From: Andrea Amorese Date: Mon, 13 Sep 2021 15:03:16 +0000 (+0200) Subject: Built motion from commit 3e8e1dcf.|2.5.35 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=b2760f80809f51f72d716bc411d4ad7e15051399;p=motion2.git Built motion from commit 3e8e1dcf.|2.5.35 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 79999d9..2a0309c 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-13T13:59:04.740Z", + "time": "2021-09-13T14:49:58.123Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 56f2dd2..b455ce8 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-13T13:59:04.740Z", + "time": "2021-09-13T14:49:58.123Z", "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 bb7b904..134ba7d 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 _0x9be3=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0x16d435,_0x5d6d2c){var _0x4f4e79=function(_0xde600e){while(--_0xde600e){_0x16d435['push'](_0x16d435['shift']());}};_0x4f4e79(++_0x5d6d2c);}(_0x9be3,0xd2));var _0x39be=function(_0x4d4576,_0x373606){_0x4d4576=_0x4d4576-0x0;var _0x437769=_0x9be3[_0x4d4576];return _0x437769;};'use strict';var Sequelize=require(_0x39be('0x0'));module[_0x39be('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17b77d){return this[_0x39be('0x2')](_0x39be('0x3'));}},'action':{'type':Sequelize[_0x39be('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x39be('0x5'),_0x39be('0x6'),_0x39be('0x7'),_0x39be('0x8'),_0x39be('0x9'),'browser',_0x39be('0xa'),_0x39be('0xb')]],'msg':_0x39be('0xc')}},'comment':_0x39be('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x39be('0xd')},'data2':{'type':Sequelize[_0x39be('0x4')](0x1000),'comment':_0x39be('0xe')},'data3':{'type':Sequelize[_0x39be('0x4')](0x1000),'comment':_0x39be('0xf')},'data4':{'type':Sequelize[_0x39be('0x4')](0x1000),'comments':_0x39be('0x10')},'data5':{'type':Sequelize[_0x39be('0x4')](0x1000),'comments':_0x39be('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0x39be('0x12')},'data7':{'type':Sequelize['TEXT'],'comments':_0x39be('0x13')}}; \ No newline at end of file +var _0x6be8=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','urlForward'];(function(_0x2b7cd1,_0x26db39){var _0x58b4f3=function(_0x18c777){while(--_0x18c777){_0x2b7cd1['push'](_0x2b7cd1['shift']());}};_0x58b4f3(++_0x26db39);}(_0x6be8,0x76));var _0x86be=function(_0x351ae1,_0x5d7aca){_0x351ae1=_0x351ae1-0x0;var _0x5e13b2=_0x6be8[_0x351ae1];return _0x5e13b2;};'use strict';var Sequelize=require(_0x86be('0x0'));module['exports']={'name':{'type':Sequelize[_0x86be('0x1')],'get':function(_0x44e38a){return this[_0x86be('0x2')]('action');}},'action':{'type':Sequelize[_0x86be('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x86be('0x4'),_0x86be('0x5'),_0x86be('0x6'),'jscripty',_0x86be('0x7'),'browser',_0x86be('0x8'),_0x86be('0x9')]],'msg':_0x86be('0xa')}},'comment':_0x86be('0xa')},'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[_0x86be('0x3')](0x1000),'comment':_0x86be('0xb')},'data3':{'type':Sequelize[_0x86be('0x3')](0x1000),'comment':_0x86be('0xc')},'data4':{'type':Sequelize[_0x86be('0x3')](0x1000),'comments':_0x86be('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x86be('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0x86be('0xf')},'data7':{'type':Sequelize[_0x86be('0x10')],'comments':_0x86be('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 8084f7a..838f916 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 _0x68c6=['end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3d0827,_0x299609){var _0x52a5d8=function(_0x214025){while(--_0x214025){_0x3d0827['push'](_0x3d0827['shift']());}};_0x52a5d8(++_0x299609);}(_0x68c6,0x166));var _0x668c=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x68c6[_0x81e39d];return _0x548fbb;};'use strict';var emlformat=require(_0x668c('0x0'));var rimraf=require(_0x668c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x668c('0x2'));var rp=require(_0x668c('0x3'));var moment=require('moment');var BPromise=require(_0x668c('0x4'));var Mustache=require(_0x668c('0x5'));var util=require(_0x668c('0x6'));var path=require(_0x668c('0x7'));var sox=require('sox');var csv=require(_0x668c('0x8'));var ejs=require(_0x668c('0x9'));var fs=require('fs');var fs_extra=require(_0x668c('0xa'));var _=require(_0x668c('0xb'));var squel=require(_0x668c('0xc'));var crypto=require(_0x668c('0xd'));var jsforce=require(_0x668c('0xe'));var deskjs=require(_0x668c('0xf'));var toCsv=require(_0x668c('0x8'));var querystring=require(_0x668c('0x10'));var Papa=require(_0x668c('0x11'));var Redis=require(_0x668c('0x12'));var authService=require(_0x668c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x668c('0x14'));var hardwareService=require(_0x668c('0x15'));var logger=require(_0x668c('0x16'))('api');var utils=require(_0x668c('0x17'));var config=require(_0x668c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x668c('0x19'))['db'];function respondWithStatusCode(_0x1efb9c,_0x10eb04){_0x10eb04=_0x10eb04||0xcc;return function(_0x4e9f77){if(_0x4e9f77){return _0x1efb9c['sendStatus'](_0x10eb04);}return _0x1efb9c['status'](_0x10eb04)[_0x668c('0x1a')]();};}function respondWithResult(_0x333038,_0x1891be){_0x1891be=_0x1891be||0xc8;return function(_0x46b513){if(_0x46b513){return _0x333038[_0x668c('0x1b')](_0x1891be)[_0x668c('0x1c')](_0x46b513);}};}function respondWithFilteredResult(_0x1a1802,_0x173dbd){return function(_0x51bef0){if(_0x51bef0){var _0x28aa9b=typeof _0x173dbd[_0x668c('0x1d')]===_0x668c('0x1e')&&typeof _0x173dbd['limit']===_0x668c('0x1e');var _0x3ff644=_0x51bef0[_0x668c('0x1f')];var _0x34314d=_0x28aa9b?0x0:_0x173dbd[_0x668c('0x1d')];var _0x6261d0=_0x28aa9b?_0x51bef0['count']:_0x173dbd[_0x668c('0x1d')]+_0x173dbd[_0x668c('0x20')];var _0x58d218;if(_0x6261d0>=_0x3ff644){_0x6261d0=_0x3ff644;_0x58d218=0xc8;}else{_0x58d218=0xce;}_0x1a1802[_0x668c('0x1b')](_0x58d218);return _0x1a1802['set']('Content-Range',_0x34314d+'-'+_0x6261d0+'/'+_0x3ff644)[_0x668c('0x1c')](_0x51bef0);}return null;};}function patchUpdates(_0x35476b){return function(_0x183cef){try{jsonpatch[_0x668c('0x21')](_0x183cef,_0x35476b,!![]);}catch(_0x5064ee){return BPromise[_0x668c('0x22')](_0x5064ee);}return _0x183cef[_0x668c('0x23')]();};}function saveUpdates(_0x5ad618,_0x13183a){return function(_0xbbbf43){if(_0xbbbf43){return _0xbbbf43[_0x668c('0x24')](_0x5ad618)[_0x668c('0x25')](function(_0x4d3f5f){return _0x4d3f5f;});}return null;};}function removeEntity(_0x522e3a,_0x74993f){return function(_0x35415e){if(_0x35415e){return _0x35415e[_0x668c('0x26')]()[_0x668c('0x25')](function(){_0x522e3a[_0x668c('0x1b')](0xcc)[_0x668c('0x1a')]();});}};}function handleEntityNotFound(_0x39aabe,_0x538940){return function(_0x9195de){if(!_0x9195de){_0x39aabe[_0x668c('0x27')](0x194);}return _0x9195de;};}function handleError(_0x17ed4f,_0x5aefdd){_0x5aefdd=_0x5aefdd||0x1f4;return function(_0x338ca6){logger['error'](_0x338ca6[_0x668c('0x28')]);if(_0x338ca6[_0x668c('0x29')]){delete _0x338ca6[_0x668c('0x29')];}_0x17ed4f[_0x668c('0x1b')](_0x5aefdd)[_0x668c('0x2a')](_0x338ca6);};}exports[_0x668c('0x24')]=function(_0x54b542,_0x57ef14){if(_0x54b542[_0x668c('0x2b')]['id']){delete _0x54b542[_0x668c('0x2b')]['id'];}return db[_0x668c('0x2c')][_0x668c('0x2d')]({'where':{'id':_0x54b542['params']['id']}})['then'](handleEntityNotFound(_0x57ef14,null))['then'](saveUpdates(_0x54b542[_0x668c('0x2b')],null))[_0x668c('0x25')](respondWithResult(_0x57ef14,null))[_0x668c('0x2e')](handleError(_0x57ef14,null));};exports[_0x668c('0x26')]=function(_0x48d0fb,_0x3eda2c){return db['Action'][_0x668c('0x2d')]({'where':{'id':_0x48d0fb[_0x668c('0x2f')]['id']}})[_0x668c('0x25')](handleEntityNotFound(_0x3eda2c,null))[_0x668c('0x25')](removeEntity(_0x3eda2c,null))[_0x668c('0x2e')](handleError(_0x3eda2c,null));}; \ No newline at end of file +var _0xcd5f=['limit','set','Content-Range','save','then','destroy','error','stack','name','send','update','Action','params','body','catch','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','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','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined'];(function(_0x38983a,_0xd83acb){var _0x2f7fda=function(_0x16dad3){while(--_0x16dad3){_0x38983a['push'](_0x38983a['shift']());}};_0x2f7fda(++_0xd83acb);}(_0xcd5f,0x6a));var _0xfcd5=function(_0x4dcba5,_0x2e19bb){_0x4dcba5=_0x4dcba5-0x0;var _0x313325=_0xcd5f[_0x4dcba5];return _0x313325;};'use strict';var emlformat=require(_0xfcd5('0x0'));var rimraf=require(_0xfcd5('0x1'));var zipdir=require(_0xfcd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfcd5('0x3'));var BPromise=require(_0xfcd5('0x4'));var Mustache=require(_0xfcd5('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfcd5('0x6'));var csv=require(_0xfcd5('0x7'));var ejs=require(_0xfcd5('0x8'));var fs=require('fs');var fs_extra=require(_0xfcd5('0x9'));var _=require(_0xfcd5('0xa'));var squel=require(_0xfcd5('0xb'));var crypto=require(_0xfcd5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfcd5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfcd5('0xe'));var Papa=require(_0xfcd5('0xf'));var Redis=require('ioredis');var authService=require(_0xfcd5('0x10'));var qs=require(_0xfcd5('0x11'));var as=require(_0xfcd5('0x12'));var hardwareService=require(_0xfcd5('0x13'));var logger=require('../../config/logger')(_0xfcd5('0x14'));var utils=require(_0xfcd5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfcd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4876d4,_0x189376){_0x189376=_0x189376||0xcc;return function(_0x1954eb){if(_0x1954eb){return _0x4876d4[_0xfcd5('0x17')](_0x189376);}return _0x4876d4['status'](_0x189376)[_0xfcd5('0x18')]();};}function respondWithResult(_0x1a27e1,_0x36a6c8){_0x36a6c8=_0x36a6c8||0xc8;return function(_0x2f6098){if(_0x2f6098){return _0x1a27e1[_0xfcd5('0x19')](_0x36a6c8)[_0xfcd5('0x1a')](_0x2f6098);}};}function respondWithFilteredResult(_0x1ccb0e,_0x5adf5e){return function(_0x382e93){if(_0x382e93){var _0x5288f4=typeof _0x5adf5e[_0xfcd5('0x1b')]===_0xfcd5('0x1c')&&typeof _0x5adf5e[_0xfcd5('0x1d')]==='undefined';var _0x47d87c=_0x382e93['count'];var _0x382e86=_0x5288f4?0x0:_0x5adf5e['offset'];var _0x2152ff=_0x5288f4?_0x382e93['count']:_0x5adf5e['offset']+_0x5adf5e[_0xfcd5('0x1d')];var _0x64c027;if(_0x2152ff>=_0x47d87c){_0x2152ff=_0x47d87c;_0x64c027=0xc8;}else{_0x64c027=0xce;}_0x1ccb0e[_0xfcd5('0x19')](_0x64c027);return _0x1ccb0e[_0xfcd5('0x1e')](_0xfcd5('0x1f'),_0x382e86+'-'+_0x2152ff+'/'+_0x47d87c)[_0xfcd5('0x1a')](_0x382e93);}return null;};}function patchUpdates(_0x332455){return function(_0x253eea){try{jsonpatch['apply'](_0x253eea,_0x332455,!![]);}catch(_0x3f6631){return BPromise['reject'](_0x3f6631);}return _0x253eea[_0xfcd5('0x20')]();};}function saveUpdates(_0x55dba8,_0x4e34b2){return function(_0x4e8e5f){if(_0x4e8e5f){return _0x4e8e5f['update'](_0x55dba8)[_0xfcd5('0x21')](function(_0x2f4c90){return _0x2f4c90;});}return null;};}function removeEntity(_0x33179b,_0x34e4e8){return function(_0x23762d){if(_0x23762d){return _0x23762d[_0xfcd5('0x22')]()['then'](function(){_0x33179b[_0xfcd5('0x19')](0xcc)[_0xfcd5('0x18')]();});}};}function handleEntityNotFound(_0x1240ce,_0xd217ce){return function(_0x4fd50a){if(!_0x4fd50a){_0x1240ce[_0xfcd5('0x17')](0x194);}return _0x4fd50a;};}function handleError(_0x73e631,_0x22e5e7){_0x22e5e7=_0x22e5e7||0x1f4;return function(_0xf509d1){logger[_0xfcd5('0x23')](_0xf509d1[_0xfcd5('0x24')]);if(_0xf509d1['name']){delete _0xf509d1[_0xfcd5('0x25')];}_0x73e631[_0xfcd5('0x19')](_0x22e5e7)[_0xfcd5('0x26')](_0xf509d1);};}exports[_0xfcd5('0x27')]=function(_0x136abe,_0x2596f4){if(_0x136abe['body']['id']){delete _0x136abe['body']['id'];}return db[_0xfcd5('0x28')]['find']({'where':{'id':_0x136abe[_0xfcd5('0x29')]['id']}})[_0xfcd5('0x21')](handleEntityNotFound(_0x2596f4,null))[_0xfcd5('0x21')](saveUpdates(_0x136abe[_0xfcd5('0x2a')],null))[_0xfcd5('0x21')](respondWithResult(_0x2596f4,null))[_0xfcd5('0x2b')](handleError(_0x2596f4,null));};exports[_0xfcd5('0x22')]=function(_0x354885,_0xa3721b){return db[_0xfcd5('0x28')][_0xfcd5('0x2c')]({'where':{'id':_0x354885[_0xfcd5('0x29')]['id']}})[_0xfcd5('0x21')](handleEntityNotFound(_0xa3721b,null))['then'](removeEntity(_0xa3721b,null))[_0xfcd5('0x2b')](handleError(_0xa3721b,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index be5e6da..9ba84a3 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 _0xe25b=['api','moment','bluebird','request-promise','rimraf','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x1837da,_0x5e3681){var _0x3b0ba2=function(_0x2ed3b6){while(--_0x2ed3b6){_0x1837da['push'](_0x1837da['shift']());}};_0x3b0ba2(++_0x5e3681);}(_0xe25b,0x129));var _0xbe25=function(_0x30be39,_0xfb49ad){_0x30be39=_0x30be39-0x0;var _0x4d99d6=_0xe25b[_0x30be39];return _0x4d99d6;};'use strict';var _=require(_0xbe25('0x0'));var util=require(_0xbe25('0x1'));var logger=require(_0xbe25('0x2'))(_0xbe25('0x3'));var moment=require(_0xbe25('0x4'));var BPromise=require(_0xbe25('0x5'));var rp=require(_0xbe25('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe25('0x7'));var config=require('../../config/environment');var attributes=require(_0xbe25('0x8'));module['exports']=function(_0xef92c9,_0x567d2c){return _0xef92c9[_0xbe25('0x9')](_0xbe25('0xa'),attributes,{'tableName':_0xbe25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03bc=['./action.attributes','exports','define','Action','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4fa40c,_0x32fcf8){var _0x389186=function(_0x266915){while(--_0x266915){_0x4fa40c['push'](_0x4fa40c['shift']());}};_0x389186(++_0x32fcf8);}(_0x03bc,0x1a8));var _0xc03b=function(_0x5d75ff,_0x5bc7ac){_0x5d75ff=_0x5d75ff-0x0;var _0x1c1894=_0x03bc[_0x5d75ff];return _0x1c1894;};'use strict';var _=require(_0xc03b('0x0'));var util=require(_0xc03b('0x1'));var logger=require('../../config/logger')(_0xc03b('0x2'));var moment=require(_0xc03b('0x3'));var BPromise=require(_0xc03b('0x4'));var rp=require(_0xc03b('0x5'));var fs=require('fs');var path=require(_0xc03b('0x6'));var rimraf=require(_0xc03b('0x7'));var config=require('../../config/environment');var attributes=require(_0xc03b('0x8'));module[_0xc03b('0x9')]=function(_0x5dfca7,_0x4ab744){return _0x5dfca7[_0xc03b('0xa')](_0xc03b('0xb'),attributes,{'tableName':'tools_actions','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 edbd371..298207e 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x5b6a47,_0x2338b9){var _0xf4a5f0=function(_0x56e498){while(--_0x56e498){_0x5b6a47['push'](_0x5b6a47['shift']());}};_0xf4a5f0(++_0x2338b9);}(_0xabce,0x103));var _0xeabc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xabce[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x212517,_0x2f737a){var _0xa6466=function(_0x1b29e7){while(--_0x1b29e7){_0x212517['push'](_0x212517['shift']());}};_0xa6466(++_0x2f737a);}(_0x1261,0x144));var _0x1126=function(_0xc45596,_0x5c410e){_0xc45596=_0xc45596-0x0;var _0x425ffe=_0x1261[_0xc45596];return _0x425ffe;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index dba6223..9c056fd 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 _0x2785=['../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2785,0x140));var _0x5278=function(_0x3ee935,_0x293a98){_0x3ee935=_0x3ee935-0x0;var _0x586db7=_0x2785[_0x3ee935];return _0x586db7;};'use strict';var multer=require(_0x5278('0x0'));var util=require(_0x5278('0x1'));var path=require('path');var timeout=require(_0x5278('0x2'));var express=require('express');var router=express[_0x5278('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5278('0x4'));var config=require(_0x5278('0x5'));var controller=require('./action.controller');router[_0x5278('0x6')](_0x5278('0x7'),auth[_0x5278('0x8')](),controller['update']);router[_0x5278('0x9')](_0x5278('0x7'),auth[_0x5278('0x8')](),controller[_0x5278('0xa')]);module[_0x5278('0xb')]=router; \ No newline at end of file +var _0x5f0c=['connect-timeout','express','fs-extra','./action.controller','put','/:id','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x5a8555,_0x4c8aa9){var _0x56fef8=function(_0x2ea160){while(--_0x2ea160){_0x5a8555['push'](_0x5a8555['shift']());}};_0x56fef8(++_0x4c8aa9);}(_0x5f0c,0xcd));var _0xc5f0=function(_0x195a12,_0x558d3c){_0x195a12=_0x195a12-0x0;var _0x5aaf55=_0x5f0c[_0x195a12];return _0x5aaf55;};'use strict';var multer=require(_0xc5f0('0x0'));var util=require(_0xc5f0('0x1'));var path=require(_0xc5f0('0x2'));var timeout=require(_0xc5f0('0x3'));var express=require(_0xc5f0('0x4'));var router=express['Router']();var fs_extra=require(_0xc5f0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc5f0('0x6'));router[_0xc5f0('0x7')](_0xc5f0('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xc5f0('0x9')](_0xc5f0('0x8'),auth[_0xc5f0('0xa')](),controller[_0xc5f0('0xb')]);module[_0xc5f0('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 83c2c62..fef43a0 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x2675,0x75));var _0x5267=function(_0x50fa04,_0xcfb27){_0x50fa04=_0x50fa04-0x0;var _0xb49bbc=_0x2675[_0x50fa04];return _0xb49bbc;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file +var _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x58b06c,_0x53ea01){var _0x4b7db8=function(_0xd151c4){while(--_0xd151c4){_0x58b06c['push'](_0x58b06c['shift']());}};_0x4b7db8(++_0x53ea01);}(_0x1883,0xab));var _0x3188=function(_0xa8fef9,_0x273f58){_0xa8fef9=_0xa8fef9-0x0;var _0x1e6c39=_0x1883[_0xa8fef9];return _0x1e6c39;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 7e01fe5..4dba350 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 _0x0a5f=['SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','IS\x20NOT\x20EMPTY','Sequelize','ValidationErrorItem','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','CustomReports','UserProfileResource','sendStatus','stack','name','send','index','fieldName','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','AnalyticCustomReport','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join'];(function(_0xdc66e7,_0x13a216){var _0x1a46af=function(_0x4a11a5){while(--_0x4a11a5){_0xdc66e7['push'](_0xdc66e7['shift']());}};_0x1a46af(++_0x13a216);}(_0x0a5f,0x192));var _0xf0a5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0a5f[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf0a5('0x0'));var rimraf=require(_0xf0a5('0x1'));var zipdir=require(_0xf0a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0a5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0a5('0x4'));var util=require(_0xf0a5('0x5'));var path=require(_0xf0a5('0x6'));var sox=require('sox');var csv=require(_0xf0a5('0x7'));var ejs=require(_0xf0a5('0x8'));var fs=require('fs');var fs_extra=require(_0xf0a5('0x9'));var _=require('lodash');var squel=require(_0xf0a5('0xa'));var crypto=require(_0xf0a5('0xb'));var jsforce=require(_0xf0a5('0xc'));var deskjs=require(_0xf0a5('0xd'));var toCsv=require(_0xf0a5('0x7'));var querystring=require(_0xf0a5('0xe'));var Papa=require(_0xf0a5('0xf'));var Redis=require(_0xf0a5('0x10'));var authService=require(_0xf0a5('0x11'));var qs=require(_0xf0a5('0x12'));var as=require(_0xf0a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf0a5('0x14'));var utils=require(_0xf0a5('0x15'));var config=require(_0xf0a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xf0a5('0x17'))['dbH'];function respondWithStatusCode(_0x465c3e,_0x2d2f37){_0x2d2f37=_0x2d2f37||0xcc;return function(_0x579b57){if(_0x579b57){return _0x465c3e['sendStatus'](_0x2d2f37);}return _0x465c3e[_0xf0a5('0x18')](_0x2d2f37)[_0xf0a5('0x19')]();};}function respondWithResult(_0x86a4c,_0x2305e6){_0x2305e6=_0x2305e6||0xc8;return function(_0x5eaaa6){if(_0x5eaaa6){return _0x86a4c[_0xf0a5('0x18')](_0x2305e6)[_0xf0a5('0x1a')](_0x5eaaa6);}};}function respondWithFilteredResult(_0xfe660e,_0x477529){return function(_0x432e4f){if(_0x432e4f){var _0x36f558=typeof _0x477529[_0xf0a5('0x1b')]===_0xf0a5('0x1c')&&typeof _0x477529[_0xf0a5('0x1d')]===_0xf0a5('0x1c');var _0x1e4b8e=_0x432e4f[_0xf0a5('0x1e')];var _0x51d9af=_0x36f558?0x0:_0x477529[_0xf0a5('0x1b')];var _0x16c654=_0x36f558?_0x432e4f['count']:_0x477529['offset']+_0x477529[_0xf0a5('0x1d')];var _0x4a7c0b;if(_0x16c654>=_0x1e4b8e){_0x16c654=_0x1e4b8e;_0x4a7c0b=0xc8;}else{_0x4a7c0b=0xce;}_0xfe660e[_0xf0a5('0x18')](_0x4a7c0b);return _0xfe660e[_0xf0a5('0x1f')](_0xf0a5('0x20'),_0x51d9af+'-'+_0x16c654+'/'+_0x1e4b8e)['json'](_0x432e4f);}return null;};}function patchUpdates(_0x4ddd15){return function(_0x541bde){try{jsonpatch[_0xf0a5('0x21')](_0x541bde,_0x4ddd15,!![]);}catch(_0x34e2a4){return BPromise[_0xf0a5('0x22')](_0x34e2a4);}return _0x541bde['save']();};}function saveUpdates(_0x51a44c,_0x2f0980){return function(_0x21d579){if(_0x21d579){return _0x21d579[_0xf0a5('0x23')](_0x51a44c)[_0xf0a5('0x24')](function(_0x415ec2){return _0x415ec2;});}return null;};}function removeEntity(_0xd8b72e,_0x150a39){return function(_0x39aaac){if(_0x39aaac){return _0x39aaac[_0xf0a5('0x25')]()[_0xf0a5('0x24')](function(){var _0x12d773=_0x39aaac['get']({'plain':!![]});var _0x5c5b6e=_0xf0a5('0x26');return db[_0xf0a5('0x27')][_0xf0a5('0x25')]({'where':{'type':_0x5c5b6e,'resourceId':_0x12d773['id']}})[_0xf0a5('0x24')](function(){return _0x39aaac;});})['then'](function(){_0xd8b72e['status'](0xcc)[_0xf0a5('0x19')]();});}};}function handleEntityNotFound(_0x2a7a4e,_0x10a156){return function(_0x1281ee){if(!_0x1281ee){_0x2a7a4e[_0xf0a5('0x28')](0x194);}return _0x1281ee;};}function handleError(_0x199260,_0x361ab2){_0x361ab2=_0x361ab2||0x1f4;return function(_0x3f3db6){logger['error'](_0x3f3db6[_0xf0a5('0x29')]);if(_0x3f3db6[_0xf0a5('0x2a')]){delete _0x3f3db6[_0xf0a5('0x2a')];}_0x199260[_0xf0a5('0x18')](_0x361ab2)[_0xf0a5('0x2b')](_0x3f3db6);};}exports[_0xf0a5('0x2c')]=function(_0x478b7e,_0x42de00){var _0x11df05={},_0x40580b={},_0x40cda8={'count':0x0,'rows':[]};var _0x4995fb=_['map'](db['AnalyticCustomReport']['rawAttributes'],function(_0x371cf2){return{'name':_0x371cf2[_0xf0a5('0x2d')],'type':_0x371cf2['type']['key']};});_0x40580b[_0xf0a5('0x2e')]=_[_0xf0a5('0x2f')](_0x4995fb,'name');_0x40580b[_0xf0a5('0x30')]=_[_0xf0a5('0x31')](_0x478b7e[_0xf0a5('0x30')]);_0x40580b['filters']=_[_0xf0a5('0x32')](_0x40580b[_0xf0a5('0x2e')],_0x40580b[_0xf0a5('0x30')]);_0x11df05[_0xf0a5('0x33')]=_[_0xf0a5('0x32')](_0x40580b[_0xf0a5('0x2e')],qs[_0xf0a5('0x34')](_0x478b7e[_0xf0a5('0x30')][_0xf0a5('0x34')]));_0x11df05['attributes']=_0x11df05[_0xf0a5('0x33')][_0xf0a5('0x35')]?_0x11df05[_0xf0a5('0x33')]:_0x40580b[_0xf0a5('0x2e')];if(!_0x478b7e['query'][_0xf0a5('0x36')](_0xf0a5('0x37'))){_0x11df05['limit']=qs[_0xf0a5('0x1d')](_0x478b7e['query'][_0xf0a5('0x1d')]);_0x11df05['offset']=qs[_0xf0a5('0x1b')](_0x478b7e[_0xf0a5('0x30')][_0xf0a5('0x1b')]);}_0x11df05[_0xf0a5('0x38')]=qs['sort'](_0x478b7e[_0xf0a5('0x30')][_0xf0a5('0x39')]);_0x11df05[_0xf0a5('0x3a')]=qs[_0xf0a5('0x3b')](_[_0xf0a5('0x3c')](_0x478b7e[_0xf0a5('0x30')],_0x40580b[_0xf0a5('0x3b')]),_0x4995fb);if(_0x478b7e[_0xf0a5('0x30')]['filter']){_0x11df05['where']=_['merge'](_0x11df05[_0xf0a5('0x3a')],{'$or':_[_0xf0a5('0x2f')](_0x4995fb,function(_0x17a7cc){if(_0x17a7cc['type']!==_0xf0a5('0x3d')){var _0x51a61b={};_0x51a61b[_0x17a7cc[_0xf0a5('0x2a')]]={'$like':'%'+_0x478b7e[_0xf0a5('0x30')]['filter']+'%'};return _0x51a61b;}})});}_0x11df05=_[_0xf0a5('0x3e')]({},_0x11df05,_0x478b7e[_0xf0a5('0x3f')]);var _0x1f503c={'where':_0x11df05[_0xf0a5('0x3a')]};return db[_0xf0a5('0x40')][_0xf0a5('0x1e')](_0x1f503c)[_0xf0a5('0x24')](function(_0x56bb8a){_0x40cda8[_0xf0a5('0x1e')]=_0x56bb8a;if(_0x478b7e[_0xf0a5('0x30')][_0xf0a5('0x41')]){_0x11df05['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xf0a5('0x42')](_0x11df05);})[_0xf0a5('0x24')](function(_0x4fe734){_0x40cda8[_0xf0a5('0x43')]=_0x4fe734;return _0x40cda8;})[_0xf0a5('0x24')](respondWithFilteredResult(_0x42de00,_0x11df05))[_0xf0a5('0x44')](handleError(_0x42de00,null));};exports['show']=function(_0x4e0555,_0xf02b75){var _0x378a09={'raw':![],'where':{'id':_0x4e0555[_0xf0a5('0x45')]['id']}},_0x10cb6e={};_0x10cb6e[_0xf0a5('0x2e')]=_[_0xf0a5('0x31')](db['AnalyticCustomReport'][_0xf0a5('0x46')]);_0x10cb6e[_0xf0a5('0x30')]=_[_0xf0a5('0x31')](_0x4e0555[_0xf0a5('0x30')]);_0x10cb6e['filters']=_['intersection'](_0x10cb6e[_0xf0a5('0x2e')],_0x10cb6e[_0xf0a5('0x30')]);_0x378a09[_0xf0a5('0x33')]=_['intersection'](_0x10cb6e[_0xf0a5('0x2e')],qs[_0xf0a5('0x34')](_0x4e0555[_0xf0a5('0x30')][_0xf0a5('0x34')]));_0x378a09[_0xf0a5('0x33')]=_0x378a09['attributes'][_0xf0a5('0x35')]?_0x378a09[_0xf0a5('0x33')]:_0x10cb6e[_0xf0a5('0x2e')];if(_0x4e0555[_0xf0a5('0x30')][_0xf0a5('0x41')]){_0x378a09[_0xf0a5('0x47')]=[{'all':!![]}];}_0x378a09=_['merge']({},_0x378a09,_0x4e0555['options']);return db[_0xf0a5('0x40')][_0xf0a5('0x48')](_0x378a09)[_0xf0a5('0x24')](handleEntityNotFound(_0xf02b75,null))[_0xf0a5('0x24')](respondWithResult(_0xf02b75,null))[_0xf0a5('0x44')](handleError(_0xf02b75,null));};exports[_0xf0a5('0x49')]=function(_0x4a1266,_0x1cd22c){return db['AnalyticCustomReport'][_0xf0a5('0x49')](_0x4a1266[_0xf0a5('0x4a')],{})['then'](function(_0x525755){var _0x36e36d=_0x4a1266[_0xf0a5('0x4b')]['get']({'plain':!![]});if(!_0x36e36d)throw new Error(_0xf0a5('0x4c'));if(_0x36e36d[_0xf0a5('0x4d')]===_0xf0a5('0x4b')){var _0x3ac758=_0x525755[_0xf0a5('0x4e')]({'plain':!![]});var _0x492334='Reports';return db[_0xf0a5('0x4f')]['find']({'where':{'name':_0x492334,'userProfileId':_0x36e36d['userProfileId']},'raw':!![]})[_0xf0a5('0x24')](function(_0x4d648f){if(_0x4d648f&&_0x4d648f['autoAssociation']===0x0){return db[_0xf0a5('0x27')][_0xf0a5('0x49')]({'name':_0x3ac758[_0xf0a5('0x2a')],'resourceId':_0x3ac758['id'],'type':_0xf0a5('0x26'),'sectionId':_0x4d648f['id']},{})[_0xf0a5('0x24')](function(){return _0x525755;});}else{return _0x525755;}})[_0xf0a5('0x44')](function(_0x5499ed){logger[_0xf0a5('0x50')](_0xf0a5('0x51'),_0x5499ed);throw _0x5499ed;});}return _0x525755;})['then'](respondWithResult(_0x1cd22c,0xc9))[_0xf0a5('0x44')](handleError(_0x1cd22c,null));};exports[_0xf0a5('0x23')]=function(_0x4585db,_0xf97337){if(_0x4585db['body']['id']){delete _0x4585db['body']['id'];}return db[_0xf0a5('0x40')][_0xf0a5('0x48')]({'where':{'id':_0x4585db['params']['id']}})['then'](handleEntityNotFound(_0xf97337,null))[_0xf0a5('0x24')](saveUpdates(_0x4585db[_0xf0a5('0x4a')],null))['then'](respondWithResult(_0xf97337,null))[_0xf0a5('0x44')](handleError(_0xf97337,null));};exports[_0xf0a5('0x25')]=function(_0x159cc9,_0x2fc8fb){return db[_0xf0a5('0x40')][_0xf0a5('0x48')]({'where':{'id':_0x159cc9[_0xf0a5('0x45')]['id']}})[_0xf0a5('0x24')](handleEntityNotFound(_0x2fc8fb,null))[_0xf0a5('0x24')](removeEntity(_0x2fc8fb,null))['catch'](handleError(_0x2fc8fb,null));};exports[_0xf0a5('0x52')]=function(_0x5c841c,_0x513473){var _0x1983b2=0xa;var _0x4dc52b=[_0xf0a5('0x53'),_0xf0a5('0x54'),_0xf0a5('0x55'),_0xf0a5('0x56')];var _0x3bff7b={'SUM':_0xf0a5('0x57'),'COUNT':_0xf0a5('0x58'),'COUNT DISTINCT':_0xf0a5('0x59'),'MAX':_0xf0a5('0x5a'),'MIN':'MIN(%s)','AVG':_0xf0a5('0x5b'),'GROUP_CONCAT':_0xf0a5('0x5c'),'GROUP_CONCAT ASC':_0xf0a5('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f4910={'SEC_TO_TIME':_0xf0a5('0x5e'),'DATE':_0xf0a5('0x5f'),'HOUR':_0xf0a5('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf0a5('0x61')};var _0x53b619=function(_0x225efa){return!_[_0xf0a5('0x62')]([_0xf0a5('0x63'),_0xf0a5('0x64'),_0xf0a5('0x65'),'IS\x20NOT\x20EMPTY'],_0x225efa);};var _0x3bc095=function(_0x332b2e){if(!_0x332b2e||!_0x332b2e[_0xf0a5('0x66')][_0xf0a5('0x35')]){return'';}for(var _0xa002ae='(',_0x580bae=0x0;_0x580bae<_0x332b2e[_0xf0a5('0x66')][_0xf0a5('0x35')];_0x580bae+=0x1){_0x580bae>0x0&&(_0xa002ae+='\x20'+_0x332b2e[_0xf0a5('0x67')]+'\x20');_0xa002ae+=_0x332b2e[_0xf0a5('0x66')][_0x580bae][_0xf0a5('0x68')]?_0x3bc095(_0x332b2e[_0xf0a5('0x66')][_0x580bae]['group']):_0x332b2e[_0xf0a5('0x66')][_0x580bae]['field']+'\x20'+_0x332b2e['rules'][_0x580bae][_0xf0a5('0x69')]+(_0x53b619(_0x332b2e[_0xf0a5('0x66')][_0x580bae][_0xf0a5('0x69')])?'\x20'+_0x332b2e[_0xf0a5('0x66')][_0x580bae][_0xf0a5('0x6a')]:'');}return _0xa002ae+')';};var _0x79e599={'where':{'id':_0x5c841c[_0xf0a5('0x45')]['id']}},_0x1b4e15,_0x588d6c,_0x21ba02,_0x36024a,_0x543a83;_0x79e599=_[_0xf0a5('0x3e')]({},_0x79e599,_0x5c841c[_0xf0a5('0x3f')]);return db[_0xf0a5('0x40')][_0xf0a5('0x48')](_0x79e599)[_0xf0a5('0x24')](function(_0x55a150){if(_0x55a150){_0x1b4e15=_0x55a150;return _0x55a150[_0xf0a5('0x6b')]();}return null;})[_0xf0a5('0x24')](function(_0x3f8f91){if(_0x3f8f91){if(!_0x3f8f91[_0xf0a5('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xf0a5('0x6c'),0x193);}_0x588d6c=_0x3f8f91;return db[_0xf0a5('0x6d')][_0xf0a5('0x42')]({'raw':!![]});}return null;})['then'](function(_0x516ecd){if(_0x516ecd){_0x21ba02=_[_0xf0a5('0x6e')](_0x516ecd,'id');var _0x553699;var _0x1fb04b=squel[_0xf0a5('0x6f')]();_0x1fb04b[_0xf0a5('0x70')](_0x1b4e15[_0xf0a5('0x71')]);for(var _0x7a67bd=0x0;_0x7a67bd<_0x588d6c['length'];_0x7a67bd+=0x1){_0x553699=_0x588d6c[_0x7a67bd][_0xf0a5('0x72')]?_0x21ba02[_0x588d6c[_0x7a67bd][_0xf0a5('0x72')]][_0xf0a5('0x73')]:_0x588d6c[_0x7a67bd][_0xf0a5('0x74')];_0x553699=_0x588d6c[_0x7a67bd][_0xf0a5('0x75')]?_[_0xf0a5('0x76')](_0x3bff7b[_0x588d6c[_0x7a67bd][_0xf0a5('0x75')]],'%s',_0x553699):_0x553699;_0x553699=_0x588d6c[_0x7a67bd][_0xf0a5('0x77')]?_[_0xf0a5('0x76')](_0x1f4910[_0x588d6c[_0x7a67bd][_0xf0a5('0x77')]],'%s',_0x553699):_0x553699;if(_0x588d6c[_0x7a67bd][_0xf0a5('0x78')]){_0x1fb04b['group'](_0x553699);}_0x588d6c[_0x7a67bd][_0xf0a5('0x79')]&&_0x1fb04b[_0xf0a5('0x38')](_0x553699,_0x588d6c[_0x7a67bd][_0xf0a5('0x79')]===_0xf0a5('0x7a')?![]:!![]);_0x1fb04b[_0xf0a5('0x74')](_0x553699,_0x588d6c[_0x7a67bd]['alias']||_0x553699);}if(_0x1b4e15[_0xf0a5('0x7b')]){_0x1b4e15[_0xf0a5('0x7b')]=JSON[_0xf0a5('0x7c')](_0x1b4e15[_0xf0a5('0x7b')]);for(var _0x5622e9=0x0;_0x5622e9<_0x1b4e15[_0xf0a5('0x7b')][_0xf0a5('0x35')];_0x5622e9+=0x1){if(_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x7d')]&&_[_0xf0a5('0x62')](_0x4dc52b,_0x1b4e15[_0xf0a5('0x7b')][_0x5622e9][_0xf0a5('0x7d')])&&_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x7e')]&&_0x1b4e15[_0xf0a5('0x7b')][_0x5622e9][_0xf0a5('0x7f')]&&_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x80')]){_0x1fb04b[_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x7d')]](_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x7f')],null,util[_0xf0a5('0x77')](_0xf0a5('0x81'),_0x1b4e15['table'],_0x1b4e15[_0xf0a5('0x7b')][_0x5622e9][_0xf0a5('0x7e')],_0x1b4e15['joins'][_0x5622e9]['foreignTable'],_0x1b4e15[_0xf0a5('0x7b')][_0x5622e9]['foreignKey']));}}}if(_0x1b4e15[_0xf0a5('0x82')]){_0x1b4e15[_0xf0a5('0x82')]=JSON[_0xf0a5('0x7c')](_0x1b4e15[_0xf0a5('0x82')]);_0x1fb04b['where'](_0x3bc095(_0x1b4e15[_0xf0a5('0x82')][_0xf0a5('0x68')]));}_0x543a83=_0x1fb04b[_0xf0a5('0x83')]();_0x1fb04b['limit'](_0x1983b2);_0x1fb04b[_0xf0a5('0x1b')](0x0);logger[_0xf0a5('0x84')](_0xf0a5('0x85'),_0x1fb04b[_0xf0a5('0x86')]());return dbH['sequelize']['query'](_0x1fb04b[_0xf0a5('0x86')](),{'type':dbH[_0xf0a5('0x87')][_0xf0a5('0x88')][_0xf0a5('0x89')]});}})[_0xf0a5('0x24')](respondWithResult(_0x513473,null))['catch'](handleError(_0x513473,null));};function runReport(_0x4f4899,_0x169316,_0x4462c0){var _0x2d0718=_0x169316[_0xf0a5('0x2a')];var _0x299c0b=0xa;var _0x52e585=[_0xf0a5('0x53'),_0xf0a5('0x54'),_0xf0a5('0x55'),_0xf0a5('0x56')];var _0x44deb0={'SUM':_0xf0a5('0x57'),'COUNT':_0xf0a5('0x58'),'COUNT DISTINCT':_0xf0a5('0x59'),'MAX':_0xf0a5('0x5a'),'MIN':_0xf0a5('0x8a'),'AVG':_0xf0a5('0x5b'),'GROUP_CONCAT':_0xf0a5('0x5c'),'GROUP_CONCAT ASC':_0xf0a5('0x5d'),'GROUP_CONCAT DESC':_0xf0a5('0x8b')};var _0x5b13eb={'SEC_TO_TIME':_0xf0a5('0x5e'),'DATE':_0xf0a5('0x5f'),'HOUR':_0xf0a5('0x60'),'ROUND':_0xf0a5('0x8c'),'UNIX_TIMESTAMP':_0xf0a5('0x61')};var _0x466b55=function(_0x1aea53){return!_[_0xf0a5('0x62')]([_0xf0a5('0x63'),_0xf0a5('0x64'),_0xf0a5('0x65'),_0xf0a5('0x8d')],_0x1aea53);};var _0x2f63f2=function(_0x173a39){if(!_0x173a39||!_0x173a39['rules'][_0xf0a5('0x35')]){return'';}for(var _0x337ecc='(',_0x18c2b4=0x0;_0x18c2b4<_0x173a39[_0xf0a5('0x66')][_0xf0a5('0x35')];_0x18c2b4+=0x1){_0x18c2b4>0x0&&(_0x337ecc+='\x20'+_0x173a39[_0xf0a5('0x67')]+'\x20');_0x337ecc+=_0x173a39[_0xf0a5('0x66')][_0x18c2b4][_0xf0a5('0x68')]?_0x2f63f2(_0x173a39[_0xf0a5('0x66')][_0x18c2b4][_0xf0a5('0x68')]):_0x173a39[_0xf0a5('0x66')][_0x18c2b4][_0xf0a5('0x74')]+'\x20'+_0x173a39['rules'][_0x18c2b4][_0xf0a5('0x69')]+(_0x466b55(_0x173a39['rules'][_0x18c2b4][_0xf0a5('0x69')])?'\x20'+_0x173a39[_0xf0a5('0x66')][_0x18c2b4][_0xf0a5('0x6a')]:'');}return _0x337ecc+')';};var _0x37a619={'where':{'id':_0x4f4899['id']}},_0x1f7954,_0x25c362,_0x130c9a,_0x1b6ea7,_0x5b40a4;_0x37a619=_[_0xf0a5('0x3e')]({},_0x37a619,_0x4462c0);return db['AnalyticCustomReport'][_0xf0a5('0x48')](_0x37a619)[_0xf0a5('0x24')](function(_0x30d62a){if(_0x30d62a){_0x1f7954=_0x30d62a;return _0x30d62a[_0xf0a5('0x6b')]();}return null;})[_0xf0a5('0x24')](function(_0x3adad8){if(_0x3adad8){if(!_0x3adad8[_0xf0a5('0x35')]){throw new db[(_0xf0a5('0x8e'))][(_0xf0a5('0x8f'))](_0xf0a5('0x6c'),0x193);}_0x25c362=_0x3adad8;return db[_0xf0a5('0x6d')][_0xf0a5('0x42')]({'raw':!![]});}return null;})[_0xf0a5('0x24')](function(_0x2f40ef){if(_0x2f40ef){_0x130c9a=_[_0xf0a5('0x6e')](_0x2f40ef,'id');var _0x1d56e9;var _0x29a3ec=squel[_0xf0a5('0x6f')]();_0x29a3ec[_0xf0a5('0x70')](_0x1f7954[_0xf0a5('0x71')]);for(var _0x2a3c90=0x0;_0x2a3c90<_0x25c362[_0xf0a5('0x35')];_0x2a3c90+=0x1){_0x1d56e9=_0x25c362[_0x2a3c90]['MetricId']?_0x130c9a[_0x25c362[_0x2a3c90][_0xf0a5('0x72')]][_0xf0a5('0x73')]:_0x25c362[_0x2a3c90][_0xf0a5('0x74')];_0x1d56e9=_0x25c362[_0x2a3c90][_0xf0a5('0x75')]?_[_0xf0a5('0x76')](_0x44deb0[_0x25c362[_0x2a3c90][_0xf0a5('0x75')]],'%s',_0x1d56e9):_0x1d56e9;_0x1d56e9=_0x25c362[_0x2a3c90][_0xf0a5('0x77')]?_[_0xf0a5('0x76')](_0x5b13eb[_0x25c362[_0x2a3c90][_0xf0a5('0x77')]],'%s',_0x1d56e9):_0x1d56e9;if(_0x25c362[_0x2a3c90][_0xf0a5('0x78')]){_0x29a3ec[_0xf0a5('0x68')](_0x1d56e9);}_0x25c362[_0x2a3c90]['orderBy']&&_0x29a3ec[_0xf0a5('0x38')](_0x1d56e9,_0x25c362[_0x2a3c90]['orderBy']===_0xf0a5('0x7a')?![]:!![]);_0x29a3ec[_0xf0a5('0x74')](_0x1d56e9,_0x25c362[_0x2a3c90][_0xf0a5('0x90')]||_0x1d56e9);}if(_0x1f7954[_0xf0a5('0x7b')]){_0x1f7954['joins']=JSON[_0xf0a5('0x7c')](_0x1f7954[_0xf0a5('0x7b')]);for(var _0x590db6=0x0;_0x590db6<_0x1f7954[_0xf0a5('0x7b')][_0xf0a5('0x35')];_0x590db6+=0x1){if(_0x1f7954['joins'][_0x590db6][_0xf0a5('0x7d')]&&_[_0xf0a5('0x62')](_0x52e585,_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7d')])&&_0x1f7954['joins'][_0x590db6][_0xf0a5('0x7e')]&&_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7f')]&&_0x1f7954['joins'][_0x590db6][_0xf0a5('0x80')]){_0x29a3ec[_0x1f7954[_0xf0a5('0x7b')][_0x590db6]['type']](_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7f')],null,util[_0xf0a5('0x77')](_0xf0a5('0x81'),_0x1f7954[_0xf0a5('0x71')],_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7e')],_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7f')],_0x1f7954[_0xf0a5('0x7b')][_0x590db6]['foreignKey']));}}}if(_0x1f7954[_0xf0a5('0x82')]){_0x1f7954[_0xf0a5('0x82')]=JSON[_0xf0a5('0x7c')](_0x1f7954[_0xf0a5('0x82')]);_0x29a3ec[_0xf0a5('0x3a')](_0x2f63f2(_0x1f7954[_0xf0a5('0x82')]['group']));}_0x5b40a4=_0x29a3ec[_0xf0a5('0x83')]();_0x29a3ec[_0xf0a5('0x1d')](_0x299c0b);_0x29a3ec['offset'](0x0);return;}})[_0xf0a5('0x24')](function(){if(_0x169316[_0xf0a5('0x91')]===_0xf0a5('0x92')){return null;}var _0x23a7ec=_[_0xf0a5('0x3e')](_0x169316,{'name':_0x169316[_0xf0a5('0x93')]||_0x169316[_0xf0a5('0x2a')]||_0x1f7954[_0xf0a5('0x2a')],'basename':_0x2d0718,'savename':util[_0xf0a5('0x77')](_0xf0a5('0x94'),_0x169316[_0xf0a5('0x2a')]||_0x1f7954[_0xf0a5('0x2a')],require(_0xf0a5('0x95'))[_0xf0a5('0x96')](0x4),_0x169316[_0xf0a5('0x91')]||'csv'),'reportId':_0x1f7954['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xf0a5('0x49')](_0x23a7ec,{'raw':!![]});})[_0xf0a5('0x24')](function(_0x255ba9){if(_0x1f7954[_0xf0a5('0x71')]===_0xf0a5('0x97')){_0x5b40a4[_0xf0a5('0x3a')](_0x1f7954['table']+_0xf0a5('0x98'),_0x169316['startDate'],_0x169316['endDate']);}else{_0x5b40a4[_0xf0a5('0x3a')](_0x1f7954[_0xf0a5('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x169316['startDate'],_0x169316[_0xf0a5('0x99')]);}if(_0x255ba9){logger['info'](_0xf0a5('0x9a'),_0x5b40a4[_0xf0a5('0x86')]());require(_0xf0a5('0x9b'))[_0xf0a5('0x9c')](path[_0xf0a5('0x53')](__dirname,_0xf0a5('0x9d'),_0x255ba9['output']),[_0x255ba9['id'],_0x5b40a4[_0xf0a5('0x86')](),path[_0xf0a5('0x53')](__dirname,'../../files/reports',_0x255ba9[_0xf0a5('0x9e')]),_0x2d0718]);return _0x255ba9;}else{var _0x3723ec=squel[_0xf0a5('0x6f')]();_0x3723ec[_0xf0a5('0x70')]('('+_0x5b40a4[_0xf0a5('0x86')]()+')',_0xf0a5('0x9f'));_0x3723ec[_0xf0a5('0x74')](_0xf0a5('0xa0'),_0xf0a5('0x1e'));_0x5b40a4[_0xf0a5('0x1d')](_0x169316[_0xf0a5('0x1d')]||_0x299c0b);_0x5b40a4['offset'](_0x169316[_0xf0a5('0x1b')]||0x0);return dbH[_0xf0a5('0x87')][_0xf0a5('0x30')](_0x3723ec[_0xf0a5('0x86')](),{'type':dbH['sequelize'][_0xf0a5('0x88')][_0xf0a5('0x89')]})[_0xf0a5('0x24')](function(_0x42b85a){if(!_0x42b85a[_0xf0a5('0x35')]){_0x1b6ea7=0x0;}else{_0x1b6ea7=_0x42b85a[0x0][_0xf0a5('0x1e')]||0x0;}return dbH[_0xf0a5('0x87')][_0xf0a5('0x30')](_0x5b40a4[_0xf0a5('0x86')](),{'type':dbH[_0xf0a5('0x87')][_0xf0a5('0x88')][_0xf0a5('0x89')]});})[_0xf0a5('0x24')](function(_0x48958c){return{'rows':_0x48958c||[],'count':_0x1b6ea7};});}});}exports[_0xf0a5('0xa1')]=function(_0x6e64d0,_0x105614){return runReport(_0x6e64d0['params'],_0x6e64d0[_0xf0a5('0x30')],_0x6e64d0[_0xf0a5('0x3f')])[_0xf0a5('0x24')](respondWithResult(_0x105614,null))[_0xf0a5('0x44')](handleError(_0x105614,null));};exports[_0xf0a5('0xa2')]=runReport;exports[_0xf0a5('0x30')]=function(_0x6a5cde,_0x40b990){var _0x2b26a3=0xa;var _0x36c376=[_0xf0a5('0x53'),'left_join','right_join',_0xf0a5('0x56')];var _0x4bb581={'SUM':_0xf0a5('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf0a5('0x59'),'MAX':_0xf0a5('0x5a'),'MIN':_0xf0a5('0x8a'),'AVG':_0xf0a5('0x5b'),'GROUP_CONCAT':_0xf0a5('0x5c'),'GROUP_CONCAT ASC':_0xf0a5('0x5d'),'GROUP_CONCAT DESC':_0xf0a5('0x8b')};var _0x5b8673={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xf0a5('0x60'),'ROUND':_0xf0a5('0x8c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1fdafe=function(_0x5c137b){return!_[_0xf0a5('0x62')]([_0xf0a5('0x63'),_0xf0a5('0x64'),'IS\x20EMPTY',_0xf0a5('0x8d')],_0x5c137b);};var _0x5dc200=function(_0x3d39aa){if(!_0x3d39aa||!_0x3d39aa[_0xf0a5('0x66')][_0xf0a5('0x35')]){return'';}for(var _0x277a78='(',_0x232f4e=0x0;_0x232f4e<_0x3d39aa['rules'][_0xf0a5('0x35')];_0x232f4e+=0x1){_0x232f4e>0x0&&(_0x277a78+='\x20'+_0x3d39aa[_0xf0a5('0x67')]+'\x20');_0x277a78+=_0x3d39aa['rules'][_0x232f4e]['group']?_0x5dc200(_0x3d39aa[_0xf0a5('0x66')][_0x232f4e][_0xf0a5('0x68')]):_0x3d39aa[_0xf0a5('0x66')][_0x232f4e][_0xf0a5('0x74')]+'\x20'+_0x3d39aa[_0xf0a5('0x66')][_0x232f4e]['condition']+(_0x1fdafe(_0x3d39aa[_0xf0a5('0x66')][_0x232f4e][_0xf0a5('0x69')])?'\x20'+_0x3d39aa[_0xf0a5('0x66')][_0x232f4e][_0xf0a5('0x6a')]:'');}return _0x277a78+')';};var _0x5a6297={'where':{'id':_0x6a5cde[_0xf0a5('0x45')]['id']}},_0x583898,_0x42f772,_0x370a41,_0x29da40,_0x12445b;_0x5a6297=_[_0xf0a5('0x3e')]({},_0x5a6297,_0x6a5cde[_0xf0a5('0x3f')]);return db[_0xf0a5('0x40')]['find'](_0x5a6297)['then'](function(_0x54a269){if(_0x54a269){_0x583898=_0x54a269;return _0x54a269[_0xf0a5('0x6b')]();}return null;})[_0xf0a5('0x24')](function(_0x213b8f){if(_0x213b8f){if(!_0x213b8f[_0xf0a5('0x35')]){throw new db[(_0xf0a5('0x8e'))][(_0xf0a5('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x42f772=_0x213b8f;return db['AnalyticMetric'][_0xf0a5('0x42')]({'raw':!![]});}return null;})[_0xf0a5('0x24')](function(_0x3a223a){if(_0x3a223a){_0x370a41=_['keyBy'](_0x3a223a,'id');var _0x3d4976;var _0x101a2b=squel[_0xf0a5('0x6f')]();_0x101a2b['from'](_0x583898['table']);for(var _0x3cd58b=0x0;_0x3cd58b<_0x42f772[_0xf0a5('0x35')];_0x3cd58b+=0x1){_0x3d4976=_0x42f772[_0x3cd58b][_0xf0a5('0x72')]?_0x370a41[_0x42f772[_0x3cd58b][_0xf0a5('0x72')]]['metric']:_0x42f772[_0x3cd58b][_0xf0a5('0x74')];_0x3d4976=_0x42f772[_0x3cd58b]['function']?_['replace'](_0x4bb581[_0x42f772[_0x3cd58b][_0xf0a5('0x75')]],'%s',_0x3d4976):_0x3d4976;_0x3d4976=_0x42f772[_0x3cd58b][_0xf0a5('0x77')]?_[_0xf0a5('0x76')](_0x5b8673[_0x42f772[_0x3cd58b][_0xf0a5('0x77')]],'%s',_0x3d4976):_0x3d4976;if(_0x42f772[_0x3cd58b][_0xf0a5('0x78')]){_0x101a2b[_0xf0a5('0x68')](_0x3d4976);}_0x42f772[_0x3cd58b][_0xf0a5('0x79')]&&_0x101a2b[_0xf0a5('0x38')](_0x3d4976,_0x42f772[_0x3cd58b]['orderBy']===_0xf0a5('0x7a')?![]:!![]);_0x101a2b[_0xf0a5('0x74')](_0x3d4976,_0x42f772[_0x3cd58b][_0xf0a5('0x90')]||_0x3d4976);}if(_0x583898[_0xf0a5('0x7b')]){_0x583898[_0xf0a5('0x7b')]=JSON[_0xf0a5('0x7c')](_0x583898[_0xf0a5('0x7b')]);for(var _0x213fa4=0x0;_0x213fa4<_0x583898['joins'][_0xf0a5('0x35')];_0x213fa4+=0x1){if(_0x583898['joins'][_0x213fa4][_0xf0a5('0x7d')]&&_['includes'](_0x36c376,_0x583898['joins'][_0x213fa4][_0xf0a5('0x7d')])&&_0x583898[_0xf0a5('0x7b')][_0x213fa4][_0xf0a5('0x7e')]&&_0x583898[_0xf0a5('0x7b')][_0x213fa4]['foreignTable']&&_0x583898[_0xf0a5('0x7b')][_0x213fa4][_0xf0a5('0x80')]){_0x101a2b[_0x583898[_0xf0a5('0x7b')][_0x213fa4]['type']](_0x583898['joins'][_0x213fa4][_0xf0a5('0x7f')],null,util[_0xf0a5('0x77')](_0xf0a5('0x81'),_0x583898[_0xf0a5('0x71')],_0x583898[_0xf0a5('0x7b')][_0x213fa4][_0xf0a5('0x7e')],_0x583898['joins'][_0x213fa4]['foreignTable'],_0x583898['joins'][_0x213fa4][_0xf0a5('0x80')]));}}}if(_0x583898[_0xf0a5('0x82')]){_0x583898[_0xf0a5('0x82')]=JSON[_0xf0a5('0x7c')](_0x583898[_0xf0a5('0x82')]);_0x101a2b[_0xf0a5('0x3a')](_0x5dc200(_0x583898[_0xf0a5('0x82')][_0xf0a5('0x68')]));}_0x12445b=_0x101a2b[_0xf0a5('0x83')]();_0x101a2b[_0xf0a5('0x1d')](_0x2b26a3);_0x101a2b[_0xf0a5('0x1b')](0x0);logger[_0xf0a5('0x84')](_0xf0a5('0x85'),_0x101a2b[_0xf0a5('0x86')]());return dbH[_0xf0a5('0x87')][_0xf0a5('0x30')](_0x101a2b['toString'](),{'type':dbH[_0xf0a5('0x87')][_0xf0a5('0x88')][_0xf0a5('0x89')]});}})[_0xf0a5('0x24')](function(){return{'sql':_0x12445b['toString']()};})[_0xf0a5('0x24')](respondWithResult(_0x40b990,null))[_0xf0a5('0x44')](handleError(_0x40b990,null));}; \ No newline at end of file +var _0xe04a=['pick','merge','type','filter','include','rows','catch','show','params','rawAttributes','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','select','from','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','left_join','cross_join','DATE(%s)','ROUND(%s)','IS\x20EMPTY','AnalyticMetric','keyBy','groupBy','DESC','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','QueryTypes','run','runReport','right_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters'];(function(_0x4d1536,_0x146875){var _0x17ce2c=function(_0x4b0c03){while(--_0x4b0c03){_0x4d1536['push'](_0x4d1536['shift']());}};_0x17ce2c(++_0x146875);}(_0xe04a,0x10f));var _0xae04=function(_0x556bd0,_0x310258){_0x556bd0=_0x556bd0-0x0;var _0xd63243=_0xe04a[_0x556bd0];return _0xd63243;};'use strict';var emlformat=require(_0xae04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae04('0x1'));var jsonpatch=require(_0xae04('0x2'));var rp=require(_0xae04('0x3'));var moment=require(_0xae04('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xae04('0x5'));var util=require(_0xae04('0x6'));var path=require(_0xae04('0x7'));var sox=require('sox');var csv=require(_0xae04('0x8'));var ejs=require(_0xae04('0x9'));var fs=require('fs');var fs_extra=require(_0xae04('0xa'));var _=require(_0xae04('0xb'));var squel=require(_0xae04('0xc'));var crypto=require(_0xae04('0xd'));var jsforce=require(_0xae04('0xe'));var deskjs=require(_0xae04('0xf'));var toCsv=require(_0xae04('0x8'));var querystring=require(_0xae04('0x10'));var Papa=require('papaparse');var Redis=require(_0xae04('0x11'));var authService=require(_0xae04('0x12'));var qs=require(_0xae04('0x13'));var as=require(_0xae04('0x14'));var hardwareService=require(_0xae04('0x15'));var logger=require('../../config/logger')(_0xae04('0x16'));var utils=require(_0xae04('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xae04('0x18'));var db=require(_0xae04('0x19'))['db'];var dbH=require(_0xae04('0x19'))[_0xae04('0x1a')];function respondWithStatusCode(_0x24c1a9,_0x115852){_0x115852=_0x115852||0xcc;return function(_0x316ca6){if(_0x316ca6){return _0x24c1a9[_0xae04('0x1b')](_0x115852);}return _0x24c1a9['status'](_0x115852)[_0xae04('0x1c')]();};}function respondWithResult(_0x177830,_0x133c7b){_0x133c7b=_0x133c7b||0xc8;return function(_0x4ed01a){if(_0x4ed01a){return _0x177830[_0xae04('0x1d')](_0x133c7b)['json'](_0x4ed01a);}};}function respondWithFilteredResult(_0x588bfa,_0x17d5e2){return function(_0x1c2a32){if(_0x1c2a32){var _0x1db557=typeof _0x17d5e2['offset']===_0xae04('0x1e')&&typeof _0x17d5e2[_0xae04('0x1f')]==='undefined';var _0x7c401c=_0x1c2a32[_0xae04('0x20')];var _0x3b861f=_0x1db557?0x0:_0x17d5e2[_0xae04('0x21')];var _0x55e925=_0x1db557?_0x1c2a32[_0xae04('0x20')]:_0x17d5e2[_0xae04('0x21')]+_0x17d5e2[_0xae04('0x1f')];var _0x4792fe;if(_0x55e925>=_0x7c401c){_0x55e925=_0x7c401c;_0x4792fe=0xc8;}else{_0x4792fe=0xce;}_0x588bfa[_0xae04('0x1d')](_0x4792fe);return _0x588bfa['set'](_0xae04('0x22'),_0x3b861f+'-'+_0x55e925+'/'+_0x7c401c)[_0xae04('0x23')](_0x1c2a32);}return null;};}function patchUpdates(_0x3f64d2){return function(_0x38d6fa){try{jsonpatch[_0xae04('0x24')](_0x38d6fa,_0x3f64d2,!![]);}catch(_0x38fe38){return BPromise[_0xae04('0x25')](_0x38fe38);}return _0x38d6fa[_0xae04('0x26')]();};}function saveUpdates(_0x4214e6,_0xe6a4ed){return function(_0x12bdd1){if(_0x12bdd1){return _0x12bdd1[_0xae04('0x27')](_0x4214e6)['then'](function(_0x3da1fb){return _0x3da1fb;});}return null;};}function removeEntity(_0x4ae87d,_0x44fa3e){return function(_0x29e447){if(_0x29e447){return _0x29e447[_0xae04('0x28')]()[_0xae04('0x29')](function(){var _0x3f6451=_0x29e447[_0xae04('0x2a')]({'plain':!![]});var _0x28ceda=_0xae04('0x2b');return db[_0xae04('0x2c')]['destroy']({'where':{'type':_0x28ceda,'resourceId':_0x3f6451['id']}})[_0xae04('0x29')](function(){return _0x29e447;});})['then'](function(){_0x4ae87d[_0xae04('0x1d')](0xcc)[_0xae04('0x1c')]();});}};}function handleEntityNotFound(_0x228ff7,_0x136235){return function(_0xee4d71){if(!_0xee4d71){_0x228ff7[_0xae04('0x1b')](0x194);}return _0xee4d71;};}function handleError(_0x25ce75,_0xba6a11){_0xba6a11=_0xba6a11||0x1f4;return function(_0x309ca4){logger[_0xae04('0x2d')](_0x309ca4[_0xae04('0x2e')]);if(_0x309ca4[_0xae04('0x2f')]){delete _0x309ca4[_0xae04('0x2f')];}_0x25ce75['status'](_0xba6a11)[_0xae04('0x30')](_0x309ca4);};}exports[_0xae04('0x31')]=function(_0x55fd15,_0xf71d2){var _0x1819ad={},_0x3340ab={},_0x21971c={'count':0x0,'rows':[]};var _0x55f1cb=_[_0xae04('0x32')](db[_0xae04('0x33')]['rawAttributes'],function(_0x15adf3){return{'name':_0x15adf3[_0xae04('0x34')],'type':_0x15adf3['type'][_0xae04('0x35')]};});_0x3340ab[_0xae04('0x36')]=_[_0xae04('0x32')](_0x55f1cb,_0xae04('0x2f'));_0x3340ab[_0xae04('0x37')]=_[_0xae04('0x38')](_0x55fd15[_0xae04('0x37')]);_0x3340ab['filters']=_[_0xae04('0x39')](_0x3340ab['model'],_0x3340ab['query']);_0x1819ad[_0xae04('0x3a')]=_[_0xae04('0x39')](_0x3340ab[_0xae04('0x36')],qs['fields'](_0x55fd15[_0xae04('0x37')][_0xae04('0x3b')]));_0x1819ad[_0xae04('0x3a')]=_0x1819ad[_0xae04('0x3a')][_0xae04('0x3c')]?_0x1819ad['attributes']:_0x3340ab[_0xae04('0x36')];if(!_0x55fd15[_0xae04('0x37')]['hasOwnProperty']('nolimit')){_0x1819ad[_0xae04('0x1f')]=qs[_0xae04('0x1f')](_0x55fd15[_0xae04('0x37')][_0xae04('0x1f')]);_0x1819ad[_0xae04('0x21')]=qs[_0xae04('0x21')](_0x55fd15[_0xae04('0x37')][_0xae04('0x21')]);}_0x1819ad[_0xae04('0x3d')]=qs[_0xae04('0x3e')](_0x55fd15[_0xae04('0x37')]['sort']);_0x1819ad[_0xae04('0x3f')]=qs[_0xae04('0x40')](_[_0xae04('0x41')](_0x55fd15[_0xae04('0x37')],_0x3340ab[_0xae04('0x40')]),_0x55f1cb);if(_0x55fd15[_0xae04('0x37')]['filter']){_0x1819ad[_0xae04('0x3f')]=_[_0xae04('0x42')](_0x1819ad[_0xae04('0x3f')],{'$or':_[_0xae04('0x32')](_0x55f1cb,function(_0x43b06d){if(_0x43b06d[_0xae04('0x43')]!=='VIRTUAL'){var _0x3ebcaf={};_0x3ebcaf[_0x43b06d['name']]={'$like':'%'+_0x55fd15[_0xae04('0x37')][_0xae04('0x44')]+'%'};return _0x3ebcaf;}})});}_0x1819ad=_['merge']({},_0x1819ad,_0x55fd15['options']);var _0x4f40c0={'where':_0x1819ad[_0xae04('0x3f')]};return db[_0xae04('0x33')]['count'](_0x4f40c0)[_0xae04('0x29')](function(_0x41212f){_0x21971c[_0xae04('0x20')]=_0x41212f;if(_0x55fd15[_0xae04('0x37')]['includeAll']){_0x1819ad[_0xae04('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x1819ad);})[_0xae04('0x29')](function(_0x55e01c){_0x21971c[_0xae04('0x46')]=_0x55e01c;return _0x21971c;})[_0xae04('0x29')](respondWithFilteredResult(_0xf71d2,_0x1819ad))[_0xae04('0x47')](handleError(_0xf71d2,null));};exports[_0xae04('0x48')]=function(_0x3b5456,_0xacd48d){var _0x480753={'raw':![],'where':{'id':_0x3b5456[_0xae04('0x49')]['id']}},_0x8064fa={};_0x8064fa[_0xae04('0x36')]=_[_0xae04('0x38')](db[_0xae04('0x33')][_0xae04('0x4a')]);_0x8064fa['query']=_[_0xae04('0x38')](_0x3b5456[_0xae04('0x37')]);_0x8064fa[_0xae04('0x40')]=_[_0xae04('0x39')](_0x8064fa['model'],_0x8064fa[_0xae04('0x37')]);_0x480753['attributes']=_[_0xae04('0x39')](_0x8064fa[_0xae04('0x36')],qs[_0xae04('0x3b')](_0x3b5456['query'][_0xae04('0x3b')]));_0x480753[_0xae04('0x3a')]=_0x480753[_0xae04('0x3a')][_0xae04('0x3c')]?_0x480753[_0xae04('0x3a')]:_0x8064fa[_0xae04('0x36')];if(_0x3b5456['query'][_0xae04('0x4b')]){_0x480753[_0xae04('0x45')]=[{'all':!![]}];}_0x480753=_['merge']({},_0x480753,_0x3b5456[_0xae04('0x4c')]);return db[_0xae04('0x33')]['find'](_0x480753)[_0xae04('0x29')](handleEntityNotFound(_0xacd48d,null))[_0xae04('0x29')](respondWithResult(_0xacd48d,null))[_0xae04('0x47')](handleError(_0xacd48d,null));};exports[_0xae04('0x4d')]=function(_0x3b0139,_0x4d3871){return db[_0xae04('0x33')]['create'](_0x3b0139['body'],{})[_0xae04('0x29')](function(_0x31aaa4){var _0x14dc1c=_0x3b0139[_0xae04('0x4e')][_0xae04('0x2a')]({'plain':!![]});if(!_0x14dc1c)throw new Error(_0xae04('0x4f'));if(_0x14dc1c['role']===_0xae04('0x4e')){var _0x57ed49=_0x31aaa4[_0xae04('0x2a')]({'plain':!![]});var _0x1c3e12='Reports';return db[_0xae04('0x50')][_0xae04('0x51')]({'where':{'name':_0x1c3e12,'userProfileId':_0x14dc1c['userProfileId']},'raw':!![]})[_0xae04('0x29')](function(_0xe721ea){if(_0xe721ea&&_0xe721ea[_0xae04('0x52')]===0x0){return db['UserProfileResource'][_0xae04('0x4d')]({'name':_0x57ed49[_0xae04('0x2f')],'resourceId':_0x57ed49['id'],'type':_0xae04('0x2b'),'sectionId':_0xe721ea['id']},{})['then'](function(){return _0x31aaa4;});}else{return _0x31aaa4;}})[_0xae04('0x47')](function(_0x4d8d8a){logger[_0xae04('0x2d')](_0xae04('0x53'),_0x4d8d8a);throw _0x4d8d8a;});}return _0x31aaa4;})[_0xae04('0x29')](respondWithResult(_0x4d3871,0xc9))[_0xae04('0x47')](handleError(_0x4d3871,null));};exports[_0xae04('0x27')]=function(_0x16b431,_0x48325d){if(_0x16b431[_0xae04('0x54')]['id']){delete _0x16b431[_0xae04('0x54')]['id'];}return db[_0xae04('0x33')][_0xae04('0x51')]({'where':{'id':_0x16b431[_0xae04('0x49')]['id']}})[_0xae04('0x29')](handleEntityNotFound(_0x48325d,null))[_0xae04('0x29')](saveUpdates(_0x16b431[_0xae04('0x54')],null))[_0xae04('0x29')](respondWithResult(_0x48325d,null))[_0xae04('0x47')](handleError(_0x48325d,null));};exports['destroy']=function(_0x22b4d6,_0x3d152){return db[_0xae04('0x33')][_0xae04('0x51')]({'where':{'id':_0x22b4d6[_0xae04('0x49')]['id']}})[_0xae04('0x29')](handleEntityNotFound(_0x3d152,null))['then'](removeEntity(_0x3d152,null))['catch'](handleError(_0x3d152,null));};exports[_0xae04('0x55')]=function(_0xd4f50c,_0x2fd8e6){var _0xe4bcfa=0xa;var _0x284571=[_0xae04('0x56'),'left_join','right_join','cross_join'];var _0x851256={'SUM':_0xae04('0x57'),'COUNT':_0xae04('0x58'),'COUNT DISTINCT':_0xae04('0x59'),'MAX':_0xae04('0x5a'),'MIN':_0xae04('0x5b'),'AVG':_0xae04('0x5c'),'GROUP_CONCAT':_0xae04('0x5d'),'GROUP_CONCAT ASC':_0xae04('0x5e'),'GROUP_CONCAT DESC':_0xae04('0x5f')};var _0x43bb48={'SEC_TO_TIME':_0xae04('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4841ac=function(_0x25204d){return!_[_0xae04('0x61')]([_0xae04('0x62'),_0xae04('0x63'),'IS\x20EMPTY',_0xae04('0x64')],_0x25204d);};var _0x309c74=function(_0x44dab4){if(!_0x44dab4||!_0x44dab4['rules']['length']){return'';}for(var _0x406b0d='(',_0x13dd67=0x0;_0x13dd67<_0x44dab4[_0xae04('0x65')]['length'];_0x13dd67+=0x1){_0x13dd67>0x0&&(_0x406b0d+='\x20'+_0x44dab4[_0xae04('0x66')]+'\x20');_0x406b0d+=_0x44dab4['rules'][_0x13dd67][_0xae04('0x67')]?_0x309c74(_0x44dab4[_0xae04('0x65')][_0x13dd67]['group']):_0x44dab4['rules'][_0x13dd67][_0xae04('0x68')]+'\x20'+_0x44dab4[_0xae04('0x65')][_0x13dd67][_0xae04('0x69')]+(_0x4841ac(_0x44dab4['rules'][_0x13dd67][_0xae04('0x69')])?'\x20'+_0x44dab4[_0xae04('0x65')][_0x13dd67][_0xae04('0x6a')]:'');}return _0x406b0d+')';};var _0x4371bd={'where':{'id':_0xd4f50c[_0xae04('0x49')]['id']}},_0x37cae4,_0x224bbe,_0x12e96f,_0x33346b,_0x146912;_0x4371bd=_[_0xae04('0x42')]({},_0x4371bd,_0xd4f50c[_0xae04('0x4c')]);return db[_0xae04('0x33')]['find'](_0x4371bd)[_0xae04('0x29')](function(_0x3d4969){if(_0x3d4969){_0x37cae4=_0x3d4969;return _0x3d4969[_0xae04('0x6b')]();}return null;})[_0xae04('0x29')](function(_0x534301){if(_0x534301){if(!_0x534301[_0xae04('0x3c')]){throw new db[(_0xae04('0x6c'))][(_0xae04('0x6d'))](_0xae04('0x6e'),0x193);}_0x224bbe=_0x534301;return db['AnalyticMetric'][_0xae04('0x6f')]({'raw':!![]});}return null;})['then'](function(_0xd68457){if(_0xd68457){_0x12e96f=_['keyBy'](_0xd68457,'id');var _0x22c545;var _0x44c7c5=squel[_0xae04('0x70')]();_0x44c7c5[_0xae04('0x71')](_0x37cae4['table']);for(var _0x216465=0x0;_0x216465<_0x224bbe['length'];_0x216465+=0x1){_0x22c545=_0x224bbe[_0x216465][_0xae04('0x72')]?_0x12e96f[_0x224bbe[_0x216465][_0xae04('0x72')]][_0xae04('0x73')]:_0x224bbe[_0x216465][_0xae04('0x68')];_0x22c545=_0x224bbe[_0x216465][_0xae04('0x74')]?_[_0xae04('0x75')](_0x851256[_0x224bbe[_0x216465][_0xae04('0x74')]],'%s',_0x22c545):_0x22c545;_0x22c545=_0x224bbe[_0x216465]['format']?_[_0xae04('0x75')](_0x43bb48[_0x224bbe[_0x216465][_0xae04('0x76')]],'%s',_0x22c545):_0x22c545;if(_0x224bbe[_0x216465]['groupBy']){_0x44c7c5['group'](_0x22c545);}_0x224bbe[_0x216465][_0xae04('0x77')]&&_0x44c7c5['order'](_0x22c545,_0x224bbe[_0x216465][_0xae04('0x77')]==='DESC'?![]:!![]);_0x44c7c5[_0xae04('0x68')](_0x22c545,_0x224bbe[_0x216465][_0xae04('0x78')]||_0x22c545);}if(_0x37cae4[_0xae04('0x79')]){_0x37cae4[_0xae04('0x79')]=JSON[_0xae04('0x7a')](_0x37cae4[_0xae04('0x79')]);for(var _0x23c4ae=0x0;_0x23c4ae<_0x37cae4[_0xae04('0x79')][_0xae04('0x3c')];_0x23c4ae+=0x1){if(_0x37cae4['joins'][_0x23c4ae][_0xae04('0x43')]&&_[_0xae04('0x61')](_0x284571,_0x37cae4['joins'][_0x23c4ae][_0xae04('0x43')])&&_0x37cae4['joins'][_0x23c4ae][_0xae04('0x7b')]&&_0x37cae4[_0xae04('0x79')][_0x23c4ae]['foreignTable']&&_0x37cae4[_0xae04('0x79')][_0x23c4ae]['foreignKey']){_0x44c7c5[_0x37cae4[_0xae04('0x79')][_0x23c4ae][_0xae04('0x43')]](_0x37cae4[_0xae04('0x79')][_0x23c4ae][_0xae04('0x7c')],null,util[_0xae04('0x76')](_0xae04('0x7d'),_0x37cae4[_0xae04('0x7e')],_0x37cae4[_0xae04('0x79')][_0x23c4ae][_0xae04('0x7b')],_0x37cae4[_0xae04('0x79')][_0x23c4ae][_0xae04('0x7c')],_0x37cae4['joins'][_0x23c4ae][_0xae04('0x7f')]));}}}if(_0x37cae4[_0xae04('0x80')]){_0x37cae4[_0xae04('0x80')]=JSON[_0xae04('0x7a')](_0x37cae4[_0xae04('0x80')]);_0x44c7c5['where'](_0x309c74(_0x37cae4[_0xae04('0x80')][_0xae04('0x67')]));}_0x146912=_0x44c7c5[_0xae04('0x81')]();_0x44c7c5[_0xae04('0x1f')](_0xe4bcfa);_0x44c7c5['offset'](0x0);logger[_0xae04('0x82')](_0xae04('0x83'),_0x44c7c5['toString']());return dbH[_0xae04('0x84')][_0xae04('0x37')](_0x44c7c5[_0xae04('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xae04('0x86')]});}})[_0xae04('0x29')](respondWithResult(_0x2fd8e6,null))[_0xae04('0x47')](handleError(_0x2fd8e6,null));};function runReport(_0x36b725,_0x560308,_0x5a45ba){var _0xa5635b=_0x560308['name'];var _0x156741=0xa;var _0x34d07e=['join',_0xae04('0x87'),'right_join',_0xae04('0x88')];var _0x459509={'SUM':_0xae04('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xae04('0x5a'),'MIN':'MIN(%s)','AVG':_0xae04('0x5c'),'GROUP_CONCAT':_0xae04('0x5d'),'GROUP_CONCAT ASC':_0xae04('0x5e'),'GROUP_CONCAT DESC':_0xae04('0x5f')};var _0x1be9f1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xae04('0x89'),'HOUR':'HOUR(%s)','ROUND':_0xae04('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x7b199=function(_0x132477){return!_[_0xae04('0x61')]([_0xae04('0x62'),_0xae04('0x63'),_0xae04('0x8b'),'IS\x20NOT\x20EMPTY'],_0x132477);};var _0x4f1217=function(_0x2fa878){if(!_0x2fa878||!_0x2fa878[_0xae04('0x65')]['length']){return'';}for(var _0x277899='(',_0x4145c6=0x0;_0x4145c6<_0x2fa878[_0xae04('0x65')][_0xae04('0x3c')];_0x4145c6+=0x1){_0x4145c6>0x0&&(_0x277899+='\x20'+_0x2fa878[_0xae04('0x66')]+'\x20');_0x277899+=_0x2fa878[_0xae04('0x65')][_0x4145c6]['group']?_0x4f1217(_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x67')]):_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x68')]+'\x20'+_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x69')]+(_0x7b199(_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x69')])?'\x20'+_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x6a')]:'');}return _0x277899+')';};var _0x4fe988={'where':{'id':_0x36b725['id']}},_0x29f79e,_0x1e7dce,_0x5d8493,_0x3b27a2,_0x145725;_0x4fe988=_[_0xae04('0x42')]({},_0x4fe988,_0x5a45ba);return db[_0xae04('0x33')]['find'](_0x4fe988)[_0xae04('0x29')](function(_0x1442ea){if(_0x1442ea){_0x29f79e=_0x1442ea;return _0x1442ea['getFields']();}return null;})[_0xae04('0x29')](function(_0xb7ec8e){if(_0xb7ec8e){if(!_0xb7ec8e[_0xae04('0x3c')]){throw new db[(_0xae04('0x6c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1e7dce=_0xb7ec8e;return db[_0xae04('0x8c')][_0xae04('0x6f')]({'raw':!![]});}return null;})[_0xae04('0x29')](function(_0x4f82a7){if(_0x4f82a7){_0x5d8493=_[_0xae04('0x8d')](_0x4f82a7,'id');var _0xa8ad54;var _0x5298f5=squel['select']();_0x5298f5[_0xae04('0x71')](_0x29f79e[_0xae04('0x7e')]);for(var _0x5e104c=0x0;_0x5e104c<_0x1e7dce['length'];_0x5e104c+=0x1){_0xa8ad54=_0x1e7dce[_0x5e104c][_0xae04('0x72')]?_0x5d8493[_0x1e7dce[_0x5e104c][_0xae04('0x72')]][_0xae04('0x73')]:_0x1e7dce[_0x5e104c][_0xae04('0x68')];_0xa8ad54=_0x1e7dce[_0x5e104c]['function']?_['replace'](_0x459509[_0x1e7dce[_0x5e104c][_0xae04('0x74')]],'%s',_0xa8ad54):_0xa8ad54;_0xa8ad54=_0x1e7dce[_0x5e104c][_0xae04('0x76')]?_[_0xae04('0x75')](_0x1be9f1[_0x1e7dce[_0x5e104c]['format']],'%s',_0xa8ad54):_0xa8ad54;if(_0x1e7dce[_0x5e104c][_0xae04('0x8e')]){_0x5298f5[_0xae04('0x67')](_0xa8ad54);}_0x1e7dce[_0x5e104c][_0xae04('0x77')]&&_0x5298f5[_0xae04('0x3d')](_0xa8ad54,_0x1e7dce[_0x5e104c][_0xae04('0x77')]===_0xae04('0x8f')?![]:!![]);_0x5298f5[_0xae04('0x68')](_0xa8ad54,_0x1e7dce[_0x5e104c][_0xae04('0x78')]||_0xa8ad54);}if(_0x29f79e[_0xae04('0x79')]){_0x29f79e[_0xae04('0x79')]=JSON[_0xae04('0x7a')](_0x29f79e['joins']);for(var _0x26fcf5=0x0;_0x26fcf5<_0x29f79e[_0xae04('0x79')][_0xae04('0x3c')];_0x26fcf5+=0x1){if(_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x43')]&&_[_0xae04('0x61')](_0x34d07e,_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x43')])&&_0x29f79e['joins'][_0x26fcf5][_0xae04('0x7b')]&&_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x7c')]&&_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x7f')]){_0x5298f5[_0x29f79e[_0xae04('0x79')][_0x26fcf5]['type']](_0x29f79e['joins'][_0x26fcf5][_0xae04('0x7c')],null,util[_0xae04('0x76')](_0xae04('0x7d'),_0x29f79e[_0xae04('0x7e')],_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x7b')],_0x29f79e['joins'][_0x26fcf5]['foreignTable'],_0x29f79e[_0xae04('0x79')][_0x26fcf5]['foreignKey']));}}}if(_0x29f79e[_0xae04('0x80')]){_0x29f79e[_0xae04('0x80')]=JSON[_0xae04('0x7a')](_0x29f79e[_0xae04('0x80')]);_0x5298f5[_0xae04('0x3f')](_0x4f1217(_0x29f79e['conditions'][_0xae04('0x67')]));}_0x145725=_0x5298f5[_0xae04('0x81')]();_0x5298f5[_0xae04('0x1f')](_0x156741);_0x5298f5[_0xae04('0x21')](0x0);return;}})[_0xae04('0x29')](function(){if(_0x560308['output']===_0xae04('0x90')){return null;}var _0x29c5a1=_[_0xae04('0x42')](_0x560308,{'name':_0x560308[_0xae04('0x91')]||_0x560308[_0xae04('0x2f')]||_0x29f79e['name'],'basename':_0xa5635b,'savename':util[_0xae04('0x76')](_0xae04('0x92'),_0x560308[_0xae04('0x2f')]||_0x29f79e[_0xae04('0x2f')],require(_0xae04('0x93'))[_0xae04('0x94')](0x4),_0x560308[_0xae04('0x95')]||_0xae04('0x96')),'reportId':_0x29f79e['id'],'reportType':_0xae04('0x97')});return db['AnalyticExtractedReport'][_0xae04('0x4d')](_0x29c5a1,{'raw':!![]});})[_0xae04('0x29')](function(_0x5bf88f){if(_0x29f79e[_0xae04('0x7e')]===_0xae04('0x98')){_0x145725[_0xae04('0x3f')](_0x29f79e[_0xae04('0x7e')]+_0xae04('0x99'),_0x560308[_0xae04('0x9a')],_0x560308['endDate']);}else{_0x145725['where'](_0x29f79e[_0xae04('0x7e')]+_0xae04('0x9b'),_0x560308[_0xae04('0x9a')],_0x560308['endDate']);}if(_0x5bf88f){logger[_0xae04('0x9c')](_0xae04('0x9d'),_0x145725[_0xae04('0x85')]());require(_0xae04('0x9e'))[_0xae04('0x9f')](path['join'](__dirname,'../../components/export/',_0x5bf88f[_0xae04('0x95')]),[_0x5bf88f['id'],_0x145725['toString'](),path['join'](__dirname,_0xae04('0xa0'),_0x5bf88f[_0xae04('0xa1')]),_0xa5635b]);return _0x5bf88f;}else{var _0x20f193=squel[_0xae04('0x70')]();_0x20f193[_0xae04('0x71')]('('+_0x145725[_0xae04('0x85')]()+')','countTable');_0x20f193['field']('COUNT(*)',_0xae04('0x20'));_0x145725['limit'](_0x560308['limit']||_0x156741);_0x145725[_0xae04('0x21')](_0x560308['offset']||0x0);return dbH['sequelize'][_0xae04('0x37')](_0x20f193[_0xae04('0x85')](),{'type':dbH['sequelize'][_0xae04('0xa2')][_0xae04('0x86')]})[_0xae04('0x29')](function(_0x147609){if(!_0x147609[_0xae04('0x3c')]){_0x3b27a2=0x0;}else{_0x3b27a2=_0x147609[0x0][_0xae04('0x20')]||0x0;}return dbH[_0xae04('0x84')]['query'](_0x145725['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xae04('0x86')]});})[_0xae04('0x29')](function(_0xb6f427){return{'rows':_0xb6f427||[],'count':_0x3b27a2};});}});}exports[_0xae04('0xa3')]=function(_0x542966,_0x2e3e6c){return runReport(_0x542966[_0xae04('0x49')],_0x542966[_0xae04('0x37')],_0x542966[_0xae04('0x4c')])[_0xae04('0x29')](respondWithResult(_0x2e3e6c,null))[_0xae04('0x47')](handleError(_0x2e3e6c,null));};exports[_0xae04('0xa4')]=runReport;exports[_0xae04('0x37')]=function(_0x56e200,_0x25a048){var _0x24cf08=0xa;var _0x39ec08=[_0xae04('0x56'),_0xae04('0x87'),_0xae04('0xa5'),_0xae04('0x88')];var _0x1a5fc2={'SUM':_0xae04('0x57'),'COUNT':_0xae04('0x58'),'COUNT DISTINCT':_0xae04('0x59'),'MAX':_0xae04('0x5a'),'MIN':_0xae04('0x5b'),'AVG':_0xae04('0x5c'),'GROUP_CONCAT':_0xae04('0x5d'),'GROUP_CONCAT ASC':_0xae04('0x5e'),'GROUP_CONCAT DESC':_0xae04('0x5f')};var _0x1e9824={'SEC_TO_TIME':_0xae04('0x60'),'DATE':'DATE(%s)','HOUR':_0xae04('0xa6'),'ROUND':_0xae04('0x8a'),'UNIX_TIMESTAMP':_0xae04('0xa7')};var _0x4c9221=function(_0x230bc1){return!_['includes'](['IS\x20NULL',_0xae04('0x63'),'IS\x20EMPTY',_0xae04('0x64')],_0x230bc1);};var _0x1ccd44=function(_0x2f8e51){if(!_0x2f8e51||!_0x2f8e51[_0xae04('0x65')][_0xae04('0x3c')]){return'';}for(var _0x4d0f22='(',_0x4bc9c5=0x0;_0x4bc9c5<_0x2f8e51[_0xae04('0x65')]['length'];_0x4bc9c5+=0x1){_0x4bc9c5>0x0&&(_0x4d0f22+='\x20'+_0x2f8e51[_0xae04('0x66')]+'\x20');_0x4d0f22+=_0x2f8e51[_0xae04('0x65')][_0x4bc9c5]['group']?_0x1ccd44(_0x2f8e51['rules'][_0x4bc9c5][_0xae04('0x67')]):_0x2f8e51[_0xae04('0x65')][_0x4bc9c5][_0xae04('0x68')]+'\x20'+_0x2f8e51[_0xae04('0x65')][_0x4bc9c5][_0xae04('0x69')]+(_0x4c9221(_0x2f8e51[_0xae04('0x65')][_0x4bc9c5][_0xae04('0x69')])?'\x20'+_0x2f8e51[_0xae04('0x65')][_0x4bc9c5][_0xae04('0x6a')]:'');}return _0x4d0f22+')';};var _0x20d311={'where':{'id':_0x56e200['params']['id']}},_0x4b77b3,_0x48bfa7,_0x3d12f2,_0x3698ee,_0x237cd1;_0x20d311=_[_0xae04('0x42')]({},_0x20d311,_0x56e200['options']);return db['AnalyticCustomReport'][_0xae04('0x51')](_0x20d311)[_0xae04('0x29')](function(_0x504a6e){if(_0x504a6e){_0x4b77b3=_0x504a6e;return _0x504a6e['getFields']();}return null;})[_0xae04('0x29')](function(_0x345195){if(_0x345195){if(!_0x345195['length']){throw new db[(_0xae04('0x6c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x48bfa7=_0x345195;return db[_0xae04('0x8c')][_0xae04('0x6f')]({'raw':!![]});}return null;})[_0xae04('0x29')](function(_0x153589){if(_0x153589){_0x3d12f2=_[_0xae04('0x8d')](_0x153589,'id');var _0x4bc423;var _0x1d1e6d=squel[_0xae04('0x70')]();_0x1d1e6d[_0xae04('0x71')](_0x4b77b3[_0xae04('0x7e')]);for(var _0x38c074=0x0;_0x38c074<_0x48bfa7[_0xae04('0x3c')];_0x38c074+=0x1){_0x4bc423=_0x48bfa7[_0x38c074][_0xae04('0x72')]?_0x3d12f2[_0x48bfa7[_0x38c074][_0xae04('0x72')]][_0xae04('0x73')]:_0x48bfa7[_0x38c074][_0xae04('0x68')];_0x4bc423=_0x48bfa7[_0x38c074][_0xae04('0x74')]?_['replace'](_0x1a5fc2[_0x48bfa7[_0x38c074][_0xae04('0x74')]],'%s',_0x4bc423):_0x4bc423;_0x4bc423=_0x48bfa7[_0x38c074]['format']?_[_0xae04('0x75')](_0x1e9824[_0x48bfa7[_0x38c074][_0xae04('0x76')]],'%s',_0x4bc423):_0x4bc423;if(_0x48bfa7[_0x38c074]['groupBy']){_0x1d1e6d[_0xae04('0x67')](_0x4bc423);}_0x48bfa7[_0x38c074][_0xae04('0x77')]&&_0x1d1e6d[_0xae04('0x3d')](_0x4bc423,_0x48bfa7[_0x38c074][_0xae04('0x77')]===_0xae04('0x8f')?![]:!![]);_0x1d1e6d['field'](_0x4bc423,_0x48bfa7[_0x38c074][_0xae04('0x78')]||_0x4bc423);}if(_0x4b77b3[_0xae04('0x79')]){_0x4b77b3['joins']=JSON[_0xae04('0x7a')](_0x4b77b3['joins']);for(var _0x48a6c7=0x0;_0x48a6c7<_0x4b77b3[_0xae04('0x79')][_0xae04('0x3c')];_0x48a6c7+=0x1){if(_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x43')]&&_['includes'](_0x39ec08,_0x4b77b3['joins'][_0x48a6c7]['type'])&&_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x7b')]&&_0x4b77b3[_0xae04('0x79')][_0x48a6c7]['foreignTable']&&_0x4b77b3['joins'][_0x48a6c7][_0xae04('0x7f')]){_0x1d1e6d[_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x43')]](_0x4b77b3[_0xae04('0x79')][_0x48a6c7]['foreignTable'],null,util[_0xae04('0x76')]('%s.%s\x20=\x20%s.%s',_0x4b77b3[_0xae04('0x7e')],_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x7b')],_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x7c')],_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x7f')]));}}}if(_0x4b77b3[_0xae04('0x80')]){_0x4b77b3[_0xae04('0x80')]=JSON[_0xae04('0x7a')](_0x4b77b3['conditions']);_0x1d1e6d[_0xae04('0x3f')](_0x1ccd44(_0x4b77b3[_0xae04('0x80')][_0xae04('0x67')]));}_0x237cd1=_0x1d1e6d[_0xae04('0x81')]();_0x1d1e6d[_0xae04('0x1f')](_0x24cf08);_0x1d1e6d['offset'](0x0);logger[_0xae04('0x82')](_0xae04('0x83'),_0x1d1e6d['toString']());return dbH['sequelize'][_0xae04('0x37')](_0x1d1e6d[_0xae04('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xae04('0x86')]});}})['then'](function(){return{'sql':_0x237cd1[_0xae04('0x85')]()};})[_0xae04('0x29')](respondWithResult(_0x25a048,null))[_0xae04('0x47')](handleError(_0x25a048,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 9c7ee8b..3d8582f 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 _0x3941=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x3941,0x6a));var _0x1394=function(_0x25f4c5,_0x22f5a6){_0x25f4c5=_0x25f4c5-0x0;var _0x440929=_0x3941[_0x25f4c5];return _0x440929;};'use strict';var _=require(_0x1394('0x0'));var util=require(_0x1394('0x1'));var logger=require(_0x1394('0x2'))(_0x1394('0x3'));var moment=require(_0x1394('0x4'));var BPromise=require(_0x1394('0x5'));var rp=require(_0x1394('0x6'));var fs=require('fs');var path=require(_0x1394('0x7'));var rimraf=require(_0x1394('0x8'));var config=require(_0x1394('0x9'));var attributes=require('./analyticCustomReport.attributes');module[_0x1394('0xa')]=function(_0x5b0445,_0x181acd){return _0x5b0445[_0x1394('0xb')](_0x1394('0xc'),attributes,{'tableName':_0x1394('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6066=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','request-promise','../../config/environment','exports'];(function(_0x3b8edd,_0x188207){var _0x770a4a=function(_0x154b3c){while(--_0x154b3c){_0x3b8edd['push'](_0x3b8edd['shift']());}};_0x770a4a(++_0x188207);}(_0x6066,0x107));var _0x6606=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0x6066[_0x1aeda2];return _0x32dc6d;};'use strict';var _=require(_0x6606('0x0'));var util=require(_0x6606('0x1'));var logger=require(_0x6606('0x2'))(_0x6606('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6606('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6606('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0x6606('0x6')]=function(_0x20e869,_0x4a11b7){return _0x20e869[_0x6606('0x7')](_0x6606('0x8'),attributes,{'tableName':_0x6606('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 3372b28..7d12666 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 _0xf44a=['code','message','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0xf44a,0xfa));var _0xaf44=function(_0x35bb79,_0x85479d){_0x35bb79=_0x35bb79-0x0;var _0x481165=_0xf44a[_0x35bb79];return _0x481165;};'use strict';var _=require(_0xaf44('0x0'));var util=require(_0xaf44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaf44('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaf44('0x3'));var logger=require(_0xaf44('0x4'))(_0xaf44('0x5'));var config=require('../../config/environment');var jayson=require(_0xaf44('0x6'));var client=jayson[_0xaf44('0x7')][_0xaf44('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d0700,_0x394624,_0x49aeec){return new BPromise(function(_0xbdafbf,_0x5075b0){return client['request'](_0x3d0700,_0x49aeec)[_0xaf44('0x9')](function(_0x1bf696){logger[_0xaf44('0xa')](_0xaf44('0xb'),_0x394624,'request\x20sent');logger[_0xaf44('0xc')](_0xaf44('0xd'),_0x394624,_0xaf44('0xe'),JSON['stringify'](_0x1bf696));if(_0x1bf696[_0xaf44('0xf')]){if(_0x1bf696[_0xaf44('0xf')][_0xaf44('0x10')]===0x1f4){logger[_0xaf44('0xf')](_0xaf44('0xb'),_0x394624,_0x1bf696[_0xaf44('0xf')][_0xaf44('0x11')]);return _0x5075b0(_0x1bf696['error']['message']);}logger[_0xaf44('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x394624,_0x1bf696[_0xaf44('0xf')][_0xaf44('0x11')]);return _0xbdafbf(_0x1bf696[_0xaf44('0xf')][_0xaf44('0x11')]);}else{logger['info'](_0xaf44('0xb'),_0x394624,_0xaf44('0xe'));_0xbdafbf(_0x1bf696['result'][_0xaf44('0x11')]);}})[_0xaf44('0x12')](function(_0x13677b){logger[_0xaf44('0xf')](_0xaf44('0xb'),_0x394624,_0x13677b);_0x5075b0(_0x13677b);});});} \ No newline at end of file +var _0x6853=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6853,0x13c));var _0x3685=function(_0x35f1e7,_0x50f26e){_0x35f1e7=_0x35f1e7-0x0;var _0xefc085=_0x6853[_0x35f1e7];return _0xefc085;};'use strict';var _=require(_0x3685('0x0'));var util=require(_0x3685('0x1'));var moment=require('moment');var BPromise=require(_0x3685('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3685('0x3'));var db=require(_0x3685('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3685('0x5'))(_0x3685('0x6'));var config=require(_0x3685('0x7'));var jayson=require(_0x3685('0x8'));var client=jayson[_0x3685('0x9')][_0x3685('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8cc512,_0x5cff6f,_0x2959c2){return new BPromise(function(_0x4e2872,_0xd08cb1){return client[_0x3685('0xb')](_0x8cc512,_0x2959c2)[_0x3685('0xc')](function(_0xebb3f2){logger[_0x3685('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5cff6f,_0x3685('0xe'));logger['debug'](_0x3685('0xf'),_0x5cff6f,_0x3685('0xe'),JSON['stringify'](_0xebb3f2));if(_0xebb3f2[_0x3685('0x10')]){if(_0xebb3f2[_0x3685('0x10')]['code']===0x1f4){logger[_0x3685('0x10')](_0x3685('0x11'),_0x5cff6f,_0xebb3f2[_0x3685('0x10')][_0x3685('0x12')]);return _0xd08cb1(_0xebb3f2[_0x3685('0x10')][_0x3685('0x12')]);}logger[_0x3685('0x10')](_0x3685('0x11'),_0x5cff6f,_0xebb3f2[_0x3685('0x10')][_0x3685('0x12')]);return _0x4e2872(_0xebb3f2[_0x3685('0x10')]['message']);}else{logger['info'](_0x3685('0x11'),_0x5cff6f,'request\x20sent');_0x4e2872(_0xebb3f2[_0x3685('0x13')]['message']);}})['catch'](function(_0x297dce){logger['error'](_0x3685('0x11'),_0x5cff6f,_0x297dce);_0xd08cb1(_0x297dce);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 745032b..a33ac02 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 _0x32e9=['/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x32e9,0x1c2));var _0x932e=function(_0x13a275,_0x3959a5){_0x13a275=_0x13a275-0x0;var _0x45919a=_0x32e9[_0x13a275];return _0x45919a;};'use strict';var multer=require(_0x932e('0x0'));var util=require(_0x932e('0x1'));var path=require(_0x932e('0x2'));var timeout=require(_0x932e('0x3'));var express=require(_0x932e('0x4'));var router=express['Router']();var fs_extra=require(_0x932e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x932e('0x6'));var config=require(_0x932e('0x7'));var controller=require(_0x932e('0x8'));router['get']('/',auth[_0x932e('0x9')](),controller[_0x932e('0xa')]);router[_0x932e('0xb')](_0x932e('0xc'),auth['isAuthenticated'](),controller[_0x932e('0xd')]);router['get'](_0x932e('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x932e('0xb')](_0x932e('0xf'),auth[_0x932e('0x9')](),controller[_0x932e('0x10')]);router[_0x932e('0xb')](_0x932e('0x11'),auth[_0x932e('0x9')](),controller[_0x932e('0x12')]);router[_0x932e('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x932e('0x14')](_0x932e('0xc'),auth['isAuthenticated'](),controller[_0x932e('0x15')]);router['delete'](_0x932e('0xc'),auth[_0x932e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc0b2=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','preview','/:id/run','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xc0b2,0x151));var _0x2c0b=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xc0b2[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0x2c0b('0x0'));var util=require(_0x2c0b('0x1'));var path=require(_0x2c0b('0x2'));var timeout=require(_0x2c0b('0x3'));var express=require(_0x2c0b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2c0b('0x5'));var interaction=require(_0x2c0b('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x2c0b('0x7')](),controller[_0x2c0b('0x8')]);router[_0x2c0b('0x9')](_0x2c0b('0xa'),auth[_0x2c0b('0x7')](),controller['show']);router[_0x2c0b('0x9')]('/:id/preview',auth[_0x2c0b('0x7')](),controller[_0x2c0b('0xb')]);router[_0x2c0b('0x9')](_0x2c0b('0xc'),auth[_0x2c0b('0x7')](),controller['run']);router['get']('/:id/query',auth[_0x2c0b('0x7')](),controller['query']);router[_0x2c0b('0xd')]('/',auth['isAuthenticated'](),controller[_0x2c0b('0xe')]);router[_0x2c0b('0xf')]('/:id',auth[_0x2c0b('0x7')](),controller[_0x2c0b('0x10')]);router[_0x2c0b('0x11')](_0x2c0b('0xa'),auth[_0x2c0b('0x7')](),controller[_0x2c0b('0x12')]);module[_0x2c0b('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index e822b25..d1fc09a 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0xafc4,0x69));var _0x4afc=function(_0x45de3a,_0x304cd8){_0x45de3a=_0x45de3a-0x0;var _0xec97ae=_0xafc4[_0x45de3a];return _0xec97ae;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}}; \ No newline at end of file +var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0xafc4,0x69));var _0x4afc=function(_0x29140c,_0x3ac196){_0x29140c=_0x29140c-0x0;var _0x46f44f=_0xafc4[_0x29140c];return _0x46f44f;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 4441685..85eeb18 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x561e0a,_0x3217b6){var _0x510ec1=function(_0x29536b){while(--_0x29536b){_0x561e0a['push'](_0x561e0a['shift']());}};_0x510ec1(++_0x3217b6);}(_0x814b,0x1a2));var _0xb814=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x814b[_0xc7348b];return _0x307cec;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file +var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x973ea5,_0x35dbd4){_0x973ea5=_0x973ea5-0x0;var _0x2f135b=_0xc6ac[_0x973ea5];return _0x2f135b;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index f15342c..fecd710 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 _0xd16f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger'];(function(_0x335549,_0x58caa2){var _0x18ec8a=function(_0x52dcc4){while(--_0x52dcc4){_0x335549['push'](_0x335549['shift']());}};_0x18ec8a(++_0x58caa2);}(_0xd16f,0x1af));var _0xfd16=function(_0x52a655,_0x5bf43f){_0x52a655=_0x52a655-0x0;var _0x3e2990=_0xd16f[_0x52a655];return _0x3e2990;};'use strict';var _=require(_0xfd16('0x0'));var util=require(_0xfd16('0x1'));var logger=require(_0xfd16('0x2'))(_0xfd16('0x3'));var moment=require(_0xfd16('0x4'));var BPromise=require(_0xfd16('0x5'));var rp=require(_0xfd16('0x6'));var fs=require('fs');var path=require(_0xfd16('0x7'));var rimraf=require(_0xfd16('0x8'));var config=require(_0xfd16('0x9'));var attributes=require(_0xfd16('0xa'));module[_0xfd16('0xb')]=function(_0x6eb4c8,_0x5ba79a){return _0x6eb4c8[_0xfd16('0xc')](_0xfd16('0xd'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x713b=['rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x270c32,_0x190eab){var _0x397ac0=function(_0xcb60ef){while(--_0xcb60ef){_0x270c32['push'](_0x270c32['shift']());}};_0x397ac0(++_0x190eab);}(_0x713b,0x172));var _0xb713=function(_0x58f245,_0x3e4f31){_0x58f245=_0x58f245-0x0;var _0x1f0cfb=_0x713b[_0x58f245];return _0x1f0cfb;};'use strict';var _=require(_0xb713('0x0'));var util=require(_0xb713('0x1'));var logger=require(_0xb713('0x2'))(_0xb713('0x3'));var moment=require(_0xb713('0x4'));var BPromise=require(_0xb713('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb713('0x6'));var rimraf=require(_0xb713('0x7'));var config=require(_0xb713('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0xb713('0x9')]=function(_0x408560,_0x1ba991){return _0x408560[_0xb713('0xa')](_0xb713('0xb'),attributes,{'tableName':_0xb713('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 2d46a8d..96410cd 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 _0xbb58=['rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21f98e,_0x52f35d){var _0x3f263a=function(_0x32bc33){while(--_0x32bc33){_0x21f98e['push'](_0x21f98e['shift']());}};_0x3f263a(++_0x52f35d);}(_0xbb58,0x1f2));var _0x8bb5=function(_0x50a655,_0x1a063a){_0x50a655=_0x50a655-0x0;var _0x5d683b=_0xbb58[_0x50a655];return _0x5d683b;};'use strict';var _=require('lodash');var util=require(_0x8bb5('0x0'));var moment=require('moment');var BPromise=require(_0x8bb5('0x1'));var rs=require(_0x8bb5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bb5('0x3'))['db'];var utils=require(_0x8bb5('0x4'));var logger=require(_0x8bb5('0x5'))(_0x8bb5('0x6'));var config=require(_0x8bb5('0x7'));var jayson=require(_0x8bb5('0x8'));var client=jayson[_0x8bb5('0x9')][_0x8bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfc5c6c,_0x373ed2,_0x1293b7){return new BPromise(function(_0x3415d0,_0x44deec){return client[_0x8bb5('0xb')](_0xfc5c6c,_0x1293b7)[_0x8bb5('0xc')](function(_0x10f419){logger['info'](_0x8bb5('0xd'),_0x373ed2,_0x8bb5('0xe'));logger[_0x8bb5('0xf')](_0x8bb5('0x10'),_0x373ed2,_0x8bb5('0xe'),JSON[_0x8bb5('0x11')](_0x10f419));if(_0x10f419[_0x8bb5('0x12')]){if(_0x10f419['error'][_0x8bb5('0x13')]===0x1f4){logger['error'](_0x8bb5('0xd'),_0x373ed2,_0x10f419[_0x8bb5('0x12')][_0x8bb5('0x14')]);return _0x44deec(_0x10f419[_0x8bb5('0x12')]['message']);}logger[_0x8bb5('0x12')](_0x8bb5('0xd'),_0x373ed2,_0x10f419[_0x8bb5('0x12')][_0x8bb5('0x14')]);return _0x3415d0(_0x10f419[_0x8bb5('0x12')]['message']);}else{logger[_0x8bb5('0x15')](_0x8bb5('0xd'),_0x373ed2,_0x8bb5('0xe'));_0x3415d0(_0x10f419[_0x8bb5('0x16')][_0x8bb5('0x14')]);}})[_0x8bb5('0x17')](function(_0x47c94f){logger[_0x8bb5('0x12')](_0x8bb5('0xd'),_0x373ed2,_0x47c94f);_0x44deec(_0x47c94f);});});} \ No newline at end of file +var _0x1f7f=['code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x11b5cf,_0x10367d){var _0xece1ae=function(_0x462fda){while(--_0x462fda){_0x11b5cf['push'](_0x11b5cf['shift']());}};_0xece1ae(++_0x10367d);}(_0x1f7f,0x14f));var _0xf1f7=function(_0x3bd497,_0x37d7a8){_0x3bd497=_0x3bd497-0x0;var _0x32f967=_0x1f7f[_0x3bd497];return _0x32f967;};'use strict';var _=require(_0xf1f7('0x0'));var util=require(_0xf1f7('0x1'));var moment=require(_0xf1f7('0x2'));var BPromise=require(_0xf1f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1f7('0x5'));var logger=require(_0xf1f7('0x6'))(_0xf1f7('0x7'));var config=require(_0xf1f7('0x8'));var jayson=require(_0xf1f7('0x9'));var client=jayson[_0xf1f7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c701,_0xe7fb95,_0x353889){return new BPromise(function(_0x319c71,_0xf988d0){return client['request'](_0x10c701,_0x353889)[_0xf1f7('0xb')](function(_0x10fc23){logger[_0xf1f7('0xc')](_0xf1f7('0xd'),_0xe7fb95,'request\x20sent');logger['debug'](_0xf1f7('0xe'),_0xe7fb95,_0xf1f7('0xf'),JSON[_0xf1f7('0x10')](_0x10fc23));if(_0x10fc23['error']){if(_0x10fc23['error'][_0xf1f7('0x11')]===0x1f4){logger[_0xf1f7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe7fb95,_0x10fc23[_0xf1f7('0x12')][_0xf1f7('0x13')]);return _0xf988d0(_0x10fc23[_0xf1f7('0x12')]['message']);}logger[_0xf1f7('0x12')](_0xf1f7('0xd'),_0xe7fb95,_0x10fc23[_0xf1f7('0x12')][_0xf1f7('0x13')]);return _0x319c71(_0x10fc23[_0xf1f7('0x12')]['message']);}else{logger[_0xf1f7('0xc')](_0xf1f7('0xd'),_0xe7fb95,_0xf1f7('0xf'));_0x319c71(_0x10fc23[_0xf1f7('0x14')][_0xf1f7('0x13')]);}})[_0xf1f7('0x15')](function(_0x59749d){logger[_0xf1f7('0x12')](_0xf1f7('0xd'),_0xe7fb95,_0x59749d);_0xf988d0(_0x59749d);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 414ff77..2161ffb 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 _0xfe73=['../../components/auth/service','./analyticDefaultReport.controller','/:id','show','get','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post','create','update','delete','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x1e765a,_0x4a7c55){var _0x5bc8a1=function(_0x8dbd4d){while(--_0x8dbd4d){_0x1e765a['push'](_0x1e765a['shift']());}};_0x5bc8a1(++_0x4a7c55);}(_0xfe73,0x12f));var _0x3fe7=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xfe73[_0x580647];return _0x5f0792;};'use strict';var multer=require(_0x3fe7('0x0'));var util=require(_0x3fe7('0x1'));var path=require(_0x3fe7('0x2'));var timeout=require(_0x3fe7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3fe7('0x4'));var auth=require(_0x3fe7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3fe7('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3fe7('0x7'),auth['isAuthenticated'](),controller[_0x3fe7('0x8')]);router[_0x3fe7('0x9')](_0x3fe7('0xa'),auth[_0x3fe7('0xb')](),controller[_0x3fe7('0xc')]);router['get'](_0x3fe7('0xd'),auth['isAuthenticated'](),controller[_0x3fe7('0xe')]);router[_0x3fe7('0x9')](_0x3fe7('0xf'),auth[_0x3fe7('0xb')](),controller[_0x3fe7('0x10')]);router[_0x3fe7('0x11')]('/',auth[_0x3fe7('0xb')](),controller[_0x3fe7('0x12')]);router['put'](_0x3fe7('0x7'),auth['isAuthenticated'](),controller[_0x3fe7('0x13')]);router[_0x3fe7('0x14')](_0x3fe7('0x7'),auth[_0x3fe7('0xb')](),controller['destroy']);module[_0x3fe7('0x15')]=router; \ No newline at end of file +var _0xca84=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','run','/:id/query','query','post','delete','exports','multer','util'];(function(_0x1bb312,_0x2d1709){var _0x222bd7=function(_0x3d1890){while(--_0x3d1890){_0x1bb312['push'](_0x1bb312['shift']());}};_0x222bd7(++_0x2d1709);}(_0xca84,0xf5));var _0x4ca8=function(_0x2e5066,_0x4d9a48){_0x2e5066=_0x2e5066-0x0;var _0x499afb=_0xca84[_0x2e5066];return _0x499afb;};'use strict';var multer=require(_0x4ca8('0x0'));var util=require(_0x4ca8('0x1'));var path=require(_0x4ca8('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ca8('0x3'));var router=express[_0x4ca8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ca8('0x5'));var interaction=require(_0x4ca8('0x6'));var config=require(_0x4ca8('0x7'));var controller=require(_0x4ca8('0x8'));router[_0x4ca8('0x9')]('/',auth[_0x4ca8('0xa')](),controller[_0x4ca8('0xb')]);router[_0x4ca8('0x9')](_0x4ca8('0xc'),auth[_0x4ca8('0xa')](),controller['show']);router[_0x4ca8('0x9')]('/:id/preview',auth[_0x4ca8('0xa')](),controller['preview']);router[_0x4ca8('0x9')]('/:id/run',auth[_0x4ca8('0xa')](),controller[_0x4ca8('0xd')]);router[_0x4ca8('0x9')](_0x4ca8('0xe'),auth[_0x4ca8('0xa')](),controller[_0x4ca8('0xf')]);router[_0x4ca8('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x4ca8('0xa')](),controller['update']);router[_0x4ca8('0x11')](_0x4ca8('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4ca8('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 3598026..73bb403 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 _0x5ea3=['manual','scheduled','UNSIGNED','STRING','moment','exports','ENUM','csv','xlsx','DATE'];(function(_0x13ea1c,_0x216164){var _0x2eee5d=function(_0x52b7f8){while(--_0x52b7f8){_0x13ea1c['push'](_0x13ea1c['shift']());}};_0x2eee5d(++_0x216164);}(_0x5ea3,0xe0));var _0x35ea=function(_0x399e7f,_0x3d2794){_0x399e7f=_0x399e7f-0x0;var _0x13e1b2=_0x5ea3[_0x399e7f];return _0x13e1b2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x35ea('0x0'));module[_0x35ea('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x35ea('0x2')](_0x35ea('0x3'),'pdf',_0x35ea('0x4')),'allowNull':![],'defaultValue':_0x35ea('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x35ea('0x5')]},'endDate':{'type':Sequelize[_0x35ea('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x35ea('0x6'),_0x35ea('0x7')),'allowNull':![],'defaultValue':_0x35ea('0x6')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x35ea('0x8')]},'reportType':{'type':Sequelize[_0x35ea('0x9')]}}; \ No newline at end of file +var _0x3289=['UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER'];(function(_0x477cfb,_0xa3c864){var _0x3f20c3=function(_0x1738dd){while(--_0x1738dd){_0x477cfb['push'](_0x477cfb['shift']());}};_0x3f20c3(++_0xa3c864);}(_0x3289,0xaa));var _0x9328=function(_0x3556e9,_0x1a6ab7){_0x3556e9=_0x3556e9-0x0;var _0x112adc=_0x3289[_0x3556e9];return _0x112adc;};'use strict';var Sequelize=require(_0x9328('0x0'));var moment=require('moment');module[_0x9328('0x1')]={'name':{'type':Sequelize[_0x9328('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x9328('0x3')](_0x9328('0x4'),_0x9328('0x5'),_0x9328('0x6')),'allowNull':![],'defaultValue':_0x9328('0x4')},'savename':{'type':Sequelize[_0x9328('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9328('0x7')]},'endDate':{'type':Sequelize[_0x9328('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x9328('0x8')},'type':{'type':Sequelize[_0x9328('0x3')]('manual',_0x9328('0x9')),'allowNull':![],'defaultValue':_0x9328('0xa')},'reportId':{'type':Sequelize[_0x9328('0xb')](0xb)[_0x9328('0xc')]},'reportType':{'type':Sequelize[_0x9328('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 9131341..17d43ff 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 _0x8803=['Report\x20not\x20found\x20or\x20empty','exists','sendStatus','download','savename','format','%s.%s','output','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','ExtractedReports','error','name','send','index','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','findAll','catch','show','params','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','existsSync','join','root','server/files/reports','Sequelize'];(function(_0x1a5861,_0x676eb1){var _0x216116=function(_0x55a958){while(--_0x55a958){_0x1a5861['push'](_0x1a5861['shift']());}};_0x216116(++_0x676eb1);}(_0x8803,0x17c));var _0x3880=function(_0x2e7e4d,_0x466190){_0x2e7e4d=_0x2e7e4d-0x0;var _0x52dcad=_0x8803[_0x2e7e4d];return _0x52dcad;};'use strict';var emlformat=require(_0x3880('0x0'));var rimraf=require(_0x3880('0x1'));var zipdir=require(_0x3880('0x2'));var jsonpatch=require(_0x3880('0x3'));var rp=require(_0x3880('0x4'));var moment=require(_0x3880('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3880('0x6'));var util=require(_0x3880('0x7'));var path=require(_0x3880('0x8'));var sox=require('sox');var csv=require(_0x3880('0x9'));var ejs=require(_0x3880('0xa'));var fs=require('fs');var fs_extra=require(_0x3880('0xb'));var _=require('lodash');var squel=require(_0x3880('0xc'));var crypto=require(_0x3880('0xd'));var jsforce=require(_0x3880('0xe'));var deskjs=require(_0x3880('0xf'));var toCsv=require(_0x3880('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3880('0x10'));var qs=require(_0x3880('0x11'));var as=require(_0x3880('0x12'));var hardwareService=require(_0x3880('0x13'));var logger=require(_0x3880('0x14'))(_0x3880('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3880('0x16'));var db=require(_0x3880('0x17'))['db'];function respondWithStatusCode(_0x206e19,_0x42d394){_0x42d394=_0x42d394||0xcc;return function(_0x10924e){if(_0x10924e){return _0x206e19['sendStatus'](_0x42d394);}return _0x206e19['status'](_0x42d394)['end']();};}function respondWithResult(_0x17c98a,_0x555515){_0x555515=_0x555515||0xc8;return function(_0x5e2918){if(_0x5e2918){return _0x17c98a[_0x3880('0x18')](_0x555515)[_0x3880('0x19')](_0x5e2918);}};}function respondWithFilteredResult(_0x22b9a5,_0x5cb7a1){return function(_0x5db88a){if(_0x5db88a){var _0x20444c=typeof _0x5cb7a1[_0x3880('0x1a')]===_0x3880('0x1b')&&typeof _0x5cb7a1[_0x3880('0x1c')]===_0x3880('0x1b');var _0x58a1be=_0x5db88a['count'];var _0x31f617=_0x20444c?0x0:_0x5cb7a1['offset'];var _0x1348c5=_0x20444c?_0x5db88a[_0x3880('0x1d')]:_0x5cb7a1['offset']+_0x5cb7a1[_0x3880('0x1c')];var _0x4b47fc;if(_0x1348c5>=_0x58a1be){_0x1348c5=_0x58a1be;_0x4b47fc=0xc8;}else{_0x4b47fc=0xce;}_0x22b9a5['status'](_0x4b47fc);return _0x22b9a5[_0x3880('0x1e')](_0x3880('0x1f'),_0x31f617+'-'+_0x1348c5+'/'+_0x58a1be)[_0x3880('0x19')](_0x5db88a);}return null;};}function patchUpdates(_0x192ba3){return function(_0x170200){try{jsonpatch[_0x3880('0x20')](_0x170200,_0x192ba3,!![]);}catch(_0xc15bb3){return BPromise['reject'](_0xc15bb3);}return _0x170200['save']();};}function saveUpdates(_0x3c9933,_0x3a6c3b){return function(_0x3387be){if(_0x3387be){return _0x3387be[_0x3880('0x21')](_0x3c9933)[_0x3880('0x22')](function(_0x19beb8){return _0x19beb8;});}return null;};}function removeEntity(_0x349e3b,_0x39d481){return function(_0x5dfea4){if(_0x5dfea4){return _0x5dfea4[_0x3880('0x23')]()['then'](function(){var _0x32081b=_0x5dfea4['get']({'plain':!![]});var _0x2ded48=_0x3880('0x24');return db['UserProfileResource'][_0x3880('0x23')]({'where':{'type':_0x2ded48,'resourceId':_0x32081b['id']}})['then'](function(){return _0x5dfea4;});})[_0x3880('0x22')](function(){_0x349e3b[_0x3880('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5c9b,_0x50c19d){return function(_0xbe116a){if(!_0xbe116a){_0x1e5c9b['sendStatus'](0x194);}return _0xbe116a;};}function handleError(_0x38784b,_0x2fc471){_0x2fc471=_0x2fc471||0x1f4;return function(_0x12fd67){logger[_0x3880('0x25')](_0x12fd67['stack']);if(_0x12fd67[_0x3880('0x26')]){delete _0x12fd67[_0x3880('0x26')];}_0x38784b[_0x3880('0x18')](_0x2fc471)[_0x3880('0x27')](_0x12fd67);};}exports[_0x3880('0x28')]=function(_0x2416ba,_0x3fd3bf){var _0x6560e9={},_0x4bb0db={},_0xccc2f4={'count':0x0,'rows':[]};var _0x2c54dc=_['map'](db['AnalyticExtractedReport'][_0x3880('0x29')],function(_0xee2530){return{'name':_0xee2530['fieldName'],'type':_0xee2530[_0x3880('0x2a')][_0x3880('0x2b')]};});_0x4bb0db[_0x3880('0x2c')]=_[_0x3880('0x2d')](_0x2c54dc,'name');_0x4bb0db[_0x3880('0x2e')]=_[_0x3880('0x2f')](_0x2416ba[_0x3880('0x2e')]);_0x4bb0db['filters']=_['intersection'](_0x4bb0db['model'],_0x4bb0db[_0x3880('0x2e')]);_0x6560e9[_0x3880('0x30')]=_[_0x3880('0x31')](_0x4bb0db['model'],qs[_0x3880('0x32')](_0x2416ba[_0x3880('0x2e')]['fields']));_0x6560e9['attributes']=_0x6560e9['attributes'][_0x3880('0x33')]?_0x6560e9[_0x3880('0x30')]:_0x4bb0db[_0x3880('0x2c')];if(!_0x2416ba[_0x3880('0x2e')][_0x3880('0x34')]('nolimit')){_0x6560e9[_0x3880('0x1c')]=qs[_0x3880('0x1c')](_0x2416ba[_0x3880('0x2e')]['limit']);_0x6560e9['offset']=qs['offset'](_0x2416ba[_0x3880('0x2e')][_0x3880('0x1a')]);}_0x6560e9[_0x3880('0x35')]=qs[_0x3880('0x36')](_0x2416ba[_0x3880('0x2e')]['sort']);_0x6560e9[_0x3880('0x37')]=qs[_0x3880('0x38')](_['pick'](_0x2416ba[_0x3880('0x2e')],_0x4bb0db[_0x3880('0x38')]),_0x2c54dc);if(_0x2416ba['query'][_0x3880('0x39')]){_0x6560e9['where']=_[_0x3880('0x3a')](_0x6560e9[_0x3880('0x37')],{'$or':_[_0x3880('0x2d')](_0x2c54dc,function(_0x377f5d){if(_0x377f5d['type']!==_0x3880('0x3b')){var _0x35090e={};_0x35090e[_0x377f5d[_0x3880('0x26')]]={'$like':'%'+_0x2416ba['query']['filter']+'%'};return _0x35090e;}})});}_0x6560e9=_[_0x3880('0x3a')]({},_0x6560e9,_0x2416ba[_0x3880('0x3c')]);var _0x33c8e4={'where':_0x6560e9[_0x3880('0x37')]};return db[_0x3880('0x3d')]['count'](_0x33c8e4)[_0x3880('0x22')](function(_0x12936e){_0xccc2f4['count']=_0x12936e;if(_0x2416ba[_0x3880('0x2e')][_0x3880('0x3e')]){_0x6560e9['include']=[{'all':!![]}];}return db[_0x3880('0x3d')][_0x3880('0x3f')](_0x6560e9);})[_0x3880('0x22')](function(_0x22dc45){_0xccc2f4['rows']=_0x22dc45;return _0xccc2f4;})['then'](respondWithFilteredResult(_0x3fd3bf,_0x6560e9))[_0x3880('0x40')](handleError(_0x3fd3bf,null));};exports[_0x3880('0x41')]=function(_0x159c9a,_0x2292f9){var _0x917b1f={'raw':!![],'where':{'id':_0x159c9a[_0x3880('0x42')]['id']}},_0x243431={};_0x243431['model']=_[_0x3880('0x2f')](db[_0x3880('0x3d')]['rawAttributes']);_0x243431[_0x3880('0x2e')]=_[_0x3880('0x2f')](_0x159c9a[_0x3880('0x2e')]);_0x243431[_0x3880('0x38')]=_[_0x3880('0x31')](_0x243431[_0x3880('0x2c')],_0x243431['query']);_0x917b1f[_0x3880('0x30')]=_['intersection'](_0x243431['model'],qs[_0x3880('0x32')](_0x159c9a[_0x3880('0x2e')]['fields']));_0x917b1f[_0x3880('0x30')]=_0x917b1f['attributes'][_0x3880('0x33')]?_0x917b1f['attributes']:_0x243431[_0x3880('0x2c')];if(_0x159c9a[_0x3880('0x2e')]['includeAll']){_0x917b1f[_0x3880('0x43')]=[{'all':!![]}];}_0x917b1f=_[_0x3880('0x3a')]({},_0x917b1f,_0x159c9a[_0x3880('0x3c')]);return db['AnalyticExtractedReport'][_0x3880('0x44')](_0x917b1f)['then'](handleEntityNotFound(_0x2292f9,null))[_0x3880('0x22')](respondWithResult(_0x2292f9,null))[_0x3880('0x40')](handleError(_0x2292f9,null));};exports['create']=function(_0x597389,_0x16e415){return db['AnalyticExtractedReport']['create'](_0x597389[_0x3880('0x45')],{})[_0x3880('0x22')](function(_0x2fdc83){var _0xed82fa=_0x597389[_0x3880('0x46')][_0x3880('0x47')]({'plain':!![]});if(!_0xed82fa)throw new Error(_0x3880('0x48'));if(_0xed82fa[_0x3880('0x49')]===_0x3880('0x46')){var _0x5201c2=_0x2fdc83[_0x3880('0x47')]({'plain':!![]});var _0x5bdabd=_0x3880('0x24');return db[_0x3880('0x4a')]['find']({'where':{'name':_0x5bdabd,'userProfileId':_0xed82fa['userProfileId']},'raw':!![]})[_0x3880('0x22')](function(_0x1142d5){if(_0x1142d5&&_0x1142d5[_0x3880('0x4b')]===0x0){return db[_0x3880('0x4c')][_0x3880('0x4d')]({'name':_0x5201c2[_0x3880('0x26')],'resourceId':_0x5201c2['id'],'type':_0x1142d5['name'],'sectionId':_0x1142d5['id']},{})[_0x3880('0x22')](function(){return _0x2fdc83;});}else{return _0x2fdc83;}})[_0x3880('0x40')](function(_0x33115f){logger[_0x3880('0x25')](_0x3880('0x4e'),_0x33115f);throw _0x33115f;});}return _0x2fdc83;})[_0x3880('0x22')](respondWithResult(_0x16e415,0xc9))[_0x3880('0x40')](handleError(_0x16e415,null));};exports[_0x3880('0x21')]=function(_0x1a4378,_0xa86047){if(_0x1a4378[_0x3880('0x45')]['id']){delete _0x1a4378[_0x3880('0x45')]['id'];}return db[_0x3880('0x3d')][_0x3880('0x44')]({'where':{'id':_0x1a4378['params']['id']}})[_0x3880('0x22')](handleEntityNotFound(_0xa86047,null))[_0x3880('0x22')](saveUpdates(_0x1a4378['body'],null))['then'](respondWithResult(_0xa86047,null))[_0x3880('0x40')](handleError(_0xa86047,null));};exports[_0x3880('0x23')]=function(_0x1b6bbc,_0x4008ff){return db[_0x3880('0x3d')][_0x3880('0x44')]({'where':{'id':_0x1b6bbc[_0x3880('0x42')]['id']}})['then'](handleEntityNotFound(_0x4008ff,null))[_0x3880('0x22')](removeEntity(_0x4008ff,null))[_0x3880('0x40')](handleError(_0x4008ff,null));};exports['download']=function(_0x2dadbc,_0x4936d0,_0x74fdb0){return db['AnalyticExtractedReport'][_0x3880('0x44')]({'where':{'id':_0x2dadbc[_0x3880('0x42')]['id']},'attributes':[_0x3880('0x26'),_0x3880('0x4f'),'savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x4936d0,null))[_0x3880('0x22')](function(_0x2f1297){if(_0x2f1297){if(!fs[_0x3880('0x50')](path[_0x3880('0x51')](config[_0x3880('0x52')],_0x3880('0x53'),_0x2f1297['savename']))){throw new db[(_0x3880('0x54'))]['ValidationError'](_0x3880('0x55'));}if(_0x2dadbc['query'][_0x3880('0x56')]){return _0x4936d0[_0x3880('0x57')](0xc8);}return _0x4936d0[_0x3880('0x58')](path[_0x3880('0x51')](config[_0x3880('0x52')],_0x3880('0x53'),_0x2f1297[_0x3880('0x59')]),util[_0x3880('0x5a')](_0x3880('0x5b'),_0x2f1297[_0x3880('0x4f')]||_0x2f1297['name'],_0x2f1297[_0x3880('0x5c')]['toLowerCase']()));}})[_0x3880('0x40')](handleError(_0x4936d0,null));}; \ No newline at end of file +var _0xc9cf=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','stack','name','index','AnalyticExtractedReport','type','key','model','map','keys','intersection','attributes','fields','length','query','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','output','join','root','server/files/reports','Sequelize','savename','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xc9cf,0x103));var _0xfc9c=function(_0x26c112,_0x41e2fd){_0x26c112=_0x26c112-0x0;var _0x4933d8=_0xc9cf[_0x26c112];return _0x4933d8;};'use strict';var emlformat=require(_0xfc9c('0x0'));var rimraf=require(_0xfc9c('0x1'));var zipdir=require(_0xfc9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfc9c('0x3'));var BPromise=require(_0xfc9c('0x4'));var Mustache=require(_0xfc9c('0x5'));var util=require(_0xfc9c('0x6'));var path=require(_0xfc9c('0x7'));var sox=require(_0xfc9c('0x8'));var csv=require(_0xfc9c('0x9'));var ejs=require(_0xfc9c('0xa'));var fs=require('fs');var fs_extra=require(_0xfc9c('0xb'));var _=require(_0xfc9c('0xc'));var squel=require(_0xfc9c('0xd'));var crypto=require(_0xfc9c('0xe'));var jsforce=require(_0xfc9c('0xf'));var deskjs=require(_0xfc9c('0x10'));var toCsv=require(_0xfc9c('0x9'));var querystring=require(_0xfc9c('0x11'));var Papa=require(_0xfc9c('0x12'));var Redis=require(_0xfc9c('0x13'));var authService=require(_0xfc9c('0x14'));var qs=require(_0xfc9c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc9c('0x16'));var logger=require(_0xfc9c('0x17'))(_0xfc9c('0x18'));var utils=require('../../config/utils');var config=require(_0xfc9c('0x19'));var licenseUtil=require(_0xfc9c('0x1a'));var db=require(_0xfc9c('0x1b'))['db'];function respondWithStatusCode(_0x5123f4,_0x53832f){_0x53832f=_0x53832f||0xcc;return function(_0x24cd7f){if(_0x24cd7f){return _0x5123f4[_0xfc9c('0x1c')](_0x53832f);}return _0x5123f4[_0xfc9c('0x1d')](_0x53832f)[_0xfc9c('0x1e')]();};}function respondWithResult(_0x4bd02a,_0x3fda3d){_0x3fda3d=_0x3fda3d||0xc8;return function(_0x4897ee){if(_0x4897ee){return _0x4bd02a[_0xfc9c('0x1d')](_0x3fda3d)[_0xfc9c('0x1f')](_0x4897ee);}};}function respondWithFilteredResult(_0x453c4a,_0x91d08a){return function(_0x4ff9a8){if(_0x4ff9a8){var _0x24e037=typeof _0x91d08a[_0xfc9c('0x20')]===_0xfc9c('0x21')&&typeof _0x91d08a['limit']===_0xfc9c('0x21');var _0x38152f=_0x4ff9a8[_0xfc9c('0x22')];var _0x283afe=_0x24e037?0x0:_0x91d08a['offset'];var _0x1eaab8=_0x24e037?_0x4ff9a8[_0xfc9c('0x22')]:_0x91d08a['offset']+_0x91d08a[_0xfc9c('0x23')];var _0xec0ff7;if(_0x1eaab8>=_0x38152f){_0x1eaab8=_0x38152f;_0xec0ff7=0xc8;}else{_0xec0ff7=0xce;}_0x453c4a[_0xfc9c('0x1d')](_0xec0ff7);return _0x453c4a['set'](_0xfc9c('0x24'),_0x283afe+'-'+_0x1eaab8+'/'+_0x38152f)[_0xfc9c('0x1f')](_0x4ff9a8);}return null;};}function patchUpdates(_0x50d6df){return function(_0xea3310){try{jsonpatch[_0xfc9c('0x25')](_0xea3310,_0x50d6df,!![]);}catch(_0xdd757){return BPromise[_0xfc9c('0x26')](_0xdd757);}return _0xea3310[_0xfc9c('0x27')]();};}function saveUpdates(_0x52be30,_0x2ec1d3){return function(_0x2d6911){if(_0x2d6911){return _0x2d6911[_0xfc9c('0x28')](_0x52be30)[_0xfc9c('0x29')](function(_0x481da1){return _0x481da1;});}return null;};}function removeEntity(_0x53ef65,_0x10bb7c){return function(_0x40a661){if(_0x40a661){return _0x40a661['destroy']()[_0xfc9c('0x29')](function(){var _0x434ec4=_0x40a661[_0xfc9c('0x2a')]({'plain':!![]});var _0x2b9ace=_0xfc9c('0x2b');return db[_0xfc9c('0x2c')]['destroy']({'where':{'type':_0x2b9ace,'resourceId':_0x434ec4['id']}})['then'](function(){return _0x40a661;});})[_0xfc9c('0x29')](function(){_0x53ef65['status'](0xcc)[_0xfc9c('0x1e')]();});}};}function handleEntityNotFound(_0x351bfa,_0x17b4d3){return function(_0x3e3aa3){if(!_0x3e3aa3){_0x351bfa[_0xfc9c('0x1c')](0x194);}return _0x3e3aa3;};}function handleError(_0x11c800,_0x2b7bdd){_0x2b7bdd=_0x2b7bdd||0x1f4;return function(_0x5c2ab9){logger['error'](_0x5c2ab9[_0xfc9c('0x2d')]);if(_0x5c2ab9[_0xfc9c('0x2e')]){delete _0x5c2ab9[_0xfc9c('0x2e')];}_0x11c800[_0xfc9c('0x1d')](_0x2b7bdd)['send'](_0x5c2ab9);};}exports[_0xfc9c('0x2f')]=function(_0x322f9f,_0xab2d69){var _0x32cc85={},_0x419c6f={},_0x37c5ec={'count':0x0,'rows':[]};var _0x406a99=_['map'](db[_0xfc9c('0x30')]['rawAttributes'],function(_0x5c2121){return{'name':_0x5c2121['fieldName'],'type':_0x5c2121[_0xfc9c('0x31')][_0xfc9c('0x32')]};});_0x419c6f[_0xfc9c('0x33')]=_[_0xfc9c('0x34')](_0x406a99,_0xfc9c('0x2e'));_0x419c6f['query']=_[_0xfc9c('0x35')](_0x322f9f['query']);_0x419c6f['filters']=_[_0xfc9c('0x36')](_0x419c6f[_0xfc9c('0x33')],_0x419c6f['query']);_0x32cc85[_0xfc9c('0x37')]=_[_0xfc9c('0x36')](_0x419c6f[_0xfc9c('0x33')],qs['fields'](_0x322f9f['query'][_0xfc9c('0x38')]));_0x32cc85['attributes']=_0x32cc85['attributes'][_0xfc9c('0x39')]?_0x32cc85['attributes']:_0x419c6f[_0xfc9c('0x33')];if(!_0x322f9f[_0xfc9c('0x3a')]['hasOwnProperty'](_0xfc9c('0x3b'))){_0x32cc85['limit']=qs[_0xfc9c('0x23')](_0x322f9f[_0xfc9c('0x3a')][_0xfc9c('0x23')]);_0x32cc85[_0xfc9c('0x20')]=qs[_0xfc9c('0x20')](_0x322f9f['query'][_0xfc9c('0x20')]);}_0x32cc85[_0xfc9c('0x3c')]=qs['sort'](_0x322f9f[_0xfc9c('0x3a')][_0xfc9c('0x3d')]);_0x32cc85[_0xfc9c('0x3e')]=qs[_0xfc9c('0x3f')](_[_0xfc9c('0x40')](_0x322f9f[_0xfc9c('0x3a')],_0x419c6f['filters']),_0x406a99);if(_0x322f9f[_0xfc9c('0x3a')][_0xfc9c('0x41')]){_0x32cc85[_0xfc9c('0x3e')]=_['merge'](_0x32cc85[_0xfc9c('0x3e')],{'$or':_[_0xfc9c('0x34')](_0x406a99,function(_0x38f468){if(_0x38f468['type']!==_0xfc9c('0x42')){var _0x3fa671={};_0x3fa671[_0x38f468[_0xfc9c('0x2e')]]={'$like':'%'+_0x322f9f['query']['filter']+'%'};return _0x3fa671;}})});}_0x32cc85=_[_0xfc9c('0x43')]({},_0x32cc85,_0x322f9f[_0xfc9c('0x44')]);var _0x362e17={'where':_0x32cc85[_0xfc9c('0x3e')]};return db[_0xfc9c('0x30')][_0xfc9c('0x22')](_0x362e17)[_0xfc9c('0x29')](function(_0x598b2e){_0x37c5ec[_0xfc9c('0x22')]=_0x598b2e;if(_0x322f9f[_0xfc9c('0x3a')][_0xfc9c('0x45')]){_0x32cc85['include']=[{'all':!![]}];}return db[_0xfc9c('0x30')][_0xfc9c('0x46')](_0x32cc85);})[_0xfc9c('0x29')](function(_0x7ce0f6){_0x37c5ec[_0xfc9c('0x47')]=_0x7ce0f6;return _0x37c5ec;})[_0xfc9c('0x29')](respondWithFilteredResult(_0xab2d69,_0x32cc85))[_0xfc9c('0x48')](handleError(_0xab2d69,null));};exports[_0xfc9c('0x49')]=function(_0x2fbcf9,_0x462bfb){var _0x3b2ce5={'raw':!![],'where':{'id':_0x2fbcf9['params']['id']}},_0xcb2549={};_0xcb2549[_0xfc9c('0x33')]=_[_0xfc9c('0x35')](db[_0xfc9c('0x30')][_0xfc9c('0x4a')]);_0xcb2549['query']=_[_0xfc9c('0x35')](_0x2fbcf9[_0xfc9c('0x3a')]);_0xcb2549[_0xfc9c('0x3f')]=_[_0xfc9c('0x36')](_0xcb2549[_0xfc9c('0x33')],_0xcb2549[_0xfc9c('0x3a')]);_0x3b2ce5[_0xfc9c('0x37')]=_[_0xfc9c('0x36')](_0xcb2549[_0xfc9c('0x33')],qs[_0xfc9c('0x38')](_0x2fbcf9['query'][_0xfc9c('0x38')]));_0x3b2ce5[_0xfc9c('0x37')]=_0x3b2ce5[_0xfc9c('0x37')]['length']?_0x3b2ce5[_0xfc9c('0x37')]:_0xcb2549[_0xfc9c('0x33')];if(_0x2fbcf9['query'][_0xfc9c('0x45')]){_0x3b2ce5[_0xfc9c('0x4b')]=[{'all':!![]}];}_0x3b2ce5=_[_0xfc9c('0x43')]({},_0x3b2ce5,_0x2fbcf9[_0xfc9c('0x44')]);return db[_0xfc9c('0x30')][_0xfc9c('0x4c')](_0x3b2ce5)[_0xfc9c('0x29')](handleEntityNotFound(_0x462bfb,null))['then'](respondWithResult(_0x462bfb,null))[_0xfc9c('0x48')](handleError(_0x462bfb,null));};exports[_0xfc9c('0x4d')]=function(_0x47670c,_0x3a3fd6){return db[_0xfc9c('0x30')][_0xfc9c('0x4d')](_0x47670c[_0xfc9c('0x4e')],{})[_0xfc9c('0x29')](function(_0x40940c){var _0x1894c7=_0x47670c[_0xfc9c('0x4f')][_0xfc9c('0x2a')]({'plain':!![]});if(!_0x1894c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1894c7[_0xfc9c('0x50')]===_0xfc9c('0x4f')){var _0x589a62=_0x40940c[_0xfc9c('0x2a')]({'plain':!![]});var _0x186e0d='ExtractedReports';return db[_0xfc9c('0x51')][_0xfc9c('0x4c')]({'where':{'name':_0x186e0d,'userProfileId':_0x1894c7['userProfileId']},'raw':!![]})[_0xfc9c('0x29')](function(_0x3fa49f){if(_0x3fa49f&&_0x3fa49f['autoAssociation']===0x0){return db['UserProfileResource'][_0xfc9c('0x4d')]({'name':_0x589a62[_0xfc9c('0x2e')],'resourceId':_0x589a62['id'],'type':_0x3fa49f[_0xfc9c('0x2e')],'sectionId':_0x3fa49f['id']},{})['then'](function(){return _0x40940c;});}else{return _0x40940c;}})[_0xfc9c('0x48')](function(_0x28270b){logger[_0xfc9c('0x52')](_0xfc9c('0x53'),_0x28270b);throw _0x28270b;});}return _0x40940c;})[_0xfc9c('0x29')](respondWithResult(_0x3a3fd6,0xc9))[_0xfc9c('0x48')](handleError(_0x3a3fd6,null));};exports[_0xfc9c('0x28')]=function(_0x1b4642,_0x3f31e7){if(_0x1b4642[_0xfc9c('0x4e')]['id']){delete _0x1b4642[_0xfc9c('0x4e')]['id'];}return db[_0xfc9c('0x30')][_0xfc9c('0x4c')]({'where':{'id':_0x1b4642[_0xfc9c('0x54')]['id']}})[_0xfc9c('0x29')](handleEntityNotFound(_0x3f31e7,null))[_0xfc9c('0x29')](saveUpdates(_0x1b4642[_0xfc9c('0x4e')],null))['then'](respondWithResult(_0x3f31e7,null))[_0xfc9c('0x48')](handleError(_0x3f31e7,null));};exports['destroy']=function(_0x9a7ba7,_0x276223){return db[_0xfc9c('0x30')][_0xfc9c('0x4c')]({'where':{'id':_0x9a7ba7[_0xfc9c('0x54')]['id']}})[_0xfc9c('0x29')](handleEntityNotFound(_0x276223,null))[_0xfc9c('0x29')](removeEntity(_0x276223,null))[_0xfc9c('0x48')](handleError(_0x276223,null));};exports[_0xfc9c('0x55')]=function(_0x36a867,_0xea74b6,_0x2644cc){return db[_0xfc9c('0x30')][_0xfc9c('0x4c')]({'where':{'id':_0x36a867[_0xfc9c('0x54')]['id']},'attributes':['name','basename','savename',_0xfc9c('0x56')],'raw':!![]})[_0xfc9c('0x29')](handleEntityNotFound(_0xea74b6,null))[_0xfc9c('0x29')](function(_0x2331bd){if(_0x2331bd){if(!fs['existsSync'](path[_0xfc9c('0x57')](config[_0xfc9c('0x58')],_0xfc9c('0x59'),_0x2331bd['savename']))){throw new db[(_0xfc9c('0x5a'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x36a867[_0xfc9c('0x3a')]['exists']){return _0xea74b6['sendStatus'](0xc8);}return _0xea74b6[_0xfc9c('0x55')](path[_0xfc9c('0x57')](config[_0xfc9c('0x58')],'server/files/reports',_0x2331bd[_0xfc9c('0x5b')]),util[_0xfc9c('0x5c')](_0xfc9c('0x5d'),_0x2331bd['basename']||_0x2331bd['name'],_0x2331bd[_0xfc9c('0x56')][_0xfc9c('0x5e')]()));}})[_0xfc9c('0x48')](handleError(_0xea74b6,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 73474bf..3cb4ba6 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 _0x172a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x172a,0x1ba));var _0xa172=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x172a[_0x119280];return _0x481797;};'use strict';var _=require(_0xa172('0x0'));var util=require(_0xa172('0x1'));var logger=require(_0xa172('0x2'))(_0xa172('0x3'));var moment=require(_0xa172('0x4'));var BPromise=require(_0xa172('0x5'));var rp=require(_0xa172('0x6'));var fs=require('fs');var path=require(_0xa172('0x7'));var rimraf=require(_0xa172('0x8'));var config=require(_0xa172('0x9'));var attributes=require(_0xa172('0xa'));module[_0xa172('0xb')]=function(_0x3284fb,_0x514186){return _0x3284fb[_0xa172('0xc')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3882=['moment','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger'];(function(_0x2d10f7,_0x36abd0){var _0x94c2f7=function(_0xcb5708){while(--_0xcb5708){_0x2d10f7['push'](_0x2d10f7['shift']());}};_0x94c2f7(++_0x36abd0);}(_0x3882,0x152));var _0x2388=function(_0x418413,_0x105785){_0x418413=_0x418413-0x0;var _0x4cd7ef=_0x3882[_0x418413];return _0x4cd7ef;};'use strict';var _=require('lodash');var util=require(_0x2388('0x0'));var logger=require(_0x2388('0x1'))('api');var moment=require(_0x2388('0x2'));var BPromise=require('bluebird');var rp=require(_0x2388('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2388('0x4'));var attributes=require(_0x2388('0x5'));module[_0x2388('0x6')]=function(_0x308ca2,_0x8a7e73){return _0x308ca2[_0x2388('0x7')](_0x2388('0x8'),attributes,{'tableName':_0x2388('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 24eb859..a84e803 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 _0x5330=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','../../config/utils'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0x5330,0x13c));var _0x0533=function(_0x3a8100,_0x5406cf){_0x3a8100=_0x3a8100-0x0;var _0x120743=_0x5330[_0x3a8100];return _0x120743;};'use strict';var _=require(_0x0533('0x0'));var util=require(_0x0533('0x1'));var moment=require(_0x0533('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0533('0x3'));var logger=require(_0x0533('0x4'))(_0x0533('0x5'));var config=require(_0x0533('0x6'));var jayson=require(_0x0533('0x7'));var client=jayson[_0x0533('0x8')][_0x0533('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x455e18,_0x361a3d,_0x339af6){return new BPromise(function(_0x245a50,_0x2e90ba){return client[_0x0533('0xa')](_0x455e18,_0x339af6)['then'](function(_0x18b7d2){logger[_0x0533('0xb')](_0x0533('0xc'),_0x361a3d,_0x0533('0xd'));logger[_0x0533('0xe')](_0x0533('0xf'),_0x361a3d,_0x0533('0xd'),JSON[_0x0533('0x10')](_0x18b7d2));if(_0x18b7d2[_0x0533('0x11')]){if(_0x18b7d2['error'][_0x0533('0x12')]===0x1f4){logger[_0x0533('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x361a3d,_0x18b7d2[_0x0533('0x11')]['message']);return _0x2e90ba(_0x18b7d2['error'][_0x0533('0x13')]);}logger[_0x0533('0x11')](_0x0533('0xc'),_0x361a3d,_0x18b7d2['error'][_0x0533('0x13')]);return _0x245a50(_0x18b7d2['error'][_0x0533('0x13')]);}else{logger[_0x0533('0xb')](_0x0533('0xc'),_0x361a3d,'request\x20sent');_0x245a50(_0x18b7d2['result'][_0x0533('0x13')]);}})['catch'](function(_0x36f2ed){logger[_0x0533('0x11')](_0x0533('0xc'),_0x361a3d,_0x36f2ed);_0x2e90ba(_0x36f2ed);});});} \ No newline at end of file +var _0xc80f=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc80f,0x1a5));var _0xfc80=function(_0x143b0a,_0x78c96b){_0x143b0a=_0x143b0a-0x0;var _0x39bf44=_0xc80f[_0x143b0a];return _0x39bf44;};'use strict';var _=require(_0xfc80('0x0'));var util=require(_0xfc80('0x1'));var moment=require(_0xfc80('0x2'));var BPromise=require(_0xfc80('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc80('0x4'));var db=require(_0xfc80('0x5'))['db'];var utils=require(_0xfc80('0x6'));var logger=require(_0xfc80('0x7'))(_0xfc80('0x8'));var config=require(_0xfc80('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21b3ad,_0x33a770,_0x3a8630){return new BPromise(function(_0x39146b,_0x21b074){return client[_0xfc80('0xa')](_0x21b3ad,_0x3a8630)['then'](function(_0x380877){logger['info'](_0xfc80('0xb'),_0x33a770,_0xfc80('0xc'));logger['debug'](_0xfc80('0xd'),_0x33a770,'request\x20sent',JSON[_0xfc80('0xe')](_0x380877));if(_0x380877[_0xfc80('0xf')]){if(_0x380877[_0xfc80('0xf')]['code']===0x1f4){logger[_0xfc80('0xf')](_0xfc80('0xb'),_0x33a770,_0x380877[_0xfc80('0xf')][_0xfc80('0x10')]);return _0x21b074(_0x380877[_0xfc80('0xf')]['message']);}logger['error'](_0xfc80('0xb'),_0x33a770,_0x380877[_0xfc80('0xf')][_0xfc80('0x10')]);return _0x39146b(_0x380877['error'][_0xfc80('0x10')]);}else{logger[_0xfc80('0x11')](_0xfc80('0xb'),_0x33a770,'request\x20sent');_0x39146b(_0x380877[_0xfc80('0x12')]['message']);}})[_0xfc80('0x13')](function(_0x5f4d3d){logger[_0xfc80('0xf')](_0xfc80('0xb'),_0x33a770,_0x5f4d3d);_0x21b074(_0x5f4d3d);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index dabeda9..01947ec 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 _0x9a39=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x9a39,0x7a));var _0x99a3=function(_0x26c1f1,_0x5bbb45){_0x26c1f1=_0x26c1f1-0x0;var _0x19e92f=_0x9a39[_0x26c1f1];return _0x19e92f;};'use strict';var multer=require('multer');var util=require(_0x99a3('0x0'));var path=require(_0x99a3('0x1'));var timeout=require(_0x99a3('0x2'));var express=require(_0x99a3('0x3'));var router=express[_0x99a3('0x4')]();var fs_extra=require(_0x99a3('0x5'));var auth=require(_0x99a3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x99a3('0x7')]('/',auth[_0x99a3('0x8')](),controller[_0x99a3('0x9')]);router[_0x99a3('0x7')](_0x99a3('0xa'),auth[_0x99a3('0x8')](),controller[_0x99a3('0xb')]);router[_0x99a3('0x7')](_0x99a3('0xc'),auth[_0x99a3('0x8')](),controller[_0x99a3('0xd')]);router[_0x99a3('0xe')]('/',auth['isAuthenticated'](),controller[_0x99a3('0xf')]);router[_0x99a3('0x10')](_0x99a3('0xa'),auth[_0x99a3('0x8')](),controller[_0x99a3('0x11')]);router['delete']('/:id',auth[_0x99a3('0x8')](),controller[_0x99a3('0x12')]);module[_0x99a3('0x13')]=router; \ No newline at end of file +var _0x7791=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x2f1d18,_0x4f65ee){var _0x3caada=function(_0x3daaca){while(--_0x3daaca){_0x2f1d18['push'](_0x2f1d18['shift']());}};_0x3caada(++_0x4f65ee);}(_0x7791,0x1b4));var _0x1779=function(_0x3432c6,_0x1d2fcf){_0x3432c6=_0x3432c6-0x0;var _0x2a893f=_0x7791[_0x3432c6];return _0x2a893f;};'use strict';var multer=require('multer');var util=require(_0x1779('0x0'));var path=require(_0x1779('0x1'));var timeout=require(_0x1779('0x2'));var express=require(_0x1779('0x3'));var router=express[_0x1779('0x4')]();var fs_extra=require(_0x1779('0x5'));var auth=require(_0x1779('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1779('0x7'));var controller=require(_0x1779('0x8'));router[_0x1779('0x9')]('/',auth[_0x1779('0xa')](),controller[_0x1779('0xb')]);router[_0x1779('0x9')]('/:id',auth[_0x1779('0xa')](),controller[_0x1779('0xc')]);router[_0x1779('0x9')](_0x1779('0xd'),auth[_0x1779('0xa')](),controller[_0x1779('0xe')]);router[_0x1779('0xf')]('/',auth[_0x1779('0xa')](),controller[_0x1779('0x10')]);router[_0x1779('0x11')](_0x1779('0x12'),auth[_0x1779('0xa')](),controller[_0x1779('0x13')]);router[_0x1779('0x14')](_0x1779('0x12'),auth[_0x1779('0xa')](),controller[_0x1779('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 1cb0b15..82415f1 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 _0x9276=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4f034b,_0x4ae230){var _0xac374c=function(_0x880d3e){while(--_0x880d3e){_0x4f034b['push'](_0x4f034b['shift']());}};_0xac374c(++_0x4ae230);}(_0x9276,0x12e));var _0x6927=function(_0x26a8a3,_0x1fdc1b){_0x26a8a3=_0x26a8a3-0x0;var _0x23ab23=_0x9276[_0x26a8a3];return _0x23ab23;};'use strict';var Sequelize=require(_0x6927('0x0'));module[_0x6927('0x1')]={'field':{'type':Sequelize[_0x6927('0x2')]},'alias':{'type':Sequelize[_0x6927('0x3')]},'function':{'type':Sequelize[_0x6927('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6927('0x3')]},'custom':{'type':Sequelize[_0x6927('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf06d=['STRING','BOOLEAN','sequelize'];(function(_0x2bba14,_0x463a51){var _0x308039=function(_0x32a3da){while(--_0x32a3da){_0x2bba14['push'](_0x2bba14['shift']());}};_0x308039(++_0x463a51);}(_0xf06d,0x113));var _0xdf06=function(_0xc2ab78,_0xf702d6){_0xc2ab78=_0xc2ab78-0x0;var _0x20e87d=_0xf06d[_0xc2ab78];return _0x20e87d;};'use strict';var Sequelize=require(_0xdf06('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdf06('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xdf06('0x1')]},'groupBy':{'type':Sequelize[_0xdf06('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdf06('0x1')]},'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 c5875e8..36fd991 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 _0x3d15=['transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','AnalyticFieldReport','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','rawAttributes','find','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne'];(function(_0xb6dbeb,_0x36182e){var _0xc69262=function(_0x44883e){while(--_0x44883e){_0xb6dbeb['push'](_0xb6dbeb['shift']());}};_0xc69262(++_0x36182e);}(_0x3d15,0x142));var _0x53d1=function(_0xd6a568,_0x4d39e9){_0xd6a568=_0xd6a568-0x0;var _0x56e5ab=_0x3d15[_0xd6a568];return _0x56e5ab;};'use strict';var emlformat=require(_0x53d1('0x0'));var rimraf=require(_0x53d1('0x1'));var zipdir=require(_0x53d1('0x2'));var jsonpatch=require(_0x53d1('0x3'));var rp=require('request-promise');var moment=require(_0x53d1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x53d1('0x5'));var util=require(_0x53d1('0x6'));var path=require(_0x53d1('0x7'));var sox=require(_0x53d1('0x8'));var csv=require(_0x53d1('0x9'));var ejs=require(_0x53d1('0xa'));var fs=require('fs');var fs_extra=require(_0x53d1('0xb'));var _=require(_0x53d1('0xc'));var squel=require(_0x53d1('0xd'));var crypto=require(_0x53d1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x53d1('0xf'));var toCsv=require(_0x53d1('0x9'));var querystring=require(_0x53d1('0x10'));var Papa=require(_0x53d1('0x11'));var Redis=require(_0x53d1('0x12'));var authService=require(_0x53d1('0x13'));var qs=require(_0x53d1('0x14'));var as=require(_0x53d1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53d1('0x16'));var utils=require(_0x53d1('0x17'));var config=require(_0x53d1('0x18'));var licenseUtil=require(_0x53d1('0x19'));var db=require(_0x53d1('0x1a'))['db'];function respondWithStatusCode(_0x39a064,_0x41d04d){_0x41d04d=_0x41d04d||0xcc;return function(_0x54dbc5){if(_0x54dbc5){return _0x39a064[_0x53d1('0x1b')](_0x41d04d);}return _0x39a064[_0x53d1('0x1c')](_0x41d04d)[_0x53d1('0x1d')]();};}function respondWithResult(_0x5958b3,_0x57e40e){_0x57e40e=_0x57e40e||0xc8;return function(_0xddfb4d){if(_0xddfb4d){return _0x5958b3[_0x53d1('0x1c')](_0x57e40e)[_0x53d1('0x1e')](_0xddfb4d);}};}function respondWithFilteredResult(_0x17b1bd,_0x201d0e){return function(_0x150bbf){if(_0x150bbf){var _0x79eebe=typeof _0x201d0e[_0x53d1('0x1f')]==='undefined'&&typeof _0x201d0e[_0x53d1('0x20')]==='undefined';var _0x498bac=_0x150bbf['count'];var _0x58313d=_0x79eebe?0x0:_0x201d0e[_0x53d1('0x1f')];var _0x45f575=_0x79eebe?_0x150bbf['count']:_0x201d0e[_0x53d1('0x1f')]+_0x201d0e[_0x53d1('0x20')];var _0x11d938;if(_0x45f575>=_0x498bac){_0x45f575=_0x498bac;_0x11d938=0xc8;}else{_0x11d938=0xce;}_0x17b1bd[_0x53d1('0x1c')](_0x11d938);return _0x17b1bd['set'](_0x53d1('0x21'),_0x58313d+'-'+_0x45f575+'/'+_0x498bac)[_0x53d1('0x1e')](_0x150bbf);}return null;};}function patchUpdates(_0x3f961d){return function(_0x107a0d){try{jsonpatch[_0x53d1('0x22')](_0x107a0d,_0x3f961d,!![]);}catch(_0x29c52f){return BPromise[_0x53d1('0x23')](_0x29c52f);}return _0x107a0d['save']();};}function saveUpdates(_0x1910d9,_0x43859e){return function(_0x1a41cd){if(_0x1a41cd){return _0x1a41cd[_0x53d1('0x24')](_0x1910d9)['then'](function(_0x34d738){return _0x34d738;});}return null;};}function removeEntity(_0x4892d7,_0x2fb615){return function(_0x3d0027){if(_0x3d0027){return _0x3d0027[_0x53d1('0x25')]()[_0x53d1('0x26')](function(){_0x4892d7['status'](0xcc)[_0x53d1('0x1d')]();});}};}function handleEntityNotFound(_0x3b2529,_0x3cb855){return function(_0x2246f6){if(!_0x2246f6){_0x3b2529[_0x53d1('0x1b')](0x194);}return _0x2246f6;};}function handleError(_0x1416c0,_0x12bff2){_0x12bff2=_0x12bff2||0x1f4;return function(_0x8643ad){logger['error'](_0x8643ad[_0x53d1('0x27')]);if(_0x8643ad[_0x53d1('0x28')]){delete _0x8643ad[_0x53d1('0x28')];}_0x1416c0['status'](_0x12bff2)['send'](_0x8643ad);};}exports[_0x53d1('0x29')]=function(_0x427de5,_0x9209a6){var _0x1c3e8d={},_0x16de4b={},_0xafbe09={'count':0x0,'rows':[]};var _0x2092e3=_[_0x53d1('0x2a')](db[_0x53d1('0x2b')]['rawAttributes'],function(_0x35ed1a){return{'name':_0x35ed1a['fieldName'],'type':_0x35ed1a[_0x53d1('0x2c')][_0x53d1('0x2d')]};});_0x16de4b[_0x53d1('0x2e')]=_[_0x53d1('0x2a')](_0x2092e3,'name');_0x16de4b[_0x53d1('0x2f')]=_[_0x53d1('0x30')](_0x427de5[_0x53d1('0x2f')]);_0x16de4b['filters']=_[_0x53d1('0x31')](_0x16de4b[_0x53d1('0x2e')],_0x16de4b[_0x53d1('0x2f')]);_0x1c3e8d[_0x53d1('0x32')]=_[_0x53d1('0x31')](_0x16de4b[_0x53d1('0x2e')],qs[_0x53d1('0x33')](_0x427de5[_0x53d1('0x2f')][_0x53d1('0x33')]));_0x1c3e8d[_0x53d1('0x32')]=_0x1c3e8d[_0x53d1('0x32')][_0x53d1('0x34')]?_0x1c3e8d[_0x53d1('0x32')]:_0x16de4b[_0x53d1('0x2e')];if(!_0x427de5['query']['hasOwnProperty'](_0x53d1('0x35'))){_0x1c3e8d[_0x53d1('0x20')]=qs[_0x53d1('0x20')](_0x427de5['query']['limit']);_0x1c3e8d['offset']=qs[_0x53d1('0x1f')](_0x427de5[_0x53d1('0x2f')]['offset']);}_0x1c3e8d[_0x53d1('0x36')]=qs[_0x53d1('0x37')](_0x427de5[_0x53d1('0x2f')][_0x53d1('0x37')]);_0x1c3e8d[_0x53d1('0x38')]=qs[_0x53d1('0x39')](_[_0x53d1('0x3a')](_0x427de5[_0x53d1('0x2f')],_0x16de4b[_0x53d1('0x39')]),_0x2092e3);if(_0x427de5['query'][_0x53d1('0x3b')]){_0x1c3e8d[_0x53d1('0x38')]=_[_0x53d1('0x3c')](_0x1c3e8d[_0x53d1('0x38')],{'$or':_[_0x53d1('0x2a')](_0x2092e3,function(_0x1b7d88){if(_0x1b7d88[_0x53d1('0x2c')]!==_0x53d1('0x3d')){var _0x4ca619={};_0x4ca619[_0x1b7d88[_0x53d1('0x28')]]={'$like':'%'+_0x427de5[_0x53d1('0x2f')][_0x53d1('0x3b')]+'%'};return _0x4ca619;}})});}_0x1c3e8d=_[_0x53d1('0x3c')]({},_0x1c3e8d,_0x427de5[_0x53d1('0x3e')]);var _0x283fe4={'where':_0x1c3e8d[_0x53d1('0x38')]};return db[_0x53d1('0x2b')][_0x53d1('0x3f')](_0x283fe4)[_0x53d1('0x26')](function(_0xa8e74){_0xafbe09['count']=_0xa8e74;if(_0x427de5['query'][_0x53d1('0x40')]){_0x1c3e8d['include']=[{'all':!![]}];}return db[_0x53d1('0x2b')]['findAll'](_0x1c3e8d);})[_0x53d1('0x26')](function(_0x3cc009){_0xafbe09[_0x53d1('0x41')]=_0x3cc009;return _0xafbe09;})['then'](respondWithFilteredResult(_0x9209a6,_0x1c3e8d))[_0x53d1('0x42')](handleError(_0x9209a6,null));};exports[_0x53d1('0x43')]=function(_0xae6f25,_0x4ead2f){var _0x4aac55={'raw':![],'where':{'id':_0xae6f25[_0x53d1('0x44')]['id']}},_0x60444d={};_0x60444d[_0x53d1('0x2e')]=_[_0x53d1('0x30')](db[_0x53d1('0x2b')][_0x53d1('0x45')]);_0x60444d[_0x53d1('0x2f')]=_['keys'](_0xae6f25[_0x53d1('0x2f')]);_0x60444d[_0x53d1('0x39')]=_[_0x53d1('0x31')](_0x60444d['model'],_0x60444d[_0x53d1('0x2f')]);_0x4aac55['attributes']=_[_0x53d1('0x31')](_0x60444d['model'],qs[_0x53d1('0x33')](_0xae6f25[_0x53d1('0x2f')][_0x53d1('0x33')]));_0x4aac55['attributes']=_0x4aac55[_0x53d1('0x32')]['length']?_0x4aac55[_0x53d1('0x32')]:_0x60444d[_0x53d1('0x2e')];if(_0xae6f25[_0x53d1('0x2f')]['includeAll']){_0x4aac55['include']=[{'all':!![]}];}_0x4aac55=_[_0x53d1('0x3c')]({},_0x4aac55,_0xae6f25[_0x53d1('0x3e')]);return db[_0x53d1('0x2b')][_0x53d1('0x46')](_0x4aac55)['then'](handleEntityNotFound(_0x4ead2f,null))[_0x53d1('0x26')](respondWithResult(_0x4ead2f,null))[_0x53d1('0x42')](handleError(_0x4ead2f,null));};exports['create']=function(_0x550cda,_0x334158){return db[_0x53d1('0x2b')]['create'](_0x550cda[_0x53d1('0x47')],{})[_0x53d1('0x26')](respondWithResult(_0x334158,0xc9))[_0x53d1('0x42')](handleError(_0x334158,null));};exports[_0x53d1('0x48')]=function(_0x3e51da,_0x403635){return db['AnalyticFieldReport'][_0x53d1('0x48')](_0x3e51da[_0x53d1('0x47')],{'raw':![],'individualHooks':!![]})[_0x53d1('0x26')](respondWithResult(_0x403635,0xc9))[_0x53d1('0x42')](handleError(_0x403635,null));};exports[_0x53d1('0x24')]=function(_0x5df16c,_0x2f1aee){if(_0x5df16c[_0x53d1('0x47')]['id']){delete _0x5df16c[_0x53d1('0x47')]['id'];}return db[_0x53d1('0x2b')][_0x53d1('0x46')]({'where':{'id':_0x5df16c['params']['id']}})[_0x53d1('0x26')](handleEntityNotFound(_0x2f1aee,null))[_0x53d1('0x26')](saveUpdates(_0x5df16c['body'],null))[_0x53d1('0x26')](respondWithResult(_0x2f1aee,null))['catch'](handleError(_0x2f1aee,null));};exports[_0x53d1('0x25')]=function(_0x283b15,_0x549ffa){return db[_0x53d1('0x2b')][_0x53d1('0x46')]({'where':{'id':_0x283b15['params']['id']}})[_0x53d1('0x26')](handleEntityNotFound(_0x549ffa,null))['then'](removeEntity(_0x549ffa,null))['catch'](handleError(_0x549ffa,null));};exports[_0x53d1('0x49')]=function(_0x4fb647,_0x5c8556){return db['AnalyticFieldReport'][_0x53d1('0x25')]({'where':{'id':_0x4fb647[_0x53d1('0x2f')][_0x53d1('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x53d1('0x26')](respondWithResult(_0x5c8556,0xcc))[_0x53d1('0x42')](handleError(_0x5c8556,null));};exports[_0x53d1('0x4b')]=function(_0x270103,_0x35090e,_0x312fc2){return db[_0x53d1('0x4c')][_0x53d1('0x4d')]({'where':{'id':_0x270103[_0x53d1('0x44')]['id']}})[_0x53d1('0x26')](handleEntityNotFound(_0x35090e,null))['then'](function(_0x7af176){if(_0x7af176){return db['sequelize'][_0x53d1('0x4e')](function(_0x28e63f){return db[_0x53d1('0x2b')]['destroy']({'where':{'CustomReportId':_0x270103[_0x53d1('0x44')]['id']},'transaction':_0x28e63f})[_0x53d1('0x26')](function(_0x33b1f9){var _0x277095=_[_0x53d1('0x2a')](_0x270103[_0x53d1('0x47')],function(_0x30c5d4){delete _0x30c5d4['id'];_0x30c5d4['CustomReportId']=_0x270103[_0x53d1('0x44')]['id'];return _0x30c5d4;});return db['AnalyticFieldReport'][_0x53d1('0x48')](_0x277095,{'transaction':_0x28e63f});});})[_0x53d1('0x26')](function(){return db[_0x53d1('0x2b')][_0x53d1('0x4f')]({'where':{'CustomReportId':_0x270103[_0x53d1('0x44')]['id']}});});}})[_0x53d1('0x26')](respondWithResult(_0x35090e,null))[_0x53d1('0x42')](handleError(_0x35090e,null));}; \ No newline at end of file +var _0xfc90=['options','AnalyticFieldReport','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','bulkDestroy','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','set','Content-Range','json','apply','then','destroy','error','stack','name','send','index','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfc90,0xfd));var _0x0fc9=function(_0x354777,_0x17cc7b){_0x354777=_0x354777-0x0;var _0x31c0e7=_0xfc90[_0x354777];return _0x31c0e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fc9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fc9('0x1'));var rp=require(_0x0fc9('0x2'));var moment=require(_0x0fc9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0fc9('0x4'));var util=require(_0x0fc9('0x5'));var path=require(_0x0fc9('0x6'));var sox=require(_0x0fc9('0x7'));var csv=require(_0x0fc9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0fc9('0x9'));var _=require(_0x0fc9('0xa'));var squel=require('squel');var crypto=require(_0x0fc9('0xb'));var jsforce=require(_0x0fc9('0xc'));var deskjs=require(_0x0fc9('0xd'));var toCsv=require(_0x0fc9('0x8'));var querystring=require(_0x0fc9('0xe'));var Papa=require(_0x0fc9('0xf'));var Redis=require(_0x0fc9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0fc9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fc9('0x12'));var logger=require(_0x0fc9('0x13'))(_0x0fc9('0x14'));var utils=require(_0x0fc9('0x15'));var config=require(_0x0fc9('0x16'));var licenseUtil=require(_0x0fc9('0x17'));var db=require(_0x0fc9('0x18'))['db'];function respondWithStatusCode(_0x781651,_0x4cf98a){_0x4cf98a=_0x4cf98a||0xcc;return function(_0x3eaa2c){if(_0x3eaa2c){return _0x781651['sendStatus'](_0x4cf98a);}return _0x781651[_0x0fc9('0x19')](_0x4cf98a)[_0x0fc9('0x1a')]();};}function respondWithResult(_0x46cdbb,_0x31e1a2){_0x31e1a2=_0x31e1a2||0xc8;return function(_0x5c55b4){if(_0x5c55b4){return _0x46cdbb['status'](_0x31e1a2)['json'](_0x5c55b4);}};}function respondWithFilteredResult(_0x134a4a,_0x56e564){return function(_0xde5c9a){if(_0xde5c9a){var _0x127445=typeof _0x56e564[_0x0fc9('0x1b')]===_0x0fc9('0x1c')&&typeof _0x56e564['limit']===_0x0fc9('0x1c');var _0x4fa23a=_0xde5c9a['count'];var _0x81ccec=_0x127445?0x0:_0x56e564[_0x0fc9('0x1b')];var _0x3da07a=_0x127445?_0xde5c9a['count']:_0x56e564['offset']+_0x56e564['limit'];var _0x36b978;if(_0x3da07a>=_0x4fa23a){_0x3da07a=_0x4fa23a;_0x36b978=0xc8;}else{_0x36b978=0xce;}_0x134a4a[_0x0fc9('0x19')](_0x36b978);return _0x134a4a[_0x0fc9('0x1d')](_0x0fc9('0x1e'),_0x81ccec+'-'+_0x3da07a+'/'+_0x4fa23a)[_0x0fc9('0x1f')](_0xde5c9a);}return null;};}function patchUpdates(_0x1295fd){return function(_0x2f81b0){try{jsonpatch[_0x0fc9('0x20')](_0x2f81b0,_0x1295fd,!![]);}catch(_0x25fbef){return BPromise['reject'](_0x25fbef);}return _0x2f81b0['save']();};}function saveUpdates(_0x3b3a7f,_0x2c3312){return function(_0x1f2456){if(_0x1f2456){return _0x1f2456['update'](_0x3b3a7f)[_0x0fc9('0x21')](function(_0x4d6449){return _0x4d6449;});}return null;};}function removeEntity(_0x3dbabd,_0x2ef50){return function(_0x1d8ee0){if(_0x1d8ee0){return _0x1d8ee0[_0x0fc9('0x22')]()[_0x0fc9('0x21')](function(){_0x3dbabd[_0x0fc9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ee02,_0x21e511){return function(_0xd21605){if(!_0xd21605){_0x43ee02['sendStatus'](0x194);}return _0xd21605;};}function handleError(_0x1e00c8,_0xd3f6f9){_0xd3f6f9=_0xd3f6f9||0x1f4;return function(_0x1266c8){logger[_0x0fc9('0x23')](_0x1266c8[_0x0fc9('0x24')]);if(_0x1266c8[_0x0fc9('0x25')]){delete _0x1266c8[_0x0fc9('0x25')];}_0x1e00c8[_0x0fc9('0x19')](_0xd3f6f9)[_0x0fc9('0x26')](_0x1266c8);};}exports[_0x0fc9('0x27')]=function(_0x275a7f,_0x28afa8){var _0x755743={},_0x512d9a={},_0x29bbc2={'count':0x0,'rows':[]};var _0xf934fa=_[_0x0fc9('0x28')](db['AnalyticFieldReport'][_0x0fc9('0x29')],function(_0x3d6ee8){return{'name':_0x3d6ee8['fieldName'],'type':_0x3d6ee8['type'][_0x0fc9('0x2a')]};});_0x512d9a['model']=_[_0x0fc9('0x28')](_0xf934fa,'name');_0x512d9a[_0x0fc9('0x2b')]=_[_0x0fc9('0x2c')](_0x275a7f['query']);_0x512d9a['filters']=_[_0x0fc9('0x2d')](_0x512d9a[_0x0fc9('0x2e')],_0x512d9a[_0x0fc9('0x2b')]);_0x755743[_0x0fc9('0x2f')]=_[_0x0fc9('0x2d')](_0x512d9a['model'],qs[_0x0fc9('0x30')](_0x275a7f['query'][_0x0fc9('0x30')]));_0x755743[_0x0fc9('0x2f')]=_0x755743[_0x0fc9('0x2f')]['length']?_0x755743[_0x0fc9('0x2f')]:_0x512d9a[_0x0fc9('0x2e')];if(!_0x275a7f['query'][_0x0fc9('0x31')](_0x0fc9('0x32'))){_0x755743[_0x0fc9('0x33')]=qs['limit'](_0x275a7f['query'][_0x0fc9('0x33')]);_0x755743[_0x0fc9('0x1b')]=qs['offset'](_0x275a7f['query']['offset']);}_0x755743[_0x0fc9('0x34')]=qs[_0x0fc9('0x35')](_0x275a7f[_0x0fc9('0x2b')][_0x0fc9('0x35')]);_0x755743['where']=qs[_0x0fc9('0x36')](_[_0x0fc9('0x37')](_0x275a7f[_0x0fc9('0x2b')],_0x512d9a[_0x0fc9('0x36')]),_0xf934fa);if(_0x275a7f[_0x0fc9('0x2b')][_0x0fc9('0x38')]){_0x755743[_0x0fc9('0x39')]=_[_0x0fc9('0x3a')](_0x755743['where'],{'$or':_[_0x0fc9('0x28')](_0xf934fa,function(_0x4e2763){if(_0x4e2763['type']!=='VIRTUAL'){var _0x5d45a6={};_0x5d45a6[_0x4e2763[_0x0fc9('0x25')]]={'$like':'%'+_0x275a7f[_0x0fc9('0x2b')][_0x0fc9('0x38')]+'%'};return _0x5d45a6;}})});}_0x755743=_[_0x0fc9('0x3a')]({},_0x755743,_0x275a7f[_0x0fc9('0x3b')]);var _0x33c3f3={'where':_0x755743['where']};return db[_0x0fc9('0x3c')]['count'](_0x33c3f3)[_0x0fc9('0x21')](function(_0x251233){_0x29bbc2[_0x0fc9('0x3d')]=_0x251233;if(_0x275a7f[_0x0fc9('0x2b')]['includeAll']){_0x755743[_0x0fc9('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0fc9('0x3f')](_0x755743);})[_0x0fc9('0x21')](function(_0xbbaf9b){_0x29bbc2[_0x0fc9('0x40')]=_0xbbaf9b;return _0x29bbc2;})[_0x0fc9('0x21')](respondWithFilteredResult(_0x28afa8,_0x755743))[_0x0fc9('0x41')](handleError(_0x28afa8,null));};exports[_0x0fc9('0x42')]=function(_0x399d41,_0x1d8bda){var _0x3c6cc0={'raw':![],'where':{'id':_0x399d41[_0x0fc9('0x43')]['id']}},_0x83996a={};_0x83996a[_0x0fc9('0x2e')]=_['keys'](db[_0x0fc9('0x3c')][_0x0fc9('0x29')]);_0x83996a[_0x0fc9('0x2b')]=_['keys'](_0x399d41['query']);_0x83996a[_0x0fc9('0x36')]=_[_0x0fc9('0x2d')](_0x83996a['model'],_0x83996a[_0x0fc9('0x2b')]);_0x3c6cc0[_0x0fc9('0x2f')]=_['intersection'](_0x83996a['model'],qs[_0x0fc9('0x30')](_0x399d41[_0x0fc9('0x2b')][_0x0fc9('0x30')]));_0x3c6cc0[_0x0fc9('0x2f')]=_0x3c6cc0[_0x0fc9('0x2f')][_0x0fc9('0x44')]?_0x3c6cc0[_0x0fc9('0x2f')]:_0x83996a[_0x0fc9('0x2e')];if(_0x399d41[_0x0fc9('0x2b')][_0x0fc9('0x45')]){_0x3c6cc0[_0x0fc9('0x3e')]=[{'all':!![]}];}_0x3c6cc0=_['merge']({},_0x3c6cc0,_0x399d41[_0x0fc9('0x3b')]);return db[_0x0fc9('0x3c')][_0x0fc9('0x46')](_0x3c6cc0)['then'](handleEntityNotFound(_0x1d8bda,null))[_0x0fc9('0x21')](respondWithResult(_0x1d8bda,null))['catch'](handleError(_0x1d8bda,null));};exports[_0x0fc9('0x47')]=function(_0x256e34,_0x102a0a){return db[_0x0fc9('0x3c')]['create'](_0x256e34[_0x0fc9('0x48')],{})[_0x0fc9('0x21')](respondWithResult(_0x102a0a,0xc9))['catch'](handleError(_0x102a0a,null));};exports['bulkCreate']=function(_0x397375,_0xf26d37){return db[_0x0fc9('0x3c')]['bulkCreate'](_0x397375['body'],{'raw':![],'individualHooks':!![]})[_0x0fc9('0x21')](respondWithResult(_0xf26d37,0xc9))[_0x0fc9('0x41')](handleError(_0xf26d37,null));};exports['update']=function(_0x53bc21,_0x770b71){if(_0x53bc21['body']['id']){delete _0x53bc21[_0x0fc9('0x48')]['id'];}return db[_0x0fc9('0x3c')][_0x0fc9('0x46')]({'where':{'id':_0x53bc21[_0x0fc9('0x43')]['id']}})[_0x0fc9('0x21')](handleEntityNotFound(_0x770b71,null))[_0x0fc9('0x21')](saveUpdates(_0x53bc21[_0x0fc9('0x48')],null))[_0x0fc9('0x21')](respondWithResult(_0x770b71,null))[_0x0fc9('0x41')](handleError(_0x770b71,null));};exports[_0x0fc9('0x22')]=function(_0x35e182,_0x7f8a19){return db['AnalyticFieldReport'][_0x0fc9('0x46')]({'where':{'id':_0x35e182[_0x0fc9('0x43')]['id']}})['then'](handleEntityNotFound(_0x7f8a19,null))[_0x0fc9('0x21')](removeEntity(_0x7f8a19,null))[_0x0fc9('0x41')](handleError(_0x7f8a19,null));};exports[_0x0fc9('0x49')]=function(_0x32b13a,_0x1b853b){return db[_0x0fc9('0x3c')][_0x0fc9('0x22')]({'where':{'id':_0x32b13a[_0x0fc9('0x2b')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x0fc9('0x21')](respondWithResult(_0x1b853b,0xcc))['catch'](handleError(_0x1b853b,null));};exports['addFields']=function(_0x233138,_0x25941e,_0x5a73b7){return db[_0x0fc9('0x4a')][_0x0fc9('0x4b')]({'where':{'id':_0x233138[_0x0fc9('0x43')]['id']}})['then'](handleEntityNotFound(_0x25941e,null))[_0x0fc9('0x21')](function(_0x2a8866){if(_0x2a8866){return db[_0x0fc9('0x4c')]['transaction'](function(_0x45f250){return db[_0x0fc9('0x3c')]['destroy']({'where':{'CustomReportId':_0x233138[_0x0fc9('0x43')]['id']},'transaction':_0x45f250})['then'](function(_0x4805a5){var _0x2aba5a=_[_0x0fc9('0x28')](_0x233138[_0x0fc9('0x48')],function(_0x3c6cd0){delete _0x3c6cd0['id'];_0x3c6cd0[_0x0fc9('0x4d')]=_0x233138[_0x0fc9('0x43')]['id'];return _0x3c6cd0;});return db[_0x0fc9('0x3c')]['bulkCreate'](_0x2aba5a,{'transaction':_0x45f250});});})[_0x0fc9('0x21')](function(){return db[_0x0fc9('0x3c')]['findAll']({'where':{'CustomReportId':_0x233138['params']['id']}});});}})['then'](respondWithResult(_0x25941e,null))[_0x0fc9('0x41')](handleError(_0x25941e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index bd2b7e5..b9efd59 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 _0x20b0=['define','analytics_report_fields','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x20b0,0x8e));var _0x020b=function(_0xe9ed2f,_0x5a4322){_0xe9ed2f=_0xe9ed2f-0x0;var _0x1a2d27=_0x20b0[_0xe9ed2f];return _0x1a2d27;};'use strict';var _=require('lodash');var util=require(_0x020b('0x0'));var logger=require('../../config/logger')(_0x020b('0x1'));var moment=require(_0x020b('0x2'));var BPromise=require(_0x020b('0x3'));var rp=require(_0x020b('0x4'));var fs=require('fs');var path=require(_0x020b('0x5'));var rimraf=require('rimraf');var config=require(_0x020b('0x6'));var attributes=require(_0x020b('0x7'));module['exports']=function(_0x4bb21b,_0x1437d1){return _0x4bb21b[_0x020b('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x020b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8297=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x49eaff,_0x455798){var _0x32e8ae=function(_0x564245){while(--_0x564245){_0x49eaff['push'](_0x49eaff['shift']());}};_0x32e8ae(++_0x455798);}(_0x8297,0xd8));var _0x7829=function(_0x39e0d4,_0x57e185){_0x39e0d4=_0x39e0d4-0x0;var _0x542b9a=_0x8297[_0x39e0d4];return _0x542b9a;};'use strict';var _=require(_0x7829('0x0'));var util=require('util');var logger=require(_0x7829('0x1'))(_0x7829('0x2'));var moment=require(_0x7829('0x3'));var BPromise=require(_0x7829('0x4'));var rp=require(_0x7829('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7829('0x6'));var attributes=require(_0x7829('0x7'));module[_0x7829('0x8')]=function(_0x15ee7d,_0x329d46){return _0x15ee7d[_0x7829('0x9')](_0x7829('0xa'),attributes,{'tableName':_0x7829('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index f738e21..7820945 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 _0x8f96=['code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xbc0b4d,_0x48d139){var _0x5920d7=function(_0x280edb){while(--_0x280edb){_0xbc0b4d['push'](_0xbc0b4d['shift']());}};_0x5920d7(++_0x48d139);}(_0x8f96,0x1a3));var _0x68f9=function(_0x52d459,_0x42ad9c){_0x52d459=_0x52d459-0x0;var _0x5e068d=_0x8f96[_0x52d459];return _0x5e068d;};'use strict';var _=require(_0x68f9('0x0'));var util=require(_0x68f9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x68f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68f9('0x3'))['db'];var utils=require(_0x68f9('0x4'));var logger=require('../../config/logger')(_0x68f9('0x5'));var config=require('../../config/environment');var jayson=require(_0x68f9('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49c280,_0x1e0b31,_0x139021){return new BPromise(function(_0x3fc26c,_0x558ae4){return client['request'](_0x49c280,_0x139021)[_0x68f9('0x7')](function(_0x1e566f){logger[_0x68f9('0x8')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e0b31,'request\x20sent');logger['debug'](_0x68f9('0x9'),_0x1e0b31,_0x68f9('0xa'),JSON[_0x68f9('0xb')](_0x1e566f));if(_0x1e566f[_0x68f9('0xc')]){if(_0x1e566f[_0x68f9('0xc')][_0x68f9('0xd')]===0x1f4){logger['error'](_0x68f9('0xe'),_0x1e0b31,_0x1e566f[_0x68f9('0xc')][_0x68f9('0xf')]);return _0x558ae4(_0x1e566f[_0x68f9('0xc')][_0x68f9('0xf')]);}logger[_0x68f9('0xc')](_0x68f9('0xe'),_0x1e0b31,_0x1e566f[_0x68f9('0xc')][_0x68f9('0xf')]);return _0x3fc26c(_0x1e566f[_0x68f9('0xc')][_0x68f9('0xf')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x1e0b31,_0x68f9('0xa'));_0x3fc26c(_0x1e566f[_0x68f9('0x10')][_0x68f9('0xf')]);}})[_0x68f9('0x11')](function(_0x8553ed){logger['error'](_0x68f9('0xe'),_0x1e0b31,_0x8553ed);_0x558ae4(_0x8553ed);});});} \ No newline at end of file +var _0x049e=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x7e1a56,_0x56a560){var _0x5c4a8c=function(_0x24c54e){while(--_0x24c54e){_0x7e1a56['push'](_0x7e1a56['shift']());}};_0x5c4a8c(++_0x56a560);}(_0x049e,0x64));var _0xe049=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0x049e[_0x59ee41];return _0x3ecd3e;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var moment=require(_0xe049('0x2'));var BPromise=require(_0xe049('0x3'));var rs=require(_0xe049('0x4'));var fs=require('fs');var Redis=require(_0xe049('0x5'));var db=require(_0xe049('0x6'))['db'];var utils=require(_0xe049('0x7'));var logger=require(_0xe049('0x8'))(_0xe049('0x9'));var config=require('../../config/environment');var jayson=require(_0xe049('0xa'));var client=jayson['client'][_0xe049('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc9b888,_0x5d9590,_0x108446){return new BPromise(function(_0xbb691f,_0x50e19b){return client[_0xe049('0xc')](_0xc9b888,_0x108446)[_0xe049('0xd')](function(_0x5155f4){logger[_0xe049('0xe')](_0xe049('0xf'),_0x5d9590,'request\x20sent');logger[_0xe049('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5d9590,_0xe049('0x11'),JSON[_0xe049('0x12')](_0x5155f4));if(_0x5155f4[_0xe049('0x13')]){if(_0x5155f4[_0xe049('0x13')][_0xe049('0x14')]===0x1f4){logger['error'](_0xe049('0xf'),_0x5d9590,_0x5155f4[_0xe049('0x13')][_0xe049('0x15')]);return _0x50e19b(_0x5155f4[_0xe049('0x13')]['message']);}logger[_0xe049('0x13')](_0xe049('0xf'),_0x5d9590,_0x5155f4[_0xe049('0x13')][_0xe049('0x15')]);return _0xbb691f(_0x5155f4[_0xe049('0x13')][_0xe049('0x15')]);}else{logger[_0xe049('0xe')](_0xe049('0xf'),_0x5d9590,_0xe049('0x11'));_0xbb691f(_0x5155f4[_0xe049('0x16')][_0xe049('0x15')]);}})[_0xe049('0x17')](function(_0x54be48){logger['error'](_0xe049('0xf'),_0x5d9590,_0x54be48);_0x50e19b(_0x54be48);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index cdf4af2..b080ebf 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(_0x1a0145,_0x5df481){var _0x193aa1=function(_0xd29a49){while(--_0xd29a49){_0x1a0145['push'](_0x1a0145['shift']());}};_0x193aa1(++_0x5df481);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x4c563d,_0x412a74){var _0x5a758c=function(_0x226c77){while(--_0x226c77){_0x4c563d['push'](_0x4c563d['shift']());}};_0x5a758c(++_0x412a74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 b1d20da..03d1800 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 _0x2179=['name','TEXT','sequelize','exports','STRING'];(function(_0x2b35a8,_0x7aec2){var _0x1a1129=function(_0x3ca887){while(--_0x3ca887){_0x2b35a8['push'](_0x2b35a8['shift']());}};_0x1a1129(++_0x7aec2);}(_0x2179,0xc0));var _0x9217=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0x2179[_0xf55e73];return _0x116b99;};'use strict';var Sequelize=require(_0x9217('0x0'));module[_0x9217('0x1')]={'name':{'type':Sequelize[_0x9217('0x2')],'allowNull':![],'unique':_0x9217('0x3')},'table':{'type':Sequelize[_0x9217('0x2')]},'metric':{'type':Sequelize[_0x9217('0x4')]},'description':{'type':Sequelize[_0x9217('0x2')]}}; \ No newline at end of file +var _0x4227=['STRING','sequelize','name','TEXT'];(function(_0x59a135,_0x5316d8){var _0x3cd388=function(_0x4075c7){while(--_0x4075c7){_0x59a135['push'](_0x59a135['shift']());}};_0x3cd388(++_0x5316d8);}(_0x4227,0x89));var _0x7422=function(_0x6a8207,_0x1f6d55){_0x6a8207=_0x6a8207-0x0;var _0x1dfcce=_0x4227[_0x6a8207];return _0x1dfcce;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7422('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7422('0x2')]},'description':{'type':Sequelize[_0x7422('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 65dfd4a..1cd466d 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 _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x2628c0,_0x34447b){var _0x41d104=function(_0x40ecd8){while(--_0x40ecd8){_0x2628c0['push'](_0x2628c0['shift']());}};_0x41d104(++_0x34447b);}(_0xa41a,0x6b));var _0xaa41=function(_0xf34b55,_0xc4c8af){_0xf34b55=_0xf34b55-0x0;var _0x52517e=_0xa41a[_0xf34b55];return _0x52517e;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file +var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x526eff,_0x32da5d){var _0x4e66ce=function(_0x193928){while(--_0x193928){_0x526eff['push'](_0x526eff['shift']());}};_0x4e66ce(++_0x32da5d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x7fbe[_0x18b5e8];return _0x25baed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 669677a..2755496 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 _0xb091=['moment','request-promise','../../config/environment','./analyticMetric.attributes','define','analytics_metrics','util','../../config/logger','api'];(function(_0x205d00,_0x56b8fa){var _0xe9c1f6=function(_0x53d5a8){while(--_0x53d5a8){_0x205d00['push'](_0x205d00['shift']());}};_0xe9c1f6(++_0x56b8fa);}(_0xb091,0x16e));var _0x1b09=function(_0x44eae2,_0x3a7e29){_0x44eae2=_0x44eae2-0x0;var _0x1741ba=_0xb091[_0x44eae2];return _0x1741ba;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('AnalyticMetric',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2ad=['path','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','util','api','moment','bluebird','request-promise'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x4fe4cf,_0x53fb23){_0x4fe4cf=_0x4fe4cf-0x0;var _0x4c4dfc=_0xb2ad[_0x4fe4cf];return _0x4c4dfc;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var logger=require('../../config/logger')(_0xdb2a('0x1'));var moment=require(_0xdb2a('0x2'));var BPromise=require(_0xdb2a('0x3'));var rp=require(_0xdb2a('0x4'));var fs=require('fs');var path=require(_0xdb2a('0x5'));var rimraf=require('rimraf');var config=require(_0xdb2a('0x6'));var attributes=require(_0xdb2a('0x7'));module[_0xdb2a('0x8')]=function(_0x1f9551,_0x5c69b1){return _0x1f9551['define']('AnalyticMetric',attributes,{'tableName':_0xdb2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 1210650..63be85e 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 _0x95e1=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x8b87a,_0x22ffc0){var _0x16ca13=function(_0x3938e5){while(--_0x3938e5){_0x8b87a['push'](_0x8b87a['shift']());}};_0x16ca13(++_0x22ffc0);}(_0x95e1,0x1b4));var _0x195e=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x95e1[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require(_0x195e('0x0'));var moment=require(_0x195e('0x1'));var BPromise=require(_0x195e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x195e('0x3'));var db=require(_0x195e('0x4'))['db'];var utils=require(_0x195e('0x5'));var logger=require(_0x195e('0x6'))('rpc');var config=require(_0x195e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x195e('0x8')][_0x195e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb207,_0x3a43b8,_0x14d801){return new BPromise(function(_0x139d24,_0x52fe85){return client[_0x195e('0xa')](_0x5eb207,_0x14d801)[_0x195e('0xb')](function(_0x8d7634){logger[_0x195e('0xc')](_0x195e('0xd'),_0x3a43b8,_0x195e('0xe'));logger[_0x195e('0xf')](_0x195e('0x10'),_0x3a43b8,_0x195e('0xe'),JSON[_0x195e('0x11')](_0x8d7634));if(_0x8d7634[_0x195e('0x12')]){if(_0x8d7634[_0x195e('0x12')][_0x195e('0x13')]===0x1f4){logger['error'](_0x195e('0xd'),_0x3a43b8,_0x8d7634['error'][_0x195e('0x14')]);return _0x52fe85(_0x8d7634[_0x195e('0x12')][_0x195e('0x14')]);}logger[_0x195e('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3a43b8,_0x8d7634[_0x195e('0x12')][_0x195e('0x14')]);return _0x139d24(_0x8d7634['error'][_0x195e('0x14')]);}else{logger[_0x195e('0xc')](_0x195e('0xd'),_0x3a43b8,'request\x20sent');_0x139d24(_0x8d7634['result']['message']);}})['catch'](function(_0x42ca06){logger[_0x195e('0x12')](_0x195e('0xd'),_0x3a43b8,_0x42ca06);_0x52fe85(_0x42ca06);});});} \ No newline at end of file +var _0xf0b0=['../../config/utils','../../config/logger','rpc','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x194f4c,_0x59908d){var _0x42672e=function(_0x37a317){while(--_0x37a317){_0x194f4c['push'](_0x194f4c['shift']());}};_0x42672e(++_0x59908d);}(_0xf0b0,0xcc));var _0x0f0b=function(_0x1501b9,_0x2be13e){_0x1501b9=_0x1501b9-0x0;var _0x2f5cca=_0xf0b0[_0x1501b9];return _0x2f5cca;};'use strict';var _=require('lodash');var util=require(_0x0f0b('0x0'));var moment=require('moment');var BPromise=require(_0x0f0b('0x1'));var rs=require(_0x0f0b('0x2'));var fs=require('fs');var Redis=require(_0x0f0b('0x3'));var db=require(_0x0f0b('0x4'))['db'];var utils=require(_0x0f0b('0x5'));var logger=require(_0x0f0b('0x6'))(_0x0f0b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f0b('0x8')][_0x0f0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5431e6,_0x473807,_0x5b2db1){return new BPromise(function(_0x21f834,_0x59c457){return client[_0x0f0b('0xa')](_0x5431e6,_0x5b2db1)[_0x0f0b('0xb')](function(_0x391f5b){logger['info'](_0x0f0b('0xc'),_0x473807,_0x0f0b('0xd'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x473807,_0x0f0b('0xd'),JSON[_0x0f0b('0xe')](_0x391f5b));if(_0x391f5b[_0x0f0b('0xf')]){if(_0x391f5b['error']['code']===0x1f4){logger[_0x0f0b('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x473807,_0x391f5b[_0x0f0b('0xf')][_0x0f0b('0x10')]);return _0x59c457(_0x391f5b[_0x0f0b('0xf')][_0x0f0b('0x10')]);}logger['error'](_0x0f0b('0xc'),_0x473807,_0x391f5b['error'][_0x0f0b('0x10')]);return _0x21f834(_0x391f5b[_0x0f0b('0xf')][_0x0f0b('0x10')]);}else{logger[_0x0f0b('0x11')](_0x0f0b('0xc'),_0x473807,_0x0f0b('0xd'));_0x21f834(_0x391f5b[_0x0f0b('0x12')]['message']);}})['catch'](function(_0x1cf64d){logger[_0x0f0b('0xf')](_0x0f0b('0xc'),_0x473807,_0x1cf64d);_0x59c457(_0x1cf64d);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 8efb0e7..c1b69f2 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 _0xf873=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xf873,0xb2));var _0x3f87=function(_0x33cf7a,_0x54fb25){_0x33cf7a=_0x33cf7a-0x0;var _0x405ebf=_0xf873[_0x33cf7a];return _0x405ebf;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./analyticMetric.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0xe')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xf')]);router['put'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);module[_0x3f87('0x13')]=router; \ No newline at end of file +var _0x8c46=['index','/:id','show','post','put','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c46,0x171));var _0x68c4=function(_0x235996,_0x370c7f){_0x235996=_0x235996-0x0;var _0x200c7f=_0x8c46[_0x235996];return _0x200c7f;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x68c4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x68c4('0x2'));var auth=require(_0x68c4('0x3'));var interaction=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var controller=require(_0x68c4('0x6'));router[_0x68c4('0x7')]('/',auth[_0x68c4('0x8')](),controller[_0x68c4('0x9')]);router[_0x68c4('0x7')](_0x68c4('0xa'),auth['isAuthenticated'](),controller[_0x68c4('0xb')]);router[_0x68c4('0xc')]('/',auth[_0x68c4('0x8')](),controller['create']);router[_0x68c4('0xd')](_0x68c4('0xa'),auth[_0x68c4('0x8')](),controller['update']);router['delete'](_0x68c4('0xa'),auth[_0x68c4('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 15f7d9f..3a505e5 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 _0xb81d=['TEXT','sequelize'];(function(_0x30e24a,_0x3216e9){var _0x5970e0=function(_0x549186){while(--_0x549186){_0x30e24a['push'](_0x30e24a['shift']());}};_0x5970e0(++_0x3216e9);}(_0xb81d,0x73));var _0xdb81=function(_0x54b086,_0x38e566){_0x54b086=_0x54b086-0x0;var _0x1ad08b=_0xb81d[_0x54b086];return _0x1ad08b;};'use strict';var Sequelize=require(_0xdb81('0x0'));module['exports']={'tree':{'type':Sequelize[_0xdb81('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xcf34=['sequelize','TEXT'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xcf34,0x7c));var _0x4cf3=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0xcf34[_0x142020];return _0x40da8f;};'use strict';var Sequelize=require(_0x4cf3('0x0'));module['exports']={'tree':{'type':Sequelize[_0x4cf3('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 5b129ab..bfa1c5b 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 _0x417e=['merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x417e,0x121));var _0xe417=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x417e[_0x2ef44b];return _0x2405b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe417('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe417('0x1'));var rp=require('request-promise');var moment=require(_0xe417('0x2'));var BPromise=require(_0xe417('0x3'));var Mustache=require(_0xe417('0x4'));var util=require('util');var path=require(_0xe417('0x5'));var sox=require(_0xe417('0x6'));var csv=require(_0xe417('0x7'));var ejs=require(_0xe417('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe417('0x9'));var squel=require(_0xe417('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe417('0x7'));var querystring=require(_0xe417('0xb'));var Papa=require(_0xe417('0xc'));var Redis=require(_0xe417('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe417('0xe'))(_0xe417('0xf'));var utils=require('../../config/utils');var config=require(_0xe417('0x10'));var licenseUtil=require(_0xe417('0x11'));var db=require(_0xe417('0x12'))['db'];function respondWithStatusCode(_0x4cd1f3,_0x5021ad){_0x5021ad=_0x5021ad||0xcc;return function(_0x56a0a5){if(_0x56a0a5){return _0x4cd1f3[_0xe417('0x13')](_0x5021ad);}return _0x4cd1f3[_0xe417('0x14')](_0x5021ad)[_0xe417('0x15')]();};}function respondWithResult(_0x1f0322,_0x3e6bdc){_0x3e6bdc=_0x3e6bdc||0xc8;return function(_0x1c6fb3){if(_0x1c6fb3){return _0x1f0322['status'](_0x3e6bdc)['json'](_0x1c6fb3);}};}function respondWithFilteredResult(_0x3b7e79,_0x281e05){return function(_0x16f38a){if(_0x16f38a){var _0x154bd8=typeof _0x281e05[_0xe417('0x16')]==='undefined'&&typeof _0x281e05[_0xe417('0x17')]===_0xe417('0x18');var _0x4256ea=_0x16f38a[_0xe417('0x19')];var _0x3de4a2=_0x154bd8?0x0:_0x281e05[_0xe417('0x16')];var _0x1a0d65=_0x154bd8?_0x16f38a[_0xe417('0x19')]:_0x281e05[_0xe417('0x16')]+_0x281e05[_0xe417('0x17')];var _0xb42fee;if(_0x1a0d65>=_0x4256ea){_0x1a0d65=_0x4256ea;_0xb42fee=0xc8;}else{_0xb42fee=0xce;}_0x3b7e79[_0xe417('0x14')](_0xb42fee);return _0x3b7e79[_0xe417('0x1a')](_0xe417('0x1b'),_0x3de4a2+'-'+_0x1a0d65+'/'+_0x4256ea)[_0xe417('0x1c')](_0x16f38a);}return null;};}function patchUpdates(_0x3a20c9){return function(_0x55e4d2){try{jsonpatch[_0xe417('0x1d')](_0x55e4d2,_0x3a20c9,!![]);}catch(_0x9dbff3){return BPromise[_0xe417('0x1e')](_0x9dbff3);}return _0x55e4d2['save']();};}function saveUpdates(_0x4c2efd,_0x3ac4a1){return function(_0x5ef3db){if(_0x5ef3db){return _0x5ef3db['update'](_0x4c2efd)[_0xe417('0x1f')](function(_0x4e5d30){return _0x4e5d30;});}return null;};}function removeEntity(_0x2a2889,_0x110d0e){return function(_0x1a977c){if(_0x1a977c){return _0x1a977c[_0xe417('0x20')]()[_0xe417('0x1f')](function(){_0x2a2889['status'](0xcc)[_0xe417('0x15')]();});}};}function handleEntityNotFound(_0x18a997,_0x30d058){return function(_0x441b03){if(!_0x441b03){_0x18a997['sendStatus'](0x194);}return _0x441b03;};}function handleError(_0x474dc9,_0x206e2a){_0x206e2a=_0x206e2a||0x1f4;return function(_0x38d48f){logger[_0xe417('0x21')](_0x38d48f[_0xe417('0x22')]);if(_0x38d48f[_0xe417('0x23')]){delete _0x38d48f[_0xe417('0x23')];}_0x474dc9['status'](_0x206e2a)['send'](_0x38d48f);};}exports[_0xe417('0x24')]=function(_0x552362,_0x18a090){var _0x4d8f9e={},_0xb61128={},_0x43648e={'count':0x0,'rows':[]};var _0x37bb14=_[_0xe417('0x25')](db[_0xe417('0x26')][_0xe417('0x27')],function(_0x8bb263){return{'name':_0x8bb263[_0xe417('0x28')],'type':_0x8bb263[_0xe417('0x29')]['key']};});_0xb61128[_0xe417('0x2a')]=_[_0xe417('0x25')](_0x37bb14,_0xe417('0x23'));_0xb61128[_0xe417('0x2b')]=_['keys'](_0x552362['query']);_0xb61128['filters']=_['intersection'](_0xb61128[_0xe417('0x2a')],_0xb61128[_0xe417('0x2b')]);_0x4d8f9e[_0xe417('0x2c')]=_[_0xe417('0x2d')](_0xb61128[_0xe417('0x2a')],qs['fields'](_0x552362['query'][_0xe417('0x2e')]));_0x4d8f9e[_0xe417('0x2c')]=_0x4d8f9e[_0xe417('0x2c')][_0xe417('0x2f')]?_0x4d8f9e[_0xe417('0x2c')]:_0xb61128[_0xe417('0x2a')];if(!_0x552362[_0xe417('0x2b')][_0xe417('0x30')](_0xe417('0x31'))){_0x4d8f9e['limit']=qs[_0xe417('0x17')](_0x552362[_0xe417('0x2b')][_0xe417('0x17')]);_0x4d8f9e[_0xe417('0x16')]=qs[_0xe417('0x16')](_0x552362['query'][_0xe417('0x16')]);}_0x4d8f9e[_0xe417('0x32')]=qs['sort'](_0x552362[_0xe417('0x2b')][_0xe417('0x33')]);_0x4d8f9e[_0xe417('0x34')]=qs[_0xe417('0x35')](_[_0xe417('0x36')](_0x552362[_0xe417('0x2b')],_0xb61128[_0xe417('0x35')]),_0x37bb14);if(_0x552362['query'][_0xe417('0x37')]){_0x4d8f9e['where']=_[_0xe417('0x38')](_0x4d8f9e[_0xe417('0x34')],{'$or':_[_0xe417('0x25')](_0x37bb14,function(_0xb7725){if(_0xb7725['type']!=='VIRTUAL'){var _0x3390d3={};_0x3390d3[_0xb7725[_0xe417('0x23')]]={'$like':'%'+_0x552362[_0xe417('0x2b')][_0xe417('0x37')]+'%'};return _0x3390d3;}})});}_0x4d8f9e=_[_0xe417('0x38')]({},_0x4d8f9e,_0x552362[_0xe417('0x39')]);var _0x3c34ca={'where':_0x4d8f9e[_0xe417('0x34')]};return db[_0xe417('0x26')][_0xe417('0x19')](_0x3c34ca)[_0xe417('0x1f')](function(_0x118539){_0x43648e[_0xe417('0x19')]=_0x118539;if(_0x552362['query'][_0xe417('0x3a')]){_0x4d8f9e[_0xe417('0x3b')]=[{'all':!![]}];}return db[_0xe417('0x26')][_0xe417('0x3c')](_0x4d8f9e);})[_0xe417('0x1f')](function(_0x2de6db){_0x43648e[_0xe417('0x3d')]=_0x2de6db;return _0x43648e;})['then'](respondWithFilteredResult(_0x18a090,_0x4d8f9e))['catch'](handleError(_0x18a090,null));};exports['show']=function(_0x3c65f2,_0x3f01e9){var _0x49b0ee={'raw':!![],'where':{'id':_0x3c65f2[_0xe417('0x3e')]['id']}},_0x390a3d={};_0x390a3d[_0xe417('0x2a')]=_['keys'](db[_0xe417('0x26')][_0xe417('0x27')]);_0x390a3d[_0xe417('0x2b')]=_[_0xe417('0x3f')](_0x3c65f2['query']);_0x390a3d['filters']=_['intersection'](_0x390a3d['model'],_0x390a3d['query']);_0x49b0ee[_0xe417('0x2c')]=_[_0xe417('0x2d')](_0x390a3d[_0xe417('0x2a')],qs[_0xe417('0x2e')](_0x3c65f2['query'][_0xe417('0x2e')]));_0x49b0ee[_0xe417('0x2c')]=_0x49b0ee[_0xe417('0x2c')][_0xe417('0x2f')]?_0x49b0ee[_0xe417('0x2c')]:_0x390a3d[_0xe417('0x2a')];if(_0x3c65f2['query']['includeAll']){_0x49b0ee[_0xe417('0x3b')]=[{'all':!![]}];}_0x49b0ee=_['merge']({},_0x49b0ee,_0x3c65f2[_0xe417('0x39')]);return db[_0xe417('0x26')][_0xe417('0x40')](_0x49b0ee)[_0xe417('0x1f')](handleEntityNotFound(_0x3f01e9,null))['then'](respondWithResult(_0x3f01e9,null))[_0xe417('0x41')](handleError(_0x3f01e9,null));};exports[_0xe417('0x42')]=function(_0x35a8b8,_0x42145f){return db['AnalyticTreeReport'][_0xe417('0x42')](_0x35a8b8[_0xe417('0x43')],{})[_0xe417('0x1f')](respondWithResult(_0x42145f,0xc9))[_0xe417('0x41')](handleError(_0x42145f,null));};exports[_0xe417('0x44')]=function(_0x3f7611,_0x55195a){if(_0x3f7611[_0xe417('0x43')]['id']){delete _0x3f7611[_0xe417('0x43')]['id'];}return db['AnalyticTreeReport'][_0xe417('0x40')]({'where':{'id':_0x3f7611[_0xe417('0x3e')]['id']}})['then'](handleEntityNotFound(_0x55195a,null))[_0xe417('0x1f')](saveUpdates(_0x3f7611['body'],null))[_0xe417('0x1f')](respondWithResult(_0x55195a,null))[_0xe417('0x41')](handleError(_0x55195a,null));};exports[_0xe417('0x20')]=function(_0x49228d,_0x15422f){return db[_0xe417('0x26')]['find']({'where':{'id':_0x49228d[_0xe417('0x3e')]['id']}})['then'](handleEntityNotFound(_0x15422f,null))[_0xe417('0x1f')](removeEntity(_0x15422f,null))['catch'](handleError(_0x15422f,null));}; \ No newline at end of file +var _0xc36e=['then','destroy','sendStatus','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','intersection','length','find','catch','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc36e,0x122));var _0xec36=function(_0x39bc9a,_0xde9de8){_0x39bc9a=_0x39bc9a-0x0;var _0x65088d=_0xc36e[_0x39bc9a];return _0x65088d;};'use strict';var emlformat=require(_0xec36('0x0'));var rimraf=require(_0xec36('0x1'));var zipdir=require(_0xec36('0x2'));var jsonpatch=require(_0xec36('0x3'));var rp=require(_0xec36('0x4'));var moment=require(_0xec36('0x5'));var BPromise=require(_0xec36('0x6'));var Mustache=require(_0xec36('0x7'));var util=require(_0xec36('0x8'));var path=require(_0xec36('0x9'));var sox=require(_0xec36('0xa'));var csv=require(_0xec36('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec36('0xc'));var squel=require(_0xec36('0xd'));var crypto=require(_0xec36('0xe'));var jsforce=require(_0xec36('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xec36('0x10'));var Papa=require(_0xec36('0x11'));var Redis=require(_0xec36('0x12'));var authService=require(_0xec36('0x13'));var qs=require(_0xec36('0x14'));var as=require(_0xec36('0x15'));var hardwareService=require(_0xec36('0x16'));var logger=require('../../config/logger')(_0xec36('0x17'));var utils=require(_0xec36('0x18'));var config=require(_0xec36('0x19'));var licenseUtil=require(_0xec36('0x1a'));var db=require(_0xec36('0x1b'))['db'];function respondWithStatusCode(_0x387a34,_0x36ce0b){_0x36ce0b=_0x36ce0b||0xcc;return function(_0x418c59){if(_0x418c59){return _0x387a34['sendStatus'](_0x36ce0b);}return _0x387a34['status'](_0x36ce0b)[_0xec36('0x1c')]();};}function respondWithResult(_0x132f34,_0x2e7b50){_0x2e7b50=_0x2e7b50||0xc8;return function(_0x5ad06a){if(_0x5ad06a){return _0x132f34[_0xec36('0x1d')](_0x2e7b50)[_0xec36('0x1e')](_0x5ad06a);}};}function respondWithFilteredResult(_0x22a299,_0x1af60a){return function(_0x1ad549){if(_0x1ad549){var _0x1aac68=typeof _0x1af60a[_0xec36('0x1f')]===_0xec36('0x20')&&typeof _0x1af60a['limit']===_0xec36('0x20');var _0x331811=_0x1ad549[_0xec36('0x21')];var _0xc4920=_0x1aac68?0x0:_0x1af60a['offset'];var _0x24146d=_0x1aac68?_0x1ad549[_0xec36('0x21')]:_0x1af60a[_0xec36('0x1f')]+_0x1af60a['limit'];var _0x557adb;if(_0x24146d>=_0x331811){_0x24146d=_0x331811;_0x557adb=0xc8;}else{_0x557adb=0xce;}_0x22a299[_0xec36('0x1d')](_0x557adb);return _0x22a299[_0xec36('0x22')](_0xec36('0x23'),_0xc4920+'-'+_0x24146d+'/'+_0x331811)['json'](_0x1ad549);}return null;};}function patchUpdates(_0x107bd7){return function(_0x1f8548){try{jsonpatch[_0xec36('0x24')](_0x1f8548,_0x107bd7,!![]);}catch(_0x2cf444){return BPromise[_0xec36('0x25')](_0x2cf444);}return _0x1f8548['save']();};}function saveUpdates(_0x14fa7a,_0x26ecaf){return function(_0x554eb8){if(_0x554eb8){return _0x554eb8['update'](_0x14fa7a)[_0xec36('0x26')](function(_0x33db54){return _0x33db54;});}return null;};}function removeEntity(_0xdb7c19,_0x55c9c4){return function(_0x53086c){if(_0x53086c){return _0x53086c[_0xec36('0x27')]()[_0xec36('0x26')](function(){_0xdb7c19[_0xec36('0x1d')](0xcc)[_0xec36('0x1c')]();});}};}function handleEntityNotFound(_0xef19a2,_0x46f41d){return function(_0x187fed){if(!_0x187fed){_0xef19a2[_0xec36('0x28')](0x194);}return _0x187fed;};}function handleError(_0xda3a3c,_0x4c6947){_0x4c6947=_0x4c6947||0x1f4;return function(_0x4c226e){logger[_0xec36('0x29')](_0x4c226e[_0xec36('0x2a')]);if(_0x4c226e[_0xec36('0x2b')]){delete _0x4c226e['name'];}_0xda3a3c['status'](_0x4c6947)[_0xec36('0x2c')](_0x4c226e);};}exports[_0xec36('0x2d')]=function(_0x274224,_0x1fa3c3){var _0x19a882={},_0x424caa={},_0x31cc86={'count':0x0,'rows':[]};var _0x5039e0=_['map'](db[_0xec36('0x2e')][_0xec36('0x2f')],function(_0x42be9d){return{'name':_0x42be9d[_0xec36('0x30')],'type':_0x42be9d[_0xec36('0x31')][_0xec36('0x32')]};});_0x424caa[_0xec36('0x33')]=_[_0xec36('0x34')](_0x5039e0,_0xec36('0x2b'));_0x424caa[_0xec36('0x35')]=_['keys'](_0x274224['query']);_0x424caa[_0xec36('0x36')]=_['intersection'](_0x424caa['model'],_0x424caa[_0xec36('0x35')]);_0x19a882[_0xec36('0x37')]=_['intersection'](_0x424caa[_0xec36('0x33')],qs[_0xec36('0x38')](_0x274224[_0xec36('0x35')]['fields']));_0x19a882[_0xec36('0x37')]=_0x19a882[_0xec36('0x37')]['length']?_0x19a882[_0xec36('0x37')]:_0x424caa[_0xec36('0x33')];if(!_0x274224[_0xec36('0x35')][_0xec36('0x39')](_0xec36('0x3a'))){_0x19a882[_0xec36('0x3b')]=qs[_0xec36('0x3b')](_0x274224[_0xec36('0x35')][_0xec36('0x3b')]);_0x19a882[_0xec36('0x1f')]=qs[_0xec36('0x1f')](_0x274224['query'][_0xec36('0x1f')]);}_0x19a882[_0xec36('0x3c')]=qs[_0xec36('0x3d')](_0x274224[_0xec36('0x35')][_0xec36('0x3d')]);_0x19a882[_0xec36('0x3e')]=qs[_0xec36('0x36')](_[_0xec36('0x3f')](_0x274224[_0xec36('0x35')],_0x424caa['filters']),_0x5039e0);if(_0x274224[_0xec36('0x35')][_0xec36('0x40')]){_0x19a882[_0xec36('0x3e')]=_[_0xec36('0x41')](_0x19a882['where'],{'$or':_['map'](_0x5039e0,function(_0x22adfd){if(_0x22adfd[_0xec36('0x31')]!==_0xec36('0x42')){var _0x8b9be={};_0x8b9be[_0x22adfd[_0xec36('0x2b')]]={'$like':'%'+_0x274224[_0xec36('0x35')]['filter']+'%'};return _0x8b9be;}})});}_0x19a882=_[_0xec36('0x41')]({},_0x19a882,_0x274224[_0xec36('0x43')]);var _0x46e6c1={'where':_0x19a882['where']};return db[_0xec36('0x2e')][_0xec36('0x21')](_0x46e6c1)['then'](function(_0x444c65){_0x31cc86[_0xec36('0x21')]=_0x444c65;if(_0x274224[_0xec36('0x35')][_0xec36('0x44')]){_0x19a882[_0xec36('0x45')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xec36('0x46')](_0x19a882);})[_0xec36('0x26')](function(_0xa3feca){_0x31cc86[_0xec36('0x47')]=_0xa3feca;return _0x31cc86;})['then'](respondWithFilteredResult(_0x1fa3c3,_0x19a882))['catch'](handleError(_0x1fa3c3,null));};exports[_0xec36('0x48')]=function(_0xcb015,_0x4caad7){var _0x2c74af={'raw':!![],'where':{'id':_0xcb015['params']['id']}},_0x19e417={};_0x19e417[_0xec36('0x33')]=_[_0xec36('0x49')](db[_0xec36('0x2e')][_0xec36('0x2f')]);_0x19e417[_0xec36('0x35')]=_[_0xec36('0x49')](_0xcb015[_0xec36('0x35')]);_0x19e417['filters']=_[_0xec36('0x4a')](_0x19e417[_0xec36('0x33')],_0x19e417[_0xec36('0x35')]);_0x2c74af['attributes']=_[_0xec36('0x4a')](_0x19e417['model'],qs[_0xec36('0x38')](_0xcb015[_0xec36('0x35')][_0xec36('0x38')]));_0x2c74af[_0xec36('0x37')]=_0x2c74af[_0xec36('0x37')][_0xec36('0x4b')]?_0x2c74af[_0xec36('0x37')]:_0x19e417[_0xec36('0x33')];if(_0xcb015['query'][_0xec36('0x44')]){_0x2c74af[_0xec36('0x45')]=[{'all':!![]}];}_0x2c74af=_[_0xec36('0x41')]({},_0x2c74af,_0xcb015[_0xec36('0x43')]);return db[_0xec36('0x2e')][_0xec36('0x4c')](_0x2c74af)[_0xec36('0x26')](handleEntityNotFound(_0x4caad7,null))[_0xec36('0x26')](respondWithResult(_0x4caad7,null))[_0xec36('0x4d')](handleError(_0x4caad7,null));};exports[_0xec36('0x4e')]=function(_0x256f3c,_0x32ce13){return db['AnalyticTreeReport'][_0xec36('0x4e')](_0x256f3c['body'],{})[_0xec36('0x26')](respondWithResult(_0x32ce13,0xc9))['catch'](handleError(_0x32ce13,null));};exports[_0xec36('0x4f')]=function(_0x26e234,_0x4bd048){if(_0x26e234[_0xec36('0x50')]['id']){delete _0x26e234[_0xec36('0x50')]['id'];}return db[_0xec36('0x2e')][_0xec36('0x4c')]({'where':{'id':_0x26e234['params']['id']}})[_0xec36('0x26')](handleEntityNotFound(_0x4bd048,null))[_0xec36('0x26')](saveUpdates(_0x26e234[_0xec36('0x50')],null))[_0xec36('0x26')](respondWithResult(_0x4bd048,null))[_0xec36('0x4d')](handleError(_0x4bd048,null));};exports[_0xec36('0x27')]=function(_0x44af5f,_0x3af236){return db[_0xec36('0x2e')][_0xec36('0x4c')]({'where':{'id':_0x44af5f[_0xec36('0x51')]['id']}})[_0xec36('0x26')](handleEntityNotFound(_0x3af236,null))['then'](removeEntity(_0x3af236,null))[_0xec36('0x4d')](handleError(_0x3af236,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 0236f6c..33d408a 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 _0xe8d5=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe8d5,0x103));var _0x5e8d=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe8d5[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x5e8d('0x0'));var util=require(_0x5e8d('0x1'));var logger=require(_0x5e8d('0x2'))(_0x5e8d('0x3'));var moment=require('moment');var BPromise=require(_0x5e8d('0x4'));var rp=require(_0x5e8d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e8d('0x6'));var config=require(_0x5e8d('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x5e8d('0x8')]=function(_0x2f48fb,_0x1d252a){return _0x2f48fb[_0x5e8d('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa79d=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','lodash'];(function(_0x590db6,_0x15b718){var _0x54d30c=function(_0x38d280){while(--_0x38d280){_0x590db6['push'](_0x590db6['shift']());}};_0x54d30c(++_0x15b718);}(_0xa79d,0x13e));var _0xda79=function(_0x451f7c,_0x189e08){_0x451f7c=_0x451f7c-0x0;var _0x2eaab7=_0xa79d[_0x451f7c];return _0x2eaab7;};'use strict';var _=require(_0xda79('0x0'));var util=require(_0xda79('0x1'));var logger=require('../../config/logger')(_0xda79('0x2'));var moment=require(_0xda79('0x3'));var BPromise=require(_0xda79('0x4'));var rp=require(_0xda79('0x5'));var fs=require('fs');var path=require(_0xda79('0x6'));var rimraf=require(_0xda79('0x7'));var config=require(_0xda79('0x8'));var attributes=require(_0xda79('0x9'));module[_0xda79('0xa')]=function(_0x8c3e71,_0x265893){return _0x8c3e71['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 7f05eee..70c272b 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2c0961,_0x498c9f){var _0x39996e=function(_0x142532){while(--_0x142532){_0x2c0961['push'](_0x2c0961['shift']());}};_0x39996e(++_0x498c9f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1611f8,_0x2d2178){_0x1611f8=_0x1611f8-0x0;var _0x54ba82=_0x5f2f[_0x1611f8];return _0x54ba82;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3072ee,_0x40b136){var _0x47041d=function(_0x47c8ee){while(--_0x47c8ee){_0x3072ee['push'](_0x3072ee['shift']());}};_0x47041d(++_0x40b136);}(_0x2ef3,0xba));var _0x32ef=function(_0x3e6e29,_0x25af27){_0x3e6e29=_0x3e6e29-0x0;var _0x95ff65=_0x2ef3[_0x3e6e29];return _0x95ff65;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index aa70928..7f201ac 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 _0xb8d5=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x33ac0c,_0x2d7d3c){var _0x564ac9=function(_0x4e9de4){while(--_0x4e9de4){_0x33ac0c['push'](_0x33ac0c['shift']());}};_0x564ac9(++_0x2d7d3c);}(_0xb8d5,0x67));var _0x5b8d=function(_0x294557,_0xc4dd63){_0x294557=_0x294557-0x0;var _0xf41961=_0xb8d5[_0x294557];return _0xf41961;};'use strict';var multer=require(_0x5b8d('0x0'));var util=require(_0x5b8d('0x1'));var path=require(_0x5b8d('0x2'));var timeout=require(_0x5b8d('0x3'));var express=require(_0x5b8d('0x4'));var router=express[_0x5b8d('0x5')]();var fs_extra=require(_0x5b8d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5b8d('0x7'));var config=require('../../config/environment');var controller=require(_0x5b8d('0x8'));router[_0x5b8d('0x9')]('/',auth[_0x5b8d('0xa')](),controller[_0x5b8d('0xb')]);router['get'](_0x5b8d('0xc'),auth[_0x5b8d('0xa')](),controller[_0x5b8d('0xd')]);router[_0x5b8d('0xe')]('/',auth[_0x5b8d('0xa')](),controller[_0x5b8d('0xf')]);router[_0x5b8d('0x10')](_0x5b8d('0xc'),auth[_0x5b8d('0xa')](),controller[_0x5b8d('0x11')]);router[_0x5b8d('0x12')](_0x5b8d('0xc'),auth[_0x5b8d('0xa')](),controller[_0x5b8d('0x13')]);module[_0x5b8d('0x14')]=router; \ No newline at end of file +var _0xc703=['update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0xc703,0x10f));var _0x3c70=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0xc703[_0x188d31];return _0x30ed33;};'use strict';var multer=require(_0x3c70('0x0'));var util=require('util');var path=require(_0x3c70('0x1'));var timeout=require(_0x3c70('0x2'));var express=require(_0x3c70('0x3'));var router=express[_0x3c70('0x4')]();var fs_extra=require(_0x3c70('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c70('0x6'));var config=require(_0x3c70('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x3c70('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c70('0x9')]);router[_0x3c70('0x8')]('/:id',auth[_0x3c70('0xa')](),controller[_0x3c70('0xb')]);router[_0x3c70('0xc')]('/',auth[_0x3c70('0xa')](),controller['create']);router[_0x3c70('0xd')]('/:id',auth[_0x3c70('0xa')](),controller[_0x3c70('0xe')]);router[_0x3c70('0xf')](_0x3c70('0x10'),auth[_0x3c70('0xa')](),controller[_0x3c70('0x11')]);module[_0x3c70('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index b2dfb64..24e2e45 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 _0x0ba7=['STRING','sequelize'];(function(_0x9a743c,_0x2e597a){var _0x114a7b=function(_0x1c6867){while(--_0x1c6867){_0x9a743c['push'](_0x9a743c['shift']());}};_0x114a7b(++_0x2e597a);}(_0x0ba7,0x16d));var _0x70ba=function(_0x551cc9,_0x254d15){_0x551cc9=_0x551cc9-0x0;var _0x39bad1=_0x0ba7[_0x551cc9];return _0x39bad1;};'use strict';var Sequelize=require(_0x70ba('0x0'));module['exports']={'name':{'type':Sequelize[_0x70ba('0x1')]},'basename':{'type':Sequelize[_0x70ba('0x1')]},'type':{'type':Sequelize[_0x70ba('0x1')]}}; \ No newline at end of file +var _0xdace=['STRING','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdace,0xc5));var _0xedac=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xdace[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'basename':{'type':Sequelize[_0xedac('0x1')]},'type':{'type':Sequelize[_0xedac('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 2566819..8691b08 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 _0x4662=['create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','rawAttributes','type','key','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Attachment','include','findAll','rows','catch','params','keys','includeAll','find','clone','get','omit','updatedAt','body','createdAt'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x4662,0x1d4));var _0x2466=function(_0x504a19,_0x4735bc){_0x504a19=_0x504a19-0x0;var _0x4bd704=_0x4662[_0x504a19];return _0x4bd704;};'use strict';var emlformat=require(_0x2466('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2466('0x1'));var jsonpatch=require(_0x2466('0x2'));var rp=require(_0x2466('0x3'));var moment=require('moment');var BPromise=require(_0x2466('0x4'));var Mustache=require(_0x2466('0x5'));var util=require('util');var path=require(_0x2466('0x6'));var sox=require(_0x2466('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2466('0x8'));var _=require('lodash');var squel=require(_0x2466('0x9'));var crypto=require(_0x2466('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2466('0xb'));var toCsv=require(_0x2466('0xc'));var querystring=require(_0x2466('0xd'));var Papa=require(_0x2466('0xe'));var Redis=require(_0x2466('0xf'));var authService=require(_0x2466('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2466('0x11'));var hardwareService=require(_0x2466('0x12'));var logger=require(_0x2466('0x13'))(_0x2466('0x14'));var utils=require('../../config/utils');var config=require(_0x2466('0x15'));var licenseUtil=require(_0x2466('0x16'));var db=require(_0x2466('0x17'))['db'];function respondWithStatusCode(_0x1baca6,_0x160a9b){_0x160a9b=_0x160a9b||0xcc;return function(_0x3b55b0){if(_0x3b55b0){return _0x1baca6[_0x2466('0x18')](_0x160a9b);}return _0x1baca6[_0x2466('0x19')](_0x160a9b)[_0x2466('0x1a')]();};}function respondWithResult(_0x51989b,_0x5114ed){_0x5114ed=_0x5114ed||0xc8;return function(_0x15a7ab){if(_0x15a7ab){return _0x51989b[_0x2466('0x19')](_0x5114ed)[_0x2466('0x1b')](_0x15a7ab);}};}function respondWithFilteredResult(_0x11619c,_0x5a8d93){return function(_0x2a9e41){if(_0x2a9e41){var _0x17cc93=typeof _0x5a8d93[_0x2466('0x1c')]===_0x2466('0x1d')&&typeof _0x5a8d93[_0x2466('0x1e')]===_0x2466('0x1d');var _0x197dd4=_0x2a9e41[_0x2466('0x1f')];var _0x159b7a=_0x17cc93?0x0:_0x5a8d93[_0x2466('0x1c')];var _0x2c235a=_0x17cc93?_0x2a9e41[_0x2466('0x1f')]:_0x5a8d93[_0x2466('0x1c')]+_0x5a8d93[_0x2466('0x1e')];var _0x4fb4de;if(_0x2c235a>=_0x197dd4){_0x2c235a=_0x197dd4;_0x4fb4de=0xc8;}else{_0x4fb4de=0xce;}_0x11619c['status'](_0x4fb4de);return _0x11619c[_0x2466('0x20')](_0x2466('0x21'),_0x159b7a+'-'+_0x2c235a+'/'+_0x197dd4)[_0x2466('0x1b')](_0x2a9e41);}return null;};}function patchUpdates(_0x391548){return function(_0x284b8e){try{jsonpatch[_0x2466('0x22')](_0x284b8e,_0x391548,!![]);}catch(_0x34e09f){return BPromise['reject'](_0x34e09f);}return _0x284b8e[_0x2466('0x23')]();};}function saveUpdates(_0x58ed0d,_0x1a7459){return function(_0x4a2538){if(_0x4a2538){return _0x4a2538[_0x2466('0x24')](_0x58ed0d)[_0x2466('0x25')](function(_0x331ff4){return _0x331ff4;});}return null;};}function removeEntity(_0x380e54,_0x220810){return function(_0x3673d1){if(_0x3673d1){return _0x3673d1['destroy']()[_0x2466('0x25')](function(){_0x380e54[_0x2466('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x599057,_0x5a5694){return function(_0xb5ea23){if(!_0xb5ea23){_0x599057[_0x2466('0x18')](0x194);}return _0xb5ea23;};}function handleError(_0x4e9085,_0x193d25){_0x193d25=_0x193d25||0x1f4;return function(_0x34c4d8){logger[_0x2466('0x26')](_0x34c4d8[_0x2466('0x27')]);if(_0x34c4d8[_0x2466('0x28')]){delete _0x34c4d8['name'];}_0x4e9085[_0x2466('0x19')](_0x193d25)['send'](_0x34c4d8);};}exports[_0x2466('0x29')]=function(_0x535dae,_0x5fd07){var _0x5b11eb={},_0x4972d9={},_0x11bbf6={'count':0x0,'rows':[]};var _0x2437a1=_[_0x2466('0x2a')](db['Attachment'][_0x2466('0x2b')],function(_0x4d2cae){return{'name':_0x4d2cae['fieldName'],'type':_0x4d2cae[_0x2466('0x2c')][_0x2466('0x2d')]};});_0x4972d9['model']=_[_0x2466('0x2a')](_0x2437a1,_0x2466('0x28'));_0x4972d9['query']=_['keys'](_0x535dae[_0x2466('0x2e')]);_0x4972d9[_0x2466('0x2f')]=_[_0x2466('0x30')](_0x4972d9[_0x2466('0x31')],_0x4972d9[_0x2466('0x2e')]);_0x5b11eb['attributes']=_[_0x2466('0x30')](_0x4972d9[_0x2466('0x31')],qs[_0x2466('0x32')](_0x535dae[_0x2466('0x2e')][_0x2466('0x32')]));_0x5b11eb['attributes']=_0x5b11eb['attributes'][_0x2466('0x33')]?_0x5b11eb[_0x2466('0x34')]:_0x4972d9[_0x2466('0x31')];if(!_0x535dae['query'][_0x2466('0x35')](_0x2466('0x36'))){_0x5b11eb[_0x2466('0x1e')]=qs[_0x2466('0x1e')](_0x535dae['query']['limit']);_0x5b11eb[_0x2466('0x1c')]=qs[_0x2466('0x1c')](_0x535dae[_0x2466('0x2e')][_0x2466('0x1c')]);}_0x5b11eb[_0x2466('0x37')]=qs['sort'](_0x535dae['query'][_0x2466('0x38')]);_0x5b11eb[_0x2466('0x39')]=qs[_0x2466('0x2f')](_[_0x2466('0x3a')](_0x535dae[_0x2466('0x2e')],_0x4972d9[_0x2466('0x2f')]),_0x2437a1);if(_0x535dae['query'][_0x2466('0x3b')]){_0x5b11eb[_0x2466('0x39')]=_['merge'](_0x5b11eb[_0x2466('0x39')],{'$or':_[_0x2466('0x2a')](_0x2437a1,function(_0x3a30f1){if(_0x3a30f1[_0x2466('0x2c')]!==_0x2466('0x3c')){var _0x2754e9={};_0x2754e9[_0x3a30f1['name']]={'$like':'%'+_0x535dae[_0x2466('0x2e')][_0x2466('0x3b')]+'%'};return _0x2754e9;}})});}_0x5b11eb=_[_0x2466('0x3d')]({},_0x5b11eb,_0x535dae[_0x2466('0x3e')]);var _0x3c2e62={'where':_0x5b11eb[_0x2466('0x39')]};return db[_0x2466('0x3f')][_0x2466('0x1f')](_0x3c2e62)[_0x2466('0x25')](function(_0x5ecba4){_0x11bbf6[_0x2466('0x1f')]=_0x5ecba4;if(_0x535dae['query']['includeAll']){_0x5b11eb[_0x2466('0x40')]=[{'all':!![]}];}return db[_0x2466('0x3f')][_0x2466('0x41')](_0x5b11eb);})[_0x2466('0x25')](function(_0x142238){_0x11bbf6[_0x2466('0x42')]=_0x142238;return _0x11bbf6;})[_0x2466('0x25')](respondWithFilteredResult(_0x5fd07,_0x5b11eb))[_0x2466('0x43')](handleError(_0x5fd07,null));};exports['show']=function(_0x146ec2,_0x164f22){var _0x29b730={'raw':!![],'where':{'id':_0x146ec2[_0x2466('0x44')]['id']}},_0x4f5bf3={};_0x4f5bf3['model']=_[_0x2466('0x45')](db[_0x2466('0x3f')]['rawAttributes']);_0x4f5bf3[_0x2466('0x2e')]=_[_0x2466('0x45')](_0x146ec2[_0x2466('0x2e')]);_0x4f5bf3[_0x2466('0x2f')]=_[_0x2466('0x30')](_0x4f5bf3[_0x2466('0x31')],_0x4f5bf3['query']);_0x29b730[_0x2466('0x34')]=_[_0x2466('0x30')](_0x4f5bf3[_0x2466('0x31')],qs[_0x2466('0x32')](_0x146ec2[_0x2466('0x2e')][_0x2466('0x32')]));_0x29b730['attributes']=_0x29b730['attributes'][_0x2466('0x33')]?_0x29b730[_0x2466('0x34')]:_0x4f5bf3[_0x2466('0x31')];if(_0x146ec2[_0x2466('0x2e')][_0x2466('0x46')]){_0x29b730[_0x2466('0x40')]=[{'all':!![]}];}_0x29b730=_['merge']({},_0x29b730,_0x146ec2[_0x2466('0x3e')]);return db[_0x2466('0x3f')][_0x2466('0x47')](_0x29b730)['then'](handleEntityNotFound(_0x164f22,null))[_0x2466('0x25')](respondWithResult(_0x164f22,null))[_0x2466('0x43')](handleError(_0x164f22,null));};exports[_0x2466('0x48')]=function(_0xfa82c,_0x5b3765){var _0x55e16e={'where':{'id':_0xfa82c[_0x2466('0x44')]['id']}},_0x3f506d={};_0x3f506d[_0x2466('0x31')]=_['keys'](db[_0x2466('0x3f')][_0x2466('0x2b')]);_0x55e16e[_0x2466('0x34')]=_[_0x2466('0x30')](_0x3f506d[_0x2466('0x31')],qs[_0x2466('0x32')](_0xfa82c['query'][_0x2466('0x32')]));_0x55e16e[_0x2466('0x34')]=_0x55e16e[_0x2466('0x34')][_0x2466('0x33')]?_0x55e16e[_0x2466('0x34')]:_0x3f506d[_0x2466('0x31')];if(_0xfa82c[_0x2466('0x2e')][_0x2466('0x46')]){_0x55e16e['include']=[{'all':!![]}];}_0x55e16e=_[_0x2466('0x3d')]({},_0x55e16e,_0xfa82c[_0x2466('0x3e')]);return db[_0x2466('0x3f')][_0x2466('0x47')](_0x55e16e)[_0x2466('0x25')](handleEntityNotFound(_0x5b3765,null))[_0x2466('0x25')](function(_0x5cc7ac){if(_0x5cc7ac){var _0x733cb2=_0x5cc7ac[_0x2466('0x49')]({'plain':!![]});_0x733cb2=qs[_0x2466('0x4a')](_0x733cb2,['id','createdAt',_0x2466('0x4b')]);_0xfa82c[_0x2466('0x4c')]=_[_0x2466('0x4a')](_0xfa82c[_0x2466('0x4c')],['id',_0x2466('0x4d'),_0x2466('0x4b')]);return db['Attachment'][_0x2466('0x4e')](_['merge'](_0x733cb2,_0xfa82c['body']),{'include':_0xfa82c['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x2466('0x25')](respondWithResult(_0x5b3765,0xc9))[_0x2466('0x43')](handleError(_0x5b3765,null));};exports['update']=function(_0x4d05ef,_0x18757a){if(_0x4d05ef[_0x2466('0x4c')]['id']){delete _0x4d05ef[_0x2466('0x4c')]['id'];}return db[_0x2466('0x3f')][_0x2466('0x47')]({'where':{'id':_0x4d05ef[_0x2466('0x44')]['id']}})[_0x2466('0x25')](handleEntityNotFound(_0x18757a,null))['then'](saveUpdates(_0x4d05ef[_0x2466('0x4c')],null))[_0x2466('0x25')](respondWithResult(_0x18757a,null))[_0x2466('0x43')](handleError(_0x18757a,null));};exports['destroy']=function(_0x2dd179,_0x38c124){return db['Attachment'][_0x2466('0x47')]({'where':{'id':_0x2dd179[_0x2466('0x44')]['id']}})[_0x2466('0x25')](handleEntityNotFound(_0x38c124,null))[_0x2466('0x25')](removeEntity(_0x38c124,null))['catch'](handleError(_0x38c124,null));};exports['create']=function(_0x5a8f63,_0x110273,_0x12fd6c){_0x5a8f63[_0x2466('0x4c')]['name']=_0x5a8f63[_0x2466('0x4f')][_0x2466('0x50')];_0x5a8f63[_0x2466('0x4c')][_0x2466('0x51')]=_0x5a8f63[_0x2466('0x4f')][_0x2466('0x52')];_0x5a8f63[_0x2466('0x4c')][_0x2466('0x2c')]=_0x5a8f63['file'][_0x2466('0x53')];return db[_0x2466('0x3f')]['create'](_0x5a8f63[_0x2466('0x4c')])[_0x2466('0x25')](respondWithResult(_0x110273,0xc9))[_0x2466('0x43')](handleError(_0x110273,null));};exports[_0x2466('0x54')]=function(_0x2fdc2f,_0x3606f0,_0x5e8a5f){return db['Attachment'][_0x2466('0x55')]({'where':{'id':_0x2fdc2f[_0x2466('0x44')]['id']},'raw':!![]})[_0x2466('0x25')](handleEntityNotFound(_0x3606f0,null))[_0x2466('0x25')](function(_0x27a75f){if(_0x27a75f){var _0x36004c=_0x27a75f[_0x2466('0x56')]!==null;var _0x3de41a=path['join'](config[_0x2466('0x57')],_0x2466('0x58'));if(_0x36004c){_0x3de41a=path[_0x2466('0x59')](_0x3de41a,_0x2466('0x5a'));}var _0x44d45d=path['join'](_0x3de41a,_0x27a75f[_0x2466('0x51')]);return _0x3606f0[_0x2466('0x54')](_0x44d45d);}})[_0x2466('0x43')](handleError(_0x3606f0,null));}; \ No newline at end of file +var _0x7d52=['download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Attachment','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','length','find','get','omit','createdAt','updatedAt','body','create','file','basename','filename'];(function(_0x19206e,_0x3baba3){var _0x1cb7a0=function(_0x40f9be){while(--_0x40f9be){_0x19206e['push'](_0x19206e['shift']());}};_0x1cb7a0(++_0x3baba3);}(_0x7d52,0x1c3));var _0x27d5=function(_0x3c1105,_0x5c45c1){_0x3c1105=_0x3c1105-0x0;var _0x35e7ab=_0x7d52[_0x3c1105];return _0x35e7ab;};'use strict';var emlformat=require(_0x27d5('0x0'));var rimraf=require(_0x27d5('0x1'));var zipdir=require(_0x27d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27d5('0x3'));var moment=require(_0x27d5('0x4'));var BPromise=require(_0x27d5('0x5'));var Mustache=require(_0x27d5('0x6'));var util=require('util');var path=require(_0x27d5('0x7'));var sox=require(_0x27d5('0x8'));var csv=require(_0x27d5('0x9'));var ejs=require(_0x27d5('0xa'));var fs=require('fs');var fs_extra=require(_0x27d5('0xb'));var _=require('lodash');var squel=require(_0x27d5('0xc'));var crypto=require(_0x27d5('0xd'));var jsforce=require(_0x27d5('0xe'));var deskjs=require(_0x27d5('0xf'));var toCsv=require(_0x27d5('0x9'));var querystring=require('querystring');var Papa=require(_0x27d5('0x10'));var Redis=require(_0x27d5('0x11'));var authService=require(_0x27d5('0x12'));var qs=require(_0x27d5('0x13'));var as=require(_0x27d5('0x14'));var hardwareService=require(_0x27d5('0x15'));var logger=require(_0x27d5('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x27d5('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4782c0,_0x3b5cde){_0x3b5cde=_0x3b5cde||0xcc;return function(_0x336b1a){if(_0x336b1a){return _0x4782c0[_0x27d5('0x18')](_0x3b5cde);}return _0x4782c0['status'](_0x3b5cde)[_0x27d5('0x19')]();};}function respondWithResult(_0x21fc9b,_0x373fb8){_0x373fb8=_0x373fb8||0xc8;return function(_0x248646){if(_0x248646){return _0x21fc9b[_0x27d5('0x1a')](_0x373fb8)[_0x27d5('0x1b')](_0x248646);}};}function respondWithFilteredResult(_0x566e0c,_0x2038f3){return function(_0x49e91d){if(_0x49e91d){var _0x36fcad=typeof _0x2038f3['offset']===_0x27d5('0x1c')&&typeof _0x2038f3[_0x27d5('0x1d')]===_0x27d5('0x1c');var _0xf2e9e3=_0x49e91d[_0x27d5('0x1e')];var _0x2c228c=_0x36fcad?0x0:_0x2038f3['offset'];var _0x5b82f6=_0x36fcad?_0x49e91d[_0x27d5('0x1e')]:_0x2038f3['offset']+_0x2038f3[_0x27d5('0x1d')];var _0x2000f6;if(_0x5b82f6>=_0xf2e9e3){_0x5b82f6=_0xf2e9e3;_0x2000f6=0xc8;}else{_0x2000f6=0xce;}_0x566e0c['status'](_0x2000f6);return _0x566e0c[_0x27d5('0x1f')](_0x27d5('0x20'),_0x2c228c+'-'+_0x5b82f6+'/'+_0xf2e9e3)[_0x27d5('0x1b')](_0x49e91d);}return null;};}function patchUpdates(_0x4fd793){return function(_0x30c809){try{jsonpatch[_0x27d5('0x21')](_0x30c809,_0x4fd793,!![]);}catch(_0x6894e9){return BPromise[_0x27d5('0x22')](_0x6894e9);}return _0x30c809[_0x27d5('0x23')]();};}function saveUpdates(_0x4113fc,_0x3c1133){return function(_0x238a85){if(_0x238a85){return _0x238a85[_0x27d5('0x24')](_0x4113fc)[_0x27d5('0x25')](function(_0xe26a47){return _0xe26a47;});}return null;};}function removeEntity(_0x32d762,_0xdf9f4a){return function(_0x3cfb3a){if(_0x3cfb3a){return _0x3cfb3a[_0x27d5('0x26')]()['then'](function(){_0x32d762[_0x27d5('0x1a')](0xcc)[_0x27d5('0x19')]();});}};}function handleEntityNotFound(_0x4329dd,_0x15acff){return function(_0x334e18){if(!_0x334e18){_0x4329dd['sendStatus'](0x194);}return _0x334e18;};}function handleError(_0x4808ec,_0x3d0089){_0x3d0089=_0x3d0089||0x1f4;return function(_0x52b861){logger[_0x27d5('0x27')](_0x52b861[_0x27d5('0x28')]);if(_0x52b861[_0x27d5('0x29')]){delete _0x52b861[_0x27d5('0x29')];}_0x4808ec['status'](_0x3d0089)['send'](_0x52b861);};}exports[_0x27d5('0x2a')]=function(_0x4c960c,_0x1d77d5){var _0x2d8e64={},_0x15006a={},_0x3d26a0={'count':0x0,'rows':[]};var _0x2e2e51=_[_0x27d5('0x2b')](db[_0x27d5('0x2c')]['rawAttributes'],function(_0x51643e){return{'name':_0x51643e[_0x27d5('0x2d')],'type':_0x51643e[_0x27d5('0x2e')][_0x27d5('0x2f')]};});_0x15006a[_0x27d5('0x30')]=_[_0x27d5('0x2b')](_0x2e2e51,_0x27d5('0x29'));_0x15006a[_0x27d5('0x31')]=_[_0x27d5('0x32')](_0x4c960c['query']);_0x15006a['filters']=_[_0x27d5('0x33')](_0x15006a[_0x27d5('0x30')],_0x15006a['query']);_0x2d8e64[_0x27d5('0x34')]=_[_0x27d5('0x33')](_0x15006a[_0x27d5('0x30')],qs['fields'](_0x4c960c['query'][_0x27d5('0x35')]));_0x2d8e64[_0x27d5('0x34')]=_0x2d8e64[_0x27d5('0x34')]['length']?_0x2d8e64['attributes']:_0x15006a[_0x27d5('0x30')];if(!_0x4c960c['query'][_0x27d5('0x36')](_0x27d5('0x37'))){_0x2d8e64['limit']=qs[_0x27d5('0x1d')](_0x4c960c[_0x27d5('0x31')]['limit']);_0x2d8e64[_0x27d5('0x38')]=qs['offset'](_0x4c960c[_0x27d5('0x31')][_0x27d5('0x38')]);}_0x2d8e64[_0x27d5('0x39')]=qs[_0x27d5('0x3a')](_0x4c960c['query'][_0x27d5('0x3a')]);_0x2d8e64[_0x27d5('0x3b')]=qs[_0x27d5('0x3c')](_[_0x27d5('0x3d')](_0x4c960c[_0x27d5('0x31')],_0x15006a[_0x27d5('0x3c')]),_0x2e2e51);if(_0x4c960c[_0x27d5('0x31')][_0x27d5('0x3e')]){_0x2d8e64[_0x27d5('0x3b')]=_[_0x27d5('0x3f')](_0x2d8e64[_0x27d5('0x3b')],{'$or':_['map'](_0x2e2e51,function(_0x2284e7){if(_0x2284e7[_0x27d5('0x2e')]!==_0x27d5('0x40')){var _0x24e391={};_0x24e391[_0x2284e7['name']]={'$like':'%'+_0x4c960c[_0x27d5('0x31')][_0x27d5('0x3e')]+'%'};return _0x24e391;}})});}_0x2d8e64=_[_0x27d5('0x3f')]({},_0x2d8e64,_0x4c960c[_0x27d5('0x41')]);var _0x45494d={'where':_0x2d8e64[_0x27d5('0x3b')]};return db[_0x27d5('0x2c')][_0x27d5('0x1e')](_0x45494d)['then'](function(_0x23a4e7){_0x3d26a0[_0x27d5('0x1e')]=_0x23a4e7;if(_0x4c960c['query'][_0x27d5('0x42')]){_0x2d8e64[_0x27d5('0x43')]=[{'all':!![]}];}return db[_0x27d5('0x2c')][_0x27d5('0x44')](_0x2d8e64);})[_0x27d5('0x25')](function(_0x559c6a){_0x3d26a0['rows']=_0x559c6a;return _0x3d26a0;})[_0x27d5('0x25')](respondWithFilteredResult(_0x1d77d5,_0x2d8e64))[_0x27d5('0x45')](handleError(_0x1d77d5,null));};exports['show']=function(_0x1670a2,_0x393c42){var _0x31d40c={'raw':!![],'where':{'id':_0x1670a2[_0x27d5('0x46')]['id']}},_0x3aad27={};_0x3aad27['model']=_['keys'](db[_0x27d5('0x2c')][_0x27d5('0x47')]);_0x3aad27[_0x27d5('0x31')]=_[_0x27d5('0x32')](_0x1670a2[_0x27d5('0x31')]);_0x3aad27[_0x27d5('0x3c')]=_[_0x27d5('0x33')](_0x3aad27[_0x27d5('0x30')],_0x3aad27[_0x27d5('0x31')]);_0x31d40c['attributes']=_[_0x27d5('0x33')](_0x3aad27[_0x27d5('0x30')],qs['fields'](_0x1670a2[_0x27d5('0x31')][_0x27d5('0x35')]));_0x31d40c['attributes']=_0x31d40c[_0x27d5('0x34')][_0x27d5('0x48')]?_0x31d40c[_0x27d5('0x34')]:_0x3aad27[_0x27d5('0x30')];if(_0x1670a2[_0x27d5('0x31')][_0x27d5('0x42')]){_0x31d40c[_0x27d5('0x43')]=[{'all':!![]}];}_0x31d40c=_[_0x27d5('0x3f')]({},_0x31d40c,_0x1670a2[_0x27d5('0x41')]);return db['Attachment'][_0x27d5('0x49')](_0x31d40c)[_0x27d5('0x25')](handleEntityNotFound(_0x393c42,null))[_0x27d5('0x25')](respondWithResult(_0x393c42,null))['catch'](handleError(_0x393c42,null));};exports['clone']=function(_0x184b79,_0x418742){var _0xbc312d={'where':{'id':_0x184b79[_0x27d5('0x46')]['id']}},_0x3028a1={};_0x3028a1[_0x27d5('0x30')]=_['keys'](db[_0x27d5('0x2c')][_0x27d5('0x47')]);_0xbc312d[_0x27d5('0x34')]=_[_0x27d5('0x33')](_0x3028a1[_0x27d5('0x30')],qs['fields'](_0x184b79[_0x27d5('0x31')][_0x27d5('0x35')]));_0xbc312d[_0x27d5('0x34')]=_0xbc312d[_0x27d5('0x34')][_0x27d5('0x48')]?_0xbc312d[_0x27d5('0x34')]:_0x3028a1[_0x27d5('0x30')];if(_0x184b79['query'][_0x27d5('0x42')]){_0xbc312d[_0x27d5('0x43')]=[{'all':!![]}];}_0xbc312d=_[_0x27d5('0x3f')]({},_0xbc312d,_0x184b79[_0x27d5('0x41')]);return db[_0x27d5('0x2c')][_0x27d5('0x49')](_0xbc312d)['then'](handleEntityNotFound(_0x418742,null))['then'](function(_0x2ee679){if(_0x2ee679){var _0x1e5360=_0x2ee679[_0x27d5('0x4a')]({'plain':!![]});_0x1e5360=qs[_0x27d5('0x4b')](_0x1e5360,['id',_0x27d5('0x4c'),_0x27d5('0x4d')]);_0x184b79['body']=_[_0x27d5('0x4b')](_0x184b79[_0x27d5('0x4e')],['id',_0x27d5('0x4c'),_0x27d5('0x4d')]);return db[_0x27d5('0x2c')][_0x27d5('0x4f')](_['merge'](_0x1e5360,_0x184b79[_0x27d5('0x4e')]),{'include':_0x184b79[_0x27d5('0x31')][_0x27d5('0x42')]?[{'all':!![]}]:undefined});}})[_0x27d5('0x25')](respondWithResult(_0x418742,0xc9))[_0x27d5('0x45')](handleError(_0x418742,null));};exports[_0x27d5('0x24')]=function(_0x28941c,_0x43e5c5){if(_0x28941c[_0x27d5('0x4e')]['id']){delete _0x28941c[_0x27d5('0x4e')]['id'];}return db[_0x27d5('0x2c')][_0x27d5('0x49')]({'where':{'id':_0x28941c['params']['id']}})[_0x27d5('0x25')](handleEntityNotFound(_0x43e5c5,null))[_0x27d5('0x25')](saveUpdates(_0x28941c[_0x27d5('0x4e')],null))[_0x27d5('0x25')](respondWithResult(_0x43e5c5,null))[_0x27d5('0x45')](handleError(_0x43e5c5,null));};exports[_0x27d5('0x26')]=function(_0x3fc8e6,_0x50095f){return db[_0x27d5('0x2c')][_0x27d5('0x49')]({'where':{'id':_0x3fc8e6['params']['id']}})[_0x27d5('0x25')](handleEntityNotFound(_0x50095f,null))[_0x27d5('0x25')](removeEntity(_0x50095f,null))[_0x27d5('0x45')](handleError(_0x50095f,null));};exports[_0x27d5('0x4f')]=function(_0xcfb94b,_0x30887b,_0x497788){_0xcfb94b['body'][_0x27d5('0x29')]=_0xcfb94b[_0x27d5('0x50')]['originalname'];_0xcfb94b[_0x27d5('0x4e')][_0x27d5('0x51')]=_0xcfb94b[_0x27d5('0x50')][_0x27d5('0x52')];_0xcfb94b['body'][_0x27d5('0x2e')]=_0xcfb94b['file']['mimetype'];return db[_0x27d5('0x2c')][_0x27d5('0x4f')](_0xcfb94b[_0x27d5('0x4e')])[_0x27d5('0x25')](respondWithResult(_0x30887b,0xc9))[_0x27d5('0x45')](handleError(_0x30887b,null));};exports[_0x27d5('0x53')]=function(_0xb51343,_0x27364f,_0x26b676){return db[_0x27d5('0x2c')][_0x27d5('0x54')]({'where':{'id':_0xb51343[_0x27d5('0x46')]['id']},'raw':!![]})[_0x27d5('0x25')](handleEntityNotFound(_0x27364f,null))[_0x27d5('0x25')](function(_0x47cdd0){if(_0x47cdd0){var _0x40b342=_0x47cdd0['ChatOfflineMessageId']!==null;var _0x2bbdcf=path[_0x27d5('0x55')](config[_0x27d5('0x56')],_0x27d5('0x57'));if(_0x40b342){_0x2bbdcf=path[_0x27d5('0x55')](_0x2bbdcf,_0x27d5('0x58'));}var _0x521796=path[_0x27d5('0x55')](_0x2bbdcf,_0x47cdd0[_0x27d5('0x51')]);return _0x27364f[_0x27d5('0x53')](_0x521796);}})['catch'](handleError(_0x27364f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index b391466..9cf7234 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 _0x1a12=['define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x3a0b77,_0x32d3b7){var _0x32f1c4=function(_0x2e157b){while(--_0x2e157b){_0x3a0b77['push'](_0x3a0b77['shift']());}};_0x32f1c4(++_0x32d3b7);}(_0x1a12,0xab));var _0x21a1=function(_0x2bd4ee,_0x3fb78e){_0x2bd4ee=_0x2bd4ee-0x0;var _0x15ccd5=_0x1a12[_0x2bd4ee];return _0x15ccd5;};'use strict';var _=require(_0x21a1('0x0'));var util=require(_0x21a1('0x1'));var logger=require(_0x21a1('0x2'))(_0x21a1('0x3'));var moment=require(_0x21a1('0x4'));var BPromise=require(_0x21a1('0x5'));var rp=require(_0x21a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21a1('0x7'));var config=require(_0x21a1('0x8'));var attributes=require(_0x21a1('0x9'));module[_0x21a1('0xa')]=function(_0x5a4610,_0x4b3855){return _0x5a4610[_0x21a1('0xb')](_0x21a1('0xc'),attributes,{'tableName':_0x21a1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a4d=['attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Attachment'];(function(_0xc053a,_0x1d0055){var _0x5d16ab=function(_0x532692){while(--_0x532692){_0xc053a['push'](_0xc053a['shift']());}};_0x5d16ab(++_0x1d0055);}(_0x6a4d,0x115));var _0xd6a4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x6a4d[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0xd6a4('0x0'));var logger=require(_0xd6a4('0x1'))(_0xd6a4('0x2'));var moment=require(_0xd6a4('0x3'));var BPromise=require(_0xd6a4('0x4'));var rp=require(_0xd6a4('0x5'));var fs=require('fs');var path=require(_0xd6a4('0x6'));var rimraf=require(_0xd6a4('0x7'));var config=require(_0xd6a4('0x8'));var attributes=require('./attachment.attributes');module[_0xd6a4('0x9')]=function(_0x12b82e,_0x55994c){return _0x12b82e['define'](_0xd6a4('0xa'),attributes,{'tableName':_0xd6a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 4f85207..c5a7981 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 _0x81d5=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','body','options','raw','then','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5e5b72,_0x486a42){var _0x2247d1=function(_0x505fb5){while(--_0x505fb5){_0x5e5b72['push'](_0x5e5b72['shift']());}};_0x2247d1(++_0x486a42);}(_0x81d5,0x1ab));var _0x581d=function(_0x7ed107,_0x441306){_0x7ed107=_0x7ed107-0x0;var _0xab54dc=_0x81d5[_0x7ed107];return _0xab54dc;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});}exports[_0x581d('0x14')]=function(_0x1e059d){var _0x42f7db=this;return new Promise(function(_0x1f790f,_0x2cff0d){return db[_0x581d('0x15')]['create'](_0x1e059d[_0x581d('0x16')],{'raw':_0x1e059d[_0x581d('0x17')]?_0x1e059d[_0x581d('0x17')][_0x581d('0x18')]===undefined?!![]:![]:!![]})[_0x581d('0x19')](function(_0x2a2aba){logger[_0x581d('0xa')](_0x581d('0x14'),_0x1e059d);logger[_0x581d('0xd')](_0x581d('0x14'),_0x1e059d,JSON[_0x581d('0xf')](_0x2a2aba));_0x1f790f(_0x2a2aba);})[_0x581d('0x1a')](function(_0x5add13){logger[_0x581d('0x10')](_0x581d('0x14'),_0x5add13[_0x581d('0x12')],_0x1e059d);_0x2cff0d(_0x42f7db[_0x581d('0x10')](0x1f4,_0x5add13[_0x581d('0x12')]));});});}; \ No newline at end of file +var _0x9c44=['code','error','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}exports[_0x49c4('0x15')]=function(_0x4c3253){var _0x512650=this;return new Promise(function(_0x3c782d,_0x2f82d5){return db[_0x49c4('0x16')]['create'](_0x4c3253[_0x49c4('0x17')],{'raw':_0x4c3253['options']?_0x4c3253[_0x49c4('0x18')][_0x49c4('0x19')]===undefined?!![]:![]:!![]})[_0x49c4('0xa')](function(_0x291526){logger[_0x49c4('0x12')](_0x49c4('0x15'),_0x4c3253);logger[_0x49c4('0xc')](_0x49c4('0x15'),_0x4c3253,JSON[_0x49c4('0xd')](_0x291526));_0x3c782d(_0x291526);})['catch'](function(_0x527126){logger['error'](_0x49c4('0x15'),_0x527126['message'],_0x4c3253);_0x2f82d5(_0x512650['error'](0x1f4,_0x527126[_0x49c4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index cef4c3b..1367a25 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2fcd50,_0x51b76c){var _0x576508=function(_0x5128b9){while(--_0x5128b9){_0x2fcd50['push'](_0x2fcd50['shift']());}};_0x576508(++_0x51b76c);}(_0x2032,0xd9));var _0x2203=function(_0x4a85bf,_0x45cadc){_0x4a85bf=_0x4a85bf-0x0;var _0x92d3e8=_0x2032[_0x4a85bf];return _0x92d3e8;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _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(_0x37f157,_0x4ffeb1){var _0xe48d0b=function(_0xb30bdb){while(--_0xb30bdb){_0x37f157['push'](_0x37f157['shift']());}};_0xe48d0b(++_0x4ffeb1);}(_0xadb5,0xad));var _0x5adb=function(_0x5cf43b,_0x14c9eb){_0x5cf43b=_0x5cf43b-0x0;var _0x37d159=_0xadb5[_0x5cf43b];return _0x37d159;};'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 diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index f331835..9925516 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 _0xd253=['then','disabled','blockDuration','blocked','clearBlockUser','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','Strategy','moment','../../config/environment','../../config/utils','authenticate','google','/login','profile','callback','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','emails','admin','user','agent'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xd253,0x152));var _0x3d25=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xd253[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x3d25('0x0'));var passport=require(_0x3d25('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x3d25('0x2')];var moment=require(_0x3d25('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x3d25('0x4'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x3d25('0x5'));exports['login']=passport[_0x3d25('0x6')](_0x3d25('0x7'),{'failureRedirect':_0x3d25('0x8'),'scope':[_0x3d25('0x9'),'email'],'session':![]});exports[_0x3d25('0xa')]=passport[_0x3d25('0x6')](_0x3d25('0x7'),{'failureRedirect':_0x3d25('0x8'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x3d25('0x7')]?config['google']['clientID']:'id','clientSecret':config[_0x3d25('0x7')]?config[_0x3d25('0x7')][_0x3d25('0xb')]:_0x3d25('0xc'),'callbackURL':config[_0x3d25('0x7')]?config[_0x3d25('0x7')][_0x3d25('0xd')]:''},function(_0xa6fe2a,_0x5872fa,_0x2b63bc,_0x3bc40e){var _0x466a49,_0x2008de;return db[_0x3d25('0xe')][_0x3d25('0xf')]({'where':{'id':0x1},'attributes':[_0x3d25('0x10'),'blockDuration'],'raw':!![]})['then'](function(_0x3692c9){_0x466a49=_0x3692c9;return db[_0x3d25('0x11')]['find']({'where':{'email':_['map'](_0x2b63bc[_0x3d25('0x12')],'value'),'role':{'$or':[_0x3d25('0x13'),_0x3d25('0x14'),_0x3d25('0x15')]}}});})[_0x3d25('0x16')](function(_0x3745a2){_0x2008de=_0x3745a2;if(_0x2008de){if(_0x2008de[_0x3d25('0x17')]){return _0x3bc40e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x466a49[_0x3d25('0x18')]>0x0){if(_0x2008de[_0x3d25('0x19')]){if(moment(_0x2008de['blockedAt'])['add'](_0x466a49[_0x3d25('0x18')],'minutes')>moment()){return _0x3bc40e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x3d25('0x1a')](_0x2008de,0x0,![],null)[_0x3d25('0x16')](function(){return utils['getLicense'](_0x2008de);})['then'](function(){return _0x3bc40e(null,_0x2008de);});}}else{return utils[_0x3d25('0x1b')](_0x2008de)['then'](function(){return _0x3bc40e(null,_0x2008de);});}}else{return utils[_0x3d25('0x1b')](_0x2008de)[_0x3d25('0x16')](function(){return _0x3bc40e(null,_0x2008de);});}}return _0x3bc40e(_0x3d25('0x1c'));})[_0x3d25('0x1d')](function(_0x1668b7){_0x3bc40e(_0x1668b7);});})); \ No newline at end of file +var _0x9ff8=['then','User','value','admin','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','clearBlockUser','getLicense','catch','lodash','passport','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts'];(function(_0xfe0d96,_0x595dd0){var _0x4ffd30=function(_0x4a83d8){while(--_0x4a83d8){_0xfe0d96['push'](_0xfe0d96['shift']());}};_0x4ffd30(++_0x595dd0);}(_0x9ff8,0x18e));var _0x89ff=function(_0x3925b4,_0x58064d){_0x3925b4=_0x3925b4-0x0;var _0x1d62fa=_0x9ff8[_0x3925b4];return _0x1d62fa;};'use strict';var _=require(_0x89ff('0x0'));var passport=require(_0x89ff('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x89ff('0x2')];var moment=require('moment');var db=require(_0x89ff('0x3'))['db'];var config=require(_0x89ff('0x4'));var signToken=require(_0x89ff('0x5'))[_0x89ff('0x6')];var utils=require(_0x89ff('0x7'));exports[_0x89ff('0x8')]=passport[_0x89ff('0x9')](_0x89ff('0xa'),{'failureRedirect':_0x89ff('0xb'),'scope':[_0x89ff('0xc'),_0x89ff('0xd')],'session':![]});exports[_0x89ff('0xe')]=passport[_0x89ff('0x9')](_0x89ff('0xa'),{'failureRedirect':_0x89ff('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config['google'][_0x89ff('0xf')]:'id','clientSecret':config[_0x89ff('0xa')]?config[_0x89ff('0xa')][_0x89ff('0x10')]:_0x89ff('0x11'),'callbackURL':config[_0x89ff('0xa')]?config['google'][_0x89ff('0x12')]:''},function(_0x59dbe6,_0x234b3d,_0x349d9f,_0x5c4f7b){var _0x31430c,_0x2ccd86;return db[_0x89ff('0x13')][_0x89ff('0x14')]({'where':{'id':0x1},'attributes':[_0x89ff('0x15'),'blockDuration'],'raw':!![]})[_0x89ff('0x16')](function(_0x2c93f5){_0x31430c=_0x2c93f5;return db[_0x89ff('0x17')]['find']({'where':{'email':_['map'](_0x349d9f['emails'],_0x89ff('0x18')),'role':{'$or':[_0x89ff('0x19'),'user','agent']}}});})[_0x89ff('0x16')](function(_0x48a7e9){_0x2ccd86=_0x48a7e9;if(_0x2ccd86){if(_0x2ccd86[_0x89ff('0x1a')]){return _0x5c4f7b(_0x89ff('0x1b'));}else if(_0x31430c[_0x89ff('0x1c')]>0x0){if(_0x2ccd86[_0x89ff('0x1d')]){if(moment(_0x2ccd86[_0x89ff('0x1e')])[_0x89ff('0x1f')](_0x31430c[_0x89ff('0x1c')],'minutes')>moment()){return _0x5c4f7b(_0x89ff('0x1b'));}else{return utils[_0x89ff('0x20')](_0x2ccd86,0x0,![],null)[_0x89ff('0x16')](function(){return utils['getLicense'](_0x2ccd86);})[_0x89ff('0x16')](function(){return _0x5c4f7b(null,_0x2ccd86);});}}else{return utils[_0x89ff('0x21')](_0x2ccd86)['then'](function(){return _0x5c4f7b(null,_0x2ccd86);});}}else{return utils[_0x89ff('0x21')](_0x2ccd86)[_0x89ff('0x16')](function(){return _0x5c4f7b(null,_0x2ccd86);});}}return _0x5c4f7b(_0x89ff('0x1b'));})[_0x89ff('0x22')](function(_0x3bc678){_0x5c4f7b(_0x3bc678);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 2c2f937..3d96396 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 _0x8f7d=['setTokenCookie','exports','express','passport','./authGoogle.controller','get','/callback','callback','isMiddleware'];(function(_0x1395b1,_0x21d72c){var _0x7d91a=function(_0x2f78e7){while(--_0x2f78e7){_0x1395b1['push'](_0x1395b1['shift']());}};_0x7d91a(++_0x21d72c);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x59170f,_0x560c2d){_0x59170f=_0x59170f-0x0;var _0x3f8792=_0x8f7d[_0x59170f];return _0x3f8792;};'use strict';var express=require(_0xd8f7('0x0'));var passport=require(_0xd8f7('0x1'));var router=express['Router']();var controller=require(_0xd8f7('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xd8f7('0x3')]('/',controller['login']);router[_0xd8f7('0x3')](_0xd8f7('0x4'),controller[_0xd8f7('0x5')],authService[_0xd8f7('0x6')],userController['login'],authService[_0xd8f7('0x7')]);module[_0xd8f7('0x8')]=router; \ No newline at end of file +var _0x861a=['../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express','Router','./authGoogle.controller'];(function(_0x1ee5be,_0x5f46e3){var _0x177140=function(_0x162779){while(--_0x162779){_0x1ee5be['push'](_0x1ee5be['shift']());}};_0x177140(++_0x5f46e3);}(_0x861a,0x194));var _0xa861=function(_0x24d06a,_0x59c850){_0x24d06a=_0x24d06a-0x0;var _0x4a987d=_0x861a[_0x24d06a];return _0x4a987d;};'use strict';var express=require(_0xa861('0x0'));var passport=require('passport');var router=express[_0xa861('0x1')]();var controller=require(_0xa861('0x2'));var userController=require(_0xa861('0x3'));var authService=require(_0xa861('0x4'));router[_0xa861('0x5')]('/',controller[_0xa861('0x6')]);router['get'](_0xa861('0x7'),controller[_0xa861('0x8')],authService[_0xa861('0x9')],userController[_0xa861('0x6')],authService[_0xa861('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 1c7f4ed..d0840b4 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 _0xbc01=['client','http','Setting','findOne','then','name','password','salt','role','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','blockedAt','add','minutes','clearBlockUser','disabled','getLicense','catch','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','save','send','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc01,0xaf));var _0x1bc0=function(_0x4e5d27,_0x247b84){_0x4e5d27=_0x4e5d27-0x0;var _0x1c7046=_0xbc01[_0x4e5d27];return _0x1c7046;};'use strict';var util=require(_0x1bc0('0x0'));var passport=require(_0x1bc0('0x1'));var LocalStrategy=require(_0x1bc0('0x2'))['Strategy'];var jayson=require(_0x1bc0('0x3'));var _=require(_0x1bc0('0x4'));var rs=require('randomstring');var moment=require(_0x1bc0('0x5'));var db=require(_0x1bc0('0x6'))['db'];var authService=require(_0x1bc0('0x7'));var utils=require(_0x1bc0('0x8'));var client=jayson[_0x1bc0('0x9')][_0x1bc0('0xa')]({'port':0x232b});function localAuthenticate(_0x17cbcc,_0x273469,_0x20f5e5,_0x2f7940){var _0x16a877,_0x307c8a;return db[_0x1bc0('0xb')][_0x1bc0('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x1bc0('0xd')](function(_0x41e732){_0x16a877=_0x41e732;return _0x17cbcc[_0x1bc0('0xc')]({'attributes':['id',_0x1bc0('0xe'),_0x1bc0('0xf'),_0x1bc0('0x10'),_0x1bc0('0x11'),'disabled',_0x1bc0('0x12'),'blockedAt',_0x1bc0('0x13')],'where':{'name':_0x273469,'role':{'$or':[_0x1bc0('0x14'),_0x1bc0('0x15'),_0x1bc0('0x16')]}}});})['then'](function(_0x4b667d){if(!_0x4b667d||_0x4b667d&&_0x4b667d[_0x1bc0('0xe')]!==_0x273469){throw new Error(_0x1bc0('0x17'));}else{_0x307c8a=_0x4b667d;return _0x307c8a;}})[_0x1bc0('0xd')](function(){_0x307c8a['authenticate'](_0x20f5e5,function(_0x596be3,_0x5c63dd){var _0x233d2b=_0x307c8a['loginAttempts']+0x1;if(_0x596be3){return _0x2f7940(_0x596be3);}else if(!_0x5c63dd){if(_0x307c8a['disabled']){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}else if(_0x16a877[_0x1bc0('0x18')]>0x0){if(_0x307c8a[_0x1bc0('0x12')]){if(_0x16a877[_0x1bc0('0x19')]>0x0){if(moment(_0x307c8a[_0x1bc0('0x1a')])[_0x1bc0('0x1b')](_0x16a877[_0x1bc0('0x19')],_0x1bc0('0x1c'))>moment()){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}else{return utils[_0x1bc0('0x1d')](_0x307c8a,_0x233d2b,![],null)['then'](function(){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});});}}else{return _0x2f7940(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x233d2b>=_0x16a877['allowedLoginAttempts']){return utils[_0x1bc0('0x1d')](_0x307c8a,0x0,!![],moment())['then'](function(){return _0x2f7940(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x307c8a,_0x233d2b,![],null)[_0x1bc0('0xd')](function(){return _0x2f7940(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}}else{if(_0x307c8a[_0x1bc0('0x1e')]){return _0x2f7940(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x16a877[_0x1bc0('0x18')]>0x0){if(_0x307c8a[_0x1bc0('0x12')]){if(_0x16a877[_0x1bc0('0x19')]>0x0){if(moment(_0x307c8a[_0x1bc0('0x1a')])['add'](_0x16a877['blockDuration'],_0x1bc0('0x1c'))>moment()){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}else{return utils['clearBlockUser'](_0x307c8a,0x0,![],null)['then'](function(){return utils['getLicense'](_0x307c8a);})['then'](function(){return _0x2f7940(null,_0x307c8a);});}}else{return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}}else{return utils[_0x1bc0('0x1d')](_0x307c8a,0x0,![],null)[_0x1bc0('0xd')](function(){return utils[_0x1bc0('0x1f')](_0x307c8a);})[_0x1bc0('0xd')](function(){return _0x2f7940(null,_0x307c8a);})[_0x1bc0('0x20')](function(_0xb501aa){return _0x2f7940(null,![],_0xb501aa);});}}else{if(_0x307c8a[_0x1bc0('0x12')]){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}else{return utils[_0x1bc0('0x1f')](_0x307c8a)['then'](function(){return _0x2f7940(null,_0x307c8a);});}}}});})[_0x1bc0('0x20')](function(_0xba5492){return _0x2f7940(null,![],_0xba5492);});}function sendServiceMail(_0x19ea66){return db['MailAccount'][_0x1bc0('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x1bc0('0x22')],'include':[{'model':db[_0x1bc0('0x23')],'as':'Smtp'}]})[_0x1bc0('0xd')](function(_0x596e74){if(!_0x596e74){throw new Error(_0x1bc0('0x24'));}var _0x141bef={'tls':{'rejectUnauthorized':![]}};if(_0x596e74[_0x1bc0('0x25')][_0x1bc0('0x26')]){_0x141bef[_0x1bc0('0x26')]=_0x596e74[_0x1bc0('0x25')][_0x1bc0('0x26')];}else{_0x141bef['host']=_0x596e74[_0x1bc0('0x25')]['host'];_0x141bef[_0x1bc0('0x27')]=_0x596e74[_0x1bc0('0x25')]['port'];_0x141bef[_0x1bc0('0x28')]=_0x596e74[_0x1bc0('0x25')][_0x1bc0('0x28')];}if(_0x596e74['Smtp'][_0x1bc0('0x29')]){_0x141bef[_0x1bc0('0x2a')]={'user':_0x596e74[_0x1bc0('0x25')]['user'],'pass':_0x596e74['Smtp'][_0x1bc0('0x2b')]};}var _0x469dc7={'account':_0x141bef,'message':_['merge']({'from':util[_0x1bc0('0x2c')](_0x1bc0('0x2d'),_0x596e74['name'],_0x596e74[_0x1bc0('0x22')]||_0x596e74[_0x1bc0('0x25')][_0x1bc0('0x15')])},_0x19ea66)};return client[_0x1bc0('0x2e')](_0x1bc0('0x2f'),_0x469dc7);})['then'](function(_0x4867bc){if(_0x4867bc[_0x1bc0('0x30')]){throw new Error(util[_0x1bc0('0x2c')](_0x1bc0('0x31'),_0x4867bc[_0x1bc0('0x30')]['message']||JSON['stringify'](_0x4867bc[_0x1bc0('0x30')])));}return!![];});}function handleError(_0x1ee44d,_0x4a5241,_0x446778){return _0x1ee44d['status'](_0x4a5241||0x1f4)['send']({'message':_0x446778?_0x446778['message']||_0x446778:''});}exports[_0x1bc0('0x32')]=function(_0x1ea3c1,_0x234d42,_0x3a6ef3){passport[_0x1bc0('0x33')](_0x1bc0('0x34'),function(_0x5ed5bf,_0x1b66f6,_0x3830b4){var _0x57dff6=_0x5ed5bf||_0x3830b4;if(_0x57dff6){return handleError(_0x234d42,0x191,_0x57dff6);}if(!_0x1b66f6){return handleError(_0x234d42,0x194,{'message':_0x1bc0('0x35')});}else{var _0xe2cdb0={'payload':{'id':_0x1b66f6['id'],'role':_0x1b66f6[_0x1bc0('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x1bc0('0x36')](_0xe2cdb0)[_0x1bc0('0xd')](function(_0x4515cd){_0x234d42[_0x1bc0('0x37')]({'id':_0x1b66f6['id'],'token':_0x4515cd,'statusCall':'','isAlreadyLogged':_0x1b66f6[_0x1bc0('0x38')]});});}})(_0x1ea3c1,_0x234d42,_0x3a6ef3);};exports[_0x1bc0('0x39')]=function(_0x5dfefe,_0x2c86d5,_0x47f180){if(!_0x5dfefe[_0x1bc0('0x3a')][_0x1bc0('0x22')]){return handleError(_0x2c86d5,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3dde3b=rs[_0x1bc0('0x3b')]();_0x5dfefe[_0x1bc0('0x3a')]['email']=_0x5dfefe['body'][_0x1bc0('0x22')][_0x1bc0('0x3c')]()[_0x1bc0('0x3d')]();var _0x2f7f3b;return db['Setting'][_0x1bc0('0xc')]({'where':{'id':0x1},'attributes':[_0x1bc0('0x18'),_0x1bc0('0x19')],'raw':!![]})[_0x1bc0('0xd')](function(_0x4b7a98){_0x2f7f3b=_0x4b7a98;return db[_0x1bc0('0x3e')][_0x1bc0('0x21')]({'where':{'email':_0x5dfefe[_0x1bc0('0x3a')][_0x1bc0('0x22')]}});})['then'](function(_0x3486a9){if(!_0x3486a9){throw new Error(_0x1bc0('0x3f'));}if(_0x3486a9[_0x1bc0('0x1e')]){throw new Error(_0x1bc0('0x40'));}if(_0x3486a9[_0x1bc0('0x12')]){if(moment(_0x3486a9[_0x1bc0('0x1a')])[_0x1bc0('0x1b')](_0x2f7f3b[_0x1bc0('0x19')],_0x1bc0('0x1c'))>moment()){throw new Error(_0x1bc0('0x41'));}else{_0x3486a9[_0x1bc0('0x12')]=![];_0x3486a9[_0x1bc0('0x1a')]=null;}}_0x3486a9[_0x1bc0('0x42')]=_0x3dde3b;_0x3486a9[_0x1bc0('0x43')]=Date[_0x1bc0('0x44')]()+0x36ee80;return _0x3486a9['save']();})[_0x1bc0('0xd')](function(){return sendServiceMail({'to':_0x5dfefe[_0x1bc0('0x3a')][_0x1bc0('0x22')],'subject':_0x1bc0('0x45'),'text':_0x1bc0('0x46')+_0x1bc0('0x47')+_0x1bc0('0x48')+_0x5dfefe[_0x1bc0('0x49')][_0x1bc0('0x4a')]+_0x1bc0('0x4b')+_0x3dde3b+'\x0a\x0a'+_0x1bc0('0x4c')});})[_0x1bc0('0xd')](function(){_0x2c86d5[_0x1bc0('0x4d')](0xc8)['send']({'message':_0x1bc0('0x4e')});})[_0x1bc0('0x20')](function(_0x46f3b8){return handleError(_0x2c86d5,0x1f4,_0x46f3b8);});};exports[_0x1bc0('0x4f')]=function(_0x2ae10a,_0x578623,_0x1ba4a2){return db['User'][_0x1bc0('0x21')]({'where':{'resetPasswordToken':_0x2ae10a[_0x1bc0('0x50')][_0x1bc0('0x51')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x295a24){if(!_0x295a24){throw new Error(_0x1bc0('0x52'));}return db['Setting'][_0x1bc0('0xc')]({'attributes':['id',_0x1bc0('0x53'),'enforcePasswordHistory',_0x1bc0('0x54')]})[_0x1bc0('0xd')](function(_0xb40a37){if(_0xb40a37['securePassword'])authService['validatePasswordPattern'](_0x2ae10a[_0x1bc0('0x3a')]['password']);if(!_0xb40a37[_0x1bc0('0x55')]||!_0x295a24[_0x1bc0('0x56')])return _0x295a24;authService[_0x1bc0('0x57')](_0x2ae10a[_0x1bc0('0x3a')][_0x1bc0('0xf')],_0x295a24[_0x1bc0('0x56')],_0xb40a37['passwordHistoryLimit']);return _0x295a24;})['then'](function(){_0x295a24['password']=_0x2ae10a[_0x1bc0('0x3a')][_0x1bc0('0xf')];_0x295a24[_0x1bc0('0x42')]=null;_0x295a24['resetPasswordExpires']=null;return _0x295a24[_0x1bc0('0x58')]();});})['then'](function(){_0x578623[_0x1bc0('0x4d')](0xc8)[_0x1bc0('0x59')]({'message':_0x1bc0('0x5a')});})[_0x1bc0('0x20')](function(_0x5c668d){return handleError(_0x578623,0x1f4,_0x5c668d);});};passport[_0x1bc0('0x5b')](new LocalStrategy({'usernameField':_0x1bc0('0xe'),'passwordField':_0x1bc0('0xf')},function(_0x4ec1c2,_0xf0e21,_0x4ed10c){return localAuthenticate(db['User'],_0x4ec1c2,_0xf0e21,_0x4ed10c);})); \ No newline at end of file +var _0x6bc9=['util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','findOne','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','Password\x20reset!','use'];(function(_0x3f2695,_0x4f6e5f){var _0x405993=function(_0x170912){while(--_0x170912){_0x3f2695['push'](_0x3f2695['shift']());}};_0x405993(++_0x4f6e5f);}(_0x6bc9,0x1c2));var _0x96bc=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x6bc9[_0x2b152a];return _0x2ad4c7;};'use strict';var util=require(_0x96bc('0x0'));var passport=require(_0x96bc('0x1'));var LocalStrategy=require('passport-local')[_0x96bc('0x2')];var jayson=require(_0x96bc('0x3'));var _=require(_0x96bc('0x4'));var rs=require(_0x96bc('0x5'));var moment=require(_0x96bc('0x6'));var db=require(_0x96bc('0x7'))['db'];var authService=require(_0x96bc('0x8'));var utils=require(_0x96bc('0x9'));var client=jayson['client'][_0x96bc('0xa')]({'port':0x232b});function localAuthenticate(_0x5afeba,_0x4f5a48,_0x6ab158,_0x5059ec){var _0x330839,_0x3166fe;return db[_0x96bc('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x96bc('0xc'),_0x96bc('0xd')],'raw':!![]})['then'](function(_0xa8688a){_0x330839=_0xa8688a;return _0x5afeba[_0x96bc('0xe')]({'attributes':['id',_0x96bc('0xf'),_0x96bc('0x10'),_0x96bc('0x11'),_0x96bc('0x12'),_0x96bc('0x13'),_0x96bc('0x14'),_0x96bc('0x15'),'loginAttempts'],'where':{'name':_0x4f5a48,'role':{'$or':[_0x96bc('0x16'),'user',_0x96bc('0x17')]}}});})[_0x96bc('0x18')](function(_0xf131bc){if(!_0xf131bc||_0xf131bc&&_0xf131bc['name']!==_0x4f5a48){throw new Error(_0x96bc('0x19'));}else{_0x3166fe=_0xf131bc;return _0x3166fe;}})['then'](function(){_0x3166fe[_0x96bc('0x1a')](_0x6ab158,function(_0x19a33b,_0x4e13da){var _0x4df295=_0x3166fe[_0x96bc('0x1b')]+0x1;if(_0x19a33b){return _0x5059ec(_0x19a33b);}else if(!_0x4e13da){if(_0x3166fe[_0x96bc('0x13')]){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else if(_0x330839[_0x96bc('0xc')]>0x0){if(_0x3166fe['blocked']){if(_0x330839[_0x96bc('0xd')]>0x0){if(moment(_0x3166fe[_0x96bc('0x15')])[_0x96bc('0x1c')](_0x330839[_0x96bc('0xd')],_0x96bc('0x1d'))>moment()){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else{return utils[_0x96bc('0x1e')](_0x3166fe,_0x4df295,![],null)['then'](function(){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});});}}else{return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}}else{if(_0x4df295>=_0x330839['allowedLoginAttempts']){return utils['clearBlockUser'](_0x3166fe,0x0,!![],moment())[_0x96bc('0x18')](function(){return _0x5059ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x3166fe,_0x4df295,![],null)['then'](function(){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});});}}}else{return _0x5059ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3166fe[_0x96bc('0x13')]){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else if(_0x330839['allowedLoginAttempts']>0x0){if(_0x3166fe[_0x96bc('0x14')]){if(_0x330839[_0x96bc('0xd')]>0x0){if(moment(_0x3166fe[_0x96bc('0x15')])[_0x96bc('0x1c')](_0x330839[_0x96bc('0xd')],'minutes')>moment()){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else{return utils['clearBlockUser'](_0x3166fe,0x0,![],null)[_0x96bc('0x18')](function(){return utils[_0x96bc('0x1f')](_0x3166fe);})['then'](function(){return _0x5059ec(null,_0x3166fe);});}}else{return _0x5059ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x3166fe,0x0,![],null)['then'](function(){return utils[_0x96bc('0x1f')](_0x3166fe);})[_0x96bc('0x18')](function(){return _0x5059ec(null,_0x3166fe);})['catch'](function(_0xc51c3c){return _0x5059ec(null,![],_0xc51c3c);});}}else{if(_0x3166fe[_0x96bc('0x14')]){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else{return utils['getLicense'](_0x3166fe)[_0x96bc('0x18')](function(){return _0x5059ec(null,_0x3166fe);});}}}});})[_0x96bc('0x20')](function(_0x1ea5af){return _0x5059ec(null,![],_0x1ea5af);});}function sendServiceMail(_0x4342f1){return db[_0x96bc('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0x96bc('0xf'),'email'],'include':[{'model':db[_0x96bc('0x22')],'as':_0x96bc('0x23')}]})['then'](function(_0x30041f){if(!_0x30041f){throw new Error(_0x96bc('0x24'));}var _0x4294a9={'tls':{'rejectUnauthorized':![]}};if(_0x30041f[_0x96bc('0x23')][_0x96bc('0x25')]){_0x4294a9['service']=_0x30041f[_0x96bc('0x23')][_0x96bc('0x25')];}else{_0x4294a9[_0x96bc('0x26')]=_0x30041f[_0x96bc('0x23')]['host'];_0x4294a9[_0x96bc('0x27')]=_0x30041f['Smtp'][_0x96bc('0x27')];_0x4294a9[_0x96bc('0x28')]=_0x30041f[_0x96bc('0x23')][_0x96bc('0x28')];}if(_0x30041f[_0x96bc('0x23')][_0x96bc('0x29')]){_0x4294a9[_0x96bc('0x2a')]={'user':_0x30041f[_0x96bc('0x23')][_0x96bc('0x2b')],'pass':_0x30041f[_0x96bc('0x23')][_0x96bc('0x2c')]};}var _0x186128={'account':_0x4294a9,'message':_[_0x96bc('0x2d')]({'from':util[_0x96bc('0x2e')](_0x96bc('0x2f'),_0x30041f[_0x96bc('0xf')],_0x30041f[_0x96bc('0x30')]||_0x30041f['Smtp'][_0x96bc('0x2b')])},_0x4342f1)};return client[_0x96bc('0x31')](_0x96bc('0x32'),_0x186128);})[_0x96bc('0x18')](function(_0x477842){if(_0x477842[_0x96bc('0x33')]){throw new Error(util[_0x96bc('0x2e')](_0x96bc('0x34'),_0x477842[_0x96bc('0x33')]['message']||JSON['stringify'](_0x477842[_0x96bc('0x33')])));}return!![];});}function handleError(_0x4eacce,_0x57a8bd,_0x26d046){return _0x4eacce[_0x96bc('0x35')](_0x57a8bd||0x1f4)[_0x96bc('0x36')]({'message':_0x26d046?_0x26d046[_0x96bc('0x37')]||_0x26d046:''});}exports['login']=function(_0x4183e0,_0x17d6e5,_0x41d90a){passport[_0x96bc('0x1a')](_0x96bc('0x38'),function(_0x11f52a,_0x316885,_0x15f1a9){var _0x2d424c=_0x11f52a||_0x15f1a9;if(_0x2d424c){return handleError(_0x17d6e5,0x191,_0x2d424c);}if(!_0x316885){return handleError(_0x17d6e5,0x194,{'message':_0x96bc('0x39')});}else{var _0x377456={'payload':{'id':_0x316885['id'],'role':_0x316885[_0x96bc('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x96bc('0x3a')](_0x377456)[_0x96bc('0x18')](function(_0x2173d1){_0x17d6e5['json']({'id':_0x316885['id'],'token':_0x2173d1,'statusCall':'','isAlreadyLogged':_0x316885[_0x96bc('0x3b')]});});}})(_0x4183e0,_0x17d6e5,_0x41d90a);};exports[_0x96bc('0x3c')]=function(_0x1a4e97,_0x2b49f7,_0x2db3d7){if(!_0x1a4e97[_0x96bc('0x3d')]['email']){return handleError(_0x2b49f7,0x1f4,{'message':_0x96bc('0x3e')});}var _0x47b6f6=rs[_0x96bc('0x3f')]();_0x1a4e97[_0x96bc('0x3d')][_0x96bc('0x30')]=_0x1a4e97['body'][_0x96bc('0x30')][_0x96bc('0x40')]()[_0x96bc('0x41')]();var _0x1cc343;return db[_0x96bc('0xb')][_0x96bc('0xe')]({'where':{'id':0x1},'attributes':[_0x96bc('0xc'),_0x96bc('0xd')],'raw':!![]})[_0x96bc('0x18')](function(_0x910a2c){_0x1cc343=_0x910a2c;return db[_0x96bc('0x42')][_0x96bc('0x43')]({'where':{'email':_0x1a4e97[_0x96bc('0x3d')]['email']}});})[_0x96bc('0x18')](function(_0x137946){if(!_0x137946){throw new Error(_0x96bc('0x44'));}if(_0x137946['disabled']){throw new Error(_0x96bc('0x45'));}if(_0x137946[_0x96bc('0x14')]){if(moment(_0x137946['blockedAt'])['add'](_0x1cc343[_0x96bc('0xd')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x137946[_0x96bc('0x14')]=![];_0x137946[_0x96bc('0x15')]=null;}}_0x137946[_0x96bc('0x46')]=_0x47b6f6;_0x137946[_0x96bc('0x47')]=Date[_0x96bc('0x48')]()+0x36ee80;return _0x137946[_0x96bc('0x49')]();})['then'](function(){return sendServiceMail({'to':_0x1a4e97[_0x96bc('0x3d')][_0x96bc('0x30')],'subject':_0x96bc('0x4a'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x96bc('0x4b')+_0x96bc('0x4c')+_0x1a4e97[_0x96bc('0x4d')][_0x96bc('0x26')]+_0x96bc('0x4e')+_0x47b6f6+'\x0a\x0a'+_0x96bc('0x4f')});})[_0x96bc('0x18')](function(){_0x2b49f7[_0x96bc('0x35')](0xc8)['send']({'message':_0x96bc('0x50')});})[_0x96bc('0x20')](function(_0x379d97){return handleError(_0x2b49f7,0x1f4,_0x379d97);});};exports['reset']=function(_0x2eade1,_0x826a13,_0x4f8fa4){return db[_0x96bc('0x42')][_0x96bc('0x43')]({'where':{'resetPasswordToken':_0x2eade1[_0x96bc('0x51')][_0x96bc('0x52')],'resetPasswordExpires':{'$gt':Date[_0x96bc('0x48')]()}}})['then'](function(_0x286355){if(!_0x286355){throw new Error(_0x96bc('0x53'));}return db[_0x96bc('0xb')]['findOne']({'attributes':['id',_0x96bc('0x54'),'enforcePasswordHistory',_0x96bc('0x55')]})['then'](function(_0x5e98da){if(_0x5e98da['securePassword'])authService['validatePasswordPattern'](_0x2eade1[_0x96bc('0x3d')][_0x96bc('0x10')]);if(!_0x5e98da[_0x96bc('0x56')]||!_0x286355['previousPasswords'])return _0x286355;authService[_0x96bc('0x57')](_0x2eade1[_0x96bc('0x3d')][_0x96bc('0x10')],_0x286355['previousPasswords'],_0x5e98da['passwordHistoryLimit']);return _0x286355;})['then'](function(){_0x286355[_0x96bc('0x10')]=_0x2eade1[_0x96bc('0x3d')]['password'];_0x286355[_0x96bc('0x46')]=null;_0x286355[_0x96bc('0x47')]=null;return _0x286355['save']();});})['then'](function(){_0x826a13[_0x96bc('0x35')](0xc8)[_0x96bc('0x36')]({'message':_0x96bc('0x58')});})[_0x96bc('0x20')](function(_0x46bd2e){return handleError(_0x826a13,0x1f4,_0x46bd2e);});};passport[_0x96bc('0x59')](new LocalStrategy({'usernameField':_0x96bc('0xf'),'passwordField':_0x96bc('0x10')},function(_0x5aff94,_0x1b11c0,_0x1ca7aa){return localAuthenticate(db[_0x96bc('0x42')],_0x5aff94,_0x1b11c0,_0x1ca7aa);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 4e6f544..406fc1c 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 _0x5531=['reset','exports','express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0x352b49,_0x16a4ee){var _0x2e314a=function(_0x339d73){while(--_0x339d73){_0x352b49['push'](_0x352b49['shift']());}};_0x2e314a(++_0x16a4ee);}(_0x5531,0x1cd));var _0x1553=function(_0x7f3cac,_0x3a3ebf){_0x7f3cac=_0x7f3cac-0x0;var _0x473692=_0x5531[_0x7f3cac];return _0x473692;};'use strict';var express=require(_0x1553('0x0'));var router=express['Router']();var controller=require(_0x1553('0x1'));router[_0x1553('0x2')]('/',controller[_0x1553('0x3')]);router[_0x1553('0x2')](_0x1553('0x4'),controller[_0x1553('0x5')]);router['post'](_0x1553('0x6'),controller[_0x1553('0x7')]);module[_0x1553('0x8')]=router; \ No newline at end of file +var _0x11ad=['login','/reset/:token','exports','express','./authLocal.controller','post'];(function(_0x301064,_0x1b5aa3){var _0x294f02=function(_0x39f98b){while(--_0x39f98b){_0x301064['push'](_0x301064['shift']());}};_0x294f02(++_0x1b5aa3);}(_0x11ad,0x12f));var _0xd11a=function(_0x51b475,_0x24beb4){_0x51b475=_0x51b475-0x0;var _0x35ab63=_0x11ad[_0x51b475];return _0x35ab63;};'use strict';var express=require(_0xd11a('0x0'));var router=express['Router']();var controller=require(_0xd11a('0x1'));router[_0xd11a('0x2')]('/',controller[_0xd11a('0x3')]);router[_0xd11a('0x2')]('/forgot',controller['forgot']);router['post'](_0xd11a('0x4'),controller['reset']);module[_0xd11a('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 975b1d9..c04e2bc 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 _0xafe0=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x232533,_0x4f53ef){var _0x17eeb8=function(_0x818dc9){while(--_0x818dc9){_0x232533['push'](_0x232533['shift']());}};_0x17eeb8(++_0x4f53ef);}(_0xafe0,0x151));var _0x0afe=function(_0x54fbed,_0x3c77a7){_0x54fbed=_0x54fbed-0x0;var _0x333bbc=_0xafe0[_0x54fbed];return _0x333bbc;};'use strict';var Sequelize=require(_0x0afe('0x0'));module[_0x0afe('0x1')]={'name':{'type':Sequelize[_0x0afe('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0afe('0x2')]},'description':{'type':Sequelize[_0x0afe('0x2')]},'status':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0afe('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x6e89=['BOOLEAN','sequelize','exports','STRING'];(function(_0x29e860,_0x1845e8){var _0xb994ef=function(_0x4dcd97){while(--_0x4dcd97){_0x29e860['push'](_0x29e860['shift']());}};_0xb994ef(++_0x1845e8);}(_0x6e89,0x1bd));var _0x96e8=function(_0x23ecc4,_0x243141){_0x23ecc4=_0x23ecc4-0x0;var _0x22ff25=_0x6e89[_0x23ecc4];return _0x22ff25;};'use strict';var Sequelize=require(_0x96e8('0x0'));module[_0x96e8('0x1')]={'name':{'type':Sequelize[_0x96e8('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x96e8('0x2')]},'status':{'type':Sequelize[_0x96e8('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 90d7529..06bfdfc 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 _0x8a2f=['send','index','Automation','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','keys','find','create','body','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name'];(function(_0x3adafa,_0x1ff5ea){var _0x229947=function(_0x3ad71b){while(--_0x3ad71b){_0x3adafa['push'](_0x3adafa['shift']());}};_0x229947(++_0x1ff5ea);}(_0x8a2f,0x81));var _0xf8a2=function(_0x42b204,_0x58d8b0){_0x42b204=_0x42b204-0x0;var _0xbff449=_0x8a2f[_0x42b204];return _0xbff449;};'use strict';var emlformat=require(_0xf8a2('0x0'));var rimraf=require(_0xf8a2('0x1'));var zipdir=require(_0xf8a2('0x2'));var jsonpatch=require(_0xf8a2('0x3'));var rp=require(_0xf8a2('0x4'));var moment=require(_0xf8a2('0x5'));var BPromise=require(_0xf8a2('0x6'));var Mustache=require(_0xf8a2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf8a2('0x8'));var csv=require('to-csv');var ejs=require(_0xf8a2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8a2('0xa'));var squel=require(_0xf8a2('0xb'));var crypto=require(_0xf8a2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf8a2('0xd'));var querystring=require(_0xf8a2('0xe'));var Papa=require(_0xf8a2('0xf'));var Redis=require(_0xf8a2('0x10'));var authService=require(_0xf8a2('0x11'));var qs=require(_0xf8a2('0x12'));var as=require(_0xf8a2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8a2('0x14'))(_0xf8a2('0x15'));var utils=require(_0xf8a2('0x16'));var config=require(_0xf8a2('0x17'));var licenseUtil=require(_0xf8a2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3597f9,_0x174b4e){_0x174b4e=_0x174b4e||0xcc;return function(_0xc5081e){if(_0xc5081e){return _0x3597f9[_0xf8a2('0x19')](_0x174b4e);}return _0x3597f9['status'](_0x174b4e)['end']();};}function respondWithResult(_0x9997d3,_0x52ad7d){_0x52ad7d=_0x52ad7d||0xc8;return function(_0x3113b9){if(_0x3113b9){return _0x9997d3[_0xf8a2('0x1a')](_0x52ad7d)[_0xf8a2('0x1b')](_0x3113b9);}};}function respondWithFilteredResult(_0xca3bfb,_0x2cb8bd){return function(_0x3c2adc){if(_0x3c2adc){var _0x2e2999=typeof _0x2cb8bd[_0xf8a2('0x1c')]===_0xf8a2('0x1d')&&typeof _0x2cb8bd[_0xf8a2('0x1e')]===_0xf8a2('0x1d');var _0x355d5d=_0x3c2adc[_0xf8a2('0x1f')];var _0x19f6c5=_0x2e2999?0x0:_0x2cb8bd[_0xf8a2('0x1c')];var _0x3abdee=_0x2e2999?_0x3c2adc[_0xf8a2('0x1f')]:_0x2cb8bd[_0xf8a2('0x1c')]+_0x2cb8bd['limit'];var _0x2f9301;if(_0x3abdee>=_0x355d5d){_0x3abdee=_0x355d5d;_0x2f9301=0xc8;}else{_0x2f9301=0xce;}_0xca3bfb[_0xf8a2('0x1a')](_0x2f9301);return _0xca3bfb['set'](_0xf8a2('0x20'),_0x19f6c5+'-'+_0x3abdee+'/'+_0x355d5d)['json'](_0x3c2adc);}return null;};}function patchUpdates(_0x3f0cf5){return function(_0x2d5e98){try{jsonpatch['apply'](_0x2d5e98,_0x3f0cf5,!![]);}catch(_0x386ce7){return BPromise['reject'](_0x386ce7);}return _0x2d5e98[_0xf8a2('0x21')]();};}function saveUpdates(_0x5e25f7,_0x237b8b){return function(_0x1c98be){if(_0x1c98be){return _0x1c98be[_0xf8a2('0x22')](_0x5e25f7)[_0xf8a2('0x23')](function(_0x1d917d){return _0x1d917d;});}return null;};}function removeEntity(_0xf138a6,_0x5d9221){return function(_0x4d80fd){if(_0x4d80fd){return _0x4d80fd[_0xf8a2('0x24')]()['then'](function(){_0xf138a6[_0xf8a2('0x1a')](0xcc)[_0xf8a2('0x25')]();});}};}function handleEntityNotFound(_0x4c44ce,_0x18ab36){return function(_0x58b530){if(!_0x58b530){_0x4c44ce['sendStatus'](0x194);}return _0x58b530;};}function handleError(_0x12f446,_0x1918cd){_0x1918cd=_0x1918cd||0x1f4;return function(_0x403612){logger[_0xf8a2('0x26')](_0x403612[_0xf8a2('0x27')]);if(_0x403612[_0xf8a2('0x28')]){delete _0x403612['name'];}_0x12f446[_0xf8a2('0x1a')](_0x1918cd)[_0xf8a2('0x29')](_0x403612);};}exports[_0xf8a2('0x2a')]=function(_0xf07852,_0x47899e){var _0x589caf={},_0x2c44b2={},_0x13e25a={'count':0x0,'rows':[]};var _0x2b214=_['map'](db[_0xf8a2('0x2b')][_0xf8a2('0x2c')],function(_0x310d84){return{'name':_0x310d84[_0xf8a2('0x2d')],'type':_0x310d84['type'][_0xf8a2('0x2e')]};});_0x2c44b2[_0xf8a2('0x2f')]=_[_0xf8a2('0x30')](_0x2b214,_0xf8a2('0x28'));_0x2c44b2['query']=_['keys'](_0xf07852[_0xf8a2('0x31')]);_0x2c44b2[_0xf8a2('0x32')]=_[_0xf8a2('0x33')](_0x2c44b2[_0xf8a2('0x2f')],_0x2c44b2[_0xf8a2('0x31')]);_0x589caf[_0xf8a2('0x34')]=_[_0xf8a2('0x33')](_0x2c44b2['model'],qs['fields'](_0xf07852['query'][_0xf8a2('0x35')]));_0x589caf['attributes']=_0x589caf[_0xf8a2('0x34')][_0xf8a2('0x36')]?_0x589caf[_0xf8a2('0x34')]:_0x2c44b2[_0xf8a2('0x2f')];if(!_0xf07852[_0xf8a2('0x31')][_0xf8a2('0x37')](_0xf8a2('0x38'))){_0x589caf[_0xf8a2('0x1e')]=qs['limit'](_0xf07852['query']['limit']);_0x589caf[_0xf8a2('0x1c')]=qs[_0xf8a2('0x1c')](_0xf07852['query'][_0xf8a2('0x1c')]);}_0x589caf[_0xf8a2('0x39')]=qs[_0xf8a2('0x3a')](_0xf07852['query']['sort']);_0x589caf['where']=qs[_0xf8a2('0x32')](_[_0xf8a2('0x3b')](_0xf07852[_0xf8a2('0x31')],_0x2c44b2[_0xf8a2('0x32')]),_0x2b214);if(_0xf07852[_0xf8a2('0x31')][_0xf8a2('0x3c')]){_0x589caf['where']=_[_0xf8a2('0x3d')](_0x589caf['where'],{'$or':_['map'](_0x2b214,function(_0x5d5e4b){if(_0x5d5e4b[_0xf8a2('0x3e')]!==_0xf8a2('0x3f')){var _0x5342d9={};_0x5342d9[_0x5d5e4b[_0xf8a2('0x28')]]={'$like':'%'+_0xf07852[_0xf8a2('0x31')][_0xf8a2('0x3c')]+'%'};return _0x5342d9;}})});}_0x589caf=_[_0xf8a2('0x3d')]({},_0x589caf,_0xf07852[_0xf8a2('0x40')]);var _0x236f9a={'where':_0x589caf[_0xf8a2('0x41')]};return db['Automation'][_0xf8a2('0x1f')](_0x236f9a)[_0xf8a2('0x23')](function(_0x11ad1a){_0x13e25a[_0xf8a2('0x1f')]=_0x11ad1a;if(_0xf07852[_0xf8a2('0x31')][_0xf8a2('0x42')]){_0x589caf[_0xf8a2('0x43')]=[{'all':!![]}];}return db['Automation'][_0xf8a2('0x44')](_0x589caf);})[_0xf8a2('0x23')](function(_0x20d12a){_0x13e25a[_0xf8a2('0x45')]=_0x20d12a;return _0x13e25a;})[_0xf8a2('0x23')](respondWithFilteredResult(_0x47899e,_0x589caf))[_0xf8a2('0x46')](handleError(_0x47899e,null));};exports['show']=function(_0x5863cc,_0x3018c5){var _0x35ac7e={'raw':![],'where':{'id':_0x5863cc[_0xf8a2('0x47')]['id']}},_0x5d3ec7={};_0x5d3ec7[_0xf8a2('0x2f')]=_[_0xf8a2('0x48')](db[_0xf8a2('0x2b')][_0xf8a2('0x2c')]);_0x5d3ec7['query']=_[_0xf8a2('0x48')](_0x5863cc[_0xf8a2('0x31')]);_0x5d3ec7['filters']=_[_0xf8a2('0x33')](_0x5d3ec7[_0xf8a2('0x2f')],_0x5d3ec7[_0xf8a2('0x31')]);_0x35ac7e[_0xf8a2('0x34')]=_[_0xf8a2('0x33')](_0x5d3ec7['model'],qs[_0xf8a2('0x35')](_0x5863cc[_0xf8a2('0x31')][_0xf8a2('0x35')]));_0x35ac7e[_0xf8a2('0x34')]=_0x35ac7e[_0xf8a2('0x34')][_0xf8a2('0x36')]?_0x35ac7e[_0xf8a2('0x34')]:_0x5d3ec7[_0xf8a2('0x2f')];if(_0x5863cc[_0xf8a2('0x31')][_0xf8a2('0x42')]){_0x35ac7e[_0xf8a2('0x43')]=[{'all':!![]}];}_0x35ac7e=_[_0xf8a2('0x3d')]({},_0x35ac7e,_0x5863cc[_0xf8a2('0x40')]);return db[_0xf8a2('0x2b')][_0xf8a2('0x49')](_0x35ac7e)[_0xf8a2('0x23')](handleEntityNotFound(_0x3018c5,null))['then'](respondWithResult(_0x3018c5,null))[_0xf8a2('0x46')](handleError(_0x3018c5,null));};exports[_0xf8a2('0x4a')]=function(_0x1184f2,_0x47f92a){return db[_0xf8a2('0x2b')][_0xf8a2('0x4a')](_0x1184f2[_0xf8a2('0x4b')],{})['then'](respondWithResult(_0x47f92a,0xc9))[_0xf8a2('0x46')](handleError(_0x47f92a,null));};exports[_0xf8a2('0x22')]=function(_0xfec5a3,_0x9af4c8){if(_0xfec5a3[_0xf8a2('0x4b')]['id']){delete _0xfec5a3[_0xf8a2('0x4b')]['id'];}return db['Automation'][_0xf8a2('0x49')]({'where':{'id':_0xfec5a3[_0xf8a2('0x47')]['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x9af4c8,null))[_0xf8a2('0x23')](saveUpdates(_0xfec5a3[_0xf8a2('0x4b')],null))[_0xf8a2('0x23')](respondWithResult(_0x9af4c8,null))[_0xf8a2('0x46')](handleError(_0x9af4c8,null));};exports['destroy']=function(_0x54561b,_0x82445a){return db['Automation'][_0xf8a2('0x49')]({'where':{'id':_0x54561b[_0xf8a2('0x47')]['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x82445a,null))['then'](removeEntity(_0x82445a,null))[_0xf8a2('0x46')](handleError(_0x82445a,null));};exports[_0xf8a2('0x4c')]=function(_0x76ff46,_0x9fe5f4,_0x431c0b){return db[_0xf8a2('0x4d')][_0xf8a2('0x49')]({'where':{'id':_0x76ff46[_0xf8a2('0x47')]['id']}})['then'](handleEntityNotFound(_0x9fe5f4,null))[_0xf8a2('0x23')](function(_0x1ebcef){if(_0x1ebcef){return _0x1ebcef[_0xf8a2('0x4c')](_0x76ff46[_0xf8a2('0x4b')][_0xf8a2('0x4e')],_[_0xf8a2('0x4f')](_0x76ff46['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x9fe5f4,null))[_0xf8a2('0x46')](handleError(_0x9fe5f4,null));};exports[_0xf8a2('0x50')]=function(_0xfd45f,_0x3b110c,_0x24689d){var _0x4868c9={};var _0x39301b={};var _0xdc461f;var _0x3aa1a5;return db[_0xf8a2('0x2b')]['findOne']({'where':{'id':_0xfd45f[_0xf8a2('0x47')]['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x3b110c,null))['then'](function(_0x263572){if(_0x263572){_0xdc461f=_0x263572;_0x39301b['model']=_[_0xf8a2('0x48')](db[_0xf8a2('0x4d')]['rawAttributes']);_0x39301b[_0xf8a2('0x31')]=_[_0xf8a2('0x48')](_0xfd45f['query']);_0x39301b['filters']=_['intersection'](_0x39301b[_0xf8a2('0x2f')],_0x39301b[_0xf8a2('0x31')]);_0x4868c9['attributes']=_[_0xf8a2('0x33')](_0x39301b['model'],qs[_0xf8a2('0x35')](_0xfd45f[_0xf8a2('0x31')][_0xf8a2('0x35')]));_0x4868c9[_0xf8a2('0x34')]=_0x4868c9['attributes'][_0xf8a2('0x36')]?_0x4868c9['attributes']:_0x39301b[_0xf8a2('0x2f')];_0x4868c9['order']=qs['sort'](_0xfd45f['query']['sort']);_0x4868c9['where']=qs[_0xf8a2('0x32')](_['pick'](_0xfd45f[_0xf8a2('0x31')],_0x39301b[_0xf8a2('0x32')]));if(_0xfd45f[_0xf8a2('0x31')][_0xf8a2('0x3c')]){_0x4868c9[_0xf8a2('0x41')]=_[_0xf8a2('0x3d')](_0x4868c9[_0xf8a2('0x41')],{'$or':_[_0xf8a2('0x30')](_0x4868c9[_0xf8a2('0x34')],function(_0xe17f8b){var _0xafd46e={};_0xafd46e[_0xe17f8b]={'$like':'%'+_0xfd45f['query'][_0xf8a2('0x3c')]+'%'};return _0xafd46e;})});}_0x4868c9=_[_0xf8a2('0x3d')]({},_0x4868c9,_0xfd45f[_0xf8a2('0x40')]);return _0xdc461f[_0xf8a2('0x50')](_0x4868c9);}})[_0xf8a2('0x23')](function(_0x521975){if(_0x521975){_0x3aa1a5=_0x521975[_0xf8a2('0x36')];if(!_0xfd45f['query'][_0xf8a2('0x37')]('nolimit')){_0x4868c9[_0xf8a2('0x1e')]=qs[_0xf8a2('0x1e')](_0xfd45f['query'][_0xf8a2('0x1e')]);_0x4868c9[_0xf8a2('0x1c')]=qs[_0xf8a2('0x1c')](_0xfd45f[_0xf8a2('0x31')]['offset']);}return _0xdc461f['getConditions'](_0x4868c9);}})['then'](function(_0x419f29){if(_0x419f29){return _0x419f29?{'count':_0x3aa1a5,'rows':_0x419f29}:null;}})['then'](respondWithResult(_0x3b110c,null))[_0xf8a2('0x46')](handleError(_0x3b110c,null));};exports[_0xf8a2('0x51')]=function(_0x557121,_0x277430,_0x33acca){return db[_0xf8a2('0x52')][_0xf8a2('0x49')]({'where':{'id':_0x557121['params']['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x277430,null))['then'](function(_0x43c6ae){if(_0x43c6ae){return _0x43c6ae[_0xf8a2('0x51')](_0x557121[_0xf8a2('0x4b')]['ids'],_['omit'](_0x557121[_0xf8a2('0x4b')],[_0xf8a2('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x277430,null))[_0xf8a2('0x46')](handleError(_0x277430,null));};exports[_0xf8a2('0x53')]=function(_0x1c307b,_0x1c0a3c,_0x4da5f1){var _0x26c8fc={};var _0x58591d={};var _0xf2f9b1;var _0x2fba48;return db[_0xf8a2('0x2b')][_0xf8a2('0x54')]({'where':{'id':_0x1c307b['params']['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x1c0a3c,null))[_0xf8a2('0x23')](function(_0x5c5da7){if(_0x5c5da7){_0xf2f9b1=_0x5c5da7;_0x58591d[_0xf8a2('0x2f')]=_[_0xf8a2('0x48')](db[_0xf8a2('0x52')][_0xf8a2('0x2c')]);_0x58591d[_0xf8a2('0x31')]=_[_0xf8a2('0x48')](_0x1c307b[_0xf8a2('0x31')]);_0x58591d[_0xf8a2('0x32')]=_[_0xf8a2('0x33')](_0x58591d[_0xf8a2('0x2f')],_0x58591d[_0xf8a2('0x31')]);_0x26c8fc[_0xf8a2('0x34')]=_[_0xf8a2('0x33')](_0x58591d[_0xf8a2('0x2f')],qs[_0xf8a2('0x35')](_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x35')]));_0x26c8fc[_0xf8a2('0x34')]=_0x26c8fc[_0xf8a2('0x34')][_0xf8a2('0x36')]?_0x26c8fc[_0xf8a2('0x34')]:_0x58591d['model'];_0x26c8fc[_0xf8a2('0x39')]=qs[_0xf8a2('0x3a')](_0x1c307b['query'][_0xf8a2('0x3a')]);_0x26c8fc['where']=qs['filters'](_[_0xf8a2('0x3b')](_0x1c307b['query'],_0x58591d['filters']));if(_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x3c')]){_0x26c8fc['where']=_['merge'](_0x26c8fc[_0xf8a2('0x41')],{'$or':_[_0xf8a2('0x30')](_0x26c8fc[_0xf8a2('0x34')],function(_0x47d7e1){var _0x22d3de={};_0x22d3de[_0x47d7e1]={'$like':'%'+_0x1c307b[_0xf8a2('0x31')]['filter']+'%'};return _0x22d3de;})});}_0x26c8fc=_['merge']({},_0x26c8fc,_0x1c307b['options']);return _0xf2f9b1[_0xf8a2('0x53')](_0x26c8fc);}})[_0xf8a2('0x23')](function(_0x566648){if(_0x566648){_0x2fba48=_0x566648[_0xf8a2('0x36')];if(!_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x37')]('nolimit')){_0x26c8fc[_0xf8a2('0x1e')]=qs['limit'](_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x1e')]);_0x26c8fc['offset']=qs[_0xf8a2('0x1c')](_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x1c')]);}return _0xf2f9b1[_0xf8a2('0x53')](_0x26c8fc);}})[_0xf8a2('0x23')](function(_0x1e1d5e){if(_0x1e1d5e){return _0x1e1d5e?{'count':_0x2fba48,'rows':_0x1e1d5e}:null;}})[_0xf8a2('0x23')](respondWithResult(_0x1c0a3c,null))[_0xf8a2('0x46')](handleError(_0x1c0a3c,null));}; \ No newline at end of file +var _0x7852=['body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Automation','count','include','findAll','rows','catch','show','params','length','find','create'];(function(_0x261304,_0x2754c3){var _0x4231a6=function(_0x18fa3d){while(--_0x18fa3d){_0x261304['push'](_0x261304['shift']());}};_0x4231a6(++_0x2754c3);}(_0x7852,0x162));var _0x2785=function(_0x1384c1,_0x428311){_0x1384c1=_0x1384c1-0x0;var _0x452d8d=_0x7852[_0x1384c1];return _0x452d8d;};'use strict';var emlformat=require(_0x2785('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2785('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2785('0x2'));var moment=require(_0x2785('0x3'));var BPromise=require(_0x2785('0x4'));var Mustache=require(_0x2785('0x5'));var util=require('util');var path=require(_0x2785('0x6'));var sox=require('sox');var csv=require(_0x2785('0x7'));var ejs=require(_0x2785('0x8'));var fs=require('fs');var fs_extra=require(_0x2785('0x9'));var _=require(_0x2785('0xa'));var squel=require(_0x2785('0xb'));var crypto=require(_0x2785('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2785('0xd'));var Papa=require(_0x2785('0xe'));var Redis=require(_0x2785('0xf'));var authService=require(_0x2785('0x10'));var qs=require(_0x2785('0x11'));var as=require(_0x2785('0x12'));var hardwareService=require(_0x2785('0x13'));var logger=require(_0x2785('0x14'))(_0x2785('0x15'));var utils=require(_0x2785('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2785('0x17'))['db'];function respondWithStatusCode(_0x5d4c3c,_0x5a5d74){_0x5a5d74=_0x5a5d74||0xcc;return function(_0x1c4c1e){if(_0x1c4c1e){return _0x5d4c3c[_0x2785('0x18')](_0x5a5d74);}return _0x5d4c3c[_0x2785('0x19')](_0x5a5d74)[_0x2785('0x1a')]();};}function respondWithResult(_0x3fdb39,_0x50a5e5){_0x50a5e5=_0x50a5e5||0xc8;return function(_0x6a586f){if(_0x6a586f){return _0x3fdb39['status'](_0x50a5e5)[_0x2785('0x1b')](_0x6a586f);}};}function respondWithFilteredResult(_0x2bc743,_0x5cd42a){return function(_0xfd9704){if(_0xfd9704){var _0x1fe771=typeof _0x5cd42a[_0x2785('0x1c')]===_0x2785('0x1d')&&typeof _0x5cd42a['limit']===_0x2785('0x1d');var _0x3043f7=_0xfd9704['count'];var _0x3b7fe7=_0x1fe771?0x0:_0x5cd42a[_0x2785('0x1c')];var _0x9a6d23=_0x1fe771?_0xfd9704['count']:_0x5cd42a[_0x2785('0x1c')]+_0x5cd42a[_0x2785('0x1e')];var _0x2e9cfd;if(_0x9a6d23>=_0x3043f7){_0x9a6d23=_0x3043f7;_0x2e9cfd=0xc8;}else{_0x2e9cfd=0xce;}_0x2bc743['status'](_0x2e9cfd);return _0x2bc743[_0x2785('0x1f')](_0x2785('0x20'),_0x3b7fe7+'-'+_0x9a6d23+'/'+_0x3043f7)[_0x2785('0x1b')](_0xfd9704);}return null;};}function patchUpdates(_0x594340){return function(_0x56f7eb){try{jsonpatch[_0x2785('0x21')](_0x56f7eb,_0x594340,!![]);}catch(_0x2f8d3b){return BPromise[_0x2785('0x22')](_0x2f8d3b);}return _0x56f7eb[_0x2785('0x23')]();};}function saveUpdates(_0x334048,_0x2ec3bd){return function(_0x3e8cf7){if(_0x3e8cf7){return _0x3e8cf7[_0x2785('0x24')](_0x334048)[_0x2785('0x25')](function(_0x415d88){return _0x415d88;});}return null;};}function removeEntity(_0x14581b,_0x5bd57a){return function(_0x6703b8){if(_0x6703b8){return _0x6703b8[_0x2785('0x26')]()['then'](function(){_0x14581b[_0x2785('0x19')](0xcc)[_0x2785('0x1a')]();});}};}function handleEntityNotFound(_0x187707,_0x597c13){return function(_0x123237){if(!_0x123237){_0x187707[_0x2785('0x18')](0x194);}return _0x123237;};}function handleError(_0x17a520,_0x2044a8){_0x2044a8=_0x2044a8||0x1f4;return function(_0xbaf44e){logger[_0x2785('0x27')](_0xbaf44e[_0x2785('0x28')]);if(_0xbaf44e[_0x2785('0x29')]){delete _0xbaf44e['name'];}_0x17a520[_0x2785('0x19')](_0x2044a8)[_0x2785('0x2a')](_0xbaf44e);};}exports[_0x2785('0x2b')]=function(_0x17ed78,_0x23da3e){var _0x4adc16={},_0x525dc6={},_0x100f45={'count':0x0,'rows':[]};var _0x124256=_[_0x2785('0x2c')](db['Automation'][_0x2785('0x2d')],function(_0x4fa28d){return{'name':_0x4fa28d[_0x2785('0x2e')],'type':_0x4fa28d[_0x2785('0x2f')][_0x2785('0x30')]};});_0x525dc6['model']=_['map'](_0x124256,_0x2785('0x29'));_0x525dc6[_0x2785('0x31')]=_[_0x2785('0x32')](_0x17ed78[_0x2785('0x31')]);_0x525dc6[_0x2785('0x33')]=_[_0x2785('0x34')](_0x525dc6[_0x2785('0x35')],_0x525dc6[_0x2785('0x31')]);_0x4adc16[_0x2785('0x36')]=_['intersection'](_0x525dc6[_0x2785('0x35')],qs[_0x2785('0x37')](_0x17ed78['query'][_0x2785('0x37')]));_0x4adc16[_0x2785('0x36')]=_0x4adc16['attributes']['length']?_0x4adc16['attributes']:_0x525dc6[_0x2785('0x35')];if(!_0x17ed78[_0x2785('0x31')][_0x2785('0x38')](_0x2785('0x39'))){_0x4adc16[_0x2785('0x1e')]=qs[_0x2785('0x1e')](_0x17ed78[_0x2785('0x31')][_0x2785('0x1e')]);_0x4adc16[_0x2785('0x1c')]=qs[_0x2785('0x1c')](_0x17ed78[_0x2785('0x31')]['offset']);}_0x4adc16[_0x2785('0x3a')]=qs[_0x2785('0x3b')](_0x17ed78[_0x2785('0x31')][_0x2785('0x3b')]);_0x4adc16[_0x2785('0x3c')]=qs['filters'](_[_0x2785('0x3d')](_0x17ed78['query'],_0x525dc6[_0x2785('0x33')]),_0x124256);if(_0x17ed78['query'][_0x2785('0x3e')]){_0x4adc16[_0x2785('0x3c')]=_[_0x2785('0x3f')](_0x4adc16[_0x2785('0x3c')],{'$or':_['map'](_0x124256,function(_0x258970){if(_0x258970[_0x2785('0x2f')]!=='VIRTUAL'){var _0xce4297={};_0xce4297[_0x258970[_0x2785('0x29')]]={'$like':'%'+_0x17ed78[_0x2785('0x31')][_0x2785('0x3e')]+'%'};return _0xce4297;}})});}_0x4adc16=_[_0x2785('0x3f')]({},_0x4adc16,_0x17ed78[_0x2785('0x40')]);var _0x6551cb={'where':_0x4adc16['where']};return db[_0x2785('0x41')][_0x2785('0x42')](_0x6551cb)[_0x2785('0x25')](function(_0x582959){_0x100f45[_0x2785('0x42')]=_0x582959;if(_0x17ed78[_0x2785('0x31')]['includeAll']){_0x4adc16[_0x2785('0x43')]=[{'all':!![]}];}return db['Automation'][_0x2785('0x44')](_0x4adc16);})[_0x2785('0x25')](function(_0x483100){_0x100f45[_0x2785('0x45')]=_0x483100;return _0x100f45;})['then'](respondWithFilteredResult(_0x23da3e,_0x4adc16))[_0x2785('0x46')](handleError(_0x23da3e,null));};exports[_0x2785('0x47')]=function(_0xf39ee7,_0xe6b887){var _0x1ee3a5={'raw':![],'where':{'id':_0xf39ee7[_0x2785('0x48')]['id']}},_0x1bf107={};_0x1bf107[_0x2785('0x35')]=_['keys'](db[_0x2785('0x41')]['rawAttributes']);_0x1bf107['query']=_[_0x2785('0x32')](_0xf39ee7[_0x2785('0x31')]);_0x1bf107[_0x2785('0x33')]=_['intersection'](_0x1bf107['model'],_0x1bf107[_0x2785('0x31')]);_0x1ee3a5[_0x2785('0x36')]=_['intersection'](_0x1bf107[_0x2785('0x35')],qs[_0x2785('0x37')](_0xf39ee7[_0x2785('0x31')][_0x2785('0x37')]));_0x1ee3a5['attributes']=_0x1ee3a5[_0x2785('0x36')][_0x2785('0x49')]?_0x1ee3a5[_0x2785('0x36')]:_0x1bf107[_0x2785('0x35')];if(_0xf39ee7[_0x2785('0x31')]['includeAll']){_0x1ee3a5[_0x2785('0x43')]=[{'all':!![]}];}_0x1ee3a5=_['merge']({},_0x1ee3a5,_0xf39ee7[_0x2785('0x40')]);return db[_0x2785('0x41')][_0x2785('0x4a')](_0x1ee3a5)[_0x2785('0x25')](handleEntityNotFound(_0xe6b887,null))['then'](respondWithResult(_0xe6b887,null))[_0x2785('0x46')](handleError(_0xe6b887,null));};exports[_0x2785('0x4b')]=function(_0x199cac,_0x447900){return db[_0x2785('0x41')][_0x2785('0x4b')](_0x199cac[_0x2785('0x4c')],{})[_0x2785('0x25')](respondWithResult(_0x447900,0xc9))[_0x2785('0x46')](handleError(_0x447900,null));};exports['update']=function(_0x5142ef,_0x8b2cbe){if(_0x5142ef[_0x2785('0x4c')]['id']){delete _0x5142ef[_0x2785('0x4c')]['id'];}return db[_0x2785('0x41')][_0x2785('0x4a')]({'where':{'id':_0x5142ef[_0x2785('0x48')]['id']}})[_0x2785('0x25')](handleEntityNotFound(_0x8b2cbe,null))[_0x2785('0x25')](saveUpdates(_0x5142ef['body'],null))[_0x2785('0x25')](respondWithResult(_0x8b2cbe,null))[_0x2785('0x46')](handleError(_0x8b2cbe,null));};exports[_0x2785('0x26')]=function(_0x2db0e1,_0x1850b1){return db[_0x2785('0x41')]['find']({'where':{'id':_0x2db0e1[_0x2785('0x48')]['id']}})['then'](handleEntityNotFound(_0x1850b1,null))['then'](removeEntity(_0x1850b1,null))[_0x2785('0x46')](handleError(_0x1850b1,null));};exports[_0x2785('0x4d')]=function(_0x1c42bc,_0x287f8c,_0x392df8){return db[_0x2785('0x4e')][_0x2785('0x4a')]({'where':{'id':_0x1c42bc[_0x2785('0x48')]['id']}})['then'](handleEntityNotFound(_0x287f8c,null))[_0x2785('0x25')](function(_0x5b229e){if(_0x5b229e){return _0x5b229e[_0x2785('0x4d')](_0x1c42bc['body'][_0x2785('0x4f')],_[_0x2785('0x50')](_0x1c42bc[_0x2785('0x4c')],[_0x2785('0x4f'),'id'])||{});}})[_0x2785('0x25')](respondWithResult(_0x287f8c,null))[_0x2785('0x46')](handleError(_0x287f8c,null));};exports[_0x2785('0x51')]=function(_0x5d3229,_0x33d476,_0x560bde){var _0x5e0d75={};var _0xea1ed0={};var _0x58fadc;var _0xfd0ce3;return db[_0x2785('0x41')][_0x2785('0x52')]({'where':{'id':_0x5d3229[_0x2785('0x48')]['id']}})[_0x2785('0x25')](handleEntityNotFound(_0x33d476,null))[_0x2785('0x25')](function(_0x592450){if(_0x592450){_0x58fadc=_0x592450;_0xea1ed0[_0x2785('0x35')]=_['keys'](db[_0x2785('0x4e')][_0x2785('0x2d')]);_0xea1ed0[_0x2785('0x31')]=_[_0x2785('0x32')](_0x5d3229['query']);_0xea1ed0[_0x2785('0x33')]=_[_0x2785('0x34')](_0xea1ed0[_0x2785('0x35')],_0xea1ed0[_0x2785('0x31')]);_0x5e0d75[_0x2785('0x36')]=_[_0x2785('0x34')](_0xea1ed0['model'],qs[_0x2785('0x37')](_0x5d3229['query'][_0x2785('0x37')]));_0x5e0d75['attributes']=_0x5e0d75[_0x2785('0x36')][_0x2785('0x49')]?_0x5e0d75[_0x2785('0x36')]:_0xea1ed0[_0x2785('0x35')];_0x5e0d75['order']=qs[_0x2785('0x3b')](_0x5d3229['query'][_0x2785('0x3b')]);_0x5e0d75['where']=qs[_0x2785('0x33')](_[_0x2785('0x3d')](_0x5d3229[_0x2785('0x31')],_0xea1ed0[_0x2785('0x33')]));if(_0x5d3229[_0x2785('0x31')][_0x2785('0x3e')]){_0x5e0d75[_0x2785('0x3c')]=_[_0x2785('0x3f')](_0x5e0d75[_0x2785('0x3c')],{'$or':_['map'](_0x5e0d75['attributes'],function(_0x1b6ff9){var _0x87f69c={};_0x87f69c[_0x1b6ff9]={'$like':'%'+_0x5d3229[_0x2785('0x31')][_0x2785('0x3e')]+'%'};return _0x87f69c;})});}_0x5e0d75=_[_0x2785('0x3f')]({},_0x5e0d75,_0x5d3229['options']);return _0x58fadc[_0x2785('0x51')](_0x5e0d75);}})[_0x2785('0x25')](function(_0x2eb481){if(_0x2eb481){_0xfd0ce3=_0x2eb481[_0x2785('0x49')];if(!_0x5d3229[_0x2785('0x31')][_0x2785('0x38')](_0x2785('0x39'))){_0x5e0d75[_0x2785('0x1e')]=qs[_0x2785('0x1e')](_0x5d3229[_0x2785('0x31')][_0x2785('0x1e')]);_0x5e0d75[_0x2785('0x1c')]=qs['offset'](_0x5d3229[_0x2785('0x31')][_0x2785('0x1c')]);}return _0x58fadc[_0x2785('0x51')](_0x5e0d75);}})[_0x2785('0x25')](function(_0x36295f){if(_0x36295f){return _0x36295f?{'count':_0xfd0ce3,'rows':_0x36295f}:null;}})[_0x2785('0x25')](respondWithResult(_0x33d476,null))['catch'](handleError(_0x33d476,null));};exports[_0x2785('0x53')]=function(_0x200932,_0x2f1bdf,_0x41a93b){return db[_0x2785('0x54')][_0x2785('0x4a')]({'where':{'id':_0x200932[_0x2785('0x48')]['id']}})[_0x2785('0x25')](handleEntityNotFound(_0x2f1bdf,null))[_0x2785('0x25')](function(_0x55bf05){if(_0x55bf05){return _0x55bf05[_0x2785('0x53')](_0x200932[_0x2785('0x4c')][_0x2785('0x4f')],_[_0x2785('0x50')](_0x200932[_0x2785('0x4c')],[_0x2785('0x4f'),'id'])||{});}})[_0x2785('0x25')](respondWithResult(_0x2f1bdf,null))[_0x2785('0x46')](handleError(_0x2f1bdf,null));};exports['getActions']=function(_0x1df0f9,_0x413369,_0x267ab4){var _0x35af52={};var _0x4d55d5={};var _0x3c9f7e;var _0x31e4b9;return db['Automation']['findOne']({'where':{'id':_0x1df0f9['params']['id']}})[_0x2785('0x25')](handleEntityNotFound(_0x413369,null))[_0x2785('0x25')](function(_0x51827c){if(_0x51827c){_0x3c9f7e=_0x51827c;_0x4d55d5[_0x2785('0x35')]=_[_0x2785('0x32')](db['Action']['rawAttributes']);_0x4d55d5[_0x2785('0x31')]=_[_0x2785('0x32')](_0x1df0f9[_0x2785('0x31')]);_0x4d55d5[_0x2785('0x33')]=_['intersection'](_0x4d55d5[_0x2785('0x35')],_0x4d55d5[_0x2785('0x31')]);_0x35af52['attributes']=_[_0x2785('0x34')](_0x4d55d5[_0x2785('0x35')],qs[_0x2785('0x37')](_0x1df0f9[_0x2785('0x31')][_0x2785('0x37')]));_0x35af52[_0x2785('0x36')]=_0x35af52[_0x2785('0x36')]['length']?_0x35af52['attributes']:_0x4d55d5[_0x2785('0x35')];_0x35af52[_0x2785('0x3a')]=qs[_0x2785('0x3b')](_0x1df0f9['query'][_0x2785('0x3b')]);_0x35af52['where']=qs[_0x2785('0x33')](_[_0x2785('0x3d')](_0x1df0f9[_0x2785('0x31')],_0x4d55d5[_0x2785('0x33')]));if(_0x1df0f9[_0x2785('0x31')][_0x2785('0x3e')]){_0x35af52[_0x2785('0x3c')]=_[_0x2785('0x3f')](_0x35af52[_0x2785('0x3c')],{'$or':_[_0x2785('0x2c')](_0x35af52['attributes'],function(_0x5cb470){var _0x25dc33={};_0x25dc33[_0x5cb470]={'$like':'%'+_0x1df0f9[_0x2785('0x31')][_0x2785('0x3e')]+'%'};return _0x25dc33;})});}_0x35af52=_[_0x2785('0x3f')]({},_0x35af52,_0x1df0f9[_0x2785('0x40')]);return _0x3c9f7e[_0x2785('0x55')](_0x35af52);}})['then'](function(_0x1df078){if(_0x1df078){_0x31e4b9=_0x1df078[_0x2785('0x49')];if(!_0x1df0f9[_0x2785('0x31')][_0x2785('0x38')](_0x2785('0x39'))){_0x35af52['limit']=qs[_0x2785('0x1e')](_0x1df0f9[_0x2785('0x31')][_0x2785('0x1e')]);_0x35af52['offset']=qs[_0x2785('0x1c')](_0x1df0f9[_0x2785('0x31')][_0x2785('0x1c')]);}return _0x3c9f7e[_0x2785('0x55')](_0x35af52);}})[_0x2785('0x25')](function(_0x405a28){if(_0x405a28){return _0x405a28?{'count':_0x31e4b9,'rows':_0x405a28}:null;}})['then'](respondWithResult(_0x413369,null))['catch'](handleError(_0x413369,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b933804..a82e4ba 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 _0x6335=['./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x49fae9,_0x48058e){var _0x231b71=function(_0x3b891e){while(--_0x3b891e){_0x49fae9['push'](_0x49fae9['shift']());}};_0x231b71(++_0x48058e);}(_0x6335,0x1cc));var _0x5633=function(_0x338aca,_0x52c9ac){_0x338aca=_0x338aca-0x0;var _0x172eb8=_0x6335[_0x338aca];return _0x172eb8;};'use strict';var _=require(_0x5633('0x0'));var util=require(_0x5633('0x1'));var logger=require(_0x5633('0x2'))(_0x5633('0x3'));var moment=require(_0x5633('0x4'));var BPromise=require('bluebird');var rp=require(_0x5633('0x5'));var fs=require('fs');var path=require(_0x5633('0x6'));var rimraf=require(_0x5633('0x7'));var config=require('../../config/environment');var attributes=require(_0x5633('0x8'));module[_0x5633('0x9')]=function(_0x517e45,_0x369d5d){return _0x517e45[_0x5633('0xa')](_0x5633('0xb'),attributes,{'tableName':_0x5633('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd221=['path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd221,0xd7));var _0x1d22=function(_0x14d187,_0x4a92dd){_0x14d187=_0x14d187-0x0;var _0x4eb39f=_0xd221[_0x14d187];return _0x4eb39f;};'use strict';var _=require(_0x1d22('0x0'));var util=require('util');var logger=require(_0x1d22('0x1'))(_0x1d22('0x2'));var moment=require(_0x1d22('0x3'));var BPromise=require(_0x1d22('0x4'));var rp=require(_0x1d22('0x5'));var fs=require('fs');var path=require(_0x1d22('0x6'));var rimraf=require(_0x1d22('0x7'));var config=require(_0x1d22('0x8'));var attributes=require(_0x1d22('0x9'));module[_0x1d22('0xa')]=function(_0x277ea0,_0x2740ee){return _0x277ea0[_0x1d22('0xb')](_0x1d22('0xc'),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 9888439..7cdb21a 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 _0xa064=['stringify','error','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x36f304,_0x4025ea){var _0x4dd9f3=function(_0x13c480){while(--_0x13c480){_0x36f304['push'](_0x36f304['shift']());}};_0x4dd9f3(++_0x4025ea);}(_0xa064,0x192));var _0x4a06=function(_0x295fe9,_0x345828){_0x295fe9=_0x295fe9-0x0;var _0x3b80df=_0xa064[_0x295fe9];return _0x3b80df;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d4e3,_0x3b01cc,_0x454574){return new BPromise(function(_0x4c966b,_0x5e3342){return client[_0x4a06('0xa')](_0x55d4e3,_0x454574)[_0x4a06('0xb')](function(_0x3a8db5){logger[_0x4a06('0xc')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));logger[_0x4a06('0xe')](_0x4a06('0xf'),_0x3b01cc,_0x4a06('0xd'),JSON[_0x4a06('0x10')](_0x3a8db5));if(_0x3a8db5[_0x4a06('0x11')]){if(_0x3a8db5[_0x4a06('0x11')]['code']===0x1f4){logger[_0x4a06('0x11')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);return _0x5e3342(_0x3a8db5[_0x4a06('0x11')]['message']);}logger[_0x4a06('0x11')](_0x4a06('0x13'),_0x3b01cc,_0x3a8db5[_0x4a06('0x11')]['message']);return _0x4c966b(_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);}else{logger[_0x4a06('0xc')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));_0x4c966b(_0x3a8db5[_0x4a06('0x14')][_0x4a06('0x12')]);}})[_0x4a06('0x15')](function(_0x15b067){logger['error'](_0x4a06('0x13'),_0x3b01cc,_0x15b067);_0x5e3342(_0x15b067);});});} \ No newline at end of file +var _0x3423=['rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 01970ca..71b01a1 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 _0x5cea=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','destroy'];(function(_0x240362,_0x156794){var _0x26de18=function(_0x4a4431){while(--_0x4a4431){_0x240362['push'](_0x240362['shift']());}};_0x26de18(++_0x156794);}(_0x5cea,0x151));var _0xa5ce=function(_0x53a7ad,_0x16d1a4){_0x53a7ad=_0x53a7ad-0x0;var _0x364325=_0x5cea[_0x53a7ad];return _0x364325;};'use strict';var multer=require('multer');var util=require(_0xa5ce('0x0'));var path=require(_0xa5ce('0x1'));var timeout=require(_0xa5ce('0x2'));var express=require(_0xa5ce('0x3'));var router=express[_0xa5ce('0x4')]();var fs_extra=require(_0xa5ce('0x5'));var auth=require(_0xa5ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa5ce('0x7'));var controller=require(_0xa5ce('0x8'));router[_0xa5ce('0x9')]('/',auth[_0xa5ce('0xa')](),controller[_0xa5ce('0xb')]);router[_0xa5ce('0x9')](_0xa5ce('0xc'),auth[_0xa5ce('0xa')](),controller[_0xa5ce('0xd')]);router[_0xa5ce('0x9')](_0xa5ce('0xe'),auth[_0xa5ce('0xa')](),controller[_0xa5ce('0xf')]);router[_0xa5ce('0x9')](_0xa5ce('0x10'),auth['isAuthenticated'](),controller[_0xa5ce('0x11')]);router[_0xa5ce('0x12')]('/',auth[_0xa5ce('0xa')](),controller['create']);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xa5ce('0x13')]);router['post'](_0xa5ce('0x10'),auth['isAuthenticated'](),controller[_0xa5ce('0x14')]);router[_0xa5ce('0x15')](_0xa5ce('0xc'),auth[_0xa5ce('0xa')](),controller['update']);router['delete'](_0xa5ce('0xc'),auth[_0xa5ce('0xa')](),controller[_0xa5ce('0x16')]);module[_0xa5ce('0x17')]=router; \ No newline at end of file +var _0xe3ee=['fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','path','connect-timeout'];(function(_0x12926a,_0xb3be90){var _0x2db765=function(_0x32e279){while(--_0x32e279){_0x12926a['push'](_0x12926a['shift']());}};_0x2db765(++_0xb3be90);}(_0xe3ee,0x116));var _0xee3e=function(_0x5a5bdf,_0x575008){_0x5a5bdf=_0x5a5bdf-0x0;var _0x5286e1=_0xe3ee[_0x5a5bdf];return _0x5286e1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee3e('0x0'));var timeout=require(_0xee3e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xee3e('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee3e('0x3'));var controller=require('./automation.controller');router[_0xee3e('0x4')]('/',auth[_0xee3e('0x5')](),controller[_0xee3e('0x6')]);router[_0xee3e('0x4')](_0xee3e('0x7'),auth[_0xee3e('0x5')](),controller[_0xee3e('0x8')]);router[_0xee3e('0x4')]('/:id/conditions',auth[_0xee3e('0x5')](),controller[_0xee3e('0x9')]);router['get'](_0xee3e('0xa'),auth[_0xee3e('0x5')](),controller['getActions']);router[_0xee3e('0xb')]('/',auth[_0xee3e('0x5')](),controller[_0xee3e('0xc')]);router[_0xee3e('0xb')](_0xee3e('0xd'),auth[_0xee3e('0x5')](),controller[_0xee3e('0xe')]);router[_0xee3e('0xb')]('/:id/actions',auth['isAuthenticated'](),controller[_0xee3e('0xf')]);router[_0xee3e('0x10')]('/:id',auth[_0xee3e('0x5')](),controller[_0xee3e('0x11')]);router[_0xee3e('0x12')]('/:id',auth[_0xee3e('0x5')](),controller[_0xee3e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 8ad2cd3..e88d0ad 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 _0x87cd=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x56d2be,_0x417f9e){var _0x467209=function(_0x101622){while(--_0x101622){_0x56d2be['push'](_0x56d2be['shift']());}};_0x467209(++_0x417f9e);}(_0x87cd,0xe6));var _0xd87c=function(_0x12049f,_0x25f34f){_0x12049f=_0x12049f-0x0;var _0x23667e=_0x87cd[_0x12049f];return _0x23667e;};'use strict';var Sequelize=require(_0xd87c('0x0'));module[_0xd87c('0x1')]={'name':{'type':Sequelize[_0xd87c('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd87c('0x3')](_0xd87c('0x4')),'allowNull':![],'defaultValue':_0xd87c('0x4')},'description':{'type':Sequelize[_0xd87c('0x2')]},'active':{'type':Sequelize[_0xd87c('0x5')],'defaultValue':0x0,'comment':_0xd87c('0x6')},'limitCalls':{'type':Sequelize[_0xd87c('0x7')](0x4)[_0xd87c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd87c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd87c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd87c('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'comment':_0xd87c('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd87c('0x2')],'defaultValue':_0xd87c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xd87c('0x3')](_0xd87c('0x11'),_0xd87c('0x12'),_0xd87c('0x13')),'defaultValue':_0xd87c('0x11')},'dialAMDActive':{'type':Sequelize[_0xd87c('0x5')],'defaultValue':0x0,'comment':_0xd87c('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd87c('0x7')](0x9)[_0xd87c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd87c('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd87c('0x7')](0x9)[_0xd87c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd87c('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd87c('0x7')](0x9)[_0xd87c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd87c('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xd87c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd87c('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd87c('0x7')](0x9)[_0xd87c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd87c('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd87c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd87c('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd87c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd87c('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd87c('0x3')]('DESC',_0xd87c('0x1c')),'defaultValue':_0xd87c('0x1d')},'dialPrefix':{'type':Sequelize[_0xd87c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd87c('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xf915=['STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','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)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.'];(function(_0x4be5be,_0xf5ea52){var _0x5525d8=function(_0x5c6e32){while(--_0x5c6e32){_0x4be5be['push'](_0x4be5be['shift']());}};_0x5525d8(++_0xf5ea52);}(_0xf915,0x6e));var _0x5f91=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf915[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x5f91('0x0'));module[_0x5f91('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5f91('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5f91('0x3')](_0x5f91('0x4')),'allowNull':![],'defaultValue':_0x5f91('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5f91('0x5')],'defaultValue':0x0,'comment':_0x5f91('0x6')},'limitCalls':{'type':Sequelize[_0x5f91('0x7')](0x4)[_0x5f91('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5f91('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5f91('0xa')]},'dialOriginateTimeout':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'comment':_0x5f91('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x11')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5f91('0x12')},'dialTimezone':{'type':Sequelize[_0x5f91('0xa')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5f91('0x13')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x5f91('0x14'),_0x5f91('0x15')),'defaultValue':_0x5f91('0x16')},'dialAMDActive':{'type':Sequelize[_0x5f91('0x5')],'defaultValue':0x0,'comment':_0x5f91('0x17')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5f91('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5f91('0x18')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5f91('0x19')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5f91('0x7')](0x9)[_0x5f91('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5f91('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5f91('0x1a')},'dialAMDMinWordLength':{'type':Sequelize[_0x5f91('0x7')](0x9)[_0x5f91('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5f91('0x7')](0x9)[_0x5f91('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5f91('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5f91('0x7')](0x9)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5f91('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5f91('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5f91('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x5f91('0x3')](_0x5f91('0x1e'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x5f91('0xa')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x5f91('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5f91('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 307380a..00de116 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 _0x7410=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','end','status','undefined','limit','offset','set','Content-Range','json','apply','reject','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','clone','omit','createdAt','body','UserProfileSection','autoAssociation','update','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','ContactId','select','field','phone','NOW()','scheduledAt','CmListId','toString','ListId','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7410,0x8a));var _0x0741=function(_0x275369,_0x30c7f2){_0x275369=_0x275369-0x0;var _0x41df41=_0x7410[_0x275369];return _0x41df41;};'use strict';var emlformat=require(_0x0741('0x0'));var rimraf=require(_0x0741('0x1'));var zipdir=require(_0x0741('0x2'));var jsonpatch=require(_0x0741('0x3'));var rp=require(_0x0741('0x4'));var moment=require(_0x0741('0x5'));var BPromise=require(_0x0741('0x6'));var Mustache=require(_0x0741('0x7'));var util=require(_0x0741('0x8'));var path=require(_0x0741('0x9'));var sox=require(_0x0741('0xa'));var csv=require(_0x0741('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0741('0xc'));var _=require(_0x0741('0xd'));var squel=require(_0x0741('0xe'));var crypto=require(_0x0741('0xf'));var jsforce=require(_0x0741('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0741('0x11'));var Papa=require(_0x0741('0x12'));var Redis=require(_0x0741('0x13'));var authService=require(_0x0741('0x14'));var qs=require(_0x0741('0x15'));var as=require(_0x0741('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0741('0x17'));var utils=require('../../config/utils');var config=require(_0x0741('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0741('0x19'))['db'];function respondWithStatusCode(_0x19fa4a,_0x4e27e3){_0x4e27e3=_0x4e27e3||0xcc;return function(_0x119156){if(_0x119156){return _0x19fa4a['sendStatus'](_0x4e27e3);}return _0x19fa4a['status'](_0x4e27e3)[_0x0741('0x1a')]();};}function respondWithResult(_0x340d6f,_0x262fcb){_0x262fcb=_0x262fcb||0xc8;return function(_0x3a04fc){if(_0x3a04fc){return _0x340d6f[_0x0741('0x1b')](_0x262fcb)['json'](_0x3a04fc);}};}function respondWithFilteredResult(_0x102b6b,_0x48f76c){return function(_0x35af2f){if(_0x35af2f){var _0x23a261=typeof _0x48f76c['offset']===_0x0741('0x1c')&&typeof _0x48f76c[_0x0741('0x1d')]===_0x0741('0x1c');var _0xf1253e=_0x35af2f['count'];var _0x2d9880=_0x23a261?0x0:_0x48f76c['offset'];var _0x568ef4=_0x23a261?_0x35af2f['count']:_0x48f76c[_0x0741('0x1e')]+_0x48f76c[_0x0741('0x1d')];var _0x48c6ab;if(_0x568ef4>=_0xf1253e){_0x568ef4=_0xf1253e;_0x48c6ab=0xc8;}else{_0x48c6ab=0xce;}_0x102b6b[_0x0741('0x1b')](_0x48c6ab);return _0x102b6b[_0x0741('0x1f')](_0x0741('0x20'),_0x2d9880+'-'+_0x568ef4+'/'+_0xf1253e)[_0x0741('0x21')](_0x35af2f);}return null;};}function patchUpdates(_0x19ec3d){return function(_0xe80312){try{jsonpatch[_0x0741('0x22')](_0xe80312,_0x19ec3d,!![]);}catch(_0x2bc1b6){return BPromise[_0x0741('0x23')](_0x2bc1b6);}return _0xe80312['save']();};}function saveUpdates(_0x2d676e,_0x3f1e1c){return function(_0x5d20c6){if(_0x5d20c6){return _0x5d20c6['update'](_0x2d676e)[_0x0741('0x24')](function(_0x47dc9a){return _0x47dc9a;});}return null;};}function removeEntity(_0x2d999b,_0x7cfccd){return function(_0x3acd2e){if(_0x3acd2e){return _0x3acd2e[_0x0741('0x25')]()[_0x0741('0x24')](function(){var _0x9b8a2e=_0x3acd2e[_0x0741('0x26')]({'plain':!![]});var _0x57126c=_0x0741('0x27');return db[_0x0741('0x28')][_0x0741('0x25')]({'where':{'type':_0x57126c,'resourceId':_0x9b8a2e['id']}})['then'](function(){return _0x3acd2e;});})[_0x0741('0x24')](function(){_0x2d999b[_0x0741('0x1b')](0xcc)[_0x0741('0x1a')]();});}};}function handleEntityNotFound(_0x1b954a,_0xd43f1a){return function(_0x24cce6){if(!_0x24cce6){_0x1b954a[_0x0741('0x29')](0x194);}return _0x24cce6;};}function handleError(_0x22bfcc,_0x5b1989){_0x5b1989=_0x5b1989||0x1f4;return function(_0x36c010){logger[_0x0741('0x2a')](_0x36c010[_0x0741('0x2b')]);if(_0x36c010[_0x0741('0x2c')]){delete _0x36c010[_0x0741('0x2c')];}_0x22bfcc[_0x0741('0x1b')](_0x5b1989)[_0x0741('0x2d')](_0x36c010);};}exports[_0x0741('0x2e')]=function(_0x235d1c,_0xf4adf9){var _0x27fa1a={},_0x4a8dd0={},_0x4a24f5={'count':0x0,'rows':[]};var _0x34b3f9=_[_0x0741('0x2f')](db[_0x0741('0x30')][_0x0741('0x31')],function(_0x222bc5){return{'name':_0x222bc5[_0x0741('0x32')],'type':_0x222bc5['type'][_0x0741('0x33')]};});_0x4a8dd0[_0x0741('0x34')]=_[_0x0741('0x2f')](_0x34b3f9,_0x0741('0x2c'));_0x4a8dd0[_0x0741('0x35')]=_['keys'](_0x235d1c[_0x0741('0x35')]);_0x4a8dd0[_0x0741('0x36')]=_[_0x0741('0x37')](_0x4a8dd0[_0x0741('0x34')],_0x4a8dd0[_0x0741('0x35')]);_0x27fa1a['attributes']=_[_0x0741('0x37')](_0x4a8dd0[_0x0741('0x34')],qs['fields'](_0x235d1c[_0x0741('0x35')][_0x0741('0x38')]));_0x27fa1a['attributes']=_0x27fa1a['attributes'][_0x0741('0x39')]?_0x27fa1a[_0x0741('0x3a')]:_0x4a8dd0[_0x0741('0x34')];if(!_0x235d1c[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x27fa1a[_0x0741('0x1d')]=qs['limit'](_0x235d1c[_0x0741('0x35')]['limit']);_0x27fa1a['offset']=qs[_0x0741('0x1e')](_0x235d1c[_0x0741('0x35')]['offset']);}_0x27fa1a[_0x0741('0x3d')]=qs['sort'](_0x235d1c[_0x0741('0x35')][_0x0741('0x3e')]);_0x27fa1a[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0x235d1c[_0x0741('0x35')],_0x4a8dd0[_0x0741('0x36')]),_0x34b3f9);if(_0x235d1c['query'][_0x0741('0x41')]){_0x27fa1a[_0x0741('0x3f')]=_[_0x0741('0x42')](_0x27fa1a[_0x0741('0x3f')],{'$or':_[_0x0741('0x2f')](_0x34b3f9,function(_0x739dd8){if(_0x739dd8[_0x0741('0x43')]!=='VIRTUAL'){var _0x1f234e={};_0x1f234e[_0x739dd8[_0x0741('0x2c')]]={'$like':'%'+_0x235d1c['query'][_0x0741('0x41')]+'%'};return _0x1f234e;}})});}_0x27fa1a=_[_0x0741('0x42')]({},_0x27fa1a,_0x235d1c[_0x0741('0x44')]);var _0x5cf7b7={'where':_0x27fa1a[_0x0741('0x3f')]};return db['Campaign'][_0x0741('0x45')](_0x5cf7b7)['then'](function(_0x292621){_0x4a24f5[_0x0741('0x45')]=_0x292621;if(_0x235d1c[_0x0741('0x35')][_0x0741('0x46')]){_0x27fa1a[_0x0741('0x47')]=[{'all':!![]}];}return db[_0x0741('0x30')][_0x0741('0x48')](_0x27fa1a);})['then'](function(_0x103ca8){_0x4a24f5[_0x0741('0x49')]=_0x103ca8;return _0x4a24f5;})[_0x0741('0x24')](respondWithFilteredResult(_0xf4adf9,_0x27fa1a))[_0x0741('0x4a')](handleError(_0xf4adf9,null));};exports[_0x0741('0x4b')]=function(_0x543b6e,_0x239bcc){var _0x4f66e6={'raw':![],'where':{'id':_0x543b6e[_0x0741('0x4c')]['id']}},_0x2400b1={};_0x2400b1[_0x0741('0x34')]=_[_0x0741('0x4d')](db[_0x0741('0x30')][_0x0741('0x31')]);_0x2400b1[_0x0741('0x35')]=_[_0x0741('0x4d')](_0x543b6e[_0x0741('0x35')]);_0x2400b1[_0x0741('0x36')]=_[_0x0741('0x37')](_0x2400b1['model'],_0x2400b1[_0x0741('0x35')]);_0x4f66e6[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x2400b1[_0x0741('0x34')],qs[_0x0741('0x38')](_0x543b6e['query'][_0x0741('0x38')]));_0x4f66e6[_0x0741('0x3a')]=_0x4f66e6['attributes'][_0x0741('0x39')]?_0x4f66e6[_0x0741('0x3a')]:_0x2400b1['model'];if(_0x543b6e[_0x0741('0x35')][_0x0741('0x46')]){_0x4f66e6['include']=[{'all':!![]}];}_0x4f66e6=_[_0x0741('0x42')]({},_0x4f66e6,_0x543b6e['options']);return db[_0x0741('0x30')][_0x0741('0x4e')](_0x4f66e6)[_0x0741('0x24')](handleEntityNotFound(_0x239bcc,null))[_0x0741('0x24')](respondWithResult(_0x239bcc,null))[_0x0741('0x4a')](handleError(_0x239bcc,null));};exports[_0x0741('0x4f')]=function(_0xe7b4c8,_0x400f4f){return db['Campaign'][_0x0741('0x4f')](_0xe7b4c8['body'],{})[_0x0741('0x24')](function(_0x3f2aab){var _0x42938b=_0xe7b4c8[_0x0741('0x50')][_0x0741('0x26')]({'plain':!![]});if(!_0x42938b)throw new Error(_0x0741('0x51'));if(_0x42938b[_0x0741('0x52')]===_0x0741('0x50')){var _0x2700bf=_0x3f2aab['get']({'plain':!![]});var _0x138d39='IvrCampaigns';return db['UserProfileSection'][_0x0741('0x4e')]({'where':{'name':_0x138d39,'userProfileId':_0x42938b[_0x0741('0x53')]},'raw':!![]})[_0x0741('0x24')](function(_0x417690){if(_0x417690&&_0x417690['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2700bf[_0x0741('0x2c')],'resourceId':_0x2700bf['id'],'type':_0x417690[_0x0741('0x2c')],'sectionId':_0x417690['id']},{})['then'](function(){return _0x3f2aab;});}else{return _0x3f2aab;}})[_0x0741('0x4a')](function(_0x1009e8){logger[_0x0741('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1009e8);throw _0x1009e8;});}return _0x3f2aab;})[_0x0741('0x24')](respondWithResult(_0x400f4f,0xc9))[_0x0741('0x4a')](handleError(_0x400f4f,null));};exports[_0x0741('0x54')]=function(_0x2636e8,_0xa3c24a){var _0x11a77a={'where':{'id':_0x2636e8[_0x0741('0x4c')]['id']}},_0x1c87a7={};_0x1c87a7[_0x0741('0x34')]=_[_0x0741('0x4d')](db[_0x0741('0x30')]['rawAttributes']);_0x11a77a[_0x0741('0x3a')]=_['intersection'](_0x1c87a7['model'],qs['fields'](_0x2636e8[_0x0741('0x35')][_0x0741('0x38')]));_0x11a77a[_0x0741('0x3a')]=_0x11a77a[_0x0741('0x3a')][_0x0741('0x39')]?_0x11a77a[_0x0741('0x3a')]:_0x1c87a7[_0x0741('0x34')];if(_0x2636e8[_0x0741('0x35')][_0x0741('0x46')]){_0x11a77a[_0x0741('0x47')]=[{'all':!![]}];}_0x11a77a=_[_0x0741('0x42')]({},_0x11a77a,_0x2636e8[_0x0741('0x44')]);return db[_0x0741('0x30')][_0x0741('0x4e')](_0x11a77a)[_0x0741('0x24')](handleEntityNotFound(_0xa3c24a,null))[_0x0741('0x24')](function(_0x12f4d7){if(_0x12f4d7){var _0x265d19=_0x12f4d7[_0x0741('0x26')]({'plain':!![]});_0x265d19=qs[_0x0741('0x55')](_0x265d19,['id',_0x0741('0x56'),'updatedAt']);_0x2636e8[_0x0741('0x57')]=_[_0x0741('0x55')](_0x2636e8[_0x0741('0x57')],['id',_0x0741('0x56'),'updatedAt']);return db[_0x0741('0x30')][_0x0741('0x4f')](_[_0x0741('0x42')](_0x265d19,_0x2636e8[_0x0741('0x57')]),{'include':_0x2636e8[_0x0741('0x35')][_0x0741('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x22f274){var _0x469c52=_0x2636e8[_0x0741('0x50')][_0x0741('0x26')]({'plain':!![]});if(!_0x469c52)throw new Error(_0x0741('0x51'));if(_0x469c52[_0x0741('0x52')]==='user'){var _0x216750=_0x22f274[_0x0741('0x26')]({'plain':!![]});var _0x4c345c='IvrCampaigns';return db[_0x0741('0x58')][_0x0741('0x4e')]({'where':{'name':_0x4c345c,'userProfileId':_0x469c52[_0x0741('0x53')]},'raw':!![]})[_0x0741('0x24')](function(_0x163d10){if(_0x163d10&&_0x163d10[_0x0741('0x59')]===0x0){return db[_0x0741('0x28')][_0x0741('0x4f')]({'name':_0x216750[_0x0741('0x2c')],'resourceId':_0x216750['id'],'type':_0x163d10[_0x0741('0x2c')],'sectionId':_0x163d10['id']},{})[_0x0741('0x24')](function(){return _0x22f274;});}else{return _0x22f274;}})[_0x0741('0x4a')](function(_0xda2659){logger[_0x0741('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xda2659);throw _0xda2659;});}return _0x22f274;});}})[_0x0741('0x24')](respondWithResult(_0xa3c24a,0xc9))[_0x0741('0x4a')](handleError(_0xa3c24a,null));};exports[_0x0741('0x5a')]=function(_0xf13ae8,_0x26d257){if(_0xf13ae8[_0x0741('0x57')]['id']){delete _0xf13ae8[_0x0741('0x57')]['id'];}return db[_0x0741('0x30')][_0x0741('0x4e')]({'where':{'id':_0xf13ae8[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x26d257,null))['then'](saveUpdates(_0xf13ae8['body'],null))[_0x0741('0x24')](respondWithResult(_0x26d257,null))[_0x0741('0x4a')](handleError(_0x26d257,null));};exports[_0x0741('0x25')]=function(_0x48ad88,_0x250b68){return db[_0x0741('0x30')]['find']({'where':{'id':_0x48ad88['params']['id']}})['then'](handleEntityNotFound(_0x250b68,null))[_0x0741('0x24')](removeEntity(_0x250b68,null))[_0x0741('0x4a')](handleError(_0x250b68,null));};exports['getHoppers']=function(_0x334444,_0x4f347c,_0x4edc2b){var _0x806a12={'raw':!![],'where':{}};var _0x52f6e1={};var _0x57f6a6={'count':0x0,'rows':[]};return db[_0x0741('0x30')][_0x0741('0x5b')]({'where':{'id':_0x334444[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x4f347c,null))[_0x0741('0x24')](function(_0x1ad6bb){if(_0x1ad6bb){_0x52f6e1[_0x0741('0x34')]=_[_0x0741('0x4d')](db[_0x0741('0x5c')][_0x0741('0x31')]);_0x52f6e1[_0x0741('0x35')]=_[_0x0741('0x4d')](_0x334444['query']);_0x52f6e1[_0x0741('0x36')]=_['intersection'](_0x52f6e1[_0x0741('0x34')],_0x52f6e1[_0x0741('0x35')]);_0x806a12[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x52f6e1['model'],qs['fields'](_0x334444[_0x0741('0x35')][_0x0741('0x38')]));_0x806a12[_0x0741('0x3a')]=_0x806a12[_0x0741('0x3a')][_0x0741('0x39')]?_0x806a12['attributes']:_0x52f6e1[_0x0741('0x34')];if(!_0x334444[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x806a12['limit']=qs['limit'](_0x334444[_0x0741('0x35')][_0x0741('0x1d')]);_0x806a12[_0x0741('0x1e')]=qs['offset'](_0x334444[_0x0741('0x35')]['offset']);}_0x806a12[_0x0741('0x3d')]=qs[_0x0741('0x3e')](_0x334444[_0x0741('0x35')][_0x0741('0x3e')]);_0x806a12[_0x0741('0x3f')]=qs[_0x0741('0x36')](_['pick'](_0x334444[_0x0741('0x35')],_0x52f6e1[_0x0741('0x36')]));_0x806a12['where'][_0x0741('0x5d')]=_0x1ad6bb['id'];if(_0x334444[_0x0741('0x35')][_0x0741('0x41')]){_0x806a12[_0x0741('0x3f')]=_['merge'](_0x806a12[_0x0741('0x3f')],{'$or':_[_0x0741('0x2f')](_0x806a12[_0x0741('0x3a')],function(_0x5aa3be){var _0x3cebc6={};_0x3cebc6[_0x5aa3be]={'$like':'%'+_0x334444['query'][_0x0741('0x41')]+'%'};return _0x3cebc6;})});}_0x806a12=_[_0x0741('0x42')]({},_0x806a12,_0x334444[_0x0741('0x44')]);return db[_0x0741('0x5c')]['count']({'where':_0x806a12[_0x0741('0x3f')]})[_0x0741('0x24')](function(_0x3b0205){_0x57f6a6[_0x0741('0x45')]=_0x3b0205;if(_0x334444['query']['includeAll']){_0x806a12[_0x0741('0x47')]=[{'all':!![]}];}return db[_0x0741('0x5c')][_0x0741('0x48')](_0x806a12);})[_0x0741('0x24')](function(_0x93283e){_0x57f6a6[_0x0741('0x49')]=_0x93283e;return _0x57f6a6;});}})[_0x0741('0x24')](respondWithFilteredResult(_0x4f347c,_0x806a12))[_0x0741('0x4a')](handleError(_0x4f347c,null));};exports[_0x0741('0x5e')]=function(_0xb590d4,_0x4a9af1,_0x5f42f3){var _0x3c47aa={'raw':!![],'where':{}};var _0x54b4c9={};var _0x186075={'count':0x0,'rows':[]};return db[_0x0741('0x30')]['findOne']({'where':{'id':_0xb590d4['params']['id']}})['then'](handleEntityNotFound(_0x4a9af1,null))[_0x0741('0x24')](function(_0x45a75b){if(_0x45a75b){_0x54b4c9[_0x0741('0x34')]=_[_0x0741('0x4d')](db['CmHopperHistory'][_0x0741('0x31')]);_0x54b4c9[_0x0741('0x35')]=_[_0x0741('0x4d')](_0xb590d4[_0x0741('0x35')]);_0x54b4c9[_0x0741('0x36')]=_[_0x0741('0x37')](_0x54b4c9[_0x0741('0x34')],_0x54b4c9[_0x0741('0x35')]);_0x3c47aa[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x54b4c9[_0x0741('0x34')],qs[_0x0741('0x38')](_0xb590d4[_0x0741('0x35')]['fields']));_0x3c47aa[_0x0741('0x3a')]=_0x3c47aa[_0x0741('0x3a')][_0x0741('0x39')]?_0x3c47aa['attributes']:_0x54b4c9[_0x0741('0x34')];if(!_0xb590d4['query']['hasOwnProperty']('nolimit')){_0x3c47aa['limit']=qs[_0x0741('0x1d')](_0xb590d4[_0x0741('0x35')]['limit']);_0x3c47aa[_0x0741('0x1e')]=qs[_0x0741('0x1e')](_0xb590d4[_0x0741('0x35')][_0x0741('0x1e')]);}_0x3c47aa['order']=qs[_0x0741('0x3e')](_0xb590d4['query']['sort']);_0x3c47aa[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0xb590d4[_0x0741('0x35')],_0x54b4c9[_0x0741('0x36')]));_0x3c47aa[_0x0741('0x3f')]['CampaignId']=_0x45a75b['id'];if(_0xb590d4[_0x0741('0x35')]['filter']){_0x3c47aa['where']=_[_0x0741('0x42')](_0x3c47aa['where'],{'$or':_[_0x0741('0x2f')](_0x3c47aa[_0x0741('0x3a')],function(_0x3de5c5){var _0xe15a5={};_0xe15a5[_0x3de5c5]={'$like':'%'+_0xb590d4[_0x0741('0x35')][_0x0741('0x41')]+'%'};return _0xe15a5;})});}_0x3c47aa=_['merge']({},_0x3c47aa,_0xb590d4['options']);return db[_0x0741('0x5f')]['count']({'where':_0x3c47aa[_0x0741('0x3f')]})[_0x0741('0x24')](function(_0x4cfacd){_0x186075['count']=_0x4cfacd;if(_0xb590d4[_0x0741('0x35')]['includeAll']){_0x3c47aa[_0x0741('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0741('0x48')](_0x3c47aa);})['then'](function(_0x4314e0){_0x186075['rows']=_0x4314e0;return _0x186075;});}})['then'](respondWithFilteredResult(_0x4a9af1,_0x3c47aa))[_0x0741('0x4a')](handleError(_0x4a9af1,null));};exports[_0x0741('0x60')]=function(_0x3ef1f1,_0x1e256c,_0x58d6a2){var _0x589dee={'raw':!![],'where':{}};var _0x548a30={};var _0x51ab33={'count':0x0,'rows':[]};return db[_0x0741('0x30')]['findOne']({'where':{'id':_0x3ef1f1[_0x0741('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e256c,null))[_0x0741('0x24')](function(_0x4574ec){if(_0x4574ec){_0x548a30['model']=_[_0x0741('0x4d')](db[_0x0741('0x61')]['rawAttributes']);_0x548a30[_0x0741('0x35')]=_[_0x0741('0x4d')](_0x3ef1f1[_0x0741('0x35')]);_0x548a30[_0x0741('0x36')]=_['intersection'](_0x548a30[_0x0741('0x34')],_0x548a30[_0x0741('0x35')]);_0x589dee[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x548a30['model'],qs[_0x0741('0x38')](_0x3ef1f1[_0x0741('0x35')]['fields']));_0x589dee[_0x0741('0x3a')]=_0x589dee['attributes'][_0x0741('0x39')]?_0x589dee[_0x0741('0x3a')]:_0x548a30['model'];if(!_0x3ef1f1[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x589dee[_0x0741('0x1d')]=qs[_0x0741('0x1d')](_0x3ef1f1[_0x0741('0x35')]['limit']);_0x589dee['offset']=qs['offset'](_0x3ef1f1['query'][_0x0741('0x1e')]);}_0x589dee[_0x0741('0x3d')]=qs['sort'](_0x3ef1f1[_0x0741('0x35')][_0x0741('0x3e')]);_0x589dee[_0x0741('0x3f')]=qs[_0x0741('0x36')](_['pick'](_0x3ef1f1[_0x0741('0x35')],_0x548a30[_0x0741('0x36')]));_0x589dee['where'][_0x0741('0x5d')]=_0x4574ec['id'];if(_0x3ef1f1[_0x0741('0x35')][_0x0741('0x41')]){_0x589dee['where']=_[_0x0741('0x42')](_0x589dee['where'],{'$or':_[_0x0741('0x2f')](_0x589dee[_0x0741('0x3a')],function(_0x585d11){var _0x24d87e={};_0x24d87e[_0x585d11]={'$like':'%'+_0x3ef1f1[_0x0741('0x35')]['filter']+'%'};return _0x24d87e;})});}_0x589dee=_['merge']({},_0x589dee,_0x3ef1f1[_0x0741('0x44')]);return db[_0x0741('0x61')][_0x0741('0x45')]({'where':_0x589dee[_0x0741('0x3f')]})[_0x0741('0x24')](function(_0x2429e5){_0x51ab33[_0x0741('0x45')]=_0x2429e5;if(_0x3ef1f1['query'][_0x0741('0x46')]){_0x589dee[_0x0741('0x47')]=[{'all':!![]}];}return db[_0x0741('0x61')][_0x0741('0x48')](_0x589dee);})[_0x0741('0x24')](function(_0x376940){_0x51ab33[_0x0741('0x49')]=_0x376940;return _0x51ab33;});}})[_0x0741('0x24')](respondWithFilteredResult(_0x1e256c,_0x589dee))[_0x0741('0x4a')](handleError(_0x1e256c,null));};exports[_0x0741('0x62')]=function(_0x56e5f1,_0x467f90,_0x43ae96){var _0xc6bb9={'raw':!![],'where':{}};var _0x27d484={};var _0x4b0b22={'count':0x0,'rows':[]};return db[_0x0741('0x30')][_0x0741('0x5b')]({'where':{'id':_0x56e5f1[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x467f90,null))[_0x0741('0x24')](function(_0x11c0f7){if(_0x11c0f7){_0x27d484['model']=_[_0x0741('0x4d')](db[_0x0741('0x63')][_0x0741('0x31')]);_0x27d484['query']=_['keys'](_0x56e5f1[_0x0741('0x35')]);_0x27d484[_0x0741('0x36')]=_[_0x0741('0x37')](_0x27d484[_0x0741('0x34')],_0x27d484[_0x0741('0x35')]);_0xc6bb9[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x27d484[_0x0741('0x34')],qs[_0x0741('0x38')](_0x56e5f1[_0x0741('0x35')][_0x0741('0x38')]));_0xc6bb9[_0x0741('0x3a')]=_0xc6bb9[_0x0741('0x3a')][_0x0741('0x39')]?_0xc6bb9[_0x0741('0x3a')]:_0x27d484['model'];if(!_0x56e5f1[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0xc6bb9[_0x0741('0x1d')]=qs['limit'](_0x56e5f1[_0x0741('0x35')][_0x0741('0x1d')]);_0xc6bb9[_0x0741('0x1e')]=qs['offset'](_0x56e5f1[_0x0741('0x35')][_0x0741('0x1e')]);}_0xc6bb9[_0x0741('0x3d')]=qs['sort'](_0x56e5f1[_0x0741('0x35')]['sort']);_0xc6bb9[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0x56e5f1[_0x0741('0x35')],_0x27d484[_0x0741('0x36')]));_0xc6bb9[_0x0741('0x3f')]['CampaignId']=_0x11c0f7['id'];if(_0x56e5f1[_0x0741('0x35')][_0x0741('0x41')]){_0xc6bb9[_0x0741('0x3f')]=_[_0x0741('0x42')](_0xc6bb9['where'],{'$or':_[_0x0741('0x2f')](_0xc6bb9['attributes'],function(_0x572858){var _0x603fde={};_0x603fde[_0x572858]={'$like':'%'+_0x56e5f1['query'][_0x0741('0x41')]+'%'};return _0x603fde;})});}_0xc6bb9=_[_0x0741('0x42')]({},_0xc6bb9,_0x56e5f1[_0x0741('0x44')]);return db['CmHopperBlack'][_0x0741('0x45')]({'where':_0xc6bb9[_0x0741('0x3f')]})['then'](function(_0x41939c){_0x4b0b22[_0x0741('0x45')]=_0x41939c;if(_0x56e5f1[_0x0741('0x35')][_0x0741('0x46')]){_0xc6bb9[_0x0741('0x47')]=[{'all':!![]}];}return db[_0x0741('0x63')]['findAll'](_0xc6bb9);})[_0x0741('0x24')](function(_0x1f333a){_0x4b0b22[_0x0741('0x49')]=_0x1f333a;return _0x4b0b22;});}})[_0x0741('0x24')](respondWithFilteredResult(_0x467f90,_0xc6bb9))[_0x0741('0x4a')](handleError(_0x467f90,null));};exports[_0x0741('0x64')]=function(_0x14b6b9,_0x543565,_0x1f4f00){var _0x4ab117={};var _0x53610c={};var _0x2d35ed;var _0x2099f3;return db[_0x0741('0x30')][_0x0741('0x5b')]({'where':{'id':_0x14b6b9[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x543565,null))[_0x0741('0x24')](function(_0x48015f){if(_0x48015f){_0x2d35ed=_0x48015f;_0x53610c[_0x0741('0x34')]=_[_0x0741('0x4d')](db['CmList'][_0x0741('0x31')]);_0x53610c['query']=_['keys'](_0x14b6b9[_0x0741('0x35')]);_0x53610c[_0x0741('0x36')]=_[_0x0741('0x37')](_0x53610c[_0x0741('0x34')],_0x53610c[_0x0741('0x35')]);_0x4ab117[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x53610c['model'],qs['fields'](_0x14b6b9[_0x0741('0x35')][_0x0741('0x38')]));_0x4ab117[_0x0741('0x3a')]=_0x4ab117[_0x0741('0x3a')]['length']?_0x4ab117[_0x0741('0x3a')]:_0x53610c[_0x0741('0x34')];_0x4ab117['order']=qs[_0x0741('0x3e')](_0x14b6b9[_0x0741('0x35')][_0x0741('0x3e')]);_0x4ab117[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0x14b6b9['query'],_0x53610c[_0x0741('0x36')]));if(_0x14b6b9[_0x0741('0x35')][_0x0741('0x41')]){_0x4ab117[_0x0741('0x3f')]=_['merge'](_0x4ab117['where'],{'$or':_['map'](_0x4ab117['attributes'],function(_0x2c3f8e){var _0x3b0600={};_0x3b0600[_0x2c3f8e]={'$like':'%'+_0x14b6b9[_0x0741('0x35')][_0x0741('0x41')]+'%'};return _0x3b0600;})});}_0x4ab117=_[_0x0741('0x42')]({},_0x4ab117,_0x14b6b9[_0x0741('0x44')]);return _0x2d35ed[_0x0741('0x64')](_0x4ab117);}})[_0x0741('0x24')](function(_0x56f031){if(_0x56f031){_0x2099f3=_0x56f031[_0x0741('0x39')];if(!_0x14b6b9[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x4ab117[_0x0741('0x1d')]=qs[_0x0741('0x1d')](_0x14b6b9[_0x0741('0x35')][_0x0741('0x1d')]);_0x4ab117[_0x0741('0x1e')]=qs['offset'](_0x14b6b9['query'][_0x0741('0x1e')]);}return _0x2d35ed['getLists'](_0x4ab117);}})[_0x0741('0x24')](function(_0x181346){if(_0x181346){return _0x181346?{'count':_0x2099f3,'rows':_0x181346}:null;}})[_0x0741('0x24')](respondWithResult(_0x543565,null))[_0x0741('0x4a')](handleError(_0x543565,null));};exports[_0x0741('0x65')]=function(_0x54df94,_0x56a7b9,_0x3c8172){var _0x1c45a2,_0x1d159d;return db[_0x0741('0x30')][_0x0741('0x4e')]({'where':{'id':_0x54df94[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x56a7b9,null))[_0x0741('0x24')](function(_0x56b31d){if(_0x56b31d){_0x1d159d=_0x56b31d;return _0x56b31d[_0x0741('0x65')](_0x54df94[_0x0741('0x57')][_0x0741('0x66')],_['omit'](_0x54df94[_0x0741('0x57')],['ids','id'])||{});}return null;})[_0x0741('0x67')](function(_0x26828f){var _0x5f1dbe;_0x1c45a2=_0x26828f||[];var _0x55faf9=[];if(_0x26828f){for(var _0x407f9=0x0;_0x407f9<_0x26828f[_0x0741('0x39')];_0x407f9+=0x1){var _0x2bc376=_0x26828f[_0x407f9][_0x0741('0x26')]({'plain':!![]});_0x1d159d[_0x0741('0x68')]=_0x54df94[_0x0741('0x57')][_0x0741('0x68')]?_0x54df94[_0x0741('0x57')]['dialCheckDuplicateType']:_0x1d159d[_0x0741('0x68')];switch(_0x1d159d[_0x0741('0x68')]){case _0x0741('0x69'):_0x5f1dbe=squel[_0x0741('0x6a')]()['into'](_0x0741('0x6b'))[_0x0741('0x6c')](['phone','scheduledAt',_0x0741('0x6d'),'ListId',_0x0741('0x5d'),_0x0741('0x56'),'updatedAt'],squel[_0x0741('0x6e')]()[_0x0741('0x6f')](_0x0741('0x70'),'phone')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x72'))[_0x0741('0x6f')]('id',_0x0741('0x6d'))[_0x0741('0x6f')](_0x2bc376[_0x0741('0x73')][_0x0741('0x74')](),_0x0741('0x75'))[_0x0741('0x6f')](_0x54df94[_0x0741('0x4c')]['id'][_0x0741('0x74')](),_0x0741('0x5d'))[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x56'))['field'](_0x0741('0x71'),_0x0741('0x76'))[_0x0741('0x77')](_0x0741('0x78'))[_0x0741('0x3f')](_0x0741('0x79'))[_0x0741('0x3f')](_0x0741('0x7a'),_0x2bc376[_0x0741('0x73')][_0x0741('0x74')]())['where'](_0x0741('0x7b'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0741('0x6f')](_0x0741('0x7c'))[_0x0741('0x77')](_0x0741('0x7d'))[_0x0741('0x3f')](_0x0741('0x7e'),_0x54df94['params']['id'][_0x0741('0x74')]()))[_0x0741('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0741('0x6e')]()[_0x0741('0x6f')]('COALESCE(phone,\x27\x27)')[_0x0741('0x77')](_0x0741('0x6b'))[_0x0741('0x3f')](_0x0741('0x7e'),_0x54df94[_0x0741('0x4c')]['id'][_0x0741('0x74')]())))['toString']();break;case _0x0741('0x7f'):_0x5f1dbe=squel[_0x0741('0x6a')]()['into'](_0x0741('0x6b'))['fromQuery']([_0x0741('0x70'),_0x0741('0x72'),'ContactId',_0x0741('0x75'),_0x0741('0x5d'),_0x0741('0x56'),'updatedAt'],squel['select']()['field'](_0x0741('0x70'),'phone')['field']('NOW()',_0x0741('0x72'))[_0x0741('0x6f')]('id','ContactId')[_0x0741('0x6f')](_0x2bc376[_0x0741('0x73')][_0x0741('0x74')](),_0x0741('0x75'))[_0x0741('0x6f')](_0x54df94[_0x0741('0x4c')]['id'][_0x0741('0x74')](),_0x0741('0x5d'))[_0x0741('0x6f')](_0x0741('0x71'),'createdAt')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x76'))[_0x0741('0x77')](_0x0741('0x78'))['where'](_0x0741('0x79'))['where']('ListId\x20=\x20?',_0x2bc376['CmListId']['toString']())[_0x0741('0x3f')](_0x0741('0x7b'))[_0x0741('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0741('0x6e')]()[_0x0741('0x6f')]('COALESCE(phone,\x27\x27)')[_0x0741('0x77')](_0x0741('0x6b'))['where']('CampaignId\x20=\x20?',_0x54df94[_0x0741('0x4c')]['id'][_0x0741('0x74')]())))[_0x0741('0x74')]();break;default:_0x5f1dbe=squel[_0x0741('0x6a')]()[_0x0741('0x80')](_0x0741('0x6b'))[_0x0741('0x6c')](['phone',_0x0741('0x72'),'ContactId',_0x0741('0x75'),'CampaignId',_0x0741('0x56'),_0x0741('0x76')],squel['select']()['field'](_0x0741('0x70'),'phone')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x72'))[_0x0741('0x6f')]('id',_0x0741('0x6d'))[_0x0741('0x6f')](_0x2bc376[_0x0741('0x73')][_0x0741('0x74')](),_0x0741('0x75'))[_0x0741('0x6f')](_0x54df94[_0x0741('0x4c')]['id']['toString'](),'CampaignId')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x56'))[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x76'))[_0x0741('0x77')](_0x0741('0x78'))['where'](_0x0741('0x79'))[_0x0741('0x3f')]('ListId\x20=\x20?',_0x2bc376[_0x0741('0x73')][_0x0741('0x74')]())[_0x0741('0x3f')](_0x0741('0x7b')))['toString']();}_0x55faf9[_0x0741('0x81')](db[_0x0741('0x82')][_0x0741('0x35')](_0x5f1dbe));}return BPromise[_0x0741('0x83')](_0x55faf9);}})['then'](function(){return _0x1c45a2;})[_0x0741('0x24')](respondWithResult(_0x56a7b9,null))['catch'](handleError(_0x56a7b9,null));};exports[_0x0741('0x84')]=function(_0x31b939,_0x214d3c,_0x307ee0){return db[_0x0741('0x30')][_0x0741('0x4e')]({'where':{'id':_0x31b939['params']['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x214d3c,null))[_0x0741('0x24')](function(_0x4cec16){if(_0x4cec16){return _0x4cec16['removeLists'](_0x31b939[_0x0741('0x35')][_0x0741('0x66')]);}})[_0x0741('0x24')](function(_0x3e1d71){if(_0x3e1d71){return db[_0x0741('0x5c')][_0x0741('0x25')]({'where':{'ListId':_0x31b939['query'][_0x0741('0x66')],'CampaignId':_0x31b939[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](function(){return _0x3e1d71;});}})[_0x0741('0x24')](respondWithStatusCode(_0x214d3c,null))[_0x0741('0x4a')](handleError(_0x214d3c,null));};exports[_0x0741('0x85')]=function(_0x520072,_0x2eb9ab,_0x4356eb){var _0x1e2f88={};var _0x3419ef={};var _0x525bc7;var _0x2260b0;return db['Campaign'][_0x0741('0x5b')]({'where':{'id':_0x520072['params']['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x2eb9ab,null))[_0x0741('0x24')](function(_0x349b80){if(_0x349b80){_0x525bc7=_0x349b80;_0x3419ef['model']=_[_0x0741('0x4d')](db[_0x0741('0x86')][_0x0741('0x31')]);_0x3419ef['query']=_['keys'](_0x520072[_0x0741('0x35')]);_0x3419ef[_0x0741('0x36')]=_[_0x0741('0x37')](_0x3419ef[_0x0741('0x34')],_0x3419ef['query']);_0x1e2f88['attributes']=_[_0x0741('0x37')](_0x3419ef['model'],qs['fields'](_0x520072[_0x0741('0x35')]['fields']));_0x1e2f88[_0x0741('0x3a')]=_0x1e2f88['attributes'][_0x0741('0x39')]?_0x1e2f88[_0x0741('0x3a')]:_0x3419ef[_0x0741('0x34')];_0x1e2f88[_0x0741('0x3d')]=qs[_0x0741('0x3e')](_0x520072[_0x0741('0x35')][_0x0741('0x3e')]);_0x1e2f88[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0x520072[_0x0741('0x35')],_0x3419ef[_0x0741('0x36')]));if(_0x520072[_0x0741('0x35')]['filter']){_0x1e2f88[_0x0741('0x3f')]=_['merge'](_0x1e2f88['where'],{'$or':_[_0x0741('0x2f')](_0x1e2f88[_0x0741('0x3a')],function(_0x5d532a){var _0x2cc506={};_0x2cc506[_0x5d532a]={'$like':'%'+_0x520072['query'][_0x0741('0x41')]+'%'};return _0x2cc506;})});}_0x1e2f88=_[_0x0741('0x42')]({},_0x1e2f88,_0x520072['options']);return _0x525bc7['getBlackLists'](_0x1e2f88);}})['then'](function(_0x4a183b){if(_0x4a183b){_0x2260b0=_0x4a183b[_0x0741('0x39')];if(!_0x520072[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x1e2f88[_0x0741('0x1d')]=qs[_0x0741('0x1d')](_0x520072['query'][_0x0741('0x1d')]);_0x1e2f88[_0x0741('0x1e')]=qs['offset'](_0x520072[_0x0741('0x35')][_0x0741('0x1e')]);}return _0x525bc7[_0x0741('0x85')](_0x1e2f88);}})[_0x0741('0x24')](function(_0x129417){if(_0x129417){return _0x129417?{'count':_0x2260b0,'rows':_0x129417}:null;}})['then'](respondWithResult(_0x2eb9ab,null))[_0x0741('0x4a')](handleError(_0x2eb9ab,null));};exports[_0x0741('0x87')]=function(_0x5ae756,_0x1d518a,_0x260e4d){var _0x1c2d59,_0x578750;return db[_0x0741('0x30')][_0x0741('0x4e')]({'where':{'id':_0x5ae756[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x1d518a,null))[_0x0741('0x24')](function(_0x56a3e8){if(_0x56a3e8){_0x578750=_0x56a3e8;return _0x56a3e8[_0x0741('0x87')](_0x5ae756[_0x0741('0x57')][_0x0741('0x66')],_['omit'](_0x5ae756[_0x0741('0x57')],['ids','id'])||{});}return null;})[_0x0741('0x67')](function(_0x27f6f1){var _0x446de6;_0x1c2d59=_0x27f6f1||[];var _0x328202=[];if(_0x27f6f1){for(var _0x5a3000=0x0;_0x5a3000<_0x27f6f1[_0x0741('0x39')];_0x5a3000+=0x1){var _0x1b117c=_0x27f6f1[_0x5a3000][_0x0741('0x26')]({'plain':!![]});_0x446de6=squel[_0x0741('0x6a')]()[_0x0741('0x80')](_0x0741('0x88'))['fromQuery']([_0x0741('0x70'),_0x0741('0x6d'),'ListId',_0x0741('0x5d'),_0x0741('0x56'),_0x0741('0x76')],squel[_0x0741('0x6e')]()[_0x0741('0x6f')](_0x0741('0x70'),_0x0741('0x70'))[_0x0741('0x6f')]('id','ContactId')[_0x0741('0x6f')](_0x1b117c[_0x0741('0x73')][_0x0741('0x74')](),_0x0741('0x75'))['field'](_0x5ae756[_0x0741('0x4c')]['id'][_0x0741('0x74')](),_0x0741('0x5d'))['field'](_0x0741('0x71'),'createdAt')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x76'))[_0x0741('0x77')]('cm_contacts')[_0x0741('0x3f')](_0x0741('0x79'))[_0x0741('0x3f')]('ListId\x20=\x20?',_0x1b117c[_0x0741('0x73')][_0x0741('0x74')]())[_0x0741('0x3f')](_0x0741('0x7b')))[_0x0741('0x74')]();_0x328202[_0x0741('0x81')](db[_0x0741('0x82')]['query'](_0x446de6));}return BPromise['all'](_0x328202);}})[_0x0741('0x24')](function(){return _0x1c2d59;})['then'](respondWithResult(_0x1d518a,null))[_0x0741('0x4a')](handleError(_0x1d518a,null));};exports['removeBlackLists']=function(_0x10adb0,_0x1eb49c,_0x12a7de){return db['Campaign'][_0x0741('0x4e')]({'where':{'id':_0x10adb0['params']['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x1eb49c,null))['then'](function(_0x5e9423){if(_0x5e9423){return _0x5e9423[_0x0741('0x89')](_0x10adb0[_0x0741('0x35')][_0x0741('0x66')]);}})[_0x0741('0x24')](function(_0x3cff44){if(_0x3cff44){return db[_0x0741('0x63')][_0x0741('0x25')]({'where':{'ListId':_0x10adb0[_0x0741('0x35')][_0x0741('0x66')],'CampaignId':_0x10adb0[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](function(){return _0x3cff44;});}})[_0x0741('0x24')](respondWithStatusCode(_0x1eb49c,null))[_0x0741('0x4a')](handleError(_0x1eb49c,null));}; \ No newline at end of file +var _0xb71b=['type','map','query','keys','filters','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','IvrCampaigns','getHoppers','findOne','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','updatedAt','field','NOW()','scheduledAt','ContactId','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId','cm_contacts','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','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','set','apply','reject','save','then','destroy','stack','name','index','Campaign','rawAttributes','fieldName'];(function(_0x108fc4,_0x4b0585){var _0x545e35=function(_0x3e0dd7){while(--_0x3e0dd7){_0x108fc4['push'](_0x108fc4['shift']());}};_0x545e35(++_0x4b0585);}(_0xb71b,0x1e8));var _0xbb71=function(_0x383a9d,_0x46d8f1){_0x383a9d=_0x383a9d-0x0;var _0x128f90=_0xb71b[_0x383a9d];return _0x128f90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb71('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb71('0x1'));var rp=require(_0xbb71('0x2'));var moment=require(_0xbb71('0x3'));var BPromise=require(_0xbb71('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbb71('0x5'));var sox=require(_0xbb71('0x6'));var csv=require(_0xbb71('0x7'));var ejs=require(_0xbb71('0x8'));var fs=require('fs');var fs_extra=require(_0xbb71('0x9'));var _=require(_0xbb71('0xa'));var squel=require(_0xbb71('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbb71('0xc'));var toCsv=require(_0xbb71('0x7'));var querystring=require(_0xbb71('0xd'));var Papa=require(_0xbb71('0xe'));var Redis=require(_0xbb71('0xf'));var authService=require(_0xbb71('0x10'));var qs=require(_0xbb71('0x11'));var as=require(_0xbb71('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb71('0x13'))(_0xbb71('0x14'));var utils=require(_0xbb71('0x15'));var config=require(_0xbb71('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb71('0x17'))['db'];function respondWithStatusCode(_0xf6cf92,_0x3992f1){_0x3992f1=_0x3992f1||0xcc;return function(_0x24cd09){if(_0x24cd09){return _0xf6cf92[_0xbb71('0x18')](_0x3992f1);}return _0xf6cf92[_0xbb71('0x19')](_0x3992f1)[_0xbb71('0x1a')]();};}function respondWithResult(_0x58b833,_0x483fbd){_0x483fbd=_0x483fbd||0xc8;return function(_0x496bba){if(_0x496bba){return _0x58b833[_0xbb71('0x19')](_0x483fbd)[_0xbb71('0x1b')](_0x496bba);}};}function respondWithFilteredResult(_0x2ff567,_0x557b59){return function(_0x345065){if(_0x345065){var _0x27c2e0=typeof _0x557b59[_0xbb71('0x1c')]===_0xbb71('0x1d')&&typeof _0x557b59[_0xbb71('0x1e')]===_0xbb71('0x1d');var _0xba8221=_0x345065[_0xbb71('0x1f')];var _0x278b5d=_0x27c2e0?0x0:_0x557b59[_0xbb71('0x1c')];var _0x29bdc7=_0x27c2e0?_0x345065['count']:_0x557b59[_0xbb71('0x1c')]+_0x557b59[_0xbb71('0x1e')];var _0x29a322;if(_0x29bdc7>=_0xba8221){_0x29bdc7=_0xba8221;_0x29a322=0xc8;}else{_0x29a322=0xce;}_0x2ff567[_0xbb71('0x19')](_0x29a322);return _0x2ff567[_0xbb71('0x20')]('Content-Range',_0x278b5d+'-'+_0x29bdc7+'/'+_0xba8221)[_0xbb71('0x1b')](_0x345065);}return null;};}function patchUpdates(_0x5c9b8e){return function(_0x390465){try{jsonpatch[_0xbb71('0x21')](_0x390465,_0x5c9b8e,!![]);}catch(_0x3d0dec){return BPromise[_0xbb71('0x22')](_0x3d0dec);}return _0x390465[_0xbb71('0x23')]();};}function saveUpdates(_0x46dcf4,_0x1ee89b){return function(_0x1bb91f){if(_0x1bb91f){return _0x1bb91f['update'](_0x46dcf4)[_0xbb71('0x24')](function(_0x18c931){return _0x18c931;});}return null;};}function removeEntity(_0x71536,_0x19ded1){return function(_0x5654d4){if(_0x5654d4){return _0x5654d4[_0xbb71('0x25')]()[_0xbb71('0x24')](function(){var _0x5d61a7=_0x5654d4['get']({'plain':!![]});var _0x2c946c='IvrCampaigns';return db['UserProfileResource'][_0xbb71('0x25')]({'where':{'type':_0x2c946c,'resourceId':_0x5d61a7['id']}})['then'](function(){return _0x5654d4;});})['then'](function(){_0x71536[_0xbb71('0x19')](0xcc)[_0xbb71('0x1a')]();});}};}function handleEntityNotFound(_0x43fa35,_0x457f0){return function(_0xfd8684){if(!_0xfd8684){_0x43fa35[_0xbb71('0x18')](0x194);}return _0xfd8684;};}function handleError(_0x7b6e33,_0xe02996){_0xe02996=_0xe02996||0x1f4;return function(_0x597b83){logger['error'](_0x597b83[_0xbb71('0x26')]);if(_0x597b83[_0xbb71('0x27')]){delete _0x597b83[_0xbb71('0x27')];}_0x7b6e33[_0xbb71('0x19')](_0xe02996)['send'](_0x597b83);};}exports[_0xbb71('0x28')]=function(_0x3b8dee,_0x59d2f3){var _0x52563b={},_0x2a6653={},_0x4e5cb6={'count':0x0,'rows':[]};var _0x1cfd3b=_['map'](db[_0xbb71('0x29')][_0xbb71('0x2a')],function(_0xaaf442){return{'name':_0xaaf442[_0xbb71('0x2b')],'type':_0xaaf442[_0xbb71('0x2c')]['key']};});_0x2a6653['model']=_[_0xbb71('0x2d')](_0x1cfd3b,_0xbb71('0x27'));_0x2a6653[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x3b8dee[_0xbb71('0x2e')]);_0x2a6653[_0xbb71('0x30')]=_['intersection'](_0x2a6653[_0xbb71('0x31')],_0x2a6653[_0xbb71('0x2e')]);_0x52563b[_0xbb71('0x32')]=_['intersection'](_0x2a6653[_0xbb71('0x31')],qs['fields'](_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x33')]));_0x52563b[_0xbb71('0x32')]=_0x52563b[_0xbb71('0x32')]['length']?_0x52563b[_0xbb71('0x32')]:_0x2a6653['model'];if(!_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x34')]('nolimit')){_0x52563b[_0xbb71('0x1e')]=qs[_0xbb71('0x1e')](_0x3b8dee[_0xbb71('0x2e')]['limit']);_0x52563b[_0xbb71('0x1c')]=qs['offset'](_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x1c')]);}_0x52563b[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x36')]);_0x52563b[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x3b8dee['query'],_0x2a6653[_0xbb71('0x30')]),_0x1cfd3b);if(_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x52563b['where']=_[_0xbb71('0x3a')](_0x52563b[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x1cfd3b,function(_0x47789d){if(_0x47789d[_0xbb71('0x2c')]!=='VIRTUAL'){var _0x3e55a6={};_0x3e55a6[_0x47789d[_0xbb71('0x27')]]={'$like':'%'+_0x3b8dee['query'][_0xbb71('0x39')]+'%'};return _0x3e55a6;}})});}_0x52563b=_[_0xbb71('0x3a')]({},_0x52563b,_0x3b8dee[_0xbb71('0x3b')]);var _0x1f63f7={'where':_0x52563b[_0xbb71('0x37')]};return db[_0xbb71('0x29')][_0xbb71('0x1f')](_0x1f63f7)['then'](function(_0x532c03){_0x4e5cb6[_0xbb71('0x1f')]=_0x532c03;if(_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x3c')]){_0x52563b[_0xbb71('0x3d')]=[{'all':!![]}];}return db['Campaign'][_0xbb71('0x3e')](_0x52563b);})[_0xbb71('0x24')](function(_0x565337){_0x4e5cb6[_0xbb71('0x3f')]=_0x565337;return _0x4e5cb6;})[_0xbb71('0x24')](respondWithFilteredResult(_0x59d2f3,_0x52563b))[_0xbb71('0x40')](handleError(_0x59d2f3,null));};exports[_0xbb71('0x41')]=function(_0x370f1e,_0x341c1e){var _0xb6203e={'raw':![],'where':{'id':_0x370f1e['params']['id']}},_0x1bfcfe={};_0x1bfcfe['model']=_[_0xbb71('0x2f')](db[_0xbb71('0x29')][_0xbb71('0x2a')]);_0x1bfcfe[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x370f1e[_0xbb71('0x2e')]);_0x1bfcfe['filters']=_[_0xbb71('0x42')](_0x1bfcfe[_0xbb71('0x31')],_0x1bfcfe[_0xbb71('0x2e')]);_0xb6203e[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x1bfcfe['model'],qs[_0xbb71('0x33')](_0x370f1e[_0xbb71('0x2e')][_0xbb71('0x33')]));_0xb6203e[_0xbb71('0x32')]=_0xb6203e[_0xbb71('0x32')][_0xbb71('0x43')]?_0xb6203e['attributes']:_0x1bfcfe['model'];if(_0x370f1e[_0xbb71('0x2e')][_0xbb71('0x3c')]){_0xb6203e[_0xbb71('0x3d')]=[{'all':!![]}];}_0xb6203e=_[_0xbb71('0x3a')]({},_0xb6203e,_0x370f1e[_0xbb71('0x3b')]);return db[_0xbb71('0x29')]['find'](_0xb6203e)['then'](handleEntityNotFound(_0x341c1e,null))[_0xbb71('0x24')](respondWithResult(_0x341c1e,null))['catch'](handleError(_0x341c1e,null));};exports[_0xbb71('0x44')]=function(_0x4f44d5,_0x43cf31){return db[_0xbb71('0x29')]['create'](_0x4f44d5[_0xbb71('0x45')],{})[_0xbb71('0x24')](function(_0x48daa6){var _0x25cc25=_0x4f44d5[_0xbb71('0x46')]['get']({'plain':!![]});if(!_0x25cc25)throw new Error(_0xbb71('0x47'));if(_0x25cc25[_0xbb71('0x48')]==='user'){var _0x4c7d52=_0x48daa6[_0xbb71('0x49')]({'plain':!![]});var _0x19acf6='IvrCampaigns';return db[_0xbb71('0x4a')][_0xbb71('0x4b')]({'where':{'name':_0x19acf6,'userProfileId':_0x25cc25[_0xbb71('0x4c')]},'raw':!![]})['then'](function(_0x21c761){if(_0x21c761&&_0x21c761[_0xbb71('0x4d')]===0x0){return db[_0xbb71('0x4e')][_0xbb71('0x44')]({'name':_0x4c7d52['name'],'resourceId':_0x4c7d52['id'],'type':_0x21c761['name'],'sectionId':_0x21c761['id']},{})[_0xbb71('0x24')](function(){return _0x48daa6;});}else{return _0x48daa6;}})[_0xbb71('0x40')](function(_0x362e1a){logger[_0xbb71('0x4f')](_0xbb71('0x50'),_0x362e1a);throw _0x362e1a;});}return _0x48daa6;})[_0xbb71('0x24')](respondWithResult(_0x43cf31,0xc9))[_0xbb71('0x40')](handleError(_0x43cf31,null));};exports[_0xbb71('0x51')]=function(_0x3c025c,_0x34155c){var _0xa434c9={'where':{'id':_0x3c025c[_0xbb71('0x52')]['id']}},_0x85f7f5={};_0x85f7f5[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db['Campaign'][_0xbb71('0x2a')]);_0xa434c9[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x85f7f5['model'],qs[_0xbb71('0x33')](_0x3c025c[_0xbb71('0x2e')][_0xbb71('0x33')]));_0xa434c9[_0xbb71('0x32')]=_0xa434c9['attributes'][_0xbb71('0x43')]?_0xa434c9[_0xbb71('0x32')]:_0x85f7f5['model'];if(_0x3c025c[_0xbb71('0x2e')]['includeAll']){_0xa434c9[_0xbb71('0x3d')]=[{'all':!![]}];}_0xa434c9=_[_0xbb71('0x3a')]({},_0xa434c9,_0x3c025c[_0xbb71('0x3b')]);return db[_0xbb71('0x29')]['find'](_0xa434c9)[_0xbb71('0x24')](handleEntityNotFound(_0x34155c,null))[_0xbb71('0x24')](function(_0x44556c){if(_0x44556c){var _0x2fdcc9=_0x44556c[_0xbb71('0x49')]({'plain':!![]});_0x2fdcc9=qs[_0xbb71('0x53')](_0x2fdcc9,['id',_0xbb71('0x54'),'updatedAt']);_0x3c025c['body']=_[_0xbb71('0x53')](_0x3c025c['body'],['id',_0xbb71('0x54'),'updatedAt']);return db[_0xbb71('0x29')]['create'](_[_0xbb71('0x3a')](_0x2fdcc9,_0x3c025c[_0xbb71('0x45')]),{'include':_0x3c025c[_0xbb71('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0xbb71('0x24')](function(_0x499f8a){var _0x3ce858=_0x3c025c[_0xbb71('0x46')]['get']({'plain':!![]});if(!_0x3ce858)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ce858['role']==='user'){var _0x179121=_0x499f8a[_0xbb71('0x49')]({'plain':!![]});var _0x44dfe4=_0xbb71('0x55');return db['UserProfileSection'][_0xbb71('0x4b')]({'where':{'name':_0x44dfe4,'userProfileId':_0x3ce858['userProfileId']},'raw':!![]})[_0xbb71('0x24')](function(_0x1ca9d0){if(_0x1ca9d0&&_0x1ca9d0[_0xbb71('0x4d')]===0x0){return db[_0xbb71('0x4e')][_0xbb71('0x44')]({'name':_0x179121[_0xbb71('0x27')],'resourceId':_0x179121['id'],'type':_0x1ca9d0['name'],'sectionId':_0x1ca9d0['id']},{})['then'](function(){return _0x499f8a;});}else{return _0x499f8a;}})[_0xbb71('0x40')](function(_0x1c8f6f){logger[_0xbb71('0x4f')](_0xbb71('0x50'),_0x1c8f6f);throw _0x1c8f6f;});}return _0x499f8a;});}})[_0xbb71('0x24')](respondWithResult(_0x34155c,0xc9))[_0xbb71('0x40')](handleError(_0x34155c,null));};exports['update']=function(_0x270852,_0x1b14a9){if(_0x270852[_0xbb71('0x45')]['id']){delete _0x270852[_0xbb71('0x45')]['id'];}return db[_0xbb71('0x29')]['find']({'where':{'id':_0x270852[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x1b14a9,null))[_0xbb71('0x24')](saveUpdates(_0x270852[_0xbb71('0x45')],null))[_0xbb71('0x24')](respondWithResult(_0x1b14a9,null))[_0xbb71('0x40')](handleError(_0x1b14a9,null));};exports[_0xbb71('0x25')]=function(_0x5ad4c9,_0x2bd7b1){return db[_0xbb71('0x29')]['find']({'where':{'id':_0x5ad4c9[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x2bd7b1,null))[_0xbb71('0x24')](removeEntity(_0x2bd7b1,null))['catch'](handleError(_0x2bd7b1,null));};exports[_0xbb71('0x56')]=function(_0x5cbf14,_0xc6c9e5,_0x3d7f48){var _0x3f8e6d={'raw':!![],'where':{}};var _0x12d4cf={};var _0x1bde0f={'count':0x0,'rows':[]};return db[_0xbb71('0x29')][_0xbb71('0x57')]({'where':{'id':_0x5cbf14[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0xc6c9e5,null))[_0xbb71('0x24')](function(_0x31ffe6){if(_0x31ffe6){_0x12d4cf[_0xbb71('0x31')]=_['keys'](db[_0xbb71('0x58')][_0xbb71('0x2a')]);_0x12d4cf[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x5cbf14[_0xbb71('0x2e')]);_0x12d4cf[_0xbb71('0x30')]=_['intersection'](_0x12d4cf[_0xbb71('0x31')],_0x12d4cf[_0xbb71('0x2e')]);_0x3f8e6d[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x12d4cf['model'],qs['fields'](_0x5cbf14['query'][_0xbb71('0x33')]));_0x3f8e6d['attributes']=_0x3f8e6d[_0xbb71('0x32')]['length']?_0x3f8e6d[_0xbb71('0x32')]:_0x12d4cf[_0xbb71('0x31')];if(!_0x5cbf14['query'][_0xbb71('0x34')](_0xbb71('0x59'))){_0x3f8e6d[_0xbb71('0x1e')]=qs[_0xbb71('0x1e')](_0x5cbf14['query'][_0xbb71('0x1e')]);_0x3f8e6d[_0xbb71('0x1c')]=qs[_0xbb71('0x1c')](_0x5cbf14[_0xbb71('0x2e')][_0xbb71('0x1c')]);}_0x3f8e6d[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x5cbf14['query'][_0xbb71('0x36')]);_0x3f8e6d['where']=qs['filters'](_[_0xbb71('0x38')](_0x5cbf14[_0xbb71('0x2e')],_0x12d4cf[_0xbb71('0x30')]));_0x3f8e6d[_0xbb71('0x37')][_0xbb71('0x5a')]=_0x31ffe6['id'];if(_0x5cbf14[_0xbb71('0x2e')]['filter']){_0x3f8e6d['where']=_['merge'](_0x3f8e6d[_0xbb71('0x37')],{'$or':_['map'](_0x3f8e6d[_0xbb71('0x32')],function(_0x5a999d){var _0x4b2704={};_0x4b2704[_0x5a999d]={'$like':'%'+_0x5cbf14[_0xbb71('0x2e')][_0xbb71('0x39')]+'%'};return _0x4b2704;})});}_0x3f8e6d=_[_0xbb71('0x3a')]({},_0x3f8e6d,_0x5cbf14[_0xbb71('0x3b')]);return db['CmHopper'][_0xbb71('0x1f')]({'where':_0x3f8e6d['where']})[_0xbb71('0x24')](function(_0x5d7179){_0x1bde0f[_0xbb71('0x1f')]=_0x5d7179;if(_0x5cbf14[_0xbb71('0x2e')]['includeAll']){_0x3f8e6d[_0xbb71('0x3d')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3f8e6d);})[_0xbb71('0x24')](function(_0x31d754){_0x1bde0f['rows']=_0x31d754;return _0x1bde0f;});}})[_0xbb71('0x24')](respondWithFilteredResult(_0xc6c9e5,_0x3f8e6d))[_0xbb71('0x40')](handleError(_0xc6c9e5,null));};exports[_0xbb71('0x5b')]=function(_0x234f64,_0x3a293d,_0x211b0b){var _0x5a9129={'raw':!![],'where':{}};var _0x4a4084={};var _0x1cf5d2={'count':0x0,'rows':[]};return db[_0xbb71('0x29')][_0xbb71('0x57')]({'where':{'id':_0x234f64[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x3a293d,null))[_0xbb71('0x24')](function(_0x2a66f9){if(_0x2a66f9){_0x4a4084[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db[_0xbb71('0x5c')][_0xbb71('0x2a')]);_0x4a4084[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x234f64[_0xbb71('0x2e')]);_0x4a4084['filters']=_[_0xbb71('0x42')](_0x4a4084[_0xbb71('0x31')],_0x4a4084[_0xbb71('0x2e')]);_0x5a9129[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x4a4084[_0xbb71('0x31')],qs[_0xbb71('0x33')](_0x234f64[_0xbb71('0x2e')][_0xbb71('0x33')]));_0x5a9129['attributes']=_0x5a9129['attributes']['length']?_0x5a9129[_0xbb71('0x32')]:_0x4a4084[_0xbb71('0x31')];if(!_0x234f64[_0xbb71('0x2e')][_0xbb71('0x34')]('nolimit')){_0x5a9129[_0xbb71('0x1e')]=qs[_0xbb71('0x1e')](_0x234f64[_0xbb71('0x2e')][_0xbb71('0x1e')]);_0x5a9129['offset']=qs[_0xbb71('0x1c')](_0x234f64[_0xbb71('0x2e')][_0xbb71('0x1c')]);}_0x5a9129[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x234f64['query']['sort']);_0x5a9129['where']=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x234f64[_0xbb71('0x2e')],_0x4a4084[_0xbb71('0x30')]));_0x5a9129['where'][_0xbb71('0x5a')]=_0x2a66f9['id'];if(_0x234f64[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x5a9129[_0xbb71('0x37')]=_[_0xbb71('0x3a')](_0x5a9129[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x5a9129['attributes'],function(_0x252b04){var _0x1c4e6e={};_0x1c4e6e[_0x252b04]={'$like':'%'+_0x234f64[_0xbb71('0x2e')][_0xbb71('0x39')]+'%'};return _0x1c4e6e;})});}_0x5a9129=_['merge']({},_0x5a9129,_0x234f64[_0xbb71('0x3b')]);return db[_0xbb71('0x5c')][_0xbb71('0x1f')]({'where':_0x5a9129[_0xbb71('0x37')]})[_0xbb71('0x24')](function(_0x310532){_0x1cf5d2[_0xbb71('0x1f')]=_0x310532;if(_0x234f64[_0xbb71('0x2e')][_0xbb71('0x3c')]){_0x5a9129[_0xbb71('0x3d')]=[{'all':!![]}];}return db[_0xbb71('0x5c')]['findAll'](_0x5a9129);})[_0xbb71('0x24')](function(_0x344263){_0x1cf5d2[_0xbb71('0x3f')]=_0x344263;return _0x1cf5d2;});}})[_0xbb71('0x24')](respondWithFilteredResult(_0x3a293d,_0x5a9129))['catch'](handleError(_0x3a293d,null));};exports[_0xbb71('0x5d')]=function(_0x2826b3,_0x38043e,_0x2e8aba){var _0x9ef327={'raw':!![],'where':{}};var _0x11df5c={};var _0x26482b={'count':0x0,'rows':[]};return db['Campaign'][_0xbb71('0x57')]({'where':{'id':_0x2826b3[_0xbb71('0x52')]['id']}})['then'](handleEntityNotFound(_0x38043e,null))[_0xbb71('0x24')](function(_0x3f1242){if(_0x3f1242){_0x11df5c[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db['CmHopperFinal']['rawAttributes']);_0x11df5c[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x2826b3[_0xbb71('0x2e')]);_0x11df5c[_0xbb71('0x30')]=_[_0xbb71('0x42')](_0x11df5c[_0xbb71('0x31')],_0x11df5c[_0xbb71('0x2e')]);_0x9ef327[_0xbb71('0x32')]=_['intersection'](_0x11df5c[_0xbb71('0x31')],qs['fields'](_0x2826b3[_0xbb71('0x2e')]['fields']));_0x9ef327['attributes']=_0x9ef327[_0xbb71('0x32')][_0xbb71('0x43')]?_0x9ef327[_0xbb71('0x32')]:_0x11df5c[_0xbb71('0x31')];if(!_0x2826b3[_0xbb71('0x2e')][_0xbb71('0x34')](_0xbb71('0x59'))){_0x9ef327[_0xbb71('0x1e')]=qs[_0xbb71('0x1e')](_0x2826b3[_0xbb71('0x2e')]['limit']);_0x9ef327[_0xbb71('0x1c')]=qs['offset'](_0x2826b3[_0xbb71('0x2e')][_0xbb71('0x1c')]);}_0x9ef327[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x2826b3['query'][_0xbb71('0x36')]);_0x9ef327[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x2826b3[_0xbb71('0x2e')],_0x11df5c[_0xbb71('0x30')]));_0x9ef327[_0xbb71('0x37')][_0xbb71('0x5a')]=_0x3f1242['id'];if(_0x2826b3[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x9ef327[_0xbb71('0x37')]=_['merge'](_0x9ef327[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x9ef327['attributes'],function(_0x7d0178){var _0x298acb={};_0x298acb[_0x7d0178]={'$like':'%'+_0x2826b3['query'][_0xbb71('0x39')]+'%'};return _0x298acb;})});}_0x9ef327=_['merge']({},_0x9ef327,_0x2826b3[_0xbb71('0x3b')]);return db['CmHopperFinal'][_0xbb71('0x1f')]({'where':_0x9ef327['where']})['then'](function(_0x1e9084){_0x26482b[_0xbb71('0x1f')]=_0x1e9084;if(_0x2826b3[_0xbb71('0x2e')][_0xbb71('0x3c')]){_0x9ef327['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xbb71('0x3e')](_0x9ef327);})['then'](function(_0x202fa8){_0x26482b[_0xbb71('0x3f')]=_0x202fa8;return _0x26482b;});}})[_0xbb71('0x24')](respondWithFilteredResult(_0x38043e,_0x9ef327))[_0xbb71('0x40')](handleError(_0x38043e,null));};exports[_0xbb71('0x5e')]=function(_0x48fe06,_0x235b63,_0x1d79a3){var _0x47a621={'raw':!![],'where':{}};var _0x580c00={};var _0x271899={'count':0x0,'rows':[]};return db[_0xbb71('0x29')][_0xbb71('0x57')]({'where':{'id':_0x48fe06[_0xbb71('0x52')]['id']}})['then'](handleEntityNotFound(_0x235b63,null))[_0xbb71('0x24')](function(_0x7e1104){if(_0x7e1104){_0x580c00[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db[_0xbb71('0x5f')][_0xbb71('0x2a')]);_0x580c00[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x48fe06[_0xbb71('0x2e')]);_0x580c00[_0xbb71('0x30')]=_['intersection'](_0x580c00[_0xbb71('0x31')],_0x580c00['query']);_0x47a621[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x580c00[_0xbb71('0x31')],qs[_0xbb71('0x33')](_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x33')]));_0x47a621['attributes']=_0x47a621[_0xbb71('0x32')][_0xbb71('0x43')]?_0x47a621[_0xbb71('0x32')]:_0x580c00['model'];if(!_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x34')]('nolimit')){_0x47a621[_0xbb71('0x1e')]=qs['limit'](_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x1e')]);_0x47a621[_0xbb71('0x1c')]=qs[_0xbb71('0x1c')](_0x48fe06[_0xbb71('0x2e')]['offset']);}_0x47a621[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x36')]);_0x47a621[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x48fe06[_0xbb71('0x2e')],_0x580c00[_0xbb71('0x30')]));_0x47a621[_0xbb71('0x37')][_0xbb71('0x5a')]=_0x7e1104['id'];if(_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x47a621[_0xbb71('0x37')]=_[_0xbb71('0x3a')](_0x47a621[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x47a621[_0xbb71('0x32')],function(_0x51c51a){var _0x2e7cf2={};_0x2e7cf2[_0x51c51a]={'$like':'%'+_0x48fe06[_0xbb71('0x2e')]['filter']+'%'};return _0x2e7cf2;})});}_0x47a621=_[_0xbb71('0x3a')]({},_0x47a621,_0x48fe06['options']);return db[_0xbb71('0x5f')][_0xbb71('0x1f')]({'where':_0x47a621[_0xbb71('0x37')]})[_0xbb71('0x24')](function(_0x3fb1a6){_0x271899[_0xbb71('0x1f')]=_0x3fb1a6;if(_0x48fe06[_0xbb71('0x2e')]['includeAll']){_0x47a621['include']=[{'all':!![]}];}return db[_0xbb71('0x5f')][_0xbb71('0x3e')](_0x47a621);})[_0xbb71('0x24')](function(_0x2c16f1){_0x271899[_0xbb71('0x3f')]=_0x2c16f1;return _0x271899;});}})['then'](respondWithFilteredResult(_0x235b63,_0x47a621))['catch'](handleError(_0x235b63,null));};exports[_0xbb71('0x60')]=function(_0xbe53ff,_0x53bc7b,_0x543e19){var _0x1b6c14={};var _0x410e51={};var _0x32ce5f;var _0x3c1d44;return db[_0xbb71('0x29')][_0xbb71('0x57')]({'where':{'id':_0xbe53ff[_0xbb71('0x52')]['id']}})['then'](handleEntityNotFound(_0x53bc7b,null))[_0xbb71('0x24')](function(_0x21873a){if(_0x21873a){_0x32ce5f=_0x21873a;_0x410e51[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db[_0xbb71('0x61')][_0xbb71('0x2a')]);_0x410e51[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0xbe53ff[_0xbb71('0x2e')]);_0x410e51['filters']=_[_0xbb71('0x42')](_0x410e51[_0xbb71('0x31')],_0x410e51[_0xbb71('0x2e')]);_0x1b6c14[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x410e51['model'],qs['fields'](_0xbe53ff[_0xbb71('0x2e')][_0xbb71('0x33')]));_0x1b6c14['attributes']=_0x1b6c14[_0xbb71('0x32')][_0xbb71('0x43')]?_0x1b6c14[_0xbb71('0x32')]:_0x410e51[_0xbb71('0x31')];_0x1b6c14['order']=qs['sort'](_0xbe53ff[_0xbb71('0x2e')][_0xbb71('0x36')]);_0x1b6c14[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_['pick'](_0xbe53ff[_0xbb71('0x2e')],_0x410e51[_0xbb71('0x30')]));if(_0xbe53ff['query'][_0xbb71('0x39')]){_0x1b6c14[_0xbb71('0x37')]=_[_0xbb71('0x3a')](_0x1b6c14[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x1b6c14[_0xbb71('0x32')],function(_0x573ae5){var _0x4d0d6f={};_0x4d0d6f[_0x573ae5]={'$like':'%'+_0xbe53ff[_0xbb71('0x2e')]['filter']+'%'};return _0x4d0d6f;})});}_0x1b6c14=_[_0xbb71('0x3a')]({},_0x1b6c14,_0xbe53ff[_0xbb71('0x3b')]);return _0x32ce5f[_0xbb71('0x60')](_0x1b6c14);}})[_0xbb71('0x24')](function(_0xfb11f1){if(_0xfb11f1){_0x3c1d44=_0xfb11f1[_0xbb71('0x43')];if(!_0xbe53ff[_0xbb71('0x2e')][_0xbb71('0x34')](_0xbb71('0x59'))){_0x1b6c14[_0xbb71('0x1e')]=qs['limit'](_0xbe53ff[_0xbb71('0x2e')]['limit']);_0x1b6c14['offset']=qs[_0xbb71('0x1c')](_0xbe53ff['query'][_0xbb71('0x1c')]);}return _0x32ce5f[_0xbb71('0x60')](_0x1b6c14);}})[_0xbb71('0x24')](function(_0x411cb7){if(_0x411cb7){return _0x411cb7?{'count':_0x3c1d44,'rows':_0x411cb7}:null;}})[_0xbb71('0x24')](respondWithResult(_0x53bc7b,null))[_0xbb71('0x40')](handleError(_0x53bc7b,null));};exports['addLists']=function(_0x3b9e64,_0x2740c0,_0x2bb43d){var _0x4c0657,_0x24eaf6;return db[_0xbb71('0x29')][_0xbb71('0x4b')]({'where':{'id':_0x3b9e64[_0xbb71('0x52')]['id']}})['then'](handleEntityNotFound(_0x2740c0,null))[_0xbb71('0x24')](function(_0x59b667){if(_0x59b667){_0x24eaf6=_0x59b667;return _0x59b667[_0xbb71('0x62')](_0x3b9e64[_0xbb71('0x45')][_0xbb71('0x63')],_[_0xbb71('0x53')](_0x3b9e64['body'],['ids','id'])||{});}return null;})[_0xbb71('0x64')](function(_0x314982){var _0x28604a;_0x4c0657=_0x314982||[];var _0x1cfee1=[];if(_0x314982){for(var _0x3a4b1a=0x0;_0x3a4b1a<_0x314982[_0xbb71('0x43')];_0x3a4b1a+=0x1){var _0x38f473=_0x314982[_0x3a4b1a][_0xbb71('0x49')]({'plain':!![]});_0x24eaf6[_0xbb71('0x65')]=_0x3b9e64['body']['dialCheckDuplicateType']?_0x3b9e64[_0xbb71('0x45')][_0xbb71('0x65')]:_0x24eaf6['dialCheckDuplicateType'];switch(_0x24eaf6[_0xbb71('0x65')]){case _0xbb71('0x66'):_0x28604a=squel[_0xbb71('0x67')]()['into'](_0xbb71('0x68'))[_0xbb71('0x69')]([_0xbb71('0x6a'),'scheduledAt','ContactId','ListId',_0xbb71('0x5a'),_0xbb71('0x54'),_0xbb71('0x6b')],squel['select']()['field'](_0xbb71('0x6a'),'phone')[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x6e'))[_0xbb71('0x6c')]('id',_0xbb71('0x6f'))['field'](_0x38f473[_0xbb71('0x70')]['toString'](),'ListId')[_0xbb71('0x6c')](_0x3b9e64['params']['id'][_0xbb71('0x71')](),_0xbb71('0x5a'))['field'](_0xbb71('0x6d'),_0xbb71('0x54'))[_0xbb71('0x6c')]('NOW()','updatedAt')[_0xbb71('0x72')]('cm_contacts')[_0xbb71('0x37')](_0xbb71('0x73'))[_0xbb71('0x37')]('ListId\x20=\x20?',_0x38f473[_0xbb71('0x70')]['toString']())[_0xbb71('0x37')](_0xbb71('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0xbb71('0x72')]('cm_hopper_final')[_0xbb71('0x37')](_0xbb71('0x75'),_0x3b9e64['params']['id'][_0xbb71('0x71')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xbb71('0x76')]()['field'](_0xbb71('0x77'))[_0xbb71('0x72')](_0xbb71('0x68'))[_0xbb71('0x37')](_0xbb71('0x75'),_0x3b9e64[_0xbb71('0x52')]['id'][_0xbb71('0x71')]())))[_0xbb71('0x71')]();break;case _0xbb71('0x78'):_0x28604a=squel['insert']()[_0xbb71('0x79')](_0xbb71('0x68'))[_0xbb71('0x69')]([_0xbb71('0x6a'),_0xbb71('0x6e'),_0xbb71('0x6f'),_0xbb71('0x7a'),_0xbb71('0x5a'),_0xbb71('0x54'),_0xbb71('0x6b')],squel[_0xbb71('0x76')]()[_0xbb71('0x6c')](_0xbb71('0x6a'),'phone')[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x6e'))[_0xbb71('0x6c')]('id',_0xbb71('0x6f'))[_0xbb71('0x6c')](_0x38f473[_0xbb71('0x70')][_0xbb71('0x71')](),_0xbb71('0x7a'))['field'](_0x3b9e64['params']['id']['toString'](),_0xbb71('0x5a'))[_0xbb71('0x6c')]('NOW()',_0xbb71('0x54'))[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x6b'))[_0xbb71('0x72')](_0xbb71('0x7b'))[_0xbb71('0x37')](_0xbb71('0x73'))[_0xbb71('0x37')]('ListId\x20=\x20?',_0x38f473[_0xbb71('0x70')][_0xbb71('0x71')]())['where'](_0xbb71('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xbb71('0x76')]()[_0xbb71('0x6c')]('COALESCE(phone,\x27\x27)')[_0xbb71('0x72')](_0xbb71('0x68'))[_0xbb71('0x37')]('CampaignId\x20=\x20?',_0x3b9e64['params']['id'][_0xbb71('0x71')]())))[_0xbb71('0x71')]();break;default:_0x28604a=squel[_0xbb71('0x67')]()[_0xbb71('0x79')](_0xbb71('0x68'))['fromQuery']([_0xbb71('0x6a'),_0xbb71('0x6e'),_0xbb71('0x6f'),_0xbb71('0x7a'),_0xbb71('0x5a'),_0xbb71('0x54'),'updatedAt'],squel['select']()[_0xbb71('0x6c')](_0xbb71('0x6a'),_0xbb71('0x6a'))[_0xbb71('0x6c')]('NOW()',_0xbb71('0x6e'))[_0xbb71('0x6c')]('id',_0xbb71('0x6f'))[_0xbb71('0x6c')](_0x38f473['CmListId'][_0xbb71('0x71')](),'ListId')[_0xbb71('0x6c')](_0x3b9e64['params']['id'][_0xbb71('0x71')](),_0xbb71('0x5a'))['field'](_0xbb71('0x6d'),'createdAt')[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x6b'))[_0xbb71('0x72')](_0xbb71('0x7b'))[_0xbb71('0x37')]('deletedAt\x20IS\x20NULL')[_0xbb71('0x37')](_0xbb71('0x7c'),_0x38f473[_0xbb71('0x70')][_0xbb71('0x71')]())[_0xbb71('0x37')](_0xbb71('0x74')))['toString']();}_0x1cfee1[_0xbb71('0x7d')](db[_0xbb71('0x7e')][_0xbb71('0x2e')](_0x28604a));}return BPromise[_0xbb71('0x7f')](_0x1cfee1);}})[_0xbb71('0x24')](function(){return _0x4c0657;})[_0xbb71('0x24')](respondWithResult(_0x2740c0,null))[_0xbb71('0x40')](handleError(_0x2740c0,null));};exports[_0xbb71('0x80')]=function(_0x5479a7,_0xc0c4bd,_0x165fa8){return db['Campaign'][_0xbb71('0x4b')]({'where':{'id':_0x5479a7[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0xc0c4bd,null))[_0xbb71('0x24')](function(_0x83c1d7){if(_0x83c1d7){return _0x83c1d7[_0xbb71('0x80')](_0x5479a7[_0xbb71('0x2e')][_0xbb71('0x63')]);}})['then'](function(_0x1867c9){if(_0x1867c9){return db['CmHopper'][_0xbb71('0x25')]({'where':{'ListId':_0x5479a7['query'][_0xbb71('0x63')],'CampaignId':_0x5479a7[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](function(){return _0x1867c9;});}})[_0xbb71('0x24')](respondWithStatusCode(_0xc0c4bd,null))[_0xbb71('0x40')](handleError(_0xc0c4bd,null));};exports['getBlackLists']=function(_0x51fcc7,_0x28f5e7,_0x60845b){var _0x54c457={};var _0x1435d6={};var _0x4fcb3;var _0x39434d;return db['Campaign'][_0xbb71('0x57')]({'where':{'id':_0x51fcc7[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x28f5e7,null))[_0xbb71('0x24')](function(_0x4bcd51){if(_0x4bcd51){_0x4fcb3=_0x4bcd51;_0x1435d6[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db[_0xbb71('0x61')][_0xbb71('0x2a')]);_0x1435d6[_0xbb71('0x2e')]=_['keys'](_0x51fcc7[_0xbb71('0x2e')]);_0x1435d6[_0xbb71('0x30')]=_[_0xbb71('0x42')](_0x1435d6[_0xbb71('0x31')],_0x1435d6[_0xbb71('0x2e')]);_0x54c457['attributes']=_[_0xbb71('0x42')](_0x1435d6[_0xbb71('0x31')],qs[_0xbb71('0x33')](_0x51fcc7['query'][_0xbb71('0x33')]));_0x54c457[_0xbb71('0x32')]=_0x54c457['attributes']['length']?_0x54c457[_0xbb71('0x32')]:_0x1435d6[_0xbb71('0x31')];_0x54c457['order']=qs[_0xbb71('0x36')](_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x36')]);_0x54c457[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x51fcc7['query'],_0x1435d6[_0xbb71('0x30')]));if(_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x54c457[_0xbb71('0x37')]=_[_0xbb71('0x3a')](_0x54c457[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x54c457[_0xbb71('0x32')],function(_0x4cdd93){var _0x5987cb={};_0x5987cb[_0x4cdd93]={'$like':'%'+_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x39')]+'%'};return _0x5987cb;})});}_0x54c457=_['merge']({},_0x54c457,_0x51fcc7['options']);return _0x4fcb3[_0xbb71('0x81')](_0x54c457);}})[_0xbb71('0x24')](function(_0x521c30){if(_0x521c30){_0x39434d=_0x521c30[_0xbb71('0x43')];if(!_0x51fcc7[_0xbb71('0x2e')]['hasOwnProperty'](_0xbb71('0x59'))){_0x54c457[_0xbb71('0x1e')]=qs['limit'](_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x1e')]);_0x54c457['offset']=qs[_0xbb71('0x1c')](_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x1c')]);}return _0x4fcb3[_0xbb71('0x81')](_0x54c457);}})[_0xbb71('0x24')](function(_0xbd0a84){if(_0xbd0a84){return _0xbd0a84?{'count':_0x39434d,'rows':_0xbd0a84}:null;}})[_0xbb71('0x24')](respondWithResult(_0x28f5e7,null))[_0xbb71('0x40')](handleError(_0x28f5e7,null));};exports[_0xbb71('0x82')]=function(_0x46b08b,_0x35f032,_0x5ad3ae){var _0x457173,_0xaa89fa;return db[_0xbb71('0x29')]['find']({'where':{'id':_0x46b08b['params']['id']}})['then'](handleEntityNotFound(_0x35f032,null))[_0xbb71('0x24')](function(_0x3295d5){if(_0x3295d5){_0xaa89fa=_0x3295d5;return _0x3295d5[_0xbb71('0x82')](_0x46b08b[_0xbb71('0x45')][_0xbb71('0x63')],_[_0xbb71('0x53')](_0x46b08b['body'],[_0xbb71('0x63'),'id'])||{});}return null;})[_0xbb71('0x64')](function(_0x27b48e){var _0x10d37c;_0x457173=_0x27b48e||[];var _0x59dd17=[];if(_0x27b48e){for(var _0x4c7256=0x0;_0x4c7256<_0x27b48e[_0xbb71('0x43')];_0x4c7256+=0x1){var _0x2209ba=_0x27b48e[_0x4c7256][_0xbb71('0x49')]({'plain':!![]});_0x10d37c=squel[_0xbb71('0x67')]()[_0xbb71('0x79')](_0xbb71('0x83'))[_0xbb71('0x69')]([_0xbb71('0x6a'),_0xbb71('0x6f'),_0xbb71('0x7a'),_0xbb71('0x5a'),_0xbb71('0x54'),_0xbb71('0x6b')],squel[_0xbb71('0x76')]()[_0xbb71('0x6c')]('phone','phone')[_0xbb71('0x6c')]('id',_0xbb71('0x6f'))[_0xbb71('0x6c')](_0x2209ba[_0xbb71('0x70')][_0xbb71('0x71')](),_0xbb71('0x7a'))[_0xbb71('0x6c')](_0x46b08b['params']['id'][_0xbb71('0x71')](),_0xbb71('0x5a'))[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x54'))[_0xbb71('0x6c')]('NOW()',_0xbb71('0x6b'))['from'](_0xbb71('0x7b'))[_0xbb71('0x37')](_0xbb71('0x73'))[_0xbb71('0x37')](_0xbb71('0x7c'),_0x2209ba[_0xbb71('0x70')][_0xbb71('0x71')]())['where'](_0xbb71('0x74')))['toString']();_0x59dd17['push'](db[_0xbb71('0x7e')]['query'](_0x10d37c));}return BPromise[_0xbb71('0x7f')](_0x59dd17);}})[_0xbb71('0x24')](function(){return _0x457173;})[_0xbb71('0x24')](respondWithResult(_0x35f032,null))[_0xbb71('0x40')](handleError(_0x35f032,null));};exports[_0xbb71('0x84')]=function(_0x4e3007,_0x5168a4,_0x22fddc){return db[_0xbb71('0x29')][_0xbb71('0x4b')]({'where':{'id':_0x4e3007[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x5168a4,null))[_0xbb71('0x24')](function(_0x36362a){if(_0x36362a){return _0x36362a['removeBlackLists'](_0x4e3007[_0xbb71('0x2e')]['ids']);}})[_0xbb71('0x24')](function(_0x38d125){if(_0x38d125){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x4e3007[_0xbb71('0x2e')][_0xbb71('0x63')],'CampaignId':_0x4e3007[_0xbb71('0x52')]['id']}})['then'](function(){return _0x38d125;});}})[_0xbb71('0x24')](respondWithStatusCode(_0x5168a4,null))[_0xbb71('0x40')](handleError(_0x5168a4,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 72fc077..cd14b77 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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_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 +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index fef586b..99c5dcf 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 _0x33a4=['catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','model','map','info','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0x33a4,0x88));var _0x433a=function(_0x3d6abc,_0x55019e){_0x3d6abc=_0x3d6abc-0x0;var _0x537904=_0x33a4[_0x3d6abc];return _0x537904;};'use strict';var _=require('lodash');var util=require(_0x433a('0x0'));var moment=require('moment');var BPromise=require(_0x433a('0x1'));var rs=require(_0x433a('0x2'));var fs=require('fs');var Redis=require(_0x433a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x433a('0x4'));var config=require(_0x433a('0x5'));var jayson=require(_0x433a('0x6'));var client=jayson[_0x433a('0x7')][_0x433a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcc88,_0x422eb9,_0x58e65c){return new BPromise(function(_0x2c2404,_0x3156ec){return client[_0x433a('0x9')](_0x4fcc88,_0x58e65c)[_0x433a('0xa')](function(_0x4c1057){logger['info'](_0x433a('0xb'),_0x422eb9,_0x433a('0xc'));logger[_0x433a('0xd')](_0x433a('0xe'),_0x422eb9,_0x433a('0xc'),JSON['stringify'](_0x4c1057));if(_0x4c1057['error']){if(_0x4c1057[_0x433a('0xf')][_0x433a('0x10')]===0x1f4){logger[_0x433a('0xf')](_0x433a('0xb'),_0x422eb9,_0x4c1057['error'][_0x433a('0x11')]);return _0x3156ec(_0x4c1057[_0x433a('0xf')]['message']);}logger[_0x433a('0xf')]('Campaign,\x20%s,\x20%s',_0x422eb9,_0x4c1057[_0x433a('0xf')][_0x433a('0x11')]);return _0x2c2404(_0x4c1057[_0x433a('0xf')]['message']);}else{logger['info'](_0x433a('0xb'),_0x422eb9,_0x433a('0xc'));_0x2c2404(_0x4c1057[_0x433a('0x12')][_0x433a('0x11')]);}})[_0x433a('0x13')](function(_0x4df77a){logger['error'](_0x433a('0xb'),_0x422eb9,_0x4df77a);_0x3156ec(_0x4df77a);});});}exports[_0x433a('0x14')]=function(_0x4254c4){var _0x1975b7=this;return new Promise(function(_0x255e47,_0xfcdced){return db[_0x433a('0x15')][_0x433a('0x16')]({'raw':_0x4254c4[_0x433a('0x17')]?_0x4254c4[_0x433a('0x17')][_0x433a('0x18')]===undefined?!![]:![]:!![],'where':_0x4254c4['options']?_0x4254c4[_0x433a('0x17')]['where']||null:null,'attributes':_0x4254c4[_0x433a('0x17')]?_0x4254c4['options'][_0x433a('0x19')]||null:null,'limit':_0x4254c4[_0x433a('0x17')]?_0x4254c4[_0x433a('0x17')][_0x433a('0x1a')]||null:null,'include':_0x4254c4[_0x433a('0x17')]?_0x4254c4[_0x433a('0x17')][_0x433a('0x1b')]?_['map'](_0x4254c4['options'][_0x433a('0x1b')],function(_0x5a50ff){return{'model':db[_0x5a50ff[_0x433a('0x1c')]],'as':_0x5a50ff['as'],'attributes':_0x5a50ff['attributes'],'include':_0x5a50ff[_0x433a('0x1b')]?_[_0x433a('0x1d')](_0x5a50ff[_0x433a('0x1b')],function(_0x3ef4ab){return{'model':db[_0x3ef4ab[_0x433a('0x1c')]],'as':_0x3ef4ab['as'],'attributes':_0x3ef4ab[_0x433a('0x19')],'include':_0x3ef4ab['include']?_[_0x433a('0x1d')](_0x3ef4ab[_0x433a('0x1b')],function(_0x4792ff){return{'model':db[_0x4792ff[_0x433a('0x1c')]],'as':_0x4792ff['as'],'attributes':_0x4792ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ec211){logger[_0x433a('0x1e')]('GetCampaign',_0x4254c4);logger[_0x433a('0xd')]('GetCampaign',_0x4254c4,JSON['stringify'](_0x5ec211));_0x255e47(_0x5ec211);})[_0x433a('0x13')](function(_0x1d5d78){logger[_0x433a('0xf')]('GetCampaign',_0x1d5d78[_0x433a('0x11')],_0x4254c4);_0xfcdced(_0x1975b7[_0x433a('0xf')](0x1f4,_0x1d5d78[_0x433a('0x11')]));});});}; \ No newline at end of file +var _0xbe31=['map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','GetCampaign','Campaign','findAll','options','raw','limit','include'];(function(_0x3899cb,_0xb95555){var _0x3fe239=function(_0x12a2dc){while(--_0x12a2dc){_0x3899cb['push'](_0x3899cb['shift']());}};_0x3fe239(++_0xb95555);}(_0xbe31,0x83));var _0x1be3=function(_0x5cfe0a,_0x4b14ac){_0x5cfe0a=_0x5cfe0a-0x0;var _0x8da0d4=_0xbe31[_0x5cfe0a];return _0x8da0d4;};'use strict';var _=require('lodash');var util=require(_0x1be3('0x0'));var moment=require(_0x1be3('0x1'));var BPromise=require(_0x1be3('0x2'));var rs=require(_0x1be3('0x3'));var fs=require('fs');var Redis=require(_0x1be3('0x4'));var db=require(_0x1be3('0x5'))['db'];var utils=require(_0x1be3('0x6'));var logger=require(_0x1be3('0x7'))(_0x1be3('0x8'));var config=require('../../config/environment');var jayson=require(_0x1be3('0x9'));var client=jayson['client'][_0x1be3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa757b9,_0x3c925a,_0x2c3965){return new BPromise(function(_0x2bb749,_0x2e4488){return client[_0x1be3('0xb')](_0xa757b9,_0x2c3965)[_0x1be3('0xc')](function(_0x359742){logger[_0x1be3('0xd')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x1be3('0xe'));logger[_0x1be3('0xf')](_0x1be3('0x10'),_0x3c925a,_0x1be3('0xe'),JSON[_0x1be3('0x11')](_0x359742));if(_0x359742[_0x1be3('0x12')]){if(_0x359742[_0x1be3('0x12')][_0x1be3('0x13')]===0x1f4){logger[_0x1be3('0x12')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x359742[_0x1be3('0x12')]['message']);return _0x2e4488(_0x359742[_0x1be3('0x12')][_0x1be3('0x14')]);}logger['error'](_0x1be3('0x15'),_0x3c925a,_0x359742['error'][_0x1be3('0x14')]);return _0x2bb749(_0x359742[_0x1be3('0x12')][_0x1be3('0x14')]);}else{logger[_0x1be3('0xd')](_0x1be3('0x15'),_0x3c925a,_0x1be3('0xe'));_0x2bb749(_0x359742['result']['message']);}})['catch'](function(_0x52d2f2){logger[_0x1be3('0x12')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x52d2f2);_0x2e4488(_0x52d2f2);});});}exports[_0x1be3('0x16')]=function(_0x6b7edf){var _0xaa1d7b=this;return new Promise(function(_0x1d0c2b,_0x21668a){return db[_0x1be3('0x17')][_0x1be3('0x18')]({'raw':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1a')]===undefined?!![]:![]:!![],'where':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')]['where']||null:null,'attributes':_0x6b7edf['options']?_0x6b7edf[_0x1be3('0x19')]['attributes']||null:null,'limit':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1b')]||null:null,'include':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1c')]?_[_0x1be3('0x1d')](_0x6b7edf['options'][_0x1be3('0x1c')],function(_0x48862c){return{'model':db[_0x48862c[_0x1be3('0x1e')]],'as':_0x48862c['as'],'attributes':_0x48862c[_0x1be3('0x1f')],'include':_0x48862c['include']?_[_0x1be3('0x1d')](_0x48862c['include'],function(_0x134d79){return{'model':db[_0x134d79[_0x1be3('0x1e')]],'as':_0x134d79['as'],'attributes':_0x134d79[_0x1be3('0x1f')],'include':_0x134d79[_0x1be3('0x1c')]?_['map'](_0x134d79[_0x1be3('0x1c')],function(_0x8d1f58){return{'model':db[_0x8d1f58['model']],'as':_0x8d1f58['as'],'attributes':_0x8d1f58[_0x1be3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1be3('0xc')](function(_0x44da09){logger[_0x1be3('0xd')](_0x1be3('0x16'),_0x6b7edf);logger[_0x1be3('0xf')]('GetCampaign',_0x6b7edf,JSON[_0x1be3('0x11')](_0x44da09));_0x1d0c2b(_0x44da09);})['catch'](function(_0x25ed26){logger['error'](_0x1be3('0x16'),_0x25ed26[_0x1be3('0x14')],_0x6b7edf);_0x21668a(_0xaa1d7b['error'](0x1f4,_0x25ed26['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 3c1ad90..ad93c3e 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 _0xf83f=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addBlackLists','put','delete','destroy','removeLists','removeBlackLists'];(function(_0x528a46,_0x532e92){var _0x2a18df=function(_0xcbf0ab){while(--_0xcbf0ab){_0x528a46['push'](_0x528a46['shift']());}};_0x2a18df(++_0x532e92);}(_0xf83f,0xf8));var _0xff83=function(_0xe7b7dd,_0x249439){_0xe7b7dd=_0xe7b7dd-0x0;var _0x14303e=_0xf83f[_0xe7b7dd];return _0x14303e;};'use strict';var multer=require(_0xff83('0x0'));var util=require(_0xff83('0x1'));var path=require('path');var timeout=require(_0xff83('0x2'));var express=require(_0xff83('0x3'));var router=express[_0xff83('0x4')]();var fs_extra=require(_0xff83('0x5'));var auth=require(_0xff83('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff83('0x7'));var controller=require('./campaign.controller');router[_0xff83('0x8')]('/',auth['isAuthenticated'](),controller[_0xff83('0x9')]);router[_0xff83('0x8')](_0xff83('0xa'),auth[_0xff83('0xb')](),controller[_0xff83('0xc')]);router[_0xff83('0x8')](_0xff83('0xd'),auth['isAuthenticated'](),controller[_0xff83('0xe')]);router[_0xff83('0x8')]('/:id/hopper_histories',auth[_0xff83('0xb')](),controller[_0xff83('0xf')]);router['get']('/:id/hopper_finals',auth[_0xff83('0xb')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xff83('0xb')](),controller[_0xff83('0x10')]);router[_0xff83('0x8')](_0xff83('0x11'),auth[_0xff83('0xb')](),controller[_0xff83('0x12')]);router['get'](_0xff83('0x13'),auth[_0xff83('0xb')](),controller[_0xff83('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xff83('0x15')]);router[_0xff83('0x16')](_0xff83('0x17'),auth[_0xff83('0xb')](),controller[_0xff83('0x18')]);router['post'](_0xff83('0x11'),auth['isAuthenticated'](),controller['addLists']);router['post'](_0xff83('0x13'),auth[_0xff83('0xb')](),controller[_0xff83('0x19')]);router[_0xff83('0x1a')]('/:id',auth[_0xff83('0xb')](),controller['update']);router[_0xff83('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xff83('0x1c')]);router[_0xff83('0x1b')]('/:id/lists',auth[_0xff83('0xb')](),controller[_0xff83('0x1d')]);router[_0xff83('0x1b')](_0xff83('0x13'),auth[_0xff83('0xb')](),controller[_0xff83('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xcee0=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','clone','addLists','put','update','/:id','destroy','delete','removeLists','removeBlackLists','exports'];(function(_0x5dd882,_0xb6cc65){var _0x21bfa9=function(_0x4bdf23){while(--_0x4bdf23){_0x5dd882['push'](_0x5dd882['shift']());}};_0x21bfa9(++_0xb6cc65);}(_0xcee0,0x1e1));var _0x0cee=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0xcee0[_0x1f83a5];return _0x45edf0;};'use strict';var multer=require(_0x0cee('0x0'));var util=require(_0x0cee('0x1'));var path=require(_0x0cee('0x2'));var timeout=require(_0x0cee('0x3'));var express=require(_0x0cee('0x4'));var router=express[_0x0cee('0x5')]();var fs_extra=require(_0x0cee('0x6'));var auth=require(_0x0cee('0x7'));var interaction=require(_0x0cee('0x8'));var config=require('../../config/environment');var controller=require(_0x0cee('0x9'));router[_0x0cee('0xa')]('/',auth[_0x0cee('0xb')](),controller[_0x0cee('0xc')]);router[_0x0cee('0xa')]('/:id',auth[_0x0cee('0xb')](),controller[_0x0cee('0xd')]);router[_0x0cee('0xa')](_0x0cee('0xe'),auth[_0x0cee('0xb')](),controller[_0x0cee('0xf')]);router[_0x0cee('0xa')](_0x0cee('0x10'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x11')]);router[_0x0cee('0xa')](_0x0cee('0x12'),auth['isAuthenticated'](),controller[_0x0cee('0x13')]);router[_0x0cee('0xa')](_0x0cee('0x14'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x15')]);router[_0x0cee('0xa')](_0x0cee('0x16'),auth[_0x0cee('0xb')](),controller['getLists']);router[_0x0cee('0xa')](_0x0cee('0x17'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x18')]);router[_0x0cee('0x19')]('/',auth[_0x0cee('0xb')](),controller[_0x0cee('0x1a')]);router[_0x0cee('0x19')]('/:id/clone',auth[_0x0cee('0xb')](),controller[_0x0cee('0x1b')]);router[_0x0cee('0x19')](_0x0cee('0x16'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x1c')]);router[_0x0cee('0x19')](_0x0cee('0x17'),auth[_0x0cee('0xb')](),controller['addBlackLists']);router[_0x0cee('0x1d')]('/:id',auth[_0x0cee('0xb')](),controller[_0x0cee('0x1e')]);router['delete'](_0x0cee('0x1f'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x20')]);router[_0x0cee('0x21')](_0x0cee('0x16'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x22')]);router[_0x0cee('0x21')](_0x0cee('0x17'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x23')]);module[_0x0cee('0x24')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 38af73f..7d7b582 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 _0x2608=['key','sequelize','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2608,0x67));var _0x8260=function(_0x39ab26,_0x13fc03){_0x39ab26=_0x39ab26-0x0;var _0x25b1d4=_0x2608[_0x39ab26];return _0x25b1d4;};'use strict';var Sequelize=require(_0x8260('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8260('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8260('0x2')]},'name':{'type':Sequelize[_0x8260('0x3')],'get':function(){return this[_0x8260('0x4')](_0x8260('0x5'));}}}; \ No newline at end of file +var _0xcf90=['STRING','TEXT','VIRTUAL','key','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf90,0x17e));var _0x0cf9=function(_0x37344b,_0x2ce638){_0x37344b=_0x37344b-0x0;var _0x598372=_0xcf90[_0x37344b];return _0x598372;};'use strict';var Sequelize=require(_0x0cf9('0x0'));module[_0x0cf9('0x1')]={'key':{'type':Sequelize[_0x0cf9('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0cf9('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x0cf9('0x4')],'get':function(){return this['getDataValue'](_0x0cf9('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 1a4ab73..740465d 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 _0x10f1=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CannedAnswers','error','stack','name','CannedAnswer','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path'];(function(_0x47f711,_0x1cb459){var _0x307fb8=function(_0x2802fa){while(--_0x2802fa){_0x47f711['push'](_0x47f711['shift']());}};_0x307fb8(++_0x1cb459);}(_0x10f1,0xaf));var _0x110f=function(_0x51ede2,_0x3a0317){_0x51ede2=_0x51ede2-0x0;var _0x412063=_0x10f1[_0x51ede2];return _0x412063;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x110f('0x0'));var zipdir=require(_0x110f('0x1'));var jsonpatch=require(_0x110f('0x2'));var rp=require(_0x110f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x110f('0x4'));var util=require(_0x110f('0x5'));var path=require(_0x110f('0x6'));var sox=require(_0x110f('0x7'));var csv=require(_0x110f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x110f('0x9'));var _=require(_0x110f('0xa'));var squel=require(_0x110f('0xb'));var crypto=require(_0x110f('0xc'));var jsforce=require(_0x110f('0xd'));var deskjs=require(_0x110f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x110f('0xf'));var Papa=require('papaparse');var Redis=require(_0x110f('0x10'));var authService=require(_0x110f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x110f('0x12'));var hardwareService=require(_0x110f('0x13'));var logger=require(_0x110f('0x14'))(_0x110f('0x15'));var utils=require(_0x110f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x110f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48655c,_0x180668){_0x180668=_0x180668||0xcc;return function(_0x15ec22){if(_0x15ec22){return _0x48655c[_0x110f('0x18')](_0x180668);}return _0x48655c[_0x110f('0x19')](_0x180668)[_0x110f('0x1a')]();};}function respondWithResult(_0x4cea0b,_0x4c21d9){_0x4c21d9=_0x4c21d9||0xc8;return function(_0x31b850){if(_0x31b850){return _0x4cea0b[_0x110f('0x19')](_0x4c21d9)['json'](_0x31b850);}};}function respondWithFilteredResult(_0x5f490e,_0x1bb1f5){return function(_0x5ec7e7){if(_0x5ec7e7){var _0x662033=typeof _0x1bb1f5[_0x110f('0x1b')]===_0x110f('0x1c')&&typeof _0x1bb1f5[_0x110f('0x1d')]===_0x110f('0x1c');var _0x179361=_0x5ec7e7[_0x110f('0x1e')];var _0xe781c3=_0x662033?0x0:_0x1bb1f5[_0x110f('0x1b')];var _0x7dbf3f=_0x662033?_0x5ec7e7[_0x110f('0x1e')]:_0x1bb1f5[_0x110f('0x1b')]+_0x1bb1f5[_0x110f('0x1d')];var _0x441854;if(_0x7dbf3f>=_0x179361){_0x7dbf3f=_0x179361;_0x441854=0xc8;}else{_0x441854=0xce;}_0x5f490e[_0x110f('0x19')](_0x441854);return _0x5f490e[_0x110f('0x1f')](_0x110f('0x20'),_0xe781c3+'-'+_0x7dbf3f+'/'+_0x179361)[_0x110f('0x21')](_0x5ec7e7);}return null;};}function patchUpdates(_0x3720da){return function(_0x3351bd){try{jsonpatch[_0x110f('0x22')](_0x3351bd,_0x3720da,!![]);}catch(_0x2847c1){return BPromise[_0x110f('0x23')](_0x2847c1);}return _0x3351bd[_0x110f('0x24')]();};}function saveUpdates(_0x6aab09,_0x53b6f4){return function(_0x7c365b){if(_0x7c365b){return _0x7c365b[_0x110f('0x25')](_0x6aab09)['then'](function(_0x16527f){return _0x16527f;});}return null;};}function removeEntity(_0x48aa6b,_0x3f9f08){return function(_0x1db5d8){if(_0x1db5d8){return _0x1db5d8[_0x110f('0x26')]()[_0x110f('0x27')](function(){var _0x52d29e=_0x1db5d8[_0x110f('0x28')]({'plain':!![]});var _0x327fbe=_0x110f('0x29');return db['UserProfileResource'][_0x110f('0x26')]({'where':{'type':_0x327fbe,'resourceId':_0x52d29e['id']}})[_0x110f('0x27')](function(){return _0x1db5d8;});})[_0x110f('0x27')](function(){_0x48aa6b[_0x110f('0x19')](0xcc)[_0x110f('0x1a')]();});}};}function handleEntityNotFound(_0x479620,_0x4ba09f){return function(_0x4a2496){if(!_0x4a2496){_0x479620[_0x110f('0x18')](0x194);}return _0x4a2496;};}function handleError(_0x4aa947,_0x3c4a19){_0x3c4a19=_0x3c4a19||0x1f4;return function(_0x3666bf){logger[_0x110f('0x2a')](_0x3666bf[_0x110f('0x2b')]);if(_0x3666bf[_0x110f('0x2c')]){delete _0x3666bf[_0x110f('0x2c')];}_0x4aa947[_0x110f('0x19')](_0x3c4a19)['send'](_0x3666bf);};}exports['index']=function(_0x1ddae0,_0x1bf6c1){var _0x53b8e8={},_0x297901={},_0x1d1993={'count':0x0,'rows':[]};var _0x55d470=_['map'](db[_0x110f('0x2d')]['rawAttributes'],function(_0x1076ac){return{'name':_0x1076ac[_0x110f('0x2e')],'type':_0x1076ac[_0x110f('0x2f')]['key']};});_0x297901[_0x110f('0x30')]=_[_0x110f('0x31')](_0x55d470,_0x110f('0x2c'));_0x297901[_0x110f('0x32')]=_[_0x110f('0x33')](_0x1ddae0[_0x110f('0x32')]);_0x297901[_0x110f('0x34')]=_['intersection'](_0x297901[_0x110f('0x30')],_0x297901[_0x110f('0x32')]);_0x53b8e8[_0x110f('0x35')]=_[_0x110f('0x36')](_0x297901[_0x110f('0x30')],qs[_0x110f('0x37')](_0x1ddae0[_0x110f('0x32')][_0x110f('0x37')]));_0x53b8e8[_0x110f('0x35')]=_0x53b8e8[_0x110f('0x35')][_0x110f('0x38')]?_0x53b8e8[_0x110f('0x35')]:_0x297901[_0x110f('0x30')];if(!_0x1ddae0[_0x110f('0x32')]['hasOwnProperty']('nolimit')){_0x53b8e8['limit']=qs[_0x110f('0x1d')](_0x1ddae0['query'][_0x110f('0x1d')]);_0x53b8e8[_0x110f('0x1b')]=qs['offset'](_0x1ddae0['query'][_0x110f('0x1b')]);}_0x53b8e8[_0x110f('0x39')]=qs['sort'](_0x1ddae0[_0x110f('0x32')][_0x110f('0x3a')]);_0x53b8e8[_0x110f('0x3b')]=qs['filters'](_[_0x110f('0x3c')](_0x1ddae0['query'],_0x297901['filters']),_0x55d470);if(_0x1ddae0['query'][_0x110f('0x3d')]){_0x53b8e8[_0x110f('0x3b')]=_[_0x110f('0x3e')](_0x53b8e8[_0x110f('0x3b')],{'$or':[{'key':{'$like':'%'+_0x1ddae0[_0x110f('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x1ddae0[_0x110f('0x32')][_0x110f('0x3d')]+'%'}}]});}_0x53b8e8=_[_0x110f('0x3e')]({},_0x53b8e8,_0x1ddae0[_0x110f('0x3f')]);var _0x26d9f2={'where':_0x53b8e8[_0x110f('0x3b')]};return db[_0x110f('0x2d')][_0x110f('0x1e')](_0x26d9f2)[_0x110f('0x27')](function(_0x1abc77){_0x1d1993[_0x110f('0x1e')]=_0x1abc77;if(_0x1ddae0[_0x110f('0x32')][_0x110f('0x40')]){_0x53b8e8[_0x110f('0x41')]=[{'all':!![]}];}return db[_0x110f('0x2d')][_0x110f('0x42')](_0x53b8e8);})[_0x110f('0x27')](function(_0xdcde71){_0x1d1993[_0x110f('0x43')]=_0xdcde71;return _0x1d1993;})['then'](respondWithFilteredResult(_0x1bf6c1,_0x53b8e8))[_0x110f('0x44')](handleError(_0x1bf6c1,null));};exports[_0x110f('0x45')]=function(_0x1d0cc1,_0xe32cbf){var _0x4e8355={'raw':!![],'where':{'id':_0x1d0cc1['params']['id']}},_0x37e4fa={};_0x37e4fa[_0x110f('0x30')]=_[_0x110f('0x33')](db[_0x110f('0x2d')][_0x110f('0x46')]);_0x37e4fa[_0x110f('0x32')]=_[_0x110f('0x33')](_0x1d0cc1[_0x110f('0x32')]);_0x37e4fa[_0x110f('0x34')]=_[_0x110f('0x36')](_0x37e4fa[_0x110f('0x30')],_0x37e4fa[_0x110f('0x32')]);_0x4e8355['attributes']=_[_0x110f('0x36')](_0x37e4fa['model'],qs[_0x110f('0x37')](_0x1d0cc1[_0x110f('0x32')]['fields']));_0x4e8355[_0x110f('0x35')]=_0x4e8355[_0x110f('0x35')][_0x110f('0x38')]?_0x4e8355[_0x110f('0x35')]:_0x37e4fa['model'];if(_0x1d0cc1[_0x110f('0x32')][_0x110f('0x40')]){_0x4e8355[_0x110f('0x41')]=[{'all':!![]}];}_0x4e8355=_[_0x110f('0x3e')]({},_0x4e8355,_0x1d0cc1[_0x110f('0x3f')]);return db['CannedAnswer'][_0x110f('0x47')](_0x4e8355)['then'](handleEntityNotFound(_0xe32cbf,null))['then'](respondWithResult(_0xe32cbf,null))[_0x110f('0x44')](handleError(_0xe32cbf,null));};exports['update']=function(_0x427e40,_0x1941df){if(_0x427e40[_0x110f('0x48')]['id']){delete _0x427e40['body']['id'];}return db[_0x110f('0x2d')][_0x110f('0x47')]({'where':{'id':_0x427e40['params']['id']}})[_0x110f('0x27')](handleEntityNotFound(_0x1941df,null))[_0x110f('0x27')](saveUpdates(_0x427e40[_0x110f('0x48')],null))['then'](respondWithResult(_0x1941df,null))[_0x110f('0x44')](handleError(_0x1941df,null));};exports[_0x110f('0x26')]=function(_0x26c984,_0x2c70ca){return db[_0x110f('0x2d')][_0x110f('0x47')]({'where':{'id':_0x26c984[_0x110f('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c70ca,null))[_0x110f('0x27')](removeEntity(_0x2c70ca,null))['catch'](handleError(_0x2c70ca,null));};exports[_0x110f('0x4a')]=function(_0x2080c7,_0x3a62bd){var _0x565d36={'key':_0x2080c7[_0x110f('0x48')][_0x110f('0x4b')]};if(_0x2080c7[_0x110f('0x48')][_0x110f('0x4c')]){_0x565d36[_0x110f('0x4c')]=_0x2080c7[_0x110f('0x48')]['MailAccountId'];}else if(_0x2080c7[_0x110f('0x48')][_0x110f('0x4d')]){_0x565d36[_0x110f('0x4d')]=_0x2080c7[_0x110f('0x48')]['SmsAccountId'];}else if(_0x2080c7[_0x110f('0x48')][_0x110f('0x4e')]){_0x565d36[_0x110f('0x4e')]=_0x2080c7['body']['OpenchannelAccountId'];}else if(_0x2080c7[_0x110f('0x48')][_0x110f('0x4f')]){_0x565d36['ChatWebsiteId']=_0x2080c7['body'][_0x110f('0x4f')];}return db[_0x110f('0x2d')]['find']({'where':_0x565d36})['then'](function(_0x205100){if(_0x205100){throw new db[(_0x110f('0x50'))][(_0x110f('0x51'))](_0x110f('0x52'));}return db[_0x110f('0x2d')][_0x110f('0x4a')](_0x2080c7[_0x110f('0x48')]);})[_0x110f('0x27')](function(_0x3156c2){var _0x116065=_0x2080c7['user'][_0x110f('0x28')]({'plain':!![]});if(!_0x116065)throw new Error(_0x110f('0x53'));if(_0x116065[_0x110f('0x54')]===_0x110f('0x55')){var _0x44d50f=_0x3156c2[_0x110f('0x28')]({'plain':!![]});return db[_0x110f('0x56')][_0x110f('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x116065[_0x110f('0x57')]},'raw':!![]})[_0x110f('0x27')](function(_0x3476d5){if(_0x3476d5&&_0x3476d5[_0x110f('0x58')]===0x0){return db[_0x110f('0x59')][_0x110f('0x4a')]({'name':_0x44d50f[_0x110f('0x2c')],'resourceId':_0x44d50f['id'],'type':_0x3476d5[_0x110f('0x2c')],'sectionId':_0x3476d5['id']},{})[_0x110f('0x27')](function(){return _0x3156c2;});}else{return _0x3156c2;}})['catch'](function(_0x261fc1){logger[_0x110f('0x2a')](_0x110f('0x5a'),_0x261fc1);throw _0x261fc1;});}return _0x3156c2;})['then'](respondWithResult(_0x3a62bd,0xc9))[_0x110f('0x44')](handleError(_0x3a62bd,null));}; \ No newline at end of file +var _0xf94e=['model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','keys','length','find','catch','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','CannedAnswers','UserProfileResource','end','stack','name','index','fieldName','type','key'];(function(_0x3ee2cd,_0x517ad4){var _0x36d7ff=function(_0x140aab){while(--_0x140aab){_0x3ee2cd['push'](_0x3ee2cd['shift']());}};_0x36d7ff(++_0x517ad4);}(_0xf94e,0x7b));var _0xef94=function(_0x5655e8,_0x1a8839){_0x5655e8=_0x5655e8-0x0;var _0x203ac2=_0xf94e[_0x5655e8];return _0x203ac2;};'use strict';var emlformat=require(_0xef94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef94('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef94('0x2'));var BPromise=require(_0xef94('0x3'));var Mustache=require('mustache');var util=require(_0xef94('0x4'));var path=require(_0xef94('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xef94('0x6'));var fs=require('fs');var fs_extra=require(_0xef94('0x7'));var _=require(_0xef94('0x8'));var squel=require(_0xef94('0x9'));var crypto=require(_0xef94('0xa'));var jsforce=require(_0xef94('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xef94('0xc'));var querystring=require(_0xef94('0xd'));var Papa=require(_0xef94('0xe'));var Redis=require(_0xef94('0xf'));var authService=require(_0xef94('0x10'));var qs=require(_0xef94('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef94('0x12'));var logger=require(_0xef94('0x13'))(_0xef94('0x14'));var utils=require(_0xef94('0x15'));var config=require(_0xef94('0x16'));var licenseUtil=require(_0xef94('0x17'));var db=require(_0xef94('0x18'))['db'];function respondWithStatusCode(_0x51007f,_0x1fe0a6){_0x1fe0a6=_0x1fe0a6||0xcc;return function(_0x79744d){if(_0x79744d){return _0x51007f[_0xef94('0x19')](_0x1fe0a6);}return _0x51007f[_0xef94('0x1a')](_0x1fe0a6)['end']();};}function respondWithResult(_0xcba157,_0xdc5805){_0xdc5805=_0xdc5805||0xc8;return function(_0x30e319){if(_0x30e319){return _0xcba157['status'](_0xdc5805)['json'](_0x30e319);}};}function respondWithFilteredResult(_0xf40936,_0x125003){return function(_0x117d79){if(_0x117d79){var _0x3080b5=typeof _0x125003['offset']==='undefined'&&typeof _0x125003[_0xef94('0x1b')]==='undefined';var _0x103bdf=_0x117d79[_0xef94('0x1c')];var _0x182229=_0x3080b5?0x0:_0x125003[_0xef94('0x1d')];var _0xa14367=_0x3080b5?_0x117d79[_0xef94('0x1c')]:_0x125003['offset']+_0x125003[_0xef94('0x1b')];var _0x52eb22;if(_0xa14367>=_0x103bdf){_0xa14367=_0x103bdf;_0x52eb22=0xc8;}else{_0x52eb22=0xce;}_0xf40936[_0xef94('0x1a')](_0x52eb22);return _0xf40936[_0xef94('0x1e')](_0xef94('0x1f'),_0x182229+'-'+_0xa14367+'/'+_0x103bdf)[_0xef94('0x20')](_0x117d79);}return null;};}function patchUpdates(_0xa0205b){return function(_0x44fa2b){try{jsonpatch[_0xef94('0x21')](_0x44fa2b,_0xa0205b,!![]);}catch(_0x4555b1){return BPromise['reject'](_0x4555b1);}return _0x44fa2b[_0xef94('0x22')]();};}function saveUpdates(_0x28f4a3,_0x1d6df8){return function(_0x3fa016){if(_0x3fa016){return _0x3fa016[_0xef94('0x23')](_0x28f4a3)[_0xef94('0x24')](function(_0x3239da){return _0x3239da;});}return null;};}function removeEntity(_0x5146dd,_0x17ff5b){return function(_0x15c586){if(_0x15c586){return _0x15c586[_0xef94('0x25')]()['then'](function(){var _0x1347a3=_0x15c586['get']({'plain':!![]});var _0x313875=_0xef94('0x26');return db[_0xef94('0x27')]['destroy']({'where':{'type':_0x313875,'resourceId':_0x1347a3['id']}})[_0xef94('0x24')](function(){return _0x15c586;});})['then'](function(){_0x5146dd[_0xef94('0x1a')](0xcc)[_0xef94('0x28')]();});}};}function handleEntityNotFound(_0x9efec9,_0x51a36a){return function(_0x4f70b9){if(!_0x4f70b9){_0x9efec9['sendStatus'](0x194);}return _0x4f70b9;};}function handleError(_0x1fdbc6,_0x5cbddb){_0x5cbddb=_0x5cbddb||0x1f4;return function(_0x5ac085){logger['error'](_0x5ac085[_0xef94('0x29')]);if(_0x5ac085[_0xef94('0x2a')]){delete _0x5ac085[_0xef94('0x2a')];}_0x1fdbc6['status'](_0x5cbddb)['send'](_0x5ac085);};}exports[_0xef94('0x2b')]=function(_0x20b298,_0x18c6fa){var _0x157eef={},_0x26e6ba={},_0x169174={'count':0x0,'rows':[]};var _0x6aa9c9=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x9321da){return{'name':_0x9321da[_0xef94('0x2c')],'type':_0x9321da[_0xef94('0x2d')][_0xef94('0x2e')]};});_0x26e6ba[_0xef94('0x2f')]=_[_0xef94('0x30')](_0x6aa9c9,_0xef94('0x2a'));_0x26e6ba[_0xef94('0x31')]=_['keys'](_0x20b298[_0xef94('0x31')]);_0x26e6ba[_0xef94('0x32')]=_[_0xef94('0x33')](_0x26e6ba[_0xef94('0x2f')],_0x26e6ba[_0xef94('0x31')]);_0x157eef[_0xef94('0x34')]=_[_0xef94('0x33')](_0x26e6ba[_0xef94('0x2f')],qs[_0xef94('0x35')](_0x20b298['query'][_0xef94('0x35')]));_0x157eef['attributes']=_0x157eef[_0xef94('0x34')]['length']?_0x157eef[_0xef94('0x34')]:_0x26e6ba[_0xef94('0x2f')];if(!_0x20b298[_0xef94('0x31')][_0xef94('0x36')](_0xef94('0x37'))){_0x157eef[_0xef94('0x1b')]=qs[_0xef94('0x1b')](_0x20b298[_0xef94('0x31')]['limit']);_0x157eef[_0xef94('0x1d')]=qs['offset'](_0x20b298[_0xef94('0x31')]['offset']);}_0x157eef['order']=qs[_0xef94('0x38')](_0x20b298[_0xef94('0x31')][_0xef94('0x38')]);_0x157eef[_0xef94('0x39')]=qs[_0xef94('0x32')](_['pick'](_0x20b298[_0xef94('0x31')],_0x26e6ba['filters']),_0x6aa9c9);if(_0x20b298[_0xef94('0x31')][_0xef94('0x3a')]){_0x157eef[_0xef94('0x39')]=_[_0xef94('0x3b')](_0x157eef['where'],{'$or':[{'key':{'$like':'%'+_0x20b298[_0xef94('0x31')][_0xef94('0x3a')]+'%'}},{'value':{'$like':'%'+_0x20b298[_0xef94('0x31')][_0xef94('0x3a')]+'%'}}]});}_0x157eef=_[_0xef94('0x3b')]({},_0x157eef,_0x20b298[_0xef94('0x3c')]);var _0x11c379={'where':_0x157eef[_0xef94('0x39')]};return db[_0xef94('0x3d')][_0xef94('0x1c')](_0x11c379)[_0xef94('0x24')](function(_0x51dfe1){_0x169174[_0xef94('0x1c')]=_0x51dfe1;if(_0x20b298[_0xef94('0x31')][_0xef94('0x3e')]){_0x157eef[_0xef94('0x3f')]=[{'all':!![]}];}return db['CannedAnswer'][_0xef94('0x40')](_0x157eef);})[_0xef94('0x24')](function(_0x240ac9){_0x169174[_0xef94('0x41')]=_0x240ac9;return _0x169174;})[_0xef94('0x24')](respondWithFilteredResult(_0x18c6fa,_0x157eef))['catch'](handleError(_0x18c6fa,null));};exports[_0xef94('0x42')]=function(_0x552938,_0x19d29e){var _0xa7e7f8={'raw':!![],'where':{'id':_0x552938['params']['id']}},_0x1f498d={};_0x1f498d[_0xef94('0x2f')]=_[_0xef94('0x43')](db[_0xef94('0x3d')]['rawAttributes']);_0x1f498d[_0xef94('0x31')]=_[_0xef94('0x43')](_0x552938[_0xef94('0x31')]);_0x1f498d['filters']=_[_0xef94('0x33')](_0x1f498d[_0xef94('0x2f')],_0x1f498d[_0xef94('0x31')]);_0xa7e7f8['attributes']=_[_0xef94('0x33')](_0x1f498d[_0xef94('0x2f')],qs[_0xef94('0x35')](_0x552938[_0xef94('0x31')][_0xef94('0x35')]));_0xa7e7f8[_0xef94('0x34')]=_0xa7e7f8[_0xef94('0x34')][_0xef94('0x44')]?_0xa7e7f8[_0xef94('0x34')]:_0x1f498d[_0xef94('0x2f')];if(_0x552938[_0xef94('0x31')][_0xef94('0x3e')]){_0xa7e7f8[_0xef94('0x3f')]=[{'all':!![]}];}_0xa7e7f8=_[_0xef94('0x3b')]({},_0xa7e7f8,_0x552938[_0xef94('0x3c')]);return db[_0xef94('0x3d')][_0xef94('0x45')](_0xa7e7f8)[_0xef94('0x24')](handleEntityNotFound(_0x19d29e,null))[_0xef94('0x24')](respondWithResult(_0x19d29e,null))[_0xef94('0x46')](handleError(_0x19d29e,null));};exports[_0xef94('0x23')]=function(_0x137449,_0x22f274){if(_0x137449[_0xef94('0x47')]['id']){delete _0x137449[_0xef94('0x47')]['id'];}return db[_0xef94('0x3d')][_0xef94('0x45')]({'where':{'id':_0x137449[_0xef94('0x48')]['id']}})[_0xef94('0x24')](handleEntityNotFound(_0x22f274,null))['then'](saveUpdates(_0x137449[_0xef94('0x47')],null))[_0xef94('0x24')](respondWithResult(_0x22f274,null))[_0xef94('0x46')](handleError(_0x22f274,null));};exports['destroy']=function(_0x322957,_0x1a000f){return db[_0xef94('0x3d')][_0xef94('0x45')]({'where':{'id':_0x322957['params']['id']}})[_0xef94('0x24')](handleEntityNotFound(_0x1a000f,null))[_0xef94('0x24')](removeEntity(_0x1a000f,null))[_0xef94('0x46')](handleError(_0x1a000f,null));};exports[_0xef94('0x49')]=function(_0x457bec,_0x2e4feb){var _0x45a7af={'key':_0x457bec[_0xef94('0x47')][_0xef94('0x2e')]};if(_0x457bec[_0xef94('0x47')][_0xef94('0x4a')]){_0x45a7af[_0xef94('0x4a')]=_0x457bec[_0xef94('0x47')][_0xef94('0x4a')];}else if(_0x457bec[_0xef94('0x47')]['SmsAccountId']){_0x45a7af[_0xef94('0x4b')]=_0x457bec[_0xef94('0x47')][_0xef94('0x4b')];}else if(_0x457bec['body'][_0xef94('0x4c')]){_0x45a7af['OpenchannelAccountId']=_0x457bec['body'][_0xef94('0x4c')];}else if(_0x457bec[_0xef94('0x47')][_0xef94('0x4d')]){_0x45a7af[_0xef94('0x4d')]=_0x457bec[_0xef94('0x47')][_0xef94('0x4d')];}return db['CannedAnswer']['find']({'where':_0x45a7af})['then'](function(_0xfcb05f){if(_0xfcb05f){throw new db[(_0xef94('0x4e'))][(_0xef94('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xef94('0x3d')][_0xef94('0x49')](_0x457bec[_0xef94('0x47')]);})['then'](function(_0x5d03ff){var _0x19b36c=_0x457bec['user'][_0xef94('0x50')]({'plain':!![]});if(!_0x19b36c)throw new Error(_0xef94('0x51'));if(_0x19b36c['role']===_0xef94('0x52')){var _0x242a39=_0x5d03ff[_0xef94('0x50')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x19b36c[_0xef94('0x53')]},'raw':!![]})[_0xef94('0x24')](function(_0x2274d1){if(_0x2274d1&&_0x2274d1['autoAssociation']===0x0){return db[_0xef94('0x27')][_0xef94('0x49')]({'name':_0x242a39[_0xef94('0x2a')],'resourceId':_0x242a39['id'],'type':_0x2274d1['name'],'sectionId':_0x2274d1['id']},{})[_0xef94('0x24')](function(){return _0x5d03ff;});}else{return _0x5d03ff;}})[_0xef94('0x46')](function(_0xb73cfb){logger['error'](_0xef94('0x54'),_0xb73cfb);throw _0xb73cfb;});}return _0x5d03ff;})[_0xef94('0x24')](respondWithResult(_0x2e4feb,0xc9))[_0xef94('0x46')](handleError(_0x2e4feb,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 6a27ae0..b02b8d2 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 _0xb3b8=['util','../../config/logger','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0xaceae2,_0x244666){var _0x1f2aab=function(_0x439090){while(--_0x439090){_0xaceae2['push'](_0xaceae2['shift']());}};_0x1f2aab(++_0x244666);}(_0xb3b8,0x108));var _0x8b3b=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xb3b8[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require(_0x8b3b('0x0'));var logger=require(_0x8b3b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8b3b('0x2'));var fs=require('fs');var path=require(_0x8b3b('0x3'));var rimraf=require('rimraf');var config=require(_0x8b3b('0x4'));var attributes=require(_0x8b3b('0x5'));module[_0x8b3b('0x6')]=function(_0x6edd45,_0x3cb6d6){return _0x6edd45['define'](_0x8b3b('0x7'),attributes,{'tableName':_0x8b3b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b3b('0x9'),'collate':_0x8b3b('0xa')});}; \ No newline at end of file +var _0x22e7=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22e7,0x9d));var _0x722e=function(_0x4b3151,_0x4784a4){_0x4b3151=_0x4b3151-0x0;var _0x462098=_0x22e7[_0x4b3151];return _0x462098;};'use strict';var _=require(_0x722e('0x0'));var util=require(_0x722e('0x1'));var logger=require(_0x722e('0x2'))(_0x722e('0x3'));var moment=require(_0x722e('0x4'));var BPromise=require('bluebird');var rp=require(_0x722e('0x5'));var fs=require('fs');var path=require(_0x722e('0x6'));var rimraf=require(_0x722e('0x7'));var config=require(_0x722e('0x8'));var attributes=require(_0x722e('0x9'));module[_0x722e('0xa')]=function(_0x4cc195,_0x52542e){return _0x4cc195[_0x722e('0xb')](_0x722e('0xc'),attributes,{'tableName':_0x722e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x722e('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 47f0e6f..e105bb9 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(_0x550c8e,_0x3539df){var _0x38a23e=function(_0x504aed){while(--_0x504aed){_0x550c8e['push'](_0x550c8e['shift']());}};_0x38a23e(++_0x3539df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x11b902,_0x36b8f6){var _0x1788d5=function(_0xfe2112){while(--_0xfe2112){_0x11b902['push'](_0x11b902['shift']());}};_0x1788d5(++_0x36b8f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 64aedce..d1c61dc 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 _0x85b7=['destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','delete'];(function(_0xb75614,_0x44090e){var _0x4b11a3=function(_0x4fb785){while(--_0x4fb785){_0xb75614['push'](_0xb75614['shift']());}};_0x4b11a3(++_0x44090e);}(_0x85b7,0x132));var _0x785b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x85b7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x785b('0x0'));var timeout=require(_0x785b('0x1'));var express=require('express');var router=express[_0x785b('0x2')]();var fs_extra=require(_0x785b('0x3'));var auth=require(_0x785b('0x4'));var interaction=require(_0x785b('0x5'));var config=require('../../config/environment');var controller=require(_0x785b('0x6'));router[_0x785b('0x7')]('/',auth[_0x785b('0x8')](),controller[_0x785b('0x9')]);router[_0x785b('0x7')](_0x785b('0xa'),auth[_0x785b('0x8')](),controller['show']);router[_0x785b('0xb')]('/',auth[_0x785b('0x8')](),controller[_0x785b('0xc')]);router['put']('/:id',auth[_0x785b('0x8')](),controller['update']);router[_0x785b('0xd')](_0x785b('0xa'),auth[_0x785b('0x8')](),controller[_0x785b('0xe')]);module[_0x785b('0xf')]=router; \ No newline at end of file +var _0x4976=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x4976,0x1be));var _0x6497=function(_0x4dfa9b,_0x4b0127){_0x4dfa9b=_0x4dfa9b-0x0;var _0x5eb93d=_0x4976[_0x4dfa9b];return _0x5eb93d;};'use strict';var multer=require(_0x6497('0x0'));var util=require(_0x6497('0x1'));var path=require('path');var timeout=require(_0x6497('0x2'));var express=require(_0x6497('0x3'));var router=express['Router']();var fs_extra=require(_0x6497('0x4'));var auth=require(_0x6497('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6497('0x6'));var controller=require('./cannedAnswer.controller');router[_0x6497('0x7')]('/',auth[_0x6497('0x8')](),controller['index']);router[_0x6497('0x7')](_0x6497('0x9'),auth['isAuthenticated'](),controller[_0x6497('0xa')]);router[_0x6497('0xb')]('/',auth[_0x6497('0x8')](),controller[_0x6497('0xc')]);router[_0x6497('0xd')](_0x6497('0x9'),auth[_0x6497('0x8')](),controller['update']);router[_0x6497('0xe')](_0x6497('0x9'),auth[_0x6497('0x8')](),controller[_0x6497('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 190515d..8012dc3 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 _0xa6e2=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xa6e2,0x132));var _0x2a6e=function(_0x43efab,_0x13954a){_0x43efab=_0x43efab-0x0;var _0x57d0e9=_0xa6e2[_0x43efab];return _0x57d0e9;};'use strict';var Sequelize=require(_0x2a6e('0x0'));module[_0x2a6e('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x2a6e('0x2')},'clid':{'type':Sequelize[_0x2a6e('0x3')]},'src':{'type':Sequelize[_0x2a6e('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2a6e('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x2a6e('0x3')]},'duration':{'type':Sequelize[_0x2a6e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2a6e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2a6e('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2a6e('0x3')]},'userfield':{'type':Sequelize[_0x2a6e('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x2a6e('0x3')]},'sequence':{'type':Sequelize[_0x2a6e('0x3')]},'peeraccount':{'type':Sequelize[_0x2a6e('0x3')]},'type':{'type':Sequelize[_0x2a6e('0x3')]},'tag':{'type':Sequelize[_0x2a6e('0x3')]}}; \ No newline at end of file +var _0x867f=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x5d983c,_0x57b322){var _0x45d2f8=function(_0x4fb48d){while(--_0x4fb48d){_0x5d983c['push'](_0x5d983c['shift']());}};_0x45d2f8(++_0x57b322);}(_0x867f,0xe6));var _0xf867=function(_0x6c225b,_0x4de56c){_0x6c225b=_0x6c225b-0x0;var _0x268839=_0x867f[_0x6c225b];return _0x268839;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'calldate':{'type':Sequelize[_0xf867('0x2')],'allowNull':![],'defaultValue':_0xf867('0x3')},'clid':{'type':Sequelize[_0xf867('0x4')]},'src':{'type':Sequelize[_0xf867('0x4')]},'dst':{'type':Sequelize[_0xf867('0x4')]},'dcontext':{'type':Sequelize[_0xf867('0x4')]},'channel':{'type':Sequelize[_0xf867('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf867('0x4')]},'duration':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf867('0x4')]},'amaflags':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf867('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xf867('0x4')]},'peeraccount':{'type':Sequelize[_0xf867('0x4')]},'type':{'type':Sequelize[_0xf867('0x4')]},'tag':{'type':Sequelize[_0xf867('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 128b6fe..fdacbd8 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','count','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','map','fieldName','type','key','name','query','keys'];(function(_0x459149,_0x5b88ae){var _0x5e2023=function(_0x555304){while(--_0x555304){_0x459149['push'](_0x459149['shift']());}};_0x5e2023(++_0x5b88ae);}(_0x3435,0xfa));var _0x5343=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x3435[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require(_0x5343('0x0'));var rimraf=require(_0x5343('0x1'));var zipdir=require(_0x5343('0x2'));var jsonpatch=require(_0x5343('0x3'));var rp=require(_0x5343('0x4'));var moment=require(_0x5343('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5343('0x6'));var util=require(_0x5343('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5343('0x8'));var ejs=require(_0x5343('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x8'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var licenseUtil=require(_0x5343('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ddeb7,_0x5f473f){_0x5f473f=_0x5f473f||0xcc;return function(_0x82074d){if(_0x82074d){return _0x2ddeb7[_0x5343('0x17')](_0x5f473f);}return _0x2ddeb7['status'](_0x5f473f)[_0x5343('0x18')]();};}function respondWithResult(_0x4cdfae,_0x13066f){_0x13066f=_0x13066f||0xc8;return function(_0x46c3d7){if(_0x46c3d7){return _0x4cdfae[_0x5343('0x19')](_0x13066f)[_0x5343('0x1a')](_0x46c3d7);}};}function respondWithFilteredResult(_0x4dbff1,_0x446e90){return function(_0x588a96){if(_0x588a96){var _0x1df724=typeof _0x446e90[_0x5343('0x1b')]===_0x5343('0x1c')&&typeof _0x446e90[_0x5343('0x1d')]===_0x5343('0x1c');var _0x4b5852=_0x588a96['count'];var _0x432992=_0x1df724?0x0:_0x446e90[_0x5343('0x1b')];var _0x1f5098=_0x1df724?_0x588a96['count']:_0x446e90[_0x5343('0x1b')]+_0x446e90[_0x5343('0x1d')];var _0x376c35;if(_0x1f5098>=_0x4b5852){_0x1f5098=_0x4b5852;_0x376c35=0xc8;}else{_0x376c35=0xce;}_0x4dbff1[_0x5343('0x19')](_0x376c35);return _0x4dbff1[_0x5343('0x1e')](_0x5343('0x1f'),_0x432992+'-'+_0x1f5098+'/'+_0x4b5852)[_0x5343('0x1a')](_0x588a96);}return null;};}function patchUpdates(_0x40ba38){return function(_0x35d41d){try{jsonpatch['apply'](_0x35d41d,_0x40ba38,!![]);}catch(_0x287304){return BPromise[_0x5343('0x20')](_0x287304);}return _0x35d41d[_0x5343('0x21')]();};}function saveUpdates(_0x42f92d,_0xd95a5b){return function(_0x4e7c0f){if(_0x4e7c0f){return _0x4e7c0f[_0x5343('0x22')](_0x42f92d)[_0x5343('0x23')](function(_0x24c250){return _0x24c250;});}return null;};}function removeEntity(_0x380aae,_0x290ce8){return function(_0x486597){if(_0x486597){return _0x486597[_0x5343('0x24')]()[_0x5343('0x23')](function(){_0x380aae['status'](0xcc)[_0x5343('0x18')]();});}};}function handleEntityNotFound(_0x96bbf6,_0x1ab5eb){return function(_0x5e4344){if(!_0x5e4344){_0x96bbf6['sendStatus'](0x194);}return _0x5e4344;};}function handleError(_0x462cb6,_0x5871de){_0x5871de=_0x5871de||0x1f4;return function(_0x14d05a){logger['error'](_0x14d05a[_0x5343('0x25')]);if(_0x14d05a['name']){delete _0x14d05a['name'];}_0x462cb6[_0x5343('0x19')](_0x5871de)[_0x5343('0x26')](_0x14d05a);};}exports['index']=function(_0x5d597e,_0x1202bb){var _0x5d0853={},_0x2ed8c9={},_0x47d49a={'count':0x0,'rows':[]};var _0x5c689e=_[_0x5343('0x27')](db['Cdr']['rawAttributes'],function(_0x125e4c){return{'name':_0x125e4c[_0x5343('0x28')],'type':_0x125e4c[_0x5343('0x29')][_0x5343('0x2a')]};});_0x2ed8c9['model']=_['map'](_0x5c689e,_0x5343('0x2b'));_0x2ed8c9[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x5d597e[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],_0x2ed8c9[_0x5343('0x2c')]);_0x5d0853[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],qs[_0x5343('0x32')](_0x5d597e['query']['fields']));_0x5d0853[_0x5343('0x31')]=_0x5d0853[_0x5343('0x31')]['length']?_0x5d0853[_0x5343('0x31')]:_0x2ed8c9['model'];if(!_0x5d597e[_0x5343('0x2c')][_0x5343('0x33')](_0x5343('0x34'))){_0x5d0853[_0x5343('0x1d')]=qs['limit'](_0x5d597e['query'][_0x5343('0x1d')]);_0x5d0853['offset']=qs[_0x5343('0x1b')](_0x5d597e[_0x5343('0x2c')]['offset']);}_0x5d0853[_0x5343('0x35')]=qs['sort'](_0x5d597e['query'][_0x5343('0x36')]);_0x5d0853[_0x5343('0x37')]=qs[_0x5343('0x2e')](_[_0x5343('0x38')](_0x5d597e['query'],_0x2ed8c9['filters']),_0x5c689e);if(_0x5d597e['query']['filter']){_0x5d0853[_0x5343('0x37')]=_[_0x5343('0x39')](_0x5d0853[_0x5343('0x37')],{'$or':_[_0x5343('0x27')](_0x5c689e,function(_0x3c517a){if(_0x3c517a[_0x5343('0x29')]!==_0x5343('0x3a')){var _0x4d2951={};_0x4d2951[_0x3c517a[_0x5343('0x2b')]]={'$like':'%'+_0x5d597e['query'][_0x5343('0x3b')]+'%'};return _0x4d2951;}})});}_0x5d0853=_[_0x5343('0x39')]({},_0x5d0853,_0x5d597e[_0x5343('0x3c')]);var _0x2f004a={'where':_0x5d0853[_0x5343('0x37')]};return db[_0x5343('0x3d')][_0x5343('0x3e')](_0x2f004a)['then'](function(_0xb93d9){_0x47d49a['count']=_0xb93d9;if(_0x5d597e[_0x5343('0x2c')][_0x5343('0x3f')]){_0x5d0853[_0x5343('0x40')]=[{'all':!![]}];}return db[_0x5343('0x3d')][_0x5343('0x41')](_0x5d0853);})[_0x5343('0x23')](function(_0x2c75bd){_0x47d49a['rows']=_0x2c75bd;return _0x47d49a;})[_0x5343('0x23')](respondWithFilteredResult(_0x1202bb,_0x5d0853))[_0x5343('0x42')](handleError(_0x1202bb,null));};exports['show']=function(_0x41df61,_0x16c880){var _0x4c576d={'raw':!![],'where':{'id':_0x41df61[_0x5343('0x43')]['id']}},_0x53c3c7={};_0x53c3c7[_0x5343('0x30')]=_[_0x5343('0x2d')](db['Cdr'][_0x5343('0x44')]);_0x53c3c7[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x41df61[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],_0x53c3c7['query']);_0x4c576d[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],qs[_0x5343('0x32')](_0x41df61[_0x5343('0x2c')][_0x5343('0x32')]));_0x4c576d[_0x5343('0x31')]=_0x4c576d[_0x5343('0x31')][_0x5343('0x45')]?_0x4c576d[_0x5343('0x31')]:_0x53c3c7[_0x5343('0x30')];if(_0x41df61[_0x5343('0x2c')][_0x5343('0x3f')]){_0x4c576d[_0x5343('0x40')]=[{'all':!![]}];}_0x4c576d=_[_0x5343('0x39')]({},_0x4c576d,_0x41df61['options']);return db[_0x5343('0x3d')][_0x5343('0x46')](_0x4c576d)['then'](handleEntityNotFound(_0x16c880,null))[_0x5343('0x23')](respondWithResult(_0x16c880,null))[_0x5343('0x42')](handleError(_0x16c880,null));};exports[_0x5343('0x47')]=function(_0x1da1b7,_0x194316){return db['Cdr'][_0x5343('0x47')](_0x1da1b7['body'],{})['then'](respondWithResult(_0x194316,0xc9))[_0x5343('0x42')](handleError(_0x194316,null));};exports[_0x5343('0x22')]=function(_0x10329c,_0x1cd4ed){if(_0x10329c['body']['id']){delete _0x10329c[_0x5343('0x48')]['id'];}return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x10329c[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x23')](saveUpdates(_0x10329c[_0x5343('0x48')],null))[_0x5343('0x23')](respondWithResult(_0x1cd4ed,null))[_0x5343('0x42')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x24')]=function(_0x566d71,_0x1cbf7c){return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x566d71[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cbf7c,null))[_0x5343('0x23')](removeEntity(_0x1cbf7c,null))[_0x5343('0x42')](handleError(_0x1cbf7c,null));};exports[_0x5343('0x49')]=function(_0x3b3c64,_0xad51f4){return db['Cdr'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));}; \ No newline at end of file +var _0x5ad3=['destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','Cdr','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then'];(function(_0x186196,_0x42e3c7){var _0xe69596=function(_0x420392){while(--_0x420392){_0x186196['push'](_0x186196['shift']());}};_0xe69596(++_0x42e3c7);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x1440ce,_0x136aee){_0x1440ce=_0x1440ce-0x0;var _0x389c35=_0x5ad3[_0x1440ce];return _0x389c35;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={},_0x2c82f1={},_0x481803={'count':0x0,'rows':[]};var _0x571ad6=_[_0x35ad('0x29')](db['Cdr'][_0x35ad('0x2a')],function(_0x4ccaea){return{'name':_0x4ccaea['fieldName'],'type':_0x4ccaea['type']['key']};});_0x2c82f1[_0x35ad('0x2b')]=_['map'](_0x571ad6,'name');_0x2c82f1[_0x35ad('0x2c')]=_['keys'](_0x11da54[_0x35ad('0x2c')]);_0x2c82f1['filters']=_[_0x35ad('0x2d')](_0x2c82f1['model'],_0x2c82f1[_0x35ad('0x2c')]);_0x34b8b9['attributes']=_[_0x35ad('0x2d')](_0x2c82f1[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x11da54['query'][_0x35ad('0x2e')]));_0x34b8b9[_0x35ad('0x2f')]=_0x34b8b9[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x34b8b9[_0x35ad('0x2f')]:_0x2c82f1['model'];if(!_0x11da54['query'][_0x35ad('0x31')](_0x35ad('0x32'))){_0x34b8b9[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x11da54['query'][_0x35ad('0x1d')]);_0x34b8b9[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x11da54[_0x35ad('0x2c')][_0x35ad('0x1a')]);}_0x34b8b9[_0x35ad('0x33')]=qs['sort'](_0x11da54['query'][_0x35ad('0x34')]);_0x34b8b9[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_[_0x35ad('0x37')](_0x11da54[_0x35ad('0x2c')],_0x2c82f1[_0x35ad('0x36')]),_0x571ad6);if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x34b8b9[_0x35ad('0x35')]=_['merge'](_0x34b8b9[_0x35ad('0x35')],{'$or':_['map'](_0x571ad6,function(_0x25e63e){if(_0x25e63e[_0x35ad('0x39')]!==_0x35ad('0x3a')){var _0x38d1c9={};_0x38d1c9[_0x25e63e[_0x35ad('0x27')]]={'$like':'%'+_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]+'%'};return _0x38d1c9;}})});}_0x34b8b9=_[_0x35ad('0x3b')]({},_0x34b8b9,_0x11da54[_0x35ad('0x3c')]);var _0x5dd327={'where':_0x34b8b9[_0x35ad('0x35')]};return db[_0x35ad('0x3d')][_0x35ad('0x1c')](_0x5dd327)['then'](function(_0x19d82d){_0x481803[_0x35ad('0x1c')]=_0x19d82d;if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x34b8b9[_0x35ad('0x3f')]=[{'all':!![]}];}return db[_0x35ad('0x3d')][_0x35ad('0x40')](_0x34b8b9);})[_0x35ad('0x23')](function(_0x11de09){_0x481803[_0x35ad('0x41')]=_0x11de09;return _0x481803;})[_0x35ad('0x23')](respondWithFilteredResult(_0x2f8b3,_0x34b8b9))['catch'](handleError(_0x2f8b3,null));};exports[_0x35ad('0x42')]=function(_0x4edc2b,_0x3de722){var _0x3b80c0={'raw':!![],'where':{'id':_0x4edc2b[_0x35ad('0x43')]['id']}},_0x3df623={};_0x3df623[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x3d')][_0x35ad('0x2a')]);_0x3df623[_0x35ad('0x2c')]=_['keys'](_0x4edc2b[_0x35ad('0x2c')]);_0x3df623[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],_0x3df623[_0x35ad('0x2c')]);_0x3b80c0['attributes']=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],qs['fields'](_0x4edc2b['query'][_0x35ad('0x2e')]));_0x3b80c0[_0x35ad('0x2f')]=_0x3b80c0[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x3b80c0['attributes']:_0x3df623[_0x35ad('0x2b')];if(_0x4edc2b[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x3b80c0[_0x35ad('0x3f')]=[{'all':!![]}];}_0x3b80c0=_[_0x35ad('0x3b')]({},_0x3b80c0,_0x4edc2b[_0x35ad('0x3c')]);return db[_0x35ad('0x3d')]['find'](_0x3b80c0)[_0x35ad('0x23')](handleEntityNotFound(_0x3de722,null))[_0x35ad('0x23')](respondWithResult(_0x3de722,null))[_0x35ad('0x45')](handleError(_0x3de722,null));};exports['create']=function(_0x5e3f96,_0x5644c4){return db[_0x35ad('0x3d')][_0x35ad('0x46')](_0x5e3f96[_0x35ad('0x47')],{})[_0x35ad('0x23')](respondWithResult(_0x5644c4,0xc9))['catch'](handleError(_0x5644c4,null));};exports[_0x35ad('0x22')]=function(_0x46c462,_0x3583ca){if(_0x46c462[_0x35ad('0x47')]['id']){delete _0x46c462[_0x35ad('0x47')]['id'];}return db[_0x35ad('0x3d')]['find']({'where':{'id':_0x46c462['params']['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3583ca,null))[_0x35ad('0x23')](saveUpdates(_0x46c462['body'],null))['then'](respondWithResult(_0x3583ca,null))[_0x35ad('0x45')](handleError(_0x3583ca,null));};exports[_0x35ad('0x24')]=function(_0x196ebd,_0x5c7dbd){return db['Cdr'][_0x35ad('0x48')]({'where':{'id':_0x196ebd[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x5c7dbd,null))['then'](removeEntity(_0x5c7dbd,null))[_0x35ad('0x45')](handleError(_0x5c7dbd,null));};exports[_0x35ad('0x49')]=function(_0x34061c,_0x467887){return db[_0x35ad('0x3d')][_0x35ad('0x49')]()['then'](respondWithResult(_0x467887,null))[_0x35ad('0x45')](handleError(_0x467887,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 769928e..9b0589b 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(_0x277763,_0x4b683c){var _0x10e5cd=function(_0x3f3bf9){while(--_0x3f3bf9){_0x277763['push'](_0x277763['shift']());}};_0x10e5cd(++_0x4b683c);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed680,_0x4b501e){_0x1ed680=_0x1ed680-0x0;var _0x24187f=_0x7a54[_0x1ed680];return _0x24187f;};'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(_0x450891,_0x1729fb){var _0x3e9a7a=function(_0x2fcaf0){while(--_0x2fcaf0){_0x450891['push'](_0x450891['shift']());}};_0x3e9a7a(++_0x1729fb);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 1e7dbc0..a15c903 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 _0xe9e0=['request','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','Cdr,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x343a14,_0xba64bc){var _0x114335=function(_0x2a2c9f){while(--_0x2a2c9f){_0x343a14['push'](_0x343a14['shift']());}};_0x114335(++_0xba64bc);}(_0xe9e0,0x94));var _0x0e9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e9e('0x0'));var util=require('util');var moment=require(_0x0e9e('0x1'));var BPromise=require(_0x0e9e('0x2'));var rs=require(_0x0e9e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e9e('0x4'))['db'];var utils=require(_0x0e9e('0x5'));var logger=require(_0x0e9e('0x6'))(_0x0e9e('0x7'));var config=require(_0x0e9e('0x8'));var jayson=require(_0x0e9e('0x9'));var client=jayson[_0x0e9e('0xa')][_0x0e9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x170b98,_0xc74bde,_0x13e861){return new BPromise(function(_0x758eb9,_0x1048da){return client[_0x0e9e('0xc')](_0x170b98,_0x13e861)['then'](function(_0x271bf6){logger['info']('Cdr,\x20%s,\x20%s',_0xc74bde,'request\x20sent');logger[_0x0e9e('0xd')](_0x0e9e('0xe'),_0xc74bde,_0x0e9e('0xf'),JSON['stringify'](_0x271bf6));if(_0x271bf6['error']){if(_0x271bf6[_0x0e9e('0x10')]['code']===0x1f4){logger[_0x0e9e('0x10')](_0x0e9e('0x11'),_0xc74bde,_0x271bf6[_0x0e9e('0x10')][_0x0e9e('0x12')]);return _0x1048da(_0x271bf6[_0x0e9e('0x10')][_0x0e9e('0x12')]);}logger['error'](_0x0e9e('0x11'),_0xc74bde,_0x271bf6[_0x0e9e('0x10')]['message']);return _0x758eb9(_0x271bf6[_0x0e9e('0x10')][_0x0e9e('0x12')]);}else{logger[_0x0e9e('0x13')](_0x0e9e('0x11'),_0xc74bde,_0x0e9e('0xf'));_0x758eb9(_0x271bf6['result']['message']);}})['catch'](function(_0x13ec6b){logger['error'](_0x0e9e('0x11'),_0xc74bde,_0x13ec6b);_0x1048da(_0x13ec6b);});});} \ No newline at end of file +var _0xca89=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x13190e,_0x4313c8){var _0x55b923=function(_0x4757c8){while(--_0x4757c8){_0x13190e['push'](_0x13190e['shift']());}};_0x55b923(++_0x4313c8);}(_0xca89,0x166));var _0x9ca8=function(_0x25cbba,_0x549cc9){_0x25cbba=_0x25cbba-0x0;var _0x28d81e=_0xca89[_0x25cbba];return _0x28d81e;};'use strict';var _=require(_0x9ca8('0x0'));var util=require(_0x9ca8('0x1'));var moment=require(_0x9ca8('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ca8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ca8('0x4'))['db'];var utils=require(_0x9ca8('0x5'));var logger=require(_0x9ca8('0x6'))('rpc');var config=require(_0x9ca8('0x7'));var jayson=require(_0x9ca8('0x8'));var client=jayson[_0x9ca8('0x9')][_0x9ca8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38a0e2,_0x4d1aec,_0x361e08){return new BPromise(function(_0x5e6b25,_0x519ba5){return client[_0x9ca8('0xb')](_0x38a0e2,_0x361e08)[_0x9ca8('0xc')](function(_0x1b1348){logger['info'](_0x9ca8('0xd'),_0x4d1aec,_0x9ca8('0xe'));logger[_0x9ca8('0xf')](_0x9ca8('0x10'),_0x4d1aec,_0x9ca8('0xe'),JSON['stringify'](_0x1b1348));if(_0x1b1348[_0x9ca8('0x11')]){if(_0x1b1348[_0x9ca8('0x11')]['code']===0x1f4){logger[_0x9ca8('0x11')](_0x9ca8('0xd'),_0x4d1aec,_0x1b1348[_0x9ca8('0x11')][_0x9ca8('0x12')]);return _0x519ba5(_0x1b1348['error'][_0x9ca8('0x12')]);}logger[_0x9ca8('0x11')]('Cdr,\x20%s,\x20%s',_0x4d1aec,_0x1b1348[_0x9ca8('0x11')]['message']);return _0x5e6b25(_0x1b1348['error'][_0x9ca8('0x12')]);}else{logger[_0x9ca8('0x13')]('Cdr,\x20%s,\x20%s',_0x4d1aec,_0x9ca8('0xe'));_0x5e6b25(_0x1b1348['result'][_0x9ca8('0x12')]);}})[_0x9ca8('0x14')](function(_0x430e27){logger['error'](_0x9ca8('0xd'),_0x4d1aec,_0x430e27);_0x519ba5(_0x430e27);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 63fb1d0..6d10ace 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _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(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_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['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 0387913..1462fb6 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 _0x8913=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x81707f,_0x4c10d0){var _0x311e6c=function(_0xc0b00){while(--_0xc0b00){_0x81707f['push'](_0x81707f['shift']());}};_0x311e6c(++_0x4c10d0);}(_0x8913,0x7f));var _0x3891=function(_0x1605e1,_0x3f4128){_0x1605e1=_0x1605e1-0x0;var _0x543337=_0x8913[_0x1605e1];return _0x543337;};'use strict';var Sequelize=require(_0x3891('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3891('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3891('0x2')],'allowNull':![],'defaultValue':_0x3891('0x3')},'appdata':{'type':Sequelize[_0x3891('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3891('0x2')],'defaultValue':_0x3891('0x5')}}; \ No newline at end of file +var _0x4417=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x54f6f6,_0x467501){var _0x194d4c=function(_0x803b99){while(--_0x803b99){_0x54f6f6['push'](_0x54f6f6['shift']());}};_0x194d4c(++_0x467501);}(_0x4417,0xd7));var _0x7441=function(_0x207d50,_0x52c08d){_0x207d50=_0x207d50-0x0;var _0x1c47e2=_0x4417[_0x207d50];return _0x1c47e2;};'use strict';var Sequelize=require(_0x7441('0x0'));module[_0x7441('0x1')]={'priority':{'type':Sequelize[_0x7441('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7441('0x3')],'allowNull':![],'defaultValue':_0x7441('0x4')},'appdata':{'type':Sequelize[_0x7441('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7441('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index f1f57a9..0ee3b79 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 _0x1bd1=['then','destroy','name','send','show','params','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','include','merge','find','update','body','catch','eml-format','rimraf','zip-dir','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../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','undefined','limit','count','apply','reject'];(function(_0x1346cb,_0xfd2ab3){var _0x4b1f6c=function(_0x2ec719){while(--_0x2ec719){_0x1346cb['push'](_0x1346cb['shift']());}};_0x4b1f6c(++_0xfd2ab3);}(_0x1bd1,0x123));var _0x11bd=function(_0x101e4f,_0x2b5285){_0x101e4f=_0x101e4f-0x0;var _0x418a07=_0x1bd1[_0x101e4f];return _0x418a07;};'use strict';var emlformat=require(_0x11bd('0x0'));var rimraf=require(_0x11bd('0x1'));var zipdir=require(_0x11bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11bd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x11bd('0x4'));var sox=require(_0x11bd('0x5'));var csv=require(_0x11bd('0x6'));var ejs=require(_0x11bd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11bd('0x8'));var squel=require(_0x11bd('0x9'));var crypto=require(_0x11bd('0xa'));var jsforce=require(_0x11bd('0xb'));var deskjs=require(_0x11bd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x11bd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x11bd('0xe'));var qs=require(_0x11bd('0xf'));var as=require(_0x11bd('0x10'));var hardwareService=require(_0x11bd('0x11'));var logger=require(_0x11bd('0x12'))(_0x11bd('0x13'));var utils=require(_0x11bd('0x14'));var config=require(_0x11bd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x11bd('0x16'))['db'];function respondWithStatusCode(_0x1afe14,_0x2ceee2){_0x2ceee2=_0x2ceee2||0xcc;return function(_0x39b6b9){if(_0x39b6b9){return _0x1afe14[_0x11bd('0x17')](_0x2ceee2);}return _0x1afe14[_0x11bd('0x18')](_0x2ceee2)[_0x11bd('0x19')]();};}function respondWithResult(_0x4d6ebe,_0x5e4cc4){_0x5e4cc4=_0x5e4cc4||0xc8;return function(_0x1c832b){if(_0x1c832b){return _0x4d6ebe[_0x11bd('0x18')](_0x5e4cc4)[_0x11bd('0x1a')](_0x1c832b);}};}function respondWithFilteredResult(_0x5ca6bb,_0x384144){return function(_0x5b78cc){if(_0x5b78cc){var _0x59978e=typeof _0x384144[_0x11bd('0x1b')]===_0x11bd('0x1c')&&typeof _0x384144[_0x11bd('0x1d')]===_0x11bd('0x1c');var _0xd04657=_0x5b78cc['count'];var _0x904980=_0x59978e?0x0:_0x384144[_0x11bd('0x1b')];var _0x39de22=_0x59978e?_0x5b78cc[_0x11bd('0x1e')]:_0x384144[_0x11bd('0x1b')]+_0x384144[_0x11bd('0x1d')];var _0xd2ca8a;if(_0x39de22>=_0xd04657){_0x39de22=_0xd04657;_0xd2ca8a=0xc8;}else{_0xd2ca8a=0xce;}_0x5ca6bb[_0x11bd('0x18')](_0xd2ca8a);return _0x5ca6bb['set']('Content-Range',_0x904980+'-'+_0x39de22+'/'+_0xd04657)[_0x11bd('0x1a')](_0x5b78cc);}return null;};}function patchUpdates(_0x232811){return function(_0x19176e){try{jsonpatch[_0x11bd('0x1f')](_0x19176e,_0x232811,!![]);}catch(_0x5d0f2b){return BPromise[_0x11bd('0x20')](_0x5d0f2b);}return _0x19176e['save']();};}function saveUpdates(_0x232f11,_0x104357){return function(_0x1d7984){if(_0x1d7984){return _0x1d7984['update'](_0x232f11)[_0x11bd('0x21')](function(_0x40c7d2){return _0x40c7d2;});}return null;};}function removeEntity(_0x1c0522,_0x27c98c){return function(_0x3343da){if(_0x3343da){return _0x3343da[_0x11bd('0x22')]()[_0x11bd('0x21')](function(){_0x1c0522[_0x11bd('0x18')](0xcc)[_0x11bd('0x19')]();});}};}function handleEntityNotFound(_0x39fbf9,_0x344826){return function(_0x3c6dab){if(!_0x3c6dab){_0x39fbf9['sendStatus'](0x194);}return _0x3c6dab;};}function handleError(_0x255365,_0xfbe811){_0xfbe811=_0xfbe811||0x1f4;return function(_0xa08420){logger['error'](_0xa08420['stack']);if(_0xa08420['name']){delete _0xa08420[_0x11bd('0x23')];}_0x255365[_0x11bd('0x18')](_0xfbe811)[_0x11bd('0x24')](_0xa08420);};}exports[_0x11bd('0x25')]=function(_0x39c2e3,_0x4312b3){var _0x3cc87b={'raw':!![],'where':{'id':_0x39c2e3[_0x11bd('0x26')]['id']}},_0x599f40={};_0x599f40['model']=_[_0x11bd('0x27')](db[_0x11bd('0x28')]['rawAttributes']);_0x599f40[_0x11bd('0x29')]=_[_0x11bd('0x27')](_0x39c2e3[_0x11bd('0x29')]);_0x599f40[_0x11bd('0x2a')]=_[_0x11bd('0x2b')](_0x599f40[_0x11bd('0x2c')],_0x599f40[_0x11bd('0x29')]);_0x3cc87b[_0x11bd('0x2d')]=_['intersection'](_0x599f40[_0x11bd('0x2c')],qs[_0x11bd('0x2e')](_0x39c2e3[_0x11bd('0x29')][_0x11bd('0x2e')]));_0x3cc87b[_0x11bd('0x2d')]=_0x3cc87b[_0x11bd('0x2d')][_0x11bd('0x2f')]?_0x3cc87b[_0x11bd('0x2d')]:_0x599f40[_0x11bd('0x2c')];if(_0x39c2e3[_0x11bd('0x29')]['includeAll']){_0x3cc87b[_0x11bd('0x30')]=[{'all':!![]}];}_0x3cc87b=_[_0x11bd('0x31')]({},_0x3cc87b,_0x39c2e3['options']);return db[_0x11bd('0x28')][_0x11bd('0x32')](_0x3cc87b)[_0x11bd('0x21')](handleEntityNotFound(_0x4312b3,null))[_0x11bd('0x21')](respondWithResult(_0x4312b3,null))['catch'](handleError(_0x4312b3,null));};exports[_0x11bd('0x33')]=function(_0x485915,_0x3dc82f){if(_0x485915[_0x11bd('0x34')]['id']){delete _0x485915[_0x11bd('0x34')]['id'];}return db[_0x11bd('0x28')][_0x11bd('0x32')]({'where':{'id':_0x485915[_0x11bd('0x26')]['id']}})[_0x11bd('0x21')](handleEntityNotFound(_0x3dc82f,null))[_0x11bd('0x21')](saveUpdates(_0x485915[_0x11bd('0x34')],null))[_0x11bd('0x21')](respondWithResult(_0x3dc82f,null))[_0x11bd('0x35')](handleError(_0x3dc82f,null));};exports[_0x11bd('0x22')]=function(_0x12c1f4,_0x234a4b){return db['ChatApplication']['find']({'where':{'id':_0x12c1f4['params']['id']}})[_0x11bd('0x21')](handleEntityNotFound(_0x234a4b,null))[_0x11bd('0x21')](removeEntity(_0x234a4b,null))['catch'](handleError(_0x234a4b,null));}; \ No newline at end of file +var _0xb458=['Content-Range','apply','reject','save','update','then','destroy','error','stack','params','model','ChatApplication','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0xb458,0xca));var _0x8b45=function(_0x499ae7,_0x11541d){_0x499ae7=_0x499ae7-0x0;var _0xdfdd0f=_0xb458[_0x499ae7];return _0xdfdd0f;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require(_0x8b45('0x3'));var rp=require('request-promise');var moment=require(_0x8b45('0x4'));var BPromise=require(_0x8b45('0x5'));var Mustache=require(_0x8b45('0x6'));var util=require(_0x8b45('0x7'));var path=require(_0x8b45('0x8'));var sox=require(_0x8b45('0x9'));var csv=require(_0x8b45('0xa'));var ejs=require(_0x8b45('0xb'));var fs=require('fs');var fs_extra=require(_0x8b45('0xc'));var _=require(_0x8b45('0xd'));var squel=require(_0x8b45('0xe'));var crypto=require(_0x8b45('0xf'));var jsforce=require(_0x8b45('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8b45('0x11'));var authService=require(_0x8b45('0x12'));var qs=require(_0x8b45('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b45('0x14'));var logger=require('../../config/logger')(_0x8b45('0x15'));var utils=require(_0x8b45('0x16'));var config=require(_0x8b45('0x17'));var licenseUtil=require(_0x8b45('0x18'));var db=require(_0x8b45('0x19'))['db'];function respondWithStatusCode(_0x54c03c,_0x5559e7){_0x5559e7=_0x5559e7||0xcc;return function(_0x46a6c4){if(_0x46a6c4){return _0x54c03c[_0x8b45('0x1a')](_0x5559e7);}return _0x54c03c[_0x8b45('0x1b')](_0x5559e7)[_0x8b45('0x1c')]();};}function respondWithResult(_0x3b7c99,_0x1fdb2d){_0x1fdb2d=_0x1fdb2d||0xc8;return function(_0x1bd228){if(_0x1bd228){return _0x3b7c99[_0x8b45('0x1b')](_0x1fdb2d)[_0x8b45('0x1d')](_0x1bd228);}};}function respondWithFilteredResult(_0x83c355,_0x300dc9){return function(_0x153495){if(_0x153495){var _0x29180d=typeof _0x300dc9[_0x8b45('0x1e')]===_0x8b45('0x1f')&&typeof _0x300dc9['limit']==='undefined';var _0x777072=_0x153495[_0x8b45('0x20')];var _0xfb84af=_0x29180d?0x0:_0x300dc9[_0x8b45('0x1e')];var _0x39bffe=_0x29180d?_0x153495['count']:_0x300dc9[_0x8b45('0x1e')]+_0x300dc9['limit'];var _0x219c94;if(_0x39bffe>=_0x777072){_0x39bffe=_0x777072;_0x219c94=0xc8;}else{_0x219c94=0xce;}_0x83c355['status'](_0x219c94);return _0x83c355[_0x8b45('0x21')](_0x8b45('0x22'),_0xfb84af+'-'+_0x39bffe+'/'+_0x777072)[_0x8b45('0x1d')](_0x153495);}return null;};}function patchUpdates(_0x51fe21){return function(_0xc924dd){try{jsonpatch[_0x8b45('0x23')](_0xc924dd,_0x51fe21,!![]);}catch(_0x48f46a){return BPromise[_0x8b45('0x24')](_0x48f46a);}return _0xc924dd[_0x8b45('0x25')]();};}function saveUpdates(_0x2319c6,_0x4e57a9){return function(_0xc125c4){if(_0xc125c4){return _0xc125c4[_0x8b45('0x26')](_0x2319c6)[_0x8b45('0x27')](function(_0x557f5b){return _0x557f5b;});}return null;};}function removeEntity(_0x1dc7c2,_0x53205d){return function(_0x5cd08a){if(_0x5cd08a){return _0x5cd08a[_0x8b45('0x28')]()[_0x8b45('0x27')](function(){_0x1dc7c2[_0x8b45('0x1b')](0xcc)[_0x8b45('0x1c')]();});}};}function handleEntityNotFound(_0x40510c,_0x5ce26a){return function(_0x3dc3b8){if(!_0x3dc3b8){_0x40510c[_0x8b45('0x1a')](0x194);}return _0x3dc3b8;};}function handleError(_0x4acd00,_0x4b6465){_0x4b6465=_0x4b6465||0x1f4;return function(_0x5919e2){logger[_0x8b45('0x29')](_0x5919e2[_0x8b45('0x2a')]);if(_0x5919e2['name']){delete _0x5919e2['name'];}_0x4acd00['status'](_0x4b6465)['send'](_0x5919e2);};}exports['show']=function(_0x2b24f3,_0x53a363){var _0x28d540={'raw':!![],'where':{'id':_0x2b24f3[_0x8b45('0x2b')]['id']}},_0x275c07={};_0x275c07[_0x8b45('0x2c')]=_['keys'](db[_0x8b45('0x2d')]['rawAttributes']);_0x275c07['query']=_[_0x8b45('0x2e')](_0x2b24f3[_0x8b45('0x2f')]);_0x275c07[_0x8b45('0x30')]=_[_0x8b45('0x31')](_0x275c07[_0x8b45('0x2c')],_0x275c07[_0x8b45('0x2f')]);_0x28d540[_0x8b45('0x32')]=_[_0x8b45('0x31')](_0x275c07[_0x8b45('0x2c')],qs[_0x8b45('0x33')](_0x2b24f3[_0x8b45('0x2f')][_0x8b45('0x33')]));_0x28d540[_0x8b45('0x32')]=_0x28d540[_0x8b45('0x32')][_0x8b45('0x34')]?_0x28d540[_0x8b45('0x32')]:_0x275c07['model'];if(_0x2b24f3[_0x8b45('0x2f')][_0x8b45('0x35')]){_0x28d540['include']=[{'all':!![]}];}_0x28d540=_[_0x8b45('0x36')]({},_0x28d540,_0x2b24f3[_0x8b45('0x37')]);return db[_0x8b45('0x2d')]['find'](_0x28d540)[_0x8b45('0x27')](handleEntityNotFound(_0x53a363,null))[_0x8b45('0x27')](respondWithResult(_0x53a363,null))['catch'](handleError(_0x53a363,null));};exports[_0x8b45('0x26')]=function(_0x49c138,_0x45e8ec){if(_0x49c138['body']['id']){delete _0x49c138['body']['id'];}return db['ChatApplication'][_0x8b45('0x38')]({'where':{'id':_0x49c138[_0x8b45('0x2b')]['id']}})[_0x8b45('0x27')](handleEntityNotFound(_0x45e8ec,null))[_0x8b45('0x27')](saveUpdates(_0x49c138[_0x8b45('0x39')],null))[_0x8b45('0x27')](respondWithResult(_0x45e8ec,null))['catch'](handleError(_0x45e8ec,null));};exports[_0x8b45('0x28')]=function(_0x24961d,_0x5c4a5d){return db['ChatApplication'][_0x8b45('0x38')]({'where':{'id':_0x24961d[_0x8b45('0x2b')]['id']}})[_0x8b45('0x27')](handleEntityNotFound(_0x5c4a5d,null))[_0x8b45('0x27')](removeEntity(_0x5c4a5d,null))[_0x8b45('0x3a')](handleError(_0x5c4a5d,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4a048e7..076612b 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 _0x24ab=['chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0x24ab,0x1c4));var _0xb24a=function(_0x5cd7de,_0x2a5628){_0x5cd7de=_0x5cd7de-0x0;var _0x285943=_0x24ab[_0x5cd7de];return _0x285943;};'use strict';var _=require(_0xb24a('0x0'));var util=require(_0xb24a('0x1'));var logger=require(_0xb24a('0x2'))(_0xb24a('0x3'));var moment=require(_0xb24a('0x4'));var BPromise=require(_0xb24a('0x5'));var rp=require(_0xb24a('0x6'));var fs=require('fs');var path=require(_0xb24a('0x7'));var rimraf=require('rimraf');var config=require(_0xb24a('0x8'));var attributes=require(_0xb24a('0x9'));module[_0xb24a('0xa')]=function(_0x11a6b9,_0x1b3e7c){return _0x11a6b9[_0xb24a('0xb')](_0xb24a('0xc'),attributes,{'tableName':_0xb24a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb24a('0xe')});}; \ No newline at end of file +var _0xe142=['utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe142,0xaa));var _0x2e14=function(_0x507d61,_0x2e3981){_0x507d61=_0x507d61-0x0;var _0x3a8c68=_0xe142[_0x507d61];return _0x3a8c68;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e14('0x0'))('api');var moment=require(_0x2e14('0x1'));var BPromise=require(_0x2e14('0x2'));var rp=require(_0x2e14('0x3'));var fs=require('fs');var path=require(_0x2e14('0x4'));var rimraf=require(_0x2e14('0x5'));var config=require(_0x2e14('0x6'));var attributes=require('./chatApplication.attributes');module[_0x2e14('0x7')]=function(_0x33e99b,_0x1bfd45){return _0x33e99b[_0x2e14('0x8')](_0x2e14('0x9'),attributes,{'tableName':_0x2e14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e14('0xb'),'collate':_0x2e14('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 049d8e5..50dee12 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 _0xc498=['then','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x579a2f,_0x2a815a){var _0x5c9e93=function(_0x3e6fc9){while(--_0x3e6fc9){_0x579a2f['push'](_0x579a2f['shift']());}};_0x5c9e93(++_0x2a815a);}(_0xc498,0x96));var _0x8c49=function(_0x3bf7ef,_0x2b0128){_0x3bf7ef=_0x3bf7ef-0x0;var _0x376805=_0xc498[_0x3bf7ef];return _0x376805;};'use strict';var _=require(_0x8c49('0x0'));var util=require(_0x8c49('0x1'));var moment=require(_0x8c49('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c49('0x3'));var db=require(_0x8c49('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c49('0x5'))(_0x8c49('0x6'));var config=require(_0x8c49('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8c49('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bd240,_0x1f1a86,_0x2dd22e){return new BPromise(function(_0x32f376,_0x563efb){return client[_0x8c49('0x9')](_0x3bd240,_0x2dd22e)[_0x8c49('0xa')](function(_0x11de25){logger[_0x8c49('0xb')]('ChatApplication,\x20%s,\x20%s',_0x1f1a86,_0x8c49('0xc'));logger['debug'](_0x8c49('0xd'),_0x1f1a86,_0x8c49('0xc'),JSON[_0x8c49('0xe')](_0x11de25));if(_0x11de25[_0x8c49('0xf')]){if(_0x11de25[_0x8c49('0xf')][_0x8c49('0x10')]===0x1f4){logger[_0x8c49('0xf')](_0x8c49('0x11'),_0x1f1a86,_0x11de25[_0x8c49('0xf')][_0x8c49('0x12')]);return _0x563efb(_0x11de25[_0x8c49('0xf')][_0x8c49('0x12')]);}logger[_0x8c49('0xf')](_0x8c49('0x11'),_0x1f1a86,_0x11de25[_0x8c49('0xf')][_0x8c49('0x12')]);return _0x32f376(_0x11de25[_0x8c49('0xf')][_0x8c49('0x12')]);}else{logger['info'](_0x8c49('0x11'),_0x1f1a86,_0x8c49('0xc'));_0x32f376(_0x11de25['result'][_0x8c49('0x12')]);}})[_0x8c49('0x13')](function(_0x4de2fb){logger['error'](_0x8c49('0x11'),_0x1f1a86,_0x4de2fb);_0x563efb(_0x4de2fb);});});} \ No newline at end of file +var _0x19db=['jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x19db,0x15e));var _0xb19d=function(_0x47a854,_0x5871dd){_0x47a854=_0x47a854-0x0;var _0x51a0af=_0x19db[_0x47a854];return _0x51a0af;};'use strict';var _=require(_0xb19d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb19d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb19d('0x2'))['db'];var utils=require(_0xb19d('0x3'));var logger=require(_0xb19d('0x4'))(_0xb19d('0x5'));var config=require(_0xb19d('0x6'));var jayson=require(_0xb19d('0x7'));var client=jayson[_0xb19d('0x8')][_0xb19d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f4c19,_0xa59db7,_0x328b94){return new BPromise(function(_0x61dec0,_0x2d6aa8){return client[_0xb19d('0xa')](_0x2f4c19,_0x328b94)[_0xb19d('0xb')](function(_0x5468d9){logger[_0xb19d('0xc')](_0xb19d('0xd'),_0xa59db7,_0xb19d('0xe'));logger[_0xb19d('0xf')](_0xb19d('0x10'),_0xa59db7,_0xb19d('0xe'),JSON['stringify'](_0x5468d9));if(_0x5468d9[_0xb19d('0x11')]){if(_0x5468d9[_0xb19d('0x11')][_0xb19d('0x12')]===0x1f4){logger[_0xb19d('0x11')](_0xb19d('0xd'),_0xa59db7,_0x5468d9[_0xb19d('0x11')][_0xb19d('0x13')]);return _0x2d6aa8(_0x5468d9[_0xb19d('0x11')][_0xb19d('0x13')]);}logger[_0xb19d('0x11')](_0xb19d('0xd'),_0xa59db7,_0x5468d9['error'][_0xb19d('0x13')]);return _0x61dec0(_0x5468d9[_0xb19d('0x11')]['message']);}else{logger[_0xb19d('0xc')]('ChatApplication,\x20%s,\x20%s',_0xa59db7,_0xb19d('0xe'));_0x61dec0(_0x5468d9['result']['message']);}})[_0xb19d('0x14')](function(_0x282d6c){logger[_0xb19d('0x11')](_0xb19d('0xd'),_0xa59db7,_0x282d6c);_0x2d6aa8(_0x282d6c);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2489f4f..5044d70 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 _0x16c6=['fs-extra','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4571c8,_0x179c89){var _0x1e4213=function(_0x11c453){while(--_0x11c453){_0x4571c8['push'](_0x4571c8['shift']());}};_0x1e4213(++_0x179c89);}(_0x16c6,0x1ea));var _0x616c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x16c6[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x616c('0x0'));var util=require(_0x616c('0x1'));var path=require(_0x616c('0x2'));var timeout=require(_0x616c('0x3'));var express=require(_0x616c('0x4'));var router=express[_0x616c('0x5')]();var fs_extra=require(_0x616c('0x6'));var auth=require(_0x616c('0x7'));var interaction=require(_0x616c('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x616c('0x9'),auth[_0x616c('0xa')](),controller[_0x616c('0xb')]);router[_0x616c('0xc')]('/:id',auth[_0x616c('0xa')](),controller[_0x616c('0xd')]);router[_0x616c('0xe')](_0x616c('0x9'),auth[_0x616c('0xa')](),controller[_0x616c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x42ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x30c680,_0x295d15){var _0x7da8a0=function(_0x4aaf5c){while(--_0x4aaf5c){_0x30c680['push'](_0x30c680['shift']());}};_0x7da8a0(++_0x295d15);}(_0x42ed,0xec));var _0xd42e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42ed[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd42e('0x0'));var util=require('util');var path=require(_0xd42e('0x1'));var timeout=require('connect-timeout');var express=require(_0xd42e('0x2'));var router=express[_0xd42e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd42e('0x4'));var interaction=require(_0xd42e('0x5'));var config=require(_0xd42e('0x6'));var controller=require(_0xd42e('0x7'));router['get']('/:id',auth[_0xd42e('0x8')](),controller[_0xd42e('0x9')]);router[_0xd42e('0xa')](_0xd42e('0xb'),auth['isAuthenticated'](),controller[_0xd42e('0xc')]);router[_0xd42e('0xd')](_0xd42e('0xb'),auth[_0xd42e('0x8')](),controller[_0xd42e('0xe')]);module[_0xd42e('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index d27d1c4..8e75257 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 _0x019b=['sequelize','exports'];(function(_0x155672,_0x46e52e){var _0x16dc93=function(_0x5f2a1e){while(--_0x5f2a1e){_0x155672['push'](_0x155672['shift']());}};_0x16dc93(++_0x46e52e);}(_0x019b,0xa6));var _0xb019=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x019b[_0x53bcc3];return _0x47c959;};'use strict';var Sequelize=require(_0xb019('0x0'));module[_0xb019('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7008=['exports','STRING','sequelize'];(function(_0x34cee7,_0x5a22ea){var _0x10544e=function(_0x4bcbbe){while(--_0x4bcbbe){_0x34cee7['push'](_0x34cee7['shift']());}};_0x10544e(++_0x5a22ea);}(_0x7008,0x185));var _0x8700=function(_0x5e0c8a,_0x23387d){_0x5e0c8a=_0x5e0c8a-0x0;var _0x568eaa=_0x7008[_0x5e0c8a];return _0x568eaa;};'use strict';var Sequelize=require(_0x8700('0x0'));module[_0x8700('0x1')]={'name':{'type':Sequelize[_0x8700('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8700('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index ff67578..35a796f 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 _0x4ff4=['ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','offset','undefined','count','limit','status','set','Content-Range','json','apply','save','update','then','end','sendStatus','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','getUnread','ChatInternalMessage','user','addMembers','findOne','User','getMembers','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv'];(function(_0x44fc50,_0x3b9d3b){var _0x5ccd46=function(_0x564c74){while(--_0x564c74){_0x44fc50['push'](_0x44fc50['shift']());}};_0x5ccd46(++_0x3b9d3b);}(_0x4ff4,0xb1));var _0x44ff=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x4ff4[_0x482214];return _0x38d0cb;};'use strict';var emlformat=require(_0x44ff('0x0'));var rimraf=require(_0x44ff('0x1'));var zipdir=require(_0x44ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44ff('0x3'));var moment=require(_0x44ff('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x44ff('0x5'));var path=require(_0x44ff('0x6'));var sox=require(_0x44ff('0x7'));var csv=require(_0x44ff('0x8'));var ejs=require(_0x44ff('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44ff('0xa'));var squel=require('squel');var crypto=require(_0x44ff('0xb'));var jsforce=require(_0x44ff('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x44ff('0x8'));var querystring=require(_0x44ff('0xd'));var Papa=require(_0x44ff('0xe'));var Redis=require(_0x44ff('0xf'));var authService=require(_0x44ff('0x10'));var qs=require(_0x44ff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44ff('0x12'));var logger=require(_0x44ff('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x44ff('0x14'));var licenseUtil=require(_0x44ff('0x15'));var db=require(_0x44ff('0x16'))['db'];config[_0x44ff('0x17')]=_[_0x44ff('0x18')](config[_0x44ff('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44ff('0x17')]));require(_0x44ff('0x19'))['register'](socket);function respondWithStatusCode(_0x4f10d0,_0x22a554){_0x22a554=_0x22a554||0xcc;return function(_0x3c79cb){if(_0x3c79cb){return _0x4f10d0['sendStatus'](_0x22a554);}return _0x4f10d0['status'](_0x22a554)['end']();};}function respondWithResult(_0x21627b,_0x499660){_0x499660=_0x499660||0xc8;return function(_0x80215b){if(_0x80215b){return _0x21627b['status'](_0x499660)['json'](_0x80215b);}};}function respondWithFilteredResult(_0x590655,_0x3a8368){return function(_0x3ddfc0){if(_0x3ddfc0){var _0x5ba75b=typeof _0x3a8368[_0x44ff('0x1a')]===_0x44ff('0x1b')&&typeof _0x3a8368['limit']===_0x44ff('0x1b');var _0x1e9b99=_0x3ddfc0['count'];var _0x3dd0dc=_0x5ba75b?0x0:_0x3a8368[_0x44ff('0x1a')];var _0x59905e=_0x5ba75b?_0x3ddfc0[_0x44ff('0x1c')]:_0x3a8368['offset']+_0x3a8368[_0x44ff('0x1d')];var _0x44f308;if(_0x59905e>=_0x1e9b99){_0x59905e=_0x1e9b99;_0x44f308=0xc8;}else{_0x44f308=0xce;}_0x590655[_0x44ff('0x1e')](_0x44f308);return _0x590655[_0x44ff('0x1f')](_0x44ff('0x20'),_0x3dd0dc+'-'+_0x59905e+'/'+_0x1e9b99)[_0x44ff('0x21')](_0x3ddfc0);}return null;};}function patchUpdates(_0x456ec2){return function(_0x1ed0e5){try{jsonpatch[_0x44ff('0x22')](_0x1ed0e5,_0x456ec2,!![]);}catch(_0x184875){return BPromise['reject'](_0x184875);}return _0x1ed0e5[_0x44ff('0x23')]();};}function saveUpdates(_0x2688f5,_0x59b155){return function(_0x531715){if(_0x531715){return _0x531715[_0x44ff('0x24')](_0x2688f5)['then'](function(_0x116093){return _0x116093;});}return null;};}function removeEntity(_0x43a671,_0x57a507){return function(_0x5ae524){if(_0x5ae524){return _0x5ae524['destroy']()[_0x44ff('0x25')](function(){_0x43a671[_0x44ff('0x1e')](0xcc)[_0x44ff('0x26')]();});}};}function handleEntityNotFound(_0x320d93,_0x6ec7ff){return function(_0x3a1cb2){if(!_0x3a1cb2){_0x320d93[_0x44ff('0x27')](0x194);}return _0x3a1cb2;};}function handleError(_0x108980,_0x37d190){_0x37d190=_0x37d190||0x1f4;return function(_0x4f37e8){logger['error'](_0x4f37e8[_0x44ff('0x28')]);if(_0x4f37e8[_0x44ff('0x29')]){delete _0x4f37e8[_0x44ff('0x29')];}_0x108980[_0x44ff('0x1e')](_0x37d190)[_0x44ff('0x2a')](_0x4f37e8);};}exports['index']=function(_0x231fcd,_0x40102e){var _0x43503e={},_0x5c5f09={},_0x4009ea={'count':0x0,'rows':[]};var _0x2f2437=_[_0x44ff('0x2b')](db[_0x44ff('0x2c')][_0x44ff('0x2d')],function(_0xd6862b){return{'name':_0xd6862b[_0x44ff('0x2e')],'type':_0xd6862b[_0x44ff('0x2f')][_0x44ff('0x30')]};});_0x5c5f09[_0x44ff('0x31')]=_[_0x44ff('0x2b')](_0x2f2437,_0x44ff('0x29'));_0x5c5f09[_0x44ff('0x32')]=_['keys'](_0x231fcd[_0x44ff('0x32')]);_0x5c5f09[_0x44ff('0x33')]=_[_0x44ff('0x34')](_0x5c5f09['model'],_0x5c5f09[_0x44ff('0x32')]);_0x43503e[_0x44ff('0x35')]=_['intersection'](_0x5c5f09[_0x44ff('0x31')],qs[_0x44ff('0x36')](_0x231fcd[_0x44ff('0x32')][_0x44ff('0x36')]));_0x43503e[_0x44ff('0x35')]=_0x43503e[_0x44ff('0x35')][_0x44ff('0x37')]?_0x43503e['attributes']:_0x5c5f09[_0x44ff('0x31')];if(!_0x231fcd[_0x44ff('0x32')][_0x44ff('0x38')](_0x44ff('0x39'))){_0x43503e[_0x44ff('0x1d')]=qs[_0x44ff('0x1d')](_0x231fcd['query'][_0x44ff('0x1d')]);_0x43503e[_0x44ff('0x1a')]=qs[_0x44ff('0x1a')](_0x231fcd[_0x44ff('0x32')]['offset']);}_0x43503e[_0x44ff('0x3a')]=qs[_0x44ff('0x3b')](_0x231fcd[_0x44ff('0x32')][_0x44ff('0x3b')]);_0x43503e[_0x44ff('0x3c')]=qs['filters'](_[_0x44ff('0x3d')](_0x231fcd[_0x44ff('0x32')],_0x5c5f09[_0x44ff('0x33')]),_0x2f2437);if(_0x231fcd[_0x44ff('0x32')][_0x44ff('0x3e')]){_0x43503e[_0x44ff('0x3c')]=_[_0x44ff('0x3f')](_0x43503e[_0x44ff('0x3c')],{'$or':_[_0x44ff('0x2b')](_0x2f2437,function(_0x568c54){if(_0x568c54[_0x44ff('0x2f')]!=='VIRTUAL'){var _0x4b243c={};_0x4b243c[_0x568c54[_0x44ff('0x29')]]={'$like':'%'+_0x231fcd[_0x44ff('0x32')][_0x44ff('0x3e')]+'%'};return _0x4b243c;}})});}_0x43503e=_[_0x44ff('0x3f')]({},_0x43503e,_0x231fcd[_0x44ff('0x40')]);var _0x592bc0={'where':_0x43503e[_0x44ff('0x3c')]};return db['ChatGroup'][_0x44ff('0x1c')](_0x592bc0)['then'](function(_0xb1f7cf){_0x4009ea[_0x44ff('0x1c')]=_0xb1f7cf;if(_0x231fcd[_0x44ff('0x32')][_0x44ff('0x41')]){_0x43503e[_0x44ff('0x42')]=[{'all':!![]}];}return db['ChatGroup'][_0x44ff('0x43')](_0x43503e);})[_0x44ff('0x25')](function(_0x4d675b){_0x4009ea['rows']=_0x4d675b;return _0x4009ea;})[_0x44ff('0x25')](respondWithFilteredResult(_0x40102e,_0x43503e))[_0x44ff('0x44')](handleError(_0x40102e,null));};exports[_0x44ff('0x45')]=function(_0x1e63ad,_0x47ba02){var _0x58c30a={'raw':!![],'where':{'id':_0x1e63ad[_0x44ff('0x46')]['id']}},_0x17cb44={};_0x17cb44['model']=_['keys'](db[_0x44ff('0x2c')]['rawAttributes']);_0x17cb44[_0x44ff('0x32')]=_[_0x44ff('0x47')](_0x1e63ad[_0x44ff('0x32')]);_0x17cb44[_0x44ff('0x33')]=_[_0x44ff('0x34')](_0x17cb44[_0x44ff('0x31')],_0x17cb44[_0x44ff('0x32')]);_0x58c30a[_0x44ff('0x35')]=_[_0x44ff('0x34')](_0x17cb44[_0x44ff('0x31')],qs[_0x44ff('0x36')](_0x1e63ad[_0x44ff('0x32')]['fields']));_0x58c30a[_0x44ff('0x35')]=_0x58c30a[_0x44ff('0x35')]['length']?_0x58c30a[_0x44ff('0x35')]:_0x17cb44[_0x44ff('0x31')];if(_0x1e63ad[_0x44ff('0x32')][_0x44ff('0x41')]){_0x58c30a[_0x44ff('0x42')]=[{'all':!![]}];}_0x58c30a=_[_0x44ff('0x3f')]({},_0x58c30a,_0x1e63ad[_0x44ff('0x40')]);return db['ChatGroup']['find'](_0x58c30a)[_0x44ff('0x25')](handleEntityNotFound(_0x47ba02,null))[_0x44ff('0x25')](respondWithResult(_0x47ba02,null))['catch'](handleError(_0x47ba02,null));};exports[_0x44ff('0x48')]=function(_0x217a91,_0x4ab47b){return db[_0x44ff('0x2c')][_0x44ff('0x48')](_0x217a91['body'],{})['then'](respondWithResult(_0x4ab47b,0xc9))[_0x44ff('0x44')](handleError(_0x4ab47b,null));};exports[_0x44ff('0x24')]=function(_0x32e566,_0x4f2854){if(_0x32e566[_0x44ff('0x49')]['id']){delete _0x32e566[_0x44ff('0x49')]['id'];}return db[_0x44ff('0x2c')][_0x44ff('0x4a')]({'where':{'id':_0x32e566[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x4f2854,null))[_0x44ff('0x25')](saveUpdates(_0x32e566[_0x44ff('0x49')],null))[_0x44ff('0x25')](respondWithResult(_0x4f2854,null))[_0x44ff('0x44')](handleError(_0x4f2854,null));};exports[_0x44ff('0x4b')]=function(_0x4839cb,_0x7186ef){return db[_0x44ff('0x2c')][_0x44ff('0x4a')]({'where':{'id':_0x4839cb[_0x44ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x7186ef,null))[_0x44ff('0x25')](removeEntity(_0x7186ef,null))[_0x44ff('0x44')](handleError(_0x7186ef,null));};exports['describe']=function(_0x382d48,_0x19665f){return db['ChatGroup'][_0x44ff('0x4c')]()[_0x44ff('0x25')](respondWithResult(_0x19665f,null))[_0x44ff('0x44')](handleError(_0x19665f,null));};exports[_0x44ff('0x4d')]=function(_0x36f45f,_0x3551f7,_0x1ba7e1){return db[_0x44ff('0x4e')]['count']({'where':{'ChatGroupId':_0x36f45f['params']['id'],'ToId':_0x36f45f[_0x44ff('0x4f')]['id'],'read':![]}})[_0x44ff('0x25')](function(_0x3dc1ae){return{'id':_['toInteger'](_0x36f45f['params']['id']),'count':_0x3dc1ae};})[_0x44ff('0x25')](respondWithResult(_0x3551f7,null))['catch'](handleError(_0x3551f7,null));};exports['addMembers']=function(_0x37550f,_0x3371ec,_0x194d5d){return db[_0x44ff('0x2c')][_0x44ff('0x4a')]({'where':{'id':_0x37550f[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x3371ec,null))[_0x44ff('0x25')](function(_0x5525e8){if(_0x5525e8){return _0x5525e8[_0x44ff('0x50')](_0x37550f[_0x44ff('0x49')]['ids'],_['omit'](_0x37550f['body'],['ids','id'])||{});}})[_0x44ff('0x25')](respondWithResult(_0x3371ec,null))[_0x44ff('0x44')](handleError(_0x3371ec,null));};exports['getMembers']=function(_0x181e46,_0x469a5d,_0x467cfd){var _0x5b833d={};var _0x2baa2e={};var _0x5851dc;var _0x49bd8a;return db[_0x44ff('0x2c')][_0x44ff('0x51')]({'where':{'id':_0x181e46[_0x44ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x469a5d,null))[_0x44ff('0x25')](function(_0x3a9122){if(_0x3a9122){_0x5851dc=_0x3a9122;_0x2baa2e[_0x44ff('0x31')]=_[_0x44ff('0x47')](db[_0x44ff('0x52')][_0x44ff('0x2d')]);_0x2baa2e[_0x44ff('0x32')]=_[_0x44ff('0x47')](_0x181e46[_0x44ff('0x32')]);_0x2baa2e[_0x44ff('0x33')]=_[_0x44ff('0x34')](_0x2baa2e[_0x44ff('0x31')],_0x2baa2e['query']);_0x5b833d[_0x44ff('0x35')]=_[_0x44ff('0x34')](_0x2baa2e[_0x44ff('0x31')],qs[_0x44ff('0x36')](_0x181e46[_0x44ff('0x32')]['fields']));_0x5b833d['attributes']=_0x5b833d['attributes'][_0x44ff('0x37')]?_0x5b833d[_0x44ff('0x35')]:_0x2baa2e[_0x44ff('0x31')];_0x5b833d[_0x44ff('0x3a')]=qs['sort'](_0x181e46['query'][_0x44ff('0x3b')]);_0x5b833d[_0x44ff('0x3c')]=qs[_0x44ff('0x33')](_['pick'](_0x181e46[_0x44ff('0x32')],_0x2baa2e[_0x44ff('0x33')]));if(_0x181e46[_0x44ff('0x32')][_0x44ff('0x3e')]){_0x5b833d[_0x44ff('0x3c')]=_[_0x44ff('0x3f')](_0x5b833d['where'],{'$or':_['map'](_0x5b833d[_0x44ff('0x35')],function(_0x4a1a04){var _0x59726b={};_0x59726b[_0x4a1a04]={'$like':'%'+_0x181e46[_0x44ff('0x32')][_0x44ff('0x3e')]+'%'};return _0x59726b;})});}_0x5b833d=_[_0x44ff('0x3f')]({},_0x5b833d,_0x181e46[_0x44ff('0x40')]);return _0x5851dc[_0x44ff('0x53')](_0x5b833d);}})[_0x44ff('0x25')](function(_0x5e96d9){if(_0x5e96d9){_0x49bd8a=_0x5e96d9[_0x44ff('0x37')];if(!_0x181e46[_0x44ff('0x32')][_0x44ff('0x38')](_0x44ff('0x39'))){_0x5b833d[_0x44ff('0x1d')]=qs[_0x44ff('0x1d')](_0x181e46[_0x44ff('0x32')][_0x44ff('0x1d')]);_0x5b833d['offset']=qs['offset'](_0x181e46[_0x44ff('0x32')][_0x44ff('0x1a')]);}return _0x5851dc[_0x44ff('0x53')](_0x5b833d);}})[_0x44ff('0x25')](function(_0x581eb1){if(_0x581eb1){return _0x581eb1?{'count':_0x49bd8a,'rows':_0x581eb1}:null;}})[_0x44ff('0x25')](respondWithResult(_0x469a5d,null))['catch'](handleError(_0x469a5d,null));};exports[_0x44ff('0x54')]=function(_0x215aec,_0x51dc3c,_0x152767){return db['ChatGroup'][_0x44ff('0x4a')]({'where':{'id':_0x215aec[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x51dc3c,null))[_0x44ff('0x25')](function(_0x14398e){if(_0x14398e){return _0x14398e[_0x44ff('0x54')](_0x215aec[_0x44ff('0x32')][_0x44ff('0x55')]);}})[_0x44ff('0x25')](respondWithStatusCode(_0x51dc3c,null))[_0x44ff('0x44')](handleError(_0x51dc3c,null));};exports[_0x44ff('0x56')]=function(_0x45bb7f,_0x5d6cfc,_0x1da339){if(_0x45bb7f[_0x44ff('0x49')]['id']){delete _0x45bb7f['body']['id'];}return db[_0x44ff('0x2c')][_0x44ff('0x4a')]({'where':{'id':_0x45bb7f[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x5d6cfc,null))[_0x44ff('0x25')](function(_0x3f83b0){if(_0x3f83b0){_0x45bb7f['body'][_0x44ff('0x57')]=_0x3f83b0['id'];return db[_0x44ff('0x4e')][_0x44ff('0x48')](_0x45bb7f['body']);}})[_0x44ff('0x25')](respondWithResult(_0x5d6cfc,null))[_0x44ff('0x44')](handleError(_0x5d6cfc,null));};exports[_0x44ff('0x58')]=function(_0x193b4b,_0x594442,_0x55bf4c){var _0xe4ae2b={};var _0x16c073={};var _0x3ef899;var _0x5939ca;return db[_0x44ff('0x2c')]['findOne']({'where':{'id':_0x193b4b[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x594442,null))[_0x44ff('0x25')](function(_0x53742a){if(_0x53742a){_0x3ef899=_0x53742a;_0x16c073[_0x44ff('0x31')]=_['keys'](db[_0x44ff('0x4e')][_0x44ff('0x2d')]);_0x16c073[_0x44ff('0x32')]=_[_0x44ff('0x47')](_0x193b4b['query']);_0x16c073[_0x44ff('0x33')]=_[_0x44ff('0x34')](_0x16c073[_0x44ff('0x31')],_0x16c073[_0x44ff('0x32')]);_0xe4ae2b[_0x44ff('0x35')]=_['intersection'](_0x16c073[_0x44ff('0x31')],qs[_0x44ff('0x36')](_0x193b4b[_0x44ff('0x32')][_0x44ff('0x36')]));_0xe4ae2b[_0x44ff('0x35')]=_0xe4ae2b[_0x44ff('0x35')][_0x44ff('0x37')]?_0xe4ae2b[_0x44ff('0x35')]:_0x16c073[_0x44ff('0x31')];_0xe4ae2b[_0x44ff('0x3a')]=qs[_0x44ff('0x3b')](_0x193b4b[_0x44ff('0x32')]['sort']);_0xe4ae2b[_0x44ff('0x3c')]=qs[_0x44ff('0x33')](_[_0x44ff('0x3d')](_0x193b4b[_0x44ff('0x32')],_0x16c073[_0x44ff('0x33')]));if(_0x193b4b['query'][_0x44ff('0x3e')]){_0xe4ae2b['where']=_[_0x44ff('0x3f')](_0xe4ae2b['where'],{'$or':_[_0x44ff('0x2b')](_0xe4ae2b[_0x44ff('0x35')],function(_0x3eb320){var _0x29e7fd={};_0x29e7fd[_0x3eb320]={'$like':'%'+_0x193b4b['query'][_0x44ff('0x3e')]+'%'};return _0x29e7fd;})});}if(_0x193b4b[_0x44ff('0x32')][_0x44ff('0x59')]){var _0x564e44=_0x193b4b[_0x44ff('0x32')][_0x44ff('0x59')][_0x44ff('0x5a')](',');var _0x35a466={};_0x35a466[_0x564e44[0x0]]={'$gte':moment(_0x564e44[0x1])[_0x44ff('0x5b')](_0x44ff('0x5c'))};_0xe4ae2b['where']=_[_0x44ff('0x3f')](_0xe4ae2b[_0x44ff('0x3c')],_0x35a466);}_0xe4ae2b=_[_0x44ff('0x3f')]({},_0xe4ae2b,_0x193b4b[_0x44ff('0x40')]);return _0x3ef899['getMessages'](_0xe4ae2b);}})[_0x44ff('0x25')](function(_0x2e44ec){if(_0x2e44ec){_0x5939ca=_0x2e44ec[_0x44ff('0x37')];if(!_0x193b4b[_0x44ff('0x32')][_0x44ff('0x38')](_0x44ff('0x39'))){_0xe4ae2b[_0x44ff('0x1d')]=qs[_0x44ff('0x1d')](_0x193b4b[_0x44ff('0x32')][_0x44ff('0x1d')]);_0xe4ae2b[_0x44ff('0x1a')]=qs[_0x44ff('0x1a')](_0x193b4b[_0x44ff('0x32')][_0x44ff('0x1a')]);}return _0x3ef899['getMessages'](_0xe4ae2b);}})['then'](function(_0x116715){if(_0x116715){return _0x116715?{'count':_0x5939ca,'rows':_0x116715}:null;}})[_0x44ff('0x25')](respondWithResult(_0x594442,null))[_0x44ff('0x44')](handleError(_0x594442,null));}; \ No newline at end of file +var _0x4d1e=['create','update','body','describe','ChatInternalMessage','user','addMembers','ids','findOne','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','name','send','index','map','ChatGroup','rawAttributes','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','length','include','find','catch'];(function(_0x3bb02b,_0x10dac8){var _0x511672=function(_0xad7efb){while(--_0xad7efb){_0x3bb02b['push'](_0x3bb02b['shift']());}};_0x511672(++_0x10dac8);}(_0x4d1e,0xd5));var _0xe4d1=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x4d1e[_0x595604];return _0x1466f3;};'use strict';var emlformat=require(_0xe4d1('0x0'));var rimraf=require(_0xe4d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4d1('0x2'));var rp=require(_0xe4d1('0x3'));var moment=require(_0xe4d1('0x4'));var BPromise=require(_0xe4d1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe4d1('0x6'));var sox=require(_0xe4d1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4d1('0x8'));var _=require(_0xe4d1('0x9'));var squel=require(_0xe4d1('0xa'));var crypto=require(_0xe4d1('0xb'));var jsforce=require(_0xe4d1('0xc'));var deskjs=require(_0xe4d1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe4d1('0xe'));var Papa=require(_0xe4d1('0xf'));var Redis=require('ioredis');var authService=require(_0xe4d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe4d1('0x11'));var hardwareService=require(_0xe4d1('0x12'));var logger=require(_0xe4d1('0x13'))(_0xe4d1('0x14'));var utils=require(_0xe4d1('0x15'));var config=require(_0xe4d1('0x16'));var licenseUtil=require(_0xe4d1('0x17'));var db=require(_0xe4d1('0x18'))['db'];config[_0xe4d1('0x19')]=_['defaults'](config[_0xe4d1('0x19')],{'host':_0xe4d1('0x1a'),'port':0x18eb});var socket=require(_0xe4d1('0x1b'))(new Redis(config[_0xe4d1('0x19')]));require(_0xe4d1('0x1c'))[_0xe4d1('0x1d')](socket);function respondWithStatusCode(_0x4b0100,_0x43fe8d){_0x43fe8d=_0x43fe8d||0xcc;return function(_0xa08579){if(_0xa08579){return _0x4b0100[_0xe4d1('0x1e')](_0x43fe8d);}return _0x4b0100[_0xe4d1('0x1f')](_0x43fe8d)[_0xe4d1('0x20')]();};}function respondWithResult(_0x4cdcb7,_0x1ad8fa){_0x1ad8fa=_0x1ad8fa||0xc8;return function(_0x3efafd){if(_0x3efafd){return _0x4cdcb7[_0xe4d1('0x1f')](_0x1ad8fa)[_0xe4d1('0x21')](_0x3efafd);}};}function respondWithFilteredResult(_0x170d02,_0xd820d1){return function(_0x133f12){if(_0x133f12){var _0x242e59=typeof _0xd820d1[_0xe4d1('0x22')]===_0xe4d1('0x23')&&typeof _0xd820d1[_0xe4d1('0x24')]===_0xe4d1('0x23');var _0x276be7=_0x133f12[_0xe4d1('0x25')];var _0x27cfbc=_0x242e59?0x0:_0xd820d1[_0xe4d1('0x22')];var _0x4cb63f=_0x242e59?_0x133f12[_0xe4d1('0x25')]:_0xd820d1['offset']+_0xd820d1[_0xe4d1('0x24')];var _0x334580;if(_0x4cb63f>=_0x276be7){_0x4cb63f=_0x276be7;_0x334580=0xc8;}else{_0x334580=0xce;}_0x170d02[_0xe4d1('0x1f')](_0x334580);return _0x170d02[_0xe4d1('0x26')](_0xe4d1('0x27'),_0x27cfbc+'-'+_0x4cb63f+'/'+_0x276be7)[_0xe4d1('0x21')](_0x133f12);}return null;};}function patchUpdates(_0x54fdc9){return function(_0x5f1d60){try{jsonpatch[_0xe4d1('0x28')](_0x5f1d60,_0x54fdc9,!![]);}catch(_0x151c9c){return BPromise[_0xe4d1('0x29')](_0x151c9c);}return _0x5f1d60[_0xe4d1('0x2a')]();};}function saveUpdates(_0x3bf4fe,_0x45d6d2){return function(_0x58d919){if(_0x58d919){return _0x58d919['update'](_0x3bf4fe)['then'](function(_0x127d15){return _0x127d15;});}return null;};}function removeEntity(_0x1339e1,_0x57fad2){return function(_0x2585e6){if(_0x2585e6){return _0x2585e6[_0xe4d1('0x2b')]()[_0xe4d1('0x2c')](function(){_0x1339e1[_0xe4d1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cc4b6,_0x1223d6){return function(_0x2cdfde){if(!_0x2cdfde){_0x4cc4b6[_0xe4d1('0x1e')](0x194);}return _0x2cdfde;};}function handleError(_0x482be7,_0x4a9464){_0x4a9464=_0x4a9464||0x1f4;return function(_0x29e3a0){logger['error'](_0x29e3a0['stack']);if(_0x29e3a0[_0xe4d1('0x2d')]){delete _0x29e3a0[_0xe4d1('0x2d')];}_0x482be7[_0xe4d1('0x1f')](_0x4a9464)[_0xe4d1('0x2e')](_0x29e3a0);};}exports[_0xe4d1('0x2f')]=function(_0x3ffe9e,_0x27b68f){var _0x55b40e={},_0xda8b29={},_0x2428c7={'count':0x0,'rows':[]};var _0x5a0dad=_[_0xe4d1('0x30')](db[_0xe4d1('0x31')][_0xe4d1('0x32')],function(_0x582f42){return{'name':_0x582f42['fieldName'],'type':_0x582f42['type'][_0xe4d1('0x33')]};});_0xda8b29[_0xe4d1('0x34')]=_[_0xe4d1('0x30')](_0x5a0dad,_0xe4d1('0x2d'));_0xda8b29[_0xe4d1('0x35')]=_['keys'](_0x3ffe9e['query']);_0xda8b29[_0xe4d1('0x36')]=_[_0xe4d1('0x37')](_0xda8b29[_0xe4d1('0x34')],_0xda8b29[_0xe4d1('0x35')]);_0x55b40e[_0xe4d1('0x38')]=_['intersection'](_0xda8b29['model'],qs['fields'](_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x39')]));_0x55b40e[_0xe4d1('0x38')]=_0x55b40e[_0xe4d1('0x38')]['length']?_0x55b40e[_0xe4d1('0x38')]:_0xda8b29[_0xe4d1('0x34')];if(!_0x3ffe9e['query']['hasOwnProperty'](_0xe4d1('0x3a'))){_0x55b40e[_0xe4d1('0x24')]=qs[_0xe4d1('0x24')](_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x24')]);_0x55b40e['offset']=qs[_0xe4d1('0x22')](_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x22')]);}_0x55b40e[_0xe4d1('0x3b')]=qs[_0xe4d1('0x3c')](_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x3c')]);_0x55b40e[_0xe4d1('0x3d')]=qs['filters'](_[_0xe4d1('0x3e')](_0x3ffe9e['query'],_0xda8b29['filters']),_0x5a0dad);if(_0x3ffe9e['query'][_0xe4d1('0x3f')]){_0x55b40e['where']=_[_0xe4d1('0x40')](_0x55b40e[_0xe4d1('0x3d')],{'$or':_[_0xe4d1('0x30')](_0x5a0dad,function(_0x48fab4){if(_0x48fab4[_0xe4d1('0x41')]!==_0xe4d1('0x42')){var _0x387c17={};_0x387c17[_0x48fab4[_0xe4d1('0x2d')]]={'$like':'%'+_0x3ffe9e[_0xe4d1('0x35')]['filter']+'%'};return _0x387c17;}})});}_0x55b40e=_[_0xe4d1('0x40')]({},_0x55b40e,_0x3ffe9e[_0xe4d1('0x43')]);var _0x56dde1={'where':_0x55b40e[_0xe4d1('0x3d')]};return db['ChatGroup']['count'](_0x56dde1)['then'](function(_0x3dcb11){_0x2428c7['count']=_0x3dcb11;if(_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x44')]){_0x55b40e['include']=[{'all':!![]}];}return db[_0xe4d1('0x31')][_0xe4d1('0x45')](_0x55b40e);})[_0xe4d1('0x2c')](function(_0x1190ee){_0x2428c7[_0xe4d1('0x46')]=_0x1190ee;return _0x2428c7;})[_0xe4d1('0x2c')](respondWithFilteredResult(_0x27b68f,_0x55b40e))['catch'](handleError(_0x27b68f,null));};exports[_0xe4d1('0x47')]=function(_0x3f29e6,_0x3034e5){var _0x1bb394={'raw':!![],'where':{'id':_0x3f29e6[_0xe4d1('0x48')]['id']}},_0xc6c416={};_0xc6c416[_0xe4d1('0x34')]=_[_0xe4d1('0x49')](db[_0xe4d1('0x31')]['rawAttributes']);_0xc6c416['query']=_['keys'](_0x3f29e6[_0xe4d1('0x35')]);_0xc6c416['filters']=_[_0xe4d1('0x37')](_0xc6c416[_0xe4d1('0x34')],_0xc6c416[_0xe4d1('0x35')]);_0x1bb394[_0xe4d1('0x38')]=_[_0xe4d1('0x37')](_0xc6c416[_0xe4d1('0x34')],qs[_0xe4d1('0x39')](_0x3f29e6[_0xe4d1('0x35')][_0xe4d1('0x39')]));_0x1bb394[_0xe4d1('0x38')]=_0x1bb394[_0xe4d1('0x38')][_0xe4d1('0x4a')]?_0x1bb394[_0xe4d1('0x38')]:_0xc6c416[_0xe4d1('0x34')];if(_0x3f29e6[_0xe4d1('0x35')][_0xe4d1('0x44')]){_0x1bb394[_0xe4d1('0x4b')]=[{'all':!![]}];}_0x1bb394=_[_0xe4d1('0x40')]({},_0x1bb394,_0x3f29e6[_0xe4d1('0x43')]);return db['ChatGroup'][_0xe4d1('0x4c')](_0x1bb394)[_0xe4d1('0x2c')](handleEntityNotFound(_0x3034e5,null))[_0xe4d1('0x2c')](respondWithResult(_0x3034e5,null))[_0xe4d1('0x4d')](handleError(_0x3034e5,null));};exports['create']=function(_0x25348e,_0xeb6338){return db[_0xe4d1('0x31')][_0xe4d1('0x4e')](_0x25348e['body'],{})['then'](respondWithResult(_0xeb6338,0xc9))[_0xe4d1('0x4d')](handleError(_0xeb6338,null));};exports[_0xe4d1('0x4f')]=function(_0x5a6ef9,_0x1afb06){if(_0x5a6ef9[_0xe4d1('0x50')]['id']){delete _0x5a6ef9[_0xe4d1('0x50')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x5a6ef9[_0xe4d1('0x48')]['id']}})[_0xe4d1('0x2c')](handleEntityNotFound(_0x1afb06,null))[_0xe4d1('0x2c')](saveUpdates(_0x5a6ef9[_0xe4d1('0x50')],null))[_0xe4d1('0x2c')](respondWithResult(_0x1afb06,null))[_0xe4d1('0x4d')](handleError(_0x1afb06,null));};exports[_0xe4d1('0x2b')]=function(_0x19c181,_0x16d4e1){return db[_0xe4d1('0x31')]['find']({'where':{'id':_0x19c181[_0xe4d1('0x48')]['id']}})['then'](handleEntityNotFound(_0x16d4e1,null))[_0xe4d1('0x2c')](removeEntity(_0x16d4e1,null))[_0xe4d1('0x4d')](handleError(_0x16d4e1,null));};exports[_0xe4d1('0x51')]=function(_0x1fc659,_0x136051){return db[_0xe4d1('0x31')][_0xe4d1('0x51')]()[_0xe4d1('0x2c')](respondWithResult(_0x136051,null))[_0xe4d1('0x4d')](handleError(_0x136051,null));};exports['getUnread']=function(_0x52587b,_0x4dbcbc,_0x4473c5){return db[_0xe4d1('0x52')][_0xe4d1('0x25')]({'where':{'ChatGroupId':_0x52587b[_0xe4d1('0x48')]['id'],'ToId':_0x52587b[_0xe4d1('0x53')]['id'],'read':![]}})['then'](function(_0x2f9a96){return{'id':_['toInteger'](_0x52587b['params']['id']),'count':_0x2f9a96};})['then'](respondWithResult(_0x4dbcbc,null))[_0xe4d1('0x4d')](handleError(_0x4dbcbc,null));};exports[_0xe4d1('0x54')]=function(_0x330d7f,_0xfbf24c,_0x2c16f6){return db[_0xe4d1('0x31')][_0xe4d1('0x4c')]({'where':{'id':_0x330d7f['params']['id']}})[_0xe4d1('0x2c')](handleEntityNotFound(_0xfbf24c,null))[_0xe4d1('0x2c')](function(_0xf8983c){if(_0xf8983c){return _0xf8983c['addMembers'](_0x330d7f[_0xe4d1('0x50')][_0xe4d1('0x55')],_['omit'](_0x330d7f[_0xe4d1('0x50')],[_0xe4d1('0x55'),'id'])||{});}})[_0xe4d1('0x2c')](respondWithResult(_0xfbf24c,null))[_0xe4d1('0x4d')](handleError(_0xfbf24c,null));};exports['getMembers']=function(_0x2ce87c,_0x1043bc,_0x3bf383){var _0xc4114f={};var _0x4013e8={};var _0x3e5e2c;var _0x5faa93;return db[_0xe4d1('0x31')][_0xe4d1('0x56')]({'where':{'id':_0x2ce87c['params']['id']}})['then'](handleEntityNotFound(_0x1043bc,null))[_0xe4d1('0x2c')](function(_0xe30d5a){if(_0xe30d5a){_0x3e5e2c=_0xe30d5a;_0x4013e8[_0xe4d1('0x34')]=_[_0xe4d1('0x49')](db[_0xe4d1('0x57')][_0xe4d1('0x32')]);_0x4013e8[_0xe4d1('0x35')]=_[_0xe4d1('0x49')](_0x2ce87c[_0xe4d1('0x35')]);_0x4013e8[_0xe4d1('0x36')]=_[_0xe4d1('0x37')](_0x4013e8[_0xe4d1('0x34')],_0x4013e8[_0xe4d1('0x35')]);_0xc4114f[_0xe4d1('0x38')]=_[_0xe4d1('0x37')](_0x4013e8[_0xe4d1('0x34')],qs[_0xe4d1('0x39')](_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x39')]));_0xc4114f[_0xe4d1('0x38')]=_0xc4114f[_0xe4d1('0x38')][_0xe4d1('0x4a')]?_0xc4114f[_0xe4d1('0x38')]:_0x4013e8['model'];_0xc4114f[_0xe4d1('0x3b')]=qs[_0xe4d1('0x3c')](_0x2ce87c[_0xe4d1('0x35')]['sort']);_0xc4114f[_0xe4d1('0x3d')]=qs[_0xe4d1('0x36')](_[_0xe4d1('0x3e')](_0x2ce87c['query'],_0x4013e8[_0xe4d1('0x36')]));if(_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x3f')]){_0xc4114f[_0xe4d1('0x3d')]=_['merge'](_0xc4114f[_0xe4d1('0x3d')],{'$or':_[_0xe4d1('0x30')](_0xc4114f[_0xe4d1('0x38')],function(_0x28f72f){var _0x3e4325={};_0x3e4325[_0x28f72f]={'$like':'%'+_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x3f')]+'%'};return _0x3e4325;})});}_0xc4114f=_[_0xe4d1('0x40')]({},_0xc4114f,_0x2ce87c[_0xe4d1('0x43')]);return _0x3e5e2c[_0xe4d1('0x58')](_0xc4114f);}})[_0xe4d1('0x2c')](function(_0x160de3){if(_0x160de3){_0x5faa93=_0x160de3[_0xe4d1('0x4a')];if(!_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x59')]('nolimit')){_0xc4114f[_0xe4d1('0x24')]=qs['limit'](_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x24')]);_0xc4114f[_0xe4d1('0x22')]=qs[_0xe4d1('0x22')](_0x2ce87c[_0xe4d1('0x35')]['offset']);}return _0x3e5e2c[_0xe4d1('0x58')](_0xc4114f);}})[_0xe4d1('0x2c')](function(_0x6e7ddc){if(_0x6e7ddc){return _0x6e7ddc?{'count':_0x5faa93,'rows':_0x6e7ddc}:null;}})[_0xe4d1('0x2c')](respondWithResult(_0x1043bc,null))[_0xe4d1('0x4d')](handleError(_0x1043bc,null));};exports[_0xe4d1('0x5a')]=function(_0x21bcd0,_0x8cfc33,_0x1544db){return db[_0xe4d1('0x31')][_0xe4d1('0x4c')]({'where':{'id':_0x21bcd0['params']['id']}})[_0xe4d1('0x2c')](handleEntityNotFound(_0x8cfc33,null))[_0xe4d1('0x2c')](function(_0x23ded2){if(_0x23ded2){return _0x23ded2[_0xe4d1('0x5a')](_0x21bcd0[_0xe4d1('0x35')]['ids']);}})[_0xe4d1('0x2c')](respondWithStatusCode(_0x8cfc33,null))[_0xe4d1('0x4d')](handleError(_0x8cfc33,null));};exports[_0xe4d1('0x5b')]=function(_0x1d5a7d,_0x21f45f,_0x3de18f){if(_0x1d5a7d[_0xe4d1('0x50')]['id']){delete _0x1d5a7d[_0xe4d1('0x50')]['id'];}return db['ChatGroup'][_0xe4d1('0x4c')]({'where':{'id':_0x1d5a7d['params']['id']}})[_0xe4d1('0x2c')](handleEntityNotFound(_0x21f45f,null))[_0xe4d1('0x2c')](function(_0x2f676e){if(_0x2f676e){_0x1d5a7d['body'][_0xe4d1('0x5c')]=_0x2f676e['id'];return db[_0xe4d1('0x52')][_0xe4d1('0x4e')](_0x1d5a7d[_0xe4d1('0x50')]);}})[_0xe4d1('0x2c')](respondWithResult(_0x21f45f,null))[_0xe4d1('0x4d')](handleError(_0x21f45f,null));};exports[_0xe4d1('0x5d')]=function(_0x2d1b49,_0xaf3d5,_0x7484ba){var _0x4fbdba={};var _0x7c9706={};var _0x523ca1;var _0x20f955;return db[_0xe4d1('0x31')][_0xe4d1('0x56')]({'where':{'id':_0x2d1b49[_0xe4d1('0x48')]['id']}})['then'](handleEntityNotFound(_0xaf3d5,null))[_0xe4d1('0x2c')](function(_0xf9e316){if(_0xf9e316){_0x523ca1=_0xf9e316;_0x7c9706[_0xe4d1('0x34')]=_[_0xe4d1('0x49')](db[_0xe4d1('0x52')]['rawAttributes']);_0x7c9706['query']=_['keys'](_0x2d1b49[_0xe4d1('0x35')]);_0x7c9706['filters']=_[_0xe4d1('0x37')](_0x7c9706[_0xe4d1('0x34')],_0x7c9706['query']);_0x4fbdba[_0xe4d1('0x38')]=_[_0xe4d1('0x37')](_0x7c9706['model'],qs['fields'](_0x2d1b49[_0xe4d1('0x35')]['fields']));_0x4fbdba[_0xe4d1('0x38')]=_0x4fbdba[_0xe4d1('0x38')]['length']?_0x4fbdba['attributes']:_0x7c9706[_0xe4d1('0x34')];_0x4fbdba['order']=qs['sort'](_0x2d1b49[_0xe4d1('0x35')]['sort']);_0x4fbdba['where']=qs[_0xe4d1('0x36')](_[_0xe4d1('0x3e')](_0x2d1b49['query'],_0x7c9706[_0xe4d1('0x36')]));if(_0x2d1b49[_0xe4d1('0x35')]['filter']){_0x4fbdba[_0xe4d1('0x3d')]=_[_0xe4d1('0x40')](_0x4fbdba['where'],{'$or':_[_0xe4d1('0x30')](_0x4fbdba[_0xe4d1('0x38')],function(_0x4dbca9){var _0x37fa2c={};_0x37fa2c[_0x4dbca9]={'$like':'%'+_0x2d1b49[_0xe4d1('0x35')][_0xe4d1('0x3f')]+'%'};return _0x37fa2c;})});}if(_0x2d1b49[_0xe4d1('0x35')][_0xe4d1('0x5e')]){var _0x36ea2d=_0x2d1b49[_0xe4d1('0x35')]['$gte']['split'](',');var _0x47e745={};_0x47e745[_0x36ea2d[0x0]]={'$gte':moment(_0x36ea2d[0x1])[_0xe4d1('0x5f')](_0xe4d1('0x60'))};_0x4fbdba[_0xe4d1('0x3d')]=_[_0xe4d1('0x40')](_0x4fbdba[_0xe4d1('0x3d')],_0x47e745);}_0x4fbdba=_[_0xe4d1('0x40')]({},_0x4fbdba,_0x2d1b49[_0xe4d1('0x43')]);return _0x523ca1['getMessages'](_0x4fbdba);}})[_0xe4d1('0x2c')](function(_0x1cbdd0){if(_0x1cbdd0){_0x20f955=_0x1cbdd0[_0xe4d1('0x4a')];if(!_0x2d1b49['query'][_0xe4d1('0x59')](_0xe4d1('0x3a'))){_0x4fbdba[_0xe4d1('0x24')]=qs['limit'](_0x2d1b49[_0xe4d1('0x35')][_0xe4d1('0x24')]);_0x4fbdba[_0xe4d1('0x22')]=qs[_0xe4d1('0x22')](_0x2d1b49['query'][_0xe4d1('0x22')]);}return _0x523ca1['getMessages'](_0x4fbdba);}})[_0xe4d1('0x2c')](function(_0x2093ab){if(_0x2093ab){return _0x2093ab?{'count':_0x20f955,'rows':_0x2093ab}:null;}})['then'](respondWithResult(_0xaf3d5,null))[_0xe4d1('0x4d')](handleError(_0xaf3d5,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index fb256f7..e46a145 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 _0xdf55=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x56900e,_0x1cff34){var _0x1a3d71=function(_0x1699f9){while(--_0x1699f9){_0x56900e['push'](_0x56900e['shift']());}};_0x1a3d71(++_0x1cff34);}(_0xdf55,0x83));var _0x5df5=function(_0x17cdd6,_0x94ae6d){_0x17cdd6=_0x17cdd6-0x0;var _0x42970a=_0xdf55[_0x17cdd6];return _0x42970a;};'use strict';var EventEmitter=require(_0x5df5('0x0'));var ChatGroup=require(_0x5df5('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5df5('0x2')](0x0);var events={'afterCreate':_0x5df5('0x3'),'afterUpdate':'update','afterDestroy':_0x5df5('0x4')};function emitEvent(_0x773e15){return function(_0x381a4c,_0x521007,_0x289af4){ChatGroupEvents[_0x5df5('0x5')](_0x773e15+':'+_0x381a4c['id'],_0x381a4c);ChatGroupEvents[_0x5df5('0x5')](_0x773e15,_0x381a4c);_0x289af4(null);};}for(var e in events){if(events[_0x5df5('0x6')](e)){var event=events[e];ChatGroup[_0x5df5('0x7')](e,emitEvent(event));}}module[_0x5df5('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x0ce9=['hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5d9538,_0x3ffeb5){var _0x19cf14=function(_0xe0349a){while(--_0xe0349a){_0x5d9538['push'](_0x5d9538['shift']());}};_0x19cf14(++_0x3ffeb5);}(_0x0ce9,0x9a));var _0x90ce=function(_0x1adbd1,_0x130e7c){_0x1adbd1=_0x1adbd1-0x0;var _0x100ca5=_0x0ce9[_0x1adbd1];return _0x100ca5;};'use strict';var EventEmitter=require(_0x90ce('0x0'));var ChatGroup=require(_0x90ce('0x1'))['db'][_0x90ce('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x90ce('0x3')](0x0);var events={'afterCreate':_0x90ce('0x4'),'afterUpdate':'update','afterDestroy':_0x90ce('0x5')};function emitEvent(_0x1e969e){return function(_0x1c18e0,_0x595446,_0x19202a){ChatGroupEvents[_0x90ce('0x6')](_0x1e969e+':'+_0x1c18e0['id'],_0x1c18e0);ChatGroupEvents[_0x90ce('0x6')](_0x1e969e,_0x1c18e0);_0x19202a(null);};}for(var e in events){if(events[_0x90ce('0x7')](e)){var event=events[e];ChatGroup[_0x90ce('0x8')](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 280e702..cd714dd 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 _0xff7d=['api','moment','bluebird','request-promise','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util'];(function(_0xca0f4f,_0x59bb30){var _0x4c53f6=function(_0x414ca1){while(--_0x414ca1){_0xca0f4f['push'](_0xca0f4f['shift']());}};_0x4c53f6(++_0x59bb30);}(_0xff7d,0x18e));var _0xdff7=function(_0x2cdf33,_0x1e69e6){_0x2cdf33=_0x2cdf33-0x0;var _0x1a83dc=_0xff7d[_0x2cdf33];return _0x1a83dc;};'use strict';var _=require(_0xdff7('0x0'));var util=require(_0xdff7('0x1'));var logger=require('../../config/logger')(_0xdff7('0x2'));var moment=require(_0xdff7('0x3'));var BPromise=require(_0xdff7('0x4'));var rp=require(_0xdff7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdff7('0x6'));module['exports']=function(_0x35c482,_0x409ec7){return _0x35c482[_0xdff7('0x7')](_0xdff7('0x8'),attributes,{'tableName':_0xdff7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2831=['chat_groups','lodash','api','bluebird','request-promise','path','./chatGroup.attributes','define','ChatGroup'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2831,0xa3));var _0x1283=function(_0x1b353c,_0x493626){_0x1b353c=_0x1b353c-0x0;var _0x3a261f=_0x2831[_0x1b353c];return _0x3a261f;};'use strict';var _=require(_0x1283('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1283('0x1'));var moment=require('moment');var BPromise=require(_0x1283('0x2'));var rp=require(_0x1283('0x3'));var fs=require('fs');var path=require(_0x1283('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1283('0x5'));module['exports']=function(_0x70bbd1,_0x23907d){return _0x70bbd1[_0x1283('0x6')](_0x1283('0x7'),attributes,{'tableName':_0x1283('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index f9ab5b0..f6197d3 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 _0x8388=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x120295,_0x103efe){var _0x13a826=function(_0x5308be){while(--_0x5308be){_0x120295['push'](_0x120295['shift']());}};_0x13a826(++_0x103efe);}(_0x8388,0x18d));var _0x8838=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0x8388[_0x4854d6];return _0x3885c0;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});config[_0x8838('0xb')]=_[_0x8838('0xc')](config[_0x8838('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8838('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x8838('0xe')](socket);function respondWithRpcPromise(_0x4b5419,_0x4aedc9,_0x336b66){return new BPromise(function(_0x28de3d,_0x1e728e){return client[_0x8838('0xf')](_0x4b5419,_0x336b66)['then'](function(_0xd472af){logger[_0x8838('0x10')](_0x8838('0x11'),_0x4aedc9,_0x8838('0x12'));logger['debug'](_0x8838('0x13'),_0x4aedc9,'request\x20sent',JSON['stringify'](_0xd472af));if(_0xd472af[_0x8838('0x14')]){if(_0xd472af[_0x8838('0x14')][_0x8838('0x15')]===0x1f4){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);return _0x1e728e(_0xd472af[_0x8838('0x14')]['message']);}logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af['error'][_0x8838('0x16')]);return _0x28de3d(_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);}else{logger['info'](_0x8838('0x11'),_0x4aedc9,'request\x20sent');_0x28de3d(_0xd472af[_0x8838('0x17')][_0x8838('0x16')]);}})[_0x8838('0x18')](function(_0x4eb6e2){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0x4eb6e2);_0x1e728e(_0x4eb6e2);});});} \ No newline at end of file +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','./chatGroup.socket','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0xe7d561,_0x146cef){var _0x4c27f0=function(_0x287ac7){while(--_0x287ac7){_0xe7d561['push'](_0xe7d561['shift']());}};_0x4c27f0(++_0x146cef);}(_0x8e52,0x1c6));var _0x28e5=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x8e52[_0x1cbcf1];return _0x3a06f0;};'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']('ChatGroup,\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 diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f01add7..c27b9c9 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 _0x1b02=['chatGroup:','./chatGroup.events','update','emit','removeListener','register','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1b02,0x151));var _0x21b0=function(_0x10346c,_0x183ce6){_0x10346c=_0x10346c-0x0;var _0x262bd4=_0x1b02[_0x10346c];return _0x262bd4;};'use strict';var ChatGroupEvents=require(_0x21b0('0x0'));var events=['save','remove',_0x21b0('0x1')];function createListener(_0xcdcc4e,_0x1d752e){return function(_0x19fcfb){_0x1d752e[_0x21b0('0x2')](_0xcdcc4e,_0x19fcfb);};}function removeListener(_0x47de39,_0x3497c6){return function(){ChatGroupEvents[_0x21b0('0x3')](_0x47de39,_0x3497c6);};}exports[_0x21b0('0x4')]=function(_0x4b793a){for(var _0x1c78c8=0x0,_0x325bb9=events[_0x21b0('0x5')];_0x1c78c8<_0x325bb9;_0x1c78c8++){var _0x478daf=events[_0x1c78c8];var _0x2d84bd=createListener(_0x21b0('0x6')+_0x478daf,_0x4b793a);ChatGroupEvents['on'](_0x478daf,_0x2d84bd);}}; \ No newline at end of file +var _0x8fe6=['removeListener','register','./chatGroup.events','save','remove','update','emit'];(function(_0x2e7316,_0x4e251d){var _0x44fe17=function(_0x5db5f0){while(--_0x5db5f0){_0x2e7316['push'](_0x2e7316['shift']());}};_0x44fe17(++_0x4e251d);}(_0x8fe6,0x19f));var _0x68fe=function(_0x110af4,_0x5570be){_0x110af4=_0x110af4-0x0;var _0x409bf6=_0x8fe6[_0x110af4];return _0x409bf6;};'use strict';var ChatGroupEvents=require(_0x68fe('0x0'));var events=[_0x68fe('0x1'),_0x68fe('0x2'),_0x68fe('0x3')];function createListener(_0x339177,_0x2e99f2){return function(_0x72a292){_0x2e99f2[_0x68fe('0x4')](_0x339177,_0x72a292);};}function removeListener(_0x2a549e,_0xdf1490){return function(){ChatGroupEvents[_0x68fe('0x5')](_0x2a549e,_0xdf1490);};}exports[_0x68fe('0x6')]=function(_0x592073){for(var _0x5120ba=0x0,_0x4d814c=events['length'];_0x5120ba<_0x4d814c;_0x5120ba++){var _0x952e5a=events[_0x5120ba];var _0x13daca=createListener('chatGroup:'+_0x952e5a,_0x592073);ChatGroupEvents['on'](_0x952e5a,_0x13daca);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 5d2e154..5a91882 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 _0x19a0=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','removeMembers'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x19a0,0x156));var _0x019a=function(_0x4387a9,_0x4dee1e){_0x4387a9=_0x4387a9-0x0;var _0x2b228e=_0x19a0[_0x4387a9];return _0x2b228e;};'use strict';var multer=require(_0x019a('0x0'));var util=require('util');var path=require(_0x019a('0x1'));var timeout=require(_0x019a('0x2'));var express=require(_0x019a('0x3'));var router=express[_0x019a('0x4')]();var fs_extra=require(_0x019a('0x5'));var auth=require(_0x019a('0x6'));var interaction=require(_0x019a('0x7'));var config=require(_0x019a('0x8'));var controller=require(_0x019a('0x9'));router[_0x019a('0xa')]('/',auth[_0x019a('0xb')](),controller[_0x019a('0xc')]);router[_0x019a('0xa')](_0x019a('0xd'),auth[_0x019a('0xb')](),controller[_0x019a('0xe')]);router[_0x019a('0xa')](_0x019a('0xf'),auth[_0x019a('0xb')](),controller['show']);router[_0x019a('0xa')](_0x019a('0x10'),auth[_0x019a('0xb')](),controller[_0x019a('0x11')]);router[_0x019a('0xa')](_0x019a('0x12'),auth['isAuthenticated'](),controller[_0x019a('0x13')]);router[_0x019a('0xa')](_0x019a('0x14'),auth[_0x019a('0xb')](),controller[_0x019a('0x15')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x019a('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0x019a('0x17')]);router[_0x019a('0x16')](_0x019a('0x14'),auth[_0x019a('0xb')](),controller[_0x019a('0x18')]);router[_0x019a('0x19')](_0x019a('0xf'),auth[_0x019a('0xb')](),controller[_0x019a('0x1a')]);router[_0x019a('0x1b')]('/:id',auth[_0x019a('0xb')](),controller[_0x019a('0x1c')]);router[_0x019a('0x1b')](_0x019a('0x12'),auth[_0x019a('0xb')](),controller[_0x019a('0x1d')]);module[_0x019a('0x1e')]=router; \ No newline at end of file +var _0xfcae=['/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','/:id','delete','removeMembers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','getUnread'];(function(_0x260efc,_0x6545d0){var _0x56fc0f=function(_0x36b313){while(--_0x36b313){_0x260efc['push'](_0x260efc['shift']());}};_0x56fc0f(++_0x6545d0);}(_0xfcae,0x143));var _0xefca=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfcae[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0xefca('0x0'));var path=require(_0xefca('0x1'));var timeout=require(_0xefca('0x2'));var express=require(_0xefca('0x3'));var router=express[_0xefca('0x4')]();var fs_extra=require(_0xefca('0x5'));var auth=require(_0xefca('0x6'));var interaction=require(_0xefca('0x7'));var config=require(_0xefca('0x8'));var controller=require('./chatGroup.controller');router[_0xefca('0x9')]('/',auth[_0xefca('0xa')](),controller['index']);router[_0xefca('0x9')](_0xefca('0xb'),auth[_0xefca('0xa')](),controller[_0xefca('0xc')]);router[_0xefca('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xefca('0xd')]);router[_0xefca('0x9')]('/:id/unread',auth[_0xefca('0xa')](),controller[_0xefca('0xe')]);router[_0xefca('0x9')](_0xefca('0xf'),auth[_0xefca('0xa')](),controller[_0xefca('0x10')]);router['get'](_0xefca('0x11'),auth[_0xefca('0xa')](),controller[_0xefca('0x12')]);router[_0xefca('0x13')]('/',auth[_0xefca('0xa')](),controller['create']);router[_0xefca('0x13')](_0xefca('0xf'),auth['isAuthenticated'](),controller[_0xefca('0x14')]);router[_0xefca('0x13')](_0xefca('0x11'),auth[_0xefca('0xa')](),controller[_0xefca('0x15')]);router[_0xefca('0x16')](_0xefca('0x17'),auth['isAuthenticated'](),controller['update']);router[_0xefca('0x18')]('/:id',auth[_0xefca('0xa')](),controller['destroy']);router[_0xefca('0x18')]('/:id/members',auth[_0xefca('0xa')](),controller[_0xefca('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 0f2ba28..db9ddc3 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 _0xa478=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x35c46a,_0x43e9c8){var _0x2febb8=function(_0x3e59ae){while(--_0x3e59ae){_0x35c46a['push'](_0x35c46a['shift']());}};_0x2febb8(++_0x43e9c8);}(_0xa478,0x136));var _0x8a47=function(_0x1af8d3,_0x544d86){_0x1af8d3=_0x1af8d3-0x0;var _0x3a50c5=_0xa478[_0x1af8d3];return _0x3a50c5;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'closed':{'type':Sequelize[_0x8a47('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8a47('0x3')]},'ratingType':{'type':Sequelize[_0x8a47('0x4')](_0x8a47('0x5'),_0x8a47('0x6')),'defaultValue':_0x8a47('0x5')},'ratingMessage':{'type':Sequelize[_0x8a47('0x7')]},'pathTranscript':{'type':Sequelize[_0x8a47('0x7')]},'mailTranscript':{'type':Sequelize[_0x8a47('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8a47('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8a47('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8a47('0x8')]},'note':{'type':Sequelize[_0x8a47('0x8')]},'browserName':{'type':Sequelize[_0x8a47('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8a47('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x8a47('0x8')]},'deviceVendor':{'type':Sequelize[_0x8a47('0x8')]},'deviceType':{'type':Sequelize[_0x8a47('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x8a47('0x8')]},'formData':{'type':Sequelize[_0x8a47('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x8a47('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8a47('0x4')]('in',_0x8a47('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8a47('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x263f=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','TEXT','DATE','STRING','long'];(function(_0x3a1b90,_0x3c0158){var _0xf6de77=function(_0x396533){while(--_0x396533){_0x3a1b90['push'](_0x3a1b90['shift']());}};_0xf6de77(++_0x3c0158);}(_0x263f,0x182));var _0xf263=function(_0x36f194,_0x460f00){_0x36f194=_0x36f194-0x0;var _0x526d83=_0x263f[_0x36f194];return _0x526d83;};'use strict';var Sequelize=require(_0xf263('0x0'));module[_0xf263('0x1')]={'closed':{'type':Sequelize[_0xf263('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf263('0x3')]},'ratingType':{'type':Sequelize[_0xf263('0x4')](_0xf263('0x5'),'thumb'),'defaultValue':_0xf263('0x5')},'ratingMessage':{'type':Sequelize[_0xf263('0x6')]},'pathTranscript':{'type':Sequelize[_0xf263('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf263('0x7')]},'disposition':{'type':Sequelize[_0xf263('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf263('0x8')]},'browserName':{'type':Sequelize[_0xf263('0x8')]},'browserVersion':{'type':Sequelize[_0xf263('0x8')]},'osName':{'type':Sequelize[_0xf263('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xf263('0x8')]},'deviceVendor':{'type':Sequelize[_0xf263('0x8')]},'deviceType':{'type':Sequelize[_0xf263('0x8')]},'referer':{'type':Sequelize[_0xf263('0x6')]},'customerIp':{'type':Sequelize[_0xf263('0x8')]},'formData':{'type':Sequelize[_0xf263('0x6')](_0xf263('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xf263('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf263('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xf263('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf263('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index c2cb76d..5843527 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 _0x2032=['nolimit','order','sort','pick','field','color','tools_tags','select','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','o.id\x20=\x20i.UserId','chat_websites','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','$gte','parse','where','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.lastName','c.email','Contact.phone','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','keys','include','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','addTags','ids','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','customerIp','customerPort','tail','createReadStream','pipe','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','socket.io-emitter','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','destroy','end','name','send','merge','body','contact','agent','Users','map','fullname','TagIds','forEach','Tags','index','ChatInteraction','rawAttributes','type','model','query','filters','attributes','intersection','length','hasOwnProperty'];(function(_0x785a63,_0x5326ec){var _0x44b81e=function(_0x2cf419){while(--_0x2cf419){_0x785a63['push'](_0x785a63['shift']());}};_0x44b81e(++_0x5326ec);}(_0x2032,0xd9));var _0x2203=function(_0x168a04,_0x3dd149){_0x168a04=_0x168a04-0x0;var _0x42a9b9=_0x2032[_0x168a04];return _0x42a9b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x2203('0x14'));var logger=require('../../config/logger')(_0x2203('0x15'));var utils=require('../../config/utils');var config=require(_0x2203('0x16'));var licenseUtil=require(_0x2203('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2203('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2203('0x19')](socket);var jayson=require(_0x2203('0x1a'));var client=jayson[_0x2203('0x1b')][_0x2203('0x1c')]({'port':0x232b});var client9004=jayson[_0x2203('0x1b')][_0x2203('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2c36e6,_0x2c085c,_0xdf9d0b,_0x3053f3){return new BPromise(function(_0x5129fb,_0x280eda){var _0x2ee127=_0x3053f3||client;return _0x2ee127['request'](_0x2c36e6,_0xdf9d0b)[_0x2203('0x1d')](function(_0x8906e1){logger['info'](_0x2203('0x1e'),_0x2c085c,'request\x20sent');logger[_0x2203('0x1f')](_0x2203('0x20'),_0x2c085c,_0x2203('0x21'),JSON[_0x2203('0x22')](_0x8906e1));if(_0x8906e1[_0x2203('0x23')]){if(_0x8906e1[_0x2203('0x23')]['code']===0x1f4){logger[_0x2203('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x2c085c,_0x8906e1['error'][_0x2203('0x24')]);return _0x280eda(_0x8906e1['error'][_0x2203('0x24')]);}logger[_0x2203('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x2c085c,_0x8906e1[_0x2203('0x23')]['message']);return _0x5129fb(_0x8906e1['error'][_0x2203('0x24')]);}else{logger[_0x2203('0x25')](_0x2203('0x1e'),_0x2c085c,_0x2203('0x21'));_0x5129fb(_0x8906e1[_0x2203('0x26')][_0x2203('0x24')]);}})[_0x2203('0x27')](function(_0x250349){logger['error'](_0x2203('0x1e'),_0x2c085c,_0x250349);_0x280eda(_0x250349);});});}function respondWithStatusCode(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0xcc;return function(_0x5f11bf){if(_0x5f11bf){return _0x36b958[_0x2203('0x28')](_0x39a11a);}return _0x36b958[_0x2203('0x29')](_0x39a11a)['end']();};}function respondWithResult(_0xd6e109,_0xd91f5d){_0xd91f5d=_0xd91f5d||0xc8;return function(_0x1c6a77){if(_0x1c6a77){return _0xd6e109[_0x2203('0x29')](_0xd91f5d)[_0x2203('0x2a')](_0x1c6a77);}};}function respondWithFilteredResult(_0x1df508,_0x9c53f){return function(_0x5a95c1){if(_0x5a95c1){var _0x34b8ba=typeof _0x9c53f[_0x2203('0x2b')]===_0x2203('0x2c')&&typeof _0x9c53f[_0x2203('0x2d')]==='undefined';var _0x3a8e23=_0x5a95c1[_0x2203('0x2e')];var _0x287c95=_0x34b8ba?0x0:_0x9c53f[_0x2203('0x2b')];var _0x520602=_0x34b8ba?_0x5a95c1[_0x2203('0x2e')]:_0x9c53f[_0x2203('0x2b')]+_0x9c53f['limit'];var _0x5c0157;if(_0x520602>=_0x3a8e23){_0x520602=_0x3a8e23;_0x5c0157=0xc8;}else{_0x5c0157=0xce;}_0x1df508[_0x2203('0x29')](_0x5c0157);return _0x1df508['set']('Content-Range',_0x287c95+'-'+_0x520602+'/'+_0x3a8e23)[_0x2203('0x2a')](_0x5a95c1);}return null;};}function patchUpdates(_0x464c88){return function(_0x191894){try{jsonpatch[_0x2203('0x2f')](_0x191894,_0x464c88,!![]);}catch(_0xf2801d){return BPromise['reject'](_0xf2801d);}return _0x191894[_0x2203('0x30')]();};}function saveUpdates(_0x2324c0,_0x49caec){return function(_0x2a2ee7){if(_0x2a2ee7){return _0x2a2ee7[_0x2203('0x31')](_0x2324c0)[_0x2203('0x1d')](function(_0x4187b4){return _0x4187b4;});}return null;};}function removeEntity(_0x43fee1,_0x24d138){return function(_0x29da55){if(_0x29da55){return _0x29da55[_0x2203('0x32')]()[_0x2203('0x1d')](function(){_0x43fee1['status'](0xcc)[_0x2203('0x33')]();});}};}function handleEntityNotFound(_0x347d3e,_0x56f9b2){return function(_0x54b90b){if(!_0x54b90b){_0x347d3e[_0x2203('0x28')](0x194);}return _0x54b90b;};}function handleError(_0x5e9841,_0x25cc97){_0x25cc97=_0x25cc97||0x1f4;return function(_0x3b1eeb){logger[_0x2203('0x23')](_0x3b1eeb['stack']);if(_0x3b1eeb['name']){delete _0x3b1eeb[_0x2203('0x34')];}_0x5e9841['status'](_0x25cc97)[_0x2203('0x35')](_0x3b1eeb);};}function getMustacheRender(_0x5cfe5e,_0x11451e){return Mustache['render'](_0x5cfe5e,_[_0x2203('0x36')](_0x11451e[_0x2203('0x37')],{'contact':_0x11451e[_0x2203('0x38')],'message':_0x11451e[_0x2203('0x24')],'agent':_0x11451e[_0x2203('0x39')],'interaction':_0x11451e['interaction'],'account':_0x11451e['account']}))||'';}function getInteractionUsers(_0x4c0e9e,_0x7ea79b){return new BPromise(function(_0x25a2dc,_0x323798){try{if(_0x7ea79b[_0x4c0e9e['id']]){_0x4c0e9e[_0x2203('0x3a')]=_[_0x2203('0x3b')](_0x7ea79b[_0x4c0e9e['id']],function(_0x3b250a){return{'id':_0x3b250a['id'],'fullname':_0x3b250a[_0x2203('0x3c')]};});}}catch(_0x590b4e){_0x323798(_0x590b4e);}_0x25a2dc(_0x4c0e9e);});}function getInteractionTags(_0x175945,_0x1b12c3){return new BPromise(function(_0x108fde,_0x26be74){try{if(_0x175945['TagIds']){_0x175945['Tags']=[];_0x175945[_0x2203('0x3d')]['split'](',')[_0x2203('0x3e')](function(_0x446209){_0x175945[_0x2203('0x3f')]['push'](_0x1b12c3[_0x446209]);});}delete _0x175945['TagIds'];}catch(_0x1e7ebc){_0x26be74(_0x1e7ebc);}_0x108fde(_0x175945);});}function updateChatInteraction(_0x3739f6,_0x368444,_0x1e09f3){return new BPromise(function(_0x372709,_0x1fa734){return getInteractionUsers(_0x3739f6,_0x1e09f3)['then'](function(_0x15d3b6){return getInteractionTags(_0x15d3b6,_0x368444);})[_0x2203('0x1d')](function(_0x3a866c){_0x372709(_0x3a866c);})[_0x2203('0x27')](function(_0x16b452){_0x1fa734(_0x16b452);});});}exports[_0x2203('0x40')]=function(_0x5b4842,_0x23a6e8){var _0x36b8e4={},_0x1e34a0={},_0x595281={'count':0x0,'rows':[]};var _0x2e2ca5=_[_0x2203('0x3b')](db[_0x2203('0x41')][_0x2203('0x42')],function(_0x4c3259){return{'name':_0x4c3259['fieldName'],'type':_0x4c3259[_0x2203('0x43')]['key']};});_0x1e34a0[_0x2203('0x44')]=_[_0x2203('0x3b')](_0x2e2ca5,_0x2203('0x34'));_0x1e34a0[_0x2203('0x45')]=_['keys'](_0x5b4842[_0x2203('0x45')]);_0x1e34a0[_0x2203('0x46')]=_['intersection'](_0x1e34a0[_0x2203('0x44')],_0x1e34a0[_0x2203('0x45')]);_0x36b8e4[_0x2203('0x47')]=_[_0x2203('0x48')](_0x1e34a0['model'],qs['fields'](_0x5b4842[_0x2203('0x45')]['fields']));_0x36b8e4['attributes']=_0x36b8e4[_0x2203('0x47')][_0x2203('0x49')]?_0x36b8e4[_0x2203('0x47')]:_0x1e34a0['model'];if(!_0x5b4842['query'][_0x2203('0x4a')](_0x2203('0x4b'))){_0x36b8e4[_0x2203('0x2d')]=qs[_0x2203('0x2d')](_0x5b4842[_0x2203('0x45')][_0x2203('0x2d')]);_0x36b8e4['offset']=qs[_0x2203('0x2b')](_0x5b4842['query'][_0x2203('0x2b')]);}_0x36b8e4[_0x2203('0x4c')]=qs[_0x2203('0x4d')](_0x5b4842[_0x2203('0x45')]['sort']);_0x36b8e4['where']=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x5b4842[_0x2203('0x45')],_0x1e34a0[_0x2203('0x46')]),_0x2e2ca5);var _0x559370=[];var _0x4de47a=squel['select']()[_0x2203('0x4f')]('id')[_0x2203('0x4f')]('name')[_0x2203('0x4f')](_0x2203('0x50'))['from'](_0x2203('0x51'));var _0xb47204=squel[_0x2203('0x52')]()[_0x2203('0x4f')]('u.id')[_0x2203('0x4f')]('u.fullname')[_0x2203('0x4f')](_0x2203('0x53'))['from'](_0x2203('0x54'),'ui')[_0x2203('0x55')](_0x2203('0x56'),'u',_0x2203('0x57'));var _0x3f335a=squel[_0x2203('0x52')]()['from']('chat_interactions','i')[_0x2203('0x55')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2203('0x55')](_0x2203('0x56'),'o',_0x2203('0x58'))['left_join'](_0x2203('0x59'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x2203('0x5a'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0x2203('0x5b'))[_0x2203('0x55')](_0x2203('0x51'),'t',_0x2203('0x5c'));var _0x26d3d9=squel[_0x2203('0x5d')]();var _0x2baea2=[];var _0x91f70c=squel[_0x2203('0x5d')]();var _0x216641;if(_0x5b4842[_0x2203('0x45')][_0x2203('0x5e')]){_0x216641=as['parseSearch'](_0x5b4842['query'][_0x2203('0x5e')]);var _0x43d8c0=_0x216641[_0x2203('0x5f')];for(var _0x2446be=0x0;_0x2446be<_0x216641[_0x2203('0x60')][_0x2203('0x49')];_0x2446be++){var _0x4f8b8e=_0x216641['conditions'][_0x2446be];var _0xb49120='i';var _0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x4f8b8e[_0x2203('0x4f')]]);if(!_0x34358e){switch(_0x4f8b8e[_0x2203('0x4f')]){case _0x2203('0x62'):if(_0x4f8b8e[_0x2203('0x63')]==0x1){_0x3f335a[_0x2203('0x64')]('`'+_0x4f8b8e[_0x2203('0x4f')]+_0x2203('0x65'));}else{_0x3f335a['having']('`'+_0x4f8b8e[_0x2203('0x4f')]+_0x2203('0x66'));}break;case _0x2203('0x67'):if(_0x4f8b8e[_0x2203('0x68')]===_0x2203('0x69')){if(_0x4f8b8e[_0x2203('0x63')][_0x2203('0x6a')]('\x20')[_0x2203('0x49')]>0x1){_0x26d3d9[_0x43d8c0](_0x2203('0x6b'),qs[_0x2203('0x6c')](_0x4f8b8e[_0x2203('0x63')]),null);}else{var _0x6ea7e8='%'+_0x4f8b8e[_0x2203('0x63')]+'%';_0x26d3d9[_0x43d8c0](_0x2203('0x6d'),_0x6ea7e8,_0x6ea7e8,_0x6ea7e8);}}else{_0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x2203('0x6e')]);_0x4f8b8e[_0x2203('0x4f')]=_0x2203('0x6e');_0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e['type'],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d['value'][_0x2203('0x33')]);}break;case _0x2203('0x72'):var _0x1b4f96=_0x4f8b8e[_0x2203('0x63')][_0x2203('0x6a')](',')['map'](function(_0x38b077){return Number(_0x38b077);});_0x1b4f96[_0x2203('0x3e')](function(_0x1c63bf){_0x91f70c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1c63bf+',%');});_0x2baea2=_['union'](_0x2baea2,_0x1b4f96);break;case'User':if(_0x4f8b8e['operator']==='$substring'){_0x26d3d9[_0x43d8c0](_0x2203('0x73'),'%'+_0x4f8b8e[_0x2203('0x63')]+'%',null);}else{_0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x2203('0x74')]);_0x4f8b8e[_0x2203('0x4f')]=_0x2203('0x74');_0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e['type'],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d['text'],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);}break;case _0x2203('0x37'):_0xf16e1d=as[_0x2203('0x6f')]('me',null,_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);break;}}else{var _0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e[_0x2203('0x43')],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);}}}else{var _0x4b2e4f=_(_0x5b4842[_0x2203('0x45')])['keys']()[_0x2203('0x3b')](function(_0x55ecbb){return _[_0x2203('0x75')](_0x2e2ca5,[_0x2203('0x34'),_0x55ecbb])?_0x55ecbb:undefined;})[_0x2203('0x76')]()[_0x2203('0x63')]();if(!_[_0x2203('0x77')](_0x4b2e4f)){_0x4b2e4f[_0x2203('0x3e')](function(_0x3e1583){if(_0x3e1583===_0x2203('0x78')){_0x3f335a['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x2203('0x79')](_0x5b4842[_0x2203('0x45')][_0x3e1583]));}else if(_0x3e1583===_0x2203('0x7a')){var _0x484549=JSON['parse'](_0x5b4842['query'][_0x3e1583])[_0x2203('0x7b')];var _0x2d26ba=JSON[_0x2203('0x7c')](_0x5b4842[_0x2203('0x45')][_0x3e1583])['$lte'];_0x3f335a[_0x2203('0x7d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x484549,_0x2d26ba);}else{if(_0x5b4842[_0x2203('0x45')][_0x3e1583]===_0x2203('0x7e')){_0x3f335a[_0x2203('0x7d')]('i.'+_0x3e1583+_0x2203('0x7f'));}else{_0x3f335a[_0x2203('0x7d')]('i.'+_0x3e1583+'\x20=\x20?',_0x5b4842[_0x2203('0x45')][_0x3e1583]);}}});}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x80')]){if(_0x5b4842['query'][_0x2203('0x80')]==0x1){_0x3f335a[_0x2203('0x64')](_0x2203('0x81'));}else{_0x3f335a[_0x2203('0x64')](_0x2203('0x82'));}}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x83')]){_0x2baea2=_[_0x2203('0x84')](_0x5b4842[_0x2203('0x45')][_0x2203('0x83')])?_0x5b4842[_0x2203('0x45')]['tag']:new Array(_0x5b4842[_0x2203('0x45')][_0x2203('0x83')]);_0x2baea2[_0x2203('0x3e')](function(_0x2da37c){_0x91f70c['or'](_0x2203('0x85'),'%,'+_0x2da37c+',%');});}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x86')]){var _0x2a5a4b=_0x5b4842[_0x2203('0x45')][_0x2203('0x86')][_0x2203('0x87')]('\x5c','\x5c\x5c')[_0x2203('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2a5a4b)){_0x26d3d9['or']('i.id\x20LIKE\x20?',_0x2a5a4b+'%');}else{_0x26d3d9['or'](_0x2203('0x88'),qs[_0x2203('0x6c')](_0x2a5a4b))['or'](_0x2203('0x89'),_0x2a5a4b+'%');}}}_0x3f335a[_0x2203('0x7d')](_0x26d3d9);_0x3f335a[_0x2203('0x8a')]('i.id');var _0x16e518={'type':db[_0x2203('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4edac6=_0x3f335a['clone']();_0x4edac6['field'](_0x2203('0x8c'));_0x4edac6[_0x2203('0x4f')](_0x2203('0x8d'),'unreadMessages');if(_0x36b8e4['order']){_0x36b8e4['order'][_0x2203('0x3e')](function(_0x1e90c4){var _0x15d061=_0x1e90c4[0x0]===_0x2203('0x8e')?_0x1e90c4[0x0]:'i.'+_0x1e90c4[0x0];_0x3f335a[_0x2203('0x4c')](_0x15d061,_0x1e90c4[0x1]===_0x2203('0x8f')?![]:!![]);});}if(!_[_0x2203('0x77')](_0x2baea2)){_0x3f335a['having'](_0x91f70c);_0x4edac6[_0x2203('0x7d')](_0x2203('0x90'),_0x2baea2);}BPromise[_0x2203('0x91')]()[_0x2203('0x1d')](function(){if(!_0x216641){if(_0x5b4842[_0x2203('0x45')][_0x2203('0x78')])return;_0x4edac6[_0x2203('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3f335a[_0x2203('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5b4842['user'][_0x2203('0x92')]!=='agent')return;return _0x5b4842[_0x2203('0x93')][_0x2203('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x29d545){if(_[_0x2203('0x77')](_0x29d545)){_0x4edac6[_0x2203('0x7d')](_0x2203('0x95'));_0x3f335a[_0x2203('0x7d')](_0x2203('0x95'));}else{_0x4edac6['where'](_0x2203('0x96'),_[_0x2203('0x3b')](_0x29d545,'id'));_0x3f335a['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x2203('0x3b')](_0x29d545,'id'));}});})[_0x2203('0x1d')](function(){if(_0x5b4842[_0x2203('0x93')][_0x2203('0x92')]===_0x2203('0x39')&&!_0x216641&&!_0x5b4842[_0x2203('0x45')][_0x2203('0x78')])return[];return db[_0x2203('0x97')][_0x2203('0x45')](_0x4edac6[_0x2203('0x98')](),_0x16e518);})[_0x2203('0x1d')](function(_0x413729){_0x595281[_0x2203('0x2e')]=_0x413729[_0x2203('0x49')];if(_0x595281[_0x2203('0x2e')]===0x0)return[];return db[_0x2203('0x97')]['query'](_0x4de47a['toString'](),_0x16e518)[_0x2203('0x1d')](function(_0x1295a3){_0x559370=_['keyBy'](_0x1295a3,'id');_0x16e518=_[_0x2203('0x36')](_0x16e518,{'model':db[_0x2203('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b4842['query'][_0x2203('0x99')]){_0x36b8e4[_0x2203('0x47')]['forEach'](function(_0x21f357){_0x3f335a[_0x2203('0x4f')]('i.'+_0x21f357);});}else{_0x3f335a['field'](_0x2203('0x8d'),_0x2203('0x62'));_0x3f335a[_0x2203('0x4f')](_0x2203('0x9a'),'Account.key');_0x3f335a['field'](_0x2203('0x9b'),_0x2203('0x9c'));_0x3f335a[_0x2203('0x4f')]('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');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9d'));_0x3f335a[_0x2203('0x4f')]('c.firstName','Contact.firstName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9e'),'Contact.lastName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9f'),'Contact.email');_0x3f335a[_0x2203('0x4f')]('c.phone',_0x2203('0xa0'));_0x3f335a['field']('c.mobile','Contact.mobile');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa1'),'Contact.fax');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa2'),_0x2203('0xa3'));_0x3f335a['field'](_0x2203('0xa4'),'Owner.internal');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa5'),'TagIds');}if(_0x36b8e4[_0x2203('0x2d')])_0x3f335a[_0x2203('0x2d')](_0x36b8e4['limit']);if(_0x36b8e4[_0x2203('0x2b')])_0x3f335a[_0x2203('0x2b')](_0x36b8e4[_0x2203('0x2b')]);return db[_0x2203('0x97')][_0x2203('0x45')](_0x3f335a['toString'](),_0x16e518);})[_0x2203('0x1d')](function(_0x1b5185){if(_0x1b5185[_0x2203('0x49')]>0x0)_0xb47204[_0x2203('0x7d')](_0x2203('0xa6'),_[_0x2203('0x3b')](_0x1b5185,'id'));return db['sequelize'][_0x2203('0x45')](_0xb47204[_0x2203('0x98')](),_0x16e518)['then'](function(_0x13fc7b){var _0x5e0bff=_[_0x2203('0xa7')](_0x13fc7b,_0x2203('0xa8'));var _0xc611e8=[];_0x1b5185['forEach'](function(_0xab7f0b){_0xc611e8[_0x2203('0xa9')](updateChatInteraction(_0xab7f0b,_0x559370,_0x5e0bff));});return BPromise[_0x2203('0xaa')](_0xc611e8);});});})[_0x2203('0x1d')](function(_0x2c275f){_0x595281[_0x2203('0xab')]=_0x2c275f;return _0x595281;})[_0x2203('0x1d')](respondWithFilteredResult(_0x23a6e8,_0x36b8e4))['catch'](handleError(_0x23a6e8,null));};exports['show']=function(_0x106534,_0x41eb4c){var _0x25996c={'raw':![],'where':{'id':_0x106534[_0x2203('0xac')]['id']}},_0x4e1f55={};_0x4e1f55[_0x2203('0x44')]=_[_0x2203('0xad')](db['ChatInteraction'][_0x2203('0x42')]);_0x4e1f55[_0x2203('0x45')]=_['keys'](_0x106534[_0x2203('0x45')]);_0x4e1f55['filters']=_[_0x2203('0x48')](_0x4e1f55[_0x2203('0x44')],_0x4e1f55['query']);_0x25996c[_0x2203('0x47')]=_[_0x2203('0x48')](_0x4e1f55[_0x2203('0x44')],qs[_0x2203('0x99')](_0x106534[_0x2203('0x45')][_0x2203('0x99')]));_0x25996c[_0x2203('0x47')]=_0x25996c[_0x2203('0x47')][_0x2203('0x49')]?_0x25996c[_0x2203('0x47')]:_0x4e1f55[_0x2203('0x44')];if(_0x106534[_0x2203('0x45')]['includeAll']){_0x25996c[_0x2203('0xae')]=[{'all':!![]}];}_0x25996c=_['merge']({},_0x25996c,_0x106534[_0x2203('0xaf')]);return db[_0x2203('0x41')][_0x2203('0x61')](_0x25996c)[_0x2203('0x1d')](handleEntityNotFound(_0x41eb4c,null))[_0x2203('0x1d')](respondWithResult(_0x41eb4c,null))[_0x2203('0x27')](handleError(_0x41eb4c,null));};exports[_0x2203('0xb0')]=function(_0x8f9f98,_0x36205d){return db[_0x2203('0x41')][_0x2203('0xb0')](_0x8f9f98['body'],{})[_0x2203('0x1d')](respondWithResult(_0x36205d,0xc9))['catch'](handleError(_0x36205d,null));};exports[_0x2203('0x31')]=function(_0x3deb3b,_0x6b8ea4){if(_0x3deb3b['body']['id']){delete _0x3deb3b[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x3deb3b[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x6b8ea4,null))['then'](saveUpdates(_0x3deb3b[_0x2203('0x37')],null))['then'](respondWithResult(_0x6b8ea4,null))[_0x2203('0x27')](handleError(_0x6b8ea4,null));};exports[_0x2203('0x32')]=function(_0x5f5270,_0x376954){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x5f5270[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0x376954,null))[_0x2203('0x1d')](removeEntity(_0x376954,null))['catch'](handleError(_0x376954,null));};exports['describe']=function(_0x4055eb,_0x95b45a){return db[_0x2203('0x41')][_0x2203('0xb1')]()[_0x2203('0x1d')](respondWithResult(_0x95b45a,null))[_0x2203('0x27')](handleError(_0x95b45a,null));};exports[_0x2203('0xb2')]=function(_0x4b6d6f,_0xb40f2b){var _0x4769ee=_0x4b6d6f[_0x2203('0xac')]['id'];var _0x492179;var _0x4fc1cc;var _0x4d6ece;return db[_0x2203('0x41')][_0x2203('0xb3')]({'where':{'id':_0x4769ee}})[_0x2203('0x1d')](function(_0x2d1ee6){_0x492179=_0x2d1ee6;return db['ChatWebsite'][_0x2203('0xb3')]({'where':{'id':_0x2d1ee6[_0x2203('0x78')]},'attributes':['id',_0x2203('0xb4'),_0x2203('0xb5'),'vidaooTopic','vidaooNote',_0x2203('0xb6')],'raw':!![]});})[_0x2203('0x1d')](function(_0x1ed416){if(_0x1ed416&&_0x1ed416['vidaooApiKey']&&_0x1ed416[_0x2203('0xb5')]){_0x4fc1cc=_0x1ed416;var _0x28bf0a={'interaction':{'id':_0x4769ee},'agent':{'id':_0x4b6d6f[_0x2203('0x93')]['id'],'name':_0x4b6d6f[_0x2203('0x93')][_0x2203('0x34')],'fullname':_0x4b6d6f[_0x2203('0x93')][_0x2203('0x3c')],'email':_0x4b6d6f['user'][_0x2203('0xb7')]},'contact':_0x4b6d6f[_0x2203('0x37')][_0x2203('0x38')],'account':_0x4b6d6f[_0x2203('0x37')][_0x2203('0xb8')]};var _0x4457c9={'rejectUnauthorized':![],'method':_0x2203('0xb9'),'url':_0x2203('0xba'),'headers':{'X-APIKEY':_0x1ed416[_0x2203('0xb4')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4b6d6f['user'][_0x2203('0xb7')]],'buttons':null,'topic':_0x4fc1cc[_0x2203('0xbb')],'note':_[_0x2203('0xbc')](_0x4fc1cc[_0x2203('0xbd')])?null:getMustacheRender(_0x4fc1cc['vidaooNote'],_0x28bf0a),'metadata':null},'redirect':_0x2203('0xbe'),'json':!![]};try{if(!_[_0x2203('0xbc')](_0x4fc1cc[_0x2203('0xb6')])){var _0x19ef05=getMustacheRender(_0x4fc1cc[_0x2203('0xb6')],_0x28bf0a);var _0x3f3062=JSON[_0x2203('0x7c')](_0x19ef05);_0x4457c9[_0x2203('0x37')][_0x2203('0xbf')]=_0x3f3062;}}catch(_0x597e49){throw new db['Sequelize'][(_0x2203('0xc0'))](_0x2203('0xc1'));}return rp(_0x4457c9);}else{throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x2203('0x1d')](function(_0x289cde){_0x4d6ece=_0x289cde;if(_0x4d6ece['id']){var _0x5d5e8e={'body':_0x4d6ece[_0x2203('0xc2')],'ChatWebsiteId':_0x4fc1cc['id'],'ChatInteractionId':_0x492179['id'],'direction':_0x2203('0xc3'),'UserId':_0x4b6d6f[_0x2203('0x93')]['id']};return db[_0x2203('0xc4')]['create'](_0x5d5e8e,{});}else{throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))](_0x2203('0xc5'));}})['then'](function(){return _0x492179[_0x2203('0xc6')]({'vidaooSessionId':_0x4d6ece['id']});})[_0x2203('0x1d')](respondWithResult(_0xb40f2b,null))[_0x2203('0x27')](handleError(_0xb40f2b,null));};exports['customUpdate']=function(_0x590035,_0x207c86){if(_0x590035[_0x2203('0x37')]['id']){delete _0x590035[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')]['find']({'where':{'id':_0x590035[_0x2203('0xac')]['id']},'include':[{'model':db[_0x2203('0xc7')],'as':_0x2203('0x67')}]})['then'](handleEntityNotFound(_0x207c86,null))['then'](saveUpdates(_0x590035[_0x2203('0x37')],null))[_0x2203('0x1d')](respondWithResult(_0x207c86,null))[_0x2203('0x27')](handleError(_0x207c86,null));};exports[_0x2203('0xc8')]=function(_0x401831,_0x410894,_0x2b0d0b){if(_0x401831[_0x2203('0x37')]['id']){delete _0x401831[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x401831['params']['id']}})[_0x2203('0x1d')](function(_0x5edebd){if(!_0x5edebd){logger[_0x2203('0x23')](_0x2203('0xc9'),_0x2203('0xc8'),0x194,_0x2203('0xca'));_0x410894[_0x2203('0x28')](0x194);}else{if(_0x5edebd['UserId']){throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))](_0x2203('0xcb'));}}return _0x5edebd;})['then'](function(_0xe9cd8f){if(_0xe9cd8f){return _0xe9cd8f[_0x2203('0x31')]({'closed':_0x401831[_0x2203('0x37')][_0x2203('0xcc')],'disposition':_0x401831['body'][_0x2203('0xcd')]})[_0x2203('0x1d')](function(_0x4508c3){return _0x4508c3;});}})[_0x2203('0x1d')](function(_0x4e3ea8){return respondWithRpcPromise(_0x2203('0xce'),_0x2203('0xc8'),_0x401831['body'],client9004);})[_0x2203('0x1d')](respondWithResult(_0x410894,null))[_0x2203('0x27')](handleError(_0x410894,null));};exports['attachmentUpload']=function(_0x5cb5be,_0x54f1a1,_0x5d21eb){_0x5cb5be[_0x2203('0x37')]['name']=_0x5cb5be[_0x2203('0xcf')]['originalname'];_0x5cb5be['body'][_0x2203('0xd0')]=_0x5cb5be['file'][_0x2203('0xd1')];_0x5cb5be['body'][_0x2203('0x43')]=_0x5cb5be[_0x2203('0xcf')][_0x2203('0xd2')];return db[_0x2203('0xd3')][_0x2203('0xb0')](_0x5cb5be[_0x2203('0x37')])[_0x2203('0x1d')](respondWithResult(_0x54f1a1,0xc9))[_0x2203('0x27')](handleError(_0x54f1a1,null));};exports[_0x2203('0xd4')]=function(_0xabe2eb,_0x453179,_0x359968){return db['ChatInteraction'][_0x2203('0xb3')]({'where':{'id':_0xabe2eb[_0x2203('0xac')]['id']},'raw':!![]})[_0x2203('0x1d')](handleEntityNotFound(_0x453179,null))[_0x2203('0x1d')](function(_0x3d2ba9){if(_0x3d2ba9){if(_0x3d2ba9[_0x2203('0xcc')]){return _0x453179['status'](0x193)[_0x2203('0x2a')]({'status':0x193,'message':_0x2203('0xd5')});}return db[_0x2203('0xd3')][_0x2203('0xb3')]({'where':{'id':_0xabe2eb[_0x2203('0x45')][_0x2203('0xd6')]},'raw':!![]})['then'](handleEntityNotFound(_0x453179,null));}})[_0x2203('0x1d')](function(_0x5a9d4e){if(_0x5a9d4e){var _0x3217a3=_0x5a9d4e['ChatOfflineMessageId']!==null;var _0x219e9d=path[_0x2203('0xd7')](config[_0x2203('0xd8')],_0x2203('0xd9'));if(_0x3217a3){_0x219e9d=path['join'](_0x219e9d,_0x2203('0xda'));}var _0x4598cb=path[_0x2203('0xd7')](_0x219e9d,_0x5a9d4e[_0x2203('0xd0')]);return _0x453179[_0x2203('0xdb')](_0x4598cb);}})[_0x2203('0x27')](handleError(_0x453179,null));};exports[_0x2203('0xdc')]=function(_0x38fb99,_0x5bcf17){var _0x581d9f=null;var _0x5ddb1a=null;var _0x358ab1=null;var _0x5b8c97=null;if(_0x38fb99[_0x2203('0x37')]['id']){delete _0x38fb99[_0x2203('0x37')]['id'];}if(_0x38fb99['body']['mailTranscript']){_0x5b8c97=path[_0x2203('0xd7')](config[_0x2203('0xd8')],'server/files/chat/upload/',util[_0x2203('0xdd')](_0x2203('0xde'),Date[_0x2203('0xdf')]()));_0x38fb99['body'][_0x2203('0xe0')]=_0x5b8c97;}return db['ChatInteraction'][_0x2203('0x61')]({'where':{'id':_0x38fb99['params']['id']},'include':[{'model':db[_0x2203('0xc4')],'as':_0x2203('0xe1'),'include':[{'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2')}]}]})['then'](handleEntityNotFound(_0x5bcf17,null))[_0x2203('0x1d')](saveUpdates(_0x38fb99['body'],null))[_0x2203('0x1d')](function(_0x5f098d){if(_0x5f098d){_0x581d9f=_0x5f098d;return db[_0x2203('0xe3')][_0x2203('0x61')]({'where':{'id':_0x581d9f[_0x2203('0x78')]}});}})[_0x2203('0x1d')](function(_0x5c2159){if(_0x5c2159){_0x358ab1=_0x5c2159;return db[_0x2203('0xc7')][_0x2203('0x61')]({'where':{'id':_0x581d9f[_0x2203('0x6e')]}});}})[_0x2203('0x1d')](function(_0x23daeb){if(_0x23daeb){_0x5ddb1a=_0x23daeb;if(_0x5b8c97){var _0x2ad175=null;for(var _0x3ca475=0x1;_0x3ca475<_0x581d9f[_0x2203('0xe1')][_0x2203('0x49')];++_0x3ca475){_0x2ad175=_0x581d9f[_0x2203('0xe1')][_0x3ca475];var _0x199849=_0x2ad175[_0x2203('0x74')]?util[_0x2203('0xdd')](_0x2203('0xe4'),_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):'System';var _0x4cf298=_0x38fb99[_0x2203('0x37')][_0x2203('0xe6')]||util[_0x2203('0xdd')](_0x2203('0xe4'),_0x2203('0xe7'),_0x2ad175[_0x2203('0x6e')]);switch(_0x358ab1['agentIdentifier']){case _0x2203('0xe8'):_0x199849=_0x2ad175[_0x2203('0x74')]?util['format']('%s%d',_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):_0x2203('0xe9');break;case _0x2203('0xea'):_0x199849=_0x2ad175['UserId']?_0x2ad175[_0x2203('0xe2')][_0x2203('0xeb')]||_0x2ad175['User'][_0x2203('0x3c')]:'System';break;case _0x2203('0xec'):_0x199849=_0x2ad175[_0x2203('0x74')]?_0x2ad175[_0x2203('0xe2')]['fullname']:_0x2203('0xe9');break;default:_0x199849=_0x2ad175[_0x2203('0x74')]?util[_0x2203('0xdd')](_0x2203('0xe4'),_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):_0x2203('0xe9');}var _0x20f50b=util[_0x2203('0xdd')](_0x2203('0xed'),moment(_0x2ad175['createdAt'])[_0x2203('0xdd')](_0x2203('0xee')),_0x2ad175[_0x2203('0xef')]==='in'?_0x4cf298:_0x199849,_0x2ad175[_0x2203('0x37')]);if(!_0x2ad175[_0x2203('0xf0')]){fs['appendFileSync'](_0x5b8c97,_0x20f50b);}}return db[_0x2203('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2203('0xf2')],'as':_0x2203('0xf3'),'raw':!![]}]});}}})[_0x2203('0x1d')](function(_0x16686c){if(_0x16686c&&_0x16686c['Smtp']&&_0x38fb99[_0x2203('0x37')]){var _0x21dfbc={'tls':{'rejectUnauthorized':![]}};if(_0x16686c[_0x2203('0xf3')][_0x2203('0xf4')]){_0x21dfbc[_0x2203('0xf4')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf4')];}else{_0x21dfbc[_0x2203('0xf5')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf5')];_0x21dfbc[_0x2203('0xf6')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf6')];_0x21dfbc[_0x2203('0xf7')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf7')];}if(_0x16686c['Smtp']['authentication']){_0x21dfbc['auth']={'user':_0x16686c[_0x2203('0xf3')][_0x2203('0x93')],'pass':_0x16686c[_0x2203('0xf3')]['pass']};}return respondWithRpcPromise(_0x2203('0xf8'),_0x2203('0xf9'),{'account':_0x21dfbc,'message':{'from':util[_0x2203('0xdd')](_0x2203('0xfa'),_0x16686c[_0x2203('0x34')],_0x16686c['email']||_0x16686c[_0x2203('0xf3')][_0x2203('0x93')]),'to':_0x38fb99[_0x2203('0x37')][_0x2203('0xfb')],'subject':_0x2203('0xfc'),'text':util['format'](_0x2203('0xfd'),_0x38fb99[_0x2203('0x37')]['mailTranscript']),'attachments':[{'path':_0x5b8c97}]}})['then'](function(){return _0x581d9f;})[_0x2203('0x27')](function(_0xfd2832){console[_0x2203('0x23')](_0xfd2832);});}else{return _0x581d9f;}})[_0x2203('0x1d')](respondWithStatusCode(_0x5bcf17,0xc8))[_0x2203('0x27')](handleError(_0x5bcf17,null));};exports[_0x2203('0xfe')]=function(_0x50d583,_0x5f01c0,_0x30df28){return db[_0x2203('0xc4')][_0x2203('0x61')]({'where':{'id':_0x50d583[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0x5f01c0,null))[_0x2203('0x1d')](function(_0x3fa96f){if(_0x3fa96f){return _0x3fa96f['addMessage'](_0x50d583[_0x2203('0x37')]['ids'],_[_0x2203('0xff')](_0x50d583[_0x2203('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x5f01c0,null))[_0x2203('0x27')](handleError(_0x5f01c0,null));};exports[_0x2203('0x100')]=function(_0x4dccbf,_0x2bc31c,_0x5807ef){var _0x45a460={'raw':![],'where':{}};var _0x59eb03={};var _0x2964d7={'count':0x0,'rows':[]};return db[_0x2203('0x41')][_0x2203('0xb3')]({'where':{'id':_0x4dccbf['params']['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x2bc31c,null))[_0x2203('0x1d')](function(_0x46d93b){if(_0x46d93b){_0x59eb03[_0x2203('0x44')]=_[_0x2203('0xad')](db[_0x2203('0xc4')][_0x2203('0x42')]);_0x59eb03[_0x2203('0x45')]=_[_0x2203('0xad')](_0x4dccbf[_0x2203('0x45')]);_0x59eb03['filters']=_[_0x2203('0x48')](_0x59eb03['model'],_0x59eb03[_0x2203('0x45')]);_0x45a460[_0x2203('0x47')]=_[_0x2203('0x48')](_0x59eb03[_0x2203('0x44')],qs['fields'](_0x4dccbf['query'][_0x2203('0x99')]));_0x45a460['attributes']=_0x45a460[_0x2203('0x47')]['length']?_0x45a460[_0x2203('0x47')]:_0x59eb03['model'];if(!_0x4dccbf['query'][_0x2203('0x4a')](_0x2203('0x4b'))){_0x45a460['limit']=qs[_0x2203('0x2d')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x2d')]);_0x45a460[_0x2203('0x2b')]=qs[_0x2203('0x2b')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x2b')]);}_0x45a460['order']=qs[_0x2203('0x4d')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x4d')]);_0x45a460[_0x2203('0x7d')]=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x4dccbf[_0x2203('0x45')],_0x59eb03[_0x2203('0x46')]));_0x45a460[_0x2203('0x7d')][_0x2203('0xa8')]=_0x46d93b['id'];if(_0x4dccbf['query'][_0x2203('0x86')]){_0x45a460[_0x2203('0x7d')]=_[_0x2203('0x36')](_0x45a460[_0x2203('0x7d')],{'$or':_[_0x2203('0x3b')](_0x45a460[_0x2203('0x47')],function(_0x36d988){var _0x36141a={};_0x36141a[_0x36d988]={'$like':'%'+_0x4dccbf[_0x2203('0x45')][_0x2203('0x86')]+'%'};return _0x36141a;})});}if(_0x4dccbf[_0x2203('0x45')][_0x2203('0x7b')]){var _0x2c7cc8=_0x4dccbf['query'][_0x2203('0x7b')][_0x2203('0x6a')](',');var _0x481a3e={};_0x481a3e[_0x2c7cc8[0x0]]={'$gte':moment(_0x2c7cc8[0x1])[_0x2203('0xdd')](_0x2203('0x101'))};_0x45a460[_0x2203('0x7d')]=_[_0x2203('0x36')](_0x45a460[_0x2203('0x7d')],_0x481a3e);}_0x45a460=_[_0x2203('0x36')]({},_0x45a460,_0x4dccbf[_0x2203('0xaf')]);return db[_0x2203('0xc4')][_0x2203('0x2e')]({'where':_0x45a460['where']})[_0x2203('0x1d')](function(_0x2485d3){_0x2964d7[_0x2203('0x2e')]=_0x2485d3;if(_0x4dccbf[_0x2203('0x45')][_0x2203('0x102')]){_0x45a460[_0x2203('0xae')]=[{'all':!![]}];}return db[_0x2203('0xc4')][_0x2203('0x103')](_0x45a460);})['then'](function(_0xc53b76){_0x2964d7['rows']=_0xc53b76;return _0x2964d7;});}})[_0x2203('0x1d')](respondWithFilteredResult(_0x2bc31c,_0x45a460))['catch'](handleError(_0x2bc31c,null));};exports[_0x2203('0x104')]=function(_0x581c4f,_0x3c279b,_0x4031b7){var _0xa9cf5a={'where':{}},_0x135b65={},_0x3c4bc3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2203('0xb3')]({'where':{'id':_0x581c4f[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x3c279b,null))[_0x2203('0x1d')](function(_0x203956){if(_0x203956){_0x135b65[_0x2203('0x44')]=_[_0x2203('0xad')](db[_0x2203('0xc4')]['rawAttributes']);_0x135b65['query']=_['keys'](_0x581c4f[_0x2203('0x45')]);_0x135b65['filters']=_['intersection'](_0x135b65[_0x2203('0x44')],_0x135b65[_0x2203('0x45')]);_0xa9cf5a['attributes']=_['intersection'](_0x135b65[_0x2203('0x44')],qs[_0x2203('0x99')](_0x581c4f[_0x2203('0x45')]['fields']));_0xa9cf5a[_0x2203('0x47')]=_0xa9cf5a[_0x2203('0x47')][_0x2203('0x49')]?_0xa9cf5a[_0x2203('0x47')]:_0x135b65[_0x2203('0x44')];if(!_0x581c4f[_0x2203('0x45')]['hasOwnProperty'](_0x2203('0x4b'))){_0xa9cf5a['limit']=qs[_0x2203('0x2d')](_0x581c4f[_0x2203('0x45')][_0x2203('0x2d')]);_0xa9cf5a[_0x2203('0x2b')]=qs[_0x2203('0x2b')](_0x581c4f[_0x2203('0x45')][_0x2203('0x2b')]);}_0xa9cf5a['order']=qs[_0x2203('0x4d')](_0x581c4f[_0x2203('0x45')]['sort']);_0xa9cf5a[_0x2203('0x7d')]=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x581c4f[_0x2203('0x45')],_0x135b65[_0x2203('0x46')]));_0xa9cf5a[_0x2203('0x7d')][_0x2203('0xa8')]=_0x203956['id'];if(_0x581c4f[_0x2203('0x45')][_0x2203('0x86')]){_0xa9cf5a[_0x2203('0x7d')]=_['merge'](_0xa9cf5a[_0x2203('0x7d')],{'$or':_[_0x2203('0x3b')](_0xa9cf5a[_0x2203('0x47')],function(_0x4a6a84){var _0x361282={};_0x361282[_0x4a6a84]={'$like':'%'+_0x581c4f[_0x2203('0x45')][_0x2203('0x86')]+'%'};return _0x361282;})});}_0xa9cf5a[_0x2203('0x7d')][_0x2203('0xf0')]=![];if(_0x581c4f[_0x2203('0x45')]['id']){_0xa9cf5a[_0x2203('0x7d')]['id']={'$gt':_0x581c4f[_0x2203('0x45')]['id']};}_0xa9cf5a=_[_0x2203('0x36')]({},_0xa9cf5a,_0x581c4f[_0x2203('0xaf')]);return db[_0x2203('0xc4')]['count']({'where':_0xa9cf5a[_0x2203('0x7d')]})[_0x2203('0x1d')](function(_0x554450){_0x3c4bc3[_0x2203('0x2e')]=_0x554450;_0xa9cf5a[_0x2203('0xae')]=[];if(_0x581c4f[_0x2203('0x45')][_0x2203('0x105')]){_0xa9cf5a[_0x2203('0xae')][_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2'),'attributes':['id',_0x2203('0x3c'),'alias']});}if(_0x581c4f[_0x2203('0x45')][_0x2203('0x102')]){_0xa9cf5a['include']=[{'all':!![]}];}return db[_0x2203('0xc4')][_0x2203('0x103')](_0xa9cf5a);})[_0x2203('0x1d')](function(_0x291aef){_0x3c4bc3[_0x2203('0xab')]=_0x291aef;return _0x3c4bc3;});}})[_0x2203('0x1d')](respondWithFilteredResult(_0x3c279b,_0xa9cf5a))[_0x2203('0x27')](handleError(_0x3c279b,null));};exports[_0x2203('0x106')]=function(_0x3e2390,_0x44d30c,_0x46c088){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x3e2390[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x44d30c,null))['then'](function(_0x42669a){if(_0x42669a){return _0x42669a['setTags'](_0x3e2390['body'][_0x2203('0x107')],_['omit'](_0x3e2390['body'],['ids','id'])||{})['spread'](function(){return db[_0x2203('0x72')][_0x2203('0x103')]({'attributes':['id',_0x2203('0x34'),_0x2203('0x50')],'where':{'id':_0x3e2390['body'][_0x2203('0x107')]}});})[_0x2203('0x1d')](function(_0x44ff9f){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3e2390[_0x2203('0xac')]['id']),'tags':_0x44ff9f||[]});return{'id':Number(_0x3e2390[_0x2203('0xac')]['id']),'tags':_0x44ff9f||[]};});}})[_0x2203('0x1d')](respondWithResult(_0x44d30c,null))[_0x2203('0x27')](handleError(_0x44d30c,null));};exports[_0x2203('0x108')]=function(_0x2c0df7,_0xdd4efc,_0x2481f5){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x2c0df7[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0xdd4efc,null))['then'](function(_0x135655){if(_0x135655){return _0x135655[_0x2203('0x108')](_0x2c0df7[_0x2203('0x45')][_0x2203('0x107')]);}})['then'](respondWithStatusCode(_0xdd4efc,null))[_0x2203('0x27')](handleError(_0xdd4efc,null));};exports[_0x2203('0xdb')]=function(_0x4718f4,_0x5b771e){var _0x3dd02d=moment()[_0x2203('0x109')]()[_0x2203('0x98')]();var _0x552a73=path[_0x2203('0xd7')](config['root'],_0x2203('0x10a'),_0x2203('0x10b'),_0x2203('0x10c'));var _0x2111b4=path[_0x2203('0xd7')](config[_0x2203('0xd8')],_0x2203('0x10a'),_0x2203('0x10b'),_0x2203('0x10d'));var _0x20a488=path[_0x2203('0xd7')](_0x552a73,_0x3dd02d);var _0x505c2a=util[_0x2203('0xdd')](_0x2203('0x10e'),_0x4718f4[_0x2203('0xac')]['id'],_0x3dd02d);var _0x44ae18=path[_0x2203('0xd7')](_0x552a73,_0x505c2a);var _0x3fbe4c=[];_0x3fbe4c[_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2'),'attributes':['id',_0x2203('0x3c')],'raw':!![]});_0x3fbe4c[_0x2203('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x2203('0x10f'),_0x2203('0x110')],'raw':!![]});if(_0x4718f4[_0x2203('0x45')][_0x2203('0x10d')]){_0x3fbe4c[_0x2203('0xa9')]({'model':db[_0x2203('0xd3')],'as':_0x2203('0xd3'),'raw':!![]});}var _0x10081d=[{'model':db[_0x2203('0xc4')],'as':_0x2203('0xe1'),'attributes':['id',_0x2203('0x37'),_0x2203('0x7a'),'direction','secret',_0x2203('0x80')],'include':_0x3fbe4c}];_0x10081d['push']({'model':db['ChatWebsite'],'as':_0x2203('0x111'),'attributes':['id','name']});_0x10081d[_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0x112'),'attributes':['id',_0x2203('0x3c')]});return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x4718f4[_0x2203('0xac')]['id']},'include':_0x10081d})[_0x2203('0x1d')](handleEntityNotFound(_0x5b771e,null))[_0x2203('0x1d')](function(_0x51dbc8){if(_0x51dbc8){var _0xd584ee=_0x51dbc8['get']({'plain':!![]});fs[_0x2203('0x113')](_0x20a488);var _0x1c36d4={'channel':_0x2203('0x114'),'account':_0xd584ee[_0x2203('0x111')][_0x2203('0x34')],'agent':_0xd584ee['Owner']?_0xd584ee[_0x2203('0x112')]['fullname']:_0x2203('0x115'),'createdAt':moment(_0xd584ee['createdAt'])['format'](_0x2203('0x101'))[_0x2203('0x98')](),'closedAt':_0xd584ee[_0x2203('0xcc')]?moment(_0xd584ee[_0x2203('0x116')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2203('0x98')]():'','disposition':_0xd584ee[_0x2203('0xcd')],'chatInfo':{'browser':_0xd584ee[_0x2203('0x117')],'os':_0xd584ee['osName'],'referer':_0xd584ee['referer'],'customerIp':_0xd584ee[_0x2203('0x118')],'customerPort':_0xd584ee[_0x2203('0x119')]?_0xd584ee[_0x2203('0x119')]:_0x2203('0x115')},'messages':_(_0xd584ee[_0x2203('0xe1')])[_0x2203('0x11a')]()[_0x2203('0x86')]({'secret':![]})[_0x2203('0x3b')](function(_0x2fc5cf){if(_0x2fc5cf[_0x2203('0xd3')]){var _0x2097be=path['join'](_0x2111b4,_0x2fc5cf['Attachment'][_0x2203('0xd0')]);if(fs['existsSync'](_0x2097be)){fs[_0x2203('0x11b')](_0x2097be)[_0x2203('0x11c')](fs['createWriteStream'](path['join'](_0x20a488,_0x2fc5cf[_0x2203('0xd3')][_0x2203('0xd0')])));}}return{'date':moment(_0x2fc5cf[_0x2203('0x7a')])[_0x2203('0xdd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2203('0x98')](),'sender':_0x2fc5cf[_0x2203('0xef')]==='out'?_0x2fc5cf[_0x2203('0xe2')]?_0x2fc5cf['User'][_0x2203('0x3c')]:'System':_0x2fc5cf[_0x2203('0x67')][_0x2203('0x10f')]+(_0x2fc5cf[_0x2203('0x67')][_0x2203('0x110')]?'\x20'+_0x2fc5cf[_0x2203('0x67')][_0x2203('0x110')]:''),'body':_0x2fc5cf[_0x2203('0xd3')]?_0x2fc5cf['Attachment'][_0x2203('0xd0')]:_0x2fc5cf['body'],'direction':_0x2fc5cf[_0x2203('0xef')]===_0x2203('0xc3')?'A':'C','secret':_0x2fc5cf[_0x2203('0xf0')],'read':_0x2fc5cf[_0x2203('0x80')],'attachment':_0x2fc5cf[_0x2203('0xd3')]};})[_0x2203('0x63')]()};return ejs['renderFile'](path['join'](config[_0x2203('0xd8')],_0x2203('0x10a'),_0x2203('0x11d'),'downloadInteraction.ejs'),{'interaction':_0x1c36d4})[_0x2203('0x1d')](function(_0x15260f){var _0x4419a8=path[_0x2203('0xd7')](_0x20a488,_0x2203('0x11e')+_0xd584ee['id']+'-'+_0x3dd02d+_0x2203('0x11f'));var _0x2af4f6={'path':_0x4419a8,'channel':'Chat','interactionId':_0xd584ee['id']};return pdf[_0x2203('0x120')](_0x15260f,_0x2af4f6);})[_0x2203('0x1d')](function(){return new BPromise(function(_0x3e8221,_0x16ccec){zipdir(_0x20a488,{'saveTo':_0x44ae18},function(_0x7da828,_0x29846d){if(_0x7da828)return _0x16ccec(_0x7da828);return _0x3e8221(_0x29846d);});})[_0x2203('0x1d')](function(){return new BPromise(function(_0x1c3684,_0x11c1db){rimraf(_0x20a488,function(_0x447a00){if(_0x447a00)_0x11c1db(_0x447a00);return _0x1c3684();});});})[_0x2203('0x1d')](function(){return _0x5b771e['download'](_0x44ae18,_0x505c2a,function(_0x2a679c){if(_0x2a679c){console[_0x2203('0x121')](_0x2203('0x122'),_0x2a679c);}else{fs[_0x2203('0x123')](_0x44ae18);}});});});}else{return _0x5b771e[_0x2203('0x28')](0xc8);}})['catch'](handleError(_0x5b771e,null));}; \ No newline at end of file +var _0xea28=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','stack','name','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','params','includeAll','options','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','include','findAll','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','emit','removeTags','files','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','read','Account','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x371f3f,_0x132bbc){var _0x20ff76=function(_0xdfc73e){while(--_0xdfc73e){_0x371f3f['push'](_0x371f3f['shift']());}};_0x20ff76(++_0x132bbc);}(_0xea28,0x13a));var _0x8ea2=function(_0x2f76b4,_0x3211ab){_0x2f76b4=_0x2f76b4-0x0;var _0x44ad54=_0xea28[_0x2f76b4];return _0x44ad54;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8ea2('0x16'));var logger=require(_0x8ea2('0x17'))(_0x8ea2('0x18'));var utils=require('../../config/utils');var config=require(_0x8ea2('0x19'));var licenseUtil=require(_0x8ea2('0x1a'));var db=require(_0x8ea2('0x1b'))['db'];config[_0x8ea2('0x1c')]=_[_0x8ea2('0x1d')](config['redis'],{'host':_0x8ea2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ea2('0x1f'))[_0x8ea2('0x20')](socket);var jayson=require(_0x8ea2('0x21'));var client=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232b});var client9004=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x11f5e8,_0x474873,_0x396aab,_0x2dfa7c){return new BPromise(function(_0x1c1715,_0x3bc774){var _0xaa8abf=_0x2dfa7c||client;return _0xaa8abf[_0x8ea2('0x24')](_0x11f5e8,_0x396aab)[_0x8ea2('0x25')](function(_0x467045){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x474873,_0x8ea2('0x28'));logger[_0x8ea2('0x29')](_0x8ea2('0x2a'),_0x474873,'request\x20sent',JSON['stringify'](_0x467045));if(_0x467045[_0x8ea2('0x2b')]){if(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2c')]===0x1f4){logger['error'](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')]['message']);return _0x3bc774(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}logger[_0x8ea2('0x2b')](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);return _0x1c1715(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}else{logger[_0x8ea2('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x8ea2('0x28'));_0x1c1715(_0x467045['result'][_0x8ea2('0x2d')]);}})[_0x8ea2('0x2e')](function(_0x29b38f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x29b38f);_0x3bc774(_0x29b38f);});});}function respondWithStatusCode(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0xcc;return function(_0x200a49){if(_0x200a49){return _0x2e4da3['sendStatus'](_0x4dc7bf);}return _0x2e4da3[_0x8ea2('0x2f')](_0x4dc7bf)[_0x8ea2('0x30')]();};}function respondWithResult(_0x21c526,_0x266db8){_0x266db8=_0x266db8||0xc8;return function(_0x4e1b90){if(_0x4e1b90){return _0x21c526['status'](_0x266db8)[_0x8ea2('0x31')](_0x4e1b90);}};}function respondWithFilteredResult(_0x4da5b3,_0x4a9875){return function(_0x287078){if(_0x287078){var _0x24f187=typeof _0x4a9875[_0x8ea2('0x32')]===_0x8ea2('0x33')&&typeof _0x4a9875[_0x8ea2('0x34')]===_0x8ea2('0x33');var _0x316707=_0x287078[_0x8ea2('0x35')];var _0x9c5fac=_0x24f187?0x0:_0x4a9875['offset'];var _0x5b7ff9=_0x24f187?_0x287078[_0x8ea2('0x35')]:_0x4a9875[_0x8ea2('0x32')]+_0x4a9875['limit'];var _0x4a110f;if(_0x5b7ff9>=_0x316707){_0x5b7ff9=_0x316707;_0x4a110f=0xc8;}else{_0x4a110f=0xce;}_0x4da5b3[_0x8ea2('0x2f')](_0x4a110f);return _0x4da5b3['set'](_0x8ea2('0x36'),_0x9c5fac+'-'+_0x5b7ff9+'/'+_0x316707)[_0x8ea2('0x31')](_0x287078);}return null;};}function patchUpdates(_0x53fd06){return function(_0x17b21c){try{jsonpatch[_0x8ea2('0x37')](_0x17b21c,_0x53fd06,!![]);}catch(_0x33abc8){return BPromise['reject'](_0x33abc8);}return _0x17b21c['save']();};}function saveUpdates(_0x49a252,_0x3880c3){return function(_0x233e12){if(_0x233e12){return _0x233e12[_0x8ea2('0x38')](_0x49a252)['then'](function(_0x456487){return _0x456487;});}return null;};}function removeEntity(_0x391b08,_0x3d5bf0){return function(_0x278e5d){if(_0x278e5d){return _0x278e5d[_0x8ea2('0x39')]()[_0x8ea2('0x25')](function(){_0x391b08[_0x8ea2('0x2f')](0xcc)[_0x8ea2('0x30')]();});}};}function handleEntityNotFound(_0x5e9b1f,_0x955ef3){return function(_0x29e3f5){if(!_0x29e3f5){_0x5e9b1f[_0x8ea2('0x3a')](0x194);}return _0x29e3f5;};}function handleError(_0x467d97,_0x4eebc1){_0x4eebc1=_0x4eebc1||0x1f4;return function(_0x2a1f14){logger['error'](_0x2a1f14[_0x8ea2('0x3b')]);if(_0x2a1f14[_0x8ea2('0x3c')]){delete _0x2a1f14[_0x8ea2('0x3c')];}_0x467d97[_0x8ea2('0x2f')](_0x4eebc1)['send'](_0x2a1f14);};}function getMustacheRender(_0x2bed24,_0x531979){return Mustache['render'](_0x2bed24,_[_0x8ea2('0x3d')](_0x531979['body'],{'contact':_0x531979[_0x8ea2('0x3e')],'message':_0x531979[_0x8ea2('0x2d')],'agent':_0x531979[_0x8ea2('0x3f')],'interaction':_0x531979[_0x8ea2('0x40')],'account':_0x531979[_0x8ea2('0x41')]}))||'';}function getInteractionUsers(_0x4ae536,_0x84685d){return new BPromise(function(_0x5c5d2d,_0x12a6c2){try{if(_0x84685d[_0x4ae536['id']]){_0x4ae536[_0x8ea2('0x42')]=_[_0x8ea2('0x43')](_0x84685d[_0x4ae536['id']],function(_0x3995ff){return{'id':_0x3995ff['id'],'fullname':_0x3995ff['fullname']};});}}catch(_0x44e8bc){_0x12a6c2(_0x44e8bc);}_0x5c5d2d(_0x4ae536);});}function getInteractionTags(_0x57a6b8,_0x3f0c78){return new BPromise(function(_0x5ba351,_0x2ee78b){try{if(_0x57a6b8[_0x8ea2('0x44')]){_0x57a6b8[_0x8ea2('0x45')]=[];_0x57a6b8[_0x8ea2('0x44')][_0x8ea2('0x46')](',')[_0x8ea2('0x47')](function(_0x2f4fa8){_0x57a6b8['Tags']['push'](_0x3f0c78[_0x2f4fa8]);});}delete _0x57a6b8[_0x8ea2('0x44')];}catch(_0x53455a){_0x2ee78b(_0x53455a);}_0x5ba351(_0x57a6b8);});}function updateChatInteraction(_0x4b03fa,_0x59e2fa,_0x3cbc09){return new BPromise(function(_0x5d9ba0,_0x40a532){return getInteractionUsers(_0x4b03fa,_0x3cbc09)[_0x8ea2('0x25')](function(_0x39c944){return getInteractionTags(_0x39c944,_0x59e2fa);})[_0x8ea2('0x25')](function(_0x989d9b){_0x5d9ba0(_0x989d9b);})[_0x8ea2('0x2e')](function(_0x3b2219){_0x40a532(_0x3b2219);});});}exports[_0x8ea2('0x48')]=function(_0x5352b9,_0x3afb80){var _0x1ef615={},_0x1db25c={},_0x5cb6ad={'count':0x0,'rows':[]};var _0x2d6bbb=_[_0x8ea2('0x43')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')],function(_0x20992d){return{'name':_0x20992d['fieldName'],'type':_0x20992d[_0x8ea2('0x4b')][_0x8ea2('0x4c')]};});_0x1db25c[_0x8ea2('0x4d')]=_['map'](_0x2d6bbb,_0x8ea2('0x3c'));_0x1db25c[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x5352b9[_0x8ea2('0x4e')]);_0x1db25c[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],_0x1db25c[_0x8ea2('0x4e')]);_0x1ef615[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x1ef615['attributes']=_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x1ef615[_0x8ea2('0x52')]:_0x1db25c[_0x8ea2('0x4d')];if(!_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x55')](_0x8ea2('0x56'))){_0x1ef615[_0x8ea2('0x34')]=qs['limit'](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x34')]);_0x1ef615[_0x8ea2('0x32')]=qs['offset'](_0x5352b9['query'][_0x8ea2('0x32')]);}_0x1ef615[_0x8ea2('0x57')]=qs[_0x8ea2('0x58')](_0x5352b9['query'][_0x8ea2('0x58')]);_0x1ef615[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x5352b9[_0x8ea2('0x4e')],_0x1db25c['filters']),_0x2d6bbb);var _0x4afd85=[];var _0x24a22a=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x5c')]('id')['field'](_0x8ea2('0x3c'))[_0x8ea2('0x5c')](_0x8ea2('0x5d'))['from']('tools_tags');var _0x48aebf=squel['select']()['field'](_0x8ea2('0x5e'))[_0x8ea2('0x5c')]('u.fullname')['field'](_0x8ea2('0x5f'))[_0x8ea2('0x60')](_0x8ea2('0x61'),'ui')['left_join'](_0x8ea2('0x62'),'u',_0x8ea2('0x63'));var _0x59e3df=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x60')](_0x8ea2('0x64'),'i')[_0x8ea2('0x65')](_0x8ea2('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x8ea2('0x67'))[_0x8ea2('0x65')](_0x8ea2('0x68'),'a',_0x8ea2('0x69'))[_0x8ea2('0x65')](_0x8ea2('0x6a'),'me',_0x8ea2('0x6b'))['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x8ea2('0x65')](_0x8ea2('0x6c'),'t',_0x8ea2('0x6d'));var _0x2bbec0=squel['expr']();var _0x11824e=[];var _0x2b8662=squel['expr']();var _0x21485a;if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x6e')]){_0x21485a=as[_0x8ea2('0x6f')](_0x5352b9[_0x8ea2('0x4e')]['search']);var _0x479c05=_0x21485a['sqlOperator'];for(var _0x53a62c=0x0;_0x53a62c<_0x21485a[_0x8ea2('0x70')][_0x8ea2('0x54')];_0x53a62c++){var _0x2d8221=_0x21485a[_0x8ea2('0x70')][_0x53a62c];var _0x491d3d='i';var _0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x2d8221[_0x8ea2('0x5c')]]);if(!_0x461d32){switch(_0x2d8221['field']){case _0x8ea2('0x72'):if(_0x2d8221['value']==0x1){_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+_0x8ea2('0x74'));}else{_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+'`\x20>\x200');}break;case _0x8ea2('0x75'):if(_0x2d8221['operator']===_0x8ea2('0x76')){if(_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')]('\x20')[_0x8ea2('0x54')]>0x1){_0x2bbec0[_0x479c05]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8ea2('0x78')](_0x2d8221[_0x8ea2('0x77')]),null);}else{var _0x39776d='%'+_0x2d8221[_0x8ea2('0x77')]+'%';_0x2bbec0[_0x479c05](_0x8ea2('0x79'),_0x39776d,_0x39776d,_0x39776d);}}else{_0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x8ea2('0x7a')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x7a');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db['text'],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);}break;case _0x8ea2('0x7d'):var _0x219f78=_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')](',')[_0x8ea2('0x43')](function(_0xefb7b){return Number(_0xefb7b);});_0x219f78[_0x8ea2('0x47')](function(_0x35cfc5){_0x2b8662['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35cfc5+',%');});_0x11824e=_[_0x8ea2('0x7e')](_0x11824e,_0x219f78);break;case _0x8ea2('0x7f'):if(_0x2d8221[_0x8ea2('0x80')]===_0x8ea2('0x76')){_0x2bbec0[_0x479c05](_0x8ea2('0x81'),'%'+_0x2d8221['value']+'%',null);}else{_0x461d32=_['find'](_0x2d6bbb,['name',_0x8ea2('0x82')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x82');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db['value'][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')]['end']);}break;case'body':_0x3d55db=as[_0x8ea2('0x7b')]('me',null,_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);break;}}else{var _0x3d55db=as['buildExpression'](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db['value'][_0x8ea2('0x30')]);}}}else{var _0x356099=_(_0x5352b9[_0x8ea2('0x4e')])['keys']()[_0x8ea2('0x43')](function(_0x5c2d05){return _['some'](_0x2d6bbb,[_0x8ea2('0x3c'),_0x5c2d05])?_0x5c2d05:undefined;})[_0x8ea2('0x84')]()['value']();if(!_['isEmpty'](_0x356099)){_0x356099['forEach'](function(_0x167f15){if(_0x167f15==='ChatWebsiteId'){_0x59e3df['where'](_0x8ea2('0x85'),[][_0x8ea2('0x86')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15]));}else if(_0x167f15===_0x8ea2('0x87')){var _0x1681d8=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x89')];var _0x14a5de=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x8a')];_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0x8b'),_0x1681d8,_0x14a5de);}else{if(_0x5352b9['query'][_0x167f15]===_0x8ea2('0x8c')){_0x59e3df[_0x8ea2('0x59')]('i.'+_0x167f15+_0x8ea2('0x8d'));}else{_0x59e3df['where']('i.'+_0x167f15+_0x8ea2('0x8e'),_0x5352b9['query'][_0x167f15]);}}});}if(_0x5352b9[_0x8ea2('0x4e')]['read']){if(_0x5352b9[_0x8ea2('0x4e')]['read']==0x1){_0x59e3df[_0x8ea2('0x73')](_0x8ea2('0x8f'));}else{_0x59e3df['having'](_0x8ea2('0x90'));}}if(_0x5352b9['query'][_0x8ea2('0x91')]){_0x11824e=_[_0x8ea2('0x92')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x91')])?_0x5352b9[_0x8ea2('0x4e')]['tag']:new Array(_0x5352b9['query'][_0x8ea2('0x91')]);_0x11824e['forEach'](function(_0x410f78){_0x2b8662['or'](_0x8ea2('0x93'),'%,'+_0x410f78+',%');});}if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x94')]){var _0x262cef=_0x5352b9[_0x8ea2('0x4e')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8ea2('0x95')](_0x262cef)){_0x2bbec0['or']('i.id\x20LIKE\x20?',_0x262cef+'%');}else{_0x2bbec0['or'](_0x8ea2('0x96'),qs[_0x8ea2('0x78')](_0x262cef))['or'](_0x8ea2('0x97'),_0x262cef+'%');}}}_0x59e3df[_0x8ea2('0x59')](_0x2bbec0);_0x59e3df[_0x8ea2('0x98')](_0x8ea2('0x99'));var _0x4b4d64={'type':db[_0x8ea2('0x9a')][_0x8ea2('0x9b')][_0x8ea2('0x9c')],'raw':!![]};var _0x335a96=_0x59e3df[_0x8ea2('0x9d')]();_0x335a96['field']('i.id');_0x335a96[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));if(_0x1ef615[_0x8ea2('0x57')]){_0x1ef615[_0x8ea2('0x57')][_0x8ea2('0x47')](function(_0x2e0bbe){var _0x9c4960=_0x2e0bbe[0x0]===_0x8ea2('0x9f')?_0x2e0bbe[0x0]:'i.'+_0x2e0bbe[0x0];_0x59e3df[_0x8ea2('0x57')](_0x9c4960,_0x2e0bbe[0x1]===_0x8ea2('0xa0')?![]:!![]);});}if(!_[_0x8ea2('0xa1')](_0x11824e)){_0x59e3df[_0x8ea2('0x73')](_0x2b8662);_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa2'),_0x11824e);}BPromise[_0x8ea2('0xa3')]()[_0x8ea2('0x25')](function(){if(!_0x21485a){if(_0x5352b9['query']['ChatWebsiteId'])return;_0x335a96[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa4'));return;}if(_0x5352b9['user'][_0x8ea2('0xa5')]!=='agent')return;return _0x5352b9[_0x8ea2('0xa6')][_0x8ea2('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17dee8){if(_[_0x8ea2('0xa1')](_0x17dee8)){_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa8'));_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa8'));}else{_0x335a96[_0x8ea2('0x59')](_0x8ea2('0x85'),_[_0x8ea2('0x43')](_0x17dee8,'id'));_0x59e3df[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IN\x20?',_[_0x8ea2('0x43')](_0x17dee8,'id'));}});})[_0x8ea2('0x25')](function(){if(_0x5352b9['user'][_0x8ea2('0xa5')]==='agent'&&!_0x21485a&&!_0x5352b9['query']['ChatWebsiteId'])return[];return db[_0x8ea2('0xa9')]['query'](_0x335a96[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x12ed20){_0x5cb6ad[_0x8ea2('0x35')]=_0x12ed20[_0x8ea2('0x54')];if(_0x5cb6ad[_0x8ea2('0x35')]===0x0)return[];return db['sequelize'][_0x8ea2('0x4e')](_0x24a22a['toString'](),_0x4b4d64)[_0x8ea2('0x25')](function(_0x18aa81){_0x4afd85=_[_0x8ea2('0xab')](_0x18aa81,'id');_0x4b4d64=_[_0x8ea2('0x3d')](_0x4b4d64,{'model':db[_0x8ea2('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5352b9['query'][_0x8ea2('0x53')]){_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x47')](function(_0x2a82b2){_0x59e3df[_0x8ea2('0x5c')]('i.'+_0x2a82b2);});}else{_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xac'),_0x8ea2('0xad'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xae'),_0x8ea2('0xaf'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb0'),_0x8ea2('0x9f'));_0x59e3df['field'](_0x8ea2('0xb1'));_0x59e3df['field']('c.firstName',_0x8ea2('0xb2'));_0x59e3df[_0x8ea2('0x5c')]('c.lastName',_0x8ea2('0xb3'));_0x59e3df[_0x8ea2('0x5c')]('c.email',_0x8ea2('0xb4'));_0x59e3df[_0x8ea2('0x5c')]('c.phone',_0x8ea2('0xb5'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb6'),_0x8ea2('0xb7'));_0x59e3df[_0x8ea2('0x5c')]('c.fax',_0x8ea2('0xb8'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb9'),_0x8ea2('0xba'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbb'),_0x8ea2('0xbc'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbd'),'TagIds');}if(_0x1ef615[_0x8ea2('0x34')])_0x59e3df['limit'](_0x1ef615[_0x8ea2('0x34')]);if(_0x1ef615[_0x8ea2('0x32')])_0x59e3df[_0x8ea2('0x32')](_0x1ef615[_0x8ea2('0x32')]);return db[_0x8ea2('0xa9')]['query'](_0x59e3df[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x4fdd16){if(_0x4fdd16['length']>0x0)_0x48aebf[_0x8ea2('0x59')](_0x8ea2('0xbe'),_['map'](_0x4fdd16,'id'));return db['sequelize'][_0x8ea2('0x4e')](_0x48aebf[_0x8ea2('0xaa')](),_0x4b4d64)['then'](function(_0x2b7e80){var _0x2f6673=_[_0x8ea2('0xbf')](_0x2b7e80,_0x8ea2('0xc0'));var _0xdf4de9=[];_0x4fdd16['forEach'](function(_0x2e3a5d){_0xdf4de9[_0x8ea2('0xc1')](updateChatInteraction(_0x2e3a5d,_0x4afd85,_0x2f6673));});return BPromise[_0x8ea2('0xc2')](_0xdf4de9);});});})[_0x8ea2('0x25')](function(_0x412af1){_0x5cb6ad['rows']=_0x412af1;return _0x5cb6ad;})[_0x8ea2('0x25')](respondWithFilteredResult(_0x3afb80,_0x1ef615))['catch'](handleError(_0x3afb80,null));};exports['show']=function(_0x9468be,_0x17e9fc){var _0x5c95ec={'raw':![],'where':{'id':_0x9468be[_0x8ea2('0xc3')]['id']}},_0x239516={};_0x239516[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')]);_0x239516['query']=_[_0x8ea2('0x4f')](_0x9468be[_0x8ea2('0x4e')]);_0x239516[_0x8ea2('0x50')]=_['intersection'](_0x239516[_0x8ea2('0x4d')],_0x239516[_0x8ea2('0x4e')]);_0x5c95ec[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x239516[_0x8ea2('0x4d')],qs['fields'](_0x9468be[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x5c95ec[_0x8ea2('0x52')]=_0x5c95ec[_0x8ea2('0x52')]['length']?_0x5c95ec['attributes']:_0x239516[_0x8ea2('0x4d')];if(_0x9468be['query'][_0x8ea2('0xc4')]){_0x5c95ec['include']=[{'all':!![]}];}_0x5c95ec=_[_0x8ea2('0x3d')]({},_0x5c95ec,_0x9468be[_0x8ea2('0xc5')]);return db[_0x8ea2('0x49')][_0x8ea2('0x71')](_0x5c95ec)[_0x8ea2('0x25')](handleEntityNotFound(_0x17e9fc,null))[_0x8ea2('0x25')](respondWithResult(_0x17e9fc,null))[_0x8ea2('0x2e')](handleError(_0x17e9fc,null));};exports['create']=function(_0x2c5677,_0x224fca){return db[_0x8ea2('0x49')][_0x8ea2('0xc6')](_0x2c5677[_0x8ea2('0xc7')],{})[_0x8ea2('0x25')](respondWithResult(_0x224fca,0xc9))['catch'](handleError(_0x224fca,null));};exports[_0x8ea2('0x38')]=function(_0x463372,_0x76085){if(_0x463372[_0x8ea2('0xc7')]['id']){delete _0x463372['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x463372[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x76085,null))[_0x8ea2('0x25')](saveUpdates(_0x463372['body'],null))[_0x8ea2('0x25')](respondWithResult(_0x76085,null))[_0x8ea2('0x2e')](handleError(_0x76085,null));};exports[_0x8ea2('0x39')]=function(_0x500b47,_0x331019){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x500b47[_0x8ea2('0xc3')]['id']}})['then'](handleEntityNotFound(_0x331019,null))['then'](removeEntity(_0x331019,null))[_0x8ea2('0x2e')](handleError(_0x331019,null));};exports[_0x8ea2('0xc8')]=function(_0x405020,_0x5c9359){return db[_0x8ea2('0x49')][_0x8ea2('0xc8')]()[_0x8ea2('0x25')](respondWithResult(_0x5c9359,null))[_0x8ea2('0x2e')](handleError(_0x5c9359,null));};exports[_0x8ea2('0xc9')]=function(_0x11c59e,_0x11b02a){var _0x5ab2c4=_0x11c59e[_0x8ea2('0xc3')]['id'];var _0x111f97;var _0xf76d70;var _0x384500;return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x5ab2c4}})[_0x8ea2('0x25')](function(_0x568581){_0x111f97=_0x568581;return db[_0x8ea2('0xcb')][_0x8ea2('0xca')]({'where':{'id':_0x568581[_0x8ea2('0xcc')]},'attributes':['id',_0x8ea2('0xcd'),_0x8ea2('0xce'),'vidaooTopic',_0x8ea2('0xcf'),_0x8ea2('0xd0')],'raw':!![]});})[_0x8ea2('0x25')](function(_0x1c336e){if(_0x1c336e&&_0x1c336e[_0x8ea2('0xcd')]&&_0x1c336e[_0x8ea2('0xce')]){_0xf76d70=_0x1c336e;var _0x473ae2={'interaction':{'id':_0x5ab2c4},'agent':{'id':_0x11c59e[_0x8ea2('0xa6')]['id'],'name':_0x11c59e[_0x8ea2('0xa6')]['name'],'fullname':_0x11c59e['user']['fullname'],'email':_0x11c59e[_0x8ea2('0xa6')]['email']},'contact':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x3e')],'account':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x41')]};var _0x6c0ccc={'rejectUnauthorized':![],'method':_0x8ea2('0xd1'),'url':_0x8ea2('0xd2'),'headers':{'X-APIKEY':_0x1c336e[_0x8ea2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11c59e[_0x8ea2('0xa6')][_0x8ea2('0xd3')]],'buttons':null,'topic':_0xf76d70['vidaooTopic'],'note':_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xcf')])?null:getMustacheRender(_0xf76d70[_0x8ea2('0xcf')],_0x473ae2),'metadata':null},'redirect':_0x8ea2('0xd5'),'json':!![]};try{if(!_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xd0')])){var _0xc6888c=getMustacheRender(_0xf76d70[_0x8ea2('0xd0')],_0x473ae2);var _0x152d46=JSON[_0x8ea2('0x88')](_0xc6888c);_0x6c0ccc[_0x8ea2('0xc7')][_0x8ea2('0xd6')]=_0x152d46;}}catch(_0x465e7f){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xd8'));}return rp(_0x6c0ccc);}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x4b2c0f){_0x384500=_0x4b2c0f;if(_0x384500['id']){var _0x2fcddc={'body':_0x384500[_0x8ea2('0xd9')],'ChatWebsiteId':_0xf76d70['id'],'ChatInteractionId':_0x111f97['id'],'direction':'out','UserId':_0x11c59e[_0x8ea2('0xa6')]['id']};return db[_0x8ea2('0xda')][_0x8ea2('0xc6')](_0x2fcddc,{});}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError'](_0x8ea2('0xdb'));}})['then'](function(){return _0x111f97[_0x8ea2('0xdc')]({'vidaooSessionId':_0x384500['id']});})[_0x8ea2('0x25')](respondWithResult(_0x11b02a,null))[_0x8ea2('0x2e')](handleError(_0x11b02a,null));};exports[_0x8ea2('0xdd')]=function(_0x3b6b03,_0x3292bc){if(_0x3b6b03['body']['id']){delete _0x3b6b03['body']['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x3b6b03['params']['id']},'include':[{'model':db[_0x8ea2('0xde')],'as':'Contact'}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x3292bc,null))[_0x8ea2('0x25')](saveUpdates(_0x3b6b03[_0x8ea2('0xc7')],null))[_0x8ea2('0x25')](respondWithResult(_0x3292bc,null))[_0x8ea2('0x2e')](handleError(_0x3292bc,null));};exports[_0x8ea2('0xdf')]=function(_0x1383b4,_0x4c1b9d,_0x3f3822){if(_0x1383b4[_0x8ea2('0xc7')]['id']){delete _0x1383b4[_0x8ea2('0xc7')]['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x1383b4[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](function(_0x1c974d){if(!_0x1c974d){logger[_0x8ea2('0x2b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x8ea2('0xdf'),0x194,_0x8ea2('0xe0'));_0x4c1b9d[_0x8ea2('0x3a')](0x194);}else{if(_0x1c974d['UserId']){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xe1'));}}return _0x1c974d;})[_0x8ea2('0x25')](function(_0xe18090){if(_0xe18090){return _0xe18090[_0x8ea2('0x38')]({'closed':_0x1383b4['body']['closed'],'disposition':_0x1383b4[_0x8ea2('0xc7')][_0x8ea2('0xe2')]})[_0x8ea2('0x25')](function(_0x695f4a){return _0x695f4a;});}})[_0x8ea2('0x25')](function(_0x57ff72){return respondWithRpcPromise(_0x8ea2('0xe3'),'abandon',_0x1383b4[_0x8ea2('0xc7')],client9004);})[_0x8ea2('0x25')](respondWithResult(_0x4c1b9d,null))['catch'](handleError(_0x4c1b9d,null));};exports[_0x8ea2('0xe4')]=function(_0x254b51,_0x2c11d2,_0x2aaa88){_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x3c')]=_0x254b51[_0x8ea2('0xe5')][_0x8ea2('0xe6')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0xe7')]=_0x254b51['file'][_0x8ea2('0xe8')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x4b')]=_0x254b51['file'][_0x8ea2('0xe9')];return db['Attachment'][_0x8ea2('0xc6')](_0x254b51[_0x8ea2('0xc7')])[_0x8ea2('0x25')](respondWithResult(_0x2c11d2,0xc9))[_0x8ea2('0x2e')](handleError(_0x2c11d2,null));};exports[_0x8ea2('0xea')]=function(_0x1786ac,_0x7a45a8,_0x3a68e2){return db[_0x8ea2('0x49')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0xc3')]['id']},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null))[_0x8ea2('0x25')](function(_0x8d4abd){if(_0x8d4abd){if(_0x8d4abd[_0x8ea2('0xeb')]){return _0x7a45a8[_0x8ea2('0x2f')](0x193)[_0x8ea2('0x31')]({'status':0x193,'message':_0x8ea2('0xec')});}return db[_0x8ea2('0xed')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0x4e')][_0x8ea2('0xee')]},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null));}})[_0x8ea2('0x25')](function(_0xcbb6b3){if(_0xcbb6b3){var _0x4bdbe0=_0xcbb6b3[_0x8ea2('0xef')]!==null;var _0x44791f=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf2'));if(_0x4bdbe0){_0x44791f=path['join'](_0x44791f,_0x8ea2('0xf3'));}var _0x4e7aff=path[_0x8ea2('0xf0')](_0x44791f,_0xcbb6b3[_0x8ea2('0xe7')]);return _0x7a45a8[_0x8ea2('0xf4')](_0x4e7aff);}})['catch'](handleError(_0x7a45a8,null));};exports[_0x8ea2('0xf5')]=function(_0x48a2e2,_0x4e804c){var _0x487bab=null;var _0x1a0966=null;var _0x50087b=null;var _0x196b89=null;if(_0x48a2e2[_0x8ea2('0xc7')]['id']){delete _0x48a2e2[_0x8ea2('0xc7')]['id'];}if(_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')]){_0x196b89=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf7'),util['format']('transcript-%s.txt',Date[_0x8ea2('0xf8')]()));_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf9')]=_0x196b89;}return db['ChatInteraction']['find']({'where':{'id':_0x48a2e2['params']['id']},'include':[{'model':db[_0x8ea2('0xda')],'as':'Messages','include':[{'model':db['User'],'as':_0x8ea2('0x7f')}]}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x4e804c,null))['then'](saveUpdates(_0x48a2e2['body'],null))[_0x8ea2('0x25')](function(_0x48eac8){if(_0x48eac8){_0x487bab=_0x48eac8;return db['ChatWebsite'][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0xcc')]}});}})[_0x8ea2('0x25')](function(_0x54da21){if(_0x54da21){_0x50087b=_0x54da21;return db[_0x8ea2('0xde')][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0x7a')]}});}})[_0x8ea2('0x25')](function(_0x3a43d5){if(_0x3a43d5){_0x1a0966=_0x3a43d5;if(_0x196b89){var _0x535b01=null;for(var _0x22e4cd=0x1;_0x22e4cd<_0x487bab['Messages'][_0x8ea2('0x54')];++_0x22e4cd){_0x535b01=_0x487bab['Messages'][_0x22e4cd];var _0x230a70=_0x535b01['UserId']?util['format'](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');var _0x332670=_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xfd')]||util[_0x8ea2('0xfe')]('%s%d',_0x8ea2('0xff'),_0x535b01[_0x8ea2('0x7a')]);switch(_0x50087b[_0x8ea2('0x100')]){case _0x8ea2('0x101'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?util['format'](_0x8ea2('0xfa'),_0x50087b['agentAlias'],_0x535b01[_0x8ea2('0x82')]):'System';break;case _0x8ea2('0x102'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01[_0x8ea2('0x7f')][_0x8ea2('0x103')]||_0x535b01['User']['fullname']:'System';break;case _0x8ea2('0x104'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01['User'][_0x8ea2('0x105')]:_0x8ea2('0xfc');break;default:_0x230a70=_0x535b01[_0x8ea2('0x82')]?util[_0x8ea2('0xfe')](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');}var _0x422280=util[_0x8ea2('0xfe')](_0x8ea2('0x106'),moment(_0x535b01[_0x8ea2('0x87')])[_0x8ea2('0xfe')]('MM/DD/YYYY\x20HH:mm:ss'),_0x535b01[_0x8ea2('0x107')]==='in'?_0x332670:_0x230a70,_0x535b01['body']);if(!_0x535b01['secret']){fs[_0x8ea2('0x108')](_0x196b89,_0x422280);}}return db['MailAccount'][_0x8ea2('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0x8ea2('0x109')],'as':_0x8ea2('0x10a'),'raw':!![]}]});}}})[_0x8ea2('0x25')](function(_0xff0fae){if(_0xff0fae&&_0xff0fae['Smtp']&&_0x48a2e2[_0x8ea2('0xc7')]){var _0x3f5688={'tls':{'rejectUnauthorized':![]}};if(_0xff0fae[_0x8ea2('0x10a')]['service']){_0x3f5688['service']=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10b')];}else{_0x3f5688['host']=_0xff0fae[_0x8ea2('0x10a')]['host'];_0x3f5688[_0x8ea2('0x10c')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10c')];_0x3f5688[_0x8ea2('0x10d')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10d')];}if(_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10e')]){_0x3f5688[_0x8ea2('0x10f')]={'user':_0xff0fae['Smtp']['user'],'pass':_0xff0fae[_0x8ea2('0x10a')]['pass']};}return respondWithRpcPromise(_0x8ea2('0x110'),_0x8ea2('0x111'),{'account':_0x3f5688,'message':{'from':util[_0x8ea2('0xfe')](_0x8ea2('0x112'),_0xff0fae['name'],_0xff0fae[_0x8ea2('0xd3')]||_0xff0fae[_0x8ea2('0x10a')]['user']),'to':_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')],'subject':_0x8ea2('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48a2e2['body'][_0x8ea2('0xf6')]),'attachments':[{'path':_0x196b89}]}})['then'](function(){return _0x487bab;})[_0x8ea2('0x2e')](function(_0x488acb){console[_0x8ea2('0x2b')](_0x488acb);});}else{return _0x487bab;}})[_0x8ea2('0x25')](respondWithStatusCode(_0x4e804c,0xc8))[_0x8ea2('0x2e')](handleError(_0x4e804c,null));};exports[_0x8ea2('0x114')]=function(_0x54925a,_0x295339,_0x55c23c){return db['ChatMessage']['find']({'where':{'id':_0x54925a[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x295339,null))[_0x8ea2('0x25')](function(_0x48b51d){if(_0x48b51d){return _0x48b51d[_0x8ea2('0x114')](_0x54925a[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x54925a[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{});}})[_0x8ea2('0x25')](respondWithResult(_0x295339,null))[_0x8ea2('0x2e')](handleError(_0x295339,null));};exports[_0x8ea2('0x117')]=function(_0x102d70,_0x2b014d,_0xc35654){var _0x355b91={'raw':![],'where':{}};var _0x1cf414={};var _0x48e543={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8ea2('0xca')]({'where':{'id':_0x102d70['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x2b014d,null))[_0x8ea2('0x25')](function(_0x3ebbc8){if(_0x3ebbc8){_0x1cf414['model']=_[_0x8ea2('0x4f')](db['ChatMessage']['rawAttributes']);_0x1cf414[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x102d70[_0x8ea2('0x4e')]);_0x1cf414[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],_0x1cf414[_0x8ea2('0x4e')]);_0x355b91['attributes']=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x102d70['query'][_0x8ea2('0x53')]));_0x355b91[_0x8ea2('0x52')]=_0x355b91[_0x8ea2('0x52')]['length']?_0x355b91[_0x8ea2('0x52')]:_0x1cf414[_0x8ea2('0x4d')];if(!_0x102d70[_0x8ea2('0x4e')]['hasOwnProperty']('nolimit')){_0x355b91[_0x8ea2('0x34')]=qs['limit'](_0x102d70[_0x8ea2('0x4e')]['limit']);_0x355b91[_0x8ea2('0x32')]=qs[_0x8ea2('0x32')](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x32')]);}_0x355b91[_0x8ea2('0x57')]=qs['sort'](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x355b91[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x102d70[_0x8ea2('0x4e')],_0x1cf414['filters']));_0x355b91['where'][_0x8ea2('0xc0')]=_0x3ebbc8['id'];if(_0x102d70[_0x8ea2('0x4e')]['filter']){_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],{'$or':_[_0x8ea2('0x43')](_0x355b91['attributes'],function(_0x19ea2b){var _0x4450e8={};_0x4450e8[_0x19ea2b]={'$like':'%'+_0x102d70['query'][_0x8ea2('0x94')]+'%'};return _0x4450e8;})});}if(_0x102d70['query'][_0x8ea2('0x89')]){var _0x479b40=_0x102d70['query'][_0x8ea2('0x89')][_0x8ea2('0x46')](',');var _0xbb5964={};_0xbb5964[_0x479b40[0x0]]={'$gte':moment(_0x479b40[0x1])[_0x8ea2('0xfe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],_0xbb5964);}_0x355b91=_['merge']({},_0x355b91,_0x102d70[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x355b91[_0x8ea2('0x59')]})[_0x8ea2('0x25')](function(_0x46d38e){_0x48e543[_0x8ea2('0x35')]=_0x46d38e;if(_0x102d70['query'][_0x8ea2('0xc4')]){_0x355b91[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x355b91);})[_0x8ea2('0x25')](function(_0x23f247){_0x48e543[_0x8ea2('0x11a')]=_0x23f247;return _0x48e543;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x2b014d,_0x355b91))[_0x8ea2('0x2e')](handleError(_0x2b014d,null));};exports[_0x8ea2('0x11b')]=function(_0x3a37fb,_0x455009,_0x556919){var _0x58a0e5={'where':{}},_0x3be2ce={},_0x56a973={'count':0x0,'rows':[]};return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x3a37fb[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x455009,null))[_0x8ea2('0x25')](function(_0x515381){if(_0x515381){_0x3be2ce[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db['ChatMessage'][_0x8ea2('0x4a')]);_0x3be2ce[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x3a37fb[_0x8ea2('0x4e')]);_0x3be2ce['filters']=_[_0x8ea2('0x51')](_0x3be2ce[_0x8ea2('0x4d')],_0x3be2ce[_0x8ea2('0x4e')]);_0x58a0e5[_0x8ea2('0x52')]=_['intersection'](_0x3be2ce[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x3a37fb[_0x8ea2('0x4e')]['fields']));_0x58a0e5[_0x8ea2('0x52')]=_0x58a0e5[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x58a0e5['attributes']:_0x3be2ce['model'];if(!_0x3a37fb[_0x8ea2('0x4e')]['hasOwnProperty'](_0x8ea2('0x56'))){_0x58a0e5[_0x8ea2('0x34')]=qs[_0x8ea2('0x34')](_0x3a37fb[_0x8ea2('0x4e')]['limit']);_0x58a0e5[_0x8ea2('0x32')]=qs['offset'](_0x3a37fb['query']['offset']);}_0x58a0e5['order']=qs[_0x8ea2('0x58')](_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x58a0e5[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_['pick'](_0x3a37fb['query'],_0x3be2ce[_0x8ea2('0x50')]));_0x58a0e5['where']['ChatInteractionId']=_0x515381['id'];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]){_0x58a0e5[_0x8ea2('0x59')]=_['merge'](_0x58a0e5[_0x8ea2('0x59')],{'$or':_['map'](_0x58a0e5[_0x8ea2('0x52')],function(_0x4041ec){var _0x56178b={};_0x56178b[_0x4041ec]={'$like':'%'+_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]+'%'};return _0x56178b;})});}_0x58a0e5['where'][_0x8ea2('0x11c')]=![];if(_0x3a37fb[_0x8ea2('0x4e')]['id']){_0x58a0e5[_0x8ea2('0x59')]['id']={'$gt':_0x3a37fb[_0x8ea2('0x4e')]['id']};}_0x58a0e5=_[_0x8ea2('0x3d')]({},_0x58a0e5,_0x3a37fb[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x58a0e5[_0x8ea2('0x59')]})['then'](function(_0xcedece){_0x56a973['count']=_0xcedece;_0x58a0e5[_0x8ea2('0x118')]=[];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x11d')]){_0x58a0e5[_0x8ea2('0x118')][_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':_0x8ea2('0x7f'),'attributes':['id',_0x8ea2('0x105'),'alias']});}if(_0x3a37fb['query'][_0x8ea2('0xc4')]){_0x58a0e5[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x58a0e5);})[_0x8ea2('0x25')](function(_0x52bf7c){_0x56a973[_0x8ea2('0x11a')]=_0x52bf7c;return _0x56a973;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x455009,_0x58a0e5))['catch'](handleError(_0x455009,null));};exports[_0x8ea2('0x11e')]=function(_0x3be5d0,_0x3ac848,_0x52ce76){return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x3be5d0['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x3ac848,null))[_0x8ea2('0x25')](function(_0x1030c9){if(_0x1030c9){return _0x1030c9[_0x8ea2('0x11f')](_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x3be5d0[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{})[_0x8ea2('0x120')](function(){return db[_0x8ea2('0x7d')][_0x8ea2('0x119')]({'attributes':['id',_0x8ea2('0x3c'),_0x8ea2('0x5d')],'where':{'id':_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')]}});})[_0x8ea2('0x25')](function(_0x452b94){socket[_0x8ea2('0x121')]('chatInteractionTags:save',{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]});return{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]};});}})[_0x8ea2('0x25')](respondWithResult(_0x3ac848,null))[_0x8ea2('0x2e')](handleError(_0x3ac848,null));};exports[_0x8ea2('0x122')]=function(_0x9410dd,_0x497671,_0x5e3e8d){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x9410dd[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x497671,null))[_0x8ea2('0x25')](function(_0x19b042){if(_0x19b042){return _0x19b042[_0x8ea2('0x122')](_0x9410dd[_0x8ea2('0x4e')][_0x8ea2('0x115')]);}})['then'](respondWithStatusCode(_0x497671,null))[_0x8ea2('0x2e')](handleError(_0x497671,null));};exports[_0x8ea2('0xf4')]=function(_0x2dc450,_0x34e1c5){var _0x5b929c=moment()['unix']()[_0x8ea2('0xaa')]();var _0x263123=path[_0x8ea2('0xf0')](config['root'],'server',_0x8ea2('0x123'),'tmp');var _0x40e8e6=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x123'),_0x8ea2('0x124'));var _0x2dfabc=path[_0x8ea2('0xf0')](_0x263123,_0x5b929c);var _0x515049=util['format'](_0x8ea2('0x125'),_0x2dc450[_0x8ea2('0xc3')]['id'],_0x5b929c);var _0x39000d=path['join'](_0x263123,_0x515049);var _0x3a1752=[];_0x3a1752['push']({'model':db[_0x8ea2('0x7f')],'as':'User','attributes':['id',_0x8ea2('0x105')],'raw':!![]});_0x3a1752['push']({'model':db[_0x8ea2('0xde')],'as':_0x8ea2('0x75'),'attributes':['id',_0x8ea2('0x126'),_0x8ea2('0x127')],'raw':!![]});if(_0x2dc450['query'][_0x8ea2('0x124')]){_0x3a1752[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xed')],'as':_0x8ea2('0xed'),'raw':!![]});}var _0x5ba508=[{'model':db[_0x8ea2('0xda')],'as':_0x8ea2('0x128'),'attributes':['id',_0x8ea2('0xc7'),_0x8ea2('0x87'),_0x8ea2('0x107'),'secret',_0x8ea2('0x129')],'include':_0x3a1752}];_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xcb')],'as':_0x8ea2('0x12a'),'attributes':['id','name']});_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x2dc450[_0x8ea2('0xc3')]['id']},'include':_0x5ba508})[_0x8ea2('0x25')](handleEntityNotFound(_0x34e1c5,null))[_0x8ea2('0x25')](function(_0x3c9013){if(_0x3c9013){var _0x103c43=_0x3c9013['get']({'plain':!![]});fs['mkdirSync'](_0x2dfabc);var _0xc099b6={'channel':_0x8ea2('0x12b'),'account':_0x103c43[_0x8ea2('0x12a')]['name'],'agent':_0x103c43['Owner']?_0x103c43[_0x8ea2('0x12c')][_0x8ea2('0x105')]:'N.A.','createdAt':moment(_0x103c43[_0x8ea2('0x87')])['format'](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'closedAt':_0x103c43[_0x8ea2('0xeb')]?moment(_0x103c43['closedAt'])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))['toString']():'','disposition':_0x103c43[_0x8ea2('0xe2')],'chatInfo':{'browser':_0x103c43[_0x8ea2('0x12e')],'os':_0x103c43['osName'],'referer':_0x103c43['referer'],'customerIp':_0x103c43[_0x8ea2('0x12f')],'customerPort':_0x103c43[_0x8ea2('0x130')]?_0x103c43[_0x8ea2('0x130')]:'N.A.'},'messages':_(_0x103c43[_0x8ea2('0x128')])[_0x8ea2('0x131')]()[_0x8ea2('0x94')]({'secret':![]})[_0x8ea2('0x43')](function(_0x36799a){if(_0x36799a['Attachment']){var _0x1cc1d9=path['join'](_0x40e8e6,_0x36799a[_0x8ea2('0xed')]['basename']);if(fs[_0x8ea2('0x132')](_0x1cc1d9)){fs[_0x8ea2('0x133')](_0x1cc1d9)[_0x8ea2('0x134')](fs[_0x8ea2('0x135')](path['join'](_0x2dfabc,_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')])));}}return{'date':moment(_0x36799a[_0x8ea2('0x87')])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'sender':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?_0x36799a[_0x8ea2('0x7f')]?_0x36799a[_0x8ea2('0x7f')][_0x8ea2('0x105')]:'System':_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x126')]+(_0x36799a[_0x8ea2('0x75')]['lastName']?'\x20'+_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x127')]:''),'body':_0x36799a[_0x8ea2('0xed')]?_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')]:_0x36799a[_0x8ea2('0xc7')],'direction':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?'A':'C','secret':_0x36799a[_0x8ea2('0x11c')],'read':_0x36799a[_0x8ea2('0x129')],'attachment':_0x36799a['Attachment']};})[_0x8ea2('0x77')]()};return ejs[_0x8ea2('0x137')](path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x138'),_0x8ea2('0x139')),{'interaction':_0xc099b6})[_0x8ea2('0x25')](function(_0x10d2b3){var _0x12a217=path[_0x8ea2('0xf0')](_0x2dfabc,_0x8ea2('0x13a')+_0x103c43['id']+'-'+_0x5b929c+'.pdf');var _0x44b0dc={'path':_0x12a217,'channel':_0x8ea2('0x12b'),'interactionId':_0x103c43['id']};return pdf['createPdfFromHTML'](_0x10d2b3,_0x44b0dc);})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x27f5e9,_0x19b678){zipdir(_0x2dfabc,{'saveTo':_0x39000d},function(_0x50ebcd,_0x5d6c63){if(_0x50ebcd)return _0x19b678(_0x50ebcd);return _0x27f5e9(_0x5d6c63);});})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x55b3a1,_0x57e228){rimraf(_0x2dfabc,function(_0x3c669b){if(_0x3c669b)_0x57e228(_0x3c669b);return _0x55b3a1();});});})[_0x8ea2('0x25')](function(){return _0x34e1c5['download'](_0x39000d,_0x515049,function(_0x688d21){if(_0x688d21){console[_0x8ea2('0x13b')]('err',_0x688d21);}else{fs[_0x8ea2('0x13c')](_0x39000d);}});});});}else{return _0x34e1c5['sendStatus'](0xc8);}})[_0x8ea2('0x2e')](handleError(_0x34e1c5,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 4dd1daa..fd39c89 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 _0x3e25=['emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x1eff20,_0xa93827){var _0x44ccfe=function(_0x15a7a0){while(--_0x15a7a0){_0x1eff20['push'](_0x1eff20['shift']());}};_0x44ccfe(++_0xa93827);}(_0x3e25,0x1ea));var _0x53e2=function(_0x57027e,_0xaef912){_0x57027e=_0x57027e-0x0;var _0x139fde=_0x3e25[_0x57027e];return _0x139fde;};'use strict';var EventEmitter=require(_0x53e2('0x0'));var ChatInteraction=require(_0x53e2('0x1'))['db'][_0x53e2('0x2')];var ChatMessage=require(_0x53e2('0x1'))['db'][_0x53e2('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x53e2('0x4')](0x0);var events={'afterCreate':_0x53e2('0x5'),'afterUpdate':'update','afterDestroy':_0x53e2('0x6')};function emitEvent(_0x140f6f){return function(_0x3cd8cc,_0x2a60f9,_0xe9a93f){_0x3cd8cc[_0x53e2('0x7')]({'attributes':['id'],'raw':!![]})[_0x53e2('0x8')](function(_0x2ea5d7){_0x3cd8cc[_0x53e2('0x9')](_0x53e2('0xa'),_0x2ea5d7[_0x53e2('0xb')](function(_0x5ab94a){return{'id':_0x5ab94a['id']};}));return ChatMessage[_0x53e2('0xc')]({'where':{'ChatInteractionId':_0x3cd8cc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x53e2('0x8')](function(_0x4f8c08){_0x3cd8cc['setDataValue'](_0x53e2('0xd'),_0x4f8c08['length']);ChatInteractionEvents[_0x53e2('0xe')](_0x140f6f+':'+_0x3cd8cc['id'],_0x3cd8cc);ChatInteractionEvents[_0x53e2('0xe')](_0x140f6f,_0x3cd8cc);_0xe9a93f(null);})[_0x53e2('0xf')](_0xe9a93f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x53e2('0x10')](e,emitEvent(event));}}module[_0x53e2('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x4680=['save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x4680,0x1ce));var _0x0468=function(_0x51ff59,_0x23a4f0){_0x51ff59=_0x51ff59-0x0;var _0x36d2e3=_0x4680[_0x51ff59];return _0x36d2e3;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x0468('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x0468('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0468('0x2')](0x0);var events={'afterCreate':_0x0468('0x3'),'afterUpdate':_0x0468('0x4'),'afterDestroy':_0x0468('0x5')};function emitEvent(_0x1d2efa){return function(_0x462798,_0x5444bd,_0x2c38df){_0x462798['getUsers']({'attributes':['id'],'raw':!![]})[_0x0468('0x6')](function(_0x2ac0bd){_0x462798[_0x0468('0x7')](_0x0468('0x8'),_0x2ac0bd['map'](function(_0x2d5c7c){return{'id':_0x2d5c7c['id']};}));return ChatMessage[_0x0468('0x9')]({'where':{'ChatInteractionId':_0x462798['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0468('0x6')](function(_0x4151ec){_0x462798[_0x0468('0x7')](_0x0468('0xa'),_0x4151ec[_0x0468('0xb')]);ChatInteractionEvents[_0x0468('0xc')](_0x1d2efa+':'+_0x462798['id'],_0x462798);ChatInteractionEvents[_0x0468('0xc')](_0x1d2efa,_0x462798);_0x2c38df(null);})['catch'](_0x2c38df(null));};}for(var e in events){if(events[_0x0468('0xd')](e)){var event=events[e];ChatInteraction[_0x0468('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 41ea64a..1c6f0bd 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 _0xc400=['api','moment','bluebird','path','rimraf','./chatInteraction.attributes','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util'];(function(_0x82cdae,_0x2f1e49){var _0x2eb8b2=function(_0x36c931){while(--_0x36c931){_0x82cdae['push'](_0x82cdae['shift']());}};_0x2eb8b2(++_0x2f1e49);}(_0xc400,0x197));var _0x0c40=function(_0x19c889,_0x3eacc2){_0x19c889=_0x19c889-0x0;var _0x1ff28c=_0xc400[_0x19c889];return _0x1ff28c;};'use strict';var _=require('lodash');var util=require(_0x0c40('0x0'));var logger=require('../../config/logger')(_0x0c40('0x1'));var moment=require(_0x0c40('0x2'));var BPromise=require(_0x0c40('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c40('0x4'));var rimraf=require(_0x0c40('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c40('0x6'));module['exports']=function(_0x3788c2,_0x41492){return _0x3788c2['define']('ChatInteraction',attributes,{'tableName':_0x0c40('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x277c40,_0x2b2655,_0x351f49){if(_0x277c40['changed'](_0x0c40('0x8'))){_0x277c40['closedAt']=moment()[_0x0c40('0x9')](_0x0c40('0xa'));}_0x351f49(null,_0x277c40);}},'charset':_0x0c40('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x49e9=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1c1bd5,_0x2f079c){var _0x3eb95b=function(_0x3b0ee2){while(--_0x3b0ee2){_0x1c1bd5['push'](_0x1c1bd5['shift']());}};_0x3eb95b(++_0x2f079c);}(_0x49e9,0x1b3));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var logger=require(_0x949e('0x2'))(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var rp=require(_0x949e('0x5'));var fs=require('fs');var path=require(_0x949e('0x6'));var rimraf=require(_0x949e('0x7'));var config=require(_0x949e('0x8'));var attributes=require(_0x949e('0x9'));module[_0x949e('0xa')]=function(_0x290d42,_0x53e85f){return _0x290d42[_0x949e('0xb')]('ChatInteraction',attributes,{'tableName':_0x949e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b53f9,_0x3d69ba,_0x4fb042){if(_0x2b53f9[_0x949e('0xd')](_0x949e('0xe'))){_0x2b53f9[_0x949e('0xf')]=moment()[_0x949e('0x10')](_0x949e('0x11'));}_0x4fb042(null,_0x2b53f9);}},'charset':_0x949e('0x12'),'collate':_0x949e('0x13')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 315ad60..53e1e67 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 _0xbcac=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update','body','raw','options','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','where','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x505099,_0xb10ee1){var _0x577eba=function(_0x4b36b1){while(--_0x4b36b1){_0x505099['push'](_0x505099['shift']());}};_0x577eba(++_0xb10ee1);}(_0xbcac,0x75));var _0xcbca=function(_0x459a0b,_0x3cb7fe){_0x459a0b=_0x459a0b-0x0;var _0x8baee5=_0xbcac[_0x459a0b];return _0x8baee5;};'use strict';var _=require(_0xcbca('0x0'));var util=require(_0xcbca('0x1'));var moment=require(_0xcbca('0x2'));var BPromise=require(_0xcbca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbca('0x4'));var db=require(_0xcbca('0x5'))['db'];var utils=require(_0xcbca('0x6'));var logger=require(_0xcbca('0x7'))(_0xcbca('0x8'));var config=require(_0xcbca('0x9'));var jayson=require(_0xcbca('0xa'));var client=jayson[_0xcbca('0xb')]['http']({'port':0x232a});config[_0xcbca('0xc')]=_[_0xcbca('0xd')](config['redis'],{'host':_0xcbca('0xe'),'port':0x18eb});var socket=require(_0xcbca('0xf'))(new Redis(config[_0xcbca('0xc')]));require('./chatInteraction.socket')[_0xcbca('0x10')](socket);function respondWithRpcPromise(_0x4714f1,_0x4ab38d,_0x4fe297){return new BPromise(function(_0xf55a03,_0x141fd4){return client[_0xcbca('0x11')](_0x4714f1,_0x4fe297)['then'](function(_0x4a5870){logger[_0xcbca('0x12')](_0xcbca('0x13'),_0x4ab38d,_0xcbca('0x14'));logger[_0xcbca('0x15')](_0xcbca('0x16'),_0x4ab38d,_0xcbca('0x14'),JSON[_0xcbca('0x17')](_0x4a5870));if(_0x4a5870[_0xcbca('0x18')]){if(_0x4a5870[_0xcbca('0x18')][_0xcbca('0x19')]===0x1f4){logger['error'](_0xcbca('0x13'),_0x4ab38d,_0x4a5870[_0xcbca('0x18')][_0xcbca('0x1a')]);return _0x141fd4(_0x4a5870[_0xcbca('0x18')][_0xcbca('0x1a')]);}logger[_0xcbca('0x18')](_0xcbca('0x13'),_0x4ab38d,_0x4a5870[_0xcbca('0x18')][_0xcbca('0x1a')]);return _0xf55a03(_0x4a5870[_0xcbca('0x18')][_0xcbca('0x1a')]);}else{logger[_0xcbca('0x12')](_0xcbca('0x13'),_0x4ab38d,_0xcbca('0x14'));_0xf55a03(_0x4a5870[_0xcbca('0x1b')][_0xcbca('0x1a')]);}})[_0xcbca('0x1c')](function(_0x512c52){logger[_0xcbca('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4ab38d,_0x512c52);_0x141fd4(_0x512c52);});});}exports['UpdateChatInteraction']=function(_0xd57f8d){var _0x4b270b=this;return new Promise(function(_0x2538ba,_0x40ab19){return db[_0xcbca('0x1d')][_0xcbca('0x1e')](_0xd57f8d[_0xcbca('0x1f')],{'raw':_0xd57f8d['options']?_0xd57f8d['options'][_0xcbca('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd57f8d[_0xcbca('0x21')]?_0xd57f8d[_0xcbca('0x21')]['where']||null:null,'attributes':_0xd57f8d[_0xcbca('0x21')]?_0xd57f8d[_0xcbca('0x21')][_0xcbca('0x22')]||null:null,'limit':_0xd57f8d[_0xcbca('0x21')]?_0xd57f8d[_0xcbca('0x21')][_0xcbca('0x23')]||null:null})['then'](function(_0x1a2f6c){logger[_0xcbca('0x12')](_0xcbca('0x24'),_0xd57f8d);logger[_0xcbca('0x15')](_0xcbca('0x24'),_0xd57f8d,JSON[_0xcbca('0x17')](_0x1a2f6c));_0x2538ba(_0x1a2f6c);})[_0xcbca('0x1c')](function(_0x281209){logger['error']('UpdateChatInteraction',_0x281209['message'],_0xd57f8d);_0x40ab19(_0x4b270b[_0xcbca('0x18')](0x1f4,_0x281209[_0xcbca('0x1a')]));});});};exports[_0xcbca('0x25')]=function(_0x39d142){return new Promise(function(_0x296fc,_0x26a304){return db[_0xcbca('0x1d')][_0xcbca('0x26')]({'where':_0x39d142['options']?_0x39d142[_0xcbca('0x21')][_0xcbca('0x27')]||null:null})[_0xcbca('0x28')](function(_0x293412){if(_0x293412){return _0x293412[_0xcbca('0x29')](_0x39d142[_0xcbca('0x1f')][_0xcbca('0x2a')],_[_0xcbca('0x2b')](_0x39d142[_0xcbca('0x1f')],['ids','id'])||{});}})[_0xcbca('0x2c')](function(_0x6b2caa){logger[_0xcbca('0x12')](_0xcbca('0x2d'),_0x39d142);logger[_0xcbca('0x15')](_0xcbca('0x2d'),_0x39d142,JSON[_0xcbca('0x17')](_0x6b2caa));_0x296fc(_0x6b2caa);})[_0xcbca('0x1c')](function(_0x461ced){logger[_0xcbca('0x18')]('AddTags',_0x461ced[_0xcbca('0x1a')],_0x39d142);_0x26a304(_this[_0xcbca('0x18')](0x1f4,_0x461ced[_0xcbca('0x1a')]));});});}; \ No newline at end of file +var _0xa774=['then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','catch','AddTagsToChatInteraction','ChatInteraction','find','ids','omit','AddTags','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x140e3c,_0x20fe71){var _0x13d287=function(_0x191fc6){while(--_0x191fc6){_0x140e3c['push'](_0x140e3c['shift']());}};_0x13d287(++_0x20fe71);}(_0xa774,0xeb));var _0x4a77=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xa774[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x4a77('0x0'));var util=require('util');var moment=require(_0x4a77('0x1'));var BPromise=require(_0x4a77('0x2'));var rs=require(_0x4a77('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a77('0x4'))['db'];var utils=require(_0x4a77('0x5'));var logger=require(_0x4a77('0x6'))(_0x4a77('0x7'));var config=require('../../config/environment');var jayson=require(_0x4a77('0x8'));var client=jayson[_0x4a77('0x9')][_0x4a77('0xa')]({'port':0x232a});config[_0x4a77('0xb')]=_[_0x4a77('0xc')](config[_0x4a77('0xb')],{'host':_0x4a77('0xd'),'port':0x18eb});var socket=require(_0x4a77('0xe'))(new Redis(config['redis']));require(_0x4a77('0xf'))[_0x4a77('0x10')](socket);function respondWithRpcPromise(_0x3b5e6c,_0x3d8079,_0xcf7b06){return new BPromise(function(_0x12802a,_0x29623f){return client['request'](_0x3b5e6c,_0xcf7b06)[_0x4a77('0x11')](function(_0x40f826){logger[_0x4a77('0x12')](_0x4a77('0x13'),_0x3d8079,'request\x20sent');logger[_0x4a77('0x14')](_0x4a77('0x15'),_0x3d8079,'request\x20sent',JSON['stringify'](_0x40f826));if(_0x40f826[_0x4a77('0x16')]){if(_0x40f826['error'][_0x4a77('0x17')]===0x1f4){logger[_0x4a77('0x16')](_0x4a77('0x13'),_0x3d8079,_0x40f826[_0x4a77('0x16')][_0x4a77('0x18')]);return _0x29623f(_0x40f826[_0x4a77('0x16')][_0x4a77('0x18')]);}logger[_0x4a77('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3d8079,_0x40f826['error'][_0x4a77('0x18')]);return _0x12802a(_0x40f826[_0x4a77('0x16')][_0x4a77('0x18')]);}else{logger[_0x4a77('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x3d8079,_0x4a77('0x19'));_0x12802a(_0x40f826['result'][_0x4a77('0x18')]);}})['catch'](function(_0x21cc5e){logger['error'](_0x4a77('0x13'),_0x3d8079,_0x21cc5e);_0x29623f(_0x21cc5e);});});}exports[_0x4a77('0x1a')]=function(_0x4b44bd){var _0x537266=this;return new Promise(function(_0x219872,_0x1d9ea5){return db['ChatInteraction'][_0x4a77('0x1b')](_0x4b44bd[_0x4a77('0x1c')],{'raw':_0x4b44bd['options']?_0x4b44bd['options'][_0x4a77('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b44bd[_0x4a77('0x1e')]?_0x4b44bd[_0x4a77('0x1e')][_0x4a77('0x1f')]||null:null,'attributes':_0x4b44bd[_0x4a77('0x1e')]?_0x4b44bd[_0x4a77('0x1e')][_0x4a77('0x20')]||null:null,'limit':_0x4b44bd[_0x4a77('0x1e')]?_0x4b44bd[_0x4a77('0x1e')][_0x4a77('0x21')]||null:null})[_0x4a77('0x11')](function(_0x1225a4){logger[_0x4a77('0x12')](_0x4a77('0x1a'),_0x4b44bd);logger[_0x4a77('0x14')](_0x4a77('0x1a'),_0x4b44bd,JSON['stringify'](_0x1225a4));_0x219872(_0x1225a4);})[_0x4a77('0x22')](function(_0x58e8e6){logger[_0x4a77('0x16')](_0x4a77('0x1a'),_0x58e8e6[_0x4a77('0x18')],_0x4b44bd);_0x1d9ea5(_0x537266['error'](0x1f4,_0x58e8e6[_0x4a77('0x18')]));});});};exports[_0x4a77('0x23')]=function(_0x3b0c50){return new Promise(function(_0x3029dd,_0x1843b0){return db[_0x4a77('0x24')][_0x4a77('0x25')]({'where':_0x3b0c50[_0x4a77('0x1e')]?_0x3b0c50[_0x4a77('0x1e')][_0x4a77('0x1f')]||null:null})[_0x4a77('0x11')](function(_0x5d4d96){if(_0x5d4d96){return _0x5d4d96['addTags'](_0x3b0c50[_0x4a77('0x1c')][_0x4a77('0x26')],_[_0x4a77('0x27')](_0x3b0c50[_0x4a77('0x1c')],[_0x4a77('0x26'),'id'])||{});}})['spread'](function(_0x1b58a9){logger[_0x4a77('0x12')](_0x4a77('0x28'),_0x3b0c50);logger[_0x4a77('0x14')](_0x4a77('0x28'),_0x3b0c50,JSON[_0x4a77('0x29')](_0x1b58a9));_0x3029dd(_0x1b58a9);})['catch'](function(_0x3f4f68){logger['error'](_0x4a77('0x28'),_0x3f4f68[_0x4a77('0x18')],_0x3b0c50);_0x1843b0(_this['error'](0x1f4,_0x3f4f68[_0x4a77('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index defb8d2..0f47ceb 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 _0x5daf=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x133fbc,_0x57016e){var _0x321783=function(_0x344152){while(--_0x344152){_0x133fbc['push'](_0x133fbc['shift']());}};_0x321783(++_0x57016e);}(_0x5daf,0x19a));var _0xf5da=function(_0x55b486,_0x273b01){_0x55b486=_0x55b486-0x0;var _0x3cfa54=_0x5daf[_0x55b486];return _0x3cfa54;};'use strict';var ChatInteractionEvents=require(_0xf5da('0x0'));var events=[_0xf5da('0x1'),'remove',_0xf5da('0x2')];function createListener(_0x3d888e,_0xe6dd28){return function(_0x5e818e){_0xe6dd28['emit'](_0x3d888e,_0x5e818e);};}function removeListener(_0x8218db,_0x435a42){return function(){ChatInteractionEvents[_0xf5da('0x3')](_0x8218db,_0x435a42);};}exports[_0xf5da('0x4')]=function(_0x279449){for(var _0x4c1d95=0x0,_0xc9c1c4=events[_0xf5da('0x5')];_0x4c1d95<_0xc9c1c4;_0x4c1d95++){var _0x2238dc=events[_0x4c1d95];var _0x5520c5=createListener(_0xf5da('0x6')+_0x2238dc,_0x279449);ChatInteractionEvents['on'](_0x2238dc,_0x5520c5);}}; \ No newline at end of file +var _0x8498=['register','chatInteraction:','./chatInteraction.events','remove','removeListener'];(function(_0x29026f,_0xe1eb38){var _0x3cab7a=function(_0x325644){while(--_0x325644){_0x29026f['push'](_0x29026f['shift']());}};_0x3cab7a(++_0xe1eb38);}(_0x8498,0x70));var _0x8849=function(_0x25ea85,_0x5cbaa6){_0x25ea85=_0x25ea85-0x0;var _0x598596=_0x8498[_0x25ea85];return _0x598596;};'use strict';var ChatInteractionEvents=require(_0x8849('0x0'));var events=['save',_0x8849('0x1'),'update'];function createListener(_0x14db60,_0x41a5d2){return function(_0x4954e0){_0x41a5d2['emit'](_0x14db60,_0x4954e0);};}function removeListener(_0x32538c,_0x2556bf){return function(){ChatInteractionEvents[_0x8849('0x2')](_0x32538c,_0x2556bf);};}exports[_0x8849('0x3')]=function(_0x2dacd7){for(var _0x501a6b=0x0,_0x2e3ba5=events['length'];_0x501a6b<_0x2e3ba5;_0x501a6b++){var _0x59a0c4=events[_0x501a6b];var _0x5a5ab9=createListener(_0x8849('0x4')+_0x59a0c4,_0x2dacd7);ChatInteractionEvents['on'](_0x59a0c4,_0x5a5ab9);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 417a35c..c8d6e0f 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 _0x3a92=['/describe','isAuthenticated','describe','/:id','show','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','/:id/tags','tracked','addTags','put','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index'];(function(_0x2166a3,_0x237c50){var _0x260035=function(_0x2dbfa2){while(--_0x2dbfa2){_0x2166a3['push'](_0x2166a3['shift']());}};_0x260035(++_0x237c50);}(_0x3a92,0xac));var _0x23a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a92[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x23a9('0x0'));var express=require('express');var router=express[_0x23a9('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x23a9('0x2'));var interaction=require(_0x23a9('0x3'));var config=require(_0x23a9('0x4'));var controller=require(_0x23a9('0x5'));router[_0x23a9('0x6')]('/',auth['isAuthenticated'](),controller[_0x23a9('0x7')]);router[_0x23a9('0x6')](_0x23a9('0x8'),auth[_0x23a9('0x9')](),controller[_0x23a9('0xa')]);router[_0x23a9('0x6')](_0x23a9('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x23a9('0xc')]);router[_0x23a9('0x6')]('/:id/attachment_download',auth[_0x23a9('0xd')](),controller[_0x23a9('0xe')]);router[_0x23a9('0x6')]('/:id/messages',auth[_0x23a9('0x9')](),controller[_0x23a9('0xf')]);router['get'](_0x23a9('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x23a9('0x9')](),controller['download']);router[_0x23a9('0x11')]('/',auth[_0x23a9('0x9')](),controller[_0x23a9('0x12')]);router['post'](_0x23a9('0x13'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x23a9('0x14')]({'destination':function(_0x1f0bae,_0x469e9c,_0x52addb){_0x52addb(null,path['join'](config[_0x23a9('0x15')],_0x23a9('0x16')));},'filename':function(_0x3b2314,_0x3cc365,_0x426a2b){_0x426a2b(null,util[_0x23a9('0x17')](_0x23a9('0x18'),Date['now'](),_0x3cc365['originalname'][_0x23a9('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x23a9('0x11')](_0x23a9('0x1a'),upload[_0x23a9('0x1b')](_0x23a9('0x1c')),controller[_0x23a9('0x1d')]);router['post'](_0x23a9('0x1e'),auth[_0x23a9('0xd')](),controller['addMessage']);router[_0x23a9('0x11')](_0x23a9('0x1f'),auth[_0x23a9('0x9')](),interaction[_0x23a9('0x20')]('chat','chatinteraction:addtags'),controller[_0x23a9('0x21')]);router[_0x23a9('0x22')]('/:id',auth[_0x23a9('0x9')](),interaction[_0x23a9('0x20')](_0x23a9('0x23'),_0x23a9('0x24')),controller['update']);router[_0x23a9('0x22')](_0x23a9('0x25'),controller[_0x23a9('0x26')]);router[_0x23a9('0x22')](_0x23a9('0x27'),auth[_0x23a9('0xd')](),controller[_0x23a9('0x28')]);router['put'](_0x23a9('0x29'),controller[_0x23a9('0x2a')]);router['delete'](_0x23a9('0xb'),auth['isAuthenticated'](),interaction[_0x23a9('0x20')](_0x23a9('0x23'),_0x23a9('0x2b')),controller['destroy']);router[_0x23a9('0x2c')](_0x23a9('0x1f'),auth[_0x23a9('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x70e8=['chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','chat'];(function(_0x4463f4,_0x2b38f2){var _0x29a8a2=function(_0x5c6c98){while(--_0x5c6c98){_0x4463f4['push'](_0x4463f4['shift']());}};_0x29a8a2(++_0x2b38f2);}(_0x70e8,0x1f0));var _0x870e=function(_0x5f047a,_0x1c61fb){_0x5f047a=_0x5f047a-0x0;var _0x2d2b7e=_0x70e8[_0x5f047a];return _0x2d2b7e;};'use strict';var multer=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var path=require(_0x870e('0x2'));var timeout=require(_0x870e('0x3'));var express=require('express');var router=express[_0x870e('0x4')]();var fs_extra=require(_0x870e('0x5'));var auth=require(_0x870e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x870e('0x7'));var controller=require(_0x870e('0x8'));router[_0x870e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x870e('0x9')](_0x870e('0xa'),auth[_0x870e('0xb')](),controller[_0x870e('0xc')]);router[_0x870e('0x9')](_0x870e('0xd'),auth[_0x870e('0xe')](),controller[_0x870e('0xf')]);router[_0x870e('0x9')](_0x870e('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0x870e('0x11'),auth[_0x870e('0xb')](),controller[_0x870e('0x12')]);router[_0x870e('0x9')](_0x870e('0x13'),auth[_0x870e('0xe')](),controller['getMyMessages']);router[_0x870e('0x9')](_0x870e('0x14'),auth[_0x870e('0xb')](),controller[_0x870e('0x15')]);router['post']('/',auth[_0x870e('0xb')](),controller[_0x870e('0x16')]);router['post'](_0x870e('0x17'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x870e('0x18')]({'destination':function(_0x593652,_0x1c096a,_0x56a55a){_0x56a55a(null,path[_0x870e('0x19')](config[_0x870e('0x1a')],_0x870e('0x1b')));},'filename':function(_0x4afd76,_0x5bbf41,_0x30d581){_0x30d581(null,util[_0x870e('0x1c')](_0x870e('0x1d'),Date[_0x870e('0x1e')](),_0x5bbf41[_0x870e('0x1f')][_0x870e('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x870e('0x21')](_0x870e('0x22'),upload[_0x870e('0x23')](_0x870e('0x24')),controller[_0x870e('0x25')]);router['post'](_0x870e('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x870e('0x26')]);router['post'](_0x870e('0x27'),auth[_0x870e('0xb')](),interaction[_0x870e('0x28')]('chat',_0x870e('0x29')),controller['addTags']);router[_0x870e('0x2a')](_0x870e('0xd'),auth[_0x870e('0xb')](),interaction['tracked'](_0x870e('0x2b'),_0x870e('0x2c')),controller[_0x870e('0x2d')]);router[_0x870e('0x2a')](_0x870e('0x2e'),controller[_0x870e('0x2f')]);router[_0x870e('0x2a')]('/:id/abandon',auth[_0x870e('0xe')](),controller['abandon']);router[_0x870e('0x2a')](_0x870e('0x30'),controller[_0x870e('0x31')]);router['delete'](_0x870e('0xd'),auth[_0x870e('0xb')](),interaction[_0x870e('0x28')](_0x870e('0x2b'),_0x870e('0x32')),controller[_0x870e('0x33')]);router['delete'](_0x870e('0x27'),auth[_0x870e('0xb')](),controller[_0x870e('0x34')]);module[_0x870e('0x35')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ef78738..3c080e9 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 _0x86fb=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x5342ea,_0x2b3389){var _0xa7d610=function(_0x345a32){while(--_0x345a32){_0x5342ea['push'](_0x5342ea['shift']());}};_0xa7d610(++_0x2b3389);}(_0x86fb,0xae));var _0xb86f=function(_0x227c2b,_0x311a03){_0x227c2b=_0x227c2b-0x0;var _0x57c2d5=_0x86fb[_0x227c2b];return _0x57c2d5;};'use strict';var Sequelize=require(_0xb86f('0x0'));module[_0xb86f('0x1')]={'body':{'type':Sequelize[_0xb86f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb86f('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb86f('0x4')]}}; \ No newline at end of file +var _0x8924=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x210316,_0x8169eb){var _0x6aaf33=function(_0x5eea61){while(--_0x5eea61){_0x210316['push'](_0x210316['shift']());}};_0x6aaf33(++_0x8169eb);}(_0x8924,0x66));var _0x4892=function(_0x345a17,_0x3b9d2a){_0x345a17=_0x345a17-0x0;var _0xd0f947=_0x8924[_0x345a17];return _0xd0f947;};'use strict';var Sequelize=require(_0x4892('0x0'));module[_0x4892('0x1')]={'body':{'type':Sequelize[_0x4892('0x2')](_0x4892('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4892('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 94c6974..5228cbd 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 _0x5952=['VoiceQueue','VoiceQueues','get','UserProfileSection','find','Agents','userProfileId','autoAssociation','isEmpty','role','resourceId','push','messages','FromId','read','rimraf','bluebird','util','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','update','body','describe','lastMessageAt','createdAt','lastMessage','getUsers','User','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online'];(function(_0x4a5f7d,_0x310d5e){var _0x5d3052=function(_0x57c9cf){while(--_0x57c9cf){_0x4a5f7d['push'](_0x4a5f7d['shift']());}};_0x5d3052(++_0x310d5e);}(_0x5952,0x77));var _0x2595=function(_0x8320c7,_0x54af56){_0x8320c7=_0x8320c7-0x0;var _0x5f449d=_0x5952[_0x8320c7];return _0x5f449d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2595('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2595('0x1'));var Mustache=require('mustache');var util=require(_0x2595('0x2'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2595('0x3'));var squel=require(_0x2595('0x4'));var crypto=require('crypto');var jsforce=require(_0x2595('0x5'));var deskjs=require(_0x2595('0x6'));var toCsv=require(_0x2595('0x7'));var querystring=require('querystring');var Papa=require(_0x2595('0x8'));var Redis=require('ioredis');var authService=require(_0x2595('0x9'));var qs=require(_0x2595('0xa'));var as=require(_0x2595('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2595('0xc'))(_0x2595('0xd'));var utils=require(_0x2595('0xe'));var config=require(_0x2595('0xf'));var licenseUtil=require(_0x2595('0x10'));var db=require(_0x2595('0x11'))['db'];config[_0x2595('0x12')]=_[_0x2595('0x13')](config[_0x2595('0x12')],{'host':_0x2595('0x14'),'port':0x18eb});var socket=require(_0x2595('0x15'))(new Redis(config[_0x2595('0x12')]));require('./chatInternalMessage.socket')[_0x2595('0x16')](socket);function respondWithStatusCode(_0x121459,_0x4061d6){_0x4061d6=_0x4061d6||0xcc;return function(_0x3e0b8c){if(_0x3e0b8c){return _0x121459[_0x2595('0x17')](_0x4061d6);}return _0x121459[_0x2595('0x18')](_0x4061d6)[_0x2595('0x19')]();};}function respondWithResult(_0x44664d,_0x110074){_0x110074=_0x110074||0xc8;return function(_0x23ab9d){if(_0x23ab9d){return _0x44664d[_0x2595('0x18')](_0x110074)['json'](_0x23ab9d);}};}function respondWithFilteredResult(_0x4b9086,_0x593a64){return function(_0x67e94f){if(_0x67e94f){var _0x1f418b=typeof _0x593a64[_0x2595('0x1a')]==='undefined'&&typeof _0x593a64[_0x2595('0x1b')]===_0x2595('0x1c');var _0x4fe984=_0x67e94f[_0x2595('0x1d')];var _0x15f6d5=_0x1f418b?0x0:_0x593a64[_0x2595('0x1a')];var _0x16ccad=_0x1f418b?_0x67e94f[_0x2595('0x1d')]:_0x593a64['offset']+_0x593a64[_0x2595('0x1b')];var _0x2a76ba;if(_0x16ccad>=_0x4fe984){_0x16ccad=_0x4fe984;_0x2a76ba=0xc8;}else{_0x2a76ba=0xce;}_0x4b9086[_0x2595('0x18')](_0x2a76ba);return _0x4b9086['set'](_0x2595('0x1e'),_0x15f6d5+'-'+_0x16ccad+'/'+_0x4fe984)[_0x2595('0x1f')](_0x67e94f);}return null;};}function patchUpdates(_0x274b9b){return function(_0x315500){try{jsonpatch[_0x2595('0x20')](_0x315500,_0x274b9b,!![]);}catch(_0x24b275){return BPromise[_0x2595('0x21')](_0x24b275);}return _0x315500[_0x2595('0x22')]();};}function saveUpdates(_0x171c96,_0x593908){return function(_0x325ca6){if(_0x325ca6){return _0x325ca6['update'](_0x171c96)[_0x2595('0x23')](function(_0x5535a7){return _0x5535a7;});}return null;};}function removeEntity(_0x2ea59f,_0x363a9c){return function(_0x5b60ac){if(_0x5b60ac){return _0x5b60ac[_0x2595('0x24')]()[_0x2595('0x23')](function(){_0x2ea59f['status'](0xcc)[_0x2595('0x19')]();});}};}function handleEntityNotFound(_0x4470fc,_0x3efa1d){return function(_0x188704){if(!_0x188704){_0x4470fc[_0x2595('0x17')](0x194);}return _0x188704;};}function handleError(_0x193a43,_0x5ee524){_0x5ee524=_0x5ee524||0x1f4;return function(_0x1eb1c2){logger[_0x2595('0x25')](_0x1eb1c2[_0x2595('0x26')]);if(_0x1eb1c2['name']){delete _0x1eb1c2[_0x2595('0x27')];}_0x193a43[_0x2595('0x18')](_0x5ee524)['send'](_0x1eb1c2);};}exports['index']=function(_0x130a03,_0x52207c){var _0x51248f={},_0x570274={},_0x3a251b={'count':0x0,'rows':[]};var _0x48d549=_[_0x2595('0x28')](db[_0x2595('0x29')][_0x2595('0x2a')],function(_0x374c64){return{'name':_0x374c64['fieldName'],'type':_0x374c64[_0x2595('0x2b')][_0x2595('0x2c')]};});_0x570274[_0x2595('0x2d')]=_['map'](_0x48d549,_0x2595('0x27'));_0x570274[_0x2595('0x2e')]=_[_0x2595('0x2f')](_0x130a03[_0x2595('0x2e')]);_0x570274[_0x2595('0x30')]=_[_0x2595('0x31')](_0x570274[_0x2595('0x2d')],_0x570274[_0x2595('0x2e')]);_0x51248f[_0x2595('0x32')]=_[_0x2595('0x31')](_0x570274['model'],qs[_0x2595('0x33')](_0x130a03[_0x2595('0x2e')][_0x2595('0x33')]));_0x51248f[_0x2595('0x32')]=_0x51248f[_0x2595('0x32')][_0x2595('0x34')]?_0x51248f[_0x2595('0x32')]:_0x570274[_0x2595('0x2d')];if(!_0x130a03[_0x2595('0x2e')][_0x2595('0x35')](_0x2595('0x36'))){_0x51248f[_0x2595('0x1b')]=qs[_0x2595('0x1b')](_0x130a03[_0x2595('0x2e')]['limit']);_0x51248f[_0x2595('0x1a')]=qs[_0x2595('0x1a')](_0x130a03[_0x2595('0x2e')][_0x2595('0x1a')]);}_0x51248f[_0x2595('0x37')]=qs[_0x2595('0x38')](_0x130a03[_0x2595('0x2e')]['sort']);_0x51248f[_0x2595('0x39')]=qs[_0x2595('0x30')](_[_0x2595('0x3a')](_0x130a03['query'],_0x570274[_0x2595('0x30')]),_0x48d549);if(_0x130a03[_0x2595('0x2e')][_0x2595('0x3b')]){_0x51248f['where']=_[_0x2595('0x3c')](_0x51248f[_0x2595('0x39')],{'$or':_[_0x2595('0x28')](_0x48d549,function(_0x40cb8d){if(_0x40cb8d[_0x2595('0x2b')]!==_0x2595('0x3d')){var _0x1f5e56={};_0x1f5e56[_0x40cb8d[_0x2595('0x27')]]={'$like':'%'+_0x130a03['query']['filter']+'%'};return _0x1f5e56;}})});}_0x51248f=_[_0x2595('0x3c')]({},_0x51248f,_0x130a03[_0x2595('0x3e')]);var _0x578269={'where':_0x51248f['where']};return db[_0x2595('0x29')][_0x2595('0x1d')](_0x578269)[_0x2595('0x23')](function(_0x544fe4){_0x3a251b[_0x2595('0x1d')]=_0x544fe4;if(_0x130a03[_0x2595('0x2e')][_0x2595('0x3f')]){_0x51248f[_0x2595('0x40')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2595('0x41')](_0x51248f);})[_0x2595('0x23')](function(_0x587e2e){_0x3a251b[_0x2595('0x42')]=_0x587e2e;return _0x3a251b;})[_0x2595('0x23')](respondWithFilteredResult(_0x52207c,_0x51248f))[_0x2595('0x43')](handleError(_0x52207c,null));};exports[_0x2595('0x44')]=function(_0x4800a5,_0x485241){var _0x4b9205={'raw':!![],'where':{'id':_0x4800a5[_0x2595('0x45')]['id']}},_0x32537b={};_0x32537b['model']=_[_0x2595('0x2f')](db[_0x2595('0x29')][_0x2595('0x2a')]);_0x32537b[_0x2595('0x2e')]=_[_0x2595('0x2f')](_0x4800a5[_0x2595('0x2e')]);_0x32537b[_0x2595('0x30')]=_[_0x2595('0x31')](_0x32537b[_0x2595('0x2d')],_0x32537b[_0x2595('0x2e')]);_0x4b9205[_0x2595('0x32')]=_[_0x2595('0x31')](_0x32537b[_0x2595('0x2d')],qs[_0x2595('0x33')](_0x4800a5[_0x2595('0x2e')][_0x2595('0x33')]));_0x4b9205[_0x2595('0x32')]=_0x4b9205['attributes']['length']?_0x4b9205[_0x2595('0x32')]:_0x32537b[_0x2595('0x2d')];if(_0x4800a5['query'][_0x2595('0x3f')]){_0x4b9205['include']=[{'all':!![]}];}_0x4b9205=_[_0x2595('0x3c')]({},_0x4b9205,_0x4800a5[_0x2595('0x3e')]);return db[_0x2595('0x29')]['find'](_0x4b9205)['then'](handleEntityNotFound(_0x485241,null))[_0x2595('0x23')](respondWithResult(_0x485241,null))[_0x2595('0x43')](handleError(_0x485241,null));};exports[_0x2595('0x46')]=function(_0x3c7ad2,_0x2b6f50){return db[_0x2595('0x29')]['create'](_0x3c7ad2['body'],{})[_0x2595('0x23')](respondWithResult(_0x2b6f50,0xc9))[_0x2595('0x43')](handleError(_0x2b6f50,null));};exports[_0x2595('0x47')]=function(_0x3684f6,_0x44487b){if(_0x3684f6[_0x2595('0x48')]['id']){delete _0x3684f6[_0x2595('0x48')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x3684f6[_0x2595('0x45')]['id']}})[_0x2595('0x23')](handleEntityNotFound(_0x44487b,null))['then'](saveUpdates(_0x3684f6[_0x2595('0x48')],null))[_0x2595('0x23')](respondWithResult(_0x44487b,null))[_0x2595('0x43')](handleError(_0x44487b,null));};exports[_0x2595('0x24')]=function(_0x5cdbfa,_0x37531b){return db[_0x2595('0x29')]['find']({'where':{'id':_0x5cdbfa[_0x2595('0x45')]['id']}})[_0x2595('0x23')](handleEntityNotFound(_0x37531b,null))['then'](removeEntity(_0x37531b,null))[_0x2595('0x43')](handleError(_0x37531b,null));};exports[_0x2595('0x49')]=function(_0x25f120,_0x2dd90c){return db[_0x2595('0x29')]['describe']()[_0x2595('0x23')](respondWithResult(_0x2dd90c,null))[_0x2595('0x43')](handleError(_0x2dd90c,null));};function wrapUser(_0x20e67e){return function(_0x5a143a){var _0x4fe274=_0x20e67e['get']({'plain':!![]});_0x4fe274['messages']=[];if(_0x5a143a){_0x4fe274[_0x2595('0x4a')]=_0x5a143a[_0x2595('0x4b')];_0x4fe274[_0x2595('0x4c')]=_0x5a143a;}else{_0x4fe274[_0x2595('0x4a')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4fe274['lastMessage']={};}return _0x4fe274;};}exports[_0x2595('0x4d')]=function(_0x1a0193,_0x5413d5,_0x3ff556){var _0x2984cd=[];return db[_0x2595('0x4e')]['findAll']({'where':{'role':[_0x2595('0x4f'),_0x2595('0x50'),_0x2595('0x51')]},'attributes':['id',_0x2595('0x52'),_0x2595('0x27'),'role',_0x2595('0x53'),_0x2595('0x54'),_0x2595('0x55'),'lastLoginAt',_0x2595('0x56'),_0x2595('0x57')],'order':qs[_0x2595('0x38')](_0x2595('0x58')),'include':[{'model':db[_0x2595('0x59')],'as':_0x2595('0x5a'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x2595('0x23')](function(_0x39d4dd){if(_0x39d4dd){var _0x49db1b=_0x1a0193[_0x2595('0x51')][_0x2595('0x5b')]({'plain':!![]});if(!_0x49db1b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49db1b['role']===_0x2595('0x51')){return db[_0x2595('0x5c')][_0x2595('0x5d')]({'where':{'name':_0x2595('0x5e'),'userProfileId':_0x49db1b[_0x2595('0x5f')]},'raw':!![]})[_0x2595('0x23')](function(_0x3c9f19){if(_0x3c9f19){if(_0x3c9f19[_0x2595('0x60')]===0x0){return db['UserProfileResource'][_0x2595('0x41')]({'where':{'sectionId':_0x3c9f19['id']},'raw':!![]})[_0x2595('0x23')](function(_0x2db901){var _0x240281=[];if(_[_0x2595('0x61')](_0x2db901)){_0x240281=_[_0x2595('0x3b')](_0x39d4dd,function(_0x3a3f5){if(_0x3a3f5[_0x2595('0x62')]!==_0x2595('0x4f')){return _0x3a3f5;}});return _0x240281;}else{for(var _0x1c9b04=0x0;_0x1c9b04<_0x39d4dd[_0x2595('0x34')];_0x1c9b04++){var _0x5db8c2=_0x39d4dd[_0x1c9b04];if(_0x5db8c2[_0x2595('0x62')]==='agent'){var _0x559f63=_[_0x2595('0x5d')](_0x2db901,function(_0x120cfe){return _0x120cfe[_0x2595('0x63')]===_0x5db8c2['id'];});if(_0x559f63)_0x240281[_0x2595('0x64')](_0x5db8c2);}else{_0x240281['push'](_0x5db8c2);}}return _0x240281;}});}else{return _0x39d4dd;}}else{var _0x3c4f2c=_[_0x2595('0x3b')](_0x39d4dd,function(_0x6135ec){if(_0x6135ec['role']!==_0x2595('0x4f')){return _0x6135ec;}});return _0x3c4f2c;}});}else{return _0x39d4dd;}}})[_0x2595('0x23')](function(_0x46ffb4){var _0x35746f=[];if(_0x46ffb4){_0x2984cd=_0x46ffb4;for(var _0x6fcead=0x0;_0x6fcead<_0x46ffb4[_0x2595('0x34')];_0x6fcead+=0x1){_0x2984cd[_0x6fcead][_0x2595('0x65')]=[];_0x35746f[_0x2595('0x64')](db[_0x2595('0x29')]['find']({'where':{'FromId':[_0x1a0193[_0x2595('0x51')]['id'],_0x46ffb4[_0x6fcead]['id']],'ToId':[_0x1a0193['user']['id'],_0x46ffb4[_0x6fcead]['id']],'ChatGroupId':null},'attributes':['id',_0x2595('0x4b'),_0x2595('0x66'),'ToId',_0x2595('0x67'),'body'],'order':qs[_0x2595('0x38')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x46ffb4[_0x6fcead])));}return BPromise['all'](_0x35746f);}return[];})[_0x2595('0x23')](function(_0x1a018a){return{'rows':_0x1a018a,'count':_0x1a018a[_0x2595('0x34')]};})[_0x2595('0x23')](respondWithResult(_0x5413d5,null))['catch'](handleError(_0x5413d5,null));}; \ No newline at end of file +var _0xd029=['allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','sort','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','pick','filter','where','type','VIRTUAL','name','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt'];(function(_0x21c772,_0x186c52){var _0x279fd1=function(_0x5cf561){while(--_0x5cf561){_0x21c772['push'](_0x21c772['shift']());}};_0x279fd1(++_0x186c52);}(_0xd029,0x173));var _0x9d02=function(_0x4e8c41,_0x200665){_0x4e8c41=_0x4e8c41-0x0;var _0x576e62=_0xd029[_0x4e8c41];return _0x576e62;};'use strict';var emlformat=require(_0x9d02('0x0'));var rimraf=require(_0x9d02('0x1'));var zipdir=require(_0x9d02('0x2'));var jsonpatch=require(_0x9d02('0x3'));var rp=require('request-promise');var moment=require(_0x9d02('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9d02('0x5'));var util=require(_0x9d02('0x6'));var path=require(_0x9d02('0x7'));var sox=require('sox');var csv=require(_0x9d02('0x8'));var ejs=require(_0x9d02('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d02('0xa'));var squel=require('squel');var crypto=require(_0x9d02('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9d02('0xc'));var toCsv=require(_0x9d02('0x8'));var querystring=require(_0x9d02('0xd'));var Papa=require('papaparse');var Redis=require(_0x9d02('0xe'));var authService=require(_0x9d02('0xf'));var qs=require(_0x9d02('0x10'));var as=require(_0x9d02('0x11'));var hardwareService=require(_0x9d02('0x12'));var logger=require(_0x9d02('0x13'))(_0x9d02('0x14'));var utils=require(_0x9d02('0x15'));var config=require(_0x9d02('0x16'));var licenseUtil=require(_0x9d02('0x17'));var db=require(_0x9d02('0x18'))['db'];config[_0x9d02('0x19')]=_[_0x9d02('0x1a')](config[_0x9d02('0x19')],{'host':_0x9d02('0x1b'),'port':0x18eb});var socket=require(_0x9d02('0x1c'))(new Redis(config[_0x9d02('0x19')]));require(_0x9d02('0x1d'))['register'](socket);function respondWithStatusCode(_0x337a30,_0xaa6ec0){_0xaa6ec0=_0xaa6ec0||0xcc;return function(_0x13675b){if(_0x13675b){return _0x337a30['sendStatus'](_0xaa6ec0);}return _0x337a30['status'](_0xaa6ec0)['end']();};}function respondWithResult(_0x5c6c61,_0x610bc1){_0x610bc1=_0x610bc1||0xc8;return function(_0x59b3f4){if(_0x59b3f4){return _0x5c6c61[_0x9d02('0x1e')](_0x610bc1)['json'](_0x59b3f4);}};}function respondWithFilteredResult(_0x16eff5,_0xca7182){return function(_0x378d47){if(_0x378d47){var _0x48b5ca=typeof _0xca7182[_0x9d02('0x1f')]===_0x9d02('0x20')&&typeof _0xca7182[_0x9d02('0x21')]===_0x9d02('0x20');var _0x37ac61=_0x378d47['count'];var _0x31975c=_0x48b5ca?0x0:_0xca7182[_0x9d02('0x1f')];var _0x3c9c45=_0x48b5ca?_0x378d47[_0x9d02('0x22')]:_0xca7182[_0x9d02('0x1f')]+_0xca7182['limit'];var _0x525ce3;if(_0x3c9c45>=_0x37ac61){_0x3c9c45=_0x37ac61;_0x525ce3=0xc8;}else{_0x525ce3=0xce;}_0x16eff5[_0x9d02('0x1e')](_0x525ce3);return _0x16eff5[_0x9d02('0x23')](_0x9d02('0x24'),_0x31975c+'-'+_0x3c9c45+'/'+_0x37ac61)[_0x9d02('0x25')](_0x378d47);}return null;};}function patchUpdates(_0x4724c3){return function(_0x4edd77){try{jsonpatch[_0x9d02('0x26')](_0x4edd77,_0x4724c3,!![]);}catch(_0x40e655){return BPromise[_0x9d02('0x27')](_0x40e655);}return _0x4edd77[_0x9d02('0x28')]();};}function saveUpdates(_0x531e59,_0x5a179e){return function(_0x619695){if(_0x619695){return _0x619695[_0x9d02('0x29')](_0x531e59)['then'](function(_0x42a2c9){return _0x42a2c9;});}return null;};}function removeEntity(_0x4c8bff,_0x1cb03e){return function(_0x5844a4){if(_0x5844a4){return _0x5844a4[_0x9d02('0x2a')]()[_0x9d02('0x2b')](function(){_0x4c8bff[_0x9d02('0x1e')](0xcc)[_0x9d02('0x2c')]();});}};}function handleEntityNotFound(_0x588165,_0x43b100){return function(_0x35b314){if(!_0x35b314){_0x588165['sendStatus'](0x194);}return _0x35b314;};}function handleError(_0x1e886e,_0x58de9a){_0x58de9a=_0x58de9a||0x1f4;return function(_0x2821f6){logger[_0x9d02('0x2d')](_0x2821f6[_0x9d02('0x2e')]);if(_0x2821f6['name']){delete _0x2821f6['name'];}_0x1e886e[_0x9d02('0x1e')](_0x58de9a)[_0x9d02('0x2f')](_0x2821f6);};}exports[_0x9d02('0x30')]=function(_0x523f7b,_0x41cc43){var _0x3fcdd4={},_0x1111c6={},_0x2fc19b={'count':0x0,'rows':[]};var _0x575d93=_[_0x9d02('0x31')](db[_0x9d02('0x32')][_0x9d02('0x33')],function(_0x1e8ab0){return{'name':_0x1e8ab0[_0x9d02('0x34')],'type':_0x1e8ab0['type'][_0x9d02('0x35')]};});_0x1111c6[_0x9d02('0x36')]=_[_0x9d02('0x31')](_0x575d93,'name');_0x1111c6['query']=_[_0x9d02('0x37')](_0x523f7b['query']);_0x1111c6[_0x9d02('0x38')]=_['intersection'](_0x1111c6[_0x9d02('0x36')],_0x1111c6[_0x9d02('0x39')]);_0x3fcdd4['attributes']=_[_0x9d02('0x3a')](_0x1111c6['model'],qs[_0x9d02('0x3b')](_0x523f7b['query'][_0x9d02('0x3b')]));_0x3fcdd4[_0x9d02('0x3c')]=_0x3fcdd4[_0x9d02('0x3c')][_0x9d02('0x3d')]?_0x3fcdd4[_0x9d02('0x3c')]:_0x1111c6[_0x9d02('0x36')];if(!_0x523f7b['query'][_0x9d02('0x3e')](_0x9d02('0x3f'))){_0x3fcdd4[_0x9d02('0x21')]=qs[_0x9d02('0x21')](_0x523f7b['query']['limit']);_0x3fcdd4[_0x9d02('0x1f')]=qs['offset'](_0x523f7b['query'][_0x9d02('0x1f')]);}_0x3fcdd4['order']=qs['sort'](_0x523f7b[_0x9d02('0x39')]['sort']);_0x3fcdd4['where']=qs[_0x9d02('0x38')](_[_0x9d02('0x40')](_0x523f7b[_0x9d02('0x39')],_0x1111c6[_0x9d02('0x38')]),_0x575d93);if(_0x523f7b['query'][_0x9d02('0x41')]){_0x3fcdd4['where']=_['merge'](_0x3fcdd4[_0x9d02('0x42')],{'$or':_[_0x9d02('0x31')](_0x575d93,function(_0x32e8b1){if(_0x32e8b1[_0x9d02('0x43')]!==_0x9d02('0x44')){var _0x17ff50={};_0x17ff50[_0x32e8b1[_0x9d02('0x45')]]={'$like':'%'+_0x523f7b[_0x9d02('0x39')][_0x9d02('0x41')]+'%'};return _0x17ff50;}})});}_0x3fcdd4=_[_0x9d02('0x46')]({},_0x3fcdd4,_0x523f7b['options']);var _0x588817={'where':_0x3fcdd4[_0x9d02('0x42')]};return db[_0x9d02('0x32')][_0x9d02('0x22')](_0x588817)[_0x9d02('0x2b')](function(_0x30b7d6){_0x2fc19b[_0x9d02('0x22')]=_0x30b7d6;if(_0x523f7b['query'][_0x9d02('0x47')]){_0x3fcdd4[_0x9d02('0x48')]=[{'all':!![]}];}return db[_0x9d02('0x32')][_0x9d02('0x49')](_0x3fcdd4);})['then'](function(_0x141d42){_0x2fc19b[_0x9d02('0x4a')]=_0x141d42;return _0x2fc19b;})['then'](respondWithFilteredResult(_0x41cc43,_0x3fcdd4))[_0x9d02('0x4b')](handleError(_0x41cc43,null));};exports[_0x9d02('0x4c')]=function(_0x5b8ea9,_0x311777){var _0x5bca7a={'raw':!![],'where':{'id':_0x5b8ea9[_0x9d02('0x4d')]['id']}},_0xe1829f={};_0xe1829f[_0x9d02('0x36')]=_[_0x9d02('0x37')](db['ChatInternalMessage']['rawAttributes']);_0xe1829f[_0x9d02('0x39')]=_['keys'](_0x5b8ea9['query']);_0xe1829f[_0x9d02('0x38')]=_[_0x9d02('0x3a')](_0xe1829f[_0x9d02('0x36')],_0xe1829f[_0x9d02('0x39')]);_0x5bca7a[_0x9d02('0x3c')]=_[_0x9d02('0x3a')](_0xe1829f[_0x9d02('0x36')],qs[_0x9d02('0x3b')](_0x5b8ea9[_0x9d02('0x39')][_0x9d02('0x3b')]));_0x5bca7a[_0x9d02('0x3c')]=_0x5bca7a['attributes'][_0x9d02('0x3d')]?_0x5bca7a['attributes']:_0xe1829f[_0x9d02('0x36')];if(_0x5b8ea9[_0x9d02('0x39')]['includeAll']){_0x5bca7a['include']=[{'all':!![]}];}_0x5bca7a=_[_0x9d02('0x46')]({},_0x5bca7a,_0x5b8ea9['options']);return db[_0x9d02('0x32')][_0x9d02('0x4e')](_0x5bca7a)[_0x9d02('0x2b')](handleEntityNotFound(_0x311777,null))['then'](respondWithResult(_0x311777,null))[_0x9d02('0x4b')](handleError(_0x311777,null));};exports['create']=function(_0x4fc8a1,_0x48daaf){return db[_0x9d02('0x32')][_0x9d02('0x4f')](_0x4fc8a1[_0x9d02('0x50')],{})['then'](respondWithResult(_0x48daaf,0xc9))['catch'](handleError(_0x48daaf,null));};exports[_0x9d02('0x29')]=function(_0x3050c5,_0xe4bc35){if(_0x3050c5['body']['id']){delete _0x3050c5[_0x9d02('0x50')]['id'];}return db[_0x9d02('0x32')][_0x9d02('0x4e')]({'where':{'id':_0x3050c5[_0x9d02('0x4d')]['id']}})[_0x9d02('0x2b')](handleEntityNotFound(_0xe4bc35,null))['then'](saveUpdates(_0x3050c5[_0x9d02('0x50')],null))[_0x9d02('0x2b')](respondWithResult(_0xe4bc35,null))[_0x9d02('0x4b')](handleError(_0xe4bc35,null));};exports[_0x9d02('0x2a')]=function(_0x5f3156,_0x47e910){return db[_0x9d02('0x32')][_0x9d02('0x4e')]({'where':{'id':_0x5f3156[_0x9d02('0x4d')]['id']}})[_0x9d02('0x2b')](handleEntityNotFound(_0x47e910,null))[_0x9d02('0x2b')](removeEntity(_0x47e910,null))[_0x9d02('0x4b')](handleError(_0x47e910,null));};exports[_0x9d02('0x51')]=function(_0x17e17b,_0x10b77a){return db[_0x9d02('0x32')][_0x9d02('0x51')]()[_0x9d02('0x2b')](respondWithResult(_0x10b77a,null))[_0x9d02('0x4b')](handleError(_0x10b77a,null));};function wrapUser(_0x5bd225){return function(_0x54169a){var _0x5e6a6e=_0x5bd225[_0x9d02('0x52')]({'plain':!![]});_0x5e6a6e[_0x9d02('0x53')]=[];if(_0x54169a){_0x5e6a6e[_0x9d02('0x54')]=_0x54169a[_0x9d02('0x55')];_0x5e6a6e['lastMessage']=_0x54169a;}else{_0x5e6a6e[_0x9d02('0x54')]=moment(0x0)[_0x9d02('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e6a6e[_0x9d02('0x57')]={};}return _0x5e6a6e;};}exports['getUsers']=function(_0x3a7aa9,_0x24bb22,_0x51ef85){var _0x4ca2f9=[];return db[_0x9d02('0x58')][_0x9d02('0x49')]({'where':{'role':['agent',_0x9d02('0x59'),_0x9d02('0x5a')]},'attributes':['id',_0x9d02('0x5b'),'name',_0x9d02('0x5c'),_0x9d02('0x5d'),_0x9d02('0x5e'),_0x9d02('0x5f'),_0x9d02('0x60'),_0x9d02('0x61'),_0x9d02('0x62')],'order':qs['sort'](_0x9d02('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0x9d02('0x64'),'attributes':['id',_0x9d02('0x45'),_0x9d02('0x43')],'through':{'attributes':[]}}]})[_0x9d02('0x2b')](function(_0x315784){if(_0x315784){var _0x4701c8=_0x3a7aa9[_0x9d02('0x5a')][_0x9d02('0x52')]({'plain':!![]});if(!_0x4701c8)throw new Error(_0x9d02('0x65'));if(_0x4701c8[_0x9d02('0x5c')]===_0x9d02('0x5a')){return db[_0x9d02('0x66')][_0x9d02('0x4e')]({'where':{'name':_0x9d02('0x67'),'userProfileId':_0x4701c8[_0x9d02('0x68')]},'raw':!![]})[_0x9d02('0x2b')](function(_0x3ad934){if(_0x3ad934){if(_0x3ad934[_0x9d02('0x69')]===0x0){return db[_0x9d02('0x6a')][_0x9d02('0x49')]({'where':{'sectionId':_0x3ad934['id']},'raw':!![]})[_0x9d02('0x2b')](function(_0x2b8762){var _0x433e97=[];if(_[_0x9d02('0x6b')](_0x2b8762)){_0x433e97=_[_0x9d02('0x41')](_0x315784,function(_0x3dcc10){if(_0x3dcc10[_0x9d02('0x5c')]!==_0x9d02('0x6c')){return _0x3dcc10;}});return _0x433e97;}else{for(var _0x2adce6=0x0;_0x2adce6<_0x315784['length'];_0x2adce6++){var _0xa934b3=_0x315784[_0x2adce6];if(_0xa934b3[_0x9d02('0x5c')]==='agent'){var _0x374a93=_[_0x9d02('0x4e')](_0x2b8762,function(_0x45333e){return _0x45333e[_0x9d02('0x6d')]===_0xa934b3['id'];});if(_0x374a93)_0x433e97[_0x9d02('0x6e')](_0xa934b3);}else{_0x433e97[_0x9d02('0x6e')](_0xa934b3);}}return _0x433e97;}});}else{return _0x315784;}}else{var _0x5e6ae6=_[_0x9d02('0x41')](_0x315784,function(_0x2d5423){if(_0x2d5423['role']!=='agent'){return _0x2d5423;}});return _0x5e6ae6;}});}else{return _0x315784;}}})[_0x9d02('0x2b')](function(_0x1fb6f6){var _0x4013b4=[];if(_0x1fb6f6){_0x4ca2f9=_0x1fb6f6;for(var _0x326647=0x0;_0x326647<_0x1fb6f6[_0x9d02('0x3d')];_0x326647+=0x1){_0x4ca2f9[_0x326647][_0x9d02('0x53')]=[];_0x4013b4['push'](db[_0x9d02('0x32')][_0x9d02('0x4e')]({'where':{'FromId':[_0x3a7aa9['user']['id'],_0x1fb6f6[_0x326647]['id']],'ToId':[_0x3a7aa9[_0x9d02('0x5a')]['id'],_0x1fb6f6[_0x326647]['id']],'ChatGroupId':null},'attributes':['id',_0x9d02('0x55'),_0x9d02('0x6f'),_0x9d02('0x70'),_0x9d02('0x71'),_0x9d02('0x50')],'order':qs[_0x9d02('0x72')](_0x9d02('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1fb6f6[_0x326647])));}return BPromise[_0x9d02('0x74')](_0x4013b4);}return[];})[_0x9d02('0x2b')](function(_0x45ec12){return{'rows':_0x45ec12,'count':_0x45ec12[_0x9d02('0x3d')]};})[_0x9d02('0x2b')](respondWithResult(_0x24bb22,null))[_0x9d02('0x4b')](handleError(_0x24bb22,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 6d96ba2..4a7f694 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 _0xa713=['setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xa713,0x7d));var _0x3a71=function(_0x2c2d60,_0x1f7ee9){_0x2c2d60=_0x2c2d60-0x0;var _0x3eee5d=_0xa713[_0x2c2d60];return _0x3eee5d;};'use strict';var EventEmitter=require(_0x3a71('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3a71('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3a71('0x2')};function emitEvent(_0x591309){return function(_0x1f7c3a,_0x5aa74c,_0x3ea5d3){ChatInternalMessageEvents[_0x3a71('0x3')](_0x591309+':'+_0x1f7c3a['id'],_0x1f7c3a);ChatInternalMessageEvents['emit'](_0x591309,_0x1f7c3a);_0x3ea5d3(null);};}for(var e in events){if(events[_0x3a71('0x4')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3a71('0x5')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x1dd1=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x559339,_0x1cc49a){var _0x1ba106=function(_0x17c687){while(--_0x17c687){_0x559339['push'](_0x559339['shift']());}};_0x1ba106(++_0x1cc49a);}(_0x1dd1,0x1e2));var _0x11dd=function(_0x340aa5,_0x2d5553){_0x340aa5=_0x340aa5-0x0;var _0x3a5b7f=_0x1dd1[_0x340aa5];return _0x3a5b7f;};'use strict';var EventEmitter=require(_0x11dd('0x0'));var ChatInternalMessage=require(_0x11dd('0x1'))['db'][_0x11dd('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x11dd('0x3')](0x0);var events={'afterCreate':_0x11dd('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ab8cf){return function(_0x28be68,_0x3fc812,_0x4a048e){ChatInternalMessageEvents[_0x11dd('0x5')](_0x3ab8cf+':'+_0x28be68['id'],_0x28be68);ChatInternalMessageEvents[_0x11dd('0x5')](_0x3ab8cf,_0x28be68);_0x4a048e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x11dd('0x6')](e,emitEvent(event));}}module[_0x11dd('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 79023cc..8ca3eeb 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 _0x41a4=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x52be4c,_0x29b9a0){var _0x7e0c5a=function(_0x476fdf){while(--_0x476fdf){_0x52be4c['push'](_0x52be4c['shift']());}};_0x7e0c5a(++_0x29b9a0);}(_0x41a4,0xc3));var _0x441a=function(_0x5c31f4,_0x446a83){_0x5c31f4=_0x5c31f4-0x0;var _0x2583bf=_0x41a4[_0x5c31f4];return _0x2583bf;};'use strict';var _=require(_0x441a('0x0'));var util=require(_0x441a('0x1'));var logger=require('../../config/logger')(_0x441a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x441a('0x3'));var fs=require('fs');var path=require(_0x441a('0x4'));var rimraf=require(_0x441a('0x5'));var config=require(_0x441a('0x6'));var attributes=require(_0x441a('0x7'));module[_0x441a('0x8')]=function(_0x10b098,_0x1d93c0){return _0x10b098[_0x441a('0x9')](_0x441a('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x441a('0xb'),'collate':_0x441a('0xc')});}; \ No newline at end of file +var _0x610a=['./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a9e9f,_0x5c2416){var _0x3c9a08=function(_0x488457){while(--_0x488457){_0x4a9e9f['push'](_0x4a9e9f['shift']());}};_0x3c9a08(++_0x5c2416);}(_0x610a,0x132));var _0xa610=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x610a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa610('0x0'));var util=require(_0xa610('0x1'));var logger=require(_0xa610('0x2'))('api');var moment=require(_0xa610('0x3'));var BPromise=require(_0xa610('0x4'));var rp=require(_0xa610('0x5'));var fs=require('fs');var path=require(_0xa610('0x6'));var rimraf=require(_0xa610('0x7'));var config=require(_0xa610('0x8'));var attributes=require(_0xa610('0x9'));module['exports']=function(_0x23376d,_0x3fa23d){return _0x23376d[_0xa610('0xa')](_0xa610('0xb'),attributes,{'tableName':_0xa610('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa610('0xd'),'collate':_0xa610('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index d1a5400..2536b43 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 _0xfcc5=['client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x149bf3,_0x4d2c41){var _0x4cb558=function(_0xfe4031){while(--_0xfe4031){_0x149bf3['push'](_0x149bf3['shift']());}};_0x4cb558(++_0x4d2c41);}(_0xfcc5,0x79));var _0x5fcc=function(_0x4e5f4d,_0x208481){_0x4e5f4d=_0x4e5f4d-0x0;var _0x48dd5d=_0xfcc5[_0x4e5f4d];return _0x48dd5d;};'use strict';var _=require(_0x5fcc('0x0'));var util=require(_0x5fcc('0x1'));var moment=require(_0x5fcc('0x2'));var BPromise=require(_0x5fcc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fcc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fcc('0x5'))(_0x5fcc('0x6'));var config=require(_0x5fcc('0x7'));var jayson=require(_0x5fcc('0x8'));var client=jayson[_0x5fcc('0x9')][_0x5fcc('0xa')]({'port':0x232a});config['redis']=_[_0x5fcc('0xb')](config[_0x5fcc('0xc')],{'host':_0x5fcc('0xd'),'port':0x18eb});var socket=require(_0x5fcc('0xe'))(new Redis(config[_0x5fcc('0xc')]));require(_0x5fcc('0xf'))[_0x5fcc('0x10')](socket);function respondWithRpcPromise(_0x700c81,_0x1e8874,_0x475ee3){return new BPromise(function(_0x2ef2d5,_0x107d4f){return client['request'](_0x700c81,_0x475ee3)[_0x5fcc('0x11')](function(_0x7bc084){logger[_0x5fcc('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x1e8874,_0x5fcc('0x13'));logger[_0x5fcc('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1e8874,_0x5fcc('0x13'),JSON[_0x5fcc('0x15')](_0x7bc084));if(_0x7bc084['error']){if(_0x7bc084[_0x5fcc('0x16')]['code']===0x1f4){logger['error'](_0x5fcc('0x17'),_0x1e8874,_0x7bc084[_0x5fcc('0x16')][_0x5fcc('0x18')]);return _0x107d4f(_0x7bc084[_0x5fcc('0x16')][_0x5fcc('0x18')]);}logger[_0x5fcc('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1e8874,_0x7bc084[_0x5fcc('0x16')][_0x5fcc('0x18')]);return _0x2ef2d5(_0x7bc084[_0x5fcc('0x16')][_0x5fcc('0x18')]);}else{logger[_0x5fcc('0x12')](_0x5fcc('0x17'),_0x1e8874,_0x5fcc('0x13'));_0x2ef2d5(_0x7bc084[_0x5fcc('0x19')][_0x5fcc('0x18')]);}})['catch'](function(_0x28f654){logger[_0x5fcc('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1e8874,_0x28f654);_0x107d4f(_0x28f654);});});} \ No newline at end of file +var _0xed98=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x3a2913,_0x3a0498){var _0x5364f1=function(_0x493350){while(--_0x493350){_0x3a2913['push'](_0x3a2913['shift']());}};_0x5364f1(++_0x3a0498);}(_0xed98,0x109));var _0x8ed9=function(_0x4c95f7,_0x56a52d){_0x4c95f7=_0x4c95f7-0x0;var _0x47c107=_0xed98[_0x4c95f7];return _0x47c107;};'use strict';var _=require(_0x8ed9('0x0'));var util=require(_0x8ed9('0x1'));var moment=require(_0x8ed9('0x2'));var BPromise=require(_0x8ed9('0x3'));var rs=require(_0x8ed9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ed9('0x5'))['db'];var utils=require(_0x8ed9('0x6'));var logger=require(_0x8ed9('0x7'))('rpc');var config=require(_0x8ed9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ed9('0x9')][_0x8ed9('0xa')]({'port':0x232a});config[_0x8ed9('0xb')]=_[_0x8ed9('0xc')](config['redis'],{'host':_0x8ed9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ed9('0xe'))[_0x8ed9('0xf')](socket);function respondWithRpcPromise(_0x1c84c,_0x35615a,_0x55670a){return new BPromise(function(_0x3425fe,_0x11d595){return client[_0x8ed9('0x10')](_0x1c84c,_0x55670a)[_0x8ed9('0x11')](function(_0x3e9a51){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x35615a,'request\x20sent');logger[_0x8ed9('0x12')](_0x8ed9('0x13'),_0x35615a,_0x8ed9('0x14'),JSON[_0x8ed9('0x15')](_0x3e9a51));if(_0x3e9a51[_0x8ed9('0x16')]){if(_0x3e9a51[_0x8ed9('0x16')][_0x8ed9('0x17')]===0x1f4){logger[_0x8ed9('0x16')](_0x8ed9('0x18'),_0x35615a,_0x3e9a51[_0x8ed9('0x16')][_0x8ed9('0x19')]);return _0x11d595(_0x3e9a51[_0x8ed9('0x16')][_0x8ed9('0x19')]);}logger[_0x8ed9('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x35615a,_0x3e9a51['error'][_0x8ed9('0x19')]);return _0x3425fe(_0x3e9a51[_0x8ed9('0x16')][_0x8ed9('0x19')]);}else{logger[_0x8ed9('0x1a')](_0x8ed9('0x18'),_0x35615a,_0x8ed9('0x14'));_0x3425fe(_0x3e9a51[_0x8ed9('0x1b')][_0x8ed9('0x19')]);}})[_0x8ed9('0x1c')](function(_0x5c7c36){logger[_0x8ed9('0x16')](_0x8ed9('0x18'),_0x35615a,_0x5c7c36);_0x11d595(_0x5c7c36);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index bdd6726..733de78 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 _0xf880=['./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x19d6b7,_0x49f5ae){var _0x1a2dfc=function(_0x456e0d){while(--_0x456e0d){_0x19d6b7['push'](_0x19d6b7['shift']());}};_0x1a2dfc(++_0x49f5ae);}(_0xf880,0x171));var _0x0f88=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xf880[_0x1a9204];return _0x17ca68;};'use strict';var ChatInternalMessageEvents=require(_0x0f88('0x0'));var events=[_0x0f88('0x1'),_0x0f88('0x2'),_0x0f88('0x3')];function createListener(_0x1d827f,_0x5bc074){return function(_0x1c380f){_0x5bc074[_0x0f88('0x4')](_0x1d827f,_0x1c380f);};}function removeListener(_0x56a0a4,_0x2aaed4){return function(){ChatInternalMessageEvents[_0x0f88('0x5')](_0x56a0a4,_0x2aaed4);};}exports[_0x0f88('0x6')]=function(_0x58964a){for(var _0x1b97ca=0x0,_0x4bf90e=events[_0x0f88('0x7')];_0x1b97ca<_0x4bf90e;_0x1b97ca++){var _0x3eb3f7=events[_0x1b97ca];var _0x1d27b6=createListener(_0x0f88('0x8')+_0x3eb3f7,_0x58964a);ChatInternalMessageEvents['on'](_0x3eb3f7,_0x1d27b6);}}; \ No newline at end of file +var _0xdef9=['emit','removeListener','register','chatInternalMessage:','save','remove'];(function(_0x2f0ca3,_0x4a2d02){var _0x567a84=function(_0x40b3cf){while(--_0x40b3cf){_0x2f0ca3['push'](_0x2f0ca3['shift']());}};_0x567a84(++_0x4a2d02);}(_0xdef9,0xb8));var _0x9def=function(_0x315d54,_0x333bec){_0x315d54=_0x315d54-0x0;var _0x21c13e=_0xdef9[_0x315d54];return _0x21c13e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x9def('0x0'),_0x9def('0x1'),'update'];function createListener(_0x228f45,_0x31f7cf){return function(_0x13f037){_0x31f7cf[_0x9def('0x2')](_0x228f45,_0x13f037);};}function removeListener(_0x1c7bb9,_0x1eabea){return function(){ChatInternalMessageEvents[_0x9def('0x3')](_0x1c7bb9,_0x1eabea);};}exports[_0x9def('0x4')]=function(_0x103321){for(var _0x2b395a=0x0,_0x158eec=events['length'];_0x2b395a<_0x158eec;_0x2b395a++){var _0x2a4193=events[_0x2b395a];var _0x6d0da8=createListener(_0x9def('0x5')+_0x2a4193,_0x103321);ChatInternalMessageEvents['on'](_0x2a4193,_0x6d0da8);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3492bdc..1dc9c1d 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 _0xda0b=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','post','create','put','destroy','multer'];(function(_0x53d6ba,_0xb57bb){var _0x786520=function(_0x51edc1){while(--_0x51edc1){_0x53d6ba['push'](_0x53d6ba['shift']());}};_0x786520(++_0xb57bb);}(_0xda0b,0x18b));var _0xbda0=function(_0x1bf1eb,_0xce9ba){_0x1bf1eb=_0x1bf1eb-0x0;var _0x2d64fc=_0xda0b[_0x1bf1eb];return _0x2d64fc;};'use strict';var multer=require(_0xbda0('0x0'));var util=require(_0xbda0('0x1'));var path=require(_0xbda0('0x2'));var timeout=require(_0xbda0('0x3'));var express=require(_0xbda0('0x4'));var router=express[_0xbda0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbda0('0x6'));var interaction=require(_0xbda0('0x7'));var config=require(_0xbda0('0x8'));var controller=require(_0xbda0('0x9'));router['get']('/',auth[_0xbda0('0xa')](),controller[_0xbda0('0xb')]);router[_0xbda0('0xc')](_0xbda0('0xd'),auth[_0xbda0('0xa')](),controller[_0xbda0('0xe')]);router[_0xbda0('0xc')](_0xbda0('0xf'),auth['isAuthenticated'](),controller[_0xbda0('0x10')]);router[_0xbda0('0xc')](_0xbda0('0x11'),auth[_0xbda0('0xa')](),controller['show']);router[_0xbda0('0x12')]('/',auth[_0xbda0('0xa')](),controller[_0xbda0('0x13')]);router[_0xbda0('0x14')]('/:id',controller['update']);router['delete'](_0xbda0('0x11'),auth['isAuthenticated'](),controller[_0xbda0('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6662=['/users','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','describe'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x6662,0x10b));var _0x2666=function(_0x4a8ce2,_0x4cd94e){_0x4a8ce2=_0x4a8ce2-0x0;var _0x38c265=_0x6662[_0x4a8ce2];return _0x38c265;};'use strict';var multer=require(_0x2666('0x0'));var util=require(_0x2666('0x1'));var path=require(_0x2666('0x2'));var timeout=require(_0x2666('0x3'));var express=require(_0x2666('0x4'));var router=express[_0x2666('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2666('0x6'));var interaction=require(_0x2666('0x7'));var config=require('../../config/environment');var controller=require(_0x2666('0x8'));router[_0x2666('0x9')]('/',auth[_0x2666('0xa')](),controller[_0x2666('0xb')]);router[_0x2666('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2666('0xc')]);router[_0x2666('0x9')](_0x2666('0xd'),auth[_0x2666('0xa')](),controller['getUsers']);router[_0x2666('0x9')]('/:id',auth[_0x2666('0xa')](),controller['show']);router['post']('/',auth[_0x2666('0xa')](),controller[_0x2666('0xe')]);router[_0x2666('0xf')]('/:id',controller['update']);router[_0x2666('0x10')](_0x2666('0x11'),auth['isAuthenticated'](),controller[_0x2666('0x12')]);module[_0x2666('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index be69bb3..882d55f 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 _0x4e5c=['TEXT','BOOLEAN','ENUM','STRING','sequelize'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x4e5c,0x149));var _0xc4e5=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x4e5c[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require(_0xc4e5('0x0'));module['exports']={'body':{'type':Sequelize[_0xc4e5('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc4e5('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc4e5('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc4e5('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc4e5('0x4')]},'providerResponse':{'type':Sequelize[_0xc4e5('0x1')]}}; \ No newline at end of file +var _0x4639=['ENUM','out','DATE','TEXT','sequelize','medium','BOOLEAN'];(function(_0x5d23be,_0x3b4f3c){var _0x4d60a9=function(_0x57dce7){while(--_0x57dce7){_0x5d23be['push'](_0x5d23be['shift']());}};_0x4d60a9(++_0x3b4f3c);}(_0x4639,0x115));var _0x9463=function(_0x5f5059,_0x469cd8){_0x5f5059=_0x5f5059-0x0;var _0x2245e3=_0x4639[_0x5f5059];return _0x2245e3;};'use strict';var Sequelize=require(_0x9463('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x9463('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x9463('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9463('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9463('0x3')]('in',_0x9463('0x4')),'defaultValue':_0x9463('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9463('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9463('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index a076fb0..31a55cc 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 _0x1dfb=['Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','keys','model','fields','attributes','query','hasOwnProperty','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','intersection','include','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','isNil','interaction','role','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','agent','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./chatMessage.socket','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','end','undefined','limit','count','offset','status'];(function(_0x48e893,_0x26840f){var _0x3301f6=function(_0x432eea){while(--_0x432eea){_0x48e893['push'](_0x48e893['shift']());}};_0x3301f6(++_0x26840f);}(_0x1dfb,0x1d1));var _0xb1df=function(_0x314c62,_0x5ede81){_0x314c62=_0x314c62-0x0;var _0x6371aa=_0x1dfb[_0x314c62];return _0x6371aa;};'use strict';var emlformat=require(_0xb1df('0x0'));var rimraf=require(_0xb1df('0x1'));var zipdir=require(_0xb1df('0x2'));var jsonpatch=require(_0xb1df('0x3'));var rp=require(_0xb1df('0x4'));var moment=require(_0xb1df('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb1df('0x6'));var path=require(_0xb1df('0x7'));var sox=require(_0xb1df('0x8'));var csv=require('to-csv');var ejs=require(_0xb1df('0x9'));var fs=require('fs');var fs_extra=require(_0xb1df('0xa'));var _=require(_0xb1df('0xb'));var squel=require(_0xb1df('0xc'));var crypto=require(_0xb1df('0xd'));var jsforce=require(_0xb1df('0xe'));var deskjs=require(_0xb1df('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb1df('0x10'));var Papa=require(_0xb1df('0x11'));var Redis=require('ioredis');var authService=require(_0xb1df('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb1df('0x13'));var hardwareService=require(_0xb1df('0x14'));var logger=require(_0xb1df('0x15'))(_0xb1df('0x16'));var utils=require(_0xb1df('0x17'));var config=require(_0xb1df('0x18'));var licenseUtil=require(_0xb1df('0x19'));var db=require('../../mysqldb')['db'];config[_0xb1df('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1df('0x1a')]));require(_0xb1df('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb1df('0x1c')][_0xb1df('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xb1df('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x489184,_0x1f5d52,_0x5ccac4,_0x4092cf){return new BPromise(function(_0xe61d8b,_0x16b881){var _0x497986=_0x4092cf||client;return _0x497986[_0xb1df('0x1e')](_0x489184,_0x5ccac4)[_0xb1df('0x1f')](function(_0x4622a0){logger[_0xb1df('0x20')](_0xb1df('0x21'),_0x1f5d52,_0xb1df('0x22'));logger[_0xb1df('0x23')](_0xb1df('0x24'),_0x1f5d52,_0xb1df('0x22'),JSON[_0xb1df('0x25')](_0x4622a0));if(_0x4622a0[_0xb1df('0x26')]){if(_0x4622a0['error']['code']===0x1f4){logger[_0xb1df('0x26')](_0xb1df('0x21'),_0x1f5d52,_0x4622a0[_0xb1df('0x26')][_0xb1df('0x27')]);return _0x16b881(_0x4622a0['error'][_0xb1df('0x27')]);}logger[_0xb1df('0x26')](_0xb1df('0x21'),_0x1f5d52,_0x4622a0[_0xb1df('0x26')][_0xb1df('0x27')]);return _0xe61d8b(_0x4622a0[_0xb1df('0x26')][_0xb1df('0x27')]);}else{logger[_0xb1df('0x20')](_0xb1df('0x21'),_0x1f5d52,_0xb1df('0x22'));_0xe61d8b(_0x4622a0['result']['message']);}})[_0xb1df('0x28')](function(_0x242ddc){logger[_0xb1df('0x26')](_0xb1df('0x21'),_0x1f5d52,_0x242ddc);_0x16b881(_0x242ddc);});});}function respondWithStatusCode(_0x40d8c7,_0x4299d5){_0x4299d5=_0x4299d5||0xcc;return function(_0x22f85a){if(_0x22f85a){return _0x40d8c7['sendStatus'](_0x4299d5);}return _0x40d8c7['status'](_0x4299d5)[_0xb1df('0x29')]();};}function respondWithResult(_0x44e6f7,_0x318af6){_0x318af6=_0x318af6||0xc8;return function(_0xa0a291){if(_0xa0a291){return _0x44e6f7['status'](_0x318af6)['json'](_0xa0a291);}};}function respondWithFilteredResult(_0x127b19,_0x195c70){return function(_0x2795a1){if(_0x2795a1){var _0x2c95fc=typeof _0x195c70['offset']===_0xb1df('0x2a')&&typeof _0x195c70[_0xb1df('0x2b')]===_0xb1df('0x2a');var _0x4cd551=_0x2795a1[_0xb1df('0x2c')];var _0x2fa15e=_0x2c95fc?0x0:_0x195c70[_0xb1df('0x2d')];var _0x1a266b=_0x2c95fc?_0x2795a1[_0xb1df('0x2c')]:_0x195c70['offset']+_0x195c70['limit'];var _0x5545ab;if(_0x1a266b>=_0x4cd551){_0x1a266b=_0x4cd551;_0x5545ab=0xc8;}else{_0x5545ab=0xce;}_0x127b19[_0xb1df('0x2e')](_0x5545ab);return _0x127b19['set'](_0xb1df('0x2f'),_0x2fa15e+'-'+_0x1a266b+'/'+_0x4cd551)[_0xb1df('0x30')](_0x2795a1);}return null;};}function patchUpdates(_0x4532ae){return function(_0x1c5fff){try{jsonpatch['apply'](_0x1c5fff,_0x4532ae,!![]);}catch(_0x3260b0){return BPromise[_0xb1df('0x31')](_0x3260b0);}return _0x1c5fff[_0xb1df('0x32')]();};}function saveUpdates(_0x52a485,_0x2d5dcc){return function(_0x554c0d){if(_0x554c0d){return _0x554c0d[_0xb1df('0x33')](_0x52a485)[_0xb1df('0x1f')](function(_0x5c6fe7){return _0x5c6fe7;});}return null;};}function removeEntity(_0x312974,_0x4fb3f8){return function(_0x4eb683){if(_0x4eb683){return _0x4eb683[_0xb1df('0x34')]()['then'](function(){_0x312974[_0xb1df('0x2e')](0xcc)[_0xb1df('0x29')]();});}};}function handleEntityNotFound(_0x415a74,_0x57ee13){return function(_0x4f28c8){if(!_0x4f28c8){_0x415a74[_0xb1df('0x35')](0x194);}return _0x4f28c8;};}function handleError(_0x4ca240,_0x1d6c0a){_0x1d6c0a=_0x1d6c0a||0x1f4;return function(_0x2c3577){logger[_0xb1df('0x26')](_0x2c3577[_0xb1df('0x36')]);if(_0x2c3577[_0xb1df('0x37')]){delete _0x2c3577[_0xb1df('0x37')];}_0x4ca240[_0xb1df('0x2e')](_0x1d6c0a)['send'](_0x2c3577);};}exports[_0xb1df('0x38')]=function(_0x4ef720,_0x510723){var _0x4351a8={},_0x4dbde3={},_0x2a6117={'count':0x0,'rows':[]};var _0x49d740=_[_0xb1df('0x39')](db[_0xb1df('0x3a')][_0xb1df('0x3b')],function(_0x32013b){return{'name':_0x32013b[_0xb1df('0x3c')],'type':_0x32013b[_0xb1df('0x3d')][_0xb1df('0x3e')]};});_0x4dbde3['model']=_['map'](_0x49d740,_0xb1df('0x37'));_0x4dbde3['query']=_[_0xb1df('0x3f')](_0x4ef720['query']);_0x4dbde3['filters']=_['intersection'](_0x4dbde3[_0xb1df('0x40')],_0x4dbde3['query']);_0x4351a8['attributes']=_['intersection'](_0x4dbde3['model'],qs[_0xb1df('0x41')](_0x4ef720['query']['fields']));_0x4351a8[_0xb1df('0x42')]=_0x4351a8[_0xb1df('0x42')]['length']?_0x4351a8[_0xb1df('0x42')]:_0x4dbde3[_0xb1df('0x40')];if(!_0x4ef720[_0xb1df('0x43')][_0xb1df('0x44')]('nolimit')){_0x4351a8['limit']=qs[_0xb1df('0x2b')](_0x4ef720['query'][_0xb1df('0x2b')]);_0x4351a8[_0xb1df('0x2d')]=qs[_0xb1df('0x2d')](_0x4ef720['query']['offset']);}_0x4351a8[_0xb1df('0x45')]=qs[_0xb1df('0x46')](_0x4ef720[_0xb1df('0x43')]['sort']);_0x4351a8['where']=qs[_0xb1df('0x47')](_['pick'](_0x4ef720[_0xb1df('0x43')],_0x4dbde3[_0xb1df('0x47')]),_0x49d740);if(_0x4ef720['query']['filter']){_0x4351a8[_0xb1df('0x48')]=_[_0xb1df('0x49')](_0x4351a8[_0xb1df('0x48')],{'$or':_[_0xb1df('0x39')](_0x49d740,function(_0x214c75){if(_0x214c75['type']!==_0xb1df('0x4a')){var _0x296d72={};_0x296d72[_0x214c75['name']]={'$like':'%'+_0x4ef720[_0xb1df('0x43')][_0xb1df('0x4b')]+'%'};return _0x296d72;}})});}_0x4351a8=_['merge']({},_0x4351a8,_0x4ef720[_0xb1df('0x4c')]);var _0x150ccd={'where':_0x4351a8[_0xb1df('0x48')]};return db['ChatMessage']['count'](_0x150ccd)[_0xb1df('0x1f')](function(_0x170a09){_0x2a6117[_0xb1df('0x2c')]=_0x170a09;if(_0x4ef720['query'][_0xb1df('0x4d')]){_0x4351a8['include']=[{'all':!![]}];}return db['ChatMessage'][_0xb1df('0x4e')](_0x4351a8);})[_0xb1df('0x1f')](function(_0x4552f1){_0x2a6117[_0xb1df('0x4f')]=_0x4552f1;return _0x2a6117;})[_0xb1df('0x1f')](respondWithFilteredResult(_0x510723,_0x4351a8))['catch'](handleError(_0x510723,null));};exports[_0xb1df('0x50')]=function(_0x873b95,_0x46494c){var _0x5d106a={'raw':!![],'where':{'id':_0x873b95[_0xb1df('0x51')]['id']}},_0x1d3ec4={};_0x1d3ec4[_0xb1df('0x40')]=_[_0xb1df('0x3f')](db[_0xb1df('0x3a')][_0xb1df('0x3b')]);_0x1d3ec4[_0xb1df('0x43')]=_[_0xb1df('0x3f')](_0x873b95[_0xb1df('0x43')]);_0x1d3ec4[_0xb1df('0x47')]=_[_0xb1df('0x52')](_0x1d3ec4['model'],_0x1d3ec4[_0xb1df('0x43')]);_0x5d106a['attributes']=_[_0xb1df('0x52')](_0x1d3ec4[_0xb1df('0x40')],qs[_0xb1df('0x41')](_0x873b95[_0xb1df('0x43')][_0xb1df('0x41')]));_0x5d106a[_0xb1df('0x42')]=_0x5d106a[_0xb1df('0x42')]['length']?_0x5d106a[_0xb1df('0x42')]:_0x1d3ec4['model'];if(_0x873b95['query']['includeAll']){_0x5d106a[_0xb1df('0x53')]=[{'all':!![]}];}_0x5d106a=_[_0xb1df('0x49')]({},_0x5d106a,_0x873b95[_0xb1df('0x4c')]);return db[_0xb1df('0x3a')][_0xb1df('0x54')](_0x5d106a)[_0xb1df('0x1f')](handleEntityNotFound(_0x46494c,null))[_0xb1df('0x1f')](respondWithResult(_0x46494c,null))['catch'](handleError(_0x46494c,null));};exports[_0xb1df('0x55')]=function(_0x8baa0a,_0x34c6f8){return db[_0xb1df('0x3a')][_0xb1df('0x55')](_0x8baa0a[_0xb1df('0x56')],{})[_0xb1df('0x1f')](respondWithResult(_0x34c6f8,0xc9))[_0xb1df('0x28')](handleError(_0x34c6f8,null));};exports[_0xb1df('0x33')]=function(_0x2ac461,_0x5a0c71){if(_0x2ac461[_0xb1df('0x56')]['id']){delete _0x2ac461['body']['id'];}return db[_0xb1df('0x3a')]['find']({'where':{'id':_0x2ac461[_0xb1df('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a0c71,null))['then'](saveUpdates(_0x2ac461[_0xb1df('0x56')],null))['then'](respondWithResult(_0x5a0c71,null))[_0xb1df('0x28')](handleError(_0x5a0c71,null));};exports['destroy']=function(_0x469d58,_0x4f93ca){return db[_0xb1df('0x3a')][_0xb1df('0x54')]({'where':{'id':_0x469d58[_0xb1df('0x51')]['id']}})[_0xb1df('0x1f')](handleEntityNotFound(_0x4f93ca,null))[_0xb1df('0x1f')](removeEntity(_0x4f93ca,null))[_0xb1df('0x28')](handleError(_0x4f93ca,null));};exports[_0xb1df('0x57')]=function(_0x4f7b10,_0x2aed60){return db[_0xb1df('0x3a')][_0xb1df('0x57')]()[_0xb1df('0x1f')](respondWithResult(_0x2aed60,null))[_0xb1df('0x28')](handleError(_0x2aed60,null));};var interaction_log=require(_0xb1df('0x15'))(_0xb1df('0x58'));exports[_0xb1df('0x59')]=function(_0x46b9f9,_0x581830,_0x5e8047){var _0x22b6e6={'agent':{},'channel':_0xb1df('0x5a')};if(_0x46b9f9[_0xb1df('0x56')]['id']){delete _0x46b9f9[_0xb1df('0x56')]['id'];}_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5b')]=!![];_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5c')]=moment()[_0xb1df('0x5d')](_0xb1df('0x5e'));_0x46b9f9['body'][_0xb1df('0x5f')]=_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5f')]||_0x46b9f9[_0xb1df('0x60')]['id'];_0x22b6e6['agent']['id']=_0x46b9f9['body'][_0xb1df('0x5f')];return db[_0xb1df('0x3a')][_0xb1df('0x54')]({'where':{'id':_0x46b9f9['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x581830,null))[_0xb1df('0x1f')](saveUpdates(_0x46b9f9[_0xb1df('0x56')],null))[_0xb1df('0x1f')](function(_0x337d7b){if(_0x337d7b){_0x22b6e6[_0xb1df('0x27')]=_0x337d7b[_0xb1df('0x61')]({'plain':!![]});return db[_0xb1df('0x62')][_0xb1df('0x54')]({'where':{'id':_0x337d7b['ChatInteractionId']}});}return null;})[_0xb1df('0x1f')](handleEntityNotFound(_0x581830,null))[_0xb1df('0x1f')](function(_0x1d6de3){if(_0x1d6de3){return _0x1d6de3[_0xb1df('0x33')]({'UserId':_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5f')],'read1stAt':_[_0xb1df('0x63')](_0x1d6de3['read1stAt'])?moment()[_0xb1df('0x5d')](_0xb1df('0x5e')):undefined});}return null;})['then'](function(_0x4a26b1){if(_0x4a26b1){_0x22b6e6[_0xb1df('0x64')]=_0x4a26b1[_0xb1df('0x61')]({'plain':!![]});interaction_log[_0xb1df('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46b9f9[_0xb1df('0x60')]['id'],_0x46b9f9['user'][_0xb1df('0x37')],_0x46b9f9[_0xb1df('0x60')][_0xb1df('0x65')],_0x22b6e6['interaction']['id'],_0x46b9f9[_0xb1df('0x56')]?JSON[_0xb1df('0x25')](_0x46b9f9[_0xb1df('0x56')]):_0xb1df('0x66'));return respondWithRpcPromise(_0xb1df('0x67'),_0xb1df('0x68'),_0x22b6e6);}return null;})[_0xb1df('0x1f')](function(_0x4b81b0){var _0x3b275a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b81b0['message'][_0xb1df('0x69')];return db['sequelize']['query'](_0x3b275a,{'type':db['Sequelize'][_0xb1df('0x6a')][_0xb1df('0x6b')],'raw':!![]})['then'](function(_0x533dcf){return _0x533dcf;});})[_0xb1df('0x1f')](function(_0x5ecde5){if(_0x5ecde5){_0x22b6e6[_0xb1df('0x27')][_0xb1df('0x6c')]=_0x5ecde5[0x0];if(!_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5f')])return;return db['User'][_0xb1df('0x54')]({'where':{'id':_0x46b9f9['body'][_0xb1df('0x5f')],'role':_0xb1df('0x6d')},'attributes':['id',_0xb1df('0x37'),_0xb1df('0x6e'),_0xb1df('0x6f'),'internal'],'raw':!![]});}return null;})[_0xb1df('0x1f')](function(_0x206095){if(!_0x206095)return null;_0x22b6e6[_0xb1df('0x27')][_0xb1df('0x6d')]=_0x206095;return _0x22b6e6;})[_0xb1df('0x1f')](function(_0x6bc0a1){if(_0x6bc0a1){if(_0x46b9f9['body']['manual']){_0x22b6e6[_0xb1df('0x27')][_0xb1df('0x70')]=util[_0xb1df('0x5d')](_0xb1df('0x71'),_0x46b9f9[_0xb1df('0x60')][_0xb1df('0x37')]);_0x22b6e6['message']['channel']=_0x22b6e6[_0xb1df('0x72')];_0x22b6e6[_0xb1df('0x27')][_0xb1df('0x73')]=_0x22b6e6[_0xb1df('0x72')];_0x22b6e6['message'][_0xb1df('0x74')]='accept';return respondWithRpcPromise(_0xb1df('0x75'),_0xb1df('0x75'),{'event':_0xb1df('0x76'),'message':_[_0xb1df('0x49')](_0x22b6e6[_0xb1df('0x27')],JSON[_0xb1df('0x77')](_0x22b6e6[_0xb1df('0x64')][_0xb1df('0x78')]))},client9002)['then'](function(){return _0x22b6e6;});}return _0x22b6e6;}return null;})[_0xb1df('0x1f')](respondWithResult(_0x581830,null))[_0xb1df('0x28')](handleError(_0x581830,null));};var interaction_log=require(_0xb1df('0x15'))('chat-interactions');exports[_0xb1df('0x31')]=function(_0x21d4af,_0x402f71,_0x4b86bb){var _0x54366a={'agent':{},'channel':'chat'};if(_0x21d4af[_0xb1df('0x56')]['id']){delete _0x21d4af[_0xb1df('0x56')]['id'];}_0x21d4af['body'][_0xb1df('0x5f')]=_0x21d4af[_0xb1df('0x56')][_0xb1df('0x5f')]||_0x21d4af['user']['id'];_0x54366a[_0xb1df('0x6d')]['id']=_0x21d4af[_0xb1df('0x56')][_0xb1df('0x5f')];return db['ChatMessage'][_0xb1df('0x54')]({'where':{'id':_0x21d4af[_0xb1df('0x51')]['id'],'UserId':null}})[_0xb1df('0x1f')](handleEntityNotFound(_0x402f71,null))['then'](function(_0x15a148){if(_0x15a148){_0x54366a[_0xb1df('0x27')]=_0x15a148[_0xb1df('0x61')]({'plain':!![]});return db[_0xb1df('0x62')][_0xb1df('0x54')]({'where':{'id':_0x15a148[_0xb1df('0x79')]}});}return null;})[_0xb1df('0x1f')](handleEntityNotFound(_0x402f71,null))[_0xb1df('0x1f')](function(_0x453c86){if(_0x453c86){_0x54366a['interaction']=_0x453c86[_0xb1df('0x61')]({'plain':!![]});interaction_log[_0xb1df('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21d4af[_0xb1df('0x60')]['id'],_0x21d4af[_0xb1df('0x60')]['name'],_0x21d4af['user'][_0xb1df('0x65')],_0x54366a[_0xb1df('0x64')]['id'],_0x21d4af[_0xb1df('0x56')]?JSON[_0xb1df('0x25')](_0x21d4af[_0xb1df('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0xb1df('0x7a'),_0x54366a);}return null;})[_0xb1df('0x1f')](function(_0x13bc23){var _0x265185=_0xb1df('0x7b')+_0x13bc23['message'][_0xb1df('0x69')];return db[_0xb1df('0x7c')][_0xb1df('0x43')](_0x265185,{'type':db['Sequelize'][_0xb1df('0x6a')][_0xb1df('0x6b')],'raw':!![]})[_0xb1df('0x1f')](function(_0x1e77ee){return _0x1e77ee;});})['then'](function(_0x330b8c){if(_0x330b8c){_0x54366a['message'][_0xb1df('0x6c')]=_0x330b8c[0x0];if(!_0x21d4af[_0xb1df('0x56')][_0xb1df('0x5f')])return;return db[_0xb1df('0x7d')][_0xb1df('0x54')]({'where':{'id':_0x21d4af['body'][_0xb1df('0x5f')],'role':_0xb1df('0x6d')},'attributes':['id',_0xb1df('0x37'),_0xb1df('0x6e'),_0xb1df('0x6f'),_0xb1df('0x7e')],'raw':!![]});}return null;})[_0xb1df('0x1f')](function(_0x1a6ad1){if(!_0x1a6ad1)return null;_0x54366a[_0xb1df('0x27')]['agent']=_0x1a6ad1;return _0x54366a;})['then'](function(_0x192b96){if(_0x192b96){_0x192b96['message']['interface']=util[_0xb1df('0x5d')](_0xb1df('0x71'),_0x21d4af['user'][_0xb1df('0x37')]);_0x192b96[_0xb1df('0x27')][_0xb1df('0x72')]=_0x54366a['channel'];_0x192b96[_0xb1df('0x27')][_0xb1df('0x73')]=_0x54366a['channel'];_0x192b96['message'][_0xb1df('0x74')]=_0xb1df('0x31');respondWithRpcPromise(_0xb1df('0x75'),_0xb1df('0x75'),{'event':_0xb1df('0x7f'),'message':_[_0xb1df('0x49')](_0x54366a[_0xb1df('0x27')],JSON[_0xb1df('0x77')](_0x54366a[_0xb1df('0x64')][_0xb1df('0x78')]))},client9002);return _0x54366a;}return null;})[_0xb1df('0x1f')](respondWithResult(_0x402f71,null))[_0xb1df('0x28')](handleError(_0x402f71,null));}; \ No newline at end of file +var _0x7a63=['User','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','destroy','then','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','includeAll','create','update','body','find','params','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','interaction','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact'];(function(_0x23b421,_0x4b47b8){var _0x21d728=function(_0x56f773){while(--_0x56f773){_0x23b421['push'](_0x23b421['shift']());}};_0x21d728(++_0x4b47b8);}(_0x7a63,0x93));var _0x37a6=function(_0x1be95f,_0x7cce06){_0x1be95f=_0x1be95f-0x0;var _0x2b3116=_0x7a63[_0x1be95f];return _0x2b3116;};'use strict';var emlformat=require(_0x37a6('0x0'));var rimraf=require(_0x37a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37a6('0x2'));var rp=require(_0x37a6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37a6('0x4'));var util=require(_0x37a6('0x5'));var path=require(_0x37a6('0x6'));var sox=require(_0x37a6('0x7'));var csv=require(_0x37a6('0x8'));var ejs=require(_0x37a6('0x9'));var fs=require('fs');var fs_extra=require(_0x37a6('0xa'));var _=require(_0x37a6('0xb'));var squel=require(_0x37a6('0xc'));var crypto=require('crypto');var jsforce=require(_0x37a6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x37a6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x37a6('0xe'));var authService=require(_0x37a6('0xf'));var qs=require(_0x37a6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37a6('0x11'));var logger=require(_0x37a6('0x12'))(_0x37a6('0x13'));var utils=require(_0x37a6('0x14'));var config=require(_0x37a6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x37a6('0x16'))['db'];config[_0x37a6('0x17')]=_[_0x37a6('0x18')](config[_0x37a6('0x17')],{'host':_0x37a6('0x19'),'port':0x18eb});var socket=require(_0x37a6('0x1a'))(new Redis(config[_0x37a6('0x17')]));require(_0x37a6('0x1b'))[_0x37a6('0x1c')](socket);var jayson=require(_0x37a6('0x1d'));var client=jayson['client'][_0x37a6('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x37a6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xaa4085,_0xa37f1e,_0x3428b6,_0x5c91b5){return new BPromise(function(_0x48353f,_0x312379){var _0x1e30c0=_0x5c91b5||client;return _0x1e30c0['request'](_0xaa4085,_0x3428b6)['then'](function(_0x4a5374){logger[_0x37a6('0x1f')](_0x37a6('0x20'),_0xa37f1e,'request\x20sent');logger[_0x37a6('0x21')](_0x37a6('0x22'),_0xa37f1e,_0x37a6('0x23'),JSON['stringify'](_0x4a5374));if(_0x4a5374[_0x37a6('0x24')]){if(_0x4a5374[_0x37a6('0x24')][_0x37a6('0x25')]===0x1f4){logger[_0x37a6('0x24')]('ChatMessage,\x20%s,\x20%s',_0xa37f1e,_0x4a5374['error'][_0x37a6('0x26')]);return _0x312379(_0x4a5374[_0x37a6('0x24')]['message']);}logger[_0x37a6('0x24')](_0x37a6('0x20'),_0xa37f1e,_0x4a5374['error'][_0x37a6('0x26')]);return _0x48353f(_0x4a5374[_0x37a6('0x24')][_0x37a6('0x26')]);}else{logger[_0x37a6('0x1f')](_0x37a6('0x20'),_0xa37f1e,_0x37a6('0x23'));_0x48353f(_0x4a5374[_0x37a6('0x27')]['message']);}})[_0x37a6('0x28')](function(_0x5a90c7){logger[_0x37a6('0x24')]('ChatMessage,\x20%s,\x20%s',_0xa37f1e,_0x5a90c7);_0x312379(_0x5a90c7);});});}function respondWithStatusCode(_0x5289e3,_0x5079bd){_0x5079bd=_0x5079bd||0xcc;return function(_0x3337c8){if(_0x3337c8){return _0x5289e3[_0x37a6('0x29')](_0x5079bd);}return _0x5289e3[_0x37a6('0x2a')](_0x5079bd)[_0x37a6('0x2b')]();};}function respondWithResult(_0x262b90,_0xf14d7f){_0xf14d7f=_0xf14d7f||0xc8;return function(_0xfb2cf0){if(_0xfb2cf0){return _0x262b90['status'](_0xf14d7f)[_0x37a6('0x2c')](_0xfb2cf0);}};}function respondWithFilteredResult(_0x137318,_0x94159a){return function(_0x3d4344){if(_0x3d4344){var _0x29a86d=typeof _0x94159a[_0x37a6('0x2d')]==='undefined'&&typeof _0x94159a['limit']===_0x37a6('0x2e');var _0x456c00=_0x3d4344['count'];var _0x554429=_0x29a86d?0x0:_0x94159a[_0x37a6('0x2d')];var _0x1d899d=_0x29a86d?_0x3d4344['count']:_0x94159a[_0x37a6('0x2d')]+_0x94159a[_0x37a6('0x2f')];var _0x237b09;if(_0x1d899d>=_0x456c00){_0x1d899d=_0x456c00;_0x237b09=0xc8;}else{_0x237b09=0xce;}_0x137318['status'](_0x237b09);return _0x137318['set'](_0x37a6('0x30'),_0x554429+'-'+_0x1d899d+'/'+_0x456c00)[_0x37a6('0x2c')](_0x3d4344);}return null;};}function patchUpdates(_0x4b06a8){return function(_0x1f7b66){try{jsonpatch['apply'](_0x1f7b66,_0x4b06a8,!![]);}catch(_0x327bf0){return BPromise[_0x37a6('0x31')](_0x327bf0);}return _0x1f7b66['save']();};}function saveUpdates(_0x23a7ae,_0x75c9be){return function(_0x9efbff){if(_0x9efbff){return _0x9efbff['update'](_0x23a7ae)['then'](function(_0x2be608){return _0x2be608;});}return null;};}function removeEntity(_0x89c230,_0x25ccff){return function(_0x428b7c){if(_0x428b7c){return _0x428b7c[_0x37a6('0x32')]()[_0x37a6('0x33')](function(){_0x89c230[_0x37a6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4030,_0x1b5393){return function(_0x3b0f37){if(!_0x3b0f37){_0x1a4030[_0x37a6('0x29')](0x194);}return _0x3b0f37;};}function handleError(_0x423312,_0x3ffa6d){_0x3ffa6d=_0x3ffa6d||0x1f4;return function(_0x35241b){logger[_0x37a6('0x24')](_0x35241b['stack']);if(_0x35241b['name']){delete _0x35241b[_0x37a6('0x34')];}_0x423312[_0x37a6('0x2a')](_0x3ffa6d)[_0x37a6('0x35')](_0x35241b);};}exports[_0x37a6('0x36')]=function(_0x1cfcb7,_0x4cf024){var _0x4a4ad4={},_0x302339={},_0xff5498={'count':0x0,'rows':[]};var _0x551da2=_[_0x37a6('0x37')](db[_0x37a6('0x38')][_0x37a6('0x39')],function(_0x19f869){return{'name':_0x19f869[_0x37a6('0x3a')],'type':_0x19f869[_0x37a6('0x3b')][_0x37a6('0x3c')]};});_0x302339['model']=_[_0x37a6('0x37')](_0x551da2,_0x37a6('0x34'));_0x302339['query']=_[_0x37a6('0x3d')](_0x1cfcb7['query']);_0x302339[_0x37a6('0x3e')]=_[_0x37a6('0x3f')](_0x302339['model'],_0x302339[_0x37a6('0x40')]);_0x4a4ad4[_0x37a6('0x41')]=_['intersection'](_0x302339[_0x37a6('0x42')],qs[_0x37a6('0x43')](_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x43')]));_0x4a4ad4[_0x37a6('0x41')]=_0x4a4ad4['attributes'][_0x37a6('0x44')]?_0x4a4ad4[_0x37a6('0x41')]:_0x302339[_0x37a6('0x42')];if(!_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x45')](_0x37a6('0x46'))){_0x4a4ad4[_0x37a6('0x2f')]=qs[_0x37a6('0x2f')](_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x2f')]);_0x4a4ad4['offset']=qs[_0x37a6('0x2d')](_0x1cfcb7['query'][_0x37a6('0x2d')]);}_0x4a4ad4[_0x37a6('0x47')]=qs['sort'](_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x48')]);_0x4a4ad4[_0x37a6('0x49')]=qs[_0x37a6('0x3e')](_[_0x37a6('0x4a')](_0x1cfcb7[_0x37a6('0x40')],_0x302339[_0x37a6('0x3e')]),_0x551da2);if(_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x4b')]){_0x4a4ad4[_0x37a6('0x49')]=_[_0x37a6('0x4c')](_0x4a4ad4[_0x37a6('0x49')],{'$or':_[_0x37a6('0x37')](_0x551da2,function(_0x191124){if(_0x191124[_0x37a6('0x3b')]!==_0x37a6('0x4d')){var _0x3c7735={};_0x3c7735[_0x191124[_0x37a6('0x34')]]={'$like':'%'+_0x1cfcb7[_0x37a6('0x40')]['filter']+'%'};return _0x3c7735;}})});}_0x4a4ad4=_[_0x37a6('0x4c')]({},_0x4a4ad4,_0x1cfcb7[_0x37a6('0x4e')]);var _0x5ddc1d={'where':_0x4a4ad4[_0x37a6('0x49')]};return db[_0x37a6('0x38')][_0x37a6('0x4f')](_0x5ddc1d)[_0x37a6('0x33')](function(_0x5c83bc){_0xff5498[_0x37a6('0x4f')]=_0x5c83bc;if(_0x1cfcb7[_0x37a6('0x40')]['includeAll']){_0x4a4ad4[_0x37a6('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x37a6('0x51')](_0x4a4ad4);})[_0x37a6('0x33')](function(_0x4a50a1){_0xff5498[_0x37a6('0x52')]=_0x4a50a1;return _0xff5498;})[_0x37a6('0x33')](respondWithFilteredResult(_0x4cf024,_0x4a4ad4))[_0x37a6('0x28')](handleError(_0x4cf024,null));};exports[_0x37a6('0x53')]=function(_0x551c59,_0x48b2b4){var _0x43011f={'raw':!![],'where':{'id':_0x551c59['params']['id']}},_0x52e013={};_0x52e013[_0x37a6('0x42')]=_['keys'](db[_0x37a6('0x38')][_0x37a6('0x39')]);_0x52e013[_0x37a6('0x40')]=_[_0x37a6('0x3d')](_0x551c59[_0x37a6('0x40')]);_0x52e013[_0x37a6('0x3e')]=_[_0x37a6('0x3f')](_0x52e013[_0x37a6('0x42')],_0x52e013[_0x37a6('0x40')]);_0x43011f[_0x37a6('0x41')]=_[_0x37a6('0x3f')](_0x52e013[_0x37a6('0x42')],qs[_0x37a6('0x43')](_0x551c59['query'][_0x37a6('0x43')]));_0x43011f[_0x37a6('0x41')]=_0x43011f['attributes'][_0x37a6('0x44')]?_0x43011f[_0x37a6('0x41')]:_0x52e013['model'];if(_0x551c59[_0x37a6('0x40')][_0x37a6('0x54')]){_0x43011f[_0x37a6('0x50')]=[{'all':!![]}];}_0x43011f=_[_0x37a6('0x4c')]({},_0x43011f,_0x551c59[_0x37a6('0x4e')]);return db[_0x37a6('0x38')]['find'](_0x43011f)[_0x37a6('0x33')](handleEntityNotFound(_0x48b2b4,null))[_0x37a6('0x33')](respondWithResult(_0x48b2b4,null))[_0x37a6('0x28')](handleError(_0x48b2b4,null));};exports[_0x37a6('0x55')]=function(_0x7ffe6b,_0x1f7af7){return db[_0x37a6('0x38')]['create'](_0x7ffe6b['body'],{})['then'](respondWithResult(_0x1f7af7,0xc9))[_0x37a6('0x28')](handleError(_0x1f7af7,null));};exports[_0x37a6('0x56')]=function(_0x4c3ac3,_0x2c62c9){if(_0x4c3ac3[_0x37a6('0x57')]['id']){delete _0x4c3ac3[_0x37a6('0x57')]['id'];}return db[_0x37a6('0x38')][_0x37a6('0x58')]({'where':{'id':_0x4c3ac3[_0x37a6('0x59')]['id']}})['then'](handleEntityNotFound(_0x2c62c9,null))[_0x37a6('0x33')](saveUpdates(_0x4c3ac3['body'],null))[_0x37a6('0x33')](respondWithResult(_0x2c62c9,null))[_0x37a6('0x28')](handleError(_0x2c62c9,null));};exports[_0x37a6('0x32')]=function(_0x4e4a3b,_0x4a6348){return db[_0x37a6('0x38')][_0x37a6('0x58')]({'where':{'id':_0x4e4a3b['params']['id']}})[_0x37a6('0x33')](handleEntityNotFound(_0x4a6348,null))['then'](removeEntity(_0x4a6348,null))[_0x37a6('0x28')](handleError(_0x4a6348,null));};exports[_0x37a6('0x5a')]=function(_0x436227,_0x263505){return db[_0x37a6('0x38')]['describe']()[_0x37a6('0x33')](respondWithResult(_0x263505,null))[_0x37a6('0x28')](handleError(_0x263505,null));};var interaction_log=require(_0x37a6('0x12'))('chat-interactions');exports[_0x37a6('0x5b')]=function(_0x431fb6,_0x34c1e2,_0x5a1468){var _0x345c17={'agent':{},'channel':_0x37a6('0x5c')};if(_0x431fb6[_0x37a6('0x57')]['id']){delete _0x431fb6[_0x37a6('0x57')]['id'];}_0x431fb6[_0x37a6('0x57')][_0x37a6('0x5d')]=!![];_0x431fb6[_0x37a6('0x57')][_0x37a6('0x5e')]=moment()[_0x37a6('0x5f')](_0x37a6('0x60'));_0x431fb6[_0x37a6('0x57')][_0x37a6('0x61')]=_0x431fb6[_0x37a6('0x57')][_0x37a6('0x61')]||_0x431fb6[_0x37a6('0x62')]['id'];_0x345c17[_0x37a6('0x63')]['id']=_0x431fb6['body'][_0x37a6('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x431fb6['params']['id'],'UserId':null}})[_0x37a6('0x33')](handleEntityNotFound(_0x34c1e2,null))[_0x37a6('0x33')](saveUpdates(_0x431fb6[_0x37a6('0x57')],null))[_0x37a6('0x33')](function(_0x244646){if(_0x244646){_0x345c17[_0x37a6('0x26')]=_0x244646[_0x37a6('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x37a6('0x58')]({'where':{'id':_0x244646[_0x37a6('0x65')]}});}return null;})[_0x37a6('0x33')](handleEntityNotFound(_0x34c1e2,null))['then'](function(_0x2cfd59){if(_0x2cfd59){return _0x2cfd59[_0x37a6('0x56')]({'UserId':_0x431fb6[_0x37a6('0x57')][_0x37a6('0x61')],'read1stAt':_['isNil'](_0x2cfd59['read1stAt'])?moment()[_0x37a6('0x5f')](_0x37a6('0x60')):undefined});}return null;})[_0x37a6('0x33')](function(_0x25fdf1){if(_0x25fdf1){_0x345c17['interaction']=_0x25fdf1['get']({'plain':!![]});interaction_log[_0x37a6('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x431fb6[_0x37a6('0x62')]['id'],_0x431fb6[_0x37a6('0x62')][_0x37a6('0x34')],_0x431fb6['user']['role'],_0x345c17[_0x37a6('0x66')]['id'],_0x431fb6[_0x37a6('0x57')]?JSON[_0x37a6('0x67')](_0x431fb6[_0x37a6('0x57')]):_0x37a6('0x68'));return respondWithRpcPromise(_0x37a6('0x69'),_0x37a6('0x6a'),_0x345c17);}return null;})['then'](function(_0x14d088){var _0x342ab5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14d088[_0x37a6('0x26')][_0x37a6('0x6b')];return db[_0x37a6('0x6c')][_0x37a6('0x40')](_0x342ab5,{'type':db[_0x37a6('0x6d')][_0x37a6('0x6e')][_0x37a6('0x6f')],'raw':!![]})[_0x37a6('0x33')](function(_0x3e5b23){return _0x3e5b23;});})[_0x37a6('0x33')](function(_0x298cd1){if(_0x298cd1){_0x345c17[_0x37a6('0x26')][_0x37a6('0x70')]=_0x298cd1[0x0];if(!_0x431fb6['body']['UserId'])return;return db[_0x37a6('0x71')][_0x37a6('0x58')]({'where':{'id':_0x431fb6['body'][_0x37a6('0x61')],'role':_0x37a6('0x63')},'attributes':['id','name','fullname',_0x37a6('0x72'),_0x37a6('0x73')],'raw':!![]});}return null;})[_0x37a6('0x33')](function(_0x5092d6){if(!_0x5092d6)return null;_0x345c17['message'][_0x37a6('0x63')]=_0x5092d6;return _0x345c17;})[_0x37a6('0x33')](function(_0x195a5d){if(_0x195a5d){if(_0x431fb6['body'][_0x37a6('0x74')]){_0x345c17[_0x37a6('0x26')][_0x37a6('0x75')]=util['format'](_0x37a6('0x76'),_0x431fb6['user'][_0x37a6('0x34')]);_0x345c17[_0x37a6('0x26')]['channel']=_0x345c17['channel'];_0x345c17[_0x37a6('0x26')][_0x37a6('0x77')]=_0x345c17[_0x37a6('0x78')];_0x345c17[_0x37a6('0x26')][_0x37a6('0x79')]='accept';return respondWithRpcPromise(_0x37a6('0x7a'),_0x37a6('0x7a'),{'event':_0x37a6('0x7b'),'message':_[_0x37a6('0x4c')](_0x345c17[_0x37a6('0x26')],JSON['parse'](_0x345c17[_0x37a6('0x66')][_0x37a6('0x7c')]))},client9002)[_0x37a6('0x33')](function(){return _0x345c17;});}return _0x345c17;}return null;})[_0x37a6('0x33')](respondWithResult(_0x34c1e2,null))[_0x37a6('0x28')](handleError(_0x34c1e2,null));};var interaction_log=require(_0x37a6('0x12'))('chat-interactions');exports[_0x37a6('0x31')]=function(_0x112673,_0x3debb2,_0x2f0f03){var _0x38cf19={'agent':{},'channel':_0x37a6('0x5c')};if(_0x112673['body']['id']){delete _0x112673['body']['id'];}_0x112673[_0x37a6('0x57')][_0x37a6('0x61')]=_0x112673[_0x37a6('0x57')][_0x37a6('0x61')]||_0x112673[_0x37a6('0x62')]['id'];_0x38cf19[_0x37a6('0x63')]['id']=_0x112673[_0x37a6('0x57')][_0x37a6('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x112673[_0x37a6('0x59')]['id'],'UserId':null}})[_0x37a6('0x33')](handleEntityNotFound(_0x3debb2,null))[_0x37a6('0x33')](function(_0x38187d){if(_0x38187d){_0x38cf19[_0x37a6('0x26')]=_0x38187d['get']({'plain':!![]});return db[_0x37a6('0x7d')]['find']({'where':{'id':_0x38187d[_0x37a6('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3debb2,null))[_0x37a6('0x33')](function(_0x19d7ba){if(_0x19d7ba){_0x38cf19[_0x37a6('0x66')]=_0x19d7ba[_0x37a6('0x64')]({'plain':!![]});interaction_log[_0x37a6('0x1f')](_0x37a6('0x7e'),_0x112673['user']['id'],_0x112673[_0x37a6('0x62')][_0x37a6('0x34')],_0x112673[_0x37a6('0x62')][_0x37a6('0x7f')],_0x38cf19[_0x37a6('0x66')]['id'],_0x112673[_0x37a6('0x57')]?JSON[_0x37a6('0x67')](_0x112673[_0x37a6('0x57')]):_0x37a6('0x68'));return respondWithRpcPromise(_0x37a6('0x80'),'rejectMessage',_0x38cf19);}return null;})[_0x37a6('0x33')](function(_0x44c14e){var _0x45eec3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x44c14e[_0x37a6('0x26')][_0x37a6('0x6b')];return db[_0x37a6('0x6c')][_0x37a6('0x40')](_0x45eec3,{'type':db[_0x37a6('0x6d')]['QueryTypes'][_0x37a6('0x6f')],'raw':!![]})[_0x37a6('0x33')](function(_0x46b52a){return _0x46b52a;});})[_0x37a6('0x33')](function(_0x54d277){if(_0x54d277){_0x38cf19['message'][_0x37a6('0x70')]=_0x54d277[0x0];if(!_0x112673['body'][_0x37a6('0x61')])return;return db['User'][_0x37a6('0x58')]({'where':{'id':_0x112673[_0x37a6('0x57')][_0x37a6('0x61')],'role':'agent'},'attributes':['id',_0x37a6('0x34'),'fullname',_0x37a6('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x35020f){if(!_0x35020f)return null;_0x38cf19[_0x37a6('0x26')][_0x37a6('0x63')]=_0x35020f;return _0x38cf19;})[_0x37a6('0x33')](function(_0x56b663){if(_0x56b663){_0x56b663[_0x37a6('0x26')][_0x37a6('0x75')]=util[_0x37a6('0x5f')](_0x37a6('0x76'),_0x112673['user'][_0x37a6('0x34')]);_0x56b663[_0x37a6('0x26')][_0x37a6('0x78')]=_0x38cf19[_0x37a6('0x78')];_0x56b663[_0x37a6('0x26')][_0x37a6('0x77')]=_0x38cf19[_0x37a6('0x78')];_0x56b663[_0x37a6('0x26')][_0x37a6('0x79')]=_0x37a6('0x31');respondWithRpcPromise(_0x37a6('0x7a'),_0x37a6('0x7a'),{'event':_0x37a6('0x81'),'message':_[_0x37a6('0x4c')](_0x38cf19[_0x37a6('0x26')],JSON['parse'](_0x38cf19[_0x37a6('0x66')][_0x37a6('0x7c')]))},client9002);return _0x38cf19;}return null;})[_0x37a6('0x33')](respondWithResult(_0x3debb2,null))[_0x37a6('0x28')](handleError(_0x3debb2,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 3a3ae0a..6a4681a 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 _0x994a=['ChatMessage','setMaxListeners','save','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x579124,_0x2022e0){var _0x2507e5=function(_0x3cf38f){while(--_0x3cf38f){_0x579124['push'](_0x579124['shift']());}};_0x2507e5(++_0x2022e0);}(_0x994a,0x67));var _0xa994=function(_0x466876,_0x135bac){_0x466876=_0x466876-0x0;var _0x3fbf01=_0x994a[_0x466876];return _0x3fbf01;};'use strict';var EventEmitter=require(_0xa994('0x0'));var ChatMessage=require(_0xa994('0x1'))['db'][_0xa994('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa994('0x3')](0x0);var events={'afterCreate':_0xa994('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x48477c){return function(_0x40d070,_0x3b2e06,_0x1438c0){ChatMessageEvents['emit'](_0x48477c+':'+_0x40d070['id'],_0x40d070);ChatMessageEvents['emit'](_0x48477c,_0x40d070);_0x1438c0(null);};}for(var e in events){if(events[_0xa994('0x5')](e)){var event=events[e];ChatMessage[_0xa994('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x0fbd=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','remove','emit'];(function(_0x4e00f3,_0x4e7ccc){var _0x2e3471=function(_0x485126){while(--_0x485126){_0x4e00f3['push'](_0x4e00f3['shift']());}};_0x2e3471(++_0x4e7ccc);}(_0x0fbd,0x133));var _0xd0fb=function(_0x455798,_0xd126ce){_0x455798=_0x455798-0x0;var _0x3afe64=_0x0fbd[_0x455798];return _0x3afe64;};'use strict';var EventEmitter=require(_0xd0fb('0x0'));var ChatMessage=require(_0xd0fb('0x1'))['db'][_0xd0fb('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd0fb('0x3')};function emitEvent(_0x260f84){return function(_0x2dba04,_0x2df9a4,_0x2694bf){ChatMessageEvents[_0xd0fb('0x4')](_0x260f84+':'+_0x2dba04['id'],_0x2dba04);ChatMessageEvents[_0xd0fb('0x4')](_0x260f84,_0x2dba04);_0x2694bf(null);};}for(var e in events){if(events[_0xd0fb('0x5')](e)){var event=events[e];ChatMessage[_0xd0fb('0x6')](e,emitEvent(event));}}module[_0xd0fb('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 99a5d43..d0d603b 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 _0xcc0d=['ChatInteraction','findOne','ChatInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil'];(function(_0x5b3600,_0x5d5543){var _0x2353a1=function(_0x4b921a){while(--_0x4b921a){_0x5b3600['push'](_0x5b3600['shift']());}};_0x2353a1(++_0x5d5543);}(_0xcc0d,0x174));var _0xdcc0=function(_0x4b8111,_0x3a9f74){_0x4b8111=_0x4b8111-0x0;var _0x13a15f=_0xcc0d[_0x4b8111];return _0x13a15f;};'use strict';var _=require(_0xdcc0('0x0'));var util=require(_0xdcc0('0x1'));var logger=require(_0xdcc0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdcc0('0x3'));var rp=require(_0xdcc0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdcc0('0x5'));var config=require(_0xdcc0('0x6'));var attributes=require(_0xdcc0('0x7'));module['exports']=function(_0x3baa5c,_0x5b6b32){return _0x3baa5c['define'](_0xdcc0('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xdcc0('0x9'),'fields':[_0xdcc0('0xa')],'type':_0xdcc0('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f4f4f,_0x4d82b5,_0x166e9d){var _0x162aa7=_0x3baa5c[_0xdcc0('0xc')];var _0x1ba3b0=_0x4f4f4f[_0xdcc0('0xd')]({'plain':!![]});if(_0x1ba3b0[_0xdcc0('0xe')][_0xdcc0('0xf')]()==='in'||_0x1ba3b0['direction'][_0xdcc0('0xf')]()==='out'&&!_0x1ba3b0[_0xdcc0('0x10')]&&!_[_0xdcc0('0x11')](_0x1ba3b0['UserId'])){_0x162aa7[_0xdcc0('0x12')][_0xdcc0('0x13')]({'where':{'id':_0x1ba3b0[_0xdcc0('0x14')]}})[_0xdcc0('0x15')](function(_0x25a458){if(_0x25a458){_0x25a458[_0xdcc0('0x16')]({'lastMsgAt':_0x1ba3b0['createdAt'],'lastMsgDirection':_0x1ba3b0['direction'][_0xdcc0('0xf')]()});}})['catch'](function(_0xa1fd7c){console[_0xdcc0('0x17')](_0xa1fd7c);});}_0x166e9d();}},'charset':_0xdcc0('0x18'),'collate':_0xdcc0('0x19')});}; \ No newline at end of file +var _0xac4e=['FULLTEXT','models','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xac4e,0x1d9));var _0xeac4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xac4e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xeac4('0x0'));var util=require(_0xeac4('0x1'));var logger=require(_0xeac4('0x2'))(_0xeac4('0x3'));var moment=require(_0xeac4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeac4('0x5'));var rimraf=require(_0xeac4('0x6'));var config=require(_0xeac4('0x7'));var attributes=require('./chatMessage.attributes');module[_0xeac4('0x8')]=function(_0x233a03,_0x2f0039){return _0x233a03[_0xeac4('0x9')](_0xeac4('0xa'),attributes,{'tableName':_0xeac4('0xb'),'paranoid':![],'indexes':[{'name':_0xeac4('0xc'),'fields':['body'],'type':_0xeac4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x178e7e,_0x309585,_0x359721){var _0x120dbb=_0x233a03[_0xeac4('0xe')];var _0x3f9035=_0x178e7e['get']({'plain':!![]});if(_0x3f9035[_0xeac4('0xf')][_0xeac4('0x10')]()==='in'||_0x3f9035[_0xeac4('0xf')][_0xeac4('0x10')]()==='out'&&!_0x3f9035[_0xeac4('0x11')]&&!_['isNil'](_0x3f9035[_0xeac4('0x12')])){_0x120dbb[_0xeac4('0x13')][_0xeac4('0x14')]({'where':{'id':_0x3f9035[_0xeac4('0x15')]}})['then'](function(_0x42025d){if(_0x42025d){_0x42025d[_0xeac4('0x16')]({'lastMsgAt':_0x3f9035[_0xeac4('0x17')],'lastMsgDirection':_0x3f9035[_0xeac4('0xf')]['toLowerCase']()});}})[_0xeac4('0x18')](function(_0x566c02){console['error'](_0x566c02);});}_0x359721();}},'charset':_0xeac4('0x19'),'collate':_0xeac4('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index fa02daf..a475817 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 _0xba73=['request\x20sent','stringify','error','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x1abb9b,_0x5040b3){var _0x556e5e=function(_0x7e6f0c){while(--_0x7e6f0c){_0x1abb9b['push'](_0x1abb9b['shift']());}};_0x556e5e(++_0x5040b3);}(_0xba73,0x18c));var _0x3ba7=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xba73[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x3ba7('0x0'));var util=require(_0x3ba7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3ba7('0x2'));var fs=require('fs');var Redis=require(_0x3ba7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ba7('0x4'));var logger=require(_0x3ba7('0x5'))(_0x3ba7('0x6'));var config=require(_0x3ba7('0x7'));var jayson=require(_0x3ba7('0x8'));var client=jayson[_0x3ba7('0x9')][_0x3ba7('0xa')]({'port':0x232a});config['redis']=_[_0x3ba7('0xb')](config[_0x3ba7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ba7('0xd'))(new Redis(config[_0x3ba7('0xc')]));require(_0x3ba7('0xe'))['register'](socket);function respondWithRpcPromise(_0x123c0a,_0x2e2fce,_0x25c1a6){return new BPromise(function(_0x42daad,_0x2040dd){return client[_0x3ba7('0xf')](_0x123c0a,_0x25c1a6)[_0x3ba7('0x10')](function(_0x184799){logger['info'](_0x3ba7('0x11'),_0x2e2fce,'request\x20sent');logger[_0x3ba7('0x12')](_0x3ba7('0x13'),_0x2e2fce,_0x3ba7('0x14'),JSON[_0x3ba7('0x15')](_0x184799));if(_0x184799[_0x3ba7('0x16')]){if(_0x184799[_0x3ba7('0x16')]['code']===0x1f4){logger['error'](_0x3ba7('0x11'),_0x2e2fce,_0x184799[_0x3ba7('0x16')]['message']);return _0x2040dd(_0x184799[_0x3ba7('0x16')]['message']);}logger[_0x3ba7('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2e2fce,_0x184799[_0x3ba7('0x16')]['message']);return _0x42daad(_0x184799[_0x3ba7('0x16')][_0x3ba7('0x17')]);}else{logger[_0x3ba7('0x18')](_0x3ba7('0x11'),_0x2e2fce,_0x3ba7('0x14'));_0x42daad(_0x184799[_0x3ba7('0x19')][_0x3ba7('0x17')]);}})[_0x3ba7('0x1a')](function(_0x50c891){logger[_0x3ba7('0x16')](_0x3ba7('0x11'),_0x2e2fce,_0x50c891);_0x2040dd(_0x50c891);});});}exports[_0x3ba7('0x1b')]=function(_0x23e9ab){var _0x10784d=this;return new Promise(function(_0x14ca0b,_0xfe7337){return db[_0x3ba7('0x1c')]['create'](_0x23e9ab[_0x3ba7('0x1d')],{'raw':_0x23e9ab[_0x3ba7('0x1e')]?_0x23e9ab[_0x3ba7('0x1e')][_0x3ba7('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x459d07){logger[_0x3ba7('0x18')](_0x3ba7('0x1b'),_0x23e9ab);logger[_0x3ba7('0x12')](_0x3ba7('0x1b'),_0x23e9ab,JSON[_0x3ba7('0x15')](_0x459d07));_0x14ca0b(_0x459d07);})[_0x3ba7('0x1a')](function(_0x203836){logger[_0x3ba7('0x16')](_0x3ba7('0x1b'),_0x203836['message'],_0x23e9ab);_0xfe7337(_0x10784d['error'](0x1f4,_0x203836['message']));});});}; \ No newline at end of file +var _0x3738=['options','raw','then','util','moment','../../mysqldb','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create'];(function(_0x40a14b,_0x5efaf9){var _0x6450fc=function(_0x2e0448){while(--_0x2e0448){_0x40a14b['push'](_0x40a14b['shift']());}};_0x6450fc(++_0x5efaf9);}(_0x3738,0x11b));var _0x8373=function(_0x22cf70,_0x52ded0){_0x22cf70=_0x22cf70-0x0;var _0x5dc166=_0x3738[_0x22cf70];return _0x5dc166;};'use strict';var _=require('lodash');var util=require(_0x8373('0x0'));var moment=require(_0x8373('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8373('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8373('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8373('0x4')][_0x8373('0x5')]({'port':0x232a});config[_0x8373('0x6')]=_[_0x8373('0x7')](config['redis'],{'host':_0x8373('0x8'),'port':0x18eb});var socket=require(_0x8373('0x9'))(new Redis(config['redis']));require(_0x8373('0xa'))[_0x8373('0xb')](socket);function respondWithRpcPromise(_0x30722e,_0x10992c,_0x5e948c){return new BPromise(function(_0x111f27,_0x314b37){return client['request'](_0x30722e,_0x5e948c)['then'](function(_0x16899d){logger[_0x8373('0xc')](_0x8373('0xd'),_0x10992c,_0x8373('0xe'));logger[_0x8373('0xf')](_0x8373('0x10'),_0x10992c,'request\x20sent',JSON[_0x8373('0x11')](_0x16899d));if(_0x16899d[_0x8373('0x12')]){if(_0x16899d[_0x8373('0x12')][_0x8373('0x13')]===0x1f4){logger[_0x8373('0x12')]('ChatMessage,\x20%s,\x20%s',_0x10992c,_0x16899d['error']['message']);return _0x314b37(_0x16899d[_0x8373('0x12')]['message']);}logger[_0x8373('0x12')]('ChatMessage,\x20%s,\x20%s',_0x10992c,_0x16899d['error'][_0x8373('0x14')]);return _0x111f27(_0x16899d[_0x8373('0x12')][_0x8373('0x14')]);}else{logger[_0x8373('0xc')]('ChatMessage,\x20%s,\x20%s',_0x10992c,'request\x20sent');_0x111f27(_0x16899d['result'][_0x8373('0x14')]);}})[_0x8373('0x15')](function(_0xbe0826){logger['error'](_0x8373('0xd'),_0x10992c,_0xbe0826);_0x314b37(_0xbe0826);});});}exports[_0x8373('0x16')]=function(_0x4a4a02){var _0x1b468e=this;return new Promise(function(_0x46403d,_0x4b4f0e){return db[_0x8373('0x17')][_0x8373('0x18')](_0x4a4a02['body'],{'raw':_0x4a4a02[_0x8373('0x19')]?_0x4a4a02[_0x8373('0x19')][_0x8373('0x1a')]===undefined?!![]:![]:!![]})[_0x8373('0x1b')](function(_0x4ce4d1){logger[_0x8373('0xc')](_0x8373('0x16'),_0x4a4a02);logger[_0x8373('0xf')](_0x8373('0x16'),_0x4a4a02,JSON[_0x8373('0x11')](_0x4ce4d1));_0x46403d(_0x4ce4d1);})[_0x8373('0x15')](function(_0x4b4b82){logger[_0x8373('0x12')](_0x8373('0x16'),_0x4b4b82[_0x8373('0x14')],_0x4a4a02);_0x4b4f0e(_0x1b468e['error'](0x1f4,_0x4b4b82[_0x8373('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 1652971..c598f5b 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 _0x6075=['remove','update','emit','register','chatMessage:','save'];(function(_0x2d2623,_0x1aaea0){var _0x28f6c1=function(_0x599d40){while(--_0x599d40){_0x2d2623['push'](_0x2d2623['shift']());}};_0x28f6c1(++_0x1aaea0);}(_0x6075,0x191));var _0x5607=function(_0x9df33f,_0x27e67f){_0x9df33f=_0x9df33f-0x0;var _0x4d712f=_0x6075[_0x9df33f];return _0x4d712f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5607('0x0'),_0x5607('0x1'),_0x5607('0x2')];function createListener(_0x24427f,_0x2bcf4e){return function(_0x120ba2){_0x2bcf4e[_0x5607('0x3')](_0x24427f,_0x120ba2);};}function removeListener(_0x100852,_0x2a1c03){return function(){ChatMessageEvents['removeListener'](_0x100852,_0x2a1c03);};}exports[_0x5607('0x4')]=function(_0xabf691){for(var _0x14b9f4=0x0,_0x5ab18d=events['length'];_0x14b9f4<_0x5ab18d;_0x14b9f4++){var _0x3dc860=events[_0x14b9f4];var _0x25107d=createListener(_0x5607('0x5')+_0x3dc860,_0xabf691);ChatMessageEvents['on'](_0x3dc860,_0x25107d);}}; \ No newline at end of file +var _0xa8eb=['length','./chatMessage.events','remove','register'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xa8eb,0x179));var _0xba8e=function(_0x4d0136,_0x5f2a26){_0x4d0136=_0x4d0136-0x0;var _0x5d9f67=_0xa8eb[_0x4d0136];return _0x5d9f67;};'use strict';var ChatMessageEvents=require(_0xba8e('0x0'));var events=['save',_0xba8e('0x1'),'update'];function createListener(_0xd7f19f,_0x35f485){return function(_0x3b8fee){_0x35f485['emit'](_0xd7f19f,_0x3b8fee);};}function removeListener(_0x353df2,_0x368ce6){return function(){ChatMessageEvents['removeListener'](_0x353df2,_0x368ce6);};}exports[_0xba8e('0x2')]=function(_0x57e345){for(var _0x14c3ac=0x0,_0x52a8ef=events[_0xba8e('0x3')];_0x14c3ac<_0x52a8ef;_0x14c3ac++){var _0x69ccbe=events[_0x14c3ac];var _0x4b1bd6=createListener('chatMessage:'+_0x69ccbe,_0x57e345);ChatMessageEvents['on'](_0x69ccbe,_0x4b1bd6);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 5285db6..1a844b5 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 _0xd8b3=['create','update','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create'];(function(_0x505fd1,_0x1571cc){var _0x10881b=function(_0x17872c){while(--_0x17872c){_0x505fd1['push'](_0x505fd1['shift']());}};_0x10881b(++_0x1571cc);}(_0xd8b3,0x117));var _0x3d8b=function(_0x13c174,_0xda25fe){_0x13c174=_0x13c174-0x0;var _0x160654=_0xd8b3[_0x13c174];return _0x160654;};'use strict';var multer=require(_0x3d8b('0x0'));var util=require(_0x3d8b('0x1'));var path=require(_0x3d8b('0x2'));var timeout=require(_0x3d8b('0x3'));var express=require('express');var router=express[_0x3d8b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3d8b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3d8b('0x6'));var controller=require(_0x3d8b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3d8b('0x8')]);router[_0x3d8b('0x9')]('/describe',auth[_0x3d8b('0xa')](),controller[_0x3d8b('0xb')]);router[_0x3d8b('0x9')](_0x3d8b('0xc'),auth[_0x3d8b('0xa')](),controller[_0x3d8b('0xd')]);router[_0x3d8b('0xe')]('/',auth[_0x3d8b('0xa')](),interaction[_0x3d8b('0xf')](_0x3d8b('0x10'),_0x3d8b('0x11')),controller[_0x3d8b('0x12')]);router['put'](_0x3d8b('0xc'),controller[_0x3d8b('0x13')]);router[_0x3d8b('0x14')](_0x3d8b('0x15'),auth[_0x3d8b('0xa')](),controller[_0x3d8b('0x16')]);router[_0x3d8b('0x14')](_0x3d8b('0x17'),auth[_0x3d8b('0xa')](),controller[_0x3d8b('0x18')]);router['delete'](_0x3d8b('0xc'),auth['isAuthenticated'](),controller[_0x3d8b('0x19')]);module[_0x3d8b('0x1a')]=router; \ No newline at end of file +var _0x250d=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','post','tracked','chatmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x250d,0x14a));var _0xd250=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x250d[_0x4a29a9];return _0x386570;};'use strict';var multer=require(_0xd250('0x0'));var util=require(_0xd250('0x1'));var path=require(_0xd250('0x2'));var timeout=require(_0xd250('0x3'));var express=require('express');var router=express[_0xd250('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd250('0x5'));var interaction=require(_0xd250('0x6'));var config=require(_0xd250('0x7'));var controller=require(_0xd250('0x8'));router[_0xd250('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd250('0x9')](_0xd250('0xa'),auth['isAuthenticated'](),controller[_0xd250('0xb')]);router[_0xd250('0x9')](_0xd250('0xc'),auth[_0xd250('0xd')](),controller[_0xd250('0xe')]);router[_0xd250('0xf')]('/',auth['isAuthenticated'](),interaction[_0xd250('0x10')]('chat',_0xd250('0x11')),controller[_0xd250('0x12')]);router['put'](_0xd250('0xc'),controller[_0xd250('0x13')]);router['put'](_0xd250('0x14'),auth['isAuthenticated'](),controller[_0xd250('0x15')]);router[_0xd250('0x16')](_0xd250('0x17'),auth[_0xd250('0xd')](),controller[_0xd250('0x18')]);router[_0xd250('0x19')]('/:id',auth[_0xd250('0xd')](),controller[_0xd250('0x1a')]);module[_0xd250('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index d8fe981..3d6906e 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 _0x1fee=['TEXT','medium','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fee,0x12e));var _0xe1fe=function(_0x40e6d1,_0x8e4ede){_0x40e6d1=_0x40e6d1-0x0;var _0x5813e7=_0x1fee[_0x40e6d1];return _0x5813e7;};'use strict';var Sequelize=require(_0xe1fe('0x0'));module[_0xe1fe('0x1')]={'body':{'type':Sequelize[_0xe1fe('0x2')](_0xe1fe('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x1c7b=['medium','sequelize','exports'];(function(_0x10fd30,_0x435db3){var _0x5b4632=function(_0x23d2c3){while(--_0x23d2c3){_0x10fd30['push'](_0x10fd30['shift']());}};_0x5b4632(++_0x435db3);}(_0x1c7b,0xd6));var _0xb1c7=function(_0x1a4b92,_0x53283c){_0x1a4b92=_0x1a4b92-0x0;var _0x176366=_0x1c7b[_0x1a4b92];return _0x176366;};'use strict';var Sequelize=require(_0xb1c7('0x0'));module[_0xb1c7('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb1c7('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 1652801..90086bd 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(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x7a54,0x106));var _0x47a5=function(_0x3f8156,_0x170874){_0x3f8156=_0x3f8156-0x0;var _0x313144=_0x7a54[_0x3f8156];return _0x313144;};'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(_0x4bfcf1,_0x3bfae7){var _0x3d29f7=function(_0x441e2a){while(--_0x441e2a){_0x4bfcf1['push'](_0x4bfcf1['shift']());}};_0x3d29f7(++_0x3bfae7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 7c03d94..60f0ced 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 _0x64d7=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x64d7,0x1b2));var _0x764d=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0x64d7[_0x284807];return _0x50c774;};'use strict';var _=require(_0x764d('0x0'));var util=require(_0x764d('0x1'));var logger=require('../../config/logger')(_0x764d('0x2'));var moment=require(_0x764d('0x3'));var BPromise=require(_0x764d('0x4'));var rp=require(_0x764d('0x5'));var fs=require('fs');var path=require(_0x764d('0x6'));var rimraf=require('rimraf');var config=require(_0x764d('0x7'));var attributes=require(_0x764d('0x8'));module[_0x764d('0x9')]=function(_0x1fe471,_0x21d263){return _0x1fe471[_0x764d('0xa')](_0x764d('0xb'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x764d('0xc'),'collate':_0x764d('0xd')});}; \ No newline at end of file +var _0x856b=['ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','bluebird','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x856b,0x9f));var _0xb856=function(_0x255a63,_0x2b8f0c){_0x255a63=_0x255a63-0x0;var _0xf6a438=_0x856b[_0x255a63];return _0xf6a438;};'use strict';var _=require(_0xb856('0x0'));var util=require(_0xb856('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb856('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb856('0x3'));var rimraf=require(_0xb856('0x4'));var config=require(_0xb856('0x5'));var attributes=require(_0xb856('0x6'));module[_0xb856('0x7')]=function(_0x193ae2,_0x42ead8){return _0x193ae2[_0xb856('0x8')](_0xb856('0x9'),attributes,{'tableName':_0xb856('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb856('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index fe220bd..ddb5c17 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 _0x5aaa=['message','info','result','lodash','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','debug','request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x5aaa,0xff));var _0xa5aa=function(_0x58a3e9,_0x222833){_0x58a3e9=_0x58a3e9-0x0;var _0x4ad233=_0x5aaa[_0x58a3e9];return _0x4ad233;};'use strict';var _=require(_0xa5aa('0x0'));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(_0xa5aa('0x1'))['db'];var utils=require(_0xa5aa('0x2'));var logger=require(_0xa5aa('0x3'))('rpc');var config=require(_0xa5aa('0x4'));var jayson=require(_0xa5aa('0x5'));var client=jayson['client'][_0xa5aa('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x143817,_0x43e3bb,_0x2c0b72){return new BPromise(function(_0x5574aa,_0x566435){return client[_0xa5aa('0x7')](_0x143817,_0x2c0b72)[_0xa5aa('0x8')](function(_0x19e12a){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x43e3bb,'request\x20sent');logger[_0xa5aa('0x9')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x43e3bb,_0xa5aa('0xa'),JSON[_0xa5aa('0xb')](_0x19e12a));if(_0x19e12a[_0xa5aa('0xc')]){if(_0x19e12a[_0xa5aa('0xc')][_0xa5aa('0xd')]===0x1f4){logger['error'](_0xa5aa('0xe'),_0x43e3bb,_0x19e12a[_0xa5aa('0xc')][_0xa5aa('0xf')]);return _0x566435(_0x19e12a[_0xa5aa('0xc')]['message']);}logger[_0xa5aa('0xc')](_0xa5aa('0xe'),_0x43e3bb,_0x19e12a[_0xa5aa('0xc')]['message']);return _0x5574aa(_0x19e12a[_0xa5aa('0xc')][_0xa5aa('0xf')]);}else{logger[_0xa5aa('0x10')](_0xa5aa('0xe'),_0x43e3bb,_0xa5aa('0xa'));_0x5574aa(_0x19e12a[_0xa5aa('0x11')][_0xa5aa('0xf')]);}})['catch'](function(_0x219532){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x43e3bb,_0x219532);_0x566435(_0x219532);});});} \ No newline at end of file +var _0x9ee6=['catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0x9ee6,0x94));var _0x69ee=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0x9ee6[_0x199c03];return _0x11a7d4;};'use strict';var _=require('lodash');var util=require(_0x69ee('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x69ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69ee('0x2'))['db'];var utils=require(_0x69ee('0x3'));var logger=require(_0x69ee('0x4'))(_0x69ee('0x5'));var config=require(_0x69ee('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x69ee('0x7')][_0x69ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10919a,_0x389035,_0x2854c4){return new BPromise(function(_0x3b78d8,_0x352d01){return client[_0x69ee('0x9')](_0x10919a,_0x2854c4)[_0x69ee('0xa')](function(_0x3b85e3){logger[_0x69ee('0xb')](_0x69ee('0xc'),_0x389035,_0x69ee('0xd'));logger[_0x69ee('0xe')](_0x69ee('0xf'),_0x389035,'request\x20sent',JSON[_0x69ee('0x10')](_0x3b85e3));if(_0x3b85e3['error']){if(_0x3b85e3[_0x69ee('0x11')][_0x69ee('0x12')]===0x1f4){logger[_0x69ee('0x11')](_0x69ee('0xc'),_0x389035,_0x3b85e3[_0x69ee('0x11')][_0x69ee('0x13')]);return _0x352d01(_0x3b85e3['error'][_0x69ee('0x13')]);}logger[_0x69ee('0x11')](_0x69ee('0xc'),_0x389035,_0x3b85e3['error']['message']);return _0x3b78d8(_0x3b85e3['error'][_0x69ee('0x13')]);}else{logger[_0x69ee('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x389035,_0x69ee('0xd'));_0x3b78d8(_0x3b85e3['result']['message']);}})[_0x69ee('0x14')](function(_0x2685ca){logger[_0x69ee('0x11')](_0x69ee('0xc'),_0x389035,_0x2685ca);_0x352d01(_0x2685ca);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 0684cae..a4e5118 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 _0xd1c7=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','put','update','delete','destroy','exports','multer'];(function(_0x1a87e8,_0x3c5fc8){var _0x27828f=function(_0x25a07a){while(--_0x25a07a){_0x1a87e8['push'](_0x1a87e8['shift']());}};_0x27828f(++_0x3c5fc8);}(_0xd1c7,0x1c7));var _0x7d1c=function(_0xea1bcd,_0x465e08){_0xea1bcd=_0xea1bcd-0x0;var _0xfbe4c6=_0xd1c7[_0xea1bcd];return _0xfbe4c6;};'use strict';var multer=require(_0x7d1c('0x0'));var util=require(_0x7d1c('0x1'));var path=require(_0x7d1c('0x2'));var timeout=require(_0x7d1c('0x3'));var express=require(_0x7d1c('0x4'));var router=express[_0x7d1c('0x5')]();var fs_extra=require(_0x7d1c('0x6'));var auth=require(_0x7d1c('0x7'));var interaction=require(_0x7d1c('0x8'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x7d1c('0x9')]('/',auth[_0x7d1c('0xa')](),controller['index']);router[_0x7d1c('0x9')](_0x7d1c('0xb'),auth[_0x7d1c('0xa')](),controller[_0x7d1c('0xc')]);router[_0x7d1c('0x9')](_0x7d1c('0xd'),auth[_0x7d1c('0xa')](),controller['show']);router['post']('/',auth[_0x7d1c('0xa')](),controller['create']);router[_0x7d1c('0xe')](_0x7d1c('0xd'),auth[_0x7d1c('0xa')](),controller[_0x7d1c('0xf')]);router[_0x7d1c('0x10')]('/:id',auth[_0x7d1c('0xa')](),controller[_0x7d1c('0x11')]);module[_0x7d1c('0x12')]=router; \ No newline at end of file +var _0x1200=['post','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x2c32de,_0x138844){var _0x1ad47e=function(_0xdcc172){while(--_0xdcc172){_0x2c32de['push'](_0x2c32de['shift']());}};_0x1ad47e(++_0x138844);}(_0x1200,0xca));var _0x0120=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x1200[_0xfa634c];return _0x73e478;};'use strict';var multer=require(_0x0120('0x0'));var util=require(_0x0120('0x1'));var path=require('path');var timeout=require(_0x0120('0x2'));var express=require(_0x0120('0x3'));var router=express[_0x0120('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0120('0x5'));var interaction=require(_0x0120('0x6'));var config=require('../../config/environment');var controller=require(_0x0120('0x7'));router[_0x0120('0x8')]('/',auth[_0x0120('0x9')](),controller[_0x0120('0xa')]);router[_0x0120('0x8')](_0x0120('0xb'),auth[_0x0120('0x9')](),controller['describe']);router[_0x0120('0x8')](_0x0120('0xc'),auth[_0x0120('0x9')](),controller[_0x0120('0xd')]);router[_0x0120('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0120('0xf')](_0x0120('0xc'),auth[_0x0120('0x9')](),controller['update']);router[_0x0120('0x10')]('/:id',auth[_0x0120('0x9')](),controller[_0x0120('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 3e80200..af1db97 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 _0x2242=['ENUM','mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x10d0c8,_0x5b0bf5){var _0x1f59f8=function(_0x1a811a){while(--_0x1a811a){_0x10d0c8['push'](_0x10d0c8['shift']());}};_0x1f59f8(++_0x5b0bf5);}(_0x2242,0x8a));var _0x2224=function(_0x5d8e32,_0x26bb8f){_0x5d8e32=_0x5d8e32-0x0;var _0x4cf34b=_0x2242[_0x5d8e32];return _0x4cf34b;};'use strict';var Sequelize=require(_0x2224('0x0'));module[_0x2224('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2224('0x2')](_0x2224('0x3'),_0x2224('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2224('0x5')]},'timeout':{'type':Sequelize[_0x2224('0x6')]}}; \ No newline at end of file +var _0x9d66=['mouseOver','sequelize','exports','STRING','ENUM','timeout'];(function(_0x2a651a,_0x306757){var _0x14234f=function(_0x392b5f){while(--_0x392b5f){_0x2a651a['push'](_0x2a651a['shift']());}};_0x14234f(++_0x306757);}(_0x9d66,0xf1));var _0x69d6=function(_0x5a9683,_0x4c09dd){_0x5a9683=_0x5a9683-0x0;var _0x18db7d=_0x9d66[_0x5a9683];return _0x18db7d;};'use strict';var Sequelize=require(_0x69d6('0x0'));module[_0x69d6('0x1')]={'name':{'type':Sequelize[_0x69d6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x69d6('0x3')]('mouseOver',_0x69d6('0x4')),'defaultValue':_0x69d6('0x5')},'selector':{'type':Sequelize[_0x69d6('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 9be043a..bdac9ec 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 _0x302c=['query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x302c,0x15c));var _0xc302=function(_0x347cc3,_0x1f05cd){_0x347cc3=_0x347cc3-0x0;var _0x1df0f8=_0x302c[_0x347cc3];return _0x1df0f8;};'use strict';var emlformat=require(_0xc302('0x0'));var rimraf=require(_0xc302('0x1'));var zipdir=require(_0xc302('0x2'));var jsonpatch=require(_0xc302('0x3'));var rp=require(_0xc302('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc302('0x5'));var util=require(_0xc302('0x6'));var path=require(_0xc302('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc302('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc302('0x9'));var squel=require(_0xc302('0xa'));var crypto=require(_0xc302('0xb'));var jsforce=require(_0xc302('0xc'));var deskjs=require(_0xc302('0xd'));var toCsv=require(_0xc302('0xe'));var querystring=require('querystring');var Papa=require(_0xc302('0xf'));var Redis=require(_0xc302('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc302('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc302('0x12'));var config=require(_0xc302('0x13'));var licenseUtil=require(_0xc302('0x14'));var db=require(_0xc302('0x15'))['db'];function respondWithStatusCode(_0x3cf0f5,_0x25f167){_0x25f167=_0x25f167||0xcc;return function(_0xd3236b){if(_0xd3236b){return _0x3cf0f5[_0xc302('0x16')](_0x25f167);}return _0x3cf0f5[_0xc302('0x17')](_0x25f167)[_0xc302('0x18')]();};}function respondWithResult(_0x5bea5f,_0x4092d6){_0x4092d6=_0x4092d6||0xc8;return function(_0x2f9a3a){if(_0x2f9a3a){return _0x5bea5f['status'](_0x4092d6)[_0xc302('0x19')](_0x2f9a3a);}};}function respondWithFilteredResult(_0x3184d3,_0x271e83){return function(_0x29ce77){if(_0x29ce77){var _0x381759=typeof _0x271e83['offset']===_0xc302('0x1a')&&typeof _0x271e83['limit']===_0xc302('0x1a');var _0x337d22=_0x29ce77['count'];var _0x17093a=_0x381759?0x0:_0x271e83[_0xc302('0x1b')];var _0x34260a=_0x381759?_0x29ce77[_0xc302('0x1c')]:_0x271e83[_0xc302('0x1b')]+_0x271e83[_0xc302('0x1d')];var _0x5eb0e4;if(_0x34260a>=_0x337d22){_0x34260a=_0x337d22;_0x5eb0e4=0xc8;}else{_0x5eb0e4=0xce;}_0x3184d3[_0xc302('0x17')](_0x5eb0e4);return _0x3184d3[_0xc302('0x1e')]('Content-Range',_0x17093a+'-'+_0x34260a+'/'+_0x337d22)[_0xc302('0x19')](_0x29ce77);}return null;};}function patchUpdates(_0x291528){return function(_0x51537c){try{jsonpatch[_0xc302('0x1f')](_0x51537c,_0x291528,!![]);}catch(_0x34c28b){return BPromise[_0xc302('0x20')](_0x34c28b);}return _0x51537c['save']();};}function saveUpdates(_0x3e19fe,_0x3f7a84){return function(_0x27ff4a){if(_0x27ff4a){return _0x27ff4a['update'](_0x3e19fe)[_0xc302('0x21')](function(_0x5c2909){return _0x5c2909;});}return null;};}function removeEntity(_0x1cbe6c,_0x54e224){return function(_0x4a6b73){if(_0x4a6b73){return _0x4a6b73['destroy']()['then'](function(){_0x1cbe6c[_0xc302('0x17')](0xcc)[_0xc302('0x18')]();});}};}function handleEntityNotFound(_0x13b524,_0x5cdcbc){return function(_0x424788){if(!_0x424788){_0x13b524['sendStatus'](0x194);}return _0x424788;};}function handleError(_0x58f09f,_0x52eee2){_0x52eee2=_0x52eee2||0x1f4;return function(_0x5d2efc){logger[_0xc302('0x22')](_0x5d2efc[_0xc302('0x23')]);if(_0x5d2efc[_0xc302('0x24')]){delete _0x5d2efc[_0xc302('0x24')];}_0x58f09f[_0xc302('0x17')](_0x52eee2)[_0xc302('0x25')](_0x5d2efc);};}exports[_0xc302('0x26')]=function(_0x4109bb,_0x121398){var _0xc05f4f={'raw':!![],'where':{'id':_0x4109bb[_0xc302('0x27')]['id']}},_0x3a0dc0={};_0x3a0dc0[_0xc302('0x28')]=_[_0xc302('0x29')](db[_0xc302('0x2a')][_0xc302('0x2b')]);_0x3a0dc0[_0xc302('0x2c')]=_[_0xc302('0x29')](_0x4109bb[_0xc302('0x2c')]);_0x3a0dc0['filters']=_[_0xc302('0x2d')](_0x3a0dc0[_0xc302('0x28')],_0x3a0dc0['query']);_0xc05f4f['attributes']=_[_0xc302('0x2d')](_0x3a0dc0['model'],qs[_0xc302('0x2e')](_0x4109bb[_0xc302('0x2c')]['fields']));_0xc05f4f[_0xc302('0x2f')]=_0xc05f4f['attributes'][_0xc302('0x30')]?_0xc05f4f['attributes']:_0x3a0dc0['model'];if(_0x4109bb[_0xc302('0x2c')][_0xc302('0x31')]){_0xc05f4f[_0xc302('0x32')]=[{'all':!![]}];}_0xc05f4f=_[_0xc302('0x33')]({},_0xc05f4f,_0x4109bb['options']);return db[_0xc302('0x2a')][_0xc302('0x34')](_0xc05f4f)[_0xc302('0x21')](handleEntityNotFound(_0x121398,null))[_0xc302('0x21')](respondWithResult(_0x121398,null))[_0xc302('0x35')](handleError(_0x121398,null));};exports[_0xc302('0x36')]=function(_0x5faceb,_0x3a4ed9){return db[_0xc302('0x2a')][_0xc302('0x36')](_0x5faceb[_0xc302('0x37')],{})[_0xc302('0x21')](respondWithResult(_0x3a4ed9,0xc9))[_0xc302('0x35')](handleError(_0x3a4ed9,null));};exports['update']=function(_0x3914d8,_0x586c85){if(_0x3914d8[_0xc302('0x37')]['id']){delete _0x3914d8[_0xc302('0x37')]['id'];}return db['ChatProactiveAction'][_0xc302('0x34')]({'where':{'id':_0x3914d8[_0xc302('0x27')]['id']}})[_0xc302('0x21')](handleEntityNotFound(_0x586c85,null))[_0xc302('0x21')](saveUpdates(_0x3914d8[_0xc302('0x37')],null))[_0xc302('0x21')](respondWithResult(_0x586c85,null))[_0xc302('0x35')](handleError(_0x586c85,null));};exports['destroy']=function(_0x345396,_0x39fd7b){return db['ChatProactiveAction'][_0xc302('0x34')]({'where':{'id':_0x345396['params']['id']}})['then'](handleEntityNotFound(_0x39fd7b,null))[_0xc302('0x21')](removeEntity(_0x39fd7b,null))['catch'](handleError(_0x39fd7b,null));}; \ No newline at end of file +var _0x8832=['catch','create','body','params','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','error','stack','name','show','model','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','then'];(function(_0x4554a1,_0x5bacc4){var _0x38befc=function(_0xc82aad){while(--_0xc82aad){_0x4554a1['push'](_0x4554a1['shift']());}};_0x38befc(++_0x5bacc4);}(_0x8832,0x1f4));var _0x2883=function(_0x23e601,_0x430574){_0x23e601=_0x23e601-0x0;var _0x258be5=_0x8832[_0x23e601];return _0x258be5;};'use strict';var emlformat=require(_0x2883('0x0'));var rimraf=require(_0x2883('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2883('0x2'));var moment=require(_0x2883('0x3'));var BPromise=require(_0x2883('0x4'));var Mustache=require('mustache');var util=require(_0x2883('0x5'));var path=require('path');var sox=require(_0x2883('0x6'));var csv=require(_0x2883('0x7'));var ejs=require(_0x2883('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2883('0x9'));var squel=require('squel');var crypto=require(_0x2883('0xa'));var jsforce=require(_0x2883('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2883('0xc'));var Papa=require(_0x2883('0xd'));var Redis=require(_0x2883('0xe'));var authService=require(_0x2883('0xf'));var qs=require(_0x2883('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2883('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2883('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x342233,_0x3e36e4){_0x3e36e4=_0x3e36e4||0xcc;return function(_0x1e4f8f){if(_0x1e4f8f){return _0x342233[_0x2883('0x13')](_0x3e36e4);}return _0x342233[_0x2883('0x14')](_0x3e36e4)[_0x2883('0x15')]();};}function respondWithResult(_0x4a32d7,_0x4a3a24){_0x4a3a24=_0x4a3a24||0xc8;return function(_0x85a4a5){if(_0x85a4a5){return _0x4a32d7[_0x2883('0x14')](_0x4a3a24)['json'](_0x85a4a5);}};}function respondWithFilteredResult(_0x42a879,_0x41062b){return function(_0x2a7291){if(_0x2a7291){var _0x186a67=typeof _0x41062b[_0x2883('0x16')]===_0x2883('0x17')&&typeof _0x41062b[_0x2883('0x18')]===_0x2883('0x17');var _0x5c9d49=_0x2a7291[_0x2883('0x19')];var _0x3eff46=_0x186a67?0x0:_0x41062b[_0x2883('0x16')];var _0x1dec8a=_0x186a67?_0x2a7291[_0x2883('0x19')]:_0x41062b[_0x2883('0x16')]+_0x41062b[_0x2883('0x18')];var _0x39f20f;if(_0x1dec8a>=_0x5c9d49){_0x1dec8a=_0x5c9d49;_0x39f20f=0xc8;}else{_0x39f20f=0xce;}_0x42a879[_0x2883('0x14')](_0x39f20f);return _0x42a879['set'](_0x2883('0x1a'),_0x3eff46+'-'+_0x1dec8a+'/'+_0x5c9d49)[_0x2883('0x1b')](_0x2a7291);}return null;};}function patchUpdates(_0x350e75){return function(_0x56fa7f){try{jsonpatch[_0x2883('0x1c')](_0x56fa7f,_0x350e75,!![]);}catch(_0x5b2ed0){return BPromise[_0x2883('0x1d')](_0x5b2ed0);}return _0x56fa7f[_0x2883('0x1e')]();};}function saveUpdates(_0x1f083a,_0x5b758a){return function(_0x2a98e9){if(_0x2a98e9){return _0x2a98e9[_0x2883('0x1f')](_0x1f083a)['then'](function(_0x1d9f9c){return _0x1d9f9c;});}return null;};}function removeEntity(_0x4def16,_0x76717b){return function(_0x5556a1){if(_0x5556a1){return _0x5556a1['destroy']()['then'](function(){_0x4def16[_0x2883('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bf27b,_0x3f5fb1){return function(_0x48f046){if(!_0x48f046){_0x4bf27b[_0x2883('0x13')](0x194);}return _0x48f046;};}function handleError(_0x327e4e,_0x3f6268){_0x3f6268=_0x3f6268||0x1f4;return function(_0x15c130){logger[_0x2883('0x20')](_0x15c130[_0x2883('0x21')]);if(_0x15c130['name']){delete _0x15c130[_0x2883('0x22')];}_0x327e4e[_0x2883('0x14')](_0x3f6268)['send'](_0x15c130);};}exports[_0x2883('0x23')]=function(_0x1a2971,_0x2934d6){var _0x405c02={'raw':!![],'where':{'id':_0x1a2971['params']['id']}},_0x52ea29={};_0x52ea29[_0x2883('0x24')]=_['keys'](db[_0x2883('0x25')][_0x2883('0x26')]);_0x52ea29[_0x2883('0x27')]=_['keys'](_0x1a2971[_0x2883('0x27')]);_0x52ea29[_0x2883('0x28')]=_[_0x2883('0x29')](_0x52ea29['model'],_0x52ea29[_0x2883('0x27')]);_0x405c02[_0x2883('0x2a')]=_[_0x2883('0x29')](_0x52ea29['model'],qs[_0x2883('0x2b')](_0x1a2971['query'][_0x2883('0x2b')]));_0x405c02[_0x2883('0x2a')]=_0x405c02[_0x2883('0x2a')][_0x2883('0x2c')]?_0x405c02[_0x2883('0x2a')]:_0x52ea29['model'];if(_0x1a2971[_0x2883('0x27')][_0x2883('0x2d')]){_0x405c02[_0x2883('0x2e')]=[{'all':!![]}];}_0x405c02=_['merge']({},_0x405c02,_0x1a2971[_0x2883('0x2f')]);return db['ChatProactiveAction'][_0x2883('0x30')](_0x405c02)[_0x2883('0x31')](handleEntityNotFound(_0x2934d6,null))[_0x2883('0x31')](respondWithResult(_0x2934d6,null))[_0x2883('0x32')](handleError(_0x2934d6,null));};exports['create']=function(_0x777065,_0x2b4a3c){return db[_0x2883('0x25')][_0x2883('0x33')](_0x777065[_0x2883('0x34')],{})['then'](respondWithResult(_0x2b4a3c,0xc9))[_0x2883('0x32')](handleError(_0x2b4a3c,null));};exports[_0x2883('0x1f')]=function(_0x2c2639,_0xc3a384){if(_0x2c2639[_0x2883('0x34')]['id']){delete _0x2c2639[_0x2883('0x34')]['id'];}return db[_0x2883('0x25')]['find']({'where':{'id':_0x2c2639[_0x2883('0x35')]['id']}})[_0x2883('0x31')](handleEntityNotFound(_0xc3a384,null))[_0x2883('0x31')](saveUpdates(_0x2c2639['body'],null))[_0x2883('0x31')](respondWithResult(_0xc3a384,null))[_0x2883('0x32')](handleError(_0xc3a384,null));};exports[_0x2883('0x36')]=function(_0x3a5881,_0x215b0e){return db[_0x2883('0x25')][_0x2883('0x30')]({'where':{'id':_0x3a5881[_0x2883('0x35')]['id']}})['then'](handleEntityNotFound(_0x215b0e,null))['then'](removeEntity(_0x215b0e,null))[_0x2883('0x32')](handleError(_0x215b0e,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c9935cc..436d378 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 _0x479e=['define','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x343083,_0x12a263){var _0x33daf1=function(_0x28a767){while(--_0x28a767){_0x343083['push'](_0x343083['shift']());}};_0x33daf1(++_0x12a263);}(_0x479e,0x6f));var _0xe479=function(_0x458146,_0x49c906){_0x458146=_0x458146-0x0;var _0x7ff827=_0x479e[_0x458146];return _0x7ff827;};'use strict';var _=require(_0xe479('0x0'));var util=require(_0xe479('0x1'));var logger=require(_0xe479('0x2'))(_0xe479('0x3'));var moment=require(_0xe479('0x4'));var BPromise=require(_0xe479('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe479('0x6'));var config=require('../../config/environment');var attributes=require(_0xe479('0x7'));module[_0xe479('0x8')]=function(_0x4e62d4,_0x519f7d){return _0x4e62d4[_0xe479('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d3b=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x1a8631,_0x4e5f40){var _0x4a0535=function(_0x5605c7){while(--_0x5605c7){_0x1a8631['push'](_0x1a8631['shift']());}};_0x4a0535(++_0x4e5f40);}(_0x7d3b,0x127));var _0xb7d3=function(_0x5cd026,_0x5b9aca){_0x5cd026=_0x5cd026-0x0;var _0x570f4f=_0x7d3b[_0x5cd026];return _0x570f4f;};'use strict';var _=require(_0xb7d3('0x0'));var util=require(_0xb7d3('0x1'));var logger=require(_0xb7d3('0x2'))(_0xb7d3('0x3'));var moment=require(_0xb7d3('0x4'));var BPromise=require(_0xb7d3('0x5'));var rp=require(_0xb7d3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7d3('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x38dcf2,_0x3420dc){return _0x38dcf2[_0xb7d3('0x8')](_0xb7d3('0x9'),attributes,{'tableName':_0xb7d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index d534283..724c0ca 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 _0xfb31=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','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'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xfb31,0x75));var _0x1fb3=function(_0x59c505,_0x55ce83){_0x59c505=_0x59c505-0x0;var _0x241acc=_0xfb31[_0x59c505];return _0x241acc;};'use strict';var _=require(_0x1fb3('0x0'));var util=require(_0x1fb3('0x1'));var moment=require(_0x1fb3('0x2'));var BPromise=require(_0x1fb3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb3('0x4'));var db=require(_0x1fb3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1fb3('0x6'));var config=require(_0x1fb3('0x7'));var jayson=require(_0x1fb3('0x8'));var client=jayson[_0x1fb3('0x9')][_0x1fb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f610d,_0x40c3a5,_0x2e61a7){return new BPromise(function(_0x6aaa34,_0x2a3162){return client[_0x1fb3('0xb')](_0x3f610d,_0x2e61a7)[_0x1fb3('0xc')](function(_0x406563){logger[_0x1fb3('0xd')](_0x1fb3('0xe'),_0x40c3a5,_0x1fb3('0xf'));logger[_0x1fb3('0x10')](_0x1fb3('0x11'),_0x40c3a5,_0x1fb3('0xf'),JSON[_0x1fb3('0x12')](_0x406563));if(_0x406563[_0x1fb3('0x13')]){if(_0x406563['error'][_0x1fb3('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x40c3a5,_0x406563['error'][_0x1fb3('0x15')]);return _0x2a3162(_0x406563['error']['message']);}logger[_0x1fb3('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x40c3a5,_0x406563[_0x1fb3('0x13')][_0x1fb3('0x15')]);return _0x6aaa34(_0x406563['error'][_0x1fb3('0x15')]);}else{logger[_0x1fb3('0xd')](_0x1fb3('0xe'),_0x40c3a5,_0x1fb3('0xf'));_0x6aaa34(_0x406563[_0x1fb3('0x16')]['message']);}})[_0x1fb3('0x17')](function(_0x24af28){logger[_0x1fb3('0x13')](_0x1fb3('0xe'),_0x40c3a5,_0x24af28);_0x2a3162(_0x24af28);});});} \ No newline at end of file +var _0x394d=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','ChatProactiveAction,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0xf162f7,_0x5b3dd9){var _0x222778=function(_0x425f55){while(--_0x425f55){_0xf162f7['push'](_0xf162f7['shift']());}};_0x222778(++_0x5b3dd9);}(_0x394d,0xa5));var _0xd394=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x394d[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xd394('0x0'));var util=require(_0xd394('0x1'));var moment=require(_0xd394('0x2'));var BPromise=require('bluebird');var rs=require(_0xd394('0x3'));var fs=require('fs');var Redis=require(_0xd394('0x4'));var db=require(_0xd394('0x5'))['db'];var utils=require(_0xd394('0x6'));var logger=require('../../config/logger')(_0xd394('0x7'));var config=require(_0xd394('0x8'));var jayson=require(_0xd394('0x9'));var client=jayson[_0xd394('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1504aa,_0x5a1ca9,_0x4de358){return new BPromise(function(_0x371449,_0x60fea){return client[_0xd394('0xb')](_0x1504aa,_0x4de358)[_0xd394('0xc')](function(_0x646ab0){logger[_0xd394('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x5a1ca9,_0xd394('0xe'));logger['debug'](_0xd394('0xf'),_0x5a1ca9,_0xd394('0xe'),JSON['stringify'](_0x646ab0));if(_0x646ab0['error']){if(_0x646ab0[_0xd394('0x10')]['code']===0x1f4){logger[_0xd394('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5a1ca9,_0x646ab0[_0xd394('0x10')][_0xd394('0x11')]);return _0x60fea(_0x646ab0[_0xd394('0x10')]['message']);}logger[_0xd394('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5a1ca9,_0x646ab0[_0xd394('0x10')][_0xd394('0x11')]);return _0x371449(_0x646ab0[_0xd394('0x10')][_0xd394('0x11')]);}else{logger['info'](_0xd394('0x12'),_0x5a1ca9,_0xd394('0xe'));_0x371449(_0x646ab0[_0xd394('0x13')][_0xd394('0x11')]);}})['catch'](function(_0x1afc62){logger[_0xd394('0x10')](_0xd394('0x12'),_0x5a1ca9,_0x1afc62);_0x60fea(_0x1afc62);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 9d1ff2f..e88e325 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 _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0xbc913a,_0x459db2){var _0x83413b=function(_0x505717){while(--_0x505717){_0xbc913a['push'](_0xbc913a['shift']());}};_0x83413b(++_0x459db2);}(_0x2d17,0x17e));var _0x72d1=function(_0x32963c,_0x45d1c7){_0x32963c=_0x32963c-0x0;var _0x1b7b7e=_0x2d17[_0x32963c];return _0x1b7b7e;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0x9')]);router['post']('/',auth[_0x72d1('0x8')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xe')]);module[_0x72d1('0xf')]=router; \ No newline at end of file +var _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x415b7e,_0x26728a){var _0x896434=function(_0x30b94f){while(--_0x30b94f){_0x415b7e['push'](_0x415b7e['shift']());}};_0x896434(++_0x26728a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0x24ca[_0x10f68e];return _0x4c8372;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 4e26e2e..a8c0a92 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 _0xdcbf=['beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xdcbf,0x1ca));var _0xfdcb=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xdcbf[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0xfdcb('0x0'));module[_0xfdcb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfdcb('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfdcb('0x3')]('rrmemory',_0xfdcb('0x4'),_0xfdcb('0x5'))}}; \ No newline at end of file +var _0x8613=['sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x1393b3,_0xd9aab6){var _0x3e3dca=function(_0x4e8b93){while(--_0x4e8b93){_0x1393b3['push'](_0x1393b3['shift']());}};_0x3e3dca(++_0xd9aab6);}(_0x8613,0x1e0));var _0x3861=function(_0x1b3f91,_0x2d7894){_0x1b3f91=_0x1b3f91-0x0;var _0xcbf3a1=_0x8613[_0x1b3f91];return _0xcbf3a1;};'use strict';var Sequelize=require(_0x3861('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3861('0x1')]},'timeout':{'type':Sequelize[_0x3861('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3861('0x3')](_0x3861('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index db61064..e4a7f47 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 _0x99ff=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','where','pick','filter','merge','options','include','rows','show','rawAttributes','includeAll','find','create','body','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserChatQueue','nolimit','order','sort','ChatQueueId','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','getTeams','findOne','Team','addTeams','Agents','online','interface','flatMap','sequelize','findOrCreate','forEach','emit','removeTeams','User','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','ids','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','save','update','destroy','get','UserProfileResource','name','send','index','map','ChatQueue','fieldName','type','key'];(function(_0x5617d0,_0x4e7ed9){var _0x506610=function(_0x2a2795){while(--_0x2a2795){_0x5617d0['push'](_0x5617d0['shift']());}};_0x506610(++_0x4e7ed9);}(_0x99ff,0xf6));var _0xf99f=function(_0x12d6cc,_0x155c63){_0x12d6cc=_0x12d6cc-0x0;var _0x4af7d3=_0x99ff[_0x12d6cc];return _0x4af7d3;};'use strict';var emlformat=require(_0xf99f('0x0'));var rimraf=require(_0xf99f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf99f('0x2'));var rp=require('request-promise');var moment=require(_0xf99f('0x3'));var BPromise=require(_0xf99f('0x4'));var Mustache=require('mustache');var util=require(_0xf99f('0x5'));var path=require(_0xf99f('0x6'));var sox=require(_0xf99f('0x7'));var csv=require(_0xf99f('0x8'));var ejs=require(_0xf99f('0x9'));var fs=require('fs');var fs_extra=require(_0xf99f('0xa'));var _=require(_0xf99f('0xb'));var squel=require('squel');var crypto=require(_0xf99f('0xc'));var jsforce=require(_0xf99f('0xd'));var deskjs=require(_0xf99f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf99f('0xf'));var Papa=require(_0xf99f('0x10'));var Redis=require('ioredis');var authService=require(_0xf99f('0x11'));var qs=require(_0xf99f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf99f('0x13'))(_0xf99f('0x14'));var utils=require(_0xf99f('0x15'));var config=require(_0xf99f('0x16'));var licenseUtil=require(_0xf99f('0x17'));var db=require(_0xf99f('0x18'))['db'];config['redis']=_[_0xf99f('0x19')](config[_0xf99f('0x1a')],{'host':_0xf99f('0x1b'),'port':0x18eb});var socket=require(_0xf99f('0x1c'))(new Redis(config[_0xf99f('0x1a')]));require(_0xf99f('0x1d'))[_0xf99f('0x1e')](socket);var jayson=require(_0xf99f('0x1f'));var client=jayson[_0xf99f('0x20')][_0xf99f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xba4a3f,_0x2a8e98,_0x409a12,_0x45e7ec){return new BPromise(function(_0x3a08bd,_0x4446b5){var _0x4ee553=_0x45e7ec||client;return _0x4ee553[_0xf99f('0x22')](_0xba4a3f,_0x409a12)[_0xf99f('0x23')](function(_0xdcc743){logger[_0xf99f('0x24')]('ChatQueue,\x20%s,\x20%s',_0x2a8e98,_0xf99f('0x25'));logger[_0xf99f('0x26')](_0xf99f('0x27'),_0x2a8e98,'request\x20sent',JSON['stringify'](_0xdcc743));if(_0xdcc743['error']){if(_0xdcc743[_0xf99f('0x28')]['code']===0x1f4){logger[_0xf99f('0x28')](_0xf99f('0x29'),_0x2a8e98,_0xdcc743[_0xf99f('0x28')][_0xf99f('0x2a')]);return _0x4446b5(_0xdcc743[_0xf99f('0x28')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2a8e98,_0xdcc743['error'][_0xf99f('0x2a')]);return _0x3a08bd(_0xdcc743[_0xf99f('0x28')]['message']);}else{logger['info'](_0xf99f('0x29'),_0x2a8e98,_0xf99f('0x25'));_0x3a08bd(_0xdcc743[_0xf99f('0x2b')]['message']);}})[_0xf99f('0x2c')](function(_0x601ed1){logger['error'](_0xf99f('0x29'),_0x2a8e98,_0x601ed1);_0x4446b5(_0x601ed1);});});}function respondWithStatusCode(_0x3b404b,_0x366867){_0x366867=_0x366867||0xcc;return function(_0x5338fc){if(_0x5338fc){return _0x3b404b[_0xf99f('0x2d')](_0x366867);}return _0x3b404b[_0xf99f('0x2e')](_0x366867)[_0xf99f('0x2f')]();};}function respondWithResult(_0xf503d6,_0x14351d){_0x14351d=_0x14351d||0xc8;return function(_0x8b4b76){if(_0x8b4b76){return _0xf503d6[_0xf99f('0x2e')](_0x14351d)['json'](_0x8b4b76);}};}function respondWithFilteredResult(_0x1b8071,_0x2dabfa){return function(_0x16cea8){if(_0x16cea8){var _0x1081b0=typeof _0x2dabfa[_0xf99f('0x30')]==='undefined'&&typeof _0x2dabfa[_0xf99f('0x31')]===_0xf99f('0x32');var _0x25f015=_0x16cea8['count'];var _0x4bd946=_0x1081b0?0x0:_0x2dabfa[_0xf99f('0x30')];var _0x418680=_0x1081b0?_0x16cea8[_0xf99f('0x33')]:_0x2dabfa[_0xf99f('0x30')]+_0x2dabfa[_0xf99f('0x31')];var _0x2bb747;if(_0x418680>=_0x25f015){_0x418680=_0x25f015;_0x2bb747=0xc8;}else{_0x2bb747=0xce;}_0x1b8071[_0xf99f('0x2e')](_0x2bb747);return _0x1b8071[_0xf99f('0x34')]('Content-Range',_0x4bd946+'-'+_0x418680+'/'+_0x25f015)[_0xf99f('0x35')](_0x16cea8);}return null;};}function patchUpdates(_0x48a065){return function(_0x5067ef){try{jsonpatch[_0xf99f('0x36')](_0x5067ef,_0x48a065,!![]);}catch(_0x197575){return BPromise['reject'](_0x197575);}return _0x5067ef[_0xf99f('0x37')]();};}function saveUpdates(_0x287279,_0x28f629){return function(_0x1f6610){if(_0x1f6610){return _0x1f6610[_0xf99f('0x38')](_0x287279)[_0xf99f('0x23')](function(_0x52fc3b){return _0x52fc3b;});}return null;};}function removeEntity(_0x42bbdb,_0x3d5602){return function(_0x525291){if(_0x525291){return _0x525291[_0xf99f('0x39')]()[_0xf99f('0x23')](function(){var _0x13cc65=_0x525291[_0xf99f('0x3a')]({'plain':!![]});var _0xd1583a='ChatQueues';return db[_0xf99f('0x3b')][_0xf99f('0x39')]({'where':{'type':_0xd1583a,'resourceId':_0x13cc65['id']}})[_0xf99f('0x23')](function(){return _0x525291;});})[_0xf99f('0x23')](function(){_0x42bbdb[_0xf99f('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x358fd2,_0x5db0a6){return function(_0x3e361e){if(!_0x3e361e){_0x358fd2['sendStatus'](0x194);}return _0x3e361e;};}function handleError(_0x3a266a,_0x32fdc2){_0x32fdc2=_0x32fdc2||0x1f4;return function(_0x56ec33){logger[_0xf99f('0x28')](_0x56ec33['stack']);if(_0x56ec33[_0xf99f('0x3c')]){delete _0x56ec33[_0xf99f('0x3c')];}_0x3a266a[_0xf99f('0x2e')](_0x32fdc2)[_0xf99f('0x3d')](_0x56ec33);};}exports[_0xf99f('0x3e')]=function(_0x232b4c,_0x448363){var _0x580dc9={},_0x5a952a={},_0x5c3e69={'count':0x0,'rows':[]};var _0x565d83=_[_0xf99f('0x3f')](db[_0xf99f('0x40')]['rawAttributes'],function(_0x7d4e10){return{'name':_0x7d4e10[_0xf99f('0x41')],'type':_0x7d4e10[_0xf99f('0x42')][_0xf99f('0x43')]};});_0x5a952a[_0xf99f('0x44')]=_[_0xf99f('0x3f')](_0x565d83,_0xf99f('0x3c'));_0x5a952a[_0xf99f('0x45')]=_[_0xf99f('0x46')](_0x232b4c[_0xf99f('0x45')]);_0x5a952a[_0xf99f('0x47')]=_['intersection'](_0x5a952a['model'],_0x5a952a[_0xf99f('0x45')]);_0x580dc9[_0xf99f('0x48')]=_[_0xf99f('0x49')](_0x5a952a['model'],qs[_0xf99f('0x4a')](_0x232b4c['query'][_0xf99f('0x4a')]));_0x580dc9[_0xf99f('0x48')]=_0x580dc9[_0xf99f('0x48')][_0xf99f('0x4b')]?_0x580dc9[_0xf99f('0x48')]:_0x5a952a[_0xf99f('0x44')];if(!_0x232b4c[_0xf99f('0x45')][_0xf99f('0x4c')]('nolimit')){_0x580dc9[_0xf99f('0x31')]=qs[_0xf99f('0x31')](_0x232b4c[_0xf99f('0x45')]['limit']);_0x580dc9['offset']=qs['offset'](_0x232b4c['query'][_0xf99f('0x30')]);}_0x580dc9['order']=qs['sort'](_0x232b4c[_0xf99f('0x45')]['sort']);_0x580dc9[_0xf99f('0x4d')]=qs['filters'](_[_0xf99f('0x4e')](_0x232b4c[_0xf99f('0x45')],_0x5a952a[_0xf99f('0x47')]),_0x565d83);if(_0x232b4c[_0xf99f('0x45')][_0xf99f('0x4f')]){_0x580dc9['where']=_['merge'](_0x580dc9[_0xf99f('0x4d')],{'$or':_[_0xf99f('0x3f')](_0x565d83,function(_0x2d3549){if(_0x2d3549[_0xf99f('0x42')]!=='VIRTUAL'){var _0x599f24={};_0x599f24[_0x2d3549[_0xf99f('0x3c')]]={'$like':'%'+_0x232b4c[_0xf99f('0x45')][_0xf99f('0x4f')]+'%'};return _0x599f24;}})});}_0x580dc9=_[_0xf99f('0x50')]({},_0x580dc9,_0x232b4c[_0xf99f('0x51')]);var _0x238d06={'where':_0x580dc9[_0xf99f('0x4d')]};return db[_0xf99f('0x40')][_0xf99f('0x33')](_0x238d06)[_0xf99f('0x23')](function(_0xc36daf){_0x5c3e69['count']=_0xc36daf;if(_0x232b4c[_0xf99f('0x45')]['includeAll']){_0x580dc9[_0xf99f('0x52')]=[{'all':!![]}];}return db[_0xf99f('0x40')]['findAll'](_0x580dc9);})[_0xf99f('0x23')](function(_0x310850){_0x5c3e69[_0xf99f('0x53')]=_0x310850;return _0x5c3e69;})['then'](respondWithFilteredResult(_0x448363,_0x580dc9))[_0xf99f('0x2c')](handleError(_0x448363,null));};exports[_0xf99f('0x54')]=function(_0x3a7fd0,_0x48be37){var _0x1ca25b={'raw':!![],'where':{'id':_0x3a7fd0['params']['id']}},_0x51aee5={};_0x51aee5[_0xf99f('0x44')]=_['keys'](db[_0xf99f('0x40')][_0xf99f('0x55')]);_0x51aee5[_0xf99f('0x45')]=_[_0xf99f('0x46')](_0x3a7fd0[_0xf99f('0x45')]);_0x51aee5[_0xf99f('0x47')]=_['intersection'](_0x51aee5[_0xf99f('0x44')],_0x51aee5[_0xf99f('0x45')]);_0x1ca25b[_0xf99f('0x48')]=_[_0xf99f('0x49')](_0x51aee5['model'],qs[_0xf99f('0x4a')](_0x3a7fd0[_0xf99f('0x45')]['fields']));_0x1ca25b[_0xf99f('0x48')]=_0x1ca25b[_0xf99f('0x48')]['length']?_0x1ca25b[_0xf99f('0x48')]:_0x51aee5[_0xf99f('0x44')];if(_0x3a7fd0[_0xf99f('0x45')][_0xf99f('0x56')]){_0x1ca25b[_0xf99f('0x52')]=[{'all':!![]}];}_0x1ca25b=_[_0xf99f('0x50')]({},_0x1ca25b,_0x3a7fd0[_0xf99f('0x51')]);return db[_0xf99f('0x40')][_0xf99f('0x57')](_0x1ca25b)[_0xf99f('0x23')](handleEntityNotFound(_0x48be37,null))['then'](respondWithResult(_0x48be37,null))['catch'](handleError(_0x48be37,null));};exports[_0xf99f('0x58')]=function(_0x13360a,_0x31e517){return db['ChatQueue']['create'](_0x13360a[_0xf99f('0x59')],{})[_0xf99f('0x23')](function(_0x218424){var _0x45e471=_0x13360a['user'][_0xf99f('0x3a')]({'plain':!![]});if(!_0x45e471)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45e471['role']===_0xf99f('0x5a')){var _0xc5cbcf=_0x218424[_0xf99f('0x3a')]({'plain':!![]});var _0x579ad4=_0xf99f('0x5b');return db[_0xf99f('0x5c')][_0xf99f('0x57')]({'where':{'name':_0x579ad4,'userProfileId':_0x45e471[_0xf99f('0x5d')]},'raw':!![]})[_0xf99f('0x23')](function(_0xf6d305){if(_0xf6d305&&_0xf6d305[_0xf99f('0x5e')]===0x0){return db['UserProfileResource'][_0xf99f('0x58')]({'name':_0xc5cbcf[_0xf99f('0x3c')],'resourceId':_0xc5cbcf['id'],'type':_0xf6d305[_0xf99f('0x3c')],'sectionId':_0xf6d305['id']},{})['then'](function(){return _0x218424;});}else{return _0x218424;}})[_0xf99f('0x2c')](function(_0x4321cd){logger['error'](_0xf99f('0x5f'),_0x4321cd);throw _0x4321cd;});}return _0x218424;})[_0xf99f('0x23')](respondWithResult(_0x31e517,0xc9))[_0xf99f('0x2c')](handleError(_0x31e517,null));};exports[_0xf99f('0x38')]=function(_0x3f668c,_0x3fb6c4){if(_0x3f668c[_0xf99f('0x59')]['id']){delete _0x3f668c[_0xf99f('0x59')]['id'];}return db[_0xf99f('0x40')]['find']({'where':{'id':_0x3f668c[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0x3fb6c4,null))['then'](saveUpdates(_0x3f668c[_0xf99f('0x59')],null))[_0xf99f('0x23')](respondWithResult(_0x3fb6c4,null))[_0xf99f('0x2c')](handleError(_0x3fb6c4,null));};exports['destroy']=function(_0x196f50,_0x2aad09){return db['ChatQueue'][_0xf99f('0x57')]({'where':{'id':_0x196f50[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0x2aad09,null))[_0xf99f('0x23')](removeEntity(_0x2aad09,null))[_0xf99f('0x2c')](handleError(_0x2aad09,null));};exports[_0xf99f('0x61')]=function(_0x4238aa,_0x6b0999){return db['ChatQueue'][_0xf99f('0x61')]()[_0xf99f('0x23')](respondWithResult(_0x6b0999,null))['catch'](handleError(_0x6b0999,null));};exports[_0xf99f('0x62')]=function(_0x4f9da8,_0xcd4a4d,_0x320ab6){var _0x5866c3={'raw':!![],'where':{}},_0x4be4d0={},_0x515dc1;return db[_0xf99f('0x40')]['findOne']({'where':{'id':_0x4f9da8[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0xcd4a4d,null))[_0xf99f('0x23')](function(_0x45f65b){if(_0x45f65b){_0x515dc1=_0x45f65b['get']({'plain':!![]});_0x4be4d0['model']=_['keys'](db[_0xf99f('0x63')][_0xf99f('0x55')]);_0x4be4d0['query']=_[_0xf99f('0x46')](_0x4f9da8[_0xf99f('0x45')]);_0x4be4d0[_0xf99f('0x47')]=_[_0xf99f('0x49')](_0x4be4d0[_0xf99f('0x44')],_0x4be4d0[_0xf99f('0x45')]);_0x5866c3[_0xf99f('0x48')]=_[_0xf99f('0x49')](_0x4be4d0[_0xf99f('0x44')],qs[_0xf99f('0x4a')](_0x4f9da8['query'][_0xf99f('0x4a')]));_0x5866c3[_0xf99f('0x48')]=_0x5866c3[_0xf99f('0x48')][_0xf99f('0x4b')]?_0x5866c3[_0xf99f('0x48')]:_0x4be4d0[_0xf99f('0x44')];if(!_0x4f9da8[_0xf99f('0x45')][_0xf99f('0x4c')](_0xf99f('0x64'))){_0x5866c3['limit']=qs[_0xf99f('0x31')](_0x4f9da8['query'][_0xf99f('0x31')]);_0x5866c3['offset']=qs[_0xf99f('0x30')](_0x4f9da8[_0xf99f('0x45')][_0xf99f('0x30')]);}_0x5866c3[_0xf99f('0x65')]=qs[_0xf99f('0x66')](_0x4f9da8[_0xf99f('0x45')][_0xf99f('0x66')]);_0x5866c3['where']=qs[_0xf99f('0x47')](_['pick'](_0x4f9da8['query'],_0x4be4d0[_0xf99f('0x47')]));_0x5866c3['where'][_0xf99f('0x67')]=_0x45f65b['id'];if(_0x4f9da8[_0xf99f('0x45')][_0xf99f('0x4f')]){_0x5866c3['where']=_[_0xf99f('0x50')](_0x5866c3['where'],{'$or':_['map'](_0x5866c3[_0xf99f('0x48')],function(_0x3472a1){var _0x415ff9={};_0x415ff9[_0x3472a1]={'$like':'%'+_0x4f9da8[_0xf99f('0x45')]['filter']+'%'};return _0x415ff9;})});}_0x5866c3=_[_0xf99f('0x50')]({},_0x5866c3,_0x4f9da8[_0xf99f('0x51')]);return db[_0xf99f('0x63')][_0xf99f('0x68')](_0x5866c3);}})[_0xf99f('0x23')](function(_0x1fa4b2){if(_0x1fa4b2){return db['User'][_0xf99f('0x69')]({'where':{'id':_[_0xf99f('0x3f')](_0x1fa4b2,_0xf99f('0x6a')),'role':_0xf99f('0x6b')},'attributes':['id',_0xf99f('0x3c'),_0xf99f('0x6c'),_0xf99f('0x6d'),'createdAt']});}})[_0xf99f('0x23')](function(_0x46a336){if(_0x46a336){return{'count':_0x46a336[_0xf99f('0x33')],'rows':_[_0xf99f('0x3f')](_0x46a336[_0xf99f('0x53')],function(_0x368a20){return{'membername':_0x368a20[_0xf99f('0x3c')],'UserId':_0x368a20['id'],'queue_name':_0x515dc1['name'],'ChatQueueId':_0x515dc1['id'],'interface':util['format'](_0xf99f('0x6e'),_0xf99f('0x6f'),_0x368a20[_0xf99f('0x3c')]),'penalty':0x0,'paused':_0x368a20[_0xf99f('0x6c')],'createdAt':_0x368a20[_0xf99f('0x70')],'updatedAt':_0x368a20['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf99f('0x23')](respondWithFilteredResult(_0xcd4a4d,_0x5866c3))[_0xf99f('0x2c')](handleError(_0xcd4a4d,null));};exports[_0xf99f('0x71')]=function(_0x10cf98,_0x5011d1,_0x5321bd){var _0x237c5d={};var _0x390228={};var _0x4434cb;var _0x5a14ea;return db[_0xf99f('0x40')][_0xf99f('0x72')]({'where':{'id':_0x10cf98['params']['id']}})['then'](handleEntityNotFound(_0x5011d1,null))['then'](function(_0x511eb0){if(_0x511eb0){_0x4434cb=_0x511eb0;_0x390228[_0xf99f('0x44')]=_['keys'](db[_0xf99f('0x73')][_0xf99f('0x55')]);_0x390228[_0xf99f('0x45')]=_[_0xf99f('0x46')](_0x10cf98[_0xf99f('0x45')]);_0x390228[_0xf99f('0x47')]=_[_0xf99f('0x49')](_0x390228[_0xf99f('0x44')],_0x390228[_0xf99f('0x45')]);_0x237c5d[_0xf99f('0x48')]=_['intersection'](_0x390228['model'],qs[_0xf99f('0x4a')](_0x10cf98[_0xf99f('0x45')][_0xf99f('0x4a')]));_0x237c5d['attributes']=_0x237c5d[_0xf99f('0x48')][_0xf99f('0x4b')]?_0x237c5d[_0xf99f('0x48')]:_0x390228[_0xf99f('0x44')];_0x237c5d[_0xf99f('0x65')]=qs[_0xf99f('0x66')](_0x10cf98[_0xf99f('0x45')][_0xf99f('0x66')]);_0x237c5d['where']=qs['filters'](_[_0xf99f('0x4e')](_0x10cf98[_0xf99f('0x45')],_0x390228[_0xf99f('0x47')]));if(_0x10cf98[_0xf99f('0x45')]['filter']){_0x237c5d['where']=_[_0xf99f('0x50')](_0x237c5d['where'],{'$or':_[_0xf99f('0x3f')](_0x237c5d[_0xf99f('0x48')],function(_0x4d10f8){var _0x27353f={};_0x27353f[_0x4d10f8]={'$like':'%'+_0x10cf98[_0xf99f('0x45')][_0xf99f('0x4f')]+'%'};return _0x27353f;})});}_0x237c5d=_[_0xf99f('0x50')]({},_0x237c5d,_0x10cf98[_0xf99f('0x51')]);return _0x4434cb[_0xf99f('0x71')](_0x237c5d);}})[_0xf99f('0x23')](function(_0x2055a4){if(_0x2055a4){_0x5a14ea=_0x2055a4[_0xf99f('0x4b')];if(!_0x10cf98['query'][_0xf99f('0x4c')](_0xf99f('0x64'))){_0x237c5d[_0xf99f('0x31')]=qs[_0xf99f('0x31')](_0x10cf98[_0xf99f('0x45')][_0xf99f('0x31')]);_0x237c5d[_0xf99f('0x30')]=qs['offset'](_0x10cf98['query'][_0xf99f('0x30')]);}return _0x4434cb['getTeams'](_0x237c5d);}})[_0xf99f('0x23')](function(_0x49da9b){if(_0x49da9b){return _0x49da9b?{'count':_0x5a14ea,'rows':_0x49da9b}:null;}})[_0xf99f('0x23')](respondWithResult(_0x5011d1,null))[_0xf99f('0x2c')](handleError(_0x5011d1,null));};exports[_0xf99f('0x74')]=function(_0x1d4f7a,_0x213953,_0x49bea1){var _0x26a36d=_0x1d4f7a[_0xf99f('0x59')]['ids'];return db[_0xf99f('0x73')][_0xf99f('0x68')]({'where':{'id':_0x26a36d},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf99f('0x75'),'attributes':['id','name',_0xf99f('0x76'),'voicePause',_0xf99f('0x77')],'raw':!![]}]})[_0xf99f('0x23')](function(_0x4cf5a1){if(_0x4cf5a1){var _0x48ef19=_[_0xf99f('0x78')](_0x4cf5a1,function(_0x1195ee){var _0x3585ad=_0x1195ee['get']({'plain':!![]});return _0x3585ad['Agents'];});return db[_0xf99f('0x40')][_0xf99f('0x57')]({'where':{'id':_0x1d4f7a[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](function(_0x3ec6b1){return db[_0xf99f('0x79')]['transaction'](function(_0x13caf8){return _0x3ec6b1[_0xf99f('0x74')](_0x26a36d,{'transaction':_0x13caf8})[_0xf99f('0x23')](function(){return BPromise['each'](_0x48ef19,function(_0x5c9f1e){return db[_0xf99f('0x63')][_0xf99f('0x7a')]({'where':{'UserId':_0x5c9f1e['id'],'ChatQueueId':_0x1d4f7a['params']['id']},'transaction':_0x13caf8});});})[_0xf99f('0x23')](function(){_0x48ef19[_0xf99f('0x7b')](function(_0x46a62b){socket[_0xf99f('0x7c')]('userChatQueue:save',{'UserId':_0x46a62b['id'],'ChatQueueId':_0x3ec6b1['id']});});});});});}})['then'](respondWithStatusCode(_0x213953,null))[_0xf99f('0x2c')](handleError(_0x213953,null));};exports[_0xf99f('0x7d')]=function(_0x3da735,_0xe581e4,_0xedf0ba){return db[_0xf99f('0x73')]['findAll']({'where':{'id':_0x3da735[_0xf99f('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf99f('0x7e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf99f('0x23')](handleEntityNotFound(_0xe581e4,null))[_0xf99f('0x23')](function(_0x5146c8){var _0xd0766d=_[_0xf99f('0x3f')](_0x5146c8,'id');var _0xec2c88=[];var _0xf3e9cd=[];var _0x392450=squel[_0xf99f('0x7f')]();_0x392450[_0xf99f('0x80')](_0xf99f('0x81'))[_0xf99f('0x82')](_0xf99f('0x83'),'tq')[_0xf99f('0x84')](_0xf99f('0x85'),'ut',_0xf99f('0x86'))[_0xf99f('0x4d')](_0xf99f('0x87'),_0x3da735['params']['id']);for(var _0x126ca2=0x0;_0x126ca2<_0x5146c8[_0xf99f('0x4b')];_0x126ca2+=0x1){let _0x2ca933=_0x5146c8[_0x126ca2];for(var _0x164161=0x0;_0x164161<_0x2ca933['Agents'][_0xf99f('0x4b')];_0x164161+=0x1){let _0x4748f3=_0x2ca933[_0xf99f('0x75')][_0x164161];var _0x5808be=_0x392450['clone']();_0x5808be[_0xf99f('0x4d')]('ut.UserId\x20=\x20?',_0x4748f3['id']);_0xf3e9cd[_0xf99f('0x88')](db['sequelize'][_0xf99f('0x45')](_0x5808be[_0xf99f('0x89')](),{'type':db[_0xf99f('0x79')]['QueryTypes'][_0xf99f('0x8a')]})[_0xf99f('0x23')](function(_0x561c86){if(_0x561c86[_0xf99f('0x4b')]===0x1){return _0x4748f3['id'];}else{var _0xfa75c1=_[_0xf99f('0x8b')](_[_0xf99f('0x3f')](_0x561c86,_0xf99f('0x8c')),function(_0x2853c1){return _[_0xf99f('0x8d')](_0xd0766d,_0x2853c1);});if(_0xfa75c1){return _0x4748f3['id'];}}}));}}return BPromise[_0xf99f('0x8e')](_0xf3e9cd)[_0xf99f('0x23')](function(_0x5cc6f9){_0xec2c88=_(_0xec2c88)[_0xf99f('0x8f')](_0x5cc6f9)[_0xf99f('0x90')]()[_0xf99f('0x91')]();return db[_0xf99f('0x40')]['find']({'where':{'id':_0x3da735[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](function(_0x42d067){return db['sequelize'][_0xf99f('0x92')](function(_0x2ad3f3){return _0x42d067['removeTeams'](_0x3da735[_0xf99f('0x45')]['ids'],{'transaction':_0x2ad3f3})[_0xf99f('0x23')](function(){if(!_[_0xf99f('0x93')](_0xec2c88)){return _0x42d067[_0xf99f('0x94')](_0xec2c88,{'transaction':_0x2ad3f3});}})[_0xf99f('0x23')](function(){_0xec2c88[_0xf99f('0x7b')](function(_0x42a838){socket[_0xf99f('0x7c')]('userChatQueue:remove',{'UserId':_0x42a838,'ChatQueueId':_0x42d067['id']});});});});});});})[_0xf99f('0x23')](respondWithStatusCode(_0xe581e4,null))['catch'](handleError(_0xe581e4,null));};exports[_0xf99f('0x95')]=function(_0x4a1d79,_0x5e44fa,_0x143d35){return db[_0xf99f('0x40')][_0xf99f('0x57')]({'where':{'id':_0x4a1d79[_0xf99f('0x60')]['id']}})['then'](handleEntityNotFound(_0x5e44fa,null))[_0xf99f('0x23')](function(_0x5078ab){if(_0x5078ab){return _0x5078ab[_0xf99f('0x95')](_0x4a1d79['body'][_0xf99f('0x96')],_[_0xf99f('0x97')](_0x4a1d79['body'],[_0xf99f('0x96'),'id'])||{})[_0xf99f('0x98')](function(_0x2b2785){for(var _0x2c5394=0x0;_0x2c5394<_0x4a1d79['body'][_0xf99f('0x96')][_0xf99f('0x4b')];_0x2c5394+=0x1){socket[_0xf99f('0x7c')](_0xf99f('0x99'),{'UserId':Number(_0x4a1d79[_0xf99f('0x59')]['ids'][_0x2c5394]),'ChatQueueId':Number(_0x4a1d79[_0xf99f('0x60')]['id'])});}return _0x2b2785;});}})[_0xf99f('0x23')](respondWithResult(_0x5e44fa,null))[_0xf99f('0x2c')](handleError(_0x5e44fa,null));};exports[_0xf99f('0x94')]=function(_0xa02d70,_0x1a537,_0x1cc9d7){return db['ChatQueue'][_0xf99f('0x57')]({'where':{'id':_0xa02d70[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0x1a537,null))[_0xf99f('0x23')](function(_0x173b1d){if(_0x173b1d){return _0x173b1d[_0xf99f('0x94')](_0xa02d70[_0xf99f('0x45')]['ids'])[_0xf99f('0x23')](function(){if(_[_0xf99f('0x9a')](_0xa02d70[_0xf99f('0x45')]['ids'])){for(var _0x21bdf4=0x0;_0x21bdf4<_0xa02d70[_0xf99f('0x45')][_0xf99f('0x96')][_0xf99f('0x4b')];_0x21bdf4+=0x1){socket[_0xf99f('0x7c')](_0xf99f('0x9b'),{'UserId':Number(_0xa02d70[_0xf99f('0x45')]['ids'][_0x21bdf4]),'ChatQueueId':Number(_0xa02d70[_0xf99f('0x60')]['id'])});}}else{socket[_0xf99f('0x7c')]('userChatQueue:remove',{'UserId':Number(_0xa02d70[_0xf99f('0x45')][_0xf99f('0x96')]),'ChatQueueId':Number(_0xa02d70[_0xf99f('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a537,null))[_0xf99f('0x2c')](handleError(_0x1a537,null));};exports[_0xf99f('0x9c')]=function(_0x5d6c87,_0x2e7970,_0x5783e0){var _0x1b6861={};var _0x16e413={};var _0x56378d;var _0x3f5c19;return db[_0xf99f('0x40')]['findOne']({'where':{'id':_0x5d6c87['params']['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0x2e7970,null))[_0xf99f('0x23')](function(_0x5b9d34){if(_0x5b9d34){_0x56378d=_0x5b9d34;_0x16e413[_0xf99f('0x44')]=_[_0xf99f('0x46')](db['User']['rawAttributes']);_0x16e413[_0xf99f('0x45')]=_[_0xf99f('0x46')](_0x5d6c87[_0xf99f('0x45')]);_0x16e413[_0xf99f('0x47')]=_[_0xf99f('0x49')](_0x16e413[_0xf99f('0x44')],_0x16e413[_0xf99f('0x45')]);_0x1b6861[_0xf99f('0x48')]=_[_0xf99f('0x49')](_0x16e413[_0xf99f('0x44')],qs['fields'](_0x5d6c87[_0xf99f('0x45')][_0xf99f('0x4a')]));_0x1b6861[_0xf99f('0x48')]=_0x1b6861[_0xf99f('0x48')][_0xf99f('0x4b')]?_0x1b6861[_0xf99f('0x48')]:_0x16e413[_0xf99f('0x44')];_0x1b6861[_0xf99f('0x65')]=qs[_0xf99f('0x66')](_0x5d6c87['query'][_0xf99f('0x66')]);_0x1b6861['where']=qs[_0xf99f('0x47')](_[_0xf99f('0x4e')](_0x5d6c87[_0xf99f('0x45')],_0x16e413['filters']));if(_0x5d6c87[_0xf99f('0x45')][_0xf99f('0x4f')]){_0x1b6861['where']=_[_0xf99f('0x50')](_0x1b6861['where'],{'$or':_[_0xf99f('0x3f')](_0x1b6861['attributes'],function(_0x2441eb){var _0x68a935={};_0x68a935[_0x2441eb]={'$like':'%'+_0x5d6c87[_0xf99f('0x45')]['filter']+'%'};return _0x68a935;})});}_0x1b6861=_[_0xf99f('0x50')]({},_0x1b6861,_0x5d6c87['options']);return _0x56378d[_0xf99f('0x9c')](_0x1b6861);}})['then'](function(_0x2def6f){if(_0x2def6f){_0x3f5c19=_0x2def6f[_0xf99f('0x4b')];if(!_0x5d6c87[_0xf99f('0x45')]['hasOwnProperty']('nolimit')){_0x1b6861[_0xf99f('0x31')]=qs['limit'](_0x5d6c87['query'][_0xf99f('0x31')]);_0x1b6861[_0xf99f('0x30')]=qs[_0xf99f('0x30')](_0x5d6c87[_0xf99f('0x45')][_0xf99f('0x30')]);}return _0x56378d[_0xf99f('0x9c')](_0x1b6861);}})[_0xf99f('0x23')](function(_0x578e90){if(_0x578e90){return _0x578e90?{'count':_0x3f5c19,'rows':_0x578e90}:null;}})[_0xf99f('0x23')](respondWithResult(_0x2e7970,null))[_0xf99f('0x2c')](handleError(_0x2e7970,null));}; \ No newline at end of file +var _0xc5a1=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','name','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','ChatQueue','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','hasOwnProperty','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','length','ids','Team','User','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x391e31,_0x1a551c){var _0xfeb791=function(_0x26fc67){while(--_0x26fc67){_0x391e31['push'](_0x391e31['shift']());}};_0xfeb791(++_0x1a551c);}(_0xc5a1,0x1c6));var _0x1c5a=function(_0xf62f27,_0x249f1d){_0xf62f27=_0xf62f27-0x0;var _0x4f7985=_0xc5a1[_0xf62f27];return _0x4f7985;};'use strict';var emlformat=require(_0x1c5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c5a('0x1'));var jsonpatch=require(_0x1c5a('0x2'));var rp=require('request-promise');var moment=require(_0x1c5a('0x3'));var BPromise=require(_0x1c5a('0x4'));var Mustache=require(_0x1c5a('0x5'));var util=require(_0x1c5a('0x6'));var path=require(_0x1c5a('0x7'));var sox=require(_0x1c5a('0x8'));var csv=require(_0x1c5a('0x9'));var ejs=require(_0x1c5a('0xa'));var fs=require('fs');var fs_extra=require(_0x1c5a('0xb'));var _=require(_0x1c5a('0xc'));var squel=require('squel');var crypto=require(_0x1c5a('0xd'));var jsforce=require(_0x1c5a('0xe'));var deskjs=require(_0x1c5a('0xf'));var toCsv=require(_0x1c5a('0x9'));var querystring=require(_0x1c5a('0x10'));var Papa=require('papaparse');var Redis=require(_0x1c5a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1c5a('0x12'));var as=require(_0x1c5a('0x13'));var hardwareService=require(_0x1c5a('0x14'));var logger=require('../../config/logger')(_0x1c5a('0x15'));var utils=require(_0x1c5a('0x16'));var config=require(_0x1c5a('0x17'));var licenseUtil=require(_0x1c5a('0x18'));var db=require('../../mysqldb')['db'];config[_0x1c5a('0x19')]=_[_0x1c5a('0x1a')](config[_0x1c5a('0x19')],{'host':_0x1c5a('0x1b'),'port':0x18eb});var socket=require(_0x1c5a('0x1c'))(new Redis(config['redis']));require(_0x1c5a('0x1d'))[_0x1c5a('0x1e')](socket);var jayson=require(_0x1c5a('0x1f'));var client=jayson[_0x1c5a('0x20')][_0x1c5a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x51fed7,_0x395638,_0x47710e,_0x2a7da7){return new BPromise(function(_0x2680e1,_0x1a8b23){var _0x2c5157=_0x2a7da7||client;return _0x2c5157[_0x1c5a('0x22')](_0x51fed7,_0x47710e)[_0x1c5a('0x23')](function(_0x2732e1){logger[_0x1c5a('0x24')]('ChatQueue,\x20%s,\x20%s',_0x395638,_0x1c5a('0x25'));logger[_0x1c5a('0x26')](_0x1c5a('0x27'),_0x395638,_0x1c5a('0x25'),JSON[_0x1c5a('0x28')](_0x2732e1));if(_0x2732e1[_0x1c5a('0x29')]){if(_0x2732e1[_0x1c5a('0x29')][_0x1c5a('0x2a')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x395638,_0x2732e1[_0x1c5a('0x29')][_0x1c5a('0x2b')]);return _0x1a8b23(_0x2732e1[_0x1c5a('0x29')][_0x1c5a('0x2b')]);}logger[_0x1c5a('0x29')](_0x1c5a('0x2c'),_0x395638,_0x2732e1[_0x1c5a('0x29')]['message']);return _0x2680e1(_0x2732e1['error'][_0x1c5a('0x2b')]);}else{logger[_0x1c5a('0x24')]('ChatQueue,\x20%s,\x20%s',_0x395638,'request\x20sent');_0x2680e1(_0x2732e1[_0x1c5a('0x2d')]['message']);}})['catch'](function(_0x43ff34){logger[_0x1c5a('0x29')](_0x1c5a('0x2c'),_0x395638,_0x43ff34);_0x1a8b23(_0x43ff34);});});}function respondWithStatusCode(_0x26686b,_0x4db404){_0x4db404=_0x4db404||0xcc;return function(_0x186672){if(_0x186672){return _0x26686b['sendStatus'](_0x4db404);}return _0x26686b[_0x1c5a('0x2e')](_0x4db404)[_0x1c5a('0x2f')]();};}function respondWithResult(_0x3053d2,_0x2f5cd2){_0x2f5cd2=_0x2f5cd2||0xc8;return function(_0x937f53){if(_0x937f53){return _0x3053d2[_0x1c5a('0x2e')](_0x2f5cd2)['json'](_0x937f53);}};}function respondWithFilteredResult(_0x50950e,_0x5654a5){return function(_0x57c2ac){if(_0x57c2ac){var _0x3c08e5=typeof _0x5654a5[_0x1c5a('0x30')]===_0x1c5a('0x31')&&typeof _0x5654a5[_0x1c5a('0x32')]==='undefined';var _0x1f6e2a=_0x57c2ac[_0x1c5a('0x33')];var _0x270fd0=_0x3c08e5?0x0:_0x5654a5['offset'];var _0x2adfb2=_0x3c08e5?_0x57c2ac['count']:_0x5654a5['offset']+_0x5654a5[_0x1c5a('0x32')];var _0x4938cc;if(_0x2adfb2>=_0x1f6e2a){_0x2adfb2=_0x1f6e2a;_0x4938cc=0xc8;}else{_0x4938cc=0xce;}_0x50950e[_0x1c5a('0x2e')](_0x4938cc);return _0x50950e['set'](_0x1c5a('0x34'),_0x270fd0+'-'+_0x2adfb2+'/'+_0x1f6e2a)[_0x1c5a('0x35')](_0x57c2ac);}return null;};}function patchUpdates(_0x5af217){return function(_0x1d9cec){try{jsonpatch['apply'](_0x1d9cec,_0x5af217,!![]);}catch(_0x4bd149){return BPromise[_0x1c5a('0x36')](_0x4bd149);}return _0x1d9cec['save']();};}function saveUpdates(_0x4f1a4a,_0xf47951){return function(_0x911ebb){if(_0x911ebb){return _0x911ebb[_0x1c5a('0x37')](_0x4f1a4a)[_0x1c5a('0x23')](function(_0x53146f){return _0x53146f;});}return null;};}function removeEntity(_0x44a015,_0x25ab2f){return function(_0x449304){if(_0x449304){return _0x449304[_0x1c5a('0x38')]()[_0x1c5a('0x23')](function(){var _0x14020d=_0x449304[_0x1c5a('0x39')]({'plain':!![]});var _0x22868d=_0x1c5a('0x3a');return db[_0x1c5a('0x3b')][_0x1c5a('0x38')]({'where':{'type':_0x22868d,'resourceId':_0x14020d['id']}})[_0x1c5a('0x23')](function(){return _0x449304;});})[_0x1c5a('0x23')](function(){_0x44a015['status'](0xcc)[_0x1c5a('0x2f')]();});}};}function handleEntityNotFound(_0x395a40,_0x4cbd56){return function(_0x4bb2d0){if(!_0x4bb2d0){_0x395a40[_0x1c5a('0x3c')](0x194);}return _0x4bb2d0;};}function handleError(_0x2af4ce,_0x37b2c2){_0x37b2c2=_0x37b2c2||0x1f4;return function(_0x43b8b2){logger['error'](_0x43b8b2['stack']);if(_0x43b8b2[_0x1c5a('0x3d')]){delete _0x43b8b2['name'];}_0x2af4ce['status'](_0x37b2c2)['send'](_0x43b8b2);};}exports['index']=function(_0x3b55a5,_0x137091){var _0x3df99d={},_0x1e4dc0={},_0x120629={'count':0x0,'rows':[]};var _0x514279=_['map'](db['ChatQueue'][_0x1c5a('0x3e')],function(_0x1bd09c){return{'name':_0x1bd09c['fieldName'],'type':_0x1bd09c[_0x1c5a('0x3f')][_0x1c5a('0x40')]};});_0x1e4dc0[_0x1c5a('0x41')]=_[_0x1c5a('0x42')](_0x514279,'name');_0x1e4dc0[_0x1c5a('0x43')]=_[_0x1c5a('0x44')](_0x3b55a5[_0x1c5a('0x43')]);_0x1e4dc0[_0x1c5a('0x45')]=_[_0x1c5a('0x46')](_0x1e4dc0[_0x1c5a('0x41')],_0x1e4dc0['query']);_0x3df99d[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x1e4dc0[_0x1c5a('0x41')],qs['fields'](_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x48')]));_0x3df99d[_0x1c5a('0x47')]=_0x3df99d[_0x1c5a('0x47')]['length']?_0x3df99d['attributes']:_0x1e4dc0[_0x1c5a('0x41')];if(!_0x3b55a5[_0x1c5a('0x43')]['hasOwnProperty'](_0x1c5a('0x49'))){_0x3df99d[_0x1c5a('0x32')]=qs[_0x1c5a('0x32')](_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x32')]);_0x3df99d[_0x1c5a('0x30')]=qs[_0x1c5a('0x30')](_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x30')]);}_0x3df99d[_0x1c5a('0x4a')]=qs[_0x1c5a('0x4b')](_0x3b55a5['query'][_0x1c5a('0x4b')]);_0x3df99d[_0x1c5a('0x4c')]=qs[_0x1c5a('0x45')](_[_0x1c5a('0x4d')](_0x3b55a5[_0x1c5a('0x43')],_0x1e4dc0[_0x1c5a('0x45')]),_0x514279);if(_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x4e')]){_0x3df99d[_0x1c5a('0x4c')]=_['merge'](_0x3df99d['where'],{'$or':_[_0x1c5a('0x42')](_0x514279,function(_0x2142fc){if(_0x2142fc['type']!==_0x1c5a('0x4f')){var _0xe2f28b={};_0xe2f28b[_0x2142fc['name']]={'$like':'%'+_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x4e')]+'%'};return _0xe2f28b;}})});}_0x3df99d=_[_0x1c5a('0x50')]({},_0x3df99d,_0x3b55a5[_0x1c5a('0x51')]);var _0x4ab583={'where':_0x3df99d[_0x1c5a('0x4c')]};return db[_0x1c5a('0x52')][_0x1c5a('0x33')](_0x4ab583)['then'](function(_0x3a2567){_0x120629[_0x1c5a('0x33')]=_0x3a2567;if(_0x3b55a5['query'][_0x1c5a('0x53')]){_0x3df99d[_0x1c5a('0x54')]=[{'all':!![]}];}return db['ChatQueue'][_0x1c5a('0x55')](_0x3df99d);})['then'](function(_0x3da43e){_0x120629[_0x1c5a('0x56')]=_0x3da43e;return _0x120629;})[_0x1c5a('0x23')](respondWithFilteredResult(_0x137091,_0x3df99d))[_0x1c5a('0x57')](handleError(_0x137091,null));};exports[_0x1c5a('0x58')]=function(_0x4d5c3e,_0x390f3b){var _0xac44f7={'raw':!![],'where':{'id':_0x4d5c3e[_0x1c5a('0x59')]['id']}},_0x20ae39={};_0x20ae39[_0x1c5a('0x41')]=_[_0x1c5a('0x44')](db[_0x1c5a('0x52')][_0x1c5a('0x3e')]);_0x20ae39[_0x1c5a('0x43')]=_[_0x1c5a('0x44')](_0x4d5c3e[_0x1c5a('0x43')]);_0x20ae39[_0x1c5a('0x45')]=_[_0x1c5a('0x46')](_0x20ae39[_0x1c5a('0x41')],_0x20ae39['query']);_0xac44f7[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x20ae39['model'],qs[_0x1c5a('0x48')](_0x4d5c3e['query'][_0x1c5a('0x48')]));_0xac44f7['attributes']=_0xac44f7['attributes']['length']?_0xac44f7['attributes']:_0x20ae39[_0x1c5a('0x41')];if(_0x4d5c3e['query'][_0x1c5a('0x53')]){_0xac44f7[_0x1c5a('0x54')]=[{'all':!![]}];}_0xac44f7=_[_0x1c5a('0x50')]({},_0xac44f7,_0x4d5c3e[_0x1c5a('0x51')]);return db[_0x1c5a('0x52')][_0x1c5a('0x5a')](_0xac44f7)[_0x1c5a('0x23')](handleEntityNotFound(_0x390f3b,null))[_0x1c5a('0x23')](respondWithResult(_0x390f3b,null))['catch'](handleError(_0x390f3b,null));};exports[_0x1c5a('0x5b')]=function(_0x3c66cb,_0x1b60fa){return db[_0x1c5a('0x52')][_0x1c5a('0x5b')](_0x3c66cb[_0x1c5a('0x5c')],{})['then'](function(_0x48c110){var _0xa3064a=_0x3c66cb['user'][_0x1c5a('0x39')]({'plain':!![]});if(!_0xa3064a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa3064a[_0x1c5a('0x5d')]===_0x1c5a('0x5e')){var _0x197b3a=_0x48c110['get']({'plain':!![]});var _0x439b42=_0x1c5a('0x3a');return db[_0x1c5a('0x5f')][_0x1c5a('0x5a')]({'where':{'name':_0x439b42,'userProfileId':_0xa3064a[_0x1c5a('0x60')]},'raw':!![]})[_0x1c5a('0x23')](function(_0x536b00){if(_0x536b00&&_0x536b00['autoAssociation']===0x0){return db[_0x1c5a('0x3b')][_0x1c5a('0x5b')]({'name':_0x197b3a[_0x1c5a('0x3d')],'resourceId':_0x197b3a['id'],'type':_0x536b00[_0x1c5a('0x3d')],'sectionId':_0x536b00['id']},{})[_0x1c5a('0x23')](function(){return _0x48c110;});}else{return _0x48c110;}})[_0x1c5a('0x57')](function(_0x10f1c3){logger[_0x1c5a('0x29')](_0x1c5a('0x61'),_0x10f1c3);throw _0x10f1c3;});}return _0x48c110;})[_0x1c5a('0x23')](respondWithResult(_0x1b60fa,0xc9))[_0x1c5a('0x57')](handleError(_0x1b60fa,null));};exports['update']=function(_0x2f1c92,_0x46fa90){if(_0x2f1c92[_0x1c5a('0x5c')]['id']){delete _0x2f1c92[_0x1c5a('0x5c')]['id'];}return db[_0x1c5a('0x52')]['find']({'where':{'id':_0x2f1c92[_0x1c5a('0x59')]['id']}})[_0x1c5a('0x23')](handleEntityNotFound(_0x46fa90,null))['then'](saveUpdates(_0x2f1c92[_0x1c5a('0x5c')],null))[_0x1c5a('0x23')](respondWithResult(_0x46fa90,null))[_0x1c5a('0x57')](handleError(_0x46fa90,null));};exports[_0x1c5a('0x38')]=function(_0x5f5094,_0x40f996){return db[_0x1c5a('0x52')][_0x1c5a('0x5a')]({'where':{'id':_0x5f5094[_0x1c5a('0x59')]['id']}})[_0x1c5a('0x23')](handleEntityNotFound(_0x40f996,null))[_0x1c5a('0x23')](removeEntity(_0x40f996,null))[_0x1c5a('0x57')](handleError(_0x40f996,null));};exports[_0x1c5a('0x62')]=function(_0x3f8513,_0x2bd4c2){return db['ChatQueue']['describe']()[_0x1c5a('0x23')](respondWithResult(_0x2bd4c2,null))[_0x1c5a('0x57')](handleError(_0x2bd4c2,null));};exports[_0x1c5a('0x63')]=function(_0x40d321,_0x3aabcc,_0x13df72){var _0x4476f5={'raw':!![],'where':{}},_0x1ace38={},_0x507b8c;return db[_0x1c5a('0x52')]['findOne']({'where':{'id':_0x40d321[_0x1c5a('0x59')]['id']}})['then'](handleEntityNotFound(_0x3aabcc,null))[_0x1c5a('0x23')](function(_0x2ebf35){if(_0x2ebf35){_0x507b8c=_0x2ebf35[_0x1c5a('0x39')]({'plain':!![]});_0x1ace38[_0x1c5a('0x41')]=_[_0x1c5a('0x44')](db[_0x1c5a('0x64')][_0x1c5a('0x3e')]);_0x1ace38[_0x1c5a('0x43')]=_['keys'](_0x40d321[_0x1c5a('0x43')]);_0x1ace38[_0x1c5a('0x45')]=_[_0x1c5a('0x46')](_0x1ace38['model'],_0x1ace38[_0x1c5a('0x43')]);_0x4476f5[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x1ace38['model'],qs['fields'](_0x40d321[_0x1c5a('0x43')]['fields']));_0x4476f5[_0x1c5a('0x47')]=_0x4476f5[_0x1c5a('0x47')]['length']?_0x4476f5['attributes']:_0x1ace38[_0x1c5a('0x41')];if(!_0x40d321['query'][_0x1c5a('0x65')]('nolimit')){_0x4476f5[_0x1c5a('0x32')]=qs[_0x1c5a('0x32')](_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x32')]);_0x4476f5['offset']=qs['offset'](_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x30')]);}_0x4476f5[_0x1c5a('0x4a')]=qs[_0x1c5a('0x4b')](_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x4b')]);_0x4476f5[_0x1c5a('0x4c')]=qs[_0x1c5a('0x45')](_[_0x1c5a('0x4d')](_0x40d321[_0x1c5a('0x43')],_0x1ace38[_0x1c5a('0x45')]));_0x4476f5[_0x1c5a('0x4c')][_0x1c5a('0x66')]=_0x2ebf35['id'];if(_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x4e')]){_0x4476f5[_0x1c5a('0x4c')]=_[_0x1c5a('0x50')](_0x4476f5[_0x1c5a('0x4c')],{'$or':_[_0x1c5a('0x42')](_0x4476f5[_0x1c5a('0x47')],function(_0x5123a4){var _0x5457e8={};_0x5457e8[_0x5123a4]={'$like':'%'+_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x4e')]+'%'};return _0x5457e8;})});}_0x4476f5=_[_0x1c5a('0x50')]({},_0x4476f5,_0x40d321[_0x1c5a('0x51')]);return db['UserChatQueue'][_0x1c5a('0x55')](_0x4476f5);}})[_0x1c5a('0x23')](function(_0x4f360b){if(_0x4f360b){return db['User'][_0x1c5a('0x67')]({'where':{'id':_[_0x1c5a('0x42')](_0x4f360b,'UserId'),'role':_0x1c5a('0x68')},'attributes':['id',_0x1c5a('0x3d'),_0x1c5a('0x69'),_0x1c5a('0x6a'),_0x1c5a('0x6b')]});}})[_0x1c5a('0x23')](function(_0x5eb9bb){if(_0x5eb9bb){return{'count':_0x5eb9bb[_0x1c5a('0x33')],'rows':_[_0x1c5a('0x42')](_0x5eb9bb[_0x1c5a('0x56')],function(_0x222c20){return{'membername':_0x222c20[_0x1c5a('0x3d')],'UserId':_0x222c20['id'],'queue_name':_0x507b8c[_0x1c5a('0x3d')],'ChatQueueId':_0x507b8c['id'],'interface':util[_0x1c5a('0x6c')](_0x1c5a('0x6d'),_0x1c5a('0x6e'),_0x222c20[_0x1c5a('0x3d')]),'penalty':0x0,'paused':_0x222c20[_0x1c5a('0x69')],'createdAt':_0x222c20[_0x1c5a('0x6b')],'updatedAt':_0x222c20['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x1c5a('0x23')](respondWithFilteredResult(_0x3aabcc,_0x4476f5))[_0x1c5a('0x57')](handleError(_0x3aabcc,null));};exports[_0x1c5a('0x6f')]=function(_0x268bd2,_0xfe17c6,_0x16b8b7){var _0x2fc9b8={};var _0x3e7351={};var _0x1c3473;var _0x5c74a0;return db[_0x1c5a('0x52')][_0x1c5a('0x70')]({'where':{'id':_0x268bd2[_0x1c5a('0x59')]['id']}})['then'](handleEntityNotFound(_0xfe17c6,null))[_0x1c5a('0x23')](function(_0x3a592d){if(_0x3a592d){_0x1c3473=_0x3a592d;_0x3e7351['model']=_[_0x1c5a('0x44')](db['Team'][_0x1c5a('0x3e')]);_0x3e7351['query']=_['keys'](_0x268bd2[_0x1c5a('0x43')]);_0x3e7351[_0x1c5a('0x45')]=_[_0x1c5a('0x46')](_0x3e7351[_0x1c5a('0x41')],_0x3e7351[_0x1c5a('0x43')]);_0x2fc9b8[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x3e7351[_0x1c5a('0x41')],qs[_0x1c5a('0x48')](_0x268bd2[_0x1c5a('0x43')][_0x1c5a('0x48')]));_0x2fc9b8['attributes']=_0x2fc9b8[_0x1c5a('0x47')][_0x1c5a('0x71')]?_0x2fc9b8['attributes']:_0x3e7351[_0x1c5a('0x41')];_0x2fc9b8[_0x1c5a('0x4a')]=qs[_0x1c5a('0x4b')](_0x268bd2[_0x1c5a('0x43')][_0x1c5a('0x4b')]);_0x2fc9b8[_0x1c5a('0x4c')]=qs[_0x1c5a('0x45')](_[_0x1c5a('0x4d')](_0x268bd2['query'],_0x3e7351['filters']));if(_0x268bd2[_0x1c5a('0x43')]['filter']){_0x2fc9b8[_0x1c5a('0x4c')]=_[_0x1c5a('0x50')](_0x2fc9b8[_0x1c5a('0x4c')],{'$or':_[_0x1c5a('0x42')](_0x2fc9b8[_0x1c5a('0x47')],function(_0x49874f){var _0x3b685e={};_0x3b685e[_0x49874f]={'$like':'%'+_0x268bd2[_0x1c5a('0x43')]['filter']+'%'};return _0x3b685e;})});}_0x2fc9b8=_[_0x1c5a('0x50')]({},_0x2fc9b8,_0x268bd2['options']);return _0x1c3473['getTeams'](_0x2fc9b8);}})[_0x1c5a('0x23')](function(_0x59f6ca){if(_0x59f6ca){_0x5c74a0=_0x59f6ca['length'];if(!_0x268bd2['query'][_0x1c5a('0x65')](_0x1c5a('0x49'))){_0x2fc9b8[_0x1c5a('0x32')]=qs['limit'](_0x268bd2['query'][_0x1c5a('0x32')]);_0x2fc9b8[_0x1c5a('0x30')]=qs['offset'](_0x268bd2[_0x1c5a('0x43')]['offset']);}return _0x1c3473[_0x1c5a('0x6f')](_0x2fc9b8);}})['then'](function(_0x4925c5){if(_0x4925c5){return _0x4925c5?{'count':_0x5c74a0,'rows':_0x4925c5}:null;}})['then'](respondWithResult(_0xfe17c6,null))[_0x1c5a('0x57')](handleError(_0xfe17c6,null));};exports['addTeams']=function(_0x5c0821,_0x4e0b58,_0x569181){var _0x7f59f4=_0x5c0821['body'][_0x1c5a('0x72')];return db[_0x1c5a('0x73')][_0x1c5a('0x55')]({'where':{'id':_0x7f59f4},'attributes':['id'],'include':[{'model':db[_0x1c5a('0x74')],'as':_0x1c5a('0x75'),'attributes':['id',_0x1c5a('0x3d'),_0x1c5a('0x76'),_0x1c5a('0x77'),'interface'],'raw':!![]}]})[_0x1c5a('0x23')](function(_0x1c328c){if(_0x1c328c){var _0x22b04b=_[_0x1c5a('0x78')](_0x1c328c,function(_0x4557e2){var _0x9d00f9=_0x4557e2['get']({'plain':!![]});return _0x9d00f9[_0x1c5a('0x75')];});return db[_0x1c5a('0x52')]['find']({'where':{'id':_0x5c0821[_0x1c5a('0x59')]['id']}})[_0x1c5a('0x23')](function(_0x176351){return db[_0x1c5a('0x79')][_0x1c5a('0x7a')](function(_0x88c9c1){return _0x176351[_0x1c5a('0x7b')](_0x7f59f4,{'transaction':_0x88c9c1})[_0x1c5a('0x23')](function(){return BPromise[_0x1c5a('0x7c')](_0x22b04b,function(_0xa03520){return db['UserChatQueue'][_0x1c5a('0x7d')]({'where':{'UserId':_0xa03520['id'],'ChatQueueId':_0x5c0821[_0x1c5a('0x59')]['id']},'transaction':_0x88c9c1});});})[_0x1c5a('0x23')](function(){_0x22b04b[_0x1c5a('0x7e')](function(_0x5c2459){socket['emit'](_0x1c5a('0x7f'),{'UserId':_0x5c2459['id'],'ChatQueueId':_0x176351['id']});});});});});}})[_0x1c5a('0x23')](respondWithStatusCode(_0x4e0b58,null))['catch'](handleError(_0x4e0b58,null));};exports[_0x1c5a('0x80')]=function(_0x28b3ad,_0x38fa2d,_0x165c40){return db[_0x1c5a('0x73')][_0x1c5a('0x55')]({'where':{'id':_0x28b3ad['query'][_0x1c5a('0x72')]},'attributes':['id'],'include':[{'model':db[_0x1c5a('0x74')],'as':_0x1c5a('0x75'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x38fa2d,null))[_0x1c5a('0x23')](function(_0x29e2df){var _0x754caf=_[_0x1c5a('0x42')](_0x29e2df,'id');var _0x3aa5e9=[];var _0x132b75=[];var _0x196cb5=squel[_0x1c5a('0x81')]();_0x196cb5[_0x1c5a('0x82')](_0x1c5a('0x83'))['from'](_0x1c5a('0x84'),'tq')[_0x1c5a('0x85')](_0x1c5a('0x86'),'ut',_0x1c5a('0x87'))[_0x1c5a('0x4c')]('ChatQueueId\x20=\x20?',_0x28b3ad[_0x1c5a('0x59')]['id']);for(var _0x9e67e8=0x0;_0x9e67e8<_0x29e2df[_0x1c5a('0x71')];_0x9e67e8+=0x1){let _0x436300=_0x29e2df[_0x9e67e8];for(var _0x2b37b0=0x0;_0x2b37b0<_0x436300['Agents'][_0x1c5a('0x71')];_0x2b37b0+=0x1){let _0x59182d=_0x436300[_0x1c5a('0x75')][_0x2b37b0];var _0x4884d3=_0x196cb5['clone']();_0x4884d3[_0x1c5a('0x4c')]('ut.UserId\x20=\x20?',_0x59182d['id']);_0x132b75[_0x1c5a('0x88')](db[_0x1c5a('0x79')][_0x1c5a('0x43')](_0x4884d3[_0x1c5a('0x89')](),{'type':db['sequelize'][_0x1c5a('0x8a')][_0x1c5a('0x8b')]})['then'](function(_0x1f853f){if(_0x1f853f[_0x1c5a('0x71')]===0x1){return _0x59182d['id'];}else{var _0xbcfaba=_[_0x1c5a('0x8c')](_['map'](_0x1f853f,_0x1c5a('0x8d')),function(_0x3bb80b){return _['includes'](_0x754caf,_0x3bb80b);});if(_0xbcfaba){return _0x59182d['id'];}}}));}}return BPromise[_0x1c5a('0x8e')](_0x132b75)[_0x1c5a('0x23')](function(_0x3abf19){_0x3aa5e9=_(_0x3aa5e9)[_0x1c5a('0x8f')](_0x3abf19)[_0x1c5a('0x90')]()[_0x1c5a('0x91')]();return db[_0x1c5a('0x52')]['find']({'where':{'id':_0x28b3ad['params']['id']}})[_0x1c5a('0x23')](function(_0x1129bf){return db[_0x1c5a('0x79')][_0x1c5a('0x7a')](function(_0x1b9dcc){return _0x1129bf[_0x1c5a('0x80')](_0x28b3ad['query'][_0x1c5a('0x72')],{'transaction':_0x1b9dcc})['then'](function(){if(!_[_0x1c5a('0x92')](_0x3aa5e9)){return _0x1129bf[_0x1c5a('0x93')](_0x3aa5e9,{'transaction':_0x1b9dcc});}})['then'](function(){_0x3aa5e9[_0x1c5a('0x7e')](function(_0x527ff9){socket['emit'](_0x1c5a('0x94'),{'UserId':_0x527ff9,'ChatQueueId':_0x1129bf['id']});});});});});});})[_0x1c5a('0x23')](respondWithStatusCode(_0x38fa2d,null))[_0x1c5a('0x57')](handleError(_0x38fa2d,null));};exports['addAgents']=function(_0x54d81b,_0xca80be,_0x116d13){return db[_0x1c5a('0x52')][_0x1c5a('0x5a')]({'where':{'id':_0x54d81b[_0x1c5a('0x59')]['id']}})['then'](handleEntityNotFound(_0xca80be,null))[_0x1c5a('0x23')](function(_0x3644e9){if(_0x3644e9){return _0x3644e9[_0x1c5a('0x95')](_0x54d81b['body'][_0x1c5a('0x72')],_[_0x1c5a('0x96')](_0x54d81b['body'],['ids','id'])||{})[_0x1c5a('0x97')](function(_0x1e8ef5){for(var _0x3a4b34=0x0;_0x3a4b34<_0x54d81b['body'][_0x1c5a('0x72')][_0x1c5a('0x71')];_0x3a4b34+=0x1){socket[_0x1c5a('0x98')](_0x1c5a('0x7f'),{'UserId':Number(_0x54d81b['body'][_0x1c5a('0x72')][_0x3a4b34]),'ChatQueueId':Number(_0x54d81b[_0x1c5a('0x59')]['id'])});}return _0x1e8ef5;});}})[_0x1c5a('0x23')](respondWithResult(_0xca80be,null))[_0x1c5a('0x57')](handleError(_0xca80be,null));};exports[_0x1c5a('0x93')]=function(_0x2d77d7,_0x4cd905,_0x5eedef){return db['ChatQueue'][_0x1c5a('0x5a')]({'where':{'id':_0x2d77d7['params']['id']}})[_0x1c5a('0x23')](handleEntityNotFound(_0x4cd905,null))[_0x1c5a('0x23')](function(_0x38d285){if(_0x38d285){return _0x38d285[_0x1c5a('0x93')](_0x2d77d7['query'][_0x1c5a('0x72')])[_0x1c5a('0x23')](function(){if(_[_0x1c5a('0x99')](_0x2d77d7[_0x1c5a('0x43')][_0x1c5a('0x72')])){for(var _0x4101e0=0x0;_0x4101e0<_0x2d77d7[_0x1c5a('0x43')][_0x1c5a('0x72')][_0x1c5a('0x71')];_0x4101e0+=0x1){socket[_0x1c5a('0x98')](_0x1c5a('0x94'),{'UserId':Number(_0x2d77d7[_0x1c5a('0x43')]['ids'][_0x4101e0]),'ChatQueueId':Number(_0x2d77d7[_0x1c5a('0x59')]['id'])});}}else{socket[_0x1c5a('0x98')](_0x1c5a('0x94'),{'UserId':Number(_0x2d77d7[_0x1c5a('0x43')][_0x1c5a('0x72')]),'ChatQueueId':Number(_0x2d77d7[_0x1c5a('0x59')]['id'])});}});}})[_0x1c5a('0x23')](respondWithStatusCode(_0x4cd905,null))[_0x1c5a('0x57')](handleError(_0x4cd905,null));};exports['getAgents']=function(_0x203cfd,_0x561839,_0x2549cb){var _0x33fbe9={};var _0x784f64={};var _0x4f8cba;var _0x337bd2;return db['ChatQueue']['findOne']({'where':{'id':_0x203cfd[_0x1c5a('0x59')]['id']}})[_0x1c5a('0x23')](handleEntityNotFound(_0x561839,null))[_0x1c5a('0x23')](function(_0x4e3e92){if(_0x4e3e92){_0x4f8cba=_0x4e3e92;_0x784f64[_0x1c5a('0x41')]=_['keys'](db[_0x1c5a('0x74')][_0x1c5a('0x3e')]);_0x784f64['query']=_[_0x1c5a('0x44')](_0x203cfd[_0x1c5a('0x43')]);_0x784f64[_0x1c5a('0x45')]=_['intersection'](_0x784f64[_0x1c5a('0x41')],_0x784f64[_0x1c5a('0x43')]);_0x33fbe9[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x784f64[_0x1c5a('0x41')],qs[_0x1c5a('0x48')](_0x203cfd['query'][_0x1c5a('0x48')]));_0x33fbe9[_0x1c5a('0x47')]=_0x33fbe9[_0x1c5a('0x47')][_0x1c5a('0x71')]?_0x33fbe9[_0x1c5a('0x47')]:_0x784f64['model'];_0x33fbe9[_0x1c5a('0x4a')]=qs[_0x1c5a('0x4b')](_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x4b')]);_0x33fbe9[_0x1c5a('0x4c')]=qs[_0x1c5a('0x45')](_[_0x1c5a('0x4d')](_0x203cfd[_0x1c5a('0x43')],_0x784f64[_0x1c5a('0x45')]));if(_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x4e')]){_0x33fbe9[_0x1c5a('0x4c')]=_[_0x1c5a('0x50')](_0x33fbe9[_0x1c5a('0x4c')],{'$or':_[_0x1c5a('0x42')](_0x33fbe9[_0x1c5a('0x47')],function(_0x39df06){var _0x1f3b86={};_0x1f3b86[_0x39df06]={'$like':'%'+_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x4e')]+'%'};return _0x1f3b86;})});}_0x33fbe9=_['merge']({},_0x33fbe9,_0x203cfd['options']);return _0x4f8cba[_0x1c5a('0x9a')](_0x33fbe9);}})[_0x1c5a('0x23')](function(_0x2144d3){if(_0x2144d3){_0x337bd2=_0x2144d3[_0x1c5a('0x71')];if(!_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x65')]('nolimit')){_0x33fbe9[_0x1c5a('0x32')]=qs['limit'](_0x203cfd['query'][_0x1c5a('0x32')]);_0x33fbe9['offset']=qs[_0x1c5a('0x30')](_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x30')]);}return _0x4f8cba[_0x1c5a('0x9a')](_0x33fbe9);}})['then'](function(_0x2a4e0b){if(_0x2a4e0b){return _0x2a4e0b?{'count':_0x337bd2,'rows':_0x2a4e0b}:null;}})[_0x1c5a('0x23')](respondWithResult(_0x561839,null))['catch'](handleError(_0x561839,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index bc4ea85..cc3fb59 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 _0xe7fb=['../../mysqldb','ChatQueue','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x3f3b97,_0x395d93){var _0xb6ab0c=function(_0x330c5a){while(--_0x330c5a){_0x3f3b97['push'](_0x3f3b97['shift']());}};_0xb6ab0c(++_0x395d93);}(_0xe7fb,0xa1));var _0xbe7f=function(_0x47cc26,_0x211721){_0x47cc26=_0x47cc26-0x0;var _0x3c96d7=_0xe7fb[_0x47cc26];return _0x3c96d7;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xbe7f('0x0'))['db'][_0xbe7f('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbe7f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe7f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x57d52b){return function(_0x4a0f06,_0x8f7177,_0x2a6a67){ChatQueueEvents['emit'](_0x57d52b+':'+_0x4a0f06['id'],_0x4a0f06);ChatQueueEvents[_0xbe7f('0x4')](_0x57d52b,_0x4a0f06);_0x2a6a67(null);};}for(var e in events){if(events[_0xbe7f('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xbe7f('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0x8bb6=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3d17c2,_0x437283){var _0x6117d=function(_0x3d3382){while(--_0x3d3382){_0x3d17c2['push'](_0x3d17c2['shift']());}};_0x6117d(++_0x437283);}(_0x8bb6,0x16b));var _0x68bb=function(_0x5a001d,_0x591f45){_0x5a001d=_0x5a001d-0x0;var _0x3d0a81=_0x8bb6[_0x5a001d];return _0x3d0a81;};'use strict';var EventEmitter=require(_0x68bb('0x0'));var ChatQueue=require(_0x68bb('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x68bb('0x2')](0x0);var events={'afterCreate':_0x68bb('0x3'),'afterUpdate':_0x68bb('0x4'),'afterDestroy':_0x68bb('0x5')};function emitEvent(_0xa4c45a){return function(_0x4406f5,_0xe77c6e,_0x11a556){ChatQueueEvents[_0x68bb('0x6')](_0xa4c45a+':'+_0x4406f5['id'],_0x4406f5);ChatQueueEvents[_0x68bb('0x6')](_0xa4c45a,_0x4406f5);_0x11a556(null);};}for(var e in events){if(events[_0x68bb('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x68bb('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 541b84b..f5357cb 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 _0x2b66=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','lodash','../../config/logger'];(function(_0xd2cd94,_0x3bf735){var _0x844eaa=function(_0xafb688){while(--_0xafb688){_0xd2cd94['push'](_0xd2cd94['shift']());}};_0x844eaa(++_0x3bf735);}(_0x2b66,0x1ba));var _0x62b6=function(_0x5387c0,_0x1c30ae){_0x5387c0=_0x5387c0-0x0;var _0x29d280=_0x2b66[_0x5387c0];return _0x29d280;};'use strict';var _=require(_0x62b6('0x0'));var util=require('util');var logger=require(_0x62b6('0x1'))(_0x62b6('0x2'));var moment=require(_0x62b6('0x3'));var BPromise=require(_0x62b6('0x4'));var rp=require(_0x62b6('0x5'));var fs=require('fs');var path=require(_0x62b6('0x6'));var rimraf=require(_0x62b6('0x7'));var config=require(_0x62b6('0x8'));var attributes=require('./chatQueue.attributes');module[_0x62b6('0x9')]=function(_0xeb90b,_0x4c4be9){return _0xeb90b[_0x62b6('0xa')](_0x62b6('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86b3=['exports','ChatQueue','chat_queues','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x86b3,0x107));var _0x386b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x86b3[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x386b('0x0'));var moment=require(_0x386b('0x1'));var BPromise=require(_0x386b('0x2'));var rp=require(_0x386b('0x3'));var fs=require('fs');var path=require(_0x386b('0x4'));var rimraf=require('rimraf');var config=require(_0x386b('0x5'));var attributes=require(_0x386b('0x6'));module[_0x386b('0x7')]=function(_0x277182,_0x4f3435){return _0x277182['define'](_0x386b('0x8'),attributes,{'tableName':_0x386b('0x9'),'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 bb79a1f..d47b7d7 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 _0xd959=['ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','ChatQueue','findAll','options','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info'];(function(_0x543624,_0x8a8563){var _0x3f9d16=function(_0x469f08){while(--_0x469f08){_0x543624['push'](_0x543624['shift']());}};_0x3f9d16(++_0x8a8563);}(_0xd959,0x1f3));var _0x9d95=function(_0x40e7c3,_0x5ba8f3){_0x40e7c3=_0x40e7c3-0x0;var _0xb24182=_0xd959[_0x40e7c3];return _0xb24182;};'use strict';var _=require(_0x9d95('0x0'));var util=require(_0x9d95('0x1'));var moment=require(_0x9d95('0x2'));var BPromise=require(_0x9d95('0x3'));var rs=require(_0x9d95('0x4'));var fs=require('fs');var Redis=require(_0x9d95('0x5'));var db=require(_0x9d95('0x6'))['db'];var utils=require(_0x9d95('0x7'));var logger=require(_0x9d95('0x8'))('rpc');var config=require(_0x9d95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9d95('0xa')][_0x9d95('0xb')]({'port':0x232a});config[_0x9d95('0xc')]=_[_0x9d95('0xd')](config['redis'],{'host':_0x9d95('0xe'),'port':0x18eb});var socket=require(_0x9d95('0xf'))(new Redis(config[_0x9d95('0xc')]));require(_0x9d95('0x10'))[_0x9d95('0x11')](socket);function respondWithRpcPromise(_0x376a01,_0xfc9b81,_0x551825){return new BPromise(function(_0x184080,_0x5993b5){return client[_0x9d95('0x12')](_0x376a01,_0x551825)[_0x9d95('0x13')](function(_0x2461d3){logger[_0x9d95('0x14')](_0x9d95('0x15'),_0xfc9b81,_0x9d95('0x16'));logger[_0x9d95('0x17')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xfc9b81,_0x9d95('0x16'),JSON['stringify'](_0x2461d3));if(_0x2461d3[_0x9d95('0x18')]){if(_0x2461d3[_0x9d95('0x18')]['code']===0x1f4){logger['error'](_0x9d95('0x15'),_0xfc9b81,_0x2461d3['error'][_0x9d95('0x19')]);return _0x5993b5(_0x2461d3[_0x9d95('0x18')][_0x9d95('0x19')]);}logger[_0x9d95('0x18')](_0x9d95('0x15'),_0xfc9b81,_0x2461d3[_0x9d95('0x18')]['message']);return _0x184080(_0x2461d3[_0x9d95('0x18')][_0x9d95('0x19')]);}else{logger[_0x9d95('0x14')]('ChatQueue,\x20%s,\x20%s',_0xfc9b81,_0x9d95('0x16'));_0x184080(_0x2461d3['result'][_0x9d95('0x19')]);}})[_0x9d95('0x1a')](function(_0x4e2740){logger[_0x9d95('0x18')](_0x9d95('0x15'),_0xfc9b81,_0x4e2740);_0x5993b5(_0x4e2740);});});}exports['GetChatQueue']=function(_0x32b662){var _0x375478=this;return new Promise(function(_0x1a0633,_0x16d7de){return db[_0x9d95('0x1b')][_0x9d95('0x1c')]({'raw':_0x32b662[_0x9d95('0x1d')]?_0x32b662[_0x9d95('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x32b662[_0x9d95('0x1d')]?_0x32b662['options'][_0x9d95('0x1e')]||null:null,'attributes':_0x32b662[_0x9d95('0x1d')]?_0x32b662[_0x9d95('0x1d')][_0x9d95('0x1f')]||null:null,'limit':_0x32b662[_0x9d95('0x1d')]?_0x32b662[_0x9d95('0x1d')][_0x9d95('0x20')]||null:null,'include':_0x32b662[_0x9d95('0x1d')]?_0x32b662[_0x9d95('0x1d')][_0x9d95('0x21')]?_[_0x9d95('0x22')](_0x32b662[_0x9d95('0x1d')][_0x9d95('0x21')],function(_0x288575){return{'model':db[_0x288575['model']],'as':_0x288575['as'],'attributes':_0x288575[_0x9d95('0x1f')],'include':_0x288575['include']?_[_0x9d95('0x22')](_0x288575[_0x9d95('0x21')],function(_0xe74415){return{'model':db[_0xe74415[_0x9d95('0x23')]],'as':_0xe74415['as'],'attributes':_0xe74415['attributes'],'include':_0xe74415[_0x9d95('0x21')]?_[_0x9d95('0x22')](_0xe74415[_0x9d95('0x21')],function(_0x1515ba){return{'model':db[_0x1515ba[_0x9d95('0x23')]],'as':_0x1515ba['as'],'attributes':_0x1515ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d95('0x13')](function(_0x49c2ca){logger[_0x9d95('0x14')](_0x9d95('0x24'),_0x32b662);logger[_0x9d95('0x17')]('GetChatQueue',_0x32b662,JSON['stringify'](_0x49c2ca));_0x1a0633(_0x49c2ca);})[_0x9d95('0x1a')](function(_0x16f85f){logger[_0x9d95('0x18')](_0x9d95('0x24'),_0x16f85f[_0x9d95('0x19')],_0x32b662);_0x16d7de(_0x375478[_0x9d95('0x18')](0x1f4,_0x16f85f[_0x9d95('0x19')]));});});};exports[_0x9d95('0x25')]=function(_0x54a61e){var _0x29dc9f=this;return new Promise(function(_0x3aeaac,_0x4a5a3){return db[_0x9d95('0x1b')]['find']({'raw':_0x54a61e[_0x9d95('0x1d')]?_0x54a61e['options'][_0x9d95('0x26')]===undefined?!![]:![]:!![],'where':_0x54a61e[_0x9d95('0x1d')]?_0x54a61e[_0x9d95('0x1d')][_0x9d95('0x1e')]||null:null,'attributes':_0x54a61e[_0x9d95('0x1d')]?_0x54a61e[_0x9d95('0x1d')]['attributes']||null:null,'include':_0x54a61e[_0x9d95('0x1d')]?_0x54a61e[_0x9d95('0x1d')][_0x9d95('0x21')]?_[_0x9d95('0x22')](_0x54a61e[_0x9d95('0x1d')][_0x9d95('0x21')],function(_0x21ef0a){return{'model':db[_0x21ef0a[_0x9d95('0x23')]],'as':_0x21ef0a['as'],'attributes':_0x21ef0a[_0x9d95('0x1f')],'include':_0x21ef0a['include']?_[_0x9d95('0x22')](_0x21ef0a[_0x9d95('0x21')],function(_0xa0f19b){return{'model':db[_0xa0f19b[_0x9d95('0x23')]],'as':_0xa0f19b['as'],'attributes':_0xa0f19b[_0x9d95('0x1f')],'include':_0xa0f19b[_0x9d95('0x21')]?_['map'](_0xa0f19b[_0x9d95('0x21')],function(_0x4be3df){return{'model':db[_0x4be3df[_0x9d95('0x23')]],'as':_0x4be3df['as'],'attributes':_0x4be3df[_0x9d95('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9d95('0x13')](function(_0x36a5db){logger[_0x9d95('0x14')](_0x9d95('0x25'),_0x54a61e);logger[_0x9d95('0x17')](_0x9d95('0x25'),_0x54a61e,JSON[_0x9d95('0x27')](_0x36a5db));_0x3aeaac(_0x36a5db);})[_0x9d95('0x1a')](function(_0x194e48){logger[_0x9d95('0x18')](_0x9d95('0x25'),_0x194e48['message'],_0x54a61e);_0x4a5a3(_0x29dc9f['error'](0x1f4,_0x194e48['message']));});});}; \ No newline at end of file +var _0xa988=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','info','ChatQueue,\x20%s,\x20%s','debug','error','message','request\x20sent','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','stringify','catch','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa988,0x1a7));var _0x8a98=function(_0x5afae5,_0x438692){_0x5afae5=_0x5afae5-0x0;var _0x4d70fe=_0xa988[_0x5afae5];return _0x4d70fe;};'use strict';var _=require(_0x8a98('0x0'));var util=require(_0x8a98('0x1'));var moment=require(_0x8a98('0x2'));var BPromise=require(_0x8a98('0x3'));var rs=require(_0x8a98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a98('0x5'))['db'];var utils=require(_0x8a98('0x6'));var logger=require(_0x8a98('0x7'))(_0x8a98('0x8'));var config=require(_0x8a98('0x9'));var jayson=require(_0x8a98('0xa'));var client=jayson[_0x8a98('0xb')][_0x8a98('0xc')]({'port':0x232a});config['redis']=_[_0x8a98('0xd')](config[_0x8a98('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a98('0xf'))(new Redis(config[_0x8a98('0xe')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1aab5c,_0x26c340,_0x51f11f){return new BPromise(function(_0x3cac53,_0xf73acb){return client[_0x8a98('0x10')](_0x1aab5c,_0x51f11f)['then'](function(_0x450a99){logger[_0x8a98('0x11')](_0x8a98('0x12'),_0x26c340,'request\x20sent');logger[_0x8a98('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x26c340,'request\x20sent',JSON['stringify'](_0x450a99));if(_0x450a99[_0x8a98('0x14')]){if(_0x450a99['error']['code']===0x1f4){logger['error'](_0x8a98('0x12'),_0x26c340,_0x450a99['error'][_0x8a98('0x15')]);return _0xf73acb(_0x450a99[_0x8a98('0x14')][_0x8a98('0x15')]);}logger[_0x8a98('0x14')](_0x8a98('0x12'),_0x26c340,_0x450a99[_0x8a98('0x14')][_0x8a98('0x15')]);return _0x3cac53(_0x450a99[_0x8a98('0x14')]['message']);}else{logger['info'](_0x8a98('0x12'),_0x26c340,_0x8a98('0x16'));_0x3cac53(_0x450a99['result'][_0x8a98('0x15')]);}})['catch'](function(_0x184488){logger[_0x8a98('0x14')](_0x8a98('0x12'),_0x26c340,_0x184488);_0xf73acb(_0x184488);});});}exports[_0x8a98('0x17')]=function(_0x289a2d){var _0x5a610e=this;return new Promise(function(_0x4d6e43,_0x239094){return db[_0x8a98('0x18')][_0x8a98('0x19')]({'raw':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d[_0x8a98('0x1a')][_0x8a98('0x1b')]===undefined?!![]:![]:!![],'where':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d[_0x8a98('0x1a')][_0x8a98('0x1c')]||null:null,'attributes':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d['options'][_0x8a98('0x1d')]||null:null,'limit':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d[_0x8a98('0x1a')][_0x8a98('0x1e')]||null:null,'include':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d['options'][_0x8a98('0x1f')]?_['map'](_0x289a2d['options'][_0x8a98('0x1f')],function(_0x410ae8){return{'model':db[_0x410ae8[_0x8a98('0x20')]],'as':_0x410ae8['as'],'attributes':_0x410ae8[_0x8a98('0x1d')],'include':_0x410ae8[_0x8a98('0x1f')]?_[_0x8a98('0x21')](_0x410ae8['include'],function(_0x204db8){return{'model':db[_0x204db8[_0x8a98('0x20')]],'as':_0x204db8['as'],'attributes':_0x204db8[_0x8a98('0x1d')],'include':_0x204db8['include']?_[_0x8a98('0x21')](_0x204db8[_0x8a98('0x1f')],function(_0x2bfd99){return{'model':db[_0x2bfd99[_0x8a98('0x20')]],'as':_0x2bfd99['as'],'attributes':_0x2bfd99['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a98('0x22')](function(_0x5edd60){logger[_0x8a98('0x11')](_0x8a98('0x17'),_0x289a2d);logger['debug'](_0x8a98('0x17'),_0x289a2d,JSON[_0x8a98('0x23')](_0x5edd60));_0x4d6e43(_0x5edd60);})[_0x8a98('0x24')](function(_0x4d69f9){logger[_0x8a98('0x14')](_0x8a98('0x17'),_0x4d69f9[_0x8a98('0x15')],_0x289a2d);_0x239094(_0x5a610e[_0x8a98('0x14')](0x1f4,_0x4d69f9[_0x8a98('0x15')]));});});};exports['ShowChatQueue']=function(_0x56b35d){var _0x24ea39=this;return new Promise(function(_0x346c61,_0xff31ec){return db[_0x8a98('0x18')][_0x8a98('0x25')]({'raw':_0x56b35d[_0x8a98('0x1a')]?_0x56b35d[_0x8a98('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x56b35d['options']?_0x56b35d[_0x8a98('0x1a')][_0x8a98('0x1c')]||null:null,'attributes':_0x56b35d[_0x8a98('0x1a')]?_0x56b35d[_0x8a98('0x1a')][_0x8a98('0x1d')]||null:null,'include':_0x56b35d[_0x8a98('0x1a')]?_0x56b35d['options'][_0x8a98('0x1f')]?_['map'](_0x56b35d[_0x8a98('0x1a')]['include'],function(_0x75ef3f){return{'model':db[_0x75ef3f[_0x8a98('0x20')]],'as':_0x75ef3f['as'],'attributes':_0x75ef3f[_0x8a98('0x1d')],'include':_0x75ef3f[_0x8a98('0x1f')]?_[_0x8a98('0x21')](_0x75ef3f[_0x8a98('0x1f')],function(_0x21f39c){return{'model':db[_0x21f39c['model']],'as':_0x21f39c['as'],'attributes':_0x21f39c[_0x8a98('0x1d')],'include':_0x21f39c[_0x8a98('0x1f')]?_['map'](_0x21f39c[_0x8a98('0x1f')],function(_0x21a337){return{'model':db[_0x21a337[_0x8a98('0x20')]],'as':_0x21a337['as'],'attributes':_0x21a337[_0x8a98('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8a98('0x22')](function(_0x4c3fa4){logger[_0x8a98('0x11')](_0x8a98('0x26'),_0x56b35d);logger[_0x8a98('0x13')](_0x8a98('0x26'),_0x56b35d,JSON[_0x8a98('0x23')](_0x4c3fa4));_0x346c61(_0x4c3fa4);})[_0x8a98('0x24')](function(_0x58aa42){logger[_0x8a98('0x14')](_0x8a98('0x26'),_0x58aa42[_0x8a98('0x15')],_0x56b35d);_0xff31ec(_0x24ea39[_0x8a98('0x14')](0x1f4,_0x58aa42[_0x8a98('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 9662321..209821e 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 _0x7a2c=['chatQueue:','./chatQueue.events','remove','update','emit','register'];(function(_0x1faf8d,_0x3ff04d){var _0xb3474c=function(_0x7a7870){while(--_0x7a7870){_0x1faf8d['push'](_0x1faf8d['shift']());}};_0xb3474c(++_0x3ff04d);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x35bca7,_0x2cf644){_0x35bca7=_0x35bca7-0x0;var _0x467498=_0x7a2c[_0x35bca7];return _0x467498;};'use strict';var ChatQueueEvents=require(_0xc7a2('0x0'));var events=['save',_0xc7a2('0x1'),_0xc7a2('0x2')];function createListener(_0x409ec5,_0x26fb61){return function(_0x44d702){_0x26fb61[_0xc7a2('0x3')](_0x409ec5,_0x44d702);};}function removeListener(_0x3f2b0d,_0x34cd60){return function(){ChatQueueEvents['removeListener'](_0x3f2b0d,_0x34cd60);};}exports[_0xc7a2('0x4')]=function(_0x1ddbae){for(var _0x5f334e=0x0,_0x481430=events['length'];_0x5f334e<_0x481430;_0x5f334e++){var _0x1dd150=events[_0x5f334e];var _0x3de428=createListener(_0xc7a2('0x5')+_0x1dd150,_0x1ddbae);ChatQueueEvents['on'](_0x1dd150,_0x3de428);}}; \ No newline at end of file +var _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x57a649,_0x43dc50){var _0x117093=function(_0x2d2255){while(--_0x2d2255){_0x57a649['push'](_0x57a649['shift']());}};_0x117093(++_0x43dc50);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5505eb,_0xd878dc){_0x5505eb=_0x5505eb-0x0;var _0x4dff66=_0x4c6d[_0x5505eb];return _0x4dff66;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index cb1ac06..e00b01d 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x57ce89,_0x389a7d){var _0x53371b=function(_0x43fdd6){while(--_0x43fdd6){_0x57ce89['push'](_0x57ce89['shift']());}};_0x53371b(++_0x389a7d);}(_0xe14b,0x93));var _0xbe14=function(_0x35e5de,_0x5311b7){_0x35e5de=_0x35e5de-0x0;var _0x665d7d=_0xe14b[_0x35e5de];return _0x665d7d;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0x5fc3[_0x7a3247];return _0x1bfde5;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index cd7d899..67eba06 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 _0x49ae=['moment','sequelize','STRING','DATE'];(function(_0x3e7ae3,_0x2ae3b7){var _0x282f67=function(_0x53eb72){while(--_0x53eb72){_0x3e7ae3['push'](_0x3e7ae3['shift']());}};_0x282f67(++_0x2ae3b7);}(_0x49ae,0x140));var _0xe49a=function(_0x27e4c4,_0x25d75a){_0x27e4c4=_0x27e4c4-0x0;var _0x4ab3f5=_0x49ae[_0x27e4c4];return _0x4ab3f5;};'use strict';var moment=require(_0xe49a('0x0'));var Sequelize=require(_0xe49a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe49a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe49a('0x3')]},'leaveAt':{'type':Sequelize[_0xe49a('0x3')]},'acceptAt':{'type':Sequelize[_0xe49a('0x3')]},'exitAt':{'type':Sequelize[_0xe49a('0x3')]},'reason':{'type':Sequelize[_0xe49a('0x2')]}}; \ No newline at end of file +var _0x7730=['moment','exports','STRING','DATE'];(function(_0x38b208,_0x5239c1){var _0x4ea610=function(_0x518195){while(--_0x518195){_0x38b208['push'](_0x38b208['shift']());}};_0x4ea610(++_0x5239c1);}(_0x7730,0x1e8));var _0x0773=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0x7730[_0xb47dc0];return _0x57f0b0;};'use strict';var moment=require(_0x0773('0x0'));var Sequelize=require('sequelize');module[_0x0773('0x1')]={'uniqueid':{'type':Sequelize[_0x0773('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0773('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0773('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index b923bec..4984e76 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 _0x8a9a=['length','hasOwnProperty','order','sort','where','filters','filter','merge','map','type','includeAll','include','findAll','rows','params','intersection','options','find','catch','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','sendStatus','stack','name','send','index','ChatQueueReport','rawAttributes','model','query','keys','attributes','fields'];(function(_0x1a5d77,_0x3fdc6d){var _0x344595=function(_0x498324){while(--_0x498324){_0x1a5d77['push'](_0x1a5d77['shift']());}};_0x344595(++_0x3fdc6d);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x8a9a[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8a9('0x0'));var zipdir=require(_0xa8a9('0x1'));var jsonpatch=require(_0xa8a9('0x2'));var rp=require(_0xa8a9('0x3'));var moment=require(_0xa8a9('0x4'));var BPromise=require(_0xa8a9('0x5'));var Mustache=require(_0xa8a9('0x6'));var util=require(_0xa8a9('0x7'));var path=require(_0xa8a9('0x8'));var sox=require(_0xa8a9('0x9'));var csv=require(_0xa8a9('0xa'));var ejs=require(_0xa8a9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8a9('0xc'));var squel=require('squel');var crypto=require(_0xa8a9('0xd'));var jsforce=require(_0xa8a9('0xe'));var deskjs=require(_0xa8a9('0xf'));var toCsv=require(_0xa8a9('0xa'));var querystring=require(_0xa8a9('0x10'));var Papa=require('papaparse');var Redis=require(_0xa8a9('0x11'));var authService=require(_0xa8a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa8a9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8a9('0x14'))(_0xa8a9('0x15'));var utils=require('../../config/utils');var config=require(_0xa8a9('0x16'));var licenseUtil=require(_0xa8a9('0x17'));var db=require(_0xa8a9('0x18'))['db'];function respondWithStatusCode(_0x28d881,_0x35b204){_0x35b204=_0x35b204||0xcc;return function(_0x248774){if(_0x248774){return _0x28d881['sendStatus'](_0x35b204);}return _0x28d881[_0xa8a9('0x19')](_0x35b204)[_0xa8a9('0x1a')]();};}function respondWithResult(_0x24abd1,_0x509bcb){_0x509bcb=_0x509bcb||0xc8;return function(_0x4f35e6){if(_0x4f35e6){return _0x24abd1[_0xa8a9('0x19')](_0x509bcb)[_0xa8a9('0x1b')](_0x4f35e6);}};}function respondWithFilteredResult(_0x2c9f36,_0x4ca16f){return function(_0x2efd94){if(_0x2efd94){var _0x35be8c=typeof _0x4ca16f['offset']==='undefined'&&typeof _0x4ca16f[_0xa8a9('0x1c')]===_0xa8a9('0x1d');var _0x91e6d8=_0x2efd94[_0xa8a9('0x1e')];var _0x46a89d=_0x35be8c?0x0:_0x4ca16f[_0xa8a9('0x1f')];var _0x5cd106=_0x35be8c?_0x2efd94['count']:_0x4ca16f[_0xa8a9('0x1f')]+_0x4ca16f['limit'];var _0x5248fa;if(_0x5cd106>=_0x91e6d8){_0x5cd106=_0x91e6d8;_0x5248fa=0xc8;}else{_0x5248fa=0xce;}_0x2c9f36[_0xa8a9('0x19')](_0x5248fa);return _0x2c9f36[_0xa8a9('0x20')](_0xa8a9('0x21'),_0x46a89d+'-'+_0x5cd106+'/'+_0x91e6d8)[_0xa8a9('0x1b')](_0x2efd94);}return null;};}function patchUpdates(_0x4744f1){return function(_0x3e8629){try{jsonpatch[_0xa8a9('0x22')](_0x3e8629,_0x4744f1,!![]);}catch(_0x3c37f9){return BPromise[_0xa8a9('0x23')](_0x3c37f9);}return _0x3e8629['save']();};}function saveUpdates(_0x102301,_0x481a34){return function(_0x32721b){if(_0x32721b){return _0x32721b['update'](_0x102301)[_0xa8a9('0x24')](function(_0x1229d0){return _0x1229d0;});}return null;};}function removeEntity(_0x540349,_0x58f832){return function(_0x5d3ec8){if(_0x5d3ec8){return _0x5d3ec8['destroy']()[_0xa8a9('0x24')](function(){_0x540349['status'](0xcc)[_0xa8a9('0x1a')]();});}};}function handleEntityNotFound(_0x5276bd,_0x284b55){return function(_0x16abed){if(!_0x16abed){_0x5276bd[_0xa8a9('0x25')](0x194);}return _0x16abed;};}function handleError(_0x46b030,_0x1893de){_0x1893de=_0x1893de||0x1f4;return function(_0x34d84a){logger['error'](_0x34d84a[_0xa8a9('0x26')]);if(_0x34d84a['name']){delete _0x34d84a[_0xa8a9('0x27')];}_0x46b030[_0xa8a9('0x19')](_0x1893de)[_0xa8a9('0x28')](_0x34d84a);};}exports[_0xa8a9('0x29')]=function(_0x21b380,_0x343c80){var _0x4a468f={},_0x24021c={},_0x111651={'count':0x0,'rows':[]};var _0x183878=_['map'](db[_0xa8a9('0x2a')][_0xa8a9('0x2b')],function(_0x4af312){return{'name':_0x4af312['fieldName'],'type':_0x4af312['type']['key']};});_0x24021c[_0xa8a9('0x2c')]=_['map'](_0x183878,_0xa8a9('0x27'));_0x24021c[_0xa8a9('0x2d')]=_[_0xa8a9('0x2e')](_0x21b380[_0xa8a9('0x2d')]);_0x24021c['filters']=_['intersection'](_0x24021c[_0xa8a9('0x2c')],_0x24021c[_0xa8a9('0x2d')]);_0x4a468f[_0xa8a9('0x2f')]=_['intersection'](_0x24021c[_0xa8a9('0x2c')],qs[_0xa8a9('0x30')](_0x21b380[_0xa8a9('0x2d')][_0xa8a9('0x30')]));_0x4a468f[_0xa8a9('0x2f')]=_0x4a468f['attributes'][_0xa8a9('0x31')]?_0x4a468f[_0xa8a9('0x2f')]:_0x24021c[_0xa8a9('0x2c')];if(!_0x21b380['query'][_0xa8a9('0x32')]('nolimit')){_0x4a468f['limit']=qs['limit'](_0x21b380[_0xa8a9('0x2d')]['limit']);_0x4a468f[_0xa8a9('0x1f')]=qs[_0xa8a9('0x1f')](_0x21b380[_0xa8a9('0x2d')]['offset']);}_0x4a468f[_0xa8a9('0x33')]=qs[_0xa8a9('0x34')](_0x21b380['query']['sort']);_0x4a468f[_0xa8a9('0x35')]=qs[_0xa8a9('0x36')](_['pick'](_0x21b380[_0xa8a9('0x2d')],_0x24021c[_0xa8a9('0x36')]),_0x183878);if(_0x21b380['query'][_0xa8a9('0x37')]){_0x4a468f[_0xa8a9('0x35')]=_[_0xa8a9('0x38')](_0x4a468f['where'],{'$or':_[_0xa8a9('0x39')](_0x183878,function(_0x1d6869){if(_0x1d6869[_0xa8a9('0x3a')]!=='VIRTUAL'){var _0x280b9d={};_0x280b9d[_0x1d6869['name']]={'$like':'%'+_0x21b380[_0xa8a9('0x2d')]['filter']+'%'};return _0x280b9d;}})});}_0x4a468f=_[_0xa8a9('0x38')]({},_0x4a468f,_0x21b380['options']);var _0x2c9e79={'where':_0x4a468f[_0xa8a9('0x35')]};return db['ChatQueueReport'][_0xa8a9('0x1e')](_0x2c9e79)['then'](function(_0x44a9be){_0x111651[_0xa8a9('0x1e')]=_0x44a9be;if(_0x21b380[_0xa8a9('0x2d')][_0xa8a9('0x3b')]){_0x4a468f[_0xa8a9('0x3c')]=[{'all':!![]}];}return db[_0xa8a9('0x2a')][_0xa8a9('0x3d')](_0x4a468f);})['then'](function(_0x1e05f6){_0x111651[_0xa8a9('0x3e')]=_0x1e05f6;return _0x111651;})[_0xa8a9('0x24')](respondWithFilteredResult(_0x343c80,_0x4a468f))['catch'](handleError(_0x343c80,null));};exports['show']=function(_0x523878,_0x38b323){var _0x2c55c4={'raw':!![],'where':{'id':_0x523878[_0xa8a9('0x3f')]['id']}},_0x210056={};_0x210056[_0xa8a9('0x2c')]=_[_0xa8a9('0x2e')](db[_0xa8a9('0x2a')][_0xa8a9('0x2b')]);_0x210056['query']=_[_0xa8a9('0x2e')](_0x523878[_0xa8a9('0x2d')]);_0x210056[_0xa8a9('0x36')]=_[_0xa8a9('0x40')](_0x210056[_0xa8a9('0x2c')],_0x210056[_0xa8a9('0x2d')]);_0x2c55c4['attributes']=_[_0xa8a9('0x40')](_0x210056[_0xa8a9('0x2c')],qs[_0xa8a9('0x30')](_0x523878['query'][_0xa8a9('0x30')]));_0x2c55c4[_0xa8a9('0x2f')]=_0x2c55c4[_0xa8a9('0x2f')][_0xa8a9('0x31')]?_0x2c55c4['attributes']:_0x210056[_0xa8a9('0x2c')];if(_0x523878['query'][_0xa8a9('0x3b')]){_0x2c55c4[_0xa8a9('0x3c')]=[{'all':!![]}];}_0x2c55c4=_[_0xa8a9('0x38')]({},_0x2c55c4,_0x523878[_0xa8a9('0x41')]);return db[_0xa8a9('0x2a')][_0xa8a9('0x42')](_0x2c55c4)['then'](handleEntityNotFound(_0x38b323,null))[_0xa8a9('0x24')](respondWithResult(_0x38b323,null))[_0xa8a9('0x43')](handleError(_0x38b323,null));};exports['create']=function(_0x319fd7,_0x5b0b6d){return db[_0xa8a9('0x2a')]['create'](_0x319fd7[_0xa8a9('0x44')],{})[_0xa8a9('0x24')](respondWithResult(_0x5b0b6d,0xc9))[_0xa8a9('0x43')](handleError(_0x5b0b6d,null));};exports[_0xa8a9('0x45')]=function(_0x13455b,_0x3d5d7e){if(_0x13455b[_0xa8a9('0x44')]['id']){delete _0x13455b['body']['id'];}return db[_0xa8a9('0x2a')][_0xa8a9('0x42')]({'where':{'id':_0x13455b['params']['id']}})[_0xa8a9('0x24')](handleEntityNotFound(_0x3d5d7e,null))[_0xa8a9('0x24')](saveUpdates(_0x13455b['body'],null))[_0xa8a9('0x24')](respondWithResult(_0x3d5d7e,null))[_0xa8a9('0x43')](handleError(_0x3d5d7e,null));};exports[_0xa8a9('0x46')]=function(_0x21ebe1,_0x1e0d27){return db['ChatQueueReport'][_0xa8a9('0x42')]({'where':{'id':_0x21ebe1[_0xa8a9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1e0d27,null))[_0xa8a9('0x24')](removeEntity(_0x1e0d27,null))[_0xa8a9('0x43')](handleError(_0x1e0d27,null));};exports[_0xa8a9('0x47')]=function(_0x43793d,_0x16a654){return db[_0xa8a9('0x2a')][_0xa8a9('0x47')]()[_0xa8a9('0x24')](respondWithResult(_0x16a654,null))[_0xa8a9('0x43')](handleError(_0x16a654,null));}; \ No newline at end of file +var _0x68b3=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3f69e7,_0x2253d6){var _0x57d5e9=function(_0x27719c){while(--_0x27719c){_0x3f69e7['push'](_0x3f69e7['shift']());}};_0x57d5e9(++_0x2253d6);}(_0x68b3,0x1d8));var _0x368b=function(_0x8071cf,_0x10e0fb){_0x8071cf=_0x8071cf-0x0;var _0xfc442e=_0x68b3[_0x8071cf];return _0xfc442e;};'use strict';var emlformat=require(_0x368b('0x0'));var rimraf=require(_0x368b('0x1'));var zipdir=require(_0x368b('0x2'));var jsonpatch=require(_0x368b('0x3'));var rp=require(_0x368b('0x4'));var moment=require('moment');var BPromise=require(_0x368b('0x5'));var Mustache=require(_0x368b('0x6'));var util=require(_0x368b('0x7'));var path=require(_0x368b('0x8'));var sox=require('sox');var csv=require(_0x368b('0x9'));var ejs=require(_0x368b('0xa'));var fs=require('fs');var fs_extra=require(_0x368b('0xb'));var _=require(_0x368b('0xc'));var squel=require(_0x368b('0xd'));var crypto=require(_0x368b('0xe'));var jsforce=require(_0x368b('0xf'));var deskjs=require(_0x368b('0x10'));var toCsv=require(_0x368b('0x9'));var querystring=require(_0x368b('0x11'));var Papa=require(_0x368b('0x12'));var Redis=require('ioredis');var authService=require(_0x368b('0x13'));var qs=require(_0x368b('0x14'));var as=require(_0x368b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x368b('0x16'))(_0x368b('0x17'));var utils=require(_0x368b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x368b('0x19'));var db=require(_0x368b('0x1a'))['db'];function respondWithStatusCode(_0x514dc7,_0x109a90){_0x109a90=_0x109a90||0xcc;return function(_0x250697){if(_0x250697){return _0x514dc7[_0x368b('0x1b')](_0x109a90);}return _0x514dc7[_0x368b('0x1c')](_0x109a90)[_0x368b('0x1d')]();};}function respondWithResult(_0x4fffe5,_0x2b326c){_0x2b326c=_0x2b326c||0xc8;return function(_0x40faa0){if(_0x40faa0){return _0x4fffe5['status'](_0x2b326c)[_0x368b('0x1e')](_0x40faa0);}};}function respondWithFilteredResult(_0x2aabb9,_0x30c245){return function(_0x515350){if(_0x515350){var _0x220cd5=typeof _0x30c245[_0x368b('0x1f')]===_0x368b('0x20')&&typeof _0x30c245['limit']===_0x368b('0x20');var _0x1b9e65=_0x515350[_0x368b('0x21')];var _0x540f57=_0x220cd5?0x0:_0x30c245['offset'];var _0x3e2e9f=_0x220cd5?_0x515350[_0x368b('0x21')]:_0x30c245[_0x368b('0x1f')]+_0x30c245[_0x368b('0x22')];var _0x1a4f20;if(_0x3e2e9f>=_0x1b9e65){_0x3e2e9f=_0x1b9e65;_0x1a4f20=0xc8;}else{_0x1a4f20=0xce;}_0x2aabb9['status'](_0x1a4f20);return _0x2aabb9[_0x368b('0x23')](_0x368b('0x24'),_0x540f57+'-'+_0x3e2e9f+'/'+_0x1b9e65)[_0x368b('0x1e')](_0x515350);}return null;};}function patchUpdates(_0x1c927f){return function(_0x23da8f){try{jsonpatch[_0x368b('0x25')](_0x23da8f,_0x1c927f,!![]);}catch(_0x397185){return BPromise[_0x368b('0x26')](_0x397185);}return _0x23da8f['save']();};}function saveUpdates(_0x13e750,_0x2f08d9){return function(_0x18869a){if(_0x18869a){return _0x18869a[_0x368b('0x27')](_0x13e750)[_0x368b('0x28')](function(_0x4c2fca){return _0x4c2fca;});}return null;};}function removeEntity(_0x286641,_0x1ca429){return function(_0x3a22bd){if(_0x3a22bd){return _0x3a22bd[_0x368b('0x29')]()[_0x368b('0x28')](function(){_0x286641[_0x368b('0x1c')](0xcc)[_0x368b('0x1d')]();});}};}function handleEntityNotFound(_0x11ea2d,_0x3123c1){return function(_0x3f7f89){if(!_0x3f7f89){_0x11ea2d[_0x368b('0x1b')](0x194);}return _0x3f7f89;};}function handleError(_0x344d8a,_0xceec4b){_0xceec4b=_0xceec4b||0x1f4;return function(_0x376e61){logger[_0x368b('0x2a')](_0x376e61[_0x368b('0x2b')]);if(_0x376e61[_0x368b('0x2c')]){delete _0x376e61[_0x368b('0x2c')];}_0x344d8a[_0x368b('0x1c')](_0xceec4b)[_0x368b('0x2d')](_0x376e61);};}exports[_0x368b('0x2e')]=function(_0xc12627,_0x107d2f){var _0x3c80b5={},_0x5db0b4={},_0x4af77a={'count':0x0,'rows':[]};var _0x381324=_[_0x368b('0x2f')](db[_0x368b('0x30')][_0x368b('0x31')],function(_0x5d6ebf){return{'name':_0x5d6ebf[_0x368b('0x32')],'type':_0x5d6ebf[_0x368b('0x33')][_0x368b('0x34')]};});_0x5db0b4[_0x368b('0x35')]=_[_0x368b('0x2f')](_0x381324,'name');_0x5db0b4[_0x368b('0x36')]=_[_0x368b('0x37')](_0xc12627[_0x368b('0x36')]);_0x5db0b4[_0x368b('0x38')]=_['intersection'](_0x5db0b4['model'],_0x5db0b4['query']);_0x3c80b5[_0x368b('0x39')]=_[_0x368b('0x3a')](_0x5db0b4[_0x368b('0x35')],qs[_0x368b('0x3b')](_0xc12627[_0x368b('0x36')]['fields']));_0x3c80b5[_0x368b('0x39')]=_0x3c80b5[_0x368b('0x39')]['length']?_0x3c80b5[_0x368b('0x39')]:_0x5db0b4[_0x368b('0x35')];if(!_0xc12627['query'][_0x368b('0x3c')](_0x368b('0x3d'))){_0x3c80b5['limit']=qs[_0x368b('0x22')](_0xc12627['query']['limit']);_0x3c80b5['offset']=qs[_0x368b('0x1f')](_0xc12627[_0x368b('0x36')][_0x368b('0x1f')]);}_0x3c80b5[_0x368b('0x3e')]=qs[_0x368b('0x3f')](_0xc12627[_0x368b('0x36')][_0x368b('0x3f')]);_0x3c80b5[_0x368b('0x40')]=qs[_0x368b('0x38')](_[_0x368b('0x41')](_0xc12627['query'],_0x5db0b4[_0x368b('0x38')]),_0x381324);if(_0xc12627[_0x368b('0x36')]['filter']){_0x3c80b5[_0x368b('0x40')]=_[_0x368b('0x42')](_0x3c80b5[_0x368b('0x40')],{'$or':_[_0x368b('0x2f')](_0x381324,function(_0x248b2b){if(_0x248b2b['type']!==_0x368b('0x43')){var _0x4287c6={};_0x4287c6[_0x248b2b[_0x368b('0x2c')]]={'$like':'%'+_0xc12627[_0x368b('0x36')]['filter']+'%'};return _0x4287c6;}})});}_0x3c80b5=_['merge']({},_0x3c80b5,_0xc12627[_0x368b('0x44')]);var _0x3d00f9={'where':_0x3c80b5[_0x368b('0x40')]};return db[_0x368b('0x30')][_0x368b('0x21')](_0x3d00f9)[_0x368b('0x28')](function(_0x1d990c){_0x4af77a[_0x368b('0x21')]=_0x1d990c;if(_0xc12627[_0x368b('0x36')][_0x368b('0x45')]){_0x3c80b5['include']=[{'all':!![]}];}return db[_0x368b('0x30')][_0x368b('0x46')](_0x3c80b5);})['then'](function(_0x25e713){_0x4af77a[_0x368b('0x47')]=_0x25e713;return _0x4af77a;})[_0x368b('0x28')](respondWithFilteredResult(_0x107d2f,_0x3c80b5))[_0x368b('0x48')](handleError(_0x107d2f,null));};exports['show']=function(_0x490eb6,_0x151711){var _0x4a0275={'raw':!![],'where':{'id':_0x490eb6[_0x368b('0x49')]['id']}},_0x91bb0b={};_0x91bb0b[_0x368b('0x35')]=_['keys'](db[_0x368b('0x30')][_0x368b('0x31')]);_0x91bb0b[_0x368b('0x36')]=_['keys'](_0x490eb6['query']);_0x91bb0b[_0x368b('0x38')]=_[_0x368b('0x3a')](_0x91bb0b['model'],_0x91bb0b[_0x368b('0x36')]);_0x4a0275[_0x368b('0x39')]=_[_0x368b('0x3a')](_0x91bb0b[_0x368b('0x35')],qs[_0x368b('0x3b')](_0x490eb6[_0x368b('0x36')][_0x368b('0x3b')]));_0x4a0275[_0x368b('0x39')]=_0x4a0275[_0x368b('0x39')][_0x368b('0x4a')]?_0x4a0275[_0x368b('0x39')]:_0x91bb0b[_0x368b('0x35')];if(_0x490eb6[_0x368b('0x36')]['includeAll']){_0x4a0275[_0x368b('0x4b')]=[{'all':!![]}];}_0x4a0275=_[_0x368b('0x42')]({},_0x4a0275,_0x490eb6[_0x368b('0x44')]);return db[_0x368b('0x30')][_0x368b('0x4c')](_0x4a0275)['then'](handleEntityNotFound(_0x151711,null))['then'](respondWithResult(_0x151711,null))[_0x368b('0x48')](handleError(_0x151711,null));};exports[_0x368b('0x4d')]=function(_0x1c8755,_0x5a9d70){return db[_0x368b('0x30')][_0x368b('0x4d')](_0x1c8755[_0x368b('0x4e')],{})[_0x368b('0x28')](respondWithResult(_0x5a9d70,0xc9))[_0x368b('0x48')](handleError(_0x5a9d70,null));};exports[_0x368b('0x27')]=function(_0x8f35b,_0x1174fa){if(_0x8f35b[_0x368b('0x4e')]['id']){delete _0x8f35b[_0x368b('0x4e')]['id'];}return db['ChatQueueReport'][_0x368b('0x4c')]({'where':{'id':_0x8f35b['params']['id']}})[_0x368b('0x28')](handleEntityNotFound(_0x1174fa,null))['then'](saveUpdates(_0x8f35b[_0x368b('0x4e')],null))['then'](respondWithResult(_0x1174fa,null))[_0x368b('0x48')](handleError(_0x1174fa,null));};exports[_0x368b('0x29')]=function(_0x3b8a12,_0x458d9a){return db['ChatQueueReport'][_0x368b('0x4c')]({'where':{'id':_0x3b8a12[_0x368b('0x49')]['id']}})[_0x368b('0x28')](handleEntityNotFound(_0x458d9a,null))[_0x368b('0x28')](removeEntity(_0x458d9a,null))[_0x368b('0x48')](handleError(_0x458d9a,null));};exports[_0x368b('0x4f')]=function(_0x3898a8,_0x15078b){return db[_0x368b('0x30')]['describe']()[_0x368b('0x28')](respondWithResult(_0x15078b,null))[_0x368b('0x48')](handleError(_0x15078b,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 322dd48..56497bc 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(_0xc5d1da,_0x352baf){var _0xd9d348=function(_0x5138b4){while(--_0x5138b4){_0xc5d1da['push'](_0xc5d1da['shift']());}};_0xd9d348(++_0x352baf);}(_0xb7e7,0x121));var _0x7b7e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb7e7[_0xc4001c];return _0x49f7bc;};'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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x3b023e,_0x1a2005){var _0x56da0f=function(_0x40ad61){while(--_0x40ad61){_0x3b023e['push'](_0x3b023e['shift']());}};_0x56da0f(++_0x1a2005);}(_0x757a,0xde));var _0xa757=function(_0x4efdf6,_0x537f4a){_0x4efdf6=_0x4efdf6-0x0;var _0x160551=_0x757a[_0x4efdf6];return _0x160551;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 2958750..74c463e 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 _0x97c1=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash'];(function(_0x64d376,_0xe4f981){var _0x42d917=function(_0x131286){while(--_0x131286){_0x64d376['push'](_0x64d376['shift']());}};_0x42d917(++_0xe4f981);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['CreateChatQueueReport']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')](_0x372311[_0x197c('0x15')],{'raw':_0x372311['options']?_0x372311[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![]})[_0x197c('0x18')](function(_0x5c278a){logger[_0x197c('0xa')](_0x197c('0x19'),_0x372311);logger[_0x197c('0x1a')](_0x197c('0x19'),_0x372311,JSON[_0x197c('0xe')](_0x5c278a));_0x50ac52(_0x5c278a);})[_0x197c('0x12')](function(_0x362bbf){logger[_0x197c('0xf')](_0x197c('0x19'),_0x362bbf[_0x197c('0x10')],_0x372311);_0x1725d9(_0x47aaa9[_0x197c('0xf')](0x1f4,_0x362bbf[_0x197c('0x10')]));});});};exports[_0x197c('0x1b')]=function(_0x2a1310){var _0x37b040=this;return new Promise(function(_0x25486a,_0x5f4a02){return db[_0x197c('0x13')][_0x197c('0x1c')](_0x2a1310[_0x197c('0x15')],{'raw':_0x2a1310['options']?_0x2a1310[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1310['options']?_0x2a1310['options'][_0x197c('0x1d')]||null:null,'attributes':_0x2a1310['options']?_0x2a1310[_0x197c('0x16')][_0x197c('0x1e')]||null:null,'limit':_0x2a1310[_0x197c('0x16')]?_0x2a1310[_0x197c('0x16')][_0x197c('0x1f')]||null:null})[_0x197c('0x18')](function(_0x2b6154){logger[_0x197c('0xa')](_0x197c('0x1b'),_0x2a1310);logger['debug']('UpdateChatQueueReport',_0x2a1310,JSON['stringify'](_0x2b6154));_0x25486a(_0x2b6154);})['catch'](function(_0x5f7425){logger['error'](_0x197c('0x1b'),_0x5f7425[_0x197c('0x10')],_0x2a1310);_0x5f4a02(_0x37b040['error'](0x1f4,_0x5f7425[_0x197c('0x10')]));});});}; \ No newline at end of file +var _0x640d=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','then','lodash','util'];(function(_0x142eef,_0x548870){var _0x1af9f3=function(_0x37d21c){while(--_0x37d21c){_0x142eef['push'](_0x142eef['shift']());}};_0x1af9f3(++_0x548870);}(_0x640d,0x130));var _0xd640=function(_0x108749,_0x1c103a){_0x108749=_0x108749-0x0;var _0x5088f0=_0x640d[_0x108749];return _0x5088f0;};'use strict';var _=require(_0xd640('0x0'));var util=require(_0xd640('0x1'));var moment=require(_0xd640('0x2'));var BPromise=require(_0xd640('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd640('0x4'));var db=require(_0xd640('0x5'))['db'];var utils=require(_0xd640('0x6'));var logger=require(_0xd640('0x7'))(_0xd640('0x8'));var config=require(_0xd640('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd640('0xa')][_0xd640('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dfb95,_0x5d003c,_0x4832a2){return new BPromise(function(_0x7e21bd,_0x4fe84e){return client[_0xd640('0xc')](_0x1dfb95,_0x4832a2)['then'](function(_0x3fad7b){logger[_0xd640('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x5d003c,_0xd640('0xe'));logger[_0xd640('0xf')](_0xd640('0x10'),_0x5d003c,'request\x20sent',JSON[_0xd640('0x11')](_0x3fad7b));if(_0x3fad7b['error']){if(_0x3fad7b[_0xd640('0x12')][_0xd640('0x13')]===0x1f4){logger['error'](_0xd640('0x14'),_0x5d003c,_0x3fad7b[_0xd640('0x12')][_0xd640('0x15')]);return _0x4fe84e(_0x3fad7b[_0xd640('0x12')][_0xd640('0x15')]);}logger[_0xd640('0x12')](_0xd640('0x14'),_0x5d003c,_0x3fad7b[_0xd640('0x12')]['message']);return _0x7e21bd(_0x3fad7b[_0xd640('0x12')][_0xd640('0x15')]);}else{logger[_0xd640('0xd')](_0xd640('0x14'),_0x5d003c,'request\x20sent');_0x7e21bd(_0x3fad7b['result'][_0xd640('0x15')]);}})[_0xd640('0x16')](function(_0x237a91){logger[_0xd640('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x5d003c,_0x237a91);_0x4fe84e(_0x237a91);});});}exports[_0xd640('0x17')]=function(_0x5a3a18){var _0x8552f2=this;return new Promise(function(_0x2d11a5,_0x4c2786){return db[_0xd640('0x18')][_0xd640('0x19')](_0x5a3a18[_0xd640('0x1a')],{'raw':_0x5a3a18['options']?_0x5a3a18[_0xd640('0x1b')][_0xd640('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3ac573){logger[_0xd640('0xd')]('CreateChatQueueReport',_0x5a3a18);logger[_0xd640('0xf')](_0xd640('0x17'),_0x5a3a18,JSON[_0xd640('0x11')](_0x3ac573));_0x2d11a5(_0x3ac573);})['catch'](function(_0x532259){logger['error'](_0xd640('0x17'),_0x532259['message'],_0x5a3a18);_0x4c2786(_0x8552f2['error'](0x1f4,_0x532259['message']));});});};exports[_0xd640('0x1d')]=function(_0x178e98){var _0x13188c=this;return new Promise(function(_0x130483,_0x487c2a){return db[_0xd640('0x18')]['update'](_0x178e98['body'],{'raw':_0x178e98['options']?_0x178e98[_0xd640('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x178e98['options']?_0x178e98[_0xd640('0x1b')][_0xd640('0x1e')]||null:null,'attributes':_0x178e98[_0xd640('0x1b')]?_0x178e98[_0xd640('0x1b')][_0xd640('0x1f')]||null:null,'limit':_0x178e98[_0xd640('0x1b')]?_0x178e98[_0xd640('0x1b')][_0xd640('0x20')]||null:null})[_0xd640('0x21')](function(_0xe56ec3){logger[_0xd640('0xd')](_0xd640('0x1d'),_0x178e98);logger[_0xd640('0xf')](_0xd640('0x1d'),_0x178e98,JSON['stringify'](_0xe56ec3));_0x130483(_0xe56ec3);})[_0xd640('0x16')](function(_0x1820c9){logger[_0xd640('0x12')](_0xd640('0x1d'),_0x1820c9[_0xd640('0x15')],_0x178e98);_0x487c2a(_0x13188c[_0xd640('0x12')](0x1f4,_0x1820c9[_0xd640('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index da63609..6cbf233 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 _0x13ae=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x4bbf8a,_0x2dc0a0){var _0x535b40=function(_0x30ec74){while(--_0x30ec74){_0x4bbf8a['push'](_0x4bbf8a['shift']());}};_0x535b40(++_0x2dc0a0);}(_0x13ae,0x1a0));var _0xe13a=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x13ae[_0x36eaaa];return _0x461349;};'use strict';var multer=require('multer');var util=require(_0xe13a('0x0'));var path=require(_0xe13a('0x1'));var timeout=require(_0xe13a('0x2'));var express=require(_0xe13a('0x3'));var router=express[_0xe13a('0x4')]();var fs_extra=require(_0xe13a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe13a('0x6'));var config=require(_0xe13a('0x7'));var controller=require(_0xe13a('0x8'));router['get']('/',auth[_0xe13a('0x9')](),controller[_0xe13a('0xa')]);router[_0xe13a('0xb')](_0xe13a('0xc'),auth[_0xe13a('0x9')](),controller[_0xe13a('0xd')]);router[_0xe13a('0xb')](_0xe13a('0xe'),auth[_0xe13a('0x9')](),controller['show']);router[_0xe13a('0xf')]('/',auth[_0xe13a('0x9')](),controller[_0xe13a('0x10')]);router[_0xe13a('0x11')](_0xe13a('0xe'),auth[_0xe13a('0x9')](),controller[_0xe13a('0x12')]);router[_0xe13a('0x13')](_0xe13a('0xe'),auth['isAuthenticated'](),controller[_0xe13a('0x14')]);module[_0xe13a('0x15')]=router; \ No newline at end of file +var _0xaf8c=['create','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','show','post'];(function(_0x2d522c,_0x5b0a48){var _0x479989=function(_0x4d1219){while(--_0x4d1219){_0x2d522c['push'](_0x2d522c['shift']());}};_0x479989(++_0x5b0a48);}(_0xaf8c,0x7d));var _0xcaf8=function(_0x1b16a5,_0x44e77b){_0x1b16a5=_0x1b16a5-0x0;var _0x2fa5c4=_0xaf8c[_0x1b16a5];return _0x2fa5c4;};'use strict';var multer=require(_0xcaf8('0x0'));var util=require('util');var path=require(_0xcaf8('0x1'));var timeout=require(_0xcaf8('0x2'));var express=require(_0xcaf8('0x3'));var router=express[_0xcaf8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcaf8('0x5'));var interaction=require(_0xcaf8('0x6'));var config=require(_0xcaf8('0x7'));var controller=require(_0xcaf8('0x8'));router[_0xcaf8('0x9')]('/',auth[_0xcaf8('0xa')](),controller[_0xcaf8('0xb')]);router[_0xcaf8('0x9')]('/describe',auth[_0xcaf8('0xa')](),controller[_0xcaf8('0xc')]);router[_0xcaf8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcaf8('0xd')]);router[_0xcaf8('0xe')]('/',auth[_0xcaf8('0xa')](),controller[_0xcaf8('0xf')]);router['put'](_0xcaf8('0x10'),auth[_0xcaf8('0xa')](),controller[_0xcaf8('0x11')]);router[_0xcaf8('0x12')](_0xcaf8('0x10'),auth[_0xcaf8('0xa')](),controller[_0xcaf8('0x13')]);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 128516b..6dc85fc 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x9bde,0xe1));var _0xe9bd=function(_0xf4fba3,_0x1ad582){_0xf4fba3=_0xf4fba3-0x0;var _0x562c20=_0x9bde[_0xf4fba3];return _0x562c20;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2fa2d6,_0x5d7dc8){var _0x3eb8ab=function(_0x23081f){while(--_0x23081f){_0x2fa2d6['push'](_0x2fa2d6['shift']());}};_0x3eb8ab(++_0x5d7dc8);}(_0x34e8,0x12c));var _0x834e=function(_0x382cac,_0x1b32a1){_0x382cac=_0x382cac-0x0;var _0x1cff24=_0x34e8[_0x382cac];return _0x1cff24;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1f08cd3..dba22cd 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 _0xadf1=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','keys','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','querystring','papaparse'];(function(_0x5ef628,_0x471f3e){var _0x3dc35a=function(_0x25ccf9){while(--_0x25ccf9){_0x5ef628['push'](_0x5ef628['shift']());}};_0x3dc35a(++_0x471f3e);}(_0xadf1,0x7e));var _0x1adf=function(_0x12b0bb,_0x3108b0){_0x12b0bb=_0x12b0bb-0x0;var _0x45cf73=_0xadf1[_0x12b0bb];return _0x45cf73;};'use strict';var emlformat=require(_0x1adf('0x0'));var rimraf=require(_0x1adf('0x1'));var zipdir=require(_0x1adf('0x2'));var jsonpatch=require(_0x1adf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1adf('0x4'));var Mustache=require(_0x1adf('0x5'));var util=require(_0x1adf('0x6'));var path=require(_0x1adf('0x7'));var sox=require('sox');var csv=require(_0x1adf('0x8'));var ejs=require(_0x1adf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1adf('0xa'));var crypto=require('crypto');var jsforce=require(_0x1adf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1adf('0x8'));var querystring=require(_0x1adf('0xc'));var Papa=require(_0x1adf('0xd'));var Redis=require('ioredis');var authService=require(_0x1adf('0xe'));var qs=require(_0x1adf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1adf('0x10'));var logger=require(_0x1adf('0x11'))('api');var utils=require(_0x1adf('0x12'));var config=require(_0x1adf('0x13'));var licenseUtil=require(_0x1adf('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb40a3f,_0x157a11){_0x157a11=_0x157a11||0xcc;return function(_0xc0e180){if(_0xc0e180){return _0xb40a3f[_0x1adf('0x15')](_0x157a11);}return _0xb40a3f[_0x1adf('0x16')](_0x157a11)[_0x1adf('0x17')]();};}function respondWithResult(_0xa24a07,_0x5f574b){_0x5f574b=_0x5f574b||0xc8;return function(_0x548c01){if(_0x548c01){return _0xa24a07['status'](_0x5f574b)[_0x1adf('0x18')](_0x548c01);}};}function respondWithFilteredResult(_0xe52a30,_0x19b3da){return function(_0x71c053){if(_0x71c053){var _0x349295=typeof _0x19b3da[_0x1adf('0x19')]===_0x1adf('0x1a')&&typeof _0x19b3da[_0x1adf('0x1b')]===_0x1adf('0x1a');var _0x2de5ed=_0x71c053[_0x1adf('0x1c')];var _0x133a42=_0x349295?0x0:_0x19b3da['offset'];var _0x59677f=_0x349295?_0x71c053[_0x1adf('0x1c')]:_0x19b3da['offset']+_0x19b3da[_0x1adf('0x1b')];var _0x318d10;if(_0x59677f>=_0x2de5ed){_0x59677f=_0x2de5ed;_0x318d10=0xc8;}else{_0x318d10=0xce;}_0xe52a30[_0x1adf('0x16')](_0x318d10);return _0xe52a30[_0x1adf('0x1d')](_0x1adf('0x1e'),_0x133a42+'-'+_0x59677f+'/'+_0x2de5ed)['json'](_0x71c053);}return null;};}function patchUpdates(_0x37fdef){return function(_0x1d7433){try{jsonpatch['apply'](_0x1d7433,_0x37fdef,!![]);}catch(_0x311504){return BPromise[_0x1adf('0x1f')](_0x311504);}return _0x1d7433['save']();};}function saveUpdates(_0x318994,_0x1b6b04){return function(_0x21b8e2){if(_0x21b8e2){return _0x21b8e2[_0x1adf('0x20')](_0x318994)['then'](function(_0x51cee3){return _0x51cee3;});}return null;};}function removeEntity(_0x5e2e7c,_0x3c934b){return function(_0x506167){if(_0x506167){return _0x506167['destroy']()[_0x1adf('0x21')](function(){_0x5e2e7c[_0x1adf('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e8a1a,_0x541806){return function(_0xb6be63){if(!_0xb6be63){_0x3e8a1a[_0x1adf('0x15')](0x194);}return _0xb6be63;};}function handleError(_0x5e1ab5,_0x2c6d65){_0x2c6d65=_0x2c6d65||0x1f4;return function(_0x51e4b1){logger['error'](_0x51e4b1[_0x1adf('0x22')]);if(_0x51e4b1[_0x1adf('0x23')]){delete _0x51e4b1[_0x1adf('0x23')];}_0x5e1ab5[_0x1adf('0x16')](_0x2c6d65)[_0x1adf('0x24')](_0x51e4b1);};}exports[_0x1adf('0x25')]=function(_0x3869c9,_0x37d3d9){var _0x199415={},_0x1926f9={},_0x15b569={'count':0x0,'rows':[]};var _0x444b31=_[_0x1adf('0x26')](db[_0x1adf('0x27')][_0x1adf('0x28')],function(_0x103e47){return{'name':_0x103e47[_0x1adf('0x29')],'type':_0x103e47[_0x1adf('0x2a')][_0x1adf('0x2b')]};});_0x1926f9[_0x1adf('0x2c')]=_['map'](_0x444b31,_0x1adf('0x23'));_0x1926f9[_0x1adf('0x2d')]=_['keys'](_0x3869c9['query']);_0x1926f9[_0x1adf('0x2e')]=_[_0x1adf('0x2f')](_0x1926f9[_0x1adf('0x2c')],_0x1926f9[_0x1adf('0x2d')]);_0x199415[_0x1adf('0x30')]=_[_0x1adf('0x2f')](_0x1926f9[_0x1adf('0x2c')],qs[_0x1adf('0x31')](_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x31')]));_0x199415[_0x1adf('0x30')]=_0x199415[_0x1adf('0x30')]['length']?_0x199415[_0x1adf('0x30')]:_0x1926f9[_0x1adf('0x2c')];if(!_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x32')](_0x1adf('0x33'))){_0x199415[_0x1adf('0x1b')]=qs[_0x1adf('0x1b')](_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x1b')]);_0x199415[_0x1adf('0x19')]=qs[_0x1adf('0x19')](_0x3869c9['query']['offset']);}_0x199415[_0x1adf('0x34')]=qs['sort'](_0x3869c9['query'][_0x1adf('0x35')]);_0x199415[_0x1adf('0x36')]=qs[_0x1adf('0x2e')](_['pick'](_0x3869c9[_0x1adf('0x2d')],_0x1926f9[_0x1adf('0x2e')]),_0x444b31);if(_0x3869c9['query']['filter']){_0x199415[_0x1adf('0x36')]=_[_0x1adf('0x37')](_0x199415[_0x1adf('0x36')],{'$or':_['map'](_0x444b31,function(_0x207779){if(_0x207779[_0x1adf('0x2a')]!==_0x1adf('0x38')){var _0x369556={};_0x369556[_0x207779[_0x1adf('0x23')]]={'$like':'%'+_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x39')]+'%'};return _0x369556;}})});}_0x199415=_[_0x1adf('0x37')]({},_0x199415,_0x3869c9[_0x1adf('0x3a')]);var _0xe0e40={'where':_0x199415[_0x1adf('0x36')]};return db[_0x1adf('0x27')][_0x1adf('0x1c')](_0xe0e40)['then'](function(_0x5090ed){_0x15b569[_0x1adf('0x1c')]=_0x5090ed;if(_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x3b')]){_0x199415[_0x1adf('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x199415);})[_0x1adf('0x21')](function(_0x10d0a8){_0x15b569[_0x1adf('0x3d')]=_0x10d0a8;return _0x15b569;})[_0x1adf('0x21')](respondWithFilteredResult(_0x37d3d9,_0x199415))[_0x1adf('0x3e')](handleError(_0x37d3d9,null));};exports['show']=function(_0xf5032d,_0x278cb3){var _0x14b08a={'raw':!![],'where':{'id':_0xf5032d['params']['id']}},_0x32066e={};_0x32066e[_0x1adf('0x2c')]=_['keys'](db['ChatTransferReport'][_0x1adf('0x28')]);_0x32066e[_0x1adf('0x2d')]=_[_0x1adf('0x3f')](_0xf5032d[_0x1adf('0x2d')]);_0x32066e['filters']=_['intersection'](_0x32066e[_0x1adf('0x2c')],_0x32066e[_0x1adf('0x2d')]);_0x14b08a['attributes']=_[_0x1adf('0x2f')](_0x32066e[_0x1adf('0x2c')],qs[_0x1adf('0x31')](_0xf5032d[_0x1adf('0x2d')][_0x1adf('0x31')]));_0x14b08a[_0x1adf('0x30')]=_0x14b08a[_0x1adf('0x30')]['length']?_0x14b08a[_0x1adf('0x30')]:_0x32066e[_0x1adf('0x2c')];if(_0xf5032d[_0x1adf('0x2d')][_0x1adf('0x3b')]){_0x14b08a[_0x1adf('0x3c')]=[{'all':!![]}];}_0x14b08a=_[_0x1adf('0x37')]({},_0x14b08a,_0xf5032d['options']);return db[_0x1adf('0x27')][_0x1adf('0x40')](_0x14b08a)[_0x1adf('0x21')](handleEntityNotFound(_0x278cb3,null))[_0x1adf('0x21')](respondWithResult(_0x278cb3,null))[_0x1adf('0x3e')](handleError(_0x278cb3,null));};exports[_0x1adf('0x41')]=function(_0x5120c0,_0xa30f0a){return db[_0x1adf('0x27')][_0x1adf('0x41')](_0x5120c0['body'],{})['then'](respondWithResult(_0xa30f0a,0xc9))['catch'](handleError(_0xa30f0a,null));};exports[_0x1adf('0x20')]=function(_0x5850a0,_0x3fe2d9){if(_0x5850a0[_0x1adf('0x42')]['id']){delete _0x5850a0[_0x1adf('0x42')]['id'];}return db[_0x1adf('0x27')][_0x1adf('0x40')]({'where':{'id':_0x5850a0[_0x1adf('0x43')]['id']}})['then'](handleEntityNotFound(_0x3fe2d9,null))[_0x1adf('0x21')](saveUpdates(_0x5850a0[_0x1adf('0x42')],null))[_0x1adf('0x21')](respondWithResult(_0x3fe2d9,null))['catch'](handleError(_0x3fe2d9,null));};exports[_0x1adf('0x44')]=function(_0x398f21,_0x2049f7){return db[_0x1adf('0x27')][_0x1adf('0x40')]({'where':{'id':_0x398f21[_0x1adf('0x43')]['id']}})[_0x1adf('0x21')](handleEntityNotFound(_0x2049f7,null))['then'](removeEntity(_0x2049f7,null))[_0x1adf('0x3e')](handleError(_0x2049f7,null));};exports[_0x1adf('0x45')]=function(_0x4b11e0,_0x357f5b){return db['ChatTransferReport'][_0x1adf('0x45')]()[_0x1adf('0x21')](respondWithResult(_0x357f5b,null))[_0x1adf('0x3e')](handleError(_0x357f5b,null));}; \ No newline at end of file +var _0x5121=['limit','set','Content-Range','apply','save','update','then','stack','name','send','index','ChatTransferReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','map','VIRTUAL','filter','merge','options','include','rows','show','params','keys','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5121,0x19d));var _0x1512=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x5121[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x1512('0x0'));var rimraf=require(_0x1512('0x1'));var zipdir=require(_0x1512('0x2'));var jsonpatch=require(_0x1512('0x3'));var rp=require(_0x1512('0x4'));var moment=require('moment');var BPromise=require(_0x1512('0x5'));var Mustache=require(_0x1512('0x6'));var util=require('util');var path=require(_0x1512('0x7'));var sox=require('sox');var csv=require(_0x1512('0x8'));var ejs=require(_0x1512('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1512('0xa'));var crypto=require(_0x1512('0xb'));var jsforce=require(_0x1512('0xc'));var deskjs=require(_0x1512('0xd'));var toCsv=require(_0x1512('0x8'));var querystring=require('querystring');var Papa=require(_0x1512('0xe'));var Redis=require(_0x1512('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1512('0x10'));var as=require(_0x1512('0x11'));var hardwareService=require(_0x1512('0x12'));var logger=require(_0x1512('0x13'))(_0x1512('0x14'));var utils=require(_0x1512('0x15'));var config=require(_0x1512('0x16'));var licenseUtil=require(_0x1512('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5554bc,_0x3220e5){_0x3220e5=_0x3220e5||0xcc;return function(_0x4a6ae1){if(_0x4a6ae1){return _0x5554bc[_0x1512('0x18')](_0x3220e5);}return _0x5554bc[_0x1512('0x19')](_0x3220e5)[_0x1512('0x1a')]();};}function respondWithResult(_0x532b26,_0x52ef79){_0x52ef79=_0x52ef79||0xc8;return function(_0x2476fc){if(_0x2476fc){return _0x532b26[_0x1512('0x19')](_0x52ef79)[_0x1512('0x1b')](_0x2476fc);}};}function respondWithFilteredResult(_0x3efd6c,_0x1cdac9){return function(_0x41baf1){if(_0x41baf1){var _0x2e2421=typeof _0x1cdac9['offset']===_0x1512('0x1c')&&typeof _0x1cdac9['limit']==='undefined';var _0x1ad877=_0x41baf1[_0x1512('0x1d')];var _0x2bf1e4=_0x2e2421?0x0:_0x1cdac9['offset'];var _0x1c87b9=_0x2e2421?_0x41baf1[_0x1512('0x1d')]:_0x1cdac9[_0x1512('0x1e')]+_0x1cdac9[_0x1512('0x1f')];var _0x3866a7;if(_0x1c87b9>=_0x1ad877){_0x1c87b9=_0x1ad877;_0x3866a7=0xc8;}else{_0x3866a7=0xce;}_0x3efd6c[_0x1512('0x19')](_0x3866a7);return _0x3efd6c[_0x1512('0x20')](_0x1512('0x21'),_0x2bf1e4+'-'+_0x1c87b9+'/'+_0x1ad877)[_0x1512('0x1b')](_0x41baf1);}return null;};}function patchUpdates(_0x2b4aaf){return function(_0x10a986){try{jsonpatch[_0x1512('0x22')](_0x10a986,_0x2b4aaf,!![]);}catch(_0x3f23df){return BPromise['reject'](_0x3f23df);}return _0x10a986[_0x1512('0x23')]();};}function saveUpdates(_0x5301d8,_0x5e32b9){return function(_0x4ca4c9){if(_0x4ca4c9){return _0x4ca4c9[_0x1512('0x24')](_0x5301d8)[_0x1512('0x25')](function(_0x46e893){return _0x46e893;});}return null;};}function removeEntity(_0x5219bf,_0x36cab7){return function(_0x3d6e77){if(_0x3d6e77){return _0x3d6e77['destroy']()['then'](function(){_0x5219bf[_0x1512('0x19')](0xcc)[_0x1512('0x1a')]();});}};}function handleEntityNotFound(_0x2ea8bc,_0x44375d){return function(_0x4a220d){if(!_0x4a220d){_0x2ea8bc['sendStatus'](0x194);}return _0x4a220d;};}function handleError(_0x408871,_0x8caaee){_0x8caaee=_0x8caaee||0x1f4;return function(_0x43aaa6){logger['error'](_0x43aaa6[_0x1512('0x26')]);if(_0x43aaa6[_0x1512('0x27')]){delete _0x43aaa6['name'];}_0x408871[_0x1512('0x19')](_0x8caaee)[_0x1512('0x28')](_0x43aaa6);};}exports[_0x1512('0x29')]=function(_0x154d2c,_0x314e1e){var _0x1fd602={},_0xa61ff5={},_0x23a67b={'count':0x0,'rows':[]};var _0x2ce902=_['map'](db[_0x1512('0x2a')]['rawAttributes'],function(_0x1e43a9){return{'name':_0x1e43a9[_0x1512('0x2b')],'type':_0x1e43a9[_0x1512('0x2c')][_0x1512('0x2d')]};});_0xa61ff5[_0x1512('0x2e')]=_['map'](_0x2ce902,_0x1512('0x27'));_0xa61ff5[_0x1512('0x2f')]=_['keys'](_0x154d2c['query']);_0xa61ff5['filters']=_[_0x1512('0x30')](_0xa61ff5[_0x1512('0x2e')],_0xa61ff5[_0x1512('0x2f')]);_0x1fd602[_0x1512('0x31')]=_['intersection'](_0xa61ff5[_0x1512('0x2e')],qs[_0x1512('0x32')](_0x154d2c[_0x1512('0x2f')][_0x1512('0x32')]));_0x1fd602['attributes']=_0x1fd602[_0x1512('0x31')][_0x1512('0x33')]?_0x1fd602[_0x1512('0x31')]:_0xa61ff5['model'];if(!_0x154d2c[_0x1512('0x2f')][_0x1512('0x34')]('nolimit')){_0x1fd602['limit']=qs[_0x1512('0x1f')](_0x154d2c[_0x1512('0x2f')][_0x1512('0x1f')]);_0x1fd602['offset']=qs[_0x1512('0x1e')](_0x154d2c[_0x1512('0x2f')][_0x1512('0x1e')]);}_0x1fd602[_0x1512('0x35')]=qs['sort'](_0x154d2c[_0x1512('0x2f')][_0x1512('0x36')]);_0x1fd602[_0x1512('0x37')]=qs[_0x1512('0x38')](_[_0x1512('0x39')](_0x154d2c['query'],_0xa61ff5[_0x1512('0x38')]),_0x2ce902);if(_0x154d2c['query']['filter']){_0x1fd602[_0x1512('0x37')]=_['merge'](_0x1fd602[_0x1512('0x37')],{'$or':_[_0x1512('0x3a')](_0x2ce902,function(_0x88e82e){if(_0x88e82e[_0x1512('0x2c')]!==_0x1512('0x3b')){var _0x79f40f={};_0x79f40f[_0x88e82e[_0x1512('0x27')]]={'$like':'%'+_0x154d2c[_0x1512('0x2f')][_0x1512('0x3c')]+'%'};return _0x79f40f;}})});}_0x1fd602=_[_0x1512('0x3d')]({},_0x1fd602,_0x154d2c[_0x1512('0x3e')]);var _0x50c31c={'where':_0x1fd602[_0x1512('0x37')]};return db['ChatTransferReport'][_0x1512('0x1d')](_0x50c31c)[_0x1512('0x25')](function(_0x16c9d7){_0x23a67b['count']=_0x16c9d7;if(_0x154d2c[_0x1512('0x2f')]['includeAll']){_0x1fd602[_0x1512('0x3f')]=[{'all':!![]}];}return db[_0x1512('0x2a')]['findAll'](_0x1fd602);})[_0x1512('0x25')](function(_0x49d981){_0x23a67b[_0x1512('0x40')]=_0x49d981;return _0x23a67b;})[_0x1512('0x25')](respondWithFilteredResult(_0x314e1e,_0x1fd602))['catch'](handleError(_0x314e1e,null));};exports[_0x1512('0x41')]=function(_0x9ba335,_0x10162e){var _0x4d6356={'raw':!![],'where':{'id':_0x9ba335[_0x1512('0x42')]['id']}},_0x19589b={};_0x19589b['model']=_[_0x1512('0x43')](db[_0x1512('0x2a')]['rawAttributes']);_0x19589b['query']=_['keys'](_0x9ba335[_0x1512('0x2f')]);_0x19589b[_0x1512('0x38')]=_[_0x1512('0x30')](_0x19589b['model'],_0x19589b[_0x1512('0x2f')]);_0x4d6356[_0x1512('0x31')]=_[_0x1512('0x30')](_0x19589b[_0x1512('0x2e')],qs[_0x1512('0x32')](_0x9ba335[_0x1512('0x2f')][_0x1512('0x32')]));_0x4d6356[_0x1512('0x31')]=_0x4d6356[_0x1512('0x31')][_0x1512('0x33')]?_0x4d6356[_0x1512('0x31')]:_0x19589b[_0x1512('0x2e')];if(_0x9ba335[_0x1512('0x2f')]['includeAll']){_0x4d6356[_0x1512('0x3f')]=[{'all':!![]}];}_0x4d6356=_[_0x1512('0x3d')]({},_0x4d6356,_0x9ba335['options']);return db[_0x1512('0x2a')]['find'](_0x4d6356)[_0x1512('0x25')](handleEntityNotFound(_0x10162e,null))[_0x1512('0x25')](respondWithResult(_0x10162e,null))[_0x1512('0x44')](handleError(_0x10162e,null));};exports[_0x1512('0x45')]=function(_0x3aedfb,_0x492f93){return db[_0x1512('0x2a')][_0x1512('0x45')](_0x3aedfb[_0x1512('0x46')],{})[_0x1512('0x25')](respondWithResult(_0x492f93,0xc9))[_0x1512('0x44')](handleError(_0x492f93,null));};exports[_0x1512('0x24')]=function(_0x592c4e,_0x5cf900){if(_0x592c4e[_0x1512('0x46')]['id']){delete _0x592c4e[_0x1512('0x46')]['id'];}return db[_0x1512('0x2a')][_0x1512('0x47')]({'where':{'id':_0x592c4e['params']['id']}})['then'](handleEntityNotFound(_0x5cf900,null))[_0x1512('0x25')](saveUpdates(_0x592c4e[_0x1512('0x46')],null))[_0x1512('0x25')](respondWithResult(_0x5cf900,null))[_0x1512('0x44')](handleError(_0x5cf900,null));};exports[_0x1512('0x48')]=function(_0x435bd0,_0x56c11e){return db[_0x1512('0x2a')][_0x1512('0x47')]({'where':{'id':_0x435bd0[_0x1512('0x42')]['id']}})[_0x1512('0x25')](handleEntityNotFound(_0x56c11e,null))['then'](removeEntity(_0x56c11e,null))[_0x1512('0x44')](handleError(_0x56c11e,null));};exports['describe']=function(_0x3a7c06,_0x23b4dd){return db[_0x1512('0x2a')][_0x1512('0x49')]()[_0x1512('0x25')](respondWithResult(_0x23b4dd,null))['catch'](handleError(_0x23b4dd,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 255c5f7..f247b09 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 _0x3534=['../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x1974b4,_0x6429ed){var _0x48507e=function(_0x150f69){while(--_0x150f69){_0x1974b4['push'](_0x1974b4['shift']());}};_0x48507e(++_0x6429ed);}(_0x3534,0x95));var _0x4353=function(_0x3549ee,_0x244421){_0x3549ee=_0x3549ee-0x0;var _0x122077=_0x3534[_0x3549ee];return _0x122077;};'use strict';var _=require(_0x4353('0x0'));var util=require(_0x4353('0x1'));var logger=require('../../config/logger')(_0x4353('0x2'));var moment=require(_0x4353('0x3'));var BPromise=require(_0x4353('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4353('0x5'));var rimraf=require(_0x4353('0x6'));var config=require(_0x4353('0x7'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3a92e6,_0x3ea32e){return _0x3a92e6[_0x4353('0x8')](_0x4353('0x9'),attributes,{'tableName':_0x4353('0xa'),'paranoid':![],'indexes':[{'name':_0x4353('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x30ef=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x496d86,_0x2f5c02){var _0x515c72=function(_0x300fb2){while(--_0x300fb2){_0x496d86['push'](_0x496d86['shift']());}};_0x515c72(++_0x2f5c02);}(_0x30ef,0x10a));var _0xf30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf30e('0x0'));var util=require(_0xf30e('0x1'));var logger=require(_0xf30e('0x2'))(_0xf30e('0x3'));var moment=require(_0xf30e('0x4'));var BPromise=require(_0xf30e('0x5'));var rp=require(_0xf30e('0x6'));var fs=require('fs');var path=require(_0xf30e('0x7'));var rimraf=require('rimraf');var config=require(_0xf30e('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0xf30e('0x9')]=function(_0x29ec2e,_0x1d5b2b){return _0x29ec2e[_0xf30e('0xa')](_0xf30e('0xb'),attributes,{'tableName':_0xf30e('0xc'),'paranoid':![],'indexes':[{'name':_0xf30e('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 cd769c2..9e93c3a 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 _0x874f=['request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ChatTransferReport,\x20%s,\x20%s'];(function(_0x30d1b5,_0x27ffb9){var _0x572855=function(_0x3f8181){while(--_0x3f8181){_0x30d1b5['push'](_0x30d1b5['shift']());}};_0x572855(++_0x27ffb9);}(_0x874f,0xc4));var _0xf874=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x874f[_0x333798];return _0x389f4e;};'use strict';var _=require('lodash');var util=require(_0xf874('0x0'));var moment=require(_0xf874('0x1'));var BPromise=require(_0xf874('0x2'));var rs=require(_0xf874('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf874('0x4'))['db'];var utils=require(_0xf874('0x5'));var logger=require(_0xf874('0x6'))(_0xf874('0x7'));var config=require(_0xf874('0x8'));var jayson=require(_0xf874('0x9'));var client=jayson[_0xf874('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8d79,_0x402af,_0x3b7e10){return new BPromise(function(_0x5534ab,_0x1728d3){return client['request'](_0x4e8d79,_0x3b7e10)[_0xf874('0xb')](function(_0x22d30b){logger['info'](_0xf874('0xc'),_0x402af,_0xf874('0xd'));logger['debug'](_0xf874('0xe'),_0x402af,'request\x20sent',JSON['stringify'](_0x22d30b));if(_0x22d30b[_0xf874('0xf')]){if(_0x22d30b['error']['code']===0x1f4){logger[_0xf874('0xf')](_0xf874('0xc'),_0x402af,_0x22d30b[_0xf874('0xf')][_0xf874('0x10')]);return _0x1728d3(_0x22d30b['error'][_0xf874('0x10')]);}logger[_0xf874('0xf')](_0xf874('0xc'),_0x402af,_0x22d30b[_0xf874('0xf')][_0xf874('0x10')]);return _0x5534ab(_0x22d30b[_0xf874('0xf')][_0xf874('0x10')]);}else{logger[_0xf874('0x11')](_0xf874('0xc'),_0x402af,_0xf874('0xd'));_0x5534ab(_0x22d30b['result'][_0xf874('0x10')]);}})[_0xf874('0x12')](function(_0x191a4a){logger['error'](_0xf874('0xc'),_0x402af,_0x191a4a);_0x1728d3(_0x191a4a);});});} \ No newline at end of file +var _0xca08=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x2c5e54,_0x51cb03){var _0x484d8e=function(_0x1cb667){while(--_0x1cb667){_0x2c5e54['push'](_0x2c5e54['shift']());}};_0x484d8e(++_0x51cb03);}(_0xca08,0xc4));var _0x8ca0=function(_0x541f17,_0x8adfd1){_0x541f17=_0x541f17-0x0;var _0x4765f6=_0xca08[_0x541f17];return _0x4765f6;};'use strict';var _=require(_0x8ca0('0x0'));var util=require(_0x8ca0('0x1'));var moment=require('moment');var BPromise=require(_0x8ca0('0x2'));var rs=require(_0x8ca0('0x3'));var fs=require('fs');var Redis=require(_0x8ca0('0x4'));var db=require(_0x8ca0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ca0('0x6'));var config=require(_0x8ca0('0x7'));var jayson=require(_0x8ca0('0x8'));var client=jayson[_0x8ca0('0x9')][_0x8ca0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cc0f9,_0xd770e7,_0x59eace){return new BPromise(function(_0x456e8d,_0x56e282){return client['request'](_0x3cc0f9,_0x59eace)[_0x8ca0('0xb')](function(_0x188d63){logger[_0x8ca0('0xc')](_0x8ca0('0xd'),_0xd770e7,_0x8ca0('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xd770e7,_0x8ca0('0xe'),JSON[_0x8ca0('0xf')](_0x188d63));if(_0x188d63['error']){if(_0x188d63[_0x8ca0('0x10')][_0x8ca0('0x11')]===0x1f4){logger[_0x8ca0('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xd770e7,_0x188d63[_0x8ca0('0x10')]['message']);return _0x56e282(_0x188d63[_0x8ca0('0x10')][_0x8ca0('0x12')]);}logger['error'](_0x8ca0('0xd'),_0xd770e7,_0x188d63[_0x8ca0('0x10')][_0x8ca0('0x12')]);return _0x456e8d(_0x188d63[_0x8ca0('0x10')][_0x8ca0('0x12')]);}else{logger[_0x8ca0('0xc')](_0x8ca0('0xd'),_0xd770e7,'request\x20sent');_0x456e8d(_0x188d63['result'][_0x8ca0('0x12')]);}})[_0x8ca0('0x13')](function(_0x97e9ff){logger[_0x8ca0('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xd770e7,_0x97e9ff);_0x56e282(_0x97e9ff);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 484275b..c237647 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 _0x705d=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x55bbd7,_0x1042ab){var _0x269df9=function(_0x225bb1){while(--_0x225bb1){_0x55bbd7['push'](_0x55bbd7['shift']());}};_0x269df9(++_0x1042ab);}(_0x705d,0x102));var _0xd705=function(_0x5ebdf5,_0x40118d){_0x5ebdf5=_0x5ebdf5-0x0;var _0x3c1a63=_0x705d[_0x5ebdf5];return _0x3c1a63;};'use strict';var multer=require(_0xd705('0x0'));var util=require(_0xd705('0x1'));var path=require(_0xd705('0x2'));var timeout=require(_0xd705('0x3'));var express=require(_0xd705('0x4'));var router=express[_0xd705('0x5')]();var fs_extra=require(_0xd705('0x6'));var auth=require(_0xd705('0x7'));var interaction=require(_0xd705('0x8'));var config=require('../../config/environment');var controller=require(_0xd705('0x9'));router[_0xd705('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd705('0xb'),auth[_0xd705('0xc')](),controller[_0xd705('0xd')]);router['get'](_0xd705('0xe'),auth[_0xd705('0xc')](),controller[_0xd705('0xf')]);router[_0xd705('0x10')]('/',auth['isAuthenticated'](),controller[_0xd705('0x11')]);router[_0xd705('0x12')](_0xd705('0xe'),auth[_0xd705('0xc')](),controller[_0xd705('0x13')]);router[_0xd705('0x14')](_0xd705('0xe'),auth[_0xd705('0xc')](),controller[_0xd705('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf2ba=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf2ba,0x113));var _0xaf2b=function(_0x3b0f80,_0x1a666a){_0x3b0f80=_0x3b0f80-0x0;var _0x52d4bf=_0xf2ba[_0x3b0f80];return _0x52d4bf;};'use strict';var multer=require('multer');var util=require(_0xaf2b('0x0'));var path=require(_0xaf2b('0x1'));var timeout=require(_0xaf2b('0x2'));var express=require('express');var router=express[_0xaf2b('0x3')]();var fs_extra=require(_0xaf2b('0x4'));var auth=require(_0xaf2b('0x5'));var interaction=require(_0xaf2b('0x6'));var config=require(_0xaf2b('0x7'));var controller=require('./chatTransferReport.controller');router[_0xaf2b('0x8')]('/',auth[_0xaf2b('0x9')](),controller[_0xaf2b('0xa')]);router['get'](_0xaf2b('0xb'),auth[_0xaf2b('0x9')](),controller['describe']);router[_0xaf2b('0x8')](_0xaf2b('0xc'),auth[_0xaf2b('0x9')](),controller[_0xaf2b('0xd')]);router[_0xaf2b('0xe')]('/',auth['isAuthenticated'](),controller[_0xaf2b('0xf')]);router[_0xaf2b('0x10')](_0xaf2b('0xc'),auth[_0xaf2b('0x9')](),controller[_0xaf2b('0x11')]);router[_0xaf2b('0x12')](_0xaf2b('0xc'),auth[_0xaf2b('0x9')](),controller[_0xaf2b('0x13')]);module[_0xaf2b('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 2e28dce..6014693 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 _0x2e7b=['You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','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','Agent','#011F6A','#ffffff','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','INTEGER','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','ENUM','thumb','stringify','input','name','text','email','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e7b,0x6a));var _0xb2e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2e7b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb2e7('0x0'));var rs=require(_0xb2e7('0x1'));module[_0xb2e7('0x2')]={'name':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x4')},'customerAlias':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![],'defaultValue':_0xb2e7('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![],'defaultValue':_0xb2e7('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb2e7('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb2e7('0x3')]},'animation':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb2e7('0x8'),'squared'),'defaultValue':_0xb2e7('0x8')},'header_online':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x9')},'start_chat_button':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xa')},'offline_chat_button':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xb')},'header_offline':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb2e7('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb2e7('0xd')]},'closingQuestion':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xf')},'noteTitle':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x10')},'placeholderMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x11')},'closingMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb2e7('0x12')]('star',_0xb2e7('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb2e7('0xc')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb2e7('0xd')],'defaultValue':function(){return JSON[_0xb2e7('0x14')]({'items':[{'type':_0xb2e7('0x15'),'variable':null,'config':{'placeholder':_0xb2e7('0x16'),'type':_0xb2e7('0x17'),'required':!![]},'props':{'title':_0xb2e7('0x16'),'helpText':''}},{'type':_0xb2e7('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb2e7('0x18'),'type':_0xb2e7('0x18')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xb2e7('0x19'))?JSON[_0xb2e7('0x1a')](this[_0xb2e7('0x1b')](_0xb2e7('0x19'))):{};},'set':function(_0x4b9602){return this[_0xb2e7('0x1c')](_0xb2e7('0x19'),JSON['stringify'](_0x4b9602));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xb2e7('0x14')]({'items':[{'type':_0xb2e7('0x15'),'props':{'title':_0xb2e7('0x18'),'helpText':''},'config':{'required':!![],'placeholder':_0xb2e7('0x18'),'type':_0xb2e7('0x18')},'variable':null},{'type':_0xb2e7('0x1d'),'config':{'placeholder':_0xb2e7('0x1e')},'props':{'title':_0xb2e7('0x1e'),'helpText':_0xb2e7('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0xb2e7('0x1b')](_0xb2e7('0x20'))?JSON[_0xb2e7('0x1a')](this[_0xb2e7('0x1b')](_0xb2e7('0x20'))):{};},'set':function(_0x14eae3){return this[_0xb2e7('0x1c')](_0xb2e7('0x20'),JSON[_0xb2e7('0x14')](_0x14eae3));}},'token':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb2e7('0x3')]},'forwardOffline':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb2e7('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb2e7('0x21')},'waitingMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb2e7('0x24')},'skipUnmanaged':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb2e7('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb2e7('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb2e7('0xd')],'defaultValue':function(){return _0xb2e7('0x25');}},'notificationSound':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x26')},'verticalAlignment':{'type':Sequelize[_0xb2e7('0xc')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x27')},'defaultTitle':{'type':Sequelize[_0xb2e7('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![],'defaultValue':_0xb2e7('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb2e7('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb2e7('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb2e7('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb2e7('0xc')],'comment':_0xb2e7('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![],'comment':_0xb2e7('0x2a'),'set':function(_0x52cfff){if(!_0x52cfff)this[_0xb2e7('0x1c')](_0xb2e7('0x2b'),null);this['setDataValue'](_0xb2e7('0x2c'),_0x52cfff);}},'vidaooEscalation':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![],'defaultValue':_0xb2e7('0x2d')},'vidaooNote':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':function(){return _0xb2e7('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb2e7('0xd')]}}; \ No newline at end of file +var _0x1db8=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','ENUM','star','thumb','TEXT','input','name','text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','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:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','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','email','Agent','#011F6A','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note'];(function(_0x5934ee,_0x23fa5f){var _0x10ea14=function(_0x46bbd5){while(--_0x46bbd5){_0x5934ee['push'](_0x5934ee['shift']());}};_0x10ea14(++_0x23fa5f);}(_0x1db8,0x177));var _0x81db=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x1db8[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0x81db('0x0'));var rs=require(_0x81db('0x1'));module[_0x81db('0x2')]={'name':{'type':Sequelize[_0x81db('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x4')},'mapKeyOffline':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x4')},'key':{'type':Sequelize[_0x81db('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x5')},'customerAlias':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':_0x81db('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':_0x81db('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x81db('0x3')]},'animation':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x81db('0x8')),'defaultValue':_0x81db('0x9')},'header_online':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0xb')},'offline_chat_button':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x81db('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0xf')},'noteTitle':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0x12')},'closingMessageButton':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x13')},'skipMessageButton':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x81db('0x14')](_0x81db('0x15'),_0x81db('0x16')),'defaultValue':_0x81db('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x81db('0xc')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x81db('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x81db('0x18'),'variable':null,'config':{'placeholder':_0x81db('0x19'),'type':_0x81db('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x81db('0x18'),'props':{'title':_0x81db('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x81db('0x4'),'type':_0x81db('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x81db('0x1b')](_0x81db('0x1c'))?JSON['parse'](this[_0x81db('0x1b')](_0x81db('0x1c'))):{};},'set':function(_0x74fc17){return this[_0x81db('0x1d')](_0x81db('0x1c'),JSON[_0x81db('0x1e')](_0x74fc17));}},'offlineForm':{'type':Sequelize[_0x81db('0x17')],'defaultValue':function(){return JSON[_0x81db('0x1e')]({'items':[{'type':_0x81db('0x18'),'props':{'title':_0x81db('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x81db('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x81db('0x1f')},'props':{'title':_0x81db('0x1f'),'helpText':_0x81db('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x81db('0x1b')](_0x81db('0x21'))?JSON['parse'](this[_0x81db('0x1b')]('offlineForm')):{};},'set':function(_0x32ac13){return this['setDataValue'](_0x81db('0x21'),JSON[_0x81db('0x1e')](_0x32ac13));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x81db('0x3')]},'forwardOffline':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0x23')},'offlineMessageBody':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x25')},'sendUnmanaged':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x13')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x81db('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x81db('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x81db('0x26');}},'notificationSound':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x81db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x28')},'verticalAlignment':{'type':Sequelize[_0x81db('0xc')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x81db('0xc')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':_0x81db('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x81db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x81db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x81db('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x81db('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![],'comment':_0x81db('0x2c'),'set':function(_0x264583){if(!_0x264583)this[_0x81db('0x1d')](_0x81db('0x2d'),null);this['setDataValue'](_0x81db('0x2e'),_0x264583);}},'vidaooEscalation':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x81db('0x3')]},'vidaooTopic':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':_0x81db('0x2f')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x81db('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x81db('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x81db('0x17')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 96f921f..2b0828e 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 _0xcd7e=['unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','MailAccountId','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','Owner','fullname','Tag','Tags','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','color','backgroundColor','addApplications','sequelize','bulkCreate','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachment','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatWebsite.socket','register','jayson/promise','client','http','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','defaults','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s'];(function(_0x3ad129,_0x2d3342){var _0x143c9d=function(_0xaf7c4f){while(--_0xaf7c4f){_0x3ad129['push'](_0x3ad129['shift']());}};_0x143c9d(++_0x2d3342);}(_0xcd7e,0x83));var _0xecd7=function(_0x54c10d,_0x2f2251){_0x54c10d=_0x54c10d-0x0;var _0x1fa703=_0xcd7e[_0x54c10d];return _0x1fa703;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xecd7('0x0'));var jsonpatch=require(_0xecd7('0x1'));var rp=require(_0xecd7('0x2'));var moment=require(_0xecd7('0x3'));var BPromise=require(_0xecd7('0x4'));var Mustache=require(_0xecd7('0x5'));var util=require(_0xecd7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xecd7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecd7('0x8'));var _=require(_0xecd7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xecd7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xecd7('0x7'));var querystring=require(_0xecd7('0xb'));var Papa=require(_0xecd7('0xc'));var Redis=require(_0xecd7('0xd'));var authService=require(_0xecd7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xecd7('0xf'));var hardwareService=require(_0xecd7('0x10'));var logger=require(_0xecd7('0x11'))('api');var utils=require(_0xecd7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xecd7('0x13'));var db=require(_0xecd7('0x14'))['db'];config[_0xecd7('0x15')]=_['defaults'](config[_0xecd7('0x15')],{'host':_0xecd7('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecd7('0x15')]));require(_0xecd7('0x17'))[_0xecd7('0x18')](socket);var jayson=require(_0xecd7('0x19'));var client=jayson[_0xecd7('0x1a')][_0xecd7('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xecd7('0x1a')][_0xecd7('0x1b')]({'port':0x232b});var client9001=jayson['client'][_0xecd7('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x4fbfb8,_0x3f0f2a,_0x19bb9e,_0x554c55){return new BPromise(function(_0x38a0b8,_0x332035){var _0x5f4c70=_0x554c55||client;return _0x5f4c70['request'](_0x4fbfb8,_0x19bb9e)[_0xecd7('0x1c')](function(_0x27563f){logger['info'](_0xecd7('0x1d'),_0x3f0f2a,'request\x20sent');logger[_0xecd7('0x1e')](_0xecd7('0x1f'),_0x3f0f2a,_0xecd7('0x20'),JSON[_0xecd7('0x21')](_0x27563f));if(_0x27563f[_0xecd7('0x22')]){if(_0x27563f[_0xecd7('0x22')][_0xecd7('0x23')]===0x1f4){logger[_0xecd7('0x22')](_0xecd7('0x1d'),_0x3f0f2a,_0x27563f[_0xecd7('0x22')]['message']);return _0x332035(_0x27563f[_0xecd7('0x22')][_0xecd7('0x24')]);}logger[_0xecd7('0x22')](_0xecd7('0x1d'),_0x3f0f2a,_0x27563f[_0xecd7('0x22')][_0xecd7('0x24')]);return _0x38a0b8(_0x27563f[_0xecd7('0x22')]['message']);}else{logger['info'](_0xecd7('0x1d'),_0x3f0f2a,_0xecd7('0x20'));_0x38a0b8(_0x27563f[_0xecd7('0x25')][_0xecd7('0x24')]);}})['catch'](function(_0x575115){logger[_0xecd7('0x22')](_0xecd7('0x1d'),_0x3f0f2a,_0x575115);_0x332035(_0x575115);});});}function respondWithStatusCode(_0x5231cc,_0x598a26){_0x598a26=_0x598a26||0xcc;return function(_0x37a531){if(_0x37a531){return _0x5231cc[_0xecd7('0x26')](_0x598a26);}return _0x5231cc[_0xecd7('0x27')](_0x598a26)[_0xecd7('0x28')]();};}function respondWithResult(_0x1ced94,_0xcfd0aa){_0xcfd0aa=_0xcfd0aa||0xc8;return function(_0x9104fb){if(_0x9104fb){return _0x1ced94[_0xecd7('0x27')](_0xcfd0aa)[_0xecd7('0x29')](_0x9104fb);}};}function respondWithFilteredResult(_0x3eaa9a,_0x1ef9fb){return function(_0x2e4582){if(_0x2e4582){var _0x2e28e1=typeof _0x1ef9fb[_0xecd7('0x2a')]==='undefined'&&typeof _0x1ef9fb[_0xecd7('0x2b')]===_0xecd7('0x2c');var _0x102f7b=_0x2e4582['count'];var _0x1a0bc2=_0x2e28e1?0x0:_0x1ef9fb[_0xecd7('0x2a')];var _0x3d19a2=_0x2e28e1?_0x2e4582[_0xecd7('0x2d')]:_0x1ef9fb[_0xecd7('0x2a')]+_0x1ef9fb['limit'];var _0x973802;if(_0x3d19a2>=_0x102f7b){_0x3d19a2=_0x102f7b;_0x973802=0xc8;}else{_0x973802=0xce;}_0x3eaa9a['status'](_0x973802);return _0x3eaa9a[_0xecd7('0x2e')](_0xecd7('0x2f'),_0x1a0bc2+'-'+_0x3d19a2+'/'+_0x102f7b)[_0xecd7('0x29')](_0x2e4582);}return null;};}function patchUpdates(_0x1f0795){return function(_0x2b456c){try{jsonpatch[_0xecd7('0x30')](_0x2b456c,_0x1f0795,!![]);}catch(_0x45da92){return BPromise[_0xecd7('0x31')](_0x45da92);}return _0x2b456c[_0xecd7('0x32')]();};}function saveUpdates(_0x33c985,_0x58f433){return function(_0x1f94a5){if(_0x1f94a5){return _0x1f94a5[_0xecd7('0x33')](_0x33c985)[_0xecd7('0x1c')](function(_0x9f42df){return _0x9f42df;});}return null;};}function removeEntity(_0x5bb352,_0x1ff2c8){return function(_0x330028){if(_0x330028){return _0x330028[_0xecd7('0x34')]()['then'](function(){var _0xb0f823=_0x330028[_0xecd7('0x35')]({'plain':!![]});var _0x1da4c9=_0xecd7('0x36');return db[_0xecd7('0x37')][_0xecd7('0x34')]({'where':{'type':_0x1da4c9,'resourceId':_0xb0f823['id']}})['then'](function(){return _0x330028;});})[_0xecd7('0x1c')](function(){_0x5bb352[_0xecd7('0x27')](0xcc)[_0xecd7('0x28')]();});}};}function handleEntityNotFound(_0x5e9e75,_0x5add50){return function(_0x271249){if(!_0x271249){_0x5e9e75[_0xecd7('0x26')](0x194);}return _0x271249;};}function handleError(_0x2dd507,_0x27183c){_0x27183c=_0x27183c||0x1f4;return function(_0x1e87ea){logger[_0xecd7('0x22')](_0x1e87ea[_0xecd7('0x38')]);if(_0x1e87ea['name']){delete _0x1e87ea[_0xecd7('0x39')];}_0x2dd507[_0xecd7('0x27')](_0x27183c)[_0xecd7('0x3a')](_0x1e87ea);};}exports[_0xecd7('0x3b')]=function(_0x35a243,_0x4698e4){var _0x390012={'include':[{'model':db[_0xecd7('0x3c')],'as':_0xecd7('0x3d')}]},_0x46216a={},_0x20d69f={'count':0x0,'rows':[]};var _0x1bd673=_[_0xecd7('0x3e')](db[_0xecd7('0x3f')][_0xecd7('0x40')],function(_0x5f28f5){return{'name':_0x5f28f5[_0xecd7('0x41')],'type':_0x5f28f5[_0xecd7('0x42')][_0xecd7('0x43')]};});_0x46216a[_0xecd7('0x44')]=_[_0xecd7('0x3e')](_0x1bd673,_0xecd7('0x39'));_0x46216a['query']=_[_0xecd7('0x45')](_0x35a243[_0xecd7('0x46')]);_0x46216a[_0xecd7('0x47')]=_['intersection'](_0x46216a[_0xecd7('0x44')],_0x46216a[_0xecd7('0x46')]);_0x390012[_0xecd7('0x48')]=_['intersection'](_0x46216a[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x35a243[_0xecd7('0x46')]['fields']));_0x390012[_0xecd7('0x48')]=_0x390012[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x390012['attributes']:_0x46216a[_0xecd7('0x44')];if(!_0x35a243[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x390012['limit']=qs['limit'](_0x35a243[_0xecd7('0x46')]['limit']);_0x390012[_0xecd7('0x2a')]=qs['offset'](_0x35a243['query'][_0xecd7('0x2a')]);}_0x390012[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x35a243[_0xecd7('0x46')][_0xecd7('0x4e')]);_0x390012['where']=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x35a243['query'],_0x46216a['filters']),_0x1bd673);if(_0x35a243[_0xecd7('0x46')][_0xecd7('0x50')]){_0x390012[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x390012['where'],{'$or':_['map'](_0x1bd673,function(_0x358762){if(_0x358762[_0xecd7('0x42')]!==_0xecd7('0x53')){var _0x1d33a5={};_0x1d33a5[_0x358762[_0xecd7('0x39')]]={'$like':'%'+_0x35a243[_0xecd7('0x46')][_0xecd7('0x50')]+'%'};return _0x1d33a5;}})});}_0x390012=_['merge']({},_0x390012,_0x35a243[_0xecd7('0x54')]);var _0x18b8dd={'where':_0x390012['where']};return db[_0xecd7('0x3f')][_0xecd7('0x2d')](_0x18b8dd)[_0xecd7('0x1c')](function(_0x17516f){_0x20d69f[_0xecd7('0x2d')]=_0x17516f;if(_0x35a243[_0xecd7('0x46')][_0xecd7('0x55')]){_0x390012[_0xecd7('0x56')]=[{'all':!![]}];}return db[_0xecd7('0x3f')][_0xecd7('0x57')](_0x390012);})[_0xecd7('0x1c')](function(_0x5a0009){_0x20d69f[_0xecd7('0x58')]=_0x5a0009;return _0x20d69f;})[_0xecd7('0x1c')](respondWithFilteredResult(_0x4698e4,_0x390012))['catch'](handleError(_0x4698e4,null));};exports[_0xecd7('0x59')]=function(_0x7cc7ae,_0x237b5c){var _0x194b32={'raw':![],'where':{'id':_0x7cc7ae[_0xecd7('0x5a')]['id']},'include':[{'model':db[_0xecd7('0x3c')],'as':'mandatoryDispositionPause'}]},_0x21b034={};_0x21b034[_0xecd7('0x44')]=_[_0xecd7('0x45')](db['ChatWebsite']['rawAttributes']);_0x21b034['query']=_[_0xecd7('0x45')](_0x7cc7ae[_0xecd7('0x46')]);_0x21b034[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x21b034[_0xecd7('0x44')],_0x21b034['query']);_0x194b32[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x21b034[_0xecd7('0x44')],qs['fields'](_0x7cc7ae[_0xecd7('0x46')][_0xecd7('0x49')]));_0x194b32[_0xecd7('0x48')]=_0x194b32[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x194b32[_0xecd7('0x48')]:_0x21b034['model'];if(_0x7cc7ae['query']['includeAll']){_0x194b32[_0xecd7('0x56')]=[{'all':!![]}];}_0x194b32=_['merge']({},_0x194b32,_0x7cc7ae[_0xecd7('0x54')]);return db[_0xecd7('0x3f')]['find'](_0x194b32)[_0xecd7('0x1c')](handleEntityNotFound(_0x237b5c,null))['then'](respondWithResult(_0x237b5c,null))[_0xecd7('0x5c')](handleError(_0x237b5c,null));};exports[_0xecd7('0x5d')]=function(_0xeb2ddf,_0x1e80e7){return db['ChatWebsite'][_0xecd7('0x5d')](_0xeb2ddf[_0xecd7('0x5e')],{})['then'](function(_0x643d1f){var _0xae2778=_0xeb2ddf[_0xecd7('0x5f')][_0xecd7('0x35')]({'plain':!![]});if(!_0xae2778)throw new Error(_0xecd7('0x60'));if(_0xae2778['role']==='user'){var _0x4312b1=_0x643d1f[_0xecd7('0x35')]({'plain':!![]});var _0x4a39d6=_0xecd7('0x36');return db[_0xecd7('0x61')][_0xecd7('0x62')]({'where':{'name':_0x4a39d6,'userProfileId':_0xae2778[_0xecd7('0x63')]},'raw':!![]})[_0xecd7('0x1c')](function(_0x5664ae){if(_0x5664ae&&_0x5664ae[_0xecd7('0x64')]===0x0){return db[_0xecd7('0x37')][_0xecd7('0x5d')]({'name':_0x4312b1[_0xecd7('0x39')],'resourceId':_0x4312b1['id'],'type':_0x5664ae['name'],'sectionId':_0x5664ae['id']},{})[_0xecd7('0x1c')](function(){return _0x643d1f;});}else{return _0x643d1f;}})[_0xecd7('0x5c')](function(_0x57d106){logger[_0xecd7('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57d106);throw _0x57d106;});}return _0x643d1f;})[_0xecd7('0x1c')](respondWithResult(_0x1e80e7,0xc9))[_0xecd7('0x5c')](handleError(_0x1e80e7,null));};exports['update']=function(_0x4e09ce,_0x53eb12){if(_0x4e09ce[_0xecd7('0x5e')]['id']){delete _0x4e09ce[_0xecd7('0x5e')]['id'];}return db['ChatWebsite'][_0xecd7('0x62')]({'where':{'id':_0x4e09ce[_0xecd7('0x5a')]['id']},'include':[{'model':db[_0xecd7('0x3c')],'as':_0xecd7('0x3d')}]})[_0xecd7('0x1c')](handleEntityNotFound(_0x53eb12,null))['then'](saveUpdates(_0x4e09ce[_0xecd7('0x5e')],null))['then'](respondWithResult(_0x53eb12,null))['catch'](handleError(_0x53eb12,null));};exports['destroy']=function(_0x2c937f,_0x3b9af5){return db['ChatWebsite']['find']({'where':{'id':_0x2c937f['params']['id']}})['then'](handleEntityNotFound(_0x3b9af5,null))[_0xecd7('0x1c')](removeEntity(_0x3b9af5,null))[_0xecd7('0x5c')](handleError(_0x3b9af5,null));};exports[_0xecd7('0x65')]=function(_0x3e2e8f,_0x1d0895){return db[_0xecd7('0x3f')]['describe']()[_0xecd7('0x1c')](respondWithResult(_0x1d0895,null))[_0xecd7('0x5c')](handleError(_0x1d0895,null));};exports[_0xecd7('0x66')]=function(_0xcd63d6,_0x5899f0,_0x47350d){if(_0xcd63d6[_0xecd7('0x5e')]['id']){delete _0xcd63d6['body']['id'];}return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0xcd63d6[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x5899f0,null))[_0xecd7('0x1c')](function(_0x31ef81){if(_0x31ef81){_0xcd63d6[_0xecd7('0x5e')][_0xecd7('0x67')]=_0x31ef81['id'];return db['Disposition'][_0xecd7('0x5d')](_0xcd63d6[_0xecd7('0x5e')]);}})[_0xecd7('0x1c')](respondWithResult(_0x5899f0,null))[_0xecd7('0x5c')](handleError(_0x5899f0,null));};exports[_0xecd7('0x68')]=function(_0x5a4e19,_0x30a3c6,_0x4d291d){var _0x1642fe={'raw':![],'where':{}};var _0x1d1510={};var _0x43b844={'count':0x0,'rows':[]};return db[_0xecd7('0x3f')][_0xecd7('0x69')]({'where':{'id':_0x5a4e19[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x30a3c6,null))[_0xecd7('0x1c')](function(_0x52f32b){if(_0x52f32b){_0x1d1510[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0x6a')][_0xecd7('0x40')]);_0x1d1510[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x5a4e19[_0xecd7('0x46')]);_0x1d1510[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x1d1510[_0xecd7('0x44')],_0x1d1510[_0xecd7('0x46')]);_0x1642fe['attributes']=_[_0xecd7('0x5b')](_0x1d1510[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x5a4e19['query'][_0xecd7('0x49')]));_0x1642fe[_0xecd7('0x48')]=_0x1642fe[_0xecd7('0x48')]['length']?_0x1642fe[_0xecd7('0x48')]:_0x1d1510[_0xecd7('0x44')];if(!_0x5a4e19['query'][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x1642fe[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x5a4e19['query']['limit']);_0x1642fe[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x5a4e19[_0xecd7('0x46')][_0xecd7('0x2a')]);}_0x1642fe[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x5a4e19[_0xecd7('0x46')]['sort']);_0x1642fe[_0xecd7('0x51')]=qs['filters'](_[_0xecd7('0x4f')](_0x5a4e19[_0xecd7('0x46')],_0x1d1510[_0xecd7('0x47')]));_0x1642fe[_0xecd7('0x51')][_0xecd7('0x67')]=_0x52f32b['id'];if(_0x5a4e19['query'][_0xecd7('0x50')]){_0x1642fe[_0xecd7('0x51')]=_['merge'](_0x1642fe[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x1642fe['attributes'],function(_0xc4d57e){var _0x31d945={};_0x31d945[_0xc4d57e]={'$like':'%'+_0x5a4e19[_0xecd7('0x46')]['filter']+'%'};return _0x31d945;})});}_0x1642fe=_[_0xecd7('0x52')]({},_0x1642fe,_0x5a4e19[_0xecd7('0x54')]);return db[_0xecd7('0x6a')]['count']({'where':_0x1642fe[_0xecd7('0x51')]})['then'](function(_0xb12c49){_0x43b844['count']=_0xb12c49;if(_0x5a4e19[_0xecd7('0x46')][_0xecd7('0x55')]){_0x1642fe[_0xecd7('0x56')]=[{'all':!![]}];}return db[_0xecd7('0x6a')][_0xecd7('0x57')](_0x1642fe);})[_0xecd7('0x1c')](function(_0x2b7a9b){_0x43b844[_0xecd7('0x58')]=_0x2b7a9b;return _0x43b844;});}})[_0xecd7('0x1c')](respondWithFilteredResult(_0x30a3c6,_0x1642fe))[_0xecd7('0x5c')](handleError(_0x30a3c6,null));};exports[_0xecd7('0x6b')]=function(_0x2dfe46,_0xf39385,_0x590ffd){return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x2dfe46[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0xf39385,null))[_0xecd7('0x1c')](function(_0x445d76){if(_0x445d76){return _0x445d76['removeDispositions'](_0x2dfe46[_0xecd7('0x46')][_0xecd7('0x6c')]);}})[_0xecd7('0x1c')](respondWithStatusCode(_0xf39385,null))[_0xecd7('0x5c')](handleError(_0xf39385,null));};exports['addAnswer']=function(_0xeeea32,_0x2c8eec,_0x3a0a2c){if(_0xeeea32['body']['id']){delete _0xeeea32['body']['id'];}return db[_0xecd7('0x3f')]['find']({'where':{'id':_0xeeea32[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x2c8eec,null))['then'](function(_0xfaec9){if(_0xfaec9){_0xeeea32[_0xecd7('0x5e')][_0xecd7('0x67')]=_0xfaec9['id'];return db[_0xecd7('0x6d')][_0xecd7('0x5d')](_0xeeea32[_0xecd7('0x5e')]);}})[_0xecd7('0x1c')](respondWithResult(_0x2c8eec,null))[_0xecd7('0x5c')](handleError(_0x2c8eec,null));};exports[_0xecd7('0x6e')]=function(_0x27ba7f,_0x16533b,_0x366b84){var _0x268dee={'raw':![],'where':{}};var _0x17724f={};var _0x4d28ec={'count':0x0,'rows':[]};return db[_0xecd7('0x3f')][_0xecd7('0x69')]({'where':{'id':_0x27ba7f[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x16533b,null))[_0xecd7('0x1c')](function(_0x6c3dcc){if(_0x6c3dcc){_0x17724f['model']=_[_0xecd7('0x45')](db[_0xecd7('0x6d')][_0xecd7('0x40')]);_0x17724f[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x27ba7f['query']);_0x17724f[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x17724f[_0xecd7('0x44')],_0x17724f[_0xecd7('0x46')]);_0x268dee['attributes']=_[_0xecd7('0x5b')](_0x17724f[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x27ba7f['query']['fields']));_0x268dee['attributes']=_0x268dee[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x268dee[_0xecd7('0x48')]:_0x17724f['model'];if(!_0x27ba7f[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x268dee[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x27ba7f[_0xecd7('0x46')]['limit']);_0x268dee['offset']=qs[_0xecd7('0x2a')](_0x27ba7f[_0xecd7('0x46')]['offset']);}_0x268dee[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x27ba7f['query']['sort']);_0x268dee['where']=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x27ba7f[_0xecd7('0x46')],_0x17724f[_0xecd7('0x47')]));_0x268dee['where'][_0xecd7('0x67')]=_0x6c3dcc['id'];if(_0x27ba7f[_0xecd7('0x46')][_0xecd7('0x50')]){_0x268dee[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x268dee[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x268dee[_0xecd7('0x48')],function(_0x19ce8b){var _0xac1951={};_0xac1951[_0x19ce8b]={'$like':'%'+_0x27ba7f['query'][_0xecd7('0x50')]+'%'};return _0xac1951;})});}_0x268dee=_[_0xecd7('0x52')]({},_0x268dee,_0x27ba7f[_0xecd7('0x54')]);return db['CannedAnswer']['count']({'where':_0x268dee['where']})[_0xecd7('0x1c')](function(_0x2315b7){_0x4d28ec[_0xecd7('0x2d')]=_0x2315b7;if(_0x27ba7f[_0xecd7('0x46')][_0xecd7('0x55')]){_0x268dee['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xecd7('0x57')](_0x268dee);})[_0xecd7('0x1c')](function(_0x1d569a){_0x4d28ec[_0xecd7('0x58')]=_0x1d569a;return _0x4d28ec;});}})['then'](respondWithFilteredResult(_0x16533b,_0x268dee))[_0xecd7('0x5c')](handleError(_0x16533b,null));};exports[_0xecd7('0x6f')]=function(_0x34f974,_0x1942e2,_0x1124d7){return db[_0xecd7('0x3f')]['find']({'where':{'id':_0x34f974['params']['id']}})['then'](handleEntityNotFound(_0x1942e2,null))[_0xecd7('0x1c')](function(_0x474842){if(_0x474842){return _0x474842[_0xecd7('0x6f')](_0x34f974[_0xecd7('0x46')][_0xecd7('0x6c')]);}})[_0xecd7('0x1c')](respondWithStatusCode(_0x1942e2,null))[_0xecd7('0x5c')](handleError(_0x1942e2,null));};exports[_0xecd7('0x70')]=function(_0x1f3ea2,_0x464c84,_0x590eeb){_0x1f3ea2[_0xecd7('0x5e')][_0xecd7('0x71')]=_0x1f3ea2['file']['filename'];return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x1f3ea2[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x464c84,null))[_0xecd7('0x1c')](saveUpdates(_0x1f3ea2['body'],null))[_0xecd7('0x1c')](respondWithResult(_0x464c84,null))[_0xecd7('0x5c')](handleError(_0x464c84,null));};exports[_0xecd7('0x72')]=function(_0xa5170e,_0x240667,_0x3bc9d9){_0xa5170e[_0xecd7('0x5e')][_0xecd7('0x73')]=_0xa5170e[_0xecd7('0x74')][_0xecd7('0x75')];return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0xa5170e[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x240667,null))[_0xecd7('0x1c')](saveUpdates(_0xa5170e[_0xecd7('0x5e')],null))['then'](respondWithResult(_0x240667,null))['catch'](handleError(_0x240667,null));};exports['addCustomerAvatar']=function(_0x549e1b,_0x561173,_0x6cac42){_0x549e1b[_0xecd7('0x5e')][_0xecd7('0x76')]=_0x549e1b[_0xecd7('0x74')][_0xecd7('0x75')];return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x549e1b['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x561173,null))[_0xecd7('0x1c')](saveUpdates(_0x549e1b[_0xecd7('0x5e')],null))[_0xecd7('0x1c')](respondWithResult(_0x561173,null))['catch'](handleError(_0x561173,null));};exports[_0xecd7('0x77')]=function(_0x2378cc,_0x1f7bd4,_0x3614b3){_0x2378cc[_0xecd7('0x5e')][_0xecd7('0x78')]=_0x2378cc['file']['filename'];return db['ChatWebsite'][_0xecd7('0x62')]({'where':{'id':_0x2378cc[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x1f7bd4,null))[_0xecd7('0x1c')](saveUpdates(_0x2378cc['body'],null))[_0xecd7('0x1c')](respondWithResult(_0x1f7bd4,null))[_0xecd7('0x5c')](handleError(_0x1f7bd4,null));};exports[_0xecd7('0x79')]=function(_0x36f398,_0x36e2d5,_0x4e5eee){var _0x378ba1=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x7c'));var _0x3368ab={'where':{'id':_0x36f398['params']['id']},'attributes':['id',_0xecd7('0x71')],'raw':!![]};var _0x712590=![];return require(_0xecd7('0x13'))['getLicense']()['then'](function(_0x525cf9){if(_0x525cf9){_0x712590=_0x525cf9['custom'];}})[_0xecd7('0x1c')](function(){return db[_0xecd7('0x3f')][_0xecd7('0x62')](_0x3368ab);})['then'](handleEntityNotFound(_0x36e2d5,null))['then'](function(_0x2d86f0){if(_0x2d86f0){if(!_[_0xecd7('0x7d')](_0x2d86f0[_0xecd7('0x71')])){if(fs[_0xecd7('0x7e')](path['join'](config[_0xecd7('0x7b')],_0xecd7('0x7f'),_0x2d86f0['sitepic']))&&_0x712590){_0x378ba1=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x7f'),_0x2d86f0[_0xecd7('0x71')]);}}return _0x36e2d5[_0xecd7('0x80')](_0x378ba1);}})[_0xecd7('0x5c')](handleError(_0x36e2d5,null));};exports[_0xecd7('0x81')]=function(_0x5905fe,_0x5295bc,_0x341fa0){var _0x412a6c=path['join'](config[_0xecd7('0x7b')],_0xecd7('0x82'));var _0x3720c5={'where':{'id':_0x5905fe['params']['id']},'attributes':['id',_0xecd7('0x73')],'raw':!![]};return db[_0xecd7('0x3f')]['find'](_0x3720c5)[_0xecd7('0x1c')](handleEntityNotFound(_0x5295bc,null))[_0xecd7('0x1c')](function(_0x58f21e){if(_0x58f21e){if(!_['isNil'](_0x58f21e['agentAvatar'])){if(fs[_0xecd7('0x7e')](path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x83'),_0x58f21e[_0xecd7('0x73')]))){_0x412a6c=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x83'),_0x58f21e[_0xecd7('0x73')]);}}return _0x5295bc['download'](_0x412a6c);}})[_0xecd7('0x5c')](handleError(_0x5295bc,null));};exports['getCustomerAvatar']=function(_0x3b188e,_0x306cd9,_0xa94494){var _0xc0b3c4=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],'server/files/images/avatars/customer_avatar.png');var _0x2a3b06={'where':{'id':_0x3b188e[_0xecd7('0x5a')]['id']},'attributes':['id',_0xecd7('0x76'),_0xecd7('0x84')],'raw':!![]};return db[_0xecd7('0x3f')][_0xecd7('0x62')](_0x2a3b06)['then'](handleEntityNotFound(_0x306cd9,null))['then'](function(_0x2116fd){if(_0x2116fd){if(!_['isNil'](_0x2116fd[_0xecd7('0x76')])){if(fs['existsSync'](path[_0xecd7('0x7a')](config['root'],_0xecd7('0x83'),_0x2116fd[_0xecd7('0x76')]))&&_0x2116fd['showCustomerAvatar']){_0xc0b3c4=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],'server/files/images/avatars/',_0x2116fd[_0xecd7('0x76')]);}}return _0x306cd9[_0xecd7('0x80')](_0xc0b3c4);}})[_0xecd7('0x5c')](handleError(_0x306cd9,null));};exports[_0xecd7('0x85')]=function(_0x3e1f21,_0x5b1962,_0x55ef4e){var _0x52d6b4=path['join'](config[_0xecd7('0x7b')],'server/files/images/avatars/system_avatar.png');var _0x3b2dc0={'where':{'id':_0x3e1f21[_0xecd7('0x5a')]['id']},'attributes':['id',_0xecd7('0x78')],'raw':!![]};return db[_0xecd7('0x3f')][_0xecd7('0x62')](_0x3b2dc0)[_0xecd7('0x1c')](handleEntityNotFound(_0x5b1962,null))[_0xecd7('0x1c')](function(_0x516ae2){if(_0x516ae2){if(!_['isNil'](_0x516ae2[_0xecd7('0x78')])){if(fs['existsSync'](path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],'server/files/images/avatars/',_0x516ae2[_0xecd7('0x78')]))){_0x52d6b4=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x83'),_0x516ae2['systemAvatar']);}}return _0x5b1962[_0xecd7('0x80')](_0x52d6b4);}})[_0xecd7('0x5c')](handleError(_0x5b1962,null));};exports['notify']=function(_0x3ae8a0,_0x53eed2,_0x230b12){var _0x37b4d8=require(_0xecd7('0x86'));var _0xc1ca66=new _0x37b4d8();var _0x4641d8=_0xc1ca66['setUA'](_0x3ae8a0[_0xecd7('0x87')][_0xecd7('0x88')])[_0xecd7('0x89')]();var _0x7330d0={'body':_0x3ae8a0[_0xecd7('0x5e')],'channel':_0xecd7('0x8a')};var _0x5ab0d0=[];var _0x3f16ec=[];var _0x1f8bfa={};var _0x21a32d=![];return db[_0xecd7('0x8b')][_0xecd7('0x65')]()[_0xecd7('0x1c')](function(_0x50873b){if(!_0x50873b){throw new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))]('no\x20available\x20attributes');}_0x5ab0d0=_[_0xecd7('0x8e')](_[_0xecd7('0x45')](_0x50873b),[_0xecd7('0x8f'),'updatedAt']);_0x3f16ec=_['difference'](_['keys'](_0x50873b),[_0xecd7('0x8f'),_0xecd7('0x90'),'CompanyId',_0xecd7('0x91')]);if(_0x3ae8a0[_0xecd7('0x5e')]['id']){delete _0x3ae8a0['body']['id'];}if(_[_0xecd7('0x7d')](_0x3ae8a0['body']['from'])){throw new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))](_0xecd7('0x92'));}if(_['isNil'](_0x3ae8a0['body']['body'])||_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x5e')]===''){throw new db['Sequelize'][(_0xecd7('0x8d'))](_0xecd7('0x93'));}if(_[_0xecd7('0x7d')](_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x94')])){throw new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))](_0xecd7('0x95')+_0x3f16ec);}if(!_[_0xecd7('0x96')](_0x3f16ec,_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x94')])){throw new db[(_0xecd7('0x8c'))]['ValidationError'](_0xecd7('0x97')+_0x3f16ec);}_0x1f8bfa[_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x94')]]=_0x3ae8a0['body']['from'];})['then'](function(){return db['ChatWebsite'][_0xecd7('0x62')]({'where':{'id':_0x3ae8a0[_0xecd7('0x5a')]['id']},'include':[{'model':db[_0xecd7('0x98')],'as':_0xecd7('0x99'),'include':[{'model':db[_0xecd7('0x8b')],'as':_0xecd7('0x9a'),'where':_0x1f8bfa,'limit':0x1,'order':[[_0xecd7('0x90'),_0xecd7('0x9b')]]}]},{'model':db[_0xecd7('0x9c')],'as':_0xecd7('0x9d')}]});})['then'](handleEntityNotFound(_0x53eed2,null))[_0xecd7('0x1c')](function(_0x54fb4e){if(_0x54fb4e&&_0x54fb4e[_0xecd7('0x99')]){_0x7330d0[_0xecd7('0x9e')]=_0x54fb4e;_0x7330d0[_0xecd7('0x9f')]=_0x54fb4e[_0xecd7('0x9d')];_0x7330d0['list']=_0x54fb4e[_0xecd7('0x99')];_0x7330d0[_0xecd7('0x9f')]=_[_0xecd7('0xa0')](_0x7330d0[_0xecd7('0x9f')],[_0xecd7('0xa1')],[_0xecd7('0xa2')]);if(_0x7330d0[_0xecd7('0x9e')][_0xecd7('0x9d')]){delete _0x7330d0[_0xecd7('0x9e')]['Applications'];}if(_0x7330d0[_0xecd7('0x9e')][_0xecd7('0x99')]&&_0x7330d0[_0xecd7('0x9e')][_0xecd7('0x99')][_0xecd7('0x9a')]['length']){return _0x7330d0[_0xecd7('0x9e')][_0xecd7('0x99')]['Contacts'][0x0];}var _0x18890f=_[_0xecd7('0xa3')](_0x3ae8a0[_0xecd7('0x5e')],{'firstName':_0x3ae8a0['body'][_0xecd7('0xa4')],'ListId':_0x54fb4e[_0xecd7('0x91')]});_0x18890f[_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x94')]]=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xa4')];return db['CmContact']['create'](_0x18890f,{'fields':_0x5ab0d0,'raw':!![]});}})[_0xecd7('0x1c')](handleEntityNotFound(_0x53eed2,null))['then'](function(_0x51e57a){_0x7330d0[_0xecd7('0xa5')]=_0x51e57a;var _0x526526=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xa6')];if(_0x3ae8a0[_0xecd7('0x87')][_0xecd7('0xa7')]){_0x526526=_0x3ae8a0[_0xecd7('0x87')][_0xecd7('0xa7')];}else if(_0x3ae8a0['headers'][_0xecd7('0xa8')]){_0x526526=_[_0xecd7('0xa9')](_0x3ae8a0['headers'][_0xecd7('0xa8')]['split'](','));}if(_0x51e57a){var _0x2dc708={'ContactId':_0x51e57a['id'],'ChatWebsiteId':_0x3ae8a0['params']['id'],'from':(_0x51e57a[_0xecd7('0xaa')]||'')+'\x20'+(_0x51e57a[_0xecd7('0xab')]||''),'customerIp':_0x526526,'customerPort':_0x3ae8a0[_0xecd7('0x87')][_0xecd7('0xac')]?_0x3ae8a0['headers']['x-real-port']:null,'referer':_0x3ae8a0['body'][_0xecd7('0xad')],'browserName':_0x4641d8[_0xecd7('0xae')][_0xecd7('0x39')]&&_0x4641d8[_0xecd7('0xae')][_0xecd7('0xaf')]?util[_0xecd7('0xb0')](_0xecd7('0xb1'),_0x4641d8['browser'][_0xecd7('0x39')],_0x4641d8[_0xecd7('0xae')][_0xecd7('0xaf')]):_0xecd7('0xb2'),'browserVersion':_0x4641d8[_0xecd7('0xae')]['version']||'unknown','osName':util[_0xecd7('0xb0')](_0xecd7('0xb1'),_0x4641d8['os'][_0xecd7('0x39')],_0x4641d8['os'][_0xecd7('0xaf')]),'osVersion':_0x4641d8['os'][_0xecd7('0xaf')],'deviceModel':_0x4641d8[_0xecd7('0xb3')][_0xecd7('0x44')]&&_0x4641d8[_0xecd7('0xb3')][_0xecd7('0xb4')]?util[_0xecd7('0xb0')](_0xecd7('0xb5'),_0x4641d8['device']['model'],_0x4641d8['device'][_0xecd7('0xb4')],_0x4641d8[_0xecd7('0xb3')][_0xecd7('0x42')]):null,'deviceVendor':_0x4641d8['device'][_0xecd7('0xb4')],'deviceType':_0x4641d8[_0xecd7('0xb3')]['type'],'formData':JSON[_0xecd7('0x21')](_0x3ae8a0[_0xecd7('0x5e')])};var _0x5e6e06={'ChatWebsiteId':_0x3ae8a0[_0xecd7('0x5a')]['id'],'closed':![]};if(_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xb6')]){_0x5e6e06['threadId']=_0x3ae8a0['body'][_0xecd7('0xb6')];return db[_0xecd7('0xb7')][_0xecd7('0x62')]({'where':_0x5e6e06})['then'](function(_0x450f02){if(_0x450f02){return[_0x450f02,![]];}_0x2dc708['threadId']=_0x3ae8a0['body']['threadId'];_0x2dc708['externalUrl']=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xb8')];return db['ChatInteraction'][_0xecd7('0x5d')](_0x2dc708)[_0xecd7('0x1c')](function(_0x30f58f){return[_0x30f58f,!![]];});});}_0x5e6e06[_0xecd7('0xb9')]=_0x51e57a['id'];if(_0x3ae8a0['body'][_0xecd7('0xba')]&&_0x3ae8a0[_0xecd7('0x5e')]['interaction']['id']){_0x5e6e06['id']=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xba')]['id'];return db[_0xecd7('0xb7')][_0xecd7('0x62')]({'where':_0x5e6e06})[_0xecd7('0x1c')](function(_0x20f57d){if(_0x20f57d){return[_0x20f57d,![]];}return db[_0xecd7('0xb7')]['create'](_0x2dc708)['then'](function(_0x3c7a26){return[_0x3c7a26,!![]];});});}return db[_0xecd7('0xb7')]['create'](_0x2dc708)['then'](function(_0x38421a){return[_0x38421a,!![]];});}})['spread'](function(_0x2f7612,_0x46a9a7){if(_0x2f7612){_0x21a32d=_0x46a9a7;if(!_0x46a9a7){var _0x47df78={'from':(_0x7330d0[_0xecd7('0xa5')]['firstName']||'')+'\x20'+(_0x7330d0[_0xecd7('0xa5')][_0xecd7('0xab')]||'')};if(_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xb6')]&&_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xbb')]&&_0x3ae8a0['body'][_0xecd7('0xb6')]!=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xbb')]){_0x47df78['threadId']=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xbb')];}return _0x2f7612[_0xecd7('0x33')](_0x47df78);}else{return _0x2f7612;}}})['then'](function(_0x32c356){_0x7330d0['interaction']=_0x32c356[_0xecd7('0x35')]({'plain':!![]});_0x7330d0[_0xecd7('0xba')][_0xecd7('0xbc')]=_0x21a32d;if(_0x7330d0[_0xecd7('0xba')]['created']){if(_0x7330d0[_0xecd7('0x9e')][_0xecd7('0xbd')]){_0x7330d0[_0xecd7('0x9f')][_0xecd7('0xbe')]({'id':0x0,'priority':_0x7330d0[_0xecd7('0x9f')][_0xecd7('0x4a')]+0x1,'app':_0xecd7('0xbf'),'appdata':_0xecd7('0xc0'),'interval':_0xecd7('0xc1')});}}return db[_0xecd7('0xc2')][_0xecd7('0x5d')]({'body':_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x5e')],'ChatWebsiteId':_0x3ae8a0[_0xecd7('0x5a')]['id'],'ChatInteractionId':_0x32c356['id'],'direction':'in','ContactId':_0x7330d0['contact']['id'],'AttachmentId':_0x3ae8a0[_0xecd7('0x5e')]['AttachmentId']});})[_0xecd7('0x1c')](function(_0x164024){_0x7330d0[_0xecd7('0x24')]=_0x164024;if(_0x7330d0[_0xecd7('0xba')][_0xecd7('0xc3')]){return db['User'][_0xecd7('0x62')]({'attributes':['id',_0xecd7('0x39')],'where':{'id':_0x7330d0[_0xecd7('0xba')]['UserId']}})['then'](function(_0x2d3da6){if(_0x2d3da6){_0x7330d0['applications'][_0xecd7('0xc4')]({'id':0x0,'priority':0x0,'app':_0xecd7('0xc5'),'appdata':_0x2d3da6[_0xecd7('0x39')]+','+(_0x7330d0[_0xecd7('0x9e')][_0xecd7('0xc6')]||0xa),'interval':_0xecd7('0xc1')});_0x7330d0[_0xecd7('0xc7')]=!![];}return respondWithRpcPromise(_0xecd7('0xc8'),_0xecd7('0xc9'),_0x7330d0);});}return respondWithRpcPromise('Start',_0xecd7('0xc9'),_0x7330d0);})['then'](function(_0x501380){respondWithRpcPromise(_0xecd7('0xca'),_0xecd7('0xca'),{'event':_0xecd7('0xcb'),'message':_0x501380},client9002);return _0x501380;})[_0xecd7('0x1c')](respondWithResult(_0x53eed2,null))[_0xecd7('0x5c')](handleError(_0x53eed2,null));};exports[_0xecd7('0xcc')]=function(_0x1af351,_0xdbf81f,_0x2af219){var _0x25bb3e,_0x28561b,_0x3a737f;var _0x245a7c=[];var _0x3cbcc9=[];var _0x17d766={};var _0x30588d=_0x1af351[_0xecd7('0xcd')]||[];var _0x452fed=[];var _0x3a981b;return db['CmContact'][_0xecd7('0x65')]()[_0xecd7('0x1c')](function(_0x8d7b1b){if(!_0x8d7b1b){throw new db['Sequelize'][(_0xecd7('0x8d'))]('no\x20available\x20attributes');}_0x3cbcc9=_[_0xecd7('0x8e')](_[_0xecd7('0x45')](_0x8d7b1b),[_0xecd7('0x8f'),_0xecd7('0x90')]);_0x245a7c=_[_0xecd7('0x8e')](_[_0xecd7('0x45')](_0x8d7b1b),['createdAt','updatedAt',_0xecd7('0xce'),_0xecd7('0x91')]);if(_0x1af351[_0xecd7('0x5e')]['id']){delete _0x1af351[_0xecd7('0x5e')]['id'];}if(_[_0xecd7('0x7d')](_0x1af351[_0xecd7('0x5e')]['from'])){throw _0xdbf81f[_0xecd7('0x27')](0x1f4)[_0xecd7('0x3a')](new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))](_0xecd7('0x92')));}if(_[_0xecd7('0x7d')](_0x1af351[_0xecd7('0x5e')]['body'])||_0x1af351[_0xecd7('0x5e')][_0xecd7('0x5e')]===''){throw _0xdbf81f[_0xecd7('0x27')](0x1f4)[_0xecd7('0x3a')](new db[(_0xecd7('0x8c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xecd7('0x7d')](_0x1af351[_0xecd7('0x5e')][_0xecd7('0xcf')])){throw _0xdbf81f[_0xecd7('0x27')](0x1f4)['send'](new db[(_0xecd7('0x8c'))]['ValidationError'](_0xecd7('0xd0')+_0x245a7c));}if(!_[_0xecd7('0x96')](_0x245a7c,_0x1af351[_0xecd7('0x5e')][_0xecd7('0xcf')])){throw _0xdbf81f[_0xecd7('0x27')](0x1f4)[_0xecd7('0x3a')](new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x245a7c));}_0x17d766[_0x1af351[_0xecd7('0x5e')][_0xecd7('0xcf')]]=_0x1af351[_0xecd7('0x5e')][_0xecd7('0xa4')];})[_0xecd7('0x1c')](function(){return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x1af351[_0xecd7('0x5a')]['id']},'include':[{'model':db[_0xecd7('0x98')],'as':'List'},{'model':db[_0xecd7('0xd1')],'as':_0xecd7('0xd1')}]});})[_0xecd7('0x1c')](handleEntityNotFound(_0xdbf81f,null))[_0xecd7('0x1c')](function(_0x3894da){if(_0x3894da&&_0x3894da[_0xecd7('0x99')]){_0x28561b=_0x3894da;var _0x31498b=_[_0xecd7('0xa3')](_0x1af351[_0xecd7('0x5e')],{'firstName':_0x1af351[_0xecd7('0x5e')][_0xecd7('0xa4')],'phone':_0x1af351[_0xecd7('0x5e')]['from'],'ListId':_0x3894da[_0xecd7('0x91')]});_0x31498b[_0x1af351[_0xecd7('0x5e')][_0xecd7('0xcf')]]=_0x1af351[_0xecd7('0x5e')][_0xecd7('0xa4')];return db[_0xecd7('0x8b')][_0xecd7('0xd2')]({'where':_0x17d766,'defaults':_0x31498b});}})[_0xecd7('0xd3')](function(_0x2de328){if(_0x2de328){_0x3a737f=_0x2de328;var _0xb49cf9=fs['readFileSync'](path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0xd4')),_0xecd7('0xd5'));var _0x510921=ejs[_0xecd7('0xd6')](_0xb49cf9,{'body':_[_0xecd7('0xd7')](_0x1af351[_0xecd7('0x5e')]['body']),'bodyTitle':_0x28561b[_0xecd7('0xd8')]});return db[_0xecd7('0xd9')][_0xecd7('0x5d')]({'body':_0x510921,'ContactId':_0x2de328['id'],'ChatWebsiteId':_0x28561b['id']});}})[_0xecd7('0x1c')](function(_0x4fbb82){_0x3a981b=_0x4fbb82;if(_0x30588d[_0xecd7('0x4a')]){var _0x167bdd=_0x30588d[_0xecd7('0x3e')](function(_0x179ebc){return{'name':_0x179ebc[_0xecd7('0xda')],'basename':_0x179ebc[_0xecd7('0x75')],'type':_0x179ebc[_0xecd7('0xdb')],'ChatOfflineMessageId':_0x4fbb82['id']};});_0x452fed=_0x167bdd[_0xecd7('0x3e')](_0x46e6cf=>{var _0x531829={'filename':_0x46e6cf[_0xecd7('0x39')],'path':path['join'](config[_0xecd7('0x7b')],_0xecd7('0xdc'),'files',_0xecd7('0xdd'),_0xecd7('0xde'),_0x46e6cf[_0xecd7('0xdf')])};return _0x531829;});if(!_0x28561b[_0xecd7('0xe0')]){return db['sequelize'][_0xecd7('0xe1')](function(_0x430dc3){return db['Attachment']['bulkCreate'](_0x167bdd,{'transaction':_0x430dc3});});}}})[_0xecd7('0x1c')](function(){if(_0x3a981b){_0x25bb3e=_0x3a981b;return db[_0xecd7('0xd1')][_0xecd7('0x69')]({'where':{'active':!![]},'include':[{'model':db[_0xecd7('0xe2')],'as':_0xecd7('0xe3'),'raw':!![]}]});}})[_0xecd7('0x1c')](function(_0x7e608d){if(_0x7e608d&&_0x7e608d[_0xecd7('0xe3')]&&_0x28561b[_0xecd7('0xe4')]&&_0x28561b[_0xecd7('0xe5')]){var _0x132492={'tls':{'rejectUnauthorized':![]}};if(_0x7e608d[_0xecd7('0xe3')]['service']){_0x132492[_0xecd7('0xe6')]=_0x7e608d['Smtp'][_0xecd7('0xe6')];}else{_0x132492[_0xecd7('0xe7')]=_0x7e608d['Smtp'][_0xecd7('0xe7')];_0x132492[_0xecd7('0xe8')]=_0x7e608d[_0xecd7('0xe3')][_0xecd7('0xe8')];_0x132492['secure']=_0x7e608d[_0xecd7('0xe3')]['secure'];}if(_0x7e608d[_0xecd7('0xe3')]['authentication']){_0x132492['auth']={'user':_0x7e608d[_0xecd7('0xe3')][_0xecd7('0x5f')],'pass':_0x7e608d[_0xecd7('0xe3')][_0xecd7('0xe9')]};}return respondWithRpcPromise(_0xecd7('0xea'),_0xecd7('0xeb'),{'account':_0x132492,'message':{'from':util[_0xecd7('0xb0')](_0xecd7('0xec'),_0x7e608d[_0xecd7('0x39')],_0x7e608d['email']||_0x7e608d['Smtp'][_0xecd7('0x5f')]),'to':_0x28561b[_0xecd7('0xe5')],'subject':_0x28561b['offlineMessageSubject'],'html':_0x25bb3e['body'],'attachments':_0x452fed}},client9003)['then'](function(){return _0x25bb3e;})[_0xecd7('0x5c')](function(_0x506f17){console['error'](_0x506f17);});}})[_0xecd7('0x1c')](function(){if(_0x28561b&&_0x28561b[_0xecd7('0xe0')]&&_0x28561b[_0xecd7('0xed')]){var _0x1ab96b=[];if(_0x30588d[_0xecd7('0x4a')]){_0x1ab96b=_0x30588d[_0xecd7('0x3e')](function(_0x461b9a){return{'name':_0x461b9a[_0xecd7('0xda')],'basename':_0x461b9a[_0xecd7('0x75')],'type':_0x461b9a[_0xecd7('0xdb')],'ChatOfflineMessageId':_0x3a981b['id']};});}var _0x2224c5;if(!_[_0xecd7('0x7d')](_0x28561b['subjectOffline'])){var _0x5cc43a=_[_0xecd7('0x3e')](_0x1af351[_0xecd7('0x5e')],function(_0x3e0853){return _0x3e0853;});var _0x15f9b1=_[_0xecd7('0xee')](_0x5cc43a)[0x0];var _0x5921e4=_[_0xecd7('0xef')](_0x15f9b1,function(_0x4063fd){return _0x4063fd;});_0x2224c5=_0x5921e4[0x1][_0x28561b[_0xecd7('0xf0')]];}var _0xb97ba6={'from':_0x3a737f[_0xecd7('0xf1')],'firstName':_0x3a737f['firstName'],'lastName':_0x3a737f[_0xecd7('0xab')],'mapKey':_0xecd7('0xf1'),'message':{'from':_0x3a737f['email'],'to':_0x28561b['MailAccount']['email'],'cc':'','subject':_[_0xecd7('0x7d')](_0x2224c5)?_0x28561b['offlineMessageSubject']:_0x2224c5,'messageId':'','sentAt':new Date(),'attach':_0x1ab96b[_0xecd7('0x4a')],'attachments':_0x1ab96b,'originChannel':'Chat','ChatWebsiteId':_0x28561b['id'],'ChatOfflineMessageId':_0x25bb3e['id'],'originTo':_0x28561b[_0xecd7('0xd1')]['email']},'body':_0x25bb3e['body']};var _0x39fdc0={'account':{'id':_0x28561b[_0xecd7('0xed')]},'body':_0xb97ba6,'log':_0xecd7('0xf2')};return respondWithRpcPromise(_0xecd7('0xf2'),'notifyMail',_0x39fdc0,client9001)[_0xecd7('0x1c')](function(){return _0x25bb3e;})[_0xecd7('0x5c')](function(_0x289880){console[_0xecd7('0x22')](_0x289880);});}return;})[_0xecd7('0x1c')](function(){if(_0x25bb3e){return _0x25bb3e;}})[_0xecd7('0x1c')](respondWithResult(_0xdbf81f,null))[_0xecd7('0x5c')](function(_0x44ec2b){console[_0xecd7('0x22')](_0xecd7('0x5c'),_0x44ec2b);for(var _0x2ecd32 of _0x30588d){var _0x593049=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0xdc'),_0xecd7('0xcd'),_0xecd7('0xdd'),_0xecd7('0xde'),_0x2ecd32[_0xecd7('0x75')]);fs_extra[_0xecd7('0xf3')](_0x593049)[_0xecd7('0x5c')](function(_0x52c191){console['error'](_0xecd7('0xf4'),_0x593049,_0x52c191);});}});};exports[_0xecd7('0xf5')]=function(_0x3aeb42,_0x518817,_0x29ebea){return db[_0xecd7('0xb7')]['find']({'where':{'id':_0x3aeb42['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x518817,null))[_0xecd7('0x1c')](function(_0x31cc6d){if(_0x31cc6d){return _0x31cc6d[_0xecd7('0xf5')](_0x3aeb42[_0xecd7('0x5e')]['ids'],_[_0xecd7('0xf6')](_0x3aeb42[_0xecd7('0x5e')],[_0xecd7('0x6c'),'id'])||{});}})[_0xecd7('0x1c')](respondWithResult(_0x518817,null))[_0xecd7('0x5c')](handleError(_0x518817,null));};exports[_0xecd7('0xf7')]=function(_0x500d68,_0x140ad7,_0x286226){var _0x37ca9b={'raw':![],'where':{}};var _0x22bd82={};var _0x5e29d0={'count':0x0,'rows':[]};return db[_0xecd7('0x3f')][_0xecd7('0x69')]({'where':{'id':_0x500d68[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x140ad7,null))['then'](function(_0x2af949){if(_0x2af949){_0x22bd82[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0xb7')]['rawAttributes']);_0x22bd82[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x500d68[_0xecd7('0x46')]);_0x22bd82[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x22bd82['model'],_0x22bd82[_0xecd7('0x46')]);_0x37ca9b[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x22bd82[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x500d68[_0xecd7('0x46')][_0xecd7('0x49')]));_0x37ca9b[_0xecd7('0x48')]=_0x37ca9b['attributes']['length']?_0x37ca9b[_0xecd7('0x48')]:_0x22bd82['model'];if(!_0x500d68[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x37ca9b[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x500d68['query']['limit']);_0x37ca9b['offset']=qs[_0xecd7('0x2a')](_0x500d68['query']['offset']);}_0x37ca9b[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x500d68['query'][_0xecd7('0x4e')]);_0x37ca9b[_0xecd7('0x51')]=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x500d68[_0xecd7('0x46')],_0x22bd82['filters']));_0x37ca9b[_0xecd7('0x51')][_0xecd7('0x67')]=_0x2af949['id'];if(_0x500d68[_0xecd7('0x46')]['filter']){_0x37ca9b[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x37ca9b[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x37ca9b[_0xecd7('0x48')],function(_0x32b376){var _0x1f4175={};_0x1f4175[_0x32b376]={'$like':'%'+_0x500d68[_0xecd7('0x46')][_0xecd7('0x50')]+'%'};return _0x1f4175;})});}_0x37ca9b=_[_0xecd7('0x52')]({},_0x37ca9b,_0x500d68[_0xecd7('0x54')]);return db[_0xecd7('0xb7')][_0xecd7('0x2d')]({'where':_0x37ca9b['where']})['then'](function(_0x3ffd2b){_0x5e29d0[_0xecd7('0x2d')]=_0x3ffd2b;if(_0x500d68[_0xecd7('0x46')][_0xecd7('0x55')]){_0x37ca9b[_0xecd7('0x56')]=[{'model':db[_0xecd7('0x8b')],'as':'Contact','required':![]},{'model':db[_0xecd7('0xf8')],'as':_0xecd7('0xf9'),'attributes':[_0xecd7('0x39'),_0xecd7('0xfa'),'internal'],'required':![]},{'model':db[_0xecd7('0xfb')],'as':_0xecd7('0xfc'),'attributes':['id','name','color'],'where':_0x500d68[_0xecd7('0x46')][_0xecd7('0xfd')]?{'id':_0x500d68['query']['tag']}:undefined,'required':_0x500d68['query'][_0xecd7('0xfd')]?!![]:![]}];}return db[_0xecd7('0xb7')][_0xecd7('0x57')](_0x37ca9b);})[_0xecd7('0x1c')](function(_0x29ee18){_0x5e29d0[_0xecd7('0x58')]=_0x29ee18;return _0x5e29d0;});}})[_0xecd7('0x1c')](respondWithFilteredResult(_0x140ad7,_0x37ca9b))[_0xecd7('0x5c')](handleError(_0x140ad7,null));};function iftimePromise(_0x2eae70,_0x5becdd){return respondWithRpcPromise(_0xecd7('0xfe'),'getSnippet',{'command':_0x5becdd[_0xecd7('0xff')]?util['format'](_0xecd7('0x100'),_0x2eae70[_0xecd7('0x101')],_0x5becdd['timezone']):util[_0xecd7('0xb0')](_0xecd7('0x102'),_0x2eae70[_0xecd7('0x101')])},client9002)[_0xecd7('0x1c')](function(_0x253523){var _0x41efb4=_0x253523&&_0x253523[_0xecd7('0x103')](_0xecd7('0x104'))>=0x0?!![]:![];logger[_0xecd7('0x105')](_0xecd7('0x106'),_0x5becdd['id'],_0x2eae70['id'],_0x2eae70['interval'],_0x41efb4?_0xecd7('0x107'):_0xecd7('0x108'),_0x5becdd[_0xecd7('0xff')]?_0x5becdd[_0xecd7('0xff')]:_0xecd7('0x109'));return _0x41efb4;})[_0xecd7('0x5c')](function(_0x7a9f19){logger['error'](_0xecd7('0x106'),_0x5becdd['id'],_0x2eae70['id'],_0x2eae70[_0xecd7('0x101')],util[_0xecd7('0x10a')](_0x7a9f19,{'showHidden':![],'depth':null}),_0x5becdd[_0xecd7('0xff')]?_0x5becdd[_0xecd7('0xff')]:_0xecd7('0x109'));return![];});}exports[_0xecd7('0x10b')]=function(_0x3012c8,_0x2f1fe2,_0x4275cf){var _0x46afa3=0x0;var _0x41c98e=0x0;var _0x100696=![];var _0x5a065a;var _0x9d8e82;return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x3012c8['params']['id']},'include':[{'model':db['Interval'],'as':_0xecd7('0x10c'),'include':[{'model':db[_0xecd7('0x10c')],'as':_0xecd7('0x10d'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xecd7('0x1c')](handleEntityNotFound(_0x2f1fe2,null))['then'](function(_0x32d785){if(_0x32d785){_0x5a065a=_0x32d785;return _0x32d785[_0xecd7('0x10e')]({'raw':!![]});}})[_0xecd7('0x1c')](function(_0x195f7a){if(_0x5a065a){if(_0x195f7a){_0x9d8e82=_0x195f7a;}}return require(_0xecd7('0x13'))['getLicense']();})[_0xecd7('0x1c')](function(_0x4cf2ea){if(_0x4cf2ea){_0x41c98e=_0x4cf2ea[_0xecd7('0x10f')];_0x100696=_0x4cf2ea[_0xecd7('0x110')];}})[_0xecd7('0x1c')](function(){return db[_0xecd7('0xb7')][_0xecd7('0x2d')]({'where':{'closed':![]}});})[_0xecd7('0x1c')](function(_0x52a312){_0x46afa3=_0x52a312;if(_0x41c98e&&_0x52a312>_0x41c98e){return db[_0xecd7('0x111')]['findOne']({'where':{'id':0x1}})[_0xecd7('0x1c')](function(_0x2232b0){if(_0x2232b0){_0x2232b0[_0xecd7('0x112')]('chatLicenseExceeded');}});}})[_0xecd7('0x1c')](function(){if(_0x5a065a[_0xecd7('0x10c')]&&_0x5a065a[_0xecd7('0x10c')][_0xecd7('0x10d')]){var _0x4e8e9d=[];for(var _0x3b12b0=0x0;_0x3b12b0<_0x5a065a[_0xecd7('0x10c')]['Intervals'][_0xecd7('0x4a')];_0x3b12b0++){var _0x56f501=_0x5a065a[_0xecd7('0x10c')][_0xecd7('0x10d')][_0x3b12b0][_0xecd7('0x35')]({'plain':!![]});_0x4e8e9d['push'](iftimePromise(_0x56f501,_0x5a065a));}return BPromise[_0xecd7('0x113')](_0x4e8e9d)[_0xecd7('0x1c')](function(_0x5e2d60){return _[_0xecd7('0x114')](_0x5e2d60);});}else{return!![];}})[_0xecd7('0x1c')](function(_0x4693ed){var _0x4ad8bd=fs['readFileSync'](path['join'](config[_0xecd7('0x7b')],_0xecd7('0x115')),'utf8');var _0x525df1={'remote':_0x5a065a[_0xecd7('0x116')],'query':querystring[_0xecd7('0x21')](_['merge'](_0x5a065a[_0xecd7('0x35')]({'plain':!![]}),{'customerIp':_0x3012c8[_0xecd7('0x87')][_0xecd7('0xa8')]||_0x3012c8[_0xecd7('0x87')][_0xecd7('0x117')]||_0x3012c8[_0xecd7('0x118')]['remoteAddress']||_0x3012c8['ip'],'referer':_0x3012c8[_0xecd7('0x87')]['referer'],'openedInteractions':_0x46afa3,'maxInteractions':_0x41c98e,'virtual':_0x100696[_0xecd7('0x10f')],'online':_0x4693ed,'custom':_0x100696}))[_0xecd7('0x119')](/'/g,'\x5c\x27')};_0x2f1fe2[_0xecd7('0x3a')](ejs[_0xecd7('0xd6')](Mustache[_0xecd7('0xd6')](_0x4ad8bd,_0x525df1),{'proactiveActions':_0x9d8e82,'alignment':_0x5a065a[_0xecd7('0x11a')],'verticalAlignment':_0x5a065a[_0xecd7('0x11b')],'div_color':_0x5a065a[_0xecd7('0x11c')],'text_color':_0x5a065a['textColor'],'button_color':_0x5a065a['color_button'],'background_color':_0x5a065a[_0xecd7('0x11d')]}));})[_0xecd7('0x5c')](handleError(_0x2f1fe2,null));};exports[_0xecd7('0x11e')]=function(_0x3e8c7a,_0x18c73b,_0x2d3d62){return db[_0xecd7('0x3f')]['findOne']({'where':{'id':_0x3e8c7a[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x18c73b,null))['then'](function(_0x3f0478){if(_0x3f0478){return db[_0xecd7('0x11f')][_0xecd7('0xe1')](function(_0x353164){return db[_0xecd7('0x9c')]['destroy']({'where':{'ChatWebsiteId':_0x3e8c7a[_0xecd7('0x5a')]['id']},'transaction':_0x353164})[_0xecd7('0x1c')](function(_0x171bc6){var _0x188758=_['map'](_0x3e8c7a[_0xecd7('0x5e')],function(_0x13125a){_0x13125a['ChatWebsiteId']=_0x3e8c7a['params']['id'];return _0x13125a;});return db[_0xecd7('0x9c')][_0xecd7('0x120')](_0x188758,{'transaction':_0x353164});});})[_0xecd7('0x1c')](function(){return db[_0xecd7('0x9c')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3e8c7a[_0xecd7('0x5a')]['id']},'order':_0xecd7('0xa1')});});}})[_0xecd7('0x1c')](respondWithResult(_0x18c73b,null))[_0xecd7('0x5c')](handleError(_0x18c73b,null));};exports[_0xecd7('0x121')]=function(_0x555825,_0x1c4a19,_0x2b7f1f){var _0x456e11={};var _0x2079b7={};var _0x11a819;var _0x22b436;return db[_0xecd7('0x3f')][_0xecd7('0x69')]({'where':{'id':_0x555825['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x1c4a19,null))[_0xecd7('0x1c')](function(_0x4064af){if(_0x4064af){_0x11a819=_0x4064af;_0x2079b7[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0x9c')]['rawAttributes']);_0x2079b7['query']=_[_0xecd7('0x45')](_0x555825['query']);_0x2079b7['filters']=_['intersection'](_0x2079b7[_0xecd7('0x44')],_0x2079b7[_0xecd7('0x46')]);_0x456e11[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x2079b7[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x555825[_0xecd7('0x46')][_0xecd7('0x49')]));_0x456e11[_0xecd7('0x48')]=_0x456e11[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x456e11[_0xecd7('0x48')]:_0x2079b7[_0xecd7('0x44')];_0x456e11['order']=qs[_0xecd7('0x4e')](_0x555825[_0xecd7('0x46')][_0xecd7('0x4e')]);_0x456e11[_0xecd7('0x51')]=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x555825[_0xecd7('0x46')],_0x2079b7['filters']));if(_0x555825[_0xecd7('0x46')][_0xecd7('0x50')]){_0x456e11['where']=_[_0xecd7('0x52')](_0x456e11[_0xecd7('0x51')],{'$or':_['map'](_0x456e11[_0xecd7('0x48')],function(_0x2f70fc){var _0x49d8d5={};_0x49d8d5[_0x2f70fc]={'$like':'%'+_0x555825[_0xecd7('0x46')][_0xecd7('0x50')]+'%'};return _0x49d8d5;})});}_0x456e11=_['merge']({},_0x456e11,_0x555825[_0xecd7('0x54')]);return _0x11a819[_0xecd7('0x121')](_0x456e11);}})[_0xecd7('0x1c')](function(_0x24d5b1){if(_0x24d5b1){_0x22b436=_0x24d5b1[_0xecd7('0x4a')];if(!_0x555825[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x456e11[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x555825[_0xecd7('0x46')]['limit']);_0x456e11[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x555825['query'][_0xecd7('0x2a')]);}return _0x11a819[_0xecd7('0x121')](_0x456e11);}})[_0xecd7('0x1c')](function(_0x429383){if(_0x429383){return _0x429383?{'count':_0x22b436,'rows':_0x429383}:null;}})['then'](respondWithResult(_0x1c4a19,null))[_0xecd7('0x5c')](handleError(_0x1c4a19,null));};exports[_0xecd7('0x122')]=function(_0x245ba4,_0x51cf27,_0x5bf42d){return db['chatProactiveAction'][_0xecd7('0x62')]({'where':{'id':_0x245ba4[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x51cf27,null))[_0xecd7('0x1c')](function(_0x28a1f3){if(_0x28a1f3){return _0x28a1f3[_0xecd7('0x122')](_0x245ba4[_0xecd7('0x5e')][_0xecd7('0x6c')],_[_0xecd7('0xf6')](_0x245ba4[_0xecd7('0x5e')],[_0xecd7('0x6c'),'id'])||{});}})[_0xecd7('0x1c')](respondWithResult(_0x51cf27,null))[_0xecd7('0x5c')](handleError(_0x51cf27,null));};exports[_0xecd7('0x10e')]=function(_0x314938,_0x2d8f84,_0x2eb688){var _0x123b83={};var _0x2a5038={};var _0x362698;var _0x56881e;return db['ChatWebsite'][_0xecd7('0x69')]({'where':{'id':_0x314938[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x2d8f84,null))[_0xecd7('0x1c')](function(_0x5d4f2a){if(_0x5d4f2a){_0x362698=_0x5d4f2a;_0x2a5038[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0x123')]['rawAttributes']);_0x2a5038[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x314938[_0xecd7('0x46')]);_0x2a5038[_0xecd7('0x47')]=_['intersection'](_0x2a5038[_0xecd7('0x44')],_0x2a5038[_0xecd7('0x46')]);_0x123b83[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x2a5038[_0xecd7('0x44')],qs['fields'](_0x314938['query']['fields']));_0x123b83[_0xecd7('0x48')]=_0x123b83[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x123b83[_0xecd7('0x48')]:_0x2a5038['model'];_0x123b83['order']=qs[_0xecd7('0x4e')](_0x314938['query']['sort']);_0x123b83['where']=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x314938[_0xecd7('0x46')],_0x2a5038['filters']));if(_0x314938[_0xecd7('0x46')][_0xecd7('0x50')]){_0x123b83[_0xecd7('0x51')]=_['merge'](_0x123b83[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x123b83[_0xecd7('0x48')],function(_0x2098df){var _0x5d1bb4={};_0x5d1bb4[_0x2098df]={'$like':'%'+_0x314938['query'][_0xecd7('0x50')]+'%'};return _0x5d1bb4;})});}_0x123b83=_[_0xecd7('0x52')]({},_0x123b83,_0x314938[_0xecd7('0x54')]);return _0x362698[_0xecd7('0x10e')](_0x123b83);}})[_0xecd7('0x1c')](function(_0x101ec2){if(_0x101ec2){_0x56881e=_0x101ec2[_0xecd7('0x4a')];if(!_0x314938[_0xecd7('0x46')]['hasOwnProperty']('nolimit')){_0x123b83['limit']=qs[_0xecd7('0x2b')](_0x314938['query'][_0xecd7('0x2b')]);_0x123b83[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x314938[_0xecd7('0x46')][_0xecd7('0x2a')]);}return _0x362698['getProactiveActions'](_0x123b83);}})[_0xecd7('0x1c')](function(_0x4bbafc){if(_0x4bbafc){return _0x4bbafc?{'count':_0x56881e,'rows':_0x4bbafc}:null;}})[_0xecd7('0x1c')](respondWithResult(_0x2d8f84,null))[_0xecd7('0x5c')](handleError(_0x2d8f84,null));};exports[_0xecd7('0x124')]=function(_0x33176f,_0x38d454,_0x1a38c3){var _0x248528=_0x33176f[_0xecd7('0x46')][_0xecd7('0x125')]===_0xecd7('0x126')?_0xecd7('0x127'):_0xecd7('0x128');return db[_0xecd7('0x3f')]['find']({'attributes':['id',_0x248528],'where':{'id':_0x33176f[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x38d454,null))['then'](function(_0xd10ec4){if(_0xd10ec4){var _0x45309d=_0xd10ec4[_0x248528];var _0xbbd1b5=_0x45309d&&_0x45309d[_0xecd7('0x129')]?_0x45309d[_0xecd7('0x129')]:[];_0x38d454[_0xecd7('0x3a')]({'fromKey':_['isNil'](_0x45309d[_0xecd7('0x12a')])?undefined:_0x45309d[_0xecd7('0x12a')],'count':_0xbbd1b5[_0xecd7('0x4a')],'rows':_0xbbd1b5});}})['catch'](handleError(_0x38d454,null));};exports[_0xecd7('0x12b')]=function(_0x3b0a43,_0x3c0237,_0x8bca5a){var _0x128911={'raw':![],'where':{}};var _0x2d16c6={};var _0x16cd27={'count':0x0,'rows':[]};return db[_0xecd7('0x3f')]['findOne']({'where':{'id':_0x3b0a43[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3c0237,null))[_0xecd7('0x1c')](function(_0x13eaa5){if(_0x13eaa5){_0x2d16c6[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0xd9')][_0xecd7('0x40')]);_0x2d16c6['query']=_[_0xecd7('0x45')](_0x3b0a43[_0xecd7('0x46')]);_0x2d16c6[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x2d16c6['model'],_0x2d16c6[_0xecd7('0x46')]);_0x128911[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x2d16c6[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x3b0a43[_0xecd7('0x46')]['fields']));_0x128911[_0xecd7('0x48')]=_0x128911[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x128911[_0xecd7('0x48')]:_0x2d16c6[_0xecd7('0x44')];if(!_0x3b0a43[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x128911[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x3b0a43[_0xecd7('0x46')][_0xecd7('0x2b')]);_0x128911[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x3b0a43[_0xecd7('0x46')]['offset']);}_0x128911[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x3b0a43[_0xecd7('0x46')]['sort']);_0x128911[_0xecd7('0x51')]=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x3b0a43[_0xecd7('0x46')],_0x2d16c6[_0xecd7('0x47')]));_0x128911[_0xecd7('0x51')][_0xecd7('0x67')]=_0x13eaa5['id'];if(_0x3b0a43[_0xecd7('0x46')][_0xecd7('0x50')]){_0x128911[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x128911['where'],{'$or':_[_0xecd7('0x3e')](_0x128911[_0xecd7('0x48')],function(_0x4b3efa){var _0x50e1c5={};_0x50e1c5[_0x4b3efa]={'$like':'%'+_0x3b0a43[_0xecd7('0x46')]['filter']+'%'};return _0x50e1c5;})});}_0x128911=_[_0xecd7('0x52')]({},_0x128911,_0x3b0a43[_0xecd7('0x54')]);return db[_0xecd7('0xd9')][_0xecd7('0x2d')]({'where':_0x128911[_0xecd7('0x51')]})[_0xecd7('0x1c')](function(_0x1c14fa){_0x16cd27[_0xecd7('0x2d')]=_0x1c14fa;if(_0x3b0a43[_0xecd7('0x46')][_0xecd7('0x55')]){_0x128911['include']=[{'all':!![]}];}else{_0x128911[_0xecd7('0x56')]=[{'model':db['CmContact'],'as':_0xecd7('0x12c'),'required':![]},{'model':db[_0xecd7('0x12d')],'as':_0xecd7('0x12e'),'required':![]}];}return db[_0xecd7('0xd9')]['findAll'](_0x128911);})[_0xecd7('0x1c')](function(_0x5037eb){_0x16cd27[_0xecd7('0x58')]=_0x5037eb;return _0x16cd27;});}})[_0xecd7('0x1c')](respondWithFilteredResult(_0x3c0237,_0x128911))[_0xecd7('0x5c')](handleError(_0x3c0237,null));};exports[_0xecd7('0x12f')]=function(_0x1815e4,_0x2df28b,_0x5ab2dd){return db[_0xecd7('0x3f')]['find']({'where':{'id':_0x1815e4[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2df28b,null))[_0xecd7('0x1c')](function(_0x59b7ca){if(_0x59b7ca){return _0x59b7ca[_0xecd7('0x12f')](_0x1815e4[_0xecd7('0x5e')]['ids'],_[_0xecd7('0xf6')](_0x1815e4['body'],['ids','id'])||{})[_0xecd7('0xd3')](function(_0x16db81){for(var _0x3eda7e=0x0;_0x3eda7e<_0x1815e4[_0xecd7('0x5e')][_0xecd7('0x6c')][_0xecd7('0x4a')];_0x3eda7e+=0x1){socket[_0xecd7('0x130')]('userChatWebsite:save',{'UserId':Number(_0x1815e4[_0xecd7('0x5e')][_0xecd7('0x6c')][_0x3eda7e]),'ChatWebsiteId':Number(_0x1815e4['params']['id'])});}return _0x16db81;});}})[_0xecd7('0x1c')](respondWithResult(_0x2df28b,null))[_0xecd7('0x5c')](handleError(_0x2df28b,null));};exports[_0xecd7('0x131')]=function(_0x116d02,_0x5b7367,_0x139b7d){return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x116d02['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x5b7367,null))[_0xecd7('0x1c')](function(_0x2bd6fd){if(_0x2bd6fd){return _0x2bd6fd['removeAgents'](_0x116d02[_0xecd7('0x46')][_0xecd7('0x6c')])['then'](function(){if(_[_0xecd7('0x132')](_0x116d02[_0xecd7('0x46')][_0xecd7('0x6c')])){for(var _0x23c08e=0x0;_0x23c08e<_0x116d02[_0xecd7('0x46')][_0xecd7('0x6c')][_0xecd7('0x4a')];_0x23c08e+=0x1){socket[_0xecd7('0x130')](_0xecd7('0x133'),{'UserId':Number(_0x116d02['query']['ids'][_0x23c08e]),'ChatWebsiteId':Number(_0x116d02[_0xecd7('0x5a')]['id'])});}}else{socket[_0xecd7('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x116d02[_0xecd7('0x46')][_0xecd7('0x6c')]),'ChatWebsiteId':Number(_0x116d02['params']['id'])});}});}})[_0xecd7('0x1c')](respondWithStatusCode(_0x5b7367,null))[_0xecd7('0x5c')](handleError(_0x5b7367,null));};exports[_0xecd7('0x134')]=function(_0x176b42,_0x46ea96,_0x262c90){var _0x36924c={};var _0x2b4f98={};var _0x2da166;var _0x5b4257;return db['ChatWebsite'][_0xecd7('0x69')]({'where':{'id':_0x176b42['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x46ea96,null))['then'](function(_0x17c600){if(_0x17c600){_0x2da166=_0x17c600;_0x2b4f98[_0xecd7('0x44')]=_['keys'](db[_0xecd7('0xf8')][_0xecd7('0x40')]);_0x2b4f98[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x176b42[_0xecd7('0x46')]);_0x2b4f98['filters']=_['intersection'](_0x2b4f98[_0xecd7('0x44')],_0x2b4f98[_0xecd7('0x46')]);_0x36924c[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x2b4f98['model'],qs['fields'](_0x176b42[_0xecd7('0x46')][_0xecd7('0x49')]));_0x36924c['attributes']=_0x36924c[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x36924c[_0xecd7('0x48')]:_0x2b4f98['model'];_0x36924c[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x176b42[_0xecd7('0x46')][_0xecd7('0x4e')]);_0x36924c['where']=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x176b42[_0xecd7('0x46')],_0x2b4f98['filters']));if(_0x176b42[_0xecd7('0x46')][_0xecd7('0x50')]){_0x36924c[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x36924c[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x36924c[_0xecd7('0x48')],function(_0x5d3e27){var _0x7274e2={};_0x7274e2[_0x5d3e27]={'$like':'%'+_0x176b42['query'][_0xecd7('0x50')]+'%'};return _0x7274e2;})});}_0x36924c=_['merge']({},_0x36924c,_0x176b42[_0xecd7('0x54')]);return _0x2da166['getAgents'](_0x36924c);}})[_0xecd7('0x1c')](function(_0x36cba8){if(_0x36cba8){_0x5b4257=_0x36cba8['length'];if(!_0x176b42[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x36924c[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x176b42['query']['limit']);_0x36924c[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x176b42[_0xecd7('0x46')]['offset']);}return _0x2da166[_0xecd7('0x134')](_0x36924c);}})[_0xecd7('0x1c')](function(_0x4d9e7f){if(_0x4d9e7f){return _0x4d9e7f?{'count':_0x5b4257,'rows':_0x4d9e7f}:null;}})[_0xecd7('0x1c')](respondWithResult(_0x46ea96,null))[_0xecd7('0x5c')](handleError(_0x46ea96,null));}; \ No newline at end of file +var _0x1135=['CmContact','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','createdAt','from\x20is\x20mandatory','send','mapKeyOffline','includes','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','stringify','connection','verticalAlignment','color','textColor','backgroundColor','addApplications','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','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','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','defaults'];(function(_0x1162bb,_0xa141a6){var _0x45b029=function(_0x52b902){while(--_0x52b902){_0x1162bb['push'](_0x1162bb['shift']());}};_0x45b029(++_0xa141a6);}(_0x1135,0x1bf));var _0x5113=function(_0x80daa5,_0x38040f){_0x80daa5=_0x80daa5-0x0;var _0x2d13d1=_0x1135[_0x80daa5];return _0x2d13d1;};'use strict';var emlformat=require(_0x5113('0x0'));var rimraf=require(_0x5113('0x1'));var zipdir=require(_0x5113('0x2'));var jsonpatch=require(_0x5113('0x3'));var rp=require(_0x5113('0x4'));var moment=require('moment');var BPromise=require(_0x5113('0x5'));var Mustache=require(_0x5113('0x6'));var util=require(_0x5113('0x7'));var path=require(_0x5113('0x8'));var sox=require(_0x5113('0x9'));var csv=require(_0x5113('0xa'));var ejs=require(_0x5113('0xb'));var fs=require('fs');var fs_extra=require(_0x5113('0xc'));var _=require(_0x5113('0xd'));var squel=require(_0x5113('0xe'));var crypto=require('crypto');var jsforce=require(_0x5113('0xf'));var deskjs=require(_0x5113('0x10'));var toCsv=require(_0x5113('0xa'));var querystring=require(_0x5113('0x11'));var Papa=require(_0x5113('0x12'));var Redis=require('ioredis');var authService=require(_0x5113('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5113('0x14'));var hardwareService=require(_0x5113('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5113('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5113('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5113('0x18')],{'host':_0x5113('0x19'),'port':0x18eb});var socket=require(_0x5113('0x1a'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x5113('0x1b')](socket);var jayson=require(_0x5113('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x5113('0x1d')]['http']({'port':0x232a});var client9003=jayson[_0x5113('0x1d')][_0x5113('0x1e')]({'port':0x232b});var client9001=jayson[_0x5113('0x1d')][_0x5113('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x1cda47,_0x23d4aa,_0x1f03f2,_0x30d851){return new BPromise(function(_0x2ea49d,_0x253260){var _0x371a9f=_0x30d851||client;return _0x371a9f[_0x5113('0x1f')](_0x1cda47,_0x1f03f2)[_0x5113('0x20')](function(_0x21af06){logger[_0x5113('0x21')](_0x5113('0x22'),_0x23d4aa,_0x5113('0x23'));logger[_0x5113('0x24')](_0x5113('0x25'),_0x23d4aa,_0x5113('0x23'),JSON['stringify'](_0x21af06));if(_0x21af06[_0x5113('0x26')]){if(_0x21af06[_0x5113('0x26')][_0x5113('0x27')]===0x1f4){logger[_0x5113('0x26')](_0x5113('0x22'),_0x23d4aa,_0x21af06[_0x5113('0x26')][_0x5113('0x28')]);return _0x253260(_0x21af06[_0x5113('0x26')][_0x5113('0x28')]);}logger[_0x5113('0x26')](_0x5113('0x22'),_0x23d4aa,_0x21af06['error'][_0x5113('0x28')]);return _0x2ea49d(_0x21af06[_0x5113('0x26')][_0x5113('0x28')]);}else{logger['info'](_0x5113('0x22'),_0x23d4aa,_0x5113('0x23'));_0x2ea49d(_0x21af06[_0x5113('0x29')][_0x5113('0x28')]);}})[_0x5113('0x2a')](function(_0x315212){logger['error'](_0x5113('0x22'),_0x23d4aa,_0x315212);_0x253260(_0x315212);});});}function respondWithStatusCode(_0x4ac1b3,_0x1c896e){_0x1c896e=_0x1c896e||0xcc;return function(_0x343e3e){if(_0x343e3e){return _0x4ac1b3[_0x5113('0x2b')](_0x1c896e);}return _0x4ac1b3['status'](_0x1c896e)[_0x5113('0x2c')]();};}function respondWithResult(_0x4d4a9e,_0x316987){_0x316987=_0x316987||0xc8;return function(_0x31c721){if(_0x31c721){return _0x4d4a9e[_0x5113('0x2d')](_0x316987)[_0x5113('0x2e')](_0x31c721);}};}function respondWithFilteredResult(_0x11722d,_0x8f01c){return function(_0x2598d9){if(_0x2598d9){var _0x3b437f=typeof _0x8f01c[_0x5113('0x2f')]==='undefined'&&typeof _0x8f01c[_0x5113('0x30')]===_0x5113('0x31');var _0x5876d8=_0x2598d9[_0x5113('0x32')];var _0x306de6=_0x3b437f?0x0:_0x8f01c['offset'];var _0x3807ff=_0x3b437f?_0x2598d9[_0x5113('0x32')]:_0x8f01c[_0x5113('0x2f')]+_0x8f01c[_0x5113('0x30')];var _0x30d030;if(_0x3807ff>=_0x5876d8){_0x3807ff=_0x5876d8;_0x30d030=0xc8;}else{_0x30d030=0xce;}_0x11722d['status'](_0x30d030);return _0x11722d[_0x5113('0x33')](_0x5113('0x34'),_0x306de6+'-'+_0x3807ff+'/'+_0x5876d8)[_0x5113('0x2e')](_0x2598d9);}return null;};}function patchUpdates(_0x23302b){return function(_0x3013ba){try{jsonpatch['apply'](_0x3013ba,_0x23302b,!![]);}catch(_0xb98b38){return BPromise[_0x5113('0x35')](_0xb98b38);}return _0x3013ba['save']();};}function saveUpdates(_0x1a66f9,_0x2330f7){return function(_0x5b1084){if(_0x5b1084){return _0x5b1084['update'](_0x1a66f9)[_0x5113('0x20')](function(_0x391bac){return _0x391bac;});}return null;};}function removeEntity(_0x353f70,_0xa35417){return function(_0xd9431f){if(_0xd9431f){return _0xd9431f[_0x5113('0x36')]()[_0x5113('0x20')](function(){var _0x2fd247=_0xd9431f[_0x5113('0x37')]({'plain':!![]});var _0x544e43=_0x5113('0x38');return db[_0x5113('0x39')][_0x5113('0x36')]({'where':{'type':_0x544e43,'resourceId':_0x2fd247['id']}})[_0x5113('0x20')](function(){return _0xd9431f;});})[_0x5113('0x20')](function(){_0x353f70[_0x5113('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2860ea,_0x3c9d79){return function(_0x28e46e){if(!_0x28e46e){_0x2860ea['sendStatus'](0x194);}return _0x28e46e;};}function handleError(_0x472d09,_0x5ebf8e){_0x5ebf8e=_0x5ebf8e||0x1f4;return function(_0x26e365){logger[_0x5113('0x26')](_0x26e365[_0x5113('0x3a')]);if(_0x26e365[_0x5113('0x3b')]){delete _0x26e365[_0x5113('0x3b')];}_0x472d09['status'](_0x5ebf8e)['send'](_0x26e365);};}exports[_0x5113('0x3c')]=function(_0x1c6498,_0x6bdc1d){var _0x423cfa={'include':[{'model':db[_0x5113('0x3d')],'as':_0x5113('0x3e')}]},_0x56f58e={},_0x4e0d52={'count':0x0,'rows':[]};var _0x1c4c26=_['map'](db[_0x5113('0x3f')][_0x5113('0x40')],function(_0xa0861c){return{'name':_0xa0861c[_0x5113('0x41')],'type':_0xa0861c['type'][_0x5113('0x42')]};});_0x56f58e[_0x5113('0x43')]=_[_0x5113('0x44')](_0x1c4c26,_0x5113('0x3b'));_0x56f58e[_0x5113('0x45')]=_['keys'](_0x1c6498[_0x5113('0x45')]);_0x56f58e[_0x5113('0x46')]=_[_0x5113('0x47')](_0x56f58e[_0x5113('0x43')],_0x56f58e['query']);_0x423cfa['attributes']=_[_0x5113('0x47')](_0x56f58e['model'],qs[_0x5113('0x48')](_0x1c6498['query']['fields']));_0x423cfa[_0x5113('0x49')]=_0x423cfa[_0x5113('0x49')][_0x5113('0x4a')]?_0x423cfa[_0x5113('0x49')]:_0x56f58e[_0x5113('0x43')];if(!_0x1c6498[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x423cfa[_0x5113('0x30')]=qs[_0x5113('0x30')](_0x1c6498[_0x5113('0x45')][_0x5113('0x30')]);_0x423cfa[_0x5113('0x2f')]=qs['offset'](_0x1c6498[_0x5113('0x45')][_0x5113('0x2f')]);}_0x423cfa[_0x5113('0x4d')]=qs['sort'](_0x1c6498[_0x5113('0x45')][_0x5113('0x4e')]);_0x423cfa[_0x5113('0x4f')]=qs[_0x5113('0x46')](_[_0x5113('0x50')](_0x1c6498[_0x5113('0x45')],_0x56f58e[_0x5113('0x46')]),_0x1c4c26);if(_0x1c6498[_0x5113('0x45')]['filter']){_0x423cfa[_0x5113('0x4f')]=_['merge'](_0x423cfa[_0x5113('0x4f')],{'$or':_['map'](_0x1c4c26,function(_0x25ad1f){if(_0x25ad1f[_0x5113('0x51')]!==_0x5113('0x52')){var _0xdb490c={};_0xdb490c[_0x25ad1f[_0x5113('0x3b')]]={'$like':'%'+_0x1c6498[_0x5113('0x45')][_0x5113('0x53')]+'%'};return _0xdb490c;}})});}_0x423cfa=_[_0x5113('0x54')]({},_0x423cfa,_0x1c6498[_0x5113('0x55')]);var _0x3d1060={'where':_0x423cfa[_0x5113('0x4f')]};return db[_0x5113('0x3f')]['count'](_0x3d1060)['then'](function(_0x170e29){_0x4e0d52['count']=_0x170e29;if(_0x1c6498[_0x5113('0x45')][_0x5113('0x56')]){_0x423cfa['include']=[{'all':!![]}];}return db[_0x5113('0x3f')][_0x5113('0x57')](_0x423cfa);})[_0x5113('0x20')](function(_0x54747a){_0x4e0d52[_0x5113('0x58')]=_0x54747a;return _0x4e0d52;})[_0x5113('0x20')](respondWithFilteredResult(_0x6bdc1d,_0x423cfa))[_0x5113('0x2a')](handleError(_0x6bdc1d,null));};exports[_0x5113('0x59')]=function(_0x2b3b34,_0x6181d4){var _0x2cee78={'raw':![],'where':{'id':_0x2b3b34['params']['id']},'include':[{'model':db[_0x5113('0x3d')],'as':_0x5113('0x3e')}]},_0x27f393={};_0x27f393[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0x3f')][_0x5113('0x40')]);_0x27f393[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x2b3b34['query']);_0x27f393['filters']=_[_0x5113('0x47')](_0x27f393[_0x5113('0x43')],_0x27f393['query']);_0x2cee78[_0x5113('0x49')]=_[_0x5113('0x47')](_0x27f393[_0x5113('0x43')],qs[_0x5113('0x48')](_0x2b3b34[_0x5113('0x45')]['fields']));_0x2cee78[_0x5113('0x49')]=_0x2cee78['attributes']['length']?_0x2cee78[_0x5113('0x49')]:_0x27f393['model'];if(_0x2b3b34[_0x5113('0x45')]['includeAll']){_0x2cee78[_0x5113('0x5b')]=[{'all':!![]}];}_0x2cee78=_['merge']({},_0x2cee78,_0x2b3b34[_0x5113('0x55')]);return db[_0x5113('0x3f')][_0x5113('0x5c')](_0x2cee78)[_0x5113('0x20')](handleEntityNotFound(_0x6181d4,null))[_0x5113('0x20')](respondWithResult(_0x6181d4,null))[_0x5113('0x2a')](handleError(_0x6181d4,null));};exports[_0x5113('0x5d')]=function(_0x2699bc,_0xb75e02){return db[_0x5113('0x3f')][_0x5113('0x5d')](_0x2699bc[_0x5113('0x5e')],{})[_0x5113('0x20')](function(_0x262088){var _0x4fab29=_0x2699bc['user'][_0x5113('0x37')]({'plain':!![]});if(!_0x4fab29)throw new Error(_0x5113('0x5f'));if(_0x4fab29[_0x5113('0x60')]===_0x5113('0x61')){var _0x2e265e=_0x262088['get']({'plain':!![]});var _0x5c9b3a='ChatWebsites';return db['UserProfileSection'][_0x5113('0x5c')]({'where':{'name':_0x5c9b3a,'userProfileId':_0x4fab29[_0x5113('0x62')]},'raw':!![]})[_0x5113('0x20')](function(_0x1be017){if(_0x1be017&&_0x1be017[_0x5113('0x63')]===0x0){return db[_0x5113('0x39')]['create']({'name':_0x2e265e[_0x5113('0x3b')],'resourceId':_0x2e265e['id'],'type':_0x1be017[_0x5113('0x3b')],'sectionId':_0x1be017['id']},{})[_0x5113('0x20')](function(){return _0x262088;});}else{return _0x262088;}})[_0x5113('0x2a')](function(_0x2ebc87){logger['error'](_0x5113('0x64'),_0x2ebc87);throw _0x2ebc87;});}return _0x262088;})[_0x5113('0x20')](respondWithResult(_0xb75e02,0xc9))[_0x5113('0x2a')](handleError(_0xb75e02,null));};exports[_0x5113('0x65')]=function(_0x4f3478,_0x28c0fd){if(_0x4f3478[_0x5113('0x5e')]['id']){delete _0x4f3478[_0x5113('0x5e')]['id'];}return db[_0x5113('0x3f')]['find']({'where':{'id':_0x4f3478[_0x5113('0x66')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5113('0x20')](handleEntityNotFound(_0x28c0fd,null))[_0x5113('0x20')](saveUpdates(_0x4f3478[_0x5113('0x5e')],null))[_0x5113('0x20')](respondWithResult(_0x28c0fd,null))['catch'](handleError(_0x28c0fd,null));};exports[_0x5113('0x36')]=function(_0x51aebd,_0x38a6c9){return db[_0x5113('0x3f')]['find']({'where':{'id':_0x51aebd[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x38a6c9,null))['then'](removeEntity(_0x38a6c9,null))[_0x5113('0x2a')](handleError(_0x38a6c9,null));};exports[_0x5113('0x67')]=function(_0x2c603d,_0x104fc6){return db[_0x5113('0x3f')][_0x5113('0x67')]()[_0x5113('0x20')](respondWithResult(_0x104fc6,null))[_0x5113('0x2a')](handleError(_0x104fc6,null));};exports['addDisposition']=function(_0x42d08c,_0x2ad755,_0x1c655c){if(_0x42d08c['body']['id']){delete _0x42d08c[_0x5113('0x5e')]['id'];}return db[_0x5113('0x3f')]['find']({'where':{'id':_0x42d08c[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x2ad755,null))['then'](function(_0xedcddb){if(_0xedcddb){_0x42d08c[_0x5113('0x5e')][_0x5113('0x68')]=_0xedcddb['id'];return db['Disposition'][_0x5113('0x5d')](_0x42d08c[_0x5113('0x5e')]);}})[_0x5113('0x20')](respondWithResult(_0x2ad755,null))['catch'](handleError(_0x2ad755,null));};exports[_0x5113('0x69')]=function(_0x41ba3d,_0x512c65,_0x46b439){var _0x364d97={'raw':![],'where':{}};var _0x36bf40={};var _0x512512={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5113('0x6a')]({'where':{'id':_0x41ba3d[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x512c65,null))[_0x5113('0x20')](function(_0x221008){if(_0x221008){_0x36bf40[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0x6b')][_0x5113('0x40')]);_0x36bf40[_0x5113('0x45')]=_['keys'](_0x41ba3d[_0x5113('0x45')]);_0x36bf40[_0x5113('0x46')]=_['intersection'](_0x36bf40[_0x5113('0x43')],_0x36bf40['query']);_0x364d97[_0x5113('0x49')]=_[_0x5113('0x47')](_0x36bf40[_0x5113('0x43')],qs[_0x5113('0x48')](_0x41ba3d[_0x5113('0x45')][_0x5113('0x48')]));_0x364d97[_0x5113('0x49')]=_0x364d97[_0x5113('0x49')]['length']?_0x364d97[_0x5113('0x49')]:_0x36bf40[_0x5113('0x43')];if(!_0x41ba3d[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x364d97[_0x5113('0x30')]=qs[_0x5113('0x30')](_0x41ba3d[_0x5113('0x45')]['limit']);_0x364d97['offset']=qs[_0x5113('0x2f')](_0x41ba3d['query']['offset']);}_0x364d97[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x41ba3d[_0x5113('0x45')][_0x5113('0x4e')]);_0x364d97[_0x5113('0x4f')]=qs['filters'](_[_0x5113('0x50')](_0x41ba3d[_0x5113('0x45')],_0x36bf40[_0x5113('0x46')]));_0x364d97[_0x5113('0x4f')][_0x5113('0x68')]=_0x221008['id'];if(_0x41ba3d['query'][_0x5113('0x53')]){_0x364d97[_0x5113('0x4f')]=_[_0x5113('0x54')](_0x364d97['where'],{'$or':_['map'](_0x364d97[_0x5113('0x49')],function(_0x5c06de){var _0x5aeaba={};_0x5aeaba[_0x5c06de]={'$like':'%'+_0x41ba3d['query'][_0x5113('0x53')]+'%'};return _0x5aeaba;})});}_0x364d97=_[_0x5113('0x54')]({},_0x364d97,_0x41ba3d[_0x5113('0x55')]);return db[_0x5113('0x6b')][_0x5113('0x32')]({'where':_0x364d97['where']})['then'](function(_0x37722f){_0x512512[_0x5113('0x32')]=_0x37722f;if(_0x41ba3d['query'][_0x5113('0x56')]){_0x364d97[_0x5113('0x5b')]=[{'all':!![]}];}return db[_0x5113('0x6b')][_0x5113('0x57')](_0x364d97);})[_0x5113('0x20')](function(_0x267166){_0x512512[_0x5113('0x58')]=_0x267166;return _0x512512;});}})[_0x5113('0x20')](respondWithFilteredResult(_0x512c65,_0x364d97))[_0x5113('0x2a')](handleError(_0x512c65,null));};exports[_0x5113('0x6c')]=function(_0x254e48,_0x4fd488,_0x324d33){return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x254e48[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x4fd488,null))[_0x5113('0x20')](function(_0x254b8c){if(_0x254b8c){return _0x254b8c[_0x5113('0x6c')](_0x254e48[_0x5113('0x45')][_0x5113('0x6d')]);}})[_0x5113('0x20')](respondWithStatusCode(_0x4fd488,null))[_0x5113('0x2a')](handleError(_0x4fd488,null));};exports[_0x5113('0x6e')]=function(_0x5e696f,_0x318aee,_0x2ee74b){if(_0x5e696f['body']['id']){delete _0x5e696f[_0x5113('0x5e')]['id'];}return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x5e696f[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x318aee,null))[_0x5113('0x20')](function(_0xb84742){if(_0xb84742){_0x5e696f['body'][_0x5113('0x68')]=_0xb84742['id'];return db[_0x5113('0x6f')]['create'](_0x5e696f[_0x5113('0x5e')]);}})[_0x5113('0x20')](respondWithResult(_0x318aee,null))[_0x5113('0x2a')](handleError(_0x318aee,null));};exports[_0x5113('0x70')]=function(_0x512be1,_0x172d16,_0x470784){var _0x1e5454={'raw':![],'where':{}};var _0x446972={};var _0x14401e={'count':0x0,'rows':[]};return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0x512be1[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x172d16,null))['then'](function(_0x4cc013){if(_0x4cc013){_0x446972[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0x6f')][_0x5113('0x40')]);_0x446972[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x512be1[_0x5113('0x45')]);_0x446972['filters']=_[_0x5113('0x47')](_0x446972[_0x5113('0x43')],_0x446972[_0x5113('0x45')]);_0x1e5454[_0x5113('0x49')]=_[_0x5113('0x47')](_0x446972[_0x5113('0x43')],qs[_0x5113('0x48')](_0x512be1[_0x5113('0x45')][_0x5113('0x48')]));_0x1e5454[_0x5113('0x49')]=_0x1e5454[_0x5113('0x49')]['length']?_0x1e5454[_0x5113('0x49')]:_0x446972[_0x5113('0x43')];if(!_0x512be1[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x1e5454[_0x5113('0x30')]=qs[_0x5113('0x30')](_0x512be1[_0x5113('0x45')][_0x5113('0x30')]);_0x1e5454[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x512be1['query']['offset']);}_0x1e5454[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x512be1[_0x5113('0x45')][_0x5113('0x4e')]);_0x1e5454[_0x5113('0x4f')]=qs[_0x5113('0x46')](_[_0x5113('0x50')](_0x512be1[_0x5113('0x45')],_0x446972[_0x5113('0x46')]));_0x1e5454[_0x5113('0x4f')][_0x5113('0x68')]=_0x4cc013['id'];if(_0x512be1['query']['filter']){_0x1e5454['where']=_['merge'](_0x1e5454['where'],{'$or':_[_0x5113('0x44')](_0x1e5454['attributes'],function(_0x502db1){var _0x343d74={};_0x343d74[_0x502db1]={'$like':'%'+_0x512be1['query'][_0x5113('0x53')]+'%'};return _0x343d74;})});}_0x1e5454=_[_0x5113('0x54')]({},_0x1e5454,_0x512be1[_0x5113('0x55')]);return db[_0x5113('0x6f')][_0x5113('0x32')]({'where':_0x1e5454['where']})[_0x5113('0x20')](function(_0x7140dd){_0x14401e[_0x5113('0x32')]=_0x7140dd;if(_0x512be1[_0x5113('0x45')][_0x5113('0x56')]){_0x1e5454[_0x5113('0x5b')]=[{'all':!![]}];}return db[_0x5113('0x6f')][_0x5113('0x57')](_0x1e5454);})['then'](function(_0x146ce4){_0x14401e[_0x5113('0x58')]=_0x146ce4;return _0x14401e;});}})[_0x5113('0x20')](respondWithFilteredResult(_0x172d16,_0x1e5454))['catch'](handleError(_0x172d16,null));};exports['removeAnswers']=function(_0x51fb2a,_0x46cf8a,_0x2e8870){return db['ChatWebsite'][_0x5113('0x5c')]({'where':{'id':_0x51fb2a['params']['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x46cf8a,null))['then'](function(_0x3ba46d){if(_0x3ba46d){return _0x3ba46d[_0x5113('0x71')](_0x51fb2a['query']['ids']);}})[_0x5113('0x20')](respondWithStatusCode(_0x46cf8a,null))[_0x5113('0x2a')](handleError(_0x46cf8a,null));};exports[_0x5113('0x72')]=function(_0x55b2d2,_0x252476,_0x580915){_0x55b2d2['body'][_0x5113('0x73')]=_0x55b2d2['file']['filename'];return db['ChatWebsite'][_0x5113('0x5c')]({'where':{'id':_0x55b2d2[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x252476,null))['then'](saveUpdates(_0x55b2d2[_0x5113('0x5e')],null))['then'](respondWithResult(_0x252476,null))[_0x5113('0x2a')](handleError(_0x252476,null));};exports['addAvatar']=function(_0x26d19a,_0x3894a6,_0x36b06d){_0x26d19a[_0x5113('0x5e')][_0x5113('0x74')]=_0x26d19a[_0x5113('0x75')][_0x5113('0x76')];return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x26d19a['params']['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x3894a6,null))[_0x5113('0x20')](saveUpdates(_0x26d19a['body'],null))[_0x5113('0x20')](respondWithResult(_0x3894a6,null))[_0x5113('0x2a')](handleError(_0x3894a6,null));};exports[_0x5113('0x77')]=function(_0x217675,_0x9edc6f,_0x1a508d){_0x217675[_0x5113('0x5e')][_0x5113('0x78')]=_0x217675[_0x5113('0x75')]['filename'];return db[_0x5113('0x3f')]['find']({'where':{'id':_0x217675[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x9edc6f,null))['then'](saveUpdates(_0x217675[_0x5113('0x5e')],null))[_0x5113('0x20')](respondWithResult(_0x9edc6f,null))[_0x5113('0x2a')](handleError(_0x9edc6f,null));};exports[_0x5113('0x79')]=function(_0x17abe0,_0x9b214a,_0x42e542){_0x17abe0[_0x5113('0x5e')][_0x5113('0x7a')]=_0x17abe0[_0x5113('0x75')][_0x5113('0x76')];return db[_0x5113('0x3f')]['find']({'where':{'id':_0x17abe0['params']['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x9b214a,null))[_0x5113('0x20')](saveUpdates(_0x17abe0[_0x5113('0x5e')],null))[_0x5113('0x20')](respondWithResult(_0x9b214a,null))[_0x5113('0x2a')](handleError(_0x9b214a,null));};exports[_0x5113('0x7b')]=function(_0x54ee3d,_0x18760e,_0x11e8fa){var _0x1a4d3f=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x7e'));var _0x22bdba={'where':{'id':_0x54ee3d[_0x5113('0x66')]['id']},'attributes':['id',_0x5113('0x73')],'raw':!![]};var _0x47a54b=![];return require(_0x5113('0x17'))[_0x5113('0x7f')]()[_0x5113('0x20')](function(_0x33650f){if(_0x33650f){_0x47a54b=_0x33650f[_0x5113('0x80')];}})[_0x5113('0x20')](function(){return db[_0x5113('0x3f')][_0x5113('0x5c')](_0x22bdba);})[_0x5113('0x20')](handleEntityNotFound(_0x18760e,null))[_0x5113('0x20')](function(_0x525f56){if(_0x525f56){if(!_[_0x5113('0x81')](_0x525f56[_0x5113('0x73')])){if(fs[_0x5113('0x82')](path['join'](config[_0x5113('0x7d')],_0x5113('0x83'),_0x525f56[_0x5113('0x73')]))&&_0x47a54b){_0x1a4d3f=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x83'),_0x525f56[_0x5113('0x73')]);}}return _0x18760e[_0x5113('0x84')](_0x1a4d3f);}})[_0x5113('0x2a')](handleError(_0x18760e,null));};exports['getAvatar']=function(_0x3aa146,_0x9c3267,_0x19741d){var _0x411253=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x85'));var _0x5ed479={'where':{'id':_0x3aa146[_0x5113('0x66')]['id']},'attributes':['id',_0x5113('0x74')],'raw':!![]};return db[_0x5113('0x3f')]['find'](_0x5ed479)[_0x5113('0x20')](handleEntityNotFound(_0x9c3267,null))['then'](function(_0x322ec3){if(_0x322ec3){if(!_['isNil'](_0x322ec3[_0x5113('0x74')])){if(fs[_0x5113('0x82')](path['join'](config[_0x5113('0x7d')],'server/files/images/avatars/',_0x322ec3[_0x5113('0x74')]))){_0x411253=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x86'),_0x322ec3[_0x5113('0x74')]);}}return _0x9c3267['download'](_0x411253);}})[_0x5113('0x2a')](handleError(_0x9c3267,null));};exports[_0x5113('0x87')]=function(_0xb1a24c,_0x366e0d,_0x194151){var _0x2b97ca=path[_0x5113('0x7c')](config[_0x5113('0x7d')],'server/files/images/avatars/customer_avatar.png');var _0x3a51c4={'where':{'id':_0xb1a24c[_0x5113('0x66')]['id']},'attributes':['id',_0x5113('0x78'),_0x5113('0x88')],'raw':!![]};return db[_0x5113('0x3f')]['find'](_0x3a51c4)['then'](handleEntityNotFound(_0x366e0d,null))[_0x5113('0x20')](function(_0x2a6758){if(_0x2a6758){if(!_[_0x5113('0x81')](_0x2a6758['customerAvatar'])){if(fs[_0x5113('0x82')](path[_0x5113('0x7c')](config['root'],_0x5113('0x86'),_0x2a6758[_0x5113('0x78')]))&&_0x2a6758[_0x5113('0x88')]){_0x2b97ca=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x86'),_0x2a6758[_0x5113('0x78')]);}}return _0x366e0d['download'](_0x2b97ca);}})['catch'](handleError(_0x366e0d,null));};exports[_0x5113('0x89')]=function(_0x3a5f8e,_0x4de6b6,_0x3e2fa5){var _0x16ae96=path[_0x5113('0x7c')](config['root'],_0x5113('0x8a'));var _0x2ca5ec={'where':{'id':_0x3a5f8e['params']['id']},'attributes':['id',_0x5113('0x7a')],'raw':!![]};return db[_0x5113('0x3f')][_0x5113('0x5c')](_0x2ca5ec)[_0x5113('0x20')](handleEntityNotFound(_0x4de6b6,null))[_0x5113('0x20')](function(_0x32f746){if(_0x32f746){if(!_[_0x5113('0x81')](_0x32f746[_0x5113('0x7a')])){if(fs[_0x5113('0x82')](path[_0x5113('0x7c')](config[_0x5113('0x7d')],'server/files/images/avatars/',_0x32f746[_0x5113('0x7a')]))){_0x16ae96=path[_0x5113('0x7c')](config['root'],'server/files/images/avatars/',_0x32f746[_0x5113('0x7a')]);}}return _0x4de6b6[_0x5113('0x84')](_0x16ae96);}})['catch'](handleError(_0x4de6b6,null));};exports[_0x5113('0x8b')]=function(_0x2057a5,_0x3fd817,_0x4f394b){var _0xbf6c2e=require('user-agent-parser');var _0x20cca5=new _0xbf6c2e();var _0xdd6e96=_0x20cca5[_0x5113('0x8c')](_0x2057a5[_0x5113('0x8d')][_0x5113('0x8e')])['getResult']();var _0x6378c2={'body':_0x2057a5[_0x5113('0x5e')],'channel':_0x5113('0x8f')};var _0x8205a1=[];var _0x1a8a02=[];var _0x4b11a9={};var _0x46b07c=![];return db['CmContact'][_0x5113('0x67')]()[_0x5113('0x20')](function(_0xddacd3){if(!_0xddacd3){throw new db[(_0x5113('0x90'))][(_0x5113('0x91'))](_0x5113('0x92'));}_0x8205a1=_[_0x5113('0x93')](_[_0x5113('0x5a')](_0xddacd3),['createdAt',_0x5113('0x94')]);_0x1a8a02=_[_0x5113('0x93')](_[_0x5113('0x5a')](_0xddacd3),['createdAt',_0x5113('0x94'),_0x5113('0x95'),_0x5113('0x96')]);if(_0x2057a5[_0x5113('0x5e')]['id']){delete _0x2057a5['body']['id'];}if(_['isNil'](_0x2057a5['body'][_0x5113('0x97')])){throw new db[(_0x5113('0x90'))][(_0x5113('0x91'))]('from\x20is\x20mandatory');}if(_[_0x5113('0x81')](_0x2057a5[_0x5113('0x5e')][_0x5113('0x5e')])||_0x2057a5['body'][_0x5113('0x5e')]===''){throw new db[(_0x5113('0x90'))][(_0x5113('0x91'))](_0x5113('0x98'));}if(_[_0x5113('0x81')](_0x2057a5[_0x5113('0x5e')][_0x5113('0x99')])){throw new db[(_0x5113('0x90'))][(_0x5113('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1a8a02);}if(!_['includes'](_0x1a8a02,_0x2057a5['body'][_0x5113('0x99')])){throw new db[(_0x5113('0x90'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1a8a02);}_0x4b11a9[_0x2057a5[_0x5113('0x5e')]['mapKey']]=_0x2057a5[_0x5113('0x5e')][_0x5113('0x97')];})[_0x5113('0x20')](function(){return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x2057a5[_0x5113('0x66')]['id']},'include':[{'model':db[_0x5113('0x9a')],'as':_0x5113('0x9b'),'include':[{'model':db['CmContact'],'as':_0x5113('0x9c'),'where':_0x4b11a9,'limit':0x1,'order':[[_0x5113('0x94'),_0x5113('0x9d')]]}]},{'model':db[_0x5113('0x9e')],'as':_0x5113('0x9f')}]});})['then'](handleEntityNotFound(_0x3fd817,null))[_0x5113('0x20')](function(_0x52e029){if(_0x52e029&&_0x52e029[_0x5113('0x9b')]){_0x6378c2[_0x5113('0xa0')]=_0x52e029;_0x6378c2[_0x5113('0xa1')]=_0x52e029[_0x5113('0x9f')];_0x6378c2[_0x5113('0xa2')]=_0x52e029[_0x5113('0x9b')];_0x6378c2[_0x5113('0xa1')]=_[_0x5113('0xa3')](_0x6378c2[_0x5113('0xa1')],[_0x5113('0xa4')],[_0x5113('0xa5')]);if(_0x6378c2[_0x5113('0xa0')]['Applications']){delete _0x6378c2[_0x5113('0xa0')][_0x5113('0x9f')];}if(_0x6378c2[_0x5113('0xa0')][_0x5113('0x9b')]&&_0x6378c2[_0x5113('0xa0')][_0x5113('0x9b')][_0x5113('0x9c')]['length']){return _0x6378c2[_0x5113('0xa0')][_0x5113('0x9b')][_0x5113('0x9c')][0x0];}var _0x588f67=_[_0x5113('0xa6')](_0x2057a5['body'],{'firstName':_0x2057a5[_0x5113('0x5e')][_0x5113('0x97')],'ListId':_0x52e029[_0x5113('0x96')]});_0x588f67[_0x2057a5['body'][_0x5113('0x99')]]=_0x2057a5[_0x5113('0x5e')][_0x5113('0x97')];return db[_0x5113('0xa7')][_0x5113('0x5d')](_0x588f67,{'fields':_0x8205a1,'raw':!![]});}})[_0x5113('0x20')](handleEntityNotFound(_0x3fd817,null))[_0x5113('0x20')](function(_0x440700){_0x6378c2[_0x5113('0xa8')]=_0x440700;var _0x5e275a=_0x2057a5[_0x5113('0x5e')][_0x5113('0xa9')];if(_0x2057a5[_0x5113('0x8d')]['cf-connecting-ip']){_0x5e275a=_0x2057a5['headers'][_0x5113('0xaa')];}else if(_0x2057a5[_0x5113('0x8d')][_0x5113('0xab')]){_0x5e275a=_['first'](_0x2057a5[_0x5113('0x8d')][_0x5113('0xab')][_0x5113('0xac')](','));}if(_0x440700){var _0x38f342={'ContactId':_0x440700['id'],'ChatWebsiteId':_0x2057a5[_0x5113('0x66')]['id'],'from':(_0x440700[_0x5113('0xad')]||'')+'\x20'+(_0x440700['lastName']||''),'customerIp':_0x5e275a,'customerPort':_0x2057a5[_0x5113('0x8d')][_0x5113('0xae')]?_0x2057a5[_0x5113('0x8d')][_0x5113('0xae')]:null,'referer':_0x2057a5[_0x5113('0x5e')][_0x5113('0xaf')],'browserName':_0xdd6e96['browser'][_0x5113('0x3b')]&&_0xdd6e96[_0x5113('0xb0')][_0x5113('0xb1')]?util[_0x5113('0xb2')](_0x5113('0xb3'),_0xdd6e96[_0x5113('0xb0')][_0x5113('0x3b')],_0xdd6e96[_0x5113('0xb0')][_0x5113('0xb1')]):_0x5113('0xb4'),'browserVersion':_0xdd6e96[_0x5113('0xb0')][_0x5113('0xb1')]||_0x5113('0xb4'),'osName':util[_0x5113('0xb2')](_0x5113('0xb3'),_0xdd6e96['os'][_0x5113('0x3b')],_0xdd6e96['os']['version']),'osVersion':_0xdd6e96['os'][_0x5113('0xb1')],'deviceModel':_0xdd6e96['device'][_0x5113('0x43')]&&_0xdd6e96[_0x5113('0xb5')][_0x5113('0xb6')]?util[_0x5113('0xb2')](_0x5113('0xb7'),_0xdd6e96[_0x5113('0xb5')][_0x5113('0x43')],_0xdd6e96[_0x5113('0xb5')]['vendor'],_0xdd6e96[_0x5113('0xb5')][_0x5113('0x51')]):null,'deviceVendor':_0xdd6e96[_0x5113('0xb5')][_0x5113('0xb6')],'deviceType':_0xdd6e96[_0x5113('0xb5')]['type'],'formData':JSON['stringify'](_0x2057a5['body'])};var _0x1f8a50={'ChatWebsiteId':_0x2057a5['params']['id'],'closed':![]};if(_0x2057a5[_0x5113('0x5e')]['threadId']){_0x1f8a50['threadId']=_0x2057a5['body'][_0x5113('0xb8')];return db[_0x5113('0xb9')][_0x5113('0x5c')]({'where':_0x1f8a50})[_0x5113('0x20')](function(_0x3ef676){if(_0x3ef676){return[_0x3ef676,![]];}_0x38f342[_0x5113('0xb8')]=_0x2057a5['body']['threadId'];_0x38f342[_0x5113('0xba')]=_0x2057a5['body']['externalUrl'];return db[_0x5113('0xb9')][_0x5113('0x5d')](_0x38f342)[_0x5113('0x20')](function(_0x5209c9){return[_0x5209c9,!![]];});});}_0x1f8a50[_0x5113('0xbb')]=_0x440700['id'];if(_0x2057a5[_0x5113('0x5e')][_0x5113('0xbc')]&&_0x2057a5[_0x5113('0x5e')][_0x5113('0xbc')]['id']){_0x1f8a50['id']=_0x2057a5[_0x5113('0x5e')][_0x5113('0xbc')]['id'];return db[_0x5113('0xb9')]['find']({'where':_0x1f8a50})[_0x5113('0x20')](function(_0x1d87e0){if(_0x1d87e0){return[_0x1d87e0,![]];}return db[_0x5113('0xb9')][_0x5113('0x5d')](_0x38f342)[_0x5113('0x20')](function(_0x1ba1a7){return[_0x1ba1a7,!![]];});});}return db[_0x5113('0xb9')][_0x5113('0x5d')](_0x38f342)[_0x5113('0x20')](function(_0x482cdb){return[_0x482cdb,!![]];});}})[_0x5113('0xbd')](function(_0x5934b9,_0x124cbf){if(_0x5934b9){_0x46b07c=_0x124cbf;if(!_0x124cbf){var _0x45a401={'from':(_0x6378c2[_0x5113('0xa8')][_0x5113('0xad')]||'')+'\x20'+(_0x6378c2['contact'][_0x5113('0xbe')]||'')};if(_0x2057a5['body'][_0x5113('0xb8')]&&_0x2057a5[_0x5113('0x5e')][_0x5113('0xbf')]&&_0x2057a5[_0x5113('0x5e')]['threadId']!=_0x2057a5[_0x5113('0x5e')]['messageId']){_0x45a401[_0x5113('0xb8')]=_0x2057a5[_0x5113('0x5e')][_0x5113('0xbf')];}return _0x5934b9[_0x5113('0x65')](_0x45a401);}else{return _0x5934b9;}}})[_0x5113('0x20')](function(_0x17f7db){_0x6378c2[_0x5113('0xbc')]=_0x17f7db[_0x5113('0x37')]({'plain':!![]});_0x6378c2[_0x5113('0xbc')][_0x5113('0xc0')]=_0x46b07c;if(_0x6378c2['interaction'][_0x5113('0xc0')]){if(_0x6378c2['account'][_0x5113('0xc1')]){_0x6378c2['applications'][_0x5113('0xc2')]({'id':0x0,'priority':_0x6378c2['applications']['length']+0x1,'app':'close','appdata':_0x5113('0xc3'),'interval':_0x5113('0xc4')});}}return db['ChatMessage'][_0x5113('0x5d')]({'body':_0x2057a5['body']['body'],'ChatWebsiteId':_0x2057a5[_0x5113('0x66')]['id'],'ChatInteractionId':_0x17f7db['id'],'direction':'in','ContactId':_0x6378c2['contact']['id'],'AttachmentId':_0x2057a5[_0x5113('0x5e')]['AttachmentId']});})[_0x5113('0x20')](function(_0x479cf7){_0x6378c2[_0x5113('0x28')]=_0x479cf7;if(_0x6378c2[_0x5113('0xbc')][_0x5113('0xc5')]){return db[_0x5113('0xc6')][_0x5113('0x5c')]({'attributes':['id',_0x5113('0x3b')],'where':{'id':_0x6378c2['interaction'][_0x5113('0xc5')]}})[_0x5113('0x20')](function(_0x2db30b){if(_0x2db30b){_0x6378c2[_0x5113('0xa1')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5113('0xc7'),'appdata':_0x2db30b[_0x5113('0x3b')]+','+(_0x6378c2[_0x5113('0xa0')][_0x5113('0xc8')]||0xa),'interval':_0x5113('0xc4')});_0x6378c2[_0x5113('0xc9')]=!![];}return respondWithRpcPromise(_0x5113('0xca'),_0x5113('0xcb'),_0x6378c2);});}return respondWithRpcPromise(_0x5113('0xca'),_0x5113('0xcb'),_0x6378c2);})[_0x5113('0x20')](function(_0x36c643){respondWithRpcPromise(_0x5113('0xcc'),_0x5113('0xcc'),{'event':_0x5113('0x8b'),'message':_0x36c643},client9002);return _0x36c643;})['then'](respondWithResult(_0x3fd817,null))[_0x5113('0x2a')](handleError(_0x3fd817,null));};exports[_0x5113('0xcd')]=function(_0x51da31,_0x4820ff,_0x38ceb6){var _0x59f708,_0x253936,_0x9a9b49;var _0x10a8f1=[];var _0x9d5332=[];var _0x53f3ee={};var _0x172afe=_0x51da31[_0x5113('0xce')]||[];var _0x260a56=[];var _0x19ece1;return db['CmContact'][_0x5113('0x67')]()[_0x5113('0x20')](function(_0x428f5c){if(!_0x428f5c){throw new db['Sequelize'][(_0x5113('0x91'))]('no\x20available\x20attributes');}_0x9d5332=_[_0x5113('0x93')](_[_0x5113('0x5a')](_0x428f5c),[_0x5113('0xcf'),'updatedAt']);_0x10a8f1=_[_0x5113('0x93')](_[_0x5113('0x5a')](_0x428f5c),[_0x5113('0xcf'),_0x5113('0x94'),_0x5113('0x95'),_0x5113('0x96')]);if(_0x51da31[_0x5113('0x5e')]['id']){delete _0x51da31['body']['id'];}if(_[_0x5113('0x81')](_0x51da31[_0x5113('0x5e')][_0x5113('0x97')])){throw _0x4820ff['status'](0x1f4)['send'](new db[(_0x5113('0x90'))][(_0x5113('0x91'))](_0x5113('0xd0')));}if(_[_0x5113('0x81')](_0x51da31[_0x5113('0x5e')]['body'])||_0x51da31['body'][_0x5113('0x5e')]===''){throw _0x4820ff['status'](0x1f4)[_0x5113('0xd1')](new db[(_0x5113('0x90'))][(_0x5113('0x91'))](_0x5113('0x98')));}if(_[_0x5113('0x81')](_0x51da31[_0x5113('0x5e')][_0x5113('0xd2')])){throw _0x4820ff['status'](0x1f4)[_0x5113('0xd1')](new db['Sequelize'][(_0x5113('0x91'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10a8f1));}if(!_[_0x5113('0xd3')](_0x10a8f1,_0x51da31[_0x5113('0x5e')][_0x5113('0xd2')])){throw _0x4820ff[_0x5113('0x2d')](0x1f4)[_0x5113('0xd1')](new db[(_0x5113('0x90'))][(_0x5113('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10a8f1));}_0x53f3ee[_0x51da31[_0x5113('0x5e')][_0x5113('0xd2')]]=_0x51da31[_0x5113('0x5e')][_0x5113('0x97')];})[_0x5113('0x20')](function(){return db['ChatWebsite'][_0x5113('0x5c')]({'where':{'id':_0x51da31[_0x5113('0x66')]['id']},'include':[{'model':db[_0x5113('0x9a')],'as':_0x5113('0x9b')},{'model':db[_0x5113('0xd4')],'as':_0x5113('0xd4')}]});})['then'](handleEntityNotFound(_0x4820ff,null))[_0x5113('0x20')](function(_0xf580fd){if(_0xf580fd&&_0xf580fd['List']){_0x253936=_0xf580fd;var _0x131f30=_['defaults'](_0x51da31[_0x5113('0x5e')],{'firstName':_0x51da31[_0x5113('0x5e')]['from'],'phone':_0x51da31[_0x5113('0x5e')][_0x5113('0x97')],'ListId':_0xf580fd[_0x5113('0x96')]});_0x131f30[_0x51da31['body'][_0x5113('0xd2')]]=_0x51da31['body'][_0x5113('0x97')];return db[_0x5113('0xa7')][_0x5113('0xd5')]({'where':_0x53f3ee,'defaults':_0x131f30});}})[_0x5113('0xbd')](function(_0x4698ae){if(_0x4698ae){_0x9a9b49=_0x4698ae;var _0x2c7ee7=fs[_0x5113('0xd6')](path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0xd7')),_0x5113('0xd8'));var _0x2d3393=ejs[_0x5113('0xd9')](_0x2c7ee7,{'body':_['toPairs'](_0x51da31[_0x5113('0x5e')][_0x5113('0x5e')]),'bodyTitle':_0x253936[_0x5113('0xda')]});return db[_0x5113('0xdb')]['create']({'body':_0x2d3393,'ContactId':_0x4698ae['id'],'ChatWebsiteId':_0x253936['id']});}})[_0x5113('0x20')](function(_0x411bf1){_0x19ece1=_0x411bf1;if(_0x172afe[_0x5113('0x4a')]){var _0x459838=_0x172afe[_0x5113('0x44')](function(_0x129a0a){return{'name':_0x129a0a['originalname'],'basename':_0x129a0a['filename'],'type':_0x129a0a[_0x5113('0xdc')],'ChatOfflineMessageId':_0x411bf1['id']};});_0x260a56=_0x459838[_0x5113('0x44')](_0x5c22ec=>{var _0x3dce2c={'filename':_0x5c22ec[_0x5113('0x3b')],'path':path[_0x5113('0x7c')](config['root'],_0x5113('0xdd'),_0x5113('0xce'),_0x5113('0xde'),'offline-chat',_0x5c22ec[_0x5113('0xdf')])};return _0x3dce2c;});if(!_0x253936[_0x5113('0xe0')]){return db['sequelize'][_0x5113('0xe1')](function(_0x429ea1){return db[_0x5113('0xe2')][_0x5113('0xe3')](_0x459838,{'transaction':_0x429ea1});});}}})['then'](function(){if(_0x19ece1){_0x59f708=_0x19ece1;return db['MailAccount'][_0x5113('0x6a')]({'where':{'active':!![]},'include':[{'model':db[_0x5113('0xe4')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x186b77){if(_0x186b77&&_0x186b77[_0x5113('0xe5')]&&_0x253936[_0x5113('0xe6')]&&_0x253936['forwardOfflineAddress']){var _0x3f513d={'tls':{'rejectUnauthorized':![]}};if(_0x186b77[_0x5113('0xe5')][_0x5113('0xe7')]){_0x3f513d[_0x5113('0xe7')]=_0x186b77[_0x5113('0xe5')]['service'];}else{_0x3f513d['host']=_0x186b77[_0x5113('0xe5')][_0x5113('0xe8')];_0x3f513d[_0x5113('0xe9')]=_0x186b77[_0x5113('0xe5')]['port'];_0x3f513d[_0x5113('0xea')]=_0x186b77['Smtp'][_0x5113('0xea')];}if(_0x186b77[_0x5113('0xe5')][_0x5113('0xeb')]){_0x3f513d[_0x5113('0xec')]={'user':_0x186b77[_0x5113('0xe5')]['user'],'pass':_0x186b77[_0x5113('0xe5')][_0x5113('0xed')]};}return respondWithRpcPromise('SendMail',_0x5113('0xee'),{'account':_0x3f513d,'message':{'from':util[_0x5113('0xb2')](_0x5113('0xef'),_0x186b77[_0x5113('0x3b')],_0x186b77[_0x5113('0xf0')]||_0x186b77[_0x5113('0xe5')][_0x5113('0x61')]),'to':_0x253936[_0x5113('0xf1')],'subject':_0x253936[_0x5113('0xf2')],'html':_0x59f708['body'],'attachments':_0x260a56}},client9003)[_0x5113('0x20')](function(){return _0x59f708;})[_0x5113('0x2a')](function(_0x211961){console[_0x5113('0x26')](_0x211961);});}})[_0x5113('0x20')](function(){if(_0x253936&&_0x253936[_0x5113('0xe0')]&&_0x253936[_0x5113('0xf3')]){var _0x11d9ba=[];if(_0x172afe[_0x5113('0x4a')]){_0x11d9ba=_0x172afe[_0x5113('0x44')](function(_0x58c155){return{'name':_0x58c155[_0x5113('0xf4')],'basename':_0x58c155['filename'],'type':_0x58c155[_0x5113('0xdc')],'ChatOfflineMessageId':_0x19ece1['id']};});}var _0xbecd33;if(!_[_0x5113('0x81')](_0x253936[_0x5113('0xf5')])){var _0x315d5d=_[_0x5113('0x44')](_0x51da31[_0x5113('0x5e')],function(_0xd3ac96){return _0xd3ac96;});var _0x5e39aa=_[_0x5113('0xf6')](_0x315d5d)[0x0];var _0x4aa116=_[_0x5113('0xf7')](_0x5e39aa,function(_0x445fe1){return _0x445fe1;});_0xbecd33=_0x4aa116[0x1][_0x253936['subjectOffline']];}var _0x58132d={'from':_0x9a9b49[_0x5113('0xf0')],'firstName':_0x9a9b49['firstName'],'lastName':_0x9a9b49[_0x5113('0xbe')],'mapKey':_0x5113('0xf0'),'message':{'from':_0x9a9b49[_0x5113('0xf0')],'to':_0x253936['MailAccount']['email'],'cc':'','subject':_[_0x5113('0x81')](_0xbecd33)?_0x253936[_0x5113('0xf2')]:_0xbecd33,'messageId':'','sentAt':new Date(),'attach':_0x11d9ba['length'],'attachments':_0x11d9ba,'originChannel':_0x5113('0xf8'),'ChatWebsiteId':_0x253936['id'],'ChatOfflineMessageId':_0x59f708['id'],'originTo':_0x253936[_0x5113('0xd4')][_0x5113('0xf0')]},'body':_0x59f708[_0x5113('0x5e')]};var _0xcb198f={'account':{'id':_0x253936[_0x5113('0xf3')]},'body':_0x58132d,'log':_0x5113('0xf9')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0xcb198f,client9001)['then'](function(){return _0x59f708;})[_0x5113('0x2a')](function(_0x39f71a){console[_0x5113('0x26')](_0x39f71a);});}return;})[_0x5113('0x20')](function(){if(_0x59f708){return _0x59f708;}})[_0x5113('0x20')](respondWithResult(_0x4820ff,null))[_0x5113('0x2a')](function(_0x5701e2){console[_0x5113('0x26')](_0x5113('0x2a'),_0x5701e2);for(var _0x5a92b1 of _0x172afe){var _0x8a5770=path[_0x5113('0x7c')](config[_0x5113('0x7d')],'server','files',_0x5113('0xde'),_0x5113('0xfa'),_0x5a92b1[_0x5113('0x76')]);fs_extra[_0x5113('0xfb')](_0x8a5770)[_0x5113('0x2a')](function(_0x16cae3){console[_0x5113('0x26')](_0x5113('0xfc'),_0x8a5770,_0x16cae3);});}});};exports[_0x5113('0xfd')]=function(_0x2a6833,_0x4378cf,_0x455390){return db[_0x5113('0xb9')][_0x5113('0x5c')]({'where':{'id':_0x2a6833[_0x5113('0x66')]['id']}})['then'](handleEntityNotFound(_0x4378cf,null))[_0x5113('0x20')](function(_0x3533ae){if(_0x3533ae){return _0x3533ae['addInteraction'](_0x2a6833[_0x5113('0x5e')]['ids'],_[_0x5113('0xfe')](_0x2a6833[_0x5113('0x5e')],['ids','id'])||{});}})['then'](respondWithResult(_0x4378cf,null))[_0x5113('0x2a')](handleError(_0x4378cf,null));};exports[_0x5113('0xff')]=function(_0x16f526,_0x2798b5,_0x13b27e){var _0x23143e={'raw':![],'where':{}};var _0x169560={};var _0xfd28b3={'count':0x0,'rows':[]};return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0x16f526[_0x5113('0x66')]['id']}})['then'](handleEntityNotFound(_0x2798b5,null))[_0x5113('0x20')](function(_0x5793f4){if(_0x5793f4){_0x169560[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0xb9')][_0x5113('0x40')]);_0x169560['query']=_['keys'](_0x16f526[_0x5113('0x45')]);_0x169560['filters']=_[_0x5113('0x47')](_0x169560['model'],_0x169560['query']);_0x23143e[_0x5113('0x49')]=_[_0x5113('0x47')](_0x169560['model'],qs['fields'](_0x16f526[_0x5113('0x45')][_0x5113('0x48')]));_0x23143e[_0x5113('0x49')]=_0x23143e[_0x5113('0x49')][_0x5113('0x4a')]?_0x23143e[_0x5113('0x49')]:_0x169560[_0x5113('0x43')];if(!_0x16f526[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x23143e['limit']=qs['limit'](_0x16f526[_0x5113('0x45')][_0x5113('0x30')]);_0x23143e[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x16f526[_0x5113('0x45')][_0x5113('0x2f')]);}_0x23143e[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x16f526[_0x5113('0x45')]['sort']);_0x23143e[_0x5113('0x4f')]=qs[_0x5113('0x46')](_[_0x5113('0x50')](_0x16f526['query'],_0x169560['filters']));_0x23143e[_0x5113('0x4f')][_0x5113('0x68')]=_0x5793f4['id'];if(_0x16f526[_0x5113('0x45')][_0x5113('0x53')]){_0x23143e['where']=_['merge'](_0x23143e[_0x5113('0x4f')],{'$or':_['map'](_0x23143e[_0x5113('0x49')],function(_0xd62124){var _0x30bbc5={};_0x30bbc5[_0xd62124]={'$like':'%'+_0x16f526[_0x5113('0x45')][_0x5113('0x53')]+'%'};return _0x30bbc5;})});}_0x23143e=_[_0x5113('0x54')]({},_0x23143e,_0x16f526[_0x5113('0x55')]);return db[_0x5113('0xb9')][_0x5113('0x32')]({'where':_0x23143e[_0x5113('0x4f')]})[_0x5113('0x20')](function(_0x9263d){_0xfd28b3[_0x5113('0x32')]=_0x9263d;if(_0x16f526[_0x5113('0x45')][_0x5113('0x56')]){_0x23143e['include']=[{'model':db['CmContact'],'as':_0x5113('0x100'),'required':![]},{'model':db['User'],'as':_0x5113('0x101'),'attributes':[_0x5113('0x3b'),_0x5113('0x102'),_0x5113('0x103')],'required':![]},{'model':db[_0x5113('0x104')],'as':'Tags','attributes':['id','name','color'],'where':_0x16f526[_0x5113('0x45')][_0x5113('0x105')]?{'id':_0x16f526[_0x5113('0x45')][_0x5113('0x105')]}:undefined,'required':_0x16f526[_0x5113('0x45')][_0x5113('0x105')]?!![]:![]}];}return db[_0x5113('0xb9')][_0x5113('0x57')](_0x23143e);})[_0x5113('0x20')](function(_0x29a367){_0xfd28b3['rows']=_0x29a367;return _0xfd28b3;});}})[_0x5113('0x20')](respondWithFilteredResult(_0x2798b5,_0x23143e))[_0x5113('0x2a')](handleError(_0x2798b5,null));};function iftimePromise(_0x48a09e,_0x282ecf){return respondWithRpcPromise(_0x5113('0x106'),_0x5113('0x107'),{'command':_0x282ecf[_0x5113('0x108')]?util[_0x5113('0xb2')](_0x5113('0x109'),_0x48a09e[_0x5113('0x10a')],_0x282ecf[_0x5113('0x108')]):util[_0x5113('0xb2')](_0x5113('0x10b'),_0x48a09e['interval'])},client9002)[_0x5113('0x20')](function(_0x961396){var _0x430fe8=_0x961396&&_0x961396[_0x5113('0x10c')](_0x5113('0x10d'))>=0x0?!![]:![];logger[_0x5113('0x21')](_0x5113('0x10e'),_0x282ecf['id'],_0x48a09e['id'],_0x48a09e[_0x5113('0x10a')],_0x430fe8?_0x5113('0x10f'):_0x5113('0x110'),_0x282ecf[_0x5113('0x108')]?_0x282ecf[_0x5113('0x108')]:_0x5113('0x111'));return _0x430fe8;})['catch'](function(_0x2a5971){logger[_0x5113('0x26')](_0x5113('0x10e'),_0x282ecf['id'],_0x48a09e['id'],_0x48a09e[_0x5113('0x10a')],util['inspect'](_0x2a5971,{'showHidden':![],'depth':null}),_0x282ecf[_0x5113('0x108')]?_0x282ecf[_0x5113('0x108')]:_0x5113('0x111'));return![];});}exports[_0x5113('0x107')]=function(_0x12833e,_0x3362c4,_0x964f9){var _0x31b8df=0x0;var _0x2881f7=0x0;var _0x56f460=![];var _0x25b6a5;var _0x3bb182;return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x12833e[_0x5113('0x66')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x5113('0x112')],'as':_0x5113('0x113'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3362c4,null))[_0x5113('0x20')](function(_0x1ad718){if(_0x1ad718){_0x25b6a5=_0x1ad718;return _0x1ad718[_0x5113('0x114')]({'raw':!![]});}})[_0x5113('0x20')](function(_0x4dfc96){if(_0x25b6a5){if(_0x4dfc96){_0x3bb182=_0x4dfc96;}}return require(_0x5113('0x17'))[_0x5113('0x7f')]();})[_0x5113('0x20')](function(_0x873844){if(_0x873844){_0x2881f7=_0x873844[_0x5113('0x115')];_0x56f460=_0x873844[_0x5113('0x80')];}})[_0x5113('0x20')](function(){return db[_0x5113('0xb9')][_0x5113('0x32')]({'where':{'closed':![]}});})['then'](function(_0x1bb89d){_0x31b8df=_0x1bb89d;if(_0x2881f7&&_0x1bb89d>_0x2881f7){return db[_0x5113('0x116')][_0x5113('0x6a')]({'where':{'id':0x1}})[_0x5113('0x20')](function(_0x363d68){if(_0x363d68){_0x363d68['increment'](_0x5113('0x117'));}});}})[_0x5113('0x20')](function(){if(_0x25b6a5[_0x5113('0x112')]&&_0x25b6a5[_0x5113('0x112')][_0x5113('0x113')]){var _0x930971=[];for(var _0x4bb103=0x0;_0x4bb103<_0x25b6a5['Interval']['Intervals']['length'];_0x4bb103++){var _0x4bc898=_0x25b6a5[_0x5113('0x112')][_0x5113('0x113')][_0x4bb103][_0x5113('0x37')]({'plain':!![]});_0x930971[_0x5113('0xc2')](iftimePromise(_0x4bc898,_0x25b6a5));}return BPromise[_0x5113('0x118')](_0x930971)[_0x5113('0x20')](function(_0x3f185e){return _[_0x5113('0x119')](_0x3f185e);});}else{return!![];}})[_0x5113('0x20')](function(_0x452497){var _0x5bd475=fs['readFileSync'](path[_0x5113('0x7c')](config['root'],_0x5113('0x11a')),_0x5113('0xd8'));var _0x120e98={'remote':_0x25b6a5['remote'],'query':querystring[_0x5113('0x11b')](_[_0x5113('0x54')](_0x25b6a5['get']({'plain':!![]}),{'customerIp':_0x12833e[_0x5113('0x8d')][_0x5113('0xab')]||_0x12833e[_0x5113('0x8d')]['x-real-ip']||_0x12833e[_0x5113('0x11c')]['remoteAddress']||_0x12833e['ip'],'referer':_0x12833e[_0x5113('0x8d')]['referer'],'openedInteractions':_0x31b8df,'maxInteractions':_0x2881f7,'virtual':_0x56f460[_0x5113('0x115')],'online':_0x452497,'custom':_0x56f460}))['replace'](/'/g,'\x5c\x27')};_0x3362c4[_0x5113('0xd1')](ejs['render'](Mustache['render'](_0x5bd475,_0x120e98),{'proactiveActions':_0x3bb182,'alignment':_0x25b6a5['alignment'],'verticalAlignment':_0x25b6a5[_0x5113('0x11d')],'div_color':_0x25b6a5[_0x5113('0x11e')],'text_color':_0x25b6a5[_0x5113('0x11f')],'button_color':_0x25b6a5['color_button'],'background_color':_0x25b6a5[_0x5113('0x120')]}));})['catch'](handleError(_0x3362c4,null));};exports[_0x5113('0x121')]=function(_0xeeb893,_0x236a94,_0x1aeb45){return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0xeeb893['params']['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x236a94,null))[_0x5113('0x20')](function(_0x4c8f93){if(_0x4c8f93){return db['sequelize'][_0x5113('0xe1')](function(_0x17185a){return db[_0x5113('0x9e')][_0x5113('0x36')]({'where':{'ChatWebsiteId':_0xeeb893[_0x5113('0x66')]['id']},'transaction':_0x17185a})[_0x5113('0x20')](function(_0x48502f){var _0x468bba=_[_0x5113('0x44')](_0xeeb893[_0x5113('0x5e')],function(_0x138228){_0x138228[_0x5113('0x68')]=_0xeeb893[_0x5113('0x66')]['id'];return _0x138228;});return db[_0x5113('0x9e')][_0x5113('0xe3')](_0x468bba,{'transaction':_0x17185a});});})['then'](function(){return db[_0x5113('0x9e')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xeeb893[_0x5113('0x66')]['id']},'order':_0x5113('0xa4')});});}})['then'](respondWithResult(_0x236a94,null))['catch'](handleError(_0x236a94,null));};exports[_0x5113('0x122')]=function(_0x16f0ca,_0x180c66,_0x2485b0){var _0x55b989={};var _0x514869={};var _0x49189f;var _0x142f68;return db['ChatWebsite'][_0x5113('0x6a')]({'where':{'id':_0x16f0ca[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x180c66,null))[_0x5113('0x20')](function(_0x341ffb){if(_0x341ffb){_0x49189f=_0x341ffb;_0x514869[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0x9e')][_0x5113('0x40')]);_0x514869[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x16f0ca[_0x5113('0x45')]);_0x514869['filters']=_[_0x5113('0x47')](_0x514869['model'],_0x514869['query']);_0x55b989[_0x5113('0x49')]=_[_0x5113('0x47')](_0x514869[_0x5113('0x43')],qs['fields'](_0x16f0ca[_0x5113('0x45')][_0x5113('0x48')]));_0x55b989[_0x5113('0x49')]=_0x55b989['attributes']['length']?_0x55b989[_0x5113('0x49')]:_0x514869[_0x5113('0x43')];_0x55b989[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x16f0ca[_0x5113('0x45')][_0x5113('0x4e')]);_0x55b989['where']=qs['filters'](_[_0x5113('0x50')](_0x16f0ca[_0x5113('0x45')],_0x514869[_0x5113('0x46')]));if(_0x16f0ca['query']['filter']){_0x55b989[_0x5113('0x4f')]=_[_0x5113('0x54')](_0x55b989[_0x5113('0x4f')],{'$or':_[_0x5113('0x44')](_0x55b989[_0x5113('0x49')],function(_0x2b9d3f){var _0x2f72f7={};_0x2f72f7[_0x2b9d3f]={'$like':'%'+_0x16f0ca['query']['filter']+'%'};return _0x2f72f7;})});}_0x55b989=_[_0x5113('0x54')]({},_0x55b989,_0x16f0ca[_0x5113('0x55')]);return _0x49189f[_0x5113('0x122')](_0x55b989);}})[_0x5113('0x20')](function(_0x10e34f){if(_0x10e34f){_0x142f68=_0x10e34f[_0x5113('0x4a')];if(!_0x16f0ca['query'][_0x5113('0x4b')](_0x5113('0x4c'))){_0x55b989[_0x5113('0x30')]=qs[_0x5113('0x30')](_0x16f0ca[_0x5113('0x45')]['limit']);_0x55b989[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x16f0ca[_0x5113('0x45')][_0x5113('0x2f')]);}return _0x49189f[_0x5113('0x122')](_0x55b989);}})[_0x5113('0x20')](function(_0x14b1a2){if(_0x14b1a2){return _0x14b1a2?{'count':_0x142f68,'rows':_0x14b1a2}:null;}})[_0x5113('0x20')](respondWithResult(_0x180c66,null))[_0x5113('0x2a')](handleError(_0x180c66,null));};exports['addProactiveActions']=function(_0x4f3dba,_0x4202d2,_0x3bb468){return db[_0x5113('0x123')]['find']({'where':{'id':_0x4f3dba[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x4202d2,null))['then'](function(_0x383a07){if(_0x383a07){return _0x383a07[_0x5113('0x124')](_0x4f3dba[_0x5113('0x5e')][_0x5113('0x6d')],_[_0x5113('0xfe')](_0x4f3dba[_0x5113('0x5e')],[_0x5113('0x6d'),'id'])||{});}})[_0x5113('0x20')](respondWithResult(_0x4202d2,null))[_0x5113('0x2a')](handleError(_0x4202d2,null));};exports[_0x5113('0x114')]=function(_0x140d27,_0x2ac9cb,_0x1309cd){var _0x450e54={};var _0x20b184={};var _0x3de14a;var _0x8291af;return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0x140d27[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x2ac9cb,null))['then'](function(_0x45eb5e){if(_0x45eb5e){_0x3de14a=_0x45eb5e;_0x20b184['model']=_[_0x5113('0x5a')](db[_0x5113('0x125')][_0x5113('0x40')]);_0x20b184[_0x5113('0x45')]=_['keys'](_0x140d27['query']);_0x20b184[_0x5113('0x46')]=_[_0x5113('0x47')](_0x20b184['model'],_0x20b184['query']);_0x450e54[_0x5113('0x49')]=_['intersection'](_0x20b184[_0x5113('0x43')],qs[_0x5113('0x48')](_0x140d27[_0x5113('0x45')][_0x5113('0x48')]));_0x450e54['attributes']=_0x450e54[_0x5113('0x49')][_0x5113('0x4a')]?_0x450e54[_0x5113('0x49')]:_0x20b184[_0x5113('0x43')];_0x450e54[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x140d27['query']['sort']);_0x450e54[_0x5113('0x4f')]=qs['filters'](_[_0x5113('0x50')](_0x140d27[_0x5113('0x45')],_0x20b184[_0x5113('0x46')]));if(_0x140d27[_0x5113('0x45')][_0x5113('0x53')]){_0x450e54[_0x5113('0x4f')]=_[_0x5113('0x54')](_0x450e54[_0x5113('0x4f')],{'$or':_[_0x5113('0x44')](_0x450e54['attributes'],function(_0x3566e1){var _0x598298={};_0x598298[_0x3566e1]={'$like':'%'+_0x140d27[_0x5113('0x45')][_0x5113('0x53')]+'%'};return _0x598298;})});}_0x450e54=_[_0x5113('0x54')]({},_0x450e54,_0x140d27['options']);return _0x3de14a[_0x5113('0x114')](_0x450e54);}})[_0x5113('0x20')](function(_0x4fce0a){if(_0x4fce0a){_0x8291af=_0x4fce0a[_0x5113('0x4a')];if(!_0x140d27[_0x5113('0x45')]['hasOwnProperty'](_0x5113('0x4c'))){_0x450e54['limit']=qs[_0x5113('0x30')](_0x140d27['query'][_0x5113('0x30')]);_0x450e54[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x140d27[_0x5113('0x45')][_0x5113('0x2f')]);}return _0x3de14a[_0x5113('0x114')](_0x450e54);}})[_0x5113('0x20')](function(_0x2e4be5){if(_0x2e4be5){return _0x2e4be5?{'count':_0x8291af,'rows':_0x2e4be5}:null;}})[_0x5113('0x20')](respondWithResult(_0x2ac9cb,null))[_0x5113('0x2a')](handleError(_0x2ac9cb,null));};exports['getFields']=function(_0x19256c,_0x4c5c4a,_0x8cf91d){var _0x2aea90=_0x19256c[_0x5113('0x45')]['online']===_0x5113('0x126')?'offlineForm':_0x5113('0x127');return db['ChatWebsite'][_0x5113('0x5c')]({'attributes':['id',_0x2aea90],'where':{'id':_0x19256c[_0x5113('0x66')]['id']}})['then'](handleEntityNotFound(_0x4c5c4a,null))[_0x5113('0x20')](function(_0x2dc847){if(_0x2dc847){var _0x17f277=_0x2dc847[_0x2aea90];var _0x22a8b0=_0x17f277&&_0x17f277[_0x5113('0x128')]?_0x17f277['items']:[];_0x4c5c4a[_0x5113('0xd1')]({'fromKey':_['isNil'](_0x17f277[_0x5113('0x129')])?undefined:_0x17f277[_0x5113('0x129')],'count':_0x22a8b0['length'],'rows':_0x22a8b0});}})[_0x5113('0x2a')](handleError(_0x4c5c4a,null));};exports[_0x5113('0x12a')]=function(_0x3de431,_0x422cb9,_0xb5f24c){var _0x15426b={'raw':![],'where':{}};var _0x485f84={};var _0x22e72e={'count':0x0,'rows':[]};return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0x3de431[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x422cb9,null))[_0x5113('0x20')](function(_0x78166f){if(_0x78166f){_0x485f84[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0xdb')][_0x5113('0x40')]);_0x485f84[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x3de431[_0x5113('0x45')]);_0x485f84[_0x5113('0x46')]=_[_0x5113('0x47')](_0x485f84[_0x5113('0x43')],_0x485f84[_0x5113('0x45')]);_0x15426b[_0x5113('0x49')]=_[_0x5113('0x47')](_0x485f84[_0x5113('0x43')],qs['fields'](_0x3de431[_0x5113('0x45')][_0x5113('0x48')]));_0x15426b[_0x5113('0x49')]=_0x15426b[_0x5113('0x49')]['length']?_0x15426b['attributes']:_0x485f84[_0x5113('0x43')];if(!_0x3de431[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x15426b[_0x5113('0x30')]=qs['limit'](_0x3de431[_0x5113('0x45')][_0x5113('0x30')]);_0x15426b[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x3de431[_0x5113('0x45')][_0x5113('0x2f')]);}_0x15426b[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x3de431['query'][_0x5113('0x4e')]);_0x15426b[_0x5113('0x4f')]=qs[_0x5113('0x46')](_[_0x5113('0x50')](_0x3de431['query'],_0x485f84[_0x5113('0x46')]));_0x15426b[_0x5113('0x4f')]['ChatWebsiteId']=_0x78166f['id'];if(_0x3de431[_0x5113('0x45')]['filter']){_0x15426b[_0x5113('0x4f')]=_[_0x5113('0x54')](_0x15426b[_0x5113('0x4f')],{'$or':_[_0x5113('0x44')](_0x15426b[_0x5113('0x49')],function(_0x5c0e9a){var _0x431ff2={};_0x431ff2[_0x5c0e9a]={'$like':'%'+_0x3de431[_0x5113('0x45')]['filter']+'%'};return _0x431ff2;})});}_0x15426b=_['merge']({},_0x15426b,_0x3de431[_0x5113('0x55')]);return db[_0x5113('0xdb')]['count']({'where':_0x15426b[_0x5113('0x4f')]})['then'](function(_0x5414d9){_0x22e72e[_0x5113('0x32')]=_0x5414d9;if(_0x3de431[_0x5113('0x45')]['includeAll']){_0x15426b['include']=[{'all':!![]}];}else{_0x15426b[_0x5113('0x5b')]=[{'model':db[_0x5113('0xa7')],'as':_0x5113('0x100'),'required':![]},{'model':db[_0x5113('0xe2')],'as':_0x5113('0x12b'),'required':![]}];}return db[_0x5113('0xdb')]['findAll'](_0x15426b);})[_0x5113('0x20')](function(_0x593bcb){_0x22e72e['rows']=_0x593bcb;return _0x22e72e;});}})[_0x5113('0x20')](respondWithFilteredResult(_0x422cb9,_0x15426b))[_0x5113('0x2a')](handleError(_0x422cb9,null));};exports[_0x5113('0x12c')]=function(_0x5f1954,_0x25faae,_0x1d359c){return db[_0x5113('0x3f')]['find']({'where':{'id':_0x5f1954[_0x5113('0x66')]['id']}})['then'](handleEntityNotFound(_0x25faae,null))[_0x5113('0x20')](function(_0x23ea5d){if(_0x23ea5d){return _0x23ea5d[_0x5113('0x12c')](_0x5f1954[_0x5113('0x5e')][_0x5113('0x6d')],_[_0x5113('0xfe')](_0x5f1954[_0x5113('0x5e')],[_0x5113('0x6d'),'id'])||{})[_0x5113('0xbd')](function(_0x33cc6c){for(var _0x583e43=0x0;_0x583e43<_0x5f1954[_0x5113('0x5e')][_0x5113('0x6d')][_0x5113('0x4a')];_0x583e43+=0x1){socket[_0x5113('0x12d')](_0x5113('0x12e'),{'UserId':Number(_0x5f1954[_0x5113('0x5e')][_0x5113('0x6d')][_0x583e43]),'ChatWebsiteId':Number(_0x5f1954[_0x5113('0x66')]['id'])});}return _0x33cc6c;});}})[_0x5113('0x20')](respondWithResult(_0x25faae,null))[_0x5113('0x2a')](handleError(_0x25faae,null));};exports[_0x5113('0x12f')]=function(_0x458cf2,_0x3aede0,_0x3cf7c5){return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x458cf2['params']['id']}})['then'](handleEntityNotFound(_0x3aede0,null))['then'](function(_0x48a938){if(_0x48a938){return _0x48a938[_0x5113('0x12f')](_0x458cf2[_0x5113('0x45')][_0x5113('0x6d')])[_0x5113('0x20')](function(){if(_[_0x5113('0x130')](_0x458cf2[_0x5113('0x45')][_0x5113('0x6d')])){for(var _0x59ce3f=0x0;_0x59ce3f<_0x458cf2[_0x5113('0x45')][_0x5113('0x6d')][_0x5113('0x4a')];_0x59ce3f+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x458cf2[_0x5113('0x45')][_0x5113('0x6d')][_0x59ce3f]),'ChatWebsiteId':Number(_0x458cf2[_0x5113('0x66')]['id'])});}}else{socket['emit'](_0x5113('0x131'),{'UserId':Number(_0x458cf2[_0x5113('0x45')]['ids']),'ChatWebsiteId':Number(_0x458cf2[_0x5113('0x66')]['id'])});}});}})[_0x5113('0x20')](respondWithStatusCode(_0x3aede0,null))[_0x5113('0x2a')](handleError(_0x3aede0,null));};exports['getAgents']=function(_0x29e794,_0x251e4d,_0x57947c){var _0x57d908={};var _0xe630fe={};var _0x2cbc92;var _0x301a64;return db[_0x5113('0x3f')]['findOne']({'where':{'id':_0x29e794[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x251e4d,null))[_0x5113('0x20')](function(_0x56c9e4){if(_0x56c9e4){_0x2cbc92=_0x56c9e4;_0xe630fe[_0x5113('0x43')]=_[_0x5113('0x5a')](db['User'][_0x5113('0x40')]);_0xe630fe[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x29e794['query']);_0xe630fe['filters']=_['intersection'](_0xe630fe['model'],_0xe630fe['query']);_0x57d908[_0x5113('0x49')]=_[_0x5113('0x47')](_0xe630fe[_0x5113('0x43')],qs[_0x5113('0x48')](_0x29e794[_0x5113('0x45')]['fields']));_0x57d908[_0x5113('0x49')]=_0x57d908['attributes'][_0x5113('0x4a')]?_0x57d908[_0x5113('0x49')]:_0xe630fe[_0x5113('0x43')];_0x57d908[_0x5113('0x4d')]=qs['sort'](_0x29e794['query']['sort']);_0x57d908[_0x5113('0x4f')]=qs['filters'](_['pick'](_0x29e794['query'],_0xe630fe[_0x5113('0x46')]));if(_0x29e794[_0x5113('0x45')][_0x5113('0x53')]){_0x57d908['where']=_[_0x5113('0x54')](_0x57d908[_0x5113('0x4f')],{'$or':_[_0x5113('0x44')](_0x57d908['attributes'],function(_0x4f91e7){var _0x36f3bb={};_0x36f3bb[_0x4f91e7]={'$like':'%'+_0x29e794[_0x5113('0x45')][_0x5113('0x53')]+'%'};return _0x36f3bb;})});}_0x57d908=_['merge']({},_0x57d908,_0x29e794['options']);return _0x2cbc92[_0x5113('0x132')](_0x57d908);}})[_0x5113('0x20')](function(_0x1ddf23){if(_0x1ddf23){_0x301a64=_0x1ddf23[_0x5113('0x4a')];if(!_0x29e794[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x57d908[_0x5113('0x30')]=qs['limit'](_0x29e794['query']['limit']);_0x57d908[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x29e794[_0x5113('0x45')][_0x5113('0x2f')]);}return _0x2cbc92[_0x5113('0x132')](_0x57d908);}})['then'](function(_0x51c9eb){if(_0x51c9eb){return _0x51c9eb?{'count':_0x301a64,'rows':_0x51c9eb}:null;}})[_0x5113('0x20')](respondWithResult(_0x251e4d,null))['catch'](handleError(_0x251e4d,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index d7f72bd..3eaeace 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 _0x5301=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hook'];(function(_0x1a27f3,_0x1c082d){var _0x3ce222=function(_0x3f93e1){while(--_0x3f93e1){_0x1a27f3['push'](_0x1a27f3['shift']());}};_0x3ce222(++_0x1c082d);}(_0x5301,0x157));var _0x1530=function(_0x1a0f8c,_0xc70292){_0x1a0f8c=_0x1a0f8c-0x0;var _0xb3b223=_0x5301[_0x1a0f8c];return _0xb3b223;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x1530('0x0'))['db'][_0x1530('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1530('0x2')](0x0);var events={'afterCreate':_0x1530('0x3'),'afterUpdate':_0x1530('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1fa680){return function(_0x639c58,_0x134a01,_0xf2bc70){ChatWebsiteEvents['emit'](_0x1fa680+':'+_0x639c58['id'],_0x639c58);ChatWebsiteEvents[_0x1530('0x5')](_0x1fa680,_0x639c58);_0xf2bc70(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x1530('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x8255=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x596a97,_0x3ae7cf){var _0x1dfbfc=function(_0x5a2c1e){while(--_0x5a2c1e){_0x596a97['push'](_0x596a97['shift']());}};_0x1dfbfc(++_0x3ae7cf);}(_0x8255,0x176));var _0x5825=function(_0x12306d,_0x40c425){_0x12306d=_0x12306d-0x0;var _0x47de4e=_0x8255[_0x12306d];return _0x47de4e;};'use strict';var EventEmitter=require(_0x5825('0x0'));var ChatWebsite=require(_0x5825('0x1'))['db'][_0x5825('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5825('0x3')](0x0);var events={'afterCreate':_0x5825('0x4'),'afterUpdate':_0x5825('0x5'),'afterDestroy':_0x5825('0x6')};function emitEvent(_0x4b18ba){return function(_0x4d1534,_0x5f2bc3,_0x29b5f3){ChatWebsiteEvents[_0x5825('0x7')](_0x4b18ba+':'+_0x4d1534['id'],_0x4d1534);ChatWebsiteEvents[_0x5825('0x7')](_0x4b18ba,_0x4d1534);_0x29b5f3(null);};}for(var e in events){if(events[_0x5825('0x8')](e)){var event=events[e];ChatWebsite[_0x5825('0x9')](e,emitEvent(event));}}module[_0x5825('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index dd1820f..3fb64a0 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 _0x4ad1=['rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x52ae56,_0x3b45dd){var _0x5b5405=function(_0x2d8c43){while(--_0x2d8c43){_0x52ae56['push'](_0x52ae56['shift']());}};_0x5b5405(++_0x3b45dd);}(_0x4ad1,0x199));var _0x14ad=function(_0x34605f,_0xa893e6){_0x34605f=_0x34605f-0x0;var _0x18195d=_0x4ad1[_0x34605f];return _0x18195d;};'use strict';var _=require(_0x14ad('0x0'));var util=require(_0x14ad('0x1'));var logger=require(_0x14ad('0x2'))('api');var moment=require(_0x14ad('0x3'));var BPromise=require(_0x14ad('0x4'));var rp=require(_0x14ad('0x5'));var fs=require('fs');var path=require(_0x14ad('0x6'));var rimraf=require(_0x14ad('0x7'));var config=require('../../config/environment');var attributes=require(_0x14ad('0x8'));module[_0x14ad('0x9')]=function(_0x54d7c8,_0x51898d){return _0x54d7c8[_0x14ad('0xa')](_0x14ad('0xb'),attributes,{'tableName':_0x14ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc21=['ChatWebsite','chat_websites','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x9ff997,_0x2b470d){var _0x92abc9=function(_0x309487){while(--_0x309487){_0x9ff997['push'](_0x9ff997['shift']());}};_0x92abc9(++_0x2b470d);}(_0xbc21,0xd2));var _0x1bc2=function(_0x5eb264,_0x37398d){_0x5eb264=_0x5eb264-0x0;var _0x2fd477=_0xbc21[_0x5eb264];return _0x2fd477;};'use strict';var _=require(_0x1bc2('0x0'));var util=require(_0x1bc2('0x1'));var logger=require('../../config/logger')(_0x1bc2('0x2'));var moment=require(_0x1bc2('0x3'));var BPromise=require(_0x1bc2('0x4'));var rp=require(_0x1bc2('0x5'));var fs=require('fs');var path=require(_0x1bc2('0x6'));var rimraf=require(_0x1bc2('0x7'));var config=require('../../config/environment');var attributes=require(_0x1bc2('0x8'));module[_0x1bc2('0x9')]=function(_0x33191a,_0x188ff6){return _0x33191a[_0x1bc2('0xa')](_0x1bc2('0xb'),attributes,{'tableName':_0x1bc2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index dd75c3f..6b33112 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 _0x030d=['stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x2dd3c0,_0x46bd46){var _0x42ef87=function(_0x3823a5){while(--_0x3823a5){_0x2dd3c0['push'](_0x2dd3c0['shift']());}};_0x42ef87(++_0x46bd46);}(_0x030d,0x1af));var _0xd030=function(_0x32dbcd,_0x463cd2){_0x32dbcd=_0x32dbcd-0x0;var _0x303818=_0x030d[_0x32dbcd];return _0x303818;};'use strict';var _=require(_0xd030('0x0'));var util=require(_0xd030('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd030('0x2'));var fs=require('fs');var Redis=require(_0xd030('0x3'));var db=require(_0xd030('0x4'))['db'];var utils=require(_0xd030('0x5'));var logger=require(_0xd030('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd030('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd030('0x8')],{'host':_0xd030('0x9'),'port':0x18eb});var socket=require(_0xd030('0xa'))(new Redis(config[_0xd030('0x8')]));require(_0xd030('0xb'))[_0xd030('0xc')](socket);function respondWithRpcPromise(_0x546d32,_0x3cafc8,_0x26331a){return new BPromise(function(_0x5c7186,_0x2136c4){return client[_0xd030('0xd')](_0x546d32,_0x26331a)['then'](function(_0x8c5ba6){logger[_0xd030('0xe')](_0xd030('0xf'),_0x3cafc8,_0xd030('0x10'));logger[_0xd030('0x11')](_0xd030('0x12'),_0x3cafc8,_0xd030('0x10'),JSON[_0xd030('0x13')](_0x8c5ba6));if(_0x8c5ba6[_0xd030('0x14')]){if(_0x8c5ba6[_0xd030('0x14')][_0xd030('0x15')]===0x1f4){logger[_0xd030('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x3cafc8,_0x8c5ba6[_0xd030('0x14')][_0xd030('0x16')]);return _0x2136c4(_0x8c5ba6[_0xd030('0x14')][_0xd030('0x16')]);}logger[_0xd030('0x14')](_0xd030('0xf'),_0x3cafc8,_0x8c5ba6[_0xd030('0x14')]['message']);return _0x5c7186(_0x8c5ba6[_0xd030('0x14')][_0xd030('0x16')]);}else{logger[_0xd030('0xe')](_0xd030('0xf'),_0x3cafc8,'request\x20sent');_0x5c7186(_0x8c5ba6[_0xd030('0x17')]['message']);}})[_0xd030('0x18')](function(_0x15785e){logger[_0xd030('0x14')](_0xd030('0xf'),_0x3cafc8,_0x15785e);_0x2136c4(_0x15785e);});});} \ No newline at end of file +var _0x9d0e=['http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0xb517fb,_0x1ae8bc){var _0x348a16=function(_0x4afe31){while(--_0x4afe31){_0xb517fb['push'](_0xb517fb['shift']());}};_0x348a16(++_0x1ae8bc);}(_0x9d0e,0x155));var _0xe9d0=function(_0x2c9e0d,_0x32ef56){_0x2c9e0d=_0x2c9e0d-0x0;var _0x5dcb5a=_0x9d0e[_0x2c9e0d];return _0x5dcb5a;};'use strict';var _=require(_0xe9d0('0x0'));var util=require('util');var moment=require(_0xe9d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe9d0('0x2'));var fs=require('fs');var Redis=require(_0xe9d0('0x3'));var db=require(_0xe9d0('0x4'))['db'];var utils=require(_0xe9d0('0x5'));var logger=require(_0xe9d0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe9d0('0x7'));var client=jayson[_0xe9d0('0x8')][_0xe9d0('0x9')]({'port':0x232a});config[_0xe9d0('0xa')]=_[_0xe9d0('0xb')](config[_0xe9d0('0xa')],{'host':_0xe9d0('0xc'),'port':0x18eb});var socket=require(_0xe9d0('0xd'))(new Redis(config[_0xe9d0('0xa')]));require(_0xe9d0('0xe'))['register'](socket);function respondWithRpcPromise(_0x51f58e,_0x4ddea1,_0x2a66d7){return new BPromise(function(_0x248ecb,_0x4479d7){return client[_0xe9d0('0xf')](_0x51f58e,_0x2a66d7)[_0xe9d0('0x10')](function(_0x1f5147){logger['info'](_0xe9d0('0x11'),_0x4ddea1,'request\x20sent');logger[_0xe9d0('0x12')](_0xe9d0('0x13'),_0x4ddea1,_0xe9d0('0x14'),JSON['stringify'](_0x1f5147));if(_0x1f5147[_0xe9d0('0x15')]){if(_0x1f5147[_0xe9d0('0x15')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4ddea1,_0x1f5147['error'][_0xe9d0('0x16')]);return _0x4479d7(_0x1f5147[_0xe9d0('0x15')][_0xe9d0('0x16')]);}logger[_0xe9d0('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x4ddea1,_0x1f5147[_0xe9d0('0x15')][_0xe9d0('0x16')]);return _0x248ecb(_0x1f5147[_0xe9d0('0x15')][_0xe9d0('0x16')]);}else{logger[_0xe9d0('0x17')](_0xe9d0('0x11'),_0x4ddea1,_0xe9d0('0x14'));_0x248ecb(_0x1f5147[_0xe9d0('0x18')][_0xe9d0('0x16')]);}})['catch'](function(_0x3ec895){logger['error'](_0xe9d0('0x11'),_0x4ddea1,_0x3ec895);_0x4479d7(_0x3ec895);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 66d2548..1449d30 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 _0x74db=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x335eca,_0x23bee1){var _0x4a9e78=function(_0x5ef1ec){while(--_0x5ef1ec){_0x335eca['push'](_0x335eca['shift']());}};_0x4a9e78(++_0x23bee1);}(_0x74db,0xd8));var _0xb74d=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x74db[_0x4ed4d2];return _0x15ae2e;};'use strict';var ChatWebsiteEvents=require(_0xb74d('0x0'));var events=[_0xb74d('0x1'),_0xb74d('0x2'),_0xb74d('0x3')];function createListener(_0xbad380,_0x478661){return function(_0x1c8b7e){_0x478661[_0xb74d('0x4')](_0xbad380,_0x1c8b7e);};}function removeListener(_0x501388,_0x23cf9e){return function(){ChatWebsiteEvents[_0xb74d('0x5')](_0x501388,_0x23cf9e);};}exports[_0xb74d('0x6')]=function(_0x146b4c){for(var _0x176d6a=0x0,_0x4ccf83=events[_0xb74d('0x7')];_0x176d6a<_0x4ccf83;_0x176d6a++){var _0x370af0=events[_0x176d6a];var _0x583f99=createListener(_0xb74d('0x8')+_0x370af0,_0x146b4c);ChatWebsiteEvents['on'](_0x370af0,_0x583f99);}}; \ No newline at end of file +var _0x9add=['length','chatWebsite:','save','remove','emit','removeListener'];(function(_0x56d9c0,_0x23cac4){var _0x183ba1=function(_0x21fa23){while(--_0x21fa23){_0x56d9c0['push'](_0x56d9c0['shift']());}};_0x183ba1(++_0x23cac4);}(_0x9add,0x134));var _0xd9ad=function(_0x29653a,_0x1b9e25){_0x29653a=_0x29653a-0x0;var _0x3bfd17=_0x9add[_0x29653a];return _0x3bfd17;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd9ad('0x0'),_0xd9ad('0x1'),'update'];function createListener(_0x45a58a,_0x242012){return function(_0x599304){_0x242012[_0xd9ad('0x2')](_0x45a58a,_0x599304);};}function removeListener(_0x6abb81,_0x64ce7b){return function(){ChatWebsiteEvents[_0xd9ad('0x3')](_0x6abb81,_0x64ce7b);};}exports['register']=function(_0x348431){for(var _0x462f3d=0x0,_0x1d57f4=events[_0xd9ad('0x4')];_0x462f3d<_0x1d57f4;_0x462f3d++){var _0x35bc6d=events[_0x462f3d];var _0x8d5ffb=createListener(_0xd9ad('0x5')+_0x35bc6d,_0x348431);ChatWebsiteEvents['on'](_0x35bc6d,_0x8d5ffb);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 456bf54..9a1fdec 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 _0x9d99=['addAnswer','diskStorage','join','root','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','destroy','delete','removeAnswers','removeAgents','exports','util','path','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x9d99,0xed));var _0x99d9=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x9d99[_0x5cb1af];return _0x8d7940;};'use strict';var multer=require('multer');var util=require(_0x99d9('0x0'));var path=require(_0x99d9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x99d9('0x2'));var config=require(_0x99d9('0x3'));var controller=require(_0x99d9('0x4'));router[_0x99d9('0x5')]('/',auth[_0x99d9('0x6')](),controller[_0x99d9('0x7')]);router[_0x99d9('0x5')](_0x99d9('0x8'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x9')]);router[_0x99d9('0x5')](_0x99d9('0xa'),auth[_0x99d9('0x6')](),controller[_0x99d9('0xb')]);router[_0x99d9('0x5')](_0x99d9('0xc'),auth['isAuthenticated'](),controller[_0x99d9('0xd')]);router[_0x99d9('0x5')](_0x99d9('0xe'),auth[_0x99d9('0x6')](),controller['getAnswers']);router[_0x99d9('0x5')](_0x99d9('0xf'),controller[_0x99d9('0x10')]);router['get']('/:id/avatar',controller[_0x99d9('0x11')]);router[_0x99d9('0x5')](_0x99d9('0x12'),controller['getCustomerAvatar']);router[_0x99d9('0x5')](_0x99d9('0x13'),controller[_0x99d9('0x14')]);router[_0x99d9('0x5')](_0x99d9('0x15'),auth['isAuthenticated'](),controller[_0x99d9('0x16')]);router[_0x99d9('0x5')](_0x99d9('0x17'),controller[_0x99d9('0x18')]);router[_0x99d9('0x5')](_0x99d9('0x19'),auth[_0x99d9('0x6')](),controller['getApplications']);router[_0x99d9('0x5')]('/:id/proactive_actions',auth[_0x99d9('0x6')](),controller[_0x99d9('0x1a')]);router['get'](_0x99d9('0x1b'),controller['getFields']);router[_0x99d9('0x5')](_0x99d9('0x1c'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x1d')]);router['get'](_0x99d9('0x1e'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x1f')]);router['post']('/',auth[_0x99d9('0x6')](),controller[_0x99d9('0x20')]);router[_0x99d9('0x21')](_0x99d9('0xc'),auth['isAuthenticated'](),controller[_0x99d9('0x22')]);router[_0x99d9('0x21')](_0x99d9('0xe'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x23')]);var upload=multer({'storage':multer[_0x99d9('0x24')]({'destination':function(_0x4c54fe,_0x17246b,_0x42588d){_0x42588d(null,path[_0x99d9('0x25')](config[_0x99d9('0x26')],'server/files/images/logos/'));},'filename':function(_0x1622eb,_0x3867ad,_0x2e04cb){_0x2e04cb(null,util[_0x99d9('0x27')](_0x99d9('0x28'),Date['now'](),_0x3867ad[_0x99d9('0x29')]));}})});router[_0x99d9('0x21')]('/:id/logo',upload[_0x99d9('0x2a')](_0x99d9('0x2b')),controller[_0x99d9('0x2c')]);var upload=multer({'storage':multer[_0x99d9('0x24')]({'destination':function(_0x550071,_0x3e4465,_0x5afb12){_0x5afb12(null,path[_0x99d9('0x25')](config[_0x99d9('0x26')],_0x99d9('0x2d')));},'filename':function(_0x1c4052,_0x5d2922,_0x20117c){_0x20117c(null,util[_0x99d9('0x27')](_0x99d9('0x28'),Date[_0x99d9('0x2e')](),_0x5d2922[_0x99d9('0x29')]));}})});router['post'](_0x99d9('0x2f'),upload[_0x99d9('0x2a')](_0x99d9('0x2b')),controller[_0x99d9('0x30')]);var upload=multer({'storage':multer[_0x99d9('0x24')]({'destination':function(_0x3e9435,_0x5763ed,_0x55782d){_0x55782d(null,path[_0x99d9('0x25')](config['root'],_0x99d9('0x2d')));},'filename':function(_0x5c9608,_0x136d32,_0x5db3c3){_0x5db3c3(null,util['format']('%s-%s',Date['now'](),_0x136d32[_0x99d9('0x29')]));}})});router[_0x99d9('0x21')](_0x99d9('0x12'),upload['single'](_0x99d9('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dd357,_0x364d01,_0x4b4390){_0x4b4390(null,path[_0x99d9('0x25')](config[_0x99d9('0x26')],_0x99d9('0x2d')));},'filename':function(_0x32665e,_0x2404c3,_0x5a9554){_0x5a9554(null,util[_0x99d9('0x27')](_0x99d9('0x28'),Date[_0x99d9('0x2e')](),_0x2404c3['originalname']));}})});router['post']('/:id/system_avatar',upload[_0x99d9('0x2a')](_0x99d9('0x2b')),controller[_0x99d9('0x31')]);router[_0x99d9('0x21')](_0x99d9('0x32'),controller[_0x99d9('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2934a6,_0x499e21,_0x51001c){const _0x1e7883=path[_0x99d9('0x25')](config[_0x99d9('0x26')],_0x99d9('0x34'),'attachments','offline-chat');fs_extra[_0x99d9('0x35')](_0x1e7883,function(){_0x51001c(null,_0x1e7883);});},'filename':function(_0x3a8093,_0x27adbf,_0x449589){const _0x5849a6=_0x27adbf[_0x99d9('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x37a7bd=path['extname'](_0x5849a6);const _0x45bbe5=Date['now']()+'-'+_0x5849a6[_0x99d9('0x36')](_0x37a7bd,'')+_0x37a7bd;_0x449589(null,_0x45bbe5);}})});router[_0x99d9('0x21')](_0x99d9('0x37'),offlineUploadMulter[_0x99d9('0x38')](),controller[_0x99d9('0x39')]);router[_0x99d9('0x21')](_0x99d9('0x15'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x3a')]);router[_0x99d9('0x21')]('/:id/applications',auth[_0x99d9('0x6')](),controller[_0x99d9('0x3b')]);router['post']('/:id/proactive_actions',auth[_0x99d9('0x6')](),controller[_0x99d9('0x3c')]);router[_0x99d9('0x21')]('/:id/users',auth[_0x99d9('0x6')](),controller[_0x99d9('0x3d')]);router['put']('/:id',auth[_0x99d9('0x6')](),controller[_0x99d9('0x3e')]);router['delete'](_0x99d9('0xa'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x3f')]);router[_0x99d9('0x40')](_0x99d9('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x99d9('0x6')](),controller[_0x99d9('0x41')]);router[_0x99d9('0x40')](_0x99d9('0x1e'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x42')]);module[_0x99d9('0x43')]=router; \ No newline at end of file +var _0x9ad1=['post','addDisposition','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','now','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x9ad1,0x1db));var _0x19ad=function(_0x4bb1a7,_0xfdc55c){_0x4bb1a7=_0x4bb1a7-0x0;var _0x2843f0=_0x9ad1[_0x4bb1a7];return _0x2843f0;};'use strict';var multer=require(_0x19ad('0x0'));var util=require(_0x19ad('0x1'));var path=require(_0x19ad('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x19ad('0x3')]();var fs_extra=require(_0x19ad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x19ad('0x5'));var config=require(_0x19ad('0x6'));var controller=require(_0x19ad('0x7'));router[_0x19ad('0x8')]('/',auth[_0x19ad('0x9')](),controller[_0x19ad('0xa')]);router[_0x19ad('0x8')](_0x19ad('0xb'),auth[_0x19ad('0x9')](),controller[_0x19ad('0xc')]);router[_0x19ad('0x8')]('/:id',auth[_0x19ad('0x9')](),controller[_0x19ad('0xd')]);router['get'](_0x19ad('0xe'),auth[_0x19ad('0x9')](),controller['getDispositions']);router[_0x19ad('0x8')](_0x19ad('0xf'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x10')]);router[_0x19ad('0x8')](_0x19ad('0x11'),controller[_0x19ad('0x12')]);router[_0x19ad('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x19ad('0x8')](_0x19ad('0x13'),controller[_0x19ad('0x14')]);router[_0x19ad('0x8')](_0x19ad('0x15'),controller[_0x19ad('0x16')]);router[_0x19ad('0x8')](_0x19ad('0x17'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x18')]);router[_0x19ad('0x8')]('/:id/snippet',controller['getSnippet']);router[_0x19ad('0x8')](_0x19ad('0x19'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x1a')]);router[_0x19ad('0x8')](_0x19ad('0x1b'),auth['isAuthenticated'](),controller[_0x19ad('0x1c')]);router[_0x19ad('0x8')](_0x19ad('0x1d'),controller[_0x19ad('0x1e')]);router[_0x19ad('0x8')](_0x19ad('0x1f'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x20')]);router[_0x19ad('0x8')](_0x19ad('0x21'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x22')]);router['post']('/',auth[_0x19ad('0x9')](),controller[_0x19ad('0x23')]);router[_0x19ad('0x24')]('/:id/dispositions',auth[_0x19ad('0x9')](),controller[_0x19ad('0x25')]);router[_0x19ad('0x24')](_0x19ad('0xf'),auth[_0x19ad('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b77c0,_0x17d56f,_0x2e6a4d){_0x2e6a4d(null,path[_0x19ad('0x26')](config[_0x19ad('0x27')],_0x19ad('0x28')));},'filename':function(_0x460228,_0x363fea,_0x4453ff){_0x4453ff(null,util[_0x19ad('0x29')](_0x19ad('0x2a'),Date['now'](),_0x363fea[_0x19ad('0x2b')]));}})});router['post'](_0x19ad('0x11'),upload[_0x19ad('0x2c')](_0x19ad('0x2d')),controller[_0x19ad('0x2e')]);var upload=multer({'storage':multer[_0x19ad('0x2f')]({'destination':function(_0x273ab8,_0x4f8927,_0x51456a){_0x51456a(null,path[_0x19ad('0x26')](config['root'],_0x19ad('0x30')));},'filename':function(_0x3d60be,_0xbcf851,_0x643a6a){_0x643a6a(null,util[_0x19ad('0x29')]('%s-%s',Date[_0x19ad('0x31')](),_0xbcf851['originalname']));}})});router['post'](_0x19ad('0x32'),upload['single'](_0x19ad('0x2d')),controller[_0x19ad('0x33')]);var upload=multer({'storage':multer[_0x19ad('0x2f')]({'destination':function(_0x547024,_0x50c5ba,_0x5a6ef1){_0x5a6ef1(null,path['join'](config[_0x19ad('0x27')],_0x19ad('0x30')));},'filename':function(_0x28ce5a,_0xc2170b,_0x5a86d4){_0x5a86d4(null,util[_0x19ad('0x29')](_0x19ad('0x2a'),Date[_0x19ad('0x31')](),_0xc2170b[_0x19ad('0x2b')]));}})});router[_0x19ad('0x24')](_0x19ad('0x13'),upload['single'](_0x19ad('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f4f71,_0x19e89a,_0x81eeb6){_0x81eeb6(null,path[_0x19ad('0x26')](config[_0x19ad('0x27')],_0x19ad('0x30')));},'filename':function(_0x25088b,_0x599139,_0x34a58d){_0x34a58d(null,util[_0x19ad('0x29')](_0x19ad('0x2a'),Date['now'](),_0x599139[_0x19ad('0x2b')]));}})});router['post'](_0x19ad('0x15'),upload[_0x19ad('0x2c')](_0x19ad('0x2d')),controller[_0x19ad('0x34')]);router['post'](_0x19ad('0x35'),controller[_0x19ad('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2e52a8,_0x232ddb,_0x336caf){const _0x123508=path[_0x19ad('0x26')](config[_0x19ad('0x27')],_0x19ad('0x37'),_0x19ad('0x38'),_0x19ad('0x39'));fs_extra[_0x19ad('0x3a')](_0x123508,function(){_0x336caf(null,_0x123508);});},'filename':function(_0x2fe47c,_0x3e49af,_0x3915ec){const _0x1bcfea=_0x3e49af[_0x19ad('0x2b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51fcba=path[_0x19ad('0x3b')](_0x1bcfea);const _0x10b38a=Date['now']()+'-'+_0x1bcfea['replace'](_0x51fcba,'')+_0x51fcba;_0x3915ec(null,_0x10b38a);}})});router['post'](_0x19ad('0x3c'),offlineUploadMulter['any'](),controller[_0x19ad('0x3d')]);router[_0x19ad('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x19ad('0x3e')]);router[_0x19ad('0x24')](_0x19ad('0x19'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x3f')]);router[_0x19ad('0x24')](_0x19ad('0x1b'),auth['isAuthenticated'](),controller[_0x19ad('0x40')]);router[_0x19ad('0x24')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x19ad('0x41')](_0x19ad('0x42'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x43')]);router[_0x19ad('0x44')](_0x19ad('0x42'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x45')]);router['delete'](_0x19ad('0xe'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x46')]);router[_0x19ad('0x44')](_0x19ad('0xf'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x47')]);router[_0x19ad('0x44')]('/:id/users',auth[_0x19ad('0x9')](),controller[_0x19ad('0x48')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index dc99168..78c7a8d 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 _0x644f=['exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x644f,0x177));var _0xf644=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x644f[_0x455c6c];return _0x488242;};'use strict';var Sequelize=require('sequelize');module[_0xf644('0x0')]={'name':{'type':Sequelize[_0xf644('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf644('0x2')](_0xf644('0x3'),_0xf644('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf644('0x1')]},'data2':{'type':Sequelize[_0xf644('0x1')]}}; \ No newline at end of file +var _0x31af=['STRING','Google','sequelize','exports'];(function(_0x32d44f,_0x62b8ba){var _0x472622=function(_0x1a1d69){while(--_0x1a1d69){_0x32d44f['push'](_0x32d44f['shift']());}};_0x472622(++_0x62b8ba);}(_0x31af,0xde));var _0xf31a=function(_0x5f44ab,_0x589ad3){_0x5f44ab=_0x5f44ab-0x0;var _0x3056d7=_0x31af[_0x5f44ab];return _0x3056d7;};'use strict';var Sequelize=require(_0xf31a('0x0'));module[_0xf31a('0x1')]={'name':{'type':Sequelize[_0xf31a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xf31a('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xf31a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index cc973ed..aac314a 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 _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x45f705,_0x737e72){var _0x34a428=function(_0x4eabb1){while(--_0x4eabb1){_0x45f705['push'](_0x45f705['shift']());}};_0x34a428(++_0x737e72);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));}; \ No newline at end of file +var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5f2f,0x73));var _0xf5f2=function(_0x30e092,_0x4c1763){_0x30e092=_0x30e092-0x0;var _0xdd544f=_0x5f2f[_0x30e092];return _0xdd544f;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index d78e049..871ff01 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 _0x806a=['bluebird','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x806a,0x1ca));var _0xa806=function(_0x10179b,_0xd79163){_0x10179b=_0x10179b-0x0;var _0x2665b8=_0x806a[_0x10179b];return _0x2665b8;};'use strict';var _=require(_0xa806('0x0'));var util=require(_0xa806('0x1'));var logger=require(_0xa806('0x2'))(_0xa806('0x3'));var moment=require('moment');var BPromise=require(_0xa806('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa806('0x5'));var config=require(_0xa806('0x6'));var attributes=require('./cloudProvider.attributes');module[_0xa806('0x7')]=function(_0x14767d,_0x6e8c7e){return _0x14767d[_0xa806('0x8')](_0xa806('0x9'),attributes,{'tableName':_0xa806('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa368=['request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','moment','bluebird'];(function(_0x4efe30,_0xfaee0){var _0x1e7485=function(_0x2afe82){while(--_0x2afe82){_0x4efe30['push'](_0x4efe30['shift']());}};_0x1e7485(++_0xfaee0);}(_0xa368,0x1c0));var _0x8a36=function(_0x2f799a,_0x3d560a){_0x2f799a=_0x2f799a-0x0;var _0x391da6=_0xa368[_0x2f799a];return _0x391da6;};'use strict';var _=require(_0x8a36('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8a36('0x1'));var BPromise=require(_0x8a36('0x2'));var rp=require(_0x8a36('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a36('0x4'));var config=require(_0x8a36('0x5'));var attributes=require(_0x8a36('0x6'));module[_0x8a36('0x7')]=function(_0x58a566,_0x3b9d29){return _0x58a566[_0x8a36('0x8')](_0x8a36('0x9'),attributes,{'tableName':_0x8a36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 008377f..10e3c0f 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 _0x9148=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1bcc3c,_0x59f478){var _0x4cdb22=function(_0x1d259b){while(--_0x1d259b){_0x1bcc3c['push'](_0x1bcc3c['shift']());}};_0x4cdb22(++_0x59f478);}(_0x9148,0x10d));var _0x8914=function(_0x58b261,_0x3fbf7f){_0x58b261=_0x58b261-0x0;var _0x1a3c76=_0x9148[_0x58b261];return _0x1a3c76;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd146,_0x58e892,_0x1b0445){return new BPromise(function(_0x15aff5,_0x1e2d12){return client[_0x8914('0xc')](_0x1cd146,_0x1b0445)['then'](function(_0x2e7aac){logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));logger[_0x8914('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58e892,_0x8914('0xf'),JSON[_0x8914('0x11')](_0x2e7aac));if(_0x2e7aac['error']){if(_0x2e7aac['error'][_0x8914('0x12')]===0x1f4){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);return _0x1e2d12(_0x2e7aac[_0x8914('0x13')]['message']);}logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac['error'][_0x8914('0x14')]);return _0x15aff5(_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);}else{logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));_0x15aff5(_0x2e7aac[_0x8914('0x15')][_0x8914('0x14')]);}})[_0x8914('0x16')](function(_0x4ca130){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x4ca130);_0x1e2d12(_0x4ca130);});});} \ No newline at end of file +var _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch'];(function(_0x4dd266,_0x1f6227){var _0x3596e0=function(_0x419157){while(--_0x419157){_0x4dd266['push'](_0x4dd266['shift']());}};_0x3596e0(++_0x1f6227);}(_0xb44a,0x1c2));var _0xab44=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0xb44a[_0x1a0600];return _0x734670;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('CloudProvider,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index f0072ed..41441f7 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 _0xf9b7=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','show','put','/:id','delete'];(function(_0xe902b3,_0x50293d){var _0x42f96e=function(_0x2345f2){while(--_0x2345f2){_0xe902b3['push'](_0xe902b3['shift']());}};_0x42f96e(++_0x50293d);}(_0xf9b7,0x91));var _0x7f9b=function(_0x41ce06,_0x413956){_0x41ce06=_0x41ce06-0x0;var _0x31ac1d=_0xf9b7[_0x41ce06];return _0x31ac1d;};'use strict';var multer=require(_0x7f9b('0x0'));var util=require(_0x7f9b('0x1'));var path=require(_0x7f9b('0x2'));var timeout=require(_0x7f9b('0x3'));var express=require(_0x7f9b('0x4'));var router=express[_0x7f9b('0x5')]();var fs_extra=require(_0x7f9b('0x6'));var auth=require(_0x7f9b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7f9b('0x8'));router['get']('/',auth[_0x7f9b('0x9')](),controller[_0x7f9b('0xa')]);router['get']('/:id',auth[_0x7f9b('0x9')](),controller[_0x7f9b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7f9b('0xc')](_0x7f9b('0xd'),auth[_0x7f9b('0x9')](),controller['update']);router[_0x7f9b('0xe')](_0x7f9b('0xd'),auth['isAuthenticated'](),controller[_0x7f9b('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb0d2=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','exports','multer'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb0d2,0x1b4));var _0x2b0d=function(_0x48f72,_0x302a09){_0x48f72=_0x48f72-0x0;var _0x32fc39=_0xb0d2[_0x48f72];return _0x32fc39;};'use strict';var multer=require(_0x2b0d('0x0'));var util=require('util');var path=require(_0x2b0d('0x1'));var timeout=require(_0x2b0d('0x2'));var express=require(_0x2b0d('0x3'));var router=express['Router']();var fs_extra=require(_0x2b0d('0x4'));var auth=require(_0x2b0d('0x5'));var interaction=require(_0x2b0d('0x6'));var config=require(_0x2b0d('0x7'));var controller=require(_0x2b0d('0x8'));router['get']('/',auth[_0x2b0d('0x9')](),controller[_0x2b0d('0xa')]);router[_0x2b0d('0xb')](_0x2b0d('0xc'),auth[_0x2b0d('0x9')](),controller[_0x2b0d('0xd')]);router[_0x2b0d('0xe')]('/',auth[_0x2b0d('0x9')](),controller[_0x2b0d('0xf')]);router[_0x2b0d('0x10')]('/:id',auth[_0x2b0d('0x9')](),controller['update']);router[_0x2b0d('0x11')](_0x2b0d('0xc'),auth[_0x2b0d('0x9')](),controller['destroy']);module[_0x2b0d('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 1af705e..03728ba 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 _0xbbc2=['exports','STRING','sequelize'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xbbc2,0x14f));var _0x2bbc=function(_0x30502e,_0x51322f){_0x30502e=_0x30502e-0x0;var _0x37ed80=_0xbbc2[_0x30502e];return _0x37ed80;};'use strict';var Sequelize=require(_0x2bbc('0x0'));module[_0x2bbc('0x1')]={'name':{'type':Sequelize[_0x2bbc('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2bbc('0x2')]},'companyId':{'type':Sequelize[_0x2bbc('0x2')]},'website':{'type':Sequelize[_0x2bbc('0x2')]},'phone':{'type':Sequelize[_0x2bbc('0x2')]},'fax':{'type':Sequelize[_0x2bbc('0x2')]},'type':{'type':Sequelize[_0x2bbc('0x2')]},'street':{'type':Sequelize[_0x2bbc('0x2')]},'postalCode':{'type':Sequelize[_0x2bbc('0x2')]},'city':{'type':Sequelize[_0x2bbc('0x2')]},'country':{'type':Sequelize[_0x2bbc('0x2')]},'email':{'type':Sequelize[_0x2bbc('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2bbc('0x2')]},'sStreet':{'type':Sequelize[_0x2bbc('0x2')]},'sPostalCode':{'type':Sequelize[_0x2bbc('0x2')]},'sCity':{'type':Sequelize[_0x2bbc('0x2')]},'sCountry':{'type':Sequelize[_0x2bbc('0x2')]},'description':{'type':Sequelize[_0x2bbc('0x2')]}}; \ No newline at end of file +var _0xbc17=['exports','name','STRING','sequelize'];(function(_0x184464,_0x85a4df){var _0x45581f=function(_0xd5e755){while(--_0xd5e755){_0x184464['push'](_0x184464['shift']());}};_0x45581f(++_0x85a4df);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x50cc54,_0x54c15f){_0x50cc54=_0x50cc54-0x0;var _0x28ecca=_0xbc17[_0x50cc54];return _0x28ecca;};'use strict';var Sequelize=require(_0x7bc1('0x0'));module[_0x7bc1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7bc1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7bc1('0x3')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x7bc1('0x3')]},'fax':{'type':Sequelize[_0x7bc1('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7bc1('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7bc1('0x3')]},'country':{'type':Sequelize[_0x7bc1('0x3')]},'email':{'type':Sequelize[_0x7bc1('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7bc1('0x3')]},'sStreet':{'type':Sequelize[_0x7bc1('0x3')]},'sPostalCode':{'type':Sequelize[_0x7bc1('0x3')]},'sCity':{'type':Sequelize[_0x7bc1('0x3')]},'sCountry':{'type':Sequelize[_0x7bc1('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 781d66f..46d7d91 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 _0x271f=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','filters','map','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','addContacts','CmContact','ids','omit','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x271f,0x160));var _0xf271=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x271f[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xf271('0x0'));var rimraf=require(_0xf271('0x1'));var zipdir=require(_0xf271('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf271('0x3'));var moment=require(_0xf271('0x4'));var BPromise=require(_0xf271('0x5'));var Mustache=require(_0xf271('0x6'));var util=require(_0xf271('0x7'));var path=require('path');var sox=require(_0xf271('0x8'));var csv=require(_0xf271('0x9'));var ejs=require(_0xf271('0xa'));var fs=require('fs');var fs_extra=require(_0xf271('0xb'));var _=require('lodash');var squel=require(_0xf271('0xc'));var crypto=require('crypto');var jsforce=require(_0xf271('0xd'));var deskjs=require(_0xf271('0xe'));var toCsv=require(_0xf271('0x9'));var querystring=require(_0xf271('0xf'));var Papa=require(_0xf271('0x10'));var Redis=require('ioredis');var authService=require(_0xf271('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf271('0x12'));var hardwareService=require(_0xf271('0x13'));var logger=require('../../config/logger')(_0xf271('0x14'));var utils=require(_0xf271('0x15'));var config=require(_0xf271('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf271('0x17'))['db'];function respondWithStatusCode(_0xceedf0,_0x1acd66){_0x1acd66=_0x1acd66||0xcc;return function(_0x30dc47){if(_0x30dc47){return _0xceedf0[_0xf271('0x18')](_0x1acd66);}return _0xceedf0[_0xf271('0x19')](_0x1acd66)[_0xf271('0x1a')]();};}function respondWithResult(_0x4fd626,_0x2997ef){_0x2997ef=_0x2997ef||0xc8;return function(_0x31e0e6){if(_0x31e0e6){return _0x4fd626[_0xf271('0x19')](_0x2997ef)[_0xf271('0x1b')](_0x31e0e6);}};}function respondWithFilteredResult(_0x263093,_0x13c250){return function(_0x1b562e){if(_0x1b562e){var _0x581e4f=typeof _0x13c250[_0xf271('0x1c')]===_0xf271('0x1d')&&typeof _0x13c250[_0xf271('0x1e')]===_0xf271('0x1d');var _0x573277=_0x1b562e[_0xf271('0x1f')];var _0x34543f=_0x581e4f?0x0:_0x13c250[_0xf271('0x1c')];var _0x4ced1f=_0x581e4f?_0x1b562e['count']:_0x13c250[_0xf271('0x1c')]+_0x13c250['limit'];var _0x122537;if(_0x4ced1f>=_0x573277){_0x4ced1f=_0x573277;_0x122537=0xc8;}else{_0x122537=0xce;}_0x263093['status'](_0x122537);return _0x263093[_0xf271('0x20')](_0xf271('0x21'),_0x34543f+'-'+_0x4ced1f+'/'+_0x573277)[_0xf271('0x1b')](_0x1b562e);}return null;};}function patchUpdates(_0x5f361a){return function(_0x3ea57b){try{jsonpatch[_0xf271('0x22')](_0x3ea57b,_0x5f361a,!![]);}catch(_0x3bb43a){return BPromise[_0xf271('0x23')](_0x3bb43a);}return _0x3ea57b[_0xf271('0x24')]();};}function saveUpdates(_0x295997,_0x46dc24){return function(_0x3cf9f3){if(_0x3cf9f3){return _0x3cf9f3['update'](_0x295997)[_0xf271('0x25')](function(_0x487b89){return _0x487b89;});}return null;};}function removeEntity(_0x2ea37c,_0x95e89d){return function(_0x92cee2){if(_0x92cee2){return _0x92cee2['destroy']()[_0xf271('0x25')](function(){var _0x1ed6ce=_0x92cee2[_0xf271('0x26')]({'plain':!![]});var _0x70f88c='Companies';return db[_0xf271('0x27')]['destroy']({'where':{'type':_0x70f88c,'resourceId':_0x1ed6ce['id']}})[_0xf271('0x25')](function(){return _0x92cee2;});})[_0xf271('0x25')](function(){_0x2ea37c[_0xf271('0x19')](0xcc)[_0xf271('0x1a')]();});}};}function handleEntityNotFound(_0x106893,_0x5b925d){return function(_0x16f87a){if(!_0x16f87a){_0x106893[_0xf271('0x18')](0x194);}return _0x16f87a;};}function handleError(_0x330c81,_0x31c787){_0x31c787=_0x31c787||0x1f4;return function(_0x24bc67){logger[_0xf271('0x28')](_0x24bc67[_0xf271('0x29')]);if(_0x24bc67['name']){delete _0x24bc67[_0xf271('0x2a')];}_0x330c81['status'](_0x31c787)[_0xf271('0x2b')](_0x24bc67);};}exports[_0xf271('0x2c')]=function(_0x3482dc,_0x4c086d){var _0x5c7997={},_0x1fcda5={},_0x447ab0={'count':0x0,'rows':[]};return db[_0xf271('0x2d')][_0xf271('0x2e')]()['then'](function(_0x18a6b0){_0x1fcda5['model']=_[_0xf271('0x2f')](_0x18a6b0);_0x1fcda5[_0xf271('0x30')]=_['keys'](_0x3482dc[_0xf271('0x30')]);_0x1fcda5['filters']=_[_0xf271('0x31')](_0x1fcda5['model'],_0x1fcda5[_0xf271('0x30')]);_0x5c7997[_0xf271('0x32')]=_[_0xf271('0x31')](_0x1fcda5['model'],qs['fields'](_0x3482dc[_0xf271('0x30')][_0xf271('0x33')]));_0x5c7997[_0xf271('0x32')]=_0x5c7997[_0xf271('0x32')][_0xf271('0x34')]?_0x5c7997[_0xf271('0x32')]:_0x1fcda5[_0xf271('0x35')];if(!_0x3482dc[_0xf271('0x30')]['hasOwnProperty'](_0xf271('0x36'))){_0x5c7997[_0xf271('0x1e')]=qs[_0xf271('0x1e')](_0x3482dc[_0xf271('0x30')][_0xf271('0x1e')]);_0x5c7997[_0xf271('0x1c')]=qs['offset'](_0x3482dc[_0xf271('0x30')][_0xf271('0x1c')]);}_0x5c7997[_0xf271('0x37')]=qs[_0xf271('0x38')](_0x3482dc[_0xf271('0x30')][_0xf271('0x38')]);_0x5c7997[_0xf271('0x39')]=qs['filters'](_[_0xf271('0x3a')](_0x3482dc['query'],_0x1fcda5[_0xf271('0x3b')]),_0x18a6b0);if(_0x3482dc[_0xf271('0x30')]['filter']){_0x5c7997[_0xf271('0x39')]=_['merge'](_0x5c7997[_0xf271('0x39')],{'$or':_[_0xf271('0x3c')](_0x5c7997[_0xf271('0x32')],function(_0xe73cda){var _0x400b44={};_0x400b44[_0xe73cda]={'$like':'%'+_0x3482dc[_0xf271('0x30')]['filter']+'%'};return _0x400b44;})});}_0x5c7997=_[_0xf271('0x3d')]({},_0x5c7997,_0x3482dc[_0xf271('0x3e')]);var _0x45f045={'where':_0x5c7997[_0xf271('0x39')]};return db[_0xf271('0x2d')][_0xf271('0x1f')](_0x45f045)['then'](function(_0x1fbb56){_0x447ab0['count']=_0x1fbb56;if(_0x3482dc['query'][_0xf271('0x3f')]){_0x5c7997[_0xf271('0x40')]=[{'all':!![]}];}return db[_0xf271('0x2d')][_0xf271('0x41')](_0x5c7997);})[_0xf271('0x25')](function(_0x16dcbc){_0x447ab0[_0xf271('0x42')]=_0x16dcbc;return _0x447ab0;})[_0xf271('0x25')](respondWithFilteredResult(_0x4c086d,_0x5c7997))[_0xf271('0x43')](handleError(_0x4c086d,null));})['catch'](handleError(_0x4c086d,null));};exports['show']=function(_0xf308ad,_0x51ef9c){var _0x34e155={'raw':![],'where':{'id':_0xf308ad[_0xf271('0x44')]['id']}},_0x5768df={};_0x5768df['model']=_[_0xf271('0x2f')](db[_0xf271('0x2d')][_0xf271('0x45')]);_0x5768df[_0xf271('0x30')]=_[_0xf271('0x2f')](_0xf308ad[_0xf271('0x30')]);_0x5768df['filters']=_[_0xf271('0x31')](_0x5768df[_0xf271('0x35')],_0x5768df[_0xf271('0x30')]);_0x34e155[_0xf271('0x32')]=_[_0xf271('0x31')](_0x5768df[_0xf271('0x35')],qs[_0xf271('0x33')](_0xf308ad[_0xf271('0x30')][_0xf271('0x33')]));_0x34e155[_0xf271('0x32')]=_0x34e155['attributes'][_0xf271('0x34')]?_0x34e155['attributes']:_0x5768df[_0xf271('0x35')];if(_0xf308ad[_0xf271('0x30')]['includeAll']){_0x34e155[_0xf271('0x40')]=[{'all':!![]}];}_0x34e155=_[_0xf271('0x3d')]({},_0x34e155,_0xf308ad['options']);return db['CmCompany']['find'](_0x34e155)['then'](handleEntityNotFound(_0x51ef9c,null))[_0xf271('0x25')](respondWithResult(_0x51ef9c,null))['catch'](handleError(_0x51ef9c,null));};exports[_0xf271('0x46')]=function(_0x285eca,_0x93a603){return db[_0xf271('0x2d')][_0xf271('0x46')](_0x285eca[_0xf271('0x47')],{})['then'](function(_0x2f6dff){var _0x150f7d=_0x285eca[_0xf271('0x48')][_0xf271('0x26')]({'plain':!![]});if(!_0x150f7d)throw new Error(_0xf271('0x49'));if(_0x150f7d[_0xf271('0x4a')]===_0xf271('0x48')){var _0x2ced27=_0x2f6dff[_0xf271('0x26')]({'plain':!![]});var _0x5195e9=_0xf271('0x4b');return db[_0xf271('0x4c')][_0xf271('0x4d')]({'where':{'name':_0x5195e9,'userProfileId':_0x150f7d[_0xf271('0x4e')]},'raw':!![]})[_0xf271('0x25')](function(_0x5f3db6){if(_0x5f3db6&&_0x5f3db6[_0xf271('0x4f')]===0x0){return db[_0xf271('0x27')][_0xf271('0x46')]({'name':_0x2ced27[_0xf271('0x2a')],'resourceId':_0x2ced27['id'],'type':_0x5f3db6[_0xf271('0x2a')],'sectionId':_0x5f3db6['id']},{})[_0xf271('0x25')](function(){return _0x2f6dff;});}else{return _0x2f6dff;}})[_0xf271('0x43')](function(_0x5a6d2c){logger['error'](_0xf271('0x50'),_0x5a6d2c);throw _0x5a6d2c;});}return _0x2f6dff;})[_0xf271('0x25')](respondWithResult(_0x93a603,0xc9))['catch'](handleError(_0x93a603,null));};exports[_0xf271('0x51')]=function(_0x3ab58d,_0x591191){if(_0x3ab58d[_0xf271('0x47')]['id']){delete _0x3ab58d[_0xf271('0x47')]['id'];}return db['CmCompany'][_0xf271('0x4d')]({'where':{'id':_0x3ab58d[_0xf271('0x44')]['id']}})['then'](handleEntityNotFound(_0x591191,null))[_0xf271('0x25')](saveUpdates(_0x3ab58d[_0xf271('0x47')],null))[_0xf271('0x25')](respondWithResult(_0x591191,null))[_0xf271('0x43')](handleError(_0x591191,null));};exports[_0xf271('0x52')]=function(_0x5d0987,_0x39a970){return db[_0xf271('0x2d')][_0xf271('0x4d')]({'where':{'id':_0x5d0987[_0xf271('0x44')]['id']}})[_0xf271('0x25')](handleEntityNotFound(_0x39a970,null))[_0xf271('0x25')](removeEntity(_0x39a970,null))[_0xf271('0x43')](handleError(_0x39a970,null));};exports[_0xf271('0x2e')]=function(_0x56f885,_0x16a404){return db[_0xf271('0x2d')]['describe']()[_0xf271('0x25')](respondWithResult(_0x16a404,null))['catch'](handleError(_0x16a404,null));};exports[_0xf271('0x53')]=function(_0x4b0fca,_0x26ddee,_0x564b03){return db[_0xf271('0x54')]['find']({'where':{'id':_0x4b0fca[_0xf271('0x44')]['id']}})[_0xf271('0x25')](handleEntityNotFound(_0x26ddee,null))[_0xf271('0x25')](function(_0x178ccd){if(_0x178ccd){return _0x178ccd['addContacts'](_0x4b0fca[_0xf271('0x47')][_0xf271('0x55')],_[_0xf271('0x56')](_0x4b0fca['body'],[_0xf271('0x55'),'id'])||{});}})[_0xf271('0x25')](respondWithResult(_0x26ddee,null))[_0xf271('0x43')](handleError(_0x26ddee,null));};exports[_0xf271('0x57')]=function(_0x58777f,_0x1a0275,_0x1417bd){var _0x2f8968={};var _0x4ebbe0={};var _0x170d9c;var _0x1d184c;return db[_0xf271('0x2d')]['findOne']({'where':{'id':_0x58777f[_0xf271('0x44')]['id']}})[_0xf271('0x25')](handleEntityNotFound(_0x1a0275,null))[_0xf271('0x25')](function(_0x7cc28f){if(_0x7cc28f){_0x170d9c=_0x7cc28f;_0x4ebbe0[_0xf271('0x35')]=_[_0xf271('0x2f')](db[_0xf271('0x54')][_0xf271('0x45')]);_0x4ebbe0[_0xf271('0x30')]=_[_0xf271('0x2f')](_0x58777f['query']);_0x4ebbe0['filters']=_[_0xf271('0x31')](_0x4ebbe0[_0xf271('0x35')],_0x4ebbe0[_0xf271('0x30')]);_0x2f8968[_0xf271('0x32')]=_['intersection'](_0x4ebbe0[_0xf271('0x35')],qs['fields'](_0x58777f['query'][_0xf271('0x33')]));_0x2f8968[_0xf271('0x32')]=_0x2f8968[_0xf271('0x32')][_0xf271('0x34')]?_0x2f8968['attributes']:_0x4ebbe0[_0xf271('0x35')];_0x2f8968[_0xf271('0x37')]=qs['sort'](_0x58777f[_0xf271('0x30')]['sort']);_0x2f8968[_0xf271('0x39')]=qs[_0xf271('0x3b')](_[_0xf271('0x3a')](_0x58777f['query'],_0x4ebbe0[_0xf271('0x3b')]));if(_0x58777f[_0xf271('0x30')]['filter']){_0x2f8968['where']=_['merge'](_0x2f8968[_0xf271('0x39')],{'$or':_[_0xf271('0x3c')](_0x2f8968['attributes'],function(_0x5db15c){var _0x420f87={};_0x420f87[_0x5db15c]={'$like':'%'+_0x58777f['query']['filter']+'%'};return _0x420f87;})});}_0x2f8968=_['merge']({},_0x2f8968,_0x58777f['options']);return _0x170d9c[_0xf271('0x57')](_0x2f8968);}})[_0xf271('0x25')](function(_0x36b3a9){if(_0x36b3a9){_0x1d184c=_0x36b3a9[_0xf271('0x34')];if(!_0x58777f[_0xf271('0x30')][_0xf271('0x58')](_0xf271('0x36'))){_0x2f8968[_0xf271('0x1e')]=qs[_0xf271('0x1e')](_0x58777f[_0xf271('0x30')][_0xf271('0x1e')]);_0x2f8968[_0xf271('0x1c')]=qs[_0xf271('0x1c')](_0x58777f[_0xf271('0x30')][_0xf271('0x1c')]);}return _0x170d9c[_0xf271('0x57')](_0x2f8968);}})[_0xf271('0x25')](function(_0x5e3af0){if(_0x5e3af0){return _0x5e3af0?{'count':_0x1d184c,'rows':_0x5e3af0}:null;}})[_0xf271('0x25')](respondWithResult(_0x1a0275,null))[_0xf271('0x43')](handleError(_0x1a0275,null));}; \ No newline at end of file +var _0x2734=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','error','name','send','index','describe','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','where','pick','filter','map','merge','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','getContacts','findOne','sort','hasOwnProperty','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x2734,0xf1));var _0x4273=function(_0x4db055,_0x5d1e2a){_0x4db055=_0x4db055-0x0;var _0x256064=_0x2734[_0x4db055];return _0x256064;};'use strict';var emlformat=require(_0x4273('0x0'));var rimraf=require(_0x4273('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4273('0x2'));var rp=require('request-promise');var moment=require(_0x4273('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4273('0x4'));var path=require('path');var sox=require(_0x4273('0x5'));var csv=require(_0x4273('0x6'));var ejs=require(_0x4273('0x7'));var fs=require('fs');var fs_extra=require(_0x4273('0x8'));var _=require(_0x4273('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4273('0xa'));var deskjs=require(_0x4273('0xb'));var toCsv=require(_0x4273('0x6'));var querystring=require('querystring');var Papa=require(_0x4273('0xc'));var Redis=require(_0x4273('0xd'));var authService=require(_0x4273('0xe'));var qs=require(_0x4273('0xf'));var as=require(_0x4273('0x10'));var hardwareService=require(_0x4273('0x11'));var logger=require(_0x4273('0x12'))(_0x4273('0x13'));var utils=require(_0x4273('0x14'));var config=require(_0x4273('0x15'));var licenseUtil=require(_0x4273('0x16'));var db=require(_0x4273('0x17'))['db'];function respondWithStatusCode(_0x2b8353,_0x14eb78){_0x14eb78=_0x14eb78||0xcc;return function(_0x4a6d12){if(_0x4a6d12){return _0x2b8353[_0x4273('0x18')](_0x14eb78);}return _0x2b8353[_0x4273('0x19')](_0x14eb78)['end']();};}function respondWithResult(_0x516100,_0x1ecd68){_0x1ecd68=_0x1ecd68||0xc8;return function(_0x526166){if(_0x526166){return _0x516100[_0x4273('0x19')](_0x1ecd68)[_0x4273('0x1a')](_0x526166);}};}function respondWithFilteredResult(_0x446ef8,_0x361ebe){return function(_0x26fe5c){if(_0x26fe5c){var _0x44e0b2=typeof _0x361ebe[_0x4273('0x1b')]===_0x4273('0x1c')&&typeof _0x361ebe[_0x4273('0x1d')]===_0x4273('0x1c');var _0x2285ff=_0x26fe5c[_0x4273('0x1e')];var _0x17db8a=_0x44e0b2?0x0:_0x361ebe[_0x4273('0x1b')];var _0x457a4c=_0x44e0b2?_0x26fe5c[_0x4273('0x1e')]:_0x361ebe[_0x4273('0x1b')]+_0x361ebe[_0x4273('0x1d')];var _0x40d5a7;if(_0x457a4c>=_0x2285ff){_0x457a4c=_0x2285ff;_0x40d5a7=0xc8;}else{_0x40d5a7=0xce;}_0x446ef8[_0x4273('0x19')](_0x40d5a7);return _0x446ef8['set'](_0x4273('0x1f'),_0x17db8a+'-'+_0x457a4c+'/'+_0x2285ff)[_0x4273('0x1a')](_0x26fe5c);}return null;};}function patchUpdates(_0x4a3e54){return function(_0x42b68e){try{jsonpatch[_0x4273('0x20')](_0x42b68e,_0x4a3e54,!![]);}catch(_0x3dd823){return BPromise[_0x4273('0x21')](_0x3dd823);}return _0x42b68e[_0x4273('0x22')]();};}function saveUpdates(_0x5108d6,_0xf17728){return function(_0x4f1e78){if(_0x4f1e78){return _0x4f1e78[_0x4273('0x23')](_0x5108d6)[_0x4273('0x24')](function(_0x4b2f7c){return _0x4b2f7c;});}return null;};}function removeEntity(_0x525421,_0x3038a3){return function(_0x5619e5){if(_0x5619e5){return _0x5619e5[_0x4273('0x25')]()[_0x4273('0x24')](function(){var _0x32b672=_0x5619e5[_0x4273('0x26')]({'plain':!![]});var _0x1a2535=_0x4273('0x27');return db[_0x4273('0x28')][_0x4273('0x25')]({'where':{'type':_0x1a2535,'resourceId':_0x32b672['id']}})[_0x4273('0x24')](function(){return _0x5619e5;});})[_0x4273('0x24')](function(){_0x525421[_0x4273('0x19')](0xcc)[_0x4273('0x29')]();});}};}function handleEntityNotFound(_0x58afc6,_0x271b9c){return function(_0x2cc720){if(!_0x2cc720){_0x58afc6[_0x4273('0x18')](0x194);}return _0x2cc720;};}function handleError(_0x3d8e37,_0x763fb1){_0x763fb1=_0x763fb1||0x1f4;return function(_0x49832f){logger[_0x4273('0x2a')](_0x49832f['stack']);if(_0x49832f[_0x4273('0x2b')]){delete _0x49832f['name'];}_0x3d8e37[_0x4273('0x19')](_0x763fb1)[_0x4273('0x2c')](_0x49832f);};}exports[_0x4273('0x2d')]=function(_0x582b22,_0x267f4d){var _0x2ef539={},_0x199f76={},_0x11a3e7={'count':0x0,'rows':[]};return db['CmCompany'][_0x4273('0x2e')]()[_0x4273('0x24')](function(_0x39889e){_0x199f76['model']=_[_0x4273('0x2f')](_0x39889e);_0x199f76[_0x4273('0x30')]=_[_0x4273('0x2f')](_0x582b22[_0x4273('0x30')]);_0x199f76[_0x4273('0x31')]=_[_0x4273('0x32')](_0x199f76[_0x4273('0x33')],_0x199f76[_0x4273('0x30')]);_0x2ef539[_0x4273('0x34')]=_[_0x4273('0x32')](_0x199f76[_0x4273('0x33')],qs['fields'](_0x582b22[_0x4273('0x30')][_0x4273('0x35')]));_0x2ef539[_0x4273('0x34')]=_0x2ef539[_0x4273('0x34')][_0x4273('0x36')]?_0x2ef539[_0x4273('0x34')]:_0x199f76[_0x4273('0x33')];if(!_0x582b22[_0x4273('0x30')]['hasOwnProperty'](_0x4273('0x37'))){_0x2ef539[_0x4273('0x1d')]=qs[_0x4273('0x1d')](_0x582b22[_0x4273('0x30')][_0x4273('0x1d')]);_0x2ef539['offset']=qs['offset'](_0x582b22[_0x4273('0x30')][_0x4273('0x1b')]);}_0x2ef539[_0x4273('0x38')]=qs['sort'](_0x582b22[_0x4273('0x30')]['sort']);_0x2ef539[_0x4273('0x39')]=qs[_0x4273('0x31')](_[_0x4273('0x3a')](_0x582b22[_0x4273('0x30')],_0x199f76['filters']),_0x39889e);if(_0x582b22['query'][_0x4273('0x3b')]){_0x2ef539[_0x4273('0x39')]=_['merge'](_0x2ef539[_0x4273('0x39')],{'$or':_[_0x4273('0x3c')](_0x2ef539[_0x4273('0x34')],function(_0x53312c){var _0x40cd30={};_0x40cd30[_0x53312c]={'$like':'%'+_0x582b22[_0x4273('0x30')]['filter']+'%'};return _0x40cd30;})});}_0x2ef539=_[_0x4273('0x3d')]({},_0x2ef539,_0x582b22[_0x4273('0x3e')]);var _0x3983d1={'where':_0x2ef539['where']};return db[_0x4273('0x3f')]['count'](_0x3983d1)[_0x4273('0x24')](function(_0x320ad9){_0x11a3e7[_0x4273('0x1e')]=_0x320ad9;if(_0x582b22[_0x4273('0x30')][_0x4273('0x40')]){_0x2ef539[_0x4273('0x41')]=[{'all':!![]}];}return db[_0x4273('0x3f')][_0x4273('0x42')](_0x2ef539);})[_0x4273('0x24')](function(_0x19e2b5){_0x11a3e7[_0x4273('0x43')]=_0x19e2b5;return _0x11a3e7;})[_0x4273('0x24')](respondWithFilteredResult(_0x267f4d,_0x2ef539))[_0x4273('0x44')](handleError(_0x267f4d,null));})['catch'](handleError(_0x267f4d,null));};exports[_0x4273('0x45')]=function(_0x13d655,_0x37f75f){var _0x561bd3={'raw':![],'where':{'id':_0x13d655[_0x4273('0x46')]['id']}},_0x48f716={};_0x48f716[_0x4273('0x33')]=_[_0x4273('0x2f')](db[_0x4273('0x3f')][_0x4273('0x47')]);_0x48f716['query']=_[_0x4273('0x2f')](_0x13d655[_0x4273('0x30')]);_0x48f716['filters']=_['intersection'](_0x48f716[_0x4273('0x33')],_0x48f716[_0x4273('0x30')]);_0x561bd3[_0x4273('0x34')]=_[_0x4273('0x32')](_0x48f716[_0x4273('0x33')],qs[_0x4273('0x35')](_0x13d655[_0x4273('0x30')]['fields']));_0x561bd3[_0x4273('0x34')]=_0x561bd3['attributes'][_0x4273('0x36')]?_0x561bd3[_0x4273('0x34')]:_0x48f716[_0x4273('0x33')];if(_0x13d655['query'][_0x4273('0x40')]){_0x561bd3['include']=[{'all':!![]}];}_0x561bd3=_[_0x4273('0x3d')]({},_0x561bd3,_0x13d655['options']);return db[_0x4273('0x3f')][_0x4273('0x48')](_0x561bd3)[_0x4273('0x24')](handleEntityNotFound(_0x37f75f,null))[_0x4273('0x24')](respondWithResult(_0x37f75f,null))[_0x4273('0x44')](handleError(_0x37f75f,null));};exports[_0x4273('0x49')]=function(_0x43ee4b,_0x1492da){return db[_0x4273('0x3f')]['create'](_0x43ee4b['body'],{})['then'](function(_0x3da7c5){var _0x57b3ba=_0x43ee4b[_0x4273('0x4a')][_0x4273('0x26')]({'plain':!![]});if(!_0x57b3ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57b3ba['role']===_0x4273('0x4a')){var _0x17103b=_0x3da7c5[_0x4273('0x26')]({'plain':!![]});var _0x13e4c6=_0x4273('0x27');return db[_0x4273('0x4b')][_0x4273('0x48')]({'where':{'name':_0x13e4c6,'userProfileId':_0x57b3ba['userProfileId']},'raw':!![]})[_0x4273('0x24')](function(_0x4fc291){if(_0x4fc291&&_0x4fc291[_0x4273('0x4c')]===0x0){return db[_0x4273('0x28')][_0x4273('0x49')]({'name':_0x17103b['name'],'resourceId':_0x17103b['id'],'type':_0x4fc291[_0x4273('0x2b')],'sectionId':_0x4fc291['id']},{})[_0x4273('0x24')](function(){return _0x3da7c5;});}else{return _0x3da7c5;}})[_0x4273('0x44')](function(_0x14929b){logger[_0x4273('0x2a')](_0x4273('0x4d'),_0x14929b);throw _0x14929b;});}return _0x3da7c5;})['then'](respondWithResult(_0x1492da,0xc9))[_0x4273('0x44')](handleError(_0x1492da,null));};exports['update']=function(_0x3c7dc2,_0x6f38d3){if(_0x3c7dc2[_0x4273('0x4e')]['id']){delete _0x3c7dc2['body']['id'];}return db['CmCompany'][_0x4273('0x48')]({'where':{'id':_0x3c7dc2[_0x4273('0x46')]['id']}})['then'](handleEntityNotFound(_0x6f38d3,null))[_0x4273('0x24')](saveUpdates(_0x3c7dc2[_0x4273('0x4e')],null))[_0x4273('0x24')](respondWithResult(_0x6f38d3,null))[_0x4273('0x44')](handleError(_0x6f38d3,null));};exports[_0x4273('0x25')]=function(_0x942b3b,_0x44b96d){return db[_0x4273('0x3f')][_0x4273('0x48')]({'where':{'id':_0x942b3b[_0x4273('0x46')]['id']}})[_0x4273('0x24')](handleEntityNotFound(_0x44b96d,null))[_0x4273('0x24')](removeEntity(_0x44b96d,null))['catch'](handleError(_0x44b96d,null));};exports[_0x4273('0x2e')]=function(_0xb987e0,_0x57779d){return db['CmCompany']['describe']()[_0x4273('0x24')](respondWithResult(_0x57779d,null))['catch'](handleError(_0x57779d,null));};exports[_0x4273('0x4f')]=function(_0x51bd98,_0x125855,_0x42e195){return db[_0x4273('0x50')][_0x4273('0x48')]({'where':{'id':_0x51bd98[_0x4273('0x46')]['id']}})[_0x4273('0x24')](handleEntityNotFound(_0x125855,null))[_0x4273('0x24')](function(_0x1677da){if(_0x1677da){return _0x1677da[_0x4273('0x4f')](_0x51bd98['body'][_0x4273('0x51')],_['omit'](_0x51bd98[_0x4273('0x4e')],[_0x4273('0x51'),'id'])||{});}})[_0x4273('0x24')](respondWithResult(_0x125855,null))[_0x4273('0x44')](handleError(_0x125855,null));};exports[_0x4273('0x52')]=function(_0xceaec1,_0x6e9cd2,_0x4d6d8d){var _0x3b2718={};var _0x292552={};var _0x4665aa;var _0xb5803d;return db[_0x4273('0x3f')][_0x4273('0x53')]({'where':{'id':_0xceaec1[_0x4273('0x46')]['id']}})[_0x4273('0x24')](handleEntityNotFound(_0x6e9cd2,null))[_0x4273('0x24')](function(_0x708608){if(_0x708608){_0x4665aa=_0x708608;_0x292552[_0x4273('0x33')]=_[_0x4273('0x2f')](db['CmContact']['rawAttributes']);_0x292552[_0x4273('0x30')]=_[_0x4273('0x2f')](_0xceaec1[_0x4273('0x30')]);_0x292552[_0x4273('0x31')]=_[_0x4273('0x32')](_0x292552[_0x4273('0x33')],_0x292552[_0x4273('0x30')]);_0x3b2718['attributes']=_[_0x4273('0x32')](_0x292552[_0x4273('0x33')],qs[_0x4273('0x35')](_0xceaec1[_0x4273('0x30')][_0x4273('0x35')]));_0x3b2718['attributes']=_0x3b2718['attributes'][_0x4273('0x36')]?_0x3b2718[_0x4273('0x34')]:_0x292552[_0x4273('0x33')];_0x3b2718['order']=qs[_0x4273('0x54')](_0xceaec1[_0x4273('0x30')][_0x4273('0x54')]);_0x3b2718['where']=qs[_0x4273('0x31')](_[_0x4273('0x3a')](_0xceaec1[_0x4273('0x30')],_0x292552[_0x4273('0x31')]));if(_0xceaec1[_0x4273('0x30')][_0x4273('0x3b')]){_0x3b2718[_0x4273('0x39')]=_[_0x4273('0x3d')](_0x3b2718[_0x4273('0x39')],{'$or':_[_0x4273('0x3c')](_0x3b2718[_0x4273('0x34')],function(_0x5dd798){var _0x4debc3={};_0x4debc3[_0x5dd798]={'$like':'%'+_0xceaec1[_0x4273('0x30')][_0x4273('0x3b')]+'%'};return _0x4debc3;})});}_0x3b2718=_['merge']({},_0x3b2718,_0xceaec1[_0x4273('0x3e')]);return _0x4665aa[_0x4273('0x52')](_0x3b2718);}})[_0x4273('0x24')](function(_0xe2e162){if(_0xe2e162){_0xb5803d=_0xe2e162[_0x4273('0x36')];if(!_0xceaec1[_0x4273('0x30')][_0x4273('0x55')](_0x4273('0x37'))){_0x3b2718[_0x4273('0x1d')]=qs[_0x4273('0x1d')](_0xceaec1[_0x4273('0x30')][_0x4273('0x1d')]);_0x3b2718[_0x4273('0x1b')]=qs['offset'](_0xceaec1[_0x4273('0x30')][_0x4273('0x1b')]);}return _0x4665aa['getContacts'](_0x3b2718);}})['then'](function(_0x224839){if(_0x224839){return _0x224839?{'count':_0xb5803d,'rows':_0x224839}:null;}})[_0x4273('0x24')](respondWithResult(_0x6e9cd2,null))['catch'](handleError(_0x6e9cd2,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index b3668c5..5519746 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 _0xe4d1=['cm_companies','lodash','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','CmCompany'];(function(_0x196d3b,_0x271252){var _0x4bb86d=function(_0x1b6766){while(--_0x1b6766){_0x196d3b['push'](_0x196d3b['shift']());}};_0x4bb86d(++_0x271252);}(_0xe4d1,0x6f));var _0x1e4d=function(_0x20902b,_0x10861b){_0x20902b=_0x20902b-0x0;var _0x492823=_0xe4d1[_0x20902b];return _0x492823;};'use strict';var _=require(_0x1e4d('0x0'));var util=require('util');var logger=require(_0x1e4d('0x1'))(_0x1e4d('0x2'));var moment=require('moment');var BPromise=require(_0x1e4d('0x3'));var rp=require(_0x1e4d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e4d('0x5'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x1e4d('0x6')]=function(_0x32d904,_0x3b4947){return _0x32d904[_0x1e4d('0x7')](_0x1e4d('0x8'),attributes,{'tableName':_0x1e4d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x313a=['../../config/environment','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3c9bfa,_0x45315f){var _0x3389ee=function(_0x223c98){while(--_0x223c98){_0x3c9bfa['push'](_0x3c9bfa['shift']());}};_0x3389ee(++_0x45315f);}(_0x313a,0x1a8));var _0xa313=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x313a[_0x5cab28];return _0xa3554d;};'use strict';var _=require(_0xa313('0x0'));var util=require(_0xa313('0x1'));var logger=require(_0xa313('0x2'))(_0xa313('0x3'));var moment=require(_0xa313('0x4'));var BPromise=require('bluebird');var rp=require(_0xa313('0x5'));var fs=require('fs');var path=require(_0xa313('0x6'));var rimraf=require(_0xa313('0x7'));var config=require(_0xa313('0x8'));var attributes=require('./cmCompany.attributes');module[_0xa313('0x9')]=function(_0x2e1b0d,_0x27d23c){return _0x2e1b0d[_0xa313('0xa')](_0xa313('0xb'),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 4b22973..bd64330 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 _0x6cef=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x50f0b8,_0x326c38){var _0x325121=function(_0x410860){while(--_0x410860){_0x50f0b8['push'](_0x50f0b8['shift']());}};_0x325121(++_0x326c38);}(_0x6cef,0x1f4));var _0xf6ce=function(_0x30ebff,_0x434cc4){_0x30ebff=_0x30ebff-0x0;var _0x421101=_0x6cef[_0x30ebff];return _0x421101;};'use strict';var _=require(_0xf6ce('0x0'));var util=require('util');var moment=require(_0xf6ce('0x1'));var BPromise=require(_0xf6ce('0x2'));var rs=require(_0xf6ce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf6ce('0x4'));var logger=require(_0xf6ce('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf6ce('0x6'));var client=jayson[_0xf6ce('0x7')][_0xf6ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f8811,_0x30a09c,_0x530e4f){return new BPromise(function(_0x2fb1,_0x2258ef){return client[_0xf6ce('0x9')](_0x2f8811,_0x530e4f)[_0xf6ce('0xa')](function(_0x15d242){logger[_0xf6ce('0xb')]('CmCompany,\x20%s,\x20%s',_0x30a09c,'request\x20sent');logger[_0xf6ce('0xc')](_0xf6ce('0xd'),_0x30a09c,_0xf6ce('0xe'),JSON[_0xf6ce('0xf')](_0x15d242));if(_0x15d242[_0xf6ce('0x10')]){if(_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x11')]===0x1f4){logger['error'](_0xf6ce('0x12'),_0x30a09c,_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x13')]);return _0x2258ef(_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x13')]);}logger[_0xf6ce('0x10')]('CmCompany,\x20%s,\x20%s',_0x30a09c,_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x13')]);return _0x2fb1(_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x13')]);}else{logger[_0xf6ce('0xb')](_0xf6ce('0x12'),_0x30a09c,'request\x20sent');_0x2fb1(_0x15d242['result'][_0xf6ce('0x13')]);}})[_0xf6ce('0x14')](function(_0x1f19cf){logger[_0xf6ce('0x10')]('CmCompany,\x20%s,\x20%s',_0x30a09c,_0x1f19cf);_0x2258ef(_0x1f19cf);});});} \ No newline at end of file +var _0xc789=['client','http','request','then','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','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);}(_0xc789,0xde));var _0x9c78=function(_0x4c3b3a,_0x1100c5){_0x4c3b3a=_0x4c3b3a-0x0;var _0x4ab118=_0xc789[_0x4c3b3a];return _0x4ab118;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c78('0x0'));var BPromise=require(_0x9c78('0x1'));var rs=require(_0x9c78('0x2'));var fs=require('fs');var Redis=require(_0x9c78('0x3'));var db=require(_0x9c78('0x4'))['db'];var utils=require(_0x9c78('0x5'));var logger=require(_0x9c78('0x6'))(_0x9c78('0x7'));var config=require(_0x9c78('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c78('0x9')][_0x9c78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fb0b4,_0x236e6d,_0x4fdc09){return new BPromise(function(_0x7e8224,_0x52912f){return client[_0x9c78('0xb')](_0x1fb0b4,_0x4fdc09)[_0x9c78('0xc')](function(_0x3f7d97){logger['info']('CmCompany,\x20%s,\x20%s',_0x236e6d,_0x9c78('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x236e6d,'request\x20sent',JSON[_0x9c78('0xe')](_0x3f7d97));if(_0x3f7d97[_0x9c78('0xf')]){if(_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x10')]===0x1f4){logger[_0x9c78('0xf')](_0x9c78('0x11'),_0x236e6d,_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x12')]);return _0x52912f(_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x12')]);}logger[_0x9c78('0xf')](_0x9c78('0x11'),_0x236e6d,_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x12')]);return _0x7e8224(_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x12')]);}else{logger['info'](_0x9c78('0x11'),_0x236e6d,_0x9c78('0xd'));_0x7e8224(_0x3f7d97[_0x9c78('0x13')]['message']);}})[_0x9c78('0x14')](function(_0xb424b){logger[_0x9c78('0xf')](_0x9c78('0x11'),_0x236e6d,_0xb424b);_0x52912f(_0xb424b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d1c979d..5fd9c93 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 _0xb022=['index','/describe','describe','/:id','/:id/contacts','post','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0xb022,0xf4));var _0x2b02=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb022[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x2b02('0x0'));var util=require(_0x2b02('0x1'));var path=require('path');var timeout=require(_0x2b02('0x2'));var express=require('express');var router=express[_0x2b02('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b02('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2b02('0x5'));var controller=require('./cmCompany.controller');router[_0x2b02('0x6')]('/',auth[_0x2b02('0x7')](),controller[_0x2b02('0x8')]);router[_0x2b02('0x6')](_0x2b02('0x9'),auth[_0x2b02('0x7')](),controller[_0x2b02('0xa')]);router[_0x2b02('0x6')](_0x2b02('0xb'),auth[_0x2b02('0x7')](),controller['show']);router[_0x2b02('0x6')](_0x2b02('0xc'),auth['isAuthenticated'](),controller['getContacts']);router[_0x2b02('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2b02('0xc'),auth[_0x2b02('0x7')](),controller['addContacts']);router[_0x2b02('0xe')](_0x2b02('0xb'),auth[_0x2b02('0x7')](),controller[_0x2b02('0xf')]);router[_0x2b02('0x10')](_0x2b02('0xb'),auth[_0x2b02('0x7')](),controller[_0x2b02('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc2e2=['show','/:id/contacts','getContacts','post','create','put','destroy','exports','util','path','Router','../../config/environment','./cmCompany.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x522a1f,_0x5edd41){var _0x34a139=function(_0x4f98e1){while(--_0x4f98e1){_0x522a1f['push'](_0x522a1f['shift']());}};_0x34a139(++_0x5edd41);}(_0xc2e2,0x194));var _0x2c2e=function(_0x24d5fd,_0x59869a){_0x24d5fd=_0x24d5fd-0x0;var _0x4b6b86=_0xc2e2[_0x24d5fd];return _0x4b6b86;};'use strict';var multer=require('multer');var util=require(_0x2c2e('0x0'));var path=require(_0x2c2e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c2e('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c2e('0x3'));var controller=require(_0x2c2e('0x4'));router['get']('/',auth[_0x2c2e('0x5')](),controller['index']);router[_0x2c2e('0x6')](_0x2c2e('0x7'),auth[_0x2c2e('0x5')](),controller[_0x2c2e('0x8')]);router[_0x2c2e('0x6')](_0x2c2e('0x9'),auth[_0x2c2e('0x5')](),controller[_0x2c2e('0xa')]);router['get'](_0x2c2e('0xb'),auth[_0x2c2e('0x5')](),controller[_0x2c2e('0xc')]);router[_0x2c2e('0xd')]('/',auth[_0x2c2e('0x5')](),controller[_0x2c2e('0xe')]);router[_0x2c2e('0xd')](_0x2c2e('0xb'),auth[_0x2c2e('0x5')](),controller['addContacts']);router[_0x2c2e('0xf')](_0x2c2e('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2c2e('0x10')]);module[_0x2c2e('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index e789557..e08e788 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 _0x0f00=['STRING','TEXT','INTEGER','UNSIGNED','lodash','exports'];(function(_0x2ffbce,_0x3b242d){var _0xd8005b=function(_0x567e42){while(--_0x567e42){_0x2ffbce['push'](_0x2ffbce['shift']());}};_0xd8005b(++_0x3b242d);}(_0x0f00,0x106));var _0x00f0=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x0f00[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x00f0('0x0'));var Sequelize=require('sequelize');module[_0x00f0('0x1')]={'firstName':{'type':Sequelize[_0x00f0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x00f0('0x2')]},'postalCode':{'type':Sequelize[_0x00f0('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x00f0('0x2')]},'description':{'type':Sequelize[_0x00f0('0x3')]},'phone':{'type':Sequelize[_0x00f0('0x2')]},'mobile':{'type':Sequelize[_0x00f0('0x2')]},'fax':{'type':Sequelize[_0x00f0('0x2')]},'email':{'type':Sequelize[_0x00f0('0x2')]},'url':{'type':Sequelize[_0x00f0('0x2')]},'facebook':{'type':Sequelize[_0x00f0('0x2')]},'fb_data':{'type':Sequelize[_0x00f0('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x00f0('0x2')]},'viber':{'type':Sequelize[_0x00f0('0x2')]},'line':{'type':Sequelize[_0x00f0('0x2')]},'wechat':{'type':Sequelize[_0x00f0('0x2')]},'telegram':{'type':Sequelize[_0x00f0('0x2')]},'UserId':{'type':Sequelize[_0x00f0('0x4')]},'priority':{'type':Sequelize[_0x00f0('0x4')](0x2)[_0x00f0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xfa84=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x529a0f,_0x328763){var _0x187a88=function(_0x1ea706){while(--_0x1ea706){_0x529a0f['push'](_0x529a0f['shift']());}};_0x187a88(++_0x328763);}(_0xfa84,0x1d8));var _0x4fa8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfa84[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x4fa8('0x0'));var Sequelize=require(_0x4fa8('0x1'));module[_0x4fa8('0x2')]={'firstName':{'type':Sequelize[_0x4fa8('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4fa8('0x3')]},'street':{'type':Sequelize[_0x4fa8('0x3')]},'postalCode':{'type':Sequelize[_0x4fa8('0x3')]},'city':{'type':Sequelize[_0x4fa8('0x3')]},'country':{'type':Sequelize[_0x4fa8('0x3')]},'dateOfBirth':{'type':Sequelize[_0x4fa8('0x3')]},'description':{'type':Sequelize[_0x4fa8('0x4')]},'phone':{'type':Sequelize[_0x4fa8('0x3')]},'mobile':{'type':Sequelize[_0x4fa8('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x4fa8('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x4fa8('0x3')]},'twitter':{'type':Sequelize[_0x4fa8('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x4fa8('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x4fa8('0x3')]},'telegram':{'type':Sequelize[_0x4fa8('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x4fa8('0x5')](0x2)[_0x4fa8('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4fa8('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 20ca35e..bce40a7 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 _0x42d6=['create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','Tags','$and','findAll','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','values','phone','findOne','rawAttributes','pick','options','getTags','setTags','ids','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','No\x20phone\x20column\x20specified','firstName','root','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','path','binding','No\x20firstName\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','UserId','fullname','findAndCountAll','startCase','Account','closed','closedAt','disposition','thirdDisposition','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./cmContact.socket','register','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','all','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','datetime','castTo','buildExpression','text','start','filter','isNil','Contact','ListId','c.ListId\x20IN\x20?','isArray','tag','replace','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','isEmpty','having','resolve','agent','some','User','user','getLists','c.ListId\x20IS\x20NULL','role','toString','sequelize','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','rows','catch','destroy','params','tags','displayName','columnName','alias','custom','type','body','get','mergeWith','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s'];(function(_0x5afd4f,_0x57ecf0){var _0xeb22c9=function(_0x56bbb0){while(--_0x56bbb0){_0x5afd4f['push'](_0x5afd4f['shift']());}};_0xeb22c9(++_0x57ecf0);}(_0x42d6,0x1aa));var _0x642d=function(_0x17d8c8,_0x52a21b){_0x17d8c8=_0x17d8c8-0x0;var _0x3320b5=_0x42d6[_0x17d8c8];return _0x3320b5;};'use strict';var emlformat=require(_0x642d('0x0'));var rimraf=require(_0x642d('0x1'));var zipdir=require(_0x642d('0x2'));var jsonpatch=require(_0x642d('0x3'));var rp=require('request-promise');var moment=require(_0x642d('0x4'));var BPromise=require(_0x642d('0x5'));var Mustache=require(_0x642d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x642d('0x7'));var ejs=require(_0x642d('0x8'));var fs=require('fs');var fs_extra=require(_0x642d('0x9'));var _=require(_0x642d('0xa'));var squel=require(_0x642d('0xb'));var crypto=require(_0x642d('0xc'));var jsforce=require(_0x642d('0xd'));var deskjs=require(_0x642d('0xe'));var toCsv=require(_0x642d('0x7'));var querystring=require(_0x642d('0xf'));var Papa=require(_0x642d('0x10'));var Redis=require(_0x642d('0x11'));var authService=require(_0x642d('0x12'));var qs=require(_0x642d('0x13'));var as=require(_0x642d('0x14'));var hardwareService=require(_0x642d('0x15'));var logger=require('../../config/logger')(_0x642d('0x16'));var utils=require('../../config/utils');var config=require(_0x642d('0x17'));var licenseUtil=require(_0x642d('0x18'));var db=require(_0x642d('0x19'))['db'];config['redis']=_[_0x642d('0x1a')](config['redis'],{'host':_0x642d('0x1b'),'port':0x18eb});var socket=require(_0x642d('0x1c'))(new Redis(config[_0x642d('0x1d')]));require(_0x642d('0x1e'))[_0x642d('0x1f')](socket);function respondWithStatusCode(_0xcbb7e0,_0x390b06){_0x390b06=_0x390b06||0xcc;return function(_0x909ae7){if(_0x909ae7){return _0xcbb7e0[_0x642d('0x20')](_0x390b06);}return _0xcbb7e0[_0x642d('0x21')](_0x390b06)[_0x642d('0x22')]();};}function respondWithResult(_0x7ad816,_0x2d4900){_0x2d4900=_0x2d4900||0xc8;return function(_0x5ddfb7){if(_0x5ddfb7){return _0x7ad816[_0x642d('0x21')](_0x2d4900)['json'](_0x5ddfb7);}};}function respondWithFilteredResult(_0x8de7db,_0x1f2f70){return function(_0x4fa778){if(_0x4fa778){var _0x5ad548=typeof _0x1f2f70['offset']===_0x642d('0x23')&&typeof _0x1f2f70[_0x642d('0x24')]==='undefined';var _0x55afec=_0x4fa778[_0x642d('0x25')];var _0x10a61f=_0x5ad548?0x0:_0x1f2f70['offset'];var _0x58e22a=_0x5ad548?_0x4fa778[_0x642d('0x25')]:_0x1f2f70[_0x642d('0x26')]+_0x1f2f70[_0x642d('0x24')];var _0x5c76ae;if(_0x58e22a>=_0x55afec){_0x58e22a=_0x55afec;_0x5c76ae=0xc8;}else{_0x5c76ae=0xce;}_0x8de7db[_0x642d('0x21')](_0x5c76ae);return _0x8de7db['set'](_0x642d('0x27'),_0x10a61f+'-'+_0x58e22a+'/'+_0x55afec)[_0x642d('0x28')](_0x4fa778);}return null;};}function patchUpdates(_0x2aecf9){return function(_0x44af82){try{jsonpatch[_0x642d('0x29')](_0x44af82,_0x2aecf9,!![]);}catch(_0x2c183b){return BPromise[_0x642d('0x2a')](_0x2c183b);}return _0x44af82[_0x642d('0x2b')]();};}function saveUpdates(_0x4c3cfe,_0x296912){return function(_0x5d2753){if(_0x5d2753){return _0x5d2753[_0x642d('0x2c')](_0x4c3cfe)['then'](function(_0x40ce3d){return _0x40ce3d;});}return null;};}function removeEntity(_0x8944,_0xbd03f4){return function(_0x300df0){if(_0x300df0){return _0x300df0['destroy']()[_0x642d('0x2d')](function(){_0x8944['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x608cf4,_0x49c469){return function(_0x4f6e8a){if(!_0x4f6e8a){_0x608cf4[_0x642d('0x20')](0x194);}return _0x4f6e8a;};}function handleError(_0x5200f5,_0x9d024e){_0x9d024e=_0x9d024e||0x1f4;return function(_0x3d7cb8){logger[_0x642d('0x2e')](_0x3d7cb8[_0x642d('0x2f')]);if(_0x3d7cb8[_0x642d('0x30')]){delete _0x3d7cb8[_0x642d('0x30')];}_0x5200f5['status'](_0x9d024e)[_0x642d('0x31')](_0x3d7cb8);};}exports[_0x642d('0x32')]=function(_0x5af8b3,_0x4c5f80){var _0x2602db={},_0xe1c93={},_0x55640b={'count':0x0,'rows':[]};return db[_0x642d('0x33')][_0x642d('0x34')]()['then'](function(_0x2c5f43){var _0x4b5002=[];for(var _0x264427=0x0;_0x2644270x1){_0x58600b['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x642d('0x6f')](_0x291d4b),null);}else{if(qs['isNumeric'](_0x291d4b)){_0x58600b['or'](_0x642d('0x70'),_0x291d4b+'%');_0x58600b['or'](_0x642d('0x71'),_0x291d4b+'%');_0x58600b['or'](_0x642d('0x72'),_0x291d4b+'%');_0x58600b['or']('c.fax\x20LIKE\x20?',_0x291d4b+'%');}else if(qs['isEmail'](_0x291d4b)){_0x58600b['or']('c.email\x20LIKE\x20?',_0x291d4b+'%');}else{_0x58600b['or'](_0x642d('0x73'),'%'+_0x291d4b+'%');_0x58600b['or'](_0x642d('0x74'),'%'+_0x291d4b+'%');_0x58600b['or'](_0x642d('0x75'),'%'+_0x291d4b+'%');}}}}_0x460fde[_0x642d('0x47')](_0x58600b);_0x460fde[_0x642d('0x76')](_0x642d('0x77'));var _0x433a23={'type':db[_0x642d('0x78')][_0x642d('0x79')][_0x642d('0x7a')],'raw':!![]};var _0xd6dc4e=_0x460fde[_0x642d('0x7b')]()[_0x642d('0x49')]('c.id');if(_0x2602db[_0x642d('0x45')]){_0x2602db[_0x642d('0x45')][_0x642d('0x5d')](function(_0x5d897b){_0x460fde[_0x642d('0x45')]('c.'+_0x5d897b[0x0],_0x5d897b[0x1]===_0x642d('0x7c')?![]:!![]);});}if(!_[_0x642d('0x7d')](_0x41d19b)){_0x460fde[_0x642d('0x7e')](_0x18918b);_0xd6dc4e[_0x642d('0x47')]('t.id\x20IN\x20?',_0x41d19b);}BPromise[_0x642d('0x7f')]()[_0x642d('0x2d')](function(){if(!_0x6d2005)return;if(_0x5af8b3['user']['role']!==_0x642d('0x80'))return;if(!_[_0x642d('0x81')](_0x6d2005[_0x642d('0x57')],[_0x642d('0x49'),_0x642d('0x82')])){return _0x5af8b3[_0x642d('0x83')][_0x642d('0x84')]({'attributes':['id'],'raw':!![]})[_0x642d('0x2d')](function(_0x161510){if(_[_0x642d('0x7d')](_0x161510)){_0xd6dc4e[_0x642d('0x47')](_0x642d('0x85'));_0x460fde[_0x642d('0x47')](_0x642d('0x85'));}else{_0xd6dc4e[_0x642d('0x47')]('c.ListId\x20IN\x20?',_[_0x642d('0x5c')](_0x161510,'id'));_0x460fde['where'](_0x642d('0x6b'),_[_0x642d('0x5c')](_0x161510,'id'));}});}})[_0x642d('0x2d')](function(){if(_0x5af8b3[_0x642d('0x83')][_0x642d('0x86')]===_0x642d('0x80')&&!_0x6d2005&&!_0x5af8b3[_0x642d('0x3e')]['ListId'])return[];return db['sequelize']['query'](_0xd6dc4e[_0x642d('0x87')](),_0x433a23);})['then'](function(_0x3b599b){_0x55640b[_0x642d('0x25')]=_0x3b599b[_0x642d('0x36')];if(_0x55640b[_0x642d('0x25')]===0x0)return[];return db[_0x642d('0x88')][_0x642d('0x3e')](_0x3e7fe8[_0x642d('0x87')](),_0x433a23)['then'](function(_0x2f0751){_0x3d6ac4=_['keyBy'](_0x2f0751,'id');_0x433a23=_[_0x642d('0x89')](_0x433a23,{'model':db[_0x642d('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5af8b3[_0x642d('0x3e')][_0x642d('0x41')]){_0x2602db['attributes'][_0x642d('0x5d')](function(_0x342f3c){_0x460fde['field']('c.'+_0x342f3c);});}else{_0x460fde[_0x642d('0x49')](_0x642d('0x77'));_0x460fde[_0x642d('0x49')](_0x642d('0x8a'));_0x460fde[_0x642d('0x49')]('c.lastName');_0x460fde[_0x642d('0x49')](_0x642d('0x8b'));_0x460fde[_0x642d('0x49')](_0x642d('0x8c'));_0x460fde[_0x642d('0x49')](_0x642d('0x8d'));_0x460fde['field'](_0x642d('0x8e'));_0x460fde['field'](_0x642d('0x8f'));_0x460fde[_0x642d('0x49')]('c.createdAt');_0x460fde[_0x642d('0x49')](_0x642d('0x90'));_0x460fde[_0x642d('0x49')]('c.CompanyId');_0x460fde['field'](_0x642d('0x91'),_0x642d('0x92'));}if(_0x2602db[_0x642d('0x24')])_0x460fde[_0x642d('0x24')](_0x2602db[_0x642d('0x24')]);if(_0x2602db[_0x642d('0x26')])_0x460fde[_0x642d('0x26')](_0x2602db[_0x642d('0x26')]);return db[_0x642d('0x88')]['query'](_0x460fde[_0x642d('0x87')](),_0x433a23);});})[_0x642d('0x2d')](function(_0x5a0a66){_0x5a0a66['forEach'](function(_0x306d7d){if(_0x306d7d[_0x642d('0x92')]){_0x306d7d['Tags']=[];_0x306d7d[_0x642d('0x92')]['split'](',')[_0x642d('0x5d')](function(_0x3b5ec6){_0x306d7d['Tags'][_0x642d('0x39')](_0x3d6ac4[_0x3b5ec6]);});}delete _0x306d7d[_0x642d('0x92')];});_0x55640b[_0x642d('0x93')]=_0x5a0a66;return _0x55640b;})[_0x642d('0x2d')](respondWithFilteredResult(_0x4c5f80,_0x2602db));})[_0x642d('0x94')](handleError(_0x4c5f80,null));};exports[_0x642d('0x95')]=function(_0x137c9,_0x526922){return db['CmContact']['find']({'where':{'id':_0x137c9[_0x642d('0x96')]['id']}})['then'](handleEntityNotFound(_0x526922,null))[_0x642d('0x2d')](removeEntity(_0x526922,null))[_0x642d('0x94')](handleError(_0x526922,null));};exports['describe']=function(_0x1a4c47,_0x1ecb9f){return db[_0x642d('0x33')][_0x642d('0x34')]()[_0x642d('0x2d')](function(_0x44aac6){delete _0x44aac6[_0x642d('0x97')];for(var _0x24de9b=0x0;_0x24de9b=_0x1b5ebc){_0x237133=_0x1b5ebc;_0x542e9e=0xc8;}else{_0x542e9e=0xce;}_0x240b8d['status'](_0x542e9e);return _0x240b8d[_0x3db1('0x22')](_0x3db1('0x23'),_0x6d15ed+'-'+_0x237133+'/'+_0x1b5ebc)[_0x3db1('0x1d')](_0x55d2fa);}return null;};}function patchUpdates(_0x432f6e){return function(_0x2ee44c){try{jsonpatch[_0x3db1('0x24')](_0x2ee44c,_0x432f6e,!![]);}catch(_0x392919){return BPromise[_0x3db1('0x25')](_0x392919);}return _0x2ee44c[_0x3db1('0x26')]();};}function saveUpdates(_0x37070d,_0xd806ed){return function(_0x428919){if(_0x428919){return _0x428919[_0x3db1('0x27')](_0x37070d)[_0x3db1('0x28')](function(_0x361936){return _0x361936;});}return null;};}function removeEntity(_0x24cfa7,_0x5b3ac5){return function(_0x5ccbc4){if(_0x5ccbc4){return _0x5ccbc4[_0x3db1('0x29')]()[_0x3db1('0x28')](function(){_0x24cfa7[_0x3db1('0x1c')](0xcc)[_0x3db1('0x2a')]();});}};}function handleEntityNotFound(_0x2581ff,_0x10ada6){return function(_0x4f7ec0){if(!_0x4f7ec0){_0x2581ff['sendStatus'](0x194);}return _0x4f7ec0;};}function handleError(_0x39aa7c,_0x53a3a3){_0x53a3a3=_0x53a3a3||0x1f4;return function(_0x44ba43){logger['error'](_0x44ba43['stack']);if(_0x44ba43[_0x3db1('0x2b')]){delete _0x44ba43[_0x3db1('0x2b')];}_0x39aa7c[_0x3db1('0x1c')](_0x53a3a3)[_0x3db1('0x2c')](_0x44ba43);};}exports['index']=function(_0x51ca49,_0x1bccd9){var _0x154da2={},_0x552e38={},_0x504de1={'count':0x0,'rows':[]};return db[_0x3db1('0x2d')]['describe']()[_0x3db1('0x28')](function(_0x6dbd6c){var _0x61b3a8=[];for(var _0x14bfa8=0x0;_0x14bfa80x1){_0x5b7e81['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3db1('0x6a')](_0x2bc7fb),null);}else{if(qs[_0x3db1('0x6b')](_0x2bc7fb)){_0x5b7e81['or'](_0x3db1('0x6c'),_0x2bc7fb+'%');_0x5b7e81['or'](_0x3db1('0x6d'),_0x2bc7fb+'%');_0x5b7e81['or'](_0x3db1('0x6e'),_0x2bc7fb+'%');_0x5b7e81['or'](_0x3db1('0x6f'),_0x2bc7fb+'%');}else if(qs[_0x3db1('0x70')](_0x2bc7fb)){_0x5b7e81['or']('c.email\x20LIKE\x20?',_0x2bc7fb+'%');}else{_0x5b7e81['or'](_0x3db1('0x71'),'%'+_0x2bc7fb+'%');_0x5b7e81['or'](_0x3db1('0x72'),'%'+_0x2bc7fb+'%');_0x5b7e81['or']('c.email\x20LIKE\x20?','%'+_0x2bc7fb+'%');}}}}_0x44733a[_0x3db1('0x41')](_0x5b7e81);_0x44733a[_0x3db1('0x73')]('c.id');var _0x1f319f={'type':db[_0x3db1('0x74')][_0x3db1('0x75')]['SELECT'],'raw':!![]};var _0x2e4617=_0x44733a[_0x3db1('0x76')]()['field']('c.id');if(_0x154da2[_0x3db1('0x40')]){_0x154da2[_0x3db1('0x40')][_0x3db1('0x55')](function(_0x5de76b){_0x44733a['order']('c.'+_0x5de76b[0x0],_0x5de76b[0x1]===_0x3db1('0x77')?![]:!![]);});}if(!_[_0x3db1('0x61')](_0x2c51e5)){_0x44733a[_0x3db1('0x78')](_0x2007a9);_0x2e4617[_0x3db1('0x41')]('t.id\x20IN\x20?',_0x2c51e5);}BPromise[_0x3db1('0x79')]()[_0x3db1('0x28')](function(){if(!_0x198cd4)return;if(_0x51ca49['user'][_0x3db1('0x7a')]!==_0x3db1('0x7b'))return;if(!_['some'](_0x198cd4['conditions'],['field',_0x3db1('0x57')])){return _0x51ca49[_0x3db1('0x7c')][_0x3db1('0x7d')]({'attributes':['id'],'raw':!![]})[_0x3db1('0x28')](function(_0x4ba4eb){if(_[_0x3db1('0x61')](_0x4ba4eb)){_0x2e4617[_0x3db1('0x41')]('c.ListId\x20IS\x20NULL');_0x44733a[_0x3db1('0x41')](_0x3db1('0x7e'));}else{_0x2e4617[_0x3db1('0x41')](_0x3db1('0x63'),_[_0x3db1('0x54')](_0x4ba4eb,'id'));_0x44733a[_0x3db1('0x41')]('c.ListId\x20IN\x20?',_[_0x3db1('0x54')](_0x4ba4eb,'id'));}});}})[_0x3db1('0x28')](function(){if(_0x51ca49[_0x3db1('0x7c')]['role']===_0x3db1('0x7b')&&!_0x198cd4&&!_0x51ca49[_0x3db1('0x39')]['ListId'])return[];return db[_0x3db1('0x7f')]['query'](_0x2e4617[_0x3db1('0x80')](),_0x1f319f);})['then'](function(_0x108c7e){_0x504de1[_0x3db1('0x21')]=_0x108c7e[_0x3db1('0x2f')];if(_0x504de1[_0x3db1('0x21')]===0x0)return[];return db[_0x3db1('0x7f')][_0x3db1('0x39')](_0x56783b[_0x3db1('0x80')](),_0x1f319f)[_0x3db1('0x28')](function(_0x58ae22){_0x54b1cb=_['keyBy'](_0x58ae22,'id');_0x1f319f=_[_0x3db1('0x81')](_0x1f319f,{'model':db[_0x3db1('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51ca49[_0x3db1('0x39')]['fields']){_0x154da2['attributes'][_0x3db1('0x55')](function(_0xe4e31){_0x44733a[_0x3db1('0x43')]('c.'+_0xe4e31);});}else{_0x44733a[_0x3db1('0x43')](_0x3db1('0x82'));_0x44733a['field'](_0x3db1('0x83'));_0x44733a[_0x3db1('0x43')](_0x3db1('0x84'));_0x44733a['field'](_0x3db1('0x85'));_0x44733a['field'](_0x3db1('0x86'));_0x44733a['field'](_0x3db1('0x87'));_0x44733a[_0x3db1('0x43')](_0x3db1('0x88'));_0x44733a[_0x3db1('0x43')]('c.ListId');_0x44733a[_0x3db1('0x43')](_0x3db1('0x89'));_0x44733a['field'](_0x3db1('0x8a'));_0x44733a['field'](_0x3db1('0x8b'));_0x44733a[_0x3db1('0x43')](_0x3db1('0x8c'),_0x3db1('0x8d'));}if(_0x154da2[_0x3db1('0x20')])_0x44733a['limit'](_0x154da2[_0x3db1('0x20')]);if(_0x154da2[_0x3db1('0x1e')])_0x44733a['offset'](_0x154da2[_0x3db1('0x1e')]);return db['sequelize'][_0x3db1('0x39')](_0x44733a[_0x3db1('0x80')](),_0x1f319f);});})[_0x3db1('0x28')](function(_0x469119){_0x469119['forEach'](function(_0xce14d5){if(_0xce14d5[_0x3db1('0x8d')]){_0xce14d5[_0x3db1('0x8e')]=[];_0xce14d5[_0x3db1('0x8d')][_0x3db1('0x53')](',')[_0x3db1('0x55')](function(_0x4a9731){_0xce14d5['Tags'][_0x3db1('0x31')](_0x54b1cb[_0x4a9731]);});}delete _0xce14d5[_0x3db1('0x8d')];});_0x504de1[_0x3db1('0x8f')]=_0x469119;return _0x504de1;})[_0x3db1('0x28')](respondWithFilteredResult(_0x1bccd9,_0x154da2));})['catch'](handleError(_0x1bccd9,null));};exports[_0x3db1('0x29')]=function(_0x345ad6,_0x9a9faf){return db['CmContact'][_0x3db1('0x90')]({'where':{'id':_0x345ad6['params']['id']}})[_0x3db1('0x28')](handleEntityNotFound(_0x9a9faf,null))[_0x3db1('0x28')](removeEntity(_0x9a9faf,null))[_0x3db1('0x91')](handleError(_0x9a9faf,null));};exports[_0x3db1('0x92')]=function(_0x5d1e8d,_0x385b14){return db[_0x3db1('0x2d')][_0x3db1('0x92')]()[_0x3db1('0x28')](function(_0x4c1da2){delete _0x4c1da2[_0x3db1('0x93')];for(var _0x492b06=0x0;_0x492b06{}\s\\|]/g,'-');_0x525c36(null,util['format'](_0x88bf('0x1e'),path[_0x88bf('0x1f')](_0x541ca6[_0x88bf('0x1c')],path[_0x88bf('0x20')](_0x541ca6['originalname'])),Date[_0x88bf('0x21')](),path[_0x88bf('0x20')](_0x541ca6[_0x88bf('0x1c')])));}})});router['post'](_0x88bf('0x22'),upload['single'](_0x88bf('0x23')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x508da4,_0x324f81,_0x2521ef){_0x2521ef(null,path['join'](config[_0x88bf('0x1a')],_0x88bf('0x1b')));},'filename':function(_0x6f1cfa,_0x54d6ee,_0x3a413d){_0x54d6ee[_0x88bf('0x1c')]=_0x54d6ee[_0x88bf('0x1c')][_0x88bf('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3a413d(null,util['format']('%s-%s%s',path[_0x88bf('0x1f')](_0x54d6ee[_0x88bf('0x1c')],path[_0x88bf('0x20')](_0x54d6ee[_0x88bf('0x1c')])),Date[_0x88bf('0x21')](),path['extname'](_0x54d6ee[_0x88bf('0x1c')])));}})});router['post'](_0x88bf('0x24'),upload['single'](_0x88bf('0x23')),controller[_0x88bf('0x25')]);router['post']('/upload/:id',auth[_0x88bf('0x6')](),controller[_0x88bf('0x26')]);router[_0x88bf('0x27')](_0x88bf('0x9'),auth[_0x88bf('0x6')](),controller['update']);router[_0x88bf('0x28')](_0x88bf('0x9'),auth[_0x88bf('0x6')](),controller[_0x88bf('0x29')]);module[_0x88bf('0x2a')]=router; \ No newline at end of file +var _0x728b=['post','/merge','merge','create','/create_many','bulkCreate','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','now','/csv','single','file','uploadCsv','extname','upload','/upload/:id','import','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/:id','show','/:id/tags','/:id/hoppers','/:id/hopper_histories','/:id/jscripty_sessions','getJscriptySessions','getJourney'];(function(_0x3af819,_0x69b6c8){var _0x43c6f7=function(_0x5051a8){while(--_0x5051a8){_0x3af819['push'](_0x3af819['shift']());}};_0x43c6f7(++_0x69b6c8);}(_0x728b,0x12f));var _0xb728=function(_0x26d55c,_0xa4c31f){_0x26d55c=_0x26d55c-0x0;var _0xbde6ee=_0x728b[_0x26d55c];return _0xbde6ee;};'use strict';var multer=require(_0xb728('0x0'));var util=require(_0xb728('0x1'));var path=require(_0xb728('0x2'));var timeout=require('connect-timeout');var express=require(_0xb728('0x3'));var router=express[_0xb728('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb728('0x5'));var interaction=require(_0xb728('0x6'));var config=require('../../config/environment');var controller=require(_0xb728('0x7'));router[_0xb728('0x8')]('/',auth[_0xb728('0x9')](),controller[_0xb728('0xa')]);router[_0xb728('0x8')]('/describe',auth[_0xb728('0x9')](),controller['describe']);router[_0xb728('0x8')](_0xb728('0xb'),auth[_0xb728('0x9')](),controller[_0xb728('0xc')]);router[_0xb728('0x8')](_0xb728('0xd'),auth[_0xb728('0x9')](),controller['getTags']);router['get'](_0xb728('0xe'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xb728('0x8')](_0xb728('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router['get']('/:id/hopper_finals',auth[_0xb728('0x9')](),controller['getHopperFinals']);router['get'](_0xb728('0x10'),auth[_0xb728('0x9')](),controller[_0xb728('0x11')]);router[_0xb728('0x8')]('/:id/journey',auth[_0xb728('0x9')](),controller[_0xb728('0x12')]);router[_0xb728('0x13')](_0xb728('0x14'),auth[_0xb728('0x9')](),controller[_0xb728('0x15')]);router[_0xb728('0x13')]('/',auth[_0xb728('0x9')](),controller[_0xb728('0x16')]);router['post'](_0xb728('0x17'),auth[_0xb728('0x9')](),controller[_0xb728('0x18')]);router[_0xb728('0x13')](_0xb728('0xd'),auth['isAuthenticated'](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46b813,_0x18f984,_0x552268){_0x552268(null,path[_0xb728('0x19')](config[_0xb728('0x1a')],_0xb728('0x1b')));},'filename':function(_0x5a6c0a,_0x235404,_0x326563){_0x235404[_0xb728('0x1c')]=_0x235404['originalname'][_0xb728('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x326563(null,util[_0xb728('0x1e')](_0xb728('0x1f'),path[_0xb728('0x20')](_0x235404['originalname'],path['extname'](_0x235404['originalname'])),Date[_0xb728('0x21')](),path['extname'](_0x235404[_0xb728('0x1c')])));}})});router[_0xb728('0x13')](_0xb728('0x22'),upload[_0xb728('0x23')](_0xb728('0x24')),controller[_0xb728('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x23fbac,_0xc691ed,_0x51448f){_0x51448f(null,path['join'](config[_0xb728('0x1a')],'server/files/tmp'));},'filename':function(_0x8a91ad,_0x1e75e6,_0x26ebc5){_0x1e75e6[_0xb728('0x1c')]=_0x1e75e6[_0xb728('0x1c')][_0xb728('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x26ebc5(null,util['format']('%s-%s%s',path[_0xb728('0x20')](_0x1e75e6['originalname'],path['extname'](_0x1e75e6[_0xb728('0x1c')])),Date[_0xb728('0x21')](),path[_0xb728('0x26')](_0x1e75e6['originalname'])));}})});router['post']('/upload',upload[_0xb728('0x23')](_0xb728('0x24')),controller[_0xb728('0x27')]);router['post'](_0xb728('0x28'),auth[_0xb728('0x9')](),controller[_0xb728('0x29')]);router[_0xb728('0x2a')](_0xb728('0xb'),auth[_0xb728('0x9')](),controller['update']);router[_0xb728('0x2b')]('/:id',auth[_0xb728('0x9')](),controller[_0xb728('0x2c')]);module[_0xb728('0x2d')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index dec97aa..8f25719 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 _0x3c9d=['type','values','isArray','BOOLEAN','voice','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name'];(function(_0x5342ff,_0xcba9fb){var _0x285b31=function(_0x527d44){while(--_0x527d44){_0x5342ff['push'](_0x5342ff['shift']());}};_0x285b31(++_0xcba9fb);}(_0x3c9d,0xe9));var _0xd3c9=function(_0x31e11b,_0x22bd4e){_0x31e11b=_0x31e11b-0x0;var _0x1b415a=_0x3c9d[_0x31e11b];return _0x1b415a;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd3c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3c9('0x1')],'get':function(_0x6495d3){return this[_0xd3c9('0x2')](_0xd3c9('0x3'));}},'alias':{'type':Sequelize[_0xd3c9('0x4')],'allowNull':![],'set':function(_0xfcb0dc){this[_0xd3c9('0x5')](_0xd3c9('0x3'),_0xfcb0dc?_0xfcb0dc:this[_0xd3c9('0x2')](_0xd3c9('0x6')));}},'type':{'type':Sequelize[_0xd3c9('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0xd3c9('0x7'))==='select'){return JSON['parse'](this[_0xd3c9('0x2')](_0xd3c9('0x8')));}else{return this[_0xd3c9('0x2')]('values');}},'set':function(_0x522d74){if(Array[_0xd3c9('0x9')](_0x522d74)){this[_0xd3c9('0x5')](_0xd3c9('0x8'),JSON['stringify'](_0x522d74));}else{this[_0xd3c9('0x5')](_0xd3c9('0x8'),_0x522d74);}}},'required':{'type':Sequelize[_0xd3c9('0xa')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd3c9('0xa')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xd3c9('0xb'))}}; \ No newline at end of file +var _0xf8b3=['BOOLEAN','voice','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','name','long','select','values','isArray','stringify'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf8b3,0x15b));var _0x3f8b=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0xf8b3[_0x5471ec];return _0x121d4c;};'use strict';var Sequelize=require(_0x3f8b('0x0'));var _=require(_0x3f8b('0x1'));module[_0x3f8b('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4ce16b){return this[_0x3f8b('0x3')](_0x3f8b('0x4'));}},'alias':{'type':Sequelize[_0x3f8b('0x5')],'allowNull':![],'set':function(_0x99d708){this[_0x3f8b('0x6')](_0x3f8b('0x4'),_0x99d708?_0x99d708:this[_0x3f8b('0x3')](_0x3f8b('0x7')));}},'type':{'type':Sequelize[_0x3f8b('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x3f8b('0x8')),'get':function(){if(this[_0x3f8b('0x3')]('type')===_0x3f8b('0x9')){return JSON['parse'](this['getDataValue'](_0x3f8b('0xa')));}else{return this['getDataValue'](_0x3f8b('0xa'));}},'set':function(_0x411672){if(Array[_0x3f8b('0xb')](_0x411672)){this[_0x3f8b('0x6')](_0x3f8b('0xa'),JSON[_0x3f8b('0xc')](_0x411672));}else{this['setDataValue']('values',_0x411672);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x3f8b('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x3f8b('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index f26340b..107fc13 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 _0x5e5e=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','cm_contacts','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save','update','then','destroy','error','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query'];(function(_0x4e47aa,_0x3ec48f){var _0x25c393=function(_0x5916c7){while(--_0x5916c7){_0x4e47aa['push'](_0x4e47aa['shift']());}};_0x25c393(++_0x3ec48f);}(_0x5e5e,0x7a));var _0xe5e5=function(_0x272477,_0x3070b8){_0x272477=_0x272477-0x0;var _0x53723d=_0x5e5e[_0x272477];return _0x53723d;};'use strict';var emlformat=require(_0xe5e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5e5('0x1'));var jsonpatch=require(_0xe5e5('0x2'));var rp=require('request-promise');var moment=require(_0xe5e5('0x3'));var BPromise=require(_0xe5e5('0x4'));var Mustache=require(_0xe5e5('0x5'));var util=require('util');var path=require(_0xe5e5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5e5('0x7'));var squel=require(_0xe5e5('0x8'));var crypto=require('crypto');var jsforce=require(_0xe5e5('0x9'));var deskjs=require(_0xe5e5('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe5e5('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe5e5('0xc'));var qs=require(_0xe5e5('0xd'));var as=require(_0xe5e5('0xe'));var hardwareService=require(_0xe5e5('0xf'));var logger=require('../../config/logger')(_0xe5e5('0x10'));var utils=require(_0xe5e5('0x11'));var config=require(_0xe5e5('0x12'));var licenseUtil=require(_0xe5e5('0x13'));var db=require(_0xe5e5('0x14'))['db'];function respondWithStatusCode(_0x1e3ef4,_0x5056fc){_0x5056fc=_0x5056fc||0xcc;return function(_0x2efd5a){if(_0x2efd5a){return _0x1e3ef4[_0xe5e5('0x15')](_0x5056fc);}return _0x1e3ef4[_0xe5e5('0x16')](_0x5056fc)[_0xe5e5('0x17')]();};}function respondWithResult(_0x2d905f,_0x415253){_0x415253=_0x415253||0xc8;return function(_0x5ae539){if(_0x5ae539){return _0x2d905f[_0xe5e5('0x16')](_0x415253)[_0xe5e5('0x18')](_0x5ae539);}};}function respondWithFilteredResult(_0x875861,_0x2f061a){return function(_0x294d34){if(_0x294d34){var _0xcad452=typeof _0x2f061a[_0xe5e5('0x19')]==='undefined'&&typeof _0x2f061a[_0xe5e5('0x1a')]==='undefined';var _0x2fcc97=_0x294d34[_0xe5e5('0x1b')];var _0x486557=_0xcad452?0x0:_0x2f061a[_0xe5e5('0x19')];var _0x2d55c4=_0xcad452?_0x294d34[_0xe5e5('0x1b')]:_0x2f061a[_0xe5e5('0x19')]+_0x2f061a['limit'];var _0x5864c6;if(_0x2d55c4>=_0x2fcc97){_0x2d55c4=_0x2fcc97;_0x5864c6=0xc8;}else{_0x5864c6=0xce;}_0x875861[_0xe5e5('0x16')](_0x5864c6);return _0x875861['set'](_0xe5e5('0x1c'),_0x486557+'-'+_0x2d55c4+'/'+_0x2fcc97)[_0xe5e5('0x18')](_0x294d34);}return null;};}function patchUpdates(_0x553d65){return function(_0xa41d30){try{jsonpatch[_0xe5e5('0x1d')](_0xa41d30,_0x553d65,!![]);}catch(_0x1d33e8){return BPromise['reject'](_0x1d33e8);}return _0xa41d30[_0xe5e5('0x1e')]();};}function saveUpdates(_0x4b51fa,_0x5385d9){return function(_0x4cec70){if(_0x4cec70){return _0x4cec70[_0xe5e5('0x1f')](_0x4b51fa)[_0xe5e5('0x20')](function(_0x1c846a){return _0x1c846a;});}return null;};}function removeEntity(_0x4519a4,_0x4c5c7d){return function(_0x32d21a){if(_0x32d21a){return _0x32d21a[_0xe5e5('0x21')]()[_0xe5e5('0x20')](function(){_0x4519a4[_0xe5e5('0x16')](0xcc)[_0xe5e5('0x17')]();});}};}function handleEntityNotFound(_0x18d695,_0x152ad9){return function(_0x233e29){if(!_0x233e29){_0x18d695['sendStatus'](0x194);}return _0x233e29;};}function handleError(_0x4cd75b,_0x53c804){_0x53c804=_0x53c804||0x1f4;return function(_0x593432){logger[_0xe5e5('0x22')](_0x593432['stack']);if(_0x593432['name']){delete _0x593432[_0xe5e5('0x23')];}_0x4cd75b[_0xe5e5('0x16')](_0x53c804)[_0xe5e5('0x24')](_0x593432);};}exports[_0xe5e5('0x25')]=function(_0x56e0c1,_0x7f4ceb){var _0x13f810={},_0x250b59={},_0x3af101={'count':0x0,'rows':[]};var _0x1a3b8d=_['map'](db[_0xe5e5('0x26')][_0xe5e5('0x27')],function(_0x5e5bc2){return{'name':_0x5e5bc2[_0xe5e5('0x28')],'type':_0x5e5bc2[_0xe5e5('0x29')][_0xe5e5('0x2a')]};});_0x250b59[_0xe5e5('0x2b')]=_[_0xe5e5('0x2c')](_['map'](_0x1a3b8d,_0xe5e5('0x23')),[_0xe5e5('0x23')]);_0x250b59[_0xe5e5('0x2d')]=_['keys'](_0x56e0c1[_0xe5e5('0x2d')]);_0x250b59['filters']=_[_0xe5e5('0x2e')](_0x250b59[_0xe5e5('0x2b')],_0x250b59[_0xe5e5('0x2d')]);_0x13f810[_0xe5e5('0x2f')]=_[_0xe5e5('0x2e')](_0x250b59[_0xe5e5('0x2b')],qs['fields'](_0x56e0c1[_0xe5e5('0x2d')][_0xe5e5('0x30')]));_0x13f810['attributes']=_0x13f810[_0xe5e5('0x2f')][_0xe5e5('0x31')]?_0x13f810[_0xe5e5('0x2f')]:_0x250b59[_0xe5e5('0x2b')];if(!_0x56e0c1['query'][_0xe5e5('0x32')](_0xe5e5('0x33'))){_0x13f810[_0xe5e5('0x1a')]=qs[_0xe5e5('0x1a')](_0x56e0c1[_0xe5e5('0x2d')][_0xe5e5('0x1a')]);_0x13f810[_0xe5e5('0x19')]=qs[_0xe5e5('0x19')](_0x56e0c1[_0xe5e5('0x2d')]['offset']);}_0x13f810[_0xe5e5('0x34')]=qs[_0xe5e5('0x35')](_0x56e0c1[_0xe5e5('0x2d')][_0xe5e5('0x35')]);_0x13f810['where']=qs[_0xe5e5('0x36')](_[_0xe5e5('0x37')](_0x56e0c1['query'],_0x250b59[_0xe5e5('0x36')]),_0x1a3b8d);if(_0x56e0c1['query'][_0xe5e5('0x38')]){_0x13f810[_0xe5e5('0x39')]=_[_0xe5e5('0x3a')](_0x13f810[_0xe5e5('0x39')],{'$or':_['map'](_0x1a3b8d,function(_0x216371){if(_0x216371['type']!==_0xe5e5('0x3b')){var _0x33926b={};_0x33926b[_0x216371[_0xe5e5('0x23')]]={'$like':'%'+_0x56e0c1[_0xe5e5('0x2d')][_0xe5e5('0x38')]+'%'};return _0x33926b;}})});}_0x13f810=_['merge']({},_0x13f810,_0x56e0c1[_0xe5e5('0x3c')]);var _0x2267a5={'where':_0x13f810[_0xe5e5('0x39')]};return db['CmCustomField']['count'](_0x2267a5)[_0xe5e5('0x20')](function(_0x51e137){_0x3af101['count']=_0x51e137;if(_0x56e0c1['query']['includeAll']){_0x13f810[_0xe5e5('0x3d')]=[{'all':!![]}];}return db[_0xe5e5('0x26')][_0xe5e5('0x3e')](_0x13f810);})['then'](function(_0xdaf46c){_0x3af101[_0xe5e5('0x3f')]=_0xdaf46c;return _0x3af101;})[_0xe5e5('0x20')](respondWithFilteredResult(_0x7f4ceb,_0x13f810))[_0xe5e5('0x40')](handleError(_0x7f4ceb,null));};exports[_0xe5e5('0x41')]=function(_0x5d0720,_0x37e4d6){var _0x3715cf={'raw':!![],'where':{'id':_0x5d0720['params']['id']}},_0x42baba={};_0x42baba[_0xe5e5('0x2b')]=_[_0xe5e5('0x42')](db[_0xe5e5('0x26')][_0xe5e5('0x27')]);_0x42baba[_0xe5e5('0x2d')]=_[_0xe5e5('0x42')](_0x5d0720[_0xe5e5('0x2d')]);_0x42baba[_0xe5e5('0x36')]=_['intersection'](_0x42baba['model'],_0x42baba[_0xe5e5('0x2d')]);_0x3715cf[_0xe5e5('0x2f')]=_['intersection'](_0x42baba['model'],qs['fields'](_0x5d0720[_0xe5e5('0x2d')]['fields']));_0x3715cf[_0xe5e5('0x2f')]=_0x3715cf[_0xe5e5('0x2f')][_0xe5e5('0x31')]?_0x3715cf[_0xe5e5('0x2f')]:_0x42baba['model'];if(_0x5d0720[_0xe5e5('0x2d')][_0xe5e5('0x43')]){_0x3715cf[_0xe5e5('0x3d')]=[{'all':!![]}];}_0x3715cf=_[_0xe5e5('0x3a')]({},_0x3715cf,_0x5d0720[_0xe5e5('0x3c')]);return db[_0xe5e5('0x26')][_0xe5e5('0x44')](_0x3715cf)['then'](handleEntityNotFound(_0x37e4d6,null))[_0xe5e5('0x20')](respondWithResult(_0x37e4d6,null))[_0xe5e5('0x40')](handleError(_0x37e4d6,null));};exports['update']=function(_0xf5de97,_0x13b745){if(_0xf5de97[_0xe5e5('0x45')]['id']){delete _0xf5de97['body']['id'];}return db[_0xe5e5('0x26')][_0xe5e5('0x44')]({'where':{'id':_0xf5de97['params']['id']}})[_0xe5e5('0x20')](handleEntityNotFound(_0x13b745,null))[_0xe5e5('0x20')](saveUpdates(_0xf5de97['body'],null))[_0xe5e5('0x20')](respondWithResult(_0x13b745,null))[_0xe5e5('0x40')](handleError(_0x13b745,null));};exports[_0xe5e5('0x21')]=function(_0x421c73,_0x1c810a){return db[_0xe5e5('0x26')][_0xe5e5('0x44')]({'where':{'id':_0x421c73[_0xe5e5('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c810a,null))[_0xe5e5('0x20')](removeEntity(_0x1c810a,null))[_0xe5e5('0x40')](handleError(_0x1c810a,null));};exports[_0xe5e5('0x47')]=function(_0x4b47b7,_0x5de065){var _0x21d729;return db[_0xe5e5('0x48')][_0xe5e5('0x49')](function(_0x14b02b){return db[_0xe5e5('0x26')][_0xe5e5('0x47')](_0x4b47b7[_0xe5e5('0x45')],{'transaction':_0x14b02b})[_0xe5e5('0x20')](function(_0x74271){_0x21d729=_0x74271;var _0x4ee304={'type':db[_0xe5e5('0x4a')][_0xe5e5('0x4b')],'transaction':_0x14b02b};switch(_0x4b47b7['body'][_0xe5e5('0x29')]){case _0xe5e5('0x4c'):_0x4ee304[_0xe5e5('0x29')]=db[_0xe5e5('0x4a')]['TEXT'];break;case _0xe5e5('0x4d'):_0x4ee304['type']=db['Sequelize'][_0xe5e5('0x4e')];break;case _0xe5e5('0x4f'):_0x4ee304[_0xe5e5('0x29')]=db['Sequelize'][_0xe5e5('0x50')];_0x4ee304[_0xe5e5('0x51')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0xe5e5('0x52'),util['format'](_0xe5e5('0x53'),_0x21d729['id']),_0x4ee304);})['then'](function(){return _0x21d729;});})[_0xe5e5('0x20')](respondWithResult(_0x5de065,0xc9))[_0xe5e5('0x40')](handleError(_0x5de065,null));}; \ No newline at end of file +var _0x65cd=['pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','include','find','body','params','create','sequelize','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x1a3557,_0x48755b){var _0x5d1ba1=function(_0x2273c0){while(--_0x2273c0){_0x1a3557['push'](_0x1a3557['shift']());}};_0x5d1ba1(++_0x48755b);}(_0x65cd,0x1cc));var _0xd65c=function(_0x3e5608,_0x8b6979){_0x3e5608=_0x3e5608-0x0;var _0x4128d3=_0x65cd[_0x3e5608];return _0x4128d3;};'use strict';var emlformat=require(_0xd65c('0x0'));var rimraf=require(_0xd65c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd65c('0x2'));var moment=require(_0xd65c('0x3'));var BPromise=require(_0xd65c('0x4'));var Mustache=require(_0xd65c('0x5'));var util=require(_0xd65c('0x6'));var path=require(_0xd65c('0x7'));var sox=require('sox');var csv=require(_0xd65c('0x8'));var ejs=require(_0xd65c('0x9'));var fs=require('fs');var fs_extra=require(_0xd65c('0xa'));var _=require(_0xd65c('0xb'));var squel=require(_0xd65c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd65c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd65c('0x8'));var querystring=require(_0xd65c('0xe'));var Papa=require(_0xd65c('0xf'));var Redis=require(_0xd65c('0x10'));var authService=require(_0xd65c('0x11'));var qs=require(_0xd65c('0x12'));var as=require(_0xd65c('0x13'));var hardwareService=require(_0xd65c('0x14'));var logger=require('../../config/logger')(_0xd65c('0x15'));var utils=require(_0xd65c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd65c('0x17'));var db=require(_0xd65c('0x18'))['db'];function respondWithStatusCode(_0x2feddb,_0x29b4b3){_0x29b4b3=_0x29b4b3||0xcc;return function(_0x3bced9){if(_0x3bced9){return _0x2feddb[_0xd65c('0x19')](_0x29b4b3);}return _0x2feddb[_0xd65c('0x1a')](_0x29b4b3)['end']();};}function respondWithResult(_0x6bbab,_0x5d8224){_0x5d8224=_0x5d8224||0xc8;return function(_0x5857c0){if(_0x5857c0){return _0x6bbab[_0xd65c('0x1a')](_0x5d8224)[_0xd65c('0x1b')](_0x5857c0);}};}function respondWithFilteredResult(_0x881a,_0x64376d){return function(_0x59b02e){if(_0x59b02e){var _0x5145ec=typeof _0x64376d['offset']==='undefined'&&typeof _0x64376d[_0xd65c('0x1c')]===_0xd65c('0x1d');var _0x386dfa=_0x59b02e[_0xd65c('0x1e')];var _0x2be688=_0x5145ec?0x0:_0x64376d[_0xd65c('0x1f')];var _0x581d23=_0x5145ec?_0x59b02e[_0xd65c('0x1e')]:_0x64376d[_0xd65c('0x1f')]+_0x64376d[_0xd65c('0x1c')];var _0x51901d;if(_0x581d23>=_0x386dfa){_0x581d23=_0x386dfa;_0x51901d=0xc8;}else{_0x51901d=0xce;}_0x881a[_0xd65c('0x1a')](_0x51901d);return _0x881a['set'](_0xd65c('0x20'),_0x2be688+'-'+_0x581d23+'/'+_0x386dfa)[_0xd65c('0x1b')](_0x59b02e);}return null;};}function patchUpdates(_0x2ff190){return function(_0x19428){try{jsonpatch[_0xd65c('0x21')](_0x19428,_0x2ff190,!![]);}catch(_0x591234){return BPromise[_0xd65c('0x22')](_0x591234);}return _0x19428[_0xd65c('0x23')]();};}function saveUpdates(_0x1f46f3,_0x5d0f05){return function(_0xf760c4){if(_0xf760c4){return _0xf760c4[_0xd65c('0x24')](_0x1f46f3)[_0xd65c('0x25')](function(_0x43a7cd){return _0x43a7cd;});}return null;};}function removeEntity(_0x4f36c6,_0x4ee8a9){return function(_0x3fb5d4){if(_0x3fb5d4){return _0x3fb5d4[_0xd65c('0x26')]()[_0xd65c('0x25')](function(){_0x4f36c6['status'](0xcc)[_0xd65c('0x27')]();});}};}function handleEntityNotFound(_0x460e4f,_0x45eaec){return function(_0x371c48){if(!_0x371c48){_0x460e4f[_0xd65c('0x19')](0x194);}return _0x371c48;};}function handleError(_0x1415a2,_0x4e5382){_0x4e5382=_0x4e5382||0x1f4;return function(_0x1da2d7){logger[_0xd65c('0x28')](_0x1da2d7['stack']);if(_0x1da2d7[_0xd65c('0x29')]){delete _0x1da2d7[_0xd65c('0x29')];}_0x1415a2[_0xd65c('0x1a')](_0x4e5382)[_0xd65c('0x2a')](_0x1da2d7);};}exports['index']=function(_0x1cd73d,_0x1897b7){var _0x4d231e={},_0x17d219={},_0x142233={'count':0x0,'rows':[]};var _0x517113=_[_0xd65c('0x2b')](db[_0xd65c('0x2c')][_0xd65c('0x2d')],function(_0x3796a1){return{'name':_0x3796a1[_0xd65c('0x2e')],'type':_0x3796a1[_0xd65c('0x2f')][_0xd65c('0x30')]};});_0x17d219[_0xd65c('0x31')]=_[_0xd65c('0x32')](_['map'](_0x517113,_0xd65c('0x29')),[_0xd65c('0x29')]);_0x17d219[_0xd65c('0x33')]=_[_0xd65c('0x34')](_0x1cd73d['query']);_0x17d219[_0xd65c('0x35')]=_[_0xd65c('0x36')](_0x17d219[_0xd65c('0x31')],_0x17d219['query']);_0x4d231e[_0xd65c('0x37')]=_['intersection'](_0x17d219[_0xd65c('0x31')],qs['fields'](_0x1cd73d['query'][_0xd65c('0x38')]));_0x4d231e[_0xd65c('0x37')]=_0x4d231e['attributes'][_0xd65c('0x39')]?_0x4d231e[_0xd65c('0x37')]:_0x17d219[_0xd65c('0x31')];if(!_0x1cd73d[_0xd65c('0x33')]['hasOwnProperty'](_0xd65c('0x3a'))){_0x4d231e['limit']=qs[_0xd65c('0x1c')](_0x1cd73d[_0xd65c('0x33')][_0xd65c('0x1c')]);_0x4d231e['offset']=qs[_0xd65c('0x1f')](_0x1cd73d['query'][_0xd65c('0x1f')]);}_0x4d231e[_0xd65c('0x3b')]=qs[_0xd65c('0x3c')](_0x1cd73d[_0xd65c('0x33')][_0xd65c('0x3c')]);_0x4d231e[_0xd65c('0x3d')]=qs[_0xd65c('0x35')](_[_0xd65c('0x3e')](_0x1cd73d[_0xd65c('0x33')],_0x17d219['filters']),_0x517113);if(_0x1cd73d['query']['filter']){_0x4d231e['where']=_[_0xd65c('0x3f')](_0x4d231e[_0xd65c('0x3d')],{'$or':_[_0xd65c('0x2b')](_0x517113,function(_0x37b936){if(_0x37b936[_0xd65c('0x2f')]!==_0xd65c('0x40')){var _0x111947={};_0x111947[_0x37b936[_0xd65c('0x29')]]={'$like':'%'+_0x1cd73d['query'][_0xd65c('0x41')]+'%'};return _0x111947;}})});}_0x4d231e=_[_0xd65c('0x3f')]({},_0x4d231e,_0x1cd73d[_0xd65c('0x42')]);var _0x1ae01b={'where':_0x4d231e[_0xd65c('0x3d')]};return db[_0xd65c('0x2c')][_0xd65c('0x1e')](_0x1ae01b)[_0xd65c('0x25')](function(_0x52f688){_0x142233[_0xd65c('0x1e')]=_0x52f688;if(_0x1cd73d['query'][_0xd65c('0x43')]){_0x4d231e['include']=[{'all':!![]}];}return db[_0xd65c('0x2c')][_0xd65c('0x44')](_0x4d231e);})[_0xd65c('0x25')](function(_0x4c3360){_0x142233[_0xd65c('0x45')]=_0x4c3360;return _0x142233;})[_0xd65c('0x25')](respondWithFilteredResult(_0x1897b7,_0x4d231e))[_0xd65c('0x46')](handleError(_0x1897b7,null));};exports['show']=function(_0x2735fb,_0x867f8a){var _0x3047da={'raw':!![],'where':{'id':_0x2735fb['params']['id']}},_0x314437={};_0x314437[_0xd65c('0x31')]=_[_0xd65c('0x34')](db[_0xd65c('0x2c')][_0xd65c('0x2d')]);_0x314437[_0xd65c('0x33')]=_[_0xd65c('0x34')](_0x2735fb[_0xd65c('0x33')]);_0x314437['filters']=_[_0xd65c('0x36')](_0x314437[_0xd65c('0x31')],_0x314437[_0xd65c('0x33')]);_0x3047da[_0xd65c('0x37')]=_['intersection'](_0x314437['model'],qs[_0xd65c('0x38')](_0x2735fb[_0xd65c('0x33')]['fields']));_0x3047da[_0xd65c('0x37')]=_0x3047da['attributes'][_0xd65c('0x39')]?_0x3047da[_0xd65c('0x37')]:_0x314437[_0xd65c('0x31')];if(_0x2735fb['query']['includeAll']){_0x3047da[_0xd65c('0x47')]=[{'all':!![]}];}_0x3047da=_[_0xd65c('0x3f')]({},_0x3047da,_0x2735fb[_0xd65c('0x42')]);return db[_0xd65c('0x2c')][_0xd65c('0x48')](_0x3047da)[_0xd65c('0x25')](handleEntityNotFound(_0x867f8a,null))[_0xd65c('0x25')](respondWithResult(_0x867f8a,null))[_0xd65c('0x46')](handleError(_0x867f8a,null));};exports[_0xd65c('0x24')]=function(_0x156560,_0x2cb7c2){if(_0x156560[_0xd65c('0x49')]['id']){delete _0x156560[_0xd65c('0x49')]['id'];}return db[_0xd65c('0x2c')][_0xd65c('0x48')]({'where':{'id':_0x156560['params']['id']}})[_0xd65c('0x25')](handleEntityNotFound(_0x2cb7c2,null))[_0xd65c('0x25')](saveUpdates(_0x156560[_0xd65c('0x49')],null))['then'](respondWithResult(_0x2cb7c2,null))[_0xd65c('0x46')](handleError(_0x2cb7c2,null));};exports['destroy']=function(_0xddfb8,_0x212535){return db[_0xd65c('0x2c')]['find']({'where':{'id':_0xddfb8[_0xd65c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x212535,null))[_0xd65c('0x25')](removeEntity(_0x212535,null))[_0xd65c('0x46')](handleError(_0x212535,null));};exports[_0xd65c('0x4b')]=function(_0x23f9fb,_0x3821dd){var _0x332aa7;return db[_0xd65c('0x4c')]['transaction'](function(_0x2deaf4){return db['CmCustomField']['create'](_0x23f9fb['body'],{'transaction':_0x2deaf4})[_0xd65c('0x25')](function(_0x40c003){_0x332aa7=_0x40c003;var _0x576c92={'type':db[_0xd65c('0x4d')][_0xd65c('0x4e')],'transaction':_0x2deaf4};switch(_0x23f9fb[_0xd65c('0x49')][_0xd65c('0x2f')]){case'text':_0x576c92[_0xd65c('0x2f')]=db[_0xd65c('0x4d')]['TEXT'];break;case'number':_0x576c92['type']=db[_0xd65c('0x4d')][_0xd65c('0x4f')];break;case _0xd65c('0x50'):_0x576c92['type']=db['Sequelize'][_0xd65c('0x51')];_0x576c92[_0xd65c('0x52')]=![];break;default:}return db[_0xd65c('0x4c')][_0xd65c('0x53')]['addColumn'](_0xd65c('0x54'),util[_0xd65c('0x55')](_0xd65c('0x56'),_0x332aa7['id']),_0x576c92);})[_0xd65c('0x25')](function(){return _0x332aa7;});})[_0xd65c('0x25')](respondWithResult(_0x3821dd,0xc9))[_0xd65c('0x46')](handleError(_0x3821dd,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 80994c3..b12bfbb 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 _0x9207=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','define','CmCustomField'];(function(_0x29b7f9,_0x3cd5d6){var _0x9f4c71=function(_0x28fd0d){while(--_0x28fd0d){_0x29b7f9['push'](_0x29b7f9['shift']());}};_0x9f4c71(++_0x3cd5d6);}(_0x9207,0x1e0));var _0x7920=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x9207[_0x35d4e9];return _0x5c2770;};'use strict';var _=require('lodash');var util=require(_0x7920('0x0'));var logger=require(_0x7920('0x1'))(_0x7920('0x2'));var moment=require('moment');var BPromise=require(_0x7920('0x3'));var rp=require(_0x7920('0x4'));var fs=require('fs');var path=require(_0x7920('0x5'));var rimraf=require(_0x7920('0x6'));var config=require('../../config/environment');var attributes=require(_0x7920('0x7'));module['exports']=function(_0x22b4e4,_0x484131){return _0x22b4e4[_0x7920('0x8')](_0x7920('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x512d=['../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','path','rimraf'];(function(_0xf53e92,_0x1927ed){var _0x1830c5=function(_0x396f7d){while(--_0x396f7d){_0xf53e92['push'](_0xf53e92['shift']());}};_0x1830c5(++_0x1927ed);}(_0x512d,0xd7));var _0xd512=function(_0x131991,_0x5e4b1f){_0x131991=_0x131991-0x0;var _0x71ebd7=_0x512d[_0x131991];return _0x71ebd7;};'use strict';var _=require(_0xd512('0x0'));var util=require(_0xd512('0x1'));var logger=require(_0xd512('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd512('0x3'));var rimraf=require(_0xd512('0x4'));var config=require(_0xd512('0x5'));var attributes=require('./cmCustomField.attributes');module[_0xd512('0x6')]=function(_0x41d787,_0x2d81d1){return _0x41d787[_0xd512('0x7')](_0xd512('0x8'),attributes,{'tableName':_0xd512('0x9'),'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 a6a6e48..5b145cd 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 _0x9be8=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x57ebd7,_0x20337f){var _0x4ed0b0=function(_0x3e204c){while(--_0x3e204c){_0x57ebd7['push'](_0x57ebd7['shift']());}};_0x4ed0b0(++_0x20337f);}(_0x9be8,0xe9));var _0x89be=function(_0x3aaef5,_0x16cdc8){_0x3aaef5=_0x3aaef5-0x0;var _0x4c0ed5=_0x9be8[_0x3aaef5];return _0x4c0ed5;};'use strict';var _=require(_0x89be('0x0'));var util=require(_0x89be('0x1'));var moment=require(_0x89be('0x2'));var BPromise=require(_0x89be('0x3'));var rs=require(_0x89be('0x4'));var fs=require('fs');var Redis=require(_0x89be('0x5'));var db=require(_0x89be('0x6'))['db'];var utils=require(_0x89be('0x7'));var logger=require(_0x89be('0x8'))('rpc');var config=require(_0x89be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x89be('0xa')][_0x89be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d97f8,_0x53a6a7,_0x5324e7){return new BPromise(function(_0x11e018,_0x1401b8){return client[_0x89be('0xc')](_0x1d97f8,_0x5324e7)[_0x89be('0xd')](function(_0x4b2974){logger['info'](_0x89be('0xe'),_0x53a6a7,'request\x20sent');logger[_0x89be('0xf')](_0x89be('0x10'),_0x53a6a7,_0x89be('0x11'),JSON['stringify'](_0x4b2974));if(_0x4b2974[_0x89be('0x12')]){if(_0x4b2974['error'][_0x89be('0x13')]===0x1f4){logger[_0x89be('0x12')](_0x89be('0xe'),_0x53a6a7,_0x4b2974[_0x89be('0x12')][_0x89be('0x14')]);return _0x1401b8(_0x4b2974[_0x89be('0x12')]['message']);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x53a6a7,_0x4b2974['error'][_0x89be('0x14')]);return _0x11e018(_0x4b2974[_0x89be('0x12')]['message']);}else{logger[_0x89be('0x15')](_0x89be('0xe'),_0x53a6a7,_0x89be('0x11'));_0x11e018(_0x4b2974[_0x89be('0x16')]['message']);}})[_0x89be('0x17')](function(_0x3e3b58){logger[_0x89be('0x12')](_0x89be('0xe'),_0x53a6a7,_0x3e3b58);_0x1401b8(_0x3e3b58);});});} \ No newline at end of file +var _0xc6d1=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','lodash','util','bluebird'];(function(_0x480316,_0x150a37){var _0xf3994c=function(_0x10124e){while(--_0x10124e){_0x480316['push'](_0x480316['shift']());}};_0xf3994c(++_0x150a37);}(_0xc6d1,0x97));var _0x1c6d=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xc6d1[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x1c6d('0x0'));var util=require(_0x1c6d('0x1'));var moment=require('moment');var BPromise=require(_0x1c6d('0x2'));var rs=require(_0x1c6d('0x3'));var fs=require('fs');var Redis=require(_0x1c6d('0x4'));var db=require(_0x1c6d('0x5'))['db'];var utils=require(_0x1c6d('0x6'));var logger=require('../../config/logger')(_0x1c6d('0x7'));var config=require(_0x1c6d('0x8'));var jayson=require(_0x1c6d('0x9'));var client=jayson[_0x1c6d('0xa')][_0x1c6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f9a3d,_0x525ec7,_0x4b1ba2){return new BPromise(function(_0x2da5dc,_0x15dbbc){return client[_0x1c6d('0xc')](_0x4f9a3d,_0x4b1ba2)[_0x1c6d('0xd')](function(_0x22187a){logger['info'](_0x1c6d('0xe'),_0x525ec7,_0x1c6d('0xf'));logger[_0x1c6d('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x525ec7,_0x1c6d('0xf'),JSON[_0x1c6d('0x11')](_0x22187a));if(_0x22187a[_0x1c6d('0x12')]){if(_0x22187a[_0x1c6d('0x12')]['code']===0x1f4){logger[_0x1c6d('0x12')]('CmCustomField,\x20%s,\x20%s',_0x525ec7,_0x22187a[_0x1c6d('0x12')]['message']);return _0x15dbbc(_0x22187a[_0x1c6d('0x12')][_0x1c6d('0x13')]);}logger[_0x1c6d('0x12')](_0x1c6d('0xe'),_0x525ec7,_0x22187a['error']['message']);return _0x2da5dc(_0x22187a[_0x1c6d('0x12')][_0x1c6d('0x13')]);}else{logger[_0x1c6d('0x14')](_0x1c6d('0xe'),_0x525ec7,_0x1c6d('0xf'));_0x2da5dc(_0x22187a['result'][_0x1c6d('0x13')]);}})[_0x1c6d('0x15')](function(_0x105bc1){logger[_0x1c6d('0x12')]('CmCustomField,\x20%s,\x20%s',_0x525ec7,_0x105bc1);_0x15dbbc(_0x105bc1);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index e93cdbc..01302a8 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 _0x22ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','show','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4ce60c,_0x5cf40f){var _0x17c7a6=function(_0x73fd5a){while(--_0x73fd5a){_0x4ce60c['push'](_0x4ce60c['shift']());}};_0x17c7a6(++_0x5cf40f);}(_0x22ed,0x1a9));var _0xd22e=function(_0x115771,_0x1d507c){_0x115771=_0x115771-0x0;var _0x3ede7e=_0x22ed[_0x115771];return _0x3ede7e;};'use strict';var multer=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var path=require(_0xd22e('0x2'));var timeout=require(_0xd22e('0x3'));var express=require(_0xd22e('0x4'));var router=express[_0xd22e('0x5')]();var fs_extra=require(_0xd22e('0x6'));var auth=require(_0xd22e('0x7'));var interaction=require(_0xd22e('0x8'));var config=require(_0xd22e('0x9'));var controller=require(_0xd22e('0xa'));router[_0xd22e('0xb')]('/',auth['isAuthenticated'](),controller[_0xd22e('0xc')]);router[_0xd22e('0xb')]('/:id',auth[_0xd22e('0xd')](),controller[_0xd22e('0xe')]);router['post']('/',auth[_0xd22e('0xd')](),controller['create']);router['put'](_0xd22e('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd22e('0xf'),auth[_0xd22e('0xd')](),controller[_0xd22e('0x10')]);module[_0xd22e('0x11')]=router; \ No newline at end of file +var _0xe364=['put','update','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','post'];(function(_0x228609,_0x58ede1){var _0x50861f=function(_0x2c95e1){while(--_0x2c95e1){_0x228609['push'](_0x228609['shift']());}};_0x50861f(++_0x58ede1);}(_0xe364,0x1c3));var _0x4e36=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0xe364[_0x204eb7];return _0x37e444;};'use strict';var multer=require('multer');var util=require(_0x4e36('0x0'));var path=require(_0x4e36('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e36('0x2'));var router=express['Router']();var fs_extra=require(_0x4e36('0x3'));var auth=require(_0x4e36('0x4'));var interaction=require(_0x4e36('0x5'));var config=require(_0x4e36('0x6'));var controller=require(_0x4e36('0x7'));router[_0x4e36('0x8')]('/',auth[_0x4e36('0x9')](),controller[_0x4e36('0xa')]);router[_0x4e36('0x8')](_0x4e36('0xb'),auth[_0x4e36('0x9')](),controller['show']);router[_0x4e36('0xc')]('/',auth[_0x4e36('0x9')](),controller['create']);router[_0x4e36('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4e36('0xe')]);router[_0x4e36('0xf')](_0x4e36('0xb'),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 1f262a8..92c5ff0 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 _0x2bf9=['moment','sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','BOOLEAN','contactListQueue'];(function(_0x5edf8c,_0x15906a){var _0x3f2201=function(_0x2caa97){while(--_0x2caa97){_0x5edf8c['push'](_0x5edf8c['shift']());}};_0x3f2201(++_0x15906a);}(_0x2bf9,0xfa));var _0x92bf=function(_0x507c81,_0x3e1b56){_0x507c81=_0x507c81-0x0;var _0x368a25=_0x2bf9[_0x507c81];return _0x368a25;};'use strict';var moment=require(_0x92bf('0x0'));var Sequelize=require(_0x92bf('0x1'));module['exports']={'phone':{'type':Sequelize[_0x92bf('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x92bf('0x3')],'defaultValue':moment()[_0x92bf('0x4')](_0x92bf('0x5'))},'countbusyretry':{'type':Sequelize[_0x92bf('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x92bf('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x92bf('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x92bf('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x92bf('0x6')](0x2)[_0x92bf('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x92bf('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x92bf('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x92bf('0x9')},'CampaignId':{'type':Sequelize[_0x92bf('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x92bf('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x92bf('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x92bf('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x92bf('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbcc2=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x486463,_0x1eb7d4){var _0xa99e82=function(_0x1be0db){while(--_0x1be0db){_0x486463['push'](_0x486463['shift']());}};_0xa99e82(++_0x1eb7d4);}(_0xbcc2,0x1e1));var _0x2bcc=function(_0x5252c4,_0x2ce775){_0x5252c4=_0x5252c4-0x0;var _0x17f07b=_0xbcc2[_0x5252c4];return _0x17f07b;};'use strict';var moment=require(_0x2bcc('0x0'));var Sequelize=require(_0x2bcc('0x1'));module[_0x2bcc('0x2')]={'phone':{'type':Sequelize[_0x2bcc('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x2bcc('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x2bcc('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2bcc('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2bcc('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2bcc('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2bcc('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2bcc('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x2bcc('0x6')],'unique':_0x2bcc('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x2bcc('0x8')},'UserId':{'type':Sequelize[_0x2bcc('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x2bcc('0x6')],'unique':_0x2bcc('0x8')},'CampaignId':{'type':Sequelize[_0x2bcc('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2bcc('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2bcc('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 95e4d34..bef5e06 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 _0x31dc=['bluebird','util','path','sox','to-csv','ejs','fs-extra','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','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','CmHopper','fieldName','type','key','model','map','query','keys','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$ne','$eq','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','params','rawAttributes','fields','length','includeAll','options','create','body','find','describe','VoiceQueueId','VoiceQueue','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','phone','queue','ContactId','firstName','lastName','isNil','calleridname','finally','CmContact','getVoiceQueues','outbound','preview','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','YYYY-MM-DD\x20HH:mm:ss','isNumber','entity\x20not\x20found','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x3e510c,_0x294640){var _0x1003f4=function(_0x25aa38){while(--_0x25aa38){_0x3e510c['push'](_0x3e510c['shift']());}};_0x1003f4(++_0x294640);}(_0x31dc,0x1ba));var _0xc31d=function(_0x1eb9db,_0x223c8d){_0x1eb9db=_0x1eb9db-0x0;var _0x10b745=_0x31dc[_0x1eb9db];return _0x10b745;};'use strict';var emlformat=require(_0xc31d('0x0'));var rimraf=require(_0xc31d('0x1'));var zipdir=require(_0xc31d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc31d('0x3'));var moment=require(_0xc31d('0x4'));var BPromise=require(_0xc31d('0x5'));var Mustache=require('mustache');var util=require(_0xc31d('0x6'));var path=require(_0xc31d('0x7'));var sox=require(_0xc31d('0x8'));var csv=require(_0xc31d('0x9'));var ejs=require(_0xc31d('0xa'));var fs=require('fs');var fs_extra=require(_0xc31d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc31d('0xc'));var jsforce=require(_0xc31d('0xd'));var deskjs=require(_0xc31d('0xe'));var toCsv=require(_0xc31d('0x9'));var querystring=require(_0xc31d('0xf'));var Papa=require('papaparse');var Redis=require(_0xc31d('0x10'));var authService=require(_0xc31d('0x11'));var qs=require(_0xc31d('0x12'));var as=require(_0xc31d('0x13'));var hardwareService=require(_0xc31d('0x14'));var logger=require(_0xc31d('0x15'))(_0xc31d('0x16'));var utils=require(_0xc31d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc31d('0x18'))['db'];function respondWithStatusCode(_0x318cf1,_0x26bd09){_0x26bd09=_0x26bd09||0xcc;return function(_0x510405){if(_0x510405){return _0x318cf1[_0xc31d('0x19')](_0x26bd09);}return _0x318cf1[_0xc31d('0x1a')](_0x26bd09)[_0xc31d('0x1b')]();};}function respondWithResult(_0xdce30f,_0xe77139){_0xe77139=_0xe77139||0xc8;return function(_0x4b42d2){if(_0x4b42d2){return _0xdce30f[_0xc31d('0x1a')](_0xe77139)[_0xc31d('0x1c')](_0x4b42d2);}};}function respondWithFilteredResult(_0x37a066,_0x39eeaa){return function(_0x12cf84){if(_0x12cf84){var _0x1e9cdc=typeof _0x39eeaa[_0xc31d('0x1d')]===_0xc31d('0x1e')&&typeof _0x39eeaa[_0xc31d('0x1f')]===_0xc31d('0x1e');var _0x2448e1=_0x12cf84[_0xc31d('0x20')];var _0x541913=_0x1e9cdc?0x0:_0x39eeaa[_0xc31d('0x1d')];var _0x1ce084=_0x1e9cdc?_0x12cf84['count']:_0x39eeaa[_0xc31d('0x1d')]+_0x39eeaa[_0xc31d('0x1f')];var _0x27192e;if(_0x1ce084>=_0x2448e1){_0x1ce084=_0x2448e1;_0x27192e=0xc8;}else{_0x27192e=0xce;}_0x37a066[_0xc31d('0x1a')](_0x27192e);return _0x37a066['set'](_0xc31d('0x21'),_0x541913+'-'+_0x1ce084+'/'+_0x2448e1)[_0xc31d('0x1c')](_0x12cf84);}return null;};}function patchUpdates(_0x2ab3f2){return function(_0x45f91d){try{jsonpatch[_0xc31d('0x22')](_0x45f91d,_0x2ab3f2,!![]);}catch(_0x107a8c){return BPromise['reject'](_0x107a8c);}return _0x45f91d[_0xc31d('0x23')]();};}function saveUpdates(_0x55a6f2,_0x10a6d4){return function(_0x14cad2){if(_0x14cad2){return _0x14cad2[_0xc31d('0x24')](_0x55a6f2)[_0xc31d('0x25')](function(_0xea547a){return _0xea547a;});}return null;};}function removeEntity(_0x43a861,_0x371abf){return function(_0x2f5e7b){if(_0x2f5e7b){return _0x2f5e7b[_0xc31d('0x26')]()[_0xc31d('0x25')](function(){_0x43a861[_0xc31d('0x1a')](0xcc)[_0xc31d('0x1b')]();});}};}function handleEntityNotFound(_0x2a722b,_0x36ebc5){return function(_0x75333b){if(!_0x75333b){_0x2a722b[_0xc31d('0x19')](0x194);}return _0x75333b;};}function handleError(_0xae618c,_0x31a9ec){_0x31a9ec=_0x31a9ec||0x1f4;return function(_0x476342){logger[_0xc31d('0x27')](_0x476342[_0xc31d('0x28')]);if(_0x476342[_0xc31d('0x29')]){delete _0x476342[_0xc31d('0x29')];}_0xae618c[_0xc31d('0x1a')](_0x31a9ec)[_0xc31d('0x2a')](_0x476342);};}exports[_0xc31d('0x2b')]=function(_0x161f9f,_0x543654){var _0x14bafb={},_0x46107f={},_0x6d60f3={'count':0x0,'rows':[]};var _0x50aab6=_['map'](db[_0xc31d('0x2c')]['rawAttributes'],function(_0x1c93fb){return{'name':_0x1c93fb[_0xc31d('0x2d')],'type':_0x1c93fb[_0xc31d('0x2e')][_0xc31d('0x2f')]};});_0x46107f[_0xc31d('0x30')]=_[_0xc31d('0x31')](_0x50aab6,'name');_0x46107f[_0xc31d('0x32')]=_[_0xc31d('0x33')](_0x161f9f['query']);_0x46107f['filters']=_[_0xc31d('0x34')](_0x46107f[_0xc31d('0x30')],_0x46107f[_0xc31d('0x32')]);_0x46107f[_0xc31d('0x35')]=_[_0xc31d('0x36')](_0x46107f['filters'],[_0xc31d('0x37'),_0xc31d('0x38'),_0xc31d('0x39'),_0xc31d('0x3a'),_0xc31d('0x3b'),'$lte',_0xc31d('0x3c'),_0xc31d('0x3d'),'$not','$between',_0xc31d('0x3e'),_0xc31d('0x3f'),_0xc31d('0x40'),_0xc31d('0x41'),_0xc31d('0x42'),_0xc31d('0x43'),_0xc31d('0x44'),_0xc31d('0x41'),_0xc31d('0x45'),'$contains',_0xc31d('0x46'),_0xc31d('0x47')]);_0x14bafb[_0xc31d('0x48')]=_[_0xc31d('0x34')](_0x46107f[_0xc31d('0x30')],qs['fields'](_0x161f9f[_0xc31d('0x32')]['fields']));_0x14bafb[_0xc31d('0x48')]=_0x14bafb[_0xc31d('0x48')]['length']?_0x14bafb[_0xc31d('0x48')]:_0x46107f[_0xc31d('0x30')];if(!_0x161f9f[_0xc31d('0x32')][_0xc31d('0x49')](_0xc31d('0x4a'))){_0x14bafb[_0xc31d('0x1f')]=qs[_0xc31d('0x1f')](_0x161f9f[_0xc31d('0x32')][_0xc31d('0x1f')]);_0x14bafb[_0xc31d('0x1d')]=qs[_0xc31d('0x1d')](_0x161f9f[_0xc31d('0x32')]['offset']);}_0x14bafb[_0xc31d('0x4b')]=qs[_0xc31d('0x4c')](_0x161f9f[_0xc31d('0x32')][_0xc31d('0x4c')]);_0x14bafb[_0xc31d('0x4d')]=qs[_0xc31d('0x35')](_['pick'](_0x161f9f[_0xc31d('0x32')],_0x46107f[_0xc31d('0x35')]),_0x50aab6);if(_0x161f9f['query'][_0xc31d('0x4e')]){_0x14bafb[_0xc31d('0x4d')]=_[_0xc31d('0x4f')](_0x14bafb['where'],{'$or':_['map'](_0x50aab6,function(_0x3a68b6){if(_0x3a68b6[_0xc31d('0x2e')]!==_0xc31d('0x50')){var _0x4823d7={};_0x4823d7[_0x3a68b6[_0xc31d('0x29')]]={'$like':'%'+_0x161f9f['query']['filter']+'%'};return _0x4823d7;}})});}_0x14bafb=_[_0xc31d('0x4f')]({},_0x14bafb,_0x161f9f['options']);var _0x4c678b={'where':_0x14bafb[_0xc31d('0x4d')]};return db['CmHopper']['count'](_0x4c678b)[_0xc31d('0x25')](function(_0x454297){_0x6d60f3['count']=_0x454297;if(_0x161f9f[_0xc31d('0x32')]['includeAll']){_0x14bafb['include']=[{'all':!![]}];}return db[_0xc31d('0x2c')][_0xc31d('0x51')](_0x14bafb);})[_0xc31d('0x25')](function(_0xe90cab){_0x6d60f3[_0xc31d('0x52')]=_0xe90cab;return _0x6d60f3;})[_0xc31d('0x25')](respondWithFilteredResult(_0x543654,_0x14bafb))[_0xc31d('0x53')](handleError(_0x543654,null));};exports['show']=function(_0x31a9f,_0x1c0657){var _0xb28ac4={'raw':!![],'where':{'id':_0x31a9f[_0xc31d('0x54')]['id']}},_0x21d24f={};_0x21d24f[_0xc31d('0x30')]=_[_0xc31d('0x33')](db[_0xc31d('0x2c')][_0xc31d('0x55')]);_0x21d24f[_0xc31d('0x32')]=_[_0xc31d('0x33')](_0x31a9f[_0xc31d('0x32')]);_0x21d24f['filters']=_[_0xc31d('0x34')](_0x21d24f[_0xc31d('0x30')],_0x21d24f[_0xc31d('0x32')]);_0xb28ac4[_0xc31d('0x48')]=_[_0xc31d('0x34')](_0x21d24f[_0xc31d('0x30')],qs[_0xc31d('0x56')](_0x31a9f[_0xc31d('0x32')][_0xc31d('0x56')]));_0xb28ac4[_0xc31d('0x48')]=_0xb28ac4[_0xc31d('0x48')][_0xc31d('0x57')]?_0xb28ac4[_0xc31d('0x48')]:_0x21d24f[_0xc31d('0x30')];if(_0x31a9f[_0xc31d('0x32')][_0xc31d('0x58')]){_0xb28ac4['include']=[{'all':!![]}];}_0xb28ac4=_['merge']({},_0xb28ac4,_0x31a9f[_0xc31d('0x59')]);return db[_0xc31d('0x2c')]['find'](_0xb28ac4)['then'](handleEntityNotFound(_0x1c0657,null))[_0xc31d('0x25')](respondWithResult(_0x1c0657,null))['catch'](handleError(_0x1c0657,null));};exports['create']=function(_0x29c992,_0x432ba9){return db[_0xc31d('0x2c')][_0xc31d('0x5a')](_0x29c992[_0xc31d('0x5b')],{})[_0xc31d('0x25')](respondWithResult(_0x432ba9,0xc9))[_0xc31d('0x53')](handleError(_0x432ba9,null));};exports['update']=function(_0x4bee4d,_0xec39ea){if(_0x4bee4d['body']['id']){delete _0x4bee4d[_0xc31d('0x5b')]['id'];}return db[_0xc31d('0x2c')][_0xc31d('0x5c')]({'where':{'id':_0x4bee4d[_0xc31d('0x54')]['id']}})[_0xc31d('0x25')](handleEntityNotFound(_0xec39ea,null))['then'](saveUpdates(_0x4bee4d[_0xc31d('0x5b')],null))[_0xc31d('0x25')](respondWithResult(_0xec39ea,null))[_0xc31d('0x53')](handleError(_0xec39ea,null));};exports[_0xc31d('0x5d')]=function(_0x322de0,_0x4612c7){return db[_0xc31d('0x2c')]['describe']()[_0xc31d('0x25')](respondWithResult(_0x4612c7,null))[_0xc31d('0x53')](handleError(_0x4612c7,null));};exports[_0xc31d('0x26')]=function(_0x23ab47,_0x10d647){var _0x3a4b83;return db[_0xc31d('0x2c')][_0xc31d('0x5c')]({'where':{'id':_0x23ab47[_0xc31d('0x54')]['id']}})[_0xc31d('0x25')](handleEntityNotFound(_0x10d647,null))[_0xc31d('0x25')](function(_0x5c29fd){if(_0x5c29fd){return _0x5c29fd['destroy']()[_0xc31d('0x25')](function(_0x2f8bb1){return _0x2f8bb1;});}})[_0xc31d('0x25')](function(_0x3b8ef2){_0x3a4b83=_0x3b8ef2;if(_0x3b8ef2){if(_0x3b8ef2[_0xc31d('0x5e')]||_0x3b8ef2['CampaignId']){return db[_0x3b8ef2['VoiceQueueId']?_0xc31d('0x5f'):'Campaign'][_0xc31d('0x5c')]({'where':{'id':_0x3b8ef2[_0xc31d('0x5e')]?_0x3b8ef2[_0xc31d('0x5e')]:_0x3b8ef2[_0xc31d('0x60')]},'attributes':['id','name'],'raw':!![]});}}})[_0xc31d('0x25')](function(_0x52a0fb){var _0x4e3fbb={};if(_0x52a0fb){_[_0xc31d('0x4f')](_0x4e3fbb,_[_0xc31d('0x61')](_0x3a4b83[_0xc31d('0x62')],[_0xc31d('0x63'),_0xc31d('0x64'),'id']));_0x4e3fbb[_0xc31d('0x65')]=0x15;_0x4e3fbb[_0xc31d('0x66')]=_0xc31d('0x67');_0x4e3fbb[_0xc31d('0x68')]=_0x52a0fb[_0xc31d('0x29')];_0x4e3fbb[_0xc31d('0x69')]=_0x23ab47[_0xc31d('0x6a')][_0xc31d('0x29')];_0x4e3fbb[_0xc31d('0x6b')]=_0x23ab47[_0xc31d('0x6a')]['id'];_0x4e3fbb[_0xc31d('0x67')]=!![];_0x4e3fbb['deletedat']=moment()[_0xc31d('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e3fbb['calleridnum']=_0x3a4b83[_0xc31d('0x6d')];_0x4e3fbb['campaigntype']=_0x3a4b83['VoiceQueueId']?_0xc31d('0x6e'):'ivr';return db['CmContact'][_0xc31d('0x5c')]({'where':{'id':_0x4e3fbb[_0xc31d('0x6f')]},'attributes':[_0xc31d('0x70'),_0xc31d('0x71')]})[_0xc31d('0x25')](function(_0x5b4433){if(!_[_0xc31d('0x72')](_0x10d647)&&!_[_0xc31d('0x72')](_0x5b4433['firstName'])){_0x4e3fbb[_0xc31d('0x73')]=_0x5b4433[_0xc31d('0x70')];if(!_[_0xc31d('0x72')](_0x5b4433[_0xc31d('0x71')])){_0x4e3fbb[_0xc31d('0x73')]+='\x20'+_0x5b4433['lastName'];}}})[_0xc31d('0x74')](function(){return db['CmHopperFinal'][_0xc31d('0x5a')](_0x4e3fbb);});}})[_0xc31d('0x25')](function(){return _0x10d647[_0xc31d('0x1a')](0xcc)[_0xc31d('0x1b')]();})['catch'](handleError(_0x10d647,null));};exports['getPreview']=function(_0x320096,_0x5755f4,_0x577cb9){var _0x5437e2=[];return db[_0xc31d('0x75')]['describe']()[_0xc31d('0x25')](function(_0x3642eb){_0x5437e2=_[_0xc31d('0x33')](_0x3642eb);return _0x320096[_0xc31d('0x6a')][_0xc31d('0x76')]({'where':{'type':_0xc31d('0x77'),'dialActive':!![],'dialMethod':_0xc31d('0x78')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0xc31d('0x25')](function(_0x51ac2a){if(_0x51ac2a&&_0x51ac2a['length']){return db[_0xc31d('0x79')][_0xc31d('0x7a')](function(_0x4c1ee5){var _0x109bfb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xc31d('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x51ac2a,'id')},'$or':[{'UserId':null},{'UserId':_0x320096[_0xc31d('0x6a')]['id']}]};var _0x1358ab=[];if(_0x320096[_0xc31d('0x5b')][_0xc31d('0x7b')]&&_0x320096['body'][_0xc31d('0x7b')]===_0xc31d('0x7c')){if(!_[_0xc31d('0x7d')](_0x320096[_0xc31d('0x5b')][_0xc31d('0x7e')])){_0x109bfb['id']={'$in':_0x320096[_0xc31d('0x5b')]['hopperIds']};}_0x1358ab=[[_0xc31d('0x7f'),_0xc31d('0x80')],[_0xc31d('0x81'),_0x51ac2a[0x0][_0xc31d('0x82')]==='ASC'?_0xc31d('0x83'):'ASC'],db[_0xc31d('0x79')][_0xc31d('0x84')](_0xc31d('0x85')),['id',_0xc31d('0x83')]];}else{if(!_[_0xc31d('0x7d')](_0x320096['body']['hopperIds'])){_0x109bfb['id']={'$notIn':_0x320096[_0xc31d('0x5b')][_0xc31d('0x7e')]};}_0x1358ab=[['priority',_0xc31d('0x83')],[_0xc31d('0x81'),_0x51ac2a[0x0][_0xc31d('0x82')]],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xc31d('0x80')]];}return db[_0xc31d('0x2c')][_0xc31d('0x86')]({'attributes':['id',_0xc31d('0x87')],'where':_0x109bfb,'order':_0x1358ab,'transaction':_0x4c1ee5,'lock':_0x4c1ee5[_0xc31d('0x88')][_0xc31d('0x89')],'include':[{'model':db[_0xc31d('0x75')],'as':_0xc31d('0x8a'),'attributes':_0x5437e2,'include':[{'model':db[_0xc31d('0x8b')],'as':_0xc31d('0x8c'),'attributes':['id',_0xc31d('0x29')]}]},{'model':db[_0xc31d('0x8d')],'as':_0xc31d('0x8e'),'attributes':['id',_0xc31d('0x29')]},{'model':db['VoiceQueue'],'as':_0xc31d('0x8f'),'attributes':['id',_0xc31d('0x29'),_0xc31d('0x90')]}]})[_0xc31d('0x25')](function(_0x267870){if(_0x267870){return _0x267870[_0xc31d('0x24')]({'UserId':_0x320096[_0xc31d('0x6a')]['id']},{'transaction':_0x4c1ee5});}});});}})[_0xc31d('0x25')](handleEntityNotFound(_0x5755f4,null))[_0xc31d('0x25')](respondWithResult(_0x5755f4,null))[_0xc31d('0x53')](handleError(_0x5755f4,null));};exports[_0xc31d('0x91')]=function(_0x332986,_0x368855,_0x53005e){return _0x332986[_0xc31d('0x6a')]['getVoiceQueues']({'where':{'type':_0xc31d('0x77'),'dialActive':!![],'dialMethod':_0xc31d('0x78')},'attributes':['id'],'raw':!![]})[_0xc31d('0x25')](function(_0x256dbe){if(_0x256dbe&&_0x256dbe['length']){return db[_0xc31d('0x2c')][_0xc31d('0x20')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xc31d('0x6c')](_0xc31d('0x92'))},'VoiceQueueId':{'$in':_['map'](_0x256dbe,'id')},'$or':[{'UserId':null},{'UserId':_0x332986[_0xc31d('0x6a')]['id']}]}});}return 0x0;})[_0xc31d('0x25')](function(_0x34aeef){if(!_[_0xc31d('0x72')](_0x34aeef)&&_[_0xc31d('0x93')](_0x34aeef)){return _0x368855[_0xc31d('0x1a')](0xc8)[_0xc31d('0x1c')]({'contacts':_0x34aeef});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0xc31d('0x91'),0x194,_0xc31d('0x94'));_0x368855['sendStatus'](0x194);}})[_0xc31d('0x53')](handleError(_0x368855,null));}; \ No newline at end of file +var _0x3018=['calleridnum','phone','queue','ContactId','firstName','lastName','isNil','calleridname','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','CmContact','Contact','CmCompany','Company','CmList','List','dialActive','isNumber','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','end','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','keys','query','filters','concat','$and','$or','$gte','$lt','$lte','$ne','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','then','catch','show','params','intersection','fields','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5e8c51,_0x4ee505){var _0x3b8d62=function(_0x33b71c){while(--_0x33b71c){_0x5e8c51['push'](_0x5e8c51['shift']());}};_0x3b8d62(++_0x4ee505);}(_0x3018,0x1d2));var _0x8301=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x3018[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0x8301('0x0'));var rimraf=require(_0x8301('0x1'));var zipdir=require(_0x8301('0x2'));var jsonpatch=require(_0x8301('0x3'));var rp=require('request-promise');var moment=require(_0x8301('0x4'));var BPromise=require(_0x8301('0x5'));var Mustache=require('mustache');var util=require(_0x8301('0x6'));var path=require(_0x8301('0x7'));var sox=require(_0x8301('0x8'));var csv=require(_0x8301('0x9'));var ejs=require(_0x8301('0xa'));var fs=require('fs');var fs_extra=require(_0x8301('0xb'));var _=require(_0x8301('0xc'));var squel=require(_0x8301('0xd'));var crypto=require(_0x8301('0xe'));var jsforce=require(_0x8301('0xf'));var deskjs=require(_0x8301('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8301('0x11'));var Papa=require(_0x8301('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8301('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8301('0x14'));var logger=require('../../config/logger')(_0x8301('0x15'));var utils=require('../../config/utils');var config=require(_0x8301('0x16'));var licenseUtil=require(_0x8301('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cfc87,_0xc712a4){_0xc712a4=_0xc712a4||0xcc;return function(_0x15a276){if(_0x15a276){return _0x4cfc87[_0x8301('0x18')](_0xc712a4);}return _0x4cfc87[_0x8301('0x19')](_0xc712a4)['end']();};}function respondWithResult(_0x555105,_0xcf4e26){_0xcf4e26=_0xcf4e26||0xc8;return function(_0x3b1060){if(_0x3b1060){return _0x555105[_0x8301('0x19')](_0xcf4e26)[_0x8301('0x1a')](_0x3b1060);}};}function respondWithFilteredResult(_0x531dee,_0x3757da){return function(_0x3fb965){if(_0x3fb965){var _0x17ec33=typeof _0x3757da[_0x8301('0x1b')]===_0x8301('0x1c')&&typeof _0x3757da['limit']===_0x8301('0x1c');var _0xec3338=_0x3fb965[_0x8301('0x1d')];var _0x3ea748=_0x17ec33?0x0:_0x3757da[_0x8301('0x1b')];var _0x529e5e=_0x17ec33?_0x3fb965[_0x8301('0x1d')]:_0x3757da[_0x8301('0x1b')]+_0x3757da[_0x8301('0x1e')];var _0x36ea04;if(_0x529e5e>=_0xec3338){_0x529e5e=_0xec3338;_0x36ea04=0xc8;}else{_0x36ea04=0xce;}_0x531dee[_0x8301('0x19')](_0x36ea04);return _0x531dee[_0x8301('0x1f')](_0x8301('0x20'),_0x3ea748+'-'+_0x529e5e+'/'+_0xec3338)[_0x8301('0x1a')](_0x3fb965);}return null;};}function patchUpdates(_0x309128){return function(_0x29ff24){try{jsonpatch['apply'](_0x29ff24,_0x309128,!![]);}catch(_0x272a26){return BPromise['reject'](_0x272a26);}return _0x29ff24[_0x8301('0x21')]();};}function saveUpdates(_0xc4455a,_0x9b5cfc){return function(_0x44a289){if(_0x44a289){return _0x44a289[_0x8301('0x22')](_0xc4455a)['then'](function(_0x3bfeb2){return _0x3bfeb2;});}return null;};}function removeEntity(_0x43660,_0x29ab46){return function(_0x7f994e){if(_0x7f994e){return _0x7f994e['destroy']()['then'](function(){_0x43660['status'](0xcc)[_0x8301('0x23')]();});}};}function handleEntityNotFound(_0x4e529c,_0xadabaf){return function(_0x49c8f7){if(!_0x49c8f7){_0x4e529c[_0x8301('0x18')](0x194);}return _0x49c8f7;};}function handleError(_0x60bc33,_0x4948ef){_0x4948ef=_0x4948ef||0x1f4;return function(_0x480836){logger[_0x8301('0x24')](_0x480836[_0x8301('0x25')]);if(_0x480836[_0x8301('0x26')]){delete _0x480836[_0x8301('0x26')];}_0x60bc33[_0x8301('0x19')](_0x4948ef)[_0x8301('0x27')](_0x480836);};}exports[_0x8301('0x28')]=function(_0x26d583,_0x5a8ed4){var _0x4ddcc5={},_0x23a237={},_0x1ef839={'count':0x0,'rows':[]};var _0x43b197=_[_0x8301('0x29')](db[_0x8301('0x2a')][_0x8301('0x2b')],function(_0x16d490){return{'name':_0x16d490[_0x8301('0x2c')],'type':_0x16d490['type'][_0x8301('0x2d')]};});_0x23a237[_0x8301('0x2e')]=_[_0x8301('0x29')](_0x43b197,_0x8301('0x26'));_0x23a237['query']=_[_0x8301('0x2f')](_0x26d583[_0x8301('0x30')]);_0x23a237['filters']=_['intersection'](_0x23a237[_0x8301('0x2e')],_0x23a237[_0x8301('0x30')]);_0x23a237[_0x8301('0x31')]=_[_0x8301('0x32')](_0x23a237['filters'],[_0x8301('0x33'),_0x8301('0x34'),'$gt',_0x8301('0x35'),_0x8301('0x36'),_0x8301('0x37'),_0x8301('0x38'),'$eq',_0x8301('0x39'),'$between',_0x8301('0x3a'),'$in',_0x8301('0x3b'),_0x8301('0x3c'),_0x8301('0x3d'),_0x8301('0x3e'),_0x8301('0x3f'),_0x8301('0x3c'),_0x8301('0x40'),'$contains','$contained','$any']);_0x4ddcc5['attributes']=_['intersection'](_0x23a237[_0x8301('0x2e')],qs['fields'](_0x26d583[_0x8301('0x30')]['fields']));_0x4ddcc5[_0x8301('0x41')]=_0x4ddcc5[_0x8301('0x41')][_0x8301('0x42')]?_0x4ddcc5[_0x8301('0x41')]:_0x23a237[_0x8301('0x2e')];if(!_0x26d583[_0x8301('0x30')][_0x8301('0x43')](_0x8301('0x44'))){_0x4ddcc5['limit']=qs[_0x8301('0x1e')](_0x26d583[_0x8301('0x30')][_0x8301('0x1e')]);_0x4ddcc5[_0x8301('0x1b')]=qs['offset'](_0x26d583[_0x8301('0x30')]['offset']);}_0x4ddcc5[_0x8301('0x45')]=qs[_0x8301('0x46')](_0x26d583['query'][_0x8301('0x46')]);_0x4ddcc5[_0x8301('0x47')]=qs[_0x8301('0x31')](_[_0x8301('0x48')](_0x26d583[_0x8301('0x30')],_0x23a237[_0x8301('0x31')]),_0x43b197);if(_0x26d583['query'][_0x8301('0x49')]){_0x4ddcc5[_0x8301('0x47')]=_[_0x8301('0x4a')](_0x4ddcc5[_0x8301('0x47')],{'$or':_[_0x8301('0x29')](_0x43b197,function(_0x51d310){if(_0x51d310[_0x8301('0x4b')]!==_0x8301('0x4c')){var _0x47a215={};_0x47a215[_0x51d310[_0x8301('0x26')]]={'$like':'%'+_0x26d583[_0x8301('0x30')][_0x8301('0x49')]+'%'};return _0x47a215;}})});}_0x4ddcc5=_[_0x8301('0x4a')]({},_0x4ddcc5,_0x26d583[_0x8301('0x4d')]);var _0x2896ab={'where':_0x4ddcc5[_0x8301('0x47')]};return db['CmHopper'][_0x8301('0x1d')](_0x2896ab)['then'](function(_0x133838){_0x1ef839['count']=_0x133838;if(_0x26d583[_0x8301('0x30')][_0x8301('0x4e')]){_0x4ddcc5[_0x8301('0x4f')]=[{'all':!![]}];}return db[_0x8301('0x2a')]['findAll'](_0x4ddcc5);})['then'](function(_0x2d52f3){_0x1ef839[_0x8301('0x50')]=_0x2d52f3;return _0x1ef839;})[_0x8301('0x51')](respondWithFilteredResult(_0x5a8ed4,_0x4ddcc5))[_0x8301('0x52')](handleError(_0x5a8ed4,null));};exports[_0x8301('0x53')]=function(_0x3616c6,_0x4b8b94){var _0x42b6e4={'raw':!![],'where':{'id':_0x3616c6[_0x8301('0x54')]['id']}},_0x79fcc1={};_0x79fcc1['model']=_['keys'](db[_0x8301('0x2a')][_0x8301('0x2b')]);_0x79fcc1[_0x8301('0x30')]=_['keys'](_0x3616c6[_0x8301('0x30')]);_0x79fcc1[_0x8301('0x31')]=_[_0x8301('0x55')](_0x79fcc1[_0x8301('0x2e')],_0x79fcc1[_0x8301('0x30')]);_0x42b6e4['attributes']=_[_0x8301('0x55')](_0x79fcc1['model'],qs['fields'](_0x3616c6['query'][_0x8301('0x56')]));_0x42b6e4[_0x8301('0x41')]=_0x42b6e4['attributes']['length']?_0x42b6e4[_0x8301('0x41')]:_0x79fcc1[_0x8301('0x2e')];if(_0x3616c6['query'][_0x8301('0x4e')]){_0x42b6e4[_0x8301('0x4f')]=[{'all':!![]}];}_0x42b6e4=_['merge']({},_0x42b6e4,_0x3616c6['options']);return db['CmHopper'][_0x8301('0x57')](_0x42b6e4)['then'](handleEntityNotFound(_0x4b8b94,null))[_0x8301('0x51')](respondWithResult(_0x4b8b94,null))['catch'](handleError(_0x4b8b94,null));};exports[_0x8301('0x58')]=function(_0x33da8b,_0xbd3946){return db[_0x8301('0x2a')][_0x8301('0x58')](_0x33da8b[_0x8301('0x59')],{})[_0x8301('0x51')](respondWithResult(_0xbd3946,0xc9))['catch'](handleError(_0xbd3946,null));};exports['update']=function(_0x3122ad,_0x4e9ed5){if(_0x3122ad['body']['id']){delete _0x3122ad[_0x8301('0x59')]['id'];}return db[_0x8301('0x2a')][_0x8301('0x57')]({'where':{'id':_0x3122ad['params']['id']}})[_0x8301('0x51')](handleEntityNotFound(_0x4e9ed5,null))[_0x8301('0x51')](saveUpdates(_0x3122ad['body'],null))['then'](respondWithResult(_0x4e9ed5,null))[_0x8301('0x52')](handleError(_0x4e9ed5,null));};exports[_0x8301('0x5a')]=function(_0x171b56,_0x18971d){return db[_0x8301('0x2a')][_0x8301('0x5a')]()[_0x8301('0x51')](respondWithResult(_0x18971d,null))[_0x8301('0x52')](handleError(_0x18971d,null));};exports[_0x8301('0x5b')]=function(_0xd97a57,_0x3814dc){var _0x1fbbef;return db[_0x8301('0x2a')][_0x8301('0x57')]({'where':{'id':_0xd97a57[_0x8301('0x54')]['id']}})[_0x8301('0x51')](handleEntityNotFound(_0x3814dc,null))[_0x8301('0x51')](function(_0x56ff92){if(_0x56ff92){return _0x56ff92[_0x8301('0x5b')]()[_0x8301('0x51')](function(_0xdff6bb){return _0xdff6bb;});}})['then'](function(_0xc7e388){_0x1fbbef=_0xc7e388;if(_0xc7e388){if(_0xc7e388[_0x8301('0x5c')]||_0xc7e388[_0x8301('0x5d')]){return db[_0xc7e388[_0x8301('0x5c')]?_0x8301('0x5e'):_0x8301('0x5f')]['find']({'where':{'id':_0xc7e388[_0x8301('0x5c')]?_0xc7e388[_0x8301('0x5c')]:_0xc7e388[_0x8301('0x5d')]},'attributes':['id',_0x8301('0x26')],'raw':!![]});}}})[_0x8301('0x51')](function(_0x433110){var _0x24b048={};if(_0x433110){_[_0x8301('0x4a')](_0x24b048,_['omit'](_0x1fbbef[_0x8301('0x60')],[_0x8301('0x61'),_0x8301('0x62'),'id']));_0x24b048[_0x8301('0x63')]=0x15;_0x24b048['statedesc']='deleted';_0x24b048['campaign']=_0x433110[_0x8301('0x26')];_0x24b048['membername']=_0xd97a57[_0x8301('0x64')][_0x8301('0x26')];_0x24b048[_0x8301('0x65')]=_0xd97a57[_0x8301('0x64')]['id'];_0x24b048[_0x8301('0x66')]=!![];_0x24b048[_0x8301('0x67')]=moment()[_0x8301('0x68')](_0x8301('0x69'));_0x24b048[_0x8301('0x6a')]=_0x1fbbef[_0x8301('0x6b')];_0x24b048['campaigntype']=_0x1fbbef[_0x8301('0x5c')]?_0x8301('0x6c'):'ivr';return db['CmContact'][_0x8301('0x57')]({'where':{'id':_0x24b048[_0x8301('0x6d')]},'attributes':[_0x8301('0x6e'),_0x8301('0x6f')]})[_0x8301('0x51')](function(_0x735484){if(!_[_0x8301('0x70')](_0x3814dc)&&!_['isNil'](_0x735484[_0x8301('0x6e')])){_0x24b048[_0x8301('0x71')]=_0x735484[_0x8301('0x6e')];if(!_[_0x8301('0x70')](_0x735484['lastName'])){_0x24b048['calleridname']+='\x20'+_0x735484[_0x8301('0x6f')];}}})['finally'](function(){return db['CmHopperFinal']['create'](_0x24b048);});}})['then'](function(){return _0x3814dc[_0x8301('0x19')](0xcc)['end']();})[_0x8301('0x52')](handleError(_0x3814dc,null));};exports['getPreview']=function(_0x5e38bc,_0x2099ff,_0x441d21){var _0xcc56ac=[];return db['CmContact']['describe']()[_0x8301('0x51')](function(_0x5602bf){_0xcc56ac=_[_0x8301('0x2f')](_0x5602bf);return _0x5e38bc[_0x8301('0x64')][_0x8301('0x72')]({'where':{'type':_0x8301('0x73'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x8301('0x74')],'raw':!![]});})[_0x8301('0x51')](function(_0xd7fecf){if(_0xd7fecf&&_0xd7fecf[_0x8301('0x42')]){return db[_0x8301('0x75')][_0x8301('0x76')](function(_0x5c6161){var _0x57a1a5={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x8301('0x69'))},'VoiceQueueId':{'$in':_['map'](_0xd7fecf,'id')},'$or':[{'UserId':null},{'UserId':_0x5e38bc[_0x8301('0x64')]['id']}]};var _0x2e2f6b=[];if(_0x5e38bc[_0x8301('0x59')][_0x8301('0x77')]&&_0x5e38bc[_0x8301('0x59')][_0x8301('0x77')]===_0x8301('0x78')){if(!_[_0x8301('0x79')](_0x5e38bc[_0x8301('0x59')][_0x8301('0x7a')])){_0x57a1a5['id']={'$in':_0x5e38bc[_0x8301('0x59')]['hopperIds']};}_0x2e2f6b=[[_0x8301('0x7b'),'ASC'],[_0x8301('0x7c'),_0xd7fecf[0x0][_0x8301('0x74')]===_0x8301('0x7d')?_0x8301('0x7e'):_0x8301('0x7d')],db[_0x8301('0x75')][_0x8301('0x7f')](_0x8301('0x80')),['id',_0x8301('0x7e')]];}else{if(!_[_0x8301('0x79')](_0x5e38bc[_0x8301('0x59')][_0x8301('0x7a')])){_0x57a1a5['id']={'$notIn':_0x5e38bc[_0x8301('0x59')][_0x8301('0x7a')]};}_0x2e2f6b=[['priority','DESC'],[_0x8301('0x7c'),_0xd7fecf[0x0][_0x8301('0x74')]],db[_0x8301('0x75')][_0x8301('0x7f')](_0x8301('0x81')),['id','ASC']];}return db['CmHopper']['findOne']({'attributes':['id',_0x8301('0x82')],'where':_0x57a1a5,'order':_0x2e2f6b,'transaction':_0x5c6161,'lock':_0x5c6161[_0x8301('0x83')][_0x8301('0x84')],'include':[{'model':db[_0x8301('0x85')],'as':_0x8301('0x86'),'attributes':_0xcc56ac,'include':[{'model':db[_0x8301('0x87')],'as':_0x8301('0x88'),'attributes':['id',_0x8301('0x26')]}]},{'model':db[_0x8301('0x89')],'as':_0x8301('0x8a'),'attributes':['id',_0x8301('0x26')]},{'model':db[_0x8301('0x5e')],'as':'Queue','attributes':['id',_0x8301('0x26'),_0x8301('0x8b')]}]})[_0x8301('0x51')](function(_0x153192){if(_0x153192){return _0x153192['update']({'UserId':_0x5e38bc['user']['id']},{'transaction':_0x5c6161});}});});}})['then'](handleEntityNotFound(_0x2099ff,null))[_0x8301('0x51')](respondWithResult(_0x2099ff,null))[_0x8301('0x52')](handleError(_0x2099ff,null));};exports['getOpenContacts']=function(_0x310548,_0x1b366e,_0x2e25ea){return _0x310548[_0x8301('0x64')]['getVoiceQueues']({'where':{'type':_0x8301('0x73'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x8301('0x51')](function(_0x33dca4){if(_0x33dca4&&_0x33dca4[_0x8301('0x42')]){return db['CmHopper'][_0x8301('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8301('0x68')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8301('0x29')](_0x33dca4,'id')},'$or':[{'UserId':null},{'UserId':_0x310548[_0x8301('0x64')]['id']}]}});}return 0x0;})[_0x8301('0x51')](function(_0xfc5442){if(!_['isNil'](_0xfc5442)&&_[_0x8301('0x8c')](_0xfc5442)){return _0x1b366e[_0x8301('0x19')](0xc8)[_0x8301('0x1a')]({'contacts':_0xfc5442});}else{logger[_0x8301('0x24')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x8301('0x8d'),0x194,_0x8301('0x8e'));_0x1b366e[_0x8301('0x18')](0x194);}})['catch'](handleError(_0x1b366e,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index dae9e23..fcf6074 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 _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api'];(function(_0x23fd09,_0x51c74c){var _0x5d8176=function(_0x178bc6){while(--_0x178bc6){_0x23fd09['push'](_0x23fd09['shift']());}};_0x5d8176(++_0x51c74c);}(_0x187d,0x93));var _0xd187=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x187d[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]},{'name':_0xd187('0xd'),'fields':['phone']},{'name':_0xd187('0xe'),'fields':[_0xd187('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x188360,_0x3d93f8){var _0x1fbe6d=function(_0x3d9d32){while(--_0x3d9d32){_0x188360['push'](_0x188360['shift']());}};_0x1fbe6d(++_0x3d93f8);}(_0x4975,0x86));var _0x5497=function(_0x2f72fc,_0x2eb9c6){_0x2f72fc=_0x2f72fc-0x0;var _0x469cf9=_0x4975[_0x2f72fc];return _0x469cf9;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['scheduledat']},{'name':_0x5497('0xe'),'fields':['phone']},{'name':_0x5497('0xf'),'fields':[_0x5497('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index aeb0a1e..0fd0e4d 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 _0x85a4=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopper','findAll','options','where','attributes','include','map','model','ShowCmHopper','find','raw','create','CreateCmHopper','UpdateCmHopper','CmHopper','body','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','LOCK','UPDATE','keys','User','name','voicePause','length','UserId','push','update','includes','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','GetContactRecallMe','transaction','Contact','lodash'];(function(_0x5b252d,_0x195d84){var _0x21bdee=function(_0x1b5203){while(--_0x1b5203){_0x5b252d['push'](_0x5b252d['shift']());}};_0x21bdee(++_0x195d84);}(_0x85a4,0xd4));var _0x485a=function(_0x243896,_0x3c2426){_0x243896=_0x243896-0x0;var _0x1d3b05=_0x85a4[_0x243896];return _0x1d3b05;};'use strict';var _=require(_0x485a('0x0'));var util=require(_0x485a('0x1'));var moment=require(_0x485a('0x2'));var BPromise=require(_0x485a('0x3'));var rs=require(_0x485a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x485a('0x5'));var logger=require(_0x485a('0x6'))(_0x485a('0x7'));var config=require(_0x485a('0x8'));var jayson=require(_0x485a('0x9'));var client=jayson['client'][_0x485a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53237f,_0x1b3236,_0x5d141e){return new BPromise(function(_0x2fd90c,_0x47d09c){return client[_0x485a('0xb')](_0x53237f,_0x5d141e)[_0x485a('0xc')](function(_0x8672e6){logger['info'](_0x485a('0xd'),_0x1b3236,_0x485a('0xe'));logger[_0x485a('0xf')](_0x485a('0x10'),_0x1b3236,_0x485a('0xe'),JSON[_0x485a('0x11')](_0x8672e6));if(_0x8672e6[_0x485a('0x12')]){if(_0x8672e6[_0x485a('0x12')][_0x485a('0x13')]===0x1f4){logger[_0x485a('0x12')](_0x485a('0xd'),_0x1b3236,_0x8672e6[_0x485a('0x12')]['message']);return _0x47d09c(_0x8672e6[_0x485a('0x12')]['message']);}logger[_0x485a('0x12')](_0x485a('0xd'),_0x1b3236,_0x8672e6[_0x485a('0x12')][_0x485a('0x14')]);return _0x2fd90c(_0x8672e6[_0x485a('0x12')][_0x485a('0x14')]);}else{logger[_0x485a('0x15')](_0x485a('0xd'),_0x1b3236,_0x485a('0xe'));_0x2fd90c(_0x8672e6[_0x485a('0x16')]['message']);}})[_0x485a('0x17')](function(_0x5f3fbc){logger['error']('CmHopper,\x20%s,\x20%s',_0x1b3236,_0x5f3fbc);_0x47d09c(_0x5f3fbc);});});}exports[_0x485a('0x18')]=function(_0x278dc0){var _0x40fea2=this;return new Promise(function(_0x16ff65,_0x40a515){return db['CmHopper'][_0x485a('0x19')]({'raw':_0x278dc0[_0x485a('0x1a')]?_0x278dc0[_0x485a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x278dc0[_0x485a('0x1a')]?_0x278dc0[_0x485a('0x1a')][_0x485a('0x1b')]||null:null,'attributes':_0x278dc0[_0x485a('0x1a')]?_0x278dc0[_0x485a('0x1a')][_0x485a('0x1c')]||null:null,'limit':_0x278dc0[_0x485a('0x1a')]?_0x278dc0['options']['limit']||null:null,'include':_0x278dc0['options']?_0x278dc0['options'][_0x485a('0x1d')]?_['map'](_0x278dc0['options'][_0x485a('0x1d')],function(_0x267f7f){return{'model':db[_0x267f7f['model']],'as':_0x267f7f['as'],'attributes':_0x267f7f['attributes'],'include':_0x267f7f['include']?_[_0x485a('0x1e')](_0x267f7f[_0x485a('0x1d')],function(_0x4bac39){return{'model':db[_0x4bac39[_0x485a('0x1f')]],'as':_0x4bac39['as'],'attributes':_0x4bac39[_0x485a('0x1c')],'include':_0x4bac39[_0x485a('0x1d')]?_['map'](_0x4bac39['include'],function(_0x246d2c){return{'model':db[_0x246d2c[_0x485a('0x1f')]],'as':_0x246d2c['as'],'attributes':_0x246d2c[_0x485a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x485a('0xc')](function(_0x39ab81){logger[_0x485a('0x15')]('GetCmHopper',_0x278dc0);logger['debug'](_0x485a('0x18'),_0x278dc0,JSON['stringify'](_0x39ab81));_0x16ff65(_0x39ab81);})[_0x485a('0x17')](function(_0x4653aa){logger[_0x485a('0x12')](_0x485a('0x18'),_0x4653aa[_0x485a('0x14')],_0x278dc0);_0x40a515(_0x40fea2[_0x485a('0x12')](0x1f4,_0x4653aa['message']));});});};exports[_0x485a('0x20')]=function(_0x1e70a1){var _0x3811e7=this;return new Promise(function(_0x13a672,_0x2729ff){return db['CmHopper'][_0x485a('0x21')]({'raw':_0x1e70a1[_0x485a('0x1a')]?_0x1e70a1[_0x485a('0x1a')][_0x485a('0x22')]===undefined?!![]:![]:!![],'where':_0x1e70a1[_0x485a('0x1a')]?_0x1e70a1[_0x485a('0x1a')]['where']||null:null,'attributes':_0x1e70a1[_0x485a('0x1a')]?_0x1e70a1[_0x485a('0x1a')][_0x485a('0x1c')]||null:null,'include':_0x1e70a1[_0x485a('0x1a')]?_0x1e70a1[_0x485a('0x1a')][_0x485a('0x1d')]?_['map'](_0x1e70a1[_0x485a('0x1a')][_0x485a('0x1d')],function(_0x17ebb6){return{'model':db[_0x17ebb6[_0x485a('0x1f')]],'as':_0x17ebb6['as'],'attributes':_0x17ebb6[_0x485a('0x1c')],'include':_0x17ebb6['include']?_[_0x485a('0x1e')](_0x17ebb6[_0x485a('0x1d')],function(_0x1027e9){return{'model':db[_0x1027e9['model']],'as':_0x1027e9['as'],'attributes':_0x1027e9[_0x485a('0x1c')],'include':_0x1027e9[_0x485a('0x1d')]?_['map'](_0x1027e9['include'],function(_0x5ef865){return{'model':db[_0x5ef865[_0x485a('0x1f')]],'as':_0x5ef865['as'],'attributes':_0x5ef865[_0x485a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x566665){logger[_0x485a('0x15')](_0x485a('0x20'),_0x1e70a1);logger[_0x485a('0xf')](_0x485a('0x20'),_0x1e70a1,JSON[_0x485a('0x11')](_0x566665));_0x13a672(_0x566665);})[_0x485a('0x17')](function(_0x3b4443){logger['error'](_0x485a('0x20'),_0x3b4443[_0x485a('0x14')],_0x1e70a1);_0x2729ff(_0x3811e7['error'](0x1f4,_0x3b4443[_0x485a('0x14')]));});});};exports['CreateCmHopper']=function(_0x4f79db){var _0x3df026=this;return new Promise(function(_0x204807,_0x22ca09){return db['CmHopper'][_0x485a('0x23')](_0x4f79db['body'],{'raw':_0x4f79db[_0x485a('0x1a')]?_0x4f79db[_0x485a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x485a('0xc')](function(_0xd032a5){logger[_0x485a('0x15')](_0x485a('0x24'),_0x4f79db);logger['debug'](_0x485a('0x24'),_0x4f79db,JSON[_0x485a('0x11')](_0xd032a5));_0x204807(_0xd032a5);})[_0x485a('0x17')](function(_0x38b09e){logger[_0x485a('0x12')](_0x485a('0x24'),_0x38b09e[_0x485a('0x14')],_0x4f79db);_0x22ca09(_0x3df026[_0x485a('0x12')](0x1f4,_0x38b09e['message']));});});};exports[_0x485a('0x25')]=function(_0x538c3c){var _0x14dac7=this;return new Promise(function(_0x2e3584,_0x39a6e7){return db[_0x485a('0x26')]['update'](_0x538c3c[_0x485a('0x27')],{'raw':_0x538c3c['options']?_0x538c3c[_0x485a('0x1a')][_0x485a('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x538c3c[_0x485a('0x1a')]?_0x538c3c[_0x485a('0x1a')]['where']||null:null,'attributes':_0x538c3c['options']?_0x538c3c[_0x485a('0x1a')][_0x485a('0x1c')]||null:null,'limit':_0x538c3c['options']?_0x538c3c[_0x485a('0x1a')][_0x485a('0x28')]||null:null})[_0x485a('0xc')](function(_0x3bcaf5){logger[_0x485a('0x15')](_0x485a('0x25'),_0x538c3c);logger[_0x485a('0xf')](_0x485a('0x25'),_0x538c3c,JSON[_0x485a('0x11')](_0x3bcaf5));_0x2e3584(_0x3bcaf5);})[_0x485a('0x17')](function(_0x250789){logger[_0x485a('0x12')](_0x485a('0x25'),_0x250789['message'],_0x538c3c);_0x39a6e7(_0x14dac7[_0x485a('0x12')](0x1f4,_0x250789[_0x485a('0x14')]));});});};exports[_0x485a('0x29')]=function(_0x9181b5){var _0x4de9ba=this;return new Promise(function(_0x414de2,_0x5c30e5){return db[_0x485a('0x26')][_0x485a('0x2a')]({'where':_0x9181b5[_0x485a('0x1a')]?_0x9181b5[_0x485a('0x1a')][_0x485a('0x1b')]||null:null})['then'](function(_0xa21bcf){logger['info']('DestroyCmHopper',_0x9181b5);logger[_0x485a('0xf')](_0x485a('0x29'),_0x9181b5,JSON[_0x485a('0x11')](_0xa21bcf));_0x414de2(_0xa21bcf);})[_0x485a('0x17')](function(_0x3caa62){logger['error'](_0x485a('0x29'),_0x3caa62['message'],_0x9181b5);_0x5c30e5(_0x4de9ba[_0x485a('0x12')](0x1f4,_0x3caa62[_0x485a('0x14')]));});});};exports[_0x485a('0x2b')]=function(_0x3712bc){var _0x480457=this;return new Promise(function(_0x43a57a,_0x3a3b13){return db[_0x485a('0x2c')][_0x485a('0x2d')]()[_0x485a('0xc')](function(_0x3a9865){return db[_0x485a('0x2e')]['transaction'](function(_0x5e8cf7){return db[_0x485a('0x26')][_0x485a('0x19')]({'where':_0x3712bc[_0x485a('0x1a')]?_0x3712bc[_0x485a('0x1a')][_0x485a('0x1b')]||null:null,'attributes':_0x3712bc['options']?_0x3712bc[_0x485a('0x1a')][_0x485a('0x1c')]||null:null,'limit':_0x3712bc[_0x485a('0x1a')]?_0x3712bc['options']['limit']||null:null,'order':_0x3712bc[_0x485a('0x1a')]?_0x3712bc[_0x485a('0x1a')][_0x485a('0x2f')]||null:null,'transaction':_0x5e8cf7,'lock':_0x5e8cf7[_0x485a('0x30')][_0x485a('0x31')],'include':[{'model':db[_0x485a('0x2c')],'as':'Contact','attributes':_[_0x485a('0x32')](_0x3a9865)},{'model':db[_0x485a('0x33')],'as':'Agent','attributes':['id',_0x485a('0x34'),_0x485a('0x35')]}]})['then'](function(_0x5b4a9f){var _0x57addf=[];var _0x4c730e=[];for(var _0x3fe8d6=0x0;_0x3fe8d6<_0x5b4a9f[_0x485a('0x36')];_0x3fe8d6+=0x1){var _0x3e5b15=_0x5b4a9f[_0x3fe8d6][_0x485a('0x37')];if(_0x3e5b15===null){_0x57addf[_0x485a('0x38')](_0x5b4a9f[_0x3fe8d6][_0x485a('0x39')](_0x3712bc[_0x485a('0x27')],{'transaction':_0x5e8cf7}));}else if(!_0x4c730e[_0x485a('0x3a')](_0x3e5b15)){_0x4c730e[_0x485a('0x38')](_0x3e5b15);_0x57addf[_0x485a('0x38')](_0x5b4a9f[_0x3fe8d6][_0x485a('0x39')](_0x3712bc[_0x485a('0x27')],{'transaction':_0x5e8cf7}));}}return BPromise[_0x485a('0x3b')](_0x57addf);});})[_0x485a('0xc')](function(_0x116290){logger[_0x485a('0x15')](_0x485a('0x2b'),_0x3712bc);logger[_0x485a('0xf')](_0x485a('0x2b'),_0x3712bc,JSON[_0x485a('0x11')](_0x116290));_0x43a57a(_0x116290);})[_0x485a('0x17')](function(_0x35219a){logger[_0x485a('0x12')]('GetContactDialer',_0x35219a[_0x485a('0x14')],_0x3712bc);_0x3a3b13(_0x480457['error'](0x1f4,_0x35219a[_0x485a('0x14')]));});});});};exports[_0x485a('0x3c')]=function(_0x215dbc){var _0xe86b66=this;return new Promise(function(_0x5e9885,_0x1577d9){return db[_0x485a('0x2e')]['transaction'](function(_0x137938){return db[_0x485a('0x3d')][_0x485a('0x23')](_0x215dbc['body'],{'raw':_0x215dbc['options']?_0x215dbc[_0x485a('0x1a')][_0x485a('0x22')]===undefined?!![]:![]:!![],'transaction':_0x137938})[_0x485a('0xc')](function(){return db[_0x485a('0x26')][_0x485a('0x2a')]({'where':_0x215dbc[_0x485a('0x1a')]?_0x215dbc['options'][_0x485a('0x1b')]||null:null,'transaction':_0x137938});});})[_0x485a('0xc')](function(_0x3ed8da){logger[_0x485a('0x15')](_0x485a('0x3c'),_0x215dbc);logger[_0x485a('0xf')](_0x485a('0x3c'),_0x215dbc,JSON[_0x485a('0x11')](_0x3ed8da));_0x5e9885(_0x3ed8da);})[_0x485a('0x17')](function(_0x38ab73){logger[_0x485a('0x12')](_0x485a('0x3c'),_0x38ab73['message'],_0x215dbc);_0x1577d9(_0xe86b66['error'](0x1f4,_0x38ab73[_0x485a('0x14')]));});});};exports[_0x485a('0x3e')]=function(_0x2d2f08){var _0x5f031c=this;return new Promise(function(_0x2cf18c,_0x41454a){return db[_0x485a('0x26')][_0x485a('0x19')]({'raw':_0x2d2f08[_0x485a('0x1a')]?_0x2d2f08[_0x485a('0x1a')][_0x485a('0x22')]===undefined?!![]:![]:!![],'where':_0x2d2f08[_0x485a('0x1a')]?_0x2d2f08[_0x485a('0x1a')][_0x485a('0x1b')]||null:null,'attributes':[[db[_0x485a('0x2e')]['fn']('COUNT',db[_0x485a('0x2e')]['fn']('IF',db[_0x485a('0x2e')][_0x485a('0x3f')](_0x485a('0x40')+util[_0x485a('0x41')](_0x485a('0x42'),moment()[_0x485a('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x485a('0x43')))),'contactsRescheduled']]})[_0x485a('0xc')](function(_0x2cb123){logger[_0x485a('0x15')](_0x485a('0x3e'),_0x2d2f08);logger['debug']('CountReScheduled',_0x2d2f08,JSON[_0x485a('0x11')](_0x2cb123));_0x2cf18c(_0x2cb123);})['catch'](function(_0xfe2aac){logger['error'](_0x485a('0x3e'),_0xfe2aac['message'],_0x2d2f08);_0x41454a(_0x5f031c[_0x485a('0x12')](0x1f4,_0xfe2aac['message']));});});};exports[_0x485a('0x44')]=function(_0x6b00ee){var _0x9ad9a8=this;return new Promise(function(_0x35ffb3,_0x18c2e5){return db[_0x485a('0x2c')][_0x485a('0x2d')]()['then'](function(_0x335d10){return db['sequelize'][_0x485a('0x45')](function(_0x207934){return db['CmHopper'][_0x485a('0x19')]({'where':_0x6b00ee[_0x485a('0x1a')]?_0x6b00ee[_0x485a('0x1a')][_0x485a('0x1b')]||null:null,'attributes':_0x6b00ee[_0x485a('0x1a')]?_0x6b00ee['options'][_0x485a('0x1c')]||null:null,'limit':0x1,'order':_0x6b00ee[_0x485a('0x1a')]?_0x6b00ee[_0x485a('0x1a')]['order']||null:null,'group':db[_0x485a('0x26')]['UserId'],'transaction':_0x207934,'lock':_0x207934[_0x485a('0x30')]['UPDATE'],'include':_0x6b00ee[_0x485a('0x1a')]?_0x6b00ee[_0x485a('0x1a')]['include']?_[_0x485a('0x1e')](_0x6b00ee['options']['include'],function(_0x4ed2b8){return{'model':db[_0x4ed2b8[_0x485a('0x1f')]],'as':_0x4ed2b8['as'],'attributes':_0x4ed2b8[_0x485a('0x1c')],'include':_0x4ed2b8[_0x485a('0x1d')]?_[_0x485a('0x1e')](_0x4ed2b8[_0x485a('0x1d')],function(_0x54ba3b){return{'model':db[_0x54ba3b[_0x485a('0x1f')]],'as':_0x54ba3b['as'],'attributes':_0x54ba3b['attributes'],'include':_0x54ba3b['include']?_['map'](_0x54ba3b[_0x485a('0x1d')],function(_0x33968a){return{'model':db[_0x33968a['model']],'as':_0x33968a['as'],'attributes':_0x33968a['attributes']};}):[]};}):[]};}):[]:[]})[_0x485a('0xc')](function(_0x50aeb4){var _0xe362b2=[];for(var _0x506ab6=0x0;_0x506ab6<_0x50aeb4[_0x485a('0x36')];_0x506ab6+=0x1){_0xe362b2['push'](_0x50aeb4[_0x506ab6][_0x485a('0x39')](_0x6b00ee['body'],{'transaction':_0x207934}));}return BPromise['all'](_0xe362b2);});})[_0x485a('0xc')](function(_0x4a1ebd){logger[_0x485a('0x15')]('GetContactRecallMe',_0x6b00ee);logger[_0x485a('0xf')](_0x485a('0x44'),_0x6b00ee,JSON[_0x485a('0x11')](_0x4a1ebd));_0x35ffb3(_0x4a1ebd);})[_0x485a('0x17')](function(_0x14ce10){logger[_0x485a('0x12')](_0x485a('0x44'),_0x14ce10[_0x485a('0x14')],_0x6b00ee);_0x18c2e5(_0x9ad9a8[_0x485a('0x12')](0x1f4,_0x14ce10[_0x485a('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x3340b2){var _0x56eb0d=this;return new Promise(function(_0x566bfd,_0x38a58f){db[_0x485a('0x2c')][_0x485a('0x2d')]()[_0x485a('0xc')](function(_0x3db5c1){return db['CmHopper'][_0x485a('0x19')]({'raw':_0x3340b2[_0x485a('0x1a')]?_0x3340b2[_0x485a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3340b2[_0x485a('0x1a')]?_0x3340b2['options']['where']||null:null,'attributes':_0x3340b2[_0x485a('0x1a')]?_0x3340b2['options'][_0x485a('0x1c')]||null:null,'limit':_0x3340b2['options']?_0x3340b2[_0x485a('0x1a')][_0x485a('0x28')]||null:null,'include':_0x3340b2['options']?_0x3340b2[_0x485a('0x1a')][_0x485a('0x1d')]?_[_0x485a('0x1e')](_0x3340b2[_0x485a('0x1a')]['include'],function(_0x190452){return{'model':db[_0x190452['model']],'as':_0x190452['as'],'attributes':_0x190452['as']===_0x485a('0x46')?_['keys'](_0x3db5c1):_0x190452[_0x485a('0x1c')],'include':_0x190452[_0x485a('0x1d')]?_[_0x485a('0x1e')](_0x190452[_0x485a('0x1d')],function(_0x165d08){return{'model':db[_0x165d08['model']],'as':_0x165d08['as'],'attributes':_0x165d08[_0x485a('0x1c')],'include':_0x165d08[_0x485a('0x1d')]?_[_0x485a('0x1e')](_0x165d08[_0x485a('0x1d')],function(_0xded17c){return{'model':db[_0xded17c[_0x485a('0x1f')]],'as':_0xded17c['as'],'attributes':_0xded17c[_0x485a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x485a('0xc')](function(_0x2e1102){logger[_0x485a('0x15')](_0x485a('0x18'),_0x3340b2);logger[_0x485a('0xf')](_0x485a('0x18'),_0x3340b2,JSON[_0x485a('0x11')](_0x2e1102));_0x566bfd(_0x2e1102);})['catch'](function(_0x299e37){logger[_0x485a('0x12')]('GetCmHopper',_0x299e37['message'],_0x3340b2);_0x38a58f(_0x56eb0d[_0x485a('0x12')](0x1f4,_0x299e37[_0x485a('0x14')]));});});});}; \ No newline at end of file +var _0x51f5=['debug','request\x20sent','error','message','result','catch','GetCmHopper','CmHopper','findAll','options','attributes','limit','include','map','model','stringify','ShowCmHopper','raw','where','CreateCmHopper','create','UpdateCmHopper','update','body','DestroyCmHopper','GetContactDialer','sequelize','order','LOCK','UPDATE','CmContact','Contact','User','Agent','name','voicePause','UserId','push','includes','all','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','length','keys','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s'];(function(_0x29ebf4,_0x38489d){var _0x18f197=function(_0x4449c3){while(--_0x4449c3){_0x29ebf4['push'](_0x29ebf4['shift']());}};_0x18f197(++_0x38489d);}(_0x51f5,0x1ce));var _0x551f=function(_0x339c44,_0x3d58a3){_0x339c44=_0x339c44-0x0;var _0x5aea57=_0x51f5[_0x339c44];return _0x5aea57;};'use strict';var _=require(_0x551f('0x0'));var util=require('util');var moment=require(_0x551f('0x1'));var BPromise=require('bluebird');var rs=require(_0x551f('0x2'));var fs=require('fs');var Redis=require(_0x551f('0x3'));var db=require(_0x551f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x551f('0x5'))(_0x551f('0x6'));var config=require(_0x551f('0x7'));var jayson=require(_0x551f('0x8'));var client=jayson[_0x551f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ff779,_0x5cef88,_0x392112){return new BPromise(function(_0x2a0b2c,_0x3caccb){return client[_0x551f('0xa')](_0x3ff779,_0x392112)[_0x551f('0xb')](function(_0x11a76d){logger[_0x551f('0xc')](_0x551f('0xd'),_0x5cef88,'request\x20sent');logger[_0x551f('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x5cef88,_0x551f('0xf'),JSON['stringify'](_0x11a76d));if(_0x11a76d[_0x551f('0x10')]){if(_0x11a76d['error']['code']===0x1f4){logger['error'](_0x551f('0xd'),_0x5cef88,_0x11a76d['error'][_0x551f('0x11')]);return _0x3caccb(_0x11a76d['error'][_0x551f('0x11')]);}logger['error'](_0x551f('0xd'),_0x5cef88,_0x11a76d[_0x551f('0x10')][_0x551f('0x11')]);return _0x2a0b2c(_0x11a76d['error']['message']);}else{logger[_0x551f('0xc')](_0x551f('0xd'),_0x5cef88,'request\x20sent');_0x2a0b2c(_0x11a76d[_0x551f('0x12')]['message']);}})[_0x551f('0x13')](function(_0x39d049){logger[_0x551f('0x10')](_0x551f('0xd'),_0x5cef88,_0x39d049);_0x3caccb(_0x39d049);});});}exports[_0x551f('0x14')]=function(_0x10627f){var _0x339805=this;return new Promise(function(_0x57c922,_0x1e64ed){return db[_0x551f('0x15')][_0x551f('0x16')]({'raw':_0x10627f[_0x551f('0x17')]?_0x10627f[_0x551f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x10627f['options']?_0x10627f[_0x551f('0x17')]['where']||null:null,'attributes':_0x10627f[_0x551f('0x17')]?_0x10627f[_0x551f('0x17')][_0x551f('0x18')]||null:null,'limit':_0x10627f['options']?_0x10627f[_0x551f('0x17')][_0x551f('0x19')]||null:null,'include':_0x10627f[_0x551f('0x17')]?_0x10627f['options'][_0x551f('0x1a')]?_[_0x551f('0x1b')](_0x10627f[_0x551f('0x17')][_0x551f('0x1a')],function(_0x3e5a42){return{'model':db[_0x3e5a42[_0x551f('0x1c')]],'as':_0x3e5a42['as'],'attributes':_0x3e5a42['attributes'],'include':_0x3e5a42[_0x551f('0x1a')]?_[_0x551f('0x1b')](_0x3e5a42[_0x551f('0x1a')],function(_0x4c9a6a){return{'model':db[_0x4c9a6a[_0x551f('0x1c')]],'as':_0x4c9a6a['as'],'attributes':_0x4c9a6a[_0x551f('0x18')],'include':_0x4c9a6a[_0x551f('0x1a')]?_[_0x551f('0x1b')](_0x4c9a6a[_0x551f('0x1a')],function(_0x26fdcf){return{'model':db[_0x26fdcf[_0x551f('0x1c')]],'as':_0x26fdcf['as'],'attributes':_0x26fdcf[_0x551f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ffc05){logger['info'](_0x551f('0x14'),_0x10627f);logger[_0x551f('0xe')]('GetCmHopper',_0x10627f,JSON[_0x551f('0x1d')](_0x2ffc05));_0x57c922(_0x2ffc05);})['catch'](function(_0x1d7c35){logger[_0x551f('0x10')](_0x551f('0x14'),_0x1d7c35['message'],_0x10627f);_0x1e64ed(_0x339805[_0x551f('0x10')](0x1f4,_0x1d7c35['message']));});});};exports[_0x551f('0x1e')]=function(_0x5ea5b4){var _0x260018=this;return new Promise(function(_0x398bfd,_0xfafcdd){return db[_0x551f('0x15')]['find']({'raw':_0x5ea5b4[_0x551f('0x17')]?_0x5ea5b4[_0x551f('0x17')][_0x551f('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ea5b4[_0x551f('0x17')]?_0x5ea5b4['options'][_0x551f('0x20')]||null:null,'attributes':_0x5ea5b4[_0x551f('0x17')]?_0x5ea5b4['options'][_0x551f('0x18')]||null:null,'include':_0x5ea5b4['options']?_0x5ea5b4[_0x551f('0x17')]['include']?_['map'](_0x5ea5b4['options'][_0x551f('0x1a')],function(_0x591048){return{'model':db[_0x591048[_0x551f('0x1c')]],'as':_0x591048['as'],'attributes':_0x591048['attributes'],'include':_0x591048['include']?_[_0x551f('0x1b')](_0x591048[_0x551f('0x1a')],function(_0x1e45a6){return{'model':db[_0x1e45a6[_0x551f('0x1c')]],'as':_0x1e45a6['as'],'attributes':_0x1e45a6[_0x551f('0x18')],'include':_0x1e45a6[_0x551f('0x1a')]?_[_0x551f('0x1b')](_0x1e45a6[_0x551f('0x1a')],function(_0x51a9da){return{'model':db[_0x51a9da['model']],'as':_0x51a9da['as'],'attributes':_0x51a9da['attributes']};}):[]};}):[]};}):[]:[]})[_0x551f('0xb')](function(_0x2c5c09){logger['info'](_0x551f('0x1e'),_0x5ea5b4);logger['debug'](_0x551f('0x1e'),_0x5ea5b4,JSON[_0x551f('0x1d')](_0x2c5c09));_0x398bfd(_0x2c5c09);})['catch'](function(_0x4ceaab){logger[_0x551f('0x10')](_0x551f('0x1e'),_0x4ceaab['message'],_0x5ea5b4);_0xfafcdd(_0x260018[_0x551f('0x10')](0x1f4,_0x4ceaab['message']));});});};exports[_0x551f('0x21')]=function(_0x48c252){var _0x6cc17b=this;return new Promise(function(_0x28ddb8,_0x554030){return db[_0x551f('0x15')][_0x551f('0x22')](_0x48c252['body'],{'raw':_0x48c252[_0x551f('0x17')]?_0x48c252[_0x551f('0x17')][_0x551f('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5a24f5){logger[_0x551f('0xc')](_0x551f('0x21'),_0x48c252);logger[_0x551f('0xe')](_0x551f('0x21'),_0x48c252,JSON[_0x551f('0x1d')](_0x5a24f5));_0x28ddb8(_0x5a24f5);})['catch'](function(_0x27ecce){logger[_0x551f('0x10')]('CreateCmHopper',_0x27ecce['message'],_0x48c252);_0x554030(_0x6cc17b[_0x551f('0x10')](0x1f4,_0x27ecce[_0x551f('0x11')]));});});};exports[_0x551f('0x23')]=function(_0x12b491){var _0x4a7f7f=this;return new Promise(function(_0x2a71de,_0x4758f5){return db['CmHopper'][_0x551f('0x24')](_0x12b491[_0x551f('0x25')],{'raw':_0x12b491[_0x551f('0x17')]?_0x12b491[_0x551f('0x17')][_0x551f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12b491[_0x551f('0x17')]?_0x12b491[_0x551f('0x17')][_0x551f('0x20')]||null:null,'attributes':_0x12b491['options']?_0x12b491[_0x551f('0x17')]['attributes']||null:null,'limit':_0x12b491[_0x551f('0x17')]?_0x12b491['options'][_0x551f('0x19')]||null:null})['then'](function(_0x1f42c7){logger['info']('UpdateCmHopper',_0x12b491);logger[_0x551f('0xe')](_0x551f('0x23'),_0x12b491,JSON[_0x551f('0x1d')](_0x1f42c7));_0x2a71de(_0x1f42c7);})[_0x551f('0x13')](function(_0x192935){logger[_0x551f('0x10')](_0x551f('0x23'),_0x192935[_0x551f('0x11')],_0x12b491);_0x4758f5(_0x4a7f7f['error'](0x1f4,_0x192935['message']));});});};exports['DestroyCmHopper']=function(_0xeeb9c3){var _0x578461=this;return new Promise(function(_0x111937,_0x1e394b){return db['CmHopper']['destroy']({'where':_0xeeb9c3[_0x551f('0x17')]?_0xeeb9c3[_0x551f('0x17')]['where']||null:null})[_0x551f('0xb')](function(_0xfea0a2){logger[_0x551f('0xc')](_0x551f('0x26'),_0xeeb9c3);logger[_0x551f('0xe')]('DestroyCmHopper',_0xeeb9c3,JSON[_0x551f('0x1d')](_0xfea0a2));_0x111937(_0xfea0a2);})['catch'](function(_0x4e7c37){logger['error'](_0x551f('0x26'),_0x4e7c37[_0x551f('0x11')],_0xeeb9c3);_0x1e394b(_0x578461['error'](0x1f4,_0x4e7c37['message']));});});};exports[_0x551f('0x27')]=function(_0x1a07c8){var _0x1fd522=this;return new Promise(function(_0x51921b,_0x2e6e3a){return db['CmContact']['describe']()['then'](function(_0x5da536){return db[_0x551f('0x28')]['transaction'](function(_0x31b172){return db[_0x551f('0x15')][_0x551f('0x16')]({'where':_0x1a07c8['options']?_0x1a07c8['options'][_0x551f('0x20')]||null:null,'attributes':_0x1a07c8[_0x551f('0x17')]?_0x1a07c8[_0x551f('0x17')][_0x551f('0x18')]||null:null,'limit':_0x1a07c8[_0x551f('0x17')]?_0x1a07c8['options'][_0x551f('0x19')]||null:null,'order':_0x1a07c8['options']?_0x1a07c8[_0x551f('0x17')][_0x551f('0x29')]||null:null,'transaction':_0x31b172,'lock':_0x31b172[_0x551f('0x2a')][_0x551f('0x2b')],'include':[{'model':db[_0x551f('0x2c')],'as':_0x551f('0x2d'),'attributes':_['keys'](_0x5da536)},{'model':db[_0x551f('0x2e')],'as':_0x551f('0x2f'),'attributes':['id',_0x551f('0x30'),_0x551f('0x31')]}]})['then'](function(_0x15f7a9){var _0x41131c=[];var _0x2701a9=[];for(var _0x4c694e=0x0;_0x4c694e<_0x15f7a9['length'];_0x4c694e+=0x1){var _0x4cbae3=_0x15f7a9[_0x4c694e][_0x551f('0x32')];if(_0x4cbae3===null){_0x41131c[_0x551f('0x33')](_0x15f7a9[_0x4c694e][_0x551f('0x24')](_0x1a07c8[_0x551f('0x25')],{'transaction':_0x31b172}));}else if(!_0x2701a9[_0x551f('0x34')](_0x4cbae3)){_0x2701a9[_0x551f('0x33')](_0x4cbae3);_0x41131c[_0x551f('0x33')](_0x15f7a9[_0x4c694e][_0x551f('0x24')](_0x1a07c8[_0x551f('0x25')],{'transaction':_0x31b172}));}}return BPromise[_0x551f('0x35')](_0x41131c);});})[_0x551f('0xb')](function(_0x34d718){logger[_0x551f('0xc')](_0x551f('0x27'),_0x1a07c8);logger['debug']('GetContactDialer',_0x1a07c8,JSON[_0x551f('0x1d')](_0x34d718));_0x51921b(_0x34d718);})[_0x551f('0x13')](function(_0x556873){logger[_0x551f('0x10')](_0x551f('0x27'),_0x556873[_0x551f('0x11')],_0x1a07c8);_0x2e6e3a(_0x1fd522[_0x551f('0x10')](0x1f4,_0x556873[_0x551f('0x11')]));});});});};exports[_0x551f('0x36')]=function(_0x1668ad){var _0x238511=this;return new Promise(function(_0x1f7597,_0x256cad){return db['sequelize'][_0x551f('0x37')](function(_0x31df70){return db[_0x551f('0x38')][_0x551f('0x22')](_0x1668ad['body'],{'raw':_0x1668ad[_0x551f('0x17')]?_0x1668ad[_0x551f('0x17')][_0x551f('0x1f')]===undefined?!![]:![]:!![],'transaction':_0x31df70})[_0x551f('0xb')](function(){return db[_0x551f('0x15')]['destroy']({'where':_0x1668ad[_0x551f('0x17')]?_0x1668ad[_0x551f('0x17')]['where']||null:null,'transaction':_0x31df70});});})[_0x551f('0xb')](function(_0x105e79){logger['info'](_0x551f('0x36'),_0x1668ad);logger['debug'](_0x551f('0x36'),_0x1668ad,JSON[_0x551f('0x1d')](_0x105e79));_0x1f7597(_0x105e79);})[_0x551f('0x13')](function(_0x5876e9){logger[_0x551f('0x10')](_0x551f('0x36'),_0x5876e9[_0x551f('0x11')],_0x1668ad);_0x256cad(_0x238511['error'](0x1f4,_0x5876e9['message']));});});};exports[_0x551f('0x39')]=function(_0x1b2a73){var _0x4aee63=this;return new Promise(function(_0x4fff10,_0x37046f){return db[_0x551f('0x15')]['findAll']({'raw':_0x1b2a73[_0x551f('0x17')]?_0x1b2a73[_0x551f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1b2a73[_0x551f('0x17')]?_0x1b2a73[_0x551f('0x17')][_0x551f('0x20')]||null:null,'attributes':[[db[_0x551f('0x28')]['fn']('COUNT',db[_0x551f('0x28')]['fn']('IF',db[_0x551f('0x28')]['literal'](_0x551f('0x3a')+util[_0x551f('0x3b')](_0x551f('0x3c'),moment()[_0x551f('0x3b')](_0x551f('0x3d')))+_0x551f('0x3e')))),_0x551f('0x3f')]]})[_0x551f('0xb')](function(_0x54b6c7){logger[_0x551f('0xc')](_0x551f('0x39'),_0x1b2a73);logger[_0x551f('0xe')](_0x551f('0x39'),_0x1b2a73,JSON['stringify'](_0x54b6c7));_0x4fff10(_0x54b6c7);})[_0x551f('0x13')](function(_0x528440){logger[_0x551f('0x10')](_0x551f('0x39'),_0x528440['message'],_0x1b2a73);_0x37046f(_0x4aee63['error'](0x1f4,_0x528440[_0x551f('0x11')]));});});};exports[_0x551f('0x40')]=function(_0x30a4a3){var _0x4844a5=this;return new Promise(function(_0x17f0f8,_0x33edd9){return db[_0x551f('0x2c')][_0x551f('0x41')]()[_0x551f('0xb')](function(_0x52153f){return db[_0x551f('0x28')]['transaction'](function(_0x85fe99){return db['CmHopper'][_0x551f('0x16')]({'where':_0x30a4a3[_0x551f('0x17')]?_0x30a4a3['options'][_0x551f('0x20')]||null:null,'attributes':_0x30a4a3[_0x551f('0x17')]?_0x30a4a3['options'][_0x551f('0x18')]||null:null,'limit':0x1,'order':_0x30a4a3['options']?_0x30a4a3[_0x551f('0x17')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x85fe99,'lock':_0x85fe99[_0x551f('0x2a')][_0x551f('0x2b')],'include':_0x30a4a3[_0x551f('0x17')]?_0x30a4a3[_0x551f('0x17')][_0x551f('0x1a')]?_[_0x551f('0x1b')](_0x30a4a3[_0x551f('0x17')][_0x551f('0x1a')],function(_0x437971){return{'model':db[_0x437971[_0x551f('0x1c')]],'as':_0x437971['as'],'attributes':_0x437971[_0x551f('0x18')],'include':_0x437971['include']?_[_0x551f('0x1b')](_0x437971['include'],function(_0x2bb756){return{'model':db[_0x2bb756[_0x551f('0x1c')]],'as':_0x2bb756['as'],'attributes':_0x2bb756[_0x551f('0x18')],'include':_0x2bb756[_0x551f('0x1a')]?_[_0x551f('0x1b')](_0x2bb756[_0x551f('0x1a')],function(_0x26437c){return{'model':db[_0x26437c[_0x551f('0x1c')]],'as':_0x26437c['as'],'attributes':_0x26437c[_0x551f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x551f('0xb')](function(_0x54c90d){var _0x296b9a=[];for(var _0x83f00d=0x0;_0x83f00d<_0x54c90d[_0x551f('0x42')];_0x83f00d+=0x1){_0x296b9a[_0x551f('0x33')](_0x54c90d[_0x83f00d][_0x551f('0x24')](_0x30a4a3['body'],{'transaction':_0x85fe99}));}return BPromise[_0x551f('0x35')](_0x296b9a);});})['then'](function(_0x21a4c7){logger['info'](_0x551f('0x40'),_0x30a4a3);logger[_0x551f('0xe')](_0x551f('0x40'),_0x30a4a3,JSON[_0x551f('0x1d')](_0x21a4c7));_0x17f0f8(_0x21a4c7);})[_0x551f('0x13')](function(_0x2c108d){logger[_0x551f('0x10')](_0x551f('0x40'),_0x2c108d[_0x551f('0x11')],_0x30a4a3);_0x33edd9(_0x4844a5[_0x551f('0x10')](0x1f4,_0x2c108d['message']));});});});};exports['GetCmHopperPreview']=function(_0xa2192c){var _0x5d8607=this;return new Promise(function(_0x5dce30,_0x54d627){db[_0x551f('0x2c')][_0x551f('0x41')]()[_0x551f('0xb')](function(_0xfb2bbc){return db[_0x551f('0x15')][_0x551f('0x16')]({'raw':_0xa2192c[_0x551f('0x17')]?_0xa2192c[_0x551f('0x17')][_0x551f('0x1f')]===undefined?!![]:![]:!![],'where':_0xa2192c['options']?_0xa2192c[_0x551f('0x17')]['where']||null:null,'attributes':_0xa2192c['options']?_0xa2192c[_0x551f('0x17')]['attributes']||null:null,'limit':_0xa2192c[_0x551f('0x17')]?_0xa2192c['options'][_0x551f('0x19')]||null:null,'include':_0xa2192c[_0x551f('0x17')]?_0xa2192c[_0x551f('0x17')]['include']?_[_0x551f('0x1b')](_0xa2192c[_0x551f('0x17')][_0x551f('0x1a')],function(_0x187de0){return{'model':db[_0x187de0[_0x551f('0x1c')]],'as':_0x187de0['as'],'attributes':_0x187de0['as']===_0x551f('0x2d')?_[_0x551f('0x43')](_0xfb2bbc):_0x187de0['attributes'],'include':_0x187de0[_0x551f('0x1a')]?_['map'](_0x187de0[_0x551f('0x1a')],function(_0x5a079e){return{'model':db[_0x5a079e[_0x551f('0x1c')]],'as':_0x5a079e['as'],'attributes':_0x5a079e[_0x551f('0x18')],'include':_0x5a079e[_0x551f('0x1a')]?_[_0x551f('0x1b')](_0x5a079e['include'],function(_0x5924fe){return{'model':db[_0x5924fe[_0x551f('0x1c')]],'as':_0x5924fe['as'],'attributes':_0x5924fe[_0x551f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55c7cd){logger[_0x551f('0xc')]('GetCmHopper',_0xa2192c);logger[_0x551f('0xe')](_0x551f('0x14'),_0xa2192c,JSON[_0x551f('0x1d')](_0x55c7cd));_0x5dce30(_0x55c7cd);})[_0x551f('0x13')](function(_0x162f8c){logger[_0x551f('0x10')]('GetCmHopper',_0x162f8c['message'],_0xa2192c);_0x54d627(_0x5d8607[_0x551f('0x10')](0x1f4,_0x162f8c[_0x551f('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 19fcb26..fe67be4 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 _0x5440=['fs-extra','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','destroy','exports','util','connect-timeout','express','Router'];(function(_0x539434,_0x4a6f1a){var _0x3b7cde=function(_0x4a243f){while(--_0x4a243f){_0x539434['push'](_0x539434['shift']());}};_0x3b7cde(++_0x4a6f1a);}(_0x5440,0x1c4));var _0x0544=function(_0x1d36c3,_0x2ae866){_0x1d36c3=_0x1d36c3-0x0;var _0x57f890=_0x5440[_0x1d36c3];return _0x57f890;};'use strict';var multer=require('multer');var util=require(_0x0544('0x0'));var path=require('path');var timeout=require(_0x0544('0x1'));var express=require(_0x0544('0x2'));var router=express[_0x0544('0x3')]();var fs_extra=require(_0x0544('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0544('0x5'));var controller=require(_0x0544('0x6'));router[_0x0544('0x7')]('/',auth[_0x0544('0x8')](),controller[_0x0544('0x9')]);router['get'](_0x0544('0xa'),auth[_0x0544('0x8')](),controller[_0x0544('0xb')]);router[_0x0544('0x7')](_0x0544('0xc'),auth['isAuthenticated'](),controller[_0x0544('0xd')]);router[_0x0544('0x7')](_0x0544('0xe'),auth[_0x0544('0x8')](),controller[_0x0544('0xf')]);router[_0x0544('0x10')]('/',auth[_0x0544('0x8')](),controller[_0x0544('0x11')]);router[_0x0544('0x10')](_0x0544('0x12'),auth['isAuthenticated'](),controller[_0x0544('0x13')]);router[_0x0544('0x14')](_0x0544('0xe'),auth[_0x0544('0x8')](),controller[_0x0544('0x15')]);router['delete']('/:id',auth[_0x0544('0x8')](),controller[_0x0544('0x16')]);module[_0x0544('0x17')]=router; \ No newline at end of file +var _0x8043=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/opencontacts','getOpenContacts','show','post','create','getPreview','put','/:id'];(function(_0x41f7f1,_0x3852ef){var _0x1e64fa=function(_0x13ec49){while(--_0x13ec49){_0x41f7f1['push'](_0x41f7f1['shift']());}};_0x1e64fa(++_0x3852ef);}(_0x8043,0xf5));var _0x3804=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x8043[_0x17406a];return _0x1501ff;};'use strict';var multer=require(_0x3804('0x0'));var util=require(_0x3804('0x1'));var path=require(_0x3804('0x2'));var timeout=require(_0x3804('0x3'));var express=require(_0x3804('0x4'));var router=express['Router']();var fs_extra=require(_0x3804('0x5'));var auth=require(_0x3804('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3804('0x7'));var controller=require('./cmHopper.controller');router[_0x3804('0x8')]('/',auth[_0x3804('0x9')](),controller['index']);router[_0x3804('0x8')]('/describe',auth[_0x3804('0x9')](),controller[_0x3804('0xa')]);router['get'](_0x3804('0xb'),auth['isAuthenticated'](),controller[_0x3804('0xc')]);router[_0x3804('0x8')]('/:id',auth[_0x3804('0x9')](),controller[_0x3804('0xd')]);router[_0x3804('0xe')]('/',auth[_0x3804('0x9')](),controller[_0x3804('0xf')]);router[_0x3804('0xe')]('/preview',auth['isAuthenticated'](),controller[_0x3804('0x10')]);router[_0x3804('0x11')](_0x3804('0x12'),auth[_0x3804('0x9')](),controller[_0x3804('0x13')]);router['delete']('/:id',auth[_0x3804('0x9')](),controller[_0x3804('0x14')]);module[_0x3804('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 56832f9..de85d75 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 _0xe944=['moment','STRING','INTEGER','contactListQueue'];(function(_0x20834a,_0x471f90){var _0x33da2d=function(_0x22a346){while(--_0x22a346){_0x20834a['push'](_0x20834a['shift']());}};_0x33da2d(++_0x471f90);}(_0xe944,0x174));var _0x4e94=function(_0x1e3ab9,_0x2adc7b){_0x1e3ab9=_0x1e3ab9-0x0;var _0x38189f=_0xe944[_0x1e3ab9];return _0x38189f;};'use strict';var moment=require(_0x4e94('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x4e94('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x4e94('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x4e94('0x3')}}; \ No newline at end of file +var _0x931f=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x3eb109,_0x2c3a36){var _0x3810c2=function(_0x261959){while(--_0x261959){_0x3eb109['push'](_0x3eb109['shift']());}};_0x3810c2(++_0x2c3a36);}(_0x931f,0x139));var _0xf931=function(_0x1f9ee0,_0x2152a2){_0x1f9ee0=_0x1f9ee0-0x0;var _0x4274b5=_0x931f[_0x1f9ee0];return _0x4274b5;};'use strict';var moment=require(_0xf931('0x0'));var Sequelize=require(_0xf931('0x1'));module[_0xf931('0x2')]={'phone':{'type':Sequelize[_0xf931('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf931('0x4')],'unique':_0xf931('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xf931('0x5')},'VoiceQueueId':{'type':Sequelize[_0xf931('0x4')],'unique':_0xf931('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index d087a2d..eb171f1 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 _0x99b7=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','reject','save','then','sendStatus','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','update','body','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x4947a6,_0x1b5d32){var _0x1d67ff=function(_0x5e6c7c){while(--_0x5e6c7c){_0x4947a6['push'](_0x4947a6['shift']());}};_0x1d67ff(++_0x1b5d32);}(_0x99b7,0x1e8));var _0x799b=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x99b7[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x799b('0x0'));var rimraf=require(_0x799b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x799b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x799b('0x3'));var Mustache=require(_0x799b('0x4'));var util=require('util');var path=require(_0x799b('0x5'));var sox=require(_0x799b('0x6'));var csv=require(_0x799b('0x7'));var ejs=require(_0x799b('0x8'));var fs=require('fs');var fs_extra=require(_0x799b('0x9'));var _=require(_0x799b('0xa'));var squel=require(_0x799b('0xb'));var crypto=require(_0x799b('0xc'));var jsforce=require(_0x799b('0xd'));var deskjs=require(_0x799b('0xe'));var toCsv=require(_0x799b('0x7'));var querystring=require('querystring');var Papa=require(_0x799b('0xf'));var Redis=require(_0x799b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x799b('0x11'));var logger=require(_0x799b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x799b('0x13'));var licenseUtil=require(_0x799b('0x14'));var db=require(_0x799b('0x15'))['db'];function respondWithStatusCode(_0x31e8e8,_0xa612bd){_0xa612bd=_0xa612bd||0xcc;return function(_0x4d951a){if(_0x4d951a){return _0x31e8e8['sendStatus'](_0xa612bd);}return _0x31e8e8[_0x799b('0x16')](_0xa612bd)[_0x799b('0x17')]();};}function respondWithResult(_0x316b88,_0x57411c){_0x57411c=_0x57411c||0xc8;return function(_0x4e312d){if(_0x4e312d){return _0x316b88[_0x799b('0x16')](_0x57411c)[_0x799b('0x18')](_0x4e312d);}};}function respondWithFilteredResult(_0x174cfb,_0x522f5a){return function(_0x41625c){if(_0x41625c){var _0x20fd98=typeof _0x522f5a[_0x799b('0x19')]==='undefined'&&typeof _0x522f5a[_0x799b('0x1a')]===_0x799b('0x1b');var _0x56a3c7=_0x41625c[_0x799b('0x1c')];var _0x2ce987=_0x20fd98?0x0:_0x522f5a[_0x799b('0x19')];var _0x4ad71c=_0x20fd98?_0x41625c['count']:_0x522f5a[_0x799b('0x19')]+_0x522f5a[_0x799b('0x1a')];var _0xaae7df;if(_0x4ad71c>=_0x56a3c7){_0x4ad71c=_0x56a3c7;_0xaae7df=0xc8;}else{_0xaae7df=0xce;}_0x174cfb[_0x799b('0x16')](_0xaae7df);return _0x174cfb['set']('Content-Range',_0x2ce987+'-'+_0x4ad71c+'/'+_0x56a3c7)[_0x799b('0x18')](_0x41625c);}return null;};}function patchUpdates(_0x3c74b3){return function(_0x48df4f){try{jsonpatch[_0x799b('0x1d')](_0x48df4f,_0x3c74b3,!![]);}catch(_0x1b6389){return BPromise[_0x799b('0x1e')](_0x1b6389);}return _0x48df4f[_0x799b('0x1f')]();};}function saveUpdates(_0x58b04f,_0x38011f){return function(_0x344cc4){if(_0x344cc4){return _0x344cc4['update'](_0x58b04f)[_0x799b('0x20')](function(_0x226533){return _0x226533;});}return null;};}function removeEntity(_0x35a3db,_0x33a1cd){return function(_0x5214de){if(_0x5214de){return _0x5214de['destroy']()[_0x799b('0x20')](function(){_0x35a3db[_0x799b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x517ea6,_0x5128f5){return function(_0x5a9112){if(!_0x5a9112){_0x517ea6[_0x799b('0x21')](0x194);}return _0x5a9112;};}function handleError(_0xa8d9f9,_0xdbf95a){_0xdbf95a=_0xdbf95a||0x1f4;return function(_0x523c06){logger[_0x799b('0x22')](_0x523c06[_0x799b('0x23')]);if(_0x523c06[_0x799b('0x24')]){delete _0x523c06[_0x799b('0x24')];}_0xa8d9f9[_0x799b('0x16')](_0xdbf95a)['send'](_0x523c06);};}exports[_0x799b('0x25')]=function(_0x3c6e2b,_0x467788){var _0x3f54c2={},_0xe458cf={},_0x1b58bd={'count':0x0,'rows':[]};var _0x3e97f7=_[_0x799b('0x26')](db[_0x799b('0x27')][_0x799b('0x28')],function(_0x40ecf3){return{'name':_0x40ecf3[_0x799b('0x29')],'type':_0x40ecf3[_0x799b('0x2a')][_0x799b('0x2b')]};});_0xe458cf[_0x799b('0x2c')]=_[_0x799b('0x26')](_0x3e97f7,_0x799b('0x24'));_0xe458cf[_0x799b('0x2d')]=_[_0x799b('0x2e')](_0x3c6e2b[_0x799b('0x2d')]);_0xe458cf[_0x799b('0x2f')]=_[_0x799b('0x30')](_0xe458cf[_0x799b('0x2c')],_0xe458cf['query']);_0x3f54c2[_0x799b('0x31')]=_[_0x799b('0x30')](_0xe458cf[_0x799b('0x2c')],qs[_0x799b('0x32')](_0x3c6e2b[_0x799b('0x2d')][_0x799b('0x32')]));_0x3f54c2[_0x799b('0x31')]=_0x3f54c2[_0x799b('0x31')][_0x799b('0x33')]?_0x3f54c2[_0x799b('0x31')]:_0xe458cf[_0x799b('0x2c')];if(!_0x3c6e2b[_0x799b('0x2d')]['hasOwnProperty']('nolimit')){_0x3f54c2[_0x799b('0x1a')]=qs[_0x799b('0x1a')](_0x3c6e2b[_0x799b('0x2d')]['limit']);_0x3f54c2[_0x799b('0x19')]=qs[_0x799b('0x19')](_0x3c6e2b[_0x799b('0x2d')][_0x799b('0x19')]);}_0x3f54c2[_0x799b('0x34')]=qs['sort'](_0x3c6e2b[_0x799b('0x2d')][_0x799b('0x35')]);_0x3f54c2[_0x799b('0x36')]=qs[_0x799b('0x2f')](_[_0x799b('0x37')](_0x3c6e2b[_0x799b('0x2d')],_0xe458cf[_0x799b('0x2f')]),_0x3e97f7);if(_0x3c6e2b['query'][_0x799b('0x38')]){_0x3f54c2[_0x799b('0x36')]=_[_0x799b('0x39')](_0x3f54c2['where'],{'$or':_[_0x799b('0x26')](_0x3e97f7,function(_0x5b5993){if(_0x5b5993['type']!==_0x799b('0x3a')){var _0x5ce287={};_0x5ce287[_0x5b5993[_0x799b('0x24')]]={'$like':'%'+_0x3c6e2b['query'][_0x799b('0x38')]+'%'};return _0x5ce287;}})});}_0x3f54c2=_[_0x799b('0x39')]({},_0x3f54c2,_0x3c6e2b[_0x799b('0x3b')]);var _0x478c8d={'where':_0x3f54c2[_0x799b('0x36')]};return db[_0x799b('0x27')]['count'](_0x478c8d)[_0x799b('0x20')](function(_0x2bb594){_0x1b58bd[_0x799b('0x1c')]=_0x2bb594;if(_0x3c6e2b[_0x799b('0x2d')][_0x799b('0x3c')]){_0x3f54c2['include']=[{'all':!![]}];}return db[_0x799b('0x27')][_0x799b('0x3d')](_0x3f54c2);})[_0x799b('0x20')](function(_0x2adcc9){_0x1b58bd['rows']=_0x2adcc9;return _0x1b58bd;})[_0x799b('0x20')](respondWithFilteredResult(_0x467788,_0x3f54c2))[_0x799b('0x3e')](handleError(_0x467788,null));};exports[_0x799b('0x3f')]=function(_0x22a2ed,_0x71a15c){var _0x419b11={'raw':!![],'where':{'id':_0x22a2ed[_0x799b('0x40')]['id']}},_0x3101c0={};_0x3101c0[_0x799b('0x2c')]=_[_0x799b('0x2e')](db[_0x799b('0x27')][_0x799b('0x28')]);_0x3101c0[_0x799b('0x2d')]=_['keys'](_0x22a2ed['query']);_0x3101c0[_0x799b('0x2f')]=_[_0x799b('0x30')](_0x3101c0[_0x799b('0x2c')],_0x3101c0['query']);_0x419b11[_0x799b('0x31')]=_['intersection'](_0x3101c0[_0x799b('0x2c')],qs[_0x799b('0x32')](_0x22a2ed[_0x799b('0x2d')][_0x799b('0x32')]));_0x419b11[_0x799b('0x31')]=_0x419b11[_0x799b('0x31')][_0x799b('0x33')]?_0x419b11['attributes']:_0x3101c0[_0x799b('0x2c')];if(_0x22a2ed['query'][_0x799b('0x3c')]){_0x419b11[_0x799b('0x41')]=[{'all':!![]}];}_0x419b11=_[_0x799b('0x39')]({},_0x419b11,_0x22a2ed[_0x799b('0x3b')]);return db[_0x799b('0x27')][_0x799b('0x42')](_0x419b11)[_0x799b('0x20')](handleEntityNotFound(_0x71a15c,null))[_0x799b('0x20')](respondWithResult(_0x71a15c,null))['catch'](handleError(_0x71a15c,null));};exports[_0x799b('0x43')]=function(_0x561a11,_0x35d15e){if(_0x561a11['body']['id']){delete _0x561a11[_0x799b('0x44')]['id'];}return db['CmHopperBlack'][_0x799b('0x42')]({'where':{'id':_0x561a11[_0x799b('0x40')]['id']}})[_0x799b('0x20')](handleEntityNotFound(_0x35d15e,null))['then'](saveUpdates(_0x561a11[_0x799b('0x44')],null))[_0x799b('0x20')](respondWithResult(_0x35d15e,null))['catch'](handleError(_0x35d15e,null));};exports[_0x799b('0x45')]=function(_0x40bddd,_0x11bea0){return db['CmHopperBlack'][_0x799b('0x42')]({'where':{'id':_0x40bddd[_0x799b('0x40')]['id']}})['then'](handleEntityNotFound(_0x11bea0,null))['then'](removeEntity(_0x11bea0,null))[_0x799b('0x3e')](handleError(_0x11bea0,null));};exports[_0x799b('0x46')]=function(_0x2e2171,_0x48e5c5){return db[_0x799b('0x27')][_0x799b('0x46')]()['then'](respondWithResult(_0x48e5c5,null))[_0x799b('0x3e')](handleError(_0x48e5c5,null));}; \ No newline at end of file +var _0x48b9=['key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','type','VIRTUAL','filter','merge','include','findAll','catch','show','params','includeAll','options','find','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','apply','reject','save','then','end','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48b9,0xeb));var _0x948b=function(_0x105045,_0x2e471e){_0x105045=_0x105045-0x0;var _0x2487d0=_0x48b9[_0x105045];return _0x2487d0;};'use strict';var emlformat=require(_0x948b('0x0'));var rimraf=require(_0x948b('0x1'));var zipdir=require(_0x948b('0x2'));var jsonpatch=require(_0x948b('0x3'));var rp=require(_0x948b('0x4'));var moment=require(_0x948b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x948b('0x6'));var path=require(_0x948b('0x7'));var sox=require('sox');var csv=require(_0x948b('0x8'));var ejs=require(_0x948b('0x9'));var fs=require('fs');var fs_extra=require(_0x948b('0xa'));var _=require('lodash');var squel=require(_0x948b('0xb'));var crypto=require(_0x948b('0xc'));var jsforce=require(_0x948b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x948b('0xe'));var Papa=require(_0x948b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x948b('0x10'));var hardwareService=require(_0x948b('0x11'));var logger=require('../../config/logger')(_0x948b('0x12'));var utils=require('../../config/utils');var config=require(_0x948b('0x13'));var licenseUtil=require(_0x948b('0x14'));var db=require(_0x948b('0x15'))['db'];function respondWithStatusCode(_0x32f094,_0x7579c6){_0x7579c6=_0x7579c6||0xcc;return function(_0x32791e){if(_0x32791e){return _0x32f094['sendStatus'](_0x7579c6);}return _0x32f094[_0x948b('0x16')](_0x7579c6)['end']();};}function respondWithResult(_0x13fb8f,_0x5be548){_0x5be548=_0x5be548||0xc8;return function(_0x36a6a9){if(_0x36a6a9){return _0x13fb8f[_0x948b('0x16')](_0x5be548)['json'](_0x36a6a9);}};}function respondWithFilteredResult(_0x44e263,_0x4f53be){return function(_0x41fc2f){if(_0x41fc2f){var _0x5139fe=typeof _0x4f53be[_0x948b('0x17')]===_0x948b('0x18')&&typeof _0x4f53be[_0x948b('0x19')]===_0x948b('0x18');var _0x361601=_0x41fc2f['count'];var _0x345764=_0x5139fe?0x0:_0x4f53be[_0x948b('0x17')];var _0x275886=_0x5139fe?_0x41fc2f[_0x948b('0x1a')]:_0x4f53be['offset']+_0x4f53be['limit'];var _0x1670b9;if(_0x275886>=_0x361601){_0x275886=_0x361601;_0x1670b9=0xc8;}else{_0x1670b9=0xce;}_0x44e263['status'](_0x1670b9);return _0x44e263['set']('Content-Range',_0x345764+'-'+_0x275886+'/'+_0x361601)['json'](_0x41fc2f);}return null;};}function patchUpdates(_0x2514c2){return function(_0x1a6257){try{jsonpatch[_0x948b('0x1b')](_0x1a6257,_0x2514c2,!![]);}catch(_0x46a2a6){return BPromise[_0x948b('0x1c')](_0x46a2a6);}return _0x1a6257[_0x948b('0x1d')]();};}function saveUpdates(_0x314ce5,_0x373899){return function(_0x26ca12){if(_0x26ca12){return _0x26ca12['update'](_0x314ce5)[_0x948b('0x1e')](function(_0xef49b0){return _0xef49b0;});}return null;};}function removeEntity(_0xe632a0,_0x1c9d47){return function(_0x10740a){if(_0x10740a){return _0x10740a['destroy']()['then'](function(){_0xe632a0[_0x948b('0x16')](0xcc)[_0x948b('0x1f')]();});}};}function handleEntityNotFound(_0x194fc0,_0x24133b){return function(_0x27d22c){if(!_0x27d22c){_0x194fc0['sendStatus'](0x194);}return _0x27d22c;};}function handleError(_0x13306a,_0x24db39){_0x24db39=_0x24db39||0x1f4;return function(_0x255a9f){logger[_0x948b('0x20')](_0x255a9f[_0x948b('0x21')]);if(_0x255a9f[_0x948b('0x22')]){delete _0x255a9f['name'];}_0x13306a[_0x948b('0x16')](_0x24db39)[_0x948b('0x23')](_0x255a9f);};}exports[_0x948b('0x24')]=function(_0x35a31d,_0x326155){var _0x3008ee={},_0x591ac7={},_0x2bb620={'count':0x0,'rows':[]};var _0x55171e=_[_0x948b('0x25')](db[_0x948b('0x26')][_0x948b('0x27')],function(_0x4a8398){return{'name':_0x4a8398[_0x948b('0x28')],'type':_0x4a8398['type'][_0x948b('0x29')]};});_0x591ac7[_0x948b('0x2a')]=_[_0x948b('0x25')](_0x55171e,'name');_0x591ac7[_0x948b('0x2b')]=_[_0x948b('0x2c')](_0x35a31d[_0x948b('0x2b')]);_0x591ac7['filters']=_[_0x948b('0x2d')](_0x591ac7[_0x948b('0x2a')],_0x591ac7[_0x948b('0x2b')]);_0x3008ee[_0x948b('0x2e')]=_[_0x948b('0x2d')](_0x591ac7[_0x948b('0x2a')],qs[_0x948b('0x2f')](_0x35a31d['query'][_0x948b('0x2f')]));_0x3008ee[_0x948b('0x2e')]=_0x3008ee[_0x948b('0x2e')]['length']?_0x3008ee[_0x948b('0x2e')]:_0x591ac7[_0x948b('0x2a')];if(!_0x35a31d[_0x948b('0x2b')][_0x948b('0x30')](_0x948b('0x31'))){_0x3008ee[_0x948b('0x19')]=qs[_0x948b('0x19')](_0x35a31d[_0x948b('0x2b')]['limit']);_0x3008ee[_0x948b('0x17')]=qs[_0x948b('0x17')](_0x35a31d[_0x948b('0x2b')]['offset']);}_0x3008ee[_0x948b('0x32')]=qs['sort'](_0x35a31d[_0x948b('0x2b')][_0x948b('0x33')]);_0x3008ee['where']=qs[_0x948b('0x34')](_['pick'](_0x35a31d[_0x948b('0x2b')],_0x591ac7['filters']),_0x55171e);if(_0x35a31d[_0x948b('0x2b')]['filter']){_0x3008ee[_0x948b('0x35')]=_['merge'](_0x3008ee['where'],{'$or':_['map'](_0x55171e,function(_0x4f8783){if(_0x4f8783[_0x948b('0x36')]!==_0x948b('0x37')){var _0x3586ae={};_0x3586ae[_0x4f8783[_0x948b('0x22')]]={'$like':'%'+_0x35a31d['query'][_0x948b('0x38')]+'%'};return _0x3586ae;}})});}_0x3008ee=_[_0x948b('0x39')]({},_0x3008ee,_0x35a31d['options']);var _0x1cc28e={'where':_0x3008ee[_0x948b('0x35')]};return db[_0x948b('0x26')]['count'](_0x1cc28e)[_0x948b('0x1e')](function(_0x519b15){_0x2bb620['count']=_0x519b15;if(_0x35a31d[_0x948b('0x2b')]['includeAll']){_0x3008ee[_0x948b('0x3a')]=[{'all':!![]}];}return db[_0x948b('0x26')][_0x948b('0x3b')](_0x3008ee);})['then'](function(_0x4ed54f){_0x2bb620['rows']=_0x4ed54f;return _0x2bb620;})['then'](respondWithFilteredResult(_0x326155,_0x3008ee))[_0x948b('0x3c')](handleError(_0x326155,null));};exports[_0x948b('0x3d')]=function(_0x1fe6e6,_0x5bf1e9){var _0x15f00b={'raw':!![],'where':{'id':_0x1fe6e6[_0x948b('0x3e')]['id']}},_0x44218d={};_0x44218d['model']=_[_0x948b('0x2c')](db[_0x948b('0x26')][_0x948b('0x27')]);_0x44218d[_0x948b('0x2b')]=_[_0x948b('0x2c')](_0x1fe6e6[_0x948b('0x2b')]);_0x44218d[_0x948b('0x34')]=_[_0x948b('0x2d')](_0x44218d[_0x948b('0x2a')],_0x44218d[_0x948b('0x2b')]);_0x15f00b[_0x948b('0x2e')]=_[_0x948b('0x2d')](_0x44218d[_0x948b('0x2a')],qs[_0x948b('0x2f')](_0x1fe6e6['query'][_0x948b('0x2f')]));_0x15f00b[_0x948b('0x2e')]=_0x15f00b[_0x948b('0x2e')]['length']?_0x15f00b[_0x948b('0x2e')]:_0x44218d[_0x948b('0x2a')];if(_0x1fe6e6[_0x948b('0x2b')][_0x948b('0x3f')]){_0x15f00b['include']=[{'all':!![]}];}_0x15f00b=_['merge']({},_0x15f00b,_0x1fe6e6[_0x948b('0x40')]);return db['CmHopperBlack'][_0x948b('0x41')](_0x15f00b)[_0x948b('0x1e')](handleEntityNotFound(_0x5bf1e9,null))[_0x948b('0x1e')](respondWithResult(_0x5bf1e9,null))[_0x948b('0x3c')](handleError(_0x5bf1e9,null));};exports[_0x948b('0x42')]=function(_0x5cb82c,_0x272aa6){if(_0x5cb82c[_0x948b('0x43')]['id']){delete _0x5cb82c['body']['id'];}return db[_0x948b('0x26')][_0x948b('0x41')]({'where':{'id':_0x5cb82c[_0x948b('0x3e')]['id']}})[_0x948b('0x1e')](handleEntityNotFound(_0x272aa6,null))[_0x948b('0x1e')](saveUpdates(_0x5cb82c[_0x948b('0x43')],null))[_0x948b('0x1e')](respondWithResult(_0x272aa6,null))['catch'](handleError(_0x272aa6,null));};exports['destroy']=function(_0xffcba6,_0x2b3d65){return db[_0x948b('0x26')][_0x948b('0x41')]({'where':{'id':_0xffcba6[_0x948b('0x3e')]['id']}})[_0x948b('0x1e')](handleEntityNotFound(_0x2b3d65,null))[_0x948b('0x1e')](removeEntity(_0x2b3d65,null))['catch'](handleError(_0x2b3d65,null));};exports[_0x948b('0x44')]=function(_0x4a4672,_0x42c082){return db[_0x948b('0x26')][_0x948b('0x44')]()[_0x948b('0x1e')](respondWithResult(_0x42c082,null))['catch'](handleError(_0x42c082,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index ad8e910..6a81d25 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 _0xb0c9=['cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4f6f04,_0x59c6ba){var _0x606b2c=function(_0x35da06){while(--_0x35da06){_0x4f6f04['push'](_0x4f6f04['shift']());}};_0x606b2c(++_0x59c6ba);}(_0xb0c9,0x139));var _0x9b0c=function(_0x4c16cf,_0x311772){_0x4c16cf=_0x4c16cf-0x0;var _0x1ac4ae=_0xb0c9[_0x4c16cf];return _0x1ac4ae;};'use strict';var _=require(_0x9b0c('0x0'));var util=require(_0x9b0c('0x1'));var logger=require(_0x9b0c('0x2'))(_0x9b0c('0x3'));var moment=require('moment');var BPromise=require(_0x9b0c('0x4'));var rp=require(_0x9b0c('0x5'));var fs=require('fs');var path=require(_0x9b0c('0x6'));var rimraf=require(_0x9b0c('0x7'));var config=require(_0x9b0c('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0x9b0c('0x9')]=function(_0x4a3073,_0x279437){return _0x4a3073[_0x9b0c('0xa')]('CmHopperBlack',attributes,{'tableName':_0x9b0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb178=['../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5bf82a,_0x368b0b){var _0x2506b4=function(_0x598892){while(--_0x598892){_0x5bf82a['push'](_0x5bf82a['shift']());}};_0x2506b4(++_0x368b0b);}(_0xb178,0x1e6));var _0x8b17=function(_0xf1b134,_0xb399dd){_0xf1b134=_0xf1b134-0x0;var _0x139dbb=_0xb178[_0xf1b134];return _0x139dbb;};'use strict';var _=require(_0x8b17('0x0'));var util=require(_0x8b17('0x1'));var logger=require(_0x8b17('0x2'))(_0x8b17('0x3'));var moment=require(_0x8b17('0x4'));var BPromise=require(_0x8b17('0x5'));var rp=require(_0x8b17('0x6'));var fs=require('fs');var path=require(_0x8b17('0x7'));var rimraf=require('rimraf');var config=require(_0x8b17('0x8'));var attributes=require(_0x8b17('0x9'));module[_0x8b17('0xa')]=function(_0x50764f,_0x509bf2){return _0x50764f[_0x8b17('0xb')](_0x8b17('0xc'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 493e569..9ec0b46 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 _0xe51a=['UpdateCmHopperBlack','update','stringify','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','where','attributes','limit','include','map','model','then'];(function(_0x25d68d,_0x69adf9){var _0x3f5c89=function(_0x27791a){while(--_0x27791a){_0x25d68d['push'](_0x25d68d['shift']());}};_0x3f5c89(++_0x69adf9);}(_0xe51a,0x1a7));var _0xae51=function(_0x5c1db8,_0x57d07d){_0x5c1db8=_0x5c1db8-0x0;var _0x2677fb=_0xe51a[_0x5c1db8];return _0x2677fb;};'use strict';var _=require(_0xae51('0x0'));var util=require(_0xae51('0x1'));var moment=require(_0xae51('0x2'));var BPromise=require(_0xae51('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae51('0x4'));var db=require(_0xae51('0x5'))['db'];var utils=require(_0xae51('0x6'));var logger=require('../../config/logger')(_0xae51('0x7'));var config=require(_0xae51('0x8'));var jayson=require(_0xae51('0x9'));var client=jayson[_0xae51('0xa')][_0xae51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x474c80,_0x2188c0,_0x538eda){return new BPromise(function(_0x2a3194,_0x4c40ca){return client[_0xae51('0xc')](_0x474c80,_0x538eda)['then'](function(_0xde6116){logger[_0xae51('0xd')](_0xae51('0xe'),_0x2188c0,_0xae51('0xf'));logger[_0xae51('0x10')](_0xae51('0x11'),_0x2188c0,_0xae51('0xf'),JSON['stringify'](_0xde6116));if(_0xde6116[_0xae51('0x12')]){if(_0xde6116[_0xae51('0x12')][_0xae51('0x13')]===0x1f4){logger[_0xae51('0x12')](_0xae51('0xe'),_0x2188c0,_0xde6116[_0xae51('0x12')][_0xae51('0x14')]);return _0x4c40ca(_0xde6116[_0xae51('0x12')][_0xae51('0x14')]);}logger[_0xae51('0x12')](_0xae51('0xe'),_0x2188c0,_0xde6116[_0xae51('0x12')][_0xae51('0x14')]);return _0x2a3194(_0xde6116[_0xae51('0x12')][_0xae51('0x14')]);}else{logger[_0xae51('0xd')](_0xae51('0xe'),_0x2188c0,_0xae51('0xf'));_0x2a3194(_0xde6116[_0xae51('0x15')][_0xae51('0x14')]);}})[_0xae51('0x16')](function(_0x472913){logger[_0xae51('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x2188c0,_0x472913);_0x4c40ca(_0x472913);});});}exports[_0xae51('0x17')]=function(_0x4f060a){var _0x1675ee=this;return new Promise(function(_0x4c206a,_0x28dce3){return db[_0xae51('0x18')]['findAll']({'raw':_0x4f060a[_0xae51('0x19')]?_0x4f060a[_0xae51('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f060a[_0xae51('0x19')]?_0x4f060a[_0xae51('0x19')][_0xae51('0x1a')]||null:null,'attributes':_0x4f060a[_0xae51('0x19')]?_0x4f060a['options'][_0xae51('0x1b')]||null:null,'limit':_0x4f060a['options']?_0x4f060a['options'][_0xae51('0x1c')]||null:null,'include':_0x4f060a[_0xae51('0x19')]?_0x4f060a['options'][_0xae51('0x1d')]?_[_0xae51('0x1e')](_0x4f060a[_0xae51('0x19')]['include'],function(_0x37c87b){return{'model':db[_0x37c87b['model']],'as':_0x37c87b['as'],'attributes':_0x37c87b[_0xae51('0x1b')],'include':_0x37c87b[_0xae51('0x1d')]?_['map'](_0x37c87b[_0xae51('0x1d')],function(_0x1c0c40){return{'model':db[_0x1c0c40[_0xae51('0x1f')]],'as':_0x1c0c40['as'],'attributes':_0x1c0c40[_0xae51('0x1b')],'include':_0x1c0c40[_0xae51('0x1d')]?_[_0xae51('0x1e')](_0x1c0c40['include'],function(_0x52a44){return{'model':db[_0x52a44[_0xae51('0x1f')]],'as':_0x52a44['as'],'attributes':_0x52a44['attributes']};}):[]};}):[]};}):[]:[]})[_0xae51('0x20')](function(_0x1e6f1b){logger['info'](_0xae51('0x17'),_0x4f060a);logger[_0xae51('0x10')]('GetCmHopperBlack',_0x4f060a,JSON['stringify'](_0x1e6f1b));_0x4c206a(_0x1e6f1b);})[_0xae51('0x16')](function(_0x16a1e4){logger[_0xae51('0x12')](_0xae51('0x17'),_0x16a1e4[_0xae51('0x14')],_0x4f060a);_0x28dce3(_0x1675ee[_0xae51('0x12')](0x1f4,_0x16a1e4[_0xae51('0x14')]));});});};exports[_0xae51('0x21')]=function(_0x37058c){var _0x539502=this;return new Promise(function(_0x3b85b5,_0x33a637){return db[_0xae51('0x18')][_0xae51('0x22')](_0x37058c['body'],{'raw':_0x37058c['options']?_0x37058c[_0xae51('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37058c[_0xae51('0x19')]?_0x37058c[_0xae51('0x19')][_0xae51('0x1a')]||null:null,'attributes':_0x37058c[_0xae51('0x19')]?_0x37058c[_0xae51('0x19')][_0xae51('0x1b')]||null:null,'limit':_0x37058c[_0xae51('0x19')]?_0x37058c[_0xae51('0x19')]['limit']||null:null})[_0xae51('0x20')](function(_0x15ee15){logger['info']('UpdateCmHopperBlack',_0x37058c);logger[_0xae51('0x10')]('UpdateCmHopperBlack',_0x37058c,JSON[_0xae51('0x23')](_0x15ee15));_0x3b85b5(_0x15ee15);})['catch'](function(_0x26d953){logger['error'](_0xae51('0x21'),_0x26d953[_0xae51('0x14')],_0x37058c);_0x33a637(_0x539502[_0xae51('0x12')](0x1f4,_0x26d953[_0xae51('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x221097){var _0x50d2d4=this;return new Promise(function(_0x29b0fd,_0x3eea4f){return db[_0xae51('0x18')][_0xae51('0x24')]({'where':_0x221097['options']?_0x221097[_0xae51('0x19')]['where']||null:null})['then'](function(_0x5d4763){logger[_0xae51('0xd')](_0xae51('0x25'),_0x221097);logger['debug']('DestroyCmHopperBlack',_0x221097,JSON[_0xae51('0x23')](_0x5d4763));_0x29b0fd(_0x5d4763);})[_0xae51('0x16')](function(_0x4a3506){logger['error'](_0xae51('0x25'),_0x4a3506[_0xae51('0x14')],_0x221097);_0x3eea4f(_0x50d2d4[_0xae51('0x12')](0x1f4,_0x4a3506[_0xae51('0x14')]));});});}; \ No newline at end of file +var _0x6961=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','body','debug','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3e0212,_0x890e53){var _0x23e856=function(_0x211696){while(--_0x211696){_0x3e0212['push'](_0x3e0212['shift']());}};_0x23e856(++_0x890e53);}(_0x6961,0x159));var _0x1696=function(_0x15c19a,_0xd4667b){_0x15c19a=_0x15c19a-0x0;var _0x3290d9=_0x6961[_0x15c19a];return _0x3290d9;};'use strict';var _=require(_0x1696('0x0'));var util=require(_0x1696('0x1'));var moment=require(_0x1696('0x2'));var BPromise=require('bluebird');var rs=require(_0x1696('0x3'));var fs=require('fs');var Redis=require(_0x1696('0x4'));var db=require(_0x1696('0x5'))['db'];var utils=require(_0x1696('0x6'));var logger=require('../../config/logger')(_0x1696('0x7'));var config=require('../../config/environment');var jayson=require(_0x1696('0x8'));var client=jayson[_0x1696('0x9')][_0x1696('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb62e4c,_0x50781d,_0xcd0eb5){return new BPromise(function(_0x2f69c1,_0xe18237){return client[_0x1696('0xb')](_0xb62e4c,_0xcd0eb5)[_0x1696('0xc')](function(_0x63be36){logger[_0x1696('0xd')](_0x1696('0xe'),_0x50781d,_0x1696('0xf'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x50781d,'request\x20sent',JSON[_0x1696('0x10')](_0x63be36));if(_0x63be36[_0x1696('0x11')]){if(_0x63be36[_0x1696('0x11')][_0x1696('0x12')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x50781d,_0x63be36[_0x1696('0x11')][_0x1696('0x13')]);return _0xe18237(_0x63be36[_0x1696('0x11')][_0x1696('0x13')]);}logger['error'](_0x1696('0xe'),_0x50781d,_0x63be36[_0x1696('0x11')][_0x1696('0x13')]);return _0x2f69c1(_0x63be36[_0x1696('0x11')][_0x1696('0x13')]);}else{logger['info'](_0x1696('0xe'),_0x50781d,'request\x20sent');_0x2f69c1(_0x63be36[_0x1696('0x14')][_0x1696('0x13')]);}})[_0x1696('0x15')](function(_0x43e20e){logger[_0x1696('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x50781d,_0x43e20e);_0xe18237(_0x43e20e);});});}exports['GetCmHopperBlack']=function(_0x5133b4){var _0x59a908=this;return new Promise(function(_0x5ef98a,_0x27a06b){return db[_0x1696('0x16')][_0x1696('0x17')]({'raw':_0x5133b4[_0x1696('0x18')]?_0x5133b4['options'][_0x1696('0x19')]===undefined?!![]:![]:!![],'where':_0x5133b4[_0x1696('0x18')]?_0x5133b4[_0x1696('0x18')][_0x1696('0x1a')]||null:null,'attributes':_0x5133b4[_0x1696('0x18')]?_0x5133b4[_0x1696('0x18')][_0x1696('0x1b')]||null:null,'limit':_0x5133b4['options']?_0x5133b4['options'][_0x1696('0x1c')]||null:null,'include':_0x5133b4[_0x1696('0x18')]?_0x5133b4[_0x1696('0x18')][_0x1696('0x1d')]?_[_0x1696('0x1e')](_0x5133b4[_0x1696('0x18')][_0x1696('0x1d')],function(_0x1a0928){return{'model':db[_0x1a0928['model']],'as':_0x1a0928['as'],'attributes':_0x1a0928['attributes'],'include':_0x1a0928[_0x1696('0x1d')]?_[_0x1696('0x1e')](_0x1a0928['include'],function(_0x4b871a){return{'model':db[_0x4b871a[_0x1696('0x1f')]],'as':_0x4b871a['as'],'attributes':_0x4b871a[_0x1696('0x1b')],'include':_0x4b871a[_0x1696('0x1d')]?_[_0x1696('0x1e')](_0x4b871a[_0x1696('0x1d')],function(_0x1d6311){return{'model':db[_0x1d6311['model']],'as':_0x1d6311['as'],'attributes':_0x1d6311[_0x1696('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1696('0xc')](function(_0x27f585){logger[_0x1696('0xd')](_0x1696('0x20'),_0x5133b4);logger['debug']('GetCmHopperBlack',_0x5133b4,JSON[_0x1696('0x10')](_0x27f585));_0x5ef98a(_0x27f585);})[_0x1696('0x15')](function(_0x3d39c5){logger[_0x1696('0x11')]('GetCmHopperBlack',_0x3d39c5[_0x1696('0x13')],_0x5133b4);_0x27a06b(_0x59a908['error'](0x1f4,_0x3d39c5[_0x1696('0x13')]));});});};exports[_0x1696('0x21')]=function(_0x41597d){var _0x4748cd=this;return new Promise(function(_0x4766bd,_0x5a0348){return db['CmHopperBlack'][_0x1696('0x22')](_0x41597d[_0x1696('0x23')],{'raw':_0x41597d['options']?_0x41597d[_0x1696('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41597d['options']?_0x41597d['options'][_0x1696('0x1a')]||null:null,'attributes':_0x41597d['options']?_0x41597d[_0x1696('0x18')][_0x1696('0x1b')]||null:null,'limit':_0x41597d[_0x1696('0x18')]?_0x41597d['options'][_0x1696('0x1c')]||null:null})['then'](function(_0x3a5a37){logger['info']('UpdateCmHopperBlack',_0x41597d);logger[_0x1696('0x24')](_0x1696('0x21'),_0x41597d,JSON[_0x1696('0x10')](_0x3a5a37));_0x4766bd(_0x3a5a37);})[_0x1696('0x15')](function(_0x4db696){logger['error']('UpdateCmHopperBlack',_0x4db696[_0x1696('0x13')],_0x41597d);_0x5a0348(_0x4748cd['error'](0x1f4,_0x4db696['message']));});});};exports[_0x1696('0x25')]=function(_0x442433){var _0x1646c9=this;return new Promise(function(_0x27d5cc,_0xe65a39){return db['CmHopperBlack'][_0x1696('0x26')]({'where':_0x442433[_0x1696('0x18')]?_0x442433[_0x1696('0x18')]['where']||null:null})['then'](function(_0x57ae3d){logger[_0x1696('0xd')](_0x1696('0x25'),_0x442433);logger[_0x1696('0x24')]('DestroyCmHopperBlack',_0x442433,JSON[_0x1696('0x10')](_0x57ae3d));_0x27d5cc(_0x57ae3d);})[_0x1696('0x15')](function(_0xd68e62){logger['error'](_0x1696('0x25'),_0xd68e62['message'],_0x442433);_0xe65a39(_0x1646c9['error'](0x1f4,_0xd68e62[_0x1696('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 753bba5..86864be 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 _0xffd6=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','/:id','update','delete','destroy','multer','util'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xffd6,0x97));var _0x6ffd=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0xffd6[_0x5c2a2b];return _0x19921f;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ffd('0x3')]();var fs_extra=require(_0x6ffd('0x4'));var auth=require(_0x6ffd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller['index']);router[_0x6ffd('0x8')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xb')]);router[_0x6ffd('0x8')]('/:id',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xc')]);router['put'](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xe')]);router[_0x6ffd('0xf')](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7096=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update'];(function(_0x18c507,_0x398fbb){var _0x16763d=function(_0x3f7e2f){while(--_0x3f7e2f){_0x18c507['push'](_0x18c507['shift']());}};_0x16763d(++_0x398fbb);}(_0x7096,0x10c));var _0x6709=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7096[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0xe')](_0x6709('0xf'),auth[_0x6709('0x9')](),controller[_0x6709('0x10')]);router['delete']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0x11')]);module[_0x6709('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index f9cf2ee..d3c22ff 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 _0x7dca=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime'];(function(_0x1d2c4d,_0x53708e){var _0x4c89e3=function(_0x598c8d){while(--_0x598c8d){_0x1d2c4d['push'](_0x1d2c4d['shift']());}};_0x4c89e3(++_0x53708e);}(_0x7dca,0x16b));var _0xa7dc=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0x7dca[_0x609988];return _0x159984;};'use strict';var Sequelize=require(_0xa7dc('0x0'));var moment=require(_0xa7dc('0x1'));module[_0xa7dc('0x2')]={'state':{'type':Sequelize[_0xa7dc('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xa7dc('0x4')]},'scheduledat':{'type':Sequelize[_0xa7dc('0x5')]},'countbusyretry':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xa7dc('0x4')]},'originatecalleridname':{'type':Sequelize[_0xa7dc('0x4')]},'calleridnum':{'type':Sequelize[_0xa7dc('0x4')]},'calleridname':{'type':Sequelize[_0xa7dc('0x4')]},'starttime':{'type':Sequelize[_0xa7dc('0x5')]},'responsetime':{'type':Sequelize[_0xa7dc('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xa7dc('0x5')]},'endtime':{'type':Sequelize[_0xa7dc('0x5')]},'ringtime':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa7dc('0x4')]},'campaign':{'type':Sequelize[_0xa7dc('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa7dc('0x4')]},'disposition':{'type':Sequelize[_0xa7dc('0x4')]},'secondDisposition':{'type':Sequelize[_0xa7dc('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4ca8a5){var _0x1ebf33=this['getDataValue'](_0xa7dc('0x6'));if(_0x1ebf33&&_0x4ca8a5){this[_0xa7dc('0x7')](_0xa7dc('0x8'),moment(_0x4ca8a5)['diff'](moment(_0x1ebf33),_0xa7dc('0x9')));}return this[_0xa7dc('0x7')](_0xa7dc('0xa'),_0x4ca8a5);}},'amd':{'type':Sequelize[_0xa7dc('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa7dc('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa7dc('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa7dc('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa7dc('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa7dc('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xa7dc('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa7dc('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa7dc('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa7dc('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf4cf=['STRING','DATE','getDataValue','endtime','followuptime','diff','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x5ae6f6,_0x1ca2fc){var _0x2154d2=function(_0x368a1c){while(--_0x368a1c){_0x5ae6f6['push'](_0x5ae6f6['shift']());}};_0x2154d2(++_0x1ca2fc);}(_0xf4cf,0xc8));var _0xff4c=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xf4cf[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0xff4c('0x0'));var moment=require(_0xff4c('0x1'));module[_0xff4c('0x2')]={'state':{'type':Sequelize[_0xff4c('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xff4c('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xff4c('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xff4c('0x4')]},'calleridname':{'type':Sequelize[_0xff4c('0x4')]},'starttime':{'type':Sequelize[_0xff4c('0x5')]},'responsetime':{'type':Sequelize[_0xff4c('0x5')]},'answertime':{'type':Sequelize[_0xff4c('0x5')]},'droptime':{'type':Sequelize[_0xff4c('0x5')]},'endtime':{'type':Sequelize[_0xff4c('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xff4c('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xff4c('0x4')]},'membername':{'type':Sequelize[_0xff4c('0x4')]},'reason':{'type':Sequelize[_0xff4c('0x4')]},'disposition':{'type':Sequelize[_0xff4c('0x4')]},'secondDisposition':{'type':Sequelize[_0xff4c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xff4c('0x4')]},'dispositionat':{'type':Sequelize[_0xff4c('0x5')],'set':function(_0x380d63){var _0x131e2d=this[_0xff4c('0x6')](_0xff4c('0x7'));if(_0x131e2d&&_0x380d63){this['setDataValue'](_0xff4c('0x8'),moment(_0x380d63)[_0xff4c('0x9')](moment(_0x131e2d),'seconds'));}return this['setDataValue'](_0xff4c('0xa'),_0x380d63);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xff4c('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xff4c('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xff4c('0x5')]},'callback':{'type':Sequelize[_0xff4c('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xff4c('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xff4c('0x5')]},'deleted':{'type':Sequelize[_0xff4c('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xff4c('0x5')]},'recallme':{'type':Sequelize[_0xff4c('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xff4c('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xff4c('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 74f4288..a084e2e 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 _0x7c09=['sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','noAnswerContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','state\x20=\x204','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x580545,_0x3ad6fb){var _0x539ea3=function(_0x1d2186){while(--_0x1d2186){_0x580545['push'](_0x580545['shift']());}};_0x539ea3(++_0x3ad6fb);}(_0x7c09,0x102));var _0x97c0=function(_0x4a68af,_0x59bad4){_0x4a68af=_0x4a68af-0x0;var _0x31f5c3=_0x7c09[_0x4a68af];return _0x31f5c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['CmHopperFinal'][_0x97c0('0x48')]()[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,null))[_0x97c0('0x43')](handleError(_0x4ff0a5,null));};exports['update']=function(_0x3e09d5,_0xac56ac){if(_0x3e09d5[_0x97c0('0x49')][_0x97c0('0x4a')]){delete _0x3e09d5[_0x97c0('0x49')]['uniqueid'];}return db[_0x97c0('0x2b')][_0x97c0('0x47')]({'where':{'uniqueid':_0x3e09d5[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0xac56ac,null))['then'](saveUpdates(_0x3e09d5[_0x97c0('0x49')],null))['then'](respondWithResult(_0xac56ac,null))['catch'](handleError(_0xac56ac,null));};exports[_0x97c0('0x4b')]=function(_0x20e2a5,_0x23c7ad,_0x53a255){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x20e2a5[_0x97c0('0x45')]['id']},'attributes':[[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x4f')))),'noSuchContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x50')))),'noAnswerContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x53')))),_0x97c0('0x54')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x55')))),_0x97c0('0x56')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x59')))),'reCallContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x97c0('0x5a')]]})[_0x97c0('0x24')](handleEntityNotFound(_0x23c7ad,null))[_0x97c0('0x24')](respondWithResult(_0x23c7ad,null))[_0x97c0('0x43')](handleError(_0x23c7ad,null));};exports[_0x97c0('0x5b')]=function(_0x2bb5d3,_0x52643e,_0x3349df){return db[_0x97c0('0x2b')][_0x97c0('0x41')]({'raw':![],'where':{'CampaignId':_0x2bb5d3[_0x97c0('0x45')]['id']},'attributes':[[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x200,\x201,\x20null'))),_0x97c0('0x5c')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x50')))),_0x97c0('0x5d')],[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),_0x97c0('0x54')],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x55')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x59')))),_0x97c0('0x5e')],[db[_0x97c0('0x4c')]['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x5f')))),_0x97c0('0x5a')]]})['then'](handleEntityNotFound(_0x52643e,null))[_0x97c0('0x24')](respondWithResult(_0x52643e,null))[_0x97c0('0x43')](handleError(_0x52643e,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x4116c9,_0x30ffa8,_0x1cfe22){return db['VoiceQueue'][_0x97c0('0x47')]({'where':{'id':_0x4116c9[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x30ffa8,null))[_0x97c0('0x24')](function(_0x4d40cd){var _0x4ee6a2;if(_0x4d40cd){_0x4ee6a2=squel['insert']()[_0x97c0('0x60')](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),_0x97c0('0x66'),_0x97c0('0x67'),'createdAt','updatedAt'],squel[_0x97c0('0x68')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x64'))[_0x97c0('0x69')](_0x97c0('0x6b'),'ContactId')['field'](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x6d'),'VoiceQueueId')[_0x97c0('0x69')]('NOW()',_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x74'),_0x4116c9['body']['state'][_0x97c0('0x73')]())[_0x97c0('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x97c0('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x97c0('0x68')]()[_0x97c0('0x69')]('phone')[_0x97c0('0x70')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]()))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9['params']['id'][_0x97c0('0x73')]())['where']('state\x20=\x204'))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')]['query'](_0x4ee6a2);}return[];})[_0x97c0('0x24')](respondWithResult(_0x30ffa8,null))[_0x97c0('0x43')](handleError(_0x30ffa8,null));};exports[_0x97c0('0x78')]=function(_0x5bb9de,_0x388ba1,_0x550a68){return db[_0x97c0('0x79')][_0x97c0('0x47')]({'where':{'id':_0x5bb9de[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0x388ba1,null))[_0x97c0('0x24')](function(_0x44f6bc){var _0x37cdb3;if(_0x44f6bc){_0x37cdb3=squel[_0x97c0('0x7a')]()['into'](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),'ListId',_0x97c0('0x7b'),_0x97c0('0x6e'),'updatedAt'],squel['select']()[_0x97c0('0x69')](_0x97c0('0x7c'),_0x97c0('0x63'))['field']('NOW()',_0x97c0('0x64'))['field'](_0x97c0('0x6b'),_0x97c0('0x65'))[_0x97c0('0x69')](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x7d'),'CampaignId')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x74'),_0x5bb9de['body'][_0x97c0('0x7f')][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x80'))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x63'))[_0x97c0('0x70')](_0x97c0('0x61'))[_0x97c0('0x39')]('CampaignId\x20=\x20?',_0x5bb9de[_0x97c0('0x45')]['id']['toString']()))[_0x97c0('0x39')](_0x97c0('0x75'),squel[_0x97c0('0x68')]()['field'](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de['params']['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x81')))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')][_0x97c0('0x2f')](_0x37cdb3);}return[];})[_0x97c0('0x24')](respondWithResult(_0x388ba1,null))[_0x97c0('0x43')](handleError(_0x388ba1,null));};exports[_0x97c0('0x82')]=function(_0x3ebd11,_0x44b374,_0x493e62){return db[_0x97c0('0x83')][_0x97c0('0x84')]({'where':{'VoiceQueueId':_0x3ebd11[_0x97c0('0x49')]['VoiceQueueId'],'CampaignId':_0x3ebd11['body'][_0x97c0('0x7b')],'ContactId':_0x3ebd11[_0x97c0('0x49')][_0x97c0('0x65')]}})[_0x97c0('0x24')](handleEntityNotFound(_0x44b374,null))[_0x97c0('0x24')](function(_0x120d78){if(_0x120d78){return _0x120d78;}return null;})[_0x97c0('0x24')](respondWithResult(_0x44b374,null))[_0x97c0('0x43')](handleError(_0x44b374,null));}; \ No newline at end of file +var _0xd8fb=['updatedAt','select','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','toString','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','keys','include','options','find','describe','body','uniqueid','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','reCallContacts','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt'];(function(_0x223f40,_0x4cdcb5){var _0x324161=function(_0x341827){while(--_0x341827){_0x223f40['push'](_0x223f40['shift']());}};_0x324161(++_0x4cdcb5);}(_0xd8fb,0x99));var _0xbd8f=function(_0x548465,_0x19fe53){_0x548465=_0x548465-0x0;var _0x82750=_0xd8fb[_0x548465];return _0x82750;};'use strict';var emlformat=require(_0xbd8f('0x0'));var rimraf=require(_0xbd8f('0x1'));var zipdir=require(_0xbd8f('0x2'));var jsonpatch=require(_0xbd8f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd8f('0x4'));var util=require(_0xbd8f('0x5'));var path=require('path');var sox=require(_0xbd8f('0x6'));var csv=require(_0xbd8f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd8f('0x8'));var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbd8f('0xf'));var hardwareService=require(_0xbd8f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xbd8f('0x11'));var config=require(_0xbd8f('0x12'));var licenseUtil=require(_0xbd8f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xcc;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0x14')](_0x159f09);}return _0x230988[_0xbd8f('0x15')](_0x159f09)[_0xbd8f('0x16')]();};}function respondWithResult(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0xc8;return function(_0x14606c){if(_0x14606c){return _0x37d4d5['status'](_0x29ffe8)[_0xbd8f('0x17')](_0x14606c);}};}function respondWithFilteredResult(_0x829fb2,_0xa57e91){return function(_0x10d72e){if(_0x10d72e){var _0x4da96f=typeof _0xa57e91[_0xbd8f('0x18')]===_0xbd8f('0x19')&&typeof _0xa57e91['limit']===_0xbd8f('0x19');var _0xf5e7a=_0x10d72e['count'];var _0x4435b9=_0x4da96f?0x0:_0xa57e91[_0xbd8f('0x18')];var _0x47d317=_0x4da96f?_0x10d72e['count']:_0xa57e91[_0xbd8f('0x18')]+_0xa57e91['limit'];var _0x5705c5;if(_0x47d317>=_0xf5e7a){_0x47d317=_0xf5e7a;_0x5705c5=0xc8;}else{_0x5705c5=0xce;}_0x829fb2[_0xbd8f('0x15')](_0x5705c5);return _0x829fb2['set'](_0xbd8f('0x1a'),_0x4435b9+'-'+_0x47d317+'/'+_0xf5e7a)[_0xbd8f('0x17')](_0x10d72e);}return null;};}function patchUpdates(_0xb47c8e){return function(_0x897f25){try{jsonpatch[_0xbd8f('0x1b')](_0x897f25,_0xb47c8e,!![]);}catch(_0x20cab7){return BPromise[_0xbd8f('0x1c')](_0x20cab7);}return _0x897f25[_0xbd8f('0x1d')]();};}function saveUpdates(_0x2fbe3b,_0x775acc){return function(_0xfe4048){if(_0xfe4048){return _0xfe4048[_0xbd8f('0x1e')](_0x2fbe3b)[_0xbd8f('0x1f')](function(_0x15c4a9){return _0x15c4a9;});}return null;};}function removeEntity(_0x320ede,_0xd11ae){return function(_0x395b1b){if(_0x395b1b){return _0x395b1b['destroy']()[_0xbd8f('0x1f')](function(){_0x320ede[_0xbd8f('0x15')](0xcc)[_0xbd8f('0x16')]();});}};}function handleEntityNotFound(_0x2f3df7,_0xa88414){return function(_0x2257fd){if(!_0x2257fd){_0x2f3df7[_0xbd8f('0x14')](0x194);}return _0x2257fd;};}function handleError(_0x264e62,_0x4ea554){_0x4ea554=_0x4ea554||0x1f4;return function(_0x40cb43){logger[_0xbd8f('0x20')](_0x40cb43['stack']);if(_0x40cb43[_0xbd8f('0x21')]){delete _0x40cb43['name'];}_0x264e62[_0xbd8f('0x15')](_0x4ea554)[_0xbd8f('0x22')](_0x40cb43);};}exports[_0xbd8f('0x23')]=function(_0x202126,_0x2aefa2){var _0x247b07={},_0x4c4431={},_0x166de7={'count':0x0,'rows':[]};var _0x14f3cb=_[_0xbd8f('0x24')](db[_0xbd8f('0x25')][_0xbd8f('0x26')],function(_0x2ac26f){return{'name':_0x2ac26f[_0xbd8f('0x27')],'type':_0x2ac26f['type'][_0xbd8f('0x28')]};});_0x4c4431[_0xbd8f('0x29')]=_[_0xbd8f('0x24')](_0x14f3cb,_0xbd8f('0x21'));_0x4c4431['query']=_['keys'](_0x202126[_0xbd8f('0x2a')]);_0x4c4431[_0xbd8f('0x2b')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],_0x4c4431['query']);_0x247b07[_0xbd8f('0x2d')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x202126[_0xbd8f('0x2a')]['fields']));_0x247b07[_0xbd8f('0x2d')]=_0x247b07[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x247b07[_0xbd8f('0x2d')]:_0x4c4431[_0xbd8f('0x29')];if(!_0x202126['query'][_0xbd8f('0x30')]('nolimit')){_0x247b07[_0xbd8f('0x31')]=qs[_0xbd8f('0x31')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x31')]);_0x247b07[_0xbd8f('0x18')]=qs[_0xbd8f('0x18')](_0x202126['query']['offset']);}_0x247b07['order']=qs[_0xbd8f('0x32')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x32')]);_0x247b07[_0xbd8f('0x33')]=qs[_0xbd8f('0x2b')](_[_0xbd8f('0x34')](_0x202126[_0xbd8f('0x2a')],_0x4c4431[_0xbd8f('0x2b')]),_0x14f3cb);if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]){_0x247b07[_0xbd8f('0x33')]=_[_0xbd8f('0x36')](_0x247b07[_0xbd8f('0x33')],{'$or':_[_0xbd8f('0x24')](_0x14f3cb,function(_0x391d45){if(_0x391d45['type']!==_0xbd8f('0x37')){var _0x4181e0={};_0x4181e0[_0x391d45['name']]={'$like':'%'+_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]+'%'};return _0x4181e0;}})});}_0x247b07=_[_0xbd8f('0x36')]({},_0x247b07,_0x202126['options']);var _0x21da54={'where':_0x247b07['where']};return db[_0xbd8f('0x25')][_0xbd8f('0x38')](_0x21da54)[_0xbd8f('0x1f')](function(_0x4f2ebc){_0x166de7[_0xbd8f('0x38')]=_0x4f2ebc;if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x247b07['include']=[{'all':!![]}];}return db[_0xbd8f('0x25')][_0xbd8f('0x3a')](_0x247b07);})[_0xbd8f('0x1f')](function(_0x351027){_0x166de7[_0xbd8f('0x3b')]=_0x351027;return _0x166de7;})[_0xbd8f('0x1f')](respondWithFilteredResult(_0x2aefa2,_0x247b07))[_0xbd8f('0x3c')](handleError(_0x2aefa2,null));};exports[_0xbd8f('0x3d')]=function(_0x14b768,_0x5e1e77){var _0x52c62b={'raw':!![],'where':{'id':_0x14b768[_0xbd8f('0x3e')]['id']}},_0x2907a3={};_0x2907a3[_0xbd8f('0x29')]=_[_0xbd8f('0x3f')](db['CmHopperFinal'][_0xbd8f('0x26')]);_0x2907a3[_0xbd8f('0x2a')]=_[_0xbd8f('0x3f')](_0x14b768[_0xbd8f('0x2a')]);_0x2907a3[_0xbd8f('0x2b')]=_['intersection'](_0x2907a3['model'],_0x2907a3[_0xbd8f('0x2a')]);_0x52c62b['attributes']=_[_0xbd8f('0x2c')](_0x2907a3[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x2e')]));_0x52c62b[_0xbd8f('0x2d')]=_0x52c62b[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x52c62b['attributes']:_0x2907a3[_0xbd8f('0x29')];if(_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x52c62b[_0xbd8f('0x40')]=[{'all':!![]}];}_0x52c62b=_[_0xbd8f('0x36')]({},_0x52c62b,_0x14b768[_0xbd8f('0x41')]);return db[_0xbd8f('0x25')][_0xbd8f('0x42')](_0x52c62b)['then'](handleEntityNotFound(_0x5e1e77,null))[_0xbd8f('0x1f')](respondWithResult(_0x5e1e77,null))[_0xbd8f('0x3c')](handleError(_0x5e1e77,null));};exports[_0xbd8f('0x43')]=function(_0x1f12dd,_0x2fdbd0){return db[_0xbd8f('0x25')][_0xbd8f('0x43')]()[_0xbd8f('0x1f')](respondWithResult(_0x2fdbd0,null))[_0xbd8f('0x3c')](handleError(_0x2fdbd0,null));};exports[_0xbd8f('0x1e')]=function(_0x406741,_0x255c59){if(_0x406741[_0xbd8f('0x44')][_0xbd8f('0x45')]){delete _0x406741[_0xbd8f('0x44')][_0xbd8f('0x45')];}return db[_0xbd8f('0x25')][_0xbd8f('0x42')]({'where':{'uniqueid':_0x406741[_0xbd8f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x255c59,null))[_0xbd8f('0x1f')](saveUpdates(_0x406741[_0xbd8f('0x44')],null))[_0xbd8f('0x1f')](respondWithResult(_0x255c59,null))[_0xbd8f('0x3c')](handleError(_0x255c59,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x1b38ad,_0x5a33c5,_0x9bfe93){return db[_0xbd8f('0x25')][_0xbd8f('0x3a')]({'raw':![],'where':{'VoiceQueueId':_0x1b38ad[_0xbd8f('0x3e')]['id']},'attributes':[[db['sequelize']['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x49')))),_0xbd8f('0x4a')],[db['sequelize']['fn'](_0xbd8f('0x46'),db['sequelize']['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x4b')))),_0xbd8f('0x4c')],[db[_0xbd8f('0x47')]['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')]('`state`\x20=\x205,\x201,\x20null'))),_0xbd8f('0x4d')],[db['sequelize']['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db['sequelize'][_0xbd8f('0x48')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x4e')))),_0xbd8f('0x4f')],[db['sequelize']['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x50')))),_0xbd8f('0x51')],[db['sequelize']['fn'](_0xbd8f('0x46'),db['sequelize']['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x52')))),'reCallContacts'],[db[_0xbd8f('0x47')]['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0xbd8f('0x53')]]})['then'](handleEntityNotFound(_0x5a33c5,null))[_0xbd8f('0x1f')](respondWithResult(_0x5a33c5,null))[_0xbd8f('0x3c')](handleError(_0x5a33c5,null));};exports[_0xbd8f('0x54')]=function(_0x93452d,_0x4a86a9,_0x5ea275){return db[_0xbd8f('0x25')][_0xbd8f('0x3a')]({'raw':![],'where':{'CampaignId':_0x93452d[_0xbd8f('0x3e')]['id']},'attributes':[[db[_0xbd8f('0x47')]['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x49')))),_0xbd8f('0x4a')],[db[_0xbd8f('0x47')]['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x4b')))),_0xbd8f('0x4c')],[db[_0xbd8f('0x47')]['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xbd8f('0x4d')],[db[_0xbd8f('0x47')]['fn'](_0xbd8f('0x46'),db['sequelize']['fn']('IF',db['sequelize'][_0xbd8f('0x48')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbd8f('0x47')]['literal'](_0xbd8f('0x4e')))),_0xbd8f('0x4f')],[db['sequelize']['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x50')))),'abandonedContacts'],[db['sequelize']['fn'](_0xbd8f('0x46'),db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')][_0xbd8f('0x48')](_0xbd8f('0x52')))),_0xbd8f('0x55')],[db['sequelize']['fn']('COUNT',db[_0xbd8f('0x47')]['fn']('IF',db[_0xbd8f('0x47')]['literal'](_0xbd8f('0x56')))),_0xbd8f('0x53')]]})['then'](handleEntityNotFound(_0x4a86a9,null))[_0xbd8f('0x1f')](respondWithResult(_0x4a86a9,null))[_0xbd8f('0x3c')](handleError(_0x4a86a9,null));};exports[_0xbd8f('0x57')]=function(_0x5a8c8f,_0x5c04d9,_0x2407e7){return db[_0xbd8f('0x58')][_0xbd8f('0x42')]({'where':{'id':_0x5a8c8f[_0xbd8f('0x3e')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x5c04d9,null))['then'](function(_0x200718){var _0x27ec14;if(_0x200718){_0x27ec14=squel[_0xbd8f('0x59')]()[_0xbd8f('0x5a')](_0xbd8f('0x5b'))[_0xbd8f('0x5c')]([_0xbd8f('0x5d'),_0xbd8f('0x5e'),_0xbd8f('0x5f'),_0xbd8f('0x60'),_0xbd8f('0x61'),_0xbd8f('0x62'),_0xbd8f('0x63')],squel[_0xbd8f('0x64')]()[_0xbd8f('0x65')](_0xbd8f('0x66'),_0xbd8f('0x5d'))[_0xbd8f('0x65')]('NOW()',_0xbd8f('0x5e'))[_0xbd8f('0x65')](_0xbd8f('0x67'),_0xbd8f('0x5f'))[_0xbd8f('0x65')](_0xbd8f('0x68'),'ListId')['field'](_0xbd8f('0x69'),_0xbd8f('0x61'))['field'](_0xbd8f('0x6a'),'createdAt')[_0xbd8f('0x65')](_0xbd8f('0x6a'),_0xbd8f('0x63'))[_0xbd8f('0x6b')]('cm_hopper_final')[_0xbd8f('0x33')](_0xbd8f('0x6c'),_0x5a8c8f[_0xbd8f('0x3e')]['id']['toString']())[_0xbd8f('0x33')](_0xbd8f('0x6d'),_0x5a8c8f[_0xbd8f('0x44')][_0xbd8f('0x6e')]['toString']())[_0xbd8f('0x33')](_0xbd8f('0x6f'))[_0xbd8f('0x33')](_0xbd8f('0x70'),squel[_0xbd8f('0x64')]()[_0xbd8f('0x65')](_0xbd8f('0x5d'))[_0xbd8f('0x6b')]('cm_hopper')[_0xbd8f('0x33')]('VoiceQueueId\x20=\x20?',_0x5a8c8f[_0xbd8f('0x3e')]['id']['toString']()))[_0xbd8f('0x33')](_0xbd8f('0x70'),squel['select']()[_0xbd8f('0x65')](_0xbd8f('0x71'))[_0xbd8f('0x6b')](_0xbd8f('0x72'))['where'](_0xbd8f('0x6c'),_0x5a8c8f[_0xbd8f('0x3e')]['id'][_0xbd8f('0x73')]())[_0xbd8f('0x33')]('state\x20=\x204'))['group'](_0xbd8f('0x5f')))[_0xbd8f('0x73')]();return db[_0xbd8f('0x47')][_0xbd8f('0x2a')](_0x27ec14);}return[];})[_0xbd8f('0x1f')](respondWithResult(_0x5c04d9,null))['catch'](handleError(_0x5c04d9,null));};exports[_0xbd8f('0x74')]=function(_0x13314f,_0x328bd6,_0x11a05a){return db[_0xbd8f('0x75')]['find']({'where':{'id':_0x13314f['params']['id']}})['then'](handleEntityNotFound(_0x328bd6,null))[_0xbd8f('0x1f')](function(_0x5df0e1){var _0x535869;if(_0x5df0e1){_0x535869=squel['insert']()[_0xbd8f('0x5a')](_0xbd8f('0x5b'))[_0xbd8f('0x5c')]([_0xbd8f('0x5d'),_0xbd8f('0x5e'),_0xbd8f('0x5f'),_0xbd8f('0x60'),_0xbd8f('0x76'),'createdAt',_0xbd8f('0x63')],squel[_0xbd8f('0x64')]()[_0xbd8f('0x65')]('ANY_VALUE(calleridnum)',_0xbd8f('0x5d'))[_0xbd8f('0x65')](_0xbd8f('0x6a'),_0xbd8f('0x5e'))[_0xbd8f('0x65')](_0xbd8f('0x67'),_0xbd8f('0x5f'))[_0xbd8f('0x65')](_0xbd8f('0x68'),_0xbd8f('0x60'))['field'](_0xbd8f('0x77'),_0xbd8f('0x76'))[_0xbd8f('0x65')]('NOW()',_0xbd8f('0x62'))['field'](_0xbd8f('0x6a'),_0xbd8f('0x63'))[_0xbd8f('0x6b')](_0xbd8f('0x72'))[_0xbd8f('0x33')]('CampaignId\x20=\x20?',_0x13314f[_0xbd8f('0x3e')]['id'][_0xbd8f('0x73')]())[_0xbd8f('0x33')](_0xbd8f('0x6d'),_0x13314f[_0xbd8f('0x44')][_0xbd8f('0x6e')]['toString']())[_0xbd8f('0x33')](_0xbd8f('0x6f'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xbd8f('0x64')]()['field']('phone')['from'](_0xbd8f('0x5b'))[_0xbd8f('0x33')](_0xbd8f('0x78'),_0x13314f[_0xbd8f('0x3e')]['id']['toString']()))[_0xbd8f('0x33')](_0xbd8f('0x70'),squel['select']()['field'](_0xbd8f('0x71'))['from'](_0xbd8f('0x72'))['where']('CampaignId\x20=\x20?',_0x13314f[_0xbd8f('0x3e')]['id'][_0xbd8f('0x73')]())[_0xbd8f('0x33')](_0xbd8f('0x79')))[_0xbd8f('0x7a')]('ContactId'))[_0xbd8f('0x73')]();return db[_0xbd8f('0x47')][_0xbd8f('0x2a')](_0x535869);}return[];})['then'](respondWithResult(_0x328bd6,null))[_0xbd8f('0x3c')](handleError(_0x328bd6,null));};exports[_0xbd8f('0x7b')]=function(_0x38d1a6,_0x31b92c,_0x11fb11){return db[_0xbd8f('0x7c')][_0xbd8f('0x7d')]({'where':{'VoiceQueueId':_0x38d1a6[_0xbd8f('0x44')][_0xbd8f('0x61')],'CampaignId':_0x38d1a6[_0xbd8f('0x44')]['CampaignId'],'ContactId':_0x38d1a6['body']['ContactId']}})['then'](handleEntityNotFound(_0x31b92c,null))[_0xbd8f('0x1f')](function(_0x3ff503){if(_0x3ff503){return _0x3ff503;}return null;})['then'](respondWithResult(_0x31b92c,null))['catch'](handleError(_0x31b92c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index c0df62d..2d5bd6a 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 _0xf44f=['request-promise','path','rimraf','../../config/environment','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x45b29d,_0x44ce43){var _0x32d74=function(_0x559eff){while(--_0x559eff){_0x45b29d['push'](_0x45b29d['shift']());}};_0x32d74(++_0x44ce43);}(_0xf44f,0xdb));var _0xff44=function(_0x4bf138,_0x1f2b35){_0x4bf138=_0x4bf138-0x0;var _0xdfdb32=_0xf44f[_0x4bf138];return _0xdfdb32;};'use strict';var _=require(_0xff44('0x0'));var util=require(_0xff44('0x1'));var logger=require(_0xff44('0x2'))(_0xff44('0x3'));var moment=require(_0xff44('0x4'));var BPromise=require(_0xff44('0x5'));var rp=require(_0xff44('0x6'));var fs=require('fs');var path=require(_0xff44('0x7'));var rimraf=require(_0xff44('0x8'));var config=require(_0xff44('0x9'));var attributes=require('./cmHopperFinal.attributes');module[_0xff44('0xa')]=function(_0x465e51,_0x40b86b){return _0x465e51[_0xff44('0xb')]('CmHopperFinal',attributes,{'tableName':_0xff44('0xc'),'paranoid':![],'indexes':[{'name':_0xff44('0xd'),'fields':[_0xff44('0xd')]},{'name':_0xff44('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9648=['bluebird','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x1f2a0e,_0xef7e2c){var _0x121634=function(_0x4c28cd){while(--_0x4c28cd){_0x1f2a0e['push'](_0x1f2a0e['shift']());}};_0x121634(++_0xef7e2c);}(_0x9648,0xc8));var _0x8964=function(_0x5dd775,_0x16f481){_0x5dd775=_0x5dd775-0x0;var _0x2cf918=_0x9648[_0x5dd775];return _0x2cf918;};'use strict';var _=require(_0x8964('0x0'));var util=require('util');var logger=require(_0x8964('0x1'))(_0x8964('0x2'));var moment=require(_0x8964('0x3'));var BPromise=require(_0x8964('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8964('0x5'));var config=require(_0x8964('0x6'));var attributes=require(_0x8964('0x7'));module['exports']=function(_0x286043,_0x16de7a){return _0x286043[_0x8964('0x8')](_0x8964('0x9'),attributes,{'tableName':_0x8964('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x8964('0xb'),'fields':[_0x8964('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index c9f9a88..f3f5cee 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4d05d2,_0x139a85){var _0x90445a=function(_0x444b3f){while(--_0x444b3f){_0x4d05d2['push'](_0x4d05d2['shift']());}};_0x90445a(++_0x139a85);}(_0xb10b,0x12a));var _0xbb10=function(_0x8ce506,_0x517f30){_0x8ce506=_0x8ce506-0x0;var _0x23c8e5=_0xb10b[_0x8ce506];return _0x23c8e5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x140ced,_0x7635a8){var _0x13c633=function(_0x2f4990){while(--_0x2f4990){_0x140ced['push'](_0x140ced['shift']());}};_0x13c633(++_0x7635a8);}(_0x7a54,0x106));var _0x47a5=function(_0x4e230f,_0x23e91b){_0x4e230f=_0x4e230f-0x0;var _0x2e15fb=_0x7a54[_0x4e230f];return _0x2e15fb;};'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 4803e8d..91c69e4 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 _0x4c41=['isAuthenticated','/:id','show','get','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','util','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c41,0xf7));var _0x14c4=function(_0x4df47e,_0x2767f4){_0x4df47e=_0x4df47e-0x0;var _0x3c33b9=_0x4c41[_0x4df47e];return _0x3c33b9;};'use strict';var multer=require('multer');var util=require(_0x14c4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x14c4('0x1'));var auth=require(_0x14c4('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x14c4('0x3'));var controller=require(_0x14c4('0x4'));router['get']('/',auth[_0x14c4('0x5')](),controller['index']);router['get']('/describe',auth[_0x14c4('0x5')](),controller['describe']);router['get'](_0x14c4('0x6'),auth['isAuthenticated'](),controller[_0x14c4('0x7')]);router[_0x14c4('0x8')](_0x14c4('0x9'),auth[_0x14c4('0x5')](),controller[_0x14c4('0xa')]);router['get'](_0x14c4('0xb'),auth['isAuthenticated'](),controller[_0x14c4('0xc')]);router[_0x14c4('0xd')](_0x14c4('0xe'),auth[_0x14c4('0x5')](),controller[_0x14c4('0xf')]);router[_0x14c4('0xd')](_0x14c4('0x10'),auth[_0x14c4('0x5')](),controller[_0x14c4('0x11')]);router[_0x14c4('0xd')](_0x14c4('0x12'),auth[_0x14c4('0x5')](),controller[_0x14c4('0x13')]);router['put'](_0x14c4('0x6'),auth[_0x14c4('0x5')](),controller['update']);module[_0x14c4('0x14')]=router; \ No newline at end of file +var _0x5d36=['../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','index','/describe','isAuthenticated','describe','/:id','show','get','/campaign/countAttributes/:id','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x586539,_0x72120){var _0x5bc7f1=function(_0x73eeb3){while(--_0x73eeb3){_0x586539['push'](_0x586539['shift']());}};_0x5bc7f1(++_0x72120);}(_0x5d36,0x11a));var _0x65d3=function(_0x528d4f,_0x19b4f9){_0x528d4f=_0x528d4f-0x0;var _0x3df605=_0x5d36[_0x528d4f];return _0x3df605;};'use strict';var multer=require(_0x65d3('0x0'));var util=require(_0x65d3('0x1'));var path=require(_0x65d3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x65d3('0x3')]();var fs_extra=require(_0x65d3('0x4'));var auth=require(_0x65d3('0x5'));var interaction=require(_0x65d3('0x6'));var config=require(_0x65d3('0x7'));var controller=require(_0x65d3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x65d3('0x9')]);router['get'](_0x65d3('0xa'),auth[_0x65d3('0xb')](),controller[_0x65d3('0xc')]);router['get'](_0x65d3('0xd'),auth[_0x65d3('0xb')](),controller[_0x65d3('0xe')]);router['get']('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x65d3('0xf')](_0x65d3('0x10'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x65d3('0x11')]('/voice/queue/moveContacts/:id',auth[_0x65d3('0xb')](),controller[_0x65d3('0x12')]);router[_0x65d3('0x11')](_0x65d3('0x13'),auth[_0x65d3('0xb')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x65d3('0x11')](_0x65d3('0x14'),auth[_0x65d3('0xb')](),controller[_0x65d3('0x15')]);router['put'](_0x65d3('0xd'),auth[_0x65d3('0xb')](),controller[_0x65d3('0x16')]);module[_0x65d3('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index f5cef11..677f11f 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 _0xc030=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x27c69b,_0x4cbe55){var _0x198ac4=function(_0x15798b){while(--_0x15798b){_0x27c69b['push'](_0x27c69b['shift']());}};_0x198ac4(++_0x4cbe55);}(_0xc030,0x1cc));var _0x0c03=function(_0x4590f8,_0x5e13cc){_0x4590f8=_0x4590f8-0x0;var _0x2dd703=_0xc030[_0x4590f8];return _0x2dd703;};'use strict';var Sequelize=require(_0x0c03('0x0'));module[_0x0c03('0x1')]={'state':{'type':Sequelize[_0x0c03('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0c03('0x3')]},'scheduledat':{'type':Sequelize[_0x0c03('0x4')]},'countbusyretry':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0c03('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x0c03('0x3')]},'originatecalleridname':{'type':Sequelize[_0x0c03('0x3')]},'calleridnum':{'type':Sequelize[_0x0c03('0x3')]},'calleridname':{'type':Sequelize[_0x0c03('0x3')]},'starttime':{'type':Sequelize[_0x0c03('0x4')]},'responsetime':{'type':Sequelize[_0x0c03('0x4')]},'answertime':{'type':Sequelize[_0x0c03('0x4')]},'droptime':{'type':Sequelize[_0x0c03('0x4')]},'endtime':{'type':Sequelize[_0x0c03('0x4')]},'ringtime':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0c03('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0c03('0x3')]},'membername':{'type':Sequelize[_0x0c03('0x3')]},'reason':{'type':Sequelize[_0x0c03('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0c03('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0c03('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0c03('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x0c03('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0c03('0x4')]},'edited':{'type':Sequelize[_0x0c03('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0c03('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdbfd=['STRING','BOOLEAN','exports','INTEGER','DATE'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xdbfd,0x1ce));var _0xddbf=function(_0x4599fa,_0x1b4cbb){_0x4599fa=_0x4599fa-0x0;var _0x3742db=_0xdbfd[_0x4599fa];return _0x3742db;};'use strict';var Sequelize=require('sequelize');module[_0xddbf('0x0')]={'state':{'type':Sequelize[_0xddbf('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xddbf('0x2')]},'countbusyretry':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xddbf('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xddbf('0x3')]},'starttime':{'type':Sequelize[_0xddbf('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xddbf('0x2')]},'droptime':{'type':Sequelize[_0xddbf('0x2')]},'endtime':{'type':Sequelize[_0xddbf('0x2')]},'ringtime':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xddbf('0x3')]},'campaign':{'type':Sequelize[_0xddbf('0x3')]},'campaigntype':{'type':Sequelize[_0xddbf('0x3')]},'membername':{'type':Sequelize[_0xddbf('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xddbf('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xddbf('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xddbf('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xddbf('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xddbf('0x2')]},'recallme':{'type':Sequelize[_0xddbf('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xddbf('0x2')]},'edited':{'type':Sequelize[_0xddbf('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xddbf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index a150f08..e7e8c7a 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 _0xa491=['fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','CmHopperHistory','includeAll','include','findAll','catch','show','params','find','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','destroy','then','error','name','send','index','rawAttributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xa491,0xf7));var _0x1a49=function(_0x1f9f77,_0x5122e5){_0x1f9f77=_0x1f9f77-0x0;var _0x13d4dc=_0xa491[_0x1f9f77];return _0x13d4dc;};'use strict';var emlformat=require(_0x1a49('0x0'));var rimraf=require(_0x1a49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a49('0x2'));var rp=require(_0x1a49('0x3'));var moment=require('moment');var BPromise=require(_0x1a49('0x4'));var Mustache=require('mustache');var util=require(_0x1a49('0x5'));var path=require('path');var sox=require(_0x1a49('0x6'));var csv=require(_0x1a49('0x7'));var ejs=require(_0x1a49('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a49('0x9'));var squel=require('squel');var crypto=require(_0x1a49('0xa'));var jsforce=require(_0x1a49('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1a49('0x7'));var querystring=require(_0x1a49('0xc'));var Papa=require(_0x1a49('0xd'));var Redis=require(_0x1a49('0xe'));var authService=require(_0x1a49('0xf'));var qs=require(_0x1a49('0x10'));var as=require(_0x1a49('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a49('0x12'))('api');var utils=require(_0x1a49('0x13'));var config=require(_0x1a49('0x14'));var licenseUtil=require(_0x1a49('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e91a6,_0x38d916){_0x38d916=_0x38d916||0xcc;return function(_0x3084cb){if(_0x3084cb){return _0x2e91a6[_0x1a49('0x16')](_0x38d916);}return _0x2e91a6[_0x1a49('0x17')](_0x38d916)[_0x1a49('0x18')]();};}function respondWithResult(_0x19fa2b,_0x48a3bf){_0x48a3bf=_0x48a3bf||0xc8;return function(_0x3c718b){if(_0x3c718b){return _0x19fa2b[_0x1a49('0x17')](_0x48a3bf)['json'](_0x3c718b);}};}function respondWithFilteredResult(_0x2fff72,_0x202818){return function(_0x85ad3c){if(_0x85ad3c){var _0x4bf3c5=typeof _0x202818[_0x1a49('0x19')]===_0x1a49('0x1a')&&typeof _0x202818['limit']===_0x1a49('0x1a');var _0x2ff2ad=_0x85ad3c[_0x1a49('0x1b')];var _0x5863cb=_0x4bf3c5?0x0:_0x202818[_0x1a49('0x19')];var _0x50b968=_0x4bf3c5?_0x85ad3c[_0x1a49('0x1b')]:_0x202818[_0x1a49('0x19')]+_0x202818[_0x1a49('0x1c')];var _0x323aaa;if(_0x50b968>=_0x2ff2ad){_0x50b968=_0x2ff2ad;_0x323aaa=0xc8;}else{_0x323aaa=0xce;}_0x2fff72[_0x1a49('0x17')](_0x323aaa);return _0x2fff72[_0x1a49('0x1d')]('Content-Range',_0x5863cb+'-'+_0x50b968+'/'+_0x2ff2ad)[_0x1a49('0x1e')](_0x85ad3c);}return null;};}function patchUpdates(_0x2a5eae){return function(_0x11db82){try{jsonpatch['apply'](_0x11db82,_0x2a5eae,!![]);}catch(_0x3733a6){return BPromise[_0x1a49('0x1f')](_0x3733a6);}return _0x11db82[_0x1a49('0x20')]();};}function saveUpdates(_0x13a32b,_0x4fce95){return function(_0xa7c1a6){if(_0xa7c1a6){return _0xa7c1a6[_0x1a49('0x21')](_0x13a32b)['then'](function(_0x468b18){return _0x468b18;});}return null;};}function removeEntity(_0xfa1e32,_0x5b7de9){return function(_0x3d59ad){if(_0x3d59ad){return _0x3d59ad[_0x1a49('0x22')]()[_0x1a49('0x23')](function(){_0xfa1e32[_0x1a49('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe214cf,_0x35f125){return function(_0x6884fb){if(!_0x6884fb){_0xe214cf[_0x1a49('0x16')](0x194);}return _0x6884fb;};}function handleError(_0x50f074,_0xeeeab){_0xeeeab=_0xeeeab||0x1f4;return function(_0x3e038e){logger[_0x1a49('0x24')](_0x3e038e['stack']);if(_0x3e038e[_0x1a49('0x25')]){delete _0x3e038e[_0x1a49('0x25')];}_0x50f074[_0x1a49('0x17')](_0xeeeab)[_0x1a49('0x26')](_0x3e038e);};}exports[_0x1a49('0x27')]=function(_0x2939bf,_0x27767c){var _0x3eebb2={},_0x1c57b0={},_0x4e7c91={'count':0x0,'rows':[]};var _0x3a936c=_['map'](db['CmHopperHistory'][_0x1a49('0x28')],function(_0x17f9e2){return{'name':_0x17f9e2[_0x1a49('0x29')],'type':_0x17f9e2[_0x1a49('0x2a')][_0x1a49('0x2b')]};});_0x1c57b0['model']=_['map'](_0x3a936c,_0x1a49('0x25'));_0x1c57b0[_0x1a49('0x2c')]=_['keys'](_0x2939bf[_0x1a49('0x2c')]);_0x1c57b0[_0x1a49('0x2d')]=_[_0x1a49('0x2e')](_0x1c57b0[_0x1a49('0x2f')],_0x1c57b0['query']);_0x3eebb2[_0x1a49('0x30')]=_[_0x1a49('0x2e')](_0x1c57b0[_0x1a49('0x2f')],qs[_0x1a49('0x31')](_0x2939bf[_0x1a49('0x2c')][_0x1a49('0x31')]));_0x3eebb2[_0x1a49('0x30')]=_0x3eebb2[_0x1a49('0x30')][_0x1a49('0x32')]?_0x3eebb2[_0x1a49('0x30')]:_0x1c57b0[_0x1a49('0x2f')];if(!_0x2939bf['query'][_0x1a49('0x33')](_0x1a49('0x34'))){_0x3eebb2['limit']=qs[_0x1a49('0x1c')](_0x2939bf[_0x1a49('0x2c')][_0x1a49('0x1c')]);_0x3eebb2[_0x1a49('0x19')]=qs['offset'](_0x2939bf[_0x1a49('0x2c')][_0x1a49('0x19')]);}_0x3eebb2[_0x1a49('0x35')]=qs[_0x1a49('0x36')](_0x2939bf[_0x1a49('0x2c')][_0x1a49('0x36')]);_0x3eebb2[_0x1a49('0x37')]=qs[_0x1a49('0x2d')](_[_0x1a49('0x38')](_0x2939bf['query'],_0x1c57b0[_0x1a49('0x2d')]),_0x3a936c);if(_0x2939bf[_0x1a49('0x2c')][_0x1a49('0x39')]){_0x3eebb2[_0x1a49('0x37')]=_['merge'](_0x3eebb2['where'],{'$or':_[_0x1a49('0x3a')](_0x3a936c,function(_0xa9bf02){if(_0xa9bf02[_0x1a49('0x2a')]!=='VIRTUAL'){var _0x5d7a37={};_0x5d7a37[_0xa9bf02[_0x1a49('0x25')]]={'$like':'%'+_0x2939bf[_0x1a49('0x2c')][_0x1a49('0x39')]+'%'};return _0x5d7a37;}})});}_0x3eebb2=_[_0x1a49('0x3b')]({},_0x3eebb2,_0x2939bf[_0x1a49('0x3c')]);var _0x1570d1={'where':_0x3eebb2[_0x1a49('0x37')]};return db[_0x1a49('0x3d')][_0x1a49('0x1b')](_0x1570d1)[_0x1a49('0x23')](function(_0x55cd99){_0x4e7c91[_0x1a49('0x1b')]=_0x55cd99;if(_0x2939bf['query'][_0x1a49('0x3e')]){_0x3eebb2[_0x1a49('0x3f')]=[{'all':!![]}];}return db[_0x1a49('0x3d')][_0x1a49('0x40')](_0x3eebb2);})['then'](function(_0xd3ac82){_0x4e7c91['rows']=_0xd3ac82;return _0x4e7c91;})[_0x1a49('0x23')](respondWithFilteredResult(_0x27767c,_0x3eebb2))[_0x1a49('0x41')](handleError(_0x27767c,null));};exports[_0x1a49('0x42')]=function(_0xfe4c59,_0x295699){var _0x5cbbc7={'raw':!![],'where':{'id':_0xfe4c59[_0x1a49('0x43')]['id']}},_0x3fb3ad={};_0x3fb3ad['model']=_['keys'](db[_0x1a49('0x3d')]['rawAttributes']);_0x3fb3ad['query']=_['keys'](_0xfe4c59[_0x1a49('0x2c')]);_0x3fb3ad[_0x1a49('0x2d')]=_[_0x1a49('0x2e')](_0x3fb3ad[_0x1a49('0x2f')],_0x3fb3ad[_0x1a49('0x2c')]);_0x5cbbc7[_0x1a49('0x30')]=_[_0x1a49('0x2e')](_0x3fb3ad[_0x1a49('0x2f')],qs[_0x1a49('0x31')](_0xfe4c59['query'][_0x1a49('0x31')]));_0x5cbbc7['attributes']=_0x5cbbc7[_0x1a49('0x30')]['length']?_0x5cbbc7[_0x1a49('0x30')]:_0x3fb3ad['model'];if(_0xfe4c59[_0x1a49('0x2c')][_0x1a49('0x3e')]){_0x5cbbc7[_0x1a49('0x3f')]=[{'all':!![]}];}_0x5cbbc7=_[_0x1a49('0x3b')]({},_0x5cbbc7,_0xfe4c59[_0x1a49('0x3c')]);return db['CmHopperHistory'][_0x1a49('0x44')](_0x5cbbc7)[_0x1a49('0x23')](handleEntityNotFound(_0x295699,null))[_0x1a49('0x23')](respondWithResult(_0x295699,null))['catch'](handleError(_0x295699,null));};exports['create']=function(_0x5abb20,_0x5f211f){return db[_0x1a49('0x3d')]['create'](_0x5abb20[_0x1a49('0x45')],{})[_0x1a49('0x23')](respondWithResult(_0x5f211f,0xc9))[_0x1a49('0x41')](handleError(_0x5f211f,null));};exports[_0x1a49('0x46')]=function(_0x5c16d2,_0x52eb77){return db['CmHopperHistory'][_0x1a49('0x46')]()[_0x1a49('0x23')](respondWithResult(_0x52eb77,null))['catch'](handleError(_0x52eb77,null));};exports['update']=function(_0x4dd5c9,_0x526be9){if(_0x4dd5c9[_0x1a49('0x45')][_0x1a49('0x47')]){delete _0x4dd5c9[_0x1a49('0x45')]['uniqueid'];}return db['CmHopperHistory'][_0x1a49('0x44')]({'where':{'uniqueid':_0x4dd5c9[_0x1a49('0x43')]['id']}})['then'](handleEntityNotFound(_0x526be9,null))[_0x1a49('0x23')](saveUpdates(_0x4dd5c9[_0x1a49('0x45')],null))[_0x1a49('0x23')](respondWithResult(_0x526be9,null))[_0x1a49('0x41')](handleError(_0x526be9,null));}; \ No newline at end of file +var _0x16ba=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','send','map','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','options','CmHopperHistory','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','bluebird'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x16ba,0x8a));var _0xa16b=function(_0x2e1e92,_0x16e465){_0x2e1e92=_0x2e1e92-0x0;var _0x193531=_0x16ba[_0x2e1e92];return _0x193531;};'use strict';var emlformat=require(_0xa16b('0x0'));var rimraf=require(_0xa16b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa16b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa16b('0x3'));var Mustache=require(_0xa16b('0x4'));var util=require(_0xa16b('0x5'));var path=require(_0xa16b('0x6'));var sox=require(_0xa16b('0x7'));var csv=require(_0xa16b('0x8'));var ejs=require(_0xa16b('0x9'));var fs=require('fs');var fs_extra=require(_0xa16b('0xa'));var _=require(_0xa16b('0xb'));var squel=require(_0xa16b('0xc'));var crypto=require('crypto');var jsforce=require(_0xa16b('0xd'));var deskjs=require(_0xa16b('0xe'));var toCsv=require(_0xa16b('0x8'));var querystring=require(_0xa16b('0xf'));var Papa=require(_0xa16b('0x10'));var Redis=require(_0xa16b('0x11'));var authService=require(_0xa16b('0x12'));var qs=require(_0xa16b('0x13'));var as=require(_0xa16b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa16b('0x15'))(_0xa16b('0x16'));var utils=require(_0xa16b('0x17'));var config=require(_0xa16b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x356af3,_0x2ba9d7){_0x2ba9d7=_0x2ba9d7||0xcc;return function(_0x93542a){if(_0x93542a){return _0x356af3[_0xa16b('0x19')](_0x2ba9d7);}return _0x356af3['status'](_0x2ba9d7)[_0xa16b('0x1a')]();};}function respondWithResult(_0x32ddec,_0x503e49){_0x503e49=_0x503e49||0xc8;return function(_0x5c5e82){if(_0x5c5e82){return _0x32ddec[_0xa16b('0x1b')](_0x503e49)[_0xa16b('0x1c')](_0x5c5e82);}};}function respondWithFilteredResult(_0x2e93ff,_0x4534c5){return function(_0x5163e9){if(_0x5163e9){var _0x103749=typeof _0x4534c5[_0xa16b('0x1d')]===_0xa16b('0x1e')&&typeof _0x4534c5[_0xa16b('0x1f')]==='undefined';var _0x390495=_0x5163e9[_0xa16b('0x20')];var _0x10ff17=_0x103749?0x0:_0x4534c5[_0xa16b('0x1d')];var _0xcc8eec=_0x103749?_0x5163e9['count']:_0x4534c5[_0xa16b('0x1d')]+_0x4534c5[_0xa16b('0x1f')];var _0x421175;if(_0xcc8eec>=_0x390495){_0xcc8eec=_0x390495;_0x421175=0xc8;}else{_0x421175=0xce;}_0x2e93ff[_0xa16b('0x1b')](_0x421175);return _0x2e93ff[_0xa16b('0x21')](_0xa16b('0x22'),_0x10ff17+'-'+_0xcc8eec+'/'+_0x390495)[_0xa16b('0x1c')](_0x5163e9);}return null;};}function patchUpdates(_0x4e3019){return function(_0x36f5f2){try{jsonpatch['apply'](_0x36f5f2,_0x4e3019,!![]);}catch(_0x3c9235){return BPromise['reject'](_0x3c9235);}return _0x36f5f2[_0xa16b('0x23')]();};}function saveUpdates(_0x329c84,_0x4f8b7c){return function(_0x323e0d){if(_0x323e0d){return _0x323e0d[_0xa16b('0x24')](_0x329c84)[_0xa16b('0x25')](function(_0xbb5d79){return _0xbb5d79;});}return null;};}function removeEntity(_0xdaea3d,_0x3b920b){return function(_0x5297b8){if(_0x5297b8){return _0x5297b8[_0xa16b('0x26')]()[_0xa16b('0x25')](function(){_0xdaea3d[_0xa16b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c5a93,_0x73fef2){return function(_0x452c81){if(!_0x452c81){_0x5c5a93[_0xa16b('0x19')](0x194);}return _0x452c81;};}function handleError(_0x4812b8,_0x374b53){_0x374b53=_0x374b53||0x1f4;return function(_0x12d52b){logger['error'](_0x12d52b[_0xa16b('0x27')]);if(_0x12d52b[_0xa16b('0x28')]){delete _0x12d52b['name'];}_0x4812b8[_0xa16b('0x1b')](_0x374b53)[_0xa16b('0x29')](_0x12d52b);};}exports['index']=function(_0x37536c,_0x34180a){var _0x1c129d={},_0x1487e5={},_0x39aa43={'count':0x0,'rows':[]};var _0x22a993=_[_0xa16b('0x2a')](db['CmHopperHistory']['rawAttributes'],function(_0x1f2d9c){return{'name':_0x1f2d9c['fieldName'],'type':_0x1f2d9c[_0xa16b('0x2b')]['key']};});_0x1487e5[_0xa16b('0x2c')]=_[_0xa16b('0x2a')](_0x22a993,_0xa16b('0x28'));_0x1487e5[_0xa16b('0x2d')]=_[_0xa16b('0x2e')](_0x37536c[_0xa16b('0x2d')]);_0x1487e5[_0xa16b('0x2f')]=_[_0xa16b('0x30')](_0x1487e5['model'],_0x1487e5[_0xa16b('0x2d')]);_0x1c129d[_0xa16b('0x31')]=_[_0xa16b('0x30')](_0x1487e5[_0xa16b('0x2c')],qs[_0xa16b('0x32')](_0x37536c['query'][_0xa16b('0x32')]));_0x1c129d[_0xa16b('0x31')]=_0x1c129d['attributes'][_0xa16b('0x33')]?_0x1c129d['attributes']:_0x1487e5[_0xa16b('0x2c')];if(!_0x37536c[_0xa16b('0x2d')][_0xa16b('0x34')]('nolimit')){_0x1c129d[_0xa16b('0x1f')]=qs[_0xa16b('0x1f')](_0x37536c[_0xa16b('0x2d')][_0xa16b('0x1f')]);_0x1c129d['offset']=qs[_0xa16b('0x1d')](_0x37536c['query']['offset']);}_0x1c129d[_0xa16b('0x35')]=qs[_0xa16b('0x36')](_0x37536c[_0xa16b('0x2d')][_0xa16b('0x36')]);_0x1c129d[_0xa16b('0x37')]=qs[_0xa16b('0x2f')](_[_0xa16b('0x38')](_0x37536c[_0xa16b('0x2d')],_0x1487e5[_0xa16b('0x2f')]),_0x22a993);if(_0x37536c['query']['filter']){_0x1c129d[_0xa16b('0x37')]=_[_0xa16b('0x39')](_0x1c129d[_0xa16b('0x37')],{'$or':_[_0xa16b('0x2a')](_0x22a993,function(_0xd57181){if(_0xd57181[_0xa16b('0x2b')]!=='VIRTUAL'){var _0x198c2f={};_0x198c2f[_0xd57181['name']]={'$like':'%'+_0x37536c[_0xa16b('0x2d')]['filter']+'%'};return _0x198c2f;}})});}_0x1c129d=_[_0xa16b('0x39')]({},_0x1c129d,_0x37536c[_0xa16b('0x3a')]);var _0x379a78={'where':_0x1c129d[_0xa16b('0x37')]};return db[_0xa16b('0x3b')][_0xa16b('0x20')](_0x379a78)[_0xa16b('0x25')](function(_0xf50076){_0x39aa43[_0xa16b('0x20')]=_0xf50076;if(_0x37536c[_0xa16b('0x2d')]['includeAll']){_0x1c129d['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1c129d);})[_0xa16b('0x25')](function(_0xb0522a){_0x39aa43['rows']=_0xb0522a;return _0x39aa43;})[_0xa16b('0x25')](respondWithFilteredResult(_0x34180a,_0x1c129d))[_0xa16b('0x3c')](handleError(_0x34180a,null));};exports[_0xa16b('0x3d')]=function(_0x355188,_0xbd39ea){var _0xa319dd={'raw':!![],'where':{'id':_0x355188[_0xa16b('0x3e')]['id']}},_0x502a33={};_0x502a33[_0xa16b('0x2c')]=_['keys'](db['CmHopperHistory'][_0xa16b('0x3f')]);_0x502a33[_0xa16b('0x2d')]=_[_0xa16b('0x2e')](_0x355188['query']);_0x502a33[_0xa16b('0x2f')]=_[_0xa16b('0x30')](_0x502a33[_0xa16b('0x2c')],_0x502a33[_0xa16b('0x2d')]);_0xa319dd[_0xa16b('0x31')]=_['intersection'](_0x502a33[_0xa16b('0x2c')],qs[_0xa16b('0x32')](_0x355188[_0xa16b('0x2d')][_0xa16b('0x32')]));_0xa319dd['attributes']=_0xa319dd[_0xa16b('0x31')][_0xa16b('0x33')]?_0xa319dd['attributes']:_0x502a33[_0xa16b('0x2c')];if(_0x355188[_0xa16b('0x2d')][_0xa16b('0x40')]){_0xa319dd[_0xa16b('0x41')]=[{'all':!![]}];}_0xa319dd=_[_0xa16b('0x39')]({},_0xa319dd,_0x355188[_0xa16b('0x3a')]);return db[_0xa16b('0x3b')][_0xa16b('0x42')](_0xa319dd)[_0xa16b('0x25')](handleEntityNotFound(_0xbd39ea,null))[_0xa16b('0x25')](respondWithResult(_0xbd39ea,null))['catch'](handleError(_0xbd39ea,null));};exports[_0xa16b('0x43')]=function(_0x327451,_0x56e70d){return db[_0xa16b('0x3b')][_0xa16b('0x43')](_0x327451[_0xa16b('0x44')],{})[_0xa16b('0x25')](respondWithResult(_0x56e70d,0xc9))[_0xa16b('0x3c')](handleError(_0x56e70d,null));};exports[_0xa16b('0x45')]=function(_0x2db4ab,_0x40b9bc){return db[_0xa16b('0x3b')]['describe']()[_0xa16b('0x25')](respondWithResult(_0x40b9bc,null))['catch'](handleError(_0x40b9bc,null));};exports['update']=function(_0x32dc96,_0x3e4986){if(_0x32dc96['body'][_0xa16b('0x46')]){delete _0x32dc96[_0xa16b('0x44')][_0xa16b('0x46')];}return db[_0xa16b('0x3b')]['find']({'where':{'uniqueid':_0x32dc96['params']['id']}})[_0xa16b('0x25')](handleEntityNotFound(_0x3e4986,null))['then'](saveUpdates(_0x32dc96['body'],null))['then'](respondWithResult(_0x3e4986,null))[_0xa16b('0x3c')](handleError(_0x3e4986,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 6df3274..93d2975 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 _0x6eec=['define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc6ee('0x0'));var util=require(_0xc6ee('0x1'));var logger=require(_0xc6ee('0x2'))(_0xc6ee('0x3'));var moment=require('moment');var BPromise=require(_0xc6ee('0x4'));var rp=require(_0xc6ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6ee('0x6'));var config=require(_0xc6ee('0x7'));var attributes=require(_0xc6ee('0x8'));module[_0xc6ee('0x9')]=function(_0xe25b0b,_0x2bf5b5){return _0xe25b0b[_0xc6ee('0xa')](_0xc6ee('0xb'),attributes,{'tableName':_0xc6ee('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xc6ee('0xd'),'fields':[_0xc6ee('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x199d=['./cmHopperHistory.attributes','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x366761,_0x35faab){var _0x356262=function(_0x3f26f3){while(--_0x3f26f3){_0x366761['push'](_0x366761['shift']());}};_0x356262(++_0x35faab);}(_0x199d,0x13d));var _0xd199=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x199d[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xd199('0x0'));var util=require(_0xd199('0x1'));var logger=require(_0xd199('0x2'))(_0xd199('0x3'));var moment=require(_0xd199('0x4'));var BPromise=require('bluebird');var rp=require(_0xd199('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd199('0x6'));var config=require(_0xd199('0x7'));var attributes=require(_0xd199('0x8'));module['exports']=function(_0x44dc53,_0x16825f){return _0x44dc53['define'](_0xd199('0x9'),attributes,{'tableName':_0xd199('0xa'),'paranoid':![],'indexes':[{'name':_0xd199('0xb'),'fields':['endtime']},{'name':_0xd199('0xc'),'fields':[_0xd199('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 216efeb..d9e15e8 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 _0x31c2=['`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout'];(function(_0x4933e9,_0x20123a){var _0x120cab=function(_0x38a3b6){while(--_0x38a3b6){_0x4933e9['push'](_0x4933e9['shift']());}};_0x120cab(++_0x20123a);}(_0x31c2,0x98));var _0x231c=function(_0x17d22e,_0x3f48e7){_0x17d22e=_0x17d22e-0x0;var _0xb3153=_0x31c2[_0x17d22e];return _0xb3153;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x231c('0x1'));var rs=require(_0x231c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x231c('0x3'))['db'];var utils=require(_0x231c('0x4'));var logger=require(_0x231c('0x5'))(_0x231c('0x6'));var config=require(_0x231c('0x7'));var jayson=require(_0x231c('0x8'));var client=jayson[_0x231c('0x9')][_0x231c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afc76,_0x1e3997,_0x4fd8b8){return new BPromise(function(_0x3dfccb,_0x396da8){return client[_0x231c('0xb')](_0x5afc76,_0x4fd8b8)[_0x231c('0xc')](function(_0x4cd3b8){logger[_0x231c('0xd')](_0x231c('0xe'),_0x1e3997,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x1e3997,_0x231c('0xf'),JSON['stringify'](_0x4cd3b8));if(_0x4cd3b8['error']){if(_0x4cd3b8['error'][_0x231c('0x12')]===0x1f4){logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x396da8(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x3dfccb(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}else{logger[_0x231c('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x1e3997,_0x231c('0xf'));_0x3dfccb(_0x4cd3b8[_0x231c('0x15')][_0x231c('0x14')]);}})[_0x231c('0x16')](function(_0x40f4f6){logger['error'](_0x231c('0xe'),_0x1e3997,_0x40f4f6);_0x396da8(_0x40f4f6);});});}exports['CreateCmHopperHistory']=function(_0x1d48e3){var _0x59282c=this;return new Promise(function(_0x286148,_0x34f391){return db[_0x231c('0x17')][_0x231c('0x18')](_0x1d48e3[_0x231c('0x19')],{'raw':_0x1d48e3[_0x231c('0x1a')]?_0x1d48e3[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x29a94){logger[_0x231c('0xd')](_0x231c('0x1c'),_0x1d48e3);logger['debug']('CreateCmHopperHistory',_0x1d48e3,JSON[_0x231c('0x1d')](_0x29a94));_0x286148(_0x29a94);})[_0x231c('0x16')](function(_0x3bd9ed){logger['error'](_0x231c('0x1c'),_0x3bd9ed['message'],_0x1d48e3);_0x34f391(_0x59282c[_0x231c('0x13')](0x1f4,_0x3bd9ed[_0x231c('0x14')]));});});};exports[_0x231c('0x1e')]=function(_0x5d754f){var _0x4822=this;return new Promise(function(_0x584f55,_0x4526aa){return db[_0x231c('0x17')][_0x231c('0x1f')]({'raw':_0x5d754f[_0x231c('0x1a')]?_0x5d754f[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d754f[_0x231c('0x1a')]?_0x5d754f[_0x231c('0x1a')][_0x231c('0x20')]||null:null,'attributes':[[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')][_0x231c('0x23')]('id')),_0x231c('0x24')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x26')))),_0x231c('0x27')],[db[_0x231c('0x21')]['fn']('COUNT',db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x28')))),_0x231c('0x29')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x2a')))),_0x231c('0x2b')],[db[_0x231c('0x21')]['fn'](_0x231c('0x2c'),db[_0x231c('0x21')]['fn']('IF',db['sequelize'][_0x231c('0x25')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x231c('0x2d')],[db[_0x231c('0x21')]['fn'](_0x231c('0x2c'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x231c('0x2e')]]})[_0x231c('0xc')](function(_0x319f32){logger[_0x231c('0xd')](_0x231c('0x1e'),_0x5d754f);logger[_0x231c('0x10')](_0x231c('0x1e'),_0x5d754f,JSON[_0x231c('0x1d')](_0x319f32));_0x584f55(_0x319f32);})['catch'](function(_0x39d32f){logger['error'](_0x231c('0x1e'),_0x39d32f[_0x231c('0x14')],_0x5d754f);_0x4526aa(_0x4822['error'](0x1f4,_0x39d32f[_0x231c('0x14')]));});});};exports[_0x231c('0x2f')]=function(_0x1a8cf4){var _0x514fb3=this;return new Promise(function(_0x29dd63,_0x32ffb0){return db['CmHopperHistory']['findAll']({'raw':_0x1a8cf4['options']?_0x1a8cf4[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a8cf4['options']?_0x1a8cf4[_0x231c('0x1a')][_0x231c('0x20')]||null:null,'attributes':[[_0x231c('0x30'),_0x231c('0x31')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db['sequelize']['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')]('`state`\x20=\x200,\x201,\x20null'))),_0x231c('0x32')],[db['sequelize']['fn'](_0x231c('0x22'),db['sequelize']['fn']('IF',db[_0x231c('0x21')]['literal'](_0x231c('0x33')))),'outboundNoAnswerCallsDay'],[db[_0x231c('0x21')]['fn']('COUNT',db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')]['literal'](_0x231c('0x26')))),_0x231c('0x34')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')]('`state`\x20=\x205,\x201,\x20null'))),_0x231c('0x35')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db['sequelize']['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x36')))),_0x231c('0x37')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x38')))),_0x231c('0x39')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db['sequelize']['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db['sequelize'][_0x231c('0x25')](_0x231c('0x3a')))),_0x231c('0x3b')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x3c')))),_0x231c('0x3d')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x3e')))),'outboundOriginateFailureCallsDay'],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x3f')))),'outboundRejectCallsDay'],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db['sequelize']['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0x231c('0x21')]['fn']('COUNT',db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x40')))),_0x231c('0x41')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')](_0x231c('0x42')))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0x4ecb5a){logger[_0x231c('0xd')](_0x231c('0x2f'),_0x1a8cf4);logger[_0x231c('0x10')]('GetVoiceQueueHopperHistory',_0x1a8cf4,JSON[_0x231c('0x1d')](_0x4ecb5a));_0x29dd63(_0x4ecb5a);})[_0x231c('0x16')](function(_0x2b0bd3){logger[_0x231c('0x13')]('GetVoiceQueueHopperHistory',_0x2b0bd3[_0x231c('0x14')],_0x1a8cf4);_0x32ffb0(_0x514fb3[_0x231c('0x13')](0x1f4,_0x2b0bd3[_0x231c('0x14')]));});});};exports[_0x231c('0x43')]=function(_0x1e5be8){var _0xefc062=this;return new Promise(function(_0x502fc9,_0x23fa09){return db[_0x231c('0x17')][_0x231c('0x1f')]({'raw':_0x1e5be8['options']?_0x1e5be8[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e5be8[_0x231c('0x1a')]?_0x1e5be8[_0x231c('0x1a')][_0x231c('0x20')]||null:null,'attributes':[[_0x231c('0x30'),'name'],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')][_0x231c('0x23')]('id')),_0x231c('0x44')],[db[_0x231c('0x21')]['fn'](_0x231c('0x22'),db[_0x231c('0x21')]['fn']('IF',db[_0x231c('0x21')][_0x231c('0x25')]('`state`\x20=\x204,\x201,\x20null'))),_0x231c('0x45')]],'group':['campaign']})[_0x231c('0xc')](function(_0x596894){logger[_0x231c('0xd')](_0x231c('0x43'),_0x1e5be8);logger[_0x231c('0x10')]('GetCampaignHopperHistory',_0x1e5be8,JSON[_0x231c('0x1d')](_0x596894));_0x502fc9(_0x596894);})[_0x231c('0x16')](function(_0x27efd2){logger['error']('GetCampaignHopperHistory',_0x27efd2[_0x231c('0x14')],_0x1e5be8);_0x23fa09(_0xefc062['error'](0x1f4,_0x27efd2['message']));});});}; \ No newline at end of file +var _0xe356=['request','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','stringify','catch','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','name','ivrTotalCallsDays','ivrAnswerCallsDay','then','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4c0e62,_0x378d17){var _0x770cbb=function(_0x2022dc){while(--_0x2022dc){_0x4c0e62['push'](_0x4c0e62['shift']());}};_0x770cbb(++_0x378d17);}(_0xe356,0x1ee));var _0x6e35=function(_0x1ab28b,_0x3a94fe){_0x1ab28b=_0x1ab28b-0x0;var _0x2fcbae=_0xe356[_0x1ab28b];return _0x2fcbae;};'use strict';var _=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var moment=require(_0x6e35('0x2'));var BPromise=require(_0x6e35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e35('0x5'));var logger=require(_0x6e35('0x6'))(_0x6e35('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e35('0x8'));var client=jayson[_0x6e35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389ae2,_0xba948e,_0x114b4c){return new BPromise(function(_0x1da99b,_0x5119fa){return client[_0x6e35('0xa')](_0x389ae2,_0x114b4c)['then'](function(_0x3b3c16){logger['info'](_0x6e35('0xb'),_0xba948e,'request\x20sent');logger['debug'](_0x6e35('0xc'),_0xba948e,_0x6e35('0xd'),JSON['stringify'](_0x3b3c16));if(_0x3b3c16['error']){if(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0xf')]===0x1f4){logger[_0x6e35('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0xba948e,_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);return _0x5119fa(_0x3b3c16[_0x6e35('0xe')]['message']);}logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3b3c16[_0x6e35('0xe')]['message']);return _0x1da99b(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);}else{logger[_0x6e35('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0xba948e,_0x6e35('0xd'));_0x1da99b(_0x3b3c16[_0x6e35('0x12')][_0x6e35('0x10')]);}})['catch'](function(_0x3e7e7a){logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3e7e7a);_0x5119fa(_0x3e7e7a);});});}exports[_0x6e35('0x13')]=function(_0x58a622){var _0x408504=this;return new Promise(function(_0x2bd771,_0x53e26d){return db[_0x6e35('0x14')][_0x6e35('0x15')](_0x58a622[_0x6e35('0x16')],{'raw':_0x58a622[_0x6e35('0x17')]?_0x58a622[_0x6e35('0x17')][_0x6e35('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x35f44){logger[_0x6e35('0x11')](_0x6e35('0x13'),_0x58a622);logger[_0x6e35('0x19')](_0x6e35('0x13'),_0x58a622,JSON[_0x6e35('0x1a')](_0x35f44));_0x2bd771(_0x35f44);})[_0x6e35('0x1b')](function(_0xa9044f){logger[_0x6e35('0xe')]('CreateCmHopperHistory',_0xa9044f[_0x6e35('0x10')],_0x58a622);_0x53e26d(_0x408504['error'](0x1f4,_0xa9044f['message']));});});};exports[_0x6e35('0x1c')]=function(_0x529510){var _0x7b3d0b=this;return new Promise(function(_0x47f4d9,_0x36a0aa){return db[_0x6e35('0x14')][_0x6e35('0x1d')]({'raw':_0x529510[_0x6e35('0x17')]?_0x529510[_0x6e35('0x17')][_0x6e35('0x18')]===undefined?!![]:![]:!![],'where':_0x529510[_0x6e35('0x17')]?_0x529510[_0x6e35('0x17')][_0x6e35('0x1e')]||null:null,'attributes':[[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')][_0x6e35('0x20')]('id')),_0x6e35('0x21')],[db['sequelize']['fn']('COUNT',db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db['sequelize'][_0x6e35('0x22')](_0x6e35('0x24')))),_0x6e35('0x25')],[db['sequelize']['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0x6e35('0x26')],[db['sequelize']['fn'](_0x6e35('0x27'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x28')))),_0x6e35('0x29')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x27'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal'](_0x6e35('0x2a')))),_0x6e35('0x2b')]]})['then'](function(_0x4a7440){logger[_0x6e35('0x11')]('AvgHandleTime',_0x529510);logger[_0x6e35('0x19')](_0x6e35('0x1c'),_0x529510,JSON['stringify'](_0x4a7440));_0x47f4d9(_0x4a7440);})[_0x6e35('0x1b')](function(_0x42b8a7){logger[_0x6e35('0xe')]('AvgHandleTime',_0x42b8a7[_0x6e35('0x10')],_0x529510);_0x36a0aa(_0x7b3d0b[_0x6e35('0xe')](0x1f4,_0x42b8a7[_0x6e35('0x10')]));});});};exports[_0x6e35('0x2c')]=function(_0x2206f1){var _0x243efe=this;return new Promise(function(_0x4e1a2f,_0x401196){return db[_0x6e35('0x14')][_0x6e35('0x1d')]({'raw':_0x2206f1[_0x6e35('0x17')]?_0x2206f1['options'][_0x6e35('0x18')]===undefined?!![]:![]:!![],'where':_0x2206f1['options']?_0x2206f1['options'][_0x6e35('0x1e')]||null:null,'attributes':[[_0x6e35('0x2d'),'name'],[db['sequelize']['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x6e35('0x2e')],[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x6e35('0x2f')],[db['sequelize']['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x30')))),_0x6e35('0x31')],[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')]['fn']('IF',db['sequelize'][_0x6e35('0x22')](_0x6e35('0x32')))),_0x6e35('0x33')],[db['sequelize']['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x34')))),_0x6e35('0x35')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x6e35('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6e35('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x38')))),_0x6e35('0x39')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')]['literal'](_0x6e35('0x3a')))),_0x6e35('0x3b')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal'](_0x6e35('0x3c')))),_0x6e35('0x3d')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal'](_0x6e35('0x3e')))),'outboundRejectCallsDay'],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x3f')))),_0x6e35('0x40')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x6e35('0x41')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x42')))),'outboundReCallsDay']],'group':[_0x6e35('0x2d')]})['then'](function(_0x36594f){logger[_0x6e35('0x11')](_0x6e35('0x2c'),_0x2206f1);logger['debug']('GetVoiceQueueHopperHistory',_0x2206f1,JSON[_0x6e35('0x1a')](_0x36594f));_0x4e1a2f(_0x36594f);})[_0x6e35('0x1b')](function(_0x3b52e0){logger[_0x6e35('0xe')]('GetVoiceQueueHopperHistory',_0x3b52e0['message'],_0x2206f1);_0x401196(_0x243efe[_0x6e35('0xe')](0x1f4,_0x3b52e0['message']));});});};exports['GetCampaignHopperHistory']=function(_0x171ecd){var _0x55ee8f=this;return new Promise(function(_0x339672,_0x644eb0){return db[_0x6e35('0x14')][_0x6e35('0x1d')]({'raw':_0x171ecd[_0x6e35('0x17')]?_0x171ecd[_0x6e35('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x171ecd[_0x6e35('0x17')]?_0x171ecd[_0x6e35('0x17')]['where']||null:null,'attributes':[['campaign',_0x6e35('0x43')],[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')]['col']('id')),_0x6e35('0x44')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x6e35('0x45')]],'group':['campaign']})[_0x6e35('0x46')](function(_0x2d499e){logger[_0x6e35('0x11')](_0x6e35('0x47'),_0x171ecd);logger['debug']('GetCampaignHopperHistory',_0x171ecd,JSON[_0x6e35('0x1a')](_0x2d499e));_0x339672(_0x2d499e);})[_0x6e35('0x1b')](function(_0x17dca4){logger[_0x6e35('0xe')]('GetCampaignHopperHistory',_0x17dca4[_0x6e35('0x10')],_0x171ecd);_0x644eb0(_0x55ee8f[_0x6e35('0xe')](0x1f4,_0x17dca4['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 8f2a1e2..ba909d3 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 _0x596d=['/:id','show','post','create','put','update','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','/describe','isAuthenticated','describe'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0x596d,0x103));var _0xd596=function(_0x4d7ffd,_0x2e9e31){_0x4d7ffd=_0x4d7ffd-0x0;var _0x8beb99=_0x596d[_0x4d7ffd];return _0x8beb99;};'use strict';var multer=require(_0xd596('0x0'));var util=require(_0xd596('0x1'));var path=require('path');var timeout=require(_0xd596('0x2'));var express=require('express');var router=express[_0xd596('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd596('0x4'));var config=require(_0xd596('0x5'));var controller=require(_0xd596('0x6'));router[_0xd596('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd596('0x7')](_0xd596('0x8'),auth[_0xd596('0x9')](),controller[_0xd596('0xa')]);router[_0xd596('0x7')](_0xd596('0xb'),auth['isAuthenticated'](),controller[_0xd596('0xc')]);router[_0xd596('0xd')]('/',auth[_0xd596('0x9')](),controller[_0xd596('0xe')]);router[_0xd596('0xf')](_0xd596('0xb'),auth['isAuthenticated'](),controller[_0xd596('0x10')]);module[_0xd596('0x11')]=router; \ No newline at end of file +var _0x7308=['index','describe','/:id','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated'];(function(_0x136cfc,_0x41a031){var _0x3833e6=function(_0x7eb331){while(--_0x7eb331){_0x136cfc['push'](_0x136cfc['shift']());}};_0x3833e6(++_0x41a031);}(_0x7308,0x14a));var _0x8730=function(_0x18d9a7,_0x38b802){_0x18d9a7=_0x18d9a7-0x0;var _0x2c2f8e=_0x7308[_0x18d9a7];return _0x2c2f8e;};'use strict';var multer=require(_0x8730('0x0'));var util=require(_0x8730('0x1'));var path=require(_0x8730('0x2'));var timeout=require('connect-timeout');var express=require(_0x8730('0x3'));var router=express[_0x8730('0x4')]();var fs_extra=require(_0x8730('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8730('0x6'));var controller=require(_0x8730('0x7'));router[_0x8730('0x8')]('/',auth[_0x8730('0x9')](),controller[_0x8730('0xa')]);router[_0x8730('0x8')]('/describe',auth[_0x8730('0x9')](),controller[_0x8730('0xb')]);router['get'](_0x8730('0xc'),auth[_0x8730('0x9')](),controller['show']);router['post']('/',auth[_0x8730('0x9')](),controller[_0x8730('0xd')]);router[_0x8730('0xe')](_0x8730('0xc'),auth[_0x8730('0x9')](),controller[_0x8730('0xf')]);module[_0x8730('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 3298d09..7bbd2ee 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 _0xca9e=['STRING','name','sequelize','exports'];(function(_0x1d8eeb,_0x486f87){var _0x3b25a3=function(_0x5d6205){while(--_0x5d6205){_0x1d8eeb['push'](_0x1d8eeb['shift']());}};_0x3b25a3(++_0x486f87);}(_0xca9e,0x136));var _0xeca9=function(_0x14f724,_0x5ea815){_0x14f724=_0x14f724-0x0;var _0x5491bb=_0xca9e[_0x14f724];return _0x5491bb;};'use strict';var Sequelize=require(_0xeca9('0x0'));module[_0xeca9('0x1')]={'name':{'type':Sequelize[_0xeca9('0x2')],'unique':_0xeca9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeca9('0x2')]},'dialPrefix':{'type':Sequelize[_0xeca9('0x2')]}}; \ No newline at end of file +var _0x0dd6=['STRING','name'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0dd6,0xca));var _0x60dd=function(_0x18ac87,_0x1b2c42){_0x18ac87=_0x18ac87-0x0;var _0x574f01=_0x0dd6[_0x18ac87];return _0x574f01;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x60dd('0x0')],'unique':_0x60dd('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x60dd('0x0')]},'dialPrefix':{'type':Sequelize[_0x60dd('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 292dd5a..7e1c8a6 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 _0xa737=['join','push','each','omit','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','getAgents','User','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmList','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','ListId','Disposition','findOne','removeDispositions','ids','addContacts','CmContact','isArray','tags'];(function(_0x5dedcc,_0x2655bc){var _0x4be117=function(_0xf9bc50){while(--_0xf9bc50){_0x5dedcc['push'](_0x5dedcc['shift']());}};_0x4be117(++_0x2655bc);}(_0xa737,0xbd));var _0x7a73=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0xa737[_0x383356];return _0x32ee5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a73('0x0'));var zipdir=require(_0x7a73('0x1'));var jsonpatch=require(_0x7a73('0x2'));var rp=require(_0x7a73('0x3'));var moment=require(_0x7a73('0x4'));var BPromise=require(_0x7a73('0x5'));var Mustache=require(_0x7a73('0x6'));var util=require(_0x7a73('0x7'));var path=require('path');var sox=require(_0x7a73('0x8'));var csv=require(_0x7a73('0x9'));var ejs=require(_0x7a73('0xa'));var fs=require('fs');var fs_extra=require(_0x7a73('0xb'));var _=require('lodash');var squel=require(_0x7a73('0xc'));var crypto=require('crypto');var jsforce=require(_0x7a73('0xd'));var deskjs=require(_0x7a73('0xe'));var toCsv=require(_0x7a73('0x9'));var querystring=require(_0x7a73('0xf'));var Papa=require('papaparse');var Redis=require(_0x7a73('0x10'));var authService=require(_0x7a73('0x11'));var qs=require(_0x7a73('0x12'));var as=require(_0x7a73('0x13'));var hardwareService=require(_0x7a73('0x14'));var logger=require('../../config/logger')(_0x7a73('0x15'));var utils=require(_0x7a73('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7a73('0x17')]=_['defaults'](config[_0x7a73('0x17')],{'host':_0x7a73('0x18'),'port':0x18eb});var socket=require(_0x7a73('0x19'))(new Redis(config['redis']));require('./cmList.socket')[_0x7a73('0x1a')](socket);function respondWithStatusCode(_0x23ed5e,_0x2021e0){_0x2021e0=_0x2021e0||0xcc;return function(_0x26eb49){if(_0x26eb49){return _0x23ed5e[_0x7a73('0x1b')](_0x2021e0);}return _0x23ed5e[_0x7a73('0x1c')](_0x2021e0)[_0x7a73('0x1d')]();};}function respondWithResult(_0x5ce8a1,_0x5eb261){_0x5eb261=_0x5eb261||0xc8;return function(_0x2d4be5){if(_0x2d4be5){return _0x5ce8a1[_0x7a73('0x1c')](_0x5eb261)[_0x7a73('0x1e')](_0x2d4be5);}};}function respondWithFilteredResult(_0x4d6c77,_0x21cb83){return function(_0x5d7845){if(_0x5d7845){var _0x5dd872=typeof _0x21cb83[_0x7a73('0x1f')]===_0x7a73('0x20')&&typeof _0x21cb83[_0x7a73('0x21')]===_0x7a73('0x20');var _0x4cf456=_0x5d7845[_0x7a73('0x22')];var _0xb6fab5=_0x5dd872?0x0:_0x21cb83['offset'];var _0x1d941c=_0x5dd872?_0x5d7845[_0x7a73('0x22')]:_0x21cb83[_0x7a73('0x1f')]+_0x21cb83[_0x7a73('0x21')];var _0x425d76;if(_0x1d941c>=_0x4cf456){_0x1d941c=_0x4cf456;_0x425d76=0xc8;}else{_0x425d76=0xce;}_0x4d6c77['status'](_0x425d76);return _0x4d6c77[_0x7a73('0x23')](_0x7a73('0x24'),_0xb6fab5+'-'+_0x1d941c+'/'+_0x4cf456)[_0x7a73('0x1e')](_0x5d7845);}return null;};}function patchUpdates(_0x3fed44){return function(_0x4898ab){try{jsonpatch[_0x7a73('0x25')](_0x4898ab,_0x3fed44,!![]);}catch(_0x4185e1){return BPromise['reject'](_0x4185e1);}return _0x4898ab[_0x7a73('0x26')]();};}function saveUpdates(_0x29efc2,_0x236064){return function(_0x5ec6d2){if(_0x5ec6d2){return _0x5ec6d2[_0x7a73('0x27')](_0x29efc2)[_0x7a73('0x28')](function(_0xf9d8c4){return _0xf9d8c4;});}return null;};}function removeEntity(_0x16e304,_0x46ac9b){return function(_0x1044e5){if(_0x1044e5){return _0x1044e5[_0x7a73('0x29')]()[_0x7a73('0x28')](function(){var _0x13ed7e=_0x1044e5[_0x7a73('0x2a')]({'plain':!![]});var _0xb46f29='Lists';return db[_0x7a73('0x2b')][_0x7a73('0x29')]({'where':{'type':_0xb46f29,'resourceId':_0x13ed7e['id']}})[_0x7a73('0x28')](function(){return _0x1044e5;});})[_0x7a73('0x28')](function(){_0x16e304[_0x7a73('0x1c')](0xcc)[_0x7a73('0x1d')]();});}};}function handleEntityNotFound(_0x3e92d2,_0x3f16fb){return function(_0x51b062){if(!_0x51b062){_0x3e92d2[_0x7a73('0x1b')](0x194);}return _0x51b062;};}function handleError(_0x49989d,_0x546a5b){_0x546a5b=_0x546a5b||0x1f4;return function(_0x4cf757){logger[_0x7a73('0x2c')](_0x4cf757['stack']);if(_0x4cf757[_0x7a73('0x2d')]){delete _0x4cf757[_0x7a73('0x2d')];}_0x49989d['status'](_0x546a5b)['send'](_0x4cf757);};}exports[_0x7a73('0x2e')]=function(_0x26ba7a,_0xd795a1){var _0x148bbe={},_0x237830={},_0x45d511={'count':0x0,'rows':[]};var _0xc9c952=_['map'](db['CmList'][_0x7a73('0x2f')],function(_0x88049d){return{'name':_0x88049d['fieldName'],'type':_0x88049d[_0x7a73('0x30')][_0x7a73('0x31')]};});_0x237830[_0x7a73('0x32')]=_[_0x7a73('0x33')](_0xc9c952,_0x7a73('0x2d'));_0x237830[_0x7a73('0x34')]=_[_0x7a73('0x35')](_0x26ba7a[_0x7a73('0x34')]);_0x237830[_0x7a73('0x36')]=_[_0x7a73('0x37')](_0x237830[_0x7a73('0x32')],_0x237830[_0x7a73('0x34')]);_0x148bbe[_0x7a73('0x38')]=_['intersection'](_0x237830[_0x7a73('0x32')],qs[_0x7a73('0x39')](_0x26ba7a[_0x7a73('0x34')]['fields']));_0x148bbe[_0x7a73('0x38')]=_0x148bbe[_0x7a73('0x38')][_0x7a73('0x3a')]?_0x148bbe[_0x7a73('0x38')]:_0x237830['model'];if(!_0x26ba7a['query'][_0x7a73('0x3b')](_0x7a73('0x3c'))){_0x148bbe['limit']=qs[_0x7a73('0x21')](_0x26ba7a['query']['limit']);_0x148bbe['offset']=qs[_0x7a73('0x1f')](_0x26ba7a[_0x7a73('0x34')][_0x7a73('0x1f')]);}_0x148bbe[_0x7a73('0x3d')]=qs['sort'](_0x26ba7a[_0x7a73('0x34')][_0x7a73('0x3e')]);_0x148bbe[_0x7a73('0x3f')]=qs[_0x7a73('0x36')](_[_0x7a73('0x40')](_0x26ba7a[_0x7a73('0x34')],_0x237830[_0x7a73('0x36')]),_0xc9c952);if(_0x26ba7a[_0x7a73('0x34')][_0x7a73('0x41')]){_0x148bbe[_0x7a73('0x3f')]=_[_0x7a73('0x42')](_0x148bbe[_0x7a73('0x3f')],{'$or':_[_0x7a73('0x33')](_0xc9c952,function(_0x1e4c78){if(_0x1e4c78[_0x7a73('0x30')]!==_0x7a73('0x43')){var _0x4ce5a5={};_0x4ce5a5[_0x1e4c78[_0x7a73('0x2d')]]={'$like':'%'+_0x26ba7a[_0x7a73('0x34')][_0x7a73('0x41')]+'%'};return _0x4ce5a5;}})});}_0x148bbe=_['merge']({},_0x148bbe,_0x26ba7a[_0x7a73('0x44')]);var _0x2e20cd={'where':_0x148bbe[_0x7a73('0x3f')]};return db[_0x7a73('0x45')][_0x7a73('0x22')](_0x2e20cd)[_0x7a73('0x28')](function(_0x33a9c2){_0x45d511['count']=_0x33a9c2;if(_0x26ba7a[_0x7a73('0x34')][_0x7a73('0x46')]){_0x148bbe[_0x7a73('0x47')]=[{'all':!![]}];}return db['CmList'][_0x7a73('0x48')](_0x148bbe);})[_0x7a73('0x28')](function(_0x36256d){_0x45d511[_0x7a73('0x49')]=_0x36256d;return _0x45d511;})['then'](respondWithFilteredResult(_0xd795a1,_0x148bbe))[_0x7a73('0x4a')](handleError(_0xd795a1,null));};exports[_0x7a73('0x4b')]=function(_0x532dea,_0x3559fd){var _0x2c1abd={'raw':![],'where':{'id':_0x532dea[_0x7a73('0x4c')]['id']}},_0x375265={};_0x375265['model']=_[_0x7a73('0x35')](db[_0x7a73('0x45')]['rawAttributes']);_0x375265[_0x7a73('0x34')]=_[_0x7a73('0x35')](_0x532dea[_0x7a73('0x34')]);_0x375265[_0x7a73('0x36')]=_[_0x7a73('0x37')](_0x375265[_0x7a73('0x32')],_0x375265[_0x7a73('0x34')]);_0x2c1abd['attributes']=_[_0x7a73('0x37')](_0x375265[_0x7a73('0x32')],qs[_0x7a73('0x39')](_0x532dea[_0x7a73('0x34')][_0x7a73('0x39')]));_0x2c1abd[_0x7a73('0x38')]=_0x2c1abd[_0x7a73('0x38')][_0x7a73('0x3a')]?_0x2c1abd['attributes']:_0x375265['model'];if(_0x532dea[_0x7a73('0x34')][_0x7a73('0x46')]){_0x2c1abd[_0x7a73('0x47')]=[{'all':!![]}];}_0x2c1abd=_['merge']({},_0x2c1abd,_0x532dea[_0x7a73('0x44')]);return db[_0x7a73('0x45')]['find'](_0x2c1abd)[_0x7a73('0x28')](handleEntityNotFound(_0x3559fd,null))[_0x7a73('0x28')](respondWithResult(_0x3559fd,null))[_0x7a73('0x4a')](handleError(_0x3559fd,null));};exports[_0x7a73('0x4d')]=function(_0x22412f,_0x5e01d8){return db['CmList'][_0x7a73('0x4d')](_0x22412f[_0x7a73('0x4e')],{})[_0x7a73('0x28')](function(_0x558b7f){var _0x11b748=_0x22412f[_0x7a73('0x4f')][_0x7a73('0x2a')]({'plain':!![]});if(!_0x11b748)throw new Error(_0x7a73('0x50'));if(_0x11b748[_0x7a73('0x51')]==='user'){var _0x2b4bf3=_0x558b7f[_0x7a73('0x2a')]({'plain':!![]});var _0x280838=_0x7a73('0x52');return db[_0x7a73('0x53')]['find']({'where':{'name':_0x280838,'userProfileId':_0x11b748[_0x7a73('0x54')]},'raw':!![]})['then'](function(_0x3aa052){if(_0x3aa052&&_0x3aa052[_0x7a73('0x55')]===0x0){return db[_0x7a73('0x2b')][_0x7a73('0x4d')]({'name':_0x2b4bf3[_0x7a73('0x2d')],'resourceId':_0x2b4bf3['id'],'type':_0x3aa052[_0x7a73('0x2d')],'sectionId':_0x3aa052['id']},{})[_0x7a73('0x28')](function(){return _0x558b7f;});}else{return _0x558b7f;}})['catch'](function(_0x5e3167){logger[_0x7a73('0x2c')](_0x7a73('0x56'),_0x5e3167);throw _0x5e3167;});}return _0x558b7f;})[_0x7a73('0x28')](respondWithResult(_0x5e01d8,0xc9))[_0x7a73('0x4a')](handleError(_0x5e01d8,null));};exports[_0x7a73('0x27')]=function(_0x13c73a,_0x27dfe6){if(_0x13c73a[_0x7a73('0x4e')]['id']){delete _0x13c73a[_0x7a73('0x4e')]['id'];}return db[_0x7a73('0x45')]['find']({'where':{'id':_0x13c73a[_0x7a73('0x4c')]['id']}})[_0x7a73('0x28')](handleEntityNotFound(_0x27dfe6,null))[_0x7a73('0x28')](saveUpdates(_0x13c73a[_0x7a73('0x4e')],null))[_0x7a73('0x28')](respondWithResult(_0x27dfe6,null))[_0x7a73('0x4a')](handleError(_0x27dfe6,null));};exports[_0x7a73('0x29')]=function(_0x3474f9,_0x234e56){return db['CmList'][_0x7a73('0x57')]({'where':{'id':_0x3474f9[_0x7a73('0x4c')]['id']}})[_0x7a73('0x28')](handleEntityNotFound(_0x234e56,null))[_0x7a73('0x28')](removeEntity(_0x234e56,null))['catch'](handleError(_0x234e56,null));};exports[_0x7a73('0x58')]=function(_0xae3f6e,_0x305c2b){return db[_0x7a73('0x45')][_0x7a73('0x58')]()[_0x7a73('0x28')](respondWithResult(_0x305c2b,null))[_0x7a73('0x4a')](handleError(_0x305c2b,null));};exports[_0x7a73('0x59')]=function(_0x3b937a,_0x130b89,_0x22dac4){if(_0x3b937a[_0x7a73('0x4e')]['id']){delete _0x3b937a['body']['id'];}return db[_0x7a73('0x45')]['find']({'where':{'id':_0x3b937a[_0x7a73('0x4c')]['id']}})[_0x7a73('0x28')](handleEntityNotFound(_0x130b89,null))[_0x7a73('0x28')](function(_0x22e4c3){if(_0x22e4c3){_0x3b937a[_0x7a73('0x4e')][_0x7a73('0x5a')]=_0x22e4c3['id'];return db[_0x7a73('0x5b')][_0x7a73('0x4d')](_0x3b937a[_0x7a73('0x4e')]);}})[_0x7a73('0x28')](respondWithResult(_0x130b89,null))[_0x7a73('0x4a')](handleError(_0x130b89,null));};exports['getDispositions']=function(_0x1d8f97,_0x283981,_0x5a33c1){var _0x20a7ed={'raw':![],'where':{}};var _0x22b3fd={};var _0x3ae868={'count':0x0,'rows':[]};return db[_0x7a73('0x45')][_0x7a73('0x5c')]({'where':{'id':_0x1d8f97['params']['id']}})['then'](handleEntityNotFound(_0x283981,null))[_0x7a73('0x28')](function(_0x47c8a3){if(_0x47c8a3){_0x22b3fd[_0x7a73('0x32')]=_[_0x7a73('0x35')](db[_0x7a73('0x5b')][_0x7a73('0x2f')]);_0x22b3fd[_0x7a73('0x34')]=_[_0x7a73('0x35')](_0x1d8f97[_0x7a73('0x34')]);_0x22b3fd['filters']=_['intersection'](_0x22b3fd[_0x7a73('0x32')],_0x22b3fd[_0x7a73('0x34')]);_0x20a7ed[_0x7a73('0x38')]=_['intersection'](_0x22b3fd[_0x7a73('0x32')],qs[_0x7a73('0x39')](_0x1d8f97[_0x7a73('0x34')][_0x7a73('0x39')]));_0x20a7ed[_0x7a73('0x38')]=_0x20a7ed[_0x7a73('0x38')]['length']?_0x20a7ed[_0x7a73('0x38')]:_0x22b3fd[_0x7a73('0x32')];if(!_0x1d8f97[_0x7a73('0x34')][_0x7a73('0x3b')](_0x7a73('0x3c'))){_0x20a7ed[_0x7a73('0x21')]=qs[_0x7a73('0x21')](_0x1d8f97[_0x7a73('0x34')][_0x7a73('0x21')]);_0x20a7ed[_0x7a73('0x1f')]=qs['offset'](_0x1d8f97[_0x7a73('0x34')][_0x7a73('0x1f')]);}_0x20a7ed['order']=qs[_0x7a73('0x3e')](_0x1d8f97['query'][_0x7a73('0x3e')]);_0x20a7ed[_0x7a73('0x3f')]=qs[_0x7a73('0x36')](_[_0x7a73('0x40')](_0x1d8f97[_0x7a73('0x34')],_0x22b3fd[_0x7a73('0x36')]));_0x20a7ed['where']['ListId']=_0x47c8a3['id'];if(_0x1d8f97[_0x7a73('0x34')][_0x7a73('0x41')]){_0x20a7ed[_0x7a73('0x3f')]=_[_0x7a73('0x42')](_0x20a7ed[_0x7a73('0x3f')],{'$or':_[_0x7a73('0x33')](_0x20a7ed['attributes'],function(_0x3ad5dc){var _0x4268a4={};_0x4268a4[_0x3ad5dc]={'$like':'%'+_0x1d8f97['query'][_0x7a73('0x41')]+'%'};return _0x4268a4;})});}_0x20a7ed=_[_0x7a73('0x42')]({},_0x20a7ed,_0x1d8f97[_0x7a73('0x44')]);return db[_0x7a73('0x5b')][_0x7a73('0x22')]({'where':_0x20a7ed[_0x7a73('0x3f')]})[_0x7a73('0x28')](function(_0x59483e){_0x3ae868[_0x7a73('0x22')]=_0x59483e;if(_0x1d8f97['query'][_0x7a73('0x46')]){_0x20a7ed[_0x7a73('0x47')]=[{'all':!![]}];}return db['Disposition'][_0x7a73('0x48')](_0x20a7ed);})['then'](function(_0x317948){_0x3ae868[_0x7a73('0x49')]=_0x317948;return _0x3ae868;});}})[_0x7a73('0x28')](respondWithFilteredResult(_0x283981,_0x20a7ed))[_0x7a73('0x4a')](handleError(_0x283981,null));};exports[_0x7a73('0x5d')]=function(_0x23e1c8,_0x57c169,_0x56c790){return db['CmList'][_0x7a73('0x57')]({'where':{'id':_0x23e1c8['params']['id']}})[_0x7a73('0x28')](handleEntityNotFound(_0x57c169,null))['then'](function(_0x99532e){if(_0x99532e){return _0x99532e[_0x7a73('0x5d')](_0x23e1c8['query'][_0x7a73('0x5e')]);}})['then'](respondWithStatusCode(_0x57c169,null))['catch'](handleError(_0x57c169,null));};exports[_0x7a73('0x5f')]=function(_0x2f9e37,_0x4e9eda,_0x2d3c6e){return db[_0x7a73('0x45')]['find']({'where':{'id':_0x2f9e37[_0x7a73('0x4c')]['id']}})[_0x7a73('0x28')](handleEntityNotFound(_0x4e9eda,null))['then'](function(_0x42b976){if(_0x42b976){var _0x4bb056=[];var _0x21a23e={'success':[],'errors':[]};return db[_0x7a73('0x60')][_0x7a73('0x58')]()[_0x7a73('0x28')](function(_0xd149e4){if(_0x2f9e37[_0x7a73('0x4e')]['tags']&&_[_0x7a73('0x61')](_0x2f9e37[_0x7a73('0x4e')][_0x7a73('0x62')])){if(_0x2f9e37[_0x7a73('0x4e')][_0x7a73('0x62')]['length']){_0x2f9e37[_0x7a73('0x4e')][_0x7a73('0x62')]=_0x2f9e37[_0x7a73('0x4e')][_0x7a73('0x62')][_0x7a73('0x63')](';')+';';}else{_0x2f9e37['body']['tags']=null;}}else{_0x2f9e37[_0x7a73('0x4e')]['tags']=null;}if(_0x2f9e37['body']&&_['isArray'](_0x2f9e37['body'])){for(var _0x31eb5b=0x0;_0x31eb5b<_0x2f9e37[_0x7a73('0x4e')][_0x7a73('0x3a')];_0x31eb5b+=0x1){_0x2f9e37[_0x7a73('0x4e')][_0x31eb5b][_0x7a73('0x5a')]=_0x2f9e37['params']['id'];_0x4bb056[_0x7a73('0x64')](_0x2f9e37[_0x7a73('0x4e')][_0x31eb5b]);}return BPromise[_0x7a73('0x65')](_0x4bb056,function(_0x3bee0b){return db[_0x7a73('0x60')]['create'](_[_0x7a73('0x66')](_0x3bee0b,['ids','id'])||{},{'fields':_[_0x7a73('0x35')](_0xd149e4),'raw':!![]})[_0x7a73('0x28')](function(_0x21d76f){_0x21a23e[_0x7a73('0x67')][_0x7a73('0x64')](_0x21d76f[_0x7a73('0x68')]);})[_0x7a73('0x4a')](function(_0xcbd22b){_0x21a23e[_0x7a73('0x69')][_0x7a73('0x64')]({'data':_0x3bee0b,'error':_0xcbd22b[_0x7a73('0x6a')]});});})[_0x7a73('0x28')](function(_0x1c74b2){return _0x21a23e;})[_0x7a73('0x4a')](function(_0x1d3fc8){return _0x1d3fc8;});}else{_0x4e9eda[_0x7a73('0x1c')](0x190)[_0x7a73('0x1e')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x7a73('0x28')](respondWithResult(_0x4e9eda,null))[_0x7a73('0x4a')](handleError(_0x4e9eda,null));};exports[_0x7a73('0x6b')]=function(_0x3bda43,_0x348118,_0x1ad0df){var _0x26f269;return db[_0x7a73('0x45')][_0x7a73('0x57')]({'where':{'id':_0x3bda43[_0x7a73('0x4c')]['id']},'include':[{'model':db[_0x7a73('0x6c')],'as':_0x7a73('0x6d')}]})[_0x7a73('0x28')](handleEntityNotFound(_0x348118,null))[_0x7a73('0x28')](function(_0x4ca606){if(_0x4ca606){_0x26f269=_0x4ca606;return db[_0x7a73('0x60')]['rawAttributes'];}})[_0x7a73('0x28')](function(_0x59f6d3){if(_0x59f6d3){var _0x2c6761={};var _0x4e88e5={};_0x4e88e5[_0x7a73('0x32')]=_[_0x7a73('0x6e')](_[_0x7a73('0x35')](_0x59f6d3),_[_0x7a73('0x33')](_0x26f269[_0x7a73('0x6d')],function(_0x52c717){return util[_0x7a73('0x6f')](_0x7a73('0x70'),_0x52c717['id']);}));_0x4e88e5[_0x7a73('0x34')]=_[_0x7a73('0x35')](_0x3bda43['query']);_0x4e88e5[_0x7a73('0x36')]=_[_0x7a73('0x37')](_0x4e88e5['model'],_0x4e88e5[_0x7a73('0x34')]);_0x2c6761['attributes']=_[_0x7a73('0x37')](_0x4e88e5[_0x7a73('0x32')],qs[_0x7a73('0x39')](_0x3bda43[_0x7a73('0x34')][_0x7a73('0x39')]));_0x2c6761['attributes']=_0x2c6761[_0x7a73('0x38')][_0x7a73('0x3a')]?_0x2c6761[_0x7a73('0x38')]:_0x4e88e5[_0x7a73('0x32')];if(!_0x3bda43[_0x7a73('0x34')]['hasOwnProperty'](_0x7a73('0x3c'))){_0x2c6761[_0x7a73('0x21')]=qs['limit'](_0x3bda43[_0x7a73('0x34')][_0x7a73('0x21')]);_0x2c6761['offset']=qs[_0x7a73('0x1f')](_0x3bda43[_0x7a73('0x34')][_0x7a73('0x1f')]);}_0x2c6761[_0x7a73('0x3d')]=qs[_0x7a73('0x3e')](_0x3bda43[_0x7a73('0x34')]['sort']);_0x2c6761[_0x7a73('0x3f')]=qs[_0x7a73('0x36')](_[_0x7a73('0x40')](_0x3bda43[_0x7a73('0x34')],_0x4e88e5[_0x7a73('0x36')]));_0x2c6761['raw']=!![];if(_0x3bda43[_0x7a73('0x34')][_0x7a73('0x41')]){_0x2c6761[_0x7a73('0x3f')]=_[_0x7a73('0x42')](_0x2c6761[_0x7a73('0x3f')],{'$or':_[_0x7a73('0x33')](_0x2c6761['attributes'],function(_0x175eeb){var _0x5c666c={};_0x5c666c[_0x175eeb]={'$like':'%'+_0x3bda43['query']['filter']+'%'};return _0x5c666c;})});}_0x2c6761=_[_0x7a73('0x42')]({},_0x2c6761,_0x3bda43['options']);return _0x26f269[_0x7a73('0x6b')](_0x2c6761);}})[_0x7a73('0x28')](respondWithResult(_0x348118,null))['catch'](handleError(_0x348118,null));};exports[_0x7a73('0x71')]=function(_0x5e56bc,_0x2648f6,_0x5d278f){var _0x119c33;return db[_0x7a73('0x45')][_0x7a73('0x57')]({'where':{'id':_0x5e56bc[_0x7a73('0x4c')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x2648f6,null))[_0x7a73('0x28')](function(_0x2edde1){if(_0x2edde1){_0x119c33=_0x2edde1;return db[_0x7a73('0x60')][_0x7a73('0x2f')];}})[_0x7a73('0x28')](function(_0x4d065c){if(_0x4d065c){var _0x4f6059={};var _0x45e12f={};_0x45e12f[_0x7a73('0x32')]=_[_0x7a73('0x6e')](_['keys'](_0x4d065c),_[_0x7a73('0x33')](_0x119c33[_0x7a73('0x6d')],function(_0x40cf0e){return util['format'](_0x7a73('0x70'),_0x40cf0e['id']);}));_0x45e12f[_0x7a73('0x34')]=_['keys'](_0x5e56bc[_0x7a73('0x34')]);_0x45e12f[_0x7a73('0x36')]=_[_0x7a73('0x37')](_0x45e12f['model'],_0x45e12f[_0x7a73('0x34')]);_0x4f6059['attributes']=_[_0x7a73('0x37')](_0x45e12f[_0x7a73('0x32')],qs[_0x7a73('0x39')](_0x5e56bc['query'][_0x7a73('0x39')]));_0x4f6059[_0x7a73('0x38')]=_0x4f6059[_0x7a73('0x38')][_0x7a73('0x3a')]?_0x4f6059[_0x7a73('0x38')]:_0x45e12f[_0x7a73('0x32')];if(!_0x5e56bc[_0x7a73('0x34')]['hasOwnProperty'](_0x7a73('0x3c'))){_0x4f6059[_0x7a73('0x21')]=qs[_0x7a73('0x21')](_0x5e56bc['query'][_0x7a73('0x21')]);_0x4f6059[_0x7a73('0x1f')]=qs[_0x7a73('0x1f')](_0x5e56bc[_0x7a73('0x34')][_0x7a73('0x1f')]);}_0x4f6059[_0x7a73('0x3d')]=qs[_0x7a73('0x3e')](_0x5e56bc[_0x7a73('0x34')][_0x7a73('0x3e')]);_0x4f6059[_0x7a73('0x3f')]=qs['filters'](_[_0x7a73('0x40')](_0x5e56bc['query'],_0x45e12f[_0x7a73('0x36')]));_0x4f6059['raw']=!![];if(_0x5e56bc['query'][_0x7a73('0x41')]){_0x4f6059[_0x7a73('0x3f')]=_[_0x7a73('0x42')](_0x4f6059['where'],{'$or':_[_0x7a73('0x33')](_0x4f6059[_0x7a73('0x38')],function(_0xb34e7d){var _0x385b0c={};_0x385b0c[_0xb34e7d]={'$like':'%'+_0x5e56bc[_0x7a73('0x34')][_0x7a73('0x41')]+'%'};return _0x385b0c;})});}_0x4f6059=_[_0x7a73('0x42')]({},_0x4f6059,_0x5e56bc[_0x7a73('0x44')]);return _0x119c33[_0x7a73('0x6b')](_0x4f6059);}})[_0x7a73('0x28')](function(_0x4d2ab1){if(!_[_0x7a73('0x72')](_0x4d2ab1)){var _0x43e72d=toCsv(_0x4d2ab1);var _0x839d44=Date[_0x7a73('0x73')]();fs[_0x7a73('0x74')](util[_0x7a73('0x6f')]('/tmp/list_%d_%s.csv',_0x119c33['id'],_0x839d44),_0x43e72d);_0x2648f6[_0x7a73('0x75')]('Content-disposition',_0x7a73('0x76')+util[_0x7a73('0x6f')]('list_%d_%s.csv',_0x119c33['id'],_0x839d44));_0x2648f6['setHeader'](_0x7a73('0x77'),'text/csv');return _0x2648f6[_0x7a73('0x78')](util[_0x7a73('0x6f')](_0x7a73('0x79'),_0x119c33['id'],_0x839d44));}else{return _0x2648f6[_0x7a73('0x1b')](0xcc);}})[_0x7a73('0x4a')](handleError(_0x2648f6,null));};exports[_0x7a73('0x7a')]=function(_0x221d4d,_0x59494b,_0x250a4c){var _0x8292e5;delete _0x221d4d[_0x7a73('0x4e')]['id'];return db[_0x7a73('0x45')][_0x7a73('0x5c')]({'where':{'id':_0x221d4d[_0x7a73('0x4c')]['id']}})[_0x7a73('0x28')](handleEntityNotFound(_0x59494b,null))[_0x7a73('0x28')](function(_0x5dee4d){if(_0x5dee4d){return db[_0x7a73('0x7b')]['transaction'](function(_0x8e7515){return db[_0x7a73('0x6c')]['create'](_0x221d4d[_0x7a73('0x4e')],{'transaction':_0x8e7515})[_0x7a73('0x28')](function(_0x530f46){_0x8292e5=_0x530f46;return _0x5dee4d[_0x7a73('0x7c')](_0x530f46,{'transaction':_0x8e7515});})[_0x7a73('0x28')](function(){var _0xbd195b={'type':db[_0x7a73('0x7d')][_0x7a73('0x7e')],'transaction':_0x8e7515};switch(_0x221d4d['body'][_0x7a73('0x30')]){case _0x7a73('0x7f'):_0xbd195b[_0x7a73('0x30')]=db[_0x7a73('0x7d')]['TEXT'];break;case _0x7a73('0x80'):_0xbd195b[_0x7a73('0x30')]=db['Sequelize'][_0x7a73('0x81')];break;case'switch':_0xbd195b[_0x7a73('0x30')]=db[_0x7a73('0x7d')][_0x7a73('0x82')];_0xbd195b[_0x7a73('0x83')]=![];break;default:}return db['sequelize'][_0x7a73('0x84')][_0x7a73('0x85')](_0x7a73('0x86'),util[_0x7a73('0x6f')](_0x7a73('0x87'),_0x8292e5['id']),_0xbd195b);})[_0x7a73('0x28')](function(){return _0x8292e5;});});}})['then'](respondWithResult(_0x59494b,null))['catch'](handleError(_0x59494b,null));};exports[_0x7a73('0x88')]=function(_0x34c7a3,_0x7fd138,_0x25ae5d){var _0x3900dc={};var _0x33fe94={};var _0x1e9248;var _0x235626;return db['CmList'][_0x7a73('0x5c')]({'where':{'id':_0x34c7a3[_0x7a73('0x4c')]['id']}})[_0x7a73('0x28')](handleEntityNotFound(_0x7fd138,null))['then'](function(_0x4417fa){if(_0x4417fa){_0x1e9248=_0x4417fa;_0x33fe94['model']=_[_0x7a73('0x35')](db[_0x7a73('0x6c')]['rawAttributes']);_0x33fe94[_0x7a73('0x34')]=_[_0x7a73('0x35')](_0x34c7a3[_0x7a73('0x34')]);_0x33fe94[_0x7a73('0x36')]=_['intersection'](_0x33fe94[_0x7a73('0x32')],_0x33fe94['query']);_0x3900dc[_0x7a73('0x38')]=_[_0x7a73('0x37')](_0x33fe94['model'],qs[_0x7a73('0x39')](_0x34c7a3[_0x7a73('0x34')][_0x7a73('0x39')]));_0x3900dc[_0x7a73('0x38')]=_0x3900dc[_0x7a73('0x38')]['length']?_0x3900dc[_0x7a73('0x38')]:_0x33fe94[_0x7a73('0x32')];_0x3900dc[_0x7a73('0x3d')]=qs['sort'](_0x34c7a3['query'][_0x7a73('0x3e')]);_0x3900dc[_0x7a73('0x3f')]=qs[_0x7a73('0x36')](_['pick'](_0x34c7a3[_0x7a73('0x34')],_0x33fe94['filters']));_0x3900dc[_0x7a73('0x3f')]=_[_0x7a73('0x42')](_0x3900dc[_0x7a73('0x3f')],{'$or':[{'ListId':_0x4417fa['id']},{'ListId':null}]});if(_0x34c7a3[_0x7a73('0x34')]['filter']){_0x3900dc['where']=_[_0x7a73('0x42')](_0x3900dc[_0x7a73('0x3f')],{'$or':_[_0x7a73('0x33')](_0x3900dc[_0x7a73('0x38')],function(_0x15db4b){var _0x296d3b={};_0x296d3b[_0x15db4b]={'$like':'%'+_0x34c7a3[_0x7a73('0x34')]['filter']+'%'};return _0x296d3b;})});}_0x3900dc=_[_0x7a73('0x42')]({},_0x3900dc,_0x34c7a3[_0x7a73('0x44')]);return db[_0x7a73('0x6c')][_0x7a73('0x89')](_0x3900dc);}})[_0x7a73('0x28')](respondWithResult(_0x7fd138,null))[_0x7a73('0x4a')](handleError(_0x7fd138,null));};exports[_0x7a73('0x8a')]=function(_0xb16465,_0x458487,_0x21d711){return db[_0x7a73('0x45')][_0x7a73('0x57')]({'where':{'id':_0xb16465[_0x7a73('0x4c')]['id']}})['then'](handleEntityNotFound(_0x458487,null))['then'](function(_0x1f203d){if(_0x1f203d){return _0x1f203d[_0x7a73('0x8a')](_0xb16465[_0x7a73('0x4e')][_0x7a73('0x5e')],_[_0x7a73('0x66')](_0xb16465[_0x7a73('0x4e')],[_0x7a73('0x5e'),'id'])||{})['spread'](function(_0xe4d6f3){for(var _0x17ad7c=0x0;_0x17ad7c<_0xb16465[_0x7a73('0x4e')]['ids'][_0x7a73('0x3a')];_0x17ad7c+=0x1){socket[_0x7a73('0x8b')](_0x7a73('0x8c'),{'UserId':Number(_0xb16465[_0x7a73('0x4e')][_0x7a73('0x5e')][_0x17ad7c]),'CmListId':Number(_0xb16465[_0x7a73('0x4c')]['id'])});}return _0xe4d6f3;});}})[_0x7a73('0x28')](respondWithResult(_0x458487,null))[_0x7a73('0x4a')](handleError(_0x458487,null));};exports[_0x7a73('0x8d')]=function(_0x211898,_0xb2b2a0,_0x1e7696){return db['CmList'][_0x7a73('0x57')]({'where':{'id':_0x211898[_0x7a73('0x4c')]['id']}})[_0x7a73('0x28')](handleEntityNotFound(_0xb2b2a0,null))[_0x7a73('0x28')](function(_0x20276e){if(_0x20276e){return _0x20276e['removeAgents'](_0x211898[_0x7a73('0x34')][_0x7a73('0x5e')])[_0x7a73('0x28')](function(){if(_[_0x7a73('0x61')](_0x211898[_0x7a73('0x34')][_0x7a73('0x5e')])){for(var _0xe42764=0x0;_0xe42764<_0x211898[_0x7a73('0x34')][_0x7a73('0x5e')][_0x7a73('0x3a')];_0xe42764+=0x1){socket[_0x7a73('0x8b')]('userCmList:remove',{'UserId':Number(_0x211898['query'][_0x7a73('0x5e')][_0xe42764]),'CmListId':Number(_0x211898[_0x7a73('0x4c')]['id'])});}}else{socket[_0x7a73('0x8b')]('userCmList:remove',{'UserId':Number(_0x211898[_0x7a73('0x34')][_0x7a73('0x5e')]),'CmListId':Number(_0x211898['params']['id'])});}});}})[_0x7a73('0x28')](respondWithStatusCode(_0xb2b2a0,null))[_0x7a73('0x4a')](handleError(_0xb2b2a0,null));};exports[_0x7a73('0x8e')]=function(_0x29a45f,_0x24c0ff,_0x2ce7a){var _0x13d66a={};var _0x131e41={};var _0x25e191;var _0x140ca4;return db[_0x7a73('0x45')][_0x7a73('0x5c')]({'where':{'id':_0x29a45f[_0x7a73('0x4c')]['id']}})['then'](handleEntityNotFound(_0x24c0ff,null))[_0x7a73('0x28')](function(_0x5ab6fd){if(_0x5ab6fd){_0x25e191=_0x5ab6fd;_0x131e41[_0x7a73('0x32')]=_['keys'](db[_0x7a73('0x8f')][_0x7a73('0x2f')]);_0x131e41[_0x7a73('0x34')]=_['keys'](_0x29a45f[_0x7a73('0x34')]);_0x131e41[_0x7a73('0x36')]=_[_0x7a73('0x37')](_0x131e41[_0x7a73('0x32')],_0x131e41[_0x7a73('0x34')]);_0x13d66a['attributes']=_[_0x7a73('0x37')](_0x131e41[_0x7a73('0x32')],qs[_0x7a73('0x39')](_0x29a45f[_0x7a73('0x34')][_0x7a73('0x39')]));_0x13d66a[_0x7a73('0x38')]=_0x13d66a['attributes']['length']?_0x13d66a['attributes']:_0x131e41['model'];_0x13d66a[_0x7a73('0x3d')]=qs[_0x7a73('0x3e')](_0x29a45f[_0x7a73('0x34')][_0x7a73('0x3e')]);_0x13d66a[_0x7a73('0x3f')]=qs['filters'](_[_0x7a73('0x40')](_0x29a45f[_0x7a73('0x34')],_0x131e41['filters']));if(_0x29a45f[_0x7a73('0x34')][_0x7a73('0x41')]){_0x13d66a['where']=_[_0x7a73('0x42')](_0x13d66a[_0x7a73('0x3f')],{'$or':_[_0x7a73('0x33')](_0x13d66a[_0x7a73('0x38')],function(_0x2dff22){var _0x42c438={};_0x42c438[_0x2dff22]={'$like':'%'+_0x29a45f['query'][_0x7a73('0x41')]+'%'};return _0x42c438;})});}_0x13d66a=_['merge']({},_0x13d66a,_0x29a45f[_0x7a73('0x44')]);return _0x25e191[_0x7a73('0x8e')](_0x13d66a);}})['then'](function(_0x258ff){if(_0x258ff){_0x140ca4=_0x258ff[_0x7a73('0x3a')];if(!_0x29a45f[_0x7a73('0x34')][_0x7a73('0x3b')]('nolimit')){_0x13d66a['limit']=qs[_0x7a73('0x21')](_0x29a45f[_0x7a73('0x34')][_0x7a73('0x21')]);_0x13d66a[_0x7a73('0x1f')]=qs[_0x7a73('0x1f')](_0x29a45f[_0x7a73('0x34')][_0x7a73('0x1f')]);}return _0x25e191[_0x7a73('0x8e')](_0x13d66a);}})['then'](function(_0xee43e3){if(_0xee43e3){return _0xee43e3?{'count':_0x140ca4,'rows':_0xee43e3}:null;}})[_0x7a73('0x28')](respondWithResult(_0x24c0ff,null))[_0x7a73('0x4a')](handleError(_0x24c0ff,null));}; \ No newline at end of file +var _0x0b87=['userCmList:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','CmList','include','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Lists','userProfileId','autoAssociation','params','describe','addDisposition','findOne','Disposition','ListId','findAll','removeDispositions','ids','CmContact','tags','isArray','push','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','raw','getContactsCsv','cf_%d','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','addAgents','spread','emit','removeAgents'];(function(_0x1a038f,_0x1a8e9b){var _0x1ee446=function(_0x1fdf1a){while(--_0x1fdf1a){_0x1a038f['push'](_0x1a038f['shift']());}};_0x1ee446(++_0x1a8e9b);}(_0x0b87,0x1af));var _0x70b8=function(_0x233f13,_0x4ed7af){_0x233f13=_0x233f13-0x0;var _0xb6a900=_0x0b87[_0x233f13];return _0xb6a900;};'use strict';var emlformat=require(_0x70b8('0x0'));var rimraf=require(_0x70b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x70b8('0x2'));var rp=require(_0x70b8('0x3'));var moment=require(_0x70b8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x70b8('0x5'));var util=require('util');var path=require(_0x70b8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70b8('0x7'));var _=require(_0x70b8('0x8'));var squel=require(_0x70b8('0x9'));var crypto=require(_0x70b8('0xa'));var jsforce=require(_0x70b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x70b8('0xc'));var querystring=require(_0x70b8('0xd'));var Papa=require(_0x70b8('0xe'));var Redis=require(_0x70b8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x70b8('0x10'));var as=require(_0x70b8('0x11'));var hardwareService=require(_0x70b8('0x12'));var logger=require(_0x70b8('0x13'))(_0x70b8('0x14'));var utils=require(_0x70b8('0x15'));var config=require(_0x70b8('0x16'));var licenseUtil=require(_0x70b8('0x17'));var db=require(_0x70b8('0x18'))['db'];config[_0x70b8('0x19')]=_[_0x70b8('0x1a')](config[_0x70b8('0x19')],{'host':_0x70b8('0x1b'),'port':0x18eb});var socket=require(_0x70b8('0x1c'))(new Redis(config[_0x70b8('0x19')]));require(_0x70b8('0x1d'))[_0x70b8('0x1e')](socket);function respondWithStatusCode(_0x140102,_0xa87b14){_0xa87b14=_0xa87b14||0xcc;return function(_0x270770){if(_0x270770){return _0x140102['sendStatus'](_0xa87b14);}return _0x140102[_0x70b8('0x1f')](_0xa87b14)[_0x70b8('0x20')]();};}function respondWithResult(_0x505d7b,_0xa3b99c){_0xa3b99c=_0xa3b99c||0xc8;return function(_0x490075){if(_0x490075){return _0x505d7b[_0x70b8('0x1f')](_0xa3b99c)['json'](_0x490075);}};}function respondWithFilteredResult(_0x19cc56,_0x447be0){return function(_0x1f2110){if(_0x1f2110){var _0x256d9e=typeof _0x447be0[_0x70b8('0x21')]===_0x70b8('0x22')&&typeof _0x447be0[_0x70b8('0x23')]===_0x70b8('0x22');var _0x5aa427=_0x1f2110[_0x70b8('0x24')];var _0x49c2fb=_0x256d9e?0x0:_0x447be0[_0x70b8('0x21')];var _0x5a2edc=_0x256d9e?_0x1f2110['count']:_0x447be0[_0x70b8('0x21')]+_0x447be0[_0x70b8('0x23')];var _0x50aebe;if(_0x5a2edc>=_0x5aa427){_0x5a2edc=_0x5aa427;_0x50aebe=0xc8;}else{_0x50aebe=0xce;}_0x19cc56['status'](_0x50aebe);return _0x19cc56[_0x70b8('0x25')](_0x70b8('0x26'),_0x49c2fb+'-'+_0x5a2edc+'/'+_0x5aa427)[_0x70b8('0x27')](_0x1f2110);}return null;};}function patchUpdates(_0xf67458){return function(_0x15e0a3){try{jsonpatch[_0x70b8('0x28')](_0x15e0a3,_0xf67458,!![]);}catch(_0x865e8d){return BPromise[_0x70b8('0x29')](_0x865e8d);}return _0x15e0a3[_0x70b8('0x2a')]();};}function saveUpdates(_0x4518b5,_0x3e2340){return function(_0x55a365){if(_0x55a365){return _0x55a365[_0x70b8('0x2b')](_0x4518b5)['then'](function(_0x459c41){return _0x459c41;});}return null;};}function removeEntity(_0x491737,_0x3e5079){return function(_0x327584){if(_0x327584){return _0x327584[_0x70b8('0x2c')]()[_0x70b8('0x2d')](function(){var _0xeab126=_0x327584[_0x70b8('0x2e')]({'plain':!![]});var _0x2eae74='Lists';return db[_0x70b8('0x2f')]['destroy']({'where':{'type':_0x2eae74,'resourceId':_0xeab126['id']}})[_0x70b8('0x2d')](function(){return _0x327584;});})[_0x70b8('0x2d')](function(){_0x491737[_0x70b8('0x1f')](0xcc)[_0x70b8('0x20')]();});}};}function handleEntityNotFound(_0x54e653,_0x4f65d0){return function(_0x2a6779){if(!_0x2a6779){_0x54e653[_0x70b8('0x30')](0x194);}return _0x2a6779;};}function handleError(_0x122cab,_0x1ba725){_0x1ba725=_0x1ba725||0x1f4;return function(_0x55cf8e){logger[_0x70b8('0x31')](_0x55cf8e[_0x70b8('0x32')]);if(_0x55cf8e['name']){delete _0x55cf8e[_0x70b8('0x33')];}_0x122cab[_0x70b8('0x1f')](_0x1ba725)[_0x70b8('0x34')](_0x55cf8e);};}exports[_0x70b8('0x35')]=function(_0x11ce49,_0x33ce88){var _0x50d77f={},_0x2af966={},_0x3fb1d4={'count':0x0,'rows':[]};var _0x2bc3dd=_['map'](db['CmList'][_0x70b8('0x36')],function(_0x261121){return{'name':_0x261121['fieldName'],'type':_0x261121[_0x70b8('0x37')]['key']};});_0x2af966[_0x70b8('0x38')]=_['map'](_0x2bc3dd,_0x70b8('0x33'));_0x2af966[_0x70b8('0x39')]=_[_0x70b8('0x3a')](_0x11ce49[_0x70b8('0x39')]);_0x2af966[_0x70b8('0x3b')]=_[_0x70b8('0x3c')](_0x2af966[_0x70b8('0x38')],_0x2af966[_0x70b8('0x39')]);_0x50d77f[_0x70b8('0x3d')]=_[_0x70b8('0x3c')](_0x2af966['model'],qs[_0x70b8('0x3e')](_0x11ce49[_0x70b8('0x39')][_0x70b8('0x3e')]));_0x50d77f['attributes']=_0x50d77f[_0x70b8('0x3d')][_0x70b8('0x3f')]?_0x50d77f[_0x70b8('0x3d')]:_0x2af966['model'];if(!_0x11ce49[_0x70b8('0x39')][_0x70b8('0x40')](_0x70b8('0x41'))){_0x50d77f[_0x70b8('0x23')]=qs['limit'](_0x11ce49[_0x70b8('0x39')][_0x70b8('0x23')]);_0x50d77f[_0x70b8('0x21')]=qs[_0x70b8('0x21')](_0x11ce49['query']['offset']);}_0x50d77f[_0x70b8('0x42')]=qs[_0x70b8('0x43')](_0x11ce49[_0x70b8('0x39')]['sort']);_0x50d77f[_0x70b8('0x44')]=qs[_0x70b8('0x3b')](_[_0x70b8('0x45')](_0x11ce49[_0x70b8('0x39')],_0x2af966[_0x70b8('0x3b')]),_0x2bc3dd);if(_0x11ce49[_0x70b8('0x39')][_0x70b8('0x46')]){_0x50d77f['where']=_[_0x70b8('0x47')](_0x50d77f[_0x70b8('0x44')],{'$or':_[_0x70b8('0x48')](_0x2bc3dd,function(_0x1bb752){if(_0x1bb752[_0x70b8('0x37')]!==_0x70b8('0x49')){var _0x4cb045={};_0x4cb045[_0x1bb752[_0x70b8('0x33')]]={'$like':'%'+_0x11ce49[_0x70b8('0x39')][_0x70b8('0x46')]+'%'};return _0x4cb045;}})});}_0x50d77f=_[_0x70b8('0x47')]({},_0x50d77f,_0x11ce49[_0x70b8('0x4a')]);var _0x46db0b={'where':_0x50d77f[_0x70b8('0x44')]};return db[_0x70b8('0x4b')]['count'](_0x46db0b)[_0x70b8('0x2d')](function(_0x5a6c8c){_0x3fb1d4[_0x70b8('0x24')]=_0x5a6c8c;if(_0x11ce49[_0x70b8('0x39')]['includeAll']){_0x50d77f[_0x70b8('0x4c')]=[{'all':!![]}];}return db[_0x70b8('0x4b')]['findAll'](_0x50d77f);})['then'](function(_0x38f55d){_0x3fb1d4[_0x70b8('0x4d')]=_0x38f55d;return _0x3fb1d4;})[_0x70b8('0x2d')](respondWithFilteredResult(_0x33ce88,_0x50d77f))[_0x70b8('0x4e')](handleError(_0x33ce88,null));};exports[_0x70b8('0x4f')]=function(_0x3fa937,_0x2fe954){var _0x440f13={'raw':![],'where':{'id':_0x3fa937['params']['id']}},_0x2f1c73={};_0x2f1c73[_0x70b8('0x38')]=_[_0x70b8('0x3a')](db[_0x70b8('0x4b')][_0x70b8('0x36')]);_0x2f1c73['query']=_[_0x70b8('0x3a')](_0x3fa937[_0x70b8('0x39')]);_0x2f1c73[_0x70b8('0x3b')]=_[_0x70b8('0x3c')](_0x2f1c73[_0x70b8('0x38')],_0x2f1c73['query']);_0x440f13[_0x70b8('0x3d')]=_[_0x70b8('0x3c')](_0x2f1c73[_0x70b8('0x38')],qs[_0x70b8('0x3e')](_0x3fa937[_0x70b8('0x39')][_0x70b8('0x3e')]));_0x440f13[_0x70b8('0x3d')]=_0x440f13['attributes'][_0x70b8('0x3f')]?_0x440f13[_0x70b8('0x3d')]:_0x2f1c73[_0x70b8('0x38')];if(_0x3fa937['query'][_0x70b8('0x50')]){_0x440f13[_0x70b8('0x4c')]=[{'all':!![]}];}_0x440f13=_[_0x70b8('0x47')]({},_0x440f13,_0x3fa937['options']);return db[_0x70b8('0x4b')][_0x70b8('0x51')](_0x440f13)[_0x70b8('0x2d')](handleEntityNotFound(_0x2fe954,null))['then'](respondWithResult(_0x2fe954,null))[_0x70b8('0x4e')](handleError(_0x2fe954,null));};exports[_0x70b8('0x52')]=function(_0x48f838,_0x1bb247){return db[_0x70b8('0x4b')][_0x70b8('0x52')](_0x48f838[_0x70b8('0x53')],{})[_0x70b8('0x2d')](function(_0x42c874){var _0xc3d3f7=_0x48f838[_0x70b8('0x54')][_0x70b8('0x2e')]({'plain':!![]});if(!_0xc3d3f7)throw new Error(_0x70b8('0x55'));if(_0xc3d3f7['role']===_0x70b8('0x54')){var _0x123a3c=_0x42c874[_0x70b8('0x2e')]({'plain':!![]});var _0x1bc866=_0x70b8('0x56');return db['UserProfileSection'][_0x70b8('0x51')]({'where':{'name':_0x1bc866,'userProfileId':_0xc3d3f7[_0x70b8('0x57')]},'raw':!![]})[_0x70b8('0x2d')](function(_0x5b734e){if(_0x5b734e&&_0x5b734e[_0x70b8('0x58')]===0x0){return db[_0x70b8('0x2f')][_0x70b8('0x52')]({'name':_0x123a3c[_0x70b8('0x33')],'resourceId':_0x123a3c['id'],'type':_0x5b734e[_0x70b8('0x33')],'sectionId':_0x5b734e['id']},{})[_0x70b8('0x2d')](function(){return _0x42c874;});}else{return _0x42c874;}})[_0x70b8('0x4e')](function(_0x35784d){logger[_0x70b8('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35784d);throw _0x35784d;});}return _0x42c874;})[_0x70b8('0x2d')](respondWithResult(_0x1bb247,0xc9))['catch'](handleError(_0x1bb247,null));};exports['update']=function(_0x37e1b4,_0x4a7c2b){if(_0x37e1b4['body']['id']){delete _0x37e1b4['body']['id'];}return db[_0x70b8('0x4b')]['find']({'where':{'id':_0x37e1b4[_0x70b8('0x59')]['id']}})[_0x70b8('0x2d')](handleEntityNotFound(_0x4a7c2b,null))[_0x70b8('0x2d')](saveUpdates(_0x37e1b4[_0x70b8('0x53')],null))[_0x70b8('0x2d')](respondWithResult(_0x4a7c2b,null))[_0x70b8('0x4e')](handleError(_0x4a7c2b,null));};exports[_0x70b8('0x2c')]=function(_0xda5a9f,_0x2295c6){return db[_0x70b8('0x4b')]['find']({'where':{'id':_0xda5a9f[_0x70b8('0x59')]['id']}})[_0x70b8('0x2d')](handleEntityNotFound(_0x2295c6,null))['then'](removeEntity(_0x2295c6,null))[_0x70b8('0x4e')](handleError(_0x2295c6,null));};exports[_0x70b8('0x5a')]=function(_0x1d373c,_0x59c923){return db[_0x70b8('0x4b')]['describe']()[_0x70b8('0x2d')](respondWithResult(_0x59c923,null))[_0x70b8('0x4e')](handleError(_0x59c923,null));};exports[_0x70b8('0x5b')]=function(_0x5b95cf,_0x2c614c,_0x1c4116){if(_0x5b95cf['body']['id']){delete _0x5b95cf['body']['id'];}return db[_0x70b8('0x4b')]['find']({'where':{'id':_0x5b95cf[_0x70b8('0x59')]['id']}})[_0x70b8('0x2d')](handleEntityNotFound(_0x2c614c,null))['then'](function(_0x19a1e6){if(_0x19a1e6){_0x5b95cf['body']['ListId']=_0x19a1e6['id'];return db['Disposition'][_0x70b8('0x52')](_0x5b95cf[_0x70b8('0x53')]);}})[_0x70b8('0x2d')](respondWithResult(_0x2c614c,null))[_0x70b8('0x4e')](handleError(_0x2c614c,null));};exports['getDispositions']=function(_0x25aebc,_0xcb56ab,_0x2320d4){var _0x3a2eda={'raw':![],'where':{}};var _0x4e73e5={};var _0x2e8490={'count':0x0,'rows':[]};return db[_0x70b8('0x4b')][_0x70b8('0x5c')]({'where':{'id':_0x25aebc[_0x70b8('0x59')]['id']}})[_0x70b8('0x2d')](handleEntityNotFound(_0xcb56ab,null))['then'](function(_0x3774d0){if(_0x3774d0){_0x4e73e5[_0x70b8('0x38')]=_[_0x70b8('0x3a')](db[_0x70b8('0x5d')]['rawAttributes']);_0x4e73e5[_0x70b8('0x39')]=_[_0x70b8('0x3a')](_0x25aebc['query']);_0x4e73e5['filters']=_[_0x70b8('0x3c')](_0x4e73e5[_0x70b8('0x38')],_0x4e73e5[_0x70b8('0x39')]);_0x3a2eda[_0x70b8('0x3d')]=_[_0x70b8('0x3c')](_0x4e73e5['model'],qs[_0x70b8('0x3e')](_0x25aebc[_0x70b8('0x39')]['fields']));_0x3a2eda[_0x70b8('0x3d')]=_0x3a2eda[_0x70b8('0x3d')]['length']?_0x3a2eda[_0x70b8('0x3d')]:_0x4e73e5['model'];if(!_0x25aebc['query'][_0x70b8('0x40')](_0x70b8('0x41'))){_0x3a2eda[_0x70b8('0x23')]=qs[_0x70b8('0x23')](_0x25aebc['query'][_0x70b8('0x23')]);_0x3a2eda[_0x70b8('0x21')]=qs[_0x70b8('0x21')](_0x25aebc[_0x70b8('0x39')]['offset']);}_0x3a2eda[_0x70b8('0x42')]=qs[_0x70b8('0x43')](_0x25aebc[_0x70b8('0x39')][_0x70b8('0x43')]);_0x3a2eda[_0x70b8('0x44')]=qs[_0x70b8('0x3b')](_[_0x70b8('0x45')](_0x25aebc[_0x70b8('0x39')],_0x4e73e5[_0x70b8('0x3b')]));_0x3a2eda[_0x70b8('0x44')][_0x70b8('0x5e')]=_0x3774d0['id'];if(_0x25aebc['query']['filter']){_0x3a2eda['where']=_[_0x70b8('0x47')](_0x3a2eda[_0x70b8('0x44')],{'$or':_['map'](_0x3a2eda[_0x70b8('0x3d')],function(_0x40324e){var _0x3b6ec2={};_0x3b6ec2[_0x40324e]={'$like':'%'+_0x25aebc[_0x70b8('0x39')]['filter']+'%'};return _0x3b6ec2;})});}_0x3a2eda=_[_0x70b8('0x47')]({},_0x3a2eda,_0x25aebc[_0x70b8('0x4a')]);return db[_0x70b8('0x5d')][_0x70b8('0x24')]({'where':_0x3a2eda[_0x70b8('0x44')]})[_0x70b8('0x2d')](function(_0x38e667){_0x2e8490[_0x70b8('0x24')]=_0x38e667;if(_0x25aebc['query'][_0x70b8('0x50')]){_0x3a2eda[_0x70b8('0x4c')]=[{'all':!![]}];}return db[_0x70b8('0x5d')][_0x70b8('0x5f')](_0x3a2eda);})[_0x70b8('0x2d')](function(_0x29e51c){_0x2e8490[_0x70b8('0x4d')]=_0x29e51c;return _0x2e8490;});}})[_0x70b8('0x2d')](respondWithFilteredResult(_0xcb56ab,_0x3a2eda))['catch'](handleError(_0xcb56ab,null));};exports[_0x70b8('0x60')]=function(_0x29487d,_0x136b6d,_0x3fe008){return db[_0x70b8('0x4b')][_0x70b8('0x51')]({'where':{'id':_0x29487d[_0x70b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x136b6d,null))['then'](function(_0x37794f){if(_0x37794f){return _0x37794f['removeDispositions'](_0x29487d['query'][_0x70b8('0x61')]);}})['then'](respondWithStatusCode(_0x136b6d,null))[_0x70b8('0x4e')](handleError(_0x136b6d,null));};exports['addContacts']=function(_0x4790f3,_0x16c1dd,_0x29c929){return db[_0x70b8('0x4b')][_0x70b8('0x51')]({'where':{'id':_0x4790f3[_0x70b8('0x59')]['id']}})[_0x70b8('0x2d')](handleEntityNotFound(_0x16c1dd,null))[_0x70b8('0x2d')](function(_0x30cc6f){if(_0x30cc6f){var _0x21f613=[];var _0x51eea0={'success':[],'errors':[]};return db[_0x70b8('0x62')][_0x70b8('0x5a')]()['then'](function(_0x200e00){if(_0x4790f3[_0x70b8('0x53')][_0x70b8('0x63')]&&_[_0x70b8('0x64')](_0x4790f3[_0x70b8('0x53')][_0x70b8('0x63')])){if(_0x4790f3['body'][_0x70b8('0x63')]['length']){_0x4790f3[_0x70b8('0x53')][_0x70b8('0x63')]=_0x4790f3['body']['tags']['join'](';')+';';}else{_0x4790f3[_0x70b8('0x53')][_0x70b8('0x63')]=null;}}else{_0x4790f3[_0x70b8('0x53')][_0x70b8('0x63')]=null;}if(_0x4790f3[_0x70b8('0x53')]&&_[_0x70b8('0x64')](_0x4790f3[_0x70b8('0x53')])){for(var _0x3c9ad8=0x0;_0x3c9ad8<_0x4790f3[_0x70b8('0x53')]['length'];_0x3c9ad8+=0x1){_0x4790f3[_0x70b8('0x53')][_0x3c9ad8][_0x70b8('0x5e')]=_0x4790f3['params']['id'];_0x21f613[_0x70b8('0x65')](_0x4790f3[_0x70b8('0x53')][_0x3c9ad8]);}return BPromise['each'](_0x21f613,function(_0xb1cf4d){return db[_0x70b8('0x62')][_0x70b8('0x52')](_[_0x70b8('0x66')](_0xb1cf4d,[_0x70b8('0x61'),'id'])||{},{'fields':_[_0x70b8('0x3a')](_0x200e00),'raw':!![]})[_0x70b8('0x2d')](function(_0x2620da){_0x51eea0[_0x70b8('0x67')][_0x70b8('0x65')](_0x2620da['dataValues']);})[_0x70b8('0x4e')](function(_0x53c545){_0x51eea0[_0x70b8('0x68')][_0x70b8('0x65')]({'data':_0xb1cf4d,'error':_0x53c545[_0x70b8('0x69')]});});})[_0x70b8('0x2d')](function(_0x546bd3){return _0x51eea0;})[_0x70b8('0x4e')](function(_0x433a4d){return _0x433a4d;});}else{_0x16c1dd[_0x70b8('0x1f')](0x190)['json']({'message':_0x70b8('0x6a')});}});}})[_0x70b8('0x2d')](respondWithResult(_0x16c1dd,null))['catch'](handleError(_0x16c1dd,null));};exports[_0x70b8('0x6b')]=function(_0x18da78,_0x525252,_0x1457da){var _0x33708e;return db['CmList'][_0x70b8('0x51')]({'where':{'id':_0x18da78[_0x70b8('0x59')]['id']},'include':[{'model':db[_0x70b8('0x6c')],'as':'CustomFields'}]})[_0x70b8('0x2d')](handleEntityNotFound(_0x525252,null))[_0x70b8('0x2d')](function(_0x14f48c){if(_0x14f48c){_0x33708e=_0x14f48c;return db[_0x70b8('0x62')]['rawAttributes'];}})['then'](function(_0x288f73){if(_0x288f73){var _0x55404f={};var _0x2ccc2c={};_0x2ccc2c['model']=_[_0x70b8('0x6d')](_[_0x70b8('0x3a')](_0x288f73),_[_0x70b8('0x48')](_0x33708e[_0x70b8('0x6e')],function(_0x55ad05){return util[_0x70b8('0x6f')]('cf_%d',_0x55ad05['id']);}));_0x2ccc2c[_0x70b8('0x39')]=_[_0x70b8('0x3a')](_0x18da78['query']);_0x2ccc2c['filters']=_[_0x70b8('0x3c')](_0x2ccc2c['model'],_0x2ccc2c[_0x70b8('0x39')]);_0x55404f['attributes']=_['intersection'](_0x2ccc2c[_0x70b8('0x38')],qs['fields'](_0x18da78[_0x70b8('0x39')][_0x70b8('0x3e')]));_0x55404f[_0x70b8('0x3d')]=_0x55404f[_0x70b8('0x3d')]['length']?_0x55404f[_0x70b8('0x3d')]:_0x2ccc2c[_0x70b8('0x38')];if(!_0x18da78[_0x70b8('0x39')][_0x70b8('0x40')](_0x70b8('0x41'))){_0x55404f[_0x70b8('0x23')]=qs['limit'](_0x18da78['query']['limit']);_0x55404f['offset']=qs['offset'](_0x18da78[_0x70b8('0x39')][_0x70b8('0x21')]);}_0x55404f[_0x70b8('0x42')]=qs[_0x70b8('0x43')](_0x18da78['query'][_0x70b8('0x43')]);_0x55404f[_0x70b8('0x44')]=qs[_0x70b8('0x3b')](_[_0x70b8('0x45')](_0x18da78[_0x70b8('0x39')],_0x2ccc2c[_0x70b8('0x3b')]));_0x55404f[_0x70b8('0x70')]=!![];if(_0x18da78[_0x70b8('0x39')][_0x70b8('0x46')]){_0x55404f[_0x70b8('0x44')]=_[_0x70b8('0x47')](_0x55404f['where'],{'$or':_['map'](_0x55404f['attributes'],function(_0x3a5ed7){var _0x405908={};_0x405908[_0x3a5ed7]={'$like':'%'+_0x18da78['query']['filter']+'%'};return _0x405908;})});}_0x55404f=_[_0x70b8('0x47')]({},_0x55404f,_0x18da78[_0x70b8('0x4a')]);return _0x33708e[_0x70b8('0x6b')](_0x55404f);}})[_0x70b8('0x2d')](respondWithResult(_0x525252,null))['catch'](handleError(_0x525252,null));};exports[_0x70b8('0x71')]=function(_0x14e541,_0x2d5969,_0x5d7c25){var _0x1159ac;return db['CmList'][_0x70b8('0x51')]({'where':{'id':_0x14e541['params']['id']},'include':[{'model':db[_0x70b8('0x6c')],'as':_0x70b8('0x6e')}]})[_0x70b8('0x2d')](handleEntityNotFound(_0x2d5969,null))['then'](function(_0x205927){if(_0x205927){_0x1159ac=_0x205927;return db[_0x70b8('0x62')][_0x70b8('0x36')];}})[_0x70b8('0x2d')](function(_0x593390){if(_0x593390){var _0x474233={};var _0x188e60={};_0x188e60[_0x70b8('0x38')]=_[_0x70b8('0x6d')](_['keys'](_0x593390),_['map'](_0x1159ac[_0x70b8('0x6e')],function(_0x26ef0e){return util['format'](_0x70b8('0x72'),_0x26ef0e['id']);}));_0x188e60[_0x70b8('0x39')]=_['keys'](_0x14e541[_0x70b8('0x39')]);_0x188e60['filters']=_[_0x70b8('0x3c')](_0x188e60[_0x70b8('0x38')],_0x188e60[_0x70b8('0x39')]);_0x474233[_0x70b8('0x3d')]=_[_0x70b8('0x3c')](_0x188e60['model'],qs[_0x70b8('0x3e')](_0x14e541['query'][_0x70b8('0x3e')]));_0x474233[_0x70b8('0x3d')]=_0x474233['attributes'][_0x70b8('0x3f')]?_0x474233[_0x70b8('0x3d')]:_0x188e60['model'];if(!_0x14e541[_0x70b8('0x39')][_0x70b8('0x40')](_0x70b8('0x41'))){_0x474233[_0x70b8('0x23')]=qs[_0x70b8('0x23')](_0x14e541[_0x70b8('0x39')][_0x70b8('0x23')]);_0x474233[_0x70b8('0x21')]=qs[_0x70b8('0x21')](_0x14e541['query'][_0x70b8('0x21')]);}_0x474233[_0x70b8('0x42')]=qs[_0x70b8('0x43')](_0x14e541[_0x70b8('0x39')][_0x70b8('0x43')]);_0x474233[_0x70b8('0x44')]=qs[_0x70b8('0x3b')](_[_0x70b8('0x45')](_0x14e541[_0x70b8('0x39')],_0x188e60['filters']));_0x474233[_0x70b8('0x70')]=!![];if(_0x14e541['query'][_0x70b8('0x46')]){_0x474233['where']=_[_0x70b8('0x47')](_0x474233[_0x70b8('0x44')],{'$or':_[_0x70b8('0x48')](_0x474233[_0x70b8('0x3d')],function(_0x563ec6){var _0x3be0d2={};_0x3be0d2[_0x563ec6]={'$like':'%'+_0x14e541['query'][_0x70b8('0x46')]+'%'};return _0x3be0d2;})});}_0x474233=_[_0x70b8('0x47')]({},_0x474233,_0x14e541[_0x70b8('0x4a')]);return _0x1159ac[_0x70b8('0x6b')](_0x474233);}})['then'](function(_0x586727){if(!_[_0x70b8('0x73')](_0x586727)){var _0x345537=toCsv(_0x586727);var _0x13659b=Date['now']();fs[_0x70b8('0x74')](util[_0x70b8('0x6f')](_0x70b8('0x75'),_0x1159ac['id'],_0x13659b),_0x345537);_0x2d5969[_0x70b8('0x76')]('Content-disposition',_0x70b8('0x77')+util[_0x70b8('0x6f')](_0x70b8('0x78'),_0x1159ac['id'],_0x13659b));_0x2d5969['setHeader'](_0x70b8('0x79'),_0x70b8('0x7a'));return _0x2d5969[_0x70b8('0x7b')](util['format'](_0x70b8('0x75'),_0x1159ac['id'],_0x13659b));}else{return _0x2d5969[_0x70b8('0x30')](0xcc);}})[_0x70b8('0x4e')](handleError(_0x2d5969,null));};exports[_0x70b8('0x7c')]=function(_0x454c0c,_0x2d408a,_0x4f7944){var _0x3adadf;delete _0x454c0c[_0x70b8('0x53')]['id'];return db[_0x70b8('0x4b')]['findOne']({'where':{'id':_0x454c0c[_0x70b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x2d408a,null))['then'](function(_0x46c1fa){if(_0x46c1fa){return db[_0x70b8('0x7d')][_0x70b8('0x7e')](function(_0x13405c){return db['CmCustomField']['create'](_0x454c0c[_0x70b8('0x53')],{'transaction':_0x13405c})[_0x70b8('0x2d')](function(_0x4ee68f){_0x3adadf=_0x4ee68f;return _0x46c1fa['addCustomFields'](_0x4ee68f,{'transaction':_0x13405c});})['then'](function(){var _0x37cfa2={'type':db[_0x70b8('0x7f')][_0x70b8('0x80')],'transaction':_0x13405c};switch(_0x454c0c[_0x70b8('0x53')]['type']){case'text':_0x37cfa2[_0x70b8('0x37')]=db[_0x70b8('0x7f')][_0x70b8('0x80')];break;case _0x70b8('0x81'):_0x37cfa2['type']=db[_0x70b8('0x7f')][_0x70b8('0x82')];break;case _0x70b8('0x83'):_0x37cfa2[_0x70b8('0x37')]=db[_0x70b8('0x7f')][_0x70b8('0x84')];_0x37cfa2[_0x70b8('0x85')]=![];break;default:}return db['sequelize'][_0x70b8('0x86')]['addColumn'](_0x70b8('0x87'),util[_0x70b8('0x6f')](_0x70b8('0x88'),_0x3adadf['id']),_0x37cfa2);})['then'](function(){return _0x3adadf;});});}})[_0x70b8('0x2d')](respondWithResult(_0x2d408a,null))[_0x70b8('0x4e')](handleError(_0x2d408a,null));};exports['getCustomFields']=function(_0x1eab96,_0x283c13,_0x357969){var _0x358d96={};var _0x2eec25={};var _0x828432;var _0x558bd8;return db['CmList'][_0x70b8('0x5c')]({'where':{'id':_0x1eab96[_0x70b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x283c13,null))[_0x70b8('0x2d')](function(_0x48be9c){if(_0x48be9c){_0x828432=_0x48be9c;_0x2eec25[_0x70b8('0x38')]=_[_0x70b8('0x3a')](db[_0x70b8('0x6c')][_0x70b8('0x36')]);_0x2eec25[_0x70b8('0x39')]=_['keys'](_0x1eab96[_0x70b8('0x39')]);_0x2eec25[_0x70b8('0x3b')]=_['intersection'](_0x2eec25[_0x70b8('0x38')],_0x2eec25[_0x70b8('0x39')]);_0x358d96[_0x70b8('0x3d')]=_[_0x70b8('0x3c')](_0x2eec25['model'],qs[_0x70b8('0x3e')](_0x1eab96[_0x70b8('0x39')][_0x70b8('0x3e')]));_0x358d96['attributes']=_0x358d96[_0x70b8('0x3d')][_0x70b8('0x3f')]?_0x358d96[_0x70b8('0x3d')]:_0x2eec25['model'];_0x358d96[_0x70b8('0x42')]=qs['sort'](_0x1eab96['query'][_0x70b8('0x43')]);_0x358d96[_0x70b8('0x44')]=qs[_0x70b8('0x3b')](_[_0x70b8('0x45')](_0x1eab96[_0x70b8('0x39')],_0x2eec25['filters']));_0x358d96[_0x70b8('0x44')]=_[_0x70b8('0x47')](_0x358d96[_0x70b8('0x44')],{'$or':[{'ListId':_0x48be9c['id']},{'ListId':null}]});if(_0x1eab96[_0x70b8('0x39')][_0x70b8('0x46')]){_0x358d96[_0x70b8('0x44')]=_['merge'](_0x358d96['where'],{'$or':_['map'](_0x358d96['attributes'],function(_0x52cbca){var _0x470772={};_0x470772[_0x52cbca]={'$like':'%'+_0x1eab96[_0x70b8('0x39')][_0x70b8('0x46')]+'%'};return _0x470772;})});}_0x358d96=_[_0x70b8('0x47')]({},_0x358d96,_0x1eab96[_0x70b8('0x4a')]);return db[_0x70b8('0x6c')]['findAndCountAll'](_0x358d96);}})[_0x70b8('0x2d')](respondWithResult(_0x283c13,null))['catch'](handleError(_0x283c13,null));};exports[_0x70b8('0x89')]=function(_0x458c6a,_0x1447f4,_0x4a6834){return db[_0x70b8('0x4b')][_0x70b8('0x51')]({'where':{'id':_0x458c6a[_0x70b8('0x59')]['id']}})[_0x70b8('0x2d')](handleEntityNotFound(_0x1447f4,null))['then'](function(_0x47ef7d){if(_0x47ef7d){return _0x47ef7d[_0x70b8('0x89')](_0x458c6a['body'][_0x70b8('0x61')],_[_0x70b8('0x66')](_0x458c6a[_0x70b8('0x53')],[_0x70b8('0x61'),'id'])||{})[_0x70b8('0x8a')](function(_0x54dd5a){for(var _0x422c89=0x0;_0x422c89<_0x458c6a[_0x70b8('0x53')][_0x70b8('0x61')][_0x70b8('0x3f')];_0x422c89+=0x1){socket[_0x70b8('0x8b')]('userCmList:save',{'UserId':Number(_0x458c6a['body'][_0x70b8('0x61')][_0x422c89]),'CmListId':Number(_0x458c6a[_0x70b8('0x59')]['id'])});}return _0x54dd5a;});}})['then'](respondWithResult(_0x1447f4,null))[_0x70b8('0x4e')](handleError(_0x1447f4,null));};exports[_0x70b8('0x8c')]=function(_0x5ba6c9,_0x2ecc52,_0x4f6889){return db[_0x70b8('0x4b')][_0x70b8('0x51')]({'where':{'id':_0x5ba6c9[_0x70b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x2ecc52,null))[_0x70b8('0x2d')](function(_0x2b173a){if(_0x2b173a){return _0x2b173a[_0x70b8('0x8c')](_0x5ba6c9[_0x70b8('0x39')][_0x70b8('0x61')])[_0x70b8('0x2d')](function(){if(_[_0x70b8('0x64')](_0x5ba6c9[_0x70b8('0x39')][_0x70b8('0x61')])){for(var _0x5846a2=0x0;_0x5846a2<_0x5ba6c9[_0x70b8('0x39')][_0x70b8('0x61')][_0x70b8('0x3f')];_0x5846a2+=0x1){socket[_0x70b8('0x8b')](_0x70b8('0x8d'),{'UserId':Number(_0x5ba6c9[_0x70b8('0x39')][_0x70b8('0x61')][_0x5846a2]),'CmListId':Number(_0x5ba6c9[_0x70b8('0x59')]['id'])});}}else{socket[_0x70b8('0x8b')](_0x70b8('0x8d'),{'UserId':Number(_0x5ba6c9[_0x70b8('0x39')][_0x70b8('0x61')]),'CmListId':Number(_0x5ba6c9[_0x70b8('0x59')]['id'])});}});}})[_0x70b8('0x2d')](respondWithStatusCode(_0x2ecc52,null))[_0x70b8('0x4e')](handleError(_0x2ecc52,null));};exports['getAgents']=function(_0x1cce10,_0x407522,_0x19cf28){var _0xcf8c62={};var _0x5b0acb={};var _0x15d047;var _0x170f29;return db['CmList'][_0x70b8('0x5c')]({'where':{'id':_0x1cce10[_0x70b8('0x59')]['id']}})[_0x70b8('0x2d')](handleEntityNotFound(_0x407522,null))[_0x70b8('0x2d')](function(_0x18d03f){if(_0x18d03f){_0x15d047=_0x18d03f;_0x5b0acb[_0x70b8('0x38')]=_['keys'](db['User']['rawAttributes']);_0x5b0acb[_0x70b8('0x39')]=_[_0x70b8('0x3a')](_0x1cce10[_0x70b8('0x39')]);_0x5b0acb['filters']=_['intersection'](_0x5b0acb['model'],_0x5b0acb[_0x70b8('0x39')]);_0xcf8c62[_0x70b8('0x3d')]=_[_0x70b8('0x3c')](_0x5b0acb['model'],qs[_0x70b8('0x3e')](_0x1cce10[_0x70b8('0x39')][_0x70b8('0x3e')]));_0xcf8c62['attributes']=_0xcf8c62[_0x70b8('0x3d')][_0x70b8('0x3f')]?_0xcf8c62[_0x70b8('0x3d')]:_0x5b0acb[_0x70b8('0x38')];_0xcf8c62['order']=qs[_0x70b8('0x43')](_0x1cce10[_0x70b8('0x39')]['sort']);_0xcf8c62['where']=qs[_0x70b8('0x3b')](_[_0x70b8('0x45')](_0x1cce10[_0x70b8('0x39')],_0x5b0acb['filters']));if(_0x1cce10[_0x70b8('0x39')][_0x70b8('0x46')]){_0xcf8c62['where']=_[_0x70b8('0x47')](_0xcf8c62[_0x70b8('0x44')],{'$or':_[_0x70b8('0x48')](_0xcf8c62['attributes'],function(_0x40d2a1){var _0x5b2d4c={};_0x5b2d4c[_0x40d2a1]={'$like':'%'+_0x1cce10[_0x70b8('0x39')][_0x70b8('0x46')]+'%'};return _0x5b2d4c;})});}_0xcf8c62=_[_0x70b8('0x47')]({},_0xcf8c62,_0x1cce10[_0x70b8('0x4a')]);return _0x15d047[_0x70b8('0x8e')](_0xcf8c62);}})[_0x70b8('0x2d')](function(_0x51f026){if(_0x51f026){_0x170f29=_0x51f026[_0x70b8('0x3f')];if(!_0x1cce10[_0x70b8('0x39')][_0x70b8('0x40')]('nolimit')){_0xcf8c62[_0x70b8('0x23')]=qs[_0x70b8('0x23')](_0x1cce10[_0x70b8('0x39')]['limit']);_0xcf8c62['offset']=qs[_0x70b8('0x21')](_0x1cce10[_0x70b8('0x39')][_0x70b8('0x21')]);}return _0x15d047[_0x70b8('0x8e')](_0xcf8c62);}})[_0x70b8('0x2d')](function(_0x3d36b1){if(_0x3d36b1){return _0x3d36b1?{'count':_0x170f29,'rows':_0x3d36b1}:null;}})[_0x70b8('0x2d')](respondWithResult(_0x407522,null))[_0x70b8('0x4e')](handleError(_0x407522,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index abf79a9..cd646dc 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x5fc3[_0x240261];return _0x45c332;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x5470e8,_0x41ac15){_0x5470e8=_0x5470e8-0x0;var _0x4c2ee2=_0x3e74[_0x5470e8];return _0x4c2ee2;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9881825..6fc5079 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 _0x0a9a=['bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_lists','util','api','moment'];(function(_0x4ec728,_0x342eed){var _0x4c1c2c=function(_0x3b81b8){while(--_0x3b81b8){_0x4ec728['push'](_0x4ec728['shift']());}};_0x4c1c2c(++_0x342eed);}(_0x0a9a,0x183));var _0xa0a9=function(_0x4b5788,_0x3c52cb){_0x4b5788=_0x4b5788-0x0;var _0x20399c=_0x0a9a[_0x4b5788];return _0x20399c;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var logger=require('../../config/logger')(_0xa0a9('0x1'));var moment=require(_0xa0a9('0x2'));var BPromise=require(_0xa0a9('0x3'));var rp=require(_0xa0a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var attributes=require('./cmList.attributes');module[_0xa0a9('0x7')]=function(_0xc65bbb,_0x1aa717){return _0xc65bbb[_0xa0a9('0x8')]('CmList',attributes,{'tableName':_0xa0a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4eb=['./cmList.attributes','exports','define','cm_lists','lodash','bluebird','rimraf','../../config/environment'];(function(_0x32a923,_0x524c14){var _0x11677d=function(_0x3cc314){while(--_0x3cc314){_0x32a923['push'](_0x32a923['shift']());}};_0x11677d(++_0x524c14);}(_0xf4eb,0xec));var _0xbf4e=function(_0x7eff6c,_0x1e108a){_0x7eff6c=_0x7eff6c-0x0;var _0x29c8c4=_0xf4eb[_0x7eff6c];return _0x29c8c4;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('CmList',attributes,{'tableName':_0xbf4e('0x7'),'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 6b190ec..bfe4068 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 _0xc7d4=['code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2e8cc3,_0x6d3373){var _0x36098f=function(_0x5a9fc7){while(--_0x5a9fc7){_0x2e8cc3['push'](_0x2e8cc3['shift']());}};_0x36098f(++_0x6d3373);}(_0xc7d4,0x17b));var _0x4c7d=function(_0x34cd30,_0x31284f){_0x34cd30=_0x34cd30-0x0;var _0x1d7b3a=_0xc7d4[_0x34cd30];return _0x1d7b3a;};'use strict';var _=require('lodash');var util=require(_0x4c7d('0x0'));var moment=require('moment');var BPromise=require(_0x4c7d('0x1'));var rs=require(_0x4c7d('0x2'));var fs=require('fs');var Redis=require(_0x4c7d('0x3'));var db=require(_0x4c7d('0x4'))['db'];var utils=require(_0x4c7d('0x5'));var logger=require(_0x4c7d('0x6'))(_0x4c7d('0x7'));var config=require(_0x4c7d('0x8'));var jayson=require(_0x4c7d('0x9'));var client=jayson[_0x4c7d('0xa')][_0x4c7d('0xb')]({'port':0x232a});config[_0x4c7d('0xc')]=_[_0x4c7d('0xd')](config[_0x4c7d('0xc')],{'host':_0x4c7d('0xe'),'port':0x18eb});var socket=require(_0x4c7d('0xf'))(new Redis(config['redis']));require(_0x4c7d('0x10'))[_0x4c7d('0x11')](socket);function respondWithRpcPromise(_0x17ab7a,_0x334b01,_0x53d690){return new BPromise(function(_0x5f0e7e,_0x5743d1){return client[_0x4c7d('0x12')](_0x17ab7a,_0x53d690)[_0x4c7d('0x13')](function(_0x2bba75){logger[_0x4c7d('0x14')](_0x4c7d('0x15'),_0x334b01,'request\x20sent');logger[_0x4c7d('0x16')](_0x4c7d('0x17'),_0x334b01,_0x4c7d('0x18'),JSON[_0x4c7d('0x19')](_0x2bba75));if(_0x2bba75[_0x4c7d('0x1a')]){if(_0x2bba75[_0x4c7d('0x1a')][_0x4c7d('0x1b')]===0x1f4){logger[_0x4c7d('0x1a')]('CmList,\x20%s,\x20%s',_0x334b01,_0x2bba75[_0x4c7d('0x1a')]['message']);return _0x5743d1(_0x2bba75[_0x4c7d('0x1a')][_0x4c7d('0x1c')]);}logger['error'](_0x4c7d('0x15'),_0x334b01,_0x2bba75[_0x4c7d('0x1a')][_0x4c7d('0x1c')]);return _0x5f0e7e(_0x2bba75['error'][_0x4c7d('0x1c')]);}else{logger['info'](_0x4c7d('0x15'),_0x334b01,_0x4c7d('0x18'));_0x5f0e7e(_0x2bba75['result'][_0x4c7d('0x1c')]);}})['catch'](function(_0xef6298){logger['error'](_0x4c7d('0x15'),_0x334b01,_0xef6298);_0x5743d1(_0xef6298);});});} \ No newline at end of file +var _0xa7a1=['client','http','defaults','redis','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4b318c,_0x1ba507){var _0x58960b=function(_0x5eb857){while(--_0x5eb857){_0x4b318c['push'](_0x4b318c['shift']());}};_0x58960b(++_0x1ba507);}(_0xa7a1,0x10e));var _0x1a7a=function(_0x497826,_0x164921){_0x497826=_0x497826-0x0;var _0x4b3ae6=_0xa7a1[_0x497826];return _0x4b3ae6;};'use strict';var _=require(_0x1a7a('0x0'));var util=require(_0x1a7a('0x1'));var moment=require(_0x1a7a('0x2'));var BPromise=require(_0x1a7a('0x3'));var rs=require(_0x1a7a('0x4'));var fs=require('fs');var Redis=require(_0x1a7a('0x5'));var db=require(_0x1a7a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a7a('0x7'))(_0x1a7a('0x8'));var config=require(_0x1a7a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1a7a('0xa')][_0x1a7a('0xb')]({'port':0x232a});config['redis']=_[_0x1a7a('0xc')](config[_0x1a7a('0xd')],{'host':_0x1a7a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a7a('0xd')]));require(_0x1a7a('0xf'))[_0x1a7a('0x10')](socket);function respondWithRpcPromise(_0x859836,_0x23221f,_0x5cebb1){return new BPromise(function(_0x432f3f,_0x7e71b8){return client[_0x1a7a('0x11')](_0x859836,_0x5cebb1)[_0x1a7a('0x12')](function(_0x2637e4){logger[_0x1a7a('0x13')](_0x1a7a('0x14'),_0x23221f,_0x1a7a('0x15'));logger['debug'](_0x1a7a('0x16'),_0x23221f,_0x1a7a('0x15'),JSON[_0x1a7a('0x17')](_0x2637e4));if(_0x2637e4[_0x1a7a('0x18')]){if(_0x2637e4[_0x1a7a('0x18')]['code']===0x1f4){logger[_0x1a7a('0x18')](_0x1a7a('0x14'),_0x23221f,_0x2637e4[_0x1a7a('0x18')][_0x1a7a('0x19')]);return _0x7e71b8(_0x2637e4['error'][_0x1a7a('0x19')]);}logger['error'](_0x1a7a('0x14'),_0x23221f,_0x2637e4[_0x1a7a('0x18')][_0x1a7a('0x19')]);return _0x432f3f(_0x2637e4['error'][_0x1a7a('0x19')]);}else{logger[_0x1a7a('0x13')]('CmList,\x20%s,\x20%s',_0x23221f,'request\x20sent');_0x432f3f(_0x2637e4[_0x1a7a('0x1a')]['message']);}})[_0x1a7a('0x1b')](function(_0x39509f){logger[_0x1a7a('0x18')](_0x1a7a('0x14'),_0x23221f,_0x39509f);_0x7e71b8(_0x39509f);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 340a238..f56dbdd 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 _0xbe95=['save','update','emit','removeListener','register','cmList:','./cmList.events'];(function(_0x3b8139,_0x459b80){var _0x5143a4=function(_0x452ffe){while(--_0x452ffe){_0x3b8139['push'](_0x3b8139['shift']());}};_0x5143a4(++_0x459b80);}(_0xbe95,0x148));var _0x5be9=function(_0x1c1de5,_0x224060){_0x1c1de5=_0x1c1de5-0x0;var _0x411b6c=_0xbe95[_0x1c1de5];return _0x411b6c;};'use strict';var CmListEvents=require(_0x5be9('0x0'));var events=[_0x5be9('0x1'),'remove',_0x5be9('0x2')];function createListener(_0x2c3180,_0x1b10ee){return function(_0x8d4a89){_0x1b10ee[_0x5be9('0x3')](_0x2c3180,_0x8d4a89);};}function removeListener(_0x23c981,_0x1b19d1){return function(){CmListEvents[_0x5be9('0x4')](_0x23c981,_0x1b19d1);};}exports[_0x5be9('0x5')]=function(_0x16c0da){for(var _0x2f882e=0x0,_0x33d41c=events['length'];_0x2f882e<_0x33d41c;_0x2f882e++){var _0x4338ed=events[_0x2f882e];var _0x44bc91=createListener(_0x5be9('0x6')+_0x4338ed,_0x16c0da);CmListEvents['on'](_0x4338ed,_0x44bc91);}}; \ No newline at end of file +var _0x7234=['length','cmList:','./cmList.events','save','remove','update','register'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x7234,0x152));var _0x4723=function(_0x5c9207,_0x4737ef){_0x5c9207=_0x5c9207-0x0;var _0x587913=_0x7234[_0x5c9207];return _0x587913;};'use strict';var CmListEvents=require(_0x4723('0x0'));var events=[_0x4723('0x1'),_0x4723('0x2'),_0x4723('0x3')];function createListener(_0x2a1050,_0x4a5aab){return function(_0x5aaf54){_0x4a5aab['emit'](_0x2a1050,_0x5aaf54);};}function removeListener(_0x11dd5f,_0x5335cc){return function(){CmListEvents['removeListener'](_0x11dd5f,_0x5335cc);};}exports[_0x4723('0x4')]=function(_0x8b33b1){for(var _0x316bcf=0x0,_0x470609=events[_0x4723('0x5')];_0x316bcf<_0x470609;_0x316bcf++){var _0x2a7283=events[_0x316bcf];var _0x5e7beb=createListener(_0x4723('0x6')+_0x2a7283,_0x8b33b1);CmListEvents['on'](_0x2a7283,_0x5e7beb);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 49e6eab..0813da6 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 _0x49d2=['/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','put','update','delete','removeAgents','multer','util','path','connect-timeout','express','Router','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','describe','/:id','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x49d2,0xa7));var _0x249d=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0x49d2[_0x5ad220];return _0xdec77d;};'use strict';var multer=require(_0x249d('0x0'));var util=require(_0x249d('0x1'));var path=require(_0x249d('0x2'));var timeout=require(_0x249d('0x3'));var express=require(_0x249d('0x4'));var router=express[_0x249d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x249d('0x6'));var controller=require(_0x249d('0x7'));router[_0x249d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x249d('0x8')](_0x249d('0x9'),auth[_0x249d('0xa')](),controller[_0x249d('0xb')]);router[_0x249d('0x8')](_0x249d('0xc'),auth[_0x249d('0xa')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x249d('0xd')]);router['get'](_0x249d('0xe'),auth[_0x249d('0xa')](),controller[_0x249d('0xf')]);router[_0x249d('0x8')](_0x249d('0x10'),auth['isAuthenticated'](),controller[_0x249d('0x11')]);router[_0x249d('0x8')](_0x249d('0x12'),auth[_0x249d('0xa')](),controller['getCustomFields']);router[_0x249d('0x8')](_0x249d('0x13'),auth[_0x249d('0xa')](),controller[_0x249d('0x14')]);router[_0x249d('0x15')]('/',auth['isAuthenticated'](),controller[_0x249d('0x16')]);router[_0x249d('0x15')](_0x249d('0x17'),auth['isAuthenticated'](),controller[_0x249d('0x18')]);router[_0x249d('0x15')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x249d('0x19')]);router['post'](_0x249d('0x12'),auth[_0x249d('0xa')](),controller[_0x249d('0x1a')]);router[_0x249d('0x15')]('/:id/users',auth[_0x249d('0xa')](),controller['addAgents']);router[_0x249d('0x1b')](_0x249d('0xc'),auth['isAuthenticated'](),controller[_0x249d('0x1c')]);router[_0x249d('0x1d')](_0x249d('0xc'),auth[_0x249d('0xa')](),controller['destroy']);router[_0x249d('0x1d')]('/:id/dispositions',auth[_0x249d('0xa')](),controller['removeDispositions']);router['delete']('/:id/users',auth[_0x249d('0xa')](),controller[_0x249d('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xe1f3=['/:id/fields','getCustomFields','getAgents','post','create','addCustomField','/:id/users','put','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv'];(function(_0x1818cd,_0x29fbd0){var _0x5019e5=function(_0x420d68){while(--_0x420d68){_0x1818cd['push'](_0x1818cd['shift']());}};_0x5019e5(++_0x29fbd0);}(_0xe1f3,0x14d));var _0x3e1f=function(_0x216226,_0x8355bc){_0x216226=_0x216226-0x0;var _0x367ed6=_0xe1f3[_0x216226];return _0x367ed6;};'use strict';var multer=require(_0x3e1f('0x0'));var util=require(_0x3e1f('0x1'));var path=require(_0x3e1f('0x2'));var timeout=require(_0x3e1f('0x3'));var express=require(_0x3e1f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3e1f('0x5'));var interaction=require(_0x3e1f('0x6'));var config=require(_0x3e1f('0x7'));var controller=require(_0x3e1f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3e1f('0x9')](_0x3e1f('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3e1f('0xb'),auth[_0x3e1f('0xc')](),controller['show']);router[_0x3e1f('0x9')](_0x3e1f('0xd'),auth[_0x3e1f('0xc')](),controller[_0x3e1f('0xe')]);router['get'](_0x3e1f('0xf'),auth['isAuthenticated'](),controller[_0x3e1f('0x10')]);router['get'](_0x3e1f('0x11'),auth[_0x3e1f('0xc')](),controller[_0x3e1f('0x12')]);router[_0x3e1f('0x9')](_0x3e1f('0x13'),auth[_0x3e1f('0xc')](),controller[_0x3e1f('0x14')]);router[_0x3e1f('0x9')]('/:id/users',auth[_0x3e1f('0xc')](),controller[_0x3e1f('0x15')]);router[_0x3e1f('0x16')]('/',auth[_0x3e1f('0xc')](),controller[_0x3e1f('0x17')]);router['post'](_0x3e1f('0xd'),auth[_0x3e1f('0xc')](),controller['addDisposition']);router[_0x3e1f('0x16')](_0x3e1f('0xf'),auth[_0x3e1f('0xc')](),controller['addContacts']);router[_0x3e1f('0x16')](_0x3e1f('0x13'),auth['isAuthenticated'](),controller[_0x3e1f('0x18')]);router['post'](_0x3e1f('0x19'),auth[_0x3e1f('0xc')](),controller['addAgents']);router[_0x3e1f('0x1a')](_0x3e1f('0xb'),auth[_0x3e1f('0xc')](),controller[_0x3e1f('0x1b')]);router[_0x3e1f('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x3e1f('0x1d')]);router[_0x3e1f('0x1c')](_0x3e1f('0xd'),auth['isAuthenticated'](),controller[_0x3e1f('0x1e')]);router[_0x3e1f('0x1c')](_0x3e1f('0x19'),auth['isAuthenticated'](),controller[_0x3e1f('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 4a1182d..f4e4e32 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 _0x2865=['VIRTUAL','STRING','sequelize','exports'];(function(_0x30346d,_0x32375b){var _0x143fb0=function(_0x4355a6){while(--_0x4355a6){_0x30346d['push'](_0x30346d['shift']());}};_0x143fb0(++_0x32375b);}(_0x2865,0x1a6));var _0x5286=function(_0x49be61,_0x3c6c49){_0x49be61=_0x49be61-0x0;var _0x9de7b3=_0x2865[_0x49be61];return _0x9de7b3;};'use strict';var Sequelize=require(_0x5286('0x0'));module[_0x5286('0x1')]={'name':{'type':Sequelize[_0x5286('0x2')],'get':function(_0x4395f7){return this['getDataValue']('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x5286('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x5286('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x752b=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x482e4b,_0x30b54d){var _0x5a3901=function(_0x189f2f){while(--_0x189f2f){_0x482e4b['push'](_0x482e4b['shift']());}};_0x5a3901(++_0x30b54d);}(_0x752b,0x10e));var _0xb752=function(_0x56b2aa,_0x4cd678){_0x56b2aa=_0x56b2aa-0x0;var _0x21f15a=_0x752b[_0x56b2aa];return _0x21f15a;};'use strict';var Sequelize=require(_0xb752('0x0'));module[_0xb752('0x1')]={'name':{'type':Sequelize[_0xb752('0x2')],'get':function(_0x12af5a){return this[_0xb752('0x3')](_0xb752('0x4'));}},'field':{'type':Sequelize[_0xb752('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xb752('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xb752('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 8521012..cde0224 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(_0x120595,_0x14f9d3){var _0x203c56=function(_0x1621e7){while(--_0x1621e7){_0x120595['push'](_0x120595['shift']());}};_0x203c56(++_0x14f9d3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x2ea7be,_0x1f974a){var _0x36cc6d=function(_0x2fc291){while(--_0x2fc291){_0x2ea7be['push'](_0x2ea7be['shift']());}};_0x36cc6d(++_0x1f974a);}(_0x7a54,0x106));var _0x47a5=function(_0x3d4e14,_0x31f677){_0x3d4e14=_0x3d4e14-0x0;var _0x5aa4ac=_0x7a54[_0x3d4e14];return _0x5aa4ac;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 430d19a..d7e7627 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 _0xe56a=['./condition.attributes','exports','define','tools_conditions','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x35cab7,_0x2534b8){var _0x4f7e1a=function(_0x9a3451){while(--_0x9a3451){_0x35cab7['push'](_0x35cab7['shift']());}};_0x4f7e1a(++_0x2534b8);}(_0xe56a,0xe8));var _0xae56=function(_0x4714b2,_0x37328f){_0x4714b2=_0x4714b2-0x0;var _0x54bb36=_0xe56a[_0x4714b2];return _0x54bb36;};'use strict';var _=require(_0xae56('0x0'));var util=require(_0xae56('0x1'));var logger=require('../../config/logger')(_0xae56('0x2'));var moment=require(_0xae56('0x3'));var BPromise=require(_0xae56('0x4'));var rp=require(_0xae56('0x5'));var fs=require('fs');var path=require(_0xae56('0x6'));var rimraf=require('rimraf');var config=require(_0xae56('0x7'));var attributes=require(_0xae56('0x8'));module[_0xae56('0x9')]=function(_0x5363a9,_0x19e42b){return _0x5363a9[_0xae56('0xa')]('Condition',attributes,{'tableName':_0xae56('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28c3=['util','../../config/logger','moment','path','../../config/environment','./condition.attributes','define','tools_conditions'];(function(_0x39a5c3,_0x4caf2b){var _0x1d2382=function(_0x225eae){while(--_0x225eae){_0x39a5c3['push'](_0x39a5c3['shift']());}};_0x1d2382(++_0x4caf2b);}(_0x28c3,0x98));var _0x328c=function(_0x5a8efe,_0x2f8e5a){_0x5a8efe=_0x5a8efe-0x0;var _0x5be2c6=_0x28c3[_0x5a8efe];return _0x5be2c6;};'use strict';var _=require('lodash');var util=require(_0x328c('0x0'));var logger=require(_0x328c('0x1'))('api');var moment=require(_0x328c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x328c('0x3'));var rimraf=require('rimraf');var config=require(_0x328c('0x4'));var attributes=require(_0x328c('0x5'));module['exports']=function(_0x7856f8,_0x1843f2){return _0x7856f8[_0x328c('0x6')]('Condition',attributes,{'tableName':_0x328c('0x7'),'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 17e12e6..ac7a7df 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 _0x58fc=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x58fc,0xe1));var _0xc58f=function(_0x3283bd,_0x456200){_0x3283bd=_0x3283bd-0x0;var _0x510be5=_0x58fc[_0x3283bd];return _0x510be5;};'use strict';var _=require(_0xc58f('0x0'));var util=require('util');var moment=require(_0xc58f('0x1'));var BPromise=require(_0xc58f('0x2'));var rs=require(_0xc58f('0x3'));var fs=require('fs');var Redis=require(_0xc58f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc58f('0x5'));var logger=require(_0xc58f('0x6'))(_0xc58f('0x7'));var config=require(_0xc58f('0x8'));var jayson=require(_0xc58f('0x9'));var client=jayson[_0xc58f('0xa')][_0xc58f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5126ec,_0xe101fb,_0x51d7ac){return new BPromise(function(_0x57a19a,_0x54fbff){return client[_0xc58f('0xc')](_0x5126ec,_0x51d7ac)[_0xc58f('0xd')](function(_0xb15a32){logger[_0xc58f('0xe')](_0xc58f('0xf'),_0xe101fb,_0xc58f('0x10'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0xe101fb,_0xc58f('0x10'),JSON[_0xc58f('0x11')](_0xb15a32));if(_0xb15a32['error']){if(_0xb15a32[_0xc58f('0x12')][_0xc58f('0x13')]===0x1f4){logger[_0xc58f('0x12')](_0xc58f('0xf'),_0xe101fb,_0xb15a32[_0xc58f('0x12')][_0xc58f('0x14')]);return _0x54fbff(_0xb15a32[_0xc58f('0x12')][_0xc58f('0x14')]);}logger[_0xc58f('0x12')]('Condition,\x20%s,\x20%s',_0xe101fb,_0xb15a32[_0xc58f('0x12')][_0xc58f('0x14')]);return _0x57a19a(_0xb15a32[_0xc58f('0x12')]['message']);}else{logger['info'](_0xc58f('0xf'),_0xe101fb,_0xc58f('0x10'));_0x57a19a(_0xb15a32[_0xc58f('0x15')][_0xc58f('0x14')]);}})[_0xc58f('0x16')](function(_0x6f6e5e){logger['error'](_0xc58f('0xf'),_0xe101fb,_0x6f6e5e);_0x54fbff(_0x6f6e5e);});});} \ No newline at end of file +var _0xe587=['debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s'];(function(_0x1431db,_0x2160f7){var _0x5dcb4a=function(_0x1c22fd){while(--_0x1c22fd){_0x1431db['push'](_0x1431db['shift']());}};_0x5dcb4a(++_0x2160f7);}(_0xe587,0xf4));var _0x7e58=function(_0x4073cb,_0x5b09a9){_0x4073cb=_0x4073cb-0x0;var _0x59472c=_0xe587[_0x4073cb];return _0x59472c;};'use strict';var _=require('lodash');var util=require(_0x7e58('0x0'));var moment=require(_0x7e58('0x1'));var BPromise=require(_0x7e58('0x2'));var rs=require(_0x7e58('0x3'));var fs=require('fs');var Redis=require(_0x7e58('0x4'));var db=require(_0x7e58('0x5'))['db'];var utils=require(_0x7e58('0x6'));var logger=require(_0x7e58('0x7'))(_0x7e58('0x8'));var config=require(_0x7e58('0x9'));var jayson=require(_0x7e58('0xa'));var client=jayson[_0x7e58('0xb')][_0x7e58('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40795f,_0x72838e,_0x27cf45){return new BPromise(function(_0x21d438,_0x33962f){return client[_0x7e58('0xd')](_0x40795f,_0x27cf45)[_0x7e58('0xe')](function(_0x595890){logger['info'](_0x7e58('0xf'),_0x72838e,'request\x20sent');logger[_0x7e58('0x10')](_0x7e58('0x11'),_0x72838e,'request\x20sent',JSON[_0x7e58('0x12')](_0x595890));if(_0x595890[_0x7e58('0x13')]){if(_0x595890[_0x7e58('0x13')][_0x7e58('0x14')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x72838e,_0x595890[_0x7e58('0x13')][_0x7e58('0x15')]);return _0x33962f(_0x595890['error'][_0x7e58('0x15')]);}logger[_0x7e58('0x13')](_0x7e58('0xf'),_0x72838e,_0x595890[_0x7e58('0x13')][_0x7e58('0x15')]);return _0x21d438(_0x595890['error'][_0x7e58('0x15')]);}else{logger[_0x7e58('0x16')](_0x7e58('0xf'),_0x72838e,_0x7e58('0x17'));_0x21d438(_0x595890[_0x7e58('0x18')][_0x7e58('0x15')]);}})[_0x7e58('0x19')](function(_0x149080){logger[_0x7e58('0x13')]('Condition,\x20%s,\x20%s',_0x72838e,_0x149080);_0x33962f(_0x149080);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index bcaeaa4..5bfe005 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 _0x9fda=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','delete','destroy','exports','util','path'];(function(_0x1b7c3b,_0x534bd9){var _0x4c295e=function(_0x40bbfa){while(--_0x40bbfa){_0x1b7c3b['push'](_0x1b7c3b['shift']());}};_0x4c295e(++_0x534bd9);}(_0x9fda,0x10c));var _0xa9fd=function(_0x2d57b0,_0x38f00a){_0x2d57b0=_0x2d57b0-0x0;var _0xbe6c3f=_0x9fda[_0x2d57b0];return _0xbe6c3f;};'use strict';var multer=require('multer');var util=require(_0xa9fd('0x0'));var path=require(_0xa9fd('0x1'));var timeout=require(_0xa9fd('0x2'));var express=require(_0xa9fd('0x3'));var router=express[_0xa9fd('0x4')]();var fs_extra=require(_0xa9fd('0x5'));var auth=require(_0xa9fd('0x6'));var interaction=require(_0xa9fd('0x7'));var config=require(_0xa9fd('0x8'));var controller=require(_0xa9fd('0x9'));router['put'](_0xa9fd('0xa'),auth[_0xa9fd('0xb')](),controller['update']);router[_0xa9fd('0xc')]('/:id',auth[_0xa9fd('0xb')](),controller[_0xa9fd('0xd')]);module[_0xa9fd('0xe')]=router; \ No newline at end of file +var _0x453f=['connect-timeout','express','Router','./condition.controller','put','/:id','isAuthenticated','destroy','exports','multer','path'];(function(_0x28aeb2,_0x319b38){var _0x1d33e1=function(_0x651b59){while(--_0x651b59){_0x28aeb2['push'](_0x28aeb2['shift']());}};_0x1d33e1(++_0x319b38);}(_0x453f,0x18a));var _0xf453=function(_0x1a14a2,_0x29efa0){_0x1a14a2=_0x1a14a2-0x0;var _0x4ebd83=_0x453f[_0x1a14a2];return _0x4ebd83;};'use strict';var multer=require(_0xf453('0x0'));var util=require('util');var path=require(_0xf453('0x1'));var timeout=require(_0xf453('0x2'));var express=require(_0xf453('0x3'));var router=express[_0xf453('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf453('0x5'));router[_0xf453('0x6')](_0xf453('0x7'),auth[_0xf453('0x8')](),controller['update']);router['delete'](_0xf453('0x7'),auth['isAuthenticated'](),controller[_0xf453('0x9')]);module[_0xf453('0xa')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index e956426..1ccd7c2 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0xc98071,_0x10eff5){var _0x85b6ac=function(_0x24dce0){while(--_0x24dce0){_0xc98071['push'](_0xc98071['shift']());}};_0x85b6ac(++_0x10eff5);}(_0xb10b,0x12a));var _0xbb10=function(_0x3374fd,_0x59a9bc){_0x3374fd=_0x3374fd-0x0;var _0xb10792=_0xb10b[_0x3374fd];return _0xb10792;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0xc537d2,_0x565315){var _0x35aac4=function(_0x759ea4){while(--_0x759ea4){_0xc537d2['push'](_0xc537d2['shift']());}};_0x35aac4(++_0x565315);}(_0x2032,0xd9));var _0x2203=function(_0x6d504d,_0x165982){_0x6d504d=_0x6d504d-0x0;var _0xafb7a=_0x2032[_0x6d504d];return _0xafb7a;};'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/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 63ef506..e1ce18d 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 _0x703a=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','clone','createdAt','omit','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','sort','pick','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','keys','filters','query','attributes','fields','length','nolimit','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body'];(function(_0x557f5f,_0x31d8e7){var _0x196eba=function(_0x433d89){while(--_0x433d89){_0x557f5f['push'](_0x557f5f['shift']());}};_0x196eba(++_0x31d8e7);}(_0x703a,0xab));var _0xa703=function(_0x42fb9a,_0x1f0617){_0x42fb9a=_0x42fb9a-0x0;var _0x3c95d6=_0x703a[_0x42fb9a];return _0x3c95d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa703('0x0'));var zipdir=require(_0xa703('0x1'));var jsonpatch=require(_0xa703('0x2'));var rp=require(_0xa703('0x3'));var moment=require('moment');var BPromise=require(_0xa703('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa703('0x5'));var sox=require(_0xa703('0x6'));var csv=require(_0xa703('0x7'));var ejs=require(_0xa703('0x8'));var fs=require('fs');var fs_extra=require(_0xa703('0x9'));var _=require(_0xa703('0xa'));var squel=require(_0xa703('0xb'));var crypto=require(_0xa703('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa703('0xd'));var toCsv=require(_0xa703('0x7'));var querystring=require(_0xa703('0xe'));var Papa=require(_0xa703('0xf'));var Redis=require('ioredis');var authService=require(_0xa703('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa703('0x11'));var hardwareService=require(_0xa703('0x12'));var logger=require(_0xa703('0x13'))('api');var utils=require(_0xa703('0x14'));var config=require(_0xa703('0x15'));var licenseUtil=require(_0xa703('0x16'));var db=require(_0xa703('0x17'))['db'];config[_0xa703('0x18')]=_[_0xa703('0x19')](config['redis'],{'host':_0xa703('0x1a'),'port':0x18eb});var socket=require(_0xa703('0x1b'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x2a1f4b,_0x53ec07){_0x53ec07=_0x53ec07||0xcc;return function(_0x1bdd0a){if(_0x1bdd0a){return _0x2a1f4b[_0xa703('0x1c')](_0x53ec07);}return _0x2a1f4b[_0xa703('0x1d')](_0x53ec07)[_0xa703('0x1e')]();};}function respondWithResult(_0x2cec37,_0x3c19b0){_0x3c19b0=_0x3c19b0||0xc8;return function(_0xc1c77c){if(_0xc1c77c){return _0x2cec37['status'](_0x3c19b0)[_0xa703('0x1f')](_0xc1c77c);}};}function respondWithFilteredResult(_0x26f90b,_0x1c0c1f){return function(_0x5f5b05){if(_0x5f5b05){var _0x59e1db=typeof _0x1c0c1f['offset']===_0xa703('0x20')&&typeof _0x1c0c1f[_0xa703('0x21')]===_0xa703('0x20');var _0x4fb502=_0x5f5b05['count'];var _0x279d9b=_0x59e1db?0x0:_0x1c0c1f['offset'];var _0x2cf8e2=_0x59e1db?_0x5f5b05[_0xa703('0x22')]:_0x1c0c1f[_0xa703('0x23')]+_0x1c0c1f[_0xa703('0x21')];var _0x25babb;if(_0x2cf8e2>=_0x4fb502){_0x2cf8e2=_0x4fb502;_0x25babb=0xc8;}else{_0x25babb=0xce;}_0x26f90b[_0xa703('0x1d')](_0x25babb);return _0x26f90b[_0xa703('0x24')](_0xa703('0x25'),_0x279d9b+'-'+_0x2cf8e2+'/'+_0x4fb502)[_0xa703('0x1f')](_0x5f5b05);}return null;};}function patchUpdates(_0x34a9fd){return function(_0x19d424){try{jsonpatch[_0xa703('0x26')](_0x19d424,_0x34a9fd,!![]);}catch(_0x25e1d9){return BPromise[_0xa703('0x27')](_0x25e1d9);}return _0x19d424[_0xa703('0x28')]();};}function saveUpdates(_0x384eee,_0x319920){return function(_0x27ee41){if(_0x27ee41){return _0x27ee41[_0xa703('0x29')](_0x384eee)[_0xa703('0x2a')](function(_0x54e539){return _0x54e539;});}return null;};}function removeEntity(_0x76a3cc,_0x1813df){return function(_0x2200eb){if(_0x2200eb){return _0x2200eb[_0xa703('0x2b')]()[_0xa703('0x2a')](function(){var _0x247000=_0x2200eb[_0xa703('0x2c')]({'plain':!![]});var _0x237dae=_0xa703('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x237dae,'resourceId':_0x247000['id']}})['then'](function(){return _0x2200eb;});})[_0xa703('0x2a')](function(){_0x76a3cc[_0xa703('0x1d')](0xcc)[_0xa703('0x1e')]();});}};}function handleEntityNotFound(_0xf6b6c3,_0x534eb3){return function(_0xab6f1e){if(!_0xab6f1e){_0xf6b6c3[_0xa703('0x1c')](0x194);}return _0xab6f1e;};}function handleError(_0x441f01,_0x3bb94d){_0x3bb94d=_0x3bb94d||0x1f4;return function(_0x41fd17){logger[_0xa703('0x2e')](_0x41fd17[_0xa703('0x2f')]);if(_0x41fd17['name']){delete _0x41fd17[_0xa703('0x30')];}_0x441f01[_0xa703('0x1d')](_0x3bb94d)[_0xa703('0x31')](_0x41fd17);};}exports[_0xa703('0x32')]=function(_0x5e943d,_0x29f8ba){var _0x2b25ff={},_0x2b2cd2={},_0x414030={'count':0x0,'rows':[]};var _0x10ad96=_[_0xa703('0x33')](db[_0xa703('0x34')][_0xa703('0x35')],function(_0x18c6fc){return{'name':_0x18c6fc[_0xa703('0x36')],'type':_0x18c6fc['type'][_0xa703('0x37')]};});_0x2b2cd2[_0xa703('0x38')]=_['map'](_0x10ad96,_0xa703('0x30'));_0x2b2cd2['query']=_[_0xa703('0x39')](_0x5e943d['query']);_0x2b2cd2[_0xa703('0x3a')]=_['intersection'](_0x2b2cd2[_0xa703('0x38')],_0x2b2cd2[_0xa703('0x3b')]);_0x2b25ff[_0xa703('0x3c')]=_['intersection'](_0x2b2cd2['model'],qs['fields'](_0x5e943d[_0xa703('0x3b')][_0xa703('0x3d')]));_0x2b25ff[_0xa703('0x3c')]=_0x2b25ff['attributes'][_0xa703('0x3e')]?_0x2b25ff['attributes']:_0x2b2cd2[_0xa703('0x38')];if(!_0x5e943d[_0xa703('0x3b')]['hasOwnProperty'](_0xa703('0x3f'))){_0x2b25ff[_0xa703('0x21')]=qs[_0xa703('0x21')](_0x5e943d[_0xa703('0x3b')][_0xa703('0x21')]);_0x2b25ff[_0xa703('0x23')]=qs[_0xa703('0x23')](_0x5e943d['query'][_0xa703('0x23')]);}_0x2b25ff['order']=qs['sort'](_0x5e943d[_0xa703('0x3b')]['sort']);_0x2b25ff[_0xa703('0x40')]=qs[_0xa703('0x3a')](_['pick'](_0x5e943d[_0xa703('0x3b')],_0x2b2cd2[_0xa703('0x3a')]),_0x10ad96);if(_0x5e943d['query'][_0xa703('0x41')]){_0x2b25ff[_0xa703('0x40')]=_[_0xa703('0x42')](_0x2b25ff[_0xa703('0x40')],{'$or':_['map'](_0x10ad96,function(_0x4178ae){if(_0x4178ae[_0xa703('0x43')]!==_0xa703('0x44')){var _0x1bbee9={};_0x1bbee9[_0x4178ae[_0xa703('0x30')]]={'$like':'%'+_0x5e943d['query'][_0xa703('0x41')]+'%'};return _0x1bbee9;}})});}_0x2b25ff=_[_0xa703('0x42')]({},_0x2b25ff,_0x5e943d[_0xa703('0x45')]);var _0xd73ce0={'where':_0x2b25ff['where']};return db[_0xa703('0x34')][_0xa703('0x22')](_0xd73ce0)['then'](function(_0x35c42c){_0x414030[_0xa703('0x22')]=_0x35c42c;if(_0x5e943d[_0xa703('0x3b')][_0xa703('0x46')]){_0x2b25ff[_0xa703('0x47')]=[{'all':!![]}];}return db[_0xa703('0x34')][_0xa703('0x48')](_0x2b25ff);})['then'](function(_0x197e2e){_0x414030[_0xa703('0x49')]=_0x197e2e;return _0x414030;})[_0xa703('0x2a')](respondWithFilteredResult(_0x29f8ba,_0x2b25ff))[_0xa703('0x4a')](handleError(_0x29f8ba,null));};exports[_0xa703('0x4b')]=function(_0x476425,_0x23202f){var _0xce216f={'raw':![],'where':{'id':_0x476425[_0xa703('0x4c')]['id']}},_0x5e6b62={};_0x5e6b62[_0xa703('0x38')]=_[_0xa703('0x39')](db[_0xa703('0x34')][_0xa703('0x35')]);_0x5e6b62[_0xa703('0x3b')]=_[_0xa703('0x39')](_0x476425['query']);_0x5e6b62[_0xa703('0x3a')]=_['intersection'](_0x5e6b62[_0xa703('0x38')],_0x5e6b62['query']);_0xce216f[_0xa703('0x3c')]=_[_0xa703('0x4d')](_0x5e6b62['model'],qs[_0xa703('0x3d')](_0x476425[_0xa703('0x3b')][_0xa703('0x3d')]));_0xce216f[_0xa703('0x3c')]=_0xce216f[_0xa703('0x3c')][_0xa703('0x3e')]?_0xce216f[_0xa703('0x3c')]:_0x5e6b62[_0xa703('0x38')];if(_0x476425['query'][_0xa703('0x46')]){_0xce216f[_0xa703('0x47')]=[{'all':!![]}];}_0xce216f=_[_0xa703('0x42')]({},_0xce216f,_0x476425[_0xa703('0x45')]);return db[_0xa703('0x34')][_0xa703('0x4e')](_0xce216f)[_0xa703('0x2a')](handleEntityNotFound(_0x23202f,null))[_0xa703('0x2a')](respondWithResult(_0x23202f,null))['catch'](handleError(_0x23202f,null));};exports[_0xa703('0x4f')]=function(_0x146b35,_0x5bf0b8){return db[_0xa703('0x34')][_0xa703('0x4f')](_0x146b35[_0xa703('0x50')],{})[_0xa703('0x2a')](function(_0x4d27b7){var _0x563f38=_0x146b35[_0xa703('0x51')]['get']({'plain':!![]});if(!_0x563f38)throw new Error(_0xa703('0x52'));if(_0x563f38['role']==='user'){var _0x49abe9=_0x4d27b7[_0xa703('0x2c')]({'plain':!![]});var _0x259bbd='CustomDashboards';return db['UserProfileSection'][_0xa703('0x4e')]({'where':{'name':_0x259bbd,'userProfileId':_0x563f38[_0xa703('0x53')]},'raw':!![]})[_0xa703('0x2a')](function(_0x3a2d4b){if(_0x3a2d4b&&_0x3a2d4b[_0xa703('0x54')]===0x0){return db[_0xa703('0x55')][_0xa703('0x4f')]({'name':_0x49abe9['name'],'resourceId':_0x49abe9['id'],'type':_0x3a2d4b['name'],'sectionId':_0x3a2d4b['id']},{})[_0xa703('0x2a')](function(){return _0x4d27b7;});}else{return _0x4d27b7;}})[_0xa703('0x4a')](function(_0x673a4){logger[_0xa703('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x673a4);throw _0x673a4;});}return _0x4d27b7;})[_0xa703('0x2a')](respondWithResult(_0x5bf0b8,0xc9))[_0xa703('0x4a')](handleError(_0x5bf0b8,null));};exports[_0xa703('0x56')]=function(_0x53e4cf,_0x3ef1d6){var _0x20b6cd={'where':{'id':_0x53e4cf['params']['id']}},_0x313ebb={};_0x313ebb[_0xa703('0x38')]=_[_0xa703('0x39')](db[_0xa703('0x34')][_0xa703('0x35')]);_0x20b6cd[_0xa703('0x3c')]=_[_0xa703('0x4d')](_0x313ebb[_0xa703('0x38')],qs[_0xa703('0x3d')](_0x53e4cf['query']['fields']));_0x20b6cd[_0xa703('0x3c')]=_0x20b6cd['attributes']['length']?_0x20b6cd['attributes']:_0x313ebb[_0xa703('0x38')];if(_0x53e4cf[_0xa703('0x3b')][_0xa703('0x46')]){_0x20b6cd['include']=[{'all':!![]}];}_0x20b6cd=_[_0xa703('0x42')]({},_0x20b6cd,_0x53e4cf[_0xa703('0x45')]);return db[_0xa703('0x34')][_0xa703('0x4e')](_0x20b6cd)[_0xa703('0x2a')](handleEntityNotFound(_0x3ef1d6,null))['then'](function(_0x373aa9){if(_0x373aa9){var _0x536f77=_0x373aa9[_0xa703('0x2c')]({'plain':!![]});_0x536f77=qs['omit'](_0x536f77,['id',_0xa703('0x57'),'updatedAt']);_0x53e4cf[_0xa703('0x50')]=_[_0xa703('0x58')](_0x53e4cf[_0xa703('0x50')],['id',_0xa703('0x57'),_0xa703('0x59')]);return db[_0xa703('0x34')][_0xa703('0x4f')](_[_0xa703('0x42')](_0x536f77,_0x53e4cf['body']),{'include':_0x53e4cf[_0xa703('0x3b')][_0xa703('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x52e4ed){var _0x237764=_0x53e4cf[_0xa703('0x51')][_0xa703('0x2c')]({'plain':!![]});if(!_0x237764)throw new Error(_0xa703('0x52'));if(_0x237764[_0xa703('0x5a')]===_0xa703('0x51')){var _0x3a4bb5=_0x52e4ed[_0xa703('0x2c')]({'plain':!![]});var _0x2384e9=_0xa703('0x2d');return db['UserProfileSection'][_0xa703('0x4e')]({'where':{'name':_0x2384e9,'userProfileId':_0x237764[_0xa703('0x53')]},'raw':!![]})[_0xa703('0x2a')](function(_0x496384){if(_0x496384&&_0x496384[_0xa703('0x54')]===0x0){return db['UserProfileResource'][_0xa703('0x4f')]({'name':_0x3a4bb5[_0xa703('0x30')],'resourceId':_0x3a4bb5['id'],'type':_0x496384[_0xa703('0x30')],'sectionId':_0x496384['id']},{})['then'](function(){return _0x52e4ed;});}else{return _0x52e4ed;}})[_0xa703('0x4a')](function(_0x493148){logger[_0xa703('0x2e')](_0xa703('0x5b'),_0x493148);throw _0x493148;});}return _0x52e4ed;});}})[_0xa703('0x2a')](respondWithResult(_0x3ef1d6,0xc9))[_0xa703('0x4a')](handleError(_0x3ef1d6,null));};exports['update']=function(_0x38ba3c,_0x5bb8a5){if(_0x38ba3c['body']['id']){delete _0x38ba3c[_0xa703('0x50')]['id'];}return db[_0xa703('0x34')]['find']({'where':{'id':_0x38ba3c[_0xa703('0x4c')]['id']}})[_0xa703('0x2a')](handleEntityNotFound(_0x5bb8a5,null))[_0xa703('0x2a')](saveUpdates(_0x38ba3c['body'],null))[_0xa703('0x2a')](respondWithResult(_0x5bb8a5,null))[_0xa703('0x4a')](handleError(_0x5bb8a5,null));};exports['destroy']=function(_0x236a0a,_0x4f1e13){return db[_0xa703('0x34')]['find']({'where':{'id':_0x236a0a['params']['id']}})[_0xa703('0x2a')](handleEntityNotFound(_0x4f1e13,null))['then'](removeEntity(_0x4f1e13,null))['catch'](handleError(_0x4f1e13,null));};function widgetAttributes(_0x18466f){try{switch(_0x18466f[_0xa703('0x43')]){case _0xa703('0x5c'):return[{'name':'attrUrl','value':_0x18466f[_0xa703('0x5d')]||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x0]?_0x18466f[_0xa703('0x5e')][0x0]['value']:undefined)||_0xa703('0x5f')}];case _0xa703('0x60'):return[{'name':_0xa703('0x61'),'value':_0x18466f['attrPath']||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x0]?_0x18466f[_0xa703('0x5e')][0x0][_0xa703('0x62')]:undefined)||''}];case _0xa703('0x63'):return[{'name':_0xa703('0x64'),'value':_0x18466f[_0xa703('0x64')]||(_0x18466f['attrs']&&_0x18466f[_0xa703('0x5e')][0x0]?_0x18466f[_0xa703('0x5e')][0x0][_0xa703('0x62')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x18466f['attrTimezone']||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x1]?_0x18466f[_0xa703('0x5e')][0x1][_0xa703('0x62')]:undefined)||_0xa703('0x65')},{'name':_0xa703('0x66'),'value':_0x18466f[_0xa703('0x66')]||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x2]?_0x18466f['attrs'][0x2][_0xa703('0x62')]:undefined)||0xc}];case _0xa703('0x67'):return[{'name':_0xa703('0x68'),'value':_0x18466f['attrMetric']||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x0]?_0x18466f['attrs'][0x0][_0xa703('0x62')]:undefined)||_0xa703('0x69')},{'name':'attrVoiceQueues','value':_0x18466f[_0xa703('0x6a')]||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x1]?_0x18466f[_0xa703('0x5e')][0x1]['value']:undefined)||[]},{'name':_0xa703('0x66'),'value':_0x18466f[_0xa703('0x66')]||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x2]?_0x18466f['attrs'][0x2][_0xa703('0x62')]:undefined)||0x14}];case _0xa703('0x6b'):case _0xa703('0x6c'):return[{'name':_0xa703('0x6d'),'value':_0x18466f[_0xa703('0x6d')]||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x0]?_0x18466f[_0xa703('0x5e')][0x0][_0xa703('0x62')]:undefined)||_0xa703('0x69')},{'name':'attrSerie2','value':_0x18466f[_0xa703('0x6e')]||(_0x18466f['attrs']&&_0x18466f[_0xa703('0x5e')][0x1]?_0x18466f[_0xa703('0x5e')][0x1][_0xa703('0x62')]:undefined)||null},{'name':'attrSerie3','value':_0x18466f[_0xa703('0x6f')]||(_0x18466f[_0xa703('0x5e')]&&_0x18466f['attrs'][0x2]?_0x18466f[_0xa703('0x5e')][0x2][_0xa703('0x62')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x18466f[_0xa703('0x6a')]||(_0x18466f['attrs']&&_0x18466f[_0xa703('0x5e')][0x3]?_0x18466f[_0xa703('0x5e')][0x3][_0xa703('0x62')]:undefined)||[]}];case _0xa703('0x70'):return[{'name':_0xa703('0x71'),'type':_0x18466f[_0xa703('0x72')]||(_0x18466f[_0xa703('0x5e')]&&_0x18466f[_0xa703('0x5e')][0x0]?_0x18466f[_0xa703('0x5e')][0x0]['type']:undefined)||null,'value':_0x18466f[_0xa703('0x71')]||(_0x18466f[_0xa703('0x5e')]&&_0x18466f['attrs'][0x0]?_0x18466f['attrs'][0x0][_0xa703('0x62')]:undefined)||null},{'name':_0xa703('0x73'),'value':_0x18466f[_0xa703('0x73')]||(_0x18466f['attrs']&&_0x18466f[_0xa703('0x5e')][0x1]?_0x18466f['attrs'][0x1][_0xa703('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x50bfdf){logger['error']('widgetAttributes:\x20%s',JSON[_0xa703('0x74')](_0x50bfdf));return[];}}exports[_0xa703('0x75')]=function(_0x5f4d5b,_0x3389f7,_0x4b93bf){if(_0x5f4d5b[_0xa703('0x50')]['id']){delete _0x5f4d5b[_0xa703('0x50')]['id'];}return db[_0xa703('0x34')]['find']({'where':{'id':_0x5f4d5b[_0xa703('0x4c')]['id']}})[_0xa703('0x2a')](handleEntityNotFound(_0x3389f7,null))['then'](function(_0x47d6cd){if(_0x47d6cd){_0x5f4d5b[_0xa703('0x50')][_0xa703('0x76')]=_0x47d6cd['id'];_0x5f4d5b[_0xa703('0x50')][_0xa703('0x5e')]=widgetAttributes(_0x5f4d5b[_0xa703('0x50')]);return db[_0xa703('0x77')]['create'](_0x5f4d5b[_0xa703('0x50')]);}})['then'](respondWithResult(_0x3389f7,null))[_0xa703('0x4a')](handleError(_0x3389f7,null));};exports[_0xa703('0x78')]=function(_0x194be5,_0x2a9095,_0x427818){var _0x680507={};var _0x1e4de5={};var _0x579bea;var _0x2d2964;return db[_0xa703('0x34')][_0xa703('0x79')]({'where':{'id':_0x194be5[_0xa703('0x4c')]['id']}})[_0xa703('0x2a')](handleEntityNotFound(_0x2a9095,null))[_0xa703('0x2a')](function(_0x2d1756){if(_0x2d1756){_0x579bea=_0x2d1756;_0x1e4de5[_0xa703('0x38')]=_[_0xa703('0x39')](db[_0xa703('0x77')][_0xa703('0x35')]);_0x1e4de5[_0xa703('0x3b')]=_[_0xa703('0x39')](_0x194be5[_0xa703('0x3b')]);_0x1e4de5['filters']=_[_0xa703('0x4d')](_0x1e4de5[_0xa703('0x38')],_0x1e4de5[_0xa703('0x3b')]);_0x680507['attributes']=_[_0xa703('0x4d')](_0x1e4de5[_0xa703('0x38')],qs[_0xa703('0x3d')](_0x194be5['query'][_0xa703('0x3d')]));_0x680507['attributes']=_0x680507[_0xa703('0x3c')][_0xa703('0x3e')]?_0x680507['attributes']:_0x1e4de5['model'];_0x680507[_0xa703('0x7a')]=qs[_0xa703('0x7b')](_0x194be5[_0xa703('0x3b')]['sort']);_0x680507['where']=qs[_0xa703('0x3a')](_[_0xa703('0x7c')](_0x194be5[_0xa703('0x3b')],_0x1e4de5[_0xa703('0x3a')]));if(_0x194be5[_0xa703('0x3b')][_0xa703('0x41')]){_0x680507[_0xa703('0x40')]=_[_0xa703('0x42')](_0x680507['where'],{'$or':_['map'](_0x680507[_0xa703('0x3c')],function(_0x438d85){var _0x18ed28={};_0x18ed28[_0x438d85]={'$like':'%'+_0x194be5[_0xa703('0x3b')][_0xa703('0x41')]+'%'};return _0x18ed28;})});}_0x680507=_['merge']({},_0x680507,_0x194be5['options']);return _0x579bea[_0xa703('0x78')](_0x680507);}})[_0xa703('0x2a')](function(_0x5b356e){if(_0x5b356e){_0x2d2964=_0x5b356e[_0xa703('0x3e')];if(!_0x194be5[_0xa703('0x3b')][_0xa703('0x7d')]('nolimit')){_0x680507[_0xa703('0x21')]=qs[_0xa703('0x21')](_0x194be5[_0xa703('0x3b')][_0xa703('0x21')]);_0x680507['offset']=qs[_0xa703('0x23')](_0x194be5[_0xa703('0x3b')][_0xa703('0x23')]);}return _0x579bea['getItems'](_0x680507);}})['then'](function(_0x486865){if(_0x486865){return _0x486865?{'count':_0x2d2964,'rows':_0x486865}:null;}})[_0xa703('0x2a')](respondWithResult(_0x2a9095,null))[_0xa703('0x4a')](handleError(_0x2a9095,null));}; \ No newline at end of file +var _0xe071=['../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','CustomDashboards','end','stack','name','send','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','params','createdAt','updatedAt','omit','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','sort','hasOwnProperty','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0xe071,0x14e));var _0x1e07=function(_0xd553ab,_0x788918){_0xd553ab=_0xd553ab-0x0;var _0x215442=_0xe071[_0xd553ab];return _0x215442;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1e07('0x0'));var jsonpatch=require(_0x1e07('0x1'));var rp=require(_0x1e07('0x2'));var moment=require(_0x1e07('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1e07('0x4'));var ejs=require(_0x1e07('0x5'));var fs=require('fs');var fs_extra=require(_0x1e07('0x6'));var _=require(_0x1e07('0x7'));var squel=require('squel');var crypto=require(_0x1e07('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x1e07('0x9'));var toCsv=require(_0x1e07('0x4'));var querystring=require(_0x1e07('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1e07('0xb'));var qs=require(_0x1e07('0xc'));var as=require(_0x1e07('0xd'));var hardwareService=require(_0x1e07('0xe'));var logger=require('../../config/logger')(_0x1e07('0xf'));var utils=require(_0x1e07('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x1e07('0x11'));var db=require(_0x1e07('0x12'))['db'];config[_0x1e07('0x13')]=_['defaults'](config[_0x1e07('0x13')],{'host':_0x1e07('0x14'),'port':0x18eb});var socket=require(_0x1e07('0x15'))(new Redis(config[_0x1e07('0x13')]));require(_0x1e07('0x16'))[_0x1e07('0x17')](socket);function respondWithStatusCode(_0x739fb4,_0x55ba08){_0x55ba08=_0x55ba08||0xcc;return function(_0x358c08){if(_0x358c08){return _0x739fb4[_0x1e07('0x18')](_0x55ba08);}return _0x739fb4['status'](_0x55ba08)['end']();};}function respondWithResult(_0x67002d,_0x43baa1){_0x43baa1=_0x43baa1||0xc8;return function(_0x1868d7){if(_0x1868d7){return _0x67002d[_0x1e07('0x19')](_0x43baa1)[_0x1e07('0x1a')](_0x1868d7);}};}function respondWithFilteredResult(_0x26ff9a,_0x11b76a){return function(_0x494477){if(_0x494477){var _0x5cf43c=typeof _0x11b76a[_0x1e07('0x1b')]===_0x1e07('0x1c')&&typeof _0x11b76a[_0x1e07('0x1d')]===_0x1e07('0x1c');var _0x35535d=_0x494477[_0x1e07('0x1e')];var _0x15fb2c=_0x5cf43c?0x0:_0x11b76a[_0x1e07('0x1b')];var _0x33fafe=_0x5cf43c?_0x494477[_0x1e07('0x1e')]:_0x11b76a['offset']+_0x11b76a[_0x1e07('0x1d')];var _0x7e3e68;if(_0x33fafe>=_0x35535d){_0x33fafe=_0x35535d;_0x7e3e68=0xc8;}else{_0x7e3e68=0xce;}_0x26ff9a['status'](_0x7e3e68);return _0x26ff9a[_0x1e07('0x1f')](_0x1e07('0x20'),_0x15fb2c+'-'+_0x33fafe+'/'+_0x35535d)[_0x1e07('0x1a')](_0x494477);}return null;};}function patchUpdates(_0x1414ff){return function(_0x46cb82){try{jsonpatch[_0x1e07('0x21')](_0x46cb82,_0x1414ff,!![]);}catch(_0x1a85e5){return BPromise['reject'](_0x1a85e5);}return _0x46cb82[_0x1e07('0x22')]();};}function saveUpdates(_0x56877b,_0x1c5665){return function(_0x14503a){if(_0x14503a){return _0x14503a[_0x1e07('0x23')](_0x56877b)[_0x1e07('0x24')](function(_0x140bb0){return _0x140bb0;});}return null;};}function removeEntity(_0x107ab2,_0x4073bc){return function(_0x5f1a2c){if(_0x5f1a2c){return _0x5f1a2c[_0x1e07('0x25')]()[_0x1e07('0x24')](function(){var _0x4541f4=_0x5f1a2c['get']({'plain':!![]});var _0xaabead=_0x1e07('0x26');return db['UserProfileResource'][_0x1e07('0x25')]({'where':{'type':_0xaabead,'resourceId':_0x4541f4['id']}})['then'](function(){return _0x5f1a2c;});})[_0x1e07('0x24')](function(){_0x107ab2['status'](0xcc)[_0x1e07('0x27')]();});}};}function handleEntityNotFound(_0x315286,_0x65f990){return function(_0x4b7735){if(!_0x4b7735){_0x315286[_0x1e07('0x18')](0x194);}return _0x4b7735;};}function handleError(_0x54f01f,_0x2cdf9f){_0x2cdf9f=_0x2cdf9f||0x1f4;return function(_0x55f08a){logger['error'](_0x55f08a[_0x1e07('0x28')]);if(_0x55f08a[_0x1e07('0x29')]){delete _0x55f08a[_0x1e07('0x29')];}_0x54f01f[_0x1e07('0x19')](_0x2cdf9f)[_0x1e07('0x2a')](_0x55f08a);};}exports['index']=function(_0x975a15,_0x92fca2){var _0x244551={},_0x276e09={},_0x1e7bce={'count':0x0,'rows':[]};var _0x475067=_[_0x1e07('0x2b')](db[_0x1e07('0x2c')][_0x1e07('0x2d')],function(_0x55d69c){return{'name':_0x55d69c[_0x1e07('0x2e')],'type':_0x55d69c[_0x1e07('0x2f')][_0x1e07('0x30')]};});_0x276e09[_0x1e07('0x31')]=_[_0x1e07('0x2b')](_0x475067,_0x1e07('0x29'));_0x276e09[_0x1e07('0x32')]=_[_0x1e07('0x33')](_0x975a15[_0x1e07('0x32')]);_0x276e09[_0x1e07('0x34')]=_['intersection'](_0x276e09[_0x1e07('0x31')],_0x276e09[_0x1e07('0x32')]);_0x244551['attributes']=_[_0x1e07('0x35')](_0x276e09[_0x1e07('0x31')],qs[_0x1e07('0x36')](_0x975a15[_0x1e07('0x32')][_0x1e07('0x36')]));_0x244551[_0x1e07('0x37')]=_0x244551[_0x1e07('0x37')]['length']?_0x244551[_0x1e07('0x37')]:_0x276e09[_0x1e07('0x31')];if(!_0x975a15[_0x1e07('0x32')]['hasOwnProperty'](_0x1e07('0x38'))){_0x244551[_0x1e07('0x1d')]=qs[_0x1e07('0x1d')](_0x975a15[_0x1e07('0x32')][_0x1e07('0x1d')]);_0x244551['offset']=qs[_0x1e07('0x1b')](_0x975a15['query'][_0x1e07('0x1b')]);}_0x244551[_0x1e07('0x39')]=qs['sort'](_0x975a15[_0x1e07('0x32')]['sort']);_0x244551[_0x1e07('0x3a')]=qs[_0x1e07('0x34')](_['pick'](_0x975a15[_0x1e07('0x32')],_0x276e09[_0x1e07('0x34')]),_0x475067);if(_0x975a15[_0x1e07('0x32')][_0x1e07('0x3b')]){_0x244551[_0x1e07('0x3a')]=_[_0x1e07('0x3c')](_0x244551[_0x1e07('0x3a')],{'$or':_[_0x1e07('0x2b')](_0x475067,function(_0x534073){if(_0x534073[_0x1e07('0x2f')]!==_0x1e07('0x3d')){var _0x42d27c={};_0x42d27c[_0x534073['name']]={'$like':'%'+_0x975a15['query'][_0x1e07('0x3b')]+'%'};return _0x42d27c;}})});}_0x244551=_['merge']({},_0x244551,_0x975a15[_0x1e07('0x3e')]);var _0x35a2f0={'where':_0x244551['where']};return db[_0x1e07('0x2c')]['count'](_0x35a2f0)[_0x1e07('0x24')](function(_0x5e9880){_0x1e7bce[_0x1e07('0x1e')]=_0x5e9880;if(_0x975a15['query'][_0x1e07('0x3f')]){_0x244551[_0x1e07('0x40')]=[{'all':!![]}];}return db[_0x1e07('0x2c')][_0x1e07('0x41')](_0x244551);})['then'](function(_0x1d65c8){_0x1e7bce[_0x1e07('0x42')]=_0x1d65c8;return _0x1e7bce;})[_0x1e07('0x24')](respondWithFilteredResult(_0x92fca2,_0x244551))[_0x1e07('0x43')](handleError(_0x92fca2,null));};exports[_0x1e07('0x44')]=function(_0x1abcc2,_0x5e0df6){var _0x1cbb56={'raw':![],'where':{'id':_0x1abcc2['params']['id']}},_0x84e982={};_0x84e982[_0x1e07('0x31')]=_[_0x1e07('0x33')](db[_0x1e07('0x2c')][_0x1e07('0x2d')]);_0x84e982[_0x1e07('0x32')]=_['keys'](_0x1abcc2[_0x1e07('0x32')]);_0x84e982[_0x1e07('0x34')]=_[_0x1e07('0x35')](_0x84e982[_0x1e07('0x31')],_0x84e982['query']);_0x1cbb56[_0x1e07('0x37')]=_[_0x1e07('0x35')](_0x84e982[_0x1e07('0x31')],qs['fields'](_0x1abcc2[_0x1e07('0x32')][_0x1e07('0x36')]));_0x1cbb56[_0x1e07('0x37')]=_0x1cbb56[_0x1e07('0x37')][_0x1e07('0x45')]?_0x1cbb56[_0x1e07('0x37')]:_0x84e982[_0x1e07('0x31')];if(_0x1abcc2[_0x1e07('0x32')]['includeAll']){_0x1cbb56['include']=[{'all':!![]}];}_0x1cbb56=_[_0x1e07('0x3c')]({},_0x1cbb56,_0x1abcc2[_0x1e07('0x3e')]);return db['Dashboard'][_0x1e07('0x46')](_0x1cbb56)[_0x1e07('0x24')](handleEntityNotFound(_0x5e0df6,null))['then'](respondWithResult(_0x5e0df6,null))[_0x1e07('0x43')](handleError(_0x5e0df6,null));};exports[_0x1e07('0x47')]=function(_0x4afff4,_0x4da612){return db[_0x1e07('0x2c')][_0x1e07('0x47')](_0x4afff4[_0x1e07('0x48')],{})[_0x1e07('0x24')](function(_0x1d3d48){var _0x519d57=_0x4afff4['user'][_0x1e07('0x49')]({'plain':!![]});if(!_0x519d57)throw new Error(_0x1e07('0x4a'));if(_0x519d57['role']===_0x1e07('0x4b')){var _0x5b7c91=_0x1d3d48[_0x1e07('0x49')]({'plain':!![]});var _0x165c81=_0x1e07('0x26');return db[_0x1e07('0x4c')][_0x1e07('0x46')]({'where':{'name':_0x165c81,'userProfileId':_0x519d57[_0x1e07('0x4d')]},'raw':!![]})[_0x1e07('0x24')](function(_0x4e34f0){if(_0x4e34f0&&_0x4e34f0[_0x1e07('0x4e')]===0x0){return db[_0x1e07('0x4f')]['create']({'name':_0x5b7c91[_0x1e07('0x29')],'resourceId':_0x5b7c91['id'],'type':_0x4e34f0[_0x1e07('0x29')],'sectionId':_0x4e34f0['id']},{})[_0x1e07('0x24')](function(){return _0x1d3d48;});}else{return _0x1d3d48;}})[_0x1e07('0x43')](function(_0x3c65e6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c65e6);throw _0x3c65e6;});}return _0x1d3d48;})[_0x1e07('0x24')](respondWithResult(_0x4da612,0xc9))[_0x1e07('0x43')](handleError(_0x4da612,null));};exports[_0x1e07('0x50')]=function(_0x251ed8,_0x125497){var _0x71b225={'where':{'id':_0x251ed8[_0x1e07('0x51')]['id']}},_0x11f394={};_0x11f394[_0x1e07('0x31')]=_['keys'](db['Dashboard'][_0x1e07('0x2d')]);_0x71b225['attributes']=_[_0x1e07('0x35')](_0x11f394[_0x1e07('0x31')],qs[_0x1e07('0x36')](_0x251ed8[_0x1e07('0x32')][_0x1e07('0x36')]));_0x71b225[_0x1e07('0x37')]=_0x71b225[_0x1e07('0x37')][_0x1e07('0x45')]?_0x71b225[_0x1e07('0x37')]:_0x11f394[_0x1e07('0x31')];if(_0x251ed8[_0x1e07('0x32')][_0x1e07('0x3f')]){_0x71b225[_0x1e07('0x40')]=[{'all':!![]}];}_0x71b225=_[_0x1e07('0x3c')]({},_0x71b225,_0x251ed8[_0x1e07('0x3e')]);return db[_0x1e07('0x2c')][_0x1e07('0x46')](_0x71b225)[_0x1e07('0x24')](handleEntityNotFound(_0x125497,null))['then'](function(_0x44f594){if(_0x44f594){var _0x43353f=_0x44f594[_0x1e07('0x49')]({'plain':!![]});_0x43353f=qs['omit'](_0x43353f,['id',_0x1e07('0x52'),_0x1e07('0x53')]);_0x251ed8['body']=_[_0x1e07('0x54')](_0x251ed8[_0x1e07('0x48')],['id',_0x1e07('0x52'),'updatedAt']);return db[_0x1e07('0x2c')][_0x1e07('0x47')](_['merge'](_0x43353f,_0x251ed8[_0x1e07('0x48')]),{'include':_0x251ed8['query'][_0x1e07('0x3f')]?[{'all':!![]}]:undefined})[_0x1e07('0x24')](function(_0x1671a2){var _0x4e43b4=_0x251ed8[_0x1e07('0x4b')][_0x1e07('0x49')]({'plain':!![]});if(!_0x4e43b4)throw new Error(_0x1e07('0x4a'));if(_0x4e43b4['role']===_0x1e07('0x4b')){var _0x11efca=_0x1671a2[_0x1e07('0x49')]({'plain':!![]});var _0x10e53c=_0x1e07('0x26');return db[_0x1e07('0x4c')][_0x1e07('0x46')]({'where':{'name':_0x10e53c,'userProfileId':_0x4e43b4[_0x1e07('0x4d')]},'raw':!![]})['then'](function(_0x2c93e0){if(_0x2c93e0&&_0x2c93e0['autoAssociation']===0x0){return db[_0x1e07('0x4f')][_0x1e07('0x47')]({'name':_0x11efca[_0x1e07('0x29')],'resourceId':_0x11efca['id'],'type':_0x2c93e0[_0x1e07('0x29')],'sectionId':_0x2c93e0['id']},{})[_0x1e07('0x24')](function(){return _0x1671a2;});}else{return _0x1671a2;}})[_0x1e07('0x43')](function(_0x12e5ed){logger[_0x1e07('0x55')](_0x1e07('0x56'),_0x12e5ed);throw _0x12e5ed;});}return _0x1671a2;});}})[_0x1e07('0x24')](respondWithResult(_0x125497,0xc9))[_0x1e07('0x43')](handleError(_0x125497,null));};exports[_0x1e07('0x23')]=function(_0x33ffe2,_0x5010fd){if(_0x33ffe2[_0x1e07('0x48')]['id']){delete _0x33ffe2[_0x1e07('0x48')]['id'];}return db[_0x1e07('0x2c')][_0x1e07('0x46')]({'where':{'id':_0x33ffe2[_0x1e07('0x51')]['id']}})[_0x1e07('0x24')](handleEntityNotFound(_0x5010fd,null))[_0x1e07('0x24')](saveUpdates(_0x33ffe2['body'],null))[_0x1e07('0x24')](respondWithResult(_0x5010fd,null))[_0x1e07('0x43')](handleError(_0x5010fd,null));};exports['destroy']=function(_0x3ecaab,_0x32b2a2){return db['Dashboard'][_0x1e07('0x46')]({'where':{'id':_0x3ecaab[_0x1e07('0x51')]['id']}})[_0x1e07('0x24')](handleEntityNotFound(_0x32b2a2,null))[_0x1e07('0x24')](removeEntity(_0x32b2a2,null))[_0x1e07('0x43')](handleError(_0x32b2a2,null));};function widgetAttributes(_0x5540cd){try{switch(_0x5540cd['type']){case _0x1e07('0x57'):return[{'name':_0x1e07('0x58'),'value':_0x5540cd[_0x1e07('0x58')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x0]?_0x5540cd[_0x1e07('0x59')][0x0][_0x1e07('0x5a')]:undefined)||'https://'}];case _0x1e07('0x5b'):return[{'name':_0x1e07('0x5c'),'value':_0x5540cd['attrPath']||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd['attrs'][0x0]?_0x5540cd[_0x1e07('0x59')][0x0]['value']:undefined)||''}];case _0x1e07('0x5d'):return[{'name':_0x1e07('0x5e'),'value':_0x5540cd[_0x1e07('0x5e')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x0]?_0x5540cd[_0x1e07('0x59')][0x0][_0x1e07('0x5a')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x5540cd[_0x1e07('0x5f')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x1]?_0x5540cd['attrs'][0x1][_0x1e07('0x5a')]:undefined)||_0x1e07('0x60')},{'name':_0x1e07('0x61'),'value':_0x5540cd[_0x1e07('0x61')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x2]?_0x5540cd[_0x1e07('0x59')][0x2][_0x1e07('0x5a')]:undefined)||0xc}];case _0x1e07('0x62'):return[{'name':_0x1e07('0x63'),'value':_0x5540cd[_0x1e07('0x63')]||(_0x5540cd['attrs']&&_0x5540cd[_0x1e07('0x59')][0x0]?_0x5540cd[_0x1e07('0x59')][0x0][_0x1e07('0x5a')]:undefined)||_0x1e07('0x64')},{'name':'attrVoiceQueues','value':_0x5540cd[_0x1e07('0x65')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x1]?_0x5540cd['attrs'][0x1][_0x1e07('0x5a')]:undefined)||[]},{'name':_0x1e07('0x61'),'value':_0x5540cd[_0x1e07('0x61')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x2]?_0x5540cd[_0x1e07('0x59')][0x2][_0x1e07('0x5a')]:undefined)||0x14}];case _0x1e07('0x66'):case _0x1e07('0x67'):return[{'name':'attrSerie1','value':_0x5540cd[_0x1e07('0x68')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x0]?_0x5540cd[_0x1e07('0x59')][0x0][_0x1e07('0x5a')]:undefined)||'total'},{'name':_0x1e07('0x69'),'value':_0x5540cd[_0x1e07('0x69')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x1]?_0x5540cd['attrs'][0x1][_0x1e07('0x5a')]:undefined)||null},{'name':_0x1e07('0x6a'),'value':_0x5540cd[_0x1e07('0x6a')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x2]?_0x5540cd[_0x1e07('0x59')][0x2][_0x1e07('0x5a')]:undefined)||null},{'name':_0x1e07('0x65'),'value':_0x5540cd['attrVoiceQueues']||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x3]?_0x5540cd[_0x1e07('0x59')][0x3][_0x1e07('0x5a')]:undefined)||[]}];case _0x1e07('0x6b'):return[{'name':_0x1e07('0x6c'),'type':_0x5540cd[_0x1e07('0x6d')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x0]?_0x5540cd[_0x1e07('0x59')][0x0]['type']:undefined)||null,'value':_0x5540cd['attrReport']||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x0]?_0x5540cd[_0x1e07('0x59')][0x0][_0x1e07('0x5a')]:undefined)||null},{'name':'attrRefresh','value':_0x5540cd[_0x1e07('0x6e')]||(_0x5540cd[_0x1e07('0x59')]&&_0x5540cd[_0x1e07('0x59')][0x1]?_0x5540cd[_0x1e07('0x59')][0x1][_0x1e07('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x42d268){logger['error'](_0x1e07('0x6f'),JSON['stringify'](_0x42d268));return[];}}exports[_0x1e07('0x70')]=function(_0xf8b220,_0x72399,_0xb9ce05){if(_0xf8b220['body']['id']){delete _0xf8b220[_0x1e07('0x48')]['id'];}return db[_0x1e07('0x2c')]['find']({'where':{'id':_0xf8b220[_0x1e07('0x51')]['id']}})[_0x1e07('0x24')](handleEntityNotFound(_0x72399,null))['then'](function(_0x39a124){if(_0x39a124){_0xf8b220[_0x1e07('0x48')]['DashboardId']=_0x39a124['id'];_0xf8b220['body'][_0x1e07('0x59')]=widgetAttributes(_0xf8b220[_0x1e07('0x48')]);return db[_0x1e07('0x71')]['create'](_0xf8b220['body']);}})[_0x1e07('0x24')](respondWithResult(_0x72399,null))['catch'](handleError(_0x72399,null));};exports[_0x1e07('0x72')]=function(_0x16b402,_0x3b4b36,_0x460e3d){var _0x2668d0={};var _0x502a60={};var _0x32c4c0;var _0x1bee13;return db[_0x1e07('0x2c')]['findOne']({'where':{'id':_0x16b402[_0x1e07('0x51')]['id']}})[_0x1e07('0x24')](handleEntityNotFound(_0x3b4b36,null))['then'](function(_0x2d214f){if(_0x2d214f){_0x32c4c0=_0x2d214f;_0x502a60[_0x1e07('0x31')]=_[_0x1e07('0x33')](db[_0x1e07('0x71')][_0x1e07('0x2d')]);_0x502a60[_0x1e07('0x32')]=_[_0x1e07('0x33')](_0x16b402[_0x1e07('0x32')]);_0x502a60[_0x1e07('0x34')]=_[_0x1e07('0x35')](_0x502a60[_0x1e07('0x31')],_0x502a60['query']);_0x2668d0[_0x1e07('0x37')]=_[_0x1e07('0x35')](_0x502a60['model'],qs[_0x1e07('0x36')](_0x16b402['query']['fields']));_0x2668d0[_0x1e07('0x37')]=_0x2668d0[_0x1e07('0x37')][_0x1e07('0x45')]?_0x2668d0[_0x1e07('0x37')]:_0x502a60[_0x1e07('0x31')];_0x2668d0['order']=qs[_0x1e07('0x73')](_0x16b402['query']['sort']);_0x2668d0[_0x1e07('0x3a')]=qs[_0x1e07('0x34')](_['pick'](_0x16b402[_0x1e07('0x32')],_0x502a60[_0x1e07('0x34')]));if(_0x16b402[_0x1e07('0x32')][_0x1e07('0x3b')]){_0x2668d0[_0x1e07('0x3a')]=_[_0x1e07('0x3c')](_0x2668d0['where'],{'$or':_[_0x1e07('0x2b')](_0x2668d0[_0x1e07('0x37')],function(_0x5366b8){var _0x4eed7f={};_0x4eed7f[_0x5366b8]={'$like':'%'+_0x16b402[_0x1e07('0x32')]['filter']+'%'};return _0x4eed7f;})});}_0x2668d0=_['merge']({},_0x2668d0,_0x16b402['options']);return _0x32c4c0['getItems'](_0x2668d0);}})['then'](function(_0x307cdc){if(_0x307cdc){_0x1bee13=_0x307cdc[_0x1e07('0x45')];if(!_0x16b402[_0x1e07('0x32')][_0x1e07('0x74')](_0x1e07('0x38'))){_0x2668d0['limit']=qs['limit'](_0x16b402['query'][_0x1e07('0x1d')]);_0x2668d0[_0x1e07('0x1b')]=qs['offset'](_0x16b402[_0x1e07('0x32')]['offset']);}return _0x32c4c0[_0x1e07('0x72')](_0x2668d0);}})[_0x1e07('0x24')](function(_0x107d1e){if(_0x107d1e){return _0x107d1e?{'count':_0x1bee13,'rows':_0x107d1e}:null;}})[_0x1e07('0x24')](respondWithResult(_0x3b4b36,null))[_0x1e07('0x43')](handleError(_0x3b4b36,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c317d90..8779e7c 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 _0x867e=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','save','remove','emit'];(function(_0x51dada,_0x4ddb59){var _0x209d74=function(_0x2e1892){while(--_0x2e1892){_0x51dada['push'](_0x51dada['shift']());}};_0x209d74(++_0x4ddb59);}(_0x867e,0x1c5));var _0xe867=function(_0x212a38,_0x2cb82d){_0x212a38=_0x212a38-0x0;var _0x3fa849=_0x867e[_0x212a38];return _0x3fa849;};'use strict';var EventEmitter=require(_0xe867('0x0'));var Dashboard=require(_0xe867('0x1'))['db'][_0xe867('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe867('0x3'),'afterUpdate':'update','afterDestroy':_0xe867('0x4')};function emitEvent(_0x497e4c){return function(_0x461c37,_0xa59225,_0x36a967){DashboardEvents[_0xe867('0x5')](_0x497e4c+':'+_0x461c37['id'],_0x461c37);DashboardEvents[_0xe867('0x5')](_0x497e4c,_0x461c37);_0x36a967(null);};}for(var e in events){if(events[_0xe867('0x6')](e)){var event=events[e];Dashboard[_0xe867('0x7')](e,emitEvent(event));}}module[_0xe867('0x8')]=DashboardEvents; \ No newline at end of file +var _0x79dd=['hasOwnProperty','exports','events','../../mysqldb','Dashboard','setMaxListeners','update','remove','emit'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x79dd,0x1f1));var _0xd79d=function(_0x444e8b,_0x3524cc){_0x444e8b=_0x444e8b-0x0;var _0x35eb37=_0x79dd[_0x444e8b];return _0x35eb37;};'use strict';var EventEmitter=require(_0xd79d('0x0'));var Dashboard=require(_0xd79d('0x1'))['db'][_0xd79d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd79d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd79d('0x4'),'afterDestroy':_0xd79d('0x5')};function emitEvent(_0x2b435f){return function(_0x3dcf5d,_0x14559d,_0x45f5d5){DashboardEvents[_0xd79d('0x6')](_0x2b435f+':'+_0x3dcf5d['id'],_0x3dcf5d);DashboardEvents[_0xd79d('0x6')](_0x2b435f,_0x3dcf5d);_0x45f5d5(null);};}for(var e in events){if(events[_0xd79d('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xd79d('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 4ab18c8..a836181 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 _0xc625=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','lodash'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0xc625,0xef));var _0x5c62=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0xc625[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0x5c62('0x0'));var util=require(_0x5c62('0x1'));var logger=require(_0x5c62('0x2'))(_0x5c62('0x3'));var moment=require('moment');var BPromise=require(_0x5c62('0x4'));var rp=require(_0x5c62('0x5'));var fs=require('fs');var path=require(_0x5c62('0x6'));var rimraf=require('rimraf');var config=require(_0x5c62('0x7'));var attributes=require(_0x5c62('0x8'));module[_0x5c62('0x9')]=function(_0x2cad53,_0x2723e5){return _0x2cad53['define'](_0x5c62('0xa'),attributes,{'tableName':_0x5c62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08fb=['moment','bluebird','request-promise','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0x2034e2,_0x147430){var _0x3e7c6d=function(_0x789f76){while(--_0x789f76){_0x2034e2['push'](_0x2034e2['shift']());}};_0x3e7c6d(++_0x147430);}(_0x08fb,0x193));var _0xb08f=function(_0x5d4837,_0x3483de){_0x5d4837=_0x5d4837-0x0;var _0x3988e4=_0x08fb[_0x5d4837];return _0x3988e4;};'use strict';var _=require(_0xb08f('0x0'));var util=require(_0xb08f('0x1'));var logger=require(_0xb08f('0x2'))(_0xb08f('0x3'));var moment=require(_0xb08f('0x4'));var BPromise=require(_0xb08f('0x5'));var rp=require(_0xb08f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0xb08f('0x7')]=function(_0x4fa529,_0x2f0853){return _0x4fa529[_0xb08f('0x8')](_0xb08f('0x9'),attributes,{'tableName':_0xb08f('0xa'),'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 63b58e0..ea27c4f 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 _0x1b07=['http','redis','defaults','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57c9fc,_0x247463){var _0x2d771f=function(_0x12a58c){while(--_0x12a58c){_0x57c9fc['push'](_0x57c9fc['shift']());}};_0x2d771f(++_0x247463);}(_0x1b07,0xcd));var _0x71b0=function(_0x593d89,_0x45145f){_0x593d89=_0x593d89-0x0;var _0x4aa403=_0x1b07[_0x593d89];return _0x4aa403;};'use strict';var _=require(_0x71b0('0x0'));var util=require(_0x71b0('0x1'));var moment=require(_0x71b0('0x2'));var BPromise=require(_0x71b0('0x3'));var rs=require(_0x71b0('0x4'));var fs=require('fs');var Redis=require(_0x71b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x71b0('0x6'));var logger=require(_0x71b0('0x7'))(_0x71b0('0x8'));var config=require(_0x71b0('0x9'));var jayson=require(_0x71b0('0xa'));var client=jayson['client'][_0x71b0('0xb')]({'port':0x232a});config[_0x71b0('0xc')]=_[_0x71b0('0xd')](config[_0x71b0('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x71b0('0xc')]));require(_0x71b0('0xe'))[_0x71b0('0xf')](socket);function respondWithRpcPromise(_0x1b4e05,_0x62cb5b,_0x2ec71d){return new BPromise(function(_0x2bba13,_0x40ba93){return client[_0x71b0('0x10')](_0x1b4e05,_0x2ec71d)[_0x71b0('0x11')](function(_0x41dac3){logger[_0x71b0('0x12')](_0x71b0('0x13'),_0x62cb5b,_0x71b0('0x14'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x62cb5b,_0x71b0('0x14'),JSON[_0x71b0('0x15')](_0x41dac3));if(_0x41dac3[_0x71b0('0x16')]){if(_0x41dac3[_0x71b0('0x16')][_0x71b0('0x17')]===0x1f4){logger[_0x71b0('0x16')]('Dashboard,\x20%s,\x20%s',_0x62cb5b,_0x41dac3[_0x71b0('0x16')][_0x71b0('0x18')]);return _0x40ba93(_0x41dac3[_0x71b0('0x16')]['message']);}logger[_0x71b0('0x16')](_0x71b0('0x13'),_0x62cb5b,_0x41dac3[_0x71b0('0x16')][_0x71b0('0x18')]);return _0x2bba13(_0x41dac3[_0x71b0('0x16')]['message']);}else{logger['info'](_0x71b0('0x13'),_0x62cb5b,_0x71b0('0x14'));_0x2bba13(_0x41dac3[_0x71b0('0x19')][_0x71b0('0x18')]);}})[_0x71b0('0x1a')](function(_0x50d86e){logger[_0x71b0('0x16')](_0x71b0('0x13'),_0x62cb5b,_0x50d86e);_0x40ba93(_0x50d86e);});});} \ No newline at end of file +var _0xd196=['request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xd196,0x1ed));var _0x6d19=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0xd196[_0x35f83e];return _0x249b05;};'use strict';var _=require('lodash');var util=require(_0x6d19('0x0'));var moment=require(_0x6d19('0x1'));var BPromise=require(_0x6d19('0x2'));var rs=require(_0x6d19('0x3'));var fs=require('fs');var Redis=require(_0x6d19('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d19('0x5'));var logger=require('../../config/logger')(_0x6d19('0x6'));var config=require(_0x6d19('0x7'));var jayson=require(_0x6d19('0x8'));var client=jayson[_0x6d19('0x9')]['http']({'port':0x232a});config[_0x6d19('0xa')]=_[_0x6d19('0xb')](config[_0x6d19('0xa')],{'host':_0x6d19('0xc'),'port':0x18eb});var socket=require(_0x6d19('0xd'))(new Redis(config[_0x6d19('0xa')]));require(_0x6d19('0xe'))[_0x6d19('0xf')](socket);function respondWithRpcPromise(_0x38ebe5,_0x1af76f,_0x823133){return new BPromise(function(_0x2d5002,_0x558ec3){return client[_0x6d19('0x10')](_0x38ebe5,_0x823133)[_0x6d19('0x11')](function(_0x4f78a3){logger[_0x6d19('0x12')](_0x6d19('0x13'),_0x1af76f,_0x6d19('0x14'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x1af76f,_0x6d19('0x14'),JSON[_0x6d19('0x15')](_0x4f78a3));if(_0x4f78a3['error']){if(_0x4f78a3[_0x6d19('0x16')][_0x6d19('0x17')]===0x1f4){logger[_0x6d19('0x16')](_0x6d19('0x13'),_0x1af76f,_0x4f78a3['error']['message']);return _0x558ec3(_0x4f78a3[_0x6d19('0x16')][_0x6d19('0x18')]);}logger['error'](_0x6d19('0x13'),_0x1af76f,_0x4f78a3[_0x6d19('0x16')][_0x6d19('0x18')]);return _0x2d5002(_0x4f78a3['error'][_0x6d19('0x18')]);}else{logger['info'](_0x6d19('0x13'),_0x1af76f,_0x6d19('0x14'));_0x2d5002(_0x4f78a3[_0x6d19('0x19')][_0x6d19('0x18')]);}})[_0x6d19('0x1a')](function(_0x48e164){logger[_0x6d19('0x16')](_0x6d19('0x13'),_0x1af76f,_0x48e164);_0x558ec3(_0x48e164);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3b93194..70caf8c 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 _0x937f=['length','dashboard:','./dashboard.events','save','remove','register'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x937f,0x1be));var _0xf937=function(_0x5a8fad,_0x3feb4f){_0x5a8fad=_0x5a8fad-0x0;var _0x2791d8=_0x937f[_0x5a8fad];return _0x2791d8;};'use strict';var DashboardEvents=require(_0xf937('0x0'));var events=[_0xf937('0x1'),_0xf937('0x2'),'update'];function createListener(_0x405627,_0x5e1e64){return function(_0x5a3cfa){_0x5e1e64['emit'](_0x405627,_0x5a3cfa);};}function removeListener(_0x5dd603,_0x13bff2){return function(){DashboardEvents['removeListener'](_0x5dd603,_0x13bff2);};}exports[_0xf937('0x3')]=function(_0x392f79){for(var _0x25311b=0x0,_0x49f92e=events[_0xf937('0x4')];_0x25311b<_0x49f92e;_0x25311b++){var _0x34e71c=events[_0x25311b];var _0x2cd5e4=createListener(_0xf937('0x5')+_0x34e71c,_0x392f79);DashboardEvents['on'](_0x34e71c,_0x2cd5e4);}}; \ No newline at end of file +var _0xc0a3=['remove','update','emit','dashboard:','save'];(function(_0x283213,_0x3a699e){var _0x3cd60e=function(_0x19cc36){while(--_0x19cc36){_0x283213['push'](_0x283213['shift']());}};_0x3cd60e(++_0x3a699e);}(_0xc0a3,0xc7));var _0x3c0a=function(_0x36f28a,_0x23fe78){_0x36f28a=_0x36f28a-0x0;var _0x40e9ce=_0xc0a3[_0x36f28a];return _0x40e9ce;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x3c0a('0x0'),_0x3c0a('0x1'),_0x3c0a('0x2')];function createListener(_0x3dc2ad,_0x5a949f){return function(_0x382376){_0x5a949f[_0x3c0a('0x3')](_0x3dc2ad,_0x382376);};}function removeListener(_0x5190d5,_0x3b4d44){return function(){DashboardEvents['removeListener'](_0x5190d5,_0x3b4d44);};}exports['register']=function(_0x597521){for(var _0x3ed7c6=0x0,_0x4ebf0a=events['length'];_0x3ed7c6<_0x4ebf0a;_0x3ed7c6++){var _0x198b91=events[_0x3ed7c6];var _0xf86da2=createListener(_0x3c0a('0x4')+_0x198b91,_0x597521);DashboardEvents['on'](_0x198b91,_0xf86da2);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index dee974c..c78a178 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 _0xdd26=['Router','fs-extra','../../components/auth/service','./dashboard.controller','get','isAuthenticated','/:id/items','getItems','/:id/clone','clone','post','addItem','put','update','/:id','exports','util','path','connect-timeout'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xdd26,0x166));var _0x6dd2=function(_0x1359f0,_0x3e372b){_0x1359f0=_0x1359f0-0x0;var _0x370451=_0xdd26[_0x1359f0];return _0x370451;};'use strict';var multer=require('multer');var util=require(_0x6dd2('0x0'));var path=require(_0x6dd2('0x1'));var timeout=require(_0x6dd2('0x2'));var express=require('express');var router=express[_0x6dd2('0x3')]();var fs_extra=require(_0x6dd2('0x4'));var auth=require(_0x6dd2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6dd2('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6dd2('0x7')]('/:id',auth[_0x6dd2('0x8')](),controller['show']);router['get'](_0x6dd2('0x9'),auth[_0x6dd2('0x8')](),controller[_0x6dd2('0xa')]);router['post']('/',auth[_0x6dd2('0x8')](),controller['create']);router['post'](_0x6dd2('0xb'),auth[_0x6dd2('0x8')](),controller[_0x6dd2('0xc')]);router[_0x6dd2('0xd')]('/:id/items',auth[_0x6dd2('0x8')](),controller[_0x6dd2('0xe')]);router[_0x6dd2('0xf')]('/:id',auth[_0x6dd2('0x8')](),controller[_0x6dd2('0x10')]);router['delete'](_0x6dd2('0x11'),auth[_0x6dd2('0x8')](),controller['destroy']);module[_0x6dd2('0x12')]=router; \ No newline at end of file +var _0xdac9=['fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items','getItems','post','create','clone','put','update','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x24deb0,_0x4e8207){var _0x5e5ac6=function(_0x2778f1){while(--_0x2778f1){_0x24deb0['push'](_0x24deb0['shift']());}};_0x5e5ac6(++_0x4e8207);}(_0xdac9,0xba));var _0x9dac=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0xdac9[_0x44039a];return _0x525de5;};'use strict';var multer=require(_0x9dac('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9dac('0x1'));var express=require('express');var router=express[_0x9dac('0x2')]();var fs_extra=require(_0x9dac('0x3'));var auth=require(_0x9dac('0x4'));var interaction=require(_0x9dac('0x5'));var config=require('../../config/environment');var controller=require(_0x9dac('0x6'));router[_0x9dac('0x7')]('/',auth[_0x9dac('0x8')](),controller[_0x9dac('0x9')]);router['get'](_0x9dac('0xa'),auth[_0x9dac('0x8')](),controller['show']);router['get'](_0x9dac('0xb'),auth[_0x9dac('0x8')](),controller[_0x9dac('0xc')]);router[_0x9dac('0xd')]('/',auth[_0x9dac('0x8')](),controller[_0x9dac('0xe')]);router[_0x9dac('0xd')]('/:id/clone',auth['isAuthenticated'](),controller[_0x9dac('0xf')]);router[_0x9dac('0xd')](_0x9dac('0xb'),auth['isAuthenticated'](),controller['addItem']);router[_0x9dac('0x10')](_0x9dac('0xa'),auth[_0x9dac('0x8')](),controller[_0x9dac('0x11')]);router[_0x9dac('0x12')]('/:id',auth[_0x9dac('0x8')](),controller[_0x9dac('0x13')]);module[_0x9dac('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 419b5b9..90722cd 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 _0x5496=['#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5496,0x175));var _0x6549=function(_0x376e40,_0x2c5f0f){_0x376e40=_0x376e40-0x0;var _0x5231f2=_0x5496[_0x376e40];return _0x5231f2;};'use strict';var Sequelize=require(_0x6549('0x0'));var squel=require(_0x6549('0x1'));var _=require(_0x6549('0x2'));module[_0x6549('0x3')]={'title':{'type':Sequelize[_0x6549('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6549('0x5')]('long'),'get':function(){try{return JSON[_0x6549('0x6')](this[_0x6549('0x7')](_0x6549('0x8')));}catch(_0x4d0473){return[];}},'set':function(_0x5a4658){try{this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify'](_0x5a4658));}catch(_0x1ca8fc){this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x6549('0xa')]},'col':{'type':Sequelize[_0x6549('0xa')]},'background':{'type':Sequelize[_0x6549('0x4')],'allowNull':![],'defaultValue':_0x6549('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6549('0x4')]},'titleFontSize':{'type':Sequelize[_0x6549('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x53ec=['getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','long'];(function(_0x196dc5,_0x50be9d){var _0x56458e=function(_0x5bd98b){while(--_0x5bd98b){_0x196dc5['push'](_0x196dc5['shift']());}};_0x56458e(++_0x50be9d);}(_0x53ec,0x192));var _0xc53e=function(_0x466e6b,_0x4053fd){_0x466e6b=_0x466e6b-0x0;var _0x118deb=_0x53ec[_0x466e6b];return _0x118deb;};'use strict';var Sequelize=require(_0xc53e('0x0'));var squel=require(_0xc53e('0x1'));var _=require(_0xc53e('0x2'));module[_0xc53e('0x3')]={'title':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc53e('0x5')),'get':function(){try{return JSON['parse'](this[_0xc53e('0x6')](_0xc53e('0x7')));}catch(_0x4a9c59){return[];}},'set':function(_0x2f1414){try{this['setDataValue'](_0xc53e('0x7'),JSON[_0xc53e('0x8')](_0x2f1414));}catch(_0x5d3b28){this[_0xc53e('0x9')](_0xc53e('0x7'),JSON[_0xc53e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc53e('0xa')]},'col':{'type':Sequelize[_0xc53e('0xa')]},'background':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![],'defaultValue':_0xc53e('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc53e('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 7e6f6fa..1c168e8 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 _0xb4a9=['fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','catch','destroy','find','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','body','eml-format'];(function(_0xccd975,_0xeb4b7f){var _0x2f3407=function(_0x463f60){while(--_0x463f60){_0xccd975['push'](_0xccd975['shift']());}};_0x2f3407(++_0xeb4b7f);}(_0xb4a9,0x1c1));var _0x9b4a=function(_0x3bc56a,_0x12c038){_0x3bc56a=_0x3bc56a-0x0;var _0x28e75d=_0xb4a9[_0x3bc56a];return _0x28e75d;};'use strict';var emlformat=require(_0x9b4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b4a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9b4a('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9b4a('0x3'));var sox=require(_0x9b4a('0x4'));var csv=require(_0x9b4a('0x5'));var ejs=require(_0x9b4a('0x6'));var fs=require('fs');var fs_extra=require(_0x9b4a('0x7'));var _=require(_0x9b4a('0x8'));var squel=require(_0x9b4a('0x9'));var crypto=require('crypto');var jsforce=require(_0x9b4a('0xa'));var deskjs=require(_0x9b4a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9b4a('0xc'));var Papa=require(_0x9b4a('0xd'));var Redis=require(_0x9b4a('0xe'));var authService=require(_0x9b4a('0xf'));var qs=require(_0x9b4a('0x10'));var as=require(_0x9b4a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b4a('0x12'))('api');var utils=require(_0x9b4a('0x13'));var config=require(_0x9b4a('0x14'));var licenseUtil=require(_0x9b4a('0x15'));var db=require('../../mysqldb')['db'];config[_0x9b4a('0x16')]=_[_0x9b4a('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9b4a('0x18'))(new Redis(config[_0x9b4a('0x16')]));require(_0x9b4a('0x19'))[_0x9b4a('0x1a')](socket);function respondWithStatusCode(_0x23793d,_0x31bf1a){_0x31bf1a=_0x31bf1a||0xcc;return function(_0x477047){if(_0x477047){return _0x23793d['sendStatus'](_0x31bf1a);}return _0x23793d[_0x9b4a('0x1b')](_0x31bf1a)[_0x9b4a('0x1c')]();};}function respondWithResult(_0x539710,_0x54cf60){_0x54cf60=_0x54cf60||0xc8;return function(_0x197263){if(_0x197263){return _0x539710[_0x9b4a('0x1b')](_0x54cf60)[_0x9b4a('0x1d')](_0x197263);}};}function respondWithFilteredResult(_0x511361,_0x11760a){return function(_0x5a2755){if(_0x5a2755){var _0x534d9e=typeof _0x11760a[_0x9b4a('0x1e')]===_0x9b4a('0x1f')&&typeof _0x11760a[_0x9b4a('0x20')]===_0x9b4a('0x1f');var _0x33c967=_0x5a2755[_0x9b4a('0x21')];var _0xe1bd37=_0x534d9e?0x0:_0x11760a[_0x9b4a('0x1e')];var _0x31b6b7=_0x534d9e?_0x5a2755[_0x9b4a('0x21')]:_0x11760a[_0x9b4a('0x1e')]+_0x11760a[_0x9b4a('0x20')];var _0x342e0f;if(_0x31b6b7>=_0x33c967){_0x31b6b7=_0x33c967;_0x342e0f=0xc8;}else{_0x342e0f=0xce;}_0x511361[_0x9b4a('0x1b')](_0x342e0f);return _0x511361[_0x9b4a('0x22')]('Content-Range',_0xe1bd37+'-'+_0x31b6b7+'/'+_0x33c967)[_0x9b4a('0x1d')](_0x5a2755);}return null;};}function patchUpdates(_0x4ea6f){return function(_0x4f115a){try{jsonpatch[_0x9b4a('0x23')](_0x4f115a,_0x4ea6f,!![]);}catch(_0x4f5c88){return BPromise[_0x9b4a('0x24')](_0x4f5c88);}return _0x4f115a[_0x9b4a('0x25')]();};}function saveUpdates(_0x45018e,_0x1b68ef){return function(_0x13dd59){if(_0x13dd59){return _0x13dd59[_0x9b4a('0x26')](_0x45018e)[_0x9b4a('0x27')](function(_0x4f9ac9){return _0x4f9ac9;});}return null;};}function removeEntity(_0x44caf6,_0x2b2b98){return function(_0x450537){if(_0x450537){return _0x450537['destroy']()[_0x9b4a('0x27')](function(){_0x44caf6[_0x9b4a('0x1b')](0xcc)[_0x9b4a('0x1c')]();});}};}function handleEntityNotFound(_0x1c2909,_0x4f3ba4){return function(_0x40b39b){if(!_0x40b39b){_0x1c2909[_0x9b4a('0x28')](0x194);}return _0x40b39b;};}function handleError(_0x4b964c,_0x897c47){_0x897c47=_0x897c47||0x1f4;return function(_0x525cc4){logger[_0x9b4a('0x29')](_0x525cc4[_0x9b4a('0x2a')]);if(_0x525cc4[_0x9b4a('0x2b')]){delete _0x525cc4[_0x9b4a('0x2b')];}_0x4b964c[_0x9b4a('0x1b')](_0x897c47)[_0x9b4a('0x2c')](_0x525cc4);};}exports['show']=function(_0x5b73f3,_0xa8b9f8){var _0x45202e={'raw':![],'where':{'id':_0x5b73f3[_0x9b4a('0x2d')]['id']}},_0x236665={};_0x236665[_0x9b4a('0x2e')]=_[_0x9b4a('0x2f')](db[_0x9b4a('0x30')][_0x9b4a('0x31')]);_0x236665[_0x9b4a('0x32')]=_['keys'](_0x5b73f3[_0x9b4a('0x32')]);_0x236665[_0x9b4a('0x33')]=_[_0x9b4a('0x34')](_0x236665[_0x9b4a('0x2e')],_0x236665[_0x9b4a('0x32')]);_0x45202e[_0x9b4a('0x35')]=_[_0x9b4a('0x34')](_0x236665[_0x9b4a('0x2e')],qs[_0x9b4a('0x36')](_0x5b73f3[_0x9b4a('0x32')][_0x9b4a('0x36')]));_0x45202e[_0x9b4a('0x35')]=_0x45202e[_0x9b4a('0x35')][_0x9b4a('0x37')]?_0x45202e['attributes']:_0x236665[_0x9b4a('0x2e')];if(_0x5b73f3[_0x9b4a('0x32')]['includeAll']){_0x45202e[_0x9b4a('0x38')]=[{'all':!![]}];}_0x45202e=_[_0x9b4a('0x39')]({},_0x45202e,_0x5b73f3[_0x9b4a('0x3a')]);return db[_0x9b4a('0x30')]['find'](_0x45202e)[_0x9b4a('0x27')](handleEntityNotFound(_0xa8b9f8,null))[_0x9b4a('0x27')](respondWithResult(_0xa8b9f8,null))[_0x9b4a('0x3b')](handleError(_0xa8b9f8,null));};exports[_0x9b4a('0x3c')]=function(_0x382f9d,_0x1a9be4){return db[_0x9b4a('0x30')][_0x9b4a('0x3d')]({'where':{'id':_0x382f9d[_0x9b4a('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1a9be4,null))[_0x9b4a('0x27')](removeEntity(_0x1a9be4,null))[_0x9b4a('0x3b')](handleError(_0x1a9be4,null));};function widgetAttributes(_0x3a10c7){try{switch(_0x3a10c7[_0x9b4a('0x3e')]){case _0x9b4a('0x3f'):return[{'name':_0x9b4a('0x40'),'value':_0x3a10c7[_0x9b4a('0x40')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7['attrs'][0x0]?_0x3a10c7[_0x9b4a('0x41')][0x0]['value']:undefined)||_0x9b4a('0x42')}];case _0x9b4a('0x43'):return[{'name':_0x9b4a('0x44'),'value':_0x3a10c7[_0x9b4a('0x44')]||(_0x3a10c7['attrs']&&_0x3a10c7[_0x9b4a('0x41')][0x0]?_0x3a10c7['attrs'][0x0][_0x9b4a('0x45')]:undefined)||''}];case'clock':return[{'name':_0x9b4a('0x46'),'value':_0x3a10c7[_0x9b4a('0x46')]||(_0x3a10c7['attrs']&&_0x3a10c7[_0x9b4a('0x41')][0x0]?_0x3a10c7[_0x9b4a('0x41')][0x0][_0x9b4a('0x45')]:undefined)||_0x9b4a('0x47')},{'name':_0x9b4a('0x48'),'value':_0x3a10c7[_0x9b4a('0x48')]||(_0x3a10c7['attrs']&&_0x3a10c7[_0x9b4a('0x41')][0x1]?_0x3a10c7[_0x9b4a('0x41')][0x1][_0x9b4a('0x45')]:undefined)||_0x9b4a('0x49')},{'name':_0x9b4a('0x4a'),'value':_0x3a10c7[_0x9b4a('0x4a')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7[_0x9b4a('0x41')][0x2]?_0x3a10c7[_0x9b4a('0x41')][0x2]['value']:undefined)||0xc}];case _0x9b4a('0x4b'):return[{'name':_0x9b4a('0x4c'),'value':_0x3a10c7[_0x9b4a('0x4c')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7[_0x9b4a('0x41')][0x0]?_0x3a10c7[_0x9b4a('0x41')][0x0][_0x9b4a('0x45')]:undefined)||'total'},{'name':_0x9b4a('0x4d'),'value':_0x3a10c7[_0x9b4a('0x4d')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7['attrs'][0x1]?_0x3a10c7[_0x9b4a('0x41')][0x1]['value']:undefined)||[]},{'name':_0x9b4a('0x4a'),'value':_0x3a10c7[_0x9b4a('0x4a')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7['attrs'][0x2]?_0x3a10c7[_0x9b4a('0x41')][0x2]['value']:undefined)||0x14}];case _0x9b4a('0x4e'):case _0x9b4a('0x4f'):return[{'name':'attrSerie1','value':_0x3a10c7[_0x9b4a('0x50')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7['attrs'][0x0]?_0x3a10c7[_0x9b4a('0x41')][0x0][_0x9b4a('0x45')]:undefined)||_0x9b4a('0x51')},{'name':_0x9b4a('0x52'),'value':_0x3a10c7[_0x9b4a('0x52')]||(_0x3a10c7['attrs']&&_0x3a10c7['attrs'][0x1]?_0x3a10c7[_0x9b4a('0x41')][0x1][_0x9b4a('0x45')]:undefined)||null},{'name':_0x9b4a('0x53'),'value':_0x3a10c7[_0x9b4a('0x53')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7[_0x9b4a('0x41')][0x2]?_0x3a10c7['attrs'][0x2][_0x9b4a('0x45')]:undefined)||null},{'name':_0x9b4a('0x4d'),'value':_0x3a10c7['attrVoiceQueues']||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7[_0x9b4a('0x41')][0x3]?_0x3a10c7[_0x9b4a('0x41')][0x3][_0x9b4a('0x45')]:undefined)||[]}];case _0x9b4a('0x54'):return[{'name':'attrReport','type':_0x3a10c7[_0x9b4a('0x55')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7[_0x9b4a('0x41')][0x0]?_0x3a10c7[_0x9b4a('0x41')][0x0][_0x9b4a('0x3e')]:undefined)||null,'value':_0x3a10c7[_0x9b4a('0x56')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7[_0x9b4a('0x41')][0x0]?_0x3a10c7[_0x9b4a('0x41')][0x0][_0x9b4a('0x45')]:undefined)||null},{'name':_0x9b4a('0x57'),'value':_0x3a10c7[_0x9b4a('0x57')]||(_0x3a10c7[_0x9b4a('0x41')]&&_0x3a10c7[_0x9b4a('0x41')][0x1]?_0x3a10c7[_0x9b4a('0x41')][0x1][_0x9b4a('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x23c120){logger[_0x9b4a('0x29')]('widgetAttributes:\x20%s',JSON[_0x9b4a('0x58')](_0x23c120));return[];}}exports['create']=function(_0x1f20b9,_0x3aef1c){if(_0x1f20b9['body']){_0x1f20b9[_0x9b4a('0x59')][_0x9b4a('0x41')]=widgetAttributes(_0x1f20b9[_0x9b4a('0x59')]);}return db[_0x9b4a('0x30')]['create'](_0x1f20b9[_0x9b4a('0x59')],{})[_0x9b4a('0x27')](respondWithResult(_0x3aef1c,0xc9))[_0x9b4a('0x3b')](handleError(_0x3aef1c,null));};exports[_0x9b4a('0x26')]=function(_0x356d14,_0x235651){if(_0x356d14[_0x9b4a('0x59')]['id']){delete _0x356d14[_0x9b4a('0x59')]['id'];}_0x356d14[_0x9b4a('0x59')][_0x9b4a('0x41')]=widgetAttributes(_0x356d14[_0x9b4a('0x59')]);return db[_0x9b4a('0x30')][_0x9b4a('0x3d')]({'where':{'id':_0x356d14[_0x9b4a('0x2d')]['id']}})[_0x9b4a('0x27')](handleEntityNotFound(_0x235651,null))[_0x9b4a('0x27')](saveUpdates(_0x356d14[_0x9b4a('0x59')],null))[_0x9b4a('0x27')](respondWithResult(_0x235651,null))['catch'](handleError(_0x235651,null));}; \ No newline at end of file +var _0x80fb=['params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrRefresh','widgetAttributes:\x20%s','stringify','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','reject','update','destroy','then','error','stack','name','send','model','rawAttributes','keys','query','intersection','fields','attributes','length','includeAll','merge','DashboardItem','catch','find'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x80fb,0x11e));var _0xb80f=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x80fb[_0x29b609];return _0x54c952;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb80f('0x0'));var zipdir=require(_0xb80f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb80f('0x2'));var moment=require(_0xb80f('0x3'));var BPromise=require(_0xb80f('0x4'));var Mustache=require(_0xb80f('0x5'));var util=require(_0xb80f('0x6'));var path=require(_0xb80f('0x7'));var sox=require(_0xb80f('0x8'));var csv=require(_0xb80f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb80f('0xa'));var _=require(_0xb80f('0xb'));var squel=require(_0xb80f('0xc'));var crypto=require(_0xb80f('0xd'));var jsforce=require(_0xb80f('0xe'));var deskjs=require(_0xb80f('0xf'));var toCsv=require(_0xb80f('0x9'));var querystring=require(_0xb80f('0x10'));var Papa=require(_0xb80f('0x11'));var Redis=require(_0xb80f('0x12'));var authService=require(_0xb80f('0x13'));var qs=require(_0xb80f('0x14'));var as=require(_0xb80f('0x15'));var hardwareService=require(_0xb80f('0x16'));var logger=require(_0xb80f('0x17'))(_0xb80f('0x18'));var utils=require('../../config/utils');var config=require(_0xb80f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb80f('0x1a'))['db'];config[_0xb80f('0x1b')]=_[_0xb80f('0x1c')](config[_0xb80f('0x1b')],{'host':_0xb80f('0x1d'),'port':0x18eb});var socket=require(_0xb80f('0x1e'))(new Redis(config[_0xb80f('0x1b')]));require(_0xb80f('0x1f'))[_0xb80f('0x20')](socket);function respondWithStatusCode(_0x205523,_0x152368){_0x152368=_0x152368||0xcc;return function(_0x3eccd1){if(_0x3eccd1){return _0x205523[_0xb80f('0x21')](_0x152368);}return _0x205523[_0xb80f('0x22')](_0x152368)[_0xb80f('0x23')]();};}function respondWithResult(_0x59cc1b,_0x2558f6){_0x2558f6=_0x2558f6||0xc8;return function(_0x2aee13){if(_0x2aee13){return _0x59cc1b['status'](_0x2558f6)['json'](_0x2aee13);}};}function respondWithFilteredResult(_0x2fc77e,_0x29b88d){return function(_0x6e017c){if(_0x6e017c){var _0x353d77=typeof _0x29b88d[_0xb80f('0x24')]===_0xb80f('0x25')&&typeof _0x29b88d['limit']===_0xb80f('0x25');var _0x361a0e=_0x6e017c[_0xb80f('0x26')];var _0x17d26d=_0x353d77?0x0:_0x29b88d[_0xb80f('0x24')];var _0x199549=_0x353d77?_0x6e017c[_0xb80f('0x26')]:_0x29b88d[_0xb80f('0x24')]+_0x29b88d[_0xb80f('0x27')];var _0x39a580;if(_0x199549>=_0x361a0e){_0x199549=_0x361a0e;_0x39a580=0xc8;}else{_0x39a580=0xce;}_0x2fc77e[_0xb80f('0x22')](_0x39a580);return _0x2fc77e['set'](_0xb80f('0x28'),_0x17d26d+'-'+_0x199549+'/'+_0x361a0e)['json'](_0x6e017c);}return null;};}function patchUpdates(_0x713bad){return function(_0x2a63b2){try{jsonpatch['apply'](_0x2a63b2,_0x713bad,!![]);}catch(_0x38a6cc){return BPromise[_0xb80f('0x29')](_0x38a6cc);}return _0x2a63b2['save']();};}function saveUpdates(_0x52a032,_0x2a0f1d){return function(_0x2a1650){if(_0x2a1650){return _0x2a1650[_0xb80f('0x2a')](_0x52a032)['then'](function(_0x206209){return _0x206209;});}return null;};}function removeEntity(_0x49d2c0,_0x510180){return function(_0x475caf){if(_0x475caf){return _0x475caf[_0xb80f('0x2b')]()[_0xb80f('0x2c')](function(){_0x49d2c0[_0xb80f('0x22')](0xcc)[_0xb80f('0x23')]();});}};}function handleEntityNotFound(_0x3c2c38,_0x1c9139){return function(_0xbffa6e){if(!_0xbffa6e){_0x3c2c38['sendStatus'](0x194);}return _0xbffa6e;};}function handleError(_0x56551d,_0x4c962b){_0x4c962b=_0x4c962b||0x1f4;return function(_0x505da2){logger[_0xb80f('0x2d')](_0x505da2[_0xb80f('0x2e')]);if(_0x505da2[_0xb80f('0x2f')]){delete _0x505da2[_0xb80f('0x2f')];}_0x56551d[_0xb80f('0x22')](_0x4c962b)[_0xb80f('0x30')](_0x505da2);};}exports['show']=function(_0x12bf45,_0x6f119e){var _0x5c0846={'raw':![],'where':{'id':_0x12bf45['params']['id']}},_0x1be34a={};_0x1be34a[_0xb80f('0x31')]=_['keys'](db['DashboardItem'][_0xb80f('0x32')]);_0x1be34a['query']=_[_0xb80f('0x33')](_0x12bf45[_0xb80f('0x34')]);_0x1be34a['filters']=_['intersection'](_0x1be34a[_0xb80f('0x31')],_0x1be34a[_0xb80f('0x34')]);_0x5c0846['attributes']=_[_0xb80f('0x35')](_0x1be34a[_0xb80f('0x31')],qs[_0xb80f('0x36')](_0x12bf45[_0xb80f('0x34')][_0xb80f('0x36')]));_0x5c0846['attributes']=_0x5c0846[_0xb80f('0x37')][_0xb80f('0x38')]?_0x5c0846['attributes']:_0x1be34a[_0xb80f('0x31')];if(_0x12bf45[_0xb80f('0x34')][_0xb80f('0x39')]){_0x5c0846['include']=[{'all':!![]}];}_0x5c0846=_[_0xb80f('0x3a')]({},_0x5c0846,_0x12bf45['options']);return db[_0xb80f('0x3b')]['find'](_0x5c0846)[_0xb80f('0x2c')](handleEntityNotFound(_0x6f119e,null))['then'](respondWithResult(_0x6f119e,null))[_0xb80f('0x3c')](handleError(_0x6f119e,null));};exports[_0xb80f('0x2b')]=function(_0x397900,_0x33e740){return db['DashboardItem'][_0xb80f('0x3d')]({'where':{'id':_0x397900[_0xb80f('0x3e')]['id']}})[_0xb80f('0x2c')](handleEntityNotFound(_0x33e740,null))[_0xb80f('0x2c')](removeEntity(_0x33e740,null))[_0xb80f('0x3c')](handleError(_0x33e740,null));};function widgetAttributes(_0x5a4c8c){try{switch(_0x5a4c8c[_0xb80f('0x3f')]){case _0xb80f('0x40'):return[{'name':'attrUrl','value':_0x5a4c8c[_0xb80f('0x41')]||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x0]?_0x5a4c8c[_0xb80f('0x42')][0x0][_0xb80f('0x43')]:undefined)||_0xb80f('0x44')}];case _0xb80f('0x45'):return[{'name':_0xb80f('0x46'),'value':_0x5a4c8c['attrPath']||(_0x5a4c8c['attrs']&&_0x5a4c8c[_0xb80f('0x42')][0x0]?_0x5a4c8c[_0xb80f('0x42')][0x0][_0xb80f('0x43')]:undefined)||''}];case _0xb80f('0x47'):return[{'name':'attrHourFormat','value':_0x5a4c8c['attrHourFormat']||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c['attrs'][0x0]?_0x5a4c8c[_0xb80f('0x42')][0x0][_0xb80f('0x43')]:undefined)||_0xb80f('0x48')},{'name':_0xb80f('0x49'),'value':_0x5a4c8c[_0xb80f('0x49')]||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x1]?_0x5a4c8c[_0xb80f('0x42')][0x1][_0xb80f('0x43')]:undefined)||_0xb80f('0x4a')},{'name':'attrFontSize','value':_0x5a4c8c[_0xb80f('0x4b')]||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x2]?_0x5a4c8c[_0xb80f('0x42')][0x2][_0xb80f('0x43')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5a4c8c['attrMetric']||(_0x5a4c8c['attrs']&&_0x5a4c8c[_0xb80f('0x42')][0x0]?_0x5a4c8c[_0xb80f('0x42')][0x0][_0xb80f('0x43')]:undefined)||_0xb80f('0x4c')},{'name':_0xb80f('0x4d'),'value':_0x5a4c8c[_0xb80f('0x4d')]||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x1]?_0x5a4c8c['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x5a4c8c[_0xb80f('0x4b')]||(_0x5a4c8c['attrs']&&_0x5a4c8c[_0xb80f('0x42')][0x2]?_0x5a4c8c[_0xb80f('0x42')][0x2][_0xb80f('0x43')]:undefined)||0x14}];case _0xb80f('0x4e'):case'pie-chart':return[{'name':_0xb80f('0x4f'),'value':_0x5a4c8c['attrSerie1']||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x0]?_0x5a4c8c['attrs'][0x0]['value']:undefined)||_0xb80f('0x4c')},{'name':_0xb80f('0x50'),'value':_0x5a4c8c[_0xb80f('0x50')]||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x1]?_0x5a4c8c['attrs'][0x1][_0xb80f('0x43')]:undefined)||null},{'name':'attrSerie3','value':_0x5a4c8c[_0xb80f('0x51')]||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x2]?_0x5a4c8c[_0xb80f('0x42')][0x2][_0xb80f('0x43')]:undefined)||null},{'name':_0xb80f('0x4d'),'value':_0x5a4c8c[_0xb80f('0x4d')]||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x3]?_0x5a4c8c['attrs'][0x3][_0xb80f('0x43')]:undefined)||[]}];case _0xb80f('0x52'):return[{'name':'attrReport','type':_0x5a4c8c['reportType']||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x0]?_0x5a4c8c[_0xb80f('0x42')][0x0][_0xb80f('0x3f')]:undefined)||null,'value':_0x5a4c8c['attrReport']||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x0]?_0x5a4c8c['attrs'][0x0][_0xb80f('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x5a4c8c[_0xb80f('0x53')]||(_0x5a4c8c[_0xb80f('0x42')]&&_0x5a4c8c[_0xb80f('0x42')][0x1]?_0x5a4c8c['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x267766){logger[_0xb80f('0x2d')](_0xb80f('0x54'),JSON[_0xb80f('0x55')](_0x267766));return[];}}exports['create']=function(_0x1466b2,_0x31ad22){if(_0x1466b2[_0xb80f('0x56')]){_0x1466b2[_0xb80f('0x56')][_0xb80f('0x42')]=widgetAttributes(_0x1466b2['body']);}return db[_0xb80f('0x3b')]['create'](_0x1466b2['body'],{})[_0xb80f('0x2c')](respondWithResult(_0x31ad22,0xc9))['catch'](handleError(_0x31ad22,null));};exports[_0xb80f('0x2a')]=function(_0x1231e5,_0x2f42e0){if(_0x1231e5[_0xb80f('0x56')]['id']){delete _0x1231e5[_0xb80f('0x56')]['id'];}_0x1231e5[_0xb80f('0x56')][_0xb80f('0x42')]=widgetAttributes(_0x1231e5[_0xb80f('0x56')]);return db[_0xb80f('0x3b')]['find']({'where':{'id':_0x1231e5[_0xb80f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2f42e0,null))['then'](saveUpdates(_0x1231e5['body'],null))['then'](respondWithResult(_0x2f42e0,null))[_0xb80f('0x3c')](handleError(_0x2f42e0,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index b069f99..744e02d 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 _0xabf9=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0xabf9,0x1e4));var _0x9abf=function(_0x5863c2,_0x109e91){_0x5863c2=_0x5863c2-0x0;var _0x17a392=_0xabf9[_0x5863c2];return _0x17a392;};'use strict';var EventEmitter=require(_0x9abf('0x0'));var DashboardItem=require(_0x9abf('0x1'))['db'][_0x9abf('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9abf('0x3')](0x0);var events={'afterCreate':_0x9abf('0x4'),'afterUpdate':_0x9abf('0x5'),'afterDestroy':_0x9abf('0x6')};function emitEvent(_0x151e90){return function(_0x25c954,_0x176a43,_0x16868b){DashboardItemEvents[_0x9abf('0x7')](_0x151e90+':'+_0x25c954['id'],_0x25c954);DashboardItemEvents[_0x9abf('0x7')](_0x151e90,_0x25c954);_0x16868b(null);};}for(var e in events){if(events[_0x9abf('0x8')](e)){var event=events[e];DashboardItem[_0x9abf('0x9')](e,emitEvent(event));}}module[_0x9abf('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x93c2=['emit','hook','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x93c2,0x15a));var _0x293c=function(_0x33d040,_0xbe4a5e){_0x33d040=_0x33d040-0x0;var _0x3be7d1=_0x93c2[_0x33d040];return _0x3be7d1;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x293c('0x0'))['db'][_0x293c('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x293c('0x2')](0x0);var events={'afterCreate':_0x293c('0x3'),'afterUpdate':_0x293c('0x4'),'afterDestroy':_0x293c('0x5')};function emitEvent(_0x1c66ec){return function(_0xcc82f1,_0x460ebc,_0x130caa){DashboardItemEvents[_0x293c('0x6')](_0x1c66ec+':'+_0xcc82f1['id'],_0xcc82f1);DashboardItemEvents[_0x293c('0x6')](_0x1c66ec,_0xcc82f1);_0x130caa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x293c('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 8534337..96a58df 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 _0x9004=['DashboardItem','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0x35827c,_0xbc06e3){var _0x19aa3a=function(_0x4956b9){while(--_0x4956b9){_0x35827c['push'](_0x35827c['shift']());}};_0x19aa3a(++_0xbc06e3);}(_0x9004,0x1eb));var _0x4900=function(_0x36995f,_0x176eba){_0x36995f=_0x36995f-0x0;var _0x5cd258=_0x9004[_0x36995f];return _0x5cd258;};'use strict';var _=require(_0x4900('0x0'));var util=require(_0x4900('0x1'));var logger=require(_0x4900('0x2'))(_0x4900('0x3'));var moment=require(_0x4900('0x4'));var BPromise=require(_0x4900('0x5'));var rp=require(_0x4900('0x6'));var fs=require('fs');var path=require(_0x4900('0x7'));var rimraf=require(_0x4900('0x8'));var config=require(_0x4900('0x9'));var attributes=require(_0x4900('0xa'));module[_0x4900('0xb')]=function(_0x24df8d,_0x31f389){return _0x24df8d[_0x4900('0xc')](_0x4900('0xd'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb592=['path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','lodash','api','bluebird'];(function(_0x44c25d,_0x513f48){var _0x2e2031=function(_0x4aadd8){while(--_0x4aadd8){_0x44c25d['push'](_0x44c25d['shift']());}};_0x2e2031(++_0x513f48);}(_0xb592,0x10b));var _0x2b59=function(_0x243aca,_0x272cb3){_0x243aca=_0x243aca-0x0;var _0x4a586d=_0xb592[_0x243aca];return _0x4a586d;};'use strict';var _=require(_0x2b59('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2b59('0x1'));var moment=require('moment');var BPromise=require(_0x2b59('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b59('0x3'));var rimraf=require(_0x2b59('0x4'));var config=require(_0x2b59('0x5'));var attributes=require(_0x2b59('0x6'));module[_0x2b59('0x7')]=function(_0xd3b426,_0x49f899){return _0xd3b426['define'](_0x2b59('0x8'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 495271f..59b265c 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 _0x27cb=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x27cb,0x66));var _0xb27c=function(_0x4ce16e,_0x4f9772){_0x4ce16e=_0x4ce16e-0x0;var _0x73d373=_0x27cb[_0x4ce16e];return _0x73d373;};'use strict';var _=require(_0xb27c('0x0'));var util=require(_0xb27c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb27c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb27c('0x3'))['db'];var utils=require(_0xb27c('0x4'));var logger=require(_0xb27c('0x5'))(_0xb27c('0x6'));var config=require('../../config/environment');var jayson=require(_0xb27c('0x7'));var client=jayson[_0xb27c('0x8')][_0xb27c('0x9')]({'port':0x232a});config[_0xb27c('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb27c('0xb'))(new Redis(config[_0xb27c('0xa')]));require(_0xb27c('0xc'))[_0xb27c('0xd')](socket);function respondWithRpcPromise(_0x105d8c,_0x34be98,_0x485606){return new BPromise(function(_0x15934a,_0x482793){return client[_0xb27c('0xe')](_0x105d8c,_0x485606)[_0xb27c('0xf')](function(_0x304d46){logger[_0xb27c('0x10')](_0xb27c('0x11'),_0x34be98,'request\x20sent');logger[_0xb27c('0x12')](_0xb27c('0x13'),_0x34be98,_0xb27c('0x14'),JSON[_0xb27c('0x15')](_0x304d46));if(_0x304d46['error']){if(_0x304d46[_0xb27c('0x16')]['code']===0x1f4){logger[_0xb27c('0x16')](_0xb27c('0x11'),_0x34be98,_0x304d46[_0xb27c('0x16')][_0xb27c('0x17')]);return _0x482793(_0x304d46[_0xb27c('0x16')]['message']);}logger[_0xb27c('0x16')](_0xb27c('0x11'),_0x34be98,_0x304d46[_0xb27c('0x16')]['message']);return _0x15934a(_0x304d46['error']['message']);}else{logger[_0xb27c('0x10')](_0xb27c('0x11'),_0x34be98,_0xb27c('0x14'));_0x15934a(_0x304d46[_0xb27c('0x18')][_0xb27c('0x17')]);}})[_0xb27c('0x19')](function(_0x4eb9fa){logger[_0xb27c('0x16')](_0xb27c('0x11'),_0x34be98,_0x4eb9fa);_0x482793(_0x4eb9fa);});});} \ No newline at end of file +var _0xf8c6=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash'];(function(_0x2d43b4,_0xa4ee8f){var _0x3a387c=function(_0x476953){while(--_0x476953){_0x2d43b4['push'](_0x2d43b4['shift']());}};_0x3a387c(++_0xa4ee8f);}(_0xf8c6,0x1a8));var _0x6f8c=function(_0x36d2ed,_0x26a70e){_0x36d2ed=_0x36d2ed-0x0;var _0x35d6a5=_0xf8c6[_0x36d2ed];return _0x35d6a5;};'use strict';var _=require(_0x6f8c('0x0'));var util=require(_0x6f8c('0x1'));var moment=require(_0x6f8c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f8c('0x3'));var db=require(_0x6f8c('0x4'))['db'];var utils=require(_0x6f8c('0x5'));var logger=require('../../config/logger')(_0x6f8c('0x6'));var config=require('../../config/environment');var jayson=require(_0x6f8c('0x7'));var client=jayson[_0x6f8c('0x8')][_0x6f8c('0x9')]({'port':0x232a});config[_0x6f8c('0xa')]=_[_0x6f8c('0xb')](config[_0x6f8c('0xa')],{'host':_0x6f8c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f8c('0xa')]));require(_0x6f8c('0xd'))[_0x6f8c('0xe')](socket);function respondWithRpcPromise(_0x4e4d58,_0xf00b71,_0x25a93a){return new BPromise(function(_0x122d36,_0x5c17f8){return client['request'](_0x4e4d58,_0x25a93a)[_0x6f8c('0xf')](function(_0x3fc12d){logger['info'](_0x6f8c('0x10'),_0xf00b71,_0x6f8c('0x11'));logger[_0x6f8c('0x12')](_0x6f8c('0x13'),_0xf00b71,_0x6f8c('0x11'),JSON['stringify'](_0x3fc12d));if(_0x3fc12d[_0x6f8c('0x14')]){if(_0x3fc12d[_0x6f8c('0x14')][_0x6f8c('0x15')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0xf00b71,_0x3fc12d[_0x6f8c('0x14')][_0x6f8c('0x16')]);return _0x5c17f8(_0x3fc12d[_0x6f8c('0x14')]['message']);}logger[_0x6f8c('0x14')](_0x6f8c('0x10'),_0xf00b71,_0x3fc12d[_0x6f8c('0x14')]['message']);return _0x122d36(_0x3fc12d[_0x6f8c('0x14')][_0x6f8c('0x16')]);}else{logger[_0x6f8c('0x17')](_0x6f8c('0x10'),_0xf00b71,'request\x20sent');_0x122d36(_0x3fc12d[_0x6f8c('0x18')][_0x6f8c('0x16')]);}})['catch'](function(_0x1ce373){logger[_0x6f8c('0x14')](_0x6f8c('0x10'),_0xf00b71,_0x1ce373);_0x5c17f8(_0x1ce373);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 3d70a26..43450a1 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 _0x61da=['save','remove','emit','removeListener','length','dashboardItem:'];(function(_0x1ddbbb,_0x5ad17c){var _0xab79c4=function(_0x4b753b){while(--_0x4b753b){_0x1ddbbb['push'](_0x1ddbbb['shift']());}};_0xab79c4(++_0x5ad17c);}(_0x61da,0x198));var _0xa61d=function(_0xb8019a,_0x45573f){_0xb8019a=_0xb8019a-0x0;var _0x27323c=_0x61da[_0xb8019a];return _0x27323c;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xa61d('0x0'),_0xa61d('0x1'),'update'];function createListener(_0x3d02c9,_0x210552){return function(_0x38eaf5){_0x210552[_0xa61d('0x2')](_0x3d02c9,_0x38eaf5);};}function removeListener(_0x250c86,_0x1bba48){return function(){DashboardItemEvents[_0xa61d('0x3')](_0x250c86,_0x1bba48);};}exports['register']=function(_0x4b0bce){for(var _0x424483=0x0,_0x34096f=events[_0xa61d('0x4')];_0x424483<_0x34096f;_0x424483++){var _0x50d8e0=events[_0x424483];var _0x462e57=createListener(_0xa61d('0x5')+_0x50d8e0,_0x4b0bce);DashboardItemEvents['on'](_0x50d8e0,_0x462e57);}}; \ No newline at end of file +var _0xfd86=['remove','update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x5f4b09,_0x35e0ab){var _0x138300=function(_0x15b7e9){while(--_0x15b7e9){_0x5f4b09['push'](_0x5f4b09['shift']());}};_0x138300(++_0x35e0ab);}(_0xfd86,0x97));var _0x6fd8=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0xfd86[_0x119d25];return _0x39cf30;};'use strict';var DashboardItemEvents=require(_0x6fd8('0x0'));var events=[_0x6fd8('0x1'),_0x6fd8('0x2'),_0x6fd8('0x3')];function createListener(_0xcbc73,_0x440957){return function(_0x1ab0ab){_0x440957[_0x6fd8('0x4')](_0xcbc73,_0x1ab0ab);};}function removeListener(_0x14c494,_0x23d595){return function(){DashboardItemEvents[_0x6fd8('0x5')](_0x14c494,_0x23d595);};}exports[_0x6fd8('0x6')]=function(_0x265295){for(var _0xdcab81=0x0,_0x330dd6=events[_0x6fd8('0x7')];_0xdcab81<_0x330dd6;_0xdcab81++){var _0x494f48=events[_0xdcab81];var _0x10581b=createListener(_0x6fd8('0x8')+_0x494f48,_0x265295);DashboardItemEvents['on'](_0x494f48,_0x10581b);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 61439f9..0696402 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 _0x5c3a=['destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','update'];(function(_0x468914,_0x3c68f3){var _0x3b08dd=function(_0x28d3bb){while(--_0x28d3bb){_0x468914['push'](_0x468914['shift']());}};_0x3b08dd(++_0x3c68f3);}(_0x5c3a,0x17b));var _0xa5c3=function(_0x1d49de,_0x44511a){_0x1d49de=_0x1d49de-0x0;var _0xb1e76c=_0x5c3a[_0x1d49de];return _0xb1e76c;};'use strict';var multer=require(_0xa5c3('0x0'));var util=require(_0xa5c3('0x1'));var path=require(_0xa5c3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa5c3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa5c3('0x4'));var interaction=require(_0xa5c3('0x5'));var config=require('../../config/environment');var controller=require(_0xa5c3('0x6'));router[_0xa5c3('0x7')](_0xa5c3('0x8'),auth[_0xa5c3('0x9')](),controller[_0xa5c3('0xa')]);router[_0xa5c3('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa5c3('0x8'),auth[_0xa5c3('0x9')](),controller[_0xa5c3('0xc')]);router['delete'](_0xa5c3('0x8'),auth[_0xa5c3('0x9')](),controller[_0xa5c3('0xd')]);module['exports']=router; \ No newline at end of file +var _0x95e7=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','update','destroy','exports'];(function(_0x166b14,_0x3ce1ce){var _0x5dc7c6=function(_0x43b519){while(--_0x43b519){_0x166b14['push'](_0x166b14['shift']());}};_0x5dc7c6(++_0x3ce1ce);}(_0x95e7,0x1db));var _0x795e=function(_0x2ad1ca,_0x2747a9){_0x2ad1ca=_0x2ad1ca-0x0;var _0x36a15a=_0x95e7[_0x2ad1ca];return _0x36a15a;};'use strict';var multer=require(_0x795e('0x0'));var util=require(_0x795e('0x1'));var path=require(_0x795e('0x2'));var timeout=require(_0x795e('0x3'));var express=require('express');var router=express[_0x795e('0x4')]();var fs_extra=require(_0x795e('0x5'));var auth=require(_0x795e('0x6'));var interaction=require(_0x795e('0x7'));var config=require(_0x795e('0x8'));var controller=require(_0x795e('0x9'));router[_0x795e('0xa')](_0x795e('0xb'),auth[_0x795e('0xc')](),controller[_0x795e('0xd')]);router['post']('/',auth[_0x795e('0xc')](),controller[_0x795e('0xe')]);router[_0x795e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x795e('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x795e('0x11')]);module[_0x795e('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 2872d05..3a9a874 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 _0xb18f=['ENUM','first','STRING','sequelize'];(function(_0x57fbc8,_0x5f1746){var _0xfcf1de=function(_0x368e6e){while(--_0x368e6e){_0x57fbc8['push'](_0x57fbc8['shift']());}};_0xfcf1de(++_0x5f1746);}(_0xb18f,0x123));var _0xfb18=function(_0x1cb8b7,_0x1d6c64){_0x1cb8b7=_0x1cb8b7-0x0;var _0x40b7c1=_0xb18f[_0x1cb8b7];return _0x40b7c1;};'use strict';var Sequelize=require(_0xfb18('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xfb18('0x1')](_0xfb18('0x2'),'second','third'),'allowNull':![],'defaultValue':_0xfb18('0x2')},'description':{'type':Sequelize[_0xfb18('0x3')]}}; \ No newline at end of file +var _0x9554=['first','second','sequelize','STRING'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x9554,0xde));var _0x4955=function(_0x48ef06,_0x4fe0ea){_0x48ef06=_0x48ef06-0x0;var _0x509ddc=_0x9554[_0x48ef06];return _0x509ddc;};'use strict';var Sequelize=require(_0x4955('0x0'));module['exports']={'name':{'type':Sequelize[_0x4955('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x4955('0x2'),_0x4955('0x3'),'third'),'allowNull':![],'defaultValue':_0x4955('0x2')},'description':{'type':Sequelize[_0x4955('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 26dcbe8..d735ce7 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 _0x6379=['sendStatus','error','stack','name','index','Disposition','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','include','findAll','rows','catch','params','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','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','Dispositions','UserProfileResource','then'];(function(_0x91bf8d,_0x2bea0b){var _0x1bf297=function(_0x4a4422){while(--_0x4a4422){_0x91bf8d['push'](_0x91bf8d['shift']());}};_0x1bf297(++_0x2bea0b);}(_0x6379,0x84));var _0x9637=function(_0x486f6b,_0x7db838){_0x486f6b=_0x486f6b-0x0;var _0x45c03c=_0x6379[_0x486f6b];return _0x45c03c;};'use strict';var emlformat=require(_0x9637('0x0'));var rimraf=require(_0x9637('0x1'));var zipdir=require(_0x9637('0x2'));var jsonpatch=require(_0x9637('0x3'));var rp=require(_0x9637('0x4'));var moment=require('moment');var BPromise=require(_0x9637('0x5'));var Mustache=require(_0x9637('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9637('0x7'));var csv=require(_0x9637('0x8'));var ejs=require(_0x9637('0x9'));var fs=require('fs');var fs_extra=require(_0x9637('0xa'));var _=require(_0x9637('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9637('0xc'));var deskjs=require(_0x9637('0xd'));var toCsv=require(_0x9637('0x8'));var querystring=require(_0x9637('0xe'));var Papa=require('papaparse');var Redis=require(_0x9637('0xf'));var authService=require(_0x9637('0x10'));var qs=require(_0x9637('0x11'));var as=require(_0x9637('0x12'));var hardwareService=require(_0x9637('0x13'));var logger=require(_0x9637('0x14'))(_0x9637('0x15'));var utils=require(_0x9637('0x16'));var config=require(_0x9637('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9637('0x18'))['db'];function respondWithStatusCode(_0x4f6167,_0x9c4e8c){_0x9c4e8c=_0x9c4e8c||0xcc;return function(_0x2bd4ae){if(_0x2bd4ae){return _0x4f6167['sendStatus'](_0x9c4e8c);}return _0x4f6167[_0x9637('0x19')](_0x9c4e8c)[_0x9637('0x1a')]();};}function respondWithResult(_0x2bbd4b,_0x46b419){_0x46b419=_0x46b419||0xc8;return function(_0x5ecb8a){if(_0x5ecb8a){return _0x2bbd4b[_0x9637('0x19')](_0x46b419)[_0x9637('0x1b')](_0x5ecb8a);}};}function respondWithFilteredResult(_0x2d5ea1,_0x316d3f){return function(_0x95d855){if(_0x95d855){var _0x59d035=typeof _0x316d3f[_0x9637('0x1c')]===_0x9637('0x1d')&&typeof _0x316d3f[_0x9637('0x1e')]===_0x9637('0x1d');var _0x10daf0=_0x95d855[_0x9637('0x1f')];var _0x465ac6=_0x59d035?0x0:_0x316d3f[_0x9637('0x1c')];var _0x27c7fd=_0x59d035?_0x95d855[_0x9637('0x1f')]:_0x316d3f['offset']+_0x316d3f['limit'];var _0x2b47b5;if(_0x27c7fd>=_0x10daf0){_0x27c7fd=_0x10daf0;_0x2b47b5=0xc8;}else{_0x2b47b5=0xce;}_0x2d5ea1[_0x9637('0x19')](_0x2b47b5);return _0x2d5ea1[_0x9637('0x20')](_0x9637('0x21'),_0x465ac6+'-'+_0x27c7fd+'/'+_0x10daf0)['json'](_0x95d855);}return null;};}function patchUpdates(_0x5935f1){return function(_0x5ad1b3){try{jsonpatch[_0x9637('0x22')](_0x5ad1b3,_0x5935f1,!![]);}catch(_0x34601a){return BPromise[_0x9637('0x23')](_0x34601a);}return _0x5ad1b3[_0x9637('0x24')]();};}function saveUpdates(_0x3121da,_0x578a20){return function(_0x4859a8){if(_0x4859a8){return _0x4859a8['update'](_0x3121da)['then'](function(_0x23b3bf){return _0x23b3bf;});}return null;};}function removeEntity(_0x1af78d,_0x3968ae){return function(_0x55319f){if(_0x55319f){return _0x55319f[_0x9637('0x25')]()['then'](function(){var _0x16c086=_0x55319f[_0x9637('0x26')]({'plain':!![]});var _0xd73547=_0x9637('0x27');return db[_0x9637('0x28')][_0x9637('0x25')]({'where':{'type':_0xd73547,'resourceId':_0x16c086['id']}})[_0x9637('0x29')](function(){return _0x55319f;});})[_0x9637('0x29')](function(){_0x1af78d[_0x9637('0x19')](0xcc)[_0x9637('0x1a')]();});}};}function handleEntityNotFound(_0x3174c2,_0x3b8801){return function(_0x392128){if(!_0x392128){_0x3174c2[_0x9637('0x2a')](0x194);}return _0x392128;};}function handleError(_0x53b889,_0x5a638c){_0x5a638c=_0x5a638c||0x1f4;return function(_0x314f30){logger[_0x9637('0x2b')](_0x314f30[_0x9637('0x2c')]);if(_0x314f30[_0x9637('0x2d')]){delete _0x314f30[_0x9637('0x2d')];}_0x53b889[_0x9637('0x19')](_0x5a638c)['send'](_0x314f30);};}exports[_0x9637('0x2e')]=function(_0x947884,_0x1c4d3a){var _0xb3c914={},_0x9675e4={},_0x457a78={'count':0x0,'rows':[]};var _0x531341=_['map'](db[_0x9637('0x2f')]['rawAttributes'],function(_0x16967c){return{'name':_0x16967c[_0x9637('0x30')],'type':_0x16967c[_0x9637('0x31')][_0x9637('0x32')]};});_0x9675e4[_0x9637('0x33')]=_['map'](_0x531341,_0x9637('0x2d'));_0x9675e4[_0x9637('0x34')]=_[_0x9637('0x35')](_0x947884[_0x9637('0x34')]);_0x9675e4[_0x9637('0x36')]=_[_0x9637('0x37')](_0x9675e4[_0x9637('0x33')],_0x9675e4[_0x9637('0x34')]);_0xb3c914[_0x9637('0x38')]=_[_0x9637('0x37')](_0x9675e4['model'],qs[_0x9637('0x39')](_0x947884['query'][_0x9637('0x39')]));_0xb3c914[_0x9637('0x38')]=_0xb3c914[_0x9637('0x38')][_0x9637('0x3a')]?_0xb3c914[_0x9637('0x38')]:_0x9675e4['model'];if(!_0x947884[_0x9637('0x34')][_0x9637('0x3b')](_0x9637('0x3c'))){_0xb3c914[_0x9637('0x1e')]=qs['limit'](_0x947884[_0x9637('0x34')][_0x9637('0x1e')]);_0xb3c914[_0x9637('0x1c')]=qs[_0x9637('0x1c')](_0x947884[_0x9637('0x34')][_0x9637('0x1c')]);}_0xb3c914[_0x9637('0x3d')]=qs[_0x9637('0x3e')](_0x947884['query'][_0x9637('0x3e')]);_0xb3c914[_0x9637('0x3f')]=qs[_0x9637('0x36')](_[_0x9637('0x40')](_0x947884[_0x9637('0x34')],_0x9675e4[_0x9637('0x36')]),_0x531341);if(_0x947884['query']['filter']){_0xb3c914['where']=_[_0x9637('0x41')](_0xb3c914[_0x9637('0x3f')],{'$or':_[_0x9637('0x42')](_0x531341,function(_0x46be73){if(_0x46be73['type']!==_0x9637('0x43')){var _0x740fab={};_0x740fab[_0x46be73[_0x9637('0x2d')]]={'$like':'%'+_0x947884[_0x9637('0x34')][_0x9637('0x44')]+'%'};return _0x740fab;}})});}_0xb3c914=_['merge']({},_0xb3c914,_0x947884[_0x9637('0x45')]);var _0x3ee560={'where':_0xb3c914[_0x9637('0x3f')]};return db[_0x9637('0x2f')]['count'](_0x3ee560)['then'](function(_0x14c9d4){_0x457a78['count']=_0x14c9d4;if(_0x947884[_0x9637('0x34')]['includeAll']){_0xb3c914[_0x9637('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x9637('0x47')](_0xb3c914);})[_0x9637('0x29')](function(_0x3b63ba){_0x457a78[_0x9637('0x48')]=_0x3b63ba;return _0x457a78;})[_0x9637('0x29')](respondWithFilteredResult(_0x1c4d3a,_0xb3c914))[_0x9637('0x49')](handleError(_0x1c4d3a,null));};exports['show']=function(_0x1b1116,_0x12aa02){var _0x55d57a={'raw':!![],'where':{'id':_0x1b1116[_0x9637('0x4a')]['id']}},_0x139a13={};_0x139a13['model']=_[_0x9637('0x35')](db[_0x9637('0x2f')]['rawAttributes']);_0x139a13[_0x9637('0x34')]=_[_0x9637('0x35')](_0x1b1116[_0x9637('0x34')]);_0x139a13['filters']=_[_0x9637('0x37')](_0x139a13[_0x9637('0x33')],_0x139a13[_0x9637('0x34')]);_0x55d57a[_0x9637('0x38')]=_[_0x9637('0x37')](_0x139a13[_0x9637('0x33')],qs[_0x9637('0x39')](_0x1b1116[_0x9637('0x34')]['fields']));_0x55d57a[_0x9637('0x38')]=_0x55d57a['attributes'][_0x9637('0x3a')]?_0x55d57a['attributes']:_0x139a13[_0x9637('0x33')];if(_0x1b1116['query'][_0x9637('0x4b')]){_0x55d57a['include']=[{'all':!![]}];}_0x55d57a=_['merge']({},_0x55d57a,_0x1b1116[_0x9637('0x45')]);return db['Disposition'][_0x9637('0x4c')](_0x55d57a)[_0x9637('0x29')](handleEntityNotFound(_0x12aa02,null))[_0x9637('0x29')](respondWithResult(_0x12aa02,null))['catch'](handleError(_0x12aa02,null));};exports['create']=function(_0x2505f7,_0x46edfb){return db[_0x9637('0x2f')][_0x9637('0x4d')](_0x2505f7[_0x9637('0x4e')],{})['then'](function(_0x2e9c7a){var _0x50870f=_0x2505f7[_0x9637('0x4f')][_0x9637('0x26')]({'plain':!![]});if(!_0x50870f)throw new Error(_0x9637('0x50'));if(_0x50870f[_0x9637('0x51')]===_0x9637('0x4f')){var _0x11c4b1=_0x2e9c7a['get']({'plain':!![]});var _0x369fbf=_0x9637('0x27');return db[_0x9637('0x52')][_0x9637('0x4c')]({'where':{'name':_0x369fbf,'userProfileId':_0x50870f[_0x9637('0x53')]},'raw':!![]})[_0x9637('0x29')](function(_0x2b14fc){if(_0x2b14fc&&_0x2b14fc[_0x9637('0x54')]===0x0){return db[_0x9637('0x28')][_0x9637('0x4d')]({'name':_0x11c4b1[_0x9637('0x2d')],'resourceId':_0x11c4b1['id'],'type':_0x2b14fc[_0x9637('0x2d')],'sectionId':_0x2b14fc['id']},{})['then'](function(){return _0x2e9c7a;});}else{return _0x2e9c7a;}})[_0x9637('0x49')](function(_0x4059f5){logger[_0x9637('0x2b')](_0x9637('0x55'),_0x4059f5);throw _0x4059f5;});}return _0x2e9c7a;})[_0x9637('0x29')](respondWithResult(_0x46edfb,0xc9))[_0x9637('0x49')](handleError(_0x46edfb,null));};exports[_0x9637('0x56')]=function(_0x4dcf62,_0x3d4f57){if(_0x4dcf62[_0x9637('0x4e')]['id']){delete _0x4dcf62[_0x9637('0x4e')]['id'];}return db[_0x9637('0x2f')][_0x9637('0x4c')]({'where':{'id':_0x4dcf62[_0x9637('0x4a')]['id']}})[_0x9637('0x29')](handleEntityNotFound(_0x3d4f57,null))[_0x9637('0x29')](saveUpdates(_0x4dcf62[_0x9637('0x4e')],null))['then'](respondWithResult(_0x3d4f57,null))[_0x9637('0x49')](handleError(_0x3d4f57,null));};exports['destroy']=function(_0x240028,_0x228b4b){return db[_0x9637('0x2f')][_0x9637('0x4c')]({'where':{'id':_0x240028[_0x9637('0x4a')]['id']}})[_0x9637('0x29')](handleEntityNotFound(_0x228b4b,null))['then'](removeEntity(_0x228b4b,null))['catch'](handleError(_0x228b4b,null));}; \ No newline at end of file +var _0x6a3b=['keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','where','includeAll','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','save','update','then','destroy','get','UserProfileResource','error','name','map','Disposition','rawAttributes','fieldName','type','key','query'];(function(_0x28b13e,_0x4ac886){var _0x230faf=function(_0x2e82d2){while(--_0x2e82d2){_0x28b13e['push'](_0x28b13e['shift']());}};_0x230faf(++_0x4ac886);}(_0x6a3b,0x16b));var _0xb6a3=function(_0xe32a81,_0x1c19c9){_0xe32a81=_0xe32a81-0x0;var _0xf3c98d=_0x6a3b[_0xe32a81];return _0xf3c98d;};'use strict';var emlformat=require(_0xb6a3('0x0'));var rimraf=require(_0xb6a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb6a3('0x2'));var rp=require('request-promise');var moment=require(_0xb6a3('0x3'));var BPromise=require(_0xb6a3('0x4'));var Mustache=require(_0xb6a3('0x5'));var util=require(_0xb6a3('0x6'));var path=require(_0xb6a3('0x7'));var sox=require(_0xb6a3('0x8'));var csv=require(_0xb6a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb6a3('0xa'));var _=require(_0xb6a3('0xb'));var squel=require(_0xb6a3('0xc'));var crypto=require(_0xb6a3('0xd'));var jsforce=require(_0xb6a3('0xe'));var deskjs=require(_0xb6a3('0xf'));var toCsv=require(_0xb6a3('0x9'));var querystring=require(_0xb6a3('0x10'));var Papa=require(_0xb6a3('0x11'));var Redis=require(_0xb6a3('0x12'));var authService=require(_0xb6a3('0x13'));var qs=require(_0xb6a3('0x14'));var as=require(_0xb6a3('0x15'));var hardwareService=require(_0xb6a3('0x16'));var logger=require(_0xb6a3('0x17'))(_0xb6a3('0x18'));var utils=require(_0xb6a3('0x19'));var config=require(_0xb6a3('0x1a'));var licenseUtil=require(_0xb6a3('0x1b'));var db=require(_0xb6a3('0x1c'))['db'];function respondWithStatusCode(_0x5ddf90,_0x39b40f){_0x39b40f=_0x39b40f||0xcc;return function(_0x56d093){if(_0x56d093){return _0x5ddf90[_0xb6a3('0x1d')](_0x39b40f);}return _0x5ddf90[_0xb6a3('0x1e')](_0x39b40f)[_0xb6a3('0x1f')]();};}function respondWithResult(_0x2432cf,_0x207b77){_0x207b77=_0x207b77||0xc8;return function(_0x4f5349){if(_0x4f5349){return _0x2432cf[_0xb6a3('0x1e')](_0x207b77)['json'](_0x4f5349);}};}function respondWithFilteredResult(_0x4bd362,_0x452a59){return function(_0x138f15){if(_0x138f15){var _0x240a0e=typeof _0x452a59[_0xb6a3('0x20')]===_0xb6a3('0x21')&&typeof _0x452a59[_0xb6a3('0x22')]===_0xb6a3('0x21');var _0x274abb=_0x138f15[_0xb6a3('0x23')];var _0x59bb56=_0x240a0e?0x0:_0x452a59[_0xb6a3('0x20')];var _0x55cf2a=_0x240a0e?_0x138f15[_0xb6a3('0x23')]:_0x452a59[_0xb6a3('0x20')]+_0x452a59[_0xb6a3('0x22')];var _0x26abf0;if(_0x55cf2a>=_0x274abb){_0x55cf2a=_0x274abb;_0x26abf0=0xc8;}else{_0x26abf0=0xce;}_0x4bd362[_0xb6a3('0x1e')](_0x26abf0);return _0x4bd362['set']('Content-Range',_0x59bb56+'-'+_0x55cf2a+'/'+_0x274abb)['json'](_0x138f15);}return null;};}function patchUpdates(_0xc1913d){return function(_0x1b9286){try{jsonpatch[_0xb6a3('0x24')](_0x1b9286,_0xc1913d,!![]);}catch(_0x522d78){return BPromise['reject'](_0x522d78);}return _0x1b9286[_0xb6a3('0x25')]();};}function saveUpdates(_0x2f3aaf,_0x429cdd){return function(_0x965dbb){if(_0x965dbb){return _0x965dbb[_0xb6a3('0x26')](_0x2f3aaf)[_0xb6a3('0x27')](function(_0x1a5d1d){return _0x1a5d1d;});}return null;};}function removeEntity(_0x346013,_0x577c8c){return function(_0x558860){if(_0x558860){return _0x558860[_0xb6a3('0x28')]()[_0xb6a3('0x27')](function(){var _0x487a34=_0x558860[_0xb6a3('0x29')]({'plain':!![]});var _0x59c6aa='Dispositions';return db[_0xb6a3('0x2a')][_0xb6a3('0x28')]({'where':{'type':_0x59c6aa,'resourceId':_0x487a34['id']}})[_0xb6a3('0x27')](function(){return _0x558860;});})[_0xb6a3('0x27')](function(){_0x346013['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fb4a,_0x2f5b06){return function(_0x28ebf5){if(!_0x28ebf5){_0x6fb4a[_0xb6a3('0x1d')](0x194);}return _0x28ebf5;};}function handleError(_0x5e6b0c,_0x5efea8){_0x5efea8=_0x5efea8||0x1f4;return function(_0x1b7793){logger[_0xb6a3('0x2b')](_0x1b7793['stack']);if(_0x1b7793[_0xb6a3('0x2c')]){delete _0x1b7793[_0xb6a3('0x2c')];}_0x5e6b0c[_0xb6a3('0x1e')](_0x5efea8)['send'](_0x1b7793);};}exports['index']=function(_0x3ce3ae,_0x24073e){var _0x1844aa={},_0x3e8ca2={},_0x1afb97={'count':0x0,'rows':[]};var _0x4c3cb4=_[_0xb6a3('0x2d')](db[_0xb6a3('0x2e')][_0xb6a3('0x2f')],function(_0x36adac){return{'name':_0x36adac[_0xb6a3('0x30')],'type':_0x36adac[_0xb6a3('0x31')][_0xb6a3('0x32')]};});_0x3e8ca2['model']=_['map'](_0x4c3cb4,_0xb6a3('0x2c'));_0x3e8ca2[_0xb6a3('0x33')]=_[_0xb6a3('0x34')](_0x3ce3ae[_0xb6a3('0x33')]);_0x3e8ca2[_0xb6a3('0x35')]=_['intersection'](_0x3e8ca2[_0xb6a3('0x36')],_0x3e8ca2[_0xb6a3('0x33')]);_0x1844aa[_0xb6a3('0x37')]=_[_0xb6a3('0x38')](_0x3e8ca2[_0xb6a3('0x36')],qs[_0xb6a3('0x39')](_0x3ce3ae['query'][_0xb6a3('0x39')]));_0x1844aa[_0xb6a3('0x37')]=_0x1844aa[_0xb6a3('0x37')][_0xb6a3('0x3a')]?_0x1844aa[_0xb6a3('0x37')]:_0x3e8ca2[_0xb6a3('0x36')];if(!_0x3ce3ae[_0xb6a3('0x33')]['hasOwnProperty'](_0xb6a3('0x3b'))){_0x1844aa[_0xb6a3('0x22')]=qs['limit'](_0x3ce3ae[_0xb6a3('0x33')][_0xb6a3('0x22')]);_0x1844aa[_0xb6a3('0x20')]=qs[_0xb6a3('0x20')](_0x3ce3ae[_0xb6a3('0x33')]['offset']);}_0x1844aa[_0xb6a3('0x3c')]=qs['sort'](_0x3ce3ae[_0xb6a3('0x33')][_0xb6a3('0x3d')]);_0x1844aa['where']=qs[_0xb6a3('0x35')](_[_0xb6a3('0x3e')](_0x3ce3ae[_0xb6a3('0x33')],_0x3e8ca2[_0xb6a3('0x35')]),_0x4c3cb4);if(_0x3ce3ae[_0xb6a3('0x33')]['filter']){_0x1844aa['where']=_['merge'](_0x1844aa['where'],{'$or':_[_0xb6a3('0x2d')](_0x4c3cb4,function(_0x11952e){if(_0x11952e[_0xb6a3('0x31')]!==_0xb6a3('0x3f')){var _0x24c18a={};_0x24c18a[_0x11952e[_0xb6a3('0x2c')]]={'$like':'%'+_0x3ce3ae[_0xb6a3('0x33')][_0xb6a3('0x40')]+'%'};return _0x24c18a;}})});}_0x1844aa=_[_0xb6a3('0x41')]({},_0x1844aa,_0x3ce3ae[_0xb6a3('0x42')]);var _0x208990={'where':_0x1844aa[_0xb6a3('0x43')]};return db[_0xb6a3('0x2e')][_0xb6a3('0x23')](_0x208990)[_0xb6a3('0x27')](function(_0x5d3898){_0x1afb97['count']=_0x5d3898;if(_0x3ce3ae['query'][_0xb6a3('0x44')]){_0x1844aa['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1844aa);})['then'](function(_0x3c4a10){_0x1afb97['rows']=_0x3c4a10;return _0x1afb97;})['then'](respondWithFilteredResult(_0x24073e,_0x1844aa))[_0xb6a3('0x45')](handleError(_0x24073e,null));};exports[_0xb6a3('0x46')]=function(_0x2f9c03,_0x428fa6){var _0x176d67={'raw':!![],'where':{'id':_0x2f9c03['params']['id']}},_0x4c04ed={};_0x4c04ed['model']=_[_0xb6a3('0x34')](db[_0xb6a3('0x2e')][_0xb6a3('0x2f')]);_0x4c04ed[_0xb6a3('0x33')]=_['keys'](_0x2f9c03['query']);_0x4c04ed[_0xb6a3('0x35')]=_[_0xb6a3('0x38')](_0x4c04ed['model'],_0x4c04ed[_0xb6a3('0x33')]);_0x176d67[_0xb6a3('0x37')]=_[_0xb6a3('0x38')](_0x4c04ed[_0xb6a3('0x36')],qs['fields'](_0x2f9c03[_0xb6a3('0x33')][_0xb6a3('0x39')]));_0x176d67['attributes']=_0x176d67[_0xb6a3('0x37')][_0xb6a3('0x3a')]?_0x176d67[_0xb6a3('0x37')]:_0x4c04ed[_0xb6a3('0x36')];if(_0x2f9c03[_0xb6a3('0x33')][_0xb6a3('0x44')]){_0x176d67[_0xb6a3('0x47')]=[{'all':!![]}];}_0x176d67=_[_0xb6a3('0x41')]({},_0x176d67,_0x2f9c03[_0xb6a3('0x42')]);return db[_0xb6a3('0x2e')]['find'](_0x176d67)[_0xb6a3('0x27')](handleEntityNotFound(_0x428fa6,null))[_0xb6a3('0x27')](respondWithResult(_0x428fa6,null))[_0xb6a3('0x45')](handleError(_0x428fa6,null));};exports[_0xb6a3('0x48')]=function(_0x1ab200,_0x4a189a){return db[_0xb6a3('0x2e')][_0xb6a3('0x48')](_0x1ab200[_0xb6a3('0x49')],{})[_0xb6a3('0x27')](function(_0x113386){var _0x1ddd3=_0x1ab200[_0xb6a3('0x4a')]['get']({'plain':!![]});if(!_0x1ddd3)throw new Error(_0xb6a3('0x4b'));if(_0x1ddd3[_0xb6a3('0x4c')]==='user'){var _0x247525=_0x113386[_0xb6a3('0x29')]({'plain':!![]});var _0x3faedd='Dispositions';return db[_0xb6a3('0x4d')][_0xb6a3('0x4e')]({'where':{'name':_0x3faedd,'userProfileId':_0x1ddd3[_0xb6a3('0x4f')]},'raw':!![]})[_0xb6a3('0x27')](function(_0x9064ba){if(_0x9064ba&&_0x9064ba[_0xb6a3('0x50')]===0x0){return db['UserProfileResource'][_0xb6a3('0x48')]({'name':_0x247525[_0xb6a3('0x2c')],'resourceId':_0x247525['id'],'type':_0x9064ba[_0xb6a3('0x2c')],'sectionId':_0x9064ba['id']},{})[_0xb6a3('0x27')](function(){return _0x113386;});}else{return _0x113386;}})[_0xb6a3('0x45')](function(_0x55353f){logger[_0xb6a3('0x2b')](_0xb6a3('0x51'),_0x55353f);throw _0x55353f;});}return _0x113386;})['then'](respondWithResult(_0x4a189a,0xc9))[_0xb6a3('0x45')](handleError(_0x4a189a,null));};exports['update']=function(_0x5ec6bc,_0x2ad0f4){if(_0x5ec6bc[_0xb6a3('0x49')]['id']){delete _0x5ec6bc[_0xb6a3('0x49')]['id'];}return db[_0xb6a3('0x2e')]['find']({'where':{'id':_0x5ec6bc[_0xb6a3('0x52')]['id']}})[_0xb6a3('0x27')](handleEntityNotFound(_0x2ad0f4,null))[_0xb6a3('0x27')](saveUpdates(_0x5ec6bc[_0xb6a3('0x49')],null))[_0xb6a3('0x27')](respondWithResult(_0x2ad0f4,null))[_0xb6a3('0x45')](handleError(_0x2ad0f4,null));};exports['destroy']=function(_0xb16186,_0x367c36){return db['Disposition'][_0xb6a3('0x4e')]({'where':{'id':_0xb16186['params']['id']}})[_0xb6a3('0x27')](handleEntityNotFound(_0x367c36,null))[_0xb6a3('0x27')](removeEntity(_0x367c36,null))['catch'](handleError(_0x367c36,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 279b737..3c85204 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 _0x6735=['../../config/environment','./disposition.attributes','exports','define','name','ListId','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a6933,_0x545202){var _0x55ae90=function(_0xb3acfa){while(--_0xb3acfa){_0x5a6933['push'](_0x5a6933['shift']());}};_0x55ae90(++_0x545202);}(_0x6735,0xc8));var _0x5673=function(_0x201a41,_0x11c7ba){_0x201a41=_0x201a41-0x0;var _0x10106f=_0x6735[_0x201a41];return _0x10106f;};'use strict';var _=require('lodash');var util=require(_0x5673('0x0'));var logger=require(_0x5673('0x1'))(_0x5673('0x2'));var moment=require(_0x5673('0x3'));var BPromise=require(_0x5673('0x4'));var rp=require(_0x5673('0x5'));var fs=require('fs');var path=require(_0x5673('0x6'));var rimraf=require('rimraf');var config=require(_0x5673('0x7'));var attributes=require(_0x5673('0x8'));module[_0x5673('0x9')]=function(_0x4700d7,_0x1fe059){return _0x4700d7[_0x5673('0xa')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x5673('0xb'),_0x5673('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x5673('0xb'),_0x5673('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0x5673('0xb'),_0x5673('0xe')]},{'unique':!![],'name':_0x5673('0xf'),'fields':[_0x5673('0xb'),_0x5673('0x10')]},{'unique':!![],'name':_0x5673('0x11'),'fields':[_0x5673('0xb'),_0x5673('0x12')]},{'unique':!![],'name':_0x5673('0x13'),'fields':['name',_0x5673('0x14')]},{'unique':!![],'name':_0x5673('0x15'),'fields':['name',_0x5673('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x07fa=['name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','api','moment','request-promise','path','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','name_fax','FaxAccountId'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x07fa,0x16c));var _0xa07f=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x07fa[_0x9c2427];return _0x51984f;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var logger=require('../../config/logger')(_0xa07f('0x1'));var moment=require(_0xa07f('0x2'));var BPromise=require('bluebird');var rp=require(_0xa07f('0x3'));var fs=require('fs');var path=require(_0xa07f('0x4'));var rimraf=require(_0xa07f('0x5'));var config=require('../../config/environment');var attributes=require(_0xa07f('0x6'));module[_0xa07f('0x7')]=function(_0x35181a,_0x2af074){return _0x35181a[_0xa07f('0x8')](_0xa07f('0x9'),attributes,{'tableName':_0xa07f('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa07f('0xb'),'fields':[_0xa07f('0xc'),_0xa07f('0xd')]},{'unique':!![],'name':_0xa07f('0xe'),'fields':[_0xa07f('0xc'),_0xa07f('0xf')]},{'unique':!![],'name':'name_mail','fields':['name',_0xa07f('0x10')]},{'unique':!![],'name':_0xa07f('0x11'),'fields':[_0xa07f('0xc'),'SmsAccountId']},{'unique':!![],'name':_0xa07f('0x12'),'fields':[_0xa07f('0xc'),_0xa07f('0x13')]},{'unique':!![],'name':_0xa07f('0x14'),'fields':[_0xa07f('0xc'),_0xa07f('0x15')]},{'unique':!![],'name':_0xa07f('0x16'),'fields':[_0xa07f('0xc'),_0xa07f('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 12a5bbd..1fb85c6 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(_0x13d6b8,_0x566a32){var _0x135e6b=function(_0x348514){while(--_0x348514){_0x13d6b8['push'](_0x13d6b8['shift']());}};_0x135e6b(++_0x566a32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x5dda8b,_0x36ecc7){var _0x2732dc=function(_0x1d9750){while(--_0x1d9750){_0x5dda8b['push'](_0x5dda8b['shift']());}};_0x2732dc(++_0x36ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 e8df71f..0cac314 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 _0x7644=['show','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./disposition.controller','get','isAuthenticated','index','/:id'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x7644,0xe2));var _0x4764=function(_0x1c6e9b,_0x4fec4c){_0x1c6e9b=_0x1c6e9b-0x0;var _0x33dd92=_0x7644[_0x1c6e9b];return _0x33dd92;};'use strict';var multer=require(_0x4764('0x0'));var util=require(_0x4764('0x1'));var path=require(_0x4764('0x2'));var timeout=require(_0x4764('0x3'));var express=require(_0x4764('0x4'));var router=express['Router']();var fs_extra=require(_0x4764('0x5'));var auth=require(_0x4764('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4764('0x7'));router[_0x4764('0x8')]('/',auth[_0x4764('0x9')](),controller[_0x4764('0xa')]);router['get'](_0x4764('0xb'),auth['isAuthenticated'](),controller[_0x4764('0xc')]);router['post']('/',auth[_0x4764('0x9')](),controller['create']);router[_0x4764('0xd')](_0x4764('0xb'),auth[_0x4764('0x9')](),controller[_0x4764('0xe')]);router[_0x4764('0xf')](_0x4764('0xb'),auth[_0x4764('0x9')](),controller[_0x4764('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3fb5=['/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','delete'];(function(_0x5c898f,_0x214d0c){var _0x5ba038=function(_0x4b1dea){while(--_0x4b1dea){_0x5c898f['push'](_0x5c898f['shift']());}};_0x5ba038(++_0x214d0c);}(_0x3fb5,0x1e3));var _0x53fb=function(_0x361f95,_0x5ec18f){_0x361f95=_0x361f95-0x0;var _0x255753=_0x3fb5[_0x361f95];return _0x255753;};'use strict';var multer=require(_0x53fb('0x0'));var util=require(_0x53fb('0x1'));var path=require(_0x53fb('0x2'));var timeout=require('connect-timeout');var express=require(_0x53fb('0x3'));var router=express[_0x53fb('0x4')]();var fs_extra=require(_0x53fb('0x5'));var auth=require(_0x53fb('0x6'));var interaction=require(_0x53fb('0x7'));var config=require(_0x53fb('0x8'));var controller=require(_0x53fb('0x9'));router[_0x53fb('0xa')]('/',auth[_0x53fb('0xb')](),controller[_0x53fb('0xc')]);router['get']('/:id',auth[_0x53fb('0xb')](),controller[_0x53fb('0xd')]);router[_0x53fb('0xe')]('/',auth[_0x53fb('0xb')](),controller[_0x53fb('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x53fb('0x10')](_0x53fb('0x11'),auth['isAuthenticated'](),controller[_0x53fb('0x12')]);module[_0x53fb('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a9c74ca..3b508ea 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 _0x2dae=['7200','12000','14400','9600','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0x2dae,0x10b));var _0xe2da=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0x2dae[_0x15942a];return _0x36a9fb;};'use strict';var Sequelize=require(_0xe2da('0x0'));module[_0xe2da('0x1')]={'name':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe2da('0x2')]},'ecm':{'type':Sequelize[_0xe2da('0x3')](_0xe2da('0x4'),'no'),'defaultValue':_0xe2da('0x4')},'headerinfo':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xe2da('0x6')},'minrate':{'type':Sequelize[_0xe2da('0x3')](_0xe2da('0x7'),_0xe2da('0x8'),_0xe2da('0x9'),'9600',_0xe2da('0xa'),_0xe2da('0xb')),'defaultValue':_0xe2da('0x8')},'maxrate':{'type':Sequelize[_0xe2da('0x3')](_0xe2da('0x7'),_0xe2da('0x8'),_0xe2da('0x9'),_0xe2da('0xc'),'12000','14400'),'defaultValue':_0xe2da('0xb')},'modem':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xd')},'gateway':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xe2da('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xe2da('0x3')](_0xe2da('0xf'),_0xe2da('0x10'),_0xe2da('0x11'),_0xe2da('0x12')),'defaultValue':_0xe2da('0xf')},'key':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe2da('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe2da('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe2da('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe2da('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe2da('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xe2da('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xe2da('0x13')],'defaultValue':![],'comment':_0xe2da('0x15'),'set':function(_0x2b4b1d){if(!_0x2b4b1d)this['setDataValue'](_0xe2da('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x2b4b1d);}}}; \ No newline at end of file +var _0x0200=['4800','9600','12000','14400','7200','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400'];(function(_0x271474,_0x248441){var _0x72f117=function(_0x4ad1b9){while(--_0x4ad1b9){_0x271474['push'](_0x271474['shift']());}};_0x72f117(++_0x248441);}(_0x0200,0x13c));var _0x0020=function(_0x191f9d,_0x21976f){_0x191f9d=_0x191f9d-0x0;var _0x58e60d=_0x0200[_0x191f9d];return _0x58e60d;};'use strict';var Sequelize=require(_0x0020('0x0'));module[_0x0020('0x1')]={'name':{'type':Sequelize[_0x0020('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0020('0x2')]},'ecm':{'type':Sequelize[_0x0020('0x3')](_0x0020('0x4'),'no'),'defaultValue':_0x0020('0x4')},'headerinfo':{'type':Sequelize[_0x0020('0x2')],'defaultValue':_0x0020('0x5')},'localstationid':{'type':Sequelize[_0x0020('0x2')],'unique':_0x0020('0x6')},'minrate':{'type':Sequelize[_0x0020('0x3')](_0x0020('0x7'),_0x0020('0x8'),'7200',_0x0020('0x9'),_0x0020('0xa'),_0x0020('0xb')),'defaultValue':_0x0020('0x8')},'maxrate':{'type':Sequelize[_0x0020('0x3')](_0x0020('0x7'),_0x0020('0x8'),_0x0020('0xc'),_0x0020('0x9'),_0x0020('0xa'),_0x0020('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x0020('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0020('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x0020('0xe'),_0x0020('0xf'),_0x0020('0x10'),_0x0020('0x11')),'defaultValue':_0x0020('0xe')},'key':{'type':Sequelize[_0x0020('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0020('0x12')],'defaultValue':function(){return _0x0020('0x13');}},'notificationSound':{'type':Sequelize[_0x0020('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0020('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0020('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0020('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0020('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0020('0x15')],'allowNull':!![],'defaultValue':null,'comment':_0x0020('0x16')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0020('0x17'),'set':function(_0x47447d){if(!_0x47447d)this[_0x0020('0x18')](_0x0020('0x19'),null);this[_0x0020('0x18')](_0x0020('0x1a'),_0x47447d);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 8e9ce8a..fdeeb16 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 _0x2454=['root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','filename','Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','omit','spread','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','FaxAccounts','UserProfileResource','destroy','end','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','FaxAccountId','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','ids','getInteractions','CmContact','User','Owner','fullname','internal','Tags','addApplications','findOne','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','system','description','Fax\x20Extension','appdata','push','Answer','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Set','Wait','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','findById','FaxMessage','$gte','split','CmList','List','Contacts','DESC','attachments','join'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x2454,0x1a2));var _0x4245=function(_0x5b0857,_0x6e33ec){_0x5b0857=_0x5b0857-0x0;var _0x2b7954=_0x2454[_0x5b0857];return _0x2b7954;};'use strict';var emlformat=require(_0x4245('0x0'));var rimraf=require(_0x4245('0x1'));var zipdir=require(_0x4245('0x2'));var jsonpatch=require(_0x4245('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4245('0x4'));var Mustache=require(_0x4245('0x5'));var util=require(_0x4245('0x6'));var path=require(_0x4245('0x7'));var sox=require(_0x4245('0x8'));var csv=require(_0x4245('0x9'));var ejs=require(_0x4245('0xa'));var fs=require('fs');var fs_extra=require(_0x4245('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4245('0xc'));var jsforce=require(_0x4245('0xd'));var deskjs=require(_0x4245('0xe'));var toCsv=require(_0x4245('0x9'));var querystring=require(_0x4245('0xf'));var Papa=require(_0x4245('0x10'));var Redis=require(_0x4245('0x11'));var authService=require(_0x4245('0x12'));var qs=require(_0x4245('0x13'));var as=require(_0x4245('0x14'));var hardwareService=require(_0x4245('0x15'));var logger=require(_0x4245('0x16'))(_0x4245('0x17'));var utils=require(_0x4245('0x18'));var config=require(_0x4245('0x19'));var licenseUtil=require(_0x4245('0x1a'));var db=require(_0x4245('0x1b'))['db'];config[_0x4245('0x1c')]=_['defaults'](config[_0x4245('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x4245('0x1d'))(new Redis(config['redis']));require(_0x4245('0x1e'))[_0x4245('0x1f')](socket);var jayson=require(_0x4245('0x20'));var client=jayson[_0x4245('0x21')][_0x4245('0x22')]({'port':0x232c});var client9002=jayson[_0x4245('0x21')][_0x4245('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x19f990,_0x5b13aa,_0x26cf23,_0xb3ecfe){return new BPromise(function(_0x202237,_0x5b1318){var _0xd1807c=_0xb3ecfe||client;return _0xd1807c[_0x4245('0x23')](_0x19f990,_0x26cf23)['then'](function(_0x302138){logger[_0x4245('0x24')](_0x4245('0x25'),_0x5b13aa,_0x4245('0x26'));logger[_0x4245('0x27')](_0x4245('0x28'),_0x5b13aa,_0x4245('0x26'),JSON[_0x4245('0x29')](_0x302138));if(_0x302138['error']){if(_0x302138[_0x4245('0x2a')][_0x4245('0x2b')]===0x1f4){logger[_0x4245('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x5b13aa,_0x302138[_0x4245('0x2a')]['message']);return _0x5b1318(_0x302138[_0x4245('0x2a')][_0x4245('0x2c')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x5b13aa,_0x302138['error'][_0x4245('0x2c')]);return _0x202237(_0x302138['error']['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x5b13aa,_0x4245('0x26'));_0x202237(_0x302138[_0x4245('0x2d')][_0x4245('0x2c')]);}})['catch'](function(_0xb89430){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5b13aa,_0xb89430);_0x5b1318(_0xb89430);});});}function respondWithStatusCode(_0x2bc730,_0x57567c){_0x57567c=_0x57567c||0xcc;return function(_0xd26911){if(_0xd26911){return _0x2bc730[_0x4245('0x2e')](_0x57567c);}return _0x2bc730[_0x4245('0x2f')](_0x57567c)['end']();};}function respondWithResult(_0x539465,_0x2e3cf6){_0x2e3cf6=_0x2e3cf6||0xc8;return function(_0x2c6e33){if(_0x2c6e33){return _0x539465['status'](_0x2e3cf6)[_0x4245('0x30')](_0x2c6e33);}};}function respondWithFilteredResult(_0x4b53d4,_0x4d8325){return function(_0xd91768){if(_0xd91768){var _0x4489f9=typeof _0x4d8325['offset']===_0x4245('0x31')&&typeof _0x4d8325[_0x4245('0x32')]===_0x4245('0x31');var _0x4fcc4a=_0xd91768[_0x4245('0x33')];var _0x38f011=_0x4489f9?0x0:_0x4d8325[_0x4245('0x34')];var _0xc9bef8=_0x4489f9?_0xd91768[_0x4245('0x33')]:_0x4d8325[_0x4245('0x34')]+_0x4d8325[_0x4245('0x32')];var _0x44e728;if(_0xc9bef8>=_0x4fcc4a){_0xc9bef8=_0x4fcc4a;_0x44e728=0xc8;}else{_0x44e728=0xce;}_0x4b53d4[_0x4245('0x2f')](_0x44e728);return _0x4b53d4[_0x4245('0x35')](_0x4245('0x36'),_0x38f011+'-'+_0xc9bef8+'/'+_0x4fcc4a)[_0x4245('0x30')](_0xd91768);}return null;};}function patchUpdates(_0x524067){return function(_0x5d3ec5){try{jsonpatch[_0x4245('0x37')](_0x5d3ec5,_0x524067,!![]);}catch(_0x4f90e8){return BPromise[_0x4245('0x38')](_0x4f90e8);}return _0x5d3ec5[_0x4245('0x39')]();};}function saveUpdates(_0x3ac829,_0x5a4ae7){return function(_0x48d229){if(_0x48d229){return _0x48d229[_0x4245('0x3a')](_0x3ac829)[_0x4245('0x3b')](function(_0x1d3650){return _0x1d3650;});}return null;};}function removeEntity(_0x1d87cc,_0x137bdd){return function(_0x3e2604){if(_0x3e2604){return _0x3e2604['destroy']()['then'](function(){var _0x828909=_0x3e2604['get']({'plain':!![]});var _0x530c00=_0x4245('0x3c');return db[_0x4245('0x3d')][_0x4245('0x3e')]({'where':{'type':_0x530c00,'resourceId':_0x828909['id']}})[_0x4245('0x3b')](function(){return _0x3e2604;});})[_0x4245('0x3b')](function(){_0x1d87cc[_0x4245('0x2f')](0xcc)[_0x4245('0x3f')]();});}};}function handleEntityNotFound(_0x2a5075,_0x9aa1ca){return function(_0x2d116b){if(!_0x2d116b){_0x2a5075[_0x4245('0x2e')](0x194);}return _0x2d116b;};}function handleError(_0x5b14aa,_0x58185e){_0x58185e=_0x58185e||0x1f4;return function(_0x2a6e34){logger[_0x4245('0x2a')](_0x2a6e34['stack']);if(_0x2a6e34[_0x4245('0x40')]){delete _0x2a6e34[_0x4245('0x40')];}_0x5b14aa[_0x4245('0x2f')](_0x58185e)[_0x4245('0x41')](_0x2a6e34);};}exports['index']=function(_0x30096d,_0x156b4e){var _0x218031={'include':[{'model':db[_0x4245('0x42')],'as':_0x4245('0x43')}]},_0x261025={},_0x4dab2b={'count':0x0,'rows':[]};var _0x438a36=_[_0x4245('0x44')](db[_0x4245('0x45')][_0x4245('0x46')],function(_0xe54c93){return{'name':_0xe54c93[_0x4245('0x47')],'type':_0xe54c93[_0x4245('0x48')][_0x4245('0x49')]};});_0x261025['model']=_['map'](_0x438a36,'name');_0x261025[_0x4245('0x4a')]=_[_0x4245('0x4b')](_0x30096d['query']);_0x261025[_0x4245('0x4c')]=_[_0x4245('0x4d')](_0x261025[_0x4245('0x4e')],_0x261025[_0x4245('0x4a')]);_0x218031[_0x4245('0x4f')]=_['intersection'](_0x261025['model'],qs['fields'](_0x30096d[_0x4245('0x4a')][_0x4245('0x50')]));_0x218031[_0x4245('0x4f')]=_0x218031[_0x4245('0x4f')][_0x4245('0x51')]?_0x218031[_0x4245('0x4f')]:_0x261025[_0x4245('0x4e')];if(!_0x30096d[_0x4245('0x4a')][_0x4245('0x52')](_0x4245('0x53'))){_0x218031[_0x4245('0x32')]=qs[_0x4245('0x32')](_0x30096d[_0x4245('0x4a')][_0x4245('0x32')]);_0x218031[_0x4245('0x34')]=qs['offset'](_0x30096d[_0x4245('0x4a')][_0x4245('0x34')]);}_0x218031[_0x4245('0x54')]=qs[_0x4245('0x55')](_0x30096d[_0x4245('0x4a')][_0x4245('0x55')]);_0x218031[_0x4245('0x56')]=qs['filters'](_[_0x4245('0x57')](_0x30096d[_0x4245('0x4a')],_0x261025[_0x4245('0x4c')]),_0x438a36);if(_0x30096d[_0x4245('0x4a')][_0x4245('0x58')]){_0x218031[_0x4245('0x56')]=_[_0x4245('0x59')](_0x218031[_0x4245('0x56')],{'$or':_[_0x4245('0x44')](_0x438a36,function(_0x27363b){if(_0x27363b[_0x4245('0x48')]!=='VIRTUAL'){var _0x76482b={};_0x76482b[_0x27363b[_0x4245('0x40')]]={'$like':'%'+_0x30096d[_0x4245('0x4a')][_0x4245('0x58')]+'%'};return _0x76482b;}})});}_0x218031=_[_0x4245('0x59')]({},_0x218031,_0x30096d[_0x4245('0x5a')]);var _0x48d108={'where':_0x218031['where']};return db[_0x4245('0x45')]['count'](_0x48d108)[_0x4245('0x3b')](function(_0x5a38c4){_0x4dab2b[_0x4245('0x33')]=_0x5a38c4;if(_0x30096d[_0x4245('0x4a')][_0x4245('0x5b')]){_0x218031[_0x4245('0x5c')]=[{'all':!![]}];}return db[_0x4245('0x45')][_0x4245('0x5d')](_0x218031);})[_0x4245('0x3b')](function(_0x1b99fd){_0x4dab2b['rows']=_0x1b99fd;return _0x4dab2b;})[_0x4245('0x3b')](respondWithFilteredResult(_0x156b4e,_0x218031))[_0x4245('0x5e')](handleError(_0x156b4e,null));};exports[_0x4245('0x5f')]=function(_0x45f6bb,_0x146e2b){var _0x9ef616={'raw':![],'where':{'id':_0x45f6bb[_0x4245('0x60')]['id']},'include':[{'model':db[_0x4245('0x42')],'as':'mandatoryDispositionPause'}]},_0x4785f2={};_0x4785f2[_0x4245('0x4e')]=_['keys'](db[_0x4245('0x45')]['rawAttributes']);_0x4785f2['query']=_[_0x4245('0x4b')](_0x45f6bb[_0x4245('0x4a')]);_0x4785f2[_0x4245('0x4c')]=_['intersection'](_0x4785f2[_0x4245('0x4e')],_0x4785f2[_0x4245('0x4a')]);_0x9ef616[_0x4245('0x4f')]=_[_0x4245('0x4d')](_0x4785f2[_0x4245('0x4e')],qs['fields'](_0x45f6bb[_0x4245('0x4a')][_0x4245('0x50')]));_0x9ef616[_0x4245('0x4f')]=_0x9ef616[_0x4245('0x4f')][_0x4245('0x51')]?_0x9ef616[_0x4245('0x4f')]:_0x4785f2[_0x4245('0x4e')];if(_0x45f6bb[_0x4245('0x4a')][_0x4245('0x5b')]){_0x9ef616['include']=[{'all':!![]}];}_0x9ef616=_['merge']({},_0x9ef616,_0x45f6bb[_0x4245('0x5a')]);return db[_0x4245('0x45')][_0x4245('0x61')](_0x9ef616)[_0x4245('0x3b')](handleEntityNotFound(_0x146e2b,null))[_0x4245('0x3b')](respondWithResult(_0x146e2b,null))['catch'](handleError(_0x146e2b,null));};exports[_0x4245('0x62')]=function(_0x3c9e53,_0x5f2165){return db[_0x4245('0x45')][_0x4245('0x62')](_0x3c9e53[_0x4245('0x63')],{})[_0x4245('0x3b')](function(_0x4fa592){var _0x2e2813=_0x3c9e53[_0x4245('0x64')][_0x4245('0x65')]({'plain':!![]});if(!_0x2e2813)throw new Error(_0x4245('0x66'));if(_0x2e2813[_0x4245('0x67')]===_0x4245('0x64')){var _0x1cb290=_0x4fa592[_0x4245('0x65')]({'plain':!![]});var _0x22559b=_0x4245('0x3c');return db['UserProfileSection'][_0x4245('0x61')]({'where':{'name':_0x22559b,'userProfileId':_0x2e2813['userProfileId']},'raw':!![]})['then'](function(_0x1e7914){if(_0x1e7914&&_0x1e7914[_0x4245('0x68')]===0x0){return db[_0x4245('0x3d')]['create']({'name':_0x1cb290[_0x4245('0x40')],'resourceId':_0x1cb290['id'],'type':_0x1e7914['name'],'sectionId':_0x1e7914['id']},{})[_0x4245('0x3b')](function(){return _0x4fa592;});}else{return _0x4fa592;}})[_0x4245('0x5e')](function(_0x2cda35){logger[_0x4245('0x2a')](_0x4245('0x69'),_0x2cda35);throw _0x2cda35;});}return _0x4fa592;})[_0x4245('0x3b')](respondWithResult(_0x5f2165,0xc9))[_0x4245('0x5e')](handleError(_0x5f2165,null));};exports['update']=function(_0x356ed4,_0xa50a0){if(_0x356ed4[_0x4245('0x63')]['id']){delete _0x356ed4[_0x4245('0x63')]['id'];}return db['FaxAccount'][_0x4245('0x61')]({'where':{'id':_0x356ed4[_0x4245('0x60')]['id']},'include':[{'model':db[_0x4245('0x42')],'as':_0x4245('0x43')}]})[_0x4245('0x3b')](handleEntityNotFound(_0xa50a0,null))[_0x4245('0x3b')](saveUpdates(_0x356ed4[_0x4245('0x63')],null))['then'](respondWithResult(_0xa50a0,null))[_0x4245('0x5e')](handleError(_0xa50a0,null));};exports[_0x4245('0x3e')]=function(_0x1efcce,_0x4d9ea1){return db[_0x4245('0x45')][_0x4245('0x61')]({'where':{'id':_0x1efcce[_0x4245('0x60')]['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x4d9ea1,null))[_0x4245('0x3b')](removeEntity(_0x4d9ea1,null))[_0x4245('0x5e')](handleError(_0x4d9ea1,null));};exports[_0x4245('0x6a')]=function(_0x208ebf,_0x4bd879){return db[_0x4245('0x45')][_0x4245('0x6a')]()[_0x4245('0x3b')](respondWithResult(_0x4bd879,null))['catch'](handleError(_0x4bd879,null));};exports[_0x4245('0x6b')]=function(_0x384759,_0xc017d6,_0x5f2419){if(_0x384759[_0x4245('0x63')]['id']){delete _0x384759[_0x4245('0x63')]['id'];}return db['FaxAccount'][_0x4245('0x61')]({'where':{'id':_0x384759['params']['id']}})['then'](handleEntityNotFound(_0xc017d6,null))[_0x4245('0x3b')](function(_0x1a1103){if(_0x1a1103){_0x384759[_0x4245('0x63')]['FaxAccountId']=_0x1a1103['id'];return db[_0x4245('0x6c')][_0x4245('0x62')](_0x384759[_0x4245('0x63')]);}})[_0x4245('0x3b')](respondWithResult(_0xc017d6,null))['catch'](handleError(_0xc017d6,null));};exports['getDispositions']=function(_0x3b461a,_0x16d320,_0x55f123){var _0x2859ca={'raw':![],'where':{}};var _0x1145d1={};var _0x508efd={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3b461a[_0x4245('0x60')]['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x16d320,null))['then'](function(_0x4e2b7b){if(_0x4e2b7b){_0x1145d1[_0x4245('0x4e')]=_[_0x4245('0x4b')](db[_0x4245('0x6c')]['rawAttributes']);_0x1145d1[_0x4245('0x4a')]=_['keys'](_0x3b461a[_0x4245('0x4a')]);_0x1145d1[_0x4245('0x4c')]=_[_0x4245('0x4d')](_0x1145d1[_0x4245('0x4e')],_0x1145d1[_0x4245('0x4a')]);_0x2859ca[_0x4245('0x4f')]=_[_0x4245('0x4d')](_0x1145d1['model'],qs['fields'](_0x3b461a[_0x4245('0x4a')][_0x4245('0x50')]));_0x2859ca[_0x4245('0x4f')]=_0x2859ca[_0x4245('0x4f')][_0x4245('0x51')]?_0x2859ca[_0x4245('0x4f')]:_0x1145d1['model'];if(!_0x3b461a['query'][_0x4245('0x52')](_0x4245('0x53'))){_0x2859ca[_0x4245('0x32')]=qs[_0x4245('0x32')](_0x3b461a['query'][_0x4245('0x32')]);_0x2859ca[_0x4245('0x34')]=qs[_0x4245('0x34')](_0x3b461a[_0x4245('0x4a')][_0x4245('0x34')]);}_0x2859ca[_0x4245('0x54')]=qs[_0x4245('0x55')](_0x3b461a[_0x4245('0x4a')][_0x4245('0x55')]);_0x2859ca[_0x4245('0x56')]=qs[_0x4245('0x4c')](_[_0x4245('0x57')](_0x3b461a['query'],_0x1145d1[_0x4245('0x4c')]));_0x2859ca[_0x4245('0x56')][_0x4245('0x6d')]=_0x4e2b7b['id'];if(_0x3b461a[_0x4245('0x4a')][_0x4245('0x58')]){_0x2859ca[_0x4245('0x56')]=_[_0x4245('0x59')](_0x2859ca[_0x4245('0x56')],{'$or':_[_0x4245('0x44')](_0x2859ca[_0x4245('0x4f')],function(_0x3d5973){var _0x518da3={};_0x518da3[_0x3d5973]={'$like':'%'+_0x3b461a['query']['filter']+'%'};return _0x518da3;})});}_0x2859ca=_[_0x4245('0x59')]({},_0x2859ca,_0x3b461a[_0x4245('0x5a')]);return db[_0x4245('0x6c')][_0x4245('0x33')]({'where':_0x2859ca['where']})['then'](function(_0x20564b){_0x508efd['count']=_0x20564b;if(_0x3b461a['query'][_0x4245('0x5b')]){_0x2859ca[_0x4245('0x5c')]=[{'all':!![]}];}return db[_0x4245('0x6c')][_0x4245('0x5d')](_0x2859ca);})[_0x4245('0x3b')](function(_0x3b444b){_0x508efd[_0x4245('0x6e')]=_0x3b444b;return _0x508efd;});}})[_0x4245('0x3b')](respondWithFilteredResult(_0x16d320,_0x2859ca))[_0x4245('0x5e')](handleError(_0x16d320,null));};exports[_0x4245('0x6f')]=function(_0x55b28f,_0xbe9f09,_0x2df808){return db['FaxAccount'][_0x4245('0x61')]({'where':{'id':_0x55b28f[_0x4245('0x60')]['id']}})['then'](handleEntityNotFound(_0xbe9f09,null))[_0x4245('0x3b')](function(_0x1a6d91){if(_0x1a6d91){return _0x1a6d91[_0x4245('0x6f')](_0x55b28f[_0x4245('0x4a')]['ids']);}})[_0x4245('0x3b')](respondWithStatusCode(_0xbe9f09,null))[_0x4245('0x5e')](handleError(_0xbe9f09,null));};exports['addAnswer']=function(_0x1c3374,_0x116049,_0x2eec22){if(_0x1c3374[_0x4245('0x63')]['id']){delete _0x1c3374[_0x4245('0x63')]['id'];}return db[_0x4245('0x45')][_0x4245('0x61')]({'where':{'id':_0x1c3374[_0x4245('0x60')]['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x116049,null))[_0x4245('0x3b')](function(_0x27cce7){if(_0x27cce7){_0x1c3374[_0x4245('0x63')][_0x4245('0x6d')]=_0x27cce7['id'];return db[_0x4245('0x70')]['create'](_0x1c3374[_0x4245('0x63')]);}})['then'](respondWithResult(_0x116049,null))[_0x4245('0x5e')](handleError(_0x116049,null));};exports[_0x4245('0x71')]=function(_0x2b3229,_0x39c3c1,_0x594d01){var _0x449e8c={'raw':![],'where':{}};var _0x57e638={};var _0x4a111a={'count':0x0,'rows':[]};return db[_0x4245('0x45')]['findOne']({'where':{'id':_0x2b3229[_0x4245('0x60')]['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x39c3c1,null))[_0x4245('0x3b')](function(_0xab7d83){if(_0xab7d83){_0x57e638['model']=_[_0x4245('0x4b')](db['CannedAnswer'][_0x4245('0x46')]);_0x57e638[_0x4245('0x4a')]=_['keys'](_0x2b3229[_0x4245('0x4a')]);_0x57e638[_0x4245('0x4c')]=_[_0x4245('0x4d')](_0x57e638['model'],_0x57e638['query']);_0x449e8c[_0x4245('0x4f')]=_[_0x4245('0x4d')](_0x57e638[_0x4245('0x4e')],qs['fields'](_0x2b3229[_0x4245('0x4a')]['fields']));_0x449e8c[_0x4245('0x4f')]=_0x449e8c[_0x4245('0x4f')][_0x4245('0x51')]?_0x449e8c[_0x4245('0x4f')]:_0x57e638[_0x4245('0x4e')];if(!_0x2b3229['query'][_0x4245('0x52')]('nolimit')){_0x449e8c[_0x4245('0x32')]=qs['limit'](_0x2b3229[_0x4245('0x4a')][_0x4245('0x32')]);_0x449e8c['offset']=qs['offset'](_0x2b3229[_0x4245('0x4a')]['offset']);}_0x449e8c['order']=qs[_0x4245('0x55')](_0x2b3229[_0x4245('0x4a')][_0x4245('0x55')]);_0x449e8c[_0x4245('0x56')]=qs[_0x4245('0x4c')](_[_0x4245('0x57')](_0x2b3229[_0x4245('0x4a')],_0x57e638['filters']));_0x449e8c[_0x4245('0x56')][_0x4245('0x6d')]=_0xab7d83['id'];if(_0x2b3229['query'][_0x4245('0x58')]){_0x449e8c[_0x4245('0x56')]=_[_0x4245('0x59')](_0x449e8c['where'],{'$or':_[_0x4245('0x44')](_0x449e8c[_0x4245('0x4f')],function(_0x1e26e0){var _0x2930dc={};_0x2930dc[_0x1e26e0]={'$like':'%'+_0x2b3229[_0x4245('0x4a')][_0x4245('0x58')]+'%'};return _0x2930dc;})});}_0x449e8c=_[_0x4245('0x59')]({},_0x449e8c,_0x2b3229[_0x4245('0x5a')]);return db[_0x4245('0x70')][_0x4245('0x33')]({'where':_0x449e8c['where']})[_0x4245('0x3b')](function(_0x30f064){_0x4a111a[_0x4245('0x33')]=_0x30f064;if(_0x2b3229[_0x4245('0x4a')][_0x4245('0x5b')]){_0x449e8c[_0x4245('0x5c')]=[{'all':!![]}];}return db[_0x4245('0x70')][_0x4245('0x5d')](_0x449e8c);})['then'](function(_0x8d8cf5){_0x4a111a[_0x4245('0x6e')]=_0x8d8cf5;return _0x4a111a;});}})[_0x4245('0x3b')](respondWithFilteredResult(_0x39c3c1,_0x449e8c))[_0x4245('0x5e')](handleError(_0x39c3c1,null));};exports['removeAnswers']=function(_0x16f7da,_0x597524,_0x1f2f50){return db[_0x4245('0x45')]['find']({'where':{'id':_0x16f7da['params']['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x597524,null))[_0x4245('0x3b')](function(_0x47ac03){if(_0x47ac03){return _0x47ac03[_0x4245('0x72')](_0x16f7da[_0x4245('0x4a')]['ids']);}})[_0x4245('0x3b')](respondWithStatusCode(_0x597524,null))[_0x4245('0x5e')](handleError(_0x597524,null));};exports[_0x4245('0x73')]=function(_0x1152dd,_0x2a42b8,_0x2a481d){return db[_0x4245('0x74')][_0x4245('0x61')]({'where':{'id':_0x1152dd['params']['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x2a42b8,null))[_0x4245('0x3b')](function(_0x66f763){if(_0x66f763){return _0x66f763[_0x4245('0x73')](_0x1152dd[_0x4245('0x63')][_0x4245('0x75')],_['omit'](_0x1152dd['body'],['ids','id'])||{});}})[_0x4245('0x3b')](respondWithResult(_0x2a42b8,null))[_0x4245('0x5e')](handleError(_0x2a42b8,null));};exports[_0x4245('0x76')]=function(_0x1262f6,_0x6efb02,_0x1b9b39){var _0x90f927={'raw':![],'where':{}};var _0x414d11={};var _0x2cec06={'count':0x0,'rows':[]};return db[_0x4245('0x45')]['findOne']({'where':{'id':_0x1262f6['params']['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x6efb02,null))[_0x4245('0x3b')](function(_0x350570){if(_0x350570){_0x414d11[_0x4245('0x4e')]=_[_0x4245('0x4b')](db[_0x4245('0x74')][_0x4245('0x46')]);_0x414d11['query']=_[_0x4245('0x4b')](_0x1262f6['query']);_0x414d11[_0x4245('0x4c')]=_[_0x4245('0x4d')](_0x414d11[_0x4245('0x4e')],_0x414d11['query']);_0x90f927[_0x4245('0x4f')]=_[_0x4245('0x4d')](_0x414d11[_0x4245('0x4e')],qs['fields'](_0x1262f6[_0x4245('0x4a')][_0x4245('0x50')]));_0x90f927[_0x4245('0x4f')]=_0x90f927[_0x4245('0x4f')][_0x4245('0x51')]?_0x90f927[_0x4245('0x4f')]:_0x414d11['model'];if(!_0x1262f6[_0x4245('0x4a')]['hasOwnProperty']('nolimit')){_0x90f927[_0x4245('0x32')]=qs['limit'](_0x1262f6[_0x4245('0x4a')][_0x4245('0x32')]);_0x90f927[_0x4245('0x34')]=qs['offset'](_0x1262f6[_0x4245('0x4a')][_0x4245('0x34')]);}_0x90f927['order']=qs[_0x4245('0x55')](_0x1262f6['query'][_0x4245('0x55')]);_0x90f927[_0x4245('0x56')]=qs[_0x4245('0x4c')](_[_0x4245('0x57')](_0x1262f6[_0x4245('0x4a')],_0x414d11[_0x4245('0x4c')]));_0x90f927[_0x4245('0x56')][_0x4245('0x6d')]=_0x350570['id'];if(_0x1262f6[_0x4245('0x4a')][_0x4245('0x58')]){_0x90f927[_0x4245('0x56')]=_[_0x4245('0x59')](_0x90f927[_0x4245('0x56')],{'$or':_['map'](_0x90f927['attributes'],function(_0x5470d4){var _0x1868b6={};_0x1868b6[_0x5470d4]={'$like':'%'+_0x1262f6[_0x4245('0x4a')][_0x4245('0x58')]+'%'};return _0x1868b6;})});}_0x90f927=_['merge']({},_0x90f927,_0x1262f6[_0x4245('0x5a')]);return db[_0x4245('0x74')][_0x4245('0x33')]({'where':_0x90f927[_0x4245('0x56')]})[_0x4245('0x3b')](function(_0x1ef39c){_0x2cec06[_0x4245('0x33')]=_0x1ef39c;if(_0x1262f6['query'][_0x4245('0x5b')]){_0x90f927[_0x4245('0x5c')]=[{'model':db[_0x4245('0x77')],'as':'Contact','required':![]},{'model':db[_0x4245('0x78')],'as':_0x4245('0x79'),'attributes':[_0x4245('0x40'),_0x4245('0x7a'),_0x4245('0x7b')],'required':![]},{'model':db['Tag'],'as':_0x4245('0x7c'),'attributes':['id',_0x4245('0x40'),'color'],'where':_0x1262f6[_0x4245('0x4a')]['tag']?{'id':_0x1262f6[_0x4245('0x4a')]['tag']}:undefined,'required':_0x1262f6['query']['tag']?!![]:![]}];}return db[_0x4245('0x74')]['findAll'](_0x90f927);})[_0x4245('0x3b')](function(_0x34a0c8){_0x2cec06[_0x4245('0x6e')]=_0x34a0c8;return _0x2cec06;});}})[_0x4245('0x3b')](respondWithFilteredResult(_0x6efb02,_0x90f927))[_0x4245('0x5e')](handleError(_0x6efb02,null));};exports[_0x4245('0x7d')]=function(_0x2b685c,_0x4ad550,_0x383899){return db[_0x4245('0x45')][_0x4245('0x7e')]({'where':{'id':_0x2b685c[_0x4245('0x60')]['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x4ad550,null))[_0x4245('0x3b')](function(_0x5f2885){if(_0x5f2885){return db[_0x4245('0x7f')][_0x4245('0x80')](function(_0x41887f){return db[_0x4245('0x81')][_0x4245('0x3e')]({'where':{'FaxAccountId':_0x2b685c['params']['id']},'transaction':_0x41887f})[_0x4245('0x3b')](function(_0x1148e3){var _0x59b838=_[_0x4245('0x44')](_0x2b685c['body'],function(_0x3c3592){_0x3c3592[_0x4245('0x6d')]=_0x2b685c['params']['id'];return _0x3c3592;});return db[_0x4245('0x81')][_0x4245('0x82')](_0x59b838,{'transaction':_0x41887f});});})[_0x4245('0x3b')](function(){return db[_0x4245('0x81')][_0x4245('0x83')]({'where':{'FaxAccountId':_0x2b685c[_0x4245('0x60')]['id']},'order':_0x4245('0x84')});});}})[_0x4245('0x3b')](respondWithResult(_0x4ad550,null))['catch'](handleError(_0x4ad550,null));};exports['getApplications']=function(_0x4c1f26,_0x2a8e88,_0x247076){var _0x1b2a8d={};var _0x5bc1de={};var _0x1c4018;var _0x3a69da;return db[_0x4245('0x45')][_0x4245('0x7e')]({'where':{'id':_0x4c1f26[_0x4245('0x60')]['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x2a8e88,null))[_0x4245('0x3b')](function(_0x19505e){if(_0x19505e){_0x1c4018=_0x19505e;_0x5bc1de[_0x4245('0x4e')]=_[_0x4245('0x4b')](db[_0x4245('0x81')][_0x4245('0x46')]);_0x5bc1de[_0x4245('0x4a')]=_['keys'](_0x4c1f26['query']);_0x5bc1de[_0x4245('0x4c')]=_['intersection'](_0x5bc1de[_0x4245('0x4e')],_0x5bc1de[_0x4245('0x4a')]);_0x1b2a8d[_0x4245('0x4f')]=_[_0x4245('0x4d')](_0x5bc1de['model'],qs[_0x4245('0x50')](_0x4c1f26['query'][_0x4245('0x50')]));_0x1b2a8d[_0x4245('0x4f')]=_0x1b2a8d[_0x4245('0x4f')][_0x4245('0x51')]?_0x1b2a8d[_0x4245('0x4f')]:_0x5bc1de[_0x4245('0x4e')];_0x1b2a8d[_0x4245('0x54')]=qs[_0x4245('0x55')](_0x4c1f26[_0x4245('0x4a')][_0x4245('0x55')]);_0x1b2a8d[_0x4245('0x56')]=qs[_0x4245('0x4c')](_[_0x4245('0x57')](_0x4c1f26['query'],_0x5bc1de[_0x4245('0x4c')]));if(_0x4c1f26['query']['filter']){_0x1b2a8d[_0x4245('0x56')]=_[_0x4245('0x59')](_0x1b2a8d[_0x4245('0x56')],{'$or':_['map'](_0x1b2a8d[_0x4245('0x4f')],function(_0x4a8789){var _0x5160c5={};_0x5160c5[_0x4a8789]={'$like':'%'+_0x4c1f26['query'][_0x4245('0x58')]+'%'};return _0x5160c5;})});}_0x1b2a8d=_[_0x4245('0x59')]({},_0x1b2a8d,_0x4c1f26['options']);return _0x1c4018['getApplications'](_0x1b2a8d);}})[_0x4245('0x3b')](function(_0x38a587){if(_0x38a587){_0x3a69da=_0x38a587[_0x4245('0x51')];if(!_0x4c1f26[_0x4245('0x4a')][_0x4245('0x52')](_0x4245('0x53'))){_0x1b2a8d[_0x4245('0x32')]=qs[_0x4245('0x32')](_0x4c1f26[_0x4245('0x4a')][_0x4245('0x32')]);_0x1b2a8d[_0x4245('0x34')]=qs['offset'](_0x4c1f26[_0x4245('0x4a')]['offset']);}return _0x1c4018[_0x4245('0x85')](_0x1b2a8d);}})['then'](function(_0x49a059){if(_0x49a059){return _0x49a059?{'count':_0x3a69da,'rows':_0x49a059}:null;}})['then'](respondWithResult(_0x2a8e88,null))[_0x4245('0x5e')](handleError(_0x2a8e88,null));};function Extension(_0x40c953,_0x925fe0,_0x254f55,_0x1f22ba){this[_0x4245('0x86')]=_0x4245('0x87');this[_0x4245('0x88')]=_0x40c953['localstationid'];this['app']=_0x1f22ba;this[_0x4245('0x48')]=_0x4245('0x89');this[_0x4245('0x8a')]=_0x4245('0x8b');this['FaxAccountId']=_0x40c953['id'];this['priority']=_0x925fe0;this[_0x4245('0x8c')]=_0x254f55;}function createExtensionsReciveFax(_0x1b49b3){var _0x368186=0x1;var _0x1e405a=[];_0x1e405a[_0x4245('0x8d')](new Extension(_0x1b49b3,_0x368186,'',_0x4245('0x8e')));_0x368186+=0x1;_0x1e405a[_0x4245('0x8d')](new Extension(_0x1b49b3,_0x368186,'CDR(type)=inbound-fax','Set'));_0x368186+=0x1;for(var _0x47c476 in _0x1b49b3){if(_0x1b49b3[_0x4245('0x52')](_0x47c476)&&(_0x47c476==='ecm'||_0x47c476===_0x4245('0x8f')||_0x47c476===_0x4245('0x90')||_0x47c476===_0x4245('0x91')||_0x47c476===_0x4245('0x92')||_0x47c476===_0x4245('0x93')||_0x47c476===_0x4245('0x94')||_0x47c476===_0x4245('0x95')||_0x47c476===_0x4245('0x96'))){_0x1e405a[_0x4245('0x8d')](new Extension(_0x1b49b3,_0x368186,'FAXOPT('+_0x47c476+')='+_0x1b49b3[_0x47c476],_0x4245('0x97')));_0x368186+=0x1;}}_0x1e405a['push'](new Extension(_0x1b49b3,_0x368186,'6',_0x4245('0x98')));_0x368186+=0x1;_0x1e405a['push'](new Extension(_0x1b49b3,_0x368186,'/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'));_0x368186=0x0;return _0x1e405a;}exports[_0x4245('0x99')]=function(_0x3644c0,_0x3c5726,_0x137d5e){var _0x21df84;return db[_0x4245('0x7f')]['transaction'](function(_0xb2a97f){return db[_0x4245('0x45')][_0x4245('0x62')](_0x3644c0['body'],{'transaction':_0xb2a97f})[_0x4245('0x3b')](function(_0x462520){_0x21df84=_0x462520['get']({'plain':!![]});return db[_0x4245('0x9a')][_0x4245('0x82')](createExtensionsReciveFax(_0x21df84),{'transaction':_0xb2a97f});});})[_0x4245('0x3b')](function(){return _0x21df84;})['then'](respondWithResult(_0x3c5726,null))[_0x4245('0x5e')](handleError(_0x3c5726,null));};exports[_0x4245('0x9b')]=function(_0x16655e,_0x25b86e,_0x4b1aa1){var _0x1b9d0c;return db[_0x4245('0x7f')][_0x4245('0x80')](function(_0x24c630){return db[_0x4245('0x45')][_0x4245('0x3a')](_0x16655e[_0x4245('0x63')],{'where':{'id':_0x16655e[_0x4245('0x63')]['id']},'transaction':_0x24c630})[_0x4245('0x3b')](function(_0x2fdb9c){return db[_0x4245('0x9a')]['destroy']({'where':{'FaxAccountId':_0x16655e[_0x4245('0x63')]['id']},'transaction':_0x24c630})['then'](function(_0x44dc31){return db[_0x4245('0x9a')][_0x4245('0x82')](createExtensionsReciveFax(_['omit'](_0x16655e['body'],[_0x4245('0x9c'),'key',_0x4245('0x9d'),'updatedAt',_0x4245('0x9e'),_0x4245('0x9f')])),{'transaction':_0x24c630});});});})[_0x4245('0x3b')](function(){return db[_0x4245('0x45')][_0x4245('0xa0')](_0x16655e[_0x4245('0x63')]['id']);})[_0x4245('0x3b')](respondWithResult(_0x25b86e,null))[_0x4245('0x5e')](handleError(_0x25b86e,null));};exports['getMessages']=function(_0x3024d2,_0x36c378,_0x3c4a04){var _0x460cc6={'raw':!![],'where':{}};var _0x334437={};var _0xf2332b={'count':0x0,'rows':[]};return db[_0x4245('0x45')][_0x4245('0x7e')]({'where':{'id':_0x3024d2[_0x4245('0x60')]['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x36c378,null))[_0x4245('0x3b')](function(_0x287312){if(_0x287312){_0x334437['model']=_[_0x4245('0x4b')](db[_0x4245('0xa1')][_0x4245('0x46')]);_0x334437['query']=_[_0x4245('0x4b')](_0x3024d2[_0x4245('0x4a')]);_0x334437[_0x4245('0x4c')]=_['intersection'](_0x334437[_0x4245('0x4e')],_0x334437[_0x4245('0x4a')]);_0x460cc6['attributes']=_['intersection'](_0x334437[_0x4245('0x4e')],qs['fields'](_0x3024d2['query'][_0x4245('0x50')]));_0x460cc6[_0x4245('0x4f')]=_0x460cc6['attributes'][_0x4245('0x51')]?_0x460cc6[_0x4245('0x4f')]:_0x334437[_0x4245('0x4e')];if(!_0x3024d2['query'][_0x4245('0x52')](_0x4245('0x53'))){_0x460cc6['limit']=qs[_0x4245('0x32')](_0x3024d2[_0x4245('0x4a')]['limit']);_0x460cc6['offset']=qs[_0x4245('0x34')](_0x3024d2[_0x4245('0x4a')][_0x4245('0x34')]);}_0x460cc6[_0x4245('0x54')]=qs['sort'](_0x3024d2['query'][_0x4245('0x55')]);_0x460cc6['where']=qs[_0x4245('0x4c')](_[_0x4245('0x57')](_0x3024d2['query'],_0x334437[_0x4245('0x4c')]));_0x460cc6['where'][_0x4245('0x6d')]=_0x287312['id'];if(_0x3024d2[_0x4245('0x4a')][_0x4245('0x58')]){_0x460cc6[_0x4245('0x56')]=_[_0x4245('0x59')](_0x460cc6[_0x4245('0x56')],{'$or':_[_0x4245('0x44')](_0x460cc6[_0x4245('0x4f')],function(_0x5a2571){var _0xa99ba5={};_0xa99ba5[_0x5a2571]={'$like':'%'+_0x3024d2[_0x4245('0x4a')][_0x4245('0x58')]+'%'};return _0xa99ba5;})});}if(_0x3024d2[_0x4245('0x4a')][_0x4245('0xa2')]){var _0xd133db=_0x3024d2['query'][_0x4245('0xa2')][_0x4245('0xa3')](',');var _0x1f8494={};_0x1f8494[_0xd133db[0x0]]={'$gte':moment(_0xd133db[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x460cc6['where']=_[_0x4245('0x59')](_0x460cc6[_0x4245('0x56')],_0x1f8494);}_0x460cc6=_['merge']({},_0x460cc6,_0x3024d2[_0x4245('0x5a')]);return db[_0x4245('0xa1')][_0x4245('0x33')]({'where':_0x460cc6['where']})['then'](function(_0x2110a7){_0xf2332b['count']=_0x2110a7;if(_0x3024d2['query'][_0x4245('0x5b')]){_0x460cc6[_0x4245('0x5c')]=[{'all':!![]}];}return db['FaxMessage'][_0x4245('0x5d')](_0x460cc6);})[_0x4245('0x3b')](function(_0x61885c){_0xf2332b[_0x4245('0x6e')]=_0x61885c;return _0xf2332b;});}})[_0x4245('0x3b')](respondWithFilteredResult(_0x36c378,_0x460cc6))[_0x4245('0x5e')](handleError(_0x36c378,null));};exports[_0x4245('0x41')]=function(_0x4ba320,_0x5bf879,_0x2eab7f){var _0x26b3ca,_0x21319a={},_0x52d94f;if(_0x4ba320['body']['to']){_0x52d94f=_0x4ba320['body']['to'][0x0];}return db[_0x4245('0x45')][_0x4245('0x61')]({'where':{'id':_0x4ba320[_0x4245('0x60')]['id']},'include':[{'model':db[_0x4245('0xa4')],'as':_0x4245('0xa5'),'include':[{'model':db['CmContact'],'as':_0x4245('0xa6'),'where':{'fax':_0x52d94f},'limit':0x1,'order':[['updatedAt',_0x4245('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x5bf879,null))[_0x4245('0x3b')](function(_0x15a2e9){_0x26b3ca=_0x15a2e9;if(_0x4ba320[_0x4245('0x63')]['attachments']&&_0x4ba320['body'][_0x4245('0xa8')][_0x4245('0x51')]){for(var _0x446a01=0x0;_0x446a01<_0x4ba320['body'][_0x4245('0xa8')][_0x4245('0x51')];_0x446a01+=0x1){_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][_0x446a01]={'filename':_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][_0x446a01][_0x4245('0x40')],'id':_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][_0x446a01]['id'],'path':path[_0x4245('0xa9')](config[_0x4245('0xaa')],_0x4245('0xab'),_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][_0x446a01][_0x4245('0xac')])};}}return respondWithRpcPromise(_0x4245('0xad'),'CheckAfterSend',{'FaxAccountId':_[_0x4245('0xae')](_0x4ba320[_0x4245('0x60')]['id'])?undefined:_0x4ba320[_0x4245('0x60')]['id'],'path':_[_0x4245('0xae')](_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][0x0][_0x4245('0x7')])?undefined:_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][0x0][_0x4245('0x7')],'fax':_[_0x4245('0xae')](_0x4ba320[_0x4245('0x63')]['to'][0x0])?undefined:_0x4ba320['body']['to'][0x0]},client9002);})[_0x4245('0x3b')](function(){if(_0x26b3ca){if(_['isNil'](_0x4ba320['body'][_0x4245('0xaf')])){_0x4ba320[_0x4245('0x63')]['from']=util[_0x4245('0xb0')](_0x4245('0xb1'),_0x26b3ca['name'],_0x26b3ca[_0x4245('0xb2')]);}if(_0x26b3ca['List']){if(_0x26b3ca[_0x4245('0xa5')][_0x4245('0xa6')]['length']){return _0x26b3ca['List']['Contacts'][0x0];}else{return db[_0x4245('0x77')][_0x4245('0x62')](_[_0x4245('0xb3')](_0x4ba320[_0x4245('0x63')],{'firstName':_0x4ba320[_0x4245('0x63')]['to'][0x0],'phone':_0x4ba320[_0x4245('0x63')]['to'][0x0],'fax':_0x4ba320[_0x4245('0x63')]['to'][0x0],'ListId':_0x26b3ca[_0x4245('0x9f')]}));}}else{throw new Error(_0x4245('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x4245('0x3b')](function(_0x455227){if(_0x455227){return db[_0x4245('0x74')]['find']({'where':{'ContactId':_0x455227['id'],'closed':![],'FaxAccountId':_0x26b3ca['id']}})[_0x4245('0x3b')](function(_0x3540ed){if(_0x3540ed){return[_0x3540ed,![]];}return db[_0x4245('0x74')][_0x4245('0x62')]({'UserId':_0x4ba320['user']['id'],'ContactId':_0x455227['id'],'FaxAccountId':_0x26b3ca['id'],'fax':_0x4ba320['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x4245('0x59')](_0x4ba320[_0x4245('0x63')],{'read':![],'body':_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][0x0][_0x4245('0xb5')],'FaxAccountId':_0x26b3ca['id'],'UserId':_0x4ba320[_0x4245('0x64')]['id'],'ContactId':_0x455227['id'],'AttachmentId':_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x4245('0xa1')],'as':'Messages'}]})[_0x4245('0x3b')](function(_0x3fbc37){return[_0x3fbc37,!![]];});});}else{throw new Error(_0x4245('0xb6'));}})['spread'](function(_0x253d90,_0x32f76b){if(_0x32f76b){return _0x253d90;}return db[_0x4245('0xa1')]['create']({'direction':'out','read':![],'body':_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][0x0][_0x4245('0xb5')],'FaxAccountId':_0x26b3ca['id'],'FaxInteractionId':_0x253d90['id'],'UserId':_0x4ba320[_0x4245('0x64')]['id'],'ContactId':_0x253d90[_0x4245('0xb7')],'AttachmentId':_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][0x0]['id']})[_0x4245('0x3b')](function(_0x44dbe9){_0x253d90[_0x4245('0xb8')][_0x4245('0xb9')]=[];_0x253d90[_0x4245('0xb8')]['Messages']['push'](_0x44dbe9[_0x4245('0xb8')]);return _0x253d90;});})['then'](function(_0xb28f0a){respondWithRpcPromise(_0x4245('0xba'),_0x4245('0xba'),{'FaxAccountId':_[_0x4245('0xae')](_0x4ba320['params']['id'])?undefined:_0x4ba320[_0x4245('0x60')]['id'],'path':_[_0x4245('0xae')](_0x4ba320['body'][_0x4245('0xa8')][0x0][_0x4245('0x7')])?undefined:_0x4ba320[_0x4245('0x63')][_0x4245('0xa8')][0x0]['path'],'fax':_[_0x4245('0xae')](_0x4ba320[_0x4245('0x63')]['to'][0x0])?undefined:_0x4ba320[_0x4245('0x63')]['to'][0x0],'AttachmentId':_0x4ba320['body'][_0x4245('0xa8')][0x0]['id']},client9002)[_0x4245('0x3b')](function(_0x1ed435){logger[_0x4245('0x24')]('SendFaxRpc,\x20%s',_0x1ed435);})[_0x4245('0x5e')](function(_0x3e68f3){logger['info'](_0x4245('0xbb'),_0x3e68f3);});return _0xb28f0a;})[_0x4245('0x3b')](respondWithResult(_0x5bf879,null))[_0x4245('0x5e')](handleError(_0x5bf879,null));};exports[_0x4245('0xbc')]=function(_0x570b37,_0x583730,_0x355c90){return db['FaxAccount']['find']({'where':{'id':_0x570b37['params']['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x583730,null))['then'](function(_0x5bc6a8){if(_0x5bc6a8){return _0x5bc6a8[_0x4245('0xbc')](_0x570b37['body']['ids'],_[_0x4245('0xbd')](_0x570b37[_0x4245('0x63')],[_0x4245('0x75'),'id'])||{})[_0x4245('0xbe')](function(_0x9dc95a){for(var _0x2e43bb=0x0;_0x2e43bb<_0x570b37[_0x4245('0x63')][_0x4245('0x75')][_0x4245('0x51')];_0x2e43bb+=0x1){socket[_0x4245('0xbf')](_0x4245('0xc0'),{'UserId':Number(_0x570b37['body'][_0x4245('0x75')][_0x2e43bb]),'FaxAccountId':Number(_0x570b37['params']['id'])});}return _0x9dc95a;});}})[_0x4245('0x3b')](respondWithResult(_0x583730,null))[_0x4245('0x5e')](handleError(_0x583730,null));};exports['removeAgents']=function(_0x4c8d09,_0x426199,_0x383314){return db['FaxAccount'][_0x4245('0x61')]({'where':{'id':_0x4c8d09['params']['id']}})['then'](handleEntityNotFound(_0x426199,null))[_0x4245('0x3b')](function(_0x33200c){if(_0x33200c){return _0x33200c[_0x4245('0xc1')](_0x4c8d09['query'][_0x4245('0x75')])[_0x4245('0x3b')](function(){if(_['isArray'](_0x4c8d09['query'][_0x4245('0x75')])){for(var _0x3cf930=0x0;_0x3cf930<_0x4c8d09['query']['ids'][_0x4245('0x51')];_0x3cf930+=0x1){socket[_0x4245('0xbf')](_0x4245('0xc2'),{'UserId':Number(_0x4c8d09[_0x4245('0x4a')][_0x4245('0x75')][_0x3cf930]),'FaxAccountId':Number(_0x4c8d09[_0x4245('0x60')]['id'])});}}else{socket['emit'](_0x4245('0xc2'),{'UserId':Number(_0x4c8d09['query'][_0x4245('0x75')]),'FaxAccountId':Number(_0x4c8d09[_0x4245('0x60')]['id'])});}});}})[_0x4245('0x3b')](respondWithStatusCode(_0x426199,null))[_0x4245('0x5e')](handleError(_0x426199,null));};exports[_0x4245('0xc3')]=function(_0x483cf3,_0x1d5cc4,_0x522bea){var _0x366a8b={};var _0x53c861={};var _0x1f0f77;var _0x6b5b9b;return db['FaxAccount']['findOne']({'where':{'id':_0x483cf3['params']['id']}})[_0x4245('0x3b')](handleEntityNotFound(_0x1d5cc4,null))[_0x4245('0x3b')](function(_0x1ab7a6){if(_0x1ab7a6){_0x1f0f77=_0x1ab7a6;_0x53c861[_0x4245('0x4e')]=_[_0x4245('0x4b')](db[_0x4245('0x78')][_0x4245('0x46')]);_0x53c861[_0x4245('0x4a')]=_[_0x4245('0x4b')](_0x483cf3[_0x4245('0x4a')]);_0x53c861[_0x4245('0x4c')]=_[_0x4245('0x4d')](_0x53c861[_0x4245('0x4e')],_0x53c861[_0x4245('0x4a')]);_0x366a8b[_0x4245('0x4f')]=_['intersection'](_0x53c861['model'],qs[_0x4245('0x50')](_0x483cf3['query']['fields']));_0x366a8b['attributes']=_0x366a8b['attributes'][_0x4245('0x51')]?_0x366a8b[_0x4245('0x4f')]:_0x53c861[_0x4245('0x4e')];_0x366a8b[_0x4245('0x54')]=qs[_0x4245('0x55')](_0x483cf3[_0x4245('0x4a')][_0x4245('0x55')]);_0x366a8b[_0x4245('0x56')]=qs[_0x4245('0x4c')](_['pick'](_0x483cf3[_0x4245('0x4a')],_0x53c861['filters']));if(_0x483cf3[_0x4245('0x4a')]['filter']){_0x366a8b['where']=_['merge'](_0x366a8b[_0x4245('0x56')],{'$or':_['map'](_0x366a8b[_0x4245('0x4f')],function(_0x165a5b){var _0x14e4da={};_0x14e4da[_0x165a5b]={'$like':'%'+_0x483cf3[_0x4245('0x4a')]['filter']+'%'};return _0x14e4da;})});}_0x366a8b=_[_0x4245('0x59')]({},_0x366a8b,_0x483cf3[_0x4245('0x5a')]);return _0x1f0f77[_0x4245('0xc3')](_0x366a8b);}})[_0x4245('0x3b')](function(_0x179159){if(_0x179159){_0x6b5b9b=_0x179159['length'];if(!_0x483cf3['query']['hasOwnProperty'](_0x4245('0x53'))){_0x366a8b[_0x4245('0x32')]=qs['limit'](_0x483cf3[_0x4245('0x4a')][_0x4245('0x32')]);_0x366a8b[_0x4245('0x34')]=qs[_0x4245('0x34')](_0x483cf3[_0x4245('0x4a')][_0x4245('0x34')]);}return _0x1f0f77[_0x4245('0xc3')](_0x366a8b);}})[_0x4245('0x3b')](function(_0x5802f1){if(_0x5802f1){return _0x5802f1?{'count':_0x6b5b9b,'rows':_0x5802f1}:null;}})[_0x4245('0x3b')](respondWithResult(_0x1d5cc4,null))[_0x4245('0x5e')](handleError(_0x1d5cc4,null));}; \ No newline at end of file +var _0x7705=['localstationid','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','maxrate','modem','FAXOPT(','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','omit','createdAt','updatedAt','getMessages','FaxMessage','$gte','split','format','CmList','List','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','ListId','Send\x20Fax\x20failed','out','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','find','create','body','user','role','UserProfileSection','update','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','options','removeAnswers','addInteraction','FaxInteraction','CmContact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','FaxApplication','bulkCreate','getApplications','context','exten'];(function(_0x443d3c,_0x1fd7b7){var _0x29845f=function(_0xe1062f){while(--_0xe1062f){_0x443d3c['push'](_0x443d3c['shift']());}};_0x29845f(++_0x1fd7b7);}(_0x7705,0xee));var _0x5770=function(_0x6cfbf6,_0x594cf1){_0x6cfbf6=_0x6cfbf6-0x0;var _0x537202=_0x7705[_0x6cfbf6];return _0x537202;};'use strict';var emlformat=require(_0x5770('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5770('0x1'));var jsonpatch=require(_0x5770('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5770('0x3'));var Mustache=require('mustache');var util=require(_0x5770('0x4'));var path=require(_0x5770('0x5'));var sox=require(_0x5770('0x6'));var csv=require(_0x5770('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5770('0x8'));var _=require(_0x5770('0x9'));var squel=require(_0x5770('0xa'));var crypto=require('crypto');var jsforce=require(_0x5770('0xb'));var deskjs=require(_0x5770('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5770('0xd'));var Papa=require(_0x5770('0xe'));var Redis=require(_0x5770('0xf'));var authService=require(_0x5770('0x10'));var qs=require(_0x5770('0x11'));var as=require(_0x5770('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5770('0x13'));var utils=require(_0x5770('0x14'));var config=require(_0x5770('0x15'));var licenseUtil=require(_0x5770('0x16'));var db=require(_0x5770('0x17'))['db'];config[_0x5770('0x18')]=_[_0x5770('0x19')](config[_0x5770('0x18')],{'host':_0x5770('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5770('0x18')]));require(_0x5770('0x1b'))[_0x5770('0x1c')](socket);var jayson=require(_0x5770('0x1d'));var client=jayson[_0x5770('0x1e')][_0x5770('0x1f')]({'port':0x232c});var client9002=jayson[_0x5770('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ebe39,_0x2d1e15,_0x3332a9,_0x208f71){return new BPromise(function(_0x27b00,_0x475992){var _0x30d62b=_0x208f71||client;return _0x30d62b[_0x5770('0x20')](_0x4ebe39,_0x3332a9)[_0x5770('0x21')](function(_0x40d15c){logger['info'](_0x5770('0x22'),_0x2d1e15,'request\x20sent');logger['debug'](_0x5770('0x23'),_0x2d1e15,_0x5770('0x24'),JSON['stringify'](_0x40d15c));if(_0x40d15c['error']){if(_0x40d15c[_0x5770('0x25')][_0x5770('0x26')]===0x1f4){logger['error'](_0x5770('0x22'),_0x2d1e15,_0x40d15c[_0x5770('0x25')][_0x5770('0x27')]);return _0x475992(_0x40d15c[_0x5770('0x25')][_0x5770('0x27')]);}logger[_0x5770('0x25')](_0x5770('0x22'),_0x2d1e15,_0x40d15c[_0x5770('0x25')]['message']);return _0x27b00(_0x40d15c['error']['message']);}else{logger[_0x5770('0x28')](_0x5770('0x22'),_0x2d1e15,_0x5770('0x24'));_0x27b00(_0x40d15c[_0x5770('0x29')]['message']);}})[_0x5770('0x2a')](function(_0x6e9af8){logger[_0x5770('0x25')](_0x5770('0x22'),_0x2d1e15,_0x6e9af8);_0x475992(_0x6e9af8);});});}function respondWithStatusCode(_0x1968de,_0x3af9bc){_0x3af9bc=_0x3af9bc||0xcc;return function(_0x28df6a){if(_0x28df6a){return _0x1968de[_0x5770('0x2b')](_0x3af9bc);}return _0x1968de[_0x5770('0x2c')](_0x3af9bc)['end']();};}function respondWithResult(_0x47afc1,_0x2804e4){_0x2804e4=_0x2804e4||0xc8;return function(_0x83879b){if(_0x83879b){return _0x47afc1[_0x5770('0x2c')](_0x2804e4)[_0x5770('0x2d')](_0x83879b);}};}function respondWithFilteredResult(_0x5be74b,_0x13b2d1){return function(_0x225b6f){if(_0x225b6f){var _0x1a3e4d=typeof _0x13b2d1[_0x5770('0x2e')]===_0x5770('0x2f')&&typeof _0x13b2d1[_0x5770('0x30')]===_0x5770('0x2f');var _0x59021b=_0x225b6f['count'];var _0x53c04b=_0x1a3e4d?0x0:_0x13b2d1[_0x5770('0x2e')];var _0x392416=_0x1a3e4d?_0x225b6f[_0x5770('0x31')]:_0x13b2d1[_0x5770('0x2e')]+_0x13b2d1['limit'];var _0x284d85;if(_0x392416>=_0x59021b){_0x392416=_0x59021b;_0x284d85=0xc8;}else{_0x284d85=0xce;}_0x5be74b[_0x5770('0x2c')](_0x284d85);return _0x5be74b[_0x5770('0x32')]('Content-Range',_0x53c04b+'-'+_0x392416+'/'+_0x59021b)[_0x5770('0x2d')](_0x225b6f);}return null;};}function patchUpdates(_0x4eb64b){return function(_0x3b85e1){try{jsonpatch[_0x5770('0x33')](_0x3b85e1,_0x4eb64b,!![]);}catch(_0x27df90){return BPromise[_0x5770('0x34')](_0x27df90);}return _0x3b85e1['save']();};}function saveUpdates(_0x3653ee,_0x350de6){return function(_0x1d5a25){if(_0x1d5a25){return _0x1d5a25['update'](_0x3653ee)['then'](function(_0xb31bbe){return _0xb31bbe;});}return null;};}function removeEntity(_0x12ad55,_0x16e18f){return function(_0x20f89c){if(_0x20f89c){return _0x20f89c['destroy']()['then'](function(){var _0x2f1a18=_0x20f89c[_0x5770('0x35')]({'plain':!![]});var _0x5c200c=_0x5770('0x36');return db[_0x5770('0x37')][_0x5770('0x38')]({'where':{'type':_0x5c200c,'resourceId':_0x2f1a18['id']}})[_0x5770('0x21')](function(){return _0x20f89c;});})[_0x5770('0x21')](function(){_0x12ad55[_0x5770('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52cb4d,_0x17e53a){return function(_0x201079){if(!_0x201079){_0x52cb4d[_0x5770('0x2b')](0x194);}return _0x201079;};}function handleError(_0x36142f,_0x5c36d6){_0x5c36d6=_0x5c36d6||0x1f4;return function(_0x11bff4){logger[_0x5770('0x25')](_0x11bff4[_0x5770('0x39')]);if(_0x11bff4[_0x5770('0x3a')]){delete _0x11bff4['name'];}_0x36142f[_0x5770('0x2c')](_0x5c36d6)[_0x5770('0x3b')](_0x11bff4);};}exports['index']=function(_0x51a966,_0x50c46d){var _0x6cbef9={'include':[{'model':db[_0x5770('0x3c')],'as':_0x5770('0x3d')}]},_0x33fcf7={},_0x5d7a06={'count':0x0,'rows':[]};var _0x4f4324=_['map'](db[_0x5770('0x3e')][_0x5770('0x3f')],function(_0x1ffadc){return{'name':_0x1ffadc[_0x5770('0x40')],'type':_0x1ffadc[_0x5770('0x41')][_0x5770('0x42')]};});_0x33fcf7[_0x5770('0x43')]=_[_0x5770('0x44')](_0x4f4324,_0x5770('0x3a'));_0x33fcf7['query']=_[_0x5770('0x45')](_0x51a966[_0x5770('0x46')]);_0x33fcf7[_0x5770('0x47')]=_[_0x5770('0x48')](_0x33fcf7[_0x5770('0x43')],_0x33fcf7['query']);_0x6cbef9[_0x5770('0x49')]=_[_0x5770('0x48')](_0x33fcf7[_0x5770('0x43')],qs[_0x5770('0x4a')](_0x51a966[_0x5770('0x46')]['fields']));_0x6cbef9[_0x5770('0x49')]=_0x6cbef9[_0x5770('0x49')][_0x5770('0x4b')]?_0x6cbef9['attributes']:_0x33fcf7[_0x5770('0x43')];if(!_0x51a966[_0x5770('0x46')]['hasOwnProperty']('nolimit')){_0x6cbef9[_0x5770('0x30')]=qs[_0x5770('0x30')](_0x51a966['query'][_0x5770('0x30')]);_0x6cbef9[_0x5770('0x2e')]=qs[_0x5770('0x2e')](_0x51a966[_0x5770('0x46')][_0x5770('0x2e')]);}_0x6cbef9[_0x5770('0x4c')]=qs[_0x5770('0x4d')](_0x51a966[_0x5770('0x46')][_0x5770('0x4d')]);_0x6cbef9[_0x5770('0x4e')]=qs[_0x5770('0x47')](_[_0x5770('0x4f')](_0x51a966[_0x5770('0x46')],_0x33fcf7[_0x5770('0x47')]),_0x4f4324);if(_0x51a966[_0x5770('0x46')][_0x5770('0x50')]){_0x6cbef9[_0x5770('0x4e')]=_[_0x5770('0x51')](_0x6cbef9['where'],{'$or':_[_0x5770('0x44')](_0x4f4324,function(_0x5c623a){if(_0x5c623a[_0x5770('0x41')]!==_0x5770('0x52')){var _0x1101e4={};_0x1101e4[_0x5c623a[_0x5770('0x3a')]]={'$like':'%'+_0x51a966[_0x5770('0x46')]['filter']+'%'};return _0x1101e4;}})});}_0x6cbef9=_['merge']({},_0x6cbef9,_0x51a966['options']);var _0x4399c9={'where':_0x6cbef9[_0x5770('0x4e')]};return db[_0x5770('0x3e')][_0x5770('0x31')](_0x4399c9)['then'](function(_0x350db3){_0x5d7a06[_0x5770('0x31')]=_0x350db3;if(_0x51a966[_0x5770('0x46')]['includeAll']){_0x6cbef9[_0x5770('0x53')]=[{'all':!![]}];}return db[_0x5770('0x3e')][_0x5770('0x54')](_0x6cbef9);})[_0x5770('0x21')](function(_0x12b338){_0x5d7a06[_0x5770('0x55')]=_0x12b338;return _0x5d7a06;})[_0x5770('0x21')](respondWithFilteredResult(_0x50c46d,_0x6cbef9))[_0x5770('0x2a')](handleError(_0x50c46d,null));};exports[_0x5770('0x56')]=function(_0x4699ab,_0x409368){var _0x3b404f={'raw':![],'where':{'id':_0x4699ab[_0x5770('0x57')]['id']},'include':[{'model':db[_0x5770('0x3c')],'as':_0x5770('0x3d')}]},_0x197c15={};_0x197c15['model']=_[_0x5770('0x45')](db['FaxAccount']['rawAttributes']);_0x197c15['query']=_[_0x5770('0x45')](_0x4699ab[_0x5770('0x46')]);_0x197c15[_0x5770('0x47')]=_['intersection'](_0x197c15[_0x5770('0x43')],_0x197c15[_0x5770('0x46')]);_0x3b404f['attributes']=_[_0x5770('0x48')](_0x197c15['model'],qs[_0x5770('0x4a')](_0x4699ab[_0x5770('0x46')][_0x5770('0x4a')]));_0x3b404f['attributes']=_0x3b404f[_0x5770('0x49')][_0x5770('0x4b')]?_0x3b404f[_0x5770('0x49')]:_0x197c15['model'];if(_0x4699ab[_0x5770('0x46')][_0x5770('0x58')]){_0x3b404f[_0x5770('0x53')]=[{'all':!![]}];}_0x3b404f=_['merge']({},_0x3b404f,_0x4699ab['options']);return db[_0x5770('0x3e')][_0x5770('0x59')](_0x3b404f)[_0x5770('0x21')](handleEntityNotFound(_0x409368,null))['then'](respondWithResult(_0x409368,null))[_0x5770('0x2a')](handleError(_0x409368,null));};exports[_0x5770('0x5a')]=function(_0x350636,_0x35958e){return db[_0x5770('0x3e')]['create'](_0x350636[_0x5770('0x5b')],{})[_0x5770('0x21')](function(_0x3ec37f){var _0x334a2f=_0x350636[_0x5770('0x5c')][_0x5770('0x35')]({'plain':!![]});if(!_0x334a2f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x334a2f[_0x5770('0x5d')]===_0x5770('0x5c')){var _0x4bf90f=_0x3ec37f[_0x5770('0x35')]({'plain':!![]});var _0x21c061=_0x5770('0x36');return db[_0x5770('0x5e')]['find']({'where':{'name':_0x21c061,'userProfileId':_0x334a2f['userProfileId']},'raw':!![]})[_0x5770('0x21')](function(_0x1964fe){if(_0x1964fe&&_0x1964fe['autoAssociation']===0x0){return db[_0x5770('0x37')][_0x5770('0x5a')]({'name':_0x4bf90f[_0x5770('0x3a')],'resourceId':_0x4bf90f['id'],'type':_0x1964fe['name'],'sectionId':_0x1964fe['id']},{})[_0x5770('0x21')](function(){return _0x3ec37f;});}else{return _0x3ec37f;}})[_0x5770('0x2a')](function(_0x2dc77f){logger[_0x5770('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2dc77f);throw _0x2dc77f;});}return _0x3ec37f;})[_0x5770('0x21')](respondWithResult(_0x35958e,0xc9))['catch'](handleError(_0x35958e,null));};exports[_0x5770('0x5f')]=function(_0x226f9b,_0x1efc39){if(_0x226f9b[_0x5770('0x5b')]['id']){delete _0x226f9b['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x226f9b[_0x5770('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x5770('0x3d')}]})['then'](handleEntityNotFound(_0x1efc39,null))[_0x5770('0x21')](saveUpdates(_0x226f9b[_0x5770('0x5b')],null))[_0x5770('0x21')](respondWithResult(_0x1efc39,null))['catch'](handleError(_0x1efc39,null));};exports['destroy']=function(_0x19a098,_0x4d6a97){return db[_0x5770('0x3e')][_0x5770('0x59')]({'where':{'id':_0x19a098['params']['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x4d6a97,null))['then'](removeEntity(_0x4d6a97,null))[_0x5770('0x2a')](handleError(_0x4d6a97,null));};exports['describe']=function(_0x269ccc,_0x1900d9){return db[_0x5770('0x3e')]['describe']()[_0x5770('0x21')](respondWithResult(_0x1900d9,null))['catch'](handleError(_0x1900d9,null));};exports['addDisposition']=function(_0x19a478,_0x2015bb,_0xfa0d4a){if(_0x19a478[_0x5770('0x5b')]['id']){delete _0x19a478[_0x5770('0x5b')]['id'];}return db[_0x5770('0x3e')]['find']({'where':{'id':_0x19a478['params']['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x2015bb,null))[_0x5770('0x21')](function(_0x4b39a2){if(_0x4b39a2){_0x19a478['body'][_0x5770('0x60')]=_0x4b39a2['id'];return db[_0x5770('0x61')][_0x5770('0x5a')](_0x19a478[_0x5770('0x5b')]);}})['then'](respondWithResult(_0x2015bb,null))[_0x5770('0x2a')](handleError(_0x2015bb,null));};exports[_0x5770('0x62')]=function(_0x3450a0,_0x402842,_0x37dd15){var _0x445d58={'raw':![],'where':{}};var _0xcfbfb9={};var _0x13208f={'count':0x0,'rows':[]};return db[_0x5770('0x3e')][_0x5770('0x63')]({'where':{'id':_0x3450a0[_0x5770('0x57')]['id']}})['then'](handleEntityNotFound(_0x402842,null))[_0x5770('0x21')](function(_0x4a90be){if(_0x4a90be){_0xcfbfb9[_0x5770('0x43')]=_['keys'](db[_0x5770('0x61')][_0x5770('0x3f')]);_0xcfbfb9[_0x5770('0x46')]=_[_0x5770('0x45')](_0x3450a0[_0x5770('0x46')]);_0xcfbfb9[_0x5770('0x47')]=_[_0x5770('0x48')](_0xcfbfb9[_0x5770('0x43')],_0xcfbfb9[_0x5770('0x46')]);_0x445d58['attributes']=_[_0x5770('0x48')](_0xcfbfb9[_0x5770('0x43')],qs[_0x5770('0x4a')](_0x3450a0['query'][_0x5770('0x4a')]));_0x445d58[_0x5770('0x49')]=_0x445d58[_0x5770('0x49')][_0x5770('0x4b')]?_0x445d58[_0x5770('0x49')]:_0xcfbfb9[_0x5770('0x43')];if(!_0x3450a0[_0x5770('0x46')][_0x5770('0x64')](_0x5770('0x65'))){_0x445d58[_0x5770('0x30')]=qs[_0x5770('0x30')](_0x3450a0[_0x5770('0x46')][_0x5770('0x30')]);_0x445d58[_0x5770('0x2e')]=qs[_0x5770('0x2e')](_0x3450a0[_0x5770('0x46')]['offset']);}_0x445d58[_0x5770('0x4c')]=qs['sort'](_0x3450a0[_0x5770('0x46')]['sort']);_0x445d58[_0x5770('0x4e')]=qs[_0x5770('0x47')](_[_0x5770('0x4f')](_0x3450a0[_0x5770('0x46')],_0xcfbfb9[_0x5770('0x47')]));_0x445d58['where']['FaxAccountId']=_0x4a90be['id'];if(_0x3450a0[_0x5770('0x46')]['filter']){_0x445d58[_0x5770('0x4e')]=_[_0x5770('0x51')](_0x445d58[_0x5770('0x4e')],{'$or':_['map'](_0x445d58['attributes'],function(_0xe7de64){var _0x5d84d4={};_0x5d84d4[_0xe7de64]={'$like':'%'+_0x3450a0['query'][_0x5770('0x50')]+'%'};return _0x5d84d4;})});}_0x445d58=_['merge']({},_0x445d58,_0x3450a0['options']);return db[_0x5770('0x61')][_0x5770('0x31')]({'where':_0x445d58[_0x5770('0x4e')]})[_0x5770('0x21')](function(_0x397458){_0x13208f['count']=_0x397458;if(_0x3450a0[_0x5770('0x46')][_0x5770('0x58')]){_0x445d58[_0x5770('0x53')]=[{'all':!![]}];}return db[_0x5770('0x61')][_0x5770('0x54')](_0x445d58);})['then'](function(_0x238339){_0x13208f['rows']=_0x238339;return _0x13208f;});}})['then'](respondWithFilteredResult(_0x402842,_0x445d58))[_0x5770('0x2a')](handleError(_0x402842,null));};exports[_0x5770('0x66')]=function(_0x2b6339,_0x28c974,_0x203d8a){return db[_0x5770('0x3e')][_0x5770('0x59')]({'where':{'id':_0x2b6339['params']['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x28c974,null))[_0x5770('0x21')](function(_0x3a455e){if(_0x3a455e){return _0x3a455e[_0x5770('0x66')](_0x2b6339[_0x5770('0x46')][_0x5770('0x67')]);}})[_0x5770('0x21')](respondWithStatusCode(_0x28c974,null))['catch'](handleError(_0x28c974,null));};exports[_0x5770('0x68')]=function(_0x78c58d,_0x11f5f1,_0x322e8d){if(_0x78c58d[_0x5770('0x5b')]['id']){delete _0x78c58d[_0x5770('0x5b')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x78c58d[_0x5770('0x57')]['id']}})['then'](handleEntityNotFound(_0x11f5f1,null))[_0x5770('0x21')](function(_0x23fd15){if(_0x23fd15){_0x78c58d[_0x5770('0x5b')][_0x5770('0x60')]=_0x23fd15['id'];return db[_0x5770('0x69')]['create'](_0x78c58d['body']);}})[_0x5770('0x21')](respondWithResult(_0x11f5f1,null))[_0x5770('0x2a')](handleError(_0x11f5f1,null));};exports[_0x5770('0x6a')]=function(_0x627ba2,_0x48655c,_0x490d13){var _0x24f6ca={'raw':![],'where':{}};var _0x3b12f8={};var _0x4ad68c={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x627ba2['params']['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x48655c,null))[_0x5770('0x21')](function(_0x59397f){if(_0x59397f){_0x3b12f8[_0x5770('0x43')]=_[_0x5770('0x45')](db[_0x5770('0x69')][_0x5770('0x3f')]);_0x3b12f8['query']=_[_0x5770('0x45')](_0x627ba2['query']);_0x3b12f8[_0x5770('0x47')]=_[_0x5770('0x48')](_0x3b12f8[_0x5770('0x43')],_0x3b12f8[_0x5770('0x46')]);_0x24f6ca[_0x5770('0x49')]=_[_0x5770('0x48')](_0x3b12f8[_0x5770('0x43')],qs[_0x5770('0x4a')](_0x627ba2[_0x5770('0x46')]['fields']));_0x24f6ca['attributes']=_0x24f6ca[_0x5770('0x49')][_0x5770('0x4b')]?_0x24f6ca[_0x5770('0x49')]:_0x3b12f8['model'];if(!_0x627ba2['query'][_0x5770('0x64')](_0x5770('0x65'))){_0x24f6ca['limit']=qs[_0x5770('0x30')](_0x627ba2[_0x5770('0x46')][_0x5770('0x30')]);_0x24f6ca[_0x5770('0x2e')]=qs[_0x5770('0x2e')](_0x627ba2[_0x5770('0x46')][_0x5770('0x2e')]);}_0x24f6ca[_0x5770('0x4c')]=qs['sort'](_0x627ba2['query']['sort']);_0x24f6ca[_0x5770('0x4e')]=qs[_0x5770('0x47')](_[_0x5770('0x4f')](_0x627ba2['query'],_0x3b12f8['filters']));_0x24f6ca[_0x5770('0x4e')][_0x5770('0x60')]=_0x59397f['id'];if(_0x627ba2[_0x5770('0x46')][_0x5770('0x50')]){_0x24f6ca[_0x5770('0x4e')]=_[_0x5770('0x51')](_0x24f6ca['where'],{'$or':_[_0x5770('0x44')](_0x24f6ca[_0x5770('0x49')],function(_0x8b4fc3){var _0x5d726f={};_0x5d726f[_0x8b4fc3]={'$like':'%'+_0x627ba2['query'][_0x5770('0x50')]+'%'};return _0x5d726f;})});}_0x24f6ca=_['merge']({},_0x24f6ca,_0x627ba2[_0x5770('0x6b')]);return db[_0x5770('0x69')][_0x5770('0x31')]({'where':_0x24f6ca[_0x5770('0x4e')]})[_0x5770('0x21')](function(_0x372dd4){_0x4ad68c[_0x5770('0x31')]=_0x372dd4;if(_0x627ba2[_0x5770('0x46')][_0x5770('0x58')]){_0x24f6ca[_0x5770('0x53')]=[{'all':!![]}];}return db[_0x5770('0x69')][_0x5770('0x54')](_0x24f6ca);})['then'](function(_0x5b94bd){_0x4ad68c[_0x5770('0x55')]=_0x5b94bd;return _0x4ad68c;});}})[_0x5770('0x21')](respondWithFilteredResult(_0x48655c,_0x24f6ca))[_0x5770('0x2a')](handleError(_0x48655c,null));};exports['removeAnswers']=function(_0x32fe34,_0x2a4b8b,_0x2f1c0d){return db[_0x5770('0x3e')][_0x5770('0x59')]({'where':{'id':_0x32fe34[_0x5770('0x57')]['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x2a4b8b,null))['then'](function(_0x355bdc){if(_0x355bdc){return _0x355bdc[_0x5770('0x6c')](_0x32fe34['query'][_0x5770('0x67')]);}})[_0x5770('0x21')](respondWithStatusCode(_0x2a4b8b,null))[_0x5770('0x2a')](handleError(_0x2a4b8b,null));};exports[_0x5770('0x6d')]=function(_0x5ee410,_0x306c70,_0x5d1356){return db[_0x5770('0x6e')][_0x5770('0x59')]({'where':{'id':_0x5ee410[_0x5770('0x57')]['id']}})['then'](handleEntityNotFound(_0x306c70,null))['then'](function(_0x3c730f){if(_0x3c730f){return _0x3c730f[_0x5770('0x6d')](_0x5ee410[_0x5770('0x5b')][_0x5770('0x67')],_['omit'](_0x5ee410[_0x5770('0x5b')],[_0x5770('0x67'),'id'])||{});}})['then'](respondWithResult(_0x306c70,null))['catch'](handleError(_0x306c70,null));};exports['getInteractions']=function(_0x1e4923,_0x212fb3,_0xb1f3fe){var _0x3e912f={'raw':![],'where':{}};var _0x155f6a={};var _0x2d3599={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x1e4923[_0x5770('0x57')]['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x212fb3,null))[_0x5770('0x21')](function(_0x40a094){if(_0x40a094){_0x155f6a[_0x5770('0x43')]=_['keys'](db['FaxInteraction'][_0x5770('0x3f')]);_0x155f6a['query']=_[_0x5770('0x45')](_0x1e4923[_0x5770('0x46')]);_0x155f6a[_0x5770('0x47')]=_['intersection'](_0x155f6a[_0x5770('0x43')],_0x155f6a[_0x5770('0x46')]);_0x3e912f[_0x5770('0x49')]=_[_0x5770('0x48')](_0x155f6a[_0x5770('0x43')],qs[_0x5770('0x4a')](_0x1e4923[_0x5770('0x46')][_0x5770('0x4a')]));_0x3e912f[_0x5770('0x49')]=_0x3e912f[_0x5770('0x49')]['length']?_0x3e912f[_0x5770('0x49')]:_0x155f6a[_0x5770('0x43')];if(!_0x1e4923['query']['hasOwnProperty'](_0x5770('0x65'))){_0x3e912f[_0x5770('0x30')]=qs[_0x5770('0x30')](_0x1e4923[_0x5770('0x46')][_0x5770('0x30')]);_0x3e912f['offset']=qs[_0x5770('0x2e')](_0x1e4923[_0x5770('0x46')][_0x5770('0x2e')]);}_0x3e912f[_0x5770('0x4c')]=qs[_0x5770('0x4d')](_0x1e4923[_0x5770('0x46')][_0x5770('0x4d')]);_0x3e912f[_0x5770('0x4e')]=qs[_0x5770('0x47')](_[_0x5770('0x4f')](_0x1e4923['query'],_0x155f6a[_0x5770('0x47')]));_0x3e912f['where'][_0x5770('0x60')]=_0x40a094['id'];if(_0x1e4923[_0x5770('0x46')][_0x5770('0x50')]){_0x3e912f['where']=_[_0x5770('0x51')](_0x3e912f[_0x5770('0x4e')],{'$or':_[_0x5770('0x44')](_0x3e912f[_0x5770('0x49')],function(_0x494e1f){var _0x1582a3={};_0x1582a3[_0x494e1f]={'$like':'%'+_0x1e4923[_0x5770('0x46')][_0x5770('0x50')]+'%'};return _0x1582a3;})});}_0x3e912f=_[_0x5770('0x51')]({},_0x3e912f,_0x1e4923[_0x5770('0x6b')]);return db[_0x5770('0x6e')]['count']({'where':_0x3e912f[_0x5770('0x4e')]})[_0x5770('0x21')](function(_0x4bdf06){_0x2d3599[_0x5770('0x31')]=_0x4bdf06;if(_0x1e4923[_0x5770('0x46')]['includeAll']){_0x3e912f[_0x5770('0x53')]=[{'model':db[_0x5770('0x6f')],'as':'Contact','required':![]},{'model':db[_0x5770('0x70')],'as':_0x5770('0x71'),'attributes':[_0x5770('0x3a'),_0x5770('0x72'),_0x5770('0x73')],'required':![]},{'model':db[_0x5770('0x74')],'as':_0x5770('0x75'),'attributes':['id',_0x5770('0x3a'),'color'],'where':_0x1e4923['query']['tag']?{'id':_0x1e4923[_0x5770('0x46')][_0x5770('0x76')]}:undefined,'required':_0x1e4923['query'][_0x5770('0x76')]?!![]:![]}];}return db[_0x5770('0x6e')][_0x5770('0x54')](_0x3e912f);})[_0x5770('0x21')](function(_0x245211){_0x2d3599[_0x5770('0x55')]=_0x245211;return _0x2d3599;});}})[_0x5770('0x21')](respondWithFilteredResult(_0x212fb3,_0x3e912f))[_0x5770('0x2a')](handleError(_0x212fb3,null));};exports[_0x5770('0x77')]=function(_0x16dd0b,_0x49e30e,_0x577add){return db['FaxAccount'][_0x5770('0x63')]({'where':{'id':_0x16dd0b[_0x5770('0x57')]['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x49e30e,null))['then'](function(_0x174d0a){if(_0x174d0a){return db[_0x5770('0x78')]['transaction'](function(_0x4ee75f){return db['FaxApplication'][_0x5770('0x38')]({'where':{'FaxAccountId':_0x16dd0b[_0x5770('0x57')]['id']},'transaction':_0x4ee75f})[_0x5770('0x21')](function(_0xdeb1cf){var _0x237067=_[_0x5770('0x44')](_0x16dd0b['body'],function(_0x151008){_0x151008[_0x5770('0x60')]=_0x16dd0b[_0x5770('0x57')]['id'];return _0x151008;});return db[_0x5770('0x79')][_0x5770('0x7a')](_0x237067,{'transaction':_0x4ee75f});});})[_0x5770('0x21')](function(){return db[_0x5770('0x79')]['findAndCountAll']({'where':{'FaxAccountId':_0x16dd0b[_0x5770('0x57')]['id']},'order':'priority'});});}})[_0x5770('0x21')](respondWithResult(_0x49e30e,null))[_0x5770('0x2a')](handleError(_0x49e30e,null));};exports[_0x5770('0x7b')]=function(_0x2afcaa,_0x5dc9d4,_0x31226d){var _0x22da7f={};var _0x393419={};var _0x39dac4;var _0x20e0a4;return db[_0x5770('0x3e')][_0x5770('0x63')]({'where':{'id':_0x2afcaa[_0x5770('0x57')]['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x5dc9d4,null))[_0x5770('0x21')](function(_0x528e63){if(_0x528e63){_0x39dac4=_0x528e63;_0x393419[_0x5770('0x43')]=_[_0x5770('0x45')](db[_0x5770('0x79')][_0x5770('0x3f')]);_0x393419[_0x5770('0x46')]=_[_0x5770('0x45')](_0x2afcaa['query']);_0x393419[_0x5770('0x47')]=_[_0x5770('0x48')](_0x393419[_0x5770('0x43')],_0x393419[_0x5770('0x46')]);_0x22da7f[_0x5770('0x49')]=_[_0x5770('0x48')](_0x393419[_0x5770('0x43')],qs['fields'](_0x2afcaa['query'][_0x5770('0x4a')]));_0x22da7f['attributes']=_0x22da7f[_0x5770('0x49')][_0x5770('0x4b')]?_0x22da7f[_0x5770('0x49')]:_0x393419[_0x5770('0x43')];_0x22da7f['order']=qs[_0x5770('0x4d')](_0x2afcaa[_0x5770('0x46')][_0x5770('0x4d')]);_0x22da7f[_0x5770('0x4e')]=qs[_0x5770('0x47')](_[_0x5770('0x4f')](_0x2afcaa['query'],_0x393419[_0x5770('0x47')]));if(_0x2afcaa[_0x5770('0x46')]['filter']){_0x22da7f[_0x5770('0x4e')]=_[_0x5770('0x51')](_0x22da7f[_0x5770('0x4e')],{'$or':_[_0x5770('0x44')](_0x22da7f['attributes'],function(_0x391e02){var _0x3f2ee8={};_0x3f2ee8[_0x391e02]={'$like':'%'+_0x2afcaa[_0x5770('0x46')]['filter']+'%'};return _0x3f2ee8;})});}_0x22da7f=_[_0x5770('0x51')]({},_0x22da7f,_0x2afcaa[_0x5770('0x6b')]);return _0x39dac4[_0x5770('0x7b')](_0x22da7f);}})[_0x5770('0x21')](function(_0x442279){if(_0x442279){_0x20e0a4=_0x442279[_0x5770('0x4b')];if(!_0x2afcaa[_0x5770('0x46')][_0x5770('0x64')](_0x5770('0x65'))){_0x22da7f[_0x5770('0x30')]=qs[_0x5770('0x30')](_0x2afcaa['query']['limit']);_0x22da7f[_0x5770('0x2e')]=qs[_0x5770('0x2e')](_0x2afcaa[_0x5770('0x46')][_0x5770('0x2e')]);}return _0x39dac4[_0x5770('0x7b')](_0x22da7f);}})['then'](function(_0x154aea){if(_0x154aea){return _0x154aea?{'count':_0x20e0a4,'rows':_0x154aea}:null;}})[_0x5770('0x21')](respondWithResult(_0x5dc9d4,null))[_0x5770('0x2a')](handleError(_0x5dc9d4,null));};function Extension(_0x42a871,_0x4c9cf0,_0x524441,_0x34bc8a){this[_0x5770('0x7c')]='from-voip-provider';this[_0x5770('0x7d')]=_0x42a871[_0x5770('0x7e')];this[_0x5770('0x7f')]=_0x34bc8a;this[_0x5770('0x41')]='system';this[_0x5770('0x80')]=_0x5770('0x81');this[_0x5770('0x60')]=_0x42a871['id'];this['priority']=_0x4c9cf0;this['appdata']=_0x524441;}function createExtensionsReciveFax(_0x287452){var _0x51a560=0x1;var _0x157ea2=[];_0x157ea2[_0x5770('0x82')](new Extension(_0x287452,_0x51a560,'',_0x5770('0x83')));_0x51a560+=0x1;_0x157ea2[_0x5770('0x82')](new Extension(_0x287452,_0x51a560,_0x5770('0x84'),'Set'));_0x51a560+=0x1;for(var _0x571d49 in _0x287452){if(_0x287452[_0x5770('0x64')](_0x571d49)&&(_0x571d49===_0x5770('0x85')||_0x571d49===_0x5770('0x7e')||_0x571d49===_0x5770('0x86')||_0x571d49===_0x5770('0x87')||_0x571d49===_0x5770('0x88')||_0x571d49===_0x5770('0x89')||_0x571d49==='minrate'||_0x571d49===_0x5770('0x8a')||_0x571d49==='t38timeout')){_0x157ea2[_0x5770('0x82')](new Extension(_0x287452,_0x51a560,_0x5770('0x8b')+_0x571d49+')='+_0x287452[_0x571d49],_0x5770('0x8c')));_0x51a560+=0x1;}}_0x157ea2['push'](new Extension(_0x287452,_0x51a560,'6','Wait'));_0x51a560+=0x1;_0x157ea2[_0x5770('0x82')](new Extension(_0x287452,_0x51a560,_0x5770('0x8d'),_0x5770('0x8e')));_0x51a560=0x0;return _0x157ea2;}exports[_0x5770('0x8f')]=function(_0x508158,_0x201721,_0x4b4cc8){var _0x4c1bb9;return db[_0x5770('0x78')]['transaction'](function(_0x4de44b){return db[_0x5770('0x3e')][_0x5770('0x5a')](_0x508158[_0x5770('0x5b')],{'transaction':_0x4de44b})[_0x5770('0x21')](function(_0x376606){_0x4c1bb9=_0x376606[_0x5770('0x35')]({'plain':!![]});return db[_0x5770('0x90')]['bulkCreate'](createExtensionsReciveFax(_0x4c1bb9),{'transaction':_0x4de44b});});})[_0x5770('0x21')](function(){return _0x4c1bb9;})[_0x5770('0x21')](respondWithResult(_0x201721,null))[_0x5770('0x2a')](handleError(_0x201721,null));};exports[_0x5770('0x91')]=function(_0x21bd34,_0x35c4ac,_0xa8f15d){var _0x30cc0f;return db['sequelize']['transaction'](function(_0x25446b){return db[_0x5770('0x3e')][_0x5770('0x5f')](_0x21bd34['body'],{'where':{'id':_0x21bd34[_0x5770('0x5b')]['id']},'transaction':_0x25446b})['then'](function(_0x3c2704){return db[_0x5770('0x90')][_0x5770('0x38')]({'where':{'FaxAccountId':_0x21bd34['body']['id']},'transaction':_0x25446b})[_0x5770('0x21')](function(_0x449181){return db[_0x5770('0x90')]['bulkCreate'](createExtensionsReciveFax(_[_0x5770('0x92')](_0x21bd34[_0x5770('0x5b')],['tech','key',_0x5770('0x93'),_0x5770('0x94'),'TrunkId','ListId'])),{'transaction':_0x25446b});});});})[_0x5770('0x21')](function(){return db[_0x5770('0x3e')]['findById'](_0x21bd34[_0x5770('0x5b')]['id']);})[_0x5770('0x21')](respondWithResult(_0x35c4ac,null))['catch'](handleError(_0x35c4ac,null));};exports[_0x5770('0x95')]=function(_0x381dd4,_0x22b220,_0x17ea94){var _0x58a924={'raw':!![],'where':{}};var _0x416556={};var _0x5d24d0={'count':0x0,'rows':[]};return db[_0x5770('0x3e')][_0x5770('0x63')]({'where':{'id':_0x381dd4[_0x5770('0x57')]['id']}})['then'](handleEntityNotFound(_0x22b220,null))[_0x5770('0x21')](function(_0x2d10f9){if(_0x2d10f9){_0x416556[_0x5770('0x43')]=_[_0x5770('0x45')](db[_0x5770('0x96')]['rawAttributes']);_0x416556['query']=_[_0x5770('0x45')](_0x381dd4[_0x5770('0x46')]);_0x416556[_0x5770('0x47')]=_[_0x5770('0x48')](_0x416556['model'],_0x416556[_0x5770('0x46')]);_0x58a924['attributes']=_[_0x5770('0x48')](_0x416556[_0x5770('0x43')],qs[_0x5770('0x4a')](_0x381dd4['query']['fields']));_0x58a924[_0x5770('0x49')]=_0x58a924['attributes'][_0x5770('0x4b')]?_0x58a924['attributes']:_0x416556[_0x5770('0x43')];if(!_0x381dd4[_0x5770('0x46')]['hasOwnProperty'](_0x5770('0x65'))){_0x58a924[_0x5770('0x30')]=qs['limit'](_0x381dd4['query'][_0x5770('0x30')]);_0x58a924[_0x5770('0x2e')]=qs[_0x5770('0x2e')](_0x381dd4[_0x5770('0x46')][_0x5770('0x2e')]);}_0x58a924[_0x5770('0x4c')]=qs[_0x5770('0x4d')](_0x381dd4[_0x5770('0x46')][_0x5770('0x4d')]);_0x58a924['where']=qs[_0x5770('0x47')](_[_0x5770('0x4f')](_0x381dd4[_0x5770('0x46')],_0x416556[_0x5770('0x47')]));_0x58a924[_0x5770('0x4e')][_0x5770('0x60')]=_0x2d10f9['id'];if(_0x381dd4[_0x5770('0x46')][_0x5770('0x50')]){_0x58a924[_0x5770('0x4e')]=_[_0x5770('0x51')](_0x58a924[_0x5770('0x4e')],{'$or':_[_0x5770('0x44')](_0x58a924[_0x5770('0x49')],function(_0x26a9d9){var _0x2add21={};_0x2add21[_0x26a9d9]={'$like':'%'+_0x381dd4[_0x5770('0x46')][_0x5770('0x50')]+'%'};return _0x2add21;})});}if(_0x381dd4[_0x5770('0x46')][_0x5770('0x97')]){var _0x5daeb7=_0x381dd4['query'][_0x5770('0x97')][_0x5770('0x98')](',');var _0x2a8b1a={};_0x2a8b1a[_0x5daeb7[0x0]]={'$gte':moment(_0x5daeb7[0x1])[_0x5770('0x99')]('YYYY-MM-DD\x20HH:mm:ss')};_0x58a924[_0x5770('0x4e')]=_[_0x5770('0x51')](_0x58a924[_0x5770('0x4e')],_0x2a8b1a);}_0x58a924=_[_0x5770('0x51')]({},_0x58a924,_0x381dd4['options']);return db[_0x5770('0x96')][_0x5770('0x31')]({'where':_0x58a924[_0x5770('0x4e')]})['then'](function(_0x192a35){_0x5d24d0['count']=_0x192a35;if(_0x381dd4[_0x5770('0x46')][_0x5770('0x58')]){_0x58a924[_0x5770('0x53')]=[{'all':!![]}];}return db[_0x5770('0x96')][_0x5770('0x54')](_0x58a924);})[_0x5770('0x21')](function(_0x1ae907){_0x5d24d0[_0x5770('0x55')]=_0x1ae907;return _0x5d24d0;});}})['then'](respondWithFilteredResult(_0x22b220,_0x58a924))['catch'](handleError(_0x22b220,null));};exports[_0x5770('0x3b')]=function(_0x57ef0c,_0x99a232,_0x574d73){var _0x2751fb,_0x34ce35={},_0x3eb78b;if(_0x57ef0c[_0x5770('0x5b')]['to']){_0x3eb78b=_0x57ef0c['body']['to'][0x0];}return db[_0x5770('0x3e')][_0x5770('0x59')]({'where':{'id':_0x57ef0c[_0x5770('0x57')]['id']},'include':[{'model':db[_0x5770('0x9a')],'as':_0x5770('0x9b'),'include':[{'model':db[_0x5770('0x6f')],'as':'Contacts','where':{'fax':_0x3eb78b},'limit':0x1,'order':[[_0x5770('0x94'),_0x5770('0x9c')]]}]}]})['then'](handleEntityNotFound(_0x99a232,null))[_0x5770('0x21')](function(_0x5b7568){_0x2751fb=_0x5b7568;if(_0x57ef0c['body']['attachments']&&_0x57ef0c[_0x5770('0x5b')]['attachments']['length']){for(var _0x38ed50=0x0;_0x38ed50<_0x57ef0c[_0x5770('0x5b')][_0x5770('0x9d')][_0x5770('0x4b')];_0x38ed50+=0x1){_0x57ef0c[_0x5770('0x5b')][_0x5770('0x9d')][_0x38ed50]={'filename':_0x57ef0c['body']['attachments'][_0x38ed50][_0x5770('0x3a')],'id':_0x57ef0c['body'][_0x5770('0x9d')][_0x38ed50]['id'],'path':path[_0x5770('0x9e')](config['root'],_0x5770('0x9f'),_0x57ef0c['body'][_0x5770('0x9d')][_0x38ed50][_0x5770('0xa0')])};}}return respondWithRpcPromise(_0x5770('0xa1'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x57ef0c[_0x5770('0x57')]['id'])?undefined:_0x57ef0c[_0x5770('0x57')]['id'],'path':_[_0x5770('0xa2')](_0x57ef0c['body'][_0x5770('0x9d')][0x0][_0x5770('0x5')])?undefined:_0x57ef0c[_0x5770('0x5b')][_0x5770('0x9d')][0x0]['path'],'fax':_[_0x5770('0xa2')](_0x57ef0c[_0x5770('0x5b')]['to'][0x0])?undefined:_0x57ef0c['body']['to'][0x0]},client9002);})[_0x5770('0x21')](function(){if(_0x2751fb){if(_[_0x5770('0xa2')](_0x57ef0c[_0x5770('0x5b')]['from'])){_0x57ef0c[_0x5770('0x5b')][_0x5770('0xa3')]=util[_0x5770('0x99')](_0x5770('0xa4'),_0x2751fb[_0x5770('0x3a')],_0x2751fb[_0x5770('0xa5')]);}if(_0x2751fb['List']){if(_0x2751fb[_0x5770('0x9b')][_0x5770('0xa6')][_0x5770('0x4b')]){return _0x2751fb[_0x5770('0x9b')][_0x5770('0xa6')][0x0];}else{return db[_0x5770('0x6f')][_0x5770('0x5a')](_['defaults'](_0x57ef0c['body'],{'firstName':_0x57ef0c[_0x5770('0x5b')]['to'][0x0],'phone':_0x57ef0c[_0x5770('0x5b')]['to'][0x0],'fax':_0x57ef0c[_0x5770('0x5b')]['to'][0x0],'ListId':_0x2751fb[_0x5770('0xa7')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5770('0xa8'));}})[_0x5770('0x21')](function(_0xb06e36){if(_0xb06e36){return db[_0x5770('0x6e')][_0x5770('0x59')]({'where':{'ContactId':_0xb06e36['id'],'closed':![],'FaxAccountId':_0x2751fb['id']}})['then'](function(_0x53ec60){if(_0x53ec60){return[_0x53ec60,![]];}return db[_0x5770('0x6e')][_0x5770('0x5a')]({'UserId':_0x57ef0c['user']['id'],'ContactId':_0xb06e36['id'],'FaxAccountId':_0x2751fb['id'],'fax':_0x57ef0c[_0x5770('0x5b')]['to'][0x0],'firstMsgDirection':_0x5770('0xa9'),'Messages':[_['merge'](_0x57ef0c[_0x5770('0x5b')],{'read':![],'body':_0x57ef0c['body'][_0x5770('0x9d')][0x0]['filename'],'FaxAccountId':_0x2751fb['id'],'UserId':_0x57ef0c['user']['id'],'ContactId':_0xb06e36['id'],'AttachmentId':_0x57ef0c[_0x5770('0x5b')][_0x5770('0x9d')][0x0]['id']})]},{'include':[{'model':db[_0x5770('0x96')],'as':_0x5770('0xaa')}]})[_0x5770('0x21')](function(_0x127628){return[_0x127628,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x5770('0xab')](function(_0x48cbae,_0x5cc4c1){if(_0x5cc4c1){return _0x48cbae;}return db[_0x5770('0x96')][_0x5770('0x5a')]({'direction':_0x5770('0xa9'),'read':![],'body':_0x57ef0c[_0x5770('0x5b')][_0x5770('0x9d')][0x0]['filename'],'FaxAccountId':_0x2751fb['id'],'FaxInteractionId':_0x48cbae['id'],'UserId':_0x57ef0c[_0x5770('0x5c')]['id'],'ContactId':_0x48cbae[_0x5770('0xac')],'AttachmentId':_0x57ef0c[_0x5770('0x5b')][_0x5770('0x9d')][0x0]['id']})[_0x5770('0x21')](function(_0x474874){_0x48cbae[_0x5770('0xad')][_0x5770('0xaa')]=[];_0x48cbae['dataValues'][_0x5770('0xaa')][_0x5770('0x82')](_0x474874[_0x5770('0xad')]);return _0x48cbae;});})['then'](function(_0x46a70a){respondWithRpcPromise(_0x5770('0xae'),_0x5770('0xae'),{'FaxAccountId':_[_0x5770('0xa2')](_0x57ef0c['params']['id'])?undefined:_0x57ef0c[_0x5770('0x57')]['id'],'path':_[_0x5770('0xa2')](_0x57ef0c['body'][_0x5770('0x9d')][0x0][_0x5770('0x5')])?undefined:_0x57ef0c[_0x5770('0x5b')][_0x5770('0x9d')][0x0]['path'],'fax':_[_0x5770('0xa2')](_0x57ef0c[_0x5770('0x5b')]['to'][0x0])?undefined:_0x57ef0c[_0x5770('0x5b')]['to'][0x0],'AttachmentId':_0x57ef0c[_0x5770('0x5b')]['attachments'][0x0]['id']},client9002)['then'](function(_0x2105a1){logger['info'](_0x5770('0xaf'),_0x2105a1);})[_0x5770('0x2a')](function(_0x1a67a7){logger[_0x5770('0x28')](_0x5770('0xaf'),_0x1a67a7);});return _0x46a70a;})[_0x5770('0x21')](respondWithResult(_0x99a232,null))[_0x5770('0x2a')](handleError(_0x99a232,null));};exports[_0x5770('0xb0')]=function(_0xe16b5,_0x43de3c,_0x3466f1){return db[_0x5770('0x3e')][_0x5770('0x59')]({'where':{'id':_0xe16b5['params']['id']}})['then'](handleEntityNotFound(_0x43de3c,null))[_0x5770('0x21')](function(_0x336419){if(_0x336419){return _0x336419[_0x5770('0xb0')](_0xe16b5[_0x5770('0x5b')][_0x5770('0x67')],_[_0x5770('0x92')](_0xe16b5[_0x5770('0x5b')],[_0x5770('0x67'),'id'])||{})[_0x5770('0xab')](function(_0x2556dc){for(var _0x3b2e4e=0x0;_0x3b2e4e<_0xe16b5['body'][_0x5770('0x67')]['length'];_0x3b2e4e+=0x1){socket[_0x5770('0xb1')]('userFaxAccount:save',{'UserId':Number(_0xe16b5[_0x5770('0x5b')][_0x5770('0x67')][_0x3b2e4e]),'FaxAccountId':Number(_0xe16b5[_0x5770('0x57')]['id'])});}return _0x2556dc;});}})['then'](respondWithResult(_0x43de3c,null))[_0x5770('0x2a')](handleError(_0x43de3c,null));};exports[_0x5770('0xb2')]=function(_0x58c8bf,_0x23a88b,_0x1019db){return db[_0x5770('0x3e')][_0x5770('0x59')]({'where':{'id':_0x58c8bf[_0x5770('0x57')]['id']}})['then'](handleEntityNotFound(_0x23a88b,null))[_0x5770('0x21')](function(_0x125b44){if(_0x125b44){return _0x125b44['removeAgents'](_0x58c8bf[_0x5770('0x46')]['ids'])[_0x5770('0x21')](function(){if(_[_0x5770('0xb3')](_0x58c8bf['query'][_0x5770('0x67')])){for(var _0x4b7925=0x0;_0x4b7925<_0x58c8bf[_0x5770('0x46')]['ids']['length'];_0x4b7925+=0x1){socket[_0x5770('0xb1')]('userFaxAccount:remove',{'UserId':Number(_0x58c8bf[_0x5770('0x46')][_0x5770('0x67')][_0x4b7925]),'FaxAccountId':Number(_0x58c8bf[_0x5770('0x57')]['id'])});}}else{socket[_0x5770('0xb1')](_0x5770('0xb4'),{'UserId':Number(_0x58c8bf[_0x5770('0x46')][_0x5770('0x67')]),'FaxAccountId':Number(_0x58c8bf[_0x5770('0x57')]['id'])});}});}})[_0x5770('0x21')](respondWithStatusCode(_0x23a88b,null))[_0x5770('0x2a')](handleError(_0x23a88b,null));};exports[_0x5770('0xb5')]=function(_0x270998,_0x60b36a,_0x3c6e59){var _0x2ee9a1={};var _0x119731={};var _0x333728;var _0x46671c;return db[_0x5770('0x3e')][_0x5770('0x63')]({'where':{'id':_0x270998['params']['id']}})[_0x5770('0x21')](handleEntityNotFound(_0x60b36a,null))['then'](function(_0x570b7d){if(_0x570b7d){_0x333728=_0x570b7d;_0x119731[_0x5770('0x43')]=_[_0x5770('0x45')](db[_0x5770('0x70')][_0x5770('0x3f')]);_0x119731[_0x5770('0x46')]=_[_0x5770('0x45')](_0x270998['query']);_0x119731[_0x5770('0x47')]=_['intersection'](_0x119731['model'],_0x119731['query']);_0x2ee9a1[_0x5770('0x49')]=_['intersection'](_0x119731[_0x5770('0x43')],qs[_0x5770('0x4a')](_0x270998['query']['fields']));_0x2ee9a1[_0x5770('0x49')]=_0x2ee9a1[_0x5770('0x49')][_0x5770('0x4b')]?_0x2ee9a1[_0x5770('0x49')]:_0x119731[_0x5770('0x43')];_0x2ee9a1[_0x5770('0x4c')]=qs[_0x5770('0x4d')](_0x270998['query']['sort']);_0x2ee9a1[_0x5770('0x4e')]=qs[_0x5770('0x47')](_[_0x5770('0x4f')](_0x270998[_0x5770('0x46')],_0x119731['filters']));if(_0x270998[_0x5770('0x46')][_0x5770('0x50')]){_0x2ee9a1[_0x5770('0x4e')]=_[_0x5770('0x51')](_0x2ee9a1[_0x5770('0x4e')],{'$or':_[_0x5770('0x44')](_0x2ee9a1[_0x5770('0x49')],function(_0x5ef5d1){var _0xcddc59={};_0xcddc59[_0x5ef5d1]={'$like':'%'+_0x270998['query'][_0x5770('0x50')]+'%'};return _0xcddc59;})});}_0x2ee9a1=_[_0x5770('0x51')]({},_0x2ee9a1,_0x270998[_0x5770('0x6b')]);return _0x333728[_0x5770('0xb5')](_0x2ee9a1);}})[_0x5770('0x21')](function(_0x1e12aa){if(_0x1e12aa){_0x46671c=_0x1e12aa['length'];if(!_0x270998[_0x5770('0x46')][_0x5770('0x64')](_0x5770('0x65'))){_0x2ee9a1['limit']=qs[_0x5770('0x30')](_0x270998[_0x5770('0x46')][_0x5770('0x30')]);_0x2ee9a1[_0x5770('0x2e')]=qs[_0x5770('0x2e')](_0x270998[_0x5770('0x46')][_0x5770('0x2e')]);}return _0x333728[_0x5770('0xb5')](_0x2ee9a1);}})['then'](function(_0x25435f){if(_0x25435f){return _0x25435f?{'count':_0x46671c,'rows':_0x25435f}:null;}})[_0x5770('0x21')](respondWithResult(_0x60b36a,null))[_0x5770('0x2a')](handleError(_0x60b36a,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 4fdf7c9..2bc95ca 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 _0x787c=['exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2414fd,_0x34cc5c){var _0x4fab16=function(_0x1bb338){while(--_0x1bb338){_0x2414fd['push'](_0x2414fd['shift']());}};_0x4fab16(++_0x34cc5c);}(_0x787c,0x172));var _0xc787=function(_0x5f2f49,_0x9de0fa){_0x5f2f49=_0x5f2f49-0x0;var _0x5c0bf9=_0x787c[_0x5f2f49];return _0x5c0bf9;};'use strict';var EventEmitter=require(_0xc787('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xc787('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc787('0x2')](0x0);var events={'afterCreate':_0xc787('0x3'),'afterUpdate':_0xc787('0x4'),'afterDestroy':_0xc787('0x5')};function emitEvent(_0x2c6bd1){return function(_0x3fbe2b,_0x3e46bb,_0x1c2bb4){FaxAccountEvents[_0xc787('0x6')](_0x2c6bd1+':'+_0x3fbe2b['id'],_0x3fbe2b);FaxAccountEvents[_0xc787('0x6')](_0x2c6bd1,_0x3fbe2b);_0x1c2bb4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xc787('0x7')](e,emitEvent(event));}}module[_0xc787('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xca31=['hasOwnProperty','hook','events','FaxAccount','save','update','remove','emit'];(function(_0x1e7d80,_0x28ea35){var _0x1fb199=function(_0x5a6353){while(--_0x5a6353){_0x1e7d80['push'](_0x1e7d80['shift']());}};_0x1fb199(++_0x28ea35);}(_0xca31,0x18a));var _0x1ca3=function(_0x4bf991,_0x3601af){_0x4bf991=_0x4bf991-0x0;var _0x5aa517=_0xca31[_0x4bf991];return _0x5aa517;};'use strict';var EventEmitter=require(_0x1ca3('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x1ca3('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ca3('0x2'),'afterUpdate':_0x1ca3('0x3'),'afterDestroy':_0x1ca3('0x4')};function emitEvent(_0x291c3c){return function(_0x437ff8,_0x3810a8,_0x178368){FaxAccountEvents[_0x1ca3('0x5')](_0x291c3c+':'+_0x437ff8['id'],_0x437ff8);FaxAccountEvents[_0x1ca3('0x5')](_0x291c3c,_0x437ff8);_0x178368(null);};}for(var e in events){if(events[_0x1ca3('0x6')](e)){var event=events[e];FaxAccount[_0x1ca3('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index a4bc80b..d2c03c3 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 _0x6ebf=['../../config/environment','./faxAccount.attributes','exports','lodash','util','api','moment','path'];(function(_0x295df8,_0x1f9924){var _0x1c4b61=function(_0x55f262){while(--_0x55f262){_0x295df8['push'](_0x295df8['shift']());}};_0x1c4b61(++_0x1f9924);}(_0x6ebf,0x9b));var _0xf6eb=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0x6ebf[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0xf6eb('0x0'));var util=require(_0xf6eb('0x1'));var logger=require('../../config/logger')(_0xf6eb('0x2'));var moment=require(_0xf6eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6eb('0x4'));var rimraf=require('rimraf');var config=require(_0xf6eb('0x5'));var attributes=require(_0xf6eb('0x6'));module[_0xf6eb('0x7')]=function(_0x55b6e3,_0x3af559){return _0x55b6e3['define']('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfb8=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x30631d,_0x184906){var _0x86c0a7=function(_0x41b75e){while(--_0x41b75e){_0x30631d['push'](_0x30631d['shift']());}};_0x86c0a7(++_0x184906);}(_0xbfb8,0x74));var _0x8bfb=function(_0xfb2493,_0x315da9){_0xfb2493=_0xfb2493-0x0;var _0x5c5d24=_0xbfb8[_0xfb2493];return _0x5c5d24;};'use strict';var _=require(_0x8bfb('0x0'));var util=require(_0x8bfb('0x1'));var logger=require(_0x8bfb('0x2'))('api');var moment=require(_0x8bfb('0x3'));var BPromise=require(_0x8bfb('0x4'));var rp=require(_0x8bfb('0x5'));var fs=require('fs');var path=require(_0x8bfb('0x6'));var rimraf=require(_0x8bfb('0x7'));var config=require(_0x8bfb('0x8'));var attributes=require('./faxAccount.attributes');module[_0x8bfb('0x9')]=function(_0x34bc3f,_0x1d21b5){return _0x34bc3f[_0x8bfb('0xa')](_0x8bfb('0xb'),attributes,{'tableName':_0x8bfb('0xc'),'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 8cb8803..1087ad5 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 _0xa132=['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','from','find','account','CmList','List','Contacts','Applications','get','applications','priority','length','defaults','create','FaxInteraction','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','./faxAccount.socket','register','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','model','debug','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil'];(function(_0x31ef25,_0x424c57){var _0x18e3b1=function(_0x36abc5){while(--_0x36abc5){_0x31ef25['push'](_0x31ef25['shift']());}};_0x18e3b1(++_0x424c57);}(_0xa132,0x1d7));var _0x2a13=function(_0x5ce33c,_0x5c75a9){_0x5ce33c=_0x5ce33c-0x0;var _0x40c7d4=_0xa132[_0x5ce33c];return _0x40c7d4;};'use strict';var _=require(_0x2a13('0x0'));var util=require(_0x2a13('0x1'));var moment=require(_0x2a13('0x2'));var BPromise=require(_0x2a13('0x3'));var rs=require(_0x2a13('0x4'));var fs=require('fs');var Redis=require(_0x2a13('0x5'));var db=require(_0x2a13('0x6'))['db'];var utils=require(_0x2a13('0x7'));var logger=require(_0x2a13('0x8'))('rpc');var config=require(_0x2a13('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2a13('0xa')][_0x2a13('0xb')]({'port':0x232c});config[_0x2a13('0xc')]=_['defaults'](config[_0x2a13('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a13('0xc')]));require(_0x2a13('0xd'))[_0x2a13('0xe')](socket);function respondWithRpcPromise(_0xc8f0ef,_0x51467d,_0x21548d){return new BPromise(function(_0x21a315,_0xdb5d9a){return client[_0x2a13('0xf')](_0xc8f0ef,_0x21548d)[_0x2a13('0x10')](function(_0x731829){logger[_0x2a13('0x11')]('FaxAccount,\x20%s,\x20%s',_0x51467d,_0x2a13('0x12'));logger['debug'](_0x2a13('0x13'),_0x51467d,_0x2a13('0x12'),JSON[_0x2a13('0x14')](_0x731829));if(_0x731829[_0x2a13('0x15')]){if(_0x731829['error'][_0x2a13('0x16')]===0x1f4){logger[_0x2a13('0x15')](_0x2a13('0x17'),_0x51467d,_0x731829[_0x2a13('0x15')][_0x2a13('0x18')]);return _0xdb5d9a(_0x731829['error'][_0x2a13('0x18')]);}logger[_0x2a13('0x15')](_0x2a13('0x17'),_0x51467d,_0x731829['error']['message']);return _0x21a315(_0x731829[_0x2a13('0x15')][_0x2a13('0x18')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x51467d,'request\x20sent');_0x21a315(_0x731829['result']['message']);}})[_0x2a13('0x19')](function(_0x34fdd7){logger[_0x2a13('0x15')]('FaxAccount,\x20%s,\x20%s',_0x51467d,_0x34fdd7);_0xdb5d9a(_0x34fdd7);});});}exports[_0x2a13('0x1a')]=function(_0x158bce){var _0x9b934f=this;return new Promise(function(_0x5b1765,_0x5c75a0){return db[_0x2a13('0x1b')][_0x2a13('0x1c')]({'raw':_0x158bce[_0x2a13('0x1d')]?_0x158bce['options'][_0x2a13('0x1e')]===undefined?!![]:![]:!![],'where':_0x158bce['options']?_0x158bce[_0x2a13('0x1d')][_0x2a13('0x1f')]||null:null,'attributes':_0x158bce[_0x2a13('0x1d')]?_0x158bce[_0x2a13('0x1d')][_0x2a13('0x20')]||null:null,'limit':_0x158bce['options']?_0x158bce[_0x2a13('0x1d')][_0x2a13('0x21')]||null:null,'include':_0x158bce[_0x2a13('0x1d')]?_0x158bce['options']['include']?_['map'](_0x158bce[_0x2a13('0x1d')][_0x2a13('0x22')],function(_0x277e37){return{'model':db[_0x277e37['model']],'as':_0x277e37['as'],'attributes':_0x277e37[_0x2a13('0x20')],'include':_0x277e37['include']?_['map'](_0x277e37[_0x2a13('0x22')],function(_0x23d120){return{'model':db[_0x23d120[_0x2a13('0x23')]],'as':_0x23d120['as'],'attributes':_0x23d120['attributes'],'include':_0x23d120[_0x2a13('0x22')]?_['map'](_0x23d120[_0x2a13('0x22')],function(_0x381b59){return{'model':db[_0x381b59[_0x2a13('0x23')]],'as':_0x381b59['as'],'attributes':_0x381b59[_0x2a13('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10c3f6){logger['info'](_0x2a13('0x1a'),_0x158bce);logger[_0x2a13('0x24')](_0x2a13('0x1a'),_0x158bce,JSON['stringify'](_0x10c3f6));_0x5b1765(_0x10c3f6);})[_0x2a13('0x19')](function(_0x4cb0da){logger[_0x2a13('0x15')](_0x2a13('0x1a'),_0x4cb0da['message'],_0x158bce);_0x5c75a0(_0x9b934f[_0x2a13('0x15')](0x1f4,_0x4cb0da[_0x2a13('0x18')]));});});};exports[_0x2a13('0x25')]=function(_0x4b504d,_0x372b8e,_0x50bd85){var _0x297db7=this;return new Promise(function(_0x37f0f1,_0x3d5c5c){var _0x135f3a={'body':_0x4b504d[_0x2a13('0x26')],'channel':_0x2a13('0x27')};var _0x3b7970=[];var _0x2aec09=[];var _0x8554b={};return db[_0x2a13('0x28')]['describe']()[_0x2a13('0x10')](function(_0x502c6e){if(!_0x502c6e){throw new db[(_0x2a13('0x29'))][(_0x2a13('0x2a'))](_0x2a13('0x2b'));}_0x3b7970=_[_0x2a13('0x2c')](_[_0x2a13('0x2d')](_0x502c6e),[_0x2a13('0x2e'),_0x2a13('0x2f')]);_0x2aec09=_[_0x2a13('0x2c')](_['keys'](_0x502c6e),[_0x2a13('0x2e'),_0x2a13('0x2f'),_0x2a13('0x30'),_0x2a13('0x31')]);if(_0x4b504d[_0x2a13('0x26')]['id']){delete _0x4b504d['body']['id'];}if(_[_0x2a13('0x32')](_0x4b504d[_0x2a13('0x26')]['from'])){throw new db[(_0x2a13('0x29'))][(_0x2a13('0x2a'))](_0x2a13('0x33'));}if(_[_0x2a13('0x32')](_0x4b504d[_0x2a13('0x26')][_0x2a13('0x26')])||_0x4b504d[_0x2a13('0x26')][_0x2a13('0x26')]===''){throw new db[(_0x2a13('0x29'))][(_0x2a13('0x2a'))](_0x2a13('0x34'));}if(_['isNil'](_0x4b504d[_0x2a13('0x26')][_0x2a13('0x35')])){throw new db['Sequelize'][(_0x2a13('0x2a'))](_0x2a13('0x36')+_0x2aec09);}if(!_[_0x2a13('0x37')](_0x2aec09,_0x4b504d['body'][_0x2a13('0x35')])){throw new db['Sequelize'][(_0x2a13('0x2a'))](_0x2a13('0x38')+_0x2aec09);}_0x8554b[_0x4b504d['body']['mapKey']]=_0x4b504d[_0x2a13('0x26')][_0x2a13('0x39')];})[_0x2a13('0x10')](function(){return db['FaxAccount'][_0x2a13('0x3a')]({'where':{'id':_0x4b504d[_0x2a13('0x3b')]['id']},'include':[{'model':db[_0x2a13('0x3c')],'as':_0x2a13('0x3d'),'include':[{'model':db['CmContact'],'as':_0x2a13('0x3e'),'where':_0x8554b,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['FaxApplication'],'as':_0x2a13('0x3f')}]});})[_0x2a13('0x10')](function(_0x5ba9e9){if(_0x5ba9e9&&_0x5ba9e9[_0x2a13('0x3d')]){var _0x54a550=_0x5ba9e9[_0x2a13('0x40')]({'plain':!![]});_0x135f3a['account']=_0x54a550;_0x135f3a[_0x2a13('0x41')]=_0x54a550[_0x2a13('0x3f')];_0x135f3a['list']=_0x54a550[_0x2a13('0x3d')];_0x135f3a[_0x2a13('0x41')]=_['orderBy'](_0x135f3a['applications'],[_0x2a13('0x42')],['asc']);if(_0x135f3a[_0x2a13('0x3b')][_0x2a13('0x3f')]){delete _0x135f3a[_0x2a13('0x3b')]['Applications'];}if(_0x135f3a[_0x2a13('0x3b')][_0x2a13('0x3d')]&&_0x135f3a[_0x2a13('0x3b')][_0x2a13('0x3d')]['Contacts'][_0x2a13('0x43')]){return _0x135f3a['account'][_0x2a13('0x3d')][_0x2a13('0x3e')][0x0];}var _0x5705ab=_[_0x2a13('0x44')](_0x4b504d['body'],{'firstName':_0x4b504d[_0x2a13('0x26')]['from'],'ListId':_0x54a550[_0x2a13('0x31')]});_0x5705ab[_0x4b504d['body'][_0x2a13('0x35')]]=_0x4b504d[_0x2a13('0x26')]['from'];return db['CmContact'][_0x2a13('0x45')](_0x5705ab,{'fields':_0x3b7970,'raw':!![]});}})[_0x2a13('0x10')](function(_0x59ae59){_0x135f3a['contact']=_0x59ae59;if(_0x59ae59){var _0x173ba2={'ContactId':_0x59ae59['id'],'FaxAccountId':_0x4b504d['account']['id'],'fax':_0x59ae59['fax']};return db[_0x2a13('0x46')][_0x2a13('0x3a')]({'where':{'ContactId':_0x59ae59['id'],'closed':![],'FaxAccountId':_0x4b504d[_0x2a13('0x3b')]['id']}})[_0x2a13('0x10')](function(_0x124bb5){if(_0x124bb5){return[_0x124bb5,![]];}return db['FaxInteraction'][_0x2a13('0x45')](_0x173ba2)[_0x2a13('0x10')](function(_0x5d8fd2){return[_0x5d8fd2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x452c0a,_0xee76ef){var _0x297b69=_0x452c0a['get']({'plain':!![]});if(_0xee76ef){if(_0x135f3a[_0x2a13('0x3b')][_0x2a13('0x47')]){_0x135f3a[_0x2a13('0x41')][_0x2a13('0x48')]({'id':0x0,'priority':_0x135f3a[_0x2a13('0x41')][_0x2a13('0x43')]+0x1,'app':_0x2a13('0x49'),'appdata':_0x2a13('0x4a'),'interval':_0x2a13('0x4b')});}_0x297b69[_0x2a13('0x4c')]=!![];}else{_0x297b69[_0x2a13('0x4c')]=![];}_0x135f3a[_0x2a13('0x4d')]=_0x297b69;return db[_0x2a13('0x4e')]['create']({'body':_0x4b504d[_0x2a13('0x26')][_0x2a13('0x26')],'FaxAccountId':_0x4b504d['account']['id'],'FaxInteractionId':_0x452c0a['id'],'direction':'in','ContactId':_0x452c0a['ContactId'],'AttachmentId':_0x4b504d['body'][_0x2a13('0x4f')]});})[_0x2a13('0x10')](function(_0x19c9a7){_0x135f3a['message']=_0x19c9a7;if(_0x135f3a[_0x2a13('0x4d')][_0x2a13('0x50')]){return db['User'][_0x2a13('0x3a')]({'attributes':['id','name'],'where':{'id':_0x135f3a[_0x2a13('0x4d')][_0x2a13('0x50')]}})[_0x2a13('0x10')](function(_0x35607a){if(_0x35607a){_0x135f3a[_0x2a13('0x41')][_0x2a13('0x51')]({'id':0x0,'priority':0x0,'app':_0x2a13('0x52'),'appdata':_0x35607a[_0x2a13('0x53')]+','+(_0x135f3a['account'][_0x2a13('0x54')]||0xa),'interval':_0x2a13('0x4b')});}return respondWithRpcPromise('Start',_0x2a13('0x55'),_0x135f3a);});}return respondWithRpcPromise(_0x2a13('0x56'),_0x2a13('0x55'),_0x135f3a);})[_0x2a13('0x10')](function(_0x426b8e){_0x37f0f1(_0x426b8e);})[_0x2a13('0x19')](function(_0x553027){_0x3d5c5c(_0x297db7[_0x2a13('0x15')](0x1f4,_0x553027[_0x2a13('0x18')]));});});}; \ No newline at end of file +var _0x77e5=['code','message','FaxAccount,\x20%s,\x20%s','info','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','keys','createdAt','updatedAt','isNil','from','from\x20is\x20mandatory','Sequelize','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','DESC','get','Applications','list','applications','priority','asc','Contacts','length','defaults','ListId','create','contact','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','User','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','ioredis','rpc','jayson/promise','client','http','redis','./faxAccount.socket','register','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11238d,_0x499ac8){var _0x3686b0=function(_0x1b7cbc){while(--_0x1b7cbc){_0x11238d['push'](_0x11238d['shift']());}};_0x3686b0(++_0x499ac8);}(_0x77e5,0x13f));var _0x577e=function(_0x297329,_0x346c6a){_0x297329=_0x297329-0x0;var _0x145b79=_0x77e5[_0x297329];return _0x145b79;};'use strict';var _=require(_0x577e('0x0'));var util=require(_0x577e('0x1'));var moment=require(_0x577e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x577e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x577e('0x4'));var config=require('../../config/environment');var jayson=require(_0x577e('0x5'));var client=jayson[_0x577e('0x6')][_0x577e('0x7')]({'port':0x232c});config[_0x577e('0x8')]=_['defaults'](config[_0x577e('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x577e('0x9'))[_0x577e('0xa')](socket);function respondWithRpcPromise(_0x393f4c,_0x562835,_0x529e91){return new BPromise(function(_0x5a410b,_0x20fc0d){return client['request'](_0x393f4c,_0x529e91)[_0x577e('0xb')](function(_0x4c178b){logger['info']('FaxAccount,\x20%s,\x20%s',_0x562835,_0x577e('0xc'));logger[_0x577e('0xd')](_0x577e('0xe'),_0x562835,_0x577e('0xc'),JSON[_0x577e('0xf')](_0x4c178b));if(_0x4c178b['error']){if(_0x4c178b[_0x577e('0x10')][_0x577e('0x11')]===0x1f4){logger[_0x577e('0x10')]('FaxAccount,\x20%s,\x20%s',_0x562835,_0x4c178b['error']['message']);return _0x20fc0d(_0x4c178b[_0x577e('0x10')][_0x577e('0x12')]);}logger[_0x577e('0x10')](_0x577e('0x13'),_0x562835,_0x4c178b['error']['message']);return _0x5a410b(_0x4c178b[_0x577e('0x10')][_0x577e('0x12')]);}else{logger[_0x577e('0x14')](_0x577e('0x13'),_0x562835,'request\x20sent');_0x5a410b(_0x4c178b[_0x577e('0x15')][_0x577e('0x12')]);}})[_0x577e('0x16')](function(_0x5ef9a1){logger[_0x577e('0x10')](_0x577e('0x13'),_0x562835,_0x5ef9a1);_0x20fc0d(_0x5ef9a1);});});}exports['GetFaxAccount']=function(_0x25516){var _0x15f3f0=this;return new Promise(function(_0x24d8d0,_0x46f84a){return db[_0x577e('0x17')][_0x577e('0x18')]({'raw':_0x25516[_0x577e('0x19')]?_0x25516[_0x577e('0x19')][_0x577e('0x1a')]===undefined?!![]:![]:!![],'where':_0x25516[_0x577e('0x19')]?_0x25516['options'][_0x577e('0x1b')]||null:null,'attributes':_0x25516[_0x577e('0x19')]?_0x25516[_0x577e('0x19')][_0x577e('0x1c')]||null:null,'limit':_0x25516[_0x577e('0x19')]?_0x25516[_0x577e('0x19')][_0x577e('0x1d')]||null:null,'include':_0x25516[_0x577e('0x19')]?_0x25516[_0x577e('0x19')][_0x577e('0x1e')]?_[_0x577e('0x1f')](_0x25516[_0x577e('0x19')][_0x577e('0x1e')],function(_0x41f44a){return{'model':db[_0x41f44a[_0x577e('0x20')]],'as':_0x41f44a['as'],'attributes':_0x41f44a['attributes'],'include':_0x41f44a[_0x577e('0x1e')]?_[_0x577e('0x1f')](_0x41f44a[_0x577e('0x1e')],function(_0x5700b9){return{'model':db[_0x5700b9[_0x577e('0x20')]],'as':_0x5700b9['as'],'attributes':_0x5700b9['attributes'],'include':_0x5700b9[_0x577e('0x1e')]?_['map'](_0x5700b9['include'],function(_0x9b92c3){return{'model':db[_0x9b92c3[_0x577e('0x20')]],'as':_0x9b92c3['as'],'attributes':_0x9b92c3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xf5265e){logger[_0x577e('0x14')](_0x577e('0x21'),_0x25516);logger[_0x577e('0xd')](_0x577e('0x21'),_0x25516,JSON[_0x577e('0xf')](_0xf5265e));_0x24d8d0(_0xf5265e);})[_0x577e('0x16')](function(_0x24b2c7){logger[_0x577e('0x10')](_0x577e('0x21'),_0x24b2c7['message'],_0x25516);_0x46f84a(_0x15f3f0[_0x577e('0x10')](0x1f4,_0x24b2c7[_0x577e('0x12')]));});});};exports[_0x577e('0x22')]=function(_0x969a9,_0x10cc89,_0x2b0500){var _0x1cd42a=this;return new Promise(function(_0x4704ea,_0x3cca7b){var _0x6d8f3a={'body':_0x969a9[_0x577e('0x23')],'channel':_0x577e('0x24')};var _0x13dd67=[];var _0x5540ba=[];var _0x542c9a={};return db[_0x577e('0x25')][_0x577e('0x26')]()[_0x577e('0xb')](function(_0x526630){if(!_0x526630){throw new db['Sequelize'][(_0x577e('0x27'))]('no\x20available\x20attributes');}_0x13dd67=_['difference'](_[_0x577e('0x28')](_0x526630),[_0x577e('0x29'),_0x577e('0x2a')]);_0x5540ba=_['difference'](_[_0x577e('0x28')](_0x526630),['createdAt','updatedAt','CompanyId','ListId']);if(_0x969a9[_0x577e('0x23')]['id']){delete _0x969a9[_0x577e('0x23')]['id'];}if(_[_0x577e('0x2b')](_0x969a9[_0x577e('0x23')][_0x577e('0x2c')])){throw new db['Sequelize']['ValidationError'](_0x577e('0x2d'));}if(_[_0x577e('0x2b')](_0x969a9[_0x577e('0x23')]['body'])||_0x969a9[_0x577e('0x23')][_0x577e('0x23')]===''){throw new db[(_0x577e('0x2e'))]['ValidationError'](_0x577e('0x2f'));}if(_[_0x577e('0x2b')](_0x969a9[_0x577e('0x23')][_0x577e('0x30')])){throw new db[(_0x577e('0x2e'))]['ValidationError'](_0x577e('0x31')+_0x5540ba);}if(!_[_0x577e('0x32')](_0x5540ba,_0x969a9[_0x577e('0x23')][_0x577e('0x30')])){throw new db['Sequelize'][(_0x577e('0x27'))](_0x577e('0x33')+_0x5540ba);}_0x542c9a[_0x969a9[_0x577e('0x23')][_0x577e('0x30')]]=_0x969a9[_0x577e('0x23')][_0x577e('0x2c')];})['then'](function(){return db['FaxAccount'][_0x577e('0x34')]({'where':{'id':_0x969a9[_0x577e('0x35')]['id']},'include':[{'model':db['CmList'],'as':_0x577e('0x36'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x542c9a,'limit':0x1,'order':[[_0x577e('0x2a'),_0x577e('0x37')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x577e('0xb')](function(_0x5ac0af){if(_0x5ac0af&&_0x5ac0af[_0x577e('0x36')]){var _0x382604=_0x5ac0af[_0x577e('0x38')]({'plain':!![]});_0x6d8f3a[_0x577e('0x35')]=_0x382604;_0x6d8f3a['applications']=_0x382604[_0x577e('0x39')];_0x6d8f3a[_0x577e('0x3a')]=_0x382604[_0x577e('0x36')];_0x6d8f3a[_0x577e('0x3b')]=_['orderBy'](_0x6d8f3a[_0x577e('0x3b')],[_0x577e('0x3c')],[_0x577e('0x3d')]);if(_0x6d8f3a[_0x577e('0x35')]['Applications']){delete _0x6d8f3a[_0x577e('0x35')][_0x577e('0x39')];}if(_0x6d8f3a[_0x577e('0x35')][_0x577e('0x36')]&&_0x6d8f3a['account'][_0x577e('0x36')][_0x577e('0x3e')][_0x577e('0x3f')]){return _0x6d8f3a['account'][_0x577e('0x36')][_0x577e('0x3e')][0x0];}var _0x23ac14=_[_0x577e('0x40')](_0x969a9['body'],{'firstName':_0x969a9[_0x577e('0x23')]['from'],'ListId':_0x382604[_0x577e('0x41')]});_0x23ac14[_0x969a9[_0x577e('0x23')][_0x577e('0x30')]]=_0x969a9[_0x577e('0x23')][_0x577e('0x2c')];return db[_0x577e('0x25')][_0x577e('0x42')](_0x23ac14,{'fields':_0x13dd67,'raw':!![]});}})[_0x577e('0xb')](function(_0x4586ab){_0x6d8f3a[_0x577e('0x43')]=_0x4586ab;if(_0x4586ab){var _0x4eb532={'ContactId':_0x4586ab['id'],'FaxAccountId':_0x969a9[_0x577e('0x35')]['id'],'fax':_0x4586ab[_0x577e('0x24')]};return db['FaxInteraction'][_0x577e('0x34')]({'where':{'ContactId':_0x4586ab['id'],'closed':![],'FaxAccountId':_0x969a9[_0x577e('0x35')]['id']}})[_0x577e('0xb')](function(_0x486065){if(_0x486065){return[_0x486065,![]];}return db['FaxInteraction'][_0x577e('0x42')](_0x4eb532)[_0x577e('0xb')](function(_0x2ab100){return[_0x2ab100,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x129548,_0x12905c){var _0x92e75b=_0x129548[_0x577e('0x38')]({'plain':!![]});if(_0x12905c){if(_0x6d8f3a[_0x577e('0x35')]['autoclose']){_0x6d8f3a['applications'][_0x577e('0x44')]({'id':0x0,'priority':_0x6d8f3a[_0x577e('0x3b')]['length']+0x1,'app':_0x577e('0x45'),'appdata':_0x577e('0x46'),'interval':_0x577e('0x47')});}_0x92e75b[_0x577e('0x48')]=!![];}else{_0x92e75b[_0x577e('0x48')]=![];}_0x6d8f3a[_0x577e('0x49')]=_0x92e75b;return db['FaxMessage']['create']({'body':_0x969a9[_0x577e('0x23')][_0x577e('0x23')],'FaxAccountId':_0x969a9[_0x577e('0x35')]['id'],'FaxInteractionId':_0x129548['id'],'direction':'in','ContactId':_0x129548[_0x577e('0x4a')],'AttachmentId':_0x969a9['body'][_0x577e('0x4b')]});})[_0x577e('0xb')](function(_0x418f91){_0x6d8f3a[_0x577e('0x12')]=_0x418f91;if(_0x6d8f3a[_0x577e('0x49')]['UserId']){return db[_0x577e('0x4c')][_0x577e('0x34')]({'attributes':['id','name'],'where':{'id':_0x6d8f3a[_0x577e('0x49')][_0x577e('0x4d')]}})[_0x577e('0xb')](function(_0x3306a0){if(_0x3306a0){_0x6d8f3a[_0x577e('0x3b')][_0x577e('0x4e')]({'id':0x0,'priority':0x0,'app':_0x577e('0x4f'),'appdata':_0x3306a0[_0x577e('0x50')]+','+(_0x6d8f3a[_0x577e('0x35')][_0x577e('0x51')]||0xa),'interval':_0x577e('0x47')});}return respondWithRpcPromise(_0x577e('0x52'),_0x577e('0x53'),_0x6d8f3a);});}return respondWithRpcPromise('Start',_0x577e('0x53'),_0x6d8f3a);})[_0x577e('0xb')](function(_0x2ed791){_0x4704ea(_0x2ed791);})[_0x577e('0x16')](function(_0x3b5357){_0x3cca7b(_0x1cd42a['error'](0x1f4,_0x3b5357['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index d7734ff..f513bba 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 _0xc685=['removeListener','register','length','faxAccount:','update','emit'];(function(_0x29b54f,_0x2e868b){var _0x596002=function(_0x45ccd0){while(--_0x45ccd0){_0x29b54f['push'](_0x29b54f['shift']());}};_0x596002(++_0x2e868b);}(_0xc685,0x190));var _0x5c68=function(_0x1717dd,_0x4bf8ab){_0x1717dd=_0x1717dd-0x0;var _0x372284=_0xc685[_0x1717dd];return _0x372284;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save','remove',_0x5c68('0x0')];function createListener(_0x4861ec,_0xc4f35d){return function(_0x5d12b7){_0xc4f35d[_0x5c68('0x1')](_0x4861ec,_0x5d12b7);};}function removeListener(_0xc0f2cc,_0x4f3d53){return function(){FaxAccountEvents[_0x5c68('0x2')](_0xc0f2cc,_0x4f3d53);};}exports[_0x5c68('0x3')]=function(_0x1e36c6){for(var _0x27913c=0x0,_0x27792a=events[_0x5c68('0x4')];_0x27913c<_0x27792a;_0x27913c++){var _0x540ce2=events[_0x27913c];var _0x5b3fd0=createListener(_0x5c68('0x5')+_0x540ce2,_0x1e36c6);FaxAccountEvents['on'](_0x540ce2,_0x5b3fd0);}}; \ No newline at end of file +var _0xf116=['update','emit','removeListener','register','length','remove'];(function(_0x47a461,_0x42ef32){var _0x39e6ff=function(_0x505602){while(--_0x505602){_0x47a461['push'](_0x47a461['shift']());}};_0x39e6ff(++_0x42ef32);}(_0xf116,0x83));var _0x6f11=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0xf116[_0x2a0fc4];return _0x531d00;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x6f11('0x0'),_0x6f11('0x1')];function createListener(_0x1f356c,_0x213313){return function(_0x1b5067){_0x213313[_0x6f11('0x2')](_0x1f356c,_0x1b5067);};}function removeListener(_0x246568,_0x27d6aa){return function(){FaxAccountEvents[_0x6f11('0x3')](_0x246568,_0x27d6aa);};}exports[_0x6f11('0x4')]=function(_0x59df24){for(var _0x44e530=0x0,_0x88a97f=events[_0x6f11('0x5')];_0x44e530<_0x88a97f;_0x44e530++){var _0x58406a=events[_0x44e530];var _0x1af194=createListener('faxAccount:'+_0x58406a,_0x59df24);FaxAccountEvents['on'](_0x58406a,_0x1af194);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index f214da3..0637fe6 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x250929,_0x12bd11){var _0x329744=function(_0x5a951a){while(--_0x5a951a){_0x250929['push'](_0x250929['shift']());}};_0x329744(++_0x12bd11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x4e8a44,_0xd0d7dd){var _0x5ce552=function(_0x5576f3){while(--_0x5576f3){_0x4e8a44['push'](_0x4e8a44['shift']());}};_0x5ce552(++_0xd0d7dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 673814b..ebc8a3b 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 _0xf501=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf501,0x198));var _0x1f50=function(_0x535db0,_0x59b3de){_0x535db0=_0x535db0-0x0;var _0x489cff=_0xf501[_0x535db0];return _0x489cff;};'use strict';var Sequelize=require(_0x1f50('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1f50('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1f50('0x2')],'allowNull':![],'defaultValue':_0x1f50('0x3')},'appdata':{'type':Sequelize[_0x1f50('0x4')]()},'description':{'type':Sequelize[_0x1f50('0x2')]},'interval':{'type':Sequelize[_0x1f50('0x2')],'defaultValue':_0x1f50('0x5')}}; \ No newline at end of file +var _0x06a5=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06a5,0x6a));var _0x506a=function(_0x3f00ce,_0xb4ec77){_0x3f00ce=_0x3f00ce-0x0;var _0x2748bd=_0x06a5[_0x3f00ce];return _0x2748bd;};'use strict';var Sequelize=require(_0x506a('0x0'));module[_0x506a('0x1')]={'priority':{'type':Sequelize[_0x506a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x506a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x506a('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 74df2c2..fc4a7e3 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 _0xa220=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes'];(function(_0x4b3e9a,_0xdef4f7){var _0x45dcf8=function(_0x2491fd){while(--_0x2491fd){_0x4b3e9a['push'](_0x4b3e9a['shift']());}};_0x45dcf8(++_0xdef4f7);}(_0xa220,0x189));var _0x0a22=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa220[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0a22('0x0'));var jsonpatch=require(_0x0a22('0x1'));var rp=require(_0x0a22('0x2'));var moment=require(_0x0a22('0x3'));var BPromise=require(_0x0a22('0x4'));var Mustache=require(_0x0a22('0x5'));var util=require(_0x0a22('0x6'));var path=require(_0x0a22('0x7'));var sox=require(_0x0a22('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0a22('0x9'));var jsforce=require(_0x0a22('0xa'));var deskjs=require(_0x0a22('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0a22('0xc'));var Papa=require(_0x0a22('0xd'));var Redis=require(_0x0a22('0xe'));var authService=require(_0x0a22('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a22('0x10'));var logger=require(_0x0a22('0x11'))(_0x0a22('0x12'));var utils=require('../../config/utils');var config=require(_0x0a22('0x13'));var licenseUtil=require(_0x0a22('0x14'));var db=require(_0x0a22('0x15'))['db'];function respondWithStatusCode(_0x367ad5,_0xf937ae){_0xf937ae=_0xf937ae||0xcc;return function(_0x521a6c){if(_0x521a6c){return _0x367ad5[_0x0a22('0x16')](_0xf937ae);}return _0x367ad5[_0x0a22('0x17')](_0xf937ae)['end']();};}function respondWithResult(_0x45a679,_0x3bc303){_0x3bc303=_0x3bc303||0xc8;return function(_0x56dc3a){if(_0x56dc3a){return _0x45a679['status'](_0x3bc303)[_0x0a22('0x18')](_0x56dc3a);}};}function respondWithFilteredResult(_0x2b33a3,_0x33de9c){return function(_0xc598f7){if(_0xc598f7){var _0x3cf746=typeof _0x33de9c[_0x0a22('0x19')]===_0x0a22('0x1a')&&typeof _0x33de9c[_0x0a22('0x1b')]==='undefined';var _0x55b0b5=_0xc598f7[_0x0a22('0x1c')];var _0x221089=_0x3cf746?0x0:_0x33de9c[_0x0a22('0x19')];var _0x497507=_0x3cf746?_0xc598f7[_0x0a22('0x1c')]:_0x33de9c[_0x0a22('0x19')]+_0x33de9c[_0x0a22('0x1b')];var _0x46f38d;if(_0x497507>=_0x55b0b5){_0x497507=_0x55b0b5;_0x46f38d=0xc8;}else{_0x46f38d=0xce;}_0x2b33a3[_0x0a22('0x17')](_0x46f38d);return _0x2b33a3[_0x0a22('0x1d')]('Content-Range',_0x221089+'-'+_0x497507+'/'+_0x55b0b5)[_0x0a22('0x18')](_0xc598f7);}return null;};}function patchUpdates(_0x1dad2d){return function(_0x3d1c40){try{jsonpatch[_0x0a22('0x1e')](_0x3d1c40,_0x1dad2d,!![]);}catch(_0x3e1107){return BPromise[_0x0a22('0x1f')](_0x3e1107);}return _0x3d1c40[_0x0a22('0x20')]();};}function saveUpdates(_0x5dbaef,_0x5dbee8){return function(_0x2b90d9){if(_0x2b90d9){return _0x2b90d9[_0x0a22('0x21')](_0x5dbaef)[_0x0a22('0x22')](function(_0x110332){return _0x110332;});}return null;};}function removeEntity(_0x1df8a3,_0x314ec7){return function(_0x8e0c96){if(_0x8e0c96){return _0x8e0c96[_0x0a22('0x23')]()['then'](function(){_0x1df8a3['status'](0xcc)[_0x0a22('0x24')]();});}};}function handleEntityNotFound(_0x289718,_0x5ab201){return function(_0x246c88){if(!_0x246c88){_0x289718[_0x0a22('0x16')](0x194);}return _0x246c88;};}function handleError(_0x25b39b,_0x23370c){_0x23370c=_0x23370c||0x1f4;return function(_0x35d8a4){logger['error'](_0x35d8a4['stack']);if(_0x35d8a4[_0x0a22('0x25')]){delete _0x35d8a4[_0x0a22('0x25')];}_0x25b39b[_0x0a22('0x17')](_0x23370c)[_0x0a22('0x26')](_0x35d8a4);};}exports[_0x0a22('0x27')]=function(_0x43065b,_0x3c82f4){var _0x5413ac={},_0x1f978d={},_0x348df0={'count':0x0,'rows':[]};var _0x28eb89=_['map'](db[_0x0a22('0x28')][_0x0a22('0x29')],function(_0xbd00ab){return{'name':_0xbd00ab[_0x0a22('0x2a')],'type':_0xbd00ab[_0x0a22('0x2b')][_0x0a22('0x2c')]};});_0x1f978d[_0x0a22('0x2d')]=_[_0x0a22('0x2e')](_0x28eb89,_0x0a22('0x25'));_0x1f978d[_0x0a22('0x2f')]=_['keys'](_0x43065b[_0x0a22('0x2f')]);_0x1f978d[_0x0a22('0x30')]=_[_0x0a22('0x31')](_0x1f978d[_0x0a22('0x2d')],_0x1f978d[_0x0a22('0x2f')]);_0x5413ac[_0x0a22('0x32')]=_[_0x0a22('0x31')](_0x1f978d[_0x0a22('0x2d')],qs[_0x0a22('0x33')](_0x43065b[_0x0a22('0x2f')][_0x0a22('0x33')]));_0x5413ac['attributes']=_0x5413ac[_0x0a22('0x32')][_0x0a22('0x34')]?_0x5413ac['attributes']:_0x1f978d[_0x0a22('0x2d')];if(!_0x43065b['query'][_0x0a22('0x35')](_0x0a22('0x36'))){_0x5413ac[_0x0a22('0x1b')]=qs['limit'](_0x43065b[_0x0a22('0x2f')][_0x0a22('0x1b')]);_0x5413ac[_0x0a22('0x19')]=qs[_0x0a22('0x19')](_0x43065b[_0x0a22('0x2f')][_0x0a22('0x19')]);}_0x5413ac[_0x0a22('0x37')]=qs[_0x0a22('0x38')](_0x43065b['query'][_0x0a22('0x38')]);_0x5413ac[_0x0a22('0x39')]=qs[_0x0a22('0x30')](_[_0x0a22('0x3a')](_0x43065b[_0x0a22('0x2f')],_0x1f978d[_0x0a22('0x30')]),_0x28eb89);if(_0x43065b['query']['filter']){_0x5413ac[_0x0a22('0x39')]=_[_0x0a22('0x3b')](_0x5413ac[_0x0a22('0x39')],{'$or':_[_0x0a22('0x2e')](_0x28eb89,function(_0x55f89d){if(_0x55f89d[_0x0a22('0x2b')]!==_0x0a22('0x3c')){var _0x28edaa={};_0x28edaa[_0x55f89d[_0x0a22('0x25')]]={'$like':'%'+_0x43065b[_0x0a22('0x2f')][_0x0a22('0x3d')]+'%'};return _0x28edaa;}})});}_0x5413ac=_[_0x0a22('0x3b')]({},_0x5413ac,_0x43065b['options']);var _0x3ffef4={'where':_0x5413ac[_0x0a22('0x39')]};return db[_0x0a22('0x28')][_0x0a22('0x1c')](_0x3ffef4)[_0x0a22('0x22')](function(_0x194b76){_0x348df0[_0x0a22('0x1c')]=_0x194b76;if(_0x43065b[_0x0a22('0x2f')]['includeAll']){_0x5413ac[_0x0a22('0x3e')]=[{'all':!![]}];}return db[_0x0a22('0x28')][_0x0a22('0x3f')](_0x5413ac);})[_0x0a22('0x22')](function(_0x1ed824){_0x348df0[_0x0a22('0x40')]=_0x1ed824;return _0x348df0;})[_0x0a22('0x22')](respondWithFilteredResult(_0x3c82f4,_0x5413ac))[_0x0a22('0x41')](handleError(_0x3c82f4,null));};exports[_0x0a22('0x42')]=function(_0x11c272,_0x243488){var _0x285b79={'raw':!![],'where':{'id':_0x11c272['params']['id']}},_0x2709a8={};_0x2709a8['model']=_[_0x0a22('0x43')](db['FaxApplication'][_0x0a22('0x29')]);_0x2709a8['query']=_[_0x0a22('0x43')](_0x11c272[_0x0a22('0x2f')]);_0x2709a8['filters']=_['intersection'](_0x2709a8[_0x0a22('0x2d')],_0x2709a8[_0x0a22('0x2f')]);_0x285b79[_0x0a22('0x32')]=_[_0x0a22('0x31')](_0x2709a8[_0x0a22('0x2d')],qs['fields'](_0x11c272[_0x0a22('0x2f')]['fields']));_0x285b79[_0x0a22('0x32')]=_0x285b79[_0x0a22('0x32')][_0x0a22('0x34')]?_0x285b79['attributes']:_0x2709a8['model'];if(_0x11c272[_0x0a22('0x2f')][_0x0a22('0x44')]){_0x285b79[_0x0a22('0x3e')]=[{'all':!![]}];}_0x285b79=_[_0x0a22('0x3b')]({},_0x285b79,_0x11c272[_0x0a22('0x45')]);return db[_0x0a22('0x28')][_0x0a22('0x46')](_0x285b79)[_0x0a22('0x22')](handleEntityNotFound(_0x243488,null))[_0x0a22('0x22')](respondWithResult(_0x243488,null))[_0x0a22('0x41')](handleError(_0x243488,null));};exports[_0x0a22('0x47')]=function(_0x146286,_0x3bb892){return db[_0x0a22('0x28')]['create'](_0x146286['body'],{})[_0x0a22('0x22')](respondWithResult(_0x3bb892,0xc9))[_0x0a22('0x41')](handleError(_0x3bb892,null));};exports[_0x0a22('0x21')]=function(_0x257bd3,_0x240d9b){if(_0x257bd3['body']['id']){delete _0x257bd3[_0x0a22('0x48')]['id'];}return db[_0x0a22('0x28')][_0x0a22('0x46')]({'where':{'id':_0x257bd3[_0x0a22('0x49')]['id']}})[_0x0a22('0x22')](handleEntityNotFound(_0x240d9b,null))[_0x0a22('0x22')](saveUpdates(_0x257bd3[_0x0a22('0x48')],null))[_0x0a22('0x22')](respondWithResult(_0x240d9b,null))[_0x0a22('0x41')](handleError(_0x240d9b,null));};exports['destroy']=function(_0x3e37ec,_0x167d90){return db['FaxApplication'][_0x0a22('0x46')]({'where':{'id':_0x3e37ec[_0x0a22('0x49')]['id']}})[_0x0a22('0x22')](handleEntityNotFound(_0x167d90,null))[_0x0a22('0x22')](removeEntity(_0x167d90,null))[_0x0a22('0x41')](handleError(_0x167d90,null));}; \ No newline at end of file +var _0xa0f5=['fieldName','type','query','keys','filters','intersection','attributes','model','fields','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','body','destroy','rimraf','zip-dir','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','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','sendStatus','error','stack','name','send','index','map','FaxApplication','rawAttributes'];(function(_0x3181a5,_0x561909){var _0x2275d5=function(_0x3248a6){while(--_0x3248a6){_0x3181a5['push'](_0x3181a5['shift']());}};_0x2275d5(++_0x561909);}(_0xa0f5,0x13c));var _0x5a0f=function(_0x55d8ad,_0x9657fa){_0x55d8ad=_0x55d8ad-0x0;var _0x5e22d5=_0xa0f5[_0x55d8ad];return _0x5e22d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a0f('0x0'));var zipdir=require(_0x5a0f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5a0f('0x2'));var Mustache=require(_0x5a0f('0x3'));var util=require(_0x5a0f('0x4'));var path=require(_0x5a0f('0x5'));var sox=require('sox');var csv=require(_0x5a0f('0x6'));var ejs=require(_0x5a0f('0x7'));var fs=require('fs');var fs_extra=require(_0x5a0f('0x8'));var _=require(_0x5a0f('0x9'));var squel=require(_0x5a0f('0xa'));var crypto=require(_0x5a0f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5a0f('0xc'));var toCsv=require(_0x5a0f('0x6'));var querystring=require(_0x5a0f('0xd'));var Papa=require(_0x5a0f('0xe'));var Redis=require(_0x5a0f('0xf'));var authService=require(_0x5a0f('0x10'));var qs=require(_0x5a0f('0x11'));var as=require(_0x5a0f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a0f('0x13'))(_0x5a0f('0x14'));var utils=require('../../config/utils');var config=require(_0x5a0f('0x15'));var licenseUtil=require(_0x5a0f('0x16'));var db=require(_0x5a0f('0x17'))['db'];function respondWithStatusCode(_0x19d52f,_0x45c517){_0x45c517=_0x45c517||0xcc;return function(_0x431f13){if(_0x431f13){return _0x19d52f['sendStatus'](_0x45c517);}return _0x19d52f[_0x5a0f('0x18')](_0x45c517)[_0x5a0f('0x19')]();};}function respondWithResult(_0x5b04ab,_0x5731f2){_0x5731f2=_0x5731f2||0xc8;return function(_0x15aa3c){if(_0x15aa3c){return _0x5b04ab[_0x5a0f('0x18')](_0x5731f2)[_0x5a0f('0x1a')](_0x15aa3c);}};}function respondWithFilteredResult(_0x390e6d,_0x2ac42a){return function(_0x2189fc){if(_0x2189fc){var _0x3fc83d=typeof _0x2ac42a[_0x5a0f('0x1b')]===_0x5a0f('0x1c')&&typeof _0x2ac42a[_0x5a0f('0x1d')]==='undefined';var _0xe75f65=_0x2189fc[_0x5a0f('0x1e')];var _0x338a13=_0x3fc83d?0x0:_0x2ac42a['offset'];var _0x290633=_0x3fc83d?_0x2189fc['count']:_0x2ac42a[_0x5a0f('0x1b')]+_0x2ac42a[_0x5a0f('0x1d')];var _0x54ed6b;if(_0x290633>=_0xe75f65){_0x290633=_0xe75f65;_0x54ed6b=0xc8;}else{_0x54ed6b=0xce;}_0x390e6d[_0x5a0f('0x18')](_0x54ed6b);return _0x390e6d['set'](_0x5a0f('0x1f'),_0x338a13+'-'+_0x290633+'/'+_0xe75f65)[_0x5a0f('0x1a')](_0x2189fc);}return null;};}function patchUpdates(_0x560b7f){return function(_0x42bd50){try{jsonpatch['apply'](_0x42bd50,_0x560b7f,!![]);}catch(_0x53b7e3){return BPromise['reject'](_0x53b7e3);}return _0x42bd50[_0x5a0f('0x20')]();};}function saveUpdates(_0x17b422,_0x3a0308){return function(_0x53bed3){if(_0x53bed3){return _0x53bed3[_0x5a0f('0x21')](_0x17b422)[_0x5a0f('0x22')](function(_0x2d41f9){return _0x2d41f9;});}return null;};}function removeEntity(_0x3bb10,_0x4f8e91){return function(_0x238fa0){if(_0x238fa0){return _0x238fa0['destroy']()[_0x5a0f('0x22')](function(){_0x3bb10[_0x5a0f('0x18')](0xcc)[_0x5a0f('0x19')]();});}};}function handleEntityNotFound(_0x319b2d,_0x68971a){return function(_0x3972bf){if(!_0x3972bf){_0x319b2d[_0x5a0f('0x23')](0x194);}return _0x3972bf;};}function handleError(_0x408b10,_0x2e18b6){_0x2e18b6=_0x2e18b6||0x1f4;return function(_0x43b0fd){logger[_0x5a0f('0x24')](_0x43b0fd[_0x5a0f('0x25')]);if(_0x43b0fd[_0x5a0f('0x26')]){delete _0x43b0fd[_0x5a0f('0x26')];}_0x408b10[_0x5a0f('0x18')](_0x2e18b6)[_0x5a0f('0x27')](_0x43b0fd);};}exports[_0x5a0f('0x28')]=function(_0x1af721,_0x29c4a4){var _0x17ff2a={},_0x337400={},_0x49fd6d={'count':0x0,'rows':[]};var _0xc8c19f=_[_0x5a0f('0x29')](db[_0x5a0f('0x2a')][_0x5a0f('0x2b')],function(_0x2857cc){return{'name':_0x2857cc[_0x5a0f('0x2c')],'type':_0x2857cc[_0x5a0f('0x2d')]['key']};});_0x337400['model']=_['map'](_0xc8c19f,_0x5a0f('0x26'));_0x337400[_0x5a0f('0x2e')]=_[_0x5a0f('0x2f')](_0x1af721['query']);_0x337400[_0x5a0f('0x30')]=_[_0x5a0f('0x31')](_0x337400['model'],_0x337400[_0x5a0f('0x2e')]);_0x17ff2a[_0x5a0f('0x32')]=_['intersection'](_0x337400[_0x5a0f('0x33')],qs['fields'](_0x1af721['query'][_0x5a0f('0x34')]));_0x17ff2a['attributes']=_0x17ff2a[_0x5a0f('0x32')]['length']?_0x17ff2a[_0x5a0f('0x32')]:_0x337400[_0x5a0f('0x33')];if(!_0x1af721[_0x5a0f('0x2e')]['hasOwnProperty'](_0x5a0f('0x35'))){_0x17ff2a[_0x5a0f('0x1d')]=qs[_0x5a0f('0x1d')](_0x1af721[_0x5a0f('0x2e')][_0x5a0f('0x1d')]);_0x17ff2a[_0x5a0f('0x1b')]=qs[_0x5a0f('0x1b')](_0x1af721['query'][_0x5a0f('0x1b')]);}_0x17ff2a['order']=qs[_0x5a0f('0x36')](_0x1af721['query']['sort']);_0x17ff2a['where']=qs['filters'](_[_0x5a0f('0x37')](_0x1af721['query'],_0x337400[_0x5a0f('0x30')]),_0xc8c19f);if(_0x1af721['query'][_0x5a0f('0x38')]){_0x17ff2a[_0x5a0f('0x39')]=_['merge'](_0x17ff2a[_0x5a0f('0x39')],{'$or':_[_0x5a0f('0x29')](_0xc8c19f,function(_0x405fc5){if(_0x405fc5[_0x5a0f('0x2d')]!==_0x5a0f('0x3a')){var _0x37999a={};_0x37999a[_0x405fc5['name']]={'$like':'%'+_0x1af721[_0x5a0f('0x2e')][_0x5a0f('0x38')]+'%'};return _0x37999a;}})});}_0x17ff2a=_[_0x5a0f('0x3b')]({},_0x17ff2a,_0x1af721[_0x5a0f('0x3c')]);var _0x1fce41={'where':_0x17ff2a[_0x5a0f('0x39')]};return db[_0x5a0f('0x2a')][_0x5a0f('0x1e')](_0x1fce41)['then'](function(_0x10a4a1){_0x49fd6d[_0x5a0f('0x1e')]=_0x10a4a1;if(_0x1af721[_0x5a0f('0x2e')][_0x5a0f('0x3d')]){_0x17ff2a[_0x5a0f('0x3e')]=[{'all':!![]}];}return db[_0x5a0f('0x2a')][_0x5a0f('0x3f')](_0x17ff2a);})[_0x5a0f('0x22')](function(_0x58a3e2){_0x49fd6d[_0x5a0f('0x40')]=_0x58a3e2;return _0x49fd6d;})[_0x5a0f('0x22')](respondWithFilteredResult(_0x29c4a4,_0x17ff2a))['catch'](handleError(_0x29c4a4,null));};exports[_0x5a0f('0x41')]=function(_0x5533d9,_0x40e8c6){var _0x57feb6={'raw':!![],'where':{'id':_0x5533d9[_0x5a0f('0x42')]['id']}},_0xab6508={};_0xab6508[_0x5a0f('0x33')]=_[_0x5a0f('0x2f')](db[_0x5a0f('0x2a')][_0x5a0f('0x2b')]);_0xab6508[_0x5a0f('0x2e')]=_[_0x5a0f('0x2f')](_0x5533d9[_0x5a0f('0x2e')]);_0xab6508[_0x5a0f('0x30')]=_[_0x5a0f('0x31')](_0xab6508[_0x5a0f('0x33')],_0xab6508[_0x5a0f('0x2e')]);_0x57feb6['attributes']=_[_0x5a0f('0x31')](_0xab6508[_0x5a0f('0x33')],qs[_0x5a0f('0x34')](_0x5533d9[_0x5a0f('0x2e')][_0x5a0f('0x34')]));_0x57feb6[_0x5a0f('0x32')]=_0x57feb6[_0x5a0f('0x32')][_0x5a0f('0x43')]?_0x57feb6['attributes']:_0xab6508['model'];if(_0x5533d9[_0x5a0f('0x2e')]['includeAll']){_0x57feb6['include']=[{'all':!![]}];}_0x57feb6=_[_0x5a0f('0x3b')]({},_0x57feb6,_0x5533d9[_0x5a0f('0x3c')]);return db[_0x5a0f('0x2a')][_0x5a0f('0x44')](_0x57feb6)[_0x5a0f('0x22')](handleEntityNotFound(_0x40e8c6,null))[_0x5a0f('0x22')](respondWithResult(_0x40e8c6,null))[_0x5a0f('0x45')](handleError(_0x40e8c6,null));};exports['create']=function(_0xaf7619,_0x47a85b){return db['FaxApplication']['create'](_0xaf7619['body'],{})['then'](respondWithResult(_0x47a85b,0xc9))[_0x5a0f('0x45')](handleError(_0x47a85b,null));};exports['update']=function(_0x20d859,_0x1934c4){if(_0x20d859['body']['id']){delete _0x20d859['body']['id'];}return db[_0x5a0f('0x2a')][_0x5a0f('0x44')]({'where':{'id':_0x20d859[_0x5a0f('0x42')]['id']}})['then'](handleEntityNotFound(_0x1934c4,null))[_0x5a0f('0x22')](saveUpdates(_0x20d859[_0x5a0f('0x46')],null))[_0x5a0f('0x22')](respondWithResult(_0x1934c4,null))[_0x5a0f('0x45')](handleError(_0x1934c4,null));};exports[_0x5a0f('0x47')]=function(_0x45b60c,_0x38a2c3){return db[_0x5a0f('0x2a')][_0x5a0f('0x44')]({'where':{'id':_0x45b60c[_0x5a0f('0x42')]['id']}})['then'](handleEntityNotFound(_0x38a2c3,null))['then'](removeEntity(_0x38a2c3,null))[_0x5a0f('0x45')](handleError(_0x38a2c3,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 29534f0..a62052b 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 _0x57cc=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3b7b42,_0x31badd){var _0x1ebaad=function(_0x3655d9){while(--_0x3655d9){_0x3b7b42['push'](_0x3b7b42['shift']());}};_0x1ebaad(++_0x31badd);}(_0x57cc,0xf7));var _0xc57c=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x57cc[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xc57c('0x0'));var util=require(_0xc57c('0x1'));var logger=require(_0xc57c('0x2'))(_0xc57c('0x3'));var moment=require('moment');var BPromise=require(_0xc57c('0x4'));var rp=require(_0xc57c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xc57c('0x7'));module[_0xc57c('0x8')]=function(_0x8dae6d,_0x15bcaa){return _0x8dae6d[_0xc57c('0x9')]('FaxApplication',attributes,{'tableName':_0xc57c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc57c('0xb'),'collate':_0xc57c('0xc')});}; \ No newline at end of file +var _0xc0fa=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','rimraf','../../config/environment','./faxApplication.attributes','exports'];(function(_0x16d0a4,_0x5eae8a){var _0x2f1692=function(_0x366475){while(--_0x366475){_0x16d0a4['push'](_0x16d0a4['shift']());}};_0x2f1692(++_0x5eae8a);}(_0xc0fa,0x171));var _0xac0f=function(_0x2b0f23,_0x152963){_0x2b0f23=_0x2b0f23-0x0;var _0x4e6ecb=_0xc0fa[_0x2b0f23];return _0x4e6ecb;};'use strict';var _=require(_0xac0f('0x0'));var util=require(_0xac0f('0x1'));var logger=require('../../config/logger')(_0xac0f('0x2'));var moment=require(_0xac0f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xac0f('0x4'));var rimraf=require(_0xac0f('0x5'));var config=require(_0xac0f('0x6'));var attributes=require(_0xac0f('0x7'));module[_0xac0f('0x8')]=function(_0x86d56f,_0x31c510){return _0x86d56f[_0xac0f('0x9')](_0xac0f('0xa'),attributes,{'tableName':_0xac0f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac0f('0xc'),'collate':_0xac0f('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index e608005..a19c4e7 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 _0xc224=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','update','body','options','raw','limit','debug','catch'];(function(_0x318fd6,_0x31078d){var _0x54c303=function(_0x4e9864){while(--_0x4e9864){_0x318fd6['push'](_0x318fd6['shift']());}};_0x54c303(++_0x31078d);}(_0xc224,0x8c));var _0x4c22=function(_0x31e1a5,_0x1c5bc3){_0x31e1a5=_0x31e1a5-0x0;var _0x5c82db=_0xc224[_0x31e1a5];return _0x5c82db;};'use strict';var _=require(_0x4c22('0x0'));var util=require('util');var moment=require(_0x4c22('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c22('0x2'));var fs=require('fs');var Redis=require(_0x4c22('0x3'));var db=require(_0x4c22('0x4'))['db'];var utils=require(_0x4c22('0x5'));var logger=require('../../config/logger')(_0x4c22('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c22('0x7'));var client=jayson[_0x4c22('0x8')][_0x4c22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5131fe,_0x3283ac,_0x646ebb){return new BPromise(function(_0x2312cc,_0x4f6fda){return client['request'](_0x5131fe,_0x646ebb)[_0x4c22('0xa')](function(_0x4ad8f8){logger[_0x4c22('0xb')](_0x4c22('0xc'),_0x3283ac,_0x4c22('0xd'));logger['debug'](_0x4c22('0xe'),_0x3283ac,'request\x20sent',JSON[_0x4c22('0xf')](_0x4ad8f8));if(_0x4ad8f8[_0x4c22('0x10')]){if(_0x4ad8f8[_0x4c22('0x10')][_0x4c22('0x11')]===0x1f4){logger[_0x4c22('0x10')](_0x4c22('0xc'),_0x3283ac,_0x4ad8f8['error'][_0x4c22('0x12')]);return _0x4f6fda(_0x4ad8f8[_0x4c22('0x10')][_0x4c22('0x12')]);}logger[_0x4c22('0x10')](_0x4c22('0xc'),_0x3283ac,_0x4ad8f8[_0x4c22('0x10')][_0x4c22('0x12')]);return _0x2312cc(_0x4ad8f8['error'][_0x4c22('0x12')]);}else{logger[_0x4c22('0xb')]('FaxApplication,\x20%s,\x20%s',_0x3283ac,'request\x20sent');_0x2312cc(_0x4ad8f8[_0x4c22('0x13')]['message']);}})['catch'](function(_0x791fec){logger[_0x4c22('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3283ac,_0x791fec);_0x4f6fda(_0x791fec);});});}exports[_0x4c22('0x14')]=function(_0x4c2da1){var _0x58ddac=this;return new Promise(function(_0x469f48,_0x216b6d){return db['FaxApplication'][_0x4c22('0x15')](_0x4c2da1[_0x4c22('0x16')],{'raw':_0x4c2da1[_0x4c22('0x17')]?_0x4c2da1[_0x4c22('0x17')][_0x4c22('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c2da1[_0x4c22('0x17')]?_0x4c2da1[_0x4c22('0x17')]['where']||null:null,'attributes':_0x4c2da1[_0x4c22('0x17')]?_0x4c2da1[_0x4c22('0x17')]['attributes']||null:null,'limit':_0x4c2da1[_0x4c22('0x17')]?_0x4c2da1['options'][_0x4c22('0x19')]||null:null})[_0x4c22('0xa')](function(_0xa544a1){logger[_0x4c22('0xb')](_0x4c22('0x14'),_0x4c2da1);logger[_0x4c22('0x1a')]('UpdateFaxApplication',_0x4c2da1,JSON[_0x4c22('0xf')](_0xa544a1));_0x469f48(_0xa544a1);})[_0x4c22('0x1b')](function(_0x5d7303){logger[_0x4c22('0x10')]('UpdateFaxApplication',_0x5d7303[_0x4c22('0x12')],_0x4c2da1);_0x216b6d(_0x58ddac[_0x4c22('0x10')](0x1f4,_0x5d7303[_0x4c22('0x12')]));});});}; \ No newline at end of file +var _0x724d=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','attributes','limit','lodash','util'];(function(_0x46eee0,_0x5e1d13){var _0x1a39a6=function(_0x43ab81){while(--_0x43ab81){_0x46eee0['push'](_0x46eee0['shift']());}};_0x1a39a6(++_0x5e1d13);}(_0x724d,0xe5));var _0xd724=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x724d[_0x2cc0b3];return _0x1667ef;};'use strict';var _=require(_0xd724('0x0'));var util=require(_0xd724('0x1'));var moment=require(_0xd724('0x2'));var BPromise=require('bluebird');var rs=require(_0xd724('0x3'));var fs=require('fs');var Redis=require(_0xd724('0x4'));var db=require(_0xd724('0x5'))['db'];var utils=require(_0xd724('0x6'));var logger=require(_0xd724('0x7'))(_0xd724('0x8'));var config=require(_0xd724('0x9'));var jayson=require(_0xd724('0xa'));var client=jayson[_0xd724('0xb')][_0xd724('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x100428,_0x260b44,_0x37938f){return new BPromise(function(_0x53601e,_0x46ce16){return client[_0xd724('0xd')](_0x100428,_0x37938f)[_0xd724('0xe')](function(_0x3884aa){logger[_0xd724('0xf')](_0xd724('0x10'),_0x260b44,'request\x20sent');logger[_0xd724('0x11')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x260b44,'request\x20sent',JSON[_0xd724('0x12')](_0x3884aa));if(_0x3884aa[_0xd724('0x13')]){if(_0x3884aa[_0xd724('0x13')][_0xd724('0x14')]===0x1f4){logger[_0xd724('0x13')](_0xd724('0x10'),_0x260b44,_0x3884aa[_0xd724('0x13')][_0xd724('0x15')]);return _0x46ce16(_0x3884aa[_0xd724('0x13')][_0xd724('0x15')]);}logger[_0xd724('0x13')](_0xd724('0x10'),_0x260b44,_0x3884aa[_0xd724('0x13')][_0xd724('0x15')]);return _0x53601e(_0x3884aa[_0xd724('0x13')][_0xd724('0x15')]);}else{logger['info'](_0xd724('0x10'),_0x260b44,_0xd724('0x16'));_0x53601e(_0x3884aa[_0xd724('0x17')][_0xd724('0x15')]);}})[_0xd724('0x18')](function(_0x23280){logger[_0xd724('0x13')](_0xd724('0x10'),_0x260b44,_0x23280);_0x46ce16(_0x23280);});});}exports[_0xd724('0x19')]=function(_0x734b54){var _0x1361c2=this;return new Promise(function(_0x32985b,_0x356e8){return db[_0xd724('0x1a')][_0xd724('0x1b')](_0x734b54['body'],{'raw':_0x734b54['options']?_0x734b54[_0xd724('0x1c')][_0xd724('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x734b54[_0xd724('0x1c')]?_0x734b54[_0xd724('0x1c')][_0xd724('0x1e')]||null:null,'attributes':_0x734b54[_0xd724('0x1c')]?_0x734b54[_0xd724('0x1c')][_0xd724('0x1f')]||null:null,'limit':_0x734b54[_0xd724('0x1c')]?_0x734b54[_0xd724('0x1c')][_0xd724('0x20')]||null:null})[_0xd724('0xe')](function(_0x1a64ff){logger['info'](_0xd724('0x19'),_0x734b54);logger['debug'](_0xd724('0x19'),_0x734b54,JSON[_0xd724('0x12')](_0x1a64ff));_0x32985b(_0x1a64ff);})['catch'](function(_0x135f8a){logger[_0xd724('0x13')]('UpdateFaxApplication',_0x135f8a[_0xd724('0x15')],_0x734b54);_0x356e8(_0x1361c2[_0xd724('0x13')](0x1f4,_0x135f8a[_0xd724('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d50509f..1912a47 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 _0x93e9=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x260515,_0x198ec0){var _0x2e2b4f=function(_0x516c5f){while(--_0x516c5f){_0x260515['push'](_0x260515['shift']());}};_0x2e2b4f(++_0x198ec0);}(_0x93e9,0xcc));var _0x993e=function(_0x5d7e07,_0x1ddbd9){_0x5d7e07=_0x5d7e07-0x0;var _0x1d0538=_0x93e9[_0x5d7e07];return _0x1d0538;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['show']);router[_0x993e('0xd')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0xf')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller[_0x993e('0x10')]);router['delete'](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x96cc=['isAuthenticated','/:id','show','post','create','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x96cc,0x16c));var _0xc96c=function(_0x5d6b41,_0x3d1c8f){_0x5d6b41=_0x5d6b41-0x0;var _0x1c2dd6=_0x96cc[_0x5d6b41];return _0x1c2dd6;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0xd')]('/',auth[_0xc96c('0xa')](),controller[_0xc96c('0xe')]);router['put'](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xf')]);router['delete'](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9758543..686b6db 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 _0xf4df=['exports','DATE','STRING','out'];(function(_0x38b812,_0x1a2b00){var _0x17f658=function(_0x5292dc){while(--_0x5292dc){_0x38b812['push'](_0x38b812['shift']());}};_0x17f658(++_0x1a2b00);}(_0xf4df,0x90));var _0xff4d=function(_0x3364ea,_0x1c65a8){_0x3364ea=_0x3364ea-0x0;var _0x11b391=_0xf4df[_0x3364ea];return _0x11b391;};'use strict';var Sequelize=require('sequelize');module[_0xff4d('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xff4d('0x1')]},'disposition':{'type':Sequelize[_0xff4d('0x2')]},'secondDisposition':{'type':Sequelize[_0xff4d('0x2')]},'thirdDisposition':{'type':Sequelize[_0xff4d('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xff4d('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xff4d('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xff4d('0x3')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb617=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb617,0x18d));var _0x7b61=function(_0x4c9316,_0x5c7f6f){_0x4c9316=_0x4c9316-0x0;var _0x146aad=_0xb617[_0x4c9316];return _0x146aad;};'use strict';var Sequelize=require(_0x7b61('0x0'));module[_0x7b61('0x1')]={'closed':{'type':Sequelize[_0x7b61('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b61('0x3')]},'disposition':{'type':Sequelize[_0x7b61('0x4')]},'secondDisposition':{'type':Sequelize[_0x7b61('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7b61('0x4')]},'note':{'type':Sequelize[_0x7b61('0x4')]},'read1stAt':{'type':Sequelize[_0x7b61('0x3')]},'fax':{'type':Sequelize[_0x7b61('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x7b61('0x5')]('in',_0x7b61('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7b61('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7b61('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 9ae693c..e60f5ef 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 _0x9530=['forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','rows','params','keys','FaxInteraction','includeAll','include','merge','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','removeTags','download','unix','join','files','tmp','root','server','transcript-%d-%s.zip','Attachment','get','mkdirSync','Messages','basename','existsSync','createReadStream','log','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../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','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','TagIds','Tags','split','catch','index','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','select','field','color','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','length','find','unreadMessages','value','having','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag'];(function(_0x5d6280,_0x3f72ab){var _0x77b738=function(_0x1b8208){while(--_0x1b8208){_0x5d6280['push'](_0x5d6280['shift']());}};_0x77b738(++_0x3f72ab);}(_0x9530,0x142));var _0x0953=function(_0x281e60,_0x35c597){_0x281e60=_0x281e60-0x0;var _0x149536=_0x9530[_0x281e60];return _0x149536;};'use strict';var emlformat=require(_0x0953('0x0'));var rimraf=require(_0x0953('0x1'));var zipdir=require(_0x0953('0x2'));var jsonpatch=require(_0x0953('0x3'));var rp=require('request-promise');var moment=require(_0x0953('0x4'));var BPromise=require(_0x0953('0x5'));var Mustache=require(_0x0953('0x6'));var util=require(_0x0953('0x7'));var path=require(_0x0953('0x8'));var sox=require('sox');var csv=require(_0x0953('0x9'));var ejs=require(_0x0953('0xa'));var fs=require('fs');var fs_extra=require(_0x0953('0xb'));var _=require(_0x0953('0xc'));var squel=require(_0x0953('0xd'));var crypto=require(_0x0953('0xe'));var jsforce=require(_0x0953('0xf'));var deskjs=require(_0x0953('0x10'));var toCsv=require(_0x0953('0x9'));var querystring=require(_0x0953('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0953('0x12'));var qs=require(_0x0953('0x13'));var as=require(_0x0953('0x14'));var hardwareService=require(_0x0953('0x15'));var logger=require(_0x0953('0x16'))(_0x0953('0x17'));var utils=require(_0x0953('0x18'));var config=require(_0x0953('0x19'));var licenseUtil=require(_0x0953('0x1a'));var db=require(_0x0953('0x1b'))['db'];config[_0x0953('0x1c')]=_[_0x0953('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0953('0x1e'))(new Redis(config[_0x0953('0x1c')]));require(_0x0953('0x1f'))['register'](socket);function respondWithStatusCode(_0x2097b6,_0x39389a){_0x39389a=_0x39389a||0xcc;return function(_0x8d3dbc){if(_0x8d3dbc){return _0x2097b6[_0x0953('0x20')](_0x39389a);}return _0x2097b6[_0x0953('0x21')](_0x39389a)[_0x0953('0x22')]();};}function respondWithResult(_0x1061db,_0x55b7af){_0x55b7af=_0x55b7af||0xc8;return function(_0x46099c){if(_0x46099c){return _0x1061db[_0x0953('0x21')](_0x55b7af)[_0x0953('0x23')](_0x46099c);}};}function respondWithFilteredResult(_0x5b90a5,_0x11b938){return function(_0x36adcf){if(_0x36adcf){var _0x1db9e6=typeof _0x11b938[_0x0953('0x24')]==='undefined'&&typeof _0x11b938[_0x0953('0x25')]==='undefined';var _0x5eeb74=_0x36adcf['count'];var _0x316d44=_0x1db9e6?0x0:_0x11b938['offset'];var _0x31dfe9=_0x1db9e6?_0x36adcf[_0x0953('0x26')]:_0x11b938[_0x0953('0x24')]+_0x11b938[_0x0953('0x25')];var _0x257bdd;if(_0x31dfe9>=_0x5eeb74){_0x31dfe9=_0x5eeb74;_0x257bdd=0xc8;}else{_0x257bdd=0xce;}_0x5b90a5['status'](_0x257bdd);return _0x5b90a5[_0x0953('0x27')](_0x0953('0x28'),_0x316d44+'-'+_0x31dfe9+'/'+_0x5eeb74)[_0x0953('0x23')](_0x36adcf);}return null;};}function patchUpdates(_0x410e70){return function(_0x5460d3){try{jsonpatch[_0x0953('0x29')](_0x5460d3,_0x410e70,!![]);}catch(_0x45567b){return BPromise[_0x0953('0x2a')](_0x45567b);}return _0x5460d3[_0x0953('0x2b')]();};}function saveUpdates(_0x231bc4,_0x3b448d){return function(_0x5b17f4){if(_0x5b17f4){return _0x5b17f4[_0x0953('0x2c')](_0x231bc4)[_0x0953('0x2d')](function(_0x1a6f7f){return _0x1a6f7f;});}return null;};}function removeEntity(_0x3dedfb,_0x6cf7a9){return function(_0x5c2d87){if(_0x5c2d87){return _0x5c2d87[_0x0953('0x2e')]()['then'](function(){_0x3dedfb[_0x0953('0x21')](0xcc)[_0x0953('0x22')]();});}};}function handleEntityNotFound(_0x4e8fdc,_0x1f4221){return function(_0x25f74a){if(!_0x25f74a){_0x4e8fdc[_0x0953('0x20')](0x194);}return _0x25f74a;};}function handleError(_0x206481,_0x5adcae){_0x5adcae=_0x5adcae||0x1f4;return function(_0x3277ad){logger['error'](_0x3277ad[_0x0953('0x2f')]);if(_0x3277ad[_0x0953('0x30')]){delete _0x3277ad[_0x0953('0x30')];}_0x206481[_0x0953('0x21')](_0x5adcae)[_0x0953('0x31')](_0x3277ad);};}function getInteractionUsers(_0x53aa65,_0x3ea62b){return new BPromise(function(_0x5d70e9,_0xc17d93){try{if(_0x3ea62b[_0x53aa65['id']]){_0x53aa65['Users']=_[_0x0953('0x32')](_0x3ea62b[_0x53aa65['id']],function(_0x45dee7){return{'id':_0x45dee7['id'],'fullname':_0x45dee7['fullname']};});}}catch(_0x12f449){_0xc17d93(_0x12f449);}_0x5d70e9(_0x53aa65);});}function getInteractionTags(_0x2a09c4,_0x500c5a){return new BPromise(function(_0xbe73d,_0x2ee0c5){try{if(_0x2a09c4[_0x0953('0x33')]){_0x2a09c4[_0x0953('0x34')]=[];_0x2a09c4[_0x0953('0x33')][_0x0953('0x35')](',')['forEach'](function(_0x3e392e){_0x2a09c4[_0x0953('0x34')]['push'](_0x500c5a[_0x3e392e]);});}delete _0x2a09c4[_0x0953('0x33')];}catch(_0x2dbb63){_0x2ee0c5(_0x2dbb63);}_0xbe73d(_0x2a09c4);});}function updateFaxInteraction(_0x2913d6,_0x1b455f,_0x6484){return new BPromise(function(_0x453833,_0x1bdf8f){return getInteractionUsers(_0x2913d6,_0x6484)[_0x0953('0x2d')](function(_0x29aa5d){return getInteractionTags(_0x29aa5d,_0x1b455f);})[_0x0953('0x2d')](function(_0x175ce6){_0x453833(_0x175ce6);})[_0x0953('0x36')](function(_0x5bcb4b){_0x1bdf8f(_0x5bcb4b);});});}exports[_0x0953('0x37')]=function(_0x21dad2,_0x509fdd){var _0x5094ba={},_0x27ce67={},_0x35212b={'count':0x0,'rows':[]};var _0x2e5c91=_[_0x0953('0x32')](db['FaxInteraction'][_0x0953('0x38')],function(_0x46732e){return{'name':_0x46732e[_0x0953('0x39')],'type':_0x46732e[_0x0953('0x3a')]['key']};});_0x27ce67[_0x0953('0x3b')]=_[_0x0953('0x32')](_0x2e5c91,_0x0953('0x30'));_0x27ce67['query']=_['keys'](_0x21dad2[_0x0953('0x3c')]);_0x27ce67[_0x0953('0x3d')]=_[_0x0953('0x3e')](_0x27ce67[_0x0953('0x3b')],_0x27ce67[_0x0953('0x3c')]);_0x5094ba[_0x0953('0x3f')]=_['intersection'](_0x27ce67['model'],qs['fields'](_0x21dad2[_0x0953('0x3c')][_0x0953('0x40')]));_0x5094ba['attributes']=_0x5094ba['attributes']['length']?_0x5094ba[_0x0953('0x3f')]:_0x27ce67[_0x0953('0x3b')];if(!_0x21dad2[_0x0953('0x3c')][_0x0953('0x41')]('nolimit')){_0x5094ba[_0x0953('0x25')]=qs[_0x0953('0x25')](_0x21dad2[_0x0953('0x3c')]['limit']);_0x5094ba[_0x0953('0x24')]=qs[_0x0953('0x24')](_0x21dad2[_0x0953('0x3c')][_0x0953('0x24')]);}_0x5094ba[_0x0953('0x42')]=qs['sort'](_0x21dad2['query'][_0x0953('0x43')]);_0x5094ba['where']=qs['filters'](_[_0x0953('0x44')](_0x21dad2[_0x0953('0x3c')],_0x27ce67[_0x0953('0x3d')]),_0x2e5c91);var _0x34aad0=[];var _0x1b98c6=squel[_0x0953('0x45')]()[_0x0953('0x46')]('id')[_0x0953('0x46')](_0x0953('0x30'))[_0x0953('0x46')](_0x0953('0x47'))['from']('tools_tags');var _0x28fd4a=squel[_0x0953('0x45')]()[_0x0953('0x46')](_0x0953('0x48'))[_0x0953('0x46')](_0x0953('0x49'))['field'](_0x0953('0x4a'))['from'](_0x0953('0x4b'),'ui')['left_join'](_0x0953('0x4c'),'u',_0x0953('0x4d'));var _0xd9e3be=squel[_0x0953('0x45')]()['from'](_0x0953('0x4e'),'i')['left_join'](_0x0953('0x4f'),'c',_0x0953('0x50'))[_0x0953('0x51')](_0x0953('0x4c'),'o',_0x0953('0x52'))[_0x0953('0x51')]('fax_accounts','a',_0x0953('0x53'))[_0x0953('0x51')](_0x0953('0x54'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x0953('0x51')](_0x0953('0x55'),'it',_0x0953('0x56'))[_0x0953('0x51')](_0x0953('0x57'),'t',_0x0953('0x58'));var _0x5c4551=squel[_0x0953('0x59')]();var _0x39bac6=[];var _0x38b9f0=squel[_0x0953('0x59')]();var _0x5a67fe;if(_0x21dad2[_0x0953('0x3c')]['search']){_0x5a67fe=as[_0x0953('0x5a')](_0x21dad2[_0x0953('0x3c')][_0x0953('0x5b')]);var _0x5d76be=_0x5a67fe['sqlOperator'];for(var _0x5275f0=0x0;_0x5275f0<_0x5a67fe[_0x0953('0x5c')][_0x0953('0x5d')];_0x5275f0++){var _0x1ef723=_0x5a67fe['conditions'][_0x5275f0];var _0xa0c0e5='i';var _0x5cf28a=_[_0x0953('0x5e')](_0x2e5c91,[_0x0953('0x30'),_0x1ef723[_0x0953('0x46')]]);if(!_0x5cf28a){switch(_0x1ef723[_0x0953('0x46')]){case _0x0953('0x5f'):if(_0x1ef723[_0x0953('0x60')]==0x1){_0xd9e3be[_0x0953('0x61')]('`'+_0x1ef723[_0x0953('0x46')]+'`\x20=\x200');}else{_0xd9e3be[_0x0953('0x61')]('`'+_0x1ef723[_0x0953('0x46')]+'`\x20>\x200');}break;case'Contact':if(_0x1ef723[_0x0953('0x62')]==='$substring'){if(_0x1ef723[_0x0953('0x60')]['split']('\x20')[_0x0953('0x5d')]>0x1){_0x5c4551[_0x5d76be](_0x0953('0x63'),qs['getFullTextValue'](_0x1ef723[_0x0953('0x60')]),null);}else{var _0x15292b='%'+_0x1ef723[_0x0953('0x60')]+'%';_0x5c4551[_0x5d76be]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x15292b,_0x15292b,_0x15292b);}}else{_0x5cf28a=_[_0x0953('0x5e')](_0x2e5c91,[_0x0953('0x30'),_0x0953('0x64')]);_0x1ef723[_0x0953('0x46')]=_0x0953('0x64');_0x2cfefb=as[_0x0953('0x65')](_0xa0c0e5,_0x5cf28a[_0x0953('0x3a')],_0x1ef723);_0x5c4551[_0x5d76be](_0x2cfefb[_0x0953('0x66')],_0x2cfefb['value']['start'],_0x2cfefb['value'][_0x0953('0x22')]);}break;case _0x0953('0x67'):var _0x50df5e=_0x1ef723['value'][_0x0953('0x35')](',')['map'](function(_0x37c416){return Number(_0x37c416);});_0x50df5e[_0x0953('0x68')](function(_0x359282){_0x38b9f0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x359282+',%');});_0x39bac6=_[_0x0953('0x69')](_0x39bac6,_0x50df5e);break;case _0x0953('0x6a'):if(_0x1ef723[_0x0953('0x62')]==='$substring'){_0x5c4551[_0x5d76be](_0x0953('0x6b'),'%'+_0x1ef723[_0x0953('0x60')]+'%',null);}else{_0x5cf28a=_['find'](_0x2e5c91,['name',_0x0953('0x6c')]);_0x1ef723['field']=_0x0953('0x6c');_0x2cfefb=as[_0x0953('0x65')](_0xa0c0e5,_0x5cf28a['type'],_0x1ef723);_0x5c4551[_0x5d76be](_0x2cfefb['text'],_0x2cfefb[_0x0953('0x60')][_0x0953('0x6d')],_0x2cfefb[_0x0953('0x60')][_0x0953('0x22')]);}break;case _0x0953('0x6e'):_0x2cfefb=as[_0x0953('0x65')]('me',null,_0x1ef723);_0x5c4551[_0x5d76be](_0x2cfefb['text'],_0x2cfefb[_0x0953('0x60')]['start'],_0x2cfefb[_0x0953('0x60')]['end']);break;}}else{var _0x2cfefb=as[_0x0953('0x65')](_0xa0c0e5,_0x5cf28a['type'],_0x1ef723);_0x5c4551[_0x5d76be](_0x2cfefb[_0x0953('0x66')],_0x2cfefb[_0x0953('0x60')]['start'],_0x2cfefb['value'][_0x0953('0x22')]);}}}else{var _0x1311d8=_(_0x21dad2[_0x0953('0x3c')])['keys']()[_0x0953('0x32')](function(_0x2bd4de){return _[_0x0953('0x6f')](_0x2e5c91,[_0x0953('0x30'),_0x2bd4de])?_0x2bd4de:undefined;})[_0x0953('0x70')]()[_0x0953('0x60')]();if(!_[_0x0953('0x71')](_0x1311d8)){_0x1311d8[_0x0953('0x68')](function(_0x6cf002){if(_0x6cf002===_0x0953('0x72')){_0xd9e3be[_0x0953('0x73')](_0x0953('0x74'),[]['concat'](_0x21dad2['query'][_0x6cf002]));}else if(_0x6cf002===_0x0953('0x75')){var _0x80bde4=JSON[_0x0953('0x76')](_0x21dad2[_0x0953('0x3c')][_0x6cf002])['$gte'];var _0x5dc4d2=JSON['parse'](_0x21dad2['query'][_0x6cf002])['$lte'];_0xd9e3be[_0x0953('0x73')](_0x0953('0x77'),_0x80bde4,_0x5dc4d2);}else{if(_0x21dad2[_0x0953('0x3c')][_0x6cf002]===_0x0953('0x78')){_0xd9e3be[_0x0953('0x73')]('i.'+_0x6cf002+'\x20IS\x20NULL');}else{_0xd9e3be[_0x0953('0x73')]('i.'+_0x6cf002+'\x20=\x20?',_0x21dad2['query'][_0x6cf002]);}}});}if(_0x21dad2[_0x0953('0x3c')][_0x0953('0x79')]){if(_0x21dad2[_0x0953('0x3c')]['read']==0x1){_0xd9e3be[_0x0953('0x61')](_0x0953('0x7a'));}else{_0xd9e3be[_0x0953('0x61')](_0x0953('0x7b'));}}if(_0x21dad2[_0x0953('0x3c')]['tag']){_0x39bac6=_[_0x0953('0x7c')](_0x21dad2[_0x0953('0x3c')]['tag'])?_0x21dad2[_0x0953('0x3c')][_0x0953('0x7d')]:new Array(_0x21dad2[_0x0953('0x3c')][_0x0953('0x7d')]);_0x39bac6['forEach'](function(_0x4596a9){_0x38b9f0['or'](_0x0953('0x7e'),'%,'+_0x4596a9+',%');});}if(_0x21dad2[_0x0953('0x3c')][_0x0953('0x7f')]){var _0x1e47b9=_0x21dad2['query'][_0x0953('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x0953('0x80')](/'/g,'\x27\x27');if(qs[_0x0953('0x81')](_0x1e47b9)){_0x5c4551['or'](_0x0953('0x82'),_0x1e47b9+'%')['or']('i.fax\x20LIKE\x20?',_0x1e47b9+'%');}_0x5c4551['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1e47b9+'%');}}_0xd9e3be['where'](_0x5c4551);_0xd9e3be[_0x0953('0x83')](_0x0953('0x84'));var _0x399790={'type':db[_0x0953('0x85')][_0x0953('0x86')][_0x0953('0x87')],'raw':!![]};var _0x28e5d2=_0xd9e3be[_0x0953('0x88')]();_0x28e5d2[_0x0953('0x46')](_0x0953('0x84'));_0x28e5d2[_0x0953('0x46')](_0x0953('0x89'),'unreadMessages');if(_0x5094ba[_0x0953('0x42')]){_0x5094ba['order'][_0x0953('0x68')](function(_0x5a7540){var _0x4ece2c=_0x5a7540[0x0]===_0x0953('0x8a')?_0x5a7540[0x0]:'i.'+_0x5a7540[0x0];_0xd9e3be[_0x0953('0x42')](_0x4ece2c,_0x5a7540[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x39bac6)){_0xd9e3be[_0x0953('0x61')](_0x38b9f0);_0x28e5d2[_0x0953('0x73')]('t.id\x20IN\x20?',_0x39bac6);}BPromise[_0x0953('0x8b')]()[_0x0953('0x2d')](function(){if(!_0x5a67fe){if(_0x21dad2[_0x0953('0x3c')][_0x0953('0x72')])return;_0x28e5d2[_0x0953('0x73')](_0x0953('0x8c'));_0xd9e3be[_0x0953('0x73')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x21dad2['user'][_0x0953('0x8d')]!=='agent')return;return _0x21dad2[_0x0953('0x8e')][_0x0953('0x8f')]({'attributes':['id'],'raw':!![]})[_0x0953('0x2d')](function(_0x1520a2){if(_[_0x0953('0x71')](_0x1520a2)){_0x28e5d2[_0x0953('0x73')](_0x0953('0x90'));_0xd9e3be['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x28e5d2[_0x0953('0x73')](_0x0953('0x74'),_[_0x0953('0x32')](_0x1520a2,'id'));_0xd9e3be[_0x0953('0x73')]('i.FaxAccountId\x20IN\x20?',_[_0x0953('0x32')](_0x1520a2,'id'));}});})[_0x0953('0x2d')](function(){if(_0x21dad2[_0x0953('0x8e')][_0x0953('0x8d')]===_0x0953('0x91')&&!_0x5a67fe&&!_0x21dad2[_0x0953('0x3c')][_0x0953('0x72')])return[];return db[_0x0953('0x92')]['query'](_0x28e5d2[_0x0953('0x93')](),_0x399790);})[_0x0953('0x2d')](function(_0x4ab573){_0x35212b[_0x0953('0x26')]=_0x4ab573['length'];if(_0x35212b['count']===0x0)return[];return db[_0x0953('0x92')][_0x0953('0x3c')](_0x1b98c6['toString'](),_0x399790)['then'](function(_0x264637){_0x34aad0=_['keyBy'](_0x264637,'id');_0x399790=_['merge'](_0x399790,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x21dad2[_0x0953('0x3c')][_0x0953('0x40')]){_0x5094ba[_0x0953('0x3f')][_0x0953('0x68')](function(_0x4900f4){_0xd9e3be[_0x0953('0x46')]('i.'+_0x4900f4);});}else{_0xd9e3be['field'](_0x0953('0x89'),_0x0953('0x5f'));_0xd9e3be[_0x0953('0x46')](_0x0953('0x94'),_0x0953('0x95'));_0xd9e3be[_0x0953('0x46')](_0x0953('0x96'),'Account.mandatoryDisposition');_0xd9e3be[_0x0953('0x46')]('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',_0x0953('0x8a'));_0xd9e3be[_0x0953('0x46')](_0x0953('0x97'));_0xd9e3be['field'](_0x0953('0x98'),_0x0953('0x99'));_0xd9e3be[_0x0953('0x46')](_0x0953('0x9a'),_0x0953('0x9b'));_0xd9e3be[_0x0953('0x46')](_0x0953('0x9c'),_0x0953('0x9d'));_0xd9e3be[_0x0953('0x46')](_0x0953('0x9e'),_0x0953('0x9f'));_0xd9e3be[_0x0953('0x46')]('c.mobile',_0x0953('0xa0'));_0xd9e3be[_0x0953('0x46')](_0x0953('0xa1'),_0x0953('0xa2'));_0xd9e3be['field'](_0x0953('0xa3'),'Owner.fullname');_0xd9e3be['field'](_0x0953('0xa4'),_0x0953('0xa5'));_0xd9e3be['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0953('0x33'));}if(_0x5094ba['limit'])_0xd9e3be[_0x0953('0x25')](_0x5094ba[_0x0953('0x25')]);if(_0x5094ba[_0x0953('0x24')])_0xd9e3be[_0x0953('0x24')](_0x5094ba['offset']);return db[_0x0953('0x92')][_0x0953('0x3c')](_0xd9e3be[_0x0953('0x93')](),_0x399790);})[_0x0953('0x2d')](function(_0x19bd5c){if(_0x19bd5c[_0x0953('0x5d')]>0x0)_0x28fd4a['where'](_0x0953('0xa6'),_[_0x0953('0x32')](_0x19bd5c,'id'));return db[_0x0953('0x92')][_0x0953('0x3c')](_0x28fd4a[_0x0953('0x93')](),_0x399790)['then'](function(_0x293271){var _0x4dc797=_[_0x0953('0xa7')](_0x293271,_0x0953('0xa8'));var _0x692c4e=[];_0x19bd5c['forEach'](function(_0x89ccb1){_0x692c4e[_0x0953('0xa9')](updateFaxInteraction(_0x89ccb1,_0x34aad0,_0x4dc797));});return BPromise[_0x0953('0xaa')](_0x692c4e);});});})[_0x0953('0x2d')](function(_0x26cb3c){_0x35212b[_0x0953('0xab')]=_0x26cb3c;return _0x35212b;})[_0x0953('0x2d')](respondWithFilteredResult(_0x509fdd,_0x5094ba))['catch'](handleError(_0x509fdd,null));};exports['show']=function(_0x5234a8,_0x33adaa){var _0x7affb6={'raw':![],'where':{'id':_0x5234a8[_0x0953('0xac')]['id']}},_0x339734={};_0x339734[_0x0953('0x3b')]=_[_0x0953('0xad')](db[_0x0953('0xae')][_0x0953('0x38')]);_0x339734[_0x0953('0x3c')]=_[_0x0953('0xad')](_0x5234a8[_0x0953('0x3c')]);_0x339734[_0x0953('0x3d')]=_[_0x0953('0x3e')](_0x339734['model'],_0x339734[_0x0953('0x3c')]);_0x7affb6['attributes']=_[_0x0953('0x3e')](_0x339734[_0x0953('0x3b')],qs[_0x0953('0x40')](_0x5234a8[_0x0953('0x3c')][_0x0953('0x40')]));_0x7affb6[_0x0953('0x3f')]=_0x7affb6[_0x0953('0x3f')]['length']?_0x7affb6['attributes']:_0x339734['model'];if(_0x5234a8[_0x0953('0x3c')][_0x0953('0xaf')]){_0x7affb6[_0x0953('0xb0')]=[{'all':!![]}];}_0x7affb6=_[_0x0953('0xb1')]({},_0x7affb6,_0x5234a8[_0x0953('0xb2')]);return db['FaxInteraction'][_0x0953('0x5e')](_0x7affb6)[_0x0953('0x2d')](handleEntityNotFound(_0x33adaa,null))[_0x0953('0x2d')](respondWithResult(_0x33adaa,null))[_0x0953('0x36')](handleError(_0x33adaa,null));};exports['create']=function(_0x3fb283,_0x12a6e5){return db[_0x0953('0xae')][_0x0953('0xb3')](_0x3fb283[_0x0953('0x6e')],{})[_0x0953('0x2d')](respondWithResult(_0x12a6e5,0xc9))['catch'](handleError(_0x12a6e5,null));};exports[_0x0953('0x2c')]=function(_0x16c8ab,_0x1b04d5){if(_0x16c8ab[_0x0953('0x6e')]['id']){delete _0x16c8ab[_0x0953('0x6e')]['id'];}return db[_0x0953('0xae')]['find']({'where':{'id':_0x16c8ab['params']['id']}})[_0x0953('0x2d')](handleEntityNotFound(_0x1b04d5,null))[_0x0953('0x2d')](saveUpdates(_0x16c8ab['body'],null))['then'](respondWithResult(_0x1b04d5,null))[_0x0953('0x36')](handleError(_0x1b04d5,null));};exports[_0x0953('0x2e')]=function(_0x170756,_0x350022){return db[_0x0953('0xae')][_0x0953('0x5e')]({'where':{'id':_0x170756[_0x0953('0xac')]['id']}})[_0x0953('0x2d')](handleEntityNotFound(_0x350022,null))[_0x0953('0x2d')](removeEntity(_0x350022,null))[_0x0953('0x36')](handleError(_0x350022,null));};exports['describe']=function(_0x161066,_0x5beac6){return db['FaxInteraction'][_0x0953('0xb4')]()['then'](respondWithResult(_0x5beac6,null))['catch'](handleError(_0x5beac6,null));};exports[_0x0953('0xb5')]=function(_0x467676,_0x23225e,_0x8be01a){return db[_0x0953('0xb6')][_0x0953('0x5e')]({'where':{'id':_0x467676[_0x0953('0xac')]['id']}})[_0x0953('0x2d')](handleEntityNotFound(_0x23225e,null))[_0x0953('0x2d')](function(_0x5e557a){if(_0x5e557a){return _0x5e557a['addMessage'](_0x467676[_0x0953('0x6e')][_0x0953('0xb7')],_[_0x0953('0xb8')](_0x467676[_0x0953('0x6e')],['ids','id'])||{});}})[_0x0953('0x2d')](respondWithResult(_0x23225e,null))[_0x0953('0x36')](handleError(_0x23225e,null));};exports[_0x0953('0xb9')]=function(_0x41b67b,_0x3dc3a5,_0x57f8ce){var _0x5760cc={'raw':![],'where':{}};var _0x3faed7={};var _0x225718={'count':0x0,'rows':[]};return db[_0x0953('0xae')][_0x0953('0xba')]({'where':{'id':_0x41b67b[_0x0953('0xac')]['id']}})[_0x0953('0x2d')](handleEntityNotFound(_0x3dc3a5,null))[_0x0953('0x2d')](function(_0x24773e){if(_0x24773e){_0x3faed7[_0x0953('0x3b')]=_[_0x0953('0xad')](db['FaxMessage'][_0x0953('0x38')]);_0x3faed7[_0x0953('0x3c')]=_[_0x0953('0xad')](_0x41b67b[_0x0953('0x3c')]);_0x3faed7[_0x0953('0x3d')]=_[_0x0953('0x3e')](_0x3faed7[_0x0953('0x3b')],_0x3faed7[_0x0953('0x3c')]);_0x5760cc[_0x0953('0x3f')]=_[_0x0953('0x3e')](_0x3faed7[_0x0953('0x3b')],qs[_0x0953('0x40')](_0x41b67b['query'][_0x0953('0x40')]));_0x5760cc[_0x0953('0x3f')]=_0x5760cc[_0x0953('0x3f')][_0x0953('0x5d')]?_0x5760cc[_0x0953('0x3f')]:_0x3faed7['model'];if(!_0x41b67b['query'][_0x0953('0x41')](_0x0953('0xbb'))){_0x5760cc[_0x0953('0x25')]=qs[_0x0953('0x25')](_0x41b67b[_0x0953('0x3c')][_0x0953('0x25')]);_0x5760cc[_0x0953('0x24')]=qs[_0x0953('0x24')](_0x41b67b[_0x0953('0x3c')][_0x0953('0x24')]);}_0x5760cc['order']=qs[_0x0953('0x43')](_0x41b67b[_0x0953('0x3c')]['sort']);_0x5760cc[_0x0953('0x73')]=qs['filters'](_[_0x0953('0x44')](_0x41b67b[_0x0953('0x3c')],_0x3faed7[_0x0953('0x3d')]));_0x5760cc[_0x0953('0x73')][_0x0953('0xa8')]=_0x24773e['id'];if(_0x41b67b[_0x0953('0x3c')][_0x0953('0x7f')]){_0x5760cc['where']=_[_0x0953('0xb1')](_0x5760cc['where'],{'$or':_[_0x0953('0x32')](_0x5760cc[_0x0953('0x3f')],function(_0x3ef4cb){var _0x8d2e08={};_0x8d2e08[_0x3ef4cb]={'$like':'%'+_0x41b67b[_0x0953('0x3c')]['filter']+'%'};return _0x8d2e08;})});}if(_0x41b67b['query'][_0x0953('0xbc')]){var _0x5f9c5b=_0x41b67b[_0x0953('0x3c')][_0x0953('0xbc')][_0x0953('0x35')](',');var _0x3309ab={};_0x3309ab[_0x5f9c5b[0x0]]={'$gte':moment(_0x5f9c5b[0x1])[_0x0953('0xbd')](_0x0953('0xbe'))};_0x5760cc['where']=_['merge'](_0x5760cc[_0x0953('0x73')],_0x3309ab);}_0x5760cc=_[_0x0953('0xb1')]({},_0x5760cc,_0x41b67b['options']);return db[_0x0953('0xb6')][_0x0953('0x26')]({'where':_0x5760cc[_0x0953('0x73')]})[_0x0953('0x2d')](function(_0x26383e){_0x225718[_0x0953('0x26')]=_0x26383e;if(_0x41b67b[_0x0953('0x3c')]['includeAll']){_0x5760cc[_0x0953('0xb0')]=[{'all':!![]}];}return db['FaxMessage'][_0x0953('0xbf')](_0x5760cc);})[_0x0953('0x2d')](function(_0x2fdcf9){_0x225718[_0x0953('0xab')]=_0x2fdcf9;return _0x225718;});}})[_0x0953('0x2d')](respondWithFilteredResult(_0x3dc3a5,_0x5760cc))[_0x0953('0x36')](handleError(_0x3dc3a5,null));};exports[_0x0953('0xc0')]=function(_0x5015d3,_0x5d9992,_0x2890cb){return db[_0x0953('0xae')][_0x0953('0x5e')]({'where':{'id':_0x5015d3[_0x0953('0xac')]['id']}})['then'](handleEntityNotFound(_0x5d9992,null))[_0x0953('0x2d')](function(_0x2c3d45){if(_0x2c3d45){return _0x2c3d45[_0x0953('0xc1')](_0x5015d3['body'][_0x0953('0xb7')],_['omit'](_0x5015d3[_0x0953('0x6e')],[_0x0953('0xb7'),'id'])||{})[_0x0953('0xc2')](function(){return db['Tag'][_0x0953('0xbf')]({'attributes':['id',_0x0953('0x30'),_0x0953('0x47')],'where':{'id':_0x5015d3[_0x0953('0x6e')][_0x0953('0xb7')]}});})[_0x0953('0x2d')](function(_0x55f15f){socket[_0x0953('0xc3')]('faxInteractionTags:save',{'id':Number(_0x5015d3['params']['id']),'tags':_0x55f15f||[]});return{'id':Number(_0x5015d3[_0x0953('0xac')]['id']),'tags':_0x55f15f||[]};});}})[_0x0953('0x2d')](respondWithResult(_0x5d9992,null))['catch'](handleError(_0x5d9992,null));};exports[_0x0953('0xc4')]=function(_0x30f95e,_0x177794,_0x4d3288){return db[_0x0953('0xae')][_0x0953('0x5e')]({'where':{'id':_0x30f95e[_0x0953('0xac')]['id']}})[_0x0953('0x2d')](handleEntityNotFound(_0x177794,null))['then'](function(_0x25464b){if(_0x25464b){return _0x25464b[_0x0953('0xc4')](_0x30f95e[_0x0953('0x3c')][_0x0953('0xb7')]);}})['then'](respondWithStatusCode(_0x177794,null))[_0x0953('0x36')](handleError(_0x177794,null));};exports[_0x0953('0xc5')]=function(_0x5ca213,_0x435656){var _0x42e78d=moment()[_0x0953('0xc6')]()[_0x0953('0x93')]();var _0x2e72ee=path[_0x0953('0xc7')](config['root'],'server',_0x0953('0xc8'),_0x0953('0xc9'));var _0x283341=path[_0x0953('0xc7')](config[_0x0953('0xca')],_0x0953('0xcb'),_0x0953('0xc8'),'attachments');var _0x3b2e3c=path[_0x0953('0xc7')](_0x2e72ee,_0x42e78d);var _0x27fecd=util['format'](_0x0953('0xcc'),_0x5ca213[_0x0953('0xac')]['id'],_0x42e78d);var _0x5d2189=path[_0x0953('0xc7')](_0x2e72ee,_0x27fecd);var _0xe3d335=[];_0xe3d335['push']({'model':db[_0x0953('0xcd')],'as':_0x0953('0xcd'),'raw':!![]});var _0xc4c18f=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x0953('0x6e'),_0x0953('0x75')],'include':_0xe3d335}];return db[_0x0953('0xae')][_0x0953('0x5e')]({'where':{'id':_0x5ca213['params']['id']},'include':_0xc4c18f})[_0x0953('0x2d')](handleEntityNotFound(_0x435656,null))[_0x0953('0x2d')](function(_0xed5078){if(_0xed5078&&_0xed5078['Messages']){var _0x1ba882=_0xed5078[_0x0953('0xce')]({'plain':!![]});fs[_0x0953('0xcf')](_0x3b2e3c);for(var _0xcd41ff=0x0;_0xcd41ff<_0x1ba882[_0x0953('0xd0')][_0x0953('0x5d')];_0xcd41ff++){var _0x55d8ac=_0x1ba882[_0x0953('0xd0')][_0xcd41ff]['Attachment'];if(_0x55d8ac){var _0x39f854=path[_0x0953('0xc7')](_0x283341,_0x55d8ac[_0x0953('0xd1')]);if(fs[_0x0953('0xd2')](_0x39f854)){fs[_0x0953('0xd3')](_0x39f854)['pipe'](fs['createWriteStream'](path[_0x0953('0xc7')](_0x3b2e3c,_0x55d8ac[_0x0953('0xd1')])));}}}return BPromise['resolve']()[_0x0953('0x2d')](function(){return new BPromise(function(_0xa33f98,_0xaa3e14){zipdir(_0x3b2e3c,{'saveTo':_0x5d2189},function(_0x52b50d,_0xcc987c){if(_0x52b50d)return _0xaa3e14(_0x52b50d);return _0xa33f98(_0xcc987c);});})[_0x0953('0x2d')](function(){return new BPromise(function(_0x5d10af,_0x5334dc){rimraf(_0x3b2e3c,function(_0x34d4b0){if(_0x34d4b0)_0x5334dc(_0x34d4b0);return _0x5d10af();});});})[_0x0953('0x2d')](function(){return _0x435656[_0x0953('0xc5')](_0x5d2189,_0x27fecd,function(_0x6f29){if(_0x6f29){console[_0x0953('0xd4')]('err',_0x6f29);}else{fs['unlinkSync'](_0x5d2189);}});});});}else{return _0x435656[_0x0953('0x20')](0xc8);}})[_0x0953('0x36')](handleError(_0x435656,null));}; \ No newline at end of file +var _0x3c63=['i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','rows','show','params','FaxInteraction','includeAll','options','create','update','describe','addMessage','FaxMessage','ids','omit','findOne','FaxInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','redis','./faxInteraction.socket','register','sendStatus','status','undefined','count','offset','limit','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','catch','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','select','u.fullname','user_has_fax_interactions','left_join','users','fax_interactions','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','contactName','DESC','t.id\x20IN\x20?','resolve'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0x3c63,0x125));var _0x33c6=function(_0x3116c9,_0x1db034){_0x3116c9=_0x3116c9-0x0;var _0x2ca671=_0x3c63[_0x3116c9];return _0x2ca671;};'use strict';var emlformat=require(_0x33c6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33c6('0x1'));var rp=require(_0x33c6('0x2'));var moment=require(_0x33c6('0x3'));var BPromise=require(_0x33c6('0x4'));var Mustache=require(_0x33c6('0x5'));var util=require('util');var path=require('path');var sox=require(_0x33c6('0x6'));var csv=require(_0x33c6('0x7'));var ejs=require(_0x33c6('0x8'));var fs=require('fs');var fs_extra=require(_0x33c6('0x9'));var _=require(_0x33c6('0xa'));var squel=require(_0x33c6('0xb'));var crypto=require(_0x33c6('0xc'));var jsforce=require(_0x33c6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x33c6('0x7'));var querystring=require(_0x33c6('0xe'));var Papa=require(_0x33c6('0xf'));var Redis=require(_0x33c6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33c6('0x11'));var as=require(_0x33c6('0x12'));var hardwareService=require(_0x33c6('0x13'));var logger=require(_0x33c6('0x14'))(_0x33c6('0x15'));var utils=require(_0x33c6('0x16'));var config=require(_0x33c6('0x17'));var licenseUtil=require(_0x33c6('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x33c6('0x19')](config['redis'],{'host':_0x33c6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33c6('0x1b')]));require(_0x33c6('0x1c'))[_0x33c6('0x1d')](socket);function respondWithStatusCode(_0x130c59,_0x5b2457){_0x5b2457=_0x5b2457||0xcc;return function(_0x4271b6){if(_0x4271b6){return _0x130c59[_0x33c6('0x1e')](_0x5b2457);}return _0x130c59[_0x33c6('0x1f')](_0x5b2457)['end']();};}function respondWithResult(_0x4d4025,_0x392a24){_0x392a24=_0x392a24||0xc8;return function(_0x56aa31){if(_0x56aa31){return _0x4d4025['status'](_0x392a24)['json'](_0x56aa31);}};}function respondWithFilteredResult(_0x10d20b,_0x2cfcd9){return function(_0x2d7915){if(_0x2d7915){var _0x3f38f6=typeof _0x2cfcd9['offset']===_0x33c6('0x20')&&typeof _0x2cfcd9['limit']===_0x33c6('0x20');var _0x29ad27=_0x2d7915[_0x33c6('0x21')];var _0x16bfe4=_0x3f38f6?0x0:_0x2cfcd9['offset'];var _0x197c07=_0x3f38f6?_0x2d7915[_0x33c6('0x21')]:_0x2cfcd9[_0x33c6('0x22')]+_0x2cfcd9[_0x33c6('0x23')];var _0x41f7d4;if(_0x197c07>=_0x29ad27){_0x197c07=_0x29ad27;_0x41f7d4=0xc8;}else{_0x41f7d4=0xce;}_0x10d20b[_0x33c6('0x1f')](_0x41f7d4);return _0x10d20b['set'](_0x33c6('0x24'),_0x16bfe4+'-'+_0x197c07+'/'+_0x29ad27)['json'](_0x2d7915);}return null;};}function patchUpdates(_0xb4996a){return function(_0x2b64f9){try{jsonpatch[_0x33c6('0x25')](_0x2b64f9,_0xb4996a,!![]);}catch(_0x3b2c56){return BPromise[_0x33c6('0x26')](_0x3b2c56);}return _0x2b64f9[_0x33c6('0x27')]();};}function saveUpdates(_0x57451f,_0x43d13c){return function(_0x501480){if(_0x501480){return _0x501480['update'](_0x57451f)['then'](function(_0x128749){return _0x128749;});}return null;};}function removeEntity(_0x172a00,_0x4cee87){return function(_0x351478){if(_0x351478){return _0x351478[_0x33c6('0x28')]()[_0x33c6('0x29')](function(){_0x172a00[_0x33c6('0x1f')](0xcc)[_0x33c6('0x2a')]();});}};}function handleEntityNotFound(_0x505b72,_0x300a56){return function(_0x1789be){if(!_0x1789be){_0x505b72[_0x33c6('0x1e')](0x194);}return _0x1789be;};}function handleError(_0x46b517,_0x1827e9){_0x1827e9=_0x1827e9||0x1f4;return function(_0x525f0e){logger[_0x33c6('0x2b')](_0x525f0e[_0x33c6('0x2c')]);if(_0x525f0e[_0x33c6('0x2d')]){delete _0x525f0e[_0x33c6('0x2d')];}_0x46b517[_0x33c6('0x1f')](_0x1827e9)[_0x33c6('0x2e')](_0x525f0e);};}function getInteractionUsers(_0x5428f0,_0x28fc46){return new BPromise(function(_0x4620c9,_0x23188c){try{if(_0x28fc46[_0x5428f0['id']]){_0x5428f0['Users']=_['map'](_0x28fc46[_0x5428f0['id']],function(_0x905ed0){return{'id':_0x905ed0['id'],'fullname':_0x905ed0[_0x33c6('0x2f')]};});}}catch(_0x384a79){_0x23188c(_0x384a79);}_0x4620c9(_0x5428f0);});}function getInteractionTags(_0x497174,_0x2322b0){return new BPromise(function(_0x11bca5,_0x43a15f){try{if(_0x497174[_0x33c6('0x30')]){_0x497174[_0x33c6('0x31')]=[];_0x497174['TagIds'][_0x33c6('0x32')](',')[_0x33c6('0x33')](function(_0x4167b7){_0x497174[_0x33c6('0x31')][_0x33c6('0x34')](_0x2322b0[_0x4167b7]);});}delete _0x497174['TagIds'];}catch(_0x10154e){_0x43a15f(_0x10154e);}_0x11bca5(_0x497174);});}function updateFaxInteraction(_0x4a9a34,_0x18bdc8,_0xe08fb2){return new BPromise(function(_0x76fe82,_0x195272){return getInteractionUsers(_0x4a9a34,_0xe08fb2)[_0x33c6('0x29')](function(_0x186b06){return getInteractionTags(_0x186b06,_0x18bdc8);})[_0x33c6('0x29')](function(_0x467812){_0x76fe82(_0x467812);})[_0x33c6('0x35')](function(_0x24ffa4){_0x195272(_0x24ffa4);});});}exports['index']=function(_0xc0570f,_0x2f26f4){var _0x4f9822={},_0x3915c3={},_0x5991d7={'count':0x0,'rows':[]};var _0xcf87a4=_[_0x33c6('0x36')](db['FaxInteraction'][_0x33c6('0x37')],function(_0x5420c3){return{'name':_0x5420c3['fieldName'],'type':_0x5420c3[_0x33c6('0x38')]['key']};});_0x3915c3[_0x33c6('0x39')]=_['map'](_0xcf87a4,_0x33c6('0x2d'));_0x3915c3[_0x33c6('0x3a')]=_[_0x33c6('0x3b')](_0xc0570f[_0x33c6('0x3a')]);_0x3915c3[_0x33c6('0x3c')]=_[_0x33c6('0x3d')](_0x3915c3[_0x33c6('0x39')],_0x3915c3['query']);_0x4f9822[_0x33c6('0x3e')]=_['intersection'](_0x3915c3[_0x33c6('0x39')],qs[_0x33c6('0x3f')](_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x3f')]));_0x4f9822[_0x33c6('0x3e')]=_0x4f9822['attributes'][_0x33c6('0x40')]?_0x4f9822[_0x33c6('0x3e')]:_0x3915c3[_0x33c6('0x39')];if(!_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x41')](_0x33c6('0x42'))){_0x4f9822[_0x33c6('0x23')]=qs[_0x33c6('0x23')](_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x23')]);_0x4f9822['offset']=qs[_0x33c6('0x22')](_0xc0570f['query'][_0x33c6('0x22')]);}_0x4f9822[_0x33c6('0x43')]=qs[_0x33c6('0x44')](_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x44')]);_0x4f9822['where']=qs[_0x33c6('0x3c')](_[_0x33c6('0x45')](_0xc0570f['query'],_0x3915c3['filters']),_0xcf87a4);var _0x32e0f4=[];var _0x2dacca=squel['select']()[_0x33c6('0x46')]('id')['field']('name')['field'](_0x33c6('0x47'))[_0x33c6('0x48')](_0x33c6('0x49'));var _0x202865=squel[_0x33c6('0x4a')]()['field']('u.id')[_0x33c6('0x46')](_0x33c6('0x4b'))[_0x33c6('0x46')]('ui.FaxInteractionId')['from'](_0x33c6('0x4c'),'ui')[_0x33c6('0x4d')](_0x33c6('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x303150=squel[_0x33c6('0x4a')]()[_0x33c6('0x48')](_0x33c6('0x4f'),'i')[_0x33c6('0x4d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x33c6('0x4d')](_0x33c6('0x4e'),'o',_0x33c6('0x50'))[_0x33c6('0x4d')](_0x33c6('0x51'),'a',_0x33c6('0x52'))[_0x33c6('0x4d')](_0x33c6('0x53'),'me',_0x33c6('0x54'))['left_join'](_0x33c6('0x55'),'it',_0x33c6('0x56'))[_0x33c6('0x4d')]('tools_tags','t',_0x33c6('0x57'));var _0x174251=squel[_0x33c6('0x58')]();var _0x28bf0d=[];var _0xe11eb6=squel[_0x33c6('0x58')]();var _0x37ea3e;if(_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x59')]){_0x37ea3e=as['parseSearch'](_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x59')]);var _0x505b0f=_0x37ea3e[_0x33c6('0x5a')];for(var _0x161ef6=0x0;_0x161ef6<_0x37ea3e[_0x33c6('0x5b')][_0x33c6('0x40')];_0x161ef6++){var _0x1aa5e0=_0x37ea3e[_0x33c6('0x5b')][_0x161ef6];var _0x50df1c='i';var _0x22dbbf=_['find'](_0xcf87a4,[_0x33c6('0x2d'),_0x1aa5e0[_0x33c6('0x46')]]);if(!_0x22dbbf){switch(_0x1aa5e0['field']){case'unreadMessages':if(_0x1aa5e0[_0x33c6('0x5c')]==0x1){_0x303150['having']('`'+_0x1aa5e0[_0x33c6('0x46')]+_0x33c6('0x5d'));}else{_0x303150[_0x33c6('0x5e')]('`'+_0x1aa5e0['field']+_0x33c6('0x5f'));}break;case _0x33c6('0x60'):if(_0x1aa5e0[_0x33c6('0x61')]===_0x33c6('0x62')){if(_0x1aa5e0[_0x33c6('0x5c')][_0x33c6('0x32')]('\x20')[_0x33c6('0x40')]>0x1){_0x174251[_0x505b0f](_0x33c6('0x63'),qs[_0x33c6('0x64')](_0x1aa5e0[_0x33c6('0x5c')]),null);}else{var _0x3fee7c='%'+_0x1aa5e0['value']+'%';_0x174251[_0x505b0f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3fee7c,_0x3fee7c,_0x3fee7c);}}else{_0x22dbbf=_[_0x33c6('0x65')](_0xcf87a4,[_0x33c6('0x2d'),_0x33c6('0x66')]);_0x1aa5e0[_0x33c6('0x46')]=_0x33c6('0x66');_0x4be6f2=as[_0x33c6('0x67')](_0x50df1c,_0x22dbbf[_0x33c6('0x38')],_0x1aa5e0);_0x174251[_0x505b0f](_0x4be6f2['text'],_0x4be6f2[_0x33c6('0x5c')][_0x33c6('0x68')],_0x4be6f2[_0x33c6('0x5c')][_0x33c6('0x2a')]);}break;case'Tag':var _0x29a7c1=_0x1aa5e0[_0x33c6('0x5c')][_0x33c6('0x32')](',')['map'](function(_0x4d6890){return Number(_0x4d6890);});_0x29a7c1[_0x33c6('0x33')](function(_0x4f71ba){_0xe11eb6['or'](_0x33c6('0x69'),'%,'+_0x4f71ba+',%');});_0x28bf0d=_[_0x33c6('0x6a')](_0x28bf0d,_0x29a7c1);break;case _0x33c6('0x6b'):if(_0x1aa5e0['operator']===_0x33c6('0x62')){_0x174251[_0x505b0f](_0x33c6('0x6c'),'%'+_0x1aa5e0['value']+'%',null);}else{_0x22dbbf=_[_0x33c6('0x65')](_0xcf87a4,[_0x33c6('0x2d'),'UserId']);_0x1aa5e0[_0x33c6('0x46')]=_0x33c6('0x6d');_0x4be6f2=as['buildExpression'](_0x50df1c,_0x22dbbf['type'],_0x1aa5e0);_0x174251[_0x505b0f](_0x4be6f2[_0x33c6('0x6e')],_0x4be6f2['value'][_0x33c6('0x68')],_0x4be6f2[_0x33c6('0x5c')][_0x33c6('0x2a')]);}break;case _0x33c6('0x6f'):_0x4be6f2=as[_0x33c6('0x67')]('me',null,_0x1aa5e0);_0x174251[_0x505b0f](_0x4be6f2[_0x33c6('0x6e')],_0x4be6f2[_0x33c6('0x5c')][_0x33c6('0x68')],_0x4be6f2[_0x33c6('0x5c')]['end']);break;}}else{var _0x4be6f2=as[_0x33c6('0x67')](_0x50df1c,_0x22dbbf[_0x33c6('0x38')],_0x1aa5e0);_0x174251[_0x505b0f](_0x4be6f2[_0x33c6('0x6e')],_0x4be6f2[_0x33c6('0x5c')][_0x33c6('0x68')],_0x4be6f2[_0x33c6('0x5c')]['end']);}}}else{var _0x45ffe0=_(_0xc0570f['query'])['keys']()[_0x33c6('0x36')](function(_0x538bd1){return _[_0x33c6('0x70')](_0xcf87a4,['name',_0x538bd1])?_0x538bd1:undefined;})['compact']()[_0x33c6('0x5c')]();if(!_[_0x33c6('0x71')](_0x45ffe0)){_0x45ffe0[_0x33c6('0x33')](function(_0x4468d5){if(_0x4468d5===_0x33c6('0x72')){_0x303150[_0x33c6('0x73')](_0x33c6('0x74'),[][_0x33c6('0x75')](_0xc0570f[_0x33c6('0x3a')][_0x4468d5]));}else if(_0x4468d5===_0x33c6('0x76')){var _0x3f4153=JSON['parse'](_0xc0570f[_0x33c6('0x3a')][_0x4468d5])['$gte'];var _0x25b245=JSON[_0x33c6('0x77')](_0xc0570f[_0x33c6('0x3a')][_0x4468d5])[_0x33c6('0x78')];_0x303150[_0x33c6('0x73')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3f4153,_0x25b245);}else{if(_0xc0570f['query'][_0x4468d5]===_0x33c6('0x79')){_0x303150[_0x33c6('0x73')]('i.'+_0x4468d5+_0x33c6('0x7a'));}else{_0x303150[_0x33c6('0x73')]('i.'+_0x4468d5+_0x33c6('0x7b'),_0xc0570f[_0x33c6('0x3a')][_0x4468d5]);}}});}if(_0xc0570f['query'][_0x33c6('0x7c')]){if(_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x7c')]==0x1){_0x303150[_0x33c6('0x5e')](_0x33c6('0x7d'));}else{_0x303150[_0x33c6('0x5e')](_0x33c6('0x7e'));}}if(_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x7f')]){_0x28bf0d=_[_0x33c6('0x80')](_0xc0570f[_0x33c6('0x3a')]['tag'])?_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x7f')]:new Array(_0xc0570f['query'][_0x33c6('0x7f')]);_0x28bf0d['forEach'](function(_0x58e671){_0xe11eb6['or'](_0x33c6('0x69'),'%,'+_0x58e671+',%');});}if(_0xc0570f['query'][_0x33c6('0x81')]){var _0x3cb39f=_0xc0570f[_0x33c6('0x3a')]['filter'][_0x33c6('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3cb39f)){_0x174251['or'](_0x33c6('0x83'),_0x3cb39f+'%')['or'](_0x33c6('0x84'),_0x3cb39f+'%');}_0x174251['or'](_0x33c6('0x85'),_0x3cb39f+'%');}}_0x303150['where'](_0x174251);_0x303150['group'](_0x33c6('0x86'));var _0x47d13b={'type':db[_0x33c6('0x87')][_0x33c6('0x88')]['SELECT'],'raw':!![]};var _0x1c52b8=_0x303150['clone']();_0x1c52b8[_0x33c6('0x46')]('i.id');_0x1c52b8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x4f9822[_0x33c6('0x43')]){_0x4f9822[_0x33c6('0x43')]['forEach'](function(_0x20d4ed){var _0x468c77=_0x20d4ed[0x0]===_0x33c6('0x89')?_0x20d4ed[0x0]:'i.'+_0x20d4ed[0x0];_0x303150[_0x33c6('0x43')](_0x468c77,_0x20d4ed[0x1]===_0x33c6('0x8a')?![]:!![]);});}if(!_[_0x33c6('0x71')](_0x28bf0d)){_0x303150[_0x33c6('0x5e')](_0xe11eb6);_0x1c52b8['where'](_0x33c6('0x8b'),_0x28bf0d);}BPromise[_0x33c6('0x8c')]()[_0x33c6('0x29')](function(){if(!_0x37ea3e){if(_0xc0570f[_0x33c6('0x3a')][_0x33c6('0x72')])return;_0x1c52b8['where'](_0x33c6('0x8d'));_0x303150[_0x33c6('0x73')](_0x33c6('0x8d'));return;}if(_0xc0570f[_0x33c6('0x8e')][_0x33c6('0x8f')]!=='agent')return;return _0xc0570f[_0x33c6('0x8e')][_0x33c6('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x28ee9a){if(_[_0x33c6('0x71')](_0x28ee9a)){_0x1c52b8[_0x33c6('0x73')](_0x33c6('0x91'));_0x303150['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x1c52b8[_0x33c6('0x73')](_0x33c6('0x74'),_['map'](_0x28ee9a,'id'));_0x303150['where'](_0x33c6('0x74'),_[_0x33c6('0x36')](_0x28ee9a,'id'));}});})[_0x33c6('0x29')](function(){if(_0xc0570f[_0x33c6('0x8e')]['role']===_0x33c6('0x92')&&!_0x37ea3e&&!_0xc0570f[_0x33c6('0x3a')]['FaxAccountId'])return[];return db[_0x33c6('0x93')][_0x33c6('0x3a')](_0x1c52b8['toString'](),_0x47d13b);})[_0x33c6('0x29')](function(_0xde20f){_0x5991d7['count']=_0xde20f[_0x33c6('0x40')];if(_0x5991d7[_0x33c6('0x21')]===0x0)return[];return db['sequelize'][_0x33c6('0x3a')](_0x2dacca[_0x33c6('0x94')](),_0x47d13b)[_0x33c6('0x29')](function(_0x45d64d){_0x32e0f4=_[_0x33c6('0x95')](_0x45d64d,'id');_0x47d13b=_[_0x33c6('0x96')](_0x47d13b,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xc0570f[_0x33c6('0x3a')]['fields']){_0x4f9822[_0x33c6('0x3e')][_0x33c6('0x33')](function(_0x4ac162){_0x303150[_0x33c6('0x46')]('i.'+_0x4ac162);});}else{_0x303150['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x303150[_0x33c6('0x46')](_0x33c6('0x97'),'Account.key');_0x303150[_0x33c6('0x46')](_0x33c6('0x98'),_0x33c6('0x99'));_0x303150[_0x33c6('0x46')](_0x33c6('0x9a'),'contactName');_0x303150[_0x33c6('0x46')](_0x33c6('0x9b'));_0x303150[_0x33c6('0x46')](_0x33c6('0x9c'),_0x33c6('0x9d'));_0x303150[_0x33c6('0x46')](_0x33c6('0x9e'),_0x33c6('0x9f'));_0x303150['field']('c.email','Contact.email');_0x303150[_0x33c6('0x46')](_0x33c6('0xa0'),_0x33c6('0xa1'));_0x303150[_0x33c6('0x46')](_0x33c6('0xa2'),_0x33c6('0xa3'));_0x303150['field'](_0x33c6('0xa4'),_0x33c6('0xa5'));_0x303150[_0x33c6('0x46')](_0x33c6('0xa6'),'Owner.fullname');_0x303150[_0x33c6('0x46')]('o.internal',_0x33c6('0xa7'));_0x303150[_0x33c6('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x33c6('0x30'));}if(_0x4f9822[_0x33c6('0x23')])_0x303150[_0x33c6('0x23')](_0x4f9822[_0x33c6('0x23')]);if(_0x4f9822[_0x33c6('0x22')])_0x303150['offset'](_0x4f9822[_0x33c6('0x22')]);return db[_0x33c6('0x93')][_0x33c6('0x3a')](_0x303150[_0x33c6('0x94')](),_0x47d13b);})['then'](function(_0x5964d0){if(_0x5964d0[_0x33c6('0x40')]>0x0)_0x202865[_0x33c6('0x73')](_0x33c6('0xa8'),_[_0x33c6('0x36')](_0x5964d0,'id'));return db['sequelize']['query'](_0x202865[_0x33c6('0x94')](),_0x47d13b)[_0x33c6('0x29')](function(_0x3e9e5f){var _0x175080=_[_0x33c6('0xa9')](_0x3e9e5f,'FaxInteractionId');var _0x366221=[];_0x5964d0[_0x33c6('0x33')](function(_0x403c9a){_0x366221[_0x33c6('0x34')](updateFaxInteraction(_0x403c9a,_0x32e0f4,_0x175080));});return BPromise['all'](_0x366221);});});})[_0x33c6('0x29')](function(_0x445a74){_0x5991d7[_0x33c6('0xaa')]=_0x445a74;return _0x5991d7;})['then'](respondWithFilteredResult(_0x2f26f4,_0x4f9822))[_0x33c6('0x35')](handleError(_0x2f26f4,null));};exports[_0x33c6('0xab')]=function(_0x1e777b,_0x38c20a){var _0x4992e8={'raw':![],'where':{'id':_0x1e777b[_0x33c6('0xac')]['id']}},_0x4b22e8={};_0x4b22e8[_0x33c6('0x39')]=_['keys'](db[_0x33c6('0xad')][_0x33c6('0x37')]);_0x4b22e8[_0x33c6('0x3a')]=_['keys'](_0x1e777b[_0x33c6('0x3a')]);_0x4b22e8['filters']=_['intersection'](_0x4b22e8['model'],_0x4b22e8[_0x33c6('0x3a')]);_0x4992e8[_0x33c6('0x3e')]=_['intersection'](_0x4b22e8[_0x33c6('0x39')],qs['fields'](_0x1e777b[_0x33c6('0x3a')][_0x33c6('0x3f')]));_0x4992e8['attributes']=_0x4992e8[_0x33c6('0x3e')][_0x33c6('0x40')]?_0x4992e8[_0x33c6('0x3e')]:_0x4b22e8[_0x33c6('0x39')];if(_0x1e777b[_0x33c6('0x3a')][_0x33c6('0xae')]){_0x4992e8['include']=[{'all':!![]}];}_0x4992e8=_[_0x33c6('0x96')]({},_0x4992e8,_0x1e777b[_0x33c6('0xaf')]);return db[_0x33c6('0xad')]['find'](_0x4992e8)['then'](handleEntityNotFound(_0x38c20a,null))[_0x33c6('0x29')](respondWithResult(_0x38c20a,null))[_0x33c6('0x35')](handleError(_0x38c20a,null));};exports[_0x33c6('0xb0')]=function(_0x132c06,_0x21f9a4){return db[_0x33c6('0xad')][_0x33c6('0xb0')](_0x132c06[_0x33c6('0x6f')],{})[_0x33c6('0x29')](respondWithResult(_0x21f9a4,0xc9))[_0x33c6('0x35')](handleError(_0x21f9a4,null));};exports[_0x33c6('0xb1')]=function(_0x1414f1,_0x2b06dd){if(_0x1414f1[_0x33c6('0x6f')]['id']){delete _0x1414f1[_0x33c6('0x6f')]['id'];}return db[_0x33c6('0xad')][_0x33c6('0x65')]({'where':{'id':_0x1414f1['params']['id']}})['then'](handleEntityNotFound(_0x2b06dd,null))[_0x33c6('0x29')](saveUpdates(_0x1414f1[_0x33c6('0x6f')],null))['then'](respondWithResult(_0x2b06dd,null))[_0x33c6('0x35')](handleError(_0x2b06dd,null));};exports[_0x33c6('0x28')]=function(_0x2bebaf,_0x484622){return db[_0x33c6('0xad')][_0x33c6('0x65')]({'where':{'id':_0x2bebaf[_0x33c6('0xac')]['id']}})[_0x33c6('0x29')](handleEntityNotFound(_0x484622,null))[_0x33c6('0x29')](removeEntity(_0x484622,null))[_0x33c6('0x35')](handleError(_0x484622,null));};exports[_0x33c6('0xb2')]=function(_0x212324,_0x22b10c){return db[_0x33c6('0xad')][_0x33c6('0xb2')]()[_0x33c6('0x29')](respondWithResult(_0x22b10c,null))[_0x33c6('0x35')](handleError(_0x22b10c,null));};exports[_0x33c6('0xb3')]=function(_0xb6eb70,_0x2c4750,_0x2a2d98){return db[_0x33c6('0xb4')][_0x33c6('0x65')]({'where':{'id':_0xb6eb70[_0x33c6('0xac')]['id']}})[_0x33c6('0x29')](handleEntityNotFound(_0x2c4750,null))[_0x33c6('0x29')](function(_0x4a5f7b){if(_0x4a5f7b){return _0x4a5f7b[_0x33c6('0xb3')](_0xb6eb70[_0x33c6('0x6f')][_0x33c6('0xb5')],_[_0x33c6('0xb6')](_0xb6eb70['body'],['ids','id'])||{});}})[_0x33c6('0x29')](respondWithResult(_0x2c4750,null))[_0x33c6('0x35')](handleError(_0x2c4750,null));};exports['getMessages']=function(_0x9e6852,_0x29c4db,_0x1e9889){var _0x47dba3={'raw':![],'where':{}};var _0x392294={};var _0x22fba1={'count':0x0,'rows':[]};return db[_0x33c6('0xad')][_0x33c6('0xb7')]({'where':{'id':_0x9e6852[_0x33c6('0xac')]['id']}})['then'](handleEntityNotFound(_0x29c4db,null))[_0x33c6('0x29')](function(_0x35004e){if(_0x35004e){_0x392294[_0x33c6('0x39')]=_['keys'](db[_0x33c6('0xb4')][_0x33c6('0x37')]);_0x392294[_0x33c6('0x3a')]=_['keys'](_0x9e6852['query']);_0x392294['filters']=_[_0x33c6('0x3d')](_0x392294[_0x33c6('0x39')],_0x392294[_0x33c6('0x3a')]);_0x47dba3[_0x33c6('0x3e')]=_[_0x33c6('0x3d')](_0x392294['model'],qs['fields'](_0x9e6852['query'][_0x33c6('0x3f')]));_0x47dba3[_0x33c6('0x3e')]=_0x47dba3['attributes'][_0x33c6('0x40')]?_0x47dba3[_0x33c6('0x3e')]:_0x392294['model'];if(!_0x9e6852[_0x33c6('0x3a')][_0x33c6('0x41')](_0x33c6('0x42'))){_0x47dba3[_0x33c6('0x23')]=qs[_0x33c6('0x23')](_0x9e6852['query'][_0x33c6('0x23')]);_0x47dba3['offset']=qs[_0x33c6('0x22')](_0x9e6852[_0x33c6('0x3a')]['offset']);}_0x47dba3[_0x33c6('0x43')]=qs['sort'](_0x9e6852[_0x33c6('0x3a')][_0x33c6('0x44')]);_0x47dba3[_0x33c6('0x73')]=qs[_0x33c6('0x3c')](_[_0x33c6('0x45')](_0x9e6852[_0x33c6('0x3a')],_0x392294[_0x33c6('0x3c')]));_0x47dba3[_0x33c6('0x73')][_0x33c6('0xb8')]=_0x35004e['id'];if(_0x9e6852[_0x33c6('0x3a')][_0x33c6('0x81')]){_0x47dba3['where']=_['merge'](_0x47dba3['where'],{'$or':_[_0x33c6('0x36')](_0x47dba3[_0x33c6('0x3e')],function(_0x30b664){var _0x227a45={};_0x227a45[_0x30b664]={'$like':'%'+_0x9e6852['query'][_0x33c6('0x81')]+'%'};return _0x227a45;})});}if(_0x9e6852[_0x33c6('0x3a')][_0x33c6('0xb9')]){var _0x102fb7=_0x9e6852[_0x33c6('0x3a')][_0x33c6('0xb9')][_0x33c6('0x32')](',');var _0x2491d7={};_0x2491d7[_0x102fb7[0x0]]={'$gte':moment(_0x102fb7[0x1])[_0x33c6('0xba')](_0x33c6('0xbb'))};_0x47dba3['where']=_[_0x33c6('0x96')](_0x47dba3['where'],_0x2491d7);}_0x47dba3=_[_0x33c6('0x96')]({},_0x47dba3,_0x9e6852[_0x33c6('0xaf')]);return db['FaxMessage']['count']({'where':_0x47dba3[_0x33c6('0x73')]})['then'](function(_0x168dff){_0x22fba1['count']=_0x168dff;if(_0x9e6852[_0x33c6('0x3a')][_0x33c6('0xae')]){_0x47dba3[_0x33c6('0xbc')]=[{'all':!![]}];}return db[_0x33c6('0xb4')][_0x33c6('0xbd')](_0x47dba3);})[_0x33c6('0x29')](function(_0x401391){_0x22fba1['rows']=_0x401391;return _0x22fba1;});}})[_0x33c6('0x29')](respondWithFilteredResult(_0x29c4db,_0x47dba3))[_0x33c6('0x35')](handleError(_0x29c4db,null));};exports[_0x33c6('0xbe')]=function(_0x5cfca1,_0x3c2886,_0x40edd2){return db[_0x33c6('0xad')]['find']({'where':{'id':_0x5cfca1[_0x33c6('0xac')]['id']}})[_0x33c6('0x29')](handleEntityNotFound(_0x3c2886,null))['then'](function(_0x563dd5){if(_0x563dd5){return _0x563dd5[_0x33c6('0xbf')](_0x5cfca1['body'][_0x33c6('0xb5')],_[_0x33c6('0xb6')](_0x5cfca1[_0x33c6('0x6f')],[_0x33c6('0xb5'),'id'])||{})[_0x33c6('0xc0')](function(){return db[_0x33c6('0xc1')][_0x33c6('0xbd')]({'attributes':['id',_0x33c6('0x2d'),_0x33c6('0x47')],'where':{'id':_0x5cfca1['body']['ids']}});})[_0x33c6('0x29')](function(_0xc32790){socket[_0x33c6('0xc2')](_0x33c6('0xc3'),{'id':Number(_0x5cfca1[_0x33c6('0xac')]['id']),'tags':_0xc32790||[]});return{'id':Number(_0x5cfca1[_0x33c6('0xac')]['id']),'tags':_0xc32790||[]};});}})['then'](respondWithResult(_0x3c2886,null))[_0x33c6('0x35')](handleError(_0x3c2886,null));};exports['removeTags']=function(_0x1e6717,_0x2113e5,_0x3e94bf){return db[_0x33c6('0xad')][_0x33c6('0x65')]({'where':{'id':_0x1e6717['params']['id']}})['then'](handleEntityNotFound(_0x2113e5,null))['then'](function(_0x345638){if(_0x345638){return _0x345638[_0x33c6('0xc4')](_0x1e6717[_0x33c6('0x3a')][_0x33c6('0xb5')]);}})[_0x33c6('0x29')](respondWithStatusCode(_0x2113e5,null))[_0x33c6('0x35')](handleError(_0x2113e5,null));};exports[_0x33c6('0xc5')]=function(_0x3c42bd,_0x503de5){var _0x9c3ba6=moment()[_0x33c6('0xc6')]()[_0x33c6('0x94')]();var _0xa2a729=path[_0x33c6('0xc7')](config[_0x33c6('0xc8')],_0x33c6('0xc9'),'files','tmp');var _0x270324=path[_0x33c6('0xc7')](config[_0x33c6('0xc8')],_0x33c6('0xc9'),_0x33c6('0xca'),_0x33c6('0xcb'));var _0x1444ab=path[_0x33c6('0xc7')](_0xa2a729,_0x9c3ba6);var _0x4aa209=util[_0x33c6('0xba')](_0x33c6('0xcc'),_0x3c42bd[_0x33c6('0xac')]['id'],_0x9c3ba6);var _0x388c35=path['join'](_0xa2a729,_0x4aa209);var _0x3ff625=[];_0x3ff625[_0x33c6('0x34')]({'model':db[_0x33c6('0xcd')],'as':_0x33c6('0xcd'),'raw':!![]});var _0x3f3c43=[{'model':db[_0x33c6('0xb4')],'as':_0x33c6('0xce'),'attributes':['id',_0x33c6('0x6f'),_0x33c6('0x76')],'include':_0x3ff625}];return db[_0x33c6('0xad')]['find']({'where':{'id':_0x3c42bd['params']['id']},'include':_0x3f3c43})[_0x33c6('0x29')](handleEntityNotFound(_0x503de5,null))[_0x33c6('0x29')](function(_0x3c3223){if(_0x3c3223&&_0x3c3223[_0x33c6('0xce')]){var _0x62e902=_0x3c3223[_0x33c6('0xcf')]({'plain':!![]});fs[_0x33c6('0xd0')](_0x1444ab);for(var _0x50218c=0x0;_0x50218c<_0x62e902[_0x33c6('0xce')]['length'];_0x50218c++){var _0x5af7a4=_0x62e902['Messages'][_0x50218c][_0x33c6('0xcd')];if(_0x5af7a4){var _0x38f02f=path['join'](_0x270324,_0x5af7a4['basename']);if(fs[_0x33c6('0xd1')](_0x38f02f)){fs[_0x33c6('0xd2')](_0x38f02f)[_0x33c6('0xd3')](fs[_0x33c6('0xd4')](path[_0x33c6('0xc7')](_0x1444ab,_0x5af7a4[_0x33c6('0xd5')])));}}}return BPromise[_0x33c6('0x8c')]()['then'](function(){return new BPromise(function(_0xb5d855,_0x23b5e3){zipdir(_0x1444ab,{'saveTo':_0x388c35},function(_0x5ebdf7,_0x337000){if(_0x5ebdf7)return _0x23b5e3(_0x5ebdf7);return _0xb5d855(_0x337000);});})[_0x33c6('0x29')](function(){return new BPromise(function(_0x3bc35f,_0x3559c1){rimraf(_0x1444ab,function(_0x53a4fa){if(_0x53a4fa)_0x3559c1(_0x53a4fa);return _0x3bc35f();});});})['then'](function(){return _0x503de5[_0x33c6('0xc5')](_0x388c35,_0x4aa209,function(_0x404d61){if(_0x404d61){console[_0x33c6('0xd6')](_0x33c6('0xd7'),_0x404d61);}else{fs[_0x33c6('0xd8')](_0x388c35);}});});});}else{return _0x503de5['sendStatus'](0xc8);}})['catch'](handleError(_0x503de5,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4fa1e77..483e21e 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 _0x63c4=['getUsers','setDataValue','Users','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x17c39f,_0x381e61){var _0x2a9150=function(_0x5eac12){while(--_0x5eac12){_0x17c39f['push'](_0x17c39f['shift']());}};_0x2a9150(++_0x381e61);}(_0x63c4,0x125));var _0x463c=function(_0x18df59,_0x385378){_0x18df59=_0x18df59-0x0;var _0x2e2b36=_0x63c4[_0x18df59];return _0x2e2b36;};'use strict';var EventEmitter=require(_0x463c('0x0'));var FaxInteraction=require(_0x463c('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x463c('0x1'))['db'][_0x463c('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x463c('0x3')](0x0);var events={'afterCreate':_0x463c('0x4'),'afterUpdate':_0x463c('0x5'),'afterDestroy':_0x463c('0x6')};function emitEvent(_0x81878a){return function(_0x1bbce6,_0x21e72c,_0x4eb79c){_0x1bbce6[_0x463c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1cbae8){_0x1bbce6[_0x463c('0x8')](_0x463c('0x9'),_0x1cbae8['map'](function(_0x2db82b){return{'id':_0x2db82b['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x1bbce6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x162e0e){_0x1bbce6[_0x463c('0x8')](_0x463c('0xa'),_0x162e0e[_0x463c('0xb')]);FaxInteractionEvents['emit'](_0x81878a+':'+_0x1bbce6['id'],_0x1bbce6);FaxInteractionEvents['emit'](_0x81878a,_0x1bbce6);_0x4eb79c(null);})['catch'](_0x4eb79c(null));};}for(var e in events){if(events[_0x463c('0xc')](e)){var event=events[e];FaxInteraction[_0x463c('0xd')](e,emitEvent(event));}}module[_0x463c('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x98ec=['setMaxListeners','update','getUsers','then','setDataValue','Users','map','unreadMessages','emit','hasOwnProperty','../../mysqldb','FaxInteraction','FaxMessage'];(function(_0x553145,_0x4f9ab8){var _0x11cfbd=function(_0x2e7702){while(--_0x2e7702){_0x553145['push'](_0x553145['shift']());}};_0x11cfbd(++_0x4f9ab8);}(_0x98ec,0xb3));var _0xc98e=function(_0x54ec48,_0x3ec05c){_0x54ec48=_0x54ec48-0x0;var _0xd44810=_0x98ec[_0x54ec48];return _0xd44810;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xc98e('0x0'))['db'][_0xc98e('0x1')];var FaxMessage=require(_0xc98e('0x0'))['db'][_0xc98e('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc98e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc98e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x277efb){return function(_0x586ede,_0xfea303,_0x29c864){_0x586ede[_0xc98e('0x5')]({'attributes':['id'],'raw':!![]})[_0xc98e('0x6')](function(_0x526297){_0x586ede[_0xc98e('0x7')](_0xc98e('0x8'),_0x526297[_0xc98e('0x9')](function(_0x3fbd70){return{'id':_0x3fbd70['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x586ede['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc98e('0x6')](function(_0x32f1b9){_0x586ede[_0xc98e('0x7')](_0xc98e('0xa'),_0x32f1b9['length']);FaxInteractionEvents[_0xc98e('0xb')](_0x277efb+':'+_0x586ede['id'],_0x586ede);FaxInteractionEvents[_0xc98e('0xb')](_0x277efb,_0x586ede);_0x29c864(null);})['catch'](_0x29c864(null));};}for(var e in events){if(events[_0xc98e('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 63468e2..a50fc95 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 _0x651e=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3f4bef,_0x359a87){var _0x1989b7=function(_0xe0ffca){while(--_0xe0ffca){_0x3f4bef['push'](_0x3f4bef['shift']());}};_0x1989b7(++_0x359a87);}(_0x651e,0x15d));var _0xe651=function(_0x373e67,_0x33f1c3){_0x373e67=_0x373e67-0x0;var _0x5efcc3=_0x651e[_0x373e67];return _0x5efcc3;};'use strict';var _=require(_0xe651('0x0'));var util=require(_0xe651('0x1'));var logger=require(_0xe651('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe651('0x3'));var rp=require(_0xe651('0x4'));var fs=require('fs');var path=require(_0xe651('0x5'));var rimraf=require('rimraf');var config=require(_0xe651('0x6'));var attributes=require(_0xe651('0x7'));module[_0xe651('0x8')]=function(_0x1dee10,_0x120d15){return _0x1dee10[_0xe651('0x9')]('FaxInteraction',attributes,{'tableName':_0xe651('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25a21b,_0x551729,_0x179d14){if(_0x25a21b[_0xe651('0xb')](_0xe651('0xc'))){_0x25a21b['closedAt']=moment()['format'](_0xe651('0xd'));}_0x179d14(null,_0x25a21b);}}});}; \ No newline at end of file +var _0xb2e6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2e6,0x1da));var _0x6b2e=function(_0x2d99cc,_0x3dc5fb){_0x2d99cc=_0x2d99cc-0x0;var _0x5ad8f0=_0xb2e6[_0x2d99cc];return _0x5ad8f0;};'use strict';var _=require(_0x6b2e('0x0'));var util=require(_0x6b2e('0x1'));var logger=require('../../config/logger')(_0x6b2e('0x2'));var moment=require(_0x6b2e('0x3'));var BPromise=require(_0x6b2e('0x4'));var rp=require(_0x6b2e('0x5'));var fs=require('fs');var path=require(_0x6b2e('0x6'));var rimraf=require(_0x6b2e('0x7'));var config=require(_0x6b2e('0x8'));var attributes=require(_0x6b2e('0x9'));module[_0x6b2e('0xa')]=function(_0x28b0c5,_0x2dda6b){return _0x28b0c5[_0x6b2e('0xb')](_0x6b2e('0xc'),attributes,{'tableName':_0x6b2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1045bc,_0x4b535f,_0x484e96){if(_0x1045bc[_0x6b2e('0xe')](_0x6b2e('0xf'))){_0x1045bc[_0x6b2e('0x10')]=moment()[_0x6b2e('0x11')](_0x6b2e('0x12'));}_0x484e96(null,_0x1045bc);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index cdb253a..4a60b69 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 _0xb07e=['catch','AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','then','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxInteraction,\x20%s,\x20%s','message','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','stringify'];(function(_0x390cef,_0x5bef86){var _0x567e44=function(_0x58c026){while(--_0x58c026){_0x390cef['push'](_0x390cef['shift']());}};_0x567e44(++_0x5bef86);}(_0xb07e,0x1a1));var _0xeb07=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb07e[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xeb07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeb07('0x1'));var fs=require('fs');var Redis=require(_0xeb07('0x2'));var db=require(_0xeb07('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb07('0x4'))(_0xeb07('0x5'));var config=require(_0xeb07('0x6'));var jayson=require(_0xeb07('0x7'));var client=jayson[_0xeb07('0x8')][_0xeb07('0x9')]({'port':0x232a});config[_0xeb07('0xa')]=_[_0xeb07('0xb')](config[_0xeb07('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb07('0xc'))(new Redis(config['redis']));require(_0xeb07('0xd'))[_0xeb07('0xe')](socket);function respondWithRpcPromise(_0x585a4c,_0x1b210d,_0x56c7f7){return new BPromise(function(_0xd25103,_0x52a124){return client['request'](_0x585a4c,_0x56c7f7)[_0xeb07('0xf')](function(_0x2523da){logger[_0xeb07('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x1b210d,'request\x20sent');logger[_0xeb07('0x11')](_0xeb07('0x12'),_0x1b210d,_0xeb07('0x13'),JSON['stringify'](_0x2523da));if(_0x2523da[_0xeb07('0x14')]){if(_0x2523da[_0xeb07('0x14')][_0xeb07('0x15')]===0x1f4){logger[_0xeb07('0x14')](_0xeb07('0x16'),_0x1b210d,_0x2523da[_0xeb07('0x14')][_0xeb07('0x17')]);return _0x52a124(_0x2523da[_0xeb07('0x14')][_0xeb07('0x17')]);}logger[_0xeb07('0x14')](_0xeb07('0x16'),_0x1b210d,_0x2523da['error'][_0xeb07('0x17')]);return _0xd25103(_0x2523da['error'][_0xeb07('0x17')]);}else{logger[_0xeb07('0x10')](_0xeb07('0x16'),_0x1b210d,'request\x20sent');_0xd25103(_0x2523da['result'][_0xeb07('0x17')]);}})['catch'](function(_0x1dff39){logger[_0xeb07('0x14')](_0xeb07('0x16'),_0x1b210d,_0x1dff39);_0x52a124(_0x1dff39);});});}exports['UpdateFaxInteraction']=function(_0x5d2c14){var _0x3cf33e=this;return new Promise(function(_0x5ec9d0,_0x3d7756){return db[_0xeb07('0x18')][_0xeb07('0x19')](_0x5d2c14[_0xeb07('0x1a')],{'raw':_0x5d2c14[_0xeb07('0x1b')]?_0x5d2c14[_0xeb07('0x1b')][_0xeb07('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d2c14[_0xeb07('0x1b')]?_0x5d2c14[_0xeb07('0x1b')][_0xeb07('0x1d')]||null:null,'attributes':_0x5d2c14['options']?_0x5d2c14[_0xeb07('0x1b')][_0xeb07('0x1e')]||null:null,'limit':_0x5d2c14[_0xeb07('0x1b')]?_0x5d2c14[_0xeb07('0x1b')][_0xeb07('0x1f')]||null:null})[_0xeb07('0xf')](function(_0x3f5e3a){logger[_0xeb07('0x10')](_0xeb07('0x20'),_0x5d2c14);logger[_0xeb07('0x11')](_0xeb07('0x20'),_0x5d2c14,JSON[_0xeb07('0x21')](_0x3f5e3a));_0x5ec9d0(_0x3f5e3a);})[_0xeb07('0x22')](function(_0x2a44f0){logger[_0xeb07('0x14')](_0xeb07('0x20'),_0x2a44f0['message'],_0x5d2c14);_0x3d7756(_0x3cf33e[_0xeb07('0x14')](0x1f4,_0x2a44f0[_0xeb07('0x17')]));});});};exports[_0xeb07('0x23')]=function(_0x24ccd2){return new Promise(function(_0x45ffb1,_0x42cddb){return db[_0xeb07('0x18')]['find']({'where':_0x24ccd2[_0xeb07('0x1b')]?_0x24ccd2[_0xeb07('0x1b')][_0xeb07('0x1d')]||null:null})[_0xeb07('0xf')](function(_0x3e4565){if(_0x3e4565){return _0x3e4565[_0xeb07('0x24')](_0x24ccd2['body'][_0xeb07('0x25')],_[_0xeb07('0x26')](_0x24ccd2[_0xeb07('0x1a')],['ids','id'])||{});}})[_0xeb07('0x27')](function(_0x2cf1e4){logger[_0xeb07('0x10')](_0xeb07('0x28'),_0x24ccd2);logger[_0xeb07('0x11')](_0xeb07('0x28'),_0x24ccd2,JSON[_0xeb07('0x21')](_0x2cf1e4));_0x45ffb1(_0x2cf1e4);})[_0xeb07('0x22')](function(_0x2b482c){logger[_0xeb07('0x14')](_0xeb07('0x28'),_0x2b482c['message'],_0x24ccd2);_0x42cddb(_this[_0xeb07('0x14')](0x1f4,_0x2b482c[_0xeb07('0x17')]));});});}; \ No newline at end of file +var _0x4509=['rpc','jayson/promise','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','AddTagsToFaxInteraction','find','where','addTags','ids','AddTags','lodash','util','bluebird','randomstring','../../config/logger'];(function(_0x24edc5,_0x1c2cf5){var _0x8fd8e0=function(_0x55cfa5){while(--_0x55cfa5){_0x24edc5['push'](_0x24edc5['shift']());}};_0x8fd8e0(++_0x1c2cf5);}(_0x4509,0x123));var _0x9450=function(_0x1aa52d,_0x4bf359){_0x1aa52d=_0x1aa52d-0x0;var _0x4bd5a9=_0x4509[_0x1aa52d];return _0x4bd5a9;};'use strict';var _=require(_0x9450('0x0'));var util=require(_0x9450('0x1'));var moment=require('moment');var BPromise=require(_0x9450('0x2'));var rs=require(_0x9450('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9450('0x4'))(_0x9450('0x5'));var config=require('../../config/environment');var jayson=require(_0x9450('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x9450('0x7')]=_[_0x9450('0x8')](config[_0x9450('0x7')],{'host':_0x9450('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9450('0xa'))[_0x9450('0xb')](socket);function respondWithRpcPromise(_0x32afec,_0x3b0a19,_0xa068cb){return new BPromise(function(_0x13cf20,_0x4ad829){return client[_0x9450('0xc')](_0x32afec,_0xa068cb)[_0x9450('0xd')](function(_0xa5a6fe){logger[_0x9450('0xe')](_0x9450('0xf'),_0x3b0a19,_0x9450('0x10'));logger[_0x9450('0x11')](_0x9450('0x12'),_0x3b0a19,_0x9450('0x10'),JSON[_0x9450('0x13')](_0xa5a6fe));if(_0xa5a6fe[_0x9450('0x14')]){if(_0xa5a6fe[_0x9450('0x14')][_0x9450('0x15')]===0x1f4){logger[_0x9450('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x3b0a19,_0xa5a6fe[_0x9450('0x14')]['message']);return _0x4ad829(_0xa5a6fe[_0x9450('0x14')][_0x9450('0x16')]);}logger['error'](_0x9450('0xf'),_0x3b0a19,_0xa5a6fe[_0x9450('0x14')][_0x9450('0x16')]);return _0x13cf20(_0xa5a6fe[_0x9450('0x14')][_0x9450('0x16')]);}else{logger['info'](_0x9450('0xf'),_0x3b0a19,_0x9450('0x10'));_0x13cf20(_0xa5a6fe['result'][_0x9450('0x16')]);}})[_0x9450('0x17')](function(_0x22a109){logger['error'](_0x9450('0xf'),_0x3b0a19,_0x22a109);_0x4ad829(_0x22a109);});});}exports[_0x9450('0x18')]=function(_0x2ee91a){var _0x536ab7=this;return new Promise(function(_0x1dc109,_0x552b50){return db[_0x9450('0x19')][_0x9450('0x1a')](_0x2ee91a[_0x9450('0x1b')],{'raw':_0x2ee91a[_0x9450('0x1c')]?_0x2ee91a[_0x9450('0x1c')][_0x9450('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ee91a['options']?_0x2ee91a['options']['where']||null:null,'attributes':_0x2ee91a[_0x9450('0x1c')]?_0x2ee91a[_0x9450('0x1c')][_0x9450('0x1e')]||null:null,'limit':_0x2ee91a[_0x9450('0x1c')]?_0x2ee91a[_0x9450('0x1c')]['limit']||null:null})['then'](function(_0x5a52c4){logger[_0x9450('0xe')](_0x9450('0x18'),_0x2ee91a);logger['debug'](_0x9450('0x18'),_0x2ee91a,JSON[_0x9450('0x13')](_0x5a52c4));_0x1dc109(_0x5a52c4);})[_0x9450('0x17')](function(_0x3c35d8){logger[_0x9450('0x14')](_0x9450('0x18'),_0x3c35d8[_0x9450('0x16')],_0x2ee91a);_0x552b50(_0x536ab7[_0x9450('0x14')](0x1f4,_0x3c35d8['message']));});});};exports[_0x9450('0x1f')]=function(_0x5dde8c){return new Promise(function(_0x1b9dbe,_0x27fc35){return db[_0x9450('0x19')][_0x9450('0x20')]({'where':_0x5dde8c[_0x9450('0x1c')]?_0x5dde8c[_0x9450('0x1c')][_0x9450('0x21')]||null:null})[_0x9450('0xd')](function(_0x401312){if(_0x401312){return _0x401312[_0x9450('0x22')](_0x5dde8c[_0x9450('0x1b')][_0x9450('0x23')],_['omit'](_0x5dde8c[_0x9450('0x1b')],[_0x9450('0x23'),'id'])||{});}})['spread'](function(_0x1578b8){logger[_0x9450('0xe')](_0x9450('0x24'),_0x5dde8c);logger[_0x9450('0x11')](_0x9450('0x24'),_0x5dde8c,JSON[_0x9450('0x13')](_0x1578b8));_0x1b9dbe(_0x1578b8);})[_0x9450('0x17')](function(_0x1114e9){logger[_0x9450('0x14')](_0x9450('0x24'),_0x1114e9[_0x9450('0x16')],_0x5dde8c);_0x27fc35(_this[_0x9450('0x14')](0x1f4,_0x1114e9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 75d9409..986d5b1 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 _0x442d=['register','length','faxInteraction:','./faxInteraction.events','save','update','emit','removeListener'];(function(_0x2255b7,_0x5b631f){var _0x54aad7=function(_0x3ac6fe){while(--_0x3ac6fe){_0x2255b7['push'](_0x2255b7['shift']());}};_0x54aad7(++_0x5b631f);}(_0x442d,0x7b));var _0xd442=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0x442d[_0x91d019];return _0x19de1f;};'use strict';var FaxInteractionEvents=require(_0xd442('0x0'));var events=[_0xd442('0x1'),'remove',_0xd442('0x2')];function createListener(_0x53268c,_0x3237c3){return function(_0x19b83e){_0x3237c3[_0xd442('0x3')](_0x53268c,_0x19b83e);};}function removeListener(_0x4a0b5a,_0x3e1a98){return function(){FaxInteractionEvents[_0xd442('0x4')](_0x4a0b5a,_0x3e1a98);};}exports[_0xd442('0x5')]=function(_0x28d43a){for(var _0x40dc88=0x0,_0x2ab0e5=events[_0xd442('0x6')];_0x40dc88<_0x2ab0e5;_0x40dc88++){var _0x3283f9=events[_0x40dc88];var _0x17857d=createListener(_0xd442('0x7')+_0x3283f9,_0x28d43a);FaxInteractionEvents['on'](_0x3283f9,_0x17857d);}}; \ No newline at end of file +var _0x1e7f=['save','remove','update','emit','removeListener','register','length','./faxInteraction.events'];(function(_0x377d77,_0xd5127c){var _0x23e816=function(_0x41d206){while(--_0x41d206){_0x377d77['push'](_0x377d77['shift']());}};_0x23e816(++_0xd5127c);}(_0x1e7f,0x10f));var _0xf1e7=function(_0x3f0f38,_0x309272){_0x3f0f38=_0x3f0f38-0x0;var _0x408688=_0x1e7f[_0x3f0f38];return _0x408688;};'use strict';var FaxInteractionEvents=require(_0xf1e7('0x0'));var events=[_0xf1e7('0x1'),_0xf1e7('0x2'),_0xf1e7('0x3')];function createListener(_0x780f29,_0x1d2f9c){return function(_0x2b4f35){_0x1d2f9c[_0xf1e7('0x4')](_0x780f29,_0x2b4f35);};}function removeListener(_0x4d4b6d,_0x29b9be){return function(){FaxInteractionEvents[_0xf1e7('0x5')](_0x4d4b6d,_0x29b9be);};}exports[_0xf1e7('0x6')]=function(_0x47b171){for(var _0x541752=0x0,_0x57ee96=events[_0xf1e7('0x7')];_0x541752<_0x57ee96;_0x541752++){var _0x106e9c=events[_0x541752];var _0x9e28ab=createListener('faxInteraction:'+_0x106e9c,_0x47b171);FaxInteractionEvents['on'](_0x106e9c,_0x9e28ab);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 7255b55..2efa392 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 _0x876c=['create','post','addMessage','fax','faxinteraction:addtags','addTags','/:id','tracked','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','/:id/tags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','show','getMessages','/:id/download','download'];(function(_0x2e16d8,_0x1110ff){var _0xbb0a07=function(_0x447b90){while(--_0x447b90){_0x2e16d8['push'](_0x2e16d8['shift']());}};_0xbb0a07(++_0x1110ff);}(_0x876c,0x12f));var _0xc876=function(_0x1b3312,_0xd912af){_0x1b3312=_0x1b3312-0x0;var _0x546d38=_0x876c[_0x1b3312];return _0x546d38;};'use strict';var multer=require(_0xc876('0x0'));var util=require(_0xc876('0x1'));var path=require(_0xc876('0x2'));var timeout=require(_0xc876('0x3'));var express=require(_0xc876('0x4'));var router=express['Router']();var fs_extra=require(_0xc876('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc876('0x6'));var config=require(_0xc876('0x7'));var controller=require(_0xc876('0x8'));router[_0xc876('0x9')]('/',auth[_0xc876('0xa')](),controller[_0xc876('0xb')]);router[_0xc876('0x9')](_0xc876('0xc'),auth[_0xc876('0xa')](),controller['describe']);router['get']('/:id',auth[_0xc876('0xa')](),controller[_0xc876('0xd')]);router['get']('/:id/messages',auth[_0xc876('0xa')](),controller[_0xc876('0xe')]);router['get'](_0xc876('0xf'),auth[_0xc876('0xa')](),controller[_0xc876('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc876('0x11')]);router[_0xc876('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0xc876('0x13')]);router[_0xc876('0x12')]('/:id/tags',auth[_0xc876('0xa')](),interaction['tracked'](_0xc876('0x14'),_0xc876('0x15')),controller[_0xc876('0x16')]);router['put'](_0xc876('0x17'),auth[_0xc876('0xa')](),interaction[_0xc876('0x18')](_0xc876('0x14'),_0xc876('0x19')),controller[_0xc876('0x1a')]);router['delete'](_0xc876('0x17'),auth[_0xc876('0xa')](),interaction[_0xc876('0x18')]('fax',_0xc876('0x1b')),controller[_0xc876('0x1c')]);router[_0xc876('0x1d')](_0xc876('0x1e'),auth[_0xc876('0xa')](),controller['removeTags']);module[_0xc876('0x1f')]=router; \ No newline at end of file +var _0xa639=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy'];(function(_0x4f2338,_0x21403f){var _0x3b1e03=function(_0x32eb2b){while(--_0x32eb2b){_0x4f2338['push'](_0x4f2338['shift']());}};_0x3b1e03(++_0x21403f);}(_0xa639,0x140));var _0x9a63=function(_0x4663df,_0x360426){_0x4663df=_0x4663df-0x0;var _0x5918bc=_0xa639[_0x4663df];return _0x5918bc;};'use strict';var multer=require('multer');var util=require(_0x9a63('0x0'));var path=require(_0x9a63('0x1'));var timeout=require(_0x9a63('0x2'));var express=require(_0x9a63('0x3'));var router=express[_0x9a63('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9a63('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a63('0x6'));var controller=require('./faxInteraction.controller');router[_0x9a63('0x7')]('/',auth[_0x9a63('0x8')](),controller['index']);router[_0x9a63('0x7')](_0x9a63('0x9'),auth['isAuthenticated'](),controller[_0x9a63('0xa')]);router['get'](_0x9a63('0xb'),auth[_0x9a63('0x8')](),controller[_0x9a63('0xc')]);router[_0x9a63('0x7')](_0x9a63('0xd'),auth[_0x9a63('0x8')](),controller[_0x9a63('0xe')]);router[_0x9a63('0x7')]('/:id/download',auth[_0x9a63('0x8')](),controller['download']);router[_0x9a63('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9a63('0xf')](_0x9a63('0xd'),auth[_0x9a63('0x8')](),controller[_0x9a63('0x10')]);router['post'](_0x9a63('0x11'),auth[_0x9a63('0x8')](),interaction['tracked'](_0x9a63('0x12'),_0x9a63('0x13')),controller[_0x9a63('0x14')]);router[_0x9a63('0x15')](_0x9a63('0xb'),auth[_0x9a63('0x8')](),interaction[_0x9a63('0x16')](_0x9a63('0x12'),_0x9a63('0x17')),controller[_0x9a63('0x18')]);router[_0x9a63('0x19')](_0x9a63('0xb'),auth['isAuthenticated'](),interaction[_0x9a63('0x16')](_0x9a63('0x12'),_0x9a63('0x1a')),controller[_0x9a63('0x1b')]);router[_0x9a63('0x19')](_0x9a63('0x11'),auth[_0x9a63('0x8')](),controller['removeTags']);module[_0x9a63('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index ddbe635..444f52c 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 _0x0ef0=['out','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x147b11,_0x44e9b6){var _0x44bb7a=function(_0x2d5210){while(--_0x2d5210){_0x147b11['push'](_0x147b11['shift']());}};_0x44bb7a(++_0x44e9b6);}(_0x0ef0,0x80));var _0x00ef=function(_0x4b634f,_0x4c0372){_0x4b634f=_0x4b634f-0x0;var _0x302e3c=_0x0ef0[_0x4b634f];return _0x302e3c;};'use strict';var Sequelize=require(_0x00ef('0x0'));module[_0x00ef('0x1')]={'body':{'type':Sequelize['TEXT'](_0x00ef('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x00ef('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x00ef('0x4')]('in',_0x00ef('0x5')),'defaultValue':_0x00ef('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x00ef('0x6')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x644a=['out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x12a62c,_0xc9c41a){var _0x268a58=function(_0x100ca9){while(--_0x100ca9){_0x12a62c['push'](_0x12a62c['shift']());}};_0x268a58(++_0xc9c41a);}(_0x644a,0xfd));var _0xa644=function(_0x192b1e,_0x578930){_0x192b1e=_0x192b1e-0x0;var _0x5db684=_0x644a[_0x192b1e];return _0x5db684;};'use strict';var Sequelize=require(_0xa644('0x0'));module[_0xa644('0x1')]={'body':{'type':Sequelize[_0xa644('0x2')](_0xa644('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa644('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa644('0x5')),'defaultValue':_0xa644('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'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 537c11d..3588b51 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 _0x38b2=['type','VIRTUAL','filter','FaxMessage','includeAll','findAll','rows','catch','show','intersection','length','include','options','find','body','params','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','internal','manual','interface','SIP/%s','motionChannel','channel','EventManager','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','fullname','event','rejectmessage','create','CmContact','findOne','Attachment','SendFax','basename','AttachmentId','download','join','root','server','files','attachments','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','send','map','rawAttributes','fieldName','name','keys','filters','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x3b2acb,_0x66c39b){var _0x359963=function(_0x4c78f2){while(--_0x4c78f2){_0x3b2acb['push'](_0x3b2acb['shift']());}};_0x359963(++_0x66c39b);}(_0x38b2,0x166));var _0x238b=function(_0x1e3dd9,_0x24ddaa){_0x1e3dd9=_0x1e3dd9-0x0;var _0x15918a=_0x38b2[_0x1e3dd9];return _0x15918a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x238b('0x0'));var jsonpatch=require(_0x238b('0x1'));var rp=require(_0x238b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x238b('0x3'));var sox=require(_0x238b('0x4'));var csv=require(_0x238b('0x5'));var ejs=require(_0x238b('0x6'));var fs=require('fs');var fs_extra=require(_0x238b('0x7'));var _=require(_0x238b('0x8'));var squel=require(_0x238b('0x9'));var crypto=require(_0x238b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x238b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x238b('0xc'));var Papa=require(_0x238b('0xd'));var Redis=require(_0x238b('0xe'));var authService=require(_0x238b('0xf'));var qs=require(_0x238b('0x10'));var as=require(_0x238b('0x11'));var hardwareService=require(_0x238b('0x12'));var logger=require(_0x238b('0x13'))(_0x238b('0x14'));var utils=require(_0x238b('0x15'));var config=require(_0x238b('0x16'));var licenseUtil=require(_0x238b('0x17'));var db=require(_0x238b('0x18'))['db'];config[_0x238b('0x19')]=_['defaults'](config['redis'],{'host':_0x238b('0x1a'),'port':0x18eb});var socket=require(_0x238b('0x1b'))(new Redis(config[_0x238b('0x19')]));require(_0x238b('0x1c'))[_0x238b('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x238b('0x1e')][_0x238b('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x238b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3644fc,_0x591a0a,_0x13f68f,_0x23be88){return new BPromise(function(_0x3b6c96,_0x2282ab){var _0x35b0cf=_0x23be88||client;return _0x35b0cf[_0x238b('0x20')](_0x3644fc,_0x13f68f)['then'](function(_0x18816d){logger['info'](_0x238b('0x21'),_0x591a0a,_0x238b('0x22'));logger[_0x238b('0x23')](_0x238b('0x24'),_0x591a0a,'request\x20sent',JSON[_0x238b('0x25')](_0x18816d));if(_0x18816d[_0x238b('0x26')]){if(_0x18816d[_0x238b('0x26')]['code']===0x1f4){logger[_0x238b('0x26')](_0x238b('0x21'),_0x591a0a,_0x18816d[_0x238b('0x26')]['message']);return _0x2282ab(_0x18816d[_0x238b('0x26')][_0x238b('0x27')]);}logger[_0x238b('0x26')]('FaxMessage,\x20%s,\x20%s',_0x591a0a,_0x18816d[_0x238b('0x26')][_0x238b('0x27')]);return _0x3b6c96(_0x18816d[_0x238b('0x26')][_0x238b('0x27')]);}else{logger[_0x238b('0x28')](_0x238b('0x21'),_0x591a0a,_0x238b('0x22'));_0x3b6c96(_0x18816d[_0x238b('0x29')]['message']);}})['catch'](function(_0xa6758a){logger['error'](_0x238b('0x21'),_0x591a0a,_0xa6758a);_0x2282ab(_0xa6758a);});});}function respondWithStatusCode(_0x41c5ed,_0x60cc2){_0x60cc2=_0x60cc2||0xcc;return function(_0x1dabae){if(_0x1dabae){return _0x41c5ed[_0x238b('0x2a')](_0x60cc2);}return _0x41c5ed[_0x238b('0x2b')](_0x60cc2)['end']();};}function respondWithResult(_0xc9ab4b,_0x18e13f){_0x18e13f=_0x18e13f||0xc8;return function(_0x17466d){if(_0x17466d){return _0xc9ab4b['status'](_0x18e13f)[_0x238b('0x2c')](_0x17466d);}};}function respondWithFilteredResult(_0x3a2b3a,_0x512d2e){return function(_0x3011e9){if(_0x3011e9){var _0x8036cd=typeof _0x512d2e[_0x238b('0x2d')]===_0x238b('0x2e')&&typeof _0x512d2e[_0x238b('0x2f')]==='undefined';var _0xcf9037=_0x3011e9[_0x238b('0x30')];var _0x4aa5e4=_0x8036cd?0x0:_0x512d2e['offset'];var _0x527d52=_0x8036cd?_0x3011e9['count']:_0x512d2e['offset']+_0x512d2e[_0x238b('0x2f')];var _0x4c831c;if(_0x527d52>=_0xcf9037){_0x527d52=_0xcf9037;_0x4c831c=0xc8;}else{_0x4c831c=0xce;}_0x3a2b3a[_0x238b('0x2b')](_0x4c831c);return _0x3a2b3a['set'](_0x238b('0x31'),_0x4aa5e4+'-'+_0x527d52+'/'+_0xcf9037)[_0x238b('0x2c')](_0x3011e9);}return null;};}function patchUpdates(_0x4c94c9){return function(_0x1f0fae){try{jsonpatch[_0x238b('0x32')](_0x1f0fae,_0x4c94c9,!![]);}catch(_0x4a2f19){return BPromise[_0x238b('0x33')](_0x4a2f19);}return _0x1f0fae[_0x238b('0x34')]();};}function saveUpdates(_0x70848c,_0x5e592d){return function(_0x5142c4){if(_0x5142c4){return _0x5142c4[_0x238b('0x35')](_0x70848c)[_0x238b('0x36')](function(_0x10ff07){return _0x10ff07;});}return null;};}function removeEntity(_0xe9ff43,_0x19542e){return function(_0x32c809){if(_0x32c809){return _0x32c809[_0x238b('0x37')]()[_0x238b('0x36')](function(){_0xe9ff43[_0x238b('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b6a29,_0x2b1b55){return function(_0x2768ad){if(!_0x2768ad){_0x9b6a29[_0x238b('0x2a')](0x194);}return _0x2768ad;};}function handleError(_0x18e0cb,_0x2ad081){_0x2ad081=_0x2ad081||0x1f4;return function(_0x449739){logger[_0x238b('0x26')](_0x449739['stack']);if(_0x449739['name']){delete _0x449739['name'];}_0x18e0cb['status'](_0x2ad081)[_0x238b('0x38')](_0x449739);};}exports['index']=function(_0x223c3f,_0x1dd9f9){var _0x5bb1c6={},_0x570660={},_0x26902f={'count':0x0,'rows':[]};var _0x4b120a=_[_0x238b('0x39')](db['FaxMessage'][_0x238b('0x3a')],function(_0x3ae003){return{'name':_0x3ae003[_0x238b('0x3b')],'type':_0x3ae003['type']['key']};});_0x570660['model']=_[_0x238b('0x39')](_0x4b120a,_0x238b('0x3c'));_0x570660['query']=_[_0x238b('0x3d')](_0x223c3f['query']);_0x570660[_0x238b('0x3e')]=_['intersection'](_0x570660[_0x238b('0x3f')],_0x570660[_0x238b('0x40')]);_0x5bb1c6[_0x238b('0x41')]=_['intersection'](_0x570660['model'],qs[_0x238b('0x42')](_0x223c3f[_0x238b('0x40')][_0x238b('0x42')]));_0x5bb1c6['attributes']=_0x5bb1c6[_0x238b('0x41')]['length']?_0x5bb1c6[_0x238b('0x41')]:_0x570660[_0x238b('0x3f')];if(!_0x223c3f[_0x238b('0x40')][_0x238b('0x43')](_0x238b('0x44'))){_0x5bb1c6[_0x238b('0x2f')]=qs[_0x238b('0x2f')](_0x223c3f[_0x238b('0x40')]['limit']);_0x5bb1c6[_0x238b('0x2d')]=qs[_0x238b('0x2d')](_0x223c3f[_0x238b('0x40')][_0x238b('0x2d')]);}_0x5bb1c6[_0x238b('0x45')]=qs[_0x238b('0x46')](_0x223c3f[_0x238b('0x40')][_0x238b('0x46')]);_0x5bb1c6[_0x238b('0x47')]=qs[_0x238b('0x3e')](_[_0x238b('0x48')](_0x223c3f['query'],_0x570660[_0x238b('0x3e')]),_0x4b120a);if(_0x223c3f[_0x238b('0x40')]['filter']){_0x5bb1c6[_0x238b('0x47')]=_[_0x238b('0x49')](_0x5bb1c6[_0x238b('0x47')],{'$or':_['map'](_0x4b120a,function(_0x51e9a6){if(_0x51e9a6[_0x238b('0x4a')]!==_0x238b('0x4b')){var _0x330db5={};_0x330db5[_0x51e9a6[_0x238b('0x3c')]]={'$like':'%'+_0x223c3f[_0x238b('0x40')][_0x238b('0x4c')]+'%'};return _0x330db5;}})});}_0x5bb1c6=_[_0x238b('0x49')]({},_0x5bb1c6,_0x223c3f['options']);var _0x5cdd10={'where':_0x5bb1c6[_0x238b('0x47')]};return db[_0x238b('0x4d')][_0x238b('0x30')](_0x5cdd10)[_0x238b('0x36')](function(_0x48d390){_0x26902f[_0x238b('0x30')]=_0x48d390;if(_0x223c3f[_0x238b('0x40')][_0x238b('0x4e')]){_0x5bb1c6['include']=[{'all':!![]}];}return db[_0x238b('0x4d')][_0x238b('0x4f')](_0x5bb1c6);})['then'](function(_0x3be7ee){_0x26902f[_0x238b('0x50')]=_0x3be7ee;return _0x26902f;})[_0x238b('0x36')](respondWithFilteredResult(_0x1dd9f9,_0x5bb1c6))[_0x238b('0x51')](handleError(_0x1dd9f9,null));};exports[_0x238b('0x52')]=function(_0xe4cae0,_0x2303b8){var _0x413923={'raw':!![],'where':{'id':_0xe4cae0['params']['id']}},_0x231956={};_0x231956[_0x238b('0x3f')]=_[_0x238b('0x3d')](db[_0x238b('0x4d')][_0x238b('0x3a')]);_0x231956['query']=_[_0x238b('0x3d')](_0xe4cae0['query']);_0x231956['filters']=_[_0x238b('0x53')](_0x231956['model'],_0x231956[_0x238b('0x40')]);_0x413923['attributes']=_['intersection'](_0x231956[_0x238b('0x3f')],qs['fields'](_0xe4cae0[_0x238b('0x40')][_0x238b('0x42')]));_0x413923[_0x238b('0x41')]=_0x413923['attributes'][_0x238b('0x54')]?_0x413923['attributes']:_0x231956[_0x238b('0x3f')];if(_0xe4cae0[_0x238b('0x40')]['includeAll']){_0x413923[_0x238b('0x55')]=[{'all':!![]}];}_0x413923=_[_0x238b('0x49')]({},_0x413923,_0xe4cae0[_0x238b('0x56')]);return db[_0x238b('0x4d')][_0x238b('0x57')](_0x413923)[_0x238b('0x36')](handleEntityNotFound(_0x2303b8,null))[_0x238b('0x36')](respondWithResult(_0x2303b8,null))[_0x238b('0x51')](handleError(_0x2303b8,null));};exports[_0x238b('0x35')]=function(_0x25b694,_0x5026bd){if(_0x25b694['body']['id']){delete _0x25b694[_0x238b('0x58')]['id'];}return db[_0x238b('0x4d')][_0x238b('0x57')]({'where':{'id':_0x25b694[_0x238b('0x59')]['id']}})[_0x238b('0x36')](handleEntityNotFound(_0x5026bd,null))[_0x238b('0x36')](saveUpdates(_0x25b694['body'],null))[_0x238b('0x36')](respondWithResult(_0x5026bd,null))[_0x238b('0x51')](handleError(_0x5026bd,null));};exports[_0x238b('0x37')]=function(_0x43e7d4,_0x2d0cdd){return db[_0x238b('0x4d')][_0x238b('0x57')]({'where':{'id':_0x43e7d4['params']['id']}})[_0x238b('0x36')](handleEntityNotFound(_0x2d0cdd,null))[_0x238b('0x36')](removeEntity(_0x2d0cdd,null))[_0x238b('0x51')](handleError(_0x2d0cdd,null));};exports[_0x238b('0x5a')]=function(_0x1a8b22,_0x28b965){return db[_0x238b('0x4d')][_0x238b('0x5a')]()[_0x238b('0x36')](respondWithResult(_0x28b965,null))[_0x238b('0x51')](handleError(_0x28b965,null));};var interaction_log=require(_0x238b('0x13'))('fax-interactions');exports[_0x238b('0x5b')]=function(_0x251b11,_0xa7cf35,_0x406946){var _0x2e241e={'agent':{},'channel':_0x238b('0x5c')};if(_0x251b11[_0x238b('0x58')]['id']){delete _0x251b11['body']['id'];}_0x251b11[_0x238b('0x58')][_0x238b('0x5d')]=!![];_0x251b11[_0x238b('0x58')]['readAt']=moment()[_0x238b('0x5e')](_0x238b('0x5f'));_0x251b11[_0x238b('0x58')][_0x238b('0x60')]=_0x251b11[_0x238b('0x58')]['UserId']||_0x251b11[_0x238b('0x61')]['id'];_0x2e241e[_0x238b('0x62')]['id']=_0x251b11[_0x238b('0x58')][_0x238b('0x60')];return db['FaxMessage']['find']({'where':{'id':_0x251b11['params']['id'],'UserId':null}})[_0x238b('0x36')](handleEntityNotFound(_0xa7cf35,null))[_0x238b('0x36')](saveUpdates(_0x251b11[_0x238b('0x58')],null))[_0x238b('0x36')](function(_0x43c8d3){if(_0x43c8d3){_0x2e241e[_0x238b('0x27')]=_0x43c8d3['get']({'plain':!![]});return db[_0x238b('0x63')][_0x238b('0x57')]({'where':{'id':_0x43c8d3[_0x238b('0x64')]}});}return null;})[_0x238b('0x36')](handleEntityNotFound(_0xa7cf35,null))[_0x238b('0x36')](function(_0xec170a){if(_0xec170a){return _0xec170a[_0x238b('0x35')]({'UserId':_0x251b11[_0x238b('0x58')][_0x238b('0x60')],'read1stAt':_[_0x238b('0x65')](_0xec170a[_0x238b('0x66')])?moment()[_0x238b('0x5e')](_0x238b('0x5f')):undefined});}return null;})['then'](function(_0x23c210){if(_0x23c210){_0x2e241e[_0x238b('0x67')]=_0x23c210[_0x238b('0x68')]({'plain':!![]});interaction_log[_0x238b('0x28')](_0x238b('0x69'),_0x251b11[_0x238b('0x61')]['id'],_0x251b11['user'][_0x238b('0x3c')],_0x251b11[_0x238b('0x61')]['role'],_0x2e241e[_0x238b('0x67')]['id'],_0x251b11['body']?JSON[_0x238b('0x25')](_0x251b11['body']):_0x238b('0x6a'));return respondWithRpcPromise(_0x238b('0x6b'),_0x238b('0x6c'),_0x2e241e);}return null;})[_0x238b('0x36')](function(_0x4bdcee){var _0x5aa444=_0x238b('0x6d')+_0x4bdcee[_0x238b('0x27')]['ContactId'];return db[_0x238b('0x6e')][_0x238b('0x40')](_0x5aa444,{'type':db[_0x238b('0x6f')][_0x238b('0x70')][_0x238b('0x71')],'raw':!![]})[_0x238b('0x36')](function(_0x1341e3){return _0x1341e3;});})['then'](function(_0x35284a){if(_0x35284a){_0x2e241e[_0x238b('0x27')]['contact']=_0x35284a[0x0];if(!_0x251b11[_0x238b('0x58')][_0x238b('0x60')])return;return db[_0x238b('0x72')][_0x238b('0x57')]({'where':{'id':_0x251b11[_0x238b('0x58')][_0x238b('0x60')],'role':_0x238b('0x62')},'attributes':['id',_0x238b('0x3c'),'fullname','email',_0x238b('0x73')],'raw':!![]});}return null;})[_0x238b('0x36')](function(_0x413b48){if(!_0x413b48)return null;_0x2e241e[_0x238b('0x27')][_0x238b('0x62')]=_0x413b48;return _0x2e241e;})[_0x238b('0x36')](function(_0x44a13f){if(_0x44a13f){if(_0x251b11['body'][_0x238b('0x74')]){_0x2e241e[_0x238b('0x27')][_0x238b('0x75')]=util[_0x238b('0x5e')](_0x238b('0x76'),_0x251b11[_0x238b('0x61')]['name']);_0x2e241e[_0x238b('0x27')]['channel']=_0x2e241e['channel'];_0x2e241e[_0x238b('0x27')][_0x238b('0x77')]=_0x2e241e[_0x238b('0x78')];_0x2e241e[_0x238b('0x27')]['event']='accept';return respondWithRpcPromise(_0x238b('0x79'),_0x238b('0x79'),{'event':'acceptmessage','message':_0x2e241e[_0x238b('0x27')]},client9002)[_0x238b('0x36')](function(){return _0x2e241e;});}return _0x2e241e;}return null;})['then'](respondWithResult(_0xa7cf35,null))['catch'](handleError(_0xa7cf35,null));};var interaction_log=require(_0x238b('0x13'))(_0x238b('0x7a'));exports[_0x238b('0x33')]=function(_0x17461d,_0x5d1536,_0x4de929){var _0x39cda6={'agent':{},'channel':'fax'};if(_0x17461d['body']['id']){delete _0x17461d[_0x238b('0x58')]['id'];}_0x17461d[_0x238b('0x58')][_0x238b('0x60')]=_0x17461d[_0x238b('0x58')]['UserId']||_0x17461d['user']['id'];_0x39cda6[_0x238b('0x62')]['id']=_0x17461d['body'][_0x238b('0x60')];return db[_0x238b('0x4d')][_0x238b('0x57')]({'where':{'id':_0x17461d[_0x238b('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5d1536,null))['then'](function(_0x2b8a07){if(_0x2b8a07){_0x39cda6[_0x238b('0x27')]=_0x2b8a07[_0x238b('0x68')]({'plain':!![]});return db[_0x238b('0x63')][_0x238b('0x57')]({'where':{'id':_0x2b8a07[_0x238b('0x64')]}});}return null;})[_0x238b('0x36')](handleEntityNotFound(_0x5d1536,null))['then'](function(_0x4bcc21){if(_0x4bcc21){_0x39cda6[_0x238b('0x67')]=_0x4bcc21[_0x238b('0x68')]({'plain':!![]});interaction_log['info'](_0x238b('0x7b'),_0x17461d[_0x238b('0x61')]['id'],_0x17461d['user'][_0x238b('0x3c')],_0x17461d[_0x238b('0x61')][_0x238b('0x7c')],_0x39cda6[_0x238b('0x67')]['id'],_0x17461d['body']?JSON[_0x238b('0x25')](_0x17461d['body']):'null');return respondWithRpcPromise(_0x238b('0x7d'),_0x238b('0x7e'),_0x39cda6);}return null;})[_0x238b('0x36')](function(_0x2a5fee){var _0x3ac01b=_0x238b('0x6d')+_0x2a5fee['message'][_0x238b('0x7f')];return db['sequelize'][_0x238b('0x40')](_0x3ac01b,{'type':db[_0x238b('0x6f')][_0x238b('0x70')][_0x238b('0x71')],'raw':!![]})[_0x238b('0x36')](function(_0x181024){return _0x181024;});})['then'](function(_0x29816f){if(_0x29816f){_0x39cda6[_0x238b('0x27')]['contact']=_0x29816f[0x0];if(!_0x17461d['body'][_0x238b('0x60')])return;return db[_0x238b('0x72')][_0x238b('0x57')]({'where':{'id':_0x17461d[_0x238b('0x58')][_0x238b('0x60')],'role':_0x238b('0x62')},'attributes':['id',_0x238b('0x3c'),_0x238b('0x80'),'email',_0x238b('0x73')],'raw':!![]});}return null;})[_0x238b('0x36')](function(_0x3abc43){if(!_0x3abc43)return null;_0x39cda6[_0x238b('0x27')]['agent']=_0x3abc43;return _0x39cda6;})[_0x238b('0x36')](function(_0x5769c6){if(_0x5769c6){_0x5769c6[_0x238b('0x27')][_0x238b('0x75')]=util[_0x238b('0x5e')](_0x238b('0x76'),_0x17461d['user'][_0x238b('0x3c')]);_0x5769c6[_0x238b('0x27')][_0x238b('0x78')]=_0x39cda6[_0x238b('0x78')];_0x5769c6[_0x238b('0x27')]['motionChannel']=_0x39cda6[_0x238b('0x78')];_0x5769c6[_0x238b('0x27')][_0x238b('0x81')]=_0x238b('0x33');respondWithRpcPromise(_0x238b('0x79'),_0x238b('0x79'),{'event':_0x238b('0x82'),'message':_0x5769c6[_0x238b('0x27')]},client9002);return _0x39cda6;}return null;})[_0x238b('0x36')](respondWithResult(_0x5d1536,null))[_0x238b('0x51')](handleError(_0x5d1536,null));};exports[_0x238b('0x83')]=function(_0x2b9e71,_0x3e47a9){var _0x769d20;return db[_0x238b('0x4d')][_0x238b('0x83')](_0x2b9e71[_0x238b('0x58')],{})[_0x238b('0x36')](function(_0x400b12){_0x769d20=_0x400b12;return db[_0x238b('0x84')][_0x238b('0x85')]({'where':{'id':_0x769d20['ContactId']}});})[_0x238b('0x36')](function(_0x27f258){if(_['isNil'](_0x27f258)){return;}else{_0x769d20['fax']=_0x27f258[_0x238b('0x5c')];return db[_0x238b('0x86')][_0x238b('0x85')]({'where':{'id':_0x769d20['AttachmentId']}});}})[_0x238b('0x36')](function(_0x3cabee){return respondWithRpcPromise(_0x238b('0x87'),'SendFax',{'FaxAccountId':_[_0x238b('0x65')](_0x2b9e71[_0x238b('0x58')])?undefined:_0x2b9e71[_0x238b('0x58')]['FaxAccountId'],'path':_['isNil'](_0x3cabee)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x3cabee[_0x238b('0x88')]),'fax':_[_0x238b('0x65')](_0x769d20[_0x238b('0x5c')])?undefined:_0x769d20[_0x238b('0x5c')],'AttachmentId':_0x769d20[_0x238b('0x89')]},client9002);})['then'](respondWithResult(_0x3e47a9,0xc9))[_0x238b('0x51')](handleError(_0x3e47a9,null));};exports[_0x238b('0x8a')]=function(_0x4d9984,_0x3f919c){var _0x4aa996=path[_0x238b('0x8b')](config[_0x238b('0x8c')],_0x238b('0x8d'),_0x238b('0x8e'),_0x238b('0x8f'));return db[_0x238b('0x4d')][_0x238b('0x57')]({'where':{'id':_0x4d9984[_0x238b('0x59')]['id']},'include':[{'model':db[_0x238b('0x86')],'as':_0x238b('0x86')}]})['then'](handleEntityNotFound(_0x3f919c,null))[_0x238b('0x36')](function(_0xd8aaf5){if(_0xd8aaf5){return _0x3f919c[_0x238b('0x8a')](path[_0x238b('0x8b')](_0x4aa996,_0xd8aaf5[_0x238b('0x86')][_0x238b('0x88')]));}})['catch'](handleError(_0x3f919c,null));}; \ No newline at end of file +var _0xbfb1=['model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','include','findAll','rows','show','params','fields','find','catch','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','SendFax','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','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','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','key'];(function(_0x3b669d,_0x889bcb){var _0x2073fd=function(_0x499854){while(--_0x499854){_0x3b669d['push'](_0x3b669d['shift']());}};_0x2073fd(++_0x889bcb);}(_0xbfb1,0xe4));var _0x1bfb=function(_0x5db129,_0x151303){_0x5db129=_0x5db129-0x0;var _0x5ec143=_0xbfb1[_0x5db129];return _0x5ec143;};'use strict';var emlformat=require(_0x1bfb('0x0'));var rimraf=require(_0x1bfb('0x1'));var zipdir=require(_0x1bfb('0x2'));var jsonpatch=require(_0x1bfb('0x3'));var rp=require(_0x1bfb('0x4'));var moment=require(_0x1bfb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bfb('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1bfb('0x7'));var csv=require('to-csv');var ejs=require(_0x1bfb('0x8'));var fs=require('fs');var fs_extra=require(_0x1bfb('0x9'));var _=require(_0x1bfb('0xa'));var squel=require(_0x1bfb('0xb'));var crypto=require(_0x1bfb('0xc'));var jsforce=require(_0x1bfb('0xd'));var deskjs=require(_0x1bfb('0xe'));var toCsv=require(_0x1bfb('0xf'));var querystring=require('querystring');var Papa=require(_0x1bfb('0x10'));var Redis=require(_0x1bfb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1bfb('0x12'));var as=require(_0x1bfb('0x13'));var hardwareService=require(_0x1bfb('0x14'));var logger=require(_0x1bfb('0x15'))(_0x1bfb('0x16'));var utils=require(_0x1bfb('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1bfb('0x18'))['db'];config[_0x1bfb('0x19')]=_[_0x1bfb('0x1a')](config[_0x1bfb('0x19')],{'host':_0x1bfb('0x1b'),'port':0x18eb});var socket=require(_0x1bfb('0x1c'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x1bfb('0x1d')](socket);var jayson=require(_0x1bfb('0x1e'));var client=jayson[_0x1bfb('0x1f')][_0x1bfb('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x1bfb('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1e79f7,_0x1b1822,_0xb95b61,_0xb69ffc){return new BPromise(function(_0x2cca55,_0x3aaaac){var _0x2d10e7=_0xb69ffc||client;return _0x2d10e7[_0x1bfb('0x21')](_0x1e79f7,_0xb95b61)[_0x1bfb('0x22')](function(_0x22c56c){logger[_0x1bfb('0x23')](_0x1bfb('0x24'),_0x1b1822,_0x1bfb('0x25'));logger[_0x1bfb('0x26')](_0x1bfb('0x27'),_0x1b1822,'request\x20sent',JSON[_0x1bfb('0x28')](_0x22c56c));if(_0x22c56c[_0x1bfb('0x29')]){if(_0x22c56c['error'][_0x1bfb('0x2a')]===0x1f4){logger[_0x1bfb('0x29')](_0x1bfb('0x24'),_0x1b1822,_0x22c56c[_0x1bfb('0x29')]['message']);return _0x3aaaac(_0x22c56c['error']['message']);}logger[_0x1bfb('0x29')]('FaxMessage,\x20%s,\x20%s',_0x1b1822,_0x22c56c[_0x1bfb('0x29')][_0x1bfb('0x2b')]);return _0x2cca55(_0x22c56c[_0x1bfb('0x29')][_0x1bfb('0x2b')]);}else{logger[_0x1bfb('0x23')]('FaxMessage,\x20%s,\x20%s',_0x1b1822,_0x1bfb('0x25'));_0x2cca55(_0x22c56c[_0x1bfb('0x2c')][_0x1bfb('0x2b')]);}})['catch'](function(_0x5d7c9e){logger[_0x1bfb('0x29')](_0x1bfb('0x24'),_0x1b1822,_0x5d7c9e);_0x3aaaac(_0x5d7c9e);});});}function respondWithStatusCode(_0x514ac9,_0x17fceb){_0x17fceb=_0x17fceb||0xcc;return function(_0xb60975){if(_0xb60975){return _0x514ac9['sendStatus'](_0x17fceb);}return _0x514ac9[_0x1bfb('0x2d')](_0x17fceb)[_0x1bfb('0x2e')]();};}function respondWithResult(_0x5efa31,_0x138272){_0x138272=_0x138272||0xc8;return function(_0x415e11){if(_0x415e11){return _0x5efa31['status'](_0x138272)[_0x1bfb('0x2f')](_0x415e11);}};}function respondWithFilteredResult(_0x5bf813,_0x582db9){return function(_0x22aa56){if(_0x22aa56){var _0x8d4712=typeof _0x582db9[_0x1bfb('0x30')]===_0x1bfb('0x31')&&typeof _0x582db9[_0x1bfb('0x32')]==='undefined';var _0x5caabe=_0x22aa56[_0x1bfb('0x33')];var _0x2dbd8c=_0x8d4712?0x0:_0x582db9[_0x1bfb('0x30')];var _0x9494a1=_0x8d4712?_0x22aa56[_0x1bfb('0x33')]:_0x582db9[_0x1bfb('0x30')]+_0x582db9[_0x1bfb('0x32')];var _0xcce8cd;if(_0x9494a1>=_0x5caabe){_0x9494a1=_0x5caabe;_0xcce8cd=0xc8;}else{_0xcce8cd=0xce;}_0x5bf813[_0x1bfb('0x2d')](_0xcce8cd);return _0x5bf813['set'](_0x1bfb('0x34'),_0x2dbd8c+'-'+_0x9494a1+'/'+_0x5caabe)[_0x1bfb('0x2f')](_0x22aa56);}return null;};}function patchUpdates(_0x39853c){return function(_0x70bd2b){try{jsonpatch[_0x1bfb('0x35')](_0x70bd2b,_0x39853c,!![]);}catch(_0xa53db3){return BPromise[_0x1bfb('0x36')](_0xa53db3);}return _0x70bd2b[_0x1bfb('0x37')]();};}function saveUpdates(_0x44e2ce,_0x237922){return function(_0x2e7993){if(_0x2e7993){return _0x2e7993[_0x1bfb('0x38')](_0x44e2ce)['then'](function(_0x5ae874){return _0x5ae874;});}return null;};}function removeEntity(_0x296d60,_0x5e1a95){return function(_0x228d54){if(_0x228d54){return _0x228d54[_0x1bfb('0x39')]()[_0x1bfb('0x22')](function(){_0x296d60[_0x1bfb('0x2d')](0xcc)[_0x1bfb('0x2e')]();});}};}function handleEntityNotFound(_0x1c6421,_0x44dd7f){return function(_0x2d3cec){if(!_0x2d3cec){_0x1c6421['sendStatus'](0x194);}return _0x2d3cec;};}function handleError(_0x8ccedd,_0x9c929c){_0x9c929c=_0x9c929c||0x1f4;return function(_0x46f088){logger[_0x1bfb('0x29')](_0x46f088[_0x1bfb('0x3a')]);if(_0x46f088[_0x1bfb('0x3b')]){delete _0x46f088['name'];}_0x8ccedd[_0x1bfb('0x2d')](_0x9c929c)[_0x1bfb('0x3c')](_0x46f088);};}exports[_0x1bfb('0x3d')]=function(_0x39d692,_0x4e224c){var _0x44e868={},_0x521cbc={},_0x50d632={'count':0x0,'rows':[]};var _0x14516e=_[_0x1bfb('0x3e')](db[_0x1bfb('0x3f')][_0x1bfb('0x40')],function(_0x11cc63){return{'name':_0x11cc63['fieldName'],'type':_0x11cc63['type'][_0x1bfb('0x41')]};});_0x521cbc[_0x1bfb('0x42')]=_[_0x1bfb('0x3e')](_0x14516e,_0x1bfb('0x3b'));_0x521cbc['query']=_[_0x1bfb('0x43')](_0x39d692[_0x1bfb('0x44')]);_0x521cbc['filters']=_['intersection'](_0x521cbc[_0x1bfb('0x42')],_0x521cbc[_0x1bfb('0x44')]);_0x44e868[_0x1bfb('0x45')]=_[_0x1bfb('0x46')](_0x521cbc[_0x1bfb('0x42')],qs['fields'](_0x39d692[_0x1bfb('0x44')]['fields']));_0x44e868[_0x1bfb('0x45')]=_0x44e868[_0x1bfb('0x45')][_0x1bfb('0x47')]?_0x44e868[_0x1bfb('0x45')]:_0x521cbc['model'];if(!_0x39d692['query'][_0x1bfb('0x48')](_0x1bfb('0x49'))){_0x44e868[_0x1bfb('0x32')]=qs[_0x1bfb('0x32')](_0x39d692['query'][_0x1bfb('0x32')]);_0x44e868[_0x1bfb('0x30')]=qs[_0x1bfb('0x30')](_0x39d692[_0x1bfb('0x44')]['offset']);}_0x44e868[_0x1bfb('0x4a')]=qs[_0x1bfb('0x4b')](_0x39d692[_0x1bfb('0x44')][_0x1bfb('0x4b')]);_0x44e868[_0x1bfb('0x4c')]=qs[_0x1bfb('0x4d')](_[_0x1bfb('0x4e')](_0x39d692[_0x1bfb('0x44')],_0x521cbc[_0x1bfb('0x4d')]),_0x14516e);if(_0x39d692[_0x1bfb('0x44')][_0x1bfb('0x4f')]){_0x44e868[_0x1bfb('0x4c')]=_[_0x1bfb('0x50')](_0x44e868['where'],{'$or':_[_0x1bfb('0x3e')](_0x14516e,function(_0x14e3a2){if(_0x14e3a2['type']!=='VIRTUAL'){var _0x30ed6d={};_0x30ed6d[_0x14e3a2[_0x1bfb('0x3b')]]={'$like':'%'+_0x39d692[_0x1bfb('0x44')][_0x1bfb('0x4f')]+'%'};return _0x30ed6d;}})});}_0x44e868=_[_0x1bfb('0x50')]({},_0x44e868,_0x39d692['options']);var _0x2514cc={'where':_0x44e868[_0x1bfb('0x4c')]};return db[_0x1bfb('0x3f')][_0x1bfb('0x33')](_0x2514cc)[_0x1bfb('0x22')](function(_0x40b9ff){_0x50d632[_0x1bfb('0x33')]=_0x40b9ff;if(_0x39d692[_0x1bfb('0x44')]['includeAll']){_0x44e868[_0x1bfb('0x51')]=[{'all':!![]}];}return db[_0x1bfb('0x3f')][_0x1bfb('0x52')](_0x44e868);})[_0x1bfb('0x22')](function(_0x252b18){_0x50d632[_0x1bfb('0x53')]=_0x252b18;return _0x50d632;})[_0x1bfb('0x22')](respondWithFilteredResult(_0x4e224c,_0x44e868))['catch'](handleError(_0x4e224c,null));};exports[_0x1bfb('0x54')]=function(_0x462cdf,_0x1ad054){var _0x5f2b4a={'raw':!![],'where':{'id':_0x462cdf[_0x1bfb('0x55')]['id']}},_0x4906da={};_0x4906da[_0x1bfb('0x42')]=_[_0x1bfb('0x43')](db[_0x1bfb('0x3f')][_0x1bfb('0x40')]);_0x4906da['query']=_['keys'](_0x462cdf[_0x1bfb('0x44')]);_0x4906da['filters']=_[_0x1bfb('0x46')](_0x4906da[_0x1bfb('0x42')],_0x4906da[_0x1bfb('0x44')]);_0x5f2b4a[_0x1bfb('0x45')]=_[_0x1bfb('0x46')](_0x4906da[_0x1bfb('0x42')],qs[_0x1bfb('0x56')](_0x462cdf[_0x1bfb('0x44')][_0x1bfb('0x56')]));_0x5f2b4a['attributes']=_0x5f2b4a[_0x1bfb('0x45')][_0x1bfb('0x47')]?_0x5f2b4a['attributes']:_0x4906da[_0x1bfb('0x42')];if(_0x462cdf[_0x1bfb('0x44')]['includeAll']){_0x5f2b4a['include']=[{'all':!![]}];}_0x5f2b4a=_[_0x1bfb('0x50')]({},_0x5f2b4a,_0x462cdf['options']);return db['FaxMessage'][_0x1bfb('0x57')](_0x5f2b4a)[_0x1bfb('0x22')](handleEntityNotFound(_0x1ad054,null))['then'](respondWithResult(_0x1ad054,null))[_0x1bfb('0x58')](handleError(_0x1ad054,null));};exports[_0x1bfb('0x38')]=function(_0xfc0343,_0x4cb119){if(_0xfc0343[_0x1bfb('0x59')]['id']){delete _0xfc0343['body']['id'];}return db[_0x1bfb('0x3f')][_0x1bfb('0x57')]({'where':{'id':_0xfc0343[_0x1bfb('0x55')]['id']}})[_0x1bfb('0x22')](handleEntityNotFound(_0x4cb119,null))[_0x1bfb('0x22')](saveUpdates(_0xfc0343[_0x1bfb('0x59')],null))[_0x1bfb('0x22')](respondWithResult(_0x4cb119,null))[_0x1bfb('0x58')](handleError(_0x4cb119,null));};exports[_0x1bfb('0x39')]=function(_0xfc5a1a,_0x21659d){return db[_0x1bfb('0x3f')][_0x1bfb('0x57')]({'where':{'id':_0xfc5a1a['params']['id']}})['then'](handleEntityNotFound(_0x21659d,null))[_0x1bfb('0x22')](removeEntity(_0x21659d,null))['catch'](handleError(_0x21659d,null));};exports[_0x1bfb('0x5a')]=function(_0x4dff3a,_0x348ec4){return db['FaxMessage'][_0x1bfb('0x5a')]()[_0x1bfb('0x22')](respondWithResult(_0x348ec4,null))[_0x1bfb('0x58')](handleError(_0x348ec4,null));};var interaction_log=require(_0x1bfb('0x15'))(_0x1bfb('0x5b'));exports[_0x1bfb('0x5c')]=function(_0x44cac6,_0x223303,_0x42674a){var _0x4ad9e8={'agent':{},'channel':_0x1bfb('0x5d')};if(_0x44cac6['body']['id']){delete _0x44cac6[_0x1bfb('0x59')]['id'];}_0x44cac6[_0x1bfb('0x59')][_0x1bfb('0x5e')]=!![];_0x44cac6[_0x1bfb('0x59')]['readAt']=moment()[_0x1bfb('0x5f')](_0x1bfb('0x60'));_0x44cac6[_0x1bfb('0x59')][_0x1bfb('0x61')]=_0x44cac6[_0x1bfb('0x59')][_0x1bfb('0x61')]||_0x44cac6[_0x1bfb('0x62')]['id'];_0x4ad9e8['agent']['id']=_0x44cac6[_0x1bfb('0x59')][_0x1bfb('0x61')];return db[_0x1bfb('0x3f')][_0x1bfb('0x57')]({'where':{'id':_0x44cac6[_0x1bfb('0x55')]['id'],'UserId':null}})[_0x1bfb('0x22')](handleEntityNotFound(_0x223303,null))[_0x1bfb('0x22')](saveUpdates(_0x44cac6[_0x1bfb('0x59')],null))[_0x1bfb('0x22')](function(_0x329319){if(_0x329319){_0x4ad9e8[_0x1bfb('0x2b')]=_0x329319[_0x1bfb('0x63')]({'plain':!![]});return db[_0x1bfb('0x64')][_0x1bfb('0x57')]({'where':{'id':_0x329319[_0x1bfb('0x65')]}});}return null;})[_0x1bfb('0x22')](handleEntityNotFound(_0x223303,null))['then'](function(_0x21d6aa){if(_0x21d6aa){return _0x21d6aa[_0x1bfb('0x38')]({'UserId':_0x44cac6['body']['UserId'],'read1stAt':_[_0x1bfb('0x66')](_0x21d6aa[_0x1bfb('0x67')])?moment()[_0x1bfb('0x5f')](_0x1bfb('0x60')):undefined});}return null;})[_0x1bfb('0x22')](function(_0x104f3a){if(_0x104f3a){_0x4ad9e8['interaction']=_0x104f3a['get']({'plain':!![]});interaction_log[_0x1bfb('0x23')](_0x1bfb('0x68'),_0x44cac6[_0x1bfb('0x62')]['id'],_0x44cac6['user']['name'],_0x44cac6[_0x1bfb('0x62')][_0x1bfb('0x69')],_0x4ad9e8[_0x1bfb('0x6a')]['id'],_0x44cac6[_0x1bfb('0x59')]?JSON[_0x1bfb('0x28')](_0x44cac6[_0x1bfb('0x59')]):_0x1bfb('0x6b'));return respondWithRpcPromise(_0x1bfb('0x6c'),_0x1bfb('0x6d'),_0x4ad9e8);}return null;})['then'](function(_0x1c1f28){var _0x3366f6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c1f28['message'][_0x1bfb('0x6e')];return db[_0x1bfb('0x6f')][_0x1bfb('0x44')](_0x3366f6,{'type':db[_0x1bfb('0x70')][_0x1bfb('0x71')][_0x1bfb('0x72')],'raw':!![]})['then'](function(_0x406172){return _0x406172;});})[_0x1bfb('0x22')](function(_0x5e38e0){if(_0x5e38e0){_0x4ad9e8[_0x1bfb('0x2b')][_0x1bfb('0x73')]=_0x5e38e0[0x0];if(!_0x44cac6[_0x1bfb('0x59')]['UserId'])return;return db[_0x1bfb('0x74')][_0x1bfb('0x57')]({'where':{'id':_0x44cac6[_0x1bfb('0x59')][_0x1bfb('0x61')],'role':'agent'},'attributes':['id','name',_0x1bfb('0x75'),_0x1bfb('0x76'),'internal'],'raw':!![]});}return null;})[_0x1bfb('0x22')](function(_0xb6de7b){if(!_0xb6de7b)return null;_0x4ad9e8[_0x1bfb('0x2b')]['agent']=_0xb6de7b;return _0x4ad9e8;})[_0x1bfb('0x22')](function(_0x47edf1){if(_0x47edf1){if(_0x44cac6[_0x1bfb('0x59')][_0x1bfb('0x77')]){_0x4ad9e8[_0x1bfb('0x2b')][_0x1bfb('0x78')]=util[_0x1bfb('0x5f')](_0x1bfb('0x79'),_0x44cac6[_0x1bfb('0x62')]['name']);_0x4ad9e8['message'][_0x1bfb('0x7a')]=_0x4ad9e8[_0x1bfb('0x7a')];_0x4ad9e8['message']['motionChannel']=_0x4ad9e8['channel'];_0x4ad9e8[_0x1bfb('0x2b')][_0x1bfb('0x7b')]=_0x1bfb('0x5c');return respondWithRpcPromise('EventManager',_0x1bfb('0x7c'),{'event':_0x1bfb('0x7d'),'message':_0x4ad9e8[_0x1bfb('0x2b')]},client9002)[_0x1bfb('0x22')](function(){return _0x4ad9e8;});}return _0x4ad9e8;}return null;})[_0x1bfb('0x22')](respondWithResult(_0x223303,null))['catch'](handleError(_0x223303,null));};var interaction_log=require('../../config/logger')(_0x1bfb('0x5b'));exports['reject']=function(_0x47de44,_0x21df90,_0x18b7e0){var _0x9cb89b={'agent':{},'channel':_0x1bfb('0x5d')};if(_0x47de44[_0x1bfb('0x59')]['id']){delete _0x47de44[_0x1bfb('0x59')]['id'];}_0x47de44[_0x1bfb('0x59')]['UserId']=_0x47de44[_0x1bfb('0x59')][_0x1bfb('0x61')]||_0x47de44[_0x1bfb('0x62')]['id'];_0x9cb89b[_0x1bfb('0x7e')]['id']=_0x47de44[_0x1bfb('0x59')][_0x1bfb('0x61')];return db[_0x1bfb('0x3f')][_0x1bfb('0x57')]({'where':{'id':_0x47de44[_0x1bfb('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21df90,null))[_0x1bfb('0x22')](function(_0x2a1b1e){if(_0x2a1b1e){_0x9cb89b['message']=_0x2a1b1e[_0x1bfb('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x1bfb('0x57')]({'where':{'id':_0x2a1b1e[_0x1bfb('0x65')]}});}return null;})[_0x1bfb('0x22')](handleEntityNotFound(_0x21df90,null))[_0x1bfb('0x22')](function(_0x122b94){if(_0x122b94){_0x9cb89b['interaction']=_0x122b94[_0x1bfb('0x63')]({'plain':!![]});interaction_log[_0x1bfb('0x23')](_0x1bfb('0x7f'),_0x47de44['user']['id'],_0x47de44[_0x1bfb('0x62')][_0x1bfb('0x3b')],_0x47de44[_0x1bfb('0x62')]['role'],_0x9cb89b[_0x1bfb('0x6a')]['id'],_0x47de44[_0x1bfb('0x59')]?JSON[_0x1bfb('0x28')](_0x47de44[_0x1bfb('0x59')]):_0x1bfb('0x6b'));return respondWithRpcPromise(_0x1bfb('0x80'),_0x1bfb('0x81'),_0x9cb89b);}return null;})[_0x1bfb('0x22')](function(_0x31fa71){var _0x69f25c=_0x1bfb('0x82')+_0x31fa71['message']['ContactId'];return db[_0x1bfb('0x6f')][_0x1bfb('0x44')](_0x69f25c,{'type':db[_0x1bfb('0x70')][_0x1bfb('0x71')][_0x1bfb('0x72')],'raw':!![]})[_0x1bfb('0x22')](function(_0x19da7d){return _0x19da7d;});})[_0x1bfb('0x22')](function(_0x5acb99){if(_0x5acb99){_0x9cb89b['message']['contact']=_0x5acb99[0x0];if(!_0x47de44[_0x1bfb('0x59')][_0x1bfb('0x61')])return;return db[_0x1bfb('0x74')][_0x1bfb('0x57')]({'where':{'id':_0x47de44[_0x1bfb('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0x1bfb('0x3b'),_0x1bfb('0x75'),'email',_0x1bfb('0x83')],'raw':!![]});}return null;})[_0x1bfb('0x22')](function(_0x5ebc02){if(!_0x5ebc02)return null;_0x9cb89b[_0x1bfb('0x2b')][_0x1bfb('0x7e')]=_0x5ebc02;return _0x9cb89b;})[_0x1bfb('0x22')](function(_0x3ccad0){if(_0x3ccad0){_0x3ccad0[_0x1bfb('0x2b')][_0x1bfb('0x78')]=util[_0x1bfb('0x5f')]('SIP/%s',_0x47de44[_0x1bfb('0x62')]['name']);_0x3ccad0['message']['channel']=_0x9cb89b[_0x1bfb('0x7a')];_0x3ccad0['message'][_0x1bfb('0x84')]=_0x9cb89b[_0x1bfb('0x7a')];_0x3ccad0[_0x1bfb('0x2b')][_0x1bfb('0x7b')]=_0x1bfb('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0x1bfb('0x85'),'message':_0x3ccad0['message']},client9002);return _0x9cb89b;}return null;})['then'](respondWithResult(_0x21df90,null))[_0x1bfb('0x58')](handleError(_0x21df90,null));};exports[_0x1bfb('0x86')]=function(_0x29348c,_0x1e892){var _0xc2028f;return db[_0x1bfb('0x3f')][_0x1bfb('0x86')](_0x29348c[_0x1bfb('0x59')],{})[_0x1bfb('0x22')](function(_0x50a2dd){_0xc2028f=_0x50a2dd;return db[_0x1bfb('0x87')][_0x1bfb('0x88')]({'where':{'id':_0xc2028f[_0x1bfb('0x6e')]}});})['then'](function(_0x83cb7d){if(_[_0x1bfb('0x66')](_0x83cb7d)){return;}else{_0xc2028f[_0x1bfb('0x5d')]=_0x83cb7d[_0x1bfb('0x5d')];return db[_0x1bfb('0x89')][_0x1bfb('0x88')]({'where':{'id':_0xc2028f['AttachmentId']}});}})[_0x1bfb('0x22')](function(_0x544a26){return respondWithRpcPromise(_0x1bfb('0x8a'),_0x1bfb('0x8a'),{'FaxAccountId':_[_0x1bfb('0x66')](_0x29348c['body'])?undefined:_0x29348c[_0x1bfb('0x59')]['FaxAccountId'],'path':_['isNil'](_0x544a26)?undefined:util[_0x1bfb('0x5f')]('/var/opt/motion2/server/files/attachments/%s',_0x544a26[_0x1bfb('0x8b')]),'fax':_[_0x1bfb('0x66')](_0xc2028f[_0x1bfb('0x5d')])?undefined:_0xc2028f[_0x1bfb('0x5d')],'AttachmentId':_0xc2028f[_0x1bfb('0x8c')]},client9002);})[_0x1bfb('0x22')](respondWithResult(_0x1e892,0xc9))[_0x1bfb('0x58')](handleError(_0x1e892,null));};exports[_0x1bfb('0x8d')]=function(_0x28ead0,_0x4d20fe){var _0x4ac7e1=path[_0x1bfb('0x8e')](config[_0x1bfb('0x8f')],_0x1bfb('0x90'),_0x1bfb('0x91'),_0x1bfb('0x92'));return db[_0x1bfb('0x3f')][_0x1bfb('0x57')]({'where':{'id':_0x28ead0['params']['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x1bfb('0x22')](handleEntityNotFound(_0x4d20fe,null))[_0x1bfb('0x22')](function(_0x5db193){if(_0x5db193){return _0x4d20fe[_0x1bfb('0x8d')](path[_0x1bfb('0x8e')](_0x4ac7e1,_0x5db193[_0x1bfb('0x89')][_0x1bfb('0x8b')]));}})[_0x1bfb('0x58')](handleError(_0x4d20fe,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index e6161de..aad0a04 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 _0xa6ce=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','FaxMessage'];(function(_0x5d67f7,_0x378b30){var _0x489bcd=function(_0x289d64){while(--_0x289d64){_0x5d67f7['push'](_0x5d67f7['shift']());}};_0x489bcd(++_0x378b30);}(_0xa6ce,0x15e));var _0xea6c=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0xa6ce[_0x2a67fe];return _0x57e726;};'use strict';var EventEmitter=require(_0xea6c('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xea6c('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xea6c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea6c('0x3'),'afterDestroy':_0xea6c('0x4')};function emitEvent(_0x4c45ad){return function(_0x5620a1,_0x2ac723,_0x1eea8f){FaxMessageEvents[_0xea6c('0x5')](_0x4c45ad+':'+_0x5620a1['id'],_0x5620a1);FaxMessageEvents[_0xea6c('0x5')](_0x4c45ad,_0x5620a1);_0x1eea8f(null);};}for(var e in events){if(events[_0xea6c('0x6')](e)){var event=events[e];FaxMessage[_0xea6c('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x87f1=['FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x337d3c,_0x3a3d68){var _0x12091d=function(_0x2c35e5){while(--_0x2c35e5){_0x337d3c['push'](_0x337d3c['shift']());}};_0x12091d(++_0x3a3d68);}(_0x87f1,0x170));var _0x187f=function(_0x10ea73,_0x3b515a){_0x10ea73=_0x10ea73-0x0;var _0x5752e6=_0x87f1[_0x10ea73];return _0x5752e6;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x187f('0x0'))['db'][_0x187f('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x187f('0x2')](0x0);var events={'afterCreate':_0x187f('0x3'),'afterUpdate':_0x187f('0x4'),'afterDestroy':_0x187f('0x5')};function emitEvent(_0x233cda){return function(_0x5eafdc,_0x19e8fb,_0x4c6db8){FaxMessageEvents[_0x187f('0x6')](_0x233cda+':'+_0x5eafdc['id'],_0x5eafdc);FaxMessageEvents['emit'](_0x233cda,_0x5eafdc);_0x4c6db8(null);};}for(var e in events){if(events[_0x187f('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x187f('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 9e80718..aaddbcc 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 _0xd130=['define','FaxMessage','fax_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes'];(function(_0x557a08,_0x1fa5c5){var _0x58cd04=function(_0x1fbe1f){while(--_0x1fbe1f){_0x557a08['push'](_0x557a08['shift']());}};_0x58cd04(++_0x1fa5c5);}(_0xd130,0xa5));var _0x0d13=function(_0x363f82,_0x55cd98){_0x363f82=_0x363f82-0x0;var _0x28abd3=_0xd130[_0x363f82];return _0x28abd3;};'use strict';var _=require(_0x0d13('0x0'));var util=require(_0x0d13('0x1'));var logger=require(_0x0d13('0x2'))(_0x0d13('0x3'));var moment=require('moment');var BPromise=require(_0x0d13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d13('0x5'));var rimraf=require(_0x0d13('0x6'));var config=require(_0x0d13('0x7'));var attributes=require(_0x0d13('0x8'));module['exports']=function(_0x38de69,_0x4e66d9){return _0x38de69[_0x0d13('0x9')](_0x0d13('0xa'),attributes,{'tableName':_0x0d13('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x0d13('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a16e1,_0x3987b5,_0x963d8e){var _0x23a38b=_0x38de69[_0x0d13('0xd')];var _0x1bf051=_0x1a16e1['get']({'plain':!![]});if(_0x1bf051[_0x0d13('0xe')][_0x0d13('0xf')]()==='in'||_0x1bf051[_0x0d13('0xe')]['toLowerCase']()===_0x0d13('0x10')&&!_0x1bf051[_0x0d13('0x11')]&&!_[_0x0d13('0x12')](_0x1bf051[_0x0d13('0x13')])){_0x23a38b[_0x0d13('0x14')]['findOne']({'where':{'id':_0x1bf051[_0x0d13('0x15')]}})[_0x0d13('0x16')](function(_0x21aef7){if(_0x21aef7){_0x21aef7[_0x0d13('0x17')]({'lastMsgAt':_0x1bf051[_0x0d13('0x18')],'lastMsgDirection':_0x1bf051[_0x0d13('0xe')]['toLowerCase']()});}})[_0x0d13('0x19')](function(_0x3e478c){console[_0x0d13('0x1a')](_0x3e478c);});}_0x963d8e();}},'charset':_0x0d13('0x1b'),'collate':_0x0d13('0x1c')});}; \ No newline at end of file +var _0x117d=['isNil','UserId','FaxInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x117d,0xb2));var _0xd117=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0x117d[_0x32e649];return _0x14d386;};'use strict';var _=require(_0xd117('0x0'));var util=require('util');var logger=require(_0xd117('0x1'))(_0xd117('0x2'));var moment=require('moment');var BPromise=require(_0xd117('0x3'));var rp=require(_0xd117('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd117('0x5'));var config=require(_0xd117('0x6'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x320bb7,_0x209dda){return _0x320bb7[_0xd117('0x7')](_0xd117('0x8'),attributes,{'tableName':_0xd117('0x9'),'paranoid':![],'indexes':[{'name':_0xd117('0xa'),'fields':[_0xd117('0xb')],'type':_0xd117('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc88a5f,_0x27e126,_0x216ec2){var _0x4e44c6=_0x320bb7[_0xd117('0xd')];var _0x37eab0=_0xc88a5f['get']({'plain':!![]});if(_0x37eab0[_0xd117('0xe')][_0xd117('0xf')]()==='in'||_0x37eab0[_0xd117('0xe')][_0xd117('0xf')]()===_0xd117('0x10')&&!_0x37eab0[_0xd117('0x11')]&&!_[_0xd117('0x12')](_0x37eab0[_0xd117('0x13')])){_0x4e44c6[_0xd117('0x14')][_0xd117('0x15')]({'where':{'id':_0x37eab0['FaxInteractionId']}})[_0xd117('0x16')](function(_0x338ffe){if(_0x338ffe){_0x338ffe[_0xd117('0x17')]({'lastMsgAt':_0x37eab0['createdAt'],'lastMsgDirection':_0x37eab0[_0xd117('0xe')]['toLowerCase']()});}})[_0xd117('0x18')](function(_0x5eb3e6){console[_0xd117('0x19')](_0x5eb3e6);});}_0x216ec2();}},'charset':_0xd117('0x1a'),'collate':_0xd117('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 72e16fe..d2cbf43 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['create','body','raw','CreateFaxMessage','catch','FaxMessage','update','options','where','attributes','limit','UpdateFaxMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4a240b,_0x504520){var _0x246d52=function(_0x155bc4){while(--_0x155bc4){_0x4a240b['push'](_0x4a240b['shift']());}};_0x246d52(++_0x504520);}(_0xedd9,0xfc));var _0x9edd=function(_0x18a94c,_0x260606){_0x18a94c=_0x18a94c-0x0;var _0x5e21f2=_0xedd9[_0x18a94c];return _0x5e21f2;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});config['redis']=_[_0x9edd('0xc')](config['redis'],{'host':_0x9edd('0xd'),'port':0x18eb});var socket=require(_0x9edd('0xe'))(new Redis(config[_0x9edd('0xf')]));require(_0x9edd('0x10'))['register'](socket);function respondWithRpcPromise(_0x494a24,_0x5d2f90,_0x2076fc){return new BPromise(function(_0x138767,_0x523026){return client[_0x9edd('0x11')](_0x494a24,_0x2076fc)[_0x9edd('0x12')](function(_0x5b6c00){logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x5d2f90,_0x9edd('0x15'));logger[_0x9edd('0x16')](_0x9edd('0x17'),_0x5d2f90,_0x9edd('0x15'),JSON[_0x9edd('0x18')](_0x5b6c00));if(_0x5b6c00[_0x9edd('0x19')]){if(_0x5b6c00['error'][_0x9edd('0x1a')]===0x1f4){logger[_0x9edd('0x19')](_0x9edd('0x14'),_0x5d2f90,_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x523026(_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);}logger[_0x9edd('0x19')]('FaxMessage,\x20%s,\x20%s',_0x5d2f90,_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x138767(_0x5b6c00[_0x9edd('0x19')]['message']);}else{logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x5d2f90,_0x9edd('0x15'));_0x138767(_0x5b6c00['result'][_0x9edd('0x1b')]);}})['catch'](function(_0x2cdcef){logger[_0x9edd('0x19')]('FaxMessage,\x20%s,\x20%s',_0x5d2f90,_0x2cdcef);_0x523026(_0x2cdcef);});});}exports['CreateFaxMessage']=function(_0x45c3ab){var _0x50338f=this;return new Promise(function(_0x27a95a,_0x54a03f){return db['FaxMessage'][_0x9edd('0x1c')](_0x45c3ab[_0x9edd('0x1d')],{'raw':_0x45c3ab['options']?_0x45c3ab['options'][_0x9edd('0x1e')]===undefined?!![]:![]:!![]})[_0x9edd('0x12')](function(_0x477878){logger['info'](_0x9edd('0x1f'),_0x45c3ab);logger[_0x9edd('0x16')](_0x9edd('0x1f'),_0x45c3ab,JSON[_0x9edd('0x18')](_0x477878));_0x27a95a(_0x477878);})[_0x9edd('0x20')](function(_0x4c75d2){logger[_0x9edd('0x19')](_0x9edd('0x1f'),_0x4c75d2[_0x9edd('0x1b')],_0x45c3ab);_0x54a03f(_0x50338f[_0x9edd('0x19')](0x1f4,_0x4c75d2[_0x9edd('0x1b')]));});});};exports['UpdateFaxMessage']=function(_0x4b3d1b){var _0x3276ee=this;return new Promise(function(_0xfeca7b,_0x8d67aa){return db[_0x9edd('0x21')][_0x9edd('0x22')](_0x4b3d1b['body'],{'raw':_0x4b3d1b['options']?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3d1b[_0x9edd('0x23')]?_0x4b3d1b['options'][_0x9edd('0x24')]||null:null,'attributes':_0x4b3d1b[_0x9edd('0x23')]?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x25')]||null:null,'limit':_0x4b3d1b['options']?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x26')]||null:null})[_0x9edd('0x12')](function(_0x12c1bc){logger[_0x9edd('0x13')](_0x9edd('0x27'),_0x4b3d1b);logger[_0x9edd('0x16')](_0x9edd('0x27'),_0x4b3d1b,JSON[_0x9edd('0x18')](_0x12c1bc));_0xfeca7b(_0x12c1bc);})[_0x9edd('0x20')](function(_0x4fd03f){logger[_0x9edd('0x19')](_0x9edd('0x27'),_0x4fd03f[_0x9edd('0x1b')],_0x4b3d1b);_0x8d67aa(_0x3276ee[_0x9edd('0x19')](0x1f4,_0x4fd03f['message']));});});}; \ No newline at end of file +var _0x3e74=['result','catch','FaxMessage,\x20%s,\x20%s','CreateFaxMessage','create','body','options','raw','then','attributes','limit','UpdateFaxMessage','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xad2f38,_0x5d3b88){var _0x562e25=function(_0x3ef591){while(--_0x3ef591){_0xad2f38['push'](_0xad2f38['shift']());}};_0x562e25(++_0x5d3b88);}(_0x3e74,0x175));var _0x43e7=function(_0x5d8b16,_0xbf8c9b){_0x5d8b16=_0x5d8b16-0x0;var _0x239f3b=_0x3e74[_0x5d8b16];return _0x239f3b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});config['redis']=_[_0x43e7('0xa')](config[_0x43e7('0xb')],{'host':_0x43e7('0xc'),'port':0x18eb});var socket=require(_0x43e7('0xd'))(new Redis(config[_0x43e7('0xb')]));require('./faxMessage.socket')[_0x43e7('0xe')](socket);function respondWithRpcPromise(_0x554d44,_0x54948c,_0x39c8bd){return new BPromise(function(_0x4139c9,_0x5c34f4){return client[_0x43e7('0xf')](_0x554d44,_0x39c8bd)['then'](function(_0xf7c520){logger[_0x43e7('0x10')]('FaxMessage,\x20%s,\x20%s',_0x54948c,_0x43e7('0x11'));logger[_0x43e7('0x12')](_0x43e7('0x13'),_0x54948c,_0x43e7('0x11'),JSON['stringify'](_0xf7c520));if(_0xf7c520['error']){if(_0xf7c520[_0x43e7('0x14')][_0x43e7('0x15')]===0x1f4){logger[_0x43e7('0x14')]('FaxMessage,\x20%s,\x20%s',_0x54948c,_0xf7c520['error'][_0x43e7('0x16')]);return _0x5c34f4(_0xf7c520[_0x43e7('0x14')][_0x43e7('0x16')]);}logger[_0x43e7('0x14')]('FaxMessage,\x20%s,\x20%s',_0x54948c,_0xf7c520['error'][_0x43e7('0x16')]);return _0x4139c9(_0xf7c520[_0x43e7('0x14')][_0x43e7('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x54948c,_0x43e7('0x11'));_0x4139c9(_0xf7c520[_0x43e7('0x17')][_0x43e7('0x16')]);}})[_0x43e7('0x18')](function(_0x3776f5){logger[_0x43e7('0x14')](_0x43e7('0x19'),_0x54948c,_0x3776f5);_0x5c34f4(_0x3776f5);});});}exports[_0x43e7('0x1a')]=function(_0x2377a3){var _0xab63cf=this;return new Promise(function(_0x191dd5,_0x177ee1){return db['FaxMessage'][_0x43e7('0x1b')](_0x2377a3[_0x43e7('0x1c')],{'raw':_0x2377a3['options']?_0x2377a3[_0x43e7('0x1d')][_0x43e7('0x1e')]===undefined?!![]:![]:!![]})[_0x43e7('0x1f')](function(_0x28aacc){logger[_0x43e7('0x10')](_0x43e7('0x1a'),_0x2377a3);logger['debug'](_0x43e7('0x1a'),_0x2377a3,JSON['stringify'](_0x28aacc));_0x191dd5(_0x28aacc);})['catch'](function(_0x47204e){logger[_0x43e7('0x14')]('CreateFaxMessage',_0x47204e[_0x43e7('0x16')],_0x2377a3);_0x177ee1(_0xab63cf['error'](0x1f4,_0x47204e[_0x43e7('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x1af208){var _0x1b5f50=this;return new Promise(function(_0x20888b,_0x405f85){return db['FaxMessage']['update'](_0x1af208[_0x43e7('0x1c')],{'raw':_0x1af208['options']?_0x1af208[_0x43e7('0x1d')][_0x43e7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1af208[_0x43e7('0x1d')]?_0x1af208[_0x43e7('0x1d')]['where']||null:null,'attributes':_0x1af208[_0x43e7('0x1d')]?_0x1af208[_0x43e7('0x1d')][_0x43e7('0x20')]||null:null,'limit':_0x1af208[_0x43e7('0x1d')]?_0x1af208[_0x43e7('0x1d')][_0x43e7('0x21')]||null:null})[_0x43e7('0x1f')](function(_0x31b2a6){logger[_0x43e7('0x10')](_0x43e7('0x22'),_0x1af208);logger[_0x43e7('0x12')](_0x43e7('0x22'),_0x1af208,JSON[_0x43e7('0x23')](_0x31b2a6));_0x20888b(_0x31b2a6);})[_0x43e7('0x18')](function(_0x4bdb17){logger[_0x43e7('0x14')](_0x43e7('0x22'),_0x4bdb17[_0x43e7('0x16')],_0x1af208);_0x405f85(_0x1b5f50[_0x43e7('0x14')](0x1f4,_0x4bdb17[_0x43e7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 7e85d1c..0031386 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 _0x69ad=['./faxMessage.events','remove','update','emit','removeListener','faxMessage:'];(function(_0x1de8ad,_0x401abf){var _0x3100a1=function(_0x380b2){while(--_0x380b2){_0x1de8ad['push'](_0x1de8ad['shift']());}};_0x3100a1(++_0x401abf);}(_0x69ad,0x10e));var _0xd69a=function(_0x1b465d,_0x1b72e6){_0x1b465d=_0x1b465d-0x0;var _0x1bbe00=_0x69ad[_0x1b465d];return _0x1bbe00;};'use strict';var FaxMessageEvents=require(_0xd69a('0x0'));var events=['save',_0xd69a('0x1'),_0xd69a('0x2')];function createListener(_0x18528b,_0x21bd37){return function(_0xc81fa9){_0x21bd37[_0xd69a('0x3')](_0x18528b,_0xc81fa9);};}function removeListener(_0x2c2f24,_0xff2a20){return function(){FaxMessageEvents[_0xd69a('0x4')](_0x2c2f24,_0xff2a20);};}exports['register']=function(_0x3dd061){for(var _0x3a5227=0x0,_0x2b08b0=events['length'];_0x3a5227<_0x2b08b0;_0x3a5227++){var _0x1e0b4e=events[_0x3a5227];var _0x26c33e=createListener(_0xd69a('0x5')+_0x1e0b4e,_0x3dd061);FaxMessageEvents['on'](_0x1e0b4e,_0x26c33e);}}; \ No newline at end of file +var _0xb488=['emit','removeListener','register','length','faxMessage:','save','remove'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb488,0x6e));var _0x8b48=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb488[_0x59ee6f];return _0x4c0979;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x8b48('0x0'),_0x8b48('0x1'),'update'];function createListener(_0x3f99e2,_0x3e2d41){return function(_0x5a4ad6){_0x3e2d41[_0x8b48('0x2')](_0x3f99e2,_0x5a4ad6);};}function removeListener(_0x269df7,_0x403790){return function(){FaxMessageEvents[_0x8b48('0x3')](_0x269df7,_0x403790);};}exports[_0x8b48('0x4')]=function(_0x14280d){for(var _0x49a8df=0x0,_0x416a9f=events[_0x8b48('0x5')];_0x49a8df<_0x416a9f;_0x49a8df++){var _0x6cff9e=events[_0x49a8df];var _0x170b69=createListener(_0x8b48('0x6')+_0x6cff9e,_0x14280d);FaxMessageEvents['on'](_0x6cff9e,_0x170b69);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index f460a04..af93ff7 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5db8=['download','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id/download'];(function(_0x10f70d,_0x3c4f1f){var _0x4b62ea=function(_0x39a779){while(--_0x39a779){_0x10f70d['push'](_0x10f70d['shift']());}};_0x4b62ea(++_0x3c4f1f);}(_0x5db8,0xbb));var _0x85db=function(_0x1263cc,_0x34b0a6){_0x1263cc=_0x1263cc-0x0;var _0x4132a0=_0x5db8[_0x1263cc];return _0x4132a0;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require(_0x85db('0x2'));var timeout=require('connect-timeout');var express=require(_0x85db('0x3'));var router=express[_0x85db('0x4')]();var fs_extra=require(_0x85db('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85db('0x6'));var controller=require(_0x85db('0x7'));router[_0x85db('0x8')]('/',auth[_0x85db('0x9')](),controller['index']);router['get'](_0x85db('0xa'),auth[_0x85db('0x9')](),controller[_0x85db('0xb')]);router[_0x85db('0x8')]('/:id',auth[_0x85db('0x9')](),controller['show']);router[_0x85db('0x8')](_0x85db('0xc'),auth[_0x85db('0x9')](),controller[_0x85db('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x85db('0xe'),_0x85db('0xf')),controller['create']);router[_0x85db('0x10')]('/:id',auth[_0x85db('0x9')](),controller[_0x85db('0x11')]);router[_0x85db('0x10')](_0x85db('0x12'),auth[_0x85db('0x9')](),controller[_0x85db('0x13')]);router[_0x85db('0x10')](_0x85db('0x14'),auth[_0x85db('0x9')](),controller[_0x85db('0x15')]);router[_0x85db('0x16')](_0x85db('0x17'),auth[_0x85db('0x9')](),controller['destroy']);module[_0x85db('0x18')]=router; \ No newline at end of file +var _0xbf6e=['accept','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept'];(function(_0x281372,_0x2a5398){var _0x4957b6=function(_0x3918ed){while(--_0x3918ed){_0x281372['push'](_0x281372['shift']());}};_0x4957b6(++_0x2a5398);}(_0xbf6e,0x149));var _0xebf6=function(_0x110dc0,_0x3a6615){_0x110dc0=_0x110dc0-0x0;var _0x39aeb1=_0xbf6e[_0x110dc0];return _0x39aeb1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var fs_extra=require(_0xebf6('0x4'));var auth=require(_0xebf6('0x5'));var interaction=require(_0xebf6('0x6'));var config=require('../../config/environment');var controller=require(_0xebf6('0x7'));router[_0xebf6('0x8')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0x8')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['describe']);router[_0xebf6('0x8')](_0xebf6('0xc'),auth[_0xebf6('0x9')](),controller['show']);router[_0xebf6('0x8')](_0xebf6('0xd'),auth['isAuthenticated'](),controller[_0xebf6('0xe')]);router[_0xebf6('0xf')]('/',auth[_0xebf6('0x9')](),interaction[_0xebf6('0x10')](_0xebf6('0x11'),_0xebf6('0x12')),controller['create']);router[_0xebf6('0x13')](_0xebf6('0xc'),auth['isAuthenticated'](),controller[_0xebf6('0x14')]);router[_0xebf6('0x13')](_0xebf6('0x15'),auth[_0xebf6('0x9')](),controller[_0xebf6('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xebf6('0x17')]);router[_0xebf6('0x18')]('/:id',auth[_0xebf6('0x9')](),controller[_0xebf6('0x19')]);module[_0xebf6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 4c2984a..7567593 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 _0x57ca=['exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x261535,_0x3dbc5d){var _0x2dc9dc=function(_0x4ed06f){while(--_0x4ed06f){_0x261535['push'](_0x261535['shift']());}};_0x2dc9dc(++_0x3dbc5d);}(_0x57ca,0x108));var _0xa57c=function(_0x4f24ec,_0x552826){_0x4f24ec=_0x4f24ec-0x0;var _0x11926e=_0x57ca[_0x4f24ec];return _0x11926e;};'use strict';var Sequelize=require('sequelize');module[_0xa57c('0x0')]={'name':{'type':Sequelize[_0xa57c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa57c('0x1')]},'timeout':{'type':Sequelize[_0xa57c('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa57c('0x3')](_0xa57c('0x4'),_0xa57c('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa57c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x39d2=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x24a007,_0x135279){var _0x5175d4=function(_0x223792){while(--_0x223792){_0x24a007['push'](_0x24a007['shift']());}};_0x5175d4(++_0x135279);}(_0x39d2,0xf5));var _0x239d=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x39d2[_0x4702ee];return _0x62ca7d;};'use strict';var Sequelize=require(_0x239d('0x0'));module['exports']={'name':{'type':Sequelize[_0x239d('0x1')],'unique':_0x239d('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x239d('0x1')]},'timeout':{'type':Sequelize[_0x239d('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x239d('0x4')](_0x239d('0x5'),_0x239d('0x6'),_0x239d('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x239d('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index d98e268..cc72864 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 _0xfc4a=['nolimit','map','agent','updatedAt','format','%s/%s','SIP','faxPause','createdAt','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','userFaxQueue:save','removeTeams','select','tq.TeamId','from','team_has_fax_queues','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','squel','jsforce','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','end','error','name','FaxQueue','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserFaxQueue'];(function(_0x25ef27,_0x150e3a){var _0x21917d=function(_0x27cdaa){while(--_0x27cdaa){_0x25ef27['push'](_0x25ef27['shift']());}};_0x21917d(++_0x150e3a);}(_0xfc4a,0x1b7));var _0xafc4=function(_0x3a7847,_0x29f52b){_0x3a7847=_0x3a7847-0x0;var _0xa64ad8=_0xfc4a[_0x3a7847];return _0xa64ad8;};'use strict';var emlformat=require(_0xafc4('0x0'));var rimraf=require(_0xafc4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xafc4('0x2'));var rp=require(_0xafc4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xafc4('0x4'));var util=require(_0xafc4('0x5'));var path=require(_0xafc4('0x6'));var sox=require('sox');var csv=require(_0xafc4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafc4('0x8'));var squel=require(_0xafc4('0x9'));var crypto=require('crypto');var jsforce=require(_0xafc4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xafc4('0x7'));var querystring=require('querystring');var Papa=require(_0xafc4('0xb'));var Redis=require('ioredis');var authService=require(_0xafc4('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xafc4('0xd'))(_0xafc4('0xe'));var utils=require(_0xafc4('0xf'));var config=require(_0xafc4('0x10'));var licenseUtil=require(_0xafc4('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xafc4('0x12')](config[_0xafc4('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xafc4('0x14'))(new Redis(config['redis']));require(_0xafc4('0x15'))[_0xafc4('0x16')](socket);function respondWithStatusCode(_0x1d5369,_0x4bc8ad){_0x4bc8ad=_0x4bc8ad||0xcc;return function(_0x492d81){if(_0x492d81){return _0x1d5369[_0xafc4('0x17')](_0x4bc8ad);}return _0x1d5369[_0xafc4('0x18')](_0x4bc8ad)['end']();};}function respondWithResult(_0x4a6e22,_0x2bf1a9){_0x2bf1a9=_0x2bf1a9||0xc8;return function(_0x544788){if(_0x544788){return _0x4a6e22[_0xafc4('0x18')](_0x2bf1a9)[_0xafc4('0x19')](_0x544788);}};}function respondWithFilteredResult(_0x4fd2ee,_0xe2e7ab){return function(_0xa31b7d){if(_0xa31b7d){var _0x289d5d=typeof _0xe2e7ab['offset']===_0xafc4('0x1a')&&typeof _0xe2e7ab[_0xafc4('0x1b')]===_0xafc4('0x1a');var _0x3eca30=_0xa31b7d['count'];var _0x581c5a=_0x289d5d?0x0:_0xe2e7ab['offset'];var _0x161541=_0x289d5d?_0xa31b7d[_0xafc4('0x1c')]:_0xe2e7ab[_0xafc4('0x1d')]+_0xe2e7ab[_0xafc4('0x1b')];var _0x4a6cd3;if(_0x161541>=_0x3eca30){_0x161541=_0x3eca30;_0x4a6cd3=0xc8;}else{_0x4a6cd3=0xce;}_0x4fd2ee[_0xafc4('0x18')](_0x4a6cd3);return _0x4fd2ee[_0xafc4('0x1e')](_0xafc4('0x1f'),_0x581c5a+'-'+_0x161541+'/'+_0x3eca30)[_0xafc4('0x19')](_0xa31b7d);}return null;};}function patchUpdates(_0x596a79){return function(_0x5a09ee){try{jsonpatch[_0xafc4('0x20')](_0x5a09ee,_0x596a79,!![]);}catch(_0x5a1d6b){return BPromise[_0xafc4('0x21')](_0x5a1d6b);}return _0x5a09ee[_0xafc4('0x22')]();};}function saveUpdates(_0x581642,_0x961c81){return function(_0x1a94ba){if(_0x1a94ba){return _0x1a94ba[_0xafc4('0x23')](_0x581642)[_0xafc4('0x24')](function(_0x2e3c1c){return _0x2e3c1c;});}return null;};}function removeEntity(_0x4be745,_0x3544ee){return function(_0x26c42e){if(_0x26c42e){return _0x26c42e[_0xafc4('0x25')]()[_0xafc4('0x24')](function(){var _0x45bf5c=_0x26c42e['get']({'plain':!![]});var _0x2b7473=_0xafc4('0x26');return db['UserProfileResource'][_0xafc4('0x25')]({'where':{'type':_0x2b7473,'resourceId':_0x45bf5c['id']}})[_0xafc4('0x24')](function(){return _0x26c42e;});})['then'](function(){_0x4be745[_0xafc4('0x18')](0xcc)[_0xafc4('0x27')]();});}};}function handleEntityNotFound(_0x3aab5c,_0x422d4c){return function(_0xe9878){if(!_0xe9878){_0x3aab5c[_0xafc4('0x17')](0x194);}return _0xe9878;};}function handleError(_0x557cc2,_0x54d517){_0x54d517=_0x54d517||0x1f4;return function(_0x17837c){logger[_0xafc4('0x28')](_0x17837c['stack']);if(_0x17837c[_0xafc4('0x29')]){delete _0x17837c['name'];}_0x557cc2[_0xafc4('0x18')](_0x54d517)['send'](_0x17837c);};}exports['index']=function(_0x5be080,_0x25712b){var _0x41323a={},_0x209598={},_0x1c2dde={'count':0x0,'rows':[]};var _0x127a73=_['map'](db[_0xafc4('0x2a')]['rawAttributes'],function(_0x371a9e){return{'name':_0x371a9e[_0xafc4('0x2b')],'type':_0x371a9e['type'][_0xafc4('0x2c')]};});_0x209598[_0xafc4('0x2d')]=_['map'](_0x127a73,_0xafc4('0x29'));_0x209598[_0xafc4('0x2e')]=_[_0xafc4('0x2f')](_0x5be080[_0xafc4('0x2e')]);_0x209598[_0xafc4('0x30')]=_['intersection'](_0x209598[_0xafc4('0x2d')],_0x209598[_0xafc4('0x2e')]);_0x41323a['attributes']=_[_0xafc4('0x31')](_0x209598[_0xafc4('0x2d')],qs[_0xafc4('0x32')](_0x5be080[_0xafc4('0x2e')][_0xafc4('0x32')]));_0x41323a[_0xafc4('0x33')]=_0x41323a[_0xafc4('0x33')][_0xafc4('0x34')]?_0x41323a['attributes']:_0x209598[_0xafc4('0x2d')];if(!_0x5be080[_0xafc4('0x2e')][_0xafc4('0x35')]('nolimit')){_0x41323a[_0xafc4('0x1b')]=qs[_0xafc4('0x1b')](_0x5be080[_0xafc4('0x2e')][_0xafc4('0x1b')]);_0x41323a[_0xafc4('0x1d')]=qs[_0xafc4('0x1d')](_0x5be080[_0xafc4('0x2e')][_0xafc4('0x1d')]);}_0x41323a[_0xafc4('0x36')]=qs[_0xafc4('0x37')](_0x5be080[_0xafc4('0x2e')][_0xafc4('0x37')]);_0x41323a[_0xafc4('0x38')]=qs['filters'](_[_0xafc4('0x39')](_0x5be080['query'],_0x209598[_0xafc4('0x30')]),_0x127a73);if(_0x5be080[_0xafc4('0x2e')][_0xafc4('0x3a')]){_0x41323a[_0xafc4('0x38')]=_[_0xafc4('0x3b')](_0x41323a['where'],{'$or':_['map'](_0x127a73,function(_0x7c96e){if(_0x7c96e['type']!=='VIRTUAL'){var _0x4ddb42={};_0x4ddb42[_0x7c96e[_0xafc4('0x29')]]={'$like':'%'+_0x5be080[_0xafc4('0x2e')][_0xafc4('0x3a')]+'%'};return _0x4ddb42;}})});}_0x41323a=_[_0xafc4('0x3b')]({},_0x41323a,_0x5be080[_0xafc4('0x3c')]);var _0x28b479={'where':_0x41323a['where']};return db[_0xafc4('0x2a')][_0xafc4('0x1c')](_0x28b479)['then'](function(_0x5eb7ca){_0x1c2dde[_0xafc4('0x1c')]=_0x5eb7ca;if(_0x5be080[_0xafc4('0x2e')]['includeAll']){_0x41323a['include']=[{'all':!![]}];}return db[_0xafc4('0x2a')][_0xafc4('0x3d')](_0x41323a);})['then'](function(_0x2d4551){_0x1c2dde[_0xafc4('0x3e')]=_0x2d4551;return _0x1c2dde;})[_0xafc4('0x24')](respondWithFilteredResult(_0x25712b,_0x41323a))[_0xafc4('0x3f')](handleError(_0x25712b,null));};exports[_0xafc4('0x40')]=function(_0x1a4600,_0xd816bb){var _0x338b41={'raw':!![],'where':{'id':_0x1a4600['params']['id']}},_0x3ee334={};_0x3ee334[_0xafc4('0x2d')]=_['keys'](db['FaxQueue'][_0xafc4('0x41')]);_0x3ee334[_0xafc4('0x2e')]=_[_0xafc4('0x2f')](_0x1a4600[_0xafc4('0x2e')]);_0x3ee334[_0xafc4('0x30')]=_['intersection'](_0x3ee334[_0xafc4('0x2d')],_0x3ee334['query']);_0x338b41[_0xafc4('0x33')]=_['intersection'](_0x3ee334[_0xafc4('0x2d')],qs[_0xafc4('0x32')](_0x1a4600[_0xafc4('0x2e')][_0xafc4('0x32')]));_0x338b41['attributes']=_0x338b41[_0xafc4('0x33')]['length']?_0x338b41[_0xafc4('0x33')]:_0x3ee334['model'];if(_0x1a4600[_0xafc4('0x2e')][_0xafc4('0x42')]){_0x338b41['include']=[{'all':!![]}];}_0x338b41=_[_0xafc4('0x3b')]({},_0x338b41,_0x1a4600[_0xafc4('0x3c')]);return db[_0xafc4('0x2a')][_0xafc4('0x43')](_0x338b41)[_0xafc4('0x24')](handleEntityNotFound(_0xd816bb,null))[_0xafc4('0x24')](respondWithResult(_0xd816bb,null))['catch'](handleError(_0xd816bb,null));};exports['create']=function(_0x24cb3a,_0xd6a92c){return db[_0xafc4('0x2a')][_0xafc4('0x44')](_0x24cb3a[_0xafc4('0x45')],{})['then'](function(_0x336a56){var _0x369463=_0x24cb3a['user'][_0xafc4('0x46')]({'plain':!![]});if(!_0x369463)throw new Error(_0xafc4('0x47'));if(_0x369463[_0xafc4('0x48')]===_0xafc4('0x49')){var _0x252b5d=_0x336a56[_0xafc4('0x46')]({'plain':!![]});var _0x530c8d=_0xafc4('0x26');return db['UserProfileSection'][_0xafc4('0x43')]({'where':{'name':_0x530c8d,'userProfileId':_0x369463[_0xafc4('0x4a')]},'raw':!![]})[_0xafc4('0x24')](function(_0x4fcc7f){if(_0x4fcc7f&&_0x4fcc7f[_0xafc4('0x4b')]===0x0){return db['UserProfileResource'][_0xafc4('0x44')]({'name':_0x252b5d['name'],'resourceId':_0x252b5d['id'],'type':_0x4fcc7f[_0xafc4('0x29')],'sectionId':_0x4fcc7f['id']},{})['then'](function(){return _0x336a56;});}else{return _0x336a56;}})[_0xafc4('0x3f')](function(_0x1372b9){logger[_0xafc4('0x28')](_0xafc4('0x4c'),_0x1372b9);throw _0x1372b9;});}return _0x336a56;})[_0xafc4('0x24')](respondWithResult(_0xd6a92c,0xc9))[_0xafc4('0x3f')](handleError(_0xd6a92c,null));};exports[_0xafc4('0x23')]=function(_0x14bcf6,_0x514d61){if(_0x14bcf6['body']['id']){delete _0x14bcf6[_0xafc4('0x45')]['id'];}return db[_0xafc4('0x2a')][_0xafc4('0x43')]({'where':{'id':_0x14bcf6[_0xafc4('0x4d')]['id']}})[_0xafc4('0x24')](handleEntityNotFound(_0x514d61,null))[_0xafc4('0x24')](saveUpdates(_0x14bcf6[_0xafc4('0x45')],null))['then'](respondWithResult(_0x514d61,null))[_0xafc4('0x3f')](handleError(_0x514d61,null));};exports['destroy']=function(_0x35d0de,_0x2bde23){return db['FaxQueue'][_0xafc4('0x43')]({'where':{'id':_0x35d0de['params']['id']}})[_0xafc4('0x24')](handleEntityNotFound(_0x2bde23,null))[_0xafc4('0x24')](removeEntity(_0x2bde23,null))['catch'](handleError(_0x2bde23,null));};exports[_0xafc4('0x4e')]=function(_0x5ac039,_0x911407){return db[_0xafc4('0x2a')][_0xafc4('0x4e')]()[_0xafc4('0x24')](respondWithResult(_0x911407,null))[_0xafc4('0x3f')](handleError(_0x911407,null));};exports[_0xafc4('0x4f')]=function(_0x3d2661,_0x1a6957,_0x4f3e58){var _0x28b75f={'raw':!![],'where':{}},_0x535218={},_0x405e06;return db[_0xafc4('0x2a')]['findOne']({'where':{'id':_0x3d2661[_0xafc4('0x4d')]['id']}})[_0xafc4('0x24')](handleEntityNotFound(_0x1a6957,null))[_0xafc4('0x24')](function(_0x57b8d9){if(_0x57b8d9){_0x405e06=_0x57b8d9[_0xafc4('0x46')]({'plain':!![]});_0x535218[_0xafc4('0x2d')]=_[_0xafc4('0x2f')](db[_0xafc4('0x50')][_0xafc4('0x41')]);_0x535218[_0xafc4('0x2e')]=_[_0xafc4('0x2f')](_0x3d2661[_0xafc4('0x2e')]);_0x535218[_0xafc4('0x30')]=_[_0xafc4('0x31')](_0x535218['model'],_0x535218[_0xafc4('0x2e')]);_0x28b75f[_0xafc4('0x33')]=_['intersection'](_0x535218[_0xafc4('0x2d')],qs[_0xafc4('0x32')](_0x3d2661[_0xafc4('0x2e')][_0xafc4('0x32')]));_0x28b75f[_0xafc4('0x33')]=_0x28b75f[_0xafc4('0x33')][_0xafc4('0x34')]?_0x28b75f['attributes']:_0x535218[_0xafc4('0x2d')];if(!_0x3d2661[_0xafc4('0x2e')]['hasOwnProperty'](_0xafc4('0x51'))){_0x28b75f[_0xafc4('0x1b')]=qs[_0xafc4('0x1b')](_0x3d2661['query'][_0xafc4('0x1b')]);_0x28b75f[_0xafc4('0x1d')]=qs[_0xafc4('0x1d')](_0x3d2661[_0xafc4('0x2e')][_0xafc4('0x1d')]);}_0x28b75f['order']=qs[_0xafc4('0x37')](_0x3d2661[_0xafc4('0x2e')][_0xafc4('0x37')]);_0x28b75f[_0xafc4('0x38')]=qs[_0xafc4('0x30')](_[_0xafc4('0x39')](_0x3d2661['query'],_0x535218[_0xafc4('0x30')]));_0x28b75f[_0xafc4('0x38')]['FaxQueueId']=_0x57b8d9['id'];if(_0x3d2661[_0xafc4('0x2e')][_0xafc4('0x3a')]){_0x28b75f[_0xafc4('0x38')]=_[_0xafc4('0x3b')](_0x28b75f[_0xafc4('0x38')],{'$or':_[_0xafc4('0x52')](_0x28b75f['attributes'],function(_0x4aa801){var _0x163ecd={};_0x163ecd[_0x4aa801]={'$like':'%'+_0x3d2661[_0xafc4('0x2e')][_0xafc4('0x3a')]+'%'};return _0x163ecd;})});}_0x28b75f=_[_0xafc4('0x3b')]({},_0x28b75f,_0x3d2661[_0xafc4('0x3c')]);return db['UserFaxQueue'][_0xafc4('0x3d')](_0x28b75f);}})[_0xafc4('0x24')](function(_0x2f8aea){if(_0x2f8aea){return db['User']['findAndCountAll']({'where':{'id':_[_0xafc4('0x52')](_0x2f8aea,'UserId'),'role':_0xafc4('0x53')},'attributes':['id',_0xafc4('0x29'),'faxPause',_0xafc4('0x54'),'createdAt']});}})['then'](function(_0x39a184){if(_0x39a184){return{'count':_0x39a184['count'],'rows':_[_0xafc4('0x52')](_0x39a184[_0xafc4('0x3e')],function(_0x211741){return{'membername':_0x211741['name'],'UserId':_0x211741['id'],'queue_name':_0x405e06[_0xafc4('0x29')],'FaxQueueId':_0x405e06['id'],'interface':util[_0xafc4('0x55')](_0xafc4('0x56'),_0xafc4('0x57'),_0x211741[_0xafc4('0x29')]),'penalty':0x0,'paused':_0x211741[_0xafc4('0x58')],'createdAt':_0x211741[_0xafc4('0x59')],'updatedAt':_0x211741[_0xafc4('0x54')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xafc4('0x24')](respondWithFilteredResult(_0x1a6957,_0x28b75f))[_0xafc4('0x3f')](handleError(_0x1a6957,null));};exports[_0xafc4('0x5a')]=function(_0x5d0be0,_0x37b43c,_0x4e7c30){var _0x32a201={};var _0x43627d={};var _0x24aefd;var _0x4d1a32;return db[_0xafc4('0x2a')][_0xafc4('0x5b')]({'where':{'id':_0x5d0be0[_0xafc4('0x4d')]['id']}})[_0xafc4('0x24')](handleEntityNotFound(_0x37b43c,null))[_0xafc4('0x24')](function(_0x851799){if(_0x851799){_0x24aefd=_0x851799;_0x43627d['model']=_[_0xafc4('0x2f')](db[_0xafc4('0x5c')][_0xafc4('0x41')]);_0x43627d[_0xafc4('0x2e')]=_['keys'](_0x5d0be0['query']);_0x43627d[_0xafc4('0x30')]=_[_0xafc4('0x31')](_0x43627d[_0xafc4('0x2d')],_0x43627d[_0xafc4('0x2e')]);_0x32a201[_0xafc4('0x33')]=_[_0xafc4('0x31')](_0x43627d[_0xafc4('0x2d')],qs[_0xafc4('0x32')](_0x5d0be0[_0xafc4('0x2e')][_0xafc4('0x32')]));_0x32a201[_0xafc4('0x33')]=_0x32a201[_0xafc4('0x33')][_0xafc4('0x34')]?_0x32a201[_0xafc4('0x33')]:_0x43627d[_0xafc4('0x2d')];_0x32a201['order']=qs[_0xafc4('0x37')](_0x5d0be0[_0xafc4('0x2e')][_0xafc4('0x37')]);_0x32a201[_0xafc4('0x38')]=qs[_0xafc4('0x30')](_[_0xafc4('0x39')](_0x5d0be0['query'],_0x43627d['filters']));if(_0x5d0be0[_0xafc4('0x2e')][_0xafc4('0x3a')]){_0x32a201[_0xafc4('0x38')]=_[_0xafc4('0x3b')](_0x32a201[_0xafc4('0x38')],{'$or':_[_0xafc4('0x52')](_0x32a201[_0xafc4('0x33')],function(_0x339878){var _0x4f3559={};_0x4f3559[_0x339878]={'$like':'%'+_0x5d0be0[_0xafc4('0x2e')]['filter']+'%'};return _0x4f3559;})});}_0x32a201=_[_0xafc4('0x3b')]({},_0x32a201,_0x5d0be0['options']);return _0x24aefd[_0xafc4('0x5a')](_0x32a201);}})[_0xafc4('0x24')](function(_0x373326){if(_0x373326){_0x4d1a32=_0x373326[_0xafc4('0x34')];if(!_0x5d0be0[_0xafc4('0x2e')][_0xafc4('0x35')](_0xafc4('0x51'))){_0x32a201[_0xafc4('0x1b')]=qs[_0xafc4('0x1b')](_0x5d0be0[_0xafc4('0x2e')][_0xafc4('0x1b')]);_0x32a201['offset']=qs['offset'](_0x5d0be0[_0xafc4('0x2e')][_0xafc4('0x1d')]);}return _0x24aefd[_0xafc4('0x5a')](_0x32a201);}})[_0xafc4('0x24')](function(_0x5d710e){if(_0x5d710e){return _0x5d710e?{'count':_0x4d1a32,'rows':_0x5d710e}:null;}})[_0xafc4('0x24')](respondWithResult(_0x37b43c,null))[_0xafc4('0x3f')](handleError(_0x37b43c,null));};exports[_0xafc4('0x5d')]=function(_0x3bfe08,_0x3d76d9,_0x2a301a){var _0x22a9b7=_0x3bfe08[_0xafc4('0x45')][_0xafc4('0x5e')];return db['Team'][_0xafc4('0x3d')]({'where':{'id':_0x22a9b7},'attributes':['id'],'include':[{'model':db[_0xafc4('0x5f')],'as':_0xafc4('0x60'),'attributes':['id',_0xafc4('0x29'),_0xafc4('0x61'),_0xafc4('0x62'),_0xafc4('0x63')],'raw':!![]}]})[_0xafc4('0x24')](function(_0x12b043){if(_0x12b043){var _0x1597bb=_[_0xafc4('0x64')](_0x12b043,function(_0x136ddb){var _0x38a88c=_0x136ddb[_0xafc4('0x46')]({'plain':!![]});return _0x38a88c['Agents'];});return db[_0xafc4('0x2a')]['find']({'where':{'id':_0x3bfe08[_0xafc4('0x4d')]['id']}})[_0xafc4('0x24')](function(_0x55935e){return db[_0xafc4('0x65')][_0xafc4('0x66')](function(_0x4671cc){return _0x55935e['addTeams'](_0x22a9b7,{'transaction':_0x4671cc})['then'](function(){return BPromise[_0xafc4('0x67')](_0x1597bb,function(_0x1b4ca2){return db[_0xafc4('0x50')]['findOrCreate']({'where':{'UserId':_0x1b4ca2['id'],'FaxQueueId':_0x3bfe08[_0xafc4('0x4d')]['id']},'transaction':_0x4671cc});});})['then'](function(){_0x1597bb[_0xafc4('0x68')](function(_0xbb4079){socket['emit'](_0xafc4('0x69'),{'UserId':_0xbb4079['id'],'FaxQueueId':_0x55935e['id']});});});});});}})[_0xafc4('0x24')](respondWithStatusCode(_0x3d76d9,null))[_0xafc4('0x3f')](handleError(_0x3d76d9,null));};exports[_0xafc4('0x6a')]=function(_0x4317f7,_0x9badcf,_0x2a1f7a){return db['Team']['findAll']({'where':{'id':_0x4317f7[_0xafc4('0x2e')][_0xafc4('0x5e')]},'attributes':['id'],'include':[{'model':db[_0xafc4('0x5f')],'as':_0xafc4('0x60'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x9badcf,null))[_0xafc4('0x24')](function(_0x585042){var _0x3fde8=_[_0xafc4('0x52')](_0x585042,'id');var _0x345617=[];var _0x3e5bd3=[];var _0xdab64c=squel[_0xafc4('0x6b')]();_0xdab64c['field'](_0xafc4('0x6c'))[_0xafc4('0x6d')](_0xafc4('0x6e'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xafc4('0x38')](_0xafc4('0x6f'),_0x4317f7['params']['id']);for(var _0x53277c=0x0;_0x53277c<_0x585042['length'];_0x53277c+=0x1){let _0x5b7d20=_0x585042[_0x53277c];for(var _0x563511=0x0;_0x563511<_0x5b7d20[_0xafc4('0x60')][_0xafc4('0x34')];_0x563511+=0x1){let _0x1a901d=_0x5b7d20[_0xafc4('0x60')][_0x563511];var _0x281445=_0xdab64c[_0xafc4('0x70')]();_0x281445[_0xafc4('0x38')](_0xafc4('0x71'),_0x1a901d['id']);_0x3e5bd3[_0xafc4('0x72')](db[_0xafc4('0x65')]['query'](_0x281445[_0xafc4('0x73')](),{'type':db['sequelize'][_0xafc4('0x74')][_0xafc4('0x75')]})['then'](function(_0x286d36){if(_0x286d36[_0xafc4('0x34')]===0x1){return _0x1a901d['id'];}else{var _0x364d0f=_['every'](_[_0xafc4('0x52')](_0x286d36,_0xafc4('0x76')),function(_0x2be97c){return _[_0xafc4('0x77')](_0x3fde8,_0x2be97c);});if(_0x364d0f){return _0x1a901d['id'];}}}));}}return BPromise[_0xafc4('0x78')](_0x3e5bd3)['then'](function(_0x4face2){_0x345617=_(_0x345617)[_0xafc4('0x79')](_0x4face2)[_0xafc4('0x7a')]()['value']();return db['FaxQueue'][_0xafc4('0x43')]({'where':{'id':_0x4317f7[_0xafc4('0x4d')]['id']}})[_0xafc4('0x24')](function(_0x570ac9){return db['sequelize']['transaction'](function(_0x4767b7){return _0x570ac9[_0xafc4('0x6a')](_0x4317f7[_0xafc4('0x2e')][_0xafc4('0x5e')],{'transaction':_0x4767b7})[_0xafc4('0x24')](function(){if(!_['isEmpty'](_0x345617)){return _0x570ac9[_0xafc4('0x7b')](_0x345617,{'transaction':_0x4767b7});}})[_0xafc4('0x24')](function(){_0x345617['forEach'](function(_0x3a1e43){socket['emit'](_0xafc4('0x7c'),{'UserId':_0x3a1e43,'FaxQueueId':_0x570ac9['id']});});});});});});})[_0xafc4('0x24')](respondWithStatusCode(_0x9badcf,null))['catch'](handleError(_0x9badcf,null));};exports[_0xafc4('0x7d')]=function(_0x3fdc31,_0x13dcf1,_0x46782f){return db[_0xafc4('0x2a')][_0xafc4('0x43')]({'where':{'id':_0x3fdc31[_0xafc4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x13dcf1,null))['then'](function(_0xb18717){if(_0xb18717){return _0xb18717[_0xafc4('0x7d')](_0x3fdc31['body'][_0xafc4('0x5e')],_[_0xafc4('0x7e')](_0x3fdc31[_0xafc4('0x45')],[_0xafc4('0x5e'),'id'])||{})['spread'](function(_0x5ea20a){for(var _0x1b9c14=0x0;_0x1b9c14<_0x3fdc31[_0xafc4('0x45')]['ids'][_0xafc4('0x34')];_0x1b9c14+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x3fdc31['body'][_0xafc4('0x5e')][_0x1b9c14]),'FaxQueueId':Number(_0x3fdc31['params']['id'])});}return _0x5ea20a;});}})['then'](respondWithResult(_0x13dcf1,null))[_0xafc4('0x3f')](handleError(_0x13dcf1,null));};exports[_0xafc4('0x7b')]=function(_0xc49d73,_0x16d287,_0x2481b5){return db[_0xafc4('0x2a')][_0xafc4('0x43')]({'where':{'id':_0xc49d73[_0xafc4('0x4d')]['id']}})[_0xafc4('0x24')](handleEntityNotFound(_0x16d287,null))[_0xafc4('0x24')](function(_0x16bbfd){if(_0x16bbfd){return _0x16bbfd[_0xafc4('0x7b')](_0xc49d73[_0xafc4('0x2e')]['ids'])['then'](function(){if(_[_0xafc4('0x7f')](_0xc49d73[_0xafc4('0x2e')][_0xafc4('0x5e')])){for(var _0xa6dcf3=0x0;_0xa6dcf3<_0xc49d73['query'][_0xafc4('0x5e')][_0xafc4('0x34')];_0xa6dcf3+=0x1){socket[_0xafc4('0x80')](_0xafc4('0x7c'),{'UserId':Number(_0xc49d73['query']['ids'][_0xa6dcf3]),'FaxQueueId':Number(_0xc49d73[_0xafc4('0x4d')]['id'])});}}else{socket[_0xafc4('0x80')](_0xafc4('0x7c'),{'UserId':Number(_0xc49d73[_0xafc4('0x2e')][_0xafc4('0x5e')]),'FaxQueueId':Number(_0xc49d73[_0xafc4('0x4d')]['id'])});}});}})[_0xafc4('0x24')](respondWithStatusCode(_0x16d287,null))['catch'](handleError(_0x16d287,null));};exports[_0xafc4('0x81')]=function(_0x43a68f,_0x24707a,_0x1f4415){var _0x3812a7={};var _0x1e417f={};var _0x5c611f;var _0x93fee6;return db[_0xafc4('0x2a')][_0xafc4('0x5b')]({'where':{'id':_0x43a68f[_0xafc4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x24707a,null))['then'](function(_0x28e2c9){if(_0x28e2c9){_0x5c611f=_0x28e2c9;_0x1e417f[_0xafc4('0x2d')]=_['keys'](db[_0xafc4('0x5f')][_0xafc4('0x41')]);_0x1e417f[_0xafc4('0x2e')]=_['keys'](_0x43a68f[_0xafc4('0x2e')]);_0x1e417f[_0xafc4('0x30')]=_[_0xafc4('0x31')](_0x1e417f[_0xafc4('0x2d')],_0x1e417f[_0xafc4('0x2e')]);_0x3812a7[_0xafc4('0x33')]=_[_0xafc4('0x31')](_0x1e417f['model'],qs[_0xafc4('0x32')](_0x43a68f[_0xafc4('0x2e')][_0xafc4('0x32')]));_0x3812a7[_0xafc4('0x33')]=_0x3812a7[_0xafc4('0x33')]['length']?_0x3812a7[_0xafc4('0x33')]:_0x1e417f[_0xafc4('0x2d')];_0x3812a7[_0xafc4('0x36')]=qs[_0xafc4('0x37')](_0x43a68f[_0xafc4('0x2e')]['sort']);_0x3812a7[_0xafc4('0x38')]=qs[_0xafc4('0x30')](_[_0xafc4('0x39')](_0x43a68f[_0xafc4('0x2e')],_0x1e417f[_0xafc4('0x30')]));if(_0x43a68f['query'][_0xafc4('0x3a')]){_0x3812a7[_0xafc4('0x38')]=_[_0xafc4('0x3b')](_0x3812a7[_0xafc4('0x38')],{'$or':_[_0xafc4('0x52')](_0x3812a7[_0xafc4('0x33')],function(_0x27db12){var _0x373161={};_0x373161[_0x27db12]={'$like':'%'+_0x43a68f[_0xafc4('0x2e')][_0xafc4('0x3a')]+'%'};return _0x373161;})});}_0x3812a7=_[_0xafc4('0x3b')]({},_0x3812a7,_0x43a68f[_0xafc4('0x3c')]);return _0x5c611f[_0xafc4('0x81')](_0x3812a7);}})[_0xafc4('0x24')](function(_0x1528ef){if(_0x1528ef){_0x93fee6=_0x1528ef[_0xafc4('0x34')];if(!_0x43a68f[_0xafc4('0x2e')][_0xafc4('0x35')](_0xafc4('0x51'))){_0x3812a7[_0xafc4('0x1b')]=qs['limit'](_0x43a68f[_0xafc4('0x2e')]['limit']);_0x3812a7[_0xafc4('0x1d')]=qs[_0xafc4('0x1d')](_0x43a68f['query'][_0xafc4('0x1d')]);}return _0x5c611f[_0xafc4('0x81')](_0x3812a7);}})[_0xafc4('0x24')](function(_0x7cf01){if(_0x7cf01){return _0x7cf01?{'count':_0x93fee6,'rows':_0x7cf01}:null;}})['then'](respondWithResult(_0x24707a,null))[_0xafc4('0x3f')](handleError(_0x24707a,null));}; \ No newline at end of file +var _0xd479=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','pick','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','nolimit','addTeams','ids','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','Agents','field','tq.TeamId','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','transaction','isEmpty','addAgents','omit','removeAgents','userFaxQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','FaxQueues','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','hasOwnProperty','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','length','find'];(function(_0x2e902b,_0x30f6c6){var _0x5408a3=function(_0x406463){while(--_0x406463){_0x2e902b['push'](_0x2e902b['shift']());}};_0x5408a3(++_0x30f6c6);}(_0xd479,0xd2));var _0x9d47=function(_0x45c02f,_0x375a20){_0x45c02f=_0x45c02f-0x0;var _0xad4ab4=_0xd479[_0x45c02f];return _0xad4ab4;};'use strict';var emlformat=require(_0x9d47('0x0'));var rimraf=require(_0x9d47('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d47('0x2'));var rp=require(_0x9d47('0x3'));var moment=require('moment');var BPromise=require(_0x9d47('0x4'));var Mustache=require(_0x9d47('0x5'));var util=require('util');var path=require(_0x9d47('0x6'));var sox=require(_0x9d47('0x7'));var csv=require(_0x9d47('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d47('0x9'));var squel=require(_0x9d47('0xa'));var crypto=require(_0x9d47('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9d47('0xc'));var Papa=require('papaparse');var Redis=require(_0x9d47('0xd'));var authService=require(_0x9d47('0xe'));var qs=require(_0x9d47('0xf'));var as=require(_0x9d47('0x10'));var hardwareService=require(_0x9d47('0x11'));var logger=require(_0x9d47('0x12'))('api');var utils=require(_0x9d47('0x13'));var config=require(_0x9d47('0x14'));var licenseUtil=require(_0x9d47('0x15'));var db=require(_0x9d47('0x16'))['db'];config[_0x9d47('0x17')]=_[_0x9d47('0x18')](config[_0x9d47('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d47('0x19'))(new Redis(config[_0x9d47('0x17')]));require(_0x9d47('0x1a'))[_0x9d47('0x1b')](socket);function respondWithStatusCode(_0x24d48b,_0x469ef5){_0x469ef5=_0x469ef5||0xcc;return function(_0x32211f){if(_0x32211f){return _0x24d48b[_0x9d47('0x1c')](_0x469ef5);}return _0x24d48b[_0x9d47('0x1d')](_0x469ef5)[_0x9d47('0x1e')]();};}function respondWithResult(_0x55784f,_0x17ff76){_0x17ff76=_0x17ff76||0xc8;return function(_0x3d197b){if(_0x3d197b){return _0x55784f['status'](_0x17ff76)[_0x9d47('0x1f')](_0x3d197b);}};}function respondWithFilteredResult(_0x19e78a,_0x72a557){return function(_0x27793f){if(_0x27793f){var _0x4972e5=typeof _0x72a557[_0x9d47('0x20')]==='undefined'&&typeof _0x72a557['limit']===_0x9d47('0x21');var _0x1fd9d7=_0x27793f['count'];var _0x5bf72d=_0x4972e5?0x0:_0x72a557[_0x9d47('0x20')];var _0x503b3a=_0x4972e5?_0x27793f[_0x9d47('0x22')]:_0x72a557['offset']+_0x72a557['limit'];var _0x5ebd2e;if(_0x503b3a>=_0x1fd9d7){_0x503b3a=_0x1fd9d7;_0x5ebd2e=0xc8;}else{_0x5ebd2e=0xce;}_0x19e78a['status'](_0x5ebd2e);return _0x19e78a[_0x9d47('0x23')](_0x9d47('0x24'),_0x5bf72d+'-'+_0x503b3a+'/'+_0x1fd9d7)[_0x9d47('0x1f')](_0x27793f);}return null;};}function patchUpdates(_0x47848f){return function(_0x4e6263){try{jsonpatch[_0x9d47('0x25')](_0x4e6263,_0x47848f,!![]);}catch(_0x380eec){return BPromise[_0x9d47('0x26')](_0x380eec);}return _0x4e6263[_0x9d47('0x27')]();};}function saveUpdates(_0x36aa2d,_0x539162){return function(_0x775540){if(_0x775540){return _0x775540['update'](_0x36aa2d)[_0x9d47('0x28')](function(_0x46b6ca){return _0x46b6ca;});}return null;};}function removeEntity(_0x351be3,_0x3e02fc){return function(_0xc2fb6){if(_0xc2fb6){return _0xc2fb6[_0x9d47('0x29')]()[_0x9d47('0x28')](function(){var _0x18c219=_0xc2fb6[_0x9d47('0x2a')]({'plain':!![]});var _0x205859=_0x9d47('0x2b');return db['UserProfileResource'][_0x9d47('0x29')]({'where':{'type':_0x205859,'resourceId':_0x18c219['id']}})[_0x9d47('0x28')](function(){return _0xc2fb6;});})[_0x9d47('0x28')](function(){_0x351be3[_0x9d47('0x1d')](0xcc)[_0x9d47('0x1e')]();});}};}function handleEntityNotFound(_0x4b145d,_0x226530){return function(_0x394b35){if(!_0x394b35){_0x4b145d[_0x9d47('0x1c')](0x194);}return _0x394b35;};}function handleError(_0xf20835,_0x448835){_0x448835=_0x448835||0x1f4;return function(_0xdb7ac3){logger['error'](_0xdb7ac3['stack']);if(_0xdb7ac3[_0x9d47('0x2c')]){delete _0xdb7ac3[_0x9d47('0x2c')];}_0xf20835[_0x9d47('0x1d')](_0x448835)[_0x9d47('0x2d')](_0xdb7ac3);};}exports[_0x9d47('0x2e')]=function(_0x1fb569,_0xfc7598){var _0x3f234e={},_0x195907={},_0x8fc0b1={'count':0x0,'rows':[]};var _0x3f0c20=_[_0x9d47('0x2f')](db[_0x9d47('0x30')][_0x9d47('0x31')],function(_0x125155){return{'name':_0x125155[_0x9d47('0x32')],'type':_0x125155[_0x9d47('0x33')][_0x9d47('0x34')]};});_0x195907[_0x9d47('0x35')]=_[_0x9d47('0x2f')](_0x3f0c20,_0x9d47('0x2c'));_0x195907[_0x9d47('0x36')]=_['keys'](_0x1fb569[_0x9d47('0x36')]);_0x195907['filters']=_[_0x9d47('0x37')](_0x195907[_0x9d47('0x35')],_0x195907[_0x9d47('0x36')]);_0x3f234e['attributes']=_[_0x9d47('0x37')](_0x195907[_0x9d47('0x35')],qs['fields'](_0x1fb569[_0x9d47('0x36')]['fields']));_0x3f234e['attributes']=_0x3f234e[_0x9d47('0x38')]['length']?_0x3f234e[_0x9d47('0x38')]:_0x195907[_0x9d47('0x35')];if(!_0x1fb569[_0x9d47('0x36')][_0x9d47('0x39')]('nolimit')){_0x3f234e[_0x9d47('0x3a')]=qs[_0x9d47('0x3a')](_0x1fb569[_0x9d47('0x36')]['limit']);_0x3f234e[_0x9d47('0x20')]=qs[_0x9d47('0x20')](_0x1fb569['query'][_0x9d47('0x20')]);}_0x3f234e[_0x9d47('0x3b')]=qs[_0x9d47('0x3c')](_0x1fb569[_0x9d47('0x36')][_0x9d47('0x3c')]);_0x3f234e['where']=qs['filters'](_['pick'](_0x1fb569[_0x9d47('0x36')],_0x195907[_0x9d47('0x3d')]),_0x3f0c20);if(_0x1fb569[_0x9d47('0x36')][_0x9d47('0x3e')]){_0x3f234e[_0x9d47('0x3f')]=_[_0x9d47('0x40')](_0x3f234e[_0x9d47('0x3f')],{'$or':_['map'](_0x3f0c20,function(_0x9b3de4){if(_0x9b3de4[_0x9d47('0x33')]!==_0x9d47('0x41')){var _0x5035ba={};_0x5035ba[_0x9b3de4[_0x9d47('0x2c')]]={'$like':'%'+_0x1fb569[_0x9d47('0x36')][_0x9d47('0x3e')]+'%'};return _0x5035ba;}})});}_0x3f234e=_[_0x9d47('0x40')]({},_0x3f234e,_0x1fb569[_0x9d47('0x42')]);var _0x3093fb={'where':_0x3f234e[_0x9d47('0x3f')]};return db[_0x9d47('0x30')][_0x9d47('0x22')](_0x3093fb)['then'](function(_0x1e2898){_0x8fc0b1[_0x9d47('0x22')]=_0x1e2898;if(_0x1fb569[_0x9d47('0x36')][_0x9d47('0x43')]){_0x3f234e[_0x9d47('0x44')]=[{'all':!![]}];}return db['FaxQueue'][_0x9d47('0x45')](_0x3f234e);})[_0x9d47('0x28')](function(_0xd15c37){_0x8fc0b1[_0x9d47('0x46')]=_0xd15c37;return _0x8fc0b1;})[_0x9d47('0x28')](respondWithFilteredResult(_0xfc7598,_0x3f234e))[_0x9d47('0x47')](handleError(_0xfc7598,null));};exports[_0x9d47('0x48')]=function(_0x59885d,_0x4d9590){var _0x55e4b3={'raw':!![],'where':{'id':_0x59885d[_0x9d47('0x49')]['id']}},_0x335ee1={};_0x335ee1[_0x9d47('0x35')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x335ee1[_0x9d47('0x36')]=_[_0x9d47('0x4a')](_0x59885d[_0x9d47('0x36')]);_0x335ee1[_0x9d47('0x3d')]=_[_0x9d47('0x37')](_0x335ee1['model'],_0x335ee1[_0x9d47('0x36')]);_0x55e4b3[_0x9d47('0x38')]=_['intersection'](_0x335ee1[_0x9d47('0x35')],qs['fields'](_0x59885d['query'][_0x9d47('0x4b')]));_0x55e4b3[_0x9d47('0x38')]=_0x55e4b3[_0x9d47('0x38')][_0x9d47('0x4c')]?_0x55e4b3[_0x9d47('0x38')]:_0x335ee1[_0x9d47('0x35')];if(_0x59885d['query'][_0x9d47('0x43')]){_0x55e4b3[_0x9d47('0x44')]=[{'all':!![]}];}_0x55e4b3=_[_0x9d47('0x40')]({},_0x55e4b3,_0x59885d[_0x9d47('0x42')]);return db[_0x9d47('0x30')][_0x9d47('0x4d')](_0x55e4b3)['then'](handleEntityNotFound(_0x4d9590,null))[_0x9d47('0x28')](respondWithResult(_0x4d9590,null))['catch'](handleError(_0x4d9590,null));};exports[_0x9d47('0x4e')]=function(_0x459771,_0x5e9036){return db[_0x9d47('0x30')]['create'](_0x459771[_0x9d47('0x4f')],{})[_0x9d47('0x28')](function(_0x4a5649){var _0x533f03=_0x459771[_0x9d47('0x50')][_0x9d47('0x2a')]({'plain':!![]});if(!_0x533f03)throw new Error(_0x9d47('0x51'));if(_0x533f03[_0x9d47('0x52')]==='user'){var _0x2c134d=_0x4a5649[_0x9d47('0x2a')]({'plain':!![]});var _0xaaf698=_0x9d47('0x2b');return db[_0x9d47('0x53')][_0x9d47('0x4d')]({'where':{'name':_0xaaf698,'userProfileId':_0x533f03[_0x9d47('0x54')]},'raw':!![]})['then'](function(_0x4261ea){if(_0x4261ea&&_0x4261ea[_0x9d47('0x55')]===0x0){return db[_0x9d47('0x56')][_0x9d47('0x4e')]({'name':_0x2c134d[_0x9d47('0x2c')],'resourceId':_0x2c134d['id'],'type':_0x4261ea[_0x9d47('0x2c')],'sectionId':_0x4261ea['id']},{})[_0x9d47('0x28')](function(){return _0x4a5649;});}else{return _0x4a5649;}})['catch'](function(_0xb51b04){logger[_0x9d47('0x57')](_0x9d47('0x58'),_0xb51b04);throw _0xb51b04;});}return _0x4a5649;})[_0x9d47('0x28')](respondWithResult(_0x5e9036,0xc9))[_0x9d47('0x47')](handleError(_0x5e9036,null));};exports[_0x9d47('0x59')]=function(_0x35a3b1,_0x39e206){if(_0x35a3b1[_0x9d47('0x4f')]['id']){delete _0x35a3b1[_0x9d47('0x4f')]['id'];}return db[_0x9d47('0x30')][_0x9d47('0x4d')]({'where':{'id':_0x35a3b1['params']['id']}})['then'](handleEntityNotFound(_0x39e206,null))[_0x9d47('0x28')](saveUpdates(_0x35a3b1[_0x9d47('0x4f')],null))[_0x9d47('0x28')](respondWithResult(_0x39e206,null))[_0x9d47('0x47')](handleError(_0x39e206,null));};exports[_0x9d47('0x29')]=function(_0x3b8050,_0x2b9a2b){return db[_0x9d47('0x30')][_0x9d47('0x4d')]({'where':{'id':_0x3b8050[_0x9d47('0x49')]['id']}})[_0x9d47('0x28')](handleEntityNotFound(_0x2b9a2b,null))[_0x9d47('0x28')](removeEntity(_0x2b9a2b,null))[_0x9d47('0x47')](handleError(_0x2b9a2b,null));};exports['describe']=function(_0x5e25b9,_0x187bdd){return db[_0x9d47('0x30')]['describe']()[_0x9d47('0x28')](respondWithResult(_0x187bdd,null))[_0x9d47('0x47')](handleError(_0x187bdd,null));};exports[_0x9d47('0x5a')]=function(_0x3cdf81,_0x342356,_0x2ef951){var _0x1a714f={'raw':!![],'where':{}},_0x5a1336={},_0x5c7c30;return db[_0x9d47('0x30')][_0x9d47('0x5b')]({'where':{'id':_0x3cdf81['params']['id']}})[_0x9d47('0x28')](handleEntityNotFound(_0x342356,null))['then'](function(_0x3ecc47){if(_0x3ecc47){_0x5c7c30=_0x3ecc47['get']({'plain':!![]});_0x5a1336[_0x9d47('0x35')]=_[_0x9d47('0x4a')](db['UserFaxQueue'][_0x9d47('0x31')]);_0x5a1336[_0x9d47('0x36')]=_['keys'](_0x3cdf81[_0x9d47('0x36')]);_0x5a1336[_0x9d47('0x3d')]=_['intersection'](_0x5a1336[_0x9d47('0x35')],_0x5a1336[_0x9d47('0x36')]);_0x1a714f[_0x9d47('0x38')]=_[_0x9d47('0x37')](_0x5a1336[_0x9d47('0x35')],qs['fields'](_0x3cdf81[_0x9d47('0x36')][_0x9d47('0x4b')]));_0x1a714f[_0x9d47('0x38')]=_0x1a714f[_0x9d47('0x38')][_0x9d47('0x4c')]?_0x1a714f[_0x9d47('0x38')]:_0x5a1336[_0x9d47('0x35')];if(!_0x3cdf81['query'][_0x9d47('0x39')]('nolimit')){_0x1a714f[_0x9d47('0x3a')]=qs['limit'](_0x3cdf81[_0x9d47('0x36')]['limit']);_0x1a714f[_0x9d47('0x20')]=qs[_0x9d47('0x20')](_0x3cdf81[_0x9d47('0x36')][_0x9d47('0x20')]);}_0x1a714f['order']=qs[_0x9d47('0x3c')](_0x3cdf81[_0x9d47('0x36')][_0x9d47('0x3c')]);_0x1a714f[_0x9d47('0x3f')]=qs[_0x9d47('0x3d')](_[_0x9d47('0x5c')](_0x3cdf81['query'],_0x5a1336[_0x9d47('0x3d')]));_0x1a714f[_0x9d47('0x3f')][_0x9d47('0x5d')]=_0x3ecc47['id'];if(_0x3cdf81[_0x9d47('0x36')]['filter']){_0x1a714f[_0x9d47('0x3f')]=_[_0x9d47('0x40')](_0x1a714f[_0x9d47('0x3f')],{'$or':_['map'](_0x1a714f[_0x9d47('0x38')],function(_0x3a076f){var _0x50c431={};_0x50c431[_0x3a076f]={'$like':'%'+_0x3cdf81['query'][_0x9d47('0x3e')]+'%'};return _0x50c431;})});}_0x1a714f=_[_0x9d47('0x40')]({},_0x1a714f,_0x3cdf81[_0x9d47('0x42')]);return db[_0x9d47('0x5e')]['findAll'](_0x1a714f);}})[_0x9d47('0x28')](function(_0x1e5efc){if(_0x1e5efc){return db[_0x9d47('0x5f')][_0x9d47('0x60')]({'where':{'id':_['map'](_0x1e5efc,_0x9d47('0x61')),'role':'agent'},'attributes':['id',_0x9d47('0x2c'),_0x9d47('0x62'),_0x9d47('0x63'),_0x9d47('0x64')]});}})[_0x9d47('0x28')](function(_0x5b654b){if(_0x5b654b){return{'count':_0x5b654b[_0x9d47('0x22')],'rows':_[_0x9d47('0x2f')](_0x5b654b['rows'],function(_0x2f964e){return{'membername':_0x2f964e[_0x9d47('0x2c')],'UserId':_0x2f964e['id'],'queue_name':_0x5c7c30[_0x9d47('0x2c')],'FaxQueueId':_0x5c7c30['id'],'interface':util[_0x9d47('0x65')](_0x9d47('0x66'),_0x9d47('0x67'),_0x2f964e[_0x9d47('0x2c')]),'penalty':0x0,'paused':_0x2f964e[_0x9d47('0x62')],'createdAt':_0x2f964e['createdAt'],'updatedAt':_0x2f964e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x342356,_0x1a714f))[_0x9d47('0x47')](handleError(_0x342356,null));};exports[_0x9d47('0x68')]=function(_0x515f52,_0x2a9798,_0x40a9d3){var _0x523530={};var _0x3d2782={};var _0x462e49;var _0x2fa0d1;return db[_0x9d47('0x30')][_0x9d47('0x5b')]({'where':{'id':_0x515f52[_0x9d47('0x49')]['id']}})[_0x9d47('0x28')](handleEntityNotFound(_0x2a9798,null))[_0x9d47('0x28')](function(_0x3690d5){if(_0x3690d5){_0x462e49=_0x3690d5;_0x3d2782[_0x9d47('0x35')]=_[_0x9d47('0x4a')](db[_0x9d47('0x69')][_0x9d47('0x31')]);_0x3d2782['query']=_[_0x9d47('0x4a')](_0x515f52['query']);_0x3d2782[_0x9d47('0x3d')]=_['intersection'](_0x3d2782['model'],_0x3d2782['query']);_0x523530[_0x9d47('0x38')]=_[_0x9d47('0x37')](_0x3d2782[_0x9d47('0x35')],qs['fields'](_0x515f52[_0x9d47('0x36')]['fields']));_0x523530[_0x9d47('0x38')]=_0x523530['attributes'][_0x9d47('0x4c')]?_0x523530[_0x9d47('0x38')]:_0x3d2782[_0x9d47('0x35')];_0x523530['order']=qs['sort'](_0x515f52['query']['sort']);_0x523530[_0x9d47('0x3f')]=qs[_0x9d47('0x3d')](_[_0x9d47('0x5c')](_0x515f52['query'],_0x3d2782[_0x9d47('0x3d')]));if(_0x515f52[_0x9d47('0x36')][_0x9d47('0x3e')]){_0x523530[_0x9d47('0x3f')]=_[_0x9d47('0x40')](_0x523530[_0x9d47('0x3f')],{'$or':_['map'](_0x523530[_0x9d47('0x38')],function(_0x59caf4){var _0x1cc756={};_0x1cc756[_0x59caf4]={'$like':'%'+_0x515f52[_0x9d47('0x36')][_0x9d47('0x3e')]+'%'};return _0x1cc756;})});}_0x523530=_[_0x9d47('0x40')]({},_0x523530,_0x515f52[_0x9d47('0x42')]);return _0x462e49[_0x9d47('0x68')](_0x523530);}})[_0x9d47('0x28')](function(_0x2811e7){if(_0x2811e7){_0x2fa0d1=_0x2811e7[_0x9d47('0x4c')];if(!_0x515f52[_0x9d47('0x36')][_0x9d47('0x39')](_0x9d47('0x6a'))){_0x523530[_0x9d47('0x3a')]=qs[_0x9d47('0x3a')](_0x515f52[_0x9d47('0x36')][_0x9d47('0x3a')]);_0x523530[_0x9d47('0x20')]=qs[_0x9d47('0x20')](_0x515f52['query'][_0x9d47('0x20')]);}return _0x462e49['getTeams'](_0x523530);}})['then'](function(_0x545956){if(_0x545956){return _0x545956?{'count':_0x2fa0d1,'rows':_0x545956}:null;}})[_0x9d47('0x28')](respondWithResult(_0x2a9798,null))[_0x9d47('0x47')](handleError(_0x2a9798,null));};exports[_0x9d47('0x6b')]=function(_0x31aeb8,_0x12937a,_0x42cbcd){var _0x488e08=_0x31aeb8[_0x9d47('0x4f')][_0x9d47('0x6c')];return db['Team']['findAll']({'where':{'id':_0x488e08},'attributes':['id'],'include':[{'model':db[_0x9d47('0x5f')],'as':'Agents','attributes':['id','name',_0x9d47('0x6d'),_0x9d47('0x6e'),_0x9d47('0x6f')],'raw':!![]}]})['then'](function(_0x5ae782){if(_0x5ae782){var _0x4d6bce=_[_0x9d47('0x70')](_0x5ae782,function(_0x40510d){var _0x2620c7=_0x40510d[_0x9d47('0x2a')]({'plain':!![]});return _0x2620c7['Agents'];});return db[_0x9d47('0x30')]['find']({'where':{'id':_0x31aeb8[_0x9d47('0x49')]['id']}})[_0x9d47('0x28')](function(_0x350ee0){return db[_0x9d47('0x71')]['transaction'](function(_0x363e1c){return _0x350ee0['addTeams'](_0x488e08,{'transaction':_0x363e1c})[_0x9d47('0x28')](function(){return BPromise[_0x9d47('0x72')](_0x4d6bce,function(_0x8e6d1c){return db[_0x9d47('0x5e')][_0x9d47('0x73')]({'where':{'UserId':_0x8e6d1c['id'],'FaxQueueId':_0x31aeb8[_0x9d47('0x49')]['id']},'transaction':_0x363e1c});});})[_0x9d47('0x28')](function(){_0x4d6bce[_0x9d47('0x74')](function(_0x582f43){socket[_0x9d47('0x75')](_0x9d47('0x76'),{'UserId':_0x582f43['id'],'FaxQueueId':_0x350ee0['id']});});});});});}})[_0x9d47('0x28')](respondWithStatusCode(_0x12937a,null))['catch'](handleError(_0x12937a,null));};exports[_0x9d47('0x77')]=function(_0x4141c3,_0x37e3d0,_0x1533d3){return db[_0x9d47('0x69')][_0x9d47('0x45')]({'where':{'id':_0x4141c3[_0x9d47('0x36')][_0x9d47('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x9d47('0x5f')],'as':_0x9d47('0x78'),'attributes':['id'],'raw':!![]}]})[_0x9d47('0x28')](handleEntityNotFound(_0x37e3d0,null))[_0x9d47('0x28')](function(_0x2e95dd){var _0x45d085=_[_0x9d47('0x2f')](_0x2e95dd,'id');var _0x4b8c45=[];var _0x5bb5b6=[];var _0x125d2c=squel['select']();_0x125d2c[_0x9d47('0x79')](_0x9d47('0x7a'))[_0x9d47('0x7b')](_0x9d47('0x7c'),'tq')['join']('user_has_teams','ut',_0x9d47('0x7d'))['where'](_0x9d47('0x7e'),_0x4141c3[_0x9d47('0x49')]['id']);for(var _0x2233a0=0x0;_0x2233a0<_0x2e95dd[_0x9d47('0x4c')];_0x2233a0+=0x1){let _0x33a8d8=_0x2e95dd[_0x2233a0];for(var _0x57b1cd=0x0;_0x57b1cd<_0x33a8d8[_0x9d47('0x78')][_0x9d47('0x4c')];_0x57b1cd+=0x1){let _0x14e81b=_0x33a8d8['Agents'][_0x57b1cd];var _0x5b48b7=_0x125d2c[_0x9d47('0x7f')]();_0x5b48b7[_0x9d47('0x3f')](_0x9d47('0x80'),_0x14e81b['id']);_0x5bb5b6['push'](db[_0x9d47('0x71')][_0x9d47('0x36')](_0x5b48b7[_0x9d47('0x81')](),{'type':db['sequelize'][_0x9d47('0x82')][_0x9d47('0x83')]})[_0x9d47('0x28')](function(_0x4de29b){if(_0x4de29b['length']===0x1){return _0x14e81b['id'];}else{var _0x5d8f5a=_['every'](_[_0x9d47('0x2f')](_0x4de29b,_0x9d47('0x84')),function(_0x4cddee){return _[_0x9d47('0x85')](_0x45d085,_0x4cddee);});if(_0x5d8f5a){return _0x14e81b['id'];}}}));}}return BPromise[_0x9d47('0x86')](_0x5bb5b6)['then'](function(_0x5a9d12){_0x4b8c45=_(_0x4b8c45)[_0x9d47('0x87')](_0x5a9d12)[_0x9d47('0x88')]()['value']();return db['FaxQueue'][_0x9d47('0x4d')]({'where':{'id':_0x4141c3[_0x9d47('0x49')]['id']}})['then'](function(_0x3ac51f){return db['sequelize'][_0x9d47('0x89')](function(_0x174056){return _0x3ac51f[_0x9d47('0x77')](_0x4141c3['query'][_0x9d47('0x6c')],{'transaction':_0x174056})[_0x9d47('0x28')](function(){if(!_[_0x9d47('0x8a')](_0x4b8c45)){return _0x3ac51f['removeAgents'](_0x4b8c45,{'transaction':_0x174056});}})[_0x9d47('0x28')](function(){_0x4b8c45[_0x9d47('0x74')](function(_0xbcf535){socket[_0x9d47('0x75')]('userFaxQueue:remove',{'UserId':_0xbcf535,'FaxQueueId':_0x3ac51f['id']});});});});});});})[_0x9d47('0x28')](respondWithStatusCode(_0x37e3d0,null))[_0x9d47('0x47')](handleError(_0x37e3d0,null));};exports[_0x9d47('0x8b')]=function(_0x4aeb34,_0x32a940,_0x3baba1){return db[_0x9d47('0x30')][_0x9d47('0x4d')]({'where':{'id':_0x4aeb34[_0x9d47('0x49')]['id']}})[_0x9d47('0x28')](handleEntityNotFound(_0x32a940,null))[_0x9d47('0x28')](function(_0x469098){if(_0x469098){return _0x469098['addAgents'](_0x4aeb34[_0x9d47('0x4f')][_0x9d47('0x6c')],_[_0x9d47('0x8c')](_0x4aeb34['body'],[_0x9d47('0x6c'),'id'])||{})['spread'](function(_0x321944){for(var _0x52eafc=0x0;_0x52eafc<_0x4aeb34[_0x9d47('0x4f')]['ids'][_0x9d47('0x4c')];_0x52eafc+=0x1){socket[_0x9d47('0x75')]('userFaxQueue:save',{'UserId':Number(_0x4aeb34[_0x9d47('0x4f')][_0x9d47('0x6c')][_0x52eafc]),'FaxQueueId':Number(_0x4aeb34[_0x9d47('0x49')]['id'])});}return _0x321944;});}})[_0x9d47('0x28')](respondWithResult(_0x32a940,null))[_0x9d47('0x47')](handleError(_0x32a940,null));};exports[_0x9d47('0x8d')]=function(_0x3370ec,_0x5ba68e,_0x39df78){return db[_0x9d47('0x30')][_0x9d47('0x4d')]({'where':{'id':_0x3370ec['params']['id']}})['then'](handleEntityNotFound(_0x5ba68e,null))[_0x9d47('0x28')](function(_0x2f63fe){if(_0x2f63fe){return _0x2f63fe[_0x9d47('0x8d')](_0x3370ec[_0x9d47('0x36')][_0x9d47('0x6c')])['then'](function(){if(_['isArray'](_0x3370ec[_0x9d47('0x36')][_0x9d47('0x6c')])){for(var _0x36f855=0x0;_0x36f855<_0x3370ec['query']['ids'][_0x9d47('0x4c')];_0x36f855+=0x1){socket[_0x9d47('0x75')](_0x9d47('0x8e'),{'UserId':Number(_0x3370ec[_0x9d47('0x36')][_0x9d47('0x6c')][_0x36f855]),'FaxQueueId':Number(_0x3370ec[_0x9d47('0x49')]['id'])});}}else{socket[_0x9d47('0x75')](_0x9d47('0x8e'),{'UserId':Number(_0x3370ec[_0x9d47('0x36')][_0x9d47('0x6c')]),'FaxQueueId':Number(_0x3370ec[_0x9d47('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x5ba68e,null))['catch'](handleError(_0x5ba68e,null));};exports[_0x9d47('0x8f')]=function(_0x4ebabb,_0x49d949,_0xfcd5fe){var _0xdff3c={};var _0x258d28={};var _0x4d06c8;var _0x7c4fc8;return db[_0x9d47('0x30')][_0x9d47('0x5b')]({'where':{'id':_0x4ebabb['params']['id']}})[_0x9d47('0x28')](handleEntityNotFound(_0x49d949,null))[_0x9d47('0x28')](function(_0x3e812f){if(_0x3e812f){_0x4d06c8=_0x3e812f;_0x258d28['model']=_[_0x9d47('0x4a')](db[_0x9d47('0x5f')][_0x9d47('0x31')]);_0x258d28[_0x9d47('0x36')]=_[_0x9d47('0x4a')](_0x4ebabb[_0x9d47('0x36')]);_0x258d28[_0x9d47('0x3d')]=_['intersection'](_0x258d28[_0x9d47('0x35')],_0x258d28['query']);_0xdff3c['attributes']=_['intersection'](_0x258d28[_0x9d47('0x35')],qs[_0x9d47('0x4b')](_0x4ebabb['query']['fields']));_0xdff3c['attributes']=_0xdff3c[_0x9d47('0x38')][_0x9d47('0x4c')]?_0xdff3c[_0x9d47('0x38')]:_0x258d28['model'];_0xdff3c[_0x9d47('0x3b')]=qs[_0x9d47('0x3c')](_0x4ebabb[_0x9d47('0x36')]['sort']);_0xdff3c[_0x9d47('0x3f')]=qs[_0x9d47('0x3d')](_[_0x9d47('0x5c')](_0x4ebabb[_0x9d47('0x36')],_0x258d28['filters']));if(_0x4ebabb[_0x9d47('0x36')][_0x9d47('0x3e')]){_0xdff3c[_0x9d47('0x3f')]=_[_0x9d47('0x40')](_0xdff3c[_0x9d47('0x3f')],{'$or':_[_0x9d47('0x2f')](_0xdff3c['attributes'],function(_0x298e71){var _0x4fbc32={};_0x4fbc32[_0x298e71]={'$like':'%'+_0x4ebabb[_0x9d47('0x36')][_0x9d47('0x3e')]+'%'};return _0x4fbc32;})});}_0xdff3c=_[_0x9d47('0x40')]({},_0xdff3c,_0x4ebabb[_0x9d47('0x42')]);return _0x4d06c8['getAgents'](_0xdff3c);}})[_0x9d47('0x28')](function(_0x1f353c){if(_0x1f353c){_0x7c4fc8=_0x1f353c[_0x9d47('0x4c')];if(!_0x4ebabb[_0x9d47('0x36')][_0x9d47('0x39')]('nolimit')){_0xdff3c[_0x9d47('0x3a')]=qs[_0x9d47('0x3a')](_0x4ebabb[_0x9d47('0x36')][_0x9d47('0x3a')]);_0xdff3c[_0x9d47('0x20')]=qs[_0x9d47('0x20')](_0x4ebabb['query']['offset']);}return _0x4d06c8[_0x9d47('0x8f')](_0xdff3c);}})[_0x9d47('0x28')](function(_0x14c725){if(_0x14c725){return _0x14c725?{'count':_0x7c4fc8,'rows':_0x14c725}:null;}})[_0x9d47('0x28')](respondWithResult(_0x49d949,null))[_0x9d47('0x47')](handleError(_0x49d949,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c619a0f..53bce73 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 _0x4480=['emit','hasOwnProperty','exports','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x41358a,_0x322144){var _0x8c40ce=function(_0x14962b){while(--_0x14962b){_0x41358a['push'](_0x41358a['shift']());}};_0x8c40ce(++_0x322144);}(_0x4480,0xab));var _0x0448=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4480[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x0448('0x0'))['db'][_0x0448('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x0448('0x2')](0x0);var events={'afterCreate':_0x0448('0x3'),'afterUpdate':_0x0448('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1e3a43){return function(_0x3bede2,_0x2a6114,_0x1b73bf){FaxQueueEvents[_0x0448('0x5')](_0x1e3a43+':'+_0x3bede2['id'],_0x3bede2);FaxQueueEvents[_0x0448('0x5')](_0x1e3a43,_0x3bede2);_0x1b73bf(null);};}for(var e in events){if(events[_0x0448('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x0448('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x0b66=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x5a40ea,_0x590e41){var _0x49db1b=function(_0x42c3d1){while(--_0x42c3d1){_0x5a40ea['push'](_0x5a40ea['shift']());}};_0x49db1b(++_0x590e41);}(_0x0b66,0x99));var _0x60b6=function(_0x5c1614,_0x1bb8d0){_0x5c1614=_0x5c1614-0x0;var _0x4c33ac=_0x0b66[_0x5c1614];return _0x4c33ac;};'use strict';var EventEmitter=require(_0x60b6('0x0'));var FaxQueue=require(_0x60b6('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x60b6('0x2')](0x0);var events={'afterCreate':_0x60b6('0x3'),'afterUpdate':_0x60b6('0x4'),'afterDestroy':_0x60b6('0x5')};function emitEvent(_0x522c78){return function(_0x59fbdd,_0x1224b8,_0x49873b){FaxQueueEvents[_0x60b6('0x6')](_0x522c78+':'+_0x59fbdd['id'],_0x59fbdd);FaxQueueEvents[_0x60b6('0x6')](_0x522c78,_0x59fbdd);_0x49873b(null);};}for(var e in events){if(events[_0x60b6('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 3ce2955..7382b64 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 _0xf9fc=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','fax_queues','lodash'];(function(_0x258aae,_0xe245a1){var _0x1e3bb1=function(_0x2f322c){while(--_0x2f322c){_0x258aae['push'](_0x258aae['shift']());}};_0x1e3bb1(++_0xe245a1);}(_0xf9fc,0x1a3));var _0xcf9f=function(_0x28f4fe,_0x45e035){_0x28f4fe=_0x28f4fe-0x0;var _0x4553ff=_0xf9fc[_0x28f4fe];return _0x4553ff;};'use strict';var _=require(_0xcf9f('0x0'));var util=require(_0xcf9f('0x1'));var logger=require(_0xcf9f('0x2'))(_0xcf9f('0x3'));var moment=require(_0xcf9f('0x4'));var BPromise=require(_0xcf9f('0x5'));var rp=require(_0xcf9f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf9f('0x7'));var config=require(_0xcf9f('0x8'));var attributes=require('./faxQueue.attributes');module[_0xcf9f('0x9')]=function(_0xdcadfa,_0x11a8fa){return _0xdcadfa[_0xcf9f('0xa')]('FaxQueue',attributes,{'tableName':_0xcf9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83b1=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','FaxQueue','fax_queues'];(function(_0x34200f,_0x73d787){var _0x508080=function(_0x17f16a){while(--_0x17f16a){_0x34200f['push'](_0x34200f['shift']());}};_0x508080(++_0x73d787);}(_0x83b1,0xb4));var _0x183b=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x83b1[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x183b('0x0'));var util=require(_0x183b('0x1'));var logger=require(_0x183b('0x2'))('api');var moment=require(_0x183b('0x3'));var BPromise=require(_0x183b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x183b('0x5'));var rimraf=require(_0x183b('0x6'));var config=require(_0x183b('0x7'));var attributes=require('./faxQueue.attributes');module[_0x183b('0x8')]=function(_0x596b43,_0x419f0f){return _0x596b43[_0x183b('0x9')](_0x183b('0xa'),attributes,{'tableName':_0x183b('0xb'),'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 9945c23..d0abe0d 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 _0x6416=['options','raw','where','limit','map','attributes','include','model','then','ShowFaxQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll'];(function(_0x487a89,_0x1433b3){var _0x327130=function(_0x22c23f){while(--_0x22c23f){_0x487a89['push'](_0x487a89['shift']());}};_0x327130(++_0x1433b3);}(_0x6416,0x1eb));var _0x6641=function(_0x287234,_0x4b9e28){_0x287234=_0x287234-0x0;var _0x4bfc27=_0x6416[_0x287234];return _0x4bfc27;};'use strict';var _=require(_0x6641('0x0'));var util=require(_0x6641('0x1'));var moment=require(_0x6641('0x2'));var BPromise=require('bluebird');var rs=require(_0x6641('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6641('0x4'))['db'];var utils=require(_0x6641('0x5'));var logger=require(_0x6641('0x6'))(_0x6641('0x7'));var config=require(_0x6641('0x8'));var jayson=require(_0x6641('0x9'));var client=jayson[_0x6641('0xa')][_0x6641('0xb')]({'port':0x232a});config[_0x6641('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6641('0xd'))(new Redis(config[_0x6641('0xc')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x112bd9,_0x5d1cc3,_0x458704){return new BPromise(function(_0xb99a23,_0x5c525e){return client['request'](_0x112bd9,_0x458704)['then'](function(_0x1bf310){logger[_0x6641('0xe')](_0x6641('0xf'),_0x5d1cc3,_0x6641('0x10'));logger[_0x6641('0x11')](_0x6641('0x12'),_0x5d1cc3,'request\x20sent',JSON[_0x6641('0x13')](_0x1bf310));if(_0x1bf310[_0x6641('0x14')]){if(_0x1bf310[_0x6641('0x14')][_0x6641('0x15')]===0x1f4){logger[_0x6641('0x14')](_0x6641('0xf'),_0x5d1cc3,_0x1bf310['error'][_0x6641('0x16')]);return _0x5c525e(_0x1bf310['error'][_0x6641('0x16')]);}logger[_0x6641('0x14')](_0x6641('0xf'),_0x5d1cc3,_0x1bf310[_0x6641('0x14')][_0x6641('0x16')]);return _0xb99a23(_0x1bf310[_0x6641('0x14')][_0x6641('0x16')]);}else{logger[_0x6641('0xe')]('FaxQueue,\x20%s,\x20%s',_0x5d1cc3,_0x6641('0x10'));_0xb99a23(_0x1bf310['result']['message']);}})[_0x6641('0x17')](function(_0x5eb75f){logger[_0x6641('0x14')](_0x6641('0xf'),_0x5d1cc3,_0x5eb75f);_0x5c525e(_0x5eb75f);});});}exports[_0x6641('0x18')]=function(_0x179d14){var _0x4be96d=this;return new Promise(function(_0x1c2646,_0x57db71){return db[_0x6641('0x19')][_0x6641('0x1a')]({'raw':_0x179d14[_0x6641('0x1b')]?_0x179d14['options'][_0x6641('0x1c')]===undefined?!![]:![]:!![],'where':_0x179d14[_0x6641('0x1b')]?_0x179d14['options'][_0x6641('0x1d')]||null:null,'attributes':_0x179d14['options']?_0x179d14[_0x6641('0x1b')]['attributes']||null:null,'limit':_0x179d14[_0x6641('0x1b')]?_0x179d14[_0x6641('0x1b')][_0x6641('0x1e')]||null:null,'include':_0x179d14[_0x6641('0x1b')]?_0x179d14[_0x6641('0x1b')]['include']?_[_0x6641('0x1f')](_0x179d14[_0x6641('0x1b')]['include'],function(_0x4fa8f0){return{'model':db[_0x4fa8f0['model']],'as':_0x4fa8f0['as'],'attributes':_0x4fa8f0[_0x6641('0x20')],'include':_0x4fa8f0[_0x6641('0x21')]?_['map'](_0x4fa8f0[_0x6641('0x21')],function(_0x36105b){return{'model':db[_0x36105b[_0x6641('0x22')]],'as':_0x36105b['as'],'attributes':_0x36105b[_0x6641('0x20')],'include':_0x36105b[_0x6641('0x21')]?_[_0x6641('0x1f')](_0x36105b[_0x6641('0x21')],function(_0x3a2505){return{'model':db[_0x3a2505['model']],'as':_0x3a2505['as'],'attributes':_0x3a2505[_0x6641('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6641('0x23')](function(_0x1d038f){logger[_0x6641('0xe')]('GetFaxQueue',_0x179d14);logger['debug'](_0x6641('0x18'),_0x179d14,JSON[_0x6641('0x13')](_0x1d038f));_0x1c2646(_0x1d038f);})['catch'](function(_0xa9a403){logger['error'](_0x6641('0x18'),_0xa9a403['message'],_0x179d14);_0x57db71(_0x4be96d[_0x6641('0x14')](0x1f4,_0xa9a403[_0x6641('0x16')]));});});};exports[_0x6641('0x24')]=function(_0xf5a565){var _0x483f27=this;return new Promise(function(_0xfec201,_0x1ffe7a){return db[_0x6641('0x19')]['find']({'raw':_0xf5a565[_0x6641('0x1b')]?_0xf5a565['options']['raw']===undefined?!![]:![]:!![],'where':_0xf5a565['options']?_0xf5a565[_0x6641('0x1b')][_0x6641('0x1d')]||null:null,'attributes':_0xf5a565[_0x6641('0x1b')]?_0xf5a565[_0x6641('0x1b')][_0x6641('0x20')]||null:null,'include':_0xf5a565['options']?_0xf5a565[_0x6641('0x1b')]['include']?_[_0x6641('0x1f')](_0xf5a565[_0x6641('0x1b')]['include'],function(_0x3cd37c){return{'model':db[_0x3cd37c[_0x6641('0x22')]],'as':_0x3cd37c['as'],'attributes':_0x3cd37c[_0x6641('0x20')],'include':_0x3cd37c['include']?_[_0x6641('0x1f')](_0x3cd37c[_0x6641('0x21')],function(_0x1936db){return{'model':db[_0x1936db['model']],'as':_0x1936db['as'],'attributes':_0x1936db[_0x6641('0x20')],'include':_0x1936db[_0x6641('0x21')]?_[_0x6641('0x1f')](_0x1936db[_0x6641('0x21')],function(_0x23cf65){return{'model':db[_0x23cf65[_0x6641('0x22')]],'as':_0x23cf65['as'],'attributes':_0x23cf65[_0x6641('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6641('0x23')](function(_0x4cc9d5){logger['info'](_0x6641('0x24'),_0xf5a565);logger[_0x6641('0x11')](_0x6641('0x24'),_0xf5a565,JSON[_0x6641('0x13')](_0x4cc9d5));_0xfec201(_0x4cc9d5);})[_0x6641('0x17')](function(_0x4bb90d){logger[_0x6641('0x14')](_0x6641('0x24'),_0x4bb90d[_0x6641('0x16')],_0xf5a565);_0x1ffe7a(_0x483f27[_0x6641('0x14')](0x1f4,_0x4bb90d[_0x6641('0x16')]));});});}; \ No newline at end of file +var _0xc291=['http','defaults','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','limit','include','map','model','attributes','stringify','ShowFaxQueue','find','raw','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc291,0x128));var _0x1c29=function(_0x2a5fa1,_0x1752c5){_0x2a5fa1=_0x2a5fa1-0x0;var _0x134572=_0xc291[_0x2a5fa1];return _0x134572;};'use strict';var _=require(_0x1c29('0x0'));var util=require(_0x1c29('0x1'));var moment=require('moment');var BPromise=require(_0x1c29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1c29('0x3'));var logger=require(_0x1c29('0x4'))(_0x1c29('0x5'));var config=require('../../config/environment');var jayson=require(_0x1c29('0x6'));var client=jayson[_0x1c29('0x7')][_0x1c29('0x8')]({'port':0x232a});config['redis']=_[_0x1c29('0x9')](config[_0x1c29('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c29('0xb'))(new Redis(config[_0x1c29('0xa')]));require(_0x1c29('0xc'))[_0x1c29('0xd')](socket);function respondWithRpcPromise(_0x3f37e3,_0x43e127,_0x38ceb4){return new BPromise(function(_0x291313,_0x1594d8){return client[_0x1c29('0xe')](_0x3f37e3,_0x38ceb4)[_0x1c29('0xf')](function(_0x2acef4){logger[_0x1c29('0x10')](_0x1c29('0x11'),_0x43e127,_0x1c29('0x12'));logger[_0x1c29('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x43e127,_0x1c29('0x12'),JSON['stringify'](_0x2acef4));if(_0x2acef4['error']){if(_0x2acef4[_0x1c29('0x14')]['code']===0x1f4){logger['error'](_0x1c29('0x11'),_0x43e127,_0x2acef4[_0x1c29('0x14')][_0x1c29('0x15')]);return _0x1594d8(_0x2acef4[_0x1c29('0x14')][_0x1c29('0x15')]);}logger[_0x1c29('0x14')]('FaxQueue,\x20%s,\x20%s',_0x43e127,_0x2acef4['error']['message']);return _0x291313(_0x2acef4[_0x1c29('0x14')]['message']);}else{logger['info'](_0x1c29('0x11'),_0x43e127,_0x1c29('0x12'));_0x291313(_0x2acef4[_0x1c29('0x16')][_0x1c29('0x15')]);}})[_0x1c29('0x17')](function(_0x25e303){logger['error'](_0x1c29('0x11'),_0x43e127,_0x25e303);_0x1594d8(_0x25e303);});});}exports[_0x1c29('0x18')]=function(_0x2099ed){var _0x16909a=this;return new Promise(function(_0x16b734,_0x4604a1){return db[_0x1c29('0x19')][_0x1c29('0x1a')]({'raw':_0x2099ed[_0x1c29('0x1b')]?_0x2099ed[_0x1c29('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2099ed[_0x1c29('0x1b')]?_0x2099ed[_0x1c29('0x1b')][_0x1c29('0x1c')]||null:null,'attributes':_0x2099ed[_0x1c29('0x1b')]?_0x2099ed[_0x1c29('0x1b')]['attributes']||null:null,'limit':_0x2099ed['options']?_0x2099ed['options'][_0x1c29('0x1d')]||null:null,'include':_0x2099ed[_0x1c29('0x1b')]?_0x2099ed['options'][_0x1c29('0x1e')]?_[_0x1c29('0x1f')](_0x2099ed[_0x1c29('0x1b')][_0x1c29('0x1e')],function(_0xca454c){return{'model':db[_0xca454c[_0x1c29('0x20')]],'as':_0xca454c['as'],'attributes':_0xca454c[_0x1c29('0x21')],'include':_0xca454c['include']?_[_0x1c29('0x1f')](_0xca454c[_0x1c29('0x1e')],function(_0x29891f){return{'model':db[_0x29891f[_0x1c29('0x20')]],'as':_0x29891f['as'],'attributes':_0x29891f['attributes'],'include':_0x29891f['include']?_['map'](_0x29891f[_0x1c29('0x1e')],function(_0x3fcbc1){return{'model':db[_0x3fcbc1['model']],'as':_0x3fcbc1['as'],'attributes':_0x3fcbc1['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c29('0xf')](function(_0x553f6d){logger[_0x1c29('0x10')](_0x1c29('0x18'),_0x2099ed);logger['debug']('GetFaxQueue',_0x2099ed,JSON[_0x1c29('0x22')](_0x553f6d));_0x16b734(_0x553f6d);})['catch'](function(_0x57e0c0){logger[_0x1c29('0x14')](_0x1c29('0x18'),_0x57e0c0['message'],_0x2099ed);_0x4604a1(_0x16909a[_0x1c29('0x14')](0x1f4,_0x57e0c0['message']));});});};exports[_0x1c29('0x23')]=function(_0x21cf76){var _0x50a8d1=this;return new Promise(function(_0x5f41c8,_0xa622eb){return db['FaxQueue'][_0x1c29('0x24')]({'raw':_0x21cf76['options']?_0x21cf76['options'][_0x1c29('0x25')]===undefined?!![]:![]:!![],'where':_0x21cf76[_0x1c29('0x1b')]?_0x21cf76[_0x1c29('0x1b')][_0x1c29('0x1c')]||null:null,'attributes':_0x21cf76['options']?_0x21cf76['options'][_0x1c29('0x21')]||null:null,'include':_0x21cf76['options']?_0x21cf76['options'][_0x1c29('0x1e')]?_[_0x1c29('0x1f')](_0x21cf76[_0x1c29('0x1b')][_0x1c29('0x1e')],function(_0x50d68f){return{'model':db[_0x50d68f[_0x1c29('0x20')]],'as':_0x50d68f['as'],'attributes':_0x50d68f['attributes'],'include':_0x50d68f[_0x1c29('0x1e')]?_['map'](_0x50d68f[_0x1c29('0x1e')],function(_0x37b820){return{'model':db[_0x37b820[_0x1c29('0x20')]],'as':_0x37b820['as'],'attributes':_0x37b820[_0x1c29('0x21')],'include':_0x37b820[_0x1c29('0x1e')]?_[_0x1c29('0x1f')](_0x37b820[_0x1c29('0x1e')],function(_0x467998){return{'model':db[_0x467998[_0x1c29('0x20')]],'as':_0x467998['as'],'attributes':_0x467998['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c29('0xf')](function(_0x4a75be){logger[_0x1c29('0x10')](_0x1c29('0x23'),_0x21cf76);logger[_0x1c29('0x13')](_0x1c29('0x23'),_0x21cf76,JSON['stringify'](_0x4a75be));_0x5f41c8(_0x4a75be);})['catch'](function(_0x25abd3){logger['error'](_0x1c29('0x23'),_0x25abd3[_0x1c29('0x15')],_0x21cf76);_0xa622eb(_0x50a8d1[_0x1c29('0x14')](0x1f4,_0x25abd3[_0x1c29('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 090f747..b4a9541 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 _0x6103=['register','length','./faxQueue.events','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6103,0x1d8));var _0x3610=function(_0x5440e8,_0x22022a){_0x5440e8=_0x5440e8-0x0;var _0x8a5e24=_0x6103[_0x5440e8];return _0x8a5e24;};'use strict';var FaxQueueEvents=require(_0x3610('0x0'));var events=['save','remove',_0x3610('0x1')];function createListener(_0x2ba4c2,_0xe2cb63){return function(_0x42ee8b){_0xe2cb63[_0x3610('0x2')](_0x2ba4c2,_0x42ee8b);};}function removeListener(_0x542a12,_0x403b59){return function(){FaxQueueEvents['removeListener'](_0x542a12,_0x403b59);};}exports[_0x3610('0x3')]=function(_0x573b96){for(var _0x38e7a0=0x0,_0xe5547d=events[_0x3610('0x4')];_0x38e7a0<_0xe5547d;_0x38e7a0++){var _0x398262=events[_0x38e7a0];var _0x33bf30=createListener('faxQueue:'+_0x398262,_0x573b96);FaxQueueEvents['on'](_0x398262,_0x33bf30);}}; \ No newline at end of file +var _0xc5fd=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0xc5fd,0xfa));var _0xdc5f=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xc5fd[_0x2dd390];return _0x3afe47;};'use strict';var FaxQueueEvents=require(_0xdc5f('0x0'));var events=[_0xdc5f('0x1'),_0xdc5f('0x2'),_0xdc5f('0x3')];function createListener(_0x340241,_0x570e02){return function(_0x48e93c){_0x570e02[_0xdc5f('0x4')](_0x340241,_0x48e93c);};}function removeListener(_0x2de1ca,_0x1ec503){return function(){FaxQueueEvents[_0xdc5f('0x5')](_0x2de1ca,_0x1ec503);};}exports[_0xdc5f('0x6')]=function(_0x18730f){for(var _0xaad25d=0x0,_0x550e56=events[_0xdc5f('0x7')];_0xaad25d<_0x550e56;_0xaad25d++){var _0x53f838=events[_0xaad25d];var _0x48120e=createListener(_0xdc5f('0x8')+_0x53f838,_0x18730f);FaxQueueEvents['on'](_0x53f838,_0x48120e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 6ed9cc1..ebe42b5 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 _0x2542=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeAgents'];(function(_0x378b85,_0x2bb0ff){var _0x161893=function(_0x41bec9){while(--_0x41bec9){_0x378b85['push'](_0x378b85['shift']());}};_0x161893(++_0x2bb0ff);}(_0x2542,0x169));var _0x2254=function(_0x4cea86,_0x1511df){_0x4cea86=_0x4cea86-0x0;var _0x5a5b35=_0x2542[_0x4cea86];return _0x5a5b35;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x9')](_0x2254('0x10'),auth['isAuthenticated'](),controller[_0x2254('0x11')]);router[_0x2254('0x9')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['getTeams']);router['get'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x14')]);router[_0x2254('0x15')]('/',auth[_0x2254('0xc')](),controller[_0x2254('0x16')]);router['post'](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['addTeams']);router[_0x2254('0x15')](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x17')]);router[_0x2254('0x18')](_0x2254('0xe'),auth['isAuthenticated'](),controller[_0x2254('0x19')]);router['delete'](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x1a')]);router[_0x2254('0x1b')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x2254('0xc')](),controller[_0x2254('0x1c')]);module[_0x2254('0x1d')]=router; \ No newline at end of file +var _0xe2fe=['describe','/:id','/:id/members','getAgents','post','create','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x141d89,_0x14e6f4){var _0x2c33a2=function(_0xfce76a){while(--_0xfce76a){_0x141d89['push'](_0x141d89['shift']());}};_0x2c33a2(++_0x14e6f4);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./faxQueue.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/teams',auth[_0xee2f('0x8')](),controller['getTeams']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0xe')]('/',auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router[_0xee2f('0xe')]('/:id/teams',auth[_0xee2f('0x8')](),controller['addTeams']);router[_0xee2f('0xe')](_0xee2f('0x10'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x12')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['delete'](_0xee2f('0xb'),auth['isAuthenticated'](),controller[_0xee2f('0x14')]);router[_0xee2f('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['delete'](_0xee2f('0x10'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x17')]);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 d303fd4..1561fee 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 _0x2aa2=['exports','STRING','DATE'];(function(_0x49725f,_0x259379){var _0x302428=function(_0x9cc796){while(--_0x9cc796){_0x49725f['push'](_0x49725f['shift']());}};_0x302428(++_0x259379);}(_0x2aa2,0xab));var _0x22aa=function(_0x2fc464,_0x2936c1){_0x2fc464=_0x2fc464-0x0;var _0x1bd429=_0x2aa2[_0x2fc464];return _0x1bd429;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x22aa('0x0')]={'uniqueid':{'type':Sequelize[_0x22aa('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x22aa('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x22aa('0x2')]},'reason':{'type':Sequelize[_0x22aa('0x1')]}}; \ No newline at end of file +var _0x4dd1=['moment','exports','STRING','DATE'];(function(_0x2ebf46,_0x13a04c){var _0x79c55a=function(_0x1789b1){while(--_0x1789b1){_0x2ebf46['push'](_0x2ebf46['shift']());}};_0x79c55a(++_0x13a04c);}(_0x4dd1,0xb0));var _0x14dd=function(_0x247d23,_0x1aa3a4){_0x247d23=_0x247d23-0x0;var _0x4ea256=_0x4dd1[_0x247d23];return _0x4ea256;};'use strict';var moment=require(_0x14dd('0x0'));var Sequelize=require('sequelize');module[_0x14dd('0x1')]={'uniqueid':{'type':Sequelize[_0x14dd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x14dd('0x2')]},'joinAt':{'type':Sequelize[_0x14dd('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x14dd('0x3')]},'exitAt':{'type':Sequelize[_0x14dd('0x3')]},'reason':{'type':Sequelize[_0x14dd('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index f3f982c..0d2d32e 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 _0xb74d=['keys','options','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0xb74d,0x16e));var _0xdb74=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xb74d[_0x215dc8];return _0x583ea3;};'use strict';var emlformat=require(_0xdb74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb74('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb74('0x2'));var moment=require('moment');var BPromise=require(_0xdb74('0x3'));var Mustache=require(_0xdb74('0x4'));var util=require(_0xdb74('0x5'));var path=require('path');var sox=require(_0xdb74('0x6'));var csv=require(_0xdb74('0x7'));var ejs=require(_0xdb74('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdb74('0x9'));var crypto=require('crypto');var jsforce=require(_0xdb74('0xa'));var deskjs=require(_0xdb74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdb74('0xc'));var Papa=require('papaparse');var Redis=require(_0xdb74('0xd'));var authService=require(_0xdb74('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xdb74('0xf'));var hardwareService=require(_0xdb74('0x10'));var logger=require(_0xdb74('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xdb74('0x12'));var licenseUtil=require(_0xdb74('0x13'));var db=require(_0xdb74('0x14'))['db'];function respondWithStatusCode(_0x31b9ad,_0xa88c98){_0xa88c98=_0xa88c98||0xcc;return function(_0x2e44a4){if(_0x2e44a4){return _0x31b9ad[_0xdb74('0x15')](_0xa88c98);}return _0x31b9ad[_0xdb74('0x16')](_0xa88c98)[_0xdb74('0x17')]();};}function respondWithResult(_0xad1802,_0x3cc3ba){_0x3cc3ba=_0x3cc3ba||0xc8;return function(_0x3cbbc5){if(_0x3cbbc5){return _0xad1802[_0xdb74('0x16')](_0x3cc3ba)['json'](_0x3cbbc5);}};}function respondWithFilteredResult(_0x3e8f63,_0x3d9d7a){return function(_0x23f848){if(_0x23f848){var _0x206b4d=typeof _0x3d9d7a['offset']==='undefined'&&typeof _0x3d9d7a[_0xdb74('0x18')]===_0xdb74('0x19');var _0x507d2f=_0x23f848[_0xdb74('0x1a')];var _0xe0fb05=_0x206b4d?0x0:_0x3d9d7a[_0xdb74('0x1b')];var _0x15184f=_0x206b4d?_0x23f848['count']:_0x3d9d7a[_0xdb74('0x1b')]+_0x3d9d7a[_0xdb74('0x18')];var _0x4367c7;if(_0x15184f>=_0x507d2f){_0x15184f=_0x507d2f;_0x4367c7=0xc8;}else{_0x4367c7=0xce;}_0x3e8f63['status'](_0x4367c7);return _0x3e8f63['set'](_0xdb74('0x1c'),_0xe0fb05+'-'+_0x15184f+'/'+_0x507d2f)['json'](_0x23f848);}return null;};}function patchUpdates(_0x2be7a7){return function(_0x17a268){try{jsonpatch[_0xdb74('0x1d')](_0x17a268,_0x2be7a7,!![]);}catch(_0x4484f2){return BPromise['reject'](_0x4484f2);}return _0x17a268[_0xdb74('0x1e')]();};}function saveUpdates(_0x305724,_0x29d840){return function(_0x22e5d4){if(_0x22e5d4){return _0x22e5d4[_0xdb74('0x1f')](_0x305724)['then'](function(_0x119434){return _0x119434;});}return null;};}function removeEntity(_0x4ff7a2,_0x3d9d1d){return function(_0x3fef84){if(_0x3fef84){return _0x3fef84[_0xdb74('0x20')]()['then'](function(){_0x4ff7a2[_0xdb74('0x16')](0xcc)[_0xdb74('0x17')]();});}};}function handleEntityNotFound(_0x429cee,_0x7fffbf){return function(_0x2d0049){if(!_0x2d0049){_0x429cee[_0xdb74('0x15')](0x194);}return _0x2d0049;};}function handleError(_0x2c908e,_0x40bcb2){_0x40bcb2=_0x40bcb2||0x1f4;return function(_0x9d8021){logger[_0xdb74('0x21')](_0x9d8021[_0xdb74('0x22')]);if(_0x9d8021['name']){delete _0x9d8021[_0xdb74('0x23')];}_0x2c908e[_0xdb74('0x16')](_0x40bcb2)[_0xdb74('0x24')](_0x9d8021);};}exports[_0xdb74('0x25')]=function(_0x1eea24,_0x3c1b45){var _0xd98810={},_0x2025c8={},_0x2ca37e={'count':0x0,'rows':[]};var _0xfe6981=_['map'](db[_0xdb74('0x26')][_0xdb74('0x27')],function(_0xd0412){return{'name':_0xd0412[_0xdb74('0x28')],'type':_0xd0412[_0xdb74('0x29')]['key']};});_0x2025c8[_0xdb74('0x2a')]=_[_0xdb74('0x2b')](_0xfe6981,_0xdb74('0x23'));_0x2025c8[_0xdb74('0x2c')]=_['keys'](_0x1eea24[_0xdb74('0x2c')]);_0x2025c8['filters']=_['intersection'](_0x2025c8[_0xdb74('0x2a')],_0x2025c8[_0xdb74('0x2c')]);_0xd98810[_0xdb74('0x2d')]=_[_0xdb74('0x2e')](_0x2025c8['model'],qs[_0xdb74('0x2f')](_0x1eea24[_0xdb74('0x2c')]['fields']));_0xd98810[_0xdb74('0x2d')]=_0xd98810[_0xdb74('0x2d')][_0xdb74('0x30')]?_0xd98810[_0xdb74('0x2d')]:_0x2025c8[_0xdb74('0x2a')];if(!_0x1eea24[_0xdb74('0x2c')][_0xdb74('0x31')](_0xdb74('0x32'))){_0xd98810[_0xdb74('0x18')]=qs[_0xdb74('0x18')](_0x1eea24[_0xdb74('0x2c')][_0xdb74('0x18')]);_0xd98810[_0xdb74('0x1b')]=qs['offset'](_0x1eea24[_0xdb74('0x2c')][_0xdb74('0x1b')]);}_0xd98810[_0xdb74('0x33')]=qs[_0xdb74('0x34')](_0x1eea24[_0xdb74('0x2c')][_0xdb74('0x34')]);_0xd98810[_0xdb74('0x35')]=qs[_0xdb74('0x36')](_[_0xdb74('0x37')](_0x1eea24['query'],_0x2025c8[_0xdb74('0x36')]),_0xfe6981);if(_0x1eea24['query'][_0xdb74('0x38')]){_0xd98810['where']=_[_0xdb74('0x39')](_0xd98810[_0xdb74('0x35')],{'$or':_[_0xdb74('0x2b')](_0xfe6981,function(_0x125f86){if(_0x125f86['type']!==_0xdb74('0x3a')){var _0x408991={};_0x408991[_0x125f86['name']]={'$like':'%'+_0x1eea24['query']['filter']+'%'};return _0x408991;}})});}_0xd98810=_[_0xdb74('0x39')]({},_0xd98810,_0x1eea24['options']);var _0x4bd82a={'where':_0xd98810[_0xdb74('0x35')]};return db[_0xdb74('0x26')][_0xdb74('0x1a')](_0x4bd82a)[_0xdb74('0x3b')](function(_0x5ba2f0){_0x2ca37e[_0xdb74('0x1a')]=_0x5ba2f0;if(_0x1eea24['query'][_0xdb74('0x3c')]){_0xd98810[_0xdb74('0x3d')]=[{'all':!![]}];}return db[_0xdb74('0x26')][_0xdb74('0x3e')](_0xd98810);})[_0xdb74('0x3b')](function(_0x174041){_0x2ca37e[_0xdb74('0x3f')]=_0x174041;return _0x2ca37e;})[_0xdb74('0x3b')](respondWithFilteredResult(_0x3c1b45,_0xd98810))[_0xdb74('0x40')](handleError(_0x3c1b45,null));};exports['show']=function(_0x4883e9,_0x59c7f1){var _0x2aea4c={'raw':!![],'where':{'id':_0x4883e9[_0xdb74('0x41')]['id']}},_0x371661={};_0x371661[_0xdb74('0x2a')]=_['keys'](db[_0xdb74('0x26')][_0xdb74('0x27')]);_0x371661[_0xdb74('0x2c')]=_[_0xdb74('0x42')](_0x4883e9[_0xdb74('0x2c')]);_0x371661[_0xdb74('0x36')]=_[_0xdb74('0x2e')](_0x371661['model'],_0x371661[_0xdb74('0x2c')]);_0x2aea4c[_0xdb74('0x2d')]=_[_0xdb74('0x2e')](_0x371661[_0xdb74('0x2a')],qs[_0xdb74('0x2f')](_0x4883e9[_0xdb74('0x2c')]['fields']));_0x2aea4c[_0xdb74('0x2d')]=_0x2aea4c[_0xdb74('0x2d')][_0xdb74('0x30')]?_0x2aea4c[_0xdb74('0x2d')]:_0x371661['model'];if(_0x4883e9[_0xdb74('0x2c')][_0xdb74('0x3c')]){_0x2aea4c[_0xdb74('0x3d')]=[{'all':!![]}];}_0x2aea4c=_['merge']({},_0x2aea4c,_0x4883e9[_0xdb74('0x43')]);return db[_0xdb74('0x26')][_0xdb74('0x44')](_0x2aea4c)['then'](handleEntityNotFound(_0x59c7f1,null))[_0xdb74('0x3b')](respondWithResult(_0x59c7f1,null))[_0xdb74('0x40')](handleError(_0x59c7f1,null));};exports[_0xdb74('0x45')]=function(_0xad8787,_0x19b4a0){return db[_0xdb74('0x26')]['create'](_0xad8787[_0xdb74('0x46')],{})[_0xdb74('0x3b')](respondWithResult(_0x19b4a0,0xc9))['catch'](handleError(_0x19b4a0,null));};exports[_0xdb74('0x1f')]=function(_0x560617,_0x20d853){if(_0x560617[_0xdb74('0x46')]['id']){delete _0x560617[_0xdb74('0x46')]['id'];}return db[_0xdb74('0x26')]['find']({'where':{'id':_0x560617['params']['id']}})[_0xdb74('0x3b')](handleEntityNotFound(_0x20d853,null))['then'](saveUpdates(_0x560617['body'],null))[_0xdb74('0x3b')](respondWithResult(_0x20d853,null))[_0xdb74('0x40')](handleError(_0x20d853,null));};exports[_0xdb74('0x20')]=function(_0x2c27c,_0x2b7e7b){return db[_0xdb74('0x26')][_0xdb74('0x44')]({'where':{'id':_0x2c27c[_0xdb74('0x41')]['id']}})[_0xdb74('0x3b')](handleEntityNotFound(_0x2b7e7b,null))[_0xdb74('0x3b')](removeEntity(_0x2b7e7b,null))['catch'](handleError(_0x2b7e7b,null));};exports[_0xdb74('0x47')]=function(_0x1d3cb4,_0x3a84b4){return db[_0xdb74('0x26')]['describe']()[_0xdb74('0x3b')](respondWithResult(_0x3a84b4,null))['catch'](handleError(_0x3a84b4,null));}; \ No newline at end of file +var _0x91a7=['options','findAll','rows','catch','rawAttributes','includeAll','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','merge','where','VIRTUAL'];(function(_0x5d02e1,_0x2e0936){var _0x3e043a=function(_0x2ead00){while(--_0x2ead00){_0x5d02e1['push'](_0x5d02e1['shift']());}};_0x3e043a(++_0x2e0936);}(_0x91a7,0xe7));var _0x791a=function(_0x36320f,_0x2d368a){_0x36320f=_0x36320f-0x0;var _0x29c875=_0x91a7[_0x36320f];return _0x29c875;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x53dc41,_0x5daecd){_0x5daecd=_0x5daecd||0xcc;return function(_0xc92016){if(_0xc92016){return _0x53dc41[_0x791a('0x16')](_0x5daecd);}return _0x53dc41['status'](_0x5daecd)[_0x791a('0x17')]();};}function respondWithResult(_0x3a2ec6,_0x5d5b11){_0x5d5b11=_0x5d5b11||0xc8;return function(_0x2887f0){if(_0x2887f0){return _0x3a2ec6[_0x791a('0x18')](_0x5d5b11)[_0x791a('0x19')](_0x2887f0);}};}function respondWithFilteredResult(_0x5cdf2,_0x55e845){return function(_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=typeof _0x55e845[_0x791a('0x1a')]===_0x791a('0x1b')&&typeof _0x55e845['limit']===_0x791a('0x1b');var _0x5bea2e=_0x2ce2e0[_0x791a('0x1c')];var _0x52941d=_0x575d11?0x0:_0x55e845['offset'];var _0x588d00=_0x575d11?_0x2ce2e0[_0x791a('0x1c')]:_0x55e845['offset']+_0x55e845['limit'];var _0x39c60b;if(_0x588d00>=_0x5bea2e){_0x588d00=_0x5bea2e;_0x39c60b=0xc8;}else{_0x39c60b=0xce;}_0x5cdf2[_0x791a('0x18')](_0x39c60b);return _0x5cdf2[_0x791a('0x1d')](_0x791a('0x1e'),_0x52941d+'-'+_0x588d00+'/'+_0x5bea2e)['json'](_0x2ce2e0);}return null;};}function patchUpdates(_0x189c0d){return function(_0xcb5e66){try{jsonpatch[_0x791a('0x1f')](_0xcb5e66,_0x189c0d,!![]);}catch(_0x280f1e){return BPromise['reject'](_0x280f1e);}return _0xcb5e66[_0x791a('0x20')]();};}function saveUpdates(_0x2054c6,_0x25bae5){return function(_0x9e17b5){if(_0x9e17b5){return _0x9e17b5[_0x791a('0x21')](_0x2054c6)[_0x791a('0x22')](function(_0x2241a0){return _0x2241a0;});}return null;};}function removeEntity(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(_0xe8e452){return _0xe8e452[_0x791a('0x23')]()['then'](function(){_0x45a67d[_0x791a('0x18')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x380329,_0x2966b8){return function(_0x4d748a){if(!_0x4d748a){_0x380329[_0x791a('0x16')](0x194);}return _0x4d748a;};}function handleError(_0x2db3f7,_0x51dcca){_0x51dcca=_0x51dcca||0x1f4;return function(_0xdfa84f){logger[_0x791a('0x24')](_0xdfa84f[_0x791a('0x25')]);if(_0xdfa84f['name']){delete _0xdfa84f[_0x791a('0x26')];}_0x2db3f7[_0x791a('0x18')](_0x51dcca)[_0x791a('0x27')](_0xdfa84f);};}exports[_0x791a('0x28')]=function(_0x4f423,_0x1a9c6b){var _0x628816={},_0x889534={},_0x58bbc0={'count':0x0,'rows':[]};var _0xbc3436=_[_0x791a('0x29')](db[_0x791a('0x2a')]['rawAttributes'],function(_0x1cdda9){return{'name':_0x1cdda9['fieldName'],'type':_0x1cdda9[_0x791a('0x2b')][_0x791a('0x2c')]};});_0x889534[_0x791a('0x2d')]=_[_0x791a('0x29')](_0xbc3436,_0x791a('0x26'));_0x889534[_0x791a('0x2e')]=_[_0x791a('0x2f')](_0x4f423['query']);_0x889534[_0x791a('0x30')]=_[_0x791a('0x31')](_0x889534[_0x791a('0x2d')],_0x889534[_0x791a('0x2e')]);_0x628816[_0x791a('0x32')]=_['intersection'](_0x889534[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x4f423[_0x791a('0x2e')][_0x791a('0x33')]));_0x628816[_0x791a('0x32')]=_0x628816['attributes'][_0x791a('0x34')]?_0x628816[_0x791a('0x32')]:_0x889534[_0x791a('0x2d')];if(!_0x4f423[_0x791a('0x2e')][_0x791a('0x35')]('nolimit')){_0x628816[_0x791a('0x36')]=qs['limit'](_0x4f423[_0x791a('0x2e')]['limit']);_0x628816['offset']=qs[_0x791a('0x1a')](_0x4f423[_0x791a('0x2e')][_0x791a('0x1a')]);}_0x628816[_0x791a('0x37')]=qs[_0x791a('0x38')](_0x4f423[_0x791a('0x2e')][_0x791a('0x38')]);_0x628816['where']=qs[_0x791a('0x30')](_['pick'](_0x4f423[_0x791a('0x2e')],_0x889534['filters']),_0xbc3436);if(_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]){_0x628816['where']=_[_0x791a('0x3a')](_0x628816[_0x791a('0x3b')],{'$or':_['map'](_0xbc3436,function(_0x45fbfa){if(_0x45fbfa[_0x791a('0x2b')]!==_0x791a('0x3c')){var _0x23db7d={};_0x23db7d[_0x45fbfa[_0x791a('0x26')]]={'$like':'%'+_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]+'%'};return _0x23db7d;}})});}_0x628816=_[_0x791a('0x3a')]({},_0x628816,_0x4f423[_0x791a('0x3d')]);var _0xeafbb5={'where':_0x628816['where']};return db[_0x791a('0x2a')][_0x791a('0x1c')](_0xeafbb5)[_0x791a('0x22')](function(_0x4efbf6){_0x58bbc0[_0x791a('0x1c')]=_0x4efbf6;if(_0x4f423['query']['includeAll']){_0x628816['include']=[{'all':!![]}];}return db[_0x791a('0x2a')][_0x791a('0x3e')](_0x628816);})['then'](function(_0x415c44){_0x58bbc0[_0x791a('0x3f')]=_0x415c44;return _0x58bbc0;})[_0x791a('0x22')](respondWithFilteredResult(_0x1a9c6b,_0x628816))[_0x791a('0x40')](handleError(_0x1a9c6b,null));};exports['show']=function(_0x483336,_0x57b9ba){var _0x2f0395={'raw':!![],'where':{'id':_0x483336['params']['id']}},_0x216dd3={};_0x216dd3[_0x791a('0x2d')]=_[_0x791a('0x2f')](db[_0x791a('0x2a')][_0x791a('0x41')]);_0x216dd3['query']=_[_0x791a('0x2f')](_0x483336['query']);_0x216dd3[_0x791a('0x30')]=_[_0x791a('0x31')](_0x216dd3[_0x791a('0x2d')],_0x216dd3[_0x791a('0x2e')]);_0x2f0395[_0x791a('0x32')]=_['intersection'](_0x216dd3[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x483336[_0x791a('0x2e')][_0x791a('0x33')]));_0x2f0395[_0x791a('0x32')]=_0x2f0395['attributes'][_0x791a('0x34')]?_0x2f0395[_0x791a('0x32')]:_0x216dd3['model'];if(_0x483336['query'][_0x791a('0x42')]){_0x2f0395[_0x791a('0x43')]=[{'all':!![]}];}_0x2f0395=_[_0x791a('0x3a')]({},_0x2f0395,_0x483336['options']);return db['FaxQueueReport'][_0x791a('0x44')](_0x2f0395)[_0x791a('0x22')](handleEntityNotFound(_0x57b9ba,null))['then'](respondWithResult(_0x57b9ba,null))[_0x791a('0x40')](handleError(_0x57b9ba,null));};exports[_0x791a('0x45')]=function(_0x3eac77,_0x549980){return db['FaxQueueReport'][_0x791a('0x45')](_0x3eac77[_0x791a('0x46')],{})[_0x791a('0x22')](respondWithResult(_0x549980,0xc9))[_0x791a('0x40')](handleError(_0x549980,null));};exports['update']=function(_0x2d7c7d,_0x9f768a){if(_0x2d7c7d[_0x791a('0x46')]['id']){delete _0x2d7c7d[_0x791a('0x46')]['id'];}return db['FaxQueueReport'][_0x791a('0x44')]({'where':{'id':_0x2d7c7d[_0x791a('0x47')]['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x9f768a,null))[_0x791a('0x22')](saveUpdates(_0x2d7c7d[_0x791a('0x46')],null))[_0x791a('0x22')](respondWithResult(_0x9f768a,null))[_0x791a('0x40')](handleError(_0x9f768a,null));};exports['destroy']=function(_0xdcb1b,_0x1fd826){return db['FaxQueueReport'][_0x791a('0x44')]({'where':{'id':_0xdcb1b[_0x791a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fd826,null))[_0x791a('0x22')](removeEntity(_0x1fd826,null))[_0x791a('0x40')](handleError(_0x1fd826,null));};exports[_0x791a('0x48')]=function(_0x2e357c,_0xd5ec90){return db['FaxQueueReport']['describe']()['then'](respondWithResult(_0xd5ec90,null))[_0x791a('0x40')](handleError(_0xd5ec90,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 2df1d26..46972e2 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x1e0943,_0x240817){var _0x53d4b5=function(_0x4962bc){while(--_0x4962bc){_0x1e0943['push'](_0x1e0943['shift']());}};_0x53d4b5(++_0x240817);}(_0x7a54,0x106));var _0x47a5=function(_0x36f4a5,_0x2a641b){_0x36f4a5=_0x36f4a5-0x0;var _0x4f7864=_0x7a54[_0x36f4a5];return _0x4f7864;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x206f3a,_0x3f39f4){var _0x4c5497=function(_0xec2d45){while(--_0xec2d45){_0x206f3a['push'](_0x206f3a['shift']());}};_0x4c5497(++_0x3f39f4);}(_0x1261,0x144));var _0x1126=function(_0xd67723,_0x1e576f){_0xd67723=_0xd67723-0x0;var _0x53b62b=_0x1261[_0xd67723];return _0x53b62b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 179e2f4..dd28436 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 _0x3cea=['request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','stringify','UpdateFaxQueueReport','update','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FaxQueueReport,\x20%s,\x20%s'];(function(_0x1c6310,_0x230b40){var _0x1c407f=function(_0x607777){while(--_0x607777){_0x1c6310['push'](_0x1c6310['shift']());}};_0x1c407f(++_0x230b40);}(_0x3cea,0x101));var _0xa3ce=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3cea[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xa3ce('0x0'));var util=require(_0xa3ce('0x1'));var moment=require(_0xa3ce('0x2'));var BPromise=require(_0xa3ce('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3ce('0x4'));var db=require(_0xa3ce('0x5'))['db'];var utils=require(_0xa3ce('0x6'));var logger=require(_0xa3ce('0x7'))(_0xa3ce('0x8'));var config=require(_0xa3ce('0x9'));var jayson=require(_0xa3ce('0xa'));var client=jayson[_0xa3ce('0xb')][_0xa3ce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47ccd3,_0x25a1fd,_0x5952c5){return new BPromise(function(_0x5e7825,_0x982fd){return client['request'](_0x47ccd3,_0x5952c5)[_0xa3ce('0xd')](function(_0x1293b9){logger['info'](_0xa3ce('0xe'),_0x25a1fd,_0xa3ce('0xf'));logger[_0xa3ce('0x10')](_0xa3ce('0x11'),_0x25a1fd,_0xa3ce('0xf'),JSON['stringify'](_0x1293b9));if(_0x1293b9[_0xa3ce('0x12')]){if(_0x1293b9['error'][_0xa3ce('0x13')]===0x1f4){logger[_0xa3ce('0x12')](_0xa3ce('0xe'),_0x25a1fd,_0x1293b9[_0xa3ce('0x12')][_0xa3ce('0x14')]);return _0x982fd(_0x1293b9['error'][_0xa3ce('0x14')]);}logger[_0xa3ce('0x12')](_0xa3ce('0xe'),_0x25a1fd,_0x1293b9[_0xa3ce('0x12')][_0xa3ce('0x14')]);return _0x5e7825(_0x1293b9['error']['message']);}else{logger[_0xa3ce('0x15')]('FaxQueueReport,\x20%s,\x20%s',_0x25a1fd,_0xa3ce('0xf'));_0x5e7825(_0x1293b9[_0xa3ce('0x16')][_0xa3ce('0x14')]);}})[_0xa3ce('0x17')](function(_0x16a35e){logger[_0xa3ce('0x12')](_0xa3ce('0xe'),_0x25a1fd,_0x16a35e);_0x982fd(_0x16a35e);});});}exports[_0xa3ce('0x18')]=function(_0x117243){var _0x1af663=this;return new Promise(function(_0x16bbcd,_0x3cf428){return db[_0xa3ce('0x19')][_0xa3ce('0x1a')](_0x117243[_0xa3ce('0x1b')],{'raw':_0x117243[_0xa3ce('0x1c')]?_0x117243[_0xa3ce('0x1c')][_0xa3ce('0x1d')]===undefined?!![]:![]:!![]})[_0xa3ce('0xd')](function(_0x27a51b){logger['info'](_0xa3ce('0x18'),_0x117243);logger['debug'](_0xa3ce('0x18'),_0x117243,JSON[_0xa3ce('0x1e')](_0x27a51b));_0x16bbcd(_0x27a51b);})[_0xa3ce('0x17')](function(_0x3ba7cd){logger[_0xa3ce('0x12')](_0xa3ce('0x18'),_0x3ba7cd[_0xa3ce('0x14')],_0x117243);_0x3cf428(_0x1af663[_0xa3ce('0x12')](0x1f4,_0x3ba7cd[_0xa3ce('0x14')]));});});};exports[_0xa3ce('0x1f')]=function(_0x4b8b70){var _0x6aad6c=this;return new Promise(function(_0x503676,_0x1a326e){return db['FaxQueueReport'][_0xa3ce('0x20')](_0x4b8b70['body'],{'raw':_0x4b8b70[_0xa3ce('0x1c')]?_0x4b8b70['options'][_0xa3ce('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b8b70['options']?_0x4b8b70[_0xa3ce('0x1c')][_0xa3ce('0x21')]||null:null,'attributes':_0x4b8b70[_0xa3ce('0x1c')]?_0x4b8b70[_0xa3ce('0x1c')]['attributes']||null:null,'limit':_0x4b8b70[_0xa3ce('0x1c')]?_0x4b8b70[_0xa3ce('0x1c')]['limit']||null:null})[_0xa3ce('0xd')](function(_0x36eedb){logger[_0xa3ce('0x15')](_0xa3ce('0x1f'),_0x4b8b70);logger[_0xa3ce('0x10')](_0xa3ce('0x1f'),_0x4b8b70,JSON['stringify'](_0x36eedb));_0x503676(_0x36eedb);})[_0xa3ce('0x17')](function(_0x2c6e47){logger[_0xa3ce('0x12')](_0xa3ce('0x1f'),_0x2c6e47[_0xa3ce('0x14')],_0x4b8b70);_0x1a326e(_0x6aad6c[_0xa3ce('0x12')](0x1f4,_0x2c6e47['message']));});});}; \ No newline at end of file +var _0xf2a0=['catch','create','body','options','CreateFaxQueueReport','FaxQueueReport','update','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3f504b,_0x3724e8){var _0x241627=function(_0x2fcc4c){while(--_0x2fcc4c){_0x3f504b['push'](_0x3f504b['shift']());}};_0x241627(++_0x3724e8);}(_0xf2a0,0x101));var _0x0f2a=function(_0x4fa4fd,_0x4c656b){_0x4fa4fd=_0x4fa4fd-0x0;var _0x3c50d0=_0xf2a0[_0x4fa4fd];return _0x3c50d0;};'use strict';var _=require(_0x0f2a('0x0'));var util=require(_0x0f2a('0x1'));var moment=require('moment');var BPromise=require(_0x0f2a('0x2'));var rs=require(_0x0f2a('0x3'));var fs=require('fs');var Redis=require(_0x0f2a('0x4'));var db=require(_0x0f2a('0x5'))['db'];var utils=require(_0x0f2a('0x6'));var logger=require(_0x0f2a('0x7'))(_0x0f2a('0x8'));var config=require(_0x0f2a('0x9'));var jayson=require(_0x0f2a('0xa'));var client=jayson[_0x0f2a('0xb')][_0x0f2a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b1ac0,_0x413948,_0x25ee5a){return new BPromise(function(_0x1c6c47,_0x160233){return client[_0x0f2a('0xd')](_0x1b1ac0,_0x25ee5a)[_0x0f2a('0xe')](function(_0x1dc1bd){logger[_0x0f2a('0xf')](_0x0f2a('0x10'),_0x413948,_0x0f2a('0x11'));logger[_0x0f2a('0x12')](_0x0f2a('0x13'),_0x413948,_0x0f2a('0x11'),JSON[_0x0f2a('0x14')](_0x1dc1bd));if(_0x1dc1bd[_0x0f2a('0x15')]){if(_0x1dc1bd[_0x0f2a('0x15')]['code']===0x1f4){logger[_0x0f2a('0x15')](_0x0f2a('0x10'),_0x413948,_0x1dc1bd[_0x0f2a('0x15')][_0x0f2a('0x16')]);return _0x160233(_0x1dc1bd[_0x0f2a('0x15')][_0x0f2a('0x16')]);}logger[_0x0f2a('0x15')](_0x0f2a('0x10'),_0x413948,_0x1dc1bd[_0x0f2a('0x15')][_0x0f2a('0x16')]);return _0x1c6c47(_0x1dc1bd[_0x0f2a('0x15')][_0x0f2a('0x16')]);}else{logger[_0x0f2a('0xf')](_0x0f2a('0x10'),_0x413948,_0x0f2a('0x11'));_0x1c6c47(_0x1dc1bd['result'][_0x0f2a('0x16')]);}})[_0x0f2a('0x17')](function(_0x5e8f4a){logger[_0x0f2a('0x15')](_0x0f2a('0x10'),_0x413948,_0x5e8f4a);_0x160233(_0x5e8f4a);});});}exports['CreateFaxQueueReport']=function(_0x1934e8){var _0x1459ea=this;return new Promise(function(_0x54dbbc,_0xe70760){return db['FaxQueueReport'][_0x0f2a('0x18')](_0x1934e8[_0x0f2a('0x19')],{'raw':_0x1934e8[_0x0f2a('0x1a')]?_0x1934e8[_0x0f2a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0f2a('0xe')](function(_0x308b08){logger['info'](_0x0f2a('0x1b'),_0x1934e8);logger[_0x0f2a('0x12')](_0x0f2a('0x1b'),_0x1934e8,JSON['stringify'](_0x308b08));_0x54dbbc(_0x308b08);})[_0x0f2a('0x17')](function(_0x504214){logger['error']('CreateFaxQueueReport',_0x504214[_0x0f2a('0x16')],_0x1934e8);_0xe70760(_0x1459ea[_0x0f2a('0x15')](0x1f4,_0x504214[_0x0f2a('0x16')]));});});};exports['UpdateFaxQueueReport']=function(_0x15c93c){var _0x257549=this;return new Promise(function(_0x192485,_0x950a3f){return db[_0x0f2a('0x1c')][_0x0f2a('0x1d')](_0x15c93c[_0x0f2a('0x19')],{'raw':_0x15c93c[_0x0f2a('0x1a')]?_0x15c93c[_0x0f2a('0x1a')][_0x0f2a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15c93c['options']?_0x15c93c['options'][_0x0f2a('0x1f')]||null:null,'attributes':_0x15c93c[_0x0f2a('0x1a')]?_0x15c93c[_0x0f2a('0x1a')][_0x0f2a('0x20')]||null:null,'limit':_0x15c93c[_0x0f2a('0x1a')]?_0x15c93c[_0x0f2a('0x1a')][_0x0f2a('0x21')]||null:null})[_0x0f2a('0xe')](function(_0x29e2e8){logger['info'](_0x0f2a('0x22'),_0x15c93c);logger['debug'](_0x0f2a('0x22'),_0x15c93c,JSON['stringify'](_0x29e2e8));_0x192485(_0x29e2e8);})[_0x0f2a('0x17')](function(_0x2f1c96){logger[_0x0f2a('0x15')](_0x0f2a('0x22'),_0x2f1c96[_0x0f2a('0x16')],_0x15c93c);_0x950a3f(_0x257549[_0x0f2a('0x15')](0x1f4,_0x2f1c96[_0x0f2a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 493ec6a..fd86c18 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 _0x13bc=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','delete','destroy'];(function(_0x5e31e2,_0x273090){var _0x294e2c=function(_0x20ab82){while(--_0x20ab82){_0x5e31e2['push'](_0x5e31e2['shift']());}};_0x294e2c(++_0x273090);}(_0x13bc,0xf8));var _0xc13b=function(_0x59956f,_0x469133){_0x59956f=_0x59956f-0x0;var _0x33df9f=_0x13bc[_0x59956f];return _0x33df9f;};'use strict';var multer=require('multer');var util=require(_0xc13b('0x0'));var path=require(_0xc13b('0x1'));var timeout=require('connect-timeout');var express=require(_0xc13b('0x2'));var router=express[_0xc13b('0x3')]();var fs_extra=require(_0xc13b('0x4'));var auth=require(_0xc13b('0x5'));var interaction=require(_0xc13b('0x6'));var config=require(_0xc13b('0x7'));var controller=require(_0xc13b('0x8'));router[_0xc13b('0x9')]('/',auth['isAuthenticated'](),controller[_0xc13b('0xa')]);router[_0xc13b('0x9')](_0xc13b('0xb'),auth[_0xc13b('0xc')](),controller[_0xc13b('0xd')]);router['get'](_0xc13b('0xe'),auth[_0xc13b('0xc')](),controller['show']);router[_0xc13b('0xf')]('/',auth[_0xc13b('0xc')](),controller['create']);router['put']('/:id',auth[_0xc13b('0xc')](),controller['update']);router[_0xc13b('0x10')](_0xc13b('0xe'),auth[_0xc13b('0xc')](),controller[_0xc13b('0x11')]);module[_0xc13b('0x12')]=router; \ No newline at end of file +var _0x4efa=['/:id','show','create','update','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x59aa37,_0x4cee60){var _0x500d80=function(_0x5d3ecd){while(--_0x5d3ecd){_0x59aa37['push'](_0x59aa37['shift']());}};_0x500d80(++_0x4cee60);}(_0x4efa,0x1b6));var _0xa4ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4efa[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa4ef('0x0'));var timeout=require('connect-timeout');var express=require(_0xa4ef('0x1'));var router=express[_0xa4ef('0x2')]();var fs_extra=require(_0xa4ef('0x3'));var auth=require(_0xa4ef('0x4'));var interaction=require(_0xa4ef('0x5'));var config=require(_0xa4ef('0x6'));var controller=require('./faxQueueReport.controller');router[_0xa4ef('0x7')]('/',auth[_0xa4ef('0x8')](),controller[_0xa4ef('0x9')]);router[_0xa4ef('0x7')](_0xa4ef('0xa'),auth['isAuthenticated'](),controller[_0xa4ef('0xb')]);router[_0xa4ef('0x7')](_0xa4ef('0xc'),auth['isAuthenticated'](),controller[_0xa4ef('0xd')]);router['post']('/',auth[_0xa4ef('0x8')](),controller[_0xa4ef('0xe')]);router['put'](_0xa4ef('0xc'),auth['isAuthenticated'](),controller[_0xa4ef('0xf')]);router['delete'](_0xa4ef('0xc'),auth[_0xa4ef('0x8')](),controller[_0xa4ef('0x10')]);module[_0xa4ef('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 3d4c1ed..590844e 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x54ef,0x112));var _0xf54e=function(_0x3a8d29,_0x52eece){_0x3a8d29=_0x3a8d29-0x0;var _0x1733bc=_0x54ef[_0x3a8d29];return _0x1733bc;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x5d93c7,_0x580b09){var _0x54a38b=function(_0x38c4c2){while(--_0x38c4c2){_0x5d93c7['push'](_0x5d93c7['shift']());}};_0x54a38b(++_0x580b09);}(_0x34e8,0x12c));var _0x834e=function(_0x2b48eb,_0x2ee186){_0x2b48eb=_0x2b48eb-0x0;var _0x18f3c5=_0x34e8[_0x2b48eb];return _0x18f3c5;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 32d4fe3..df1776c 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 _0xe8df=['limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','offset','undefined'];(function(_0x187b0b,_0x2261f4){var _0x1fedf5=function(_0x2614a1){while(--_0x2614a1){_0x187b0b['push'](_0x187b0b['shift']());}};_0x1fedf5(++_0x2261f4);}(_0xe8df,0xba));var _0xfe8d=function(_0x3289c8,_0x847cf3){_0x3289c8=_0x3289c8-0x0;var _0x2eaec4=_0xe8df[_0x3289c8];return _0x2eaec4;};'use strict';var emlformat=require(_0xfe8d('0x0'));var rimraf=require(_0xfe8d('0x1'));var zipdir=require(_0xfe8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe8d('0x3'));var BPromise=require(_0xfe8d('0x4'));var Mustache=require(_0xfe8d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfe8d('0x6'));var csv=require(_0xfe8d('0x7'));var ejs=require(_0xfe8d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfe8d('0x9'));var crypto=require('crypto');var jsforce=require(_0xfe8d('0xa'));var deskjs=require(_0xfe8d('0xb'));var toCsv=require(_0xfe8d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe8d('0xc'));var qs=require(_0xfe8d('0xd'));var as=require(_0xfe8d('0xe'));var hardwareService=require(_0xfe8d('0xf'));var logger=require(_0xfe8d('0x10'))(_0xfe8d('0x11'));var utils=require(_0xfe8d('0x12'));var config=require(_0xfe8d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe8d('0x14'))['db'];function respondWithStatusCode(_0x49c207,_0x52709c){_0x52709c=_0x52709c||0xcc;return function(_0xc1938f){if(_0xc1938f){return _0x49c207['sendStatus'](_0x52709c);}return _0x49c207['status'](_0x52709c)[_0xfe8d('0x15')]();};}function respondWithResult(_0x2fee24,_0x380028){_0x380028=_0x380028||0xc8;return function(_0x47d10f){if(_0x47d10f){return _0x2fee24['status'](_0x380028)['json'](_0x47d10f);}};}function respondWithFilteredResult(_0x2ca9c7,_0x3f2faf){return function(_0x3f3b25){if(_0x3f3b25){var _0x1250c8=typeof _0x3f2faf[_0xfe8d('0x16')]===_0xfe8d('0x17')&&typeof _0x3f2faf[_0xfe8d('0x18')]==='undefined';var _0x1831d0=_0x3f3b25[_0xfe8d('0x19')];var _0x30e75b=_0x1250c8?0x0:_0x3f2faf[_0xfe8d('0x16')];var _0x5d44a6=_0x1250c8?_0x3f3b25[_0xfe8d('0x19')]:_0x3f2faf['offset']+_0x3f2faf[_0xfe8d('0x18')];var _0x1602ca;if(_0x5d44a6>=_0x1831d0){_0x5d44a6=_0x1831d0;_0x1602ca=0xc8;}else{_0x1602ca=0xce;}_0x2ca9c7[_0xfe8d('0x1a')](_0x1602ca);return _0x2ca9c7[_0xfe8d('0x1b')](_0xfe8d('0x1c'),_0x30e75b+'-'+_0x5d44a6+'/'+_0x1831d0)['json'](_0x3f3b25);}return null;};}function patchUpdates(_0x53334b){return function(_0x51bd85){try{jsonpatch[_0xfe8d('0x1d')](_0x51bd85,_0x53334b,!![]);}catch(_0x12fa96){return BPromise[_0xfe8d('0x1e')](_0x12fa96);}return _0x51bd85[_0xfe8d('0x1f')]();};}function saveUpdates(_0x44bc32,_0x1c24f1){return function(_0x7adc0e){if(_0x7adc0e){return _0x7adc0e[_0xfe8d('0x20')](_0x44bc32)['then'](function(_0xb6e72){return _0xb6e72;});}return null;};}function removeEntity(_0x525e63,_0x148ee3){return function(_0x3943fb){if(_0x3943fb){return _0x3943fb[_0xfe8d('0x21')]()[_0xfe8d('0x22')](function(){_0x525e63[_0xfe8d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1411eb,_0x17f0c1){return function(_0x3f2cfa){if(!_0x3f2cfa){_0x1411eb['sendStatus'](0x194);}return _0x3f2cfa;};}function handleError(_0x373203,_0x358bf5){_0x358bf5=_0x358bf5||0x1f4;return function(_0x2f068c){logger[_0xfe8d('0x23')](_0x2f068c['stack']);if(_0x2f068c[_0xfe8d('0x24')]){delete _0x2f068c[_0xfe8d('0x24')];}_0x373203[_0xfe8d('0x1a')](_0x358bf5)[_0xfe8d('0x25')](_0x2f068c);};}exports['index']=function(_0x5a9950,_0x31c6bc){var _0x118470={},_0x5dc15f={},_0x2e6023={'count':0x0,'rows':[]};var _0x4c7b97=_[_0xfe8d('0x26')](db[_0xfe8d('0x27')][_0xfe8d('0x28')],function(_0x27833f){return{'name':_0x27833f[_0xfe8d('0x29')],'type':_0x27833f[_0xfe8d('0x2a')]['key']};});_0x5dc15f[_0xfe8d('0x2b')]=_[_0xfe8d('0x26')](_0x4c7b97,_0xfe8d('0x24'));_0x5dc15f[_0xfe8d('0x2c')]=_[_0xfe8d('0x2d')](_0x5a9950[_0xfe8d('0x2c')]);_0x5dc15f[_0xfe8d('0x2e')]=_['intersection'](_0x5dc15f[_0xfe8d('0x2b')],_0x5dc15f['query']);_0x118470[_0xfe8d('0x2f')]=_[_0xfe8d('0x30')](_0x5dc15f[_0xfe8d('0x2b')],qs[_0xfe8d('0x31')](_0x5a9950['query'][_0xfe8d('0x31')]));_0x118470['attributes']=_0x118470['attributes'][_0xfe8d('0x32')]?_0x118470[_0xfe8d('0x2f')]:_0x5dc15f[_0xfe8d('0x2b')];if(!_0x5a9950[_0xfe8d('0x2c')][_0xfe8d('0x33')](_0xfe8d('0x34'))){_0x118470[_0xfe8d('0x18')]=qs[_0xfe8d('0x18')](_0x5a9950['query'][_0xfe8d('0x18')]);_0x118470[_0xfe8d('0x16')]=qs[_0xfe8d('0x16')](_0x5a9950[_0xfe8d('0x2c')][_0xfe8d('0x16')]);}_0x118470[_0xfe8d('0x35')]=qs[_0xfe8d('0x36')](_0x5a9950[_0xfe8d('0x2c')][_0xfe8d('0x36')]);_0x118470[_0xfe8d('0x37')]=qs['filters'](_[_0xfe8d('0x38')](_0x5a9950['query'],_0x5dc15f[_0xfe8d('0x2e')]),_0x4c7b97);if(_0x5a9950['query'][_0xfe8d('0x39')]){_0x118470[_0xfe8d('0x37')]=_[_0xfe8d('0x3a')](_0x118470[_0xfe8d('0x37')],{'$or':_['map'](_0x4c7b97,function(_0x3affc9){if(_0x3affc9[_0xfe8d('0x2a')]!==_0xfe8d('0x3b')){var _0x16579d={};_0x16579d[_0x3affc9['name']]={'$like':'%'+_0x5a9950[_0xfe8d('0x2c')]['filter']+'%'};return _0x16579d;}})});}_0x118470=_[_0xfe8d('0x3a')]({},_0x118470,_0x5a9950[_0xfe8d('0x3c')]);var _0x54ca56={'where':_0x118470[_0xfe8d('0x37')]};return db[_0xfe8d('0x27')]['count'](_0x54ca56)[_0xfe8d('0x22')](function(_0x199094){_0x2e6023[_0xfe8d('0x19')]=_0x199094;if(_0x5a9950[_0xfe8d('0x2c')]['includeAll']){_0x118470['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xfe8d('0x3d')](_0x118470);})[_0xfe8d('0x22')](function(_0x244b5e){_0x2e6023[_0xfe8d('0x3e')]=_0x244b5e;return _0x2e6023;})[_0xfe8d('0x22')](respondWithFilteredResult(_0x31c6bc,_0x118470))[_0xfe8d('0x3f')](handleError(_0x31c6bc,null));};exports[_0xfe8d('0x40')]=function(_0x6a38ff,_0x33eb01){var _0x1ba31a={'raw':!![],'where':{'id':_0x6a38ff[_0xfe8d('0x41')]['id']}},_0x5be1ca={};_0x5be1ca[_0xfe8d('0x2b')]=_['keys'](db[_0xfe8d('0x27')]['rawAttributes']);_0x5be1ca['query']=_['keys'](_0x6a38ff[_0xfe8d('0x2c')]);_0x5be1ca[_0xfe8d('0x2e')]=_[_0xfe8d('0x30')](_0x5be1ca[_0xfe8d('0x2b')],_0x5be1ca[_0xfe8d('0x2c')]);_0x1ba31a['attributes']=_['intersection'](_0x5be1ca[_0xfe8d('0x2b')],qs[_0xfe8d('0x31')](_0x6a38ff[_0xfe8d('0x2c')][_0xfe8d('0x31')]));_0x1ba31a[_0xfe8d('0x2f')]=_0x1ba31a[_0xfe8d('0x2f')]['length']?_0x1ba31a[_0xfe8d('0x2f')]:_0x5be1ca['model'];if(_0x6a38ff[_0xfe8d('0x2c')]['includeAll']){_0x1ba31a['include']=[{'all':!![]}];}_0x1ba31a=_['merge']({},_0x1ba31a,_0x6a38ff[_0xfe8d('0x3c')]);return db[_0xfe8d('0x27')][_0xfe8d('0x42')](_0x1ba31a)['then'](handleEntityNotFound(_0x33eb01,null))['then'](respondWithResult(_0x33eb01,null))['catch'](handleError(_0x33eb01,null));};exports['create']=function(_0x1e2287,_0x4d726e){return db[_0xfe8d('0x27')][_0xfe8d('0x43')](_0x1e2287[_0xfe8d('0x44')],{})[_0xfe8d('0x22')](respondWithResult(_0x4d726e,0xc9))[_0xfe8d('0x3f')](handleError(_0x4d726e,null));};exports[_0xfe8d('0x20')]=function(_0x30c180,_0x39e90f){if(_0x30c180[_0xfe8d('0x44')]['id']){delete _0x30c180[_0xfe8d('0x44')]['id'];}return db[_0xfe8d('0x27')]['find']({'where':{'id':_0x30c180[_0xfe8d('0x41')]['id']}})[_0xfe8d('0x22')](handleEntityNotFound(_0x39e90f,null))[_0xfe8d('0x22')](saveUpdates(_0x30c180[_0xfe8d('0x44')],null))[_0xfe8d('0x22')](respondWithResult(_0x39e90f,null))[_0xfe8d('0x3f')](handleError(_0x39e90f,null));};exports[_0xfe8d('0x21')]=function(_0x56d989,_0x5ac98d){return db[_0xfe8d('0x27')][_0xfe8d('0x42')]({'where':{'id':_0x56d989[_0xfe8d('0x41')]['id']}})['then'](handleEntityNotFound(_0x5ac98d,null))[_0xfe8d('0x22')](removeEntity(_0x5ac98d,null))[_0xfe8d('0x3f')](handleError(_0x5ac98d,null));};exports[_0xfe8d('0x45')]=function(_0x25b711,_0x511c40){return db[_0xfe8d('0x27')][_0xfe8d('0x45')]()[_0xfe8d('0x22')](respondWithResult(_0x511c40,null))[_0xfe8d('0x3f')](handleError(_0x511c40,null));}; \ No newline at end of file +var _0x51d2=['../../mysqldb','end','status','json','offset','limit','count','Content-Range','apply','reject','destroy','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','FaxTransferReport','include','findAll','rows','show','params','length','includeAll','catch','create','body','update','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x51d2,0x79));var _0x251d=function(_0x3e5f6d,_0x121db6){_0x3e5f6d=_0x3e5f6d-0x0;var _0x1bea6e=_0x51d2[_0x3e5f6d];return _0x1bea6e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x251d('0x0'));var jsonpatch=require(_0x251d('0x1'));var rp=require(_0x251d('0x2'));var moment=require('moment');var BPromise=require(_0x251d('0x3'));var Mustache=require(_0x251d('0x4'));var util=require(_0x251d('0x5'));var path=require(_0x251d('0x6'));var sox=require(_0x251d('0x7'));var csv=require(_0x251d('0x8'));var ejs=require(_0x251d('0x9'));var fs=require('fs');var fs_extra=require(_0x251d('0xa'));var _=require('lodash');var squel=require(_0x251d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x251d('0xc'));var toCsv=require(_0x251d('0x8'));var querystring=require(_0x251d('0xd'));var Papa=require('papaparse');var Redis=require(_0x251d('0xe'));var authService=require(_0x251d('0xf'));var qs=require(_0x251d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x251d('0x11'));var logger=require(_0x251d('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x251d('0x13'));var licenseUtil=require(_0x251d('0x14'));var db=require(_0x251d('0x15'))['db'];function respondWithStatusCode(_0x38b3b8,_0x4a34b0){_0x4a34b0=_0x4a34b0||0xcc;return function(_0x2e0484){if(_0x2e0484){return _0x38b3b8['sendStatus'](_0x4a34b0);}return _0x38b3b8['status'](_0x4a34b0)[_0x251d('0x16')]();};}function respondWithResult(_0x1e85c6,_0x37dfc9){_0x37dfc9=_0x37dfc9||0xc8;return function(_0x1c7b8e){if(_0x1c7b8e){return _0x1e85c6[_0x251d('0x17')](_0x37dfc9)[_0x251d('0x18')](_0x1c7b8e);}};}function respondWithFilteredResult(_0x2c95d3,_0x517466){return function(_0x55c760){if(_0x55c760){var _0x17af0e=typeof _0x517466[_0x251d('0x19')]==='undefined'&&typeof _0x517466[_0x251d('0x1a')]==='undefined';var _0x57c33d=_0x55c760[_0x251d('0x1b')];var _0x1fd737=_0x17af0e?0x0:_0x517466['offset'];var _0x1b056f=_0x17af0e?_0x55c760[_0x251d('0x1b')]:_0x517466[_0x251d('0x19')]+_0x517466[_0x251d('0x1a')];var _0x5ab5ad;if(_0x1b056f>=_0x57c33d){_0x1b056f=_0x57c33d;_0x5ab5ad=0xc8;}else{_0x5ab5ad=0xce;}_0x2c95d3[_0x251d('0x17')](_0x5ab5ad);return _0x2c95d3['set'](_0x251d('0x1c'),_0x1fd737+'-'+_0x1b056f+'/'+_0x57c33d)[_0x251d('0x18')](_0x55c760);}return null;};}function patchUpdates(_0x154908){return function(_0x51d469){try{jsonpatch[_0x251d('0x1d')](_0x51d469,_0x154908,!![]);}catch(_0x33bf8a){return BPromise[_0x251d('0x1e')](_0x33bf8a);}return _0x51d469['save']();};}function saveUpdates(_0x1b026d,_0xe3640d){return function(_0x2acb0a){if(_0x2acb0a){return _0x2acb0a['update'](_0x1b026d)['then'](function(_0x16aa92){return _0x16aa92;});}return null;};}function removeEntity(_0x4eadfb,_0x34ce83){return function(_0x29297d){if(_0x29297d){return _0x29297d[_0x251d('0x1f')]()[_0x251d('0x20')](function(){_0x4eadfb['status'](0xcc)[_0x251d('0x16')]();});}};}function handleEntityNotFound(_0x709c96,_0x313df6){return function(_0xb0d87a){if(!_0xb0d87a){_0x709c96[_0x251d('0x21')](0x194);}return _0xb0d87a;};}function handleError(_0x20f5bb,_0x18f875){_0x18f875=_0x18f875||0x1f4;return function(_0x5ce8ab){logger['error'](_0x5ce8ab['stack']);if(_0x5ce8ab[_0x251d('0x22')]){delete _0x5ce8ab[_0x251d('0x22')];}_0x20f5bb['status'](_0x18f875)[_0x251d('0x23')](_0x5ce8ab);};}exports[_0x251d('0x24')]=function(_0xad8339,_0x16891e){var _0x237be8={},_0x1b8ccc={},_0x29529e={'count':0x0,'rows':[]};var _0x5f06c5=_[_0x251d('0x25')](db['FaxTransferReport'][_0x251d('0x26')],function(_0x281b52){return{'name':_0x281b52[_0x251d('0x27')],'type':_0x281b52[_0x251d('0x28')][_0x251d('0x29')]};});_0x1b8ccc[_0x251d('0x2a')]=_[_0x251d('0x25')](_0x5f06c5,_0x251d('0x22'));_0x1b8ccc['query']=_[_0x251d('0x2b')](_0xad8339[_0x251d('0x2c')]);_0x1b8ccc[_0x251d('0x2d')]=_[_0x251d('0x2e')](_0x1b8ccc[_0x251d('0x2a')],_0x1b8ccc[_0x251d('0x2c')]);_0x237be8[_0x251d('0x2f')]=_['intersection'](_0x1b8ccc[_0x251d('0x2a')],qs['fields'](_0xad8339[_0x251d('0x2c')][_0x251d('0x30')]));_0x237be8['attributes']=_0x237be8['attributes']['length']?_0x237be8['attributes']:_0x1b8ccc['model'];if(!_0xad8339[_0x251d('0x2c')][_0x251d('0x31')](_0x251d('0x32'))){_0x237be8['limit']=qs[_0x251d('0x1a')](_0xad8339['query']['limit']);_0x237be8[_0x251d('0x19')]=qs[_0x251d('0x19')](_0xad8339[_0x251d('0x2c')][_0x251d('0x19')]);}_0x237be8['order']=qs[_0x251d('0x33')](_0xad8339['query'][_0x251d('0x33')]);_0x237be8[_0x251d('0x34')]=qs['filters'](_[_0x251d('0x35')](_0xad8339[_0x251d('0x2c')],_0x1b8ccc[_0x251d('0x2d')]),_0x5f06c5);if(_0xad8339[_0x251d('0x2c')]['filter']){_0x237be8['where']=_[_0x251d('0x36')](_0x237be8['where'],{'$or':_[_0x251d('0x25')](_0x5f06c5,function(_0x1ce0fe){if(_0x1ce0fe[_0x251d('0x28')]!==_0x251d('0x37')){var _0x326ce7={};_0x326ce7[_0x1ce0fe['name']]={'$like':'%'+_0xad8339[_0x251d('0x2c')]['filter']+'%'};return _0x326ce7;}})});}_0x237be8=_['merge']({},_0x237be8,_0xad8339[_0x251d('0x38')]);var _0x32ae3a={'where':_0x237be8[_0x251d('0x34')]};return db[_0x251d('0x39')][_0x251d('0x1b')](_0x32ae3a)['then'](function(_0x19d4b7){_0x29529e[_0x251d('0x1b')]=_0x19d4b7;if(_0xad8339[_0x251d('0x2c')]['includeAll']){_0x237be8[_0x251d('0x3a')]=[{'all':!![]}];}return db[_0x251d('0x39')][_0x251d('0x3b')](_0x237be8);})[_0x251d('0x20')](function(_0x39f5e5){_0x29529e[_0x251d('0x3c')]=_0x39f5e5;return _0x29529e;})['then'](respondWithFilteredResult(_0x16891e,_0x237be8))['catch'](handleError(_0x16891e,null));};exports[_0x251d('0x3d')]=function(_0x36a4ac,_0x1f259a){var _0x1bcfb8={'raw':!![],'where':{'id':_0x36a4ac[_0x251d('0x3e')]['id']}},_0x46dbf7={};_0x46dbf7['model']=_[_0x251d('0x2b')](db['FaxTransferReport']['rawAttributes']);_0x46dbf7[_0x251d('0x2c')]=_['keys'](_0x36a4ac[_0x251d('0x2c')]);_0x46dbf7['filters']=_[_0x251d('0x2e')](_0x46dbf7['model'],_0x46dbf7[_0x251d('0x2c')]);_0x1bcfb8[_0x251d('0x2f')]=_['intersection'](_0x46dbf7[_0x251d('0x2a')],qs[_0x251d('0x30')](_0x36a4ac[_0x251d('0x2c')][_0x251d('0x30')]));_0x1bcfb8[_0x251d('0x2f')]=_0x1bcfb8[_0x251d('0x2f')][_0x251d('0x3f')]?_0x1bcfb8[_0x251d('0x2f')]:_0x46dbf7['model'];if(_0x36a4ac['query'][_0x251d('0x40')]){_0x1bcfb8['include']=[{'all':!![]}];}_0x1bcfb8=_[_0x251d('0x36')]({},_0x1bcfb8,_0x36a4ac['options']);return db[_0x251d('0x39')]['find'](_0x1bcfb8)[_0x251d('0x20')](handleEntityNotFound(_0x1f259a,null))[_0x251d('0x20')](respondWithResult(_0x1f259a,null))[_0x251d('0x41')](handleError(_0x1f259a,null));};exports[_0x251d('0x42')]=function(_0x466780,_0xecdab1){return db['FaxTransferReport'][_0x251d('0x42')](_0x466780[_0x251d('0x43')],{})[_0x251d('0x20')](respondWithResult(_0xecdab1,0xc9))[_0x251d('0x41')](handleError(_0xecdab1,null));};exports[_0x251d('0x44')]=function(_0x3be8a2,_0x235e9b){if(_0x3be8a2['body']['id']){delete _0x3be8a2['body']['id'];}return db[_0x251d('0x39')][_0x251d('0x45')]({'where':{'id':_0x3be8a2[_0x251d('0x3e')]['id']}})[_0x251d('0x20')](handleEntityNotFound(_0x235e9b,null))[_0x251d('0x20')](saveUpdates(_0x3be8a2[_0x251d('0x43')],null))[_0x251d('0x20')](respondWithResult(_0x235e9b,null))['catch'](handleError(_0x235e9b,null));};exports[_0x251d('0x1f')]=function(_0x362d6a,_0x2237d3){return db[_0x251d('0x39')]['find']({'where':{'id':_0x362d6a[_0x251d('0x3e')]['id']}})[_0x251d('0x20')](handleEntityNotFound(_0x2237d3,null))['then'](removeEntity(_0x2237d3,null))[_0x251d('0x41')](handleError(_0x2237d3,null));};exports[_0x251d('0x46')]=function(_0x22620c,_0x5470ab){return db['FaxTransferReport'][_0x251d('0x46')]()[_0x251d('0x20')](respondWithResult(_0x5470ab,null))[_0x251d('0x41')](handleError(_0x5470ab,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 75ca0b9..0dd5370 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 _0xdd2e=['../../config/environment','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x40877d,_0x46a5d2){var _0x4e8fd7=function(_0xa2eb57){while(--_0xa2eb57){_0x40877d['push'](_0x40877d['shift']());}};_0x4e8fd7(++_0x46a5d2);}(_0xdd2e,0x13d));var _0xedd2=function(_0x189d77,_0x4a982a){_0x189d77=_0x189d77-0x0;var _0x22a133=_0xdd2e[_0x189d77];return _0x22a133;};'use strict';var _=require(_0xedd2('0x0'));var util=require(_0xedd2('0x1'));var logger=require('../../config/logger')(_0xedd2('0x2'));var moment=require(_0xedd2('0x3'));var BPromise=require('bluebird');var rp=require(_0xedd2('0x4'));var fs=require('fs');var path=require(_0xedd2('0x5'));var rimraf=require(_0xedd2('0x6'));var config=require(_0xedd2('0x7'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x473dd9,_0x9bd9f4){return _0x473dd9[_0xedd2('0x8')](_0xedd2('0x9'),attributes,{'tableName':_0xedd2('0xa'),'paranoid':![],'indexes':[{'name':_0xedd2('0xb'),'fields':[_0xedd2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbfe0=['FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x1a8396,_0x280126){var _0x29ce3=function(_0x2a205a){while(--_0x2a205a){_0x1a8396['push'](_0x1a8396['shift']());}};_0x29ce3(++_0x280126);}(_0xbfe0,0x1ed));var _0x0bfe=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0xbfe0[_0x37756b];return _0x46efec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0bfe('0x0'))(_0x0bfe('0x1'));var moment=require(_0x0bfe('0x2'));var BPromise=require(_0x0bfe('0x3'));var rp=require(_0x0bfe('0x4'));var fs=require('fs');var path=require(_0x0bfe('0x5'));var rimraf=require(_0x0bfe('0x6'));var config=require(_0x0bfe('0x7'));var attributes=require(_0x0bfe('0x8'));module[_0x0bfe('0x9')]=function(_0x48b75e,_0x10407d){return _0x48b75e[_0x0bfe('0xa')](_0x0bfe('0xb'),attributes,{'tableName':_0x0bfe('0xc'),'paranoid':![],'indexes':[{'name':_0x0bfe('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 4f315e9..dea813e 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 _0x4e7d=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4e7d,0x1ce));var _0xd4e7=function(_0x551faf,_0xcd6d7e){_0x551faf=_0x551faf-0x0;var _0x5bbb54=_0x4e7d[_0x551faf];return _0x5bbb54;};'use strict';var _=require('lodash');var util=require(_0xd4e7('0x0'));var moment=require(_0xd4e7('0x1'));var BPromise=require(_0xd4e7('0x2'));var rs=require(_0xd4e7('0x3'));var fs=require('fs');var Redis=require(_0xd4e7('0x4'));var db=require(_0xd4e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4e7('0x6'))(_0xd4e7('0x7'));var config=require('../../config/environment');var jayson=require(_0xd4e7('0x8'));var client=jayson[_0xd4e7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c0f9,_0x5eeaaf,_0xcb2a2b){return new BPromise(function(_0x468850,_0x7954d4){return client[_0xd4e7('0xa')](_0x10c0f9,_0xcb2a2b)[_0xd4e7('0xb')](function(_0x39fc9c){logger[_0xd4e7('0xc')](_0xd4e7('0xd'),_0x5eeaaf,'request\x20sent');logger['debug'](_0xd4e7('0xe'),_0x5eeaaf,'request\x20sent',JSON[_0xd4e7('0xf')](_0x39fc9c));if(_0x39fc9c[_0xd4e7('0x10')]){if(_0x39fc9c[_0xd4e7('0x10')][_0xd4e7('0x11')]===0x1f4){logger[_0xd4e7('0x10')](_0xd4e7('0xd'),_0x5eeaaf,_0x39fc9c[_0xd4e7('0x10')][_0xd4e7('0x12')]);return _0x7954d4(_0x39fc9c[_0xd4e7('0x10')][_0xd4e7('0x12')]);}logger[_0xd4e7('0x10')](_0xd4e7('0xd'),_0x5eeaaf,_0x39fc9c[_0xd4e7('0x10')][_0xd4e7('0x12')]);return _0x468850(_0x39fc9c['error']['message']);}else{logger[_0xd4e7('0xc')](_0xd4e7('0xd'),_0x5eeaaf,'request\x20sent');_0x468850(_0x39fc9c[_0xd4e7('0x13')][_0xd4e7('0x12')]);}})['catch'](function(_0x2cf83d){logger[_0xd4e7('0x10')](_0xd4e7('0xd'),_0x5eeaaf,_0x2cf83d);_0x7954d4(_0x2cf83d);});});} \ No newline at end of file +var _0xc2ab=['http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5af2c8,_0x501dc9){var _0x15e0f6=function(_0x22aa18){while(--_0x22aa18){_0x5af2c8['push'](_0x5af2c8['shift']());}};_0x15e0f6(++_0x501dc9);}(_0xc2ab,0xbc));var _0xbc2a=function(_0x524ce0,_0x3670b2){_0x524ce0=_0x524ce0-0x0;var _0x38299f=_0xc2ab[_0x524ce0];return _0x38299f;};'use strict';var _=require(_0xbc2a('0x0'));var util=require(_0xbc2a('0x1'));var moment=require(_0xbc2a('0x2'));var BPromise=require(_0xbc2a('0x3'));var rs=require(_0xbc2a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc2a('0x5'))['db'];var utils=require(_0xbc2a('0x6'));var logger=require(_0xbc2a('0x7'))(_0xbc2a('0x8'));var config=require(_0xbc2a('0x9'));var jayson=require(_0xbc2a('0xa'));var client=jayson[_0xbc2a('0xb')][_0xbc2a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36f6f7,_0x5746d7,_0x5623bc){return new BPromise(function(_0x3dee3c,_0x5b0c02){return client[_0xbc2a('0xd')](_0x36f6f7,_0x5623bc)[_0xbc2a('0xe')](function(_0x169f71){logger[_0xbc2a('0xf')](_0xbc2a('0x10'),_0x5746d7,_0xbc2a('0x11'));logger[_0xbc2a('0x12')](_0xbc2a('0x13'),_0x5746d7,_0xbc2a('0x11'),JSON[_0xbc2a('0x14')](_0x169f71));if(_0x169f71['error']){if(_0x169f71['error']['code']===0x1f4){logger['error'](_0xbc2a('0x10'),_0x5746d7,_0x169f71[_0xbc2a('0x15')]['message']);return _0x5b0c02(_0x169f71[_0xbc2a('0x15')][_0xbc2a('0x16')]);}logger['error'](_0xbc2a('0x10'),_0x5746d7,_0x169f71['error'][_0xbc2a('0x16')]);return _0x3dee3c(_0x169f71[_0xbc2a('0x15')]['message']);}else{logger['info'](_0xbc2a('0x10'),_0x5746d7,'request\x20sent');_0x3dee3c(_0x169f71[_0xbc2a('0x17')][_0xbc2a('0x16')]);}})[_0xbc2a('0x18')](function(_0xc21cd8){logger[_0xbc2a('0x15')](_0xbc2a('0x10'),_0x5746d7,_0xc21cd8);_0x5b0c02(_0xc21cd8);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 216018b..b59378b 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 _0x6c68=['/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe'];(function(_0x3023dd,_0x551377){var _0x5c3958=function(_0xa3f42e){while(--_0xa3f42e){_0x3023dd['push'](_0x3023dd['shift']());}};_0x5c3958(++_0x551377);}(_0x6c68,0x184));var _0x86c6=function(_0x4eccbc,_0x365452){_0x4eccbc=_0x4eccbc-0x0;var _0x13b3ff=_0x6c68[_0x4eccbc];return _0x13b3ff;};'use strict';var multer=require(_0x86c6('0x0'));var util=require('util');var path=require(_0x86c6('0x1'));var timeout=require(_0x86c6('0x2'));var express=require(_0x86c6('0x3'));var router=express['Router']();var fs_extra=require(_0x86c6('0x4'));var auth=require(_0x86c6('0x5'));var interaction=require(_0x86c6('0x6'));var config=require(_0x86c6('0x7'));var controller=require(_0x86c6('0x8'));router[_0x86c6('0x9')]('/',auth[_0x86c6('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x86c6('0xb')]);router['get'](_0x86c6('0xc'),auth['isAuthenticated'](),controller[_0x86c6('0xd')]);router[_0x86c6('0xe')]('/',auth[_0x86c6('0xa')](),controller[_0x86c6('0xf')]);router[_0x86c6('0x10')]('/:id',auth[_0x86c6('0xa')](),controller[_0x86c6('0x11')]);router['delete'](_0x86c6('0xc'),auth[_0x86c6('0xa')](),controller[_0x86c6('0x12')]);module[_0x86c6('0x13')]=router; \ No newline at end of file +var _0x10e9=['/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index'];(function(_0x299e29,_0x10be83){var _0x560c6a=function(_0xef2a1e){while(--_0xef2a1e){_0x299e29['push'](_0x299e29['shift']());}};_0x560c6a(++_0x10be83);}(_0x10e9,0xe5));var _0x910e=function(_0x21e97b,_0x65a77f){_0x21e97b=_0x21e97b-0x0;var _0x10ba44=_0x10e9[_0x21e97b];return _0x10ba44;};'use strict';var multer=require(_0x910e('0x0'));var util=require(_0x910e('0x1'));var path=require('path');var timeout=require(_0x910e('0x2'));var express=require('express');var router=express[_0x910e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x910e('0x4'));var controller=require(_0x910e('0x5'));router[_0x910e('0x6')]('/',auth[_0x910e('0x7')](),controller[_0x910e('0x8')]);router[_0x910e('0x6')]('/describe',auth[_0x910e('0x7')](),controller['describe']);router[_0x910e('0x6')](_0x910e('0x9'),auth[_0x910e('0x7')](),controller['show']);router[_0x910e('0xa')]('/',auth[_0x910e('0x7')](),controller[_0x910e('0xb')]);router[_0x910e('0xc')](_0x910e('0x9'),auth['isAuthenticated'](),controller[_0x910e('0xd')]);router[_0x910e('0xe')](_0x910e('0x9'),auth[_0x910e('0x7')](),controller[_0x910e('0xf')]);module[_0x910e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 5a114a5..f0a5577 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 _0x5217=['/:id/configurations','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','index','/:id','show'];(function(_0x238b75,_0x185e8d){var _0x7b0fe4=function(_0x2e571b){while(--_0x2e571b){_0x238b75['push'](_0x238b75['shift']());}};_0x7b0fe4(++_0x185e8d);}(_0x5217,0x1ad));var _0x7521=function(_0x5902f2,_0x5aba68){_0x5902f2=_0x5902f2-0x0;var _0x2273bc=_0x5217[_0x5902f2];return _0x2273bc;};'use strict';var multer=require(_0x7521('0x0'));var util=require(_0x7521('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7521('0x2'));var router=express[_0x7521('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7521('0x4'));var interaction=require(_0x7521('0x5'));var config=require('../../config/environment');var controller=require(_0x7521('0x6'));router[_0x7521('0x7')]('/',auth['isAuthenticated'](),controller[_0x7521('0x8')]);router[_0x7521('0x7')](_0x7521('0x9'),auth['isAuthenticated'](),controller[_0x7521('0xa')]);router[_0x7521('0x7')](_0x7521('0xb'),auth[_0x7521('0xc')](),controller['getConfigurations']);router[_0x7521('0x7')]('/:id/fields',auth[_0x7521('0xc')](),controller[_0x7521('0xd')]);router[_0x7521('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7521('0xe')](_0x7521('0xb'),auth[_0x7521('0xc')](),controller[_0x7521('0xf')]);router[_0x7521('0x10')](_0x7521('0x9'),auth['isAuthenticated'](),controller[_0x7521('0x11')]);router['delete'](_0x7521('0x9'),auth[_0x7521('0xc')](),controller[_0x7521('0x12')]);module[_0x7521('0x13')]=router; \ No newline at end of file +var _0xd36c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd36c,0x84));var _0xcd36=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xd36c[_0x126fb9];return _0xc8a3b1;};'use strict';var multer=require(_0xcd36('0x0'));var util=require(_0xcd36('0x1'));var path=require(_0xcd36('0x2'));var timeout=require(_0xcd36('0x3'));var express=require(_0xcd36('0x4'));var router=express[_0xcd36('0x5')]();var fs_extra=require(_0xcd36('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcd36('0x7'));var config=require(_0xcd36('0x8'));var controller=require(_0xcd36('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xcd36('0xa')]);router[_0xcd36('0xb')](_0xcd36('0xc'),auth[_0xcd36('0xd')](),controller[_0xcd36('0xe')]);router[_0xcd36('0xb')](_0xcd36('0xf'),auth[_0xcd36('0xd')](),controller[_0xcd36('0x10')]);router[_0xcd36('0xb')](_0xcd36('0x11'),auth[_0xcd36('0xd')](),controller[_0xcd36('0x12')]);router[_0xcd36('0x13')]('/',auth[_0xcd36('0xd')](),controller['create']);router['post'](_0xcd36('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xcd36('0xc'),auth[_0xcd36('0xd')](),controller[_0xcd36('0x14')]);router['delete'](_0xcd36('0xc'),auth[_0xcd36('0xd')](),controller[_0xcd36('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index ed47d33..30d6846 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 _0x5789=['sequelize','exports','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x57816e,_0x366859){var _0x5d1eff=function(_0x481433){while(--_0x481433){_0x57816e['push'](_0x57816e['shift']());}};_0x5d1eff(++_0x366859);}(_0x5789,0x10a));var _0x9578=function(_0x3ee4ff,_0x1a75e4){_0x3ee4ff=_0x3ee4ff-0x0;var _0x3bdd52=_0x5789[_0x3ee4ff];return _0x3bdd52;};'use strict';var Sequelize=require(_0x9578('0x0'));module[_0x9578('0x1')]={'name':{'type':Sequelize[_0x9578('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9578('0x2')]},'remoteUri':{'type':Sequelize[_0x9578('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x9578('0x3')},'password':{'type':Sequelize[_0x9578('0x2')]},'consumerKey':{'type':Sequelize[_0x9578('0x2')]},'consumerSecret':{'type':Sequelize[_0x9578('0x2')]},'token':{'type':Sequelize[_0x9578('0x2')]},'tokenSecret':{'type':Sequelize[_0x9578('0x2')]},'serverUrl':{'type':Sequelize[_0x9578('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9578('0x4')](_0x9578('0x5'),_0x9578('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x3147=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x4c3070,_0xc2fb4c){var _0x536a44=function(_0x1412a5){while(--_0x1412a5){_0x4c3070['push'](_0x4c3070['shift']());}};_0x536a44(++_0xc2fb4c);}(_0x3147,0x64));var _0x7314=function(_0x55b2b5,_0x3b2506){_0x55b2b5=_0x55b2b5-0x0;var _0x2a6eb4=_0x3147[_0x55b2b5];return _0x2a6eb4;};'use strict';var Sequelize=require(_0x7314('0x0'));module[_0x7314('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7314('0x2')]},'username':{'type':Sequelize[_0x7314('0x2')]},'remoteUri':{'type':Sequelize[_0x7314('0x2')]},'authType':{'type':Sequelize[_0x7314('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x7314('0x2')]},'consumerSecret':{'type':Sequelize[_0x7314('0x2')]},'token':{'type':Sequelize[_0x7314('0x2')]},'tokenSecret':{'type':Sequelize[_0x7314('0x2')]},'serverUrl':{'type':Sequelize[_0x7314('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7314('0x4'),_0x7314('0x5')),'defaultValue':_0x7314('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 3a40efa..7bc87c7 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 _0x9fec=['include','findAll','rows','catch','show','params','keys','find','create','body','findOne','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','authType','password','consumerSecret','token','tokenSecret','remoteUri','slice','GET','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','username','toString','base64','concat','label','test','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x406b85,_0xf0ca8b){var _0x52b312=function(_0x83d952){while(--_0x83d952){_0x406b85['push'](_0x406b85['shift']());}};_0x52b312(++_0xf0ca8b);}(_0x9fec,0x1eb));var _0xc9fe=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0x9fec[_0x4c3ffe];return _0x28d3eb;};'use strict';var emlformat=require(_0xc9fe('0x0'));var rimraf=require(_0xc9fe('0x1'));var zipdir=require(_0xc9fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9fe('0x3'));var moment=require(_0xc9fe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9fe('0x5'));var util=require(_0xc9fe('0x6'));var path=require(_0xc9fe('0x7'));var sox=require(_0xc9fe('0x8'));var csv=require(_0xc9fe('0x9'));var ejs=require(_0xc9fe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9fe('0xb'));var squel=require(_0xc9fe('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc9fe('0xd'));var toCsv=require(_0xc9fe('0x9'));var querystring=require(_0xc9fe('0xe'));var Papa=require(_0xc9fe('0xf'));var Redis=require(_0xc9fe('0x10'));var authService=require(_0xc9fe('0x11'));var qs=require(_0xc9fe('0x12'));var as=require(_0xc9fe('0x13'));var hardwareService=require(_0xc9fe('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc9fe('0x15'));var config=require(_0xc9fe('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1c8456,_0x483361){_0x483361=_0x483361||0xcc;return function(_0x33b3b4){if(_0x33b3b4){return _0x1c8456[_0xc9fe('0x17')](_0x483361);}return _0x1c8456['status'](_0x483361)[_0xc9fe('0x18')]();};}function respondWithResult(_0x58dbed,_0x1156f8){_0x1156f8=_0x1156f8||0xc8;return function(_0xb65342){if(_0xb65342){return _0x58dbed[_0xc9fe('0x19')](_0x1156f8)[_0xc9fe('0x1a')](_0xb65342);}};}function respondWithFilteredResult(_0x4b958a,_0x1281c4){return function(_0x566177){if(_0x566177){var _0x49163b=typeof _0x1281c4['offset']==='undefined'&&typeof _0x1281c4['limit']===_0xc9fe('0x1b');var _0x1a716b=_0x566177[_0xc9fe('0x1c')];var _0xf5c00a=_0x49163b?0x0:_0x1281c4[_0xc9fe('0x1d')];var _0x5ec64a=_0x49163b?_0x566177[_0xc9fe('0x1c')]:_0x1281c4[_0xc9fe('0x1d')]+_0x1281c4[_0xc9fe('0x1e')];var _0x3a5975;if(_0x5ec64a>=_0x1a716b){_0x5ec64a=_0x1a716b;_0x3a5975=0xc8;}else{_0x3a5975=0xce;}_0x4b958a[_0xc9fe('0x19')](_0x3a5975);return _0x4b958a[_0xc9fe('0x1f')](_0xc9fe('0x20'),_0xf5c00a+'-'+_0x5ec64a+'/'+_0x1a716b)['json'](_0x566177);}return null;};}function patchUpdates(_0x4c4f6e){return function(_0x5222db){try{jsonpatch[_0xc9fe('0x21')](_0x5222db,_0x4c4f6e,!![]);}catch(_0x3ff38d){return BPromise[_0xc9fe('0x22')](_0x3ff38d);}return _0x5222db[_0xc9fe('0x23')]();};}function saveUpdates(_0x591722,_0x52643f){return function(_0x1ab291){if(_0x1ab291){return _0x1ab291[_0xc9fe('0x24')](_0x591722)[_0xc9fe('0x25')](function(_0x11c652){return _0x11c652;});}return null;};}function removeEntity(_0x354115,_0x4bd5ac){return function(_0x2cacce){if(_0x2cacce){return _0x2cacce['destroy']()[_0xc9fe('0x25')](function(){_0x354115[_0xc9fe('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583fa4,_0x4ef812){return function(_0x196b68){if(!_0x196b68){_0x583fa4[_0xc9fe('0x17')](0x194);}return _0x196b68;};}function handleError(_0x410e40,_0x42a77d){_0x42a77d=_0x42a77d||0x1f4;return function(_0x3a8b41){logger['error'](_0x3a8b41[_0xc9fe('0x26')]);if(_0x3a8b41[_0xc9fe('0x27')]){delete _0x3a8b41[_0xc9fe('0x27')];}_0x410e40[_0xc9fe('0x19')](_0x42a77d)['send'](_0x3a8b41);};}exports[_0xc9fe('0x28')]=function(_0x299567,_0x1ba053){var _0x453588={},_0x5732dc={},_0x35517b={'count':0x0,'rows':[]};var _0x2f3ab3=_[_0xc9fe('0x29')](db[_0xc9fe('0x2a')][_0xc9fe('0x2b')],function(_0x4935c1){return{'name':_0x4935c1[_0xc9fe('0x2c')],'type':_0x4935c1[_0xc9fe('0x2d')]['key']};});_0x5732dc[_0xc9fe('0x2e')]=_[_0xc9fe('0x29')](_0x2f3ab3,_0xc9fe('0x27'));_0x5732dc[_0xc9fe('0x2f')]=_['keys'](_0x299567[_0xc9fe('0x2f')]);_0x5732dc['filters']=_[_0xc9fe('0x30')](_0x5732dc[_0xc9fe('0x2e')],_0x5732dc['query']);_0x453588[_0xc9fe('0x31')]=_[_0xc9fe('0x30')](_0x5732dc[_0xc9fe('0x2e')],qs[_0xc9fe('0x32')](_0x299567[_0xc9fe('0x2f')]['fields']));_0x453588[_0xc9fe('0x31')]=_0x453588['attributes'][_0xc9fe('0x33')]?_0x453588[_0xc9fe('0x31')]:_0x5732dc[_0xc9fe('0x2e')];if(!_0x299567[_0xc9fe('0x2f')][_0xc9fe('0x34')](_0xc9fe('0x35'))){_0x453588[_0xc9fe('0x1e')]=qs[_0xc9fe('0x1e')](_0x299567[_0xc9fe('0x2f')][_0xc9fe('0x1e')]);_0x453588['offset']=qs['offset'](_0x299567[_0xc9fe('0x2f')][_0xc9fe('0x1d')]);}_0x453588[_0xc9fe('0x36')]=qs['sort'](_0x299567['query'][_0xc9fe('0x37')]);_0x453588['where']=qs[_0xc9fe('0x38')](_[_0xc9fe('0x39')](_0x299567[_0xc9fe('0x2f')],_0x5732dc['filters']),_0x2f3ab3);if(_0x299567['query'][_0xc9fe('0x3a')]){_0x453588[_0xc9fe('0x3b')]=_[_0xc9fe('0x3c')](_0x453588[_0xc9fe('0x3b')],{'$or':_['map'](_0x2f3ab3,function(_0x401636){if(_0x401636[_0xc9fe('0x2d')]!==_0xc9fe('0x3d')){var _0x2e65d7={};_0x2e65d7[_0x401636[_0xc9fe('0x27')]]={'$like':'%'+_0x299567['query'][_0xc9fe('0x3a')]+'%'};return _0x2e65d7;}})});}_0x453588=_['merge']({},_0x453588,_0x299567[_0xc9fe('0x3e')]);var _0x5d92af={'where':_0x453588['where']};return db[_0xc9fe('0x2a')][_0xc9fe('0x1c')](_0x5d92af)[_0xc9fe('0x25')](function(_0x21fc2b){_0x35517b[_0xc9fe('0x1c')]=_0x21fc2b;if(_0x299567[_0xc9fe('0x2f')][_0xc9fe('0x3f')]){_0x453588[_0xc9fe('0x40')]=[{'all':!![]}];}return db[_0xc9fe('0x2a')][_0xc9fe('0x41')](_0x453588);})[_0xc9fe('0x25')](function(_0x2d2734){_0x35517b[_0xc9fe('0x42')]=_0x2d2734;return _0x35517b;})[_0xc9fe('0x25')](respondWithFilteredResult(_0x1ba053,_0x453588))[_0xc9fe('0x43')](handleError(_0x1ba053,null));};exports[_0xc9fe('0x44')]=function(_0x3043d6,_0x4e536f){var _0x537a6e={'raw':![],'where':{'id':_0x3043d6[_0xc9fe('0x45')]['id']}},_0x118078={};_0x118078[_0xc9fe('0x2e')]=_[_0xc9fe('0x46')](db['DeskAccount']['rawAttributes']);_0x118078['query']=_[_0xc9fe('0x46')](_0x3043d6[_0xc9fe('0x2f')]);_0x118078['filters']=_[_0xc9fe('0x30')](_0x118078[_0xc9fe('0x2e')],_0x118078[_0xc9fe('0x2f')]);_0x537a6e[_0xc9fe('0x31')]=_[_0xc9fe('0x30')](_0x118078[_0xc9fe('0x2e')],qs[_0xc9fe('0x32')](_0x3043d6[_0xc9fe('0x2f')][_0xc9fe('0x32')]));_0x537a6e[_0xc9fe('0x31')]=_0x537a6e[_0xc9fe('0x31')][_0xc9fe('0x33')]?_0x537a6e['attributes']:_0x118078[_0xc9fe('0x2e')];if(_0x3043d6[_0xc9fe('0x2f')]['includeAll']){_0x537a6e['include']=[{'all':!![]}];}_0x537a6e=_[_0xc9fe('0x3c')]({},_0x537a6e,_0x3043d6[_0xc9fe('0x3e')]);return db[_0xc9fe('0x2a')][_0xc9fe('0x47')](_0x537a6e)[_0xc9fe('0x25')](handleEntityNotFound(_0x4e536f,null))[_0xc9fe('0x25')](respondWithResult(_0x4e536f,null))[_0xc9fe('0x43')](handleError(_0x4e536f,null));};exports[_0xc9fe('0x48')]=function(_0x4619e4,_0x209d37){return db[_0xc9fe('0x2a')]['create'](_0x4619e4[_0xc9fe('0x49')],{})['then'](respondWithResult(_0x209d37,0xc9))[_0xc9fe('0x43')](handleError(_0x209d37,null));};exports[_0xc9fe('0x24')]=function(_0x2afb61,_0x1b5288){if(_0x2afb61[_0xc9fe('0x49')]['id']){delete _0x2afb61[_0xc9fe('0x49')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0x2afb61['params']['id']}})[_0xc9fe('0x25')](handleEntityNotFound(_0x1b5288,null))[_0xc9fe('0x25')](saveUpdates(_0x2afb61[_0xc9fe('0x49')],null))[_0xc9fe('0x25')](respondWithResult(_0x1b5288,null))[_0xc9fe('0x43')](handleError(_0x1b5288,null));};exports['destroy']=function(_0x43646f,_0x595852){return db[_0xc9fe('0x2a')][_0xc9fe('0x47')]({'where':{'id':_0x43646f[_0xc9fe('0x45')]['id']}})[_0xc9fe('0x25')](handleEntityNotFound(_0x595852,null))[_0xc9fe('0x25')](removeEntity(_0x595852,null))['catch'](handleError(_0x595852,null));};exports['getConfigurations']=function(_0x4046d2,_0x87dc00,_0x361e5c){var _0x213dca={};var _0x156b83={};var _0xd2d85b;var _0x35149e;return db[_0xc9fe('0x2a')][_0xc9fe('0x4a')]({'where':{'id':_0x4046d2[_0xc9fe('0x45')]['id']}})['then'](handleEntityNotFound(_0x87dc00,null))['then'](function(_0x305070){if(_0x305070){_0xd2d85b=_0x305070;_0x156b83['model']=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x156b83['query']=_[_0xc9fe('0x46')](_0x4046d2[_0xc9fe('0x2f')]);_0x156b83['filters']=_['intersection'](_0x156b83[_0xc9fe('0x2e')],_0x156b83['query']);_0x213dca['attributes']=_['intersection'](_0x156b83[_0xc9fe('0x2e')],qs[_0xc9fe('0x32')](_0x4046d2[_0xc9fe('0x2f')][_0xc9fe('0x32')]));_0x213dca[_0xc9fe('0x31')]=_0x213dca[_0xc9fe('0x31')][_0xc9fe('0x33')]?_0x213dca[_0xc9fe('0x31')]:_0x156b83[_0xc9fe('0x2e')];_0x213dca['order']=qs[_0xc9fe('0x37')](_0x4046d2['query'][_0xc9fe('0x37')]);_0x213dca[_0xc9fe('0x3b')]=qs[_0xc9fe('0x38')](_[_0xc9fe('0x39')](_0x4046d2[_0xc9fe('0x2f')],_0x156b83[_0xc9fe('0x38')]));if(_0x4046d2[_0xc9fe('0x2f')][_0xc9fe('0x3a')]){_0x213dca['where']=_['merge'](_0x213dca[_0xc9fe('0x3b')],{'$or':_[_0xc9fe('0x29')](_0x213dca[_0xc9fe('0x31')],function(_0x4cebde){var _0x251c2a={};_0x251c2a[_0x4cebde]={'$like':'%'+_0x4046d2[_0xc9fe('0x2f')]['filter']+'%'};return _0x251c2a;})});}_0x213dca=_['merge']({},_0x213dca,_0x4046d2[_0xc9fe('0x3e')]);return _0xd2d85b[_0xc9fe('0x4b')](_0x213dca);}})[_0xc9fe('0x25')](function(_0x2b0051){if(_0x2b0051){_0x35149e=_0x2b0051[_0xc9fe('0x33')];if(!_0x4046d2['query'][_0xc9fe('0x34')]('nolimit')){_0x213dca[_0xc9fe('0x1e')]=qs[_0xc9fe('0x1e')](_0x4046d2[_0xc9fe('0x2f')]['limit']);_0x213dca[_0xc9fe('0x1d')]=qs[_0xc9fe('0x1d')](_0x4046d2['query'][_0xc9fe('0x1d')]);}return _0xd2d85b[_0xc9fe('0x4b')](_0x213dca);}})[_0xc9fe('0x25')](function(_0x360d03){if(_0x360d03){return _0x360d03?{'count':_0x35149e,'rows':_0x360d03}:null;}})[_0xc9fe('0x25')](respondWithResult(_0x87dc00,null))[_0xc9fe('0x43')](handleError(_0x87dc00,null));};exports[_0xc9fe('0x4c')]=function(_0x1dcded,_0x336841,_0x873fbf){if(_0x1dcded[_0xc9fe('0x49')]['id']){delete _0x1dcded[_0xc9fe('0x49')]['id'];}return db[_0xc9fe('0x2a')][_0xc9fe('0x4a')]({'where':{'id':_0x1dcded['params']['id']}})[_0xc9fe('0x25')](handleEntityNotFound(_0x336841,null))[_0xc9fe('0x25')](function(_0x4cf92b){if(_0x4cf92b){_0x1dcded['body']['AccountId']=_0x4cf92b['id'];_0x1dcded[_0xc9fe('0x49')][_0xc9fe('0x4d')]=integrations[_0xc9fe('0x4e')](_0x1dcded[_0xc9fe('0x49')][_0xc9fe('0x4f')],_0x1dcded['body'][_0xc9fe('0x2d')]);_0x1dcded[_0xc9fe('0x49')][_0xc9fe('0x50')]=integrations[_0xc9fe('0x51')](_0x1dcded[_0xc9fe('0x49')][_0xc9fe('0x4f')],_0x1dcded[_0xc9fe('0x49')][_0xc9fe('0x2d')]);return db[_0xc9fe('0x52')][_0xc9fe('0x48')](_0x1dcded[_0xc9fe('0x49')],{'include':[{'model':db[_0xc9fe('0x53')],'as':_0xc9fe('0x4d')},{'model':db[_0xc9fe('0x53')],'as':_0xc9fe('0x50')}]});}return null;})[_0xc9fe('0x25')](respondWithResult(_0x336841,null))[_0xc9fe('0x43')](handleError(_0x336841,null));};exports[_0xc9fe('0x54')]=function(_0x38b003,_0x49fb9d,_0x19d777){var _0x249f68=[{'name':'priority','label':_0xc9fe('0x55'),'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 _0x227431='';return db[_0xc9fe('0x2a')][_0xc9fe('0x4a')]({'where':{'id':_0x38b003['params']['id']},'attributes':['id','remoteUri',_0xc9fe('0x56'),'username',_0xc9fe('0x57'),'consumerKey',_0xc9fe('0x58'),_0xc9fe('0x59'),_0xc9fe('0x5a')]})[_0xc9fe('0x25')](handleEntityNotFound(_0x49fb9d,null))[_0xc9fe('0x25')](function(_0x2e996b){if(_0x2e996b){_0x227431=_0x2e996b[_0xc9fe('0x5b')];var _0x4d9681=_0x227431[_0xc9fe('0x5c')](-0x1);if(_0x4d9681==='/'){_0x227431=_0x227431['substring'](0x0,_0x227431['lastIndexOf'](_0x4d9681));}var _0x4dec7b={'method':_0xc9fe('0x5d'),'uri':util[_0xc9fe('0x5e')]('%s/custom_fields',_0x227431),'headers':{'Content-Type':_0xc9fe('0x5f'),'Accept':'application/json'},'json':!![]};if(_0x2e996b[_0xc9fe('0x56')]===_0xc9fe('0x60')){_0x4dec7b[_0xc9fe('0x61')][_0xc9fe('0x62')]=util[_0xc9fe('0x5e')](_0xc9fe('0x63'),new Buffer(util[_0xc9fe('0x5e')](_0xc9fe('0x64'),_0x2e996b[_0xc9fe('0x65')],_0x2e996b[_0xc9fe('0x57')]))[_0xc9fe('0x66')](_0xc9fe('0x67')));}return rp(_0x4dec7b)['then'](function(_0x548483){return _0x249f68[_0xc9fe('0x68')](_[_0xc9fe('0x29')](_0x548483['_embedded']['entries'],function(_0x3d790c){return{'id':_0x3d790c[_0xc9fe('0x27')],'name':_0x3d790c[_0xc9fe('0x27')],'type':_0x3d790c['type'],'active':_0x3d790c['active'],'label':_0x3d790c[_0xc9fe('0x69')],'custom':!![]};}));});}})[_0xc9fe('0x25')](function(_0x6dbaf3){return{'count':_0x6dbaf3['length'],'rows':_0x6dbaf3};})[_0xc9fe('0x25')](respondWithResult(_0x49fb9d,null))['catch'](function(_0x1e3269){var _0x3e88d2=_0x38b003[_0xc9fe('0x2f')][_0xc9fe('0x6a')]?0x1f4:_0x1e3269['statusCode']||0x1f4;logger[_0xc9fe('0x6b')](_0xc9fe('0x6c'),_0xc9fe('0x54'),_0x3e88d2,JSON['stringify'](_0x1e3269));delete _0x1e3269[_0xc9fe('0x27')];if(_0x3e88d2===0x191){_0x3e88d2=0x190;}_0x49fb9d[_0xc9fe('0x19')](_0x3e88d2)['send'](_0x38b003['query'][_0xc9fe('0x6a')]?{'message':_0xc9fe('0x6d'),'statusCode':_0x1e3269[_0xc9fe('0x6e')]}:_0x1e3269);});}; \ No newline at end of file +var _0xfc49=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','merge','find','catch','create','update','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','token','tokenSecret','slice','lastIndexOf','format','application/json','basic','headers','Authorization','%s:%s','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','request-promise','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0xdf262,_0x170322){var _0x433b0d=function(_0x401919){while(--_0x401919){_0xdf262['push'](_0xdf262['shift']());}};_0x433b0d(++_0x170322);}(_0xfc49,0x137));var _0x9fc4=function(_0x2c3660,_0x29d682){_0x2c3660=_0x2c3660-0x0;var _0x2017e1=_0xfc49[_0x2c3660];return _0x2017e1;};'use strict';var emlformat=require(_0x9fc4('0x0'));var rimraf=require(_0x9fc4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9fc4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9fc4('0x3'));var path=require(_0x9fc4('0x4'));var sox=require(_0x9fc4('0x5'));var csv=require(_0x9fc4('0x6'));var ejs=require(_0x9fc4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9fc4('0x8'));var jsforce=require(_0x9fc4('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9fc4('0xa'));var Papa=require(_0x9fc4('0xb'));var Redis=require(_0x9fc4('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9fc4('0xd'));var as=require(_0x9fc4('0xe'));var hardwareService=require(_0x9fc4('0xf'));var logger=require(_0x9fc4('0x10'))('api');var utils=require(_0x9fc4('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x9fc4('0x12'));var db=require(_0x9fc4('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x65a18,_0x2a72ae){_0x2a72ae=_0x2a72ae||0xcc;return function(_0x33e9dd){if(_0x33e9dd){return _0x65a18[_0x9fc4('0x14')](_0x2a72ae);}return _0x65a18[_0x9fc4('0x15')](_0x2a72ae)[_0x9fc4('0x16')]();};}function respondWithResult(_0x253d70,_0x479f14){_0x479f14=_0x479f14||0xc8;return function(_0x2cd3cf){if(_0x2cd3cf){return _0x253d70['status'](_0x479f14)['json'](_0x2cd3cf);}};}function respondWithFilteredResult(_0x33ca57,_0x44c54f){return function(_0x3b1aa1){if(_0x3b1aa1){var _0x977a51=typeof _0x44c54f[_0x9fc4('0x17')]===_0x9fc4('0x18')&&typeof _0x44c54f[_0x9fc4('0x19')]===_0x9fc4('0x18');var _0x3c7047=_0x3b1aa1['count'];var _0x5a65a6=_0x977a51?0x0:_0x44c54f[_0x9fc4('0x17')];var _0x2e98b0=_0x977a51?_0x3b1aa1[_0x9fc4('0x1a')]:_0x44c54f['offset']+_0x44c54f[_0x9fc4('0x19')];var _0xff47f4;if(_0x2e98b0>=_0x3c7047){_0x2e98b0=_0x3c7047;_0xff47f4=0xc8;}else{_0xff47f4=0xce;}_0x33ca57['status'](_0xff47f4);return _0x33ca57['set'](_0x9fc4('0x1b'),_0x5a65a6+'-'+_0x2e98b0+'/'+_0x3c7047)[_0x9fc4('0x1c')](_0x3b1aa1);}return null;};}function patchUpdates(_0x358ba1){return function(_0x478cbc){try{jsonpatch['apply'](_0x478cbc,_0x358ba1,!![]);}catch(_0xa3fa7d){return BPromise[_0x9fc4('0x1d')](_0xa3fa7d);}return _0x478cbc[_0x9fc4('0x1e')]();};}function saveUpdates(_0x508165,_0x403b81){return function(_0x468cd2){if(_0x468cd2){return _0x468cd2['update'](_0x508165)[_0x9fc4('0x1f')](function(_0x563618){return _0x563618;});}return null;};}function removeEntity(_0x3449e5,_0x3532ca){return function(_0x21137a){if(_0x21137a){return _0x21137a[_0x9fc4('0x20')]()[_0x9fc4('0x1f')](function(){_0x3449e5[_0x9fc4('0x15')](0xcc)[_0x9fc4('0x16')]();});}};}function handleEntityNotFound(_0x522a7f,_0x51c027){return function(_0x277adb){if(!_0x277adb){_0x522a7f[_0x9fc4('0x14')](0x194);}return _0x277adb;};}function handleError(_0x25f1d3,_0x203e79){_0x203e79=_0x203e79||0x1f4;return function(_0x50d5eb){logger[_0x9fc4('0x21')](_0x50d5eb[_0x9fc4('0x22')]);if(_0x50d5eb[_0x9fc4('0x23')]){delete _0x50d5eb[_0x9fc4('0x23')];}_0x25f1d3['status'](_0x203e79)[_0x9fc4('0x24')](_0x50d5eb);};}exports[_0x9fc4('0x25')]=function(_0x4245e3,_0x54c276){var _0x29829f={},_0x430115={},_0x19977b={'count':0x0,'rows':[]};var _0x15bf32=_[_0x9fc4('0x26')](db[_0x9fc4('0x27')][_0x9fc4('0x28')],function(_0x22800a){return{'name':_0x22800a[_0x9fc4('0x29')],'type':_0x22800a[_0x9fc4('0x2a')][_0x9fc4('0x2b')]};});_0x430115['model']=_[_0x9fc4('0x26')](_0x15bf32,_0x9fc4('0x23'));_0x430115[_0x9fc4('0x2c')]=_[_0x9fc4('0x2d')](_0x4245e3[_0x9fc4('0x2c')]);_0x430115[_0x9fc4('0x2e')]=_[_0x9fc4('0x2f')](_0x430115['model'],_0x430115[_0x9fc4('0x2c')]);_0x29829f[_0x9fc4('0x30')]=_[_0x9fc4('0x2f')](_0x430115['model'],qs[_0x9fc4('0x31')](_0x4245e3['query'][_0x9fc4('0x31')]));_0x29829f[_0x9fc4('0x30')]=_0x29829f[_0x9fc4('0x30')][_0x9fc4('0x32')]?_0x29829f[_0x9fc4('0x30')]:_0x430115[_0x9fc4('0x33')];if(!_0x4245e3['query'][_0x9fc4('0x34')](_0x9fc4('0x35'))){_0x29829f[_0x9fc4('0x19')]=qs[_0x9fc4('0x19')](_0x4245e3[_0x9fc4('0x2c')][_0x9fc4('0x19')]);_0x29829f[_0x9fc4('0x17')]=qs[_0x9fc4('0x17')](_0x4245e3[_0x9fc4('0x2c')]['offset']);}_0x29829f[_0x9fc4('0x36')]=qs[_0x9fc4('0x37')](_0x4245e3[_0x9fc4('0x2c')][_0x9fc4('0x37')]);_0x29829f['where']=qs[_0x9fc4('0x2e')](_['pick'](_0x4245e3[_0x9fc4('0x2c')],_0x430115[_0x9fc4('0x2e')]),_0x15bf32);if(_0x4245e3['query'][_0x9fc4('0x38')]){_0x29829f[_0x9fc4('0x39')]=_['merge'](_0x29829f[_0x9fc4('0x39')],{'$or':_[_0x9fc4('0x26')](_0x15bf32,function(_0x102fad){if(_0x102fad[_0x9fc4('0x2a')]!==_0x9fc4('0x3a')){var _0x356b17={};_0x356b17[_0x102fad['name']]={'$like':'%'+_0x4245e3[_0x9fc4('0x2c')][_0x9fc4('0x38')]+'%'};return _0x356b17;}})});}_0x29829f=_['merge']({},_0x29829f,_0x4245e3[_0x9fc4('0x3b')]);var _0x54a377={'where':_0x29829f['where']};return db[_0x9fc4('0x27')][_0x9fc4('0x1a')](_0x54a377)[_0x9fc4('0x1f')](function(_0x30741d){_0x19977b[_0x9fc4('0x1a')]=_0x30741d;if(_0x4245e3['query'][_0x9fc4('0x3c')]){_0x29829f[_0x9fc4('0x3d')]=[{'all':!![]}];}return db[_0x9fc4('0x27')][_0x9fc4('0x3e')](_0x29829f);})[_0x9fc4('0x1f')](function(_0x419269){_0x19977b[_0x9fc4('0x3f')]=_0x419269;return _0x19977b;})[_0x9fc4('0x1f')](respondWithFilteredResult(_0x54c276,_0x29829f))['catch'](handleError(_0x54c276,null));};exports[_0x9fc4('0x40')]=function(_0x526fe1,_0x89dcf8){var _0x533b74={'raw':![],'where':{'id':_0x526fe1[_0x9fc4('0x41')]['id']}},_0x1debdb={};_0x1debdb[_0x9fc4('0x33')]=_['keys'](db[_0x9fc4('0x27')][_0x9fc4('0x28')]);_0x1debdb[_0x9fc4('0x2c')]=_[_0x9fc4('0x2d')](_0x526fe1[_0x9fc4('0x2c')]);_0x1debdb[_0x9fc4('0x2e')]=_[_0x9fc4('0x2f')](_0x1debdb['model'],_0x1debdb[_0x9fc4('0x2c')]);_0x533b74[_0x9fc4('0x30')]=_[_0x9fc4('0x2f')](_0x1debdb[_0x9fc4('0x33')],qs[_0x9fc4('0x31')](_0x526fe1['query']['fields']));_0x533b74[_0x9fc4('0x30')]=_0x533b74[_0x9fc4('0x30')][_0x9fc4('0x32')]?_0x533b74[_0x9fc4('0x30')]:_0x1debdb['model'];if(_0x526fe1[_0x9fc4('0x2c')][_0x9fc4('0x3c')]){_0x533b74[_0x9fc4('0x3d')]=[{'all':!![]}];}_0x533b74=_[_0x9fc4('0x42')]({},_0x533b74,_0x526fe1['options']);return db['DeskAccount'][_0x9fc4('0x43')](_0x533b74)[_0x9fc4('0x1f')](handleEntityNotFound(_0x89dcf8,null))['then'](respondWithResult(_0x89dcf8,null))[_0x9fc4('0x44')](handleError(_0x89dcf8,null));};exports[_0x9fc4('0x45')]=function(_0x347a7b,_0x1bce0f){return db[_0x9fc4('0x27')][_0x9fc4('0x45')](_0x347a7b['body'],{})['then'](respondWithResult(_0x1bce0f,0xc9))[_0x9fc4('0x44')](handleError(_0x1bce0f,null));};exports[_0x9fc4('0x46')]=function(_0x1f040f,_0x124d71){if(_0x1f040f[_0x9fc4('0x47')]['id']){delete _0x1f040f[_0x9fc4('0x47')]['id'];}return db[_0x9fc4('0x27')][_0x9fc4('0x43')]({'where':{'id':_0x1f040f[_0x9fc4('0x41')]['id']}})[_0x9fc4('0x1f')](handleEntityNotFound(_0x124d71,null))[_0x9fc4('0x1f')](saveUpdates(_0x1f040f[_0x9fc4('0x47')],null))[_0x9fc4('0x1f')](respondWithResult(_0x124d71,null))['catch'](handleError(_0x124d71,null));};exports[_0x9fc4('0x20')]=function(_0x25df96,_0x5dd349){return db[_0x9fc4('0x27')]['find']({'where':{'id':_0x25df96['params']['id']}})[_0x9fc4('0x1f')](handleEntityNotFound(_0x5dd349,null))[_0x9fc4('0x1f')](removeEntity(_0x5dd349,null))[_0x9fc4('0x44')](handleError(_0x5dd349,null));};exports[_0x9fc4('0x48')]=function(_0x39feca,_0x44eb1d,_0x5a05aa){var _0xd00a51={};var _0x98e17={};var _0x442b55;var _0x10ea7c;return db[_0x9fc4('0x27')][_0x9fc4('0x49')]({'where':{'id':_0x39feca[_0x9fc4('0x41')]['id']}})['then'](handleEntityNotFound(_0x44eb1d,null))[_0x9fc4('0x1f')](function(_0x34c0fd){if(_0x34c0fd){_0x442b55=_0x34c0fd;_0x98e17['model']=_[_0x9fc4('0x2d')](db['DeskConfiguration'][_0x9fc4('0x28')]);_0x98e17[_0x9fc4('0x2c')]=_['keys'](_0x39feca[_0x9fc4('0x2c')]);_0x98e17['filters']=_[_0x9fc4('0x2f')](_0x98e17['model'],_0x98e17[_0x9fc4('0x2c')]);_0xd00a51['attributes']=_[_0x9fc4('0x2f')](_0x98e17['model'],qs[_0x9fc4('0x31')](_0x39feca[_0x9fc4('0x2c')][_0x9fc4('0x31')]));_0xd00a51['attributes']=_0xd00a51[_0x9fc4('0x30')]['length']?_0xd00a51[_0x9fc4('0x30')]:_0x98e17[_0x9fc4('0x33')];_0xd00a51[_0x9fc4('0x36')]=qs[_0x9fc4('0x37')](_0x39feca[_0x9fc4('0x2c')][_0x9fc4('0x37')]);_0xd00a51[_0x9fc4('0x39')]=qs[_0x9fc4('0x2e')](_['pick'](_0x39feca[_0x9fc4('0x2c')],_0x98e17[_0x9fc4('0x2e')]));if(_0x39feca['query'][_0x9fc4('0x38')]){_0xd00a51[_0x9fc4('0x39')]=_[_0x9fc4('0x42')](_0xd00a51['where'],{'$or':_[_0x9fc4('0x26')](_0xd00a51[_0x9fc4('0x30')],function(_0x28cf11){var _0x5f19eb={};_0x5f19eb[_0x28cf11]={'$like':'%'+_0x39feca[_0x9fc4('0x2c')][_0x9fc4('0x38')]+'%'};return _0x5f19eb;})});}_0xd00a51=_[_0x9fc4('0x42')]({},_0xd00a51,_0x39feca[_0x9fc4('0x3b')]);return _0x442b55[_0x9fc4('0x48')](_0xd00a51);}})[_0x9fc4('0x1f')](function(_0x136dcf){if(_0x136dcf){_0x10ea7c=_0x136dcf[_0x9fc4('0x32')];if(!_0x39feca[_0x9fc4('0x2c')][_0x9fc4('0x34')]('nolimit')){_0xd00a51[_0x9fc4('0x19')]=qs[_0x9fc4('0x19')](_0x39feca[_0x9fc4('0x2c')][_0x9fc4('0x19')]);_0xd00a51[_0x9fc4('0x17')]=qs[_0x9fc4('0x17')](_0x39feca['query'][_0x9fc4('0x17')]);}return _0x442b55['getConfigurations'](_0xd00a51);}})[_0x9fc4('0x1f')](function(_0x5db436){if(_0x5db436){return _0x5db436?{'count':_0x10ea7c,'rows':_0x5db436}:null;}})[_0x9fc4('0x1f')](respondWithResult(_0x44eb1d,null))[_0x9fc4('0x44')](handleError(_0x44eb1d,null));};exports[_0x9fc4('0x4a')]=function(_0x46084c,_0x2b3f62,_0xfe95ae){if(_0x46084c['body']['id']){delete _0x46084c[_0x9fc4('0x47')]['id'];}return db[_0x9fc4('0x27')][_0x9fc4('0x49')]({'where':{'id':_0x46084c[_0x9fc4('0x41')]['id']}})[_0x9fc4('0x1f')](handleEntityNotFound(_0x2b3f62,null))[_0x9fc4('0x1f')](function(_0x2062d8){if(_0x2062d8){_0x46084c['body'][_0x9fc4('0x4b')]=_0x2062d8['id'];_0x46084c[_0x9fc4('0x47')][_0x9fc4('0x4c')]=integrations[_0x9fc4('0x4d')](_0x46084c[_0x9fc4('0x47')][_0x9fc4('0x4e')],_0x46084c[_0x9fc4('0x47')][_0x9fc4('0x2a')]);_0x46084c['body'][_0x9fc4('0x4f')]=integrations[_0x9fc4('0x50')](_0x46084c['body'][_0x9fc4('0x4e')],_0x46084c[_0x9fc4('0x47')][_0x9fc4('0x2a')]);return db[_0x9fc4('0x51')][_0x9fc4('0x45')](_0x46084c['body'],{'include':[{'model':db[_0x9fc4('0x52')],'as':_0x9fc4('0x4c')},{'model':db[_0x9fc4('0x52')],'as':_0x9fc4('0x4f')}]});}return null;})[_0x9fc4('0x1f')](respondWithResult(_0x2b3f62,null))['catch'](handleError(_0x2b3f62,null));};exports[_0x9fc4('0x53')]=function(_0x34cac0,_0x51e4fd,_0x57fe9b){var _0xb0c05b=[{'name':_0x9fc4('0x54'),'label':_0x9fc4('0x54'),'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 _0x49f02b='';return db[_0x9fc4('0x27')][_0x9fc4('0x49')]({'where':{'id':_0x34cac0[_0x9fc4('0x41')]['id']},'attributes':['id',_0x9fc4('0x55'),_0x9fc4('0x56'),_0x9fc4('0x57'),_0x9fc4('0x58'),_0x9fc4('0x59'),'consumerSecret',_0x9fc4('0x5a'),_0x9fc4('0x5b')]})[_0x9fc4('0x1f')](handleEntityNotFound(_0x51e4fd,null))[_0x9fc4('0x1f')](function(_0x41cbd7){if(_0x41cbd7){_0x49f02b=_0x41cbd7[_0x9fc4('0x55')];var _0x246948=_0x49f02b[_0x9fc4('0x5c')](-0x1);if(_0x246948==='/'){_0x49f02b=_0x49f02b['substring'](0x0,_0x49f02b[_0x9fc4('0x5d')](_0x246948));}var _0xe95934={'method':'GET','uri':util[_0x9fc4('0x5e')]('%s/custom_fields',_0x49f02b),'headers':{'Content-Type':_0x9fc4('0x5f'),'Accept':_0x9fc4('0x5f')},'json':!![]};if(_0x41cbd7['authType']===_0x9fc4('0x60')){_0xe95934[_0x9fc4('0x61')][_0x9fc4('0x62')]=util['format']('Basic\x20%s',new Buffer(util[_0x9fc4('0x5e')](_0x9fc4('0x63'),_0x41cbd7[_0x9fc4('0x57')],_0x41cbd7[_0x9fc4('0x58')]))['toString']('base64'));}return rp(_0xe95934)[_0x9fc4('0x1f')](function(_0x3a1e0e){return _0xb0c05b[_0x9fc4('0x64')](_[_0x9fc4('0x26')](_0x3a1e0e[_0x9fc4('0x65')][_0x9fc4('0x66')],function(_0x45dc6c){return{'id':_0x45dc6c[_0x9fc4('0x23')],'name':_0x45dc6c[_0x9fc4('0x23')],'type':_0x45dc6c[_0x9fc4('0x2a')],'active':_0x45dc6c[_0x9fc4('0x67')],'label':_0x45dc6c[_0x9fc4('0x68')],'custom':!![]};}));});}})[_0x9fc4('0x1f')](function(_0x246447){return{'count':_0x246447[_0x9fc4('0x32')],'rows':_0x246447};})[_0x9fc4('0x1f')](respondWithResult(_0x51e4fd,null))[_0x9fc4('0x44')](function(_0x4ff194){var _0x1c78c0=_0x34cac0['query'][_0x9fc4('0x69')]?0x1f4:_0x4ff194[_0x9fc4('0x6a')]||0x1f4;logger[_0x9fc4('0x21')](_0x9fc4('0x6b'),_0x9fc4('0x53'),_0x1c78c0,JSON['stringify'](_0x4ff194));delete _0x4ff194[_0x9fc4('0x23')];if(_0x1c78c0===0x191){_0x1c78c0=0x190;}_0x51e4fd[_0x9fc4('0x15')](_0x1c78c0)[_0x9fc4('0x24')](_0x34cac0[_0x9fc4('0x2c')][_0x9fc4('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x4ff194[_0x9fc4('0x6a')]}:_0x4ff194);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 0a2c78a..a67b196 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 _0x0e48=['request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','util','../../config/logger','api','bluebird'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x0e48,0x141));var _0x80e4=function(_0x398735,_0x3eb86f){_0x398735=_0x398735-0x0;var _0x1ef779=_0x0e48[_0x398735];return _0x1ef779;};'use strict';var _=require('lodash');var util=require(_0x80e4('0x0'));var logger=require(_0x80e4('0x1'))(_0x80e4('0x2'));var moment=require('moment');var BPromise=require(_0x80e4('0x3'));var rp=require(_0x80e4('0x4'));var fs=require('fs');var path=require(_0x80e4('0x5'));var rimraf=require(_0x80e4('0x6'));var config=require(_0x80e4('0x7'));var attributes=require(_0x80e4('0x8'));var integrations=require(_0x80e4('0x9'));module[_0x80e4('0xa')]=function(_0x48688b,_0x55aa1e){return _0x48688b[_0x80e4('0xb')](_0x80e4('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9848=['bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x9848,0x1b7));var _0x8984=function(_0x1c4916,_0x27568c){_0x1c4916=_0x1c4916-0x0;var _0x3cc16a=_0x9848[_0x1c4916];return _0x3cc16a;};'use strict';var _=require(_0x8984('0x0'));var util=require(_0x8984('0x1'));var logger=require(_0x8984('0x2'))(_0x8984('0x3'));var moment=require(_0x8984('0x4'));var BPromise=require(_0x8984('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8984('0x6'));var rimraf=require(_0x8984('0x7'));var config=require(_0x8984('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x8984('0x9'));module[_0x8984('0xa')]=function(_0x8a4a1d,_0x5a5c79){return _0x8a4a1d[_0x8984('0xb')]('DeskAccount',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 37d3759..436aeab 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 _0x6533=['where','attributes','limit','map','model','include','GetDeskAccount','ShowDeskAccount','DeskAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','client','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw'];(function(_0x4648d0,_0x111f70){var _0x43e744=function(_0x45bae5){while(--_0x45bae5){_0x4648d0['push'](_0x4648d0['shift']());}};_0x43e744(++_0x111f70);}(_0x6533,0x149));var _0x3653=function(_0x49e020,_0x3a2b9f){_0x49e020=_0x49e020-0x0;var _0x62c30c=_0x6533[_0x49e020];return _0x62c30c;};'use strict';var _=require(_0x3653('0x0'));var util=require(_0x3653('0x1'));var moment=require('moment');var BPromise=require(_0x3653('0x2'));var rs=require(_0x3653('0x3'));var fs=require('fs');var Redis=require(_0x3653('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3653('0x5'));var logger=require('../../config/logger')(_0x3653('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3653('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ac0d6,_0x79a127,_0x289832){return new BPromise(function(_0x4e42c6,_0x5d5c4f){return client[_0x3653('0x8')](_0x3ac0d6,_0x289832)[_0x3653('0x9')](function(_0x51a198){logger[_0x3653('0xa')](_0x3653('0xb'),_0x79a127,'request\x20sent');logger[_0x3653('0xc')](_0x3653('0xd'),_0x79a127,_0x3653('0xe'),JSON[_0x3653('0xf')](_0x51a198));if(_0x51a198[_0x3653('0x10')]){if(_0x51a198['error'][_0x3653('0x11')]===0x1f4){logger[_0x3653('0x10')](_0x3653('0xb'),_0x79a127,_0x51a198['error']['message']);return _0x5d5c4f(_0x51a198[_0x3653('0x10')][_0x3653('0x12')]);}logger[_0x3653('0x10')](_0x3653('0xb'),_0x79a127,_0x51a198[_0x3653('0x10')][_0x3653('0x12')]);return _0x4e42c6(_0x51a198[_0x3653('0x10')][_0x3653('0x12')]);}else{logger[_0x3653('0xa')]('DeskAccount,\x20%s,\x20%s',_0x79a127,_0x3653('0xe'));_0x4e42c6(_0x51a198[_0x3653('0x13')][_0x3653('0x12')]);}})[_0x3653('0x14')](function(_0x3db38b){logger[_0x3653('0x10')](_0x3653('0xb'),_0x79a127,_0x3db38b);_0x5d5c4f(_0x3db38b);});});}exports['GetDeskAccount']=function(_0x161532){var _0x1f88de=this;return new Promise(function(_0x30e0f8,_0x1b20ab){return db['DeskAccount']['findAll']({'raw':_0x161532['options']?_0x161532[_0x3653('0x15')][_0x3653('0x16')]===undefined?!![]:![]:!![],'where':_0x161532[_0x3653('0x15')]?_0x161532[_0x3653('0x15')][_0x3653('0x17')]||null:null,'attributes':_0x161532['options']?_0x161532[_0x3653('0x15')][_0x3653('0x18')]||null:null,'limit':_0x161532[_0x3653('0x15')]?_0x161532[_0x3653('0x15')][_0x3653('0x19')]||null:null,'include':_0x161532['options']?_0x161532[_0x3653('0x15')]['include']?_[_0x3653('0x1a')](_0x161532[_0x3653('0x15')]['include'],function(_0x4142d8){return{'model':db[_0x4142d8[_0x3653('0x1b')]],'as':_0x4142d8['as'],'attributes':_0x4142d8[_0x3653('0x18')],'include':_0x4142d8[_0x3653('0x1c')]?_[_0x3653('0x1a')](_0x4142d8['include'],function(_0x44a514){return{'model':db[_0x44a514[_0x3653('0x1b')]],'as':_0x44a514['as'],'attributes':_0x44a514[_0x3653('0x18')],'include':_0x44a514[_0x3653('0x1c')]?_[_0x3653('0x1a')](_0x44a514[_0x3653('0x1c')],function(_0x26cd86){return{'model':db[_0x26cd86['model']],'as':_0x26cd86['as'],'attributes':_0x26cd86[_0x3653('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3653('0x9')](function(_0x447011){logger[_0x3653('0xa')]('GetDeskAccount',_0x161532);logger['debug'](_0x3653('0x1d'),_0x161532,JSON[_0x3653('0xf')](_0x447011));_0x30e0f8(_0x447011);})[_0x3653('0x14')](function(_0x22e6c9){logger[_0x3653('0x10')](_0x3653('0x1d'),_0x22e6c9['message'],_0x161532);_0x1b20ab(_0x1f88de[_0x3653('0x10')](0x1f4,_0x22e6c9[_0x3653('0x12')]));});});};exports[_0x3653('0x1e')]=function(_0x350a88){var _0x19aaff=this;return new Promise(function(_0x1491c6,_0x5f36aa){return db[_0x3653('0x1f')]['find']({'raw':_0x350a88[_0x3653('0x15')]?_0x350a88[_0x3653('0x15')][_0x3653('0x16')]===undefined?!![]:![]:!![],'where':_0x350a88[_0x3653('0x15')]?_0x350a88[_0x3653('0x15')][_0x3653('0x17')]||null:null,'attributes':_0x350a88[_0x3653('0x15')]?_0x350a88[_0x3653('0x15')][_0x3653('0x18')]||null:null,'include':_0x350a88[_0x3653('0x15')]?_0x350a88[_0x3653('0x15')][_0x3653('0x1c')]?_['map'](_0x350a88['options']['include'],function(_0x3124c2){return{'model':db[_0x3124c2[_0x3653('0x1b')]],'as':_0x3124c2['as'],'attributes':_0x3124c2[_0x3653('0x18')],'include':_0x3124c2['include']?_[_0x3653('0x1a')](_0x3124c2[_0x3653('0x1c')],function(_0x1c7390){return{'model':db[_0x1c7390[_0x3653('0x1b')]],'as':_0x1c7390['as'],'attributes':_0x1c7390[_0x3653('0x18')],'include':_0x1c7390['include']?_[_0x3653('0x1a')](_0x1c7390[_0x3653('0x1c')],function(_0x9370fb){return{'model':db[_0x9370fb['model']],'as':_0x9370fb['as'],'attributes':_0x9370fb[_0x3653('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3653('0x9')](function(_0x4a5bbf){logger[_0x3653('0xa')](_0x3653('0x1e'),_0x350a88);logger[_0x3653('0xc')]('ShowDeskAccount',_0x350a88,JSON[_0x3653('0xf')](_0x4a5bbf));_0x1491c6(_0x4a5bbf);})[_0x3653('0x14')](function(_0x35b793){logger[_0x3653('0x10')](_0x3653('0x1e'),_0x35b793[_0x3653('0x12')],_0x350a88);_0x5f36aa(_0x19aaff[_0x3653('0x10')](0x1f4,_0x35b793[_0x3653('0x12')]));});});}; \ No newline at end of file +var _0x0e08=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','GetDeskAccount','DeskAccount','ShowDeskAccount'];(function(_0x5739ec,_0x241825){var _0x327830=function(_0x327d45){while(--_0x327d45){_0x5739ec['push'](_0x5739ec['shift']());}};_0x327830(++_0x241825);}(_0x0e08,0x1a2));var _0x80e0=function(_0x217e08,_0x12f12d){_0x217e08=_0x217e08-0x0;var _0x20a856=_0x0e08[_0x217e08];return _0x20a856;};'use strict';var _=require(_0x80e0('0x0'));var util=require(_0x80e0('0x1'));var moment=require('moment');var BPromise=require(_0x80e0('0x2'));var rs=require(_0x80e0('0x3'));var fs=require('fs');var Redis=require(_0x80e0('0x4'));var db=require(_0x80e0('0x5'))['db'];var utils=require(_0x80e0('0x6'));var logger=require(_0x80e0('0x7'))(_0x80e0('0x8'));var config=require(_0x80e0('0x9'));var jayson=require(_0x80e0('0xa'));var client=jayson[_0x80e0('0xb')][_0x80e0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b92fc,_0x44cfb2,_0x5537aa){return new BPromise(function(_0x19f838,_0x204674){return client[_0x80e0('0xd')](_0x1b92fc,_0x5537aa)['then'](function(_0x45217f){logger[_0x80e0('0xe')](_0x80e0('0xf'),_0x44cfb2,'request\x20sent');logger['debug'](_0x80e0('0x10'),_0x44cfb2,_0x80e0('0x11'),JSON[_0x80e0('0x12')](_0x45217f));if(_0x45217f[_0x80e0('0x13')]){if(_0x45217f[_0x80e0('0x13')][_0x80e0('0x14')]===0x1f4){logger[_0x80e0('0x13')]('DeskAccount,\x20%s,\x20%s',_0x44cfb2,_0x45217f[_0x80e0('0x13')][_0x80e0('0x15')]);return _0x204674(_0x45217f[_0x80e0('0x13')][_0x80e0('0x15')]);}logger[_0x80e0('0x13')]('DeskAccount,\x20%s,\x20%s',_0x44cfb2,_0x45217f['error'][_0x80e0('0x15')]);return _0x19f838(_0x45217f[_0x80e0('0x13')][_0x80e0('0x15')]);}else{logger[_0x80e0('0xe')](_0x80e0('0xf'),_0x44cfb2,_0x80e0('0x11'));_0x19f838(_0x45217f[_0x80e0('0x16')][_0x80e0('0x15')]);}})[_0x80e0('0x17')](function(_0x42c63a){logger[_0x80e0('0x13')](_0x80e0('0xf'),_0x44cfb2,_0x42c63a);_0x204674(_0x42c63a);});});}exports['GetDeskAccount']=function(_0x417c64){var _0x41357a=this;return new Promise(function(_0x4a6a51,_0x4dd04b){return db['DeskAccount'][_0x80e0('0x18')]({'raw':_0x417c64[_0x80e0('0x19')]?_0x417c64['options'][_0x80e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x417c64[_0x80e0('0x19')]?_0x417c64['options'][_0x80e0('0x1b')]||null:null,'attributes':_0x417c64['options']?_0x417c64[_0x80e0('0x19')][_0x80e0('0x1c')]||null:null,'limit':_0x417c64['options']?_0x417c64[_0x80e0('0x19')][_0x80e0('0x1d')]||null:null,'include':_0x417c64[_0x80e0('0x19')]?_0x417c64[_0x80e0('0x19')][_0x80e0('0x1e')]?_[_0x80e0('0x1f')](_0x417c64[_0x80e0('0x19')]['include'],function(_0x2e10a1){return{'model':db[_0x2e10a1[_0x80e0('0x20')]],'as':_0x2e10a1['as'],'attributes':_0x2e10a1[_0x80e0('0x1c')],'include':_0x2e10a1[_0x80e0('0x1e')]?_[_0x80e0('0x1f')](_0x2e10a1[_0x80e0('0x1e')],function(_0xf0a1fb){return{'model':db[_0xf0a1fb[_0x80e0('0x20')]],'as':_0xf0a1fb['as'],'attributes':_0xf0a1fb[_0x80e0('0x1c')],'include':_0xf0a1fb[_0x80e0('0x1e')]?_[_0x80e0('0x1f')](_0xf0a1fb[_0x80e0('0x1e')],function(_0x375f61){return{'model':db[_0x375f61['model']],'as':_0x375f61['as'],'attributes':_0x375f61[_0x80e0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x80e0('0x21')](function(_0x2a2d39){logger[_0x80e0('0xe')]('GetDeskAccount',_0x417c64);logger[_0x80e0('0x22')](_0x80e0('0x23'),_0x417c64,JSON['stringify'](_0x2a2d39));_0x4a6a51(_0x2a2d39);})[_0x80e0('0x17')](function(_0x2814b7){logger['error'](_0x80e0('0x23'),_0x2814b7[_0x80e0('0x15')],_0x417c64);_0x4dd04b(_0x41357a['error'](0x1f4,_0x2814b7[_0x80e0('0x15')]));});});};exports['ShowDeskAccount']=function(_0x1606f0){var _0x5833c2=this;return new Promise(function(_0x6be5c9,_0x4136a){return db[_0x80e0('0x24')]['find']({'raw':_0x1606f0[_0x80e0('0x19')]?_0x1606f0[_0x80e0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1606f0[_0x80e0('0x19')]?_0x1606f0['options'][_0x80e0('0x1b')]||null:null,'attributes':_0x1606f0[_0x80e0('0x19')]?_0x1606f0[_0x80e0('0x19')][_0x80e0('0x1c')]||null:null,'include':_0x1606f0['options']?_0x1606f0[_0x80e0('0x19')]['include']?_[_0x80e0('0x1f')](_0x1606f0[_0x80e0('0x19')]['include'],function(_0x497fcf){return{'model':db[_0x497fcf[_0x80e0('0x20')]],'as':_0x497fcf['as'],'attributes':_0x497fcf[_0x80e0('0x1c')],'include':_0x497fcf[_0x80e0('0x1e')]?_[_0x80e0('0x1f')](_0x497fcf['include'],function(_0x2d8bcc){return{'model':db[_0x2d8bcc[_0x80e0('0x20')]],'as':_0x2d8bcc['as'],'attributes':_0x2d8bcc['attributes'],'include':_0x2d8bcc[_0x80e0('0x1e')]?_[_0x80e0('0x1f')](_0x2d8bcc[_0x80e0('0x1e')],function(_0x45d8c1){return{'model':db[_0x45d8c1[_0x80e0('0x20')]],'as':_0x45d8c1['as'],'attributes':_0x45d8c1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b0db2){logger['info'](_0x80e0('0x25'),_0x1606f0);logger[_0x80e0('0x22')](_0x80e0('0x25'),_0x1606f0,JSON['stringify'](_0x5b0db2));_0x6be5c9(_0x5b0db2);})[_0x80e0('0x17')](function(_0x17d6ed){logger['error']('ShowDeskAccount',_0x17d6ed[_0x80e0('0x15')],_0x1606f0);_0x4136a(_0x5833c2[_0x80e0('0x13')](0x1f4,_0x17d6ed[_0x80e0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5576f83..b75b0aa 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x20738d,_0x2996c1){var _0x9bd611=function(_0x2b0d0a){while(--_0x2b0d0a){_0x20738d['push'](_0x20738d['shift']());}};_0x9bd611(++_0x2996c1);}(_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/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _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(_0x733404,_0x5c9baf){var _0x41dd6f=function(_0x33c833){while(--_0x33c833){_0x733404['push'](_0x733404['shift']());}};_0x41dd6f(++_0x5c9baf);}(_0x34e8,0x12c));var _0x834e=function(_0x41b29d,_0x14fc29){_0x41b29d=_0x41b29d-0x0;var _0x4ab160=_0x34e8[_0x41b29d];return _0x4ab160;};'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 1049d60..0e4bf39 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 _0x553b=['exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x553b,0x1c6));var _0xb553=function(_0x126945,_0x2abc62){_0x126945=_0x126945-0x0;var _0xb08ec1=_0x553b[_0x126945];return _0xb08ec1;};'use strict';var Sequelize=require('sequelize');module[_0xb553('0x0')]={'name':{'type':Sequelize[_0xb553('0x1')]},'description':{'type':Sequelize[_0xb553('0x1')]}}; \ No newline at end of file +var _0xdaf7=['exports','sequelize'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0xdaf7,0x11b));var _0x7daf=function(_0x56440e,_0x473f05){_0x56440e=_0x56440e-0x0;var _0x314f45=_0xdaf7[_0x56440e];return _0x314f45;};'use strict';var Sequelize=require(_0x7daf('0x0'));module[_0x7daf('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 71596bf..e60bb65 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 _0xacc3=['findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','rawAttributes','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','DeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','getFields'];(function(_0x38b093,_0x1158c2){var _0x16adca=function(_0x3bc707){while(--_0x3bc707){_0x38b093['push'](_0x38b093['shift']());}};_0x16adca(++_0x1158c2);}(_0xacc3,0x165));var _0x3acc=function(_0x550b53,_0x50ca10){_0x550b53=_0x550b53-0x0;var _0x56541b=_0xacc3[_0x550b53];return _0x56541b;};'use strict';var emlformat=require(_0x3acc('0x0'));var rimraf=require(_0x3acc('0x1'));var zipdir=require(_0x3acc('0x2'));var jsonpatch=require(_0x3acc('0x3'));var rp=require(_0x3acc('0x4'));var moment=require(_0x3acc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3acc('0x6'));var util=require(_0x3acc('0x7'));var path=require(_0x3acc('0x8'));var sox=require(_0x3acc('0x9'));var csv=require(_0x3acc('0xa'));var ejs=require(_0x3acc('0xb'));var fs=require('fs');var fs_extra=require(_0x3acc('0xc'));var _=require('lodash');var squel=require(_0x3acc('0xd'));var crypto=require(_0x3acc('0xe'));var jsforce=require(_0x3acc('0xf'));var deskjs=require(_0x3acc('0x10'));var toCsv=require(_0x3acc('0xa'));var querystring=require(_0x3acc('0x11'));var Papa=require(_0x3acc('0x12'));var Redis=require('ioredis');var authService=require(_0x3acc('0x13'));var qs=require(_0x3acc('0x14'));var as=require(_0x3acc('0x15'));var hardwareService=require(_0x3acc('0x16'));var logger=require(_0x3acc('0x17'))(_0x3acc('0x18'));var utils=require(_0x3acc('0x19'));var config=require(_0x3acc('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3acc('0x1b'))['db'];function respondWithStatusCode(_0x297483,_0x55b11c){_0x55b11c=_0x55b11c||0xcc;return function(_0xa9f020){if(_0xa9f020){return _0x297483[_0x3acc('0x1c')](_0x55b11c);}return _0x297483[_0x3acc('0x1d')](_0x55b11c)[_0x3acc('0x1e')]();};}function respondWithResult(_0x67dca7,_0xd670ad){_0xd670ad=_0xd670ad||0xc8;return function(_0x7747c3){if(_0x7747c3){return _0x67dca7['status'](_0xd670ad)['json'](_0x7747c3);}};}function respondWithFilteredResult(_0x42bf97,_0x45d5f9){return function(_0xa5f52f){if(_0xa5f52f){var _0x53ea8d=typeof _0x45d5f9['offset']===_0x3acc('0x1f')&&typeof _0x45d5f9[_0x3acc('0x20')]===_0x3acc('0x1f');var _0x31830e=_0xa5f52f[_0x3acc('0x21')];var _0xa37fe6=_0x53ea8d?0x0:_0x45d5f9[_0x3acc('0x22')];var _0x4f7de2=_0x53ea8d?_0xa5f52f['count']:_0x45d5f9[_0x3acc('0x22')]+_0x45d5f9[_0x3acc('0x20')];var _0x2a9ca6;if(_0x4f7de2>=_0x31830e){_0x4f7de2=_0x31830e;_0x2a9ca6=0xc8;}else{_0x2a9ca6=0xce;}_0x42bf97['status'](_0x2a9ca6);return _0x42bf97[_0x3acc('0x23')](_0x3acc('0x24'),_0xa37fe6+'-'+_0x4f7de2+'/'+_0x31830e)[_0x3acc('0x25')](_0xa5f52f);}return null;};}function patchUpdates(_0x51cb06){return function(_0x26a2ce){try{jsonpatch[_0x3acc('0x26')](_0x26a2ce,_0x51cb06,!![]);}catch(_0x2a550c){return BPromise[_0x3acc('0x27')](_0x2a550c);}return _0x26a2ce[_0x3acc('0x28')]();};}function saveUpdates(_0x1c8733,_0x102c0d){return function(_0xc7edc){if(_0xc7edc){return _0xc7edc[_0x3acc('0x29')](_0x1c8733)[_0x3acc('0x2a')](function(_0x42be9e){return _0x42be9e;});}return null;};}function removeEntity(_0x45b476,_0x537d68){return function(_0x158615){if(_0x158615){return _0x158615[_0x3acc('0x2b')]()[_0x3acc('0x2a')](function(){_0x45b476[_0x3acc('0x1d')](0xcc)[_0x3acc('0x1e')]();});}};}function handleEntityNotFound(_0x4047df,_0x4ef2d5){return function(_0x564327){if(!_0x564327){_0x4047df['sendStatus'](0x194);}return _0x564327;};}function handleError(_0x18544d,_0x236771){_0x236771=_0x236771||0x1f4;return function(_0x11269b){logger['error'](_0x11269b[_0x3acc('0x2c')]);if(_0x11269b[_0x3acc('0x2d')]){delete _0x11269b[_0x3acc('0x2d')];}_0x18544d[_0x3acc('0x1d')](_0x236771)['send'](_0x11269b);};}exports['index']=function(_0x5c680a,_0x4fc7f4){var _0x238a03={},_0x361b54={},_0xc8d6e8={'count':0x0,'rows':[]};var _0x3ec914=_[_0x3acc('0x2e')](db[_0x3acc('0x2f')]['rawAttributes'],function(_0x4e8719){return{'name':_0x4e8719[_0x3acc('0x30')],'type':_0x4e8719[_0x3acc('0x31')][_0x3acc('0x32')]};});_0x361b54[_0x3acc('0x33')]=_['map'](_0x3ec914,_0x3acc('0x2d'));_0x361b54[_0x3acc('0x34')]=_[_0x3acc('0x35')](_0x5c680a[_0x3acc('0x34')]);_0x361b54[_0x3acc('0x36')]=_[_0x3acc('0x37')](_0x361b54['model'],_0x361b54[_0x3acc('0x34')]);_0x238a03[_0x3acc('0x38')]=_[_0x3acc('0x37')](_0x361b54['model'],qs[_0x3acc('0x39')](_0x5c680a['query']['fields']));_0x238a03[_0x3acc('0x38')]=_0x238a03[_0x3acc('0x38')][_0x3acc('0x3a')]?_0x238a03['attributes']:_0x361b54[_0x3acc('0x33')];if(!_0x5c680a['query'][_0x3acc('0x3b')](_0x3acc('0x3c'))){_0x238a03[_0x3acc('0x20')]=qs[_0x3acc('0x20')](_0x5c680a[_0x3acc('0x34')]['limit']);_0x238a03[_0x3acc('0x22')]=qs[_0x3acc('0x22')](_0x5c680a[_0x3acc('0x34')][_0x3acc('0x22')]);}_0x238a03[_0x3acc('0x3d')]=qs[_0x3acc('0x3e')](_0x5c680a[_0x3acc('0x34')][_0x3acc('0x3e')]);_0x238a03[_0x3acc('0x3f')]=qs['filters'](_[_0x3acc('0x40')](_0x5c680a[_0x3acc('0x34')],_0x361b54['filters']),_0x3ec914);if(_0x5c680a[_0x3acc('0x34')][_0x3acc('0x41')]){_0x238a03[_0x3acc('0x3f')]=_[_0x3acc('0x42')](_0x238a03['where'],{'$or':_[_0x3acc('0x2e')](_0x3ec914,function(_0x1837c6){if(_0x1837c6[_0x3acc('0x31')]!==_0x3acc('0x43')){var _0x1e4912={};_0x1e4912[_0x1837c6[_0x3acc('0x2d')]]={'$like':'%'+_0x5c680a['query'][_0x3acc('0x41')]+'%'};return _0x1e4912;}})});}_0x238a03=_[_0x3acc('0x42')]({},_0x238a03,_0x5c680a['options']);var _0x4615ba={'where':_0x238a03['where']};return db[_0x3acc('0x2f')]['count'](_0x4615ba)['then'](function(_0x19e63a){_0xc8d6e8[_0x3acc('0x21')]=_0x19e63a;if(_0x5c680a[_0x3acc('0x34')][_0x3acc('0x44')]){_0x238a03[_0x3acc('0x45')]=[{'all':!![]}];}return db[_0x3acc('0x2f')]['findAll'](_0x238a03);})['then'](function(_0x448c0b){_0xc8d6e8['rows']=_0x448c0b;return _0xc8d6e8;})[_0x3acc('0x2a')](respondWithFilteredResult(_0x4fc7f4,_0x238a03))[_0x3acc('0x46')](handleError(_0x4fc7f4,null));};exports[_0x3acc('0x47')]=function(_0xa6826f,_0x1fdfab){var _0x33db22={'raw':![],'where':{'id':_0xa6826f[_0x3acc('0x48')]['id']}},_0x2cef3d={};_0x2cef3d[_0x3acc('0x33')]=_['keys'](db[_0x3acc('0x2f')]['rawAttributes']);_0x2cef3d[_0x3acc('0x34')]=_['keys'](_0xa6826f[_0x3acc('0x34')]);_0x2cef3d[_0x3acc('0x36')]=_[_0x3acc('0x37')](_0x2cef3d[_0x3acc('0x33')],_0x2cef3d[_0x3acc('0x34')]);_0x33db22[_0x3acc('0x38')]=_[_0x3acc('0x37')](_0x2cef3d[_0x3acc('0x33')],qs['fields'](_0xa6826f[_0x3acc('0x34')][_0x3acc('0x39')]));_0x33db22[_0x3acc('0x38')]=_0x33db22[_0x3acc('0x38')][_0x3acc('0x3a')]?_0x33db22['attributes']:_0x2cef3d[_0x3acc('0x33')];if(_0xa6826f[_0x3acc('0x34')][_0x3acc('0x44')]){_0x33db22[_0x3acc('0x45')]=[{'all':!![]}];}_0x33db22=_[_0x3acc('0x42')]({},_0x33db22,_0xa6826f[_0x3acc('0x49')]);return db[_0x3acc('0x2f')][_0x3acc('0x4a')](_0x33db22)[_0x3acc('0x2a')](handleEntityNotFound(_0x1fdfab,null))['then'](respondWithResult(_0x1fdfab,null))[_0x3acc('0x46')](handleError(_0x1fdfab,null));};exports[_0x3acc('0x4b')]=function(_0x5a9933,_0x309096){return db['DeskConfiguration'][_0x3acc('0x4b')](_0x5a9933['body'],{})['then'](respondWithResult(_0x309096,0xc9))[_0x3acc('0x46')](handleError(_0x309096,null));};exports[_0x3acc('0x29')]=function(_0xf75218,_0x5bbfbf){if(_0xf75218[_0x3acc('0x4c')]['id']){delete _0xf75218[_0x3acc('0x4c')]['id'];}return db[_0x3acc('0x2f')]['find']({'where':{'id':_0xf75218['params']['id']}})[_0x3acc('0x2a')](handleEntityNotFound(_0x5bbfbf,null))[_0x3acc('0x2a')](saveUpdates(_0xf75218[_0x3acc('0x4c')],null))[_0x3acc('0x2a')](respondWithResult(_0x5bbfbf,null))[_0x3acc('0x46')](handleError(_0x5bbfbf,null));};exports[_0x3acc('0x2b')]=function(_0x55581d,_0x33263d){return db[_0x3acc('0x2f')][_0x3acc('0x4a')]({'where':{'id':_0x55581d['params']['id']}})[_0x3acc('0x2a')](handleEntityNotFound(_0x33263d,null))[_0x3acc('0x2a')](removeEntity(_0x33263d,null))[_0x3acc('0x46')](handleError(_0x33263d,null));};exports[_0x3acc('0x4d')]=function(_0x159141,_0x3c561b,_0x38d175){var _0x4f488d={};var _0x170c2c={};var _0x1c65fc;var _0x4129a6;return db[_0x3acc('0x2f')][_0x3acc('0x4e')]({'where':{'id':_0x159141[_0x3acc('0x48')]['id']}})[_0x3acc('0x2a')](handleEntityNotFound(_0x3c561b,null))['then'](function(_0x489de4){if(_0x489de4){_0x1c65fc=_0x489de4;_0x170c2c[_0x3acc('0x33')]=_[_0x3acc('0x35')](db[_0x3acc('0x4f')]['rawAttributes']);_0x170c2c[_0x3acc('0x34')]=_[_0x3acc('0x35')](_0x159141['query']);_0x170c2c[_0x3acc('0x36')]=_[_0x3acc('0x37')](_0x170c2c[_0x3acc('0x33')],_0x170c2c['query']);_0x4f488d[_0x3acc('0x38')]=_[_0x3acc('0x37')](_0x170c2c[_0x3acc('0x33')],qs['fields'](_0x159141[_0x3acc('0x34')]['fields']));_0x4f488d[_0x3acc('0x38')]=_0x4f488d[_0x3acc('0x38')]['length']?_0x4f488d[_0x3acc('0x38')]:_0x170c2c[_0x3acc('0x33')];_0x4f488d['order']=qs[_0x3acc('0x3e')](_0x159141[_0x3acc('0x34')][_0x3acc('0x3e')]);_0x4f488d[_0x3acc('0x3f')]=qs[_0x3acc('0x36')](_[_0x3acc('0x40')](_0x159141['query'],_0x170c2c[_0x3acc('0x36')]));if(_0x159141[_0x3acc('0x34')][_0x3acc('0x41')]){_0x4f488d[_0x3acc('0x3f')]=_[_0x3acc('0x42')](_0x4f488d[_0x3acc('0x3f')],{'$or':_[_0x3acc('0x2e')](_0x4f488d['attributes'],function(_0x2b567d){var _0x48c74d={};_0x48c74d[_0x2b567d]={'$like':'%'+_0x159141[_0x3acc('0x34')][_0x3acc('0x41')]+'%'};return _0x48c74d;})});}_0x4f488d=_[_0x3acc('0x42')]({},_0x4f488d,_0x159141['options']);return _0x1c65fc[_0x3acc('0x4d')](_0x4f488d);}})[_0x3acc('0x2a')](function(_0x3069ce){if(_0x3069ce){_0x4129a6=_0x3069ce['length'];if(!_0x159141[_0x3acc('0x34')][_0x3acc('0x3b')](_0x3acc('0x3c'))){_0x4f488d[_0x3acc('0x20')]=qs[_0x3acc('0x20')](_0x159141[_0x3acc('0x34')][_0x3acc('0x20')]);_0x4f488d[_0x3acc('0x22')]=qs[_0x3acc('0x22')](_0x159141[_0x3acc('0x34')]['offset']);}return _0x1c65fc[_0x3acc('0x4d')](_0x4f488d);}})[_0x3acc('0x2a')](function(_0x4269d0){if(_0x4269d0){return _0x4269d0?{'count':_0x4129a6,'rows':_0x4269d0}:null;}})[_0x3acc('0x2a')](respondWithResult(_0x3c561b,null))[_0x3acc('0x46')](handleError(_0x3c561b,null));};exports[_0x3acc('0x50')]=function(_0x19f4aa,_0x385f38,_0x45bea5){var _0x481821={};var _0x2b1c82={};var _0x5265a9;var _0x3a2c91;return db[_0x3acc('0x2f')][_0x3acc('0x4e')]({'where':{'id':_0x19f4aa[_0x3acc('0x48')]['id']}})[_0x3acc('0x2a')](handleEntityNotFound(_0x385f38,null))[_0x3acc('0x2a')](function(_0x3e5469){if(_0x3e5469){_0x5265a9=_0x3e5469;_0x2b1c82[_0x3acc('0x33')]=_[_0x3acc('0x35')](db[_0x3acc('0x4f')]['rawAttributes']);_0x2b1c82[_0x3acc('0x34')]=_['keys'](_0x19f4aa[_0x3acc('0x34')]);_0x2b1c82['filters']=_[_0x3acc('0x37')](_0x2b1c82[_0x3acc('0x33')],_0x2b1c82['query']);_0x481821[_0x3acc('0x38')]=_[_0x3acc('0x37')](_0x2b1c82[_0x3acc('0x33')],qs['fields'](_0x19f4aa[_0x3acc('0x34')]['fields']));_0x481821['attributes']=_0x481821[_0x3acc('0x38')][_0x3acc('0x3a')]?_0x481821[_0x3acc('0x38')]:_0x2b1c82[_0x3acc('0x33')];_0x481821[_0x3acc('0x3d')]=qs['sort'](_0x19f4aa[_0x3acc('0x34')][_0x3acc('0x3e')]);_0x481821['where']=qs['filters'](_[_0x3acc('0x40')](_0x19f4aa[_0x3acc('0x34')],_0x2b1c82[_0x3acc('0x36')]));if(_0x19f4aa[_0x3acc('0x34')][_0x3acc('0x41')]){_0x481821['where']=_[_0x3acc('0x42')](_0x481821[_0x3acc('0x3f')],{'$or':_['map'](_0x481821[_0x3acc('0x38')],function(_0x40bb7d){var _0x538d59={};_0x538d59[_0x40bb7d]={'$like':'%'+_0x19f4aa[_0x3acc('0x34')][_0x3acc('0x41')]+'%'};return _0x538d59;})});}_0x481821=_['merge']({},_0x481821,_0x19f4aa['options']);return _0x5265a9[_0x3acc('0x50')](_0x481821);}})['then'](function(_0x4942b5){if(_0x4942b5){_0x3a2c91=_0x4942b5[_0x3acc('0x3a')];if(!_0x19f4aa['query'][_0x3acc('0x3b')](_0x3acc('0x3c'))){_0x481821[_0x3acc('0x20')]=qs['limit'](_0x19f4aa['query'][_0x3acc('0x20')]);_0x481821[_0x3acc('0x22')]=qs[_0x3acc('0x22')](_0x19f4aa[_0x3acc('0x34')][_0x3acc('0x22')]);}return _0x5265a9[_0x3acc('0x50')](_0x481821);}})['then'](function(_0x5f00f1){if(_0x5f00f1){return _0x5f00f1?{'count':_0x3a2c91,'rows':_0x5f00f1}:null;}})[_0x3acc('0x2a')](respondWithResult(_0x385f38,null))['catch'](handleError(_0x385f38,null));};exports['getDescriptions']=function(_0x36ad1f,_0x3bb30f,_0x50770f){var _0x4a648c={};var _0x9fbc12={};var _0x2ded66;var _0x19e01e;return db[_0x3acc('0x2f')][_0x3acc('0x4e')]({'where':{'id':_0x36ad1f[_0x3acc('0x48')]['id']}})[_0x3acc('0x2a')](handleEntityNotFound(_0x3bb30f,null))[_0x3acc('0x2a')](function(_0x1069cd){if(_0x1069cd){_0x2ded66=_0x1069cd;_0x9fbc12[_0x3acc('0x33')]=_[_0x3acc('0x35')](db[_0x3acc('0x4f')]['rawAttributes']);_0x9fbc12[_0x3acc('0x34')]=_[_0x3acc('0x35')](_0x36ad1f[_0x3acc('0x34')]);_0x9fbc12[_0x3acc('0x36')]=_[_0x3acc('0x37')](_0x9fbc12[_0x3acc('0x33')],_0x9fbc12[_0x3acc('0x34')]);_0x4a648c[_0x3acc('0x38')]=_[_0x3acc('0x37')](_0x9fbc12[_0x3acc('0x33')],qs[_0x3acc('0x39')](_0x36ad1f[_0x3acc('0x34')][_0x3acc('0x39')]));_0x4a648c['attributes']=_0x4a648c['attributes'][_0x3acc('0x3a')]?_0x4a648c['attributes']:_0x9fbc12[_0x3acc('0x33')];_0x4a648c[_0x3acc('0x3d')]=qs[_0x3acc('0x3e')](_0x36ad1f['query'][_0x3acc('0x3e')]);_0x4a648c[_0x3acc('0x3f')]=qs[_0x3acc('0x36')](_[_0x3acc('0x40')](_0x36ad1f[_0x3acc('0x34')],_0x9fbc12['filters']));if(_0x36ad1f['query'][_0x3acc('0x41')]){_0x4a648c[_0x3acc('0x3f')]=_['merge'](_0x4a648c[_0x3acc('0x3f')],{'$or':_[_0x3acc('0x2e')](_0x4a648c['attributes'],function(_0x32977d){var _0x3c37e3={};_0x3c37e3[_0x32977d]={'$like':'%'+_0x36ad1f['query'][_0x3acc('0x41')]+'%'};return _0x3c37e3;})});}_0x4a648c=_[_0x3acc('0x42')]({},_0x4a648c,_0x36ad1f[_0x3acc('0x49')]);return _0x2ded66[_0x3acc('0x51')](_0x4a648c);}})[_0x3acc('0x2a')](function(_0xabe0ba){if(_0xabe0ba){_0x19e01e=_0xabe0ba[_0x3acc('0x3a')];if(!_0x36ad1f[_0x3acc('0x34')][_0x3acc('0x3b')](_0x3acc('0x3c'))){_0x4a648c[_0x3acc('0x20')]=qs[_0x3acc('0x20')](_0x36ad1f[_0x3acc('0x34')][_0x3acc('0x20')]);_0x4a648c[_0x3acc('0x22')]=qs['offset'](_0x36ad1f[_0x3acc('0x34')][_0x3acc('0x22')]);}return _0x2ded66[_0x3acc('0x51')](_0x4a648c);}})[_0x3acc('0x2a')](function(_0x2f321a){if(_0x2f321a){return _0x2f321a?{'count':_0x19e01e,'rows':_0x2f321a}:null;}})[_0x3acc('0x2a')](respondWithResult(_0x3bb30f,null))['catch'](handleError(_0x3bb30f,null));};exports[_0x3acc('0x52')]=function(_0xbab707,_0x5f204b,_0x4c5ebd){var _0x150e86={};var _0x30d93e={};var _0x5bd1f8;var _0x333fa7;return db[_0x3acc('0x2f')][_0x3acc('0x4e')]({'where':{'id':_0xbab707[_0x3acc('0x48')]['id']}})[_0x3acc('0x2a')](handleEntityNotFound(_0x5f204b,null))[_0x3acc('0x2a')](function(_0x3631c0){if(_0x3631c0){_0x5bd1f8=_0x3631c0;_0x30d93e['model']=_[_0x3acc('0x35')](db[_0x3acc('0x53')][_0x3acc('0x54')]);_0x30d93e['query']=_[_0x3acc('0x35')](_0xbab707[_0x3acc('0x34')]);_0x30d93e[_0x3acc('0x36')]=_[_0x3acc('0x37')](_0x30d93e[_0x3acc('0x33')],_0x30d93e['query']);_0x150e86['attributes']=_[_0x3acc('0x37')](_0x30d93e[_0x3acc('0x33')],qs[_0x3acc('0x39')](_0xbab707['query']['fields']));_0x150e86['attributes']=_0x150e86[_0x3acc('0x38')]['length']?_0x150e86[_0x3acc('0x38')]:_0x30d93e[_0x3acc('0x33')];_0x150e86['order']=qs[_0x3acc('0x3e')](_0xbab707[_0x3acc('0x34')]['sort']);_0x150e86[_0x3acc('0x3f')]=qs[_0x3acc('0x36')](_[_0x3acc('0x40')](_0xbab707[_0x3acc('0x34')],_0x30d93e['filters']));if(_0xbab707[_0x3acc('0x34')][_0x3acc('0x41')]){_0x150e86[_0x3acc('0x3f')]=_[_0x3acc('0x42')](_0x150e86[_0x3acc('0x3f')],{'$or':_[_0x3acc('0x2e')](_0x150e86[_0x3acc('0x38')],function(_0x2451d0){var _0x479c6f={};_0x479c6f[_0x2451d0]={'$like':'%'+_0xbab707['query']['filter']+'%'};return _0x479c6f;})});}_0x150e86=_[_0x3acc('0x42')]({},_0x150e86,_0xbab707[_0x3acc('0x49')]);return _0x5bd1f8[_0x3acc('0x52')](_0x150e86);}})[_0x3acc('0x2a')](function(_0x6fef01){if(_0x6fef01){_0x333fa7=_0x6fef01[_0x3acc('0x3a')];if(!_0xbab707[_0x3acc('0x34')][_0x3acc('0x3b')](_0x3acc('0x3c'))){_0x150e86[_0x3acc('0x20')]=qs[_0x3acc('0x20')](_0xbab707['query'][_0x3acc('0x20')]);_0x150e86[_0x3acc('0x22')]=qs['offset'](_0xbab707[_0x3acc('0x34')][_0x3acc('0x22')]);}return _0x5bd1f8[_0x3acc('0x52')](_0x150e86);}})['then'](function(_0x3f5ad){if(_0x3f5ad){return _0x3f5ad?{'count':_0x333fa7,'rows':_0x3f5ad}:null;}})[_0x3acc('0x2a')](respondWithResult(_0x5f204b,null))[_0x3acc('0x46')](handleError(_0x5f204b,null));};exports[_0x3acc('0x55')]=function(_0x3d8bed,_0x3f5854,_0x3188d6){if(_0x3d8bed[_0x3acc('0x4c')]['id']){delete _0x3d8bed[_0x3acc('0x4c')]['id'];}return db[_0x3acc('0x2f')][_0x3acc('0x4e')]({'where':{'id':_0x3d8bed[_0x3acc('0x48')]['id']}})[_0x3acc('0x2a')](handleEntityNotFound(_0x3f5854,null))[_0x3acc('0x2a')](function(_0x584e0d){if(_0x584e0d){return _0x584e0d[_0x3acc('0x55')](_0x3d8bed[_0x3acc('0x4c')][_0x3acc('0x56')]||[]);}return null;})['then'](respondWithResult(_0x3f5854,null))[_0x3acc('0x46')](handleError(_0x3f5854,null));}; \ No newline at end of file +var _0xa83f=['map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','getFields','DeskField','order','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','DeskConfiguration','rawAttributes','fieldName','type','model'];(function(_0x539281,_0xeef1e){var _0x223040=function(_0x495014){while(--_0x495014){_0x539281['push'](_0x539281['shift']());}};_0x223040(++_0xeef1e);}(_0xa83f,0x11a));var _0xfa83=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa83f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfa83('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa83('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa83('0x2'));var moment=require(_0xfa83('0x3'));var BPromise=require(_0xfa83('0x4'));var Mustache=require(_0xfa83('0x5'));var util=require(_0xfa83('0x6'));var path=require(_0xfa83('0x7'));var sox=require('sox');var csv=require(_0xfa83('0x8'));var ejs=require(_0xfa83('0x9'));var fs=require('fs');var fs_extra=require(_0xfa83('0xa'));var _=require('lodash');var squel=require(_0xfa83('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfa83('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfa83('0xd'));var Papa=require(_0xfa83('0xe'));var Redis=require('ioredis');var authService=require(_0xfa83('0xf'));var qs=require(_0xfa83('0x10'));var as=require(_0xfa83('0x11'));var hardwareService=require(_0xfa83('0x12'));var logger=require(_0xfa83('0x13'))(_0xfa83('0x14'));var utils=require(_0xfa83('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfa83('0x16'))['db'];function respondWithStatusCode(_0x860964,_0x7360fb){_0x7360fb=_0x7360fb||0xcc;return function(_0xcf053b){if(_0xcf053b){return _0x860964[_0xfa83('0x17')](_0x7360fb);}return _0x860964[_0xfa83('0x18')](_0x7360fb)['end']();};}function respondWithResult(_0x15824c,_0x34636b){_0x34636b=_0x34636b||0xc8;return function(_0x65b136){if(_0x65b136){return _0x15824c['status'](_0x34636b)['json'](_0x65b136);}};}function respondWithFilteredResult(_0x16db99,_0x39ef8d){return function(_0x4c4290){if(_0x4c4290){var _0x5bb320=typeof _0x39ef8d[_0xfa83('0x19')]==='undefined'&&typeof _0x39ef8d[_0xfa83('0x1a')]===_0xfa83('0x1b');var _0x463c6b=_0x4c4290[_0xfa83('0x1c')];var _0x2a5fee=_0x5bb320?0x0:_0x39ef8d['offset'];var _0x39346f=_0x5bb320?_0x4c4290['count']:_0x39ef8d[_0xfa83('0x19')]+_0x39ef8d[_0xfa83('0x1a')];var _0x5778a0;if(_0x39346f>=_0x463c6b){_0x39346f=_0x463c6b;_0x5778a0=0xc8;}else{_0x5778a0=0xce;}_0x16db99[_0xfa83('0x18')](_0x5778a0);return _0x16db99[_0xfa83('0x1d')](_0xfa83('0x1e'),_0x2a5fee+'-'+_0x39346f+'/'+_0x463c6b)['json'](_0x4c4290);}return null;};}function patchUpdates(_0x295aee){return function(_0x5dd709){try{jsonpatch[_0xfa83('0x1f')](_0x5dd709,_0x295aee,!![]);}catch(_0x5b0f8e){return BPromise[_0xfa83('0x20')](_0x5b0f8e);}return _0x5dd709['save']();};}function saveUpdates(_0xe9433,_0x192c81){return function(_0x4b8cff){if(_0x4b8cff){return _0x4b8cff[_0xfa83('0x21')](_0xe9433)[_0xfa83('0x22')](function(_0x223f43){return _0x223f43;});}return null;};}function removeEntity(_0x32d765,_0x31f9c6){return function(_0x9a8315){if(_0x9a8315){return _0x9a8315[_0xfa83('0x23')]()[_0xfa83('0x22')](function(){_0x32d765['status'](0xcc)[_0xfa83('0x24')]();});}};}function handleEntityNotFound(_0x58176d,_0x2d7c4d){return function(_0x1095d0){if(!_0x1095d0){_0x58176d[_0xfa83('0x17')](0x194);}return _0x1095d0;};}function handleError(_0x591e6b,_0x112867){_0x112867=_0x112867||0x1f4;return function(_0x127f06){logger[_0xfa83('0x25')](_0x127f06[_0xfa83('0x26')]);if(_0x127f06['name']){delete _0x127f06[_0xfa83('0x27')];}_0x591e6b['status'](_0x112867)['send'](_0x127f06);};}exports[_0xfa83('0x28')]=function(_0x5d0904,_0x57b653){var _0x3cadf6={},_0x3bc8eb={},_0x2b1fd4={'count':0x0,'rows':[]};var _0x113357=_['map'](db[_0xfa83('0x29')][_0xfa83('0x2a')],function(_0xef34e9){return{'name':_0xef34e9[_0xfa83('0x2b')],'type':_0xef34e9[_0xfa83('0x2c')]['key']};});_0x3bc8eb[_0xfa83('0x2d')]=_[_0xfa83('0x2e')](_0x113357,_0xfa83('0x27'));_0x3bc8eb['query']=_[_0xfa83('0x2f')](_0x5d0904[_0xfa83('0x30')]);_0x3bc8eb[_0xfa83('0x31')]=_[_0xfa83('0x32')](_0x3bc8eb[_0xfa83('0x2d')],_0x3bc8eb[_0xfa83('0x30')]);_0x3cadf6[_0xfa83('0x33')]=_[_0xfa83('0x32')](_0x3bc8eb['model'],qs[_0xfa83('0x34')](_0x5d0904['query'][_0xfa83('0x34')]));_0x3cadf6[_0xfa83('0x33')]=_0x3cadf6[_0xfa83('0x33')][_0xfa83('0x35')]?_0x3cadf6[_0xfa83('0x33')]:_0x3bc8eb[_0xfa83('0x2d')];if(!_0x5d0904[_0xfa83('0x30')][_0xfa83('0x36')](_0xfa83('0x37'))){_0x3cadf6[_0xfa83('0x1a')]=qs[_0xfa83('0x1a')](_0x5d0904[_0xfa83('0x30')][_0xfa83('0x1a')]);_0x3cadf6[_0xfa83('0x19')]=qs[_0xfa83('0x19')](_0x5d0904['query'][_0xfa83('0x19')]);}_0x3cadf6['order']=qs[_0xfa83('0x38')](_0x5d0904['query'][_0xfa83('0x38')]);_0x3cadf6[_0xfa83('0x39')]=qs[_0xfa83('0x31')](_[_0xfa83('0x3a')](_0x5d0904[_0xfa83('0x30')],_0x3bc8eb[_0xfa83('0x31')]),_0x113357);if(_0x5d0904[_0xfa83('0x30')][_0xfa83('0x3b')]){_0x3cadf6[_0xfa83('0x39')]=_[_0xfa83('0x3c')](_0x3cadf6[_0xfa83('0x39')],{'$or':_[_0xfa83('0x2e')](_0x113357,function(_0x5725fc){if(_0x5725fc['type']!=='VIRTUAL'){var _0x28b451={};_0x28b451[_0x5725fc['name']]={'$like':'%'+_0x5d0904[_0xfa83('0x30')][_0xfa83('0x3b')]+'%'};return _0x28b451;}})});}_0x3cadf6=_['merge']({},_0x3cadf6,_0x5d0904[_0xfa83('0x3d')]);var _0x54c850={'where':_0x3cadf6['where']};return db[_0xfa83('0x29')][_0xfa83('0x1c')](_0x54c850)[_0xfa83('0x22')](function(_0x1db2e6){_0x2b1fd4[_0xfa83('0x1c')]=_0x1db2e6;if(_0x5d0904[_0xfa83('0x30')][_0xfa83('0x3e')]){_0x3cadf6[_0xfa83('0x3f')]=[{'all':!![]}];}return db[_0xfa83('0x29')][_0xfa83('0x40')](_0x3cadf6);})[_0xfa83('0x22')](function(_0x29c481){_0x2b1fd4[_0xfa83('0x41')]=_0x29c481;return _0x2b1fd4;})[_0xfa83('0x22')](respondWithFilteredResult(_0x57b653,_0x3cadf6))[_0xfa83('0x42')](handleError(_0x57b653,null));};exports[_0xfa83('0x43')]=function(_0x2f6ac,_0x33634a){var _0x1b2402={'raw':![],'where':{'id':_0x2f6ac['params']['id']}},_0x59eef4={};_0x59eef4[_0xfa83('0x2d')]=_['keys'](db[_0xfa83('0x29')][_0xfa83('0x2a')]);_0x59eef4[_0xfa83('0x30')]=_['keys'](_0x2f6ac[_0xfa83('0x30')]);_0x59eef4[_0xfa83('0x31')]=_[_0xfa83('0x32')](_0x59eef4[_0xfa83('0x2d')],_0x59eef4['query']);_0x1b2402[_0xfa83('0x33')]=_['intersection'](_0x59eef4[_0xfa83('0x2d')],qs['fields'](_0x2f6ac[_0xfa83('0x30')][_0xfa83('0x34')]));_0x1b2402[_0xfa83('0x33')]=_0x1b2402[_0xfa83('0x33')][_0xfa83('0x35')]?_0x1b2402[_0xfa83('0x33')]:_0x59eef4['model'];if(_0x2f6ac[_0xfa83('0x30')]['includeAll']){_0x1b2402['include']=[{'all':!![]}];}_0x1b2402=_[_0xfa83('0x3c')]({},_0x1b2402,_0x2f6ac[_0xfa83('0x3d')]);return db[_0xfa83('0x29')]['find'](_0x1b2402)[_0xfa83('0x22')](handleEntityNotFound(_0x33634a,null))[_0xfa83('0x22')](respondWithResult(_0x33634a,null))[_0xfa83('0x42')](handleError(_0x33634a,null));};exports[_0xfa83('0x44')]=function(_0x5dd789,_0x1e6e18){return db['DeskConfiguration'][_0xfa83('0x44')](_0x5dd789[_0xfa83('0x45')],{})[_0xfa83('0x22')](respondWithResult(_0x1e6e18,0xc9))['catch'](handleError(_0x1e6e18,null));};exports[_0xfa83('0x21')]=function(_0x547c72,_0x20b0ae){if(_0x547c72['body']['id']){delete _0x547c72[_0xfa83('0x45')]['id'];}return db[_0xfa83('0x29')][_0xfa83('0x46')]({'where':{'id':_0x547c72[_0xfa83('0x47')]['id']}})['then'](handleEntityNotFound(_0x20b0ae,null))['then'](saveUpdates(_0x547c72[_0xfa83('0x45')],null))[_0xfa83('0x22')](respondWithResult(_0x20b0ae,null))[_0xfa83('0x42')](handleError(_0x20b0ae,null));};exports['destroy']=function(_0x25abd8,_0x6cc53f){return db['DeskConfiguration'][_0xfa83('0x46')]({'where':{'id':_0x25abd8[_0xfa83('0x47')]['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0x6cc53f,null))['then'](removeEntity(_0x6cc53f,null))[_0xfa83('0x42')](handleError(_0x6cc53f,null));};exports[_0xfa83('0x48')]=function(_0x5d0b34,_0x470b1e,_0xc5a9f3){var _0x46575a={};var _0x3894c8={};var _0x1bcf9c;var _0x3dedad;return db['DeskConfiguration']['findOne']({'where':{'id':_0x5d0b34[_0xfa83('0x47')]['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0x470b1e,null))['then'](function(_0x1b7274){if(_0x1b7274){_0x1bcf9c=_0x1b7274;_0x3894c8[_0xfa83('0x2d')]=_[_0xfa83('0x2f')](db[_0xfa83('0x49')][_0xfa83('0x2a')]);_0x3894c8['query']=_[_0xfa83('0x2f')](_0x5d0b34[_0xfa83('0x30')]);_0x3894c8[_0xfa83('0x31')]=_[_0xfa83('0x32')](_0x3894c8[_0xfa83('0x2d')],_0x3894c8[_0xfa83('0x30')]);_0x46575a[_0xfa83('0x33')]=_[_0xfa83('0x32')](_0x3894c8['model'],qs[_0xfa83('0x34')](_0x5d0b34['query'][_0xfa83('0x34')]));_0x46575a[_0xfa83('0x33')]=_0x46575a[_0xfa83('0x33')]['length']?_0x46575a[_0xfa83('0x33')]:_0x3894c8[_0xfa83('0x2d')];_0x46575a[_0xfa83('0x4a')]=qs[_0xfa83('0x38')](_0x5d0b34[_0xfa83('0x30')][_0xfa83('0x38')]);_0x46575a[_0xfa83('0x39')]=qs[_0xfa83('0x31')](_['pick'](_0x5d0b34[_0xfa83('0x30')],_0x3894c8[_0xfa83('0x31')]));if(_0x5d0b34['query'][_0xfa83('0x3b')]){_0x46575a[_0xfa83('0x39')]=_[_0xfa83('0x3c')](_0x46575a[_0xfa83('0x39')],{'$or':_['map'](_0x46575a[_0xfa83('0x33')],function(_0x280bd8){var _0x6e65b7={};_0x6e65b7[_0x280bd8]={'$like':'%'+_0x5d0b34[_0xfa83('0x30')][_0xfa83('0x3b')]+'%'};return _0x6e65b7;})});}_0x46575a=_[_0xfa83('0x3c')]({},_0x46575a,_0x5d0b34[_0xfa83('0x3d')]);return _0x1bcf9c[_0xfa83('0x48')](_0x46575a);}})[_0xfa83('0x22')](function(_0x37964b){if(_0x37964b){_0x3dedad=_0x37964b[_0xfa83('0x35')];if(!_0x5d0b34['query'][_0xfa83('0x36')](_0xfa83('0x37'))){_0x46575a[_0xfa83('0x1a')]=qs[_0xfa83('0x1a')](_0x5d0b34[_0xfa83('0x30')]['limit']);_0x46575a[_0xfa83('0x19')]=qs[_0xfa83('0x19')](_0x5d0b34[_0xfa83('0x30')][_0xfa83('0x19')]);}return _0x1bcf9c['getFields'](_0x46575a);}})[_0xfa83('0x22')](function(_0xdad4c2){if(_0xdad4c2){return _0xdad4c2?{'count':_0x3dedad,'rows':_0xdad4c2}:null;}})['then'](respondWithResult(_0x470b1e,null))['catch'](handleError(_0x470b1e,null));};exports[_0xfa83('0x4b')]=function(_0xdc0236,_0xe7c112,_0x3916d5){var _0x4569f5={};var _0x3e632a={};var _0x334b05;var _0x39ed7b;return db[_0xfa83('0x29')]['findOne']({'where':{'id':_0xdc0236[_0xfa83('0x47')]['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0xe7c112,null))[_0xfa83('0x22')](function(_0x281254){if(_0x281254){_0x334b05=_0x281254;_0x3e632a['model']=_[_0xfa83('0x2f')](db[_0xfa83('0x49')][_0xfa83('0x2a')]);_0x3e632a[_0xfa83('0x30')]=_[_0xfa83('0x2f')](_0xdc0236[_0xfa83('0x30')]);_0x3e632a[_0xfa83('0x31')]=_[_0xfa83('0x32')](_0x3e632a[_0xfa83('0x2d')],_0x3e632a[_0xfa83('0x30')]);_0x4569f5[_0xfa83('0x33')]=_[_0xfa83('0x32')](_0x3e632a[_0xfa83('0x2d')],qs[_0xfa83('0x34')](_0xdc0236[_0xfa83('0x30')][_0xfa83('0x34')]));_0x4569f5[_0xfa83('0x33')]=_0x4569f5['attributes'][_0xfa83('0x35')]?_0x4569f5[_0xfa83('0x33')]:_0x3e632a[_0xfa83('0x2d')];_0x4569f5[_0xfa83('0x4a')]=qs[_0xfa83('0x38')](_0xdc0236['query'][_0xfa83('0x38')]);_0x4569f5[_0xfa83('0x39')]=qs[_0xfa83('0x31')](_[_0xfa83('0x3a')](_0xdc0236['query'],_0x3e632a[_0xfa83('0x31')]));if(_0xdc0236['query'][_0xfa83('0x3b')]){_0x4569f5[_0xfa83('0x39')]=_[_0xfa83('0x3c')](_0x4569f5[_0xfa83('0x39')],{'$or':_[_0xfa83('0x2e')](_0x4569f5[_0xfa83('0x33')],function(_0x1496dd){var _0x344eca={};_0x344eca[_0x1496dd]={'$like':'%'+_0xdc0236[_0xfa83('0x30')][_0xfa83('0x3b')]+'%'};return _0x344eca;})});}_0x4569f5=_['merge']({},_0x4569f5,_0xdc0236[_0xfa83('0x3d')]);return _0x334b05[_0xfa83('0x4b')](_0x4569f5);}})[_0xfa83('0x22')](function(_0x2075ad){if(_0x2075ad){_0x39ed7b=_0x2075ad['length'];if(!_0xdc0236['query'][_0xfa83('0x36')](_0xfa83('0x37'))){_0x4569f5[_0xfa83('0x1a')]=qs[_0xfa83('0x1a')](_0xdc0236[_0xfa83('0x30')]['limit']);_0x4569f5[_0xfa83('0x19')]=qs['offset'](_0xdc0236[_0xfa83('0x30')]['offset']);}return _0x334b05[_0xfa83('0x4b')](_0x4569f5);}})['then'](function(_0x3c284a){if(_0x3c284a){return _0x3c284a?{'count':_0x39ed7b,'rows':_0x3c284a}:null;}})[_0xfa83('0x22')](respondWithResult(_0xe7c112,null))['catch'](handleError(_0xe7c112,null));};exports['getDescriptions']=function(_0x2dd35b,_0x49f240,_0x210e97){var _0xf6175f={};var _0x224b39={};var _0x5672d8;var _0x1e73ce;return db['DeskConfiguration'][_0xfa83('0x4c')]({'where':{'id':_0x2dd35b['params']['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0x49f240,null))[_0xfa83('0x22')](function(_0x35031c){if(_0x35031c){_0x5672d8=_0x35031c;_0x224b39[_0xfa83('0x2d')]=_[_0xfa83('0x2f')](db[_0xfa83('0x49')]['rawAttributes']);_0x224b39[_0xfa83('0x30')]=_[_0xfa83('0x2f')](_0x2dd35b[_0xfa83('0x30')]);_0x224b39['filters']=_[_0xfa83('0x32')](_0x224b39['model'],_0x224b39[_0xfa83('0x30')]);_0xf6175f[_0xfa83('0x33')]=_[_0xfa83('0x32')](_0x224b39[_0xfa83('0x2d')],qs[_0xfa83('0x34')](_0x2dd35b[_0xfa83('0x30')][_0xfa83('0x34')]));_0xf6175f[_0xfa83('0x33')]=_0xf6175f[_0xfa83('0x33')][_0xfa83('0x35')]?_0xf6175f['attributes']:_0x224b39['model'];_0xf6175f[_0xfa83('0x4a')]=qs[_0xfa83('0x38')](_0x2dd35b[_0xfa83('0x30')][_0xfa83('0x38')]);_0xf6175f[_0xfa83('0x39')]=qs[_0xfa83('0x31')](_[_0xfa83('0x3a')](_0x2dd35b['query'],_0x224b39[_0xfa83('0x31')]));if(_0x2dd35b['query'][_0xfa83('0x3b')]){_0xf6175f[_0xfa83('0x39')]=_[_0xfa83('0x3c')](_0xf6175f[_0xfa83('0x39')],{'$or':_[_0xfa83('0x2e')](_0xf6175f[_0xfa83('0x33')],function(_0x9a2be5){var _0x10bb9a={};_0x10bb9a[_0x9a2be5]={'$like':'%'+_0x2dd35b[_0xfa83('0x30')][_0xfa83('0x3b')]+'%'};return _0x10bb9a;})});}_0xf6175f=_[_0xfa83('0x3c')]({},_0xf6175f,_0x2dd35b[_0xfa83('0x3d')]);return _0x5672d8['getDescriptions'](_0xf6175f);}})[_0xfa83('0x22')](function(_0x273ca1){if(_0x273ca1){_0x1e73ce=_0x273ca1['length'];if(!_0x2dd35b[_0xfa83('0x30')][_0xfa83('0x36')](_0xfa83('0x37'))){_0xf6175f[_0xfa83('0x1a')]=qs[_0xfa83('0x1a')](_0x2dd35b[_0xfa83('0x30')][_0xfa83('0x1a')]);_0xf6175f['offset']=qs[_0xfa83('0x19')](_0x2dd35b['query'][_0xfa83('0x19')]);}return _0x5672d8[_0xfa83('0x4d')](_0xf6175f);}})[_0xfa83('0x22')](function(_0x42d6da){if(_0x42d6da){return _0x42d6da?{'count':_0x1e73ce,'rows':_0x42d6da}:null;}})[_0xfa83('0x22')](respondWithResult(_0x49f240,null))[_0xfa83('0x42')](handleError(_0x49f240,null));};exports['getTags']=function(_0x49b960,_0x3b27d4,_0x44d2ab){var _0x41d673={};var _0x56a7de={};var _0x7e2327;var _0x17806b;return db['DeskConfiguration'][_0xfa83('0x4c')]({'where':{'id':_0x49b960[_0xfa83('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b27d4,null))[_0xfa83('0x22')](function(_0x59d032){if(_0x59d032){_0x7e2327=_0x59d032;_0x56a7de[_0xfa83('0x2d')]=_[_0xfa83('0x2f')](db[_0xfa83('0x4e')][_0xfa83('0x2a')]);_0x56a7de[_0xfa83('0x30')]=_[_0xfa83('0x2f')](_0x49b960['query']);_0x56a7de[_0xfa83('0x31')]=_['intersection'](_0x56a7de['model'],_0x56a7de[_0xfa83('0x30')]);_0x41d673[_0xfa83('0x33')]=_[_0xfa83('0x32')](_0x56a7de[_0xfa83('0x2d')],qs['fields'](_0x49b960['query']['fields']));_0x41d673[_0xfa83('0x33')]=_0x41d673[_0xfa83('0x33')][_0xfa83('0x35')]?_0x41d673['attributes']:_0x56a7de[_0xfa83('0x2d')];_0x41d673[_0xfa83('0x4a')]=qs['sort'](_0x49b960[_0xfa83('0x30')][_0xfa83('0x38')]);_0x41d673[_0xfa83('0x39')]=qs[_0xfa83('0x31')](_[_0xfa83('0x3a')](_0x49b960['query'],_0x56a7de['filters']));if(_0x49b960['query']['filter']){_0x41d673[_0xfa83('0x39')]=_[_0xfa83('0x3c')](_0x41d673[_0xfa83('0x39')],{'$or':_[_0xfa83('0x2e')](_0x41d673['attributes'],function(_0x180a28){var _0x48eb12={};_0x48eb12[_0x180a28]={'$like':'%'+_0x49b960['query'][_0xfa83('0x3b')]+'%'};return _0x48eb12;})});}_0x41d673=_[_0xfa83('0x3c')]({},_0x41d673,_0x49b960[_0xfa83('0x3d')]);return _0x7e2327[_0xfa83('0x4f')](_0x41d673);}})[_0xfa83('0x22')](function(_0x573593){if(_0x573593){_0x17806b=_0x573593[_0xfa83('0x35')];if(!_0x49b960[_0xfa83('0x30')][_0xfa83('0x36')](_0xfa83('0x37'))){_0x41d673[_0xfa83('0x1a')]=qs[_0xfa83('0x1a')](_0x49b960['query'][_0xfa83('0x1a')]);_0x41d673[_0xfa83('0x19')]=qs['offset'](_0x49b960[_0xfa83('0x30')]['offset']);}return _0x7e2327[_0xfa83('0x4f')](_0x41d673);}})[_0xfa83('0x22')](function(_0xf8adea){if(_0xf8adea){return _0xf8adea?{'count':_0x17806b,'rows':_0xf8adea}:null;}})[_0xfa83('0x22')](respondWithResult(_0x3b27d4,null))['catch'](handleError(_0x3b27d4,null));};exports[_0xfa83('0x50')]=function(_0x588562,_0xe49de4,_0x36fe57){if(_0x588562[_0xfa83('0x45')]['id']){delete _0x588562['body']['id'];}return db['DeskConfiguration'][_0xfa83('0x4c')]({'where':{'id':_0x588562['params']['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0xe49de4,null))[_0xfa83('0x22')](function(_0x29a553){if(_0x29a553){return _0x29a553[_0xfa83('0x50')](_0x588562[_0xfa83('0x45')][_0xfa83('0x51')]||[]);}return null;})[_0xfa83('0x22')](respondWithResult(_0xe49de4,null))[_0xfa83('0x42')](handleError(_0xe49de4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 540c076..0e856a1 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 _0x5396=['./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5396,0x101));var _0x6539=function(_0x50cff6,_0x53b29f){_0x50cff6=_0x50cff6-0x0;var _0x4cb7ae=_0x5396[_0x50cff6];return _0x4cb7ae;};'use strict';var _=require('lodash');var util=require(_0x6539('0x0'));var logger=require('../../config/logger')(_0x6539('0x1'));var moment=require(_0x6539('0x2'));var BPromise=require(_0x6539('0x3'));var rp=require(_0x6539('0x4'));var fs=require('fs');var path=require(_0x6539('0x5'));var rimraf=require('rimraf');var config=require(_0x6539('0x6'));var attributes=require(_0x6539('0x7'));module[_0x6539('0x8')]=function(_0x2b97ab,_0x141f82){return _0x2b97ab['define'](_0x6539('0x9'),attributes,{'tableName':_0x6539('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb020=['moment','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','util','../../config/logger','api'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb020,0x126));var _0x0b02=function(_0x3452a8,_0x4bfaa4){_0x3452a8=_0x3452a8-0x0;var _0x233814=_0xb020[_0x3452a8];return _0x233814;};'use strict';var _=require('lodash');var util=require(_0x0b02('0x0'));var logger=require(_0x0b02('0x1'))(_0x0b02('0x2'));var moment=require(_0x0b02('0x3'));var BPromise=require('bluebird');var rp=require(_0x0b02('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b02('0x5'));var config=require(_0x0b02('0x6'));var attributes=require(_0x0b02('0x7'));module[_0x0b02('0x8')]=function(_0x30d77c,_0x30420a){return _0x30d77c[_0x0b02('0x9')]('DeskConfiguration',attributes,{'tableName':_0x0b02('0xa'),'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 9350f69..f4bc584 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 _0x6829=['http','then','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x210105,_0xdbebc7){var _0x14a5ca=function(_0x68f25c){while(--_0x68f25c){_0x210105['push'](_0x210105['shift']());}};_0x14a5ca(++_0xdbebc7);}(_0x6829,0x14c));var _0x9682=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6829[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9682('0x2'));var db=require(_0x9682('0x3'))['db'];var utils=require(_0x9682('0x4'));var logger=require(_0x9682('0x5'))(_0x9682('0x6'));var config=require(_0x9682('0x7'));var jayson=require(_0x9682('0x8'));var client=jayson[_0x9682('0x9')][_0x9682('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cec91,_0x37ab0a,_0x1cca2f){return new BPromise(function(_0x576a39,_0x519138){return client['request'](_0x4cec91,_0x1cca2f)[_0x9682('0xb')](function(_0x1b27c2){logger['info'](_0x9682('0xc'),_0x37ab0a,'request\x20sent');logger[_0x9682('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x37ab0a,_0x9682('0xe'),JSON[_0x9682('0xf')](_0x1b27c2));if(_0x1b27c2[_0x9682('0x10')]){if(_0x1b27c2['error']['code']===0x1f4){logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x1b27c2['error'][_0x9682('0x11')]);return _0x519138(_0x1b27c2['error'][_0x9682('0x11')]);}logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x1b27c2[_0x9682('0x10')][_0x9682('0x11')]);return _0x576a39(_0x1b27c2[_0x9682('0x10')][_0x9682('0x11')]);}else{logger[_0x9682('0x12')](_0x9682('0xc'),_0x37ab0a,_0x9682('0xe'));_0x576a39(_0x1b27c2['result'][_0x9682('0x11')]);}})['catch'](function(_0x23eef6){logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x23eef6);_0x519138(_0x23eef6);});});} \ No newline at end of file +var _0x7031=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x367816,_0x35633c){var _0x2cdde2=function(_0x153253){while(--_0x153253){_0x367816['push'](_0x367816['shift']());}};_0x2cdde2(++_0x35633c);}(_0x7031,0x19a));var _0x1703=function(_0x498bdd,_0x470eeb){_0x498bdd=_0x498bdd-0x0;var _0x392cb7=_0x7031[_0x498bdd];return _0x392cb7;};'use strict';var _=require(_0x1703('0x0'));var util=require(_0x1703('0x1'));var moment=require('moment');var BPromise=require(_0x1703('0x2'));var rs=require(_0x1703('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1703('0x4'))['db'];var utils=require(_0x1703('0x5'));var logger=require('../../config/logger')(_0x1703('0x6'));var config=require(_0x1703('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1703('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229e82,_0x2ba8e2,_0x3117b5){return new BPromise(function(_0x4f46dc,_0x1cba9a){return client[_0x1703('0x9')](_0x229e82,_0x3117b5)[_0x1703('0xa')](function(_0x5ded48){logger[_0x1703('0xb')](_0x1703('0xc'),_0x2ba8e2,_0x1703('0xd'));logger[_0x1703('0xe')](_0x1703('0xf'),_0x2ba8e2,_0x1703('0xd'),JSON[_0x1703('0x10')](_0x5ded48));if(_0x5ded48[_0x1703('0x11')]){if(_0x5ded48[_0x1703('0x11')][_0x1703('0x12')]===0x1f4){logger[_0x1703('0x11')](_0x1703('0xc'),_0x2ba8e2,_0x5ded48[_0x1703('0x11')][_0x1703('0x13')]);return _0x1cba9a(_0x5ded48[_0x1703('0x11')][_0x1703('0x13')]);}logger[_0x1703('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x2ba8e2,_0x5ded48['error'][_0x1703('0x13')]);return _0x4f46dc(_0x5ded48[_0x1703('0x11')]['message']);}else{logger[_0x1703('0xb')](_0x1703('0xc'),_0x2ba8e2,_0x1703('0xd'));_0x4f46dc(_0x5ded48['result'][_0x1703('0x13')]);}})[_0x1703('0x14')](function(_0x4d53d1){logger[_0x1703('0x11')](_0x1703('0xc'),_0x2ba8e2,_0x4d53d1);_0x1cba9a(_0x4d53d1);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index a723cbb..faa2906 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 _0x6124=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x217d66,_0x5e1e22){var _0x2edc8a=function(_0x191393){while(--_0x191393){_0x217d66['push'](_0x217d66['shift']());}};_0x2edc8a(++_0x5e1e22);}(_0x6124,0x140));var _0x4612=function(_0x4244b3,_0x2da4f3){_0x4244b3=_0x4244b3-0x0;var _0x851509=_0x6124[_0x4244b3];return _0x851509;};'use strict';var multer=require(_0x4612('0x0'));var util=require(_0x4612('0x1'));var path=require(_0x4612('0x2'));var timeout=require('connect-timeout');var express=require(_0x4612('0x3'));var router=express[_0x4612('0x4')]();var fs_extra=require(_0x4612('0x5'));var auth=require(_0x4612('0x6'));var interaction=require(_0x4612('0x7'));var config=require(_0x4612('0x8'));var controller=require(_0x4612('0x9'));router['get']('/',auth[_0x4612('0xa')](),controller[_0x4612('0xb')]);router[_0x4612('0xc')](_0x4612('0xd'),auth['isAuthenticated'](),controller[_0x4612('0xe')]);router[_0x4612('0xf')]('/',auth[_0x4612('0xa')](),controller[_0x4612('0x10')]);router[_0x4612('0x11')](_0x4612('0xd'),auth[_0x4612('0xa')](),controller[_0x4612('0x12')]);router[_0x4612('0x13')](_0x4612('0xd'),auth[_0x4612('0xa')](),controller[_0x4612('0x14')]);module[_0x4612('0x15')]=router; \ No newline at end of file +var _0xd5a2=['show','create','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x3c5dd2,_0x44f997){var _0x27e534=function(_0xbea2d1){while(--_0xbea2d1){_0x3c5dd2['push'](_0x3c5dd2['shift']());}};_0x27e534(++_0x44f997);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x12b88f,_0x28ed14){_0x12b88f=_0x12b88f-0x0;var _0x5c8fde=_0xd5a2[_0x12b88f];return _0x5c8fde;};'use strict';var multer=require('multer');var util=require(_0x2d5a('0x0'));var path=require(_0x2d5a('0x1'));var timeout=require(_0x2d5a('0x2'));var express=require(_0x2d5a('0x3'));var router=express[_0x2d5a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2d5a('0x5'));var interaction=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var controller=require(_0x2d5a('0x8'));router[_0x2d5a('0x9')]('/',auth[_0x2d5a('0xa')](),controller[_0x2d5a('0xb')]);router[_0x2d5a('0x9')](_0x2d5a('0xc'),auth[_0x2d5a('0xa')](),controller[_0x2d5a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2d5a('0xe')]);router['put'](_0x2d5a('0xc'),auth[_0x2d5a('0xa')](),controller['update']);router[_0x2d5a('0xf')](_0x2d5a('0xc'),auth[_0x2d5a('0xa')](),controller[_0x2d5a('0x10')]);module[_0x2d5a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e31baf8..5c2bae5 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 _0xd363=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xd363,0x17b));var _0x3d36=function(_0x256cc1,_0x568424){_0x256cc1=_0x256cc1-0x0;var _0x330d0a=_0xd363[_0x256cc1];return _0x330d0a;};'use strict';var Sequelize=require(_0x3d36('0x0'));module['exports']={'type':{'type':Sequelize[_0x3d36('0x1')](_0x3d36('0x2'),_0x3d36('0x3'),_0x3d36('0x4'),_0x3d36('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3d36('0x6')]},'key':{'type':Sequelize[_0x3d36('0x6')]},'keyType':{'type':Sequelize[_0x3d36('0x1')](_0x3d36('0x2'),_0x3d36('0x3'),_0x3d36('0x4'))},'keyContent':{'type':Sequelize[_0x3d36('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3d36('0x6')]},'customField':{'type':Sequelize[_0x3d36('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe3ee=['STRING','ENUM','BOOLEAN','sequelize','exports','string','customVariable','keyValue'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0xe3ee,0xa3));var _0xee3e=function(_0x1f21af,_0x38970a){_0x1f21af=_0x1f21af-0x0;var _0x5c991e=_0xe3ee[_0x1f21af];return _0x5c991e;};'use strict';var Sequelize=require(_0xee3e('0x0'));module[_0xee3e('0x1')]={'type':{'type':Sequelize['ENUM'](_0xee3e('0x2'),'variable',_0xee3e('0x3'),_0xee3e('0x4'),'picklist'),'defaultValue':_0xee3e('0x2')},'content':{'type':Sequelize[_0xee3e('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xee3e('0x6')](_0xee3e('0x2'),'variable',_0xee3e('0x3'))},'keyContent':{'type':Sequelize[_0xee3e('0x5')]},'idField':{'type':Sequelize[_0xee3e('0x5')]},'nameField':{'type':Sequelize[_0xee3e('0x5')]},'customField':{'type':Sequelize[_0xee3e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xee3e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3d51fab..4882344 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 _0xa0a1=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','set','apply','reject','then','destroy','end','error','stack','name','send','index','DeskField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','keys','options','create','body','update','find','params','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv'];(function(_0x497750,_0x434e80){var _0x5d68d5=function(_0x248447){while(--_0x248447){_0x497750['push'](_0x497750['shift']());}};_0x5d68d5(++_0x434e80);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x24c5e9,_0x13b505){_0x24c5e9=_0x24c5e9-0x0;var _0x22c495=_0xa0a1[_0x24c5e9];return _0x22c495;};'use strict';var emlformat=require(_0x1a0a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a0a('0x1'));var jsonpatch=require(_0x1a0a('0x2'));var rp=require(_0x1a0a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a0a('0x4'));var util=require(_0x1a0a('0x5'));var path=require('path');var sox=require(_0x1a0a('0x6'));var csv=require(_0x1a0a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a0a('0x8'));var _=require(_0x1a0a('0x9'));var squel=require(_0x1a0a('0xa'));var crypto=require(_0x1a0a('0xb'));var jsforce=require(_0x1a0a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1a0a('0x7'));var querystring=require(_0x1a0a('0xd'));var Papa=require(_0x1a0a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a0a('0xf'));var hardwareService=require(_0x1a0a('0x10'));var logger=require(_0x1a0a('0x11'))('api');var utils=require(_0x1a0a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1a0a('0x13'));var db=require(_0x1a0a('0x14'))['db'];function respondWithStatusCode(_0x461b36,_0x1877bf){_0x1877bf=_0x1877bf||0xcc;return function(_0x289046){if(_0x289046){return _0x461b36[_0x1a0a('0x15')](_0x1877bf);}return _0x461b36[_0x1a0a('0x16')](_0x1877bf)['end']();};}function respondWithResult(_0x88d191,_0x3b0b2d){_0x3b0b2d=_0x3b0b2d||0xc8;return function(_0x3c531c){if(_0x3c531c){return _0x88d191[_0x1a0a('0x16')](_0x3b0b2d)[_0x1a0a('0x17')](_0x3c531c);}};}function respondWithFilteredResult(_0x4c8080,_0x16b8c9){return function(_0x80627b){if(_0x80627b){var _0x157b74=typeof _0x16b8c9['offset']===_0x1a0a('0x18')&&typeof _0x16b8c9['limit']===_0x1a0a('0x18');var _0x57f65d=_0x80627b['count'];var _0x3a988c=_0x157b74?0x0:_0x16b8c9[_0x1a0a('0x19')];var _0x307fdc=_0x157b74?_0x80627b[_0x1a0a('0x1a')]:_0x16b8c9['offset']+_0x16b8c9['limit'];var _0x239065;if(_0x307fdc>=_0x57f65d){_0x307fdc=_0x57f65d;_0x239065=0xc8;}else{_0x239065=0xce;}_0x4c8080[_0x1a0a('0x16')](_0x239065);return _0x4c8080[_0x1a0a('0x1b')]('Content-Range',_0x3a988c+'-'+_0x307fdc+'/'+_0x57f65d)[_0x1a0a('0x17')](_0x80627b);}return null;};}function patchUpdates(_0x3547fe){return function(_0x5bb4bd){try{jsonpatch[_0x1a0a('0x1c')](_0x5bb4bd,_0x3547fe,!![]);}catch(_0x1ba27f){return BPromise[_0x1a0a('0x1d')](_0x1ba27f);}return _0x5bb4bd['save']();};}function saveUpdates(_0x159a2a,_0xc33284){return function(_0x1f4083){if(_0x1f4083){return _0x1f4083['update'](_0x159a2a)[_0x1a0a('0x1e')](function(_0x47ef88){return _0x47ef88;});}return null;};}function removeEntity(_0x28c094,_0x2d426d){return function(_0x2d7967){if(_0x2d7967){return _0x2d7967[_0x1a0a('0x1f')]()[_0x1a0a('0x1e')](function(){_0x28c094['status'](0xcc)[_0x1a0a('0x20')]();});}};}function handleEntityNotFound(_0x8e4151,_0x561407){return function(_0x4cf939){if(!_0x4cf939){_0x8e4151[_0x1a0a('0x15')](0x194);}return _0x4cf939;};}function handleError(_0x184de8,_0x3f61e4){_0x3f61e4=_0x3f61e4||0x1f4;return function(_0x365ab5){logger[_0x1a0a('0x21')](_0x365ab5[_0x1a0a('0x22')]);if(_0x365ab5[_0x1a0a('0x23')]){delete _0x365ab5[_0x1a0a('0x23')];}_0x184de8[_0x1a0a('0x16')](_0x3f61e4)[_0x1a0a('0x24')](_0x365ab5);};}exports[_0x1a0a('0x25')]=function(_0x35fd0a,_0x354d89){var _0x385f2b={},_0x396c01={},_0x3069ab={'count':0x0,'rows':[]};var _0x297b12=_['map'](db[_0x1a0a('0x26')][_0x1a0a('0x27')],function(_0x36ca44){return{'name':_0x36ca44[_0x1a0a('0x28')],'type':_0x36ca44[_0x1a0a('0x29')][_0x1a0a('0x2a')]};});_0x396c01[_0x1a0a('0x2b')]=_[_0x1a0a('0x2c')](_0x297b12,_0x1a0a('0x23'));_0x396c01[_0x1a0a('0x2d')]=_['keys'](_0x35fd0a[_0x1a0a('0x2d')]);_0x396c01[_0x1a0a('0x2e')]=_['intersection'](_0x396c01[_0x1a0a('0x2b')],_0x396c01['query']);_0x385f2b['attributes']=_[_0x1a0a('0x2f')](_0x396c01[_0x1a0a('0x2b')],qs['fields'](_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x30')]));_0x385f2b[_0x1a0a('0x31')]=_0x385f2b['attributes'][_0x1a0a('0x32')]?_0x385f2b[_0x1a0a('0x31')]:_0x396c01['model'];if(!_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x33')]('nolimit')){_0x385f2b[_0x1a0a('0x34')]=qs[_0x1a0a('0x34')](_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x34')]);_0x385f2b['offset']=qs[_0x1a0a('0x19')](_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x19')]);}_0x385f2b[_0x1a0a('0x35')]=qs[_0x1a0a('0x36')](_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x36')]);_0x385f2b[_0x1a0a('0x37')]=qs[_0x1a0a('0x2e')](_['pick'](_0x35fd0a['query'],_0x396c01['filters']),_0x297b12);if(_0x35fd0a['query'][_0x1a0a('0x38')]){_0x385f2b['where']=_[_0x1a0a('0x39')](_0x385f2b[_0x1a0a('0x37')],{'$or':_['map'](_0x297b12,function(_0x5f586c){if(_0x5f586c[_0x1a0a('0x29')]!==_0x1a0a('0x3a')){var _0x13042e={};_0x13042e[_0x5f586c[_0x1a0a('0x23')]]={'$like':'%'+_0x35fd0a['query'][_0x1a0a('0x38')]+'%'};return _0x13042e;}})});}_0x385f2b=_['merge']({},_0x385f2b,_0x35fd0a['options']);var _0x4852e8={'where':_0x385f2b[_0x1a0a('0x37')]};return db[_0x1a0a('0x26')]['count'](_0x4852e8)[_0x1a0a('0x1e')](function(_0x2dcda5){_0x3069ab['count']=_0x2dcda5;if(_0x35fd0a['query'][_0x1a0a('0x3b')]){_0x385f2b[_0x1a0a('0x3c')]=[{'all':!![]}];}return db['DeskField'][_0x1a0a('0x3d')](_0x385f2b);})[_0x1a0a('0x1e')](function(_0x56cfd6){_0x3069ab[_0x1a0a('0x3e')]=_0x56cfd6;return _0x3069ab;})['then'](respondWithFilteredResult(_0x354d89,_0x385f2b))[_0x1a0a('0x3f')](handleError(_0x354d89,null));};exports['show']=function(_0x2dfcfb,_0x7b6e14){var _0x3466f6={'raw':!![],'where':{'id':_0x2dfcfb['params']['id']}},_0x2a72b7={};_0x2a72b7[_0x1a0a('0x2b')]=_[_0x1a0a('0x40')](db[_0x1a0a('0x26')][_0x1a0a('0x27')]);_0x2a72b7['query']=_[_0x1a0a('0x40')](_0x2dfcfb[_0x1a0a('0x2d')]);_0x2a72b7['filters']=_[_0x1a0a('0x2f')](_0x2a72b7[_0x1a0a('0x2b')],_0x2a72b7[_0x1a0a('0x2d')]);_0x3466f6[_0x1a0a('0x31')]=_[_0x1a0a('0x2f')](_0x2a72b7[_0x1a0a('0x2b')],qs[_0x1a0a('0x30')](_0x2dfcfb[_0x1a0a('0x2d')][_0x1a0a('0x30')]));_0x3466f6[_0x1a0a('0x31')]=_0x3466f6['attributes'][_0x1a0a('0x32')]?_0x3466f6[_0x1a0a('0x31')]:_0x2a72b7['model'];if(_0x2dfcfb['query']['includeAll']){_0x3466f6['include']=[{'all':!![]}];}_0x3466f6=_[_0x1a0a('0x39')]({},_0x3466f6,_0x2dfcfb[_0x1a0a('0x41')]);return db['DeskField']['find'](_0x3466f6)['then'](handleEntityNotFound(_0x7b6e14,null))[_0x1a0a('0x1e')](respondWithResult(_0x7b6e14,null))[_0x1a0a('0x3f')](handleError(_0x7b6e14,null));};exports[_0x1a0a('0x42')]=function(_0x2c58a9,_0x4678da){return db[_0x1a0a('0x26')][_0x1a0a('0x42')](_0x2c58a9[_0x1a0a('0x43')],{})[_0x1a0a('0x1e')](respondWithResult(_0x4678da,0xc9))[_0x1a0a('0x3f')](handleError(_0x4678da,null));};exports[_0x1a0a('0x44')]=function(_0x2bab64,_0x23a985){if(_0x2bab64['body']['id']){delete _0x2bab64[_0x1a0a('0x43')]['id'];}return db[_0x1a0a('0x26')][_0x1a0a('0x45')]({'where':{'id':_0x2bab64['params']['id']}})[_0x1a0a('0x1e')](handleEntityNotFound(_0x23a985,null))[_0x1a0a('0x1e')](saveUpdates(_0x2bab64['body'],null))[_0x1a0a('0x1e')](respondWithResult(_0x23a985,null))[_0x1a0a('0x3f')](handleError(_0x23a985,null));};exports['destroy']=function(_0x555b6d,_0x313e79){return db['DeskField']['find']({'where':{'id':_0x555b6d[_0x1a0a('0x46')]['id']}})['then'](handleEntityNotFound(_0x313e79,null))[_0x1a0a('0x1e')](removeEntity(_0x313e79,null))[_0x1a0a('0x3f')](handleError(_0x313e79,null));}; \ No newline at end of file +var _0x398a=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','then','sendStatus','error','stack','name','send','index','DeskField','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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'];(function(_0x4a274b,_0x2fd7a4){var _0x41493f=function(_0x568122){while(--_0x568122){_0x4a274b['push'](_0x4a274b['shift']());}};_0x41493f(++_0x2fd7a4);}(_0x398a,0x11a));var _0xa398=function(_0x1b0a09,_0x1ae14d){_0x1b0a09=_0x1b0a09-0x0;var _0x37ef69=_0x398a[_0x1b0a09];return _0x37ef69;};'use strict';var emlformat=require(_0xa398('0x0'));var rimraf=require(_0xa398('0x1'));var zipdir=require(_0xa398('0x2'));var jsonpatch=require(_0xa398('0x3'));var rp=require(_0xa398('0x4'));var moment=require(_0xa398('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa398('0x6'));var sox=require(_0xa398('0x7'));var csv=require(_0xa398('0x8'));var ejs=require(_0xa398('0x9'));var fs=require('fs');var fs_extra=require(_0xa398('0xa'));var _=require(_0xa398('0xb'));var squel=require(_0xa398('0xc'));var crypto=require(_0xa398('0xd'));var jsforce=require(_0xa398('0xe'));var deskjs=require(_0xa398('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa398('0x10'));var Papa=require(_0xa398('0x11'));var Redis=require(_0xa398('0x12'));var authService=require(_0xa398('0x13'));var qs=require(_0xa398('0x14'));var as=require(_0xa398('0x15'));var hardwareService=require(_0xa398('0x16'));var logger=require('../../config/logger')(_0xa398('0x17'));var utils=require(_0xa398('0x18'));var config=require(_0xa398('0x19'));var licenseUtil=require(_0xa398('0x1a'));var db=require(_0xa398('0x1b'))['db'];function respondWithStatusCode(_0x109865,_0x362ef4){_0x362ef4=_0x362ef4||0xcc;return function(_0x1d39d6){if(_0x1d39d6){return _0x109865['sendStatus'](_0x362ef4);}return _0x109865[_0xa398('0x1c')](_0x362ef4)[_0xa398('0x1d')]();};}function respondWithResult(_0x316587,_0x20b340){_0x20b340=_0x20b340||0xc8;return function(_0xb2345f){if(_0xb2345f){return _0x316587[_0xa398('0x1c')](_0x20b340)[_0xa398('0x1e')](_0xb2345f);}};}function respondWithFilteredResult(_0x10bc43,_0x483dbf){return function(_0x264419){if(_0x264419){var _0x1788e5=typeof _0x483dbf['offset']===_0xa398('0x1f')&&typeof _0x483dbf[_0xa398('0x20')]===_0xa398('0x1f');var _0x41edbd=_0x264419[_0xa398('0x21')];var _0x144c1f=_0x1788e5?0x0:_0x483dbf[_0xa398('0x22')];var _0x10fa7f=_0x1788e5?_0x264419[_0xa398('0x21')]:_0x483dbf[_0xa398('0x22')]+_0x483dbf['limit'];var _0x1941c3;if(_0x10fa7f>=_0x41edbd){_0x10fa7f=_0x41edbd;_0x1941c3=0xc8;}else{_0x1941c3=0xce;}_0x10bc43[_0xa398('0x1c')](_0x1941c3);return _0x10bc43['set']('Content-Range',_0x144c1f+'-'+_0x10fa7f+'/'+_0x41edbd)[_0xa398('0x1e')](_0x264419);}return null;};}function patchUpdates(_0x4e21bc){return function(_0x1a3f34){try{jsonpatch[_0xa398('0x23')](_0x1a3f34,_0x4e21bc,!![]);}catch(_0x3ddae2){return BPromise[_0xa398('0x24')](_0x3ddae2);}return _0x1a3f34[_0xa398('0x25')]();};}function saveUpdates(_0x54e08c,_0x46ab19){return function(_0x550e75){if(_0x550e75){return _0x550e75['update'](_0x54e08c)['then'](function(_0x4c92a0){return _0x4c92a0;});}return null;};}function removeEntity(_0x3f6601,_0x11ebc7){return function(_0x1a2b9e){if(_0x1a2b9e){return _0x1a2b9e['destroy']()[_0xa398('0x26')](function(){_0x3f6601[_0xa398('0x1c')](0xcc)[_0xa398('0x1d')]();});}};}function handleEntityNotFound(_0x44692d,_0x47df2a){return function(_0x311a77){if(!_0x311a77){_0x44692d[_0xa398('0x27')](0x194);}return _0x311a77;};}function handleError(_0x4626c1,_0x8db81b){_0x8db81b=_0x8db81b||0x1f4;return function(_0x7d1e04){logger[_0xa398('0x28')](_0x7d1e04[_0xa398('0x29')]);if(_0x7d1e04[_0xa398('0x2a')]){delete _0x7d1e04[_0xa398('0x2a')];}_0x4626c1['status'](_0x8db81b)[_0xa398('0x2b')](_0x7d1e04);};}exports[_0xa398('0x2c')]=function(_0x215ca6,_0x1fd70d){var _0x1cbe2f={},_0x4641e8={},_0x598851={'count':0x0,'rows':[]};var _0x2ad539=_['map'](db[_0xa398('0x2d')]['rawAttributes'],function(_0x3244d5){return{'name':_0x3244d5[_0xa398('0x2e')],'type':_0x3244d5[_0xa398('0x2f')][_0xa398('0x30')]};});_0x4641e8[_0xa398('0x31')]=_[_0xa398('0x32')](_0x2ad539,'name');_0x4641e8[_0xa398('0x33')]=_[_0xa398('0x34')](_0x215ca6[_0xa398('0x33')]);_0x4641e8[_0xa398('0x35')]=_[_0xa398('0x36')](_0x4641e8[_0xa398('0x31')],_0x4641e8[_0xa398('0x33')]);_0x1cbe2f['attributes']=_[_0xa398('0x36')](_0x4641e8[_0xa398('0x31')],qs[_0xa398('0x37')](_0x215ca6[_0xa398('0x33')]['fields']));_0x1cbe2f[_0xa398('0x38')]=_0x1cbe2f[_0xa398('0x38')][_0xa398('0x39')]?_0x1cbe2f['attributes']:_0x4641e8[_0xa398('0x31')];if(!_0x215ca6[_0xa398('0x33')][_0xa398('0x3a')](_0xa398('0x3b'))){_0x1cbe2f[_0xa398('0x20')]=qs[_0xa398('0x20')](_0x215ca6[_0xa398('0x33')]['limit']);_0x1cbe2f[_0xa398('0x22')]=qs['offset'](_0x215ca6[_0xa398('0x33')]['offset']);}_0x1cbe2f['order']=qs['sort'](_0x215ca6['query'][_0xa398('0x3c')]);_0x1cbe2f[_0xa398('0x3d')]=qs[_0xa398('0x35')](_[_0xa398('0x3e')](_0x215ca6[_0xa398('0x33')],_0x4641e8[_0xa398('0x35')]),_0x2ad539);if(_0x215ca6[_0xa398('0x33')][_0xa398('0x3f')]){_0x1cbe2f['where']=_[_0xa398('0x40')](_0x1cbe2f[_0xa398('0x3d')],{'$or':_[_0xa398('0x32')](_0x2ad539,function(_0x8859a8){if(_0x8859a8['type']!==_0xa398('0x41')){var _0x45e84e={};_0x45e84e[_0x8859a8['name']]={'$like':'%'+_0x215ca6[_0xa398('0x33')][_0xa398('0x3f')]+'%'};return _0x45e84e;}})});}_0x1cbe2f=_[_0xa398('0x40')]({},_0x1cbe2f,_0x215ca6[_0xa398('0x42')]);var _0x4bab3a={'where':_0x1cbe2f[_0xa398('0x3d')]};return db[_0xa398('0x2d')][_0xa398('0x21')](_0x4bab3a)['then'](function(_0x2eb748){_0x598851[_0xa398('0x21')]=_0x2eb748;if(_0x215ca6['query'][_0xa398('0x43')]){_0x1cbe2f[_0xa398('0x44')]=[{'all':!![]}];}return db['DeskField'][_0xa398('0x45')](_0x1cbe2f);})[_0xa398('0x26')](function(_0x31e4bb){_0x598851[_0xa398('0x46')]=_0x31e4bb;return _0x598851;})[_0xa398('0x26')](respondWithFilteredResult(_0x1fd70d,_0x1cbe2f))[_0xa398('0x47')](handleError(_0x1fd70d,null));};exports['show']=function(_0x30e2b1,_0x184feb){var _0x2eb0c6={'raw':!![],'where':{'id':_0x30e2b1[_0xa398('0x48')]['id']}},_0x3f9e95={};_0x3f9e95[_0xa398('0x31')]=_[_0xa398('0x34')](db['DeskField']['rawAttributes']);_0x3f9e95[_0xa398('0x33')]=_[_0xa398('0x34')](_0x30e2b1[_0xa398('0x33')]);_0x3f9e95[_0xa398('0x35')]=_[_0xa398('0x36')](_0x3f9e95[_0xa398('0x31')],_0x3f9e95['query']);_0x2eb0c6['attributes']=_[_0xa398('0x36')](_0x3f9e95['model'],qs[_0xa398('0x37')](_0x30e2b1['query'][_0xa398('0x37')]));_0x2eb0c6[_0xa398('0x38')]=_0x2eb0c6['attributes'][_0xa398('0x39')]?_0x2eb0c6[_0xa398('0x38')]:_0x3f9e95[_0xa398('0x31')];if(_0x30e2b1[_0xa398('0x33')][_0xa398('0x43')]){_0x2eb0c6[_0xa398('0x44')]=[{'all':!![]}];}_0x2eb0c6=_['merge']({},_0x2eb0c6,_0x30e2b1['options']);return db['DeskField'][_0xa398('0x49')](_0x2eb0c6)[_0xa398('0x26')](handleEntityNotFound(_0x184feb,null))['then'](respondWithResult(_0x184feb,null))[_0xa398('0x47')](handleError(_0x184feb,null));};exports[_0xa398('0x4a')]=function(_0x28f371,_0x4bda1c){return db[_0xa398('0x2d')][_0xa398('0x4a')](_0x28f371[_0xa398('0x4b')],{})['then'](respondWithResult(_0x4bda1c,0xc9))['catch'](handleError(_0x4bda1c,null));};exports['update']=function(_0x3e7109,_0x530e9e){if(_0x3e7109[_0xa398('0x4b')]['id']){delete _0x3e7109[_0xa398('0x4b')]['id'];}return db[_0xa398('0x2d')][_0xa398('0x49')]({'where':{'id':_0x3e7109['params']['id']}})[_0xa398('0x26')](handleEntityNotFound(_0x530e9e,null))[_0xa398('0x26')](saveUpdates(_0x3e7109[_0xa398('0x4b')],null))['then'](respondWithResult(_0x530e9e,null))['catch'](handleError(_0x530e9e,null));};exports['destroy']=function(_0x414762,_0xb01b2e){return db['DeskField'][_0xa398('0x49')]({'where':{'id':_0x414762['params']['id']}})[_0xa398('0x26')](handleEntityNotFound(_0xb01b2e,null))[_0xa398('0x26')](removeEntity(_0xb01b2e,null))[_0xa398('0x47')](handleError(_0xb01b2e,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 62f2542..6f79425 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 _0xd37d=['request-promise','path','define','DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2df84d,_0x56d874){var _0x2634ce=function(_0x8e8e31){while(--_0x8e8e31){_0x2df84d['push'](_0x2df84d['shift']());}};_0x2634ce(++_0x56d874);}(_0xd37d,0x1e7));var _0xdd37=function(_0x734a07,_0x2c9a39){_0x734a07=_0x734a07-0x0;var _0x15b45a=_0xd37d[_0x734a07];return _0x15b45a;};'use strict';var _=require(_0xdd37('0x0'));var util=require(_0xdd37('0x1'));var logger=require(_0xdd37('0x2'))('api');var moment=require(_0xdd37('0x3'));var BPromise=require(_0xdd37('0x4'));var rp=require(_0xdd37('0x5'));var fs=require('fs');var path=require(_0xdd37('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module['exports']=function(_0x3188ee,_0xbd0ec){return _0x3188ee[_0xdd37('0x7')](_0xdd37('0x8'),attributes,{'tableName':_0xdd37('0x9'),'paranoid':![],'indexes':[{'name':_0xdd37('0xa'),'fields':[_0xdd37('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3b31=['moment','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','desk_unique_index','lodash','util','api'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0x3b31,0x147));var _0x13b3=function(_0x449287,_0x31e948){_0x449287=_0x449287-0x0;var _0x504d63=_0x3b31[_0x449287];return _0x504d63;};'use strict';var _=require(_0x13b3('0x0'));var util=require(_0x13b3('0x1'));var logger=require('../../config/logger')(_0x13b3('0x2'));var moment=require(_0x13b3('0x3'));var BPromise=require('bluebird');var rp=require(_0x13b3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x13b3('0x5'));var config=require(_0x13b3('0x6'));var attributes=require(_0x13b3('0x7'));module[_0x13b3('0x8')]=function(_0x1098c1,_0x5c73b0){return _0x1098c1['define'](_0x13b3('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x13b3('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 14b9167..77e9923 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 _0xd21e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','util','moment','bluebird','randomstring','ioredis'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0xd21e,0xeb));var _0xed21=function(_0x4bd70c,_0x1785ea){_0x4bd70c=_0x4bd70c-0x0;var _0xcb4a5f=_0xd21e[_0x4bd70c];return _0xcb4a5f;};'use strict';var _=require('lodash');var util=require(_0xed21('0x0'));var moment=require(_0xed21('0x1'));var BPromise=require(_0xed21('0x2'));var rs=require(_0xed21('0x3'));var fs=require('fs');var Redis=require(_0xed21('0x4'));var db=require(_0xed21('0x5'))['db'];var utils=require(_0xed21('0x6'));var logger=require('../../config/logger')(_0xed21('0x7'));var config=require(_0xed21('0x8'));var jayson=require(_0xed21('0x9'));var client=jayson[_0xed21('0xa')][_0xed21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c7e82,_0x417685,_0xf3e03e){return new BPromise(function(_0x4131b1,_0x38787e){return client['request'](_0x1c7e82,_0xf3e03e)[_0xed21('0xc')](function(_0x4dfbf4){logger['info'](_0xed21('0xd'),_0x417685,_0xed21('0xe'));logger['debug'](_0xed21('0xf'),_0x417685,_0xed21('0xe'),JSON['stringify'](_0x4dfbf4));if(_0x4dfbf4[_0xed21('0x10')]){if(_0x4dfbf4['error'][_0xed21('0x11')]===0x1f4){logger[_0xed21('0x10')](_0xed21('0xd'),_0x417685,_0x4dfbf4[_0xed21('0x10')]['message']);return _0x38787e(_0x4dfbf4[_0xed21('0x10')]['message']);}logger[_0xed21('0x10')](_0xed21('0xd'),_0x417685,_0x4dfbf4[_0xed21('0x10')]['message']);return _0x4131b1(_0x4dfbf4['error'][_0xed21('0x12')]);}else{logger[_0xed21('0x13')](_0xed21('0xd'),_0x417685,_0xed21('0xe'));_0x4131b1(_0x4dfbf4['result'][_0xed21('0x12')]);}})['catch'](function(_0x3a42ef){logger[_0xed21('0x10')](_0xed21('0xd'),_0x417685,_0x3a42ef);_0x38787e(_0x3a42ef);});});} \ No newline at end of file +var _0x0ca2=['debug','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x42d98d,_0x1cb5e8){var _0xb0a743=function(_0x16cc06){while(--_0x16cc06){_0x42d98d['push'](_0x42d98d['shift']());}};_0xb0a743(++_0x1cb5e8);}(_0x0ca2,0x1a4));var _0x20ca=function(_0x3167b1,_0x5ad266){_0x3167b1=_0x3167b1-0x0;var _0x362152=_0x0ca2[_0x3167b1];return _0x362152;};'use strict';var _=require('lodash');var util=require(_0x20ca('0x0'));var moment=require(_0x20ca('0x1'));var BPromise=require(_0x20ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20ca('0x3'));var db=require(_0x20ca('0x4'))['db'];var utils=require(_0x20ca('0x5'));var logger=require(_0x20ca('0x6'))(_0x20ca('0x7'));var config=require(_0x20ca('0x8'));var jayson=require(_0x20ca('0x9'));var client=jayson[_0x20ca('0xa')][_0x20ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ba9e5,_0x47c64f,_0x29d4ec){return new BPromise(function(_0x2b9c0c,_0x248223){return client[_0x20ca('0xc')](_0x1ba9e5,_0x29d4ec)[_0x20ca('0xd')](function(_0xd02d08){logger[_0x20ca('0xe')](_0x20ca('0xf'),_0x47c64f,_0x20ca('0x10'));logger[_0x20ca('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x47c64f,_0x20ca('0x10'),JSON[_0x20ca('0x12')](_0xd02d08));if(_0xd02d08[_0x20ca('0x13')]){if(_0xd02d08['error'][_0x20ca('0x14')]===0x1f4){logger[_0x20ca('0x13')](_0x20ca('0xf'),_0x47c64f,_0xd02d08[_0x20ca('0x13')][_0x20ca('0x15')]);return _0x248223(_0xd02d08['error'][_0x20ca('0x15')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x47c64f,_0xd02d08[_0x20ca('0x13')]['message']);return _0x2b9c0c(_0xd02d08[_0x20ca('0x13')]['message']);}else{logger[_0x20ca('0xe')](_0x20ca('0xf'),_0x47c64f,_0x20ca('0x10'));_0x2b9c0c(_0xd02d08[_0x20ca('0x16')][_0x20ca('0x15')]);}})['catch'](function(_0x4c0173){logger['error'](_0x20ca('0xf'),_0x47c64f,_0x4c0173);_0x248223(_0x4c0173);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6bdd277..74aaeba 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 _0xc9ad=['./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x22cf60,_0x549835){var _0x1cd601=function(_0x5b3b43){while(--_0x5b3b43){_0x22cf60['push'](_0x22cf60['shift']());}};_0x1cd601(++_0x549835);}(_0xc9ad,0x10a));var _0xdc9a=function(_0x2a7e17,_0x4a2530){_0x2a7e17=_0x2a7e17-0x0;var _0x43da57=_0xc9ad[_0x2a7e17];return _0x43da57;};'use strict';var multer=require(_0xdc9a('0x0'));var util=require(_0xdc9a('0x1'));var path=require('path');var timeout=require(_0xdc9a('0x2'));var express=require(_0xdc9a('0x3'));var router=express[_0xdc9a('0x4')]();var fs_extra=require(_0xdc9a('0x5'));var auth=require(_0xdc9a('0x6'));var interaction=require(_0xdc9a('0x7'));var config=require(_0xdc9a('0x8'));var controller=require(_0xdc9a('0x9'));router['get']('/',auth[_0xdc9a('0xa')](),controller[_0xdc9a('0xb')]);router[_0xdc9a('0xc')](_0xdc9a('0xd'),auth['isAuthenticated'](),controller[_0xdc9a('0xe')]);router[_0xdc9a('0xc')](_0xdc9a('0xf'),auth[_0xdc9a('0xa')](),controller[_0xdc9a('0x10')]);router[_0xdc9a('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdc9a('0x11')]);router[_0xdc9a('0x12')]('/',auth[_0xdc9a('0xa')](),controller[_0xdc9a('0x13')]);router[_0xdc9a('0x12')](_0xdc9a('0xf'),auth[_0xdc9a('0xa')](),controller[_0xdc9a('0x14')]);router[_0xdc9a('0x15')](_0xdc9a('0xd'),auth['isAuthenticated'](),controller[_0xdc9a('0x16')]);router[_0xdc9a('0x17')](_0xdc9a('0xd'),auth[_0xdc9a('0xa')](),controller[_0xdc9a('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa96f=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','exports'];(function(_0x2f0d1a,_0x53949e){var _0x352ddf=function(_0x36af18){while(--_0x36af18){_0x2f0d1a['push'](_0x2f0d1a['shift']());}};_0x352ddf(++_0x53949e);}(_0xa96f,0x150));var _0xfa96=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0xa96f[_0x9b2bb0];return _0x2cdb3b;};'use strict';var multer=require(_0xfa96('0x0'));var util=require('util');var path=require(_0xfa96('0x1'));var timeout=require(_0xfa96('0x2'));var express=require(_0xfa96('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfa96('0x4'));var interaction=require(_0xfa96('0x5'));var config=require(_0xfa96('0x6'));var controller=require(_0xfa96('0x7'));router[_0xfa96('0x8')]('/',auth[_0xfa96('0x9')](),controller[_0xfa96('0xa')]);router['get'](_0xfa96('0xb'),auth['isAuthenticated'](),controller[_0xfa96('0xc')]);router[_0xfa96('0x8')]('/:id/configurations',auth[_0xfa96('0x9')](),controller[_0xfa96('0xd')]);router[_0xfa96('0x8')](_0xfa96('0xe'),auth[_0xfa96('0x9')](),controller[_0xfa96('0xf')]);router[_0xfa96('0x10')]('/',auth[_0xfa96('0x9')](),controller['create']);router[_0xfa96('0x10')](_0xfa96('0x11'),auth[_0xfa96('0x9')](),controller[_0xfa96('0x12')]);router[_0xfa96('0x13')](_0xfa96('0xb'),auth[_0xfa96('0x9')](),controller['update']);router['delete'](_0xfa96('0xb'),auth[_0xfa96('0x9')](),controller['destroy']);module[_0xfa96('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e834ac9..419fd3b 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 _0xc749=['STRING','sequelize'];(function(_0x56cbeb,_0x30d6ad){var _0x32f613=function(_0x1eb36f){while(--_0x1eb36f){_0x56cbeb['push'](_0x56cbeb['shift']());}};_0x32f613(++_0x30d6ad);}(_0xc749,0x135));var _0x9c74=function(_0x569795,_0x10c9fa){_0x569795=_0x569795-0x0;var _0x4cf9da=_0xc749[_0x569795];return _0x4cf9da;};'use strict';var Sequelize=require(_0x9c74('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c74('0x1')]},'username':{'type':Sequelize[_0x9c74('0x1')]},'password':{'type':Sequelize[_0x9c74('0x1')]},'remoteUri':{'type':Sequelize[_0x9c74('0x1')]},'tenantId':{'type':Sequelize[_0x9c74('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9c74('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9c74('0x1')]}}; \ No newline at end of file +var _0x3376=['STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3376,0x168));var _0x6337=function(_0x45e2ad,_0x11c28e){_0x45e2ad=_0x45e2ad-0x0;var _0x7ac69f=_0x3376[_0x45e2ad];return _0x7ac69f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6337('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6337('0x0')]},'tenantId':{'type':Sequelize[_0x6337('0x0')]},'clientId':{'type':Sequelize[_0x6337('0x0')]},'clientSecret':{'type':Sequelize[_0x6337('0x0')]},'serverUrl':{'type':Sequelize[_0x6337('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x6337('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 0e6708a..d55655a 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 _0x3f49=['kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','/oauth2/token','access_token','GET','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Bearer\x20','OptionSet','Options','UserLocalizedLabel','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset','limit','count','set','apply','save','then','status','sendStatus','error','stack','name','send','index','map','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','update','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','description','customerid','ownerid','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f49,0x11f));var _0x93f4=function(_0x1c6f6c,_0x34a3df){_0x1c6f6c=_0x1c6f6c-0x0;var _0xa486d1=_0x3f49[_0x1c6f6c];return _0xa486d1;};'use strict';var emlformat=require(_0x93f4('0x0'));var rimraf=require(_0x93f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f4('0x2'));var rp=require(_0x93f4('0x3'));var moment=require(_0x93f4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x93f4('0x5'));var util=require(_0x93f4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x93f4('0x7'));var ejs=require(_0x93f4('0x8'));var fs=require('fs');var fs_extra=require(_0x93f4('0x9'));var _=require('lodash');var squel=require(_0x93f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x93f4('0xb'));var deskjs=require(_0x93f4('0xc'));var toCsv=require(_0x93f4('0x7'));var querystring=require(_0x93f4('0xd'));var Papa=require(_0x93f4('0xe'));var Redis=require(_0x93f4('0xf'));var authService=require(_0x93f4('0x10'));var qs=require(_0x93f4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x93f4('0x12'))(_0x93f4('0x13'));var utils=require(_0x93f4('0x14'));var config=require(_0x93f4('0x15'));var licenseUtil=require(_0x93f4('0x16'));var db=require(_0x93f4('0x17'))['db'];var integrations=require(_0x93f4('0x18'));function respondWithStatusCode(_0x1d2edb,_0x54e7c6){_0x54e7c6=_0x54e7c6||0xcc;return function(_0x3e6dd6){if(_0x3e6dd6){return _0x1d2edb['sendStatus'](_0x54e7c6);}return _0x1d2edb['status'](_0x54e7c6)[_0x93f4('0x19')]();};}function respondWithResult(_0x1d63ef,_0x1f8832){_0x1f8832=_0x1f8832||0xc8;return function(_0x52298b){if(_0x52298b){return _0x1d63ef['status'](_0x1f8832)[_0x93f4('0x1a')](_0x52298b);}};}function respondWithFilteredResult(_0x40f50a,_0x3fdf23){return function(_0x5e4e32){if(_0x5e4e32){var _0x33dfb3=typeof _0x3fdf23[_0x93f4('0x1b')]==='undefined'&&typeof _0x3fdf23[_0x93f4('0x1c')]==='undefined';var _0x5edf31=_0x5e4e32[_0x93f4('0x1d')];var _0x5b6488=_0x33dfb3?0x0:_0x3fdf23[_0x93f4('0x1b')];var _0x556fc6=_0x33dfb3?_0x5e4e32['count']:_0x3fdf23['offset']+_0x3fdf23[_0x93f4('0x1c')];var _0x2cd6a6;if(_0x556fc6>=_0x5edf31){_0x556fc6=_0x5edf31;_0x2cd6a6=0xc8;}else{_0x2cd6a6=0xce;}_0x40f50a['status'](_0x2cd6a6);return _0x40f50a[_0x93f4('0x1e')]('Content-Range',_0x5b6488+'-'+_0x556fc6+'/'+_0x5edf31)[_0x93f4('0x1a')](_0x5e4e32);}return null;};}function patchUpdates(_0x3182d6){return function(_0xfb95e3){try{jsonpatch[_0x93f4('0x1f')](_0xfb95e3,_0x3182d6,!![]);}catch(_0x5f396d){return BPromise['reject'](_0x5f396d);}return _0xfb95e3[_0x93f4('0x20')]();};}function saveUpdates(_0x432f99,_0x5b0de8){return function(_0x58f8fd){if(_0x58f8fd){return _0x58f8fd['update'](_0x432f99)[_0x93f4('0x21')](function(_0x3301b5){return _0x3301b5;});}return null;};}function removeEntity(_0x475f0b,_0x4c87e3){return function(_0x31e249){if(_0x31e249){return _0x31e249['destroy']()[_0x93f4('0x21')](function(){_0x475f0b[_0x93f4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bebc1,_0x1decfc){return function(_0x186b3f){if(!_0x186b3f){_0x1bebc1[_0x93f4('0x23')](0x194);}return _0x186b3f;};}function handleError(_0x5cf6be,_0x454b5b){_0x454b5b=_0x454b5b||0x1f4;return function(_0x252c5c){logger[_0x93f4('0x24')](_0x252c5c[_0x93f4('0x25')]);if(_0x252c5c['name']){delete _0x252c5c[_0x93f4('0x26')];}_0x5cf6be[_0x93f4('0x22')](_0x454b5b)[_0x93f4('0x27')](_0x252c5c);};}exports[_0x93f4('0x28')]=function(_0x3d57c1,_0x275203){var _0x47776e={},_0x2fce95={},_0x501c27={'count':0x0,'rows':[]};var _0x1fff66=_[_0x93f4('0x29')](db['Dynamics365Account']['rawAttributes'],function(_0xd27b64){return{'name':_0xd27b64['fieldName'],'type':_0xd27b64[_0x93f4('0x2a')]['key']};});_0x2fce95[_0x93f4('0x2b')]=_['map'](_0x1fff66,'name');_0x2fce95[_0x93f4('0x2c')]=_[_0x93f4('0x2d')](_0x3d57c1[_0x93f4('0x2c')]);_0x2fce95['filters']=_[_0x93f4('0x2e')](_0x2fce95[_0x93f4('0x2b')],_0x2fce95[_0x93f4('0x2c')]);_0x47776e[_0x93f4('0x2f')]=_[_0x93f4('0x2e')](_0x2fce95[_0x93f4('0x2b')],qs[_0x93f4('0x30')](_0x3d57c1[_0x93f4('0x2c')]['fields']));_0x47776e[_0x93f4('0x2f')]=_0x47776e[_0x93f4('0x2f')]['length']?_0x47776e[_0x93f4('0x2f')]:_0x2fce95[_0x93f4('0x2b')];if(!_0x3d57c1['query']['hasOwnProperty'](_0x93f4('0x31'))){_0x47776e[_0x93f4('0x1c')]=qs[_0x93f4('0x1c')](_0x3d57c1[_0x93f4('0x2c')][_0x93f4('0x1c')]);_0x47776e[_0x93f4('0x1b')]=qs[_0x93f4('0x1b')](_0x3d57c1[_0x93f4('0x2c')][_0x93f4('0x1b')]);}_0x47776e[_0x93f4('0x32')]=qs[_0x93f4('0x33')](_0x3d57c1[_0x93f4('0x2c')][_0x93f4('0x33')]);_0x47776e[_0x93f4('0x34')]=qs[_0x93f4('0x35')](_[_0x93f4('0x36')](_0x3d57c1[_0x93f4('0x2c')],_0x2fce95[_0x93f4('0x35')]),_0x1fff66);if(_0x3d57c1['query'][_0x93f4('0x37')]){_0x47776e['where']=_[_0x93f4('0x38')](_0x47776e[_0x93f4('0x34')],{'$or':_[_0x93f4('0x29')](_0x1fff66,function(_0x135712){if(_0x135712[_0x93f4('0x2a')]!==_0x93f4('0x39')){var _0x3dd7b3={};_0x3dd7b3[_0x135712[_0x93f4('0x26')]]={'$like':'%'+_0x3d57c1[_0x93f4('0x2c')][_0x93f4('0x37')]+'%'};return _0x3dd7b3;}})});}_0x47776e=_[_0x93f4('0x38')]({},_0x47776e,_0x3d57c1[_0x93f4('0x3a')]);var _0x1fdf49={'where':_0x47776e[_0x93f4('0x34')]};return db[_0x93f4('0x3b')]['count'](_0x1fdf49)['then'](function(_0x50e1aa){_0x501c27[_0x93f4('0x1d')]=_0x50e1aa;if(_0x3d57c1[_0x93f4('0x2c')][_0x93f4('0x3c')]){_0x47776e[_0x93f4('0x3d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x93f4('0x3e')](_0x47776e);})[_0x93f4('0x21')](function(_0x2238d0){_0x501c27[_0x93f4('0x3f')]=_0x2238d0;return _0x501c27;})[_0x93f4('0x21')](respondWithFilteredResult(_0x275203,_0x47776e))[_0x93f4('0x40')](handleError(_0x275203,null));};exports[_0x93f4('0x41')]=function(_0x362dbc,_0x3ee9de){var _0x26ef4b={'raw':![],'where':{'id':_0x362dbc[_0x93f4('0x42')]['id']}},_0x56329b={};_0x56329b['model']=_[_0x93f4('0x2d')](db[_0x93f4('0x3b')][_0x93f4('0x43')]);_0x56329b['query']=_[_0x93f4('0x2d')](_0x362dbc[_0x93f4('0x2c')]);_0x56329b[_0x93f4('0x35')]=_[_0x93f4('0x2e')](_0x56329b['model'],_0x56329b[_0x93f4('0x2c')]);_0x26ef4b[_0x93f4('0x2f')]=_[_0x93f4('0x2e')](_0x56329b['model'],qs[_0x93f4('0x30')](_0x362dbc[_0x93f4('0x2c')][_0x93f4('0x30')]));_0x26ef4b[_0x93f4('0x2f')]=_0x26ef4b[_0x93f4('0x2f')][_0x93f4('0x44')]?_0x26ef4b[_0x93f4('0x2f')]:_0x56329b[_0x93f4('0x2b')];if(_0x362dbc[_0x93f4('0x2c')][_0x93f4('0x3c')]){_0x26ef4b[_0x93f4('0x3d')]=[{'all':!![]}];}_0x26ef4b=_[_0x93f4('0x38')]({},_0x26ef4b,_0x362dbc[_0x93f4('0x3a')]);return db[_0x93f4('0x3b')][_0x93f4('0x45')](_0x26ef4b)['then'](handleEntityNotFound(_0x3ee9de,null))[_0x93f4('0x21')](respondWithResult(_0x3ee9de,null))[_0x93f4('0x40')](handleError(_0x3ee9de,null));};exports[_0x93f4('0x46')]=function(_0x1a50c4,_0x248bdf){return db[_0x93f4('0x3b')]['create'](_0x1a50c4[_0x93f4('0x47')],{})[_0x93f4('0x21')](respondWithResult(_0x248bdf,0xc9))['catch'](handleError(_0x248bdf,null));};exports[_0x93f4('0x48')]=function(_0x2c8a13,_0x8d32c5){if(_0x2c8a13[_0x93f4('0x47')]['id']){delete _0x2c8a13['body']['id'];}return db[_0x93f4('0x3b')][_0x93f4('0x45')]({'where':{'id':_0x2c8a13[_0x93f4('0x42')]['id']}})['then'](handleEntityNotFound(_0x8d32c5,null))[_0x93f4('0x21')](saveUpdates(_0x2c8a13[_0x93f4('0x47')],null))[_0x93f4('0x21')](respondWithResult(_0x8d32c5,null))[_0x93f4('0x40')](handleError(_0x8d32c5,null));};exports['destroy']=function(_0x52db1f,_0x108487){return db[_0x93f4('0x3b')][_0x93f4('0x45')]({'where':{'id':_0x52db1f[_0x93f4('0x42')]['id']}})[_0x93f4('0x21')](handleEntityNotFound(_0x108487,null))[_0x93f4('0x21')](removeEntity(_0x108487,null))[_0x93f4('0x40')](handleError(_0x108487,null));};exports['getConfigurations']=function(_0x2cb1d3,_0xe3ca3d,_0x917aa3){var _0x458323={};var _0x247f0b={};var _0x340d52;var _0x203607;return db[_0x93f4('0x3b')]['findOne']({'where':{'id':_0x2cb1d3['params']['id']}})['then'](handleEntityNotFound(_0xe3ca3d,null))[_0x93f4('0x21')](function(_0x1d8c1){if(_0x1d8c1){_0x340d52=_0x1d8c1;_0x247f0b[_0x93f4('0x2b')]=_[_0x93f4('0x2d')](db['Dynamics365Configuration'][_0x93f4('0x43')]);_0x247f0b[_0x93f4('0x2c')]=_[_0x93f4('0x2d')](_0x2cb1d3[_0x93f4('0x2c')]);_0x247f0b[_0x93f4('0x35')]=_['intersection'](_0x247f0b[_0x93f4('0x2b')],_0x247f0b[_0x93f4('0x2c')]);_0x458323[_0x93f4('0x2f')]=_['intersection'](_0x247f0b['model'],qs[_0x93f4('0x30')](_0x2cb1d3['query'][_0x93f4('0x30')]));_0x458323[_0x93f4('0x2f')]=_0x458323[_0x93f4('0x2f')][_0x93f4('0x44')]?_0x458323[_0x93f4('0x2f')]:_0x247f0b[_0x93f4('0x2b')];_0x458323[_0x93f4('0x32')]=qs[_0x93f4('0x33')](_0x2cb1d3[_0x93f4('0x2c')][_0x93f4('0x33')]);_0x458323[_0x93f4('0x34')]=qs[_0x93f4('0x35')](_[_0x93f4('0x36')](_0x2cb1d3[_0x93f4('0x2c')],_0x247f0b[_0x93f4('0x35')]));if(_0x2cb1d3['query'][_0x93f4('0x37')]){_0x458323[_0x93f4('0x34')]=_[_0x93f4('0x38')](_0x458323[_0x93f4('0x34')],{'$or':_[_0x93f4('0x29')](_0x458323[_0x93f4('0x2f')],function(_0x402a1b){var _0x34bb10={};_0x34bb10[_0x402a1b]={'$like':'%'+_0x2cb1d3[_0x93f4('0x2c')]['filter']+'%'};return _0x34bb10;})});}_0x458323=_[_0x93f4('0x38')]({},_0x458323,_0x2cb1d3[_0x93f4('0x3a')]);return _0x340d52[_0x93f4('0x49')](_0x458323);}})[_0x93f4('0x21')](function(_0x22e560){if(_0x22e560){_0x203607=_0x22e560[_0x93f4('0x44')];if(!_0x2cb1d3[_0x93f4('0x2c')][_0x93f4('0x4a')](_0x93f4('0x31'))){_0x458323[_0x93f4('0x1c')]=qs[_0x93f4('0x1c')](_0x2cb1d3[_0x93f4('0x2c')][_0x93f4('0x1c')]);_0x458323[_0x93f4('0x1b')]=qs[_0x93f4('0x1b')](_0x2cb1d3[_0x93f4('0x2c')][_0x93f4('0x1b')]);}return _0x340d52[_0x93f4('0x49')](_0x458323);}})[_0x93f4('0x21')](function(_0x498117){if(_0x498117){return _0x498117?{'count':_0x203607,'rows':_0x498117}:null;}})[_0x93f4('0x21')](respondWithResult(_0xe3ca3d,null))[_0x93f4('0x40')](handleError(_0xe3ca3d,null));};exports[_0x93f4('0x4b')]=function(_0xde0fde,_0x4d761b,_0x3d2ea7){if(_0xde0fde[_0x93f4('0x47')]['id']){delete _0xde0fde[_0x93f4('0x47')]['id'];}return db[_0x93f4('0x3b')][_0x93f4('0x4c')]({'where':{'id':_0xde0fde[_0x93f4('0x42')]['id']}})[_0x93f4('0x21')](handleEntityNotFound(_0x4d761b,null))[_0x93f4('0x21')](function(_0x14242a){if(_0x14242a){_0xde0fde[_0x93f4('0x47')][_0x93f4('0x4d')]=_0x14242a['id'];_0xde0fde[_0x93f4('0x47')][_0x93f4('0x4e')]=integrations[_0x93f4('0x4f')](_0xde0fde[_0x93f4('0x47')][_0x93f4('0x50')],_0xde0fde[_0x93f4('0x47')]['type']);_0xde0fde[_0x93f4('0x47')][_0x93f4('0x51')]=integrations['getDescriptions'](_0xde0fde[_0x93f4('0x47')][_0x93f4('0x50')],_0xde0fde[_0x93f4('0x47')][_0x93f4('0x2a')]);return db['Dynamics365Configuration']['create'](_0xde0fde[_0x93f4('0x47')],{'include':[{'model':db[_0x93f4('0x52')],'as':_0x93f4('0x4e')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4d761b,null))[_0x93f4('0x40')](handleError(_0x4d761b,null));};exports[_0x93f4('0x53')]=function(_0x63272c,_0x4635ef,_0x3124e2){var _0x1573c9=_0x63272c[_0x93f4('0x2c')][_0x93f4('0x54')];var _0x5e8289=_0x1573c9===_0x93f4('0x55')?'Incident':_0x93f4('0x56');var _0x2a02d2='';var _0x227b33='';var _0x233bfb='';var _0x16d908='';var _0x2253c1='';var _0x33954e='';var _0xc56381='';var _0x2cb299='';var _0x223fed=[_0x93f4('0x57'),_0x93f4('0x58'),_0x93f4('0x59'),_0x93f4('0x5a'),'caseorigincode',_0x93f4('0x5b'),'phonenumber',_0x93f4('0x5c'),_0x93f4('0x5d'),_0x93f4('0x5e')];var _0x23857a=[_0x93f4('0x5f'),'accountidyominame','actualserviceunits',_0x93f4('0x60'),_0x93f4('0x61'),_0x93f4('0x62'),'contractdetailidname',_0x93f4('0x63'),_0x93f4('0x64'),'createdbyexternalpartyyominame',_0x93f4('0x65'),_0x93f4('0x66'),'createdon',_0x93f4('0x67'),'createdonbehalfbyyominame',_0x93f4('0x68'),_0x93f4('0x69'),'customeridyominame',_0x93f4('0x6a'),_0x93f4('0x6b'),'entityimage_timestamp',_0x93f4('0x6c'),_0x93f4('0x6d'),'exchangerate',_0x93f4('0x6e'),_0x93f4('0x6f'),_0x93f4('0x70'),'influencescore',_0x93f4('0x71'),_0x93f4('0x72'),_0x93f4('0x73'),'modifiedbyexternalpartyname',_0x93f4('0x74'),_0x93f4('0x75'),_0x93f4('0x76'),'modifiedon','modifiedonbehalfbyname',_0x93f4('0x77'),_0x93f4('0x78'),_0x93f4('0x79'),_0x93f4('0x7a'),_0x93f4('0x7b'),_0x93f4('0x7c'),'owneridname',_0x93f4('0x7d'),'owneridyominame',_0x93f4('0x7e'),_0x93f4('0x7f'),_0x93f4('0x80'),'prioritycodename',_0x93f4('0x81'),_0x93f4('0x82'),_0x93f4('0x83'),_0x93f4('0x84'),_0x93f4('0x85'),_0x93f4('0x86'),_0x93f4('0x87'),_0x93f4('0x88'),_0x93f4('0x89'),_0x93f4('0x8a'),_0x93f4('0x8b'),_0x93f4('0x8c'),'statuscode',_0x93f4('0x8d'),'ticketnumber','timezoneruleversionnumber',_0x93f4('0x8e'),_0x93f4('0x8f'),_0x93f4('0x90'),'versionnumber'];var _0x2da706=_0x223fed[_0x93f4('0x91')](_0x23857a);return db['Dynamics365Account'][_0x93f4('0x4c')]({'where':{'id':_0x63272c[_0x93f4('0x42')]['id']},'attributes':['id',_0x93f4('0x92'),_0x93f4('0x93'),_0x93f4('0x94'),_0x93f4('0x95'),'clientId',_0x93f4('0x96')]})[_0x93f4('0x21')](handleEntityNotFound(_0x4635ef,null))[_0x93f4('0x21')](function(_0x39a676){if(_0x39a676){_0x2cb299=_0x39a676['remoteUri'];var _0x38ef38=_0x2cb299[_0x93f4('0x97')](-0x1);if(_0x38ef38==='/'){_0x2cb299=_0x2cb299[_0x93f4('0x98')](0x0,_0x2cb299[_0x93f4('0x99')](_0x38ef38));}_0xc56381=util['format'](_0x93f4('0x9a'),_0x2cb299);var _0x2cc0bc={'method':_0x93f4('0x9b'),'uri':'https://login.microsoftonline.com/'+_0x39a676['tenantId']+_0x93f4('0x9c'),'form':{'client_id':_0x39a676['clientId'],'resource':_0x2cb299,'username':_0x39a676[_0x93f4('0x92')],'password':_0x39a676[_0x93f4('0x93')],'grant_type':_0x93f4('0x93'),'client_secret':_0x39a676[_0x93f4('0x96')]},'json':!![]};return rp(_0x2cc0bc);}})['then'](function(_0x317306){_0x33954e=_0x317306[_0x93f4('0x9d')];var _0x33e9be={'method':_0x93f4('0x9e'),'uri':encodeURI(_0xc56381+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5e8289+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x33954e,'If-None-Match':null,'OData-Version':_0x93f4('0x9f')},'json':!![]};return rp(_0x33e9be);})['then'](function(_0x5dec58){var _0x71055e=_0x5dec58[_0x93f4('0xa0')][0x0];var _0x62b4c5=_0x71055e[_0x93f4('0xa1')];var _0xa80270={'method':_0x93f4('0x9e'),'uri':_0xc56381+_0x93f4('0xa2')+_0x62b4c5+_0x93f4('0xa3'),'headers':{'Authorization':'Bearer\x20'+_0x33954e,'If-None-Match':null,'OData-Version':_0x93f4('0x9f')},'json':!![]};return rp(_0xa80270);})[_0x93f4('0x21')](function(_0x2858ef){_0x2a02d2=_0x2858ef;_0x227b33=_0x2a02d2[_0x93f4('0xa4')];_0x227b33=_[_0x93f4('0xa5')](_0x227b33,function(_0x4d0bf9){return!_0x2da706[_0x93f4('0xa6')](_0x4d0bf9[_0x93f4('0xa7')]);});var _0x4bc456=[];var _0x4c730d=[];_0x227b33[_0x93f4('0xa8')](function(_0xb2744d){if(_0xb2744d[_0x93f4('0xa9')]){var _0x3e5200=_0xb2744d[_0x93f4('0xa9')][_0x93f4('0x98')](_0xb2744d[_0x93f4('0xa9')][_0x93f4('0x99')]('.')+0x1);if(_0x3e5200===_0x93f4('0xaa')){_0x4bc456[_0x93f4('0xab')](getSelectList(_0xc56381,_0x1573c9,_0x4c730d,_0x2a02d2['MetadataId'],_0xb2744d[_0x93f4('0xa1')],_0x33954e));}}});return Promise[_0x93f4('0xac')](_0x4bc456);})[_0x93f4('0x21')](function(_0x38ec78){_0x233bfb=_0x38ec78[0x0];var _0x5664d8=[];var _0x485af5=[];_0x227b33[_0x93f4('0xa8')](function(_0x4dbb17){if(!_[_0x93f4('0xad')](_0x4dbb17[_0x93f4('0xa9')])){var _0x91634d=_0x4dbb17[_0x93f4('0xa9')][_0x93f4('0x98')](_0x4dbb17[_0x93f4('0xa9')][_0x93f4('0x99')]('.')+0x1);if(_0x91634d==='BooleanAttributeMetadata'){_0x5664d8[_0x93f4('0xab')](getBooleanList(_0xc56381,_0x1573c9,_0x485af5,_0x2a02d2[_0x93f4('0xa1')],_0x4dbb17[_0x93f4('0xa1')],_0x33954e));}}});return Promise[_0x93f4('0xac')](_0x5664d8);})[_0x93f4('0x21')](function(_0x82ebeb){_0x16d908=_0x82ebeb[0x0];var _0x5e98c5=[];var _0x2cacda=[];_0x227b33[_0x93f4('0xa8')](function(_0x212cc6){if(_0x212cc6[_0x93f4('0xa9')]){var _0x4664f0=_0x212cc6[_0x93f4('0xa9')][_0x93f4('0x98')](_0x212cc6['@odata.type'][_0x93f4('0x99')]('.')+0x1);if(_0x4664f0===_0x93f4('0xae')||_0x4664f0===_0x93f4('0xaf')||_0x4664f0===_0x93f4('0xb0')||_0x4664f0===_0x93f4('0xb1')||_0x4664f0===_0x93f4('0xb2')||_0x4664f0===_0x93f4('0xb3')||_0x4664f0==='StatusAttributeMetadata'||_0x4664f0===_0x93f4('0xb4')||_0x4664f0==='StateAttributeMetadata'||_0x4664f0===_0x93f4('0xb5')){_0x5e98c5['push'](getInputList(_0xc56381,_0x1573c9,_0x4664f0,_0x2cacda,_0x2a02d2[_0x93f4('0xa1')],_0x212cc6['MetadataId'],_0x33954e));}}});return Promise['all'](_0x5e98c5);})[_0x93f4('0x21')](function(_0x2ee23d){_0x2253c1=_0x2ee23d[0x0];var _0x506824=_0x233bfb[_0x93f4('0x91')](_0x16d908)['concat'](_0x2253c1);var _0x53e3cd={'count':_0x506824[_0x93f4('0x44')],'rows':_0x506824};return _0x53e3cd;})[_0x93f4('0x21')](respondWithResult(_0x4635ef,null))['catch'](function(_0x26f4b9){var _0x5da8de=_0x63272c[_0x93f4('0x2c')][_0x93f4('0xb6')]?0x1f4:_0x26f4b9['statusCode']||0x1f4;logger[_0x93f4('0x24')](_0x26f4b9[_0x93f4('0x25')]);delete _0x26f4b9['name'];if(_0x5da8de===0x191){_0x5da8de=0x190;}_0x4635ef[_0x93f4('0x22')](_0x5da8de)[_0x93f4('0x27')](_0x63272c[_0x93f4('0x2c')][_0x93f4('0xb6')]?{'message':_0x93f4('0xb7'),'statusCode':_0x26f4b9[_0x93f4('0xb8')]}:_0x26f4b9);});};function getSelectList(_0x583377,_0x215365,_0x53f765,_0xc9e738,_0x11cc5e,_0x440f4f){var _0x1763cc={'method':'GET','uri':_0x583377+_0x93f4('0xa2')+_0xc9e738+_0x93f4('0xb9')+_0x11cc5e+_0x93f4('0xba')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x93f4('0xbb')+_0x440f4f,'If-None-Match':null,'OData-Version':_0x93f4('0x9f')},'json':!![]};return rp(_0x1763cc)[_0x93f4('0x21')](function(_0x36d205){var _0x42cc59=[];var _0x25d26e=_0x36d205[_0x93f4('0xbc')][_0x93f4('0xbd')];_0x25d26e[_0x93f4('0xa8')](function(_0x4321bf){_0x42cc59['push']({'name':_0x4321bf['Label'][_0x93f4('0xbe')]['Label'],'value':String(_0x4321bf['Value'])});});var _0x2e60c6={'id':_0x215365+'_'+_0x36d205[_0x93f4('0xa7')],'name':_0x36d205['DisplayName']['UserLocalizedLabel'][_0x93f4('0xbf')],'custom':![],'options':_0x42cc59};_0x53f765[_0x93f4('0xab')](_0x2e60c6);return _0x53f765;});}function getBooleanList(_0x2e1605,_0x5a1331,_0x4f715e,_0x4e4510,_0x166f6d,_0x156c54){var _0x4420cf={'method':_0x93f4('0x9e'),'uri':_0x2e1605+_0x93f4('0xa2')+_0x4e4510+_0x93f4('0xb9')+_0x166f6d+_0x93f4('0xc0'),'headers':{'Authorization':'Bearer\x20'+_0x156c54,'If-None-Match':null,'OData-Version':_0x93f4('0x9f')},'json':!![]};return rp(_0x4420cf)[_0x93f4('0x21')](function(_0x394f89){var _0x35071a=[];_0x35071a[_0x93f4('0xab')]({'name':_0x394f89[_0x93f4('0xbc')][_0x93f4('0xc1')][_0x93f4('0xbf')][_0x93f4('0xbe')][_0x93f4('0xbf')],'value':_0x93f4('0xc2')},{'name':_0x394f89[_0x93f4('0xbc')][_0x93f4('0xc3')][_0x93f4('0xbf')][_0x93f4('0xbe')][_0x93f4('0xbf')],'value':_0x93f4('0xc4')});var _0x1e722d={'id':_0x5a1331+'_'+_0x394f89[_0x93f4('0xa7')],'name':_0x394f89[_0x93f4('0xc5')][_0x93f4('0xbe')][_0x93f4('0xbf')],'custom':![],'options':_0x35071a};_0x4f715e[_0x93f4('0xab')](_0x1e722d);return _0x4f715e;});}function getInputList(_0x4303e7,_0x3da340,_0x5eb4e4,_0x3f38e2,_0x2a22c5,_0x1df309,_0x9a9e92){var _0x4646db={'method':_0x93f4('0x9e'),'uri':_0x4303e7+_0x93f4('0xa2')+_0x2a22c5+')/Attributes('+_0x1df309+_0x93f4('0xc6')+_0x5eb4e4+_0x93f4('0xc7'),'headers':{'Authorization':_0x93f4('0xbb')+_0x9a9e92,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4646db)['then'](function(_0x2323cb){var _0x5c339a={'id':_0x3da340+'_'+_0x2323cb[_0x93f4('0xa7')],'name':_0x2323cb[_0x93f4('0xc5')][_0x93f4('0xbe')]?_0x2323cb[_0x93f4('0xc5')]['UserLocalizedLabel']['Label']:_0x2323cb['LogicalName'],'custom':![],'options':[]};_0x3f38e2[_0x93f4('0xab')](_0x5c339a);return _0x3f38e2;});} \ No newline at end of file +var _0x28e3=['subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','slice','substring','lastIndexOf','format','POST','/oauth2/token','clientSecret','GET','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','forEach','BooleanAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','error','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','fields','attributes','length','order','sort','filters','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','getConfigurations','findOne','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','ticketType','Incident','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode'];(function(_0x3c6835,_0x952d5c){var _0x1adeb9=function(_0xfefab3){while(--_0xfefab3){_0x3c6835['push'](_0x3c6835['shift']());}};_0x1adeb9(++_0x952d5c);}(_0x28e3,0x106));var _0x328e=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x28e3[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x328e('0x0'));var rimraf=require(_0x328e('0x1'));var zipdir=require(_0x328e('0x2'));var jsonpatch=require(_0x328e('0x3'));var rp=require('request-promise');var moment=require(_0x328e('0x4'));var BPromise=require(_0x328e('0x5'));var Mustache=require(_0x328e('0x6'));var util=require(_0x328e('0x7'));var path=require(_0x328e('0x8'));var sox=require(_0x328e('0x9'));var csv=require(_0x328e('0xa'));var ejs=require(_0x328e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x328e('0xc'));var jsforce=require(_0x328e('0xd'));var deskjs=require(_0x328e('0xe'));var toCsv=require(_0x328e('0xa'));var querystring=require(_0x328e('0xf'));var Papa=require('papaparse');var Redis=require(_0x328e('0x10'));var authService=require(_0x328e('0x11'));var qs=require(_0x328e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x328e('0x13'));var utils=require(_0x328e('0x14'));var config=require(_0x328e('0x15'));var licenseUtil=require(_0x328e('0x16'));var db=require(_0x328e('0x17'))['db'];var integrations=require(_0x328e('0x18'));function respondWithStatusCode(_0x4699ec,_0x39338e){_0x39338e=_0x39338e||0xcc;return function(_0x1d3e4a){if(_0x1d3e4a){return _0x4699ec[_0x328e('0x19')](_0x39338e);}return _0x4699ec[_0x328e('0x1a')](_0x39338e)['end']();};}function respondWithResult(_0x89600b,_0x1cddc3){_0x1cddc3=_0x1cddc3||0xc8;return function(_0x1552ce){if(_0x1552ce){return _0x89600b[_0x328e('0x1a')](_0x1cddc3)[_0x328e('0x1b')](_0x1552ce);}};}function respondWithFilteredResult(_0x397b16,_0x2a8096){return function(_0x3c5b37){if(_0x3c5b37){var _0x20901e=typeof _0x2a8096['offset']===_0x328e('0x1c')&&typeof _0x2a8096[_0x328e('0x1d')]===_0x328e('0x1c');var _0x1adadc=_0x3c5b37[_0x328e('0x1e')];var _0x32c7c8=_0x20901e?0x0:_0x2a8096[_0x328e('0x1f')];var _0x47b194=_0x20901e?_0x3c5b37[_0x328e('0x1e')]:_0x2a8096[_0x328e('0x1f')]+_0x2a8096[_0x328e('0x1d')];var _0x39e3c1;if(_0x47b194>=_0x1adadc){_0x47b194=_0x1adadc;_0x39e3c1=0xc8;}else{_0x39e3c1=0xce;}_0x397b16[_0x328e('0x1a')](_0x39e3c1);return _0x397b16['set'](_0x328e('0x20'),_0x32c7c8+'-'+_0x47b194+'/'+_0x1adadc)[_0x328e('0x1b')](_0x3c5b37);}return null;};}function patchUpdates(_0x3d876b){return function(_0x5dcfaa){try{jsonpatch[_0x328e('0x21')](_0x5dcfaa,_0x3d876b,!![]);}catch(_0x3bafb1){return BPromise[_0x328e('0x22')](_0x3bafb1);}return _0x5dcfaa[_0x328e('0x23')]();};}function saveUpdates(_0x233bd3,_0x1c43f8){return function(_0x725a1){if(_0x725a1){return _0x725a1[_0x328e('0x24')](_0x233bd3)[_0x328e('0x25')](function(_0x5cbc7f){return _0x5cbc7f;});}return null;};}function removeEntity(_0x4e1d4c,_0x139ef3){return function(_0x388bc0){if(_0x388bc0){return _0x388bc0[_0x328e('0x26')]()[_0x328e('0x25')](function(){_0x4e1d4c[_0x328e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23fda2,_0x48a854){return function(_0x1cc449){if(!_0x1cc449){_0x23fda2[_0x328e('0x19')](0x194);}return _0x1cc449;};}function handleError(_0x28da22,_0x2fab5a){_0x2fab5a=_0x2fab5a||0x1f4;return function(_0x108f0d){logger['error'](_0x108f0d['stack']);if(_0x108f0d[_0x328e('0x27')]){delete _0x108f0d['name'];}_0x28da22['status'](_0x2fab5a)[_0x328e('0x28')](_0x108f0d);};}exports[_0x328e('0x29')]=function(_0x5873d1,_0x232ec7){var _0x1fdc4d={},_0x4bdadc={},_0x26a204={'count':0x0,'rows':[]};var _0x2448bc=_[_0x328e('0x2a')](db[_0x328e('0x2b')][_0x328e('0x2c')],function(_0x490fa7){return{'name':_0x490fa7[_0x328e('0x2d')],'type':_0x490fa7[_0x328e('0x2e')][_0x328e('0x2f')]};});_0x4bdadc[_0x328e('0x30')]=_[_0x328e('0x2a')](_0x2448bc,_0x328e('0x27'));_0x4bdadc[_0x328e('0x31')]=_[_0x328e('0x32')](_0x5873d1[_0x328e('0x31')]);_0x4bdadc['filters']=_['intersection'](_0x4bdadc[_0x328e('0x30')],_0x4bdadc[_0x328e('0x31')]);_0x1fdc4d['attributes']=_['intersection'](_0x4bdadc['model'],qs[_0x328e('0x33')](_0x5873d1[_0x328e('0x31')][_0x328e('0x33')]));_0x1fdc4d[_0x328e('0x34')]=_0x1fdc4d[_0x328e('0x34')][_0x328e('0x35')]?_0x1fdc4d[_0x328e('0x34')]:_0x4bdadc['model'];if(!_0x5873d1[_0x328e('0x31')]['hasOwnProperty']('nolimit')){_0x1fdc4d[_0x328e('0x1d')]=qs['limit'](_0x5873d1[_0x328e('0x31')][_0x328e('0x1d')]);_0x1fdc4d[_0x328e('0x1f')]=qs['offset'](_0x5873d1[_0x328e('0x31')]['offset']);}_0x1fdc4d[_0x328e('0x36')]=qs[_0x328e('0x37')](_0x5873d1[_0x328e('0x31')][_0x328e('0x37')]);_0x1fdc4d['where']=qs[_0x328e('0x38')](_['pick'](_0x5873d1[_0x328e('0x31')],_0x4bdadc['filters']),_0x2448bc);if(_0x5873d1['query'][_0x328e('0x39')]){_0x1fdc4d['where']=_[_0x328e('0x3a')](_0x1fdc4d[_0x328e('0x3b')],{'$or':_[_0x328e('0x2a')](_0x2448bc,function(_0x467a0b){if(_0x467a0b['type']!==_0x328e('0x3c')){var _0x387941={};_0x387941[_0x467a0b[_0x328e('0x27')]]={'$like':'%'+_0x5873d1[_0x328e('0x31')][_0x328e('0x39')]+'%'};return _0x387941;}})});}_0x1fdc4d=_['merge']({},_0x1fdc4d,_0x5873d1[_0x328e('0x3d')]);var _0x2be20c={'where':_0x1fdc4d[_0x328e('0x3b')]};return db['Dynamics365Account']['count'](_0x2be20c)['then'](function(_0x2e0d9d){_0x26a204['count']=_0x2e0d9d;if(_0x5873d1[_0x328e('0x31')][_0x328e('0x3e')]){_0x1fdc4d['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0x328e('0x3f')](_0x1fdc4d);})[_0x328e('0x25')](function(_0x32fea8){_0x26a204[_0x328e('0x40')]=_0x32fea8;return _0x26a204;})[_0x328e('0x25')](respondWithFilteredResult(_0x232ec7,_0x1fdc4d))[_0x328e('0x41')](handleError(_0x232ec7,null));};exports[_0x328e('0x42')]=function(_0x1c94e9,_0x2a823e){var _0xdf4229={'raw':![],'where':{'id':_0x1c94e9[_0x328e('0x43')]['id']}},_0x27049f={};_0x27049f['model']=_[_0x328e('0x32')](db['Dynamics365Account']['rawAttributes']);_0x27049f[_0x328e('0x31')]=_[_0x328e('0x32')](_0x1c94e9[_0x328e('0x31')]);_0x27049f['filters']=_[_0x328e('0x44')](_0x27049f[_0x328e('0x30')],_0x27049f[_0x328e('0x31')]);_0xdf4229[_0x328e('0x34')]=_[_0x328e('0x44')](_0x27049f[_0x328e('0x30')],qs[_0x328e('0x33')](_0x1c94e9['query']['fields']));_0xdf4229[_0x328e('0x34')]=_0xdf4229[_0x328e('0x34')]['length']?_0xdf4229[_0x328e('0x34')]:_0x27049f[_0x328e('0x30')];if(_0x1c94e9[_0x328e('0x31')]['includeAll']){_0xdf4229[_0x328e('0x45')]=[{'all':!![]}];}_0xdf4229=_[_0x328e('0x3a')]({},_0xdf4229,_0x1c94e9[_0x328e('0x3d')]);return db[_0x328e('0x2b')][_0x328e('0x46')](_0xdf4229)[_0x328e('0x25')](handleEntityNotFound(_0x2a823e,null))[_0x328e('0x25')](respondWithResult(_0x2a823e,null))['catch'](handleError(_0x2a823e,null));};exports[_0x328e('0x47')]=function(_0x13ac38,_0x44470b){return db['Dynamics365Account'][_0x328e('0x47')](_0x13ac38[_0x328e('0x48')],{})[_0x328e('0x25')](respondWithResult(_0x44470b,0xc9))[_0x328e('0x41')](handleError(_0x44470b,null));};exports[_0x328e('0x24')]=function(_0x294945,_0x2b83bd){if(_0x294945['body']['id']){delete _0x294945[_0x328e('0x48')]['id'];}return db[_0x328e('0x2b')][_0x328e('0x46')]({'where':{'id':_0x294945[_0x328e('0x43')]['id']}})[_0x328e('0x25')](handleEntityNotFound(_0x2b83bd,null))[_0x328e('0x25')](saveUpdates(_0x294945[_0x328e('0x48')],null))['then'](respondWithResult(_0x2b83bd,null))['catch'](handleError(_0x2b83bd,null));};exports['destroy']=function(_0xcad004,_0x25b8a6){return db[_0x328e('0x2b')][_0x328e('0x46')]({'where':{'id':_0xcad004['params']['id']}})[_0x328e('0x25')](handleEntityNotFound(_0x25b8a6,null))['then'](removeEntity(_0x25b8a6,null))[_0x328e('0x41')](handleError(_0x25b8a6,null));};exports[_0x328e('0x49')]=function(_0x287ea4,_0x30064b,_0x2d07ae){var _0x310098={};var _0x5c5408={};var _0x1bdc0c;var _0x3b78c3;return db[_0x328e('0x2b')][_0x328e('0x4a')]({'where':{'id':_0x287ea4['params']['id']}})['then'](handleEntityNotFound(_0x30064b,null))[_0x328e('0x25')](function(_0x167e7e){if(_0x167e7e){_0x1bdc0c=_0x167e7e;_0x5c5408[_0x328e('0x30')]=_[_0x328e('0x32')](db['Dynamics365Configuration']['rawAttributes']);_0x5c5408['query']=_[_0x328e('0x32')](_0x287ea4[_0x328e('0x31')]);_0x5c5408[_0x328e('0x38')]=_[_0x328e('0x44')](_0x5c5408[_0x328e('0x30')],_0x5c5408[_0x328e('0x31')]);_0x310098[_0x328e('0x34')]=_[_0x328e('0x44')](_0x5c5408[_0x328e('0x30')],qs[_0x328e('0x33')](_0x287ea4[_0x328e('0x31')][_0x328e('0x33')]));_0x310098[_0x328e('0x34')]=_0x310098[_0x328e('0x34')]['length']?_0x310098['attributes']:_0x5c5408['model'];_0x310098[_0x328e('0x36')]=qs[_0x328e('0x37')](_0x287ea4[_0x328e('0x31')]['sort']);_0x310098[_0x328e('0x3b')]=qs[_0x328e('0x38')](_[_0x328e('0x4b')](_0x287ea4[_0x328e('0x31')],_0x5c5408[_0x328e('0x38')]));if(_0x287ea4[_0x328e('0x31')][_0x328e('0x39')]){_0x310098[_0x328e('0x3b')]=_[_0x328e('0x3a')](_0x310098[_0x328e('0x3b')],{'$or':_[_0x328e('0x2a')](_0x310098[_0x328e('0x34')],function(_0x48312a){var _0x518b28={};_0x518b28[_0x48312a]={'$like':'%'+_0x287ea4['query'][_0x328e('0x39')]+'%'};return _0x518b28;})});}_0x310098=_['merge']({},_0x310098,_0x287ea4[_0x328e('0x3d')]);return _0x1bdc0c[_0x328e('0x49')](_0x310098);}})[_0x328e('0x25')](function(_0x334807){if(_0x334807){_0x3b78c3=_0x334807[_0x328e('0x35')];if(!_0x287ea4[_0x328e('0x31')]['hasOwnProperty'](_0x328e('0x4c'))){_0x310098[_0x328e('0x1d')]=qs[_0x328e('0x1d')](_0x287ea4['query'][_0x328e('0x1d')]);_0x310098[_0x328e('0x1f')]=qs[_0x328e('0x1f')](_0x287ea4['query'][_0x328e('0x1f')]);}return _0x1bdc0c[_0x328e('0x49')](_0x310098);}})[_0x328e('0x25')](function(_0x2bc0c8){if(_0x2bc0c8){return _0x2bc0c8?{'count':_0x3b78c3,'rows':_0x2bc0c8}:null;}})[_0x328e('0x25')](respondWithResult(_0x30064b,null))['catch'](handleError(_0x30064b,null));};exports[_0x328e('0x4d')]=function(_0x305f66,_0x128c9f,_0xda6eaa){if(_0x305f66[_0x328e('0x48')]['id']){delete _0x305f66[_0x328e('0x48')]['id'];}return db[_0x328e('0x2b')]['findOne']({'where':{'id':_0x305f66[_0x328e('0x43')]['id']}})['then'](handleEntityNotFound(_0x128c9f,null))['then'](function(_0x191bf9){if(_0x191bf9){_0x305f66[_0x328e('0x48')][_0x328e('0x4e')]=_0x191bf9['id'];_0x305f66[_0x328e('0x48')][_0x328e('0x4f')]=integrations[_0x328e('0x50')](_0x305f66['body'][_0x328e('0x51')],_0x305f66[_0x328e('0x48')]['type']);_0x305f66[_0x328e('0x48')][_0x328e('0x52')]=integrations['getDescriptions'](_0x305f66[_0x328e('0x48')][_0x328e('0x51')],_0x305f66[_0x328e('0x48')][_0x328e('0x2e')]);return db['Dynamics365Configuration'][_0x328e('0x47')](_0x305f66[_0x328e('0x48')],{'include':[{'model':db[_0x328e('0x53')],'as':_0x328e('0x4f')},{'model':db[_0x328e('0x53')],'as':_0x328e('0x52')}]});}return null;})[_0x328e('0x25')](respondWithResult(_0x128c9f,null))[_0x328e('0x41')](handleError(_0x128c9f,null));};exports['getFields']=function(_0x22e4ce,_0x5e6999,_0x5b6edb){var _0x1e4744=_0x22e4ce[_0x328e('0x31')][_0x328e('0x54')];var _0x31ceb3=_0x1e4744==='incident'?_0x328e('0x55'):'PhoneCall';var _0x4b9417='';var _0x42e047='';var _0xcb0d44='';var _0x3df494='';var _0x3cf16f='';var _0x1dd3a7='';var _0x4c4d31='';var _0x5553f5='';var _0x4d5d15=[_0x328e('0x56'),'description',_0x328e('0x57'),_0x328e('0x58'),_0x328e('0x59'),_0x328e('0x5a'),_0x328e('0x5b'),_0x328e('0x5c'),_0x328e('0x5d'),'phonecall_activity_parties'];var _0x3085d4=[_0x328e('0x5e'),_0x328e('0x5f'),_0x328e('0x60'),'billedserviceunits',_0x328e('0x61'),_0x328e('0x62'),_0x328e('0x63'),'contractidname',_0x328e('0x64'),_0x328e('0x65'),'createdbyname',_0x328e('0x66'),_0x328e('0x67'),_0x328e('0x68'),_0x328e('0x69'),_0x328e('0x6a'),_0x328e('0x6b'),_0x328e('0x6c'),_0x328e('0x6d'),'entitlementidname',_0x328e('0x6e'),_0x328e('0x6f'),_0x328e('0x70'),'exchangerate',_0x328e('0x71'),_0x328e('0x72'),_0x328e('0x73'),_0x328e('0x74'),_0x328e('0x75'),_0x328e('0x76'),_0x328e('0x77'),_0x328e('0x78'),'modifiedbyexternalpartyyominame',_0x328e('0x79'),_0x328e('0x7a'),_0x328e('0x7b'),_0x328e('0x7c'),'modifiedonbehalfbyyominame',_0x328e('0x7d'),_0x328e('0x7e'),_0x328e('0x7f'),'onholdtime',_0x328e('0x80'),_0x328e('0x81'),_0x328e('0x82'),'owneridyominame',_0x328e('0x83'),_0x328e('0x84'),_0x328e('0x85'),_0x328e('0x86'),_0x328e('0x87'),'productserialnumber','resolveby','resolvebykpiidname','responseby',_0x328e('0x88'),_0x328e('0x89'),_0x328e('0x8a'),_0x328e('0x8b'),_0x328e('0x8c'),_0x328e('0x8d'),_0x328e('0x8e'),_0x328e('0x8f'),_0x328e('0x90'),'ticketnumber',_0x328e('0x91'),_0x328e('0x92'),'traversedpath',_0x328e('0x93'),_0x328e('0x94')];var _0x15895f=_0x4d5d15[_0x328e('0x95')](_0x3085d4);return db[_0x328e('0x2b')][_0x328e('0x4a')]({'where':{'id':_0x22e4ce[_0x328e('0x43')]['id']},'attributes':['id',_0x328e('0x96'),_0x328e('0x97'),'remoteUri',_0x328e('0x98'),_0x328e('0x99'),'clientSecret']})[_0x328e('0x25')](handleEntityNotFound(_0x5e6999,null))['then'](function(_0x5d650e){if(_0x5d650e){_0x5553f5=_0x5d650e['remoteUri'];var _0x3ab8ca=_0x5553f5[_0x328e('0x9a')](-0x1);if(_0x3ab8ca==='/'){_0x5553f5=_0x5553f5[_0x328e('0x9b')](0x0,_0x5553f5[_0x328e('0x9c')](_0x3ab8ca));}_0x4c4d31=util[_0x328e('0x9d')]('%s/api/data/v9.0/',_0x5553f5);var _0x69191b={'method':_0x328e('0x9e'),'uri':'https://login.microsoftonline.com/'+_0x5d650e[_0x328e('0x98')]+_0x328e('0x9f'),'form':{'client_id':_0x5d650e[_0x328e('0x99')],'resource':_0x5553f5,'username':_0x5d650e[_0x328e('0x96')],'password':_0x5d650e[_0x328e('0x97')],'grant_type':'password','client_secret':_0x5d650e[_0x328e('0xa0')]},'json':!![]};return rp(_0x69191b);}})[_0x328e('0x25')](function(_0x3c5a6e){_0x1dd3a7=_0x3c5a6e['access_token'];var _0x387366={'method':_0x328e('0xa1'),'uri':encodeURI(_0x4c4d31+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x31ceb3+'\x27'),'headers':{'Authorization':_0x328e('0xa2')+_0x1dd3a7,'If-None-Match':null,'OData-Version':_0x328e('0xa3')},'json':!![]};return rp(_0x387366);})['then'](function(_0x50c33f){var _0x397643=_0x50c33f[_0x328e('0xa4')][0x0];var _0x1be85b=_0x397643['MetadataId'];var _0x48b095={'method':'GET','uri':_0x4c4d31+_0x328e('0xa5')+_0x1be85b+_0x328e('0xa6'),'headers':{'Authorization':_0x328e('0xa2')+_0x1dd3a7,'If-None-Match':null,'OData-Version':_0x328e('0xa3')},'json':!![]};return rp(_0x48b095);})[_0x328e('0x25')](function(_0x5103b1){_0x4b9417=_0x5103b1;_0x42e047=_0x4b9417[_0x328e('0xa7')];_0x42e047=_[_0x328e('0xa8')](_0x42e047,function(_0x21bfe1){return!_0x15895f[_0x328e('0xa9')](_0x21bfe1[_0x328e('0xaa')]);});var _0x4f72b0=[];var _0x48333e=[];_0x42e047['forEach'](function(_0x3688d1){if(_0x3688d1[_0x328e('0xab')]){var _0x18afde=_0x3688d1[_0x328e('0xab')][_0x328e('0x9b')](_0x3688d1[_0x328e('0xab')][_0x328e('0x9c')]('.')+0x1);if(_0x18afde===_0x328e('0xac')){_0x4f72b0[_0x328e('0xad')](getSelectList(_0x4c4d31,_0x1e4744,_0x48333e,_0x4b9417[_0x328e('0xae')],_0x3688d1[_0x328e('0xae')],_0x1dd3a7));}}});return Promise[_0x328e('0xaf')](_0x4f72b0);})[_0x328e('0x25')](function(_0x1225c8){_0xcb0d44=_0x1225c8[0x0];var _0x4bec11=[];var _0x5267a4=[];_0x42e047[_0x328e('0xb0')](function(_0x5b35a4){if(!_['isNil'](_0x5b35a4[_0x328e('0xab')])){var _0x37f391=_0x5b35a4[_0x328e('0xab')]['substring'](_0x5b35a4['@odata.type'][_0x328e('0x9c')]('.')+0x1);if(_0x37f391===_0x328e('0xb1')){_0x4bec11[_0x328e('0xad')](getBooleanList(_0x4c4d31,_0x1e4744,_0x5267a4,_0x4b9417['MetadataId'],_0x5b35a4['MetadataId'],_0x1dd3a7));}}});return Promise['all'](_0x4bec11);})['then'](function(_0x19f7d3){_0x3df494=_0x19f7d3[0x0];var _0x1fd2c1=[];var _0x1c17ea=[];_0x42e047[_0x328e('0xb0')](function(_0x15a100){if(_0x15a100[_0x328e('0xab')]){var _0x9bb78d=_0x15a100[_0x328e('0xab')][_0x328e('0x9b')](_0x15a100[_0x328e('0xab')][_0x328e('0x9c')]('.')+0x1);if(_0x9bb78d==='StringAttributeMetadata'||_0x9bb78d==='DoubleAttributeMetadata'||_0x9bb78d===_0x328e('0xb2')||_0x9bb78d===_0x328e('0xb3')||_0x9bb78d===_0x328e('0xb4')||_0x9bb78d===_0x328e('0xb5')||_0x9bb78d===_0x328e('0xb6')||_0x9bb78d===_0x328e('0xb7')||_0x9bb78d===_0x328e('0xb8')||_0x9bb78d===_0x328e('0xb9')){_0x1fd2c1['push'](getInputList(_0x4c4d31,_0x1e4744,_0x9bb78d,_0x1c17ea,_0x4b9417[_0x328e('0xae')],_0x15a100[_0x328e('0xae')],_0x1dd3a7));}}});return Promise[_0x328e('0xaf')](_0x1fd2c1);})[_0x328e('0x25')](function(_0x26fc84){_0x3cf16f=_0x26fc84[0x0];var _0x189567=_0xcb0d44[_0x328e('0x95')](_0x3df494)[_0x328e('0x95')](_0x3cf16f);var _0x3a9cc1={'count':_0x189567[_0x328e('0x35')],'rows':_0x189567};return _0x3a9cc1;})['then'](respondWithResult(_0x5e6999,null))['catch'](function(_0x5812e5){var _0x39e43d=_0x22e4ce[_0x328e('0x31')]['test']?0x1f4:_0x5812e5[_0x328e('0xba')]||0x1f4;logger[_0x328e('0xbb')](_0x5812e5[_0x328e('0xbc')]);delete _0x5812e5[_0x328e('0x27')];if(_0x39e43d===0x191){_0x39e43d=0x190;}_0x5e6999[_0x328e('0x1a')](_0x39e43d)[_0x328e('0x28')](_0x22e4ce[_0x328e('0x31')]['test']?{'message':_0x328e('0xbd'),'statusCode':_0x5812e5[_0x328e('0xba')]}:_0x5812e5);});};function getSelectList(_0x234276,_0x305cee,_0x10df7f,_0x3125b2,_0x5ad3ea,_0x26e5f0){var _0xaba678={'method':_0x328e('0xa1'),'uri':_0x234276+_0x328e('0xa5')+_0x3125b2+_0x328e('0xbe')+_0x5ad3ea+_0x328e('0xbf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x328e('0xa2')+_0x26e5f0,'If-None-Match':null,'OData-Version':_0x328e('0xa3')},'json':!![]};return rp(_0xaba678)[_0x328e('0x25')](function(_0x2f839d){var _0x5c4e82=[];var _0x3f2614=_0x2f839d['OptionSet'][_0x328e('0xc0')];_0x3f2614[_0x328e('0xb0')](function(_0x279a86){_0x5c4e82[_0x328e('0xad')]({'name':_0x279a86[_0x328e('0xc1')][_0x328e('0xc2')]['Label'],'value':String(_0x279a86['Value'])});});var _0x255f75={'id':_0x305cee+'_'+_0x2f839d['LogicalName'],'name':_0x2f839d[_0x328e('0xc3')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x5c4e82};_0x10df7f['push'](_0x255f75);return _0x10df7f;});}function getBooleanList(_0x578050,_0x278cb2,_0x2a2b13,_0x27086c,_0xc33855,_0x260712){var _0x172b4b={'method':_0x328e('0xa1'),'uri':_0x578050+_0x328e('0xa5')+_0x27086c+_0x328e('0xbe')+_0xc33855+_0x328e('0xc4'),'headers':{'Authorization':_0x328e('0xa2')+_0x260712,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x172b4b)[_0x328e('0x25')](function(_0x5206db){var _0x2b9993=[];_0x2b9993['push']({'name':_0x5206db[_0x328e('0xc5')]['TrueOption'][_0x328e('0xc1')][_0x328e('0xc2')][_0x328e('0xc1')],'value':_0x328e('0xc6')},{'name':_0x5206db[_0x328e('0xc5')][_0x328e('0xc7')]['Label'][_0x328e('0xc2')]['Label'],'value':_0x328e('0xc8')});var _0x50a937={'id':_0x278cb2+'_'+_0x5206db[_0x328e('0xaa')],'name':_0x5206db[_0x328e('0xc3')][_0x328e('0xc2')][_0x328e('0xc1')],'custom':![],'options':_0x2b9993};_0x2a2b13['push'](_0x50a937);return _0x2a2b13;});}function getInputList(_0x1e5bc2,_0x3942cb,_0x11918f,_0x29568e,_0x5be9d8,_0x3d8a80,_0xa384ca){var _0x5366c6={'method':_0x328e('0xa1'),'uri':_0x1e5bc2+_0x328e('0xa5')+_0x5be9d8+_0x328e('0xbe')+_0x3d8a80+_0x328e('0xc9')+_0x11918f+_0x328e('0xca'),'headers':{'Authorization':'Bearer\x20'+_0xa384ca,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5366c6)[_0x328e('0x25')](function(_0x373266){var _0x46c072={'id':_0x3942cb+'_'+_0x373266[_0x328e('0xaa')],'name':_0x373266['DisplayName'][_0x328e('0xc2')]?_0x373266['DisplayName'][_0x328e('0xc2')][_0x328e('0xc1')]:_0x373266[_0x328e('0xaa')],'custom':![],'options':[]};_0x29568e[_0x328e('0xad')](_0x46c072);return _0x29568e;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 3a70791..52a8133 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x38ae1b,_0x53bd1e){var _0x55b293=function(_0x3b97d8){while(--_0x3b97d8){_0x38ae1b['push'](_0x38ae1b['shift']());}};_0x55b293(++_0x53bd1e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'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'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x41ea39,_0x46e8a2){var _0x5d3dd2=function(_0xa99c48){while(--_0xa99c48){_0x41ea39['push'](_0x41ea39['shift']());}};_0x5d3dd2(++_0x46e8a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 0050cec..cec0f32 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 _0x5047=['raw','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetDynamics365Account','findAll','options','where','attributes','limit','include','map','model','then','catch','ShowDynamics365Account','Dynamics365Account','find'];(function(_0x1ccecd,_0x4f4f2a){var _0x19e66e=function(_0x3727e2){while(--_0x3727e2){_0x1ccecd['push'](_0x1ccecd['shift']());}};_0x19e66e(++_0x4f4f2a);}(_0x5047,0xda));var _0x7504=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0x5047[_0x1d1963];return _0x3f58bb;};'use strict';var _=require(_0x7504('0x0'));var util=require('util');var moment=require(_0x7504('0x1'));var BPromise=require(_0x7504('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7504('0x3'));var db=require(_0x7504('0x4'))['db'];var utils=require(_0x7504('0x5'));var logger=require(_0x7504('0x6'))(_0x7504('0x7'));var config=require(_0x7504('0x8'));var jayson=require(_0x7504('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9474e8,_0x279875,_0x5c4870){return new BPromise(function(_0x13e934,_0x506e52){return client[_0x7504('0xa')](_0x9474e8,_0x5c4870)['then'](function(_0x17a5e4){logger['info'](_0x7504('0xb'),_0x279875,_0x7504('0xc'));logger['debug'](_0x7504('0xd'),_0x279875,'request\x20sent',JSON[_0x7504('0xe')](_0x17a5e4));if(_0x17a5e4[_0x7504('0xf')]){if(_0x17a5e4[_0x7504('0xf')][_0x7504('0x10')]===0x1f4){logger['error'](_0x7504('0xb'),_0x279875,_0x17a5e4[_0x7504('0xf')][_0x7504('0x11')]);return _0x506e52(_0x17a5e4['error']['message']);}logger[_0x7504('0xf')](_0x7504('0xb'),_0x279875,_0x17a5e4[_0x7504('0xf')][_0x7504('0x11')]);return _0x13e934(_0x17a5e4[_0x7504('0xf')][_0x7504('0x11')]);}else{logger[_0x7504('0x12')](_0x7504('0xb'),_0x279875,_0x7504('0xc'));_0x13e934(_0x17a5e4[_0x7504('0x13')][_0x7504('0x11')]);}})['catch'](function(_0x53012e){logger[_0x7504('0xf')](_0x7504('0xb'),_0x279875,_0x53012e);_0x506e52(_0x53012e);});});}exports[_0x7504('0x14')]=function(_0x4af59a){var _0x46dd9b=this;return new Promise(function(_0x120dd4,_0x1a8e1d){return db['Dynamics365Account'][_0x7504('0x15')]({'raw':_0x4af59a[_0x7504('0x16')]?_0x4af59a[_0x7504('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4af59a['options']?_0x4af59a[_0x7504('0x16')][_0x7504('0x17')]||null:null,'attributes':_0x4af59a[_0x7504('0x16')]?_0x4af59a[_0x7504('0x16')][_0x7504('0x18')]||null:null,'limit':_0x4af59a[_0x7504('0x16')]?_0x4af59a[_0x7504('0x16')][_0x7504('0x19')]||null:null,'include':_0x4af59a['options']?_0x4af59a[_0x7504('0x16')][_0x7504('0x1a')]?_[_0x7504('0x1b')](_0x4af59a[_0x7504('0x16')][_0x7504('0x1a')],function(_0x32863c){return{'model':db[_0x32863c[_0x7504('0x1c')]],'as':_0x32863c['as'],'attributes':_0x32863c[_0x7504('0x18')],'include':_0x32863c[_0x7504('0x1a')]?_[_0x7504('0x1b')](_0x32863c[_0x7504('0x1a')],function(_0x15e336){return{'model':db[_0x15e336[_0x7504('0x1c')]],'as':_0x15e336['as'],'attributes':_0x15e336['attributes'],'include':_0x15e336[_0x7504('0x1a')]?_['map'](_0x15e336[_0x7504('0x1a')],function(_0x677fda){return{'model':db[_0x677fda[_0x7504('0x1c')]],'as':_0x677fda['as'],'attributes':_0x677fda['attributes']};}):[]};}):[]};}):[]:[]})[_0x7504('0x1d')](function(_0x245006){logger['info'](_0x7504('0x14'),_0x4af59a);logger['debug'](_0x7504('0x14'),_0x4af59a,JSON[_0x7504('0xe')](_0x245006));_0x120dd4(_0x245006);})[_0x7504('0x1e')](function(_0x147358){logger['error'](_0x7504('0x14'),_0x147358[_0x7504('0x11')],_0x4af59a);_0x1a8e1d(_0x46dd9b[_0x7504('0xf')](0x1f4,_0x147358[_0x7504('0x11')]));});});};exports[_0x7504('0x1f')]=function(_0x5dbff2){var _0x179d37=this;return new Promise(function(_0x29c10b,_0x41d16f){return db[_0x7504('0x20')][_0x7504('0x21')]({'raw':_0x5dbff2['options']?_0x5dbff2[_0x7504('0x16')][_0x7504('0x22')]===undefined?!![]:![]:!![],'where':_0x5dbff2['options']?_0x5dbff2[_0x7504('0x16')]['where']||null:null,'attributes':_0x5dbff2['options']?_0x5dbff2[_0x7504('0x16')][_0x7504('0x18')]||null:null,'include':_0x5dbff2[_0x7504('0x16')]?_0x5dbff2[_0x7504('0x16')][_0x7504('0x1a')]?_[_0x7504('0x1b')](_0x5dbff2['options'][_0x7504('0x1a')],function(_0x23fcc8){return{'model':db[_0x23fcc8[_0x7504('0x1c')]],'as':_0x23fcc8['as'],'attributes':_0x23fcc8[_0x7504('0x18')],'include':_0x23fcc8['include']?_[_0x7504('0x1b')](_0x23fcc8[_0x7504('0x1a')],function(_0x4b6657){return{'model':db[_0x4b6657['model']],'as':_0x4b6657['as'],'attributes':_0x4b6657[_0x7504('0x18')],'include':_0x4b6657[_0x7504('0x1a')]?_[_0x7504('0x1b')](_0x4b6657[_0x7504('0x1a')],function(_0x4ff45f){return{'model':db[_0x4ff45f[_0x7504('0x1c')]],'as':_0x4ff45f['as'],'attributes':_0x4ff45f[_0x7504('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7504('0x1d')](function(_0x25e36b){logger[_0x7504('0x12')]('ShowDynamics365Account',_0x5dbff2);logger[_0x7504('0x23')](_0x7504('0x1f'),_0x5dbff2,JSON[_0x7504('0xe')](_0x25e36b));_0x29c10b(_0x25e36b);})[_0x7504('0x1e')](function(_0x2b97f4){logger[_0x7504('0xf')](_0x7504('0x1f'),_0x2b97f4['message'],_0x5dbff2);_0x41d16f(_0x179d37[_0x7504('0xf')](0x1f4,_0x2b97f4[_0x7504('0x11')]));});});}; \ No newline at end of file +var _0xeabb=['then','ShowDynamics365Account','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','GetDynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','catch','Dynamics365Account','find'];(function(_0x4f65bb,_0x1e751b){var _0x3ca7c1=function(_0x44dd79){while(--_0x44dd79){_0x4f65bb['push'](_0x4f65bb['shift']());}};_0x3ca7c1(++_0x1e751b);}(_0xeabb,0x156));var _0xbeab=function(_0x2c6fd3,_0x4ad940){_0x2c6fd3=_0x2c6fd3-0x0;var _0x57d735=_0xeabb[_0x2c6fd3];return _0x57d735;};'use strict';var _=require(_0xbeab('0x0'));var util=require('util');var moment=require(_0xbeab('0x1'));var BPromise=require('bluebird');var rs=require(_0xbeab('0x2'));var fs=require('fs');var Redis=require(_0xbeab('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbeab('0x4'))(_0xbeab('0x5'));var config=require('../../config/environment');var jayson=require(_0xbeab('0x6'));var client=jayson[_0xbeab('0x7')][_0xbeab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5784c7,_0x1f9d73,_0x1f86ff){return new BPromise(function(_0x5694ac,_0x16d6ff){return client['request'](_0x5784c7,_0x1f86ff)['then'](function(_0x4b7e0b){logger[_0xbeab('0x9')]('Dynamics365Account,\x20%s,\x20%s',_0x1f9d73,_0xbeab('0xa'));logger[_0xbeab('0xb')](_0xbeab('0xc'),_0x1f9d73,_0xbeab('0xa'),JSON[_0xbeab('0xd')](_0x4b7e0b));if(_0x4b7e0b[_0xbeab('0xe')]){if(_0x4b7e0b[_0xbeab('0xe')][_0xbeab('0xf')]===0x1f4){logger[_0xbeab('0xe')](_0xbeab('0x10'),_0x1f9d73,_0x4b7e0b[_0xbeab('0xe')]['message']);return _0x16d6ff(_0x4b7e0b[_0xbeab('0xe')][_0xbeab('0x11')]);}logger[_0xbeab('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x1f9d73,_0x4b7e0b['error'][_0xbeab('0x11')]);return _0x5694ac(_0x4b7e0b[_0xbeab('0xe')][_0xbeab('0x11')]);}else{logger[_0xbeab('0x9')](_0xbeab('0x10'),_0x1f9d73,_0xbeab('0xa'));_0x5694ac(_0x4b7e0b[_0xbeab('0x12')][_0xbeab('0x11')]);}})['catch'](function(_0x2c0c29){logger[_0xbeab('0xe')](_0xbeab('0x10'),_0x1f9d73,_0x2c0c29);_0x16d6ff(_0x2c0c29);});});}exports[_0xbeab('0x13')]=function(_0x36a94e){var _0x2377ee=this;return new Promise(function(_0x2cadb3,_0x514946){return db['Dynamics365Account'][_0xbeab('0x14')]({'raw':_0x36a94e[_0xbeab('0x15')]?_0x36a94e[_0xbeab('0x15')][_0xbeab('0x16')]===undefined?!![]:![]:!![],'where':_0x36a94e[_0xbeab('0x15')]?_0x36a94e[_0xbeab('0x15')][_0xbeab('0x17')]||null:null,'attributes':_0x36a94e[_0xbeab('0x15')]?_0x36a94e[_0xbeab('0x15')]['attributes']||null:null,'limit':_0x36a94e[_0xbeab('0x15')]?_0x36a94e[_0xbeab('0x15')][_0xbeab('0x18')]||null:null,'include':_0x36a94e[_0xbeab('0x15')]?_0x36a94e[_0xbeab('0x15')][_0xbeab('0x19')]?_[_0xbeab('0x1a')](_0x36a94e[_0xbeab('0x15')]['include'],function(_0x212bb8){return{'model':db[_0x212bb8[_0xbeab('0x1b')]],'as':_0x212bb8['as'],'attributes':_0x212bb8[_0xbeab('0x1c')],'include':_0x212bb8[_0xbeab('0x19')]?_[_0xbeab('0x1a')](_0x212bb8[_0xbeab('0x19')],function(_0x3f2c29){return{'model':db[_0x3f2c29[_0xbeab('0x1b')]],'as':_0x3f2c29['as'],'attributes':_0x3f2c29[_0xbeab('0x1c')],'include':_0x3f2c29['include']?_[_0xbeab('0x1a')](_0x3f2c29[_0xbeab('0x19')],function(_0x4c7338){return{'model':db[_0x4c7338[_0xbeab('0x1b')]],'as':_0x4c7338['as'],'attributes':_0x4c7338['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xfefd2b){logger[_0xbeab('0x9')](_0xbeab('0x13'),_0x36a94e);logger[_0xbeab('0xb')](_0xbeab('0x13'),_0x36a94e,JSON['stringify'](_0xfefd2b));_0x2cadb3(_0xfefd2b);})[_0xbeab('0x1d')](function(_0x464dd6){logger[_0xbeab('0xe')](_0xbeab('0x13'),_0x464dd6[_0xbeab('0x11')],_0x36a94e);_0x514946(_0x2377ee[_0xbeab('0xe')](0x1f4,_0x464dd6[_0xbeab('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x3d9f1c){var _0x373359=this;return new Promise(function(_0x252451,_0x50d890){return db[_0xbeab('0x1e')][_0xbeab('0x1f')]({'raw':_0x3d9f1c[_0xbeab('0x15')]?_0x3d9f1c[_0xbeab('0x15')][_0xbeab('0x16')]===undefined?!![]:![]:!![],'where':_0x3d9f1c['options']?_0x3d9f1c[_0xbeab('0x15')]['where']||null:null,'attributes':_0x3d9f1c['options']?_0x3d9f1c[_0xbeab('0x15')][_0xbeab('0x1c')]||null:null,'include':_0x3d9f1c[_0xbeab('0x15')]?_0x3d9f1c['options'][_0xbeab('0x19')]?_[_0xbeab('0x1a')](_0x3d9f1c['options'][_0xbeab('0x19')],function(_0x282d05){return{'model':db[_0x282d05[_0xbeab('0x1b')]],'as':_0x282d05['as'],'attributes':_0x282d05[_0xbeab('0x1c')],'include':_0x282d05['include']?_[_0xbeab('0x1a')](_0x282d05[_0xbeab('0x19')],function(_0x14d2e1){return{'model':db[_0x14d2e1[_0xbeab('0x1b')]],'as':_0x14d2e1['as'],'attributes':_0x14d2e1[_0xbeab('0x1c')],'include':_0x14d2e1[_0xbeab('0x19')]?_['map'](_0x14d2e1['include'],function(_0x5b362d){return{'model':db[_0x5b362d[_0xbeab('0x1b')]],'as':_0x5b362d['as'],'attributes':_0x5b362d[_0xbeab('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbeab('0x20')](function(_0x40bf8b){logger['info'](_0xbeab('0x21'),_0x3d9f1c);logger[_0xbeab('0xb')]('ShowDynamics365Account',_0x3d9f1c,JSON[_0xbeab('0xd')](_0x40bf8b));_0x252451(_0x40bf8b);})[_0xbeab('0x1d')](function(_0x4cefa9){logger[_0xbeab('0xe')]('ShowDynamics365Account',_0x4cefa9[_0xbeab('0x11')],_0x3d9f1c);_0x50d890(_0x373359[_0xbeab('0xe')](0x1f4,_0x4cefa9['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index b4b0827..e9a48bc 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 _0x989b=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x989b,0x187));var _0xb989=function(_0xa8fa22,_0x2e097a){_0xa8fa22=_0xa8fa22-0x0;var _0x5940bd=_0x989b[_0xa8fa22];return _0x5940bd;};'use strict';var multer=require(_0xb989('0x0'));var util=require(_0xb989('0x1'));var path=require(_0xb989('0x2'));var timeout=require(_0xb989('0x3'));var express=require(_0xb989('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb989('0x5'));var interaction=require(_0xb989('0x6'));var config=require(_0xb989('0x7'));var controller=require(_0xb989('0x8'));router[_0xb989('0x9')]('/',auth[_0xb989('0xa')](),controller[_0xb989('0xb')]);router[_0xb989('0x9')](_0xb989('0xc'),auth[_0xb989('0xa')](),controller[_0xb989('0xd')]);router[_0xb989('0x9')](_0xb989('0xe'),auth['isAuthenticated'](),controller[_0xb989('0xf')]);router[_0xb989('0x9')](_0xb989('0x10'),auth['isAuthenticated'](),controller[_0xb989('0x11')]);router[_0xb989('0x9')](_0xb989('0x12'),auth[_0xb989('0xa')](),controller[_0xb989('0x13')]);router[_0xb989('0x14')]('/',auth[_0xb989('0xa')](),controller['create']);router[_0xb989('0x15')](_0xb989('0xc'),auth[_0xb989('0xa')](),controller[_0xb989('0x16')]);router[_0xb989('0x17')](_0xb989('0xc'),auth[_0xb989('0xa')](),controller[_0xb989('0x18')]);module['exports']=router; \ No newline at end of file +var _0xfa7e=['create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post'];(function(_0xb692d1,_0x1245d7){var _0x462754=function(_0xc29422){while(--_0xc29422){_0xb692d1['push'](_0xb692d1['shift']());}};_0x462754(++_0x1245d7);}(_0xfa7e,0x11a));var _0xefa7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfa7e[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xefa7('0x0'));var util=require(_0xefa7('0x1'));var path=require(_0xefa7('0x2'));var timeout=require(_0xefa7('0x3'));var express=require(_0xefa7('0x4'));var router=express[_0xefa7('0x5')]();var fs_extra=require(_0xefa7('0x6'));var auth=require(_0xefa7('0x7'));var interaction=require(_0xefa7('0x8'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xefa7('0x9')]('/',auth[_0xefa7('0xa')](),controller[_0xefa7('0xb')]);router[_0xefa7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xefa7('0xc')]);router['get'](_0xefa7('0xd'),auth[_0xefa7('0xa')](),controller[_0xefa7('0xe')]);router[_0xefa7('0x9')]('/:id/subjects',auth[_0xefa7('0xa')](),controller[_0xefa7('0xf')]);router[_0xefa7('0x9')](_0xefa7('0x10'),auth[_0xefa7('0xa')](),controller['getDescriptions']);router[_0xefa7('0x11')]('/',auth[_0xefa7('0xa')](),controller[_0xefa7('0x12')]);router[_0xefa7('0x13')]('/:id',auth[_0xefa7('0xa')](),controller[_0xefa7('0x14')]);router[_0xefa7('0x15')](_0xefa7('0x16'),auth['isAuthenticated'](),controller[_0xefa7('0x17')]);module[_0xefa7('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 754259a..6747378 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 _0x5e8f=['incident','sequelize','exports','STRING','ENUM'];(function(_0x3fb707,_0x1ae423){var _0x45da9c=function(_0x567d4e){while(--_0x567d4e){_0x3fb707['push'](_0x3fb707['shift']());}};_0x45da9c(++_0x1ae423);}(_0x5e8f,0xec));var _0xf5e8=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x5e8f[_0x3daa8c];return _0x2b1bd7;};'use strict';var Sequelize=require(_0xf5e8('0x0'));module[_0xf5e8('0x1')]={'name':{'type':Sequelize[_0xf5e8('0x2')]},'description':{'type':Sequelize[_0xf5e8('0x2')]},'ticketType':{'type':Sequelize[_0xf5e8('0x3')](_0xf5e8('0x4'),'phonecall'),'defaultValue':_0xf5e8('0x4')}}; \ No newline at end of file +var _0xae10=['phonecall','incident','STRING','ENUM'];(function(_0x2254a0,_0x41f33e){var _0x35cd31=function(_0x5242d5){while(--_0x5242d5){_0x2254a0['push'](_0x2254a0['shift']());}};_0x35cd31(++_0x41f33e);}(_0xae10,0x11a));var _0x0ae1=function(_0x4ee588,_0x2bfcc0){_0x4ee588=_0x4ee588-0x0;var _0x51dec2=_0xae10[_0x4ee588];return _0x51dec2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0ae1('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x0ae1('0x1')]('incident',_0x0ae1('0x2')),'defaultValue':_0x0ae1('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 15a27e4..6406edf 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 _0xcdb5=['length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','catch','show','find','create','body','params','getFields','findOne','sort','Dynamics365Field','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields'];(function(_0x2dc6c6,_0x166977){var _0x30b5ab=function(_0x4cdbc7){while(--_0x4cdbc7){_0x2dc6c6['push'](_0x2dc6c6['shift']());}};_0x30b5ab(++_0x166977);}(_0xcdb5,0xc0));var _0x5cdb=function(_0x5a7552,_0xf1ba17){_0x5a7552=_0x5a7552-0x0;var _0x5b31a0=_0xcdb5[_0x5a7552];return _0x5b31a0;};'use strict';var emlformat=require(_0x5cdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cdb('0x1'));var jsonpatch=require(_0x5cdb('0x2'));var rp=require('request-promise');var moment=require(_0x5cdb('0x3'));var BPromise=require(_0x5cdb('0x4'));var Mustache=require(_0x5cdb('0x5'));var util=require(_0x5cdb('0x6'));var path=require(_0x5cdb('0x7'));var sox=require(_0x5cdb('0x8'));var csv=require(_0x5cdb('0x9'));var ejs=require(_0x5cdb('0xa'));var fs=require('fs');var fs_extra=require(_0x5cdb('0xb'));var _=require(_0x5cdb('0xc'));var squel=require(_0x5cdb('0xd'));var crypto=require('crypto');var jsforce=require(_0x5cdb('0xe'));var deskjs=require(_0x5cdb('0xf'));var toCsv=require(_0x5cdb('0x9'));var querystring=require(_0x5cdb('0x10'));var Papa=require(_0x5cdb('0x11'));var Redis=require('ioredis');var authService=require(_0x5cdb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5cdb('0x13'));var hardwareService=require(_0x5cdb('0x14'));var logger=require(_0x5cdb('0x15'))(_0x5cdb('0x16'));var utils=require(_0x5cdb('0x17'));var config=require(_0x5cdb('0x18'));var licenseUtil=require(_0x5cdb('0x19'));var db=require(_0x5cdb('0x1a'))['db'];function respondWithStatusCode(_0x510a70,_0x1b6db6){_0x1b6db6=_0x1b6db6||0xcc;return function(_0x3c574c){if(_0x3c574c){return _0x510a70[_0x5cdb('0x1b')](_0x1b6db6);}return _0x510a70['status'](_0x1b6db6)[_0x5cdb('0x1c')]();};}function respondWithResult(_0x4c9688,_0x4ee8f7){_0x4ee8f7=_0x4ee8f7||0xc8;return function(_0x58ce92){if(_0x58ce92){return _0x4c9688[_0x5cdb('0x1d')](_0x4ee8f7)[_0x5cdb('0x1e')](_0x58ce92);}};}function respondWithFilteredResult(_0x11d96b,_0x59099a){return function(_0x30f230){if(_0x30f230){var _0x223eec=typeof _0x59099a[_0x5cdb('0x1f')]==='undefined'&&typeof _0x59099a['limit']===_0x5cdb('0x20');var _0x5aaf58=_0x30f230[_0x5cdb('0x21')];var _0x3111a3=_0x223eec?0x0:_0x59099a[_0x5cdb('0x1f')];var _0x71e83b=_0x223eec?_0x30f230['count']:_0x59099a[_0x5cdb('0x1f')]+_0x59099a[_0x5cdb('0x22')];var _0x413a78;if(_0x71e83b>=_0x5aaf58){_0x71e83b=_0x5aaf58;_0x413a78=0xc8;}else{_0x413a78=0xce;}_0x11d96b[_0x5cdb('0x1d')](_0x413a78);return _0x11d96b['set'](_0x5cdb('0x23'),_0x3111a3+'-'+_0x71e83b+'/'+_0x5aaf58)['json'](_0x30f230);}return null;};}function patchUpdates(_0x7edab2){return function(_0xfd74c8){try{jsonpatch['apply'](_0xfd74c8,_0x7edab2,!![]);}catch(_0xbd3e29){return BPromise[_0x5cdb('0x24')](_0xbd3e29);}return _0xfd74c8[_0x5cdb('0x25')]();};}function saveUpdates(_0x1c64d4,_0x418ee7){return function(_0x331aa0){if(_0x331aa0){return _0x331aa0[_0x5cdb('0x26')](_0x1c64d4)['then'](function(_0x40fd66){return _0x40fd66;});}return null;};}function removeEntity(_0x532ee3,_0x574b10){return function(_0x11f6d0){if(_0x11f6d0){return _0x11f6d0[_0x5cdb('0x27')]()['then'](function(){_0x532ee3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a602c,_0x4b6ee0){return function(_0x485155){if(!_0x485155){_0x3a602c[_0x5cdb('0x1b')](0x194);}return _0x485155;};}function handleError(_0x19ac87,_0x5e5643){_0x5e5643=_0x5e5643||0x1f4;return function(_0x1bd8e7){logger[_0x5cdb('0x28')](_0x1bd8e7[_0x5cdb('0x29')]);if(_0x1bd8e7[_0x5cdb('0x2a')]){delete _0x1bd8e7['name'];}_0x19ac87['status'](_0x5e5643)[_0x5cdb('0x2b')](_0x1bd8e7);};}exports[_0x5cdb('0x2c')]=function(_0x5f3f9e,_0x2f4516){var _0x1e151d={},_0x384672={},_0x4f15b3={'count':0x0,'rows':[]};var _0x989039=_[_0x5cdb('0x2d')](db[_0x5cdb('0x2e')][_0x5cdb('0x2f')],function(_0x3a2e4e){return{'name':_0x3a2e4e[_0x5cdb('0x30')],'type':_0x3a2e4e['type'][_0x5cdb('0x31')]};});_0x384672[_0x5cdb('0x32')]=_[_0x5cdb('0x2d')](_0x989039,_0x5cdb('0x2a'));_0x384672['query']=_[_0x5cdb('0x33')](_0x5f3f9e['query']);_0x384672[_0x5cdb('0x34')]=_[_0x5cdb('0x35')](_0x384672[_0x5cdb('0x32')],_0x384672[_0x5cdb('0x36')]);_0x1e151d[_0x5cdb('0x37')]=_[_0x5cdb('0x35')](_0x384672[_0x5cdb('0x32')],qs[_0x5cdb('0x38')](_0x5f3f9e[_0x5cdb('0x36')][_0x5cdb('0x38')]));_0x1e151d[_0x5cdb('0x37')]=_0x1e151d['attributes'][_0x5cdb('0x39')]?_0x1e151d[_0x5cdb('0x37')]:_0x384672[_0x5cdb('0x32')];if(!_0x5f3f9e[_0x5cdb('0x36')][_0x5cdb('0x3a')](_0x5cdb('0x3b'))){_0x1e151d['limit']=qs[_0x5cdb('0x22')](_0x5f3f9e[_0x5cdb('0x36')][_0x5cdb('0x22')]);_0x1e151d[_0x5cdb('0x1f')]=qs[_0x5cdb('0x1f')](_0x5f3f9e[_0x5cdb('0x36')][_0x5cdb('0x1f')]);}_0x1e151d[_0x5cdb('0x3c')]=qs['sort'](_0x5f3f9e['query']['sort']);_0x1e151d[_0x5cdb('0x3d')]=qs['filters'](_[_0x5cdb('0x3e')](_0x5f3f9e['query'],_0x384672[_0x5cdb('0x34')]),_0x989039);if(_0x5f3f9e['query'][_0x5cdb('0x3f')]){_0x1e151d[_0x5cdb('0x3d')]=_[_0x5cdb('0x40')](_0x1e151d['where'],{'$or':_[_0x5cdb('0x2d')](_0x989039,function(_0x21dfa0){if(_0x21dfa0[_0x5cdb('0x41')]!==_0x5cdb('0x42')){var _0x3ee80a={};_0x3ee80a[_0x21dfa0['name']]={'$like':'%'+_0x5f3f9e[_0x5cdb('0x36')][_0x5cdb('0x3f')]+'%'};return _0x3ee80a;}})});}_0x1e151d=_[_0x5cdb('0x40')]({},_0x1e151d,_0x5f3f9e[_0x5cdb('0x43')]);var _0x5d03e7={'where':_0x1e151d[_0x5cdb('0x3d')]};return db[_0x5cdb('0x2e')]['count'](_0x5d03e7)[_0x5cdb('0x44')](function(_0x2b4865){_0x4f15b3[_0x5cdb('0x21')]=_0x2b4865;if(_0x5f3f9e['query'][_0x5cdb('0x45')]){_0x1e151d[_0x5cdb('0x46')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x5cdb('0x47')](_0x1e151d);})[_0x5cdb('0x44')](function(_0x49d651){_0x4f15b3['rows']=_0x49d651;return _0x4f15b3;})['then'](respondWithFilteredResult(_0x2f4516,_0x1e151d))[_0x5cdb('0x48')](handleError(_0x2f4516,null));};exports[_0x5cdb('0x49')]=function(_0x3e624c,_0x1c8dd8){var _0x5114f1={'raw':![],'where':{'id':_0x3e624c['params']['id']}},_0x1c8316={};_0x1c8316['model']=_[_0x5cdb('0x33')](db[_0x5cdb('0x2e')][_0x5cdb('0x2f')]);_0x1c8316['query']=_['keys'](_0x3e624c[_0x5cdb('0x36')]);_0x1c8316[_0x5cdb('0x34')]=_['intersection'](_0x1c8316[_0x5cdb('0x32')],_0x1c8316[_0x5cdb('0x36')]);_0x5114f1[_0x5cdb('0x37')]=_[_0x5cdb('0x35')](_0x1c8316[_0x5cdb('0x32')],qs[_0x5cdb('0x38')](_0x3e624c[_0x5cdb('0x36')][_0x5cdb('0x38')]));_0x5114f1[_0x5cdb('0x37')]=_0x5114f1['attributes'][_0x5cdb('0x39')]?_0x5114f1['attributes']:_0x1c8316['model'];if(_0x3e624c[_0x5cdb('0x36')][_0x5cdb('0x45')]){_0x5114f1[_0x5cdb('0x46')]=[{'all':!![]}];}_0x5114f1=_[_0x5cdb('0x40')]({},_0x5114f1,_0x3e624c['options']);return db[_0x5cdb('0x2e')][_0x5cdb('0x4a')](_0x5114f1)[_0x5cdb('0x44')](handleEntityNotFound(_0x1c8dd8,null))[_0x5cdb('0x44')](respondWithResult(_0x1c8dd8,null))[_0x5cdb('0x48')](handleError(_0x1c8dd8,null));};exports[_0x5cdb('0x4b')]=function(_0x44476c,_0x5dd63d){return db[_0x5cdb('0x2e')][_0x5cdb('0x4b')](_0x44476c[_0x5cdb('0x4c')],{})[_0x5cdb('0x44')](respondWithResult(_0x5dd63d,0xc9))[_0x5cdb('0x48')](handleError(_0x5dd63d,null));};exports[_0x5cdb('0x26')]=function(_0x126a53,_0x1b249f){if(_0x126a53['body']['id']){delete _0x126a53[_0x5cdb('0x4c')]['id'];}return db[_0x5cdb('0x2e')][_0x5cdb('0x4a')]({'where':{'id':_0x126a53[_0x5cdb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1b249f,null))[_0x5cdb('0x44')](saveUpdates(_0x126a53[_0x5cdb('0x4c')],null))['then'](respondWithResult(_0x1b249f,null))[_0x5cdb('0x48')](handleError(_0x1b249f,null));};exports[_0x5cdb('0x27')]=function(_0x2c64c7,_0x277400){return db[_0x5cdb('0x2e')]['find']({'where':{'id':_0x2c64c7[_0x5cdb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x277400,null))[_0x5cdb('0x44')](removeEntity(_0x277400,null))[_0x5cdb('0x48')](handleError(_0x277400,null));};exports[_0x5cdb('0x4e')]=function(_0x51e35c,_0x28dde1,_0xf3856b){var _0x5e1bd7={};var _0x138cec={};var _0x3497c0;var _0x59c65f;return db[_0x5cdb('0x2e')][_0x5cdb('0x4f')]({'where':{'id':_0x51e35c[_0x5cdb('0x4d')]['id']}})[_0x5cdb('0x44')](handleEntityNotFound(_0x28dde1,null))['then'](function(_0x3e8b8e){if(_0x3e8b8e){_0x3497c0=_0x3e8b8e;_0x138cec[_0x5cdb('0x32')]=_[_0x5cdb('0x33')](db['Dynamics365Field'][_0x5cdb('0x2f')]);_0x138cec[_0x5cdb('0x36')]=_['keys'](_0x51e35c[_0x5cdb('0x36')]);_0x138cec['filters']=_['intersection'](_0x138cec[_0x5cdb('0x32')],_0x138cec[_0x5cdb('0x36')]);_0x5e1bd7[_0x5cdb('0x37')]=_[_0x5cdb('0x35')](_0x138cec[_0x5cdb('0x32')],qs[_0x5cdb('0x38')](_0x51e35c[_0x5cdb('0x36')]['fields']));_0x5e1bd7[_0x5cdb('0x37')]=_0x5e1bd7['attributes'][_0x5cdb('0x39')]?_0x5e1bd7['attributes']:_0x138cec[_0x5cdb('0x32')];_0x5e1bd7[_0x5cdb('0x3c')]=qs[_0x5cdb('0x50')](_0x51e35c['query'][_0x5cdb('0x50')]);_0x5e1bd7['where']=qs['filters'](_[_0x5cdb('0x3e')](_0x51e35c['query'],_0x138cec[_0x5cdb('0x34')]));if(_0x51e35c[_0x5cdb('0x36')][_0x5cdb('0x3f')]){_0x5e1bd7[_0x5cdb('0x3d')]=_[_0x5cdb('0x40')](_0x5e1bd7[_0x5cdb('0x3d')],{'$or':_[_0x5cdb('0x2d')](_0x5e1bd7[_0x5cdb('0x37')],function(_0x134931){var _0x5f45a5={};_0x5f45a5[_0x134931]={'$like':'%'+_0x51e35c['query'][_0x5cdb('0x3f')]+'%'};return _0x5f45a5;})});}_0x5e1bd7=_[_0x5cdb('0x40')]({},_0x5e1bd7,_0x51e35c[_0x5cdb('0x43')]);return _0x3497c0[_0x5cdb('0x4e')](_0x5e1bd7);}})['then'](function(_0x11fe11){if(_0x11fe11){_0x59c65f=_0x11fe11[_0x5cdb('0x39')];if(!_0x51e35c[_0x5cdb('0x36')][_0x5cdb('0x3a')]('nolimit')){_0x5e1bd7[_0x5cdb('0x22')]=qs[_0x5cdb('0x22')](_0x51e35c[_0x5cdb('0x36')][_0x5cdb('0x22')]);_0x5e1bd7[_0x5cdb('0x1f')]=qs[_0x5cdb('0x1f')](_0x51e35c['query'][_0x5cdb('0x1f')]);}return _0x3497c0['getFields'](_0x5e1bd7);}})[_0x5cdb('0x44')](function(_0x3c4ecc){if(_0x3c4ecc){return _0x3c4ecc?{'count':_0x59c65f,'rows':_0x3c4ecc}:null;}})[_0x5cdb('0x44')](respondWithResult(_0x28dde1,null))[_0x5cdb('0x48')](handleError(_0x28dde1,null));};exports['getSubjects']=function(_0x3ddc89,_0x5f69ba,_0x58e9a5){var _0x3a05af={};var _0x27fbf6={};var _0xc2e25a;var _0x443d67;return db[_0x5cdb('0x2e')][_0x5cdb('0x4f')]({'where':{'id':_0x3ddc89[_0x5cdb('0x4d')]['id']}})[_0x5cdb('0x44')](handleEntityNotFound(_0x5f69ba,null))['then'](function(_0x5527ea){if(_0x5527ea){_0xc2e25a=_0x5527ea;_0x27fbf6['model']=_[_0x5cdb('0x33')](db['Dynamics365Field'][_0x5cdb('0x2f')]);_0x27fbf6[_0x5cdb('0x36')]=_['keys'](_0x3ddc89[_0x5cdb('0x36')]);_0x27fbf6[_0x5cdb('0x34')]=_[_0x5cdb('0x35')](_0x27fbf6['model'],_0x27fbf6['query']);_0x3a05af[_0x5cdb('0x37')]=_['intersection'](_0x27fbf6[_0x5cdb('0x32')],qs[_0x5cdb('0x38')](_0x3ddc89[_0x5cdb('0x36')][_0x5cdb('0x38')]));_0x3a05af['attributes']=_0x3a05af[_0x5cdb('0x37')][_0x5cdb('0x39')]?_0x3a05af['attributes']:_0x27fbf6[_0x5cdb('0x32')];_0x3a05af[_0x5cdb('0x3c')]=qs['sort'](_0x3ddc89[_0x5cdb('0x36')][_0x5cdb('0x50')]);_0x3a05af[_0x5cdb('0x3d')]=qs['filters'](_[_0x5cdb('0x3e')](_0x3ddc89[_0x5cdb('0x36')],_0x27fbf6[_0x5cdb('0x34')]));if(_0x3ddc89['query'][_0x5cdb('0x3f')]){_0x3a05af['where']=_[_0x5cdb('0x40')](_0x3a05af['where'],{'$or':_[_0x5cdb('0x2d')](_0x3a05af[_0x5cdb('0x37')],function(_0xde38){var _0x30e23c={};_0x30e23c[_0xde38]={'$like':'%'+_0x3ddc89['query']['filter']+'%'};return _0x30e23c;})});}_0x3a05af=_[_0x5cdb('0x40')]({},_0x3a05af,_0x3ddc89[_0x5cdb('0x43')]);return _0xc2e25a['getSubjects'](_0x3a05af);}})[_0x5cdb('0x44')](function(_0x20af6d){if(_0x20af6d){_0x443d67=_0x20af6d[_0x5cdb('0x39')];if(!_0x3ddc89[_0x5cdb('0x36')][_0x5cdb('0x3a')](_0x5cdb('0x3b'))){_0x3a05af[_0x5cdb('0x22')]=qs['limit'](_0x3ddc89['query'][_0x5cdb('0x22')]);_0x3a05af[_0x5cdb('0x1f')]=qs[_0x5cdb('0x1f')](_0x3ddc89[_0x5cdb('0x36')][_0x5cdb('0x1f')]);}return _0xc2e25a['getSubjects'](_0x3a05af);}})[_0x5cdb('0x44')](function(_0x3034ce){if(_0x3034ce){return _0x3034ce?{'count':_0x443d67,'rows':_0x3034ce}:null;}})[_0x5cdb('0x44')](respondWithResult(_0x5f69ba,null))[_0x5cdb('0x48')](handleError(_0x5f69ba,null));};exports['getDescriptions']=function(_0x1889d8,_0x461f53,_0x9e8077){var _0x11a556={};var _0x1a3aba={};var _0x2ba2a6;var _0x649b37;return db[_0x5cdb('0x2e')][_0x5cdb('0x4f')]({'where':{'id':_0x1889d8[_0x5cdb('0x4d')]['id']}})[_0x5cdb('0x44')](handleEntityNotFound(_0x461f53,null))[_0x5cdb('0x44')](function(_0x281bb4){if(_0x281bb4){_0x2ba2a6=_0x281bb4;_0x1a3aba[_0x5cdb('0x32')]=_[_0x5cdb('0x33')](db[_0x5cdb('0x51')][_0x5cdb('0x2f')]);_0x1a3aba[_0x5cdb('0x36')]=_[_0x5cdb('0x33')](_0x1889d8[_0x5cdb('0x36')]);_0x1a3aba[_0x5cdb('0x34')]=_['intersection'](_0x1a3aba[_0x5cdb('0x32')],_0x1a3aba[_0x5cdb('0x36')]);_0x11a556[_0x5cdb('0x37')]=_['intersection'](_0x1a3aba['model'],qs['fields'](_0x1889d8[_0x5cdb('0x36')][_0x5cdb('0x38')]));_0x11a556['attributes']=_0x11a556[_0x5cdb('0x37')][_0x5cdb('0x39')]?_0x11a556[_0x5cdb('0x37')]:_0x1a3aba[_0x5cdb('0x32')];_0x11a556[_0x5cdb('0x3c')]=qs[_0x5cdb('0x50')](_0x1889d8[_0x5cdb('0x36')][_0x5cdb('0x50')]);_0x11a556[_0x5cdb('0x3d')]=qs[_0x5cdb('0x34')](_[_0x5cdb('0x3e')](_0x1889d8[_0x5cdb('0x36')],_0x1a3aba['filters']));if(_0x1889d8['query'][_0x5cdb('0x3f')]){_0x11a556['where']=_[_0x5cdb('0x40')](_0x11a556[_0x5cdb('0x3d')],{'$or':_[_0x5cdb('0x2d')](_0x11a556['attributes'],function(_0x84449f){var _0x189672={};_0x189672[_0x84449f]={'$like':'%'+_0x1889d8[_0x5cdb('0x36')]['filter']+'%'};return _0x189672;})});}_0x11a556=_['merge']({},_0x11a556,_0x1889d8[_0x5cdb('0x43')]);return _0x2ba2a6[_0x5cdb('0x52')](_0x11a556);}})[_0x5cdb('0x44')](function(_0x4684ac){if(_0x4684ac){_0x649b37=_0x4684ac['length'];if(!_0x1889d8[_0x5cdb('0x36')]['hasOwnProperty'](_0x5cdb('0x3b'))){_0x11a556['limit']=qs[_0x5cdb('0x22')](_0x1889d8[_0x5cdb('0x36')][_0x5cdb('0x22')]);_0x11a556[_0x5cdb('0x1f')]=qs[_0x5cdb('0x1f')](_0x1889d8[_0x5cdb('0x36')][_0x5cdb('0x1f')]);}return _0x2ba2a6[_0x5cdb('0x52')](_0x11a556);}})[_0x5cdb('0x44')](function(_0x4a467d){if(_0x4a467d){return _0x4a467d?{'count':_0x649b37,'rows':_0x4a467d}:null;}})[_0x5cdb('0x44')](respondWithResult(_0x461f53,null))[_0x5cdb('0x48')](handleError(_0x461f53,null));}; \ No newline at end of file +var _0x8d80=['Dynamics365Configuration','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','params','keys','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map'];(function(_0x388a11,_0x364c0e){var _0xb7b0d=function(_0x5d058f){while(--_0x5d058f){_0x388a11['push'](_0x388a11['shift']());}};_0xb7b0d(++_0x364c0e);}(_0x8d80,0x77));var _0x08d8=function(_0x24c7cf,_0x326c2d){_0x24c7cf=_0x24c7cf-0x0;var _0x1ba9e9=_0x8d80[_0x24c7cf];return _0x1ba9e9;};'use strict';var emlformat=require(_0x08d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x08d8('0x1'));var jsonpatch=require(_0x08d8('0x2'));var rp=require('request-promise');var moment=require(_0x08d8('0x3'));var BPromise=require(_0x08d8('0x4'));var Mustache=require('mustache');var util=require(_0x08d8('0x5'));var path=require('path');var sox=require(_0x08d8('0x6'));var csv=require(_0x08d8('0x7'));var ejs=require(_0x08d8('0x8'));var fs=require('fs');var fs_extra=require(_0x08d8('0x9'));var _=require(_0x08d8('0xa'));var squel=require(_0x08d8('0xb'));var crypto=require('crypto');var jsforce=require(_0x08d8('0xc'));var deskjs=require(_0x08d8('0xd'));var toCsv=require(_0x08d8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x08d8('0xe'));var qs=require(_0x08d8('0xf'));var as=require(_0x08d8('0x10'));var hardwareService=require(_0x08d8('0x11'));var logger=require(_0x08d8('0x12'))(_0x08d8('0x13'));var utils=require(_0x08d8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x08d8('0x15'));var db=require(_0x08d8('0x16'))['db'];function respondWithStatusCode(_0x34827e,_0x565091){_0x565091=_0x565091||0xcc;return function(_0x21edfe){if(_0x21edfe){return _0x34827e[_0x08d8('0x17')](_0x565091);}return _0x34827e[_0x08d8('0x18')](_0x565091)[_0x08d8('0x19')]();};}function respondWithResult(_0x57fe02,_0xc62380){_0xc62380=_0xc62380||0xc8;return function(_0x44ab0a){if(_0x44ab0a){return _0x57fe02[_0x08d8('0x18')](_0xc62380)[_0x08d8('0x1a')](_0x44ab0a);}};}function respondWithFilteredResult(_0x10deda,_0x5e4343){return function(_0x51dae2){if(_0x51dae2){var _0x2d911c=typeof _0x5e4343[_0x08d8('0x1b')]==='undefined'&&typeof _0x5e4343['limit']===_0x08d8('0x1c');var _0x1118f5=_0x51dae2[_0x08d8('0x1d')];var _0x5cc47f=_0x2d911c?0x0:_0x5e4343[_0x08d8('0x1b')];var _0x5dc0fd=_0x2d911c?_0x51dae2[_0x08d8('0x1d')]:_0x5e4343[_0x08d8('0x1b')]+_0x5e4343[_0x08d8('0x1e')];var _0x2564f0;if(_0x5dc0fd>=_0x1118f5){_0x5dc0fd=_0x1118f5;_0x2564f0=0xc8;}else{_0x2564f0=0xce;}_0x10deda['status'](_0x2564f0);return _0x10deda[_0x08d8('0x1f')](_0x08d8('0x20'),_0x5cc47f+'-'+_0x5dc0fd+'/'+_0x1118f5)[_0x08d8('0x1a')](_0x51dae2);}return null;};}function patchUpdates(_0x1955b2){return function(_0x5a7d9f){try{jsonpatch['apply'](_0x5a7d9f,_0x1955b2,!![]);}catch(_0x10dc8f){return BPromise[_0x08d8('0x21')](_0x10dc8f);}return _0x5a7d9f[_0x08d8('0x22')]();};}function saveUpdates(_0x1903d9,_0x3641be){return function(_0x47ab7f){if(_0x47ab7f){return _0x47ab7f[_0x08d8('0x23')](_0x1903d9)['then'](function(_0x717ba){return _0x717ba;});}return null;};}function removeEntity(_0x49c9c7,_0x14ee4c){return function(_0x5e3ae8){if(_0x5e3ae8){return _0x5e3ae8[_0x08d8('0x24')]()['then'](function(){_0x49c9c7[_0x08d8('0x18')](0xcc)[_0x08d8('0x19')]();});}};}function handleEntityNotFound(_0x178c4c,_0x38cb52){return function(_0x413130){if(!_0x413130){_0x178c4c[_0x08d8('0x17')](0x194);}return _0x413130;};}function handleError(_0x4e5a2f,_0x26b9a5){_0x26b9a5=_0x26b9a5||0x1f4;return function(_0x288300){logger[_0x08d8('0x25')](_0x288300[_0x08d8('0x26')]);if(_0x288300[_0x08d8('0x27')]){delete _0x288300[_0x08d8('0x27')];}_0x4e5a2f['status'](_0x26b9a5)[_0x08d8('0x28')](_0x288300);};}exports[_0x08d8('0x29')]=function(_0x6ea5bd,_0x509ef3){var _0x5c0346={},_0x184ec8={},_0x3fe502={'count':0x0,'rows':[]};var _0x40066e=_[_0x08d8('0x2a')](db[_0x08d8('0x2b')][_0x08d8('0x2c')],function(_0x8a4033){return{'name':_0x8a4033[_0x08d8('0x2d')],'type':_0x8a4033['type'][_0x08d8('0x2e')]};});_0x184ec8['model']=_['map'](_0x40066e,'name');_0x184ec8[_0x08d8('0x2f')]=_['keys'](_0x6ea5bd[_0x08d8('0x2f')]);_0x184ec8[_0x08d8('0x30')]=_[_0x08d8('0x31')](_0x184ec8[_0x08d8('0x32')],_0x184ec8['query']);_0x5c0346['attributes']=_[_0x08d8('0x31')](_0x184ec8[_0x08d8('0x32')],qs['fields'](_0x6ea5bd[_0x08d8('0x2f')][_0x08d8('0x33')]));_0x5c0346[_0x08d8('0x34')]=_0x5c0346[_0x08d8('0x34')][_0x08d8('0x35')]?_0x5c0346['attributes']:_0x184ec8[_0x08d8('0x32')];if(!_0x6ea5bd['query'][_0x08d8('0x36')](_0x08d8('0x37'))){_0x5c0346[_0x08d8('0x1e')]=qs[_0x08d8('0x1e')](_0x6ea5bd[_0x08d8('0x2f')][_0x08d8('0x1e')]);_0x5c0346[_0x08d8('0x1b')]=qs[_0x08d8('0x1b')](_0x6ea5bd[_0x08d8('0x2f')][_0x08d8('0x1b')]);}_0x5c0346[_0x08d8('0x38')]=qs[_0x08d8('0x39')](_0x6ea5bd['query'][_0x08d8('0x39')]);_0x5c0346['where']=qs[_0x08d8('0x30')](_[_0x08d8('0x3a')](_0x6ea5bd[_0x08d8('0x2f')],_0x184ec8['filters']),_0x40066e);if(_0x6ea5bd[_0x08d8('0x2f')][_0x08d8('0x3b')]){_0x5c0346[_0x08d8('0x3c')]=_[_0x08d8('0x3d')](_0x5c0346['where'],{'$or':_[_0x08d8('0x2a')](_0x40066e,function(_0x3b2014){if(_0x3b2014[_0x08d8('0x3e')]!==_0x08d8('0x3f')){var _0x39cdec={};_0x39cdec[_0x3b2014['name']]={'$like':'%'+_0x6ea5bd[_0x08d8('0x2f')]['filter']+'%'};return _0x39cdec;}})});}_0x5c0346=_[_0x08d8('0x3d')]({},_0x5c0346,_0x6ea5bd[_0x08d8('0x40')]);var _0x5b5157={'where':_0x5c0346[_0x08d8('0x3c')]};return db['Dynamics365Configuration'][_0x08d8('0x1d')](_0x5b5157)['then'](function(_0x398ccf){_0x3fe502['count']=_0x398ccf;if(_0x6ea5bd[_0x08d8('0x2f')][_0x08d8('0x41')]){_0x5c0346[_0x08d8('0x42')]=[{'all':!![]}];}return db[_0x08d8('0x2b')][_0x08d8('0x43')](_0x5c0346);})[_0x08d8('0x44')](function(_0x770984){_0x3fe502[_0x08d8('0x45')]=_0x770984;return _0x3fe502;})[_0x08d8('0x44')](respondWithFilteredResult(_0x509ef3,_0x5c0346))[_0x08d8('0x46')](handleError(_0x509ef3,null));};exports['show']=function(_0xac63ab,_0x585f56){var _0x561c93={'raw':![],'where':{'id':_0xac63ab[_0x08d8('0x47')]['id']}},_0x45d84d={};_0x45d84d[_0x08d8('0x32')]=_[_0x08d8('0x48')](db[_0x08d8('0x2b')][_0x08d8('0x2c')]);_0x45d84d[_0x08d8('0x2f')]=_[_0x08d8('0x48')](_0xac63ab[_0x08d8('0x2f')]);_0x45d84d['filters']=_[_0x08d8('0x31')](_0x45d84d[_0x08d8('0x32')],_0x45d84d[_0x08d8('0x2f')]);_0x561c93['attributes']=_['intersection'](_0x45d84d[_0x08d8('0x32')],qs[_0x08d8('0x33')](_0xac63ab['query'][_0x08d8('0x33')]));_0x561c93[_0x08d8('0x34')]=_0x561c93[_0x08d8('0x34')][_0x08d8('0x35')]?_0x561c93[_0x08d8('0x34')]:_0x45d84d[_0x08d8('0x32')];if(_0xac63ab[_0x08d8('0x2f')][_0x08d8('0x41')]){_0x561c93[_0x08d8('0x42')]=[{'all':!![]}];}_0x561c93=_[_0x08d8('0x3d')]({},_0x561c93,_0xac63ab[_0x08d8('0x40')]);return db[_0x08d8('0x2b')]['find'](_0x561c93)[_0x08d8('0x44')](handleEntityNotFound(_0x585f56,null))[_0x08d8('0x44')](respondWithResult(_0x585f56,null))[_0x08d8('0x46')](handleError(_0x585f56,null));};exports[_0x08d8('0x49')]=function(_0x17638d,_0x6a4024){return db[_0x08d8('0x2b')][_0x08d8('0x49')](_0x17638d['body'],{})['then'](respondWithResult(_0x6a4024,0xc9))[_0x08d8('0x46')](handleError(_0x6a4024,null));};exports[_0x08d8('0x23')]=function(_0x475422,_0x59fd9b){if(_0x475422['body']['id']){delete _0x475422[_0x08d8('0x4a')]['id'];}return db[_0x08d8('0x2b')]['find']({'where':{'id':_0x475422['params']['id']}})[_0x08d8('0x44')](handleEntityNotFound(_0x59fd9b,null))[_0x08d8('0x44')](saveUpdates(_0x475422[_0x08d8('0x4a')],null))[_0x08d8('0x44')](respondWithResult(_0x59fd9b,null))['catch'](handleError(_0x59fd9b,null));};exports[_0x08d8('0x24')]=function(_0x2c7190,_0x55df60){return db[_0x08d8('0x2b')][_0x08d8('0x4b')]({'where':{'id':_0x2c7190[_0x08d8('0x47')]['id']}})[_0x08d8('0x44')](handleEntityNotFound(_0x55df60,null))[_0x08d8('0x44')](removeEntity(_0x55df60,null))[_0x08d8('0x46')](handleError(_0x55df60,null));};exports[_0x08d8('0x4c')]=function(_0x5d4e82,_0x20ec43,_0x316e2f){var _0x2ab760={};var _0x415733={};var _0xc17c3f;var _0x113311;return db[_0x08d8('0x2b')][_0x08d8('0x4d')]({'where':{'id':_0x5d4e82[_0x08d8('0x47')]['id']}})[_0x08d8('0x44')](handleEntityNotFound(_0x20ec43,null))['then'](function(_0xdb016c){if(_0xdb016c){_0xc17c3f=_0xdb016c;_0x415733[_0x08d8('0x32')]=_[_0x08d8('0x48')](db[_0x08d8('0x4e')][_0x08d8('0x2c')]);_0x415733['query']=_[_0x08d8('0x48')](_0x5d4e82[_0x08d8('0x2f')]);_0x415733[_0x08d8('0x30')]=_[_0x08d8('0x31')](_0x415733[_0x08d8('0x32')],_0x415733[_0x08d8('0x2f')]);_0x2ab760[_0x08d8('0x34')]=_['intersection'](_0x415733[_0x08d8('0x32')],qs[_0x08d8('0x33')](_0x5d4e82[_0x08d8('0x2f')][_0x08d8('0x33')]));_0x2ab760[_0x08d8('0x34')]=_0x2ab760[_0x08d8('0x34')][_0x08d8('0x35')]?_0x2ab760[_0x08d8('0x34')]:_0x415733['model'];_0x2ab760[_0x08d8('0x38')]=qs[_0x08d8('0x39')](_0x5d4e82['query'][_0x08d8('0x39')]);_0x2ab760[_0x08d8('0x3c')]=qs['filters'](_[_0x08d8('0x3a')](_0x5d4e82[_0x08d8('0x2f')],_0x415733[_0x08d8('0x30')]));if(_0x5d4e82[_0x08d8('0x2f')][_0x08d8('0x3b')]){_0x2ab760[_0x08d8('0x3c')]=_[_0x08d8('0x3d')](_0x2ab760[_0x08d8('0x3c')],{'$or':_[_0x08d8('0x2a')](_0x2ab760['attributes'],function(_0x47fd42){var _0x22b998={};_0x22b998[_0x47fd42]={'$like':'%'+_0x5d4e82[_0x08d8('0x2f')][_0x08d8('0x3b')]+'%'};return _0x22b998;})});}_0x2ab760=_[_0x08d8('0x3d')]({},_0x2ab760,_0x5d4e82[_0x08d8('0x40')]);return _0xc17c3f[_0x08d8('0x4c')](_0x2ab760);}})[_0x08d8('0x44')](function(_0x3a8f2e){if(_0x3a8f2e){_0x113311=_0x3a8f2e['length'];if(!_0x5d4e82[_0x08d8('0x2f')][_0x08d8('0x36')](_0x08d8('0x37'))){_0x2ab760['limit']=qs[_0x08d8('0x1e')](_0x5d4e82[_0x08d8('0x2f')][_0x08d8('0x1e')]);_0x2ab760[_0x08d8('0x1b')]=qs[_0x08d8('0x1b')](_0x5d4e82[_0x08d8('0x2f')][_0x08d8('0x1b')]);}return _0xc17c3f[_0x08d8('0x4c')](_0x2ab760);}})[_0x08d8('0x44')](function(_0xed784b){if(_0xed784b){return _0xed784b?{'count':_0x113311,'rows':_0xed784b}:null;}})[_0x08d8('0x44')](respondWithResult(_0x20ec43,null))[_0x08d8('0x46')](handleError(_0x20ec43,null));};exports[_0x08d8('0x4f')]=function(_0x34b114,_0x55b05c,_0x2afb01){var _0x1549d4={};var _0x1b0788={};var _0x397fa6;var _0x5afcab;return db[_0x08d8('0x2b')]['findOne']({'where':{'id':_0x34b114[_0x08d8('0x47')]['id']}})[_0x08d8('0x44')](handleEntityNotFound(_0x55b05c,null))['then'](function(_0x3a27e7){if(_0x3a27e7){_0x397fa6=_0x3a27e7;_0x1b0788['model']=_[_0x08d8('0x48')](db[_0x08d8('0x4e')][_0x08d8('0x2c')]);_0x1b0788[_0x08d8('0x2f')]=_[_0x08d8('0x48')](_0x34b114[_0x08d8('0x2f')]);_0x1b0788['filters']=_[_0x08d8('0x31')](_0x1b0788['model'],_0x1b0788[_0x08d8('0x2f')]);_0x1549d4['attributes']=_['intersection'](_0x1b0788[_0x08d8('0x32')],qs[_0x08d8('0x33')](_0x34b114[_0x08d8('0x2f')][_0x08d8('0x33')]));_0x1549d4[_0x08d8('0x34')]=_0x1549d4[_0x08d8('0x34')][_0x08d8('0x35')]?_0x1549d4[_0x08d8('0x34')]:_0x1b0788['model'];_0x1549d4[_0x08d8('0x38')]=qs[_0x08d8('0x39')](_0x34b114[_0x08d8('0x2f')][_0x08d8('0x39')]);_0x1549d4[_0x08d8('0x3c')]=qs[_0x08d8('0x30')](_['pick'](_0x34b114[_0x08d8('0x2f')],_0x1b0788[_0x08d8('0x30')]));if(_0x34b114[_0x08d8('0x2f')][_0x08d8('0x3b')]){_0x1549d4[_0x08d8('0x3c')]=_[_0x08d8('0x3d')](_0x1549d4[_0x08d8('0x3c')],{'$or':_['map'](_0x1549d4[_0x08d8('0x34')],function(_0x1453db){var _0xe50a0b={};_0xe50a0b[_0x1453db]={'$like':'%'+_0x34b114[_0x08d8('0x2f')]['filter']+'%'};return _0xe50a0b;})});}_0x1549d4=_[_0x08d8('0x3d')]({},_0x1549d4,_0x34b114[_0x08d8('0x40')]);return _0x397fa6[_0x08d8('0x4f')](_0x1549d4);}})[_0x08d8('0x44')](function(_0x55ebd8){if(_0x55ebd8){_0x5afcab=_0x55ebd8['length'];if(!_0x34b114[_0x08d8('0x2f')][_0x08d8('0x36')](_0x08d8('0x37'))){_0x1549d4[_0x08d8('0x1e')]=qs[_0x08d8('0x1e')](_0x34b114[_0x08d8('0x2f')]['limit']);_0x1549d4[_0x08d8('0x1b')]=qs['offset'](_0x34b114[_0x08d8('0x2f')]['offset']);}return _0x397fa6[_0x08d8('0x4f')](_0x1549d4);}})[_0x08d8('0x44')](function(_0x14dcc1){if(_0x14dcc1){return _0x14dcc1?{'count':_0x5afcab,'rows':_0x14dcc1}:null;}})[_0x08d8('0x44')](respondWithResult(_0x55b05c,null))['catch'](handleError(_0x55b05c,null));};exports[_0x08d8('0x50')]=function(_0x2cc458,_0x2be5e4,_0x26b3b0){var _0x3cd8d0={};var _0x8006bd={};var _0x51a139;var _0x10e70b;return db['Dynamics365Configuration'][_0x08d8('0x4d')]({'where':{'id':_0x2cc458['params']['id']}})[_0x08d8('0x44')](handleEntityNotFound(_0x2be5e4,null))[_0x08d8('0x44')](function(_0x5af8e8){if(_0x5af8e8){_0x51a139=_0x5af8e8;_0x8006bd['model']=_[_0x08d8('0x48')](db[_0x08d8('0x4e')][_0x08d8('0x2c')]);_0x8006bd[_0x08d8('0x2f')]=_['keys'](_0x2cc458['query']);_0x8006bd[_0x08d8('0x30')]=_[_0x08d8('0x31')](_0x8006bd[_0x08d8('0x32')],_0x8006bd[_0x08d8('0x2f')]);_0x3cd8d0[_0x08d8('0x34')]=_[_0x08d8('0x31')](_0x8006bd['model'],qs[_0x08d8('0x33')](_0x2cc458[_0x08d8('0x2f')][_0x08d8('0x33')]));_0x3cd8d0['attributes']=_0x3cd8d0[_0x08d8('0x34')][_0x08d8('0x35')]?_0x3cd8d0[_0x08d8('0x34')]:_0x8006bd[_0x08d8('0x32')];_0x3cd8d0[_0x08d8('0x38')]=qs[_0x08d8('0x39')](_0x2cc458[_0x08d8('0x2f')][_0x08d8('0x39')]);_0x3cd8d0[_0x08d8('0x3c')]=qs[_0x08d8('0x30')](_[_0x08d8('0x3a')](_0x2cc458['query'],_0x8006bd[_0x08d8('0x30')]));if(_0x2cc458['query'][_0x08d8('0x3b')]){_0x3cd8d0[_0x08d8('0x3c')]=_[_0x08d8('0x3d')](_0x3cd8d0['where'],{'$or':_[_0x08d8('0x2a')](_0x3cd8d0['attributes'],function(_0x480b3d){var _0x4e56d4={};_0x4e56d4[_0x480b3d]={'$like':'%'+_0x2cc458[_0x08d8('0x2f')][_0x08d8('0x3b')]+'%'};return _0x4e56d4;})});}_0x3cd8d0=_['merge']({},_0x3cd8d0,_0x2cc458[_0x08d8('0x40')]);return _0x51a139[_0x08d8('0x50')](_0x3cd8d0);}})[_0x08d8('0x44')](function(_0x25e1ed){if(_0x25e1ed){_0x10e70b=_0x25e1ed[_0x08d8('0x35')];if(!_0x2cc458[_0x08d8('0x2f')][_0x08d8('0x36')]('nolimit')){_0x3cd8d0[_0x08d8('0x1e')]=qs[_0x08d8('0x1e')](_0x2cc458['query'][_0x08d8('0x1e')]);_0x3cd8d0[_0x08d8('0x1b')]=qs['offset'](_0x2cc458[_0x08d8('0x2f')][_0x08d8('0x1b')]);}return _0x51a139[_0x08d8('0x50')](_0x3cd8d0);}})['then'](function(_0x3e1fbf){if(_0x3e1fbf){return _0x3e1fbf?{'count':_0x10e70b,'rows':_0x3e1fbf}:null;}})[_0x08d8('0x44')](respondWithResult(_0x2be5e4,null))[_0x08d8('0x46')](handleError(_0x2be5e4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 32ae05a..c1ebc2f 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 _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x39e76b,_0x334a02){var _0x1e1c27=function(_0x5b170d){while(--_0x5b170d){_0x39e76b['push'](_0x39e76b['shift']());}};_0x1e1c27(++_0x334a02);}(_0xb43b,0x1b2));var _0xbb43=function(_0x546be2,_0x22135f){_0x546be2=_0x546be2-0x0;var _0x35b1ed=_0xb43b[_0x546be2];return _0x35b1ed;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb821=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','bluebird'];(function(_0x1aff43,_0x5eb639){var _0x5e75d1=function(_0x3b0cf7){while(--_0x3b0cf7){_0x1aff43['push'](_0x1aff43['shift']());}};_0x5e75d1(++_0x5eb639);}(_0xb821,0xa7));var _0x1b82=function(_0x56fbae,_0x459d21){_0x56fbae=_0x56fbae-0x0;var _0x42dbea=_0xb821[_0x56fbae];return _0x42dbea;};'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 cc1b3c6..450cdee 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 _0x349a=['info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4bcf38,_0x3c12be){var _0x4a89be=function(_0x3215a6){while(--_0x3215a6){_0x4bcf38['push'](_0x4bcf38['shift']());}};_0x4a89be(++_0x3c12be);}(_0x349a,0xfb));var _0xa349=function(_0x2e890e,_0x1a22b7){_0x2e890e=_0x2e890e-0x0;var _0x5d2b7f=_0x349a[_0x2e890e];return _0x5d2b7f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa349('0x0'));var rs=require(_0xa349('0x1'));var fs=require('fs');var Redis=require(_0xa349('0x2'));var db=require(_0xa349('0x3'))['db'];var utils=require(_0xa349('0x4'));var logger=require(_0xa349('0x5'))(_0xa349('0x6'));var config=require(_0xa349('0x7'));var jayson=require(_0xa349('0x8'));var client=jayson[_0xa349('0x9')][_0xa349('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc900c3,_0x64a75d,_0x18e2fa){return new BPromise(function(_0x15f550,_0x527b8e){return client[_0xa349('0xb')](_0xc900c3,_0x18e2fa)[_0xa349('0xc')](function(_0x5e8000){logger[_0xa349('0xd')](_0xa349('0xe'),_0x64a75d,'request\x20sent');logger[_0xa349('0xf')](_0xa349('0x10'),_0x64a75d,_0xa349('0x11'),JSON[_0xa349('0x12')](_0x5e8000));if(_0x5e8000[_0xa349('0x13')]){if(_0x5e8000['error'][_0xa349('0x14')]===0x1f4){logger[_0xa349('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x64a75d,_0x5e8000[_0xa349('0x13')][_0xa349('0x15')]);return _0x527b8e(_0x5e8000[_0xa349('0x13')]['message']);}logger[_0xa349('0x13')](_0xa349('0xe'),_0x64a75d,_0x5e8000[_0xa349('0x13')][_0xa349('0x15')]);return _0x15f550(_0x5e8000[_0xa349('0x13')][_0xa349('0x15')]);}else{logger[_0xa349('0xd')](_0xa349('0xe'),_0x64a75d,_0xa349('0x11'));_0x15f550(_0x5e8000[_0xa349('0x16')][_0xa349('0x15')]);}})[_0xa349('0x17')](function(_0x4d7b2a){logger[_0xa349('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x64a75d,_0x4d7b2a);_0x527b8e(_0x4d7b2a);});});} \ No newline at end of file +var _0xd17d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xd17d,0x18d));var _0xdd17=function(_0x51adff,_0x57bb68){_0x51adff=_0x51adff-0x0;var _0x189348=_0xd17d[_0x51adff];return _0x189348;};'use strict';var _=require(_0xdd17('0x0'));var util=require(_0xdd17('0x1'));var moment=require(_0xdd17('0x2'));var BPromise=require(_0xdd17('0x3'));var rs=require(_0xdd17('0x4'));var fs=require('fs');var Redis=require(_0xdd17('0x5'));var db=require(_0xdd17('0x6'))['db'];var utils=require(_0xdd17('0x7'));var logger=require(_0xdd17('0x8'))(_0xdd17('0x9'));var config=require('../../config/environment');var jayson=require(_0xdd17('0xa'));var client=jayson[_0xdd17('0xb')][_0xdd17('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18e4d1,_0x3a95e4,_0x1e4d29){return new BPromise(function(_0x6ee143,_0x498d0a){return client['request'](_0x18e4d1,_0x1e4d29)[_0xdd17('0xd')](function(_0x241bc8){logger['info'](_0xdd17('0xe'),_0x3a95e4,_0xdd17('0xf'));logger[_0xdd17('0x10')](_0xdd17('0x11'),_0x3a95e4,_0xdd17('0xf'),JSON[_0xdd17('0x12')](_0x241bc8));if(_0x241bc8[_0xdd17('0x13')]){if(_0x241bc8['error'][_0xdd17('0x14')]===0x1f4){logger['error'](_0xdd17('0xe'),_0x3a95e4,_0x241bc8[_0xdd17('0x13')][_0xdd17('0x15')]);return _0x498d0a(_0x241bc8[_0xdd17('0x13')][_0xdd17('0x15')]);}logger[_0xdd17('0x13')](_0xdd17('0xe'),_0x3a95e4,_0x241bc8['error'][_0xdd17('0x15')]);return _0x6ee143(_0x241bc8['error'][_0xdd17('0x15')]);}else{logger[_0xdd17('0x16')](_0xdd17('0xe'),_0x3a95e4,'request\x20sent');_0x6ee143(_0x241bc8[_0xdd17('0x17')][_0xdd17('0x15')]);}})[_0xdd17('0x18')](function(_0x4aba72){logger[_0xdd17('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3a95e4,_0x4aba72);_0x498d0a(_0x4aba72);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 241e6e0..4ba252a 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 _0x7bb7=['index','get','/:id','show','post','isAuthenticated','put','update','delete','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bb7,0x9f));var _0x77bb=function(_0x1607bc,_0x4e9eb6){_0x1607bc=_0x1607bc-0x0;var _0x4369ca=_0x7bb7[_0x1607bc];return _0x4369ca;};'use strict';var multer=require('multer');var util=require(_0x77bb('0x0'));var path=require(_0x77bb('0x1'));var timeout=require(_0x77bb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x77bb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x77bb('0x4'));var config=require(_0x77bb('0x5'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x77bb('0x6')]);router[_0x77bb('0x7')](_0x77bb('0x8'),auth['isAuthenticated'](),controller[_0x77bb('0x9')]);router[_0x77bb('0xa')]('/',auth[_0x77bb('0xb')](),controller['create']);router[_0x77bb('0xc')](_0x77bb('0x8'),auth[_0x77bb('0xb')](),controller[_0x77bb('0xd')]);router[_0x77bb('0xe')]('/:id',auth[_0x77bb('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xac50=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','util'];(function(_0x2a81e8,_0xaf4f29){var _0x5da3c6=function(_0x5a3597){while(--_0x5a3597){_0x2a81e8['push'](_0x2a81e8['shift']());}};_0x5da3c6(++_0xaf4f29);}(_0xac50,0xe9));var _0x0ac5=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xac50[_0x307d86];return _0x361745;};'use strict';var multer=require('multer');var util=require(_0x0ac5('0x0'));var path=require(_0x0ac5('0x1'));var timeout=require(_0x0ac5('0x2'));var express=require(_0x0ac5('0x3'));var router=express[_0x0ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0ac5('0x5'));var interaction=require(_0x0ac5('0x6'));var config=require(_0x0ac5('0x7'));var controller=require(_0x0ac5('0x8'));router['get']('/',auth[_0x0ac5('0x9')](),controller[_0x0ac5('0xa')]);router['get'](_0x0ac5('0xb'),auth[_0x0ac5('0x9')](),controller[_0x0ac5('0xc')]);router[_0x0ac5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0ac5('0xe')](_0x0ac5('0xb'),auth[_0x0ac5('0x9')](),controller[_0x0ac5('0xf')]);router['delete']('/:id',auth[_0x0ac5('0x9')](),controller[_0x0ac5('0x10')]);module[_0x0ac5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index b5eb5fd..ea90023 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 _0xc8ac=['sequelize','exports','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0xc8ac,0x1dd));var _0xcc8a=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xc8ac[_0x284807];return _0x50c774;};'use strict';var Sequelize=require(_0xcc8a('0x0'));module[_0xcc8a('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcc8a('0x2'),'variable',_0xcc8a('0x3'),_0xcc8a('0x4'),_0xcc8a('0x5')),'defaultValue':_0xcc8a('0x2')},'content':{'type':Sequelize[_0xcc8a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xcc8a('0x2'),_0xcc8a('0x7'),_0xcc8a('0x3'))},'keyContent':{'type':Sequelize[_0xcc8a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xcc8a('0x6')]},'customField':{'type':Sequelize[_0xcc8a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcc8a('0x6')]}}; \ No newline at end of file +var _0x1ea5=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x272838,_0x5e7c15){var _0x1f43ef=function(_0xbc7b09){while(--_0xbc7b09){_0x272838['push'](_0x272838['shift']());}};_0x1f43ef(++_0x5e7c15);}(_0x1ea5,0x1c8));var _0x51ea=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x1ea5[_0x553150];return _0x18193d;};'use strict';var Sequelize=require(_0x51ea('0x0'));module[_0x51ea('0x1')]={'type':{'type':Sequelize[_0x51ea('0x2')](_0x51ea('0x3'),_0x51ea('0x4'),_0x51ea('0x5'),_0x51ea('0x6'),_0x51ea('0x7')),'defaultValue':_0x51ea('0x3')},'content':{'type':Sequelize[_0x51ea('0x8')]},'key':{'type':Sequelize[_0x51ea('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x51ea('0x3'),_0x51ea('0x4'),_0x51ea('0x5'))},'keyContent':{'type':Sequelize[_0x51ea('0x8')]},'idField':{'type':Sequelize[_0x51ea('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x51ea('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x51ea('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 3549c12..6c0b8cf 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 _0x82c9=['end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','create','body','find','destroy','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0xadd855,_0x313dd0){var _0x16a09f=function(_0x29693f){while(--_0x29693f){_0xadd855['push'](_0xadd855['shift']());}};_0x16a09f(++_0x313dd0);}(_0x82c9,0x7e));var _0x982c=function(_0x4810a6,_0x2f96a7){_0x4810a6=_0x4810a6-0x0;var _0x390f52=_0x82c9[_0x4810a6];return _0x390f52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x982c('0x0'));var zipdir=require(_0x982c('0x1'));var jsonpatch=require(_0x982c('0x2'));var rp=require(_0x982c('0x3'));var moment=require('moment');var BPromise=require(_0x982c('0x4'));var Mustache=require(_0x982c('0x5'));var util=require(_0x982c('0x6'));var path=require(_0x982c('0x7'));var sox=require(_0x982c('0x8'));var csv=require(_0x982c('0x9'));var ejs=require(_0x982c('0xa'));var fs=require('fs');var fs_extra=require(_0x982c('0xb'));var _=require(_0x982c('0xc'));var squel=require('squel');var crypto=require(_0x982c('0xd'));var jsforce=require(_0x982c('0xe'));var deskjs=require(_0x982c('0xf'));var toCsv=require(_0x982c('0x9'));var querystring=require(_0x982c('0x10'));var Papa=require(_0x982c('0x11'));var Redis=require(_0x982c('0x12'));var authService=require(_0x982c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x982c('0x14'));var hardwareService=require(_0x982c('0x15'));var logger=require(_0x982c('0x16'))(_0x982c('0x17'));var utils=require(_0x982c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x982c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb08ce9,_0x4e7f0d){_0x4e7f0d=_0x4e7f0d||0xcc;return function(_0x577312){if(_0x577312){return _0xb08ce9[_0x982c('0x1a')](_0x4e7f0d);}return _0xb08ce9[_0x982c('0x1b')](_0x4e7f0d)[_0x982c('0x1c')]();};}function respondWithResult(_0x550615,_0x53a436){_0x53a436=_0x53a436||0xc8;return function(_0x59e832){if(_0x59e832){return _0x550615['status'](_0x53a436)[_0x982c('0x1d')](_0x59e832);}};}function respondWithFilteredResult(_0x1cd380,_0x18abaa){return function(_0x30f9c4){if(_0x30f9c4){var _0x4ce9c0=typeof _0x18abaa[_0x982c('0x1e')]===_0x982c('0x1f')&&typeof _0x18abaa[_0x982c('0x20')]===_0x982c('0x1f');var _0x52b61f=_0x30f9c4[_0x982c('0x21')];var _0x252e65=_0x4ce9c0?0x0:_0x18abaa['offset'];var _0x1b0f46=_0x4ce9c0?_0x30f9c4['count']:_0x18abaa['offset']+_0x18abaa[_0x982c('0x20')];var _0x1c7950;if(_0x1b0f46>=_0x52b61f){_0x1b0f46=_0x52b61f;_0x1c7950=0xc8;}else{_0x1c7950=0xce;}_0x1cd380[_0x982c('0x1b')](_0x1c7950);return _0x1cd380[_0x982c('0x22')]('Content-Range',_0x252e65+'-'+_0x1b0f46+'/'+_0x52b61f)[_0x982c('0x1d')](_0x30f9c4);}return null;};}function patchUpdates(_0x1ca382){return function(_0x26f945){try{jsonpatch[_0x982c('0x23')](_0x26f945,_0x1ca382,!![]);}catch(_0x53994f){return BPromise[_0x982c('0x24')](_0x53994f);}return _0x26f945[_0x982c('0x25')]();};}function saveUpdates(_0x1badf8,_0xb975f6){return function(_0x31d206){if(_0x31d206){return _0x31d206[_0x982c('0x26')](_0x1badf8)[_0x982c('0x27')](function(_0x479bbc){return _0x479bbc;});}return null;};}function removeEntity(_0x38f0fb,_0x235c8c){return function(_0x42dfda){if(_0x42dfda){return _0x42dfda['destroy']()[_0x982c('0x27')](function(){_0x38f0fb[_0x982c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cdeb8,_0x1392e8){return function(_0x54ff15){if(!_0x54ff15){_0x5cdeb8[_0x982c('0x1a')](0x194);}return _0x54ff15;};}function handleError(_0x289765,_0x51aad1){_0x51aad1=_0x51aad1||0x1f4;return function(_0x13aa79){logger['error'](_0x13aa79[_0x982c('0x28')]);if(_0x13aa79['name']){delete _0x13aa79[_0x982c('0x29')];}_0x289765[_0x982c('0x1b')](_0x51aad1)[_0x982c('0x2a')](_0x13aa79);};}exports[_0x982c('0x2b')]=function(_0x459ba6,_0x2a5d93){var _0xf14a85={},_0x49d256={},_0x44a40d={'count':0x0,'rows':[]};var _0x5ccc5d=_[_0x982c('0x2c')](db[_0x982c('0x2d')][_0x982c('0x2e')],function(_0x154f53){return{'name':_0x154f53[_0x982c('0x2f')],'type':_0x154f53['type']['key']};});_0x49d256[_0x982c('0x30')]=_[_0x982c('0x2c')](_0x5ccc5d,_0x982c('0x29'));_0x49d256['query']=_[_0x982c('0x31')](_0x459ba6[_0x982c('0x32')]);_0x49d256[_0x982c('0x33')]=_[_0x982c('0x34')](_0x49d256['model'],_0x49d256['query']);_0xf14a85[_0x982c('0x35')]=_[_0x982c('0x34')](_0x49d256[_0x982c('0x30')],qs[_0x982c('0x36')](_0x459ba6[_0x982c('0x32')][_0x982c('0x36')]));_0xf14a85[_0x982c('0x35')]=_0xf14a85[_0x982c('0x35')]['length']?_0xf14a85[_0x982c('0x35')]:_0x49d256['model'];if(!_0x459ba6[_0x982c('0x32')][_0x982c('0x37')](_0x982c('0x38'))){_0xf14a85['limit']=qs[_0x982c('0x20')](_0x459ba6[_0x982c('0x32')][_0x982c('0x20')]);_0xf14a85[_0x982c('0x1e')]=qs[_0x982c('0x1e')](_0x459ba6[_0x982c('0x32')][_0x982c('0x1e')]);}_0xf14a85[_0x982c('0x39')]=qs[_0x982c('0x3a')](_0x459ba6[_0x982c('0x32')][_0x982c('0x3a')]);_0xf14a85[_0x982c('0x3b')]=qs[_0x982c('0x33')](_[_0x982c('0x3c')](_0x459ba6[_0x982c('0x32')],_0x49d256['filters']),_0x5ccc5d);if(_0x459ba6[_0x982c('0x32')]['filter']){_0xf14a85['where']=_[_0x982c('0x3d')](_0xf14a85[_0x982c('0x3b')],{'$or':_[_0x982c('0x2c')](_0x5ccc5d,function(_0x2a22ef){if(_0x2a22ef[_0x982c('0x3e')]!==_0x982c('0x3f')){var _0x303521={};_0x303521[_0x2a22ef[_0x982c('0x29')]]={'$like':'%'+_0x459ba6[_0x982c('0x32')][_0x982c('0x40')]+'%'};return _0x303521;}})});}_0xf14a85=_[_0x982c('0x3d')]({},_0xf14a85,_0x459ba6[_0x982c('0x41')]);var _0x45437c={'where':_0xf14a85['where']};return db['Dynamics365Field'][_0x982c('0x21')](_0x45437c)[_0x982c('0x27')](function(_0x1108bd){_0x44a40d['count']=_0x1108bd;if(_0x459ba6[_0x982c('0x32')][_0x982c('0x42')]){_0xf14a85[_0x982c('0x43')]=[{'all':!![]}];}return db[_0x982c('0x2d')]['findAll'](_0xf14a85);})[_0x982c('0x27')](function(_0xd1a59e){_0x44a40d[_0x982c('0x44')]=_0xd1a59e;return _0x44a40d;})[_0x982c('0x27')](respondWithFilteredResult(_0x2a5d93,_0xf14a85))[_0x982c('0x45')](handleError(_0x2a5d93,null));};exports[_0x982c('0x46')]=function(_0x27d7e3,_0x20f16b){var _0x1683c8={'raw':!![],'where':{'id':_0x27d7e3[_0x982c('0x47')]['id']}},_0x16310d={};_0x16310d[_0x982c('0x30')]=_[_0x982c('0x31')](db['Dynamics365Field'][_0x982c('0x2e')]);_0x16310d[_0x982c('0x32')]=_[_0x982c('0x31')](_0x27d7e3[_0x982c('0x32')]);_0x16310d[_0x982c('0x33')]=_['intersection'](_0x16310d[_0x982c('0x30')],_0x16310d[_0x982c('0x32')]);_0x1683c8[_0x982c('0x35')]=_[_0x982c('0x34')](_0x16310d[_0x982c('0x30')],qs[_0x982c('0x36')](_0x27d7e3[_0x982c('0x32')]['fields']));_0x1683c8[_0x982c('0x35')]=_0x1683c8['attributes'][_0x982c('0x48')]?_0x1683c8['attributes']:_0x16310d[_0x982c('0x30')];if(_0x27d7e3['query'][_0x982c('0x42')]){_0x1683c8['include']=[{'all':!![]}];}_0x1683c8=_[_0x982c('0x3d')]({},_0x1683c8,_0x27d7e3[_0x982c('0x41')]);return db['Dynamics365Field']['find'](_0x1683c8)[_0x982c('0x27')](handleEntityNotFound(_0x20f16b,null))['then'](respondWithResult(_0x20f16b,null))[_0x982c('0x45')](handleError(_0x20f16b,null));};exports[_0x982c('0x49')]=function(_0x5cac25,_0x2a0420){return db[_0x982c('0x2d')][_0x982c('0x49')](_0x5cac25[_0x982c('0x4a')],{})[_0x982c('0x27')](respondWithResult(_0x2a0420,0xc9))[_0x982c('0x45')](handleError(_0x2a0420,null));};exports[_0x982c('0x26')]=function(_0x1af0aa,_0x587ac0){if(_0x1af0aa[_0x982c('0x4a')]['id']){delete _0x1af0aa[_0x982c('0x4a')]['id'];}return db[_0x982c('0x2d')][_0x982c('0x4b')]({'where':{'id':_0x1af0aa['params']['id']}})[_0x982c('0x27')](handleEntityNotFound(_0x587ac0,null))[_0x982c('0x27')](saveUpdates(_0x1af0aa[_0x982c('0x4a')],null))[_0x982c('0x27')](respondWithResult(_0x587ac0,null))[_0x982c('0x45')](handleError(_0x587ac0,null));};exports[_0x982c('0x4c')]=function(_0x12fa09,_0x1f2a86){return db[_0x982c('0x2d')][_0x982c('0x4b')]({'where':{'id':_0x12fa09[_0x982c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f2a86,null))['then'](removeEntity(_0x1f2a86,null))['catch'](handleError(_0x1f2a86,null));}; \ No newline at end of file +var _0x820a=['save','update','then','destroy','end','sendStatus','stack','name','send','index','Dynamics365Field','fieldName','type','key','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','model','rawAttributes','length','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply'];(function(_0x515cff,_0x27d4a5){var _0x419c0e=function(_0x4a0ad2){while(--_0x4a0ad2){_0x515cff['push'](_0x515cff['shift']());}};_0x419c0e(++_0x27d4a5);}(_0x820a,0x19a));var _0xa820=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x820a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa820('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa820('0x1'));var jsonpatch=require(_0xa820('0x2'));var rp=require(_0xa820('0x3'));var moment=require(_0xa820('0x4'));var BPromise=require(_0xa820('0x5'));var Mustache=require(_0xa820('0x6'));var util=require(_0xa820('0x7'));var path=require(_0xa820('0x8'));var sox=require(_0xa820('0x9'));var csv=require(_0xa820('0xa'));var ejs=require(_0xa820('0xb'));var fs=require('fs');var fs_extra=require(_0xa820('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa820('0xd'));var deskjs=require(_0xa820('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa820('0xf'));var Papa=require(_0xa820('0x10'));var Redis=require('ioredis');var authService=require(_0xa820('0x11'));var qs=require(_0xa820('0x12'));var as=require(_0xa820('0x13'));var hardwareService=require(_0xa820('0x14'));var logger=require('../../config/logger')(_0xa820('0x15'));var utils=require('../../config/utils');var config=require(_0xa820('0x16'));var licenseUtil=require(_0xa820('0x17'));var db=require(_0xa820('0x18'))['db'];function respondWithStatusCode(_0x56edcd,_0x1c8ff2){_0x1c8ff2=_0x1c8ff2||0xcc;return function(_0x58f6fa){if(_0x58f6fa){return _0x56edcd['sendStatus'](_0x1c8ff2);}return _0x56edcd[_0xa820('0x19')](_0x1c8ff2)['end']();};}function respondWithResult(_0x4417a0,_0x371c92){_0x371c92=_0x371c92||0xc8;return function(_0x33c055){if(_0x33c055){return _0x4417a0['status'](_0x371c92)['json'](_0x33c055);}};}function respondWithFilteredResult(_0x530806,_0x3e2606){return function(_0x528a21){if(_0x528a21){var _0x4352a7=typeof _0x3e2606[_0xa820('0x1a')]==='undefined'&&typeof _0x3e2606[_0xa820('0x1b')]===_0xa820('0x1c');var _0x2b00af=_0x528a21[_0xa820('0x1d')];var _0x159de5=_0x4352a7?0x0:_0x3e2606[_0xa820('0x1a')];var _0x480b7e=_0x4352a7?_0x528a21['count']:_0x3e2606[_0xa820('0x1a')]+_0x3e2606[_0xa820('0x1b')];var _0x33cb93;if(_0x480b7e>=_0x2b00af){_0x480b7e=_0x2b00af;_0x33cb93=0xc8;}else{_0x33cb93=0xce;}_0x530806[_0xa820('0x19')](_0x33cb93);return _0x530806[_0xa820('0x1e')](_0xa820('0x1f'),_0x159de5+'-'+_0x480b7e+'/'+_0x2b00af)[_0xa820('0x20')](_0x528a21);}return null;};}function patchUpdates(_0x45f42e){return function(_0x3a554f){try{jsonpatch[_0xa820('0x21')](_0x3a554f,_0x45f42e,!![]);}catch(_0x4db6b7){return BPromise['reject'](_0x4db6b7);}return _0x3a554f[_0xa820('0x22')]();};}function saveUpdates(_0x2df97e,_0xd6b851){return function(_0x3ab92e){if(_0x3ab92e){return _0x3ab92e[_0xa820('0x23')](_0x2df97e)[_0xa820('0x24')](function(_0x154a1d){return _0x154a1d;});}return null;};}function removeEntity(_0xa54ad1,_0x148cb3){return function(_0x4dd94c){if(_0x4dd94c){return _0x4dd94c[_0xa820('0x25')]()[_0xa820('0x24')](function(){_0xa54ad1[_0xa820('0x19')](0xcc)[_0xa820('0x26')]();});}};}function handleEntityNotFound(_0x4de328,_0xafb9cd){return function(_0x59c542){if(!_0x59c542){_0x4de328[_0xa820('0x27')](0x194);}return _0x59c542;};}function handleError(_0x401506,_0x197f89){_0x197f89=_0x197f89||0x1f4;return function(_0x364fa6){logger['error'](_0x364fa6[_0xa820('0x28')]);if(_0x364fa6['name']){delete _0x364fa6[_0xa820('0x29')];}_0x401506[_0xa820('0x19')](_0x197f89)[_0xa820('0x2a')](_0x364fa6);};}exports[_0xa820('0x2b')]=function(_0x30c4dd,_0x3f81e5){var _0x151c8f={},_0x48e74d={},_0x5282db={'count':0x0,'rows':[]};var _0x1fbc42=_['map'](db[_0xa820('0x2c')]['rawAttributes'],function(_0x149f2b){return{'name':_0x149f2b[_0xa820('0x2d')],'type':_0x149f2b[_0xa820('0x2e')][_0xa820('0x2f')]};});_0x48e74d['model']=_[_0xa820('0x30')](_0x1fbc42,'name');_0x48e74d['query']=_[_0xa820('0x31')](_0x30c4dd[_0xa820('0x32')]);_0x48e74d[_0xa820('0x33')]=_[_0xa820('0x34')](_0x48e74d['model'],_0x48e74d[_0xa820('0x32')]);_0x151c8f[_0xa820('0x35')]=_[_0xa820('0x34')](_0x48e74d['model'],qs[_0xa820('0x36')](_0x30c4dd[_0xa820('0x32')][_0xa820('0x36')]));_0x151c8f[_0xa820('0x35')]=_0x151c8f[_0xa820('0x35')]['length']?_0x151c8f['attributes']:_0x48e74d['model'];if(!_0x30c4dd[_0xa820('0x32')][_0xa820('0x37')]('nolimit')){_0x151c8f[_0xa820('0x1b')]=qs[_0xa820('0x1b')](_0x30c4dd['query'][_0xa820('0x1b')]);_0x151c8f['offset']=qs[_0xa820('0x1a')](_0x30c4dd['query'][_0xa820('0x1a')]);}_0x151c8f[_0xa820('0x38')]=qs['sort'](_0x30c4dd['query'][_0xa820('0x39')]);_0x151c8f[_0xa820('0x3a')]=qs[_0xa820('0x33')](_[_0xa820('0x3b')](_0x30c4dd[_0xa820('0x32')],_0x48e74d[_0xa820('0x33')]),_0x1fbc42);if(_0x30c4dd[_0xa820('0x32')][_0xa820('0x3c')]){_0x151c8f[_0xa820('0x3a')]=_[_0xa820('0x3d')](_0x151c8f['where'],{'$or':_[_0xa820('0x30')](_0x1fbc42,function(_0x1e719f){if(_0x1e719f['type']!=='VIRTUAL'){var _0x46b272={};_0x46b272[_0x1e719f['name']]={'$like':'%'+_0x30c4dd[_0xa820('0x32')][_0xa820('0x3c')]+'%'};return _0x46b272;}})});}_0x151c8f=_[_0xa820('0x3d')]({},_0x151c8f,_0x30c4dd[_0xa820('0x3e')]);var _0xd0bc6c={'where':_0x151c8f[_0xa820('0x3a')]};return db[_0xa820('0x2c')][_0xa820('0x1d')](_0xd0bc6c)['then'](function(_0x5b771a){_0x5282db[_0xa820('0x1d')]=_0x5b771a;if(_0x30c4dd[_0xa820('0x32')][_0xa820('0x3f')]){_0x151c8f[_0xa820('0x40')]=[{'all':!![]}];}return db[_0xa820('0x2c')]['findAll'](_0x151c8f);})[_0xa820('0x24')](function(_0x30f924){_0x5282db[_0xa820('0x41')]=_0x30f924;return _0x5282db;})['then'](respondWithFilteredResult(_0x3f81e5,_0x151c8f))[_0xa820('0x42')](handleError(_0x3f81e5,null));};exports['show']=function(_0x2f74e8,_0x29763f){var _0x26adac={'raw':!![],'where':{'id':_0x2f74e8['params']['id']}},_0x405eca={};_0x405eca[_0xa820('0x43')]=_[_0xa820('0x31')](db[_0xa820('0x2c')][_0xa820('0x44')]);_0x405eca[_0xa820('0x32')]=_['keys'](_0x2f74e8[_0xa820('0x32')]);_0x405eca[_0xa820('0x33')]=_[_0xa820('0x34')](_0x405eca[_0xa820('0x43')],_0x405eca[_0xa820('0x32')]);_0x26adac[_0xa820('0x35')]=_[_0xa820('0x34')](_0x405eca[_0xa820('0x43')],qs['fields'](_0x2f74e8['query'][_0xa820('0x36')]));_0x26adac['attributes']=_0x26adac[_0xa820('0x35')][_0xa820('0x45')]?_0x26adac['attributes']:_0x405eca[_0xa820('0x43')];if(_0x2f74e8[_0xa820('0x32')][_0xa820('0x3f')]){_0x26adac[_0xa820('0x40')]=[{'all':!![]}];}_0x26adac=_[_0xa820('0x3d')]({},_0x26adac,_0x2f74e8[_0xa820('0x3e')]);return db[_0xa820('0x2c')][_0xa820('0x46')](_0x26adac)[_0xa820('0x24')](handleEntityNotFound(_0x29763f,null))[_0xa820('0x24')](respondWithResult(_0x29763f,null))['catch'](handleError(_0x29763f,null));};exports[_0xa820('0x47')]=function(_0x3a576d,_0x13a520){return db['Dynamics365Field'][_0xa820('0x47')](_0x3a576d[_0xa820('0x48')],{})[_0xa820('0x24')](respondWithResult(_0x13a520,0xc9))[_0xa820('0x42')](handleError(_0x13a520,null));};exports['update']=function(_0x3ac9ce,_0x363848){if(_0x3ac9ce['body']['id']){delete _0x3ac9ce[_0xa820('0x48')]['id'];}return db[_0xa820('0x2c')][_0xa820('0x46')]({'where':{'id':_0x3ac9ce[_0xa820('0x49')]['id']}})[_0xa820('0x24')](handleEntityNotFound(_0x363848,null))[_0xa820('0x24')](saveUpdates(_0x3ac9ce[_0xa820('0x48')],null))[_0xa820('0x24')](respondWithResult(_0x363848,null))[_0xa820('0x42')](handleError(_0x363848,null));};exports[_0xa820('0x25')]=function(_0x1fe317,_0x128296){return db[_0xa820('0x2c')][_0xa820('0x46')]({'where':{'id':_0x1fe317['params']['id']}})['then'](handleEntityNotFound(_0x128296,null))[_0xa820('0x24')](removeEntity(_0x128296,null))['catch'](handleError(_0x128296,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index a234162..90b2a9b 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 _0xc634=['int_dynamics365_fields','idField','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0xc634,0x1e3));var _0x4c63=function(_0xb6afe,_0x38671f){_0xb6afe=_0xb6afe-0x0;var _0x335218=_0xc634[_0xb6afe];return _0x335218;};'use strict';var _=require(_0x4c63('0x0'));var util=require(_0x4c63('0x1'));var logger=require('../../config/logger')(_0x4c63('0x2'));var moment=require('moment');var BPromise=require(_0x4c63('0x3'));var rp=require(_0x4c63('0x4'));var fs=require('fs');var path=require(_0x4c63('0x5'));var rimraf=require(_0x4c63('0x6'));var config=require(_0x4c63('0x7'));var attributes=require(_0x4c63('0x8'));module[_0x4c63('0x9')]=function(_0x1c08ad,_0x4dfe45){return _0x1c08ad[_0x4c63('0xa')](_0x4c63('0xb'),attributes,{'tableName':_0x4c63('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x4c63('0xd'),_0x4c63('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ef3=['idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0ef3,0xb2));var _0x30ef=function(_0x425b10,_0xe4cbbe){_0x425b10=_0x425b10-0x0;var _0x1eecfe=_0x0ef3[_0x425b10];return _0x1eecfe;};'use strict';var _=require(_0x30ef('0x0'));var util=require(_0x30ef('0x1'));var logger=require(_0x30ef('0x2'))(_0x30ef('0x3'));var moment=require(_0x30ef('0x4'));var BPromise=require('bluebird');var rp=require(_0x30ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30ef('0x6'));var config=require(_0x30ef('0x7'));var attributes=require(_0x30ef('0x8'));module[_0x30ef('0x9')]=function(_0x61e06e,_0x313a15){return _0x61e06e[_0x30ef('0xa')](_0x30ef('0xb'),attributes,{'tableName':_0x30ef('0xc'),'paranoid':![],'indexes':[{'name':_0x30ef('0xd'),'fields':[_0x30ef('0xe'),_0x30ef('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index e735c24..257948d 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 _0xc2e2=['client','http','request','info','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59039b,_0x16eb8e){var _0x237a97=function(_0x2ef9f5){while(--_0x2ef9f5){_0x59039b['push'](_0x59039b['shift']());}};_0x237a97(++_0x16eb8e);}(_0xc2e2,0xa5));var _0x2c2e=function(_0xa308b0,_0x1e8523){_0xa308b0=_0xa308b0-0x0;var _0xdee9ea=_0xc2e2[_0xa308b0];return _0xdee9ea;};'use strict';var _=require(_0x2c2e('0x0'));var util=require(_0x2c2e('0x1'));var moment=require(_0x2c2e('0x2'));var BPromise=require(_0x2c2e('0x3'));var rs=require(_0x2c2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c2e('0x5'))['db'];var utils=require(_0x2c2e('0x6'));var logger=require(_0x2c2e('0x7'))(_0x2c2e('0x8'));var config=require(_0x2c2e('0x9'));var jayson=require(_0x2c2e('0xa'));var client=jayson[_0x2c2e('0xb')][_0x2c2e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49e2e7,_0x3ad54d,_0x17a64e){return new BPromise(function(_0x15d2e3,_0x185f7e){return client[_0x2c2e('0xd')](_0x49e2e7,_0x17a64e)['then'](function(_0x288ccd){logger[_0x2c2e('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x3ad54d,_0x2c2e('0xf'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3ad54d,_0x2c2e('0xf'),JSON[_0x2c2e('0x10')](_0x288ccd));if(_0x288ccd[_0x2c2e('0x11')]){if(_0x288ccd[_0x2c2e('0x11')][_0x2c2e('0x12')]===0x1f4){logger[_0x2c2e('0x11')](_0x2c2e('0x13'),_0x3ad54d,_0x288ccd[_0x2c2e('0x11')][_0x2c2e('0x14')]);return _0x185f7e(_0x288ccd[_0x2c2e('0x11')][_0x2c2e('0x14')]);}logger['error'](_0x2c2e('0x13'),_0x3ad54d,_0x288ccd[_0x2c2e('0x11')]['message']);return _0x15d2e3(_0x288ccd[_0x2c2e('0x11')][_0x2c2e('0x14')]);}else{logger[_0x2c2e('0xe')](_0x2c2e('0x13'),_0x3ad54d,_0x2c2e('0xf'));_0x15d2e3(_0x288ccd['result'][_0x2c2e('0x14')]);}})[_0x2c2e('0x15')](function(_0x1d067f){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3ad54d,_0x1d067f);_0x185f7e(_0x1d067f);});});} \ No newline at end of file +var _0xeafc=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x5dabee,_0x3bbe02){var _0x4d3bfe=function(_0x1f4f7a){while(--_0x1f4f7a){_0x5dabee['push'](_0x5dabee['shift']());}};_0x4d3bfe(++_0x3bbe02);}(_0xeafc,0x1b3));var _0xceaf=function(_0x5917af,_0x5b14b){_0x5917af=_0x5917af-0x0;var _0x263b6d=_0xeafc[_0x5917af];return _0x263b6d;};'use strict';var _=require(_0xceaf('0x0'));var util=require(_0xceaf('0x1'));var moment=require(_0xceaf('0x2'));var BPromise=require('bluebird');var rs=require(_0xceaf('0x3'));var fs=require('fs');var Redis=require(_0xceaf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xceaf('0x5'));var logger=require(_0xceaf('0x6'))(_0xceaf('0x7'));var config=require('../../config/environment');var jayson=require(_0xceaf('0x8'));var client=jayson[_0xceaf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b18f2,_0x1869bb,_0x37b3b3){return new BPromise(function(_0x16c9c6,_0x244074){return client[_0xceaf('0xa')](_0x3b18f2,_0x37b3b3)[_0xceaf('0xb')](function(_0x46a499){logger[_0xceaf('0xc')](_0xceaf('0xd'),_0x1869bb,_0xceaf('0xe'));logger[_0xceaf('0xf')](_0xceaf('0x10'),_0x1869bb,_0xceaf('0xe'),JSON[_0xceaf('0x11')](_0x46a499));if(_0x46a499[_0xceaf('0x12')]){if(_0x46a499[_0xceaf('0x12')]['code']===0x1f4){logger[_0xceaf('0x12')](_0xceaf('0xd'),_0x1869bb,_0x46a499['error'][_0xceaf('0x13')]);return _0x244074(_0x46a499[_0xceaf('0x12')][_0xceaf('0x13')]);}logger[_0xceaf('0x12')](_0xceaf('0xd'),_0x1869bb,_0x46a499[_0xceaf('0x12')][_0xceaf('0x13')]);return _0x16c9c6(_0x46a499[_0xceaf('0x12')][_0xceaf('0x13')]);}else{logger[_0xceaf('0xc')](_0xceaf('0xd'),_0x1869bb,_0xceaf('0xe'));_0x16c9c6(_0x46a499[_0xceaf('0x14')][_0xceaf('0x13')]);}})[_0xceaf('0x15')](function(_0x5ae4d5){logger[_0xceaf('0x12')](_0xceaf('0xd'),_0x1869bb,_0x5ae4d5);_0x244074(_0x5ae4d5);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 123e400..a11c3f0 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 _0xd4db=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0xd4db,0x15c));var _0xbd4d=function(_0x30f792,_0x47af26){_0x30f792=_0x30f792-0x0;var _0x450549=_0xd4db[_0x30f792];return _0x450549;};'use strict';var multer=require(_0xbd4d('0x0'));var util=require('util');var path=require(_0xbd4d('0x1'));var timeout=require(_0xbd4d('0x2'));var express=require(_0xbd4d('0x3'));var router=express[_0xbd4d('0x4')]();var fs_extra=require(_0xbd4d('0x5'));var auth=require(_0xbd4d('0x6'));var interaction=require(_0xbd4d('0x7'));var config=require(_0xbd4d('0x8'));var controller=require(_0xbd4d('0x9'));router[_0xbd4d('0xa')]('/',auth[_0xbd4d('0xb')](),controller[_0xbd4d('0xc')]);router['get'](_0xbd4d('0xd'),auth[_0xbd4d('0xb')](),controller[_0xbd4d('0xe')]);router[_0xbd4d('0xa')](_0xbd4d('0xf'),auth['isAuthenticated'](),controller[_0xbd4d('0x10')]);router['get'](_0xbd4d('0x11'),auth[_0xbd4d('0xb')](),controller[_0xbd4d('0x12')]);router[_0xbd4d('0x13')]('/',auth[_0xbd4d('0xb')](),controller[_0xbd4d('0x14')]);router[_0xbd4d('0x13')](_0xbd4d('0xf'),auth['isAuthenticated'](),controller[_0xbd4d('0x15')]);router[_0xbd4d('0x16')](_0xbd4d('0xd'),auth['isAuthenticated'](),controller[_0xbd4d('0x17')]);router[_0xbd4d('0x18')]('/:id',auth[_0xbd4d('0xb')](),controller[_0xbd4d('0x19')]);module['exports']=router; \ No newline at end of file +var _0x42ba=['exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','post','addConfiguration','put','update'];(function(_0x5609cb,_0x29805e){var _0x12e219=function(_0x3bb394){while(--_0x3bb394){_0x5609cb['push'](_0x5609cb['shift']());}};_0x12e219(++_0x29805e);}(_0x42ba,0x19f));var _0xa42b=function(_0x5d28db,_0x502e16){_0x5d28db=_0x5d28db-0x0;var _0x4fea30=_0x42ba[_0x5d28db];return _0x4fea30;};'use strict';var multer=require(_0xa42b('0x0'));var util=require('util');var path=require(_0xa42b('0x1'));var timeout=require(_0xa42b('0x2'));var express=require('express');var router=express[_0xa42b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa42b('0x4'));var config=require(_0xa42b('0x5'));var controller=require(_0xa42b('0x6'));router[_0xa42b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa42b('0x8'),auth['isAuthenticated'](),controller[_0xa42b('0x9')]);router[_0xa42b('0x7')](_0xa42b('0xa'),auth[_0xa42b('0xb')](),controller[_0xa42b('0xc')]);router['get']('/:id/fields',auth[_0xa42b('0xb')](),controller['getFields']);router[_0xa42b('0xd')]('/',auth[_0xa42b('0xb')](),controller['create']);router['post']('/:id/configurations',auth[_0xa42b('0xb')](),controller[_0xa42b('0xe')]);router[_0xa42b('0xf')](_0xa42b('0x8'),auth[_0xa42b('0xb')](),controller[_0xa42b('0x10')]);router['delete'](_0xa42b('0x8'),auth[_0xa42b('0xb')](),controller['destroy']);module[_0xa42b('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 238f27d..bf375f0 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 _0x955f=['exports','STRING','sequelize'];(function(_0x101e72,_0x5111ae){var _0x4d3247=function(_0x3e5185){while(--_0x3e5185){_0x101e72['push'](_0x101e72['shift']());}};_0x4d3247(++_0x5111ae);}(_0x955f,0x1eb));var _0xf955=function(_0x494ad5,_0x15cbe7){_0x494ad5=_0x494ad5-0x0;var _0x317a56=_0x955f[_0x494ad5];return _0x317a56;};'use strict';var Sequelize=require(_0xf955('0x0'));module[_0xf955('0x1')]={'name':{'type':Sequelize[_0xf955('0x2')]},'description':{'type':Sequelize[_0xf955('0x2')]},'username':{'type':Sequelize[_0xf955('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xf955('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf955('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0x46a691,_0x4ddf8f){var _0x16854d=function(_0x193560){while(--_0x193560){_0x46a691['push'](_0x46a691['shift']());}};_0x16854d(++_0x4ddf8f);}(_0x5464,0x15d));var _0x4546=function(_0x1d2414,_0x391932){_0x1d2414=_0x1d2414-0x0;var _0x51dcef=_0x5464[_0x1d2414];return _0x51dcef;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 61ff5df..b400f26 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 _0xee11=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','reject','save','update','then','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','params','keys','find','catch','create','body','destroy','getConfigurations','FreshdeskConfiguration','nolimit','findOne','AccountId','Subjects','channel','Descriptions','FreshdeskField','remoteUri','slice','substring','format','%s/%s','%s:X','apiKey','toString','base64','requester','subject','agent','description','priority','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format'];(function(_0x5077a1,_0x4ece5f){var _0x31dcb2=function(_0x4c83df){while(--_0x4c83df){_0x5077a1['push'](_0x5077a1['shift']());}};_0x31dcb2(++_0x4ece5f);}(_0xee11,0x146));var _0x1ee1=function(_0x580730,_0x423233){_0x580730=_0x580730-0x0;var _0xf5629a=_0xee11[_0x580730];return _0xf5629a;};'use strict';var emlformat=require(_0x1ee1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ee1('0x1'));var rp=require(_0x1ee1('0x2'));var moment=require(_0x1ee1('0x3'));var BPromise=require(_0x1ee1('0x4'));var Mustache=require(_0x1ee1('0x5'));var util=require(_0x1ee1('0x6'));var path=require(_0x1ee1('0x7'));var sox=require(_0x1ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x1ee1('0x9'));var fs=require('fs');var fs_extra=require(_0x1ee1('0xa'));var _=require(_0x1ee1('0xb'));var squel=require(_0x1ee1('0xc'));var crypto=require(_0x1ee1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ee1('0xe'));var querystring=require(_0x1ee1('0xf'));var Papa=require(_0x1ee1('0x10'));var Redis=require(_0x1ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ee1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ee1('0x13'));var logger=require(_0x1ee1('0x14'))(_0x1ee1('0x15'));var utils=require(_0x1ee1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1ee1('0x17'));var db=require(_0x1ee1('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x35d97c,_0xc2b64e){_0xc2b64e=_0xc2b64e||0xcc;return function(_0x97cc85){if(_0x97cc85){return _0x35d97c[_0x1ee1('0x19')](_0xc2b64e);}return _0x35d97c[_0x1ee1('0x1a')](_0xc2b64e)[_0x1ee1('0x1b')]();};}function respondWithResult(_0x1a23e4,_0xbc8577){_0xbc8577=_0xbc8577||0xc8;return function(_0x2f4c8d){if(_0x2f4c8d){return _0x1a23e4[_0x1ee1('0x1a')](_0xbc8577)[_0x1ee1('0x1c')](_0x2f4c8d);}};}function respondWithFilteredResult(_0x443dff,_0x3c64f1){return function(_0x3a19db){if(_0x3a19db){var _0x4828ba=typeof _0x3c64f1['offset']===_0x1ee1('0x1d')&&typeof _0x3c64f1[_0x1ee1('0x1e')]===_0x1ee1('0x1d');var _0x2752ba=_0x3a19db[_0x1ee1('0x1f')];var _0xff3d76=_0x4828ba?0x0:_0x3c64f1['offset'];var _0x39229e=_0x4828ba?_0x3a19db[_0x1ee1('0x1f')]:_0x3c64f1['offset']+_0x3c64f1[_0x1ee1('0x1e')];var _0xa5ec64;if(_0x39229e>=_0x2752ba){_0x39229e=_0x2752ba;_0xa5ec64=0xc8;}else{_0xa5ec64=0xce;}_0x443dff['status'](_0xa5ec64);return _0x443dff['set'](_0x1ee1('0x20'),_0xff3d76+'-'+_0x39229e+'/'+_0x2752ba)[_0x1ee1('0x1c')](_0x3a19db);}return null;};}function patchUpdates(_0x6f623){return function(_0x39fd57){try{jsonpatch['apply'](_0x39fd57,_0x6f623,!![]);}catch(_0x1c3851){return BPromise[_0x1ee1('0x21')](_0x1c3851);}return _0x39fd57[_0x1ee1('0x22')]();};}function saveUpdates(_0x5093ff,_0x1a27c4){return function(_0x277cd8){if(_0x277cd8){return _0x277cd8[_0x1ee1('0x23')](_0x5093ff)[_0x1ee1('0x24')](function(_0x21073e){return _0x21073e;});}return null;};}function removeEntity(_0x353542,_0x55921f){return function(_0x1142fd){if(_0x1142fd){return _0x1142fd['destroy']()['then'](function(){_0x353542[_0x1ee1('0x1a')](0xcc)[_0x1ee1('0x1b')]();});}};}function handleEntityNotFound(_0x585e51,_0x29df0b){return function(_0x1a90b3){if(!_0x1a90b3){_0x585e51[_0x1ee1('0x19')](0x194);}return _0x1a90b3;};}function handleError(_0x31ede7,_0x129232){_0x129232=_0x129232||0x1f4;return function(_0x12c583){logger['error'](_0x12c583[_0x1ee1('0x25')]);if(_0x12c583[_0x1ee1('0x26')]){delete _0x12c583[_0x1ee1('0x26')];}_0x31ede7[_0x1ee1('0x1a')](_0x129232)[_0x1ee1('0x27')](_0x12c583);};}exports[_0x1ee1('0x28')]=function(_0x551e9d,_0x19e4cc){var _0x576bf4={},_0x1fab9d={},_0x153731={'count':0x0,'rows':[]};var _0x5cf5a6=_['map'](db[_0x1ee1('0x29')][_0x1ee1('0x2a')],function(_0xf63d67){return{'name':_0xf63d67[_0x1ee1('0x2b')],'type':_0xf63d67['type']['key']};});_0x1fab9d[_0x1ee1('0x2c')]=_[_0x1ee1('0x2d')](_0x5cf5a6,_0x1ee1('0x26'));_0x1fab9d[_0x1ee1('0x2e')]=_['keys'](_0x551e9d['query']);_0x1fab9d[_0x1ee1('0x2f')]=_['intersection'](_0x1fab9d[_0x1ee1('0x2c')],_0x1fab9d[_0x1ee1('0x2e')]);_0x576bf4['attributes']=_[_0x1ee1('0x30')](_0x1fab9d['model'],qs[_0x1ee1('0x31')](_0x551e9d['query'][_0x1ee1('0x31')]));_0x576bf4['attributes']=_0x576bf4[_0x1ee1('0x32')][_0x1ee1('0x33')]?_0x576bf4['attributes']:_0x1fab9d[_0x1ee1('0x2c')];if(!_0x551e9d[_0x1ee1('0x2e')][_0x1ee1('0x34')]('nolimit')){_0x576bf4[_0x1ee1('0x1e')]=qs[_0x1ee1('0x1e')](_0x551e9d[_0x1ee1('0x2e')][_0x1ee1('0x1e')]);_0x576bf4[_0x1ee1('0x35')]=qs[_0x1ee1('0x35')](_0x551e9d[_0x1ee1('0x2e')][_0x1ee1('0x35')]);}_0x576bf4[_0x1ee1('0x36')]=qs[_0x1ee1('0x37')](_0x551e9d[_0x1ee1('0x2e')][_0x1ee1('0x37')]);_0x576bf4[_0x1ee1('0x38')]=qs[_0x1ee1('0x2f')](_[_0x1ee1('0x39')](_0x551e9d[_0x1ee1('0x2e')],_0x1fab9d[_0x1ee1('0x2f')]),_0x5cf5a6);if(_0x551e9d[_0x1ee1('0x2e')][_0x1ee1('0x3a')]){_0x576bf4[_0x1ee1('0x38')]=_[_0x1ee1('0x3b')](_0x576bf4[_0x1ee1('0x38')],{'$or':_['map'](_0x5cf5a6,function(_0x25788f){if(_0x25788f[_0x1ee1('0x3c')]!==_0x1ee1('0x3d')){var _0x14d787={};_0x14d787[_0x25788f[_0x1ee1('0x26')]]={'$like':'%'+_0x551e9d[_0x1ee1('0x2e')][_0x1ee1('0x3a')]+'%'};return _0x14d787;}})});}_0x576bf4=_[_0x1ee1('0x3b')]({},_0x576bf4,_0x551e9d[_0x1ee1('0x3e')]);var _0x2dc450={'where':_0x576bf4[_0x1ee1('0x38')]};return db[_0x1ee1('0x29')]['count'](_0x2dc450)[_0x1ee1('0x24')](function(_0x353867){_0x153731[_0x1ee1('0x1f')]=_0x353867;if(_0x551e9d[_0x1ee1('0x2e')][_0x1ee1('0x3f')]){_0x576bf4[_0x1ee1('0x40')]=[{'all':!![]}];}return db[_0x1ee1('0x29')]['findAll'](_0x576bf4);})[_0x1ee1('0x24')](function(_0x34c8cc){_0x153731['rows']=_0x34c8cc;return _0x153731;})[_0x1ee1('0x24')](respondWithFilteredResult(_0x19e4cc,_0x576bf4))['catch'](handleError(_0x19e4cc,null));};exports['show']=function(_0xf6708c,_0x4db4ef){var _0x5cc8a1={'raw':![],'where':{'id':_0xf6708c[_0x1ee1('0x41')]['id']}},_0x1b5f05={};_0x1b5f05[_0x1ee1('0x2c')]=_[_0x1ee1('0x42')](db[_0x1ee1('0x29')]['rawAttributes']);_0x1b5f05['query']=_[_0x1ee1('0x42')](_0xf6708c[_0x1ee1('0x2e')]);_0x1b5f05[_0x1ee1('0x2f')]=_[_0x1ee1('0x30')](_0x1b5f05[_0x1ee1('0x2c')],_0x1b5f05[_0x1ee1('0x2e')]);_0x5cc8a1[_0x1ee1('0x32')]=_['intersection'](_0x1b5f05[_0x1ee1('0x2c')],qs['fields'](_0xf6708c[_0x1ee1('0x2e')][_0x1ee1('0x31')]));_0x5cc8a1[_0x1ee1('0x32')]=_0x5cc8a1[_0x1ee1('0x32')][_0x1ee1('0x33')]?_0x5cc8a1[_0x1ee1('0x32')]:_0x1b5f05[_0x1ee1('0x2c')];if(_0xf6708c[_0x1ee1('0x2e')][_0x1ee1('0x3f')]){_0x5cc8a1[_0x1ee1('0x40')]=[{'all':!![]}];}_0x5cc8a1=_['merge']({},_0x5cc8a1,_0xf6708c[_0x1ee1('0x3e')]);return db[_0x1ee1('0x29')][_0x1ee1('0x43')](_0x5cc8a1)['then'](handleEntityNotFound(_0x4db4ef,null))[_0x1ee1('0x24')](respondWithResult(_0x4db4ef,null))[_0x1ee1('0x44')](handleError(_0x4db4ef,null));};exports[_0x1ee1('0x45')]=function(_0x4f965d,_0x8214cd){return db[_0x1ee1('0x29')][_0x1ee1('0x45')](_0x4f965d[_0x1ee1('0x46')],{})['then'](respondWithResult(_0x8214cd,0xc9))[_0x1ee1('0x44')](handleError(_0x8214cd,null));};exports[_0x1ee1('0x23')]=function(_0x12edad,_0x10c226){if(_0x12edad['body']['id']){delete _0x12edad['body']['id'];}return db[_0x1ee1('0x29')][_0x1ee1('0x43')]({'where':{'id':_0x12edad[_0x1ee1('0x41')]['id']}})[_0x1ee1('0x24')](handleEntityNotFound(_0x10c226,null))['then'](saveUpdates(_0x12edad[_0x1ee1('0x46')],null))[_0x1ee1('0x24')](respondWithResult(_0x10c226,null))['catch'](handleError(_0x10c226,null));};exports[_0x1ee1('0x47')]=function(_0x345991,_0x400c27){return db[_0x1ee1('0x29')][_0x1ee1('0x43')]({'where':{'id':_0x345991[_0x1ee1('0x41')]['id']}})['then'](handleEntityNotFound(_0x400c27,null))[_0x1ee1('0x24')](removeEntity(_0x400c27,null))[_0x1ee1('0x44')](handleError(_0x400c27,null));};exports[_0x1ee1('0x48')]=function(_0x223893,_0x3ffde3,_0x28051d){var _0x4b599d={};var _0x4fbb61={};var _0x41f3d3;var _0xe93945;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x223893[_0x1ee1('0x41')]['id']}})[_0x1ee1('0x24')](handleEntityNotFound(_0x3ffde3,null))[_0x1ee1('0x24')](function(_0x4af47b){if(_0x4af47b){_0x41f3d3=_0x4af47b;_0x4fbb61[_0x1ee1('0x2c')]=_[_0x1ee1('0x42')](db[_0x1ee1('0x49')][_0x1ee1('0x2a')]);_0x4fbb61[_0x1ee1('0x2e')]=_[_0x1ee1('0x42')](_0x223893[_0x1ee1('0x2e')]);_0x4fbb61[_0x1ee1('0x2f')]=_['intersection'](_0x4fbb61['model'],_0x4fbb61[_0x1ee1('0x2e')]);_0x4b599d['attributes']=_['intersection'](_0x4fbb61[_0x1ee1('0x2c')],qs['fields'](_0x223893['query'][_0x1ee1('0x31')]));_0x4b599d[_0x1ee1('0x32')]=_0x4b599d['attributes'][_0x1ee1('0x33')]?_0x4b599d['attributes']:_0x4fbb61[_0x1ee1('0x2c')];_0x4b599d[_0x1ee1('0x36')]=qs['sort'](_0x223893[_0x1ee1('0x2e')][_0x1ee1('0x37')]);_0x4b599d[_0x1ee1('0x38')]=qs[_0x1ee1('0x2f')](_[_0x1ee1('0x39')](_0x223893[_0x1ee1('0x2e')],_0x4fbb61[_0x1ee1('0x2f')]));if(_0x223893[_0x1ee1('0x2e')][_0x1ee1('0x3a')]){_0x4b599d[_0x1ee1('0x38')]=_[_0x1ee1('0x3b')](_0x4b599d[_0x1ee1('0x38')],{'$or':_['map'](_0x4b599d[_0x1ee1('0x32')],function(_0x173ba8){var _0x4ebf8e={};_0x4ebf8e[_0x173ba8]={'$like':'%'+_0x223893['query'][_0x1ee1('0x3a')]+'%'};return _0x4ebf8e;})});}_0x4b599d=_[_0x1ee1('0x3b')]({},_0x4b599d,_0x223893['options']);return _0x41f3d3[_0x1ee1('0x48')](_0x4b599d);}})['then'](function(_0x3540f9){if(_0x3540f9){_0xe93945=_0x3540f9[_0x1ee1('0x33')];if(!_0x223893[_0x1ee1('0x2e')][_0x1ee1('0x34')](_0x1ee1('0x4a'))){_0x4b599d[_0x1ee1('0x1e')]=qs['limit'](_0x223893[_0x1ee1('0x2e')]['limit']);_0x4b599d[_0x1ee1('0x35')]=qs[_0x1ee1('0x35')](_0x223893[_0x1ee1('0x2e')][_0x1ee1('0x35')]);}return _0x41f3d3[_0x1ee1('0x48')](_0x4b599d);}})[_0x1ee1('0x24')](function(_0x319001){if(_0x319001){return _0x319001?{'count':_0xe93945,'rows':_0x319001}:null;}})[_0x1ee1('0x24')](respondWithResult(_0x3ffde3,null))[_0x1ee1('0x44')](handleError(_0x3ffde3,null));};exports['addConfiguration']=function(_0x4095d5,_0xda6975,_0x4bee33){if(_0x4095d5['body']['id']){delete _0x4095d5[_0x1ee1('0x46')]['id'];}return db[_0x1ee1('0x29')][_0x1ee1('0x4b')]({'where':{'id':_0x4095d5[_0x1ee1('0x41')]['id']}})[_0x1ee1('0x24')](handleEntityNotFound(_0xda6975,null))[_0x1ee1('0x24')](function(_0x2af459){if(_0x2af459){_0x4095d5[_0x1ee1('0x46')][_0x1ee1('0x4c')]=_0x2af459['id'];_0x4095d5[_0x1ee1('0x46')][_0x1ee1('0x4d')]=integrations['getSubjects'](_0x4095d5['body'][_0x1ee1('0x4e')],_0x4095d5['body']['type']);_0x4095d5[_0x1ee1('0x46')][_0x1ee1('0x4f')]=integrations['getDescriptions'](_0x4095d5['body'][_0x1ee1('0x4e')],_0x4095d5[_0x1ee1('0x46')][_0x1ee1('0x3c')]);return db[_0x1ee1('0x49')][_0x1ee1('0x45')](_0x4095d5[_0x1ee1('0x46')],{'include':[{'model':db['FreshdeskField'],'as':_0x1ee1('0x4d')},{'model':db[_0x1ee1('0x50')],'as':_0x1ee1('0x4f')}]});}return null;})[_0x1ee1('0x24')](respondWithResult(_0xda6975,null))[_0x1ee1('0x44')](handleError(_0xda6975,null));};exports['getFields']=function(_0x247674,_0x1efd22,_0x5e51ec){var _0x321eac='';return db['FreshdeskAccount'][_0x1ee1('0x4b')]({'where':{'id':_0x247674[_0x1ee1('0x41')]['id']},'attributes':['id','remoteUri','apiKey']})[_0x1ee1('0x24')](handleEntityNotFound(_0x1efd22,null))[_0x1ee1('0x24')](function(_0x377688){if(_0x377688){_0x321eac=_0x377688[_0x1ee1('0x51')];var _0x3236a9=_0x321eac[_0x1ee1('0x52')](-0x1);if(_0x3236a9==='/'){_0x321eac=_0x321eac[_0x1ee1('0x53')](0x0,_0x321eac['lastIndexOf'](_0x3236a9));}return rp({'method':'GET','uri':util[_0x1ee1('0x54')](_0x1ee1('0x55'),_0x321eac,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x1ee1('0x54')]('Basic\x20%s',new Buffer(util[_0x1ee1('0x54')](_0x1ee1('0x56'),_0x377688[_0x1ee1('0x57')]))[_0x1ee1('0x58')](_0x1ee1('0x59')))},'json':!![]});}})['then'](function(_0x1bbc12){if(_0x1bbc12){var _0x37e47d=[_0x1ee1('0x5a'),_0x1ee1('0x5b'),_0x1ee1('0x5c'),_0x1ee1('0x5d'),'status',_0x1ee1('0x5e'),'group',_0x1ee1('0x5f'),_0x1ee1('0x60'),'group','company'];_[_0x1ee1('0x61')](_0x1bbc12,function(_0x3b7d8c){return _0x37e47d[_0x1ee1('0x62')](_0x3b7d8c[_0x1ee1('0x26')])||!_0x3b7d8c[_0x1ee1('0x63')]&&_0x3b7d8c[_0x1ee1('0x3c')]!==_0x1ee1('0x64')&&_0x3b7d8c[_0x1ee1('0x3c')]!==_0x1ee1('0x65');});return{'count':_0x1bbc12[_0x1ee1('0x33')],'rows':_[_0x1ee1('0x2d')](_0x1bbc12,function(_0x4307a4){return{'id':_0x4307a4[_0x1ee1('0x26')],'name':_0x4307a4[_0x1ee1('0x66')],'custom':!_0x4307a4[_0x1ee1('0x63')],'options':_0x4307a4[_0x1ee1('0x67')]?_[_0x1ee1('0x2d')](_0x4307a4[_0x1ee1('0x67')],function(_0x183570){return{'name':_['capitalize'](_0x183570),'value':_0x183570};}):[]};})};}})[_0x1ee1('0x24')](respondWithResult(_0x1efd22,null))[_0x1ee1('0x44')](function(_0x16c123){var _0x112d44=_0x247674['query']['test']?0x1f4:_0x16c123[_0x1ee1('0x68')]||0x1f4;logger['error'](_0x1ee1('0x69'),_0x1ee1('0x6a'),_0x112d44,JSON[_0x1ee1('0x6b')](_0x16c123));delete _0x16c123[_0x1ee1('0x26')];if(_0x112d44===0x191){_0x112d44=0x190;}_0x1efd22[_0x1ee1('0x1a')](_0x112d44)[_0x1ee1('0x27')](_0x247674[_0x1ee1('0x2e')]['test']?{'message':_0x1ee1('0x6c'),'statusCode':_0x16c123[_0x1ee1('0x68')]}:_0x16c123);});}; \ No newline at end of file +var _0xb677=['map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','api/v2/ticket_fields','%s:X','requester','subject','agent','priority','group','source','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','name','FreshdeskAccount','fieldName','type','key','model'];(function(_0x12d89e,_0x388ae7){var _0x485a21=function(_0x303935){while(--_0x303935){_0x12d89e['push'](_0x12d89e['shift']());}};_0x485a21(++_0x388ae7);}(_0xb677,0x119));var _0x7b67=function(_0xb5835d,_0x42d919){_0xb5835d=_0xb5835d-0x0;var _0x4f767c=_0xb677[_0xb5835d];return _0x4f767c;};'use strict';var emlformat=require(_0x7b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b67('0x1'));var jsonpatch=require(_0x7b67('0x2'));var rp=require(_0x7b67('0x3'));var moment=require(_0x7b67('0x4'));var BPromise=require(_0x7b67('0x5'));var Mustache=require(_0x7b67('0x6'));var util=require(_0x7b67('0x7'));var path=require(_0x7b67('0x8'));var sox=require('sox');var csv=require(_0x7b67('0x9'));var ejs=require(_0x7b67('0xa'));var fs=require('fs');var fs_extra=require(_0x7b67('0xb'));var _=require(_0x7b67('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b67('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7b67('0xe'));var Papa=require('papaparse');var Redis=require(_0x7b67('0xf'));var authService=require(_0x7b67('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b67('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b67('0x12'))(_0x7b67('0x13'));var utils=require(_0x7b67('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x7b67('0x15'));function respondWithStatusCode(_0x454df4,_0x1e17fc){_0x1e17fc=_0x1e17fc||0xcc;return function(_0x963f60){if(_0x963f60){return _0x454df4[_0x7b67('0x16')](_0x1e17fc);}return _0x454df4[_0x7b67('0x17')](_0x1e17fc)['end']();};}function respondWithResult(_0x37eb7a,_0x473d10){_0x473d10=_0x473d10||0xc8;return function(_0x233388){if(_0x233388){return _0x37eb7a[_0x7b67('0x17')](_0x473d10)[_0x7b67('0x18')](_0x233388);}};}function respondWithFilteredResult(_0x309f1c,_0x1861d1){return function(_0xf99987){if(_0xf99987){var _0x52c21b=typeof _0x1861d1[_0x7b67('0x19')]===_0x7b67('0x1a')&&typeof _0x1861d1[_0x7b67('0x1b')]===_0x7b67('0x1a');var _0x241f1d=_0xf99987[_0x7b67('0x1c')];var _0x59fd3d=_0x52c21b?0x0:_0x1861d1[_0x7b67('0x19')];var _0x348f28=_0x52c21b?_0xf99987[_0x7b67('0x1c')]:_0x1861d1[_0x7b67('0x19')]+_0x1861d1[_0x7b67('0x1b')];var _0x4095e7;if(_0x348f28>=_0x241f1d){_0x348f28=_0x241f1d;_0x4095e7=0xc8;}else{_0x4095e7=0xce;}_0x309f1c[_0x7b67('0x17')](_0x4095e7);return _0x309f1c[_0x7b67('0x1d')](_0x7b67('0x1e'),_0x59fd3d+'-'+_0x348f28+'/'+_0x241f1d)[_0x7b67('0x18')](_0xf99987);}return null;};}function patchUpdates(_0x5ddb36){return function(_0x125924){try{jsonpatch[_0x7b67('0x1f')](_0x125924,_0x5ddb36,!![]);}catch(_0x55cab1){return BPromise['reject'](_0x55cab1);}return _0x125924['save']();};}function saveUpdates(_0x48944a,_0x44b951){return function(_0xeabc5c){if(_0xeabc5c){return _0xeabc5c[_0x7b67('0x20')](_0x48944a)[_0x7b67('0x21')](function(_0x2c3f11){return _0x2c3f11;});}return null;};}function removeEntity(_0x56b952,_0x3b4fea){return function(_0x12d848){if(_0x12d848){return _0x12d848[_0x7b67('0x22')]()[_0x7b67('0x21')](function(){_0x56b952[_0x7b67('0x17')](0xcc)[_0x7b67('0x23')]();});}};}function handleEntityNotFound(_0x2b6da7,_0x50e71c){return function(_0x463c41){if(!_0x463c41){_0x2b6da7['sendStatus'](0x194);}return _0x463c41;};}function handleError(_0x45da6b,_0x2f1e62){_0x2f1e62=_0x2f1e62||0x1f4;return function(_0x250fb0){logger[_0x7b67('0x24')](_0x250fb0['stack']);if(_0x250fb0[_0x7b67('0x25')]){delete _0x250fb0[_0x7b67('0x25')];}_0x45da6b[_0x7b67('0x17')](_0x2f1e62)['send'](_0x250fb0);};}exports['index']=function(_0x5ac43f,_0x8649ec){var _0x4bd8b7={},_0x5ee006={},_0x2cd200={'count':0x0,'rows':[]};var _0x3de320=_['map'](db[_0x7b67('0x26')]['rawAttributes'],function(_0x4815ab){return{'name':_0x4815ab[_0x7b67('0x27')],'type':_0x4815ab[_0x7b67('0x28')][_0x7b67('0x29')]};});_0x5ee006[_0x7b67('0x2a')]=_[_0x7b67('0x2b')](_0x3de320,_0x7b67('0x25'));_0x5ee006[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x5ac43f[_0x7b67('0x2c')]);_0x5ee006[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x5ee006[_0x7b67('0x2a')],_0x5ee006[_0x7b67('0x2c')]);_0x4bd8b7[_0x7b67('0x30')]=_[_0x7b67('0x2f')](_0x5ee006[_0x7b67('0x2a')],qs[_0x7b67('0x31')](_0x5ac43f['query'][_0x7b67('0x31')]));_0x4bd8b7[_0x7b67('0x30')]=_0x4bd8b7['attributes'][_0x7b67('0x32')]?_0x4bd8b7[_0x7b67('0x30')]:_0x5ee006[_0x7b67('0x2a')];if(!_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x33')](_0x7b67('0x34'))){_0x4bd8b7[_0x7b67('0x1b')]=qs[_0x7b67('0x1b')](_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x1b')]);_0x4bd8b7[_0x7b67('0x19')]=qs[_0x7b67('0x19')](_0x5ac43f[_0x7b67('0x2c')]['offset']);}_0x4bd8b7[_0x7b67('0x35')]=qs[_0x7b67('0x36')](_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x36')]);_0x4bd8b7['where']=qs[_0x7b67('0x2e')](_[_0x7b67('0x37')](_0x5ac43f[_0x7b67('0x2c')],_0x5ee006[_0x7b67('0x2e')]),_0x3de320);if(_0x5ac43f[_0x7b67('0x2c')]['filter']){_0x4bd8b7[_0x7b67('0x38')]=_[_0x7b67('0x39')](_0x4bd8b7[_0x7b67('0x38')],{'$or':_[_0x7b67('0x2b')](_0x3de320,function(_0x2f82ac){if(_0x2f82ac[_0x7b67('0x28')]!==_0x7b67('0x3a')){var _0x254eec={};_0x254eec[_0x2f82ac[_0x7b67('0x25')]]={'$like':'%'+_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x3b')]+'%'};return _0x254eec;}})});}_0x4bd8b7=_[_0x7b67('0x39')]({},_0x4bd8b7,_0x5ac43f[_0x7b67('0x3c')]);var _0x2ef44e={'where':_0x4bd8b7[_0x7b67('0x38')]};return db['FreshdeskAccount'][_0x7b67('0x1c')](_0x2ef44e)[_0x7b67('0x21')](function(_0x1d19c8){_0x2cd200[_0x7b67('0x1c')]=_0x1d19c8;if(_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x3d')]){_0x4bd8b7['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x7b67('0x3e')](_0x4bd8b7);})[_0x7b67('0x21')](function(_0x571ac9){_0x2cd200['rows']=_0x571ac9;return _0x2cd200;})[_0x7b67('0x21')](respondWithFilteredResult(_0x8649ec,_0x4bd8b7))[_0x7b67('0x3f')](handleError(_0x8649ec,null));};exports[_0x7b67('0x40')]=function(_0x30da75,_0x3e6f37){var _0x46629b={'raw':![],'where':{'id':_0x30da75[_0x7b67('0x41')]['id']}},_0x4f39df={};_0x4f39df[_0x7b67('0x2a')]=_[_0x7b67('0x2d')](db[_0x7b67('0x26')]['rawAttributes']);_0x4f39df[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x30da75[_0x7b67('0x2c')]);_0x4f39df['filters']=_['intersection'](_0x4f39df[_0x7b67('0x2a')],_0x4f39df['query']);_0x46629b[_0x7b67('0x30')]=_['intersection'](_0x4f39df['model'],qs[_0x7b67('0x31')](_0x30da75['query'][_0x7b67('0x31')]));_0x46629b['attributes']=_0x46629b[_0x7b67('0x30')][_0x7b67('0x32')]?_0x46629b['attributes']:_0x4f39df[_0x7b67('0x2a')];if(_0x30da75[_0x7b67('0x2c')][_0x7b67('0x3d')]){_0x46629b[_0x7b67('0x42')]=[{'all':!![]}];}_0x46629b=_[_0x7b67('0x39')]({},_0x46629b,_0x30da75[_0x7b67('0x3c')]);return db[_0x7b67('0x26')][_0x7b67('0x43')](_0x46629b)[_0x7b67('0x21')](handleEntityNotFound(_0x3e6f37,null))[_0x7b67('0x21')](respondWithResult(_0x3e6f37,null))[_0x7b67('0x3f')](handleError(_0x3e6f37,null));};exports[_0x7b67('0x44')]=function(_0x3dd431,_0x3e7b0f){return db['FreshdeskAccount'][_0x7b67('0x44')](_0x3dd431[_0x7b67('0x45')],{})['then'](respondWithResult(_0x3e7b0f,0xc9))[_0x7b67('0x3f')](handleError(_0x3e7b0f,null));};exports['update']=function(_0x1c80e9,_0x3ae6d5){if(_0x1c80e9[_0x7b67('0x45')]['id']){delete _0x1c80e9[_0x7b67('0x45')]['id'];}return db['FreshdeskAccount'][_0x7b67('0x43')]({'where':{'id':_0x1c80e9[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x3ae6d5,null))['then'](saveUpdates(_0x1c80e9['body'],null))[_0x7b67('0x21')](respondWithResult(_0x3ae6d5,null))[_0x7b67('0x3f')](handleError(_0x3ae6d5,null));};exports['destroy']=function(_0x501088,_0x3d35c3){return db[_0x7b67('0x26')][_0x7b67('0x43')]({'where':{'id':_0x501088[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x3d35c3,null))['then'](removeEntity(_0x3d35c3,null))[_0x7b67('0x3f')](handleError(_0x3d35c3,null));};exports[_0x7b67('0x46')]=function(_0x3689e4,_0x439551,_0x5a6b5d){var _0x1a2b81={};var _0x5465db={};var _0x3510b6;var _0x1ea2b5;return db[_0x7b67('0x26')][_0x7b67('0x47')]({'where':{'id':_0x3689e4[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x439551,null))[_0x7b67('0x21')](function(_0x2023da){if(_0x2023da){_0x3510b6=_0x2023da;_0x5465db['model']=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x5465db[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x3689e4[_0x7b67('0x2c')]);_0x5465db[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x5465db['model'],_0x5465db[_0x7b67('0x2c')]);_0x1a2b81['attributes']=_[_0x7b67('0x2f')](_0x5465db[_0x7b67('0x2a')],qs[_0x7b67('0x31')](_0x3689e4[_0x7b67('0x2c')][_0x7b67('0x31')]));_0x1a2b81['attributes']=_0x1a2b81[_0x7b67('0x30')][_0x7b67('0x32')]?_0x1a2b81[_0x7b67('0x30')]:_0x5465db[_0x7b67('0x2a')];_0x1a2b81['order']=qs[_0x7b67('0x36')](_0x3689e4[_0x7b67('0x2c')]['sort']);_0x1a2b81[_0x7b67('0x38')]=qs[_0x7b67('0x2e')](_[_0x7b67('0x37')](_0x3689e4['query'],_0x5465db[_0x7b67('0x2e')]));if(_0x3689e4[_0x7b67('0x2c')]['filter']){_0x1a2b81['where']=_[_0x7b67('0x39')](_0x1a2b81[_0x7b67('0x38')],{'$or':_[_0x7b67('0x2b')](_0x1a2b81['attributes'],function(_0x1048e9){var _0x1767f9={};_0x1767f9[_0x1048e9]={'$like':'%'+_0x3689e4[_0x7b67('0x2c')]['filter']+'%'};return _0x1767f9;})});}_0x1a2b81=_[_0x7b67('0x39')]({},_0x1a2b81,_0x3689e4[_0x7b67('0x3c')]);return _0x3510b6['getConfigurations'](_0x1a2b81);}})['then'](function(_0x4f9267){if(_0x4f9267){_0x1ea2b5=_0x4f9267[_0x7b67('0x32')];if(!_0x3689e4[_0x7b67('0x2c')][_0x7b67('0x33')]('nolimit')){_0x1a2b81['limit']=qs[_0x7b67('0x1b')](_0x3689e4['query'][_0x7b67('0x1b')]);_0x1a2b81[_0x7b67('0x19')]=qs[_0x7b67('0x19')](_0x3689e4['query'][_0x7b67('0x19')]);}return _0x3510b6[_0x7b67('0x46')](_0x1a2b81);}})[_0x7b67('0x21')](function(_0x44d54b){if(_0x44d54b){return _0x44d54b?{'count':_0x1ea2b5,'rows':_0x44d54b}:null;}})[_0x7b67('0x21')](respondWithResult(_0x439551,null))[_0x7b67('0x3f')](handleError(_0x439551,null));};exports[_0x7b67('0x48')]=function(_0x7c9f96,_0x1e4b7a,_0x16dd22){if(_0x7c9f96['body']['id']){delete _0x7c9f96[_0x7b67('0x45')]['id'];}return db[_0x7b67('0x26')]['findOne']({'where':{'id':_0x7c9f96['params']['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x1e4b7a,null))['then'](function(_0x5115bc){if(_0x5115bc){_0x7c9f96[_0x7b67('0x45')]['AccountId']=_0x5115bc['id'];_0x7c9f96['body'][_0x7b67('0x49')]=integrations['getSubjects'](_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x4a')],_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x28')]);_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x4b')]=integrations['getDescriptions'](_0x7c9f96['body']['channel'],_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x28')]);return db[_0x7b67('0x4c')][_0x7b67('0x44')](_0x7c9f96['body'],{'include':[{'model':db[_0x7b67('0x4d')],'as':_0x7b67('0x49')},{'model':db[_0x7b67('0x4d')],'as':_0x7b67('0x4b')}]});}return null;})[_0x7b67('0x21')](respondWithResult(_0x1e4b7a,null))[_0x7b67('0x3f')](handleError(_0x1e4b7a,null));};exports[_0x7b67('0x4e')]=function(_0x2c83e7,_0x498b04,_0x3b7d30){var _0xd8ced3='';return db['FreshdeskAccount'][_0x7b67('0x47')]({'where':{'id':_0x2c83e7[_0x7b67('0x41')]['id']},'attributes':['id',_0x7b67('0x4f'),_0x7b67('0x50')]})[_0x7b67('0x21')](handleEntityNotFound(_0x498b04,null))['then'](function(_0x1cdecd){if(_0x1cdecd){_0xd8ced3=_0x1cdecd['remoteUri'];var _0x2cbab9=_0xd8ced3[_0x7b67('0x51')](-0x1);if(_0x2cbab9==='/'){_0xd8ced3=_0xd8ced3['substring'](0x0,_0xd8ced3[_0x7b67('0x52')](_0x2cbab9));}return rp({'method':_0x7b67('0x53'),'uri':util[_0x7b67('0x54')]('%s/%s',_0xd8ced3,_0x7b67('0x55')),'headers':{'Authorization':util[_0x7b67('0x54')]('Basic\x20%s',new Buffer(util[_0x7b67('0x54')](_0x7b67('0x56'),_0x1cdecd['apiKey']))['toString']('base64'))},'json':!![]});}})[_0x7b67('0x21')](function(_0x3293a1){if(_0x3293a1){var _0xa13bd9=[_0x7b67('0x57'),_0x7b67('0x58'),_0x7b67('0x59'),'description','status',_0x7b67('0x5a'),_0x7b67('0x5b'),_0x7b67('0x5c'),'ticket_type','group',_0x7b67('0x5d')];_[_0x7b67('0x5e')](_0x3293a1,function(_0x510b1f){return _0xa13bd9[_0x7b67('0x5f')](_0x510b1f[_0x7b67('0x25')])||!_0x510b1f[_0x7b67('0x60')]&&_0x510b1f['type']!==_0x7b67('0x61')&&_0x510b1f[_0x7b67('0x28')]!==_0x7b67('0x62');});return{'count':_0x3293a1[_0x7b67('0x32')],'rows':_[_0x7b67('0x2b')](_0x3293a1,function(_0xc6314f){return{'id':_0xc6314f[_0x7b67('0x25')],'name':_0xc6314f[_0x7b67('0x63')],'custom':!_0xc6314f[_0x7b67('0x60')],'options':_0xc6314f[_0x7b67('0x64')]?_['map'](_0xc6314f['choices'],function(_0x225000){return{'name':_[_0x7b67('0x65')](_0x225000),'value':_0x225000};}):[]};})};}})[_0x7b67('0x21')](respondWithResult(_0x498b04,null))['catch'](function(_0x2a9bcd){var _0x33f21b=_0x2c83e7['query'][_0x7b67('0x66')]?0x1f4:_0x2a9bcd[_0x7b67('0x67')]||0x1f4;logger[_0x7b67('0x24')](_0x7b67('0x68'),_0x7b67('0x4e'),_0x33f21b,JSON[_0x7b67('0x69')](_0x2a9bcd));delete _0x2a9bcd[_0x7b67('0x25')];if(_0x33f21b===0x191){_0x33f21b=0x190;}_0x498b04['status'](_0x33f21b)[_0x7b67('0x6a')](_0x2c83e7['query']['test']?{'message':_0x7b67('0x6b'),'statusCode':_0x2a9bcd[_0x7b67('0x67')]}:_0x2a9bcd);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index d4e3419..40f2b28 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 _0xdfd9=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x49631b,_0x588788){var _0x41e96c=function(_0x1362d4){while(--_0x1362d4){_0x49631b['push'](_0x49631b['shift']());}};_0x41e96c(++_0x588788);}(_0xdfd9,0x140));var _0x9dfd=function(_0x178d6a,_0x3d9e5a){_0x178d6a=_0x178d6a-0x0;var _0xcc3244=_0xdfd9[_0x178d6a];return _0xcc3244;};'use strict';var _=require(_0x9dfd('0x0'));var util=require(_0x9dfd('0x1'));var logger=require(_0x9dfd('0x2'))(_0x9dfd('0x3'));var moment=require(_0x9dfd('0x4'));var BPromise=require('bluebird');var rp=require(_0x9dfd('0x5'));var fs=require('fs');var path=require(_0x9dfd('0x6'));var rimraf=require(_0x9dfd('0x7'));var config=require(_0x9dfd('0x8'));var attributes=require(_0x9dfd('0x9'));var integrations=require(_0x9dfd('0xa'));module[_0x9dfd('0xb')]=function(_0x30668b,_0x13bd9e){return _0x30668b[_0x9dfd('0xc')](_0x9dfd('0xd'),attributes,{'tableName':_0x9dfd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62b2=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2ec650,_0x24b011){var _0xdb00de=function(_0x3244e6){while(--_0x3244e6){_0x2ec650['push'](_0x2ec650['shift']());}};_0xdb00de(++_0x24b011);}(_0x62b2,0xfd));var _0x262b=function(_0xaef659,_0x33f745){_0xaef659=_0xaef659-0x0;var _0x113913=_0x62b2[_0xaef659];return _0x113913;};'use strict';var _=require(_0x262b('0x0'));var util=require(_0x262b('0x1'));var logger=require(_0x262b('0x2'))(_0x262b('0x3'));var moment=require(_0x262b('0x4'));var BPromise=require(_0x262b('0x5'));var rp=require(_0x262b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x262b('0x7'));var config=require(_0x262b('0x8'));var attributes=require(_0x262b('0x9'));var integrations=require(_0x262b('0xa'));module[_0x262b('0xb')]=function(_0x36d8c1,_0x3ae037){return _0x36d8c1['define']('FreshdeskAccount',attributes,{'tableName':_0x262b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 9a2dd5d..d28805f 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 _0x2bfb=['request\x20sent','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','attributes','limit','include','map','model','stringify','ShowFreshdeskAccount','find','where','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x167f3b,_0x36d5cd){var _0x56efd2=function(_0x332c3d){while(--_0x332c3d){_0x167f3b['push'](_0x167f3b['shift']());}};_0x56efd2(++_0x36d5cd);}(_0x2bfb,0x15d));var _0xb2bf=function(_0x3ed91f,_0x56747d){_0x3ed91f=_0x3ed91f-0x0;var _0x35eab3=_0x2bfb[_0x3ed91f];return _0x35eab3;};'use strict';var _=require('lodash');var util=require(_0xb2bf('0x0'));var moment=require(_0xb2bf('0x1'));var BPromise=require(_0xb2bf('0x2'));var rs=require(_0xb2bf('0x3'));var fs=require('fs');var Redis=require(_0xb2bf('0x4'));var db=require(_0xb2bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2bf('0x6'))('rpc');var config=require(_0xb2bf('0x7'));var jayson=require(_0xb2bf('0x8'));var client=jayson['client'][_0xb2bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e03e5,_0xf71685,_0x5a914c){return new BPromise(function(_0x56ba2d,_0x499231){return client[_0xb2bf('0xa')](_0x1e03e5,_0x5a914c)[_0xb2bf('0xb')](function(_0x3ce37c){logger[_0xb2bf('0xc')](_0xb2bf('0xd'),_0xf71685,'request\x20sent');logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0xf71685,_0xb2bf('0xe'),JSON['stringify'](_0x3ce37c));if(_0x3ce37c[_0xb2bf('0xf')]){if(_0x3ce37c[_0xb2bf('0xf')]['code']===0x1f4){logger[_0xb2bf('0xf')](_0xb2bf('0xd'),_0xf71685,_0x3ce37c[_0xb2bf('0xf')][_0xb2bf('0x10')]);return _0x499231(_0x3ce37c[_0xb2bf('0xf')][_0xb2bf('0x10')]);}logger['error'](_0xb2bf('0xd'),_0xf71685,_0x3ce37c[_0xb2bf('0xf')][_0xb2bf('0x10')]);return _0x56ba2d(_0x3ce37c['error'][_0xb2bf('0x10')]);}else{logger[_0xb2bf('0xc')](_0xb2bf('0xd'),_0xf71685,_0xb2bf('0xe'));_0x56ba2d(_0x3ce37c[_0xb2bf('0x11')][_0xb2bf('0x10')]);}})[_0xb2bf('0x12')](function(_0x36de3f){logger[_0xb2bf('0xf')](_0xb2bf('0xd'),_0xf71685,_0x36de3f);_0x499231(_0x36de3f);});});}exports[_0xb2bf('0x13')]=function(_0x3e3fc1){var _0x1b8b94=this;return new Promise(function(_0x4ba94d,_0x283710){return db[_0xb2bf('0x14')]['findAll']({'raw':_0x3e3fc1['options']?_0x3e3fc1[_0xb2bf('0x15')][_0xb2bf('0x16')]===undefined?!![]:![]:!![],'where':_0x3e3fc1[_0xb2bf('0x15')]?_0x3e3fc1[_0xb2bf('0x15')]['where']||null:null,'attributes':_0x3e3fc1[_0xb2bf('0x15')]?_0x3e3fc1[_0xb2bf('0x15')][_0xb2bf('0x17')]||null:null,'limit':_0x3e3fc1['options']?_0x3e3fc1[_0xb2bf('0x15')][_0xb2bf('0x18')]||null:null,'include':_0x3e3fc1[_0xb2bf('0x15')]?_0x3e3fc1[_0xb2bf('0x15')][_0xb2bf('0x19')]?_[_0xb2bf('0x1a')](_0x3e3fc1['options'][_0xb2bf('0x19')],function(_0x15bea9){return{'model':db[_0x15bea9[_0xb2bf('0x1b')]],'as':_0x15bea9['as'],'attributes':_0x15bea9[_0xb2bf('0x17')],'include':_0x15bea9[_0xb2bf('0x19')]?_[_0xb2bf('0x1a')](_0x15bea9['include'],function(_0x4ca40a){return{'model':db[_0x4ca40a[_0xb2bf('0x1b')]],'as':_0x4ca40a['as'],'attributes':_0x4ca40a[_0xb2bf('0x17')],'include':_0x4ca40a[_0xb2bf('0x19')]?_['map'](_0x4ca40a[_0xb2bf('0x19')],function(_0x5ec090){return{'model':db[_0x5ec090[_0xb2bf('0x1b')]],'as':_0x5ec090['as'],'attributes':_0x5ec090[_0xb2bf('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29f69c){logger[_0xb2bf('0xc')](_0xb2bf('0x13'),_0x3e3fc1);logger['debug'](_0xb2bf('0x13'),_0x3e3fc1,JSON[_0xb2bf('0x1c')](_0x29f69c));_0x4ba94d(_0x29f69c);})[_0xb2bf('0x12')](function(_0xfdec89){logger[_0xb2bf('0xf')](_0xb2bf('0x13'),_0xfdec89[_0xb2bf('0x10')],_0x3e3fc1);_0x283710(_0x1b8b94['error'](0x1f4,_0xfdec89[_0xb2bf('0x10')]));});});};exports[_0xb2bf('0x1d')]=function(_0x9aaf43){var _0x3deae6=this;return new Promise(function(_0x3a4000,_0x49773e){return db[_0xb2bf('0x14')][_0xb2bf('0x1e')]({'raw':_0x9aaf43['options']?_0x9aaf43[_0xb2bf('0x15')][_0xb2bf('0x16')]===undefined?!![]:![]:!![],'where':_0x9aaf43[_0xb2bf('0x15')]?_0x9aaf43[_0xb2bf('0x15')][_0xb2bf('0x1f')]||null:null,'attributes':_0x9aaf43[_0xb2bf('0x15')]?_0x9aaf43[_0xb2bf('0x15')][_0xb2bf('0x17')]||null:null,'include':_0x9aaf43['options']?_0x9aaf43[_0xb2bf('0x15')][_0xb2bf('0x19')]?_['map'](_0x9aaf43[_0xb2bf('0x15')][_0xb2bf('0x19')],function(_0x430c48){return{'model':db[_0x430c48[_0xb2bf('0x1b')]],'as':_0x430c48['as'],'attributes':_0x430c48[_0xb2bf('0x17')],'include':_0x430c48[_0xb2bf('0x19')]?_[_0xb2bf('0x1a')](_0x430c48[_0xb2bf('0x19')],function(_0x4e10f5){return{'model':db[_0x4e10f5[_0xb2bf('0x1b')]],'as':_0x4e10f5['as'],'attributes':_0x4e10f5[_0xb2bf('0x17')],'include':_0x4e10f5[_0xb2bf('0x19')]?_['map'](_0x4e10f5['include'],function(_0xa7fb27){return{'model':db[_0xa7fb27[_0xb2bf('0x1b')]],'as':_0xa7fb27['as'],'attributes':_0xa7fb27[_0xb2bf('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb2bf('0xb')](function(_0x3d06b1){logger[_0xb2bf('0xc')]('ShowFreshdeskAccount',_0x9aaf43);logger[_0xb2bf('0x20')](_0xb2bf('0x1d'),_0x9aaf43,JSON[_0xb2bf('0x1c')](_0x3d06b1));_0x3a4000(_0x3d06b1);})[_0xb2bf('0x12')](function(_0x2316cc){logger[_0xb2bf('0xf')](_0xb2bf('0x1d'),_0x2316cc[_0xb2bf('0x10')],_0x9aaf43);_0x49773e(_0x3deae6[_0xb2bf('0xf')](0x1f4,_0x2316cc['message']));});});}; \ No newline at end of file +var _0x554b=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','FreshdeskAccount,\x20%s,\x20%s','catch','GetFreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','moment','bluebird','randomstring'];(function(_0x5aaef4,_0xb4f31b){var _0x4c7604=function(_0x2328f0){while(--_0x2328f0){_0x5aaef4['push'](_0x5aaef4['shift']());}};_0x4c7604(++_0xb4f31b);}(_0x554b,0xda));var _0xb554=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x554b[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0xb554('0x0'));var util=require('util');var moment=require(_0xb554('0x1'));var BPromise=require(_0xb554('0x2'));var rs=require(_0xb554('0x3'));var fs=require('fs');var Redis=require(_0xb554('0x4'));var db=require(_0xb554('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb554('0x6'))(_0xb554('0x7'));var config=require(_0xb554('0x8'));var jayson=require(_0xb554('0x9'));var client=jayson[_0xb554('0xa')][_0xb554('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x355800,_0x4daf01,_0x2757c8){return new BPromise(function(_0x4da21b,_0x569567){return client[_0xb554('0xc')](_0x355800,_0x2757c8)[_0xb554('0xd')](function(_0x192745){logger[_0xb554('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x4daf01,_0xb554('0xf'));logger[_0xb554('0x10')](_0xb554('0x11'),_0x4daf01,_0xb554('0xf'),JSON['stringify'](_0x192745));if(_0x192745[_0xb554('0x12')]){if(_0x192745[_0xb554('0x12')][_0xb554('0x13')]===0x1f4){logger[_0xb554('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x4daf01,_0x192745[_0xb554('0x12')][_0xb554('0x14')]);return _0x569567(_0x192745[_0xb554('0x12')]['message']);}logger[_0xb554('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x4daf01,_0x192745[_0xb554('0x12')]['message']);return _0x4da21b(_0x192745['error'][_0xb554('0x14')]);}else{logger['info'](_0xb554('0x15'),_0x4daf01,'request\x20sent');_0x4da21b(_0x192745['result'][_0xb554('0x14')]);}})[_0xb554('0x16')](function(_0x2214a2){logger[_0xb554('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x4daf01,_0x2214a2);_0x569567(_0x2214a2);});});}exports[_0xb554('0x17')]=function(_0x352a83){var _0x4b1ae1=this;return new Promise(function(_0x25942b,_0x14f389){return db['FreshdeskAccount'][_0xb554('0x18')]({'raw':_0x352a83[_0xb554('0x19')]?_0x352a83[_0xb554('0x19')][_0xb554('0x1a')]===undefined?!![]:![]:!![],'where':_0x352a83[_0xb554('0x19')]?_0x352a83['options'][_0xb554('0x1b')]||null:null,'attributes':_0x352a83[_0xb554('0x19')]?_0x352a83[_0xb554('0x19')]['attributes']||null:null,'limit':_0x352a83[_0xb554('0x19')]?_0x352a83[_0xb554('0x19')][_0xb554('0x1c')]||null:null,'include':_0x352a83[_0xb554('0x19')]?_0x352a83[_0xb554('0x19')][_0xb554('0x1d')]?_[_0xb554('0x1e')](_0x352a83['options'][_0xb554('0x1d')],function(_0x46a86d){return{'model':db[_0x46a86d[_0xb554('0x1f')]],'as':_0x46a86d['as'],'attributes':_0x46a86d[_0xb554('0x20')],'include':_0x46a86d[_0xb554('0x1d')]?_[_0xb554('0x1e')](_0x46a86d[_0xb554('0x1d')],function(_0x2e8ba1){return{'model':db[_0x2e8ba1[_0xb554('0x1f')]],'as':_0x2e8ba1['as'],'attributes':_0x2e8ba1[_0xb554('0x20')],'include':_0x2e8ba1[_0xb554('0x1d')]?_['map'](_0x2e8ba1['include'],function(_0x223aa5){return{'model':db[_0x223aa5[_0xb554('0x1f')]],'as':_0x223aa5['as'],'attributes':_0x223aa5['attributes']};}):[]};}):[]};}):[]:[]})[_0xb554('0xd')](function(_0x895d74){logger[_0xb554('0xe')](_0xb554('0x17'),_0x352a83);logger[_0xb554('0x10')](_0xb554('0x17'),_0x352a83,JSON[_0xb554('0x21')](_0x895d74));_0x25942b(_0x895d74);})['catch'](function(_0xe388e9){logger[_0xb554('0x12')](_0xb554('0x17'),_0xe388e9[_0xb554('0x14')],_0x352a83);_0x14f389(_0x4b1ae1[_0xb554('0x12')](0x1f4,_0xe388e9['message']));});});};exports[_0xb554('0x22')]=function(_0xb18edf){var _0xe14b08=this;return new Promise(function(_0x505f79,_0x476656){return db[_0xb554('0x23')][_0xb554('0x24')]({'raw':_0xb18edf[_0xb554('0x19')]?_0xb18edf[_0xb554('0x19')][_0xb554('0x1a')]===undefined?!![]:![]:!![],'where':_0xb18edf[_0xb554('0x19')]?_0xb18edf[_0xb554('0x19')]['where']||null:null,'attributes':_0xb18edf['options']?_0xb18edf['options'][_0xb554('0x20')]||null:null,'include':_0xb18edf[_0xb554('0x19')]?_0xb18edf['options'][_0xb554('0x1d')]?_[_0xb554('0x1e')](_0xb18edf[_0xb554('0x19')]['include'],function(_0x49ff11){return{'model':db[_0x49ff11[_0xb554('0x1f')]],'as':_0x49ff11['as'],'attributes':_0x49ff11['attributes'],'include':_0x49ff11[_0xb554('0x1d')]?_['map'](_0x49ff11[_0xb554('0x1d')],function(_0xf4fdaa){return{'model':db[_0xf4fdaa[_0xb554('0x1f')]],'as':_0xf4fdaa['as'],'attributes':_0xf4fdaa[_0xb554('0x20')],'include':_0xf4fdaa[_0xb554('0x1d')]?_['map'](_0xf4fdaa[_0xb554('0x1d')],function(_0x2b378e){return{'model':db[_0x2b378e[_0xb554('0x1f')]],'as':_0x2b378e['as'],'attributes':_0x2b378e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb554('0xd')](function(_0x4b60cd){logger[_0xb554('0xe')]('ShowFreshdeskAccount',_0xb18edf);logger[_0xb554('0x10')](_0xb554('0x22'),_0xb18edf,JSON[_0xb554('0x21')](_0x4b60cd));_0x505f79(_0x4b60cd);})['catch'](function(_0x1c14c6){logger[_0xb554('0x12')](_0xb554('0x22'),_0x1c14c6['message'],_0xb18edf);_0x476656(_0xe14b08[_0xb554('0x12')](0x1f4,_0x1c14c6[_0xb554('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 2b1a504..c453175 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 _0x75fd=['get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x745ab1,_0x25c4ed){var _0x44ab8d=function(_0x1a16d6){while(--_0x1a16d6){_0x745ab1['push'](_0x745ab1['shift']());}};_0x44ab8d(++_0x25c4ed);}(_0x75fd,0xa6));var _0xd75f=function(_0x3a23f7,_0x5b2196){_0x3a23f7=_0x3a23f7-0x0;var _0x4b5098=_0x75fd[_0x3a23f7];return _0x4b5098;};'use strict';var multer=require('multer');var util=require(_0xd75f('0x0'));var path=require(_0xd75f('0x1'));var timeout=require(_0xd75f('0x2'));var express=require(_0xd75f('0x3'));var router=express[_0xd75f('0x4')]();var fs_extra=require(_0xd75f('0x5'));var auth=require(_0xd75f('0x6'));var interaction=require(_0xd75f('0x7'));var config=require(_0xd75f('0x8'));var controller=require(_0xd75f('0x9'));router['get']('/',auth[_0xd75f('0xa')](),controller[_0xd75f('0xb')]);router['get'](_0xd75f('0xc'),auth[_0xd75f('0xa')](),controller[_0xd75f('0xd')]);router[_0xd75f('0xe')](_0xd75f('0xf'),auth[_0xd75f('0xa')](),controller[_0xd75f('0x10')]);router['get'](_0xd75f('0x11'),auth[_0xd75f('0xa')](),controller[_0xd75f('0x12')]);router[_0xd75f('0xe')](_0xd75f('0x13'),auth[_0xd75f('0xa')](),controller[_0xd75f('0x14')]);router['get'](_0xd75f('0x15'),auth[_0xd75f('0xa')](),controller[_0xd75f('0x16')]);router[_0xd75f('0x17')]('/',auth[_0xd75f('0xa')](),controller[_0xd75f('0x18')]);router[_0xd75f('0x17')](_0xd75f('0x15'),auth[_0xd75f('0xa')](),controller['setTags']);router[_0xd75f('0x19')](_0xd75f('0xc'),auth[_0xd75f('0xa')](),controller[_0xd75f('0x1a')]);router[_0xd75f('0x1b')](_0xd75f('0xc'),auth[_0xd75f('0xa')](),controller[_0xd75f('0x1c')]);module[_0xd75f('0x1d')]=router; \ No newline at end of file +var _0xed7c=['../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x20916d,_0x4a7380){var _0x41cb9c=function(_0x1b511b){while(--_0x1b511b){_0x20916d['push'](_0x20916d['shift']());}};_0x41cb9c(++_0x4a7380);}(_0xed7c,0xec));var _0xced7=function(_0x5a9381,_0x14255a){_0x5a9381=_0x5a9381-0x0;var _0x363740=_0xed7c[_0x5a9381];return _0x363740;};'use strict';var multer=require('multer');var util=require(_0xced7('0x0'));var path=require('path');var timeout=require(_0xced7('0x1'));var express=require(_0xced7('0x2'));var router=express[_0xced7('0x3')]();var fs_extra=require(_0xced7('0x4'));var auth=require(_0xced7('0x5'));var interaction=require(_0xced7('0x6'));var config=require(_0xced7('0x7'));var controller=require(_0xced7('0x8'));router[_0xced7('0x9')]('/',auth['isAuthenticated'](),controller[_0xced7('0xa')]);router[_0xced7('0x9')](_0xced7('0xb'),auth[_0xced7('0xc')](),controller[_0xced7('0xd')]);router[_0xced7('0x9')](_0xced7('0xe'),auth[_0xced7('0xc')](),controller['getFields']);router[_0xced7('0x9')](_0xced7('0xf'),auth[_0xced7('0xc')](),controller[_0xced7('0x10')]);router['get'](_0xced7('0x11'),auth[_0xced7('0xc')](),controller[_0xced7('0x12')]);router[_0xced7('0x9')](_0xced7('0x13'),auth[_0xced7('0xc')](),controller[_0xced7('0x14')]);router[_0xced7('0x15')]('/',auth[_0xced7('0xc')](),controller[_0xced7('0x16')]);router[_0xced7('0x15')](_0xced7('0x13'),auth[_0xced7('0xc')](),controller[_0xced7('0x17')]);router['put'](_0xced7('0xb'),auth[_0xced7('0xc')](),controller[_0xced7('0x18')]);router['delete'](_0xced7('0xb'),auth['isAuthenticated'](),controller[_0xced7('0x19')]);module[_0xced7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 650cf14..ff62b89 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 _0x4952=['sequelize','STRING'];(function(_0x28958d,_0xfa5f9f){var _0x439c72=function(_0x280df5){while(--_0x280df5){_0x28958d['push'](_0x28958d['shift']());}};_0x439c72(++_0xfa5f9f);}(_0x4952,0x140));var _0x2495=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x4952[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0x2495('0x0'));module['exports']={'name':{'type':Sequelize[_0x2495('0x1')]},'description':{'type':Sequelize[_0x2495('0x1')]}}; \ No newline at end of file +var _0x118d=['sequelize','STRING'];(function(_0x2e30c6,_0x40a809){var _0x470e59=function(_0x4faaed){while(--_0x4faaed){_0x2e30c6['push'](_0x2e30c6['shift']());}};_0x470e59(++_0x40a809);}(_0x118d,0x11e));var _0xd118=function(_0x2f05d0,_0x5d7bea){_0x2f05d0=_0x2f05d0-0x0;var _0x5762d0=_0x118d[_0x2f05d0];return _0x5762d0;};'use strict';var Sequelize=require(_0xd118('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd118('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index a406162..8004a2f 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 _0x4972=['fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','filter','options','rows','catch','show','includeAll','include','find','create','body','update','params','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','name','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x42db63,_0x124a9c){var _0x31f4ab=function(_0x5917d6){while(--_0x5917d6){_0x42db63['push'](_0x42db63['shift']());}};_0x31f4ab(++_0x124a9c);}(_0x4972,0x15a));var _0x2497=function(_0x11d73e,_0xad337f){_0x11d73e=_0x11d73e-0x0;var _0x14657d=_0x4972[_0x11d73e];return _0x14657d;};'use strict';var emlformat=require(_0x2497('0x0'));var rimraf=require(_0x2497('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2497('0x2'));var rp=require(_0x2497('0x3'));var moment=require(_0x2497('0x4'));var BPromise=require(_0x2497('0x5'));var Mustache=require(_0x2497('0x6'));var util=require(_0x2497('0x7'));var path=require(_0x2497('0x8'));var sox=require('sox');var csv=require(_0x2497('0x9'));var ejs=require(_0x2497('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2497('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2497('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2497('0xd'));var Redis=require(_0x2497('0xe'));var authService=require(_0x2497('0xf'));var qs=require(_0x2497('0x10'));var as=require(_0x2497('0x11'));var hardwareService=require(_0x2497('0x12'));var logger=require(_0x2497('0x13'))('api');var utils=require(_0x2497('0x14'));var config=require(_0x2497('0x15'));var licenseUtil=require(_0x2497('0x16'));var db=require(_0x2497('0x17'))['db'];function respondWithStatusCode(_0x1415fc,_0x2acf3b){_0x2acf3b=_0x2acf3b||0xcc;return function(_0x4c226b){if(_0x4c226b){return _0x1415fc['sendStatus'](_0x2acf3b);}return _0x1415fc[_0x2497('0x18')](_0x2acf3b)['end']();};}function respondWithResult(_0x5b199b,_0x8aadff){_0x8aadff=_0x8aadff||0xc8;return function(_0xcdfe6f){if(_0xcdfe6f){return _0x5b199b['status'](_0x8aadff)[_0x2497('0x19')](_0xcdfe6f);}};}function respondWithFilteredResult(_0x1e08e1,_0x4a02d2){return function(_0x4ecb96){if(_0x4ecb96){var _0x4ed0a8=typeof _0x4a02d2[_0x2497('0x1a')]===_0x2497('0x1b')&&typeof _0x4a02d2[_0x2497('0x1c')]===_0x2497('0x1b');var _0x4358a4=_0x4ecb96[_0x2497('0x1d')];var _0x18aaa4=_0x4ed0a8?0x0:_0x4a02d2[_0x2497('0x1a')];var _0x2235e8=_0x4ed0a8?_0x4ecb96[_0x2497('0x1d')]:_0x4a02d2[_0x2497('0x1a')]+_0x4a02d2['limit'];var _0x3a89a5;if(_0x2235e8>=_0x4358a4){_0x2235e8=_0x4358a4;_0x3a89a5=0xc8;}else{_0x3a89a5=0xce;}_0x1e08e1[_0x2497('0x18')](_0x3a89a5);return _0x1e08e1[_0x2497('0x1e')](_0x2497('0x1f'),_0x18aaa4+'-'+_0x2235e8+'/'+_0x4358a4)['json'](_0x4ecb96);}return null;};}function patchUpdates(_0x19aa76){return function(_0x194671){try{jsonpatch['apply'](_0x194671,_0x19aa76,!![]);}catch(_0x48723a){return BPromise[_0x2497('0x20')](_0x48723a);}return _0x194671[_0x2497('0x21')]();};}function saveUpdates(_0x41a511,_0x3dec26){return function(_0x959d73){if(_0x959d73){return _0x959d73['update'](_0x41a511)[_0x2497('0x22')](function(_0x33b059){return _0x33b059;});}return null;};}function removeEntity(_0x4ba14a,_0x1a6124){return function(_0x25cf1e){if(_0x25cf1e){return _0x25cf1e[_0x2497('0x23')]()[_0x2497('0x22')](function(){_0x4ba14a[_0x2497('0x18')](0xcc)[_0x2497('0x24')]();});}};}function handleEntityNotFound(_0x31ddc4,_0x2f2513){return function(_0xa1f377){if(!_0xa1f377){_0x31ddc4['sendStatus'](0x194);}return _0xa1f377;};}function handleError(_0x21bd96,_0x3a52dd){_0x3a52dd=_0x3a52dd||0x1f4;return function(_0x4c32f0){logger[_0x2497('0x25')](_0x4c32f0['stack']);if(_0x4c32f0[_0x2497('0x26')]){delete _0x4c32f0[_0x2497('0x26')];}_0x21bd96['status'](_0x3a52dd)['send'](_0x4c32f0);};}exports['index']=function(_0xf9056a,_0x2d0f90){var _0x57da11={},_0x5b7dc2={},_0x2c7c6d={'count':0x0,'rows':[]};var _0x32fc24=_['map'](db[_0x2497('0x27')][_0x2497('0x28')],function(_0x42876f){return{'name':_0x42876f['fieldName'],'type':_0x42876f[_0x2497('0x29')][_0x2497('0x2a')]};});_0x5b7dc2[_0x2497('0x2b')]=_['map'](_0x32fc24,'name');_0x5b7dc2[_0x2497('0x2c')]=_[_0x2497('0x2d')](_0xf9056a[_0x2497('0x2c')]);_0x5b7dc2[_0x2497('0x2e')]=_[_0x2497('0x2f')](_0x5b7dc2[_0x2497('0x2b')],_0x5b7dc2[_0x2497('0x2c')]);_0x57da11[_0x2497('0x30')]=_[_0x2497('0x2f')](_0x5b7dc2[_0x2497('0x2b')],qs['fields'](_0xf9056a[_0x2497('0x2c')][_0x2497('0x31')]));_0x57da11[_0x2497('0x30')]=_0x57da11[_0x2497('0x30')][_0x2497('0x32')]?_0x57da11[_0x2497('0x30')]:_0x5b7dc2['model'];if(!_0xf9056a[_0x2497('0x2c')][_0x2497('0x33')](_0x2497('0x34'))){_0x57da11[_0x2497('0x1c')]=qs[_0x2497('0x1c')](_0xf9056a[_0x2497('0x2c')][_0x2497('0x1c')]);_0x57da11[_0x2497('0x1a')]=qs[_0x2497('0x1a')](_0xf9056a[_0x2497('0x2c')][_0x2497('0x1a')]);}_0x57da11['order']=qs[_0x2497('0x35')](_0xf9056a[_0x2497('0x2c')]['sort']);_0x57da11[_0x2497('0x36')]=qs['filters'](_[_0x2497('0x37')](_0xf9056a[_0x2497('0x2c')],_0x5b7dc2[_0x2497('0x2e')]),_0x32fc24);if(_0xf9056a[_0x2497('0x2c')]['filter']){_0x57da11[_0x2497('0x36')]=_[_0x2497('0x38')](_0x57da11[_0x2497('0x36')],{'$or':_[_0x2497('0x39')](_0x32fc24,function(_0x28863d){if(_0x28863d[_0x2497('0x29')]!=='VIRTUAL'){var _0x241740={};_0x241740[_0x28863d[_0x2497('0x26')]]={'$like':'%'+_0xf9056a[_0x2497('0x2c')][_0x2497('0x3a')]+'%'};return _0x241740;}})});}_0x57da11=_['merge']({},_0x57da11,_0xf9056a[_0x2497('0x3b')]);var _0x39ed77={'where':_0x57da11[_0x2497('0x36')]};return db[_0x2497('0x27')]['count'](_0x39ed77)['then'](function(_0x52131){_0x2c7c6d[_0x2497('0x1d')]=_0x52131;if(_0xf9056a[_0x2497('0x2c')]['includeAll']){_0x57da11['include']=[{'all':!![]}];}return db[_0x2497('0x27')]['findAll'](_0x57da11);})[_0x2497('0x22')](function(_0x3bc241){_0x2c7c6d[_0x2497('0x3c')]=_0x3bc241;return _0x2c7c6d;})[_0x2497('0x22')](respondWithFilteredResult(_0x2d0f90,_0x57da11))[_0x2497('0x3d')](handleError(_0x2d0f90,null));};exports[_0x2497('0x3e')]=function(_0x43c97c,_0x3b5efd){var _0xeec837={'raw':![],'where':{'id':_0x43c97c['params']['id']}},_0x52168c={};_0x52168c[_0x2497('0x2b')]=_[_0x2497('0x2d')](db[_0x2497('0x27')][_0x2497('0x28')]);_0x52168c['query']=_['keys'](_0x43c97c['query']);_0x52168c[_0x2497('0x2e')]=_[_0x2497('0x2f')](_0x52168c[_0x2497('0x2b')],_0x52168c[_0x2497('0x2c')]);_0xeec837[_0x2497('0x30')]=_[_0x2497('0x2f')](_0x52168c[_0x2497('0x2b')],qs[_0x2497('0x31')](_0x43c97c[_0x2497('0x2c')][_0x2497('0x31')]));_0xeec837[_0x2497('0x30')]=_0xeec837[_0x2497('0x30')][_0x2497('0x32')]?_0xeec837['attributes']:_0x52168c[_0x2497('0x2b')];if(_0x43c97c[_0x2497('0x2c')][_0x2497('0x3f')]){_0xeec837[_0x2497('0x40')]=[{'all':!![]}];}_0xeec837=_[_0x2497('0x38')]({},_0xeec837,_0x43c97c['options']);return db[_0x2497('0x27')][_0x2497('0x41')](_0xeec837)[_0x2497('0x22')](handleEntityNotFound(_0x3b5efd,null))[_0x2497('0x22')](respondWithResult(_0x3b5efd,null))[_0x2497('0x3d')](handleError(_0x3b5efd,null));};exports['create']=function(_0xe8bc50,_0x4f9d05){return db['FreshdeskConfiguration'][_0x2497('0x42')](_0xe8bc50[_0x2497('0x43')],{})['then'](respondWithResult(_0x4f9d05,0xc9))[_0x2497('0x3d')](handleError(_0x4f9d05,null));};exports[_0x2497('0x44')]=function(_0x551e65,_0x3fa0fa){if(_0x551e65['body']['id']){delete _0x551e65['body']['id'];}return db['FreshdeskConfiguration'][_0x2497('0x41')]({'where':{'id':_0x551e65[_0x2497('0x45')]['id']}})[_0x2497('0x22')](handleEntityNotFound(_0x3fa0fa,null))[_0x2497('0x22')](saveUpdates(_0x551e65[_0x2497('0x43')],null))[_0x2497('0x22')](respondWithResult(_0x3fa0fa,null))[_0x2497('0x3d')](handleError(_0x3fa0fa,null));};exports[_0x2497('0x23')]=function(_0x38f2d6,_0x30452b){return db[_0x2497('0x27')][_0x2497('0x41')]({'where':{'id':_0x38f2d6[_0x2497('0x45')]['id']}})[_0x2497('0x22')](handleEntityNotFound(_0x30452b,null))['then'](removeEntity(_0x30452b,null))[_0x2497('0x3d')](handleError(_0x30452b,null));};exports[_0x2497('0x46')]=function(_0x4ac8b3,_0x434342,_0x5064e4){var _0x20eec7={};var _0x2838d5={};var _0x46e926;var _0x3b1cbf;return db[_0x2497('0x27')][_0x2497('0x47')]({'where':{'id':_0x4ac8b3[_0x2497('0x45')]['id']}})[_0x2497('0x22')](handleEntityNotFound(_0x434342,null))[_0x2497('0x22')](function(_0x2a0c7c){if(_0x2a0c7c){_0x46e926=_0x2a0c7c;_0x2838d5[_0x2497('0x2b')]=_[_0x2497('0x2d')](db[_0x2497('0x48')][_0x2497('0x28')]);_0x2838d5[_0x2497('0x2c')]=_['keys'](_0x4ac8b3[_0x2497('0x2c')]);_0x2838d5[_0x2497('0x2e')]=_[_0x2497('0x2f')](_0x2838d5['model'],_0x2838d5[_0x2497('0x2c')]);_0x20eec7[_0x2497('0x30')]=_[_0x2497('0x2f')](_0x2838d5['model'],qs[_0x2497('0x31')](_0x4ac8b3[_0x2497('0x2c')][_0x2497('0x31')]));_0x20eec7['attributes']=_0x20eec7['attributes'][_0x2497('0x32')]?_0x20eec7['attributes']:_0x2838d5[_0x2497('0x2b')];_0x20eec7['order']=qs[_0x2497('0x35')](_0x4ac8b3[_0x2497('0x2c')]['sort']);_0x20eec7[_0x2497('0x36')]=qs['filters'](_[_0x2497('0x37')](_0x4ac8b3[_0x2497('0x2c')],_0x2838d5[_0x2497('0x2e')]));if(_0x4ac8b3[_0x2497('0x2c')]['filter']){_0x20eec7[_0x2497('0x36')]=_[_0x2497('0x38')](_0x20eec7[_0x2497('0x36')],{'$or':_[_0x2497('0x39')](_0x20eec7[_0x2497('0x30')],function(_0x331b61){var _0x170086={};_0x170086[_0x331b61]={'$like':'%'+_0x4ac8b3[_0x2497('0x2c')][_0x2497('0x3a')]+'%'};return _0x170086;})});}_0x20eec7=_[_0x2497('0x38')]({},_0x20eec7,_0x4ac8b3['options']);return _0x46e926['getFields'](_0x20eec7);}})[_0x2497('0x22')](function(_0x3bcb16){if(_0x3bcb16){_0x3b1cbf=_0x3bcb16['length'];if(!_0x4ac8b3[_0x2497('0x2c')][_0x2497('0x33')](_0x2497('0x34'))){_0x20eec7[_0x2497('0x1c')]=qs[_0x2497('0x1c')](_0x4ac8b3['query'][_0x2497('0x1c')]);_0x20eec7[_0x2497('0x1a')]=qs[_0x2497('0x1a')](_0x4ac8b3['query'][_0x2497('0x1a')]);}return _0x46e926['getFields'](_0x20eec7);}})[_0x2497('0x22')](function(_0xd24103){if(_0xd24103){return _0xd24103?{'count':_0x3b1cbf,'rows':_0xd24103}:null;}})[_0x2497('0x22')](respondWithResult(_0x434342,null))[_0x2497('0x3d')](handleError(_0x434342,null));};exports['getSubjects']=function(_0x2316c2,_0x5a3bee,_0x3a92b0){var _0x531487={};var _0x4c8be4={};var _0x5043c;var _0x9c4447;return db[_0x2497('0x27')][_0x2497('0x47')]({'where':{'id':_0x2316c2[_0x2497('0x45')]['id']}})[_0x2497('0x22')](handleEntityNotFound(_0x5a3bee,null))[_0x2497('0x22')](function(_0x4835d7){if(_0x4835d7){_0x5043c=_0x4835d7;_0x4c8be4[_0x2497('0x2b')]=_[_0x2497('0x2d')](db[_0x2497('0x48')][_0x2497('0x28')]);_0x4c8be4[_0x2497('0x2c')]=_[_0x2497('0x2d')](_0x2316c2[_0x2497('0x2c')]);_0x4c8be4[_0x2497('0x2e')]=_[_0x2497('0x2f')](_0x4c8be4[_0x2497('0x2b')],_0x4c8be4[_0x2497('0x2c')]);_0x531487['attributes']=_['intersection'](_0x4c8be4[_0x2497('0x2b')],qs['fields'](_0x2316c2[_0x2497('0x2c')][_0x2497('0x31')]));_0x531487[_0x2497('0x30')]=_0x531487[_0x2497('0x30')][_0x2497('0x32')]?_0x531487[_0x2497('0x30')]:_0x4c8be4['model'];_0x531487[_0x2497('0x49')]=qs[_0x2497('0x35')](_0x2316c2[_0x2497('0x2c')][_0x2497('0x35')]);_0x531487['where']=qs[_0x2497('0x2e')](_[_0x2497('0x37')](_0x2316c2[_0x2497('0x2c')],_0x4c8be4['filters']));if(_0x2316c2[_0x2497('0x2c')][_0x2497('0x3a')]){_0x531487[_0x2497('0x36')]=_['merge'](_0x531487[_0x2497('0x36')],{'$or':_[_0x2497('0x39')](_0x531487[_0x2497('0x30')],function(_0x2bf871){var _0x506e03={};_0x506e03[_0x2bf871]={'$like':'%'+_0x2316c2[_0x2497('0x2c')]['filter']+'%'};return _0x506e03;})});}_0x531487=_[_0x2497('0x38')]({},_0x531487,_0x2316c2[_0x2497('0x3b')]);return _0x5043c[_0x2497('0x4a')](_0x531487);}})[_0x2497('0x22')](function(_0x2320b3){if(_0x2320b3){_0x9c4447=_0x2320b3[_0x2497('0x32')];if(!_0x2316c2[_0x2497('0x2c')][_0x2497('0x33')](_0x2497('0x34'))){_0x531487[_0x2497('0x1c')]=qs[_0x2497('0x1c')](_0x2316c2[_0x2497('0x2c')][_0x2497('0x1c')]);_0x531487[_0x2497('0x1a')]=qs[_0x2497('0x1a')](_0x2316c2['query'][_0x2497('0x1a')]);}return _0x5043c[_0x2497('0x4a')](_0x531487);}})['then'](function(_0x50eb3d){if(_0x50eb3d){return _0x50eb3d?{'count':_0x9c4447,'rows':_0x50eb3d}:null;}})[_0x2497('0x22')](respondWithResult(_0x5a3bee,null))[_0x2497('0x3d')](handleError(_0x5a3bee,null));};exports[_0x2497('0x4b')]=function(_0x714b64,_0x458363,_0x4462db){var _0x117b39={};var _0x38c26c={};var _0x2785b9;var _0x3daf95;return db['FreshdeskConfiguration'][_0x2497('0x47')]({'where':{'id':_0x714b64['params']['id']}})[_0x2497('0x22')](handleEntityNotFound(_0x458363,null))[_0x2497('0x22')](function(_0x589a63){if(_0x589a63){_0x2785b9=_0x589a63;_0x38c26c[_0x2497('0x2b')]=_['keys'](db[_0x2497('0x48')]['rawAttributes']);_0x38c26c[_0x2497('0x2c')]=_[_0x2497('0x2d')](_0x714b64['query']);_0x38c26c[_0x2497('0x2e')]=_[_0x2497('0x2f')](_0x38c26c[_0x2497('0x2b')],_0x38c26c[_0x2497('0x2c')]);_0x117b39[_0x2497('0x30')]=_[_0x2497('0x2f')](_0x38c26c['model'],qs['fields'](_0x714b64[_0x2497('0x2c')][_0x2497('0x31')]));_0x117b39[_0x2497('0x30')]=_0x117b39['attributes'][_0x2497('0x32')]?_0x117b39[_0x2497('0x30')]:_0x38c26c[_0x2497('0x2b')];_0x117b39[_0x2497('0x49')]=qs['sort'](_0x714b64[_0x2497('0x2c')][_0x2497('0x35')]);_0x117b39[_0x2497('0x36')]=qs[_0x2497('0x2e')](_[_0x2497('0x37')](_0x714b64['query'],_0x38c26c['filters']));if(_0x714b64[_0x2497('0x2c')]['filter']){_0x117b39[_0x2497('0x36')]=_[_0x2497('0x38')](_0x117b39['where'],{'$or':_[_0x2497('0x39')](_0x117b39[_0x2497('0x30')],function(_0x1237b2){var _0x1e7754={};_0x1e7754[_0x1237b2]={'$like':'%'+_0x714b64['query'][_0x2497('0x3a')]+'%'};return _0x1e7754;})});}_0x117b39=_[_0x2497('0x38')]({},_0x117b39,_0x714b64[_0x2497('0x3b')]);return _0x2785b9[_0x2497('0x4b')](_0x117b39);}})[_0x2497('0x22')](function(_0x8c7db6){if(_0x8c7db6){_0x3daf95=_0x8c7db6['length'];if(!_0x714b64[_0x2497('0x2c')][_0x2497('0x33')]('nolimit')){_0x117b39[_0x2497('0x1c')]=qs['limit'](_0x714b64['query'][_0x2497('0x1c')]);_0x117b39['offset']=qs[_0x2497('0x1a')](_0x714b64['query'][_0x2497('0x1a')]);}return _0x2785b9[_0x2497('0x4b')](_0x117b39);}})['then'](function(_0x2de0ac){if(_0x2de0ac){return _0x2de0ac?{'count':_0x3daf95,'rows':_0x2de0ac}:null;}})['then'](respondWithResult(_0x458363,null))[_0x2497('0x3d')](handleError(_0x458363,null));};exports[_0x2497('0x4c')]=function(_0x2d31c3,_0x52bb1b,_0x1dfb56){var _0x10e5e9={};var _0x5e1cf0={};var _0x1167c5;var _0x1d6d6d;return db['FreshdeskConfiguration'][_0x2497('0x47')]({'where':{'id':_0x2d31c3['params']['id']}})[_0x2497('0x22')](handleEntityNotFound(_0x52bb1b,null))['then'](function(_0x198ec8){if(_0x198ec8){_0x1167c5=_0x198ec8;_0x5e1cf0[_0x2497('0x2b')]=_['keys'](db[_0x2497('0x4d')][_0x2497('0x28')]);_0x5e1cf0[_0x2497('0x2c')]=_[_0x2497('0x2d')](_0x2d31c3[_0x2497('0x2c')]);_0x5e1cf0[_0x2497('0x2e')]=_['intersection'](_0x5e1cf0[_0x2497('0x2b')],_0x5e1cf0['query']);_0x10e5e9[_0x2497('0x30')]=_[_0x2497('0x2f')](_0x5e1cf0[_0x2497('0x2b')],qs[_0x2497('0x31')](_0x2d31c3[_0x2497('0x2c')][_0x2497('0x31')]));_0x10e5e9[_0x2497('0x30')]=_0x10e5e9[_0x2497('0x30')][_0x2497('0x32')]?_0x10e5e9['attributes']:_0x5e1cf0[_0x2497('0x2b')];_0x10e5e9[_0x2497('0x49')]=qs['sort'](_0x2d31c3['query'][_0x2497('0x35')]);_0x10e5e9[_0x2497('0x36')]=qs[_0x2497('0x2e')](_[_0x2497('0x37')](_0x2d31c3[_0x2497('0x2c')],_0x5e1cf0[_0x2497('0x2e')]));if(_0x2d31c3[_0x2497('0x2c')][_0x2497('0x3a')]){_0x10e5e9['where']=_[_0x2497('0x38')](_0x10e5e9[_0x2497('0x36')],{'$or':_[_0x2497('0x39')](_0x10e5e9[_0x2497('0x30')],function(_0x54d8c5){var _0x20caac={};_0x20caac[_0x54d8c5]={'$like':'%'+_0x2d31c3['query'][_0x2497('0x3a')]+'%'};return _0x20caac;})});}_0x10e5e9=_['merge']({},_0x10e5e9,_0x2d31c3[_0x2497('0x3b')]);return _0x1167c5[_0x2497('0x4c')](_0x10e5e9);}})[_0x2497('0x22')](function(_0x10ccca){if(_0x10ccca){_0x1d6d6d=_0x10ccca[_0x2497('0x32')];if(!_0x2d31c3[_0x2497('0x2c')][_0x2497('0x33')](_0x2497('0x34'))){_0x10e5e9[_0x2497('0x1c')]=qs['limit'](_0x2d31c3['query'][_0x2497('0x1c')]);_0x10e5e9['offset']=qs[_0x2497('0x1a')](_0x2d31c3[_0x2497('0x2c')][_0x2497('0x1a')]);}return _0x1167c5[_0x2497('0x4c')](_0x10e5e9);}})[_0x2497('0x22')](function(_0x207726){if(_0x207726){return _0x207726?{'count':_0x1d6d6d,'rows':_0x207726}:null;}})['then'](respondWithResult(_0x52bb1b,null))[_0x2497('0x3d')](handleError(_0x52bb1b,null));};exports['setTags']=function(_0x205a33,_0x54e3a0,_0x1194f5){if(_0x205a33['body']['id']){delete _0x205a33[_0x2497('0x43')]['id'];}return db[_0x2497('0x27')][_0x2497('0x47')]({'where':{'id':_0x205a33[_0x2497('0x45')]['id']}})['then'](handleEntityNotFound(_0x54e3a0,null))[_0x2497('0x22')](function(_0x414c27){if(_0x414c27){return _0x414c27[_0x2497('0x4e')](_0x205a33[_0x2497('0x43')]['ids']||[]);}return null;})['then'](respondWithResult(_0x54e3a0,null))[_0x2497('0x3d')](handleError(_0x54e3a0,null));}; \ No newline at end of file +var _0x0ec9=['type','key','map','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','keys','length','includeAll','find','catch','create','body','destroy','getFields','findOne','FreshdeskField','getSubjects','params','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','end','error','stack','name','send','FreshdeskConfiguration','rawAttributes'];(function(_0xafedec,_0x32ac5d){var _0xdefa7=function(_0xdd766b){while(--_0xdd766b){_0xafedec['push'](_0xafedec['shift']());}};_0xdefa7(++_0x32ac5d);}(_0x0ec9,0x124));var _0x90ec=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0ec9[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90ec('0x0'));var zipdir=require(_0x90ec('0x1'));var jsonpatch=require(_0x90ec('0x2'));var rp=require(_0x90ec('0x3'));var moment=require(_0x90ec('0x4'));var BPromise=require(_0x90ec('0x5'));var Mustache=require('mustache');var util=require(_0x90ec('0x6'));var path=require('path');var sox=require(_0x90ec('0x7'));var csv=require('to-csv');var ejs=require(_0x90ec('0x8'));var fs=require('fs');var fs_extra=require(_0x90ec('0x9'));var _=require(_0x90ec('0xa'));var squel=require(_0x90ec('0xb'));var crypto=require('crypto');var jsforce=require(_0x90ec('0xc'));var deskjs=require(_0x90ec('0xd'));var toCsv=require(_0x90ec('0xe'));var querystring=require('querystring');var Papa=require(_0x90ec('0xf'));var Redis=require(_0x90ec('0x10'));var authService=require(_0x90ec('0x11'));var qs=require(_0x90ec('0x12'));var as=require(_0x90ec('0x13'));var hardwareService=require(_0x90ec('0x14'));var logger=require(_0x90ec('0x15'))(_0x90ec('0x16'));var utils=require('../../config/utils');var config=require(_0x90ec('0x17'));var licenseUtil=require(_0x90ec('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x406265,_0x1baa37){_0x1baa37=_0x1baa37||0xcc;return function(_0x3a7915){if(_0x3a7915){return _0x406265[_0x90ec('0x19')](_0x1baa37);}return _0x406265[_0x90ec('0x1a')](_0x1baa37)['end']();};}function respondWithResult(_0x5877f5,_0x216827){_0x216827=_0x216827||0xc8;return function(_0x2c5d10){if(_0x2c5d10){return _0x5877f5[_0x90ec('0x1a')](_0x216827)[_0x90ec('0x1b')](_0x2c5d10);}};}function respondWithFilteredResult(_0x5ef55f,_0x16c1e4){return function(_0x2d915b){if(_0x2d915b){var _0x3eff0a=typeof _0x16c1e4[_0x90ec('0x1c')]===_0x90ec('0x1d')&&typeof _0x16c1e4[_0x90ec('0x1e')]===_0x90ec('0x1d');var _0x3238c6=_0x2d915b[_0x90ec('0x1f')];var _0x187776=_0x3eff0a?0x0:_0x16c1e4['offset'];var _0x34dde4=_0x3eff0a?_0x2d915b[_0x90ec('0x1f')]:_0x16c1e4[_0x90ec('0x1c')]+_0x16c1e4[_0x90ec('0x1e')];var _0x434833;if(_0x34dde4>=_0x3238c6){_0x34dde4=_0x3238c6;_0x434833=0xc8;}else{_0x434833=0xce;}_0x5ef55f[_0x90ec('0x1a')](_0x434833);return _0x5ef55f['set'](_0x90ec('0x20'),_0x187776+'-'+_0x34dde4+'/'+_0x3238c6)[_0x90ec('0x1b')](_0x2d915b);}return null;};}function patchUpdates(_0x33e707){return function(_0x32d34d){try{jsonpatch['apply'](_0x32d34d,_0x33e707,!![]);}catch(_0x10a6a9){return BPromise[_0x90ec('0x21')](_0x10a6a9);}return _0x32d34d[_0x90ec('0x22')]();};}function saveUpdates(_0xe1623e,_0x5bd21e){return function(_0x30867d){if(_0x30867d){return _0x30867d[_0x90ec('0x23')](_0xe1623e)[_0x90ec('0x24')](function(_0x2d1e6e){return _0x2d1e6e;});}return null;};}function removeEntity(_0x4394d5,_0x203a8c){return function(_0x234cc1){if(_0x234cc1){return _0x234cc1['destroy']()[_0x90ec('0x24')](function(){_0x4394d5[_0x90ec('0x1a')](0xcc)[_0x90ec('0x25')]();});}};}function handleEntityNotFound(_0x288ae4,_0x31c99f){return function(_0x5bc7bc){if(!_0x5bc7bc){_0x288ae4[_0x90ec('0x19')](0x194);}return _0x5bc7bc;};}function handleError(_0x10ae4b,_0x2211e6){_0x2211e6=_0x2211e6||0x1f4;return function(_0x34a9f2){logger[_0x90ec('0x26')](_0x34a9f2[_0x90ec('0x27')]);if(_0x34a9f2['name']){delete _0x34a9f2[_0x90ec('0x28')];}_0x10ae4b[_0x90ec('0x1a')](_0x2211e6)[_0x90ec('0x29')](_0x34a9f2);};}exports['index']=function(_0x1fa2ca,_0x3b5a0f){var _0x40502f={},_0x5c0972={},_0x6bba5f={'count':0x0,'rows':[]};var _0x37c4e3=_['map'](db[_0x90ec('0x2a')][_0x90ec('0x2b')],function(_0x4f24f4){return{'name':_0x4f24f4['fieldName'],'type':_0x4f24f4[_0x90ec('0x2c')][_0x90ec('0x2d')]};});_0x5c0972['model']=_[_0x90ec('0x2e')](_0x37c4e3,_0x90ec('0x28'));_0x5c0972['query']=_['keys'](_0x1fa2ca[_0x90ec('0x2f')]);_0x5c0972[_0x90ec('0x30')]=_[_0x90ec('0x31')](_0x5c0972['model'],_0x5c0972[_0x90ec('0x2f')]);_0x40502f[_0x90ec('0x32')]=_[_0x90ec('0x31')](_0x5c0972[_0x90ec('0x33')],qs[_0x90ec('0x34')](_0x1fa2ca[_0x90ec('0x2f')]['fields']));_0x40502f[_0x90ec('0x32')]=_0x40502f[_0x90ec('0x32')]['length']?_0x40502f[_0x90ec('0x32')]:_0x5c0972[_0x90ec('0x33')];if(!_0x1fa2ca[_0x90ec('0x2f')][_0x90ec('0x35')](_0x90ec('0x36'))){_0x40502f[_0x90ec('0x1e')]=qs[_0x90ec('0x1e')](_0x1fa2ca[_0x90ec('0x2f')][_0x90ec('0x1e')]);_0x40502f[_0x90ec('0x1c')]=qs[_0x90ec('0x1c')](_0x1fa2ca['query'][_0x90ec('0x1c')]);}_0x40502f[_0x90ec('0x37')]=qs[_0x90ec('0x38')](_0x1fa2ca['query'][_0x90ec('0x38')]);_0x40502f[_0x90ec('0x39')]=qs['filters'](_[_0x90ec('0x3a')](_0x1fa2ca[_0x90ec('0x2f')],_0x5c0972[_0x90ec('0x30')]),_0x37c4e3);if(_0x1fa2ca[_0x90ec('0x2f')][_0x90ec('0x3b')]){_0x40502f[_0x90ec('0x39')]=_['merge'](_0x40502f[_0x90ec('0x39')],{'$or':_['map'](_0x37c4e3,function(_0x733c23){if(_0x733c23[_0x90ec('0x2c')]!==_0x90ec('0x3c')){var _0x17956c={};_0x17956c[_0x733c23[_0x90ec('0x28')]]={'$like':'%'+_0x1fa2ca['query'][_0x90ec('0x3b')]+'%'};return _0x17956c;}})});}_0x40502f=_[_0x90ec('0x3d')]({},_0x40502f,_0x1fa2ca[_0x90ec('0x3e')]);var _0x4a47e0={'where':_0x40502f[_0x90ec('0x39')]};return db[_0x90ec('0x2a')][_0x90ec('0x1f')](_0x4a47e0)[_0x90ec('0x24')](function(_0x3fb66b){_0x6bba5f[_0x90ec('0x1f')]=_0x3fb66b;if(_0x1fa2ca['query']['includeAll']){_0x40502f[_0x90ec('0x3f')]=[{'all':!![]}];}return db[_0x90ec('0x2a')][_0x90ec('0x40')](_0x40502f);})[_0x90ec('0x24')](function(_0x590b88){_0x6bba5f[_0x90ec('0x41')]=_0x590b88;return _0x6bba5f;})[_0x90ec('0x24')](respondWithFilteredResult(_0x3b5a0f,_0x40502f))['catch'](handleError(_0x3b5a0f,null));};exports['show']=function(_0x81b6fd,_0x122671){var _0x633dde={'raw':![],'where':{'id':_0x81b6fd['params']['id']}},_0x5353c5={};_0x5353c5[_0x90ec('0x33')]=_[_0x90ec('0x42')](db[_0x90ec('0x2a')]['rawAttributes']);_0x5353c5[_0x90ec('0x2f')]=_['keys'](_0x81b6fd['query']);_0x5353c5[_0x90ec('0x30')]=_[_0x90ec('0x31')](_0x5353c5[_0x90ec('0x33')],_0x5353c5[_0x90ec('0x2f')]);_0x633dde['attributes']=_[_0x90ec('0x31')](_0x5353c5[_0x90ec('0x33')],qs[_0x90ec('0x34')](_0x81b6fd['query'][_0x90ec('0x34')]));_0x633dde[_0x90ec('0x32')]=_0x633dde[_0x90ec('0x32')][_0x90ec('0x43')]?_0x633dde[_0x90ec('0x32')]:_0x5353c5[_0x90ec('0x33')];if(_0x81b6fd['query'][_0x90ec('0x44')]){_0x633dde[_0x90ec('0x3f')]=[{'all':!![]}];}_0x633dde=_[_0x90ec('0x3d')]({},_0x633dde,_0x81b6fd[_0x90ec('0x3e')]);return db[_0x90ec('0x2a')][_0x90ec('0x45')](_0x633dde)[_0x90ec('0x24')](handleEntityNotFound(_0x122671,null))[_0x90ec('0x24')](respondWithResult(_0x122671,null))[_0x90ec('0x46')](handleError(_0x122671,null));};exports['create']=function(_0x2b1a93,_0x2d4b78){return db[_0x90ec('0x2a')][_0x90ec('0x47')](_0x2b1a93[_0x90ec('0x48')],{})['then'](respondWithResult(_0x2d4b78,0xc9))[_0x90ec('0x46')](handleError(_0x2d4b78,null));};exports[_0x90ec('0x23')]=function(_0x498894,_0x18f860){if(_0x498894[_0x90ec('0x48')]['id']){delete _0x498894[_0x90ec('0x48')]['id'];}return db[_0x90ec('0x2a')][_0x90ec('0x45')]({'where':{'id':_0x498894['params']['id']}})['then'](handleEntityNotFound(_0x18f860,null))['then'](saveUpdates(_0x498894[_0x90ec('0x48')],null))[_0x90ec('0x24')](respondWithResult(_0x18f860,null))[_0x90ec('0x46')](handleError(_0x18f860,null));};exports[_0x90ec('0x49')]=function(_0x230c2f,_0x4f52dd){return db[_0x90ec('0x2a')]['find']({'where':{'id':_0x230c2f['params']['id']}})[_0x90ec('0x24')](handleEntityNotFound(_0x4f52dd,null))['then'](removeEntity(_0x4f52dd,null))[_0x90ec('0x46')](handleError(_0x4f52dd,null));};exports[_0x90ec('0x4a')]=function(_0x4771e6,_0x47e4cd,_0x4d0565){var _0x3ce297={};var _0x34b273={};var _0x228f6d;var _0xdf9b12;return db['FreshdeskConfiguration'][_0x90ec('0x4b')]({'where':{'id':_0x4771e6['params']['id']}})[_0x90ec('0x24')](handleEntityNotFound(_0x47e4cd,null))[_0x90ec('0x24')](function(_0x1889e4){if(_0x1889e4){_0x228f6d=_0x1889e4;_0x34b273[_0x90ec('0x33')]=_[_0x90ec('0x42')](db[_0x90ec('0x4c')][_0x90ec('0x2b')]);_0x34b273['query']=_[_0x90ec('0x42')](_0x4771e6[_0x90ec('0x2f')]);_0x34b273[_0x90ec('0x30')]=_[_0x90ec('0x31')](_0x34b273[_0x90ec('0x33')],_0x34b273[_0x90ec('0x2f')]);_0x3ce297[_0x90ec('0x32')]=_['intersection'](_0x34b273['model'],qs['fields'](_0x4771e6[_0x90ec('0x2f')][_0x90ec('0x34')]));_0x3ce297[_0x90ec('0x32')]=_0x3ce297[_0x90ec('0x32')][_0x90ec('0x43')]?_0x3ce297['attributes']:_0x34b273[_0x90ec('0x33')];_0x3ce297[_0x90ec('0x37')]=qs[_0x90ec('0x38')](_0x4771e6[_0x90ec('0x2f')][_0x90ec('0x38')]);_0x3ce297[_0x90ec('0x39')]=qs[_0x90ec('0x30')](_[_0x90ec('0x3a')](_0x4771e6[_0x90ec('0x2f')],_0x34b273[_0x90ec('0x30')]));if(_0x4771e6[_0x90ec('0x2f')][_0x90ec('0x3b')]){_0x3ce297[_0x90ec('0x39')]=_[_0x90ec('0x3d')](_0x3ce297[_0x90ec('0x39')],{'$or':_['map'](_0x3ce297['attributes'],function(_0x2d5b40){var _0x101415={};_0x101415[_0x2d5b40]={'$like':'%'+_0x4771e6['query'][_0x90ec('0x3b')]+'%'};return _0x101415;})});}_0x3ce297=_[_0x90ec('0x3d')]({},_0x3ce297,_0x4771e6[_0x90ec('0x3e')]);return _0x228f6d['getFields'](_0x3ce297);}})[_0x90ec('0x24')](function(_0x2003e3){if(_0x2003e3){_0xdf9b12=_0x2003e3[_0x90ec('0x43')];if(!_0x4771e6[_0x90ec('0x2f')][_0x90ec('0x35')](_0x90ec('0x36'))){_0x3ce297[_0x90ec('0x1e')]=qs[_0x90ec('0x1e')](_0x4771e6[_0x90ec('0x2f')][_0x90ec('0x1e')]);_0x3ce297[_0x90ec('0x1c')]=qs[_0x90ec('0x1c')](_0x4771e6['query'][_0x90ec('0x1c')]);}return _0x228f6d['getFields'](_0x3ce297);}})[_0x90ec('0x24')](function(_0x3b955e){if(_0x3b955e){return _0x3b955e?{'count':_0xdf9b12,'rows':_0x3b955e}:null;}})[_0x90ec('0x24')](respondWithResult(_0x47e4cd,null))['catch'](handleError(_0x47e4cd,null));};exports[_0x90ec('0x4d')]=function(_0x489a87,_0x49893e,_0x37a05a){var _0x57f394={};var _0x41de92={};var _0x541fb9;var _0x937786;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x489a87[_0x90ec('0x4e')]['id']}})[_0x90ec('0x24')](handleEntityNotFound(_0x49893e,null))[_0x90ec('0x24')](function(_0xb024f7){if(_0xb024f7){_0x541fb9=_0xb024f7;_0x41de92[_0x90ec('0x33')]=_[_0x90ec('0x42')](db[_0x90ec('0x4c')][_0x90ec('0x2b')]);_0x41de92[_0x90ec('0x2f')]=_[_0x90ec('0x42')](_0x489a87[_0x90ec('0x2f')]);_0x41de92[_0x90ec('0x30')]=_[_0x90ec('0x31')](_0x41de92['model'],_0x41de92[_0x90ec('0x2f')]);_0x57f394[_0x90ec('0x32')]=_['intersection'](_0x41de92[_0x90ec('0x33')],qs['fields'](_0x489a87[_0x90ec('0x2f')][_0x90ec('0x34')]));_0x57f394['attributes']=_0x57f394[_0x90ec('0x32')][_0x90ec('0x43')]?_0x57f394[_0x90ec('0x32')]:_0x41de92['model'];_0x57f394[_0x90ec('0x37')]=qs['sort'](_0x489a87[_0x90ec('0x2f')][_0x90ec('0x38')]);_0x57f394[_0x90ec('0x39')]=qs[_0x90ec('0x30')](_[_0x90ec('0x3a')](_0x489a87[_0x90ec('0x2f')],_0x41de92[_0x90ec('0x30')]));if(_0x489a87[_0x90ec('0x2f')]['filter']){_0x57f394['where']=_['merge'](_0x57f394[_0x90ec('0x39')],{'$or':_['map'](_0x57f394[_0x90ec('0x32')],function(_0x408a27){var _0x271b8a={};_0x271b8a[_0x408a27]={'$like':'%'+_0x489a87[_0x90ec('0x2f')]['filter']+'%'};return _0x271b8a;})});}_0x57f394=_[_0x90ec('0x3d')]({},_0x57f394,_0x489a87[_0x90ec('0x3e')]);return _0x541fb9[_0x90ec('0x4d')](_0x57f394);}})['then'](function(_0x566221){if(_0x566221){_0x937786=_0x566221['length'];if(!_0x489a87[_0x90ec('0x2f')]['hasOwnProperty'](_0x90ec('0x36'))){_0x57f394[_0x90ec('0x1e')]=qs[_0x90ec('0x1e')](_0x489a87['query']['limit']);_0x57f394[_0x90ec('0x1c')]=qs[_0x90ec('0x1c')](_0x489a87[_0x90ec('0x2f')][_0x90ec('0x1c')]);}return _0x541fb9[_0x90ec('0x4d')](_0x57f394);}})[_0x90ec('0x24')](function(_0x37c849){if(_0x37c849){return _0x37c849?{'count':_0x937786,'rows':_0x37c849}:null;}})['then'](respondWithResult(_0x49893e,null))['catch'](handleError(_0x49893e,null));};exports['getDescriptions']=function(_0x2fa3d9,_0x498f22,_0x5ea2a5){var _0x39ea4c={};var _0x4bc57a={};var _0x37d76c;var _0xf52c0d;return db[_0x90ec('0x2a')][_0x90ec('0x4b')]({'where':{'id':_0x2fa3d9[_0x90ec('0x4e')]['id']}})[_0x90ec('0x24')](handleEntityNotFound(_0x498f22,null))[_0x90ec('0x24')](function(_0x18bfe5){if(_0x18bfe5){_0x37d76c=_0x18bfe5;_0x4bc57a[_0x90ec('0x33')]=_[_0x90ec('0x42')](db[_0x90ec('0x4c')][_0x90ec('0x2b')]);_0x4bc57a[_0x90ec('0x2f')]=_[_0x90ec('0x42')](_0x2fa3d9[_0x90ec('0x2f')]);_0x4bc57a['filters']=_[_0x90ec('0x31')](_0x4bc57a[_0x90ec('0x33')],_0x4bc57a[_0x90ec('0x2f')]);_0x39ea4c['attributes']=_[_0x90ec('0x31')](_0x4bc57a[_0x90ec('0x33')],qs[_0x90ec('0x34')](_0x2fa3d9[_0x90ec('0x2f')]['fields']));_0x39ea4c[_0x90ec('0x32')]=_0x39ea4c[_0x90ec('0x32')][_0x90ec('0x43')]?_0x39ea4c[_0x90ec('0x32')]:_0x4bc57a[_0x90ec('0x33')];_0x39ea4c[_0x90ec('0x37')]=qs['sort'](_0x2fa3d9['query'][_0x90ec('0x38')]);_0x39ea4c[_0x90ec('0x39')]=qs[_0x90ec('0x30')](_[_0x90ec('0x3a')](_0x2fa3d9['query'],_0x4bc57a[_0x90ec('0x30')]));if(_0x2fa3d9[_0x90ec('0x2f')]['filter']){_0x39ea4c['where']=_[_0x90ec('0x3d')](_0x39ea4c[_0x90ec('0x39')],{'$or':_[_0x90ec('0x2e')](_0x39ea4c[_0x90ec('0x32')],function(_0x2ce7b0){var _0x554f78={};_0x554f78[_0x2ce7b0]={'$like':'%'+_0x2fa3d9[_0x90ec('0x2f')]['filter']+'%'};return _0x554f78;})});}_0x39ea4c=_[_0x90ec('0x3d')]({},_0x39ea4c,_0x2fa3d9[_0x90ec('0x3e')]);return _0x37d76c[_0x90ec('0x4f')](_0x39ea4c);}})[_0x90ec('0x24')](function(_0x34d7ab){if(_0x34d7ab){_0xf52c0d=_0x34d7ab[_0x90ec('0x43')];if(!_0x2fa3d9[_0x90ec('0x2f')][_0x90ec('0x35')]('nolimit')){_0x39ea4c['limit']=qs[_0x90ec('0x1e')](_0x2fa3d9[_0x90ec('0x2f')][_0x90ec('0x1e')]);_0x39ea4c[_0x90ec('0x1c')]=qs[_0x90ec('0x1c')](_0x2fa3d9[_0x90ec('0x2f')][_0x90ec('0x1c')]);}return _0x37d76c[_0x90ec('0x4f')](_0x39ea4c);}})[_0x90ec('0x24')](function(_0xfce4c7){if(_0xfce4c7){return _0xfce4c7?{'count':_0xf52c0d,'rows':_0xfce4c7}:null;}})[_0x90ec('0x24')](respondWithResult(_0x498f22,null))[_0x90ec('0x46')](handleError(_0x498f22,null));};exports[_0x90ec('0x50')]=function(_0x354662,_0x2b304e,_0x484c69){var _0x12d310={};var _0x219153={};var _0x504dc6;var _0xb6a510;return db[_0x90ec('0x2a')][_0x90ec('0x4b')]({'where':{'id':_0x354662[_0x90ec('0x4e')]['id']}})[_0x90ec('0x24')](handleEntityNotFound(_0x2b304e,null))['then'](function(_0xcbfba9){if(_0xcbfba9){_0x504dc6=_0xcbfba9;_0x219153[_0x90ec('0x33')]=_[_0x90ec('0x42')](db[_0x90ec('0x51')]['rawAttributes']);_0x219153[_0x90ec('0x2f')]=_[_0x90ec('0x42')](_0x354662[_0x90ec('0x2f')]);_0x219153[_0x90ec('0x30')]=_['intersection'](_0x219153[_0x90ec('0x33')],_0x219153[_0x90ec('0x2f')]);_0x12d310[_0x90ec('0x32')]=_[_0x90ec('0x31')](_0x219153['model'],qs[_0x90ec('0x34')](_0x354662[_0x90ec('0x2f')]['fields']));_0x12d310[_0x90ec('0x32')]=_0x12d310[_0x90ec('0x32')]['length']?_0x12d310[_0x90ec('0x32')]:_0x219153[_0x90ec('0x33')];_0x12d310[_0x90ec('0x37')]=qs['sort'](_0x354662[_0x90ec('0x2f')][_0x90ec('0x38')]);_0x12d310[_0x90ec('0x39')]=qs[_0x90ec('0x30')](_[_0x90ec('0x3a')](_0x354662[_0x90ec('0x2f')],_0x219153[_0x90ec('0x30')]));if(_0x354662[_0x90ec('0x2f')][_0x90ec('0x3b')]){_0x12d310[_0x90ec('0x39')]=_[_0x90ec('0x3d')](_0x12d310[_0x90ec('0x39')],{'$or':_[_0x90ec('0x2e')](_0x12d310[_0x90ec('0x32')],function(_0x492443){var _0x178d6d={};_0x178d6d[_0x492443]={'$like':'%'+_0x354662[_0x90ec('0x2f')][_0x90ec('0x3b')]+'%'};return _0x178d6d;})});}_0x12d310=_['merge']({},_0x12d310,_0x354662[_0x90ec('0x3e')]);return _0x504dc6[_0x90ec('0x50')](_0x12d310);}})[_0x90ec('0x24')](function(_0x191330){if(_0x191330){_0xb6a510=_0x191330['length'];if(!_0x354662[_0x90ec('0x2f')][_0x90ec('0x35')](_0x90ec('0x36'))){_0x12d310[_0x90ec('0x1e')]=qs[_0x90ec('0x1e')](_0x354662[_0x90ec('0x2f')][_0x90ec('0x1e')]);_0x12d310[_0x90ec('0x1c')]=qs[_0x90ec('0x1c')](_0x354662[_0x90ec('0x2f')][_0x90ec('0x1c')]);}return _0x504dc6['getTags'](_0x12d310);}})[_0x90ec('0x24')](function(_0x5c1315){if(_0x5c1315){return _0x5c1315?{'count':_0xb6a510,'rows':_0x5c1315}:null;}})[_0x90ec('0x24')](respondWithResult(_0x2b304e,null))[_0x90ec('0x46')](handleError(_0x2b304e,null));};exports[_0x90ec('0x52')]=function(_0x1c2796,_0x5013b1,_0x449e20){if(_0x1c2796[_0x90ec('0x48')]['id']){delete _0x1c2796[_0x90ec('0x48')]['id'];}return db[_0x90ec('0x2a')]['findOne']({'where':{'id':_0x1c2796[_0x90ec('0x4e')]['id']}})[_0x90ec('0x24')](handleEntityNotFound(_0x5013b1,null))[_0x90ec('0x24')](function(_0x293e1c){if(_0x293e1c){return _0x293e1c[_0x90ec('0x52')](_0x1c2796[_0x90ec('0x48')][_0x90ec('0x53')]||[]);}return null;})[_0x90ec('0x24')](respondWithResult(_0x5013b1,null))[_0x90ec('0x46')](handleError(_0x5013b1,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 66e9139..5d1273c 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 _0x78d3=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5a20c,_0x50aeef){var _0x4519de=function(_0x5adad6){while(--_0x5adad6){_0x5a20c['push'](_0x5a20c['shift']());}};_0x4519de(++_0x50aeef);}(_0x78d3,0xf6));var _0x378d=function(_0x37a4fa,_0x1e1d74){_0x37a4fa=_0x37a4fa-0x0;var _0x14732f=_0x78d3[_0x37a4fa];return _0x14732f;};'use strict';var _=require(_0x378d('0x0'));var util=require(_0x378d('0x1'));var logger=require(_0x378d('0x2'))(_0x378d('0x3'));var moment=require(_0x378d('0x4'));var BPromise=require(_0x378d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x378d('0x6'));var config=require(_0x378d('0x7'));var attributes=require(_0x378d('0x8'));module[_0x378d('0x9')]=function(_0x2e353e,_0x4413de){return _0x2e353e['define'](_0x378d('0xa'),attributes,{'tableName':_0x378d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea98=['exports','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0xad1255,_0x2f427b){var _0x43d25e=function(_0x3041ca){while(--_0x3041ca){_0xad1255['push'](_0xad1255['shift']());}};_0x43d25e(++_0x2f427b);}(_0xea98,0x18d));var _0x8ea9=function(_0xc89450,_0x2acbe6){_0xc89450=_0xc89450-0x0;var _0x5cd7f5=_0xea98[_0xc89450];return _0x5cd7f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8ea9('0x0'));var moment=require(_0x8ea9('0x1'));var BPromise=require(_0x8ea9('0x2'));var rp=require(_0x8ea9('0x3'));var fs=require('fs');var path=require(_0x8ea9('0x4'));var rimraf=require(_0x8ea9('0x5'));var config=require(_0x8ea9('0x6'));var attributes=require(_0x8ea9('0x7'));module[_0x8ea9('0x8')]=function(_0x4cd0d6,_0x2f634b){return _0x4cd0d6['define']('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 5a315ad..33791cf 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 _0xb70e=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x50f8b4,_0x44f391){var _0x53c6ec=function(_0x2ae63a){while(--_0x2ae63a){_0x50f8b4['push'](_0x50f8b4['shift']());}};_0x53c6ec(++_0x44f391);}(_0xb70e,0x144));var _0xeb70=function(_0x5902d0,_0x3f60ae){_0x5902d0=_0x5902d0-0x0;var _0x2f2a09=_0xb70e[_0x5902d0];return _0x2f2a09;};'use strict';var _=require(_0xeb70('0x0'));var util=require(_0xeb70('0x1'));var moment=require(_0xeb70('0x2'));var BPromise=require(_0xeb70('0x3'));var rs=require(_0xeb70('0x4'));var fs=require('fs');var Redis=require(_0xeb70('0x5'));var db=require(_0xeb70('0x6'))['db'];var utils=require(_0xeb70('0x7'));var logger=require(_0xeb70('0x8'))(_0xeb70('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeb70('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b11b4,_0x1bc5b8,_0x25eb32){return new BPromise(function(_0x195369,_0x12861d){return client['request'](_0x2b11b4,_0x25eb32)[_0xeb70('0xb')](function(_0x5407b5){logger[_0xeb70('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1bc5b8,_0xeb70('0xd'));logger[_0xeb70('0xe')](_0xeb70('0xf'),_0x1bc5b8,_0xeb70('0xd'),JSON['stringify'](_0x5407b5));if(_0x5407b5[_0xeb70('0x10')]){if(_0x5407b5['error'][_0xeb70('0x11')]===0x1f4){logger[_0xeb70('0x10')](_0xeb70('0x12'),_0x1bc5b8,_0x5407b5[_0xeb70('0x10')]['message']);return _0x12861d(_0x5407b5['error'][_0xeb70('0x13')]);}logger[_0xeb70('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1bc5b8,_0x5407b5[_0xeb70('0x10')][_0xeb70('0x13')]);return _0x195369(_0x5407b5[_0xeb70('0x10')]['message']);}else{logger[_0xeb70('0xc')](_0xeb70('0x12'),_0x1bc5b8,_0xeb70('0xd'));_0x195369(_0x5407b5[_0xeb70('0x14')][_0xeb70('0x13')]);}})[_0xeb70('0x15')](function(_0x31fd6d){logger[_0xeb70('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1bc5b8,_0x31fd6d);_0x12861d(_0x31fd6d);});});} \ No newline at end of file +var _0x2b3c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','util','bluebird','ioredis'];(function(_0x22ad6d,_0x3fa82a){var _0x43f150=function(_0x5c0ea1){while(--_0x5c0ea1){_0x22ad6d['push'](_0x22ad6d['shift']());}};_0x43f150(++_0x3fa82a);}(_0x2b3c,0xf9));var _0xc2b3=function(_0x2b0f81,_0x5769e3){_0x2b0f81=_0x2b0f81-0x0;var _0x436698=_0x2b3c[_0x2b0f81];return _0x436698;};'use strict';var _=require('lodash');var util=require(_0xc2b3('0x0'));var moment=require('moment');var BPromise=require(_0xc2b3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2b3('0x2'));var db=require(_0xc2b3('0x3'))['db'];var utils=require(_0xc2b3('0x4'));var logger=require(_0xc2b3('0x5'))(_0xc2b3('0x6'));var config=require('../../config/environment');var jayson=require(_0xc2b3('0x7'));var client=jayson[_0xc2b3('0x8')][_0xc2b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cb590,_0x5c2e53,_0x78a5bb){return new BPromise(function(_0x56a372,_0x10a3ab){return client[_0xc2b3('0xa')](_0x3cb590,_0x78a5bb)['then'](function(_0x3bd4b1){logger[_0xc2b3('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5c2e53,_0xc2b3('0xc'));logger[_0xc2b3('0xd')](_0xc2b3('0xe'),_0x5c2e53,_0xc2b3('0xc'),JSON[_0xc2b3('0xf')](_0x3bd4b1));if(_0x3bd4b1['error']){if(_0x3bd4b1[_0xc2b3('0x10')][_0xc2b3('0x11')]===0x1f4){logger[_0xc2b3('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5c2e53,_0x3bd4b1[_0xc2b3('0x10')][_0xc2b3('0x12')]);return _0x10a3ab(_0x3bd4b1['error'][_0xc2b3('0x12')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5c2e53,_0x3bd4b1[_0xc2b3('0x10')]['message']);return _0x56a372(_0x3bd4b1['error']['message']);}else{logger[_0xc2b3('0xb')](_0xc2b3('0x13'),_0x5c2e53,'request\x20sent');_0x56a372(_0x3bd4b1[_0xc2b3('0x14')][_0xc2b3('0x12')]);}})['catch'](function(_0x5afcca){logger[_0xc2b3('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5c2e53,_0x5afcca);_0x10a3ab(_0x5afcca);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 504ceb7..8819256 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 _0x6cce=['get','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x37b271,_0x53e5e4){var _0x1aeed9=function(_0x1b6aaf){while(--_0x1b6aaf){_0x37b271['push'](_0x37b271['shift']());}};_0x1aeed9(++_0x53e5e4);}(_0x6cce,0x1a2));var _0xe6cc=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x6cce[_0x1e393b];return _0x3d0bfe;};'use strict';var multer=require(_0xe6cc('0x0'));var util=require(_0xe6cc('0x1'));var path=require('path');var timeout=require(_0xe6cc('0x2'));var express=require('express');var router=express[_0xe6cc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe6cc('0x4'));var interaction=require(_0xe6cc('0x5'));var config=require(_0xe6cc('0x6'));var controller=require('./intFreshdeskField.controller');router[_0xe6cc('0x7')]('/',auth[_0xe6cc('0x8')](),controller['index']);router['get']('/:id',auth[_0xe6cc('0x8')](),controller[_0xe6cc('0x9')]);router[_0xe6cc('0xa')]('/',auth['isAuthenticated'](),controller[_0xe6cc('0xb')]);router[_0xe6cc('0xc')](_0xe6cc('0xd'),auth[_0xe6cc('0x8')](),controller[_0xe6cc('0xe')]);router['delete'](_0xe6cc('0xd'),auth['isAuthenticated'](),controller[_0xe6cc('0xf')]);module[_0xe6cc('0x10')]=router; \ No newline at end of file +var _0x4921=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','/:id','isAuthenticated','create','update','delete','destroy','exports','multer','util','path'];(function(_0x4c630b,_0x25f8ef){var _0x181259=function(_0x5d0e58){while(--_0x5d0e58){_0x4c630b['push'](_0x4c630b['shift']());}};_0x181259(++_0x25f8ef);}(_0x4921,0x8d));var _0x1492=function(_0x59c2cb,_0x671ebb){_0x59c2cb=_0x59c2cb-0x0;var _0x4d2910=_0x4921[_0x59c2cb];return _0x4d2910;};'use strict';var multer=require(_0x1492('0x0'));var util=require(_0x1492('0x1'));var path=require(_0x1492('0x2'));var timeout=require(_0x1492('0x3'));var express=require(_0x1492('0x4'));var router=express[_0x1492('0x5')]();var fs_extra=require(_0x1492('0x6'));var auth=require(_0x1492('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1492('0x8'));var controller=require(_0x1492('0x9'));router[_0x1492('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1492('0xa')](_0x1492('0xb'),auth[_0x1492('0xc')](),controller['show']);router['post']('/',auth[_0x1492('0xc')](),controller[_0x1492('0xd')]);router['put'](_0x1492('0xb'),auth[_0x1492('0xc')](),controller[_0x1492('0xe')]);router[_0x1492('0xf')](_0x1492('0xb'),auth[_0x1492('0xc')](),controller[_0x1492('0x10')]);module[_0x1492('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 2bc6139..66b6411 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 _0x894d=['string','variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM'];(function(_0x51687f,_0x35c457){var _0x5bb285=function(_0x39fc70){while(--_0x39fc70){_0x51687f['push'](_0x51687f['shift']());}};_0x5bb285(++_0x35c457);}(_0x894d,0xf6));var _0xd894=function(_0x403a80,_0x5b67ce){_0x403a80=_0x403a80-0x0;var _0xf3ef9e=_0x894d[_0x403a80];return _0xf3ef9e;};'use strict';var Sequelize=require('sequelize');module[_0xd894('0x0')]={'type':{'type':Sequelize[_0xd894('0x1')](_0xd894('0x2'),_0xd894('0x3'),_0xd894('0x4'),_0xd894('0x5'),'picklist'),'defaultValue':_0xd894('0x2')},'content':{'type':Sequelize[_0xd894('0x6')]},'key':{'type':Sequelize[_0xd894('0x6')]},'keyType':{'type':Sequelize[_0xd894('0x1')]('string',_0xd894('0x3'),_0xd894('0x4'))},'keyContent':{'type':Sequelize[_0xd894('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd894('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf280=['variable','STRING','customVariable','ENUM','string'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xf280,0xcb));var _0x0f28=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xf280[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x0f28('0x0')](_0x0f28('0x1'),_0x0f28('0x2'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0f28('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0f28('0x0')](_0x0f28('0x1'),_0x0f28('0x2'),_0x0f28('0x4'))},'keyContent':{'type':Sequelize[_0x0f28('0x3')]},'idField':{'type':Sequelize[_0x0f28('0x3')]},'nameField':{'type':Sequelize[_0x0f28('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0f28('0x3')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 6a8ba9d..a509394 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 _0x0e9f=['merge','VIRTUAL','name','options','then','include','rows','catch','params','length','includeAll','find','create','body','eml-format','rimraf','request-promise','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','error','send','map','FreshdeskField','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','order','sort','where','filters','pick','filter'];(function(_0x120aec,_0x26f761){var _0x4a4863=function(_0x43d21e){while(--_0x43d21e){_0x120aec['push'](_0x120aec['shift']());}};_0x4a4863(++_0x26f761);}(_0x0e9f,0x116));var _0xf0e9=function(_0xcc6824,_0x5f9b86){_0xcc6824=_0xcc6824-0x0;var _0x31dfbb=_0x0e9f[_0xcc6824];return _0x31dfbb;};'use strict';var emlformat=require(_0xf0e9('0x0'));var rimraf=require(_0xf0e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf0e9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf0e9('0x3'));var util=require('util');var path=require('path');var sox=require(_0xf0e9('0x4'));var csv=require(_0xf0e9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0e9('0x6'));var _=require('lodash');var squel=require(_0xf0e9('0x7'));var crypto=require(_0xf0e9('0x8'));var jsforce=require(_0xf0e9('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf0e9('0xa'));var Papa=require(_0xf0e9('0xb'));var Redis=require(_0xf0e9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xf0e9('0xd'));var as=require(_0xf0e9('0xe'));var hardwareService=require(_0xf0e9('0xf'));var logger=require('../../config/logger')(_0xf0e9('0x10'));var utils=require(_0xf0e9('0x11'));var config=require(_0xf0e9('0x12'));var licenseUtil=require(_0xf0e9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa9d7e3,_0x541cd6){_0x541cd6=_0x541cd6||0xcc;return function(_0x1461af){if(_0x1461af){return _0xa9d7e3[_0xf0e9('0x14')](_0x541cd6);}return _0xa9d7e3['status'](_0x541cd6)[_0xf0e9('0x15')]();};}function respondWithResult(_0x34ebf1,_0x261100){_0x261100=_0x261100||0xc8;return function(_0x1b87cf){if(_0x1b87cf){return _0x34ebf1[_0xf0e9('0x16')](_0x261100)[_0xf0e9('0x17')](_0x1b87cf);}};}function respondWithFilteredResult(_0x5c7787,_0x933fea){return function(_0x1eb36f){if(_0x1eb36f){var _0x4f37b5=typeof _0x933fea[_0xf0e9('0x18')]===_0xf0e9('0x19')&&typeof _0x933fea[_0xf0e9('0x1a')]===_0xf0e9('0x19');var _0x5cf302=_0x1eb36f[_0xf0e9('0x1b')];var _0x2f4ee3=_0x4f37b5?0x0:_0x933fea[_0xf0e9('0x18')];var _0x2987a1=_0x4f37b5?_0x1eb36f['count']:_0x933fea['offset']+_0x933fea[_0xf0e9('0x1a')];var _0x98bb88;if(_0x2987a1>=_0x5cf302){_0x2987a1=_0x5cf302;_0x98bb88=0xc8;}else{_0x98bb88=0xce;}_0x5c7787[_0xf0e9('0x16')](_0x98bb88);return _0x5c7787['set']('Content-Range',_0x2f4ee3+'-'+_0x2987a1+'/'+_0x5cf302)[_0xf0e9('0x17')](_0x1eb36f);}return null;};}function patchUpdates(_0x1ac91f){return function(_0x4992c5){try{jsonpatch[_0xf0e9('0x1c')](_0x4992c5,_0x1ac91f,!![]);}catch(_0x51f313){return BPromise[_0xf0e9('0x1d')](_0x51f313);}return _0x4992c5[_0xf0e9('0x1e')]();};}function saveUpdates(_0x4afcff,_0x5dd652){return function(_0x186fa5){if(_0x186fa5){return _0x186fa5[_0xf0e9('0x1f')](_0x4afcff)['then'](function(_0x1cd143){return _0x1cd143;});}return null;};}function removeEntity(_0x257acb,_0x52612e){return function(_0x2f44ee){if(_0x2f44ee){return _0x2f44ee[_0xf0e9('0x20')]()['then'](function(){_0x257acb[_0xf0e9('0x16')](0xcc)[_0xf0e9('0x15')]();});}};}function handleEntityNotFound(_0x9acc21,_0x3a74fe){return function(_0x33048a){if(!_0x33048a){_0x9acc21[_0xf0e9('0x14')](0x194);}return _0x33048a;};}function handleError(_0x330080,_0x4d4bc8){_0x4d4bc8=_0x4d4bc8||0x1f4;return function(_0x5c5d96){logger[_0xf0e9('0x21')](_0x5c5d96['stack']);if(_0x5c5d96['name']){delete _0x5c5d96['name'];}_0x330080[_0xf0e9('0x16')](_0x4d4bc8)[_0xf0e9('0x22')](_0x5c5d96);};}exports['index']=function(_0x258927,_0xc4501a){var _0x453195={},_0x480b7d={},_0x2fa5e9={'count':0x0,'rows':[]};var _0x337a59=_[_0xf0e9('0x23')](db[_0xf0e9('0x24')][_0xf0e9('0x25')],function(_0xf90eea){return{'name':_0xf90eea[_0xf0e9('0x26')],'type':_0xf90eea[_0xf0e9('0x27')]['key']};});_0x480b7d[_0xf0e9('0x28')]=_[_0xf0e9('0x23')](_0x337a59,'name');_0x480b7d['query']=_[_0xf0e9('0x29')](_0x258927[_0xf0e9('0x2a')]);_0x480b7d['filters']=_[_0xf0e9('0x2b')](_0x480b7d[_0xf0e9('0x28')],_0x480b7d[_0xf0e9('0x2a')]);_0x453195[_0xf0e9('0x2c')]=_[_0xf0e9('0x2b')](_0x480b7d[_0xf0e9('0x28')],qs[_0xf0e9('0x2d')](_0x258927[_0xf0e9('0x2a')]['fields']));_0x453195[_0xf0e9('0x2c')]=_0x453195[_0xf0e9('0x2c')]['length']?_0x453195[_0xf0e9('0x2c')]:_0x480b7d['model'];if(!_0x258927[_0xf0e9('0x2a')]['hasOwnProperty']('nolimit')){_0x453195[_0xf0e9('0x1a')]=qs[_0xf0e9('0x1a')](_0x258927[_0xf0e9('0x2a')][_0xf0e9('0x1a')]);_0x453195[_0xf0e9('0x18')]=qs[_0xf0e9('0x18')](_0x258927['query'][_0xf0e9('0x18')]);}_0x453195[_0xf0e9('0x2e')]=qs[_0xf0e9('0x2f')](_0x258927['query'][_0xf0e9('0x2f')]);_0x453195[_0xf0e9('0x30')]=qs[_0xf0e9('0x31')](_[_0xf0e9('0x32')](_0x258927[_0xf0e9('0x2a')],_0x480b7d[_0xf0e9('0x31')]),_0x337a59);if(_0x258927[_0xf0e9('0x2a')][_0xf0e9('0x33')]){_0x453195[_0xf0e9('0x30')]=_[_0xf0e9('0x34')](_0x453195['where'],{'$or':_[_0xf0e9('0x23')](_0x337a59,function(_0x248a74){if(_0x248a74['type']!==_0xf0e9('0x35')){var _0x36c0e0={};_0x36c0e0[_0x248a74[_0xf0e9('0x36')]]={'$like':'%'+_0x258927[_0xf0e9('0x2a')][_0xf0e9('0x33')]+'%'};return _0x36c0e0;}})});}_0x453195=_['merge']({},_0x453195,_0x258927[_0xf0e9('0x37')]);var _0xd14889={'where':_0x453195['where']};return db[_0xf0e9('0x24')]['count'](_0xd14889)[_0xf0e9('0x38')](function(_0x58d9ab){_0x2fa5e9[_0xf0e9('0x1b')]=_0x58d9ab;if(_0x258927[_0xf0e9('0x2a')]['includeAll']){_0x453195[_0xf0e9('0x39')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x453195);})['then'](function(_0x3935d8){_0x2fa5e9[_0xf0e9('0x3a')]=_0x3935d8;return _0x2fa5e9;})[_0xf0e9('0x38')](respondWithFilteredResult(_0xc4501a,_0x453195))[_0xf0e9('0x3b')](handleError(_0xc4501a,null));};exports['show']=function(_0x11f4f1,_0x34d44d){var _0x50fc1b={'raw':!![],'where':{'id':_0x11f4f1[_0xf0e9('0x3c')]['id']}},_0x587259={};_0x587259[_0xf0e9('0x28')]=_[_0xf0e9('0x29')](db[_0xf0e9('0x24')][_0xf0e9('0x25')]);_0x587259['query']=_[_0xf0e9('0x29')](_0x11f4f1[_0xf0e9('0x2a')]);_0x587259[_0xf0e9('0x31')]=_[_0xf0e9('0x2b')](_0x587259[_0xf0e9('0x28')],_0x587259[_0xf0e9('0x2a')]);_0x50fc1b[_0xf0e9('0x2c')]=_['intersection'](_0x587259[_0xf0e9('0x28')],qs[_0xf0e9('0x2d')](_0x11f4f1[_0xf0e9('0x2a')][_0xf0e9('0x2d')]));_0x50fc1b['attributes']=_0x50fc1b[_0xf0e9('0x2c')][_0xf0e9('0x3d')]?_0x50fc1b[_0xf0e9('0x2c')]:_0x587259['model'];if(_0x11f4f1[_0xf0e9('0x2a')][_0xf0e9('0x3e')]){_0x50fc1b[_0xf0e9('0x39')]=[{'all':!![]}];}_0x50fc1b=_[_0xf0e9('0x34')]({},_0x50fc1b,_0x11f4f1[_0xf0e9('0x37')]);return db[_0xf0e9('0x24')][_0xf0e9('0x3f')](_0x50fc1b)[_0xf0e9('0x38')](handleEntityNotFound(_0x34d44d,null))[_0xf0e9('0x38')](respondWithResult(_0x34d44d,null))[_0xf0e9('0x3b')](handleError(_0x34d44d,null));};exports[_0xf0e9('0x40')]=function(_0x392a9a,_0x317419){return db[_0xf0e9('0x24')][_0xf0e9('0x40')](_0x392a9a[_0xf0e9('0x41')],{})[_0xf0e9('0x38')](respondWithResult(_0x317419,0xc9))[_0xf0e9('0x3b')](handleError(_0x317419,null));};exports[_0xf0e9('0x1f')]=function(_0x39def0,_0x3250d7){if(_0x39def0[_0xf0e9('0x41')]['id']){delete _0x39def0[_0xf0e9('0x41')]['id'];}return db[_0xf0e9('0x24')][_0xf0e9('0x3f')]({'where':{'id':_0x39def0[_0xf0e9('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3250d7,null))[_0xf0e9('0x38')](saveUpdates(_0x39def0[_0xf0e9('0x41')],null))['then'](respondWithResult(_0x3250d7,null))[_0xf0e9('0x3b')](handleError(_0x3250d7,null));};exports[_0xf0e9('0x20')]=function(_0x26789c,_0x19419e){return db[_0xf0e9('0x24')]['find']({'where':{'id':_0x26789c[_0xf0e9('0x3c')]['id']}})['then'](handleEntityNotFound(_0x19419e,null))[_0xf0e9('0x38')](removeEntity(_0x19419e,null))['catch'](handleError(_0x19419e,null));}; \ No newline at end of file +var _0x6ae2=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','index','map','FreshdeskField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','show','params','find','catch','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x261798,_0x199810){var _0x2604d8=function(_0x1ee9fa){while(--_0x1ee9fa){_0x261798['push'](_0x261798['shift']());}};_0x2604d8(++_0x199810);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x5b49a8,_0x469753){_0x5b49a8=_0x5b49a8-0x0;var _0x3de322=_0x6ae2[_0x5b49a8];return _0x3de322;};'use strict';var emlformat=require(_0x26ae('0x0'));var rimraf=require(_0x26ae('0x1'));var zipdir=require(_0x26ae('0x2'));var jsonpatch=require(_0x26ae('0x3'));var rp=require(_0x26ae('0x4'));var moment=require(_0x26ae('0x5'));var BPromise=require(_0x26ae('0x6'));var Mustache=require(_0x26ae('0x7'));var util=require(_0x26ae('0x8'));var path=require('path');var sox=require(_0x26ae('0x9'));var csv=require(_0x26ae('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26ae('0xb'));var squel=require(_0x26ae('0xc'));var crypto=require(_0x26ae('0xd'));var jsforce=require(_0x26ae('0xe'));var deskjs=require(_0x26ae('0xf'));var toCsv=require(_0x26ae('0xa'));var querystring=require(_0x26ae('0x10'));var Papa=require(_0x26ae('0x11'));var Redis=require(_0x26ae('0x12'));var authService=require(_0x26ae('0x13'));var qs=require(_0x26ae('0x14'));var as=require(_0x26ae('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26ae('0x16'))('api');var utils=require(_0x26ae('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26ae('0x18'))['db'];function respondWithStatusCode(_0x46bc2,_0x21811d){_0x21811d=_0x21811d||0xcc;return function(_0x17f9a6){if(_0x17f9a6){return _0x46bc2[_0x26ae('0x19')](_0x21811d);}return _0x46bc2[_0x26ae('0x1a')](_0x21811d)[_0x26ae('0x1b')]();};}function respondWithResult(_0x1c66b8,_0x2390a7){_0x2390a7=_0x2390a7||0xc8;return function(_0x52d611){if(_0x52d611){return _0x1c66b8[_0x26ae('0x1a')](_0x2390a7)[_0x26ae('0x1c')](_0x52d611);}};}function respondWithFilteredResult(_0x4e5c4e,_0x15d055){return function(_0x32cd9e){if(_0x32cd9e){var _0x497974=typeof _0x15d055[_0x26ae('0x1d')]===_0x26ae('0x1e')&&typeof _0x15d055[_0x26ae('0x1f')]===_0x26ae('0x1e');var _0x13ad43=_0x32cd9e[_0x26ae('0x20')];var _0x250dc0=_0x497974?0x0:_0x15d055[_0x26ae('0x1d')];var _0x28584c=_0x497974?_0x32cd9e[_0x26ae('0x20')]:_0x15d055[_0x26ae('0x1d')]+_0x15d055[_0x26ae('0x1f')];var _0x38102c;if(_0x28584c>=_0x13ad43){_0x28584c=_0x13ad43;_0x38102c=0xc8;}else{_0x38102c=0xce;}_0x4e5c4e[_0x26ae('0x1a')](_0x38102c);return _0x4e5c4e[_0x26ae('0x21')](_0x26ae('0x22'),_0x250dc0+'-'+_0x28584c+'/'+_0x13ad43)[_0x26ae('0x1c')](_0x32cd9e);}return null;};}function patchUpdates(_0xdfcd69){return function(_0x22d535){try{jsonpatch[_0x26ae('0x23')](_0x22d535,_0xdfcd69,!![]);}catch(_0x334153){return BPromise['reject'](_0x334153);}return _0x22d535['save']();};}function saveUpdates(_0x2a2ba5,_0x5d72dc){return function(_0x22c47b){if(_0x22c47b){return _0x22c47b['update'](_0x2a2ba5)[_0x26ae('0x24')](function(_0x2e34d1){return _0x2e34d1;});}return null;};}function removeEntity(_0x19f641,_0x57062e){return function(_0x4ab3f1){if(_0x4ab3f1){return _0x4ab3f1[_0x26ae('0x25')]()[_0x26ae('0x24')](function(){_0x19f641[_0x26ae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2caf20,_0x295cc2){return function(_0x53e0da){if(!_0x53e0da){_0x2caf20[_0x26ae('0x19')](0x194);}return _0x53e0da;};}function handleError(_0x2658ed,_0x19eacc){_0x19eacc=_0x19eacc||0x1f4;return function(_0x4a0045){logger[_0x26ae('0x26')](_0x4a0045['stack']);if(_0x4a0045[_0x26ae('0x27')]){delete _0x4a0045[_0x26ae('0x27')];}_0x2658ed[_0x26ae('0x1a')](_0x19eacc)['send'](_0x4a0045);};}exports[_0x26ae('0x28')]=function(_0x5a8301,_0x4cddc4){var _0x2f2e9d={},_0x2fcc89={},_0x5979ec={'count':0x0,'rows':[]};var _0x5308c=_[_0x26ae('0x29')](db[_0x26ae('0x2a')][_0x26ae('0x2b')],function(_0x2d8cac){return{'name':_0x2d8cac['fieldName'],'type':_0x2d8cac[_0x26ae('0x2c')][_0x26ae('0x2d')]};});_0x2fcc89[_0x26ae('0x2e')]=_[_0x26ae('0x29')](_0x5308c,_0x26ae('0x27'));_0x2fcc89['query']=_[_0x26ae('0x2f')](_0x5a8301[_0x26ae('0x30')]);_0x2fcc89[_0x26ae('0x31')]=_[_0x26ae('0x32')](_0x2fcc89[_0x26ae('0x2e')],_0x2fcc89[_0x26ae('0x30')]);_0x2f2e9d[_0x26ae('0x33')]=_[_0x26ae('0x32')](_0x2fcc89['model'],qs[_0x26ae('0x34')](_0x5a8301['query']['fields']));_0x2f2e9d[_0x26ae('0x33')]=_0x2f2e9d[_0x26ae('0x33')][_0x26ae('0x35')]?_0x2f2e9d['attributes']:_0x2fcc89[_0x26ae('0x2e')];if(!_0x5a8301[_0x26ae('0x30')][_0x26ae('0x36')](_0x26ae('0x37'))){_0x2f2e9d[_0x26ae('0x1f')]=qs[_0x26ae('0x1f')](_0x5a8301[_0x26ae('0x30')][_0x26ae('0x1f')]);_0x2f2e9d[_0x26ae('0x1d')]=qs[_0x26ae('0x1d')](_0x5a8301[_0x26ae('0x30')][_0x26ae('0x1d')]);}_0x2f2e9d[_0x26ae('0x38')]=qs[_0x26ae('0x39')](_0x5a8301['query'][_0x26ae('0x39')]);_0x2f2e9d[_0x26ae('0x3a')]=qs[_0x26ae('0x31')](_['pick'](_0x5a8301[_0x26ae('0x30')],_0x2fcc89[_0x26ae('0x31')]),_0x5308c);if(_0x5a8301[_0x26ae('0x30')][_0x26ae('0x3b')]){_0x2f2e9d[_0x26ae('0x3a')]=_['merge'](_0x2f2e9d[_0x26ae('0x3a')],{'$or':_[_0x26ae('0x29')](_0x5308c,function(_0x49eb68){if(_0x49eb68[_0x26ae('0x2c')]!==_0x26ae('0x3c')){var _0x11586b={};_0x11586b[_0x49eb68['name']]={'$like':'%'+_0x5a8301['query']['filter']+'%'};return _0x11586b;}})});}_0x2f2e9d=_[_0x26ae('0x3d')]({},_0x2f2e9d,_0x5a8301[_0x26ae('0x3e')]);var _0x607968={'where':_0x2f2e9d[_0x26ae('0x3a')]};return db[_0x26ae('0x2a')]['count'](_0x607968)[_0x26ae('0x24')](function(_0x3fd0ef){_0x5979ec[_0x26ae('0x20')]=_0x3fd0ef;if(_0x5a8301[_0x26ae('0x30')][_0x26ae('0x3f')]){_0x2f2e9d[_0x26ae('0x40')]=[{'all':!![]}];}return db[_0x26ae('0x2a')]['findAll'](_0x2f2e9d);})[_0x26ae('0x24')](function(_0x7d041f){_0x5979ec['rows']=_0x7d041f;return _0x5979ec;})[_0x26ae('0x24')](respondWithFilteredResult(_0x4cddc4,_0x2f2e9d))['catch'](handleError(_0x4cddc4,null));};exports[_0x26ae('0x41')]=function(_0x150bf1,_0x92a7d8){var _0x5e0369={'raw':!![],'where':{'id':_0x150bf1[_0x26ae('0x42')]['id']}},_0x2a0797={};_0x2a0797[_0x26ae('0x2e')]=_[_0x26ae('0x2f')](db[_0x26ae('0x2a')][_0x26ae('0x2b')]);_0x2a0797['query']=_['keys'](_0x150bf1['query']);_0x2a0797[_0x26ae('0x31')]=_[_0x26ae('0x32')](_0x2a0797[_0x26ae('0x2e')],_0x2a0797[_0x26ae('0x30')]);_0x5e0369[_0x26ae('0x33')]=_['intersection'](_0x2a0797['model'],qs[_0x26ae('0x34')](_0x150bf1[_0x26ae('0x30')][_0x26ae('0x34')]));_0x5e0369['attributes']=_0x5e0369[_0x26ae('0x33')]['length']?_0x5e0369[_0x26ae('0x33')]:_0x2a0797[_0x26ae('0x2e')];if(_0x150bf1['query']['includeAll']){_0x5e0369[_0x26ae('0x40')]=[{'all':!![]}];}_0x5e0369=_['merge']({},_0x5e0369,_0x150bf1[_0x26ae('0x3e')]);return db[_0x26ae('0x2a')][_0x26ae('0x43')](_0x5e0369)[_0x26ae('0x24')](handleEntityNotFound(_0x92a7d8,null))[_0x26ae('0x24')](respondWithResult(_0x92a7d8,null))[_0x26ae('0x44')](handleError(_0x92a7d8,null));};exports[_0x26ae('0x45')]=function(_0x3484cb,_0x21a623){return db[_0x26ae('0x2a')][_0x26ae('0x45')](_0x3484cb['body'],{})[_0x26ae('0x24')](respondWithResult(_0x21a623,0xc9))[_0x26ae('0x44')](handleError(_0x21a623,null));};exports[_0x26ae('0x46')]=function(_0x1fe641,_0x3e56bb){if(_0x1fe641[_0x26ae('0x47')]['id']){delete _0x1fe641[_0x26ae('0x47')]['id'];}return db[_0x26ae('0x2a')][_0x26ae('0x43')]({'where':{'id':_0x1fe641[_0x26ae('0x42')]['id']}})[_0x26ae('0x24')](handleEntityNotFound(_0x3e56bb,null))[_0x26ae('0x24')](saveUpdates(_0x1fe641[_0x26ae('0x47')],null))['then'](respondWithResult(_0x3e56bb,null))[_0x26ae('0x44')](handleError(_0x3e56bb,null));};exports['destroy']=function(_0x3dd581,_0x23e6be){return db[_0x26ae('0x2a')][_0x26ae('0x43')]({'where':{'id':_0x3dd581[_0x26ae('0x42')]['id']}})[_0x26ae('0x24')](handleEntityNotFound(_0x23e6be,null))['then'](removeEntity(_0x23e6be,null))[_0x26ae('0x44')](handleError(_0x23e6be,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1c90c48..b06f334 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 _0x5544=['path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','lodash','util','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5544,0x12e));var _0x4554=function(_0x1719de,_0xd1967a){_0x1719de=_0x1719de-0x0;var _0x5a44f3=_0x5544[_0x1719de];return _0x5a44f3;};'use strict';var _=require(_0x4554('0x0'));var util=require(_0x4554('0x1'));var logger=require('../../config/logger')(_0x4554('0x2'));var moment=require(_0x4554('0x3'));var BPromise=require(_0x4554('0x4'));var rp=require(_0x4554('0x5'));var fs=require('fs');var path=require(_0x4554('0x6'));var rimraf=require(_0x4554('0x7'));var config=require('../../config/environment');var attributes=require(_0x4554('0x8'));module[_0x4554('0x9')]=function(_0x5a7ce2,_0x258d17){return _0x5a7ce2[_0x4554('0xa')](_0x4554('0xb'),attributes,{'tableName':_0x4554('0xc'),'paranoid':![],'indexes':[{'name':_0x4554('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2d=['moment','bluebird','path','../../config/environment','./intFreshdeskField.attributes','exports','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4e2d,0x11c));var _0xd4e2=function(_0x20a176,_0x39d6a5){_0x20a176=_0x20a176-0x0;var _0x466fd2=_0x4e2d[_0x20a176];return _0x466fd2;};'use strict';var _=require(_0xd4e2('0x0'));var util=require(_0xd4e2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd4e2('0x2'));var BPromise=require(_0xd4e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4e2('0x4'));var rimraf=require('rimraf');var config=require(_0xd4e2('0x5'));var attributes=require(_0xd4e2('0x6'));module[_0xd4e2('0x7')]=function(_0x497da2,_0x2d1faa){return _0x497da2['define']('FreshdeskField',attributes,{'tableName':_0xd4e2('0x8'),'paranoid':![],'indexes':[{'name':_0xd4e2('0x9'),'fields':['idField',_0xd4e2('0xa')],'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 ab2d425..60574d0 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 _0x00df=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x562faf,_0x102bcc){var _0x22c1f6=function(_0x2cd3b8){while(--_0x2cd3b8){_0x562faf['push'](_0x562faf['shift']());}};_0x22c1f6(++_0x102bcc);}(_0x00df,0x19e));var _0xf00d=function(_0x49dd2a,_0x209f1d){_0x49dd2a=_0x49dd2a-0x0;var _0x6fb729=_0x00df[_0x49dd2a];return _0x6fb729;};'use strict';var _=require(_0xf00d('0x0'));var util=require(_0xf00d('0x1'));var moment=require(_0xf00d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf00d('0x3'));var db=require(_0xf00d('0x4'))['db'];var utils=require(_0xf00d('0x5'));var logger=require(_0xf00d('0x6'))(_0xf00d('0x7'));var config=require(_0xf00d('0x8'));var jayson=require(_0xf00d('0x9'));var client=jayson[_0xf00d('0xa')][_0xf00d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50634f,_0x3f37c2,_0x241438){return new BPromise(function(_0x577431,_0x1d4a89){return client[_0xf00d('0xc')](_0x50634f,_0x241438)[_0xf00d('0xd')](function(_0xe7d1ff){logger[_0xf00d('0xe')](_0xf00d('0xf'),_0x3f37c2,_0xf00d('0x10'));logger['debug'](_0xf00d('0x11'),_0x3f37c2,_0xf00d('0x10'),JSON[_0xf00d('0x12')](_0xe7d1ff));if(_0xe7d1ff[_0xf00d('0x13')]){if(_0xe7d1ff['error'][_0xf00d('0x14')]===0x1f4){logger['error'](_0xf00d('0xf'),_0x3f37c2,_0xe7d1ff[_0xf00d('0x13')][_0xf00d('0x15')]);return _0x1d4a89(_0xe7d1ff[_0xf00d('0x13')][_0xf00d('0x15')]);}logger[_0xf00d('0x13')](_0xf00d('0xf'),_0x3f37c2,_0xe7d1ff['error'][_0xf00d('0x15')]);return _0x577431(_0xe7d1ff['error'][_0xf00d('0x15')]);}else{logger[_0xf00d('0xe')](_0xf00d('0xf'),_0x3f37c2,_0xf00d('0x10'));_0x577431(_0xe7d1ff[_0xf00d('0x16')][_0xf00d('0x15')]);}})['catch'](function(_0x4151f3){logger[_0xf00d('0x13')](_0xf00d('0xf'),_0x3f37c2,_0x4151f3);_0x1d4a89(_0x4151f3);});});} \ No newline at end of file +var _0xdb4e=['info','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3319a1,_0x347b3c){var _0x27f27c=function(_0x27ab35){while(--_0x27ab35){_0x3319a1['push'](_0x3319a1['shift']());}};_0x27f27c(++_0x347b3c);}(_0xdb4e,0x116));var _0xedb4=function(_0x222ec2,_0x1edc3a){_0x222ec2=_0x222ec2-0x0;var _0x946964=_0xdb4e[_0x222ec2];return _0x946964;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xedb4('0x0'));var rs=require(_0xedb4('0x1'));var fs=require('fs');var Redis=require(_0xedb4('0x2'));var db=require(_0xedb4('0x3'))['db'];var utils=require(_0xedb4('0x4'));var logger=require(_0xedb4('0x5'))(_0xedb4('0x6'));var config=require(_0xedb4('0x7'));var jayson=require(_0xedb4('0x8'));var client=jayson[_0xedb4('0x9')][_0xedb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cd8fc,_0x580adb,_0x310fe9){return new BPromise(function(_0xa571ab,_0x4e0d20){return client[_0xedb4('0xb')](_0x3cd8fc,_0x310fe9)[_0xedb4('0xc')](function(_0x158336){logger['info'](_0xedb4('0xd'),_0x580adb,_0xedb4('0xe'));logger[_0xedb4('0xf')](_0xedb4('0x10'),_0x580adb,_0xedb4('0xe'),JSON[_0xedb4('0x11')](_0x158336));if(_0x158336['error']){if(_0x158336[_0xedb4('0x12')][_0xedb4('0x13')]===0x1f4){logger['error'](_0xedb4('0xd'),_0x580adb,_0x158336[_0xedb4('0x12')][_0xedb4('0x14')]);return _0x4e0d20(_0x158336[_0xedb4('0x12')]['message']);}logger[_0xedb4('0x12')](_0xedb4('0xd'),_0x580adb,_0x158336[_0xedb4('0x12')]['message']);return _0xa571ab(_0x158336[_0xedb4('0x12')][_0xedb4('0x14')]);}else{logger[_0xedb4('0x15')](_0xedb4('0xd'),_0x580adb,'request\x20sent');_0xa571ab(_0x158336['result'][_0xedb4('0x14')]);}})[_0xedb4('0x16')](function(_0x350b61){logger['error'](_0xedb4('0xd'),_0x580adb,_0x350b61);_0x4e0d20(_0x350b61);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2fbc2be..156280b 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 _0xf4eb=['getFields','create','put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x9e59de,_0x10bce5){var _0x5a72fb=function(_0x3ad4df){while(--_0x3ad4df){_0x9e59de['push'](_0x9e59de['shift']());}};_0x5a72fb(++_0x10bce5);}(_0xf4eb,0xec));var _0xbf4e=function(_0x366f98,_0x6d3316){_0x366f98=_0x366f98-0x0;var _0x6a3147=_0xf4eb[_0x366f98];return _0x6a3147;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xc')]);router['post'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['addConfiguration']);router[_0xbf4e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);module[_0xbf4e('0x12')]=router; \ No newline at end of file +var _0xde2c=['getFields','post','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0x146e9d,_0x2619bf){var _0x550314=function(_0x543e89){while(--_0x543e89){_0x146e9d['push'](_0x146e9d['shift']());}};_0x550314(++_0x2619bf);}(_0xde2c,0x7f));var _0xcde2=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0xde2c[_0x58c851];return _0x534d8a;};'use strict';var multer=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var timeout=require(_0xcde2('0x3'));var express=require(_0xcde2('0x4'));var router=express[_0xcde2('0x5')]();var fs_extra=require(_0xcde2('0x6'));var auth=require(_0xcde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcde2('0x8'));var controller=require(_0xcde2('0x9'));router[_0xcde2('0xa')]('/',auth[_0xcde2('0xb')](),controller[_0xcde2('0xc')]);router['get'](_0xcde2('0xd'),auth[_0xcde2('0xb')](),controller[_0xcde2('0xe')]);router['get']('/:id/configurations',auth[_0xcde2('0xb')](),controller[_0xcde2('0xf')]);router['get'](_0xcde2('0x10'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x11')]);router[_0xcde2('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcde2('0x12')](_0xcde2('0x13'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x14')]);router[_0xcde2('0x15')](_0xcde2('0xd'),auth['isAuthenticated'](),controller[_0xcde2('0x16')]);router['delete'](_0xcde2('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xcde2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 30dea89..7e4dfee 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 _0x5f66=['STRING','username','exports'];(function(_0x84adcc,_0x1c6600){var _0x477bcd=function(_0x390ad4){while(--_0x390ad4){_0x84adcc['push'](_0x84adcc['shift']());}};_0x477bcd(++_0x1c6600);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x65f6('0x1')]},'username':{'type':Sequelize[_0x65f6('0x1')],'unique':_0x65f6('0x2')},'apiKey':{'type':Sequelize[_0x65f6('0x1')]},'remoteUri':{'type':Sequelize[_0x65f6('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xf4f4=['exports','STRING','username','sequelize'];(function(_0x3b7fb0,_0x553e21){var _0x3b7fc5=function(_0x286bdc){while(--_0x286bdc){_0x3b7fb0['push'](_0x3b7fb0['shift']());}};_0x3b7fc5(++_0x553e21);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x369adf,_0x1e4428){_0x369adf=_0x369adf-0x0;var _0x164b44=_0xf4f4[_0x369adf];return _0x164b44;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4f4f('0x2')]},'username':{'type':Sequelize[_0x4f4f('0x2')],'unique':_0x4f4f('0x3')},'apiKey':{'type':Sequelize[_0x4f4f('0x2')]},'remoteUri':{'type':Sequelize[_0x4f4f('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4f4f('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 2fe5697..b938dad 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 _0x9c05=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','FreshsalesAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','include','findAll','catch','params','includeAll','find','create','body','findOne','sort','getConfigurations','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','GET','format','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf'];(function(_0x2cb80e,_0x478ec1){var _0x2de0c0=function(_0x5c1980){while(--_0x5c1980){_0x2cb80e['push'](_0x2cb80e['shift']());}};_0x2de0c0(++_0x478ec1);}(_0x9c05,0x19b));var _0x59c0=function(_0xeed695,_0x2b42b9){_0xeed695=_0xeed695-0x0;var _0x1a308b=_0x9c05[_0xeed695];return _0x1a308b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59c0('0x0'));var zipdir=require(_0x59c0('0x1'));var jsonpatch=require(_0x59c0('0x2'));var rp=require(_0x59c0('0x3'));var moment=require(_0x59c0('0x4'));var BPromise=require(_0x59c0('0x5'));var Mustache=require(_0x59c0('0x6'));var util=require(_0x59c0('0x7'));var path=require(_0x59c0('0x8'));var sox=require(_0x59c0('0x9'));var csv=require(_0x59c0('0xa'));var ejs=require(_0x59c0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59c0('0xc'));var squel=require('squel');var crypto=require(_0x59c0('0xd'));var jsforce=require(_0x59c0('0xe'));var deskjs=require(_0x59c0('0xf'));var toCsv=require(_0x59c0('0xa'));var querystring=require(_0x59c0('0x10'));var Papa=require(_0x59c0('0x11'));var Redis=require(_0x59c0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x59c0('0x13'));var hardwareService=require(_0x59c0('0x14'));var logger=require(_0x59c0('0x15'))(_0x59c0('0x16'));var utils=require(_0x59c0('0x17'));var config=require(_0x59c0('0x18'));var licenseUtil=require(_0x59c0('0x19'));var db=require(_0x59c0('0x1a'))['db'];var integrations=require(_0x59c0('0x1b'));function respondWithStatusCode(_0x3bb650,_0x154e00){_0x154e00=_0x154e00||0xcc;return function(_0x505ba9){if(_0x505ba9){return _0x3bb650[_0x59c0('0x1c')](_0x154e00);}return _0x3bb650[_0x59c0('0x1d')](_0x154e00)['end']();};}function respondWithResult(_0x1d017b,_0x2f2fd6){_0x2f2fd6=_0x2f2fd6||0xc8;return function(_0x100108){if(_0x100108){return _0x1d017b[_0x59c0('0x1d')](_0x2f2fd6)[_0x59c0('0x1e')](_0x100108);}};}function respondWithFilteredResult(_0x122fc2,_0x3c5947){return function(_0x43d262){if(_0x43d262){var _0x4aa5bb=typeof _0x3c5947['offset']==='undefined'&&typeof _0x3c5947[_0x59c0('0x1f')]===_0x59c0('0x20');var _0x2036e0=_0x43d262[_0x59c0('0x21')];var _0x16496a=_0x4aa5bb?0x0:_0x3c5947[_0x59c0('0x22')];var _0xf8a24a=_0x4aa5bb?_0x43d262[_0x59c0('0x21')]:_0x3c5947[_0x59c0('0x22')]+_0x3c5947[_0x59c0('0x1f')];var _0xba97ad;if(_0xf8a24a>=_0x2036e0){_0xf8a24a=_0x2036e0;_0xba97ad=0xc8;}else{_0xba97ad=0xce;}_0x122fc2['status'](_0xba97ad);return _0x122fc2[_0x59c0('0x23')](_0x59c0('0x24'),_0x16496a+'-'+_0xf8a24a+'/'+_0x2036e0)[_0x59c0('0x1e')](_0x43d262);}return null;};}function patchUpdates(_0x3ee7f8){return function(_0x1c4e9f){try{jsonpatch[_0x59c0('0x25')](_0x1c4e9f,_0x3ee7f8,!![]);}catch(_0x59f127){return BPromise[_0x59c0('0x26')](_0x59f127);}return _0x1c4e9f[_0x59c0('0x27')]();};}function saveUpdates(_0x1ff169,_0x5b25a2){return function(_0x33696d){if(_0x33696d){return _0x33696d[_0x59c0('0x28')](_0x1ff169)[_0x59c0('0x29')](function(_0x42531c){return _0x42531c;});}return null;};}function removeEntity(_0x51743d,_0x5dcf3f){return function(_0x3fa0f9){if(_0x3fa0f9){return _0x3fa0f9[_0x59c0('0x2a')]()[_0x59c0('0x29')](function(){_0x51743d[_0x59c0('0x1d')](0xcc)[_0x59c0('0x2b')]();});}};}function handleEntityNotFound(_0x554746,_0x34fa90){return function(_0x14d8e3){if(!_0x14d8e3){_0x554746['sendStatus'](0x194);}return _0x14d8e3;};}function handleError(_0x3a75d9,_0x42d5c0){_0x42d5c0=_0x42d5c0||0x1f4;return function(_0x119f9d){logger['error'](_0x119f9d[_0x59c0('0x2c')]);if(_0x119f9d[_0x59c0('0x2d')]){delete _0x119f9d['name'];}_0x3a75d9[_0x59c0('0x1d')](_0x42d5c0)[_0x59c0('0x2e')](_0x119f9d);};}exports[_0x59c0('0x2f')]=function(_0x6ce7c5,_0x5db1e4){var _0x3f2ab8={},_0x4da95d={},_0x450647={'count':0x0,'rows':[]};var _0x5016f2=_[_0x59c0('0x30')](db[_0x59c0('0x31')][_0x59c0('0x32')],function(_0x2b672f){return{'name':_0x2b672f['fieldName'],'type':_0x2b672f[_0x59c0('0x33')]['key']};});_0x4da95d[_0x59c0('0x34')]=_['map'](_0x5016f2,_0x59c0('0x2d'));_0x4da95d[_0x59c0('0x35')]=_[_0x59c0('0x36')](_0x6ce7c5['query']);_0x4da95d[_0x59c0('0x37')]=_[_0x59c0('0x38')](_0x4da95d[_0x59c0('0x34')],_0x4da95d[_0x59c0('0x35')]);_0x3f2ab8['attributes']=_[_0x59c0('0x38')](_0x4da95d['model'],qs[_0x59c0('0x39')](_0x6ce7c5[_0x59c0('0x35')][_0x59c0('0x39')]));_0x3f2ab8[_0x59c0('0x3a')]=_0x3f2ab8[_0x59c0('0x3a')][_0x59c0('0x3b')]?_0x3f2ab8[_0x59c0('0x3a')]:_0x4da95d[_0x59c0('0x34')];if(!_0x6ce7c5[_0x59c0('0x35')][_0x59c0('0x3c')](_0x59c0('0x3d'))){_0x3f2ab8[_0x59c0('0x1f')]=qs['limit'](_0x6ce7c5[_0x59c0('0x35')][_0x59c0('0x1f')]);_0x3f2ab8[_0x59c0('0x22')]=qs[_0x59c0('0x22')](_0x6ce7c5[_0x59c0('0x35')][_0x59c0('0x22')]);}_0x3f2ab8[_0x59c0('0x3e')]=qs['sort'](_0x6ce7c5['query']['sort']);_0x3f2ab8['where']=qs[_0x59c0('0x37')](_[_0x59c0('0x3f')](_0x6ce7c5[_0x59c0('0x35')],_0x4da95d['filters']),_0x5016f2);if(_0x6ce7c5['query'][_0x59c0('0x40')]){_0x3f2ab8[_0x59c0('0x41')]=_[_0x59c0('0x42')](_0x3f2ab8[_0x59c0('0x41')],{'$or':_[_0x59c0('0x30')](_0x5016f2,function(_0x2c8cd7){if(_0x2c8cd7['type']!=='VIRTUAL'){var _0x19d0df={};_0x19d0df[_0x2c8cd7[_0x59c0('0x2d')]]={'$like':'%'+_0x6ce7c5[_0x59c0('0x35')][_0x59c0('0x40')]+'%'};return _0x19d0df;}})});}_0x3f2ab8=_[_0x59c0('0x42')]({},_0x3f2ab8,_0x6ce7c5[_0x59c0('0x43')]);var _0x5c24d1={'where':_0x3f2ab8[_0x59c0('0x41')]};return db[_0x59c0('0x31')][_0x59c0('0x21')](_0x5c24d1)['then'](function(_0x150414){_0x450647[_0x59c0('0x21')]=_0x150414;if(_0x6ce7c5[_0x59c0('0x35')]['includeAll']){_0x3f2ab8[_0x59c0('0x44')]=[{'all':!![]}];}return db[_0x59c0('0x31')][_0x59c0('0x45')](_0x3f2ab8);})[_0x59c0('0x29')](function(_0x2f5c8b){_0x450647['rows']=_0x2f5c8b;return _0x450647;})[_0x59c0('0x29')](respondWithFilteredResult(_0x5db1e4,_0x3f2ab8))[_0x59c0('0x46')](handleError(_0x5db1e4,null));};exports['show']=function(_0xb55ddb,_0x28198a){var _0x1816d9={'raw':![],'where':{'id':_0xb55ddb[_0x59c0('0x47')]['id']}},_0x336591={};_0x336591[_0x59c0('0x34')]=_['keys'](db[_0x59c0('0x31')][_0x59c0('0x32')]);_0x336591[_0x59c0('0x35')]=_[_0x59c0('0x36')](_0xb55ddb['query']);_0x336591[_0x59c0('0x37')]=_[_0x59c0('0x38')](_0x336591[_0x59c0('0x34')],_0x336591[_0x59c0('0x35')]);_0x1816d9[_0x59c0('0x3a')]=_[_0x59c0('0x38')](_0x336591[_0x59c0('0x34')],qs[_0x59c0('0x39')](_0xb55ddb[_0x59c0('0x35')][_0x59c0('0x39')]));_0x1816d9[_0x59c0('0x3a')]=_0x1816d9[_0x59c0('0x3a')][_0x59c0('0x3b')]?_0x1816d9['attributes']:_0x336591[_0x59c0('0x34')];if(_0xb55ddb['query'][_0x59c0('0x48')]){_0x1816d9[_0x59c0('0x44')]=[{'all':!![]}];}_0x1816d9=_[_0x59c0('0x42')]({},_0x1816d9,_0xb55ddb[_0x59c0('0x43')]);return db[_0x59c0('0x31')][_0x59c0('0x49')](_0x1816d9)[_0x59c0('0x29')](handleEntityNotFound(_0x28198a,null))[_0x59c0('0x29')](respondWithResult(_0x28198a,null))['catch'](handleError(_0x28198a,null));};exports[_0x59c0('0x4a')]=function(_0x279aa7,_0x12f990){return db[_0x59c0('0x31')][_0x59c0('0x4a')](_0x279aa7[_0x59c0('0x4b')],{})[_0x59c0('0x29')](respondWithResult(_0x12f990,0xc9))[_0x59c0('0x46')](handleError(_0x12f990,null));};exports[_0x59c0('0x28')]=function(_0x4406a4,_0x4483eb){if(_0x4406a4[_0x59c0('0x4b')]['id']){delete _0x4406a4['body']['id'];}return db[_0x59c0('0x31')][_0x59c0('0x49')]({'where':{'id':_0x4406a4[_0x59c0('0x47')]['id']}})[_0x59c0('0x29')](handleEntityNotFound(_0x4483eb,null))[_0x59c0('0x29')](saveUpdates(_0x4406a4['body'],null))[_0x59c0('0x29')](respondWithResult(_0x4483eb,null))['catch'](handleError(_0x4483eb,null));};exports['destroy']=function(_0x28765a,_0x684467){return db[_0x59c0('0x31')][_0x59c0('0x49')]({'where':{'id':_0x28765a[_0x59c0('0x47')]['id']}})[_0x59c0('0x29')](handleEntityNotFound(_0x684467,null))[_0x59c0('0x29')](removeEntity(_0x684467,null))['catch'](handleError(_0x684467,null));};exports['getConfigurations']=function(_0x3f8277,_0x5b7546,_0x3a504a){var _0x15a5ba={};var _0x4354de={};var _0x4b6565;var _0x4552e0;return db[_0x59c0('0x31')][_0x59c0('0x4c')]({'where':{'id':_0x3f8277['params']['id']}})[_0x59c0('0x29')](handleEntityNotFound(_0x5b7546,null))[_0x59c0('0x29')](function(_0x4a19d0){if(_0x4a19d0){_0x4b6565=_0x4a19d0;_0x4354de[_0x59c0('0x34')]=_[_0x59c0('0x36')](db['FreshsalesConfiguration'][_0x59c0('0x32')]);_0x4354de[_0x59c0('0x35')]=_[_0x59c0('0x36')](_0x3f8277[_0x59c0('0x35')]);_0x4354de[_0x59c0('0x37')]=_[_0x59c0('0x38')](_0x4354de[_0x59c0('0x34')],_0x4354de[_0x59c0('0x35')]);_0x15a5ba[_0x59c0('0x3a')]=_['intersection'](_0x4354de[_0x59c0('0x34')],qs[_0x59c0('0x39')](_0x3f8277[_0x59c0('0x35')][_0x59c0('0x39')]));_0x15a5ba[_0x59c0('0x3a')]=_0x15a5ba['attributes'][_0x59c0('0x3b')]?_0x15a5ba[_0x59c0('0x3a')]:_0x4354de[_0x59c0('0x34')];_0x15a5ba[_0x59c0('0x3e')]=qs[_0x59c0('0x4d')](_0x3f8277[_0x59c0('0x35')][_0x59c0('0x4d')]);_0x15a5ba[_0x59c0('0x41')]=qs[_0x59c0('0x37')](_[_0x59c0('0x3f')](_0x3f8277[_0x59c0('0x35')],_0x4354de[_0x59c0('0x37')]));if(_0x3f8277[_0x59c0('0x35')][_0x59c0('0x40')]){_0x15a5ba['where']=_[_0x59c0('0x42')](_0x15a5ba[_0x59c0('0x41')],{'$or':_['map'](_0x15a5ba[_0x59c0('0x3a')],function(_0x3efc60){var _0x5b3bb9={};_0x5b3bb9[_0x3efc60]={'$like':'%'+_0x3f8277[_0x59c0('0x35')][_0x59c0('0x40')]+'%'};return _0x5b3bb9;})});}_0x15a5ba=_[_0x59c0('0x42')]({},_0x15a5ba,_0x3f8277[_0x59c0('0x43')]);return _0x4b6565[_0x59c0('0x4e')](_0x15a5ba);}})['then'](function(_0x28a92e){if(_0x28a92e){_0x4552e0=_0x28a92e[_0x59c0('0x3b')];if(!_0x3f8277['query']['hasOwnProperty'](_0x59c0('0x3d'))){_0x15a5ba['limit']=qs[_0x59c0('0x1f')](_0x3f8277['query'][_0x59c0('0x1f')]);_0x15a5ba[_0x59c0('0x22')]=qs[_0x59c0('0x22')](_0x3f8277[_0x59c0('0x35')][_0x59c0('0x22')]);}return _0x4b6565[_0x59c0('0x4e')](_0x15a5ba);}})[_0x59c0('0x29')](function(_0x2ca4dd){if(_0x2ca4dd){return _0x2ca4dd?{'count':_0x4552e0,'rows':_0x2ca4dd}:null;}})['then'](respondWithResult(_0x5b7546,null))[_0x59c0('0x46')](handleError(_0x5b7546,null));};exports['addConfiguration']=function(_0x85b61c,_0x7be95d,_0x45067a){if(_0x85b61c['body']['id']){delete _0x85b61c['body']['id'];}return db['FreshsalesAccount'][_0x59c0('0x4c')]({'where':{'id':_0x85b61c[_0x59c0('0x47')]['id']}})[_0x59c0('0x29')](handleEntityNotFound(_0x7be95d,null))[_0x59c0('0x29')](function(_0x317b6b){if(_0x317b6b){_0x85b61c['body']['AccountId']=_0x317b6b['id'];_0x85b61c['body']['Subjects']=integrations['getSubjects'](_0x85b61c[_0x59c0('0x4b')][_0x59c0('0x4f')],_0x85b61c['body']['type']);_0x85b61c[_0x59c0('0x4b')][_0x59c0('0x50')]=integrations[_0x59c0('0x51')](_0x85b61c['body'][_0x59c0('0x4f')],_0x85b61c[_0x59c0('0x4b')][_0x59c0('0x33')]);return db[_0x59c0('0x52')][_0x59c0('0x4a')](_0x85b61c[_0x59c0('0x4b')],{'include':[{'model':db[_0x59c0('0x53')],'as':_0x59c0('0x54')},{'model':db[_0x59c0('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x7be95d,null))[_0x59c0('0x46')](handleError(_0x7be95d,null));};exports[_0x59c0('0x55')]=function(_0x37cab9,_0xcc623d,_0xefca4e){var _0x47eb76='';var _0x197f2='';return db[_0x59c0('0x31')][_0x59c0('0x4c')]({'where':{'id':_0x37cab9[_0x59c0('0x47')]['id']},'attributes':['id',_0x59c0('0x56'),_0x59c0('0x57'),_0x59c0('0x58')]})[_0x59c0('0x29')](handleEntityNotFound(_0xcc623d,null))[_0x59c0('0x29')](function(_0x248354){if(_0x248354){_0x197f2=_0x248354[_0x59c0('0x56')];_0x47eb76=_0x248354[_0x59c0('0x57')];var _0x27625b=_0x248354[_0x59c0('0x57')][_0x59c0('0x59')](-0x1);if(_0x27625b==='/'){_0x47eb76=_0x47eb76[_0x59c0('0x5a')](0x0,_0x47eb76['lastIndexOf'](_0x27625b));}return rp({'method':_0x59c0('0x5b'),'uri':util[_0x59c0('0x5c')]('%s%s',_0x47eb76,'/api/selector/owners'),'headers':{'Authorization':_0x59c0('0x5d')+_0x248354[_0x59c0('0x58')]},'json':!![]});}})[_0x59c0('0x29')](function(_0xd6cecc){if(_0xd6cecc){var _0x306a8e=_0xd6cecc[_0x59c0('0x5e')];var _0x197dd5=![];var _0x40fbcf=null;for(_0x40fbcf=0x0;_0x40fbcf<_0x306a8e[_0x59c0('0x3b')];_0x40fbcf++){if(_0x306a8e[_0x40fbcf][_0x59c0('0x5f')]===_0x197f2){_0x197dd5=!![];}}if(_0x197dd5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x59c0('0x60')});}}})[_0x59c0('0x29')](respondWithResult(_0xcc623d,null))[_0x59c0('0x46')](function(_0x4acd21){var _0x3422c1=_0x37cab9['query'][_0x59c0('0x61')]?0x1f4:_0x4acd21[_0x59c0('0x62')]||0x1f4;logger[_0x59c0('0x63')](_0x59c0('0x64'),_0x59c0('0x55'),_0x3422c1,JSON[_0x59c0('0x65')](_0x4acd21));delete _0x4acd21['name'];if(_0x3422c1===0x191){_0x3422c1=0x190;}_0xcc623d[_0x59c0('0x1d')](_0x3422c1)[_0x59c0('0x2e')](_0x37cab9['query'][_0x59c0('0x61')]?{'message':_0x59c0('0x66'),'statusCode':_0x4acd21['statusCode']}:_0x4acd21);});}; \ No newline at end of file +var _0xd5da=['moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','Content-Range','reject','save','update','then','end','error','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','length','nolimit','limit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','fields','include','catch','create','body','find','destroy','findOne','FreshsalesConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','GET','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise'];(function(_0x1282e1,_0x2d18b3){var _0x50d901=function(_0x57ff81){while(--_0x57ff81){_0x1282e1['push'](_0x1282e1['shift']());}};_0x50d901(++_0x2d18b3);}(_0xd5da,0x129));var _0xad5d=function(_0xa13f71,_0x3fd65e){_0xa13f71=_0xa13f71-0x0;var _0x369283=_0xd5da[_0xa13f71];return _0x369283;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad5d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad5d('0x1'));var rp=require(_0xad5d('0x2'));var moment=require(_0xad5d('0x3'));var BPromise=require(_0xad5d('0x4'));var Mustache=require(_0xad5d('0x5'));var util=require(_0xad5d('0x6'));var path=require(_0xad5d('0x7'));var sox=require('sox');var csv=require(_0xad5d('0x8'));var ejs=require(_0xad5d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad5d('0xa'));var squel=require('squel');var crypto=require(_0xad5d('0xb'));var jsforce=require(_0xad5d('0xc'));var deskjs=require(_0xad5d('0xd'));var toCsv=require(_0xad5d('0x8'));var querystring=require(_0xad5d('0xe'));var Papa=require(_0xad5d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xad5d('0x10'));var hardwareService=require(_0xad5d('0x11'));var logger=require(_0xad5d('0x12'))(_0xad5d('0x13'));var utils=require(_0xad5d('0x14'));var config=require(_0xad5d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xad5d('0x16'));function respondWithStatusCode(_0x276edf,_0xd291df){_0xd291df=_0xd291df||0xcc;return function(_0x316c2b){if(_0x316c2b){return _0x276edf[_0xad5d('0x17')](_0xd291df);}return _0x276edf[_0xad5d('0x18')](_0xd291df)['end']();};}function respondWithResult(_0x3638d6,_0x15a078){_0x15a078=_0x15a078||0xc8;return function(_0x2546b1){if(_0x2546b1){return _0x3638d6[_0xad5d('0x18')](_0x15a078)[_0xad5d('0x19')](_0x2546b1);}};}function respondWithFilteredResult(_0x6ff078,_0x80d349){return function(_0x3629cf){if(_0x3629cf){var _0x2b8337=typeof _0x80d349[_0xad5d('0x1a')]===_0xad5d('0x1b')&&typeof _0x80d349['limit']===_0xad5d('0x1b');var _0x250d00=_0x3629cf[_0xad5d('0x1c')];var _0x75eb98=_0x2b8337?0x0:_0x80d349['offset'];var _0x1b5d42=_0x2b8337?_0x3629cf[_0xad5d('0x1c')]:_0x80d349[_0xad5d('0x1a')]+_0x80d349['limit'];var _0x21012c;if(_0x1b5d42>=_0x250d00){_0x1b5d42=_0x250d00;_0x21012c=0xc8;}else{_0x21012c=0xce;}_0x6ff078[_0xad5d('0x18')](_0x21012c);return _0x6ff078['set'](_0xad5d('0x1d'),_0x75eb98+'-'+_0x1b5d42+'/'+_0x250d00)['json'](_0x3629cf);}return null;};}function patchUpdates(_0x4c075e){return function(_0x510df9){try{jsonpatch['apply'](_0x510df9,_0x4c075e,!![]);}catch(_0x435689){return BPromise[_0xad5d('0x1e')](_0x435689);}return _0x510df9[_0xad5d('0x1f')]();};}function saveUpdates(_0x400db2,_0x41a056){return function(_0x420096){if(_0x420096){return _0x420096[_0xad5d('0x20')](_0x400db2)[_0xad5d('0x21')](function(_0x3bbe18){return _0x3bbe18;});}return null;};}function removeEntity(_0x438b94,_0x62b775){return function(_0x4da34b){if(_0x4da34b){return _0x4da34b['destroy']()[_0xad5d('0x21')](function(){_0x438b94['status'](0xcc)[_0xad5d('0x22')]();});}};}function handleEntityNotFound(_0x306b3f,_0x230df2){return function(_0x475a2c){if(!_0x475a2c){_0x306b3f[_0xad5d('0x17')](0x194);}return _0x475a2c;};}function handleError(_0x3b0f57,_0x36fae3){_0x36fae3=_0x36fae3||0x1f4;return function(_0x5ece62){logger[_0xad5d('0x23')](_0x5ece62['stack']);if(_0x5ece62[_0xad5d('0x24')]){delete _0x5ece62['name'];}_0x3b0f57['status'](_0x36fae3)[_0xad5d('0x25')](_0x5ece62);};}exports[_0xad5d('0x26')]=function(_0x26d702,_0x1384cd){var _0x5f0cd5={},_0x4843ba={},_0xc27e87={'count':0x0,'rows':[]};var _0xbe13c0=_['map'](db[_0xad5d('0x27')][_0xad5d('0x28')],function(_0xfb4cbc){return{'name':_0xfb4cbc[_0xad5d('0x29')],'type':_0xfb4cbc[_0xad5d('0x2a')][_0xad5d('0x2b')]};});_0x4843ba['model']=_[_0xad5d('0x2c')](_0xbe13c0,'name');_0x4843ba[_0xad5d('0x2d')]=_['keys'](_0x26d702[_0xad5d('0x2d')]);_0x4843ba['filters']=_[_0xad5d('0x2e')](_0x4843ba[_0xad5d('0x2f')],_0x4843ba[_0xad5d('0x2d')]);_0x5f0cd5['attributes']=_[_0xad5d('0x2e')](_0x4843ba[_0xad5d('0x2f')],qs['fields'](_0x26d702[_0xad5d('0x2d')]['fields']));_0x5f0cd5['attributes']=_0x5f0cd5[_0xad5d('0x30')][_0xad5d('0x31')]?_0x5f0cd5[_0xad5d('0x30')]:_0x4843ba['model'];if(!_0x26d702['query']['hasOwnProperty'](_0xad5d('0x32'))){_0x5f0cd5[_0xad5d('0x33')]=qs[_0xad5d('0x33')](_0x26d702[_0xad5d('0x2d')][_0xad5d('0x33')]);_0x5f0cd5[_0xad5d('0x1a')]=qs['offset'](_0x26d702[_0xad5d('0x2d')][_0xad5d('0x1a')]);}_0x5f0cd5[_0xad5d('0x34')]=qs[_0xad5d('0x35')](_0x26d702['query']['sort']);_0x5f0cd5['where']=qs['filters'](_[_0xad5d('0x36')](_0x26d702[_0xad5d('0x2d')],_0x4843ba[_0xad5d('0x37')]),_0xbe13c0);if(_0x26d702[_0xad5d('0x2d')][_0xad5d('0x38')]){_0x5f0cd5[_0xad5d('0x39')]=_[_0xad5d('0x3a')](_0x5f0cd5[_0xad5d('0x39')],{'$or':_[_0xad5d('0x2c')](_0xbe13c0,function(_0x3bc890){if(_0x3bc890['type']!==_0xad5d('0x3b')){var _0x4105b8={};_0x4105b8[_0x3bc890[_0xad5d('0x24')]]={'$like':'%'+_0x26d702[_0xad5d('0x2d')][_0xad5d('0x38')]+'%'};return _0x4105b8;}})});}_0x5f0cd5=_[_0xad5d('0x3a')]({},_0x5f0cd5,_0x26d702[_0xad5d('0x3c')]);var _0xfe0ea4={'where':_0x5f0cd5['where']};return db['FreshsalesAccount'][_0xad5d('0x1c')](_0xfe0ea4)[_0xad5d('0x21')](function(_0x4614ef){_0xc27e87[_0xad5d('0x1c')]=_0x4614ef;if(_0x26d702[_0xad5d('0x2d')][_0xad5d('0x3d')]){_0x5f0cd5['include']=[{'all':!![]}];}return db[_0xad5d('0x27')][_0xad5d('0x3e')](_0x5f0cd5);})[_0xad5d('0x21')](function(_0x4bb793){_0xc27e87[_0xad5d('0x3f')]=_0x4bb793;return _0xc27e87;})['then'](respondWithFilteredResult(_0x1384cd,_0x5f0cd5))['catch'](handleError(_0x1384cd,null));};exports['show']=function(_0x425bbf,_0x1afc95){var _0x1a06b7={'raw':![],'where':{'id':_0x425bbf[_0xad5d('0x40')]['id']}},_0x5d8af3={};_0x5d8af3[_0xad5d('0x2f')]=_[_0xad5d('0x41')](db[_0xad5d('0x27')][_0xad5d('0x28')]);_0x5d8af3['query']=_[_0xad5d('0x41')](_0x425bbf[_0xad5d('0x2d')]);_0x5d8af3[_0xad5d('0x37')]=_['intersection'](_0x5d8af3[_0xad5d('0x2f')],_0x5d8af3['query']);_0x1a06b7[_0xad5d('0x30')]=_[_0xad5d('0x2e')](_0x5d8af3['model'],qs[_0xad5d('0x42')](_0x425bbf[_0xad5d('0x2d')]['fields']));_0x1a06b7[_0xad5d('0x30')]=_0x1a06b7['attributes'][_0xad5d('0x31')]?_0x1a06b7[_0xad5d('0x30')]:_0x5d8af3['model'];if(_0x425bbf[_0xad5d('0x2d')][_0xad5d('0x3d')]){_0x1a06b7[_0xad5d('0x43')]=[{'all':!![]}];}_0x1a06b7=_['merge']({},_0x1a06b7,_0x425bbf['options']);return db[_0xad5d('0x27')]['find'](_0x1a06b7)[_0xad5d('0x21')](handleEntityNotFound(_0x1afc95,null))[_0xad5d('0x21')](respondWithResult(_0x1afc95,null))[_0xad5d('0x44')](handleError(_0x1afc95,null));};exports[_0xad5d('0x45')]=function(_0x265bb1,_0x17c2d3){return db[_0xad5d('0x27')]['create'](_0x265bb1[_0xad5d('0x46')],{})['then'](respondWithResult(_0x17c2d3,0xc9))[_0xad5d('0x44')](handleError(_0x17c2d3,null));};exports[_0xad5d('0x20')]=function(_0x3003ec,_0x33812c){if(_0x3003ec['body']['id']){delete _0x3003ec[_0xad5d('0x46')]['id'];}return db[_0xad5d('0x27')][_0xad5d('0x47')]({'where':{'id':_0x3003ec['params']['id']}})[_0xad5d('0x21')](handleEntityNotFound(_0x33812c,null))[_0xad5d('0x21')](saveUpdates(_0x3003ec['body'],null))[_0xad5d('0x21')](respondWithResult(_0x33812c,null))[_0xad5d('0x44')](handleError(_0x33812c,null));};exports[_0xad5d('0x48')]=function(_0x4cd37b,_0x7c0044){return db[_0xad5d('0x27')][_0xad5d('0x47')]({'where':{'id':_0x4cd37b['params']['id']}})[_0xad5d('0x21')](handleEntityNotFound(_0x7c0044,null))['then'](removeEntity(_0x7c0044,null))[_0xad5d('0x44')](handleError(_0x7c0044,null));};exports['getConfigurations']=function(_0x4691fa,_0x145e47,_0x2b4fe5){var _0x8b6d80={};var _0x58bb19={};var _0x419f80;var _0x44e1a1;return db[_0xad5d('0x27')][_0xad5d('0x49')]({'where':{'id':_0x4691fa[_0xad5d('0x40')]['id']}})[_0xad5d('0x21')](handleEntityNotFound(_0x145e47,null))[_0xad5d('0x21')](function(_0x266622){if(_0x266622){_0x419f80=_0x266622;_0x58bb19[_0xad5d('0x2f')]=_[_0xad5d('0x41')](db[_0xad5d('0x4a')][_0xad5d('0x28')]);_0x58bb19[_0xad5d('0x2d')]=_[_0xad5d('0x41')](_0x4691fa[_0xad5d('0x2d')]);_0x58bb19[_0xad5d('0x37')]=_[_0xad5d('0x2e')](_0x58bb19[_0xad5d('0x2f')],_0x58bb19[_0xad5d('0x2d')]);_0x8b6d80[_0xad5d('0x30')]=_[_0xad5d('0x2e')](_0x58bb19[_0xad5d('0x2f')],qs['fields'](_0x4691fa[_0xad5d('0x2d')]['fields']));_0x8b6d80['attributes']=_0x8b6d80[_0xad5d('0x30')][_0xad5d('0x31')]?_0x8b6d80[_0xad5d('0x30')]:_0x58bb19[_0xad5d('0x2f')];_0x8b6d80[_0xad5d('0x34')]=qs[_0xad5d('0x35')](_0x4691fa[_0xad5d('0x2d')][_0xad5d('0x35')]);_0x8b6d80['where']=qs[_0xad5d('0x37')](_[_0xad5d('0x36')](_0x4691fa['query'],_0x58bb19[_0xad5d('0x37')]));if(_0x4691fa['query'][_0xad5d('0x38')]){_0x8b6d80[_0xad5d('0x39')]=_[_0xad5d('0x3a')](_0x8b6d80[_0xad5d('0x39')],{'$or':_['map'](_0x8b6d80['attributes'],function(_0x9fa1cd){var _0x5cd1e7={};_0x5cd1e7[_0x9fa1cd]={'$like':'%'+_0x4691fa[_0xad5d('0x2d')]['filter']+'%'};return _0x5cd1e7;})});}_0x8b6d80=_[_0xad5d('0x3a')]({},_0x8b6d80,_0x4691fa[_0xad5d('0x3c')]);return _0x419f80[_0xad5d('0x4b')](_0x8b6d80);}})[_0xad5d('0x21')](function(_0x42fe35){if(_0x42fe35){_0x44e1a1=_0x42fe35[_0xad5d('0x31')];if(!_0x4691fa['query'][_0xad5d('0x4c')](_0xad5d('0x32'))){_0x8b6d80[_0xad5d('0x33')]=qs[_0xad5d('0x33')](_0x4691fa[_0xad5d('0x2d')]['limit']);_0x8b6d80[_0xad5d('0x1a')]=qs[_0xad5d('0x1a')](_0x4691fa[_0xad5d('0x2d')][_0xad5d('0x1a')]);}return _0x419f80['getConfigurations'](_0x8b6d80);}})[_0xad5d('0x21')](function(_0x2b40c6){if(_0x2b40c6){return _0x2b40c6?{'count':_0x44e1a1,'rows':_0x2b40c6}:null;}})['then'](respondWithResult(_0x145e47,null))[_0xad5d('0x44')](handleError(_0x145e47,null));};exports[_0xad5d('0x4d')]=function(_0x3c8a25,_0x482b7f,_0x34c0c8){if(_0x3c8a25[_0xad5d('0x46')]['id']){delete _0x3c8a25[_0xad5d('0x46')]['id'];}return db[_0xad5d('0x27')][_0xad5d('0x49')]({'where':{'id':_0x3c8a25[_0xad5d('0x40')]['id']}})['then'](handleEntityNotFound(_0x482b7f,null))[_0xad5d('0x21')](function(_0x4586c9){if(_0x4586c9){_0x3c8a25[_0xad5d('0x46')][_0xad5d('0x4e')]=_0x4586c9['id'];_0x3c8a25[_0xad5d('0x46')][_0xad5d('0x4f')]=integrations[_0xad5d('0x50')](_0x3c8a25[_0xad5d('0x46')]['channel'],_0x3c8a25[_0xad5d('0x46')][_0xad5d('0x2a')]);_0x3c8a25[_0xad5d('0x46')][_0xad5d('0x51')]=integrations['getDescriptions'](_0x3c8a25['body']['channel'],_0x3c8a25[_0xad5d('0x46')][_0xad5d('0x2a')]);return db[_0xad5d('0x4a')][_0xad5d('0x45')](_0x3c8a25[_0xad5d('0x46')],{'include':[{'model':db[_0xad5d('0x52')],'as':_0xad5d('0x4f')},{'model':db[_0xad5d('0x52')],'as':'Descriptions'}]});}return null;})[_0xad5d('0x21')](respondWithResult(_0x482b7f,null))['catch'](handleError(_0x482b7f,null));};exports[_0xad5d('0x53')]=function(_0x54d91b,_0x3a9e87,_0x185b02){var _0x44dd45='';var _0x5697c4='';return db[_0xad5d('0x27')][_0xad5d('0x49')]({'where':{'id':_0x54d91b[_0xad5d('0x40')]['id']},'attributes':['id',_0xad5d('0x54'),_0xad5d('0x55'),_0xad5d('0x56')]})[_0xad5d('0x21')](handleEntityNotFound(_0x3a9e87,null))['then'](function(_0x36a52f){if(_0x36a52f){_0x5697c4=_0x36a52f[_0xad5d('0x54')];_0x44dd45=_0x36a52f[_0xad5d('0x55')];var _0x5442ae=_0x36a52f[_0xad5d('0x55')][_0xad5d('0x57')](-0x1);if(_0x5442ae==='/'){_0x44dd45=_0x44dd45[_0xad5d('0x58')](0x0,_0x44dd45['lastIndexOf'](_0x5442ae));}return rp({'method':_0xad5d('0x59'),'uri':util['format'](_0xad5d('0x5a'),_0x44dd45,_0xad5d('0x5b')),'headers':{'Authorization':'Token\x20token='+_0x36a52f[_0xad5d('0x56')]},'json':!![]});}})[_0xad5d('0x21')](function(_0x535805){if(_0x535805){var _0x43e974=_0x535805[_0xad5d('0x5c')];var _0x54100f=![];var _0x3009f4=null;for(_0x3009f4=0x0;_0x3009f4<_0x43e974[_0xad5d('0x31')];_0x3009f4++){if(_0x43e974[_0x3009f4][_0xad5d('0x5d')]===_0x5697c4){_0x54100f=!![];}}if(_0x54100f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xad5d('0x5e')});}}})['then'](respondWithResult(_0x3a9e87,null))[_0xad5d('0x44')](function(_0x49f9e6){var _0x356c78=_0x54d91b[_0xad5d('0x2d')][_0xad5d('0x5f')]?0x1f4:_0x49f9e6[_0xad5d('0x60')]||0x1f4;logger['error'](_0xad5d('0x61'),_0xad5d('0x53'),_0x356c78,JSON[_0xad5d('0x62')](_0x49f9e6));delete _0x49f9e6['name'];if(_0x356c78===0x191){_0x356c78=0x190;}_0x3a9e87[_0xad5d('0x18')](_0x356c78)['send'](_0x54d91b[_0xad5d('0x2d')][_0xad5d('0x5f')]?{'message':_0xad5d('0x63'),'statusCode':_0x49f9e6[_0xad5d('0x60')]}:_0x49f9e6);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 585476d..b088e47 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 _0xf61e=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2ecbc1,_0x4869c8){var _0x1ae2f2=function(_0x474c98){while(--_0x474c98){_0x2ecbc1['push'](_0x2ecbc1['shift']());}};_0x1ae2f2(++_0x4869c8);}(_0xf61e,0x191));var _0xef61=function(_0x5f268e,_0x5c7c7e){_0x5f268e=_0x5f268e-0x0;var _0x58dee8=_0xf61e[_0x5f268e];return _0x58dee8;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var logger=require(_0xef61('0x2'))(_0xef61('0x3'));var moment=require(_0xef61('0x4'));var BPromise=require(_0xef61('0x5'));var rp=require(_0xef61('0x6'));var fs=require('fs');var path=require(_0xef61('0x7'));var rimraf=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var attributes=require(_0xef61('0xa'));var integrations=require(_0xef61('0xb'));module['exports']=function(_0x9e17f4,_0x3e2f79){return _0x9e17f4['define'](_0xef61('0xc'),attributes,{'tableName':_0xef61('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcaf2=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x3233c3,_0x15e5fa){var _0x36029b=function(_0xe3dd12){while(--_0xe3dd12){_0x3233c3['push'](_0x3233c3['shift']());}};_0x36029b(++_0x15e5fa);}(_0xcaf2,0x8a));var _0x2caf=function(_0xa5bd84,_0x287943){_0xa5bd84=_0xa5bd84-0x0;var _0x22bcca=_0xcaf2[_0xa5bd84];return _0x22bcca;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var logger=require(_0x2caf('0x1'))(_0x2caf('0x2'));var moment=require('moment');var BPromise=require(_0x2caf('0x3'));var rp=require(_0x2caf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2caf('0x5'));var config=require('../../config/environment');var attributes=require(_0x2caf('0x6'));var integrations=require(_0x2caf('0x7'));module[_0x2caf('0x8')]=function(_0x599ce7,_0xc44e4e){return _0x599ce7[_0x2caf('0x9')](_0x2caf('0xa'),attributes,{'tableName':_0x2caf('0xb'),'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 5c12f45..1150242 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 _0xc4aa=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowFreshsalesAccount','lodash','util','moment'];(function(_0xf95355,_0x5ab11d){var _0x1108b1=function(_0xdfb6c0){while(--_0xdfb6c0){_0xf95355['push'](_0xf95355['shift']());}};_0x1108b1(++_0x5ab11d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')]({'raw':_0x28e304[_0xac4a('0x18')]?_0x28e304['options'][_0xac4a('0x19')]===undefined?!![]:![]:!![],'where':_0x28e304[_0xac4a('0x18')]?_0x28e304[_0xac4a('0x18')][_0xac4a('0x1a')]||null:null,'attributes':_0x28e304[_0xac4a('0x18')]?_0x28e304[_0xac4a('0x18')][_0xac4a('0x1b')]||null:null,'limit':_0x28e304[_0xac4a('0x18')]?_0x28e304['options'][_0xac4a('0x1c')]||null:null,'include':_0x28e304[_0xac4a('0x18')]?_0x28e304['options'][_0xac4a('0x1d')]?_[_0xac4a('0x1e')](_0x28e304[_0xac4a('0x18')][_0xac4a('0x1d')],function(_0x4d2d6c){return{'model':db[_0x4d2d6c[_0xac4a('0x1f')]],'as':_0x4d2d6c['as'],'attributes':_0x4d2d6c[_0xac4a('0x1b')],'include':_0x4d2d6c[_0xac4a('0x1d')]?_[_0xac4a('0x1e')](_0x4d2d6c[_0xac4a('0x1d')],function(_0x2b0dc2){return{'model':db[_0x2b0dc2[_0xac4a('0x1f')]],'as':_0x2b0dc2['as'],'attributes':_0x2b0dc2[_0xac4a('0x1b')],'include':_0x2b0dc2[_0xac4a('0x1d')]?_[_0xac4a('0x1e')](_0x2b0dc2[_0xac4a('0x1d')],function(_0x215a31){return{'model':db[_0x215a31[_0xac4a('0x1f')]],'as':_0x215a31['as'],'attributes':_0x215a31[_0xac4a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac4a('0xc')](function(_0x20202c){logger['info'](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON[_0xac4a('0x20')](_0x20202c));_0x546c5d(_0x20202c);})[_0xac4a('0x14')](function(_0x4a5a9e){logger['error'](_0xac4a('0x15'),_0x4a5a9e[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x4a5a9e['message']));});});};exports['ShowFreshsalesAccount']=function(_0x355755){var _0x2896bc=this;return new Promise(function(_0x228629,_0x432066){return db[_0xac4a('0x16')]['find']({'raw':_0x355755[_0xac4a('0x18')]?_0x355755['options'][_0xac4a('0x19')]===undefined?!![]:![]:!![],'where':_0x355755['options']?_0x355755[_0xac4a('0x18')][_0xac4a('0x1a')]||null:null,'attributes':_0x355755[_0xac4a('0x18')]?_0x355755[_0xac4a('0x18')][_0xac4a('0x1b')]||null:null,'include':_0x355755[_0xac4a('0x18')]?_0x355755[_0xac4a('0x18')][_0xac4a('0x1d')]?_[_0xac4a('0x1e')](_0x355755[_0xac4a('0x18')][_0xac4a('0x1d')],function(_0x1634df){return{'model':db[_0x1634df[_0xac4a('0x1f')]],'as':_0x1634df['as'],'attributes':_0x1634df[_0xac4a('0x1b')],'include':_0x1634df['include']?_[_0xac4a('0x1e')](_0x1634df[_0xac4a('0x1d')],function(_0x5a4e2b){return{'model':db[_0x5a4e2b[_0xac4a('0x1f')]],'as':_0x5a4e2b['as'],'attributes':_0x5a4e2b[_0xac4a('0x1b')],'include':_0x5a4e2b['include']?_['map'](_0x5a4e2b[_0xac4a('0x1d')],function(_0x1ba096){return{'model':db[_0x1ba096[_0xac4a('0x1f')]],'as':_0x1ba096['as'],'attributes':_0x1ba096[_0xac4a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x453d02){logger[_0xac4a('0x13')]('ShowFreshsalesAccount',_0x355755);logger[_0xac4a('0xf')](_0xac4a('0x21'),_0x355755,JSON[_0xac4a('0x20')](_0x453d02));_0x228629(_0x453d02);})['catch'](function(_0x121328){logger[_0xac4a('0x10')](_0xac4a('0x21'),_0x121328['message'],_0x355755);_0x432066(_0x2896bc[_0xac4a('0x10')](0x1f4,_0x121328[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x524e=['http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshsalesAccount','catch','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x83b21d,_0x747f5f){var _0x52d1f1=function(_0x9d5ffd){while(--_0x9d5ffd){_0x83b21d['push'](_0x83b21d['shift']());}};_0x52d1f1(++_0x747f5f);}(_0x524e,0x15e));var _0xe524=function(_0x2b3972,_0x4780c3){_0x2b3972=_0x2b3972-0x0;var _0x391d14=_0x524e[_0x2b3972];return _0x391d14;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['GetFreshsalesAccount']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')]({'raw':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x19')]===undefined?!![]:![]:!![],'where':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1b')]||null:null,'limit':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1c')]||null:null,'include':_0x3a4027[_0xe524('0x18')]?_0x3a4027['options'][_0xe524('0x1d')]?_['map'](_0x3a4027['options'][_0xe524('0x1d')],function(_0x23df5e){return{'model':db[_0x23df5e[_0xe524('0x1e')]],'as':_0x23df5e['as'],'attributes':_0x23df5e[_0xe524('0x1b')],'include':_0x23df5e['include']?_[_0xe524('0x1f')](_0x23df5e['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x1e')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1b')],'include':_0x17e245[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x17e245[_0xe524('0x1d')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x45abad){logger[_0xe524('0xd')](_0xe524('0x20'),_0x3a4027);logger[_0xe524('0x10')]('GetFreshsalesAccount',_0x3a4027,JSON['stringify'](_0x45abad));_0x11b2a1(_0x45abad);})[_0xe524('0x21')](function(_0x25e7a7){logger[_0xe524('0x13')](_0xe524('0x20'),_0x25e7a7[_0xe524('0x15')],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x25e7a7[_0xe524('0x15')]));});});};exports[_0xe524('0x22')]=function(_0x4a4e15){var _0x5b7ded=this;return new Promise(function(_0x20688e,_0x376324){return db['FreshsalesAccount'][_0xe524('0x23')]({'raw':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['attributes']||null:null,'include':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')]?_['map'](_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')],function(_0x49c43e){return{'model':db[_0x49c43e[_0xe524('0x1e')]],'as':_0x49c43e['as'],'attributes':_0x49c43e[_0xe524('0x1b')],'include':_0x49c43e[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x49c43e['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x1e')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1b')],'include':_0x415450[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x415450[_0xe524('0x1d')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x1e')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x56f371){logger[_0xe524('0xd')](_0xe524('0x22'),_0x4a4e15);logger['debug'](_0xe524('0x22'),_0x4a4e15,JSON['stringify'](_0x56f371));_0x20688e(_0x56f371);})[_0xe524('0x21')](function(_0x41af26){logger[_0xe524('0x13')](_0xe524('0x22'),_0x41af26[_0xe524('0x15')],_0x4a4e15);_0x376324(_0x5b7ded[_0xe524('0x13')](0x1f4,_0x41af26[_0xe524('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 4764d90..7c73b79 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 _0xeed5=['update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','put'];(function(_0x1a6bc2,_0x126f66){var _0x147952=function(_0x41f6fc){while(--_0x41f6fc){_0x1a6bc2['push'](_0x1a6bc2['shift']());}};_0x147952(++_0x126f66);}(_0xeed5,0xea));var _0x5eed=function(_0x37f0c8,_0x2f80a1){_0x37f0c8=_0x37f0c8-0x0;var _0x57c6f9=_0xeed5[_0x37f0c8];return _0x57c6f9;};'use strict';var multer=require('multer');var util=require(_0x5eed('0x0'));var path=require(_0x5eed('0x1'));var timeout=require(_0x5eed('0x2'));var express=require('express');var router=express[_0x5eed('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5eed('0x4'));var interaction=require(_0x5eed('0x5'));var config=require(_0x5eed('0x6'));var controller=require(_0x5eed('0x7'));router[_0x5eed('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5eed('0x9'),auth[_0x5eed('0xa')](),controller['show']);router[_0x5eed('0x8')](_0x5eed('0xb'),auth['isAuthenticated'](),controller[_0x5eed('0xc')]);router[_0x5eed('0x8')]('/:id/descriptions',auth[_0x5eed('0xa')](),controller[_0x5eed('0xd')]);router[_0x5eed('0x8')](_0x5eed('0xe'),auth[_0x5eed('0xa')](),controller[_0x5eed('0xf')]);router[_0x5eed('0x10')]('/',auth[_0x5eed('0xa')](),controller['create']);router[_0x5eed('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5eed('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5eed('0x13')]);module[_0x5eed('0x14')]=router; \ No newline at end of file +var _0x96a5=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x96a5,0x93));var _0x596a=function(_0x389c94,_0x5bfec8){_0x389c94=_0x389c94-0x0;var _0x510374=_0x96a5[_0x389c94];return _0x510374;};'use strict';var multer=require(_0x596a('0x0'));var util=require(_0x596a('0x1'));var path=require(_0x596a('0x2'));var timeout=require(_0x596a('0x3'));var express=require(_0x596a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x596a('0x5'));var interaction=require(_0x596a('0x6'));var config=require(_0x596a('0x7'));var controller=require(_0x596a('0x8'));router[_0x596a('0x9')]('/',auth[_0x596a('0xa')](),controller[_0x596a('0xb')]);router[_0x596a('0x9')](_0x596a('0xc'),auth[_0x596a('0xa')](),controller[_0x596a('0xd')]);router[_0x596a('0x9')](_0x596a('0xe'),auth[_0x596a('0xa')](),controller['getSubjects']);router[_0x596a('0x9')](_0x596a('0xf'),auth[_0x596a('0xa')](),controller[_0x596a('0x10')]);router['get'](_0x596a('0x11'),auth['isAuthenticated'](),controller[_0x596a('0x12')]);router['post']('/',auth[_0x596a('0xa')](),controller[_0x596a('0x13')]);router[_0x596a('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x596a('0x15')]);router[_0x596a('0x16')](_0x596a('0xc'),auth[_0x596a('0xa')](),controller[_0x596a('0x17')]);module[_0x596a('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 75ad26e..8ea4b6e 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 _0xcc9c=['STRING','sequelize','exports'];(function(_0x478a19,_0x2ff359){var _0x7fd2fa=function(_0x2aeb50){while(--_0x2aeb50){_0x478a19['push'](_0x478a19['shift']());}};_0x7fd2fa(++_0x2ff359);}(_0xcc9c,0x85));var _0xccc9=function(_0x78c0ee,_0x49f115){_0x78c0ee=_0x78c0ee-0x0;var _0x5ed903=_0xcc9c[_0x78c0ee];return _0x5ed903;};'use strict';var Sequelize=require(_0xccc9('0x0'));module[_0xccc9('0x1')]={'name':{'type':Sequelize[_0xccc9('0x2')]},'description':{'type':Sequelize[_0xccc9('0x2')]}}; \ No newline at end of file +var _0x7500=['STRING','sequelize','exports'];(function(_0x1d20ba,_0x5425bf){var _0x347f2a=function(_0x488c9b){while(--_0x488c9b){_0x1d20ba['push'](_0x1d20ba['shift']());}};_0x347f2a(++_0x5425bf);}(_0x7500,0x1b7));var _0x0750=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7500[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x0750('0x0'));module[_0x0750('0x1')]={'name':{'type':Sequelize[_0x0750('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 95b825a..0d39155 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 _0x18c8=['order','sort','where','pick','merge','type','filter','options','findAll','catch','params','include','find','create','body','findOne','hasOwnProperty','getSubjects','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit'];(function(_0x558f42,_0x3813dc){var _0x59223b=function(_0x378637){while(--_0x378637){_0x558f42['push'](_0x558f42['shift']());}};_0x59223b(++_0x3813dc);}(_0x18c8,0xff));var _0x818c=function(_0x3c5374,_0x49ed4e){_0x3c5374=_0x3c5374-0x0;var _0xd75fe1=_0x18c8[_0x3c5374];return _0xd75fe1;};'use strict';var emlformat=require(_0x818c('0x0'));var rimraf=require(_0x818c('0x1'));var zipdir=require(_0x818c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x818c('0x3'));var moment=require(_0x818c('0x4'));var BPromise=require(_0x818c('0x5'));var Mustache=require(_0x818c('0x6'));var util=require('util');var path=require(_0x818c('0x7'));var sox=require('sox');var csv=require(_0x818c('0x8'));var ejs=require(_0x818c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x818c('0xa'));var squel=require(_0x818c('0xb'));var crypto=require(_0x818c('0xc'));var jsforce=require(_0x818c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x818c('0x8'));var querystring=require('querystring');var Papa=require(_0x818c('0xe'));var Redis=require(_0x818c('0xf'));var authService=require(_0x818c('0x10'));var qs=require(_0x818c('0x11'));var as=require(_0x818c('0x12'));var hardwareService=require(_0x818c('0x13'));var logger=require(_0x818c('0x14'))(_0x818c('0x15'));var utils=require(_0x818c('0x16'));var config=require(_0x818c('0x17'));var licenseUtil=require(_0x818c('0x18'));var db=require(_0x818c('0x19'))['db'];function respondWithStatusCode(_0x358e84,_0x53c900){_0x53c900=_0x53c900||0xcc;return function(_0x4c3200){if(_0x4c3200){return _0x358e84[_0x818c('0x1a')](_0x53c900);}return _0x358e84[_0x818c('0x1b')](_0x53c900)[_0x818c('0x1c')]();};}function respondWithResult(_0x27b6d6,_0x53e468){_0x53e468=_0x53e468||0xc8;return function(_0x13acfc){if(_0x13acfc){return _0x27b6d6[_0x818c('0x1b')](_0x53e468)['json'](_0x13acfc);}};}function respondWithFilteredResult(_0x3fbfeb,_0xf4a02){return function(_0xc059b2){if(_0xc059b2){var _0x479c12=typeof _0xf4a02[_0x818c('0x1d')]===_0x818c('0x1e')&&typeof _0xf4a02[_0x818c('0x1f')]===_0x818c('0x1e');var _0xbacc3e=_0xc059b2[_0x818c('0x20')];var _0x4562f3=_0x479c12?0x0:_0xf4a02[_0x818c('0x1d')];var _0x1d72ca=_0x479c12?_0xc059b2['count']:_0xf4a02[_0x818c('0x1d')]+_0xf4a02[_0x818c('0x1f')];var _0x5b897f;if(_0x1d72ca>=_0xbacc3e){_0x1d72ca=_0xbacc3e;_0x5b897f=0xc8;}else{_0x5b897f=0xce;}_0x3fbfeb[_0x818c('0x1b')](_0x5b897f);return _0x3fbfeb[_0x818c('0x21')](_0x818c('0x22'),_0x4562f3+'-'+_0x1d72ca+'/'+_0xbacc3e)[_0x818c('0x23')](_0xc059b2);}return null;};}function patchUpdates(_0x3b8285){return function(_0x53190e){try{jsonpatch[_0x818c('0x24')](_0x53190e,_0x3b8285,!![]);}catch(_0x21c59a){return BPromise['reject'](_0x21c59a);}return _0x53190e['save']();};}function saveUpdates(_0x100bae,_0x4d90a0){return function(_0x5368be){if(_0x5368be){return _0x5368be[_0x818c('0x25')](_0x100bae)[_0x818c('0x26')](function(_0x505898){return _0x505898;});}return null;};}function removeEntity(_0x5a1257,_0x384f55){return function(_0x38934f){if(_0x38934f){return _0x38934f[_0x818c('0x27')]()[_0x818c('0x26')](function(){_0x5a1257[_0x818c('0x1b')](0xcc)[_0x818c('0x1c')]();});}};}function handleEntityNotFound(_0xe7bdce,_0x513e03){return function(_0x777a75){if(!_0x777a75){_0xe7bdce['sendStatus'](0x194);}return _0x777a75;};}function handleError(_0x49df3e,_0x5e4a4b){_0x5e4a4b=_0x5e4a4b||0x1f4;return function(_0x491587){logger['error'](_0x491587[_0x818c('0x28')]);if(_0x491587[_0x818c('0x29')]){delete _0x491587[_0x818c('0x29')];}_0x49df3e['status'](_0x5e4a4b)[_0x818c('0x2a')](_0x491587);};}exports[_0x818c('0x2b')]=function(_0x187db9,_0x11dceb){var _0x5b0fb5={},_0x2ed522={},_0x1fe750={'count':0x0,'rows':[]};var _0x544f12=_[_0x818c('0x2c')](db[_0x818c('0x2d')][_0x818c('0x2e')],function(_0x4508a6){return{'name':_0x4508a6[_0x818c('0x2f')],'type':_0x4508a6['type']['key']};});_0x2ed522[_0x818c('0x30')]=_[_0x818c('0x2c')](_0x544f12,_0x818c('0x29'));_0x2ed522[_0x818c('0x31')]=_[_0x818c('0x32')](_0x187db9[_0x818c('0x31')]);_0x2ed522[_0x818c('0x33')]=_['intersection'](_0x2ed522[_0x818c('0x30')],_0x2ed522[_0x818c('0x31')]);_0x5b0fb5['attributes']=_[_0x818c('0x34')](_0x2ed522[_0x818c('0x30')],qs[_0x818c('0x35')](_0x187db9[_0x818c('0x31')][_0x818c('0x35')]));_0x5b0fb5['attributes']=_0x5b0fb5[_0x818c('0x36')][_0x818c('0x37')]?_0x5b0fb5[_0x818c('0x36')]:_0x2ed522[_0x818c('0x30')];if(!_0x187db9['query']['hasOwnProperty'](_0x818c('0x38'))){_0x5b0fb5[_0x818c('0x1f')]=qs['limit'](_0x187db9[_0x818c('0x31')][_0x818c('0x1f')]);_0x5b0fb5[_0x818c('0x1d')]=qs[_0x818c('0x1d')](_0x187db9[_0x818c('0x31')][_0x818c('0x1d')]);}_0x5b0fb5[_0x818c('0x39')]=qs[_0x818c('0x3a')](_0x187db9[_0x818c('0x31')][_0x818c('0x3a')]);_0x5b0fb5[_0x818c('0x3b')]=qs[_0x818c('0x33')](_[_0x818c('0x3c')](_0x187db9[_0x818c('0x31')],_0x2ed522[_0x818c('0x33')]),_0x544f12);if(_0x187db9['query']['filter']){_0x5b0fb5[_0x818c('0x3b')]=_[_0x818c('0x3d')](_0x5b0fb5[_0x818c('0x3b')],{'$or':_[_0x818c('0x2c')](_0x544f12,function(_0x5e2d72){if(_0x5e2d72[_0x818c('0x3e')]!=='VIRTUAL'){var _0x5ba14a={};_0x5ba14a[_0x5e2d72[_0x818c('0x29')]]={'$like':'%'+_0x187db9[_0x818c('0x31')][_0x818c('0x3f')]+'%'};return _0x5ba14a;}})});}_0x5b0fb5=_[_0x818c('0x3d')]({},_0x5b0fb5,_0x187db9[_0x818c('0x40')]);var _0x453ebb={'where':_0x5b0fb5[_0x818c('0x3b')]};return db[_0x818c('0x2d')][_0x818c('0x20')](_0x453ebb)[_0x818c('0x26')](function(_0x99c2ef){_0x1fe750[_0x818c('0x20')]=_0x99c2ef;if(_0x187db9['query']['includeAll']){_0x5b0fb5['include']=[{'all':!![]}];}return db[_0x818c('0x2d')][_0x818c('0x41')](_0x5b0fb5);})[_0x818c('0x26')](function(_0x1cc647){_0x1fe750['rows']=_0x1cc647;return _0x1fe750;})[_0x818c('0x26')](respondWithFilteredResult(_0x11dceb,_0x5b0fb5))[_0x818c('0x42')](handleError(_0x11dceb,null));};exports['show']=function(_0x1196dd,_0x2d8537){var _0x3229fc={'raw':![],'where':{'id':_0x1196dd[_0x818c('0x43')]['id']}},_0x364bf3={};_0x364bf3['model']=_[_0x818c('0x32')](db['FreshsalesConfiguration']['rawAttributes']);_0x364bf3[_0x818c('0x31')]=_['keys'](_0x1196dd[_0x818c('0x31')]);_0x364bf3[_0x818c('0x33')]=_[_0x818c('0x34')](_0x364bf3[_0x818c('0x30')],_0x364bf3[_0x818c('0x31')]);_0x3229fc[_0x818c('0x36')]=_[_0x818c('0x34')](_0x364bf3['model'],qs[_0x818c('0x35')](_0x1196dd[_0x818c('0x31')][_0x818c('0x35')]));_0x3229fc['attributes']=_0x3229fc['attributes']['length']?_0x3229fc[_0x818c('0x36')]:_0x364bf3[_0x818c('0x30')];if(_0x1196dd[_0x818c('0x31')]['includeAll']){_0x3229fc[_0x818c('0x44')]=[{'all':!![]}];}_0x3229fc=_['merge']({},_0x3229fc,_0x1196dd[_0x818c('0x40')]);return db[_0x818c('0x2d')][_0x818c('0x45')](_0x3229fc)[_0x818c('0x26')](handleEntityNotFound(_0x2d8537,null))[_0x818c('0x26')](respondWithResult(_0x2d8537,null))[_0x818c('0x42')](handleError(_0x2d8537,null));};exports[_0x818c('0x46')]=function(_0x634b32,_0xab0734){return db[_0x818c('0x2d')][_0x818c('0x46')](_0x634b32[_0x818c('0x47')],{})[_0x818c('0x26')](respondWithResult(_0xab0734,0xc9))[_0x818c('0x42')](handleError(_0xab0734,null));};exports[_0x818c('0x25')]=function(_0x35c04c,_0x357f1f){if(_0x35c04c[_0x818c('0x47')]['id']){delete _0x35c04c[_0x818c('0x47')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x35c04c[_0x818c('0x43')]['id']}})['then'](handleEntityNotFound(_0x357f1f,null))[_0x818c('0x26')](saveUpdates(_0x35c04c[_0x818c('0x47')],null))[_0x818c('0x26')](respondWithResult(_0x357f1f,null))[_0x818c('0x42')](handleError(_0x357f1f,null));};exports['destroy']=function(_0x3c96f3,_0x54309d){return db[_0x818c('0x2d')][_0x818c('0x45')]({'where':{'id':_0x3c96f3['params']['id']}})[_0x818c('0x26')](handleEntityNotFound(_0x54309d,null))[_0x818c('0x26')](removeEntity(_0x54309d,null))[_0x818c('0x42')](handleError(_0x54309d,null));};exports['getSubjects']=function(_0x4f30e2,_0x1812a4,_0x513063){var _0x25f1f1={};var _0x359fd6={};var _0x1cce7d;var _0xd1563c;return db['FreshsalesConfiguration'][_0x818c('0x48')]({'where':{'id':_0x4f30e2[_0x818c('0x43')]['id']}})[_0x818c('0x26')](handleEntityNotFound(_0x1812a4,null))[_0x818c('0x26')](function(_0x27f03b){if(_0x27f03b){_0x1cce7d=_0x27f03b;_0x359fd6[_0x818c('0x30')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x359fd6['query']=_[_0x818c('0x32')](_0x4f30e2[_0x818c('0x31')]);_0x359fd6[_0x818c('0x33')]=_[_0x818c('0x34')](_0x359fd6[_0x818c('0x30')],_0x359fd6['query']);_0x25f1f1['attributes']=_[_0x818c('0x34')](_0x359fd6[_0x818c('0x30')],qs[_0x818c('0x35')](_0x4f30e2[_0x818c('0x31')]['fields']));_0x25f1f1[_0x818c('0x36')]=_0x25f1f1[_0x818c('0x36')][_0x818c('0x37')]?_0x25f1f1[_0x818c('0x36')]:_0x359fd6['model'];_0x25f1f1[_0x818c('0x39')]=qs['sort'](_0x4f30e2['query'][_0x818c('0x3a')]);_0x25f1f1[_0x818c('0x3b')]=qs[_0x818c('0x33')](_[_0x818c('0x3c')](_0x4f30e2[_0x818c('0x31')],_0x359fd6['filters']));if(_0x4f30e2['query'][_0x818c('0x3f')]){_0x25f1f1[_0x818c('0x3b')]=_[_0x818c('0x3d')](_0x25f1f1[_0x818c('0x3b')],{'$or':_[_0x818c('0x2c')](_0x25f1f1['attributes'],function(_0x14c1d9){var _0x23c60c={};_0x23c60c[_0x14c1d9]={'$like':'%'+_0x4f30e2[_0x818c('0x31')]['filter']+'%'};return _0x23c60c;})});}_0x25f1f1=_[_0x818c('0x3d')]({},_0x25f1f1,_0x4f30e2['options']);return _0x1cce7d['getSubjects'](_0x25f1f1);}})[_0x818c('0x26')](function(_0x322313){if(_0x322313){_0xd1563c=_0x322313[_0x818c('0x37')];if(!_0x4f30e2[_0x818c('0x31')][_0x818c('0x49')](_0x818c('0x38'))){_0x25f1f1['limit']=qs[_0x818c('0x1f')](_0x4f30e2[_0x818c('0x31')][_0x818c('0x1f')]);_0x25f1f1['offset']=qs[_0x818c('0x1d')](_0x4f30e2[_0x818c('0x31')][_0x818c('0x1d')]);}return _0x1cce7d[_0x818c('0x4a')](_0x25f1f1);}})[_0x818c('0x26')](function(_0x3d9bd0){if(_0x3d9bd0){return _0x3d9bd0?{'count':_0xd1563c,'rows':_0x3d9bd0}:null;}})['then'](respondWithResult(_0x1812a4,null))[_0x818c('0x42')](handleError(_0x1812a4,null));};exports[_0x818c('0x4b')]=function(_0x20656d,_0x4e69af,_0x412619){var _0x37e8ef={};var _0x500d7c={};var _0xc3c77a;var _0x3309cc;return db[_0x818c('0x2d')][_0x818c('0x48')]({'where':{'id':_0x20656d[_0x818c('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e69af,null))[_0x818c('0x26')](function(_0x453ad0){if(_0x453ad0){_0xc3c77a=_0x453ad0;_0x500d7c['model']=_[_0x818c('0x32')](db[_0x818c('0x4c')][_0x818c('0x2e')]);_0x500d7c['query']=_[_0x818c('0x32')](_0x20656d['query']);_0x500d7c[_0x818c('0x33')]=_[_0x818c('0x34')](_0x500d7c[_0x818c('0x30')],_0x500d7c['query']);_0x37e8ef[_0x818c('0x36')]=_['intersection'](_0x500d7c['model'],qs['fields'](_0x20656d[_0x818c('0x31')][_0x818c('0x35')]));_0x37e8ef[_0x818c('0x36')]=_0x37e8ef['attributes'][_0x818c('0x37')]?_0x37e8ef[_0x818c('0x36')]:_0x500d7c[_0x818c('0x30')];_0x37e8ef['order']=qs['sort'](_0x20656d[_0x818c('0x31')][_0x818c('0x3a')]);_0x37e8ef['where']=qs[_0x818c('0x33')](_[_0x818c('0x3c')](_0x20656d[_0x818c('0x31')],_0x500d7c['filters']));if(_0x20656d[_0x818c('0x31')]['filter']){_0x37e8ef['where']=_[_0x818c('0x3d')](_0x37e8ef['where'],{'$or':_[_0x818c('0x2c')](_0x37e8ef['attributes'],function(_0x4d5ca9){var _0xeabe53={};_0xeabe53[_0x4d5ca9]={'$like':'%'+_0x20656d[_0x818c('0x31')][_0x818c('0x3f')]+'%'};return _0xeabe53;})});}_0x37e8ef=_[_0x818c('0x3d')]({},_0x37e8ef,_0x20656d[_0x818c('0x40')]);return _0xc3c77a[_0x818c('0x4b')](_0x37e8ef);}})[_0x818c('0x26')](function(_0x351f1f){if(_0x351f1f){_0x3309cc=_0x351f1f[_0x818c('0x37')];if(!_0x20656d[_0x818c('0x31')][_0x818c('0x49')]('nolimit')){_0x37e8ef[_0x818c('0x1f')]=qs['limit'](_0x20656d[_0x818c('0x31')]['limit']);_0x37e8ef[_0x818c('0x1d')]=qs[_0x818c('0x1d')](_0x20656d[_0x818c('0x31')][_0x818c('0x1d')]);}return _0xc3c77a[_0x818c('0x4b')](_0x37e8ef);}})[_0x818c('0x26')](function(_0x2ebc8d){if(_0x2ebc8d){return _0x2ebc8d?{'count':_0x3309cc,'rows':_0x2ebc8d}:null;}})[_0x818c('0x26')](respondWithResult(_0x4e69af,null))[_0x818c('0x42')](handleError(_0x4e69af,null));};exports[_0x818c('0x4d')]=function(_0x16cd2d,_0x2dd7fe,_0x116c85){var _0x38ba6d={};var _0x3e5f27={};var _0xd9e644;var _0x405dbd;return db[_0x818c('0x2d')][_0x818c('0x48')]({'where':{'id':_0x16cd2d['params']['id']}})['then'](handleEntityNotFound(_0x2dd7fe,null))[_0x818c('0x26')](function(_0x105017){if(_0x105017){_0xd9e644=_0x105017;_0x3e5f27['model']=_[_0x818c('0x32')](db[_0x818c('0x4c')]['rawAttributes']);_0x3e5f27[_0x818c('0x31')]=_[_0x818c('0x32')](_0x16cd2d[_0x818c('0x31')]);_0x3e5f27[_0x818c('0x33')]=_[_0x818c('0x34')](_0x3e5f27[_0x818c('0x30')],_0x3e5f27[_0x818c('0x31')]);_0x38ba6d[_0x818c('0x36')]=_[_0x818c('0x34')](_0x3e5f27[_0x818c('0x30')],qs[_0x818c('0x35')](_0x16cd2d[_0x818c('0x31')][_0x818c('0x35')]));_0x38ba6d[_0x818c('0x36')]=_0x38ba6d['attributes'][_0x818c('0x37')]?_0x38ba6d[_0x818c('0x36')]:_0x3e5f27[_0x818c('0x30')];_0x38ba6d[_0x818c('0x39')]=qs[_0x818c('0x3a')](_0x16cd2d[_0x818c('0x31')][_0x818c('0x3a')]);_0x38ba6d['where']=qs['filters'](_[_0x818c('0x3c')](_0x16cd2d['query'],_0x3e5f27[_0x818c('0x33')]));if(_0x16cd2d[_0x818c('0x31')][_0x818c('0x3f')]){_0x38ba6d['where']=_[_0x818c('0x3d')](_0x38ba6d[_0x818c('0x3b')],{'$or':_[_0x818c('0x2c')](_0x38ba6d[_0x818c('0x36')],function(_0x52918d){var _0xbd36a1={};_0xbd36a1[_0x52918d]={'$like':'%'+_0x16cd2d[_0x818c('0x31')][_0x818c('0x3f')]+'%'};return _0xbd36a1;})});}_0x38ba6d=_['merge']({},_0x38ba6d,_0x16cd2d[_0x818c('0x40')]);return _0xd9e644['getFields'](_0x38ba6d);}})[_0x818c('0x26')](function(_0x400ccd){if(_0x400ccd){_0x405dbd=_0x400ccd['length'];if(!_0x16cd2d[_0x818c('0x31')][_0x818c('0x49')](_0x818c('0x38'))){_0x38ba6d[_0x818c('0x1f')]=qs['limit'](_0x16cd2d[_0x818c('0x31')][_0x818c('0x1f')]);_0x38ba6d[_0x818c('0x1d')]=qs[_0x818c('0x1d')](_0x16cd2d['query']['offset']);}return _0xd9e644[_0x818c('0x4d')](_0x38ba6d);}})['then'](function(_0x3560a0){if(_0x3560a0){return _0x3560a0?{'count':_0x405dbd,'rows':_0x3560a0}:null;}})[_0x818c('0x26')](respondWithResult(_0x2dd7fe,null))[_0x818c('0x42')](handleError(_0x2dd7fe,null));}; \ No newline at end of file +var _0xa43a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','status','set','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','FreshsalesConfiguration','include','findAll','rows','catch','show','params','find','create','body','findOne','FreshsalesField','nolimit','getSubjects','getDescriptions','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x43fae7,_0x5aae76){var _0xedfd71=function(_0x5ee1ed){while(--_0x5ee1ed){_0x43fae7['push'](_0x43fae7['shift']());}};_0xedfd71(++_0x5aae76);}(_0xa43a,0xe3));var _0xaa43=function(_0x5f3713,_0x334c97){_0x5f3713=_0x5f3713-0x0;var _0x48829e=_0xa43a[_0x5f3713];return _0x48829e;};'use strict';var emlformat=require(_0xaa43('0x0'));var rimraf=require(_0xaa43('0x1'));var zipdir=require(_0xaa43('0x2'));var jsonpatch=require(_0xaa43('0x3'));var rp=require(_0xaa43('0x4'));var moment=require(_0xaa43('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaa43('0x6'));var util=require(_0xaa43('0x7'));var path=require(_0xaa43('0x8'));var sox=require(_0xaa43('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa43('0xa'));var _=require(_0xaa43('0xb'));var squel=require(_0xaa43('0xc'));var crypto=require(_0xaa43('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa43('0xe'));var toCsv=require(_0xaa43('0xf'));var querystring=require(_0xaa43('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa43('0x11'));var qs=require(_0xaa43('0x12'));var as=require(_0xaa43('0x13'));var hardwareService=require(_0xaa43('0x14'));var logger=require(_0xaa43('0x15'))('api');var utils=require(_0xaa43('0x16'));var config=require(_0xaa43('0x17'));var licenseUtil=require(_0xaa43('0x18'));var db=require(_0xaa43('0x19'))['db'];function respondWithStatusCode(_0xd86f93,_0x4d4a02){_0x4d4a02=_0x4d4a02||0xcc;return function(_0x4867a7){if(_0x4867a7){return _0xd86f93['sendStatus'](_0x4d4a02);}return _0xd86f93['status'](_0x4d4a02)[_0xaa43('0x1a')]();};}function respondWithResult(_0x492d6e,_0x57ed54){_0x57ed54=_0x57ed54||0xc8;return function(_0x3ff9e3){if(_0x3ff9e3){return _0x492d6e['status'](_0x57ed54)[_0xaa43('0x1b')](_0x3ff9e3);}};}function respondWithFilteredResult(_0xe10c43,_0x46511f){return function(_0xf011f8){if(_0xf011f8){var _0x255b57=typeof _0x46511f['offset']===_0xaa43('0x1c')&&typeof _0x46511f[_0xaa43('0x1d')]===_0xaa43('0x1c');var _0x352420=_0xf011f8[_0xaa43('0x1e')];var _0x454000=_0x255b57?0x0:_0x46511f[_0xaa43('0x1f')];var _0x29c58b=_0x255b57?_0xf011f8[_0xaa43('0x1e')]:_0x46511f[_0xaa43('0x1f')]+_0x46511f[_0xaa43('0x1d')];var _0x195613;if(_0x29c58b>=_0x352420){_0x29c58b=_0x352420;_0x195613=0xc8;}else{_0x195613=0xce;}_0xe10c43[_0xaa43('0x20')](_0x195613);return _0xe10c43[_0xaa43('0x21')]('Content-Range',_0x454000+'-'+_0x29c58b+'/'+_0x352420)[_0xaa43('0x1b')](_0xf011f8);}return null;};}function patchUpdates(_0x557432){return function(_0x1bd23f){try{jsonpatch[_0xaa43('0x22')](_0x1bd23f,_0x557432,!![]);}catch(_0x52c241){return BPromise[_0xaa43('0x23')](_0x52c241);}return _0x1bd23f['save']();};}function saveUpdates(_0x186aef,_0x5ad94c){return function(_0x166804){if(_0x166804){return _0x166804[_0xaa43('0x24')](_0x186aef)[_0xaa43('0x25')](function(_0xb705ea){return _0xb705ea;});}return null;};}function removeEntity(_0x37797b,_0x1f02de){return function(_0x572d00){if(_0x572d00){return _0x572d00[_0xaa43('0x26')]()[_0xaa43('0x25')](function(){_0x37797b[_0xaa43('0x20')](0xcc)[_0xaa43('0x1a')]();});}};}function handleEntityNotFound(_0xe61c66,_0x264953){return function(_0x4b8545){if(!_0x4b8545){_0xe61c66[_0xaa43('0x27')](0x194);}return _0x4b8545;};}function handleError(_0x3caf42,_0x327c55){_0x327c55=_0x327c55||0x1f4;return function(_0x42ee6b){logger[_0xaa43('0x28')](_0x42ee6b['stack']);if(_0x42ee6b[_0xaa43('0x29')]){delete _0x42ee6b[_0xaa43('0x29')];}_0x3caf42['status'](_0x327c55)[_0xaa43('0x2a')](_0x42ee6b);};}exports[_0xaa43('0x2b')]=function(_0x51f332,_0x583ca0){var _0xb7bd75={},_0x423336={},_0x5a9781={'count':0x0,'rows':[]};var _0x52645c=_[_0xaa43('0x2c')](db['FreshsalesConfiguration'][_0xaa43('0x2d')],function(_0x216941){return{'name':_0x216941[_0xaa43('0x2e')],'type':_0x216941[_0xaa43('0x2f')][_0xaa43('0x30')]};});_0x423336[_0xaa43('0x31')]=_['map'](_0x52645c,'name');_0x423336[_0xaa43('0x32')]=_[_0xaa43('0x33')](_0x51f332[_0xaa43('0x32')]);_0x423336[_0xaa43('0x34')]=_[_0xaa43('0x35')](_0x423336[_0xaa43('0x31')],_0x423336[_0xaa43('0x32')]);_0xb7bd75['attributes']=_[_0xaa43('0x35')](_0x423336[_0xaa43('0x31')],qs[_0xaa43('0x36')](_0x51f332[_0xaa43('0x32')][_0xaa43('0x36')]));_0xb7bd75[_0xaa43('0x37')]=_0xb7bd75['attributes'][_0xaa43('0x38')]?_0xb7bd75['attributes']:_0x423336[_0xaa43('0x31')];if(!_0x51f332[_0xaa43('0x32')][_0xaa43('0x39')]('nolimit')){_0xb7bd75['limit']=qs[_0xaa43('0x1d')](_0x51f332[_0xaa43('0x32')][_0xaa43('0x1d')]);_0xb7bd75[_0xaa43('0x1f')]=qs[_0xaa43('0x1f')](_0x51f332['query']['offset']);}_0xb7bd75[_0xaa43('0x3a')]=qs[_0xaa43('0x3b')](_0x51f332[_0xaa43('0x32')][_0xaa43('0x3b')]);_0xb7bd75[_0xaa43('0x3c')]=qs[_0xaa43('0x34')](_['pick'](_0x51f332[_0xaa43('0x32')],_0x423336['filters']),_0x52645c);if(_0x51f332[_0xaa43('0x32')][_0xaa43('0x3d')]){_0xb7bd75[_0xaa43('0x3c')]=_[_0xaa43('0x3e')](_0xb7bd75[_0xaa43('0x3c')],{'$or':_['map'](_0x52645c,function(_0x359145){if(_0x359145['type']!==_0xaa43('0x3f')){var _0x464820={};_0x464820[_0x359145[_0xaa43('0x29')]]={'$like':'%'+_0x51f332[_0xaa43('0x32')][_0xaa43('0x3d')]+'%'};return _0x464820;}})});}_0xb7bd75=_[_0xaa43('0x3e')]({},_0xb7bd75,_0x51f332[_0xaa43('0x40')]);var _0x4eb260={'where':_0xb7bd75[_0xaa43('0x3c')]};return db[_0xaa43('0x41')][_0xaa43('0x1e')](_0x4eb260)[_0xaa43('0x25')](function(_0x14c5b2){_0x5a9781['count']=_0x14c5b2;if(_0x51f332[_0xaa43('0x32')]['includeAll']){_0xb7bd75[_0xaa43('0x42')]=[{'all':!![]}];}return db[_0xaa43('0x41')][_0xaa43('0x43')](_0xb7bd75);})['then'](function(_0x69ca41){_0x5a9781[_0xaa43('0x44')]=_0x69ca41;return _0x5a9781;})[_0xaa43('0x25')](respondWithFilteredResult(_0x583ca0,_0xb7bd75))[_0xaa43('0x45')](handleError(_0x583ca0,null));};exports[_0xaa43('0x46')]=function(_0x1aa97b,_0x15fcce){var _0x226b6e={'raw':![],'where':{'id':_0x1aa97b[_0xaa43('0x47')]['id']}},_0x147748={};_0x147748[_0xaa43('0x31')]=_[_0xaa43('0x33')](db[_0xaa43('0x41')][_0xaa43('0x2d')]);_0x147748[_0xaa43('0x32')]=_[_0xaa43('0x33')](_0x1aa97b['query']);_0x147748['filters']=_[_0xaa43('0x35')](_0x147748['model'],_0x147748[_0xaa43('0x32')]);_0x226b6e['attributes']=_['intersection'](_0x147748[_0xaa43('0x31')],qs['fields'](_0x1aa97b[_0xaa43('0x32')]['fields']));_0x226b6e[_0xaa43('0x37')]=_0x226b6e[_0xaa43('0x37')]['length']?_0x226b6e[_0xaa43('0x37')]:_0x147748['model'];if(_0x1aa97b['query']['includeAll']){_0x226b6e[_0xaa43('0x42')]=[{'all':!![]}];}_0x226b6e=_[_0xaa43('0x3e')]({},_0x226b6e,_0x1aa97b[_0xaa43('0x40')]);return db[_0xaa43('0x41')][_0xaa43('0x48')](_0x226b6e)[_0xaa43('0x25')](handleEntityNotFound(_0x15fcce,null))['then'](respondWithResult(_0x15fcce,null))[_0xaa43('0x45')](handleError(_0x15fcce,null));};exports['create']=function(_0x421ddb,_0xb46ed){return db[_0xaa43('0x41')][_0xaa43('0x49')](_0x421ddb[_0xaa43('0x4a')],{})[_0xaa43('0x25')](respondWithResult(_0xb46ed,0xc9))[_0xaa43('0x45')](handleError(_0xb46ed,null));};exports[_0xaa43('0x24')]=function(_0x2474bb,_0x2f8af5){if(_0x2474bb['body']['id']){delete _0x2474bb['body']['id'];}return db[_0xaa43('0x41')][_0xaa43('0x48')]({'where':{'id':_0x2474bb[_0xaa43('0x47')]['id']}})[_0xaa43('0x25')](handleEntityNotFound(_0x2f8af5,null))[_0xaa43('0x25')](saveUpdates(_0x2474bb[_0xaa43('0x4a')],null))['then'](respondWithResult(_0x2f8af5,null))[_0xaa43('0x45')](handleError(_0x2f8af5,null));};exports[_0xaa43('0x26')]=function(_0x3d4be8,_0x5a3368){return db[_0xaa43('0x41')][_0xaa43('0x48')]({'where':{'id':_0x3d4be8[_0xaa43('0x47')]['id']}})[_0xaa43('0x25')](handleEntityNotFound(_0x5a3368,null))[_0xaa43('0x25')](removeEntity(_0x5a3368,null))[_0xaa43('0x45')](handleError(_0x5a3368,null));};exports['getSubjects']=function(_0x589ba9,_0x7d8b68,_0x5ae915){var _0x1d73ad={};var _0x2fcdfb={};var _0x597901;var _0x4e51ae;return db['FreshsalesConfiguration'][_0xaa43('0x4b')]({'where':{'id':_0x589ba9[_0xaa43('0x47')]['id']}})[_0xaa43('0x25')](handleEntityNotFound(_0x7d8b68,null))[_0xaa43('0x25')](function(_0x218188){if(_0x218188){_0x597901=_0x218188;_0x2fcdfb[_0xaa43('0x31')]=_[_0xaa43('0x33')](db[_0xaa43('0x4c')][_0xaa43('0x2d')]);_0x2fcdfb[_0xaa43('0x32')]=_[_0xaa43('0x33')](_0x589ba9[_0xaa43('0x32')]);_0x2fcdfb[_0xaa43('0x34')]=_[_0xaa43('0x35')](_0x2fcdfb[_0xaa43('0x31')],_0x2fcdfb[_0xaa43('0x32')]);_0x1d73ad[_0xaa43('0x37')]=_['intersection'](_0x2fcdfb[_0xaa43('0x31')],qs[_0xaa43('0x36')](_0x589ba9[_0xaa43('0x32')][_0xaa43('0x36')]));_0x1d73ad[_0xaa43('0x37')]=_0x1d73ad[_0xaa43('0x37')][_0xaa43('0x38')]?_0x1d73ad[_0xaa43('0x37')]:_0x2fcdfb[_0xaa43('0x31')];_0x1d73ad[_0xaa43('0x3a')]=qs[_0xaa43('0x3b')](_0x589ba9[_0xaa43('0x32')]['sort']);_0x1d73ad[_0xaa43('0x3c')]=qs['filters'](_['pick'](_0x589ba9[_0xaa43('0x32')],_0x2fcdfb[_0xaa43('0x34')]));if(_0x589ba9[_0xaa43('0x32')]['filter']){_0x1d73ad[_0xaa43('0x3c')]=_[_0xaa43('0x3e')](_0x1d73ad[_0xaa43('0x3c')],{'$or':_[_0xaa43('0x2c')](_0x1d73ad[_0xaa43('0x37')],function(_0x3d6cc7){var _0x2e66f3={};_0x2e66f3[_0x3d6cc7]={'$like':'%'+_0x589ba9[_0xaa43('0x32')][_0xaa43('0x3d')]+'%'};return _0x2e66f3;})});}_0x1d73ad=_['merge']({},_0x1d73ad,_0x589ba9[_0xaa43('0x40')]);return _0x597901['getSubjects'](_0x1d73ad);}})[_0xaa43('0x25')](function(_0x66ba75){if(_0x66ba75){_0x4e51ae=_0x66ba75[_0xaa43('0x38')];if(!_0x589ba9[_0xaa43('0x32')][_0xaa43('0x39')](_0xaa43('0x4d'))){_0x1d73ad[_0xaa43('0x1d')]=qs['limit'](_0x589ba9[_0xaa43('0x32')][_0xaa43('0x1d')]);_0x1d73ad['offset']=qs[_0xaa43('0x1f')](_0x589ba9[_0xaa43('0x32')]['offset']);}return _0x597901[_0xaa43('0x4e')](_0x1d73ad);}})[_0xaa43('0x25')](function(_0x1b198e){if(_0x1b198e){return _0x1b198e?{'count':_0x4e51ae,'rows':_0x1b198e}:null;}})[_0xaa43('0x25')](respondWithResult(_0x7d8b68,null))['catch'](handleError(_0x7d8b68,null));};exports['getDescriptions']=function(_0x32e86a,_0x53726f,_0x5f52e2){var _0x35751c={};var _0x4a141c={};var _0x485eb0;var _0x3c7e3b;return db[_0xaa43('0x41')][_0xaa43('0x4b')]({'where':{'id':_0x32e86a[_0xaa43('0x47')]['id']}})['then'](handleEntityNotFound(_0x53726f,null))[_0xaa43('0x25')](function(_0x59ca29){if(_0x59ca29){_0x485eb0=_0x59ca29;_0x4a141c[_0xaa43('0x31')]=_[_0xaa43('0x33')](db['FreshsalesField'][_0xaa43('0x2d')]);_0x4a141c[_0xaa43('0x32')]=_[_0xaa43('0x33')](_0x32e86a['query']);_0x4a141c[_0xaa43('0x34')]=_[_0xaa43('0x35')](_0x4a141c[_0xaa43('0x31')],_0x4a141c['query']);_0x35751c['attributes']=_[_0xaa43('0x35')](_0x4a141c['model'],qs[_0xaa43('0x36')](_0x32e86a[_0xaa43('0x32')][_0xaa43('0x36')]));_0x35751c[_0xaa43('0x37')]=_0x35751c['attributes'][_0xaa43('0x38')]?_0x35751c[_0xaa43('0x37')]:_0x4a141c['model'];_0x35751c['order']=qs[_0xaa43('0x3b')](_0x32e86a['query'][_0xaa43('0x3b')]);_0x35751c['where']=qs[_0xaa43('0x34')](_['pick'](_0x32e86a[_0xaa43('0x32')],_0x4a141c[_0xaa43('0x34')]));if(_0x32e86a[_0xaa43('0x32')][_0xaa43('0x3d')]){_0x35751c[_0xaa43('0x3c')]=_['merge'](_0x35751c[_0xaa43('0x3c')],{'$or':_[_0xaa43('0x2c')](_0x35751c['attributes'],function(_0x27db78){var _0x3507c5={};_0x3507c5[_0x27db78]={'$like':'%'+_0x32e86a[_0xaa43('0x32')][_0xaa43('0x3d')]+'%'};return _0x3507c5;})});}_0x35751c=_[_0xaa43('0x3e')]({},_0x35751c,_0x32e86a['options']);return _0x485eb0['getDescriptions'](_0x35751c);}})[_0xaa43('0x25')](function(_0x5489b5){if(_0x5489b5){_0x3c7e3b=_0x5489b5[_0xaa43('0x38')];if(!_0x32e86a[_0xaa43('0x32')]['hasOwnProperty'](_0xaa43('0x4d'))){_0x35751c[_0xaa43('0x1d')]=qs[_0xaa43('0x1d')](_0x32e86a[_0xaa43('0x32')][_0xaa43('0x1d')]);_0x35751c[_0xaa43('0x1f')]=qs[_0xaa43('0x1f')](_0x32e86a[_0xaa43('0x32')][_0xaa43('0x1f')]);}return _0x485eb0[_0xaa43('0x4f')](_0x35751c);}})[_0xaa43('0x25')](function(_0x47836d){if(_0x47836d){return _0x47836d?{'count':_0x3c7e3b,'rows':_0x47836d}:null;}})['then'](respondWithResult(_0x53726f,null))['catch'](handleError(_0x53726f,null));};exports['getFields']=function(_0x1a21fd,_0x50814a,_0x106a1e){var _0x115b6a={};var _0x3e6748={};var _0x42d55f;var _0x27eade;return db[_0xaa43('0x41')]['findOne']({'where':{'id':_0x1a21fd[_0xaa43('0x47')]['id']}})[_0xaa43('0x25')](handleEntityNotFound(_0x50814a,null))['then'](function(_0x1a2894){if(_0x1a2894){_0x42d55f=_0x1a2894;_0x3e6748[_0xaa43('0x31')]=_[_0xaa43('0x33')](db[_0xaa43('0x4c')][_0xaa43('0x2d')]);_0x3e6748[_0xaa43('0x32')]=_['keys'](_0x1a21fd[_0xaa43('0x32')]);_0x3e6748[_0xaa43('0x34')]=_[_0xaa43('0x35')](_0x3e6748[_0xaa43('0x31')],_0x3e6748[_0xaa43('0x32')]);_0x115b6a[_0xaa43('0x37')]=_[_0xaa43('0x35')](_0x3e6748[_0xaa43('0x31')],qs[_0xaa43('0x36')](_0x1a21fd[_0xaa43('0x32')]['fields']));_0x115b6a['attributes']=_0x115b6a['attributes']['length']?_0x115b6a[_0xaa43('0x37')]:_0x3e6748[_0xaa43('0x31')];_0x115b6a['order']=qs['sort'](_0x1a21fd[_0xaa43('0x32')][_0xaa43('0x3b')]);_0x115b6a[_0xaa43('0x3c')]=qs[_0xaa43('0x34')](_[_0xaa43('0x50')](_0x1a21fd[_0xaa43('0x32')],_0x3e6748[_0xaa43('0x34')]));if(_0x1a21fd['query'][_0xaa43('0x3d')]){_0x115b6a[_0xaa43('0x3c')]=_[_0xaa43('0x3e')](_0x115b6a['where'],{'$or':_[_0xaa43('0x2c')](_0x115b6a['attributes'],function(_0x52280f){var _0x4025fa={};_0x4025fa[_0x52280f]={'$like':'%'+_0x1a21fd[_0xaa43('0x32')][_0xaa43('0x3d')]+'%'};return _0x4025fa;})});}_0x115b6a=_[_0xaa43('0x3e')]({},_0x115b6a,_0x1a21fd[_0xaa43('0x40')]);return _0x42d55f[_0xaa43('0x51')](_0x115b6a);}})[_0xaa43('0x25')](function(_0x428fc4){if(_0x428fc4){_0x27eade=_0x428fc4[_0xaa43('0x38')];if(!_0x1a21fd[_0xaa43('0x32')][_0xaa43('0x39')](_0xaa43('0x4d'))){_0x115b6a[_0xaa43('0x1d')]=qs[_0xaa43('0x1d')](_0x1a21fd[_0xaa43('0x32')][_0xaa43('0x1d')]);_0x115b6a['offset']=qs['offset'](_0x1a21fd[_0xaa43('0x32')][_0xaa43('0x1f')]);}return _0x42d55f[_0xaa43('0x51')](_0x115b6a);}})['then'](function(_0x471b7f){if(_0x471b7f){return _0x471b7f?{'count':_0x27eade,'rows':_0x471b7f}:null;}})[_0xaa43('0x25')](respondWithResult(_0x50814a,null))[_0xaa43('0x45')](handleError(_0x50814a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index ff2e1d0..2280df5 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 _0x3a3e=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3a3e,0x1c6));var _0xe3a3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x3a3e[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3a3('0x0'))(_0xe3a3('0x1'));var moment=require('moment');var BPromise=require(_0xe3a3('0x2'));var rp=require(_0xe3a3('0x3'));var fs=require('fs');var path=require(_0xe3a3('0x4'));var rimraf=require(_0xe3a3('0x5'));var config=require(_0xe3a3('0x6'));var attributes=require(_0xe3a3('0x7'));module['exports']=function(_0x5a8676,_0x22b4ed){return _0x5a8676[_0xe3a3('0x8')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x279c=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x279c,0x9c));var _0xc279=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x279c[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xc279('0x0'));var util=require('util');var logger=require(_0xc279('0x1'))('api');var moment=require(_0xc279('0x2'));var BPromise=require(_0xc279('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc279('0x4'));var rimraf=require(_0xc279('0x5'));var config=require(_0xc279('0x6'));var attributes=require(_0xc279('0x7'));module[_0xc279('0x8')]=function(_0x489a5d,_0x53d4b9){return _0x489a5d[_0xc279('0x9')](_0xc279('0xa'),attributes,{'tableName':_0xc279('0xb'),'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 58c0865..a245fd1 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 _0xfa35=['rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa35,0xe0));var _0x5fa3=function(_0x2dc2bf,_0x445916){_0x2dc2bf=_0x2dc2bf-0x0;var _0x5d1be8=_0xfa35[_0x2dc2bf];return _0x5d1be8;};'use strict';var _=require(_0x5fa3('0x0'));var util=require(_0x5fa3('0x1'));var moment=require(_0x5fa3('0x2'));var BPromise=require('bluebird');var rs=require(_0x5fa3('0x3'));var fs=require('fs');var Redis=require(_0x5fa3('0x4'));var db=require(_0x5fa3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5fa3('0x6'));var config=require(_0x5fa3('0x7'));var jayson=require(_0x5fa3('0x8'));var client=jayson[_0x5fa3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9f35e2,_0x3e18b3,_0x246fa5){return new BPromise(function(_0x6cf158,_0xe9d9ca){return client[_0x5fa3('0xa')](_0x9f35e2,_0x246fa5)[_0x5fa3('0xb')](function(_0x37537c){logger[_0x5fa3('0xc')](_0x5fa3('0xd'),_0x3e18b3,_0x5fa3('0xe'));logger[_0x5fa3('0xf')](_0x5fa3('0x10'),_0x3e18b3,_0x5fa3('0xe'),JSON[_0x5fa3('0x11')](_0x37537c));if(_0x37537c['error']){if(_0x37537c['error'][_0x5fa3('0x12')]===0x1f4){logger[_0x5fa3('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3e18b3,_0x37537c[_0x5fa3('0x13')][_0x5fa3('0x14')]);return _0xe9d9ca(_0x37537c[_0x5fa3('0x13')][_0x5fa3('0x14')]);}logger[_0x5fa3('0x13')](_0x5fa3('0xd'),_0x3e18b3,_0x37537c['error'][_0x5fa3('0x14')]);return _0x6cf158(_0x37537c[_0x5fa3('0x13')][_0x5fa3('0x14')]);}else{logger[_0x5fa3('0xc')](_0x5fa3('0xd'),_0x3e18b3,_0x5fa3('0xe'));_0x6cf158(_0x37537c[_0x5fa3('0x15')][_0x5fa3('0x14')]);}})[_0x5fa3('0x16')](function(_0x2c5ab8){logger[_0x5fa3('0x13')](_0x5fa3('0xd'),_0x3e18b3,_0x2c5ab8);_0xe9d9ca(_0x2c5ab8);});});} \ No newline at end of file +var _0x9e0c=['../../config/environment','jayson/promise','then','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','FreshsalesConfiguration,\x20%s,\x20%s','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2d9ed7,_0x37d3eb){var _0x40df14=function(_0x5b9a1f){while(--_0x5b9a1f){_0x2d9ed7['push'](_0x2d9ed7['shift']());}};_0x40df14(++_0x37d3eb);}(_0x9e0c,0x125));var _0xc9e0=function(_0xa08179,_0x389519){_0xa08179=_0xa08179-0x0;var _0x1e997d=_0x9e0c[_0xa08179];return _0x1e997d;};'use strict';var _=require(_0xc9e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc9e0('0x1'));var rs=require(_0xc9e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9e0('0x3'))['db'];var utils=require(_0xc9e0('0x4'));var logger=require(_0xc9e0('0x5'))(_0xc9e0('0x6'));var config=require(_0xc9e0('0x7'));var jayson=require(_0xc9e0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3c36,_0x20eaea,_0x179149){return new BPromise(function(_0x3e4845,_0x4cacfc){return client['request'](_0x5f3c36,_0x179149)[_0xc9e0('0x9')](function(_0x46c39b){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x20eaea,_0xc9e0('0xa'));logger[_0xc9e0('0xb')](_0xc9e0('0xc'),_0x20eaea,_0xc9e0('0xa'),JSON['stringify'](_0x46c39b));if(_0x46c39b['error']){if(_0x46c39b['error'][_0xc9e0('0xd')]===0x1f4){logger[_0xc9e0('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x20eaea,_0x46c39b[_0xc9e0('0xe')][_0xc9e0('0xf')]);return _0x4cacfc(_0x46c39b[_0xc9e0('0xe')][_0xc9e0('0xf')]);}logger[_0xc9e0('0xe')](_0xc9e0('0x10'),_0x20eaea,_0x46c39b[_0xc9e0('0xe')][_0xc9e0('0xf')]);return _0x3e4845(_0x46c39b[_0xc9e0('0xe')][_0xc9e0('0xf')]);}else{logger[_0xc9e0('0x11')](_0xc9e0('0x10'),_0x20eaea,_0xc9e0('0xa'));_0x3e4845(_0x46c39b[_0xc9e0('0x12')][_0xc9e0('0xf')]);}})[_0xc9e0('0x13')](function(_0x5c050c){logger['error'](_0xc9e0('0x10'),_0x20eaea,_0x5c050c);_0x4cacfc(_0x5c050c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index d2bfe42..3b20bc1 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 _0xf021=['get','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x327cef,_0x8b85a4){var _0x3c39f0=function(_0xf7115e){while(--_0xf7115e){_0x327cef['push'](_0x327cef['shift']());}};_0x3c39f0(++_0x8b85a4);}(_0xf021,0x18f));var _0x1f02=function(_0x57d209,_0x37dc1a){_0x57d209=_0x57d209-0x0;var _0x182ced=_0xf021[_0x57d209];return _0x182ced;};'use strict';var multer=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var path=require(_0x1f02('0x2'));var timeout=require(_0x1f02('0x3'));var express=require(_0x1f02('0x4'));var router=express['Router']();var fs_extra=require(_0x1f02('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1f02('0x6'));var config=require(_0x1f02('0x7'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x1f02('0x8')](),controller['index']);router[_0x1f02('0x9')](_0x1f02('0xa'),auth[_0x1f02('0x8')](),controller[_0x1f02('0xb')]);router[_0x1f02('0xc')]('/',auth['isAuthenticated'](),controller[_0x1f02('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1f02('0xe')]);router[_0x1f02('0xf')](_0x1f02('0xa'),auth[_0x1f02('0x8')](),controller[_0x1f02('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb18e=['destroy','path','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete'];(function(_0x463e1d,_0xf9cc5a){var _0x1d6ffb=function(_0x53762e){while(--_0x53762e){_0x463e1d['push'](_0x463e1d['shift']());}};_0x1d6ffb(++_0xf9cc5a);}(_0xb18e,0x181));var _0xeb18=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0xb18e[_0x4d2993];return _0x427374;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeb18('0x0'));var timeout=require('connect-timeout');var express=require(_0xeb18('0x1'));var router=express['Router']();var fs_extra=require(_0xeb18('0x2'));var auth=require(_0xeb18('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xeb18('0x4'));var controller=require(_0xeb18('0x5'));router[_0xeb18('0x6')]('/',auth[_0xeb18('0x7')](),controller[_0xeb18('0x8')]);router[_0xeb18('0x6')]('/:id',auth[_0xeb18('0x7')](),controller[_0xeb18('0x9')]);router['post']('/',auth[_0xeb18('0x7')](),controller[_0xeb18('0xa')]);router[_0xeb18('0xb')](_0xeb18('0xc'),auth[_0xeb18('0x7')](),controller[_0xeb18('0xd')]);router[_0xeb18('0xe')](_0xeb18('0xc'),auth[_0xeb18('0x7')](),controller[_0xeb18('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 364dd56..13673b1 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 _0x02ed=['STRING','customVariable','BOOLEAN','ENUM','string','variable','keyValue'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x02ed,0xdc));var _0xd02e=function(_0x1aaf9b,_0x1ab98a){_0x1aaf9b=_0x1aaf9b-0x0;var _0x4fd9a3=_0x02ed[_0x1aaf9b];return _0x4fd9a3;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xd02e('0x0')](_0xd02e('0x1'),_0xd02e('0x2'),'customVariable',_0xd02e('0x3'),'picklist'),'defaultValue':_0xd02e('0x1')},'content':{'type':Sequelize[_0xd02e('0x4')]},'key':{'type':Sequelize[_0xd02e('0x4')]},'keyType':{'type':Sequelize['ENUM']('string',_0xd02e('0x2'),_0xd02e('0x5'))},'keyContent':{'type':Sequelize[_0xd02e('0x4')]},'idField':{'type':Sequelize[_0xd02e('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd02e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x53e7=['sequelize','ENUM','picklist','string','variable','customVariable','STRING','BOOLEAN'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x53e7,0x1b0));var _0x753e=function(_0x1ca907,_0x318ca2){_0x1ca907=_0x1ca907-0x0;var _0x4eb2c1=_0x53e7[_0x1ca907];return _0x4eb2c1;};'use strict';var Sequelize=require(_0x753e('0x0'));module['exports']={'type':{'type':Sequelize[_0x753e('0x1')]('string','variable','customVariable','keyValue',_0x753e('0x2')),'defaultValue':_0x753e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x753e('0x1')](_0x753e('0x3'),_0x753e('0x4'),_0x753e('0x5'))},'keyContent':{'type':Sequelize[_0x753e('0x6')]},'idField':{'type':Sequelize[_0x753e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x753e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x753e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index bc95ca9..c386d6d 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 _0xce35=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache'];(function(_0x5de621,_0xc0ec1a){var _0x427121=function(_0x56bd88){while(--_0x56bd88){_0x5de621['push'](_0x5de621['shift']());}};_0x427121(++_0xc0ec1a);}(_0xce35,0x12e));var _0x5ce3=function(_0x5cb446,_0x40d0a7){_0x5cb446=_0x5cb446-0x0;var _0x4e4882=_0xce35[_0x5cb446];return _0x4e4882;};'use strict';var emlformat=require(_0x5ce3('0x0'));var rimraf=require(_0x5ce3('0x1'));var zipdir=require(_0x5ce3('0x2'));var jsonpatch=require(_0x5ce3('0x3'));var rp=require('request-promise');var moment=require(_0x5ce3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ce3('0x5'));var util=require(_0x5ce3('0x6'));var path=require(_0x5ce3('0x7'));var sox=require(_0x5ce3('0x8'));var csv=require(_0x5ce3('0x9'));var ejs=require(_0x5ce3('0xa'));var fs=require('fs');var fs_extra=require(_0x5ce3('0xb'));var _=require(_0x5ce3('0xc'));var squel=require(_0x5ce3('0xd'));var crypto=require(_0x5ce3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5ce3('0x9'));var querystring=require(_0x5ce3('0xf'));var Papa=require(_0x5ce3('0x10'));var Redis=require(_0x5ce3('0x11'));var authService=require(_0x5ce3('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ce3('0x13'));var logger=require(_0x5ce3('0x14'))(_0x5ce3('0x15'));var utils=require('../../config/utils');var config=require(_0x5ce3('0x16'));var licenseUtil=require(_0x5ce3('0x17'));var db=require(_0x5ce3('0x18'))['db'];function respondWithStatusCode(_0x598565,_0x3bcb13){_0x3bcb13=_0x3bcb13||0xcc;return function(_0x2ebfb1){if(_0x2ebfb1){return _0x598565['sendStatus'](_0x3bcb13);}return _0x598565[_0x5ce3('0x19')](_0x3bcb13)[_0x5ce3('0x1a')]();};}function respondWithResult(_0x38a29b,_0x89e2d7){_0x89e2d7=_0x89e2d7||0xc8;return function(_0x3917a0){if(_0x3917a0){return _0x38a29b[_0x5ce3('0x19')](_0x89e2d7)[_0x5ce3('0x1b')](_0x3917a0);}};}function respondWithFilteredResult(_0x4c4702,_0x3d09a7){return function(_0x14d331){if(_0x14d331){var _0x1483b6=typeof _0x3d09a7['offset']==='undefined'&&typeof _0x3d09a7[_0x5ce3('0x1c')]===_0x5ce3('0x1d');var _0xc4b148=_0x14d331[_0x5ce3('0x1e')];var _0x3c3d3c=_0x1483b6?0x0:_0x3d09a7[_0x5ce3('0x1f')];var _0x346147=_0x1483b6?_0x14d331[_0x5ce3('0x1e')]:_0x3d09a7[_0x5ce3('0x1f')]+_0x3d09a7[_0x5ce3('0x1c')];var _0x31ab2f;if(_0x346147>=_0xc4b148){_0x346147=_0xc4b148;_0x31ab2f=0xc8;}else{_0x31ab2f=0xce;}_0x4c4702[_0x5ce3('0x19')](_0x31ab2f);return _0x4c4702[_0x5ce3('0x20')]('Content-Range',_0x3c3d3c+'-'+_0x346147+'/'+_0xc4b148)[_0x5ce3('0x1b')](_0x14d331);}return null;};}function patchUpdates(_0x17e05f){return function(_0x29bb70){try{jsonpatch[_0x5ce3('0x21')](_0x29bb70,_0x17e05f,!![]);}catch(_0x2bc04f){return BPromise[_0x5ce3('0x22')](_0x2bc04f);}return _0x29bb70[_0x5ce3('0x23')]();};}function saveUpdates(_0x136c28,_0x165483){return function(_0x430178){if(_0x430178){return _0x430178[_0x5ce3('0x24')](_0x136c28)[_0x5ce3('0x25')](function(_0x89b355){return _0x89b355;});}return null;};}function removeEntity(_0x298a23,_0x1a3053){return function(_0x16656f){if(_0x16656f){return _0x16656f[_0x5ce3('0x26')]()[_0x5ce3('0x25')](function(){_0x298a23[_0x5ce3('0x19')](0xcc)[_0x5ce3('0x1a')]();});}};}function handleEntityNotFound(_0x13fac1,_0x77cc94){return function(_0x26126e){if(!_0x26126e){_0x13fac1[_0x5ce3('0x27')](0x194);}return _0x26126e;};}function handleError(_0x498434,_0x5351b1){_0x5351b1=_0x5351b1||0x1f4;return function(_0x38c73e){logger[_0x5ce3('0x28')](_0x38c73e[_0x5ce3('0x29')]);if(_0x38c73e[_0x5ce3('0x2a')]){delete _0x38c73e[_0x5ce3('0x2a')];}_0x498434[_0x5ce3('0x19')](_0x5351b1)[_0x5ce3('0x2b')](_0x38c73e);};}exports[_0x5ce3('0x2c')]=function(_0x3cad37,_0x21e400){var _0x373650={},_0x4c3daf={},_0x5adca0={'count':0x0,'rows':[]};var _0xce84a2=_[_0x5ce3('0x2d')](db[_0x5ce3('0x2e')][_0x5ce3('0x2f')],function(_0x187f1b){return{'name':_0x187f1b[_0x5ce3('0x30')],'type':_0x187f1b[_0x5ce3('0x31')]['key']};});_0x4c3daf['model']=_['map'](_0xce84a2,_0x5ce3('0x2a'));_0x4c3daf['query']=_[_0x5ce3('0x32')](_0x3cad37[_0x5ce3('0x33')]);_0x4c3daf[_0x5ce3('0x34')]=_[_0x5ce3('0x35')](_0x4c3daf[_0x5ce3('0x36')],_0x4c3daf[_0x5ce3('0x33')]);_0x373650[_0x5ce3('0x37')]=_[_0x5ce3('0x35')](_0x4c3daf['model'],qs[_0x5ce3('0x38')](_0x3cad37[_0x5ce3('0x33')]['fields']));_0x373650['attributes']=_0x373650[_0x5ce3('0x37')][_0x5ce3('0x39')]?_0x373650[_0x5ce3('0x37')]:_0x4c3daf['model'];if(!_0x3cad37['query'][_0x5ce3('0x3a')](_0x5ce3('0x3b'))){_0x373650['limit']=qs['limit'](_0x3cad37[_0x5ce3('0x33')][_0x5ce3('0x1c')]);_0x373650[_0x5ce3('0x1f')]=qs[_0x5ce3('0x1f')](_0x3cad37[_0x5ce3('0x33')][_0x5ce3('0x1f')]);}_0x373650[_0x5ce3('0x3c')]=qs['sort'](_0x3cad37[_0x5ce3('0x33')][_0x5ce3('0x3d')]);_0x373650[_0x5ce3('0x3e')]=qs[_0x5ce3('0x34')](_[_0x5ce3('0x3f')](_0x3cad37[_0x5ce3('0x33')],_0x4c3daf['filters']),_0xce84a2);if(_0x3cad37[_0x5ce3('0x33')][_0x5ce3('0x40')]){_0x373650[_0x5ce3('0x3e')]=_['merge'](_0x373650[_0x5ce3('0x3e')],{'$or':_['map'](_0xce84a2,function(_0x1b62ad){if(_0x1b62ad[_0x5ce3('0x31')]!==_0x5ce3('0x41')){var _0x1d6694={};_0x1d6694[_0x1b62ad['name']]={'$like':'%'+_0x3cad37['query'][_0x5ce3('0x40')]+'%'};return _0x1d6694;}})});}_0x373650=_[_0x5ce3('0x42')]({},_0x373650,_0x3cad37[_0x5ce3('0x43')]);var _0x4c2b05={'where':_0x373650[_0x5ce3('0x3e')]};return db[_0x5ce3('0x2e')][_0x5ce3('0x1e')](_0x4c2b05)['then'](function(_0x46b58d){_0x5adca0[_0x5ce3('0x1e')]=_0x46b58d;if(_0x3cad37[_0x5ce3('0x33')][_0x5ce3('0x44')]){_0x373650[_0x5ce3('0x45')]=[{'all':!![]}];}return db[_0x5ce3('0x2e')][_0x5ce3('0x46')](_0x373650);})[_0x5ce3('0x25')](function(_0xdc35a8){_0x5adca0[_0x5ce3('0x47')]=_0xdc35a8;return _0x5adca0;})[_0x5ce3('0x25')](respondWithFilteredResult(_0x21e400,_0x373650))[_0x5ce3('0x48')](handleError(_0x21e400,null));};exports['show']=function(_0x13e4a8,_0x4241a0){var _0x267d5f={'raw':!![],'where':{'id':_0x13e4a8[_0x5ce3('0x49')]['id']}},_0x2d3f9a={};_0x2d3f9a[_0x5ce3('0x36')]=_[_0x5ce3('0x32')](db['FreshsalesField'][_0x5ce3('0x2f')]);_0x2d3f9a[_0x5ce3('0x33')]=_[_0x5ce3('0x32')](_0x13e4a8['query']);_0x2d3f9a[_0x5ce3('0x34')]=_[_0x5ce3('0x35')](_0x2d3f9a[_0x5ce3('0x36')],_0x2d3f9a[_0x5ce3('0x33')]);_0x267d5f[_0x5ce3('0x37')]=_[_0x5ce3('0x35')](_0x2d3f9a[_0x5ce3('0x36')],qs[_0x5ce3('0x38')](_0x13e4a8['query'][_0x5ce3('0x38')]));_0x267d5f['attributes']=_0x267d5f['attributes']['length']?_0x267d5f[_0x5ce3('0x37')]:_0x2d3f9a[_0x5ce3('0x36')];if(_0x13e4a8[_0x5ce3('0x33')]['includeAll']){_0x267d5f[_0x5ce3('0x45')]=[{'all':!![]}];}_0x267d5f=_['merge']({},_0x267d5f,_0x13e4a8['options']);return db[_0x5ce3('0x2e')]['find'](_0x267d5f)['then'](handleEntityNotFound(_0x4241a0,null))[_0x5ce3('0x25')](respondWithResult(_0x4241a0,null))[_0x5ce3('0x48')](handleError(_0x4241a0,null));};exports[_0x5ce3('0x4a')]=function(_0x19653c,_0x2fee91){return db[_0x5ce3('0x2e')][_0x5ce3('0x4a')](_0x19653c[_0x5ce3('0x4b')],{})[_0x5ce3('0x25')](respondWithResult(_0x2fee91,0xc9))[_0x5ce3('0x48')](handleError(_0x2fee91,null));};exports[_0x5ce3('0x24')]=function(_0x559d79,_0x24b9e5){if(_0x559d79[_0x5ce3('0x4b')]['id']){delete _0x559d79['body']['id'];}return db[_0x5ce3('0x2e')][_0x5ce3('0x4c')]({'where':{'id':_0x559d79[_0x5ce3('0x49')]['id']}})[_0x5ce3('0x25')](handleEntityNotFound(_0x24b9e5,null))[_0x5ce3('0x25')](saveUpdates(_0x559d79[_0x5ce3('0x4b')],null))[_0x5ce3('0x25')](respondWithResult(_0x24b9e5,null))[_0x5ce3('0x48')](handleError(_0x24b9e5,null));};exports[_0x5ce3('0x26')]=function(_0x4a50ad,_0x21090f){return db[_0x5ce3('0x2e')][_0x5ce3('0x4c')]({'where':{'id':_0x4a50ad[_0x5ce3('0x49')]['id']}})[_0x5ce3('0x25')](handleEntityNotFound(_0x21090f,null))[_0x5ce3('0x25')](removeEntity(_0x21090f,null))[_0x5ce3('0x48')](handleError(_0x21090f,null));}; \ No newline at end of file +var _0xdc7e=['model','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','ejs','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesField','fieldName','type','key','query','keys','filters','intersection','attributes'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xdc7e,0xa6));var _0xedc7=function(_0x1c1770,_0x856270){_0x1c1770=_0x1c1770-0x0;var _0x46141a=_0xdc7e[_0x1c1770];return _0x46141a;};'use strict';var emlformat=require(_0xedc7('0x0'));var rimraf=require(_0xedc7('0x1'));var zipdir=require(_0xedc7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xedc7('0x3'));var BPromise=require(_0xedc7('0x4'));var Mustache=require('mustache');var util=require(_0xedc7('0x5'));var path=require(_0xedc7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xedc7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xedc7('0x8'));var querystring=require(_0xedc7('0x9'));var Papa=require(_0xedc7('0xa'));var Redis=require(_0xedc7('0xb'));var authService=require(_0xedc7('0xc'));var qs=require(_0xedc7('0xd'));var as=require(_0xedc7('0xe'));var hardwareService=require(_0xedc7('0xf'));var logger=require(_0xedc7('0x10'))('api');var utils=require(_0xedc7('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xedc7('0x12'));var db=require(_0xedc7('0x13'))['db'];function respondWithStatusCode(_0x460243,_0x26963e){_0x26963e=_0x26963e||0xcc;return function(_0x14ba83){if(_0x14ba83){return _0x460243[_0xedc7('0x14')](_0x26963e);}return _0x460243['status'](_0x26963e)[_0xedc7('0x15')]();};}function respondWithResult(_0x4f15ba,_0x551059){_0x551059=_0x551059||0xc8;return function(_0x5d7309){if(_0x5d7309){return _0x4f15ba['status'](_0x551059)[_0xedc7('0x16')](_0x5d7309);}};}function respondWithFilteredResult(_0x4ed594,_0xbdccb9){return function(_0x585a50){if(_0x585a50){var _0x26949c=typeof _0xbdccb9['offset']==='undefined'&&typeof _0xbdccb9[_0xedc7('0x17')]===_0xedc7('0x18');var _0x35c4d4=_0x585a50[_0xedc7('0x19')];var _0x178cd8=_0x26949c?0x0:_0xbdccb9[_0xedc7('0x1a')];var _0x1fcc49=_0x26949c?_0x585a50[_0xedc7('0x19')]:_0xbdccb9[_0xedc7('0x1a')]+_0xbdccb9['limit'];var _0x16e3f2;if(_0x1fcc49>=_0x35c4d4){_0x1fcc49=_0x35c4d4;_0x16e3f2=0xc8;}else{_0x16e3f2=0xce;}_0x4ed594[_0xedc7('0x1b')](_0x16e3f2);return _0x4ed594['set'](_0xedc7('0x1c'),_0x178cd8+'-'+_0x1fcc49+'/'+_0x35c4d4)[_0xedc7('0x16')](_0x585a50);}return null;};}function patchUpdates(_0x4875c8){return function(_0x35e402){try{jsonpatch[_0xedc7('0x1d')](_0x35e402,_0x4875c8,!![]);}catch(_0xc81d51){return BPromise[_0xedc7('0x1e')](_0xc81d51);}return _0x35e402[_0xedc7('0x1f')]();};}function saveUpdates(_0x4720ee,_0x559469){return function(_0x2a6f29){if(_0x2a6f29){return _0x2a6f29[_0xedc7('0x20')](_0x4720ee)['then'](function(_0x431952){return _0x431952;});}return null;};}function removeEntity(_0xea9154,_0x52756b){return function(_0x1f0d9c){if(_0x1f0d9c){return _0x1f0d9c[_0xedc7('0x21')]()[_0xedc7('0x22')](function(){_0xea9154['status'](0xcc)[_0xedc7('0x15')]();});}};}function handleEntityNotFound(_0x3642a0,_0x115f11){return function(_0x111489){if(!_0x111489){_0x3642a0['sendStatus'](0x194);}return _0x111489;};}function handleError(_0x2cc83f,_0x270741){_0x270741=_0x270741||0x1f4;return function(_0x2adeec){logger[_0xedc7('0x23')](_0x2adeec[_0xedc7('0x24')]);if(_0x2adeec[_0xedc7('0x25')]){delete _0x2adeec[_0xedc7('0x25')];}_0x2cc83f['status'](_0x270741)[_0xedc7('0x26')](_0x2adeec);};}exports[_0xedc7('0x27')]=function(_0x9a851c,_0x9c677e){var _0x4ecf9e={},_0xb761a9={},_0x47394a={'count':0x0,'rows':[]};var _0x5305d5=_[_0xedc7('0x28')](db[_0xedc7('0x29')]['rawAttributes'],function(_0xe7f857){return{'name':_0xe7f857[_0xedc7('0x2a')],'type':_0xe7f857[_0xedc7('0x2b')][_0xedc7('0x2c')]};});_0xb761a9['model']=_[_0xedc7('0x28')](_0x5305d5,'name');_0xb761a9[_0xedc7('0x2d')]=_[_0xedc7('0x2e')](_0x9a851c[_0xedc7('0x2d')]);_0xb761a9[_0xedc7('0x2f')]=_[_0xedc7('0x30')](_0xb761a9['model'],_0xb761a9[_0xedc7('0x2d')]);_0x4ecf9e[_0xedc7('0x31')]=_[_0xedc7('0x30')](_0xb761a9[_0xedc7('0x32')],qs[_0xedc7('0x33')](_0x9a851c['query']['fields']));_0x4ecf9e['attributes']=_0x4ecf9e[_0xedc7('0x31')][_0xedc7('0x34')]?_0x4ecf9e[_0xedc7('0x31')]:_0xb761a9[_0xedc7('0x32')];if(!_0x9a851c[_0xedc7('0x2d')][_0xedc7('0x35')]('nolimit')){_0x4ecf9e['limit']=qs[_0xedc7('0x17')](_0x9a851c[_0xedc7('0x2d')][_0xedc7('0x17')]);_0x4ecf9e[_0xedc7('0x1a')]=qs[_0xedc7('0x1a')](_0x9a851c[_0xedc7('0x2d')][_0xedc7('0x1a')]);}_0x4ecf9e[_0xedc7('0x36')]=qs[_0xedc7('0x37')](_0x9a851c[_0xedc7('0x2d')][_0xedc7('0x37')]);_0x4ecf9e[_0xedc7('0x38')]=qs[_0xedc7('0x2f')](_['pick'](_0x9a851c[_0xedc7('0x2d')],_0xb761a9[_0xedc7('0x2f')]),_0x5305d5);if(_0x9a851c[_0xedc7('0x2d')][_0xedc7('0x39')]){_0x4ecf9e['where']=_['merge'](_0x4ecf9e[_0xedc7('0x38')],{'$or':_['map'](_0x5305d5,function(_0x5d6ba1){if(_0x5d6ba1[_0xedc7('0x2b')]!==_0xedc7('0x3a')){var _0x55ae95={};_0x55ae95[_0x5d6ba1[_0xedc7('0x25')]]={'$like':'%'+_0x9a851c[_0xedc7('0x2d')]['filter']+'%'};return _0x55ae95;}})});}_0x4ecf9e=_[_0xedc7('0x3b')]({},_0x4ecf9e,_0x9a851c[_0xedc7('0x3c')]);var _0x198fae={'where':_0x4ecf9e[_0xedc7('0x38')]};return db[_0xedc7('0x29')][_0xedc7('0x19')](_0x198fae)[_0xedc7('0x22')](function(_0x4110d5){_0x47394a[_0xedc7('0x19')]=_0x4110d5;if(_0x9a851c[_0xedc7('0x2d')][_0xedc7('0x3d')]){_0x4ecf9e[_0xedc7('0x3e')]=[{'all':!![]}];}return db[_0xedc7('0x29')][_0xedc7('0x3f')](_0x4ecf9e);})['then'](function(_0x5dcbbe){_0x47394a[_0xedc7('0x40')]=_0x5dcbbe;return _0x47394a;})[_0xedc7('0x22')](respondWithFilteredResult(_0x9c677e,_0x4ecf9e))[_0xedc7('0x41')](handleError(_0x9c677e,null));};exports[_0xedc7('0x42')]=function(_0x7151ee,_0x577afb){var _0x9051a0={'raw':!![],'where':{'id':_0x7151ee[_0xedc7('0x43')]['id']}},_0x11fc50={};_0x11fc50[_0xedc7('0x32')]=_['keys'](db[_0xedc7('0x29')][_0xedc7('0x44')]);_0x11fc50[_0xedc7('0x2d')]=_[_0xedc7('0x2e')](_0x7151ee['query']);_0x11fc50[_0xedc7('0x2f')]=_[_0xedc7('0x30')](_0x11fc50[_0xedc7('0x32')],_0x11fc50[_0xedc7('0x2d')]);_0x9051a0['attributes']=_[_0xedc7('0x30')](_0x11fc50['model'],qs[_0xedc7('0x33')](_0x7151ee[_0xedc7('0x2d')][_0xedc7('0x33')]));_0x9051a0[_0xedc7('0x31')]=_0x9051a0['attributes']['length']?_0x9051a0[_0xedc7('0x31')]:_0x11fc50[_0xedc7('0x32')];if(_0x7151ee[_0xedc7('0x2d')][_0xedc7('0x3d')]){_0x9051a0[_0xedc7('0x3e')]=[{'all':!![]}];}_0x9051a0=_[_0xedc7('0x3b')]({},_0x9051a0,_0x7151ee[_0xedc7('0x3c')]);return db[_0xedc7('0x29')][_0xedc7('0x45')](_0x9051a0)[_0xedc7('0x22')](handleEntityNotFound(_0x577afb,null))[_0xedc7('0x22')](respondWithResult(_0x577afb,null))[_0xedc7('0x41')](handleError(_0x577afb,null));};exports['create']=function(_0x27031a,_0x2e3e5b){return db[_0xedc7('0x29')][_0xedc7('0x46')](_0x27031a[_0xedc7('0x47')],{})[_0xedc7('0x22')](respondWithResult(_0x2e3e5b,0xc9))[_0xedc7('0x41')](handleError(_0x2e3e5b,null));};exports[_0xedc7('0x20')]=function(_0x299b1e,_0xd371c2){if(_0x299b1e['body']['id']){delete _0x299b1e[_0xedc7('0x47')]['id'];}return db[_0xedc7('0x29')][_0xedc7('0x45')]({'where':{'id':_0x299b1e[_0xedc7('0x43')]['id']}})['then'](handleEntityNotFound(_0xd371c2,null))['then'](saveUpdates(_0x299b1e[_0xedc7('0x47')],null))[_0xedc7('0x22')](respondWithResult(_0xd371c2,null))['catch'](handleError(_0xd371c2,null));};exports[_0xedc7('0x21')]=function(_0x4ddd0c,_0x5236d5){return db[_0xedc7('0x29')][_0xedc7('0x45')]({'where':{'id':_0x4ddd0c['params']['id']}})['then'](handleEntityNotFound(_0x5236d5,null))[_0xedc7('0x22')](removeEntity(_0x5236d5,null))[_0xedc7('0x41')](handleError(_0x5236d5,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 0794f19..72cd768 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 _0xb982=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0xb982,0x15e));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b98('0x0'))(_0x2b98('0x1'));var moment=require(_0x2b98('0x2'));var BPromise=require(_0x2b98('0x3'));var rp=require(_0x2b98('0x4'));var fs=require('fs');var path=require(_0x2b98('0x5'));var rimraf=require(_0x2b98('0x6'));var config=require(_0x2b98('0x7'));var attributes=require(_0x2b98('0x8'));module[_0x2b98('0x9')]=function(_0x55f7b8,_0xe2657d){return _0x55f7b8[_0x2b98('0xa')](_0x2b98('0xb'),attributes,{'tableName':_0x2b98('0xc'),'paranoid':![],'indexes':[{'name':_0x2b98('0xd'),'fields':[_0x2b98('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba37=['idField','FieldId','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields'];(function(_0x36cda5,_0xacc7de){var _0x328c03=function(_0x143279){while(--_0x143279){_0x36cda5['push'](_0x36cda5['shift']());}};_0x328c03(++_0xacc7de);}(_0xba37,0xb6));var _0x7ba3=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xba37[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x7ba3('0x0'));var util=require('util');var logger=require(_0x7ba3('0x1'))('api');var moment=require(_0x7ba3('0x2'));var BPromise=require('bluebird');var rp=require(_0x7ba3('0x3'));var fs=require('fs');var path=require(_0x7ba3('0x4'));var rimraf=require(_0x7ba3('0x5'));var config=require(_0x7ba3('0x6'));var attributes=require(_0x7ba3('0x7'));module['exports']=function(_0x401c33,_0x47b38c){return _0x401c33['define'](_0x7ba3('0x8'),attributes,{'tableName':_0x7ba3('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x7ba3('0xa'),_0x7ba3('0xb')],'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 fad90cf..1c51b89 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 _0x0295=['client','http','then','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x454ef5,_0x45812b){var _0x35b643=function(_0x475c58){while(--_0x475c58){_0x454ef5['push'](_0x454ef5['shift']());}};_0x35b643(++_0x45812b);}(_0x0295,0x1f0));var _0x5029=function(_0xa3fa3,_0x328285){_0xa3fa3=_0xa3fa3-0x0;var _0x488dd4=_0x0295[_0xa3fa3];return _0x488dd4;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x34679f,_0x3a0213){var _0x28e85f=function(_0x1e3371){while(--_0x1e3371){_0x34679f['push'](_0x34679f['shift']());}};_0x28e85f(++_0x3a0213);}(_0x4c60,0xc1));var _0x04c6=function(_0x51b53e,_0xc0be22){_0x51b53e=_0x51b53e-0x0;var _0x577c96=_0x4c60[_0x51b53e];return _0x577c96;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index bae561a..9dac936 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2de9cd,_0x4d16e8){var _0x3d781a=function(_0x13237e){while(--_0x13237e){_0x2de9cd['push'](_0x2de9cd['shift']());}};_0x3d781a(++_0x4d16e8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x29cbcd,_0x54cba2){var _0x56bfda=function(_0x1d504c){while(--_0x1d504c){_0x29cbcd['push'](_0x29cbcd['shift']());}};_0x56bfda(++_0x54cba2);}(_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/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index c22f11f..b16d689 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 _0x958a=['integrationTab','newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0x958a,0x128));var _0xa958=function(_0x46bfb4,_0x2f087f){_0x46bfb4=_0x46bfb4-0x0;var _0xb17d82=_0x958a[_0x46bfb4];return _0xb17d82;};'use strict';var Sequelize=require(_0xa958('0x0'));module[_0xa958('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa958('0x2')]},'username':{'type':Sequelize[_0xa958('0x2')],'unique':_0xa958('0x3')},'remoteUri':{'type':Sequelize[_0xa958('0x2')]},'password':{'type':Sequelize[_0xa958('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xa958('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa958('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa958('0x4')](_0xa958('0x5'),_0xa958('0x6')),'defaultValue':_0xa958('0x5')}}; \ No newline at end of file +var _0x6af6=['STRING','integrationTab','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6af6,0x176));var _0x66af=function(_0x4600df,_0x3cc090){_0x4600df=_0x4600df-0x0;var _0x4aabfb=_0x6af6[_0x4600df];return _0x4aabfb;};'use strict';var Sequelize=require(_0x66af('0x0'));module[_0x66af('0x1')]={'name':{'type':Sequelize[_0x66af('0x2')]},'description':{'type':Sequelize[_0x66af('0x2')]},'username':{'type':Sequelize[_0x66af('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x66af('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x66af('0x2')]},'clientSecret':{'type':Sequelize[_0x66af('0x2')]},'securityToken':{'type':Sequelize[_0x66af('0x2')]},'serverUrl':{'type':Sequelize[_0x66af('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x66af('0x3'),'newTab'),'defaultValue':_0x66af('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 261a398..624f176 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 _0x32a1=['getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','error','stack','name','send','SalesforceAccount','rawAttributes','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','length','include','options','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','Subjects','getSubjects','channel','SalesforceField','Descriptions','remoteUri','clientId','clientSecret','username','securityToken','substring','lastIndexOf','login','concat','ticketType','sobject','describe','IsReminderSet','Description','int','picklist','boolean','textarea','remove','includes','custom','picklistValues','label','value','True','true','False','false','test','statusCode'];(function(_0x34a788,_0x4a1f17){var _0x2a02ef=function(_0x2b134b){while(--_0x2b134b){_0x34a788['push'](_0x34a788['shift']());}};_0x2a02ef(++_0x4a1f17);}(_0x32a1,0x7b));var _0x132a=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x32a1[_0x135904];return _0x1ce7d5;};'use strict';var emlformat=require(_0x132a('0x0'));var rimraf=require(_0x132a('0x1'));var zipdir=require(_0x132a('0x2'));var jsonpatch=require(_0x132a('0x3'));var rp=require(_0x132a('0x4'));var moment=require(_0x132a('0x5'));var BPromise=require(_0x132a('0x6'));var Mustache=require('mustache');var util=require(_0x132a('0x7'));var path=require('path');var sox=require(_0x132a('0x8'));var csv=require(_0x132a('0x9'));var ejs=require(_0x132a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x132a('0xb'));var crypto=require(_0x132a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x132a('0xd'));var toCsv=require(_0x132a('0x9'));var querystring=require(_0x132a('0xe'));var Papa=require(_0x132a('0xf'));var Redis=require(_0x132a('0x10'));var authService=require(_0x132a('0x11'));var qs=require(_0x132a('0x12'));var as=require(_0x132a('0x13'));var hardwareService=require(_0x132a('0x14'));var logger=require(_0x132a('0x15'))(_0x132a('0x16'));var utils=require(_0x132a('0x17'));var config=require(_0x132a('0x18'));var licenseUtil=require(_0x132a('0x19'));var db=require(_0x132a('0x1a'))['db'];var integrations=require(_0x132a('0x1b'));function respondWithStatusCode(_0x43ef49,_0x49184f){_0x49184f=_0x49184f||0xcc;return function(_0x3aca1b){if(_0x3aca1b){return _0x43ef49[_0x132a('0x1c')](_0x49184f);}return _0x43ef49[_0x132a('0x1d')](_0x49184f)[_0x132a('0x1e')]();};}function respondWithResult(_0x45284b,_0x3db5fb){_0x3db5fb=_0x3db5fb||0xc8;return function(_0x4931e0){if(_0x4931e0){return _0x45284b['status'](_0x3db5fb)['json'](_0x4931e0);}};}function respondWithFilteredResult(_0x221249,_0xac777b){return function(_0x3a42c0){if(_0x3a42c0){var _0x4cfb9a=typeof _0xac777b[_0x132a('0x1f')]===_0x132a('0x20')&&typeof _0xac777b[_0x132a('0x21')]===_0x132a('0x20');var _0x18f34d=_0x3a42c0[_0x132a('0x22')];var _0x1d19ed=_0x4cfb9a?0x0:_0xac777b['offset'];var _0x1a728b=_0x4cfb9a?_0x3a42c0[_0x132a('0x22')]:_0xac777b[_0x132a('0x1f')]+_0xac777b[_0x132a('0x21')];var _0x35402f;if(_0x1a728b>=_0x18f34d){_0x1a728b=_0x18f34d;_0x35402f=0xc8;}else{_0x35402f=0xce;}_0x221249[_0x132a('0x1d')](_0x35402f);return _0x221249['set'](_0x132a('0x23'),_0x1d19ed+'-'+_0x1a728b+'/'+_0x18f34d)[_0x132a('0x24')](_0x3a42c0);}return null;};}function patchUpdates(_0x5d5e8d){return function(_0x458b3f){try{jsonpatch[_0x132a('0x25')](_0x458b3f,_0x5d5e8d,!![]);}catch(_0x2baa9f){return BPromise[_0x132a('0x26')](_0x2baa9f);}return _0x458b3f['save']();};}function saveUpdates(_0x260acc,_0x35afbb){return function(_0x36f9ed){if(_0x36f9ed){return _0x36f9ed[_0x132a('0x27')](_0x260acc)[_0x132a('0x28')](function(_0x177ace){return _0x177ace;});}return null;};}function removeEntity(_0x2a72b4,_0x10594a){return function(_0x3e013e){if(_0x3e013e){return _0x3e013e['destroy']()[_0x132a('0x28')](function(){_0x2a72b4['status'](0xcc)[_0x132a('0x1e')]();});}};}function handleEntityNotFound(_0x1265f1,_0x128ce0){return function(_0x4d5585){if(!_0x4d5585){_0x1265f1['sendStatus'](0x194);}return _0x4d5585;};}function handleError(_0x2a08b0,_0x35c059){_0x35c059=_0x35c059||0x1f4;return function(_0x4bdf44){logger[_0x132a('0x29')](_0x4bdf44[_0x132a('0x2a')]);if(_0x4bdf44['name']){delete _0x4bdf44[_0x132a('0x2b')];}_0x2a08b0['status'](_0x35c059)[_0x132a('0x2c')](_0x4bdf44);};}exports['index']=function(_0x3b4169,_0x207ef4){var _0x165605={},_0x3848e2={},_0x1ec8d4={'count':0x0,'rows':[]};var _0x2b6313=_['map'](db[_0x132a('0x2d')][_0x132a('0x2e')],function(_0x5f1c9d){return{'name':_0x5f1c9d['fieldName'],'type':_0x5f1c9d['type']['key']};});_0x3848e2[_0x132a('0x2f')]=_[_0x132a('0x30')](_0x2b6313,'name');_0x3848e2[_0x132a('0x31')]=_['keys'](_0x3b4169[_0x132a('0x31')]);_0x3848e2[_0x132a('0x32')]=_[_0x132a('0x33')](_0x3848e2[_0x132a('0x2f')],_0x3848e2[_0x132a('0x31')]);_0x165605[_0x132a('0x34')]=_['intersection'](_0x3848e2[_0x132a('0x2f')],qs['fields'](_0x3b4169[_0x132a('0x31')][_0x132a('0x35')]));_0x165605['attributes']=_0x165605[_0x132a('0x34')]['length']?_0x165605['attributes']:_0x3848e2[_0x132a('0x2f')];if(!_0x3b4169[_0x132a('0x31')][_0x132a('0x36')](_0x132a('0x37'))){_0x165605[_0x132a('0x21')]=qs[_0x132a('0x21')](_0x3b4169[_0x132a('0x31')]['limit']);_0x165605[_0x132a('0x1f')]=qs[_0x132a('0x1f')](_0x3b4169[_0x132a('0x31')][_0x132a('0x1f')]);}_0x165605[_0x132a('0x38')]=qs['sort'](_0x3b4169[_0x132a('0x31')][_0x132a('0x39')]);_0x165605[_0x132a('0x3a')]=qs[_0x132a('0x32')](_[_0x132a('0x3b')](_0x3b4169[_0x132a('0x31')],_0x3848e2[_0x132a('0x32')]),_0x2b6313);if(_0x3b4169[_0x132a('0x31')]['filter']){_0x165605[_0x132a('0x3a')]=_[_0x132a('0x3c')](_0x165605[_0x132a('0x3a')],{'$or':_[_0x132a('0x30')](_0x2b6313,function(_0x28b024){if(_0x28b024[_0x132a('0x3d')]!==_0x132a('0x3e')){var _0x4fc73b={};_0x4fc73b[_0x28b024[_0x132a('0x2b')]]={'$like':'%'+_0x3b4169['query'][_0x132a('0x3f')]+'%'};return _0x4fc73b;}})});}_0x165605=_[_0x132a('0x3c')]({},_0x165605,_0x3b4169['options']);var _0x191be7={'where':_0x165605[_0x132a('0x3a')]};return db[_0x132a('0x2d')][_0x132a('0x22')](_0x191be7)[_0x132a('0x28')](function(_0x505fb2){_0x1ec8d4[_0x132a('0x22')]=_0x505fb2;if(_0x3b4169[_0x132a('0x31')][_0x132a('0x40')]){_0x165605['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x132a('0x41')](_0x165605);})[_0x132a('0x28')](function(_0x5818cc){_0x1ec8d4[_0x132a('0x42')]=_0x5818cc;return _0x1ec8d4;})[_0x132a('0x28')](respondWithFilteredResult(_0x207ef4,_0x165605))[_0x132a('0x43')](handleError(_0x207ef4,null));};exports[_0x132a('0x44')]=function(_0xbbb1c8,_0x197b59){var _0x20ffa3={'raw':![],'where':{'id':_0xbbb1c8[_0x132a('0x45')]['id']}},_0xff81b5={};_0xff81b5[_0x132a('0x2f')]=_[_0x132a('0x46')](db[_0x132a('0x2d')][_0x132a('0x2e')]);_0xff81b5[_0x132a('0x31')]=_['keys'](_0xbbb1c8[_0x132a('0x31')]);_0xff81b5['filters']=_[_0x132a('0x33')](_0xff81b5['model'],_0xff81b5[_0x132a('0x31')]);_0x20ffa3[_0x132a('0x34')]=_[_0x132a('0x33')](_0xff81b5[_0x132a('0x2f')],qs[_0x132a('0x35')](_0xbbb1c8[_0x132a('0x31')][_0x132a('0x35')]));_0x20ffa3[_0x132a('0x34')]=_0x20ffa3[_0x132a('0x34')][_0x132a('0x47')]?_0x20ffa3['attributes']:_0xff81b5[_0x132a('0x2f')];if(_0xbbb1c8[_0x132a('0x31')][_0x132a('0x40')]){_0x20ffa3[_0x132a('0x48')]=[{'all':!![]}];}_0x20ffa3=_[_0x132a('0x3c')]({},_0x20ffa3,_0xbbb1c8[_0x132a('0x49')]);return db[_0x132a('0x2d')][_0x132a('0x4a')](_0x20ffa3)[_0x132a('0x28')](handleEntityNotFound(_0x197b59,null))[_0x132a('0x28')](respondWithResult(_0x197b59,null))[_0x132a('0x43')](handleError(_0x197b59,null));};exports[_0x132a('0x4b')]=function(_0x32d57f,_0x3088cd){return db[_0x132a('0x2d')][_0x132a('0x4b')](_0x32d57f[_0x132a('0x4c')],{})[_0x132a('0x28')](respondWithResult(_0x3088cd,0xc9))['catch'](handleError(_0x3088cd,null));};exports[_0x132a('0x27')]=function(_0x4db8d0,_0xab72c2){if(_0x4db8d0[_0x132a('0x4c')]['id']){delete _0x4db8d0[_0x132a('0x4c')]['id'];}return db[_0x132a('0x2d')]['find']({'where':{'id':_0x4db8d0[_0x132a('0x45')]['id']}})[_0x132a('0x28')](handleEntityNotFound(_0xab72c2,null))[_0x132a('0x28')](saveUpdates(_0x4db8d0['body'],null))['then'](respondWithResult(_0xab72c2,null))[_0x132a('0x43')](handleError(_0xab72c2,null));};exports[_0x132a('0x4d')]=function(_0x1aeacb,_0x492f10){return db['SalesforceAccount'][_0x132a('0x4a')]({'where':{'id':_0x1aeacb['params']['id']}})[_0x132a('0x28')](handleEntityNotFound(_0x492f10,null))[_0x132a('0x28')](removeEntity(_0x492f10,null))[_0x132a('0x43')](handleError(_0x492f10,null));};exports[_0x132a('0x4e')]=function(_0x3bc3df,_0x2579c5,_0xb9fa23){var _0x378790={};var _0x530d5f={};var _0x5d1fb8;var _0x3594c8;return db[_0x132a('0x2d')][_0x132a('0x4f')]({'where':{'id':_0x3bc3df[_0x132a('0x45')]['id']}})[_0x132a('0x28')](handleEntityNotFound(_0x2579c5,null))[_0x132a('0x28')](function(_0x750dc2){if(_0x750dc2){_0x5d1fb8=_0x750dc2;_0x530d5f['model']=_[_0x132a('0x46')](db[_0x132a('0x50')][_0x132a('0x2e')]);_0x530d5f[_0x132a('0x31')]=_[_0x132a('0x46')](_0x3bc3df[_0x132a('0x31')]);_0x530d5f[_0x132a('0x32')]=_['intersection'](_0x530d5f['model'],_0x530d5f[_0x132a('0x31')]);_0x378790['attributes']=_[_0x132a('0x33')](_0x530d5f['model'],qs[_0x132a('0x35')](_0x3bc3df[_0x132a('0x31')]['fields']));_0x378790[_0x132a('0x34')]=_0x378790[_0x132a('0x34')]['length']?_0x378790[_0x132a('0x34')]:_0x530d5f[_0x132a('0x2f')];_0x378790['order']=qs['sort'](_0x3bc3df['query']['sort']);_0x378790['where']=qs[_0x132a('0x32')](_['pick'](_0x3bc3df[_0x132a('0x31')],_0x530d5f[_0x132a('0x32')]));if(_0x3bc3df['query'][_0x132a('0x3f')]){_0x378790[_0x132a('0x3a')]=_[_0x132a('0x3c')](_0x378790[_0x132a('0x3a')],{'$or':_['map'](_0x378790[_0x132a('0x34')],function(_0x548628){var _0xb1bb7e={};_0xb1bb7e[_0x548628]={'$like':'%'+_0x3bc3df[_0x132a('0x31')][_0x132a('0x3f')]+'%'};return _0xb1bb7e;})});}_0x378790=_['merge']({},_0x378790,_0x3bc3df['options']);return _0x5d1fb8[_0x132a('0x4e')](_0x378790);}})[_0x132a('0x28')](function(_0x33b495){if(_0x33b495){_0x3594c8=_0x33b495[_0x132a('0x47')];if(!_0x3bc3df[_0x132a('0x31')]['hasOwnProperty'](_0x132a('0x37'))){_0x378790[_0x132a('0x21')]=qs[_0x132a('0x21')](_0x3bc3df['query'][_0x132a('0x21')]);_0x378790[_0x132a('0x1f')]=qs[_0x132a('0x1f')](_0x3bc3df[_0x132a('0x31')][_0x132a('0x1f')]);}return _0x5d1fb8[_0x132a('0x4e')](_0x378790);}})[_0x132a('0x28')](function(_0x4cdb7b){if(_0x4cdb7b){return _0x4cdb7b?{'count':_0x3594c8,'rows':_0x4cdb7b}:null;}})[_0x132a('0x28')](respondWithResult(_0x2579c5,null))[_0x132a('0x43')](handleError(_0x2579c5,null));};exports[_0x132a('0x51')]=function(_0x3c4511,_0x544b5a,_0x390431){if(_0x3c4511[_0x132a('0x4c')]['id']){delete _0x3c4511[_0x132a('0x4c')]['id'];}return db[_0x132a('0x2d')]['findOne']({'where':{'id':_0x3c4511[_0x132a('0x45')]['id']}})['then'](handleEntityNotFound(_0x544b5a,null))[_0x132a('0x28')](function(_0x266d7f){if(_0x266d7f){_0x3c4511['body']['AccountId']=_0x266d7f['id'];_0x3c4511['body'][_0x132a('0x52')]=integrations[_0x132a('0x53')](_0x3c4511['body'][_0x132a('0x54')],_0x3c4511[_0x132a('0x4c')]['type']);_0x3c4511['body']['Descriptions']=integrations['getDescriptions'](_0x3c4511[_0x132a('0x4c')][_0x132a('0x54')],_0x3c4511[_0x132a('0x4c')]['type']);return db[_0x132a('0x50')][_0x132a('0x4b')](_0x3c4511['body'],{'include':[{'model':db[_0x132a('0x55')],'as':_0x132a('0x52')},{'model':db[_0x132a('0x55')],'as':_0x132a('0x56')}]});}return null;})[_0x132a('0x28')](respondWithResult(_0x544b5a,null))[_0x132a('0x43')](handleError(_0x544b5a,null));};exports['getFields']=function(_0x292fd2,_0x536b7a,_0x121e18){var _0xcf3f9e;var _0x130314='';var _0x4dbd23='Task';return db[_0x132a('0x2d')][_0x132a('0x4f')]({'where':{'id':_0x292fd2[_0x132a('0x45')]['id']},'attributes':['id',_0x132a('0x57'),_0x132a('0x58'),_0x132a('0x59'),_0x132a('0x5a'),'password',_0x132a('0x5b')]})[_0x132a('0x28')](handleEntityNotFound(_0x536b7a,null))[_0x132a('0x28')](function(_0x12e066){if(_0x12e066){_0x130314=_0x12e066[_0x132a('0x57')];var _0x4a91ea=_0x130314['slice'](-0x1);if(_0x4a91ea==='/'){_0x130314=_0x130314[_0x132a('0x5c')](0x0,_0x130314[_0x132a('0x5d')](_0x4a91ea));}_0xcf3f9e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x130314,'clientId':_0x12e066[_0x132a('0x58')],'clientSecret':_0x12e066['clientSecret']}});return _0xcf3f9e[_0x132a('0x5e')](_0x12e066[_0x132a('0x5a')],_0x12e066['password'][_0x132a('0x5f')](_0x12e066['securityToken']));}})[_0x132a('0x28')](function(_0x5f29a9){if(_0x5f29a9){if(!_['isNil'](_0x292fd2[_0x132a('0x31')][_0x132a('0x60')])){_0x4dbd23=_0x292fd2['query']['ticketType'];}return _0xcf3f9e[_0x132a('0x61')](_0x4dbd23)[_0x132a('0x62')]();}})[_0x132a('0x28')](function(_0x53d927){var _0x1682bc=['OwnerId','ActivityDate',_0x132a('0x63'),'IsRecurrence','Subject',_0x132a('0x64')];var _0x1dfadc=['string',_0x132a('0x65'),_0x132a('0x66'),_0x132a('0x67'),'email',_0x132a('0x68'),'phone'];if(_0x53d927){_[_0x132a('0x69')](_0x53d927[_0x132a('0x35')],function(_0x8f0878){return _0x1682bc[_0x132a('0x6a')](_0x8f0878['name'])||!_0x1dfadc['includes'](_0x8f0878[_0x132a('0x3d')]);});return{'count':_0x53d927['fields']['length'],'rows':_[_0x132a('0x30')](_0x53d927['fields'],function(_0x340647){return{'id':_0x340647[_0x132a('0x2b')],'name':_0x340647['label'],'custom':_0x340647[_0x132a('0x6b')],'options':_0x340647['picklistValues'][_0x132a('0x47')]>0x0?_['map'](_0x340647[_0x132a('0x6c')],function(_0x1498d2){return{'name':_0x1498d2[_0x132a('0x6d')],'value':_0x1498d2[_0x132a('0x6e')]};}):_0x340647[_0x132a('0x3d')]==_0x132a('0x67')?[{'name':_0x132a('0x6f'),'value':_0x132a('0x70')},{'name':_0x132a('0x71'),'value':_0x132a('0x72')}]:[]};})};}})[_0x132a('0x28')](respondWithResult(_0x536b7a,null))[_0x132a('0x43')](function(_0x1f7a38){var _0xed430b=_0x292fd2[_0x132a('0x31')][_0x132a('0x73')]?0x1f4:_0x1f7a38[_0x132a('0x74')]||0x1f4;logger[_0x132a('0x29')](_0x132a('0x75'),_0x132a('0x76'),_0xed430b,JSON['stringify'](_0x1f7a38));delete _0x1f7a38[_0x132a('0x2b')];if(_0xed430b===0x191){_0xed430b=0x190;}_0x536b7a['status'](_0xed430b)[_0x132a('0x2c')](_0x292fd2[_0x132a('0x31')][_0x132a('0x73')]?{'message':_0x132a('0x77'),'statusCode':_0x1f7a38['statusCode']}:_0x1f7a38);});}; \ No newline at end of file +var _0xcab8=['bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','query','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','create','body','find','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','password','securityToken','slice','substring','lastIndexOf','Connection','login','username','concat','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','email','textarea','phone','includes','label','custom','picklistValues','value','boolean','True','true','false','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment'];(function(_0x1452d7,_0x1ee5bb){var _0x3cc972=function(_0x27977f){while(--_0x27977f){_0x1452d7['push'](_0x1452d7['shift']());}};_0x3cc972(++_0x1ee5bb);}(_0xcab8,0x16d));var _0x8cab=function(_0x6c7a95,_0x45dd54){_0x6c7a95=_0x6c7a95-0x0;var _0x23076b=_0xcab8[_0x6c7a95];return _0x23076b;};'use strict';var emlformat=require(_0x8cab('0x0'));var rimraf=require(_0x8cab('0x1'));var zipdir=require(_0x8cab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8cab('0x3'));var BPromise=require(_0x8cab('0x4'));var Mustache=require('mustache');var util=require(_0x8cab('0x5'));var path=require(_0x8cab('0x6'));var sox=require(_0x8cab('0x7'));var csv=require('to-csv');var ejs=require(_0x8cab('0x8'));var fs=require('fs');var fs_extra=require(_0x8cab('0x9'));var _=require(_0x8cab('0xa'));var squel=require(_0x8cab('0xb'));var crypto=require(_0x8cab('0xc'));var jsforce=require(_0x8cab('0xd'));var deskjs=require(_0x8cab('0xe'));var toCsv=require(_0x8cab('0xf'));var querystring=require(_0x8cab('0x10'));var Papa=require('papaparse');var Redis=require(_0x8cab('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8cab('0x12'));var as=require(_0x8cab('0x13'));var hardwareService=require(_0x8cab('0x14'));var logger=require(_0x8cab('0x15'))(_0x8cab('0x16'));var utils=require(_0x8cab('0x17'));var config=require(_0x8cab('0x18'));var licenseUtil=require(_0x8cab('0x19'));var db=require(_0x8cab('0x1a'))['db'];var integrations=require(_0x8cab('0x1b'));function respondWithStatusCode(_0x5396e8,_0xf40f22){_0xf40f22=_0xf40f22||0xcc;return function(_0x170f37){if(_0x170f37){return _0x5396e8['sendStatus'](_0xf40f22);}return _0x5396e8['status'](_0xf40f22)[_0x8cab('0x1c')]();};}function respondWithResult(_0x343b4f,_0x545da5){_0x545da5=_0x545da5||0xc8;return function(_0x238cb4){if(_0x238cb4){return _0x343b4f[_0x8cab('0x1d')](_0x545da5)[_0x8cab('0x1e')](_0x238cb4);}};}function respondWithFilteredResult(_0x31015d,_0x256791){return function(_0x590435){if(_0x590435){var _0x393762=typeof _0x256791['offset']===_0x8cab('0x1f')&&typeof _0x256791[_0x8cab('0x20')]==='undefined';var _0x3321c0=_0x590435[_0x8cab('0x21')];var _0x96e798=_0x393762?0x0:_0x256791['offset'];var _0x3b6fa1=_0x393762?_0x590435[_0x8cab('0x21')]:_0x256791['offset']+_0x256791[_0x8cab('0x20')];var _0x31bca4;if(_0x3b6fa1>=_0x3321c0){_0x3b6fa1=_0x3321c0;_0x31bca4=0xc8;}else{_0x31bca4=0xce;}_0x31015d[_0x8cab('0x1d')](_0x31bca4);return _0x31015d[_0x8cab('0x22')]('Content-Range',_0x96e798+'-'+_0x3b6fa1+'/'+_0x3321c0)['json'](_0x590435);}return null;};}function patchUpdates(_0x249d06){return function(_0x2077f8){try{jsonpatch[_0x8cab('0x23')](_0x2077f8,_0x249d06,!![]);}catch(_0x1ab6a4){return BPromise[_0x8cab('0x24')](_0x1ab6a4);}return _0x2077f8[_0x8cab('0x25')]();};}function saveUpdates(_0x52317b,_0x32bc38){return function(_0x8a4b32){if(_0x8a4b32){return _0x8a4b32[_0x8cab('0x26')](_0x52317b)[_0x8cab('0x27')](function(_0x27ce38){return _0x27ce38;});}return null;};}function removeEntity(_0x229b2b,_0x1ce5c0){return function(_0x63645a){if(_0x63645a){return _0x63645a[_0x8cab('0x28')]()[_0x8cab('0x27')](function(){_0x229b2b[_0x8cab('0x1d')](0xcc)[_0x8cab('0x1c')]();});}};}function handleEntityNotFound(_0x4ac14c,_0x37145c){return function(_0x2e9816){if(!_0x2e9816){_0x4ac14c['sendStatus'](0x194);}return _0x2e9816;};}function handleError(_0x2027a9,_0xd6a185){_0xd6a185=_0xd6a185||0x1f4;return function(_0x1eced6){logger['error'](_0x1eced6['stack']);if(_0x1eced6[_0x8cab('0x29')]){delete _0x1eced6[_0x8cab('0x29')];}_0x2027a9[_0x8cab('0x1d')](_0xd6a185)['send'](_0x1eced6);};}exports['index']=function(_0x16542d,_0x4451ad){var _0x59bfcb={},_0x3fb2ef={},_0x40c538={'count':0x0,'rows':[]};var _0x3665ff=_[_0x8cab('0x2a')](db[_0x8cab('0x2b')][_0x8cab('0x2c')],function(_0x303031){return{'name':_0x303031[_0x8cab('0x2d')],'type':_0x303031[_0x8cab('0x2e')][_0x8cab('0x2f')]};});_0x3fb2ef[_0x8cab('0x30')]=_['map'](_0x3665ff,_0x8cab('0x29'));_0x3fb2ef['query']=_[_0x8cab('0x31')](_0x16542d['query']);_0x3fb2ef[_0x8cab('0x32')]=_[_0x8cab('0x33')](_0x3fb2ef[_0x8cab('0x30')],_0x3fb2ef['query']);_0x59bfcb[_0x8cab('0x34')]=_['intersection'](_0x3fb2ef[_0x8cab('0x30')],qs['fields'](_0x16542d[_0x8cab('0x35')][_0x8cab('0x36')]));_0x59bfcb['attributes']=_0x59bfcb[_0x8cab('0x34')]['length']?_0x59bfcb[_0x8cab('0x34')]:_0x3fb2ef[_0x8cab('0x30')];if(!_0x16542d[_0x8cab('0x35')][_0x8cab('0x37')](_0x8cab('0x38'))){_0x59bfcb[_0x8cab('0x20')]=qs[_0x8cab('0x20')](_0x16542d[_0x8cab('0x35')]['limit']);_0x59bfcb['offset']=qs['offset'](_0x16542d[_0x8cab('0x35')][_0x8cab('0x39')]);}_0x59bfcb[_0x8cab('0x3a')]=qs[_0x8cab('0x3b')](_0x16542d['query']['sort']);_0x59bfcb[_0x8cab('0x3c')]=qs[_0x8cab('0x32')](_[_0x8cab('0x3d')](_0x16542d[_0x8cab('0x35')],_0x3fb2ef[_0x8cab('0x32')]),_0x3665ff);if(_0x16542d[_0x8cab('0x35')][_0x8cab('0x3e')]){_0x59bfcb[_0x8cab('0x3c')]=_[_0x8cab('0x3f')](_0x59bfcb[_0x8cab('0x3c')],{'$or':_[_0x8cab('0x2a')](_0x3665ff,function(_0x1da7f2){if(_0x1da7f2[_0x8cab('0x2e')]!==_0x8cab('0x40')){var _0x59295d={};_0x59295d[_0x1da7f2[_0x8cab('0x29')]]={'$like':'%'+_0x16542d[_0x8cab('0x35')]['filter']+'%'};return _0x59295d;}})});}_0x59bfcb=_['merge']({},_0x59bfcb,_0x16542d[_0x8cab('0x41')]);var _0x16f09a={'where':_0x59bfcb[_0x8cab('0x3c')]};return db[_0x8cab('0x2b')][_0x8cab('0x21')](_0x16f09a)['then'](function(_0x42c7e9){_0x40c538['count']=_0x42c7e9;if(_0x16542d[_0x8cab('0x35')]['includeAll']){_0x59bfcb[_0x8cab('0x42')]=[{'all':!![]}];}return db[_0x8cab('0x2b')]['findAll'](_0x59bfcb);})['then'](function(_0x53ef39){_0x40c538[_0x8cab('0x43')]=_0x53ef39;return _0x40c538;})['then'](respondWithFilteredResult(_0x4451ad,_0x59bfcb))[_0x8cab('0x44')](handleError(_0x4451ad,null));};exports[_0x8cab('0x45')]=function(_0x16a126,_0x41678a){var _0x402c56={'raw':![],'where':{'id':_0x16a126[_0x8cab('0x46')]['id']}},_0xa6f7c3={};_0xa6f7c3[_0x8cab('0x30')]=_[_0x8cab('0x31')](db['SalesforceAccount'][_0x8cab('0x2c')]);_0xa6f7c3[_0x8cab('0x35')]=_[_0x8cab('0x31')](_0x16a126[_0x8cab('0x35')]);_0xa6f7c3[_0x8cab('0x32')]=_[_0x8cab('0x33')](_0xa6f7c3[_0x8cab('0x30')],_0xa6f7c3['query']);_0x402c56[_0x8cab('0x34')]=_[_0x8cab('0x33')](_0xa6f7c3[_0x8cab('0x30')],qs[_0x8cab('0x36')](_0x16a126[_0x8cab('0x35')][_0x8cab('0x36')]));_0x402c56[_0x8cab('0x34')]=_0x402c56[_0x8cab('0x34')][_0x8cab('0x47')]?_0x402c56[_0x8cab('0x34')]:_0xa6f7c3[_0x8cab('0x30')];if(_0x16a126[_0x8cab('0x35')][_0x8cab('0x48')]){_0x402c56[_0x8cab('0x42')]=[{'all':!![]}];}_0x402c56=_['merge']({},_0x402c56,_0x16a126[_0x8cab('0x41')]);return db[_0x8cab('0x2b')]['find'](_0x402c56)[_0x8cab('0x27')](handleEntityNotFound(_0x41678a,null))[_0x8cab('0x27')](respondWithResult(_0x41678a,null))[_0x8cab('0x44')](handleError(_0x41678a,null));};exports[_0x8cab('0x49')]=function(_0x552266,_0x3f62ea){return db[_0x8cab('0x2b')]['create'](_0x552266[_0x8cab('0x4a')],{})[_0x8cab('0x27')](respondWithResult(_0x3f62ea,0xc9))['catch'](handleError(_0x3f62ea,null));};exports[_0x8cab('0x26')]=function(_0x47a03e,_0x16d639){if(_0x47a03e[_0x8cab('0x4a')]['id']){delete _0x47a03e[_0x8cab('0x4a')]['id'];}return db['SalesforceAccount'][_0x8cab('0x4b')]({'where':{'id':_0x47a03e[_0x8cab('0x46')]['id']}})[_0x8cab('0x27')](handleEntityNotFound(_0x16d639,null))[_0x8cab('0x27')](saveUpdates(_0x47a03e[_0x8cab('0x4a')],null))[_0x8cab('0x27')](respondWithResult(_0x16d639,null))['catch'](handleError(_0x16d639,null));};exports[_0x8cab('0x28')]=function(_0x427017,_0x3ae5f6){return db[_0x8cab('0x2b')][_0x8cab('0x4b')]({'where':{'id':_0x427017[_0x8cab('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ae5f6,null))['then'](removeEntity(_0x3ae5f6,null))[_0x8cab('0x44')](handleError(_0x3ae5f6,null));};exports[_0x8cab('0x4c')]=function(_0x41d0d4,_0x2479f6,_0x261ab9){var _0x41ba02={};var _0x4b175c={};var _0x107153;var _0x6f7614;return db['SalesforceAccount'][_0x8cab('0x4d')]({'where':{'id':_0x41d0d4[_0x8cab('0x46')]['id']}})['then'](handleEntityNotFound(_0x2479f6,null))[_0x8cab('0x27')](function(_0x5d36ab){if(_0x5d36ab){_0x107153=_0x5d36ab;_0x4b175c[_0x8cab('0x30')]=_['keys'](db['SalesforceConfiguration'][_0x8cab('0x2c')]);_0x4b175c[_0x8cab('0x35')]=_[_0x8cab('0x31')](_0x41d0d4[_0x8cab('0x35')]);_0x4b175c[_0x8cab('0x32')]=_['intersection'](_0x4b175c[_0x8cab('0x30')],_0x4b175c[_0x8cab('0x35')]);_0x41ba02[_0x8cab('0x34')]=_[_0x8cab('0x33')](_0x4b175c[_0x8cab('0x30')],qs[_0x8cab('0x36')](_0x41d0d4[_0x8cab('0x35')][_0x8cab('0x36')]));_0x41ba02[_0x8cab('0x34')]=_0x41ba02[_0x8cab('0x34')][_0x8cab('0x47')]?_0x41ba02['attributes']:_0x4b175c[_0x8cab('0x30')];_0x41ba02[_0x8cab('0x3a')]=qs[_0x8cab('0x3b')](_0x41d0d4['query'][_0x8cab('0x3b')]);_0x41ba02[_0x8cab('0x3c')]=qs[_0x8cab('0x32')](_[_0x8cab('0x3d')](_0x41d0d4[_0x8cab('0x35')],_0x4b175c['filters']));if(_0x41d0d4[_0x8cab('0x35')][_0x8cab('0x3e')]){_0x41ba02[_0x8cab('0x3c')]=_['merge'](_0x41ba02['where'],{'$or':_[_0x8cab('0x2a')](_0x41ba02[_0x8cab('0x34')],function(_0x482788){var _0x4a1f2e={};_0x4a1f2e[_0x482788]={'$like':'%'+_0x41d0d4[_0x8cab('0x35')][_0x8cab('0x3e')]+'%'};return _0x4a1f2e;})});}_0x41ba02=_[_0x8cab('0x3f')]({},_0x41ba02,_0x41d0d4[_0x8cab('0x41')]);return _0x107153['getConfigurations'](_0x41ba02);}})[_0x8cab('0x27')](function(_0x1ad0e7){if(_0x1ad0e7){_0x6f7614=_0x1ad0e7[_0x8cab('0x47')];if(!_0x41d0d4['query'][_0x8cab('0x37')]('nolimit')){_0x41ba02[_0x8cab('0x20')]=qs[_0x8cab('0x20')](_0x41d0d4[_0x8cab('0x35')][_0x8cab('0x20')]);_0x41ba02['offset']=qs[_0x8cab('0x39')](_0x41d0d4['query'][_0x8cab('0x39')]);}return _0x107153[_0x8cab('0x4c')](_0x41ba02);}})[_0x8cab('0x27')](function(_0x2a024e){if(_0x2a024e){return _0x2a024e?{'count':_0x6f7614,'rows':_0x2a024e}:null;}})['then'](respondWithResult(_0x2479f6,null))['catch'](handleError(_0x2479f6,null));};exports[_0x8cab('0x4e')]=function(_0x44c998,_0x14ce95,_0x3dfa62){if(_0x44c998[_0x8cab('0x4a')]['id']){delete _0x44c998[_0x8cab('0x4a')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x44c998[_0x8cab('0x46')]['id']}})['then'](handleEntityNotFound(_0x14ce95,null))['then'](function(_0x37282a){if(_0x37282a){_0x44c998[_0x8cab('0x4a')][_0x8cab('0x4f')]=_0x37282a['id'];_0x44c998[_0x8cab('0x4a')][_0x8cab('0x50')]=integrations['getSubjects'](_0x44c998[_0x8cab('0x4a')][_0x8cab('0x51')],_0x44c998[_0x8cab('0x4a')][_0x8cab('0x2e')]);_0x44c998['body']['Descriptions']=integrations[_0x8cab('0x52')](_0x44c998[_0x8cab('0x4a')][_0x8cab('0x51')],_0x44c998[_0x8cab('0x4a')][_0x8cab('0x2e')]);return db['SalesforceConfiguration']['create'](_0x44c998[_0x8cab('0x4a')],{'include':[{'model':db[_0x8cab('0x53')],'as':_0x8cab('0x50')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x14ce95,null))[_0x8cab('0x44')](handleError(_0x14ce95,null));};exports[_0x8cab('0x54')]=function(_0x54e0dc,_0x2ceba1,_0x29fa1a){var _0x2edebf;var _0x49801a='';var _0x4ef947='Task';return db['SalesforceAccount'][_0x8cab('0x4d')]({'where':{'id':_0x54e0dc['params']['id']},'attributes':['id',_0x8cab('0x55'),_0x8cab('0x56'),_0x8cab('0x57'),'username',_0x8cab('0x58'),_0x8cab('0x59')]})[_0x8cab('0x27')](handleEntityNotFound(_0x2ceba1,null))[_0x8cab('0x27')](function(_0x132d50){if(_0x132d50){_0x49801a=_0x132d50['remoteUri'];var _0x4c7458=_0x49801a[_0x8cab('0x5a')](-0x1);if(_0x4c7458==='/'){_0x49801a=_0x49801a[_0x8cab('0x5b')](0x0,_0x49801a[_0x8cab('0x5c')](_0x4c7458));}_0x2edebf=new jsforce[(_0x8cab('0x5d'))]({'oauth2':{'loginUrl':_0x49801a,'clientId':_0x132d50['clientId'],'clientSecret':_0x132d50[_0x8cab('0x57')]}});return _0x2edebf[_0x8cab('0x5e')](_0x132d50[_0x8cab('0x5f')],_0x132d50[_0x8cab('0x58')][_0x8cab('0x60')](_0x132d50[_0x8cab('0x59')]));}})[_0x8cab('0x27')](function(_0x3cc4b8){if(_0x3cc4b8){if(!_['isNil'](_0x54e0dc['query'][_0x8cab('0x61')])){_0x4ef947=_0x54e0dc[_0x8cab('0x35')][_0x8cab('0x61')];}return _0x2edebf[_0x8cab('0x62')](_0x4ef947)['describe']();}})[_0x8cab('0x27')](function(_0x1ea2a3){var _0x199551=[_0x8cab('0x63'),_0x8cab('0x64'),_0x8cab('0x65'),_0x8cab('0x66'),_0x8cab('0x67'),'Description'];var _0x5b42d4=[_0x8cab('0x68'),_0x8cab('0x69'),'picklist','boolean',_0x8cab('0x6a'),_0x8cab('0x6b'),_0x8cab('0x6c')];if(_0x1ea2a3){_['remove'](_0x1ea2a3[_0x8cab('0x36')],function(_0x53e266){return _0x199551[_0x8cab('0x6d')](_0x53e266[_0x8cab('0x29')])||!_0x5b42d4[_0x8cab('0x6d')](_0x53e266[_0x8cab('0x2e')]);});return{'count':_0x1ea2a3[_0x8cab('0x36')][_0x8cab('0x47')],'rows':_['map'](_0x1ea2a3[_0x8cab('0x36')],function(_0x341442){return{'id':_0x341442['name'],'name':_0x341442[_0x8cab('0x6e')],'custom':_0x341442[_0x8cab('0x6f')],'options':_0x341442['picklistValues'][_0x8cab('0x47')]>0x0?_[_0x8cab('0x2a')](_0x341442[_0x8cab('0x70')],function(_0x164934){return{'name':_0x164934[_0x8cab('0x6e')],'value':_0x164934[_0x8cab('0x71')]};}):_0x341442[_0x8cab('0x2e')]==_0x8cab('0x72')?[{'name':_0x8cab('0x73'),'value':_0x8cab('0x74')},{'name':'False','value':_0x8cab('0x75')}]:[]};})};}})[_0x8cab('0x27')](respondWithResult(_0x2ceba1,null))[_0x8cab('0x44')](function(_0x4762ec){var _0x4a8da1=_0x54e0dc[_0x8cab('0x35')][_0x8cab('0x76')]?0x1f4:_0x4762ec[_0x8cab('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x8cab('0x54'),_0x4a8da1,JSON[_0x8cab('0x78')](_0x4762ec));delete _0x4762ec['name'];if(_0x4a8da1===0x191){_0x4a8da1=0x190;}_0x2ceba1[_0x8cab('0x1d')](_0x4a8da1)[_0x8cab('0x79')](_0x54e0dc['query'][_0x8cab('0x76')]?{'message':_0x8cab('0x7a'),'statusCode':_0x4762ec['statusCode']}:_0x4762ec);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 61bee5f..529e95a 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 _0xd9ea=['api','moment','bluebird','request-promise','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util'];(function(_0x500e7e,_0x1f75fb){var _0x5b290e=function(_0x28604a){while(--_0x28604a){_0x500e7e['push'](_0x500e7e['shift']());}};_0x5b290e(++_0x1f75fb);}(_0xd9ea,0x1c6));var _0xad9e=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0xd9ea[_0x59eefb];return _0x1a49e8;};'use strict';var _=require(_0xad9e('0x0'));var util=require(_0xad9e('0x1'));var logger=require('../../config/logger')(_0xad9e('0x2'));var moment=require(_0xad9e('0x3'));var BPromise=require(_0xad9e('0x4'));var rp=require(_0xad9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad9e('0x6'));var attributes=require(_0xad9e('0x7'));var integrations=require(_0xad9e('0x8'));module['exports']=function(_0x1fff5c,_0x414ef7){return _0x1fff5c[_0xad9e('0x9')](_0xad9e('0xa'),attributes,{'tableName':_0xad9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf579=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x25e18b,_0x502e01){var _0xc0fd79=function(_0x315ac9){while(--_0x315ac9){_0x25e18b['push'](_0x25e18b['shift']());}};_0xc0fd79(++_0x502e01);}(_0xf579,0x1bc));var _0x9f57=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xf579[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0x9f57('0x0'));var logger=require(_0x9f57('0x1'))('api');var moment=require(_0x9f57('0x2'));var BPromise=require(_0x9f57('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f57('0x4'));var rimraf=require(_0x9f57('0x5'));var config=require(_0x9f57('0x6'));var attributes=require(_0x9f57('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x9f57('0x8')]=function(_0x4a8c49,_0x7f519d){return _0x4a8c49[_0x9f57('0x9')](_0x9f57('0xa'),attributes,{'tableName':_0x9f57('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 ba65b37..ba0226a 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 _0x6b95=['then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceAccount,\x20%s,\x20%s','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','limit','include','map','model','attributes','debug','find','ShowSalesforceAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x6b95,0x105));var _0x56b9=function(_0x4a85b5,_0x21b7e9){_0x4a85b5=_0x4a85b5-0x0;var _0x523168=_0x6b95[_0x4a85b5];return _0x523168;};'use strict';var _=require(_0x56b9('0x0'));var util=require(_0x56b9('0x1'));var moment=require(_0x56b9('0x2'));var BPromise=require(_0x56b9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56b9('0x4'));var db=require(_0x56b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x56b9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x56b9('0x7'));var client=jayson[_0x56b9('0x8')][_0x56b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fc198,_0x50f7f5,_0x355527){return new BPromise(function(_0x7c8e99,_0x820b68){return client[_0x56b9('0xa')](_0x1fc198,_0x355527)[_0x56b9('0xb')](function(_0x3bf4ec){logger[_0x56b9('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x50f7f5,_0x56b9('0xd'));logger['debug'](_0x56b9('0xe'),_0x50f7f5,'request\x20sent',JSON[_0x56b9('0xf')](_0x3bf4ec));if(_0x3bf4ec[_0x56b9('0x10')]){if(_0x3bf4ec[_0x56b9('0x10')][_0x56b9('0x11')]===0x1f4){logger[_0x56b9('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x50f7f5,_0x3bf4ec[_0x56b9('0x10')][_0x56b9('0x12')]);return _0x820b68(_0x3bf4ec[_0x56b9('0x10')]['message']);}logger[_0x56b9('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x50f7f5,_0x3bf4ec[_0x56b9('0x10')][_0x56b9('0x12')]);return _0x7c8e99(_0x3bf4ec['error'][_0x56b9('0x12')]);}else{logger[_0x56b9('0xc')](_0x56b9('0x13'),_0x50f7f5,_0x56b9('0xd'));_0x7c8e99(_0x3bf4ec['result'][_0x56b9('0x12')]);}})[_0x56b9('0x14')](function(_0x42365f){logger[_0x56b9('0x10')](_0x56b9('0x13'),_0x50f7f5,_0x42365f);_0x820b68(_0x42365f);});});}exports[_0x56b9('0x15')]=function(_0x13b097){var _0x3eb90a=this;return new Promise(function(_0x123535,_0x2e8972){return db[_0x56b9('0x16')]['findAll']({'raw':_0x13b097['options']?_0x13b097[_0x56b9('0x17')][_0x56b9('0x18')]===undefined?!![]:![]:!![],'where':_0x13b097[_0x56b9('0x17')]?_0x13b097['options'][_0x56b9('0x19')]||null:null,'attributes':_0x13b097[_0x56b9('0x17')]?_0x13b097[_0x56b9('0x17')]['attributes']||null:null,'limit':_0x13b097[_0x56b9('0x17')]?_0x13b097[_0x56b9('0x17')][_0x56b9('0x1a')]||null:null,'include':_0x13b097[_0x56b9('0x17')]?_0x13b097[_0x56b9('0x17')][_0x56b9('0x1b')]?_[_0x56b9('0x1c')](_0x13b097[_0x56b9('0x17')]['include'],function(_0x3ff87a){return{'model':db[_0x3ff87a[_0x56b9('0x1d')]],'as':_0x3ff87a['as'],'attributes':_0x3ff87a['attributes'],'include':_0x3ff87a[_0x56b9('0x1b')]?_[_0x56b9('0x1c')](_0x3ff87a[_0x56b9('0x1b')],function(_0x28049f){return{'model':db[_0x28049f['model']],'as':_0x28049f['as'],'attributes':_0x28049f['attributes'],'include':_0x28049f[_0x56b9('0x1b')]?_[_0x56b9('0x1c')](_0x28049f[_0x56b9('0x1b')],function(_0xf04bf3){return{'model':db[_0xf04bf3[_0x56b9('0x1d')]],'as':_0xf04bf3['as'],'attributes':_0xf04bf3[_0x56b9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x56b9('0xb')](function(_0x317e8c){logger['info']('GetSalesforceAccount',_0x13b097);logger[_0x56b9('0x1f')](_0x56b9('0x15'),_0x13b097,JSON['stringify'](_0x317e8c));_0x123535(_0x317e8c);})['catch'](function(_0x544d34){logger['error'](_0x56b9('0x15'),_0x544d34[_0x56b9('0x12')],_0x13b097);_0x2e8972(_0x3eb90a['error'](0x1f4,_0x544d34[_0x56b9('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x59163b){var _0x433310=this;return new Promise(function(_0x56e49e,_0x1c8425){return db[_0x56b9('0x16')][_0x56b9('0x20')]({'raw':_0x59163b[_0x56b9('0x17')]?_0x59163b[_0x56b9('0x17')][_0x56b9('0x18')]===undefined?!![]:![]:!![],'where':_0x59163b[_0x56b9('0x17')]?_0x59163b[_0x56b9('0x17')][_0x56b9('0x19')]||null:null,'attributes':_0x59163b[_0x56b9('0x17')]?_0x59163b[_0x56b9('0x17')][_0x56b9('0x1e')]||null:null,'include':_0x59163b[_0x56b9('0x17')]?_0x59163b[_0x56b9('0x17')][_0x56b9('0x1b')]?_[_0x56b9('0x1c')](_0x59163b['options'][_0x56b9('0x1b')],function(_0x3ea586){return{'model':db[_0x3ea586[_0x56b9('0x1d')]],'as':_0x3ea586['as'],'attributes':_0x3ea586['attributes'],'include':_0x3ea586[_0x56b9('0x1b')]?_[_0x56b9('0x1c')](_0x3ea586[_0x56b9('0x1b')],function(_0x307602){return{'model':db[_0x307602[_0x56b9('0x1d')]],'as':_0x307602['as'],'attributes':_0x307602['attributes'],'include':_0x307602[_0x56b9('0x1b')]?_['map'](_0x307602[_0x56b9('0x1b')],function(_0x496491){return{'model':db[_0x496491[_0x56b9('0x1d')]],'as':_0x496491['as'],'attributes':_0x496491[_0x56b9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x56b9('0xb')](function(_0x23e556){logger[_0x56b9('0xc')](_0x56b9('0x21'),_0x59163b);logger[_0x56b9('0x1f')](_0x56b9('0x21'),_0x59163b,JSON[_0x56b9('0xf')](_0x23e556));_0x56e49e(_0x23e556);})[_0x56b9('0x14')](function(_0x47b6de){logger[_0x56b9('0x10')](_0x56b9('0x21'),_0x47b6de[_0x56b9('0x12')],_0x59163b);_0x1c8425(_0x433310[_0x56b9('0x10')](0x1f4,_0x47b6de['message']));});});}; \ No newline at end of file +var _0xd94b=['attributes','map','catch','ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','include','model'];(function(_0x40001a,_0x57f2ae){var _0x4cec45=function(_0x5e4166){while(--_0x5e4166){_0x40001a['push'](_0x40001a['shift']());}};_0x4cec45(++_0x57f2ae);}(_0xd94b,0xbf));var _0xbd94=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xd94b[_0x261e29];return _0x25ef43;};'use strict';var _=require(_0xbd94('0x0'));var util=require(_0xbd94('0x1'));var moment=require(_0xbd94('0x2'));var BPromise=require(_0xbd94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd94('0x4'));var db=require(_0xbd94('0x5'))['db'];var utils=require(_0xbd94('0x6'));var logger=require(_0xbd94('0x7'))('rpc');var config=require(_0xbd94('0x8'));var jayson=require(_0xbd94('0x9'));var client=jayson[_0xbd94('0xa')][_0xbd94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31a79c,_0x289cb4,_0x2ef2f2){return new BPromise(function(_0x20635d,_0x4aa203){return client[_0xbd94('0xc')](_0x31a79c,_0x2ef2f2)[_0xbd94('0xd')](function(_0x4a525e){logger[_0xbd94('0xe')](_0xbd94('0xf'),_0x289cb4,_0xbd94('0x10'));logger[_0xbd94('0x11')](_0xbd94('0x12'),_0x289cb4,'request\x20sent',JSON[_0xbd94('0x13')](_0x4a525e));if(_0x4a525e[_0xbd94('0x14')]){if(_0x4a525e['error'][_0xbd94('0x15')]===0x1f4){logger[_0xbd94('0x14')](_0xbd94('0xf'),_0x289cb4,_0x4a525e[_0xbd94('0x14')][_0xbd94('0x16')]);return _0x4aa203(_0x4a525e[_0xbd94('0x14')][_0xbd94('0x16')]);}logger[_0xbd94('0x14')](_0xbd94('0xf'),_0x289cb4,_0x4a525e[_0xbd94('0x14')][_0xbd94('0x16')]);return _0x20635d(_0x4a525e[_0xbd94('0x14')][_0xbd94('0x16')]);}else{logger['info'](_0xbd94('0xf'),_0x289cb4,_0xbd94('0x10'));_0x20635d(_0x4a525e[_0xbd94('0x17')][_0xbd94('0x16')]);}})['catch'](function(_0xdb778e){logger[_0xbd94('0x14')](_0xbd94('0xf'),_0x289cb4,_0xdb778e);_0x4aa203(_0xdb778e);});});}exports[_0xbd94('0x18')]=function(_0x1a6d43){var _0xe525e1=this;return new Promise(function(_0x5c1c1a,_0x21f3e1){return db[_0xbd94('0x19')][_0xbd94('0x1a')]({'raw':_0x1a6d43[_0xbd94('0x1b')]?_0x1a6d43[_0xbd94('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1a6d43[_0xbd94('0x1b')]?_0x1a6d43['options'][_0xbd94('0x1c')]||null:null,'attributes':_0x1a6d43[_0xbd94('0x1b')]?_0x1a6d43[_0xbd94('0x1b')]['attributes']||null:null,'limit':_0x1a6d43[_0xbd94('0x1b')]?_0x1a6d43[_0xbd94('0x1b')]['limit']||null:null,'include':_0x1a6d43[_0xbd94('0x1b')]?_0x1a6d43[_0xbd94('0x1b')][_0xbd94('0x1d')]?_['map'](_0x1a6d43['options'][_0xbd94('0x1d')],function(_0x45447c){return{'model':db[_0x45447c[_0xbd94('0x1e')]],'as':_0x45447c['as'],'attributes':_0x45447c[_0xbd94('0x1f')],'include':_0x45447c[_0xbd94('0x1d')]?_['map'](_0x45447c[_0xbd94('0x1d')],function(_0x1388e9){return{'model':db[_0x1388e9[_0xbd94('0x1e')]],'as':_0x1388e9['as'],'attributes':_0x1388e9[_0xbd94('0x1f')],'include':_0x1388e9[_0xbd94('0x1d')]?_[_0xbd94('0x20')](_0x1388e9[_0xbd94('0x1d')],function(_0x4ec5eb){return{'model':db[_0x4ec5eb[_0xbd94('0x1e')]],'as':_0x4ec5eb['as'],'attributes':_0x4ec5eb[_0xbd94('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbd94('0xd')](function(_0x3ad5e6){logger[_0xbd94('0xe')](_0xbd94('0x18'),_0x1a6d43);logger[_0xbd94('0x11')](_0xbd94('0x18'),_0x1a6d43,JSON[_0xbd94('0x13')](_0x3ad5e6));_0x5c1c1a(_0x3ad5e6);})[_0xbd94('0x21')](function(_0x29a4ef){logger[_0xbd94('0x14')](_0xbd94('0x18'),_0x29a4ef[_0xbd94('0x16')],_0x1a6d43);_0x21f3e1(_0xe525e1[_0xbd94('0x14')](0x1f4,_0x29a4ef['message']));});});};exports[_0xbd94('0x22')]=function(_0x6693ee){var _0x3728ef=this;return new Promise(function(_0x125ca6,_0x16f842){return db[_0xbd94('0x19')][_0xbd94('0x23')]({'raw':_0x6693ee[_0xbd94('0x1b')]?_0x6693ee['options'][_0xbd94('0x24')]===undefined?!![]:![]:!![],'where':_0x6693ee['options']?_0x6693ee[_0xbd94('0x1b')]['where']||null:null,'attributes':_0x6693ee[_0xbd94('0x1b')]?_0x6693ee[_0xbd94('0x1b')][_0xbd94('0x1f')]||null:null,'include':_0x6693ee[_0xbd94('0x1b')]?_0x6693ee[_0xbd94('0x1b')][_0xbd94('0x1d')]?_['map'](_0x6693ee[_0xbd94('0x1b')][_0xbd94('0x1d')],function(_0x13b63f){return{'model':db[_0x13b63f[_0xbd94('0x1e')]],'as':_0x13b63f['as'],'attributes':_0x13b63f[_0xbd94('0x1f')],'include':_0x13b63f[_0xbd94('0x1d')]?_[_0xbd94('0x20')](_0x13b63f[_0xbd94('0x1d')],function(_0x3f80c8){return{'model':db[_0x3f80c8[_0xbd94('0x1e')]],'as':_0x3f80c8['as'],'attributes':_0x3f80c8[_0xbd94('0x1f')],'include':_0x3f80c8[_0xbd94('0x1d')]?_[_0xbd94('0x20')](_0x3f80c8[_0xbd94('0x1d')],function(_0x413959){return{'model':db[_0x413959[_0xbd94('0x1e')]],'as':_0x413959['as'],'attributes':_0x413959[_0xbd94('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbd94('0xd')](function(_0x3f7f64){logger[_0xbd94('0xe')](_0xbd94('0x22'),_0x6693ee);logger[_0xbd94('0x11')](_0xbd94('0x22'),_0x6693ee,JSON['stringify'](_0x3f7f64));_0x125ca6(_0x3f7f64);})[_0xbd94('0x21')](function(_0x464fec){logger['error']('ShowSalesforceAccount',_0x464fec[_0xbd94('0x16')],_0x6693ee);_0x16f842(_0x3728ef[_0xbd94('0x14')](0x1f4,_0x464fec[_0xbd94('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index a9c9b6b..abcdf9c 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xdb28,0x106));var _0x8db2=function(_0x3c34c7,_0x3785d3){_0x3c34c7=_0x3c34c7-0x0;var _0x54f4cc=_0xdb28[_0x3c34c7];return _0x54f4cc;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x3f8987,_0x4f35e4){var _0x3d2529=function(_0x2e044b){while(--_0x2e044b){_0x3f8987['push'](_0x3f8987['shift']());}};_0x3d2529(++_0x4f35e4);}(_0x7a54,0x106));var _0x47a5=function(_0x5c15d5,_0x3750c4){_0x5c15d5=_0x5c15d5-0x0;var _0x49434a=_0x7a54[_0x5c15d5];return _0x49434a;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index a3a50bb..d576a05 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 _0xb5d1=['STRING','Task','Case','ENUM','contact','lead','account_contact_lead','contact_lead','nothing','sequelize','exports'];(function(_0x4a1e96,_0x143e6b){var _0x5acea9=function(_0x1e1677){while(--_0x1e1677){_0x4a1e96['push'](_0x4a1e96['shift']());}};_0x5acea9(++_0x143e6b);}(_0xb5d1,0x1e2));var _0x1b5d=function(_0x133551,_0x2c0fa6){_0x133551=_0x133551-0x0;var _0x49f6ed=_0xb5d1[_0x133551];return _0x49f6ed;};'use strict';var Sequelize=require(_0x1b5d('0x0'));module[_0x1b5d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1b5d('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x1b5d('0x3'),_0x1b5d('0x4')),'defaultValue':_0x1b5d('0x3')},'moduleSearch':{'type':Sequelize[_0x1b5d('0x5')]('contact_lead',_0x1b5d('0x6'),_0x1b5d('0x7'),_0x1b5d('0x8'),'account'),'defaultValue':_0x1b5d('0x9')},'moduleCreate':{'type':Sequelize[_0x1b5d('0x5')](_0x1b5d('0xa'),'contact',_0x1b5d('0x7'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x1b5d('0x2')]}}; \ No newline at end of file +var _0xe3dc=['account','sequelize','exports','STRING','ENUM','Task','contact_lead','contact','lead'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0xe3dc,0x1e7));var _0xce3d=function(_0xcebd6,_0x101758){_0xcebd6=_0xcebd6-0x0;var _0xba0c09=_0xe3dc[_0xcebd6];return _0xba0c09;};'use strict';var Sequelize=require(_0xce3d('0x0'));module[_0xce3d('0x1')]={'name':{'type':Sequelize[_0xce3d('0x2')]},'description':{'type':Sequelize[_0xce3d('0x2')]},'ticketType':{'type':Sequelize[_0xce3d('0x3')](_0xce3d('0x4'),'Case'),'defaultValue':_0xce3d('0x4')},'moduleSearch':{'type':Sequelize[_0xce3d('0x3')](_0xce3d('0x5'),_0xce3d('0x6'),_0xce3d('0x7'),'account_contact_lead',_0xce3d('0x8')),'defaultValue':_0xce3d('0x5')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0xce3d('0x6'),_0xce3d('0x7'),_0xce3d('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xce3d('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xce3d('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xce3d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index fbe45c5..ef37bab 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 _0xec2f=['findAll','rows','catch','show','params','keys','find','create','body','destroy','getFields','findOne','SalesforceField','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','update','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x1ea170,_0x28d157){var _0x32487e=function(_0x5bebe9){while(--_0x5bebe9){_0x1ea170['push'](_0x1ea170['shift']());}};_0x32487e(++_0x28d157);}(_0xec2f,0xa8));var _0xfec2=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0xec2f[_0x2c534a];return _0x3f5c99;};'use strict';var emlformat=require(_0xfec2('0x0'));var rimraf=require(_0xfec2('0x1'));var zipdir=require(_0xfec2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfec2('0x3'));var moment=require(_0xfec2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfec2('0x5'));var path=require(_0xfec2('0x6'));var sox=require('sox');var csv=require(_0xfec2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfec2('0x8'));var _=require(_0xfec2('0x9'));var squel=require('squel');var crypto=require(_0xfec2('0xa'));var jsforce=require(_0xfec2('0xb'));var deskjs=require(_0xfec2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfec2('0xd'));var Papa=require(_0xfec2('0xe'));var Redis=require('ioredis');var authService=require(_0xfec2('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfec2('0x10'));var logger=require('../../config/logger')(_0xfec2('0x11'));var utils=require(_0xfec2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xfec2('0x13'));var db=require(_0xfec2('0x14'))['db'];function respondWithStatusCode(_0x37e075,_0x3e624f){_0x3e624f=_0x3e624f||0xcc;return function(_0x23a4c2){if(_0x23a4c2){return _0x37e075[_0xfec2('0x15')](_0x3e624f);}return _0x37e075[_0xfec2('0x16')](_0x3e624f)['end']();};}function respondWithResult(_0x256d8c,_0x390987){_0x390987=_0x390987||0xc8;return function(_0x55de70){if(_0x55de70){return _0x256d8c['status'](_0x390987)[_0xfec2('0x17')](_0x55de70);}};}function respondWithFilteredResult(_0x4f5ca4,_0x244286){return function(_0x34deab){if(_0x34deab){var _0x61a2f8=typeof _0x244286['offset']===_0xfec2('0x18')&&typeof _0x244286['limit']===_0xfec2('0x18');var _0x2eff45=_0x34deab[_0xfec2('0x19')];var _0x558865=_0x61a2f8?0x0:_0x244286['offset'];var _0x2aad79=_0x61a2f8?_0x34deab[_0xfec2('0x19')]:_0x244286[_0xfec2('0x1a')]+_0x244286[_0xfec2('0x1b')];var _0x1e0198;if(_0x2aad79>=_0x2eff45){_0x2aad79=_0x2eff45;_0x1e0198=0xc8;}else{_0x1e0198=0xce;}_0x4f5ca4[_0xfec2('0x16')](_0x1e0198);return _0x4f5ca4[_0xfec2('0x1c')]('Content-Range',_0x558865+'-'+_0x2aad79+'/'+_0x2eff45)[_0xfec2('0x17')](_0x34deab);}return null;};}function patchUpdates(_0x333160){return function(_0x1e96ed){try{jsonpatch[_0xfec2('0x1d')](_0x1e96ed,_0x333160,!![]);}catch(_0x3661fe){return BPromise[_0xfec2('0x1e')](_0x3661fe);}return _0x1e96ed['save']();};}function saveUpdates(_0x517cd0,_0x4e0a56){return function(_0x2268f6){if(_0x2268f6){return _0x2268f6[_0xfec2('0x1f')](_0x517cd0)[_0xfec2('0x20')](function(_0x5d38ba){return _0x5d38ba;});}return null;};}function removeEntity(_0x1e84f2,_0x270b15){return function(_0x2a3a73){if(_0x2a3a73){return _0x2a3a73['destroy']()[_0xfec2('0x20')](function(){_0x1e84f2[_0xfec2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8635b,_0x37b177){return function(_0x5dc8ea){if(!_0x5dc8ea){_0x8635b[_0xfec2('0x15')](0x194);}return _0x5dc8ea;};}function handleError(_0x319615,_0x5c846e){_0x5c846e=_0x5c846e||0x1f4;return function(_0x3e4547){logger[_0xfec2('0x21')](_0x3e4547[_0xfec2('0x22')]);if(_0x3e4547[_0xfec2('0x23')]){delete _0x3e4547['name'];}_0x319615[_0xfec2('0x16')](_0x5c846e)[_0xfec2('0x24')](_0x3e4547);};}exports[_0xfec2('0x25')]=function(_0x4f8cc2,_0x21c1a4){var _0x224773={},_0x498ce4={},_0x4f55c0={'count':0x0,'rows':[]};var _0x1a5c49=_[_0xfec2('0x26')](db[_0xfec2('0x27')][_0xfec2('0x28')],function(_0x23373f){return{'name':_0x23373f['fieldName'],'type':_0x23373f[_0xfec2('0x29')][_0xfec2('0x2a')]};});_0x498ce4[_0xfec2('0x2b')]=_[_0xfec2('0x26')](_0x1a5c49,_0xfec2('0x23'));_0x498ce4[_0xfec2('0x2c')]=_['keys'](_0x4f8cc2['query']);_0x498ce4[_0xfec2('0x2d')]=_[_0xfec2('0x2e')](_0x498ce4[_0xfec2('0x2b')],_0x498ce4[_0xfec2('0x2c')]);_0x224773['attributes']=_[_0xfec2('0x2e')](_0x498ce4['model'],qs[_0xfec2('0x2f')](_0x4f8cc2['query'][_0xfec2('0x2f')]));_0x224773['attributes']=_0x224773['attributes'][_0xfec2('0x30')]?_0x224773[_0xfec2('0x31')]:_0x498ce4[_0xfec2('0x2b')];if(!_0x4f8cc2['query'][_0xfec2('0x32')]('nolimit')){_0x224773['limit']=qs[_0xfec2('0x1b')](_0x4f8cc2[_0xfec2('0x2c')][_0xfec2('0x1b')]);_0x224773[_0xfec2('0x1a')]=qs[_0xfec2('0x1a')](_0x4f8cc2[_0xfec2('0x2c')][_0xfec2('0x1a')]);}_0x224773[_0xfec2('0x33')]=qs[_0xfec2('0x34')](_0x4f8cc2['query'][_0xfec2('0x34')]);_0x224773[_0xfec2('0x35')]=qs[_0xfec2('0x2d')](_[_0xfec2('0x36')](_0x4f8cc2['query'],_0x498ce4[_0xfec2('0x2d')]),_0x1a5c49);if(_0x4f8cc2[_0xfec2('0x2c')][_0xfec2('0x37')]){_0x224773[_0xfec2('0x35')]=_['merge'](_0x224773[_0xfec2('0x35')],{'$or':_[_0xfec2('0x26')](_0x1a5c49,function(_0x3e5887){if(_0x3e5887[_0xfec2('0x29')]!=='VIRTUAL'){var _0x57eaa3={};_0x57eaa3[_0x3e5887[_0xfec2('0x23')]]={'$like':'%'+_0x4f8cc2['query']['filter']+'%'};return _0x57eaa3;}})});}_0x224773=_[_0xfec2('0x38')]({},_0x224773,_0x4f8cc2[_0xfec2('0x39')]);var _0x194297={'where':_0x224773[_0xfec2('0x35')]};return db[_0xfec2('0x27')][_0xfec2('0x19')](_0x194297)[_0xfec2('0x20')](function(_0x362095){_0x4f55c0[_0xfec2('0x19')]=_0x362095;if(_0x4f8cc2['query'][_0xfec2('0x3a')]){_0x224773[_0xfec2('0x3b')]=[{'all':!![]}];}return db[_0xfec2('0x27')][_0xfec2('0x3c')](_0x224773);})[_0xfec2('0x20')](function(_0x2df0ec){_0x4f55c0[_0xfec2('0x3d')]=_0x2df0ec;return _0x4f55c0;})[_0xfec2('0x20')](respondWithFilteredResult(_0x21c1a4,_0x224773))[_0xfec2('0x3e')](handleError(_0x21c1a4,null));};exports[_0xfec2('0x3f')]=function(_0x57316f,_0x37d457){var _0x5be152={'raw':![],'where':{'id':_0x57316f[_0xfec2('0x40')]['id']}},_0x1d602d={};_0x1d602d[_0xfec2('0x2b')]=_[_0xfec2('0x41')](db[_0xfec2('0x27')][_0xfec2('0x28')]);_0x1d602d[_0xfec2('0x2c')]=_[_0xfec2('0x41')](_0x57316f[_0xfec2('0x2c')]);_0x1d602d[_0xfec2('0x2d')]=_[_0xfec2('0x2e')](_0x1d602d['model'],_0x1d602d['query']);_0x5be152[_0xfec2('0x31')]=_[_0xfec2('0x2e')](_0x1d602d[_0xfec2('0x2b')],qs[_0xfec2('0x2f')](_0x57316f[_0xfec2('0x2c')][_0xfec2('0x2f')]));_0x5be152[_0xfec2('0x31')]=_0x5be152[_0xfec2('0x31')]['length']?_0x5be152[_0xfec2('0x31')]:_0x1d602d[_0xfec2('0x2b')];if(_0x57316f[_0xfec2('0x2c')]['includeAll']){_0x5be152[_0xfec2('0x3b')]=[{'all':!![]}];}_0x5be152=_[_0xfec2('0x38')]({},_0x5be152,_0x57316f[_0xfec2('0x39')]);return db['SalesforceConfiguration'][_0xfec2('0x42')](_0x5be152)[_0xfec2('0x20')](handleEntityNotFound(_0x37d457,null))[_0xfec2('0x20')](respondWithResult(_0x37d457,null))[_0xfec2('0x3e')](handleError(_0x37d457,null));};exports[_0xfec2('0x43')]=function(_0x12c137,_0x88a45c){return db[_0xfec2('0x27')][_0xfec2('0x43')](_0x12c137['body'],{})['then'](respondWithResult(_0x88a45c,0xc9))[_0xfec2('0x3e')](handleError(_0x88a45c,null));};exports[_0xfec2('0x1f')]=function(_0x2bcc5d,_0x3d1f1d){if(_0x2bcc5d[_0xfec2('0x44')]['id']){delete _0x2bcc5d[_0xfec2('0x44')]['id'];}return db[_0xfec2('0x27')][_0xfec2('0x42')]({'where':{'id':_0x2bcc5d['params']['id']}})['then'](handleEntityNotFound(_0x3d1f1d,null))[_0xfec2('0x20')](saveUpdates(_0x2bcc5d[_0xfec2('0x44')],null))['then'](respondWithResult(_0x3d1f1d,null))['catch'](handleError(_0x3d1f1d,null));};exports[_0xfec2('0x45')]=function(_0x31c8bd,_0x5ae0f1){return db[_0xfec2('0x27')][_0xfec2('0x42')]({'where':{'id':_0x31c8bd[_0xfec2('0x40')]['id']}})[_0xfec2('0x20')](handleEntityNotFound(_0x5ae0f1,null))['then'](removeEntity(_0x5ae0f1,null))['catch'](handleError(_0x5ae0f1,null));};exports[_0xfec2('0x46')]=function(_0x2095bf,_0x529d36,_0x36af09){var _0x59dfe1={};var _0x52de80={};var _0x2066e0;var _0x93d7af;return db[_0xfec2('0x27')][_0xfec2('0x47')]({'where':{'id':_0x2095bf['params']['id']}})[_0xfec2('0x20')](handleEntityNotFound(_0x529d36,null))['then'](function(_0x2fa0f4){if(_0x2fa0f4){_0x2066e0=_0x2fa0f4;_0x52de80[_0xfec2('0x2b')]=_[_0xfec2('0x41')](db[_0xfec2('0x48')]['rawAttributes']);_0x52de80['query']=_['keys'](_0x2095bf[_0xfec2('0x2c')]);_0x52de80[_0xfec2('0x2d')]=_[_0xfec2('0x2e')](_0x52de80['model'],_0x52de80[_0xfec2('0x2c')]);_0x59dfe1[_0xfec2('0x31')]=_['intersection'](_0x52de80[_0xfec2('0x2b')],qs[_0xfec2('0x2f')](_0x2095bf[_0xfec2('0x2c')]['fields']));_0x59dfe1['attributes']=_0x59dfe1['attributes'][_0xfec2('0x30')]?_0x59dfe1['attributes']:_0x52de80[_0xfec2('0x2b')];_0x59dfe1[_0xfec2('0x33')]=qs['sort'](_0x2095bf[_0xfec2('0x2c')][_0xfec2('0x34')]);_0x59dfe1[_0xfec2('0x35')]=qs[_0xfec2('0x2d')](_['pick'](_0x2095bf[_0xfec2('0x2c')],_0x52de80[_0xfec2('0x2d')]));if(_0x2095bf[_0xfec2('0x2c')][_0xfec2('0x37')]){_0x59dfe1[_0xfec2('0x35')]=_[_0xfec2('0x38')](_0x59dfe1[_0xfec2('0x35')],{'$or':_[_0xfec2('0x26')](_0x59dfe1[_0xfec2('0x31')],function(_0x50c02b){var _0x5404cf={};_0x5404cf[_0x50c02b]={'$like':'%'+_0x2095bf[_0xfec2('0x2c')]['filter']+'%'};return _0x5404cf;})});}_0x59dfe1=_['merge']({},_0x59dfe1,_0x2095bf['options']);return _0x2066e0[_0xfec2('0x46')](_0x59dfe1);}})[_0xfec2('0x20')](function(_0x30d6b4){if(_0x30d6b4){_0x93d7af=_0x30d6b4[_0xfec2('0x30')];if(!_0x2095bf['query'][_0xfec2('0x32')]('nolimit')){_0x59dfe1['limit']=qs[_0xfec2('0x1b')](_0x2095bf[_0xfec2('0x2c')]['limit']);_0x59dfe1[_0xfec2('0x1a')]=qs[_0xfec2('0x1a')](_0x2095bf[_0xfec2('0x2c')]['offset']);}return _0x2066e0['getFields'](_0x59dfe1);}})['then'](function(_0x5e9147){if(_0x5e9147){return _0x5e9147?{'count':_0x93d7af,'rows':_0x5e9147}:null;}})[_0xfec2('0x20')](respondWithResult(_0x529d36,null))[_0xfec2('0x3e')](handleError(_0x529d36,null));};exports[_0xfec2('0x49')]=function(_0x174b44,_0x338315,_0x36a6ff){var _0x31c855={};var _0x365633={};var _0x4d27b7;var _0x5becc1;return db['SalesforceConfiguration'][_0xfec2('0x47')]({'where':{'id':_0x174b44[_0xfec2('0x40')]['id']}})[_0xfec2('0x20')](handleEntityNotFound(_0x338315,null))[_0xfec2('0x20')](function(_0x1905b8){if(_0x1905b8){_0x4d27b7=_0x1905b8;_0x365633[_0xfec2('0x2b')]=_[_0xfec2('0x41')](db[_0xfec2('0x48')]['rawAttributes']);_0x365633[_0xfec2('0x2c')]=_[_0xfec2('0x41')](_0x174b44[_0xfec2('0x2c')]);_0x365633[_0xfec2('0x2d')]=_[_0xfec2('0x2e')](_0x365633[_0xfec2('0x2b')],_0x365633['query']);_0x31c855[_0xfec2('0x31')]=_[_0xfec2('0x2e')](_0x365633[_0xfec2('0x2b')],qs['fields'](_0x174b44[_0xfec2('0x2c')][_0xfec2('0x2f')]));_0x31c855[_0xfec2('0x31')]=_0x31c855['attributes']['length']?_0x31c855[_0xfec2('0x31')]:_0x365633[_0xfec2('0x2b')];_0x31c855[_0xfec2('0x33')]=qs[_0xfec2('0x34')](_0x174b44[_0xfec2('0x2c')][_0xfec2('0x34')]);_0x31c855[_0xfec2('0x35')]=qs['filters'](_[_0xfec2('0x36')](_0x174b44['query'],_0x365633[_0xfec2('0x2d')]));if(_0x174b44[_0xfec2('0x2c')][_0xfec2('0x37')]){_0x31c855[_0xfec2('0x35')]=_[_0xfec2('0x38')](_0x31c855[_0xfec2('0x35')],{'$or':_[_0xfec2('0x26')](_0x31c855[_0xfec2('0x31')],function(_0x41ed3f){var _0x3781d0={};_0x3781d0[_0x41ed3f]={'$like':'%'+_0x174b44[_0xfec2('0x2c')][_0xfec2('0x37')]+'%'};return _0x3781d0;})});}_0x31c855=_[_0xfec2('0x38')]({},_0x31c855,_0x174b44[_0xfec2('0x39')]);return _0x4d27b7['getSubjects'](_0x31c855);}})[_0xfec2('0x20')](function(_0x15bbe2){if(_0x15bbe2){_0x5becc1=_0x15bbe2['length'];if(!_0x174b44[_0xfec2('0x2c')][_0xfec2('0x32')](_0xfec2('0x4a'))){_0x31c855[_0xfec2('0x1b')]=qs[_0xfec2('0x1b')](_0x174b44[_0xfec2('0x2c')][_0xfec2('0x1b')]);_0x31c855[_0xfec2('0x1a')]=qs[_0xfec2('0x1a')](_0x174b44[_0xfec2('0x2c')][_0xfec2('0x1a')]);}return _0x4d27b7[_0xfec2('0x49')](_0x31c855);}})['then'](function(_0x272366){if(_0x272366){return _0x272366?{'count':_0x5becc1,'rows':_0x272366}:null;}})[_0xfec2('0x20')](respondWithResult(_0x338315,null))[_0xfec2('0x3e')](handleError(_0x338315,null));};exports[_0xfec2('0x4b')]=function(_0x2fc013,_0x158231,_0x246c34){var _0x662ac6={};var _0x10485e={};var _0x703e71;var _0x616234;return db[_0xfec2('0x27')][_0xfec2('0x47')]({'where':{'id':_0x2fc013[_0xfec2('0x40')]['id']}})[_0xfec2('0x20')](handleEntityNotFound(_0x158231,null))[_0xfec2('0x20')](function(_0x2aceca){if(_0x2aceca){_0x703e71=_0x2aceca;_0x10485e['model']=_['keys'](db[_0xfec2('0x48')]['rawAttributes']);_0x10485e[_0xfec2('0x2c')]=_['keys'](_0x2fc013['query']);_0x10485e[_0xfec2('0x2d')]=_['intersection'](_0x10485e[_0xfec2('0x2b')],_0x10485e[_0xfec2('0x2c')]);_0x662ac6[_0xfec2('0x31')]=_['intersection'](_0x10485e[_0xfec2('0x2b')],qs['fields'](_0x2fc013['query'][_0xfec2('0x2f')]));_0x662ac6['attributes']=_0x662ac6[_0xfec2('0x31')][_0xfec2('0x30')]?_0x662ac6[_0xfec2('0x31')]:_0x10485e['model'];_0x662ac6['order']=qs['sort'](_0x2fc013[_0xfec2('0x2c')][_0xfec2('0x34')]);_0x662ac6['where']=qs[_0xfec2('0x2d')](_['pick'](_0x2fc013[_0xfec2('0x2c')],_0x10485e[_0xfec2('0x2d')]));if(_0x2fc013[_0xfec2('0x2c')][_0xfec2('0x37')]){_0x662ac6[_0xfec2('0x35')]=_[_0xfec2('0x38')](_0x662ac6[_0xfec2('0x35')],{'$or':_[_0xfec2('0x26')](_0x662ac6['attributes'],function(_0x32c0bd){var _0x30a579={};_0x30a579[_0x32c0bd]={'$like':'%'+_0x2fc013[_0xfec2('0x2c')][_0xfec2('0x37')]+'%'};return _0x30a579;})});}_0x662ac6=_['merge']({},_0x662ac6,_0x2fc013[_0xfec2('0x39')]);return _0x703e71[_0xfec2('0x4b')](_0x662ac6);}})[_0xfec2('0x20')](function(_0xaaa1a4){if(_0xaaa1a4){_0x616234=_0xaaa1a4[_0xfec2('0x30')];if(!_0x2fc013['query'][_0xfec2('0x32')]('nolimit')){_0x662ac6[_0xfec2('0x1b')]=qs[_0xfec2('0x1b')](_0x2fc013[_0xfec2('0x2c')][_0xfec2('0x1b')]);_0x662ac6[_0xfec2('0x1a')]=qs['offset'](_0x2fc013[_0xfec2('0x2c')][_0xfec2('0x1a')]);}return _0x703e71['getDescriptions'](_0x662ac6);}})[_0xfec2('0x20')](function(_0x1b0741){if(_0x1b0741){return _0x1b0741?{'count':_0x616234,'rows':_0x1b0741}:null;}})['then'](respondWithResult(_0x158231,null))[_0xfec2('0x3e')](handleError(_0x158231,null));}; \ No newline at end of file +var _0xb009=['offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','includeAll','include','find','create','body','params','destroy','getFields','findOne','getSubjects','SalesforceField','options','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count'];(function(_0x292e88,_0x4cf40d){var _0x149d3c=function(_0x1efab0){while(--_0x1efab0){_0x292e88['push'](_0x292e88['shift']());}};_0x149d3c(++_0x4cf40d);}(_0xb009,0xe0));var _0x9b00=function(_0x3291b8,_0x33b4d1){_0x3291b8=_0x3291b8-0x0;var _0x373e1e=_0xb009[_0x3291b8];return _0x373e1e;};'use strict';var emlformat=require(_0x9b00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b00('0x1'));var jsonpatch=require(_0x9b00('0x2'));var rp=require(_0x9b00('0x3'));var moment=require(_0x9b00('0x4'));var BPromise=require(_0x9b00('0x5'));var Mustache=require('mustache');var util=require(_0x9b00('0x6'));var path=require(_0x9b00('0x7'));var sox=require(_0x9b00('0x8'));var csv=require(_0x9b00('0x9'));var ejs=require(_0x9b00('0xa'));var fs=require('fs');var fs_extra=require(_0x9b00('0xb'));var _=require(_0x9b00('0xc'));var squel=require(_0x9b00('0xd'));var crypto=require(_0x9b00('0xe'));var jsforce=require(_0x9b00('0xf'));var deskjs=require(_0x9b00('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9b00('0x11'));var Papa=require(_0x9b00('0x12'));var Redis=require('ioredis');var authService=require(_0x9b00('0x13'));var qs=require(_0x9b00('0x14'));var as=require(_0x9b00('0x15'));var hardwareService=require(_0x9b00('0x16'));var logger=require(_0x9b00('0x17'))(_0x9b00('0x18'));var utils=require(_0x9b00('0x19'));var config=require(_0x9b00('0x1a'));var licenseUtil=require(_0x9b00('0x1b'));var db=require(_0x9b00('0x1c'))['db'];function respondWithStatusCode(_0x202549,_0x7eb0){_0x7eb0=_0x7eb0||0xcc;return function(_0x953865){if(_0x953865){return _0x202549['sendStatus'](_0x7eb0);}return _0x202549[_0x9b00('0x1d')](_0x7eb0)['end']();};}function respondWithResult(_0x251854,_0x534668){_0x534668=_0x534668||0xc8;return function(_0xf1260e){if(_0xf1260e){return _0x251854[_0x9b00('0x1d')](_0x534668)[_0x9b00('0x1e')](_0xf1260e);}};}function respondWithFilteredResult(_0xf9aa48,_0x218b19){return function(_0x491bae){if(_0x491bae){var _0x2b7590=typeof _0x218b19['offset']===_0x9b00('0x1f')&&typeof _0x218b19[_0x9b00('0x20')]===_0x9b00('0x1f');var _0x1dd29c=_0x491bae[_0x9b00('0x21')];var _0xf6289c=_0x2b7590?0x0:_0x218b19[_0x9b00('0x22')];var _0x4e9f8a=_0x2b7590?_0x491bae[_0x9b00('0x21')]:_0x218b19['offset']+_0x218b19[_0x9b00('0x20')];var _0x20774b;if(_0x4e9f8a>=_0x1dd29c){_0x4e9f8a=_0x1dd29c;_0x20774b=0xc8;}else{_0x20774b=0xce;}_0xf9aa48[_0x9b00('0x1d')](_0x20774b);return _0xf9aa48[_0x9b00('0x23')](_0x9b00('0x24'),_0xf6289c+'-'+_0x4e9f8a+'/'+_0x1dd29c)[_0x9b00('0x1e')](_0x491bae);}return null;};}function patchUpdates(_0x54bbea){return function(_0x22c65a){try{jsonpatch[_0x9b00('0x25')](_0x22c65a,_0x54bbea,!![]);}catch(_0x5f3ac5){return BPromise[_0x9b00('0x26')](_0x5f3ac5);}return _0x22c65a[_0x9b00('0x27')]();};}function saveUpdates(_0x34916a,_0x2a5e7f){return function(_0x207340){if(_0x207340){return _0x207340[_0x9b00('0x28')](_0x34916a)[_0x9b00('0x29')](function(_0x1b8b84){return _0x1b8b84;});}return null;};}function removeEntity(_0x3982b7,_0x5f3c31){return function(_0xb74144){if(_0xb74144){return _0xb74144['destroy']()[_0x9b00('0x29')](function(){_0x3982b7[_0x9b00('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22d481,_0x2008fb){return function(_0x1fb277){if(!_0x1fb277){_0x22d481[_0x9b00('0x2a')](0x194);}return _0x1fb277;};}function handleError(_0x1427a5,_0x3e228c){_0x3e228c=_0x3e228c||0x1f4;return function(_0x3230a6){logger[_0x9b00('0x2b')](_0x3230a6[_0x9b00('0x2c')]);if(_0x3230a6[_0x9b00('0x2d')]){delete _0x3230a6[_0x9b00('0x2d')];}_0x1427a5[_0x9b00('0x1d')](_0x3e228c)[_0x9b00('0x2e')](_0x3230a6);};}exports[_0x9b00('0x2f')]=function(_0x594e3a,_0x260978){var _0x4a3dee={},_0x128adc={},_0x55af72={'count':0x0,'rows':[]};var _0x3ee18=_[_0x9b00('0x30')](db[_0x9b00('0x31')][_0x9b00('0x32')],function(_0x474058){return{'name':_0x474058['fieldName'],'type':_0x474058[_0x9b00('0x33')][_0x9b00('0x34')]};});_0x128adc[_0x9b00('0x35')]=_[_0x9b00('0x30')](_0x3ee18,_0x9b00('0x2d'));_0x128adc[_0x9b00('0x36')]=_[_0x9b00('0x37')](_0x594e3a[_0x9b00('0x36')]);_0x128adc[_0x9b00('0x38')]=_[_0x9b00('0x39')](_0x128adc[_0x9b00('0x35')],_0x128adc[_0x9b00('0x36')]);_0x4a3dee[_0x9b00('0x3a')]=_[_0x9b00('0x39')](_0x128adc[_0x9b00('0x35')],qs[_0x9b00('0x3b')](_0x594e3a[_0x9b00('0x36')][_0x9b00('0x3b')]));_0x4a3dee[_0x9b00('0x3a')]=_0x4a3dee[_0x9b00('0x3a')][_0x9b00('0x3c')]?_0x4a3dee[_0x9b00('0x3a')]:_0x128adc[_0x9b00('0x35')];if(!_0x594e3a[_0x9b00('0x36')]['hasOwnProperty'](_0x9b00('0x3d'))){_0x4a3dee[_0x9b00('0x20')]=qs[_0x9b00('0x20')](_0x594e3a[_0x9b00('0x36')]['limit']);_0x4a3dee[_0x9b00('0x22')]=qs['offset'](_0x594e3a['query']['offset']);}_0x4a3dee[_0x9b00('0x3e')]=qs[_0x9b00('0x3f')](_0x594e3a[_0x9b00('0x36')][_0x9b00('0x3f')]);_0x4a3dee[_0x9b00('0x40')]=qs[_0x9b00('0x38')](_[_0x9b00('0x41')](_0x594e3a['query'],_0x128adc[_0x9b00('0x38')]),_0x3ee18);if(_0x594e3a[_0x9b00('0x36')][_0x9b00('0x42')]){_0x4a3dee[_0x9b00('0x40')]=_[_0x9b00('0x43')](_0x4a3dee[_0x9b00('0x40')],{'$or':_[_0x9b00('0x30')](_0x3ee18,function(_0x162948){if(_0x162948[_0x9b00('0x33')]!==_0x9b00('0x44')){var _0x2ded35={};_0x2ded35[_0x162948[_0x9b00('0x2d')]]={'$like':'%'+_0x594e3a[_0x9b00('0x36')][_0x9b00('0x42')]+'%'};return _0x2ded35;}})});}_0x4a3dee=_[_0x9b00('0x43')]({},_0x4a3dee,_0x594e3a['options']);var _0x32c5a4={'where':_0x4a3dee[_0x9b00('0x40')]};return db[_0x9b00('0x31')]['count'](_0x32c5a4)[_0x9b00('0x29')](function(_0xea92a9){_0x55af72[_0x9b00('0x21')]=_0xea92a9;if(_0x594e3a[_0x9b00('0x36')]['includeAll']){_0x4a3dee['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x9b00('0x45')](_0x4a3dee);})['then'](function(_0x5bd400){_0x55af72[_0x9b00('0x46')]=_0x5bd400;return _0x55af72;})[_0x9b00('0x29')](respondWithFilteredResult(_0x260978,_0x4a3dee))[_0x9b00('0x47')](handleError(_0x260978,null));};exports['show']=function(_0xe05365,_0x32dd41){var _0x45f330={'raw':![],'where':{'id':_0xe05365['params']['id']}},_0x43e690={};_0x43e690['model']=_['keys'](db['SalesforceConfiguration'][_0x9b00('0x32')]);_0x43e690[_0x9b00('0x36')]=_['keys'](_0xe05365[_0x9b00('0x36')]);_0x43e690[_0x9b00('0x38')]=_[_0x9b00('0x39')](_0x43e690[_0x9b00('0x35')],_0x43e690['query']);_0x45f330['attributes']=_['intersection'](_0x43e690[_0x9b00('0x35')],qs[_0x9b00('0x3b')](_0xe05365[_0x9b00('0x36')][_0x9b00('0x3b')]));_0x45f330['attributes']=_0x45f330[_0x9b00('0x3a')]['length']?_0x45f330[_0x9b00('0x3a')]:_0x43e690[_0x9b00('0x35')];if(_0xe05365[_0x9b00('0x36')][_0x9b00('0x48')]){_0x45f330[_0x9b00('0x49')]=[{'all':!![]}];}_0x45f330=_[_0x9b00('0x43')]({},_0x45f330,_0xe05365['options']);return db[_0x9b00('0x31')][_0x9b00('0x4a')](_0x45f330)['then'](handleEntityNotFound(_0x32dd41,null))['then'](respondWithResult(_0x32dd41,null))['catch'](handleError(_0x32dd41,null));};exports[_0x9b00('0x4b')]=function(_0x302702,_0x3a51ec){return db[_0x9b00('0x31')][_0x9b00('0x4b')](_0x302702[_0x9b00('0x4c')],{})[_0x9b00('0x29')](respondWithResult(_0x3a51ec,0xc9))['catch'](handleError(_0x3a51ec,null));};exports['update']=function(_0x5d49f5,_0x25c2e4){if(_0x5d49f5[_0x9b00('0x4c')]['id']){delete _0x5d49f5[_0x9b00('0x4c')]['id'];}return db[_0x9b00('0x31')][_0x9b00('0x4a')]({'where':{'id':_0x5d49f5[_0x9b00('0x4d')]['id']}})['then'](handleEntityNotFound(_0x25c2e4,null))[_0x9b00('0x29')](saveUpdates(_0x5d49f5[_0x9b00('0x4c')],null))[_0x9b00('0x29')](respondWithResult(_0x25c2e4,null))[_0x9b00('0x47')](handleError(_0x25c2e4,null));};exports[_0x9b00('0x4e')]=function(_0x14c4e0,_0x380b3d){return db[_0x9b00('0x31')][_0x9b00('0x4a')]({'where':{'id':_0x14c4e0[_0x9b00('0x4d')]['id']}})['then'](handleEntityNotFound(_0x380b3d,null))['then'](removeEntity(_0x380b3d,null))[_0x9b00('0x47')](handleError(_0x380b3d,null));};exports[_0x9b00('0x4f')]=function(_0xc4c267,_0x410acc,_0x8d9c0a){var _0x424721={};var _0x2654ab={};var _0x3e5664;var _0x100027;return db[_0x9b00('0x31')][_0x9b00('0x50')]({'where':{'id':_0xc4c267[_0x9b00('0x4d')]['id']}})[_0x9b00('0x29')](handleEntityNotFound(_0x410acc,null))['then'](function(_0x13f96a){if(_0x13f96a){_0x3e5664=_0x13f96a;_0x2654ab[_0x9b00('0x35')]=_[_0x9b00('0x37')](db['SalesforceField']['rawAttributes']);_0x2654ab[_0x9b00('0x36')]=_[_0x9b00('0x37')](_0xc4c267[_0x9b00('0x36')]);_0x2654ab['filters']=_['intersection'](_0x2654ab[_0x9b00('0x35')],_0x2654ab[_0x9b00('0x36')]);_0x424721[_0x9b00('0x3a')]=_[_0x9b00('0x39')](_0x2654ab[_0x9b00('0x35')],qs[_0x9b00('0x3b')](_0xc4c267[_0x9b00('0x36')][_0x9b00('0x3b')]));_0x424721['attributes']=_0x424721[_0x9b00('0x3a')][_0x9b00('0x3c')]?_0x424721['attributes']:_0x2654ab[_0x9b00('0x35')];_0x424721[_0x9b00('0x3e')]=qs[_0x9b00('0x3f')](_0xc4c267['query'][_0x9b00('0x3f')]);_0x424721[_0x9b00('0x40')]=qs['filters'](_[_0x9b00('0x41')](_0xc4c267[_0x9b00('0x36')],_0x2654ab[_0x9b00('0x38')]));if(_0xc4c267['query'][_0x9b00('0x42')]){_0x424721[_0x9b00('0x40')]=_['merge'](_0x424721[_0x9b00('0x40')],{'$or':_[_0x9b00('0x30')](_0x424721[_0x9b00('0x3a')],function(_0xe104a1){var _0x3ea1c7={};_0x3ea1c7[_0xe104a1]={'$like':'%'+_0xc4c267[_0x9b00('0x36')][_0x9b00('0x42')]+'%'};return _0x3ea1c7;})});}_0x424721=_[_0x9b00('0x43')]({},_0x424721,_0xc4c267['options']);return _0x3e5664[_0x9b00('0x4f')](_0x424721);}})[_0x9b00('0x29')](function(_0x2b8e8f){if(_0x2b8e8f){_0x100027=_0x2b8e8f['length'];if(!_0xc4c267[_0x9b00('0x36')]['hasOwnProperty'](_0x9b00('0x3d'))){_0x424721[_0x9b00('0x20')]=qs[_0x9b00('0x20')](_0xc4c267[_0x9b00('0x36')][_0x9b00('0x20')]);_0x424721[_0x9b00('0x22')]=qs[_0x9b00('0x22')](_0xc4c267[_0x9b00('0x36')][_0x9b00('0x22')]);}return _0x3e5664['getFields'](_0x424721);}})[_0x9b00('0x29')](function(_0x265db2){if(_0x265db2){return _0x265db2?{'count':_0x100027,'rows':_0x265db2}:null;}})[_0x9b00('0x29')](respondWithResult(_0x410acc,null))[_0x9b00('0x47')](handleError(_0x410acc,null));};exports[_0x9b00('0x51')]=function(_0x29a69d,_0x7593ea,_0xb22619){var _0x263a84={};var _0x2281ba={};var _0x226072;var _0x10bf25;return db[_0x9b00('0x31')][_0x9b00('0x50')]({'where':{'id':_0x29a69d[_0x9b00('0x4d')]['id']}})[_0x9b00('0x29')](handleEntityNotFound(_0x7593ea,null))['then'](function(_0x252dca){if(_0x252dca){_0x226072=_0x252dca;_0x2281ba[_0x9b00('0x35')]=_[_0x9b00('0x37')](db[_0x9b00('0x52')][_0x9b00('0x32')]);_0x2281ba[_0x9b00('0x36')]=_[_0x9b00('0x37')](_0x29a69d[_0x9b00('0x36')]);_0x2281ba[_0x9b00('0x38')]=_[_0x9b00('0x39')](_0x2281ba[_0x9b00('0x35')],_0x2281ba[_0x9b00('0x36')]);_0x263a84['attributes']=_[_0x9b00('0x39')](_0x2281ba[_0x9b00('0x35')],qs[_0x9b00('0x3b')](_0x29a69d[_0x9b00('0x36')][_0x9b00('0x3b')]));_0x263a84['attributes']=_0x263a84[_0x9b00('0x3a')][_0x9b00('0x3c')]?_0x263a84[_0x9b00('0x3a')]:_0x2281ba[_0x9b00('0x35')];_0x263a84[_0x9b00('0x3e')]=qs['sort'](_0x29a69d[_0x9b00('0x36')][_0x9b00('0x3f')]);_0x263a84[_0x9b00('0x40')]=qs[_0x9b00('0x38')](_[_0x9b00('0x41')](_0x29a69d['query'],_0x2281ba[_0x9b00('0x38')]));if(_0x29a69d[_0x9b00('0x36')]['filter']){_0x263a84[_0x9b00('0x40')]=_[_0x9b00('0x43')](_0x263a84[_0x9b00('0x40')],{'$or':_[_0x9b00('0x30')](_0x263a84['attributes'],function(_0x49bc8e){var _0x925d5c={};_0x925d5c[_0x49bc8e]={'$like':'%'+_0x29a69d[_0x9b00('0x36')]['filter']+'%'};return _0x925d5c;})});}_0x263a84=_[_0x9b00('0x43')]({},_0x263a84,_0x29a69d[_0x9b00('0x53')]);return _0x226072[_0x9b00('0x51')](_0x263a84);}})[_0x9b00('0x29')](function(_0x116b42){if(_0x116b42){_0x10bf25=_0x116b42[_0x9b00('0x3c')];if(!_0x29a69d[_0x9b00('0x36')][_0x9b00('0x54')]('nolimit')){_0x263a84['limit']=qs['limit'](_0x29a69d[_0x9b00('0x36')]['limit']);_0x263a84[_0x9b00('0x22')]=qs[_0x9b00('0x22')](_0x29a69d['query'][_0x9b00('0x22')]);}return _0x226072[_0x9b00('0x51')](_0x263a84);}})[_0x9b00('0x29')](function(_0x4b535a){if(_0x4b535a){return _0x4b535a?{'count':_0x10bf25,'rows':_0x4b535a}:null;}})[_0x9b00('0x29')](respondWithResult(_0x7593ea,null))['catch'](handleError(_0x7593ea,null));};exports[_0x9b00('0x55')]=function(_0x22214e,_0x2af1ee,_0x1cebf1){var _0x1cbf12={};var _0xa9b35b={};var _0x185df6;var _0x322afb;return db[_0x9b00('0x31')][_0x9b00('0x50')]({'where':{'id':_0x22214e[_0x9b00('0x4d')]['id']}})[_0x9b00('0x29')](handleEntityNotFound(_0x2af1ee,null))['then'](function(_0x1ab922){if(_0x1ab922){_0x185df6=_0x1ab922;_0xa9b35b[_0x9b00('0x35')]=_['keys'](db[_0x9b00('0x52')]['rawAttributes']);_0xa9b35b[_0x9b00('0x36')]=_[_0x9b00('0x37')](_0x22214e[_0x9b00('0x36')]);_0xa9b35b[_0x9b00('0x38')]=_[_0x9b00('0x39')](_0xa9b35b['model'],_0xa9b35b[_0x9b00('0x36')]);_0x1cbf12[_0x9b00('0x3a')]=_[_0x9b00('0x39')](_0xa9b35b[_0x9b00('0x35')],qs['fields'](_0x22214e[_0x9b00('0x36')]['fields']));_0x1cbf12[_0x9b00('0x3a')]=_0x1cbf12[_0x9b00('0x3a')][_0x9b00('0x3c')]?_0x1cbf12[_0x9b00('0x3a')]:_0xa9b35b[_0x9b00('0x35')];_0x1cbf12['order']=qs[_0x9b00('0x3f')](_0x22214e[_0x9b00('0x36')]['sort']);_0x1cbf12[_0x9b00('0x40')]=qs[_0x9b00('0x38')](_[_0x9b00('0x41')](_0x22214e[_0x9b00('0x36')],_0xa9b35b[_0x9b00('0x38')]));if(_0x22214e[_0x9b00('0x36')][_0x9b00('0x42')]){_0x1cbf12[_0x9b00('0x40')]=_['merge'](_0x1cbf12['where'],{'$or':_[_0x9b00('0x30')](_0x1cbf12['attributes'],function(_0x5125db){var _0x417212={};_0x417212[_0x5125db]={'$like':'%'+_0x22214e[_0x9b00('0x36')][_0x9b00('0x42')]+'%'};return _0x417212;})});}_0x1cbf12=_[_0x9b00('0x43')]({},_0x1cbf12,_0x22214e[_0x9b00('0x53')]);return _0x185df6[_0x9b00('0x55')](_0x1cbf12);}})[_0x9b00('0x29')](function(_0x3d7786){if(_0x3d7786){_0x322afb=_0x3d7786[_0x9b00('0x3c')];if(!_0x22214e[_0x9b00('0x36')][_0x9b00('0x54')]('nolimit')){_0x1cbf12[_0x9b00('0x20')]=qs[_0x9b00('0x20')](_0x22214e[_0x9b00('0x36')][_0x9b00('0x20')]);_0x1cbf12[_0x9b00('0x22')]=qs[_0x9b00('0x22')](_0x22214e[_0x9b00('0x36')][_0x9b00('0x22')]);}return _0x185df6[_0x9b00('0x55')](_0x1cbf12);}})[_0x9b00('0x29')](function(_0x353287){if(_0x353287){return _0x353287?{'count':_0x322afb,'rows':_0x353287}:null;}})['then'](respondWithResult(_0x2af1ee,null))[_0x9b00('0x47')](handleError(_0x2af1ee,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 20e0668..2afe030 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 _0x6764=['../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6764,0x15a));var _0x4676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6764[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4676('0x0'));var util=require(_0x4676('0x1'));var logger=require(_0x4676('0x2'))(_0x4676('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4676('0x4'));var fs=require('fs');var path=require(_0x4676('0x5'));var rimraf=require('rimraf');var config=require(_0x4676('0x6'));var attributes=require(_0x4676('0x7'));module[_0x4676('0x8')]=function(_0x182ba9,_0xf8aa13){return _0x182ba9['define'](_0x4676('0x9'),attributes,{'tableName':_0x4676('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce4f=['define','SalesforceConfiguration','int_salesforce_configurations','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5b4f98,_0x4e2213){var _0x1f5022=function(_0x32b3f5){while(--_0x32b3f5){_0x5b4f98['push'](_0x5b4f98['shift']());}};_0x1f5022(++_0x4e2213);}(_0xce4f,0xdf));var _0xfce4=function(_0x5972d8,_0x3a1c8b){_0x5972d8=_0x5972d8-0x0;var _0x228561=_0xce4f[_0x5972d8];return _0x228561;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfce4('0x0'))(_0xfce4('0x1'));var moment=require('moment');var BPromise=require(_0xfce4('0x2'));var rp=require(_0xfce4('0x3'));var fs=require('fs');var path=require(_0xfce4('0x4'));var rimraf=require(_0xfce4('0x5'));var config=require(_0xfce4('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xfce4('0x7')]=function(_0x221e4f,_0x5aed3d){return _0x221e4f[_0xfce4('0x8')](_0xfce4('0x9'),attributes,{'tableName':_0xfce4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index ab162a2..c738c7a 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 _0xd4a6=['request','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x1a01ec,_0x142bef){var _0x390b80=function(_0x5bfa0e){while(--_0x5bfa0e){_0x1a01ec['push'](_0x1a01ec['shift']());}};_0x390b80(++_0x142bef);}(_0xd4a6,0x89));var _0x6d4a=function(_0x53363d,_0x5aafe3){_0x53363d=_0x53363d-0x0;var _0x253176=_0xd4a6[_0x53363d];return _0x253176;};'use strict';var _=require(_0x6d4a('0x0'));var util=require(_0x6d4a('0x1'));var moment=require(_0x6d4a('0x2'));var BPromise=require(_0x6d4a('0x3'));var rs=require(_0x6d4a('0x4'));var fs=require('fs');var Redis=require(_0x6d4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d4a('0x6'));var logger=require(_0x6d4a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6d4a('0x8'));var client=jayson['client'][_0x6d4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x245fbf,_0x1b1af0,_0x54acda){return new BPromise(function(_0x509d74,_0x2d480f){return client[_0x6d4a('0xa')](_0x245fbf,_0x54acda)[_0x6d4a('0xb')](function(_0x86e08f){logger[_0x6d4a('0xc')](_0x6d4a('0xd'),_0x1b1af0,'request\x20sent');logger['debug'](_0x6d4a('0xe'),_0x1b1af0,_0x6d4a('0xf'),JSON[_0x6d4a('0x10')](_0x86e08f));if(_0x86e08f[_0x6d4a('0x11')]){if(_0x86e08f[_0x6d4a('0x11')][_0x6d4a('0x12')]===0x1f4){logger[_0x6d4a('0x11')](_0x6d4a('0xd'),_0x1b1af0,_0x86e08f[_0x6d4a('0x11')][_0x6d4a('0x13')]);return _0x2d480f(_0x86e08f[_0x6d4a('0x11')][_0x6d4a('0x13')]);}logger[_0x6d4a('0x11')](_0x6d4a('0xd'),_0x1b1af0,_0x86e08f[_0x6d4a('0x11')][_0x6d4a('0x13')]);return _0x509d74(_0x86e08f[_0x6d4a('0x11')]['message']);}else{logger[_0x6d4a('0xc')](_0x6d4a('0xd'),_0x1b1af0,_0x6d4a('0xf'));_0x509d74(_0x86e08f[_0x6d4a('0x14')][_0x6d4a('0x13')]);}})['catch'](function(_0x456bcb){logger['error'](_0x6d4a('0xd'),_0x1b1af0,_0x456bcb);_0x2d480f(_0x456bcb);});});} \ No newline at end of file +var _0x5b0e=['rpc','../../config/environment','client','http','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x5b0e,0x120));var _0xe5b0=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x5b0e[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0xe5b0('0x0'));var util=require(_0xe5b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5b0('0x2'));var db=require(_0xe5b0('0x3'))['db'];var utils=require(_0xe5b0('0x4'));var logger=require(_0xe5b0('0x5'))(_0xe5b0('0x6'));var config=require(_0xe5b0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe5b0('0x8')][_0xe5b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4439ce,_0x55667c,_0x138889){return new BPromise(function(_0x37e535,_0x523a96){return client[_0xe5b0('0xa')](_0x4439ce,_0x138889)[_0xe5b0('0xb')](function(_0xcff868){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x55667c,_0xe5b0('0xc'));logger[_0xe5b0('0xd')](_0xe5b0('0xe'),_0x55667c,_0xe5b0('0xc'),JSON['stringify'](_0xcff868));if(_0xcff868['error']){if(_0xcff868[_0xe5b0('0xf')][_0xe5b0('0x10')]===0x1f4){logger['error'](_0xe5b0('0x11'),_0x55667c,_0xcff868[_0xe5b0('0xf')][_0xe5b0('0x12')]);return _0x523a96(_0xcff868[_0xe5b0('0xf')]['message']);}logger[_0xe5b0('0xf')](_0xe5b0('0x11'),_0x55667c,_0xcff868[_0xe5b0('0xf')][_0xe5b0('0x12')]);return _0x37e535(_0xcff868[_0xe5b0('0xf')][_0xe5b0('0x12')]);}else{logger[_0xe5b0('0x13')](_0xe5b0('0x11'),_0x55667c,_0xe5b0('0xc'));_0x37e535(_0xcff868[_0xe5b0('0x14')]['message']);}})['catch'](function(_0x570e0c){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x55667c,_0x570e0c);_0x523a96(_0x570e0c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 5cfcc9d..27af701 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 _0xce87=['../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b28a6,_0x3635ef){var _0x3fa439=function(_0x1e46ca){while(--_0x1e46ca){_0x5b28a6['push'](_0x5b28a6['shift']());}};_0x3fa439(++_0x3635ef);}(_0xce87,0x188));var _0x7ce8=function(_0x84a159,_0x1d2a62){_0x84a159=_0x84a159-0x0;var _0x596baa=_0xce87[_0x84a159];return _0x596baa;};'use strict';var multer=require('multer');var util=require(_0x7ce8('0x0'));var path=require(_0x7ce8('0x1'));var timeout=require(_0x7ce8('0x2'));var express=require(_0x7ce8('0x3'));var router=express['Router']();var fs_extra=require(_0x7ce8('0x4'));var auth=require(_0x7ce8('0x5'));var interaction=require(_0x7ce8('0x6'));var config=require(_0x7ce8('0x7'));var controller=require(_0x7ce8('0x8'));router[_0x7ce8('0x9')]('/',auth[_0x7ce8('0xa')](),controller[_0x7ce8('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7ce8('0xc')]('/',auth[_0x7ce8('0xa')](),controller[_0x7ce8('0xd')]);router[_0x7ce8('0xe')](_0x7ce8('0xf'),auth[_0x7ce8('0xa')](),controller[_0x7ce8('0x10')]);router['delete']('/:id',auth[_0x7ce8('0xa')](),controller[_0x7ce8('0x11')]);module[_0x7ce8('0x12')]=router; \ No newline at end of file +var _0xd330=['/:id','show','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index'];(function(_0x30a90e,_0x54d75d){var _0x5a3a26=function(_0x127981){while(--_0x127981){_0x30a90e['push'](_0x30a90e['shift']());}};_0x5a3a26(++_0x54d75d);}(_0xd330,0x177));var _0x0d33=function(_0x586a8a,_0x1ed840){_0x586a8a=_0x586a8a-0x0;var _0x4fb71d=_0xd330[_0x586a8a];return _0x4fb71d;};'use strict';var multer=require(_0x0d33('0x0'));var util=require(_0x0d33('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d33('0x2')]();var fs_extra=require(_0x0d33('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0d33('0x4'));var controller=require(_0x0d33('0x5'));router[_0x0d33('0x6')]('/',auth[_0x0d33('0x7')](),controller[_0x0d33('0x8')]);router[_0x0d33('0x6')](_0x0d33('0x9'),auth[_0x0d33('0x7')](),controller[_0x0d33('0xa')]);router['post']('/',auth[_0x0d33('0x7')](),controller[_0x0d33('0xb')]);router[_0x0d33('0xc')](_0x0d33('0x9'),auth[_0x0d33('0x7')](),controller['update']);router[_0x0d33('0xd')]('/:id',auth[_0x0d33('0x7')](),controller[_0x0d33('0xe')]);module[_0x0d33('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 2b8cf63..3654997 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 _0x9936=['STRING','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x9936,0x1dd));var _0x6993=function(_0x422b1a,_0x3d28b4){_0x422b1a=_0x422b1a-0x0;var _0x286506=_0x9936[_0x422b1a];return _0x286506;};'use strict';var Sequelize=require('sequelize');module[_0x6993('0x0')]={'type':{'type':Sequelize[_0x6993('0x1')](_0x6993('0x2'),'variable',_0x6993('0x3'),_0x6993('0x4'),_0x6993('0x5')),'defaultValue':_0x6993('0x2')},'content':{'type':Sequelize[_0x6993('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6993('0x1')]('string','variable',_0x6993('0x3'))},'keyContent':{'type':Sequelize[_0x6993('0x6')]},'idField':{'type':Sequelize[_0x6993('0x6')]},'variableName':{'type':Sequelize[_0x6993('0x6')]}}; \ No newline at end of file +var _0x5fa0=['string','variable','picklist','STRING','customVariable','exports','ENUM'];(function(_0xed01eb,_0x275edb){var _0x25b9de=function(_0x3c331c){while(--_0x3c331c){_0xed01eb['push'](_0xed01eb['shift']());}};_0x25b9de(++_0x275edb);}(_0x5fa0,0x1a2));var _0x05fa=function(_0x4dd29b,_0x48cf26){_0x4dd29b=_0x4dd29b-0x0;var _0x15bb51=_0x5fa0[_0x4dd29b];return _0x15bb51;};'use strict';var Sequelize=require('sequelize');module[_0x05fa('0x0')]={'type':{'type':Sequelize[_0x05fa('0x1')](_0x05fa('0x2'),_0x05fa('0x3'),'customVariable','keyValue',_0x05fa('0x4')),'defaultValue':_0x05fa('0x2')},'content':{'type':Sequelize[_0x05fa('0x5')]},'key':{'type':Sequelize[_0x05fa('0x5')]},'keyType':{'type':Sequelize[_0x05fa('0x1')]('string',_0x05fa('0x3'),_0x05fa('0x6'))},'keyContent':{'type':Sequelize[_0x05fa('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x05fa('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9008e11..789d4fb 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 _0x3ce5=['json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','keys','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x513e48,_0x50b679){var _0x2eda18=function(_0x3279fe){while(--_0x3279fe){_0x513e48['push'](_0x513e48['shift']());}};_0x2eda18(++_0x50b679);}(_0x3ce5,0x76));var _0x53ce=function(_0x49f8c5,_0x20e3a4){_0x49f8c5=_0x49f8c5-0x0;var _0xe91ea0=_0x3ce5[_0x49f8c5];return _0xe91ea0;};'use strict';var emlformat=require(_0x53ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x53ce('0x1'));var jsonpatch=require(_0x53ce('0x2'));var rp=require(_0x53ce('0x3'));var moment=require(_0x53ce('0x4'));var BPromise=require(_0x53ce('0x5'));var Mustache=require(_0x53ce('0x6'));var util=require(_0x53ce('0x7'));var path=require(_0x53ce('0x8'));var sox=require('sox');var csv=require(_0x53ce('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53ce('0xa'));var _=require(_0x53ce('0xb'));var squel=require(_0x53ce('0xc'));var crypto=require('crypto');var jsforce=require(_0x53ce('0xd'));var deskjs=require(_0x53ce('0xe'));var toCsv=require('to-csv');var querystring=require(_0x53ce('0xf'));var Papa=require(_0x53ce('0x10'));var Redis=require('ioredis');var authService=require(_0x53ce('0x11'));var qs=require(_0x53ce('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53ce('0x13'));var logger=require(_0x53ce('0x14'))(_0x53ce('0x15'));var utils=require(_0x53ce('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x53ce('0x17'))['db'];function respondWithStatusCode(_0x440f60,_0x2293a0){_0x2293a0=_0x2293a0||0xcc;return function(_0x17ea4f){if(_0x17ea4f){return _0x440f60[_0x53ce('0x18')](_0x2293a0);}return _0x440f60[_0x53ce('0x19')](_0x2293a0)['end']();};}function respondWithResult(_0x4c761d,_0x4806ab){_0x4806ab=_0x4806ab||0xc8;return function(_0x1821d1){if(_0x1821d1){return _0x4c761d[_0x53ce('0x19')](_0x4806ab)[_0x53ce('0x1a')](_0x1821d1);}};}function respondWithFilteredResult(_0x4d6cb3,_0x28c4a2){return function(_0x282532){if(_0x282532){var _0x37d39e=typeof _0x28c4a2[_0x53ce('0x1b')]==='undefined'&&typeof _0x28c4a2['limit']===_0x53ce('0x1c');var _0x3ee0a0=_0x282532[_0x53ce('0x1d')];var _0x44be3c=_0x37d39e?0x0:_0x28c4a2[_0x53ce('0x1b')];var _0x5c1769=_0x37d39e?_0x282532[_0x53ce('0x1d')]:_0x28c4a2[_0x53ce('0x1b')]+_0x28c4a2['limit'];var _0xd95b5b;if(_0x5c1769>=_0x3ee0a0){_0x5c1769=_0x3ee0a0;_0xd95b5b=0xc8;}else{_0xd95b5b=0xce;}_0x4d6cb3['status'](_0xd95b5b);return _0x4d6cb3['set'](_0x53ce('0x1e'),_0x44be3c+'-'+_0x5c1769+'/'+_0x3ee0a0)['json'](_0x282532);}return null;};}function patchUpdates(_0xb7c80d){return function(_0x27ecb8){try{jsonpatch[_0x53ce('0x1f')](_0x27ecb8,_0xb7c80d,!![]);}catch(_0x5ec2de){return BPromise[_0x53ce('0x20')](_0x5ec2de);}return _0x27ecb8['save']();};}function saveUpdates(_0xf3fc,_0x3cea94){return function(_0x3802a6){if(_0x3802a6){return _0x3802a6[_0x53ce('0x21')](_0xf3fc)[_0x53ce('0x22')](function(_0x320507){return _0x320507;});}return null;};}function removeEntity(_0x101ccb,_0x509b8a){return function(_0x2db035){if(_0x2db035){return _0x2db035[_0x53ce('0x23')]()[_0x53ce('0x22')](function(){_0x101ccb[_0x53ce('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x558beb,_0x124f2c){return function(_0x50001e){if(!_0x50001e){_0x558beb['sendStatus'](0x194);}return _0x50001e;};}function handleError(_0x3f6982,_0x17c51c){_0x17c51c=_0x17c51c||0x1f4;return function(_0x515617){logger[_0x53ce('0x24')](_0x515617[_0x53ce('0x25')]);if(_0x515617[_0x53ce('0x26')]){delete _0x515617['name'];}_0x3f6982[_0x53ce('0x19')](_0x17c51c)['send'](_0x515617);};}exports[_0x53ce('0x27')]=function(_0x360c43,_0x8f0692){var _0x4294ab={},_0x18fca6={},_0x3fde6b={'count':0x0,'rows':[]};var _0x809e79=_[_0x53ce('0x28')](db[_0x53ce('0x29')][_0x53ce('0x2a')],function(_0x2c9a9e){return{'name':_0x2c9a9e[_0x53ce('0x2b')],'type':_0x2c9a9e[_0x53ce('0x2c')][_0x53ce('0x2d')]};});_0x18fca6[_0x53ce('0x2e')]=_[_0x53ce('0x28')](_0x809e79,'name');_0x18fca6['query']=_['keys'](_0x360c43[_0x53ce('0x2f')]);_0x18fca6[_0x53ce('0x30')]=_[_0x53ce('0x31')](_0x18fca6[_0x53ce('0x2e')],_0x18fca6[_0x53ce('0x2f')]);_0x4294ab['attributes']=_[_0x53ce('0x31')](_0x18fca6['model'],qs[_0x53ce('0x32')](_0x360c43[_0x53ce('0x2f')][_0x53ce('0x32')]));_0x4294ab[_0x53ce('0x33')]=_0x4294ab[_0x53ce('0x33')][_0x53ce('0x34')]?_0x4294ab[_0x53ce('0x33')]:_0x18fca6[_0x53ce('0x2e')];if(!_0x360c43['query'][_0x53ce('0x35')](_0x53ce('0x36'))){_0x4294ab[_0x53ce('0x37')]=qs[_0x53ce('0x37')](_0x360c43[_0x53ce('0x2f')][_0x53ce('0x37')]);_0x4294ab[_0x53ce('0x1b')]=qs['offset'](_0x360c43['query']['offset']);}_0x4294ab[_0x53ce('0x38')]=qs[_0x53ce('0x39')](_0x360c43[_0x53ce('0x2f')]['sort']);_0x4294ab[_0x53ce('0x3a')]=qs[_0x53ce('0x30')](_['pick'](_0x360c43[_0x53ce('0x2f')],_0x18fca6['filters']),_0x809e79);if(_0x360c43[_0x53ce('0x2f')][_0x53ce('0x3b')]){_0x4294ab['where']=_[_0x53ce('0x3c')](_0x4294ab[_0x53ce('0x3a')],{'$or':_[_0x53ce('0x28')](_0x809e79,function(_0x5cf911){if(_0x5cf911[_0x53ce('0x2c')]!=='VIRTUAL'){var _0x487832={};_0x487832[_0x5cf911[_0x53ce('0x26')]]={'$like':'%'+_0x360c43[_0x53ce('0x2f')][_0x53ce('0x3b')]+'%'};return _0x487832;}})});}_0x4294ab=_[_0x53ce('0x3c')]({},_0x4294ab,_0x360c43[_0x53ce('0x3d')]);var _0x788757={'where':_0x4294ab[_0x53ce('0x3a')]};return db[_0x53ce('0x29')][_0x53ce('0x1d')](_0x788757)[_0x53ce('0x22')](function(_0x45f12f){_0x3fde6b[_0x53ce('0x1d')]=_0x45f12f;if(_0x360c43['query'][_0x53ce('0x3e')]){_0x4294ab[_0x53ce('0x3f')]=[{'all':!![]}];}return db[_0x53ce('0x29')]['findAll'](_0x4294ab);})['then'](function(_0x5114c7){_0x3fde6b[_0x53ce('0x40')]=_0x5114c7;return _0x3fde6b;})[_0x53ce('0x22')](respondWithFilteredResult(_0x8f0692,_0x4294ab))['catch'](handleError(_0x8f0692,null));};exports[_0x53ce('0x41')]=function(_0x195813,_0x5bd8fa){var _0x2df83d={'raw':!![],'where':{'id':_0x195813[_0x53ce('0x42')]['id']}},_0x1ba0af={};_0x1ba0af[_0x53ce('0x2e')]=_[_0x53ce('0x43')](db[_0x53ce('0x29')][_0x53ce('0x2a')]);_0x1ba0af[_0x53ce('0x2f')]=_[_0x53ce('0x43')](_0x195813[_0x53ce('0x2f')]);_0x1ba0af[_0x53ce('0x30')]=_[_0x53ce('0x31')](_0x1ba0af[_0x53ce('0x2e')],_0x1ba0af[_0x53ce('0x2f')]);_0x2df83d['attributes']=_['intersection'](_0x1ba0af[_0x53ce('0x2e')],qs[_0x53ce('0x32')](_0x195813['query'][_0x53ce('0x32')]));_0x2df83d[_0x53ce('0x33')]=_0x2df83d[_0x53ce('0x33')][_0x53ce('0x34')]?_0x2df83d[_0x53ce('0x33')]:_0x1ba0af[_0x53ce('0x2e')];if(_0x195813[_0x53ce('0x2f')][_0x53ce('0x3e')]){_0x2df83d[_0x53ce('0x3f')]=[{'all':!![]}];}_0x2df83d=_[_0x53ce('0x3c')]({},_0x2df83d,_0x195813['options']);return db[_0x53ce('0x29')][_0x53ce('0x44')](_0x2df83d)[_0x53ce('0x22')](handleEntityNotFound(_0x5bd8fa,null))[_0x53ce('0x22')](respondWithResult(_0x5bd8fa,null))[_0x53ce('0x45')](handleError(_0x5bd8fa,null));};exports[_0x53ce('0x46')]=function(_0x1a7078,_0x5d3b19){return db[_0x53ce('0x29')]['create'](_0x1a7078['body'],{})[_0x53ce('0x22')](respondWithResult(_0x5d3b19,0xc9))[_0x53ce('0x45')](handleError(_0x5d3b19,null));};exports[_0x53ce('0x21')]=function(_0x474377,_0x2e375c){if(_0x474377[_0x53ce('0x47')]['id']){delete _0x474377[_0x53ce('0x47')]['id'];}return db[_0x53ce('0x29')][_0x53ce('0x44')]({'where':{'id':_0x474377[_0x53ce('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e375c,null))[_0x53ce('0x22')](saveUpdates(_0x474377[_0x53ce('0x47')],null))[_0x53ce('0x22')](respondWithResult(_0x2e375c,null))[_0x53ce('0x45')](handleError(_0x2e375c,null));};exports['destroy']=function(_0x207094,_0x5184ef){return db[_0x53ce('0x29')][_0x53ce('0x44')]({'where':{'id':_0x207094['params']['id']}})[_0x53ce('0x22')](handleEntityNotFound(_0x5184ef,null))['then'](removeEntity(_0x5184ef,null))[_0x53ce('0x45')](handleError(_0x5184ef,null));}; \ No newline at end of file +var _0x1421=['filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','reject','save','then','destroy','end','error','name','send','SalesforceField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filters'];(function(_0x343395,_0x4045bc){var _0x19de40=function(_0x3e86b8){while(--_0x3e86b8){_0x343395['push'](_0x343395['shift']());}};_0x19de40(++_0x4045bc);}(_0x1421,0x182));var _0x1142=function(_0x2720bb,_0x35e02f){_0x2720bb=_0x2720bb-0x0;var _0x23394e=_0x1421[_0x2720bb];return _0x23394e;};'use strict';var emlformat=require(_0x1142('0x0'));var rimraf=require(_0x1142('0x1'));var zipdir=require(_0x1142('0x2'));var jsonpatch=require(_0x1142('0x3'));var rp=require('request-promise');var moment=require(_0x1142('0x4'));var BPromise=require(_0x1142('0x5'));var Mustache=require('mustache');var util=require(_0x1142('0x6'));var path=require('path');var sox=require(_0x1142('0x7'));var csv=require(_0x1142('0x8'));var ejs=require(_0x1142('0x9'));var fs=require('fs');var fs_extra=require(_0x1142('0xa'));var _=require(_0x1142('0xb'));var squel=require('squel');var crypto=require(_0x1142('0xc'));var jsforce=require(_0x1142('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1142('0x8'));var querystring=require(_0x1142('0xe'));var Papa=require(_0x1142('0xf'));var Redis=require(_0x1142('0x10'));var authService=require(_0x1142('0x11'));var qs=require(_0x1142('0x12'));var as=require(_0x1142('0x13'));var hardwareService=require(_0x1142('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1142('0x15'));var config=require(_0x1142('0x16'));var licenseUtil=require(_0x1142('0x17'));var db=require(_0x1142('0x18'))['db'];function respondWithStatusCode(_0x4b3b74,_0x1e6c44){_0x1e6c44=_0x1e6c44||0xcc;return function(_0x1a5d7a){if(_0x1a5d7a){return _0x4b3b74[_0x1142('0x19')](_0x1e6c44);}return _0x4b3b74[_0x1142('0x1a')](_0x1e6c44)['end']();};}function respondWithResult(_0x37cc3f,_0x5d4cba){_0x5d4cba=_0x5d4cba||0xc8;return function(_0x314cdb){if(_0x314cdb){return _0x37cc3f[_0x1142('0x1a')](_0x5d4cba)[_0x1142('0x1b')](_0x314cdb);}};}function respondWithFilteredResult(_0x1f78c2,_0xa098e3){return function(_0x3d50c7){if(_0x3d50c7){var _0x5f0973=typeof _0xa098e3[_0x1142('0x1c')]==='undefined'&&typeof _0xa098e3[_0x1142('0x1d')]===_0x1142('0x1e');var _0x41a311=_0x3d50c7[_0x1142('0x1f')];var _0x459443=_0x5f0973?0x0:_0xa098e3['offset'];var _0x19ad16=_0x5f0973?_0x3d50c7['count']:_0xa098e3[_0x1142('0x1c')]+_0xa098e3[_0x1142('0x1d')];var _0x1fdfe3;if(_0x19ad16>=_0x41a311){_0x19ad16=_0x41a311;_0x1fdfe3=0xc8;}else{_0x1fdfe3=0xce;}_0x1f78c2[_0x1142('0x1a')](_0x1fdfe3);return _0x1f78c2['set']('Content-Range',_0x459443+'-'+_0x19ad16+'/'+_0x41a311)['json'](_0x3d50c7);}return null;};}function patchUpdates(_0x35c473){return function(_0x36148e){try{jsonpatch['apply'](_0x36148e,_0x35c473,!![]);}catch(_0x1c3fd3){return BPromise[_0x1142('0x20')](_0x1c3fd3);}return _0x36148e[_0x1142('0x21')]();};}function saveUpdates(_0x4ed45f,_0x40bc3b){return function(_0x511281){if(_0x511281){return _0x511281['update'](_0x4ed45f)[_0x1142('0x22')](function(_0x25b7f1){return _0x25b7f1;});}return null;};}function removeEntity(_0xb5fca5,_0x67939c){return function(_0x18814){if(_0x18814){return _0x18814[_0x1142('0x23')]()[_0x1142('0x22')](function(){_0xb5fca5[_0x1142('0x1a')](0xcc)[_0x1142('0x24')]();});}};}function handleEntityNotFound(_0x20d82f,_0x2ccad0){return function(_0x324b70){if(!_0x324b70){_0x20d82f[_0x1142('0x19')](0x194);}return _0x324b70;};}function handleError(_0x3d7fe5,_0x17e72f){_0x17e72f=_0x17e72f||0x1f4;return function(_0x3567bd){logger[_0x1142('0x25')](_0x3567bd['stack']);if(_0x3567bd[_0x1142('0x26')]){delete _0x3567bd['name'];}_0x3d7fe5[_0x1142('0x1a')](_0x17e72f)[_0x1142('0x27')](_0x3567bd);};}exports['index']=function(_0x5e5756,_0x43fdc8){var _0x49b774={},_0x30bc80={},_0x190208={'count':0x0,'rows':[]};var _0x1247f7=_['map'](db[_0x1142('0x28')][_0x1142('0x29')],function(_0x56cbb8){return{'name':_0x56cbb8[_0x1142('0x2a')],'type':_0x56cbb8[_0x1142('0x2b')][_0x1142('0x2c')]};});_0x30bc80[_0x1142('0x2d')]=_[_0x1142('0x2e')](_0x1247f7,'name');_0x30bc80[_0x1142('0x2f')]=_[_0x1142('0x30')](_0x5e5756[_0x1142('0x2f')]);_0x30bc80['filters']=_[_0x1142('0x31')](_0x30bc80[_0x1142('0x2d')],_0x30bc80[_0x1142('0x2f')]);_0x49b774[_0x1142('0x32')]=_[_0x1142('0x31')](_0x30bc80['model'],qs[_0x1142('0x33')](_0x5e5756[_0x1142('0x2f')][_0x1142('0x33')]));_0x49b774[_0x1142('0x32')]=_0x49b774[_0x1142('0x32')]['length']?_0x49b774[_0x1142('0x32')]:_0x30bc80[_0x1142('0x2d')];if(!_0x5e5756['query'][_0x1142('0x34')](_0x1142('0x35'))){_0x49b774[_0x1142('0x1d')]=qs[_0x1142('0x1d')](_0x5e5756[_0x1142('0x2f')][_0x1142('0x1d')]);_0x49b774[_0x1142('0x1c')]=qs['offset'](_0x5e5756['query'][_0x1142('0x1c')]);}_0x49b774[_0x1142('0x36')]=qs['sort'](_0x5e5756[_0x1142('0x2f')]['sort']);_0x49b774[_0x1142('0x37')]=qs['filters'](_[_0x1142('0x38')](_0x5e5756['query'],_0x30bc80[_0x1142('0x39')]),_0x1247f7);if(_0x5e5756[_0x1142('0x2f')][_0x1142('0x3a')]){_0x49b774[_0x1142('0x37')]=_['merge'](_0x49b774['where'],{'$or':_['map'](_0x1247f7,function(_0x5ede19){if(_0x5ede19[_0x1142('0x2b')]!==_0x1142('0x3b')){var _0x1e43b0={};_0x1e43b0[_0x5ede19[_0x1142('0x26')]]={'$like':'%'+_0x5e5756[_0x1142('0x2f')][_0x1142('0x3a')]+'%'};return _0x1e43b0;}})});}_0x49b774=_[_0x1142('0x3c')]({},_0x49b774,_0x5e5756[_0x1142('0x3d')]);var _0xe24414={'where':_0x49b774[_0x1142('0x37')]};return db[_0x1142('0x28')]['count'](_0xe24414)[_0x1142('0x22')](function(_0x22fc7d){_0x190208[_0x1142('0x1f')]=_0x22fc7d;if(_0x5e5756['query'][_0x1142('0x3e')]){_0x49b774[_0x1142('0x3f')]=[{'all':!![]}];}return db[_0x1142('0x28')][_0x1142('0x40')](_0x49b774);})['then'](function(_0x56349b){_0x190208[_0x1142('0x41')]=_0x56349b;return _0x190208;})[_0x1142('0x22')](respondWithFilteredResult(_0x43fdc8,_0x49b774))[_0x1142('0x42')](handleError(_0x43fdc8,null));};exports[_0x1142('0x43')]=function(_0x598ada,_0x3e12af){var _0x1ee35d={'raw':!![],'where':{'id':_0x598ada[_0x1142('0x44')]['id']}},_0x271d2f={};_0x271d2f[_0x1142('0x2d')]=_['keys'](db['SalesforceField'][_0x1142('0x29')]);_0x271d2f[_0x1142('0x2f')]=_[_0x1142('0x30')](_0x598ada['query']);_0x271d2f[_0x1142('0x39')]=_[_0x1142('0x31')](_0x271d2f['model'],_0x271d2f['query']);_0x1ee35d[_0x1142('0x32')]=_[_0x1142('0x31')](_0x271d2f['model'],qs[_0x1142('0x33')](_0x598ada[_0x1142('0x2f')][_0x1142('0x33')]));_0x1ee35d[_0x1142('0x32')]=_0x1ee35d[_0x1142('0x32')][_0x1142('0x45')]?_0x1ee35d[_0x1142('0x32')]:_0x271d2f[_0x1142('0x2d')];if(_0x598ada[_0x1142('0x2f')][_0x1142('0x3e')]){_0x1ee35d[_0x1142('0x3f')]=[{'all':!![]}];}_0x1ee35d=_['merge']({},_0x1ee35d,_0x598ada['options']);return db[_0x1142('0x28')][_0x1142('0x46')](_0x1ee35d)[_0x1142('0x22')](handleEntityNotFound(_0x3e12af,null))['then'](respondWithResult(_0x3e12af,null))['catch'](handleError(_0x3e12af,null));};exports[_0x1142('0x47')]=function(_0x3eaac4,_0x1c1a5c){return db[_0x1142('0x28')]['create'](_0x3eaac4[_0x1142('0x48')],{})[_0x1142('0x22')](respondWithResult(_0x1c1a5c,0xc9))['catch'](handleError(_0x1c1a5c,null));};exports[_0x1142('0x49')]=function(_0x7c71e7,_0x10f1bc){if(_0x7c71e7[_0x1142('0x48')]['id']){delete _0x7c71e7['body']['id'];}return db[_0x1142('0x28')]['find']({'where':{'id':_0x7c71e7['params']['id']}})[_0x1142('0x22')](handleEntityNotFound(_0x10f1bc,null))[_0x1142('0x22')](saveUpdates(_0x7c71e7[_0x1142('0x48')],null))[_0x1142('0x22')](respondWithResult(_0x10f1bc,null))[_0x1142('0x42')](handleError(_0x10f1bc,null));};exports[_0x1142('0x23')]=function(_0x41dbd3,_0x4ddf58){return db['SalesforceField'][_0x1142('0x46')]({'where':{'id':_0x41dbd3[_0x1142('0x44')]['id']}})[_0x1142('0x22')](handleEntityNotFound(_0x4ddf58,null))[_0x1142('0x22')](removeEntity(_0x4ddf58,null))['catch'](handleError(_0x4ddf58,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index a04fd3f..b6db380 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 _0x19c0=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','../../config/logger','api','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x19c0,0x1ef));var _0x019c=function(_0x14bf39,_0x3e00bc){_0x14bf39=_0x14bf39-0x0;var _0x3f9cfe=_0x19c0[_0x14bf39];return _0x3f9cfe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x019c('0x0'))(_0x019c('0x1'));var moment=require('moment');var BPromise=require(_0x019c('0x2'));var rp=require(_0x019c('0x3'));var fs=require('fs');var path=require(_0x019c('0x4'));var rimraf=require(_0x019c('0x5'));var config=require('../../config/environment');var attributes=require(_0x019c('0x6'));module[_0x019c('0x7')]=function(_0x5b28cf,_0x26dfb7){return _0x5b28cf[_0x019c('0x8')](_0x019c('0x9'),attributes,{'tableName':_0x019c('0xa'),'paranoid':![],'indexes':[{'name':_0x019c('0xb'),'fields':[_0x019c('0xc'),_0x019c('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7f4=['./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xd7f4,0x1a7));var _0x4d7f=function(_0x2b1e2a,_0x190596){_0x2b1e2a=_0x2b1e2a-0x0;var _0x3cb720=_0xd7f4[_0x2b1e2a];return _0x3cb720;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4d7f('0x0'));var moment=require(_0x4d7f('0x1'));var BPromise=require(_0x4d7f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d7f('0x3'));var rimraf=require(_0x4d7f('0x4'));var config=require(_0x4d7f('0x5'));var attributes=require(_0x4d7f('0x6'));module[_0x4d7f('0x7')]=function(_0x2d8c92,_0x5cc0e0){return _0x2d8c92['define'](_0x4d7f('0x8'),attributes,{'tableName':_0x4d7f('0x9'),'paranoid':![],'indexes':[{'name':_0x4d7f('0xa'),'fields':[_0x4d7f('0xb'),_0x4d7f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 1db9c30..2791b79 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 _0x4609=['code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4ce615,_0x17ba74){var _0x214e09=function(_0x3ab098){while(--_0x3ab098){_0x4ce615['push'](_0x4ce615['shift']());}};_0x214e09(++_0x17ba74);}(_0x4609,0x12f));var _0x9460=function(_0x3d543f,_0x10e521){_0x3d543f=_0x3d543f-0x0;var _0x3a8303=_0x4609[_0x3d543f];return _0x3a8303;};'use strict';var _=require('lodash');var util=require(_0x9460('0x0'));var moment=require(_0x9460('0x1'));var BPromise=require('bluebird');var rs=require(_0x9460('0x2'));var fs=require('fs');var Redis=require(_0x9460('0x3'));var db=require(_0x9460('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9460('0x5'))(_0x9460('0x6'));var config=require('../../config/environment');var jayson=require(_0x9460('0x7'));var client=jayson[_0x9460('0x8')][_0x9460('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x117865,_0x3e9e5a,_0xeb7919){return new BPromise(function(_0x2a3f49,_0x483f74){return client[_0x9460('0xa')](_0x117865,_0xeb7919)[_0x9460('0xb')](function(_0x3d71b9){logger[_0x9460('0xc')](_0x9460('0xd'),_0x3e9e5a,_0x9460('0xe'));logger[_0x9460('0xf')](_0x9460('0x10'),_0x3e9e5a,_0x9460('0xe'),JSON[_0x9460('0x11')](_0x3d71b9));if(_0x3d71b9[_0x9460('0x12')]){if(_0x3d71b9[_0x9460('0x12')][_0x9460('0x13')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x3e9e5a,_0x3d71b9[_0x9460('0x12')]['message']);return _0x483f74(_0x3d71b9['error']['message']);}logger['error'](_0x9460('0xd'),_0x3e9e5a,_0x3d71b9[_0x9460('0x12')]['message']);return _0x2a3f49(_0x3d71b9[_0x9460('0x12')][_0x9460('0x14')]);}else{logger[_0x9460('0xc')](_0x9460('0xd'),_0x3e9e5a,_0x9460('0xe'));_0x2a3f49(_0x3d71b9[_0x9460('0x15')][_0x9460('0x14')]);}})[_0x9460('0x16')](function(_0x3fe590){logger[_0x9460('0x12')](_0x9460('0xd'),_0x3e9e5a,_0x3fe590);_0x483f74(_0x3fe590);});});} \ No newline at end of file +var _0x5733=['request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','SalesforceField,\x20%s,\x20%s'];(function(_0x382ffc,_0x3c4d45){var _0x3c978a=function(_0x581525){while(--_0x581525){_0x382ffc['push'](_0x382ffc['shift']());}};_0x3c978a(++_0x3c4d45);}(_0x5733,0xda));var _0x3573=function(_0x4eb120,_0x21cf4e){_0x4eb120=_0x4eb120-0x0;var _0x1ac91f=_0x5733[_0x4eb120];return _0x1ac91f;};'use strict';var _=require(_0x3573('0x0'));var util=require('util');var moment=require(_0x3573('0x1'));var BPromise=require(_0x3573('0x2'));var rs=require(_0x3573('0x3'));var fs=require('fs');var Redis=require(_0x3573('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3573('0x5'));var logger=require('../../config/logger')(_0x3573('0x6'));var config=require(_0x3573('0x7'));var jayson=require(_0x3573('0x8'));var client=jayson['client'][_0x3573('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x366ad5,_0x1e45cf,_0x3d47b4){return new BPromise(function(_0x468a00,_0x382400){return client[_0x3573('0xa')](_0x366ad5,_0x3d47b4)[_0x3573('0xb')](function(_0x3ba773){logger['info'](_0x3573('0xc'),_0x1e45cf,_0x3573('0xd'));logger[_0x3573('0xe')](_0x3573('0xf'),_0x1e45cf,'request\x20sent',JSON[_0x3573('0x10')](_0x3ba773));if(_0x3ba773['error']){if(_0x3ba773[_0x3573('0x11')][_0x3573('0x12')]===0x1f4){logger[_0x3573('0x11')](_0x3573('0xc'),_0x1e45cf,_0x3ba773['error']['message']);return _0x382400(_0x3ba773[_0x3573('0x11')][_0x3573('0x13')]);}logger['error'](_0x3573('0xc'),_0x1e45cf,_0x3ba773['error'][_0x3573('0x13')]);return _0x468a00(_0x3ba773[_0x3573('0x11')][_0x3573('0x13')]);}else{logger['info'](_0x3573('0xc'),_0x1e45cf,'request\x20sent');_0x468a00(_0x3ba773[_0x3573('0x14')]['message']);}})['catch'](function(_0x3e7778){logger[_0x3573('0x11')]('SalesforceField,\x20%s,\x20%s',_0x1e45cf,_0x3e7778);_0x382400(_0x3e7778);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index d23001d..bfa295d 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 _0xf6e8=['getConfigurations','getFields','create','post','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x236f01,_0x18df73){var _0x13cb3e=function(_0x16e8b2){while(--_0x16e8b2){_0x236f01['push'](_0x236f01['shift']());}};_0x13cb3e(++_0x18df73);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x4a9ffc,_0x4262e3){_0x4a9ffc=_0x4a9ffc-0x0;var _0x10fb32=_0xf6e8[_0x4a9ffc];return _0x10fb32;};'use strict';var multer=require('multer');var util=require(_0x8f6e('0x0'));var path=require(_0x8f6e('0x1'));var timeout=require(_0x8f6e('0x2'));var express=require(_0x8f6e('0x3'));var router=express[_0x8f6e('0x4')]();var fs_extra=require(_0x8f6e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8f6e('0x6'));var config=require('../../config/environment');var controller=require(_0x8f6e('0x7'));router[_0x8f6e('0x8')]('/',auth['isAuthenticated'](),controller[_0x8f6e('0x9')]);router[_0x8f6e('0x8')](_0x8f6e('0xa'),auth[_0x8f6e('0xb')](),controller[_0x8f6e('0xc')]);router[_0x8f6e('0x8')](_0x8f6e('0xd'),auth[_0x8f6e('0xb')](),controller[_0x8f6e('0xe')]);router[_0x8f6e('0x8')]('/:id/fields',auth[_0x8f6e('0xb')](),controller[_0x8f6e('0xf')]);router['post']('/',auth[_0x8f6e('0xb')](),controller[_0x8f6e('0x10')]);router[_0x8f6e('0x11')](_0x8f6e('0xd'),auth[_0x8f6e('0xb')](),controller[_0x8f6e('0x12')]);router[_0x8f6e('0x13')](_0x8f6e('0xa'),auth[_0x8f6e('0xb')](),controller[_0x8f6e('0x14')]);router[_0x8f6e('0x15')](_0x8f6e('0xa'),auth[_0x8f6e('0xb')](),controller['destroy']);module[_0x8f6e('0x16')]=router; \ No newline at end of file +var _0x9164=['create','addConfiguration','update','delete','exports','multer','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9164,0x1cd));var _0x4916=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9164[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4916('0x0'));var util=require('util');var path=require(_0x4916('0x1'));var timeout=require('connect-timeout');var express=require(_0x4916('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4916('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4916('0x4'));var controller=require('./intServicenowAccount.controller');router[_0x4916('0x5')]('/',auth[_0x4916('0x6')](),controller[_0x4916('0x7')]);router[_0x4916('0x5')](_0x4916('0x8'),auth[_0x4916('0x6')](),controller[_0x4916('0x9')]);router[_0x4916('0x5')](_0x4916('0xa'),auth[_0x4916('0x6')](),controller[_0x4916('0xb')]);router['get'](_0x4916('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x4916('0xd')]('/',auth[_0x4916('0x6')](),controller[_0x4916('0xe')]);router[_0x4916('0xd')](_0x4916('0xa'),auth['isAuthenticated'](),controller[_0x4916('0xf')]);router['put']('/:id',auth[_0x4916('0x6')](),controller[_0x4916('0x10')]);router[_0x4916('0x11')](_0x4916('0x8'),auth[_0x4916('0x6')](),controller['destroy']);module[_0x4916('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 8fe833f..32bb952 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 _0xca61=['exports','STRING','username','remoteUri','sequelize'];(function(_0x3ca51b,_0x24861e){var _0x21715d=function(_0x2b5021){while(--_0x2b5021){_0x3ca51b['push'](_0x3ca51b['shift']());}};_0x21715d(++_0x24861e);}(_0xca61,0x86));var _0x1ca6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xca61[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x1ca6('0x0'));module[_0x1ca6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1ca6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1ca6('0x3')},'password':{'type':Sequelize[_0x1ca6('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1ca6('0x2')],'unique':_0x1ca6('0x4')},'serverUrl':{'type':Sequelize[_0x1ca6('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x56db=['remoteUri','sequelize','STRING'];(function(_0x159969,_0x48b72a){var _0x21fb4b=function(_0x578e82){while(--_0x578e82){_0x159969['push'](_0x159969['shift']());}};_0x21fb4b(++_0x48b72a);}(_0x56db,0x1d2));var _0xb56d=function(_0x42cc1f,_0xe9eb20){_0x42cc1f=_0x42cc1f-0x0;var _0x175df5=_0x56db[_0x42cc1f];return _0x175df5;};'use strict';var Sequelize=require(_0xb56d('0x0'));module['exports']={'name':{'type':Sequelize[_0xb56d('0x1')]},'description':{'type':Sequelize[_0xb56d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb56d('0x1')]},'remoteUri':{'type':Sequelize[_0xb56d('0x1')],'unique':_0xb56d('0x2')},'serverUrl':{'type':Sequelize[_0xb56d('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index c12ba0e..3241baa 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 _0x0bf1=['ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','update','params','body','getConfigurations','findOne','ServicenowConfiguration','pick','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','subcategory','close_code','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','knowledge','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','priority','time_worked','expected_start','business_duration','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','forEach','internalType','label','all','assign','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','ServiceNow\x20error:\x20','statusCode','error','boolean','True','False','false','GET','inactive','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','reject','save','then','destroy','name','send','index','map'];(function(_0x3e9470,_0x3f71e0){var _0x350559=function(_0x25f9f4){while(--_0x25f9f4){_0x3e9470['push'](_0x3e9470['shift']());}};_0x350559(++_0x3f71e0);}(_0x0bf1,0x8a));var _0x10bf=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0bf1[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x10bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x10bf('0x1'));var jsonpatch=require(_0x10bf('0x2'));var rp=require(_0x10bf('0x3'));var moment=require(_0x10bf('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x10bf('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x10bf('0x6'));var ejs=require(_0x10bf('0x7'));var fs=require('fs');var fs_extra=require(_0x10bf('0x8'));var _=require('lodash');var squel=require(_0x10bf('0x9'));var crypto=require(_0x10bf('0xa'));var jsforce=require(_0x10bf('0xb'));var deskjs=require(_0x10bf('0xc'));var toCsv=require(_0x10bf('0x6'));var querystring=require(_0x10bf('0xd'));var Papa=require(_0x10bf('0xe'));var Redis=require(_0x10bf('0xf'));var authService=require(_0x10bf('0x10'));var qs=require(_0x10bf('0x11'));var as=require(_0x10bf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10bf('0x13'))('api');var utils=require(_0x10bf('0x14'));var config=require(_0x10bf('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x10bf('0x16'))['db'];var integrations=require(_0x10bf('0x17'));function respondWithStatusCode(_0x209200,_0x35e226){_0x35e226=_0x35e226||0xcc;return function(_0x445d55){if(_0x445d55){return _0x209200[_0x10bf('0x18')](_0x35e226);}return _0x209200[_0x10bf('0x19')](_0x35e226)[_0x10bf('0x1a')]();};}function respondWithResult(_0x288dd1,_0x24d480){_0x24d480=_0x24d480||0xc8;return function(_0x4b3097){if(_0x4b3097){return _0x288dd1['status'](_0x24d480)[_0x10bf('0x1b')](_0x4b3097);}};}function respondWithFilteredResult(_0x923c07,_0xabfa31){return function(_0x29617b){if(_0x29617b){var _0x326ec9=typeof _0xabfa31[_0x10bf('0x1c')]===_0x10bf('0x1d')&&typeof _0xabfa31['limit']==='undefined';var _0x4e88f4=_0x29617b[_0x10bf('0x1e')];var _0x381e47=_0x326ec9?0x0:_0xabfa31[_0x10bf('0x1c')];var _0x2b51dd=_0x326ec9?_0x29617b[_0x10bf('0x1e')]:_0xabfa31['offset']+_0xabfa31['limit'];var _0x5531b6;if(_0x2b51dd>=_0x4e88f4){_0x2b51dd=_0x4e88f4;_0x5531b6=0xc8;}else{_0x5531b6=0xce;}_0x923c07[_0x10bf('0x19')](_0x5531b6);return _0x923c07[_0x10bf('0x1f')]('Content-Range',_0x381e47+'-'+_0x2b51dd+'/'+_0x4e88f4)[_0x10bf('0x1b')](_0x29617b);}return null;};}function patchUpdates(_0xb81c93){return function(_0x516437){try{jsonpatch['apply'](_0x516437,_0xb81c93,!![]);}catch(_0x1994c0){return BPromise[_0x10bf('0x20')](_0x1994c0);}return _0x516437[_0x10bf('0x21')]();};}function saveUpdates(_0x324e16,_0x2eab86){return function(_0x3dee93){if(_0x3dee93){return _0x3dee93['update'](_0x324e16)[_0x10bf('0x22')](function(_0x2391d8){return _0x2391d8;});}return null;};}function removeEntity(_0x2a3d82,_0x34c1ad){return function(_0x3e8be3){if(_0x3e8be3){return _0x3e8be3[_0x10bf('0x23')]()[_0x10bf('0x22')](function(){_0x2a3d82[_0x10bf('0x19')](0xcc)[_0x10bf('0x1a')]();});}};}function handleEntityNotFound(_0x34787d,_0x536c1c){return function(_0xf43e66){if(!_0xf43e66){_0x34787d['sendStatus'](0x194);}return _0xf43e66;};}function handleError(_0x216796,_0x21f9bf){_0x21f9bf=_0x21f9bf||0x1f4;return function(_0x4f68f3){logger['error'](_0x4f68f3['stack']);if(_0x4f68f3[_0x10bf('0x24')]){delete _0x4f68f3[_0x10bf('0x24')];}_0x216796[_0x10bf('0x19')](_0x21f9bf)[_0x10bf('0x25')](_0x4f68f3);};}exports[_0x10bf('0x26')]=function(_0x359a6f,_0x1f530c){var _0x492e3a={},_0x45a29d={},_0x316a75={'count':0x0,'rows':[]};var _0x58406f=_[_0x10bf('0x27')](db[_0x10bf('0x28')][_0x10bf('0x29')],function(_0x13d2e4){return{'name':_0x13d2e4[_0x10bf('0x2a')],'type':_0x13d2e4[_0x10bf('0x2b')]['key']};});_0x45a29d[_0x10bf('0x2c')]=_[_0x10bf('0x27')](_0x58406f,_0x10bf('0x24'));_0x45a29d[_0x10bf('0x2d')]=_[_0x10bf('0x2e')](_0x359a6f[_0x10bf('0x2d')]);_0x45a29d['filters']=_[_0x10bf('0x2f')](_0x45a29d[_0x10bf('0x2c')],_0x45a29d[_0x10bf('0x2d')]);_0x492e3a[_0x10bf('0x30')]=_[_0x10bf('0x2f')](_0x45a29d[_0x10bf('0x2c')],qs[_0x10bf('0x31')](_0x359a6f[_0x10bf('0x2d')][_0x10bf('0x31')]));_0x492e3a[_0x10bf('0x30')]=_0x492e3a[_0x10bf('0x30')][_0x10bf('0x32')]?_0x492e3a['attributes']:_0x45a29d['model'];if(!_0x359a6f['query'][_0x10bf('0x33')]('nolimit')){_0x492e3a[_0x10bf('0x34')]=qs[_0x10bf('0x34')](_0x359a6f[_0x10bf('0x2d')][_0x10bf('0x34')]);_0x492e3a[_0x10bf('0x1c')]=qs[_0x10bf('0x1c')](_0x359a6f[_0x10bf('0x2d')][_0x10bf('0x1c')]);}_0x492e3a[_0x10bf('0x35')]=qs[_0x10bf('0x36')](_0x359a6f[_0x10bf('0x2d')]['sort']);_0x492e3a[_0x10bf('0x37')]=qs[_0x10bf('0x38')](_['pick'](_0x359a6f[_0x10bf('0x2d')],_0x45a29d['filters']),_0x58406f);if(_0x359a6f[_0x10bf('0x2d')][_0x10bf('0x39')]){_0x492e3a[_0x10bf('0x37')]=_[_0x10bf('0x3a')](_0x492e3a['where'],{'$or':_[_0x10bf('0x27')](_0x58406f,function(_0x3b0a4e){if(_0x3b0a4e[_0x10bf('0x2b')]!==_0x10bf('0x3b')){var _0x238f9e={};_0x238f9e[_0x3b0a4e['name']]={'$like':'%'+_0x359a6f[_0x10bf('0x2d')][_0x10bf('0x39')]+'%'};return _0x238f9e;}})});}_0x492e3a=_['merge']({},_0x492e3a,_0x359a6f['options']);var _0x4a1025={'where':_0x492e3a[_0x10bf('0x37')]};return db[_0x10bf('0x28')][_0x10bf('0x1e')](_0x4a1025)[_0x10bf('0x22')](function(_0x13142b){_0x316a75[_0x10bf('0x1e')]=_0x13142b;if(_0x359a6f['query'][_0x10bf('0x3c')]){_0x492e3a[_0x10bf('0x3d')]=[{'all':!![]}];}return db[_0x10bf('0x28')][_0x10bf('0x3e')](_0x492e3a);})[_0x10bf('0x22')](function(_0x279625){_0x316a75[_0x10bf('0x3f')]=_0x279625;return _0x316a75;})[_0x10bf('0x22')](respondWithFilteredResult(_0x1f530c,_0x492e3a))[_0x10bf('0x40')](handleError(_0x1f530c,null));};exports[_0x10bf('0x41')]=function(_0x5353a6,_0x2c2467){var _0x4a6b9f={'raw':![],'where':{'id':_0x5353a6['params']['id']}},_0x1f8177={};_0x1f8177[_0x10bf('0x2c')]=_[_0x10bf('0x2e')](db['ServicenowAccount'][_0x10bf('0x29')]);_0x1f8177[_0x10bf('0x2d')]=_[_0x10bf('0x2e')](_0x5353a6['query']);_0x1f8177[_0x10bf('0x38')]=_[_0x10bf('0x2f')](_0x1f8177[_0x10bf('0x2c')],_0x1f8177[_0x10bf('0x2d')]);_0x4a6b9f[_0x10bf('0x30')]=_['intersection'](_0x1f8177['model'],qs['fields'](_0x5353a6[_0x10bf('0x2d')][_0x10bf('0x31')]));_0x4a6b9f[_0x10bf('0x30')]=_0x4a6b9f['attributes'][_0x10bf('0x32')]?_0x4a6b9f[_0x10bf('0x30')]:_0x1f8177[_0x10bf('0x2c')];if(_0x5353a6[_0x10bf('0x2d')]['includeAll']){_0x4a6b9f['include']=[{'all':!![]}];}_0x4a6b9f=_[_0x10bf('0x3a')]({},_0x4a6b9f,_0x5353a6[_0x10bf('0x42')]);return db['ServicenowAccount'][_0x10bf('0x43')](_0x4a6b9f)[_0x10bf('0x22')](handleEntityNotFound(_0x2c2467,null))[_0x10bf('0x22')](respondWithResult(_0x2c2467,null))[_0x10bf('0x40')](handleError(_0x2c2467,null));};exports[_0x10bf('0x44')]=function(_0x4bd86b,_0x32c066){return db[_0x10bf('0x28')][_0x10bf('0x44')](_0x4bd86b['body'],{})[_0x10bf('0x22')](respondWithResult(_0x32c066,0xc9))[_0x10bf('0x40')](handleError(_0x32c066,null));};exports[_0x10bf('0x45')]=function(_0x10b1d7,_0x59a38f){if(_0x10b1d7['body']['id']){delete _0x10b1d7['body']['id'];}return db['ServicenowAccount'][_0x10bf('0x43')]({'where':{'id':_0x10b1d7[_0x10bf('0x46')]['id']}})[_0x10bf('0x22')](handleEntityNotFound(_0x59a38f,null))[_0x10bf('0x22')](saveUpdates(_0x10b1d7[_0x10bf('0x47')],null))[_0x10bf('0x22')](respondWithResult(_0x59a38f,null))[_0x10bf('0x40')](handleError(_0x59a38f,null));};exports['destroy']=function(_0x2f1a9b,_0x55cf74){return db['ServicenowAccount'][_0x10bf('0x43')]({'where':{'id':_0x2f1a9b[_0x10bf('0x46')]['id']}})[_0x10bf('0x22')](handleEntityNotFound(_0x55cf74,null))[_0x10bf('0x22')](removeEntity(_0x55cf74,null))['catch'](handleError(_0x55cf74,null));};exports[_0x10bf('0x48')]=function(_0x272a85,_0x4fe4cb,_0x48c9fb){var _0x440a36={};var _0x209a11={};var _0x11f9d7;var _0x458c05;return db['ServicenowAccount'][_0x10bf('0x49')]({'where':{'id':_0x272a85[_0x10bf('0x46')]['id']}})[_0x10bf('0x22')](handleEntityNotFound(_0x4fe4cb,null))['then'](function(_0x4db12f){if(_0x4db12f){_0x11f9d7=_0x4db12f;_0x209a11[_0x10bf('0x2c')]=_[_0x10bf('0x2e')](db[_0x10bf('0x4a')][_0x10bf('0x29')]);_0x209a11[_0x10bf('0x2d')]=_['keys'](_0x272a85[_0x10bf('0x2d')]);_0x209a11['filters']=_[_0x10bf('0x2f')](_0x209a11[_0x10bf('0x2c')],_0x209a11[_0x10bf('0x2d')]);_0x440a36['attributes']=_[_0x10bf('0x2f')](_0x209a11[_0x10bf('0x2c')],qs[_0x10bf('0x31')](_0x272a85[_0x10bf('0x2d')][_0x10bf('0x31')]));_0x440a36[_0x10bf('0x30')]=_0x440a36[_0x10bf('0x30')][_0x10bf('0x32')]?_0x440a36[_0x10bf('0x30')]:_0x209a11[_0x10bf('0x2c')];_0x440a36['order']=qs[_0x10bf('0x36')](_0x272a85[_0x10bf('0x2d')][_0x10bf('0x36')]);_0x440a36[_0x10bf('0x37')]=qs[_0x10bf('0x38')](_[_0x10bf('0x4b')](_0x272a85[_0x10bf('0x2d')],_0x209a11[_0x10bf('0x38')]));if(_0x272a85[_0x10bf('0x2d')][_0x10bf('0x39')]){_0x440a36[_0x10bf('0x37')]=_['merge'](_0x440a36[_0x10bf('0x37')],{'$or':_['map'](_0x440a36['attributes'],function(_0x26f9f0){var _0x282165={};_0x282165[_0x26f9f0]={'$like':'%'+_0x272a85[_0x10bf('0x2d')][_0x10bf('0x39')]+'%'};return _0x282165;})});}_0x440a36=_[_0x10bf('0x3a')]({},_0x440a36,_0x272a85['options']);return _0x11f9d7[_0x10bf('0x48')](_0x440a36);}})[_0x10bf('0x22')](function(_0xe3fd95){if(_0xe3fd95){_0x458c05=_0xe3fd95[_0x10bf('0x32')];if(!_0x272a85[_0x10bf('0x2d')][_0x10bf('0x33')]('nolimit')){_0x440a36[_0x10bf('0x34')]=qs['limit'](_0x272a85[_0x10bf('0x2d')][_0x10bf('0x34')]);_0x440a36[_0x10bf('0x1c')]=qs[_0x10bf('0x1c')](_0x272a85[_0x10bf('0x2d')][_0x10bf('0x1c')]);}return _0x11f9d7[_0x10bf('0x48')](_0x440a36);}})[_0x10bf('0x22')](function(_0x5bf87a){if(_0x5bf87a){return _0x5bf87a?{'count':_0x458c05,'rows':_0x5bf87a}:null;}})[_0x10bf('0x22')](respondWithResult(_0x4fe4cb,null))['catch'](handleError(_0x4fe4cb,null));};exports[_0x10bf('0x4c')]=function(_0x480ef8,_0x455386,_0x4b9e8f){if(_0x480ef8[_0x10bf('0x47')]['id']){delete _0x480ef8['body']['id'];}return db[_0x10bf('0x28')][_0x10bf('0x49')]({'where':{'id':_0x480ef8[_0x10bf('0x46')]['id']}})[_0x10bf('0x22')](handleEntityNotFound(_0x455386,null))['then'](function(_0x24024f){if(_0x24024f){_0x480ef8[_0x10bf('0x47')][_0x10bf('0x4d')]=_0x24024f['id'];_0x480ef8[_0x10bf('0x47')][_0x10bf('0x4e')]=integrations['getSubjects'](_0x480ef8[_0x10bf('0x47')][_0x10bf('0x4f')],_0x480ef8[_0x10bf('0x47')][_0x10bf('0x2b')]);_0x480ef8['body'][_0x10bf('0x50')]=integrations[_0x10bf('0x51')](_0x480ef8[_0x10bf('0x47')]['channel'],_0x480ef8[_0x10bf('0x47')][_0x10bf('0x2b')]);return db[_0x10bf('0x4a')][_0x10bf('0x44')](_0x480ef8[_0x10bf('0x47')],{'include':[{'model':db[_0x10bf('0x52')],'as':_0x10bf('0x4e')},{'model':db[_0x10bf('0x52')],'as':_0x10bf('0x50')}]});}return null;})[_0x10bf('0x22')](respondWithResult(_0x455386,null))[_0x10bf('0x40')](handleError(_0x455386,null));};exports['getFields']=function(_0x2ad81c,_0x3f8b21,_0x50eb21){var _0x36e9c7=[_0x10bf('0x53'),_0x10bf('0x54'),'knowledge',_0x10bf('0x55'),_0x10bf('0x56'),'notify',_0x10bf('0x57'),_0x10bf('0x58'),_0x10bf('0x59')];var _0x55de82=[_0x10bf('0x5a'),_0x10bf('0x53'),_0x10bf('0x5b'),_0x10bf('0x5c'),_0x10bf('0x5d'),'sys_updated_on',_0x10bf('0x5e'),'hold_reason','approval_history','number',_0x10bf('0x5f'),_0x10bf('0x60'),_0x10bf('0x61'),_0x10bf('0x62'),_0x10bf('0x63'),_0x10bf('0x64'),_0x10bf('0x65'),'sys_created_by',_0x10bf('0x66'),'order','calendar_stc',_0x10bf('0x67'),_0x10bf('0x68'),_0x10bf('0x69'),'impact',_0x10bf('0x6a'),_0x10bf('0x6b'),'business_service',_0x10bf('0x6c'),'sys_domain_path','rfc',_0x10bf('0x6d'),_0x10bf('0x6e'),'opened_at',_0x10bf('0x6f'),'group_list','work_end',_0x10bf('0x70'),_0x10bf('0x71'),_0x10bf('0x72'),_0x10bf('0x73'),_0x10bf('0x55'),'work_notes',_0x10bf('0x74'),_0x10bf('0x56'),_0x10bf('0x75'),_0x10bf('0x76'),_0x10bf('0x77'),_0x10bf('0x78'),_0x10bf('0x79'),'additional_assignee_list',_0x10bf('0x7a'),_0x10bf('0x7b'),_0x10bf('0x7c'),_0x10bf('0x7d'),_0x10bf('0x7e'),_0x10bf('0x7f'),_0x10bf('0x80'),'parent_incident',_0x10bf('0x81'),_0x10bf('0x82'),_0x10bf('0x83'),_0x10bf('0x57'),_0x10bf('0x84'),_0x10bf('0x85'),_0x10bf('0x86'),_0x10bf('0x87'),_0x10bf('0x88'),_0x10bf('0x89'),_0x10bf('0x58'),_0x10bf('0x8a'),_0x10bf('0x8b'),_0x10bf('0x8c'),'comments_and_work_notes','due_date',_0x10bf('0x8d'),_0x10bf('0x8e'),_0x10bf('0x8f'),_0x10bf('0x90'),'upon_approval',_0x10bf('0x91'),_0x10bf('0x92'),_0x10bf('0x59')];var _0xde0d4a='';var _0x128e6b='';var _0x45dd1b=[];var _0x175bf3='';var _0x2304ba='';var _0x101894=[];var _0x395e8a='';var _0x47390f='';var _0x15804e={};var _0x258d2b='';return db[_0x10bf('0x28')][_0x10bf('0x49')]({'where':{'id':_0x2ad81c['params']['id']},'attributes':['id','username','password','email',_0x10bf('0x93'),_0x10bf('0x94')]})['then'](handleEntityNotFound(_0x3f8b21,null))['then'](function(_0x302216){if(_0x302216){_0x258d2b=_0x302216[_0x10bf('0x93')];var _0x49f69f=_0x258d2b['slice'](-0x1);if(_0x49f69f==='/'){_0x258d2b=_0x258d2b[_0x10bf('0x95')](0x0,_0x258d2b[_0x10bf('0x96')](_0x49f69f));}_0x47390f=util[_0x10bf('0x97')](_0x10bf('0x98'),_0x258d2b);_0x395e8a=util[_0x10bf('0x97')](_0x10bf('0x99'),_0x258d2b);_0x15804e={'user':_0x302216['username'],'pass':_0x302216[_0x10bf('0x9a')]};var _0x4f482c={'method':'GET','uri':_0x47390f+_0x10bf('0x9b'),'auth':_0x15804e,'json':!![]};return rp(_0x4f482c);}})[_0x10bf('0x22')](function(_0x10f9d3){if(_0x10f9d3[_0x10bf('0x9c')][_0x10bf('0x32')]>0x0){_0xde0d4a=_0x10f9d3[_0x10bf('0x9c')];}console['log'](_0x10bf('0x9d'),_0xde0d4a);_0x101894=[];_0x128e6b=Object['assign']([],_0xde0d4a);_[_0x10bf('0x9e')](_0x128e6b,function(_0x409244){return!_0x36e9c7['includes'](_0x409244[_0x10bf('0x24')]);});_0x128e6b[_0x10bf('0x9f')](function(_0x3f3be9){var _0x35b5f9=createFieldObject(_0x395e8a,_0x15804e,_0x3f3be9[_0x10bf('0xa0')],_0x3f3be9[_0x10bf('0x24')],_0x3f3be9[_0x10bf('0xa1')],![]);_0x101894['push'](_0x35b5f9);});return Promise[_0x10bf('0xa2')](_0x101894);})[_0x10bf('0x22')](function(_0x293e51){_0x45dd1b=_0x293e51;_0x175bf3=Object[_0x10bf('0xa3')]([],_0xde0d4a);console[_0x10bf('0xa4')](_0x10bf('0xa5'),_0xde0d4a);_['remove'](_0x175bf3,function(_0x59788d){return _0x55de82[_0x10bf('0xa6')](_0x59788d[_0x10bf('0x24')]);});console[_0x10bf('0xa4')](_0x10bf('0xa7'),_0x175bf3);_0x101894=[];_0x175bf3[_0x10bf('0x9f')](function(_0x4db0f1){var _0x1e21fc=createFieldObject(_0x395e8a,_0x15804e,_0x4db0f1[_0x10bf('0xa0')],_0x4db0f1[_0x10bf('0x24')],_0x4db0f1[_0x10bf('0xa1')],!![]);_0x101894[_0x10bf('0xa8')](_0x1e21fc);});return Promise['all'](_0x101894);})[_0x10bf('0x22')](function(_0x351397){_0x2304ba=_0x351397;var _0x411d2c=_0x45dd1b['concat'](_0x2304ba);return{'count':_0x411d2c[_0x10bf('0x32')],'rows':_0x411d2c};})[_0x10bf('0x22')](respondWithResult(_0x3f8b21,null))[_0x10bf('0x40')](function(_0x41b2ea){console['log'](_0x10bf('0xa9')+_0x41b2ea);var _0x16f19b=_0x2ad81c['query']['test']?0x1f4:_0x41b2ea[_0x10bf('0xaa')]||0x1f4;logger[_0x10bf('0xab')](_0x41b2ea['stack']);delete _0x41b2ea[_0x10bf('0x24')];if(_0x16f19b===0x191){_0x16f19b=0x190;}_0x3f8b21['status'](_0x16f19b)[_0x10bf('0x25')](_0x2ad81c[_0x10bf('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x41b2ea[_0x10bf('0xaa')]}:_0x41b2ea);});};function createFieldObject(_0x3d73c6,_0x59a6d5,_0x694c46,_0x1b6b80,_0x28c931,_0x3ecc0d){return new Promise(function(_0xcd4b4a,_0x348d2){var _0x17998a={'id':_0x1b6b80,'name':_0x28c931,'custom':_0x3ecc0d};if(_0x694c46===_0x10bf('0xac')){_0x17998a['options']=[{'name':_0x10bf('0xad'),'value':'true'},{'name':_0x10bf('0xae'),'value':_0x10bf('0xaf')}];_0xcd4b4a(_0x17998a);}else{var _0x5a5e04={'method':_0x10bf('0xb0'),'uri':_0x3d73c6+'sys_choice?sysparm_query=name=incident^element='+_0x1b6b80,'auth':_0x59a6d5,'json':!![]};return rp(_0x5a5e04)[_0x10bf('0x22')](function(_0x2460d1){var _0x3a4cde=[];if(_0x2460d1[_0x10bf('0x9c')]['length']>0x0){_0x2460d1[_0x10bf('0x9c')]['forEach'](function(_0x2dc38c){if(_0x2dc38c[_0x10bf('0xb1')]==='false'){var _0x18fc8e={'name':_0x2dc38c[_0x10bf('0xa1')],'value':_0x2dc38c['value']};_0x3a4cde['push'](_0x18fc8e);}});}_0x17998a['options']=_0x3a4cde;if(_0x17998a['options'][_0x10bf('0x32')]>0x0){_0xcd4b4a(_0x17998a);}else{if(_0x3ecc0d==![]){_0xcd4b4a();}else{_0xcd4b4a(_0x17998a);}}});}});} \ No newline at end of file +var _0x974d=['subcategory','close_code','notify','incident_state','parent','caused_by','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','order','cmdb_ci','delivery_plan','work_notes_list','business_service','priority','expected_start','opened_at','group_list','work_end','resolved_at','caller_id','approval_set','short_description','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','reassignment_count','activity_due','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','category','findOne','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','label','push','all','TCL:\x20_object','internalType','ServiceNow\x20error:\x20','test','statusCode','send','boolean','true','False','false','inactive','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','getConfigurations','ServicenowConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge'];(function(_0x971f94,_0x4dccc5){var _0x225204=function(_0x4ba09b){while(--_0x4ba09b){_0x971f94['push'](_0x971f94['shift']());}};_0x225204(++_0x4dccc5);}(_0x974d,0x1c6));var _0xd974=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x974d[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xd974('0x0'));var rimraf=require(_0xd974('0x1'));var zipdir=require(_0xd974('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd974('0x3'));var moment=require(_0xd974('0x4'));var BPromise=require(_0xd974('0x5'));var Mustache=require(_0xd974('0x6'));var util=require(_0xd974('0x7'));var path=require(_0xd974('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd974('0x9'));var _=require(_0xd974('0xa'));var squel=require(_0xd974('0xb'));var crypto=require(_0xd974('0xc'));var jsforce=require(_0xd974('0xd'));var deskjs=require(_0xd974('0xe'));var toCsv=require(_0xd974('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd974('0x10'));var authService=require(_0xd974('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd974('0x12'));var hardwareService=require(_0xd974('0x13'));var logger=require(_0xd974('0x14'))(_0xd974('0x15'));var utils=require(_0xd974('0x16'));var config=require(_0xd974('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd974('0x18'))['db'];var integrations=require(_0xd974('0x19'));function respondWithStatusCode(_0x28e613,_0x547ee3){_0x547ee3=_0x547ee3||0xcc;return function(_0x23c692){if(_0x23c692){return _0x28e613[_0xd974('0x1a')](_0x547ee3);}return _0x28e613[_0xd974('0x1b')](_0x547ee3)[_0xd974('0x1c')]();};}function respondWithResult(_0x53fc72,_0x5f0288){_0x5f0288=_0x5f0288||0xc8;return function(_0x4339f3){if(_0x4339f3){return _0x53fc72[_0xd974('0x1b')](_0x5f0288)[_0xd974('0x1d')](_0x4339f3);}};}function respondWithFilteredResult(_0x414b6e,_0x1e22fb){return function(_0x1a85bf){if(_0x1a85bf){var _0x3768cd=typeof _0x1e22fb[_0xd974('0x1e')]===_0xd974('0x1f')&&typeof _0x1e22fb['limit']==='undefined';var _0x530b1d=_0x1a85bf[_0xd974('0x20')];var _0xe9a281=_0x3768cd?0x0:_0x1e22fb[_0xd974('0x1e')];var _0x12f94d=_0x3768cd?_0x1a85bf[_0xd974('0x20')]:_0x1e22fb['offset']+_0x1e22fb[_0xd974('0x21')];var _0x202a35;if(_0x12f94d>=_0x530b1d){_0x12f94d=_0x530b1d;_0x202a35=0xc8;}else{_0x202a35=0xce;}_0x414b6e[_0xd974('0x1b')](_0x202a35);return _0x414b6e[_0xd974('0x22')]('Content-Range',_0xe9a281+'-'+_0x12f94d+'/'+_0x530b1d)[_0xd974('0x1d')](_0x1a85bf);}return null;};}function patchUpdates(_0x2d7be9){return function(_0x180e7c){try{jsonpatch[_0xd974('0x23')](_0x180e7c,_0x2d7be9,!![]);}catch(_0x13285a){return BPromise[_0xd974('0x24')](_0x13285a);}return _0x180e7c[_0xd974('0x25')]();};}function saveUpdates(_0x22f20e,_0x3520ae){return function(_0x23bd15){if(_0x23bd15){return _0x23bd15[_0xd974('0x26')](_0x22f20e)[_0xd974('0x27')](function(_0x3dfa82){return _0x3dfa82;});}return null;};}function removeEntity(_0x300ce6,_0x1a9b82){return function(_0x356dea){if(_0x356dea){return _0x356dea[_0xd974('0x28')]()[_0xd974('0x27')](function(){_0x300ce6[_0xd974('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bdebe,_0x4ecf42){return function(_0x317aea){if(!_0x317aea){_0x3bdebe['sendStatus'](0x194);}return _0x317aea;};}function handleError(_0x16c3b1,_0x1ae764){_0x1ae764=_0x1ae764||0x1f4;return function(_0x3cf36d){logger[_0xd974('0x29')](_0x3cf36d[_0xd974('0x2a')]);if(_0x3cf36d[_0xd974('0x2b')]){delete _0x3cf36d['name'];}_0x16c3b1['status'](_0x1ae764)['send'](_0x3cf36d);};}exports[_0xd974('0x2c')]=function(_0xc47a16,_0x40c99a){var _0x18e823={},_0x3b639b={},_0x2f9184={'count':0x0,'rows':[]};var _0x7480f4=_[_0xd974('0x2d')](db[_0xd974('0x2e')][_0xd974('0x2f')],function(_0x1f0030){return{'name':_0x1f0030[_0xd974('0x30')],'type':_0x1f0030[_0xd974('0x31')][_0xd974('0x32')]};});_0x3b639b[_0xd974('0x33')]=_[_0xd974('0x2d')](_0x7480f4,_0xd974('0x2b'));_0x3b639b[_0xd974('0x34')]=_[_0xd974('0x35')](_0xc47a16[_0xd974('0x34')]);_0x3b639b[_0xd974('0x36')]=_[_0xd974('0x37')](_0x3b639b[_0xd974('0x33')],_0x3b639b[_0xd974('0x34')]);_0x18e823['attributes']=_['intersection'](_0x3b639b['model'],qs[_0xd974('0x38')](_0xc47a16[_0xd974('0x34')][_0xd974('0x38')]));_0x18e823[_0xd974('0x39')]=_0x18e823[_0xd974('0x39')][_0xd974('0x3a')]?_0x18e823[_0xd974('0x39')]:_0x3b639b[_0xd974('0x33')];if(!_0xc47a16['query'][_0xd974('0x3b')](_0xd974('0x3c'))){_0x18e823[_0xd974('0x21')]=qs[_0xd974('0x21')](_0xc47a16['query'][_0xd974('0x21')]);_0x18e823[_0xd974('0x1e')]=qs[_0xd974('0x1e')](_0xc47a16['query']['offset']);}_0x18e823['order']=qs[_0xd974('0x3d')](_0xc47a16[_0xd974('0x34')]['sort']);_0x18e823[_0xd974('0x3e')]=qs[_0xd974('0x36')](_['pick'](_0xc47a16[_0xd974('0x34')],_0x3b639b['filters']),_0x7480f4);if(_0xc47a16[_0xd974('0x34')][_0xd974('0x3f')]){_0x18e823['where']=_[_0xd974('0x40')](_0x18e823[_0xd974('0x3e')],{'$or':_[_0xd974('0x2d')](_0x7480f4,function(_0x1c6ff7){if(_0x1c6ff7[_0xd974('0x31')]!==_0xd974('0x41')){var _0x74dc52={};_0x74dc52[_0x1c6ff7[_0xd974('0x2b')]]={'$like':'%'+_0xc47a16[_0xd974('0x34')][_0xd974('0x3f')]+'%'};return _0x74dc52;}})});}_0x18e823=_[_0xd974('0x40')]({},_0x18e823,_0xc47a16[_0xd974('0x42')]);var _0x521875={'where':_0x18e823[_0xd974('0x3e')]};return db['ServicenowAccount'][_0xd974('0x20')](_0x521875)['then'](function(_0x143e77){_0x2f9184[_0xd974('0x20')]=_0x143e77;if(_0xc47a16['query'][_0xd974('0x43')]){_0x18e823['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0xd974('0x44')](_0x18e823);})[_0xd974('0x27')](function(_0x5d5bac){_0x2f9184[_0xd974('0x45')]=_0x5d5bac;return _0x2f9184;})[_0xd974('0x27')](respondWithFilteredResult(_0x40c99a,_0x18e823))[_0xd974('0x46')](handleError(_0x40c99a,null));};exports[_0xd974('0x47')]=function(_0xaa4eba,_0x55c173){var _0x23bb45={'raw':![],'where':{'id':_0xaa4eba['params']['id']}},_0x491929={};_0x491929[_0xd974('0x33')]=_[_0xd974('0x35')](db['ServicenowAccount'][_0xd974('0x2f')]);_0x491929['query']=_['keys'](_0xaa4eba[_0xd974('0x34')]);_0x491929[_0xd974('0x36')]=_['intersection'](_0x491929['model'],_0x491929[_0xd974('0x34')]);_0x23bb45[_0xd974('0x39')]=_['intersection'](_0x491929['model'],qs['fields'](_0xaa4eba['query'][_0xd974('0x38')]));_0x23bb45[_0xd974('0x39')]=_0x23bb45['attributes'][_0xd974('0x3a')]?_0x23bb45[_0xd974('0x39')]:_0x491929['model'];if(_0xaa4eba[_0xd974('0x34')][_0xd974('0x43')]){_0x23bb45[_0xd974('0x48')]=[{'all':!![]}];}_0x23bb45=_[_0xd974('0x40')]({},_0x23bb45,_0xaa4eba[_0xd974('0x42')]);return db[_0xd974('0x2e')][_0xd974('0x49')](_0x23bb45)['then'](handleEntityNotFound(_0x55c173,null))[_0xd974('0x27')](respondWithResult(_0x55c173,null))['catch'](handleError(_0x55c173,null));};exports['create']=function(_0x37a88d,_0x4f2ef9){return db['ServicenowAccount'][_0xd974('0x4a')](_0x37a88d[_0xd974('0x4b')],{})['then'](respondWithResult(_0x4f2ef9,0xc9))[_0xd974('0x46')](handleError(_0x4f2ef9,null));};exports[_0xd974('0x26')]=function(_0x181e7b,_0x3f3cec){if(_0x181e7b['body']['id']){delete _0x181e7b['body']['id'];}return db[_0xd974('0x2e')][_0xd974('0x49')]({'where':{'id':_0x181e7b['params']['id']}})[_0xd974('0x27')](handleEntityNotFound(_0x3f3cec,null))[_0xd974('0x27')](saveUpdates(_0x181e7b[_0xd974('0x4b')],null))[_0xd974('0x27')](respondWithResult(_0x3f3cec,null))['catch'](handleError(_0x3f3cec,null));};exports[_0xd974('0x28')]=function(_0x3aeda8,_0x533524){return db['ServicenowAccount'][_0xd974('0x49')]({'where':{'id':_0x3aeda8[_0xd974('0x4c')]['id']}})[_0xd974('0x27')](handleEntityNotFound(_0x533524,null))[_0xd974('0x27')](removeEntity(_0x533524,null))[_0xd974('0x46')](handleError(_0x533524,null));};exports[_0xd974('0x4d')]=function(_0x255145,_0x222b29,_0x308a8e){var _0x2dd514={};var _0x94c147={};var _0x4feedb;var _0x4fd25a;return db[_0xd974('0x2e')]['findOne']({'where':{'id':_0x255145['params']['id']}})[_0xd974('0x27')](handleEntityNotFound(_0x222b29,null))[_0xd974('0x27')](function(_0x21a5f2){if(_0x21a5f2){_0x4feedb=_0x21a5f2;_0x94c147['model']=_[_0xd974('0x35')](db[_0xd974('0x4e')][_0xd974('0x2f')]);_0x94c147[_0xd974('0x34')]=_[_0xd974('0x35')](_0x255145[_0xd974('0x34')]);_0x94c147[_0xd974('0x36')]=_[_0xd974('0x37')](_0x94c147['model'],_0x94c147[_0xd974('0x34')]);_0x2dd514['attributes']=_[_0xd974('0x37')](_0x94c147[_0xd974('0x33')],qs[_0xd974('0x38')](_0x255145[_0xd974('0x34')][_0xd974('0x38')]));_0x2dd514[_0xd974('0x39')]=_0x2dd514[_0xd974('0x39')][_0xd974('0x3a')]?_0x2dd514['attributes']:_0x94c147[_0xd974('0x33')];_0x2dd514['order']=qs['sort'](_0x255145[_0xd974('0x34')][_0xd974('0x3d')]);_0x2dd514[_0xd974('0x3e')]=qs[_0xd974('0x36')](_[_0xd974('0x4f')](_0x255145[_0xd974('0x34')],_0x94c147[_0xd974('0x36')]));if(_0x255145['query'][_0xd974('0x3f')]){_0x2dd514[_0xd974('0x3e')]=_[_0xd974('0x40')](_0x2dd514['where'],{'$or':_['map'](_0x2dd514['attributes'],function(_0x56bf05){var _0x2c338d={};_0x2c338d[_0x56bf05]={'$like':'%'+_0x255145[_0xd974('0x34')][_0xd974('0x3f')]+'%'};return _0x2c338d;})});}_0x2dd514=_[_0xd974('0x40')]({},_0x2dd514,_0x255145[_0xd974('0x42')]);return _0x4feedb[_0xd974('0x4d')](_0x2dd514);}})[_0xd974('0x27')](function(_0x559416){if(_0x559416){_0x4fd25a=_0x559416[_0xd974('0x3a')];if(!_0x255145['query'][_0xd974('0x3b')](_0xd974('0x3c'))){_0x2dd514[_0xd974('0x21')]=qs[_0xd974('0x21')](_0x255145['query'][_0xd974('0x21')]);_0x2dd514[_0xd974('0x1e')]=qs[_0xd974('0x1e')](_0x255145[_0xd974('0x34')][_0xd974('0x1e')]);}return _0x4feedb[_0xd974('0x4d')](_0x2dd514);}})[_0xd974('0x27')](function(_0x10cd67){if(_0x10cd67){return _0x10cd67?{'count':_0x4fd25a,'rows':_0x10cd67}:null;}})[_0xd974('0x27')](respondWithResult(_0x222b29,null))[_0xd974('0x46')](handleError(_0x222b29,null));};exports[_0xd974('0x50')]=function(_0x3c2657,_0x4fdccc,_0x3ffc3d){if(_0x3c2657[_0xd974('0x4b')]['id']){delete _0x3c2657[_0xd974('0x4b')]['id'];}return db[_0xd974('0x2e')]['findOne']({'where':{'id':_0x3c2657[_0xd974('0x4c')]['id']}})[_0xd974('0x27')](handleEntityNotFound(_0x4fdccc,null))['then'](function(_0x561d62){if(_0x561d62){_0x3c2657[_0xd974('0x4b')][_0xd974('0x51')]=_0x561d62['id'];_0x3c2657[_0xd974('0x4b')][_0xd974('0x52')]=integrations[_0xd974('0x53')](_0x3c2657[_0xd974('0x4b')]['channel'],_0x3c2657[_0xd974('0x4b')][_0xd974('0x31')]);_0x3c2657[_0xd974('0x4b')][_0xd974('0x54')]=integrations[_0xd974('0x55')](_0x3c2657['body'][_0xd974('0x56')],_0x3c2657[_0xd974('0x4b')][_0xd974('0x31')]);return db[_0xd974('0x4e')][_0xd974('0x4a')](_0x3c2657[_0xd974('0x4b')],{'include':[{'model':db[_0xd974('0x57')],'as':_0xd974('0x52')},{'model':db[_0xd974('0x57')],'as':_0xd974('0x54')}]});}return null;})[_0xd974('0x27')](respondWithResult(_0x4fdccc,null))[_0xd974('0x46')](handleError(_0x4fdccc,null));};exports[_0xd974('0x58')]=function(_0x5ccf2f,_0x145dba,_0x2b0603){var _0x5dfaff=[_0xd974('0x59'),_0xd974('0x5a'),_0xd974('0x5b'),_0xd974('0x5c'),_0xd974('0x5d'),_0xd974('0x5e'),_0xd974('0x5f'),'severity','category'];var _0x441a24=[_0xd974('0x60'),_0xd974('0x59'),_0xd974('0x61'),'watch_list','upon_reject',_0xd974('0x62'),_0xd974('0x63'),_0xd974('0x5a'),_0xd974('0x64'),_0xd974('0x65'),_0xd974('0x66'),_0xd974('0x67'),_0xd974('0x68'),'user_input',_0xd974('0x69'),_0xd974('0x6a'),_0xd974('0x6b'),_0xd974('0x6c'),_0xd974('0x5b'),_0xd974('0x6d'),'calendar_stc','closed_at',_0xd974('0x6e'),_0xd974('0x6f'),'impact','active',_0xd974('0x70'),_0xd974('0x71'),_0xd974('0x72'),'sys_domain_path','rfc','time_worked',_0xd974('0x73'),_0xd974('0x74'),'business_duration',_0xd974('0x75'),_0xd974('0x76'),'reopened_time',_0xd974('0x77'),_0xd974('0x78'),_0xd974('0x79'),'subcategory','work_notes',_0xd974('0x7a'),_0xd974('0x5d'),'correlation_display',_0xd974('0x7b'),_0xd974('0x7c'),_0xd974('0x7d'),_0xd974('0x7e'),_0xd974('0x7f'),'description',_0xd974('0x80'),_0xd974('0x5e'),_0xd974('0x81'),'close_notes',_0xd974('0x82'),_0xd974('0x83'),'parent_incident',_0xd974('0x84'),_0xd974('0x85'),_0xd974('0x86'),_0xd974('0x5f'),_0xd974('0x87'),'problem_id','company',_0xd974('0x88'),_0xd974('0x89'),'assigned_to','severity','comments',_0xd974('0x8a'),'approval',_0xd974('0x8b'),_0xd974('0x8c'),_0xd974('0x8d'),_0xd974('0x8e'),_0xd974('0x8f'),_0xd974('0x90'),'upon_approval',_0xd974('0x91'),_0xd974('0x92'),_0xd974('0x93')];var _0x3f0acf='';var _0x3eb51f='';var _0x3053ed=[];var _0x26e16d='';var _0x560150='';var _0x403875=[];var _0x5366d9='';var _0x3ccb94='';var _0x3bcb80={};var _0x1f8b13='';return db['ServicenowAccount'][_0xd974('0x94')]({'where':{'id':_0x5ccf2f[_0xd974('0x4c')]['id']},'attributes':['id',_0xd974('0x95'),'password',_0xd974('0x96'),_0xd974('0x97'),_0xd974('0x98')]})[_0xd974('0x27')](handleEntityNotFound(_0x145dba,null))['then'](function(_0x232660){if(_0x232660){_0x1f8b13=_0x232660[_0xd974('0x97')];var _0x4deb6b=_0x1f8b13[_0xd974('0x99')](-0x1);if(_0x4deb6b==='/'){_0x1f8b13=_0x1f8b13[_0xd974('0x9a')](0x0,_0x1f8b13[_0xd974('0x9b')](_0x4deb6b));}_0x3ccb94=util['format'](_0xd974('0x9c'),_0x1f8b13);_0x5366d9=util[_0xd974('0x9d')](_0xd974('0x9e'),_0x1f8b13);_0x3bcb80={'user':_0x232660['username'],'pass':_0x232660[_0xd974('0x9f')]};var _0x188860={'method':_0xd974('0xa0'),'uri':_0x3ccb94+_0xd974('0xa1'),'auth':_0x3bcb80,'json':!![]};return rp(_0x188860);}})[_0xd974('0x27')](function(_0x2c26e8){if(_0x2c26e8[_0xd974('0xa2')][_0xd974('0x3a')]>0x0){_0x3f0acf=_0x2c26e8[_0xd974('0xa2')];}console[_0xd974('0xa3')]('incident\x20table\x20objects',_0x3f0acf);_0x403875=[];_0x3eb51f=Object[_0xd974('0xa4')]([],_0x3f0acf);_[_0xd974('0xa5')](_0x3eb51f,function(_0x1d929a){return!_0x5dfaff[_0xd974('0xa6')](_0x1d929a[_0xd974('0x2b')]);});_0x3eb51f[_0xd974('0xa7')](function(_0x4b02d2){var _0x22880d=createFieldObject(_0x5366d9,_0x3bcb80,_0x4b02d2['internalType'],_0x4b02d2['name'],_0x4b02d2[_0xd974('0xa8')],![]);_0x403875[_0xd974('0xa9')](_0x22880d);});return Promise[_0xd974('0xaa')](_0x403875);})['then'](function(_0x26f9ed){_0x3053ed=_0x26f9ed;_0x26e16d=Object['assign']([],_0x3f0acf);console[_0xd974('0xa3')](_0xd974('0xab'),_0x3f0acf);_[_0xd974('0xa5')](_0x26e16d,function(_0x38e448){return _0x441a24[_0xd974('0xa6')](_0x38e448[_0xd974('0x2b')]);});console[_0xd974('0xa3')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x26e16d);_0x403875=[];_0x26e16d[_0xd974('0xa7')](function(_0x559432){var _0x488695=createFieldObject(_0x5366d9,_0x3bcb80,_0x559432[_0xd974('0xac')],_0x559432[_0xd974('0x2b')],_0x559432['label'],!![]);_0x403875[_0xd974('0xa9')](_0x488695);});return Promise[_0xd974('0xaa')](_0x403875);})[_0xd974('0x27')](function(_0x276200){_0x560150=_0x276200;var _0x39716d=_0x3053ed['concat'](_0x560150);return{'count':_0x39716d['length'],'rows':_0x39716d};})[_0xd974('0x27')](respondWithResult(_0x145dba,null))['catch'](function(_0x16373c){console[_0xd974('0xa3')](_0xd974('0xad')+_0x16373c);var _0x51ac1e=_0x5ccf2f[_0xd974('0x34')][_0xd974('0xae')]?0x1f4:_0x16373c[_0xd974('0xaf')]||0x1f4;logger[_0xd974('0x29')](_0x16373c['stack']);delete _0x16373c[_0xd974('0x2b')];if(_0x51ac1e===0x191){_0x51ac1e=0x190;}_0x145dba[_0xd974('0x1b')](_0x51ac1e)[_0xd974('0xb0')](_0x5ccf2f[_0xd974('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x16373c[_0xd974('0xaf')]}:_0x16373c);});};function createFieldObject(_0x249b6b,_0x411105,_0x56ef8a,_0xc939ee,_0x381b8e,_0xdf31ca){return new Promise(function(_0x36e23e,_0x11f5bd){var _0x162aaf={'id':_0xc939ee,'name':_0x381b8e,'custom':_0xdf31ca};if(_0x56ef8a===_0xd974('0xb1')){_0x162aaf[_0xd974('0x42')]=[{'name':'True','value':_0xd974('0xb2')},{'name':_0xd974('0xb3'),'value':_0xd974('0xb4')}];_0x36e23e(_0x162aaf);}else{var _0xe3d31b={'method':_0xd974('0xa0'),'uri':_0x249b6b+'sys_choice?sysparm_query=name=incident^element='+_0xc939ee,'auth':_0x411105,'json':!![]};return rp(_0xe3d31b)[_0xd974('0x27')](function(_0x2e7a5a){var _0x1e246f=[];if(_0x2e7a5a[_0xd974('0xa2')][_0xd974('0x3a')]>0x0){_0x2e7a5a['result'][_0xd974('0xa7')](function(_0x3e7e4f){if(_0x3e7e4f[_0xd974('0xb5')]===_0xd974('0xb4')){var _0x4b90e1={'name':_0x3e7e4f['label'],'value':_0x3e7e4f['value']};_0x1e246f[_0xd974('0xa9')](_0x4b90e1);}});}_0x162aaf[_0xd974('0x42')]=_0x1e246f;if(_0x162aaf['options']['length']>0x0){_0x36e23e(_0x162aaf);}else{if(_0xdf31ca==![]){_0x36e23e();}else{_0x36e23e(_0x162aaf);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1965e39..76d4674 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x45ee03,_0x2f5319){var _0x13d535=function(_0x391904){while(--_0x391904){_0x45ee03['push'](_0x45ee03['shift']());}};_0x13d535(++_0x2f5319);}(_0x7a54,0x106));var _0x47a5=function(_0x6e26ff,_0x2b8f43){_0x6e26ff=_0x6e26ff-0x0;var _0x525320=_0x7a54[_0x6e26ff];return _0x525320;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da7=['../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7da7,0x10d));var _0x77da=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x7da7[_0x4a3898];return _0x25ceb0;};'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('./intServicenowAccount.attributes');var integrations=require(_0x77da('0x7'));module[_0x77da('0x8')]=function(_0x47da81,_0x30afe0){return _0x47da81['define'](_0x77da('0x9'),attributes,{'tableName':_0x77da('0xa'),'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 682551a..a5558cd 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 _0x7f1d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','options','where','map','include','model','attributes','GetServicenowAccount','stringify','ShowServicenowAccount','ServicenowAccount','find','debug','lodash','util','moment'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x7f1d,0x11d));var _0xd7f1=function(_0x239a99,_0x2eea66){_0x239a99=_0x239a99-0x0;var _0x5e65dc=_0x7f1d[_0x239a99];return _0x5e65dc;};'use strict';var _=require(_0xd7f1('0x0'));var util=require(_0xd7f1('0x1'));var moment=require(_0xd7f1('0x2'));var BPromise=require('bluebird');var rs=require(_0xd7f1('0x3'));var fs=require('fs');var Redis=require(_0xd7f1('0x4'));var db=require(_0xd7f1('0x5'))['db'];var utils=require(_0xd7f1('0x6'));var logger=require(_0xd7f1('0x7'))(_0xd7f1('0x8'));var config=require('../../config/environment');var jayson=require(_0xd7f1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x528248,_0x1a0b4f,_0xfb4f59){return new BPromise(function(_0x4fee14,_0x12cf7b){return client[_0xd7f1('0xa')](_0x528248,_0xfb4f59)[_0xd7f1('0xb')](function(_0x125ef9){logger[_0xd7f1('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x1a0b4f,_0xd7f1('0xd'));logger['debug'](_0xd7f1('0xe'),_0x1a0b4f,_0xd7f1('0xd'),JSON['stringify'](_0x125ef9));if(_0x125ef9[_0xd7f1('0xf')]){if(_0x125ef9[_0xd7f1('0xf')]['code']===0x1f4){logger[_0xd7f1('0xf')](_0xd7f1('0x10'),_0x1a0b4f,_0x125ef9[_0xd7f1('0xf')]['message']);return _0x12cf7b(_0x125ef9[_0xd7f1('0xf')][_0xd7f1('0x11')]);}logger[_0xd7f1('0xf')](_0xd7f1('0x10'),_0x1a0b4f,_0x125ef9['error']['message']);return _0x4fee14(_0x125ef9[_0xd7f1('0xf')]['message']);}else{logger['info'](_0xd7f1('0x10'),_0x1a0b4f,_0xd7f1('0xd'));_0x4fee14(_0x125ef9[_0xd7f1('0x12')]['message']);}})[_0xd7f1('0x13')](function(_0x46a752){logger[_0xd7f1('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x1a0b4f,_0x46a752);_0x12cf7b(_0x46a752);});});}exports['GetServicenowAccount']=function(_0x15aae5){var _0x5216bf=this;return new Promise(function(_0x1d5191,_0x5c78b4){return db['ServicenowAccount']['findAll']({'raw':_0x15aae5[_0xd7f1('0x14')]?_0x15aae5['options']['raw']===undefined?!![]:![]:!![],'where':_0x15aae5[_0xd7f1('0x14')]?_0x15aae5[_0xd7f1('0x14')][_0xd7f1('0x15')]||null:null,'attributes':_0x15aae5[_0xd7f1('0x14')]?_0x15aae5[_0xd7f1('0x14')]['attributes']||null:null,'limit':_0x15aae5[_0xd7f1('0x14')]?_0x15aae5[_0xd7f1('0x14')]['limit']||null:null,'include':_0x15aae5[_0xd7f1('0x14')]?_0x15aae5['options']['include']?_[_0xd7f1('0x16')](_0x15aae5[_0xd7f1('0x14')][_0xd7f1('0x17')],function(_0x132092){return{'model':db[_0x132092['model']],'as':_0x132092['as'],'attributes':_0x132092['attributes'],'include':_0x132092[_0xd7f1('0x17')]?_[_0xd7f1('0x16')](_0x132092[_0xd7f1('0x17')],function(_0x1efe2e){return{'model':db[_0x1efe2e[_0xd7f1('0x18')]],'as':_0x1efe2e['as'],'attributes':_0x1efe2e[_0xd7f1('0x19')],'include':_0x1efe2e['include']?_[_0xd7f1('0x16')](_0x1efe2e['include'],function(_0x2dfcb1){return{'model':db[_0x2dfcb1[_0xd7f1('0x18')]],'as':_0x2dfcb1['as'],'attributes':_0x2dfcb1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7f1('0xb')](function(_0x16f425){logger[_0xd7f1('0xc')](_0xd7f1('0x1a'),_0x15aae5);logger['debug'](_0xd7f1('0x1a'),_0x15aae5,JSON[_0xd7f1('0x1b')](_0x16f425));_0x1d5191(_0x16f425);})[_0xd7f1('0x13')](function(_0x56a5cb){logger[_0xd7f1('0xf')](_0xd7f1('0x1a'),_0x56a5cb[_0xd7f1('0x11')],_0x15aae5);_0x5c78b4(_0x5216bf['error'](0x1f4,_0x56a5cb[_0xd7f1('0x11')]));});});};exports[_0xd7f1('0x1c')]=function(_0x4040d2){var _0x34d54f=this;return new Promise(function(_0x57b88d,_0x1615cc){return db[_0xd7f1('0x1d')][_0xd7f1('0x1e')]({'raw':_0x4040d2[_0xd7f1('0x14')]?_0x4040d2[_0xd7f1('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4040d2[_0xd7f1('0x14')]?_0x4040d2[_0xd7f1('0x14')][_0xd7f1('0x15')]||null:null,'attributes':_0x4040d2[_0xd7f1('0x14')]?_0x4040d2[_0xd7f1('0x14')][_0xd7f1('0x19')]||null:null,'include':_0x4040d2[_0xd7f1('0x14')]?_0x4040d2[_0xd7f1('0x14')][_0xd7f1('0x17')]?_[_0xd7f1('0x16')](_0x4040d2['options'][_0xd7f1('0x17')],function(_0x6df65){return{'model':db[_0x6df65['model']],'as':_0x6df65['as'],'attributes':_0x6df65[_0xd7f1('0x19')],'include':_0x6df65[_0xd7f1('0x17')]?_['map'](_0x6df65[_0xd7f1('0x17')],function(_0x3ff75a){return{'model':db[_0x3ff75a['model']],'as':_0x3ff75a['as'],'attributes':_0x3ff75a[_0xd7f1('0x19')],'include':_0x3ff75a['include']?_['map'](_0x3ff75a['include'],function(_0xb32342){return{'model':db[_0xb32342[_0xd7f1('0x18')]],'as':_0xb32342['as'],'attributes':_0xb32342['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7f1('0xb')](function(_0x31316d){logger['info'](_0xd7f1('0x1c'),_0x4040d2);logger[_0xd7f1('0x1f')](_0xd7f1('0x1c'),_0x4040d2,JSON[_0xd7f1('0x1b')](_0x31316d));_0x57b88d(_0x31316d);})[_0xd7f1('0x13')](function(_0x3d709d){logger[_0xd7f1('0xf')]('ShowServicenowAccount',_0x3d709d[_0xd7f1('0x11')],_0x4040d2);_0x1615cc(_0x34d54f[_0xd7f1('0xf')](0x1f4,_0x3d709d['message']));});});}; \ No newline at end of file +var _0xf408=['info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','raw','options','where','attributes','limit','include','map','model','ShowServicenowAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf408,0x79));var _0x8f40=function(_0x33e982,_0x1d15b1){_0x33e982=_0x33e982-0x0;var _0x2d3668=_0xf408[_0x33e982];return _0x2d3668;};'use strict';var _=require('lodash');var util=require(_0x8f40('0x0'));var moment=require(_0x8f40('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f40('0x2'));var fs=require('fs');var Redis=require(_0x8f40('0x3'));var db=require(_0x8f40('0x4'))['db'];var utils=require(_0x8f40('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8f40('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8f40('0x7')][_0x8f40('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d2530,_0x59f921,_0x2b3292){return new BPromise(function(_0x2dffff,_0x2268ce){return client[_0x8f40('0x9')](_0x4d2530,_0x2b3292)[_0x8f40('0xa')](function(_0x1fe050){logger['info'](_0x8f40('0xb'),_0x59f921,_0x8f40('0xc'));logger[_0x8f40('0xd')](_0x8f40('0xe'),_0x59f921,_0x8f40('0xc'),JSON[_0x8f40('0xf')](_0x1fe050));if(_0x1fe050['error']){if(_0x1fe050[_0x8f40('0x10')][_0x8f40('0x11')]===0x1f4){logger[_0x8f40('0x10')](_0x8f40('0xb'),_0x59f921,_0x1fe050[_0x8f40('0x10')][_0x8f40('0x12')]);return _0x2268ce(_0x1fe050[_0x8f40('0x10')][_0x8f40('0x12')]);}logger[_0x8f40('0x10')](_0x8f40('0xb'),_0x59f921,_0x1fe050[_0x8f40('0x10')][_0x8f40('0x12')]);return _0x2dffff(_0x1fe050['error'][_0x8f40('0x12')]);}else{logger[_0x8f40('0x13')](_0x8f40('0xb'),_0x59f921,_0x8f40('0xc'));_0x2dffff(_0x1fe050[_0x8f40('0x14')]['message']);}})[_0x8f40('0x15')](function(_0x35890d){logger[_0x8f40('0x10')](_0x8f40('0xb'),_0x59f921,_0x35890d);_0x2268ce(_0x35890d);});});}exports[_0x8f40('0x16')]=function(_0x20874c){var _0x1c0a71=this;return new Promise(function(_0x4ff65a,_0x330847){return db[_0x8f40('0x17')][_0x8f40('0x18')]({'raw':_0x20874c['options']?_0x20874c['options'][_0x8f40('0x19')]===undefined?!![]:![]:!![],'where':_0x20874c[_0x8f40('0x1a')]?_0x20874c[_0x8f40('0x1a')][_0x8f40('0x1b')]||null:null,'attributes':_0x20874c[_0x8f40('0x1a')]?_0x20874c[_0x8f40('0x1a')][_0x8f40('0x1c')]||null:null,'limit':_0x20874c[_0x8f40('0x1a')]?_0x20874c[_0x8f40('0x1a')][_0x8f40('0x1d')]||null:null,'include':_0x20874c[_0x8f40('0x1a')]?_0x20874c['options'][_0x8f40('0x1e')]?_[_0x8f40('0x1f')](_0x20874c[_0x8f40('0x1a')][_0x8f40('0x1e')],function(_0x32b247){return{'model':db[_0x32b247[_0x8f40('0x20')]],'as':_0x32b247['as'],'attributes':_0x32b247['attributes'],'include':_0x32b247['include']?_['map'](_0x32b247[_0x8f40('0x1e')],function(_0x2d15cb){return{'model':db[_0x2d15cb[_0x8f40('0x20')]],'as':_0x2d15cb['as'],'attributes':_0x2d15cb[_0x8f40('0x1c')],'include':_0x2d15cb['include']?_[_0x8f40('0x1f')](_0x2d15cb[_0x8f40('0x1e')],function(_0x4ea7e3){return{'model':db[_0x4ea7e3[_0x8f40('0x20')]],'as':_0x4ea7e3['as'],'attributes':_0x4ea7e3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2527f0){logger[_0x8f40('0x13')](_0x8f40('0x16'),_0x20874c);logger[_0x8f40('0xd')](_0x8f40('0x16'),_0x20874c,JSON[_0x8f40('0xf')](_0x2527f0));_0x4ff65a(_0x2527f0);})[_0x8f40('0x15')](function(_0x508775){logger[_0x8f40('0x10')]('GetServicenowAccount',_0x508775['message'],_0x20874c);_0x330847(_0x1c0a71[_0x8f40('0x10')](0x1f4,_0x508775[_0x8f40('0x12')]));});});};exports[_0x8f40('0x21')]=function(_0x1630b4){var _0x4c71eb=this;return new Promise(function(_0x34b3b9,_0x304ac2){return db[_0x8f40('0x17')][_0x8f40('0x22')]({'raw':_0x1630b4['options']?_0x1630b4['options'][_0x8f40('0x19')]===undefined?!![]:![]:!![],'where':_0x1630b4[_0x8f40('0x1a')]?_0x1630b4[_0x8f40('0x1a')]['where']||null:null,'attributes':_0x1630b4[_0x8f40('0x1a')]?_0x1630b4[_0x8f40('0x1a')][_0x8f40('0x1c')]||null:null,'include':_0x1630b4[_0x8f40('0x1a')]?_0x1630b4[_0x8f40('0x1a')][_0x8f40('0x1e')]?_[_0x8f40('0x1f')](_0x1630b4[_0x8f40('0x1a')][_0x8f40('0x1e')],function(_0x53a855){return{'model':db[_0x53a855['model']],'as':_0x53a855['as'],'attributes':_0x53a855[_0x8f40('0x1c')],'include':_0x53a855['include']?_['map'](_0x53a855['include'],function(_0x477bb4){return{'model':db[_0x477bb4[_0x8f40('0x20')]],'as':_0x477bb4['as'],'attributes':_0x477bb4[_0x8f40('0x1c')],'include':_0x477bb4[_0x8f40('0x1e')]?_['map'](_0x477bb4[_0x8f40('0x1e')],function(_0x5b2071){return{'model':db[_0x5b2071[_0x8f40('0x20')]],'as':_0x5b2071['as'],'attributes':_0x5b2071[_0x8f40('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8f40('0xa')](function(_0x1fc2a8){logger['info'](_0x8f40('0x21'),_0x1630b4);logger[_0x8f40('0xd')]('ShowServicenowAccount',_0x1630b4,JSON[_0x8f40('0xf')](_0x1fc2a8));_0x34b3b9(_0x1fc2a8);})[_0x8f40('0x15')](function(_0x127264){logger[_0x8f40('0x10')]('ShowServicenowAccount',_0x127264[_0x8f40('0x12')],_0x1630b4);_0x304ac2(_0x4c71eb[_0x8f40('0x10')](0x1f4,_0x127264['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 5ca7eda..8669674 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 _0xebb8=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x4a321a,_0x55b081){var _0x228947=function(_0x495645){while(--_0x495645){_0x4a321a['push'](_0x4a321a['shift']());}};_0x228947(++_0x55b081);}(_0xebb8,0x8c));var _0x8ebb=function(_0x493dc2,_0x2373ee){_0x493dc2=_0x493dc2-0x0;var _0x328f73=_0xebb8[_0x493dc2];return _0x328f73;};'use strict';var multer=require(_0x8ebb('0x0'));var util=require(_0x8ebb('0x1'));var path=require('path');var timeout=require(_0x8ebb('0x2'));var express=require(_0x8ebb('0x3'));var router=express[_0x8ebb('0x4')]();var fs_extra=require(_0x8ebb('0x5'));var auth=require(_0x8ebb('0x6'));var interaction=require(_0x8ebb('0x7'));var config=require(_0x8ebb('0x8'));var controller=require(_0x8ebb('0x9'));router[_0x8ebb('0xa')]('/',auth[_0x8ebb('0xb')](),controller[_0x8ebb('0xc')]);router['get'](_0x8ebb('0xd'),auth['isAuthenticated'](),controller[_0x8ebb('0xe')]);router['get'](_0x8ebb('0xf'),auth[_0x8ebb('0xb')](),controller[_0x8ebb('0x10')]);router[_0x8ebb('0xa')](_0x8ebb('0x11'),auth['isAuthenticated'](),controller[_0x8ebb('0x12')]);router['get'](_0x8ebb('0x13'),auth[_0x8ebb('0xb')](),controller[_0x8ebb('0x14')]);router['post']('/',auth[_0x8ebb('0xb')](),controller['create']);router[_0x8ebb('0x15')](_0x8ebb('0xd'),auth[_0x8ebb('0xb')](),controller[_0x8ebb('0x16')]);router[_0x8ebb('0x17')](_0x8ebb('0xd'),auth[_0x8ebb('0xb')](),controller[_0x8ebb('0x18')]);module[_0x8ebb('0x19')]=router; \ No newline at end of file +var _0x831f=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create'];(function(_0x3c80b9,_0x4e8ff2){var _0x8ac11e=function(_0x833197){while(--_0x833197){_0x3c80b9['push'](_0x3c80b9['shift']());}};_0x8ac11e(++_0x4e8ff2);}(_0x831f,0x170));var _0xf831=function(_0x54f859,_0x59d463){_0x54f859=_0x54f859-0x0;var _0x17a08b=_0x831f[_0x54f859];return _0x17a08b;};'use strict';var multer=require(_0xf831('0x0'));var util=require(_0xf831('0x1'));var path=require(_0xf831('0x2'));var timeout=require(_0xf831('0x3'));var express=require(_0xf831('0x4'));var router=express[_0xf831('0x5')]();var fs_extra=require(_0xf831('0x6'));var auth=require(_0xf831('0x7'));var interaction=require(_0xf831('0x8'));var config=require(_0xf831('0x9'));var controller=require(_0xf831('0xa'));router[_0xf831('0xb')]('/',auth[_0xf831('0xc')](),controller[_0xf831('0xd')]);router['get'](_0xf831('0xe'),auth[_0xf831('0xc')](),controller['show']);router[_0xf831('0xb')](_0xf831('0xf'),auth['isAuthenticated'](),controller[_0xf831('0x10')]);router[_0xf831('0xb')](_0xf831('0x11'),auth['isAuthenticated'](),controller[_0xf831('0x12')]);router[_0xf831('0xb')](_0xf831('0x13'),auth[_0xf831('0xc')](),controller[_0xf831('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf831('0x15')]);router[_0xf831('0x16')]('/:id',auth[_0xf831('0xc')](),controller[_0xf831('0x17')]);router[_0xf831('0x18')](_0xf831('0xe'),auth[_0xf831('0xc')](),controller['destroy']);module[_0xf831('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 202efd7..9d8d89a 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 _0xd193=['sequelize','exports','STRING'];(function(_0x53c228,_0x427768){var _0x13f412=function(_0x136c44){while(--_0x136c44){_0x53c228['push'](_0x53c228['shift']());}};_0x13f412(++_0x427768);}(_0xd193,0xf6));var _0x3d19=function(_0x204c34,_0x1141d2){_0x204c34=_0x204c34-0x0;var _0xbfa72d=_0xd193[_0x204c34];return _0xbfa72d;};'use strict';var Sequelize=require(_0x3d19('0x0'));module[_0x3d19('0x1')]={'name':{'type':Sequelize[_0x3d19('0x2')]},'description':{'type':Sequelize[_0x3d19('0x2')]}}; \ No newline at end of file +var _0xf83b=['sequelize','exports'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0xf83b,0x1cc));var _0xbf83=function(_0x4724e3,_0x47aefd){_0x4724e3=_0x4724e3-0x0;var _0x314ad2=_0xf83b[_0x4724e3];return _0x314ad2;};'use strict';var Sequelize=require(_0xbf83('0x0'));module[_0xbf83('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ef89f2d..07632e3 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 _0x3048=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','map','query','keys','intersection','model','attributes','fields','length','nolimit','offset','sort','where','filters','pick','filter','merge','type','VIRTUAL','show','params','includeAll','include','find','catch','create','body','getFields','findOne','ServicenowField','order','options','getSubjects','getDescriptions','hasOwnProperty','rimraf','zip-dir','moment','mustache','path','sox','to-csv','lodash'];(function(_0x53f8e5,_0x138f2a){var _0x4477e7=function(_0x35ab84){while(--_0x35ab84){_0x53f8e5['push'](_0x53f8e5['shift']());}};_0x4477e7(++_0x138f2a);}(_0x3048,0x1b4));var _0x8304=function(_0x37c2f2,_0x38d0ad){_0x37c2f2=_0x37c2f2-0x0;var _0x3f5f77=_0x3048[_0x37c2f2];return _0x3f5f77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8304('0x0'));var zipdir=require(_0x8304('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8304('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8304('0x3'));var util=require('util');var path=require(_0x8304('0x4'));var sox=require(_0x8304('0x5'));var csv=require(_0x8304('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8304('0x7'));var squel=require(_0x8304('0x8'));var crypto=require(_0x8304('0x9'));var jsforce=require(_0x8304('0xa'));var deskjs=require(_0x8304('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8304('0xc'));var Redis=require(_0x8304('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8304('0xe'));var hardwareService=require(_0x8304('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x8304('0x10'));var config=require(_0x8304('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29ab84,_0x16fb01){_0x16fb01=_0x16fb01||0xcc;return function(_0x457a01){if(_0x457a01){return _0x29ab84[_0x8304('0x12')](_0x16fb01);}return _0x29ab84[_0x8304('0x13')](_0x16fb01)[_0x8304('0x14')]();};}function respondWithResult(_0x43e079,_0x5e2d86){_0x5e2d86=_0x5e2d86||0xc8;return function(_0x76854b){if(_0x76854b){return _0x43e079['status'](_0x5e2d86)[_0x8304('0x15')](_0x76854b);}};}function respondWithFilteredResult(_0x425fac,_0x9ece7f){return function(_0x5b7708){if(_0x5b7708){var _0x6a1bde=typeof _0x9ece7f['offset']===_0x8304('0x16')&&typeof _0x9ece7f[_0x8304('0x17')]===_0x8304('0x16');var _0x18c7f3=_0x5b7708['count'];var _0x287c72=_0x6a1bde?0x0:_0x9ece7f['offset'];var _0x1b8778=_0x6a1bde?_0x5b7708[_0x8304('0x18')]:_0x9ece7f['offset']+_0x9ece7f[_0x8304('0x17')];var _0x48b232;if(_0x1b8778>=_0x18c7f3){_0x1b8778=_0x18c7f3;_0x48b232=0xc8;}else{_0x48b232=0xce;}_0x425fac[_0x8304('0x13')](_0x48b232);return _0x425fac[_0x8304('0x19')](_0x8304('0x1a'),_0x287c72+'-'+_0x1b8778+'/'+_0x18c7f3)[_0x8304('0x15')](_0x5b7708);}return null;};}function patchUpdates(_0x58a251){return function(_0xe58d7){try{jsonpatch[_0x8304('0x1b')](_0xe58d7,_0x58a251,!![]);}catch(_0x3d411f){return BPromise['reject'](_0x3d411f);}return _0xe58d7[_0x8304('0x1c')]();};}function saveUpdates(_0x3bcc03,_0x222d76){return function(_0x49ad1d){if(_0x49ad1d){return _0x49ad1d[_0x8304('0x1d')](_0x3bcc03)[_0x8304('0x1e')](function(_0x533e78){return _0x533e78;});}return null;};}function removeEntity(_0x1b7f70,_0x43fb2a){return function(_0x5c3a25){if(_0x5c3a25){return _0x5c3a25[_0x8304('0x1f')]()['then'](function(){_0x1b7f70['status'](0xcc)[_0x8304('0x14')]();});}};}function handleEntityNotFound(_0x133afc,_0x251bac){return function(_0x3e642f){if(!_0x3e642f){_0x133afc[_0x8304('0x12')](0x194);}return _0x3e642f;};}function handleError(_0x4bb3e3,_0x3e743e){_0x3e743e=_0x3e743e||0x1f4;return function(_0x4fa320){logger[_0x8304('0x20')](_0x4fa320[_0x8304('0x21')]);if(_0x4fa320[_0x8304('0x22')]){delete _0x4fa320[_0x8304('0x22')];}_0x4bb3e3[_0x8304('0x13')](_0x3e743e)[_0x8304('0x23')](_0x4fa320);};}exports[_0x8304('0x24')]=function(_0x20f0b8,_0x534140){var _0x5b0d8b={},_0x42a76d={},_0x166a25={'count':0x0,'rows':[]};var _0xd2b928=_['map'](db[_0x8304('0x25')][_0x8304('0x26')],function(_0x5ad26f){return{'name':_0x5ad26f[_0x8304('0x27')],'type':_0x5ad26f['type']['key']};});_0x42a76d['model']=_[_0x8304('0x28')](_0xd2b928,_0x8304('0x22'));_0x42a76d[_0x8304('0x29')]=_[_0x8304('0x2a')](_0x20f0b8['query']);_0x42a76d['filters']=_[_0x8304('0x2b')](_0x42a76d[_0x8304('0x2c')],_0x42a76d[_0x8304('0x29')]);_0x5b0d8b[_0x8304('0x2d')]=_['intersection'](_0x42a76d[_0x8304('0x2c')],qs['fields'](_0x20f0b8[_0x8304('0x29')][_0x8304('0x2e')]));_0x5b0d8b[_0x8304('0x2d')]=_0x5b0d8b[_0x8304('0x2d')][_0x8304('0x2f')]?_0x5b0d8b['attributes']:_0x42a76d[_0x8304('0x2c')];if(!_0x20f0b8[_0x8304('0x29')]['hasOwnProperty'](_0x8304('0x30'))){_0x5b0d8b['limit']=qs[_0x8304('0x17')](_0x20f0b8[_0x8304('0x29')][_0x8304('0x17')]);_0x5b0d8b[_0x8304('0x31')]=qs[_0x8304('0x31')](_0x20f0b8['query'][_0x8304('0x31')]);}_0x5b0d8b['order']=qs[_0x8304('0x32')](_0x20f0b8[_0x8304('0x29')]['sort']);_0x5b0d8b[_0x8304('0x33')]=qs[_0x8304('0x34')](_[_0x8304('0x35')](_0x20f0b8[_0x8304('0x29')],_0x42a76d['filters']),_0xd2b928);if(_0x20f0b8[_0x8304('0x29')][_0x8304('0x36')]){_0x5b0d8b[_0x8304('0x33')]=_[_0x8304('0x37')](_0x5b0d8b[_0x8304('0x33')],{'$or':_[_0x8304('0x28')](_0xd2b928,function(_0x514a6a){if(_0x514a6a[_0x8304('0x38')]!==_0x8304('0x39')){var _0x457e71={};_0x457e71[_0x514a6a[_0x8304('0x22')]]={'$like':'%'+_0x20f0b8[_0x8304('0x29')][_0x8304('0x36')]+'%'};return _0x457e71;}})});}_0x5b0d8b=_['merge']({},_0x5b0d8b,_0x20f0b8['options']);var _0x36f5ec={'where':_0x5b0d8b[_0x8304('0x33')]};return db[_0x8304('0x25')]['count'](_0x36f5ec)[_0x8304('0x1e')](function(_0x15ebb5){_0x166a25['count']=_0x15ebb5;if(_0x20f0b8[_0x8304('0x29')]['includeAll']){_0x5b0d8b['include']=[{'all':!![]}];}return db[_0x8304('0x25')]['findAll'](_0x5b0d8b);})[_0x8304('0x1e')](function(_0x184356){_0x166a25['rows']=_0x184356;return _0x166a25;})[_0x8304('0x1e')](respondWithFilteredResult(_0x534140,_0x5b0d8b))['catch'](handleError(_0x534140,null));};exports[_0x8304('0x3a')]=function(_0x5ccff4,_0x438bd4){var _0x3b3aee={'raw':![],'where':{'id':_0x5ccff4[_0x8304('0x3b')]['id']}},_0x465d1e={};_0x465d1e[_0x8304('0x2c')]=_[_0x8304('0x2a')](db[_0x8304('0x25')]['rawAttributes']);_0x465d1e[_0x8304('0x29')]=_[_0x8304('0x2a')](_0x5ccff4['query']);_0x465d1e[_0x8304('0x34')]=_[_0x8304('0x2b')](_0x465d1e[_0x8304('0x2c')],_0x465d1e[_0x8304('0x29')]);_0x3b3aee[_0x8304('0x2d')]=_[_0x8304('0x2b')](_0x465d1e['model'],qs['fields'](_0x5ccff4[_0x8304('0x29')][_0x8304('0x2e')]));_0x3b3aee[_0x8304('0x2d')]=_0x3b3aee[_0x8304('0x2d')][_0x8304('0x2f')]?_0x3b3aee[_0x8304('0x2d')]:_0x465d1e[_0x8304('0x2c')];if(_0x5ccff4[_0x8304('0x29')][_0x8304('0x3c')]){_0x3b3aee[_0x8304('0x3d')]=[{'all':!![]}];}_0x3b3aee=_[_0x8304('0x37')]({},_0x3b3aee,_0x5ccff4['options']);return db['ServicenowConfiguration'][_0x8304('0x3e')](_0x3b3aee)[_0x8304('0x1e')](handleEntityNotFound(_0x438bd4,null))[_0x8304('0x1e')](respondWithResult(_0x438bd4,null))[_0x8304('0x3f')](handleError(_0x438bd4,null));};exports[_0x8304('0x40')]=function(_0x524acd,_0x2d42d6){return db[_0x8304('0x25')][_0x8304('0x40')](_0x524acd[_0x8304('0x41')],{})[_0x8304('0x1e')](respondWithResult(_0x2d42d6,0xc9))[_0x8304('0x3f')](handleError(_0x2d42d6,null));};exports[_0x8304('0x1d')]=function(_0x86fa36,_0x1b315c){if(_0x86fa36['body']['id']){delete _0x86fa36[_0x8304('0x41')]['id'];}return db['ServicenowConfiguration'][_0x8304('0x3e')]({'where':{'id':_0x86fa36[_0x8304('0x3b')]['id']}})[_0x8304('0x1e')](handleEntityNotFound(_0x1b315c,null))['then'](saveUpdates(_0x86fa36[_0x8304('0x41')],null))['then'](respondWithResult(_0x1b315c,null))[_0x8304('0x3f')](handleError(_0x1b315c,null));};exports['destroy']=function(_0x64dd5f,_0x593eea){return db['ServicenowConfiguration'][_0x8304('0x3e')]({'where':{'id':_0x64dd5f[_0x8304('0x3b')]['id']}})[_0x8304('0x1e')](handleEntityNotFound(_0x593eea,null))[_0x8304('0x1e')](removeEntity(_0x593eea,null))[_0x8304('0x3f')](handleError(_0x593eea,null));};exports[_0x8304('0x42')]=function(_0x146f9f,_0x297284,_0x470cba){var _0x461d95={};var _0x52e577={};var _0x1ee1da;var _0x5ad79b;return db['ServicenowConfiguration'][_0x8304('0x43')]({'where':{'id':_0x146f9f[_0x8304('0x3b')]['id']}})[_0x8304('0x1e')](handleEntityNotFound(_0x297284,null))[_0x8304('0x1e')](function(_0x56fbc9){if(_0x56fbc9){_0x1ee1da=_0x56fbc9;_0x52e577[_0x8304('0x2c')]=_[_0x8304('0x2a')](db[_0x8304('0x44')]['rawAttributes']);_0x52e577[_0x8304('0x29')]=_[_0x8304('0x2a')](_0x146f9f[_0x8304('0x29')]);_0x52e577[_0x8304('0x34')]=_[_0x8304('0x2b')](_0x52e577[_0x8304('0x2c')],_0x52e577['query']);_0x461d95['attributes']=_[_0x8304('0x2b')](_0x52e577[_0x8304('0x2c')],qs[_0x8304('0x2e')](_0x146f9f['query'][_0x8304('0x2e')]));_0x461d95[_0x8304('0x2d')]=_0x461d95[_0x8304('0x2d')][_0x8304('0x2f')]?_0x461d95[_0x8304('0x2d')]:_0x52e577[_0x8304('0x2c')];_0x461d95[_0x8304('0x45')]=qs[_0x8304('0x32')](_0x146f9f[_0x8304('0x29')][_0x8304('0x32')]);_0x461d95[_0x8304('0x33')]=qs['filters'](_[_0x8304('0x35')](_0x146f9f[_0x8304('0x29')],_0x52e577[_0x8304('0x34')]));if(_0x146f9f[_0x8304('0x29')][_0x8304('0x36')]){_0x461d95['where']=_[_0x8304('0x37')](_0x461d95['where'],{'$or':_[_0x8304('0x28')](_0x461d95['attributes'],function(_0x487eca){var _0x17e9bb={};_0x17e9bb[_0x487eca]={'$like':'%'+_0x146f9f[_0x8304('0x29')][_0x8304('0x36')]+'%'};return _0x17e9bb;})});}_0x461d95=_['merge']({},_0x461d95,_0x146f9f[_0x8304('0x46')]);return _0x1ee1da[_0x8304('0x42')](_0x461d95);}})[_0x8304('0x1e')](function(_0x2821ef){if(_0x2821ef){_0x5ad79b=_0x2821ef[_0x8304('0x2f')];if(!_0x146f9f['query']['hasOwnProperty'](_0x8304('0x30'))){_0x461d95[_0x8304('0x17')]=qs[_0x8304('0x17')](_0x146f9f[_0x8304('0x29')][_0x8304('0x17')]);_0x461d95[_0x8304('0x31')]=qs[_0x8304('0x31')](_0x146f9f[_0x8304('0x29')][_0x8304('0x31')]);}return _0x1ee1da[_0x8304('0x42')](_0x461d95);}})[_0x8304('0x1e')](function(_0x43f7d7){if(_0x43f7d7){return _0x43f7d7?{'count':_0x5ad79b,'rows':_0x43f7d7}:null;}})[_0x8304('0x1e')](respondWithResult(_0x297284,null))[_0x8304('0x3f')](handleError(_0x297284,null));};exports[_0x8304('0x47')]=function(_0x177423,_0x2dd4aa,_0x54b060){var _0x4a2759={};var _0x22c4c8={};var _0x49c62f;var _0x4a2e69;return db[_0x8304('0x25')]['findOne']({'where':{'id':_0x177423['params']['id']}})[_0x8304('0x1e')](handleEntityNotFound(_0x2dd4aa,null))[_0x8304('0x1e')](function(_0xe1d7e8){if(_0xe1d7e8){_0x49c62f=_0xe1d7e8;_0x22c4c8[_0x8304('0x2c')]=_['keys'](db[_0x8304('0x44')]['rawAttributes']);_0x22c4c8[_0x8304('0x29')]=_['keys'](_0x177423[_0x8304('0x29')]);_0x22c4c8[_0x8304('0x34')]=_[_0x8304('0x2b')](_0x22c4c8[_0x8304('0x2c')],_0x22c4c8[_0x8304('0x29')]);_0x4a2759[_0x8304('0x2d')]=_[_0x8304('0x2b')](_0x22c4c8[_0x8304('0x2c')],qs[_0x8304('0x2e')](_0x177423['query']['fields']));_0x4a2759[_0x8304('0x2d')]=_0x4a2759['attributes']['length']?_0x4a2759[_0x8304('0x2d')]:_0x22c4c8[_0x8304('0x2c')];_0x4a2759[_0x8304('0x45')]=qs[_0x8304('0x32')](_0x177423[_0x8304('0x29')][_0x8304('0x32')]);_0x4a2759[_0x8304('0x33')]=qs['filters'](_[_0x8304('0x35')](_0x177423[_0x8304('0x29')],_0x22c4c8[_0x8304('0x34')]));if(_0x177423[_0x8304('0x29')][_0x8304('0x36')]){_0x4a2759[_0x8304('0x33')]=_['merge'](_0x4a2759[_0x8304('0x33')],{'$or':_[_0x8304('0x28')](_0x4a2759['attributes'],function(_0x2805c0){var _0x5c651b={};_0x5c651b[_0x2805c0]={'$like':'%'+_0x177423[_0x8304('0x29')][_0x8304('0x36')]+'%'};return _0x5c651b;})});}_0x4a2759=_[_0x8304('0x37')]({},_0x4a2759,_0x177423[_0x8304('0x46')]);return _0x49c62f[_0x8304('0x47')](_0x4a2759);}})[_0x8304('0x1e')](function(_0x797981){if(_0x797981){_0x4a2e69=_0x797981[_0x8304('0x2f')];if(!_0x177423[_0x8304('0x29')]['hasOwnProperty']('nolimit')){_0x4a2759['limit']=qs[_0x8304('0x17')](_0x177423[_0x8304('0x29')][_0x8304('0x17')]);_0x4a2759[_0x8304('0x31')]=qs[_0x8304('0x31')](_0x177423['query'][_0x8304('0x31')]);}return _0x49c62f[_0x8304('0x47')](_0x4a2759);}})[_0x8304('0x1e')](function(_0x4a2470){if(_0x4a2470){return _0x4a2470?{'count':_0x4a2e69,'rows':_0x4a2470}:null;}})[_0x8304('0x1e')](respondWithResult(_0x2dd4aa,null))[_0x8304('0x3f')](handleError(_0x2dd4aa,null));};exports[_0x8304('0x48')]=function(_0x3d9e56,_0x14dd8f,_0x2d02e1){var _0x5c0eed={};var _0x3324f7={};var _0x36995e;var _0x4da306;return db[_0x8304('0x25')][_0x8304('0x43')]({'where':{'id':_0x3d9e56[_0x8304('0x3b')]['id']}})[_0x8304('0x1e')](handleEntityNotFound(_0x14dd8f,null))[_0x8304('0x1e')](function(_0x19cab8){if(_0x19cab8){_0x36995e=_0x19cab8;_0x3324f7[_0x8304('0x2c')]=_[_0x8304('0x2a')](db[_0x8304('0x44')][_0x8304('0x26')]);_0x3324f7['query']=_['keys'](_0x3d9e56[_0x8304('0x29')]);_0x3324f7['filters']=_['intersection'](_0x3324f7[_0x8304('0x2c')],_0x3324f7[_0x8304('0x29')]);_0x5c0eed['attributes']=_[_0x8304('0x2b')](_0x3324f7[_0x8304('0x2c')],qs[_0x8304('0x2e')](_0x3d9e56[_0x8304('0x29')][_0x8304('0x2e')]));_0x5c0eed[_0x8304('0x2d')]=_0x5c0eed[_0x8304('0x2d')]['length']?_0x5c0eed[_0x8304('0x2d')]:_0x3324f7[_0x8304('0x2c')];_0x5c0eed['order']=qs[_0x8304('0x32')](_0x3d9e56[_0x8304('0x29')][_0x8304('0x32')]);_0x5c0eed[_0x8304('0x33')]=qs[_0x8304('0x34')](_[_0x8304('0x35')](_0x3d9e56[_0x8304('0x29')],_0x3324f7[_0x8304('0x34')]));if(_0x3d9e56[_0x8304('0x29')]['filter']){_0x5c0eed[_0x8304('0x33')]=_[_0x8304('0x37')](_0x5c0eed[_0x8304('0x33')],{'$or':_[_0x8304('0x28')](_0x5c0eed['attributes'],function(_0x1ed87a){var _0x259e1a={};_0x259e1a[_0x1ed87a]={'$like':'%'+_0x3d9e56[_0x8304('0x29')][_0x8304('0x36')]+'%'};return _0x259e1a;})});}_0x5c0eed=_[_0x8304('0x37')]({},_0x5c0eed,_0x3d9e56[_0x8304('0x46')]);return _0x36995e[_0x8304('0x48')](_0x5c0eed);}})[_0x8304('0x1e')](function(_0x4b2ece){if(_0x4b2ece){_0x4da306=_0x4b2ece[_0x8304('0x2f')];if(!_0x3d9e56['query'][_0x8304('0x49')]('nolimit')){_0x5c0eed[_0x8304('0x17')]=qs[_0x8304('0x17')](_0x3d9e56[_0x8304('0x29')][_0x8304('0x17')]);_0x5c0eed['offset']=qs[_0x8304('0x31')](_0x3d9e56[_0x8304('0x29')]['offset']);}return _0x36995e[_0x8304('0x48')](_0x5c0eed);}})['then'](function(_0x45aeae){if(_0x45aeae){return _0x45aeae?{'count':_0x4da306,'rows':_0x45aeae}:null;}})['then'](respondWithResult(_0x14dd8f,null))['catch'](handleError(_0x14dd8f,null));}; \ No newline at end of file +var _0x1be4=['type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','rows','catch','show','length','includeAll','find','create','body','params','destroy','getFields','ServicenowField','pick','filter','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName'];(function(_0x588bc0,_0x49c74d){var _0x484ea7=function(_0x272efc){while(--_0x272efc){_0x588bc0['push'](_0x588bc0['shift']());}};_0x484ea7(++_0x49c74d);}(_0x1be4,0x122));var _0x41be=function(_0x4f8886,_0x9be826){_0x4f8886=_0x4f8886-0x0;var _0x3c49e4=_0x1be4[_0x4f8886];return _0x3c49e4;};'use strict';var emlformat=require(_0x41be('0x0'));var rimraf=require(_0x41be('0x1'));var zipdir=require(_0x41be('0x2'));var jsonpatch=require(_0x41be('0x3'));var rp=require('request-promise');var moment=require(_0x41be('0x4'));var BPromise=require(_0x41be('0x5'));var Mustache=require('mustache');var util=require(_0x41be('0x6'));var path=require(_0x41be('0x7'));var sox=require('sox');var csv=require(_0x41be('0x8'));var ejs=require(_0x41be('0x9'));var fs=require('fs');var fs_extra=require(_0x41be('0xa'));var _=require(_0x41be('0xb'));var squel=require(_0x41be('0xc'));var crypto=require(_0x41be('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x41be('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x41be('0xf'));var Redis=require(_0x41be('0x10'));var authService=require(_0x41be('0x11'));var qs=require(_0x41be('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41be('0x13'));var logger=require(_0x41be('0x14'))(_0x41be('0x15'));var utils=require(_0x41be('0x16'));var config=require(_0x41be('0x17'));var licenseUtil=require(_0x41be('0x18'));var db=require(_0x41be('0x19'))['db'];function respondWithStatusCode(_0x2da149,_0x4c7bc3){_0x4c7bc3=_0x4c7bc3||0xcc;return function(_0xb7861){if(_0xb7861){return _0x2da149['sendStatus'](_0x4c7bc3);}return _0x2da149[_0x41be('0x1a')](_0x4c7bc3)[_0x41be('0x1b')]();};}function respondWithResult(_0x5266f8,_0x1f9d71){_0x1f9d71=_0x1f9d71||0xc8;return function(_0x4c01f2){if(_0x4c01f2){return _0x5266f8[_0x41be('0x1a')](_0x1f9d71)[_0x41be('0x1c')](_0x4c01f2);}};}function respondWithFilteredResult(_0x246201,_0x18ddce){return function(_0xd48eeb){if(_0xd48eeb){var _0x513f9b=typeof _0x18ddce['offset']===_0x41be('0x1d')&&typeof _0x18ddce[_0x41be('0x1e')]==='undefined';var _0x5a0c57=_0xd48eeb[_0x41be('0x1f')];var _0x102e53=_0x513f9b?0x0:_0x18ddce[_0x41be('0x20')];var _0x4a5f10=_0x513f9b?_0xd48eeb[_0x41be('0x1f')]:_0x18ddce[_0x41be('0x20')]+_0x18ddce['limit'];var _0x57ee91;if(_0x4a5f10>=_0x5a0c57){_0x4a5f10=_0x5a0c57;_0x57ee91=0xc8;}else{_0x57ee91=0xce;}_0x246201[_0x41be('0x1a')](_0x57ee91);return _0x246201[_0x41be('0x21')](_0x41be('0x22'),_0x102e53+'-'+_0x4a5f10+'/'+_0x5a0c57)[_0x41be('0x1c')](_0xd48eeb);}return null;};}function patchUpdates(_0x5abcdc){return function(_0x3442c3){try{jsonpatch[_0x41be('0x23')](_0x3442c3,_0x5abcdc,!![]);}catch(_0x139d17){return BPromise[_0x41be('0x24')](_0x139d17);}return _0x3442c3[_0x41be('0x25')]();};}function saveUpdates(_0x50209c,_0x287f23){return function(_0x51bfd6){if(_0x51bfd6){return _0x51bfd6[_0x41be('0x26')](_0x50209c)['then'](function(_0x2de742){return _0x2de742;});}return null;};}function removeEntity(_0x59e339,_0x56e75b){return function(_0x591729){if(_0x591729){return _0x591729['destroy']()[_0x41be('0x27')](function(){_0x59e339[_0x41be('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b8d7e,_0x1b1dbb){return function(_0x3cc88b){if(!_0x3cc88b){_0x1b8d7e[_0x41be('0x28')](0x194);}return _0x3cc88b;};}function handleError(_0x42120f,_0x215b2b){_0x215b2b=_0x215b2b||0x1f4;return function(_0x29a05f){logger[_0x41be('0x29')](_0x29a05f[_0x41be('0x2a')]);if(_0x29a05f[_0x41be('0x2b')]){delete _0x29a05f[_0x41be('0x2b')];}_0x42120f[_0x41be('0x1a')](_0x215b2b)[_0x41be('0x2c')](_0x29a05f);};}exports[_0x41be('0x2d')]=function(_0x42d54e,_0x9db37f){var _0x3352c8={},_0x512a25={},_0x58b722={'count':0x0,'rows':[]};var _0x1ed4c3=_[_0x41be('0x2e')](db[_0x41be('0x2f')][_0x41be('0x30')],function(_0x4f6b49){return{'name':_0x4f6b49[_0x41be('0x31')],'type':_0x4f6b49[_0x41be('0x32')][_0x41be('0x33')]};});_0x512a25['model']=_[_0x41be('0x2e')](_0x1ed4c3,_0x41be('0x2b'));_0x512a25[_0x41be('0x34')]=_[_0x41be('0x35')](_0x42d54e['query']);_0x512a25[_0x41be('0x36')]=_['intersection'](_0x512a25[_0x41be('0x37')],_0x512a25[_0x41be('0x34')]);_0x3352c8[_0x41be('0x38')]=_[_0x41be('0x39')](_0x512a25[_0x41be('0x37')],qs[_0x41be('0x3a')](_0x42d54e[_0x41be('0x34')][_0x41be('0x3a')]));_0x3352c8[_0x41be('0x38')]=_0x3352c8[_0x41be('0x38')]['length']?_0x3352c8[_0x41be('0x38')]:_0x512a25[_0x41be('0x37')];if(!_0x42d54e['query'][_0x41be('0x3b')](_0x41be('0x3c'))){_0x3352c8[_0x41be('0x1e')]=qs[_0x41be('0x1e')](_0x42d54e['query'][_0x41be('0x1e')]);_0x3352c8[_0x41be('0x20')]=qs[_0x41be('0x20')](_0x42d54e[_0x41be('0x34')]['offset']);}_0x3352c8[_0x41be('0x3d')]=qs[_0x41be('0x3e')](_0x42d54e[_0x41be('0x34')]['sort']);_0x3352c8[_0x41be('0x3f')]=qs[_0x41be('0x36')](_['pick'](_0x42d54e[_0x41be('0x34')],_0x512a25[_0x41be('0x36')]),_0x1ed4c3);if(_0x42d54e['query']['filter']){_0x3352c8['where']=_[_0x41be('0x40')](_0x3352c8['where'],{'$or':_['map'](_0x1ed4c3,function(_0xa69d55){if(_0xa69d55[_0x41be('0x32')]!==_0x41be('0x41')){var _0x5a8cfd={};_0x5a8cfd[_0xa69d55[_0x41be('0x2b')]]={'$like':'%'+_0x42d54e[_0x41be('0x34')]['filter']+'%'};return _0x5a8cfd;}})});}_0x3352c8=_['merge']({},_0x3352c8,_0x42d54e[_0x41be('0x42')]);var _0x2075b8={'where':_0x3352c8[_0x41be('0x3f')]};return db[_0x41be('0x2f')]['count'](_0x2075b8)[_0x41be('0x27')](function(_0x36a17b){_0x58b722[_0x41be('0x1f')]=_0x36a17b;if(_0x42d54e[_0x41be('0x34')]['includeAll']){_0x3352c8[_0x41be('0x43')]=[{'all':!![]}];}return db[_0x41be('0x2f')]['findAll'](_0x3352c8);})[_0x41be('0x27')](function(_0x5d9785){_0x58b722[_0x41be('0x44')]=_0x5d9785;return _0x58b722;})[_0x41be('0x27')](respondWithFilteredResult(_0x9db37f,_0x3352c8))[_0x41be('0x45')](handleError(_0x9db37f,null));};exports[_0x41be('0x46')]=function(_0x16297c,_0x298482){var _0x4c91e4={'raw':![],'where':{'id':_0x16297c['params']['id']}},_0x1dcb61={};_0x1dcb61[_0x41be('0x37')]=_[_0x41be('0x35')](db['ServicenowConfiguration'][_0x41be('0x30')]);_0x1dcb61['query']=_['keys'](_0x16297c['query']);_0x1dcb61['filters']=_[_0x41be('0x39')](_0x1dcb61[_0x41be('0x37')],_0x1dcb61['query']);_0x4c91e4[_0x41be('0x38')]=_[_0x41be('0x39')](_0x1dcb61[_0x41be('0x37')],qs[_0x41be('0x3a')](_0x16297c['query']['fields']));_0x4c91e4[_0x41be('0x38')]=_0x4c91e4[_0x41be('0x38')][_0x41be('0x47')]?_0x4c91e4['attributes']:_0x1dcb61[_0x41be('0x37')];if(_0x16297c[_0x41be('0x34')][_0x41be('0x48')]){_0x4c91e4[_0x41be('0x43')]=[{'all':!![]}];}_0x4c91e4=_[_0x41be('0x40')]({},_0x4c91e4,_0x16297c[_0x41be('0x42')]);return db[_0x41be('0x2f')][_0x41be('0x49')](_0x4c91e4)[_0x41be('0x27')](handleEntityNotFound(_0x298482,null))[_0x41be('0x27')](respondWithResult(_0x298482,null))['catch'](handleError(_0x298482,null));};exports[_0x41be('0x4a')]=function(_0x29f36a,_0x391aab){return db['ServicenowConfiguration'][_0x41be('0x4a')](_0x29f36a[_0x41be('0x4b')],{})[_0x41be('0x27')](respondWithResult(_0x391aab,0xc9))[_0x41be('0x45')](handleError(_0x391aab,null));};exports[_0x41be('0x26')]=function(_0x34e1b6,_0x54b42b){if(_0x34e1b6[_0x41be('0x4b')]['id']){delete _0x34e1b6[_0x41be('0x4b')]['id'];}return db[_0x41be('0x2f')][_0x41be('0x49')]({'where':{'id':_0x34e1b6[_0x41be('0x4c')]['id']}})[_0x41be('0x27')](handleEntityNotFound(_0x54b42b,null))[_0x41be('0x27')](saveUpdates(_0x34e1b6[_0x41be('0x4b')],null))['then'](respondWithResult(_0x54b42b,null))['catch'](handleError(_0x54b42b,null));};exports[_0x41be('0x4d')]=function(_0x14ee06,_0xac4b3f){return db[_0x41be('0x2f')][_0x41be('0x49')]({'where':{'id':_0x14ee06[_0x41be('0x4c')]['id']}})[_0x41be('0x27')](handleEntityNotFound(_0xac4b3f,null))[_0x41be('0x27')](removeEntity(_0xac4b3f,null))[_0x41be('0x45')](handleError(_0xac4b3f,null));};exports[_0x41be('0x4e')]=function(_0x278f9b,_0x345520,_0x2e3972){var _0x3e5f3d={};var _0x49e653={};var _0x4f779b;var _0x165f66;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x278f9b[_0x41be('0x4c')]['id']}})[_0x41be('0x27')](handleEntityNotFound(_0x345520,null))[_0x41be('0x27')](function(_0x1c2c23){if(_0x1c2c23){_0x4f779b=_0x1c2c23;_0x49e653[_0x41be('0x37')]=_[_0x41be('0x35')](db[_0x41be('0x4f')]['rawAttributes']);_0x49e653[_0x41be('0x34')]=_[_0x41be('0x35')](_0x278f9b[_0x41be('0x34')]);_0x49e653['filters']=_[_0x41be('0x39')](_0x49e653[_0x41be('0x37')],_0x49e653[_0x41be('0x34')]);_0x3e5f3d[_0x41be('0x38')]=_[_0x41be('0x39')](_0x49e653['model'],qs[_0x41be('0x3a')](_0x278f9b['query'][_0x41be('0x3a')]));_0x3e5f3d['attributes']=_0x3e5f3d[_0x41be('0x38')]['length']?_0x3e5f3d['attributes']:_0x49e653[_0x41be('0x37')];_0x3e5f3d[_0x41be('0x3d')]=qs[_0x41be('0x3e')](_0x278f9b[_0x41be('0x34')][_0x41be('0x3e')]);_0x3e5f3d[_0x41be('0x3f')]=qs[_0x41be('0x36')](_[_0x41be('0x50')](_0x278f9b[_0x41be('0x34')],_0x49e653[_0x41be('0x36')]));if(_0x278f9b[_0x41be('0x34')][_0x41be('0x51')]){_0x3e5f3d[_0x41be('0x3f')]=_[_0x41be('0x40')](_0x3e5f3d[_0x41be('0x3f')],{'$or':_[_0x41be('0x2e')](_0x3e5f3d['attributes'],function(_0xa06e0c){var _0x2a7ef4={};_0x2a7ef4[_0xa06e0c]={'$like':'%'+_0x278f9b['query']['filter']+'%'};return _0x2a7ef4;})});}_0x3e5f3d=_[_0x41be('0x40')]({},_0x3e5f3d,_0x278f9b[_0x41be('0x42')]);return _0x4f779b[_0x41be('0x4e')](_0x3e5f3d);}})[_0x41be('0x27')](function(_0x15897f){if(_0x15897f){_0x165f66=_0x15897f[_0x41be('0x47')];if(!_0x278f9b['query'][_0x41be('0x3b')](_0x41be('0x3c'))){_0x3e5f3d['limit']=qs[_0x41be('0x1e')](_0x278f9b['query'][_0x41be('0x1e')]);_0x3e5f3d[_0x41be('0x20')]=qs[_0x41be('0x20')](_0x278f9b[_0x41be('0x34')][_0x41be('0x20')]);}return _0x4f779b[_0x41be('0x4e')](_0x3e5f3d);}})[_0x41be('0x27')](function(_0x3f8cf0){if(_0x3f8cf0){return _0x3f8cf0?{'count':_0x165f66,'rows':_0x3f8cf0}:null;}})['then'](respondWithResult(_0x345520,null))[_0x41be('0x45')](handleError(_0x345520,null));};exports[_0x41be('0x52')]=function(_0x10d9db,_0x269530,_0x2d317f){var _0x21c482={};var _0x1b9bfc={};var _0x45e4a1;var _0x2e39fe;return db[_0x41be('0x2f')]['findOne']({'where':{'id':_0x10d9db[_0x41be('0x4c')]['id']}})[_0x41be('0x27')](handleEntityNotFound(_0x269530,null))[_0x41be('0x27')](function(_0x138633){if(_0x138633){_0x45e4a1=_0x138633;_0x1b9bfc[_0x41be('0x37')]=_['keys'](db[_0x41be('0x4f')]['rawAttributes']);_0x1b9bfc['query']=_['keys'](_0x10d9db[_0x41be('0x34')]);_0x1b9bfc[_0x41be('0x36')]=_[_0x41be('0x39')](_0x1b9bfc[_0x41be('0x37')],_0x1b9bfc[_0x41be('0x34')]);_0x21c482['attributes']=_[_0x41be('0x39')](_0x1b9bfc[_0x41be('0x37')],qs[_0x41be('0x3a')](_0x10d9db['query']['fields']));_0x21c482[_0x41be('0x38')]=_0x21c482[_0x41be('0x38')][_0x41be('0x47')]?_0x21c482[_0x41be('0x38')]:_0x1b9bfc[_0x41be('0x37')];_0x21c482[_0x41be('0x3d')]=qs['sort'](_0x10d9db['query'][_0x41be('0x3e')]);_0x21c482['where']=qs['filters'](_[_0x41be('0x50')](_0x10d9db[_0x41be('0x34')],_0x1b9bfc[_0x41be('0x36')]));if(_0x10d9db['query'][_0x41be('0x51')]){_0x21c482[_0x41be('0x3f')]=_[_0x41be('0x40')](_0x21c482['where'],{'$or':_['map'](_0x21c482[_0x41be('0x38')],function(_0x8d6cf7){var _0x2ef534={};_0x2ef534[_0x8d6cf7]={'$like':'%'+_0x10d9db[_0x41be('0x34')][_0x41be('0x51')]+'%'};return _0x2ef534;})});}_0x21c482=_['merge']({},_0x21c482,_0x10d9db['options']);return _0x45e4a1[_0x41be('0x52')](_0x21c482);}})['then'](function(_0x16c209){if(_0x16c209){_0x2e39fe=_0x16c209[_0x41be('0x47')];if(!_0x10d9db[_0x41be('0x34')][_0x41be('0x3b')](_0x41be('0x3c'))){_0x21c482[_0x41be('0x1e')]=qs[_0x41be('0x1e')](_0x10d9db[_0x41be('0x34')][_0x41be('0x1e')]);_0x21c482[_0x41be('0x20')]=qs['offset'](_0x10d9db[_0x41be('0x34')][_0x41be('0x20')]);}return _0x45e4a1['getSubjects'](_0x21c482);}})[_0x41be('0x27')](function(_0x33597e){if(_0x33597e){return _0x33597e?{'count':_0x2e39fe,'rows':_0x33597e}:null;}})[_0x41be('0x27')](respondWithResult(_0x269530,null))[_0x41be('0x45')](handleError(_0x269530,null));};exports[_0x41be('0x53')]=function(_0x47dd7b,_0x537569,_0x2c5002){var _0x241d34={};var _0x2998d0={};var _0x7af5;var _0x285ed5;return db[_0x41be('0x2f')][_0x41be('0x54')]({'where':{'id':_0x47dd7b[_0x41be('0x4c')]['id']}})['then'](handleEntityNotFound(_0x537569,null))['then'](function(_0x460ee0){if(_0x460ee0){_0x7af5=_0x460ee0;_0x2998d0[_0x41be('0x37')]=_['keys'](db[_0x41be('0x4f')]['rawAttributes']);_0x2998d0[_0x41be('0x34')]=_['keys'](_0x47dd7b[_0x41be('0x34')]);_0x2998d0[_0x41be('0x36')]=_[_0x41be('0x39')](_0x2998d0[_0x41be('0x37')],_0x2998d0[_0x41be('0x34')]);_0x241d34['attributes']=_[_0x41be('0x39')](_0x2998d0[_0x41be('0x37')],qs[_0x41be('0x3a')](_0x47dd7b[_0x41be('0x34')][_0x41be('0x3a')]));_0x241d34['attributes']=_0x241d34[_0x41be('0x38')][_0x41be('0x47')]?_0x241d34[_0x41be('0x38')]:_0x2998d0[_0x41be('0x37')];_0x241d34[_0x41be('0x3d')]=qs['sort'](_0x47dd7b[_0x41be('0x34')][_0x41be('0x3e')]);_0x241d34['where']=qs[_0x41be('0x36')](_[_0x41be('0x50')](_0x47dd7b[_0x41be('0x34')],_0x2998d0[_0x41be('0x36')]));if(_0x47dd7b[_0x41be('0x34')][_0x41be('0x51')]){_0x241d34[_0x41be('0x3f')]=_[_0x41be('0x40')](_0x241d34[_0x41be('0x3f')],{'$or':_['map'](_0x241d34[_0x41be('0x38')],function(_0x214f4a){var _0x4144b2={};_0x4144b2[_0x214f4a]={'$like':'%'+_0x47dd7b[_0x41be('0x34')][_0x41be('0x51')]+'%'};return _0x4144b2;})});}_0x241d34=_[_0x41be('0x40')]({},_0x241d34,_0x47dd7b[_0x41be('0x42')]);return _0x7af5[_0x41be('0x53')](_0x241d34);}})[_0x41be('0x27')](function(_0x239b46){if(_0x239b46){_0x285ed5=_0x239b46[_0x41be('0x47')];if(!_0x47dd7b[_0x41be('0x34')][_0x41be('0x3b')](_0x41be('0x3c'))){_0x241d34['limit']=qs[_0x41be('0x1e')](_0x47dd7b[_0x41be('0x34')][_0x41be('0x1e')]);_0x241d34['offset']=qs[_0x41be('0x20')](_0x47dd7b['query']['offset']);}return _0x7af5[_0x41be('0x53')](_0x241d34);}})['then'](function(_0x152b2f){if(_0x152b2f){return _0x152b2f?{'count':_0x285ed5,'rows':_0x152b2f}:null;}})[_0x41be('0x27')](respondWithResult(_0x537569,null))[_0x41be('0x45')](handleError(_0x537569,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 2fc25b7..52c44f1 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 _0x07a2=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2cc2e2,_0x5cc9d3){var _0x171c41=function(_0x51f1de){while(--_0x51f1de){_0x2cc2e2['push'](_0x2cc2e2['shift']());}};_0x171c41(++_0x5cc9d3);}(_0x07a2,0x12c));var _0x207a=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0x07a2[_0x25efdf];return _0x22c495;};'use strict';var _=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var logger=require('../../config/logger')(_0x207a('0x2'));var moment=require(_0x207a('0x3'));var BPromise=require(_0x207a('0x4'));var rp=require(_0x207a('0x5'));var fs=require('fs');var path=require(_0x207a('0x6'));var rimraf=require(_0x207a('0x7'));var config=require(_0x207a('0x8'));var attributes=require(_0x207a('0x9'));module[_0x207a('0xa')]=function(_0x47dbbf,_0x5b1fa9){return _0x47dbbf[_0x207a('0xb')](_0x207a('0xc'),attributes,{'tableName':_0x207a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3013=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x331b08,_0x2c5937){var _0x5034d9=function(_0x2c916a){while(--_0x2c916a){_0x331b08['push'](_0x331b08['shift']());}};_0x5034d9(++_0x2c5937);}(_0x3013,0xea));var _0x3301=function(_0x12cfc6,_0x15727e){_0x12cfc6=_0x12cfc6-0x0;var _0x421bef=_0x3013[_0x12cfc6];return _0x421bef;};'use strict';var _=require(_0x3301('0x0'));var util=require(_0x3301('0x1'));var logger=require(_0x3301('0x2'))(_0x3301('0x3'));var moment=require('moment');var BPromise=require(_0x3301('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3301('0x5'));var rimraf=require(_0x3301('0x6'));var config=require(_0x3301('0x7'));var attributes=require(_0x3301('0x8'));module['exports']=function(_0x30b608,_0x52515d){return _0x30b608[_0x3301('0x9')](_0x3301('0xa'),attributes,{'tableName':_0x3301('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index b12fbb7..f7b395c 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 _0x973b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x54b58d,_0x8584b){var _0x5a2b28=function(_0x5eedc8){while(--_0x5eedc8){_0x54b58d['push'](_0x54b58d['shift']());}};_0x5a2b28(++_0x8584b);}(_0x973b,0x6e));var _0xb973=function(_0xe126fb,_0x8cb1e1){_0xe126fb=_0xe126fb-0x0;var _0x1f6d1d=_0x973b[_0xe126fb];return _0x1f6d1d;};'use strict';var _=require(_0xb973('0x0'));var util=require(_0xb973('0x1'));var moment=require(_0xb973('0x2'));var BPromise=require(_0xb973('0x3'));var rs=require(_0xb973('0x4'));var fs=require('fs');var Redis=require(_0xb973('0x5'));var db=require(_0xb973('0x6'))['db'];var utils=require(_0xb973('0x7'));var logger=require(_0xb973('0x8'))(_0xb973('0x9'));var config=require(_0xb973('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb973('0xb')][_0xb973('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5160b1,_0x2a8ed6,_0x532c97){return new BPromise(function(_0x584286,_0xc12b98){return client[_0xb973('0xd')](_0x5160b1,_0x532c97)['then'](function(_0x5a3960){logger[_0xb973('0xe')](_0xb973('0xf'),_0x2a8ed6,_0xb973('0x10'));logger[_0xb973('0x11')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2a8ed6,'request\x20sent',JSON[_0xb973('0x12')](_0x5a3960));if(_0x5a3960[_0xb973('0x13')]){if(_0x5a3960['error']['code']===0x1f4){logger[_0xb973('0x13')](_0xb973('0xf'),_0x2a8ed6,_0x5a3960[_0xb973('0x13')][_0xb973('0x14')]);return _0xc12b98(_0x5a3960[_0xb973('0x13')][_0xb973('0x14')]);}logger[_0xb973('0x13')](_0xb973('0xf'),_0x2a8ed6,_0x5a3960['error'][_0xb973('0x14')]);return _0x584286(_0x5a3960['error'][_0xb973('0x14')]);}else{logger[_0xb973('0xe')](_0xb973('0xf'),_0x2a8ed6,_0xb973('0x10'));_0x584286(_0x5a3960[_0xb973('0x15')][_0xb973('0x14')]);}})[_0xb973('0x16')](function(_0x3462c5){logger[_0xb973('0x13')](_0xb973('0xf'),_0x2a8ed6,_0x3462c5);_0xc12b98(_0x3462c5);});});} \ No newline at end of file +var _0x4e06=['stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x4e06,0x1d2));var _0x64e0=function(_0x276846,_0x7c88b0){_0x276846=_0x276846-0x0;var _0x25a493=_0x4e06[_0x276846];return _0x25a493;};'use strict';var _=require(_0x64e0('0x0'));var util=require(_0x64e0('0x1'));var moment=require(_0x64e0('0x2'));var BPromise=require(_0x64e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64e0('0x4'));var db=require(_0x64e0('0x5'))['db'];var utils=require(_0x64e0('0x6'));var logger=require(_0x64e0('0x7'))(_0x64e0('0x8'));var config=require('../../config/environment');var jayson=require(_0x64e0('0x9'));var client=jayson[_0x64e0('0xa')][_0x64e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x63dbec,_0x32b867,_0x12cd81){return new BPromise(function(_0x1f197b,_0x191e5d){return client[_0x64e0('0xc')](_0x63dbec,_0x12cd81)[_0x64e0('0xd')](function(_0xc6ad41){logger[_0x64e0('0xe')](_0x64e0('0xf'),_0x32b867,_0x64e0('0x10'));logger[_0x64e0('0x11')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x32b867,_0x64e0('0x10'),JSON[_0x64e0('0x12')](_0xc6ad41));if(_0xc6ad41[_0x64e0('0x13')]){if(_0xc6ad41[_0x64e0('0x13')]['code']===0x1f4){logger[_0x64e0('0x13')](_0x64e0('0xf'),_0x32b867,_0xc6ad41[_0x64e0('0x13')][_0x64e0('0x14')]);return _0x191e5d(_0xc6ad41[_0x64e0('0x13')][_0x64e0('0x14')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x32b867,_0xc6ad41[_0x64e0('0x13')][_0x64e0('0x14')]);return _0x1f197b(_0xc6ad41[_0x64e0('0x13')][_0x64e0('0x14')]);}else{logger[_0x64e0('0xe')](_0x64e0('0xf'),_0x32b867,'request\x20sent');_0x1f197b(_0xc6ad41['result'][_0x64e0('0x14')]);}})[_0x64e0('0x15')](function(_0x176693){logger[_0x64e0('0x13')](_0x64e0('0xf'),_0x32b867,_0x176693);_0x191e5d(_0x176693);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 10753a7..f220785 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 _0xbff8=['index','/:id','show','post','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbff8,0x1c9));var _0x8bff=function(_0xc2c644,_0x5b668d){_0xc2c644=_0xc2c644-0x0;var _0x323853=_0xbff8[_0xc2c644];return _0x323853;};'use strict';var multer=require('multer');var util=require(_0x8bff('0x0'));var path=require(_0x8bff('0x1'));var timeout=require(_0x8bff('0x2'));var express=require(_0x8bff('0x3'));var router=express[_0x8bff('0x4')]();var fs_extra=require(_0x8bff('0x5'));var auth=require(_0x8bff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8bff('0x7'));var controller=require(_0x8bff('0x8'));router[_0x8bff('0x9')]('/',auth[_0x8bff('0xa')](),controller[_0x8bff('0xb')]);router[_0x8bff('0x9')](_0x8bff('0xc'),auth['isAuthenticated'](),controller[_0x8bff('0xd')]);router[_0x8bff('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x8bff('0xa')](),controller[_0x8bff('0xf')]);router['delete']('/:id',auth[_0x8bff('0xa')](),controller[_0x8bff('0x10')]);module[_0x8bff('0x11')]=router; \ No newline at end of file +var _0xae05=['isAuthenticated','show','/:id','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index'];(function(_0x18ea9d,_0x2072c2){var _0xe3e295=function(_0x1d180c){while(--_0x1d180c){_0x18ea9d['push'](_0x18ea9d['shift']());}};_0xe3e295(++_0x2072c2);}(_0xae05,0x165));var _0x5ae0=function(_0x155e04,_0x28cd61){_0x155e04=_0x155e04-0x0;var _0x4590d0=_0xae05[_0x155e04];return _0x4590d0;};'use strict';var multer=require('multer');var util=require(_0x5ae0('0x0'));var path=require(_0x5ae0('0x1'));var timeout=require(_0x5ae0('0x2'));var express=require('express');var router=express[_0x5ae0('0x3')]();var fs_extra=require(_0x5ae0('0x4'));var auth=require(_0x5ae0('0x5'));var interaction=require(_0x5ae0('0x6'));var config=require(_0x5ae0('0x7'));var controller=require(_0x5ae0('0x8'));router[_0x5ae0('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ae0('0xa')]);router['get']('/:id',auth[_0x5ae0('0xb')](),controller[_0x5ae0('0xc')]);router['post']('/',auth[_0x5ae0('0xb')](),controller['create']);router['put'](_0x5ae0('0xd'),auth[_0x5ae0('0xb')](),controller['update']);router[_0x5ae0('0xe')](_0x5ae0('0xd'),auth['isAuthenticated'](),controller[_0x5ae0('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 98d0384..4c39468 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 _0x605b=['picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x1f2af1,_0x386181){var _0x139dc3=function(_0x174f25){while(--_0x174f25){_0x1f2af1['push'](_0x1f2af1['shift']());}};_0x139dc3(++_0x386181);}(_0x605b,0x1e4));var _0xb605=function(_0x5f122a,_0x4b147d){_0x5f122a=_0x5f122a-0x0;var _0x153b21=_0x605b[_0x5f122a];return _0x153b21;};'use strict';var Sequelize=require(_0xb605('0x0'));module[_0xb605('0x1')]={'type':{'type':Sequelize[_0xb605('0x2')](_0xb605('0x3'),'variable',_0xb605('0x4'),_0xb605('0x5'),_0xb605('0x6')),'defaultValue':_0xb605('0x3')},'content':{'type':Sequelize[_0xb605('0x7')]},'key':{'type':Sequelize[_0xb605('0x7')]},'keyType':{'type':Sequelize[_0xb605('0x2')](_0xb605('0x3'),_0xb605('0x8'),_0xb605('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb605('0x7')]},'nameField':{'type':Sequelize[_0xb605('0x7')]},'customField':{'type':Sequelize[_0xb605('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb605('0x7')]}}; \ No newline at end of file +var _0xdc9a=['variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM'];(function(_0x1c0dd6,_0x1d5b20){var _0x4c5382=function(_0x242e10){while(--_0x242e10){_0x1c0dd6['push'](_0x1c0dd6['shift']());}};_0x4c5382(++_0x1d5b20);}(_0xdc9a,0x138));var _0xadc9=function(_0x5dfff5,_0x34e32e){_0x5dfff5=_0x5dfff5-0x0;var _0x504a80=_0xdc9a[_0x5dfff5];return _0x504a80;};'use strict';var Sequelize=require(_0xadc9('0x0'));module[_0xadc9('0x1')]={'type':{'type':Sequelize[_0xadc9('0x2')]('string',_0xadc9('0x3'),_0xadc9('0x4'),_0xadc9('0x5'),_0xadc9('0x6')),'defaultValue':_0xadc9('0x7')},'content':{'type':Sequelize[_0xadc9('0x8')]},'key':{'type':Sequelize[_0xadc9('0x8')]},'keyType':{'type':Sequelize[_0xadc9('0x2')](_0xadc9('0x7'),'variable',_0xadc9('0x4'))},'keyContent':{'type':Sequelize[_0xadc9('0x8')]},'idField':{'type':Sequelize[_0xadc9('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xadc9('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 450c554..74e5447 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 _0x4afe=['error','name','index','map','ServicenowField','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','eml-format','zip-dir','request-promise','moment','mustache','path','sox','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x3f83ea,_0x216211){var _0x2a786a=function(_0x3c4f7f){while(--_0x3c4f7f){_0x3f83ea['push'](_0x3f83ea['shift']());}};_0x2a786a(++_0x216211);}(_0x4afe,0x1c1));var _0xe4af=function(_0x22c938,_0x49126a){_0x22c938=_0x22c938-0x0;var _0x1a964f=_0x4afe[_0x22c938];return _0x1a964f;};'use strict';var emlformat=require(_0xe4af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4af('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4af('0x2'));var moment=require(_0xe4af('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe4af('0x4'));var util=require('util');var path=require(_0xe4af('0x5'));var sox=require(_0xe4af('0x6'));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('squel');var crypto=require('crypto');var jsforce=require(_0xe4af('0x7'));var deskjs=require(_0xe4af('0x8'));var toCsv=require(_0xe4af('0x9'));var querystring=require(_0xe4af('0xa'));var Papa=require(_0xe4af('0xb'));var Redis=require(_0xe4af('0xc'));var authService=require(_0xe4af('0xd'));var qs=require(_0xe4af('0xe'));var as=require(_0xe4af('0xf'));var hardwareService=require(_0xe4af('0x10'));var logger=require(_0xe4af('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xe4af('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20d9c6,_0x29778c){_0x29778c=_0x29778c||0xcc;return function(_0x3c2432){if(_0x3c2432){return _0x20d9c6[_0xe4af('0x13')](_0x29778c);}return _0x20d9c6[_0xe4af('0x14')](_0x29778c)[_0xe4af('0x15')]();};}function respondWithResult(_0x35adf2,_0x1f2b45){_0x1f2b45=_0x1f2b45||0xc8;return function(_0x4d4240){if(_0x4d4240){return _0x35adf2[_0xe4af('0x14')](_0x1f2b45)[_0xe4af('0x16')](_0x4d4240);}};}function respondWithFilteredResult(_0x28e8c7,_0x48bc1e){return function(_0x502a14){if(_0x502a14){var _0x19702c=typeof _0x48bc1e['offset']===_0xe4af('0x17')&&typeof _0x48bc1e[_0xe4af('0x18')]===_0xe4af('0x17');var _0x243354=_0x502a14[_0xe4af('0x19')];var _0x4ba6bc=_0x19702c?0x0:_0x48bc1e[_0xe4af('0x1a')];var _0x1b7a35=_0x19702c?_0x502a14[_0xe4af('0x19')]:_0x48bc1e[_0xe4af('0x1a')]+_0x48bc1e[_0xe4af('0x18')];var _0x4438ee;if(_0x1b7a35>=_0x243354){_0x1b7a35=_0x243354;_0x4438ee=0xc8;}else{_0x4438ee=0xce;}_0x28e8c7['status'](_0x4438ee);return _0x28e8c7[_0xe4af('0x1b')](_0xe4af('0x1c'),_0x4ba6bc+'-'+_0x1b7a35+'/'+_0x243354)[_0xe4af('0x16')](_0x502a14);}return null;};}function patchUpdates(_0x5db2a9){return function(_0x5f2f15){try{jsonpatch[_0xe4af('0x1d')](_0x5f2f15,_0x5db2a9,!![]);}catch(_0x1c72ce){return BPromise[_0xe4af('0x1e')](_0x1c72ce);}return _0x5f2f15['save']();};}function saveUpdates(_0x3eaf08,_0x525844){return function(_0x4fa76e){if(_0x4fa76e){return _0x4fa76e[_0xe4af('0x1f')](_0x3eaf08)[_0xe4af('0x20')](function(_0x85ae17){return _0x85ae17;});}return null;};}function removeEntity(_0xfa580f,_0x596ab0){return function(_0x43fb57){if(_0x43fb57){return _0x43fb57[_0xe4af('0x21')]()[_0xe4af('0x20')](function(){_0xfa580f[_0xe4af('0x14')](0xcc)[_0xe4af('0x15')]();});}};}function handleEntityNotFound(_0xb9f3a4,_0x54ace3){return function(_0x2d0d54){if(!_0x2d0d54){_0xb9f3a4['sendStatus'](0x194);}return _0x2d0d54;};}function handleError(_0x341a52,_0x16d48d){_0x16d48d=_0x16d48d||0x1f4;return function(_0x2ca688){logger[_0xe4af('0x22')](_0x2ca688['stack']);if(_0x2ca688[_0xe4af('0x23')]){delete _0x2ca688[_0xe4af('0x23')];}_0x341a52[_0xe4af('0x14')](_0x16d48d)['send'](_0x2ca688);};}exports[_0xe4af('0x24')]=function(_0x2ba819,_0x556253){var _0x19082e={},_0x15890f={},_0x253f4d={'count':0x0,'rows':[]};var _0x49077c=_[_0xe4af('0x25')](db[_0xe4af('0x26')][_0xe4af('0x27')],function(_0x3aa6d6){return{'name':_0x3aa6d6[_0xe4af('0x28')],'type':_0x3aa6d6['type']['key']};});_0x15890f[_0xe4af('0x29')]=_['map'](_0x49077c,_0xe4af('0x23'));_0x15890f[_0xe4af('0x2a')]=_[_0xe4af('0x2b')](_0x2ba819[_0xe4af('0x2a')]);_0x15890f[_0xe4af('0x2c')]=_['intersection'](_0x15890f[_0xe4af('0x29')],_0x15890f[_0xe4af('0x2a')]);_0x19082e['attributes']=_[_0xe4af('0x2d')](_0x15890f[_0xe4af('0x29')],qs[_0xe4af('0x2e')](_0x2ba819[_0xe4af('0x2a')][_0xe4af('0x2e')]));_0x19082e[_0xe4af('0x2f')]=_0x19082e[_0xe4af('0x2f')]['length']?_0x19082e[_0xe4af('0x2f')]:_0x15890f[_0xe4af('0x29')];if(!_0x2ba819[_0xe4af('0x2a')][_0xe4af('0x30')](_0xe4af('0x31'))){_0x19082e[_0xe4af('0x18')]=qs[_0xe4af('0x18')](_0x2ba819['query']['limit']);_0x19082e[_0xe4af('0x1a')]=qs[_0xe4af('0x1a')](_0x2ba819[_0xe4af('0x2a')][_0xe4af('0x1a')]);}_0x19082e[_0xe4af('0x32')]=qs[_0xe4af('0x33')](_0x2ba819['query']['sort']);_0x19082e[_0xe4af('0x34')]=qs['filters'](_[_0xe4af('0x35')](_0x2ba819['query'],_0x15890f['filters']),_0x49077c);if(_0x2ba819[_0xe4af('0x2a')][_0xe4af('0x36')]){_0x19082e[_0xe4af('0x34')]=_[_0xe4af('0x37')](_0x19082e['where'],{'$or':_[_0xe4af('0x25')](_0x49077c,function(_0x225a83){if(_0x225a83[_0xe4af('0x38')]!==_0xe4af('0x39')){var _0x4edb63={};_0x4edb63[_0x225a83['name']]={'$like':'%'+_0x2ba819['query'][_0xe4af('0x36')]+'%'};return _0x4edb63;}})});}_0x19082e=_[_0xe4af('0x37')]({},_0x19082e,_0x2ba819[_0xe4af('0x3a')]);var _0x3690a6={'where':_0x19082e[_0xe4af('0x34')]};return db[_0xe4af('0x26')]['count'](_0x3690a6)[_0xe4af('0x20')](function(_0x34973d){_0x253f4d[_0xe4af('0x19')]=_0x34973d;if(_0x2ba819[_0xe4af('0x2a')][_0xe4af('0x3b')]){_0x19082e[_0xe4af('0x3c')]=[{'all':!![]}];}return db['ServicenowField'][_0xe4af('0x3d')](_0x19082e);})['then'](function(_0x3b4f90){_0x253f4d['rows']=_0x3b4f90;return _0x253f4d;})['then'](respondWithFilteredResult(_0x556253,_0x19082e))[_0xe4af('0x3e')](handleError(_0x556253,null));};exports[_0xe4af('0x3f')]=function(_0x561086,_0x319464){var _0x4296ca={'raw':!![],'where':{'id':_0x561086[_0xe4af('0x40')]['id']}},_0xe07a0a={};_0xe07a0a[_0xe4af('0x29')]=_[_0xe4af('0x2b')](db['ServicenowField'][_0xe4af('0x27')]);_0xe07a0a['query']=_[_0xe4af('0x2b')](_0x561086[_0xe4af('0x2a')]);_0xe07a0a[_0xe4af('0x2c')]=_[_0xe4af('0x2d')](_0xe07a0a[_0xe4af('0x29')],_0xe07a0a[_0xe4af('0x2a')]);_0x4296ca[_0xe4af('0x2f')]=_[_0xe4af('0x2d')](_0xe07a0a[_0xe4af('0x29')],qs[_0xe4af('0x2e')](_0x561086[_0xe4af('0x2a')][_0xe4af('0x2e')]));_0x4296ca[_0xe4af('0x2f')]=_0x4296ca[_0xe4af('0x2f')][_0xe4af('0x41')]?_0x4296ca[_0xe4af('0x2f')]:_0xe07a0a[_0xe4af('0x29')];if(_0x561086[_0xe4af('0x2a')][_0xe4af('0x3b')]){_0x4296ca[_0xe4af('0x3c')]=[{'all':!![]}];}_0x4296ca=_[_0xe4af('0x37')]({},_0x4296ca,_0x561086['options']);return db['ServicenowField'][_0xe4af('0x42')](_0x4296ca)[_0xe4af('0x20')](handleEntityNotFound(_0x319464,null))[_0xe4af('0x20')](respondWithResult(_0x319464,null))[_0xe4af('0x3e')](handleError(_0x319464,null));};exports[_0xe4af('0x43')]=function(_0x7bb0b2,_0x5274d6){return db[_0xe4af('0x26')]['create'](_0x7bb0b2['body'],{})[_0xe4af('0x20')](respondWithResult(_0x5274d6,0xc9))[_0xe4af('0x3e')](handleError(_0x5274d6,null));};exports[_0xe4af('0x1f')]=function(_0xf394c5,_0xe60b31){if(_0xf394c5['body']['id']){delete _0xf394c5[_0xe4af('0x44')]['id'];}return db[_0xe4af('0x26')][_0xe4af('0x42')]({'where':{'id':_0xf394c5['params']['id']}})[_0xe4af('0x20')](handleEntityNotFound(_0xe60b31,null))[_0xe4af('0x20')](saveUpdates(_0xf394c5[_0xe4af('0x44')],null))[_0xe4af('0x20')](respondWithResult(_0xe60b31,null))[_0xe4af('0x3e')](handleError(_0xe60b31,null));};exports[_0xe4af('0x21')]=function(_0x4ad0ee,_0x43d4c5){return db[_0xe4af('0x26')]['find']({'where':{'id':_0x4ad0ee['params']['id']}})[_0xe4af('0x20')](handleEntityNotFound(_0x43d4c5,null))[_0xe4af('0x20')](removeEntity(_0x43d4c5,null))[_0xe4af('0x3e')](handleError(_0x43d4c5,null));}; \ No newline at end of file +var _0xd43c=['fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','ServicenowField','rawAttributes'];(function(_0x59c940,_0x248942){var _0x4e092a=function(_0x52a076){while(--_0x52a076){_0x59c940['push'](_0x59c940['shift']());}};_0x4e092a(++_0x248942);}(_0xd43c,0x19a));var _0xcd43=function(_0x367b29,_0x184544){_0x367b29=_0x367b29-0x0;var _0x7a1a95=_0xd43c[_0x367b29];return _0x7a1a95;};'use strict';var emlformat=require(_0xcd43('0x0'));var rimraf=require(_0xcd43('0x1'));var zipdir=require(_0xcd43('0x2'));var jsonpatch=require(_0xcd43('0x3'));var rp=require(_0xcd43('0x4'));var moment=require('moment');var BPromise=require(_0xcd43('0x5'));var Mustache=require(_0xcd43('0x6'));var util=require('util');var path=require(_0xcd43('0x7'));var sox=require('sox');var csv=require(_0xcd43('0x8'));var ejs=require(_0xcd43('0x9'));var fs=require('fs');var fs_extra=require(_0xcd43('0xa'));var _=require('lodash');var squel=require(_0xcd43('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcd43('0x8'));var querystring=require(_0xcd43('0xc'));var Papa=require(_0xcd43('0xd'));var Redis=require('ioredis');var authService=require(_0xcd43('0xe'));var qs=require(_0xcd43('0xf'));var as=require(_0xcd43('0x10'));var hardwareService=require(_0xcd43('0x11'));var logger=require(_0xcd43('0x12'))(_0xcd43('0x13'));var utils=require(_0xcd43('0x14'));var config=require(_0xcd43('0x15'));var licenseUtil=require(_0xcd43('0x16'));var db=require(_0xcd43('0x17'))['db'];function respondWithStatusCode(_0x2e9c85,_0x137b3f){_0x137b3f=_0x137b3f||0xcc;return function(_0x4ededf){if(_0x4ededf){return _0x2e9c85[_0xcd43('0x18')](_0x137b3f);}return _0x2e9c85[_0xcd43('0x19')](_0x137b3f)[_0xcd43('0x1a')]();};}function respondWithResult(_0x2dc396,_0x2ceb7b){_0x2ceb7b=_0x2ceb7b||0xc8;return function(_0xea7fa9){if(_0xea7fa9){return _0x2dc396['status'](_0x2ceb7b)[_0xcd43('0x1b')](_0xea7fa9);}};}function respondWithFilteredResult(_0x5d8398,_0x13eb51){return function(_0xb35700){if(_0xb35700){var _0x487bef=typeof _0x13eb51['offset']===_0xcd43('0x1c')&&typeof _0x13eb51[_0xcd43('0x1d')]===_0xcd43('0x1c');var _0x507989=_0xb35700[_0xcd43('0x1e')];var _0x560cde=_0x487bef?0x0:_0x13eb51[_0xcd43('0x1f')];var _0x28c01d=_0x487bef?_0xb35700['count']:_0x13eb51[_0xcd43('0x1f')]+_0x13eb51[_0xcd43('0x1d')];var _0x8ac02a;if(_0x28c01d>=_0x507989){_0x28c01d=_0x507989;_0x8ac02a=0xc8;}else{_0x8ac02a=0xce;}_0x5d8398['status'](_0x8ac02a);return _0x5d8398[_0xcd43('0x20')](_0xcd43('0x21'),_0x560cde+'-'+_0x28c01d+'/'+_0x507989)['json'](_0xb35700);}return null;};}function patchUpdates(_0x404588){return function(_0x5a8c8c){try{jsonpatch[_0xcd43('0x22')](_0x5a8c8c,_0x404588,!![]);}catch(_0x5df616){return BPromise['reject'](_0x5df616);}return _0x5a8c8c[_0xcd43('0x23')]();};}function saveUpdates(_0x27803c,_0x29b21c){return function(_0x59e47e){if(_0x59e47e){return _0x59e47e[_0xcd43('0x24')](_0x27803c)[_0xcd43('0x25')](function(_0x5cea34){return _0x5cea34;});}return null;};}function removeEntity(_0x2368b5,_0x184889){return function(_0x3966d2){if(_0x3966d2){return _0x3966d2[_0xcd43('0x26')]()[_0xcd43('0x25')](function(){_0x2368b5[_0xcd43('0x19')](0xcc)[_0xcd43('0x1a')]();});}};}function handleEntityNotFound(_0x444e2d,_0x227ab7){return function(_0x4ac28e){if(!_0x4ac28e){_0x444e2d[_0xcd43('0x18')](0x194);}return _0x4ac28e;};}function handleError(_0x40b124,_0x50fa40){_0x50fa40=_0x50fa40||0x1f4;return function(_0x2d2979){logger[_0xcd43('0x27')](_0x2d2979['stack']);if(_0x2d2979[_0xcd43('0x28')]){delete _0x2d2979['name'];}_0x40b124[_0xcd43('0x19')](_0x50fa40)[_0xcd43('0x29')](_0x2d2979);};}exports[_0xcd43('0x2a')]=function(_0x8b7e48,_0x414416){var _0x444c4f={},_0x15c7fd={},_0x1da9c4={'count':0x0,'rows':[]};var _0x326982=_[_0xcd43('0x2b')](db[_0xcd43('0x2c')][_0xcd43('0x2d')],function(_0x3c006a){return{'name':_0x3c006a[_0xcd43('0x2e')],'type':_0x3c006a[_0xcd43('0x2f')]['key']};});_0x15c7fd[_0xcd43('0x30')]=_[_0xcd43('0x2b')](_0x326982,'name');_0x15c7fd['query']=_[_0xcd43('0x31')](_0x8b7e48[_0xcd43('0x32')]);_0x15c7fd[_0xcd43('0x33')]=_[_0xcd43('0x34')](_0x15c7fd[_0xcd43('0x30')],_0x15c7fd[_0xcd43('0x32')]);_0x444c4f[_0xcd43('0x35')]=_[_0xcd43('0x34')](_0x15c7fd['model'],qs[_0xcd43('0x36')](_0x8b7e48[_0xcd43('0x32')][_0xcd43('0x36')]));_0x444c4f[_0xcd43('0x35')]=_0x444c4f[_0xcd43('0x35')][_0xcd43('0x37')]?_0x444c4f[_0xcd43('0x35')]:_0x15c7fd[_0xcd43('0x30')];if(!_0x8b7e48[_0xcd43('0x32')][_0xcd43('0x38')](_0xcd43('0x39'))){_0x444c4f['limit']=qs[_0xcd43('0x1d')](_0x8b7e48[_0xcd43('0x32')][_0xcd43('0x1d')]);_0x444c4f[_0xcd43('0x1f')]=qs[_0xcd43('0x1f')](_0x8b7e48['query'][_0xcd43('0x1f')]);}_0x444c4f[_0xcd43('0x3a')]=qs[_0xcd43('0x3b')](_0x8b7e48[_0xcd43('0x32')]['sort']);_0x444c4f[_0xcd43('0x3c')]=qs[_0xcd43('0x33')](_[_0xcd43('0x3d')](_0x8b7e48[_0xcd43('0x32')],_0x15c7fd[_0xcd43('0x33')]),_0x326982);if(_0x8b7e48[_0xcd43('0x32')][_0xcd43('0x3e')]){_0x444c4f['where']=_[_0xcd43('0x3f')](_0x444c4f['where'],{'$or':_[_0xcd43('0x2b')](_0x326982,function(_0x3c8f1f){if(_0x3c8f1f[_0xcd43('0x2f')]!==_0xcd43('0x40')){var _0x2f6893={};_0x2f6893[_0x3c8f1f[_0xcd43('0x28')]]={'$like':'%'+_0x8b7e48['query'][_0xcd43('0x3e')]+'%'};return _0x2f6893;}})});}_0x444c4f=_[_0xcd43('0x3f')]({},_0x444c4f,_0x8b7e48[_0xcd43('0x41')]);var _0x219d4b={'where':_0x444c4f[_0xcd43('0x3c')]};return db[_0xcd43('0x2c')][_0xcd43('0x1e')](_0x219d4b)[_0xcd43('0x25')](function(_0x2bc0a4){_0x1da9c4[_0xcd43('0x1e')]=_0x2bc0a4;if(_0x8b7e48[_0xcd43('0x32')]['includeAll']){_0x444c4f[_0xcd43('0x42')]=[{'all':!![]}];}return db[_0xcd43('0x2c')][_0xcd43('0x43')](_0x444c4f);})[_0xcd43('0x25')](function(_0x2fcc47){_0x1da9c4[_0xcd43('0x44')]=_0x2fcc47;return _0x1da9c4;})['then'](respondWithFilteredResult(_0x414416,_0x444c4f))[_0xcd43('0x45')](handleError(_0x414416,null));};exports[_0xcd43('0x46')]=function(_0xa3da40,_0x4401d9){var _0x62d82b={'raw':!![],'where':{'id':_0xa3da40[_0xcd43('0x47')]['id']}},_0x257761={};_0x257761['model']=_[_0xcd43('0x31')](db[_0xcd43('0x2c')][_0xcd43('0x2d')]);_0x257761[_0xcd43('0x32')]=_[_0xcd43('0x31')](_0xa3da40[_0xcd43('0x32')]);_0x257761[_0xcd43('0x33')]=_[_0xcd43('0x34')](_0x257761[_0xcd43('0x30')],_0x257761[_0xcd43('0x32')]);_0x62d82b[_0xcd43('0x35')]=_['intersection'](_0x257761[_0xcd43('0x30')],qs[_0xcd43('0x36')](_0xa3da40[_0xcd43('0x32')][_0xcd43('0x36')]));_0x62d82b[_0xcd43('0x35')]=_0x62d82b[_0xcd43('0x35')][_0xcd43('0x37')]?_0x62d82b['attributes']:_0x257761[_0xcd43('0x30')];if(_0xa3da40[_0xcd43('0x32')][_0xcd43('0x48')]){_0x62d82b['include']=[{'all':!![]}];}_0x62d82b=_['merge']({},_0x62d82b,_0xa3da40[_0xcd43('0x41')]);return db['ServicenowField'][_0xcd43('0x49')](_0x62d82b)[_0xcd43('0x25')](handleEntityNotFound(_0x4401d9,null))['then'](respondWithResult(_0x4401d9,null))[_0xcd43('0x45')](handleError(_0x4401d9,null));};exports[_0xcd43('0x4a')]=function(_0x271436,_0x58206f){return db[_0xcd43('0x2c')][_0xcd43('0x4a')](_0x271436[_0xcd43('0x4b')],{})[_0xcd43('0x25')](respondWithResult(_0x58206f,0xc9))[_0xcd43('0x45')](handleError(_0x58206f,null));};exports['update']=function(_0x27a076,_0x2bc13e){if(_0x27a076[_0xcd43('0x4b')]['id']){delete _0x27a076[_0xcd43('0x4b')]['id'];}return db[_0xcd43('0x2c')]['find']({'where':{'id':_0x27a076['params']['id']}})[_0xcd43('0x25')](handleEntityNotFound(_0x2bc13e,null))[_0xcd43('0x25')](saveUpdates(_0x27a076[_0xcd43('0x4b')],null))[_0xcd43('0x25')](respondWithResult(_0x2bc13e,null))[_0xcd43('0x45')](handleError(_0x2bc13e,null));};exports[_0xcd43('0x26')]=function(_0x2d4811,_0x482cb7){return db[_0xcd43('0x2c')][_0xcd43('0x49')]({'where':{'id':_0x2d4811[_0xcd43('0x47')]['id']}})[_0xcd43('0x25')](handleEntityNotFound(_0x482cb7,null))[_0xcd43('0x25')](removeEntity(_0x482cb7,null))[_0xcd43('0x45')](handleError(_0x482cb7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 863bcd0..87d5036 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0915=['FieldId','../../config/logger','api','moment','bluebird','request-promise','path','define','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x69b5e3,_0x2f39af){var _0x114d3b=function(_0x4bc35d){while(--_0x4bc35d){_0x69b5e3['push'](_0x69b5e3['shift']());}};_0x114d3b(++_0x2f39af);}(_0x0915,0xd2));var _0x5091=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x0915[_0x44a3b0];return _0x39e6f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5091('0x0'))(_0x5091('0x1'));var moment=require(_0x5091('0x2'));var BPromise=require(_0x5091('0x3'));var rp=require(_0x5091('0x4'));var fs=require('fs');var path=require(_0x5091('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x3472e7,_0x54daae){return _0x3472e7[_0x5091('0x6')](_0x5091('0x7'),attributes,{'tableName':_0x5091('0x8'),'paranoid':![],'indexes':[{'name':_0x5091('0x9'),'fields':['idField',_0x5091('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6538=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6538,0xbf));var _0x8653=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0x6538[_0x2f3d29];return _0x53d69d;};'use strict';var _=require(_0x8653('0x0'));var util=require(_0x8653('0x1'));var logger=require(_0x8653('0x2'))(_0x8653('0x3'));var moment=require('moment');var BPromise=require(_0x8653('0x4'));var rp=require(_0x8653('0x5'));var fs=require('fs');var path=require(_0x8653('0x6'));var rimraf=require(_0x8653('0x7'));var config=require('../../config/environment');var attributes=require(_0x8653('0x8'));module[_0x8653('0x9')]=function(_0x4ce205,_0x4adfb8){return _0x4ce205[_0x8653('0xa')](_0x8653('0xb'),attributes,{'tableName':_0x8653('0xc'),'paranoid':![],'indexes':[{'name':_0x8653('0xd'),'fields':[_0x8653('0xe'),_0x8653('0xf')],'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 164d6c4..07ac674 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1c599d,_0x34ac8c){var _0x2ae32e=function(_0x27f1f6){while(--_0x27f1f6){_0x1c599d['push'](_0x1c599d['shift']());}};_0x2ae32e(++_0x34ac8c);}(_0xf4eb,0xec));var _0xbf4e=function(_0xa86ca8,_0x54853f){_0xa86ca8=_0xa86ca8-0x0;var _0x48b356=_0xf4eb[_0xa86ca8];return _0x48b356;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3e546b,_0x36511c){var _0xc65a88=function(_0x291836){while(--_0x291836){_0x3e546b['push'](_0x3e546b['shift']());}};_0xc65a88(++_0x36511c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1f2db3,_0x568977){_0x1f2db3=_0x1f2db3-0x0;var _0x368513=_0xb43b[_0x1f2db3];return _0x368513;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 7061f60..451be82 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x32c44e,_0x1eb1da){var _0x2ba5cc=function(_0x3c45c9){while(--_0x3c45c9){_0x32c44e['push'](_0x32c44e['shift']());}};_0x2ba5cc(++_0x1eb1da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x362d17,_0x3f98f5){var _0x43a374=function(_0x201706){while(--_0x201706){_0x362d17['push'](_0x362d17['shift']());}};_0x43a374(++_0x3f98f5);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index a494803..ca034a4 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(_0x5c8498,_0x11ad28){var _0xa55a51=function(_0x7ec27a){while(--_0x7ec27a){_0x5c8498['push'](_0x5c8498['shift']());}};_0xa55a51(++_0x11ad28);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x2faafc,_0x3b1596){var _0x1c21ee=function(_0x38f894){while(--_0x38f894){_0x2faafc['push'](_0x2faafc['shift']());}};_0x1c21ee(++_0x3b1596);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 f6a0af1..4bb7871 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 _0x2ec2=['reject','save','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SugarcrmAccount','includeAll','include','rows','catch','show','params','keys','find','create','update','body','getConfigurations','SugarcrmConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_name','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','includes','label','endsWith','values','value','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x2ec2,0x14b));var _0x22ec=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x2ec2[_0x5e3b04];return _0x1fc44d;};'use strict';var emlformat=require(_0x22ec('0x0'));var rimraf=require(_0x22ec('0x1'));var zipdir=require(_0x22ec('0x2'));var jsonpatch=require(_0x22ec('0x3'));var rp=require(_0x22ec('0x4'));var moment=require(_0x22ec('0x5'));var BPromise=require(_0x22ec('0x6'));var Mustache=require(_0x22ec('0x7'));var util=require(_0x22ec('0x8'));var path=require(_0x22ec('0x9'));var sox=require(_0x22ec('0xa'));var csv=require(_0x22ec('0xb'));var ejs=require(_0x22ec('0xc'));var fs=require('fs');var fs_extra=require(_0x22ec('0xd'));var _=require('lodash');var squel=require(_0x22ec('0xe'));var crypto=require(_0x22ec('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x22ec('0x10'));var toCsv=require(_0x22ec('0xb'));var querystring=require(_0x22ec('0x11'));var Papa=require(_0x22ec('0x12'));var Redis=require(_0x22ec('0x13'));var authService=require(_0x22ec('0x14'));var qs=require(_0x22ec('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22ec('0x16'));var logger=require(_0x22ec('0x17'))(_0x22ec('0x18'));var utils=require(_0x22ec('0x19'));var config=require(_0x22ec('0x1a'));var licenseUtil=require(_0x22ec('0x1b'));var db=require(_0x22ec('0x1c'))['db'];var integrations=require(_0x22ec('0x1d'));function respondWithStatusCode(_0x5c84ac,_0x2e4c69){_0x2e4c69=_0x2e4c69||0xcc;return function(_0x5e107e){if(_0x5e107e){return _0x5c84ac[_0x22ec('0x1e')](_0x2e4c69);}return _0x5c84ac[_0x22ec('0x1f')](_0x2e4c69)[_0x22ec('0x20')]();};}function respondWithResult(_0x51c426,_0x9559d3){_0x9559d3=_0x9559d3||0xc8;return function(_0x18704a){if(_0x18704a){return _0x51c426[_0x22ec('0x1f')](_0x9559d3)[_0x22ec('0x21')](_0x18704a);}};}function respondWithFilteredResult(_0x15e58c,_0xf85789){return function(_0x1edefb){if(_0x1edefb){var _0x3abfb3=typeof _0xf85789[_0x22ec('0x22')]===_0x22ec('0x23')&&typeof _0xf85789['limit']==='undefined';var _0x368d7b=_0x1edefb[_0x22ec('0x24')];var _0x3983a2=_0x3abfb3?0x0:_0xf85789[_0x22ec('0x22')];var _0x57efc9=_0x3abfb3?_0x1edefb[_0x22ec('0x24')]:_0xf85789[_0x22ec('0x22')]+_0xf85789[_0x22ec('0x25')];var _0x41163d;if(_0x57efc9>=_0x368d7b){_0x57efc9=_0x368d7b;_0x41163d=0xc8;}else{_0x41163d=0xce;}_0x15e58c['status'](_0x41163d);return _0x15e58c[_0x22ec('0x26')](_0x22ec('0x27'),_0x3983a2+'-'+_0x57efc9+'/'+_0x368d7b)['json'](_0x1edefb);}return null;};}function patchUpdates(_0x459f79){return function(_0x2127c2){try{jsonpatch[_0x22ec('0x28')](_0x2127c2,_0x459f79,!![]);}catch(_0x187f2e){return BPromise[_0x22ec('0x29')](_0x187f2e);}return _0x2127c2[_0x22ec('0x2a')]();};}function saveUpdates(_0x3a2cd9,_0x5b2f39){return function(_0x44ffec){if(_0x44ffec){return _0x44ffec['update'](_0x3a2cd9)[_0x22ec('0x2b')](function(_0x3a558f){return _0x3a558f;});}return null;};}function removeEntity(_0x1879b4,_0x3335c1){return function(_0x186276){if(_0x186276){return _0x186276[_0x22ec('0x2c')]()[_0x22ec('0x2b')](function(){_0x1879b4[_0x22ec('0x1f')](0xcc)[_0x22ec('0x20')]();});}};}function handleEntityNotFound(_0x3da363,_0x1f026a){return function(_0x59ddde){if(!_0x59ddde){_0x3da363['sendStatus'](0x194);}return _0x59ddde;};}function handleError(_0x33c4c7,_0x134e1b){_0x134e1b=_0x134e1b||0x1f4;return function(_0x740df5){logger[_0x22ec('0x2d')](_0x740df5[_0x22ec('0x2e')]);if(_0x740df5[_0x22ec('0x2f')]){delete _0x740df5[_0x22ec('0x2f')];}_0x33c4c7['status'](_0x134e1b)['send'](_0x740df5);};}exports['index']=function(_0x42130b,_0x56a87e){var _0x234469={},_0x59a9e6={},_0x5194cd={'count':0x0,'rows':[]};var _0x4fe767=_[_0x22ec('0x30')](db['SugarcrmAccount'][_0x22ec('0x31')],function(_0x30b724){return{'name':_0x30b724[_0x22ec('0x32')],'type':_0x30b724[_0x22ec('0x33')][_0x22ec('0x34')]};});_0x59a9e6[_0x22ec('0x35')]=_[_0x22ec('0x30')](_0x4fe767,_0x22ec('0x2f'));_0x59a9e6['query']=_['keys'](_0x42130b[_0x22ec('0x36')]);_0x59a9e6[_0x22ec('0x37')]=_[_0x22ec('0x38')](_0x59a9e6[_0x22ec('0x35')],_0x59a9e6[_0x22ec('0x36')]);_0x234469['attributes']=_[_0x22ec('0x38')](_0x59a9e6['model'],qs[_0x22ec('0x39')](_0x42130b[_0x22ec('0x36')][_0x22ec('0x39')]));_0x234469[_0x22ec('0x3a')]=_0x234469[_0x22ec('0x3a')][_0x22ec('0x3b')]?_0x234469[_0x22ec('0x3a')]:_0x59a9e6[_0x22ec('0x35')];if(!_0x42130b[_0x22ec('0x36')][_0x22ec('0x3c')](_0x22ec('0x3d'))){_0x234469[_0x22ec('0x25')]=qs[_0x22ec('0x25')](_0x42130b[_0x22ec('0x36')]['limit']);_0x234469[_0x22ec('0x22')]=qs[_0x22ec('0x22')](_0x42130b[_0x22ec('0x36')]['offset']);}_0x234469[_0x22ec('0x3e')]=qs['sort'](_0x42130b['query'][_0x22ec('0x3f')]);_0x234469[_0x22ec('0x40')]=qs[_0x22ec('0x37')](_[_0x22ec('0x41')](_0x42130b[_0x22ec('0x36')],_0x59a9e6[_0x22ec('0x37')]),_0x4fe767);if(_0x42130b['query'][_0x22ec('0x42')]){_0x234469[_0x22ec('0x40')]=_[_0x22ec('0x43')](_0x234469['where'],{'$or':_[_0x22ec('0x30')](_0x4fe767,function(_0x5ed84d){if(_0x5ed84d[_0x22ec('0x33')]!=='VIRTUAL'){var _0x5044d3={};_0x5044d3[_0x5ed84d[_0x22ec('0x2f')]]={'$like':'%'+_0x42130b[_0x22ec('0x36')][_0x22ec('0x42')]+'%'};return _0x5044d3;}})});}_0x234469=_[_0x22ec('0x43')]({},_0x234469,_0x42130b[_0x22ec('0x44')]);var _0x5600a7={'where':_0x234469[_0x22ec('0x40')]};return db[_0x22ec('0x45')]['count'](_0x5600a7)[_0x22ec('0x2b')](function(_0x107a28){_0x5194cd[_0x22ec('0x24')]=_0x107a28;if(_0x42130b['query'][_0x22ec('0x46')]){_0x234469[_0x22ec('0x47')]=[{'all':!![]}];}return db[_0x22ec('0x45')]['findAll'](_0x234469);})['then'](function(_0x187e34){_0x5194cd[_0x22ec('0x48')]=_0x187e34;return _0x5194cd;})[_0x22ec('0x2b')](respondWithFilteredResult(_0x56a87e,_0x234469))[_0x22ec('0x49')](handleError(_0x56a87e,null));};exports[_0x22ec('0x4a')]=function(_0x1f8681,_0x4b0cf1){var _0x215c00={'raw':![],'where':{'id':_0x1f8681[_0x22ec('0x4b')]['id']}},_0x2320ab={};_0x2320ab[_0x22ec('0x35')]=_[_0x22ec('0x4c')](db[_0x22ec('0x45')][_0x22ec('0x31')]);_0x2320ab[_0x22ec('0x36')]=_[_0x22ec('0x4c')](_0x1f8681[_0x22ec('0x36')]);_0x2320ab[_0x22ec('0x37')]=_[_0x22ec('0x38')](_0x2320ab[_0x22ec('0x35')],_0x2320ab[_0x22ec('0x36')]);_0x215c00['attributes']=_[_0x22ec('0x38')](_0x2320ab[_0x22ec('0x35')],qs[_0x22ec('0x39')](_0x1f8681[_0x22ec('0x36')][_0x22ec('0x39')]));_0x215c00['attributes']=_0x215c00[_0x22ec('0x3a')][_0x22ec('0x3b')]?_0x215c00['attributes']:_0x2320ab[_0x22ec('0x35')];if(_0x1f8681[_0x22ec('0x36')][_0x22ec('0x46')]){_0x215c00[_0x22ec('0x47')]=[{'all':!![]}];}_0x215c00=_[_0x22ec('0x43')]({},_0x215c00,_0x1f8681['options']);return db['SugarcrmAccount'][_0x22ec('0x4d')](_0x215c00)[_0x22ec('0x2b')](handleEntityNotFound(_0x4b0cf1,null))[_0x22ec('0x2b')](respondWithResult(_0x4b0cf1,null))[_0x22ec('0x49')](handleError(_0x4b0cf1,null));};exports[_0x22ec('0x4e')]=function(_0x23c62a,_0x1ed3de){return db['SugarcrmAccount'][_0x22ec('0x4e')](_0x23c62a['body'],{})[_0x22ec('0x2b')](respondWithResult(_0x1ed3de,0xc9))[_0x22ec('0x49')](handleError(_0x1ed3de,null));};exports[_0x22ec('0x4f')]=function(_0x117494,_0x45dc2d){if(_0x117494[_0x22ec('0x50')]['id']){delete _0x117494['body']['id'];}return db['SugarcrmAccount'][_0x22ec('0x4d')]({'where':{'id':_0x117494['params']['id']}})[_0x22ec('0x2b')](handleEntityNotFound(_0x45dc2d,null))[_0x22ec('0x2b')](saveUpdates(_0x117494[_0x22ec('0x50')],null))[_0x22ec('0x2b')](respondWithResult(_0x45dc2d,null))[_0x22ec('0x49')](handleError(_0x45dc2d,null));};exports[_0x22ec('0x2c')]=function(_0x152f4e,_0x42aff0){return db[_0x22ec('0x45')][_0x22ec('0x4d')]({'where':{'id':_0x152f4e[_0x22ec('0x4b')]['id']}})[_0x22ec('0x2b')](handleEntityNotFound(_0x42aff0,null))[_0x22ec('0x2b')](removeEntity(_0x42aff0,null))[_0x22ec('0x49')](handleError(_0x42aff0,null));};exports[_0x22ec('0x51')]=function(_0x1e5e10,_0x39a4d0,_0x1b8379){var _0x2c761e={};var _0xb4b901={};var _0x1c66e5;var _0x2ba6f9;return db[_0x22ec('0x45')]['findOne']({'where':{'id':_0x1e5e10[_0x22ec('0x4b')]['id']}})[_0x22ec('0x2b')](handleEntityNotFound(_0x39a4d0,null))['then'](function(_0x1ef685){if(_0x1ef685){_0x1c66e5=_0x1ef685;_0xb4b901[_0x22ec('0x35')]=_[_0x22ec('0x4c')](db[_0x22ec('0x52')][_0x22ec('0x31')]);_0xb4b901[_0x22ec('0x36')]=_[_0x22ec('0x4c')](_0x1e5e10[_0x22ec('0x36')]);_0xb4b901[_0x22ec('0x37')]=_[_0x22ec('0x38')](_0xb4b901[_0x22ec('0x35')],_0xb4b901['query']);_0x2c761e[_0x22ec('0x3a')]=_[_0x22ec('0x38')](_0xb4b901['model'],qs['fields'](_0x1e5e10[_0x22ec('0x36')][_0x22ec('0x39')]));_0x2c761e[_0x22ec('0x3a')]=_0x2c761e[_0x22ec('0x3a')][_0x22ec('0x3b')]?_0x2c761e[_0x22ec('0x3a')]:_0xb4b901[_0x22ec('0x35')];_0x2c761e[_0x22ec('0x3e')]=qs[_0x22ec('0x3f')](_0x1e5e10[_0x22ec('0x36')][_0x22ec('0x3f')]);_0x2c761e[_0x22ec('0x40')]=qs[_0x22ec('0x37')](_[_0x22ec('0x41')](_0x1e5e10[_0x22ec('0x36')],_0xb4b901[_0x22ec('0x37')]));if(_0x1e5e10[_0x22ec('0x36')]['filter']){_0x2c761e['where']=_[_0x22ec('0x43')](_0x2c761e[_0x22ec('0x40')],{'$or':_[_0x22ec('0x30')](_0x2c761e['attributes'],function(_0x3f5d4d){var _0x5155d4={};_0x5155d4[_0x3f5d4d]={'$like':'%'+_0x1e5e10[_0x22ec('0x36')][_0x22ec('0x42')]+'%'};return _0x5155d4;})});}_0x2c761e=_[_0x22ec('0x43')]({},_0x2c761e,_0x1e5e10[_0x22ec('0x44')]);return _0x1c66e5[_0x22ec('0x51')](_0x2c761e);}})[_0x22ec('0x2b')](function(_0xa15a6d){if(_0xa15a6d){_0x2ba6f9=_0xa15a6d[_0x22ec('0x3b')];if(!_0x1e5e10['query'][_0x22ec('0x3c')](_0x22ec('0x3d'))){_0x2c761e[_0x22ec('0x25')]=qs[_0x22ec('0x25')](_0x1e5e10[_0x22ec('0x36')][_0x22ec('0x25')]);_0x2c761e[_0x22ec('0x22')]=qs['offset'](_0x1e5e10[_0x22ec('0x36')][_0x22ec('0x22')]);}return _0x1c66e5['getConfigurations'](_0x2c761e);}})[_0x22ec('0x2b')](function(_0x4d0c00){if(_0x4d0c00){return _0x4d0c00?{'count':_0x2ba6f9,'rows':_0x4d0c00}:null;}})[_0x22ec('0x2b')](respondWithResult(_0x39a4d0,null))[_0x22ec('0x49')](handleError(_0x39a4d0,null));};exports[_0x22ec('0x53')]=function(_0xed9b97,_0x576bc9,_0x178dbf){if(_0xed9b97[_0x22ec('0x50')]['id']){delete _0xed9b97[_0x22ec('0x50')]['id'];}return db['SugarcrmAccount'][_0x22ec('0x54')]({'where':{'id':_0xed9b97[_0x22ec('0x4b')]['id']}})[_0x22ec('0x2b')](handleEntityNotFound(_0x576bc9,null))[_0x22ec('0x2b')](function(_0x18c49d){if(_0x18c49d){_0xed9b97[_0x22ec('0x50')][_0x22ec('0x55')]=_0x18c49d['id'];_0xed9b97[_0x22ec('0x50')][_0x22ec('0x56')]=integrations[_0x22ec('0x57')](_0xed9b97[_0x22ec('0x50')]['channel'],_0xed9b97['body']['type']);_0xed9b97[_0x22ec('0x50')][_0x22ec('0x58')]=integrations[_0x22ec('0x59')](_0xed9b97['body']['channel'],_0xed9b97[_0x22ec('0x50')][_0x22ec('0x33')]);return db['SugarcrmConfiguration'][_0x22ec('0x4e')](_0xed9b97[_0x22ec('0x50')],{'include':[{'model':db['SugarcrmField'],'as':_0x22ec('0x56')},{'model':db[_0x22ec('0x5a')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x576bc9,null))[_0x22ec('0x49')](handleError(_0x576bc9,null));};exports[_0x22ec('0x5b')]=function(_0x438a04,_0x45f71d,_0xea4e25){var _0x23d6a9='';var _0x33da8f=['id',_0x22ec('0x2f'),_0x22ec('0x5c'),_0x22ec('0x5d'),_0x22ec('0x5e'),_0x22ec('0x5f'),_0x22ec('0x60'),'duration_minutes',_0x22ec('0x61'),'parent_type',_0x22ec('0x62'),'direction'];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x438a04['params']['id']},'attributes':['id',_0x22ec('0x63'),'password',_0x22ec('0x64')]})[_0x22ec('0x2b')](handleEntityNotFound(_0x45f71d,null))[_0x22ec('0x2b')](function(_0xf29e66){if(_0xf29e66){_0x23d6a9=_0xf29e66['remoteUri'];var _0x24be77=_0x23d6a9[_0x22ec('0x65')](-0x1);if(_0x24be77==='/'){_0x23d6a9=_0x23d6a9[_0x22ec('0x66')](0x0,_0x23d6a9[_0x22ec('0x67')](_0x24be77));}return rp({'method':_0x22ec('0x68'),'uri':util[_0x22ec('0x69')](_0x22ec('0x6a'),_0x23d6a9,_0x22ec('0x6b')),'json':!![],'form':{'method':'login','input_type':_0x22ec('0x6c'),'response_type':_0x22ec('0x6c'),'rest_data':JSON[_0x22ec('0x6d')]({'user_auth':{'user_name':_0xf29e66['username'],'password':_0xf29e66[_0x22ec('0x6e')],'encryption':'PLAIN'},'application':_0x22ec('0x6f')})}});}})['then'](function(_0x36a762){if(_0x36a762&&_0x36a762[_0x22ec('0x2f')]!==_0x22ec('0x70')&&_0x36a762[_0x22ec('0x2f')]!=='Password\x20Expired'){return rp({'method':_0x22ec('0x68'),'uri':util[_0x22ec('0x69')](_0x22ec('0x6a'),_0x23d6a9,_0x22ec('0x6b')),'json':!![],'form':{'method':_0x22ec('0x71'),'input_type':_0x22ec('0x6c'),'response_type':_0x22ec('0x6c'),'rest_data':JSON[_0x22ec('0x6d')]({'session':_0x36a762['id'],'module_name':_0x22ec('0x72')})}})[_0x22ec('0x2b')](function(_0x59b45b){if(_0x59b45b){var _0x4d1a55=_['values'](_0x59b45b['module_fields']);_['remove'](_0x4d1a55,function(_0x4cd53a){return _0x33da8f[_0x22ec('0x73')](_0x4cd53a[_0x22ec('0x2f')]);});return{'count':_0x4d1a55['length'],'rows':_[_0x22ec('0x30')](_0x4d1a55,function(_0xff3626){return{'id':_0xff3626[_0x22ec('0x2f')],'name':_0xff3626[_0x22ec('0x74')],'custom':_[_0x22ec('0x75')](_0xff3626[_0x22ec('0x2f')],'_c')?!![]:![],'options':_0xff3626[_0x22ec('0x44')]?_['map'](_[_0x22ec('0x76')](_0xff3626[_0x22ec('0x44')]),function(_0x327b1f){return{'name':_0x327b1f[_0x22ec('0x77')],'value':_0x327b1f['name']};}):[]};})};}})['then'](respondWithResult(_0x45f71d,null))[_0x22ec('0x49')](function(_0x2d386f){var _0x32a1ef=_0x438a04['query'][_0x22ec('0x78')]?0x1f4:_0x2d386f['statusCode']||0x1f4;logger[_0x22ec('0x2d')](_0x22ec('0x79'),'getFields',_0x32a1ef,JSON[_0x22ec('0x6d')](_0x2d386f));delete _0x2d386f['name'];if(_0x32a1ef===0x191){_0x32a1ef=0x190;}_0x45f71d[_0x22ec('0x1f')](_0x32a1ef)[_0x22ec('0x7a')](_0x438a04['query'][_0x22ec('0x78')]?{'message':_0x22ec('0x7b'),'statusCode':_0x2d386f['statusCode']}:_0x2d386f);});}else{var _0x1cae0d=0x1f4;_0x45f71d[_0x22ec('0x1f')](_0x1cae0d)[_0x22ec('0x7a')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xaf3f=['destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','duration_minutes','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','catch','find','create','body','params'];(function(_0x48a2af,_0x3c60d3){var _0x525468=function(_0x3e1d44){while(--_0x3e1d44){_0x48a2af['push'](_0x48a2af['shift']());}};_0x525468(++_0x3c60d3);}(_0xaf3f,0xa8));var _0xfaf3=function(_0x242589,_0x228244){_0x242589=_0x242589-0x0;var _0x48b19a=_0xaf3f[_0x242589];return _0x48b19a;};'use strict';var emlformat=require(_0xfaf3('0x0'));var rimraf=require(_0xfaf3('0x1'));var zipdir=require(_0xfaf3('0x2'));var jsonpatch=require(_0xfaf3('0x3'));var rp=require(_0xfaf3('0x4'));var moment=require(_0xfaf3('0x5'));var BPromise=require(_0xfaf3('0x6'));var Mustache=require(_0xfaf3('0x7'));var util=require(_0xfaf3('0x8'));var path=require(_0xfaf3('0x9'));var sox=require('sox');var csv=require(_0xfaf3('0xa'));var ejs=require(_0xfaf3('0xb'));var fs=require('fs');var fs_extra=require(_0xfaf3('0xc'));var _=require(_0xfaf3('0xd'));var squel=require(_0xfaf3('0xe'));var crypto=require('crypto');var jsforce=require(_0xfaf3('0xf'));var deskjs=require(_0xfaf3('0x10'));var toCsv=require(_0xfaf3('0xa'));var querystring=require(_0xfaf3('0x11'));var Papa=require(_0xfaf3('0x12'));var Redis=require('ioredis');var authService=require(_0xfaf3('0x13'));var qs=require(_0xfaf3('0x14'));var as=require(_0xfaf3('0x15'));var hardwareService=require(_0xfaf3('0x16'));var logger=require('../../config/logger')(_0xfaf3('0x17'));var utils=require('../../config/utils');var config=require(_0xfaf3('0x18'));var licenseUtil=require(_0xfaf3('0x19'));var db=require(_0xfaf3('0x1a'))['db'];var integrations=require(_0xfaf3('0x1b'));function respondWithStatusCode(_0x4bd85c,_0x747583){_0x747583=_0x747583||0xcc;return function(_0x442d7c){if(_0x442d7c){return _0x4bd85c[_0xfaf3('0x1c')](_0x747583);}return _0x4bd85c[_0xfaf3('0x1d')](_0x747583)[_0xfaf3('0x1e')]();};}function respondWithResult(_0x3da4c4,_0x1290f0){_0x1290f0=_0x1290f0||0xc8;return function(_0x7e7c08){if(_0x7e7c08){return _0x3da4c4[_0xfaf3('0x1d')](_0x1290f0)[_0xfaf3('0x1f')](_0x7e7c08);}};}function respondWithFilteredResult(_0x2f5356,_0x222cbf){return function(_0x573cc4){if(_0x573cc4){var _0x35e93d=typeof _0x222cbf[_0xfaf3('0x20')]===_0xfaf3('0x21')&&typeof _0x222cbf[_0xfaf3('0x22')]==='undefined';var _0x20df01=_0x573cc4[_0xfaf3('0x23')];var _0x55dbf9=_0x35e93d?0x0:_0x222cbf[_0xfaf3('0x20')];var _0x389733=_0x35e93d?_0x573cc4['count']:_0x222cbf[_0xfaf3('0x20')]+_0x222cbf[_0xfaf3('0x22')];var _0x219ebd;if(_0x389733>=_0x20df01){_0x389733=_0x20df01;_0x219ebd=0xc8;}else{_0x219ebd=0xce;}_0x2f5356[_0xfaf3('0x1d')](_0x219ebd);return _0x2f5356[_0xfaf3('0x24')](_0xfaf3('0x25'),_0x55dbf9+'-'+_0x389733+'/'+_0x20df01)[_0xfaf3('0x1f')](_0x573cc4);}return null;};}function patchUpdates(_0x5824fa){return function(_0x315a4e){try{jsonpatch[_0xfaf3('0x26')](_0x315a4e,_0x5824fa,!![]);}catch(_0x4cfdf0){return BPromise['reject'](_0x4cfdf0);}return _0x315a4e[_0xfaf3('0x27')]();};}function saveUpdates(_0x3aa2f1,_0xc44977){return function(_0x19a05e){if(_0x19a05e){return _0x19a05e[_0xfaf3('0x28')](_0x3aa2f1)['then'](function(_0x2cc89e){return _0x2cc89e;});}return null;};}function removeEntity(_0xdbba01,_0x1ffa23){return function(_0x9309c2){if(_0x9309c2){return _0x9309c2['destroy']()[_0xfaf3('0x29')](function(){_0xdbba01[_0xfaf3('0x1d')](0xcc)[_0xfaf3('0x1e')]();});}};}function handleEntityNotFound(_0x1c3b8c,_0x44e3ce){return function(_0x828907){if(!_0x828907){_0x1c3b8c[_0xfaf3('0x1c')](0x194);}return _0x828907;};}function handleError(_0xd8a32f,_0x4872df){_0x4872df=_0x4872df||0x1f4;return function(_0x38ae94){logger[_0xfaf3('0x2a')](_0x38ae94[_0xfaf3('0x2b')]);if(_0x38ae94[_0xfaf3('0x2c')]){delete _0x38ae94['name'];}_0xd8a32f[_0xfaf3('0x1d')](_0x4872df)[_0xfaf3('0x2d')](_0x38ae94);};}exports[_0xfaf3('0x2e')]=function(_0x437cea,_0x51331d){var _0x1647dc={},_0xb3da20={},_0x50a862={'count':0x0,'rows':[]};var _0x174a49=_[_0xfaf3('0x2f')](db['SugarcrmAccount'][_0xfaf3('0x30')],function(_0x5c31c4){return{'name':_0x5c31c4[_0xfaf3('0x31')],'type':_0x5c31c4[_0xfaf3('0x32')]['key']};});_0xb3da20[_0xfaf3('0x33')]=_[_0xfaf3('0x2f')](_0x174a49,'name');_0xb3da20[_0xfaf3('0x34')]=_[_0xfaf3('0x35')](_0x437cea[_0xfaf3('0x34')]);_0xb3da20['filters']=_[_0xfaf3('0x36')](_0xb3da20[_0xfaf3('0x33')],_0xb3da20['query']);_0x1647dc[_0xfaf3('0x37')]=_[_0xfaf3('0x36')](_0xb3da20[_0xfaf3('0x33')],qs[_0xfaf3('0x38')](_0x437cea[_0xfaf3('0x34')][_0xfaf3('0x38')]));_0x1647dc[_0xfaf3('0x37')]=_0x1647dc['attributes'][_0xfaf3('0x39')]?_0x1647dc[_0xfaf3('0x37')]:_0xb3da20[_0xfaf3('0x33')];if(!_0x437cea['query'][_0xfaf3('0x3a')](_0xfaf3('0x3b'))){_0x1647dc[_0xfaf3('0x22')]=qs[_0xfaf3('0x22')](_0x437cea[_0xfaf3('0x34')][_0xfaf3('0x22')]);_0x1647dc[_0xfaf3('0x20')]=qs[_0xfaf3('0x20')](_0x437cea[_0xfaf3('0x34')][_0xfaf3('0x20')]);}_0x1647dc[_0xfaf3('0x3c')]=qs[_0xfaf3('0x3d')](_0x437cea[_0xfaf3('0x34')][_0xfaf3('0x3d')]);_0x1647dc[_0xfaf3('0x3e')]=qs[_0xfaf3('0x3f')](_[_0xfaf3('0x40')](_0x437cea[_0xfaf3('0x34')],_0xb3da20[_0xfaf3('0x3f')]),_0x174a49);if(_0x437cea[_0xfaf3('0x34')][_0xfaf3('0x41')]){_0x1647dc['where']=_[_0xfaf3('0x42')](_0x1647dc[_0xfaf3('0x3e')],{'$or':_[_0xfaf3('0x2f')](_0x174a49,function(_0x3938b7){if(_0x3938b7[_0xfaf3('0x32')]!==_0xfaf3('0x43')){var _0xe9b5be={};_0xe9b5be[_0x3938b7['name']]={'$like':'%'+_0x437cea['query']['filter']+'%'};return _0xe9b5be;}})});}_0x1647dc=_[_0xfaf3('0x42')]({},_0x1647dc,_0x437cea[_0xfaf3('0x44')]);var _0x16461c={'where':_0x1647dc[_0xfaf3('0x3e')]};return db[_0xfaf3('0x45')][_0xfaf3('0x23')](_0x16461c)[_0xfaf3('0x29')](function(_0x2cb3da){_0x50a862[_0xfaf3('0x23')]=_0x2cb3da;if(_0x437cea[_0xfaf3('0x34')][_0xfaf3('0x46')]){_0x1647dc[_0xfaf3('0x47')]=[{'all':!![]}];}return db[_0xfaf3('0x45')][_0xfaf3('0x48')](_0x1647dc);})[_0xfaf3('0x29')](function(_0x13baa9){_0x50a862['rows']=_0x13baa9;return _0x50a862;})[_0xfaf3('0x29')](respondWithFilteredResult(_0x51331d,_0x1647dc))[_0xfaf3('0x49')](handleError(_0x51331d,null));};exports['show']=function(_0x708d64,_0x3a9545){var _0x329fe2={'raw':![],'where':{'id':_0x708d64['params']['id']}},_0x35a26a={};_0x35a26a[_0xfaf3('0x33')]=_[_0xfaf3('0x35')](db[_0xfaf3('0x45')][_0xfaf3('0x30')]);_0x35a26a[_0xfaf3('0x34')]=_[_0xfaf3('0x35')](_0x708d64[_0xfaf3('0x34')]);_0x35a26a[_0xfaf3('0x3f')]=_[_0xfaf3('0x36')](_0x35a26a[_0xfaf3('0x33')],_0x35a26a[_0xfaf3('0x34')]);_0x329fe2[_0xfaf3('0x37')]=_[_0xfaf3('0x36')](_0x35a26a[_0xfaf3('0x33')],qs['fields'](_0x708d64[_0xfaf3('0x34')][_0xfaf3('0x38')]));_0x329fe2[_0xfaf3('0x37')]=_0x329fe2[_0xfaf3('0x37')][_0xfaf3('0x39')]?_0x329fe2[_0xfaf3('0x37')]:_0x35a26a[_0xfaf3('0x33')];if(_0x708d64[_0xfaf3('0x34')][_0xfaf3('0x46')]){_0x329fe2[_0xfaf3('0x47')]=[{'all':!![]}];}_0x329fe2=_[_0xfaf3('0x42')]({},_0x329fe2,_0x708d64[_0xfaf3('0x44')]);return db[_0xfaf3('0x45')][_0xfaf3('0x4a')](_0x329fe2)['then'](handleEntityNotFound(_0x3a9545,null))[_0xfaf3('0x29')](respondWithResult(_0x3a9545,null))[_0xfaf3('0x49')](handleError(_0x3a9545,null));};exports[_0xfaf3('0x4b')]=function(_0x2e52f,_0xdd13a7){return db[_0xfaf3('0x45')][_0xfaf3('0x4b')](_0x2e52f['body'],{})[_0xfaf3('0x29')](respondWithResult(_0xdd13a7,0xc9))['catch'](handleError(_0xdd13a7,null));};exports[_0xfaf3('0x28')]=function(_0x5600ba,_0x485796){if(_0x5600ba[_0xfaf3('0x4c')]['id']){delete _0x5600ba['body']['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x5600ba[_0xfaf3('0x4d')]['id']}})[_0xfaf3('0x29')](handleEntityNotFound(_0x485796,null))['then'](saveUpdates(_0x5600ba[_0xfaf3('0x4c')],null))[_0xfaf3('0x29')](respondWithResult(_0x485796,null))[_0xfaf3('0x49')](handleError(_0x485796,null));};exports[_0xfaf3('0x4e')]=function(_0x1da7c0,_0x3ae823){return db[_0xfaf3('0x45')][_0xfaf3('0x4a')]({'where':{'id':_0x1da7c0[_0xfaf3('0x4d')]['id']}})[_0xfaf3('0x29')](handleEntityNotFound(_0x3ae823,null))[_0xfaf3('0x29')](removeEntity(_0x3ae823,null))[_0xfaf3('0x49')](handleError(_0x3ae823,null));};exports[_0xfaf3('0x4f')]=function(_0x57974b,_0x24b6d0,_0x2b7a09){var _0x5133ac={};var _0x1afb3d={};var _0x4fe219;var _0x2e9ae2;return db['SugarcrmAccount'][_0xfaf3('0x50')]({'where':{'id':_0x57974b['params']['id']}})['then'](handleEntityNotFound(_0x24b6d0,null))[_0xfaf3('0x29')](function(_0x323658){if(_0x323658){_0x4fe219=_0x323658;_0x1afb3d[_0xfaf3('0x33')]=_['keys'](db[_0xfaf3('0x51')][_0xfaf3('0x30')]);_0x1afb3d[_0xfaf3('0x34')]=_['keys'](_0x57974b['query']);_0x1afb3d[_0xfaf3('0x3f')]=_[_0xfaf3('0x36')](_0x1afb3d['model'],_0x1afb3d[_0xfaf3('0x34')]);_0x5133ac[_0xfaf3('0x37')]=_['intersection'](_0x1afb3d[_0xfaf3('0x33')],qs[_0xfaf3('0x38')](_0x57974b[_0xfaf3('0x34')]['fields']));_0x5133ac[_0xfaf3('0x37')]=_0x5133ac[_0xfaf3('0x37')]['length']?_0x5133ac[_0xfaf3('0x37')]:_0x1afb3d[_0xfaf3('0x33')];_0x5133ac['order']=qs[_0xfaf3('0x3d')](_0x57974b['query']['sort']);_0x5133ac[_0xfaf3('0x3e')]=qs[_0xfaf3('0x3f')](_[_0xfaf3('0x40')](_0x57974b[_0xfaf3('0x34')],_0x1afb3d[_0xfaf3('0x3f')]));if(_0x57974b[_0xfaf3('0x34')][_0xfaf3('0x41')]){_0x5133ac[_0xfaf3('0x3e')]=_[_0xfaf3('0x42')](_0x5133ac['where'],{'$or':_[_0xfaf3('0x2f')](_0x5133ac[_0xfaf3('0x37')],function(_0x2203c7){var _0x22f227={};_0x22f227[_0x2203c7]={'$like':'%'+_0x57974b[_0xfaf3('0x34')]['filter']+'%'};return _0x22f227;})});}_0x5133ac=_[_0xfaf3('0x42')]({},_0x5133ac,_0x57974b[_0xfaf3('0x44')]);return _0x4fe219[_0xfaf3('0x4f')](_0x5133ac);}})[_0xfaf3('0x29')](function(_0x57472a){if(_0x57472a){_0x2e9ae2=_0x57472a['length'];if(!_0x57974b[_0xfaf3('0x34')][_0xfaf3('0x3a')](_0xfaf3('0x3b'))){_0x5133ac['limit']=qs[_0xfaf3('0x22')](_0x57974b[_0xfaf3('0x34')]['limit']);_0x5133ac[_0xfaf3('0x20')]=qs[_0xfaf3('0x20')](_0x57974b[_0xfaf3('0x34')][_0xfaf3('0x20')]);}return _0x4fe219['getConfigurations'](_0x5133ac);}})[_0xfaf3('0x29')](function(_0x374b57){if(_0x374b57){return _0x374b57?{'count':_0x2e9ae2,'rows':_0x374b57}:null;}})[_0xfaf3('0x29')](respondWithResult(_0x24b6d0,null))[_0xfaf3('0x49')](handleError(_0x24b6d0,null));};exports[_0xfaf3('0x52')]=function(_0x3aaa26,_0x537813,_0x8c41c5){if(_0x3aaa26[_0xfaf3('0x4c')]['id']){delete _0x3aaa26[_0xfaf3('0x4c')]['id'];}return db['SugarcrmAccount'][_0xfaf3('0x50')]({'where':{'id':_0x3aaa26[_0xfaf3('0x4d')]['id']}})[_0xfaf3('0x29')](handleEntityNotFound(_0x537813,null))[_0xfaf3('0x29')](function(_0x2fa1f5){if(_0x2fa1f5){_0x3aaa26['body'][_0xfaf3('0x53')]=_0x2fa1f5['id'];_0x3aaa26[_0xfaf3('0x4c')][_0xfaf3('0x54')]=integrations[_0xfaf3('0x55')](_0x3aaa26[_0xfaf3('0x4c')]['channel'],_0x3aaa26[_0xfaf3('0x4c')][_0xfaf3('0x32')]);_0x3aaa26['body'][_0xfaf3('0x56')]=integrations['getDescriptions'](_0x3aaa26[_0xfaf3('0x4c')][_0xfaf3('0x57')],_0x3aaa26['body'][_0xfaf3('0x32')]);return db[_0xfaf3('0x51')][_0xfaf3('0x4b')](_0x3aaa26[_0xfaf3('0x4c')],{'include':[{'model':db[_0xfaf3('0x58')],'as':_0xfaf3('0x54')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0xfaf3('0x29')](respondWithResult(_0x537813,null))[_0xfaf3('0x49')](handleError(_0x537813,null));};exports[_0xfaf3('0x59')]=function(_0x514578,_0x45d77d,_0x5b89a9){var _0x5c1188='';var _0x4f702d=['id',_0xfaf3('0x2c'),_0xfaf3('0x5a'),_0xfaf3('0x5b'),'description','date_start','duration_hours',_0xfaf3('0x5c'),_0xfaf3('0x5d'),_0xfaf3('0x5e'),_0xfaf3('0x5f'),_0xfaf3('0x60')];return db['SugarcrmAccount'][_0xfaf3('0x50')]({'where':{'id':_0x514578[_0xfaf3('0x4d')]['id']},'attributes':['id','username',_0xfaf3('0x61'),_0xfaf3('0x62')]})['then'](handleEntityNotFound(_0x45d77d,null))[_0xfaf3('0x29')](function(_0x2ea283){if(_0x2ea283){_0x5c1188=_0x2ea283[_0xfaf3('0x62')];var _0x48422a=_0x5c1188[_0xfaf3('0x63')](-0x1);if(_0x48422a==='/'){_0x5c1188=_0x5c1188[_0xfaf3('0x64')](0x0,_0x5c1188[_0xfaf3('0x65')](_0x48422a));}return rp({'method':_0xfaf3('0x66'),'uri':util[_0xfaf3('0x67')](_0xfaf3('0x68'),_0x5c1188,_0xfaf3('0x69')),'json':!![],'form':{'method':'login','input_type':_0xfaf3('0x6a'),'response_type':_0xfaf3('0x6a'),'rest_data':JSON[_0xfaf3('0x6b')]({'user_auth':{'user_name':_0x2ea283['username'],'password':_0x2ea283[_0xfaf3('0x61')],'encryption':_0xfaf3('0x6c')},'application':_0xfaf3('0x6d')})}});}})[_0xfaf3('0x29')](function(_0x4a445c){if(_0x4a445c&&_0x4a445c['name']!=='Invalid\x20Login'&&_0x4a445c['name']!=='Password\x20Expired'){return rp({'method':_0xfaf3('0x66'),'uri':util[_0xfaf3('0x67')](_0xfaf3('0x68'),_0x5c1188,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xfaf3('0x6e'),'input_type':_0xfaf3('0x6a'),'response_type':'JSON','rest_data':JSON[_0xfaf3('0x6b')]({'session':_0x4a445c['id'],'module_name':_0xfaf3('0x6f')})}})[_0xfaf3('0x29')](function(_0x4f0563){if(_0x4f0563){var _0x3ceaa3=_['values'](_0x4f0563[_0xfaf3('0x70')]);_[_0xfaf3('0x71')](_0x3ceaa3,function(_0x11456b){return _0x4f702d[_0xfaf3('0x72')](_0x11456b[_0xfaf3('0x2c')]);});return{'count':_0x3ceaa3[_0xfaf3('0x39')],'rows':_[_0xfaf3('0x2f')](_0x3ceaa3,function(_0x274469){return{'id':_0x274469['name'],'name':_0x274469[_0xfaf3('0x73')],'custom':_[_0xfaf3('0x74')](_0x274469[_0xfaf3('0x2c')],'_c')?!![]:![],'options':_0x274469[_0xfaf3('0x44')]?_[_0xfaf3('0x2f')](_[_0xfaf3('0x75')](_0x274469['options']),function(_0x1b3550){return{'name':_0x1b3550[_0xfaf3('0x76')],'value':_0x1b3550[_0xfaf3('0x2c')]};}):[]};})};}})[_0xfaf3('0x29')](respondWithResult(_0x45d77d,null))[_0xfaf3('0x49')](function(_0x16745b){var _0x163ae5=_0x514578['query']['test']?0x1f4:_0x16745b[_0xfaf3('0x77')]||0x1f4;logger[_0xfaf3('0x2a')](_0xfaf3('0x78'),_0xfaf3('0x59'),_0x163ae5,JSON[_0xfaf3('0x6b')](_0x16745b));delete _0x16745b[_0xfaf3('0x2c')];if(_0x163ae5===0x191){_0x163ae5=0x190;}_0x45d77d[_0xfaf3('0x1d')](_0x163ae5)['send'](_0x514578[_0xfaf3('0x34')][_0xfaf3('0x79')]?{'message':_0xfaf3('0x7a'),'statusCode':_0x16745b[_0xfaf3('0x77')]}:_0x16745b);});}else{var _0x1e1e9e=0x1f4;_0x45d77d[_0xfaf3('0x1d')](_0x1e1e9e)[_0xfaf3('0x2d')]({'message':_0xfaf3('0x7a'),'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 0df45b8..4ef3076 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 _0xdd73=['exports','int_sugarcrm_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x489903,_0x4d9882){var _0x140482=function(_0x5edaac){while(--_0x5edaac){_0x489903['push'](_0x489903['shift']());}};_0x140482(++_0x4d9882);}(_0xdd73,0x156));var _0x3dd7=function(_0x138b2c,_0x142181){_0x138b2c=_0x138b2c-0x0;var _0xa8b921=_0xdd73[_0x138b2c];return _0xa8b921;};'use strict';var _=require(_0x3dd7('0x0'));var util=require(_0x3dd7('0x1'));var logger=require(_0x3dd7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3dd7('0x3'));var rp=require(_0x3dd7('0x4'));var fs=require('fs');var path=require(_0x3dd7('0x5'));var rimraf=require(_0x3dd7('0x6'));var config=require(_0x3dd7('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3dd7('0x8')]=function(_0xf6457d,_0x5a2693){return _0xf6457d['define']('SugarcrmAccount',attributes,{'tableName':_0x3dd7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcec=['SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define'];(function(_0x52c9e6,_0xc7f921){var _0x15f272=function(_0x583536){while(--_0x583536){_0x52c9e6['push'](_0x52c9e6['shift']());}};_0x15f272(++_0xc7f921);}(_0xdcec,0xf2));var _0xcdce=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0xdcec[_0x3da612];return _0x1a9d1d;};'use strict';var _=require('lodash');var util=require(_0xcdce('0x0'));var logger=require(_0xcdce('0x1'))(_0xcdce('0x2'));var moment=require(_0xcdce('0x3'));var BPromise=require(_0xcdce('0x4'));var rp=require(_0xcdce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcdce('0x6'));var attributes=require(_0xcdce('0x7'));var integrations=require(_0xcdce('0x8'));module['exports']=function(_0x559227,_0x475aed){return _0x559227[_0xcdce('0x9')](_0xcdce('0xa'),attributes,{'tableName':_0xcdce('0xb'),'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 88324fe..ad40100 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 _0xb37a=['model','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','stringify','ShowSugarcrmAccount'];(function(_0x29e0d8,_0x289c2e){var _0x164bc7=function(_0x195089){while(--_0x195089){_0x29e0d8['push'](_0x29e0d8['shift']());}};_0x164bc7(++_0x289c2e);}(_0xb37a,0xe9));var _0xab37=function(_0x4b0bb7,_0x585341){_0x4b0bb7=_0x4b0bb7-0x0;var _0x154e65=_0xb37a[_0x4b0bb7];return _0x154e65;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab37('0x0'));var BPromise=require(_0xab37('0x1'));var rs=require(_0xab37('0x2'));var fs=require('fs');var Redis=require(_0xab37('0x3'));var db=require(_0xab37('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab37('0x5'))(_0xab37('0x6'));var config=require(_0xab37('0x7'));var jayson=require(_0xab37('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x513db1,_0x321be9,_0x10c0e2){return new BPromise(function(_0x46bb18,_0x332c3a){return client[_0xab37('0x9')](_0x513db1,_0x10c0e2)['then'](function(_0x57d95a){logger[_0xab37('0xa')](_0xab37('0xb'),_0x321be9,_0xab37('0xc'));logger[_0xab37('0xd')](_0xab37('0xe'),_0x321be9,_0xab37('0xc'),JSON['stringify'](_0x57d95a));if(_0x57d95a[_0xab37('0xf')]){if(_0x57d95a[_0xab37('0xf')][_0xab37('0x10')]===0x1f4){logger[_0xab37('0xf')](_0xab37('0xb'),_0x321be9,_0x57d95a[_0xab37('0xf')][_0xab37('0x11')]);return _0x332c3a(_0x57d95a[_0xab37('0xf')][_0xab37('0x11')]);}logger[_0xab37('0xf')](_0xab37('0xb'),_0x321be9,_0x57d95a[_0xab37('0xf')]['message']);return _0x46bb18(_0x57d95a[_0xab37('0xf')]['message']);}else{logger['info'](_0xab37('0xb'),_0x321be9,_0xab37('0xc'));_0x46bb18(_0x57d95a[_0xab37('0x12')][_0xab37('0x11')]);}})[_0xab37('0x13')](function(_0x5dd7f7){logger[_0xab37('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x321be9,_0x5dd7f7);_0x332c3a(_0x5dd7f7);});});}exports[_0xab37('0x14')]=function(_0x579b34){var _0x584414=this;return new Promise(function(_0x313b5a,_0x2e6181){return db[_0xab37('0x15')][_0xab37('0x16')]({'raw':_0x579b34[_0xab37('0x17')]?_0x579b34[_0xab37('0x17')][_0xab37('0x18')]===undefined?!![]:![]:!![],'where':_0x579b34['options']?_0x579b34[_0xab37('0x17')][_0xab37('0x19')]||null:null,'attributes':_0x579b34['options']?_0x579b34['options'][_0xab37('0x1a')]||null:null,'limit':_0x579b34[_0xab37('0x17')]?_0x579b34[_0xab37('0x17')]['limit']||null:null,'include':_0x579b34[_0xab37('0x17')]?_0x579b34['options'][_0xab37('0x1b')]?_[_0xab37('0x1c')](_0x579b34[_0xab37('0x17')][_0xab37('0x1b')],function(_0x54cd30){return{'model':db[_0x54cd30['model']],'as':_0x54cd30['as'],'attributes':_0x54cd30[_0xab37('0x1a')],'include':_0x54cd30['include']?_['map'](_0x54cd30[_0xab37('0x1b')],function(_0x2f80bc){return{'model':db[_0x2f80bc['model']],'as':_0x2f80bc['as'],'attributes':_0x2f80bc[_0xab37('0x1a')],'include':_0x2f80bc[_0xab37('0x1b')]?_[_0xab37('0x1c')](_0x2f80bc[_0xab37('0x1b')],function(_0x7c1088){return{'model':db[_0x7c1088['model']],'as':_0x7c1088['as'],'attributes':_0x7c1088['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x49f4dd){logger[_0xab37('0xa')](_0xab37('0x14'),_0x579b34);logger[_0xab37('0xd')](_0xab37('0x14'),_0x579b34,JSON[_0xab37('0x1d')](_0x49f4dd));_0x313b5a(_0x49f4dd);})[_0xab37('0x13')](function(_0x5920e4){logger[_0xab37('0xf')](_0xab37('0x14'),_0x5920e4[_0xab37('0x11')],_0x579b34);_0x2e6181(_0x584414['error'](0x1f4,_0x5920e4[_0xab37('0x11')]));});});};exports[_0xab37('0x1e')]=function(_0x359387){var _0x2e4932=this;return new Promise(function(_0x2401bf,_0x32bef5){return db[_0xab37('0x15')]['find']({'raw':_0x359387[_0xab37('0x17')]?_0x359387[_0xab37('0x17')][_0xab37('0x18')]===undefined?!![]:![]:!![],'where':_0x359387['options']?_0x359387[_0xab37('0x17')]['where']||null:null,'attributes':_0x359387['options']?_0x359387[_0xab37('0x17')]['attributes']||null:null,'include':_0x359387[_0xab37('0x17')]?_0x359387[_0xab37('0x17')][_0xab37('0x1b')]?_[_0xab37('0x1c')](_0x359387[_0xab37('0x17')][_0xab37('0x1b')],function(_0x1e67ec){return{'model':db[_0x1e67ec['model']],'as':_0x1e67ec['as'],'attributes':_0x1e67ec[_0xab37('0x1a')],'include':_0x1e67ec['include']?_[_0xab37('0x1c')](_0x1e67ec[_0xab37('0x1b')],function(_0x3d5852){return{'model':db[_0x3d5852[_0xab37('0x1f')]],'as':_0x3d5852['as'],'attributes':_0x3d5852['attributes'],'include':_0x3d5852[_0xab37('0x1b')]?_[_0xab37('0x1c')](_0x3d5852[_0xab37('0x1b')],function(_0x216b4c){return{'model':db[_0x216b4c['model']],'as':_0x216b4c['as'],'attributes':_0x216b4c[_0xab37('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xab37('0x20')](function(_0x30dbda){logger[_0xab37('0xa')](_0xab37('0x1e'),_0x359387);logger[_0xab37('0xd')](_0xab37('0x1e'),_0x359387,JSON[_0xab37('0x1d')](_0x30dbda));_0x2401bf(_0x30dbda);})[_0xab37('0x13')](function(_0x34a423){logger['error'](_0xab37('0x1e'),_0x34a423[_0xab37('0x11')],_0x359387);_0x32bef5(_0x2e4932[_0xab37('0xf')](0x1f4,_0x34a423[_0xab37('0x11')]));});});}; \ No newline at end of file +var _0x7afb=['then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','debug','catch','find','where','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0x7afb,0x80));var _0xb7af=function(_0x224c1e,_0x53d3b0){_0x224c1e=_0x224c1e-0x0;var _0x326e72=_0x7afb[_0x224c1e];return _0x326e72;};'use strict';var _=require(_0xb7af('0x0'));var util=require(_0xb7af('0x1'));var moment=require('moment');var BPromise=require(_0xb7af('0x2'));var rs=require(_0xb7af('0x3'));var fs=require('fs');var Redis=require(_0xb7af('0x4'));var db=require(_0xb7af('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7af('0x6'))(_0xb7af('0x7'));var config=require(_0xb7af('0x8'));var jayson=require(_0xb7af('0x9'));var client=jayson[_0xb7af('0xa')][_0xb7af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b2298,_0x4c1209,_0x51a9d1){return new BPromise(function(_0xf7ef7e,_0xb134f0){return client['request'](_0x3b2298,_0x51a9d1)[_0xb7af('0xc')](function(_0x3db7f9){logger['info'](_0xb7af('0xd'),_0x4c1209,_0xb7af('0xe'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4c1209,_0xb7af('0xe'),JSON[_0xb7af('0xf')](_0x3db7f9));if(_0x3db7f9[_0xb7af('0x10')]){if(_0x3db7f9[_0xb7af('0x10')][_0xb7af('0x11')]===0x1f4){logger[_0xb7af('0x10')](_0xb7af('0xd'),_0x4c1209,_0x3db7f9[_0xb7af('0x10')][_0xb7af('0x12')]);return _0xb134f0(_0x3db7f9[_0xb7af('0x10')][_0xb7af('0x12')]);}logger[_0xb7af('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x4c1209,_0x3db7f9[_0xb7af('0x10')]['message']);return _0xf7ef7e(_0x3db7f9[_0xb7af('0x10')][_0xb7af('0x12')]);}else{logger[_0xb7af('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x4c1209,_0xb7af('0xe'));_0xf7ef7e(_0x3db7f9['result'][_0xb7af('0x12')]);}})['catch'](function(_0xe8c01b){logger[_0xb7af('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x4c1209,_0xe8c01b);_0xb134f0(_0xe8c01b);});});}exports[_0xb7af('0x14')]=function(_0x466a77){var _0x1e5b4b=this;return new Promise(function(_0x83e153,_0x376259){return db[_0xb7af('0x15')][_0xb7af('0x16')]({'raw':_0x466a77[_0xb7af('0x17')]?_0x466a77[_0xb7af('0x17')][_0xb7af('0x18')]===undefined?!![]:![]:!![],'where':_0x466a77['options']?_0x466a77[_0xb7af('0x17')]['where']||null:null,'attributes':_0x466a77['options']?_0x466a77[_0xb7af('0x17')][_0xb7af('0x19')]||null:null,'limit':_0x466a77[_0xb7af('0x17')]?_0x466a77[_0xb7af('0x17')][_0xb7af('0x1a')]||null:null,'include':_0x466a77[_0xb7af('0x17')]?_0x466a77[_0xb7af('0x17')][_0xb7af('0x1b')]?_[_0xb7af('0x1c')](_0x466a77[_0xb7af('0x17')]['include'],function(_0x31f281){return{'model':db[_0x31f281['model']],'as':_0x31f281['as'],'attributes':_0x31f281[_0xb7af('0x19')],'include':_0x31f281[_0xb7af('0x1b')]?_['map'](_0x31f281[_0xb7af('0x1b')],function(_0x49bd72){return{'model':db[_0x49bd72[_0xb7af('0x1d')]],'as':_0x49bd72['as'],'attributes':_0x49bd72[_0xb7af('0x19')],'include':_0x49bd72[_0xb7af('0x1b')]?_['map'](_0x49bd72[_0xb7af('0x1b')],function(_0x80e994){return{'model':db[_0x80e994[_0xb7af('0x1d')]],'as':_0x80e994['as'],'attributes':_0x80e994[_0xb7af('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb7af('0xc')](function(_0x427d43){logger[_0xb7af('0x13')](_0xb7af('0x14'),_0x466a77);logger[_0xb7af('0x1e')](_0xb7af('0x14'),_0x466a77,JSON[_0xb7af('0xf')](_0x427d43));_0x83e153(_0x427d43);})[_0xb7af('0x1f')](function(_0x50a72e){logger[_0xb7af('0x10')](_0xb7af('0x14'),_0x50a72e['message'],_0x466a77);_0x376259(_0x1e5b4b[_0xb7af('0x10')](0x1f4,_0x50a72e[_0xb7af('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x2a6f20){var _0x314ebb=this;return new Promise(function(_0x3da591,_0x298554){return db[_0xb7af('0x15')][_0xb7af('0x20')]({'raw':_0x2a6f20[_0xb7af('0x17')]?_0x2a6f20[_0xb7af('0x17')][_0xb7af('0x18')]===undefined?!![]:![]:!![],'where':_0x2a6f20[_0xb7af('0x17')]?_0x2a6f20['options'][_0xb7af('0x21')]||null:null,'attributes':_0x2a6f20['options']?_0x2a6f20[_0xb7af('0x17')][_0xb7af('0x19')]||null:null,'include':_0x2a6f20[_0xb7af('0x17')]?_0x2a6f20[_0xb7af('0x17')][_0xb7af('0x1b')]?_['map'](_0x2a6f20[_0xb7af('0x17')][_0xb7af('0x1b')],function(_0x18a9bd){return{'model':db[_0x18a9bd[_0xb7af('0x1d')]],'as':_0x18a9bd['as'],'attributes':_0x18a9bd[_0xb7af('0x19')],'include':_0x18a9bd[_0xb7af('0x1b')]?_[_0xb7af('0x1c')](_0x18a9bd['include'],function(_0x35e21e){return{'model':db[_0x35e21e[_0xb7af('0x1d')]],'as':_0x35e21e['as'],'attributes':_0x35e21e[_0xb7af('0x19')],'include':_0x35e21e[_0xb7af('0x1b')]?_[_0xb7af('0x1c')](_0x35e21e[_0xb7af('0x1b')],function(_0xc39179){return{'model':db[_0xc39179[_0xb7af('0x1d')]],'as':_0xc39179['as'],'attributes':_0xc39179[_0xb7af('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb7af('0xc')](function(_0x933d5c){logger[_0xb7af('0x13')]('ShowSugarcrmAccount',_0x2a6f20);logger[_0xb7af('0x1e')](_0xb7af('0x22'),_0x2a6f20,JSON[_0xb7af('0xf')](_0x933d5c));_0x3da591(_0x933d5c);})[_0xb7af('0x1f')](function(_0x171cb6){logger[_0xb7af('0x10')](_0xb7af('0x22'),_0x171cb6[_0xb7af('0x12')],_0x2a6f20);_0x298554(_0x314ebb[_0xb7af('0x10')](0x1f4,_0x171cb6[_0xb7af('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index e005359..612ee2d 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 _0xc4cc=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id'];(function(_0x336ba2,_0x26b1fa){var _0x2e699f=function(_0x5e7b74){while(--_0x5e7b74){_0x336ba2['push'](_0x336ba2['shift']());}};_0x2e699f(++_0x26b1fa);}(_0xc4cc,0xba));var _0xcc4c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc4cc[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xcc4c('0x0'));var util=require(_0xcc4c('0x1'));var path=require('path');var timeout=require(_0xcc4c('0x2'));var express=require(_0xcc4c('0x3'));var router=express[_0xcc4c('0x4')]();var fs_extra=require(_0xcc4c('0x5'));var auth=require(_0xcc4c('0x6'));var interaction=require(_0xcc4c('0x7'));var config=require('../../config/environment');var controller=require(_0xcc4c('0x8'));router[_0xcc4c('0x9')]('/',auth['isAuthenticated'](),controller[_0xcc4c('0xa')]);router[_0xcc4c('0x9')]('/:id',auth[_0xcc4c('0xb')](),controller[_0xcc4c('0xc')]);router[_0xcc4c('0x9')](_0xcc4c('0xd'),auth[_0xcc4c('0xb')](),controller[_0xcc4c('0xe')]);router[_0xcc4c('0x9')](_0xcc4c('0xf'),auth['isAuthenticated'](),controller[_0xcc4c('0x10')]);router[_0xcc4c('0x9')]('/:id/descriptions',auth[_0xcc4c('0xb')](),controller[_0xcc4c('0x11')]);router[_0xcc4c('0x12')]('/',auth[_0xcc4c('0xb')](),controller[_0xcc4c('0x13')]);router[_0xcc4c('0x14')](_0xcc4c('0x15'),auth[_0xcc4c('0xb')](),controller[_0xcc4c('0x16')]);router[_0xcc4c('0x17')](_0xcc4c('0x15'),auth[_0xcc4c('0xb')](),controller[_0xcc4c('0x18')]);module[_0xcc4c('0x19')]=router; \ No newline at end of file +var _0xb451=['index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0xb451,0x113));var _0x1b45=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0xb451[_0x1e9424];return _0x1bd96c;};'use strict';var multer=require('multer');var util=require(_0x1b45('0x0'));var path=require(_0x1b45('0x1'));var timeout=require(_0x1b45('0x2'));var express=require('express');var router=express[_0x1b45('0x3')]();var fs_extra=require(_0x1b45('0x4'));var auth=require(_0x1b45('0x5'));var interaction=require(_0x1b45('0x6'));var config=require(_0x1b45('0x7'));var controller=require(_0x1b45('0x8'));router[_0x1b45('0x9')]('/',auth[_0x1b45('0xa')](),controller[_0x1b45('0xb')]);router[_0x1b45('0x9')](_0x1b45('0xc'),auth[_0x1b45('0xa')](),controller[_0x1b45('0xd')]);router[_0x1b45('0x9')](_0x1b45('0xe'),auth[_0x1b45('0xa')](),controller['getFields']);router['get'](_0x1b45('0xf'),auth[_0x1b45('0xa')](),controller[_0x1b45('0x10')]);router[_0x1b45('0x9')](_0x1b45('0x11'),auth[_0x1b45('0xa')](),controller[_0x1b45('0x12')]);router[_0x1b45('0x13')]('/',auth[_0x1b45('0xa')](),controller[_0x1b45('0x14')]);router['put'](_0x1b45('0xc'),auth[_0x1b45('0xa')](),controller['update']);router[_0x1b45('0x15')]('/:id',auth[_0x1b45('0xa')](),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 730ec68..9aadcbe 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 _0x5a2b=['exports','STRING','sequelize'];(function(_0xb49bf0,_0x815644){var _0x1567a2=function(_0x276ea3){while(--_0x276ea3){_0xb49bf0['push'](_0xb49bf0['shift']());}};_0x1567a2(++_0x815644);}(_0x5a2b,0x7d));var _0xb5a2=function(_0x10887b,_0xaa75a9){_0x10887b=_0x10887b-0x0;var _0x3a00db=_0x5a2b[_0x10887b];return _0x3a00db;};'use strict';var Sequelize=require(_0xb5a2('0x0'));module[_0xb5a2('0x1')]={'name':{'type':Sequelize[_0xb5a2('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8029=['sequelize','exports','STRING'];(function(_0x1ee84e,_0xfceb15){var _0x198e29=function(_0x566446){while(--_0x566446){_0x1ee84e['push'](_0x1ee84e['shift']());}};_0x198e29(++_0xfceb15);}(_0x8029,0x15f));var _0x9802=function(_0x1baf3f,_0x4a698e){_0x1baf3f=_0x1baf3f-0x0;var _0x107b74=_0x8029[_0x1baf3f];return _0x107b74;};'use strict';var Sequelize=require(_0x9802('0x0'));module[_0x9802('0x1')]={'name':{'type':Sequelize[_0x9802('0x2')]},'description':{'type':Sequelize[_0x9802('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 70f4192..4c3bb43 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 _0x0691=['SugarcrmField','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','SugarcrmConfiguration','type','key','model','map','intersection','attributes','fields','length','query','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','update','body','findOne'];(function(_0xfaf6eb,_0x8ea9f3){var _0x4ad91d=function(_0x514dbf){while(--_0x514dbf){_0xfaf6eb['push'](_0xfaf6eb['shift']());}};_0x4ad91d(++_0x8ea9f3);}(_0x0691,0x19b));var _0x1069=function(_0x57d899,_0x2ee10b){_0x57d899=_0x57d899-0x0;var _0x1840fb=_0x0691[_0x57d899];return _0x1840fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1069('0x0'));var zipdir=require(_0x1069('0x1'));var jsonpatch=require(_0x1069('0x2'));var rp=require(_0x1069('0x3'));var moment=require('moment');var BPromise=require(_0x1069('0x4'));var Mustache=require('mustache');var util=require(_0x1069('0x5'));var path=require(_0x1069('0x6'));var sox=require(_0x1069('0x7'));var csv=require('to-csv');var ejs=require(_0x1069('0x8'));var fs=require('fs');var fs_extra=require(_0x1069('0x9'));var _=require(_0x1069('0xa'));var squel=require(_0x1069('0xb'));var crypto=require('crypto');var jsforce=require(_0x1069('0xc'));var deskjs=require(_0x1069('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1069('0xe'));var Papa=require(_0x1069('0xf'));var Redis=require(_0x1069('0x10'));var authService=require(_0x1069('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1069('0x12'));var hardwareService=require(_0x1069('0x13'));var logger=require(_0x1069('0x14'))('api');var utils=require(_0x1069('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1069('0x16'));var db=require(_0x1069('0x17'))['db'];function respondWithStatusCode(_0x1dda6b,_0x11a691){_0x11a691=_0x11a691||0xcc;return function(_0x221cf2){if(_0x221cf2){return _0x1dda6b[_0x1069('0x18')](_0x11a691);}return _0x1dda6b[_0x1069('0x19')](_0x11a691)[_0x1069('0x1a')]();};}function respondWithResult(_0x553c1c,_0x2a25ae){_0x2a25ae=_0x2a25ae||0xc8;return function(_0x28f3a7){if(_0x28f3a7){return _0x553c1c[_0x1069('0x19')](_0x2a25ae)[_0x1069('0x1b')](_0x28f3a7);}};}function respondWithFilteredResult(_0x52be40,_0x2a3d90){return function(_0xda20ca){if(_0xda20ca){var _0x200582=typeof _0x2a3d90[_0x1069('0x1c')]===_0x1069('0x1d')&&typeof _0x2a3d90[_0x1069('0x1e')]===_0x1069('0x1d');var _0x381f05=_0xda20ca[_0x1069('0x1f')];var _0x103c95=_0x200582?0x0:_0x2a3d90[_0x1069('0x1c')];var _0x3e1d12=_0x200582?_0xda20ca['count']:_0x2a3d90[_0x1069('0x1c')]+_0x2a3d90[_0x1069('0x1e')];var _0x1d0125;if(_0x3e1d12>=_0x381f05){_0x3e1d12=_0x381f05;_0x1d0125=0xc8;}else{_0x1d0125=0xce;}_0x52be40[_0x1069('0x19')](_0x1d0125);return _0x52be40['set'](_0x1069('0x20'),_0x103c95+'-'+_0x3e1d12+'/'+_0x381f05)[_0x1069('0x1b')](_0xda20ca);}return null;};}function patchUpdates(_0x23a689){return function(_0x337513){try{jsonpatch[_0x1069('0x21')](_0x337513,_0x23a689,!![]);}catch(_0x5b339d){return BPromise[_0x1069('0x22')](_0x5b339d);}return _0x337513[_0x1069('0x23')]();};}function saveUpdates(_0x1a13a5,_0x108668){return function(_0xcb35b1){if(_0xcb35b1){return _0xcb35b1['update'](_0x1a13a5)['then'](function(_0x500841){return _0x500841;});}return null;};}function removeEntity(_0x56c659,_0x1530a4){return function(_0x4fdc86){if(_0x4fdc86){return _0x4fdc86[_0x1069('0x24')]()[_0x1069('0x25')](function(){_0x56c659[_0x1069('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20edac,_0x1c3353){return function(_0x5edaf1){if(!_0x5edaf1){_0x20edac['sendStatus'](0x194);}return _0x5edaf1;};}function handleError(_0xcef1f2,_0x11aafe){_0x11aafe=_0x11aafe||0x1f4;return function(_0x1b6687){logger[_0x1069('0x26')](_0x1b6687[_0x1069('0x27')]);if(_0x1b6687[_0x1069('0x28')]){delete _0x1b6687['name'];}_0xcef1f2['status'](_0x11aafe)[_0x1069('0x29')](_0x1b6687);};}exports[_0x1069('0x2a')]=function(_0x1c1bf5,_0x1d274f){var _0x478c39={},_0x3d8927={},_0x2dfb8a={'count':0x0,'rows':[]};var _0x5ef5c7=_['map'](db[_0x1069('0x2b')]['rawAttributes'],function(_0x3071ad){return{'name':_0x3071ad['fieldName'],'type':_0x3071ad[_0x1069('0x2c')][_0x1069('0x2d')]};});_0x3d8927[_0x1069('0x2e')]=_[_0x1069('0x2f')](_0x5ef5c7,_0x1069('0x28'));_0x3d8927['query']=_['keys'](_0x1c1bf5['query']);_0x3d8927['filters']=_[_0x1069('0x30')](_0x3d8927[_0x1069('0x2e')],_0x3d8927['query']);_0x478c39[_0x1069('0x31')]=_['intersection'](_0x3d8927['model'],qs[_0x1069('0x32')](_0x1c1bf5['query'][_0x1069('0x32')]));_0x478c39[_0x1069('0x31')]=_0x478c39[_0x1069('0x31')][_0x1069('0x33')]?_0x478c39[_0x1069('0x31')]:_0x3d8927[_0x1069('0x2e')];if(!_0x1c1bf5['query']['hasOwnProperty']('nolimit')){_0x478c39[_0x1069('0x1e')]=qs[_0x1069('0x1e')](_0x1c1bf5[_0x1069('0x34')][_0x1069('0x1e')]);_0x478c39[_0x1069('0x1c')]=qs[_0x1069('0x1c')](_0x1c1bf5[_0x1069('0x34')][_0x1069('0x1c')]);}_0x478c39[_0x1069('0x35')]=qs['sort'](_0x1c1bf5['query'][_0x1069('0x36')]);_0x478c39['where']=qs[_0x1069('0x37')](_[_0x1069('0x38')](_0x1c1bf5[_0x1069('0x34')],_0x3d8927['filters']),_0x5ef5c7);if(_0x1c1bf5[_0x1069('0x34')][_0x1069('0x39')]){_0x478c39[_0x1069('0x3a')]=_[_0x1069('0x3b')](_0x478c39[_0x1069('0x3a')],{'$or':_[_0x1069('0x2f')](_0x5ef5c7,function(_0x25396d){if(_0x25396d[_0x1069('0x2c')]!==_0x1069('0x3c')){var _0x19d874={};_0x19d874[_0x25396d[_0x1069('0x28')]]={'$like':'%'+_0x1c1bf5[_0x1069('0x34')]['filter']+'%'};return _0x19d874;}})});}_0x478c39=_[_0x1069('0x3b')]({},_0x478c39,_0x1c1bf5[_0x1069('0x3d')]);var _0x45bc72={'where':_0x478c39['where']};return db[_0x1069('0x2b')][_0x1069('0x1f')](_0x45bc72)[_0x1069('0x25')](function(_0x3a43e9){_0x2dfb8a[_0x1069('0x1f')]=_0x3a43e9;if(_0x1c1bf5['query'][_0x1069('0x3e')]){_0x478c39[_0x1069('0x3f')]=[{'all':!![]}];}return db[_0x1069('0x2b')][_0x1069('0x40')](_0x478c39);})[_0x1069('0x25')](function(_0x410f33){_0x2dfb8a[_0x1069('0x41')]=_0x410f33;return _0x2dfb8a;})[_0x1069('0x25')](respondWithFilteredResult(_0x1d274f,_0x478c39))[_0x1069('0x42')](handleError(_0x1d274f,null));};exports['show']=function(_0x11298e,_0x4f9c10){var _0x42dbb1={'raw':![],'where':{'id':_0x11298e[_0x1069('0x43')]['id']}},_0xf0c81a={};_0xf0c81a['model']=_[_0x1069('0x44')](db['SugarcrmConfiguration'][_0x1069('0x45')]);_0xf0c81a[_0x1069('0x34')]=_[_0x1069('0x44')](_0x11298e['query']);_0xf0c81a[_0x1069('0x37')]=_[_0x1069('0x30')](_0xf0c81a['model'],_0xf0c81a[_0x1069('0x34')]);_0x42dbb1[_0x1069('0x31')]=_['intersection'](_0xf0c81a[_0x1069('0x2e')],qs[_0x1069('0x32')](_0x11298e[_0x1069('0x34')][_0x1069('0x32')]));_0x42dbb1['attributes']=_0x42dbb1['attributes']['length']?_0x42dbb1['attributes']:_0xf0c81a[_0x1069('0x2e')];if(_0x11298e[_0x1069('0x34')][_0x1069('0x3e')]){_0x42dbb1[_0x1069('0x3f')]=[{'all':!![]}];}_0x42dbb1=_['merge']({},_0x42dbb1,_0x11298e[_0x1069('0x3d')]);return db[_0x1069('0x2b')][_0x1069('0x46')](_0x42dbb1)[_0x1069('0x25')](handleEntityNotFound(_0x4f9c10,null))['then'](respondWithResult(_0x4f9c10,null))[_0x1069('0x42')](handleError(_0x4f9c10,null));};exports[_0x1069('0x47')]=function(_0x5882f8,_0x29a22d){return db['SugarcrmConfiguration'][_0x1069('0x47')](_0x5882f8['body'],{})[_0x1069('0x25')](respondWithResult(_0x29a22d,0xc9))[_0x1069('0x42')](handleError(_0x29a22d,null));};exports[_0x1069('0x48')]=function(_0x4b490a,_0xda16d8){if(_0x4b490a[_0x1069('0x49')]['id']){delete _0x4b490a[_0x1069('0x49')]['id'];}return db[_0x1069('0x2b')][_0x1069('0x46')]({'where':{'id':_0x4b490a[_0x1069('0x43')]['id']}})[_0x1069('0x25')](handleEntityNotFound(_0xda16d8,null))[_0x1069('0x25')](saveUpdates(_0x4b490a[_0x1069('0x49')],null))[_0x1069('0x25')](respondWithResult(_0xda16d8,null))[_0x1069('0x42')](handleError(_0xda16d8,null));};exports['destroy']=function(_0x2664fa,_0x4c01f8){return db[_0x1069('0x2b')]['find']({'where':{'id':_0x2664fa[_0x1069('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c01f8,null))[_0x1069('0x25')](removeEntity(_0x4c01f8,null))[_0x1069('0x42')](handleError(_0x4c01f8,null));};exports['getFields']=function(_0x3b7156,_0x23a133,_0x16f2e3){var _0x35098f={};var _0x2f8ef4={};var _0x16c0a3;var _0x575d94;return db[_0x1069('0x2b')][_0x1069('0x4a')]({'where':{'id':_0x3b7156[_0x1069('0x43')]['id']}})[_0x1069('0x25')](handleEntityNotFound(_0x23a133,null))[_0x1069('0x25')](function(_0x581aee){if(_0x581aee){_0x16c0a3=_0x581aee;_0x2f8ef4[_0x1069('0x2e')]=_[_0x1069('0x44')](db[_0x1069('0x4b')]['rawAttributes']);_0x2f8ef4[_0x1069('0x34')]=_[_0x1069('0x44')](_0x3b7156[_0x1069('0x34')]);_0x2f8ef4[_0x1069('0x37')]=_[_0x1069('0x30')](_0x2f8ef4[_0x1069('0x2e')],_0x2f8ef4[_0x1069('0x34')]);_0x35098f['attributes']=_[_0x1069('0x30')](_0x2f8ef4[_0x1069('0x2e')],qs[_0x1069('0x32')](_0x3b7156['query'][_0x1069('0x32')]));_0x35098f[_0x1069('0x31')]=_0x35098f[_0x1069('0x31')][_0x1069('0x33')]?_0x35098f[_0x1069('0x31')]:_0x2f8ef4['model'];_0x35098f['order']=qs[_0x1069('0x36')](_0x3b7156['query'][_0x1069('0x36')]);_0x35098f[_0x1069('0x3a')]=qs[_0x1069('0x37')](_[_0x1069('0x38')](_0x3b7156[_0x1069('0x34')],_0x2f8ef4[_0x1069('0x37')]));if(_0x3b7156[_0x1069('0x34')][_0x1069('0x39')]){_0x35098f[_0x1069('0x3a')]=_['merge'](_0x35098f['where'],{'$or':_[_0x1069('0x2f')](_0x35098f['attributes'],function(_0xe40bf0){var _0x4508ad={};_0x4508ad[_0xe40bf0]={'$like':'%'+_0x3b7156[_0x1069('0x34')][_0x1069('0x39')]+'%'};return _0x4508ad;})});}_0x35098f=_[_0x1069('0x3b')]({},_0x35098f,_0x3b7156[_0x1069('0x3d')]);return _0x16c0a3[_0x1069('0x4c')](_0x35098f);}})[_0x1069('0x25')](function(_0x579bc3){if(_0x579bc3){_0x575d94=_0x579bc3[_0x1069('0x33')];if(!_0x3b7156[_0x1069('0x34')][_0x1069('0x4d')](_0x1069('0x4e'))){_0x35098f[_0x1069('0x1e')]=qs[_0x1069('0x1e')](_0x3b7156[_0x1069('0x34')][_0x1069('0x1e')]);_0x35098f[_0x1069('0x1c')]=qs[_0x1069('0x1c')](_0x3b7156[_0x1069('0x34')][_0x1069('0x1c')]);}return _0x16c0a3[_0x1069('0x4c')](_0x35098f);}})[_0x1069('0x25')](function(_0x178272){if(_0x178272){return _0x178272?{'count':_0x575d94,'rows':_0x178272}:null;}})[_0x1069('0x25')](respondWithResult(_0x23a133,null))[_0x1069('0x42')](handleError(_0x23a133,null));};exports[_0x1069('0x4f')]=function(_0x309ed6,_0x1a002e,_0x458552){var _0x474830={};var _0x9b52ac={};var _0x4e65bc;var _0x2952e3;return db[_0x1069('0x2b')][_0x1069('0x4a')]({'where':{'id':_0x309ed6[_0x1069('0x43')]['id']}})[_0x1069('0x25')](handleEntityNotFound(_0x1a002e,null))[_0x1069('0x25')](function(_0x1b8891){if(_0x1b8891){_0x4e65bc=_0x1b8891;_0x9b52ac[_0x1069('0x2e')]=_[_0x1069('0x44')](db['SugarcrmField'][_0x1069('0x45')]);_0x9b52ac[_0x1069('0x34')]=_['keys'](_0x309ed6[_0x1069('0x34')]);_0x9b52ac['filters']=_[_0x1069('0x30')](_0x9b52ac[_0x1069('0x2e')],_0x9b52ac[_0x1069('0x34')]);_0x474830[_0x1069('0x31')]=_[_0x1069('0x30')](_0x9b52ac[_0x1069('0x2e')],qs[_0x1069('0x32')](_0x309ed6[_0x1069('0x34')][_0x1069('0x32')]));_0x474830['attributes']=_0x474830['attributes'][_0x1069('0x33')]?_0x474830['attributes']:_0x9b52ac[_0x1069('0x2e')];_0x474830['order']=qs[_0x1069('0x36')](_0x309ed6[_0x1069('0x34')][_0x1069('0x36')]);_0x474830['where']=qs[_0x1069('0x37')](_[_0x1069('0x38')](_0x309ed6['query'],_0x9b52ac[_0x1069('0x37')]));if(_0x309ed6[_0x1069('0x34')]['filter']){_0x474830['where']=_[_0x1069('0x3b')](_0x474830[_0x1069('0x3a')],{'$or':_[_0x1069('0x2f')](_0x474830[_0x1069('0x31')],function(_0x160879){var _0x4baec4={};_0x4baec4[_0x160879]={'$like':'%'+_0x309ed6[_0x1069('0x34')]['filter']+'%'};return _0x4baec4;})});}_0x474830=_[_0x1069('0x3b')]({},_0x474830,_0x309ed6[_0x1069('0x3d')]);return _0x4e65bc['getSubjects'](_0x474830);}})[_0x1069('0x25')](function(_0x440191){if(_0x440191){_0x2952e3=_0x440191[_0x1069('0x33')];if(!_0x309ed6[_0x1069('0x34')][_0x1069('0x4d')](_0x1069('0x4e'))){_0x474830[_0x1069('0x1e')]=qs[_0x1069('0x1e')](_0x309ed6['query'][_0x1069('0x1e')]);_0x474830['offset']=qs[_0x1069('0x1c')](_0x309ed6[_0x1069('0x34')]['offset']);}return _0x4e65bc[_0x1069('0x4f')](_0x474830);}})[_0x1069('0x25')](function(_0x414c8a){if(_0x414c8a){return _0x414c8a?{'count':_0x2952e3,'rows':_0x414c8a}:null;}})[_0x1069('0x25')](respondWithResult(_0x1a002e,null))[_0x1069('0x42')](handleError(_0x1a002e,null));};exports[_0x1069('0x50')]=function(_0x117dd7,_0x4b2581,_0x2dc895){var _0x2faf5c={};var _0x29c199={};var _0x1d4c53;var _0x49b653;return db[_0x1069('0x2b')]['findOne']({'where':{'id':_0x117dd7[_0x1069('0x43')]['id']}})[_0x1069('0x25')](handleEntityNotFound(_0x4b2581,null))['then'](function(_0xc9911e){if(_0xc9911e){_0x1d4c53=_0xc9911e;_0x29c199[_0x1069('0x2e')]=_[_0x1069('0x44')](db[_0x1069('0x4b')]['rawAttributes']);_0x29c199[_0x1069('0x34')]=_[_0x1069('0x44')](_0x117dd7[_0x1069('0x34')]);_0x29c199[_0x1069('0x37')]=_[_0x1069('0x30')](_0x29c199[_0x1069('0x2e')],_0x29c199[_0x1069('0x34')]);_0x2faf5c[_0x1069('0x31')]=_[_0x1069('0x30')](_0x29c199[_0x1069('0x2e')],qs[_0x1069('0x32')](_0x117dd7['query']['fields']));_0x2faf5c[_0x1069('0x31')]=_0x2faf5c[_0x1069('0x31')][_0x1069('0x33')]?_0x2faf5c['attributes']:_0x29c199[_0x1069('0x2e')];_0x2faf5c['order']=qs[_0x1069('0x36')](_0x117dd7[_0x1069('0x34')]['sort']);_0x2faf5c['where']=qs['filters'](_[_0x1069('0x38')](_0x117dd7[_0x1069('0x34')],_0x29c199[_0x1069('0x37')]));if(_0x117dd7[_0x1069('0x34')][_0x1069('0x39')]){_0x2faf5c[_0x1069('0x3a')]=_['merge'](_0x2faf5c[_0x1069('0x3a')],{'$or':_[_0x1069('0x2f')](_0x2faf5c['attributes'],function(_0x5b8ab9){var _0x23e779={};_0x23e779[_0x5b8ab9]={'$like':'%'+_0x117dd7[_0x1069('0x34')][_0x1069('0x39')]+'%'};return _0x23e779;})});}_0x2faf5c=_['merge']({},_0x2faf5c,_0x117dd7[_0x1069('0x3d')]);return _0x1d4c53['getDescriptions'](_0x2faf5c);}})[_0x1069('0x25')](function(_0x423018){if(_0x423018){_0x49b653=_0x423018['length'];if(!_0x117dd7['query'][_0x1069('0x4d')](_0x1069('0x4e'))){_0x2faf5c[_0x1069('0x1e')]=qs[_0x1069('0x1e')](_0x117dd7['query'][_0x1069('0x1e')]);_0x2faf5c['offset']=qs[_0x1069('0x1c')](_0x117dd7[_0x1069('0x34')][_0x1069('0x1c')]);}return _0x1d4c53[_0x1069('0x50')](_0x2faf5c);}})[_0x1069('0x25')](function(_0x1773e5){if(_0x1773e5){return _0x1773e5?{'count':_0x49b653,'rows':_0x1773e5}:null;}})[_0x1069('0x25')](respondWithResult(_0x4b2581,null))[_0x1069('0x42')](handleError(_0x4b2581,null));}; \ No newline at end of file +var _0xe9da=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','error','name','send','index','SugarcrmConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','merge','find','create','body','catch','getFields','findOne','SugarcrmField','order','nolimit','getSubjects','getDescriptions','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe9da,0x177));var _0xae9d=function(_0x41799e,_0x1320b1){_0x41799e=_0x41799e-0x0;var _0xa2bdb4=_0xe9da[_0x41799e];return _0xa2bdb4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae9d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xae9d('0x1'));var BPromise=require(_0xae9d('0x2'));var Mustache=require(_0xae9d('0x3'));var util=require(_0xae9d('0x4'));var path=require('path');var sox=require(_0xae9d('0x5'));var csv=require(_0xae9d('0x6'));var ejs=require(_0xae9d('0x7'));var fs=require('fs');var fs_extra=require(_0xae9d('0x8'));var _=require(_0xae9d('0x9'));var squel=require('squel');var crypto=require(_0xae9d('0xa'));var jsforce=require(_0xae9d('0xb'));var deskjs=require(_0xae9d('0xc'));var toCsv=require(_0xae9d('0x6'));var querystring=require('querystring');var Papa=require(_0xae9d('0xd'));var Redis=require(_0xae9d('0xe'));var authService=require(_0xae9d('0xf'));var qs=require(_0xae9d('0x10'));var as=require(_0xae9d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae9d('0x12'))(_0xae9d('0x13'));var utils=require(_0xae9d('0x14'));var config=require(_0xae9d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xae9d('0x16'))['db'];function respondWithStatusCode(_0x2ac348,_0x7a75ef){_0x7a75ef=_0x7a75ef||0xcc;return function(_0x412343){if(_0x412343){return _0x2ac348[_0xae9d('0x17')](_0x7a75ef);}return _0x2ac348['status'](_0x7a75ef)[_0xae9d('0x18')]();};}function respondWithResult(_0x5ba337,_0x528ce2){_0x528ce2=_0x528ce2||0xc8;return function(_0x6de752){if(_0x6de752){return _0x5ba337[_0xae9d('0x19')](_0x528ce2)['json'](_0x6de752);}};}function respondWithFilteredResult(_0x355200,_0x41a75d){return function(_0xf3202c){if(_0xf3202c){var _0xa593f5=typeof _0x41a75d['offset']===_0xae9d('0x1a')&&typeof _0x41a75d[_0xae9d('0x1b')]===_0xae9d('0x1a');var _0x46898c=_0xf3202c[_0xae9d('0x1c')];var _0x37a447=_0xa593f5?0x0:_0x41a75d[_0xae9d('0x1d')];var _0xdc59c0=_0xa593f5?_0xf3202c[_0xae9d('0x1c')]:_0x41a75d[_0xae9d('0x1d')]+_0x41a75d[_0xae9d('0x1b')];var _0x4d2093;if(_0xdc59c0>=_0x46898c){_0xdc59c0=_0x46898c;_0x4d2093=0xc8;}else{_0x4d2093=0xce;}_0x355200[_0xae9d('0x19')](_0x4d2093);return _0x355200[_0xae9d('0x1e')](_0xae9d('0x1f'),_0x37a447+'-'+_0xdc59c0+'/'+_0x46898c)[_0xae9d('0x20')](_0xf3202c);}return null;};}function patchUpdates(_0x55795f){return function(_0x260588){try{jsonpatch['apply'](_0x260588,_0x55795f,!![]);}catch(_0x5d1703){return BPromise['reject'](_0x5d1703);}return _0x260588['save']();};}function saveUpdates(_0x2e72b6,_0x5a6f9d){return function(_0x344af5){if(_0x344af5){return _0x344af5[_0xae9d('0x21')](_0x2e72b6)[_0xae9d('0x22')](function(_0x8faf0c){return _0x8faf0c;});}return null;};}function removeEntity(_0x1a1fa5,_0x102dfc){return function(_0x4838b3){if(_0x4838b3){return _0x4838b3[_0xae9d('0x23')]()[_0xae9d('0x22')](function(){_0x1a1fa5['status'](0xcc)[_0xae9d('0x18')]();});}};}function handleEntityNotFound(_0x2ad9f3,_0x4b0071){return function(_0x333877){if(!_0x333877){_0x2ad9f3['sendStatus'](0x194);}return _0x333877;};}function handleError(_0x309bfb,_0x3dc00c){_0x3dc00c=_0x3dc00c||0x1f4;return function(_0x38944e){logger[_0xae9d('0x24')](_0x38944e['stack']);if(_0x38944e[_0xae9d('0x25')]){delete _0x38944e[_0xae9d('0x25')];}_0x309bfb[_0xae9d('0x19')](_0x3dc00c)[_0xae9d('0x26')](_0x38944e);};}exports[_0xae9d('0x27')]=function(_0x593bdc,_0x5b9a10){var _0x1a4bd7={},_0x19a9ec={},_0x25d7db={'count':0x0,'rows':[]};var _0x1bf3bf=_['map'](db[_0xae9d('0x28')][_0xae9d('0x29')],function(_0x54d9f8){return{'name':_0x54d9f8['fieldName'],'type':_0x54d9f8[_0xae9d('0x2a')][_0xae9d('0x2b')]};});_0x19a9ec[_0xae9d('0x2c')]=_[_0xae9d('0x2d')](_0x1bf3bf,_0xae9d('0x25'));_0x19a9ec[_0xae9d('0x2e')]=_[_0xae9d('0x2f')](_0x593bdc[_0xae9d('0x2e')]);_0x19a9ec[_0xae9d('0x30')]=_[_0xae9d('0x31')](_0x19a9ec[_0xae9d('0x2c')],_0x19a9ec[_0xae9d('0x2e')]);_0x1a4bd7['attributes']=_[_0xae9d('0x31')](_0x19a9ec['model'],qs[_0xae9d('0x32')](_0x593bdc[_0xae9d('0x2e')][_0xae9d('0x32')]));_0x1a4bd7[_0xae9d('0x33')]=_0x1a4bd7[_0xae9d('0x33')][_0xae9d('0x34')]?_0x1a4bd7['attributes']:_0x19a9ec['model'];if(!_0x593bdc['query'][_0xae9d('0x35')]('nolimit')){_0x1a4bd7[_0xae9d('0x1b')]=qs[_0xae9d('0x1b')](_0x593bdc['query'][_0xae9d('0x1b')]);_0x1a4bd7[_0xae9d('0x1d')]=qs[_0xae9d('0x1d')](_0x593bdc[_0xae9d('0x2e')][_0xae9d('0x1d')]);}_0x1a4bd7['order']=qs[_0xae9d('0x36')](_0x593bdc[_0xae9d('0x2e')][_0xae9d('0x36')]);_0x1a4bd7['where']=qs[_0xae9d('0x30')](_[_0xae9d('0x37')](_0x593bdc[_0xae9d('0x2e')],_0x19a9ec[_0xae9d('0x30')]),_0x1bf3bf);if(_0x593bdc[_0xae9d('0x2e')][_0xae9d('0x38')]){_0x1a4bd7[_0xae9d('0x39')]=_['merge'](_0x1a4bd7[_0xae9d('0x39')],{'$or':_[_0xae9d('0x2d')](_0x1bf3bf,function(_0x1f7e6a){if(_0x1f7e6a[_0xae9d('0x2a')]!==_0xae9d('0x3a')){var _0x43817d={};_0x43817d[_0x1f7e6a[_0xae9d('0x25')]]={'$like':'%'+_0x593bdc[_0xae9d('0x2e')]['filter']+'%'};return _0x43817d;}})});}_0x1a4bd7=_['merge']({},_0x1a4bd7,_0x593bdc[_0xae9d('0x3b')]);var _0xd2da8e={'where':_0x1a4bd7['where']};return db[_0xae9d('0x28')][_0xae9d('0x1c')](_0xd2da8e)['then'](function(_0x1e877e){_0x25d7db['count']=_0x1e877e;if(_0x593bdc[_0xae9d('0x2e')][_0xae9d('0x3c')]){_0x1a4bd7['include']=[{'all':!![]}];}return db[_0xae9d('0x28')][_0xae9d('0x3d')](_0x1a4bd7);})[_0xae9d('0x22')](function(_0x32f7e0){_0x25d7db[_0xae9d('0x3e')]=_0x32f7e0;return _0x25d7db;})[_0xae9d('0x22')](respondWithFilteredResult(_0x5b9a10,_0x1a4bd7))['catch'](handleError(_0x5b9a10,null));};exports[_0xae9d('0x3f')]=function(_0x283ee9,_0x26720a){var _0x120f5c={'raw':![],'where':{'id':_0x283ee9[_0xae9d('0x40')]['id']}},_0x5d7778={};_0x5d7778[_0xae9d('0x2c')]=_['keys'](db['SugarcrmConfiguration'][_0xae9d('0x29')]);_0x5d7778[_0xae9d('0x2e')]=_[_0xae9d('0x2f')](_0x283ee9['query']);_0x5d7778[_0xae9d('0x30')]=_[_0xae9d('0x31')](_0x5d7778[_0xae9d('0x2c')],_0x5d7778[_0xae9d('0x2e')]);_0x120f5c[_0xae9d('0x33')]=_['intersection'](_0x5d7778['model'],qs[_0xae9d('0x32')](_0x283ee9['query'][_0xae9d('0x32')]));_0x120f5c['attributes']=_0x120f5c['attributes']['length']?_0x120f5c[_0xae9d('0x33')]:_0x5d7778[_0xae9d('0x2c')];if(_0x283ee9[_0xae9d('0x2e')]['includeAll']){_0x120f5c[_0xae9d('0x41')]=[{'all':!![]}];}_0x120f5c=_[_0xae9d('0x42')]({},_0x120f5c,_0x283ee9['options']);return db[_0xae9d('0x28')][_0xae9d('0x43')](_0x120f5c)[_0xae9d('0x22')](handleEntityNotFound(_0x26720a,null))['then'](respondWithResult(_0x26720a,null))['catch'](handleError(_0x26720a,null));};exports[_0xae9d('0x44')]=function(_0x279842,_0x24a55a){return db[_0xae9d('0x28')][_0xae9d('0x44')](_0x279842[_0xae9d('0x45')],{})[_0xae9d('0x22')](respondWithResult(_0x24a55a,0xc9))[_0xae9d('0x46')](handleError(_0x24a55a,null));};exports[_0xae9d('0x21')]=function(_0x43e8e6,_0x4a6e83){if(_0x43e8e6[_0xae9d('0x45')]['id']){delete _0x43e8e6['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x43e8e6[_0xae9d('0x40')]['id']}})[_0xae9d('0x22')](handleEntityNotFound(_0x4a6e83,null))[_0xae9d('0x22')](saveUpdates(_0x43e8e6['body'],null))[_0xae9d('0x22')](respondWithResult(_0x4a6e83,null))[_0xae9d('0x46')](handleError(_0x4a6e83,null));};exports['destroy']=function(_0x36d530,_0x5ca249){return db[_0xae9d('0x28')]['find']({'where':{'id':_0x36d530[_0xae9d('0x40')]['id']}})[_0xae9d('0x22')](handleEntityNotFound(_0x5ca249,null))[_0xae9d('0x22')](removeEntity(_0x5ca249,null))[_0xae9d('0x46')](handleError(_0x5ca249,null));};exports[_0xae9d('0x47')]=function(_0x3097ce,_0x15cfc6,_0x3afc21){var _0x2d60dd={};var _0x332bea={};var _0xc329dd;var _0x227710;return db[_0xae9d('0x28')][_0xae9d('0x48')]({'where':{'id':_0x3097ce['params']['id']}})[_0xae9d('0x22')](handleEntityNotFound(_0x15cfc6,null))[_0xae9d('0x22')](function(_0x475caf){if(_0x475caf){_0xc329dd=_0x475caf;_0x332bea[_0xae9d('0x2c')]=_[_0xae9d('0x2f')](db[_0xae9d('0x49')][_0xae9d('0x29')]);_0x332bea['query']=_[_0xae9d('0x2f')](_0x3097ce[_0xae9d('0x2e')]);_0x332bea[_0xae9d('0x30')]=_[_0xae9d('0x31')](_0x332bea[_0xae9d('0x2c')],_0x332bea[_0xae9d('0x2e')]);_0x2d60dd[_0xae9d('0x33')]=_['intersection'](_0x332bea[_0xae9d('0x2c')],qs[_0xae9d('0x32')](_0x3097ce['query'][_0xae9d('0x32')]));_0x2d60dd[_0xae9d('0x33')]=_0x2d60dd[_0xae9d('0x33')][_0xae9d('0x34')]?_0x2d60dd[_0xae9d('0x33')]:_0x332bea['model'];_0x2d60dd[_0xae9d('0x4a')]=qs['sort'](_0x3097ce[_0xae9d('0x2e')][_0xae9d('0x36')]);_0x2d60dd[_0xae9d('0x39')]=qs[_0xae9d('0x30')](_['pick'](_0x3097ce[_0xae9d('0x2e')],_0x332bea[_0xae9d('0x30')]));if(_0x3097ce['query'][_0xae9d('0x38')]){_0x2d60dd[_0xae9d('0x39')]=_[_0xae9d('0x42')](_0x2d60dd[_0xae9d('0x39')],{'$or':_['map'](_0x2d60dd['attributes'],function(_0x52b2b1){var _0x2098a4={};_0x2098a4[_0x52b2b1]={'$like':'%'+_0x3097ce[_0xae9d('0x2e')][_0xae9d('0x38')]+'%'};return _0x2098a4;})});}_0x2d60dd=_[_0xae9d('0x42')]({},_0x2d60dd,_0x3097ce[_0xae9d('0x3b')]);return _0xc329dd[_0xae9d('0x47')](_0x2d60dd);}})[_0xae9d('0x22')](function(_0x19d05e){if(_0x19d05e){_0x227710=_0x19d05e['length'];if(!_0x3097ce[_0xae9d('0x2e')][_0xae9d('0x35')](_0xae9d('0x4b'))){_0x2d60dd['limit']=qs[_0xae9d('0x1b')](_0x3097ce[_0xae9d('0x2e')][_0xae9d('0x1b')]);_0x2d60dd['offset']=qs['offset'](_0x3097ce[_0xae9d('0x2e')][_0xae9d('0x1d')]);}return _0xc329dd[_0xae9d('0x47')](_0x2d60dd);}})['then'](function(_0x5a0bdf){if(_0x5a0bdf){return _0x5a0bdf?{'count':_0x227710,'rows':_0x5a0bdf}:null;}})[_0xae9d('0x22')](respondWithResult(_0x15cfc6,null))[_0xae9d('0x46')](handleError(_0x15cfc6,null));};exports[_0xae9d('0x4c')]=function(_0x29831b,_0x3be76a,_0x2a69ab){var _0xa82369={};var _0x3b2efd={};var _0x58bbcc;var _0x32e578;return db[_0xae9d('0x28')][_0xae9d('0x48')]({'where':{'id':_0x29831b[_0xae9d('0x40')]['id']}})[_0xae9d('0x22')](handleEntityNotFound(_0x3be76a,null))['then'](function(_0x3e61b8){if(_0x3e61b8){_0x58bbcc=_0x3e61b8;_0x3b2efd[_0xae9d('0x2c')]=_[_0xae9d('0x2f')](db[_0xae9d('0x49')][_0xae9d('0x29')]);_0x3b2efd[_0xae9d('0x2e')]=_[_0xae9d('0x2f')](_0x29831b[_0xae9d('0x2e')]);_0x3b2efd[_0xae9d('0x30')]=_['intersection'](_0x3b2efd[_0xae9d('0x2c')],_0x3b2efd[_0xae9d('0x2e')]);_0xa82369[_0xae9d('0x33')]=_[_0xae9d('0x31')](_0x3b2efd[_0xae9d('0x2c')],qs[_0xae9d('0x32')](_0x29831b[_0xae9d('0x2e')][_0xae9d('0x32')]));_0xa82369[_0xae9d('0x33')]=_0xa82369[_0xae9d('0x33')][_0xae9d('0x34')]?_0xa82369['attributes']:_0x3b2efd[_0xae9d('0x2c')];_0xa82369[_0xae9d('0x4a')]=qs['sort'](_0x29831b[_0xae9d('0x2e')]['sort']);_0xa82369[_0xae9d('0x39')]=qs[_0xae9d('0x30')](_[_0xae9d('0x37')](_0x29831b[_0xae9d('0x2e')],_0x3b2efd['filters']));if(_0x29831b['query'][_0xae9d('0x38')]){_0xa82369[_0xae9d('0x39')]=_[_0xae9d('0x42')](_0xa82369['where'],{'$or':_[_0xae9d('0x2d')](_0xa82369['attributes'],function(_0x32c950){var _0x486713={};_0x486713[_0x32c950]={'$like':'%'+_0x29831b[_0xae9d('0x2e')]['filter']+'%'};return _0x486713;})});}_0xa82369=_[_0xae9d('0x42')]({},_0xa82369,_0x29831b[_0xae9d('0x3b')]);return _0x58bbcc[_0xae9d('0x4c')](_0xa82369);}})['then'](function(_0x5ce8d7){if(_0x5ce8d7){_0x32e578=_0x5ce8d7['length'];if(!_0x29831b['query'][_0xae9d('0x35')]('nolimit')){_0xa82369[_0xae9d('0x1b')]=qs[_0xae9d('0x1b')](_0x29831b[_0xae9d('0x2e')]['limit']);_0xa82369['offset']=qs[_0xae9d('0x1d')](_0x29831b['query'][_0xae9d('0x1d')]);}return _0x58bbcc[_0xae9d('0x4c')](_0xa82369);}})[_0xae9d('0x22')](function(_0x3178e6){if(_0x3178e6){return _0x3178e6?{'count':_0x32e578,'rows':_0x3178e6}:null;}})[_0xae9d('0x22')](respondWithResult(_0x3be76a,null))['catch'](handleError(_0x3be76a,null));};exports['getDescriptions']=function(_0x4b453b,_0x58b28a,_0x5348bd){var _0x448cab={};var _0x446aa4={};var _0x309b97;var _0x2ed462;return db['SugarcrmConfiguration'][_0xae9d('0x48')]({'where':{'id':_0x4b453b[_0xae9d('0x40')]['id']}})[_0xae9d('0x22')](handleEntityNotFound(_0x58b28a,null))[_0xae9d('0x22')](function(_0x49afdf){if(_0x49afdf){_0x309b97=_0x49afdf;_0x446aa4['model']=_[_0xae9d('0x2f')](db[_0xae9d('0x49')]['rawAttributes']);_0x446aa4[_0xae9d('0x2e')]=_[_0xae9d('0x2f')](_0x4b453b[_0xae9d('0x2e')]);_0x446aa4[_0xae9d('0x30')]=_[_0xae9d('0x31')](_0x446aa4[_0xae9d('0x2c')],_0x446aa4[_0xae9d('0x2e')]);_0x448cab['attributes']=_[_0xae9d('0x31')](_0x446aa4['model'],qs['fields'](_0x4b453b[_0xae9d('0x2e')]['fields']));_0x448cab[_0xae9d('0x33')]=_0x448cab[_0xae9d('0x33')]['length']?_0x448cab[_0xae9d('0x33')]:_0x446aa4[_0xae9d('0x2c')];_0x448cab['order']=qs[_0xae9d('0x36')](_0x4b453b['query'][_0xae9d('0x36')]);_0x448cab['where']=qs[_0xae9d('0x30')](_[_0xae9d('0x37')](_0x4b453b[_0xae9d('0x2e')],_0x446aa4[_0xae9d('0x30')]));if(_0x4b453b[_0xae9d('0x2e')][_0xae9d('0x38')]){_0x448cab[_0xae9d('0x39')]=_['merge'](_0x448cab[_0xae9d('0x39')],{'$or':_['map'](_0x448cab[_0xae9d('0x33')],function(_0x19e0e5){var _0x200a41={};_0x200a41[_0x19e0e5]={'$like':'%'+_0x4b453b['query'][_0xae9d('0x38')]+'%'};return _0x200a41;})});}_0x448cab=_[_0xae9d('0x42')]({},_0x448cab,_0x4b453b[_0xae9d('0x3b')]);return _0x309b97[_0xae9d('0x4d')](_0x448cab);}})[_0xae9d('0x22')](function(_0x2616d8){if(_0x2616d8){_0x2ed462=_0x2616d8[_0xae9d('0x34')];if(!_0x4b453b[_0xae9d('0x2e')]['hasOwnProperty'](_0xae9d('0x4b'))){_0x448cab[_0xae9d('0x1b')]=qs[_0xae9d('0x1b')](_0x4b453b['query'][_0xae9d('0x1b')]);_0x448cab['offset']=qs['offset'](_0x4b453b[_0xae9d('0x2e')]['offset']);}return _0x309b97[_0xae9d('0x4d')](_0x448cab);}})[_0xae9d('0x22')](function(_0x35db49){if(_0x35db49){return _0x35db49?{'count':_0x2ed462,'rows':_0x35db49}:null;}})[_0xae9d('0x22')](respondWithResult(_0x58b28a,null))[_0xae9d('0x46')](handleError(_0x58b28a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index aadaf9f..64bf705 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 _0x23f1=['path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x23f1,0x119));var _0x123f=function(_0x72bff2,_0x1cbec3){_0x72bff2=_0x72bff2-0x0;var _0x370c6a=_0x23f1[_0x72bff2];return _0x370c6a;};'use strict';var _=require(_0x123f('0x0'));var util=require(_0x123f('0x1'));var logger=require(_0x123f('0x2'))(_0x123f('0x3'));var moment=require(_0x123f('0x4'));var BPromise=require(_0x123f('0x5'));var rp=require(_0x123f('0x6'));var fs=require('fs');var path=require(_0x123f('0x7'));var rimraf=require(_0x123f('0x8'));var config=require('../../config/environment');var attributes=require(_0x123f('0x9'));module['exports']=function(_0x36e18c,_0x270604){return _0x36e18c[_0x123f('0xa')](_0x123f('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97b8=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x97b8,0x128));var _0x897b=function(_0x9ca697,_0x54ad1f){_0x9ca697=_0x9ca697-0x0;var _0x1cefdd=_0x97b8[_0x9ca697];return _0x1cefdd;};'use strict';var _=require(_0x897b('0x0'));var util=require(_0x897b('0x1'));var logger=require(_0x897b('0x2'))(_0x897b('0x3'));var moment=require(_0x897b('0x4'));var BPromise=require('bluebird');var rp=require(_0x897b('0x5'));var fs=require('fs');var path=require(_0x897b('0x6'));var rimraf=require(_0x897b('0x7'));var config=require(_0x897b('0x8'));var attributes=require(_0x897b('0x9'));module[_0x897b('0xa')]=function(_0x527f1c,_0xe6203c){return _0x527f1c[_0x897b('0xb')](_0x897b('0xc'),attributes,{'tableName':_0x897b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index b71cf01..1e85dd4 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 _0xaf70=['rpc','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaf70,0x174));var _0x0af7=function(_0x312e41,_0x18b050){_0x312e41=_0x312e41-0x0;var _0x4c8eef=_0xaf70[_0x312e41];return _0x4c8eef;};'use strict';var _=require('lodash');var util=require(_0x0af7('0x0'));var moment=require(_0x0af7('0x1'));var BPromise=require(_0x0af7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0af7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0af7('0x4'));var logger=require(_0x0af7('0x5'))(_0x0af7('0x6'));var config=require('../../config/environment');var jayson=require(_0x0af7('0x7'));var client=jayson[_0x0af7('0x8')][_0x0af7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4af656,_0x1284b6,_0x25750a){return new BPromise(function(_0x3794f8,_0x16b129){return client['request'](_0x4af656,_0x25750a)[_0x0af7('0xa')](function(_0xdf97a8){logger[_0x0af7('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1284b6,'request\x20sent');logger[_0x0af7('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1284b6,_0x0af7('0xd'),JSON[_0x0af7('0xe')](_0xdf97a8));if(_0xdf97a8[_0x0af7('0xf')]){if(_0xdf97a8[_0x0af7('0xf')][_0x0af7('0x10')]===0x1f4){logger[_0x0af7('0xf')](_0x0af7('0x11'),_0x1284b6,_0xdf97a8[_0x0af7('0xf')]['message']);return _0x16b129(_0xdf97a8[_0x0af7('0xf')]['message']);}logger['error'](_0x0af7('0x11'),_0x1284b6,_0xdf97a8[_0x0af7('0xf')][_0x0af7('0x12')]);return _0x3794f8(_0xdf97a8[_0x0af7('0xf')]['message']);}else{logger[_0x0af7('0xb')](_0x0af7('0x11'),_0x1284b6,'request\x20sent');_0x3794f8(_0xdf97a8[_0x0af7('0x13')]['message']);}})[_0x0af7('0x14')](function(_0x1191df){logger['error'](_0x0af7('0x11'),_0x1284b6,_0x1191df);_0x16b129(_0x1191df);});});} \ No newline at end of file +var _0x3bc3=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x48e03e,_0x11e7d4){var _0x525d99=function(_0x1fe86d){while(--_0x1fe86d){_0x48e03e['push'](_0x48e03e['shift']());}};_0x525d99(++_0x11e7d4);}(_0x3bc3,0x1b4));var _0x33bc=function(_0x5b0df3,_0x150c2b){_0x5b0df3=_0x5b0df3-0x0;var _0x567bd2=_0x3bc3[_0x5b0df3];return _0x567bd2;};'use strict';var _=require(_0x33bc('0x0'));var util=require(_0x33bc('0x1'));var moment=require(_0x33bc('0x2'));var BPromise=require(_0x33bc('0x3'));var rs=require(_0x33bc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33bc('0x5'))['db'];var utils=require(_0x33bc('0x6'));var logger=require(_0x33bc('0x7'))(_0x33bc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x33bc('0x9')][_0x33bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x355cca,_0x4bf690,_0x90ca85){return new BPromise(function(_0x214c6a,_0x18a911){return client['request'](_0x355cca,_0x90ca85)['then'](function(_0x41cb33){logger['info'](_0x33bc('0xb'),_0x4bf690,'request\x20sent');logger[_0x33bc('0xc')](_0x33bc('0xd'),_0x4bf690,_0x33bc('0xe'),JSON[_0x33bc('0xf')](_0x41cb33));if(_0x41cb33[_0x33bc('0x10')]){if(_0x41cb33[_0x33bc('0x10')][_0x33bc('0x11')]===0x1f4){logger[_0x33bc('0x10')](_0x33bc('0xb'),_0x4bf690,_0x41cb33[_0x33bc('0x10')]['message']);return _0x18a911(_0x41cb33[_0x33bc('0x10')][_0x33bc('0x12')]);}logger[_0x33bc('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4bf690,_0x41cb33[_0x33bc('0x10')][_0x33bc('0x12')]);return _0x214c6a(_0x41cb33[_0x33bc('0x10')][_0x33bc('0x12')]);}else{logger[_0x33bc('0x13')](_0x33bc('0xb'),_0x4bf690,_0x33bc('0xe'));_0x214c6a(_0x41cb33[_0x33bc('0x14')][_0x33bc('0x12')]);}})[_0x33bc('0x15')](function(_0x3943ab){logger[_0x33bc('0x10')](_0x33bc('0xb'),_0x4bf690,_0x3943ab);_0x18a911(_0x3943ab);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index cd417bc..31eec2f 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 _0x21e4=['/:id','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','show','post','create','update','delete'];(function(_0x4f5624,_0x2510de){var _0xf87f78=function(_0x467fef){while(--_0x467fef){_0x4f5624['push'](_0x4f5624['shift']());}};_0xf87f78(++_0x2510de);}(_0x21e4,0xe2));var _0x421e=function(_0x24521f,_0x591221){_0x24521f=_0x24521f-0x0;var _0x2f0b39=_0x21e4[_0x24521f];return _0x2f0b39;};'use strict';var multer=require(_0x421e('0x0'));var util=require(_0x421e('0x1'));var path=require(_0x421e('0x2'));var timeout=require(_0x421e('0x3'));var express=require(_0x421e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x421e('0x5'));var config=require('../../config/environment');var controller=require(_0x421e('0x6'));router[_0x421e('0x7')]('/',auth[_0x421e('0x8')](),controller['index']);router[_0x421e('0x7')]('/:id',auth[_0x421e('0x8')](),controller[_0x421e('0x9')]);router[_0x421e('0xa')]('/',auth[_0x421e('0x8')](),controller[_0x421e('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x421e('0xc')]);router[_0x421e('0xd')](_0x421e('0xe'),auth[_0x421e('0x8')](),controller['destroy']);module[_0x421e('0xf')]=router; \ No newline at end of file +var _0x6986=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','get','post','isAuthenticated','create','put','/:id','update','exports','multer'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6986,0x97));var _0x6698=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x6986[_0x2d994d];return _0xd54be4;};'use strict';var multer=require(_0x6698('0x0'));var util=require(_0x6698('0x1'));var path=require('path');var timeout=require(_0x6698('0x2'));var express=require(_0x6698('0x3'));var router=express[_0x6698('0x4')]();var fs_extra=require(_0x6698('0x5'));var auth=require(_0x6698('0x6'));var interaction=require(_0x6698('0x7'));var config=require(_0x6698('0x8'));var controller=require(_0x6698('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x6698('0xa')]);router[_0x6698('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6698('0xc')]('/',auth[_0x6698('0xd')](),controller[_0x6698('0xe')]);router[_0x6698('0xf')](_0x6698('0x10'),auth['isAuthenticated'](),controller[_0x6698('0x11')]);router['delete'](_0x6698('0x10'),auth[_0x6698('0xd')](),controller['destroy']);module[_0x6698('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 0c85f5e..2b751af 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 _0xd6ec=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x27054e,_0x2f0a75){var _0x541962=function(_0x3fc452){while(--_0x3fc452){_0x27054e['push'](_0x27054e['shift']());}};_0x541962(++_0x2f0a75);}(_0xd6ec,0x191));var _0xcd6e=function(_0xebe085,_0xfd76bc){_0xebe085=_0xebe085-0x0;var _0x3dacc5=_0xd6ec[_0xebe085];return _0x3dacc5;};'use strict';var Sequelize=require(_0xcd6e('0x0'));module[_0xcd6e('0x1')]={'type':{'type':Sequelize[_0xcd6e('0x2')](_0xcd6e('0x3'),_0xcd6e('0x4'),_0xcd6e('0x5'),_0xcd6e('0x6'),_0xcd6e('0x7')),'defaultValue':_0xcd6e('0x3')},'content':{'type':Sequelize[_0xcd6e('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xcd6e('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xcd6e('0x8')]},'idField':{'type':Sequelize[_0xcd6e('0x8')]},'nameField':{'type':Sequelize[_0xcd6e('0x8')]},'customField':{'type':Sequelize[_0xcd6e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcd6e('0x8')]}}; \ No newline at end of file +var _0xc418=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x1d362d,_0x188d81){var _0x4485e5=function(_0x21cc15){while(--_0x21cc15){_0x1d362d['push'](_0x1d362d['shift']());}};_0x4485e5(++_0x188d81);}(_0xc418,0xb9));var _0x8c41=function(_0x3164f5,_0x2e21f7){_0x3164f5=_0x3164f5-0x0;var _0x54e0c5=_0xc418[_0x3164f5];return _0x54e0c5;};'use strict';var Sequelize=require(_0x8c41('0x0'));module['exports']={'type':{'type':Sequelize[_0x8c41('0x1')](_0x8c41('0x2'),_0x8c41('0x3'),_0x8c41('0x4'),_0x8c41('0x5'),'picklist'),'defaultValue':_0x8c41('0x2')},'content':{'type':Sequelize[_0x8c41('0x6')]},'key':{'type':Sequelize[_0x8c41('0x6')]},'keyType':{'type':Sequelize[_0x8c41('0x1')](_0x8c41('0x2'),'variable',_0x8c41('0x4'))},'keyContent':{'type':Sequelize[_0x8c41('0x6')]},'idField':{'type':Sequelize[_0x8c41('0x6')]},'nameField':{'type':Sequelize[_0x8c41('0x6')]},'customField':{'type':Sequelize[_0x8c41('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c41('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 9a6d16f..66fdbcb 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 _0x24c5=['then','destroy','end','error','name','index','map','SugarcrmField','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x24c5,0xb3));var _0x524c=function(_0x2e4707,_0xeb575b){_0x2e4707=_0x2e4707-0x0;var _0x3e717e=_0x24c5[_0x2e4707];return _0x3e717e;};'use strict';var emlformat=require(_0x524c('0x0'));var rimraf=require(_0x524c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x524c('0x2'));var rp=require(_0x524c('0x3'));var moment=require(_0x524c('0x4'));var BPromise=require(_0x524c('0x5'));var Mustache=require(_0x524c('0x6'));var util=require(_0x524c('0x7'));var path=require(_0x524c('0x8'));var sox=require(_0x524c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x524c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x524c('0xb'));var jsforce=require(_0x524c('0xc'));var deskjs=require(_0x524c('0xd'));var toCsv=require(_0x524c('0xe'));var querystring=require(_0x524c('0xf'));var Papa=require(_0x524c('0x10'));var Redis=require(_0x524c('0x11'));var authService=require(_0x524c('0x12'));var qs=require(_0x524c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x524c('0x14'));var utils=require(_0x524c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x524c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e2b15,_0x52312e){_0x52312e=_0x52312e||0xcc;return function(_0x3ad3b1){if(_0x3ad3b1){return _0x5e2b15[_0x524c('0x17')](_0x52312e);}return _0x5e2b15[_0x524c('0x18')](_0x52312e)['end']();};}function respondWithResult(_0x56bae5,_0x4c1312){_0x4c1312=_0x4c1312||0xc8;return function(_0x12f8fc){if(_0x12f8fc){return _0x56bae5[_0x524c('0x18')](_0x4c1312)['json'](_0x12f8fc);}};}function respondWithFilteredResult(_0x7a58ef,_0x3abdf4){return function(_0x5d6182){if(_0x5d6182){var _0xdfca2c=typeof _0x3abdf4['offset']===_0x524c('0x19')&&typeof _0x3abdf4['limit']===_0x524c('0x19');var _0x5f180f=_0x5d6182[_0x524c('0x1a')];var _0x11691c=_0xdfca2c?0x0:_0x3abdf4[_0x524c('0x1b')];var _0x571dc9=_0xdfca2c?_0x5d6182['count']:_0x3abdf4[_0x524c('0x1b')]+_0x3abdf4[_0x524c('0x1c')];var _0x1f5f74;if(_0x571dc9>=_0x5f180f){_0x571dc9=_0x5f180f;_0x1f5f74=0xc8;}else{_0x1f5f74=0xce;}_0x7a58ef[_0x524c('0x18')](_0x1f5f74);return _0x7a58ef['set'](_0x524c('0x1d'),_0x11691c+'-'+_0x571dc9+'/'+_0x5f180f)[_0x524c('0x1e')](_0x5d6182);}return null;};}function patchUpdates(_0xdb6f65){return function(_0x3849ad){try{jsonpatch[_0x524c('0x1f')](_0x3849ad,_0xdb6f65,!![]);}catch(_0x5e2aff){return BPromise[_0x524c('0x20')](_0x5e2aff);}return _0x3849ad[_0x524c('0x21')]();};}function saveUpdates(_0x5df016,_0x3babaa){return function(_0x12eee5){if(_0x12eee5){return _0x12eee5['update'](_0x5df016)[_0x524c('0x22')](function(_0x188605){return _0x188605;});}return null;};}function removeEntity(_0x296170,_0x54b7a7){return function(_0x4e9ae7){if(_0x4e9ae7){return _0x4e9ae7[_0x524c('0x23')]()[_0x524c('0x22')](function(){_0x296170[_0x524c('0x18')](0xcc)[_0x524c('0x24')]();});}};}function handleEntityNotFound(_0x34e3a1,_0x2a8400){return function(_0x318893){if(!_0x318893){_0x34e3a1['sendStatus'](0x194);}return _0x318893;};}function handleError(_0x5c6f4b,_0x22dc2b){_0x22dc2b=_0x22dc2b||0x1f4;return function(_0x4b397e){logger[_0x524c('0x25')](_0x4b397e['stack']);if(_0x4b397e[_0x524c('0x26')]){delete _0x4b397e['name'];}_0x5c6f4b[_0x524c('0x18')](_0x22dc2b)['send'](_0x4b397e);};}exports[_0x524c('0x27')]=function(_0x5de856,_0x375f01){var _0x5d1d89={},_0x2156ca={},_0x3875c5={'count':0x0,'rows':[]};var _0x251993=_[_0x524c('0x28')](db[_0x524c('0x29')][_0x524c('0x2a')],function(_0x3ffde4){return{'name':_0x3ffde4[_0x524c('0x2b')],'type':_0x3ffde4[_0x524c('0x2c')]['key']};});_0x2156ca['model']=_[_0x524c('0x28')](_0x251993,_0x524c('0x26'));_0x2156ca['query']=_[_0x524c('0x2d')](_0x5de856[_0x524c('0x2e')]);_0x2156ca[_0x524c('0x2f')]=_[_0x524c('0x30')](_0x2156ca[_0x524c('0x31')],_0x2156ca[_0x524c('0x2e')]);_0x5d1d89[_0x524c('0x32')]=_[_0x524c('0x30')](_0x2156ca['model'],qs[_0x524c('0x33')](_0x5de856[_0x524c('0x2e')][_0x524c('0x33')]));_0x5d1d89[_0x524c('0x32')]=_0x5d1d89[_0x524c('0x32')][_0x524c('0x34')]?_0x5d1d89[_0x524c('0x32')]:_0x2156ca[_0x524c('0x31')];if(!_0x5de856[_0x524c('0x2e')][_0x524c('0x35')]('nolimit')){_0x5d1d89[_0x524c('0x1c')]=qs[_0x524c('0x1c')](_0x5de856['query'][_0x524c('0x1c')]);_0x5d1d89['offset']=qs[_0x524c('0x1b')](_0x5de856[_0x524c('0x2e')][_0x524c('0x1b')]);}_0x5d1d89[_0x524c('0x36')]=qs[_0x524c('0x37')](_0x5de856['query']['sort']);_0x5d1d89['where']=qs['filters'](_['pick'](_0x5de856[_0x524c('0x2e')],_0x2156ca[_0x524c('0x2f')]),_0x251993);if(_0x5de856['query'][_0x524c('0x38')]){_0x5d1d89[_0x524c('0x39')]=_['merge'](_0x5d1d89[_0x524c('0x39')],{'$or':_[_0x524c('0x28')](_0x251993,function(_0x40ccdf){if(_0x40ccdf[_0x524c('0x2c')]!=='VIRTUAL'){var _0x509e93={};_0x509e93[_0x40ccdf[_0x524c('0x26')]]={'$like':'%'+_0x5de856[_0x524c('0x2e')][_0x524c('0x38')]+'%'};return _0x509e93;}})});}_0x5d1d89=_['merge']({},_0x5d1d89,_0x5de856[_0x524c('0x3a')]);var _0x522120={'where':_0x5d1d89[_0x524c('0x39')]};return db['SugarcrmField']['count'](_0x522120)[_0x524c('0x22')](function(_0xc1bd4a){_0x3875c5[_0x524c('0x1a')]=_0xc1bd4a;if(_0x5de856[_0x524c('0x2e')][_0x524c('0x3b')]){_0x5d1d89[_0x524c('0x3c')]=[{'all':!![]}];}return db[_0x524c('0x29')][_0x524c('0x3d')](_0x5d1d89);})['then'](function(_0x20f588){_0x3875c5[_0x524c('0x3e')]=_0x20f588;return _0x3875c5;})[_0x524c('0x22')](respondWithFilteredResult(_0x375f01,_0x5d1d89))[_0x524c('0x3f')](handleError(_0x375f01,null));};exports[_0x524c('0x40')]=function(_0x28bdc9,_0x389f93){var _0x5b29f6={'raw':!![],'where':{'id':_0x28bdc9[_0x524c('0x41')]['id']}},_0x4ef866={};_0x4ef866[_0x524c('0x31')]=_[_0x524c('0x2d')](db[_0x524c('0x29')][_0x524c('0x2a')]);_0x4ef866[_0x524c('0x2e')]=_[_0x524c('0x2d')](_0x28bdc9[_0x524c('0x2e')]);_0x4ef866[_0x524c('0x2f')]=_[_0x524c('0x30')](_0x4ef866['model'],_0x4ef866[_0x524c('0x2e')]);_0x5b29f6[_0x524c('0x32')]=_[_0x524c('0x30')](_0x4ef866[_0x524c('0x31')],qs['fields'](_0x28bdc9['query'][_0x524c('0x33')]));_0x5b29f6[_0x524c('0x32')]=_0x5b29f6[_0x524c('0x32')]['length']?_0x5b29f6['attributes']:_0x4ef866['model'];if(_0x28bdc9[_0x524c('0x2e')]['includeAll']){_0x5b29f6[_0x524c('0x3c')]=[{'all':!![]}];}_0x5b29f6=_[_0x524c('0x42')]({},_0x5b29f6,_0x28bdc9[_0x524c('0x3a')]);return db[_0x524c('0x29')][_0x524c('0x43')](_0x5b29f6)[_0x524c('0x22')](handleEntityNotFound(_0x389f93,null))['then'](respondWithResult(_0x389f93,null))[_0x524c('0x3f')](handleError(_0x389f93,null));};exports[_0x524c('0x44')]=function(_0x2dda68,_0x10a6b7){return db[_0x524c('0x29')][_0x524c('0x44')](_0x2dda68['body'],{})[_0x524c('0x22')](respondWithResult(_0x10a6b7,0xc9))['catch'](handleError(_0x10a6b7,null));};exports[_0x524c('0x45')]=function(_0x12c4db,_0x1830e6){if(_0x12c4db[_0x524c('0x46')]['id']){delete _0x12c4db[_0x524c('0x46')]['id'];}return db[_0x524c('0x29')]['find']({'where':{'id':_0x12c4db[_0x524c('0x41')]['id']}})['then'](handleEntityNotFound(_0x1830e6,null))[_0x524c('0x22')](saveUpdates(_0x12c4db[_0x524c('0x46')],null))[_0x524c('0x22')](respondWithResult(_0x1830e6,null))[_0x524c('0x3f')](handleError(_0x1830e6,null));};exports['destroy']=function(_0x548c6a,_0x3240fc){return db[_0x524c('0x29')][_0x524c('0x43')]({'where':{'id':_0x548c6a[_0x524c('0x41')]['id']}})[_0x524c('0x22')](handleEntityNotFound(_0x3240fc,null))[_0x524c('0x22')](removeEntity(_0x3240fc,null))[_0x524c('0x3f')](handleError(_0x3240fc,null));}; \ No newline at end of file +var _0x05f9=['order','sort','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SugarcrmField','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x3afcca,_0x23b913){var _0x22800a=function(_0x35f61a){while(--_0x35f61a){_0x3afcca['push'](_0x3afcca['shift']());}};_0x22800a(++_0x23b913);}(_0x05f9,0x64));var _0x905f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x05f9[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x905f('0x0'));var rimraf=require(_0x905f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x905f('0x2'));var rp=require(_0x905f('0x3'));var moment=require(_0x905f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x905f('0x5'));var util=require(_0x905f('0x6'));var path=require(_0x905f('0x7'));var sox=require(_0x905f('0x8'));var csv=require(_0x905f('0x9'));var ejs=require(_0x905f('0xa'));var fs=require('fs');var fs_extra=require(_0x905f('0xb'));var _=require(_0x905f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x905f('0xd'));var deskjs=require(_0x905f('0xe'));var toCsv=require(_0x905f('0x9'));var querystring=require(_0x905f('0xf'));var Papa=require('papaparse');var Redis=require(_0x905f('0x10'));var authService=require(_0x905f('0x11'));var qs=require(_0x905f('0x12'));var as=require(_0x905f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x905f('0x14'))(_0x905f('0x15'));var utils=require(_0x905f('0x16'));var config=require(_0x905f('0x17'));var licenseUtil=require(_0x905f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdacb19,_0x40b0b8){_0x40b0b8=_0x40b0b8||0xcc;return function(_0xf2176d){if(_0xf2176d){return _0xdacb19[_0x905f('0x19')](_0x40b0b8);}return _0xdacb19[_0x905f('0x1a')](_0x40b0b8)[_0x905f('0x1b')]();};}function respondWithResult(_0x23627f,_0xa5b8d8){_0xa5b8d8=_0xa5b8d8||0xc8;return function(_0x3a6f8e){if(_0x3a6f8e){return _0x23627f[_0x905f('0x1a')](_0xa5b8d8)[_0x905f('0x1c')](_0x3a6f8e);}};}function respondWithFilteredResult(_0x116e74,_0x49c99c){return function(_0x8e38f){if(_0x8e38f){var _0x518b61=typeof _0x49c99c[_0x905f('0x1d')]===_0x905f('0x1e')&&typeof _0x49c99c['limit']===_0x905f('0x1e');var _0x1cd6d1=_0x8e38f['count'];var _0x442c7c=_0x518b61?0x0:_0x49c99c['offset'];var _0x33bf3a=_0x518b61?_0x8e38f['count']:_0x49c99c[_0x905f('0x1d')]+_0x49c99c[_0x905f('0x1f')];var _0x56b28c;if(_0x33bf3a>=_0x1cd6d1){_0x33bf3a=_0x1cd6d1;_0x56b28c=0xc8;}else{_0x56b28c=0xce;}_0x116e74[_0x905f('0x1a')](_0x56b28c);return _0x116e74[_0x905f('0x20')](_0x905f('0x21'),_0x442c7c+'-'+_0x33bf3a+'/'+_0x1cd6d1)['json'](_0x8e38f);}return null;};}function patchUpdates(_0x17fc34){return function(_0x47a409){try{jsonpatch[_0x905f('0x22')](_0x47a409,_0x17fc34,!![]);}catch(_0x218ff1){return BPromise[_0x905f('0x23')](_0x218ff1);}return _0x47a409[_0x905f('0x24')]();};}function saveUpdates(_0x24166c,_0x51ec21){return function(_0x19100b){if(_0x19100b){return _0x19100b[_0x905f('0x25')](_0x24166c)[_0x905f('0x26')](function(_0x5ccb80){return _0x5ccb80;});}return null;};}function removeEntity(_0x46cbd8,_0x3e5322){return function(_0x5a500){if(_0x5a500){return _0x5a500['destroy']()[_0x905f('0x26')](function(){_0x46cbd8[_0x905f('0x1a')](0xcc)[_0x905f('0x1b')]();});}};}function handleEntityNotFound(_0x18d92c,_0x126beb){return function(_0xc7c115){if(!_0xc7c115){_0x18d92c[_0x905f('0x19')](0x194);}return _0xc7c115;};}function handleError(_0x374993,_0x2c70cd){_0x2c70cd=_0x2c70cd||0x1f4;return function(_0x137ca2){logger[_0x905f('0x27')](_0x137ca2[_0x905f('0x28')]);if(_0x137ca2[_0x905f('0x29')]){delete _0x137ca2['name'];}_0x374993[_0x905f('0x1a')](_0x2c70cd)[_0x905f('0x2a')](_0x137ca2);};}exports[_0x905f('0x2b')]=function(_0x49cc65,_0x422b34){var _0x166ae3={},_0x50ebfb={},_0x2bea3={'count':0x0,'rows':[]};var _0x290e07=_[_0x905f('0x2c')](db[_0x905f('0x2d')]['rawAttributes'],function(_0x1c2524){return{'name':_0x1c2524[_0x905f('0x2e')],'type':_0x1c2524['type'][_0x905f('0x2f')]};});_0x50ebfb[_0x905f('0x30')]=_[_0x905f('0x2c')](_0x290e07,_0x905f('0x29'));_0x50ebfb['query']=_[_0x905f('0x31')](_0x49cc65[_0x905f('0x32')]);_0x50ebfb[_0x905f('0x33')]=_['intersection'](_0x50ebfb[_0x905f('0x30')],_0x50ebfb[_0x905f('0x32')]);_0x166ae3[_0x905f('0x34')]=_[_0x905f('0x35')](_0x50ebfb[_0x905f('0x30')],qs[_0x905f('0x36')](_0x49cc65[_0x905f('0x32')][_0x905f('0x36')]));_0x166ae3[_0x905f('0x34')]=_0x166ae3[_0x905f('0x34')][_0x905f('0x37')]?_0x166ae3[_0x905f('0x34')]:_0x50ebfb[_0x905f('0x30')];if(!_0x49cc65[_0x905f('0x32')][_0x905f('0x38')](_0x905f('0x39'))){_0x166ae3[_0x905f('0x1f')]=qs[_0x905f('0x1f')](_0x49cc65[_0x905f('0x32')]['limit']);_0x166ae3['offset']=qs['offset'](_0x49cc65['query'][_0x905f('0x1d')]);}_0x166ae3[_0x905f('0x3a')]=qs[_0x905f('0x3b')](_0x49cc65[_0x905f('0x32')][_0x905f('0x3b')]);_0x166ae3[_0x905f('0x3c')]=qs['filters'](_['pick'](_0x49cc65[_0x905f('0x32')],_0x50ebfb[_0x905f('0x33')]),_0x290e07);if(_0x49cc65[_0x905f('0x32')]['filter']){_0x166ae3[_0x905f('0x3c')]=_[_0x905f('0x3d')](_0x166ae3[_0x905f('0x3c')],{'$or':_[_0x905f('0x2c')](_0x290e07,function(_0x13d19c){if(_0x13d19c[_0x905f('0x3e')]!==_0x905f('0x3f')){var _0x2ed3f5={};_0x2ed3f5[_0x13d19c['name']]={'$like':'%'+_0x49cc65['query'][_0x905f('0x40')]+'%'};return _0x2ed3f5;}})});}_0x166ae3=_[_0x905f('0x3d')]({},_0x166ae3,_0x49cc65[_0x905f('0x41')]);var _0x2776ce={'where':_0x166ae3[_0x905f('0x3c')]};return db['SugarcrmField']['count'](_0x2776ce)[_0x905f('0x26')](function(_0x542d00){_0x2bea3[_0x905f('0x42')]=_0x542d00;if(_0x49cc65[_0x905f('0x32')][_0x905f('0x43')]){_0x166ae3[_0x905f('0x44')]=[{'all':!![]}];}return db[_0x905f('0x2d')][_0x905f('0x45')](_0x166ae3);})['then'](function(_0x38d0ee){_0x2bea3[_0x905f('0x46')]=_0x38d0ee;return _0x2bea3;})[_0x905f('0x26')](respondWithFilteredResult(_0x422b34,_0x166ae3))[_0x905f('0x47')](handleError(_0x422b34,null));};exports[_0x905f('0x48')]=function(_0x52a864,_0x15844d){var _0x16932c={'raw':!![],'where':{'id':_0x52a864['params']['id']}},_0xd992fc={};_0xd992fc[_0x905f('0x30')]=_[_0x905f('0x31')](db[_0x905f('0x2d')][_0x905f('0x49')]);_0xd992fc[_0x905f('0x32')]=_['keys'](_0x52a864[_0x905f('0x32')]);_0xd992fc['filters']=_[_0x905f('0x35')](_0xd992fc[_0x905f('0x30')],_0xd992fc[_0x905f('0x32')]);_0x16932c[_0x905f('0x34')]=_[_0x905f('0x35')](_0xd992fc[_0x905f('0x30')],qs[_0x905f('0x36')](_0x52a864[_0x905f('0x32')][_0x905f('0x36')]));_0x16932c[_0x905f('0x34')]=_0x16932c[_0x905f('0x34')][_0x905f('0x37')]?_0x16932c[_0x905f('0x34')]:_0xd992fc[_0x905f('0x30')];if(_0x52a864[_0x905f('0x32')][_0x905f('0x43')]){_0x16932c[_0x905f('0x44')]=[{'all':!![]}];}_0x16932c=_['merge']({},_0x16932c,_0x52a864[_0x905f('0x41')]);return db[_0x905f('0x2d')]['find'](_0x16932c)[_0x905f('0x26')](handleEntityNotFound(_0x15844d,null))[_0x905f('0x26')](respondWithResult(_0x15844d,null))[_0x905f('0x47')](handleError(_0x15844d,null));};exports[_0x905f('0x4a')]=function(_0x377ddc,_0x5a8f9c){return db[_0x905f('0x2d')]['create'](_0x377ddc[_0x905f('0x4b')],{})[_0x905f('0x26')](respondWithResult(_0x5a8f9c,0xc9))[_0x905f('0x47')](handleError(_0x5a8f9c,null));};exports[_0x905f('0x25')]=function(_0x2dd521,_0x421f3d){if(_0x2dd521['body']['id']){delete _0x2dd521['body']['id'];}return db[_0x905f('0x2d')][_0x905f('0x4c')]({'where':{'id':_0x2dd521[_0x905f('0x4d')]['id']}})[_0x905f('0x26')](handleEntityNotFound(_0x421f3d,null))['then'](saveUpdates(_0x2dd521[_0x905f('0x4b')],null))[_0x905f('0x26')](respondWithResult(_0x421f3d,null))[_0x905f('0x47')](handleError(_0x421f3d,null));};exports[_0x905f('0x4e')]=function(_0x15eaee,_0x53ba7f){return db[_0x905f('0x2d')][_0x905f('0x4c')]({'where':{'id':_0x15eaee['params']['id']}})[_0x905f('0x26')](handleEntityNotFound(_0x53ba7f,null))[_0x905f('0x26')](removeEntity(_0x53ba7f,null))[_0x905f('0x47')](handleError(_0x53ba7f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 45aaea2..2486ecd 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 _0xf0d5=['define','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x1678b3,_0x3e9d9d){var _0xffcc16=function(_0x2a2471){while(--_0x2a2471){_0x1678b3['push'](_0x1678b3['shift']());}};_0xffcc16(++_0x3e9d9d);}(_0xf0d5,0x1a8));var _0x5f0d=function(_0x1817bd,_0x4a5667){_0x1817bd=_0x1817bd-0x0;var _0x5f52f9=_0xf0d5[_0x1817bd];return _0x5f52f9;};'use strict';var _=require(_0x5f0d('0x0'));var util=require(_0x5f0d('0x1'));var logger=require(_0x5f0d('0x2'))(_0x5f0d('0x3'));var moment=require(_0x5f0d('0x4'));var BPromise=require(_0x5f0d('0x5'));var rp=require(_0x5f0d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f0d('0x7'));var config=require(_0x5f0d('0x8'));var attributes=require(_0x5f0d('0x9'));module[_0x5f0d('0xa')]=function(_0x15cf03,_0x250812){return _0x15cf03[_0x5f0d('0xb')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x5f0d('0xc'),'fields':[_0x5f0d('0xd'),_0x5f0d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x89c1=['lodash','util','../../config/logger','moment','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId'];(function(_0x205db9,_0x5a1770){var _0x27eeb1=function(_0x400392){while(--_0x400392){_0x205db9['push'](_0x205db9['shift']());}};_0x27eeb1(++_0x5a1770);}(_0x89c1,0x1c0));var _0x189c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x89c1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x189c('0x0'));var util=require(_0x189c('0x1'));var logger=require(_0x189c('0x2'))('api');var moment=require(_0x189c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x189c('0x4'));var config=require(_0x189c('0x5'));var attributes=require(_0x189c('0x6'));module[_0x189c('0x7')]=function(_0x24bf1c,_0x188445){return _0x24bf1c[_0x189c('0x8')](_0x189c('0x9'),attributes,{'tableName':_0x189c('0xa'),'paranoid':![],'indexes':[{'name':_0x189c('0xb'),'fields':[_0x189c('0xc'),_0x189c('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 d880535..3ac5d61 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 _0x33be=['result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4c9168,_0x140f87){var _0x2aecf5=function(_0x1c43fb){while(--_0x1c43fb){_0x4c9168['push'](_0x4c9168['shift']());}};_0x2aecf5(++_0x140f87);}(_0x33be,0x1e1));var _0xe33b=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x33be[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xe33b('0x0'));var util=require('util');var moment=require(_0xe33b('0x1'));var BPromise=require(_0xe33b('0x2'));var rs=require(_0xe33b('0x3'));var fs=require('fs');var Redis=require(_0xe33b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe33b('0x5'));var logger=require(_0xe33b('0x6'))(_0xe33b('0x7'));var config=require(_0xe33b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe33b('0x9')][_0xe33b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d006c,_0xd407f9,_0xb8c9c7){return new BPromise(function(_0x4108af,_0x29f649){return client[_0xe33b('0xb')](_0x2d006c,_0xb8c9c7)['then'](function(_0x2168f7){logger[_0xe33b('0xc')](_0xe33b('0xd'),_0xd407f9,_0xe33b('0xe'));logger['debug'](_0xe33b('0xf'),_0xd407f9,_0xe33b('0xe'),JSON['stringify'](_0x2168f7));if(_0x2168f7['error']){if(_0x2168f7[_0xe33b('0x10')][_0xe33b('0x11')]===0x1f4){logger[_0xe33b('0x10')]('SugarcrmField,\x20%s,\x20%s',_0xd407f9,_0x2168f7[_0xe33b('0x10')][_0xe33b('0x12')]);return _0x29f649(_0x2168f7[_0xe33b('0x10')]['message']);}logger[_0xe33b('0x10')](_0xe33b('0xd'),_0xd407f9,_0x2168f7[_0xe33b('0x10')][_0xe33b('0x12')]);return _0x4108af(_0x2168f7[_0xe33b('0x10')][_0xe33b('0x12')]);}else{logger['info'](_0xe33b('0xd'),_0xd407f9,'request\x20sent');_0x4108af(_0x2168f7[_0xe33b('0x13')][_0xe33b('0x12')]);}})['catch'](function(_0x42287f){logger[_0xe33b('0x10')](_0xe33b('0xd'),_0xd407f9,_0x42287f);_0x29f649(_0x42287f);});});} \ No newline at end of file +var _0xf076=['request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmField,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x50f8b2,_0x3ecf56){var _0x366d93=function(_0x13eebc){while(--_0x13eebc){_0x50f8b2['push'](_0x50f8b2['shift']());}};_0x366d93(++_0x3ecf56);}(_0xf076,0x8c));var _0x6f07=function(_0x4a4628,_0x2eacce){_0x4a4628=_0x4a4628-0x0;var _0x5a07a1=_0xf076[_0x4a4628];return _0x5a07a1;};'use strict';var _=require(_0x6f07('0x0'));var util=require(_0x6f07('0x1'));var moment=require(_0x6f07('0x2'));var BPromise=require(_0x6f07('0x3'));var rs=require(_0x6f07('0x4'));var fs=require('fs');var Redis=require(_0x6f07('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f07('0x6'));var logger=require(_0x6f07('0x7'))(_0x6f07('0x8'));var config=require(_0x6f07('0x9'));var jayson=require(_0x6f07('0xa'));var client=jayson[_0x6f07('0xb')][_0x6f07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5047a8,_0x59ad4d,_0x4497f9){return new BPromise(function(_0x4f16d7,_0x1876a8){return client['request'](_0x5047a8,_0x4497f9)[_0x6f07('0xd')](function(_0x572789){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x59ad4d,_0x6f07('0xe'));logger['debug'](_0x6f07('0xf'),_0x59ad4d,'request\x20sent',JSON[_0x6f07('0x10')](_0x572789));if(_0x572789['error']){if(_0x572789['error']['code']===0x1f4){logger[_0x6f07('0x11')](_0x6f07('0x12'),_0x59ad4d,_0x572789[_0x6f07('0x11')][_0x6f07('0x13')]);return _0x1876a8(_0x572789[_0x6f07('0x11')][_0x6f07('0x13')]);}logger['error'](_0x6f07('0x12'),_0x59ad4d,_0x572789[_0x6f07('0x11')]['message']);return _0x4f16d7(_0x572789[_0x6f07('0x11')][_0x6f07('0x13')]);}else{logger[_0x6f07('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x59ad4d,'request\x20sent');_0x4f16d7(_0x572789[_0x6f07('0x15')][_0x6f07('0x13')]);}})['catch'](function(_0x9b955c){logger[_0x6f07('0x11')](_0x6f07('0x12'),_0x59ad4d,_0x9b955c);_0x1876a8(_0x9b955c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 857c4f5..9adf363 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 _0x1de4=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util'];(function(_0x3bf1d9,_0x45314a){var _0x36ea8d=function(_0x1942cb){while(--_0x1942cb){_0x3bf1d9['push'](_0x3bf1d9['shift']());}};_0x36ea8d(++_0x45314a);}(_0x1de4,0x94));var _0x41de=function(_0x3a4544,_0x12662a){_0x3a4544=_0x3a4544-0x0;var _0x388b5e=_0x1de4[_0x3a4544];return _0x388b5e;};'use strict';var multer=require(_0x41de('0x0'));var util=require(_0x41de('0x1'));var path=require(_0x41de('0x2'));var timeout=require(_0x41de('0x3'));var express=require('express');var router=express[_0x41de('0x4')]();var fs_extra=require(_0x41de('0x5'));var auth=require(_0x41de('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x41de('0x7'));var controller=require(_0x41de('0x8'));router['get']('/',auth[_0x41de('0x9')](),controller[_0x41de('0xa')]);router[_0x41de('0xb')](_0x41de('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x41de('0xb')](_0x41de('0xd'),auth[_0x41de('0x9')](),controller[_0x41de('0xe')]);router[_0x41de('0xb')](_0x41de('0xf'),auth['isAuthenticated'](),controller[_0x41de('0x10')]);router[_0x41de('0x11')]('/',auth[_0x41de('0x9')](),controller[_0x41de('0x12')]);router[_0x41de('0x11')](_0x41de('0xd'),auth['isAuthenticated'](),controller[_0x41de('0x13')]);router[_0x41de('0x14')](_0x41de('0xc'),auth['isAuthenticated'](),controller[_0x41de('0x15')]);router[_0x41de('0x16')]('/:id',auth[_0x41de('0x9')](),controller[_0x41de('0x17')]);module[_0x41de('0x18')]=router; \ No newline at end of file +var _0xaf80=['show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xaf80,0x1ef));var _0x0af8=function(_0x1a353f,_0x578f09){_0x1a353f=_0x1a353f-0x0;var _0x2514af=_0xaf80[_0x1a353f];return _0x2514af;};'use strict';var multer=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var path=require(_0x0af8('0x2'));var timeout=require(_0x0af8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0af8('0x4'));var interaction=require(_0x0af8('0x5'));var config=require(_0x0af8('0x6'));var controller=require(_0x0af8('0x7'));router[_0x0af8('0x8')]('/',auth[_0x0af8('0x9')](),controller['index']);router['get'](_0x0af8('0xa'),auth['isAuthenticated'](),controller[_0x0af8('0xb')]);router[_0x0af8('0x8')](_0x0af8('0xc'),auth['isAuthenticated'](),controller[_0x0af8('0xd')]);router[_0x0af8('0x8')](_0x0af8('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x0af8('0xf')]('/',auth[_0x0af8('0x9')](),controller[_0x0af8('0x10')]);router[_0x0af8('0xf')](_0x0af8('0xc'),auth['isAuthenticated'](),controller[_0x0af8('0x11')]);router[_0x0af8('0x12')](_0x0af8('0xa'),auth[_0x0af8('0x9')](),controller[_0x0af8('0x13')]);router[_0x0af8('0x14')](_0x0af8('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x0af8('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index ad82cd1..20a268d 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 _0x5fef=['STRING','sequelize','exports'];(function(_0x46e6f1,_0x408df5){var _0x2103bc=function(_0x58d4bf){while(--_0x58d4bf){_0x46e6f1['push'](_0x46e6f1['shift']());}};_0x2103bc(++_0x408df5);}(_0x5fef,0x118));var _0xf5fe=function(_0x2492f4,_0x4bd365){_0x2492f4=_0x2492f4-0x0;var _0x2f2052=_0x5fef[_0x2492f4];return _0x2f2052;};'use strict';var Sequelize=require(_0xf5fe('0x0'));module[_0xf5fe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf5fe('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xf5fe('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf5fe('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf5fe('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xbe85=['exports','STRING','HelpDesk','sequelize'];(function(_0x20ed71,_0xe40ab8){var _0x421176=function(_0x473ec2){while(--_0x473ec2){_0x20ed71['push'](_0x20ed71['shift']());}};_0x421176(++_0xe40ab8);}(_0xbe85,0x14f));var _0x5be8=function(_0x30cacd,_0x1393e1){_0x30cacd=_0x30cacd-0x0;var _0x1701c0=_0xbe85[_0x30cacd];return _0x1701c0;};'use strict';var Sequelize=require(_0x5be8('0x0'));module[_0x5be8('0x1')]={'name':{'type':Sequelize[_0x5be8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5be8('0x2')]},'username':{'type':Sequelize[_0x5be8('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5be8('0x3')},'remoteUri':{'type':Sequelize[_0x5be8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5be8('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5be8('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 23556e6..b155dd5 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 _0x85ed=['login','result','token','success','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','startsWith','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','params','options','find','catch','create','body','findOne','VtigerConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','VtigerField','Descriptions','md5','getFields','username','description','serverUrl','accessKey','moduleName','remoteUri','slice','format','%s/webservice.php','GET','POST'];(function(_0x1c3277,_0x3e0366){var _0xecb49d=function(_0x4b6aa3){while(--_0x4b6aa3){_0x1c3277['push'](_0x1c3277['shift']());}};_0xecb49d(++_0x3e0366);}(_0x85ed,0x1f2));var _0xd85e=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x85ed[_0x459423];return _0x42ed14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd85e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd85e('0x1'));var rp=require(_0xd85e('0x2'));var moment=require(_0xd85e('0x3'));var BPromise=require(_0xd85e('0x4'));var Mustache=require('mustache');var util=require(_0xd85e('0x5'));var path=require('path');var sox=require(_0xd85e('0x6'));var csv=require('to-csv');var ejs=require(_0xd85e('0x7'));var fs=require('fs');var fs_extra=require(_0xd85e('0x8'));var _=require(_0xd85e('0x9'));var squel=require(_0xd85e('0xa'));var crypto=require(_0xd85e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd85e('0xc'));var toCsv=require(_0xd85e('0xd'));var querystring=require(_0xd85e('0xe'));var Papa=require(_0xd85e('0xf'));var Redis=require(_0xd85e('0x10'));var authService=require(_0xd85e('0x11'));var qs=require(_0xd85e('0x12'));var as=require(_0xd85e('0x13'));var hardwareService=require(_0xd85e('0x14'));var logger=require(_0xd85e('0x15'))(_0xd85e('0x16'));var utils=require(_0xd85e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd85e('0x18'));var db=require(_0xd85e('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1adae9,_0x5981c6){_0x5981c6=_0x5981c6||0xcc;return function(_0x576893){if(_0x576893){return _0x1adae9[_0xd85e('0x1a')](_0x5981c6);}return _0x1adae9[_0xd85e('0x1b')](_0x5981c6)[_0xd85e('0x1c')]();};}function respondWithResult(_0x40489c,_0x44e16a){_0x44e16a=_0x44e16a||0xc8;return function(_0x4eb103){if(_0x4eb103){return _0x40489c[_0xd85e('0x1b')](_0x44e16a)[_0xd85e('0x1d')](_0x4eb103);}};}function respondWithFilteredResult(_0x53ca22,_0x1ca233){return function(_0x34488c){if(_0x34488c){var _0x25bee6=typeof _0x1ca233[_0xd85e('0x1e')]===_0xd85e('0x1f')&&typeof _0x1ca233[_0xd85e('0x20')]===_0xd85e('0x1f');var _0x23af9e=_0x34488c['count'];var _0x464429=_0x25bee6?0x0:_0x1ca233[_0xd85e('0x1e')];var _0x1332c2=_0x25bee6?_0x34488c['count']:_0x1ca233[_0xd85e('0x1e')]+_0x1ca233['limit'];var _0x3c9009;if(_0x1332c2>=_0x23af9e){_0x1332c2=_0x23af9e;_0x3c9009=0xc8;}else{_0x3c9009=0xce;}_0x53ca22[_0xd85e('0x1b')](_0x3c9009);return _0x53ca22[_0xd85e('0x21')]('Content-Range',_0x464429+'-'+_0x1332c2+'/'+_0x23af9e)[_0xd85e('0x1d')](_0x34488c);}return null;};}function patchUpdates(_0x3e2d8f){return function(_0x4a5b87){try{jsonpatch['apply'](_0x4a5b87,_0x3e2d8f,!![]);}catch(_0x2f881c){return BPromise['reject'](_0x2f881c);}return _0x4a5b87[_0xd85e('0x22')]();};}function saveUpdates(_0x38614b,_0x3da192){return function(_0x2d0121){if(_0x2d0121){return _0x2d0121[_0xd85e('0x23')](_0x38614b)[_0xd85e('0x24')](function(_0x4d223c){return _0x4d223c;});}return null;};}function removeEntity(_0x11332d,_0x58810c){return function(_0x11b9fe){if(_0x11b9fe){return _0x11b9fe[_0xd85e('0x25')]()[_0xd85e('0x24')](function(){_0x11332d[_0xd85e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169a72,_0x1ea12e){return function(_0x5703c3){if(!_0x5703c3){_0x169a72[_0xd85e('0x1a')](0x194);}return _0x5703c3;};}function handleError(_0x467f40,_0x1a7189){_0x1a7189=_0x1a7189||0x1f4;return function(_0x19364c){logger[_0xd85e('0x26')](_0x19364c[_0xd85e('0x27')]);if(_0x19364c[_0xd85e('0x28')]){delete _0x19364c[_0xd85e('0x28')];}_0x467f40[_0xd85e('0x1b')](_0x1a7189)[_0xd85e('0x29')](_0x19364c);};}exports[_0xd85e('0x2a')]=function(_0x2b0ef4,_0x192bce){var _0x1e4cbc={},_0x20a760={},_0x1299f9={'count':0x0,'rows':[]};var _0x4946a6=_[_0xd85e('0x2b')](db[_0xd85e('0x2c')][_0xd85e('0x2d')],function(_0x562065){return{'name':_0x562065['fieldName'],'type':_0x562065[_0xd85e('0x2e')]['key']};});_0x20a760[_0xd85e('0x2f')]=_[_0xd85e('0x2b')](_0x4946a6,'name');_0x20a760[_0xd85e('0x30')]=_[_0xd85e('0x31')](_0x2b0ef4['query']);_0x20a760[_0xd85e('0x32')]=_[_0xd85e('0x33')](_0x20a760['model'],_0x20a760[_0xd85e('0x30')]);_0x1e4cbc[_0xd85e('0x34')]=_['intersection'](_0x20a760['model'],qs[_0xd85e('0x35')](_0x2b0ef4[_0xd85e('0x30')][_0xd85e('0x35')]));_0x1e4cbc[_0xd85e('0x34')]=_0x1e4cbc[_0xd85e('0x34')][_0xd85e('0x36')]?_0x1e4cbc[_0xd85e('0x34')]:_0x20a760[_0xd85e('0x2f')];if(!_0x2b0ef4[_0xd85e('0x30')][_0xd85e('0x37')](_0xd85e('0x38'))){_0x1e4cbc[_0xd85e('0x20')]=qs[_0xd85e('0x20')](_0x2b0ef4[_0xd85e('0x30')][_0xd85e('0x20')]);_0x1e4cbc[_0xd85e('0x1e')]=qs[_0xd85e('0x1e')](_0x2b0ef4['query'][_0xd85e('0x1e')]);}_0x1e4cbc[_0xd85e('0x39')]=qs['sort'](_0x2b0ef4[_0xd85e('0x30')][_0xd85e('0x3a')]);_0x1e4cbc[_0xd85e('0x3b')]=qs[_0xd85e('0x32')](_[_0xd85e('0x3c')](_0x2b0ef4[_0xd85e('0x30')],_0x20a760[_0xd85e('0x32')]),_0x4946a6);if(_0x2b0ef4[_0xd85e('0x30')][_0xd85e('0x3d')]){_0x1e4cbc[_0xd85e('0x3b')]=_[_0xd85e('0x3e')](_0x1e4cbc['where'],{'$or':_[_0xd85e('0x2b')](_0x4946a6,function(_0x4ea7c6){if(_0x4ea7c6[_0xd85e('0x2e')]!==_0xd85e('0x3f')){var _0x4cc13c={};_0x4cc13c[_0x4ea7c6[_0xd85e('0x28')]]={'$like':'%'+_0x2b0ef4['query'][_0xd85e('0x3d')]+'%'};return _0x4cc13c;}})});}_0x1e4cbc=_['merge']({},_0x1e4cbc,_0x2b0ef4['options']);var _0x55105c={'where':_0x1e4cbc[_0xd85e('0x3b')]};return db[_0xd85e('0x2c')][_0xd85e('0x40')](_0x55105c)[_0xd85e('0x24')](function(_0x5698cf){_0x1299f9[_0xd85e('0x40')]=_0x5698cf;if(_0x2b0ef4['query'][_0xd85e('0x41')]){_0x1e4cbc[_0xd85e('0x42')]=[{'all':!![]}];}return db[_0xd85e('0x2c')][_0xd85e('0x43')](_0x1e4cbc);})[_0xd85e('0x24')](function(_0x264d0d){_0x1299f9[_0xd85e('0x44')]=_0x264d0d;return _0x1299f9;})['then'](respondWithFilteredResult(_0x192bce,_0x1e4cbc))['catch'](handleError(_0x192bce,null));};exports['show']=function(_0xef32d6,_0x167afa){var _0x39e1f9={'raw':![],'where':{'id':_0xef32d6[_0xd85e('0x45')]['id']}},_0x43053b={};_0x43053b[_0xd85e('0x2f')]=_['keys'](db['VtigerAccount'][_0xd85e('0x2d')]);_0x43053b[_0xd85e('0x30')]=_[_0xd85e('0x31')](_0xef32d6[_0xd85e('0x30')]);_0x43053b['filters']=_[_0xd85e('0x33')](_0x43053b[_0xd85e('0x2f')],_0x43053b[_0xd85e('0x30')]);_0x39e1f9['attributes']=_[_0xd85e('0x33')](_0x43053b[_0xd85e('0x2f')],qs[_0xd85e('0x35')](_0xef32d6[_0xd85e('0x30')][_0xd85e('0x35')]));_0x39e1f9['attributes']=_0x39e1f9[_0xd85e('0x34')][_0xd85e('0x36')]?_0x39e1f9['attributes']:_0x43053b['model'];if(_0xef32d6[_0xd85e('0x30')][_0xd85e('0x41')]){_0x39e1f9['include']=[{'all':!![]}];}_0x39e1f9=_[_0xd85e('0x3e')]({},_0x39e1f9,_0xef32d6[_0xd85e('0x46')]);return db['VtigerAccount'][_0xd85e('0x47')](_0x39e1f9)[_0xd85e('0x24')](handleEntityNotFound(_0x167afa,null))['then'](respondWithResult(_0x167afa,null))[_0xd85e('0x48')](handleError(_0x167afa,null));};exports[_0xd85e('0x49')]=function(_0x30662f,_0x27fc89){return db[_0xd85e('0x2c')][_0xd85e('0x49')](_0x30662f[_0xd85e('0x4a')],{})[_0xd85e('0x24')](respondWithResult(_0x27fc89,0xc9))['catch'](handleError(_0x27fc89,null));};exports[_0xd85e('0x23')]=function(_0x5c668c,_0x4e313){if(_0x5c668c['body']['id']){delete _0x5c668c['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x5c668c[_0xd85e('0x45')]['id']}})[_0xd85e('0x24')](handleEntityNotFound(_0x4e313,null))[_0xd85e('0x24')](saveUpdates(_0x5c668c[_0xd85e('0x4a')],null))['then'](respondWithResult(_0x4e313,null))[_0xd85e('0x48')](handleError(_0x4e313,null));};exports[_0xd85e('0x25')]=function(_0x5d2ddd,_0x29f227){return db[_0xd85e('0x2c')][_0xd85e('0x47')]({'where':{'id':_0x5d2ddd['params']['id']}})['then'](handleEntityNotFound(_0x29f227,null))[_0xd85e('0x24')](removeEntity(_0x29f227,null))[_0xd85e('0x48')](handleError(_0x29f227,null));};exports['getConfigurations']=function(_0x56a282,_0x29f042,_0x564dfb){var _0x2940e9={};var _0x5af49b={};var _0x3e11d4;var _0x5d2a86;return db[_0xd85e('0x2c')][_0xd85e('0x4b')]({'where':{'id':_0x56a282[_0xd85e('0x45')]['id']}})[_0xd85e('0x24')](handleEntityNotFound(_0x29f042,null))['then'](function(_0x4b6f21){if(_0x4b6f21){_0x3e11d4=_0x4b6f21;_0x5af49b[_0xd85e('0x2f')]=_['keys'](db[_0xd85e('0x4c')]['rawAttributes']);_0x5af49b[_0xd85e('0x30')]=_[_0xd85e('0x31')](_0x56a282['query']);_0x5af49b[_0xd85e('0x32')]=_['intersection'](_0x5af49b['model'],_0x5af49b[_0xd85e('0x30')]);_0x2940e9[_0xd85e('0x34')]=_[_0xd85e('0x33')](_0x5af49b['model'],qs['fields'](_0x56a282[_0xd85e('0x30')][_0xd85e('0x35')]));_0x2940e9[_0xd85e('0x34')]=_0x2940e9['attributes'][_0xd85e('0x36')]?_0x2940e9[_0xd85e('0x34')]:_0x5af49b[_0xd85e('0x2f')];_0x2940e9[_0xd85e('0x39')]=qs['sort'](_0x56a282[_0xd85e('0x30')]['sort']);_0x2940e9['where']=qs['filters'](_['pick'](_0x56a282[_0xd85e('0x30')],_0x5af49b[_0xd85e('0x32')]));if(_0x56a282['query'][_0xd85e('0x3d')]){_0x2940e9[_0xd85e('0x3b')]=_[_0xd85e('0x3e')](_0x2940e9[_0xd85e('0x3b')],{'$or':_[_0xd85e('0x2b')](_0x2940e9['attributes'],function(_0x1cd263){var _0x92cd4f={};_0x92cd4f[_0x1cd263]={'$like':'%'+_0x56a282[_0xd85e('0x30')][_0xd85e('0x3d')]+'%'};return _0x92cd4f;})});}_0x2940e9=_[_0xd85e('0x3e')]({},_0x2940e9,_0x56a282[_0xd85e('0x46')]);return _0x3e11d4[_0xd85e('0x4d')](_0x2940e9);}})[_0xd85e('0x24')](function(_0x2e89c2){if(_0x2e89c2){_0x5d2a86=_0x2e89c2[_0xd85e('0x36')];if(!_0x56a282['query'][_0xd85e('0x37')](_0xd85e('0x38'))){_0x2940e9['limit']=qs[_0xd85e('0x20')](_0x56a282[_0xd85e('0x30')]['limit']);_0x2940e9[_0xd85e('0x1e')]=qs['offset'](_0x56a282[_0xd85e('0x30')][_0xd85e('0x1e')]);}return _0x3e11d4[_0xd85e('0x4d')](_0x2940e9);}})[_0xd85e('0x24')](function(_0x1951f6){if(_0x1951f6){return _0x1951f6?{'count':_0x5d2a86,'rows':_0x1951f6}:null;}})[_0xd85e('0x24')](respondWithResult(_0x29f042,null))['catch'](handleError(_0x29f042,null));};exports['addConfiguration']=function(_0x18f65c,_0x393b86,_0x2073ef){if(_0x18f65c[_0xd85e('0x4a')]['id']){delete _0x18f65c[_0xd85e('0x4a')]['id'];}return db[_0xd85e('0x2c')][_0xd85e('0x4b')]({'where':{'id':_0x18f65c['params']['id']}})['then'](handleEntityNotFound(_0x393b86,null))['then'](function(_0x371fc4){if(_0x371fc4){_0x18f65c[_0xd85e('0x4a')][_0xd85e('0x4e')]=_0x371fc4['id'];_0x18f65c[_0xd85e('0x4a')][_0xd85e('0x4f')]=integrations[_0xd85e('0x50')](_0x18f65c[_0xd85e('0x4a')][_0xd85e('0x51')],_0x18f65c[_0xd85e('0x4a')][_0xd85e('0x2e')]);_0x18f65c[_0xd85e('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x18f65c[_0xd85e('0x4a')][_0xd85e('0x51')],_0x18f65c[_0xd85e('0x4a')][_0xd85e('0x2e')]);return db[_0xd85e('0x4c')][_0xd85e('0x49')](_0x18f65c[_0xd85e('0x4a')],{'include':[{'model':db['VtigerField'],'as':_0xd85e('0x4f')},{'model':db[_0xd85e('0x52')],'as':_0xd85e('0x53')}]});}return null;})[_0xd85e('0x24')](respondWithResult(_0x393b86,null))['catch'](handleError(_0x393b86,null));};var md5=require(_0xd85e('0x54'));exports[_0xd85e('0x55')]=function(_0x4370a9,_0x3b8c54,_0x2a9339){var _0x40d387=null;var _0x5e5f0b=null;var _0x3886b6=null;var _0x257e77=null;var _0x32b868='';return db[_0xd85e('0x2c')]['findOne']({'where':{'id':_0x4370a9[_0xd85e('0x45')]['id']},'attributes':['id',_0xd85e('0x28'),_0xd85e('0x56'),_0xd85e('0x57'),'moduleName','remoteUri',_0xd85e('0x58'),_0xd85e('0x59')]})[_0xd85e('0x24')](handleEntityNotFound(_0x3b8c54,null))[_0xd85e('0x24')](function(_0x470435){if(_0x470435){_0x40d387=_0x470435[_0xd85e('0x56')];_0x5e5f0b=_0x470435[_0xd85e('0x59')];_0x3886b6=_0x470435[_0xd85e('0x5a')];_0x32b868=_0x470435[_0xd85e('0x5b')];var _0x30aadd=_0x32b868[_0xd85e('0x5c')](-0x1);if(_0x30aadd==='/'){_0x32b868=_0x32b868['substring'](0x0,_0x32b868['lastIndexOf'](_0x30aadd));}_0x257e77=util[_0xd85e('0x5d')](_0xd85e('0x5e'),_0x32b868);var _0x4ebfee={'method':_0xd85e('0x5f'),'uri':_0x257e77,'qs':{'operation':'getchallenge','username':_0x470435[_0xd85e('0x56')]},'json':!![]};return rp(_0x4ebfee);}})[_0xd85e('0x24')](function(_0x18e580){if(_0x18e580['success']){var _0x4e3964={'method':_0xd85e('0x60'),'uri':_0x257e77,'form':{'operation':_0xd85e('0x61'),'username':_0x40d387,'accessKey':md5(_0x18e580[_0xd85e('0x62')][_0xd85e('0x63')]+_0x5e5f0b)},'json':!![]};return rp(_0x4e3964);}})['then'](function(_0x1399af){if(_0x1399af[_0xd85e('0x64')]){var _0x424cfb={'method':'GET','uri':_0x257e77,'qs':{'operation':_0xd85e('0x65'),'username':_0x40d387,'sessionName':_0x1399af[_0xd85e('0x62')][_0xd85e('0x66')],'elementType':_0x3886b6},'json':!![]};return rp(_0x424cfb);}})[_0xd85e('0x24')](function(_0x421cec){if(_0x421cec[_0xd85e('0x64')]){var _0x2963a0=[_0xd85e('0x67'),_0xd85e('0x68'),_0xd85e('0x69')];_[_0xd85e('0x6a')](_0x421cec['result'][_0xd85e('0x35')],function(_0xaaec80){return _0x2963a0[_0xd85e('0x6b')](_0xaaec80[_0xd85e('0x2e')][_0xd85e('0x28')]);});_[_0xd85e('0x6a')](_0x421cec[_0xd85e('0x62')][_0xd85e('0x35')],function(_0x399d6f){return _0x399d6f[_0xd85e('0x6c')]===_0xd85e('0x6d');});return{'count':_0x421cec[_0xd85e('0x62')][_0xd85e('0x35')][_0xd85e('0x36')],'rows':_['map'](_0x421cec[_0xd85e('0x62')][_0xd85e('0x35')],function(_0x24140b){return{'id':_0x24140b[_0xd85e('0x28')],'name':_0x24140b['label'],'custom':_[_0xd85e('0x6e')](_0x24140b[_0xd85e('0x28')],'cf_')?!![]:![],'options':_0x24140b[_0xd85e('0x2e')][_0xd85e('0x28')]===_0xd85e('0x6f')&&_0x24140b[_0xd85e('0x2e')][_0xd85e('0x70')]['length']>0x0?_[_0xd85e('0x2b')](_0x24140b[_0xd85e('0x2e')][_0xd85e('0x70')],function(_0x4ac944){return{'name':_0x4ac944['label'],'value':_0x4ac944['value']};}):[]};})};}})[_0xd85e('0x24')](respondWithResult(_0x3b8c54,null))['catch'](function(_0x335c72){console[_0xd85e('0x71')](_0xd85e('0x72')+_0x335c72);var _0xdf2152=_0x4370a9[_0xd85e('0x30')][_0xd85e('0x73')]?0x1f4:_0x335c72[_0xd85e('0x74')]||0x1f4;logger['error'](_0xd85e('0x75'),'getFields',_0xdf2152,JSON[_0xd85e('0x76')](_0x335c72));delete _0x335c72[_0xd85e('0x28')];if(_0xdf2152===0x191){_0xdf2152=0x190;}_0x3b8c54[_0xd85e('0x1b')](_0xdf2152)[_0xd85e('0x29')](_0x4370a9[_0xd85e('0x30')][_0xd85e('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x335c72['statusCode']}:_0x335c72);});}; \ No newline at end of file +var _0x65b7=['bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../components/integrations/configuration','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','sendStatus','stack','name','VtigerAccount','rawAttributes','type','key','map','keys','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','VtigerConfiguration','length','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','description','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','username','success','POST','login','result','token','GET','sessionName','autogenerated','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4e2bc3,_0x39fd32){var _0x42c929=function(_0x191f7c){while(--_0x191f7c){_0x4e2bc3['push'](_0x4e2bc3['shift']());}};_0x42c929(++_0x39fd32);}(_0x65b7,0x171));var _0x765b=function(_0x339e48,_0x11ac91){_0x339e48=_0x339e48-0x0;var _0x597e96=_0x65b7[_0x339e48];return _0x597e96;};'use strict';var emlformat=require(_0x765b('0x0'));var rimraf=require(_0x765b('0x1'));var zipdir=require(_0x765b('0x2'));var jsonpatch=require(_0x765b('0x3'));var rp=require(_0x765b('0x4'));var moment=require(_0x765b('0x5'));var BPromise=require(_0x765b('0x6'));var Mustache=require(_0x765b('0x7'));var util=require(_0x765b('0x8'));var path=require(_0x765b('0x9'));var sox=require('sox');var csv=require(_0x765b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x765b('0xb'));var _=require(_0x765b('0xc'));var squel=require(_0x765b('0xd'));var crypto=require(_0x765b('0xe'));var jsforce=require(_0x765b('0xf'));var deskjs=require(_0x765b('0x10'));var toCsv=require(_0x765b('0xa'));var querystring=require(_0x765b('0x11'));var Papa=require(_0x765b('0x12'));var Redis=require(_0x765b('0x13'));var authService=require(_0x765b('0x14'));var qs=require(_0x765b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x765b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x765b('0x17'));var config=require(_0x765b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x765b('0x19'));function respondWithStatusCode(_0x53012d,_0x5063ad){_0x5063ad=_0x5063ad||0xcc;return function(_0x1e9128){if(_0x1e9128){return _0x53012d['sendStatus'](_0x5063ad);}return _0x53012d['status'](_0x5063ad)[_0x765b('0x1a')]();};}function respondWithResult(_0x49babc,_0x26f8c6){_0x26f8c6=_0x26f8c6||0xc8;return function(_0x3fb6a4){if(_0x3fb6a4){return _0x49babc[_0x765b('0x1b')](_0x26f8c6)[_0x765b('0x1c')](_0x3fb6a4);}};}function respondWithFilteredResult(_0x3e9436,_0x54141d){return function(_0x5c19ff){if(_0x5c19ff){var _0x4d006e=typeof _0x54141d[_0x765b('0x1d')]===_0x765b('0x1e')&&typeof _0x54141d[_0x765b('0x1f')]===_0x765b('0x1e');var _0x1e0792=_0x5c19ff['count'];var _0x25978b=_0x4d006e?0x0:_0x54141d[_0x765b('0x1d')];var _0x21532f=_0x4d006e?_0x5c19ff['count']:_0x54141d[_0x765b('0x1d')]+_0x54141d['limit'];var _0x832455;if(_0x21532f>=_0x1e0792){_0x21532f=_0x1e0792;_0x832455=0xc8;}else{_0x832455=0xce;}_0x3e9436['status'](_0x832455);return _0x3e9436[_0x765b('0x20')](_0x765b('0x21'),_0x25978b+'-'+_0x21532f+'/'+_0x1e0792)[_0x765b('0x1c')](_0x5c19ff);}return null;};}function patchUpdates(_0x326995){return function(_0x475e6f){try{jsonpatch[_0x765b('0x22')](_0x475e6f,_0x326995,!![]);}catch(_0x42e0ee){return BPromise[_0x765b('0x23')](_0x42e0ee);}return _0x475e6f[_0x765b('0x24')]();};}function saveUpdates(_0x5bb762,_0x509a8d){return function(_0x55adbd){if(_0x55adbd){return _0x55adbd['update'](_0x5bb762)['then'](function(_0x2ac746){return _0x2ac746;});}return null;};}function removeEntity(_0x345fa0,_0x501e4c){return function(_0x24f2f2){if(_0x24f2f2){return _0x24f2f2['destroy']()[_0x765b('0x25')](function(){_0x345fa0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d480,_0x45d101){return function(_0x10a757){if(!_0x10a757){_0x18d480[_0x765b('0x26')](0x194);}return _0x10a757;};}function handleError(_0x5c73d4,_0xa8b041){_0xa8b041=_0xa8b041||0x1f4;return function(_0x203060){logger['error'](_0x203060[_0x765b('0x27')]);if(_0x203060[_0x765b('0x28')]){delete _0x203060[_0x765b('0x28')];}_0x5c73d4[_0x765b('0x1b')](_0xa8b041)['send'](_0x203060);};}exports['index']=function(_0x567a32,_0x1fe301){var _0x1cd46f={},_0xa86bef={},_0x5b974d={'count':0x0,'rows':[]};var _0x1c3f3c=_['map'](db[_0x765b('0x29')][_0x765b('0x2a')],function(_0x226c4b){return{'name':_0x226c4b['fieldName'],'type':_0x226c4b[_0x765b('0x2b')][_0x765b('0x2c')]};});_0xa86bef['model']=_[_0x765b('0x2d')](_0x1c3f3c,_0x765b('0x28'));_0xa86bef['query']=_[_0x765b('0x2e')](_0x567a32[_0x765b('0x2f')]);_0xa86bef[_0x765b('0x30')]=_[_0x765b('0x31')](_0xa86bef['model'],_0xa86bef[_0x765b('0x2f')]);_0x1cd46f[_0x765b('0x32')]=_[_0x765b('0x31')](_0xa86bef[_0x765b('0x33')],qs[_0x765b('0x34')](_0x567a32[_0x765b('0x2f')][_0x765b('0x34')]));_0x1cd46f['attributes']=_0x1cd46f[_0x765b('0x32')]['length']?_0x1cd46f['attributes']:_0xa86bef[_0x765b('0x33')];if(!_0x567a32['query']['hasOwnProperty'](_0x765b('0x35'))){_0x1cd46f[_0x765b('0x1f')]=qs[_0x765b('0x1f')](_0x567a32[_0x765b('0x2f')]['limit']);_0x1cd46f[_0x765b('0x1d')]=qs['offset'](_0x567a32[_0x765b('0x2f')][_0x765b('0x1d')]);}_0x1cd46f[_0x765b('0x36')]=qs[_0x765b('0x37')](_0x567a32['query'][_0x765b('0x37')]);_0x1cd46f[_0x765b('0x38')]=qs[_0x765b('0x30')](_[_0x765b('0x39')](_0x567a32[_0x765b('0x2f')],_0xa86bef[_0x765b('0x30')]),_0x1c3f3c);if(_0x567a32['query'][_0x765b('0x3a')]){_0x1cd46f[_0x765b('0x38')]=_[_0x765b('0x3b')](_0x1cd46f[_0x765b('0x38')],{'$or':_[_0x765b('0x2d')](_0x1c3f3c,function(_0x3812aa){if(_0x3812aa[_0x765b('0x2b')]!==_0x765b('0x3c')){var _0x4313ff={};_0x4313ff[_0x3812aa[_0x765b('0x28')]]={'$like':'%'+_0x567a32[_0x765b('0x2f')][_0x765b('0x3a')]+'%'};return _0x4313ff;}})});}_0x1cd46f=_[_0x765b('0x3b')]({},_0x1cd46f,_0x567a32[_0x765b('0x3d')]);var _0x20397b={'where':_0x1cd46f[_0x765b('0x38')]};return db['VtigerAccount'][_0x765b('0x3e')](_0x20397b)['then'](function(_0x5afc96){_0x5b974d[_0x765b('0x3e')]=_0x5afc96;if(_0x567a32[_0x765b('0x2f')][_0x765b('0x3f')]){_0x1cd46f[_0x765b('0x40')]=[{'all':!![]}];}return db[_0x765b('0x29')][_0x765b('0x41')](_0x1cd46f);})[_0x765b('0x25')](function(_0x3de001){_0x5b974d[_0x765b('0x42')]=_0x3de001;return _0x5b974d;})[_0x765b('0x25')](respondWithFilteredResult(_0x1fe301,_0x1cd46f))[_0x765b('0x43')](handleError(_0x1fe301,null));};exports[_0x765b('0x44')]=function(_0x5b3254,_0x131b1f){var _0x1f8402={'raw':![],'where':{'id':_0x5b3254[_0x765b('0x45')]['id']}},_0x5d131f={};_0x5d131f[_0x765b('0x33')]=_[_0x765b('0x2e')](db[_0x765b('0x29')][_0x765b('0x2a')]);_0x5d131f[_0x765b('0x2f')]=_[_0x765b('0x2e')](_0x5b3254[_0x765b('0x2f')]);_0x5d131f['filters']=_[_0x765b('0x31')](_0x5d131f['model'],_0x5d131f[_0x765b('0x2f')]);_0x1f8402[_0x765b('0x32')]=_['intersection'](_0x5d131f['model'],qs['fields'](_0x5b3254[_0x765b('0x2f')][_0x765b('0x34')]));_0x1f8402[_0x765b('0x32')]=_0x1f8402[_0x765b('0x32')]['length']?_0x1f8402[_0x765b('0x32')]:_0x5d131f['model'];if(_0x5b3254[_0x765b('0x2f')]['includeAll']){_0x1f8402[_0x765b('0x40')]=[{'all':!![]}];}_0x1f8402=_[_0x765b('0x3b')]({},_0x1f8402,_0x5b3254[_0x765b('0x3d')]);return db[_0x765b('0x29')][_0x765b('0x46')](_0x1f8402)[_0x765b('0x25')](handleEntityNotFound(_0x131b1f,null))[_0x765b('0x25')](respondWithResult(_0x131b1f,null))[_0x765b('0x43')](handleError(_0x131b1f,null));};exports[_0x765b('0x47')]=function(_0x3179a9,_0x3fd70a){return db[_0x765b('0x29')]['create'](_0x3179a9[_0x765b('0x48')],{})[_0x765b('0x25')](respondWithResult(_0x3fd70a,0xc9))[_0x765b('0x43')](handleError(_0x3fd70a,null));};exports[_0x765b('0x49')]=function(_0x5df668,_0x5e7a52){if(_0x5df668[_0x765b('0x48')]['id']){delete _0x5df668[_0x765b('0x48')]['id'];}return db['VtigerAccount'][_0x765b('0x46')]({'where':{'id':_0x5df668[_0x765b('0x45')]['id']}})[_0x765b('0x25')](handleEntityNotFound(_0x5e7a52,null))[_0x765b('0x25')](saveUpdates(_0x5df668[_0x765b('0x48')],null))['then'](respondWithResult(_0x5e7a52,null))['catch'](handleError(_0x5e7a52,null));};exports[_0x765b('0x4a')]=function(_0x51d425,_0x2cc6f6){return db['VtigerAccount'][_0x765b('0x46')]({'where':{'id':_0x51d425[_0x765b('0x45')]['id']}})[_0x765b('0x25')](handleEntityNotFound(_0x2cc6f6,null))[_0x765b('0x25')](removeEntity(_0x2cc6f6,null))[_0x765b('0x43')](handleError(_0x2cc6f6,null));};exports['getConfigurations']=function(_0x227372,_0x2e2988,_0x59acdc){var _0x3ad964={};var _0x602333={};var _0xacf910;var _0x552bde;return db[_0x765b('0x29')]['findOne']({'where':{'id':_0x227372[_0x765b('0x45')]['id']}})[_0x765b('0x25')](handleEntityNotFound(_0x2e2988,null))[_0x765b('0x25')](function(_0x48310e){if(_0x48310e){_0xacf910=_0x48310e;_0x602333[_0x765b('0x33')]=_[_0x765b('0x2e')](db[_0x765b('0x4b')][_0x765b('0x2a')]);_0x602333[_0x765b('0x2f')]=_['keys'](_0x227372['query']);_0x602333[_0x765b('0x30')]=_[_0x765b('0x31')](_0x602333[_0x765b('0x33')],_0x602333[_0x765b('0x2f')]);_0x3ad964['attributes']=_[_0x765b('0x31')](_0x602333[_0x765b('0x33')],qs[_0x765b('0x34')](_0x227372['query'][_0x765b('0x34')]));_0x3ad964[_0x765b('0x32')]=_0x3ad964[_0x765b('0x32')][_0x765b('0x4c')]?_0x3ad964[_0x765b('0x32')]:_0x602333[_0x765b('0x33')];_0x3ad964[_0x765b('0x36')]=qs[_0x765b('0x37')](_0x227372[_0x765b('0x2f')][_0x765b('0x37')]);_0x3ad964[_0x765b('0x38')]=qs[_0x765b('0x30')](_[_0x765b('0x39')](_0x227372[_0x765b('0x2f')],_0x602333[_0x765b('0x30')]));if(_0x227372['query'][_0x765b('0x3a')]){_0x3ad964[_0x765b('0x38')]=_[_0x765b('0x3b')](_0x3ad964[_0x765b('0x38')],{'$or':_['map'](_0x3ad964[_0x765b('0x32')],function(_0x2218ec){var _0x3a61b6={};_0x3a61b6[_0x2218ec]={'$like':'%'+_0x227372[_0x765b('0x2f')]['filter']+'%'};return _0x3a61b6;})});}_0x3ad964=_[_0x765b('0x3b')]({},_0x3ad964,_0x227372[_0x765b('0x3d')]);return _0xacf910[_0x765b('0x4d')](_0x3ad964);}})[_0x765b('0x25')](function(_0x1e1359){if(_0x1e1359){_0x552bde=_0x1e1359[_0x765b('0x4c')];if(!_0x227372['query'][_0x765b('0x4e')](_0x765b('0x35'))){_0x3ad964[_0x765b('0x1f')]=qs[_0x765b('0x1f')](_0x227372['query'][_0x765b('0x1f')]);_0x3ad964['offset']=qs['offset'](_0x227372['query']['offset']);}return _0xacf910['getConfigurations'](_0x3ad964);}})[_0x765b('0x25')](function(_0x1ff136){if(_0x1ff136){return _0x1ff136?{'count':_0x552bde,'rows':_0x1ff136}:null;}})[_0x765b('0x25')](respondWithResult(_0x2e2988,null))['catch'](handleError(_0x2e2988,null));};exports[_0x765b('0x4f')]=function(_0x36cdff,_0x17dc89,_0x4ea099){if(_0x36cdff['body']['id']){delete _0x36cdff[_0x765b('0x48')]['id'];}return db[_0x765b('0x29')][_0x765b('0x50')]({'where':{'id':_0x36cdff[_0x765b('0x45')]['id']}})['then'](handleEntityNotFound(_0x17dc89,null))[_0x765b('0x25')](function(_0x2809dc){if(_0x2809dc){_0x36cdff[_0x765b('0x48')][_0x765b('0x51')]=_0x2809dc['id'];_0x36cdff[_0x765b('0x48')][_0x765b('0x52')]=integrations['getSubjects'](_0x36cdff[_0x765b('0x48')][_0x765b('0x53')],_0x36cdff[_0x765b('0x48')]['type']);_0x36cdff[_0x765b('0x48')][_0x765b('0x54')]=integrations[_0x765b('0x55')](_0x36cdff[_0x765b('0x48')][_0x765b('0x53')],_0x36cdff[_0x765b('0x48')][_0x765b('0x2b')]);return db[_0x765b('0x4b')][_0x765b('0x47')](_0x36cdff['body'],{'include':[{'model':db[_0x765b('0x56')],'as':_0x765b('0x52')},{'model':db[_0x765b('0x56')],'as':_0x765b('0x54')}]});}return null;})[_0x765b('0x25')](respondWithResult(_0x17dc89,null))[_0x765b('0x43')](handleError(_0x17dc89,null));};var md5=require(_0x765b('0x57'));exports['getFields']=function(_0x31d383,_0xf4eafd,_0x248e9d){var _0x3c0642=null;var _0x430af6=null;var _0x4495d1=null;var _0x3f74cf=null;var _0x44c547='';return db[_0x765b('0x29')]['findOne']({'where':{'id':_0x31d383[_0x765b('0x45')]['id']},'attributes':['id',_0x765b('0x28'),'username',_0x765b('0x58'),_0x765b('0x59'),'remoteUri',_0x765b('0x5a'),_0x765b('0x5b')]})[_0x765b('0x25')](handleEntityNotFound(_0xf4eafd,null))[_0x765b('0x25')](function(_0x160b8b){if(_0x160b8b){_0x3c0642=_0x160b8b['username'];_0x430af6=_0x160b8b[_0x765b('0x5b')];_0x4495d1=_0x160b8b[_0x765b('0x59')];_0x44c547=_0x160b8b[_0x765b('0x5c')];var _0x126f38=_0x44c547[_0x765b('0x5d')](-0x1);if(_0x126f38==='/'){_0x44c547=_0x44c547['substring'](0x0,_0x44c547[_0x765b('0x5e')](_0x126f38));}_0x3f74cf=util[_0x765b('0x5f')](_0x765b('0x60'),_0x44c547);var _0x3191cf={'method':'GET','uri':_0x3f74cf,'qs':{'operation':'getchallenge','username':_0x160b8b[_0x765b('0x61')]},'json':!![]};return rp(_0x3191cf);}})[_0x765b('0x25')](function(_0x29c7fa){if(_0x29c7fa[_0x765b('0x62')]){var _0x413e23={'method':_0x765b('0x63'),'uri':_0x3f74cf,'form':{'operation':_0x765b('0x64'),'username':_0x3c0642,'accessKey':md5(_0x29c7fa[_0x765b('0x65')][_0x765b('0x66')]+_0x430af6)},'json':!![]};return rp(_0x413e23);}})['then'](function(_0x2b0160){if(_0x2b0160[_0x765b('0x62')]){var _0x164c0e={'method':_0x765b('0x67'),'uri':_0x3f74cf,'qs':{'operation':'describe','username':_0x3c0642,'sessionName':_0x2b0160[_0x765b('0x65')][_0x765b('0x68')],'elementType':_0x4495d1},'json':!![]};return rp(_0x164c0e);}})[_0x765b('0x25')](function(_0x345464){if(_0x345464[_0x765b('0x62')]){var _0x9dbe5b=[_0x765b('0x69'),'reference',_0x765b('0x6a')];_[_0x765b('0x6b')](_0x345464[_0x765b('0x65')][_0x765b('0x34')],function(_0x575c00){return _0x9dbe5b[_0x765b('0x6c')](_0x575c00[_0x765b('0x2b')][_0x765b('0x28')]);});_['remove'](_0x345464[_0x765b('0x65')][_0x765b('0x34')],function(_0x2e6054){return _0x2e6054[_0x765b('0x6d')]===_0x765b('0x6e');});return{'count':_0x345464[_0x765b('0x65')][_0x765b('0x34')][_0x765b('0x4c')],'rows':_[_0x765b('0x2d')](_0x345464[_0x765b('0x65')]['fields'],function(_0x1fdea1){return{'id':_0x1fdea1['name'],'name':_0x1fdea1[_0x765b('0x6f')],'custom':_[_0x765b('0x70')](_0x1fdea1[_0x765b('0x28')],_0x765b('0x71'))?!![]:![],'options':_0x1fdea1[_0x765b('0x2b')][_0x765b('0x28')]==='picklist'&&_0x1fdea1[_0x765b('0x2b')][_0x765b('0x72')][_0x765b('0x4c')]>0x0?_['map'](_0x1fdea1[_0x765b('0x2b')]['picklistValues'],function(_0x5c8857){return{'name':_0x5c8857[_0x765b('0x6f')],'value':_0x5c8857[_0x765b('0x73')]};}):[]};})};}})['then'](respondWithResult(_0xf4eafd,null))['catch'](function(_0x1477e7){console[_0x765b('0x74')](_0x765b('0x75')+_0x1477e7);var _0x1a918b=_0x31d383['query'][_0x765b('0x76')]?0x1f4:_0x1477e7[_0x765b('0x77')]||0x1f4;logger[_0x765b('0x78')](_0x765b('0x79'),_0x765b('0x7a'),_0x1a918b,JSON[_0x765b('0x7b')](_0x1477e7));delete _0x1477e7['name'];if(_0x1a918b===0x191){_0x1a918b=0x190;}_0xf4eafd['status'](_0x1a918b)['send'](_0x31d383[_0x765b('0x2f')][_0x765b('0x76')]?{'message':_0x765b('0x7c'),'statusCode':_0x1477e7[_0x765b('0x77')]}:_0x1477e7);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 7a5b9ab..432bc30 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 _0xc576=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','request-promise','path'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xc576,0x131));var _0x6c57=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc576[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x6c57('0x0'));var util=require('util');var logger=require(_0x6c57('0x1'))(_0x6c57('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c57('0x3'));var fs=require('fs');var path=require(_0x6c57('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c57('0x5'));var integrations=require(_0x6c57('0x6'));module[_0x6c57('0x7')]=function(_0x19d1a6,_0xd400a6){return _0x19d1a6['define'](_0x6c57('0x8'),attributes,{'tableName':_0x6c57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacff=['exports','define','int_vtiger_accounts','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x5d9dc3,_0x594d5f){var _0x1a2e87=function(_0x10cc9a){while(--_0x10cc9a){_0x5d9dc3['push'](_0x5d9dc3['shift']());}};_0x1a2e87(++_0x594d5f);}(_0xacff,0x116));var _0xfacf=function(_0x5ebad9,_0x440587){_0x5ebad9=_0x5ebad9-0x0;var _0x44e18c=_0xacff[_0x5ebad9];return _0x44e18c;};'use strict';var _=require('lodash');var util=require(_0xfacf('0x0'));var logger=require(_0xfacf('0x1'))(_0xfacf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfacf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfacf('0x4'));var config=require(_0xfacf('0x5'));var attributes=require(_0xfacf('0x6'));var integrations=require(_0xfacf('0x7'));module[_0xfacf('0x8')]=function(_0x34568a,_0x5c19c7){return _0x34568a[_0xfacf('0x9')]('VtigerAccount',attributes,{'tableName':_0xfacf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index e82189f..a2f94b9 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e81=['find','raw','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','map','include','model','attributes','ShowVtigerAccount'];(function(_0x377dc0,_0x21b1b5){var _0x39c882=function(_0x34745b){while(--_0x34745b){_0x377dc0['push'](_0x377dc0['shift']());}};_0x39c882(++_0x21b1b5);}(_0x4e81,0x1bc));var _0x14e8=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x4e81[_0x21de89];return _0x290b7e;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});}exports[_0x14e8('0x15')]=function(_0x10dc8b){var _0x462259=this;return new Promise(function(_0x5a38c1,_0x328c5a){return db[_0x14e8('0x16')][_0x14e8('0x17')]({'raw':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')][_0x14e8('0x19')]||null:null,'attributes':_0x10dc8b['options']?_0x10dc8b[_0x14e8('0x18')]['attributes']||null:null,'limit':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')][_0x14e8('0x1a')]||null:null,'include':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')]['include']?_[_0x14e8('0x1b')](_0x10dc8b['options'][_0x14e8('0x1c')],function(_0x185a0e){return{'model':db[_0x185a0e['model']],'as':_0x185a0e['as'],'attributes':_0x185a0e['attributes'],'include':_0x185a0e['include']?_[_0x14e8('0x1b')](_0x185a0e[_0x14e8('0x1c')],function(_0x3eae0b){return{'model':db[_0x3eae0b[_0x14e8('0x1d')]],'as':_0x3eae0b['as'],'attributes':_0x3eae0b[_0x14e8('0x1e')],'include':_0x3eae0b['include']?_[_0x14e8('0x1b')](_0x3eae0b[_0x14e8('0x1c')],function(_0x3c09cb){return{'model':db[_0x3c09cb[_0x14e8('0x1d')]],'as':_0x3c09cb['as'],'attributes':_0x3c09cb[_0x14e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14e8('0xa')](function(_0x2813ae){logger['info'](_0x14e8('0x15'),_0x10dc8b);logger[_0x14e8('0xd')](_0x14e8('0x15'),_0x10dc8b,JSON['stringify'](_0x2813ae));_0x5a38c1(_0x2813ae);})['catch'](function(_0x5cacd7){logger[_0x14e8('0x10')](_0x14e8('0x15'),_0x5cacd7['message'],_0x10dc8b);_0x328c5a(_0x462259[_0x14e8('0x10')](0x1f4,_0x5cacd7[_0x14e8('0x13')]));});});};exports[_0x14e8('0x1f')]=function(_0xa83433){var _0x5c2635=this;return new Promise(function(_0x1f1259,_0x260d51){return db[_0x14e8('0x16')][_0x14e8('0x20')]({'raw':_0xa83433[_0x14e8('0x18')]?_0xa83433['options'][_0x14e8('0x21')]===undefined?!![]:![]:!![],'where':_0xa83433[_0x14e8('0x18')]?_0xa83433[_0x14e8('0x18')][_0x14e8('0x19')]||null:null,'attributes':_0xa83433['options']?_0xa83433[_0x14e8('0x18')]['attributes']||null:null,'include':_0xa83433[_0x14e8('0x18')]?_0xa83433[_0x14e8('0x18')][_0x14e8('0x1c')]?_[_0x14e8('0x1b')](_0xa83433[_0x14e8('0x18')][_0x14e8('0x1c')],function(_0xbe9eab){return{'model':db[_0xbe9eab[_0x14e8('0x1d')]],'as':_0xbe9eab['as'],'attributes':_0xbe9eab[_0x14e8('0x1e')],'include':_0xbe9eab[_0x14e8('0x1c')]?_[_0x14e8('0x1b')](_0xbe9eab[_0x14e8('0x1c')],function(_0x54e624){return{'model':db[_0x54e624['model']],'as':_0x54e624['as'],'attributes':_0x54e624['attributes'],'include':_0x54e624[_0x14e8('0x1c')]?_['map'](_0x54e624[_0x14e8('0x1c')],function(_0x5bdf42){return{'model':db[_0x5bdf42[_0x14e8('0x1d')]],'as':_0x5bdf42['as'],'attributes':_0x5bdf42[_0x14e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14e8('0xa')](function(_0x2fc030){logger['info'](_0x14e8('0x1f'),_0xa83433);logger['debug'](_0x14e8('0x1f'),_0xa83433,JSON[_0x14e8('0xf')](_0x2fc030));_0x1f1259(_0x2fc030);})[_0x14e8('0x14')](function(_0x1fda35){logger[_0x14e8('0x10')](_0x14e8('0x1f'),_0x1fda35['message'],_0xa83433);_0x260d51(_0x5c2635[_0x14e8('0x10')](0x1f4,_0x1fda35['message']));});});}; \ No newline at end of file +var _0xed3c=['catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xed3c,0x1a6));var _0xced3=function(_0x55e111,_0x391f5a){_0x55e111=_0x55e111-0x0;var _0x30d69c=_0xed3c[_0x55e111];return _0x30d69c;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});}exports['GetVtigerAccount']=function(_0x4569af){var _0x4a3afe=this;return new Promise(function(_0x353580,_0x4480a6){return db[_0xced3('0x15')][_0xced3('0x16')]({'raw':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x4569af[_0xced3('0x17')]?_0x4569af['options']['attributes']||null:null,'limit':_0x4569af['options']?_0x4569af[_0xced3('0x17')][_0xced3('0x1a')]||null:null,'include':_0x4569af[_0xced3('0x17')]?_0x4569af['options'][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x4569af['options']['include'],function(_0x3adf14){return{'model':db[_0x3adf14[_0xced3('0x1d')]],'as':_0x3adf14['as'],'attributes':_0x3adf14[_0xced3('0x1e')],'include':_0x3adf14[_0xced3('0x1b')]?_['map'](_0x3adf14[_0xced3('0x1b')],function(_0x23f92b){return{'model':db[_0x23f92b['model']],'as':_0x23f92b['as'],'attributes':_0x23f92b[_0xced3('0x1e')],'include':_0x23f92b['include']?_[_0xced3('0x1c')](_0x23f92b[_0xced3('0x1b')],function(_0x3b728d){return{'model':db[_0x3b728d[_0xced3('0x1d')]],'as':_0x3b728d['as'],'attributes':_0x3b728d[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5454c0){logger[_0xced3('0xb')]('GetVtigerAccount',_0x4569af);logger[_0xced3('0xe')](_0xced3('0x1f'),_0x4569af,JSON['stringify'](_0x5454c0));_0x353580(_0x5454c0);})[_0xced3('0x14')](function(_0x4024fa){logger[_0xced3('0x10')](_0xced3('0x1f'),_0x4024fa[_0xced3('0x12')],_0x4569af);_0x4480a6(_0x4a3afe[_0xced3('0x10')](0x1f4,_0x4024fa[_0xced3('0x12')]));});});};exports[_0xced3('0x20')]=function(_0x116cc7){var _0x559b8e=this;return new Promise(function(_0xa78899,_0x1b8baa){return db[_0xced3('0x15')][_0xced3('0x21')]({'raw':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1e')]||null:null,'include':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')],function(_0xcd0fe3){return{'model':db[_0xcd0fe3[_0xced3('0x1d')]],'as':_0xcd0fe3['as'],'attributes':_0xcd0fe3['attributes'],'include':_0xcd0fe3[_0xced3('0x1b')]?_['map'](_0xcd0fe3[_0xced3('0x1b')],function(_0x28f674){return{'model':db[_0x28f674[_0xced3('0x1d')]],'as':_0x28f674['as'],'attributes':_0x28f674[_0xced3('0x1e')],'include':_0x28f674[_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x28f674[_0xced3('0x1b')],function(_0x340be1){return{'model':db[_0x340be1[_0xced3('0x1d')]],'as':_0x340be1['as'],'attributes':_0x340be1[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x342c11){logger[_0xced3('0xb')]('ShowVtigerAccount',_0x116cc7);logger[_0xced3('0xe')](_0xced3('0x20'),_0x116cc7,JSON[_0xced3('0xf')](_0x342c11));_0xa78899(_0x342c11);})['catch'](function(_0x59c3aa){logger[_0xced3('0x10')]('ShowVtigerAccount',_0x59c3aa[_0xced3('0x12')],_0x116cc7);_0x1b8baa(_0x559b8e[_0xced3('0x10')](0x1f4,_0x59c3aa['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 9241726..98444e0 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 _0x4941=['/:id','show','/:id/fields','getFields','post','create','put','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x4067a8,_0x4959d6){var _0x203acb=function(_0x4df5c4){while(--_0x4df5c4){_0x4067a8['push'](_0x4067a8['shift']());}};_0x203acb(++_0x4959d6);}(_0x4941,0xaa));var _0x1494=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0x4941[_0x1f99a0];return _0x1e0849;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1494('0x0'));var timeout=require(_0x1494('0x1'));var express=require(_0x1494('0x2'));var router=express['Router']();var fs_extra=require(_0x1494('0x3'));var auth=require(_0x1494('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1494('0x5'));var controller=require(_0x1494('0x6'));router[_0x1494('0x7')]('/',auth[_0x1494('0x8')](),controller[_0x1494('0x9')]);router[_0x1494('0x7')](_0x1494('0xa'),auth[_0x1494('0x8')](),controller[_0x1494('0xb')]);router[_0x1494('0x7')](_0x1494('0xc'),auth[_0x1494('0x8')](),controller[_0x1494('0xd')]);router[_0x1494('0x7')]('/:id/subjects',auth[_0x1494('0x8')](),controller['getSubjects']);router[_0x1494('0x7')]('/:id/descriptions',auth[_0x1494('0x8')](),controller['getDescriptions']);router[_0x1494('0xe')]('/',auth['isAuthenticated'](),controller[_0x1494('0xf')]);router[_0x1494('0x10')](_0x1494('0xa'),auth[_0x1494('0x8')](),controller['update']);router[_0x1494('0x11')]('/:id',auth[_0x1494('0x8')](),controller[_0x1494('0x12')]);module[_0x1494('0x13')]=router; \ No newline at end of file +var _0x9c0a=['path','Router','fs-extra','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update','destroy','multer','util'];(function(_0x2e6a88,_0xca27){var _0xeaa9a2=function(_0x5a538f){while(--_0x5a538f){_0x2e6a88['push'](_0x2e6a88['shift']());}};_0xeaa9a2(++_0xca27);}(_0x9c0a,0x1b7));var _0xa9c0=function(_0x46cdc0,_0x98d11f){_0x46cdc0=_0x46cdc0-0x0;var _0x2580c4=_0x9c0a[_0x46cdc0];return _0x2580c4;};'use strict';var multer=require(_0xa9c0('0x0'));var util=require(_0xa9c0('0x1'));var path=require(_0xa9c0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa9c0('0x3')]();var fs_extra=require(_0xa9c0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c0('0x5'));var config=require('../../config/environment');var controller=require(_0xa9c0('0x6'));router[_0xa9c0('0x7')]('/',auth[_0xa9c0('0x8')](),controller[_0xa9c0('0x9')]);router[_0xa9c0('0x7')](_0xa9c0('0xa'),auth[_0xa9c0('0x8')](),controller[_0xa9c0('0xb')]);router[_0xa9c0('0x7')](_0xa9c0('0xc'),auth[_0xa9c0('0x8')](),controller[_0xa9c0('0xd')]);router[_0xa9c0('0x7')]('/:id/subjects',auth[_0xa9c0('0x8')](),controller[_0xa9c0('0xe')]);router[_0xa9c0('0x7')]('/:id/descriptions',auth[_0xa9c0('0x8')](),controller[_0xa9c0('0xf')]);router[_0xa9c0('0x10')]('/',auth[_0xa9c0('0x8')](),controller[_0xa9c0('0x11')]);router[_0xa9c0('0x12')](_0xa9c0('0xa'),auth[_0xa9c0('0x8')](),controller[_0xa9c0('0x13')]);router['delete'](_0xa9c0('0xa'),auth['isAuthenticated'](),controller[_0xa9c0('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 0f000f9..d6d8513 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 _0x1d84=['STRING'];(function(_0x25ccbd,_0x22a5da){var _0x27626d=function(_0x26fb4d){while(--_0x26fb4d){_0x25ccbd['push'](_0x25ccbd['shift']());}};_0x27626d(++_0x22a5da);}(_0x1d84,0xe5));var _0x41d8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1d84[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x41d8('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xead4=['STRING','sequelize'];(function(_0x4178af,_0x388652){var _0x20f4b1=function(_0x504188){while(--_0x504188){_0x4178af['push'](_0x4178af['shift']());}};_0x20f4b1(++_0x388652);}(_0xead4,0x177));var _0x4ead=function(_0x42423d,_0x30a07e){_0x42423d=_0x42423d-0x0;var _0x5d6864=_0xead4[_0x42423d];return _0x5d6864;};'use strict';var Sequelize=require(_0x4ead('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ead('0x1')]},'description':{'type':Sequelize[_0x4ead('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2b4dc69..dfea5cc 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 _0x1782=['fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','VtigerConfiguration','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','find','body','getFields','findOne','VtigerField','rawAttributes','pick','nolimit','getSubjects','getDescriptions','eml-format','zip-dir'];(function(_0x2510f6,_0x5299ec){var _0x3f460d=function(_0x46e164){while(--_0x46e164){_0x2510f6['push'](_0x2510f6['shift']());}};_0x3f460d(++_0x5299ec);}(_0x1782,0x13e));var _0x2178=function(_0x30abf4,_0x87be27){_0x30abf4=_0x30abf4-0x0;var _0x3a1402=_0x1782[_0x30abf4];return _0x3a1402;};'use strict';var emlformat=require(_0x2178('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2178('0x1'));var jsonpatch=require(_0x2178('0x2'));var rp=require(_0x2178('0x3'));var moment=require(_0x2178('0x4'));var BPromise=require(_0x2178('0x5'));var Mustache=require('mustache');var util=require(_0x2178('0x6'));var path=require(_0x2178('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2178('0x8'));var fs=require('fs');var fs_extra=require(_0x2178('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2178('0xa'));var deskjs=require(_0x2178('0xb'));var toCsv=require(_0x2178('0xc'));var querystring=require(_0x2178('0xd'));var Papa=require(_0x2178('0xe'));var Redis=require(_0x2178('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2178('0x10'));var as=require(_0x2178('0x11'));var hardwareService=require(_0x2178('0x12'));var logger=require(_0x2178('0x13'))(_0x2178('0x14'));var utils=require(_0x2178('0x15'));var config=require(_0x2178('0x16'));var licenseUtil=require(_0x2178('0x17'));var db=require(_0x2178('0x18'))['db'];function respondWithStatusCode(_0xd7dd49,_0x5f1d29){_0x5f1d29=_0x5f1d29||0xcc;return function(_0x197ce9){if(_0x197ce9){return _0xd7dd49[_0x2178('0x19')](_0x5f1d29);}return _0xd7dd49['status'](_0x5f1d29)[_0x2178('0x1a')]();};}function respondWithResult(_0x3fd74c,_0x32f65c){_0x32f65c=_0x32f65c||0xc8;return function(_0x21d6e3){if(_0x21d6e3){return _0x3fd74c[_0x2178('0x1b')](_0x32f65c)['json'](_0x21d6e3);}};}function respondWithFilteredResult(_0x5921cc,_0x535e82){return function(_0x47aac0){if(_0x47aac0){var _0x4d8f39=typeof _0x535e82[_0x2178('0x1c')]===_0x2178('0x1d')&&typeof _0x535e82['limit']==='undefined';var _0x2cbbfe=_0x47aac0[_0x2178('0x1e')];var _0x561990=_0x4d8f39?0x0:_0x535e82[_0x2178('0x1c')];var _0x39dd60=_0x4d8f39?_0x47aac0[_0x2178('0x1e')]:_0x535e82[_0x2178('0x1c')]+_0x535e82[_0x2178('0x1f')];var _0x443b2a;if(_0x39dd60>=_0x2cbbfe){_0x39dd60=_0x2cbbfe;_0x443b2a=0xc8;}else{_0x443b2a=0xce;}_0x5921cc[_0x2178('0x1b')](_0x443b2a);return _0x5921cc[_0x2178('0x20')](_0x2178('0x21'),_0x561990+'-'+_0x39dd60+'/'+_0x2cbbfe)[_0x2178('0x22')](_0x47aac0);}return null;};}function patchUpdates(_0x1d2dd5){return function(_0x45999f){try{jsonpatch['apply'](_0x45999f,_0x1d2dd5,!![]);}catch(_0x3dd119){return BPromise[_0x2178('0x23')](_0x3dd119);}return _0x45999f[_0x2178('0x24')]();};}function saveUpdates(_0x27a745,_0x4335f2){return function(_0x6f21d4){if(_0x6f21d4){return _0x6f21d4[_0x2178('0x25')](_0x27a745)[_0x2178('0x26')](function(_0x383894){return _0x383894;});}return null;};}function removeEntity(_0x2fa395,_0x3c03f7){return function(_0x1506ec){if(_0x1506ec){return _0x1506ec[_0x2178('0x27')]()[_0x2178('0x26')](function(){_0x2fa395[_0x2178('0x1b')](0xcc)[_0x2178('0x1a')]();});}};}function handleEntityNotFound(_0x393f67,_0x3ddb6d){return function(_0x27179c){if(!_0x27179c){_0x393f67[_0x2178('0x19')](0x194);}return _0x27179c;};}function handleError(_0x2d516f,_0x2b5a0f){_0x2b5a0f=_0x2b5a0f||0x1f4;return function(_0x330618){logger['error'](_0x330618[_0x2178('0x28')]);if(_0x330618[_0x2178('0x29')]){delete _0x330618['name'];}_0x2d516f['status'](_0x2b5a0f)[_0x2178('0x2a')](_0x330618);};}exports['index']=function(_0xffcd00,_0x843cf7){var _0x2bccc6={},_0x47a28f={},_0x50f596={'count':0x0,'rows':[]};var _0x2ee78a=_[_0x2178('0x2b')](db[_0x2178('0x2c')]['rawAttributes'],function(_0x4baf93){return{'name':_0x4baf93[_0x2178('0x2d')],'type':_0x4baf93[_0x2178('0x2e')][_0x2178('0x2f')]};});_0x47a28f[_0x2178('0x30')]=_[_0x2178('0x2b')](_0x2ee78a,_0x2178('0x29'));_0x47a28f[_0x2178('0x31')]=_['keys'](_0xffcd00[_0x2178('0x31')]);_0x47a28f[_0x2178('0x32')]=_['intersection'](_0x47a28f[_0x2178('0x30')],_0x47a28f[_0x2178('0x31')]);_0x2bccc6[_0x2178('0x33')]=_[_0x2178('0x34')](_0x47a28f['model'],qs[_0x2178('0x35')](_0xffcd00['query']['fields']));_0x2bccc6[_0x2178('0x33')]=_0x2bccc6[_0x2178('0x33')][_0x2178('0x36')]?_0x2bccc6[_0x2178('0x33')]:_0x47a28f[_0x2178('0x30')];if(!_0xffcd00[_0x2178('0x31')][_0x2178('0x37')]('nolimit')){_0x2bccc6[_0x2178('0x1f')]=qs['limit'](_0xffcd00[_0x2178('0x31')][_0x2178('0x1f')]);_0x2bccc6['offset']=qs[_0x2178('0x1c')](_0xffcd00[_0x2178('0x31')][_0x2178('0x1c')]);}_0x2bccc6[_0x2178('0x38')]=qs[_0x2178('0x39')](_0xffcd00[_0x2178('0x31')][_0x2178('0x39')]);_0x2bccc6['where']=qs['filters'](_['pick'](_0xffcd00['query'],_0x47a28f[_0x2178('0x32')]),_0x2ee78a);if(_0xffcd00[_0x2178('0x31')][_0x2178('0x3a')]){_0x2bccc6[_0x2178('0x3b')]=_[_0x2178('0x3c')](_0x2bccc6['where'],{'$or':_['map'](_0x2ee78a,function(_0x578277){if(_0x578277['type']!==_0x2178('0x3d')){var _0x6a430b={};_0x6a430b[_0x578277[_0x2178('0x29')]]={'$like':'%'+_0xffcd00['query'][_0x2178('0x3a')]+'%'};return _0x6a430b;}})});}_0x2bccc6=_[_0x2178('0x3c')]({},_0x2bccc6,_0xffcd00[_0x2178('0x3e')]);var _0x165167={'where':_0x2bccc6[_0x2178('0x3b')]};return db[_0x2178('0x2c')][_0x2178('0x1e')](_0x165167)[_0x2178('0x26')](function(_0x2ed3a3){_0x50f596[_0x2178('0x1e')]=_0x2ed3a3;if(_0xffcd00[_0x2178('0x31')]['includeAll']){_0x2bccc6[_0x2178('0x3f')]=[{'all':!![]}];}return db[_0x2178('0x2c')][_0x2178('0x40')](_0x2bccc6);})[_0x2178('0x26')](function(_0x5348fe){_0x50f596['rows']=_0x5348fe;return _0x50f596;})[_0x2178('0x26')](respondWithFilteredResult(_0x843cf7,_0x2bccc6))[_0x2178('0x41')](handleError(_0x843cf7,null));};exports[_0x2178('0x42')]=function(_0x2d3028,_0x14a408){var _0x2c7ed4={'raw':![],'where':{'id':_0x2d3028[_0x2178('0x43')]['id']}},_0x2fa43d={};_0x2fa43d[_0x2178('0x30')]=_[_0x2178('0x44')](db[_0x2178('0x2c')]['rawAttributes']);_0x2fa43d[_0x2178('0x31')]=_['keys'](_0x2d3028[_0x2178('0x31')]);_0x2fa43d[_0x2178('0x32')]=_[_0x2178('0x34')](_0x2fa43d[_0x2178('0x30')],_0x2fa43d[_0x2178('0x31')]);_0x2c7ed4[_0x2178('0x33')]=_[_0x2178('0x34')](_0x2fa43d[_0x2178('0x30')],qs['fields'](_0x2d3028[_0x2178('0x31')][_0x2178('0x35')]));_0x2c7ed4[_0x2178('0x33')]=_0x2c7ed4[_0x2178('0x33')][_0x2178('0x36')]?_0x2c7ed4[_0x2178('0x33')]:_0x2fa43d[_0x2178('0x30')];if(_0x2d3028[_0x2178('0x31')][_0x2178('0x45')]){_0x2c7ed4[_0x2178('0x3f')]=[{'all':!![]}];}_0x2c7ed4=_[_0x2178('0x3c')]({},_0x2c7ed4,_0x2d3028[_0x2178('0x3e')]);return db[_0x2178('0x2c')][_0x2178('0x46')](_0x2c7ed4)[_0x2178('0x26')](handleEntityNotFound(_0x14a408,null))['then'](respondWithResult(_0x14a408,null))[_0x2178('0x41')](handleError(_0x14a408,null));};exports['create']=function(_0x3edff3,_0x41771c){return db[_0x2178('0x2c')]['create'](_0x3edff3[_0x2178('0x47')],{})[_0x2178('0x26')](respondWithResult(_0x41771c,0xc9))[_0x2178('0x41')](handleError(_0x41771c,null));};exports[_0x2178('0x25')]=function(_0x29c161,_0x5f150d){if(_0x29c161[_0x2178('0x47')]['id']){delete _0x29c161[_0x2178('0x47')]['id'];}return db[_0x2178('0x2c')][_0x2178('0x46')]({'where':{'id':_0x29c161[_0x2178('0x43')]['id']}})['then'](handleEntityNotFound(_0x5f150d,null))['then'](saveUpdates(_0x29c161[_0x2178('0x47')],null))[_0x2178('0x26')](respondWithResult(_0x5f150d,null))[_0x2178('0x41')](handleError(_0x5f150d,null));};exports[_0x2178('0x27')]=function(_0x52d35e,_0x4fd2e5){return db['VtigerConfiguration'][_0x2178('0x46')]({'where':{'id':_0x52d35e[_0x2178('0x43')]['id']}})[_0x2178('0x26')](handleEntityNotFound(_0x4fd2e5,null))[_0x2178('0x26')](removeEntity(_0x4fd2e5,null))[_0x2178('0x41')](handleError(_0x4fd2e5,null));};exports[_0x2178('0x48')]=function(_0x55d6ad,_0x4b743b,_0x2b2301){var _0x2972b3={};var _0x5dbf85={};var _0x50f83f;var _0x5acac4;return db[_0x2178('0x2c')][_0x2178('0x49')]({'where':{'id':_0x55d6ad[_0x2178('0x43')]['id']}})[_0x2178('0x26')](handleEntityNotFound(_0x4b743b,null))['then'](function(_0x4b516e){if(_0x4b516e){_0x50f83f=_0x4b516e;_0x5dbf85[_0x2178('0x30')]=_[_0x2178('0x44')](db[_0x2178('0x4a')][_0x2178('0x4b')]);_0x5dbf85[_0x2178('0x31')]=_[_0x2178('0x44')](_0x55d6ad['query']);_0x5dbf85[_0x2178('0x32')]=_['intersection'](_0x5dbf85['model'],_0x5dbf85['query']);_0x2972b3['attributes']=_[_0x2178('0x34')](_0x5dbf85['model'],qs[_0x2178('0x35')](_0x55d6ad[_0x2178('0x31')][_0x2178('0x35')]));_0x2972b3[_0x2178('0x33')]=_0x2972b3[_0x2178('0x33')][_0x2178('0x36')]?_0x2972b3[_0x2178('0x33')]:_0x5dbf85['model'];_0x2972b3[_0x2178('0x38')]=qs['sort'](_0x55d6ad['query'][_0x2178('0x39')]);_0x2972b3[_0x2178('0x3b')]=qs[_0x2178('0x32')](_[_0x2178('0x4c')](_0x55d6ad[_0x2178('0x31')],_0x5dbf85['filters']));if(_0x55d6ad['query'][_0x2178('0x3a')]){_0x2972b3[_0x2178('0x3b')]=_[_0x2178('0x3c')](_0x2972b3[_0x2178('0x3b')],{'$or':_['map'](_0x2972b3[_0x2178('0x33')],function(_0x1ff7d0){var _0x542d79={};_0x542d79[_0x1ff7d0]={'$like':'%'+_0x55d6ad['query'][_0x2178('0x3a')]+'%'};return _0x542d79;})});}_0x2972b3=_[_0x2178('0x3c')]({},_0x2972b3,_0x55d6ad[_0x2178('0x3e')]);return _0x50f83f['getFields'](_0x2972b3);}})['then'](function(_0x2ae746){if(_0x2ae746){_0x5acac4=_0x2ae746[_0x2178('0x36')];if(!_0x55d6ad[_0x2178('0x31')][_0x2178('0x37')](_0x2178('0x4d'))){_0x2972b3[_0x2178('0x1f')]=qs[_0x2178('0x1f')](_0x55d6ad['query'][_0x2178('0x1f')]);_0x2972b3[_0x2178('0x1c')]=qs[_0x2178('0x1c')](_0x55d6ad['query'][_0x2178('0x1c')]);}return _0x50f83f[_0x2178('0x48')](_0x2972b3);}})[_0x2178('0x26')](function(_0xbf22f2){if(_0xbf22f2){return _0xbf22f2?{'count':_0x5acac4,'rows':_0xbf22f2}:null;}})[_0x2178('0x26')](respondWithResult(_0x4b743b,null))[_0x2178('0x41')](handleError(_0x4b743b,null));};exports[_0x2178('0x4e')]=function(_0x2d1e88,_0x4f8652,_0x5d6bcf){var _0x511934={};var _0x506d4c={};var _0x37b16c;var _0x19bc74;return db[_0x2178('0x2c')][_0x2178('0x49')]({'where':{'id':_0x2d1e88[_0x2178('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f8652,null))[_0x2178('0x26')](function(_0x2e478a){if(_0x2e478a){_0x37b16c=_0x2e478a;_0x506d4c[_0x2178('0x30')]=_[_0x2178('0x44')](db[_0x2178('0x4a')]['rawAttributes']);_0x506d4c[_0x2178('0x31')]=_[_0x2178('0x44')](_0x2d1e88[_0x2178('0x31')]);_0x506d4c['filters']=_[_0x2178('0x34')](_0x506d4c['model'],_0x506d4c[_0x2178('0x31')]);_0x511934[_0x2178('0x33')]=_[_0x2178('0x34')](_0x506d4c[_0x2178('0x30')],qs[_0x2178('0x35')](_0x2d1e88[_0x2178('0x31')][_0x2178('0x35')]));_0x511934[_0x2178('0x33')]=_0x511934['attributes']['length']?_0x511934[_0x2178('0x33')]:_0x506d4c[_0x2178('0x30')];_0x511934['order']=qs['sort'](_0x2d1e88[_0x2178('0x31')]['sort']);_0x511934['where']=qs[_0x2178('0x32')](_[_0x2178('0x4c')](_0x2d1e88[_0x2178('0x31')],_0x506d4c[_0x2178('0x32')]));if(_0x2d1e88[_0x2178('0x31')][_0x2178('0x3a')]){_0x511934[_0x2178('0x3b')]=_[_0x2178('0x3c')](_0x511934[_0x2178('0x3b')],{'$or':_[_0x2178('0x2b')](_0x511934[_0x2178('0x33')],function(_0x23237b){var _0x329968={};_0x329968[_0x23237b]={'$like':'%'+_0x2d1e88[_0x2178('0x31')]['filter']+'%'};return _0x329968;})});}_0x511934=_[_0x2178('0x3c')]({},_0x511934,_0x2d1e88[_0x2178('0x3e')]);return _0x37b16c['getSubjects'](_0x511934);}})[_0x2178('0x26')](function(_0x49c55e){if(_0x49c55e){_0x19bc74=_0x49c55e[_0x2178('0x36')];if(!_0x2d1e88[_0x2178('0x31')][_0x2178('0x37')]('nolimit')){_0x511934[_0x2178('0x1f')]=qs[_0x2178('0x1f')](_0x2d1e88['query'][_0x2178('0x1f')]);_0x511934[_0x2178('0x1c')]=qs[_0x2178('0x1c')](_0x2d1e88[_0x2178('0x31')]['offset']);}return _0x37b16c[_0x2178('0x4e')](_0x511934);}})[_0x2178('0x26')](function(_0x5e7525){if(_0x5e7525){return _0x5e7525?{'count':_0x19bc74,'rows':_0x5e7525}:null;}})[_0x2178('0x26')](respondWithResult(_0x4f8652,null))[_0x2178('0x41')](handleError(_0x4f8652,null));};exports[_0x2178('0x4f')]=function(_0x3cc7dc,_0x155cf3,_0x56ee55){var _0x55fcd6={};var _0x35a70e={};var _0x479679;var _0x574f14;return db['VtigerConfiguration'][_0x2178('0x49')]({'where':{'id':_0x3cc7dc['params']['id']}})[_0x2178('0x26')](handleEntityNotFound(_0x155cf3,null))[_0x2178('0x26')](function(_0x66e500){if(_0x66e500){_0x479679=_0x66e500;_0x35a70e[_0x2178('0x30')]=_[_0x2178('0x44')](db[_0x2178('0x4a')]['rawAttributes']);_0x35a70e[_0x2178('0x31')]=_[_0x2178('0x44')](_0x3cc7dc[_0x2178('0x31')]);_0x35a70e[_0x2178('0x32')]=_[_0x2178('0x34')](_0x35a70e['model'],_0x35a70e[_0x2178('0x31')]);_0x55fcd6[_0x2178('0x33')]=_[_0x2178('0x34')](_0x35a70e[_0x2178('0x30')],qs['fields'](_0x3cc7dc[_0x2178('0x31')][_0x2178('0x35')]));_0x55fcd6[_0x2178('0x33')]=_0x55fcd6['attributes']['length']?_0x55fcd6[_0x2178('0x33')]:_0x35a70e[_0x2178('0x30')];_0x55fcd6[_0x2178('0x38')]=qs['sort'](_0x3cc7dc['query'][_0x2178('0x39')]);_0x55fcd6[_0x2178('0x3b')]=qs[_0x2178('0x32')](_[_0x2178('0x4c')](_0x3cc7dc[_0x2178('0x31')],_0x35a70e['filters']));if(_0x3cc7dc[_0x2178('0x31')][_0x2178('0x3a')]){_0x55fcd6[_0x2178('0x3b')]=_[_0x2178('0x3c')](_0x55fcd6[_0x2178('0x3b')],{'$or':_[_0x2178('0x2b')](_0x55fcd6[_0x2178('0x33')],function(_0x3ccb8c){var _0xc0038c={};_0xc0038c[_0x3ccb8c]={'$like':'%'+_0x3cc7dc['query'][_0x2178('0x3a')]+'%'};return _0xc0038c;})});}_0x55fcd6=_[_0x2178('0x3c')]({},_0x55fcd6,_0x3cc7dc[_0x2178('0x3e')]);return _0x479679[_0x2178('0x4f')](_0x55fcd6);}})[_0x2178('0x26')](function(_0x243d3f){if(_0x243d3f){_0x574f14=_0x243d3f[_0x2178('0x36')];if(!_0x3cc7dc['query']['hasOwnProperty']('nolimit')){_0x55fcd6[_0x2178('0x1f')]=qs[_0x2178('0x1f')](_0x3cc7dc['query'][_0x2178('0x1f')]);_0x55fcd6[_0x2178('0x1c')]=qs[_0x2178('0x1c')](_0x3cc7dc[_0x2178('0x31')][_0x2178('0x1c')]);}return _0x479679[_0x2178('0x4f')](_0x55fcd6);}})[_0x2178('0x26')](function(_0x27545d){if(_0x27545d){return _0x27545d?{'count':_0x574f14,'rows':_0x27545d}:null;}})[_0x2178('0x26')](respondWithResult(_0x155cf3,null))[_0x2178('0x41')](handleError(_0x155cf3,null));}; \ No newline at end of file +var _0x11a9=['name','index','map','VtigerConfiguration','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','count','rows','catch','show','params','rawAttributes','length','include','create','body','find','getFields','findOne','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','apply','reject','update','destroy','then','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11a9,0x11b));var _0x911a=function(_0x3163a5,_0x31381c){_0x3163a5=_0x3163a5-0x0;var _0x2d147d=_0x11a9[_0x3163a5];return _0x2d147d;};'use strict';var emlformat=require(_0x911a('0x0'));var rimraf=require(_0x911a('0x1'));var zipdir=require(_0x911a('0x2'));var jsonpatch=require(_0x911a('0x3'));var rp=require(_0x911a('0x4'));var moment=require(_0x911a('0x5'));var BPromise=require(_0x911a('0x6'));var Mustache=require(_0x911a('0x7'));var util=require(_0x911a('0x8'));var path=require(_0x911a('0x9'));var sox=require(_0x911a('0xa'));var csv=require(_0x911a('0xb'));var ejs=require(_0x911a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x911a('0xd'));var squel=require('squel');var crypto=require(_0x911a('0xe'));var jsforce=require(_0x911a('0xf'));var deskjs=require(_0x911a('0x10'));var toCsv=require(_0x911a('0xb'));var querystring=require(_0x911a('0x11'));var Papa=require(_0x911a('0x12'));var Redis=require(_0x911a('0x13'));var authService=require(_0x911a('0x14'));var qs=require(_0x911a('0x15'));var as=require(_0x911a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x911a('0x17'))(_0x911a('0x18'));var utils=require(_0x911a('0x19'));var config=require(_0x911a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x911a('0x1b'))['db'];function respondWithStatusCode(_0xdb3608,_0x5803ff){_0x5803ff=_0x5803ff||0xcc;return function(_0x35ea33){if(_0x35ea33){return _0xdb3608[_0x911a('0x1c')](_0x5803ff);}return _0xdb3608['status'](_0x5803ff)[_0x911a('0x1d')]();};}function respondWithResult(_0x3e55ed,_0x4eb876){_0x4eb876=_0x4eb876||0xc8;return function(_0x4dde96){if(_0x4dde96){return _0x3e55ed[_0x911a('0x1e')](_0x4eb876)[_0x911a('0x1f')](_0x4dde96);}};}function respondWithFilteredResult(_0x470510,_0x3959b6){return function(_0x4c95b7){if(_0x4c95b7){var _0x262a72=typeof _0x3959b6[_0x911a('0x20')]===_0x911a('0x21')&&typeof _0x3959b6[_0x911a('0x22')]===_0x911a('0x21');var _0x4970df=_0x4c95b7['count'];var _0x20de20=_0x262a72?0x0:_0x3959b6[_0x911a('0x20')];var _0x48ca42=_0x262a72?_0x4c95b7['count']:_0x3959b6[_0x911a('0x20')]+_0x3959b6[_0x911a('0x22')];var _0x38c60b;if(_0x48ca42>=_0x4970df){_0x48ca42=_0x4970df;_0x38c60b=0xc8;}else{_0x38c60b=0xce;}_0x470510[_0x911a('0x1e')](_0x38c60b);return _0x470510['set']('Content-Range',_0x20de20+'-'+_0x48ca42+'/'+_0x4970df)[_0x911a('0x1f')](_0x4c95b7);}return null;};}function patchUpdates(_0x29c0d8){return function(_0x44fa0d){try{jsonpatch[_0x911a('0x23')](_0x44fa0d,_0x29c0d8,!![]);}catch(_0x2c03c5){return BPromise[_0x911a('0x24')](_0x2c03c5);}return _0x44fa0d['save']();};}function saveUpdates(_0x31d309,_0x1efac2){return function(_0x5ef871){if(_0x5ef871){return _0x5ef871[_0x911a('0x25')](_0x31d309)['then'](function(_0x465e10){return _0x465e10;});}return null;};}function removeEntity(_0x33b2b7,_0x448ce2){return function(_0x25c17c){if(_0x25c17c){return _0x25c17c[_0x911a('0x26')]()[_0x911a('0x27')](function(){_0x33b2b7['status'](0xcc)[_0x911a('0x1d')]();});}};}function handleEntityNotFound(_0x1ec162,_0x2ccaee){return function(_0x46cdf1){if(!_0x46cdf1){_0x1ec162[_0x911a('0x1c')](0x194);}return _0x46cdf1;};}function handleError(_0x5e3910,_0x1d172f){_0x1d172f=_0x1d172f||0x1f4;return function(_0x7129f3){logger['error'](_0x7129f3[_0x911a('0x28')]);if(_0x7129f3[_0x911a('0x29')]){delete _0x7129f3['name'];}_0x5e3910[_0x911a('0x1e')](_0x1d172f)['send'](_0x7129f3);};}exports[_0x911a('0x2a')]=function(_0x35676e,_0x406b62){var _0x28d8e4={},_0x226f2d={},_0x13ba9a={'count':0x0,'rows':[]};var _0x34f5be=_[_0x911a('0x2b')](db[_0x911a('0x2c')]['rawAttributes'],function(_0x4ae528){return{'name':_0x4ae528[_0x911a('0x2d')],'type':_0x4ae528[_0x911a('0x2e')][_0x911a('0x2f')]};});_0x226f2d[_0x911a('0x30')]=_[_0x911a('0x2b')](_0x34f5be,_0x911a('0x29'));_0x226f2d[_0x911a('0x31')]=_[_0x911a('0x32')](_0x35676e[_0x911a('0x31')]);_0x226f2d['filters']=_['intersection'](_0x226f2d[_0x911a('0x30')],_0x226f2d[_0x911a('0x31')]);_0x28d8e4['attributes']=_[_0x911a('0x33')](_0x226f2d[_0x911a('0x30')],qs[_0x911a('0x34')](_0x35676e['query'][_0x911a('0x34')]));_0x28d8e4[_0x911a('0x35')]=_0x28d8e4['attributes']['length']?_0x28d8e4['attributes']:_0x226f2d[_0x911a('0x30')];if(!_0x35676e[_0x911a('0x31')][_0x911a('0x36')](_0x911a('0x37'))){_0x28d8e4[_0x911a('0x22')]=qs[_0x911a('0x22')](_0x35676e[_0x911a('0x31')]['limit']);_0x28d8e4[_0x911a('0x20')]=qs['offset'](_0x35676e[_0x911a('0x31')][_0x911a('0x20')]);}_0x28d8e4[_0x911a('0x38')]=qs[_0x911a('0x39')](_0x35676e[_0x911a('0x31')][_0x911a('0x39')]);_0x28d8e4['where']=qs[_0x911a('0x3a')](_[_0x911a('0x3b')](_0x35676e[_0x911a('0x31')],_0x226f2d[_0x911a('0x3a')]),_0x34f5be);if(_0x35676e['query'][_0x911a('0x3c')]){_0x28d8e4['where']=_[_0x911a('0x3d')](_0x28d8e4[_0x911a('0x3e')],{'$or':_[_0x911a('0x2b')](_0x34f5be,function(_0x1e1dec){if(_0x1e1dec['type']!==_0x911a('0x3f')){var _0x44b0a7={};_0x44b0a7[_0x1e1dec[_0x911a('0x29')]]={'$like':'%'+_0x35676e[_0x911a('0x31')]['filter']+'%'};return _0x44b0a7;}})});}_0x28d8e4=_['merge']({},_0x28d8e4,_0x35676e[_0x911a('0x40')]);var _0x445f01={'where':_0x28d8e4[_0x911a('0x3e')]};return db[_0x911a('0x2c')][_0x911a('0x41')](_0x445f01)[_0x911a('0x27')](function(_0x3e78d3){_0x13ba9a[_0x911a('0x41')]=_0x3e78d3;if(_0x35676e['query']['includeAll']){_0x28d8e4['include']=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x28d8e4);})['then'](function(_0x3229f3){_0x13ba9a[_0x911a('0x42')]=_0x3229f3;return _0x13ba9a;})[_0x911a('0x27')](respondWithFilteredResult(_0x406b62,_0x28d8e4))[_0x911a('0x43')](handleError(_0x406b62,null));};exports[_0x911a('0x44')]=function(_0x5469c6,_0x335202){var _0x1716fc={'raw':![],'where':{'id':_0x5469c6[_0x911a('0x45')]['id']}},_0x35e283={};_0x35e283[_0x911a('0x30')]=_[_0x911a('0x32')](db[_0x911a('0x2c')][_0x911a('0x46')]);_0x35e283[_0x911a('0x31')]=_['keys'](_0x5469c6[_0x911a('0x31')]);_0x35e283[_0x911a('0x3a')]=_['intersection'](_0x35e283['model'],_0x35e283[_0x911a('0x31')]);_0x1716fc['attributes']=_[_0x911a('0x33')](_0x35e283[_0x911a('0x30')],qs[_0x911a('0x34')](_0x5469c6[_0x911a('0x31')][_0x911a('0x34')]));_0x1716fc[_0x911a('0x35')]=_0x1716fc[_0x911a('0x35')][_0x911a('0x47')]?_0x1716fc['attributes']:_0x35e283[_0x911a('0x30')];if(_0x5469c6['query']['includeAll']){_0x1716fc[_0x911a('0x48')]=[{'all':!![]}];}_0x1716fc=_['merge']({},_0x1716fc,_0x5469c6[_0x911a('0x40')]);return db[_0x911a('0x2c')]['find'](_0x1716fc)['then'](handleEntityNotFound(_0x335202,null))[_0x911a('0x27')](respondWithResult(_0x335202,null))[_0x911a('0x43')](handleError(_0x335202,null));};exports[_0x911a('0x49')]=function(_0x3a45ea,_0x8931f5){return db[_0x911a('0x2c')][_0x911a('0x49')](_0x3a45ea[_0x911a('0x4a')],{})[_0x911a('0x27')](respondWithResult(_0x8931f5,0xc9))['catch'](handleError(_0x8931f5,null));};exports[_0x911a('0x25')]=function(_0x2c3a11,_0x15a57a){if(_0x2c3a11[_0x911a('0x4a')]['id']){delete _0x2c3a11[_0x911a('0x4a')]['id'];}return db[_0x911a('0x2c')][_0x911a('0x4b')]({'where':{'id':_0x2c3a11[_0x911a('0x45')]['id']}})[_0x911a('0x27')](handleEntityNotFound(_0x15a57a,null))['then'](saveUpdates(_0x2c3a11[_0x911a('0x4a')],null))[_0x911a('0x27')](respondWithResult(_0x15a57a,null))[_0x911a('0x43')](handleError(_0x15a57a,null));};exports[_0x911a('0x26')]=function(_0x590ab2,_0x159c7d){return db[_0x911a('0x2c')]['find']({'where':{'id':_0x590ab2[_0x911a('0x45')]['id']}})[_0x911a('0x27')](handleEntityNotFound(_0x159c7d,null))['then'](removeEntity(_0x159c7d,null))['catch'](handleError(_0x159c7d,null));};exports[_0x911a('0x4c')]=function(_0x39b6da,_0x8af4be,_0x54ced2){var _0x4318d2={};var _0x48e237={};var _0x407048;var _0x204d3b;return db[_0x911a('0x2c')][_0x911a('0x4d')]({'where':{'id':_0x39b6da[_0x911a('0x45')]['id']}})['then'](handleEntityNotFound(_0x8af4be,null))[_0x911a('0x27')](function(_0x1eed6a){if(_0x1eed6a){_0x407048=_0x1eed6a;_0x48e237['model']=_[_0x911a('0x32')](db['VtigerField'][_0x911a('0x46')]);_0x48e237['query']=_[_0x911a('0x32')](_0x39b6da[_0x911a('0x31')]);_0x48e237['filters']=_[_0x911a('0x33')](_0x48e237[_0x911a('0x30')],_0x48e237[_0x911a('0x31')]);_0x4318d2['attributes']=_[_0x911a('0x33')](_0x48e237[_0x911a('0x30')],qs[_0x911a('0x34')](_0x39b6da['query'][_0x911a('0x34')]));_0x4318d2[_0x911a('0x35')]=_0x4318d2[_0x911a('0x35')]['length']?_0x4318d2[_0x911a('0x35')]:_0x48e237[_0x911a('0x30')];_0x4318d2[_0x911a('0x38')]=qs[_0x911a('0x39')](_0x39b6da['query'][_0x911a('0x39')]);_0x4318d2['where']=qs[_0x911a('0x3a')](_[_0x911a('0x3b')](_0x39b6da[_0x911a('0x31')],_0x48e237['filters']));if(_0x39b6da['query'][_0x911a('0x3c')]){_0x4318d2[_0x911a('0x3e')]=_[_0x911a('0x3d')](_0x4318d2[_0x911a('0x3e')],{'$or':_[_0x911a('0x2b')](_0x4318d2[_0x911a('0x35')],function(_0x1e8932){var _0x56be03={};_0x56be03[_0x1e8932]={'$like':'%'+_0x39b6da['query'][_0x911a('0x3c')]+'%'};return _0x56be03;})});}_0x4318d2=_[_0x911a('0x3d')]({},_0x4318d2,_0x39b6da[_0x911a('0x40')]);return _0x407048[_0x911a('0x4c')](_0x4318d2);}})[_0x911a('0x27')](function(_0x281e5d){if(_0x281e5d){_0x204d3b=_0x281e5d[_0x911a('0x47')];if(!_0x39b6da['query'][_0x911a('0x36')](_0x911a('0x37'))){_0x4318d2['limit']=qs[_0x911a('0x22')](_0x39b6da[_0x911a('0x31')]['limit']);_0x4318d2[_0x911a('0x20')]=qs[_0x911a('0x20')](_0x39b6da[_0x911a('0x31')]['offset']);}return _0x407048['getFields'](_0x4318d2);}})[_0x911a('0x27')](function(_0x4fe24c){if(_0x4fe24c){return _0x4fe24c?{'count':_0x204d3b,'rows':_0x4fe24c}:null;}})['then'](respondWithResult(_0x8af4be,null))[_0x911a('0x43')](handleError(_0x8af4be,null));};exports[_0x911a('0x4e')]=function(_0x2ffece,_0x50c680,_0x1fd20b){var _0x3695c7={};var _0xcb7892={};var _0x185784;var _0x5233e0;return db['VtigerConfiguration'][_0x911a('0x4d')]({'where':{'id':_0x2ffece[_0x911a('0x45')]['id']}})[_0x911a('0x27')](handleEntityNotFound(_0x50c680,null))[_0x911a('0x27')](function(_0x4346f6){if(_0x4346f6){_0x185784=_0x4346f6;_0xcb7892[_0x911a('0x30')]=_[_0x911a('0x32')](db[_0x911a('0x4f')][_0x911a('0x46')]);_0xcb7892[_0x911a('0x31')]=_[_0x911a('0x32')](_0x2ffece['query']);_0xcb7892['filters']=_[_0x911a('0x33')](_0xcb7892[_0x911a('0x30')],_0xcb7892[_0x911a('0x31')]);_0x3695c7[_0x911a('0x35')]=_['intersection'](_0xcb7892[_0x911a('0x30')],qs['fields'](_0x2ffece[_0x911a('0x31')][_0x911a('0x34')]));_0x3695c7[_0x911a('0x35')]=_0x3695c7['attributes'][_0x911a('0x47')]?_0x3695c7[_0x911a('0x35')]:_0xcb7892[_0x911a('0x30')];_0x3695c7[_0x911a('0x38')]=qs[_0x911a('0x39')](_0x2ffece[_0x911a('0x31')]['sort']);_0x3695c7['where']=qs[_0x911a('0x3a')](_[_0x911a('0x3b')](_0x2ffece['query'],_0xcb7892[_0x911a('0x3a')]));if(_0x2ffece['query'][_0x911a('0x3c')]){_0x3695c7['where']=_[_0x911a('0x3d')](_0x3695c7['where'],{'$or':_[_0x911a('0x2b')](_0x3695c7[_0x911a('0x35')],function(_0x3c2b6a){var _0x3eae96={};_0x3eae96[_0x3c2b6a]={'$like':'%'+_0x2ffece[_0x911a('0x31')][_0x911a('0x3c')]+'%'};return _0x3eae96;})});}_0x3695c7=_[_0x911a('0x3d')]({},_0x3695c7,_0x2ffece['options']);return _0x185784[_0x911a('0x4e')](_0x3695c7);}})[_0x911a('0x27')](function(_0x5f29ce){if(_0x5f29ce){_0x5233e0=_0x5f29ce[_0x911a('0x47')];if(!_0x2ffece[_0x911a('0x31')][_0x911a('0x36')](_0x911a('0x37'))){_0x3695c7['limit']=qs[_0x911a('0x22')](_0x2ffece[_0x911a('0x31')]['limit']);_0x3695c7[_0x911a('0x20')]=qs[_0x911a('0x20')](_0x2ffece['query'][_0x911a('0x20')]);}return _0x185784[_0x911a('0x4e')](_0x3695c7);}})[_0x911a('0x27')](function(_0x2baf65){if(_0x2baf65){return _0x2baf65?{'count':_0x5233e0,'rows':_0x2baf65}:null;}})[_0x911a('0x27')](respondWithResult(_0x50c680,null))[_0x911a('0x43')](handleError(_0x50c680,null));};exports['getDescriptions']=function(_0x485da2,_0x5a7645,_0x1a387a){var _0x372d89={};var _0xc21d42={};var _0x59a4b7;var _0x1be84c;return db[_0x911a('0x2c')][_0x911a('0x4d')]({'where':{'id':_0x485da2[_0x911a('0x45')]['id']}})[_0x911a('0x27')](handleEntityNotFound(_0x5a7645,null))[_0x911a('0x27')](function(_0x40de6a){if(_0x40de6a){_0x59a4b7=_0x40de6a;_0xc21d42['model']=_[_0x911a('0x32')](db[_0x911a('0x4f')][_0x911a('0x46')]);_0xc21d42[_0x911a('0x31')]=_['keys'](_0x485da2[_0x911a('0x31')]);_0xc21d42['filters']=_[_0x911a('0x33')](_0xc21d42[_0x911a('0x30')],_0xc21d42[_0x911a('0x31')]);_0x372d89[_0x911a('0x35')]=_[_0x911a('0x33')](_0xc21d42[_0x911a('0x30')],qs[_0x911a('0x34')](_0x485da2[_0x911a('0x31')][_0x911a('0x34')]));_0x372d89['attributes']=_0x372d89[_0x911a('0x35')][_0x911a('0x47')]?_0x372d89[_0x911a('0x35')]:_0xc21d42[_0x911a('0x30')];_0x372d89[_0x911a('0x38')]=qs[_0x911a('0x39')](_0x485da2[_0x911a('0x31')][_0x911a('0x39')]);_0x372d89[_0x911a('0x3e')]=qs[_0x911a('0x3a')](_[_0x911a('0x3b')](_0x485da2['query'],_0xc21d42[_0x911a('0x3a')]));if(_0x485da2[_0x911a('0x31')][_0x911a('0x3c')]){_0x372d89['where']=_[_0x911a('0x3d')](_0x372d89['where'],{'$or':_[_0x911a('0x2b')](_0x372d89[_0x911a('0x35')],function(_0x59d7e6){var _0x325fe1={};_0x325fe1[_0x59d7e6]={'$like':'%'+_0x485da2[_0x911a('0x31')]['filter']+'%'};return _0x325fe1;})});}_0x372d89=_[_0x911a('0x3d')]({},_0x372d89,_0x485da2[_0x911a('0x40')]);return _0x59a4b7[_0x911a('0x50')](_0x372d89);}})[_0x911a('0x27')](function(_0x1c50d6){if(_0x1c50d6){_0x1be84c=_0x1c50d6[_0x911a('0x47')];if(!_0x485da2[_0x911a('0x31')]['hasOwnProperty'](_0x911a('0x37'))){_0x372d89[_0x911a('0x22')]=qs[_0x911a('0x22')](_0x485da2[_0x911a('0x31')][_0x911a('0x22')]);_0x372d89[_0x911a('0x20')]=qs[_0x911a('0x20')](_0x485da2['query'][_0x911a('0x20')]);}return _0x59a4b7[_0x911a('0x50')](_0x372d89);}})[_0x911a('0x27')](function(_0x358741){if(_0x358741){return _0x358741?{'count':_0x1be84c,'rows':_0x358741}:null;}})[_0x911a('0x27')](respondWithResult(_0x5a7645,null))[_0x911a('0x43')](handleError(_0x5a7645,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index d773395..0b303d7 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 _0x60af=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x60af,0x82));var _0xf60a=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0x60af[_0x2134b7];return _0x6c5914;};'use strict';var _=require(_0xf60a('0x0'));var util=require(_0xf60a('0x1'));var logger=require(_0xf60a('0x2'))(_0xf60a('0x3'));var moment=require(_0xf60a('0x4'));var BPromise=require(_0xf60a('0x5'));var rp=require(_0xf60a('0x6'));var fs=require('fs');var path=require(_0xf60a('0x7'));var rimraf=require('rimraf');var config=require(_0xf60a('0x8'));var attributes=require(_0xf60a('0x9'));module[_0xf60a('0xa')]=function(_0x3c3c4f,_0x4f508b){return _0x3c3c4f[_0xf60a('0xb')](_0xf60a('0xc'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bb8=['api','moment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash','util','../../config/logger'];(function(_0x49ad79,_0x48ee93){var _0xa4e38a=function(_0x4925c7){while(--_0x4925c7){_0x49ad79['push'](_0x49ad79['shift']());}};_0xa4e38a(++_0x48ee93);}(_0x0bb8,0xb5));var _0x80bb=function(_0x99ddba,_0x2a43b6){_0x99ddba=_0x99ddba-0x0;var _0x14795b=_0x0bb8[_0x99ddba];return _0x14795b;};'use strict';var _=require(_0x80bb('0x0'));var util=require(_0x80bb('0x1'));var logger=require(_0x80bb('0x2'))(_0x80bb('0x3'));var moment=require(_0x80bb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x80bb('0x5'));module[_0x80bb('0x6')]=function(_0x231b76,_0x5eea96){return _0x231b76['define'](_0x80bb('0x7'),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 15a1e25..1ef9e58 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 _0x0c2f=['moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0c2f,0x179));var _0xf0c2=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x0c2f[_0x2e986d];return _0x351c79;};'use strict';var _=require('lodash');var util=require(_0xf0c2('0x0'));var moment=require(_0xf0c2('0x1'));var BPromise=require(_0xf0c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0c2('0x3'))(_0xf0c2('0x4'));var config=require(_0xf0c2('0x5'));var jayson=require(_0xf0c2('0x6'));var client=jayson['client'][_0xf0c2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x27eb55,_0x1c7c01,_0x4acafc){return new BPromise(function(_0x5dab4d,_0x986876){return client[_0xf0c2('0x8')](_0x27eb55,_0x4acafc)[_0xf0c2('0x9')](function(_0x1f7952){logger[_0xf0c2('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x1c7c01,_0xf0c2('0xb'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1c7c01,_0xf0c2('0xb'),JSON[_0xf0c2('0xc')](_0x1f7952));if(_0x1f7952[_0xf0c2('0xd')]){if(_0x1f7952[_0xf0c2('0xd')]['code']===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1c7c01,_0x1f7952['error'][_0xf0c2('0xe')]);return _0x986876(_0x1f7952[_0xf0c2('0xd')][_0xf0c2('0xe')]);}logger[_0xf0c2('0xd')](_0xf0c2('0xf'),_0x1c7c01,_0x1f7952['error'][_0xf0c2('0xe')]);return _0x5dab4d(_0x1f7952[_0xf0c2('0xd')][_0xf0c2('0xe')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x1c7c01,'request\x20sent');_0x5dab4d(_0x1f7952[_0xf0c2('0x10')]['message']);}})[_0xf0c2('0x11')](function(_0xd9425d){logger['error'](_0xf0c2('0xf'),_0x1c7c01,_0xd9425d);_0x986876(_0xd9425d);});});} \ No newline at end of file +var _0x3116=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash'];(function(_0x5bdec6,_0x6a580){var _0x3cb53d=function(_0x5d3aad){while(--_0x5d3aad){_0x5bdec6['push'](_0x5bdec6['shift']());}};_0x3cb53d(++_0x6a580);}(_0x3116,0x1cd));var _0x6311=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x3116[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x6311('0x0'));var util=require(_0x6311('0x1'));var moment=require(_0x6311('0x2'));var BPromise=require(_0x6311('0x3'));var rs=require(_0x6311('0x4'));var fs=require('fs');var Redis=require(_0x6311('0x5'));var db=require(_0x6311('0x6'))['db'];var utils=require(_0x6311('0x7'));var logger=require(_0x6311('0x8'))(_0x6311('0x9'));var config=require(_0x6311('0xa'));var jayson=require(_0x6311('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a9203,_0x46c53e,_0x494e37){return new BPromise(function(_0x79c4e8,_0x544cbe){return client[_0x6311('0xc')](_0x5a9203,_0x494e37)['then'](function(_0x432724){logger[_0x6311('0xd')](_0x6311('0xe'),_0x46c53e,'request\x20sent');logger['debug'](_0x6311('0xf'),_0x46c53e,'request\x20sent',JSON[_0x6311('0x10')](_0x432724));if(_0x432724[_0x6311('0x11')]){if(_0x432724[_0x6311('0x11')][_0x6311('0x12')]===0x1f4){logger[_0x6311('0x11')](_0x6311('0xe'),_0x46c53e,_0x432724[_0x6311('0x11')][_0x6311('0x13')]);return _0x544cbe(_0x432724[_0x6311('0x11')][_0x6311('0x13')]);}logger[_0x6311('0x11')](_0x6311('0xe'),_0x46c53e,_0x432724[_0x6311('0x11')][_0x6311('0x13')]);return _0x79c4e8(_0x432724[_0x6311('0x11')][_0x6311('0x13')]);}else{logger[_0x6311('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x46c53e,_0x6311('0x14'));_0x79c4e8(_0x432724[_0x6311('0x15')][_0x6311('0x13')]);}})['catch'](function(_0x63b1c){logger['error'](_0x6311('0xe'),_0x46c53e,_0x63b1c);_0x544cbe(_0x63b1c);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index acb3771..b96e668 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 _0xde10=['destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x52db3e,_0x4808e5){var _0x17f1fd=function(_0x33f746){while(--_0x33f746){_0x52db3e['push'](_0x52db3e['shift']());}};_0x17f1fd(++_0x4808e5);}(_0xde10,0x145));var _0x0de1=function(_0x30dfc0,_0x30c92e){_0x30dfc0=_0x30dfc0-0x0;var _0x302dae=_0xde10[_0x30dfc0];return _0x302dae;};'use strict';var multer=require(_0x0de1('0x0'));var util=require(_0x0de1('0x1'));var path=require(_0x0de1('0x2'));var timeout=require('connect-timeout');var express=require(_0x0de1('0x3'));var router=express[_0x0de1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0de1('0x5'));var interaction=require(_0x0de1('0x6'));var config=require(_0x0de1('0x7'));var controller=require(_0x0de1('0x8'));router[_0x0de1('0x9')]('/',auth[_0x0de1('0xa')](),controller['index']);router[_0x0de1('0x9')]('/:id',auth[_0x0de1('0xa')](),controller[_0x0de1('0xb')]);router[_0x0de1('0xc')]('/',auth[_0x0de1('0xa')](),controller[_0x0de1('0xd')]);router[_0x0de1('0xe')](_0x0de1('0xf'),auth[_0x0de1('0xa')](),controller[_0x0de1('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0de1('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb54b=['/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x4e5f40,_0x3bf5d2){var _0x7d58be=function(_0xd91e4d){while(--_0xd91e4d){_0x4e5f40['push'](_0x4e5f40['shift']());}};_0x7d58be(++_0x3bf5d2);}(_0xb54b,0x74));var _0xbb54=function(_0x3291d4,_0x24e104){_0x3291d4=_0x3291d4-0x0;var _0x2120cd=_0xb54b[_0x3291d4];return _0x2120cd;};'use strict';var multer=require('multer');var util=require(_0xbb54('0x0'));var path=require(_0xbb54('0x1'));var timeout=require(_0xbb54('0x2'));var express=require(_0xbb54('0x3'));var router=express['Router']();var fs_extra=require(_0xbb54('0x4'));var auth=require(_0xbb54('0x5'));var interaction=require(_0xbb54('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0xbb54('0x7')]('/',auth[_0xbb54('0x8')](),controller[_0xbb54('0x9')]);router[_0xbb54('0x7')](_0xbb54('0xa'),auth['isAuthenticated'](),controller[_0xbb54('0xb')]);router[_0xbb54('0xc')]('/',auth[_0xbb54('0x8')](),controller[_0xbb54('0xd')]);router[_0xbb54('0xe')](_0xbb54('0xa'),auth[_0xbb54('0x8')](),controller[_0xbb54('0xf')]);router['delete'](_0xbb54('0xa'),auth[_0xbb54('0x8')](),controller[_0xbb54('0x10')]);module[_0xbb54('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 6919d1b..391e31c 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 _0x23cf=['BOOLEAN','sequelize','exports','string','customVariable','picklist','STRING','ENUM','variable'];(function(_0x42918d,_0x44b0cf){var _0xf645a8=function(_0x4a9504){while(--_0x4a9504){_0x42918d['push'](_0x42918d['shift']());}};_0xf645a8(++_0x44b0cf);}(_0x23cf,0x133));var _0xf23c=function(_0x546e30,_0x17eec0){_0x546e30=_0x546e30-0x0;var _0x3ff167=_0x23cf[_0x546e30];return _0x3ff167;};'use strict';var Sequelize=require(_0xf23c('0x0'));module[_0xf23c('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf23c('0x2'),'variable',_0xf23c('0x3'),'keyValue',_0xf23c('0x4')),'defaultValue':_0xf23c('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf23c('0x5')]},'keyType':{'type':Sequelize[_0xf23c('0x6')](_0xf23c('0x2'),_0xf23c('0x7'),_0xf23c('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf23c('0x5')]},'customField':{'type':Sequelize[_0xf23c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf23c('0x5')]}}; \ No newline at end of file +var _0x6cb4=['customVariable','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x1998bb,_0x1f1da1){var _0x4ae4c9=function(_0x4741e8){while(--_0x4741e8){_0x1998bb['push'](_0x1998bb['shift']());}};_0x4ae4c9(++_0x1f1da1);}(_0x6cb4,0x83));var _0x46cb=function(_0x4fe94d,_0x3b44a8){_0x4fe94d=_0x4fe94d-0x0;var _0x976f6f=_0x6cb4[_0x4fe94d];return _0x976f6f;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'type':{'type':Sequelize[_0x46cb('0x2')](_0x46cb('0x3'),_0x46cb('0x4'),_0x46cb('0x5'),'keyValue',_0x46cb('0x6')),'defaultValue':_0x46cb('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x46cb('0x2')]('string',_0x46cb('0x4'),_0x46cb('0x5'))},'keyContent':{'type':Sequelize[_0x46cb('0x7')]},'idField':{'type':Sequelize[_0x46cb('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x46cb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b2409dc..e34821b 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 _0x621a=['map','VIRTUAL','filter','options','VtigerField','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x621a,0x1a4));var _0xa621=function(_0x376866,_0x58b7f7){_0x376866=_0x376866-0x0;var _0x201d5b=_0x621a[_0x376866];return _0x201d5b;};'use strict';var emlformat=require(_0xa621('0x0'));var rimraf=require(_0xa621('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa621('0x2'));var rp=require(_0xa621('0x3'));var moment=require(_0xa621('0x4'));var BPromise=require(_0xa621('0x5'));var Mustache=require(_0xa621('0x6'));var util=require('util');var path=require(_0xa621('0x7'));var sox=require(_0xa621('0x8'));var csv=require(_0xa621('0x9'));var ejs=require(_0xa621('0xa'));var fs=require('fs');var fs_extra=require(_0xa621('0xb'));var _=require(_0xa621('0xc'));var squel=require(_0xa621('0xd'));var crypto=require(_0xa621('0xe'));var jsforce=require(_0xa621('0xf'));var deskjs=require(_0xa621('0x10'));var toCsv=require(_0xa621('0x9'));var querystring=require(_0xa621('0x11'));var Papa=require(_0xa621('0x12'));var Redis=require(_0xa621('0x13'));var authService=require(_0xa621('0x14'));var qs=require(_0xa621('0x15'));var as=require(_0xa621('0x16'));var hardwareService=require(_0xa621('0x17'));var logger=require(_0xa621('0x18'))(_0xa621('0x19'));var utils=require(_0xa621('0x1a'));var config=require(_0xa621('0x1b'));var licenseUtil=require(_0xa621('0x1c'));var db=require(_0xa621('0x1d'))['db'];function respondWithStatusCode(_0x4cfe61,_0x409d2d){_0x409d2d=_0x409d2d||0xcc;return function(_0x343545){if(_0x343545){return _0x4cfe61['sendStatus'](_0x409d2d);}return _0x4cfe61[_0xa621('0x1e')](_0x409d2d)[_0xa621('0x1f')]();};}function respondWithResult(_0x4080fd,_0x541493){_0x541493=_0x541493||0xc8;return function(_0x4e02c3){if(_0x4e02c3){return _0x4080fd['status'](_0x541493)[_0xa621('0x20')](_0x4e02c3);}};}function respondWithFilteredResult(_0x4a87d5,_0x5c3c41){return function(_0x49eddd){if(_0x49eddd){var _0x52dd7b=typeof _0x5c3c41[_0xa621('0x21')]==='undefined'&&typeof _0x5c3c41['limit']==='undefined';var _0x46130c=_0x49eddd['count'];var _0x1cbd87=_0x52dd7b?0x0:_0x5c3c41['offset'];var _0x48a290=_0x52dd7b?_0x49eddd[_0xa621('0x22')]:_0x5c3c41[_0xa621('0x21')]+_0x5c3c41[_0xa621('0x23')];var _0x55848b;if(_0x48a290>=_0x46130c){_0x48a290=_0x46130c;_0x55848b=0xc8;}else{_0x55848b=0xce;}_0x4a87d5[_0xa621('0x1e')](_0x55848b);return _0x4a87d5[_0xa621('0x24')](_0xa621('0x25'),_0x1cbd87+'-'+_0x48a290+'/'+_0x46130c)[_0xa621('0x20')](_0x49eddd);}return null;};}function patchUpdates(_0xe97996){return function(_0x22d770){try{jsonpatch[_0xa621('0x26')](_0x22d770,_0xe97996,!![]);}catch(_0x5846ac){return BPromise[_0xa621('0x27')](_0x5846ac);}return _0x22d770[_0xa621('0x28')]();};}function saveUpdates(_0x9762db,_0xe04255){return function(_0x4a5888){if(_0x4a5888){return _0x4a5888[_0xa621('0x29')](_0x9762db)['then'](function(_0x2148a8){return _0x2148a8;});}return null;};}function removeEntity(_0x5e2cca,_0x4a3d5e){return function(_0x594523){if(_0x594523){return _0x594523[_0xa621('0x2a')]()[_0xa621('0x2b')](function(){_0x5e2cca['status'](0xcc)[_0xa621('0x1f')]();});}};}function handleEntityNotFound(_0x4f4c42,_0x3d020c){return function(_0x3ab0bc){if(!_0x3ab0bc){_0x4f4c42[_0xa621('0x2c')](0x194);}return _0x3ab0bc;};}function handleError(_0x28e015,_0x49c4cc){_0x49c4cc=_0x49c4cc||0x1f4;return function(_0xf67d7c){logger['error'](_0xf67d7c[_0xa621('0x2d')]);if(_0xf67d7c[_0xa621('0x2e')]){delete _0xf67d7c[_0xa621('0x2e')];}_0x28e015[_0xa621('0x1e')](_0x49c4cc)[_0xa621('0x2f')](_0xf67d7c);};}exports[_0xa621('0x30')]=function(_0x6c7eae,_0x2890ae){var _0x4c8228={},_0x2c8275={},_0x2249f9={'count':0x0,'rows':[]};var _0x3ea04c=_['map'](db['VtigerField'][_0xa621('0x31')],function(_0x96fbe3){return{'name':_0x96fbe3[_0xa621('0x32')],'type':_0x96fbe3['type']['key']};});_0x2c8275[_0xa621('0x33')]=_['map'](_0x3ea04c,_0xa621('0x2e'));_0x2c8275[_0xa621('0x34')]=_[_0xa621('0x35')](_0x6c7eae[_0xa621('0x34')]);_0x2c8275['filters']=_[_0xa621('0x36')](_0x2c8275['model'],_0x2c8275['query']);_0x4c8228[_0xa621('0x37')]=_['intersection'](_0x2c8275[_0xa621('0x33')],qs[_0xa621('0x38')](_0x6c7eae['query']['fields']));_0x4c8228[_0xa621('0x37')]=_0x4c8228['attributes'][_0xa621('0x39')]?_0x4c8228[_0xa621('0x37')]:_0x2c8275[_0xa621('0x33')];if(!_0x6c7eae['query'][_0xa621('0x3a')](_0xa621('0x3b'))){_0x4c8228[_0xa621('0x23')]=qs[_0xa621('0x23')](_0x6c7eae[_0xa621('0x34')][_0xa621('0x23')]);_0x4c8228[_0xa621('0x21')]=qs[_0xa621('0x21')](_0x6c7eae[_0xa621('0x34')][_0xa621('0x21')]);}_0x4c8228[_0xa621('0x3c')]=qs['sort'](_0x6c7eae['query'][_0xa621('0x3d')]);_0x4c8228['where']=qs[_0xa621('0x3e')](_[_0xa621('0x3f')](_0x6c7eae[_0xa621('0x34')],_0x2c8275['filters']),_0x3ea04c);if(_0x6c7eae['query']['filter']){_0x4c8228[_0xa621('0x40')]=_[_0xa621('0x41')](_0x4c8228[_0xa621('0x40')],{'$or':_[_0xa621('0x42')](_0x3ea04c,function(_0x17015a){if(_0x17015a['type']!==_0xa621('0x43')){var _0x20a262={};_0x20a262[_0x17015a[_0xa621('0x2e')]]={'$like':'%'+_0x6c7eae[_0xa621('0x34')][_0xa621('0x44')]+'%'};return _0x20a262;}})});}_0x4c8228=_[_0xa621('0x41')]({},_0x4c8228,_0x6c7eae[_0xa621('0x45')]);var _0x11f12a={'where':_0x4c8228['where']};return db[_0xa621('0x46')]['count'](_0x11f12a)[_0xa621('0x2b')](function(_0x22eac0){_0x2249f9['count']=_0x22eac0;if(_0x6c7eae[_0xa621('0x34')][_0xa621('0x47')]){_0x4c8228[_0xa621('0x48')]=[{'all':!![]}];}return db[_0xa621('0x46')][_0xa621('0x49')](_0x4c8228);})[_0xa621('0x2b')](function(_0x459b46){_0x2249f9[_0xa621('0x4a')]=_0x459b46;return _0x2249f9;})['then'](respondWithFilteredResult(_0x2890ae,_0x4c8228))[_0xa621('0x4b')](handleError(_0x2890ae,null));};exports[_0xa621('0x4c')]=function(_0x3f83be,_0x5d06e2){var _0x290475={'raw':!![],'where':{'id':_0x3f83be[_0xa621('0x4d')]['id']}},_0x536cfc={};_0x536cfc[_0xa621('0x33')]=_['keys'](db['VtigerField']['rawAttributes']);_0x536cfc['query']=_[_0xa621('0x35')](_0x3f83be['query']);_0x536cfc[_0xa621('0x3e')]=_['intersection'](_0x536cfc[_0xa621('0x33')],_0x536cfc[_0xa621('0x34')]);_0x290475[_0xa621('0x37')]=_['intersection'](_0x536cfc['model'],qs[_0xa621('0x38')](_0x3f83be[_0xa621('0x34')]['fields']));_0x290475[_0xa621('0x37')]=_0x290475[_0xa621('0x37')]['length']?_0x290475[_0xa621('0x37')]:_0x536cfc[_0xa621('0x33')];if(_0x3f83be[_0xa621('0x34')][_0xa621('0x47')]){_0x290475[_0xa621('0x48')]=[{'all':!![]}];}_0x290475=_[_0xa621('0x41')]({},_0x290475,_0x3f83be['options']);return db[_0xa621('0x46')][_0xa621('0x4e')](_0x290475)['then'](handleEntityNotFound(_0x5d06e2,null))[_0xa621('0x2b')](respondWithResult(_0x5d06e2,null))[_0xa621('0x4b')](handleError(_0x5d06e2,null));};exports[_0xa621('0x4f')]=function(_0x3c1718,_0x2bfdfa){return db[_0xa621('0x46')][_0xa621('0x4f')](_0x3c1718[_0xa621('0x50')],{})[_0xa621('0x2b')](respondWithResult(_0x2bfdfa,0xc9))[_0xa621('0x4b')](handleError(_0x2bfdfa,null));};exports[_0xa621('0x29')]=function(_0x2c70aa,_0x301617){if(_0x2c70aa[_0xa621('0x50')]['id']){delete _0x2c70aa[_0xa621('0x50')]['id'];}return db[_0xa621('0x46')][_0xa621('0x4e')]({'where':{'id':_0x2c70aa[_0xa621('0x4d')]['id']}})[_0xa621('0x2b')](handleEntityNotFound(_0x301617,null))['then'](saveUpdates(_0x2c70aa[_0xa621('0x50')],null))['then'](respondWithResult(_0x301617,null))['catch'](handleError(_0x301617,null));};exports['destroy']=function(_0x5c4128,_0x1005f2){return db[_0xa621('0x46')][_0xa621('0x4e')]({'where':{'id':_0x5c4128[_0xa621('0x4d')]['id']}})[_0xa621('0x2b')](handleEntityNotFound(_0x1005f2,null))[_0xa621('0x2b')](removeEntity(_0x1005f2,null))[_0xa621('0x4b')](handleError(_0x1005f2,null));}; \ No newline at end of file +var _0xf7a6=['set','apply','reject','update','then','destroy','end','error','stack','send','index','VtigerField','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7a6,0x14c));var _0x6f7a=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xf7a6[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0x6f7a('0x0'));var rimraf=require(_0x6f7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f7a('0x2'));var rp=require('request-promise');var moment=require(_0x6f7a('0x3'));var BPromise=require(_0x6f7a('0x4'));var Mustache=require('mustache');var util=require(_0x6f7a('0x5'));var path=require(_0x6f7a('0x6'));var sox=require(_0x6f7a('0x7'));var csv=require(_0x6f7a('0x8'));var ejs=require(_0x6f7a('0x9'));var fs=require('fs');var fs_extra=require(_0x6f7a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6f7a('0xb'));var deskjs=require(_0x6f7a('0xc'));var toCsv=require(_0x6f7a('0x8'));var querystring=require('querystring');var Papa=require(_0x6f7a('0xd'));var Redis=require(_0x6f7a('0xe'));var authService=require(_0x6f7a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6f7a('0x10'));var hardwareService=require(_0x6f7a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6f7a('0x12'));var config=require(_0x6f7a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f7a('0x14'))['db'];function respondWithStatusCode(_0x442adb,_0xae818a){_0xae818a=_0xae818a||0xcc;return function(_0x1d0db9){if(_0x1d0db9){return _0x442adb[_0x6f7a('0x15')](_0xae818a);}return _0x442adb[_0x6f7a('0x16')](_0xae818a)['end']();};}function respondWithResult(_0x255af0,_0x3e9b5a){_0x3e9b5a=_0x3e9b5a||0xc8;return function(_0x207343){if(_0x207343){return _0x255af0[_0x6f7a('0x16')](_0x3e9b5a)[_0x6f7a('0x17')](_0x207343);}};}function respondWithFilteredResult(_0x4a3045,_0x24c457){return function(_0x223f37){if(_0x223f37){var _0x269f92=typeof _0x24c457[_0x6f7a('0x18')]===_0x6f7a('0x19')&&typeof _0x24c457[_0x6f7a('0x1a')]===_0x6f7a('0x19');var _0x45e872=_0x223f37[_0x6f7a('0x1b')];var _0x35bfaf=_0x269f92?0x0:_0x24c457['offset'];var _0x3de36a=_0x269f92?_0x223f37[_0x6f7a('0x1b')]:_0x24c457['offset']+_0x24c457['limit'];var _0x2527e9;if(_0x3de36a>=_0x45e872){_0x3de36a=_0x45e872;_0x2527e9=0xc8;}else{_0x2527e9=0xce;}_0x4a3045['status'](_0x2527e9);return _0x4a3045[_0x6f7a('0x1c')]('Content-Range',_0x35bfaf+'-'+_0x3de36a+'/'+_0x45e872)[_0x6f7a('0x17')](_0x223f37);}return null;};}function patchUpdates(_0x26a3fb){return function(_0x4ccf2f){try{jsonpatch[_0x6f7a('0x1d')](_0x4ccf2f,_0x26a3fb,!![]);}catch(_0x322098){return BPromise[_0x6f7a('0x1e')](_0x322098);}return _0x4ccf2f['save']();};}function saveUpdates(_0xa964f9,_0x41ee6a){return function(_0x5d57a1){if(_0x5d57a1){return _0x5d57a1[_0x6f7a('0x1f')](_0xa964f9)[_0x6f7a('0x20')](function(_0x410fa4){return _0x410fa4;});}return null;};}function removeEntity(_0x3285ca,_0x45ced9){return function(_0xb4f4ea){if(_0xb4f4ea){return _0xb4f4ea[_0x6f7a('0x21')]()[_0x6f7a('0x20')](function(){_0x3285ca[_0x6f7a('0x16')](0xcc)[_0x6f7a('0x22')]();});}};}function handleEntityNotFound(_0x117821,_0x6b6a17){return function(_0x4b1be9){if(!_0x4b1be9){_0x117821[_0x6f7a('0x15')](0x194);}return _0x4b1be9;};}function handleError(_0x1dfdf2,_0x388543){_0x388543=_0x388543||0x1f4;return function(_0x49f55a){logger[_0x6f7a('0x23')](_0x49f55a[_0x6f7a('0x24')]);if(_0x49f55a['name']){delete _0x49f55a['name'];}_0x1dfdf2[_0x6f7a('0x16')](_0x388543)[_0x6f7a('0x25')](_0x49f55a);};}exports[_0x6f7a('0x26')]=function(_0x500f1c,_0x4ed487){var _0x3dc59c={},_0x2b56a3={},_0x4eb713={'count':0x0,'rows':[]};var _0x53e273=_['map'](db[_0x6f7a('0x27')][_0x6f7a('0x28')],function(_0x177375){return{'name':_0x177375[_0x6f7a('0x29')],'type':_0x177375[_0x6f7a('0x2a')][_0x6f7a('0x2b')]};});_0x2b56a3[_0x6f7a('0x2c')]=_[_0x6f7a('0x2d')](_0x53e273,_0x6f7a('0x2e'));_0x2b56a3[_0x6f7a('0x2f')]=_[_0x6f7a('0x30')](_0x500f1c[_0x6f7a('0x2f')]);_0x2b56a3[_0x6f7a('0x31')]=_['intersection'](_0x2b56a3[_0x6f7a('0x2c')],_0x2b56a3['query']);_0x3dc59c[_0x6f7a('0x32')]=_['intersection'](_0x2b56a3['model'],qs[_0x6f7a('0x33')](_0x500f1c[_0x6f7a('0x2f')]['fields']));_0x3dc59c[_0x6f7a('0x32')]=_0x3dc59c[_0x6f7a('0x32')][_0x6f7a('0x34')]?_0x3dc59c['attributes']:_0x2b56a3[_0x6f7a('0x2c')];if(!_0x500f1c['query']['hasOwnProperty'](_0x6f7a('0x35'))){_0x3dc59c[_0x6f7a('0x1a')]=qs['limit'](_0x500f1c[_0x6f7a('0x2f')][_0x6f7a('0x1a')]);_0x3dc59c[_0x6f7a('0x18')]=qs['offset'](_0x500f1c[_0x6f7a('0x2f')][_0x6f7a('0x18')]);}_0x3dc59c[_0x6f7a('0x36')]=qs[_0x6f7a('0x37')](_0x500f1c[_0x6f7a('0x2f')][_0x6f7a('0x37')]);_0x3dc59c[_0x6f7a('0x38')]=qs[_0x6f7a('0x31')](_[_0x6f7a('0x39')](_0x500f1c[_0x6f7a('0x2f')],_0x2b56a3[_0x6f7a('0x31')]),_0x53e273);if(_0x500f1c[_0x6f7a('0x2f')][_0x6f7a('0x3a')]){_0x3dc59c[_0x6f7a('0x38')]=_[_0x6f7a('0x3b')](_0x3dc59c[_0x6f7a('0x38')],{'$or':_[_0x6f7a('0x2d')](_0x53e273,function(_0x5151f4){if(_0x5151f4[_0x6f7a('0x2a')]!==_0x6f7a('0x3c')){var _0x492c43={};_0x492c43[_0x5151f4[_0x6f7a('0x2e')]]={'$like':'%'+_0x500f1c[_0x6f7a('0x2f')][_0x6f7a('0x3a')]+'%'};return _0x492c43;}})});}_0x3dc59c=_[_0x6f7a('0x3b')]({},_0x3dc59c,_0x500f1c['options']);var _0x4d6d31={'where':_0x3dc59c[_0x6f7a('0x38')]};return db[_0x6f7a('0x27')][_0x6f7a('0x1b')](_0x4d6d31)[_0x6f7a('0x20')](function(_0x3e82a5){_0x4eb713['count']=_0x3e82a5;if(_0x500f1c[_0x6f7a('0x2f')]['includeAll']){_0x3dc59c['include']=[{'all':!![]}];}return db[_0x6f7a('0x27')][_0x6f7a('0x3d')](_0x3dc59c);})[_0x6f7a('0x20')](function(_0x145ad9){_0x4eb713[_0x6f7a('0x3e')]=_0x145ad9;return _0x4eb713;})['then'](respondWithFilteredResult(_0x4ed487,_0x3dc59c))[_0x6f7a('0x3f')](handleError(_0x4ed487,null));};exports[_0x6f7a('0x40')]=function(_0x3c53ae,_0xa78135){var _0x5ca9c3={'raw':!![],'where':{'id':_0x3c53ae[_0x6f7a('0x41')]['id']}},_0xb815a2={};_0xb815a2[_0x6f7a('0x2c')]=_[_0x6f7a('0x30')](db[_0x6f7a('0x27')]['rawAttributes']);_0xb815a2[_0x6f7a('0x2f')]=_['keys'](_0x3c53ae[_0x6f7a('0x2f')]);_0xb815a2[_0x6f7a('0x31')]=_[_0x6f7a('0x42')](_0xb815a2[_0x6f7a('0x2c')],_0xb815a2[_0x6f7a('0x2f')]);_0x5ca9c3[_0x6f7a('0x32')]=_[_0x6f7a('0x42')](_0xb815a2['model'],qs['fields'](_0x3c53ae[_0x6f7a('0x2f')][_0x6f7a('0x33')]));_0x5ca9c3[_0x6f7a('0x32')]=_0x5ca9c3['attributes'][_0x6f7a('0x34')]?_0x5ca9c3[_0x6f7a('0x32')]:_0xb815a2[_0x6f7a('0x2c')];if(_0x3c53ae[_0x6f7a('0x2f')][_0x6f7a('0x43')]){_0x5ca9c3['include']=[{'all':!![]}];}_0x5ca9c3=_[_0x6f7a('0x3b')]({},_0x5ca9c3,_0x3c53ae[_0x6f7a('0x44')]);return db[_0x6f7a('0x27')][_0x6f7a('0x45')](_0x5ca9c3)[_0x6f7a('0x20')](handleEntityNotFound(_0xa78135,null))[_0x6f7a('0x20')](respondWithResult(_0xa78135,null))[_0x6f7a('0x3f')](handleError(_0xa78135,null));};exports[_0x6f7a('0x46')]=function(_0x5b22d5,_0xe8583c){return db[_0x6f7a('0x27')]['create'](_0x5b22d5[_0x6f7a('0x47')],{})[_0x6f7a('0x20')](respondWithResult(_0xe8583c,0xc9))[_0x6f7a('0x3f')](handleError(_0xe8583c,null));};exports[_0x6f7a('0x1f')]=function(_0x1ec7c9,_0x4f5a94){if(_0x1ec7c9[_0x6f7a('0x47')]['id']){delete _0x1ec7c9[_0x6f7a('0x47')]['id'];}return db[_0x6f7a('0x27')][_0x6f7a('0x45')]({'where':{'id':_0x1ec7c9[_0x6f7a('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f5a94,null))[_0x6f7a('0x20')](saveUpdates(_0x1ec7c9[_0x6f7a('0x47')],null))[_0x6f7a('0x20')](respondWithResult(_0x4f5a94,null))[_0x6f7a('0x3f')](handleError(_0x4f5a94,null));};exports[_0x6f7a('0x21')]=function(_0x36f9b4,_0x51c8ef){return db[_0x6f7a('0x27')]['find']({'where':{'id':_0x36f9b4[_0x6f7a('0x41')]['id']}})[_0x6f7a('0x20')](handleEntityNotFound(_0x51c8ef,null))[_0x6f7a('0x20')](removeEntity(_0x51c8ef,null))[_0x6f7a('0x3f')](handleError(_0x51c8ef,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 5417733..1e9ecfd 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 _0xcedb=['define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xcedb,0xa1));var _0xbced=function(_0x3e3a09,_0x1b82b5){_0x3e3a09=_0x3e3a09-0x0;var _0x1b5d94=_0xcedb[_0x3e3a09];return _0x1b5d94;};'use strict';var _=require(_0xbced('0x0'));var util=require('util');var logger=require(_0xbced('0x1'))('api');var moment=require(_0xbced('0x2'));var BPromise=require(_0xbced('0x3'));var rp=require(_0xbced('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbced('0x5'));var config=require(_0xbced('0x6'));var attributes=require('./intVtigerField.attributes');module[_0xbced('0x7')]=function(_0x3a58f3,_0x131d4e){return _0x3a58f3[_0xbced('0x8')](_0xbced('0x9'),attributes,{'tableName':_0xbced('0xa'),'paranoid':![],'indexes':[{'name':_0xbced('0xb'),'fields':['idField',_0xbced('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc952=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','moment','path','rimraf','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0xc952,0x72));var _0x2c95=function(_0x534f9f,_0x3f82cf){_0x534f9f=_0x534f9f-0x0;var _0x5ea68f=_0xc952[_0x534f9f];return _0x5ea68f;};'use strict';var _=require(_0x2c95('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2c95('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c95('0x2'));var rimraf=require(_0x2c95('0x3'));var config=require(_0x2c95('0x4'));var attributes=require(_0x2c95('0x5'));module[_0x2c95('0x6')]=function(_0x581812,_0x55aba4){return _0x581812['define'](_0x2c95('0x7'),attributes,{'tableName':_0x2c95('0x8'),'paranoid':![],'indexes':[{'name':_0x2c95('0x9'),'fields':[_0x2c95('0xa'),'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 5a73c26..3ee5693 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 _0x1000=['moment','bluebird','ioredis','../../mysqldb','rpc','client','http','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x6b4173,_0x33679b){var _0x39a374=function(_0x183944){while(--_0x183944){_0x6b4173['push'](_0x6b4173['shift']());}};_0x39a374(++_0x33679b);}(_0x1000,0x1a0));var _0x0100=function(_0x2cb208,_0x44068b){_0x2cb208=_0x2cb208-0x0;var _0x2853db=_0x1000[_0x2cb208];return _0x2853db;};'use strict';var _=require(_0x0100('0x0'));var util=require(_0x0100('0x1'));var moment=require(_0x0100('0x2'));var BPromise=require(_0x0100('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0100('0x4'));var db=require(_0x0100('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0100('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0100('0x7')][_0x0100('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58cd64,_0xe0770b,_0x18cea8){return new BPromise(function(_0x243ddd,_0x45cf77){return client['request'](_0x58cd64,_0x18cea8)['then'](function(_0xc17566){logger[_0x0100('0x9')](_0x0100('0xa'),_0xe0770b,'request\x20sent');logger['debug'](_0x0100('0xb'),_0xe0770b,_0x0100('0xc'),JSON[_0x0100('0xd')](_0xc17566));if(_0xc17566[_0x0100('0xe')]){if(_0xc17566['error'][_0x0100('0xf')]===0x1f4){logger['error'](_0x0100('0xa'),_0xe0770b,_0xc17566[_0x0100('0xe')][_0x0100('0x10')]);return _0x45cf77(_0xc17566[_0x0100('0xe')][_0x0100('0x10')]);}logger[_0x0100('0xe')](_0x0100('0xa'),_0xe0770b,_0xc17566['error'][_0x0100('0x10')]);return _0x243ddd(_0xc17566[_0x0100('0xe')][_0x0100('0x10')]);}else{logger['info'](_0x0100('0xa'),_0xe0770b,_0x0100('0xc'));_0x243ddd(_0xc17566[_0x0100('0x11')][_0x0100('0x10')]);}})[_0x0100('0x12')](function(_0x8f3960){logger[_0x0100('0xe')](_0x0100('0xa'),_0xe0770b,_0x8f3960);_0x45cf77(_0x8f3960);});});} \ No newline at end of file +var _0x5c9d=['VtigerField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4c1ce7,_0x3c9531){var _0x2dcd4f=function(_0x5550fe){while(--_0x5550fe){_0x4c1ce7['push'](_0x4c1ce7['shift']());}};_0x2dcd4f(++_0x3c9531);}(_0x5c9d,0x192));var _0xd5c9=function(_0xabe65e,_0x455177){_0xabe65e=_0xabe65e-0x0;var _0x3da843=_0x5c9d[_0xabe65e];return _0x3da843;};'use strict';var _=require(_0xd5c9('0x0'));var util=require(_0xd5c9('0x1'));var moment=require(_0xd5c9('0x2'));var BPromise=require(_0xd5c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5c9('0x4'));var db=require(_0xd5c9('0x5'))['db'];var utils=require(_0xd5c9('0x6'));var logger=require('../../config/logger')(_0xd5c9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd5c9('0x8')][_0xd5c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f5e52,_0x52a280,_0x107331){return new BPromise(function(_0x418f8f,_0x3fc140){return client[_0xd5c9('0xa')](_0x1f5e52,_0x107331)[_0xd5c9('0xb')](function(_0x345f5a){logger[_0xd5c9('0xc')](_0xd5c9('0xd'),_0x52a280,_0xd5c9('0xe'));logger[_0xd5c9('0xf')](_0xd5c9('0x10'),_0x52a280,'request\x20sent',JSON['stringify'](_0x345f5a));if(_0x345f5a['error']){if(_0x345f5a['error'][_0xd5c9('0x11')]===0x1f4){logger['error'](_0xd5c9('0xd'),_0x52a280,_0x345f5a[_0xd5c9('0x12')][_0xd5c9('0x13')]);return _0x3fc140(_0x345f5a[_0xd5c9('0x12')]['message']);}logger[_0xd5c9('0x12')](_0xd5c9('0xd'),_0x52a280,_0x345f5a[_0xd5c9('0x12')][_0xd5c9('0x13')]);return _0x418f8f(_0x345f5a['error'][_0xd5c9('0x13')]);}else{logger['info'](_0xd5c9('0xd'),_0x52a280,'request\x20sent');_0x418f8f(_0x345f5a[_0xd5c9('0x14')][_0xd5c9('0x13')]);}})[_0xd5c9('0x15')](function(_0x24adce){logger[_0xd5c9('0x12')](_0xd5c9('0xd'),_0x52a280,_0x24adce);_0x3fc140(_0x24adce);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index fe33620..21bc8e8 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 _0x430a=['post','create','addConfiguration','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields'];(function(_0x121a9b,_0x55f316){var _0x3ec127=function(_0xd9eef8){while(--_0xd9eef8){_0x121a9b['push'](_0x121a9b['shift']());}};_0x3ec127(++_0x55f316);}(_0x430a,0xaf));var _0xa430=function(_0x453ebd,_0x1bc0ea){_0x453ebd=_0x453ebd-0x0;var _0x24140e=_0x430a[_0x453ebd];return _0x24140e;};'use strict';var multer=require(_0xa430('0x0'));var util=require('util');var path=require(_0xa430('0x1'));var timeout=require(_0xa430('0x2'));var express=require(_0xa430('0x3'));var router=express[_0xa430('0x4')]();var fs_extra=require(_0xa430('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xa430('0x6')]('/',auth[_0xa430('0x7')](),controller[_0xa430('0x8')]);router[_0xa430('0x6')](_0xa430('0x9'),auth[_0xa430('0x7')](),controller[_0xa430('0xa')]);router['get'](_0xa430('0xb'),auth['isAuthenticated'](),controller[_0xa430('0xc')]);router[_0xa430('0x6')]('/:id/fields',auth[_0xa430('0x7')](),controller[_0xa430('0xd')]);router[_0xa430('0xe')]('/',auth[_0xa430('0x7')](),controller[_0xa430('0xf')]);router[_0xa430('0xe')](_0xa430('0xb'),auth[_0xa430('0x7')](),controller[_0xa430('0x10')]);router[_0xa430('0x11')](_0xa430('0x9'),auth['isAuthenticated'](),controller[_0xa430('0x12')]);router[_0xa430('0x13')]('/:id',auth[_0xa430('0x7')](),controller[_0xa430('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf69c=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x35d276,_0x5acf98){var _0x56ed3a=function(_0x2237f8){while(--_0x2237f8){_0x35d276['push'](_0x35d276['shift']());}};_0x56ed3a(++_0x5acf98);}(_0xf69c,0x151));var _0xcf69=function(_0x1e35bd,_0x40ee90){_0x1e35bd=_0x1e35bd-0x0;var _0x2c379d=_0xf69c[_0x1e35bd];return _0x2c379d;};'use strict';var multer=require(_0xcf69('0x0'));var util=require('util');var path=require(_0xcf69('0x1'));var timeout=require(_0xcf69('0x2'));var express=require('express');var router=express[_0xcf69('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcf69('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcf69('0x5'));var controller=require('./intZendeskAccount.controller');router[_0xcf69('0x6')]('/',auth[_0xcf69('0x7')](),controller[_0xcf69('0x8')]);router[_0xcf69('0x6')](_0xcf69('0x9'),auth['isAuthenticated'](),controller[_0xcf69('0xa')]);router[_0xcf69('0x6')](_0xcf69('0xb'),auth[_0xcf69('0x7')](),controller['getConfigurations']);router[_0xcf69('0x6')](_0xcf69('0xc'),auth[_0xcf69('0x7')](),controller[_0xcf69('0xd')]);router[_0xcf69('0xe')]('/',auth[_0xcf69('0x7')](),controller['create']);router[_0xcf69('0xe')]('/:id/configurations',auth[_0xcf69('0x7')](),controller[_0xcf69('0xf')]);router[_0xcf69('0x10')](_0xcf69('0x9'),auth[_0xcf69('0x7')](),controller[_0xcf69('0x11')]);router[_0xcf69('0x12')](_0xcf69('0x9'),auth['isAuthenticated'](),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 7fcda3c..c5b2b84 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 _0xbedb=['integrationTab','sequelize','STRING','remoteUri','ENUM','password','token'];(function(_0x16e9b5,_0x192142){var _0x206df0=function(_0x1a0a8f){while(--_0x1a0a8f){_0x16e9b5['push'](_0x16e9b5['shift']());}};_0x206df0(++_0x192142);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbbed('0x0'));module['exports']={'name':{'type':Sequelize[_0xbbed('0x1')]},'description':{'type':Sequelize[_0xbbed('0x1')]},'username':{'type':Sequelize[_0xbbed('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xbbed('0x1')]},'remoteUri':{'type':Sequelize[_0xbbed('0x1')],'unique':_0xbbed('0x2')},'authType':{'type':Sequelize[_0xbbed('0x3')](_0xbbed('0x4'),_0xbbed('0x5')),'defaultValue':_0xbbed('0x4')},'serverUrl':{'type':Sequelize[_0xbbed('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbbed('0x3')](_0xbbed('0x6'),'newTab'),'defaultValue':_0xbbed('0x6')}}; \ No newline at end of file +var _0x761c=['username','remoteUri','password','token','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0xf58db,_0x314965){var _0x73e05a=function(_0x1bb627){while(--_0x1bb627){_0xf58db['push'](_0xf58db['shift']());}};_0x73e05a(++_0x314965);}(_0x761c,0x18a));var _0xc761=function(_0x44efc6,_0x3d5a13){_0x44efc6=_0x44efc6-0x0;var _0x18a4de=_0x761c[_0x44efc6];return _0x18a4de;};'use strict';var Sequelize=require(_0xc761('0x0'));module['exports']={'name':{'type':Sequelize[_0xc761('0x1')]},'description':{'type':Sequelize[_0xc761('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xc761('0x2')},'password':{'type':Sequelize[_0xc761('0x1')]},'token':{'type':Sequelize[_0xc761('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc761('0x3')},'authType':{'type':Sequelize['ENUM'](_0xc761('0x4'),_0xc761('0x5')),'defaultValue':_0xc761('0x4')},'serverUrl':{'type':Sequelize[_0xc761('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc761('0x6')](_0xc761('0x7'),_0xc761('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 1d0e48b..9f87516 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 _0xf290=['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/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','sendStatus','send','ZendeskAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','count','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','create','body','find','getConfigurations','findOne','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','username','authType','remoteUri','lastIndexOf','%s/%s','password','headers','format','%s:%s','toString','token','Basic\x20%s','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','ticket_fields','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv'];(function(_0x1bb7d9,_0x96fa05){var _0x5581be=function(_0x15ef11){while(--_0x15ef11){_0x1bb7d9['push'](_0x1bb7d9['shift']());}};_0x5581be(++_0x96fa05);}(_0xf290,0xde));var _0x0f29=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xf290[_0x2aecb2];return _0x3ebb80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];var integrations=require(_0x0f29('0x19'));function respondWithStatusCode(_0x222c42,_0x195424){_0x195424=_0x195424||0xcc;return function(_0x2d2573){if(_0x2d2573){return _0x222c42['sendStatus'](_0x195424);}return _0x222c42[_0x0f29('0x1a')](_0x195424)[_0x0f29('0x1b')]();};}function respondWithResult(_0x2bb7b8,_0x368984){_0x368984=_0x368984||0xc8;return function(_0x234856){if(_0x234856){return _0x2bb7b8[_0x0f29('0x1a')](_0x368984)[_0x0f29('0x1c')](_0x234856);}};}function respondWithFilteredResult(_0x69df36,_0x547404){return function(_0x4ac37d){if(_0x4ac37d){var _0x2be27f=typeof _0x547404[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x547404[_0x0f29('0x1f')]==='undefined';var _0x122bfa=_0x4ac37d['count'];var _0x17b994=_0x2be27f?0x0:_0x547404['offset'];var _0x5ddc74=_0x2be27f?_0x4ac37d['count']:_0x547404[_0x0f29('0x1d')]+_0x547404[_0x0f29('0x1f')];var _0x13e8ff;if(_0x5ddc74>=_0x122bfa){_0x5ddc74=_0x122bfa;_0x13e8ff=0xc8;}else{_0x13e8ff=0xce;}_0x69df36[_0x0f29('0x1a')](_0x13e8ff);return _0x69df36[_0x0f29('0x20')](_0x0f29('0x21'),_0x17b994+'-'+_0x5ddc74+'/'+_0x122bfa)[_0x0f29('0x1c')](_0x4ac37d);}return null;};}function patchUpdates(_0x4888b6){return function(_0x49d954){try{jsonpatch['apply'](_0x49d954,_0x4888b6,!![]);}catch(_0x5ab592){return BPromise['reject'](_0x5ab592);}return _0x49d954['save']();};}function saveUpdates(_0x38a1ce,_0x4a9dd8){return function(_0x563d15){if(_0x563d15){return _0x563d15[_0x0f29('0x22')](_0x38a1ce)[_0x0f29('0x23')](function(_0x346db8){return _0x346db8;});}return null;};}function removeEntity(_0x3402dc,_0x29ca73){return function(_0x568ad9){if(_0x568ad9){return _0x568ad9[_0x0f29('0x24')]()['then'](function(){_0x3402dc[_0x0f29('0x1a')](0xcc)[_0x0f29('0x1b')]();});}};}function handleEntityNotFound(_0x23c09e,_0x28cfaa){return function(_0x57667b){if(!_0x57667b){_0x23c09e[_0x0f29('0x25')](0x194);}return _0x57667b;};}function handleError(_0x540d72,_0x58b201){_0x58b201=_0x58b201||0x1f4;return function(_0x92876){logger['error'](_0x92876['stack']);if(_0x92876['name']){delete _0x92876['name'];}_0x540d72[_0x0f29('0x1a')](_0x58b201)[_0x0f29('0x26')](_0x92876);};}exports['index']=function(_0x1fc4fd,_0x2ab528){var _0x274c9d={},_0x51e7dc={},_0x56e729={'count':0x0,'rows':[]};var _0x37ebcc=_['map'](db[_0x0f29('0x27')]['rawAttributes'],function(_0x526364){return{'name':_0x526364[_0x0f29('0x28')],'type':_0x526364[_0x0f29('0x29')][_0x0f29('0x2a')]};});_0x51e7dc[_0x0f29('0x2b')]=_['map'](_0x37ebcc,'name');_0x51e7dc[_0x0f29('0x2c')]=_['keys'](_0x1fc4fd['query']);_0x51e7dc[_0x0f29('0x2d')]=_['intersection'](_0x51e7dc[_0x0f29('0x2b')],_0x51e7dc['query']);_0x274c9d['attributes']=_[_0x0f29('0x2e')](_0x51e7dc[_0x0f29('0x2b')],qs[_0x0f29('0x2f')](_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x2f')]));_0x274c9d['attributes']=_0x274c9d[_0x0f29('0x30')]['length']?_0x274c9d[_0x0f29('0x30')]:_0x51e7dc[_0x0f29('0x2b')];if(!_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x31')]('nolimit')){_0x274c9d[_0x0f29('0x1f')]=qs[_0x0f29('0x1f')](_0x1fc4fd['query'][_0x0f29('0x1f')]);_0x274c9d[_0x0f29('0x1d')]=qs['offset'](_0x1fc4fd['query'][_0x0f29('0x1d')]);}_0x274c9d[_0x0f29('0x32')]=qs[_0x0f29('0x33')](_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x33')]);_0x274c9d[_0x0f29('0x34')]=qs['filters'](_[_0x0f29('0x35')](_0x1fc4fd['query'],_0x51e7dc[_0x0f29('0x2d')]),_0x37ebcc);if(_0x1fc4fd['query'][_0x0f29('0x36')]){_0x274c9d[_0x0f29('0x34')]=_[_0x0f29('0x37')](_0x274c9d['where'],{'$or':_['map'](_0x37ebcc,function(_0x16a9eb){if(_0x16a9eb['type']!==_0x0f29('0x38')){var _0x3f49f8={};_0x3f49f8[_0x16a9eb[_0x0f29('0x39')]]={'$like':'%'+_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x36')]+'%'};return _0x3f49f8;}})});}_0x274c9d=_['merge']({},_0x274c9d,_0x1fc4fd[_0x0f29('0x3a')]);var _0xf77c66={'where':_0x274c9d[_0x0f29('0x34')]};return db[_0x0f29('0x27')][_0x0f29('0x3b')](_0xf77c66)[_0x0f29('0x23')](function(_0xac4fb2){_0x56e729[_0x0f29('0x3b')]=_0xac4fb2;if(_0x1fc4fd[_0x0f29('0x2c')]['includeAll']){_0x274c9d[_0x0f29('0x3c')]=[{'all':!![]}];}return db[_0x0f29('0x27')][_0x0f29('0x3d')](_0x274c9d);})[_0x0f29('0x23')](function(_0x504908){_0x56e729[_0x0f29('0x3e')]=_0x504908;return _0x56e729;})[_0x0f29('0x23')](respondWithFilteredResult(_0x2ab528,_0x274c9d))[_0x0f29('0x3f')](handleError(_0x2ab528,null));};exports[_0x0f29('0x40')]=function(_0x185493,_0x56062d){var _0x410c59={'raw':![],'where':{'id':_0x185493[_0x0f29('0x41')]['id']}},_0x245bf9={};_0x245bf9['model']=_[_0x0f29('0x42')](db[_0x0f29('0x27')][_0x0f29('0x43')]);_0x245bf9[_0x0f29('0x2c')]=_[_0x0f29('0x42')](_0x185493[_0x0f29('0x2c')]);_0x245bf9[_0x0f29('0x2d')]=_[_0x0f29('0x2e')](_0x245bf9['model'],_0x245bf9['query']);_0x410c59['attributes']=_[_0x0f29('0x2e')](_0x245bf9[_0x0f29('0x2b')],qs[_0x0f29('0x2f')](_0x185493[_0x0f29('0x2c')][_0x0f29('0x2f')]));_0x410c59[_0x0f29('0x30')]=_0x410c59['attributes'][_0x0f29('0x44')]?_0x410c59['attributes']:_0x245bf9[_0x0f29('0x2b')];if(_0x185493['query'][_0x0f29('0x45')]){_0x410c59[_0x0f29('0x3c')]=[{'all':!![]}];}_0x410c59=_[_0x0f29('0x37')]({},_0x410c59,_0x185493[_0x0f29('0x3a')]);return db[_0x0f29('0x27')]['find'](_0x410c59)[_0x0f29('0x23')](handleEntityNotFound(_0x56062d,null))[_0x0f29('0x23')](respondWithResult(_0x56062d,null))[_0x0f29('0x3f')](handleError(_0x56062d,null));};exports['create']=function(_0x14b747,_0x563fe2){return db['ZendeskAccount'][_0x0f29('0x46')](_0x14b747[_0x0f29('0x47')],{})[_0x0f29('0x23')](respondWithResult(_0x563fe2,0xc9))[_0x0f29('0x3f')](handleError(_0x563fe2,null));};exports[_0x0f29('0x22')]=function(_0x335435,_0x5e3546){if(_0x335435[_0x0f29('0x47')]['id']){delete _0x335435[_0x0f29('0x47')]['id'];}return db[_0x0f29('0x27')][_0x0f29('0x48')]({'where':{'id':_0x335435[_0x0f29('0x41')]['id']}})[_0x0f29('0x23')](handleEntityNotFound(_0x5e3546,null))[_0x0f29('0x23')](saveUpdates(_0x335435[_0x0f29('0x47')],null))[_0x0f29('0x23')](respondWithResult(_0x5e3546,null))[_0x0f29('0x3f')](handleError(_0x5e3546,null));};exports['destroy']=function(_0x5e4479,_0xa6231e){return db[_0x0f29('0x27')][_0x0f29('0x48')]({'where':{'id':_0x5e4479[_0x0f29('0x41')]['id']}})['then'](handleEntityNotFound(_0xa6231e,null))[_0x0f29('0x23')](removeEntity(_0xa6231e,null))[_0x0f29('0x3f')](handleError(_0xa6231e,null));};exports[_0x0f29('0x49')]=function(_0x30387c,_0xbf8f22,_0x2b3797){var _0x277ced={};var _0x59aeb9={};var _0x17f33;var _0x6c1800;return db[_0x0f29('0x27')][_0x0f29('0x4a')]({'where':{'id':_0x30387c[_0x0f29('0x41')]['id']}})[_0x0f29('0x23')](handleEntityNotFound(_0xbf8f22,null))['then'](function(_0x8c9780){if(_0x8c9780){_0x17f33=_0x8c9780;_0x59aeb9[_0x0f29('0x2b')]=_[_0x0f29('0x42')](db['ZendeskConfiguration'][_0x0f29('0x43')]);_0x59aeb9['query']=_[_0x0f29('0x42')](_0x30387c['query']);_0x59aeb9[_0x0f29('0x2d')]=_[_0x0f29('0x2e')](_0x59aeb9['model'],_0x59aeb9[_0x0f29('0x2c')]);_0x277ced[_0x0f29('0x30')]=_[_0x0f29('0x2e')](_0x59aeb9['model'],qs[_0x0f29('0x2f')](_0x30387c['query'][_0x0f29('0x2f')]));_0x277ced[_0x0f29('0x30')]=_0x277ced['attributes'][_0x0f29('0x44')]?_0x277ced[_0x0f29('0x30')]:_0x59aeb9['model'];_0x277ced[_0x0f29('0x32')]=qs['sort'](_0x30387c[_0x0f29('0x2c')]['sort']);_0x277ced[_0x0f29('0x34')]=qs[_0x0f29('0x2d')](_[_0x0f29('0x35')](_0x30387c['query'],_0x59aeb9[_0x0f29('0x2d')]));if(_0x30387c[_0x0f29('0x2c')][_0x0f29('0x36')]){_0x277ced[_0x0f29('0x34')]=_['merge'](_0x277ced[_0x0f29('0x34')],{'$or':_['map'](_0x277ced[_0x0f29('0x30')],function(_0x5159ac){var _0x1a4c57={};_0x1a4c57[_0x5159ac]={'$like':'%'+_0x30387c[_0x0f29('0x2c')][_0x0f29('0x36')]+'%'};return _0x1a4c57;})});}_0x277ced=_[_0x0f29('0x37')]({},_0x277ced,_0x30387c[_0x0f29('0x3a')]);return _0x17f33[_0x0f29('0x49')](_0x277ced);}})[_0x0f29('0x23')](function(_0x536ab1){if(_0x536ab1){_0x6c1800=_0x536ab1[_0x0f29('0x44')];if(!_0x30387c['query'][_0x0f29('0x31')](_0x0f29('0x4b'))){_0x277ced[_0x0f29('0x1f')]=qs['limit'](_0x30387c[_0x0f29('0x2c')][_0x0f29('0x1f')]);_0x277ced[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x30387c[_0x0f29('0x2c')]['offset']);}return _0x17f33['getConfigurations'](_0x277ced);}})[_0x0f29('0x23')](function(_0x441fe8){if(_0x441fe8){return _0x441fe8?{'count':_0x6c1800,'rows':_0x441fe8}:null;}})[_0x0f29('0x23')](respondWithResult(_0xbf8f22,null))['catch'](handleError(_0xbf8f22,null));};exports['addConfiguration']=function(_0xebd543,_0x204a27,_0x280433){if(_0xebd543['body']['id']){delete _0xebd543['body']['id'];}return db['ZendeskAccount'][_0x0f29('0x4a')]({'where':{'id':_0xebd543[_0x0f29('0x41')]['id']}})['then'](handleEntityNotFound(_0x204a27,null))[_0x0f29('0x23')](function(_0x1c5eb4){if(_0x1c5eb4){_0xebd543['body'][_0x0f29('0x4c')]=_0x1c5eb4['id'];_0xebd543['body'][_0x0f29('0x4d')]=integrations[_0x0f29('0x4e')](_0xebd543['body'][_0x0f29('0x4f')],_0xebd543[_0x0f29('0x47')][_0x0f29('0x29')]);_0xebd543[_0x0f29('0x47')][_0x0f29('0x50')]=integrations[_0x0f29('0x51')](_0xebd543['body'][_0x0f29('0x4f')],_0xebd543[_0x0f29('0x47')][_0x0f29('0x29')]);return db['ZendeskConfiguration'][_0x0f29('0x46')](_0xebd543[_0x0f29('0x47')],{'include':[{'model':db['ZendeskField'],'as':_0x0f29('0x4d')},{'model':db['ZendeskField'],'as':_0x0f29('0x50')}]});}return null;})[_0x0f29('0x23')](respondWithResult(_0x204a27,null))[_0x0f29('0x3f')](handleError(_0x204a27,null));};exports['getFields']=function(_0x3c46d7,_0x1c0cb2,_0x2325cf){var _0x1a7d0c='';return db[_0x0f29('0x27')][_0x0f29('0x4a')]({'where':{'id':_0x3c46d7['params']['id']},'attributes':['id',_0x0f29('0x52'),'password','token',_0x0f29('0x53'),_0x0f29('0x54')]})['then'](handleEntityNotFound(_0x1c0cb2,null))[_0x0f29('0x23')](function(_0x1668a3){if(_0x1668a3){_0x1a7d0c=_0x1668a3['remoteUri'];var _0x5767b3=_0x1a7d0c['slice'](-0x1);if(_0x5767b3==='/'){_0x1a7d0c=_0x1a7d0c['substring'](0x0,_0x1a7d0c[_0x0f29('0x55')](_0x5767b3));}var _0x353472={'method':'GET','uri':util['format'](_0x0f29('0x56'),_0x1a7d0c,'ticket_fields'),'json':!![]};switch(_0x1668a3[_0x0f29('0x53')]){case _0x0f29('0x57'):_0x353472[_0x0f29('0x58')]={'Authorization':util[_0x0f29('0x59')]('Basic\x20%s',new Buffer(util[_0x0f29('0x59')](_0x0f29('0x5a'),_0x1668a3[_0x0f29('0x52')],_0x1668a3[_0x0f29('0x57')]))[_0x0f29('0x5b')]('base64'))};break;case _0x0f29('0x5c'):_0x353472[_0x0f29('0x58')]={'Authorization':util[_0x0f29('0x59')](_0x0f29('0x5d'),new Buffer(util[_0x0f29('0x59')](_0x0f29('0x5e'),_0x1668a3[_0x0f29('0x52')],_0x1668a3[_0x0f29('0x5c')]))[_0x0f29('0x5b')](_0x0f29('0x5f')))};break;default:throw new db[(_0x0f29('0x60'))][(_0x0f29('0x61'))](_0x0f29('0x62'));}return rp(_0x353472);}})[_0x0f29('0x23')](function(_0x46a8c1){if(_0x46a8c1){var _0x58f4cc=[_0x0f29('0x63'),_0x0f29('0x64'),_0x0f29('0x65'),_0x0f29('0x66')];_['remove'](_0x46a8c1['ticket_fields'],function(_0x5c0695){return _0x58f4cc[_0x0f29('0x67')](_0x5c0695[_0x0f29('0x29')]);});return{'count':_0x46a8c1['ticket_fields'][_0x0f29('0x44')],'rows':_['map'](_0x46a8c1[_0x0f29('0x68')],function(_0x5548dd){return{'id':_0x5548dd['id'],'name':_0x5548dd[_0x0f29('0x69')]>0x7?_0x5548dd[_0x0f29('0x6a')]:_0x5548dd[_0x0f29('0x29')],'custom':_0x5548dd['position']>0x7?!![]:![],'options':_0x5548dd[_0x0f29('0x6b')]?_0x5548dd['system_field_options']:_0x5548dd['custom_field_options']?_0x5548dd[_0x0f29('0x6c')]:[]};})};}})['then'](respondWithResult(_0x1c0cb2,null))[_0x0f29('0x3f')](function(_0x2b4390){var _0x55b810=_0x3c46d7[_0x0f29('0x2c')][_0x0f29('0x6d')]?0x1f4:_0x2b4390[_0x0f29('0x6e')]||0x1f4;logger[_0x0f29('0x6f')](_0x0f29('0x70'),_0x0f29('0x71'),_0x55b810,JSON[_0x0f29('0x72')](_0x2b4390));delete _0x2b4390[_0x0f29('0x39')];if(_0x55b810===0x191){_0x55b810=0x190;}_0x1c0cb2['status'](_0x55b810)[_0x0f29('0x26')](_0x3c46d7[_0x0f29('0x2c')][_0x0f29('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x2b4390[_0x0f29('0x6e')]}:_0x2b4390);});}; \ No newline at end of file +var _0xa74f=['Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskAccount','findAll','rows','params','length','find','catch','create','body','findOne','getConfigurations','addConfiguration'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0xa74f,0x9a));var _0xfa74=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0xa74f[_0x351509];return _0x4e9861;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfa74('0x16'));function respondWithStatusCode(_0x998585,_0x78173f){_0x78173f=_0x78173f||0xcc;return function(_0x278e8b){if(_0x278e8b){return _0x998585['sendStatus'](_0x78173f);}return _0x998585[_0xfa74('0x17')](_0x78173f)[_0xfa74('0x18')]();};}function respondWithResult(_0x3eb49b,_0x3947ca){_0x3947ca=_0x3947ca||0xc8;return function(_0xe3c97e){if(_0xe3c97e){return _0x3eb49b['status'](_0x3947ca)[_0xfa74('0x19')](_0xe3c97e);}};}function respondWithFilteredResult(_0x13d911,_0x947da6){return function(_0x1f1de0){if(_0x1f1de0){var _0x3867f8=typeof _0x947da6[_0xfa74('0x1a')]===_0xfa74('0x1b')&&typeof _0x947da6['limit']===_0xfa74('0x1b');var _0xe0e33d=_0x1f1de0['count'];var _0x4928b6=_0x3867f8?0x0:_0x947da6[_0xfa74('0x1a')];var _0x25a36b=_0x3867f8?_0x1f1de0[_0xfa74('0x1c')]:_0x947da6['offset']+_0x947da6[_0xfa74('0x1d')];var _0x2edebb;if(_0x25a36b>=_0xe0e33d){_0x25a36b=_0xe0e33d;_0x2edebb=0xc8;}else{_0x2edebb=0xce;}_0x13d911[_0xfa74('0x17')](_0x2edebb);return _0x13d911['set'](_0xfa74('0x1e'),_0x4928b6+'-'+_0x25a36b+'/'+_0xe0e33d)[_0xfa74('0x19')](_0x1f1de0);}return null;};}function patchUpdates(_0x2e6c33){return function(_0x4a5ee4){try{jsonpatch['apply'](_0x4a5ee4,_0x2e6c33,!![]);}catch(_0x100851){return BPromise[_0xfa74('0x1f')](_0x100851);}return _0x4a5ee4[_0xfa74('0x20')]();};}function saveUpdates(_0xeaaa19,_0x1a453d){return function(_0x554e0e){if(_0x554e0e){return _0x554e0e['update'](_0xeaaa19)[_0xfa74('0x21')](function(_0x5aa8a7){return _0x5aa8a7;});}return null;};}function removeEntity(_0x48cbd3,_0x529810){return function(_0x42c439){if(_0x42c439){return _0x42c439[_0xfa74('0x22')]()[_0xfa74('0x21')](function(){_0x48cbd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9eb68c,_0xeb6c11){return function(_0x5ed1c8){if(!_0x5ed1c8){_0x9eb68c[_0xfa74('0x23')](0x194);}return _0x5ed1c8;};}function handleError(_0x5d3b26,_0x1a8cf7){_0x1a8cf7=_0x1a8cf7||0x1f4;return function(_0x153b2a){logger['error'](_0x153b2a[_0xfa74('0x24')]);if(_0x153b2a[_0xfa74('0x25')]){delete _0x153b2a[_0xfa74('0x25')];}_0x5d3b26[_0xfa74('0x17')](_0x1a8cf7)['send'](_0x153b2a);};}exports[_0xfa74('0x26')]=function(_0x2f7cd7,_0x204e01){var _0x57d90e={},_0x4d4bed={},_0x1322a4={'count':0x0,'rows':[]};var _0x8b706e=_['map'](db['ZendeskAccount'][_0xfa74('0x27')],function(_0x564060){return{'name':_0x564060[_0xfa74('0x28')],'type':_0x564060['type'][_0xfa74('0x29')]};});_0x4d4bed[_0xfa74('0x2a')]=_[_0xfa74('0x2b')](_0x8b706e,_0xfa74('0x25'));_0x4d4bed['query']=_[_0xfa74('0x2c')](_0x2f7cd7[_0xfa74('0x2d')]);_0x4d4bed[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x4d4bed[_0xfa74('0x2a')],_0x4d4bed[_0xfa74('0x2d')]);_0x57d90e[_0xfa74('0x30')]=_['intersection'](_0x4d4bed[_0xfa74('0x2a')],qs['fields'](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x57d90e[_0xfa74('0x30')]=_0x57d90e[_0xfa74('0x30')]['length']?_0x57d90e['attributes']:_0x4d4bed[_0xfa74('0x2a')];if(!_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x32')](_0xfa74('0x33'))){_0x57d90e['limit']=qs[_0xfa74('0x1d')](_0x2f7cd7[_0xfa74('0x2d')]['limit']);_0x57d90e['offset']=qs['offset'](_0x2f7cd7['query']['offset']);}_0x57d90e[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x57d90e[_0xfa74('0x36')]=qs[_0xfa74('0x2e')](_[_0xfa74('0x37')](_0x2f7cd7[_0xfa74('0x2d')],_0x4d4bed[_0xfa74('0x2e')]),_0x8b706e);if(_0x2f7cd7['query'][_0xfa74('0x38')]){_0x57d90e[_0xfa74('0x36')]=_[_0xfa74('0x39')](_0x57d90e[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x8b706e,function(_0x186126){if(_0x186126['type']!==_0xfa74('0x3a')){var _0x1f0806={};_0x1f0806[_0x186126[_0xfa74('0x25')]]={'$like':'%'+_0x2f7cd7[_0xfa74('0x2d')]['filter']+'%'};return _0x1f0806;}})});}_0x57d90e=_[_0xfa74('0x39')]({},_0x57d90e,_0x2f7cd7[_0xfa74('0x3b')]);var _0xe8491b={'where':_0x57d90e[_0xfa74('0x36')]};return db['ZendeskAccount'][_0xfa74('0x1c')](_0xe8491b)[_0xfa74('0x21')](function(_0x3dacc2){_0x1322a4['count']=_0x3dacc2;if(_0x2f7cd7['query'][_0xfa74('0x3c')]){_0x57d90e[_0xfa74('0x3d')]=[{'all':!![]}];}return db[_0xfa74('0x3e')][_0xfa74('0x3f')](_0x57d90e);})['then'](function(_0x1ab026){_0x1322a4[_0xfa74('0x40')]=_0x1ab026;return _0x1322a4;})['then'](respondWithFilteredResult(_0x204e01,_0x57d90e))['catch'](handleError(_0x204e01,null));};exports['show']=function(_0x492c7d,_0x95c891){var _0x3098ca={'raw':![],'where':{'id':_0x492c7d[_0xfa74('0x41')]['id']}},_0x3f92b2={};_0x3f92b2[_0xfa74('0x2a')]=_[_0xfa74('0x2c')](db[_0xfa74('0x3e')]['rawAttributes']);_0x3f92b2[_0xfa74('0x2d')]=_[_0xfa74('0x2c')](_0x492c7d[_0xfa74('0x2d')]);_0x3f92b2[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x3f92b2['model'],_0x3f92b2[_0xfa74('0x2d')]);_0x3098ca[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x3f92b2[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x492c7d[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x3098ca[_0xfa74('0x30')]=_0x3098ca[_0xfa74('0x30')][_0xfa74('0x42')]?_0x3098ca['attributes']:_0x3f92b2[_0xfa74('0x2a')];if(_0x492c7d['query'][_0xfa74('0x3c')]){_0x3098ca[_0xfa74('0x3d')]=[{'all':!![]}];}_0x3098ca=_[_0xfa74('0x39')]({},_0x3098ca,_0x492c7d[_0xfa74('0x3b')]);return db['ZendeskAccount'][_0xfa74('0x43')](_0x3098ca)[_0xfa74('0x21')](handleEntityNotFound(_0x95c891,null))['then'](respondWithResult(_0x95c891,null))[_0xfa74('0x44')](handleError(_0x95c891,null));};exports[_0xfa74('0x45')]=function(_0x5cbb70,_0x2be89f){return db[_0xfa74('0x3e')][_0xfa74('0x45')](_0x5cbb70[_0xfa74('0x46')],{})[_0xfa74('0x21')](respondWithResult(_0x2be89f,0xc9))['catch'](handleError(_0x2be89f,null));};exports['update']=function(_0x36f6ca,_0x91df44){if(_0x36f6ca['body']['id']){delete _0x36f6ca[_0xfa74('0x46')]['id'];}return db[_0xfa74('0x3e')][_0xfa74('0x43')]({'where':{'id':_0x36f6ca['params']['id']}})['then'](handleEntityNotFound(_0x91df44,null))[_0xfa74('0x21')](saveUpdates(_0x36f6ca[_0xfa74('0x46')],null))[_0xfa74('0x21')](respondWithResult(_0x91df44,null))[_0xfa74('0x44')](handleError(_0x91df44,null));};exports[_0xfa74('0x22')]=function(_0x3cb23d,_0x2d217d){return db[_0xfa74('0x3e')]['find']({'where':{'id':_0x3cb23d[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2d217d,null))[_0xfa74('0x21')](removeEntity(_0x2d217d,null))[_0xfa74('0x44')](handleError(_0x2d217d,null));};exports['getConfigurations']=function(_0x4ec218,_0x3146de,_0x5b3404){var _0x152eaa={};var _0x221dc7={};var _0x427469;var _0x33e31e;return db[_0xfa74('0x3e')][_0xfa74('0x47')]({'where':{'id':_0x4ec218[_0xfa74('0x41')]['id']}})['then'](handleEntityNotFound(_0x3146de,null))[_0xfa74('0x21')](function(_0x4bcee3){if(_0x4bcee3){_0x427469=_0x4bcee3;_0x221dc7[_0xfa74('0x2a')]=_['keys'](db['ZendeskConfiguration'][_0xfa74('0x27')]);_0x221dc7[_0xfa74('0x2d')]=_['keys'](_0x4ec218['query']);_0x221dc7[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],_0x221dc7[_0xfa74('0x2d')]);_0x152eaa[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x152eaa['attributes']=_0x152eaa[_0xfa74('0x30')][_0xfa74('0x42')]?_0x152eaa['attributes']:_0x221dc7['model'];_0x152eaa[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x152eaa[_0xfa74('0x36')]=qs['filters'](_[_0xfa74('0x37')](_0x4ec218['query'],_0x221dc7[_0xfa74('0x2e')]));if(_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]){_0x152eaa['where']=_['merge'](_0x152eaa[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x152eaa[_0xfa74('0x30')],function(_0x1b3484){var _0x53eca4={};_0x53eca4[_0x1b3484]={'$like':'%'+_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]+'%'};return _0x53eca4;})});}_0x152eaa=_['merge']({},_0x152eaa,_0x4ec218[_0xfa74('0x3b')]);return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x1681e7){if(_0x1681e7){_0x33e31e=_0x1681e7['length'];if(!_0x4ec218[_0xfa74('0x2d')]['hasOwnProperty'](_0xfa74('0x33'))){_0x152eaa[_0xfa74('0x1d')]=qs[_0xfa74('0x1d')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1d')]);_0x152eaa[_0xfa74('0x1a')]=qs[_0xfa74('0x1a')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1a')]);}return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x930728){if(_0x930728){return _0x930728?{'count':_0x33e31e,'rows':_0x930728}:null;}})[_0xfa74('0x21')](respondWithResult(_0x3146de,null))[_0xfa74('0x44')](handleError(_0x3146de,null));};exports[_0xfa74('0x49')]=function(_0x512b58,_0x2361d2,_0x3b0dd5){if(_0x512b58['body']['id']){delete _0x512b58['body']['id'];}return db[_0xfa74('0x3e')]['findOne']({'where':{'id':_0x512b58[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2361d2,null))[_0xfa74('0x21')](function(_0x529921){if(_0x529921){_0x512b58[_0xfa74('0x46')]['AccountId']=_0x529921['id'];_0x512b58['body'][_0xfa74('0x4a')]=integrations[_0xfa74('0x4b')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58[_0xfa74('0x46')][_0xfa74('0x4d')]);_0x512b58[_0xfa74('0x46')][_0xfa74('0x4e')]=integrations[_0xfa74('0x4f')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58['body'][_0xfa74('0x4d')]);return db['ZendeskConfiguration'][_0xfa74('0x45')](_0x512b58[_0xfa74('0x46')],{'include':[{'model':db[_0xfa74('0x50')],'as':'Subjects'},{'model':db[_0xfa74('0x50')],'as':_0xfa74('0x4e')}]});}return null;})[_0xfa74('0x21')](respondWithResult(_0x2361d2,null))['catch'](handleError(_0x2361d2,null));};exports[_0xfa74('0x51')]=function(_0x34e772,_0x474462,_0x1105e5){var _0x10e5f5='';return db['ZendeskAccount'][_0xfa74('0x47')]({'where':{'id':_0x34e772[_0xfa74('0x41')]['id']},'attributes':['id',_0xfa74('0x52'),_0xfa74('0x53'),_0xfa74('0x54'),_0xfa74('0x55'),_0xfa74('0x56')]})[_0xfa74('0x21')](handleEntityNotFound(_0x474462,null))[_0xfa74('0x21')](function(_0x3526d7){if(_0x3526d7){_0x10e5f5=_0x3526d7[_0xfa74('0x56')];var _0x30aec7=_0x10e5f5['slice'](-0x1);if(_0x30aec7==='/'){_0x10e5f5=_0x10e5f5[_0xfa74('0x57')](0x0,_0x10e5f5[_0xfa74('0x58')](_0x30aec7));}var _0xdffc88={'method':_0xfa74('0x59'),'uri':util[_0xfa74('0x5a')](_0xfa74('0x5b'),_0x10e5f5,_0xfa74('0x5c')),'json':!![]};switch(_0x3526d7[_0xfa74('0x55')]){case'password':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util[_0xfa74('0x5a')](_0xfa74('0x5e'),new Buffer(util[_0xfa74('0x5a')]('%s:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x53')]))[_0xfa74('0x5f')](_0xfa74('0x60')))};break;case'token':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xfa74('0x5a')]('%s/token:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x54')]))['toString']('base64'))};break;default:throw new db[(_0xfa74('0x61'))][(_0xfa74('0x62'))](_0xfa74('0x63'));}return rp(_0xdffc88);}})[_0xfa74('0x21')](function(_0x4f1acc){if(_0x4f1acc){var _0x5acb9b=['subject',_0xfa74('0x64'),_0xfa74('0x65'),_0xfa74('0x66')];_[_0xfa74('0x67')](_0x4f1acc[_0xfa74('0x5c')],function(_0x52e8ac){return _0x5acb9b[_0xfa74('0x68')](_0x52e8ac[_0xfa74('0x4d')]);});return{'count':_0x4f1acc[_0xfa74('0x5c')][_0xfa74('0x42')],'rows':_[_0xfa74('0x2b')](_0x4f1acc[_0xfa74('0x5c')],function(_0x358db2){return{'id':_0x358db2['id'],'name':_0x358db2[_0xfa74('0x69')]>0x7?_0x358db2[_0xfa74('0x6a')]:_0x358db2['type'],'custom':_0x358db2['position']>0x7?!![]:![],'options':_0x358db2['system_field_options']?_0x358db2[_0xfa74('0x6b')]:_0x358db2[_0xfa74('0x6c')]?_0x358db2[_0xfa74('0x6c')]:[]};})};}})[_0xfa74('0x21')](respondWithResult(_0x474462,null))[_0xfa74('0x44')](function(_0x533649){var _0x3e4323=_0x34e772[_0xfa74('0x2d')]['test']?0x1f4:_0x533649[_0xfa74('0x6d')]||0x1f4;logger['error'](_0xfa74('0x6e'),_0xfa74('0x51'),_0x3e4323,JSON[_0xfa74('0x6f')](_0x533649));delete _0x533649[_0xfa74('0x25')];if(_0x3e4323===0x191){_0x3e4323=0x190;}_0x474462[_0xfa74('0x17')](_0x3e4323)[_0xfa74('0x70')](_0x34e772[_0xfa74('0x2d')][_0xfa74('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x533649['statusCode']}:_0x533649);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index c6f48bf..57e3946 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 _0x7495=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZendeskAccount.attributes','exports','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x2c7877,_0x108b04){var _0x2b5403=function(_0x33c839){while(--_0x33c839){_0x2c7877['push'](_0x2c7877['shift']());}};_0x2b5403(++_0x108b04);}(_0x7495,0x14f));var _0x5749=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x7495[_0x114b7c];return _0x47185f;};'use strict';var _=require(_0x5749('0x0'));var util=require(_0x5749('0x1'));var logger=require(_0x5749('0x2'))(_0x5749('0x3'));var moment=require(_0x5749('0x4'));var BPromise=require(_0x5749('0x5'));var rp=require(_0x5749('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5749('0x7'));var attributes=require(_0x5749('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x5749('0x9')]=function(_0x1e5e47,_0x5c7bd6){return _0x1e5e47['define'](_0x5749('0xa'),attributes,{'tableName':_0x5749('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbeb8=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbeb8,0x1ed));var _0x8beb=function(_0x1226b0,_0x1bd586){_0x1226b0=_0x1226b0-0x0;var _0x1f09c9=_0xbeb8[_0x1226b0];return _0x1f09c9;};'use strict';var _=require(_0x8beb('0x0'));var util=require(_0x8beb('0x1'));var logger=require(_0x8beb('0x2'))(_0x8beb('0x3'));var moment=require(_0x8beb('0x4'));var BPromise=require('bluebird');var rp=require(_0x8beb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8beb('0x6'));var config=require(_0x8beb('0x7'));var attributes=require(_0x8beb('0x8'));var integrations=require(_0x8beb('0x9'));module[_0x8beb('0xa')]=function(_0x15d94f,_0x2cbaf1){return _0x15d94f[_0x8beb('0xb')](_0x8beb('0xc'),attributes,{'tableName':'int_zendesk_accounts','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 a5bfb31..90c8d7a 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 _0xa2f0=['ZendeskAccount','findAll','options','attributes','include','model','map','ShowZendeskAccount','raw','where','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount'];(function(_0x3163d2,_0x3b099e){var _0x1d6992=function(_0x4a39cd){while(--_0x4a39cd){_0x3163d2['push'](_0x3163d2['shift']());}};_0x1d6992(++_0x3b099e);}(_0xa2f0,0x82));var _0x0a2f=function(_0x3cd860,_0x5b7684){_0x3cd860=_0x3cd860-0x0;var _0xa340ac=_0xa2f0[_0x3cd860];return _0xa340ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0a2f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a2f('0x1'))['db'];var utils=require(_0x0a2f('0x2'));var logger=require(_0x0a2f('0x3'))(_0x0a2f('0x4'));var config=require('../../config/environment');var jayson=require(_0x0a2f('0x5'));var client=jayson[_0x0a2f('0x6')][_0x0a2f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a9d4d,_0x524800,_0x562a04){return new BPromise(function(_0x47a56e,_0x231f98){return client['request'](_0x3a9d4d,_0x562a04)[_0x0a2f('0x8')](function(_0x5377a5){logger[_0x0a2f('0x9')](_0x0a2f('0xa'),_0x524800,_0x0a2f('0xb'));logger[_0x0a2f('0xc')](_0x0a2f('0xd'),_0x524800,'request\x20sent',JSON[_0x0a2f('0xe')](_0x5377a5));if(_0x5377a5[_0x0a2f('0xf')]){if(_0x5377a5[_0x0a2f('0xf')]['code']===0x1f4){logger[_0x0a2f('0xf')](_0x0a2f('0xa'),_0x524800,_0x5377a5['error'][_0x0a2f('0x10')]);return _0x231f98(_0x5377a5[_0x0a2f('0xf')][_0x0a2f('0x10')]);}logger[_0x0a2f('0xf')](_0x0a2f('0xa'),_0x524800,_0x5377a5[_0x0a2f('0xf')][_0x0a2f('0x10')]);return _0x47a56e(_0x5377a5[_0x0a2f('0xf')][_0x0a2f('0x10')]);}else{logger[_0x0a2f('0x9')](_0x0a2f('0xa'),_0x524800,_0x0a2f('0xb'));_0x47a56e(_0x5377a5[_0x0a2f('0x11')][_0x0a2f('0x10')]);}})[_0x0a2f('0x12')](function(_0xecf13c){logger[_0x0a2f('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x524800,_0xecf13c);_0x231f98(_0xecf13c);});});}exports[_0x0a2f('0x13')]=function(_0x4c6ffc){var _0x3fa538=this;return new Promise(function(_0x3e88ba,_0x479aa3){return db[_0x0a2f('0x14')][_0x0a2f('0x15')]({'raw':_0x4c6ffc[_0x0a2f('0x16')]?_0x4c6ffc['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c6ffc[_0x0a2f('0x16')]?_0x4c6ffc['options']['where']||null:null,'attributes':_0x4c6ffc['options']?_0x4c6ffc['options'][_0x0a2f('0x17')]||null:null,'limit':_0x4c6ffc['options']?_0x4c6ffc[_0x0a2f('0x16')]['limit']||null:null,'include':_0x4c6ffc[_0x0a2f('0x16')]?_0x4c6ffc[_0x0a2f('0x16')][_0x0a2f('0x18')]?_['map'](_0x4c6ffc['options'][_0x0a2f('0x18')],function(_0x3ec2e4){return{'model':db[_0x3ec2e4[_0x0a2f('0x19')]],'as':_0x3ec2e4['as'],'attributes':_0x3ec2e4['attributes'],'include':_0x3ec2e4[_0x0a2f('0x18')]?_[_0x0a2f('0x1a')](_0x3ec2e4[_0x0a2f('0x18')],function(_0x206640){return{'model':db[_0x206640[_0x0a2f('0x19')]],'as':_0x206640['as'],'attributes':_0x206640[_0x0a2f('0x17')],'include':_0x206640[_0x0a2f('0x18')]?_['map'](_0x206640[_0x0a2f('0x18')],function(_0x496796){return{'model':db[_0x496796[_0x0a2f('0x19')]],'as':_0x496796['as'],'attributes':_0x496796[_0x0a2f('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0a2f('0x8')](function(_0x206cb8){logger[_0x0a2f('0x9')](_0x0a2f('0x13'),_0x4c6ffc);logger[_0x0a2f('0xc')](_0x0a2f('0x13'),_0x4c6ffc,JSON[_0x0a2f('0xe')](_0x206cb8));_0x3e88ba(_0x206cb8);})[_0x0a2f('0x12')](function(_0x2fb810){logger[_0x0a2f('0xf')](_0x0a2f('0x13'),_0x2fb810[_0x0a2f('0x10')],_0x4c6ffc);_0x479aa3(_0x3fa538[_0x0a2f('0xf')](0x1f4,_0x2fb810[_0x0a2f('0x10')]));});});};exports[_0x0a2f('0x1b')]=function(_0xd5fc60){var _0x52ba64=this;return new Promise(function(_0x2fa044,_0x3bfda0){return db[_0x0a2f('0x14')]['find']({'raw':_0xd5fc60[_0x0a2f('0x16')]?_0xd5fc60[_0x0a2f('0x16')][_0x0a2f('0x1c')]===undefined?!![]:![]:!![],'where':_0xd5fc60[_0x0a2f('0x16')]?_0xd5fc60['options'][_0x0a2f('0x1d')]||null:null,'attributes':_0xd5fc60[_0x0a2f('0x16')]?_0xd5fc60[_0x0a2f('0x16')][_0x0a2f('0x17')]||null:null,'include':_0xd5fc60[_0x0a2f('0x16')]?_0xd5fc60[_0x0a2f('0x16')]['include']?_[_0x0a2f('0x1a')](_0xd5fc60[_0x0a2f('0x16')][_0x0a2f('0x18')],function(_0x2e2955){return{'model':db[_0x2e2955[_0x0a2f('0x19')]],'as':_0x2e2955['as'],'attributes':_0x2e2955[_0x0a2f('0x17')],'include':_0x2e2955[_0x0a2f('0x18')]?_[_0x0a2f('0x1a')](_0x2e2955[_0x0a2f('0x18')],function(_0x846af8){return{'model':db[_0x846af8[_0x0a2f('0x19')]],'as':_0x846af8['as'],'attributes':_0x846af8[_0x0a2f('0x17')],'include':_0x846af8['include']?_[_0x0a2f('0x1a')](_0x846af8['include'],function(_0x1a9a3e){return{'model':db[_0x1a9a3e[_0x0a2f('0x19')]],'as':_0x1a9a3e['as'],'attributes':_0x1a9a3e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a2f('0x8')](function(_0x16df01){logger['info']('ShowZendeskAccount',_0xd5fc60);logger['debug']('ShowZendeskAccount',_0xd5fc60,JSON['stringify'](_0x16df01));_0x2fa044(_0x16df01);})[_0x0a2f('0x12')](function(_0x579f89){logger['error']('ShowZendeskAccount',_0x579f89[_0x0a2f('0x10')],_0xd5fc60);_0x3bfda0(_0x52ba64['error'](0x1f4,_0x579f89['message']));});});}; \ No newline at end of file +var _0x8d93=['then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','findAll','options','raw','where','attributes','include','model','map','GetZendeskAccount','stringify','ZendeskAccount','find','ShowZendeskAccount','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3ec4a6,_0x30e7b5){var _0x1201e1=function(_0x24b7bc){while(--_0x24b7bc){_0x3ec4a6['push'](_0x3ec4a6['shift']());}};_0x1201e1(++_0x30e7b5);}(_0x8d93,0x96));var _0x38d9=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x8d93[_0x120376];return _0x28c529;};'use strict';var _=require('lodash');var util=require(_0x38d9('0x0'));var moment=require(_0x38d9('0x1'));var BPromise=require(_0x38d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38d9('0x3'))['db'];var utils=require(_0x38d9('0x4'));var logger=require(_0x38d9('0x5'))(_0x38d9('0x6'));var config=require('../../config/environment');var jayson=require(_0x38d9('0x7'));var client=jayson[_0x38d9('0x8')][_0x38d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x284f3f,_0x535ff3,_0x209235){return new BPromise(function(_0x1c4a96,_0xc23d60){return client['request'](_0x284f3f,_0x209235)[_0x38d9('0xa')](function(_0x205c85){logger[_0x38d9('0xb')](_0x38d9('0xc'),_0x535ff3,_0x38d9('0xd'));logger[_0x38d9('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x535ff3,_0x38d9('0xd'),JSON['stringify'](_0x205c85));if(_0x205c85['error']){if(_0x205c85['error']['code']===0x1f4){logger[_0x38d9('0xf')](_0x38d9('0xc'),_0x535ff3,_0x205c85[_0x38d9('0xf')][_0x38d9('0x10')]);return _0xc23d60(_0x205c85[_0x38d9('0xf')]['message']);}logger[_0x38d9('0xf')](_0x38d9('0xc'),_0x535ff3,_0x205c85[_0x38d9('0xf')][_0x38d9('0x10')]);return _0x1c4a96(_0x205c85[_0x38d9('0xf')][_0x38d9('0x10')]);}else{logger[_0x38d9('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x535ff3,_0x38d9('0xd'));_0x1c4a96(_0x205c85[_0x38d9('0x11')][_0x38d9('0x10')]);}})['catch'](function(_0x3c9f8d){logger[_0x38d9('0xf')](_0x38d9('0xc'),_0x535ff3,_0x3c9f8d);_0xc23d60(_0x3c9f8d);});});}exports['GetZendeskAccount']=function(_0xca6d43){var _0x48c69=this;return new Promise(function(_0x4ae582,_0x37ce35){return db['ZendeskAccount'][_0x38d9('0x12')]({'raw':_0xca6d43[_0x38d9('0x13')]?_0xca6d43[_0x38d9('0x13')][_0x38d9('0x14')]===undefined?!![]:![]:!![],'where':_0xca6d43[_0x38d9('0x13')]?_0xca6d43[_0x38d9('0x13')][_0x38d9('0x15')]||null:null,'attributes':_0xca6d43[_0x38d9('0x13')]?_0xca6d43[_0x38d9('0x13')][_0x38d9('0x16')]||null:null,'limit':_0xca6d43[_0x38d9('0x13')]?_0xca6d43[_0x38d9('0x13')]['limit']||null:null,'include':_0xca6d43['options']?_0xca6d43[_0x38d9('0x13')][_0x38d9('0x17')]?_['map'](_0xca6d43[_0x38d9('0x13')]['include'],function(_0x50729d){return{'model':db[_0x50729d[_0x38d9('0x18')]],'as':_0x50729d['as'],'attributes':_0x50729d[_0x38d9('0x16')],'include':_0x50729d[_0x38d9('0x17')]?_['map'](_0x50729d[_0x38d9('0x17')],function(_0x4c098c){return{'model':db[_0x4c098c[_0x38d9('0x18')]],'as':_0x4c098c['as'],'attributes':_0x4c098c[_0x38d9('0x16')],'include':_0x4c098c['include']?_[_0x38d9('0x19')](_0x4c098c[_0x38d9('0x17')],function(_0x5d2377){return{'model':db[_0x5d2377[_0x38d9('0x18')]],'as':_0x5d2377['as'],'attributes':_0x5d2377[_0x38d9('0x16')]};}):[]};}):[]};}):[]:[]})[_0x38d9('0xa')](function(_0xe75499){logger[_0x38d9('0xb')](_0x38d9('0x1a'),_0xca6d43);logger[_0x38d9('0xe')](_0x38d9('0x1a'),_0xca6d43,JSON[_0x38d9('0x1b')](_0xe75499));_0x4ae582(_0xe75499);})['catch'](function(_0x5398c4){logger[_0x38d9('0xf')](_0x38d9('0x1a'),_0x5398c4[_0x38d9('0x10')],_0xca6d43);_0x37ce35(_0x48c69[_0x38d9('0xf')](0x1f4,_0x5398c4[_0x38d9('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x5e81f3){var _0x1c28b5=this;return new Promise(function(_0x470ced,_0x49d690){return db[_0x38d9('0x1c')][_0x38d9('0x1d')]({'raw':_0x5e81f3['options']?_0x5e81f3['options'][_0x38d9('0x14')]===undefined?!![]:![]:!![],'where':_0x5e81f3['options']?_0x5e81f3[_0x38d9('0x13')][_0x38d9('0x15')]||null:null,'attributes':_0x5e81f3[_0x38d9('0x13')]?_0x5e81f3[_0x38d9('0x13')][_0x38d9('0x16')]||null:null,'include':_0x5e81f3['options']?_0x5e81f3['options']['include']?_[_0x38d9('0x19')](_0x5e81f3[_0x38d9('0x13')][_0x38d9('0x17')],function(_0x444997){return{'model':db[_0x444997[_0x38d9('0x18')]],'as':_0x444997['as'],'attributes':_0x444997[_0x38d9('0x16')],'include':_0x444997[_0x38d9('0x17')]?_[_0x38d9('0x19')](_0x444997['include'],function(_0xebb98a){return{'model':db[_0xebb98a['model']],'as':_0xebb98a['as'],'attributes':_0xebb98a['attributes'],'include':_0xebb98a['include']?_[_0x38d9('0x19')](_0xebb98a[_0x38d9('0x17')],function(_0x585295){return{'model':db[_0x585295[_0x38d9('0x18')]],'as':_0x585295['as'],'attributes':_0x585295['attributes']};}):[]};}):[]};}):[]:[]})[_0x38d9('0xa')](function(_0x21f21b){logger[_0x38d9('0xb')](_0x38d9('0x1e'),_0x5e81f3);logger[_0x38d9('0xe')]('ShowZendeskAccount',_0x5e81f3,JSON['stringify'](_0x21f21b));_0x470ced(_0x21f21b);})[_0x38d9('0x1f')](function(_0x108b8a){logger[_0x38d9('0xf')](_0x38d9('0x1e'),_0x108b8a[_0x38d9('0x10')],_0x5e81f3);_0x49d690(_0x1c28b5[_0x38d9('0xf')](0x1f4,_0x108b8a[_0x38d9('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 8074ee0..2d85c1e 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 _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x3d79f1,_0xc280a7){var _0x7209df=function(_0x40e63e){while(--_0x40e63e){_0x3d79f1['push'](_0x3d79f1['shift']());}};_0x7209df(++_0xc280a7);}(_0x4fc2,0x111));var _0x24fc=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0x4fc2[_0x1fd675];return _0x16b554;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file +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(_0x333fed,_0x3d2122){var _0x12cac2=function(_0x41d9af){while(--_0x41d9af){_0x333fed['push'](_0x333fed['shift']());}};_0x12cac2(++_0x3d2122);}(_0xb688,0xcf));var _0x8b68=function(_0x452067,_0x3e4629){_0x452067=_0x452067-0x0;var _0xd0d319=_0xb688[_0x452067];return _0xd0d319;};'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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 610fe72..8cbb0ec 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 _0x8c80=['exports'];(function(_0x389487,_0x6311c3){var _0x26dcde=function(_0x3dd325){while(--_0x3dd325){_0x389487['push'](_0x389487['shift']());}};_0x26dcde(++_0x6311c3);}(_0x8c80,0x1db));var _0x08c8=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x8c80[_0x4b4d43];return _0x5706ba;};'use strict';var Sequelize=require('sequelize');module[_0x08c8('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa9f6=['STRING','exports'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xa9f6,0x9f));var _0x6a9f=function(_0x3f462e,_0x59cc17){_0x3f462e=_0x3f462e-0x0;var _0x526275=_0xa9f6[_0x3f462e];return _0x526275;};'use strict';var Sequelize=require('sequelize');module[_0x6a9f('0x0')]={'name':{'type':Sequelize[_0x6a9f('0x1')]},'description':{'type':Sequelize[_0x6a9f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 3d2f69c..09d2ecf 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 _0x7ae6=['Content-Range','json','save','update','then','error','name','index','ZendeskConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','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','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set'];(function(_0x2979db,_0x4e414b){var _0x283140=function(_0x28c3bc){while(--_0x28c3bc){_0x2979db['push'](_0x2979db['shift']());}};_0x283140(++_0x4e414b);}(_0x7ae6,0x115));var _0x67ae=function(_0x203720,_0x5d7cde){_0x203720=_0x203720-0x0;var _0x4e1456=_0x7ae6[_0x203720];return _0x4e1456;};'use strict';var emlformat=require(_0x67ae('0x0'));var rimraf=require(_0x67ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x67ae('0x2'));var rp=require(_0x67ae('0x3'));var moment=require(_0x67ae('0x4'));var BPromise=require(_0x67ae('0x5'));var Mustache=require(_0x67ae('0x6'));var util=require('util');var path=require(_0x67ae('0x7'));var sox=require('sox');var csv=require(_0x67ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x67ae('0x9'));var _=require(_0x67ae('0xa'));var squel=require('squel');var crypto=require(_0x67ae('0xb'));var jsforce=require(_0x67ae('0xc'));var deskjs=require(_0x67ae('0xd'));var toCsv=require(_0x67ae('0x8'));var querystring=require(_0x67ae('0xe'));var Papa=require(_0x67ae('0xf'));var Redis=require('ioredis');var authService=require(_0x67ae('0x10'));var qs=require(_0x67ae('0x11'));var as=require(_0x67ae('0x12'));var hardwareService=require(_0x67ae('0x13'));var logger=require(_0x67ae('0x14'))('api');var utils=require(_0x67ae('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x67ae('0x16'))['db'];function respondWithStatusCode(_0x32d6c4,_0x4f5ed9){_0x4f5ed9=_0x4f5ed9||0xcc;return function(_0x1493a2){if(_0x1493a2){return _0x32d6c4[_0x67ae('0x17')](_0x4f5ed9);}return _0x32d6c4[_0x67ae('0x18')](_0x4f5ed9)[_0x67ae('0x19')]();};}function respondWithResult(_0x5a95fa,_0x10e736){_0x10e736=_0x10e736||0xc8;return function(_0x562a20){if(_0x562a20){return _0x5a95fa[_0x67ae('0x18')](_0x10e736)['json'](_0x562a20);}};}function respondWithFilteredResult(_0x53de64,_0x597464){return function(_0x4b62fc){if(_0x4b62fc){var _0x510e84=typeof _0x597464[_0x67ae('0x1a')]===_0x67ae('0x1b')&&typeof _0x597464['limit']==='undefined';var _0x5da0c4=_0x4b62fc[_0x67ae('0x1c')];var _0x174b91=_0x510e84?0x0:_0x597464[_0x67ae('0x1a')];var _0x3998c1=_0x510e84?_0x4b62fc[_0x67ae('0x1c')]:_0x597464[_0x67ae('0x1a')]+_0x597464[_0x67ae('0x1d')];var _0x21fff9;if(_0x3998c1>=_0x5da0c4){_0x3998c1=_0x5da0c4;_0x21fff9=0xc8;}else{_0x21fff9=0xce;}_0x53de64[_0x67ae('0x18')](_0x21fff9);return _0x53de64[_0x67ae('0x1e')](_0x67ae('0x1f'),_0x174b91+'-'+_0x3998c1+'/'+_0x5da0c4)[_0x67ae('0x20')](_0x4b62fc);}return null;};}function patchUpdates(_0x48b7a1){return function(_0x3185c0){try{jsonpatch['apply'](_0x3185c0,_0x48b7a1,!![]);}catch(_0x4ca55f){return BPromise['reject'](_0x4ca55f);}return _0x3185c0[_0x67ae('0x21')]();};}function saveUpdates(_0x5b7d39,_0x4c64e0){return function(_0x4879f0){if(_0x4879f0){return _0x4879f0[_0x67ae('0x22')](_0x5b7d39)['then'](function(_0x5e1300){return _0x5e1300;});}return null;};}function removeEntity(_0x2577fd,_0x15e8a7){return function(_0x2aef08){if(_0x2aef08){return _0x2aef08['destroy']()[_0x67ae('0x23')](function(){_0x2577fd[_0x67ae('0x18')](0xcc)[_0x67ae('0x19')]();});}};}function handleEntityNotFound(_0xe0a201,_0x6bed1e){return function(_0x4d4116){if(!_0x4d4116){_0xe0a201['sendStatus'](0x194);}return _0x4d4116;};}function handleError(_0x1e0f5f,_0x414de2){_0x414de2=_0x414de2||0x1f4;return function(_0x42c33b){logger[_0x67ae('0x24')](_0x42c33b['stack']);if(_0x42c33b[_0x67ae('0x25')]){delete _0x42c33b[_0x67ae('0x25')];}_0x1e0f5f['status'](_0x414de2)['send'](_0x42c33b);};}exports[_0x67ae('0x26')]=function(_0x24bd89,_0x4c746e){var _0x1fe362={},_0x56f2e9={},_0x179e17={'count':0x0,'rows':[]};var _0x28819a=_['map'](db[_0x67ae('0x27')][_0x67ae('0x28')],function(_0x2a849f){return{'name':_0x2a849f[_0x67ae('0x29')],'type':_0x2a849f['type'][_0x67ae('0x2a')]};});_0x56f2e9[_0x67ae('0x2b')]=_[_0x67ae('0x2c')](_0x28819a,_0x67ae('0x25'));_0x56f2e9[_0x67ae('0x2d')]=_[_0x67ae('0x2e')](_0x24bd89[_0x67ae('0x2d')]);_0x56f2e9[_0x67ae('0x2f')]=_[_0x67ae('0x30')](_0x56f2e9['model'],_0x56f2e9[_0x67ae('0x2d')]);_0x1fe362[_0x67ae('0x31')]=_['intersection'](_0x56f2e9[_0x67ae('0x2b')],qs[_0x67ae('0x32')](_0x24bd89['query'][_0x67ae('0x32')]));_0x1fe362[_0x67ae('0x31')]=_0x1fe362[_0x67ae('0x31')][_0x67ae('0x33')]?_0x1fe362['attributes']:_0x56f2e9[_0x67ae('0x2b')];if(!_0x24bd89[_0x67ae('0x2d')][_0x67ae('0x34')](_0x67ae('0x35'))){_0x1fe362['limit']=qs[_0x67ae('0x1d')](_0x24bd89[_0x67ae('0x2d')][_0x67ae('0x1d')]);_0x1fe362[_0x67ae('0x1a')]=qs[_0x67ae('0x1a')](_0x24bd89['query'][_0x67ae('0x1a')]);}_0x1fe362[_0x67ae('0x36')]=qs[_0x67ae('0x37')](_0x24bd89['query'][_0x67ae('0x37')]);_0x1fe362[_0x67ae('0x38')]=qs['filters'](_[_0x67ae('0x39')](_0x24bd89[_0x67ae('0x2d')],_0x56f2e9['filters']),_0x28819a);if(_0x24bd89[_0x67ae('0x2d')][_0x67ae('0x3a')]){_0x1fe362[_0x67ae('0x38')]=_[_0x67ae('0x3b')](_0x1fe362['where'],{'$or':_[_0x67ae('0x2c')](_0x28819a,function(_0x18ec1c){if(_0x18ec1c['type']!==_0x67ae('0x3c')){var _0x31b1cb={};_0x31b1cb[_0x18ec1c[_0x67ae('0x25')]]={'$like':'%'+_0x24bd89['query'][_0x67ae('0x3a')]+'%'};return _0x31b1cb;}})});}_0x1fe362=_['merge']({},_0x1fe362,_0x24bd89[_0x67ae('0x3d')]);var _0x483f4e={'where':_0x1fe362[_0x67ae('0x38')]};return db[_0x67ae('0x27')]['count'](_0x483f4e)['then'](function(_0x3c79a9){_0x179e17[_0x67ae('0x1c')]=_0x3c79a9;if(_0x24bd89[_0x67ae('0x2d')][_0x67ae('0x3e')]){_0x1fe362[_0x67ae('0x3f')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x1fe362);})[_0x67ae('0x23')](function(_0x4301d3){_0x179e17['rows']=_0x4301d3;return _0x179e17;})[_0x67ae('0x23')](respondWithFilteredResult(_0x4c746e,_0x1fe362))[_0x67ae('0x40')](handleError(_0x4c746e,null));};exports['show']=function(_0x160766,_0x8b3527){var _0x441f21={'raw':![],'where':{'id':_0x160766[_0x67ae('0x41')]['id']}},_0x588512={};_0x588512['model']=_['keys'](db[_0x67ae('0x27')]['rawAttributes']);_0x588512[_0x67ae('0x2d')]=_['keys'](_0x160766['query']);_0x588512[_0x67ae('0x2f')]=_['intersection'](_0x588512[_0x67ae('0x2b')],_0x588512[_0x67ae('0x2d')]);_0x441f21['attributes']=_['intersection'](_0x588512[_0x67ae('0x2b')],qs[_0x67ae('0x32')](_0x160766[_0x67ae('0x2d')]['fields']));_0x441f21[_0x67ae('0x31')]=_0x441f21[_0x67ae('0x31')]['length']?_0x441f21[_0x67ae('0x31')]:_0x588512['model'];if(_0x160766[_0x67ae('0x2d')][_0x67ae('0x3e')]){_0x441f21[_0x67ae('0x3f')]=[{'all':!![]}];}_0x441f21=_[_0x67ae('0x3b')]({},_0x441f21,_0x160766['options']);return db[_0x67ae('0x27')][_0x67ae('0x42')](_0x441f21)[_0x67ae('0x23')](handleEntityNotFound(_0x8b3527,null))['then'](respondWithResult(_0x8b3527,null))[_0x67ae('0x40')](handleError(_0x8b3527,null));};exports[_0x67ae('0x43')]=function(_0x40806c,_0x2a62a5){return db[_0x67ae('0x27')][_0x67ae('0x43')](_0x40806c[_0x67ae('0x44')],{})[_0x67ae('0x23')](respondWithResult(_0x2a62a5,0xc9))[_0x67ae('0x40')](handleError(_0x2a62a5,null));};exports['update']=function(_0xd49d4d,_0x29bfbf){if(_0xd49d4d[_0x67ae('0x44')]['id']){delete _0xd49d4d['body']['id'];}return db[_0x67ae('0x27')]['find']({'where':{'id':_0xd49d4d['params']['id']}})['then'](handleEntityNotFound(_0x29bfbf,null))[_0x67ae('0x23')](saveUpdates(_0xd49d4d['body'],null))[_0x67ae('0x23')](respondWithResult(_0x29bfbf,null))['catch'](handleError(_0x29bfbf,null));};exports['destroy']=function(_0x136933,_0xa298da){return db['ZendeskConfiguration'][_0x67ae('0x42')]({'where':{'id':_0x136933['params']['id']}})[_0x67ae('0x23')](handleEntityNotFound(_0xa298da,null))[_0x67ae('0x23')](removeEntity(_0xa298da,null))[_0x67ae('0x40')](handleError(_0xa298da,null));};exports[_0x67ae('0x45')]=function(_0x4eb3aa,_0x4bbc9a,_0x12286a){var _0x3d6f3b={};var _0x19cd87={};var _0x2d2acd;var _0x3591f3;return db[_0x67ae('0x27')][_0x67ae('0x46')]({'where':{'id':_0x4eb3aa[_0x67ae('0x41')]['id']}})[_0x67ae('0x23')](handleEntityNotFound(_0x4bbc9a,null))[_0x67ae('0x23')](function(_0x71ea9b){if(_0x71ea9b){_0x2d2acd=_0x71ea9b;_0x19cd87[_0x67ae('0x2b')]=_['keys'](db['ZendeskField'][_0x67ae('0x28')]);_0x19cd87[_0x67ae('0x2d')]=_['keys'](_0x4eb3aa[_0x67ae('0x2d')]);_0x19cd87[_0x67ae('0x2f')]=_[_0x67ae('0x30')](_0x19cd87[_0x67ae('0x2b')],_0x19cd87[_0x67ae('0x2d')]);_0x3d6f3b[_0x67ae('0x31')]=_[_0x67ae('0x30')](_0x19cd87[_0x67ae('0x2b')],qs[_0x67ae('0x32')](_0x4eb3aa[_0x67ae('0x2d')][_0x67ae('0x32')]));_0x3d6f3b[_0x67ae('0x31')]=_0x3d6f3b[_0x67ae('0x31')]['length']?_0x3d6f3b['attributes']:_0x19cd87[_0x67ae('0x2b')];_0x3d6f3b['order']=qs[_0x67ae('0x37')](_0x4eb3aa[_0x67ae('0x2d')][_0x67ae('0x37')]);_0x3d6f3b[_0x67ae('0x38')]=qs[_0x67ae('0x2f')](_[_0x67ae('0x39')](_0x4eb3aa[_0x67ae('0x2d')],_0x19cd87[_0x67ae('0x2f')]));if(_0x4eb3aa[_0x67ae('0x2d')]['filter']){_0x3d6f3b['where']=_[_0x67ae('0x3b')](_0x3d6f3b[_0x67ae('0x38')],{'$or':_[_0x67ae('0x2c')](_0x3d6f3b['attributes'],function(_0x57e77b){var _0x34fed1={};_0x34fed1[_0x57e77b]={'$like':'%'+_0x4eb3aa[_0x67ae('0x2d')][_0x67ae('0x3a')]+'%'};return _0x34fed1;})});}_0x3d6f3b=_['merge']({},_0x3d6f3b,_0x4eb3aa[_0x67ae('0x3d')]);return _0x2d2acd[_0x67ae('0x45')](_0x3d6f3b);}})[_0x67ae('0x23')](function(_0x184081){if(_0x184081){_0x3591f3=_0x184081[_0x67ae('0x33')];if(!_0x4eb3aa[_0x67ae('0x2d')][_0x67ae('0x34')](_0x67ae('0x35'))){_0x3d6f3b[_0x67ae('0x1d')]=qs[_0x67ae('0x1d')](_0x4eb3aa[_0x67ae('0x2d')]['limit']);_0x3d6f3b[_0x67ae('0x1a')]=qs[_0x67ae('0x1a')](_0x4eb3aa['query'][_0x67ae('0x1a')]);}return _0x2d2acd['getFields'](_0x3d6f3b);}})[_0x67ae('0x23')](function(_0x2857a8){if(_0x2857a8){return _0x2857a8?{'count':_0x3591f3,'rows':_0x2857a8}:null;}})[_0x67ae('0x23')](respondWithResult(_0x4bbc9a,null))[_0x67ae('0x40')](handleError(_0x4bbc9a,null));};exports['getSubjects']=function(_0x48681d,_0x5a6834,_0x2f17f4){var _0x1e7fbe={};var _0x38d677={};var _0xe677ec;var _0x2c2729;return db[_0x67ae('0x27')]['findOne']({'where':{'id':_0x48681d[_0x67ae('0x41')]['id']}})[_0x67ae('0x23')](handleEntityNotFound(_0x5a6834,null))[_0x67ae('0x23')](function(_0x15ed17){if(_0x15ed17){_0xe677ec=_0x15ed17;_0x38d677[_0x67ae('0x2b')]=_[_0x67ae('0x2e')](db[_0x67ae('0x47')][_0x67ae('0x28')]);_0x38d677['query']=_[_0x67ae('0x2e')](_0x48681d['query']);_0x38d677[_0x67ae('0x2f')]=_[_0x67ae('0x30')](_0x38d677[_0x67ae('0x2b')],_0x38d677[_0x67ae('0x2d')]);_0x1e7fbe[_0x67ae('0x31')]=_[_0x67ae('0x30')](_0x38d677[_0x67ae('0x2b')],qs[_0x67ae('0x32')](_0x48681d['query'][_0x67ae('0x32')]));_0x1e7fbe[_0x67ae('0x31')]=_0x1e7fbe['attributes']['length']?_0x1e7fbe[_0x67ae('0x31')]:_0x38d677[_0x67ae('0x2b')];_0x1e7fbe[_0x67ae('0x36')]=qs[_0x67ae('0x37')](_0x48681d[_0x67ae('0x2d')][_0x67ae('0x37')]);_0x1e7fbe[_0x67ae('0x38')]=qs[_0x67ae('0x2f')](_[_0x67ae('0x39')](_0x48681d[_0x67ae('0x2d')],_0x38d677[_0x67ae('0x2f')]));if(_0x48681d[_0x67ae('0x2d')][_0x67ae('0x3a')]){_0x1e7fbe[_0x67ae('0x38')]=_[_0x67ae('0x3b')](_0x1e7fbe[_0x67ae('0x38')],{'$or':_[_0x67ae('0x2c')](_0x1e7fbe[_0x67ae('0x31')],function(_0x595a87){var _0x3715e9={};_0x3715e9[_0x595a87]={'$like':'%'+_0x48681d[_0x67ae('0x2d')][_0x67ae('0x3a')]+'%'};return _0x3715e9;})});}_0x1e7fbe=_[_0x67ae('0x3b')]({},_0x1e7fbe,_0x48681d[_0x67ae('0x3d')]);return _0xe677ec[_0x67ae('0x48')](_0x1e7fbe);}})[_0x67ae('0x23')](function(_0x35548f){if(_0x35548f){_0x2c2729=_0x35548f[_0x67ae('0x33')];if(!_0x48681d['query'][_0x67ae('0x34')](_0x67ae('0x35'))){_0x1e7fbe[_0x67ae('0x1d')]=qs[_0x67ae('0x1d')](_0x48681d[_0x67ae('0x2d')][_0x67ae('0x1d')]);_0x1e7fbe['offset']=qs[_0x67ae('0x1a')](_0x48681d[_0x67ae('0x2d')][_0x67ae('0x1a')]);}return _0xe677ec[_0x67ae('0x48')](_0x1e7fbe);}})['then'](function(_0x240d6b){if(_0x240d6b){return _0x240d6b?{'count':_0x2c2729,'rows':_0x240d6b}:null;}})[_0x67ae('0x23')](respondWithResult(_0x5a6834,null))[_0x67ae('0x40')](handleError(_0x5a6834,null));};exports[_0x67ae('0x49')]=function(_0x557315,_0x4d1f95,_0xae6c9f){var _0x13e7d6={};var _0x201e6d={};var _0x1f9af5;var _0x415a25;return db[_0x67ae('0x27')]['findOne']({'where':{'id':_0x557315[_0x67ae('0x41')]['id']}})[_0x67ae('0x23')](handleEntityNotFound(_0x4d1f95,null))[_0x67ae('0x23')](function(_0x5e1dc1){if(_0x5e1dc1){_0x1f9af5=_0x5e1dc1;_0x201e6d[_0x67ae('0x2b')]=_[_0x67ae('0x2e')](db[_0x67ae('0x47')]['rawAttributes']);_0x201e6d[_0x67ae('0x2d')]=_[_0x67ae('0x2e')](_0x557315['query']);_0x201e6d[_0x67ae('0x2f')]=_[_0x67ae('0x30')](_0x201e6d[_0x67ae('0x2b')],_0x201e6d[_0x67ae('0x2d')]);_0x13e7d6[_0x67ae('0x31')]=_[_0x67ae('0x30')](_0x201e6d['model'],qs[_0x67ae('0x32')](_0x557315[_0x67ae('0x2d')][_0x67ae('0x32')]));_0x13e7d6[_0x67ae('0x31')]=_0x13e7d6[_0x67ae('0x31')][_0x67ae('0x33')]?_0x13e7d6[_0x67ae('0x31')]:_0x201e6d[_0x67ae('0x2b')];_0x13e7d6[_0x67ae('0x36')]=qs['sort'](_0x557315[_0x67ae('0x2d')]['sort']);_0x13e7d6[_0x67ae('0x38')]=qs[_0x67ae('0x2f')](_[_0x67ae('0x39')](_0x557315['query'],_0x201e6d['filters']));if(_0x557315[_0x67ae('0x2d')]['filter']){_0x13e7d6[_0x67ae('0x38')]=_[_0x67ae('0x3b')](_0x13e7d6[_0x67ae('0x38')],{'$or':_[_0x67ae('0x2c')](_0x13e7d6[_0x67ae('0x31')],function(_0x5b60b1){var _0x5b9987={};_0x5b9987[_0x5b60b1]={'$like':'%'+_0x557315[_0x67ae('0x2d')][_0x67ae('0x3a')]+'%'};return _0x5b9987;})});}_0x13e7d6=_[_0x67ae('0x3b')]({},_0x13e7d6,_0x557315['options']);return _0x1f9af5['getDescriptions'](_0x13e7d6);}})[_0x67ae('0x23')](function(_0x48d7cf){if(_0x48d7cf){_0x415a25=_0x48d7cf[_0x67ae('0x33')];if(!_0x557315[_0x67ae('0x2d')]['hasOwnProperty'](_0x67ae('0x35'))){_0x13e7d6[_0x67ae('0x1d')]=qs['limit'](_0x557315[_0x67ae('0x2d')]['limit']);_0x13e7d6['offset']=qs[_0x67ae('0x1a')](_0x557315[_0x67ae('0x2d')]['offset']);}return _0x1f9af5[_0x67ae('0x49')](_0x13e7d6);}})[_0x67ae('0x23')](function(_0x22d88b){if(_0x22d88b){return _0x22d88b?{'count':_0x415a25,'rows':_0x22d88b}:null;}})[_0x67ae('0x23')](respondWithResult(_0x4d1f95,null))[_0x67ae('0x40')](handleError(_0x4d1f95,null));};exports['getTags']=function(_0x3a6b37,_0x1b1843,_0x2afde5){var _0x2177df={};var _0x9e97e={};var _0x3b90ff;var _0x5c00c7;return db[_0x67ae('0x27')]['findOne']({'where':{'id':_0x3a6b37[_0x67ae('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b1843,null))['then'](function(_0x45ba53){if(_0x45ba53){_0x3b90ff=_0x45ba53;_0x9e97e['model']=_[_0x67ae('0x2e')](db['Tag']['rawAttributes']);_0x9e97e[_0x67ae('0x2d')]=_[_0x67ae('0x2e')](_0x3a6b37[_0x67ae('0x2d')]);_0x9e97e['filters']=_[_0x67ae('0x30')](_0x9e97e[_0x67ae('0x2b')],_0x9e97e[_0x67ae('0x2d')]);_0x2177df[_0x67ae('0x31')]=_['intersection'](_0x9e97e[_0x67ae('0x2b')],qs[_0x67ae('0x32')](_0x3a6b37['query']['fields']));_0x2177df['attributes']=_0x2177df[_0x67ae('0x31')]['length']?_0x2177df['attributes']:_0x9e97e['model'];_0x2177df[_0x67ae('0x36')]=qs[_0x67ae('0x37')](_0x3a6b37[_0x67ae('0x2d')][_0x67ae('0x37')]);_0x2177df[_0x67ae('0x38')]=qs['filters'](_['pick'](_0x3a6b37[_0x67ae('0x2d')],_0x9e97e['filters']));if(_0x3a6b37[_0x67ae('0x2d')]['filter']){_0x2177df[_0x67ae('0x38')]=_[_0x67ae('0x3b')](_0x2177df[_0x67ae('0x38')],{'$or':_['map'](_0x2177df['attributes'],function(_0x2e7263){var _0x17af62={};_0x17af62[_0x2e7263]={'$like':'%'+_0x3a6b37[_0x67ae('0x2d')][_0x67ae('0x3a')]+'%'};return _0x17af62;})});}_0x2177df=_[_0x67ae('0x3b')]({},_0x2177df,_0x3a6b37['options']);return _0x3b90ff[_0x67ae('0x4a')](_0x2177df);}})[_0x67ae('0x23')](function(_0x5641ec){if(_0x5641ec){_0x5c00c7=_0x5641ec['length'];if(!_0x3a6b37[_0x67ae('0x2d')]['hasOwnProperty'](_0x67ae('0x35'))){_0x2177df[_0x67ae('0x1d')]=qs[_0x67ae('0x1d')](_0x3a6b37['query'][_0x67ae('0x1d')]);_0x2177df['offset']=qs[_0x67ae('0x1a')](_0x3a6b37[_0x67ae('0x2d')]['offset']);}return _0x3b90ff[_0x67ae('0x4a')](_0x2177df);}})['then'](function(_0x38936d){if(_0x38936d){return _0x38936d?{'count':_0x5c00c7,'rows':_0x38936d}:null;}})[_0x67ae('0x23')](respondWithResult(_0x1b1843,null))[_0x67ae('0x40')](handleError(_0x1b1843,null));};exports['setTags']=function(_0x2fb385,_0x5ae2a5,_0xa74b5e){if(_0x2fb385[_0x67ae('0x44')]['id']){delete _0x2fb385[_0x67ae('0x44')]['id'];}return db[_0x67ae('0x27')][_0x67ae('0x46')]({'where':{'id':_0x2fb385[_0x67ae('0x41')]['id']}})[_0x67ae('0x23')](handleEntityNotFound(_0x5ae2a5,null))[_0x67ae('0x23')](function(_0x5f1725){if(_0x5f1725){return _0x5f1725[_0x67ae('0x4b')](_0x2fb385[_0x67ae('0x44')][_0x67ae('0x4c')]||[]);}return null;})[_0x67ae('0x23')](respondWithResult(_0x5ae2a5,null))[_0x67ae('0x40')](handleError(_0x5ae2a5,null));}; \ No newline at end of file +var _0x33b0=['papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','destroy','then','error','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','filter','merge','options','where','findAll','show','includeAll','include','catch','create','body','find','params','getFields','ZendeskField','order','sort','nolimit','getSubjects','findOne','pick','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring'];(function(_0x4d0d10,_0x5638d1){var _0x2a3db1=function(_0x201542){while(--_0x201542){_0x4d0d10['push'](_0x4d0d10['shift']());}};_0x2a3db1(++_0x5638d1);}(_0x33b0,0x12d));var _0x033b=function(_0x51c709,_0x4bdbb9){_0x51c709=_0x51c709-0x0;var _0x2f0372=_0x33b0[_0x51c709];return _0x2f0372;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x033b('0x0'));var zipdir=require(_0x033b('0x1'));var jsonpatch=require(_0x033b('0x2'));var rp=require(_0x033b('0x3'));var moment=require(_0x033b('0x4'));var BPromise=require(_0x033b('0x5'));var Mustache=require('mustache');var util=require(_0x033b('0x6'));var path=require(_0x033b('0x7'));var sox=require(_0x033b('0x8'));var csv=require(_0x033b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x033b('0xa'));var _=require(_0x033b('0xb'));var squel=require(_0x033b('0xc'));var crypto=require(_0x033b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x033b('0x9'));var querystring=require(_0x033b('0xe'));var Papa=require(_0x033b('0xf'));var Redis=require(_0x033b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x033b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x033b('0x12'))(_0x033b('0x13'));var utils=require(_0x033b('0x14'));var config=require(_0x033b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x033b('0x16'))['db'];function respondWithStatusCode(_0x2e43db,_0x513a2d){_0x513a2d=_0x513a2d||0xcc;return function(_0x56d04a){if(_0x56d04a){return _0x2e43db[_0x033b('0x17')](_0x513a2d);}return _0x2e43db[_0x033b('0x18')](_0x513a2d)[_0x033b('0x19')]();};}function respondWithResult(_0x463732,_0x536483){_0x536483=_0x536483||0xc8;return function(_0x148595){if(_0x148595){return _0x463732[_0x033b('0x18')](_0x536483)[_0x033b('0x1a')](_0x148595);}};}function respondWithFilteredResult(_0x24adb7,_0x1a928a){return function(_0x57e4b3){if(_0x57e4b3){var _0x329aec=typeof _0x1a928a['offset']===_0x033b('0x1b')&&typeof _0x1a928a[_0x033b('0x1c')]===_0x033b('0x1b');var _0x413a38=_0x57e4b3[_0x033b('0x1d')];var _0x107501=_0x329aec?0x0:_0x1a928a['offset'];var _0x294e86=_0x329aec?_0x57e4b3['count']:_0x1a928a[_0x033b('0x1e')]+_0x1a928a[_0x033b('0x1c')];var _0x1e7992;if(_0x294e86>=_0x413a38){_0x294e86=_0x413a38;_0x1e7992=0xc8;}else{_0x1e7992=0xce;}_0x24adb7[_0x033b('0x18')](_0x1e7992);return _0x24adb7['set']('Content-Range',_0x107501+'-'+_0x294e86+'/'+_0x413a38)['json'](_0x57e4b3);}return null;};}function patchUpdates(_0x4e972b){return function(_0x242dea){try{jsonpatch['apply'](_0x242dea,_0x4e972b,!![]);}catch(_0x102f2f){return BPromise[_0x033b('0x1f')](_0x102f2f);}return _0x242dea[_0x033b('0x20')]();};}function saveUpdates(_0x2f479f,_0x4a3177){return function(_0x5e2306){if(_0x5e2306){return _0x5e2306[_0x033b('0x21')](_0x2f479f)['then'](function(_0x292cb6){return _0x292cb6;});}return null;};}function removeEntity(_0x24a0cc,_0x271e5d){return function(_0x496d8b){if(_0x496d8b){return _0x496d8b[_0x033b('0x22')]()[_0x033b('0x23')](function(){_0x24a0cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x522ad4,_0x3ed02c){return function(_0x19cde6){if(!_0x19cde6){_0x522ad4[_0x033b('0x17')](0x194);}return _0x19cde6;};}function handleError(_0x785ad0,_0x2881a){_0x2881a=_0x2881a||0x1f4;return function(_0x687761){logger[_0x033b('0x24')](_0x687761['stack']);if(_0x687761[_0x033b('0x25')]){delete _0x687761[_0x033b('0x25')];}_0x785ad0['status'](_0x2881a)['send'](_0x687761);};}exports[_0x033b('0x26')]=function(_0x34ec98,_0x2b69ef){var _0x1edcc2={},_0x5267b5={},_0x3e9312={'count':0x0,'rows':[]};var _0x2287ca=_[_0x033b('0x27')](db[_0x033b('0x28')][_0x033b('0x29')],function(_0x13e2e5){return{'name':_0x13e2e5[_0x033b('0x2a')],'type':_0x13e2e5[_0x033b('0x2b')][_0x033b('0x2c')]};});_0x5267b5[_0x033b('0x2d')]=_[_0x033b('0x27')](_0x2287ca,_0x033b('0x25'));_0x5267b5[_0x033b('0x2e')]=_[_0x033b('0x2f')](_0x34ec98['query']);_0x5267b5[_0x033b('0x30')]=_[_0x033b('0x31')](_0x5267b5[_0x033b('0x2d')],_0x5267b5[_0x033b('0x2e')]);_0x1edcc2[_0x033b('0x32')]=_[_0x033b('0x31')](_0x5267b5[_0x033b('0x2d')],qs[_0x033b('0x33')](_0x34ec98[_0x033b('0x2e')][_0x033b('0x33')]));_0x1edcc2['attributes']=_0x1edcc2[_0x033b('0x32')][_0x033b('0x34')]?_0x1edcc2[_0x033b('0x32')]:_0x5267b5[_0x033b('0x2d')];if(!_0x34ec98[_0x033b('0x2e')][_0x033b('0x35')]('nolimit')){_0x1edcc2[_0x033b('0x1c')]=qs[_0x033b('0x1c')](_0x34ec98[_0x033b('0x2e')]['limit']);_0x1edcc2[_0x033b('0x1e')]=qs['offset'](_0x34ec98[_0x033b('0x2e')]['offset']);}_0x1edcc2['order']=qs['sort'](_0x34ec98['query']['sort']);_0x1edcc2['where']=qs['filters'](_['pick'](_0x34ec98[_0x033b('0x2e')],_0x5267b5['filters']),_0x2287ca);if(_0x34ec98[_0x033b('0x2e')][_0x033b('0x36')]){_0x1edcc2['where']=_[_0x033b('0x37')](_0x1edcc2['where'],{'$or':_[_0x033b('0x27')](_0x2287ca,function(_0x58fecb){if(_0x58fecb[_0x033b('0x2b')]!=='VIRTUAL'){var _0x5d0018={};_0x5d0018[_0x58fecb[_0x033b('0x25')]]={'$like':'%'+_0x34ec98[_0x033b('0x2e')][_0x033b('0x36')]+'%'};return _0x5d0018;}})});}_0x1edcc2=_[_0x033b('0x37')]({},_0x1edcc2,_0x34ec98[_0x033b('0x38')]);var _0xe1806f={'where':_0x1edcc2[_0x033b('0x39')]};return db[_0x033b('0x28')][_0x033b('0x1d')](_0xe1806f)[_0x033b('0x23')](function(_0x4419e9){_0x3e9312[_0x033b('0x1d')]=_0x4419e9;if(_0x34ec98[_0x033b('0x2e')]['includeAll']){_0x1edcc2['include']=[{'all':!![]}];}return db[_0x033b('0x28')][_0x033b('0x3a')](_0x1edcc2);})['then'](function(_0x1c9b0a){_0x3e9312['rows']=_0x1c9b0a;return _0x3e9312;})[_0x033b('0x23')](respondWithFilteredResult(_0x2b69ef,_0x1edcc2))['catch'](handleError(_0x2b69ef,null));};exports[_0x033b('0x3b')]=function(_0x4263df,_0x2fabcc){var _0x4f2358={'raw':![],'where':{'id':_0x4263df['params']['id']}},_0x42fafa={};_0x42fafa['model']=_[_0x033b('0x2f')](db[_0x033b('0x28')][_0x033b('0x29')]);_0x42fafa[_0x033b('0x2e')]=_[_0x033b('0x2f')](_0x4263df[_0x033b('0x2e')]);_0x42fafa[_0x033b('0x30')]=_[_0x033b('0x31')](_0x42fafa[_0x033b('0x2d')],_0x42fafa[_0x033b('0x2e')]);_0x4f2358['attributes']=_[_0x033b('0x31')](_0x42fafa[_0x033b('0x2d')],qs[_0x033b('0x33')](_0x4263df[_0x033b('0x2e')][_0x033b('0x33')]));_0x4f2358['attributes']=_0x4f2358['attributes'][_0x033b('0x34')]?_0x4f2358['attributes']:_0x42fafa[_0x033b('0x2d')];if(_0x4263df['query'][_0x033b('0x3c')]){_0x4f2358[_0x033b('0x3d')]=[{'all':!![]}];}_0x4f2358=_[_0x033b('0x37')]({},_0x4f2358,_0x4263df['options']);return db[_0x033b('0x28')]['find'](_0x4f2358)['then'](handleEntityNotFound(_0x2fabcc,null))[_0x033b('0x23')](respondWithResult(_0x2fabcc,null))[_0x033b('0x3e')](handleError(_0x2fabcc,null));};exports[_0x033b('0x3f')]=function(_0x113fa4,_0xf17aa1){return db[_0x033b('0x28')][_0x033b('0x3f')](_0x113fa4[_0x033b('0x40')],{})[_0x033b('0x23')](respondWithResult(_0xf17aa1,0xc9))[_0x033b('0x3e')](handleError(_0xf17aa1,null));};exports['update']=function(_0x1aba29,_0x32211c){if(_0x1aba29[_0x033b('0x40')]['id']){delete _0x1aba29[_0x033b('0x40')]['id'];}return db[_0x033b('0x28')][_0x033b('0x41')]({'where':{'id':_0x1aba29[_0x033b('0x42')]['id']}})[_0x033b('0x23')](handleEntityNotFound(_0x32211c,null))['then'](saveUpdates(_0x1aba29[_0x033b('0x40')],null))[_0x033b('0x23')](respondWithResult(_0x32211c,null))[_0x033b('0x3e')](handleError(_0x32211c,null));};exports[_0x033b('0x22')]=function(_0x3660b2,_0x11f4f3){return db[_0x033b('0x28')][_0x033b('0x41')]({'where':{'id':_0x3660b2[_0x033b('0x42')]['id']}})[_0x033b('0x23')](handleEntityNotFound(_0x11f4f3,null))[_0x033b('0x23')](removeEntity(_0x11f4f3,null))[_0x033b('0x3e')](handleError(_0x11f4f3,null));};exports[_0x033b('0x43')]=function(_0x3fe708,_0x39f639,_0x4f6241){var _0x56b60d={};var _0x35681a={};var _0x1f7035;var _0x2f0402;return db[_0x033b('0x28')]['findOne']({'where':{'id':_0x3fe708[_0x033b('0x42')]['id']}})[_0x033b('0x23')](handleEntityNotFound(_0x39f639,null))[_0x033b('0x23')](function(_0x340266){if(_0x340266){_0x1f7035=_0x340266;_0x35681a['model']=_[_0x033b('0x2f')](db[_0x033b('0x44')][_0x033b('0x29')]);_0x35681a[_0x033b('0x2e')]=_[_0x033b('0x2f')](_0x3fe708[_0x033b('0x2e')]);_0x35681a[_0x033b('0x30')]=_[_0x033b('0x31')](_0x35681a[_0x033b('0x2d')],_0x35681a['query']);_0x56b60d['attributes']=_['intersection'](_0x35681a[_0x033b('0x2d')],qs[_0x033b('0x33')](_0x3fe708['query']['fields']));_0x56b60d[_0x033b('0x32')]=_0x56b60d[_0x033b('0x32')]['length']?_0x56b60d[_0x033b('0x32')]:_0x35681a[_0x033b('0x2d')];_0x56b60d[_0x033b('0x45')]=qs[_0x033b('0x46')](_0x3fe708[_0x033b('0x2e')][_0x033b('0x46')]);_0x56b60d[_0x033b('0x39')]=qs[_0x033b('0x30')](_['pick'](_0x3fe708[_0x033b('0x2e')],_0x35681a[_0x033b('0x30')]));if(_0x3fe708[_0x033b('0x2e')][_0x033b('0x36')]){_0x56b60d[_0x033b('0x39')]=_[_0x033b('0x37')](_0x56b60d[_0x033b('0x39')],{'$or':_['map'](_0x56b60d[_0x033b('0x32')],function(_0x5ee28d){var _0x2b6df4={};_0x2b6df4[_0x5ee28d]={'$like':'%'+_0x3fe708['query'][_0x033b('0x36')]+'%'};return _0x2b6df4;})});}_0x56b60d=_[_0x033b('0x37')]({},_0x56b60d,_0x3fe708[_0x033b('0x38')]);return _0x1f7035['getFields'](_0x56b60d);}})[_0x033b('0x23')](function(_0x4ea194){if(_0x4ea194){_0x2f0402=_0x4ea194['length'];if(!_0x3fe708[_0x033b('0x2e')][_0x033b('0x35')](_0x033b('0x47'))){_0x56b60d[_0x033b('0x1c')]=qs[_0x033b('0x1c')](_0x3fe708[_0x033b('0x2e')][_0x033b('0x1c')]);_0x56b60d[_0x033b('0x1e')]=qs[_0x033b('0x1e')](_0x3fe708['query'][_0x033b('0x1e')]);}return _0x1f7035[_0x033b('0x43')](_0x56b60d);}})[_0x033b('0x23')](function(_0x336bb8){if(_0x336bb8){return _0x336bb8?{'count':_0x2f0402,'rows':_0x336bb8}:null;}})[_0x033b('0x23')](respondWithResult(_0x39f639,null))[_0x033b('0x3e')](handleError(_0x39f639,null));};exports[_0x033b('0x48')]=function(_0x724280,_0x22faa6,_0x40a481){var _0x539307={};var _0x9cd2de={};var _0x180785;var _0x51da18;return db[_0x033b('0x28')][_0x033b('0x49')]({'where':{'id':_0x724280['params']['id']}})[_0x033b('0x23')](handleEntityNotFound(_0x22faa6,null))[_0x033b('0x23')](function(_0x475601){if(_0x475601){_0x180785=_0x475601;_0x9cd2de['model']=_['keys'](db[_0x033b('0x44')][_0x033b('0x29')]);_0x9cd2de[_0x033b('0x2e')]=_['keys'](_0x724280[_0x033b('0x2e')]);_0x9cd2de['filters']=_[_0x033b('0x31')](_0x9cd2de[_0x033b('0x2d')],_0x9cd2de[_0x033b('0x2e')]);_0x539307[_0x033b('0x32')]=_[_0x033b('0x31')](_0x9cd2de[_0x033b('0x2d')],qs[_0x033b('0x33')](_0x724280[_0x033b('0x2e')][_0x033b('0x33')]));_0x539307[_0x033b('0x32')]=_0x539307[_0x033b('0x32')][_0x033b('0x34')]?_0x539307[_0x033b('0x32')]:_0x9cd2de[_0x033b('0x2d')];_0x539307['order']=qs[_0x033b('0x46')](_0x724280[_0x033b('0x2e')][_0x033b('0x46')]);_0x539307[_0x033b('0x39')]=qs[_0x033b('0x30')](_[_0x033b('0x4a')](_0x724280['query'],_0x9cd2de[_0x033b('0x30')]));if(_0x724280[_0x033b('0x2e')][_0x033b('0x36')]){_0x539307[_0x033b('0x39')]=_['merge'](_0x539307['where'],{'$or':_['map'](_0x539307['attributes'],function(_0x56c4be){var _0x1d3b75={};_0x1d3b75[_0x56c4be]={'$like':'%'+_0x724280['query'][_0x033b('0x36')]+'%'};return _0x1d3b75;})});}_0x539307=_[_0x033b('0x37')]({},_0x539307,_0x724280[_0x033b('0x38')]);return _0x180785[_0x033b('0x48')](_0x539307);}})[_0x033b('0x23')](function(_0x1b0fa1){if(_0x1b0fa1){_0x51da18=_0x1b0fa1['length'];if(!_0x724280[_0x033b('0x2e')][_0x033b('0x35')](_0x033b('0x47'))){_0x539307['limit']=qs[_0x033b('0x1c')](_0x724280[_0x033b('0x2e')][_0x033b('0x1c')]);_0x539307[_0x033b('0x1e')]=qs['offset'](_0x724280['query'][_0x033b('0x1e')]);}return _0x180785[_0x033b('0x48')](_0x539307);}})[_0x033b('0x23')](function(_0x138df9){if(_0x138df9){return _0x138df9?{'count':_0x51da18,'rows':_0x138df9}:null;}})[_0x033b('0x23')](respondWithResult(_0x22faa6,null))[_0x033b('0x3e')](handleError(_0x22faa6,null));};exports[_0x033b('0x4b')]=function(_0x1b17e9,_0x1ef4c3,_0x196e2d){var _0xf8b466={};var _0x1d388c={};var _0x116d09;var _0xca9baa;return db[_0x033b('0x28')][_0x033b('0x49')]({'where':{'id':_0x1b17e9['params']['id']}})[_0x033b('0x23')](handleEntityNotFound(_0x1ef4c3,null))[_0x033b('0x23')](function(_0x526563){if(_0x526563){_0x116d09=_0x526563;_0x1d388c[_0x033b('0x2d')]=_[_0x033b('0x2f')](db[_0x033b('0x44')][_0x033b('0x29')]);_0x1d388c[_0x033b('0x2e')]=_[_0x033b('0x2f')](_0x1b17e9[_0x033b('0x2e')]);_0x1d388c['filters']=_['intersection'](_0x1d388c[_0x033b('0x2d')],_0x1d388c[_0x033b('0x2e')]);_0xf8b466['attributes']=_['intersection'](_0x1d388c[_0x033b('0x2d')],qs[_0x033b('0x33')](_0x1b17e9[_0x033b('0x2e')][_0x033b('0x33')]));_0xf8b466[_0x033b('0x32')]=_0xf8b466['attributes'][_0x033b('0x34')]?_0xf8b466[_0x033b('0x32')]:_0x1d388c[_0x033b('0x2d')];_0xf8b466[_0x033b('0x45')]=qs[_0x033b('0x46')](_0x1b17e9['query'][_0x033b('0x46')]);_0xf8b466[_0x033b('0x39')]=qs[_0x033b('0x30')](_[_0x033b('0x4a')](_0x1b17e9[_0x033b('0x2e')],_0x1d388c[_0x033b('0x30')]));if(_0x1b17e9[_0x033b('0x2e')][_0x033b('0x36')]){_0xf8b466[_0x033b('0x39')]=_[_0x033b('0x37')](_0xf8b466['where'],{'$or':_['map'](_0xf8b466[_0x033b('0x32')],function(_0x4f8d54){var _0x4c35ca={};_0x4c35ca[_0x4f8d54]={'$like':'%'+_0x1b17e9[_0x033b('0x2e')][_0x033b('0x36')]+'%'};return _0x4c35ca;})});}_0xf8b466=_[_0x033b('0x37')]({},_0xf8b466,_0x1b17e9[_0x033b('0x38')]);return _0x116d09[_0x033b('0x4b')](_0xf8b466);}})[_0x033b('0x23')](function(_0xc6f25){if(_0xc6f25){_0xca9baa=_0xc6f25[_0x033b('0x34')];if(!_0x1b17e9[_0x033b('0x2e')][_0x033b('0x35')](_0x033b('0x47'))){_0xf8b466[_0x033b('0x1c')]=qs[_0x033b('0x1c')](_0x1b17e9[_0x033b('0x2e')][_0x033b('0x1c')]);_0xf8b466[_0x033b('0x1e')]=qs[_0x033b('0x1e')](_0x1b17e9[_0x033b('0x2e')][_0x033b('0x1e')]);}return _0x116d09[_0x033b('0x4b')](_0xf8b466);}})[_0x033b('0x23')](function(_0x425241){if(_0x425241){return _0x425241?{'count':_0xca9baa,'rows':_0x425241}:null;}})[_0x033b('0x23')](respondWithResult(_0x1ef4c3,null))['catch'](handleError(_0x1ef4c3,null));};exports[_0x033b('0x4c')]=function(_0xdcfaca,_0x51cfaa,_0x322c1c){var _0x5c8254={};var _0xf17dd2={};var _0x4cd1b6;var _0x46c533;return db[_0x033b('0x28')][_0x033b('0x49')]({'where':{'id':_0xdcfaca[_0x033b('0x42')]['id']}})[_0x033b('0x23')](handleEntityNotFound(_0x51cfaa,null))[_0x033b('0x23')](function(_0x5a0a53){if(_0x5a0a53){_0x4cd1b6=_0x5a0a53;_0xf17dd2[_0x033b('0x2d')]=_['keys'](db['Tag'][_0x033b('0x29')]);_0xf17dd2[_0x033b('0x2e')]=_[_0x033b('0x2f')](_0xdcfaca[_0x033b('0x2e')]);_0xf17dd2['filters']=_[_0x033b('0x31')](_0xf17dd2[_0x033b('0x2d')],_0xf17dd2['query']);_0x5c8254[_0x033b('0x32')]=_[_0x033b('0x31')](_0xf17dd2['model'],qs['fields'](_0xdcfaca[_0x033b('0x2e')][_0x033b('0x33')]));_0x5c8254[_0x033b('0x32')]=_0x5c8254[_0x033b('0x32')][_0x033b('0x34')]?_0x5c8254[_0x033b('0x32')]:_0xf17dd2['model'];_0x5c8254[_0x033b('0x45')]=qs[_0x033b('0x46')](_0xdcfaca[_0x033b('0x2e')]['sort']);_0x5c8254['where']=qs['filters'](_['pick'](_0xdcfaca[_0x033b('0x2e')],_0xf17dd2[_0x033b('0x30')]));if(_0xdcfaca[_0x033b('0x2e')][_0x033b('0x36')]){_0x5c8254[_0x033b('0x39')]=_[_0x033b('0x37')](_0x5c8254[_0x033b('0x39')],{'$or':_['map'](_0x5c8254[_0x033b('0x32')],function(_0x50e087){var _0x3affea={};_0x3affea[_0x50e087]={'$like':'%'+_0xdcfaca[_0x033b('0x2e')][_0x033b('0x36')]+'%'};return _0x3affea;})});}_0x5c8254=_[_0x033b('0x37')]({},_0x5c8254,_0xdcfaca[_0x033b('0x38')]);return _0x4cd1b6[_0x033b('0x4c')](_0x5c8254);}})['then'](function(_0x29cce5){if(_0x29cce5){_0x46c533=_0x29cce5[_0x033b('0x34')];if(!_0xdcfaca[_0x033b('0x2e')][_0x033b('0x35')](_0x033b('0x47'))){_0x5c8254['limit']=qs[_0x033b('0x1c')](_0xdcfaca[_0x033b('0x2e')][_0x033b('0x1c')]);_0x5c8254['offset']=qs['offset'](_0xdcfaca[_0x033b('0x2e')][_0x033b('0x1e')]);}return _0x4cd1b6[_0x033b('0x4c')](_0x5c8254);}})[_0x033b('0x23')](function(_0x145193){if(_0x145193){return _0x145193?{'count':_0x46c533,'rows':_0x145193}:null;}})[_0x033b('0x23')](respondWithResult(_0x51cfaa,null))['catch'](handleError(_0x51cfaa,null));};exports[_0x033b('0x4d')]=function(_0xa508ab,_0x3e6cb6,_0x1e1f61){if(_0xa508ab['body']['id']){delete _0xa508ab[_0x033b('0x40')]['id'];}return db[_0x033b('0x28')][_0x033b('0x49')]({'where':{'id':_0xa508ab['params']['id']}})['then'](handleEntityNotFound(_0x3e6cb6,null))[_0x033b('0x23')](function(_0x4d42bd){if(_0x4d42bd){return _0x4d42bd[_0x033b('0x4d')](_0xa508ab[_0x033b('0x40')][_0x033b('0x4e')]||[]);}return null;})['then'](respondWithResult(_0x3e6cb6,null))['catch'](handleError(_0x3e6cb6,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index d920d9c..c46f2bb 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 _0xa478=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x307c57,_0x2ff9e5){var _0x232faa=function(_0xef7f){while(--_0xef7f){_0x307c57['push'](_0x307c57['shift']());}};_0x232faa(++_0x2ff9e5);}(_0xa478,0x136));var _0x8a47=function(_0x577519,_0x346daf){_0x577519=_0x577519-0x0;var _0x5b12f7=_0xa478[_0x577519];return _0x5b12f7;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var logger=require(_0x8a47('0x2'))(_0x8a47('0x3'));var moment=require(_0x8a47('0x4'));var BPromise=require(_0x8a47('0x5'));var rp=require(_0x8a47('0x6'));var fs=require('fs');var path=require(_0x8a47('0x7'));var rimraf=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var attributes=require(_0x8a47('0xa'));module[_0x8a47('0xb')]=function(_0x50226a,_0x413787){return _0x50226a[_0x8a47('0xc')](_0x8a47('0xd'),attributes,{'tableName':_0x8a47('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2e=['exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x18ca9a,_0x54e125){_0x18ca9a=_0x18ca9a-0x0;var _0x303b50=_0x4e2e[_0x18ca9a];return _0x303b50;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index c7cf27b..e8a1396 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 _0x5104=['ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5104,0x1a1));var _0x4510=function(_0x58176f,_0x55a4e5){_0x58176f=_0x58176f-0x0;var _0x14ccb0=_0x5104[_0x58176f];return _0x14ccb0;};'use strict';var _=require(_0x4510('0x0'));var util=require(_0x4510('0x1'));var moment=require('moment');var BPromise=require(_0x4510('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4510('0x3'));var db=require(_0x4510('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4510('0x5'));var config=require('../../config/environment');var jayson=require(_0x4510('0x6'));var client=jayson[_0x4510('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x596e5a,_0x5b2f35,_0x54b44d){return new BPromise(function(_0x5475c3,_0x26ffe5){return client[_0x4510('0x8')](_0x596e5a,_0x54b44d)[_0x4510('0x9')](function(_0x13563b){logger[_0x4510('0xa')](_0x4510('0xb'),_0x5b2f35,_0x4510('0xc'));logger['debug'](_0x4510('0xd'),_0x5b2f35,_0x4510('0xc'),JSON[_0x4510('0xe')](_0x13563b));if(_0x13563b['error']){if(_0x13563b[_0x4510('0xf')][_0x4510('0x10')]===0x1f4){logger[_0x4510('0xf')](_0x4510('0xb'),_0x5b2f35,_0x13563b[_0x4510('0xf')][_0x4510('0x11')]);return _0x26ffe5(_0x13563b[_0x4510('0xf')][_0x4510('0x11')]);}logger[_0x4510('0xf')](_0x4510('0xb'),_0x5b2f35,_0x13563b[_0x4510('0xf')][_0x4510('0x11')]);return _0x5475c3(_0x13563b['error'][_0x4510('0x11')]);}else{logger[_0x4510('0xa')](_0x4510('0xb'),_0x5b2f35,_0x4510('0xc'));_0x5475c3(_0x13563b[_0x4510('0x12')][_0x4510('0x11')]);}})[_0x4510('0x13')](function(_0xc0bd82){logger[_0x4510('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5b2f35,_0xc0bd82);_0x26ffe5(_0xc0bd82);});});} \ No newline at end of file +var _0xfc9b=['then','info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x465598,_0x41e0f2){var _0x120e61=function(_0x4df322){while(--_0x4df322){_0x465598['push'](_0x465598['shift']());}};_0x120e61(++_0x41e0f2);}(_0xfc9b,0x11c));var _0xbfc9=function(_0x197abd,_0x4b3f5b){_0x197abd=_0x197abd-0x0;var _0x5d9ead=_0xfc9b[_0x197abd];return _0x5d9ead;};'use strict';var _=require('lodash');var util=require(_0xbfc9('0x0'));var moment=require(_0xbfc9('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfc9('0x2'));var fs=require('fs');var Redis=require(_0xbfc9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfc9('0x4'));var logger=require('../../config/logger')(_0xbfc9('0x5'));var config=require(_0xbfc9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbfc9('0x7')][_0xbfc9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53ce36,_0xe507cd,_0x49bbb0){return new BPromise(function(_0x53f4f6,_0x29fcb6){return client[_0xbfc9('0x9')](_0x53ce36,_0x49bbb0)[_0xbfc9('0xa')](function(_0x179c1b){logger[_0xbfc9('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe507cd,'request\x20sent');logger[_0xbfc9('0xc')](_0xbfc9('0xd'),_0xe507cd,_0xbfc9('0xe'),JSON['stringify'](_0x179c1b));if(_0x179c1b[_0xbfc9('0xf')]){if(_0x179c1b[_0xbfc9('0xf')][_0xbfc9('0x10')]===0x1f4){logger['error'](_0xbfc9('0x11'),_0xe507cd,_0x179c1b['error']['message']);return _0x29fcb6(_0x179c1b[_0xbfc9('0xf')][_0xbfc9('0x12')]);}logger[_0xbfc9('0xf')](_0xbfc9('0x11'),_0xe507cd,_0x179c1b[_0xbfc9('0xf')]['message']);return _0x53f4f6(_0x179c1b[_0xbfc9('0xf')][_0xbfc9('0x12')]);}else{logger[_0xbfc9('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe507cd,_0xbfc9('0xe'));_0x53f4f6(_0x179c1b[_0xbfc9('0x13')][_0xbfc9('0x12')]);}})[_0xbfc9('0x14')](function(_0x500465){logger[_0xbfc9('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe507cd,_0x500465);_0x29fcb6(_0x500465);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index cad0569..99e280f 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 _0x8a50=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','get','show','create','/:id','destroy'];(function(_0x2e7efe,_0x3042da){var _0x36b081=function(_0x202721){while(--_0x202721){_0x2e7efe['push'](_0x2e7efe['shift']());}};_0x36b081(++_0x3042da);}(_0x8a50,0xd3));var _0x08a5=function(_0x56aa47,_0x2eef13){_0x56aa47=_0x56aa47-0x0;var _0x543726=_0x8a50[_0x56aa47];return _0x543726;};'use strict';var multer=require('multer');var util=require(_0x08a5('0x0'));var path=require(_0x08a5('0x1'));var timeout=require(_0x08a5('0x2'));var express=require('express');var router=express[_0x08a5('0x3')]();var fs_extra=require(_0x08a5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x08a5('0x5'));var config=require(_0x08a5('0x6'));var controller=require(_0x08a5('0x7'));router['get']('/',auth[_0x08a5('0x8')](),controller['index']);router[_0x08a5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x08a5('0xa')]);router['post']('/',auth[_0x08a5('0x8')](),controller[_0x08a5('0xb')]);router['put'](_0x08a5('0xc'),auth[_0x08a5('0x8')](),controller['update']);router['delete'](_0x08a5('0xc'),auth[_0x08a5('0x8')](),controller[_0x08a5('0xd')]);module[_0x08a5('0xe')]=router; \ No newline at end of file +var _0xdc60=['show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xdc60,0x127));var _0x0dc6=function(_0x2a59af,_0x18d558){_0x2a59af=_0x2a59af-0x0;var _0x3af243=_0xdc60[_0x2a59af];return _0x3af243;};'use strict';var multer=require(_0x0dc6('0x0'));var util=require(_0x0dc6('0x1'));var path=require(_0x0dc6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0dc6('0x3'));var router=express[_0x0dc6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0dc6('0x5'));var interaction=require(_0x0dc6('0x6'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0x0dc6('0x7')]('/',auth['isAuthenticated'](),controller[_0x0dc6('0x8')]);router[_0x0dc6('0x7')](_0x0dc6('0x9'),auth[_0x0dc6('0xa')](),controller[_0x0dc6('0xb')]);router['post']('/',auth[_0x0dc6('0xa')](),controller[_0x0dc6('0xc')]);router[_0x0dc6('0xd')](_0x0dc6('0x9'),auth[_0x0dc6('0xa')](),controller[_0x0dc6('0xe')]);router[_0x0dc6('0xf')]('/:id',auth[_0x0dc6('0xa')](),controller[_0x0dc6('0x10')]);module[_0x0dc6('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 31635ad..5578c6a 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 _0xb8fb=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x486b21,_0x100589){var _0x455aaa=function(_0x3e9853){while(--_0x3e9853){_0x486b21['push'](_0x486b21['shift']());}};_0x455aaa(++_0x100589);}(_0xb8fb,0xf6));var _0xbb8f=function(_0x4e960f,_0x348a2){_0x4e960f=_0x4e960f-0x0;var _0x384373=_0xb8fb[_0x4e960f];return _0x384373;};'use strict';var Sequelize=require(_0xbb8f('0x0'));module[_0xbb8f('0x1')]={'type':{'type':Sequelize[_0xbb8f('0x2')](_0xbb8f('0x3'),_0xbb8f('0x4'),_0xbb8f('0x5'),'keyValue',_0xbb8f('0x6')),'defaultValue':_0xbb8f('0x3')},'content':{'type':Sequelize[_0xbb8f('0x7')]},'key':{'type':Sequelize[_0xbb8f('0x7')]},'keyType':{'type':Sequelize[_0xbb8f('0x2')](_0xbb8f('0x3'),_0xbb8f('0x4'),_0xbb8f('0x5'))},'keyContent':{'type':Sequelize[_0xbb8f('0x7')]},'idField':{'type':Sequelize[_0xbb8f('0x7')]},'nameField':{'type':Sequelize[_0xbb8f('0x7')]},'customField':{'type':Sequelize[_0xbb8f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa31a=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa31a,0x11f));var _0xaa31=function(_0xe0a414,_0x4112ca){_0xe0a414=_0xe0a414-0x0;var _0x3d2bef=_0xa31a[_0xe0a414];return _0x3d2bef;};'use strict';var Sequelize=require(_0xaa31('0x0'));module[_0xaa31('0x1')]={'type':{'type':Sequelize[_0xaa31('0x2')](_0xaa31('0x3'),'variable',_0xaa31('0x4'),_0xaa31('0x5'),_0xaa31('0x6')),'defaultValue':_0xaa31('0x3')},'content':{'type':Sequelize[_0xaa31('0x7')]},'key':{'type':Sequelize[_0xaa31('0x7')]},'keyType':{'type':Sequelize[_0xaa31('0x2')](_0xaa31('0x3'),_0xaa31('0x8'),_0xaa31('0x4'))},'keyContent':{'type':Sequelize[_0xaa31('0x7')]},'idField':{'type':Sequelize[_0xaa31('0x7')]},'nameField':{'type':Sequelize[_0xaa31('0x7')]},'customField':{'type':Sequelize[_0xaa31('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaa31('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 06cd9bc..807c132 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 _0x057f=['includeAll','findAll','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','ZendeskField'];(function(_0x21f268,_0x1346fa){var _0x5b93c7=function(_0xfe67eb){while(--_0xfe67eb){_0x21f268['push'](_0x21f268['shift']());}};_0x5b93c7(++_0x1346fa);}(_0x057f,0x1d7));var _0xf057=function(_0x3bdbe8,_0x454de8){_0x3bdbe8=_0x3bdbe8-0x0;var _0x280e62=_0x057f[_0x3bdbe8];return _0x280e62;};'use strict';var emlformat=require(_0xf057('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf057('0x1'));var jsonpatch=require(_0xf057('0x2'));var rp=require(_0xf057('0x3'));var moment=require('moment');var BPromise=require(_0xf057('0x4'));var Mustache=require(_0xf057('0x5'));var util=require(_0xf057('0x6'));var path=require(_0xf057('0x7'));var sox=require(_0xf057('0x8'));var csv=require(_0xf057('0x9'));var ejs=require(_0xf057('0xa'));var fs=require('fs');var fs_extra=require(_0xf057('0xb'));var _=require(_0xf057('0xc'));var squel=require(_0xf057('0xd'));var crypto=require(_0xf057('0xe'));var jsforce=require(_0xf057('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf057('0x10'));var Papa=require(_0xf057('0x11'));var Redis=require('ioredis');var authService=require(_0xf057('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf057('0x13'));var hardwareService=require(_0xf057('0x14'));var logger=require(_0xf057('0x15'))(_0xf057('0x16'));var utils=require('../../config/utils');var config=require(_0xf057('0x17'));var licenseUtil=require(_0xf057('0x18'));var db=require(_0xf057('0x19'))['db'];function respondWithStatusCode(_0x2df8c1,_0x49084f){_0x49084f=_0x49084f||0xcc;return function(_0x28fdbf){if(_0x28fdbf){return _0x2df8c1['sendStatus'](_0x49084f);}return _0x2df8c1[_0xf057('0x1a')](_0x49084f)['end']();};}function respondWithResult(_0x18e093,_0x7aedae){_0x7aedae=_0x7aedae||0xc8;return function(_0x19f17c){if(_0x19f17c){return _0x18e093[_0xf057('0x1a')](_0x7aedae)[_0xf057('0x1b')](_0x19f17c);}};}function respondWithFilteredResult(_0x324521,_0x452256){return function(_0x2d69f3){if(_0x2d69f3){var _0x4a8580=typeof _0x452256[_0xf057('0x1c')]==='undefined'&&typeof _0x452256[_0xf057('0x1d')]===_0xf057('0x1e');var _0x5567b0=_0x2d69f3[_0xf057('0x1f')];var _0x2b1505=_0x4a8580?0x0:_0x452256[_0xf057('0x1c')];var _0x3343da=_0x4a8580?_0x2d69f3[_0xf057('0x1f')]:_0x452256[_0xf057('0x1c')]+_0x452256['limit'];var _0xab6f0e;if(_0x3343da>=_0x5567b0){_0x3343da=_0x5567b0;_0xab6f0e=0xc8;}else{_0xab6f0e=0xce;}_0x324521['status'](_0xab6f0e);return _0x324521[_0xf057('0x20')](_0xf057('0x21'),_0x2b1505+'-'+_0x3343da+'/'+_0x5567b0)[_0xf057('0x1b')](_0x2d69f3);}return null;};}function patchUpdates(_0x56ecb9){return function(_0x2ba2af){try{jsonpatch[_0xf057('0x22')](_0x2ba2af,_0x56ecb9,!![]);}catch(_0x33bc31){return BPromise[_0xf057('0x23')](_0x33bc31);}return _0x2ba2af[_0xf057('0x24')]();};}function saveUpdates(_0x4e9870,_0x2e5c86){return function(_0x3f2bdb){if(_0x3f2bdb){return _0x3f2bdb[_0xf057('0x25')](_0x4e9870)[_0xf057('0x26')](function(_0x8b4b4b){return _0x8b4b4b;});}return null;};}function removeEntity(_0x46eb6a,_0xd0c217){return function(_0xd49736){if(_0xd49736){return _0xd49736[_0xf057('0x27')]()[_0xf057('0x26')](function(){_0x46eb6a[_0xf057('0x1a')](0xcc)[_0xf057('0x28')]();});}};}function handleEntityNotFound(_0xaf45e4,_0x30c225){return function(_0x2c2a9c){if(!_0x2c2a9c){_0xaf45e4[_0xf057('0x29')](0x194);}return _0x2c2a9c;};}function handleError(_0x29d218,_0x32cccb){_0x32cccb=_0x32cccb||0x1f4;return function(_0x275c29){logger['error'](_0x275c29[_0xf057('0x2a')]);if(_0x275c29[_0xf057('0x2b')]){delete _0x275c29['name'];}_0x29d218['status'](_0x32cccb)[_0xf057('0x2c')](_0x275c29);};}exports[_0xf057('0x2d')]=function(_0x3a564e,_0x4d3a33){var _0x2daff5={},_0x12b4a8={},_0x46eecb={'count':0x0,'rows':[]};var _0x305e8e=_[_0xf057('0x2e')](db['ZendeskField']['rawAttributes'],function(_0x55035a){return{'name':_0x55035a[_0xf057('0x2f')],'type':_0x55035a['type'][_0xf057('0x30')]};});_0x12b4a8[_0xf057('0x31')]=_[_0xf057('0x2e')](_0x305e8e,'name');_0x12b4a8[_0xf057('0x32')]=_[_0xf057('0x33')](_0x3a564e[_0xf057('0x32')]);_0x12b4a8[_0xf057('0x34')]=_[_0xf057('0x35')](_0x12b4a8[_0xf057('0x31')],_0x12b4a8[_0xf057('0x32')]);_0x2daff5[_0xf057('0x36')]=_[_0xf057('0x35')](_0x12b4a8[_0xf057('0x31')],qs[_0xf057('0x37')](_0x3a564e[_0xf057('0x32')][_0xf057('0x37')]));_0x2daff5[_0xf057('0x36')]=_0x2daff5['attributes'][_0xf057('0x38')]?_0x2daff5['attributes']:_0x12b4a8[_0xf057('0x31')];if(!_0x3a564e[_0xf057('0x32')][_0xf057('0x39')](_0xf057('0x3a'))){_0x2daff5[_0xf057('0x1d')]=qs[_0xf057('0x1d')](_0x3a564e[_0xf057('0x32')][_0xf057('0x1d')]);_0x2daff5[_0xf057('0x1c')]=qs[_0xf057('0x1c')](_0x3a564e[_0xf057('0x32')][_0xf057('0x1c')]);}_0x2daff5['order']=qs[_0xf057('0x3b')](_0x3a564e[_0xf057('0x32')][_0xf057('0x3b')]);_0x2daff5[_0xf057('0x3c')]=qs[_0xf057('0x34')](_[_0xf057('0x3d')](_0x3a564e['query'],_0x12b4a8[_0xf057('0x34')]),_0x305e8e);if(_0x3a564e[_0xf057('0x32')][_0xf057('0x3e')]){_0x2daff5['where']=_[_0xf057('0x3f')](_0x2daff5[_0xf057('0x3c')],{'$or':_[_0xf057('0x2e')](_0x305e8e,function(_0x31569d){if(_0x31569d[_0xf057('0x40')]!==_0xf057('0x41')){var _0x323122={};_0x323122[_0x31569d[_0xf057('0x2b')]]={'$like':'%'+_0x3a564e[_0xf057('0x32')][_0xf057('0x3e')]+'%'};return _0x323122;}})});}_0x2daff5=_[_0xf057('0x3f')]({},_0x2daff5,_0x3a564e[_0xf057('0x42')]);var _0x497432={'where':_0x2daff5[_0xf057('0x3c')]};return db[_0xf057('0x43')][_0xf057('0x1f')](_0x497432)[_0xf057('0x26')](function(_0x3574da){_0x46eecb[_0xf057('0x1f')]=_0x3574da;if(_0x3a564e[_0xf057('0x32')][_0xf057('0x44')]){_0x2daff5['include']=[{'all':!![]}];}return db[_0xf057('0x43')][_0xf057('0x45')](_0x2daff5);})[_0xf057('0x26')](function(_0x456753){_0x46eecb['rows']=_0x456753;return _0x46eecb;})['then'](respondWithFilteredResult(_0x4d3a33,_0x2daff5))[_0xf057('0x46')](handleError(_0x4d3a33,null));};exports[_0xf057('0x47')]=function(_0x136c22,_0x1c99ba){var _0x1eb15b={'raw':!![],'where':{'id':_0x136c22[_0xf057('0x48')]['id']}},_0x3db34e={};_0x3db34e[_0xf057('0x31')]=_[_0xf057('0x33')](db['ZendeskField']['rawAttributes']);_0x3db34e['query']=_['keys'](_0x136c22[_0xf057('0x32')]);_0x3db34e[_0xf057('0x34')]=_['intersection'](_0x3db34e[_0xf057('0x31')],_0x3db34e['query']);_0x1eb15b[_0xf057('0x36')]=_[_0xf057('0x35')](_0x3db34e[_0xf057('0x31')],qs[_0xf057('0x37')](_0x136c22['query'][_0xf057('0x37')]));_0x1eb15b[_0xf057('0x36')]=_0x1eb15b['attributes'][_0xf057('0x38')]?_0x1eb15b[_0xf057('0x36')]:_0x3db34e[_0xf057('0x31')];if(_0x136c22[_0xf057('0x32')][_0xf057('0x44')]){_0x1eb15b[_0xf057('0x49')]=[{'all':!![]}];}_0x1eb15b=_[_0xf057('0x3f')]({},_0x1eb15b,_0x136c22[_0xf057('0x42')]);return db[_0xf057('0x43')][_0xf057('0x4a')](_0x1eb15b)['then'](handleEntityNotFound(_0x1c99ba,null))[_0xf057('0x26')](respondWithResult(_0x1c99ba,null))['catch'](handleError(_0x1c99ba,null));};exports[_0xf057('0x4b')]=function(_0xe5fb94,_0x33695e){return db[_0xf057('0x43')][_0xf057('0x4b')](_0xe5fb94['body'],{})[_0xf057('0x26')](respondWithResult(_0x33695e,0xc9))[_0xf057('0x46')](handleError(_0x33695e,null));};exports[_0xf057('0x25')]=function(_0x5a63a5,_0x3a78d9){if(_0x5a63a5[_0xf057('0x4c')]['id']){delete _0x5a63a5[_0xf057('0x4c')]['id'];}return db[_0xf057('0x43')]['find']({'where':{'id':_0x5a63a5[_0xf057('0x48')]['id']}})[_0xf057('0x26')](handleEntityNotFound(_0x3a78d9,null))['then'](saveUpdates(_0x5a63a5['body'],null))['then'](respondWithResult(_0x3a78d9,null))['catch'](handleError(_0x3a78d9,null));};exports['destroy']=function(_0x4de66f,_0x54bb7a){return db['ZendeskField'][_0xf057('0x4a')]({'where':{'id':_0x4de66f['params']['id']}})[_0xf057('0x26')](handleEntityNotFound(_0x54bb7a,null))[_0xf057('0x26')](removeEntity(_0x54bb7a,null))[_0xf057('0x46')](handleError(_0x54bb7a,null));}; \ No newline at end of file +var _0x843b=['save','then','destroy','end','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x843b,0xc5));var _0xb843=function(_0xa95a9c,_0x5c7354){_0xa95a9c=_0xa95a9c-0x0;var _0x37e5e1=_0x843b[_0xa95a9c];return _0x37e5e1;};'use strict';var emlformat=require(_0xb843('0x0'));var rimraf=require(_0xb843('0x1'));var zipdir=require(_0xb843('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb843('0x3'));var moment=require(_0xb843('0x4'));var BPromise=require(_0xb843('0x5'));var Mustache=require(_0xb843('0x6'));var util=require(_0xb843('0x7'));var path=require(_0xb843('0x8'));var sox=require(_0xb843('0x9'));var csv=require(_0xb843('0xa'));var ejs=require(_0xb843('0xb'));var fs=require('fs');var fs_extra=require(_0xb843('0xc'));var _=require(_0xb843('0xd'));var squel=require(_0xb843('0xe'));var crypto=require(_0xb843('0xf'));var jsforce=require(_0xb843('0x10'));var deskjs=require(_0xb843('0x11'));var toCsv=require(_0xb843('0xa'));var querystring=require('querystring');var Papa=require(_0xb843('0x12'));var Redis=require(_0xb843('0x13'));var authService=require(_0xb843('0x14'));var qs=require(_0xb843('0x15'));var as=require(_0xb843('0x16'));var hardwareService=require(_0xb843('0x17'));var logger=require(_0xb843('0x18'))('api');var utils=require(_0xb843('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb843('0x1a'));var db=require(_0xb843('0x1b'))['db'];function respondWithStatusCode(_0x2fc2a9,_0x3ab55e){_0x3ab55e=_0x3ab55e||0xcc;return function(_0x2f8e71){if(_0x2f8e71){return _0x2fc2a9[_0xb843('0x1c')](_0x3ab55e);}return _0x2fc2a9[_0xb843('0x1d')](_0x3ab55e)['end']();};}function respondWithResult(_0x5a7cc6,_0x17e748){_0x17e748=_0x17e748||0xc8;return function(_0x2986b7){if(_0x2986b7){return _0x5a7cc6['status'](_0x17e748)['json'](_0x2986b7);}};}function respondWithFilteredResult(_0xa6984,_0x3d9ce2){return function(_0x1c4a1c){if(_0x1c4a1c){var _0x58b770=typeof _0x3d9ce2[_0xb843('0x1e')]===_0xb843('0x1f')&&typeof _0x3d9ce2[_0xb843('0x20')]===_0xb843('0x1f');var _0x15a892=_0x1c4a1c[_0xb843('0x21')];var _0x1925b3=_0x58b770?0x0:_0x3d9ce2[_0xb843('0x1e')];var _0x5035f3=_0x58b770?_0x1c4a1c[_0xb843('0x21')]:_0x3d9ce2[_0xb843('0x1e')]+_0x3d9ce2[_0xb843('0x20')];var _0x40e8e0;if(_0x5035f3>=_0x15a892){_0x5035f3=_0x15a892;_0x40e8e0=0xc8;}else{_0x40e8e0=0xce;}_0xa6984[_0xb843('0x1d')](_0x40e8e0);return _0xa6984['set']('Content-Range',_0x1925b3+'-'+_0x5035f3+'/'+_0x15a892)[_0xb843('0x22')](_0x1c4a1c);}return null;};}function patchUpdates(_0x33abbb){return function(_0x4c8d8b){try{jsonpatch[_0xb843('0x23')](_0x4c8d8b,_0x33abbb,!![]);}catch(_0x208036){return BPromise[_0xb843('0x24')](_0x208036);}return _0x4c8d8b[_0xb843('0x25')]();};}function saveUpdates(_0x44dadc,_0x3215be){return function(_0x2e56a8){if(_0x2e56a8){return _0x2e56a8['update'](_0x44dadc)[_0xb843('0x26')](function(_0x1afd57){return _0x1afd57;});}return null;};}function removeEntity(_0x53a689,_0x395045){return function(_0x33c3a4){if(_0x33c3a4){return _0x33c3a4[_0xb843('0x27')]()['then'](function(){_0x53a689[_0xb843('0x1d')](0xcc)[_0xb843('0x28')]();});}};}function handleEntityNotFound(_0x3d771d,_0x499859){return function(_0x5623ad){if(!_0x5623ad){_0x3d771d['sendStatus'](0x194);}return _0x5623ad;};}function handleError(_0x3cd3b0,_0x39ade6){_0x39ade6=_0x39ade6||0x1f4;return function(_0x5bdba8){logger[_0xb843('0x29')](_0x5bdba8[_0xb843('0x2a')]);if(_0x5bdba8[_0xb843('0x2b')]){delete _0x5bdba8[_0xb843('0x2b')];}_0x3cd3b0[_0xb843('0x1d')](_0x39ade6)[_0xb843('0x2c')](_0x5bdba8);};}exports['index']=function(_0xd9565c,_0xf34316){var _0x1753e5={},_0x4bc8e5={},_0x3fe943={'count':0x0,'rows':[]};var _0x3ace8d=_[_0xb843('0x2d')](db[_0xb843('0x2e')][_0xb843('0x2f')],function(_0x5d8a72){return{'name':_0x5d8a72[_0xb843('0x30')],'type':_0x5d8a72[_0xb843('0x31')]['key']};});_0x4bc8e5[_0xb843('0x32')]=_['map'](_0x3ace8d,_0xb843('0x2b'));_0x4bc8e5[_0xb843('0x33')]=_['keys'](_0xd9565c['query']);_0x4bc8e5['filters']=_[_0xb843('0x34')](_0x4bc8e5[_0xb843('0x32')],_0x4bc8e5['query']);_0x1753e5[_0xb843('0x35')]=_[_0xb843('0x34')](_0x4bc8e5[_0xb843('0x32')],qs[_0xb843('0x36')](_0xd9565c[_0xb843('0x33')]['fields']));_0x1753e5[_0xb843('0x35')]=_0x1753e5[_0xb843('0x35')][_0xb843('0x37')]?_0x1753e5[_0xb843('0x35')]:_0x4bc8e5['model'];if(!_0xd9565c[_0xb843('0x33')][_0xb843('0x38')](_0xb843('0x39'))){_0x1753e5['limit']=qs[_0xb843('0x20')](_0xd9565c[_0xb843('0x33')][_0xb843('0x20')]);_0x1753e5[_0xb843('0x1e')]=qs[_0xb843('0x1e')](_0xd9565c['query']['offset']);}_0x1753e5[_0xb843('0x3a')]=qs['sort'](_0xd9565c[_0xb843('0x33')][_0xb843('0x3b')]);_0x1753e5[_0xb843('0x3c')]=qs[_0xb843('0x3d')](_[_0xb843('0x3e')](_0xd9565c[_0xb843('0x33')],_0x4bc8e5[_0xb843('0x3d')]),_0x3ace8d);if(_0xd9565c[_0xb843('0x33')][_0xb843('0x3f')]){_0x1753e5['where']=_[_0xb843('0x40')](_0x1753e5[_0xb843('0x3c')],{'$or':_[_0xb843('0x2d')](_0x3ace8d,function(_0x537911){if(_0x537911[_0xb843('0x31')]!=='VIRTUAL'){var _0x539ad3={};_0x539ad3[_0x537911[_0xb843('0x2b')]]={'$like':'%'+_0xd9565c[_0xb843('0x33')]['filter']+'%'};return _0x539ad3;}})});}_0x1753e5=_[_0xb843('0x40')]({},_0x1753e5,_0xd9565c[_0xb843('0x41')]);var _0x19f0d2={'where':_0x1753e5['where']};return db[_0xb843('0x2e')][_0xb843('0x21')](_0x19f0d2)['then'](function(_0x19032f){_0x3fe943[_0xb843('0x21')]=_0x19032f;if(_0xd9565c[_0xb843('0x33')][_0xb843('0x42')]){_0x1753e5[_0xb843('0x43')]=[{'all':!![]}];}return db[_0xb843('0x2e')][_0xb843('0x44')](_0x1753e5);})[_0xb843('0x26')](function(_0x5399af){_0x3fe943[_0xb843('0x45')]=_0x5399af;return _0x3fe943;})['then'](respondWithFilteredResult(_0xf34316,_0x1753e5))[_0xb843('0x46')](handleError(_0xf34316,null));};exports[_0xb843('0x47')]=function(_0x275fa8,_0x3cc51e){var _0x8e5b6f={'raw':!![],'where':{'id':_0x275fa8['params']['id']}},_0x518ce0={};_0x518ce0[_0xb843('0x32')]=_[_0xb843('0x48')](db['ZendeskField'][_0xb843('0x2f')]);_0x518ce0['query']=_['keys'](_0x275fa8['query']);_0x518ce0[_0xb843('0x3d')]=_[_0xb843('0x34')](_0x518ce0[_0xb843('0x32')],_0x518ce0[_0xb843('0x33')]);_0x8e5b6f[_0xb843('0x35')]=_['intersection'](_0x518ce0[_0xb843('0x32')],qs[_0xb843('0x36')](_0x275fa8['query'][_0xb843('0x36')]));_0x8e5b6f[_0xb843('0x35')]=_0x8e5b6f[_0xb843('0x35')][_0xb843('0x37')]?_0x8e5b6f[_0xb843('0x35')]:_0x518ce0[_0xb843('0x32')];if(_0x275fa8[_0xb843('0x33')][_0xb843('0x42')]){_0x8e5b6f[_0xb843('0x43')]=[{'all':!![]}];}_0x8e5b6f=_[_0xb843('0x40')]({},_0x8e5b6f,_0x275fa8['options']);return db['ZendeskField'][_0xb843('0x49')](_0x8e5b6f)[_0xb843('0x26')](handleEntityNotFound(_0x3cc51e,null))[_0xb843('0x26')](respondWithResult(_0x3cc51e,null))['catch'](handleError(_0x3cc51e,null));};exports['create']=function(_0x461f5c,_0x4a6604){return db[_0xb843('0x2e')][_0xb843('0x4a')](_0x461f5c[_0xb843('0x4b')],{})[_0xb843('0x26')](respondWithResult(_0x4a6604,0xc9))[_0xb843('0x46')](handleError(_0x4a6604,null));};exports[_0xb843('0x4c')]=function(_0x2fedeb,_0x4f2d1f){if(_0x2fedeb[_0xb843('0x4b')]['id']){delete _0x2fedeb['body']['id'];}return db[_0xb843('0x2e')][_0xb843('0x49')]({'where':{'id':_0x2fedeb[_0xb843('0x4d')]['id']}})[_0xb843('0x26')](handleEntityNotFound(_0x4f2d1f,null))[_0xb843('0x26')](saveUpdates(_0x2fedeb[_0xb843('0x4b')],null))[_0xb843('0x26')](respondWithResult(_0x4f2d1f,null))[_0xb843('0x46')](handleError(_0x4f2d1f,null));};exports[_0xb843('0x27')]=function(_0x4aff81,_0x330c89){return db[_0xb843('0x2e')][_0xb843('0x49')]({'where':{'id':_0x4aff81[_0xb843('0x4d')]['id']}})[_0xb843('0x26')](handleEntityNotFound(_0x330c89,null))[_0xb843('0x26')](removeEntity(_0x330c89,null))['catch'](handleError(_0x330c89,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e3ab752..b437323 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 _0xa854=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0x4612df,_0x37a8f7){var _0x2804c6=function(_0x2b1979){while(--_0x2b1979){_0x4612df['push'](_0x4612df['shift']());}};_0x2804c6(++_0x37a8f7);}(_0xa854,0x135));var _0x4a85=function(_0x1f1b8f,_0x380e36){_0x1f1b8f=_0x1f1b8f-0x0;var _0x2a5cef=_0xa854[_0x1f1b8f];return _0x2a5cef;};'use strict';var _=require(_0x4a85('0x0'));var util=require(_0x4a85('0x1'));var logger=require(_0x4a85('0x2'))('api');var moment=require(_0x4a85('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a85('0x4'));var fs=require('fs');var path=require(_0x4a85('0x5'));var rimraf=require(_0x4a85('0x6'));var config=require(_0x4a85('0x7'));var attributes=require(_0x4a85('0x8'));module[_0x4a85('0x9')]=function(_0x3b1c24,_0x3a8705){return _0x3b1c24[_0x4a85('0xa')](_0x4a85('0xb'),attributes,{'tableName':_0x4a85('0xc'),'paranoid':![],'indexes':[{'name':_0x4a85('0xd'),'fields':[_0x4a85('0xe'),_0x4a85('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7976=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','zendesk_unique_index','idField','util','../../config/logger','moment'];(function(_0x52797d,_0x28b539){var _0x5d3a49=function(_0x4d26cb){while(--_0x4d26cb){_0x52797d['push'](_0x52797d['shift']());}};_0x5d3a49(++_0x28b539);}(_0x7976,0xcd));var _0x6797=function(_0xc2a57a,_0x1aff8c){_0xc2a57a=_0xc2a57a-0x0;var _0xe8a404=_0x7976[_0xc2a57a];return _0xe8a404;};'use strict';var _=require('lodash');var util=require(_0x6797('0x0'));var logger=require(_0x6797('0x1'))('api');var moment=require(_0x6797('0x2'));var BPromise=require(_0x6797('0x3'));var rp=require(_0x6797('0x4'));var fs=require('fs');var path=require(_0x6797('0x5'));var rimraf=require(_0x6797('0x6'));var config=require(_0x6797('0x7'));var attributes=require(_0x6797('0x8'));module[_0x6797('0x9')]=function(_0x14f95d,_0x4cec31){return _0x14f95d['define'](_0x6797('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x6797('0xb'),'fields':[_0x6797('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index b662743..7dd8e50 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 _0x2bbb=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x14f981,_0x25545a){var _0x5f36bc=function(_0x4fe8df){while(--_0x4fe8df){_0x14f981['push'](_0x14f981['shift']());}};_0x5f36bc(++_0x25545a);}(_0x2bbb,0x96));var _0xb2bb=function(_0x2b51fc,_0x2e92e1){_0x2b51fc=_0x2b51fc-0x0;var _0x30de71=_0x2bbb[_0x2b51fc];return _0x30de71;};'use strict';var _=require(_0xb2bb('0x0'));var util=require(_0xb2bb('0x1'));var moment=require(_0xb2bb('0x2'));var BPromise=require('bluebird');var rs=require(_0xb2bb('0x3'));var fs=require('fs');var Redis=require(_0xb2bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb2bb('0x5'))(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var jayson=require(_0xb2bb('0x8'));var client=jayson[_0xb2bb('0x9')][_0xb2bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c0a30,_0x1ba095,_0x280d50){return new BPromise(function(_0x242162,_0x1c36ad){return client[_0xb2bb('0xb')](_0x2c0a30,_0x280d50)[_0xb2bb('0xc')](function(_0x2606ad){logger[_0xb2bb('0xd')](_0xb2bb('0xe'),_0x1ba095,_0xb2bb('0xf'));logger[_0xb2bb('0x10')](_0xb2bb('0x11'),_0x1ba095,_0xb2bb('0xf'),JSON[_0xb2bb('0x12')](_0x2606ad));if(_0x2606ad[_0xb2bb('0x13')]){if(_0x2606ad['error'][_0xb2bb('0x14')]===0x1f4){logger[_0xb2bb('0x13')](_0xb2bb('0xe'),_0x1ba095,_0x2606ad[_0xb2bb('0x13')]['message']);return _0x1c36ad(_0x2606ad[_0xb2bb('0x13')][_0xb2bb('0x15')]);}logger['error'](_0xb2bb('0xe'),_0x1ba095,_0x2606ad[_0xb2bb('0x13')][_0xb2bb('0x15')]);return _0x242162(_0x2606ad['error']['message']);}else{logger[_0xb2bb('0xd')](_0xb2bb('0xe'),_0x1ba095,_0xb2bb('0xf'));_0x242162(_0x2606ad[_0xb2bb('0x16')]['message']);}})[_0xb2bb('0x17')](function(_0x1b50e){logger[_0xb2bb('0x13')](_0xb2bb('0xe'),_0x1ba095,_0x1b50e);_0x1c36ad(_0x1b50e);});});} \ No newline at end of file +var _0x514c=['util','moment','randomstring','../../mysqldb','rpc','client','http','request','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x514c,0x1b4));var _0xc514=function(_0x222df6,_0x4922fc){_0x222df6=_0x222df6-0x0;var _0x1c1368=_0x514c[_0x222df6];return _0x1c1368;};'use strict';var _=require(_0xc514('0x0'));var util=require(_0xc514('0x1'));var moment=require(_0xc514('0x2'));var BPromise=require('bluebird');var rs=require(_0xc514('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc514('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc514('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc514('0x6')][_0xc514('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x39b2b7,_0x49002a,_0x24f94e){return new BPromise(function(_0xe6bb1c,_0x92e517){return client[_0xc514('0x8')](_0x39b2b7,_0x24f94e)['then'](function(_0x1762fb){logger[_0xc514('0x9')](_0xc514('0xa'),_0x49002a,'request\x20sent');logger[_0xc514('0xb')](_0xc514('0xc'),_0x49002a,_0xc514('0xd'),JSON[_0xc514('0xe')](_0x1762fb));if(_0x1762fb[_0xc514('0xf')]){if(_0x1762fb[_0xc514('0xf')][_0xc514('0x10')]===0x1f4){logger[_0xc514('0xf')](_0xc514('0xa'),_0x49002a,_0x1762fb[_0xc514('0xf')][_0xc514('0x11')]);return _0x92e517(_0x1762fb[_0xc514('0xf')][_0xc514('0x11')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x49002a,_0x1762fb[_0xc514('0xf')][_0xc514('0x11')]);return _0xe6bb1c(_0x1762fb[_0xc514('0xf')]['message']);}else{logger[_0xc514('0x9')]('ZendeskField,\x20%s,\x20%s',_0x49002a,_0xc514('0xd'));_0xe6bb1c(_0x1762fb['result'][_0xc514('0x11')]);}})[_0xc514('0x12')](function(_0x1b3e1f){logger[_0xc514('0xf')](_0xc514('0xa'),_0x49002a,_0x1b3e1f);_0x92e517(_0x1b3e1f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 0b0d089..f301825 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 _0xdb8a=['getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x406e1d,_0x11c99c){var _0x1d05e7=function(_0x1cf251){while(--_0x1cf251){_0x406e1d['push'](_0x406e1d['shift']());}};_0x1d05e7(++_0x11c99c);}(_0xdb8a,0xef));var _0xadb8=function(_0x32c3c2,_0x42a5bf){_0x32c3c2=_0x32c3c2-0x0;var _0x43070a=_0xdb8a[_0x32c3c2];return _0x43070a;};'use strict';var multer=require('multer');var util=require(_0xadb8('0x0'));var path=require(_0xadb8('0x1'));var timeout=require(_0xadb8('0x2'));var express=require(_0xadb8('0x3'));var router=express[_0xadb8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xadb8('0x5'));var config=require(_0xadb8('0x6'));var controller=require(_0xadb8('0x7'));router[_0xadb8('0x8')]('/',auth[_0xadb8('0x9')](),controller[_0xadb8('0xa')]);router['get'](_0xadb8('0xb'),auth[_0xadb8('0x9')](),controller[_0xadb8('0xc')]);router[_0xadb8('0x8')](_0xadb8('0xd'),auth[_0xadb8('0x9')](),controller[_0xadb8('0xe')]);router['get'](_0xadb8('0xf'),auth[_0xadb8('0x9')](),controller[_0xadb8('0x10')]);router[_0xadb8('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xadb8('0x11')](_0xadb8('0xd'),auth['isAuthenticated'](),controller[_0xadb8('0x12')]);router['put']('/:id',auth[_0xadb8('0x9')](),controller[_0xadb8('0x13')]);router[_0xadb8('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xadb8('0x15')]);module[_0xadb8('0x16')]=router; \ No newline at end of file +var _0x7a7e=['create','addConfiguration','put','update','exports','path','connect-timeout','Router','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x4a4e50,_0x5b3636){var _0x2b6507=function(_0x4f854c){while(--_0x4f854c){_0x4a4e50['push'](_0x4a4e50['shift']());}};_0x2b6507(++_0x5b3636);}(_0x7a7e,0x115));var _0xe7a7=function(_0x6f1937,_0x2ee34b){_0x6f1937=_0x6f1937-0x0;var _0x479fde=_0x7a7e[_0x6f1937];return _0x479fde;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7a7('0x0'));var timeout=require(_0xe7a7('0x1'));var express=require('express');var router=express[_0xe7a7('0x2')]();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('./intZohoAccount.controller');router[_0xe7a7('0x3')]('/',auth[_0xe7a7('0x4')](),controller[_0xe7a7('0x5')]);router[_0xe7a7('0x3')](_0xe7a7('0x6'),auth['isAuthenticated'](),controller[_0xe7a7('0x7')]);router[_0xe7a7('0x3')](_0xe7a7('0x8'),auth[_0xe7a7('0x4')](),controller[_0xe7a7('0x9')]);router[_0xe7a7('0x3')](_0xe7a7('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0xe7a7('0xb')]('/',auth[_0xe7a7('0x4')](),controller[_0xe7a7('0xc')]);router[_0xe7a7('0xb')](_0xe7a7('0x8'),auth[_0xe7a7('0x4')](),controller[_0xe7a7('0xd')]);router[_0xe7a7('0xe')]('/:id',auth[_0xe7a7('0x4')](),controller[_0xe7a7('0xf')]);router['delete']('/:id',auth[_0xe7a7('0x4')](),controller['destroy']);module[_0xe7a7('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index be8b739..737f953 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 _0xb4e6=['sequelize','STRING'];(function(_0x4b868a,_0x2ddc54){var _0x5c2499=function(_0x22d51d){while(--_0x22d51d){_0x4b868a['push'](_0x4b868a['shift']());}};_0x5c2499(++_0x2ddc54);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0xb4e6[_0x212bf5];return _0xfcad21;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b4e('0x1')]},'description':{'type':Sequelize[_0x6b4e('0x1')]},'host':{'type':Sequelize[_0x6b4e('0x1')]},'zone':{'type':Sequelize[_0x6b4e('0x1')]},'clientId':{'type':Sequelize[_0x6b4e('0x1')]},'clientSecret':{'type':Sequelize[_0x6b4e('0x1')]},'serverUrl':{'type':Sequelize[_0x6b4e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x6b4e('0x1')]}}; \ No newline at end of file +var _0xec56=['STRING','sequelize'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xec56,0x1bd));var _0x6ec5=function(_0x1a4aa3,_0x3ccbad){_0x1a4aa3=_0x1a4aa3-0x0;var _0x31d480=_0xec56[_0x1a4aa3];return _0x31d480;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ec5('0x1')]},'host':{'type':Sequelize[_0x6ec5('0x1')]},'zone':{'type':Sequelize[_0x6ec5('0x1')]},'clientId':{'type':Sequelize[_0x6ec5('0x1')]},'clientSecret':{'type':Sequelize[_0x6ec5('0x1')]},'serverUrl':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x6ec5('0x1')]},'refreshToken':{'type':Sequelize[_0x6ec5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 7932198..7379dd6 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 _0xf3fe=['Unable\x20to\x20retrieve\x20the\x20access\x20token','host','code','refreshToken','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Subject','WhoId','Call_Duration','Call_Result','remove','includes','api_name','push','display_label','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','error','stack','name','index','map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','ZohoAccount','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','pick','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0xf3fe,0x196));var _0xef3f=function(_0xf55b4d,_0x210d76){_0xf55b4d=_0xf55b4d-0x0;var _0x32a8fa=_0xf3fe[_0xf55b4d];return _0x32a8fa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xef3f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef3f('0x1'));var BPromise=require(_0xef3f('0x2'));var Mustache=require(_0xef3f('0x3'));var util=require(_0xef3f('0x4'));var path=require(_0xef3f('0x5'));var sox=require('sox');var csv=require(_0xef3f('0x6'));var ejs=require(_0xef3f('0x7'));var fs=require('fs');var fs_extra=require(_0xef3f('0x8'));var _=require(_0xef3f('0x9'));var squel=require(_0xef3f('0xa'));var crypto=require(_0xef3f('0xb'));var jsforce=require(_0xef3f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xef3f('0x6'));var querystring=require(_0xef3f('0xd'));var Papa=require('papaparse');var Redis=require(_0xef3f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xef3f('0xf'));var hardwareService=require(_0xef3f('0x10'));var logger=require('../../config/logger')(_0xef3f('0x11'));var utils=require(_0xef3f('0x12'));var config=require(_0xef3f('0x13'));var licenseUtil=require(_0xef3f('0x14'));var db=require(_0xef3f('0x15'))['db'];var integrations=require(_0xef3f('0x16'));function respondWithStatusCode(_0x448a8e,_0x11cad9){_0x11cad9=_0x11cad9||0xcc;return function(_0x506f84){if(_0x506f84){return _0x448a8e[_0xef3f('0x17')](_0x11cad9);}return _0x448a8e[_0xef3f('0x18')](_0x11cad9)['end']();};}function respondWithResult(_0x28ba4e,_0x80cb93){_0x80cb93=_0x80cb93||0xc8;return function(_0xe7d4ac){if(_0xe7d4ac){return _0x28ba4e[_0xef3f('0x18')](_0x80cb93)[_0xef3f('0x19')](_0xe7d4ac);}};}function respondWithFilteredResult(_0x48c912,_0x1087bd){return function(_0x56235d){if(_0x56235d){var _0xbb78d4=typeof _0x1087bd[_0xef3f('0x1a')]===_0xef3f('0x1b')&&typeof _0x1087bd[_0xef3f('0x1c')]===_0xef3f('0x1b');var _0x1a53b7=_0x56235d[_0xef3f('0x1d')];var _0x6b2002=_0xbb78d4?0x0:_0x1087bd[_0xef3f('0x1a')];var _0x39f4b6=_0xbb78d4?_0x56235d[_0xef3f('0x1d')]:_0x1087bd[_0xef3f('0x1a')]+_0x1087bd[_0xef3f('0x1c')];var _0x15f540;if(_0x39f4b6>=_0x1a53b7){_0x39f4b6=_0x1a53b7;_0x15f540=0xc8;}else{_0x15f540=0xce;}_0x48c912[_0xef3f('0x18')](_0x15f540);return _0x48c912[_0xef3f('0x1e')](_0xef3f('0x1f'),_0x6b2002+'-'+_0x39f4b6+'/'+_0x1a53b7)['json'](_0x56235d);}return null;};}function patchUpdates(_0x94deb5){return function(_0x1ed173){try{jsonpatch[_0xef3f('0x20')](_0x1ed173,_0x94deb5,!![]);}catch(_0x410933){return BPromise[_0xef3f('0x21')](_0x410933);}return _0x1ed173[_0xef3f('0x22')]();};}function saveUpdates(_0x1e7cc9,_0x4664c2){return function(_0x50c3ed){if(_0x50c3ed){return _0x50c3ed['update'](_0x1e7cc9)['then'](function(_0x2eb59d){return _0x2eb59d;});}return null;};}function removeEntity(_0xced169,_0x455daf){return function(_0x169688){if(_0x169688){return _0x169688['destroy']()[_0xef3f('0x23')](function(){_0xced169[_0xef3f('0x18')](0xcc)[_0xef3f('0x24')]();});}};}function handleEntityNotFound(_0x427cf2,_0x5634e1){return function(_0x94c46){if(!_0x94c46){_0x427cf2[_0xef3f('0x17')](0x194);}return _0x94c46;};}function handleError(_0x3c176d,_0x7d0830){_0x7d0830=_0x7d0830||0x1f4;return function(_0x5533a0){logger[_0xef3f('0x25')](_0x5533a0[_0xef3f('0x26')]);if(_0x5533a0[_0xef3f('0x27')]){delete _0x5533a0[_0xef3f('0x27')];}_0x3c176d['status'](_0x7d0830)['send'](_0x5533a0);};}exports[_0xef3f('0x28')]=function(_0x1b738c,_0x2eca36){var _0x3c1fbc={},_0x3faa00={},_0x270663={'count':0x0,'rows':[]};var _0x27d87a=_[_0xef3f('0x29')](db['ZohoAccount']['rawAttributes'],function(_0x390d03){return{'name':_0x390d03[_0xef3f('0x2a')],'type':_0x390d03['type']['key']};});_0x3faa00[_0xef3f('0x2b')]=_[_0xef3f('0x29')](_0x27d87a,'name');_0x3faa00[_0xef3f('0x2c')]=_[_0xef3f('0x2d')](_0x1b738c[_0xef3f('0x2c')]);_0x3faa00[_0xef3f('0x2e')]=_[_0xef3f('0x2f')](_0x3faa00[_0xef3f('0x2b')],_0x3faa00['query']);_0x3c1fbc['attributes']=_[_0xef3f('0x2f')](_0x3faa00['model'],qs[_0xef3f('0x30')](_0x1b738c['query']['fields']));_0x3c1fbc[_0xef3f('0x31')]=_0x3c1fbc[_0xef3f('0x31')][_0xef3f('0x32')]?_0x3c1fbc[_0xef3f('0x31')]:_0x3faa00[_0xef3f('0x2b')];if(!_0x1b738c['query'][_0xef3f('0x33')](_0xef3f('0x34'))){_0x3c1fbc[_0xef3f('0x1c')]=qs[_0xef3f('0x1c')](_0x1b738c['query'][_0xef3f('0x1c')]);_0x3c1fbc[_0xef3f('0x1a')]=qs[_0xef3f('0x1a')](_0x1b738c[_0xef3f('0x2c')][_0xef3f('0x1a')]);}_0x3c1fbc[_0xef3f('0x35')]=qs[_0xef3f('0x36')](_0x1b738c[_0xef3f('0x2c')][_0xef3f('0x36')]);_0x3c1fbc[_0xef3f('0x37')]=qs[_0xef3f('0x2e')](_['pick'](_0x1b738c[_0xef3f('0x2c')],_0x3faa00[_0xef3f('0x2e')]),_0x27d87a);if(_0x1b738c['query'][_0xef3f('0x38')]){_0x3c1fbc['where']=_[_0xef3f('0x39')](_0x3c1fbc[_0xef3f('0x37')],{'$or':_['map'](_0x27d87a,function(_0x408b63){if(_0x408b63[_0xef3f('0x3a')]!==_0xef3f('0x3b')){var _0x4e9a58={};_0x4e9a58[_0x408b63[_0xef3f('0x27')]]={'$like':'%'+_0x1b738c[_0xef3f('0x2c')][_0xef3f('0x38')]+'%'};return _0x4e9a58;}})});}_0x3c1fbc=_[_0xef3f('0x39')]({},_0x3c1fbc,_0x1b738c[_0xef3f('0x3c')]);var _0x5969fa={'where':_0x3c1fbc[_0xef3f('0x37')]};return db['ZohoAccount'][_0xef3f('0x1d')](_0x5969fa)[_0xef3f('0x23')](function(_0x30327d){_0x270663[_0xef3f('0x1d')]=_0x30327d;if(_0x1b738c[_0xef3f('0x2c')][_0xef3f('0x3d')]){_0x3c1fbc['include']=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x3c1fbc);})['then'](function(_0x1a1873){_0x270663[_0xef3f('0x3e')]=_0x1a1873;return _0x270663;})[_0xef3f('0x23')](respondWithFilteredResult(_0x2eca36,_0x3c1fbc))[_0xef3f('0x3f')](handleError(_0x2eca36,null));};exports[_0xef3f('0x40')]=function(_0x114d44,_0x25fc5d){var _0x335476={'raw':![],'where':{'id':_0x114d44[_0xef3f('0x41')]['id']}},_0xf51916={};_0xf51916[_0xef3f('0x2b')]=_[_0xef3f('0x2d')](db['ZohoAccount'][_0xef3f('0x42')]);_0xf51916[_0xef3f('0x2c')]=_[_0xef3f('0x2d')](_0x114d44[_0xef3f('0x2c')]);_0xf51916[_0xef3f('0x2e')]=_['intersection'](_0xf51916['model'],_0xf51916['query']);_0x335476['attributes']=_[_0xef3f('0x2f')](_0xf51916['model'],qs['fields'](_0x114d44[_0xef3f('0x2c')]['fields']));_0x335476[_0xef3f('0x31')]=_0x335476[_0xef3f('0x31')][_0xef3f('0x32')]?_0x335476[_0xef3f('0x31')]:_0xf51916['model'];if(_0x114d44['query'][_0xef3f('0x3d')]){_0x335476[_0xef3f('0x43')]=[{'all':!![]}];}_0x335476=_[_0xef3f('0x39')]({},_0x335476,_0x114d44[_0xef3f('0x3c')]);return db[_0xef3f('0x44')][_0xef3f('0x45')](_0x335476)[_0xef3f('0x23')](handleEntityNotFound(_0x25fc5d,null))[_0xef3f('0x23')](respondWithResult(_0x25fc5d,null))[_0xef3f('0x3f')](handleError(_0x25fc5d,null));};exports[_0xef3f('0x46')]=function(_0x53e95f,_0xf7f099){return db[_0xef3f('0x44')][_0xef3f('0x46')](_0x53e95f[_0xef3f('0x47')],{})[_0xef3f('0x23')](respondWithResult(_0xf7f099,0xc9))[_0xef3f('0x3f')](handleError(_0xf7f099,null));};exports[_0xef3f('0x48')]=function(_0x140bda,_0x15c305){if(_0x140bda[_0xef3f('0x47')]['id']){delete _0x140bda[_0xef3f('0x47')]['id'];}return db[_0xef3f('0x44')][_0xef3f('0x45')]({'where':{'id':_0x140bda[_0xef3f('0x41')]['id']}})[_0xef3f('0x23')](handleEntityNotFound(_0x15c305,null))[_0xef3f('0x23')](saveUpdates(_0x140bda[_0xef3f('0x47')],null))[_0xef3f('0x23')](respondWithResult(_0x15c305,null))['catch'](handleError(_0x15c305,null));};exports['destroy']=function(_0x12a260,_0x3ef29c){return db[_0xef3f('0x44')][_0xef3f('0x45')]({'where':{'id':_0x12a260[_0xef3f('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ef29c,null))[_0xef3f('0x23')](removeEntity(_0x3ef29c,null))[_0xef3f('0x3f')](handleError(_0x3ef29c,null));};exports[_0xef3f('0x49')]=function(_0x4d437d,_0x198241,_0x107612){var _0x3bd4a7={};var _0x4f5c20={};var _0x2ec23a;var _0x4e1a02;return db[_0xef3f('0x44')][_0xef3f('0x4a')]({'where':{'id':_0x4d437d[_0xef3f('0x41')]['id']}})[_0xef3f('0x23')](handleEntityNotFound(_0x198241,null))['then'](function(_0x48b0dc){if(_0x48b0dc){_0x2ec23a=_0x48b0dc;_0x4f5c20[_0xef3f('0x2b')]=_[_0xef3f('0x2d')](db[_0xef3f('0x4b')]['rawAttributes']);_0x4f5c20[_0xef3f('0x2c')]=_['keys'](_0x4d437d[_0xef3f('0x2c')]);_0x4f5c20[_0xef3f('0x2e')]=_['intersection'](_0x4f5c20['model'],_0x4f5c20[_0xef3f('0x2c')]);_0x3bd4a7['attributes']=_['intersection'](_0x4f5c20['model'],qs[_0xef3f('0x30')](_0x4d437d[_0xef3f('0x2c')][_0xef3f('0x30')]));_0x3bd4a7[_0xef3f('0x31')]=_0x3bd4a7[_0xef3f('0x31')][_0xef3f('0x32')]?_0x3bd4a7['attributes']:_0x4f5c20[_0xef3f('0x2b')];_0x3bd4a7[_0xef3f('0x35')]=qs[_0xef3f('0x36')](_0x4d437d[_0xef3f('0x2c')]['sort']);_0x3bd4a7[_0xef3f('0x37')]=qs['filters'](_[_0xef3f('0x4c')](_0x4d437d['query'],_0x4f5c20[_0xef3f('0x2e')]));if(_0x4d437d[_0xef3f('0x2c')]['filter']){_0x3bd4a7[_0xef3f('0x37')]=_[_0xef3f('0x39')](_0x3bd4a7['where'],{'$or':_[_0xef3f('0x29')](_0x3bd4a7[_0xef3f('0x31')],function(_0x5bd7dd){var _0x48c550={};_0x48c550[_0x5bd7dd]={'$like':'%'+_0x4d437d[_0xef3f('0x2c')][_0xef3f('0x38')]+'%'};return _0x48c550;})});}_0x3bd4a7=_[_0xef3f('0x39')]({},_0x3bd4a7,_0x4d437d[_0xef3f('0x3c')]);return _0x2ec23a[_0xef3f('0x49')](_0x3bd4a7);}})[_0xef3f('0x23')](function(_0x1bdc17){if(_0x1bdc17){_0x4e1a02=_0x1bdc17[_0xef3f('0x32')];if(!_0x4d437d[_0xef3f('0x2c')][_0xef3f('0x33')](_0xef3f('0x34'))){_0x3bd4a7[_0xef3f('0x1c')]=qs[_0xef3f('0x1c')](_0x4d437d[_0xef3f('0x2c')][_0xef3f('0x1c')]);_0x3bd4a7[_0xef3f('0x1a')]=qs[_0xef3f('0x1a')](_0x4d437d[_0xef3f('0x2c')][_0xef3f('0x1a')]);}return _0x2ec23a[_0xef3f('0x49')](_0x3bd4a7);}})[_0xef3f('0x23')](function(_0x502fc8){if(_0x502fc8){return _0x502fc8?{'count':_0x4e1a02,'rows':_0x502fc8}:null;}})[_0xef3f('0x23')](respondWithResult(_0x198241,null))['catch'](handleError(_0x198241,null));};exports['addConfiguration']=function(_0x790ee4,_0x28db0d,_0x2a804d){if(_0x790ee4[_0xef3f('0x47')]['id']){delete _0x790ee4['body']['id'];}return db[_0xef3f('0x44')][_0xef3f('0x4a')]({'where':{'id':_0x790ee4[_0xef3f('0x41')]['id']}})[_0xef3f('0x23')](handleEntityNotFound(_0x28db0d,null))[_0xef3f('0x23')](function(_0xe8e9ab){if(_0xe8e9ab){_0x790ee4[_0xef3f('0x47')]['AccountId']=_0xe8e9ab['id'];_0x790ee4[_0xef3f('0x47')][_0xef3f('0x4d')]=integrations[_0xef3f('0x4e')](_0x790ee4['body'][_0xef3f('0x4f')],_0x790ee4[_0xef3f('0x47')][_0xef3f('0x3a')]);_0x790ee4['body'][_0xef3f('0x50')]=integrations[_0xef3f('0x51')](_0x790ee4['body'][_0xef3f('0x4f')],_0x790ee4['body'][_0xef3f('0x3a')]);return db[_0xef3f('0x4b')]['create'](_0x790ee4[_0xef3f('0x47')],{'include':[{'model':db['ZohoField'],'as':_0xef3f('0x4d')},{'model':db[_0xef3f('0x52')],'as':_0xef3f('0x50')}]});}return null;})[_0xef3f('0x23')](respondWithResult(_0x28db0d,null))[_0xef3f('0x3f')](handleError(_0x28db0d,null));};function getAccessToken(_0x6ebde1){return new Promise(function(_0x5b1abb,_0x3bc94e){var _0x3f57c5;switch(_0x6ebde1[_0xef3f('0x53')]){case'US':_0x3f57c5=_0xef3f('0x54');break;case'AU':_0x3f57c5='https://accounts.zoho.com.au';break;case'EU':_0x3f57c5=_0xef3f('0x55');break;case'IN':_0x3f57c5=_0xef3f('0x56');break;case'CN':_0x3f57c5=_0xef3f('0x57');break;default:_0x3f57c5='https://accounts.zoho.eu';break;}var _0x977e0a={'method':_0xef3f('0x58'),'uri':_0x3f57c5+_0xef3f('0x59'),'qs':{'refresh_token':_0x6ebde1['refreshToken'],'client_id':_0x6ebde1[_0xef3f('0x5a')],'client_secret':_0x6ebde1[_0xef3f('0x5b')],'grant_type':_0xef3f('0x5c')},'json':!![]};return rp(_0x977e0a)[_0xef3f('0x23')](function(_0x16c13f){if(_0x16c13f[_0xef3f('0x5d')]){_0x5b1abb(_0x16c13f['access_token']);}else{_0x3bc94e(_0xef3f('0x5e'));}})[_0xef3f('0x3f')](function(_0x218771){_0x3bc94e(_0x218771);});});}exports['getFields']=function(_0x1660fc,_0x3ed5a7,_0x17b381){var _0x2ff5ff,_0x264c8f,_0x44d5dd,_0x31322b,_0x1a2926;return db[_0xef3f('0x44')][_0xef3f('0x4a')]({'where':{'id':_0x1660fc[_0xef3f('0x41')]['id']},'attributes':['id',_0xef3f('0x5f'),_0xef3f('0x53'),'clientId',_0xef3f('0x5b'),'serverUrl',_0xef3f('0x60'),_0xef3f('0x61')]})[_0xef3f('0x23')](handleEntityNotFound(_0x3ed5a7,null))[_0xef3f('0x23')](function(_0x2798bc){_0x1a2926=_0x2798bc;_0x2ff5ff=_0x1a2926[_0xef3f('0x5f')];_0x264c8f=_0x2ff5ff===_0xef3f('0x62')?'eu':'com';_0x44d5dd=_0x1a2926['serverUrl'];var _0x1173c2=_0x44d5dd[_0xef3f('0x63')](-0x1);if(_0x1173c2==='/'||_0x1173c2==='\x5c'||_0x1173c2===':'){_0x44d5dd=_0x44d5dd[_0xef3f('0x64')](0x0,_0x44d5dd[_0xef3f('0x65')](_0x1173c2));}if(!_0x1a2926[_0xef3f('0x61')]){throw new Error(_0xef3f('0x66'));}return getAccessToken(_0x1a2926);})[_0xef3f('0x23')](function(_0xbbc11d){if(_0xbbc11d){return rp({'method':_0xef3f('0x67'),'uri':util['format'](_0xef3f('0x68'),_0x264c8f),'qs':{'module':_0xef3f('0x69')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xbbc11d},'json':!![]});}})[_0xef3f('0x23')](function(_0x5bc1be){if(_0x5bc1be){if(_0x5bc1be[_0xef3f('0x6a')]&&_0x5bc1be[_0xef3f('0x6a')]['error']){throw new Error(_0x5bc1be[_0xef3f('0x6a')][_0xef3f('0x25')][_0xef3f('0x6b')]);}var _0x4b831f=[];var _0x21cdeb=[];var _0x27bc3b=['Owner',_0xef3f('0x6c'),'Description',_0xef3f('0x6d'),_0xef3f('0x6e'),_0xef3f('0x6f'),'Call_Start_Time','Call_Type'];_0x21cdeb=_[_0xef3f('0x70')](_0x5bc1be[_0xef3f('0x30')],function(_0x17d8d2){return _0x27bc3b[_0xef3f('0x71')](_0x17d8d2[_0xef3f('0x72')]);});for(var _0x6aa04=0x0;_0x6aa04<_0x21cdeb[_0xef3f('0x32')];_0x6aa04++){if(_0x21cdeb[_0x6aa04]['system_mandatory']===![]){_0x4b831f[_0xef3f('0x73')]({'id':_0x21cdeb[_0x6aa04]['id'],'name':_0x21cdeb[_0x6aa04][_0xef3f('0x74')],'custom':_0x21cdeb[_0x6aa04]['custom_field'],'options':_0x21cdeb[_0x6aa04][_0xef3f('0x75')]==='picklist'&&_0x21cdeb[_0x6aa04][_0xef3f('0x76')][_0xef3f('0x32')]>-0x1?_[_0xef3f('0x29')](_0x21cdeb[_0x6aa04][_0xef3f('0x76')],function(_0x485523){return{'name':_0x485523,'value':_0x485523};}):[]});}}return{'count':_0x4b831f[_0xef3f('0x32')],'rows':_0x4b831f};}else{return{'count':0x0,'rows':[]};}})[_0xef3f('0x23')](respondWithResult(_0x3ed5a7,null))[_0xef3f('0x3f')](function(_0x49346c){var _0xbcdca6=_0x1660fc[_0xef3f('0x2c')][_0xef3f('0x77')]?0x1f4:_0x49346c[_0xef3f('0x78')]||0x1f4;logger[_0xef3f('0x25')](_0xef3f('0x79'),_0xef3f('0x7a'),_0xbcdca6,JSON[_0xef3f('0x7b')](_0x49346c));delete _0x49346c['name'];if(_0xbcdca6===0x191){_0xbcdca6=0x190;}_0x3ed5a7[_0xef3f('0x18')](_0xbcdca6)['send'](_0x1660fc['query'][_0xef3f('0x77')]?{'message':_0xef3f('0x7c'),'statusCode':_0x49346c[_0xef3f('0x78')]}:_0x49346c);});}; \ No newline at end of file +var _0x5d30=['includeAll','include','findAll','rows','catch','show','find','create','update','body','params','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options'];(function(_0xdf7b6,_0x1cb44c){var _0x13396c=function(_0xfd0a5c){while(--_0xfd0a5c){_0xdf7b6['push'](_0xdf7b6['shift']());}};_0x13396c(++_0x1cb44c);}(_0x5d30,0x1d6));var _0x05d3=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0x5d30[_0x413727];return _0x5f46d7;};'use strict';var emlformat=require(_0x05d3('0x0'));var rimraf=require(_0x05d3('0x1'));var zipdir=require(_0x05d3('0x2'));var jsonpatch=require(_0x05d3('0x3'));var rp=require(_0x05d3('0x4'));var moment=require(_0x05d3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x05d3('0x6'));var util=require(_0x05d3('0x7'));var path=require('path');var sox=require(_0x05d3('0x8'));var csv=require(_0x05d3('0x9'));var ejs=require(_0x05d3('0xa'));var fs=require('fs');var fs_extra=require(_0x05d3('0xb'));var _=require('lodash');var squel=require(_0x05d3('0xc'));var crypto=require(_0x05d3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x05d3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05d3('0xf'));var Papa=require(_0x05d3('0x10'));var Redis=require(_0x05d3('0x11'));var authService=require(_0x05d3('0x12'));var qs=require(_0x05d3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05d3('0x14'));var logger=require(_0x05d3('0x15'))(_0x05d3('0x16'));var utils=require(_0x05d3('0x17'));var config=require(_0x05d3('0x18'));var licenseUtil=require(_0x05d3('0x19'));var db=require(_0x05d3('0x1a'))['db'];var integrations=require(_0x05d3('0x1b'));function respondWithStatusCode(_0x98301f,_0x4e9989){_0x4e9989=_0x4e9989||0xcc;return function(_0x22dd3d){if(_0x22dd3d){return _0x98301f[_0x05d3('0x1c')](_0x4e9989);}return _0x98301f[_0x05d3('0x1d')](_0x4e9989)[_0x05d3('0x1e')]();};}function respondWithResult(_0x5c5a58,_0x8edb15){_0x8edb15=_0x8edb15||0xc8;return function(_0x496849){if(_0x496849){return _0x5c5a58['status'](_0x8edb15)[_0x05d3('0x1f')](_0x496849);}};}function respondWithFilteredResult(_0x339aa0,_0x11a917){return function(_0x19233b){if(_0x19233b){var _0x4a9a1b=typeof _0x11a917['offset']===_0x05d3('0x20')&&typeof _0x11a917['limit']==='undefined';var _0x21c74c=_0x19233b[_0x05d3('0x21')];var _0x149ee1=_0x4a9a1b?0x0:_0x11a917['offset'];var _0x2fb0e6=_0x4a9a1b?_0x19233b['count']:_0x11a917[_0x05d3('0x22')]+_0x11a917['limit'];var _0x29be1a;if(_0x2fb0e6>=_0x21c74c){_0x2fb0e6=_0x21c74c;_0x29be1a=0xc8;}else{_0x29be1a=0xce;}_0x339aa0[_0x05d3('0x1d')](_0x29be1a);return _0x339aa0[_0x05d3('0x23')](_0x05d3('0x24'),_0x149ee1+'-'+_0x2fb0e6+'/'+_0x21c74c)[_0x05d3('0x1f')](_0x19233b);}return null;};}function patchUpdates(_0x2e7030){return function(_0xa91e72){try{jsonpatch[_0x05d3('0x25')](_0xa91e72,_0x2e7030,!![]);}catch(_0x5061e9){return BPromise[_0x05d3('0x26')](_0x5061e9);}return _0xa91e72[_0x05d3('0x27')]();};}function saveUpdates(_0x2a56d6,_0x7d9764){return function(_0xd72d18){if(_0xd72d18){return _0xd72d18['update'](_0x2a56d6)[_0x05d3('0x28')](function(_0x2b2cf5){return _0x2b2cf5;});}return null;};}function removeEntity(_0x38c782,_0x5bd7ad){return function(_0x20f461){if(_0x20f461){return _0x20f461[_0x05d3('0x29')]()[_0x05d3('0x28')](function(){_0x38c782['status'](0xcc)[_0x05d3('0x1e')]();});}};}function handleEntityNotFound(_0x48631b,_0x2b1655){return function(_0x27ccdb){if(!_0x27ccdb){_0x48631b[_0x05d3('0x1c')](0x194);}return _0x27ccdb;};}function handleError(_0x5d68cc,_0x240c89){_0x240c89=_0x240c89||0x1f4;return function(_0x53c23d){logger[_0x05d3('0x2a')](_0x53c23d[_0x05d3('0x2b')]);if(_0x53c23d['name']){delete _0x53c23d[_0x05d3('0x2c')];}_0x5d68cc[_0x05d3('0x1d')](_0x240c89)['send'](_0x53c23d);};}exports[_0x05d3('0x2d')]=function(_0x2888dc,_0x2b6256){var _0x34a6bb={},_0x24baee={},_0x508596={'count':0x0,'rows':[]};var _0x18925a=_[_0x05d3('0x2e')](db[_0x05d3('0x2f')][_0x05d3('0x30')],function(_0x6492f8){return{'name':_0x6492f8[_0x05d3('0x31')],'type':_0x6492f8[_0x05d3('0x32')][_0x05d3('0x33')]};});_0x24baee[_0x05d3('0x34')]=_[_0x05d3('0x2e')](_0x18925a,_0x05d3('0x2c'));_0x24baee[_0x05d3('0x35')]=_[_0x05d3('0x36')](_0x2888dc[_0x05d3('0x35')]);_0x24baee['filters']=_[_0x05d3('0x37')](_0x24baee[_0x05d3('0x34')],_0x24baee[_0x05d3('0x35')]);_0x34a6bb[_0x05d3('0x38')]=_['intersection'](_0x24baee[_0x05d3('0x34')],qs[_0x05d3('0x39')](_0x2888dc[_0x05d3('0x35')][_0x05d3('0x39')]));_0x34a6bb[_0x05d3('0x38')]=_0x34a6bb[_0x05d3('0x38')][_0x05d3('0x3a')]?_0x34a6bb[_0x05d3('0x38')]:_0x24baee[_0x05d3('0x34')];if(!_0x2888dc[_0x05d3('0x35')][_0x05d3('0x3b')](_0x05d3('0x3c'))){_0x34a6bb[_0x05d3('0x3d')]=qs[_0x05d3('0x3d')](_0x2888dc['query']['limit']);_0x34a6bb['offset']=qs['offset'](_0x2888dc[_0x05d3('0x35')][_0x05d3('0x22')]);}_0x34a6bb[_0x05d3('0x3e')]=qs[_0x05d3('0x3f')](_0x2888dc['query'][_0x05d3('0x3f')]);_0x34a6bb[_0x05d3('0x40')]=qs[_0x05d3('0x41')](_[_0x05d3('0x42')](_0x2888dc[_0x05d3('0x35')],_0x24baee[_0x05d3('0x41')]),_0x18925a);if(_0x2888dc[_0x05d3('0x35')][_0x05d3('0x43')]){_0x34a6bb['where']=_[_0x05d3('0x44')](_0x34a6bb['where'],{'$or':_[_0x05d3('0x2e')](_0x18925a,function(_0x49a9ca){if(_0x49a9ca[_0x05d3('0x32')]!=='VIRTUAL'){var _0x2c5677={};_0x2c5677[_0x49a9ca[_0x05d3('0x2c')]]={'$like':'%'+_0x2888dc['query'][_0x05d3('0x43')]+'%'};return _0x2c5677;}})});}_0x34a6bb=_['merge']({},_0x34a6bb,_0x2888dc[_0x05d3('0x45')]);var _0x4c0255={'where':_0x34a6bb[_0x05d3('0x40')]};return db['ZohoAccount'][_0x05d3('0x21')](_0x4c0255)[_0x05d3('0x28')](function(_0x20aaa2){_0x508596[_0x05d3('0x21')]=_0x20aaa2;if(_0x2888dc[_0x05d3('0x35')][_0x05d3('0x46')]){_0x34a6bb[_0x05d3('0x47')]=[{'all':!![]}];}return db[_0x05d3('0x2f')][_0x05d3('0x48')](_0x34a6bb);})[_0x05d3('0x28')](function(_0x20b8e4){_0x508596[_0x05d3('0x49')]=_0x20b8e4;return _0x508596;})[_0x05d3('0x28')](respondWithFilteredResult(_0x2b6256,_0x34a6bb))[_0x05d3('0x4a')](handleError(_0x2b6256,null));};exports[_0x05d3('0x4b')]=function(_0x1ef4da,_0x264341){var _0x443321={'raw':![],'where':{'id':_0x1ef4da['params']['id']}},_0x1d4e3c={};_0x1d4e3c['model']=_[_0x05d3('0x36')](db[_0x05d3('0x2f')][_0x05d3('0x30')]);_0x1d4e3c[_0x05d3('0x35')]=_[_0x05d3('0x36')](_0x1ef4da[_0x05d3('0x35')]);_0x1d4e3c[_0x05d3('0x41')]=_[_0x05d3('0x37')](_0x1d4e3c[_0x05d3('0x34')],_0x1d4e3c[_0x05d3('0x35')]);_0x443321[_0x05d3('0x38')]=_['intersection'](_0x1d4e3c['model'],qs[_0x05d3('0x39')](_0x1ef4da['query'][_0x05d3('0x39')]));_0x443321[_0x05d3('0x38')]=_0x443321['attributes'][_0x05d3('0x3a')]?_0x443321[_0x05d3('0x38')]:_0x1d4e3c[_0x05d3('0x34')];if(_0x1ef4da[_0x05d3('0x35')]['includeAll']){_0x443321['include']=[{'all':!![]}];}_0x443321=_[_0x05d3('0x44')]({},_0x443321,_0x1ef4da[_0x05d3('0x45')]);return db[_0x05d3('0x2f')][_0x05d3('0x4c')](_0x443321)[_0x05d3('0x28')](handleEntityNotFound(_0x264341,null))[_0x05d3('0x28')](respondWithResult(_0x264341,null))[_0x05d3('0x4a')](handleError(_0x264341,null));};exports[_0x05d3('0x4d')]=function(_0x27e391,_0x594646){return db[_0x05d3('0x2f')][_0x05d3('0x4d')](_0x27e391['body'],{})[_0x05d3('0x28')](respondWithResult(_0x594646,0xc9))['catch'](handleError(_0x594646,null));};exports[_0x05d3('0x4e')]=function(_0x27960c,_0x3365a7){if(_0x27960c[_0x05d3('0x4f')]['id']){delete _0x27960c['body']['id'];}return db['ZohoAccount'][_0x05d3('0x4c')]({'where':{'id':_0x27960c['params']['id']}})['then'](handleEntityNotFound(_0x3365a7,null))[_0x05d3('0x28')](saveUpdates(_0x27960c[_0x05d3('0x4f')],null))[_0x05d3('0x28')](respondWithResult(_0x3365a7,null))['catch'](handleError(_0x3365a7,null));};exports[_0x05d3('0x29')]=function(_0x1781fa,_0x8b2b6f){return db['ZohoAccount'][_0x05d3('0x4c')]({'where':{'id':_0x1781fa[_0x05d3('0x50')]['id']}})['then'](handleEntityNotFound(_0x8b2b6f,null))[_0x05d3('0x28')](removeEntity(_0x8b2b6f,null))[_0x05d3('0x4a')](handleError(_0x8b2b6f,null));};exports[_0x05d3('0x51')]=function(_0x2ba30f,_0xed181d,_0x4d942a){var _0xe9d5b4={};var _0x37a151={};var _0x4640c1;var _0x5be4e6;return db[_0x05d3('0x2f')][_0x05d3('0x52')]({'where':{'id':_0x2ba30f[_0x05d3('0x50')]['id']}})[_0x05d3('0x28')](handleEntityNotFound(_0xed181d,null))['then'](function(_0x3b03a5){if(_0x3b03a5){_0x4640c1=_0x3b03a5;_0x37a151[_0x05d3('0x34')]=_[_0x05d3('0x36')](db[_0x05d3('0x53')][_0x05d3('0x30')]);_0x37a151[_0x05d3('0x35')]=_[_0x05d3('0x36')](_0x2ba30f['query']);_0x37a151[_0x05d3('0x41')]=_['intersection'](_0x37a151['model'],_0x37a151[_0x05d3('0x35')]);_0xe9d5b4[_0x05d3('0x38')]=_['intersection'](_0x37a151[_0x05d3('0x34')],qs[_0x05d3('0x39')](_0x2ba30f[_0x05d3('0x35')][_0x05d3('0x39')]));_0xe9d5b4[_0x05d3('0x38')]=_0xe9d5b4['attributes'][_0x05d3('0x3a')]?_0xe9d5b4[_0x05d3('0x38')]:_0x37a151['model'];_0xe9d5b4[_0x05d3('0x3e')]=qs[_0x05d3('0x3f')](_0x2ba30f[_0x05d3('0x35')][_0x05d3('0x3f')]);_0xe9d5b4['where']=qs[_0x05d3('0x41')](_[_0x05d3('0x42')](_0x2ba30f[_0x05d3('0x35')],_0x37a151[_0x05d3('0x41')]));if(_0x2ba30f[_0x05d3('0x35')][_0x05d3('0x43')]){_0xe9d5b4['where']=_[_0x05d3('0x44')](_0xe9d5b4[_0x05d3('0x40')],{'$or':_[_0x05d3('0x2e')](_0xe9d5b4['attributes'],function(_0x3ac931){var _0xd0a7ca={};_0xd0a7ca[_0x3ac931]={'$like':'%'+_0x2ba30f[_0x05d3('0x35')][_0x05d3('0x43')]+'%'};return _0xd0a7ca;})});}_0xe9d5b4=_[_0x05d3('0x44')]({},_0xe9d5b4,_0x2ba30f[_0x05d3('0x45')]);return _0x4640c1[_0x05d3('0x51')](_0xe9d5b4);}})[_0x05d3('0x28')](function(_0x4ac2bf){if(_0x4ac2bf){_0x5be4e6=_0x4ac2bf[_0x05d3('0x3a')];if(!_0x2ba30f[_0x05d3('0x35')][_0x05d3('0x3b')](_0x05d3('0x3c'))){_0xe9d5b4[_0x05d3('0x3d')]=qs[_0x05d3('0x3d')](_0x2ba30f[_0x05d3('0x35')][_0x05d3('0x3d')]);_0xe9d5b4['offset']=qs[_0x05d3('0x22')](_0x2ba30f[_0x05d3('0x35')][_0x05d3('0x22')]);}return _0x4640c1[_0x05d3('0x51')](_0xe9d5b4);}})[_0x05d3('0x28')](function(_0x348b11){if(_0x348b11){return _0x348b11?{'count':_0x5be4e6,'rows':_0x348b11}:null;}})[_0x05d3('0x28')](respondWithResult(_0xed181d,null))['catch'](handleError(_0xed181d,null));};exports[_0x05d3('0x54')]=function(_0x52669a,_0x27b683,_0x1ac25f){if(_0x52669a['body']['id']){delete _0x52669a[_0x05d3('0x4f')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x52669a[_0x05d3('0x50')]['id']}})[_0x05d3('0x28')](handleEntityNotFound(_0x27b683,null))[_0x05d3('0x28')](function(_0xc4518f){if(_0xc4518f){_0x52669a[_0x05d3('0x4f')][_0x05d3('0x55')]=_0xc4518f['id'];_0x52669a[_0x05d3('0x4f')][_0x05d3('0x56')]=integrations[_0x05d3('0x57')](_0x52669a[_0x05d3('0x4f')][_0x05d3('0x58')],_0x52669a[_0x05d3('0x4f')][_0x05d3('0x32')]);_0x52669a[_0x05d3('0x4f')]['Descriptions']=integrations['getDescriptions'](_0x52669a[_0x05d3('0x4f')][_0x05d3('0x58')],_0x52669a['body'][_0x05d3('0x32')]);return db['ZohoConfiguration'][_0x05d3('0x4d')](_0x52669a[_0x05d3('0x4f')],{'include':[{'model':db['ZohoField'],'as':_0x05d3('0x56')},{'model':db[_0x05d3('0x59')],'as':_0x05d3('0x5a')}]});}return null;})[_0x05d3('0x28')](respondWithResult(_0x27b683,null))[_0x05d3('0x4a')](handleError(_0x27b683,null));};function getAccessToken(_0x454bc4){return new Promise(function(_0x381029,_0x395eaa){var _0x4692b3;switch(_0x454bc4[_0x05d3('0x5b')]){case'US':_0x4692b3=_0x05d3('0x5c');break;case'AU':_0x4692b3=_0x05d3('0x5d');break;case'EU':_0x4692b3=_0x05d3('0x5e');break;case'IN':_0x4692b3='https://accounts.zoho.in';break;case'CN':_0x4692b3='https://accounts.zoho.com.cn';break;default:_0x4692b3=_0x05d3('0x5e');break;}var _0x50c6a7={'method':'POST','uri':_0x4692b3+_0x05d3('0x5f'),'qs':{'refresh_token':_0x454bc4[_0x05d3('0x60')],'client_id':_0x454bc4[_0x05d3('0x61')],'client_secret':_0x454bc4[_0x05d3('0x62')],'grant_type':_0x05d3('0x63')},'json':!![]};return rp(_0x50c6a7)[_0x05d3('0x28')](function(_0x260894){if(_0x260894[_0x05d3('0x64')]){_0x381029(_0x260894[_0x05d3('0x64')]);}else{_0x395eaa(_0x05d3('0x65'));}})['catch'](function(_0x4801c5){_0x395eaa(_0x4801c5);});});}exports[_0x05d3('0x66')]=function(_0x3ec9f1,_0x167693,_0x1ff917){var _0x3251a4,_0x2bd141,_0x3e1c74,_0x46bc35,_0x231df5;return db[_0x05d3('0x2f')][_0x05d3('0x52')]({'where':{'id':_0x3ec9f1[_0x05d3('0x50')]['id']},'attributes':['id',_0x05d3('0x67'),_0x05d3('0x5b'),_0x05d3('0x61'),_0x05d3('0x62'),_0x05d3('0x68'),'code','refreshToken']})[_0x05d3('0x28')](handleEntityNotFound(_0x167693,null))[_0x05d3('0x28')](function(_0x490d9b){_0x231df5=_0x490d9b;_0x3251a4=_0x231df5[_0x05d3('0x67')];_0x2bd141=_0x3251a4===_0x05d3('0x69')?'eu':'com';_0x3e1c74=_0x231df5[_0x05d3('0x68')];var _0xa6411c=_0x3e1c74[_0x05d3('0x6a')](-0x1);if(_0xa6411c==='/'||_0xa6411c==='\x5c'||_0xa6411c===':'){_0x3e1c74=_0x3e1c74[_0x05d3('0x6b')](0x0,_0x3e1c74['lastIndexOf'](_0xa6411c));}if(!_0x231df5['refreshToken']){throw new Error(_0x05d3('0x6c'));}return getAccessToken(_0x231df5);})[_0x05d3('0x28')](function(_0x34199b){if(_0x34199b){return rp({'method':'GET','uri':util[_0x05d3('0x6d')](_0x05d3('0x6e'),_0x2bd141),'qs':{'module':_0x05d3('0x6f')},'headers':{'Authorization':_0x05d3('0x70')+_0x34199b},'json':!![]});}})[_0x05d3('0x28')](function(_0x3654d3){if(_0x3654d3){if(_0x3654d3[_0x05d3('0x71')]&&_0x3654d3['response']['error']){throw new Error(_0x3654d3['response'][_0x05d3('0x2a')][_0x05d3('0x72')]);}var _0x595ff1=[];var _0x2cdfca=[];var _0x1c37aa=[_0x05d3('0x73'),'Subject',_0x05d3('0x74'),'WhoId','Call_Duration',_0x05d3('0x75'),_0x05d3('0x76'),_0x05d3('0x77')];_0x2cdfca=_[_0x05d3('0x78')](_0x3654d3[_0x05d3('0x39')],function(_0x135f63){return _0x1c37aa[_0x05d3('0x79')](_0x135f63[_0x05d3('0x7a')]);});for(var _0x26d0d4=0x0;_0x26d0d4<_0x2cdfca[_0x05d3('0x3a')];_0x26d0d4++){if(_0x2cdfca[_0x26d0d4][_0x05d3('0x7b')]===![]){_0x595ff1[_0x05d3('0x7c')]({'id':_0x2cdfca[_0x26d0d4]['id'],'name':_0x2cdfca[_0x26d0d4][_0x05d3('0x7d')],'custom':_0x2cdfca[_0x26d0d4][_0x05d3('0x7e')],'options':_0x2cdfca[_0x26d0d4][_0x05d3('0x7f')]===_0x05d3('0x80')&&_0x2cdfca[_0x26d0d4][_0x05d3('0x81')][_0x05d3('0x3a')]>-0x1?_['map'](_0x2cdfca[_0x26d0d4][_0x05d3('0x81')],function(_0x4e6c63){return{'name':_0x4e6c63,'value':_0x4e6c63};}):[]});}}return{'count':_0x595ff1[_0x05d3('0x3a')],'rows':_0x595ff1};}else{return{'count':0x0,'rows':[]};}})[_0x05d3('0x28')](respondWithResult(_0x167693,null))[_0x05d3('0x4a')](function(_0x41af70){var _0x309774=_0x3ec9f1['query'][_0x05d3('0x82')]?0x1f4:_0x41af70[_0x05d3('0x83')]||0x1f4;logger[_0x05d3('0x2a')](_0x05d3('0x84'),_0x05d3('0x66'),_0x309774,JSON[_0x05d3('0x85')](_0x41af70));delete _0x41af70[_0x05d3('0x2c')];if(_0x309774===0x191){_0x309774=0x190;}_0x167693[_0x05d3('0x1d')](_0x309774)[_0x05d3('0x86')](_0x3ec9f1[_0x05d3('0x35')][_0x05d3('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x41af70[_0x05d3('0x83')]}:_0x41af70);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c3d3afd..c4519eb 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 _0x4196=['https://accounts.zoho.com.cn','/oauth/v2/token','application/x-www-form-urlencoded','info','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','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','clientId'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x4196,0x131));var _0x6419=function(_0x58399d,_0xd9fc31){_0x58399d=_0x58399d-0x0;var _0x3d9e86=_0x4196[_0x58399d];return _0x3d9e86;};'use strict';var _=require(_0x6419('0x0'));var util=require(_0x6419('0x1'));var logger=require('../../config/logger')(_0x6419('0x2'));var moment=require('moment');var BPromise=require(_0x6419('0x3'));var rp=require(_0x6419('0x4'));var fs=require('fs');var path=require(_0x6419('0x5'));var rimraf=require(_0x6419('0x6'));var config=require(_0x6419('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x6419('0x8'));module[_0x6419('0x9')]=function(_0x51edc0,_0x180423){return _0x51edc0[_0x6419('0xa')](_0x6419('0xb'),attributes,{'tableName':_0x6419('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe5740,_0x5c7ebd,_0x520992){if(_0xe5740['changed'](_0x6419('0xd'))||_0xe5740[_0x6419('0xe')](_0x6419('0xf'))||_0xe5740['changed']('clientId')||_0xe5740[_0x6419('0xe')](_0x6419('0x10'))||_0xe5740[_0x6419('0xe')](_0x6419('0x11'))||_0xe5740[_0x6419('0xe')](_0x6419('0x12'))){var _0x49f506,_0x4a035c;_0x49f506=_0xe5740[_0x6419('0xf')];var _0x24db94=_0x49f506[_0x6419('0x13')](-0x1);if(_0x24db94==='/'||_0x24db94==='\x5c'||_0x24db94===':'){_0x49f506=_0x49f506[_0x6419('0x14')](0x0,_0x49f506[_0x6419('0x15')](_0x24db94));}switch(_0xe5740[_0x6419('0xd')]){case'US':_0x4a035c=_0x6419('0x16');break;case'AU':_0x4a035c=_0x6419('0x17');break;case'IN':_0x4a035c=_0x6419('0x18');break;case'CN':_0x4a035c='https://accounts.zoho.com.cn';break;default:_0x4a035c=_0x6419('0x19');break;}var _0x147b06={'method':_0x6419('0x1a'),'uri':_0x4a035c+'/oauth/v2/token','form':{'grant_type':_0x6419('0x1b'),'client_id':_0xe5740['clientId'],'client_secret':_0xe5740[_0x6419('0x10')],'redirect_uri':_0xe5740['serverUrl'],'code':_0xe5740['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x147b06)[_0x6419('0x1c')](function(_0x1f7191){var _0x2c9efc=JSON[_0x6419('0x1d')](_0x1f7191);if(_0x2c9efc[_0x6419('0x1e')]){_0xe5740[_0x6419('0x1f')]=_0x2c9efc[_0x6419('0x1e')];logger['info'](util[_0x6419('0x20')](_0x6419('0x21'),_0xe5740[_0x6419('0x22')],_0xe5740['id']));}else{logger[_0x6419('0x23')](util[_0x6419('0x20')](_0x6419('0x24'),_0xe5740['name'],_0xe5740['id']),util['inspect'](_0x2c9efc,{'showHidden':![],'depth':null}));}return _0x520992(null,_0x5c7ebd);})['catch'](function(_0x5963a2){logger['error'](util[_0x6419('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xe5740[_0x6419('0x22')],_0xe5740['id']),util[_0x6419('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x520992(_0x5963a2);});}else{return _0x520992(null,_0x5c7ebd);}},'beforeUpdate':function(_0x5c74a4,_0x7a4a2,_0x50c13b){if(_0x5c74a4[_0x6419('0xe')](_0x6419('0xd'))||_0x5c74a4[_0x6419('0xe')](_0x6419('0xf'))||_0x5c74a4[_0x6419('0xe')](_0x6419('0x26'))||_0x5c74a4['changed'](_0x6419('0x10'))||_0x5c74a4['changed']('code')||_0x5c74a4[_0x6419('0xe')]('host')){var _0x2033a8,_0x3f2e0d;_0x2033a8=_0x5c74a4['serverUrl'];var _0x2199a3=_0x2033a8[_0x6419('0x13')](-0x1);if(_0x2199a3==='/'||_0x2199a3==='\x5c'||_0x2199a3===':'){_0x2033a8=_0x2033a8[_0x6419('0x14')](0x0,_0x2033a8[_0x6419('0x15')](_0x2199a3));}switch(_0x5c74a4[_0x6419('0xd')]){case'US':_0x3f2e0d='https://accounts.zoho.com';break;case'AU':_0x3f2e0d=_0x6419('0x17');break;case'IN':_0x3f2e0d=_0x6419('0x18');break;case'CN':_0x3f2e0d=_0x6419('0x27');break;default:_0x3f2e0d=_0x6419('0x19');break;}var _0x1d7bce={'method':_0x6419('0x1a'),'uri':_0x3f2e0d+_0x6419('0x28'),'form':{'grant_type':_0x6419('0x1b'),'client_id':_0x5c74a4[_0x6419('0x26')],'client_secret':_0x5c74a4[_0x6419('0x10')],'redirect_uri':_0x5c74a4[_0x6419('0xf')],'code':_0x5c74a4['code']},'headers':{'Content-Type':_0x6419('0x29')}};return rp(_0x1d7bce)[_0x6419('0x1c')](function(_0x236ab1){var _0xf4298e=JSON[_0x6419('0x1d')](_0x236ab1);if(_0xf4298e['refresh_token']){_0x5c74a4[_0x6419('0x1f')]=_0xf4298e[_0x6419('0x1e')];logger[_0x6419('0x2a')](util['format'](_0x6419('0x21'),_0x5c74a4['name'],_0x5c74a4['id']));}else{logger[_0x6419('0x23')](util['format'](_0x6419('0x24'),_0x5c74a4['name'],_0x5c74a4['id']),util[_0x6419('0x25')](_0xf4298e,{'showHidden':![],'depth':null}));}return _0x50c13b(null,_0x7a4a2);})['catch'](function(_0x57ed81){logger[_0x6419('0x23')](util[_0x6419('0x20')](_0x6419('0x24'),_0x5c74a4[_0x6419('0x22')],_0x5c74a4['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x50c13b(_0x57ed81);});}else{return _0x50c13b(null,_0x7a4a2);}}}});}; \ No newline at end of file +var _0x563f=['authorization_code','info','lodash','util','api','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','inspect','slice'];(function(_0x1c6a0c,_0x3914fd){var _0x422f76=function(_0xd60fe){while(--_0xd60fe){_0x1c6a0c['push'](_0x1c6a0c['shift']());}};_0x422f76(++_0x3914fd);}(_0x563f,0x121));var _0xf563=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x563f[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf563('0x0'));var util=require(_0xf563('0x1'));var logger=require('../../config/logger')(_0xf563('0x2'));var moment=require(_0xf563('0x3'));var BPromise=require(_0xf563('0x4'));var rp=require(_0xf563('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf563('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xf563('0x7'));module['exports']=function(_0x43438b,_0x367df2){return _0x43438b[_0xf563('0x8')](_0xf563('0x9'),attributes,{'tableName':_0xf563('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7c0f03,_0x4dd211,_0x1494ac){if(_0x7c0f03[_0xf563('0xb')](_0xf563('0xc'))||_0x7c0f03[_0xf563('0xb')](_0xf563('0xd'))||_0x7c0f03[_0xf563('0xb')](_0xf563('0xe'))||_0x7c0f03['changed'](_0xf563('0xf'))||_0x7c0f03['changed']('code')||_0x7c0f03['changed'](_0xf563('0x10'))){var _0x47e705,_0x366d4e;_0x47e705=_0x7c0f03[_0xf563('0xd')];var _0x32ca81=_0x47e705['slice'](-0x1);if(_0x32ca81==='/'||_0x32ca81==='\x5c'||_0x32ca81===':'){_0x47e705=_0x47e705[_0xf563('0x11')](0x0,_0x47e705[_0xf563('0x12')](_0x32ca81));}switch(_0x7c0f03['zone']){case'US':_0x366d4e=_0xf563('0x13');break;case'AU':_0x366d4e=_0xf563('0x14');break;case'IN':_0x366d4e=_0xf563('0x15');break;case'CN':_0x366d4e=_0xf563('0x16');break;default:_0x366d4e=_0xf563('0x17');break;}var _0x23ca55={'method':_0xf563('0x18'),'uri':_0x366d4e+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x7c0f03[_0xf563('0xe')],'client_secret':_0x7c0f03[_0xf563('0xf')],'redirect_uri':_0x7c0f03[_0xf563('0xd')],'code':_0x7c0f03[_0xf563('0x19')]},'headers':{'Content-Type':_0xf563('0x1a')}};return rp(_0x23ca55)[_0xf563('0x1b')](function(_0x12cca4){var _0x1a8b5c=JSON[_0xf563('0x1c')](_0x12cca4);if(_0x1a8b5c[_0xf563('0x1d')]){_0x7c0f03[_0xf563('0x1e')]=_0x1a8b5c['refresh_token'];logger['info'](util[_0xf563('0x1f')](_0xf563('0x20'),_0x7c0f03['name'],_0x7c0f03['id']));}else{logger[_0xf563('0x21')](util[_0xf563('0x1f')](_0xf563('0x22'),_0x7c0f03[_0xf563('0x23')],_0x7c0f03['id']),util['inspect'](_0x1a8b5c,{'showHidden':![],'depth':null}));}return _0x1494ac(null,_0x4dd211);})[_0xf563('0x24')](function(_0xf958e0){logger[_0xf563('0x21')](util[_0xf563('0x1f')](_0xf563('0x22'),_0x7c0f03[_0xf563('0x23')],_0x7c0f03['id']),util[_0xf563('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1494ac(_0xf958e0);});}else{return _0x1494ac(null,_0x4dd211);}},'beforeUpdate':function(_0x17eb9f,_0xe9a76a,_0x4622c1){if(_0x17eb9f[_0xf563('0xb')](_0xf563('0xc'))||_0x17eb9f[_0xf563('0xb')](_0xf563('0xd'))||_0x17eb9f[_0xf563('0xb')](_0xf563('0xe'))||_0x17eb9f['changed']('clientSecret')||_0x17eb9f[_0xf563('0xb')]('code')||_0x17eb9f[_0xf563('0xb')]('host')){var _0xbd94e4,_0x5b6205;_0xbd94e4=_0x17eb9f['serverUrl'];var _0x59653f=_0xbd94e4[_0xf563('0x26')](-0x1);if(_0x59653f==='/'||_0x59653f==='\x5c'||_0x59653f===':'){_0xbd94e4=_0xbd94e4[_0xf563('0x11')](0x0,_0xbd94e4['lastIndexOf'](_0x59653f));}switch(_0x17eb9f['zone']){case'US':_0x5b6205=_0xf563('0x13');break;case'AU':_0x5b6205=_0xf563('0x14');break;case'IN':_0x5b6205=_0xf563('0x15');break;case'CN':_0x5b6205=_0xf563('0x16');break;default:_0x5b6205='https://accounts.zoho.eu';break;}var _0x5cd572={'method':_0xf563('0x18'),'uri':_0x5b6205+'/oauth/v2/token','form':{'grant_type':_0xf563('0x27'),'client_id':_0x17eb9f[_0xf563('0xe')],'client_secret':_0x17eb9f[_0xf563('0xf')],'redirect_uri':_0x17eb9f[_0xf563('0xd')],'code':_0x17eb9f[_0xf563('0x19')]},'headers':{'Content-Type':_0xf563('0x1a')}};return rp(_0x5cd572)[_0xf563('0x1b')](function(_0x2205e8){var _0xe1952e=JSON['parse'](_0x2205e8);if(_0xe1952e[_0xf563('0x1d')]){_0x17eb9f['refreshToken']=_0xe1952e[_0xf563('0x1d')];logger[_0xf563('0x28')](util['format'](_0xf563('0x20'),_0x17eb9f[_0xf563('0x23')],_0x17eb9f['id']));}else{logger[_0xf563('0x21')](util['format'](_0xf563('0x22'),_0x17eb9f[_0xf563('0x23')],_0x17eb9f['id']),util[_0xf563('0x25')](_0xe1952e,{'showHidden':![],'depth':null}));}return _0x4622c1(null,_0xe9a76a);})[_0xf563('0x24')](function(_0x17790d){logger[_0xf563('0x21')](util[_0xf563('0x1f')](_0xf563('0x22'),_0x17eb9f[_0xf563('0x23')],_0x17eb9f['id']),util[_0xf563('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4622c1(_0x17790d);});}else{return _0x4622c1(null,_0xe9a76a);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 527aeec..f315cb4 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 _0x84c6=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','ZohoAccount,\x20%s,\x20%s','error','message','result','catch','GetZohoAccount','ZohoAccount','options','where','limit','map','include','model','attributes','ShowZohoAccount','raw','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2ff77,_0x34dd24){var _0x50edef=function(_0x2a9367){while(--_0x2a9367){_0x2ff77['push'](_0x2ff77['shift']());}};_0x50edef(++_0x34dd24);}(_0x84c6,0xe7));var _0x684c=function(_0xad6b4d,_0x4001f7){_0xad6b4d=_0xad6b4d-0x0;var _0x3e82ce=_0x84c6[_0xad6b4d];return _0x3e82ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x684c('0x0'));var BPromise=require(_0x684c('0x1'));var rs=require(_0x684c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x684c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x684c('0x4'))(_0x684c('0x5'));var config=require(_0x684c('0x6'));var jayson=require(_0x684c('0x7'));var client=jayson[_0x684c('0x8')][_0x684c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x209f74,_0x2c52dd,_0x168935){return new BPromise(function(_0x2fd628,_0x5824d8){return client[_0x684c('0xa')](_0x209f74,_0x168935)[_0x684c('0xb')](function(_0x5502ad){logger[_0x684c('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x2c52dd,_0x684c('0xd'));logger[_0x684c('0xe')](_0x684c('0xf'),_0x2c52dd,_0x684c('0xd'),JSON[_0x684c('0x10')](_0x5502ad));if(_0x5502ad['error']){if(_0x5502ad['error'][_0x684c('0x11')]===0x1f4){logger['error'](_0x684c('0x12'),_0x2c52dd,_0x5502ad[_0x684c('0x13')][_0x684c('0x14')]);return _0x5824d8(_0x5502ad['error'][_0x684c('0x14')]);}logger['error'](_0x684c('0x12'),_0x2c52dd,_0x5502ad[_0x684c('0x13')][_0x684c('0x14')]);return _0x2fd628(_0x5502ad[_0x684c('0x13')][_0x684c('0x14')]);}else{logger[_0x684c('0xc')](_0x684c('0x12'),_0x2c52dd,_0x684c('0xd'));_0x2fd628(_0x5502ad[_0x684c('0x15')]['message']);}})[_0x684c('0x16')](function(_0x5dd4f1){logger['error'](_0x684c('0x12'),_0x2c52dd,_0x5dd4f1);_0x5824d8(_0x5dd4f1);});});}exports[_0x684c('0x17')]=function(_0x421404){var _0x1dc55d=this;return new Promise(function(_0x304099,_0x5d9905){return db[_0x684c('0x18')]['findAll']({'raw':_0x421404['options']?_0x421404[_0x684c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x421404[_0x684c('0x19')]?_0x421404['options'][_0x684c('0x1a')]||null:null,'attributes':_0x421404[_0x684c('0x19')]?_0x421404[_0x684c('0x19')]['attributes']||null:null,'limit':_0x421404[_0x684c('0x19')]?_0x421404[_0x684c('0x19')][_0x684c('0x1b')]||null:null,'include':_0x421404[_0x684c('0x19')]?_0x421404[_0x684c('0x19')]['include']?_[_0x684c('0x1c')](_0x421404[_0x684c('0x19')][_0x684c('0x1d')],function(_0x416912){return{'model':db[_0x416912[_0x684c('0x1e')]],'as':_0x416912['as'],'attributes':_0x416912[_0x684c('0x1f')],'include':_0x416912['include']?_[_0x684c('0x1c')](_0x416912[_0x684c('0x1d')],function(_0x1962a0){return{'model':db[_0x1962a0[_0x684c('0x1e')]],'as':_0x1962a0['as'],'attributes':_0x1962a0[_0x684c('0x1f')],'include':_0x1962a0[_0x684c('0x1d')]?_[_0x684c('0x1c')](_0x1962a0[_0x684c('0x1d')],function(_0xa2fbd9){return{'model':db[_0xa2fbd9['model']],'as':_0xa2fbd9['as'],'attributes':_0xa2fbd9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d3445){logger[_0x684c('0xc')](_0x684c('0x17'),_0x421404);logger[_0x684c('0xe')]('GetZohoAccount',_0x421404,JSON[_0x684c('0x10')](_0x1d3445));_0x304099(_0x1d3445);})['catch'](function(_0x63a41f){logger['error'](_0x684c('0x17'),_0x63a41f[_0x684c('0x14')],_0x421404);_0x5d9905(_0x1dc55d[_0x684c('0x13')](0x1f4,_0x63a41f['message']));});});};exports[_0x684c('0x20')]=function(_0x7b3900){var _0x5dedcb=this;return new Promise(function(_0xadb242,_0x1a944b){return db[_0x684c('0x18')]['find']({'raw':_0x7b3900[_0x684c('0x19')]?_0x7b3900[_0x684c('0x19')][_0x684c('0x21')]===undefined?!![]:![]:!![],'where':_0x7b3900[_0x684c('0x19')]?_0x7b3900['options'][_0x684c('0x1a')]||null:null,'attributes':_0x7b3900[_0x684c('0x19')]?_0x7b3900[_0x684c('0x19')][_0x684c('0x1f')]||null:null,'include':_0x7b3900['options']?_0x7b3900[_0x684c('0x19')]['include']?_[_0x684c('0x1c')](_0x7b3900[_0x684c('0x19')][_0x684c('0x1d')],function(_0x4d8d71){return{'model':db[_0x4d8d71[_0x684c('0x1e')]],'as':_0x4d8d71['as'],'attributes':_0x4d8d71[_0x684c('0x1f')],'include':_0x4d8d71[_0x684c('0x1d')]?_[_0x684c('0x1c')](_0x4d8d71[_0x684c('0x1d')],function(_0x2004d6){return{'model':db[_0x2004d6[_0x684c('0x1e')]],'as':_0x2004d6['as'],'attributes':_0x2004d6[_0x684c('0x1f')],'include':_0x2004d6[_0x684c('0x1d')]?_[_0x684c('0x1c')](_0x2004d6[_0x684c('0x1d')],function(_0xce6b24){return{'model':db[_0xce6b24['model']],'as':_0xce6b24['as'],'attributes':_0xce6b24[_0x684c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10c672){logger['info'](_0x684c('0x20'),_0x7b3900);logger['debug'](_0x684c('0x20'),_0x7b3900,JSON['stringify'](_0x10c672));_0xadb242(_0x10c672);})[_0x684c('0x16')](function(_0x524cf9){logger[_0x684c('0x13')](_0x684c('0x20'),_0x524cf9[_0x684c('0x14')],_0x7b3900);_0x1a944b(_0x5dedcb[_0x684c('0x13')](0x1f4,_0x524cf9[_0x684c('0x14')]));});});}; \ No newline at end of file +var _0xcac3=['attributes','limit','include','model','map','ShowZohoAccount','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xcac3,0x193));var _0x3cac=function(_0x26e780,_0x5465ba){_0x26e780=_0x26e780-0x0;var _0x2e9594=_0xcac3[_0x26e780];return _0x2e9594;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var moment=require(_0x3cac('0x1'));var BPromise=require(_0x3cac('0x2'));var rs=require(_0x3cac('0x3'));var fs=require('fs');var Redis=require(_0x3cac('0x4'));var db=require(_0x3cac('0x5'))['db'];var utils=require(_0x3cac('0x6'));var logger=require(_0x3cac('0x7'))(_0x3cac('0x8'));var config=require(_0x3cac('0x9'));var jayson=require(_0x3cac('0xa'));var client=jayson[_0x3cac('0xb')][_0x3cac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e2560,_0x14562c,_0x21365c){return new BPromise(function(_0x13c1b9,_0x55670d){return client[_0x3cac('0xd')](_0x1e2560,_0x21365c)[_0x3cac('0xe')](function(_0x3bcbed){logger[_0x3cac('0xf')](_0x3cac('0x10'),_0x14562c,'request\x20sent');logger[_0x3cac('0x11')](_0x3cac('0x12'),_0x14562c,_0x3cac('0x13'),JSON[_0x3cac('0x14')](_0x3bcbed));if(_0x3bcbed[_0x3cac('0x15')]){if(_0x3bcbed['error']['code']===0x1f4){logger[_0x3cac('0x15')](_0x3cac('0x10'),_0x14562c,_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);return _0x55670d(_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);}logger[_0x3cac('0x15')]('ZohoAccount,\x20%s,\x20%s',_0x14562c,_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);return _0x13c1b9(_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);}else{logger[_0x3cac('0xf')](_0x3cac('0x10'),_0x14562c,_0x3cac('0x13'));_0x13c1b9(_0x3bcbed[_0x3cac('0x17')][_0x3cac('0x16')]);}})[_0x3cac('0x18')](function(_0x4173ca){logger[_0x3cac('0x15')](_0x3cac('0x10'),_0x14562c,_0x4173ca);_0x55670d(_0x4173ca);});});}exports[_0x3cac('0x19')]=function(_0x1b1007){var _0x9c768f=this;return new Promise(function(_0x752c5b,_0x17d5bc){return db[_0x3cac('0x1a')][_0x3cac('0x1b')]({'raw':_0x1b1007[_0x3cac('0x1c')]?_0x1b1007[_0x3cac('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1b1007[_0x3cac('0x1c')]?_0x1b1007[_0x3cac('0x1c')]['where']||null:null,'attributes':_0x1b1007[_0x3cac('0x1c')]?_0x1b1007[_0x3cac('0x1c')][_0x3cac('0x1d')]||null:null,'limit':_0x1b1007[_0x3cac('0x1c')]?_0x1b1007[_0x3cac('0x1c')][_0x3cac('0x1e')]||null:null,'include':_0x1b1007['options']?_0x1b1007[_0x3cac('0x1c')]['include']?_['map'](_0x1b1007['options'][_0x3cac('0x1f')],function(_0x842c3d){return{'model':db[_0x842c3d[_0x3cac('0x20')]],'as':_0x842c3d['as'],'attributes':_0x842c3d[_0x3cac('0x1d')],'include':_0x842c3d[_0x3cac('0x1f')]?_[_0x3cac('0x21')](_0x842c3d[_0x3cac('0x1f')],function(_0x3f79b6){return{'model':db[_0x3f79b6[_0x3cac('0x20')]],'as':_0x3f79b6['as'],'attributes':_0x3f79b6[_0x3cac('0x1d')],'include':_0x3f79b6[_0x3cac('0x1f')]?_[_0x3cac('0x21')](_0x3f79b6['include'],function(_0x24c4fb){return{'model':db[_0x24c4fb[_0x3cac('0x20')]],'as':_0x24c4fb['as'],'attributes':_0x24c4fb[_0x3cac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3cac('0xe')](function(_0xf8ef01){logger[_0x3cac('0xf')](_0x3cac('0x19'),_0x1b1007);logger[_0x3cac('0x11')](_0x3cac('0x19'),_0x1b1007,JSON[_0x3cac('0x14')](_0xf8ef01));_0x752c5b(_0xf8ef01);})[_0x3cac('0x18')](function(_0x391412){logger[_0x3cac('0x15')](_0x3cac('0x19'),_0x391412[_0x3cac('0x16')],_0x1b1007);_0x17d5bc(_0x9c768f[_0x3cac('0x15')](0x1f4,_0x391412[_0x3cac('0x16')]));});});};exports[_0x3cac('0x22')]=function(_0x447e9e){var _0x1fc118=this;return new Promise(function(_0x2d44ff,_0x2f03b3){return db[_0x3cac('0x1a')]['find']({'raw':_0x447e9e[_0x3cac('0x1c')]?_0x447e9e[_0x3cac('0x1c')][_0x3cac('0x23')]===undefined?!![]:![]:!![],'where':_0x447e9e[_0x3cac('0x1c')]?_0x447e9e[_0x3cac('0x1c')]['where']||null:null,'attributes':_0x447e9e['options']?_0x447e9e[_0x3cac('0x1c')][_0x3cac('0x1d')]||null:null,'include':_0x447e9e['options']?_0x447e9e[_0x3cac('0x1c')]['include']?_['map'](_0x447e9e[_0x3cac('0x1c')][_0x3cac('0x1f')],function(_0x4eba91){return{'model':db[_0x4eba91[_0x3cac('0x20')]],'as':_0x4eba91['as'],'attributes':_0x4eba91[_0x3cac('0x1d')],'include':_0x4eba91[_0x3cac('0x1f')]?_[_0x3cac('0x21')](_0x4eba91[_0x3cac('0x1f')],function(_0x7ec730){return{'model':db[_0x7ec730[_0x3cac('0x20')]],'as':_0x7ec730['as'],'attributes':_0x7ec730[_0x3cac('0x1d')],'include':_0x7ec730[_0x3cac('0x1f')]?_['map'](_0x7ec730['include'],function(_0x27a8fc){return{'model':db[_0x27a8fc[_0x3cac('0x20')]],'as':_0x27a8fc['as'],'attributes':_0x27a8fc[_0x3cac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3cac('0xe')](function(_0x55bf22){logger[_0x3cac('0xf')](_0x3cac('0x22'),_0x447e9e);logger[_0x3cac('0x11')]('ShowZohoAccount',_0x447e9e,JSON[_0x3cac('0x14')](_0x55bf22));_0x2d44ff(_0x55bf22);})[_0x3cac('0x18')](function(_0x5b57c5){logger[_0x3cac('0x15')](_0x3cac('0x22'),_0x5b57c5[_0x3cac('0x16')],_0x447e9e);_0x2f03b3(_0x1fc118['error'](0x1f4,_0x5b57c5['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index b41ee82..fa81f8d 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 _0x31d6=['./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','getFields','/:id/subjects','post','create','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x181b23,_0x3ed1a2){var _0x29bd87=function(_0x5a522a){while(--_0x5a522a){_0x181b23['push'](_0x181b23['shift']());}};_0x29bd87(++_0x3ed1a2);}(_0x31d6,0x1c3));var _0x631d=function(_0x11ac94,_0x5f4bab){_0x11ac94=_0x11ac94-0x0;var _0x287e78=_0x31d6[_0x11ac94];return _0x287e78;};'use strict';var multer=require(_0x631d('0x0'));var util=require(_0x631d('0x1'));var path=require(_0x631d('0x2'));var timeout=require(_0x631d('0x3'));var express=require(_0x631d('0x4'));var router=express[_0x631d('0x5')]();var fs_extra=require(_0x631d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x631d('0x7'));var config=require(_0x631d('0x8'));var controller=require(_0x631d('0x9'));router['get']('/',auth[_0x631d('0xa')](),controller[_0x631d('0xb')]);router[_0x631d('0xc')](_0x631d('0xd'),auth[_0x631d('0xa')](),controller['show']);router[_0x631d('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0x631d('0xe')]);router[_0x631d('0xc')](_0x631d('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x631d('0xc')]('/:id/descriptions',auth[_0x631d('0xa')](),controller['getDescriptions']);router[_0x631d('0x10')]('/',auth[_0x631d('0xa')](),controller[_0x631d('0x11')]);router['put'](_0x631d('0xd'),auth[_0x631d('0xa')](),controller[_0x631d('0x12')]);router['delete']('/:id',auth[_0x631d('0xa')](),controller['destroy']);module[_0x631d('0x13')]=router; \ No newline at end of file +var _0xf873=['create','put','update','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x1a8874,_0x3080eb){var _0x4b810a=function(_0xadc923){while(--_0xadc923){_0x1a8874['push'](_0x1a8874['shift']());}};_0x4b810a(++_0x3080eb);}(_0xf873,0x119));var _0x3f87=function(_0x56c95c,_0x15dd39){_0x56c95c=_0x56c95c-0x0;var _0x5c5365=_0xf873[_0x56c95c];return _0x5c5365;};'use strict';var multer=require(_0x3f87('0x0'));var util=require(_0x3f87('0x1'));var path=require(_0x3f87('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3f87('0x3'));var interaction=require(_0x3f87('0x4'));var config=require(_0x3f87('0x5'));var controller=require(_0x3f87('0x6'));router[_0x3f87('0x7')]('/',auth[_0x3f87('0x8')](),controller[_0x3f87('0x9')]);router[_0x3f87('0x7')](_0x3f87('0xa'),auth['isAuthenticated'](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0x8')](),controller[_0x3f87('0xd')]);router[_0x3f87('0x7')](_0x3f87('0xe'),auth['isAuthenticated'](),controller[_0x3f87('0xf')]);router[_0x3f87('0x7')](_0x3f87('0x10'),auth[_0x3f87('0x8')](),controller[_0x3f87('0x11')]);router[_0x3f87('0x12')]('/',auth[_0x3f87('0x8')](),controller[_0x3f87('0x13')]);router[_0x3f87('0x14')](_0x3f87('0xa'),auth[_0x3f87('0x8')](),controller[_0x3f87('0x15')]);router[_0x3f87('0x16')](_0x3f87('0xa'),auth[_0x3f87('0x8')](),controller[_0x3f87('0x17')]);module[_0x3f87('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 28e9a48..2f6a348 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 _0x81e1=['exports','STRING','nothing','lead','ENUM','contact_lead','contact','sequelize'];(function(_0x226cfb,_0xb4ef36){var _0x7b66fd=function(_0x509e0a){while(--_0x509e0a){_0x226cfb['push'](_0x226cfb['shift']());}};_0x7b66fd(++_0xb4ef36);}(_0x81e1,0x1af));var _0x181e=function(_0xeb0e33,_0x50d16d){_0xeb0e33=_0xeb0e33-0x0;var _0x3fbf65=_0x81e1[_0xeb0e33];return _0x3fbf65;};'use strict';var Sequelize=require(_0x181e('0x0'));module[_0x181e('0x1')]={'name':{'type':Sequelize[_0x181e('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact',_0x181e('0x3')),'defaultValue':_0x181e('0x4')},'moduleSearch':{'type':Sequelize[_0x181e('0x5')](_0x181e('0x6'),_0x181e('0x7'),_0x181e('0x4')),'defaultValue':_0x181e('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x90fa=['lead','contact','contact_lead','sequelize','STRING','nothing'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0x90fa,0xe7));var _0xa90f=function(_0x3cf2e1,_0x314846){_0x3cf2e1=_0x3cf2e1-0x0;var _0x3fb90e=_0x90fa[_0x3cf2e1];return _0x3fb90e;};'use strict';var Sequelize=require(_0xa90f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa90f('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact',_0xa90f('0x2')),'defaultValue':_0xa90f('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xa90f('0x4'),_0xa90f('0x3')),'defaultValue':_0xa90f('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 09baaa7..df5d55d 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 _0xf1eb=['key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','catch','body','getFields','findOne','ZohoField','nolimit','getSubjects','getDescriptions','order','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ZohoConfiguration','fieldName','type'];(function(_0x50382a,_0x539e42){var _0x4ef400=function(_0x5f528d){while(--_0x5f528d){_0x50382a['push'](_0x50382a['shift']());}};_0x4ef400(++_0x539e42);}(_0xf1eb,0x119));var _0xbf1e=function(_0xc56853,_0xb97b1f){_0xc56853=_0xc56853-0x0;var _0xccd0ec=_0xf1eb[_0xc56853];return _0xccd0ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf1e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf1e('0x1'));var rp=require(_0xbf1e('0x2'));var moment=require(_0xbf1e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf1e('0x4'));var util=require(_0xbf1e('0x5'));var path=require(_0xbf1e('0x6'));var sox=require('sox');var csv=require(_0xbf1e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbf1e('0x8'));var crypto=require(_0xbf1e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbf1e('0xa'));var toCsv=require(_0xbf1e('0x7'));var querystring=require(_0xbf1e('0xb'));var Papa=require(_0xbf1e('0xc'));var Redis=require(_0xbf1e('0xd'));var authService=require(_0xbf1e('0xe'));var qs=require(_0xbf1e('0xf'));var as=require(_0xbf1e('0x10'));var hardwareService=require(_0xbf1e('0x11'));var logger=require(_0xbf1e('0x12'))(_0xbf1e('0x13'));var utils=require(_0xbf1e('0x14'));var config=require(_0xbf1e('0x15'));var licenseUtil=require(_0xbf1e('0x16'));var db=require(_0xbf1e('0x17'))['db'];function respondWithStatusCode(_0x106079,_0x451833){_0x451833=_0x451833||0xcc;return function(_0x4f2a19){if(_0x4f2a19){return _0x106079[_0xbf1e('0x18')](_0x451833);}return _0x106079[_0xbf1e('0x19')](_0x451833)[_0xbf1e('0x1a')]();};}function respondWithResult(_0x4c6183,_0x25acd7){_0x25acd7=_0x25acd7||0xc8;return function(_0x16d257){if(_0x16d257){return _0x4c6183[_0xbf1e('0x19')](_0x25acd7)[_0xbf1e('0x1b')](_0x16d257);}};}function respondWithFilteredResult(_0x30f1c8,_0x4655ee){return function(_0x8863a8){if(_0x8863a8){var _0x41f27d=typeof _0x4655ee[_0xbf1e('0x1c')]===_0xbf1e('0x1d')&&typeof _0x4655ee[_0xbf1e('0x1e')]===_0xbf1e('0x1d');var _0x1c2839=_0x8863a8[_0xbf1e('0x1f')];var _0xd8d102=_0x41f27d?0x0:_0x4655ee[_0xbf1e('0x1c')];var _0x467e29=_0x41f27d?_0x8863a8[_0xbf1e('0x1f')]:_0x4655ee['offset']+_0x4655ee[_0xbf1e('0x1e')];var _0x56e43d;if(_0x467e29>=_0x1c2839){_0x467e29=_0x1c2839;_0x56e43d=0xc8;}else{_0x56e43d=0xce;}_0x30f1c8['status'](_0x56e43d);return _0x30f1c8[_0xbf1e('0x20')](_0xbf1e('0x21'),_0xd8d102+'-'+_0x467e29+'/'+_0x1c2839)[_0xbf1e('0x1b')](_0x8863a8);}return null;};}function patchUpdates(_0x375241){return function(_0x15fd4c){try{jsonpatch[_0xbf1e('0x22')](_0x15fd4c,_0x375241,!![]);}catch(_0x30da9f){return BPromise[_0xbf1e('0x23')](_0x30da9f);}return _0x15fd4c[_0xbf1e('0x24')]();};}function saveUpdates(_0xb23a61,_0x5908b6){return function(_0xe63975){if(_0xe63975){return _0xe63975[_0xbf1e('0x25')](_0xb23a61)[_0xbf1e('0x26')](function(_0x36be8d){return _0x36be8d;});}return null;};}function removeEntity(_0x4027f7,_0x22f499){return function(_0x51e884){if(_0x51e884){return _0x51e884[_0xbf1e('0x27')]()[_0xbf1e('0x26')](function(){_0x4027f7[_0xbf1e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330efd,_0x448811){return function(_0x4a95c4){if(!_0x4a95c4){_0x330efd['sendStatus'](0x194);}return _0x4a95c4;};}function handleError(_0x5f1b38,_0x33eb1e){_0x33eb1e=_0x33eb1e||0x1f4;return function(_0x17e639){logger['error'](_0x17e639[_0xbf1e('0x28')]);if(_0x17e639[_0xbf1e('0x29')]){delete _0x17e639[_0xbf1e('0x29')];}_0x5f1b38[_0xbf1e('0x19')](_0x33eb1e)['send'](_0x17e639);};}exports[_0xbf1e('0x2a')]=function(_0x986804,_0x534553){var _0x305565={},_0x2b0525={},_0x468972={'count':0x0,'rows':[]};var _0x46c5e7=_[_0xbf1e('0x2b')](db[_0xbf1e('0x2c')]['rawAttributes'],function(_0x19a6b9){return{'name':_0x19a6b9[_0xbf1e('0x2d')],'type':_0x19a6b9[_0xbf1e('0x2e')][_0xbf1e('0x2f')]};});_0x2b0525['model']=_[_0xbf1e('0x2b')](_0x46c5e7,_0xbf1e('0x29'));_0x2b0525[_0xbf1e('0x30')]=_[_0xbf1e('0x31')](_0x986804['query']);_0x2b0525[_0xbf1e('0x32')]=_[_0xbf1e('0x33')](_0x2b0525[_0xbf1e('0x34')],_0x2b0525[_0xbf1e('0x30')]);_0x305565[_0xbf1e('0x35')]=_[_0xbf1e('0x33')](_0x2b0525[_0xbf1e('0x34')],qs[_0xbf1e('0x36')](_0x986804[_0xbf1e('0x30')]['fields']));_0x305565['attributes']=_0x305565['attributes'][_0xbf1e('0x37')]?_0x305565[_0xbf1e('0x35')]:_0x2b0525[_0xbf1e('0x34')];if(!_0x986804[_0xbf1e('0x30')][_0xbf1e('0x38')]('nolimit')){_0x305565['limit']=qs[_0xbf1e('0x1e')](_0x986804[_0xbf1e('0x30')][_0xbf1e('0x1e')]);_0x305565['offset']=qs[_0xbf1e('0x1c')](_0x986804[_0xbf1e('0x30')]['offset']);}_0x305565['order']=qs[_0xbf1e('0x39')](_0x986804[_0xbf1e('0x30')][_0xbf1e('0x39')]);_0x305565['where']=qs[_0xbf1e('0x32')](_[_0xbf1e('0x3a')](_0x986804['query'],_0x2b0525[_0xbf1e('0x32')]),_0x46c5e7);if(_0x986804['query'][_0xbf1e('0x3b')]){_0x305565[_0xbf1e('0x3c')]=_[_0xbf1e('0x3d')](_0x305565[_0xbf1e('0x3c')],{'$or':_['map'](_0x46c5e7,function(_0x4c2655){if(_0x4c2655[_0xbf1e('0x2e')]!==_0xbf1e('0x3e')){var _0x4ac5db={};_0x4ac5db[_0x4c2655[_0xbf1e('0x29')]]={'$like':'%'+_0x986804[_0xbf1e('0x30')]['filter']+'%'};return _0x4ac5db;}})});}_0x305565=_[_0xbf1e('0x3d')]({},_0x305565,_0x986804[_0xbf1e('0x3f')]);var _0x4f57e3={'where':_0x305565[_0xbf1e('0x3c')]};return db[_0xbf1e('0x2c')]['count'](_0x4f57e3)['then'](function(_0xefe97a){_0x468972[_0xbf1e('0x1f')]=_0xefe97a;if(_0x986804[_0xbf1e('0x30')][_0xbf1e('0x40')]){_0x305565[_0xbf1e('0x41')]=[{'all':!![]}];}return db[_0xbf1e('0x2c')][_0xbf1e('0x42')](_0x305565);})[_0xbf1e('0x26')](function(_0x317577){_0x468972[_0xbf1e('0x43')]=_0x317577;return _0x468972;})[_0xbf1e('0x26')](respondWithFilteredResult(_0x534553,_0x305565))['catch'](handleError(_0x534553,null));};exports[_0xbf1e('0x44')]=function(_0x15eece,_0x569fae){var _0x4bf1da={'raw':![],'where':{'id':_0x15eece[_0xbf1e('0x45')]['id']}},_0x34d9df={};_0x34d9df[_0xbf1e('0x34')]=_['keys'](db[_0xbf1e('0x2c')][_0xbf1e('0x46')]);_0x34d9df['query']=_[_0xbf1e('0x31')](_0x15eece[_0xbf1e('0x30')]);_0x34d9df[_0xbf1e('0x32')]=_[_0xbf1e('0x33')](_0x34d9df[_0xbf1e('0x34')],_0x34d9df[_0xbf1e('0x30')]);_0x4bf1da[_0xbf1e('0x35')]=_['intersection'](_0x34d9df['model'],qs[_0xbf1e('0x36')](_0x15eece[_0xbf1e('0x30')]['fields']));_0x4bf1da['attributes']=_0x4bf1da['attributes'][_0xbf1e('0x37')]?_0x4bf1da[_0xbf1e('0x35')]:_0x34d9df[_0xbf1e('0x34')];if(_0x15eece[_0xbf1e('0x30')]['includeAll']){_0x4bf1da[_0xbf1e('0x41')]=[{'all':!![]}];}_0x4bf1da=_[_0xbf1e('0x3d')]({},_0x4bf1da,_0x15eece[_0xbf1e('0x3f')]);return db[_0xbf1e('0x2c')][_0xbf1e('0x47')](_0x4bf1da)[_0xbf1e('0x26')](handleEntityNotFound(_0x569fae,null))['then'](respondWithResult(_0x569fae,null))['catch'](handleError(_0x569fae,null));};exports[_0xbf1e('0x48')]=function(_0x3c8777,_0x168498){return db[_0xbf1e('0x2c')][_0xbf1e('0x48')](_0x3c8777['body'],{})[_0xbf1e('0x26')](respondWithResult(_0x168498,0xc9))[_0xbf1e('0x49')](handleError(_0x168498,null));};exports[_0xbf1e('0x25')]=function(_0x39f287,_0x54238d){if(_0x39f287[_0xbf1e('0x4a')]['id']){delete _0x39f287['body']['id'];}return db['ZohoConfiguration'][_0xbf1e('0x47')]({'where':{'id':_0x39f287[_0xbf1e('0x45')]['id']}})['then'](handleEntityNotFound(_0x54238d,null))[_0xbf1e('0x26')](saveUpdates(_0x39f287['body'],null))[_0xbf1e('0x26')](respondWithResult(_0x54238d,null))[_0xbf1e('0x49')](handleError(_0x54238d,null));};exports[_0xbf1e('0x27')]=function(_0x4b80c4,_0x3b4a70){return db[_0xbf1e('0x2c')]['find']({'where':{'id':_0x4b80c4[_0xbf1e('0x45')]['id']}})[_0xbf1e('0x26')](handleEntityNotFound(_0x3b4a70,null))[_0xbf1e('0x26')](removeEntity(_0x3b4a70,null))[_0xbf1e('0x49')](handleError(_0x3b4a70,null));};exports[_0xbf1e('0x4b')]=function(_0x409c61,_0x5701ef,_0xf5e116){var _0x9ec636={};var _0x2d8951={};var _0x593962;var _0x55fa13;return db[_0xbf1e('0x2c')][_0xbf1e('0x4c')]({'where':{'id':_0x409c61[_0xbf1e('0x45')]['id']}})[_0xbf1e('0x26')](handleEntityNotFound(_0x5701ef,null))[_0xbf1e('0x26')](function(_0x586de8){if(_0x586de8){_0x593962=_0x586de8;_0x2d8951[_0xbf1e('0x34')]=_[_0xbf1e('0x31')](db[_0xbf1e('0x4d')][_0xbf1e('0x46')]);_0x2d8951[_0xbf1e('0x30')]=_[_0xbf1e('0x31')](_0x409c61[_0xbf1e('0x30')]);_0x2d8951['filters']=_[_0xbf1e('0x33')](_0x2d8951[_0xbf1e('0x34')],_0x2d8951[_0xbf1e('0x30')]);_0x9ec636[_0xbf1e('0x35')]=_[_0xbf1e('0x33')](_0x2d8951['model'],qs[_0xbf1e('0x36')](_0x409c61[_0xbf1e('0x30')][_0xbf1e('0x36')]));_0x9ec636['attributes']=_0x9ec636[_0xbf1e('0x35')][_0xbf1e('0x37')]?_0x9ec636[_0xbf1e('0x35')]:_0x2d8951[_0xbf1e('0x34')];_0x9ec636['order']=qs['sort'](_0x409c61[_0xbf1e('0x30')]['sort']);_0x9ec636['where']=qs['filters'](_[_0xbf1e('0x3a')](_0x409c61[_0xbf1e('0x30')],_0x2d8951[_0xbf1e('0x32')]));if(_0x409c61[_0xbf1e('0x30')]['filter']){_0x9ec636[_0xbf1e('0x3c')]=_[_0xbf1e('0x3d')](_0x9ec636['where'],{'$or':_[_0xbf1e('0x2b')](_0x9ec636['attributes'],function(_0x4a99c7){var _0x1be223={};_0x1be223[_0x4a99c7]={'$like':'%'+_0x409c61['query']['filter']+'%'};return _0x1be223;})});}_0x9ec636=_[_0xbf1e('0x3d')]({},_0x9ec636,_0x409c61[_0xbf1e('0x3f')]);return _0x593962['getFields'](_0x9ec636);}})[_0xbf1e('0x26')](function(_0x44dfb){if(_0x44dfb){_0x55fa13=_0x44dfb[_0xbf1e('0x37')];if(!_0x409c61['query'][_0xbf1e('0x38')](_0xbf1e('0x4e'))){_0x9ec636[_0xbf1e('0x1e')]=qs[_0xbf1e('0x1e')](_0x409c61[_0xbf1e('0x30')][_0xbf1e('0x1e')]);_0x9ec636[_0xbf1e('0x1c')]=qs['offset'](_0x409c61[_0xbf1e('0x30')][_0xbf1e('0x1c')]);}return _0x593962['getFields'](_0x9ec636);}})[_0xbf1e('0x26')](function(_0x14fc3e){if(_0x14fc3e){return _0x14fc3e?{'count':_0x55fa13,'rows':_0x14fc3e}:null;}})[_0xbf1e('0x26')](respondWithResult(_0x5701ef,null))['catch'](handleError(_0x5701ef,null));};exports[_0xbf1e('0x4f')]=function(_0x9ef224,_0xcf14fc,_0x4ccbed){var _0x5c4daa={};var _0x3aab53={};var _0x340fbe;var _0x50a9d6;return db[_0xbf1e('0x2c')]['findOne']({'where':{'id':_0x9ef224[_0xbf1e('0x45')]['id']}})[_0xbf1e('0x26')](handleEntityNotFound(_0xcf14fc,null))[_0xbf1e('0x26')](function(_0x3fe783){if(_0x3fe783){_0x340fbe=_0x3fe783;_0x3aab53[_0xbf1e('0x34')]=_[_0xbf1e('0x31')](db[_0xbf1e('0x4d')][_0xbf1e('0x46')]);_0x3aab53[_0xbf1e('0x30')]=_[_0xbf1e('0x31')](_0x9ef224[_0xbf1e('0x30')]);_0x3aab53[_0xbf1e('0x32')]=_[_0xbf1e('0x33')](_0x3aab53[_0xbf1e('0x34')],_0x3aab53['query']);_0x5c4daa['attributes']=_['intersection'](_0x3aab53[_0xbf1e('0x34')],qs[_0xbf1e('0x36')](_0x9ef224['query'][_0xbf1e('0x36')]));_0x5c4daa[_0xbf1e('0x35')]=_0x5c4daa[_0xbf1e('0x35')][_0xbf1e('0x37')]?_0x5c4daa[_0xbf1e('0x35')]:_0x3aab53[_0xbf1e('0x34')];_0x5c4daa['order']=qs[_0xbf1e('0x39')](_0x9ef224[_0xbf1e('0x30')][_0xbf1e('0x39')]);_0x5c4daa[_0xbf1e('0x3c')]=qs[_0xbf1e('0x32')](_[_0xbf1e('0x3a')](_0x9ef224[_0xbf1e('0x30')],_0x3aab53[_0xbf1e('0x32')]));if(_0x9ef224[_0xbf1e('0x30')][_0xbf1e('0x3b')]){_0x5c4daa[_0xbf1e('0x3c')]=_['merge'](_0x5c4daa['where'],{'$or':_[_0xbf1e('0x2b')](_0x5c4daa[_0xbf1e('0x35')],function(_0x3bdcc5){var _0x4dcbfb={};_0x4dcbfb[_0x3bdcc5]={'$like':'%'+_0x9ef224['query'][_0xbf1e('0x3b')]+'%'};return _0x4dcbfb;})});}_0x5c4daa=_['merge']({},_0x5c4daa,_0x9ef224[_0xbf1e('0x3f')]);return _0x340fbe[_0xbf1e('0x4f')](_0x5c4daa);}})[_0xbf1e('0x26')](function(_0x5dc4e0){if(_0x5dc4e0){_0x50a9d6=_0x5dc4e0[_0xbf1e('0x37')];if(!_0x9ef224[_0xbf1e('0x30')][_0xbf1e('0x38')](_0xbf1e('0x4e'))){_0x5c4daa['limit']=qs['limit'](_0x9ef224[_0xbf1e('0x30')][_0xbf1e('0x1e')]);_0x5c4daa[_0xbf1e('0x1c')]=qs['offset'](_0x9ef224[_0xbf1e('0x30')]['offset']);}return _0x340fbe[_0xbf1e('0x4f')](_0x5c4daa);}})[_0xbf1e('0x26')](function(_0x5d8c21){if(_0x5d8c21){return _0x5d8c21?{'count':_0x50a9d6,'rows':_0x5d8c21}:null;}})[_0xbf1e('0x26')](respondWithResult(_0xcf14fc,null))[_0xbf1e('0x49')](handleError(_0xcf14fc,null));};exports[_0xbf1e('0x50')]=function(_0x488d19,_0x32531b,_0x381ce9){var _0x1df04c={};var _0x5e226f={};var _0x1050f5;var _0x23989f;return db[_0xbf1e('0x2c')][_0xbf1e('0x4c')]({'where':{'id':_0x488d19['params']['id']}})['then'](handleEntityNotFound(_0x32531b,null))[_0xbf1e('0x26')](function(_0x2aa443){if(_0x2aa443){_0x1050f5=_0x2aa443;_0x5e226f[_0xbf1e('0x34')]=_[_0xbf1e('0x31')](db[_0xbf1e('0x4d')]['rawAttributes']);_0x5e226f['query']=_[_0xbf1e('0x31')](_0x488d19[_0xbf1e('0x30')]);_0x5e226f[_0xbf1e('0x32')]=_[_0xbf1e('0x33')](_0x5e226f[_0xbf1e('0x34')],_0x5e226f[_0xbf1e('0x30')]);_0x1df04c['attributes']=_[_0xbf1e('0x33')](_0x5e226f['model'],qs[_0xbf1e('0x36')](_0x488d19[_0xbf1e('0x30')][_0xbf1e('0x36')]));_0x1df04c[_0xbf1e('0x35')]=_0x1df04c[_0xbf1e('0x35')][_0xbf1e('0x37')]?_0x1df04c[_0xbf1e('0x35')]:_0x5e226f[_0xbf1e('0x34')];_0x1df04c[_0xbf1e('0x51')]=qs['sort'](_0x488d19[_0xbf1e('0x30')][_0xbf1e('0x39')]);_0x1df04c[_0xbf1e('0x3c')]=qs[_0xbf1e('0x32')](_[_0xbf1e('0x3a')](_0x488d19[_0xbf1e('0x30')],_0x5e226f[_0xbf1e('0x32')]));if(_0x488d19[_0xbf1e('0x30')]['filter']){_0x1df04c[_0xbf1e('0x3c')]=_[_0xbf1e('0x3d')](_0x1df04c[_0xbf1e('0x3c')],{'$or':_[_0xbf1e('0x2b')](_0x1df04c[_0xbf1e('0x35')],function(_0x524b0f){var _0x2e54d2={};_0x2e54d2[_0x524b0f]={'$like':'%'+_0x488d19[_0xbf1e('0x30')][_0xbf1e('0x3b')]+'%'};return _0x2e54d2;})});}_0x1df04c=_[_0xbf1e('0x3d')]({},_0x1df04c,_0x488d19['options']);return _0x1050f5[_0xbf1e('0x50')](_0x1df04c);}})['then'](function(_0x39bf2a){if(_0x39bf2a){_0x23989f=_0x39bf2a[_0xbf1e('0x37')];if(!_0x488d19['query'][_0xbf1e('0x38')](_0xbf1e('0x4e'))){_0x1df04c['limit']=qs[_0xbf1e('0x1e')](_0x488d19[_0xbf1e('0x30')]['limit']);_0x1df04c[_0xbf1e('0x1c')]=qs[_0xbf1e('0x1c')](_0x488d19[_0xbf1e('0x30')][_0xbf1e('0x1c')]);}return _0x1050f5[_0xbf1e('0x50')](_0x1df04c);}})['then'](function(_0x55569b){if(_0x55569b){return _0x55569b?{'count':_0x23989f,'rows':_0x55569b}:null;}})[_0xbf1e('0x26')](respondWithResult(_0x32531b,null))['catch'](handleError(_0x32531b,null));}; \ No newline at end of file +var _0x4a9b=['getDescriptions','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','body','params','getFields','findOne','ZohoField','getSubjects'];(function(_0x24eb57,_0x345325){var _0x2ed018=function(_0x58d204){while(--_0x58d204){_0x24eb57['push'](_0x24eb57['shift']());}};_0x2ed018(++_0x345325);}(_0x4a9b,0x187));var _0xb4a9=function(_0x29a398,_0x1fcb02){_0x29a398=_0x29a398-0x0;var _0x24d3ed=_0x4a9b[_0x29a398];return _0x24d3ed;};'use strict';var emlformat=require(_0xb4a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4a9('0x1'));var jsonpatch=require(_0xb4a9('0x2'));var rp=require('request-promise');var moment=require(_0xb4a9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb4a9('0x4'));var util=require(_0xb4a9('0x5'));var path=require(_0xb4a9('0x6'));var sox=require(_0xb4a9('0x7'));var csv=require(_0xb4a9('0x8'));var ejs=require(_0xb4a9('0x9'));var fs=require('fs');var fs_extra=require(_0xb4a9('0xa'));var _=require(_0xb4a9('0xb'));var squel=require(_0xb4a9('0xc'));var crypto=require(_0xb4a9('0xd'));var jsforce=require(_0xb4a9('0xe'));var deskjs=require(_0xb4a9('0xf'));var toCsv=require(_0xb4a9('0x8'));var querystring=require(_0xb4a9('0x10'));var Papa=require('papaparse');var Redis=require(_0xb4a9('0x11'));var authService=require(_0xb4a9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb4a9('0x13'))(_0xb4a9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb4a9('0x15'));var db=require(_0xb4a9('0x16'))['db'];function respondWithStatusCode(_0x13ef48,_0x45e895){_0x45e895=_0x45e895||0xcc;return function(_0x26e030){if(_0x26e030){return _0x13ef48[_0xb4a9('0x17')](_0x45e895);}return _0x13ef48[_0xb4a9('0x18')](_0x45e895)[_0xb4a9('0x19')]();};}function respondWithResult(_0x31226b,_0x689f6e){_0x689f6e=_0x689f6e||0xc8;return function(_0x63cb7){if(_0x63cb7){return _0x31226b[_0xb4a9('0x18')](_0x689f6e)[_0xb4a9('0x1a')](_0x63cb7);}};}function respondWithFilteredResult(_0x57e0b3,_0x5826a2){return function(_0x508271){if(_0x508271){var _0x5834a6=typeof _0x5826a2[_0xb4a9('0x1b')]===_0xb4a9('0x1c')&&typeof _0x5826a2[_0xb4a9('0x1d')]===_0xb4a9('0x1c');var _0x3f0f9d=_0x508271[_0xb4a9('0x1e')];var _0x474943=_0x5834a6?0x0:_0x5826a2[_0xb4a9('0x1b')];var _0x12172c=_0x5834a6?_0x508271['count']:_0x5826a2[_0xb4a9('0x1b')]+_0x5826a2[_0xb4a9('0x1d')];var _0x70a3fc;if(_0x12172c>=_0x3f0f9d){_0x12172c=_0x3f0f9d;_0x70a3fc=0xc8;}else{_0x70a3fc=0xce;}_0x57e0b3[_0xb4a9('0x18')](_0x70a3fc);return _0x57e0b3[_0xb4a9('0x1f')]('Content-Range',_0x474943+'-'+_0x12172c+'/'+_0x3f0f9d)[_0xb4a9('0x1a')](_0x508271);}return null;};}function patchUpdates(_0x4f5bc7){return function(_0x4f03fc){try{jsonpatch['apply'](_0x4f03fc,_0x4f5bc7,!![]);}catch(_0x2386da){return BPromise['reject'](_0x2386da);}return _0x4f03fc[_0xb4a9('0x20')]();};}function saveUpdates(_0x15d70e,_0x13125f){return function(_0x4e49cb){if(_0x4e49cb){return _0x4e49cb[_0xb4a9('0x21')](_0x15d70e)[_0xb4a9('0x22')](function(_0x25686e){return _0x25686e;});}return null;};}function removeEntity(_0x42ec8d,_0x489b84){return function(_0x1f8b8b){if(_0x1f8b8b){return _0x1f8b8b[_0xb4a9('0x23')]()[_0xb4a9('0x22')](function(){_0x42ec8d['status'](0xcc)[_0xb4a9('0x19')]();});}};}function handleEntityNotFound(_0x44f4f5,_0x33668e){return function(_0x5f1384){if(!_0x5f1384){_0x44f4f5['sendStatus'](0x194);}return _0x5f1384;};}function handleError(_0x2ab7cb,_0x4125f2){_0x4125f2=_0x4125f2||0x1f4;return function(_0x280548){logger[_0xb4a9('0x24')](_0x280548[_0xb4a9('0x25')]);if(_0x280548[_0xb4a9('0x26')]){delete _0x280548[_0xb4a9('0x26')];}_0x2ab7cb['status'](_0x4125f2)['send'](_0x280548);};}exports[_0xb4a9('0x27')]=function(_0x1e4aa3,_0x1985d3){var _0x582f21={},_0x316563={},_0x384bea={'count':0x0,'rows':[]};var _0x50d349=_[_0xb4a9('0x28')](db[_0xb4a9('0x29')][_0xb4a9('0x2a')],function(_0x85af82){return{'name':_0x85af82[_0xb4a9('0x2b')],'type':_0x85af82[_0xb4a9('0x2c')][_0xb4a9('0x2d')]};});_0x316563[_0xb4a9('0x2e')]=_[_0xb4a9('0x28')](_0x50d349,_0xb4a9('0x26'));_0x316563[_0xb4a9('0x2f')]=_[_0xb4a9('0x30')](_0x1e4aa3[_0xb4a9('0x2f')]);_0x316563[_0xb4a9('0x31')]=_[_0xb4a9('0x32')](_0x316563[_0xb4a9('0x2e')],_0x316563[_0xb4a9('0x2f')]);_0x582f21[_0xb4a9('0x33')]=_['intersection'](_0x316563[_0xb4a9('0x2e')],qs[_0xb4a9('0x34')](_0x1e4aa3['query'][_0xb4a9('0x34')]));_0x582f21['attributes']=_0x582f21['attributes']['length']?_0x582f21['attributes']:_0x316563[_0xb4a9('0x2e')];if(!_0x1e4aa3[_0xb4a9('0x2f')][_0xb4a9('0x35')](_0xb4a9('0x36'))){_0x582f21[_0xb4a9('0x1d')]=qs[_0xb4a9('0x1d')](_0x1e4aa3[_0xb4a9('0x2f')]['limit']);_0x582f21[_0xb4a9('0x1b')]=qs[_0xb4a9('0x1b')](_0x1e4aa3[_0xb4a9('0x2f')]['offset']);}_0x582f21[_0xb4a9('0x37')]=qs[_0xb4a9('0x38')](_0x1e4aa3[_0xb4a9('0x2f')][_0xb4a9('0x38')]);_0x582f21['where']=qs[_0xb4a9('0x31')](_[_0xb4a9('0x39')](_0x1e4aa3[_0xb4a9('0x2f')],_0x316563['filters']),_0x50d349);if(_0x1e4aa3[_0xb4a9('0x2f')]['filter']){_0x582f21['where']=_[_0xb4a9('0x3a')](_0x582f21[_0xb4a9('0x3b')],{'$or':_['map'](_0x50d349,function(_0x5a36c2){if(_0x5a36c2[_0xb4a9('0x2c')]!==_0xb4a9('0x3c')){var _0x40f219={};_0x40f219[_0x5a36c2['name']]={'$like':'%'+_0x1e4aa3[_0xb4a9('0x2f')][_0xb4a9('0x3d')]+'%'};return _0x40f219;}})});}_0x582f21=_['merge']({},_0x582f21,_0x1e4aa3[_0xb4a9('0x3e')]);var _0x3006a0={'where':_0x582f21['where']};return db[_0xb4a9('0x29')][_0xb4a9('0x1e')](_0x3006a0)[_0xb4a9('0x22')](function(_0x2a3f78){_0x384bea[_0xb4a9('0x1e')]=_0x2a3f78;if(_0x1e4aa3['query'][_0xb4a9('0x3f')]){_0x582f21[_0xb4a9('0x40')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xb4a9('0x41')](_0x582f21);})['then'](function(_0x4dbd57){_0x384bea[_0xb4a9('0x42')]=_0x4dbd57;return _0x384bea;})['then'](respondWithFilteredResult(_0x1985d3,_0x582f21))[_0xb4a9('0x43')](handleError(_0x1985d3,null));};exports[_0xb4a9('0x44')]=function(_0x568e2d,_0x82a8c5){var _0x4abc8e={'raw':![],'where':{'id':_0x568e2d['params']['id']}},_0x3a671c={};_0x3a671c[_0xb4a9('0x2e')]=_['keys'](db[_0xb4a9('0x29')][_0xb4a9('0x2a')]);_0x3a671c[_0xb4a9('0x2f')]=_[_0xb4a9('0x30')](_0x568e2d['query']);_0x3a671c[_0xb4a9('0x31')]=_['intersection'](_0x3a671c[_0xb4a9('0x2e')],_0x3a671c[_0xb4a9('0x2f')]);_0x4abc8e[_0xb4a9('0x33')]=_[_0xb4a9('0x32')](_0x3a671c[_0xb4a9('0x2e')],qs[_0xb4a9('0x34')](_0x568e2d[_0xb4a9('0x2f')][_0xb4a9('0x34')]));_0x4abc8e[_0xb4a9('0x33')]=_0x4abc8e[_0xb4a9('0x33')][_0xb4a9('0x45')]?_0x4abc8e['attributes']:_0x3a671c[_0xb4a9('0x2e')];if(_0x568e2d[_0xb4a9('0x2f')][_0xb4a9('0x3f')]){_0x4abc8e[_0xb4a9('0x40')]=[{'all':!![]}];}_0x4abc8e=_[_0xb4a9('0x3a')]({},_0x4abc8e,_0x568e2d[_0xb4a9('0x3e')]);return db['ZohoConfiguration'][_0xb4a9('0x46')](_0x4abc8e)['then'](handleEntityNotFound(_0x82a8c5,null))[_0xb4a9('0x22')](respondWithResult(_0x82a8c5,null))[_0xb4a9('0x43')](handleError(_0x82a8c5,null));};exports['create']=function(_0x4b6a02,_0x442f6e){return db[_0xb4a9('0x29')]['create'](_0x4b6a02[_0xb4a9('0x47')],{})[_0xb4a9('0x22')](respondWithResult(_0x442f6e,0xc9))[_0xb4a9('0x43')](handleError(_0x442f6e,null));};exports[_0xb4a9('0x21')]=function(_0x19b3ae,_0x1d6180){if(_0x19b3ae[_0xb4a9('0x47')]['id']){delete _0x19b3ae['body']['id'];}return db[_0xb4a9('0x29')]['find']({'where':{'id':_0x19b3ae[_0xb4a9('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d6180,null))[_0xb4a9('0x22')](saveUpdates(_0x19b3ae[_0xb4a9('0x47')],null))[_0xb4a9('0x22')](respondWithResult(_0x1d6180,null))[_0xb4a9('0x43')](handleError(_0x1d6180,null));};exports[_0xb4a9('0x23')]=function(_0x29d47a,_0x2681b9){return db[_0xb4a9('0x29')][_0xb4a9('0x46')]({'where':{'id':_0x29d47a[_0xb4a9('0x48')]['id']}})[_0xb4a9('0x22')](handleEntityNotFound(_0x2681b9,null))[_0xb4a9('0x22')](removeEntity(_0x2681b9,null))[_0xb4a9('0x43')](handleError(_0x2681b9,null));};exports[_0xb4a9('0x49')]=function(_0x48d3c0,_0x23c947,_0x1b334b){var _0x5a992d={};var _0x1fbf7f={};var _0x270531;var _0x265422;return db['ZohoConfiguration'][_0xb4a9('0x4a')]({'where':{'id':_0x48d3c0['params']['id']}})[_0xb4a9('0x22')](handleEntityNotFound(_0x23c947,null))[_0xb4a9('0x22')](function(_0x33c0e5){if(_0x33c0e5){_0x270531=_0x33c0e5;_0x1fbf7f[_0xb4a9('0x2e')]=_[_0xb4a9('0x30')](db[_0xb4a9('0x4b')][_0xb4a9('0x2a')]);_0x1fbf7f['query']=_['keys'](_0x48d3c0[_0xb4a9('0x2f')]);_0x1fbf7f[_0xb4a9('0x31')]=_[_0xb4a9('0x32')](_0x1fbf7f[_0xb4a9('0x2e')],_0x1fbf7f[_0xb4a9('0x2f')]);_0x5a992d[_0xb4a9('0x33')]=_[_0xb4a9('0x32')](_0x1fbf7f['model'],qs[_0xb4a9('0x34')](_0x48d3c0[_0xb4a9('0x2f')]['fields']));_0x5a992d[_0xb4a9('0x33')]=_0x5a992d['attributes']['length']?_0x5a992d['attributes']:_0x1fbf7f[_0xb4a9('0x2e')];_0x5a992d['order']=qs['sort'](_0x48d3c0[_0xb4a9('0x2f')][_0xb4a9('0x38')]);_0x5a992d['where']=qs[_0xb4a9('0x31')](_['pick'](_0x48d3c0[_0xb4a9('0x2f')],_0x1fbf7f[_0xb4a9('0x31')]));if(_0x48d3c0['query'][_0xb4a9('0x3d')]){_0x5a992d['where']=_[_0xb4a9('0x3a')](_0x5a992d['where'],{'$or':_[_0xb4a9('0x28')](_0x5a992d[_0xb4a9('0x33')],function(_0x5eb635){var _0x454138={};_0x454138[_0x5eb635]={'$like':'%'+_0x48d3c0[_0xb4a9('0x2f')]['filter']+'%'};return _0x454138;})});}_0x5a992d=_[_0xb4a9('0x3a')]({},_0x5a992d,_0x48d3c0[_0xb4a9('0x3e')]);return _0x270531['getFields'](_0x5a992d);}})['then'](function(_0x6e61f7){if(_0x6e61f7){_0x265422=_0x6e61f7[_0xb4a9('0x45')];if(!_0x48d3c0[_0xb4a9('0x2f')][_0xb4a9('0x35')](_0xb4a9('0x36'))){_0x5a992d[_0xb4a9('0x1d')]=qs['limit'](_0x48d3c0[_0xb4a9('0x2f')]['limit']);_0x5a992d[_0xb4a9('0x1b')]=qs[_0xb4a9('0x1b')](_0x48d3c0[_0xb4a9('0x2f')][_0xb4a9('0x1b')]);}return _0x270531['getFields'](_0x5a992d);}})[_0xb4a9('0x22')](function(_0x24644f){if(_0x24644f){return _0x24644f?{'count':_0x265422,'rows':_0x24644f}:null;}})[_0xb4a9('0x22')](respondWithResult(_0x23c947,null))[_0xb4a9('0x43')](handleError(_0x23c947,null));};exports['getSubjects']=function(_0xa9a168,_0x1054e7,_0x17c1ca){var _0x474ee7={};var _0x463832={};var _0x94d2d3;var _0x1994ca;return db[_0xb4a9('0x29')][_0xb4a9('0x4a')]({'where':{'id':_0xa9a168[_0xb4a9('0x48')]['id']}})[_0xb4a9('0x22')](handleEntityNotFound(_0x1054e7,null))[_0xb4a9('0x22')](function(_0x487bda){if(_0x487bda){_0x94d2d3=_0x487bda;_0x463832[_0xb4a9('0x2e')]=_[_0xb4a9('0x30')](db[_0xb4a9('0x4b')][_0xb4a9('0x2a')]);_0x463832[_0xb4a9('0x2f')]=_['keys'](_0xa9a168['query']);_0x463832[_0xb4a9('0x31')]=_['intersection'](_0x463832[_0xb4a9('0x2e')],_0x463832[_0xb4a9('0x2f')]);_0x474ee7[_0xb4a9('0x33')]=_[_0xb4a9('0x32')](_0x463832['model'],qs[_0xb4a9('0x34')](_0xa9a168[_0xb4a9('0x2f')][_0xb4a9('0x34')]));_0x474ee7[_0xb4a9('0x33')]=_0x474ee7[_0xb4a9('0x33')][_0xb4a9('0x45')]?_0x474ee7[_0xb4a9('0x33')]:_0x463832[_0xb4a9('0x2e')];_0x474ee7[_0xb4a9('0x37')]=qs[_0xb4a9('0x38')](_0xa9a168[_0xb4a9('0x2f')][_0xb4a9('0x38')]);_0x474ee7['where']=qs[_0xb4a9('0x31')](_[_0xb4a9('0x39')](_0xa9a168['query'],_0x463832[_0xb4a9('0x31')]));if(_0xa9a168[_0xb4a9('0x2f')][_0xb4a9('0x3d')]){_0x474ee7[_0xb4a9('0x3b')]=_[_0xb4a9('0x3a')](_0x474ee7[_0xb4a9('0x3b')],{'$or':_[_0xb4a9('0x28')](_0x474ee7[_0xb4a9('0x33')],function(_0x380499){var _0x49e09c={};_0x49e09c[_0x380499]={'$like':'%'+_0xa9a168[_0xb4a9('0x2f')]['filter']+'%'};return _0x49e09c;})});}_0x474ee7=_[_0xb4a9('0x3a')]({},_0x474ee7,_0xa9a168['options']);return _0x94d2d3[_0xb4a9('0x4c')](_0x474ee7);}})[_0xb4a9('0x22')](function(_0x48afbc){if(_0x48afbc){_0x1994ca=_0x48afbc['length'];if(!_0xa9a168[_0xb4a9('0x2f')]['hasOwnProperty']('nolimit')){_0x474ee7['limit']=qs[_0xb4a9('0x1d')](_0xa9a168[_0xb4a9('0x2f')]['limit']);_0x474ee7[_0xb4a9('0x1b')]=qs[_0xb4a9('0x1b')](_0xa9a168[_0xb4a9('0x2f')]['offset']);}return _0x94d2d3[_0xb4a9('0x4c')](_0x474ee7);}})['then'](function(_0x326278){if(_0x326278){return _0x326278?{'count':_0x1994ca,'rows':_0x326278}:null;}})[_0xb4a9('0x22')](respondWithResult(_0x1054e7,null))['catch'](handleError(_0x1054e7,null));};exports[_0xb4a9('0x4d')]=function(_0x4e92d9,_0x4c2244,_0x2bf732){var _0x210ed8={};var _0x3986ce={};var _0x251bdd;var _0x349e5d;return db[_0xb4a9('0x29')][_0xb4a9('0x4a')]({'where':{'id':_0x4e92d9[_0xb4a9('0x48')]['id']}})[_0xb4a9('0x22')](handleEntityNotFound(_0x4c2244,null))[_0xb4a9('0x22')](function(_0x51beff){if(_0x51beff){_0x251bdd=_0x51beff;_0x3986ce['model']=_[_0xb4a9('0x30')](db[_0xb4a9('0x4b')][_0xb4a9('0x2a')]);_0x3986ce[_0xb4a9('0x2f')]=_[_0xb4a9('0x30')](_0x4e92d9[_0xb4a9('0x2f')]);_0x3986ce[_0xb4a9('0x31')]=_['intersection'](_0x3986ce[_0xb4a9('0x2e')],_0x3986ce[_0xb4a9('0x2f')]);_0x210ed8[_0xb4a9('0x33')]=_['intersection'](_0x3986ce[_0xb4a9('0x2e')],qs[_0xb4a9('0x34')](_0x4e92d9['query'][_0xb4a9('0x34')]));_0x210ed8['attributes']=_0x210ed8['attributes'][_0xb4a9('0x45')]?_0x210ed8[_0xb4a9('0x33')]:_0x3986ce[_0xb4a9('0x2e')];_0x210ed8['order']=qs[_0xb4a9('0x38')](_0x4e92d9[_0xb4a9('0x2f')]['sort']);_0x210ed8[_0xb4a9('0x3b')]=qs['filters'](_['pick'](_0x4e92d9[_0xb4a9('0x2f')],_0x3986ce[_0xb4a9('0x31')]));if(_0x4e92d9[_0xb4a9('0x2f')][_0xb4a9('0x3d')]){_0x210ed8[_0xb4a9('0x3b')]=_[_0xb4a9('0x3a')](_0x210ed8[_0xb4a9('0x3b')],{'$or':_['map'](_0x210ed8['attributes'],function(_0x550a83){var _0x28fc01={};_0x28fc01[_0x550a83]={'$like':'%'+_0x4e92d9['query'][_0xb4a9('0x3d')]+'%'};return _0x28fc01;})});}_0x210ed8=_[_0xb4a9('0x3a')]({},_0x210ed8,_0x4e92d9[_0xb4a9('0x3e')]);return _0x251bdd['getDescriptions'](_0x210ed8);}})[_0xb4a9('0x22')](function(_0x27e340){if(_0x27e340){_0x349e5d=_0x27e340[_0xb4a9('0x45')];if(!_0x4e92d9[_0xb4a9('0x2f')][_0xb4a9('0x35')](_0xb4a9('0x36'))){_0x210ed8[_0xb4a9('0x1d')]=qs[_0xb4a9('0x1d')](_0x4e92d9[_0xb4a9('0x2f')][_0xb4a9('0x1d')]);_0x210ed8[_0xb4a9('0x1b')]=qs[_0xb4a9('0x1b')](_0x4e92d9[_0xb4a9('0x2f')][_0xb4a9('0x1b')]);}return _0x251bdd[_0xb4a9('0x4d')](_0x210ed8);}})['then'](function(_0xab7d21){if(_0xab7d21){return _0xab7d21?{'count':_0x349e5d,'rows':_0xab7d21}:null;}})[_0xb4a9('0x22')](respondWithResult(_0x4c2244,null))['catch'](handleError(_0x4c2244,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index ae234b5..46c08e0 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 _0x6de1=['ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x1d5742,_0x4a2b9b){var _0x1e9cfe=function(_0x393e9f){while(--_0x393e9f){_0x1d5742['push'](_0x1d5742['shift']());}};_0x1e9cfe(++_0x4a2b9b);}(_0x6de1,0x1f1));var _0x16de=function(_0x1265ed,_0x4b85e8){_0x1265ed=_0x1265ed-0x0;var _0x5ac459=_0x6de1[_0x1265ed];return _0x5ac459;};'use strict';var _=require(_0x16de('0x0'));var util=require(_0x16de('0x1'));var logger=require('../../config/logger')(_0x16de('0x2'));var moment=require(_0x16de('0x3'));var BPromise=require('bluebird');var rp=require(_0x16de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16de('0x5'));var config=require(_0x16de('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0x16de('0x7')]=function(_0x4c84fa,_0x4d4ba8){return _0x4c84fa[_0x16de('0x8')](_0x16de('0x9'),attributes,{'tableName':_0x16de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82db=['define','int_zoho_configurations','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0x82db,0x106));var _0xb82d=function(_0x5a72bc,_0xa7fc7d){_0x5a72bc=_0x5a72bc-0x0;var _0x925544=_0x82db[_0x5a72bc];return _0x925544;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb82d('0x0'));var BPromise=require(_0xb82d('0x1'));var rp=require(_0xb82d('0x2'));var fs=require('fs');var path=require(_0xb82d('0x3'));var rimraf=require(_0xb82d('0x4'));var config=require(_0xb82d('0x5'));var attributes=require(_0xb82d('0x6'));module[_0xb82d('0x7')]=function(_0x4c1990,_0x1f52c0){return _0x4c1990[_0xb82d('0x8')]('ZohoConfiguration',attributes,{'tableName':_0xb82d('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 2f5d26e..fe8a98c 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 _0x66dc=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x33bff2,_0x46f0d6){var _0x31d0be=function(_0x2b6fc3){while(--_0x2b6fc3){_0x33bff2['push'](_0x33bff2['shift']());}};_0x31d0be(++_0x46f0d6);}(_0x66dc,0xad));var _0xc66d=function(_0x4b8eb0,_0x126dbf){_0x4b8eb0=_0x4b8eb0-0x0;var _0xffc67f=_0x66dc[_0x4b8eb0];return _0xffc67f;};'use strict';var _=require(_0xc66d('0x0'));var util=require(_0xc66d('0x1'));var moment=require(_0xc66d('0x2'));var BPromise=require(_0xc66d('0x3'));var rs=require(_0xc66d('0x4'));var fs=require('fs');var Redis=require(_0xc66d('0x5'));var db=require(_0xc66d('0x6'))['db'];var utils=require(_0xc66d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc66d('0x8'));var jayson=require(_0xc66d('0x9'));var client=jayson[_0xc66d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x424a3e,_0x47ae82,_0x99fac4){return new BPromise(function(_0x1d1f37,_0x3047c3){return client['request'](_0x424a3e,_0x99fac4)[_0xc66d('0xb')](function(_0xb31a96){logger[_0xc66d('0xc')](_0xc66d('0xd'),_0x47ae82,_0xc66d('0xe'));logger[_0xc66d('0xf')](_0xc66d('0x10'),_0x47ae82,_0xc66d('0xe'),JSON[_0xc66d('0x11')](_0xb31a96));if(_0xb31a96[_0xc66d('0x12')]){if(_0xb31a96['error'][_0xc66d('0x13')]===0x1f4){logger[_0xc66d('0x12')](_0xc66d('0xd'),_0x47ae82,_0xb31a96[_0xc66d('0x12')][_0xc66d('0x14')]);return _0x3047c3(_0xb31a96[_0xc66d('0x12')][_0xc66d('0x14')]);}logger[_0xc66d('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x47ae82,_0xb31a96['error'][_0xc66d('0x14')]);return _0x1d1f37(_0xb31a96['error'][_0xc66d('0x14')]);}else{logger[_0xc66d('0xc')](_0xc66d('0xd'),_0x47ae82,_0xc66d('0xe'));_0x1d1f37(_0xb31a96['result'][_0xc66d('0x14')]);}})[_0xc66d('0x15')](function(_0x581255){logger[_0xc66d('0x12')](_0xc66d('0xd'),_0x47ae82,_0x581255);_0x3047c3(_0x581255);});});} \ No newline at end of file +var _0xf362=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xf362,0x18f));var _0x2f36=function(_0x5f1dee,_0x30b6f9){_0x5f1dee=_0x5f1dee-0x0;var _0x370186=_0xf362[_0x5f1dee];return _0x370186;};'use strict';var _=require(_0x2f36('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2f36('0x1'));var rs=require(_0x2f36('0x2'));var fs=require('fs');var Redis=require(_0x2f36('0x3'));var db=require(_0x2f36('0x4'))['db'];var utils=require(_0x2f36('0x5'));var logger=require(_0x2f36('0x6'))(_0x2f36('0x7'));var config=require(_0x2f36('0x8'));var jayson=require(_0x2f36('0x9'));var client=jayson[_0x2f36('0xa')][_0x2f36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6bd8,_0x518055,_0x15446c){return new BPromise(function(_0x3dfbcc,_0x28b423){return client[_0x2f36('0xc')](_0x4a6bd8,_0x15446c)[_0x2f36('0xd')](function(_0x2484a4){logger[_0x2f36('0xe')](_0x2f36('0xf'),_0x518055,_0x2f36('0x10'));logger[_0x2f36('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x518055,'request\x20sent',JSON[_0x2f36('0x12')](_0x2484a4));if(_0x2484a4[_0x2f36('0x13')]){if(_0x2484a4[_0x2f36('0x13')][_0x2f36('0x14')]===0x1f4){logger[_0x2f36('0x13')](_0x2f36('0xf'),_0x518055,_0x2484a4[_0x2f36('0x13')][_0x2f36('0x15')]);return _0x28b423(_0x2484a4['error'][_0x2f36('0x15')]);}logger[_0x2f36('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x518055,_0x2484a4[_0x2f36('0x13')][_0x2f36('0x15')]);return _0x3dfbcc(_0x2484a4[_0x2f36('0x13')][_0x2f36('0x15')]);}else{logger[_0x2f36('0xe')](_0x2f36('0xf'),_0x518055,_0x2f36('0x10'));_0x3dfbcc(_0x2484a4['result'][_0x2f36('0x15')]);}})[_0x2f36('0x16')](function(_0xb002eb){logger[_0x2f36('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x518055,_0xb002eb);_0x28b423(_0xb002eb);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index e143057..4c34fd6 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 _0xc22f=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','isAuthenticated','show','post','put','update','delete','exports','multer'];(function(_0x4d6b9c,_0x545c05){var _0x467ad1=function(_0x5cc530){while(--_0x5cc530){_0x4d6b9c['push'](_0x4d6b9c['shift']());}};_0x467ad1(++_0x545c05);}(_0xc22f,0x9f));var _0xfc22=function(_0x203ac0,_0x27b022){_0x203ac0=_0x203ac0-0x0;var _0x49c107=_0xc22f[_0x203ac0];return _0x49c107;};'use strict';var multer=require(_0xfc22('0x0'));var util=require(_0xfc22('0x1'));var path=require(_0xfc22('0x2'));var timeout=require(_0xfc22('0x3'));var express=require(_0xfc22('0x4'));var router=express[_0xfc22('0x5')]();var fs_extra=require(_0xfc22('0x6'));var auth=require(_0xfc22('0x7'));var interaction=require(_0xfc22('0x8'));var config=require(_0xfc22('0x9'));var controller=require(_0xfc22('0xa'));router[_0xfc22('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfc22('0xb')](_0xfc22('0xc'),auth[_0xfc22('0xd')](),controller[_0xfc22('0xe')]);router[_0xfc22('0xf')]('/',auth[_0xfc22('0xd')](),controller['create']);router[_0xfc22('0x10')](_0xfc22('0xc'),auth[_0xfc22('0xd')](),controller[_0xfc22('0x11')]);router[_0xfc22('0x12')](_0xfc22('0xc'),auth[_0xfc22('0xd')](),controller['destroy']);module[_0xfc22('0x13')]=router; \ No newline at end of file +var _0xb065=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','isAuthenticated','show','post','create','put','update','multer','util','path','Router'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xb065,0xec));var _0x5b06=function(_0x22beab,_0x410db5){_0x22beab=_0x22beab-0x0;var _0x39f010=_0xb065[_0x22beab];return _0x39f010;};'use strict';var multer=require(_0x5b06('0x0'));var util=require(_0x5b06('0x1'));var path=require(_0x5b06('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5b06('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5b06('0x4'));var interaction=require(_0x5b06('0x5'));var config=require(_0x5b06('0x6'));var controller=require(_0x5b06('0x7'));router[_0x5b06('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b06('0x8')](_0x5b06('0x9'),auth[_0x5b06('0xa')](),controller[_0x5b06('0xb')]);router[_0x5b06('0xc')]('/',auth[_0x5b06('0xa')](),controller[_0x5b06('0xd')]);router[_0x5b06('0xe')](_0x5b06('0x9'),auth[_0x5b06('0xa')](),controller[_0x5b06('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 681fdeb..5b05484 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 _0xb5d9=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x200f1c,_0x5515b5){var _0x1443aa=function(_0x59126a){while(--_0x59126a){_0x200f1c['push'](_0x200f1c['shift']());}};_0x1443aa(++_0x5515b5);}(_0xb5d9,0xab));var _0x9b5d=function(_0x26b83d,_0xe7497){_0x26b83d=_0x26b83d-0x0;var _0x4c9fb6=_0xb5d9[_0x26b83d];return _0x4c9fb6;};'use strict';var Sequelize=require('sequelize');module[_0x9b5d('0x0')]={'type':{'type':Sequelize[_0x9b5d('0x1')](_0x9b5d('0x2'),_0x9b5d('0x3'),_0x9b5d('0x4'),_0x9b5d('0x5'),_0x9b5d('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9b5d('0x7')]},'key':{'type':Sequelize[_0x9b5d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x9b5d('0x2'),_0x9b5d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x9b5d('0x7')]},'idField':{'type':Sequelize[_0x9b5d('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9b5d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf7e5=['variable','picklist','STRING','ENUM','sequelize','exports','string'];(function(_0x209891,_0x5c9861){var _0x13e4a8=function(_0x271be4){while(--_0x271be4){_0x209891['push'](_0x209891['shift']());}};_0x13e4a8(++_0x5c9861);}(_0xf7e5,0xa5));var _0x5f7e=function(_0x4fe528,_0x75d312){_0x4fe528=_0x4fe528-0x0;var _0x37ceb3=_0xf7e5[_0x4fe528];return _0x37ceb3;};'use strict';var Sequelize=require(_0x5f7e('0x0'));module[_0x5f7e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5f7e('0x2'),_0x5f7e('0x3'),'customVariable','keyValue',_0x5f7e('0x4')),'defaultValue':_0x5f7e('0x2')},'content':{'type':Sequelize[_0x5f7e('0x5')]},'key':{'type':Sequelize[_0x5f7e('0x5')]},'keyType':{'type':Sequelize[_0x5f7e('0x6')]('string',_0x5f7e('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x5f7e('0x5')]},'idField':{'type':Sequelize[_0x5f7e('0x5')]},'nameField':{'type':Sequelize[_0x5f7e('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5f7e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 59b68c7..2240fd5 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 _0xa552=['then','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','intersection','options','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0xa552,0x147));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2a55('0x0'));var rimraf=require(_0x2a55('0x1'));var zipdir=require(_0x2a55('0x2'));var jsonpatch=require(_0x2a55('0x3'));var rp=require('request-promise');var moment=require(_0x2a55('0x4'));var BPromise=require(_0x2a55('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a55('0x6'));var sox=require(_0x2a55('0x7'));var csv=require(_0x2a55('0x8'));var ejs=require(_0x2a55('0x9'));var fs=require('fs');var fs_extra=require(_0x2a55('0xa'));var _=require(_0x2a55('0xb'));var squel=require(_0x2a55('0xc'));var crypto=require('crypto');var jsforce=require(_0x2a55('0xd'));var deskjs=require(_0x2a55('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2a55('0xf'));var Papa=require(_0x2a55('0x10'));var Redis=require('ioredis');var authService=require(_0x2a55('0x11'));var qs=require(_0x2a55('0x12'));var as=require(_0x2a55('0x13'));var hardwareService=require(_0x2a55('0x14'));var logger=require(_0x2a55('0x15'))(_0x2a55('0x16'));var utils=require(_0x2a55('0x17'));var config=require(_0x2a55('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a55('0x19'))['db'];function respondWithStatusCode(_0x441658,_0x5e000c){_0x5e000c=_0x5e000c||0xcc;return function(_0x207cae){if(_0x207cae){return _0x441658['sendStatus'](_0x5e000c);}return _0x441658['status'](_0x5e000c)[_0x2a55('0x1a')]();};}function respondWithResult(_0x3f623d,_0x3fabf4){_0x3fabf4=_0x3fabf4||0xc8;return function(_0x589286){if(_0x589286){return _0x3f623d[_0x2a55('0x1b')](_0x3fabf4)['json'](_0x589286);}};}function respondWithFilteredResult(_0x5e5632,_0x556c85){return function(_0x174186){if(_0x174186){var _0x6d0efa=typeof _0x556c85[_0x2a55('0x1c')]==='undefined'&&typeof _0x556c85[_0x2a55('0x1d')]===_0x2a55('0x1e');var _0x5df8f4=_0x174186[_0x2a55('0x1f')];var _0x537a2b=_0x6d0efa?0x0:_0x556c85[_0x2a55('0x1c')];var _0x540350=_0x6d0efa?_0x174186[_0x2a55('0x1f')]:_0x556c85[_0x2a55('0x1c')]+_0x556c85[_0x2a55('0x1d')];var _0x54d6cc;if(_0x540350>=_0x5df8f4){_0x540350=_0x5df8f4;_0x54d6cc=0xc8;}else{_0x54d6cc=0xce;}_0x5e5632[_0x2a55('0x1b')](_0x54d6cc);return _0x5e5632[_0x2a55('0x20')](_0x2a55('0x21'),_0x537a2b+'-'+_0x540350+'/'+_0x5df8f4)[_0x2a55('0x22')](_0x174186);}return null;};}function patchUpdates(_0x4b1cc5){return function(_0x5e5a5d){try{jsonpatch[_0x2a55('0x23')](_0x5e5a5d,_0x4b1cc5,!![]);}catch(_0x2dfb59){return BPromise['reject'](_0x2dfb59);}return _0x5e5a5d[_0x2a55('0x24')]();};}function saveUpdates(_0x47b851,_0x2c4617){return function(_0x2db552){if(_0x2db552){return _0x2db552[_0x2a55('0x25')](_0x47b851)['then'](function(_0x16b832){return _0x16b832;});}return null;};}function removeEntity(_0xfcf35c,_0x36f05b){return function(_0x3619cf){if(_0x3619cf){return _0x3619cf['destroy']()[_0x2a55('0x26')](function(){_0xfcf35c['status'](0xcc)[_0x2a55('0x1a')]();});}};}function handleEntityNotFound(_0x3aca6f,_0x1935db){return function(_0x1d2dd3){if(!_0x1d2dd3){_0x3aca6f['sendStatus'](0x194);}return _0x1d2dd3;};}function handleError(_0x2c55cc,_0x319944){_0x319944=_0x319944||0x1f4;return function(_0x2f4e3f){logger[_0x2a55('0x27')](_0x2f4e3f[_0x2a55('0x28')]);if(_0x2f4e3f[_0x2a55('0x29')]){delete _0x2f4e3f[_0x2a55('0x29')];}_0x2c55cc[_0x2a55('0x1b')](_0x319944)[_0x2a55('0x2a')](_0x2f4e3f);};}exports['index']=function(_0x5bca70,_0x4eec64){var _0x11e166={},_0x541c1c={},_0x185227={'count':0x0,'rows':[]};var _0x498ac2=_[_0x2a55('0x2b')](db[_0x2a55('0x2c')][_0x2a55('0x2d')],function(_0xb647fb){return{'name':_0xb647fb[_0x2a55('0x2e')],'type':_0xb647fb[_0x2a55('0x2f')][_0x2a55('0x30')]};});_0x541c1c[_0x2a55('0x31')]=_[_0x2a55('0x2b')](_0x498ac2,_0x2a55('0x29'));_0x541c1c[_0x2a55('0x32')]=_[_0x2a55('0x33')](_0x5bca70['query']);_0x541c1c[_0x2a55('0x34')]=_['intersection'](_0x541c1c['model'],_0x541c1c[_0x2a55('0x32')]);_0x11e166[_0x2a55('0x35')]=_['intersection'](_0x541c1c[_0x2a55('0x31')],qs['fields'](_0x5bca70['query'][_0x2a55('0x36')]));_0x11e166[_0x2a55('0x35')]=_0x11e166[_0x2a55('0x35')][_0x2a55('0x37')]?_0x11e166['attributes']:_0x541c1c[_0x2a55('0x31')];if(!_0x5bca70[_0x2a55('0x32')][_0x2a55('0x38')](_0x2a55('0x39'))){_0x11e166['limit']=qs[_0x2a55('0x1d')](_0x5bca70['query'][_0x2a55('0x1d')]);_0x11e166['offset']=qs[_0x2a55('0x1c')](_0x5bca70[_0x2a55('0x32')]['offset']);}_0x11e166['order']=qs['sort'](_0x5bca70[_0x2a55('0x32')]['sort']);_0x11e166[_0x2a55('0x3a')]=qs[_0x2a55('0x34')](_[_0x2a55('0x3b')](_0x5bca70['query'],_0x541c1c['filters']),_0x498ac2);if(_0x5bca70[_0x2a55('0x32')]['filter']){_0x11e166[_0x2a55('0x3a')]=_['merge'](_0x11e166['where'],{'$or':_[_0x2a55('0x2b')](_0x498ac2,function(_0x2d2d35){if(_0x2d2d35['type']!==_0x2a55('0x3c')){var _0x489a00={};_0x489a00[_0x2d2d35[_0x2a55('0x29')]]={'$like':'%'+_0x5bca70[_0x2a55('0x32')][_0x2a55('0x3d')]+'%'};return _0x489a00;}})});}_0x11e166=_[_0x2a55('0x3e')]({},_0x11e166,_0x5bca70['options']);var _0xd50b35={'where':_0x11e166['where']};return db['ZohoField'][_0x2a55('0x1f')](_0xd50b35)[_0x2a55('0x26')](function(_0x22418e){_0x185227['count']=_0x22418e;if(_0x5bca70['query'][_0x2a55('0x3f')]){_0x11e166[_0x2a55('0x40')]=[{'all':!![]}];}return db['ZohoField'][_0x2a55('0x41')](_0x11e166);})[_0x2a55('0x26')](function(_0x5bdb29){_0x185227['rows']=_0x5bdb29;return _0x185227;})[_0x2a55('0x26')](respondWithFilteredResult(_0x4eec64,_0x11e166))[_0x2a55('0x42')](handleError(_0x4eec64,null));};exports[_0x2a55('0x43')]=function(_0x4ebad4,_0x374750){var _0x40f8a1={'raw':!![],'where':{'id':_0x4ebad4[_0x2a55('0x44')]['id']}},_0x4970f0={};_0x4970f0[_0x2a55('0x31')]=_[_0x2a55('0x33')](db['ZohoField'][_0x2a55('0x2d')]);_0x4970f0[_0x2a55('0x32')]=_[_0x2a55('0x33')](_0x4ebad4['query']);_0x4970f0[_0x2a55('0x34')]=_[_0x2a55('0x45')](_0x4970f0[_0x2a55('0x31')],_0x4970f0[_0x2a55('0x32')]);_0x40f8a1['attributes']=_[_0x2a55('0x45')](_0x4970f0['model'],qs['fields'](_0x4ebad4[_0x2a55('0x32')][_0x2a55('0x36')]));_0x40f8a1[_0x2a55('0x35')]=_0x40f8a1['attributes'][_0x2a55('0x37')]?_0x40f8a1[_0x2a55('0x35')]:_0x4970f0[_0x2a55('0x31')];if(_0x4ebad4[_0x2a55('0x32')]['includeAll']){_0x40f8a1['include']=[{'all':!![]}];}_0x40f8a1=_[_0x2a55('0x3e')]({},_0x40f8a1,_0x4ebad4[_0x2a55('0x46')]);return db[_0x2a55('0x2c')]['find'](_0x40f8a1)[_0x2a55('0x26')](handleEntityNotFound(_0x374750,null))[_0x2a55('0x26')](respondWithResult(_0x374750,null))[_0x2a55('0x42')](handleError(_0x374750,null));};exports[_0x2a55('0x47')]=function(_0x276690,_0x4007e3){return db[_0x2a55('0x2c')][_0x2a55('0x47')](_0x276690[_0x2a55('0x48')],{})[_0x2a55('0x26')](respondWithResult(_0x4007e3,0xc9))[_0x2a55('0x42')](handleError(_0x4007e3,null));};exports['update']=function(_0x5481e1,_0x2a0d52){if(_0x5481e1[_0x2a55('0x48')]['id']){delete _0x5481e1[_0x2a55('0x48')]['id'];}return db[_0x2a55('0x2c')]['find']({'where':{'id':_0x5481e1[_0x2a55('0x44')]['id']}})[_0x2a55('0x26')](handleEntityNotFound(_0x2a0d52,null))['then'](saveUpdates(_0x5481e1[_0x2a55('0x48')],null))[_0x2a55('0x26')](respondWithResult(_0x2a0d52,null))[_0x2a55('0x42')](handleError(_0x2a0d52,null));};exports['destroy']=function(_0x51e03d,_0x11aab8){return db[_0x2a55('0x2c')]['find']({'where':{'id':_0x51e03d[_0x2a55('0x44')]['id']}})[_0x2a55('0x26')](handleEntityNotFound(_0x11aab8,null))[_0x2a55('0x26')](removeEntity(_0x11aab8,null))[_0x2a55('0x42')](handleError(_0x11aab8,null));}; \ No newline at end of file +var _0x47ed=['find','update','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','ZohoField','rawAttributes','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length'];(function(_0x2b0533,_0xa89ceb){var _0x3d4d6f=function(_0x447999){while(--_0x447999){_0x2b0533['push'](_0x2b0533['shift']());}};_0x3d4d6f(++_0xa89ceb);}(_0x47ed,0x180));var _0xd47e=function(_0x242dd7,_0x3d81d9){_0x242dd7=_0x242dd7-0x0;var _0x30ae03=_0x47ed[_0x242dd7];return _0x30ae03;};'use strict';var emlformat=require(_0xd47e('0x0'));var rimraf=require(_0xd47e('0x1'));var zipdir=require(_0xd47e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd47e('0x3'));var BPromise=require(_0xd47e('0x4'));var Mustache=require(_0xd47e('0x5'));var util=require(_0xd47e('0x6'));var path=require(_0xd47e('0x7'));var sox=require(_0xd47e('0x8'));var csv=require(_0xd47e('0x9'));var ejs=require(_0xd47e('0xa'));var fs=require('fs');var fs_extra=require(_0xd47e('0xb'));var _=require(_0xd47e('0xc'));var squel=require(_0xd47e('0xd'));var crypto=require(_0xd47e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd47e('0xf'));var toCsv=require(_0xd47e('0x9'));var querystring=require(_0xd47e('0x10'));var Papa=require(_0xd47e('0x11'));var Redis=require(_0xd47e('0x12'));var authService=require(_0xd47e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd47e('0x14'));var hardwareService=require(_0xd47e('0x15'));var logger=require(_0xd47e('0x16'))(_0xd47e('0x17'));var utils=require(_0xd47e('0x18'));var config=require(_0xd47e('0x19'));var licenseUtil=require(_0xd47e('0x1a'));var db=require(_0xd47e('0x1b'))['db'];function respondWithStatusCode(_0x57533a,_0x461861){_0x461861=_0x461861||0xcc;return function(_0x29c0ee){if(_0x29c0ee){return _0x57533a[_0xd47e('0x1c')](_0x461861);}return _0x57533a[_0xd47e('0x1d')](_0x461861)[_0xd47e('0x1e')]();};}function respondWithResult(_0x3dffc9,_0x131db2){_0x131db2=_0x131db2||0xc8;return function(_0x2321de){if(_0x2321de){return _0x3dffc9[_0xd47e('0x1d')](_0x131db2)[_0xd47e('0x1f')](_0x2321de);}};}function respondWithFilteredResult(_0x24631b,_0x239f7c){return function(_0x549dfb){if(_0x549dfb){var _0x12e974=typeof _0x239f7c[_0xd47e('0x20')]===_0xd47e('0x21')&&typeof _0x239f7c['limit']==='undefined';var _0x3eb5e0=_0x549dfb[_0xd47e('0x22')];var _0x5de2ff=_0x12e974?0x0:_0x239f7c[_0xd47e('0x20')];var _0x33f8fe=_0x12e974?_0x549dfb['count']:_0x239f7c[_0xd47e('0x20')]+_0x239f7c[_0xd47e('0x23')];var _0x42ec31;if(_0x33f8fe>=_0x3eb5e0){_0x33f8fe=_0x3eb5e0;_0x42ec31=0xc8;}else{_0x42ec31=0xce;}_0x24631b['status'](_0x42ec31);return _0x24631b[_0xd47e('0x24')](_0xd47e('0x25'),_0x5de2ff+'-'+_0x33f8fe+'/'+_0x3eb5e0)[_0xd47e('0x1f')](_0x549dfb);}return null;};}function patchUpdates(_0x2aba63){return function(_0x4ab02c){try{jsonpatch['apply'](_0x4ab02c,_0x2aba63,!![]);}catch(_0x28489a){return BPromise[_0xd47e('0x26')](_0x28489a);}return _0x4ab02c[_0xd47e('0x27')]();};}function saveUpdates(_0x1231bb,_0x496311){return function(_0x3f5f51){if(_0x3f5f51){return _0x3f5f51['update'](_0x1231bb)[_0xd47e('0x28')](function(_0x286b06){return _0x286b06;});}return null;};}function removeEntity(_0x50add6,_0x520931){return function(_0xc33a0e){if(_0xc33a0e){return _0xc33a0e['destroy']()['then'](function(){_0x50add6[_0xd47e('0x1d')](0xcc)[_0xd47e('0x1e')]();});}};}function handleEntityNotFound(_0x2afe00,_0x3b1a30){return function(_0x23e4c8){if(!_0x23e4c8){_0x2afe00[_0xd47e('0x1c')](0x194);}return _0x23e4c8;};}function handleError(_0x220287,_0x2815fe){_0x2815fe=_0x2815fe||0x1f4;return function(_0x1f39cb){logger[_0xd47e('0x29')](_0x1f39cb[_0xd47e('0x2a')]);if(_0x1f39cb[_0xd47e('0x2b')]){delete _0x1f39cb[_0xd47e('0x2b')];}_0x220287['status'](_0x2815fe)[_0xd47e('0x2c')](_0x1f39cb);};}exports[_0xd47e('0x2d')]=function(_0x1cf12a,_0x2249f4){var _0x2b231c={},_0x38fd50={},_0x380e36={'count':0x0,'rows':[]};var _0x4fadc8=_['map'](db[_0xd47e('0x2e')][_0xd47e('0x2f')],function(_0x296c8a){return{'name':_0x296c8a['fieldName'],'type':_0x296c8a['type']['key']};});_0x38fd50[_0xd47e('0x30')]=_[_0xd47e('0x31')](_0x4fadc8,_0xd47e('0x2b'));_0x38fd50['query']=_[_0xd47e('0x32')](_0x1cf12a[_0xd47e('0x33')]);_0x38fd50[_0xd47e('0x34')]=_[_0xd47e('0x35')](_0x38fd50[_0xd47e('0x30')],_0x38fd50[_0xd47e('0x33')]);_0x2b231c[_0xd47e('0x36')]=_[_0xd47e('0x35')](_0x38fd50[_0xd47e('0x30')],qs[_0xd47e('0x37')](_0x1cf12a[_0xd47e('0x33')][_0xd47e('0x37')]));_0x2b231c['attributes']=_0x2b231c[_0xd47e('0x36')]['length']?_0x2b231c[_0xd47e('0x36')]:_0x38fd50[_0xd47e('0x30')];if(!_0x1cf12a[_0xd47e('0x33')][_0xd47e('0x38')]('nolimit')){_0x2b231c[_0xd47e('0x23')]=qs[_0xd47e('0x23')](_0x1cf12a[_0xd47e('0x33')][_0xd47e('0x23')]);_0x2b231c[_0xd47e('0x20')]=qs[_0xd47e('0x20')](_0x1cf12a[_0xd47e('0x33')][_0xd47e('0x20')]);}_0x2b231c['order']=qs[_0xd47e('0x39')](_0x1cf12a['query'][_0xd47e('0x39')]);_0x2b231c[_0xd47e('0x3a')]=qs[_0xd47e('0x34')](_[_0xd47e('0x3b')](_0x1cf12a[_0xd47e('0x33')],_0x38fd50[_0xd47e('0x34')]),_0x4fadc8);if(_0x1cf12a[_0xd47e('0x33')][_0xd47e('0x3c')]){_0x2b231c[_0xd47e('0x3a')]=_[_0xd47e('0x3d')](_0x2b231c[_0xd47e('0x3a')],{'$or':_[_0xd47e('0x31')](_0x4fadc8,function(_0x39b389){if(_0x39b389[_0xd47e('0x3e')]!==_0xd47e('0x3f')){var _0x355ca3={};_0x355ca3[_0x39b389[_0xd47e('0x2b')]]={'$like':'%'+_0x1cf12a[_0xd47e('0x33')][_0xd47e('0x3c')]+'%'};return _0x355ca3;}})});}_0x2b231c=_[_0xd47e('0x3d')]({},_0x2b231c,_0x1cf12a[_0xd47e('0x40')]);var _0x3512c4={'where':_0x2b231c['where']};return db[_0xd47e('0x2e')]['count'](_0x3512c4)['then'](function(_0x2154c2){_0x380e36[_0xd47e('0x22')]=_0x2154c2;if(_0x1cf12a['query']['includeAll']){_0x2b231c[_0xd47e('0x41')]=[{'all':!![]}];}return db[_0xd47e('0x2e')][_0xd47e('0x42')](_0x2b231c);})['then'](function(_0x15d3c7){_0x380e36[_0xd47e('0x43')]=_0x15d3c7;return _0x380e36;})[_0xd47e('0x28')](respondWithFilteredResult(_0x2249f4,_0x2b231c))[_0xd47e('0x44')](handleError(_0x2249f4,null));};exports[_0xd47e('0x45')]=function(_0x1a13a3,_0x3dcff1){var _0x223734={'raw':!![],'where':{'id':_0x1a13a3[_0xd47e('0x46')]['id']}},_0x2c10d8={};_0x2c10d8[_0xd47e('0x30')]=_[_0xd47e('0x32')](db[_0xd47e('0x2e')][_0xd47e('0x2f')]);_0x2c10d8[_0xd47e('0x33')]=_[_0xd47e('0x32')](_0x1a13a3[_0xd47e('0x33')]);_0x2c10d8['filters']=_[_0xd47e('0x35')](_0x2c10d8['model'],_0x2c10d8['query']);_0x223734['attributes']=_['intersection'](_0x2c10d8[_0xd47e('0x30')],qs[_0xd47e('0x37')](_0x1a13a3['query'][_0xd47e('0x37')]));_0x223734['attributes']=_0x223734[_0xd47e('0x36')][_0xd47e('0x47')]?_0x223734[_0xd47e('0x36')]:_0x2c10d8[_0xd47e('0x30')];if(_0x1a13a3[_0xd47e('0x33')]['includeAll']){_0x223734[_0xd47e('0x41')]=[{'all':!![]}];}_0x223734=_['merge']({},_0x223734,_0x1a13a3[_0xd47e('0x40')]);return db[_0xd47e('0x2e')][_0xd47e('0x48')](_0x223734)[_0xd47e('0x28')](handleEntityNotFound(_0x3dcff1,null))[_0xd47e('0x28')](respondWithResult(_0x3dcff1,null))[_0xd47e('0x44')](handleError(_0x3dcff1,null));};exports['create']=function(_0x3d7b9d,_0x54ef49){return db[_0xd47e('0x2e')]['create'](_0x3d7b9d['body'],{})[_0xd47e('0x28')](respondWithResult(_0x54ef49,0xc9))[_0xd47e('0x44')](handleError(_0x54ef49,null));};exports[_0xd47e('0x49')]=function(_0x562cb8,_0x2d2c9c){if(_0x562cb8['body']['id']){delete _0x562cb8[_0xd47e('0x4a')]['id'];}return db['ZohoField'][_0xd47e('0x48')]({'where':{'id':_0x562cb8[_0xd47e('0x46')]['id']}})[_0xd47e('0x28')](handleEntityNotFound(_0x2d2c9c,null))[_0xd47e('0x28')](saveUpdates(_0x562cb8[_0xd47e('0x4a')],null))[_0xd47e('0x28')](respondWithResult(_0x2d2c9c,null))['catch'](handleError(_0x2d2c9c,null));};exports[_0xd47e('0x4b')]=function(_0x598ade,_0x3940fa){return db['ZohoField'][_0xd47e('0x48')]({'where':{'id':_0x598ade[_0xd47e('0x46')]['id']}})['then'](handleEntityNotFound(_0x3940fa,null))[_0xd47e('0x28')](removeEntity(_0x3940fa,null))[_0xd47e('0x44')](handleError(_0x3940fa,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index cf7693f..f199493 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 _0x1a85=['rimraf','../../config/environment','exports','ZohoField','int_zoho_fields','idField','../../config/logger','api','moment','path'];(function(_0x509342,_0x3bbb15){var _0x42769c=function(_0x373014){while(--_0x373014){_0x509342['push'](_0x509342['shift']());}};_0x42769c(++_0x3bbb15);}(_0x1a85,0x178));var _0x51a8=function(_0x10778c,_0x461571){_0x10778c=_0x10778c-0x0;var _0x38d5f2=_0x1a85[_0x10778c];return _0x38d5f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./intZohoField.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x51a8('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd943=['api','bluebird','request-promise','path','rimraf','../../config/environment','int_zoho_fields','zoho_unique_index','lodash','util','../../config/logger'];(function(_0xa5e587,_0x289f9c){var _0x5e57fe=function(_0x590185){while(--_0x590185){_0xa5e587['push'](_0xa5e587['shift']());}};_0x5e57fe(++_0x289f9c);}(_0xd943,0x15d));var _0x3d94=function(_0x405175,_0x2a5371){_0x405175=_0x405175-0x0;var _0x34788b=_0xd943[_0x405175];return _0x34788b;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x34c9c3,_0x51cf1f){return _0x34c9c3['define']('ZohoField',attributes,{'tableName':_0x3d94('0x9'),'paranoid':![],'indexes':[{'name':_0x3d94('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 2cd41eb..e048c08 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 _0x8abd=['ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x243545,_0x47cc32){var _0x5b8124=function(_0xe369fd){while(--_0xe369fd){_0x243545['push'](_0x243545['shift']());}};_0x5b8124(++_0x47cc32);}(_0x8abd,0x96));var _0xd8ab=function(_0x119a01,_0x566f10){_0x119a01=_0x119a01-0x0;var _0x3bc659=_0x8abd[_0x119a01];return _0x3bc659;};'use strict';var _=require(_0xd8ab('0x0'));var util=require(_0xd8ab('0x1'));var moment=require('moment');var BPromise=require(_0xd8ab('0x2'));var rs=require(_0xd8ab('0x3'));var fs=require('fs');var Redis=require(_0xd8ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8ab('0x5'));var logger=require(_0xd8ab('0x6'))(_0xd8ab('0x7'));var config=require(_0xd8ab('0x8'));var jayson=require(_0xd8ab('0x9'));var client=jayson[_0xd8ab('0xa')][_0xd8ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fcaa8,_0x438f69,_0x48d452){return new BPromise(function(_0x2dea4c,_0x1a9b4e){return client[_0xd8ab('0xc')](_0x3fcaa8,_0x48d452)[_0xd8ab('0xd')](function(_0x3c9694){logger[_0xd8ab('0xe')](_0xd8ab('0xf'),_0x438f69,_0xd8ab('0x10'));logger[_0xd8ab('0x11')](_0xd8ab('0x12'),_0x438f69,'request\x20sent',JSON['stringify'](_0x3c9694));if(_0x3c9694[_0xd8ab('0x13')]){if(_0x3c9694[_0xd8ab('0x13')][_0xd8ab('0x14')]===0x1f4){logger[_0xd8ab('0x13')](_0xd8ab('0xf'),_0x438f69,_0x3c9694['error'][_0xd8ab('0x15')]);return _0x1a9b4e(_0x3c9694[_0xd8ab('0x13')]['message']);}logger[_0xd8ab('0x13')]('ZohoField,\x20%s,\x20%s',_0x438f69,_0x3c9694[_0xd8ab('0x13')][_0xd8ab('0x15')]);return _0x2dea4c(_0x3c9694[_0xd8ab('0x13')]['message']);}else{logger[_0xd8ab('0xe')]('ZohoField,\x20%s,\x20%s',_0x438f69,_0xd8ab('0x10'));_0x2dea4c(_0x3c9694[_0xd8ab('0x16')][_0xd8ab('0x15')]);}})[_0xd8ab('0x17')](function(_0x1d70a4){logger['error'](_0xd8ab('0xf'),_0x438f69,_0x1d70a4);_0x1a9b4e(_0x1d70a4);});});} \ No newline at end of file +var _0x36d2=['bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment'];(function(_0x3fc86e,_0x4e35f3){var _0x146022=function(_0x213264){while(--_0x213264){_0x3fc86e['push'](_0x3fc86e['shift']());}};_0x146022(++_0x4e35f3);}(_0x36d2,0x166));var _0x236d=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x36d2[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x236d('0x0'));var util=require(_0x236d('0x1'));var moment=require(_0x236d('0x2'));var BPromise=require(_0x236d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x236d('0x4'))['db'];var utils=require(_0x236d('0x5'));var logger=require('../../config/logger')(_0x236d('0x6'));var config=require('../../config/environment');var jayson=require(_0x236d('0x7'));var client=jayson['client'][_0x236d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x356619,_0x1be7dc,_0x2defd5){return new BPromise(function(_0x3053f0,_0xbef74f){return client['request'](_0x356619,_0x2defd5)[_0x236d('0x9')](function(_0x166d3d){logger[_0x236d('0xa')](_0x236d('0xb'),_0x1be7dc,'request\x20sent');logger[_0x236d('0xc')](_0x236d('0xd'),_0x1be7dc,_0x236d('0xe'),JSON['stringify'](_0x166d3d));if(_0x166d3d[_0x236d('0xf')]){if(_0x166d3d[_0x236d('0xf')][_0x236d('0x10')]===0x1f4){logger[_0x236d('0xf')](_0x236d('0xb'),_0x1be7dc,_0x166d3d[_0x236d('0xf')][_0x236d('0x11')]);return _0xbef74f(_0x166d3d[_0x236d('0xf')]['message']);}logger[_0x236d('0xf')](_0x236d('0xb'),_0x1be7dc,_0x166d3d[_0x236d('0xf')][_0x236d('0x11')]);return _0x3053f0(_0x166d3d['error'][_0x236d('0x11')]);}else{logger[_0x236d('0xa')](_0x236d('0xb'),_0x1be7dc,_0x236d('0xe'));_0x3053f0(_0x166d3d['result']['message']);}})[_0x236d('0x12')](function(_0x52a08d){logger[_0x236d('0xf')](_0x236d('0xb'),_0x1be7dc,_0x52a08d);_0xbef74f(_0x52a08d);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index ed9bec6..03fdbed 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x37fc93,_0x27d9e6){var _0x3fbeed=function(_0x221ea7){while(--_0x221ea7){_0x37fc93['push'](_0x37fc93['shift']());}};_0x3fbeed(++_0x27d9e6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3e0b78,_0x1618fd){var _0x12832f=function(_0x4ba578){while(--_0x4ba578){_0x3e0b78['push'](_0x3e0b78['shift']());}};_0x12832f(++_0x1618fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 f375520..00ebdd4 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 _0x059a=['unique_name_and_version','STRING','INTEGER','exports'];(function(_0x2f224d,_0x38f8ec){var _0x38364c=function(_0x4e57d4){while(--_0x4e57d4){_0x2f224d['push'](_0x2f224d['shift']());}};_0x38364c(++_0x38f8ec);}(_0x059a,0x18b));var _0xa059=function(_0x4b7f28,_0x27d23a){_0x4b7f28=_0x4b7f28-0x0;var _0xf5b553=_0x059a[_0x4b7f28];return _0xf5b553;};'use strict';var Sequelize=require('sequelize');module[_0xa059('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa059('0x1')},'main':{'type':Sequelize[_0xa059('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xa059('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xa059('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xa059('0x2')]},'logo':{'type':Sequelize[_0xa059('0x2')]},'state':{'type':Sequelize[_0xa059('0x2')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa059('0x2')]},'link':{'type':Sequelize[_0xa059('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xc283=['sequelize','exports','STRING','unique_name_and_version','app.js','BOOLEAN','state'];(function(_0x25aff4,_0x21b5b7){var _0x2072e8=function(_0x308fa6){while(--_0x308fa6){_0x25aff4['push'](_0x25aff4['shift']());}};_0x2072e8(++_0x21b5b7);}(_0xc283,0x103));var _0x3c28=function(_0x29e25b,_0x321be0){_0x29e25b=_0x29e25b-0x0;var _0x2490cc=_0xc283[_0x29e25b];return _0x2490cc;};'use strict';var Sequelize=require(_0x3c28('0x0'));module[_0x3c28('0x1')]={'name':{'type':Sequelize[_0x3c28('0x2')],'allowNull':![],'unique':_0x3c28('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3c28('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x3c28('0x4')},'filename':{'type':Sequelize[_0x3c28('0x2')]},'path':{'type':Sequelize[_0x3c28('0x2')]},'type':{'type':Sequelize[_0x3c28('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3c28('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x3c28('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x3c28('0x6')},'description':{'type':Sequelize[_0x3c28('0x2')]},'title':{'type':Sequelize[_0x3c28('0x2')]},'remoteUri':{'type':Sequelize[_0x3c28('0x2')]},'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 59c4f7c..08c4fa3 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 _0x5d58=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','Integration','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','create','update','find','catch','destroy','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x32dc61,_0x263571){var _0x48ddc6=function(_0x381735){while(--_0x381735){_0x32dc61['push'](_0x32dc61['shift']());}};_0x48ddc6(++_0x263571);}(_0x5d58,0x187));var _0x85d5=function(_0x1f6236,_0x5daa8c){_0x1f6236=_0x1f6236-0x0;var _0x56060b=_0x5d58[_0x1f6236];return _0x56060b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['Integration']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['Integration'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')](_0x13ab32['body'],{})[_0x85d5('0x1c')](respondWithResult(_0x12a03,0xc9))['catch'](handleError(_0x12a03,null));};exports[_0x85d5('0x40')]=function(_0xd8db57,_0x219154){if(_0xd8db57['body']['id']){delete _0xd8db57['body']['id'];}return db['Integration'][_0x85d5('0x41')]({'where':{'id':_0xd8db57[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x219154,null))['then'](saveUpdates(_0xd8db57['body'],null))[_0x85d5('0x1c')](respondWithResult(_0x219154,null))[_0x85d5('0x42')](handleError(_0x219154,null));};exports[_0x85d5('0x43')]=function(_0x288b56,_0x4b2dce){return db[_0x85d5('0x34')][_0x85d5('0x41')]({'where':{'id':_0x288b56[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x4b2dce,null))[_0x85d5('0x1c')](removeEntity(_0x4b2dce,null))[_0x85d5('0x42')](handleError(_0x4b2dce,null));}; \ No newline at end of file +var _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x66fa,0x117));var _0xa66f=function(_0x5316eb,_0x1bb98e){_0x5316eb=_0x5316eb-0x0;var _0x7d3830=_0x66fa[_0x5316eb];return _0x7d3830;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['Integration'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['Integration'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['Integration'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['Integration'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d3ba1e0..632877a 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 _0x6f54=['./integration.attributes','define','integrations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xa56e55,_0x4e81db){var _0x4c1453=function(_0x395022){while(--_0x395022){_0xa56e55['push'](_0xa56e55['shift']());}};_0x4c1453(++_0x4e81db);}(_0x6f54,0x7c));var _0x46f5=function(_0x17f451,_0x3329bd){_0x17f451=_0x17f451-0x0;var _0x583b53=_0x6f54[_0x17f451];return _0x583b53;};'use strict';var _=require(_0x46f5('0x0'));var util=require(_0x46f5('0x1'));var logger=require(_0x46f5('0x2'))(_0x46f5('0x3'));var moment=require(_0x46f5('0x4'));var BPromise=require('bluebird');var rp=require(_0x46f5('0x5'));var fs=require('fs');var path=require(_0x46f5('0x6'));var rimraf=require(_0x46f5('0x7'));var config=require('../../config/environment');var attributes=require(_0x46f5('0x8'));module['exports']=function(_0x3faace,_0x2eaa34){return _0x3faace[_0x46f5('0x9')]('Integration',attributes,{'tableName':_0x46f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69dc=['rimraf','../../config/environment','define','Integration','integrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x6fc33,_0x444c9f){var _0x50145e=function(_0x3cdc6b){while(--_0x3cdc6b){_0x6fc33['push'](_0x6fc33['shift']());}};_0x50145e(++_0x444c9f);}(_0x69dc,0x1e5));var _0xc69d=function(_0x228eb5,_0x55a676){_0x228eb5=_0x228eb5-0x0;var _0x3073f5=_0x69dc[_0x228eb5];return _0x3073f5;};'use strict';var _=require(_0xc69d('0x0'));var util=require('util');var logger=require(_0xc69d('0x1'))(_0xc69d('0x2'));var moment=require(_0xc69d('0x3'));var BPromise=require(_0xc69d('0x4'));var rp=require(_0xc69d('0x5'));var fs=require('fs');var path=require(_0xc69d('0x6'));var rimraf=require(_0xc69d('0x7'));var config=require(_0xc69d('0x8'));var attributes=require('./integration.attributes');module['exports']=function(_0x3aac03,_0xb4ae4){return _0x3aac03[_0xc69d('0x9')](_0xc69d('0xa'),attributes,{'tableName':_0xc69d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 4cdd4a8..3582d90 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x27e978,_0x15c40b){_0x27e978=_0x27e978-0x0;var _0x1f9979=_0x7a54[_0x27e978];return _0x1f9979;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Integration,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1ace49,_0x577825){var _0x447b0f=function(_0x40e9b9){while(--_0x40e9b9){_0x1ace49['push'](_0x1ace49['shift']());}};_0x447b0f(++_0x577825);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3142d2,_0x8943fa){_0x3142d2=_0x3142d2-0x0;var _0x1c56f0=_0x5f2f[_0x3142d2];return _0x1c56f0;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d45143f..4e80919 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 _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0xd943,0x15d));var _0x3d94=function(_0x337f00,_0x9efca6){_0x337f00=_0x337f00-0x0;var _0x3116e2=_0xd943[_0x337f00];return _0x3116e2;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file +var _0x1967=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0x1967,0x173));var _0x7196=function(_0x49ea15,_0xa11542){_0x49ea15=_0x49ea15-0x0;var _0x8f2498=_0x1967[_0x49ea15];return _0x8f2498;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')]('/',auth[_0x7196('0xa')](),controller['create']);router['put'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x12')]);router[_0x7196('0x13')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x14')]);module[_0x7196('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index fa08185..f5e85d6 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 _0x1fef=['ENUM','SENT','SENDING','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x96e7c3,_0x5197aa){var _0x1bc389=function(_0x75d077){while(--_0x75d077){_0x96e7c3['push'](_0x96e7c3['shift']());}};_0x1bc389(++_0x5197aa);}(_0x1fef,0x71));var _0xf1fe=function(_0x528a70,_0x294a67){_0x528a70=_0x528a70-0x0;var _0x1e6ff9=_0x1fef[_0x528a70];return _0x1e6ff9;};'use strict';var Sequelize=require(_0xf1fe('0x0'));module[_0xf1fe('0x1')]={'integration':{'type':Sequelize[_0xf1fe('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xf1fe('0x2')]},'integrationId':{'type':Sequelize[_0xf1fe('0x3')]},'contacts':{'type':Sequelize[_0xf1fe('0x2')]},'uniqueid':{'type':Sequelize[_0xf1fe('0x2')]},'calleridnum':{'type':Sequelize[_0xf1fe('0x2')]},'calleridname':{'type':Sequelize[_0xf1fe('0x2')]},'queue':{'type':Sequelize[_0xf1fe('0x2')]},'interface':{'type':Sequelize[_0xf1fe('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xf1fe('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf1fe('0x4')]},'holdtime':{'type':Sequelize[_0xf1fe('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xf1fe('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf1fe('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xf1fe('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf1fe('0x4')]},'lastevent':{'type':Sequelize[_0xf1fe('0x2')]},'channel':{'type':Sequelize[_0xf1fe('0x2')]},'channelstate':{'type':Sequelize[_0xf1fe('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf1fe('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf1fe('0x2')]},'context':{'type':Sequelize[_0xf1fe('0x2')]},'exten':{'type':Sequelize[_0xf1fe('0x2')]},'priority':{'type':Sequelize[_0xf1fe('0x2')]},'destchannel':{'type':Sequelize[_0xf1fe('0x2')]},'destchannelstate':{'type':Sequelize[_0xf1fe('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf1fe('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf1fe('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf1fe('0x2')]},'destlanguage':{'type':Sequelize[_0xf1fe('0x2')]},'destaccountcode':{'type':Sequelize[_0xf1fe('0x2')]},'destcontext':{'type':Sequelize[_0xf1fe('0x2')]},'destexten':{'type':Sequelize[_0xf1fe('0x2')]},'destpriority':{'type':Sequelize[_0xf1fe('0x2')]},'destuniqueid':{'type':Sequelize[_0xf1fe('0x2')]},'messageId':{'type':Sequelize[_0xf1fe('0x2')]},'inReplyTo':{'type':Sequelize[_0xf1fe('0x2')]},'subject':{'type':Sequelize[_0xf1fe('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf1fe('0x2')]},'cc':{'type':Sequelize[_0xf1fe('0x2')]},'attachment':{'type':Sequelize[_0xf1fe('0x6')]},'html':{'type':Sequelize[_0xf1fe('0x6')]},'text':{'type':Sequelize[_0xf1fe('0x6')]},'status':{'type':Sequelize[_0xf1fe('0x7')](_0xf1fe('0x8'),_0xf1fe('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0xf1fe('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xf1fe('0x2')]},'projectId':{'type':Sequelize[_0xf1fe('0x3')]}}; \ No newline at end of file +var _0x974a=['TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE'];(function(_0xd692d4,_0x52efa4){var _0x567410=function(_0x478d92){while(--_0x478d92){_0xd692d4['push'](_0xd692d4['shift']());}};_0x567410(++_0x52efa4);}(_0x974a,0x170));var _0xa974=function(_0x3197bf,_0xeaa54e){_0x3197bf=_0x3197bf-0x0;var _0x63df3=_0x974a[_0x3197bf];return _0x63df3;};'use strict';var Sequelize=require(_0xa974('0x0'));module[_0xa974('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xa974('0x2')]},'ticketId':{'type':Sequelize[_0xa974('0x2')]},'integrationId':{'type':Sequelize[_0xa974('0x3')]},'contacts':{'type':Sequelize[_0xa974('0x2')]},'uniqueid':{'type':Sequelize[_0xa974('0x2')]},'calleridnum':{'type':Sequelize[_0xa974('0x2')]},'calleridname':{'type':Sequelize[_0xa974('0x2')]},'queue':{'type':Sequelize[_0xa974('0x2')]},'interface':{'type':Sequelize[_0xa974('0x2')]},'membername':{'type':Sequelize[_0xa974('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xa974('0x3')]},'agentcomplete':{'type':Sequelize[_0xa974('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa974('0x5')]},'talktime':{'type':Sequelize[_0xa974('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa974('0x3')]},'reason':{'type':Sequelize[_0xa974('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xa974('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa974('0x5')]},'agentdump':{'type':Sequelize[_0xa974('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xa974('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xa974('0x3')]},'channelstatedesc':{'type':Sequelize[_0xa974('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xa974('0x2')]},'language':{'type':Sequelize[_0xa974('0x2')]},'accountcode':{'type':Sequelize[_0xa974('0x2')]},'context':{'type':Sequelize[_0xa974('0x2')]},'exten':{'type':Sequelize[_0xa974('0x2')]},'priority':{'type':Sequelize[_0xa974('0x2')]},'destchannel':{'type':Sequelize[_0xa974('0x2')]},'destchannelstate':{'type':Sequelize[_0xa974('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xa974('0x2')]},'destcalleridname':{'type':Sequelize[_0xa974('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa974('0x2')]},'destlanguage':{'type':Sequelize[_0xa974('0x2')]},'destaccountcode':{'type':Sequelize[_0xa974('0x2')]},'destcontext':{'type':Sequelize[_0xa974('0x2')]},'destexten':{'type':Sequelize[_0xa974('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xa974('0x2')]},'messageId':{'type':Sequelize[_0xa974('0x2')]},'inReplyTo':{'type':Sequelize[_0xa974('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xa974('0x2')]},'to':{'type':Sequelize[_0xa974('0x2')]},'cc':{'type':Sequelize[_0xa974('0x2')]},'attachment':{'type':Sequelize[_0xa974('0x6')]},'html':{'type':Sequelize[_0xa974('0x6')]},'text':{'type':Sequelize[_0xa974('0x6')]},'status':{'type':Sequelize[_0xa974('0x7')](_0xa974('0x8'),'SENDING',_0xa974('0x9'),_0xa974('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xa974('0x2')]},'appdata':{'type':Sequelize[_0xa974('0x2')]},'projectId':{'type':Sequelize[_0xa974('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 135d5e1..88e1aec 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 _0x3425=['attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','name','send','IntegrationReport','fieldName','type','key','model','map','keys','query','filters','intersection','fields'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x3425,0xa2));var _0x5342=function(_0x4c7e28,_0x519637){_0x4c7e28=_0x4c7e28-0x0;var _0x3be262=_0x3425[_0x4c7e28];return _0x3be262;};'use strict';var emlformat=require(_0x5342('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5342('0x1'));var jsonpatch=require(_0x5342('0x2'));var rp=require('request-promise');var moment=require(_0x5342('0x3'));var BPromise=require(_0x5342('0x4'));var Mustache=require(_0x5342('0x5'));var util=require('util');var path=require(_0x5342('0x6'));var sox=require(_0x5342('0x7'));var csv=require(_0x5342('0x8'));var ejs=require(_0x5342('0x9'));var fs=require('fs');var fs_extra=require(_0x5342('0xa'));var _=require(_0x5342('0xb'));var squel=require(_0x5342('0xc'));var crypto=require(_0x5342('0xd'));var jsforce=require(_0x5342('0xe'));var deskjs=require(_0x5342('0xf'));var toCsv=require(_0x5342('0x8'));var querystring=require('querystring');var Papa=require(_0x5342('0x10'));var Redis=require(_0x5342('0x11'));var authService=require(_0x5342('0x12'));var qs=require(_0x5342('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5342('0x14'));var logger=require(_0x5342('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5342('0x16'));var licenseUtil=require(_0x5342('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x108b7c,_0xd085a9){_0xd085a9=_0xd085a9||0xcc;return function(_0x51cb78){if(_0x51cb78){return _0x108b7c[_0x5342('0x18')](_0xd085a9);}return _0x108b7c['status'](_0xd085a9)[_0x5342('0x19')]();};}function respondWithResult(_0x549ea5,_0x38976d){_0x38976d=_0x38976d||0xc8;return function(_0x80af9f){if(_0x80af9f){return _0x549ea5[_0x5342('0x1a')](_0x38976d)['json'](_0x80af9f);}};}function respondWithFilteredResult(_0x3b0862,_0x512538){return function(_0x1cf357){if(_0x1cf357){var _0x3c1ecc=typeof _0x512538[_0x5342('0x1b')]===_0x5342('0x1c')&&typeof _0x512538['limit']===_0x5342('0x1c');var _0x3b1f33=_0x1cf357['count'];var _0x356733=_0x3c1ecc?0x0:_0x512538[_0x5342('0x1b')];var _0x122bbd=_0x3c1ecc?_0x1cf357[_0x5342('0x1d')]:_0x512538[_0x5342('0x1b')]+_0x512538[_0x5342('0x1e')];var _0x38b182;if(_0x122bbd>=_0x3b1f33){_0x122bbd=_0x3b1f33;_0x38b182=0xc8;}else{_0x38b182=0xce;}_0x3b0862['status'](_0x38b182);return _0x3b0862[_0x5342('0x1f')](_0x5342('0x20'),_0x356733+'-'+_0x122bbd+'/'+_0x3b1f33)['json'](_0x1cf357);}return null;};}function patchUpdates(_0x27d247){return function(_0x3eda83){try{jsonpatch[_0x5342('0x21')](_0x3eda83,_0x27d247,!![]);}catch(_0x35a34f){return BPromise['reject'](_0x35a34f);}return _0x3eda83['save']();};}function saveUpdates(_0x5c1d27,_0x16b780){return function(_0x1cfb67){if(_0x1cfb67){return _0x1cfb67[_0x5342('0x22')](_0x5c1d27)[_0x5342('0x23')](function(_0x17315b){return _0x17315b;});}return null;};}function removeEntity(_0x4e1595,_0x524bf0){return function(_0x299293){if(_0x299293){return _0x299293[_0x5342('0x24')]()[_0x5342('0x23')](function(){_0x4e1595[_0x5342('0x1a')](0xcc)[_0x5342('0x19')]();});}};}function handleEntityNotFound(_0x5b5db8,_0x3b3da8){return function(_0xd00926){if(!_0xd00926){_0x5b5db8[_0x5342('0x18')](0x194);}return _0xd00926;};}function handleError(_0x1c8042,_0x1bb9ed){_0x1bb9ed=_0x1bb9ed||0x1f4;return function(_0x4019a6){logger[_0x5342('0x25')](_0x4019a6['stack']);if(_0x4019a6[_0x5342('0x26')]){delete _0x4019a6[_0x5342('0x26')];}_0x1c8042[_0x5342('0x1a')](_0x1bb9ed)[_0x5342('0x27')](_0x4019a6);};}exports['index']=function(_0x18c4ec,_0xb3ddb9){var _0x19c560={},_0x56e411={},_0x34736d={'count':0x0,'rows':[]};var _0xfac95=_['map'](db[_0x5342('0x28')]['rawAttributes'],function(_0x36bec7){return{'name':_0x36bec7[_0x5342('0x29')],'type':_0x36bec7[_0x5342('0x2a')][_0x5342('0x2b')]};});_0x56e411[_0x5342('0x2c')]=_[_0x5342('0x2d')](_0xfac95,_0x5342('0x26'));_0x56e411['query']=_[_0x5342('0x2e')](_0x18c4ec[_0x5342('0x2f')]);_0x56e411[_0x5342('0x30')]=_[_0x5342('0x31')](_0x56e411[_0x5342('0x2c')],_0x56e411[_0x5342('0x2f')]);_0x19c560['attributes']=_[_0x5342('0x31')](_0x56e411['model'],qs[_0x5342('0x32')](_0x18c4ec[_0x5342('0x2f')][_0x5342('0x32')]));_0x19c560[_0x5342('0x33')]=_0x19c560[_0x5342('0x33')][_0x5342('0x34')]?_0x19c560['attributes']:_0x56e411[_0x5342('0x2c')];if(!_0x18c4ec[_0x5342('0x2f')][_0x5342('0x35')]('nolimit')){_0x19c560['limit']=qs['limit'](_0x18c4ec[_0x5342('0x2f')][_0x5342('0x1e')]);_0x19c560[_0x5342('0x1b')]=qs[_0x5342('0x1b')](_0x18c4ec[_0x5342('0x2f')][_0x5342('0x1b')]);}_0x19c560[_0x5342('0x36')]=qs[_0x5342('0x37')](_0x18c4ec['query'][_0x5342('0x37')]);_0x19c560[_0x5342('0x38')]=qs[_0x5342('0x30')](_[_0x5342('0x39')](_0x18c4ec[_0x5342('0x2f')],_0x56e411[_0x5342('0x30')]),_0xfac95);if(_0x18c4ec[_0x5342('0x2f')][_0x5342('0x3a')]){_0x19c560[_0x5342('0x38')]=_[_0x5342('0x3b')](_0x19c560[_0x5342('0x38')],{'$or':_[_0x5342('0x2d')](_0xfac95,function(_0x256b83){if(_0x256b83['type']!=='VIRTUAL'){var _0x597dc7={};_0x597dc7[_0x256b83['name']]={'$like':'%'+_0x18c4ec['query'][_0x5342('0x3a')]+'%'};return _0x597dc7;}})});}_0x19c560=_[_0x5342('0x3b')]({},_0x19c560,_0x18c4ec[_0x5342('0x3c')]);var _0x1c9d4b={'where':_0x19c560[_0x5342('0x38')]};return db[_0x5342('0x28')][_0x5342('0x1d')](_0x1c9d4b)[_0x5342('0x23')](function(_0x45e483){_0x34736d[_0x5342('0x1d')]=_0x45e483;if(_0x18c4ec[_0x5342('0x2f')][_0x5342('0x3d')]){_0x19c560[_0x5342('0x3e')]=[{'all':!![]}];}return db[_0x5342('0x28')][_0x5342('0x3f')](_0x19c560);})[_0x5342('0x23')](function(_0xf33f58){_0x34736d['rows']=_0xf33f58;return _0x34736d;})[_0x5342('0x23')](respondWithFilteredResult(_0xb3ddb9,_0x19c560))['catch'](handleError(_0xb3ddb9,null));};exports[_0x5342('0x40')]=function(_0xd9a119,_0xbbeb7f){var _0x4ebd74={'raw':![],'where':{'id':_0xd9a119['params']['id']}},_0x52768e={};_0x52768e[_0x5342('0x2c')]=_[_0x5342('0x2e')](db[_0x5342('0x28')][_0x5342('0x41')]);_0x52768e[_0x5342('0x2f')]=_[_0x5342('0x2e')](_0xd9a119[_0x5342('0x2f')]);_0x52768e['filters']=_['intersection'](_0x52768e[_0x5342('0x2c')],_0x52768e['query']);_0x4ebd74['attributes']=_[_0x5342('0x31')](_0x52768e['model'],qs[_0x5342('0x32')](_0xd9a119[_0x5342('0x2f')][_0x5342('0x32')]));_0x4ebd74[_0x5342('0x33')]=_0x4ebd74['attributes']['length']?_0x4ebd74[_0x5342('0x33')]:_0x52768e['model'];if(_0xd9a119[_0x5342('0x2f')][_0x5342('0x3d')]){_0x4ebd74[_0x5342('0x3e')]=[{'all':!![]}];}_0x4ebd74=_[_0x5342('0x3b')]({},_0x4ebd74,_0xd9a119[_0x5342('0x3c')]);return db['IntegrationReport'][_0x5342('0x42')](_0x4ebd74)[_0x5342('0x23')](handleEntityNotFound(_0xbbeb7f,null))[_0x5342('0x23')](respondWithResult(_0xbbeb7f,null))[_0x5342('0x43')](handleError(_0xbbeb7f,null));};exports[_0x5342('0x44')]=function(_0x425cd2,_0x448b25){return db[_0x5342('0x28')][_0x5342('0x44')](_0x425cd2[_0x5342('0x45')],{})[_0x5342('0x23')](respondWithResult(_0x448b25,0xc9))[_0x5342('0x43')](handleError(_0x448b25,null));};exports['update']=function(_0x40f298,_0xc61bc6){if(_0x40f298[_0x5342('0x45')]['id']){delete _0x40f298[_0x5342('0x45')]['id'];}return db[_0x5342('0x28')][_0x5342('0x42')]({'where':{'id':_0x40f298['params']['id']}})[_0x5342('0x23')](handleEntityNotFound(_0xc61bc6,null))[_0x5342('0x23')](saveUpdates(_0x40f298[_0x5342('0x45')],null))[_0x5342('0x23')](respondWithResult(_0xc61bc6,null))[_0x5342('0x43')](handleError(_0xc61bc6,null));};exports[_0x5342('0x24')]=function(_0x1d9b5f,_0x208726){return db['IntegrationReport'][_0x5342('0x42')]({'where':{'id':_0x1d9b5f['params']['id']}})[_0x5342('0x23')](handleEntityNotFound(_0x208726,null))['then'](removeEntity(_0x208726,null))[_0x5342('0x43')](handleError(_0x208726,null));};exports[_0x5342('0x46')]=function(_0x43e064,_0x38bbb5){return db[_0x5342('0x28')][_0x5342('0x46')]()[_0x5342('0x23')](respondWithResult(_0x38bbb5,null))[_0x5342('0x43')](handleError(_0x38bbb5,null));}; \ No newline at end of file +var _0xd663=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','IntegrationReport','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','then','show','params','rawAttributes','include','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3db470,_0x1e5d89){var _0x30e18d=function(_0x1e1f78){while(--_0x1e1f78){_0x3db470['push'](_0x3db470['shift']());}};_0x30e18d(++_0x1e5d89);}(_0xd663,0xd8));var _0x3d66=function(_0x162ee7,_0x3ef892){_0x162ee7=_0x162ee7-0x0;var _0x3bd8fc=_0xd663[_0x162ee7];return _0x3bd8fc;};'use strict';var emlformat=require(_0x3d66('0x0'));var rimraf=require(_0x3d66('0x1'));var zipdir=require(_0x3d66('0x2'));var jsonpatch=require(_0x3d66('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d66('0x4'));var Mustache=require(_0x3d66('0x5'));var util=require(_0x3d66('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3d66('0x7'));var ejs=require(_0x3d66('0x8'));var fs=require('fs');var fs_extra=require(_0x3d66('0x9'));var _=require('lodash');var squel=require(_0x3d66('0xa'));var crypto=require(_0x3d66('0xb'));var jsforce=require(_0x3d66('0xc'));var deskjs=require(_0x3d66('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3d66('0xe'));var Papa=require(_0x3d66('0xf'));var Redis=require(_0x3d66('0x10'));var authService=require(_0x3d66('0x11'));var qs=require(_0x3d66('0x12'));var as=require(_0x3d66('0x13'));var hardwareService=require(_0x3d66('0x14'));var logger=require(_0x3d66('0x15'))('api');var utils=require(_0x3d66('0x16'));var config=require(_0x3d66('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d66('0x18'))['db'];function respondWithStatusCode(_0x1dc5a0,_0x151aab){_0x151aab=_0x151aab||0xcc;return function(_0x49eaad){if(_0x49eaad){return _0x1dc5a0[_0x3d66('0x19')](_0x151aab);}return _0x1dc5a0[_0x3d66('0x1a')](_0x151aab)[_0x3d66('0x1b')]();};}function respondWithResult(_0x39122b,_0x14c595){_0x14c595=_0x14c595||0xc8;return function(_0x4a8508){if(_0x4a8508){return _0x39122b[_0x3d66('0x1a')](_0x14c595)[_0x3d66('0x1c')](_0x4a8508);}};}function respondWithFilteredResult(_0x3f8368,_0x2a0a3d){return function(_0x12d0b8){if(_0x12d0b8){var _0x8be14e=typeof _0x2a0a3d[_0x3d66('0x1d')]==='undefined'&&typeof _0x2a0a3d[_0x3d66('0x1e')]===_0x3d66('0x1f');var _0x330332=_0x12d0b8[_0x3d66('0x20')];var _0x50f987=_0x8be14e?0x0:_0x2a0a3d[_0x3d66('0x1d')];var _0x19eba5=_0x8be14e?_0x12d0b8[_0x3d66('0x20')]:_0x2a0a3d[_0x3d66('0x1d')]+_0x2a0a3d['limit'];var _0x3cdd36;if(_0x19eba5>=_0x330332){_0x19eba5=_0x330332;_0x3cdd36=0xc8;}else{_0x3cdd36=0xce;}_0x3f8368[_0x3d66('0x1a')](_0x3cdd36);return _0x3f8368[_0x3d66('0x21')](_0x3d66('0x22'),_0x50f987+'-'+_0x19eba5+'/'+_0x330332)[_0x3d66('0x1c')](_0x12d0b8);}return null;};}function patchUpdates(_0x577098){return function(_0xb94e83){try{jsonpatch[_0x3d66('0x23')](_0xb94e83,_0x577098,!![]);}catch(_0xef0ba9){return BPromise[_0x3d66('0x24')](_0xef0ba9);}return _0xb94e83[_0x3d66('0x25')]();};}function saveUpdates(_0x4012e5,_0x4787ec){return function(_0x1df038){if(_0x1df038){return _0x1df038[_0x3d66('0x26')](_0x4012e5)['then'](function(_0x2b7da6){return _0x2b7da6;});}return null;};}function removeEntity(_0x2bd5c0,_0x49bf53){return function(_0x51fe00){if(_0x51fe00){return _0x51fe00[_0x3d66('0x27')]()['then'](function(){_0x2bd5c0[_0x3d66('0x1a')](0xcc)[_0x3d66('0x1b')]();});}};}function handleEntityNotFound(_0x53e269,_0x508626){return function(_0xf80887){if(!_0xf80887){_0x53e269['sendStatus'](0x194);}return _0xf80887;};}function handleError(_0x304047,_0x53f7a1){_0x53f7a1=_0x53f7a1||0x1f4;return function(_0x34c4c6){logger['error'](_0x34c4c6[_0x3d66('0x28')]);if(_0x34c4c6[_0x3d66('0x29')]){delete _0x34c4c6['name'];}_0x304047[_0x3d66('0x1a')](_0x53f7a1)[_0x3d66('0x2a')](_0x34c4c6);};}exports[_0x3d66('0x2b')]=function(_0x1a9725,_0x20c616){var _0x22cf7e={},_0x47a73d={},_0x2c5663={'count':0x0,'rows':[]};var _0x224fc9=_[_0x3d66('0x2c')](db[_0x3d66('0x2d')]['rawAttributes'],function(_0x215580){return{'name':_0x215580[_0x3d66('0x2e')],'type':_0x215580[_0x3d66('0x2f')][_0x3d66('0x30')]};});_0x47a73d['model']=_['map'](_0x224fc9,_0x3d66('0x29'));_0x47a73d['query']=_[_0x3d66('0x31')](_0x1a9725['query']);_0x47a73d[_0x3d66('0x32')]=_[_0x3d66('0x33')](_0x47a73d[_0x3d66('0x34')],_0x47a73d[_0x3d66('0x35')]);_0x22cf7e['attributes']=_[_0x3d66('0x33')](_0x47a73d['model'],qs[_0x3d66('0x36')](_0x1a9725['query'][_0x3d66('0x36')]));_0x22cf7e[_0x3d66('0x37')]=_0x22cf7e[_0x3d66('0x37')][_0x3d66('0x38')]?_0x22cf7e[_0x3d66('0x37')]:_0x47a73d[_0x3d66('0x34')];if(!_0x1a9725[_0x3d66('0x35')][_0x3d66('0x39')](_0x3d66('0x3a'))){_0x22cf7e[_0x3d66('0x1e')]=qs[_0x3d66('0x1e')](_0x1a9725[_0x3d66('0x35')][_0x3d66('0x1e')]);_0x22cf7e[_0x3d66('0x1d')]=qs[_0x3d66('0x1d')](_0x1a9725[_0x3d66('0x35')][_0x3d66('0x1d')]);}_0x22cf7e[_0x3d66('0x3b')]=qs[_0x3d66('0x3c')](_0x1a9725['query']['sort']);_0x22cf7e[_0x3d66('0x3d')]=qs[_0x3d66('0x32')](_[_0x3d66('0x3e')](_0x1a9725['query'],_0x47a73d[_0x3d66('0x32')]),_0x224fc9);if(_0x1a9725[_0x3d66('0x35')]['filter']){_0x22cf7e['where']=_[_0x3d66('0x3f')](_0x22cf7e[_0x3d66('0x3d')],{'$or':_[_0x3d66('0x2c')](_0x224fc9,function(_0x1e8d3e){if(_0x1e8d3e[_0x3d66('0x2f')]!==_0x3d66('0x40')){var _0x1f311c={};_0x1f311c[_0x1e8d3e[_0x3d66('0x29')]]={'$like':'%'+_0x1a9725[_0x3d66('0x35')]['filter']+'%'};return _0x1f311c;}})});}_0x22cf7e=_['merge']({},_0x22cf7e,_0x1a9725['options']);var _0x4f610a={'where':_0x22cf7e[_0x3d66('0x3d')]};return db[_0x3d66('0x2d')][_0x3d66('0x20')](_0x4f610a)['then'](function(_0x55ee6c){_0x2c5663[_0x3d66('0x20')]=_0x55ee6c;if(_0x1a9725['query'][_0x3d66('0x41')]){_0x22cf7e['include']=[{'all':!![]}];}return db[_0x3d66('0x2d')][_0x3d66('0x42')](_0x22cf7e);})['then'](function(_0x5064ba){_0x2c5663[_0x3d66('0x43')]=_0x5064ba;return _0x2c5663;})[_0x3d66('0x44')](respondWithFilteredResult(_0x20c616,_0x22cf7e))['catch'](handleError(_0x20c616,null));};exports[_0x3d66('0x45')]=function(_0xc38671,_0x187f2b){var _0x2977cc={'raw':![],'where':{'id':_0xc38671[_0x3d66('0x46')]['id']}},_0x2964b9={};_0x2964b9[_0x3d66('0x34')]=_[_0x3d66('0x31')](db[_0x3d66('0x2d')][_0x3d66('0x47')]);_0x2964b9['query']=_['keys'](_0xc38671[_0x3d66('0x35')]);_0x2964b9[_0x3d66('0x32')]=_[_0x3d66('0x33')](_0x2964b9['model'],_0x2964b9[_0x3d66('0x35')]);_0x2977cc[_0x3d66('0x37')]=_[_0x3d66('0x33')](_0x2964b9[_0x3d66('0x34')],qs[_0x3d66('0x36')](_0xc38671[_0x3d66('0x35')][_0x3d66('0x36')]));_0x2977cc[_0x3d66('0x37')]=_0x2977cc[_0x3d66('0x37')][_0x3d66('0x38')]?_0x2977cc[_0x3d66('0x37')]:_0x2964b9[_0x3d66('0x34')];if(_0xc38671[_0x3d66('0x35')][_0x3d66('0x41')]){_0x2977cc[_0x3d66('0x48')]=[{'all':!![]}];}_0x2977cc=_[_0x3d66('0x3f')]({},_0x2977cc,_0xc38671[_0x3d66('0x49')]);return db['IntegrationReport'][_0x3d66('0x4a')](_0x2977cc)['then'](handleEntityNotFound(_0x187f2b,null))[_0x3d66('0x44')](respondWithResult(_0x187f2b,null))[_0x3d66('0x4b')](handleError(_0x187f2b,null));};exports[_0x3d66('0x4c')]=function(_0xfe8879,_0x40e846){return db[_0x3d66('0x2d')][_0x3d66('0x4c')](_0xfe8879[_0x3d66('0x4d')],{})['then'](respondWithResult(_0x40e846,0xc9))[_0x3d66('0x4b')](handleError(_0x40e846,null));};exports[_0x3d66('0x26')]=function(_0x22e13c,_0x2bbf0f){if(_0x22e13c[_0x3d66('0x4d')]['id']){delete _0x22e13c[_0x3d66('0x4d')]['id'];}return db[_0x3d66('0x2d')][_0x3d66('0x4a')]({'where':{'id':_0x22e13c['params']['id']}})['then'](handleEntityNotFound(_0x2bbf0f,null))['then'](saveUpdates(_0x22e13c[_0x3d66('0x4d')],null))[_0x3d66('0x44')](respondWithResult(_0x2bbf0f,null))[_0x3d66('0x4b')](handleError(_0x2bbf0f,null));};exports['destroy']=function(_0x1192bd,_0x3b70ce){return db['IntegrationReport']['find']({'where':{'id':_0x1192bd[_0x3d66('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b70ce,null))[_0x3d66('0x44')](removeEntity(_0x3b70ce,null))[_0x3d66('0x4b')](handleError(_0x3b70ce,null));};exports['describe']=function(_0x493229,_0x241485){return db['IntegrationReport'][_0x3d66('0x4e')]()[_0x3d66('0x44')](respondWithResult(_0x241485,null))[_0x3d66('0x4b')](handleError(_0x241485,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 4ef5c16..e1b9825 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 _0xadee=['define','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports'];(function(_0x30ac42,_0x254605){var _0x36e8bd=function(_0x36b0e8){while(--_0x36b0e8){_0x30ac42['push'](_0x30ac42['shift']());}};_0x36e8bd(++_0x254605);}(_0xadee,0xec));var _0xeade=function(_0xae2c6e,_0x18837b){_0xae2c6e=_0xae2c6e-0x0;var _0x1eaa48=_0xadee[_0xae2c6e];return _0x1eaa48;};'use strict';var _=require(_0xeade('0x0'));var util=require(_0xeade('0x1'));var logger=require(_0xeade('0x2'))(_0xeade('0x3'));var moment=require(_0xeade('0x4'));var BPromise=require(_0xeade('0x5'));var rp=require(_0xeade('0x6'));var fs=require('fs');var path=require(_0xeade('0x7'));var rimraf=require('rimraf');var config=require(_0xeade('0x8'));var attributes=require(_0xeade('0x9'));module[_0xeade('0xa')]=function(_0x4fa51e,_0x20d6cc){return _0x4fa51e[_0xeade('0xb')]('IntegrationReport',attributes,{'tableName':_0xeade('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x674f=['../../config/logger','api','moment','bluebird','path','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util'];(function(_0x101dd2,_0x232c65){var _0x54b796=function(_0x445181){while(--_0x445181){_0x101dd2['push'](_0x101dd2['shift']());}};_0x54b796(++_0x232c65);}(_0x674f,0x11e));var _0xf674=function(_0x20b046,_0x6296e0){_0x20b046=_0x20b046-0x0;var _0x276a24=_0x674f[_0x20b046];return _0x276a24;};'use strict';var _=require(_0xf674('0x0'));var util=require(_0xf674('0x1'));var logger=require(_0xf674('0x2'))(_0xf674('0x3'));var moment=require(_0xf674('0x4'));var BPromise=require(_0xf674('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf674('0x6'));var rimraf=require('rimraf');var config=require(_0xf674('0x7'));var attributes=require(_0xf674('0x8'));module['exports']=function(_0x59a822,_0x488cb5){return _0x59a822[_0xf674('0x9')](_0xf674('0xa'),attributes,{'tableName':_0xf674('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 d16132f..ddd8138 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 _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4d6a4d,_0x3c9aaf){var _0x5d06cc=function(_0x1c5ec3){while(--_0x1c5ec3){_0x4d6a4d['push'](_0x4d6a4d['shift']());}};_0x5d06cc(++_0x3c9aaf);}(_0x31f0,0xb7));var _0x031f=function(_0x8618dd,_0x1d8cf3){_0x8618dd=_0x8618dd-0x0;var _0x4c0138=_0x31f0[_0x8618dd];return _0x4c0138;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4f582b,_0x3fea82){var _0x2cb899=function(_0x30aa77){while(--_0x30aa77){_0x4f582b['push'](_0x4f582b['shift']());}};_0x2cb899(++_0x3fea82);}(_0x1261,0x144));var _0x1126=function(_0x4944f1,_0x482a52){_0x4944f1=_0x4944f1-0x0;var _0x433494=_0x1261[_0x4944f1];return _0x433494;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 7180128..ec7d3d4 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 _0x2ba6=['/:id/sub_intervals','isAuthenticated','getIntervals','post','create','/:id/sub_intervals/create_many','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','show'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x2ba6,0x1ea));var _0x62ba=function(_0x225fb5,_0x130329){_0x225fb5=_0x225fb5-0x0;var _0x270251=_0x2ba6[_0x225fb5];return _0x270251;};'use strict';var multer=require(_0x62ba('0x0'));var util=require(_0x62ba('0x1'));var path=require(_0x62ba('0x2'));var timeout=require(_0x62ba('0x3'));var express=require(_0x62ba('0x4'));var router=express['Router']();var fs_extra=require(_0x62ba('0x5'));var auth=require(_0x62ba('0x6'));var interaction=require(_0x62ba('0x7'));var config=require(_0x62ba('0x8'));var controller=require(_0x62ba('0x9'));router[_0x62ba('0xa')]('/',auth['isAuthenticated'](),controller[_0x62ba('0xb')]);router[_0x62ba('0xa')](_0x62ba('0xc'),auth['isAuthenticated'](),controller[_0x62ba('0xd')]);router['get'](_0x62ba('0xe'),auth[_0x62ba('0xf')](),controller[_0x62ba('0x10')]);router[_0x62ba('0x11')]('/',auth[_0x62ba('0xf')](),controller[_0x62ba('0x12')]);router[_0x62ba('0x11')](_0x62ba('0xe'),auth[_0x62ba('0xf')](),controller['addInterval']);router[_0x62ba('0x11')](_0x62ba('0x13'),auth[_0x62ba('0xf')](),controller['addIntervals']);router['put'](_0x62ba('0xc'),auth[_0x62ba('0xf')](),controller[_0x62ba('0x14')]);router[_0x62ba('0x15')](_0x62ba('0xc'),auth[_0x62ba('0xf')](),controller[_0x62ba('0x16')]);module[_0x62ba('0x17')]=router; \ No newline at end of file +var _0xf70f=['/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','put','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index'];(function(_0x4c1739,_0x3218c4){var _0x5ed2c4=function(_0x4af195){while(--_0x4af195){_0x4c1739['push'](_0x4c1739['shift']());}};_0x5ed2c4(++_0x3218c4);}(_0xf70f,0x9c));var _0xff70=function(_0x3d407c,_0x8127b5){_0x3d407c=_0x3d407c-0x0;var _0x7d17dc=_0xf70f[_0x3d407c];return _0x7d17dc;};'use strict';var multer=require(_0xff70('0x0'));var util=require(_0xff70('0x1'));var path=require(_0xff70('0x2'));var timeout=require('connect-timeout');var express=require(_0xff70('0x3'));var router=express[_0xff70('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff70('0x5'));var interaction=require(_0xff70('0x6'));var config=require(_0xff70('0x7'));var controller=require(_0xff70('0x8'));router[_0xff70('0x9')]('/',auth[_0xff70('0xa')](),controller[_0xff70('0xb')]);router['get'](_0xff70('0xc'),auth[_0xff70('0xa')](),controller[_0xff70('0xd')]);router[_0xff70('0x9')](_0xff70('0xe'),auth['isAuthenticated'](),controller[_0xff70('0xf')]);router[_0xff70('0x10')]('/',auth['isAuthenticated'](),controller[_0xff70('0x11')]);router[_0xff70('0x10')](_0xff70('0xe'),auth[_0xff70('0xa')](),controller[_0xff70('0x12')]);router[_0xff70('0x10')](_0xff70('0x13'),auth[_0xff70('0xa')](),controller['addIntervals']);router[_0xff70('0x14')]('/:id',auth[_0xff70('0xa')](),controller['update']);router['delete'](_0xff70('0xc'),auth[_0xff70('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 95327be..526f4f5 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 _0xdf1f=['sequelize','exports','STRING'];(function(_0x3e7051,_0x12d760){var _0x849f36=function(_0x4d3b6c){while(--_0x4d3b6c){_0x3e7051['push'](_0x3e7051['shift']());}};_0x849f36(++_0x12d760);}(_0xdf1f,0xed));var _0xfdf1=function(_0x5451cd,_0x49e495){_0x5451cd=_0x5451cd-0x0;var _0x55060e=_0xdf1f[_0x5451cd];return _0x55060e;};'use strict';var Sequelize=require(_0xfdf1('0x0'));module[_0xfdf1('0x1')]={'name':{'type':Sequelize[_0xfdf1('0x2')]},'description':{'type':Sequelize[_0xfdf1('0x2')]},'interval':{'type':Sequelize[_0xfdf1('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x6676=['exports','STRING','sequelize'];(function(_0x3f12b4,_0x13ccd3){var _0x43389e=function(_0x294aff){while(--_0x294aff){_0x3f12b4['push'](_0x3f12b4['shift']());}};_0x43389e(++_0x13ccd3);}(_0x6676,0x1b2));var _0x6667=function(_0x1be58b,_0x21472a){_0x1be58b=_0x1be58b-0x0;var _0x58a986=_0x6676[_0x1be58b];return _0x58a986;};'use strict';var Sequelize=require(_0x6667('0x0'));module[_0x6667('0x1')]={'name':{'type':Sequelize[_0x6667('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6667('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 2e693ff..52a3024 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 _0xb1ec=['offset','set','Content-Range','apply','reject','update','then','UserProfileResource','destroy','error','stack','name','send','map','Interval','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Intervals','userProfileId','autoAssociation','catch','body','addInterval','IntervalId','getIntervals','findOne','sequelize','bulkCreate','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','limit','count'];(function(_0x4a37b6,_0x37e625){var _0x3887bf=function(_0x3515fc){while(--_0x3515fc){_0x4a37b6['push'](_0x4a37b6['shift']());}};_0x3887bf(++_0x37e625);}(_0xb1ec,0x148));var _0xcb1e=function(_0x5200f2,_0x5d6e79){_0x5200f2=_0x5200f2-0x0;var _0x375629=_0xb1ec[_0x5200f2];return _0x375629;};'use strict';var emlformat=require(_0xcb1e('0x0'));var rimraf=require(_0xcb1e('0x1'));var zipdir=require(_0xcb1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcb1e('0x3'));var BPromise=require(_0xcb1e('0x4'));var Mustache=require(_0xcb1e('0x5'));var util=require(_0xcb1e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcb1e('0x7'));var fs=require('fs');var fs_extra=require(_0xcb1e('0x8'));var _=require(_0xcb1e('0x9'));var squel=require(_0xcb1e('0xa'));var crypto=require(_0xcb1e('0xb'));var jsforce=require(_0xcb1e('0xc'));var deskjs=require(_0xcb1e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb1e('0xe'));var Papa=require(_0xcb1e('0xf'));var Redis=require(_0xcb1e('0x10'));var authService=require(_0xcb1e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcb1e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb1e('0x13'))('api');var utils=require(_0xcb1e('0x14'));var config=require(_0xcb1e('0x15'));var licenseUtil=require(_0xcb1e('0x16'));var db=require(_0xcb1e('0x17'))['db'];var extensions=require(_0xcb1e('0x18'));function respondWithStatusCode(_0x31fda6,_0x51db86){_0x51db86=_0x51db86||0xcc;return function(_0x32902a){if(_0x32902a){return _0x31fda6[_0xcb1e('0x19')](_0x51db86);}return _0x31fda6[_0xcb1e('0x1a')](_0x51db86)[_0xcb1e('0x1b')]();};}function respondWithResult(_0x152115,_0x229228){_0x229228=_0x229228||0xc8;return function(_0x5abad5){if(_0x5abad5){return _0x152115[_0xcb1e('0x1a')](_0x229228)[_0xcb1e('0x1c')](_0x5abad5);}};}function respondWithFilteredResult(_0x1dfd93,_0x49dc3e){return function(_0x14425b){if(_0x14425b){var _0xcee51a=typeof _0x49dc3e['offset']===_0xcb1e('0x1d')&&typeof _0x49dc3e[_0xcb1e('0x1e')]===_0xcb1e('0x1d');var _0x1d46e9=_0x14425b[_0xcb1e('0x1f')];var _0xde90a1=_0xcee51a?0x0:_0x49dc3e['offset'];var _0x1ff52f=_0xcee51a?_0x14425b[_0xcb1e('0x1f')]:_0x49dc3e[_0xcb1e('0x20')]+_0x49dc3e['limit'];var _0x32c08e;if(_0x1ff52f>=_0x1d46e9){_0x1ff52f=_0x1d46e9;_0x32c08e=0xc8;}else{_0x32c08e=0xce;}_0x1dfd93[_0xcb1e('0x1a')](_0x32c08e);return _0x1dfd93[_0xcb1e('0x21')](_0xcb1e('0x22'),_0xde90a1+'-'+_0x1ff52f+'/'+_0x1d46e9)[_0xcb1e('0x1c')](_0x14425b);}return null;};}function patchUpdates(_0x1ea007){return function(_0x1d1047){try{jsonpatch[_0xcb1e('0x23')](_0x1d1047,_0x1ea007,!![]);}catch(_0x14db84){return BPromise[_0xcb1e('0x24')](_0x14db84);}return _0x1d1047['save']();};}function saveUpdates(_0x195468,_0x60c80f){return function(_0x2c5829){if(_0x2c5829){return _0x2c5829[_0xcb1e('0x25')](_0x195468)[_0xcb1e('0x26')](function(_0xdb2769){return _0xdb2769;});}return null;};}function removeEntity(_0x575fdf,_0x2e5bbc){return function(_0x31c9a1){if(_0x31c9a1){return _0x31c9a1['destroy']()[_0xcb1e('0x26')](function(){var _0x4f9f5b=_0x31c9a1['get']({'plain':!![]});var _0x85f92b='Intervals';return db[_0xcb1e('0x27')][_0xcb1e('0x28')]({'where':{'type':_0x85f92b,'resourceId':_0x4f9f5b['id']}})[_0xcb1e('0x26')](function(){return _0x31c9a1;});})[_0xcb1e('0x26')](function(){_0x575fdf[_0xcb1e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10a96a,_0x45b232){return function(_0x57eb9c){if(!_0x57eb9c){_0x10a96a[_0xcb1e('0x19')](0x194);}return _0x57eb9c;};}function handleError(_0x4ab5c9,_0x4ca1a9){_0x4ca1a9=_0x4ca1a9||0x1f4;return function(_0x167417){logger[_0xcb1e('0x29')](_0x167417[_0xcb1e('0x2a')]);if(_0x167417[_0xcb1e('0x2b')]){delete _0x167417[_0xcb1e('0x2b')];}_0x4ab5c9[_0xcb1e('0x1a')](_0x4ca1a9)[_0xcb1e('0x2c')](_0x167417);};}exports['index']=function(_0x470fb9,_0x373ed3){var _0x4d7aa6={},_0x1eb7ee={},_0x3b62f7={'count':0x0,'rows':[]};var _0x12762d=_[_0xcb1e('0x2d')](db[_0xcb1e('0x2e')][_0xcb1e('0x2f')],function(_0x491b7c){return{'name':_0x491b7c['fieldName'],'type':_0x491b7c[_0xcb1e('0x30')][_0xcb1e('0x31')]};});_0x1eb7ee[_0xcb1e('0x32')]=_[_0xcb1e('0x2d')](_0x12762d,_0xcb1e('0x2b'));_0x1eb7ee[_0xcb1e('0x33')]=_['keys'](_0x470fb9[_0xcb1e('0x33')]);_0x1eb7ee[_0xcb1e('0x34')]=_[_0xcb1e('0x35')](_0x1eb7ee[_0xcb1e('0x32')],_0x1eb7ee[_0xcb1e('0x33')]);_0x4d7aa6[_0xcb1e('0x36')]=_[_0xcb1e('0x35')](_0x1eb7ee['model'],qs[_0xcb1e('0x37')](_0x470fb9[_0xcb1e('0x33')]['fields']));_0x4d7aa6['attributes']=_0x4d7aa6[_0xcb1e('0x36')][_0xcb1e('0x38')]?_0x4d7aa6[_0xcb1e('0x36')]:_0x1eb7ee['model'];if(!_0x470fb9['query'][_0xcb1e('0x39')](_0xcb1e('0x3a'))){_0x4d7aa6[_0xcb1e('0x1e')]=qs[_0xcb1e('0x1e')](_0x470fb9['query'][_0xcb1e('0x1e')]);_0x4d7aa6[_0xcb1e('0x20')]=qs[_0xcb1e('0x20')](_0x470fb9[_0xcb1e('0x33')]['offset']);}_0x4d7aa6[_0xcb1e('0x3b')]=qs[_0xcb1e('0x3c')](_0x470fb9['query'][_0xcb1e('0x3c')]);_0x4d7aa6['where']=qs['filters'](_[_0xcb1e('0x3d')](_0x470fb9[_0xcb1e('0x33')],_0x1eb7ee[_0xcb1e('0x34')]),_0x12762d);if(_0x470fb9[_0xcb1e('0x33')][_0xcb1e('0x3e')]){_0x4d7aa6[_0xcb1e('0x3f')]=_[_0xcb1e('0x40')](_0x4d7aa6['where'],{'$or':_[_0xcb1e('0x2d')](_0x12762d,function(_0x302413){if(_0x302413['type']!==_0xcb1e('0x41')){var _0x1481b8={};_0x1481b8[_0x302413[_0xcb1e('0x2b')]]={'$like':'%'+_0x470fb9[_0xcb1e('0x33')][_0xcb1e('0x3e')]+'%'};return _0x1481b8;}})});}_0x4d7aa6=_[_0xcb1e('0x40')]({},_0x4d7aa6,_0x470fb9[_0xcb1e('0x42')]);var _0x93f454={'where':_0x4d7aa6[_0xcb1e('0x3f')]};return db['Interval'][_0xcb1e('0x1f')](_0x93f454)[_0xcb1e('0x26')](function(_0x4c9966){_0x3b62f7[_0xcb1e('0x1f')]=_0x4c9966;if(_0x470fb9['query']['includeAll']){_0x4d7aa6[_0xcb1e('0x43')]=[{'all':!![]}];}return db[_0xcb1e('0x2e')][_0xcb1e('0x44')](_0x4d7aa6);})[_0xcb1e('0x26')](function(_0xf14bf0){_0x3b62f7[_0xcb1e('0x45')]=_0xf14bf0;return _0x3b62f7;})[_0xcb1e('0x26')](respondWithFilteredResult(_0x373ed3,_0x4d7aa6))['catch'](handleError(_0x373ed3,null));};exports[_0xcb1e('0x46')]=function(_0x139839,_0x4c7ec6){var _0x1d5b4f={'raw':!![],'where':{'id':_0x139839[_0xcb1e('0x47')]['id']}},_0x5a0ae4={};_0x5a0ae4['model']=_['keys'](db[_0xcb1e('0x2e')][_0xcb1e('0x2f')]);_0x5a0ae4['query']=_[_0xcb1e('0x48')](_0x139839[_0xcb1e('0x33')]);_0x5a0ae4[_0xcb1e('0x34')]=_[_0xcb1e('0x35')](_0x5a0ae4[_0xcb1e('0x32')],_0x5a0ae4[_0xcb1e('0x33')]);_0x1d5b4f['attributes']=_[_0xcb1e('0x35')](_0x5a0ae4['model'],qs[_0xcb1e('0x37')](_0x139839[_0xcb1e('0x33')][_0xcb1e('0x37')]));_0x1d5b4f[_0xcb1e('0x36')]=_0x1d5b4f[_0xcb1e('0x36')][_0xcb1e('0x38')]?_0x1d5b4f[_0xcb1e('0x36')]:_0x5a0ae4[_0xcb1e('0x32')];if(_0x139839['query']['includeAll']){_0x1d5b4f[_0xcb1e('0x43')]=[{'all':!![]}];}_0x1d5b4f=_[_0xcb1e('0x40')]({},_0x1d5b4f,_0x139839['options']);return db[_0xcb1e('0x2e')][_0xcb1e('0x49')](_0x1d5b4f)['then'](handleEntityNotFound(_0x4c7ec6,null))[_0xcb1e('0x26')](respondWithResult(_0x4c7ec6,null))['catch'](handleError(_0x4c7ec6,null));};exports['create']=function(_0x32d0ca,_0x8a13cf){return db['Interval'][_0xcb1e('0x4a')](_0x32d0ca['body'],{})['then'](function(_0x5d4894){var _0xc19dee=_0x32d0ca[_0xcb1e('0x4b')]['get']({'plain':!![]});if(!_0xc19dee)throw new Error(_0xcb1e('0x4c'));if(_0xc19dee[_0xcb1e('0x4d')]===_0xcb1e('0x4b')){var _0x412d2f=_0x5d4894[_0xcb1e('0x4e')]({'plain':!![]});var _0xc6247e=_0xcb1e('0x4f');return db['UserProfileSection'][_0xcb1e('0x49')]({'where':{'name':_0xc6247e,'userProfileId':_0xc19dee[_0xcb1e('0x50')]},'raw':!![]})[_0xcb1e('0x26')](function(_0x54e4b6){if(_0x54e4b6&&_0x54e4b6[_0xcb1e('0x51')]===0x0){return db[_0xcb1e('0x27')][_0xcb1e('0x4a')]({'name':_0x412d2f[_0xcb1e('0x2b')],'resourceId':_0x412d2f['id'],'type':_0x54e4b6[_0xcb1e('0x2b')],'sectionId':_0x54e4b6['id']},{})[_0xcb1e('0x26')](function(){return _0x5d4894;});}else{return _0x5d4894;}})['catch'](function(_0x5ad333){logger[_0xcb1e('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ad333);throw _0x5ad333;});}return _0x5d4894;})[_0xcb1e('0x26')](respondWithResult(_0x8a13cf,0xc9))[_0xcb1e('0x52')](handleError(_0x8a13cf,null));};exports[_0xcb1e('0x25')]=function(_0x18e578,_0x4f9bdf){if(_0x18e578[_0xcb1e('0x53')]['id']){delete _0x18e578[_0xcb1e('0x53')]['id'];}return db[_0xcb1e('0x2e')][_0xcb1e('0x49')]({'where':{'id':_0x18e578[_0xcb1e('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f9bdf,null))[_0xcb1e('0x26')](saveUpdates(_0x18e578['body'],null))[_0xcb1e('0x26')](respondWithResult(_0x4f9bdf,null))[_0xcb1e('0x52')](handleError(_0x4f9bdf,null));};exports['destroy']=function(_0x2545e0,_0x51b704){return db[_0xcb1e('0x2e')][_0xcb1e('0x49')]({'where':{'id':_0x2545e0[_0xcb1e('0x47')]['id']}})['then'](handleEntityNotFound(_0x51b704,null))[_0xcb1e('0x26')](removeEntity(_0x51b704,null))[_0xcb1e('0x52')](handleError(_0x51b704,null));};exports[_0xcb1e('0x54')]=function(_0x106d92,_0xee2c48,_0x1b13bd){if(_0x106d92[_0xcb1e('0x53')]['id']){delete _0x106d92['body']['id'];}return db['Interval'][_0xcb1e('0x49')]({'where':{'id':_0x106d92['params']['id']}})[_0xcb1e('0x26')](handleEntityNotFound(_0xee2c48,null))[_0xcb1e('0x26')](function(_0x26c25e){if(_0x26c25e){_0x106d92[_0xcb1e('0x53')][_0xcb1e('0x55')]=_0x26c25e['id'];return db[_0xcb1e('0x2e')][_0xcb1e('0x4a')](_0x106d92[_0xcb1e('0x53')]);}})[_0xcb1e('0x26')](respondWithResult(_0xee2c48,null))[_0xcb1e('0x52')](handleError(_0xee2c48,null));};exports[_0xcb1e('0x56')]=function(_0x19a609,_0x380642,_0x336d95){var _0x1ba481={};var _0x4831ae={};var _0x2ee221;var _0x1b7452;return db[_0xcb1e('0x2e')][_0xcb1e('0x57')]({'where':{'id':_0x19a609[_0xcb1e('0x47')]['id']}})['then'](handleEntityNotFound(_0x380642,null))[_0xcb1e('0x26')](function(_0x802b0e){if(_0x802b0e){_0x2ee221=_0x802b0e;_0x4831ae[_0xcb1e('0x32')]=_[_0xcb1e('0x48')](db[_0xcb1e('0x2e')][_0xcb1e('0x2f')]);_0x4831ae[_0xcb1e('0x33')]=_[_0xcb1e('0x48')](_0x19a609[_0xcb1e('0x33')]);_0x4831ae[_0xcb1e('0x34')]=_['intersection'](_0x4831ae['model'],_0x4831ae[_0xcb1e('0x33')]);_0x1ba481['attributes']=_['intersection'](_0x4831ae[_0xcb1e('0x32')],qs[_0xcb1e('0x37')](_0x19a609[_0xcb1e('0x33')]['fields']));_0x1ba481[_0xcb1e('0x36')]=_0x1ba481[_0xcb1e('0x36')][_0xcb1e('0x38')]?_0x1ba481[_0xcb1e('0x36')]:_0x4831ae['model'];_0x1ba481[_0xcb1e('0x3b')]=qs['sort'](_0x19a609[_0xcb1e('0x33')][_0xcb1e('0x3c')]);_0x1ba481['where']=qs[_0xcb1e('0x34')](_['pick'](_0x19a609[_0xcb1e('0x33')],_0x4831ae[_0xcb1e('0x34')]));if(_0x19a609[_0xcb1e('0x33')][_0xcb1e('0x3e')]){_0x1ba481[_0xcb1e('0x3f')]=_['merge'](_0x1ba481[_0xcb1e('0x3f')],{'$or':_[_0xcb1e('0x2d')](_0x1ba481['attributes'],function(_0x55aa24){var _0x4c90a7={};_0x4c90a7[_0x55aa24]={'$like':'%'+_0x19a609[_0xcb1e('0x33')][_0xcb1e('0x3e')]+'%'};return _0x4c90a7;})});}_0x1ba481=_[_0xcb1e('0x40')]({},_0x1ba481,_0x19a609[_0xcb1e('0x42')]);return _0x2ee221['getIntervals'](_0x1ba481);}})['then'](function(_0x4e9fbd){if(_0x4e9fbd){_0x1b7452=_0x4e9fbd[_0xcb1e('0x38')];if(!_0x19a609['query']['hasOwnProperty'](_0xcb1e('0x3a'))){_0x1ba481[_0xcb1e('0x1e')]=qs[_0xcb1e('0x1e')](_0x19a609[_0xcb1e('0x33')]['limit']);_0x1ba481[_0xcb1e('0x20')]=qs['offset'](_0x19a609[_0xcb1e('0x33')][_0xcb1e('0x20')]);}return _0x2ee221[_0xcb1e('0x56')](_0x1ba481);}})[_0xcb1e('0x26')](function(_0x18aba3){if(_0x18aba3){return _0x18aba3?{'count':_0x1b7452,'rows':_0x18aba3}:null;}})[_0xcb1e('0x26')](respondWithResult(_0x380642,null))['catch'](handleError(_0x380642,null));};exports['addIntervals']=function(_0x353086,_0x2b944e,_0x538b2b){return db['Interval']['findOne']({'where':{'id':_0x353086[_0xcb1e('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b944e,null))[_0xcb1e('0x26')](function(_0xcb049e){if(_0xcb049e){return db[_0xcb1e('0x58')]['transaction'](function(_0x437f72){return db[_0xcb1e('0x2e')]['destroy']({'where':{'IntervalId':_0x353086[_0xcb1e('0x47')]['id']},'transaction':_0x437f72})[_0xcb1e('0x26')](function(_0x2c8e46){var _0x3fd7ab=_[_0xcb1e('0x2d')](_0x353086[_0xcb1e('0x53')],function(_0xd2d402){delete _0xd2d402['id'];_0xd2d402[_0xcb1e('0x55')]=_0x353086[_0xcb1e('0x47')]['id'];return _0xd2d402;});return db['Interval'][_0xcb1e('0x59')](_0x3fd7ab,{'transaction':_0x437f72});});})['then'](function(){return db[_0xcb1e('0x2e')]['findAll']({'where':{'IntervalId':_0x353086[_0xcb1e('0x47')]['id']}});});}})[_0xcb1e('0x26')](respondWithResult(_0x2b944e,null))['catch'](handleError(_0x2b944e,null));}; \ No newline at end of file +var _0xfa47=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','error','name','send','index','map','Interval','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xf73871,_0x5eacfc){var _0x4440b5=function(_0x205197){while(--_0x205197){_0xf73871['push'](_0xf73871['shift']());}};_0x4440b5(++_0x5eacfc);}(_0xfa47,0xf6));var _0x7fa4=function(_0x33670a,_0x55e188){_0x33670a=_0x33670a-0x0;var _0x36ad1d=_0xfa47[_0x33670a];return _0x36ad1d;};'use strict';var emlformat=require(_0x7fa4('0x0'));var rimraf=require(_0x7fa4('0x1'));var zipdir=require(_0x7fa4('0x2'));var jsonpatch=require(_0x7fa4('0x3'));var rp=require(_0x7fa4('0x4'));var moment=require(_0x7fa4('0x5'));var BPromise=require(_0x7fa4('0x6'));var Mustache=require(_0x7fa4('0x7'));var util=require('util');var path=require(_0x7fa4('0x8'));var sox=require(_0x7fa4('0x9'));var csv=require(_0x7fa4('0xa'));var ejs=require(_0x7fa4('0xb'));var fs=require('fs');var fs_extra=require(_0x7fa4('0xc'));var _=require(_0x7fa4('0xd'));var squel=require(_0x7fa4('0xe'));var crypto=require(_0x7fa4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7fa4('0x10'));var toCsv=require(_0x7fa4('0xa'));var querystring=require(_0x7fa4('0x11'));var Papa=require('papaparse');var Redis=require(_0x7fa4('0x12'));var authService=require(_0x7fa4('0x13'));var qs=require(_0x7fa4('0x14'));var as=require(_0x7fa4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fa4('0x16'))(_0x7fa4('0x17'));var utils=require('../../config/utils');var config=require(_0x7fa4('0x18'));var licenseUtil=require(_0x7fa4('0x19'));var db=require(_0x7fa4('0x1a'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2c1c93,_0x37b410){_0x37b410=_0x37b410||0xcc;return function(_0x4a302c){if(_0x4a302c){return _0x2c1c93[_0x7fa4('0x1b')](_0x37b410);}return _0x2c1c93[_0x7fa4('0x1c')](_0x37b410)[_0x7fa4('0x1d')]();};}function respondWithResult(_0x481190,_0x224c02){_0x224c02=_0x224c02||0xc8;return function(_0x18eadf){if(_0x18eadf){return _0x481190[_0x7fa4('0x1c')](_0x224c02)[_0x7fa4('0x1e')](_0x18eadf);}};}function respondWithFilteredResult(_0x18bec5,_0x3d861c){return function(_0x40b203){if(_0x40b203){var _0x58d337=typeof _0x3d861c[_0x7fa4('0x1f')]===_0x7fa4('0x20')&&typeof _0x3d861c['limit']===_0x7fa4('0x20');var _0x4df9f4=_0x40b203[_0x7fa4('0x21')];var _0x221e7e=_0x58d337?0x0:_0x3d861c[_0x7fa4('0x1f')];var _0x4e58fb=_0x58d337?_0x40b203[_0x7fa4('0x21')]:_0x3d861c[_0x7fa4('0x1f')]+_0x3d861c['limit'];var _0x65cb64;if(_0x4e58fb>=_0x4df9f4){_0x4e58fb=_0x4df9f4;_0x65cb64=0xc8;}else{_0x65cb64=0xce;}_0x18bec5[_0x7fa4('0x1c')](_0x65cb64);return _0x18bec5[_0x7fa4('0x22')](_0x7fa4('0x23'),_0x221e7e+'-'+_0x4e58fb+'/'+_0x4df9f4)['json'](_0x40b203);}return null;};}function patchUpdates(_0x1827ce){return function(_0x5952a1){try{jsonpatch[_0x7fa4('0x24')](_0x5952a1,_0x1827ce,!![]);}catch(_0x1c0c14){return BPromise[_0x7fa4('0x25')](_0x1c0c14);}return _0x5952a1[_0x7fa4('0x26')]();};}function saveUpdates(_0xad1f7c,_0x3350e8){return function(_0x46a120){if(_0x46a120){return _0x46a120[_0x7fa4('0x27')](_0xad1f7c)[_0x7fa4('0x28')](function(_0x319a8f){return _0x319a8f;});}return null;};}function removeEntity(_0x4821f3,_0x452a56){return function(_0x4abb53){if(_0x4abb53){return _0x4abb53[_0x7fa4('0x29')]()['then'](function(){var _0x571cf9=_0x4abb53[_0x7fa4('0x2a')]({'plain':!![]});var _0x584675=_0x7fa4('0x2b');return db['UserProfileResource'][_0x7fa4('0x29')]({'where':{'type':_0x584675,'resourceId':_0x571cf9['id']}})['then'](function(){return _0x4abb53;});})[_0x7fa4('0x28')](function(){_0x4821f3[_0x7fa4('0x1c')](0xcc)[_0x7fa4('0x1d')]();});}};}function handleEntityNotFound(_0x3663d4,_0x149da6){return function(_0x2129ac){if(!_0x2129ac){_0x3663d4[_0x7fa4('0x1b')](0x194);}return _0x2129ac;};}function handleError(_0x275c50,_0x6fbc1b){_0x6fbc1b=_0x6fbc1b||0x1f4;return function(_0x21fcb0){logger[_0x7fa4('0x2c')](_0x21fcb0['stack']);if(_0x21fcb0[_0x7fa4('0x2d')]){delete _0x21fcb0[_0x7fa4('0x2d')];}_0x275c50['status'](_0x6fbc1b)[_0x7fa4('0x2e')](_0x21fcb0);};}exports[_0x7fa4('0x2f')]=function(_0x3b24a9,_0x56801c){var _0x4a31c6={},_0x13c376={},_0x2b8ca5={'count':0x0,'rows':[]};var _0xa65355=_[_0x7fa4('0x30')](db[_0x7fa4('0x31')]['rawAttributes'],function(_0x5f3031){return{'name':_0x5f3031[_0x7fa4('0x32')],'type':_0x5f3031[_0x7fa4('0x33')]['key']};});_0x13c376['model']=_[_0x7fa4('0x30')](_0xa65355,_0x7fa4('0x2d'));_0x13c376[_0x7fa4('0x34')]=_['keys'](_0x3b24a9[_0x7fa4('0x34')]);_0x13c376[_0x7fa4('0x35')]=_[_0x7fa4('0x36')](_0x13c376[_0x7fa4('0x37')],_0x13c376['query']);_0x4a31c6[_0x7fa4('0x38')]=_[_0x7fa4('0x36')](_0x13c376[_0x7fa4('0x37')],qs['fields'](_0x3b24a9[_0x7fa4('0x34')][_0x7fa4('0x39')]));_0x4a31c6[_0x7fa4('0x38')]=_0x4a31c6[_0x7fa4('0x38')][_0x7fa4('0x3a')]?_0x4a31c6[_0x7fa4('0x38')]:_0x13c376[_0x7fa4('0x37')];if(!_0x3b24a9[_0x7fa4('0x34')]['hasOwnProperty'](_0x7fa4('0x3b'))){_0x4a31c6[_0x7fa4('0x3c')]=qs[_0x7fa4('0x3c')](_0x3b24a9[_0x7fa4('0x34')]['limit']);_0x4a31c6['offset']=qs[_0x7fa4('0x1f')](_0x3b24a9['query'][_0x7fa4('0x1f')]);}_0x4a31c6['order']=qs[_0x7fa4('0x3d')](_0x3b24a9[_0x7fa4('0x34')]['sort']);_0x4a31c6[_0x7fa4('0x3e')]=qs[_0x7fa4('0x35')](_[_0x7fa4('0x3f')](_0x3b24a9['query'],_0x13c376[_0x7fa4('0x35')]),_0xa65355);if(_0x3b24a9[_0x7fa4('0x34')]['filter']){_0x4a31c6[_0x7fa4('0x3e')]=_['merge'](_0x4a31c6[_0x7fa4('0x3e')],{'$or':_[_0x7fa4('0x30')](_0xa65355,function(_0x5a5669){if(_0x5a5669[_0x7fa4('0x33')]!=='VIRTUAL'){var _0x1b2a96={};_0x1b2a96[_0x5a5669[_0x7fa4('0x2d')]]={'$like':'%'+_0x3b24a9['query'][_0x7fa4('0x40')]+'%'};return _0x1b2a96;}})});}_0x4a31c6=_[_0x7fa4('0x41')]({},_0x4a31c6,_0x3b24a9['options']);var _0x323e48={'where':_0x4a31c6['where']};return db['Interval'][_0x7fa4('0x21')](_0x323e48)[_0x7fa4('0x28')](function(_0x4fd07f){_0x2b8ca5['count']=_0x4fd07f;if(_0x3b24a9['query'][_0x7fa4('0x42')]){_0x4a31c6[_0x7fa4('0x43')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x4a31c6);})['then'](function(_0x22fce1){_0x2b8ca5[_0x7fa4('0x44')]=_0x22fce1;return _0x2b8ca5;})['then'](respondWithFilteredResult(_0x56801c,_0x4a31c6))[_0x7fa4('0x45')](handleError(_0x56801c,null));};exports[_0x7fa4('0x46')]=function(_0x143ec5,_0x207c44){var _0x2be5af={'raw':!![],'where':{'id':_0x143ec5[_0x7fa4('0x47')]['id']}},_0x5c7044={};_0x5c7044[_0x7fa4('0x37')]=_[_0x7fa4('0x48')](db[_0x7fa4('0x31')][_0x7fa4('0x49')]);_0x5c7044['query']=_[_0x7fa4('0x48')](_0x143ec5[_0x7fa4('0x34')]);_0x5c7044[_0x7fa4('0x35')]=_['intersection'](_0x5c7044[_0x7fa4('0x37')],_0x5c7044[_0x7fa4('0x34')]);_0x2be5af[_0x7fa4('0x38')]=_[_0x7fa4('0x36')](_0x5c7044['model'],qs[_0x7fa4('0x39')](_0x143ec5[_0x7fa4('0x34')]['fields']));_0x2be5af[_0x7fa4('0x38')]=_0x2be5af['attributes'][_0x7fa4('0x3a')]?_0x2be5af[_0x7fa4('0x38')]:_0x5c7044[_0x7fa4('0x37')];if(_0x143ec5[_0x7fa4('0x34')][_0x7fa4('0x42')]){_0x2be5af[_0x7fa4('0x43')]=[{'all':!![]}];}_0x2be5af=_[_0x7fa4('0x41')]({},_0x2be5af,_0x143ec5[_0x7fa4('0x4a')]);return db[_0x7fa4('0x31')][_0x7fa4('0x4b')](_0x2be5af)[_0x7fa4('0x28')](handleEntityNotFound(_0x207c44,null))['then'](respondWithResult(_0x207c44,null))[_0x7fa4('0x45')](handleError(_0x207c44,null));};exports[_0x7fa4('0x4c')]=function(_0x2c8c6e,_0x44b1cf){return db['Interval'][_0x7fa4('0x4c')](_0x2c8c6e[_0x7fa4('0x4d')],{})['then'](function(_0x538b61){var _0x14f926=_0x2c8c6e[_0x7fa4('0x4e')][_0x7fa4('0x2a')]({'plain':!![]});if(!_0x14f926)throw new Error(_0x7fa4('0x4f'));if(_0x14f926[_0x7fa4('0x50')]===_0x7fa4('0x4e')){var _0x396dda=_0x538b61[_0x7fa4('0x2a')]({'plain':!![]});var _0x584ee6='Intervals';return db['UserProfileSection'][_0x7fa4('0x4b')]({'where':{'name':_0x584ee6,'userProfileId':_0x14f926['userProfileId']},'raw':!![]})['then'](function(_0x5f5812){if(_0x5f5812&&_0x5f5812[_0x7fa4('0x51')]===0x0){return db[_0x7fa4('0x52')][_0x7fa4('0x4c')]({'name':_0x396dda[_0x7fa4('0x2d')],'resourceId':_0x396dda['id'],'type':_0x5f5812[_0x7fa4('0x2d')],'sectionId':_0x5f5812['id']},{})[_0x7fa4('0x28')](function(){return _0x538b61;});}else{return _0x538b61;}})[_0x7fa4('0x45')](function(_0xd4f705){logger[_0x7fa4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd4f705);throw _0xd4f705;});}return _0x538b61;})[_0x7fa4('0x28')](respondWithResult(_0x44b1cf,0xc9))[_0x7fa4('0x45')](handleError(_0x44b1cf,null));};exports['update']=function(_0x1d1baa,_0x5887d1){if(_0x1d1baa[_0x7fa4('0x4d')]['id']){delete _0x1d1baa[_0x7fa4('0x4d')]['id'];}return db['Interval'][_0x7fa4('0x4b')]({'where':{'id':_0x1d1baa[_0x7fa4('0x47')]['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x5887d1,null))[_0x7fa4('0x28')](saveUpdates(_0x1d1baa[_0x7fa4('0x4d')],null))[_0x7fa4('0x28')](respondWithResult(_0x5887d1,null))[_0x7fa4('0x45')](handleError(_0x5887d1,null));};exports['destroy']=function(_0x1e4801,_0x522e0c){return db[_0x7fa4('0x31')][_0x7fa4('0x4b')]({'where':{'id':_0x1e4801['params']['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x522e0c,null))['then'](removeEntity(_0x522e0c,null))[_0x7fa4('0x45')](handleError(_0x522e0c,null));};exports[_0x7fa4('0x53')]=function(_0x3682c2,_0x2a913d,_0x12d867){if(_0x3682c2['body']['id']){delete _0x3682c2[_0x7fa4('0x4d')]['id'];}return db[_0x7fa4('0x31')][_0x7fa4('0x4b')]({'where':{'id':_0x3682c2[_0x7fa4('0x47')]['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x2a913d,null))[_0x7fa4('0x28')](function(_0x2a0272){if(_0x2a0272){_0x3682c2[_0x7fa4('0x4d')][_0x7fa4('0x54')]=_0x2a0272['id'];return db[_0x7fa4('0x31')]['create'](_0x3682c2[_0x7fa4('0x4d')]);}})[_0x7fa4('0x28')](respondWithResult(_0x2a913d,null))[_0x7fa4('0x45')](handleError(_0x2a913d,null));};exports[_0x7fa4('0x55')]=function(_0x46840e,_0x356679,_0x128b40){var _0x1ec43b={};var _0x38cc96={};var _0x6f0774;var _0x5c5889;return db[_0x7fa4('0x31')][_0x7fa4('0x56')]({'where':{'id':_0x46840e[_0x7fa4('0x47')]['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x356679,null))[_0x7fa4('0x28')](function(_0x3953fa){if(_0x3953fa){_0x6f0774=_0x3953fa;_0x38cc96[_0x7fa4('0x37')]=_[_0x7fa4('0x48')](db['Interval'][_0x7fa4('0x49')]);_0x38cc96[_0x7fa4('0x34')]=_[_0x7fa4('0x48')](_0x46840e[_0x7fa4('0x34')]);_0x38cc96[_0x7fa4('0x35')]=_['intersection'](_0x38cc96[_0x7fa4('0x37')],_0x38cc96[_0x7fa4('0x34')]);_0x1ec43b[_0x7fa4('0x38')]=_['intersection'](_0x38cc96[_0x7fa4('0x37')],qs[_0x7fa4('0x39')](_0x46840e[_0x7fa4('0x34')][_0x7fa4('0x39')]));_0x1ec43b['attributes']=_0x1ec43b[_0x7fa4('0x38')][_0x7fa4('0x3a')]?_0x1ec43b['attributes']:_0x38cc96['model'];_0x1ec43b[_0x7fa4('0x57')]=qs['sort'](_0x46840e[_0x7fa4('0x34')][_0x7fa4('0x3d')]);_0x1ec43b[_0x7fa4('0x3e')]=qs[_0x7fa4('0x35')](_['pick'](_0x46840e[_0x7fa4('0x34')],_0x38cc96[_0x7fa4('0x35')]));if(_0x46840e[_0x7fa4('0x34')]['filter']){_0x1ec43b[_0x7fa4('0x3e')]=_[_0x7fa4('0x41')](_0x1ec43b['where'],{'$or':_[_0x7fa4('0x30')](_0x1ec43b[_0x7fa4('0x38')],function(_0x2ee431){var _0x8b15dc={};_0x8b15dc[_0x2ee431]={'$like':'%'+_0x46840e[_0x7fa4('0x34')][_0x7fa4('0x40')]+'%'};return _0x8b15dc;})});}_0x1ec43b=_[_0x7fa4('0x41')]({},_0x1ec43b,_0x46840e[_0x7fa4('0x4a')]);return _0x6f0774[_0x7fa4('0x55')](_0x1ec43b);}})[_0x7fa4('0x28')](function(_0x2b334f){if(_0x2b334f){_0x5c5889=_0x2b334f[_0x7fa4('0x3a')];if(!_0x46840e[_0x7fa4('0x34')]['hasOwnProperty'](_0x7fa4('0x3b'))){_0x1ec43b[_0x7fa4('0x3c')]=qs[_0x7fa4('0x3c')](_0x46840e[_0x7fa4('0x34')][_0x7fa4('0x3c')]);_0x1ec43b[_0x7fa4('0x1f')]=qs['offset'](_0x46840e[_0x7fa4('0x34')][_0x7fa4('0x1f')]);}return _0x6f0774[_0x7fa4('0x55')](_0x1ec43b);}})[_0x7fa4('0x28')](function(_0x53047a){if(_0x53047a){return _0x53047a?{'count':_0x5c5889,'rows':_0x53047a}:null;}})[_0x7fa4('0x28')](respondWithResult(_0x356679,null))[_0x7fa4('0x45')](handleError(_0x356679,null));};exports[_0x7fa4('0x58')]=function(_0x498aa4,_0x8561af,_0x2e5c28){return db[_0x7fa4('0x31')]['findOne']({'where':{'id':_0x498aa4['params']['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x8561af,null))['then'](function(_0x2ca6b7){if(_0x2ca6b7){return db[_0x7fa4('0x59')][_0x7fa4('0x5a')](function(_0x374f7a){return db['Interval'][_0x7fa4('0x29')]({'where':{'IntervalId':_0x498aa4[_0x7fa4('0x47')]['id']},'transaction':_0x374f7a})['then'](function(_0x4bae2c){var _0xe1b894=_[_0x7fa4('0x30')](_0x498aa4['body'],function(_0x7fc259){delete _0x7fc259['id'];_0x7fc259[_0x7fa4('0x54')]=_0x498aa4[_0x7fa4('0x47')]['id'];return _0x7fc259;});return db[_0x7fa4('0x31')][_0x7fa4('0x5b')](_0xe1b894,{'transaction':_0x374f7a});});})[_0x7fa4('0x28')](function(){return db[_0x7fa4('0x31')][_0x7fa4('0x5c')]({'where':{'IntervalId':_0x498aa4[_0x7fa4('0x47')]['id']}});});}})['then'](respondWithResult(_0x8561af,null))[_0x7fa4('0x45')](handleError(_0x8561af,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index d2fbe95..5dcf42e 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 _0xe056=['define','tools_intervals','rewrite','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe056,0xdb));var _0x6e05=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xe056[_0x2a5099];return _0x2802f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e05('0x0'))(_0x6e05('0x1'));var moment=require(_0x6e05('0x2'));var BPromise=require('bluebird');var rp=require(_0x6e05('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e05('0x4'));var config=require(_0x6e05('0x5'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x19837b,_0x390bb6){return _0x19837b[_0x6e05('0x6')]('Interval',attributes,{'tableName':_0x6e05('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x177b2c,_0x1a0ed3){extensions[_0x6e05('0x8')](_0x19837b,_0x177b2c);},'afterBulkCreate':function(_0x13af56,_0x52b72b,_0x330e12){_0x330e12();extensions[_0x6e05('0x8')](_0x19837b,_0x13af56[0x0]);},'afterUpdate':function(_0x321ee5,_0x178c9f){extensions[_0x6e05('0x8')](_0x19837b,_0x321ee5);},'afterDestroy':function(_0x21af62,_0x4ff533){extensions[_0x6e05('0x8')](_0x19837b,_0x21af62);}}});}; \ No newline at end of file +var _0xd457=['path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a2385,_0x483814){var _0x2c75=function(_0x1991da){while(--_0x1991da){_0x2a2385['push'](_0x2a2385['shift']());}};_0x2c75(++_0x483814);}(_0xd457,0x1e9));var _0x7d45=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd457[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x7d45('0x0'));var util=require(_0x7d45('0x1'));var logger=require(_0x7d45('0x2'))(_0x7d45('0x3'));var moment=require(_0x7d45('0x4'));var BPromise=require(_0x7d45('0x5'));var rp=require(_0x7d45('0x6'));var fs=require('fs');var path=require(_0x7d45('0x7'));var rimraf=require(_0x7d45('0x8'));var config=require(_0x7d45('0x9'));var attributes=require(_0x7d45('0xa'));var extensions=require(_0x7d45('0xb'));module[_0x7d45('0xc')]=function(_0x28bbc0,_0x43d9dd){return _0x28bbc0[_0x7d45('0xd')]('Interval',attributes,{'tableName':_0x7d45('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xcc9ec4,_0x592390){extensions[_0x7d45('0xf')](_0x28bbc0,_0xcc9ec4);},'afterBulkCreate':function(_0x409c27,_0x33d41c,_0x1ef609){_0x1ef609();extensions[_0x7d45('0xf')](_0x28bbc0,_0x409c27[0x0]);},'afterUpdate':function(_0x5cc660,_0x4c5dcc){extensions['rewrite'](_0x28bbc0,_0x5cc660);},'afterDestroy':function(_0x12261b,_0x239f03){extensions[_0x7d45('0xf')](_0x28bbc0,_0x12261b);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 9334db9..30d0b45 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 6686ed9..3071ff4 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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x37bb81,_0x43e976){var _0x38f8e7=function(_0x127fdc){while(--_0x127fdc){_0x37bb81['push'](_0x37bb81['shift']());}};_0x38f8e7(++_0x43e976);}(_0xdb28,0x106));var _0x8db2=function(_0x1fb9cc,_0x9e2ac2){_0x1fb9cc=_0x1fb9cc-0x0;var _0x41077d=_0xdb28[_0x1fb9cc];return _0x41077d;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x37ea15,_0x5a0470){var _0x453798=function(_0x47b5f9){while(--_0x47b5f9){_0x37ea15['push'](_0x37ea15['shift']());}};_0x453798(++_0x5a0470);}(_0x5f2f,0x73));var _0xf5f2=function(_0x11ab2f,_0x4aeaf9){_0x11ab2f=_0x11ab2f-0x0;var _0x596631=_0x5f2f[_0x11ab2f];return _0x596631;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index e95ac55..7feaab2 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 _0xa2fa=['name','customfield_11504','reason','/rest/api/2/issue','POST','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','fields','customfield_11500','customfield_11501','oldToken','newToken','customfield_11503'];(function(_0x17d337,_0x3f8bd3){var _0x4b726b=function(_0x8b08db){while(--_0x8b08db){_0x17d337['push'](_0x17d337['shift']());}};_0x4b726b(++_0x3f8bd3);}(_0xa2fa,0xc2));var _0xaa2f=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0xa2fa[_0xd29c88];return _0x375635;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0xaa2f('0x0'))(_0xaa2f('0x1'));var USERNAME=_0xaa2f('0x2');var PASSWORD=_0xaa2f('0x3');function openIssue(_0x88c7af,_0x46e3cb){var _0x40cc81={'fields':{'project':{'key':_0x88c7af[_0xaa2f('0x4')]||_0xaa2f('0x5')},'summary':(_0x88c7af[_0xaa2f('0x6')]||_0xaa2f('0x7'))+'\x20from\x20'+_0x88c7af['ip'],'description':_0x88c7af[_0xaa2f('0x8')]||JSON[_0xaa2f('0x9')](_0x88c7af),'issuetype':{'name':_0x88c7af['issuetype']||'Bug'}}};_0x40cc81[_0xaa2f('0xa')][_0xaa2f('0xb')]=_0x88c7af['email'];_0x40cc81[_0xaa2f('0xa')][_0xaa2f('0xc')]=_0x88c7af[_0xaa2f('0xd')];_0x40cc81[_0xaa2f('0xa')]['customfield_11502']=_0x88c7af[_0xaa2f('0xe')];_0x40cc81['fields'][_0xaa2f('0xf')]=_0x88c7af[_0xaa2f('0x10')];_0x40cc81[_0xaa2f('0xa')][_0xaa2f('0x11')]=_0x88c7af[_0xaa2f('0x12')];_0x40cc81[_0xaa2f('0xa')]['customfield_10102']=_0x88c7af['ip'];var _0x3e1e01={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xaa2f('0x13'),'method':_0xaa2f('0x14'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xaa2f('0x15')](_0xaa2f('0x16'))}};var _0x16de56=JSON[_0xaa2f('0x9')](_0x40cc81);var _0x4d37bf=https[_0xaa2f('0x17')](_0x3e1e01,function(_0x2b500d){_0x2b500d[_0xaa2f('0x18')](_0xaa2f('0x19'));var _0x73b7e9='';_0x2b500d['on'](_0xaa2f('0x1a'),function(_0x24c766){_0x73b7e9+=_0x24c766;});_0x2b500d['on'](_0xaa2f('0x1b'),function(){if(_0x46e3cb){return _0x46e3cb[_0xaa2f('0x1c')](_0x2b500d[_0xaa2f('0x1d')])[_0xaa2f('0x1e')](JSON[_0xaa2f('0x1f')](_0x73b7e9));}});});_0x4d37bf['on']('error',function(_0x1423da){if(_0x46e3cb){return _0x46e3cb['status'](0x1f4)[_0xaa2f('0x1e')]({'errors':[{'message':_0xaa2f('0x20'),'type':_0xaa2f('0x21')}]});}});_0x4d37bf[_0xaa2f('0x22')](_0x16de56);_0x4d37bf['end']();}exports[_0xaa2f('0x23')]=openIssue;exports['send']=function(_0x27869b,_0x36943c){_0x27869b[_0xaa2f('0x24')]['ip']=_0x27869b[_0xaa2f('0x25')][_0xaa2f('0x26')]||_0x27869b[_0xaa2f('0x27')][_0xaa2f('0x28')]||_0x27869b[_0xaa2f('0x29')][_0xaa2f('0x28')]||_0x27869b[_0xaa2f('0x27')][_0xaa2f('0x29')][_0xaa2f('0x28')];return openIssue(_0x27869b['body'],_0x36943c);}; \ No newline at end of file +var _0xc646=['application/json','Basic\x20','toString','stringify','request','setEncoding','utf8','data','end','statusCode','parse','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','issuetype','Bug','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com'];(function(_0x1beb8b,_0x19510d){var _0x47d9bf=function(_0x37f13b){while(--_0x37f13b){_0x1beb8b['push'](_0x1beb8b['shift']());}};_0x47d9bf(++_0x19510d);}(_0xc646,0xa6));var _0x6c64=function(_0x788a54,_0x12450b){_0x788a54=_0x788a54-0x0;var _0x8b73a4=_0xc646[_0x788a54];return _0x8b73a4;};'use strict';var BPromise=require(_0x6c64('0x0'));var https=require(_0x6c64('0x1'));var logger=require(_0x6c64('0x2'))(_0x6c64('0x3'));var USERNAME=_0x6c64('0x4');var PASSWORD=_0x6c64('0x5');function openIssue(_0x2480dd,_0x4cff15){var _0x5ae19a={'fields':{'project':{'key':_0x2480dd[_0x6c64('0x6')]||_0x6c64('0x7')},'summary':(_0x2480dd['summary']||_0x6c64('0x8'))+_0x6c64('0x9')+_0x2480dd['ip'],'description':_0x2480dd[_0x6c64('0xa')]||JSON['stringify'](_0x2480dd),'issuetype':{'name':_0x2480dd[_0x6c64('0xb')]||_0x6c64('0xc')}}};_0x5ae19a['fields'][_0x6c64('0xd')]=_0x2480dd[_0x6c64('0xe')];_0x5ae19a[_0x6c64('0xf')][_0x6c64('0x10')]=_0x2480dd[_0x6c64('0x11')];_0x5ae19a[_0x6c64('0xf')][_0x6c64('0x12')]=_0x2480dd[_0x6c64('0x13')];_0x5ae19a['fields'][_0x6c64('0x14')]=_0x2480dd[_0x6c64('0x15')];_0x5ae19a[_0x6c64('0xf')][_0x6c64('0x16')]=_0x2480dd[_0x6c64('0x17')];_0x5ae19a[_0x6c64('0xf')][_0x6c64('0x18')]=_0x2480dd['ip'];var _0x24324e={'host':_0x6c64('0x19'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x6c64('0x1a'),'Authorization':_0x6c64('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0x6c64('0x1c')]('base64')}};var _0x2800ed=JSON[_0x6c64('0x1d')](_0x5ae19a);var _0x414c49=https[_0x6c64('0x1e')](_0x24324e,function(_0x184a56){_0x184a56[_0x6c64('0x1f')](_0x6c64('0x20'));var _0xb19ee5='';_0x184a56['on'](_0x6c64('0x21'),function(_0x5e672a){_0xb19ee5+=_0x5e672a;});_0x184a56['on'](_0x6c64('0x22'),function(){if(_0x4cff15){return _0x4cff15['status'](_0x184a56[_0x6c64('0x23')])['json'](JSON[_0x6c64('0x24')](_0xb19ee5));}});});_0x414c49['on'](_0x6c64('0x25'),function(_0x5b3fed){if(_0x4cff15){return _0x4cff15[_0x6c64('0x26')](0x1f4)[_0x6c64('0x27')]({'errors':[{'message':_0x6c64('0x28'),'type':_0x6c64('0x29')}]});}});_0x414c49['write'](_0x2800ed);_0x414c49[_0x6c64('0x22')]();}exports[_0x6c64('0x2a')]=openIssue;exports['send']=function(_0x521a66,_0x23b5e1){_0x521a66[_0x6c64('0x2b')]['ip']=_0x521a66['headers'][_0x6c64('0x2c')]||_0x521a66[_0x6c64('0x2d')][_0x6c64('0x2e')]||_0x521a66['socket']['remoteAddress']||_0x521a66[_0x6c64('0x2d')][_0x6c64('0x2f')][_0x6c64('0x2e')];return openIssue(_0x521a66[_0x6c64('0x2b')],_0x23b5e1);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 190c9a1..563f243 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 _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x221ebe,_0xc5deee){var _0x53d75b=function(_0x6693b6){while(--_0x6693b6){_0x221ebe['push'](_0x221ebe['shift']());}};_0x53d75b(++_0xc5deee);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4ea3=['multer','util','path','connect-timeout','Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','post','update','destroy','exports'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x4ea3,0x70));var _0x34ea=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x4ea3[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['describe']);router[_0x34ea('0x7')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['show']);router[_0x34ea('0xc')]('/',auth[_0x34ea('0x8')](),controller['create']);router['put'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xd')]);router['delete'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xe')]);module[_0x34ea('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index f987097..5c15e0c 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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x51f8ae,_0x58307c){_0x51f8ae=_0x51f8ae-0x0;var _0x2068df=_0x7a54[_0x51f8ae];return _0x2068df;};'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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0xa25b72,_0xbe3ecb){_0xa25b72=_0xa25b72-0x0;var _0x347d75=_0x7a54[_0xa25b72];return _0x347d75;};'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 e269936..6965c79 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 _0x50d0=['fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes'];(function(_0x65b707,_0x410e08){var _0x58cbb6=function(_0x40100d){while(--_0x40100d){_0x65b707['push'](_0x65b707['shift']());}};_0x58cbb6(++_0x410e08);}(_0x50d0,0x101));var _0x050d=function(_0x7c658d,_0xa5a056){_0x7c658d=_0x7c658d-0x0;var _0x12c7b2=_0x50d0[_0x7c658d];return _0x12c7b2;};'use strict';var emlformat=require(_0x050d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x050d('0x1'));var jsonpatch=require(_0x050d('0x2'));var rp=require(_0x050d('0x3'));var moment=require(_0x050d('0x4'));var BPromise=require(_0x050d('0x5'));var Mustache=require('mustache');var util=require(_0x050d('0x6'));var path=require(_0x050d('0x7'));var sox=require(_0x050d('0x8'));var csv=require(_0x050d('0x9'));var ejs=require(_0x050d('0xa'));var fs=require('fs');var fs_extra=require(_0x050d('0xb'));var _=require(_0x050d('0xc'));var squel=require(_0x050d('0xd'));var crypto=require(_0x050d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x050d('0xf'));var toCsv=require(_0x050d('0x9'));var querystring=require(_0x050d('0x10'));var Papa=require('papaparse');var Redis=require(_0x050d('0x11'));var authService=require(_0x050d('0x12'));var qs=require(_0x050d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x050d('0x14'))(_0x050d('0x15'));var utils=require(_0x050d('0x16'));var config=require(_0x050d('0x17'));var licenseUtil=require(_0x050d('0x18'));var db=require(_0x050d('0x19'))['db'];function respondWithStatusCode(_0x55a57d,_0x5656b4){_0x5656b4=_0x5656b4||0xcc;return function(_0x27d825){if(_0x27d825){return _0x55a57d[_0x050d('0x1a')](_0x5656b4);}return _0x55a57d[_0x050d('0x1b')](_0x5656b4)[_0x050d('0x1c')]();};}function respondWithResult(_0x4f5d24,_0x5c982f){_0x5c982f=_0x5c982f||0xc8;return function(_0x5e0c23){if(_0x5e0c23){return _0x4f5d24['status'](_0x5c982f)['json'](_0x5e0c23);}};}function respondWithFilteredResult(_0x4a65e5,_0x50c2f9){return function(_0x53c110){if(_0x53c110){var _0x340c55=typeof _0x50c2f9[_0x050d('0x1d')]===_0x050d('0x1e')&&typeof _0x50c2f9[_0x050d('0x1f')]===_0x050d('0x1e');var _0x3dddb1=_0x53c110[_0x050d('0x20')];var _0xe6bdad=_0x340c55?0x0:_0x50c2f9[_0x050d('0x1d')];var _0x9b240f=_0x340c55?_0x53c110[_0x050d('0x20')]:_0x50c2f9[_0x050d('0x1d')]+_0x50c2f9['limit'];var _0x54b9f6;if(_0x9b240f>=_0x3dddb1){_0x9b240f=_0x3dddb1;_0x54b9f6=0xc8;}else{_0x54b9f6=0xce;}_0x4a65e5['status'](_0x54b9f6);return _0x4a65e5[_0x050d('0x21')](_0x050d('0x22'),_0xe6bdad+'-'+_0x9b240f+'/'+_0x3dddb1)[_0x050d('0x23')](_0x53c110);}return null;};}function patchUpdates(_0x125a00){return function(_0x181bb8){try{jsonpatch['apply'](_0x181bb8,_0x125a00,!![]);}catch(_0x584439){return BPromise['reject'](_0x584439);}return _0x181bb8['save']();};}function saveUpdates(_0x365512,_0xdebdb8){return function(_0x185e2f){if(_0x185e2f){return _0x185e2f[_0x050d('0x24')](_0x365512)[_0x050d('0x25')](function(_0xfd26b8){return _0xfd26b8;});}return null;};}function removeEntity(_0x20e887,_0x102766){return function(_0x17f82b){if(_0x17f82b){return _0x17f82b[_0x050d('0x26')]()[_0x050d('0x25')](function(){_0x20e887[_0x050d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a70c3,_0x2ba0c3){return function(_0x369311){if(!_0x369311){_0x5a70c3['sendStatus'](0x194);}return _0x369311;};}function handleError(_0x1562fe,_0x3cafc1){_0x3cafc1=_0x3cafc1||0x1f4;return function(_0x1ea9a8){logger[_0x050d('0x27')](_0x1ea9a8[_0x050d('0x28')]);if(_0x1ea9a8[_0x050d('0x29')]){delete _0x1ea9a8[_0x050d('0x29')];}_0x1562fe[_0x050d('0x1b')](_0x3cafc1)[_0x050d('0x2a')](_0x1ea9a8);};}exports[_0x050d('0x2b')]=function(_0x1ce601,_0x392efa){var _0x422367={},_0x6da660={},_0x3f290c={'count':0x0,'rows':[]};var _0x5f5111=_[_0x050d('0x2c')](db[_0x050d('0x2d')][_0x050d('0x2e')],function(_0x519c6f){return{'name':_0x519c6f[_0x050d('0x2f')],'type':_0x519c6f['type'][_0x050d('0x30')]};});_0x6da660[_0x050d('0x31')]=_[_0x050d('0x2c')](_0x5f5111,_0x050d('0x29'));_0x6da660['query']=_[_0x050d('0x32')](_0x1ce601['query']);_0x6da660[_0x050d('0x33')]=_[_0x050d('0x34')](_0x6da660[_0x050d('0x31')],_0x6da660[_0x050d('0x35')]);_0x422367[_0x050d('0x36')]=_[_0x050d('0x34')](_0x6da660['model'],qs[_0x050d('0x37')](_0x1ce601[_0x050d('0x35')]['fields']));_0x422367[_0x050d('0x36')]=_0x422367['attributes'][_0x050d('0x38')]?_0x422367['attributes']:_0x6da660[_0x050d('0x31')];if(!_0x1ce601[_0x050d('0x35')]['hasOwnProperty'](_0x050d('0x39'))){_0x422367[_0x050d('0x1f')]=qs[_0x050d('0x1f')](_0x1ce601['query'][_0x050d('0x1f')]);_0x422367[_0x050d('0x1d')]=qs[_0x050d('0x1d')](_0x1ce601[_0x050d('0x35')][_0x050d('0x1d')]);}_0x422367['order']=qs[_0x050d('0x3a')](_0x1ce601['query'][_0x050d('0x3a')]);_0x422367[_0x050d('0x3b')]=qs[_0x050d('0x33')](_[_0x050d('0x3c')](_0x1ce601[_0x050d('0x35')],_0x6da660[_0x050d('0x33')]),_0x5f5111);if(_0x1ce601[_0x050d('0x35')][_0x050d('0x3d')]){_0x422367[_0x050d('0x3b')]=_[_0x050d('0x3e')](_0x422367['where'],{'$or':_['map'](_0x5f5111,function(_0xfc5f9b){if(_0xfc5f9b[_0x050d('0x3f')]!==_0x050d('0x40')){var _0x5e04b8={};_0x5e04b8[_0xfc5f9b[_0x050d('0x29')]]={'$like':'%'+_0x1ce601[_0x050d('0x35')]['filter']+'%'};return _0x5e04b8;}})});}_0x422367=_[_0x050d('0x3e')]({},_0x422367,_0x1ce601[_0x050d('0x41')]);var _0x2fe939={'where':_0x422367['where']};return db[_0x050d('0x2d')][_0x050d('0x20')](_0x2fe939)[_0x050d('0x25')](function(_0x37635d){_0x3f290c[_0x050d('0x20')]=_0x37635d;if(_0x1ce601[_0x050d('0x35')][_0x050d('0x42')]){_0x422367[_0x050d('0x43')]=[{'all':!![]}];}return db[_0x050d('0x2d')]['findAll'](_0x422367);})[_0x050d('0x25')](function(_0x2646e0){_0x3f290c[_0x050d('0x44')]=_0x2646e0;return _0x3f290c;})[_0x050d('0x25')](respondWithFilteredResult(_0x392efa,_0x422367))[_0x050d('0x45')](handleError(_0x392efa,null));};exports[_0x050d('0x46')]=function(_0x23c453,_0x45019d){var _0x1edde2={'raw':!![],'where':{'id':_0x23c453[_0x050d('0x47')]['id']}},_0x10e320={};_0x10e320[_0x050d('0x31')]=_['keys'](db['JscriptyAnswerReport'][_0x050d('0x2e')]);_0x10e320[_0x050d('0x35')]=_[_0x050d('0x32')](_0x23c453[_0x050d('0x35')]);_0x10e320[_0x050d('0x33')]=_['intersection'](_0x10e320[_0x050d('0x31')],_0x10e320[_0x050d('0x35')]);_0x1edde2[_0x050d('0x36')]=_[_0x050d('0x34')](_0x10e320[_0x050d('0x31')],qs[_0x050d('0x37')](_0x23c453['query'][_0x050d('0x37')]));_0x1edde2[_0x050d('0x36')]=_0x1edde2[_0x050d('0x36')][_0x050d('0x38')]?_0x1edde2[_0x050d('0x36')]:_0x10e320[_0x050d('0x31')];if(_0x23c453[_0x050d('0x35')][_0x050d('0x42')]){_0x1edde2[_0x050d('0x43')]=[{'all':!![]}];}_0x1edde2=_[_0x050d('0x3e')]({},_0x1edde2,_0x23c453[_0x050d('0x41')]);return db[_0x050d('0x2d')][_0x050d('0x48')](_0x1edde2)['then'](handleEntityNotFound(_0x45019d,null))['then'](respondWithResult(_0x45019d,null))[_0x050d('0x45')](handleError(_0x45019d,null));};exports['create']=function(_0x27bc53,_0x48d7f6){return db[_0x050d('0x2d')][_0x050d('0x49')](_0x27bc53['body'],{})['then'](respondWithResult(_0x48d7f6,0xc9))[_0x050d('0x45')](handleError(_0x48d7f6,null));};exports['update']=function(_0x4b2253,_0x242ccb){if(_0x4b2253['body']['id']){delete _0x4b2253[_0x050d('0x4a')]['id'];}return db['JscriptyAnswerReport'][_0x050d('0x48')]({'where':{'id':_0x4b2253[_0x050d('0x47')]['id']}})['then'](handleEntityNotFound(_0x242ccb,null))[_0x050d('0x25')](saveUpdates(_0x4b2253[_0x050d('0x4a')],null))[_0x050d('0x25')](respondWithResult(_0x242ccb,null))[_0x050d('0x45')](handleError(_0x242ccb,null));};exports['destroy']=function(_0x20f076,_0x2e7d7f){return db[_0x050d('0x2d')]['find']({'where':{'id':_0x20f076[_0x050d('0x47')]['id']}})[_0x050d('0x25')](handleEntityNotFound(_0x2e7d7f,null))['then'](removeEntity(_0x2e7d7f,null))[_0x050d('0x45')](handleError(_0x2e7d7f,null));};exports[_0x050d('0x4b')]=function(_0x27a06a,_0x1d5b58){return db[_0x050d('0x2d')][_0x050d('0x4b')]()[_0x050d('0x25')](respondWithResult(_0x1d5b58,null))['catch'](handleError(_0x1d5b58,null));}; \ No newline at end of file +var _0x4006=['findAll','catch','show','keys','include','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','end','error','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll'];(function(_0x56a0a6,_0x3c3503){var _0x57f19e=function(_0x18864a){while(--_0x18864a){_0x56a0a6['push'](_0x56a0a6['shift']());}};_0x57f19e(++_0x3c3503);}(_0x4006,0x1c7));var _0x6400=function(_0x1d70fc,_0x15a0c6){_0x1d70fc=_0x1d70fc-0x0;var _0x50e641=_0x4006[_0x1d70fc];return _0x50e641;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6400('0x0'));var zipdir=require(_0x6400('0x1'));var jsonpatch=require(_0x6400('0x2'));var rp=require(_0x6400('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6400('0x4'));var util=require('util');var path=require(_0x6400('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6400('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6400('0x7'));var squel=require(_0x6400('0x8'));var crypto=require(_0x6400('0x9'));var jsforce=require(_0x6400('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6400('0xb'));var querystring=require(_0x6400('0xc'));var Papa=require(_0x6400('0xd'));var Redis=require(_0x6400('0xe'));var authService=require(_0x6400('0xf'));var qs=require(_0x6400('0x10'));var as=require(_0x6400('0x11'));var hardwareService=require(_0x6400('0x12'));var logger=require(_0x6400('0x13'))(_0x6400('0x14'));var utils=require(_0x6400('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6400('0x16'));var db=require(_0x6400('0x17'))['db'];function respondWithStatusCode(_0x230c94,_0x36bf00){_0x36bf00=_0x36bf00||0xcc;return function(_0x5a6d31){if(_0x5a6d31){return _0x230c94[_0x6400('0x18')](_0x36bf00);}return _0x230c94[_0x6400('0x19')](_0x36bf00)['end']();};}function respondWithResult(_0x4f8133,_0x559312){_0x559312=_0x559312||0xc8;return function(_0x268f93){if(_0x268f93){return _0x4f8133[_0x6400('0x19')](_0x559312)['json'](_0x268f93);}};}function respondWithFilteredResult(_0x191696,_0x4ae3ea){return function(_0x28eb67){if(_0x28eb67){var _0x5a0c1c=typeof _0x4ae3ea[_0x6400('0x1a')]===_0x6400('0x1b')&&typeof _0x4ae3ea[_0x6400('0x1c')]===_0x6400('0x1b');var _0x49d412=_0x28eb67[_0x6400('0x1d')];var _0x14c036=_0x5a0c1c?0x0:_0x4ae3ea[_0x6400('0x1a')];var _0x50524f=_0x5a0c1c?_0x28eb67[_0x6400('0x1d')]:_0x4ae3ea[_0x6400('0x1a')]+_0x4ae3ea['limit'];var _0x36a8f5;if(_0x50524f>=_0x49d412){_0x50524f=_0x49d412;_0x36a8f5=0xc8;}else{_0x36a8f5=0xce;}_0x191696[_0x6400('0x19')](_0x36a8f5);return _0x191696[_0x6400('0x1e')]('Content-Range',_0x14c036+'-'+_0x50524f+'/'+_0x49d412)[_0x6400('0x1f')](_0x28eb67);}return null;};}function patchUpdates(_0x23c1cd){return function(_0x325bde){try{jsonpatch[_0x6400('0x20')](_0x325bde,_0x23c1cd,!![]);}catch(_0x1c8b72){return BPromise[_0x6400('0x21')](_0x1c8b72);}return _0x325bde[_0x6400('0x22')]();};}function saveUpdates(_0x171e39,_0x22eb63){return function(_0x212f0f){if(_0x212f0f){return _0x212f0f['update'](_0x171e39)[_0x6400('0x23')](function(_0x50c29e){return _0x50c29e;});}return null;};}function removeEntity(_0x589b7c,_0x257d80){return function(_0xb79c62){if(_0xb79c62){return _0xb79c62[_0x6400('0x24')]()[_0x6400('0x23')](function(){_0x589b7c['status'](0xcc)[_0x6400('0x25')]();});}};}function handleEntityNotFound(_0x56d9e6,_0x1acff2){return function(_0x506732){if(!_0x506732){_0x56d9e6[_0x6400('0x18')](0x194);}return _0x506732;};}function handleError(_0x246433,_0x577156){_0x577156=_0x577156||0x1f4;return function(_0x434550){logger[_0x6400('0x26')](_0x434550[_0x6400('0x27')]);if(_0x434550['name']){delete _0x434550[_0x6400('0x28')];}_0x246433['status'](_0x577156)['send'](_0x434550);};}exports[_0x6400('0x29')]=function(_0x4bb214,_0x234670){var _0x197b9d={},_0x50f5e9={},_0x452a2c={'count':0x0,'rows':[]};var _0x52eba1=_['map'](db[_0x6400('0x2a')][_0x6400('0x2b')],function(_0x10005a){return{'name':_0x10005a[_0x6400('0x2c')],'type':_0x10005a[_0x6400('0x2d')]['key']};});_0x50f5e9[_0x6400('0x2e')]=_[_0x6400('0x2f')](_0x52eba1,_0x6400('0x28'));_0x50f5e9[_0x6400('0x30')]=_['keys'](_0x4bb214[_0x6400('0x30')]);_0x50f5e9[_0x6400('0x31')]=_[_0x6400('0x32')](_0x50f5e9['model'],_0x50f5e9[_0x6400('0x30')]);_0x197b9d[_0x6400('0x33')]=_[_0x6400('0x32')](_0x50f5e9[_0x6400('0x2e')],qs['fields'](_0x4bb214[_0x6400('0x30')][_0x6400('0x34')]));_0x197b9d['attributes']=_0x197b9d[_0x6400('0x33')][_0x6400('0x35')]?_0x197b9d['attributes']:_0x50f5e9['model'];if(!_0x4bb214[_0x6400('0x30')][_0x6400('0x36')](_0x6400('0x37'))){_0x197b9d['limit']=qs['limit'](_0x4bb214['query'][_0x6400('0x1c')]);_0x197b9d[_0x6400('0x1a')]=qs[_0x6400('0x1a')](_0x4bb214[_0x6400('0x30')][_0x6400('0x1a')]);}_0x197b9d['order']=qs[_0x6400('0x38')](_0x4bb214[_0x6400('0x30')]['sort']);_0x197b9d['where']=qs[_0x6400('0x31')](_[_0x6400('0x39')](_0x4bb214[_0x6400('0x30')],_0x50f5e9['filters']),_0x52eba1);if(_0x4bb214[_0x6400('0x30')][_0x6400('0x3a')]){_0x197b9d[_0x6400('0x3b')]=_['merge'](_0x197b9d[_0x6400('0x3b')],{'$or':_[_0x6400('0x2f')](_0x52eba1,function(_0xd824bf){if(_0xd824bf['type']!=='VIRTUAL'){var _0x5a0973={};_0x5a0973[_0xd824bf[_0x6400('0x28')]]={'$like':'%'+_0x4bb214['query']['filter']+'%'};return _0x5a0973;}})});}_0x197b9d=_[_0x6400('0x3c')]({},_0x197b9d,_0x4bb214[_0x6400('0x3d')]);var _0x565942={'where':_0x197b9d[_0x6400('0x3b')]};return db[_0x6400('0x2a')][_0x6400('0x1d')](_0x565942)['then'](function(_0x9536e5){_0x452a2c[_0x6400('0x1d')]=_0x9536e5;if(_0x4bb214[_0x6400('0x30')][_0x6400('0x3e')]){_0x197b9d['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6400('0x3f')](_0x197b9d);})[_0x6400('0x23')](function(_0x1bf820){_0x452a2c['rows']=_0x1bf820;return _0x452a2c;})[_0x6400('0x23')](respondWithFilteredResult(_0x234670,_0x197b9d))[_0x6400('0x40')](handleError(_0x234670,null));};exports[_0x6400('0x41')]=function(_0xe50c96,_0x3069f0){var _0x557133={'raw':!![],'where':{'id':_0xe50c96['params']['id']}},_0x24d0c7={};_0x24d0c7[_0x6400('0x2e')]=_[_0x6400('0x42')](db[_0x6400('0x2a')][_0x6400('0x2b')]);_0x24d0c7['query']=_[_0x6400('0x42')](_0xe50c96[_0x6400('0x30')]);_0x24d0c7[_0x6400('0x31')]=_[_0x6400('0x32')](_0x24d0c7['model'],_0x24d0c7[_0x6400('0x30')]);_0x557133['attributes']=_[_0x6400('0x32')](_0x24d0c7['model'],qs[_0x6400('0x34')](_0xe50c96[_0x6400('0x30')][_0x6400('0x34')]));_0x557133['attributes']=_0x557133[_0x6400('0x33')]['length']?_0x557133[_0x6400('0x33')]:_0x24d0c7[_0x6400('0x2e')];if(_0xe50c96[_0x6400('0x30')][_0x6400('0x3e')]){_0x557133[_0x6400('0x43')]=[{'all':!![]}];}_0x557133=_[_0x6400('0x3c')]({},_0x557133,_0xe50c96[_0x6400('0x3d')]);return db[_0x6400('0x2a')][_0x6400('0x44')](_0x557133)[_0x6400('0x23')](handleEntityNotFound(_0x3069f0,null))[_0x6400('0x23')](respondWithResult(_0x3069f0,null))['catch'](handleError(_0x3069f0,null));};exports[_0x6400('0x45')]=function(_0x3340c7,_0x59a8f2){return db['JscriptyAnswerReport'][_0x6400('0x45')](_0x3340c7[_0x6400('0x46')],{})[_0x6400('0x23')](respondWithResult(_0x59a8f2,0xc9))['catch'](handleError(_0x59a8f2,null));};exports[_0x6400('0x47')]=function(_0x54cbfb,_0x518ee4){if(_0x54cbfb['body']['id']){delete _0x54cbfb[_0x6400('0x46')]['id'];}return db[_0x6400('0x2a')]['find']({'where':{'id':_0x54cbfb[_0x6400('0x48')]['id']}})[_0x6400('0x23')](handleEntityNotFound(_0x518ee4,null))['then'](saveUpdates(_0x54cbfb['body'],null))[_0x6400('0x23')](respondWithResult(_0x518ee4,null))[_0x6400('0x40')](handleError(_0x518ee4,null));};exports['destroy']=function(_0x3421b5,_0x205233){return db[_0x6400('0x2a')][_0x6400('0x44')]({'where':{'id':_0x3421b5[_0x6400('0x48')]['id']}})[_0x6400('0x23')](handleEntityNotFound(_0x205233,null))[_0x6400('0x23')](removeEntity(_0x205233,null))['catch'](handleError(_0x205233,null));};exports[_0x6400('0x49')]=function(_0x801179,_0x6905bb){return db[_0x6400('0x2a')][_0x6400('0x49')]()[_0x6400('0x23')](respondWithResult(_0x6905bb,null))[_0x6400('0x40')](handleError(_0x6905bb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index d4c8e87..61fbf43 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 _0x89a2=['report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport'];(function(_0x31d03c,_0x158cef){var _0x420e61=function(_0x1ddac1){while(--_0x1ddac1){_0x31d03c['push'](_0x31d03c['shift']());}};_0x420e61(++_0x158cef);}(_0x89a2,0x1e1));var _0x289a=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0x89a2[_0x55c485];return _0x6bb521;};'use strict';var _=require(_0x289a('0x0'));var util=require(_0x289a('0x1'));var logger=require(_0x289a('0x2'))(_0x289a('0x3'));var moment=require(_0x289a('0x4'));var BPromise=require(_0x289a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x289a('0x6'));var rimraf=require('rimraf');var config=require(_0x289a('0x7'));var attributes=require(_0x289a('0x8'));module['exports']=function(_0x270ed2,_0x15f6ee){return _0x270ed2[_0x289a('0x9')](_0x289a('0xa'),attributes,{'tableName':_0x289a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8918=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x56ce22,_0x25b601){var _0x5e4703=function(_0x131007){while(--_0x131007){_0x56ce22['push'](_0x56ce22['shift']());}};_0x5e4703(++_0x25b601);}(_0x8918,0x1c1));var _0x8891=function(_0x39dd10,_0x134622){_0x39dd10=_0x39dd10-0x0;var _0x35bd8a=_0x8918[_0x39dd10];return _0x35bd8a;};'use strict';var _=require(_0x8891('0x0'));var util=require(_0x8891('0x1'));var logger=require(_0x8891('0x2'))(_0x8891('0x3'));var moment=require(_0x8891('0x4'));var BPromise=require('bluebird');var rp=require(_0x8891('0x5'));var fs=require('fs');var path=require(_0x8891('0x6'));var rimraf=require('rimraf');var config=require(_0x8891('0x7'));var attributes=require(_0x8891('0x8'));module[_0x8891('0x9')]=function(_0x2c685b,_0x5284dd){return _0x2c685b[_0x8891('0xa')](_0x8891('0xb'),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 ac4b9d8..255e6de 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 _0x3c71=['stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','debug'];(function(_0x16aa29,_0xebed34){var _0x1f844e=function(_0x21ed56){while(--_0x21ed56){_0x16aa29['push'](_0x16aa29['shift']());}};_0x1f844e(++_0xebed34);}(_0x3c71,0x98));var _0x13c7=function(_0x56de1d,_0x3ee6b0){_0x56de1d=_0x56de1d-0x0;var _0x1f726e=_0x3c71[_0x56de1d];return _0x1f726e;};'use strict';var _=require(_0x13c7('0x0'));var util=require(_0x13c7('0x1'));var moment=require(_0x13c7('0x2'));var BPromise=require(_0x13c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c7('0x4'));var db=require(_0x13c7('0x5'))['db'];var utils=require(_0x13c7('0x6'));var logger=require(_0x13c7('0x7'))(_0x13c7('0x8'));var config=require(_0x13c7('0x9'));var jayson=require(_0x13c7('0xa'));var client=jayson['client'][_0x13c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18a790,_0x69a58,_0x2f4e95){return new BPromise(function(_0x552425,_0x4126d7){return client[_0x13c7('0xc')](_0x18a790,_0x2f4e95)[_0x13c7('0xd')](function(_0x2c4a4f){logger['info'](_0x13c7('0xe'),_0x69a58,'request\x20sent');logger[_0x13c7('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x69a58,'request\x20sent',JSON[_0x13c7('0x10')](_0x2c4a4f));if(_0x2c4a4f[_0x13c7('0x11')]){if(_0x2c4a4f['error'][_0x13c7('0x12')]===0x1f4){logger['error'](_0x13c7('0xe'),_0x69a58,_0x2c4a4f[_0x13c7('0x11')]['message']);return _0x4126d7(_0x2c4a4f['error']['message']);}logger['error'](_0x13c7('0xe'),_0x69a58,_0x2c4a4f[_0x13c7('0x11')][_0x13c7('0x13')]);return _0x552425(_0x2c4a4f['error'][_0x13c7('0x13')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x69a58,'request\x20sent');_0x552425(_0x2c4a4f['result'][_0x13c7('0x13')]);}})[_0x13c7('0x14')](function(_0x34692e){logger[_0x13c7('0x11')](_0x13c7('0xe'),_0x69a58,_0x34692e);_0x4126d7(_0x34692e);});});} \ No newline at end of file +var _0x1f2f=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x4d2ae0,_0x1a71ce){var _0x328872=function(_0xc3c194){while(--_0xc3c194){_0x4d2ae0['push'](_0x4d2ae0['shift']());}};_0x328872(++_0x1a71ce);}(_0x1f2f,0x1a3));var _0xf1f2=function(_0x272e18,_0x75e43c){_0x272e18=_0x272e18-0x0;var _0x572ca9=_0x1f2f[_0x272e18];return _0x572ca9;};'use strict';var _=require(_0xf1f2('0x0'));var util=require(_0xf1f2('0x1'));var moment=require(_0xf1f2('0x2'));var BPromise=require('bluebird');var rs=require(_0xf1f2('0x3'));var fs=require('fs');var Redis=require(_0xf1f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf1f2('0x5'))(_0xf1f2('0x6'));var config=require(_0xf1f2('0x7'));var jayson=require(_0xf1f2('0x8'));var client=jayson[_0xf1f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bd415,_0x952dd2,_0xb21027){return new BPromise(function(_0x559baa,_0x1cf645){return client[_0xf1f2('0xa')](_0x2bd415,_0xb21027)[_0xf1f2('0xb')](function(_0x10ac84){logger[_0xf1f2('0xc')](_0xf1f2('0xd'),_0x952dd2,'request\x20sent');logger[_0xf1f2('0xe')](_0xf1f2('0xf'),_0x952dd2,_0xf1f2('0x10'),JSON[_0xf1f2('0x11')](_0x10ac84));if(_0x10ac84[_0xf1f2('0x12')]){if(_0x10ac84['error']['code']===0x1f4){logger[_0xf1f2('0x12')](_0xf1f2('0xd'),_0x952dd2,_0x10ac84[_0xf1f2('0x12')]['message']);return _0x1cf645(_0x10ac84[_0xf1f2('0x12')][_0xf1f2('0x13')]);}logger[_0xf1f2('0x12')](_0xf1f2('0xd'),_0x952dd2,_0x10ac84[_0xf1f2('0x12')][_0xf1f2('0x13')]);return _0x559baa(_0x10ac84[_0xf1f2('0x12')][_0xf1f2('0x13')]);}else{logger[_0xf1f2('0xc')](_0xf1f2('0xd'),_0x952dd2,'request\x20sent');_0x559baa(_0x10ac84[_0xf1f2('0x14')][_0xf1f2('0x13')]);}})['catch'](function(_0x317654){logger[_0xf1f2('0x12')](_0xf1f2('0xd'),_0x952dd2,_0x317654);_0x1cf645(_0x317654);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 2b9fada..12ab3cd 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 _0x31f3=['get','/:id','show','/:id/sessions','getSessions','getAnswers','/:id/summary','getSummary','create','/:id/clone','clone','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index'];(function(_0x26e8b7,_0x1bfca3){var _0x24904e=function(_0xdffbaa){while(--_0xdffbaa){_0x26e8b7['push'](_0x26e8b7['shift']());}};_0x24904e(++_0x1bfca3);}(_0x31f3,0x9d));var _0x331f=function(_0x2ed176,_0x1d3e64){_0x2ed176=_0x2ed176-0x0;var _0x10f61a=_0x31f3[_0x2ed176];return _0x10f61a;};'use strict';var multer=require('multer');var util=require(_0x331f('0x0'));var path=require(_0x331f('0x1'));var timeout=require('connect-timeout');var express=require(_0x331f('0x2'));var router=express[_0x331f('0x3')]();var fs_extra=require(_0x331f('0x4'));var auth=require(_0x331f('0x5'));var interaction=require(_0x331f('0x6'));var config=require(_0x331f('0x7'));var controller=require(_0x331f('0x8'));router['get']('/',auth[_0x331f('0x9')](),controller[_0x331f('0xa')]);router[_0x331f('0xb')](_0x331f('0xc'),auth['isAuthenticated'](),controller[_0x331f('0xd')]);router[_0x331f('0xb')](_0x331f('0xe'),auth[_0x331f('0x9')](),controller[_0x331f('0xf')]);router[_0x331f('0xb')]('/:id/answers',auth['isAuthenticated'](),controller[_0x331f('0x10')]);router[_0x331f('0xb')](_0x331f('0x11'),auth[_0x331f('0x9')](),timeout('30s'),controller[_0x331f('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x331f('0x13')]);router['post'](_0x331f('0x14'),auth[_0x331f('0x9')](),controller[_0x331f('0x15')]);router['put'](_0x331f('0xc'),auth[_0x331f('0x9')](),controller['update']);router['delete'](_0x331f('0xc'),auth['isAuthenticated'](),controller[_0x331f('0x16')]);module[_0x331f('0x17')]=router; \ No newline at end of file +var _0x32c3=['update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','create','post','clone','put'];(function(_0x566c6c,_0x5f0b94){var _0x5d9a1d=function(_0xffb829){while(--_0xffb829){_0x566c6c['push'](_0x566c6c['shift']());}};_0x5d9a1d(++_0x5f0b94);}(_0x32c3,0x11b));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x332c('0x0'));var util=require(_0x332c('0x1'));var path=require(_0x332c('0x2'));var timeout=require(_0x332c('0x3'));var express=require(_0x332c('0x4'));var router=express[_0x332c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x332c('0x6'));var interaction=require(_0x332c('0x7'));var config=require(_0x332c('0x8'));var controller=require(_0x332c('0x9'));router['get']('/',auth[_0x332c('0xa')](),controller[_0x332c('0xb')]);router[_0x332c('0xc')](_0x332c('0xd'),auth['isAuthenticated'](),controller[_0x332c('0xe')]);router[_0x332c('0xc')](_0x332c('0xf'),auth[_0x332c('0xa')](),controller[_0x332c('0x10')]);router['get']('/:id/answers',auth[_0x332c('0xa')](),controller[_0x332c('0x11')]);router['get'](_0x332c('0x12'),auth[_0x332c('0xa')](),timeout(_0x332c('0x13')),controller[_0x332c('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x332c('0x15')]);router[_0x332c('0x16')]('/:id/clone',auth[_0x332c('0xa')](),controller[_0x332c('0x17')]);router[_0x332c('0x18')](_0x332c('0xd'),auth[_0x332c('0xa')](),controller[_0x332c('0x19')]);router[_0x332c('0x1a')]('/:id',auth[_0x332c('0xa')](),controller['destroy']);module[_0x332c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 423aaae..c430a30 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 _0x9e86=['setDataValue','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x9e86,0x158));var _0x69e8=function(_0x145e0a,_0x164f28){_0x145e0a=_0x145e0a-0x0;var _0xddc026=_0x9e86[_0x145e0a];return _0xddc026;};'use strict';var Sequelize=require(_0x69e8('0x0'));var _=require(_0x69e8('0x1'));var util=require(_0x69e8('0x2'));module[_0x69e8('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x13131c){if(_['isObjectLike'](_0x13131c)){this[_0x69e8('0x4')]('formData',JSON['stringify'](_0x13131c));}else if(_[_0x69e8('0x5')](_0x13131c)){this[_0x69e8('0x4')]('formData',_0x13131c);}else{this[_0x69e8('0x4')](_0x69e8('0x6'),util[_0x69e8('0x7')](_0x69e8('0x8'),this[_0x69e8('0x9')]('name')||'',this[_0x69e8('0x9')](_0x69e8('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x69e8('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8ecb=['isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING','name','long'];(function(_0x424edf,_0x184352){var _0xe9b044=function(_0x324b02){while(--_0x324b02){_0x424edf['push'](_0x424edf['shift']());}};_0xe9b044(++_0x184352);}(_0x8ecb,0x199));var _0xb8ec=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x8ecb[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0xb8ec('0x0'));var _=require(_0xb8ec('0x1'));var util=require(_0xb8ec('0x2'));module[_0xb8ec('0x3')]={'name':{'type':Sequelize[_0xb8ec('0x4')],'unique':_0xb8ec('0x5')},'description':{'type':Sequelize[_0xb8ec('0x4')]},'formData':{'type':Sequelize['TEXT'](_0xb8ec('0x6')),'set':function(_0x2a3256){if(_[_0xb8ec('0x7')](_0x2a3256)){this[_0xb8ec('0x8')](_0xb8ec('0x9'),JSON[_0xb8ec('0xa')](_0x2a3256));}else if(_[_0xb8ec('0xb')](_0x2a3256)){this[_0xb8ec('0x8')]('formData',_0x2a3256);}else{this[_0xb8ec('0x8')](_0xb8ec('0x9'),util[_0xb8ec('0xc')](_0xb8ec('0xd'),this[_0xb8ec('0xe')](_0xb8ec('0x5'))||'',this[_0xb8ec('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xb8ec('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 0472998..8411efd 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 _0x1794=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','JscriptyProject','includeAll','findAll','show','params','rawAttributes','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','clone','omit','createdAt','updatedAt','body','getSessions','findOne','JscriptySessionReport','filter','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','parse','-createdAt','questionId','question','SessionId','answer','push','isEmpty','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','end','error','stack','name','index','map','fieldName','type','model','query'];(function(_0x44db60,_0x4ec8ca){var _0x3fa929=function(_0x5800a6){while(--_0x5800a6){_0x44db60['push'](_0x44db60['shift']());}};_0x3fa929(++_0x4ec8ca);}(_0x1794,0x19d));var _0x4179=function(_0x337a40,_0x77957c){_0x337a40=_0x337a40-0x0;var _0x1a18bb=_0x1794[_0x337a40];return _0x1a18bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4179('0x0'));var jsonpatch=require(_0x4179('0x1'));var rp=require(_0x4179('0x2'));var moment=require(_0x4179('0x3'));var BPromise=require(_0x4179('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4179('0x5'));var sox=require(_0x4179('0x6'));var csv=require(_0x4179('0x7'));var ejs=require(_0x4179('0x8'));var fs=require('fs');var fs_extra=require(_0x4179('0x9'));var _=require(_0x4179('0xa'));var squel=require(_0x4179('0xb'));var crypto=require(_0x4179('0xc'));var jsforce=require(_0x4179('0xd'));var deskjs=require(_0x4179('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4179('0xf'));var Papa=require(_0x4179('0x10'));var Redis=require(_0x4179('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4179('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4179('0x13'));var logger=require('../../config/logger')(_0x4179('0x14'));var utils=require('../../config/utils');var config=require(_0x4179('0x15'));var licenseUtil=require(_0x4179('0x16'));var db=require(_0x4179('0x17'))['db'];function respondWithStatusCode(_0x5c32df,_0x2b26f1){_0x2b26f1=_0x2b26f1||0xcc;return function(_0x5f49e1){if(_0x5f49e1){return _0x5c32df[_0x4179('0x18')](_0x2b26f1);}return _0x5c32df[_0x4179('0x19')](_0x2b26f1)['end']();};}function respondWithResult(_0x20d964,_0x2f6cbc){_0x2f6cbc=_0x2f6cbc||0xc8;return function(_0x47e478){if(_0x47e478){return _0x20d964[_0x4179('0x19')](_0x2f6cbc)[_0x4179('0x1a')](_0x47e478);}};}function respondWithFilteredResult(_0x1faf45,_0x1c6ea4){return function(_0x1b0d10){if(_0x1b0d10){var _0xd43eba=typeof _0x1c6ea4[_0x4179('0x1b')]===_0x4179('0x1c')&&typeof _0x1c6ea4[_0x4179('0x1d')]===_0x4179('0x1c');var _0x1f8bdd=_0x1b0d10[_0x4179('0x1e')];var _0x17c4ef=_0xd43eba?0x0:_0x1c6ea4[_0x4179('0x1b')];var _0x5e2e25=_0xd43eba?_0x1b0d10[_0x4179('0x1e')]:_0x1c6ea4['offset']+_0x1c6ea4[_0x4179('0x1d')];var _0x5d496b;if(_0x5e2e25>=_0x1f8bdd){_0x5e2e25=_0x1f8bdd;_0x5d496b=0xc8;}else{_0x5d496b=0xce;}_0x1faf45[_0x4179('0x19')](_0x5d496b);return _0x1faf45[_0x4179('0x1f')]('Content-Range',_0x17c4ef+'-'+_0x5e2e25+'/'+_0x1f8bdd)['json'](_0x1b0d10);}return null;};}function patchUpdates(_0x3d3264){return function(_0x434225){try{jsonpatch[_0x4179('0x20')](_0x434225,_0x3d3264,!![]);}catch(_0x466ff5){return BPromise[_0x4179('0x21')](_0x466ff5);}return _0x434225[_0x4179('0x22')]();};}function saveUpdates(_0x3b9b2b,_0x10aaff){return function(_0x34f243){if(_0x34f243){return _0x34f243[_0x4179('0x23')](_0x3b9b2b)[_0x4179('0x24')](function(_0x533a2f){return _0x533a2f;});}return null;};}function removeEntity(_0x5b26b4,_0x166f25){return function(_0x46e8d1){if(_0x46e8d1){return _0x46e8d1[_0x4179('0x25')]()[_0x4179('0x24')](function(){var _0x26ab63=_0x46e8d1[_0x4179('0x26')]({'plain':!![]});var _0x5b0324=_0x4179('0x27');return db[_0x4179('0x28')][_0x4179('0x25')]({'where':{'type':_0x5b0324,'resourceId':_0x26ab63['id']}})[_0x4179('0x24')](function(){return _0x46e8d1;});})['then'](function(){_0x5b26b4[_0x4179('0x19')](0xcc)[_0x4179('0x29')]();});}};}function handleEntityNotFound(_0x230f53,_0x2317c9){return function(_0x18e558){if(!_0x18e558){_0x230f53[_0x4179('0x18')](0x194);}return _0x18e558;};}function handleError(_0x2da56f,_0x4de2ec){_0x4de2ec=_0x4de2ec||0x1f4;return function(_0x5cbfb2){logger[_0x4179('0x2a')](_0x5cbfb2[_0x4179('0x2b')]);if(_0x5cbfb2['name']){delete _0x5cbfb2[_0x4179('0x2c')];}_0x2da56f['status'](_0x4de2ec)['send'](_0x5cbfb2);};}exports[_0x4179('0x2d')]=function(_0xd28fe3,_0x749301){var _0x36a924={},_0x194fd2={},_0x50c4b7={'count':0x0,'rows':[]};var _0x479762=_[_0x4179('0x2e')](db['JscriptyProject']['rawAttributes'],function(_0x85824a){return{'name':_0x85824a[_0x4179('0x2f')],'type':_0x85824a[_0x4179('0x30')]['key']};});_0x194fd2[_0x4179('0x31')]=_[_0x4179('0x2e')](_0x479762,'name');_0x194fd2[_0x4179('0x32')]=_['keys'](_0xd28fe3[_0x4179('0x32')]);_0x194fd2[_0x4179('0x33')]=_['intersection'](_0x194fd2[_0x4179('0x31')],_0x194fd2[_0x4179('0x32')]);_0x36a924[_0x4179('0x34')]=_[_0x4179('0x35')](_0x194fd2[_0x4179('0x31')],qs[_0x4179('0x36')](_0xd28fe3[_0x4179('0x32')]['fields']));_0x36a924['attributes']=_0x36a924[_0x4179('0x34')][_0x4179('0x37')]?_0x36a924['attributes']:_0x194fd2[_0x4179('0x31')];if(!_0xd28fe3[_0x4179('0x32')][_0x4179('0x38')](_0x4179('0x39'))){_0x36a924[_0x4179('0x1d')]=qs['limit'](_0xd28fe3[_0x4179('0x32')][_0x4179('0x1d')]);_0x36a924[_0x4179('0x1b')]=qs['offset'](_0xd28fe3['query'][_0x4179('0x1b')]);}_0x36a924[_0x4179('0x3a')]=qs[_0x4179('0x3b')](_0xd28fe3[_0x4179('0x32')][_0x4179('0x3b')]);_0x36a924['where']=qs['filters'](_[_0x4179('0x3c')](_0xd28fe3[_0x4179('0x32')],_0x194fd2[_0x4179('0x33')]),_0x479762);if(_0xd28fe3[_0x4179('0x32')]['filter']){_0x36a924[_0x4179('0x3d')]=_['merge'](_0x36a924[_0x4179('0x3d')],{'$or':_['map'](_0x479762,function(_0x58b99e){if(_0x58b99e['type']!==_0x4179('0x3e')){var _0x1c1ec2={};_0x1c1ec2[_0x58b99e[_0x4179('0x2c')]]={'$like':'%'+_0xd28fe3[_0x4179('0x32')]['filter']+'%'};return _0x1c1ec2;}})});}_0x36a924=_[_0x4179('0x3f')]({},_0x36a924,_0xd28fe3[_0x4179('0x40')]);var _0x373e5f={'where':_0x36a924[_0x4179('0x3d')]};return db[_0x4179('0x41')]['count'](_0x373e5f)[_0x4179('0x24')](function(_0x13f93e){_0x50c4b7['count']=_0x13f93e;if(_0xd28fe3[_0x4179('0x32')][_0x4179('0x42')]){_0x36a924['include']=[{'all':!![]}];}return db[_0x4179('0x41')][_0x4179('0x43')](_0x36a924);})['then'](function(_0x69621d){_0x50c4b7['rows']=_0x69621d;return _0x50c4b7;})['then'](respondWithFilteredResult(_0x749301,_0x36a924))['catch'](handleError(_0x749301,null));};exports[_0x4179('0x44')]=function(_0x4b6741,_0x5eba40){var _0x12a4fc={'raw':![],'where':{'id':_0x4b6741[_0x4179('0x45')]['id']}},_0xb37653={};_0xb37653['model']=_['keys'](db['JscriptyProject'][_0x4179('0x46')]);_0xb37653['query']=_[_0x4179('0x47')](_0x4b6741['query']);_0xb37653[_0x4179('0x33')]=_[_0x4179('0x35')](_0xb37653[_0x4179('0x31')],_0xb37653[_0x4179('0x32')]);_0x12a4fc[_0x4179('0x34')]=_[_0x4179('0x35')](_0xb37653['model'],qs[_0x4179('0x36')](_0x4b6741[_0x4179('0x32')][_0x4179('0x36')]));_0x12a4fc[_0x4179('0x34')]=_0x12a4fc[_0x4179('0x34')]['length']?_0x12a4fc['attributes']:_0xb37653['model'];if(_0x4b6741[_0x4179('0x32')][_0x4179('0x42')]){_0x12a4fc[_0x4179('0x48')]=[{'all':!![]}];}_0x12a4fc=_[_0x4179('0x3f')]({},_0x12a4fc,_0x4b6741[_0x4179('0x40')]);return db[_0x4179('0x41')][_0x4179('0x49')](_0x12a4fc)[_0x4179('0x24')](handleEntityNotFound(_0x5eba40,null))[_0x4179('0x24')](respondWithResult(_0x5eba40,null))['catch'](handleError(_0x5eba40,null));};exports[_0x4179('0x4a')]=function(_0x393842,_0xaa6f0){return db['JscriptyProject'][_0x4179('0x4a')](_0x393842['body'],{})[_0x4179('0x24')](function(_0x5676cc){var _0x5e70f1=_0x393842[_0x4179('0x4b')][_0x4179('0x26')]({'plain':!![]});if(!_0x5e70f1)throw new Error(_0x4179('0x4c'));if(_0x5e70f1[_0x4179('0x4d')]===_0x4179('0x4b')){var _0xbea7cf=_0x5676cc[_0x4179('0x26')]({'plain':!![]});var _0x3ff071=_0x4179('0x27');return db[_0x4179('0x4e')]['find']({'where':{'name':_0x3ff071,'userProfileId':_0x5e70f1[_0x4179('0x4f')]},'raw':!![]})[_0x4179('0x24')](function(_0x150eed){if(_0x150eed&&_0x150eed[_0x4179('0x50')]===0x0){return db[_0x4179('0x28')][_0x4179('0x4a')]({'name':_0xbea7cf['name'],'resourceId':_0xbea7cf['id'],'type':_0x150eed[_0x4179('0x2c')],'sectionId':_0x150eed['id']},{})[_0x4179('0x24')](function(){return _0x5676cc;});}else{return _0x5676cc;}})[_0x4179('0x51')](function(_0x54fd66){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54fd66);throw _0x54fd66;});}return _0x5676cc;})[_0x4179('0x24')](respondWithResult(_0xaa6f0,0xc9))[_0x4179('0x51')](handleError(_0xaa6f0,null));};exports[_0x4179('0x52')]=function(_0x599e30,_0xb38b69){var _0x389dfd={'where':{'id':_0x599e30[_0x4179('0x45')]['id']}},_0x440a39={};_0x440a39[_0x4179('0x31')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x389dfd['attributes']=_[_0x4179('0x35')](_0x440a39[_0x4179('0x31')],qs[_0x4179('0x36')](_0x599e30[_0x4179('0x32')]['fields']));_0x389dfd[_0x4179('0x34')]=_0x389dfd[_0x4179('0x34')][_0x4179('0x37')]?_0x389dfd[_0x4179('0x34')]:_0x440a39[_0x4179('0x31')];if(_0x599e30[_0x4179('0x32')]['includeAll']){_0x389dfd['include']=[{'all':!![]}];}_0x389dfd=_[_0x4179('0x3f')]({},_0x389dfd,_0x599e30[_0x4179('0x40')]);return db[_0x4179('0x41')][_0x4179('0x49')](_0x389dfd)[_0x4179('0x24')](handleEntityNotFound(_0xb38b69,null))[_0x4179('0x24')](function(_0x32b80d){if(_0x32b80d){var _0x520b4f=_0x32b80d[_0x4179('0x26')]({'plain':!![]});_0x520b4f=qs[_0x4179('0x53')](_0x520b4f,['id',_0x4179('0x54'),_0x4179('0x55')]);_0x599e30['body']=_[_0x4179('0x53')](_0x599e30['body'],['id',_0x4179('0x54'),_0x4179('0x55')]);return db[_0x4179('0x41')][_0x4179('0x4a')](_[_0x4179('0x3f')](_0x520b4f,_0x599e30[_0x4179('0x56')]),{'include':_0x599e30[_0x4179('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x4179('0x24')](function(_0xd7284f){var _0x117999=_0x599e30[_0x4179('0x4b')][_0x4179('0x26')]({'plain':!![]});if(!_0x117999)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x117999[_0x4179('0x4d')]===_0x4179('0x4b')){var _0xde872c=_0xd7284f[_0x4179('0x26')]({'plain':!![]});var _0x18468a=_0x4179('0x27');return db[_0x4179('0x4e')]['find']({'where':{'name':_0x18468a,'userProfileId':_0x117999[_0x4179('0x4f')]},'raw':!![]})[_0x4179('0x24')](function(_0x3baecf){if(_0x3baecf&&_0x3baecf[_0x4179('0x50')]===0x0){return db[_0x4179('0x28')][_0x4179('0x4a')]({'name':_0xde872c[_0x4179('0x2c')],'resourceId':_0xde872c['id'],'type':_0x3baecf[_0x4179('0x2c')],'sectionId':_0x3baecf['id']},{})['then'](function(){return _0xd7284f;});}else{return _0xd7284f;}})[_0x4179('0x51')](function(_0x4efc05){logger[_0x4179('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4efc05);throw _0x4efc05;});}return _0xd7284f;});}})[_0x4179('0x24')](respondWithResult(_0xb38b69,0xc9))['catch'](handleError(_0xb38b69,null));};exports[_0x4179('0x23')]=function(_0x25ea28,_0x4ab990){if(_0x25ea28[_0x4179('0x56')]['id']){delete _0x25ea28[_0x4179('0x56')]['id'];}return db[_0x4179('0x41')][_0x4179('0x49')]({'where':{'id':_0x25ea28['params']['id']}})['then'](handleEntityNotFound(_0x4ab990,null))[_0x4179('0x24')](saveUpdates(_0x25ea28[_0x4179('0x56')],null))[_0x4179('0x24')](respondWithResult(_0x4ab990,null))[_0x4179('0x51')](handleError(_0x4ab990,null));};exports['destroy']=function(_0x2abdf4,_0x5b889e){return db[_0x4179('0x41')][_0x4179('0x49')]({'where':{'id':_0x2abdf4[_0x4179('0x45')]['id']}})[_0x4179('0x24')](handleEntityNotFound(_0x5b889e,null))[_0x4179('0x24')](removeEntity(_0x5b889e,null))['catch'](handleError(_0x5b889e,null));};exports[_0x4179('0x57')]=function(_0x2ec342,_0x256387,_0xe273de){var _0x15bc5f={'raw':!![],'where':{}};var _0x4456e4={};var _0x1e8181={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4179('0x58')]({'where':{'id':_0x2ec342[_0x4179('0x45')]['id']}})[_0x4179('0x24')](handleEntityNotFound(_0x256387,null))[_0x4179('0x24')](function(_0x23f2e8){if(_0x23f2e8){_0x4456e4[_0x4179('0x31')]=_[_0x4179('0x47')](db[_0x4179('0x59')][_0x4179('0x46')]);_0x4456e4[_0x4179('0x32')]=_['keys'](_0x2ec342[_0x4179('0x32')]);_0x4456e4[_0x4179('0x33')]=_[_0x4179('0x35')](_0x4456e4[_0x4179('0x31')],_0x4456e4[_0x4179('0x32')]);_0x15bc5f[_0x4179('0x34')]=_[_0x4179('0x35')](_0x4456e4[_0x4179('0x31')],qs[_0x4179('0x36')](_0x2ec342[_0x4179('0x32')]['fields']));_0x15bc5f[_0x4179('0x34')]=_0x15bc5f[_0x4179('0x34')]['length']?_0x15bc5f[_0x4179('0x34')]:_0x4456e4['model'];if(!_0x2ec342[_0x4179('0x32')][_0x4179('0x38')]('nolimit')){_0x15bc5f[_0x4179('0x1d')]=qs['limit'](_0x2ec342[_0x4179('0x32')][_0x4179('0x1d')]);_0x15bc5f[_0x4179('0x1b')]=qs[_0x4179('0x1b')](_0x2ec342[_0x4179('0x32')][_0x4179('0x1b')]);}_0x15bc5f[_0x4179('0x3a')]=qs[_0x4179('0x3b')](_0x2ec342[_0x4179('0x32')][_0x4179('0x3b')]);_0x15bc5f[_0x4179('0x3d')]=qs[_0x4179('0x33')](_[_0x4179('0x3c')](_0x2ec342[_0x4179('0x32')],_0x4456e4[_0x4179('0x33')]));_0x15bc5f[_0x4179('0x3d')]['ProjectId']=_0x23f2e8['id'];if(_0x2ec342[_0x4179('0x32')][_0x4179('0x5a')]){_0x15bc5f[_0x4179('0x3d')]=_[_0x4179('0x3f')](_0x15bc5f['where'],{'$or':_['map'](_0x15bc5f['attributes'],function(_0x43cb1a){var _0x4b4f1e={};_0x4b4f1e[_0x43cb1a]={'$like':'%'+_0x2ec342[_0x4179('0x32')][_0x4179('0x5a')]+'%'};return _0x4b4f1e;})});}_0x15bc5f=_[_0x4179('0x3f')]({},_0x15bc5f,_0x2ec342[_0x4179('0x40')]);return db['JscriptySessionReport']['count']({'where':_0x15bc5f[_0x4179('0x3d')]})[_0x4179('0x24')](function(_0x618bb9){_0x1e8181['count']=_0x618bb9;if(_0x2ec342[_0x4179('0x32')][_0x4179('0x42')]){_0x15bc5f[_0x4179('0x48')]=[{'all':!![]}];}return db[_0x4179('0x59')][_0x4179('0x43')](_0x15bc5f);})[_0x4179('0x24')](function(_0x2c725d){_0x1e8181['rows']=_0x2c725d;return _0x1e8181;});}})[_0x4179('0x24')](respondWithFilteredResult(_0x256387,_0x15bc5f))['catch'](handleError(_0x256387,null));};exports['getAnswers']=function(_0x5cbfef,_0x29c684,_0x10b2ab){var _0x1abc3e={'raw':!![],'where':{}};var _0x1d46da={};var _0x2bea65={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4179('0x58')]({'where':{'id':_0x5cbfef[_0x4179('0x45')]['id']}})['then'](handleEntityNotFound(_0x29c684,null))['then'](function(_0x51f724){if(_0x51f724){_0x1d46da['model']=_[_0x4179('0x47')](db[_0x4179('0x5b')][_0x4179('0x46')]);_0x1d46da[_0x4179('0x32')]=_[_0x4179('0x47')](_0x5cbfef[_0x4179('0x32')]);_0x1d46da[_0x4179('0x33')]=_['intersection'](_0x1d46da['model'],_0x1d46da['query']);_0x1abc3e['attributes']=_[_0x4179('0x35')](_0x1d46da[_0x4179('0x31')],qs[_0x4179('0x36')](_0x5cbfef[_0x4179('0x32')][_0x4179('0x36')]));_0x1abc3e[_0x4179('0x34')]=_0x1abc3e[_0x4179('0x34')][_0x4179('0x37')]?_0x1abc3e[_0x4179('0x34')]:_0x1d46da['model'];if(!_0x5cbfef['query'][_0x4179('0x38')](_0x4179('0x39'))){_0x1abc3e[_0x4179('0x1d')]=qs[_0x4179('0x1d')](_0x5cbfef['query'][_0x4179('0x1d')]);_0x1abc3e[_0x4179('0x1b')]=qs[_0x4179('0x1b')](_0x5cbfef[_0x4179('0x32')][_0x4179('0x1b')]);}_0x1abc3e[_0x4179('0x3a')]=qs[_0x4179('0x3b')](_0x5cbfef['query'][_0x4179('0x3b')]);_0x1abc3e[_0x4179('0x3d')]=qs[_0x4179('0x33')](_[_0x4179('0x3c')](_0x5cbfef['query'],_0x1d46da[_0x4179('0x33')]));_0x1abc3e['where'][_0x4179('0x5c')]=_0x51f724['id'];if(_0x5cbfef[_0x4179('0x32')]['filter']){_0x1abc3e[_0x4179('0x3d')]=_[_0x4179('0x3f')](_0x1abc3e['where'],{'$or':_['map'](_0x1abc3e[_0x4179('0x34')],function(_0x4ef28f){var _0x26cfa9={};_0x26cfa9[_0x4ef28f]={'$like':'%'+_0x5cbfef[_0x4179('0x32')][_0x4179('0x5a')]+'%'};return _0x26cfa9;})});}_0x1abc3e=_['merge']({},_0x1abc3e,_0x5cbfef['options']);return db[_0x4179('0x5b')][_0x4179('0x1e')]({'where':_0x1abc3e[_0x4179('0x3d')]})[_0x4179('0x24')](function(_0xd67c4b){_0x2bea65[_0x4179('0x1e')]=_0xd67c4b;if(_0x5cbfef['query'][_0x4179('0x42')]){_0x1abc3e[_0x4179('0x48')]=[{'all':!![]}];}return db[_0x4179('0x5b')][_0x4179('0x43')](_0x1abc3e);})['then'](function(_0x51509b){_0x2bea65['rows']=_0x51509b;return _0x2bea65;});}})[_0x4179('0x24')](respondWithFilteredResult(_0x29c684,_0x1abc3e))['catch'](handleError(_0x29c684,null));};function char(_0x5041d2){return _0x4179('0x5d')===typeof _0x5041d2?String[_0x4179('0x5e')][_0x4179('0x20')](null,arguments):_0x5041d2;}function needsEncapsulation(_0x387bd6){return!!_0x387bd6&&(_0x387bd6[_0x4179('0x5f')]()[_0x4179('0x60')](char(0xd))>=0x0||_0x387bd6[_0x4179('0x5f')]()[_0x4179('0x60')](char(0xa))>=0x0||_0x387bd6[_0x4179('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x387bd6['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x2d4407){var _0x1a6b4f=char(0x22),_0x29b2b6='\x5c'+char(0x22),_0x3b2bdf=_0x2d4407['toString']()['replace'](new RegExp(_0x1a6b4f,'g'),_0x29b2b6);return _0x1a6b4f+_0x3b2bdf+_0x1a6b4f;}exports[_0x4179('0x61')]=function(_0x4e9444,_0x590a80,_0x79dd85){var _0x3401cf,_0x22e364;var _0x1388a1={'where':{'ProjectId':_0x4e9444[_0x4179('0x45')]['id']}};if(_0x4e9444[_0x4179('0x32')][_0x4179('0x62')]){_0x1388a1['where'][_0x4179('0x63')]=JSON[_0x4179('0x64')](_0x4e9444['query'][_0x4179('0x62')]);}return db[_0x4179('0x59')]['findAll'](_0x1388a1)[_0x4179('0x24')](handleEntityNotFound(_0x590a80,null))[_0x4179('0x24')](function(_0x39bb70){if(_0x39bb70){_0x3401cf=_0x39bb70;return db['JscriptyQuestionReport'][_0x4179('0x43')]({'where':{'SessionId':{'$in':_[_0x4179('0x2e')](_0x3401cf,'id')},'ProjectId':_0x4e9444['params']['id']},'order':_0x4179('0x65')});}})['then'](handleEntityNotFound(_0x590a80,null))[_0x4179('0x24')](function(_0x484cb1){if(_0x484cb1){_0x22e364=_0x484cb1;var _0xccb748={};for(var _0x22f868=0x0,_0x36d014=_0x22e364[_0x4179('0x37')];_0x22f868<_0x36d014;_0x22f868++){if(!_0xccb748['hasOwnProperty'](_0x22e364[_0x22f868][_0x4179('0x66')])){_0xccb748[_0x22e364[_0x22f868]['questionId']]=needsEncapsulation(_0x22e364[_0x22f868][_0x4179('0x67')])?encapsulate(_0x22e364[_0x22f868][_0x4179('0x67')]):_0x22e364[_0x22f868][_0x4179('0x67')];}}var _0x22724f=[],_0x3a036e={};for(var _0x1a746a=0x0,_0x7dd3a9=_0x3401cf[_0x4179('0x37')];_0x1a746a<_0x7dd3a9;_0x1a746a++){_0x3a036e={'ProjectId':_0x4e9444[_0x4179('0x45')]['id'],'SessionId':_0x3401cf[_0x1a746a]['id'],'StartTime':moment(_0x3401cf[_0x1a746a][_0x4179('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x32cb7f=0x0,_0x1782ee=_0x22e364['length'];_0x32cb7f<_0x1782ee;_0x32cb7f++){if(_0x22e364[_0x32cb7f][_0x4179('0x68')]==_0x3401cf[_0x1a746a]['id']&&_0xccb748[_0x4179('0x38')](_0x22e364[_0x32cb7f]['questionId'])){_0x3a036e[_0xccb748[_0x22e364[_0x32cb7f][_0x4179('0x66')]]]=_0x22e364[_0x32cb7f][_0x4179('0x69')];}}for(var _0x2877cb in _0xccb748){if(!_0x3a036e['hasOwnProperty'](_0xccb748[_0x2877cb])){_0x3a036e[_0xccb748[_0x2877cb]]=null;}}_0x22724f[_0x4179('0x6a')](_0x3a036e);}return _0x22724f;}})['then'](function(_0x283d5c){if(!_[_0x4179('0x6b')](_0x283d5c)){var _0x32ff0f=toCsv(_0x283d5c);var _0x21442b=Date['now']();fs['writeFileSync'](util[_0x4179('0x6c')](_0x4179('0x6d'),_0x4e9444['params']['id'],_0x21442b),_0x32ff0f);_0x590a80[_0x4179('0x6e')]('Content-disposition',_0x4179('0x6f')+util[_0x4179('0x6c')](_0x4179('0x70'),_0x4e9444['params']['id'],_0x21442b));_0x590a80['setHeader'](_0x4179('0x71'),_0x4179('0x72'));return _0x590a80[_0x4179('0x73')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4e9444[_0x4179('0x45')]['id'],_0x21442b));}else{return _0x590a80[_0x4179('0x18')](0xcc);}})[_0x4179('0x51')](handleError(_0x590a80,null));}; \ No newline at end of file +var _0xd7ab=['download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','include','findAll','catch','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','length','includeAll','omit','updatedAt','body','createdAt','userProfileId','update','getSessions','findOne','JscriptySessionReport','rows','JscriptyAnswerReport','fromCharCode','indexOf','toString','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xd7ab,0x14e));var _0xbd7a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd7ab[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xbd7a('0x0'));var rimraf=require(_0xbd7a('0x1'));var zipdir=require(_0xbd7a('0x2'));var jsonpatch=require(_0xbd7a('0x3'));var rp=require(_0xbd7a('0x4'));var moment=require(_0xbd7a('0x5'));var BPromise=require(_0xbd7a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbd7a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd7a('0x8'));var _=require(_0xbd7a('0x9'));var squel=require(_0xbd7a('0xa'));var crypto=require('crypto');var jsforce=require(_0xbd7a('0xb'));var deskjs=require(_0xbd7a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbd7a('0xd'));var Papa=require('papaparse');var Redis=require(_0xbd7a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbd7a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbd7a('0x10'));var utils=require(_0xbd7a('0x11'));var config=require(_0xbd7a('0x12'));var licenseUtil=require(_0xbd7a('0x13'));var db=require(_0xbd7a('0x14'))['db'];function respondWithStatusCode(_0x5aaa2d,_0x2133eb){_0x2133eb=_0x2133eb||0xcc;return function(_0x5393ee){if(_0x5393ee){return _0x5aaa2d[_0xbd7a('0x15')](_0x2133eb);}return _0x5aaa2d[_0xbd7a('0x16')](_0x2133eb)[_0xbd7a('0x17')]();};}function respondWithResult(_0x354119,_0x2b3731){_0x2b3731=_0x2b3731||0xc8;return function(_0x427a93){if(_0x427a93){return _0x354119['status'](_0x2b3731)[_0xbd7a('0x18')](_0x427a93);}};}function respondWithFilteredResult(_0x59dd24,_0x301b95){return function(_0x520d5a){if(_0x520d5a){var _0x3fb8f4=typeof _0x301b95[_0xbd7a('0x19')]===_0xbd7a('0x1a')&&typeof _0x301b95[_0xbd7a('0x1b')]===_0xbd7a('0x1a');var _0x123be5=_0x520d5a[_0xbd7a('0x1c')];var _0x5b063a=_0x3fb8f4?0x0:_0x301b95['offset'];var _0x5a71eb=_0x3fb8f4?_0x520d5a[_0xbd7a('0x1c')]:_0x301b95[_0xbd7a('0x19')]+_0x301b95['limit'];var _0x340229;if(_0x5a71eb>=_0x123be5){_0x5a71eb=_0x123be5;_0x340229=0xc8;}else{_0x340229=0xce;}_0x59dd24[_0xbd7a('0x16')](_0x340229);return _0x59dd24[_0xbd7a('0x1d')](_0xbd7a('0x1e'),_0x5b063a+'-'+_0x5a71eb+'/'+_0x123be5)[_0xbd7a('0x18')](_0x520d5a);}return null;};}function patchUpdates(_0x2d6e2f){return function(_0x16bbb5){try{jsonpatch[_0xbd7a('0x1f')](_0x16bbb5,_0x2d6e2f,!![]);}catch(_0x3fbe95){return BPromise['reject'](_0x3fbe95);}return _0x16bbb5[_0xbd7a('0x20')]();};}function saveUpdates(_0x5ad9c6,_0x4b2842){return function(_0x5d5918){if(_0x5d5918){return _0x5d5918['update'](_0x5ad9c6)[_0xbd7a('0x21')](function(_0x1d53b0){return _0x1d53b0;});}return null;};}function removeEntity(_0x2650a0,_0x3b2e24){return function(_0x16a97b){if(_0x16a97b){return _0x16a97b[_0xbd7a('0x22')]()['then'](function(){var _0x1e5ad6=_0x16a97b[_0xbd7a('0x23')]({'plain':!![]});var _0x1a15c='Projects';return db[_0xbd7a('0x24')]['destroy']({'where':{'type':_0x1a15c,'resourceId':_0x1e5ad6['id']}})[_0xbd7a('0x21')](function(){return _0x16a97b;});})['then'](function(){_0x2650a0[_0xbd7a('0x16')](0xcc)[_0xbd7a('0x17')]();});}};}function handleEntityNotFound(_0x5d4558,_0x2eb44c){return function(_0x8ce570){if(!_0x8ce570){_0x5d4558[_0xbd7a('0x15')](0x194);}return _0x8ce570;};}function handleError(_0x4e551d,_0x335520){_0x335520=_0x335520||0x1f4;return function(_0x33f0b7){logger[_0xbd7a('0x25')](_0x33f0b7['stack']);if(_0x33f0b7[_0xbd7a('0x26')]){delete _0x33f0b7[_0xbd7a('0x26')];}_0x4e551d['status'](_0x335520)[_0xbd7a('0x27')](_0x33f0b7);};}exports[_0xbd7a('0x28')]=function(_0x269c15,_0x449266){var _0x2a5d2={},_0x1d89d6={},_0x31ae4e={'count':0x0,'rows':[]};var _0x42bcf9=_[_0xbd7a('0x29')](db[_0xbd7a('0x2a')][_0xbd7a('0x2b')],function(_0x4443bd){return{'name':_0x4443bd[_0xbd7a('0x2c')],'type':_0x4443bd[_0xbd7a('0x2d')][_0xbd7a('0x2e')]};});_0x1d89d6[_0xbd7a('0x2f')]=_[_0xbd7a('0x29')](_0x42bcf9,'name');_0x1d89d6[_0xbd7a('0x30')]=_[_0xbd7a('0x31')](_0x269c15[_0xbd7a('0x30')]);_0x1d89d6[_0xbd7a('0x32')]=_[_0xbd7a('0x33')](_0x1d89d6['model'],_0x1d89d6[_0xbd7a('0x30')]);_0x2a5d2[_0xbd7a('0x34')]=_[_0xbd7a('0x33')](_0x1d89d6['model'],qs[_0xbd7a('0x35')](_0x269c15['query'][_0xbd7a('0x35')]));_0x2a5d2[_0xbd7a('0x34')]=_0x2a5d2[_0xbd7a('0x34')]['length']?_0x2a5d2['attributes']:_0x1d89d6[_0xbd7a('0x2f')];if(!_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x36')](_0xbd7a('0x37'))){_0x2a5d2[_0xbd7a('0x1b')]=qs[_0xbd7a('0x1b')](_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x1b')]);_0x2a5d2[_0xbd7a('0x19')]=qs[_0xbd7a('0x19')](_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x19')]);}_0x2a5d2[_0xbd7a('0x38')]=qs[_0xbd7a('0x39')](_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x39')]);_0x2a5d2['where']=qs[_0xbd7a('0x32')](_[_0xbd7a('0x3a')](_0x269c15[_0xbd7a('0x30')],_0x1d89d6['filters']),_0x42bcf9);if(_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x3b')]){_0x2a5d2['where']=_[_0xbd7a('0x3c')](_0x2a5d2[_0xbd7a('0x3d')],{'$or':_[_0xbd7a('0x29')](_0x42bcf9,function(_0x5cb8ca){if(_0x5cb8ca[_0xbd7a('0x2d')]!=='VIRTUAL'){var _0x2576ed={};_0x2576ed[_0x5cb8ca[_0xbd7a('0x26')]]={'$like':'%'+_0x269c15[_0xbd7a('0x30')][_0xbd7a('0x3b')]+'%'};return _0x2576ed;}})});}_0x2a5d2=_[_0xbd7a('0x3c')]({},_0x2a5d2,_0x269c15['options']);var _0x162dd8={'where':_0x2a5d2[_0xbd7a('0x3d')]};return db[_0xbd7a('0x2a')]['count'](_0x162dd8)['then'](function(_0x4a65d5){_0x31ae4e[_0xbd7a('0x1c')]=_0x4a65d5;if(_0x269c15[_0xbd7a('0x30')]['includeAll']){_0x2a5d2[_0xbd7a('0x3e')]=[{'all':!![]}];}return db[_0xbd7a('0x2a')][_0xbd7a('0x3f')](_0x2a5d2);})[_0xbd7a('0x21')](function(_0x4748d1){_0x31ae4e['rows']=_0x4748d1;return _0x31ae4e;})[_0xbd7a('0x21')](respondWithFilteredResult(_0x449266,_0x2a5d2))[_0xbd7a('0x40')](handleError(_0x449266,null));};exports['show']=function(_0x12467f,_0x9394e5){var _0x17617c={'raw':![],'where':{'id':_0x12467f['params']['id']}},_0x42ba39={};_0x42ba39[_0xbd7a('0x2f')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x42ba39[_0xbd7a('0x30')]=_[_0xbd7a('0x31')](_0x12467f['query']);_0x42ba39[_0xbd7a('0x32')]=_['intersection'](_0x42ba39[_0xbd7a('0x2f')],_0x42ba39[_0xbd7a('0x30')]);_0x17617c[_0xbd7a('0x34')]=_[_0xbd7a('0x33')](_0x42ba39[_0xbd7a('0x2f')],qs[_0xbd7a('0x35')](_0x12467f[_0xbd7a('0x30')][_0xbd7a('0x35')]));_0x17617c[_0xbd7a('0x34')]=_0x17617c[_0xbd7a('0x34')]['length']?_0x17617c[_0xbd7a('0x34')]:_0x42ba39[_0xbd7a('0x2f')];if(_0x12467f['query']['includeAll']){_0x17617c[_0xbd7a('0x3e')]=[{'all':!![]}];}_0x17617c=_[_0xbd7a('0x3c')]({},_0x17617c,_0x12467f[_0xbd7a('0x41')]);return db[_0xbd7a('0x2a')][_0xbd7a('0x42')](_0x17617c)[_0xbd7a('0x21')](handleEntityNotFound(_0x9394e5,null))[_0xbd7a('0x21')](respondWithResult(_0x9394e5,null))[_0xbd7a('0x40')](handleError(_0x9394e5,null));};exports[_0xbd7a('0x43')]=function(_0x526ce5,_0x2a08a1){return db['JscriptyProject']['create'](_0x526ce5['body'],{})[_0xbd7a('0x21')](function(_0x4d9fee){var _0x1b3a57=_0x526ce5[_0xbd7a('0x44')]['get']({'plain':!![]});if(!_0x1b3a57)throw new Error(_0xbd7a('0x45'));if(_0x1b3a57[_0xbd7a('0x46')]==='user'){var _0x455acc=_0x4d9fee[_0xbd7a('0x23')]({'plain':!![]});var _0x4de29b='Projects';return db[_0xbd7a('0x47')]['find']({'where':{'name':_0x4de29b,'userProfileId':_0x1b3a57['userProfileId']},'raw':!![]})[_0xbd7a('0x21')](function(_0x186e3f){if(_0x186e3f&&_0x186e3f[_0xbd7a('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x455acc['name'],'resourceId':_0x455acc['id'],'type':_0x186e3f[_0xbd7a('0x26')],'sectionId':_0x186e3f['id']},{})['then'](function(){return _0x4d9fee;});}else{return _0x4d9fee;}})[_0xbd7a('0x40')](function(_0x2af4cd){logger[_0xbd7a('0x25')](_0xbd7a('0x49'),_0x2af4cd);throw _0x2af4cd;});}return _0x4d9fee;})[_0xbd7a('0x21')](respondWithResult(_0x2a08a1,0xc9))[_0xbd7a('0x40')](handleError(_0x2a08a1,null));};exports[_0xbd7a('0x4a')]=function(_0x4c0b50,_0x4f5c1f){var _0x5509f7={'where':{'id':_0x4c0b50[_0xbd7a('0x4b')]['id']}},_0x301c56={};_0x301c56['model']=_[_0xbd7a('0x31')](db['JscriptyProject']['rawAttributes']);_0x5509f7['attributes']=_['intersection'](_0x301c56[_0xbd7a('0x2f')],qs[_0xbd7a('0x35')](_0x4c0b50[_0xbd7a('0x30')][_0xbd7a('0x35')]));_0x5509f7[_0xbd7a('0x34')]=_0x5509f7['attributes'][_0xbd7a('0x4c')]?_0x5509f7['attributes']:_0x301c56[_0xbd7a('0x2f')];if(_0x4c0b50[_0xbd7a('0x30')][_0xbd7a('0x4d')]){_0x5509f7[_0xbd7a('0x3e')]=[{'all':!![]}];}_0x5509f7=_[_0xbd7a('0x3c')]({},_0x5509f7,_0x4c0b50[_0xbd7a('0x41')]);return db['JscriptyProject'][_0xbd7a('0x42')](_0x5509f7)[_0xbd7a('0x21')](handleEntityNotFound(_0x4f5c1f,null))[_0xbd7a('0x21')](function(_0x560548){if(_0x560548){var _0x11616d=_0x560548[_0xbd7a('0x23')]({'plain':!![]});_0x11616d=qs[_0xbd7a('0x4e')](_0x11616d,['id','createdAt',_0xbd7a('0x4f')]);_0x4c0b50['body']=_[_0xbd7a('0x4e')](_0x4c0b50[_0xbd7a('0x50')],['id',_0xbd7a('0x51'),_0xbd7a('0x4f')]);return db['JscriptyProject'][_0xbd7a('0x43')](_['merge'](_0x11616d,_0x4c0b50[_0xbd7a('0x50')]),{'include':_0x4c0b50['query'][_0xbd7a('0x4d')]?[{'all':!![]}]:undefined})[_0xbd7a('0x21')](function(_0x390143){var _0x416bb0=_0x4c0b50[_0xbd7a('0x44')][_0xbd7a('0x23')]({'plain':!![]});if(!_0x416bb0)throw new Error(_0xbd7a('0x45'));if(_0x416bb0['role']===_0xbd7a('0x44')){var _0x9d764e=_0x390143[_0xbd7a('0x23')]({'plain':!![]});var _0x24d507='Projects';return db['UserProfileSection'][_0xbd7a('0x42')]({'where':{'name':_0x24d507,'userProfileId':_0x416bb0[_0xbd7a('0x52')]},'raw':!![]})[_0xbd7a('0x21')](function(_0x3d497c){if(_0x3d497c&&_0x3d497c[_0xbd7a('0x48')]===0x0){return db[_0xbd7a('0x24')][_0xbd7a('0x43')]({'name':_0x9d764e['name'],'resourceId':_0x9d764e['id'],'type':_0x3d497c['name'],'sectionId':_0x3d497c['id']},{})[_0xbd7a('0x21')](function(){return _0x390143;});}else{return _0x390143;}})[_0xbd7a('0x40')](function(_0x5ea401){logger[_0xbd7a('0x25')](_0xbd7a('0x49'),_0x5ea401);throw _0x5ea401;});}return _0x390143;});}})[_0xbd7a('0x21')](respondWithResult(_0x4f5c1f,0xc9))['catch'](handleError(_0x4f5c1f,null));};exports[_0xbd7a('0x53')]=function(_0x23ec5b,_0x273b18){if(_0x23ec5b[_0xbd7a('0x50')]['id']){delete _0x23ec5b[_0xbd7a('0x50')]['id'];}return db['JscriptyProject'][_0xbd7a('0x42')]({'where':{'id':_0x23ec5b[_0xbd7a('0x4b')]['id']}})[_0xbd7a('0x21')](handleEntityNotFound(_0x273b18,null))['then'](saveUpdates(_0x23ec5b['body'],null))['then'](respondWithResult(_0x273b18,null))[_0xbd7a('0x40')](handleError(_0x273b18,null));};exports[_0xbd7a('0x22')]=function(_0x2a2b88,_0xfa0419){return db['JscriptyProject']['find']({'where':{'id':_0x2a2b88[_0xbd7a('0x4b')]['id']}})[_0xbd7a('0x21')](handleEntityNotFound(_0xfa0419,null))['then'](removeEntity(_0xfa0419,null))[_0xbd7a('0x40')](handleError(_0xfa0419,null));};exports[_0xbd7a('0x54')]=function(_0x8dc915,_0x296984,_0x38621a){var _0x448505={'raw':!![],'where':{}};var _0x39c2d1={};var _0x2c323d={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbd7a('0x55')]({'where':{'id':_0x8dc915[_0xbd7a('0x4b')]['id']}})[_0xbd7a('0x21')](handleEntityNotFound(_0x296984,null))[_0xbd7a('0x21')](function(_0x21c38b){if(_0x21c38b){_0x39c2d1[_0xbd7a('0x2f')]=_[_0xbd7a('0x31')](db[_0xbd7a('0x56')]['rawAttributes']);_0x39c2d1['query']=_['keys'](_0x8dc915[_0xbd7a('0x30')]);_0x39c2d1['filters']=_[_0xbd7a('0x33')](_0x39c2d1[_0xbd7a('0x2f')],_0x39c2d1[_0xbd7a('0x30')]);_0x448505['attributes']=_[_0xbd7a('0x33')](_0x39c2d1[_0xbd7a('0x2f')],qs[_0xbd7a('0x35')](_0x8dc915[_0xbd7a('0x30')]['fields']));_0x448505['attributes']=_0x448505[_0xbd7a('0x34')][_0xbd7a('0x4c')]?_0x448505[_0xbd7a('0x34')]:_0x39c2d1['model'];if(!_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x36')]('nolimit')){_0x448505[_0xbd7a('0x1b')]=qs['limit'](_0x8dc915[_0xbd7a('0x30')]['limit']);_0x448505[_0xbd7a('0x19')]=qs[_0xbd7a('0x19')](_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x19')]);}_0x448505['order']=qs[_0xbd7a('0x39')](_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x39')]);_0x448505[_0xbd7a('0x3d')]=qs[_0xbd7a('0x32')](_[_0xbd7a('0x3a')](_0x8dc915['query'],_0x39c2d1[_0xbd7a('0x32')]));_0x448505[_0xbd7a('0x3d')]['ProjectId']=_0x21c38b['id'];if(_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x3b')]){_0x448505[_0xbd7a('0x3d')]=_[_0xbd7a('0x3c')](_0x448505['where'],{'$or':_[_0xbd7a('0x29')](_0x448505[_0xbd7a('0x34')],function(_0x26baa4){var _0x51d94d={};_0x51d94d[_0x26baa4]={'$like':'%'+_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x3b')]+'%'};return _0x51d94d;})});}_0x448505=_[_0xbd7a('0x3c')]({},_0x448505,_0x8dc915[_0xbd7a('0x41')]);return db[_0xbd7a('0x56')]['count']({'where':_0x448505[_0xbd7a('0x3d')]})[_0xbd7a('0x21')](function(_0x56d93b){_0x2c323d[_0xbd7a('0x1c')]=_0x56d93b;if(_0x8dc915[_0xbd7a('0x30')][_0xbd7a('0x4d')]){_0x448505[_0xbd7a('0x3e')]=[{'all':!![]}];}return db[_0xbd7a('0x56')][_0xbd7a('0x3f')](_0x448505);})[_0xbd7a('0x21')](function(_0xecba26){_0x2c323d[_0xbd7a('0x57')]=_0xecba26;return _0x2c323d;});}})['then'](respondWithFilteredResult(_0x296984,_0x448505))[_0xbd7a('0x40')](handleError(_0x296984,null));};exports['getAnswers']=function(_0x5a7bd7,_0x143670,_0x17bd00){var _0x3fd69a={'raw':!![],'where':{}};var _0x101d25={};var _0x62ddbc={'count':0x0,'rows':[]};return db[_0xbd7a('0x2a')][_0xbd7a('0x55')]({'where':{'id':_0x5a7bd7['params']['id']}})[_0xbd7a('0x21')](handleEntityNotFound(_0x143670,null))[_0xbd7a('0x21')](function(_0x25e52f){if(_0x25e52f){_0x101d25['model']=_['keys'](db[_0xbd7a('0x58')]['rawAttributes']);_0x101d25[_0xbd7a('0x30')]=_['keys'](_0x5a7bd7['query']);_0x101d25[_0xbd7a('0x32')]=_[_0xbd7a('0x33')](_0x101d25[_0xbd7a('0x2f')],_0x101d25[_0xbd7a('0x30')]);_0x3fd69a[_0xbd7a('0x34')]=_[_0xbd7a('0x33')](_0x101d25[_0xbd7a('0x2f')],qs[_0xbd7a('0x35')](_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x35')]));_0x3fd69a[_0xbd7a('0x34')]=_0x3fd69a[_0xbd7a('0x34')]['length']?_0x3fd69a[_0xbd7a('0x34')]:_0x101d25[_0xbd7a('0x2f')];if(!_0x5a7bd7['query'][_0xbd7a('0x36')](_0xbd7a('0x37'))){_0x3fd69a[_0xbd7a('0x1b')]=qs[_0xbd7a('0x1b')](_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x1b')]);_0x3fd69a[_0xbd7a('0x19')]=qs[_0xbd7a('0x19')](_0x5a7bd7['query'][_0xbd7a('0x19')]);}_0x3fd69a['order']=qs[_0xbd7a('0x39')](_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x39')]);_0x3fd69a[_0xbd7a('0x3d')]=qs[_0xbd7a('0x32')](_[_0xbd7a('0x3a')](_0x5a7bd7[_0xbd7a('0x30')],_0x101d25[_0xbd7a('0x32')]));_0x3fd69a[_0xbd7a('0x3d')]['ProjectId']=_0x25e52f['id'];if(_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x3b')]){_0x3fd69a[_0xbd7a('0x3d')]=_[_0xbd7a('0x3c')](_0x3fd69a[_0xbd7a('0x3d')],{'$or':_[_0xbd7a('0x29')](_0x3fd69a['attributes'],function(_0x5114c3){var _0x1bf2f4={};_0x1bf2f4[_0x5114c3]={'$like':'%'+_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x3b')]+'%'};return _0x1bf2f4;})});}_0x3fd69a=_[_0xbd7a('0x3c')]({},_0x3fd69a,_0x5a7bd7['options']);return db[_0xbd7a('0x58')]['count']({'where':_0x3fd69a[_0xbd7a('0x3d')]})[_0xbd7a('0x21')](function(_0x51ab35){_0x62ddbc['count']=_0x51ab35;if(_0x5a7bd7[_0xbd7a('0x30')][_0xbd7a('0x4d')]){_0x3fd69a[_0xbd7a('0x3e')]=[{'all':!![]}];}return db[_0xbd7a('0x58')]['findAll'](_0x3fd69a);})[_0xbd7a('0x21')](function(_0x4e6ab4){_0x62ddbc['rows']=_0x4e6ab4;return _0x62ddbc;});}})[_0xbd7a('0x21')](respondWithFilteredResult(_0x143670,_0x3fd69a))[_0xbd7a('0x40')](handleError(_0x143670,null));};function char(_0x550591){return'number'===typeof _0x550591?String[_0xbd7a('0x59')][_0xbd7a('0x1f')](null,arguments):_0x550591;}function needsEncapsulation(_0x931195){return!!_0x931195&&(_0x931195['toString']()[_0xbd7a('0x5a')](char(0xd))>=0x0||_0x931195['toString']()[_0xbd7a('0x5a')](char(0xa))>=0x0||_0x931195[_0xbd7a('0x5b')]()[_0xbd7a('0x5a')](char(0x2c))>=0x0||_0x931195['toString']()[_0xbd7a('0x5a')](char(0x22))>=0x0);}function encapsulate(_0x38e874){var _0x58d740=char(0x22),_0x302967='\x5c'+char(0x22),_0x1b311f=_0x38e874['toString']()[_0xbd7a('0x5c')](new RegExp(_0x58d740,'g'),_0x302967);return _0x58d740+_0x1b311f+_0x58d740;}exports['getSummary']=function(_0x2a54bf,_0x1ba94b,_0x1b9690){var _0x28fc6f,_0x4379c6;var _0x3443a3={'where':{'ProjectId':_0x2a54bf[_0xbd7a('0x4b')]['id']}};if(_0x2a54bf[_0xbd7a('0x30')][_0xbd7a('0x5d')]){_0x3443a3[_0xbd7a('0x3d')][_0xbd7a('0x5e')]=JSON[_0xbd7a('0x5f')](_0x2a54bf[_0xbd7a('0x30')]['startTime']);}return db[_0xbd7a('0x56')][_0xbd7a('0x3f')](_0x3443a3)['then'](handleEntityNotFound(_0x1ba94b,null))['then'](function(_0x1e5822){if(_0x1e5822){_0x28fc6f=_0x1e5822;return db[_0xbd7a('0x60')][_0xbd7a('0x3f')]({'where':{'SessionId':{'$in':_[_0xbd7a('0x29')](_0x28fc6f,'id')},'ProjectId':_0x2a54bf[_0xbd7a('0x4b')]['id']},'order':_0xbd7a('0x61')});}})['then'](handleEntityNotFound(_0x1ba94b,null))[_0xbd7a('0x21')](function(_0x9379db){if(_0x9379db){_0x4379c6=_0x9379db;var _0x40b862={};for(var _0x2383dd=0x0,_0x3e0f27=_0x4379c6[_0xbd7a('0x4c')];_0x2383dd<_0x3e0f27;_0x2383dd++){if(!_0x40b862['hasOwnProperty'](_0x4379c6[_0x2383dd][_0xbd7a('0x62')])){_0x40b862[_0x4379c6[_0x2383dd][_0xbd7a('0x62')]]=needsEncapsulation(_0x4379c6[_0x2383dd][_0xbd7a('0x63')])?encapsulate(_0x4379c6[_0x2383dd][_0xbd7a('0x63')]):_0x4379c6[_0x2383dd][_0xbd7a('0x63')];}}var _0x157518=[],_0x4f0c41={};for(var _0x231383=0x0,_0x2ca152=_0x28fc6f[_0xbd7a('0x4c')];_0x231383<_0x2ca152;_0x231383++){_0x4f0c41={'ProjectId':_0x2a54bf['params']['id'],'SessionId':_0x28fc6f[_0x231383]['id'],'StartTime':moment(_0x28fc6f[_0x231383][_0xbd7a('0x5e')])[_0xbd7a('0x64')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x405a87=0x0,_0x3fc863=_0x4379c6[_0xbd7a('0x4c')];_0x405a87<_0x3fc863;_0x405a87++){if(_0x4379c6[_0x405a87][_0xbd7a('0x65')]==_0x28fc6f[_0x231383]['id']&&_0x40b862[_0xbd7a('0x36')](_0x4379c6[_0x405a87]['questionId'])){_0x4f0c41[_0x40b862[_0x4379c6[_0x405a87][_0xbd7a('0x62')]]]=_0x4379c6[_0x405a87]['answer'];}}for(var _0x3dfc0a in _0x40b862){if(!_0x4f0c41[_0xbd7a('0x36')](_0x40b862[_0x3dfc0a])){_0x4f0c41[_0x40b862[_0x3dfc0a]]=null;}}_0x157518[_0xbd7a('0x66')](_0x4f0c41);}return _0x157518;}})[_0xbd7a('0x21')](function(_0x41001c){if(!_[_0xbd7a('0x67')](_0x41001c)){var _0x7eb94a=toCsv(_0x41001c);var _0xcae4ee=Date[_0xbd7a('0x68')]();fs['writeFileSync'](util['format'](_0xbd7a('0x69'),_0x2a54bf[_0xbd7a('0x4b')]['id'],_0xcae4ee),_0x7eb94a);_0x1ba94b[_0xbd7a('0x6a')]('Content-disposition',_0xbd7a('0x6b')+util[_0xbd7a('0x64')]('Jscripty_Project_%d_Summary_%s.csv',_0x2a54bf['params']['id'],_0xcae4ee));_0x1ba94b[_0xbd7a('0x6a')](_0xbd7a('0x6c'),_0xbd7a('0x6d'));return _0x1ba94b[_0xbd7a('0x6e')](util[_0xbd7a('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2a54bf['params']['id'],_0xcae4ee));}else{return _0x1ba94b[_0xbd7a('0x15')](0xcc);}})[_0xbd7a('0x40')](handleError(_0x1ba94b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 9e880a3..fe958c0 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 _0xe105=['bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','jscripty_projects','lodash'];(function(_0x36b0f6,_0x3d95c4){var _0x22e401=function(_0x22b745){while(--_0x22b745){_0x36b0f6['push'](_0x36b0f6['shift']());}};_0x22e401(++_0x3d95c4);}(_0xe105,0xef));var _0x5e10=function(_0x47ebb8,_0x34e2bd){_0x47ebb8=_0x47ebb8-0x0;var _0x39a6ed=_0xe105[_0x47ebb8];return _0x39a6ed;};'use strict';var _=require(_0x5e10('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5e10('0x1'));var rp=require(_0x5e10('0x2'));var fs=require('fs');var path=require(_0x5e10('0x3'));var rimraf=require(_0x5e10('0x4'));var config=require('../../config/environment');var attributes=require(_0x5e10('0x5'));module[_0x5e10('0x6')]=function(_0x4b8ff2,_0x1f3fc6){return _0x4b8ff2['define']('JscriptyProject',attributes,{'tableName':_0x5e10('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa48=['jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xaa48,0x15a));var _0x8aa4=function(_0xd9fbc3,_0x428198){_0xd9fbc3=_0xd9fbc3-0x0;var _0x4500e0=_0xaa48[_0xd9fbc3];return _0x4500e0;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var logger=require(_0x8aa4('0x2'))(_0x8aa4('0x3'));var moment=require(_0x8aa4('0x4'));var BPromise=require(_0x8aa4('0x5'));var rp=require(_0x8aa4('0x6'));var fs=require('fs');var path=require(_0x8aa4('0x7'));var rimraf=require(_0x8aa4('0x8'));var config=require(_0x8aa4('0x9'));var attributes=require(_0x8aa4('0xa'));module[_0x8aa4('0xb')]=function(_0x141d8b,_0x14614c){return _0x141d8b[_0x8aa4('0xc')](_0x8aa4('0xd'),attributes,{'tableName':_0x8aa4('0xe'),'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 bb4daf6..150b127 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 _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(_0x29bef4,_0x575d15){var _0x1508a1=function(_0x31158a){while(--_0x31158a){_0x29bef4['push'](_0x29bef4['shift']());}};_0x1508a1(++_0x575d15);}(_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 +var _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x552be1,_0x22d2b2){var _0x358a7c=function(_0x3592f0){while(--_0x3592f0){_0x552be1['push'](_0x552be1['shift']());}};_0x358a7c(++_0x22d2b2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5b0edc,_0x4e3851){_0x5b0edc=_0x5b0edc-0x0;var _0x137ae5=_0x9bde[_0x5b0edc];return _0x137ae5;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c319557..6499e05 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 _0x2720=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','exports'];(function(_0x1f478a,_0x57e790){var _0x49f4c3=function(_0xb9f004){while(--_0xb9f004){_0x1f478a['push'](_0x1f478a['shift']());}};_0x49f4c3(++_0x57e790);}(_0x2720,0x154));var _0x0272=function(_0x31ec2d,_0x489bbf){_0x31ec2d=_0x31ec2d-0x0;var _0x290c68=_0x2720[_0x31ec2d];return _0x290c68;};'use strict';var multer=require('multer');var util=require(_0x0272('0x0'));var path=require('path');var timeout=require(_0x0272('0x1'));var express=require('express');var router=express[_0x0272('0x2')]();var fs_extra=require(_0x0272('0x3'));var auth=require(_0x0272('0x4'));var interaction=require(_0x0272('0x5'));var config=require(_0x0272('0x6'));var controller=require(_0x0272('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0272('0x8')]);router[_0x0272('0x9')](_0x0272('0xa'),auth[_0x0272('0xb')](),controller[_0x0272('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0272('0xd')]('/',auth[_0x0272('0xb')](),controller[_0x0272('0xe')]);router[_0x0272('0xf')](_0x0272('0x10'),auth[_0x0272('0xb')](),controller[_0x0272('0x11')]);router[_0x0272('0x12')](_0x0272('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x0272('0x13')]=router; \ No newline at end of file +var _0xf3ab=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','destroy','exports','multer','util','path'];(function(_0x3f2816,_0x2c4f6d){var _0x3141b8=function(_0x18bdb6){while(--_0x18bdb6){_0x3f2816['push'](_0x3f2816['shift']());}};_0x3141b8(++_0x2c4f6d);}(_0xf3ab,0x1cb));var _0xbf3a=function(_0x2baca1,_0x2f3557){_0x2baca1=_0x2baca1-0x0;var _0x9aa62a=_0xf3ab[_0x2baca1];return _0x9aa62a;};'use strict';var multer=require(_0xbf3a('0x0'));var util=require(_0xbf3a('0x1'));var path=require(_0xbf3a('0x2'));var timeout=require(_0xbf3a('0x3'));var express=require(_0xbf3a('0x4'));var router=express[_0xbf3a('0x5')]();var fs_extra=require(_0xbf3a('0x6'));var auth=require(_0xbf3a('0x7'));var interaction=require(_0xbf3a('0x8'));var config=require(_0xbf3a('0x9'));var controller=require(_0xbf3a('0xa'));router[_0xbf3a('0xb')]('/',auth[_0xbf3a('0xc')](),controller[_0xbf3a('0xd')]);router[_0xbf3a('0xb')](_0xbf3a('0xe'),auth[_0xbf3a('0xc')](),controller[_0xbf3a('0xf')]);router[_0xbf3a('0xb')](_0xbf3a('0x10'),auth[_0xbf3a('0xc')](),controller[_0xbf3a('0x11')]);router['post']('/',auth[_0xbf3a('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbf3a('0x12')](_0xbf3a('0x10'),auth['isAuthenticated'](),controller[_0xbf3a('0x13')]);module[_0xbf3a('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 ff15412..ac2e983 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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0x349bf3,_0x42b1af){_0x349bf3=_0x349bf3-0x0;var _0x10e39d=_0x7a54[_0x349bf3];return _0x10e39d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x3f29db,_0x1e5670){_0x3f29db=_0x3f29db-0x0;var _0x5e8031=_0x7a54[_0x3f29db];return _0x5e8031;};'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 f97bb70..edece94 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 _0x723b=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','end','error','stack','name','send','index','JscriptyQuestionReport','fieldName','type','key','model','map','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','filters','length','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x228f58,_0x1b89b1){var _0x273dc1=function(_0x81ab76){while(--_0x81ab76){_0x228f58['push'](_0x228f58['shift']());}};_0x273dc1(++_0x1b89b1);}(_0x723b,0x81));var _0xb723=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x723b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb723('0x0'));var zipdir=require(_0xb723('0x1'));var jsonpatch=require(_0xb723('0x2'));var rp=require(_0xb723('0x3'));var moment=require(_0xb723('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb723('0x5'));var path=require(_0xb723('0x6'));var sox=require(_0xb723('0x7'));var csv=require(_0xb723('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb723('0x9'));var _=require(_0xb723('0xa'));var squel=require(_0xb723('0xb'));var crypto=require(_0xb723('0xc'));var jsforce=require(_0xb723('0xd'));var deskjs=require(_0xb723('0xe'));var toCsv=require(_0xb723('0x8'));var querystring=require(_0xb723('0xf'));var Papa=require(_0xb723('0x10'));var Redis=require(_0xb723('0x11'));var authService=require(_0xb723('0x12'));var qs=require(_0xb723('0x13'));var as=require(_0xb723('0x14'));var hardwareService=require(_0xb723('0x15'));var logger=require(_0xb723('0x16'))('api');var utils=require(_0xb723('0x17'));var config=require(_0xb723('0x18'));var licenseUtil=require(_0xb723('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x82ec9c,_0x571f6b){_0x571f6b=_0x571f6b||0xcc;return function(_0x32a08f){if(_0x32a08f){return _0x82ec9c[_0xb723('0x1a')](_0x571f6b);}return _0x82ec9c['status'](_0x571f6b)['end']();};}function respondWithResult(_0x2a74ee,_0x49cfa8){_0x49cfa8=_0x49cfa8||0xc8;return function(_0x29bbca){if(_0x29bbca){return _0x2a74ee[_0xb723('0x1b')](_0x49cfa8)[_0xb723('0x1c')](_0x29bbca);}};}function respondWithFilteredResult(_0x27437c,_0x1a441a){return function(_0x15cd29){if(_0x15cd29){var _0x53a856=typeof _0x1a441a[_0xb723('0x1d')]===_0xb723('0x1e')&&typeof _0x1a441a[_0xb723('0x1f')]===_0xb723('0x1e');var _0x181928=_0x15cd29['count'];var _0x383f28=_0x53a856?0x0:_0x1a441a['offset'];var _0x4752d6=_0x53a856?_0x15cd29[_0xb723('0x20')]:_0x1a441a[_0xb723('0x1d')]+_0x1a441a[_0xb723('0x1f')];var _0x2dbfbc;if(_0x4752d6>=_0x181928){_0x4752d6=_0x181928;_0x2dbfbc=0xc8;}else{_0x2dbfbc=0xce;}_0x27437c[_0xb723('0x1b')](_0x2dbfbc);return _0x27437c[_0xb723('0x21')](_0xb723('0x22'),_0x383f28+'-'+_0x4752d6+'/'+_0x181928)[_0xb723('0x1c')](_0x15cd29);}return null;};}function patchUpdates(_0x41a719){return function(_0x12d37a){try{jsonpatch[_0xb723('0x23')](_0x12d37a,_0x41a719,!![]);}catch(_0x2241f9){return BPromise['reject'](_0x2241f9);}return _0x12d37a['save']();};}function saveUpdates(_0x4e624d,_0x5c0739){return function(_0x443e04){if(_0x443e04){return _0x443e04[_0xb723('0x24')](_0x4e624d)[_0xb723('0x25')](function(_0x8b1fd1){return _0x8b1fd1;});}return null;};}function removeEntity(_0x1f8dd4,_0x167b5c){return function(_0x1b9eac){if(_0x1b9eac){return _0x1b9eac['destroy']()[_0xb723('0x25')](function(){_0x1f8dd4[_0xb723('0x1b')](0xcc)[_0xb723('0x26')]();});}};}function handleEntityNotFound(_0x36c44b,_0x38327c){return function(_0x398043){if(!_0x398043){_0x36c44b[_0xb723('0x1a')](0x194);}return _0x398043;};}function handleError(_0x5f02b8,_0x56560f){_0x56560f=_0x56560f||0x1f4;return function(_0x4363bc){logger[_0xb723('0x27')](_0x4363bc[_0xb723('0x28')]);if(_0x4363bc['name']){delete _0x4363bc[_0xb723('0x29')];}_0x5f02b8[_0xb723('0x1b')](_0x56560f)[_0xb723('0x2a')](_0x4363bc);};}exports[_0xb723('0x2b')]=function(_0x162666,_0x1dc886){var _0xa8821d={},_0x2f13be={},_0x5d9c82={'count':0x0,'rows':[]};var _0x426983=_['map'](db[_0xb723('0x2c')]['rawAttributes'],function(_0x40c26d){return{'name':_0x40c26d[_0xb723('0x2d')],'type':_0x40c26d[_0xb723('0x2e')][_0xb723('0x2f')]};});_0x2f13be[_0xb723('0x30')]=_[_0xb723('0x31')](_0x426983,_0xb723('0x29'));_0x2f13be['query']=_[_0xb723('0x32')](_0x162666['query']);_0x2f13be['filters']=_[_0xb723('0x33')](_0x2f13be[_0xb723('0x30')],_0x2f13be[_0xb723('0x34')]);_0xa8821d['attributes']=_[_0xb723('0x33')](_0x2f13be[_0xb723('0x30')],qs[_0xb723('0x35')](_0x162666['query'][_0xb723('0x35')]));_0xa8821d[_0xb723('0x36')]=_0xa8821d['attributes']['length']?_0xa8821d['attributes']:_0x2f13be[_0xb723('0x30')];if(!_0x162666[_0xb723('0x34')][_0xb723('0x37')](_0xb723('0x38'))){_0xa8821d[_0xb723('0x1f')]=qs['limit'](_0x162666[_0xb723('0x34')][_0xb723('0x1f')]);_0xa8821d[_0xb723('0x1d')]=qs[_0xb723('0x1d')](_0x162666['query'][_0xb723('0x1d')]);}_0xa8821d['order']=qs[_0xb723('0x39')](_0x162666[_0xb723('0x34')][_0xb723('0x39')]);_0xa8821d[_0xb723('0x3a')]=qs['filters'](_[_0xb723('0x3b')](_0x162666['query'],_0x2f13be['filters']),_0x426983);if(_0x162666[_0xb723('0x34')][_0xb723('0x3c')]){_0xa8821d[_0xb723('0x3a')]=_[_0xb723('0x3d')](_0xa8821d[_0xb723('0x3a')],{'$or':_[_0xb723('0x31')](_0x426983,function(_0x54efe8){if(_0x54efe8[_0xb723('0x2e')]!==_0xb723('0x3e')){var _0x52be7f={};_0x52be7f[_0x54efe8[_0xb723('0x29')]]={'$like':'%'+_0x162666['query']['filter']+'%'};return _0x52be7f;}})});}_0xa8821d=_['merge']({},_0xa8821d,_0x162666[_0xb723('0x3f')]);var _0x22ca0a={'where':_0xa8821d[_0xb723('0x3a')]};return db[_0xb723('0x2c')][_0xb723('0x20')](_0x22ca0a)[_0xb723('0x25')](function(_0x3a2bfb){_0x5d9c82['count']=_0x3a2bfb;if(_0x162666['query'][_0xb723('0x40')]){_0xa8821d[_0xb723('0x41')]=[{'all':!![]}];}return db[_0xb723('0x2c')]['findAll'](_0xa8821d);})['then'](function(_0x3dfe85){_0x5d9c82[_0xb723('0x42')]=_0x3dfe85;return _0x5d9c82;})[_0xb723('0x25')](respondWithFilteredResult(_0x1dc886,_0xa8821d))['catch'](handleError(_0x1dc886,null));};exports['show']=function(_0x1ea620,_0x476380){var _0x4c310d={'raw':!![],'where':{'id':_0x1ea620[_0xb723('0x43')]['id']}},_0x22feac={};_0x22feac['model']=_[_0xb723('0x32')](db[_0xb723('0x2c')]['rawAttributes']);_0x22feac[_0xb723('0x34')]=_['keys'](_0x1ea620['query']);_0x22feac[_0xb723('0x44')]=_[_0xb723('0x33')](_0x22feac[_0xb723('0x30')],_0x22feac[_0xb723('0x34')]);_0x4c310d[_0xb723('0x36')]=_['intersection'](_0x22feac[_0xb723('0x30')],qs['fields'](_0x1ea620[_0xb723('0x34')][_0xb723('0x35')]));_0x4c310d[_0xb723('0x36')]=_0x4c310d['attributes'][_0xb723('0x45')]?_0x4c310d[_0xb723('0x36')]:_0x22feac['model'];if(_0x1ea620[_0xb723('0x34')]['includeAll']){_0x4c310d[_0xb723('0x41')]=[{'all':!![]}];}_0x4c310d=_[_0xb723('0x3d')]({},_0x4c310d,_0x1ea620[_0xb723('0x3f')]);return db['JscriptyQuestionReport'][_0xb723('0x46')](_0x4c310d)[_0xb723('0x25')](handleEntityNotFound(_0x476380,null))[_0xb723('0x25')](respondWithResult(_0x476380,null))[_0xb723('0x47')](handleError(_0x476380,null));};exports[_0xb723('0x48')]=function(_0x3e6189,_0x7a3e88){return db[_0xb723('0x2c')]['create'](_0x3e6189[_0xb723('0x49')],{})['then'](respondWithResult(_0x7a3e88,0xc9))['catch'](handleError(_0x7a3e88,null));};exports[_0xb723('0x24')]=function(_0x3f2f53,_0x2140df){if(_0x3f2f53['body']['id']){delete _0x3f2f53['body']['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x3f2f53[_0xb723('0x43')]['id']}})[_0xb723('0x25')](handleEntityNotFound(_0x2140df,null))[_0xb723('0x25')](saveUpdates(_0x3f2f53[_0xb723('0x49')],null))['then'](respondWithResult(_0x2140df,null))[_0xb723('0x47')](handleError(_0x2140df,null));};exports[_0xb723('0x4a')]=function(_0x5d0aa0,_0x1378f6){return db[_0xb723('0x2c')][_0xb723('0x46')]({'where':{'id':_0x5d0aa0[_0xb723('0x43')]['id']}})[_0xb723('0x25')](handleEntityNotFound(_0x1378f6,null))[_0xb723('0x25')](removeEntity(_0x1378f6,null))[_0xb723('0x47')](handleError(_0x1378f6,null));};exports[_0xb723('0x4b')]=function(_0x3f68ad,_0xff571e){return db[_0xb723('0x2c')][_0xb723('0x4b')]()[_0xb723('0x25')](respondWithResult(_0xff571e,null))[_0xb723('0x47')](handleError(_0xff571e,null));}; \ No newline at end of file +var _0xc8f5=['fields','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes'];(function(_0x55853b,_0x2eb91c){var _0x33ec6d=function(_0x350fe4){while(--_0x350fe4){_0x55853b['push'](_0x55853b['shift']());}};_0x33ec6d(++_0x2eb91c);}(_0xc8f5,0x9f));var _0x5c8f=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0xc8f5[_0x29d2d2];return _0x3f6476;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c8f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c8f('0x1'));var rp=require(_0x5c8f('0x2'));var moment=require(_0x5c8f('0x3'));var BPromise=require(_0x5c8f('0x4'));var Mustache=require('mustache');var util=require(_0x5c8f('0x5'));var path=require('path');var sox=require(_0x5c8f('0x6'));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(_0x5c8f('0x7'));var crypto=require(_0x5c8f('0x8'));var jsforce=require(_0x5c8f('0x9'));var deskjs=require(_0x5c8f('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5c8f('0xb'));var Papa=require(_0x5c8f('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c8f('0xd'));var as=require(_0x5c8f('0xe'));var hardwareService=require(_0x5c8f('0xf'));var logger=require(_0x5c8f('0x10'))(_0x5c8f('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5c8f('0x12'));var db=require(_0x5c8f('0x13'))['db'];function respondWithStatusCode(_0x449330,_0x19b201){_0x19b201=_0x19b201||0xcc;return function(_0x3f16d4){if(_0x3f16d4){return _0x449330[_0x5c8f('0x14')](_0x19b201);}return _0x449330[_0x5c8f('0x15')](_0x19b201)['end']();};}function respondWithResult(_0x2358b1,_0x517d28){_0x517d28=_0x517d28||0xc8;return function(_0x1e466a){if(_0x1e466a){return _0x2358b1['status'](_0x517d28)[_0x5c8f('0x16')](_0x1e466a);}};}function respondWithFilteredResult(_0x482957,_0x58be99){return function(_0x23f3ff){if(_0x23f3ff){var _0x5ce148=typeof _0x58be99[_0x5c8f('0x17')]===_0x5c8f('0x18')&&typeof _0x58be99[_0x5c8f('0x19')]===_0x5c8f('0x18');var _0x10c55f=_0x23f3ff[_0x5c8f('0x1a')];var _0xed4456=_0x5ce148?0x0:_0x58be99[_0x5c8f('0x17')];var _0x501845=_0x5ce148?_0x23f3ff[_0x5c8f('0x1a')]:_0x58be99['offset']+_0x58be99['limit'];var _0x2323e3;if(_0x501845>=_0x10c55f){_0x501845=_0x10c55f;_0x2323e3=0xc8;}else{_0x2323e3=0xce;}_0x482957[_0x5c8f('0x15')](_0x2323e3);return _0x482957['set'](_0x5c8f('0x1b'),_0xed4456+'-'+_0x501845+'/'+_0x10c55f)['json'](_0x23f3ff);}return null;};}function patchUpdates(_0x4a196f){return function(_0x6abb9f){try{jsonpatch['apply'](_0x6abb9f,_0x4a196f,!![]);}catch(_0x4de8b1){return BPromise['reject'](_0x4de8b1);}return _0x6abb9f[_0x5c8f('0x1c')]();};}function saveUpdates(_0x4ef401,_0x16212f){return function(_0x599d08){if(_0x599d08){return _0x599d08[_0x5c8f('0x1d')](_0x4ef401)[_0x5c8f('0x1e')](function(_0x15f529){return _0x15f529;});}return null;};}function removeEntity(_0x1b49c2,_0x1aa8af){return function(_0x388dbc){if(_0x388dbc){return _0x388dbc[_0x5c8f('0x1f')]()['then'](function(){_0x1b49c2[_0x5c8f('0x15')](0xcc)[_0x5c8f('0x20')]();});}};}function handleEntityNotFound(_0x2e477e,_0x3f8e0d){return function(_0x39cbd7){if(!_0x39cbd7){_0x2e477e['sendStatus'](0x194);}return _0x39cbd7;};}function handleError(_0x3c517c,_0x591ec0){_0x591ec0=_0x591ec0||0x1f4;return function(_0x323eaa){logger[_0x5c8f('0x21')](_0x323eaa[_0x5c8f('0x22')]);if(_0x323eaa[_0x5c8f('0x23')]){delete _0x323eaa[_0x5c8f('0x23')];}_0x3c517c[_0x5c8f('0x15')](_0x591ec0)[_0x5c8f('0x24')](_0x323eaa);};}exports[_0x5c8f('0x25')]=function(_0x289e59,_0x21af12){var _0x216821={},_0x565ddd={},_0x26591b={'count':0x0,'rows':[]};var _0xd6ff83=_[_0x5c8f('0x26')](db[_0x5c8f('0x27')][_0x5c8f('0x28')],function(_0x5bee6f){return{'name':_0x5bee6f[_0x5c8f('0x29')],'type':_0x5bee6f[_0x5c8f('0x2a')]['key']};});_0x565ddd[_0x5c8f('0x2b')]=_[_0x5c8f('0x26')](_0xd6ff83,_0x5c8f('0x23'));_0x565ddd[_0x5c8f('0x2c')]=_[_0x5c8f('0x2d')](_0x289e59[_0x5c8f('0x2c')]);_0x565ddd['filters']=_[_0x5c8f('0x2e')](_0x565ddd[_0x5c8f('0x2b')],_0x565ddd[_0x5c8f('0x2c')]);_0x216821[_0x5c8f('0x2f')]=_['intersection'](_0x565ddd[_0x5c8f('0x2b')],qs['fields'](_0x289e59[_0x5c8f('0x2c')][_0x5c8f('0x30')]));_0x216821['attributes']=_0x216821[_0x5c8f('0x2f')]['length']?_0x216821[_0x5c8f('0x2f')]:_0x565ddd[_0x5c8f('0x2b')];if(!_0x289e59[_0x5c8f('0x2c')]['hasOwnProperty'](_0x5c8f('0x31'))){_0x216821[_0x5c8f('0x19')]=qs['limit'](_0x289e59[_0x5c8f('0x2c')]['limit']);_0x216821['offset']=qs[_0x5c8f('0x17')](_0x289e59[_0x5c8f('0x2c')]['offset']);}_0x216821[_0x5c8f('0x32')]=qs['sort'](_0x289e59[_0x5c8f('0x2c')]['sort']);_0x216821[_0x5c8f('0x33')]=qs[_0x5c8f('0x34')](_[_0x5c8f('0x35')](_0x289e59[_0x5c8f('0x2c')],_0x565ddd[_0x5c8f('0x34')]),_0xd6ff83);if(_0x289e59[_0x5c8f('0x2c')][_0x5c8f('0x36')]){_0x216821[_0x5c8f('0x33')]=_[_0x5c8f('0x37')](_0x216821[_0x5c8f('0x33')],{'$or':_['map'](_0xd6ff83,function(_0x11ba1a){if(_0x11ba1a['type']!==_0x5c8f('0x38')){var _0xbbbaa={};_0xbbbaa[_0x11ba1a[_0x5c8f('0x23')]]={'$like':'%'+_0x289e59[_0x5c8f('0x2c')][_0x5c8f('0x36')]+'%'};return _0xbbbaa;}})});}_0x216821=_[_0x5c8f('0x37')]({},_0x216821,_0x289e59[_0x5c8f('0x39')]);var _0x1fc351={'where':_0x216821[_0x5c8f('0x33')]};return db['JscriptyQuestionReport'][_0x5c8f('0x1a')](_0x1fc351)['then'](function(_0x5d41a8){_0x26591b[_0x5c8f('0x1a')]=_0x5d41a8;if(_0x289e59['query'][_0x5c8f('0x3a')]){_0x216821['include']=[{'all':!![]}];}return db[_0x5c8f('0x27')]['findAll'](_0x216821);})[_0x5c8f('0x1e')](function(_0x34d58a){_0x26591b[_0x5c8f('0x3b')]=_0x34d58a;return _0x26591b;})[_0x5c8f('0x1e')](respondWithFilteredResult(_0x21af12,_0x216821))[_0x5c8f('0x3c')](handleError(_0x21af12,null));};exports[_0x5c8f('0x3d')]=function(_0x57bbec,_0x265517){var _0x289986={'raw':!![],'where':{'id':_0x57bbec[_0x5c8f('0x3e')]['id']}},_0x410337={};_0x410337[_0x5c8f('0x2b')]=_[_0x5c8f('0x2d')](db['JscriptyQuestionReport'][_0x5c8f('0x28')]);_0x410337[_0x5c8f('0x2c')]=_[_0x5c8f('0x2d')](_0x57bbec[_0x5c8f('0x2c')]);_0x410337[_0x5c8f('0x34')]=_['intersection'](_0x410337['model'],_0x410337['query']);_0x289986[_0x5c8f('0x2f')]=_[_0x5c8f('0x2e')](_0x410337[_0x5c8f('0x2b')],qs[_0x5c8f('0x30')](_0x57bbec[_0x5c8f('0x2c')][_0x5c8f('0x30')]));_0x289986['attributes']=_0x289986['attributes'][_0x5c8f('0x3f')]?_0x289986[_0x5c8f('0x2f')]:_0x410337[_0x5c8f('0x2b')];if(_0x57bbec[_0x5c8f('0x2c')]['includeAll']){_0x289986[_0x5c8f('0x40')]=[{'all':!![]}];}_0x289986=_[_0x5c8f('0x37')]({},_0x289986,_0x57bbec['options']);return db[_0x5c8f('0x27')]['find'](_0x289986)[_0x5c8f('0x1e')](handleEntityNotFound(_0x265517,null))[_0x5c8f('0x1e')](respondWithResult(_0x265517,null))[_0x5c8f('0x3c')](handleError(_0x265517,null));};exports['create']=function(_0xf9991c,_0x2fea28){return db[_0x5c8f('0x27')][_0x5c8f('0x41')](_0xf9991c[_0x5c8f('0x42')],{})[_0x5c8f('0x1e')](respondWithResult(_0x2fea28,0xc9))['catch'](handleError(_0x2fea28,null));};exports['update']=function(_0x141d17,_0x500da2){if(_0x141d17['body']['id']){delete _0x141d17[_0x5c8f('0x42')]['id'];}return db[_0x5c8f('0x27')][_0x5c8f('0x43')]({'where':{'id':_0x141d17[_0x5c8f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x500da2,null))[_0x5c8f('0x1e')](saveUpdates(_0x141d17[_0x5c8f('0x42')],null))[_0x5c8f('0x1e')](respondWithResult(_0x500da2,null))['catch'](handleError(_0x500da2,null));};exports['destroy']=function(_0x4d407a,_0x3a796e){return db[_0x5c8f('0x27')][_0x5c8f('0x43')]({'where':{'id':_0x4d407a['params']['id']}})[_0x5c8f('0x1e')](handleEntityNotFound(_0x3a796e,null))[_0x5c8f('0x1e')](removeEntity(_0x3a796e,null))['catch'](handleError(_0x3a796e,null));};exports[_0x5c8f('0x44')]=function(_0x56919d,_0x39904e){return db['JscriptyQuestionReport'][_0x5c8f('0x44')]()[_0x5c8f('0x1e')](respondWithResult(_0x39904e,null))[_0x5c8f('0x3c')](handleError(_0x39904e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 1e66edb..6d5fe3a 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 _0x292b=['rimraf','../../config/environment','exports','define','JscriptyQuestionReport','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3d911b,_0x3ef921){var _0xeed5fb=function(_0x33ba0a){while(--_0x33ba0a){_0x3d911b['push'](_0x3d911b['shift']());}};_0xeed5fb(++_0x3ef921);}(_0x292b,0xd1));var _0xb292=function(_0xa9671b,_0x11378d){_0xa9671b=_0xa9671b-0x0;var _0x205591=_0x292b[_0xa9671b];return _0x205591;};'use strict';var _=require('lodash');var util=require(_0xb292('0x0'));var logger=require(_0xb292('0x1'))(_0xb292('0x2'));var moment=require(_0xb292('0x3'));var BPromise=require(_0xb292('0x4'));var rp=require(_0xb292('0x5'));var fs=require('fs');var path=require(_0xb292('0x6'));var rimraf=require(_0xb292('0x7'));var config=require(_0xb292('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xb292('0x9')]=function(_0x44a63f,_0x1cec69){return _0x44a63f[_0xb292('0xa')](_0xb292('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefce=['rimraf','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x34b5b2,_0x2b9dec){var _0xf50d50=function(_0x18d5b1){while(--_0x18d5b1){_0x34b5b2['push'](_0x34b5b2['shift']());}};_0xf50d50(++_0x2b9dec);}(_0xefce,0xdd));var _0xeefc=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0xefce[_0x4e11d5];return _0x5e4e4c;};'use strict';var _=require(_0xeefc('0x0'));var util=require(_0xeefc('0x1'));var logger=require(_0xeefc('0x2'))(_0xeefc('0x3'));var moment=require(_0xeefc('0x4'));var BPromise=require(_0xeefc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeefc('0x6'));var rimraf=require(_0xeefc('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xeefc('0x8')]=function(_0x4c2179,_0x1e5fd6){return _0x4c2179[_0xeefc('0x9')](_0xeefc('0xa'),attributes,{'tableName':_0xeefc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index aa575e0..543f925 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 _0xbbe3=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xbbe3,0xff));var _0x3bbe=function(_0x45853f,_0x100f59){_0x45853f=_0x45853f-0x0;var _0x462fd2=_0xbbe3[_0x45853f];return _0x462fd2;};'use strict';var _=require(_0x3bbe('0x0'));var util=require(_0x3bbe('0x1'));var moment=require(_0x3bbe('0x2'));var BPromise=require(_0x3bbe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bbe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bbe('0x5'));var logger=require('../../config/logger')(_0x3bbe('0x6'));var config=require(_0x3bbe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3bbe('0x8')][_0x3bbe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c2ae1,_0x4d2115,_0xad38a9){return new BPromise(function(_0x349f21,_0x3857ad){return client[_0x3bbe('0xa')](_0x2c2ae1,_0xad38a9)['then'](function(_0x16bd9e){logger['info'](_0x3bbe('0xb'),_0x4d2115,_0x3bbe('0xc'));logger['debug'](_0x3bbe('0xd'),_0x4d2115,_0x3bbe('0xc'),JSON[_0x3bbe('0xe')](_0x16bd9e));if(_0x16bd9e['error']){if(_0x16bd9e[_0x3bbe('0xf')]['code']===0x1f4){logger['error'](_0x3bbe('0xb'),_0x4d2115,_0x16bd9e['error'][_0x3bbe('0x10')]);return _0x3857ad(_0x16bd9e[_0x3bbe('0xf')][_0x3bbe('0x10')]);}logger['error'](_0x3bbe('0xb'),_0x4d2115,_0x16bd9e[_0x3bbe('0xf')][_0x3bbe('0x10')]);return _0x349f21(_0x16bd9e[_0x3bbe('0xf')][_0x3bbe('0x10')]);}else{logger[_0x3bbe('0x11')](_0x3bbe('0xb'),_0x4d2115,_0x3bbe('0xc'));_0x349f21(_0x16bd9e['result']['message']);}})[_0x3bbe('0x12')](function(_0x256ba7){logger[_0x3bbe('0xf')](_0x3bbe('0xb'),_0x4d2115,_0x256ba7);_0x3857ad(_0x256ba7);});});} \ No newline at end of file +var _0x667e=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x667e,0x102));var _0xe667=function(_0x4d23c6,_0x218454){_0x4d23c6=_0x4d23c6-0x0;var _0x44e1b7=_0x667e[_0x4d23c6];return _0x44e1b7;};'use strict';var _=require(_0xe667('0x0'));var util=require(_0xe667('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe667('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe667('0x3'));var logger=require(_0xe667('0x4'))(_0xe667('0x5'));var config=require(_0xe667('0x6'));var jayson=require(_0xe667('0x7'));var client=jayson[_0xe667('0x8')][_0xe667('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ff934,_0x34d8ea,_0x2416d2){return new BPromise(function(_0x540825,_0x33f381){return client[_0xe667('0xa')](_0x1ff934,_0x2416d2)[_0xe667('0xb')](function(_0x50184f){logger[_0xe667('0xc')](_0xe667('0xd'),_0x34d8ea,_0xe667('0xe'));logger['debug'](_0xe667('0xf'),_0x34d8ea,_0xe667('0xe'),JSON[_0xe667('0x10')](_0x50184f));if(_0x50184f[_0xe667('0x11')]){if(_0x50184f[_0xe667('0x11')][_0xe667('0x12')]===0x1f4){logger[_0xe667('0x11')](_0xe667('0xd'),_0x34d8ea,_0x50184f['error'][_0xe667('0x13')]);return _0x33f381(_0x50184f['error']['message']);}logger[_0xe667('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x34d8ea,_0x50184f[_0xe667('0x11')][_0xe667('0x13')]);return _0x540825(_0x50184f[_0xe667('0x11')]['message']);}else{logger[_0xe667('0xc')](_0xe667('0xd'),_0x34d8ea,_0xe667('0xe'));_0x540825(_0x50184f[_0xe667('0x14')][_0xe667('0x13')]);}})[_0xe667('0x15')](function(_0x3b8a7a){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x34d8ea,_0x3b8a7a);_0x33f381(_0x3b8a7a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9700cd0..453d7dc 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 _0xeeca=['get','/describe','describe','show','/:id/questions','getQuestions','post','create','put','/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index'];(function(_0x2070e6,_0x5401d2){var _0x490c4a=function(_0x2e6ad5){while(--_0x2e6ad5){_0x2070e6['push'](_0x2070e6['shift']());}};_0x490c4a(++_0x5401d2);}(_0xeeca,0xad));var _0xaeec=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0xeeca[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require(_0xaeec('0x0'));var util=require(_0xaeec('0x1'));var path=require(_0xaeec('0x2'));var timeout=require('connect-timeout');var express=require(_0xaeec('0x3'));var router=express[_0xaeec('0x4')]();var fs_extra=require(_0xaeec('0x5'));var auth=require(_0xaeec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaeec('0x7'));var controller=require(_0xaeec('0x8'));router['get']('/',auth[_0xaeec('0x9')](),controller[_0xaeec('0xa')]);router[_0xaeec('0xb')](_0xaeec('0xc'),auth[_0xaeec('0x9')](),controller[_0xaeec('0xd')]);router[_0xaeec('0xb')]('/:id',auth[_0xaeec('0x9')](),controller[_0xaeec('0xe')]);router[_0xaeec('0xb')](_0xaeec('0xf'),auth[_0xaeec('0x9')](),controller[_0xaeec('0x10')]);router[_0xaeec('0x11')]('/',auth[_0xaeec('0x9')](),controller[_0xaeec('0x12')]);router[_0xaeec('0x13')](_0xaeec('0x14'),auth[_0xaeec('0x9')](),controller[_0xaeec('0x15')]);router['delete'](_0xaeec('0x14'),auth[_0xaeec('0x9')](),controller[_0xaeec('0x16')]);module['exports']=router; \ No newline at end of file +var _0x7a38=['index','/describe','describe','/:id','show','/:id/questions','getQuestions','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x391f9a,_0x3d93e1){var _0xf3e760=function(_0x282840){while(--_0x282840){_0x391f9a['push'](_0x391f9a['shift']());}};_0xf3e760(++_0x3d93e1);}(_0x7a38,0x186));var _0x87a3=function(_0x31e22c,_0x580c36){_0x31e22c=_0x31e22c-0x0;var _0x1a6ee4=_0x7a38[_0x31e22c];return _0x1a6ee4;};'use strict';var multer=require('multer');var util=require(_0x87a3('0x0'));var path=require('path');var timeout=require(_0x87a3('0x1'));var express=require(_0x87a3('0x2'));var router=express['Router']();var fs_extra=require(_0x87a3('0x3'));var auth=require(_0x87a3('0x4'));var interaction=require(_0x87a3('0x5'));var config=require('../../config/environment');var controller=require(_0x87a3('0x6'));router[_0x87a3('0x7')]('/',auth[_0x87a3('0x8')](),controller[_0x87a3('0x9')]);router[_0x87a3('0x7')](_0x87a3('0xa'),auth[_0x87a3('0x8')](),controller[_0x87a3('0xb')]);router[_0x87a3('0x7')](_0x87a3('0xc'),auth[_0x87a3('0x8')](),controller[_0x87a3('0xd')]);router[_0x87a3('0x7')](_0x87a3('0xe'),auth[_0x87a3('0x8')](),controller[_0x87a3('0xf')]);router['post']('/',auth[_0x87a3('0x8')](),controller['create']);router['put'](_0x87a3('0xc'),auth['isAuthenticated'](),controller[_0x87a3('0x10')]);router['delete'](_0x87a3('0xc'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x11')]);module[_0x87a3('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ea74ef3..a309d61 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 _0x9cd6=['STRING','BOOLEAN','sequelize','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x9cd6,0x16a));var _0x69cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9cd6[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x69cd('0x0'));module['exports']={'starttime':{'type':Sequelize[_0x69cd('0x1')],'set':function(_0x3e8572){this[_0x69cd('0x2')]('starttime',_0x3e8572);this[_0x69cd('0x2')](_0x69cd('0x3'),moment()[_0x69cd('0x4')](_0x69cd('0x5')));}},'endtime':{'type':Sequelize[_0x69cd('0x1')]},'membername':{'type':Sequelize[_0x69cd('0x6')]},'projectname':{'type':Sequelize[_0x69cd('0x6')]},'queue':{'type':Sequelize[_0x69cd('0x6')]},'uniqueid':{'type':Sequelize[_0x69cd('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x69cd('0x6')]},'completed':{'type':Sequelize[_0x69cd('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xdf0f=['moment','DATE','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x5af1ce,_0x318f6e){var _0x4e7f4f=function(_0x4c4c90){while(--_0x4c4c90){_0x5af1ce['push'](_0x5af1ce['shift']());}};_0x4e7f4f(++_0x318f6e);}(_0xdf0f,0x10e));var _0xfdf0=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdf0f[_0x17d9e3];return _0x14192d;};'use strict';var moment=require(_0xfdf0('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xfdf0('0x1')],'set':function(_0x5cc0aa){this[_0xfdf0('0x2')]('starttime',_0x5cc0aa);this['setDataValue']('endtime',moment()[_0xfdf0('0x3')](_0xfdf0('0x4')));}},'endtime':{'type':Sequelize[_0xfdf0('0x1')]},'membername':{'type':Sequelize[_0xfdf0('0x5')]},'projectname':{'type':Sequelize[_0xfdf0('0x5')]},'queue':{'type':Sequelize[_0xfdf0('0x5')]},'uniqueid':{'type':Sequelize[_0xfdf0('0x5')]},'calleridname':{'type':Sequelize[_0xfdf0('0x5')]},'calleridnum':{'type':Sequelize[_0xfdf0('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 395608a..5455afc 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 _0x971c=['create','body','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x971c,0xf6));var _0xc971=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x971c[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc971('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc971('0x1'));var Mustache=require(_0xc971('0x2'));var util=require(_0xc971('0x3'));var path=require(_0xc971('0x4'));var sox=require(_0xc971('0x5'));var csv=require(_0xc971('0x6'));var ejs=require(_0xc971('0x7'));var fs=require('fs');var fs_extra=require(_0xc971('0x8'));var _=require(_0xc971('0x9'));var squel=require('squel');var crypto=require(_0xc971('0xa'));var jsforce=require(_0xc971('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc971('0xc'));var Papa=require(_0xc971('0xd'));var Redis=require(_0xc971('0xe'));var authService=require(_0xc971('0xf'));var qs=require(_0xc971('0x10'));var as=require(_0xc971('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc971('0x12'))(_0xc971('0x13'));var utils=require(_0xc971('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc971('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599267,_0x258768){_0x258768=_0x258768||0xcc;return function(_0x1fabb3){if(_0x1fabb3){return _0x599267[_0xc971('0x16')](_0x258768);}return _0x599267[_0xc971('0x17')](_0x258768)[_0xc971('0x18')]();};}function respondWithResult(_0x1bc5ad,_0x4d48bd){_0x4d48bd=_0x4d48bd||0xc8;return function(_0x310af8){if(_0x310af8){return _0x1bc5ad[_0xc971('0x17')](_0x4d48bd)['json'](_0x310af8);}};}function respondWithFilteredResult(_0x34474d,_0x1ec194){return function(_0x276067){if(_0x276067){var _0x33821d=typeof _0x1ec194[_0xc971('0x19')]===_0xc971('0x1a')&&typeof _0x1ec194[_0xc971('0x1b')]===_0xc971('0x1a');var _0x23b8fe=_0x276067[_0xc971('0x1c')];var _0x36f627=_0x33821d?0x0:_0x1ec194[_0xc971('0x19')];var _0x4d3cc1=_0x33821d?_0x276067[_0xc971('0x1c')]:_0x1ec194[_0xc971('0x19')]+_0x1ec194['limit'];var _0x1e8e4c;if(_0x4d3cc1>=_0x23b8fe){_0x4d3cc1=_0x23b8fe;_0x1e8e4c=0xc8;}else{_0x1e8e4c=0xce;}_0x34474d[_0xc971('0x17')](_0x1e8e4c);return _0x34474d[_0xc971('0x1d')](_0xc971('0x1e'),_0x36f627+'-'+_0x4d3cc1+'/'+_0x23b8fe)[_0xc971('0x1f')](_0x276067);}return null;};}function patchUpdates(_0x69a3e2){return function(_0x627451){try{jsonpatch[_0xc971('0x20')](_0x627451,_0x69a3e2,!![]);}catch(_0x31aa46){return BPromise[_0xc971('0x21')](_0x31aa46);}return _0x627451[_0xc971('0x22')]();};}function saveUpdates(_0x16741c,_0x52ecc9){return function(_0x30200f){if(_0x30200f){return _0x30200f['update'](_0x16741c)[_0xc971('0x23')](function(_0x335f2c){return _0x335f2c;});}return null;};}function removeEntity(_0x499f11,_0x206603){return function(_0x3ec332){if(_0x3ec332){return _0x3ec332['destroy']()[_0xc971('0x23')](function(){_0x499f11[_0xc971('0x17')](0xcc)[_0xc971('0x18')]();});}};}function handleEntityNotFound(_0x4e7af0,_0x59c00a){return function(_0x5eb617){if(!_0x5eb617){_0x4e7af0[_0xc971('0x16')](0x194);}return _0x5eb617;};}function handleError(_0x1b7a61,_0x3998de){_0x3998de=_0x3998de||0x1f4;return function(_0x4c8bdf){logger[_0xc971('0x24')](_0x4c8bdf['stack']);if(_0x4c8bdf[_0xc971('0x25')]){delete _0x4c8bdf['name'];}_0x1b7a61[_0xc971('0x17')](_0x3998de)[_0xc971('0x26')](_0x4c8bdf);};}exports[_0xc971('0x27')]=function(_0x3ff76a,_0x2f3af5){var _0x39561f={},_0x285e60={},_0x1b746a={'count':0x0,'rows':[]};var _0x519260=_[_0xc971('0x28')](db[_0xc971('0x29')]['rawAttributes'],function(_0x22a555){return{'name':_0x22a555[_0xc971('0x2a')],'type':_0x22a555[_0xc971('0x2b')][_0xc971('0x2c')]};});_0x285e60[_0xc971('0x2d')]=_[_0xc971('0x28')](_0x519260,'name');_0x285e60['query']=_[_0xc971('0x2e')](_0x3ff76a['query']);_0x285e60[_0xc971('0x2f')]=_[_0xc971('0x30')](_0x285e60[_0xc971('0x2d')],_0x285e60[_0xc971('0x31')]);_0x39561f[_0xc971('0x32')]=_[_0xc971('0x30')](_0x285e60[_0xc971('0x2d')],qs['fields'](_0x3ff76a['query'][_0xc971('0x33')]));_0x39561f[_0xc971('0x32')]=_0x39561f[_0xc971('0x32')][_0xc971('0x34')]?_0x39561f['attributes']:_0x285e60[_0xc971('0x2d')];if(!_0x3ff76a[_0xc971('0x31')][_0xc971('0x35')](_0xc971('0x36'))){_0x39561f['limit']=qs[_0xc971('0x1b')](_0x3ff76a[_0xc971('0x31')][_0xc971('0x1b')]);_0x39561f[_0xc971('0x19')]=qs[_0xc971('0x19')](_0x3ff76a[_0xc971('0x31')][_0xc971('0x19')]);}_0x39561f[_0xc971('0x37')]=qs[_0xc971('0x38')](_0x3ff76a[_0xc971('0x31')][_0xc971('0x38')]);_0x39561f[_0xc971('0x39')]=qs[_0xc971('0x2f')](_[_0xc971('0x3a')](_0x3ff76a[_0xc971('0x31')],_0x285e60[_0xc971('0x2f')]),_0x519260);if(_0x3ff76a[_0xc971('0x31')]['filter']){_0x39561f['where']=_[_0xc971('0x3b')](_0x39561f[_0xc971('0x39')],{'$or':_['map'](_0x519260,function(_0xdd07c8){if(_0xdd07c8[_0xc971('0x2b')]!==_0xc971('0x3c')){var _0x131311={};_0x131311[_0xdd07c8[_0xc971('0x25')]]={'$like':'%'+_0x3ff76a[_0xc971('0x31')][_0xc971('0x3d')]+'%'};return _0x131311;}})});}_0x39561f=_[_0xc971('0x3b')]({},_0x39561f,_0x3ff76a['options']);var _0x4b14e5={'where':_0x39561f['where']};return db[_0xc971('0x29')]['count'](_0x4b14e5)[_0xc971('0x23')](function(_0x190941){_0x1b746a[_0xc971('0x1c')]=_0x190941;if(_0x3ff76a[_0xc971('0x31')][_0xc971('0x3e')]){_0x39561f[_0xc971('0x3f')]=[{'all':!![]}];}return db[_0xc971('0x29')][_0xc971('0x40')](_0x39561f);})[_0xc971('0x23')](function(_0x2d0607){_0x1b746a[_0xc971('0x41')]=_0x2d0607;return _0x1b746a;})[_0xc971('0x23')](respondWithFilteredResult(_0x2f3af5,_0x39561f))[_0xc971('0x42')](handleError(_0x2f3af5,null));};exports[_0xc971('0x43')]=function(_0xc53265,_0x2d3113){var _0x24c4a1={'raw':!![],'where':{'id':_0xc53265[_0xc971('0x44')]['id']}},_0x121c96={};_0x121c96[_0xc971('0x2d')]=_['keys'](db['JscriptySessionReport'][_0xc971('0x45')]);_0x121c96['query']=_['keys'](_0xc53265['query']);_0x121c96[_0xc971('0x2f')]=_[_0xc971('0x30')](_0x121c96['model'],_0x121c96[_0xc971('0x31')]);_0x24c4a1[_0xc971('0x32')]=_[_0xc971('0x30')](_0x121c96[_0xc971('0x2d')],qs[_0xc971('0x33')](_0xc53265[_0xc971('0x31')][_0xc971('0x33')]));_0x24c4a1[_0xc971('0x32')]=_0x24c4a1['attributes']['length']?_0x24c4a1[_0xc971('0x32')]:_0x121c96[_0xc971('0x2d')];if(_0xc53265[_0xc971('0x31')][_0xc971('0x3e')]){_0x24c4a1[_0xc971('0x3f')]=[{'all':!![]}];}_0x24c4a1=_[_0xc971('0x3b')]({},_0x24c4a1,_0xc53265['options']);return db[_0xc971('0x29')]['find'](_0x24c4a1)[_0xc971('0x23')](handleEntityNotFound(_0x2d3113,null))[_0xc971('0x23')](respondWithResult(_0x2d3113,null))[_0xc971('0x42')](handleError(_0x2d3113,null));};exports['create']=function(_0x3dfa5e,_0x4ab03c){return db[_0xc971('0x29')][_0xc971('0x46')](_0x3dfa5e[_0xc971('0x47')],{})['then'](respondWithResult(_0x4ab03c,0xc9))[_0xc971('0x42')](handleError(_0x4ab03c,null));};exports['update']=function(_0x57febf,_0x58eaf6){if(_0x57febf[_0xc971('0x47')]['id']){delete _0x57febf[_0xc971('0x47')]['id'];}return db[_0xc971('0x29')][_0xc971('0x48')]({'where':{'id':_0x57febf[_0xc971('0x44')]['id']}})[_0xc971('0x23')](handleEntityNotFound(_0x58eaf6,null))[_0xc971('0x23')](saveUpdates(_0x57febf['body'],null))['then'](respondWithResult(_0x58eaf6,null))[_0xc971('0x42')](handleError(_0x58eaf6,null));};exports[_0xc971('0x49')]=function(_0x494353,_0x512c7f){return db[_0xc971('0x29')][_0xc971('0x48')]({'where':{'id':_0x494353[_0xc971('0x44')]['id']}})[_0xc971('0x23')](handleEntityNotFound(_0x512c7f,null))[_0xc971('0x23')](removeEntity(_0x512c7f,null))['catch'](handleError(_0x512c7f,null));};exports[_0xc971('0x4a')]=function(_0x1248d5,_0x17d95b){return db[_0xc971('0x29')][_0xc971('0x4a')]()[_0xc971('0x23')](respondWithResult(_0x17d95b,null))[_0xc971('0x42')](handleError(_0x17d95b,null));};exports[_0xc971('0x4b')]=function(_0x128c09,_0x567351,_0x269617){var _0x5d4c4d={'raw':!![],'where':{}};var _0x361200={};var _0x55d974={'count':0x0,'rows':[]};return db[_0xc971('0x29')][_0xc971('0x4c')]({'where':{'id':_0x128c09[_0xc971('0x44')]['id']}})[_0xc971('0x23')](handleEntityNotFound(_0x567351,null))[_0xc971('0x23')](function(_0x338c17){if(_0x338c17){_0x361200[_0xc971('0x2d')]=_[_0xc971('0x2e')](db[_0xc971('0x4d')]['rawAttributes']);_0x361200[_0xc971('0x31')]=_[_0xc971('0x2e')](_0x128c09[_0xc971('0x31')]);_0x361200[_0xc971('0x2f')]=_['intersection'](_0x361200[_0xc971('0x2d')],_0x361200[_0xc971('0x31')]);_0x5d4c4d[_0xc971('0x32')]=_[_0xc971('0x30')](_0x361200['model'],qs[_0xc971('0x33')](_0x128c09['query'][_0xc971('0x33')]));_0x5d4c4d[_0xc971('0x32')]=_0x5d4c4d[_0xc971('0x32')]['length']?_0x5d4c4d[_0xc971('0x32')]:_0x361200['model'];if(!_0x128c09[_0xc971('0x31')]['hasOwnProperty'](_0xc971('0x36'))){_0x5d4c4d[_0xc971('0x1b')]=qs[_0xc971('0x1b')](_0x128c09[_0xc971('0x31')]['limit']);_0x5d4c4d[_0xc971('0x19')]=qs['offset'](_0x128c09[_0xc971('0x31')]['offset']);}_0x5d4c4d[_0xc971('0x37')]=qs[_0xc971('0x38')](_0x128c09[_0xc971('0x31')]['sort']);_0x5d4c4d[_0xc971('0x39')]=qs[_0xc971('0x2f')](_['pick'](_0x128c09[_0xc971('0x31')],_0x361200[_0xc971('0x2f')]));_0x5d4c4d['where'][_0xc971('0x4e')]=_0x338c17['id'];if(_0x128c09[_0xc971('0x31')][_0xc971('0x3d')]){_0x5d4c4d[_0xc971('0x39')]=_['merge'](_0x5d4c4d['where'],{'$or':_[_0xc971('0x28')](_0x5d4c4d[_0xc971('0x32')],function(_0x14b764){var _0x1cdc45={};_0x1cdc45[_0x14b764]={'$like':'%'+_0x128c09['query'][_0xc971('0x3d')]+'%'};return _0x1cdc45;})});}_0x5d4c4d=_['merge']({},_0x5d4c4d,_0x128c09['options']);return db['JscriptyQuestionReport'][_0xc971('0x1c')]({'where':_0x5d4c4d['where']})[_0xc971('0x23')](function(_0x32e46a){_0x55d974['count']=_0x32e46a;if(_0x128c09['query'][_0xc971('0x3e')]){_0x5d4c4d[_0xc971('0x3f')]=[{'all':!![]}];}return db[_0xc971('0x4d')][_0xc971('0x40')](_0x5d4c4d);})['then'](function(_0x56e673){_0x55d974[_0xc971('0x41')]=_0x56e673;return _0x55d974;});}})['then'](respondWithFilteredResult(_0x567351,_0x5d4c4d))[_0xc971('0x42')](handleError(_0x567351,null));}; \ No newline at end of file +var _0x2600=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','count','set','apply','reject','save','destroy','sendStatus','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','then','includeAll','include','findAll','rows','catch','params','keys','find','create','update','body','describe','getQuestions','JscriptyQuestionReport','pick','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2600,0x9a));var _0x0260=function(_0x262619,_0x570d3f){_0x262619=_0x262619-0x0;var _0x115d26=_0x2600[_0x262619];return _0x115d26;};'use strict';var emlformat=require(_0x0260('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0260('0x1'));var jsonpatch=require(_0x0260('0x2'));var rp=require(_0x0260('0x3'));var moment=require(_0x0260('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0260('0x5'));var path=require(_0x0260('0x6'));var sox=require(_0x0260('0x7'));var csv=require(_0x0260('0x8'));var ejs=require(_0x0260('0x9'));var fs=require('fs');var fs_extra=require(_0x0260('0xa'));var _=require(_0x0260('0xb'));var squel=require(_0x0260('0xc'));var crypto=require(_0x0260('0xd'));var jsforce=require(_0x0260('0xe'));var deskjs=require(_0x0260('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0260('0x10'));var Papa=require(_0x0260('0x11'));var Redis=require(_0x0260('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0260('0x13'));var as=require(_0x0260('0x14'));var hardwareService=require(_0x0260('0x15'));var logger=require(_0x0260('0x16'))(_0x0260('0x17'));var utils=require('../../config/utils');var config=require(_0x0260('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0260('0x19'))['db'];function respondWithStatusCode(_0x4c517d,_0x2598cc){_0x2598cc=_0x2598cc||0xcc;return function(_0x36273a){if(_0x36273a){return _0x4c517d['sendStatus'](_0x2598cc);}return _0x4c517d[_0x0260('0x1a')](_0x2598cc)[_0x0260('0x1b')]();};}function respondWithResult(_0xb33057,_0x14fbb6){_0x14fbb6=_0x14fbb6||0xc8;return function(_0x1be44c){if(_0x1be44c){return _0xb33057[_0x0260('0x1a')](_0x14fbb6)[_0x0260('0x1c')](_0x1be44c);}};}function respondWithFilteredResult(_0x50d7c4,_0x319f06){return function(_0xe6b7e6){if(_0xe6b7e6){var _0x5287a2=typeof _0x319f06[_0x0260('0x1d')]==='undefined'&&typeof _0x319f06['limit']==='undefined';var _0x3601a8=_0xe6b7e6['count'];var _0x29a65e=_0x5287a2?0x0:_0x319f06[_0x0260('0x1d')];var _0x2abcc0=_0x5287a2?_0xe6b7e6[_0x0260('0x1e')]:_0x319f06[_0x0260('0x1d')]+_0x319f06['limit'];var _0x15407c;if(_0x2abcc0>=_0x3601a8){_0x2abcc0=_0x3601a8;_0x15407c=0xc8;}else{_0x15407c=0xce;}_0x50d7c4[_0x0260('0x1a')](_0x15407c);return _0x50d7c4[_0x0260('0x1f')]('Content-Range',_0x29a65e+'-'+_0x2abcc0+'/'+_0x3601a8)['json'](_0xe6b7e6);}return null;};}function patchUpdates(_0x3b824f){return function(_0x142374){try{jsonpatch[_0x0260('0x20')](_0x142374,_0x3b824f,!![]);}catch(_0x187be4){return BPromise[_0x0260('0x21')](_0x187be4);}return _0x142374[_0x0260('0x22')]();};}function saveUpdates(_0x1b49ed,_0x40c594){return function(_0x518190){if(_0x518190){return _0x518190['update'](_0x1b49ed)['then'](function(_0x3491b1){return _0x3491b1;});}return null;};}function removeEntity(_0x1f0495,_0x28d116){return function(_0x48a7d3){if(_0x48a7d3){return _0x48a7d3[_0x0260('0x23')]()['then'](function(){_0x1f0495[_0x0260('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520643,_0x171a96){return function(_0x4c4393){if(!_0x4c4393){_0x520643[_0x0260('0x24')](0x194);}return _0x4c4393;};}function handleError(_0x2cb10f,_0x4a8357){_0x4a8357=_0x4a8357||0x1f4;return function(_0x2f085e){logger[_0x0260('0x25')](_0x2f085e['stack']);if(_0x2f085e[_0x0260('0x26')]){delete _0x2f085e['name'];}_0x2cb10f[_0x0260('0x1a')](_0x4a8357)[_0x0260('0x27')](_0x2f085e);};}exports[_0x0260('0x28')]=function(_0x1b0cb0,_0x477c79){var _0xbc5b74={},_0x4ad7d4={},_0x3ff0b4={'count':0x0,'rows':[]};var _0x3d8dbe=_[_0x0260('0x29')](db[_0x0260('0x2a')][_0x0260('0x2b')],function(_0x4a2f35){return{'name':_0x4a2f35[_0x0260('0x2c')],'type':_0x4a2f35[_0x0260('0x2d')][_0x0260('0x2e')]};});_0x4ad7d4['model']=_[_0x0260('0x29')](_0x3d8dbe,_0x0260('0x26'));_0x4ad7d4[_0x0260('0x2f')]=_['keys'](_0x1b0cb0[_0x0260('0x2f')]);_0x4ad7d4[_0x0260('0x30')]=_[_0x0260('0x31')](_0x4ad7d4[_0x0260('0x32')],_0x4ad7d4['query']);_0xbc5b74[_0x0260('0x33')]=_[_0x0260('0x31')](_0x4ad7d4[_0x0260('0x32')],qs[_0x0260('0x34')](_0x1b0cb0['query'][_0x0260('0x34')]));_0xbc5b74[_0x0260('0x33')]=_0xbc5b74['attributes'][_0x0260('0x35')]?_0xbc5b74[_0x0260('0x33')]:_0x4ad7d4[_0x0260('0x32')];if(!_0x1b0cb0['query'][_0x0260('0x36')](_0x0260('0x37'))){_0xbc5b74[_0x0260('0x38')]=qs[_0x0260('0x38')](_0x1b0cb0[_0x0260('0x2f')][_0x0260('0x38')]);_0xbc5b74[_0x0260('0x1d')]=qs[_0x0260('0x1d')](_0x1b0cb0['query']['offset']);}_0xbc5b74[_0x0260('0x39')]=qs[_0x0260('0x3a')](_0x1b0cb0[_0x0260('0x2f')][_0x0260('0x3a')]);_0xbc5b74[_0x0260('0x3b')]=qs[_0x0260('0x30')](_['pick'](_0x1b0cb0[_0x0260('0x2f')],_0x4ad7d4[_0x0260('0x30')]),_0x3d8dbe);if(_0x1b0cb0['query'][_0x0260('0x3c')]){_0xbc5b74['where']=_[_0x0260('0x3d')](_0xbc5b74[_0x0260('0x3b')],{'$or':_[_0x0260('0x29')](_0x3d8dbe,function(_0x2d8453){if(_0x2d8453[_0x0260('0x2d')]!=='VIRTUAL'){var _0x491861={};_0x491861[_0x2d8453[_0x0260('0x26')]]={'$like':'%'+_0x1b0cb0[_0x0260('0x2f')]['filter']+'%'};return _0x491861;}})});}_0xbc5b74=_[_0x0260('0x3d')]({},_0xbc5b74,_0x1b0cb0[_0x0260('0x3e')]);var _0x2ab7f9={'where':_0xbc5b74[_0x0260('0x3b')]};return db[_0x0260('0x2a')][_0x0260('0x1e')](_0x2ab7f9)[_0x0260('0x3f')](function(_0x250091){_0x3ff0b4['count']=_0x250091;if(_0x1b0cb0[_0x0260('0x2f')][_0x0260('0x40')]){_0xbc5b74[_0x0260('0x41')]=[{'all':!![]}];}return db[_0x0260('0x2a')][_0x0260('0x42')](_0xbc5b74);})[_0x0260('0x3f')](function(_0x4eabd6){_0x3ff0b4[_0x0260('0x43')]=_0x4eabd6;return _0x3ff0b4;})['then'](respondWithFilteredResult(_0x477c79,_0xbc5b74))[_0x0260('0x44')](handleError(_0x477c79,null));};exports['show']=function(_0x47336d,_0x178da1){var _0x4c1d83={'raw':!![],'where':{'id':_0x47336d[_0x0260('0x45')]['id']}},_0x47efa9={};_0x47efa9[_0x0260('0x32')]=_[_0x0260('0x46')](db[_0x0260('0x2a')][_0x0260('0x2b')]);_0x47efa9[_0x0260('0x2f')]=_['keys'](_0x47336d[_0x0260('0x2f')]);_0x47efa9['filters']=_[_0x0260('0x31')](_0x47efa9[_0x0260('0x32')],_0x47efa9[_0x0260('0x2f')]);_0x4c1d83[_0x0260('0x33')]=_['intersection'](_0x47efa9['model'],qs[_0x0260('0x34')](_0x47336d[_0x0260('0x2f')]['fields']));_0x4c1d83['attributes']=_0x4c1d83[_0x0260('0x33')]['length']?_0x4c1d83['attributes']:_0x47efa9['model'];if(_0x47336d[_0x0260('0x2f')][_0x0260('0x40')]){_0x4c1d83[_0x0260('0x41')]=[{'all':!![]}];}_0x4c1d83=_['merge']({},_0x4c1d83,_0x47336d[_0x0260('0x3e')]);return db[_0x0260('0x2a')][_0x0260('0x47')](_0x4c1d83)[_0x0260('0x3f')](handleEntityNotFound(_0x178da1,null))[_0x0260('0x3f')](respondWithResult(_0x178da1,null))['catch'](handleError(_0x178da1,null));};exports[_0x0260('0x48')]=function(_0x130952,_0x3f2e2e){return db['JscriptySessionReport'][_0x0260('0x48')](_0x130952['body'],{})['then'](respondWithResult(_0x3f2e2e,0xc9))['catch'](handleError(_0x3f2e2e,null));};exports[_0x0260('0x49')]=function(_0x1b011d,_0x159dc4){if(_0x1b011d[_0x0260('0x4a')]['id']){delete _0x1b011d[_0x0260('0x4a')]['id'];}return db['JscriptySessionReport'][_0x0260('0x47')]({'where':{'id':_0x1b011d[_0x0260('0x45')]['id']}})['then'](handleEntityNotFound(_0x159dc4,null))[_0x0260('0x3f')](saveUpdates(_0x1b011d['body'],null))[_0x0260('0x3f')](respondWithResult(_0x159dc4,null))[_0x0260('0x44')](handleError(_0x159dc4,null));};exports[_0x0260('0x23')]=function(_0x520c1b,_0x237dab){return db[_0x0260('0x2a')][_0x0260('0x47')]({'where':{'id':_0x520c1b[_0x0260('0x45')]['id']}})[_0x0260('0x3f')](handleEntityNotFound(_0x237dab,null))[_0x0260('0x3f')](removeEntity(_0x237dab,null))[_0x0260('0x44')](handleError(_0x237dab,null));};exports[_0x0260('0x4b')]=function(_0x547158,_0x33c6ab){return db[_0x0260('0x2a')][_0x0260('0x4b')]()[_0x0260('0x3f')](respondWithResult(_0x33c6ab,null))['catch'](handleError(_0x33c6ab,null));};exports[_0x0260('0x4c')]=function(_0x6b519b,_0x516bc6,_0x243c85){var _0x4d3428={'raw':!![],'where':{}};var _0x447c04={};var _0x4652af={'count':0x0,'rows':[]};return db[_0x0260('0x2a')]['findOne']({'where':{'id':_0x6b519b[_0x0260('0x45')]['id']}})[_0x0260('0x3f')](handleEntityNotFound(_0x516bc6,null))[_0x0260('0x3f')](function(_0x48c107){if(_0x48c107){_0x447c04[_0x0260('0x32')]=_[_0x0260('0x46')](db[_0x0260('0x4d')]['rawAttributes']);_0x447c04[_0x0260('0x2f')]=_['keys'](_0x6b519b[_0x0260('0x2f')]);_0x447c04[_0x0260('0x30')]=_[_0x0260('0x31')](_0x447c04[_0x0260('0x32')],_0x447c04[_0x0260('0x2f')]);_0x4d3428[_0x0260('0x33')]=_[_0x0260('0x31')](_0x447c04[_0x0260('0x32')],qs[_0x0260('0x34')](_0x6b519b[_0x0260('0x2f')]['fields']));_0x4d3428[_0x0260('0x33')]=_0x4d3428[_0x0260('0x33')][_0x0260('0x35')]?_0x4d3428[_0x0260('0x33')]:_0x447c04['model'];if(!_0x6b519b[_0x0260('0x2f')][_0x0260('0x36')]('nolimit')){_0x4d3428[_0x0260('0x38')]=qs['limit'](_0x6b519b[_0x0260('0x2f')]['limit']);_0x4d3428[_0x0260('0x1d')]=qs[_0x0260('0x1d')](_0x6b519b['query']['offset']);}_0x4d3428[_0x0260('0x39')]=qs[_0x0260('0x3a')](_0x6b519b[_0x0260('0x2f')][_0x0260('0x3a')]);_0x4d3428['where']=qs[_0x0260('0x30')](_[_0x0260('0x4e')](_0x6b519b[_0x0260('0x2f')],_0x447c04[_0x0260('0x30')]));_0x4d3428['where'][_0x0260('0x4f')]=_0x48c107['id'];if(_0x6b519b[_0x0260('0x2f')][_0x0260('0x3c')]){_0x4d3428['where']=_[_0x0260('0x3d')](_0x4d3428[_0x0260('0x3b')],{'$or':_['map'](_0x4d3428['attributes'],function(_0x5afb7a){var _0x28f331={};_0x28f331[_0x5afb7a]={'$like':'%'+_0x6b519b[_0x0260('0x2f')][_0x0260('0x3c')]+'%'};return _0x28f331;})});}_0x4d3428=_[_0x0260('0x3d')]({},_0x4d3428,_0x6b519b[_0x0260('0x3e')]);return db[_0x0260('0x4d')]['count']({'where':_0x4d3428[_0x0260('0x3b')]})[_0x0260('0x3f')](function(_0x3c6bb1){_0x4652af[_0x0260('0x1e')]=_0x3c6bb1;if(_0x6b519b[_0x0260('0x2f')][_0x0260('0x40')]){_0x4d3428['include']=[{'all':!![]}];}return db[_0x0260('0x4d')][_0x0260('0x42')](_0x4d3428);})[_0x0260('0x3f')](function(_0xaa6d47){_0x4652af[_0x0260('0x43')]=_0xaa6d47;return _0x4652af;});}})[_0x0260('0x3f')](respondWithFilteredResult(_0x516bc6,_0x4d3428))['catch'](handleError(_0x516bc6,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 8bf06ba..a3f4602 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 _0xcca7=['request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','report_jscripty_sessions','lodash','util','../../config/logger','api'];(function(_0x35ead7,_0x453d3a){var _0x33b761=function(_0x1c28b9){while(--_0x1c28b9){_0x35ead7['push'](_0x35ead7['shift']());}};_0x33b761(++_0x453d3a);}(_0xcca7,0x1aa));var _0x7cca=function(_0x59432f,_0x4677e6){_0x59432f=_0x59432f-0x0;var _0x1a0f62=_0xcca7[_0x59432f];return _0x1a0f62;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var attributes=require(_0x7cca('0x7'));module[_0x7cca('0x8')]=function(_0x1c6c95,_0xe70805){return _0x1c6c95['define']('JscriptySessionReport',attributes,{'tableName':_0x7cca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd8=['./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x89427,_0x533fa3){var _0x5695ad=function(_0x184ed7){while(--_0x184ed7){_0x89427['push'](_0x89427['shift']());}};_0x5695ad(++_0x533fa3);}(_0x2bd8,0x130));var _0x82bd=function(_0x4e00c8,_0x3a3c34){_0x4e00c8=_0x4e00c8-0x0;var _0x514edb=_0x2bd8[_0x4e00c8];return _0x514edb;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x3bf810,_0x5ceb60){return _0x3bf810[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'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 ea6ac8f..f301017 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 _0x0120=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x8e015d,_0x49893f){var _0x5c5653=function(_0x1e2abb){while(--_0x1e2abb){_0x8e015d['push'](_0x8e015d['shift']());}};_0x5c5653(++_0x49893f);}(_0x0120,0x6f));var _0x0012=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0120[_0x432682];return _0x463d05;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});} \ No newline at end of file +var _0x8aad=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x48c042,_0x678407){var _0x547759=function(_0x36256a){while(--_0x36256a){_0x48c042['push'](_0x48c042['shift']());}};_0x547759(++_0x678407);}(_0x8aad,0x146));var _0xd8aa=function(_0x1a1b12,_0x45dd79){_0x1a1b12=_0x1a1b12-0x0;var _0x1e2f23=_0x8aad[_0x1a1b12];return _0x1e2f23;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 23bbe3d..930a753 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 _0xf939=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','update','exports','multer','path'];(function(_0x3797ae,_0x257d56){var _0x43c669=function(_0x51bbc6){while(--_0x51bbc6){_0x3797ae['push'](_0x3797ae['shift']());}};_0x43c669(++_0x257d56);}(_0xf939,0x1b8));var _0x9f93=function(_0x26b613,_0x1db457){_0x26b613=_0x26b613-0x0;var _0x3497e1=_0xf939[_0x26b613];return _0x3497e1;};'use strict';var multer=require(_0x9f93('0x0'));var util=require('util');var path=require(_0x9f93('0x1'));var timeout=require(_0x9f93('0x2'));var express=require(_0x9f93('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f93('0x4'));var interaction=require(_0x9f93('0x5'));var config=require(_0x9f93('0x6'));var controller=require(_0x9f93('0x7'));router[_0x9f93('0x8')]('/',controller['index']);router[_0x9f93('0x9')](_0x9f93('0xa'),auth['isAuthenticated'](),controller[_0x9f93('0xb')]);module[_0x9f93('0xc')]=router; \ No newline at end of file +var _0x158f=['Router','fs-extra','../../components/auth/service','../../config/environment','get','index','put','/:id','isAuthenticated','update','exports','util','path','connect-timeout','express'];(function(_0x593d8d,_0x48708c){var _0x52a3dc=function(_0x472c45){while(--_0x472c45){_0x593d8d['push'](_0x593d8d['shift']());}};_0x52a3dc(++_0x48708c);}(_0x158f,0x137));var _0xf158=function(_0x1d537f,_0x1c479c){_0x1d537f=_0x1d537f-0x0;var _0x4cfd45=_0x158f[_0x1d537f];return _0x4cfd45;};'use strict';var multer=require('multer');var util=require(_0xf158('0x0'));var path=require(_0xf158('0x1'));var timeout=require(_0xf158('0x2'));var express=require(_0xf158('0x3'));var router=express[_0xf158('0x4')]();var fs_extra=require(_0xf158('0x5'));var auth=require(_0xf158('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf158('0x7'));var controller=require('./license.controller');router[_0xf158('0x8')]('/',controller[_0xf158('0x9')]);router[_0xf158('0xa')](_0xf158('0xb'),auth[_0xf158('0xc')](),controller[_0xf158('0xd')]);module[_0xf158('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 5609ad9..5ef763d 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 _0xe5c3=['STRING','INTEGER','sequelize','exports'];(function(_0x9ec81f,_0x21d9cc){var _0x3e922b=function(_0xd18e21){while(--_0xd18e21){_0x9ec81f['push'](_0x9ec81f['shift']());}};_0x3e922b(++_0x21d9cc);}(_0xe5c3,0x1a2));var _0x3e5c=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xe5c3[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x3e5c('0x0'));module[_0x3e5c('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x3e5c('0x2')]},'data2':{'type':Sequelize[_0x3e5c('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x3e5c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0347=['STRING','INTEGER','sequelize','exports'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x0347,0xfe));var _0x7034=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0347[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7034('0x0'));module[_0x7034('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x7034('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x7034('0x3')],'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 2273640..35c7af4 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 _0x1967=['params','checkLicense','key','demo','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','index','model','keys','rawAttributes','query','intersection','attributes','fields','merge','getLicense','body','find'];(function(_0x3c5ac1,_0x4f0022){var _0x5a5dcb=function(_0x4140a1){while(--_0x4140a1){_0x3c5ac1['push'](_0x3c5ac1['shift']());}};_0x5a5dcb(++_0x4f0022);}(_0x1967,0x173));var _0x7196=function(_0x12aeb8,_0xe953c2){_0x12aeb8=_0x12aeb8-0x0;var _0x170e36=_0x1967[_0x12aeb8];return _0x170e36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}var utilLicense=require('../../config/license/util');exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={'raw':!![],'where':{'id':0x1}},_0x30151f={};_0x30151f[_0x7196('0x2d')]=_[_0x7196('0x2e')](db['License'][_0x7196('0x2f')]);_0x30151f[_0x7196('0x30')]=_[_0x7196('0x2e')](_0x4ecea1[_0x7196('0x30')]);_0x30151f['filters']=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],_0x30151f[_0x7196('0x30')]);_0x59d79d[_0x7196('0x32')]=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],qs[_0x7196('0x33')](_0x4ecea1[_0x7196('0x30')][_0x7196('0x33')]));_0x59d79d[_0x7196('0x32')]=_0x59d79d[_0x7196('0x32')]['length']?_0x59d79d[_0x7196('0x32')]:_0x30151f['model'];_0x59d79d=_[_0x7196('0x34')]({},_0x59d79d,_0x4ecea1['options']);return utilLicense[_0x7196('0x35')](_0x59d79d)[_0x7196('0x27')](respondWithResult(_0x4fd339,null))['catch'](handleError(_0x4fd339,null));};exports[_0x7196('0x26')]=function(_0x2bcadd,_0x4531d7){if(_0x2bcadd[_0x7196('0x36')]['id']){delete _0x2bcadd[_0x7196('0x36')]['id'];}return db['License'][_0x7196('0x37')]({'where':{'id':_0x2bcadd[_0x7196('0x38')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x4531d7,null))[_0x7196('0x27')](function(_0x3e8f98){var _0x123cad=_0x3e8f98['get']({'plain':!![]});return utilLicense[_0x7196('0x39')](_0x123cad,_0x2bcadd[_0x7196('0x36')][_0x7196('0x3a')]);})['then'](function(_0x33831a){if(!_0x33831a[_0x7196('0x3b')]){return saveUpdates(_0x2bcadd[_0x7196('0x36')],null);}return _0x33831a;})[_0x7196('0x27')](respondWithResult(_0x4531d7,null))[_0x7196('0x3c')](handleError(_0x4531d7,null));}; \ No newline at end of file +var _0xc4aa=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}var utilLicense=require(_0xac4a('0x15'));exports[_0xac4a('0x2a')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={'raw':!![],'where':{'id':0x1}},_0x47f49c={};_0x47f49c[_0xac4a('0x2b')]=_[_0xac4a('0x2c')](db[_0xac4a('0x2d')]['rawAttributes']);_0x47f49c['query']=_[_0xac4a('0x2c')](_0x2772fe[_0xac4a('0x2e')]);_0x47f49c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x47f49c[_0xac4a('0x2b')],_0x47f49c['query']);_0x4a5a9e[_0xac4a('0x31')]=_['intersection'](_0x47f49c[_0xac4a('0x2b')],qs['fields'](_0x2772fe[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x4a5a9e[_0xac4a('0x31')]=_0x4a5a9e[_0xac4a('0x31')][_0xac4a('0x33')]?_0x4a5a9e[_0xac4a('0x31')]:_0x47f49c[_0xac4a('0x2b')];_0x4a5a9e=_[_0xac4a('0x34')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x35')]);return utilLicense[_0xac4a('0x36')](_0x4a5a9e)[_0xac4a('0x24')](respondWithResult(_0x116700,null))[_0xac4a('0x37')](handleError(_0x116700,null));};exports[_0xac4a('0x23')]=function(_0x1a9d4e,_0x5634e2){if(_0x1a9d4e[_0xac4a('0x38')]['id']){delete _0x1a9d4e[_0xac4a('0x38')]['id'];}return db['License'][_0xac4a('0x39')]({'where':{'id':_0x1a9d4e[_0xac4a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5634e2,null))['then'](function(_0x11f0be){var _0x1ba096=_0x11f0be[_0xac4a('0x3b')]({'plain':!![]});return utilLicense[_0xac4a('0x3c')](_0x1ba096,_0x1a9d4e['body'][_0xac4a('0x3d')]);})[_0xac4a('0x24')](function(_0x4e7630){if(!_0x4e7630[_0xac4a('0x3e')]){return saveUpdates(_0x1a9d4e[_0xac4a('0x38')],null);}return _0x4e7630;})[_0xac4a('0x24')](respondWithResult(_0x5634e2,null))['catch'](handleError(_0x5634e2,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 0890b73..5ed7b31 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 _0x8395=['exports','define','License','license','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./license.attributes'];(function(_0x2a4dbf,_0x51d721){var _0x2a5261=function(_0x592ff3){while(--_0x592ff3){_0x2a4dbf['push'](_0x2a4dbf['shift']());}};_0x2a5261(++_0x51d721);}(_0x8395,0xac));var _0x5839=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x8395[_0x256d6a];return _0x460058;};'use strict';var _=require(_0x5839('0x0'));var util=require('util');var logger=require(_0x5839('0x1'))(_0x5839('0x2'));var moment=require(_0x5839('0x3'));var BPromise=require(_0x5839('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5839('0x5'));var config=require(_0x5839('0x6'));var attributes=require(_0x5839('0x7'));module[_0x5839('0x8')]=function(_0x85b1fe,_0x1c5d36){return _0x85b1fe[_0x5839('0x9')](_0x5839('0xa'),attributes,{'tableName':_0x5839('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2286=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','license','lodash'];(function(_0x433fed,_0x118d04){var _0x134cfa=function(_0x465d8c){while(--_0x465d8c){_0x433fed['push'](_0x433fed['shift']());}};_0x134cfa(++_0x118d04);}(_0x2286,0x180));var _0x6228=function(_0x303074,_0x1c1b0d){_0x303074=_0x303074-0x0;var _0x3a0f26=_0x2286[_0x303074];return _0x3a0f26;};'use strict';var _=require(_0x6228('0x0'));var util=require(_0x6228('0x1'));var logger=require(_0x6228('0x2'))(_0x6228('0x3'));var moment=require(_0x6228('0x4'));var BPromise=require(_0x6228('0x5'));var rp=require(_0x6228('0x6'));var fs=require('fs');var path=require(_0x6228('0x7'));var rimraf=require('rimraf');var config=require(_0x6228('0x8'));var attributes=require('./license.attributes');module[_0x6228('0x9')]=function(_0x26f6ee,_0x1e9b5e){return _0x26f6ee['define']('License',attributes,{'tableName':_0x6228('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index a693cdc..7e3de59 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 _0x1a2c=['request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise'];(function(_0x24f277,_0x170f8d){var _0x115306=function(_0x4001f5){while(--_0x4001f5){_0x24f277['push'](_0x24f277['shift']());}};_0x115306(++_0x170f8d);}(_0x1a2c,0x175));var _0xc1a2=function(_0x5545f1,_0x4b0e56){_0x5545f1=_0x5545f1-0x0;var _0x4e0c00=_0x1a2c[_0x5545f1];return _0x4e0c00;};'use strict';var _=require('lodash');var util=require(_0xc1a2('0x0'));var moment=require(_0xc1a2('0x1'));var BPromise=require(_0xc1a2('0x2'));var rs=require(_0xc1a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc1a2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc1a2('0x5'));var jayson=require(_0xc1a2('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c7916,_0x3a3fa4,_0x4c94a2){return new BPromise(function(_0x19c59c,_0x5dbefd){return client[_0xc1a2('0x7')](_0x5c7916,_0x4c94a2)[_0xc1a2('0x8')](function(_0x5a5431){logger[_0xc1a2('0x9')](_0xc1a2('0xa'),_0x3a3fa4,_0xc1a2('0xb'));logger[_0xc1a2('0xc')](_0xc1a2('0xd'),_0x3a3fa4,_0xc1a2('0xb'),JSON[_0xc1a2('0xe')](_0x5a5431));if(_0x5a5431['error']){if(_0x5a5431[_0xc1a2('0xf')]['code']===0x1f4){logger[_0xc1a2('0xf')](_0xc1a2('0xa'),_0x3a3fa4,_0x5a5431[_0xc1a2('0xf')][_0xc1a2('0x10')]);return _0x5dbefd(_0x5a5431['error'][_0xc1a2('0x10')]);}logger[_0xc1a2('0xf')](_0xc1a2('0xa'),_0x3a3fa4,_0x5a5431[_0xc1a2('0xf')][_0xc1a2('0x10')]);return _0x19c59c(_0x5a5431['error']['message']);}else{logger['info'](_0xc1a2('0xa'),_0x3a3fa4,'request\x20sent');_0x19c59c(_0x5a5431[_0xc1a2('0x11')][_0xc1a2('0x10')]);}})[_0xc1a2('0x12')](function(_0x4db631){logger[_0xc1a2('0xf')](_0xc1a2('0xa'),_0x3a3fa4,_0x4db631);_0x5dbefd(_0x4db631);});});} \ No newline at end of file +var _0x3bdf=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird'];(function(_0x566b99,_0xf3721a){var _0x1af8d4=function(_0x380239){while(--_0x380239){_0x566b99['push'](_0x566b99['shift']());}};_0x1af8d4(++_0xf3721a);}(_0x3bdf,0xd9));var _0xf3bd=function(_0x2beef1,_0x3ae65c){_0x2beef1=_0x2beef1-0x0;var _0x3bc8d4=_0x3bdf[_0x2beef1];return _0x3bc8d4;};'use strict';var _=require(_0xf3bd('0x0'));var util=require(_0xf3bd('0x1'));var moment=require('moment');var BPromise=require(_0xf3bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3bd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3bd('0x4'));var logger=require(_0xf3bd('0x5'))(_0xf3bd('0x6'));var config=require(_0xf3bd('0x7'));var jayson=require(_0xf3bd('0x8'));var client=jayson[_0xf3bd('0x9')][_0xf3bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40b0b1,_0x4b6a7a,_0x1f09fb){return new BPromise(function(_0x48aed8,_0x3d517d){return client[_0xf3bd('0xb')](_0x40b0b1,_0x1f09fb)[_0xf3bd('0xc')](function(_0x16b919){logger[_0xf3bd('0xd')](_0xf3bd('0xe'),_0x4b6a7a,_0xf3bd('0xf'));logger[_0xf3bd('0x10')](_0xf3bd('0x11'),_0x4b6a7a,_0xf3bd('0xf'),JSON['stringify'](_0x16b919));if(_0x16b919[_0xf3bd('0x12')]){if(_0x16b919[_0xf3bd('0x12')][_0xf3bd('0x13')]===0x1f4){logger[_0xf3bd('0x12')](_0xf3bd('0xe'),_0x4b6a7a,_0x16b919['error']['message']);return _0x3d517d(_0x16b919['error'][_0xf3bd('0x14')]);}logger['error'](_0xf3bd('0xe'),_0x4b6a7a,_0x16b919[_0xf3bd('0x12')][_0xf3bd('0x14')]);return _0x48aed8(_0x16b919['error'][_0xf3bd('0x14')]);}else{logger[_0xf3bd('0xd')](_0xf3bd('0xe'),_0x4b6a7a,_0xf3bd('0xf'));_0x48aed8(_0x16b919[_0xf3bd('0x15')][_0xf3bd('0x14')]);}})['catch'](function(_0x5d58bf){logger[_0xf3bd('0x12')]('License,\x20%s,\x20%s',_0x4b6a7a,_0x5d58bf);_0x3d517d(_0x5d58bf);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 597b458..db94e90 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 _0x2262=['/:id/send','send','addAgents','put','/:id','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','describe','isAuthenticated','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','/:id/dispositions','addDisposition','addAnswer','post','addImap','addSmtp','addInteraction','/:id/applications','addApplications'];(function(_0x382ed5,_0x44cc69){var _0x491319=function(_0x3150d8){while(--_0x3150d8){_0x382ed5['push'](_0x382ed5['shift']());}};_0x491319(++_0x44cc69);}(_0x2262,0x194));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2226('0x0'));var util=require(_0x2226('0x1'));var path=require(_0x2226('0x2'));var timeout=require(_0x2226('0x3'));var express=require(_0x2226('0x4'));var router=express[_0x2226('0x5')]();var fs_extra=require(_0x2226('0x6'));var auth=require(_0x2226('0x7'));var interaction=require(_0x2226('0x8'));var config=require(_0x2226('0x9'));var controller=require(_0x2226('0xa'));router[_0x2226('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2226('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x2226('0xc')]);router[_0x2226('0xb')]('/:id',auth[_0x2226('0xd')](),controller[_0x2226('0xe')]);router[_0x2226('0xb')]('/:id/dispositions',auth[_0x2226('0xd')](),controller[_0x2226('0xf')]);router[_0x2226('0xb')](_0x2226('0x10'),auth['isAuthenticated'](),controller[_0x2226('0x11')]);router[_0x2226('0xb')](_0x2226('0x12'),auth[_0x2226('0xd')](),controller[_0x2226('0x13')]);router[_0x2226('0xb')]('/:id/out_servers',auth[_0x2226('0xd')](),controller['getSmtp']);router[_0x2226('0xb')](_0x2226('0x14'),auth[_0x2226('0xd')](),controller[_0x2226('0x15')]);router['get']('/:id/applications',auth[_0x2226('0xd')](),controller[_0x2226('0x16')]);router[_0x2226('0xb')](_0x2226('0x17'),auth[_0x2226('0xd')](),controller[_0x2226('0x18')]);router[_0x2226('0xb')](_0x2226('0x19'),auth['isAuthenticated'](),controller[_0x2226('0x1a')]);router[_0x2226('0xb')](_0x2226('0x1b'),auth['isAuthenticated'](),controller['getAgents']);router['post'](_0x2226('0x1c'),auth[_0x2226('0xd')](),controller[_0x2226('0x1d')]);router['post'](_0x2226('0x10'),auth['isAuthenticated'](),controller[_0x2226('0x1e')]);router[_0x2226('0x1f')]('/',auth[_0x2226('0xd')](),controller['create']);router[_0x2226('0x1f')](_0x2226('0x12'),auth[_0x2226('0xd')](),controller[_0x2226('0x20')]);router[_0x2226('0x1f')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x2226('0x21')]);router[_0x2226('0x1f')](_0x2226('0x14'),auth[_0x2226('0xd')](),controller[_0x2226('0x22')]);router[_0x2226('0x1f')](_0x2226('0x23'),auth[_0x2226('0xd')](),controller[_0x2226('0x24')]);router[_0x2226('0x1f')](_0x2226('0x25'),auth['isAuthenticated'](),controller[_0x2226('0x26')]);router[_0x2226('0x1f')](_0x2226('0x1b'),auth['isAuthenticated'](),controller[_0x2226('0x27')]);router[_0x2226('0x28')](_0x2226('0x29'),auth[_0x2226('0xd')](),controller['update']);router[_0x2226('0x2a')](_0x2226('0x1c'),auth[_0x2226('0xd')](),controller[_0x2226('0x2b')]);router[_0x2226('0x2a')](_0x2226('0x10'),auth['isAuthenticated'](),controller[_0x2226('0x2c')]);router[_0x2226('0x2a')](_0x2226('0x12'),auth[_0x2226('0xd')](),controller[_0x2226('0x2d')]);router[_0x2226('0x2a')](_0x2226('0x2e'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0x2226('0x2a')](_0x2226('0x29'),auth[_0x2226('0xd')](),controller[_0x2226('0x2f')]);router[_0x2226('0x2a')](_0x2226('0x1b'),auth[_0x2226('0xd')](),controller[_0x2226('0x30')]);module['exports']=router; \ No newline at end of file +var _0x8f6c=['addSmtp','/:id/applications','/:id/send','addAgents','put','delete','removeAnswers','removeImap','removeSmtp','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','/:id/dispositions','addDisposition','post','addAnswer','create','addImap','/:id/out_servers'];(function(_0x401f12,_0x5a4281){var _0x35ac78=function(_0x583da5){while(--_0x583da5){_0x401f12['push'](_0x401f12['shift']());}};_0x35ac78(++_0x5a4281);}(_0x8f6c,0x1a9));var _0xc8f6=function(_0xef687b,_0x2be007){_0xef687b=_0xef687b-0x0;var _0x148865=_0x8f6c[_0xef687b];return _0x148865;};'use strict';var multer=require(_0xc8f6('0x0'));var util=require(_0xc8f6('0x1'));var path=require(_0xc8f6('0x2'));var timeout=require(_0xc8f6('0x3'));var express=require(_0xc8f6('0x4'));var router=express[_0xc8f6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8f6('0x6'));var interaction=require(_0xc8f6('0x7'));var config=require(_0xc8f6('0x8'));var controller=require('./mailAccount.controller');router[_0xc8f6('0x9')]('/',auth[_0xc8f6('0xa')](),controller[_0xc8f6('0xb')]);router[_0xc8f6('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc8f6('0x9')](_0xc8f6('0xc'),auth['isAuthenticated'](),controller[_0xc8f6('0xd')]);router[_0xc8f6('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc8f6('0xe')]);router[_0xc8f6('0x9')](_0xc8f6('0xf'),auth['isAuthenticated'](),controller[_0xc8f6('0x10')]);router[_0xc8f6('0x9')](_0xc8f6('0x11'),auth['isAuthenticated'](),controller['getImap']);router[_0xc8f6('0x9')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xc8f6('0x12')]);router['get'](_0xc8f6('0x13'),auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x14')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0xc8f6('0x15')]);router['get'](_0xc8f6('0x16'),auth['isAuthenticated'](),controller[_0xc8f6('0x17')]);router[_0xc8f6('0x9')](_0xc8f6('0x18'),auth['isAuthenticated'](),controller[_0xc8f6('0x19')]);router[_0xc8f6('0x9')](_0xc8f6('0x1a'),auth['isAuthenticated'](),controller[_0xc8f6('0x1b')]);router['post'](_0xc8f6('0x1c'),auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x1d')]);router[_0xc8f6('0x1e')]('/:id/canned_answers',auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x1f')]);router['post']('/',auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x20')]);router[_0xc8f6('0x1e')](_0xc8f6('0x11'),auth['isAuthenticated'](),controller[_0xc8f6('0x21')]);router[_0xc8f6('0x1e')](_0xc8f6('0x22'),auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x23')]);router[_0xc8f6('0x1e')](_0xc8f6('0x13'),auth[_0xc8f6('0xa')](),controller['addInteraction']);router[_0xc8f6('0x1e')](_0xc8f6('0x24'),auth[_0xc8f6('0xa')](),controller['addApplications']);router[_0xc8f6('0x1e')](_0xc8f6('0x25'),auth[_0xc8f6('0xa')](),controller['send']);router[_0xc8f6('0x1e')]('/:id/users',auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x26')]);router[_0xc8f6('0x27')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc8f6('0x28')](_0xc8f6('0x1c'),auth[_0xc8f6('0xa')](),controller['removeDispositions']);router['delete'](_0xc8f6('0xf'),auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x29')]);router[_0xc8f6('0x28')]('/:id/in_servers',auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x2a')]);router['delete']('/:id/out_servers',auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x2b')]);router[_0xc8f6('0x28')](_0xc8f6('0xc'),auth[_0xc8f6('0xa')](),controller[_0xc8f6('0x2c')]);router[_0xc8f6('0x28')](_0xc8f6('0x1a'),auth[_0xc8f6('0xa')](),controller['removeAgents']);module[_0xc8f6('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 61e4410..7c0a124 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 _0x99c9=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x55cfed,_0x20a72e){var _0x3af064=function(_0x3a347b){while(--_0x3a347b){_0x55cfed['push'](_0x55cfed['shift']());}};_0x3af064(++_0x20a72e);}(_0x99c9,0x13c));var _0x999c=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x99c9[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x999c('0x0'));module[_0x999c('0x1')]={'description':{'type':Sequelize[_0x999c('0x2')]},'name':{'type':Sequelize[_0x999c('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x999c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x999c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x999c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x999c('0x4')]},'markAsUnread':{'type':Sequelize[_0x999c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x999c('0x2')],'allowNull':![],'defaultValue':_0x999c('0x5')},'fontSize':{'type':Sequelize[_0x999c('0x6')](0x2)[_0x999c('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x999c('0x4')],'defaultValue':function(){return _0x999c('0x8');}},'notificationSound':{'type':Sequelize[_0x999c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x999c('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x999c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x999c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x999c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x999c('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x999c('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x999c('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x999c('0xa'),'set':function(_0x140c4b){if(!_0x140c4b)this[_0x999c('0xb')](_0x999c('0xc'),null);this[_0x999c('0xb')](_0x999c('0xd'),_0x140c4b);}}}; \ No newline at end of file +var _0x7c49=['setDataValue','mandatoryDisposition','sequelize','exports','BOOLEAN','STRING','Arial,Helvetica,sans-serif','INTEGER','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x7c49,0x141));var _0x97c4=function(_0x545acb,_0x379e6f){_0x545acb=_0x545acb-0x0;var _0x1e7381=_0x7c49[_0x545acb];return _0x1e7381;};'use strict';var Sequelize=require(_0x97c4('0x0'));module[_0x97c4('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x97c4('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x97c4('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x97c4('0x3')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x97c4('0x3')],'allowNull':![],'defaultValue':_0x97c4('0x4')},'fontSize':{'type':Sequelize[_0x97c4('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x97c4('0x6')],'defaultValue':function(){return _0x97c4('0x7');}},'notificationSound':{'type':Sequelize[_0x97c4('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x97c4('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x97c4('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x97c4('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x97c4('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x97c4('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x97c4('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x97c4('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x97c4('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b615a){if(!_0x1b615a)this[_0x97c4('0x9')]('mandatoryDispositionPauseId',null);this[_0x97c4('0x9')](_0x97c4('0xa'),_0x1b615a);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 1d7d7bc..31e64b0 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 _0x9ac7=['MailAccounts','UserProfileResource','name','send','index','MailServerIn','Imap','MailServerOut','Pause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','Smtp','mandatoryDispositionPause','length','find','update','body','describe','addDisposition','getDispositions','Disposition','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','findOne','removeAnswers','email','active','description','cservice','cauthentication','user','cuser','password','authentication','host','port','service','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','bulkCreate','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','DESC','from','attachments','join','root','server/files/attachments','isNil','auth','pass','secure','SendMail','sendMail','ListId','messageId','subject','attach','out','Interaction','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get'];(function(_0x78c442,_0x1d9dad){var _0x345210=function(_0x4f262f){while(--_0x4f262f){_0x78c442['push'](_0x78c442['shift']());}};_0x345210(++_0x1d9dad);}(_0x9ac7,0x152));var _0x79ac=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9ac7[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require(_0x79ac('0x0'));var rimraf=require(_0x79ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79ac('0x2'));var rp=require(_0x79ac('0x3'));var moment=require('moment');var BPromise=require(_0x79ac('0x4'));var Mustache=require(_0x79ac('0x5'));var util=require(_0x79ac('0x6'));var path=require('path');var sox=require(_0x79ac('0x7'));var csv=require(_0x79ac('0x8'));var ejs=require(_0x79ac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79ac('0xa'));var squel=require(_0x79ac('0xb'));var crypto=require(_0x79ac('0xc'));var jsforce=require(_0x79ac('0xd'));var deskjs=require(_0x79ac('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x79ac('0xf'));var htmlToText=require('html-to-text');var juice=require(_0x79ac('0x10'));var Redis=require(_0x79ac('0x11'));var authService=require(_0x79ac('0x12'));var qs=require(_0x79ac('0x13'));var as=require(_0x79ac('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x79ac('0x15'));var config=require(_0x79ac('0x16'));var licenseUtil=require(_0x79ac('0x17'));var db=require('../../mysqldb')['db'];config[_0x79ac('0x18')]=_[_0x79ac('0x19')](config['redis'],{'host':_0x79ac('0x1a'),'port':0x18eb});var socket=require(_0x79ac('0x1b'))(new Redis(config[_0x79ac('0x18')]));require('./mailAccount.socket')[_0x79ac('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x79ac('0x1d')][_0x79ac('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x1d34b8,_0xc7accf,_0x519a13,_0x20ffc8){return new BPromise(function(_0x25c795,_0x5a1017){var _0x42e82e=_0x20ffc8||client;return _0x42e82e['request'](_0x1d34b8,_0x519a13)[_0x79ac('0x1f')](function(_0x5ae410){logger[_0x79ac('0x20')](_0x79ac('0x21'),_0xc7accf,'request\x20sent');logger[_0x79ac('0x22')](_0x79ac('0x23'),_0xc7accf,_0x79ac('0x24'),JSON[_0x79ac('0x25')](_0x5ae410));if(_0x5ae410['error']){if(_0x5ae410[_0x79ac('0x26')][_0x79ac('0x27')]===0x1f4){logger[_0x79ac('0x26')]('MailAccount,\x20%s,\x20%s',_0xc7accf,_0x5ae410[_0x79ac('0x26')][_0x79ac('0x28')]);return _0x5a1017(_0x5ae410[_0x79ac('0x26')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0xc7accf,_0x5ae410[_0x79ac('0x26')][_0x79ac('0x28')]);return _0x25c795(_0x5ae410[_0x79ac('0x26')]['message']);}else{logger[_0x79ac('0x20')](_0x79ac('0x21'),_0xc7accf,'request\x20sent');_0x25c795(_0x5ae410['result'][_0x79ac('0x28')]);}})['catch'](function(_0x2f93d6){logger[_0x79ac('0x26')]('MailAccount,\x20%s,\x20%s',_0xc7accf,_0x2f93d6);_0x5a1017(_0x2f93d6);});});}function respondWithStatusCode(_0x1bd5a3,_0x465105){_0x465105=_0x465105||0xcc;return function(_0x40500c){if(_0x40500c){return _0x1bd5a3[_0x79ac('0x29')](_0x465105);}return _0x1bd5a3[_0x79ac('0x2a')](_0x465105)[_0x79ac('0x2b')]();};}function respondWithResult(_0x86c3a3,_0x1cb2e1){_0x1cb2e1=_0x1cb2e1||0xc8;return function(_0x535bd6){if(_0x535bd6){return _0x86c3a3[_0x79ac('0x2a')](_0x1cb2e1)[_0x79ac('0x2c')](_0x535bd6);}};}function respondWithFilteredResult(_0x24a6a5,_0xf5131e){return function(_0x2f966f){if(_0x2f966f){var _0x276b15=typeof _0xf5131e[_0x79ac('0x2d')]==='undefined'&&typeof _0xf5131e[_0x79ac('0x2e')]===_0x79ac('0x2f');var _0x3ae396=_0x2f966f[_0x79ac('0x30')];var _0x2fc116=_0x276b15?0x0:_0xf5131e[_0x79ac('0x2d')];var _0x27d2a6=_0x276b15?_0x2f966f['count']:_0xf5131e['offset']+_0xf5131e[_0x79ac('0x2e')];var _0x4736c8;if(_0x27d2a6>=_0x3ae396){_0x27d2a6=_0x3ae396;_0x4736c8=0xc8;}else{_0x4736c8=0xce;}_0x24a6a5[_0x79ac('0x2a')](_0x4736c8);return _0x24a6a5[_0x79ac('0x31')](_0x79ac('0x32'),_0x2fc116+'-'+_0x27d2a6+'/'+_0x3ae396)[_0x79ac('0x2c')](_0x2f966f);}return null;};}function patchUpdates(_0x55e85a){return function(_0x4e4428){try{jsonpatch[_0x79ac('0x33')](_0x4e4428,_0x55e85a,!![]);}catch(_0x378e49){return BPromise[_0x79ac('0x34')](_0x378e49);}return _0x4e4428[_0x79ac('0x35')]();};}function saveUpdates(_0x576e79,_0x904016){return function(_0x35f078){if(_0x35f078){return _0x35f078['update'](_0x576e79)[_0x79ac('0x1f')](function(_0x4671e2){return _0x4671e2;});}return null;};}function removeEntity(_0x86068d,_0x48265d){return function(_0x377433){if(_0x377433){return _0x377433[_0x79ac('0x36')]()[_0x79ac('0x1f')](function(){var _0x49cd55=_0x377433[_0x79ac('0x37')]({'plain':!![]});var _0x296870=_0x79ac('0x38');return db[_0x79ac('0x39')]['destroy']({'where':{'type':_0x296870,'resourceId':_0x49cd55['id']}})['then'](function(){return _0x377433;});})[_0x79ac('0x1f')](function(){_0x86068d[_0x79ac('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258d6e,_0x5d1cb4){return function(_0x14a7cb){if(!_0x14a7cb){_0x258d6e[_0x79ac('0x29')](0x194);}return _0x14a7cb;};}function handleError(_0x446a5c,_0x25a060){_0x25a060=_0x25a060||0x1f4;return function(_0x1e2b81){logger[_0x79ac('0x26')](_0x1e2b81['stack']);if(_0x1e2b81[_0x79ac('0x3a')]){delete _0x1e2b81[_0x79ac('0x3a')];}_0x446a5c[_0x79ac('0x2a')](_0x25a060)[_0x79ac('0x3b')](_0x1e2b81);};}exports[_0x79ac('0x3c')]=function(_0xec0156,_0xc54154){var _0x2b2cfd={'include':[{'model':db[_0x79ac('0x3d')],'as':_0x79ac('0x3e')},{'model':db[_0x79ac('0x3f')],'as':'Smtp'},{'model':db[_0x79ac('0x40')],'as':'mandatoryDispositionPause'}]},_0x4ac602={},_0x204640={'count':0x0,'rows':[]};var _0x521d57=_[_0x79ac('0x41')](db[_0x79ac('0x42')][_0x79ac('0x43')],function(_0xa1c240){return{'name':_0xa1c240[_0x79ac('0x44')],'type':_0xa1c240[_0x79ac('0x45')][_0x79ac('0x46')]};});_0x4ac602[_0x79ac('0x47')]=_[_0x79ac('0x41')](_0x521d57,_0x79ac('0x3a'));_0x4ac602[_0x79ac('0x48')]=_[_0x79ac('0x49')](_0xec0156[_0x79ac('0x48')]);_0x4ac602['filters']=_['intersection'](_0x4ac602['model'],_0x4ac602[_0x79ac('0x48')]);_0x2b2cfd['attributes']=_[_0x79ac('0x4a')](_0x4ac602['model'],qs[_0x79ac('0x4b')](_0xec0156[_0x79ac('0x48')][_0x79ac('0x4b')]));_0x2b2cfd[_0x79ac('0x4c')]=_0x2b2cfd[_0x79ac('0x4c')]['length']?_0x2b2cfd['attributes']:_0x4ac602['model'];if(!_0xec0156[_0x79ac('0x48')][_0x79ac('0x4d')](_0x79ac('0x4e'))){_0x2b2cfd[_0x79ac('0x2e')]=qs['limit'](_0xec0156[_0x79ac('0x48')][_0x79ac('0x2e')]);_0x2b2cfd[_0x79ac('0x2d')]=qs['offset'](_0xec0156['query'][_0x79ac('0x2d')]);}_0x2b2cfd[_0x79ac('0x4f')]=qs['sort'](_0xec0156[_0x79ac('0x48')][_0x79ac('0x50')]);_0x2b2cfd['where']=qs['filters'](_[_0x79ac('0x51')](_0xec0156[_0x79ac('0x48')],_0x4ac602[_0x79ac('0x52')]),_0x521d57);if(_0xec0156[_0x79ac('0x48')][_0x79ac('0x53')]){_0x2b2cfd[_0x79ac('0x54')]=_[_0x79ac('0x55')](_0x2b2cfd[_0x79ac('0x54')],{'$or':_['map'](_0x521d57,function(_0x25d88b){if(_0x25d88b[_0x79ac('0x45')]!==_0x79ac('0x56')){var _0x5e99b1={};_0x5e99b1[_0x25d88b['name']]={'$like':'%'+_0xec0156[_0x79ac('0x48')][_0x79ac('0x53')]+'%'};return _0x5e99b1;}})});}_0x2b2cfd=_[_0x79ac('0x55')]({},_0x2b2cfd,_0xec0156[_0x79ac('0x57')]);var _0x4b8a25={'where':_0x2b2cfd['where']};return db[_0x79ac('0x42')][_0x79ac('0x30')](_0x4b8a25)['then'](function(_0x14b86f){_0x204640[_0x79ac('0x30')]=_0x14b86f;if(_0xec0156[_0x79ac('0x48')][_0x79ac('0x58')]){_0x2b2cfd[_0x79ac('0x59')]=[{'all':!![]}];}return db[_0x79ac('0x42')][_0x79ac('0x5a')](_0x2b2cfd);})[_0x79ac('0x1f')](function(_0xe54cc4){_0x204640[_0x79ac('0x5b')]=_0xe54cc4;return _0x204640;})[_0x79ac('0x1f')](respondWithFilteredResult(_0xc54154,_0x2b2cfd))[_0x79ac('0x5c')](handleError(_0xc54154,null));};exports['show']=function(_0x49c799,_0x5464a6){var _0xd22fc7={'raw':![],'where':{'id':_0x49c799[_0x79ac('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x79ac('0x3e')},{'model':db[_0x79ac('0x3f')],'as':_0x79ac('0x5e')},{'model':db['Pause'],'as':_0x79ac('0x5f')}]},_0x2a617e={};_0x2a617e[_0x79ac('0x47')]=_[_0x79ac('0x49')](db[_0x79ac('0x42')][_0x79ac('0x43')]);_0x2a617e['query']=_['keys'](_0x49c799[_0x79ac('0x48')]);_0x2a617e[_0x79ac('0x52')]=_['intersection'](_0x2a617e['model'],_0x2a617e['query']);_0xd22fc7[_0x79ac('0x4c')]=_[_0x79ac('0x4a')](_0x2a617e[_0x79ac('0x47')],qs[_0x79ac('0x4b')](_0x49c799['query'][_0x79ac('0x4b')]));_0xd22fc7[_0x79ac('0x4c')]=_0xd22fc7['attributes'][_0x79ac('0x60')]?_0xd22fc7[_0x79ac('0x4c')]:_0x2a617e['model'];if(_0x49c799[_0x79ac('0x48')][_0x79ac('0x58')]){_0xd22fc7[_0x79ac('0x59')]=[{'all':!![]}];}_0xd22fc7=_[_0x79ac('0x55')]({},_0xd22fc7,_0x49c799[_0x79ac('0x57')]);return db[_0x79ac('0x42')][_0x79ac('0x61')](_0xd22fc7)[_0x79ac('0x1f')](handleEntityNotFound(_0x5464a6,null))[_0x79ac('0x1f')](respondWithResult(_0x5464a6,null))[_0x79ac('0x5c')](handleError(_0x5464a6,null));};exports[_0x79ac('0x62')]=function(_0x2f4fcd,_0x2c7fd0){if(_0x2f4fcd[_0x79ac('0x63')]['id']){delete _0x2f4fcd['body']['id'];}return db['MailAccount'][_0x79ac('0x61')]({'where':{'id':_0x2f4fcd[_0x79ac('0x5d')]['id']},'include':[{'model':db[_0x79ac('0x3d')],'as':_0x79ac('0x3e')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x79ac('0x40')],'as':_0x79ac('0x5f')}]})[_0x79ac('0x1f')](handleEntityNotFound(_0x2c7fd0,null))['then'](saveUpdates(_0x2f4fcd['body'],null))[_0x79ac('0x1f')](function(_0x38a05){if(_0x38a05&&_0x2f4fcd[_0x79ac('0x63')][_0x79ac('0x3e')]){return db[_0x79ac('0x3d')][_0x79ac('0x62')](_0x2f4fcd[_0x79ac('0x63')][_0x79ac('0x3e')],{'where':{'MailAccountId':_0x38a05['id']}})['then'](function(){return _0x38a05;});}return _0x38a05;})[_0x79ac('0x1f')](function(_0x264ddc){if(_0x264ddc&&_0x2f4fcd['body'][_0x79ac('0x5e')]){return db[_0x79ac('0x3f')][_0x79ac('0x62')](_0x2f4fcd[_0x79ac('0x63')]['Smtp'],{'where':{'MailAccountId':_0x264ddc['id']}})[_0x79ac('0x1f')](function(){return _0x264ddc;});}return _0x264ddc;})['then'](respondWithResult(_0x2c7fd0,null))['catch'](handleError(_0x2c7fd0,null));};exports[_0x79ac('0x64')]=function(_0x540a50,_0x2646c8){return db[_0x79ac('0x42')][_0x79ac('0x64')]()[_0x79ac('0x1f')](respondWithResult(_0x2646c8,null))['catch'](handleError(_0x2646c8,null));};exports[_0x79ac('0x65')]=function(_0x270d5a,_0x1293c3,_0x5bea1f){if(_0x270d5a[_0x79ac('0x63')]['id']){delete _0x270d5a[_0x79ac('0x63')]['id'];}return db[_0x79ac('0x42')]['find']({'where':{'id':_0x270d5a[_0x79ac('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1293c3,null))[_0x79ac('0x1f')](function(_0x4eda21){if(_0x4eda21){_0x270d5a['body']['MailAccountId']=_0x4eda21['id'];return db['Disposition']['create'](_0x270d5a[_0x79ac('0x63')]);}})[_0x79ac('0x1f')](respondWithResult(_0x1293c3,null))[_0x79ac('0x5c')](handleError(_0x1293c3,null));};exports[_0x79ac('0x66')]=function(_0x140158,_0x23f602,_0x257a3d){var _0x271324={'raw':![],'where':{}};var _0x9664a2={};var _0x294426={'count':0x0,'rows':[]};return db[_0x79ac('0x42')]['findOne']({'where':{'id':_0x140158['params']['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x23f602,null))[_0x79ac('0x1f')](function(_0x1aed40){if(_0x1aed40){_0x9664a2['model']=_['keys'](db[_0x79ac('0x67')][_0x79ac('0x43')]);_0x9664a2['query']=_['keys'](_0x140158[_0x79ac('0x48')]);_0x9664a2['filters']=_[_0x79ac('0x4a')](_0x9664a2[_0x79ac('0x47')],_0x9664a2[_0x79ac('0x48')]);_0x271324[_0x79ac('0x4c')]=_['intersection'](_0x9664a2[_0x79ac('0x47')],qs[_0x79ac('0x4b')](_0x140158[_0x79ac('0x48')]['fields']));_0x271324[_0x79ac('0x4c')]=_0x271324['attributes'][_0x79ac('0x60')]?_0x271324['attributes']:_0x9664a2[_0x79ac('0x47')];if(!_0x140158[_0x79ac('0x48')][_0x79ac('0x4d')]('nolimit')){_0x271324[_0x79ac('0x2e')]=qs[_0x79ac('0x2e')](_0x140158['query'][_0x79ac('0x2e')]);_0x271324[_0x79ac('0x2d')]=qs[_0x79ac('0x2d')](_0x140158[_0x79ac('0x48')][_0x79ac('0x2d')]);}_0x271324[_0x79ac('0x4f')]=qs[_0x79ac('0x50')](_0x140158['query']['sort']);_0x271324[_0x79ac('0x54')]=qs['filters'](_[_0x79ac('0x51')](_0x140158[_0x79ac('0x48')],_0x9664a2[_0x79ac('0x52')]));_0x271324[_0x79ac('0x54')][_0x79ac('0x68')]=_0x1aed40['id'];if(_0x140158[_0x79ac('0x48')][_0x79ac('0x53')]){_0x271324['where']=_[_0x79ac('0x55')](_0x271324[_0x79ac('0x54')],{'$or':_['map'](_0x271324['attributes'],function(_0xf5a289){var _0x2ec582={};_0x2ec582[_0xf5a289]={'$like':'%'+_0x140158['query'][_0x79ac('0x53')]+'%'};return _0x2ec582;})});}_0x271324=_[_0x79ac('0x55')]({},_0x271324,_0x140158['options']);return db[_0x79ac('0x67')][_0x79ac('0x30')]({'where':_0x271324['where']})['then'](function(_0x2048ea){_0x294426['count']=_0x2048ea;if(_0x140158['query'][_0x79ac('0x58')]){_0x271324[_0x79ac('0x59')]=[{'all':!![]}];}return db[_0x79ac('0x67')][_0x79ac('0x5a')](_0x271324);})[_0x79ac('0x1f')](function(_0x21bce1){_0x294426[_0x79ac('0x5b')]=_0x21bce1;return _0x294426;});}})['then'](respondWithFilteredResult(_0x23f602,_0x271324))['catch'](handleError(_0x23f602,null));};exports[_0x79ac('0x69')]=function(_0x360a63,_0xccb208,_0x5cb1bc){return db[_0x79ac('0x42')][_0x79ac('0x61')]({'where':{'id':_0x360a63[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0xccb208,null))[_0x79ac('0x1f')](function(_0x190a5a){if(_0x190a5a){return _0x190a5a[_0x79ac('0x69')](_0x360a63['query'][_0x79ac('0x6a')]);}})['then'](respondWithStatusCode(_0xccb208,null))[_0x79ac('0x5c')](handleError(_0xccb208,null));};exports[_0x79ac('0x6b')]=function(_0x3a8cb1,_0x55a286,_0x1a6664){if(_0x3a8cb1[_0x79ac('0x63')]['id']){delete _0x3a8cb1[_0x79ac('0x63')]['id'];}return db[_0x79ac('0x42')]['find']({'where':{'id':_0x3a8cb1[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x55a286,null))[_0x79ac('0x1f')](function(_0x8e225c){if(_0x8e225c){_0x3a8cb1[_0x79ac('0x63')]['MailAccountId']=_0x8e225c['id'];return db[_0x79ac('0x6c')][_0x79ac('0x6d')](_0x3a8cb1[_0x79ac('0x63')]);}})[_0x79ac('0x1f')](respondWithResult(_0x55a286,null))[_0x79ac('0x5c')](handleError(_0x55a286,null));};exports[_0x79ac('0x6e')]=function(_0x530a42,_0x2d4901,_0x340537){var _0x2d58d7={'raw':![],'where':{}};var _0xc2311b={};var _0x50c8b9={'count':0x0,'rows':[]};return db[_0x79ac('0x42')][_0x79ac('0x6f')]({'where':{'id':_0x530a42[_0x79ac('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2d4901,null))[_0x79ac('0x1f')](function(_0x4fe2a3){if(_0x4fe2a3){_0xc2311b[_0x79ac('0x47')]=_[_0x79ac('0x49')](db[_0x79ac('0x6c')][_0x79ac('0x43')]);_0xc2311b['query']=_[_0x79ac('0x49')](_0x530a42[_0x79ac('0x48')]);_0xc2311b[_0x79ac('0x52')]=_[_0x79ac('0x4a')](_0xc2311b[_0x79ac('0x47')],_0xc2311b['query']);_0x2d58d7[_0x79ac('0x4c')]=_[_0x79ac('0x4a')](_0xc2311b['model'],qs[_0x79ac('0x4b')](_0x530a42[_0x79ac('0x48')][_0x79ac('0x4b')]));_0x2d58d7['attributes']=_0x2d58d7['attributes'][_0x79ac('0x60')]?_0x2d58d7['attributes']:_0xc2311b[_0x79ac('0x47')];if(!_0x530a42[_0x79ac('0x48')]['hasOwnProperty'](_0x79ac('0x4e'))){_0x2d58d7[_0x79ac('0x2e')]=qs['limit'](_0x530a42[_0x79ac('0x48')][_0x79ac('0x2e')]);_0x2d58d7[_0x79ac('0x2d')]=qs[_0x79ac('0x2d')](_0x530a42[_0x79ac('0x48')][_0x79ac('0x2d')]);}_0x2d58d7['order']=qs[_0x79ac('0x50')](_0x530a42[_0x79ac('0x48')][_0x79ac('0x50')]);_0x2d58d7[_0x79ac('0x54')]=qs['filters'](_[_0x79ac('0x51')](_0x530a42[_0x79ac('0x48')],_0xc2311b[_0x79ac('0x52')]));_0x2d58d7[_0x79ac('0x54')][_0x79ac('0x68')]=_0x4fe2a3['id'];if(_0x530a42[_0x79ac('0x48')][_0x79ac('0x53')]){_0x2d58d7[_0x79ac('0x54')]=_[_0x79ac('0x55')](_0x2d58d7[_0x79ac('0x54')],{'$or':_[_0x79ac('0x41')](_0x2d58d7[_0x79ac('0x4c')],function(_0x45c44a){var _0x768219={};_0x768219[_0x45c44a]={'$like':'%'+_0x530a42[_0x79ac('0x48')][_0x79ac('0x53')]+'%'};return _0x768219;})});}_0x2d58d7=_[_0x79ac('0x55')]({},_0x2d58d7,_0x530a42[_0x79ac('0x57')]);return db[_0x79ac('0x6c')][_0x79ac('0x30')]({'where':_0x2d58d7[_0x79ac('0x54')]})[_0x79ac('0x1f')](function(_0x42d2f9){_0x50c8b9[_0x79ac('0x30')]=_0x42d2f9;if(_0x530a42[_0x79ac('0x48')][_0x79ac('0x58')]){_0x2d58d7['include']=[{'all':!![]}];}return db[_0x79ac('0x6c')]['findAll'](_0x2d58d7);})[_0x79ac('0x1f')](function(_0x18ffde){_0x50c8b9['rows']=_0x18ffde;return _0x50c8b9;});}})[_0x79ac('0x1f')](respondWithFilteredResult(_0x2d4901,_0x2d58d7))['catch'](handleError(_0x2d4901,null));};exports['removeAnswers']=function(_0x34bf48,_0x577980,_0x1b184b){return db[_0x79ac('0x42')][_0x79ac('0x61')]({'where':{'id':_0x34bf48[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x577980,null))[_0x79ac('0x1f')](function(_0x232d6f){if(_0x232d6f){return _0x232d6f[_0x79ac('0x70')](_0x34bf48['query']['ids']);}})[_0x79ac('0x1f')](respondWithStatusCode(_0x577980,null))[_0x79ac('0x5c')](handleError(_0x577980,null));};exports[_0x79ac('0x6d')]=function(_0x5e4331,_0x52ee00){var _0x5b4dcd={'name':_0x5e4331['body']['name'],'key':_0x5e4331[_0x79ac('0x63')]['key'],'email':_0x5e4331['body'][_0x79ac('0x71')],'ListId':_0x5e4331[_0x79ac('0x63')]['ListId'],'active':!_['isNil'](_0x5e4331[_0x79ac('0x63')][_0x79ac('0x72')])?_0x5e4331[_0x79ac('0x63')][_0x79ac('0x72')]:!![],'description':_0x5e4331[_0x79ac('0x63')][_0x79ac('0x73')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x5e4331[_0x79ac('0x63')][_0x79ac('0x74')])){if(_0x5e4331['body'][_0x79ac('0x75')]){_0x5b4dcd[_0x79ac('0x3e')][_0x79ac('0x76')]=_0x5b4dcd['Smtp']['user']=_0x5e4331[_0x79ac('0x63')][_0x79ac('0x77')];_0x5b4dcd[_0x79ac('0x3e')][_0x79ac('0x78')]=_0x5b4dcd['Smtp']['pass']=_0x5e4331['body']['cpassword'];}else{_0x5b4dcd[_0x79ac('0x3e')][_0x79ac('0x79')]=_0x5b4dcd[_0x79ac('0x5e')][_0x79ac('0x79')]=![];}_0x5b4dcd['Imap'][_0x79ac('0x7a')]=_0x5e4331[_0x79ac('0x63')]['Imap'][_0x79ac('0x7a')];_0x5b4dcd[_0x79ac('0x3e')][_0x79ac('0x7b')]=_0x5e4331[_0x79ac('0x63')][_0x79ac('0x3e')][_0x79ac('0x7b')];_0x5b4dcd[_0x79ac('0x5e')][_0x79ac('0x7a')]=_0x5e4331[_0x79ac('0x63')][_0x79ac('0x5e')][_0x79ac('0x7a')];_0x5b4dcd['Smtp'][_0x79ac('0x7b')]=_0x5e4331[_0x79ac('0x63')]['Smtp'][_0x79ac('0x7b')];}else{_0x5b4dcd[_0x79ac('0x3e')][_0x79ac('0x7c')]=_0x5b4dcd[_0x79ac('0x5e')][_0x79ac('0x7c')]=_0x5e4331[_0x79ac('0x63')]['cservice'];_0x5b4dcd[_0x79ac('0x3e')][_0x79ac('0x76')]=_0x5b4dcd[_0x79ac('0x5e')][_0x79ac('0x76')]=_0x5e4331[_0x79ac('0x63')]['cuser'];_0x5b4dcd['Imap'][_0x79ac('0x78')]=_0x5b4dcd[_0x79ac('0x5e')]['pass']=_0x5e4331[_0x79ac('0x63')][_0x79ac('0x7d')];}return db[_0x79ac('0x42')][_0x79ac('0x6d')](_0x5b4dcd,{'include':[{'model':db['MailServerOut'],'as':_0x79ac('0x5e')},{'model':db[_0x79ac('0x3d')],'as':_0x79ac('0x3e')}]})['then'](function(_0x1788d5){var _0x516533=_0x5e4331['user'][_0x79ac('0x37')]({'plain':!![]});if(!_0x516533)throw new Error(_0x79ac('0x7e'));if(_0x516533[_0x79ac('0x7f')]===_0x79ac('0x76')){var _0xc1159e=_0x1788d5[_0x79ac('0x37')]({'plain':!![]});return db[_0x79ac('0x80')][_0x79ac('0x61')]({'where':{'name':_0x79ac('0x38'),'userProfileId':_0x516533[_0x79ac('0x81')]},'raw':!![]})[_0x79ac('0x1f')](function(_0x96f7ea){if(_0x96f7ea&&_0x96f7ea['autoAssociation']===0x0){return db[_0x79ac('0x39')][_0x79ac('0x6d')]({'name':_0xc1159e['name'],'resourceId':_0xc1159e['id'],'type':_0x96f7ea['name'],'sectionId':_0x96f7ea['id']},{})[_0x79ac('0x1f')](function(){return _0x1788d5;});}else{return _0x1788d5;}})[_0x79ac('0x5c')](function(_0x1a5f6b){logger['error'](_0x79ac('0x82'),_0x1a5f6b);throw _0x1a5f6b;});}return _0x1788d5;})[_0x79ac('0x1f')](respondWithResult(_0x52ee00,0xc9))[_0x79ac('0x5c')](handleError(_0x52ee00,null));};exports[_0x79ac('0x83')]=function(_0x39879e,_0x2483a0,_0x66dcf){return db[_0x79ac('0x42')][_0x79ac('0x6f')]({'where':{'id':_0x39879e[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x2483a0,null))[_0x79ac('0x1f')](function(_0x3555cb){if(_0x3555cb){return _0x3555cb['getImap']();}return null;})[_0x79ac('0x1f')](respondWithResult(_0x2483a0,null))[_0x79ac('0x5c')](handleError(_0x2483a0,null));};exports[_0x79ac('0x84')]=function(_0x53541e,_0x5f53b3,_0x33fbd3){if(_0x53541e[_0x79ac('0x63')]['id']){delete _0x53541e[_0x79ac('0x63')]['id'];}return db[_0x79ac('0x42')]['find']({'where':{'id':_0x53541e[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x5f53b3,null))[_0x79ac('0x1f')](function(_0x4f048e){if(_0x4f048e){_0x53541e[_0x79ac('0x63')][_0x79ac('0x68')]=_0x4f048e['id'];return db[_0x79ac('0x3d')][_0x79ac('0x6d')](_0x53541e['body']);}})[_0x79ac('0x1f')](respondWithResult(_0x5f53b3,null))['catch'](handleError(_0x5f53b3,null));};exports[_0x79ac('0x85')]=function(_0xa186b9,_0xbd625b,_0x322ab2){return db[_0x79ac('0x42')]['findOne']({'where':{'id':_0xa186b9[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0xbd625b,null))[_0x79ac('0x1f')](function(_0x5066b3){if(_0x5066b3){return _0x5066b3['setImap'](null);}return null;})[_0x79ac('0x1f')](respondWithStatusCode(_0xbd625b,null))['catch'](handleError(_0xbd625b,null));};exports[_0x79ac('0x86')]=function(_0x9f95a5,_0x5b455a,_0x1fe04d){return db[_0x79ac('0x42')][_0x79ac('0x6f')]({'where':{'id':_0x9f95a5[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x5b455a,null))[_0x79ac('0x1f')](function(_0x5ddb37){if(_0x5ddb37){return _0x5ddb37[_0x79ac('0x86')]();}return null;})[_0x79ac('0x1f')](respondWithResult(_0x5b455a,null))[_0x79ac('0x5c')](handleError(_0x5b455a,null));};exports[_0x79ac('0x87')]=function(_0x3e3093,_0x427a37,_0x58493b){if(_0x3e3093[_0x79ac('0x63')]['id']){delete _0x3e3093[_0x79ac('0x63')]['id'];}return db[_0x79ac('0x42')][_0x79ac('0x61')]({'where':{'id':_0x3e3093['params']['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x427a37,null))[_0x79ac('0x1f')](function(_0x455905){if(_0x455905){_0x3e3093[_0x79ac('0x63')]['MailAccountId']=_0x455905['id'];return db['MailServerOut'][_0x79ac('0x6d')](_0x3e3093[_0x79ac('0x63')]);}})[_0x79ac('0x1f')](respondWithResult(_0x427a37,null))[_0x79ac('0x5c')](handleError(_0x427a37,null));};exports[_0x79ac('0x88')]=function(_0x2ab3d5,_0x289770,_0x449307){return db[_0x79ac('0x42')]['findOne']({'where':{'id':_0x2ab3d5['params']['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x289770,null))[_0x79ac('0x1f')](function(_0xa6984e){if(_0xa6984e){return _0xa6984e[_0x79ac('0x89')](null);}return null;})[_0x79ac('0x1f')](respondWithStatusCode(_0x289770,null))[_0x79ac('0x5c')](handleError(_0x289770,null));};exports[_0x79ac('0x8a')]=function(_0x45a9b6,_0x1c3704,_0x591a18){return db[_0x79ac('0x8b')][_0x79ac('0x61')]({'where':{'id':_0x45a9b6[_0x79ac('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1c3704,null))['then'](function(_0x36def5){if(_0x36def5){return _0x36def5[_0x79ac('0x8a')](_0x45a9b6[_0x79ac('0x63')][_0x79ac('0x6a')],_['omit'](_0x45a9b6[_0x79ac('0x63')],['ids','id'])||{});}})['then'](respondWithResult(_0x1c3704,null))[_0x79ac('0x5c')](handleError(_0x1c3704,null));};exports[_0x79ac('0x8c')]=function(_0x3e98d4,_0x1654a7,_0xa43615){var _0x253fce={'raw':![],'where':{}};var _0x2b9bb3={};var _0x5113e6={'count':0x0,'rows':[]};return db[_0x79ac('0x42')][_0x79ac('0x6f')]({'where':{'id':_0x3e98d4[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x1654a7,null))[_0x79ac('0x1f')](function(_0x3130dc){if(_0x3130dc){_0x2b9bb3['model']=_[_0x79ac('0x49')](db['MailInteraction']['rawAttributes']);_0x2b9bb3[_0x79ac('0x48')]=_[_0x79ac('0x49')](_0x3e98d4[_0x79ac('0x48')]);_0x2b9bb3['filters']=_[_0x79ac('0x4a')](_0x2b9bb3[_0x79ac('0x47')],_0x2b9bb3['query']);_0x253fce[_0x79ac('0x4c')]=_[_0x79ac('0x4a')](_0x2b9bb3['model'],qs[_0x79ac('0x4b')](_0x3e98d4[_0x79ac('0x48')][_0x79ac('0x4b')]));_0x253fce[_0x79ac('0x4c')]=_0x253fce[_0x79ac('0x4c')][_0x79ac('0x60')]?_0x253fce[_0x79ac('0x4c')]:_0x2b9bb3[_0x79ac('0x47')];if(!_0x3e98d4[_0x79ac('0x48')][_0x79ac('0x4d')](_0x79ac('0x4e'))){_0x253fce[_0x79ac('0x2e')]=qs[_0x79ac('0x2e')](_0x3e98d4[_0x79ac('0x48')][_0x79ac('0x2e')]);_0x253fce[_0x79ac('0x2d')]=qs[_0x79ac('0x2d')](_0x3e98d4[_0x79ac('0x48')]['offset']);}_0x253fce['order']=qs[_0x79ac('0x50')](_0x3e98d4[_0x79ac('0x48')]['sort']);_0x253fce[_0x79ac('0x54')]=qs[_0x79ac('0x52')](_[_0x79ac('0x51')](_0x3e98d4[_0x79ac('0x48')],_0x2b9bb3[_0x79ac('0x52')]));_0x253fce['where'][_0x79ac('0x68')]=_0x3130dc['id'];if(_0x3e98d4[_0x79ac('0x48')][_0x79ac('0x53')]){_0x253fce['where']=_[_0x79ac('0x55')](_0x253fce[_0x79ac('0x54')],{'$or':_[_0x79ac('0x41')](_0x253fce['attributes'],function(_0x41bc18){var _0x1d321f={};_0x1d321f[_0x41bc18]={'$like':'%'+_0x3e98d4[_0x79ac('0x48')][_0x79ac('0x53')]+'%'};return _0x1d321f;})});}_0x253fce=_[_0x79ac('0x55')]({},_0x253fce,_0x3e98d4[_0x79ac('0x57')]);return db[_0x79ac('0x8b')][_0x79ac('0x30')]({'where':_0x253fce[_0x79ac('0x54')]})[_0x79ac('0x1f')](function(_0x5d69a0){_0x5113e6['count']=_0x5d69a0;if(_0x3e98d4['query'][_0x79ac('0x58')]){_0x253fce['include']=[{'model':db[_0x79ac('0x8d')],'as':'Contact','required':![]},{'model':db[_0x79ac('0x8e')],'as':_0x79ac('0x8f'),'attributes':[_0x79ac('0x3a'),_0x79ac('0x90'),_0x79ac('0x91')],'required':![]},{'model':db[_0x79ac('0x92')],'as':_0x79ac('0x93'),'attributes':['id','name',_0x79ac('0x94')],'where':_0x3e98d4[_0x79ac('0x48')][_0x79ac('0x95')]?{'id':_0x3e98d4[_0x79ac('0x48')][_0x79ac('0x95')]}:undefined,'required':_0x3e98d4[_0x79ac('0x48')][_0x79ac('0x95')]?!![]:![]}];}return db[_0x79ac('0x8b')][_0x79ac('0x5a')](_0x253fce);})[_0x79ac('0x1f')](function(_0x33074f){_0x5113e6[_0x79ac('0x5b')]=_0x33074f;return _0x5113e6;});}})['then'](respondWithFilteredResult(_0x1654a7,_0x253fce))[_0x79ac('0x5c')](handleError(_0x1654a7,null));};exports['addApplications']=function(_0x59b9b6,_0x476f65,_0xfd72b7){return db['MailAccount'][_0x79ac('0x6f')]({'where':{'id':_0x59b9b6[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x476f65,null))['then'](function(_0x3f9b1f){if(_0x3f9b1f){return db[_0x79ac('0x96')][_0x79ac('0x97')](function(_0x10d1e6){return db['MailApplication'][_0x79ac('0x36')]({'where':{'MailAccountId':_0x59b9b6['params']['id']},'transaction':_0x10d1e6})[_0x79ac('0x1f')](function(_0x3a638e){var _0x19718c=_['map'](_0x59b9b6[_0x79ac('0x63')],function(_0x2e4e50){_0x2e4e50[_0x79ac('0x68')]=_0x59b9b6['params']['id'];return _0x2e4e50;});return db['MailApplication'][_0x79ac('0x98')](_0x19718c,{'transaction':_0x10d1e6});});})[_0x79ac('0x1f')](function(){return db[_0x79ac('0x99')][_0x79ac('0x9a')]({'where':{'MailAccountId':_0x59b9b6['params']['id']},'order':_0x79ac('0x9b')});});}})[_0x79ac('0x1f')](respondWithResult(_0x476f65,null))[_0x79ac('0x5c')](handleError(_0x476f65,null));};exports[_0x79ac('0x9c')]=function(_0xd33ecc,_0x310c69,_0x235a20){var _0x33e41e={};var _0x538e53={};var _0x32eea5;var _0x2e43e2;return db[_0x79ac('0x42')][_0x79ac('0x6f')]({'where':{'id':_0xd33ecc[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x310c69,null))['then'](function(_0x366486){if(_0x366486){_0x32eea5=_0x366486;_0x538e53[_0x79ac('0x47')]=_['keys'](db[_0x79ac('0x99')][_0x79ac('0x43')]);_0x538e53['query']=_[_0x79ac('0x49')](_0xd33ecc['query']);_0x538e53[_0x79ac('0x52')]=_[_0x79ac('0x4a')](_0x538e53['model'],_0x538e53[_0x79ac('0x48')]);_0x33e41e[_0x79ac('0x4c')]=_[_0x79ac('0x4a')](_0x538e53[_0x79ac('0x47')],qs[_0x79ac('0x4b')](_0xd33ecc[_0x79ac('0x48')][_0x79ac('0x4b')]));_0x33e41e[_0x79ac('0x4c')]=_0x33e41e[_0x79ac('0x4c')][_0x79ac('0x60')]?_0x33e41e[_0x79ac('0x4c')]:_0x538e53[_0x79ac('0x47')];_0x33e41e[_0x79ac('0x4f')]=qs[_0x79ac('0x50')](_0xd33ecc[_0x79ac('0x48')][_0x79ac('0x50')]);_0x33e41e[_0x79ac('0x54')]=qs[_0x79ac('0x52')](_['pick'](_0xd33ecc[_0x79ac('0x48')],_0x538e53[_0x79ac('0x52')]));if(_0xd33ecc['query'][_0x79ac('0x53')]){_0x33e41e[_0x79ac('0x54')]=_['merge'](_0x33e41e[_0x79ac('0x54')],{'$or':_['map'](_0x33e41e[_0x79ac('0x4c')],function(_0x451e42){var _0x4c1137={};_0x4c1137[_0x451e42]={'$like':'%'+_0xd33ecc[_0x79ac('0x48')]['filter']+'%'};return _0x4c1137;})});}_0x33e41e=_[_0x79ac('0x55')]({},_0x33e41e,_0xd33ecc[_0x79ac('0x57')]);return _0x32eea5[_0x79ac('0x9c')](_0x33e41e);}})[_0x79ac('0x1f')](function(_0x55041c){if(_0x55041c){_0x2e43e2=_0x55041c['length'];if(!_0xd33ecc['query'][_0x79ac('0x4d')](_0x79ac('0x4e'))){_0x33e41e[_0x79ac('0x2e')]=qs[_0x79ac('0x2e')](_0xd33ecc[_0x79ac('0x48')][_0x79ac('0x2e')]);_0x33e41e['offset']=qs['offset'](_0xd33ecc[_0x79ac('0x48')]['offset']);}return _0x32eea5['getApplications'](_0x33e41e);}})[_0x79ac('0x1f')](function(_0x3e7363){if(_0x3e7363){return _0x3e7363?{'count':_0x2e43e2,'rows':_0x3e7363}:null;}})['then'](respondWithResult(_0x310c69,null))[_0x79ac('0x5c')](handleError(_0x310c69,null));};exports[_0x79ac('0x9d')]=function(_0x37343c,_0x1a0aca,_0xaef9cc){var _0x6930e2={'raw':!![],'where':{}};var _0x460035={};var _0x360b66={'count':0x0,'rows':[]};return db[_0x79ac('0x42')][_0x79ac('0x6f')]({'where':{'id':_0x37343c[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x1a0aca,null))[_0x79ac('0x1f')](function(_0x38c162){if(_0x38c162){_0x460035['model']=_[_0x79ac('0x49')](db[_0x79ac('0x9e')][_0x79ac('0x43')]);_0x460035['query']=_['keys'](_0x37343c[_0x79ac('0x48')]);_0x460035['filters']=_[_0x79ac('0x4a')](_0x460035['model'],_0x460035[_0x79ac('0x48')]);_0x6930e2[_0x79ac('0x4c')]=_[_0x79ac('0x4a')](_0x460035['model'],qs[_0x79ac('0x4b')](_0x37343c[_0x79ac('0x48')][_0x79ac('0x4b')]));_0x6930e2[_0x79ac('0x4c')]=_0x6930e2['attributes'][_0x79ac('0x60')]?_0x6930e2[_0x79ac('0x4c')]:_0x460035['model'];if(!_0x37343c[_0x79ac('0x48')][_0x79ac('0x4d')](_0x79ac('0x4e'))){_0x6930e2[_0x79ac('0x2e')]=qs[_0x79ac('0x2e')](_0x37343c['query'][_0x79ac('0x2e')]);_0x6930e2[_0x79ac('0x2d')]=qs[_0x79ac('0x2d')](_0x37343c[_0x79ac('0x48')][_0x79ac('0x2d')]);}_0x6930e2[_0x79ac('0x4f')]=qs[_0x79ac('0x50')](_0x37343c[_0x79ac('0x48')][_0x79ac('0x50')]);_0x6930e2[_0x79ac('0x54')]=qs[_0x79ac('0x52')](_[_0x79ac('0x51')](_0x37343c[_0x79ac('0x48')],_0x460035[_0x79ac('0x52')]));_0x6930e2[_0x79ac('0x54')][_0x79ac('0x68')]=_0x38c162['id'];if(_0x37343c[_0x79ac('0x48')]['filter']){_0x6930e2[_0x79ac('0x54')]=_[_0x79ac('0x55')](_0x6930e2[_0x79ac('0x54')],{'$or':_['map'](_0x6930e2['attributes'],function(_0x2fabd0){var _0x193533={};_0x193533[_0x2fabd0]={'$like':'%'+_0x37343c[_0x79ac('0x48')][_0x79ac('0x53')]+'%'};return _0x193533;})});}if(_0x37343c['query'][_0x79ac('0x9f')]){var _0x61c60b=_0x37343c[_0x79ac('0x48')][_0x79ac('0x9f')]['split'](',');var _0x3576fb={};_0x3576fb[_0x61c60b[0x0]]={'$gte':moment(_0x61c60b[0x1])[_0x79ac('0xa0')](_0x79ac('0xa1'))};_0x6930e2['where']=_[_0x79ac('0x55')](_0x6930e2[_0x79ac('0x54')],_0x3576fb);}_0x6930e2=_[_0x79ac('0x55')]({},_0x6930e2,_0x37343c['options']);return db['MailMessage'][_0x79ac('0x30')]({'where':_0x6930e2[_0x79ac('0x54')]})[_0x79ac('0x1f')](function(_0x506208){_0x360b66[_0x79ac('0x30')]=_0x506208;if(_0x37343c[_0x79ac('0x48')][_0x79ac('0x58')]){_0x6930e2['include']=[{'all':!![]}];}return db['MailMessage'][_0x79ac('0x5a')](_0x6930e2);})['then'](function(_0x45633b){if(_0x37343c['query'][_0x79ac('0xa2')]===_0x79ac('0xa3')){for(var _0xe30cea=0x0;_0xe30cea<_0x45633b['length'];_0xe30cea++){_0x45633b[_0xe30cea][_0x79ac('0x63')]=juice(_0x45633b[_0xe30cea][_0x79ac('0x63')]);}}_0x360b66[_0x79ac('0x5b')]=_0x45633b;return _0x360b66;});}})[_0x79ac('0x1f')](respondWithFilteredResult(_0x1a0aca,_0x6930e2))['catch'](handleError(_0x1a0aca,null));};exports[_0x79ac('0x3b')]=function(_0x55e8d4,_0x30b78f,_0x4efe48){var _0x1c2679,_0x58ec8f={},_0x2de9d0;if(_0x55e8d4[_0x79ac('0x63')]['to']){_0x2de9d0=_0x55e8d4[_0x79ac('0x63')]['to']['split'](',')[0x0];}return db[_0x79ac('0x42')][_0x79ac('0x61')]({'where':{'id':_0x55e8d4[_0x79ac('0x5d')]['id']},'include':[{'model':db[_0x79ac('0xa4')],'as':_0x79ac('0xa5'),'include':[{'model':db[_0x79ac('0x8d')],'as':_0x79ac('0xa6'),'where':{'email':_0x2de9d0},'limit':0x1,'order':[['updatedAt',_0x79ac('0xa7')]]}]},{'model':db[_0x79ac('0x3f')],'as':_0x79ac('0x5e'),'raw':!![]}]})[_0x79ac('0x1f')](handleEntityNotFound(_0x30b78f,null))[_0x79ac('0x1f')](function(_0x465686){if(_0x465686){_0x1c2679=_0x465686;if(_0x465686['Smtp']){if(_['isNil'](_0x55e8d4[_0x79ac('0x63')]['from'])){_0x55e8d4['body'][_0x79ac('0xa8')]=util[_0x79ac('0xa0')]('%s\x20<%s>',_0x465686['name'],_0x465686[_0x79ac('0x71')]||_0x465686[_0x79ac('0x5e')][_0x79ac('0x76')]);}if(_0x55e8d4[_0x79ac('0x63')][_0x79ac('0xa9')]&&_0x55e8d4['body'][_0x79ac('0xa9')][_0x79ac('0x60')]){for(var _0x50a82e=0x0;_0x50a82e<_0x55e8d4[_0x79ac('0x63')]['attachments']['length'];_0x50a82e+=0x1){_0x55e8d4[_0x79ac('0x63')][_0x79ac('0xa9')][_0x50a82e]={'filename':_0x55e8d4[_0x79ac('0x63')]['attachments'][_0x50a82e][_0x79ac('0x3a')],'path':path[_0x79ac('0xaa')](config[_0x79ac('0xab')],_0x79ac('0xac'),_0x55e8d4[_0x79ac('0x63')][_0x79ac('0xa9')][_0x50a82e]['basename'])};}}var _0x2be7fb={'tls':{'rejectUnauthorized':![]}};if(_[_0x79ac('0xad')](_0x465686[_0x79ac('0x5e')][_0x79ac('0x7c')])){if(_0x465686[_0x79ac('0x5e')]['authentication']){_0x2be7fb[_0x79ac('0xae')]={'user':_0x465686[_0x79ac('0x5e')][_0x79ac('0x76')],'pass':_0x465686['Smtp'][_0x79ac('0xaf')]};}_0x2be7fb['host']=_0x465686[_0x79ac('0x5e')]['host'];_0x2be7fb[_0x79ac('0x7b')]=_0x465686[_0x79ac('0x5e')][_0x79ac('0x7b')];_0x2be7fb[_0x79ac('0xb0')]=_0x465686[_0x79ac('0x5e')]['secure'];}else{_0x2be7fb[_0x79ac('0x7c')]=_0x465686['Smtp'][_0x79ac('0x7c')];_0x2be7fb[_0x79ac('0xae')]={'user':_0x465686[_0x79ac('0x5e')][_0x79ac('0x76')],'pass':_0x465686[_0x79ac('0x5e')][_0x79ac('0xaf')]};}return respondWithRpcPromise(_0x79ac('0xb1'),_0x79ac('0xb2'),{'account':_0x2be7fb,'message':_0x55e8d4[_0x79ac('0x63')]});}else{throw new Error('List\x20not\x20found');}}})[_0x79ac('0x1f')](function(_0x1e3654){if(_0x1e3654){_0x58ec8f=_0x1e3654;if(_0x1c2679[_0x79ac('0xa5')]){if(_0x1c2679[_0x79ac('0xa5')]['Contacts'][_0x79ac('0x60')]){return _0x1c2679['List'][_0x79ac('0xa6')][0x0];}else{return db[_0x79ac('0x8d')]['create'](_[_0x79ac('0x19')](_0x55e8d4['body'],{'firstName':_0x55e8d4['body']['to'],'email':_0x55e8d4[_0x79ac('0x63')]['to'],'phone':_0x55e8d4[_0x79ac('0x63')]['to'],'ListId':_0x1c2679[_0x79ac('0xb3')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x79ac('0x1f')](function(_0x1a8838){if(_0x1a8838){var _0x3becbe={'UserId':_0x55e8d4[_0x79ac('0x76')]['id'],'ContactId':_0x1a8838['id'],'MailAccountId':_0x1c2679['id'],'inReplyTo':_0x58ec8f[_0x79ac('0xb4')],'to':_0x55e8d4[_0x79ac('0x63')][_0x79ac('0xa8')],'cc':_0x55e8d4[_0x79ac('0x63')]['cc'],'subject':_0x55e8d4[_0x79ac('0x63')][_0x79ac('0xb5')],'attach':_0x55e8d4[_0x79ac('0x63')][_0x79ac('0xb6')],'firstMsgDirection':_0x79ac('0xb7'),'lastMsgAt':moment()[_0x79ac('0xa0')](_0x79ac('0xa1')),'lastMsgDirection':_0x79ac('0xb7'),'Messages':[_[_0x79ac('0x55')](_0x55e8d4['body'],{'messageId':_0x58ec8f['messageId'],'sentAt':moment()[_0x79ac('0xa0')](_0x79ac('0xa1')),'read':!![],'MailAccountId':_0x1c2679['id'],'UserId':_0x55e8d4['user']['id'],'ContactId':_0x1a8838['id']})]};if(_0x55e8d4[_0x79ac('0x63')][_0x79ac('0xb8')]){_0x3becbe=_[_0x79ac('0x55')](_0x3becbe,_0x55e8d4[_0x79ac('0x63')][_0x79ac('0xb8')]);}return db[_0x79ac('0x8b')][_0x79ac('0x6d')](_0x3becbe,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x79ac('0x1f')](respondWithResult(_0x30b78f,null))[_0x79ac('0x5c')](handleError(_0x30b78f,null));};exports[_0x79ac('0xb9')]=function(_0x4c9105,_0x332947,_0x5d0584){return db[_0x79ac('0x42')]['find']({'where':{'id':_0x4c9105[_0x79ac('0x5d')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x79ac('0x5e'),'raw':!![]}]})[_0x79ac('0x1f')](handleEntityNotFound(_0x332947,null))[_0x79ac('0x1f')](function(_0x37cb12){if(_0x37cb12&&_0x37cb12[_0x79ac('0x5e')]){var _0x3effe1={'id':_0x37cb12['id'],'tls':{'rejectUnauthorized':![]}};if(_0x37cb12['Smtp']['service']){_0x3effe1[_0x79ac('0x7c')]=_0x37cb12[_0x79ac('0x5e')][_0x79ac('0x7c')];}else{_0x3effe1[_0x79ac('0x7a')]=_0x37cb12['Smtp'][_0x79ac('0x7a')];_0x3effe1[_0x79ac('0x7b')]=_0x37cb12['Smtp']['port'];_0x3effe1['secure']=_0x37cb12['Smtp']['secure'];}if(_0x37cb12[_0x79ac('0x5e')]['authentication']){_0x3effe1[_0x79ac('0xae')]={'user':_0x37cb12[_0x79ac('0x5e')]['user'],'pass':_0x37cb12[_0x79ac('0x5e')][_0x79ac('0xaf')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x3effe1});}})[_0x79ac('0x1f')](respondWithResult(_0x332947,null))[_0x79ac('0x5c')](handleError(_0x332947,null));};exports[_0x79ac('0x36')]=function(_0x552083,_0x240566){return db['MailAccount'][_0x79ac('0x61')]({'where':{'id':_0x552083[_0x79ac('0x5d')]['id']}})['then'](handleEntityNotFound(_0x240566,null))[_0x79ac('0x1f')](function(_0x58b449){if(_0x58b449&&_0x58b449[_0x79ac('0x7c')]){throw new db[(_0x79ac('0xba'))][(_0x79ac('0xbb'))](_0x79ac('0xbc'));}return _0x58b449;})[_0x79ac('0x1f')](removeEntity(_0x240566,null))['catch'](handleError(_0x240566,null));};exports[_0x79ac('0xbd')]=function(_0x7e8e32,_0x2d6b0,_0x461344){return db[_0x79ac('0x42')]['find']({'where':{'id':_0x7e8e32[_0x79ac('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2d6b0,null))[_0x79ac('0x1f')](function(_0x33be35){if(_0x33be35){return _0x33be35[_0x79ac('0xbd')](_0x7e8e32[_0x79ac('0x63')][_0x79ac('0x6a')],_[_0x79ac('0xbe')](_0x7e8e32['body'],[_0x79ac('0x6a'),'id'])||{})[_0x79ac('0xbf')](function(_0x5e64d4){for(var _0xf6b2eb=0x0;_0xf6b2eb<_0x7e8e32[_0x79ac('0x63')][_0x79ac('0x6a')][_0x79ac('0x60')];_0xf6b2eb+=0x1){socket[_0x79ac('0xc0')](_0x79ac('0xc1'),{'UserId':Number(_0x7e8e32[_0x79ac('0x63')][_0x79ac('0x6a')][_0xf6b2eb]),'MailAccountId':Number(_0x7e8e32[_0x79ac('0x5d')]['id'])});}return _0x5e64d4;});}})[_0x79ac('0x1f')](respondWithResult(_0x2d6b0,null))['catch'](handleError(_0x2d6b0,null));};exports[_0x79ac('0xc2')]=function(_0x1d8853,_0x29725a,_0x49fcba){return db[_0x79ac('0x42')][_0x79ac('0x61')]({'where':{'id':_0x1d8853[_0x79ac('0x5d')]['id']}})[_0x79ac('0x1f')](handleEntityNotFound(_0x29725a,null))[_0x79ac('0x1f')](function(_0x4bddcc){if(_0x4bddcc){return _0x4bddcc[_0x79ac('0xc2')](_0x1d8853[_0x79ac('0x48')][_0x79ac('0x6a')])['then'](function(){if(_['isArray'](_0x1d8853[_0x79ac('0x48')][_0x79ac('0x6a')])){for(var _0x574314=0x0;_0x574314<_0x1d8853[_0x79ac('0x48')][_0x79ac('0x6a')]['length'];_0x574314+=0x1){socket[_0x79ac('0xc0')](_0x79ac('0xc3'),{'UserId':Number(_0x1d8853[_0x79ac('0x48')][_0x79ac('0x6a')][_0x574314]),'MailAccountId':Number(_0x1d8853[_0x79ac('0x5d')]['id'])});}}else{socket[_0x79ac('0xc0')](_0x79ac('0xc3'),{'UserId':Number(_0x1d8853[_0x79ac('0x48')][_0x79ac('0x6a')]),'MailAccountId':Number(_0x1d8853[_0x79ac('0x5d')]['id'])});}});}})[_0x79ac('0x1f')](respondWithStatusCode(_0x29725a,null))[_0x79ac('0x5c')](handleError(_0x29725a,null));};exports[_0x79ac('0xc4')]=function(_0x5b65a8,_0xc507c1,_0x5650f0){var _0x80fe03={};var _0x892d95={};var _0xd6e2f8;var _0x4cfa93;return db['MailAccount'][_0x79ac('0x6f')]({'where':{'id':_0x5b65a8[_0x79ac('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc507c1,null))[_0x79ac('0x1f')](function(_0x3457a8){if(_0x3457a8){_0xd6e2f8=_0x3457a8;_0x892d95[_0x79ac('0x47')]=_['keys'](db['User'][_0x79ac('0x43')]);_0x892d95[_0x79ac('0x48')]=_[_0x79ac('0x49')](_0x5b65a8[_0x79ac('0x48')]);_0x892d95['filters']=_[_0x79ac('0x4a')](_0x892d95['model'],_0x892d95['query']);_0x80fe03[_0x79ac('0x4c')]=_[_0x79ac('0x4a')](_0x892d95['model'],qs[_0x79ac('0x4b')](_0x5b65a8[_0x79ac('0x48')][_0x79ac('0x4b')]));_0x80fe03[_0x79ac('0x4c')]=_0x80fe03[_0x79ac('0x4c')][_0x79ac('0x60')]?_0x80fe03['attributes']:_0x892d95[_0x79ac('0x47')];_0x80fe03[_0x79ac('0x4f')]=qs[_0x79ac('0x50')](_0x5b65a8[_0x79ac('0x48')][_0x79ac('0x50')]);_0x80fe03[_0x79ac('0x54')]=qs['filters'](_[_0x79ac('0x51')](_0x5b65a8[_0x79ac('0x48')],_0x892d95['filters']));if(_0x5b65a8[_0x79ac('0x48')][_0x79ac('0x53')]){_0x80fe03[_0x79ac('0x54')]=_[_0x79ac('0x55')](_0x80fe03[_0x79ac('0x54')],{'$or':_[_0x79ac('0x41')](_0x80fe03[_0x79ac('0x4c')],function(_0xf375f){var _0x5319c0={};_0x5319c0[_0xf375f]={'$like':'%'+_0x5b65a8[_0x79ac('0x48')]['filter']+'%'};return _0x5319c0;})});}_0x80fe03=_[_0x79ac('0x55')]({},_0x80fe03,_0x5b65a8[_0x79ac('0x57')]);return _0xd6e2f8[_0x79ac('0xc4')](_0x80fe03);}})[_0x79ac('0x1f')](function(_0x3071bc){if(_0x3071bc){_0x4cfa93=_0x3071bc[_0x79ac('0x60')];if(!_0x5b65a8[_0x79ac('0x48')][_0x79ac('0x4d')]('nolimit')){_0x80fe03[_0x79ac('0x2e')]=qs[_0x79ac('0x2e')](_0x5b65a8[_0x79ac('0x48')][_0x79ac('0x2e')]);_0x80fe03[_0x79ac('0x2d')]=qs[_0x79ac('0x2d')](_0x5b65a8[_0x79ac('0x48')][_0x79ac('0x2d')]);}return _0xd6e2f8['getAgents'](_0x80fe03);}})[_0x79ac('0x1f')](function(_0xa917d4){if(_0xa917d4){return _0xa917d4?{'count':_0x4cfa93,'rows':_0xa917d4}:null;}})[_0x79ac('0x1f')](respondWithResult(_0xc507c1,null))[_0x79ac('0x5c')](handleError(_0xc507c1,null));}; \ No newline at end of file +var _0xae4f=['ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','email','ListId','isNil','active','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','cservice','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','MailApplication','findAndCountAll','priority','getApplications','$gte','split','format','MailMessage','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','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','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','stack','name','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','MailAccount','findAll','show','Pause','keys','includeAll','include','merge','find','body','describe','addDisposition','params','MailAccountId','Disposition','create','findOne','rows','removeDispositions'];(function(_0x571d93,_0x5c04e5){var _0x2d60e5=function(_0x2afd87){while(--_0x2afd87){_0x571d93['push'](_0x571d93['shift']());}};_0x2d60e5(++_0x5c04e5);}(_0xae4f,0x1e3));var _0xfae4=function(_0x499c3a,_0x228ec8){_0x499c3a=_0x499c3a-0x0;var _0xccb266=_0xae4f[_0x499c3a];return _0xccb266;};'use strict';var emlformat=require(_0xfae4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfae4('0x1'));var jsonpatch=require(_0xfae4('0x2'));var rp=require('request-promise');var moment=require(_0xfae4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfae4('0x4'));var util=require(_0xfae4('0x5'));var path=require(_0xfae4('0x6'));var sox=require('sox');var csv=require(_0xfae4('0x7'));var ejs=require(_0xfae4('0x8'));var fs=require('fs');var fs_extra=require(_0xfae4('0x9'));var _=require('lodash');var squel=require(_0xfae4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfae4('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfae4('0xc'));var Papa=require(_0xfae4('0xd'));var htmlToText=require(_0xfae4('0xe'));var juice=require(_0xfae4('0xf'));var Redis=require(_0xfae4('0x10'));var authService=require(_0xfae4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfae4('0x12'));var hardwareService=require(_0xfae4('0x13'));var logger=require('../../config/logger')(_0xfae4('0x14'));var utils=require(_0xfae4('0x15'));var config=require(_0xfae4('0x16'));var licenseUtil=require(_0xfae4('0x17'));var db=require('../../mysqldb')['db'];config[_0xfae4('0x18')]=_[_0xfae4('0x19')](config[_0xfae4('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xfae4('0x1a'))(new Redis(config['redis']));require(_0xfae4('0x1b'))[_0xfae4('0x1c')](socket);var jayson=require(_0xfae4('0x1d'));var client=jayson[_0xfae4('0x1e')][_0xfae4('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x413cc0,_0x4bfbd7,_0x5a9e58,_0x4ab620){return new BPromise(function(_0x11a145,_0x3e58a2){var _0x2057a0=_0x4ab620||client;return _0x2057a0[_0xfae4('0x20')](_0x413cc0,_0x5a9e58)['then'](function(_0x56c701){logger[_0xfae4('0x21')](_0xfae4('0x22'),_0x4bfbd7,_0xfae4('0x23'));logger[_0xfae4('0x24')](_0xfae4('0x25'),_0x4bfbd7,_0xfae4('0x23'),JSON[_0xfae4('0x26')](_0x56c701));if(_0x56c701[_0xfae4('0x27')]){if(_0x56c701[_0xfae4('0x27')][_0xfae4('0x28')]===0x1f4){logger['error'](_0xfae4('0x22'),_0x4bfbd7,_0x56c701[_0xfae4('0x27')][_0xfae4('0x29')]);return _0x3e58a2(_0x56c701[_0xfae4('0x27')][_0xfae4('0x29')]);}logger[_0xfae4('0x27')](_0xfae4('0x22'),_0x4bfbd7,_0x56c701[_0xfae4('0x27')]['message']);return _0x11a145(_0x56c701['error'][_0xfae4('0x29')]);}else{logger[_0xfae4('0x21')](_0xfae4('0x22'),_0x4bfbd7,'request\x20sent');_0x11a145(_0x56c701[_0xfae4('0x2a')]['message']);}})[_0xfae4('0x2b')](function(_0x731d5){logger[_0xfae4('0x27')](_0xfae4('0x22'),_0x4bfbd7,_0x731d5);_0x3e58a2(_0x731d5);});});}function respondWithStatusCode(_0x30bb14,_0x503ff2){_0x503ff2=_0x503ff2||0xcc;return function(_0x5da354){if(_0x5da354){return _0x30bb14[_0xfae4('0x2c')](_0x503ff2);}return _0x30bb14[_0xfae4('0x2d')](_0x503ff2)[_0xfae4('0x2e')]();};}function respondWithResult(_0x21a1c8,_0x1acbe4){_0x1acbe4=_0x1acbe4||0xc8;return function(_0x2a99b6){if(_0x2a99b6){return _0x21a1c8[_0xfae4('0x2d')](_0x1acbe4)[_0xfae4('0x2f')](_0x2a99b6);}};}function respondWithFilteredResult(_0x56017b,_0x394165){return function(_0x71819d){if(_0x71819d){var _0xeebf72=typeof _0x394165['offset']===_0xfae4('0x30')&&typeof _0x394165[_0xfae4('0x31')]===_0xfae4('0x30');var _0x5e463a=_0x71819d['count'];var _0x135291=_0xeebf72?0x0:_0x394165['offset'];var _0x125cfb=_0xeebf72?_0x71819d[_0xfae4('0x32')]:_0x394165[_0xfae4('0x33')]+_0x394165[_0xfae4('0x31')];var _0x537570;if(_0x125cfb>=_0x5e463a){_0x125cfb=_0x5e463a;_0x537570=0xc8;}else{_0x537570=0xce;}_0x56017b['status'](_0x537570);return _0x56017b['set'](_0xfae4('0x34'),_0x135291+'-'+_0x125cfb+'/'+_0x5e463a)[_0xfae4('0x2f')](_0x71819d);}return null;};}function patchUpdates(_0x517621){return function(_0x1b55c5){try{jsonpatch[_0xfae4('0x35')](_0x1b55c5,_0x517621,!![]);}catch(_0x23a870){return BPromise['reject'](_0x23a870);}return _0x1b55c5[_0xfae4('0x36')]();};}function saveUpdates(_0xdd298b,_0x2cc172){return function(_0x1f2a98){if(_0x1f2a98){return _0x1f2a98[_0xfae4('0x37')](_0xdd298b)[_0xfae4('0x38')](function(_0x1d0929){return _0x1d0929;});}return null;};}function removeEntity(_0x4594f4,_0x5e8f4e){return function(_0x5f3425){if(_0x5f3425){return _0x5f3425['destroy']()[_0xfae4('0x38')](function(){var _0x19d941=_0x5f3425[_0xfae4('0x39')]({'plain':!![]});var _0x5eeed4='MailAccounts';return db[_0xfae4('0x3a')][_0xfae4('0x3b')]({'where':{'type':_0x5eeed4,'resourceId':_0x19d941['id']}})[_0xfae4('0x38')](function(){return _0x5f3425;});})[_0xfae4('0x38')](function(){_0x4594f4[_0xfae4('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30e33f,_0x44c453){return function(_0x2b7d6f){if(!_0x2b7d6f){_0x30e33f[_0xfae4('0x2c')](0x194);}return _0x2b7d6f;};}function handleError(_0x5ccafc,_0x515221){_0x515221=_0x515221||0x1f4;return function(_0x2b1ac4){logger[_0xfae4('0x27')](_0x2b1ac4[_0xfae4('0x3c')]);if(_0x2b1ac4['name']){delete _0x2b1ac4[_0xfae4('0x3d')];}_0x5ccafc['status'](_0x515221)['send'](_0x2b1ac4);};}exports[_0xfae4('0x3e')]=function(_0x436461,_0x4c7dd3){var _0x21ca45={'include':[{'model':db[_0xfae4('0x3f')],'as':_0xfae4('0x40')},{'model':db[_0xfae4('0x41')],'as':_0xfae4('0x42')},{'model':db['Pause'],'as':_0xfae4('0x43')}]},_0x253426={},_0x2dcaa0={'count':0x0,'rows':[]};var _0x4611a3=_[_0xfae4('0x44')](db['MailAccount'][_0xfae4('0x45')],function(_0x34a3b3){return{'name':_0x34a3b3[_0xfae4('0x46')],'type':_0x34a3b3[_0xfae4('0x47')][_0xfae4('0x48')]};});_0x253426[_0xfae4('0x49')]=_[_0xfae4('0x44')](_0x4611a3,_0xfae4('0x3d'));_0x253426[_0xfae4('0x4a')]=_['keys'](_0x436461['query']);_0x253426[_0xfae4('0x4b')]=_[_0xfae4('0x4c')](_0x253426[_0xfae4('0x49')],_0x253426[_0xfae4('0x4a')]);_0x21ca45[_0xfae4('0x4d')]=_[_0xfae4('0x4c')](_0x253426[_0xfae4('0x49')],qs[_0xfae4('0x4e')](_0x436461[_0xfae4('0x4a')]['fields']));_0x21ca45[_0xfae4('0x4d')]=_0x21ca45['attributes'][_0xfae4('0x4f')]?_0x21ca45['attributes']:_0x253426[_0xfae4('0x49')];if(!_0x436461[_0xfae4('0x4a')][_0xfae4('0x50')](_0xfae4('0x51'))){_0x21ca45[_0xfae4('0x31')]=qs[_0xfae4('0x31')](_0x436461[_0xfae4('0x4a')][_0xfae4('0x31')]);_0x21ca45['offset']=qs[_0xfae4('0x33')](_0x436461[_0xfae4('0x4a')][_0xfae4('0x33')]);}_0x21ca45[_0xfae4('0x52')]=qs[_0xfae4('0x53')](_0x436461[_0xfae4('0x4a')][_0xfae4('0x53')]);_0x21ca45[_0xfae4('0x54')]=qs[_0xfae4('0x4b')](_[_0xfae4('0x55')](_0x436461[_0xfae4('0x4a')],_0x253426[_0xfae4('0x4b')]),_0x4611a3);if(_0x436461[_0xfae4('0x4a')][_0xfae4('0x56')]){_0x21ca45['where']=_['merge'](_0x21ca45['where'],{'$or':_[_0xfae4('0x44')](_0x4611a3,function(_0x15a42c){if(_0x15a42c['type']!==_0xfae4('0x57')){var _0x34fb0c={};_0x34fb0c[_0x15a42c[_0xfae4('0x3d')]]={'$like':'%'+_0x436461[_0xfae4('0x4a')]['filter']+'%'};return _0x34fb0c;}})});}_0x21ca45=_['merge']({},_0x21ca45,_0x436461[_0xfae4('0x58')]);var _0x4a7e3a={'where':_0x21ca45[_0xfae4('0x54')]};return db[_0xfae4('0x59')][_0xfae4('0x32')](_0x4a7e3a)[_0xfae4('0x38')](function(_0x15fe0c){_0x2dcaa0[_0xfae4('0x32')]=_0x15fe0c;if(_0x436461['query']['includeAll']){_0x21ca45['include']=[{'all':!![]}];}return db[_0xfae4('0x59')][_0xfae4('0x5a')](_0x21ca45);})[_0xfae4('0x38')](function(_0x5540a8){_0x2dcaa0['rows']=_0x5540a8;return _0x2dcaa0;})[_0xfae4('0x38')](respondWithFilteredResult(_0x4c7dd3,_0x21ca45))[_0xfae4('0x2b')](handleError(_0x4c7dd3,null));};exports[_0xfae4('0x5b')]=function(_0x41ab70,_0x49a4a1){var _0x3b5e7d={'raw':![],'where':{'id':_0x41ab70['params']['id']},'include':[{'model':db[_0xfae4('0x3f')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xfae4('0x42')},{'model':db[_0xfae4('0x5c')],'as':_0xfae4('0x43')}]},_0x4691ec={};_0x4691ec[_0xfae4('0x49')]=_[_0xfae4('0x5d')](db[_0xfae4('0x59')][_0xfae4('0x45')]);_0x4691ec[_0xfae4('0x4a')]=_['keys'](_0x41ab70[_0xfae4('0x4a')]);_0x4691ec['filters']=_[_0xfae4('0x4c')](_0x4691ec[_0xfae4('0x49')],_0x4691ec[_0xfae4('0x4a')]);_0x3b5e7d[_0xfae4('0x4d')]=_[_0xfae4('0x4c')](_0x4691ec[_0xfae4('0x49')],qs[_0xfae4('0x4e')](_0x41ab70[_0xfae4('0x4a')]['fields']));_0x3b5e7d[_0xfae4('0x4d')]=_0x3b5e7d[_0xfae4('0x4d')][_0xfae4('0x4f')]?_0x3b5e7d[_0xfae4('0x4d')]:_0x4691ec['model'];if(_0x41ab70[_0xfae4('0x4a')][_0xfae4('0x5e')]){_0x3b5e7d[_0xfae4('0x5f')]=[{'all':!![]}];}_0x3b5e7d=_[_0xfae4('0x60')]({},_0x3b5e7d,_0x41ab70[_0xfae4('0x58')]);return db[_0xfae4('0x59')][_0xfae4('0x61')](_0x3b5e7d)[_0xfae4('0x38')](handleEntityNotFound(_0x49a4a1,null))[_0xfae4('0x38')](respondWithResult(_0x49a4a1,null))['catch'](handleError(_0x49a4a1,null));};exports[_0xfae4('0x37')]=function(_0x5b3c,_0x4abc09){if(_0x5b3c[_0xfae4('0x62')]['id']){delete _0x5b3c['body']['id'];}return db[_0xfae4('0x59')]['find']({'where':{'id':_0x5b3c['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xfae4('0x40')},{'model':db[_0xfae4('0x41')],'as':_0xfae4('0x42')},{'model':db[_0xfae4('0x5c')],'as':'mandatoryDispositionPause'}]})[_0xfae4('0x38')](handleEntityNotFound(_0x4abc09,null))[_0xfae4('0x38')](saveUpdates(_0x5b3c[_0xfae4('0x62')],null))['then'](function(_0x2000cc){if(_0x2000cc&&_0x5b3c[_0xfae4('0x62')][_0xfae4('0x40')]){return db['MailServerIn']['update'](_0x5b3c[_0xfae4('0x62')][_0xfae4('0x40')],{'where':{'MailAccountId':_0x2000cc['id']}})[_0xfae4('0x38')](function(){return _0x2000cc;});}return _0x2000cc;})[_0xfae4('0x38')](function(_0x4b89d5){if(_0x4b89d5&&_0x5b3c[_0xfae4('0x62')][_0xfae4('0x42')]){return db['MailServerOut'][_0xfae4('0x37')](_0x5b3c[_0xfae4('0x62')]['Smtp'],{'where':{'MailAccountId':_0x4b89d5['id']}})[_0xfae4('0x38')](function(){return _0x4b89d5;});}return _0x4b89d5;})[_0xfae4('0x38')](respondWithResult(_0x4abc09,null))[_0xfae4('0x2b')](handleError(_0x4abc09,null));};exports[_0xfae4('0x63')]=function(_0x17a29f,_0x2669b2){return db[_0xfae4('0x59')][_0xfae4('0x63')]()[_0xfae4('0x38')](respondWithResult(_0x2669b2,null))[_0xfae4('0x2b')](handleError(_0x2669b2,null));};exports[_0xfae4('0x64')]=function(_0x42ed6c,_0x587b25,_0x3f01a6){if(_0x42ed6c[_0xfae4('0x62')]['id']){delete _0x42ed6c[_0xfae4('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x42ed6c[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x587b25,null))[_0xfae4('0x38')](function(_0x489533){if(_0x489533){_0x42ed6c[_0xfae4('0x62')][_0xfae4('0x66')]=_0x489533['id'];return db[_0xfae4('0x67')][_0xfae4('0x68')](_0x42ed6c[_0xfae4('0x62')]);}})[_0xfae4('0x38')](respondWithResult(_0x587b25,null))['catch'](handleError(_0x587b25,null));};exports['getDispositions']=function(_0x4e7087,_0x289fce,_0x2b0e73){var _0x440d54={'raw':![],'where':{}};var _0x4ac2fc={};var _0x523aaa={'count':0x0,'rows':[]};return db[_0xfae4('0x59')][_0xfae4('0x69')]({'where':{'id':_0x4e7087[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x289fce,null))['then'](function(_0x538db6){if(_0x538db6){_0x4ac2fc['model']=_[_0xfae4('0x5d')](db['Disposition'][_0xfae4('0x45')]);_0x4ac2fc[_0xfae4('0x4a')]=_[_0xfae4('0x5d')](_0x4e7087['query']);_0x4ac2fc[_0xfae4('0x4b')]=_[_0xfae4('0x4c')](_0x4ac2fc[_0xfae4('0x49')],_0x4ac2fc[_0xfae4('0x4a')]);_0x440d54[_0xfae4('0x4d')]=_[_0xfae4('0x4c')](_0x4ac2fc[_0xfae4('0x49')],qs['fields'](_0x4e7087[_0xfae4('0x4a')][_0xfae4('0x4e')]));_0x440d54['attributes']=_0x440d54[_0xfae4('0x4d')][_0xfae4('0x4f')]?_0x440d54['attributes']:_0x4ac2fc[_0xfae4('0x49')];if(!_0x4e7087[_0xfae4('0x4a')][_0xfae4('0x50')](_0xfae4('0x51'))){_0x440d54[_0xfae4('0x31')]=qs[_0xfae4('0x31')](_0x4e7087['query'][_0xfae4('0x31')]);_0x440d54[_0xfae4('0x33')]=qs['offset'](_0x4e7087[_0xfae4('0x4a')][_0xfae4('0x33')]);}_0x440d54['order']=qs[_0xfae4('0x53')](_0x4e7087['query'][_0xfae4('0x53')]);_0x440d54[_0xfae4('0x54')]=qs[_0xfae4('0x4b')](_['pick'](_0x4e7087[_0xfae4('0x4a')],_0x4ac2fc[_0xfae4('0x4b')]));_0x440d54[_0xfae4('0x54')][_0xfae4('0x66')]=_0x538db6['id'];if(_0x4e7087[_0xfae4('0x4a')][_0xfae4('0x56')]){_0x440d54['where']=_[_0xfae4('0x60')](_0x440d54[_0xfae4('0x54')],{'$or':_[_0xfae4('0x44')](_0x440d54[_0xfae4('0x4d')],function(_0x3752cf){var _0x484429={};_0x484429[_0x3752cf]={'$like':'%'+_0x4e7087['query'][_0xfae4('0x56')]+'%'};return _0x484429;})});}_0x440d54=_['merge']({},_0x440d54,_0x4e7087[_0xfae4('0x58')]);return db['Disposition'][_0xfae4('0x32')]({'where':_0x440d54['where']})['then'](function(_0x10709f){_0x523aaa[_0xfae4('0x32')]=_0x10709f;if(_0x4e7087[_0xfae4('0x4a')]['includeAll']){_0x440d54['include']=[{'all':!![]}];}return db[_0xfae4('0x67')]['findAll'](_0x440d54);})[_0xfae4('0x38')](function(_0x3593f2){_0x523aaa[_0xfae4('0x6a')]=_0x3593f2;return _0x523aaa;});}})[_0xfae4('0x38')](respondWithFilteredResult(_0x289fce,_0x440d54))[_0xfae4('0x2b')](handleError(_0x289fce,null));};exports[_0xfae4('0x6b')]=function(_0x4774a0,_0x147dec,_0x465750){return db[_0xfae4('0x59')][_0xfae4('0x61')]({'where':{'id':_0x4774a0['params']['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x147dec,null))[_0xfae4('0x38')](function(_0x2ca836){if(_0x2ca836){return _0x2ca836[_0xfae4('0x6b')](_0x4774a0['query'][_0xfae4('0x6c')]);}})[_0xfae4('0x38')](respondWithStatusCode(_0x147dec,null))[_0xfae4('0x2b')](handleError(_0x147dec,null));};exports[_0xfae4('0x6d')]=function(_0x46553b,_0x11edd9,_0x4e7fc0){if(_0x46553b['body']['id']){delete _0x46553b['body']['id'];}return db[_0xfae4('0x59')]['find']({'where':{'id':_0x46553b[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x11edd9,null))[_0xfae4('0x38')](function(_0xe29627){if(_0xe29627){_0x46553b['body'][_0xfae4('0x66')]=_0xe29627['id'];return db['CannedAnswer'][_0xfae4('0x68')](_0x46553b[_0xfae4('0x62')]);}})['then'](respondWithResult(_0x11edd9,null))[_0xfae4('0x2b')](handleError(_0x11edd9,null));};exports[_0xfae4('0x6e')]=function(_0x3632dc,_0x4adf71,_0x3d17f6){var _0x3459de={'raw':![],'where':{}};var _0xb50294={};var _0xab6de4={'count':0x0,'rows':[]};return db[_0xfae4('0x59')][_0xfae4('0x69')]({'where':{'id':_0x3632dc[_0xfae4('0x65')]['id']}})['then'](handleEntityNotFound(_0x4adf71,null))[_0xfae4('0x38')](function(_0x1ff754){if(_0x1ff754){_0xb50294[_0xfae4('0x49')]=_[_0xfae4('0x5d')](db[_0xfae4('0x6f')][_0xfae4('0x45')]);_0xb50294[_0xfae4('0x4a')]=_['keys'](_0x3632dc[_0xfae4('0x4a')]);_0xb50294[_0xfae4('0x4b')]=_[_0xfae4('0x4c')](_0xb50294[_0xfae4('0x49')],_0xb50294[_0xfae4('0x4a')]);_0x3459de['attributes']=_['intersection'](_0xb50294[_0xfae4('0x49')],qs['fields'](_0x3632dc['query'][_0xfae4('0x4e')]));_0x3459de[_0xfae4('0x4d')]=_0x3459de['attributes'][_0xfae4('0x4f')]?_0x3459de[_0xfae4('0x4d')]:_0xb50294[_0xfae4('0x49')];if(!_0x3632dc[_0xfae4('0x4a')]['hasOwnProperty'](_0xfae4('0x51'))){_0x3459de[_0xfae4('0x31')]=qs[_0xfae4('0x31')](_0x3632dc[_0xfae4('0x4a')][_0xfae4('0x31')]);_0x3459de[_0xfae4('0x33')]=qs[_0xfae4('0x33')](_0x3632dc[_0xfae4('0x4a')]['offset']);}_0x3459de[_0xfae4('0x52')]=qs[_0xfae4('0x53')](_0x3632dc[_0xfae4('0x4a')][_0xfae4('0x53')]);_0x3459de[_0xfae4('0x54')]=qs[_0xfae4('0x4b')](_[_0xfae4('0x55')](_0x3632dc['query'],_0xb50294[_0xfae4('0x4b')]));_0x3459de[_0xfae4('0x54')][_0xfae4('0x66')]=_0x1ff754['id'];if(_0x3632dc[_0xfae4('0x4a')][_0xfae4('0x56')]){_0x3459de[_0xfae4('0x54')]=_[_0xfae4('0x60')](_0x3459de['where'],{'$or':_['map'](_0x3459de['attributes'],function(_0xf0cb8b){var _0x3364ff={};_0x3364ff[_0xf0cb8b]={'$like':'%'+_0x3632dc[_0xfae4('0x4a')][_0xfae4('0x56')]+'%'};return _0x3364ff;})});}_0x3459de=_[_0xfae4('0x60')]({},_0x3459de,_0x3632dc[_0xfae4('0x58')]);return db['CannedAnswer'][_0xfae4('0x32')]({'where':_0x3459de[_0xfae4('0x54')]})[_0xfae4('0x38')](function(_0x1f27c7){_0xab6de4[_0xfae4('0x32')]=_0x1f27c7;if(_0x3632dc[_0xfae4('0x4a')][_0xfae4('0x5e')]){_0x3459de[_0xfae4('0x5f')]=[{'all':!![]}];}return db['CannedAnswer'][_0xfae4('0x5a')](_0x3459de);})[_0xfae4('0x38')](function(_0x156627){_0xab6de4[_0xfae4('0x6a')]=_0x156627;return _0xab6de4;});}})[_0xfae4('0x38')](respondWithFilteredResult(_0x4adf71,_0x3459de))['catch'](handleError(_0x4adf71,null));};exports[_0xfae4('0x70')]=function(_0xcb8cf5,_0x2673b7,_0x22606d){return db[_0xfae4('0x59')][_0xfae4('0x61')]({'where':{'id':_0xcb8cf5['params']['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x2673b7,null))[_0xfae4('0x38')](function(_0x332eee){if(_0x332eee){return _0x332eee[_0xfae4('0x70')](_0xcb8cf5['query'][_0xfae4('0x6c')]);}})[_0xfae4('0x38')](respondWithStatusCode(_0x2673b7,null))['catch'](handleError(_0x2673b7,null));};exports[_0xfae4('0x68')]=function(_0x1a7800,_0x4cdd8d){var _0x37c569={'name':_0x1a7800[_0xfae4('0x62')][_0xfae4('0x3d')],'key':_0x1a7800['body'][_0xfae4('0x48')],'email':_0x1a7800[_0xfae4('0x62')][_0xfae4('0x71')],'ListId':_0x1a7800[_0xfae4('0x62')][_0xfae4('0x72')],'active':!_[_0xfae4('0x73')](_0x1a7800[_0xfae4('0x62')][_0xfae4('0x74')])?_0x1a7800[_0xfae4('0x62')][_0xfae4('0x74')]:!![],'description':_0x1a7800['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0xfae4('0x73')](_0x1a7800[_0xfae4('0x62')]['cservice'])){if(_0x1a7800[_0xfae4('0x62')][_0xfae4('0x75')]){_0x37c569[_0xfae4('0x40')][_0xfae4('0x76')]=_0x37c569[_0xfae4('0x42')][_0xfae4('0x76')]=_0x1a7800[_0xfae4('0x62')][_0xfae4('0x77')];_0x37c569[_0xfae4('0x40')][_0xfae4('0x78')]=_0x37c569['Smtp']['pass']=_0x1a7800[_0xfae4('0x62')][_0xfae4('0x79')];}else{_0x37c569[_0xfae4('0x40')][_0xfae4('0x7a')]=_0x37c569['Smtp'][_0xfae4('0x7a')]=![];}_0x37c569[_0xfae4('0x40')][_0xfae4('0x7b')]=_0x1a7800['body'][_0xfae4('0x40')][_0xfae4('0x7b')];_0x37c569['Imap'][_0xfae4('0x7c')]=_0x1a7800['body']['Imap']['port'];_0x37c569[_0xfae4('0x42')][_0xfae4('0x7b')]=_0x1a7800['body']['Smtp'][_0xfae4('0x7b')];_0x37c569[_0xfae4('0x42')][_0xfae4('0x7c')]=_0x1a7800[_0xfae4('0x62')][_0xfae4('0x42')][_0xfae4('0x7c')];}else{_0x37c569['Imap'][_0xfae4('0x7d')]=_0x37c569['Smtp'][_0xfae4('0x7d')]=_0x1a7800[_0xfae4('0x62')][_0xfae4('0x7e')];_0x37c569[_0xfae4('0x40')][_0xfae4('0x76')]=_0x37c569[_0xfae4('0x42')]['user']=_0x1a7800[_0xfae4('0x62')]['cuser'];_0x37c569[_0xfae4('0x40')][_0xfae4('0x78')]=_0x37c569[_0xfae4('0x42')][_0xfae4('0x7f')]=_0x1a7800[_0xfae4('0x62')][_0xfae4('0x79')];}return db[_0xfae4('0x59')][_0xfae4('0x68')](_0x37c569,{'include':[{'model':db[_0xfae4('0x41')],'as':_0xfae4('0x42')},{'model':db['MailServerIn'],'as':_0xfae4('0x40')}]})['then'](function(_0x1ad2a3){var _0x349197=_0x1a7800[_0xfae4('0x76')][_0xfae4('0x39')]({'plain':!![]});if(!_0x349197)throw new Error(_0xfae4('0x80'));if(_0x349197[_0xfae4('0x81')]===_0xfae4('0x76')){var _0x1247b4=_0x1ad2a3[_0xfae4('0x39')]({'plain':!![]});return db[_0xfae4('0x82')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x349197['userProfileId']},'raw':!![]})[_0xfae4('0x38')](function(_0x9318ca){if(_0x9318ca&&_0x9318ca[_0xfae4('0x83')]===0x0){return db[_0xfae4('0x3a')]['create']({'name':_0x1247b4[_0xfae4('0x3d')],'resourceId':_0x1247b4['id'],'type':_0x9318ca[_0xfae4('0x3d')],'sectionId':_0x9318ca['id']},{})[_0xfae4('0x38')](function(){return _0x1ad2a3;});}else{return _0x1ad2a3;}})[_0xfae4('0x2b')](function(_0x5c5cee){logger['error'](_0xfae4('0x84'),_0x5c5cee);throw _0x5c5cee;});}return _0x1ad2a3;})[_0xfae4('0x38')](respondWithResult(_0x4cdd8d,0xc9))[_0xfae4('0x2b')](handleError(_0x4cdd8d,null));};exports[_0xfae4('0x85')]=function(_0x55f42b,_0x38ce39,_0x35be0b){return db[_0xfae4('0x59')][_0xfae4('0x69')]({'where':{'id':_0x55f42b['params']['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x38ce39,null))[_0xfae4('0x38')](function(_0x1ab313){if(_0x1ab313){return _0x1ab313[_0xfae4('0x85')]();}return null;})[_0xfae4('0x38')](respondWithResult(_0x38ce39,null))[_0xfae4('0x2b')](handleError(_0x38ce39,null));};exports[_0xfae4('0x86')]=function(_0x4ed5d9,_0x327235,_0x1b13e0){if(_0x4ed5d9[_0xfae4('0x62')]['id']){delete _0x4ed5d9[_0xfae4('0x62')]['id'];}return db[_0xfae4('0x59')][_0xfae4('0x61')]({'where':{'id':_0x4ed5d9[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x327235,null))[_0xfae4('0x38')](function(_0x2a78b1){if(_0x2a78b1){_0x4ed5d9[_0xfae4('0x62')][_0xfae4('0x66')]=_0x2a78b1['id'];return db[_0xfae4('0x3f')][_0xfae4('0x68')](_0x4ed5d9[_0xfae4('0x62')]);}})['then'](respondWithResult(_0x327235,null))[_0xfae4('0x2b')](handleError(_0x327235,null));};exports['removeImap']=function(_0x4286d2,_0x3b2a31,_0x119130){return db[_0xfae4('0x59')]['findOne']({'where':{'id':_0x4286d2[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x3b2a31,null))[_0xfae4('0x38')](function(_0x119825){if(_0x119825){return _0x119825[_0xfae4('0x87')](null);}return null;})[_0xfae4('0x38')](respondWithStatusCode(_0x3b2a31,null))[_0xfae4('0x2b')](handleError(_0x3b2a31,null));};exports[_0xfae4('0x88')]=function(_0x2a4d9c,_0x3b15d5,_0x57bfd7){return db[_0xfae4('0x59')][_0xfae4('0x69')]({'where':{'id':_0x2a4d9c[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x3b15d5,null))[_0xfae4('0x38')](function(_0x41c8fe){if(_0x41c8fe){return _0x41c8fe[_0xfae4('0x88')]();}return null;})[_0xfae4('0x38')](respondWithResult(_0x3b15d5,null))['catch'](handleError(_0x3b15d5,null));};exports[_0xfae4('0x89')]=function(_0x43e0d4,_0x591d42,_0x54614d){if(_0x43e0d4[_0xfae4('0x62')]['id']){delete _0x43e0d4[_0xfae4('0x62')]['id'];}return db[_0xfae4('0x59')][_0xfae4('0x61')]({'where':{'id':_0x43e0d4[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x591d42,null))[_0xfae4('0x38')](function(_0x6599cf){if(_0x6599cf){_0x43e0d4[_0xfae4('0x62')][_0xfae4('0x66')]=_0x6599cf['id'];return db[_0xfae4('0x41')][_0xfae4('0x68')](_0x43e0d4[_0xfae4('0x62')]);}})[_0xfae4('0x38')](respondWithResult(_0x591d42,null))[_0xfae4('0x2b')](handleError(_0x591d42,null));};exports[_0xfae4('0x8a')]=function(_0x35dd04,_0x3c92f3,_0x60aee6){return db[_0xfae4('0x59')]['findOne']({'where':{'id':_0x35dd04[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x3c92f3,null))[_0xfae4('0x38')](function(_0x2de05d){if(_0x2de05d){return _0x2de05d[_0xfae4('0x8b')](null);}return null;})[_0xfae4('0x38')](respondWithStatusCode(_0x3c92f3,null))['catch'](handleError(_0x3c92f3,null));};exports[_0xfae4('0x8c')]=function(_0x3fb01c,_0x2cbf13,_0x5654d6){return db[_0xfae4('0x8d')][_0xfae4('0x61')]({'where':{'id':_0x3fb01c['params']['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x2cbf13,null))[_0xfae4('0x38')](function(_0xe72d3a){if(_0xe72d3a){return _0xe72d3a[_0xfae4('0x8c')](_0x3fb01c['body'][_0xfae4('0x6c')],_[_0xfae4('0x8e')](_0x3fb01c['body'],[_0xfae4('0x6c'),'id'])||{});}})[_0xfae4('0x38')](respondWithResult(_0x2cbf13,null))[_0xfae4('0x2b')](handleError(_0x2cbf13,null));};exports['getInteractions']=function(_0x2ae1bc,_0x233f36,_0x114569){var _0x33e012={'raw':![],'where':{}};var _0x4b8179={};var _0x3c1d58={'count':0x0,'rows':[]};return db['MailAccount'][_0xfae4('0x69')]({'where':{'id':_0x2ae1bc[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x233f36,null))[_0xfae4('0x38')](function(_0x2742d0){if(_0x2742d0){_0x4b8179['model']=_[_0xfae4('0x5d')](db['MailInteraction'][_0xfae4('0x45')]);_0x4b8179[_0xfae4('0x4a')]=_[_0xfae4('0x5d')](_0x2ae1bc['query']);_0x4b8179[_0xfae4('0x4b')]=_[_0xfae4('0x4c')](_0x4b8179['model'],_0x4b8179[_0xfae4('0x4a')]);_0x33e012['attributes']=_[_0xfae4('0x4c')](_0x4b8179[_0xfae4('0x49')],qs[_0xfae4('0x4e')](_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x4e')]));_0x33e012['attributes']=_0x33e012['attributes'][_0xfae4('0x4f')]?_0x33e012[_0xfae4('0x4d')]:_0x4b8179['model'];if(!_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x50')](_0xfae4('0x51'))){_0x33e012[_0xfae4('0x31')]=qs[_0xfae4('0x31')](_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x31')]);_0x33e012[_0xfae4('0x33')]=qs[_0xfae4('0x33')](_0x2ae1bc['query'][_0xfae4('0x33')]);}_0x33e012['order']=qs['sort'](_0x2ae1bc[_0xfae4('0x4a')]['sort']);_0x33e012[_0xfae4('0x54')]=qs['filters'](_[_0xfae4('0x55')](_0x2ae1bc[_0xfae4('0x4a')],_0x4b8179[_0xfae4('0x4b')]));_0x33e012[_0xfae4('0x54')][_0xfae4('0x66')]=_0x2742d0['id'];if(_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x56')]){_0x33e012[_0xfae4('0x54')]=_['merge'](_0x33e012[_0xfae4('0x54')],{'$or':_['map'](_0x33e012['attributes'],function(_0x14ade8){var _0x1c2690={};_0x1c2690[_0x14ade8]={'$like':'%'+_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x56')]+'%'};return _0x1c2690;})});}_0x33e012=_[_0xfae4('0x60')]({},_0x33e012,_0x2ae1bc[_0xfae4('0x58')]);return db[_0xfae4('0x8d')]['count']({'where':_0x33e012[_0xfae4('0x54')]})[_0xfae4('0x38')](function(_0xc2489f){_0x3c1d58[_0xfae4('0x32')]=_0xc2489f;if(_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x5e')]){_0x33e012[_0xfae4('0x5f')]=[{'model':db[_0xfae4('0x8f')],'as':_0xfae4('0x90'),'required':![]},{'model':db[_0xfae4('0x91')],'as':_0xfae4('0x92'),'attributes':['name',_0xfae4('0x93'),'internal'],'required':![]},{'model':db[_0xfae4('0x94')],'as':_0xfae4('0x95'),'attributes':['id','name',_0xfae4('0x96')],'where':_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x97')]?{'id':_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x97')]}:undefined,'required':_0x2ae1bc[_0xfae4('0x4a')][_0xfae4('0x97')]?!![]:![]}];}return db['MailInteraction'][_0xfae4('0x5a')](_0x33e012);})[_0xfae4('0x38')](function(_0x44398b){_0x3c1d58[_0xfae4('0x6a')]=_0x44398b;return _0x3c1d58;});}})['then'](respondWithFilteredResult(_0x233f36,_0x33e012))[_0xfae4('0x2b')](handleError(_0x233f36,null));};exports[_0xfae4('0x98')]=function(_0x31a301,_0x3e4285,_0x16abbd){return db[_0xfae4('0x59')][_0xfae4('0x69')]({'where':{'id':_0x31a301[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x3e4285,null))[_0xfae4('0x38')](function(_0x2f0932){if(_0x2f0932){return db[_0xfae4('0x99')]['transaction'](function(_0x4b50db){return db[_0xfae4('0x9a')][_0xfae4('0x3b')]({'where':{'MailAccountId':_0x31a301[_0xfae4('0x65')]['id']},'transaction':_0x4b50db})[_0xfae4('0x38')](function(_0x414a23){var _0x5397b6=_[_0xfae4('0x44')](_0x31a301[_0xfae4('0x62')],function(_0x2d3cc1){_0x2d3cc1[_0xfae4('0x66')]=_0x31a301['params']['id'];return _0x2d3cc1;});return db['MailApplication']['bulkCreate'](_0x5397b6,{'transaction':_0x4b50db});});})[_0xfae4('0x38')](function(){return db['MailApplication'][_0xfae4('0x9b')]({'where':{'MailAccountId':_0x31a301['params']['id']},'order':_0xfae4('0x9c')});});}})[_0xfae4('0x38')](respondWithResult(_0x3e4285,null))['catch'](handleError(_0x3e4285,null));};exports[_0xfae4('0x9d')]=function(_0x2b2d79,_0x106dc4,_0x486277){var _0x1f05fb={};var _0x25ac83={};var _0x632f21;var _0x589ab5;return db[_0xfae4('0x59')][_0xfae4('0x69')]({'where':{'id':_0x2b2d79['params']['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x106dc4,null))['then'](function(_0x43b70f){if(_0x43b70f){_0x632f21=_0x43b70f;_0x25ac83[_0xfae4('0x49')]=_[_0xfae4('0x5d')](db['MailApplication']['rawAttributes']);_0x25ac83[_0xfae4('0x4a')]=_[_0xfae4('0x5d')](_0x2b2d79[_0xfae4('0x4a')]);_0x25ac83[_0xfae4('0x4b')]=_[_0xfae4('0x4c')](_0x25ac83[_0xfae4('0x49')],_0x25ac83[_0xfae4('0x4a')]);_0x1f05fb[_0xfae4('0x4d')]=_['intersection'](_0x25ac83[_0xfae4('0x49')],qs[_0xfae4('0x4e')](_0x2b2d79[_0xfae4('0x4a')][_0xfae4('0x4e')]));_0x1f05fb[_0xfae4('0x4d')]=_0x1f05fb[_0xfae4('0x4d')][_0xfae4('0x4f')]?_0x1f05fb[_0xfae4('0x4d')]:_0x25ac83[_0xfae4('0x49')];_0x1f05fb[_0xfae4('0x52')]=qs['sort'](_0x2b2d79['query'][_0xfae4('0x53')]);_0x1f05fb[_0xfae4('0x54')]=qs[_0xfae4('0x4b')](_[_0xfae4('0x55')](_0x2b2d79[_0xfae4('0x4a')],_0x25ac83[_0xfae4('0x4b')]));if(_0x2b2d79[_0xfae4('0x4a')][_0xfae4('0x56')]){_0x1f05fb[_0xfae4('0x54')]=_[_0xfae4('0x60')](_0x1f05fb['where'],{'$or':_[_0xfae4('0x44')](_0x1f05fb[_0xfae4('0x4d')],function(_0x35c13c){var _0x44bc47={};_0x44bc47[_0x35c13c]={'$like':'%'+_0x2b2d79[_0xfae4('0x4a')]['filter']+'%'};return _0x44bc47;})});}_0x1f05fb=_['merge']({},_0x1f05fb,_0x2b2d79[_0xfae4('0x58')]);return _0x632f21['getApplications'](_0x1f05fb);}})[_0xfae4('0x38')](function(_0x4a158d){if(_0x4a158d){_0x589ab5=_0x4a158d[_0xfae4('0x4f')];if(!_0x2b2d79['query'][_0xfae4('0x50')](_0xfae4('0x51'))){_0x1f05fb['limit']=qs[_0xfae4('0x31')](_0x2b2d79[_0xfae4('0x4a')][_0xfae4('0x31')]);_0x1f05fb[_0xfae4('0x33')]=qs[_0xfae4('0x33')](_0x2b2d79[_0xfae4('0x4a')][_0xfae4('0x33')]);}return _0x632f21[_0xfae4('0x9d')](_0x1f05fb);}})[_0xfae4('0x38')](function(_0xe6edca){if(_0xe6edca){return _0xe6edca?{'count':_0x589ab5,'rows':_0xe6edca}:null;}})[_0xfae4('0x38')](respondWithResult(_0x106dc4,null))[_0xfae4('0x2b')](handleError(_0x106dc4,null));};exports['getMessages']=function(_0x525d3c,_0x2f7ad1,_0x315418){var _0x1d96f4={'raw':!![],'where':{}};var _0x586e85={};var _0x416d59={'count':0x0,'rows':[]};return db[_0xfae4('0x59')][_0xfae4('0x69')]({'where':{'id':_0x525d3c['params']['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x2f7ad1,null))[_0xfae4('0x38')](function(_0xd86b9e){if(_0xd86b9e){_0x586e85[_0xfae4('0x49')]=_[_0xfae4('0x5d')](db['MailMessage'][_0xfae4('0x45')]);_0x586e85[_0xfae4('0x4a')]=_[_0xfae4('0x5d')](_0x525d3c[_0xfae4('0x4a')]);_0x586e85[_0xfae4('0x4b')]=_['intersection'](_0x586e85[_0xfae4('0x49')],_0x586e85[_0xfae4('0x4a')]);_0x1d96f4[_0xfae4('0x4d')]=_['intersection'](_0x586e85['model'],qs['fields'](_0x525d3c[_0xfae4('0x4a')][_0xfae4('0x4e')]));_0x1d96f4[_0xfae4('0x4d')]=_0x1d96f4[_0xfae4('0x4d')][_0xfae4('0x4f')]?_0x1d96f4[_0xfae4('0x4d')]:_0x586e85[_0xfae4('0x49')];if(!_0x525d3c['query']['hasOwnProperty']('nolimit')){_0x1d96f4[_0xfae4('0x31')]=qs[_0xfae4('0x31')](_0x525d3c['query'][_0xfae4('0x31')]);_0x1d96f4['offset']=qs['offset'](_0x525d3c[_0xfae4('0x4a')][_0xfae4('0x33')]);}_0x1d96f4[_0xfae4('0x52')]=qs[_0xfae4('0x53')](_0x525d3c[_0xfae4('0x4a')][_0xfae4('0x53')]);_0x1d96f4[_0xfae4('0x54')]=qs[_0xfae4('0x4b')](_[_0xfae4('0x55')](_0x525d3c[_0xfae4('0x4a')],_0x586e85[_0xfae4('0x4b')]));_0x1d96f4[_0xfae4('0x54')]['MailAccountId']=_0xd86b9e['id'];if(_0x525d3c[_0xfae4('0x4a')][_0xfae4('0x56')]){_0x1d96f4['where']=_[_0xfae4('0x60')](_0x1d96f4[_0xfae4('0x54')],{'$or':_[_0xfae4('0x44')](_0x1d96f4[_0xfae4('0x4d')],function(_0x416a1e){var _0x1c65b0={};_0x1c65b0[_0x416a1e]={'$like':'%'+_0x525d3c[_0xfae4('0x4a')][_0xfae4('0x56')]+'%'};return _0x1c65b0;})});}if(_0x525d3c[_0xfae4('0x4a')]['$gte']){var _0x19ff4d=_0x525d3c[_0xfae4('0x4a')][_0xfae4('0x9e')][_0xfae4('0x9f')](',');var _0x5f3a04={};_0x5f3a04[_0x19ff4d[0x0]]={'$gte':moment(_0x19ff4d[0x1])[_0xfae4('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d96f4[_0xfae4('0x54')]=_[_0xfae4('0x60')](_0x1d96f4[_0xfae4('0x54')],_0x5f3a04);}_0x1d96f4=_[_0xfae4('0x60')]({},_0x1d96f4,_0x525d3c['options']);return db['MailMessage'][_0xfae4('0x32')]({'where':_0x1d96f4[_0xfae4('0x54')]})[_0xfae4('0x38')](function(_0x3d7799){_0x416d59['count']=_0x3d7799;if(_0x525d3c[_0xfae4('0x4a')][_0xfae4('0x5e')]){_0x1d96f4[_0xfae4('0x5f')]=[{'all':!![]}];}return db[_0xfae4('0xa1')]['findAll'](_0x1d96f4);})['then'](function(_0x142f49){if(_0x525d3c[_0xfae4('0x4a')][_0xfae4('0xa2')]===_0xfae4('0xa3')){for(var _0x2b568f=0x0;_0x2b568f<_0x142f49[_0xfae4('0x4f')];_0x2b568f++){_0x142f49[_0x2b568f][_0xfae4('0x62')]=juice(_0x142f49[_0x2b568f][_0xfae4('0x62')]);}}_0x416d59['rows']=_0x142f49;return _0x416d59;});}})['then'](respondWithFilteredResult(_0x2f7ad1,_0x1d96f4))[_0xfae4('0x2b')](handleError(_0x2f7ad1,null));};exports['send']=function(_0x1b73d7,_0x45be09,_0x2f66f9){var _0x2f2266,_0x39fa49={},_0xeb266d;if(_0x1b73d7[_0xfae4('0x62')]['to']){_0xeb266d=_0x1b73d7[_0xfae4('0x62')]['to'][_0xfae4('0x9f')](',')[0x0];}return db[_0xfae4('0x59')][_0xfae4('0x61')]({'where':{'id':_0x1b73d7[_0xfae4('0x65')]['id']},'include':[{'model':db[_0xfae4('0xa4')],'as':_0xfae4('0xa5'),'include':[{'model':db[_0xfae4('0x8f')],'as':_0xfae4('0xa6'),'where':{'email':_0xeb266d},'limit':0x1,'order':[[_0xfae4('0xa7'),_0xfae4('0xa8')]]}]},{'model':db[_0xfae4('0x41')],'as':_0xfae4('0x42'),'raw':!![]}]})[_0xfae4('0x38')](handleEntityNotFound(_0x45be09,null))[_0xfae4('0x38')](function(_0x324884){if(_0x324884){_0x2f2266=_0x324884;if(_0x324884['Smtp']){if(_[_0xfae4('0x73')](_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xa9')])){_0x1b73d7['body'][_0xfae4('0xa9')]=util[_0xfae4('0xa0')](_0xfae4('0xaa'),_0x324884[_0xfae4('0x3d')],_0x324884[_0xfae4('0x71')]||_0x324884[_0xfae4('0x42')][_0xfae4('0x76')]);}if(_0x1b73d7[_0xfae4('0x62')]['attachments']&&_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xab')]['length']){for(var _0x4b14c8=0x0;_0x4b14c8<_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xab')]['length'];_0x4b14c8+=0x1){_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xab')][_0x4b14c8]={'filename':_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xab')][_0x4b14c8][_0xfae4('0x3d')],'path':path[_0xfae4('0xac')](config[_0xfae4('0xad')],_0xfae4('0xae'),_0x1b73d7['body'][_0xfae4('0xab')][_0x4b14c8][_0xfae4('0xaf')])};}}var _0xcb8646={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x324884[_0xfae4('0x42')]['service'])){if(_0x324884[_0xfae4('0x42')][_0xfae4('0x7a')]){_0xcb8646[_0xfae4('0xb0')]={'user':_0x324884[_0xfae4('0x42')]['user'],'pass':_0x324884[_0xfae4('0x42')]['pass']};}_0xcb8646[_0xfae4('0x7b')]=_0x324884[_0xfae4('0x42')]['host'];_0xcb8646[_0xfae4('0x7c')]=_0x324884['Smtp'][_0xfae4('0x7c')];_0xcb8646[_0xfae4('0xb1')]=_0x324884[_0xfae4('0x42')][_0xfae4('0xb1')];}else{_0xcb8646[_0xfae4('0x7d')]=_0x324884[_0xfae4('0x42')]['service'];_0xcb8646[_0xfae4('0xb0')]={'user':_0x324884[_0xfae4('0x42')][_0xfae4('0x76')],'pass':_0x324884['Smtp'][_0xfae4('0x7f')]};}return respondWithRpcPromise(_0xfae4('0xb2'),_0xfae4('0xb3'),{'account':_0xcb8646,'message':_0x1b73d7[_0xfae4('0x62')]});}else{throw new Error(_0xfae4('0xb4'));}}})[_0xfae4('0x38')](function(_0x58e7d8){if(_0x58e7d8){_0x39fa49=_0x58e7d8;if(_0x2f2266[_0xfae4('0xa5')]){if(_0x2f2266[_0xfae4('0xa5')][_0xfae4('0xa6')][_0xfae4('0x4f')]){return _0x2f2266[_0xfae4('0xa5')][_0xfae4('0xa6')][0x0];}else{return db[_0xfae4('0x8f')][_0xfae4('0x68')](_[_0xfae4('0x19')](_0x1b73d7[_0xfae4('0x62')],{'firstName':_0x1b73d7[_0xfae4('0x62')]['to'],'email':_0x1b73d7['body']['to'],'phone':_0x1b73d7[_0xfae4('0x62')]['to'],'ListId':_0x2f2266[_0xfae4('0x72')]}));}}else{throw new Error(_0xfae4('0xb4'));}}})[_0xfae4('0x38')](function(_0x411ca9){if(_0x411ca9){var _0x242c7d={'UserId':_0x1b73d7[_0xfae4('0x76')]['id'],'ContactId':_0x411ca9['id'],'MailAccountId':_0x2f2266['id'],'inReplyTo':_0x39fa49[_0xfae4('0xb5')],'to':_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xa9')],'cc':_0x1b73d7['body']['cc'],'subject':_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xb6')],'attach':_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xb7')],'firstMsgDirection':_0xfae4('0xb8'),'lastMsgAt':moment()[_0xfae4('0xa0')](_0xfae4('0xb9')),'lastMsgDirection':_0xfae4('0xb8'),'Messages':[_[_0xfae4('0x60')](_0x1b73d7[_0xfae4('0x62')],{'messageId':_0x39fa49[_0xfae4('0xb5')],'sentAt':moment()[_0xfae4('0xa0')](_0xfae4('0xb9')),'read':!![],'MailAccountId':_0x2f2266['id'],'UserId':_0x1b73d7[_0xfae4('0x76')]['id'],'ContactId':_0x411ca9['id']})]};if(_0x1b73d7[_0xfae4('0x62')]['Interaction']){_0x242c7d=_[_0xfae4('0x60')](_0x242c7d,_0x1b73d7[_0xfae4('0x62')][_0xfae4('0xba')]);}return db['MailInteraction'][_0xfae4('0x68')](_0x242c7d,{'include':[{'model':db[_0xfae4('0xa1')],'as':'Messages'}]});}})[_0xfae4('0x38')](respondWithResult(_0x45be09,null))[_0xfae4('0x2b')](handleError(_0x45be09,null));};exports['verifySmtp']=function(_0x3d5165,_0x1b30c8,_0x1f4164){return db[_0xfae4('0x59')][_0xfae4('0x61')]({'where':{'id':_0x3d5165['params']['id']},'include':[{'model':db[_0xfae4('0x41')],'as':'Smtp','raw':!![]}]})[_0xfae4('0x38')](handleEntityNotFound(_0x1b30c8,null))[_0xfae4('0x38')](function(_0x3610f6){if(_0x3610f6&&_0x3610f6[_0xfae4('0x42')]){var _0x5a0071={'id':_0x3610f6['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3610f6[_0xfae4('0x42')][_0xfae4('0x7d')]){_0x5a0071[_0xfae4('0x7d')]=_0x3610f6['Smtp'][_0xfae4('0x7d')];}else{_0x5a0071['host']=_0x3610f6[_0xfae4('0x42')][_0xfae4('0x7b')];_0x5a0071[_0xfae4('0x7c')]=_0x3610f6[_0xfae4('0x42')][_0xfae4('0x7c')];_0x5a0071[_0xfae4('0xb1')]=_0x3610f6['Smtp'][_0xfae4('0xb1')];}if(_0x3610f6['Smtp']['authentication']){_0x5a0071['auth']={'user':_0x3610f6[_0xfae4('0x42')]['user'],'pass':_0x3610f6['Smtp']['pass']};}return respondWithRpcPromise('VerifySmtp',_0xfae4('0xbb'),{'account':_0x5a0071});}})[_0xfae4('0x38')](respondWithResult(_0x1b30c8,null))['catch'](handleError(_0x1b30c8,null));};exports[_0xfae4('0x3b')]=function(_0x23300f,_0x3deefe){return db[_0xfae4('0x59')]['find']({'where':{'id':_0x23300f[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x3deefe,null))[_0xfae4('0x38')](function(_0x1c9cd2){if(_0x1c9cd2&&_0x1c9cd2[_0xfae4('0x7d')]){throw new db[(_0xfae4('0xbc'))]['ValidationError'](_0xfae4('0xbd'));}return _0x1c9cd2;})[_0xfae4('0x38')](removeEntity(_0x3deefe,null))[_0xfae4('0x2b')](handleError(_0x3deefe,null));};exports[_0xfae4('0xbe')]=function(_0x197aaa,_0x5ec9ad,_0x53b63d){return db['MailAccount'][_0xfae4('0x61')]({'where':{'id':_0x197aaa[_0xfae4('0x65')]['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x5ec9ad,null))[_0xfae4('0x38')](function(_0x2e46d7){if(_0x2e46d7){return _0x2e46d7[_0xfae4('0xbe')](_0x197aaa[_0xfae4('0x62')]['ids'],_['omit'](_0x197aaa['body'],[_0xfae4('0x6c'),'id'])||{})['spread'](function(_0x105fd8){for(var _0x2b259a=0x0;_0x2b259a<_0x197aaa['body'][_0xfae4('0x6c')][_0xfae4('0x4f')];_0x2b259a+=0x1){socket[_0xfae4('0xbf')](_0xfae4('0xc0'),{'UserId':Number(_0x197aaa[_0xfae4('0x62')][_0xfae4('0x6c')][_0x2b259a]),'MailAccountId':Number(_0x197aaa['params']['id'])});}return _0x105fd8;});}})[_0xfae4('0x38')](respondWithResult(_0x5ec9ad,null))['catch'](handleError(_0x5ec9ad,null));};exports[_0xfae4('0xc1')]=function(_0x1386b0,_0x28e494,_0x1c1b12){return db[_0xfae4('0x59')][_0xfae4('0x61')]({'where':{'id':_0x1386b0['params']['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x28e494,null))[_0xfae4('0x38')](function(_0x4f9169){if(_0x4f9169){return _0x4f9169[_0xfae4('0xc1')](_0x1386b0[_0xfae4('0x4a')][_0xfae4('0x6c')])['then'](function(){if(_[_0xfae4('0xc2')](_0x1386b0[_0xfae4('0x4a')]['ids'])){for(var _0x26846f=0x0;_0x26846f<_0x1386b0[_0xfae4('0x4a')]['ids'][_0xfae4('0x4f')];_0x26846f+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x1386b0[_0xfae4('0x4a')][_0xfae4('0x6c')][_0x26846f]),'MailAccountId':Number(_0x1386b0[_0xfae4('0x65')]['id'])});}}else{socket[_0xfae4('0xbf')](_0xfae4('0xc3'),{'UserId':Number(_0x1386b0[_0xfae4('0x4a')]['ids']),'MailAccountId':Number(_0x1386b0['params']['id'])});}});}})[_0xfae4('0x38')](respondWithStatusCode(_0x28e494,null))['catch'](handleError(_0x28e494,null));};exports['getAgents']=function(_0x5476f5,_0x807ad7,_0x3b2ca7){var _0x4e3bb5={};var _0x50a3ae={};var _0x1a02d0;var _0x41f975;return db[_0xfae4('0x59')][_0xfae4('0x69')]({'where':{'id':_0x5476f5['params']['id']}})[_0xfae4('0x38')](handleEntityNotFound(_0x807ad7,null))[_0xfae4('0x38')](function(_0x183ca0){if(_0x183ca0){_0x1a02d0=_0x183ca0;_0x50a3ae[_0xfae4('0x49')]=_[_0xfae4('0x5d')](db['User'][_0xfae4('0x45')]);_0x50a3ae['query']=_[_0xfae4('0x5d')](_0x5476f5['query']);_0x50a3ae[_0xfae4('0x4b')]=_[_0xfae4('0x4c')](_0x50a3ae[_0xfae4('0x49')],_0x50a3ae['query']);_0x4e3bb5['attributes']=_['intersection'](_0x50a3ae[_0xfae4('0x49')],qs['fields'](_0x5476f5[_0xfae4('0x4a')][_0xfae4('0x4e')]));_0x4e3bb5[_0xfae4('0x4d')]=_0x4e3bb5[_0xfae4('0x4d')]['length']?_0x4e3bb5['attributes']:_0x50a3ae[_0xfae4('0x49')];_0x4e3bb5[_0xfae4('0x52')]=qs['sort'](_0x5476f5[_0xfae4('0x4a')]['sort']);_0x4e3bb5[_0xfae4('0x54')]=qs['filters'](_[_0xfae4('0x55')](_0x5476f5[_0xfae4('0x4a')],_0x50a3ae[_0xfae4('0x4b')]));if(_0x5476f5[_0xfae4('0x4a')][_0xfae4('0x56')]){_0x4e3bb5[_0xfae4('0x54')]=_[_0xfae4('0x60')](_0x4e3bb5[_0xfae4('0x54')],{'$or':_[_0xfae4('0x44')](_0x4e3bb5[_0xfae4('0x4d')],function(_0x2e495a){var _0x297311={};_0x297311[_0x2e495a]={'$like':'%'+_0x5476f5[_0xfae4('0x4a')]['filter']+'%'};return _0x297311;})});}_0x4e3bb5=_[_0xfae4('0x60')]({},_0x4e3bb5,_0x5476f5['options']);return _0x1a02d0['getAgents'](_0x4e3bb5);}})['then'](function(_0x59ac05){if(_0x59ac05){_0x41f975=_0x59ac05[_0xfae4('0x4f')];if(!_0x5476f5[_0xfae4('0x4a')][_0xfae4('0x50')](_0xfae4('0x51'))){_0x4e3bb5[_0xfae4('0x31')]=qs[_0xfae4('0x31')](_0x5476f5['query']['limit']);_0x4e3bb5['offset']=qs[_0xfae4('0x33')](_0x5476f5['query']['offset']);}return _0x1a02d0[_0xfae4('0xc4')](_0x4e3bb5);}})[_0xfae4('0x38')](function(_0x18b001){if(_0x18b001){return _0x18b001?{'count':_0x41f975,'rows':_0x18b001}:null;}})[_0xfae4('0x38')](respondWithResult(_0x807ad7,null))[_0xfae4('0x2b')](handleError(_0x807ad7,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index eeb2388..1d1ed70 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 _0xc4a6=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','remove','emit','hook'];(function(_0x474c8c,_0x8648f7){var _0x52c4a5=function(_0x41f1bb){while(--_0x41f1bb){_0x474c8c['push'](_0x474c8c['shift']());}};_0x52c4a5(++_0x8648f7);}(_0xc4a6,0x106));var _0x6c4a=function(_0x3a08e3,_0x6812cb){_0x3a08e3=_0x3a08e3-0x0;var _0xb2d69e=_0xc4a6[_0x3a08e3];return _0xb2d69e;};'use strict';var EventEmitter=require(_0x6c4a('0x0'));var MailAccount=require(_0x6c4a('0x1'))['db'][_0x6c4a('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6c4a('0x3')](0x0);var events={'afterCreate':_0x6c4a('0x4'),'afterUpdate':'update','afterDestroy':_0x6c4a('0x5')};function emitEvent(_0x36ccd2){return function(_0x12f185,_0x7e185d,_0x223522){MailAccountEvents[_0x6c4a('0x6')](_0x36ccd2+':'+_0x12f185['id'],_0x12f185);MailAccountEvents[_0x6c4a('0x6')](_0x36ccd2,_0x12f185);_0x223522(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x6c4a('0x7')](e,emitEvent(event));}}module[_0x6c4a('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x1485=['../../mysqldb','MailAccount','setMaxListeners','update','hasOwnProperty','hook','exports'];(function(_0x2e7a86,_0x2cbf55){var _0x26c7b2=function(_0x1860ab){while(--_0x1860ab){_0x2e7a86['push'](_0x2e7a86['shift']());}};_0x26c7b2(++_0x2cbf55);}(_0x1485,0x77));var _0x5148=function(_0x3f131b,_0x2507a7){_0x3f131b=_0x3f131b-0x0;var _0x6db5df=_0x1485[_0x3f131b];return _0x6db5df;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x5148('0x0'))['db'][_0x5148('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5148('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5148('0x3'),'afterDestroy':'remove'};function emitEvent(_0x32d1f4){return function(_0x314828,_0x2ccc77,_0x4c539b){MailAccountEvents['emit'](_0x32d1f4+':'+_0x314828['id'],_0x314828);MailAccountEvents['emit'](_0x32d1f4,_0x314828);_0x4c539b(null);};}for(var e in events){if(events[_0x5148('0x4')](e)){var event=events[e];MailAccount[_0x5148('0x5')](e,emitEvent(event));}}module[_0x5148('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2bdbc70..d8abbbc 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 _0x342d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger'];(function(_0x31522a,_0x581ba3){var _0x88419c=function(_0x5192a9){while(--_0x5192a9){_0x31522a['push'](_0x31522a['shift']());}};_0x88419c(++_0x581ba3);}(_0x342d,0x80));var _0xd342=function(_0xd247cd,_0x43edb0){_0xd247cd=_0xd247cd-0x0;var _0x386a29=_0x342d[_0xd247cd];return _0x386a29;};'use strict';var _=require(_0xd342('0x0'));var util=require('util');var logger=require(_0xd342('0x1'))(_0xd342('0x2'));var moment=require(_0xd342('0x3'));var BPromise=require(_0xd342('0x4'));var rp=require(_0xd342('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd342('0x6'));var config=require(_0xd342('0x7'));var attributes=require(_0xd342('0x8'));module[_0xd342('0x9')]=function(_0x1e9f7a,_0x383531){return _0x1e9f7a[_0xd342('0xa')](_0xd342('0xb'),attributes,{'tableName':_0xd342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x317e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','lodash'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x317e,0xdb));var _0xe317=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x317e[_0xd7b0a4];return _0x184e9e;};'use strict';var _=require(_0xe317('0x0'));var util=require(_0xe317('0x1'));var logger=require(_0xe317('0x2'))(_0xe317('0x3'));var moment=require(_0xe317('0x4'));var BPromise=require(_0xe317('0x5'));var rp=require(_0xe317('0x6'));var fs=require('fs');var path=require(_0xe317('0x7'));var rimraf=require(_0xe317('0x8'));var config=require(_0xe317('0x9'));var attributes=require('./mailAccount.attributes');module[_0xe317('0xa')]=function(_0x2fba0b,_0x56df5){return _0x2fba0b['define']('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 69b366f..c2b9081 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 _0x71d8=['asc','autoclose','length','close','*,*,*,*','Contacts','ListId','create','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','update','YYYY-MM-DD\x20HH:mm:ss','interaction','get','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','GetMailAccount','options','raw','where','attributes','limit','include','map','model','then','debug','catch','ShowMailAccount','MailAccount','find','NotifyMailAccount','body','mail','difference','rawAttributes','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmContact','DESC','MailApplication','Applications','Smtp','List','omit','list','applications','priority'];(function(_0x5a27fe,_0x43993b){var _0x121c88=function(_0x2aff1f){while(--_0x2aff1f){_0x5a27fe['push'](_0x5a27fe['shift']());}};_0x121c88(++_0x43993b);}(_0x71d8,0x89));var _0x871d=function(_0x1ff472,_0x39b971){_0x1ff472=_0x1ff472-0x0;var _0xb31a77=_0x71d8[_0x1ff472];return _0xb31a77;};'use strict';var _=require(_0x871d('0x0'));var util=require(_0x871d('0x1'));var moment=require(_0x871d('0x2'));var BPromise=require(_0x871d('0x3'));var rs=require(_0x871d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x871d('0x5'))['db'];var utils=require(_0x871d('0x6'));var logger=require(_0x871d('0x7'))(_0x871d('0x8'));var config=require(_0x871d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x871d('0xa')][_0x871d('0xb')]({'port':0x232c});config['redis']=_['defaults'](config[_0x871d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x871d('0xd'))(new Redis(config[_0x871d('0xc')]));require(_0x871d('0xe'))['register'](socket);function respondWithRpcPromise(_0x1e1c0c,_0x4e9258,_0x48b0f3){return new BPromise(function(_0x20dbee,_0x1ea28e){return client[_0x871d('0xf')](_0x1e1c0c,_0x48b0f3)['then'](function(_0x3f78c9){logger[_0x871d('0x10')](_0x871d('0x11'),_0x4e9258,'request\x20sent');logger['debug'](_0x871d('0x12'),_0x4e9258,'request\x20sent',JSON[_0x871d('0x13')](_0x3f78c9));if(_0x3f78c9[_0x871d('0x14')]){if(_0x3f78c9[_0x871d('0x14')][_0x871d('0x15')]===0x1f4){logger[_0x871d('0x14')](_0x871d('0x11'),_0x4e9258,_0x3f78c9[_0x871d('0x14')][_0x871d('0x16')]);return _0x1ea28e(_0x3f78c9[_0x871d('0x14')][_0x871d('0x16')]);}logger[_0x871d('0x14')](_0x871d('0x11'),_0x4e9258,_0x3f78c9[_0x871d('0x14')]['message']);return _0x20dbee(_0x3f78c9['error'][_0x871d('0x16')]);}else{logger[_0x871d('0x10')](_0x871d('0x11'),_0x4e9258,_0x871d('0x17'));_0x20dbee(_0x3f78c9['result'][_0x871d('0x16')]);}})['catch'](function(_0x50b50d){logger[_0x871d('0x14')]('MailAccount,\x20%s,\x20%s',_0x4e9258,_0x50b50d);_0x1ea28e(_0x50b50d);});});}exports[_0x871d('0x18')]=function(_0x57b0a3){var _0x67973=this;return new Promise(function(_0x13de5a,_0x50e58d){return db['MailAccount']['findAll']({'raw':_0x57b0a3[_0x871d('0x19')]?_0x57b0a3[_0x871d('0x19')][_0x871d('0x1a')]===undefined?!![]:![]:!![],'where':_0x57b0a3[_0x871d('0x19')]?_0x57b0a3['options'][_0x871d('0x1b')]||null:null,'attributes':_0x57b0a3[_0x871d('0x19')]?_0x57b0a3[_0x871d('0x19')][_0x871d('0x1c')]||null:null,'limit':_0x57b0a3[_0x871d('0x19')]?_0x57b0a3[_0x871d('0x19')][_0x871d('0x1d')]||null:null,'include':_0x57b0a3[_0x871d('0x19')]?_0x57b0a3['options'][_0x871d('0x1e')]?_[_0x871d('0x1f')](_0x57b0a3[_0x871d('0x19')]['include'],function(_0x239a44){return{'model':db[_0x239a44[_0x871d('0x20')]],'as':_0x239a44['as'],'attributes':_0x239a44[_0x871d('0x1c')],'include':_0x239a44['include']?_[_0x871d('0x1f')](_0x239a44['include'],function(_0x46ef3){return{'model':db[_0x46ef3['model']],'as':_0x46ef3['as'],'attributes':_0x46ef3['attributes'],'include':_0x46ef3[_0x871d('0x1e')]?_['map'](_0x46ef3[_0x871d('0x1e')],function(_0x47ab30){return{'model':db[_0x47ab30[_0x871d('0x20')]],'as':_0x47ab30['as'],'attributes':_0x47ab30[_0x871d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x871d('0x21')](function(_0xd0e6da){logger[_0x871d('0x10')](_0x871d('0x18'),_0x57b0a3);logger[_0x871d('0x22')]('GetMailAccount',_0x57b0a3,JSON[_0x871d('0x13')](_0xd0e6da));_0x13de5a(_0xd0e6da);})[_0x871d('0x23')](function(_0x1f53c8){logger[_0x871d('0x14')](_0x871d('0x18'),_0x1f53c8[_0x871d('0x16')],_0x57b0a3);_0x50e58d(_0x67973['error'](0x1f4,_0x1f53c8[_0x871d('0x16')]));});});};exports[_0x871d('0x24')]=function(_0x754169){var _0x182485=this;return new Promise(function(_0x5dc6fe,_0xab3987){return db[_0x871d('0x25')][_0x871d('0x26')]({'raw':_0x754169[_0x871d('0x19')]?_0x754169[_0x871d('0x19')][_0x871d('0x1a')]===undefined?!![]:![]:!![],'where':_0x754169[_0x871d('0x19')]?_0x754169[_0x871d('0x19')]['where']||null:null,'attributes':_0x754169[_0x871d('0x19')]?_0x754169[_0x871d('0x19')][_0x871d('0x1c')]||null:null,'include':_0x754169[_0x871d('0x19')]?_0x754169[_0x871d('0x19')][_0x871d('0x1e')]?_[_0x871d('0x1f')](_0x754169['options'][_0x871d('0x1e')],function(_0x23fa8c){return{'model':db[_0x23fa8c[_0x871d('0x20')]],'as':_0x23fa8c['as'],'attributes':_0x23fa8c[_0x871d('0x1c')],'include':_0x23fa8c['include']?_[_0x871d('0x1f')](_0x23fa8c[_0x871d('0x1e')],function(_0x10093a){return{'model':db[_0x10093a['model']],'as':_0x10093a['as'],'attributes':_0x10093a[_0x871d('0x1c')],'include':_0x10093a[_0x871d('0x1e')]?_[_0x871d('0x1f')](_0x10093a[_0x871d('0x1e')],function(_0x128b1c){return{'model':db[_0x128b1c['model']],'as':_0x128b1c['as'],'attributes':_0x128b1c['attributes']};}):[]};}):[]};}):[]:[]})[_0x871d('0x21')](function(_0x11f6c9){logger[_0x871d('0x10')](_0x871d('0x24'),_0x754169);logger[_0x871d('0x22')](_0x871d('0x24'),_0x754169,JSON[_0x871d('0x13')](_0x11f6c9));_0x5dc6fe(_0x11f6c9);})[_0x871d('0x23')](function(_0x475fc0){logger[_0x871d('0x14')](_0x871d('0x24'),_0x475fc0[_0x871d('0x16')],_0x754169);_0xab3987(_0x182485[_0x871d('0x14')](0x1f4,_0x475fc0['message']));});});};exports[_0x871d('0x27')]=function(_0x1987f3){var _0x496ece=this;return new Promise(function(_0x756187,_0x12ff31){var _0x572134={'body':_0x1987f3[_0x871d('0x28')],'channel':_0x871d('0x29')};var _0x219483=_[_0x871d('0x2a')](_['keys'](db['CmContact'][_0x871d('0x2b')]),['createdAt',_0x871d('0x2c'),_0x871d('0x2d'),'ListId']);var _0x3aacd7=![];if(_0x1987f3['body']['id']){delete _0x1987f3[_0x871d('0x28')]['id'];}if(_[_0x871d('0x2e')](_0x1987f3[_0x871d('0x28')][_0x871d('0x2f')])){return _0x12ff31(_0x496ece['error'](0x1f4,_0x871d('0x30')));}if(_[_0x871d('0x2e')](_0x1987f3[_0x871d('0x28')]['body'])||_0x1987f3[_0x871d('0x28')][_0x871d('0x28')]===''){return _0x12ff31(_0x496ece['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x871d('0x2e')](_0x1987f3[_0x871d('0x28')]['mapKey'])){return _0x12ff31(_0x496ece['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x219483));}if(!_[_0x871d('0x31')](_0x219483,_0x1987f3[_0x871d('0x28')][_0x871d('0x32')])){return _0x12ff31(_0x496ece[_0x871d('0x14')](0x1f4,_0x871d('0x33')+_0x219483));}var _0x35bbfa={};_0x35bbfa[_0x1987f3[_0x871d('0x28')]['mapKey']]=_0x1987f3['body'][_0x871d('0x2f')];return db[_0x871d('0x25')][_0x871d('0x26')]({'where':{'id':_0x1987f3[_0x871d('0x34')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x871d('0x35')],'as':'Contacts','where':_0x35bbfa,'limit':0x1,'order':[[_0x871d('0x2c'),_0x871d('0x36')]]}]},{'model':db[_0x871d('0x37')],'as':_0x871d('0x38')},{'model':db['MailServerOut'],'as':_0x871d('0x39')}]})[_0x871d('0x21')](function(_0x7889d4){if(_0x7889d4&&_0x7889d4[_0x871d('0x3a')]){var _0x12a07e=_0x7889d4['get']({'plain':!![]});_0x572134[_0x871d('0x34')]=_[_0x871d('0x3b')](_0x12a07e,[_0x871d('0x38'),_0x871d('0x3a')]);_0x572134['applications']=_0x12a07e[_0x871d('0x38')];_0x572134[_0x871d('0x3c')]=_0x12a07e[_0x871d('0x3a')];_0x572134['applications']=_['orderBy'](_0x572134[_0x871d('0x3d')],[_0x871d('0x3e')],[_0x871d('0x3f')]);if(_0x572134['account']&&_0x572134[_0x871d('0x34')][_0x871d('0x40')]){_0x572134['applications']['push']({'id':0x0,'priority':_0x572134['applications'][_0x871d('0x41')]+0x1,'app':_0x871d('0x42'),'appdata':'autoclose','interval':_0x871d('0x43')});}if(_0x572134[_0x871d('0x34')][_0x871d('0x38')]){delete _0x572134[_0x871d('0x34')][_0x871d('0x38')];}if(_0x572134[_0x871d('0x34')][_0x871d('0x3a')]){delete _0x572134[_0x871d('0x34')]['List'];}if(_0x12a07e[_0x871d('0x3a')][_0x871d('0x44')][_0x871d('0x41')]){return _0x12a07e[_0x871d('0x3a')][_0x871d('0x44')][0x0];}var _0x26c108=_['defaults'](_0x1987f3[_0x871d('0x28')],{'firstName':_0x1987f3[_0x871d('0x28')][_0x871d('0x2f')],'ListId':_0x12a07e[_0x871d('0x45')]});_0x26c108[_0x1987f3[_0x871d('0x28')][_0x871d('0x32')]]=_0x1987f3[_0x871d('0x28')]['from'];return db['CmContact'][_0x871d('0x46')](_0x26c108);}else{throw new Error('List\x20not\x20found');}})[_0x871d('0x21')](function(_0x4896b9){_0x572134[_0x871d('0x47')]=_0x4896b9;if(_0x4896b9){if(!_0x1987f3[_0x871d('0x28')]['message']['messageId']){_0x1987f3[_0x871d('0x28')][_0x871d('0x16')][_0x871d('0x48')]=rs[_0x871d('0x49')]()+'\x20'+_0x1987f3[_0x871d('0x28')][_0x871d('0x16')][_0x871d('0x2f')];}var _0x3c2c22={'ContactId':_0x4896b9['id'],'MailAccountId':_0x1987f3[_0x871d('0x34')]['id'],'inReplyTo':_0x1987f3[_0x871d('0x28')]['message'][_0x871d('0x48')],'to':_0x1987f3['body'][_0x871d('0x16')][_0x871d('0x2f')],'cc':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')]['cc'],'subject':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')][_0x871d('0x4a')],'attach':_0x1987f3['body'][_0x871d('0x16')][_0x871d('0x4b')],'lastMsgAt':moment()[_0x871d('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x871d('0x4d')][_0x871d('0x26')]({'where':{'closed':![],'MailAccountId':_0x1987f3['account']['id']},'include':[{'model':db[_0x871d('0x4e')],'as':'Messages','attributes':[_0x871d('0x48')],'where':{'messageId':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')][_0x871d('0x4f')]}}]})[_0x871d('0x21')](function(_0x1b5347){if(_0x1b5347){return[_0x1b5347,![]];}return db['MailInteraction'][_0x871d('0x46')](_0x3c2c22)['then'](function(_0x3202de){return[_0x3202de,!![]];});});}else{throw new Error(_0x871d('0x50'));}})['spread'](function(_0xb07dc5,_0x4e1697){if(_0xb07dc5){_0x3aacd7=_0x4e1697;if(!_0x4e1697){return _0xb07dc5[_0x871d('0x51')]({'inReplyTo':_0x1987f3[_0x871d('0x28')]['message'][_0x871d('0x48')],'to':_0x1987f3[_0x871d('0x28')]['message']['from'],'cc':_0x1987f3['body'][_0x871d('0x16')]['cc'],'subject':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')][_0x871d('0x4a')],'attach':_0xb07dc5['attach']?_0xb07dc5[_0x871d('0x4b')]:_0x1987f3[_0x871d('0x28')][_0x871d('0x16')]['attach'],'substatus':null,'substatusAt':moment()[_0x871d('0x4c')](_0x871d('0x52')),'lastMsgAt':moment()[_0x871d('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0xb07dc5;}}})[_0x871d('0x21')](function(_0x148a91){_0x572134[_0x871d('0x53')]=_0x148a91[_0x871d('0x54')]({'plain':!![]});_0x572134[_0x871d('0x53')]['created']=_0x3aacd7;return db['MailMessage'][_0x871d('0x46')]({'body':_0x1987f3[_0x871d('0x28')][_0x871d('0x28')],'MailAccountId':_0x1987f3[_0x871d('0x34')]['id'],'MailInteractionId':_0x148a91['id'],'direction':'in','ContactId':_0x572134['contact']['id'],'messageId':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')]['messageId'],'from':_0x1987f3['body'][_0x871d('0x16')][_0x871d('0x2f')],'to':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')]['to'],'cc':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')]['cc'],'subject':_0x1987f3[_0x871d('0x28')]['message'][_0x871d('0x4a')],'attach':_0x1987f3['body']['message'][_0x871d('0x4b')],'Attachments':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')]['attachments'],'originTo':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')]['originTo'],'originCc':_0x1987f3[_0x871d('0x28')]['message'][_0x871d('0x55')],'bcc':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')][_0x871d('0x56')],'ChatWebsiteId':_0x1987f3['body'][_0x871d('0x16')][_0x871d('0x57')]||null,'originChannel':_0x1987f3['body'][_0x871d('0x16')][_0x871d('0x58')]||_0x871d('0x59'),'ChatOfflineMessageId':_0x1987f3[_0x871d('0x28')][_0x871d('0x16')][_0x871d('0x5a')]||null},{'include':[{'model':db[_0x871d('0x5b')],'as':_0x871d('0x5c')}]});})[_0x871d('0x21')](function(_0x431dc5){_0x572134[_0x871d('0x16')]=_0x431dc5;if(_0x572134[_0x871d('0x53')]['UserId']){return db[_0x871d('0x5d')][_0x871d('0x26')]({'attributes':['id',_0x871d('0x5e')],'where':{'id':_0x572134[_0x871d('0x53')][_0x871d('0x5f')]}})[_0x871d('0x21')](function(_0x1ff299){if(_0x1ff299){_0x572134[_0x871d('0x3d')][_0x871d('0x60')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1ff299[_0x871d('0x5e')]+','+(_0x572134[_0x871d('0x34')][_0x871d('0x61')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x871d('0x62'),_0x871d('0x63'),_0x572134);});}return respondWithRpcPromise('Start','startRouting',_0x572134);})[_0x871d('0x21')](function(_0x491292){_0x756187(_0x491292);})[_0x871d('0x23')](function(_0x8205eb){_0x12ff31(_0x496ece[_0x871d('0x14')](0x1f4,_0x8205eb[_0x871d('0x16')]));});});}; \ No newline at end of file +var _0x5706=['contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','create','Contact\x20not\x20found','spread','update','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','UserId','User','name','unshift','agent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailAccount','options','raw','where','limit','include','map','model','attributes','info','catch','GetMailAccount','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','omit','List','applications','orderBy','priority','autoclose','push','length','close','*,*,*,*','List\x20not\x20found'];(function(_0xefd283,_0x4abd97){var _0x26b138=function(_0x2b20fd){while(--_0x2b20fd){_0xefd283['push'](_0xefd283['shift']());}};_0x26b138(++_0x4abd97);}(_0x5706,0x1c1));var _0x6570=function(_0x44e191,_0x279a3a){_0x44e191=_0x44e191-0x0;var _0x189d9d=_0x5706[_0x44e191];return _0x189d9d;};'use strict';var _=require(_0x6570('0x0'));var util=require(_0x6570('0x1'));var moment=require(_0x6570('0x2'));var BPromise=require(_0x6570('0x3'));var rs=require(_0x6570('0x4'));var fs=require('fs');var Redis=require(_0x6570('0x5'));var db=require(_0x6570('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6570('0x7'))(_0x6570('0x8'));var config=require('../../config/environment');var jayson=require(_0x6570('0x9'));var client=jayson[_0x6570('0xa')][_0x6570('0xb')]({'port':0x232c});config[_0x6570('0xc')]=_[_0x6570('0xd')](config[_0x6570('0xc')],{'host':_0x6570('0xe'),'port':0x18eb});var socket=require(_0x6570('0xf'))(new Redis(config[_0x6570('0xc')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2b197a,_0x432ec1,_0x5d61d7){return new BPromise(function(_0x4afe4c,_0x49eebc){return client[_0x6570('0x10')](_0x2b197a,_0x5d61d7)[_0x6570('0x11')](function(_0x5eb6cb){logger['info'](_0x6570('0x12'),_0x432ec1,_0x6570('0x13'));logger[_0x6570('0x14')](_0x6570('0x15'),_0x432ec1,_0x6570('0x13'),JSON[_0x6570('0x16')](_0x5eb6cb));if(_0x5eb6cb[_0x6570('0x17')]){if(_0x5eb6cb[_0x6570('0x17')][_0x6570('0x18')]===0x1f4){logger[_0x6570('0x17')](_0x6570('0x12'),_0x432ec1,_0x5eb6cb['error'][_0x6570('0x19')]);return _0x49eebc(_0x5eb6cb[_0x6570('0x17')]['message']);}logger[_0x6570('0x17')](_0x6570('0x12'),_0x432ec1,_0x5eb6cb[_0x6570('0x17')][_0x6570('0x19')]);return _0x4afe4c(_0x5eb6cb[_0x6570('0x17')][_0x6570('0x19')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x432ec1,_0x6570('0x13'));_0x4afe4c(_0x5eb6cb['result']['message']);}})['catch'](function(_0x3b9484){logger[_0x6570('0x17')](_0x6570('0x12'),_0x432ec1,_0x3b9484);_0x49eebc(_0x3b9484);});});}exports['GetMailAccount']=function(_0x39cc64){var _0x3fdc5c=this;return new Promise(function(_0x52d156,_0x570b2a){return db[_0x6570('0x1a')]['findAll']({'raw':_0x39cc64[_0x6570('0x1b')]?_0x39cc64[_0x6570('0x1b')][_0x6570('0x1c')]===undefined?!![]:![]:!![],'where':_0x39cc64[_0x6570('0x1b')]?_0x39cc64[_0x6570('0x1b')][_0x6570('0x1d')]||null:null,'attributes':_0x39cc64['options']?_0x39cc64[_0x6570('0x1b')]['attributes']||null:null,'limit':_0x39cc64[_0x6570('0x1b')]?_0x39cc64['options'][_0x6570('0x1e')]||null:null,'include':_0x39cc64['options']?_0x39cc64['options'][_0x6570('0x1f')]?_[_0x6570('0x20')](_0x39cc64['options'][_0x6570('0x1f')],function(_0x5b2c61){return{'model':db[_0x5b2c61[_0x6570('0x21')]],'as':_0x5b2c61['as'],'attributes':_0x5b2c61[_0x6570('0x22')],'include':_0x5b2c61[_0x6570('0x1f')]?_[_0x6570('0x20')](_0x5b2c61[_0x6570('0x1f')],function(_0x4f8f7c){return{'model':db[_0x4f8f7c[_0x6570('0x21')]],'as':_0x4f8f7c['as'],'attributes':_0x4f8f7c[_0x6570('0x22')],'include':_0x4f8f7c[_0x6570('0x1f')]?_[_0x6570('0x20')](_0x4f8f7c[_0x6570('0x1f')],function(_0x323972){return{'model':db[_0x323972[_0x6570('0x21')]],'as':_0x323972['as'],'attributes':_0x323972['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40b0db){logger[_0x6570('0x23')]('GetMailAccount',_0x39cc64);logger[_0x6570('0x14')]('GetMailAccount',_0x39cc64,JSON[_0x6570('0x16')](_0x40b0db));_0x52d156(_0x40b0db);})[_0x6570('0x24')](function(_0x3c8a0a){logger[_0x6570('0x17')](_0x6570('0x25'),_0x3c8a0a[_0x6570('0x19')],_0x39cc64);_0x570b2a(_0x3fdc5c[_0x6570('0x17')](0x1f4,_0x3c8a0a[_0x6570('0x19')]));});});};exports[_0x6570('0x26')]=function(_0x45d651){var _0x30ce40=this;return new Promise(function(_0x1a3ba8,_0x163c76){return db[_0x6570('0x1a')][_0x6570('0x27')]({'raw':_0x45d651['options']?_0x45d651[_0x6570('0x1b')][_0x6570('0x1c')]===undefined?!![]:![]:!![],'where':_0x45d651[_0x6570('0x1b')]?_0x45d651[_0x6570('0x1b')][_0x6570('0x1d')]||null:null,'attributes':_0x45d651[_0x6570('0x1b')]?_0x45d651[_0x6570('0x1b')][_0x6570('0x22')]||null:null,'include':_0x45d651[_0x6570('0x1b')]?_0x45d651['options'][_0x6570('0x1f')]?_['map'](_0x45d651[_0x6570('0x1b')][_0x6570('0x1f')],function(_0x1c11f3){return{'model':db[_0x1c11f3[_0x6570('0x21')]],'as':_0x1c11f3['as'],'attributes':_0x1c11f3['attributes'],'include':_0x1c11f3[_0x6570('0x1f')]?_['map'](_0x1c11f3[_0x6570('0x1f')],function(_0x9cbfe9){return{'model':db[_0x9cbfe9['model']],'as':_0x9cbfe9['as'],'attributes':_0x9cbfe9['attributes'],'include':_0x9cbfe9[_0x6570('0x1f')]?_[_0x6570('0x20')](_0x9cbfe9['include'],function(_0x32a8a4){return{'model':db[_0x32a8a4[_0x6570('0x21')]],'as':_0x32a8a4['as'],'attributes':_0x32a8a4[_0x6570('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6570('0x11')](function(_0x237d22){logger[_0x6570('0x23')](_0x6570('0x26'),_0x45d651);logger['debug']('ShowMailAccount',_0x45d651,JSON[_0x6570('0x16')](_0x237d22));_0x1a3ba8(_0x237d22);})[_0x6570('0x24')](function(_0x2a8173){logger[_0x6570('0x17')]('ShowMailAccount',_0x2a8173[_0x6570('0x19')],_0x45d651);_0x163c76(_0x30ce40[_0x6570('0x17')](0x1f4,_0x2a8173[_0x6570('0x19')]));});});};exports[_0x6570('0x28')]=function(_0x45ba52){var _0x31dec6=this;return new Promise(function(_0x2e60d7,_0x242903){var _0x2c35a5={'body':_0x45ba52[_0x6570('0x29')],'channel':_0x6570('0x2a')};var _0x217060=_[_0x6570('0x2b')](_[_0x6570('0x2c')](db[_0x6570('0x2d')][_0x6570('0x2e')]),[_0x6570('0x2f'),'updatedAt',_0x6570('0x30'),_0x6570('0x31')]);var _0xab5932=![];if(_0x45ba52[_0x6570('0x29')]['id']){delete _0x45ba52['body']['id'];}if(_['isNil'](_0x45ba52[_0x6570('0x29')][_0x6570('0x32')])){return _0x242903(_0x31dec6['error'](0x1f4,_0x6570('0x33')));}if(_[_0x6570('0x34')](_0x45ba52['body'][_0x6570('0x29')])||_0x45ba52['body'][_0x6570('0x29')]===''){return _0x242903(_0x31dec6[_0x6570('0x17')](0x1f4,_0x6570('0x35')));}if(_[_0x6570('0x34')](_0x45ba52[_0x6570('0x29')][_0x6570('0x36')])){return _0x242903(_0x31dec6['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x217060));}if(!_[_0x6570('0x37')](_0x217060,_0x45ba52[_0x6570('0x29')]['mapKey'])){return _0x242903(_0x31dec6[_0x6570('0x17')](0x1f4,_0x6570('0x38')+_0x217060));}var _0x512d0={};_0x512d0[_0x45ba52['body'][_0x6570('0x36')]]=_0x45ba52[_0x6570('0x29')][_0x6570('0x32')];return db[_0x6570('0x1a')]['find']({'where':{'id':_0x45ba52[_0x6570('0x39')]['id']},'include':[{'model':db[_0x6570('0x3a')],'as':'List','include':[{'model':db['CmContact'],'as':_0x6570('0x3b'),'where':_0x512d0,'limit':0x1,'order':[['updatedAt',_0x6570('0x3c')]]}]},{'model':db[_0x6570('0x3d')],'as':_0x6570('0x3e')},{'model':db[_0x6570('0x3f')],'as':_0x6570('0x40')}]})['then'](function(_0x5c7625){if(_0x5c7625&&_0x5c7625['List']){var _0x511b52=_0x5c7625['get']({'plain':!![]});_0x2c35a5['account']=_[_0x6570('0x41')](_0x511b52,[_0x6570('0x3e'),_0x6570('0x42')]);_0x2c35a5[_0x6570('0x43')]=_0x511b52[_0x6570('0x3e')];_0x2c35a5['list']=_0x511b52[_0x6570('0x42')];_0x2c35a5['applications']=_[_0x6570('0x44')](_0x2c35a5[_0x6570('0x43')],[_0x6570('0x45')],['asc']);if(_0x2c35a5['account']&&_0x2c35a5[_0x6570('0x39')][_0x6570('0x46')]){_0x2c35a5[_0x6570('0x43')][_0x6570('0x47')]({'id':0x0,'priority':_0x2c35a5['applications'][_0x6570('0x48')]+0x1,'app':_0x6570('0x49'),'appdata':_0x6570('0x46'),'interval':_0x6570('0x4a')});}if(_0x2c35a5[_0x6570('0x39')][_0x6570('0x3e')]){delete _0x2c35a5[_0x6570('0x39')]['Applications'];}if(_0x2c35a5['account']['List']){delete _0x2c35a5[_0x6570('0x39')][_0x6570('0x42')];}if(_0x511b52[_0x6570('0x42')]['Contacts'][_0x6570('0x48')]){return _0x511b52[_0x6570('0x42')][_0x6570('0x3b')][0x0];}var _0x36b474=_['defaults'](_0x45ba52[_0x6570('0x29')],{'firstName':_0x45ba52[_0x6570('0x29')][_0x6570('0x32')],'ListId':_0x511b52[_0x6570('0x31')]});_0x36b474[_0x45ba52[_0x6570('0x29')][_0x6570('0x36')]]=_0x45ba52[_0x6570('0x29')][_0x6570('0x32')];return db[_0x6570('0x2d')]['create'](_0x36b474);}else{throw new Error(_0x6570('0x4b'));}})[_0x6570('0x11')](function(_0x50db51){_0x2c35a5[_0x6570('0x4c')]=_0x50db51;if(_0x50db51){if(!_0x45ba52[_0x6570('0x29')]['message'][_0x6570('0x4d')]){_0x45ba52[_0x6570('0x29')][_0x6570('0x19')][_0x6570('0x4d')]=rs[_0x6570('0x4e')]()+'\x20'+_0x45ba52['body'][_0x6570('0x19')]['from'];}var _0x11c0d8={'ContactId':_0x50db51['id'],'MailAccountId':_0x45ba52[_0x6570('0x39')]['id'],'inReplyTo':_0x45ba52['body'][_0x6570('0x19')]['messageId'],'to':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')][_0x6570('0x32')],'cc':_0x45ba52['body'][_0x6570('0x19')]['cc'],'subject':_0x45ba52[_0x6570('0x29')]['message'][_0x6570('0x4f')],'attach':_0x45ba52[_0x6570('0x29')]['message'][_0x6570('0x50')],'lastMsgAt':moment()[_0x6570('0x51')](_0x6570('0x52')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x6570('0x27')]({'where':{'closed':![],'MailAccountId':_0x45ba52[_0x6570('0x39')]['id']},'include':[{'model':db[_0x6570('0x53')],'as':_0x6570('0x54'),'attributes':[_0x6570('0x4d')],'where':{'messageId':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')]['inReplyTo']}}]})[_0x6570('0x11')](function(_0x3ab3f7){if(_0x3ab3f7){return[_0x3ab3f7,![]];}return db['MailInteraction'][_0x6570('0x55')](_0x11c0d8)[_0x6570('0x11')](function(_0xa8ac56){return[_0xa8ac56,!![]];});});}else{throw new Error(_0x6570('0x56'));}})[_0x6570('0x57')](function(_0x58634f,_0x1ef82e){if(_0x58634f){_0xab5932=_0x1ef82e;if(!_0x1ef82e){return _0x58634f[_0x6570('0x58')]({'inReplyTo':_0x45ba52[_0x6570('0x29')]['message'][_0x6570('0x4d')],'to':_0x45ba52['body']['message']['from'],'cc':_0x45ba52[_0x6570('0x29')]['message']['cc'],'subject':_0x45ba52['body']['message'][_0x6570('0x4f')],'attach':_0x58634f['attach']?_0x58634f[_0x6570('0x50')]:_0x45ba52[_0x6570('0x29')][_0x6570('0x19')][_0x6570('0x50')],'substatus':null,'substatusAt':moment()[_0x6570('0x51')](_0x6570('0x52')),'lastMsgAt':moment()[_0x6570('0x51')](_0x6570('0x52')),'lastMsgDirection':'in'});}else{return _0x58634f;}}})['then'](function(_0x4be7aa){_0x2c35a5[_0x6570('0x59')]=_0x4be7aa['get']({'plain':!![]});_0x2c35a5[_0x6570('0x59')][_0x6570('0x5a')]=_0xab5932;return db[_0x6570('0x53')]['create']({'body':_0x45ba52[_0x6570('0x29')]['body'],'MailAccountId':_0x45ba52['account']['id'],'MailInteractionId':_0x4be7aa['id'],'direction':'in','ContactId':_0x2c35a5[_0x6570('0x4c')]['id'],'messageId':_0x45ba52['body'][_0x6570('0x19')][_0x6570('0x4d')],'from':_0x45ba52[_0x6570('0x29')]['message'][_0x6570('0x32')],'to':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')]['to'],'cc':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')]['cc'],'subject':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')]['subject'],'attach':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')][_0x6570('0x50')],'Attachments':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')][_0x6570('0x5b')],'originTo':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')][_0x6570('0x5c')],'originCc':_0x45ba52['body'][_0x6570('0x19')][_0x6570('0x5d')],'bcc':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')][_0x6570('0x5e')],'ChatWebsiteId':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')][_0x6570('0x5f')]||null,'originChannel':_0x45ba52['body'][_0x6570('0x19')][_0x6570('0x60')]||_0x6570('0x61'),'ChatOfflineMessageId':_0x45ba52[_0x6570('0x29')][_0x6570('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x6570('0x11')](function(_0x237ae9){_0x2c35a5[_0x6570('0x19')]=_0x237ae9;if(_0x2c35a5[_0x6570('0x59')][_0x6570('0x62')]){return db[_0x6570('0x63')][_0x6570('0x27')]({'attributes':['id',_0x6570('0x64')],'where':{'id':_0x2c35a5[_0x6570('0x59')]['UserId']}})[_0x6570('0x11')](function(_0x5e9a0d){if(_0x5e9a0d){_0x2c35a5['applications'][_0x6570('0x65')]({'id':0x0,'priority':0x0,'app':_0x6570('0x66'),'appdata':_0x5e9a0d[_0x6570('0x64')]+','+(_0x2c35a5[_0x6570('0x39')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x6570('0x67'),_0x2c35a5);});}return respondWithRpcPromise(_0x6570('0x68'),_0x6570('0x67'),_0x2c35a5);})[_0x6570('0x11')](function(_0x3bf505){_0x2e60d7(_0x3bf505);})[_0x6570('0x24')](function(_0x56ac74){_0x242903(_0x31dec6[_0x6570('0x17')](0x1f4,_0x56ac74[_0x6570('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 71ae132..8fb74f9 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 _0xa8ea=['save','remove','update','emit','removeListener','register','./mailAccount.events'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa8ea,0xfb));var _0xaa8e=function(_0x583ae9,_0x4781bd){_0x583ae9=_0x583ae9-0x0;var _0x4a9264=_0xa8ea[_0x583ae9];return _0x4a9264;};'use strict';var MailAccountEvents=require(_0xaa8e('0x0'));var events=[_0xaa8e('0x1'),_0xaa8e('0x2'),_0xaa8e('0x3')];function createListener(_0x55472c,_0x8562e9){return function(_0x243596){_0x8562e9[_0xaa8e('0x4')](_0x55472c,_0x243596);};}function removeListener(_0x3a5d8f,_0x3352b8){return function(){MailAccountEvents[_0xaa8e('0x5')](_0x3a5d8f,_0x3352b8);};}exports[_0xaa8e('0x6')]=function(_0x2348d5){for(var _0x478702=0x0,_0x1be20d=events['length'];_0x478702<_0x1be20d;_0x478702++){var _0x3c1211=events[_0x478702];var _0x17db7e=createListener('mailAccount:'+_0x3c1211,_0x2348d5);MailAccountEvents['on'](_0x3c1211,_0x17db7e);}}; \ No newline at end of file +var _0x89d9=['./mailAccount.events','save','update','emit','removeListener','register','length','mailAccount:'];(function(_0x32e018,_0xf3f5de){var _0x567ed7=function(_0x40d4ef){while(--_0x40d4ef){_0x32e018['push'](_0x32e018['shift']());}};_0x567ed7(++_0xf3f5de);}(_0x89d9,0x1c0));var _0x989d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x89d9[_0x413feb];return _0x40ee88;};'use strict';var MailAccountEvents=require(_0x989d('0x0'));var events=[_0x989d('0x1'),'remove',_0x989d('0x2')];function createListener(_0x205d44,_0x5f55b4){return function(_0x57c9e8){_0x5f55b4[_0x989d('0x3')](_0x205d44,_0x57c9e8);};}function removeListener(_0x1defe5,_0x267226){return function(){MailAccountEvents[_0x989d('0x4')](_0x1defe5,_0x267226);};}exports[_0x989d('0x5')]=function(_0x3938d3){for(var _0x214e4f=0x0,_0x70ccd4=events[_0x989d('0x6')];_0x214e4f<_0x70ccd4;_0x214e4f++){var _0x21e60f=events[_0x214e4f];var _0x2e1327=createListener(_0x989d('0x7')+_0x21e60f,_0x3938d3);MailAccountEvents['on'](_0x21e60f,_0x2e1327);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 13f6f46..bb10de9 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 _0x9b32=['update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','/:id','isAuthenticated','put'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x9b32,0xda));var _0x29b3=function(_0x296713,_0x2b7080){_0x296713=_0x296713-0x0;var _0x2b0630=_0x9b32[_0x296713];return _0x2b0630;};'use strict';var multer=require(_0x29b3('0x0'));var util=require(_0x29b3('0x1'));var path=require('path');var timeout=require(_0x29b3('0x2'));var express=require(_0x29b3('0x3'));var router=express[_0x29b3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x29b3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x29b3('0x6'));var controller=require('./mailApplication.controller');router['get'](_0x29b3('0x7'),auth[_0x29b3('0x8')](),controller['show']);router[_0x29b3('0x9')](_0x29b3('0x7'),auth[_0x29b3('0x8')](),controller[_0x29b3('0xa')]);router[_0x29b3('0xb')](_0x29b3('0x7'),auth[_0x29b3('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7473=['isAuthenticated','show','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id'];(function(_0x26d14a,_0x324f50){var _0x34ee0e=function(_0x351a2d){while(--_0x351a2d){_0x26d14a['push'](_0x26d14a['shift']());}};_0x34ee0e(++_0x324f50);}(_0x7473,0x1b6));var _0x3747=function(_0x509d39,_0x398ecc){_0x509d39=_0x509d39-0x0;var _0x5b4145=_0x7473[_0x509d39];return _0x5b4145;};'use strict';var multer=require(_0x3747('0x0'));var util=require('util');var path=require(_0x3747('0x1'));var timeout=require('connect-timeout');var express=require(_0x3747('0x2'));var router=express[_0x3747('0x3')]();var fs_extra=require(_0x3747('0x4'));var auth=require(_0x3747('0x5'));var interaction=require(_0x3747('0x6'));var config=require(_0x3747('0x7'));var controller=require(_0x3747('0x8'));router['get'](_0x3747('0x9'),auth[_0x3747('0xa')](),controller[_0x3747('0xb')]);router['put'](_0x3747('0x9'),auth[_0x3747('0xa')](),controller[_0x3747('0xc')]);router[_0x3747('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3747('0xe')]);module[_0x3747('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 1972085..95a2a2a 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 _0x1b9a=['TEXT','sequelize','exports','STRING'];(function(_0x39bd80,_0x48cc4b){var _0x368d24=function(_0x532709){while(--_0x532709){_0x39bd80['push'](_0x39bd80['shift']());}};_0x368d24(++_0x48cc4b);}(_0x1b9a,0x1cd));var _0xa1b9=function(_0x45c4d2,_0x10bc7d){_0x45c4d2=_0x45c4d2-0x0;var _0x3b605f=_0x1b9a[_0x45c4d2];return _0x3b605f;};'use strict';var Sequelize=require(_0xa1b9('0x0'));module[_0xa1b9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa1b9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa1b9('0x3')]()},'description':{'type':Sequelize[_0xa1b9('0x2')]},'interval':{'type':Sequelize[_0xa1b9('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xe542=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe542,0x1b1));var _0x2e54=function(_0x545240,_0x5daa34){_0x545240=_0x545240-0x0;var _0x4cf537=_0xe542[_0x545240];return _0x4cf537;};'use strict';var Sequelize=require(_0x2e54('0x0'));module[_0x2e54('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2e54('0x2')],'allowNull':![],'defaultValue':_0x2e54('0x3')},'appdata':{'type':Sequelize[_0x2e54('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2e54('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index d944c18..26fe8d8 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x452ac2,_0x45f034){var _0x5a589a=function(_0x3c3fe8){while(--_0x3c3fe8){_0x452ac2['push'](_0x452ac2['shift']());}};_0x5a589a(++_0x45f034);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file +var _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(_0x4dc064,_0x5e52d2){var _0x5d7a74=function(_0x442b6c){while(--_0x442b6c){_0x4dc064['push'](_0x4dc064['shift']());}};_0x5d7a74(++_0x5e52d2);}(_0x54ef,0x112));var _0xf54e=function(_0x34bb7c,_0x557774){_0x34bb7c=_0x34bb7c-0x0;var _0x181f2b=_0x54ef[_0x34bb7c];return _0x181f2b;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 1721308..93858a1 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 _0xf345=['request-promise','path','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x50bd15,_0x42c704){var _0x1197ef=function(_0x291009){while(--_0x291009){_0x50bd15['push'](_0x50bd15['shift']());}};_0x1197ef(++_0x42c704);}(_0xf345,0xea));var _0x5f34=function(_0x2c67c3,_0x15d579){_0x2c67c3=_0x2c67c3-0x0;var _0x13a2f9=_0xf345[_0x2c67c3];return _0x13a2f9;};'use strict';var _=require(_0x5f34('0x0'));var util=require(_0x5f34('0x1'));var logger=require(_0x5f34('0x2'))(_0x5f34('0x3'));var moment=require(_0x5f34('0x4'));var BPromise=require(_0x5f34('0x5'));var rp=require(_0x5f34('0x6'));var fs=require('fs');var path=require(_0x5f34('0x7'));var rimraf=require(_0x5f34('0x8'));var config=require('../../config/environment');var attributes=require(_0x5f34('0x9'));module[_0x5f34('0xa')]=function(_0x2aef35,_0x3df507){return _0x2aef35[_0x5f34('0xb')](_0x5f34('0xc'),attributes,{'tableName':_0x5f34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f34('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb606=['define','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x3772e2,_0x53ebd2){var _0x9a802a=function(_0x4f042d){while(--_0x4f042d){_0x3772e2['push'](_0x3772e2['shift']());}};_0x9a802a(++_0x53ebd2);}(_0xb606,0xb4));var _0x6b60=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xb606[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6b60('0x0'))('api');var moment=require(_0x6b60('0x1'));var BPromise=require(_0x6b60('0x2'));var rp=require(_0x6b60('0x3'));var fs=require('fs');var path=require(_0x6b60('0x4'));var rimraf=require(_0x6b60('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x6b60('0x6')]=function(_0x1672e0,_0x521671){return _0x1672e0[_0x6b60('0x7')]('MailApplication',attributes,{'tableName':_0x6b60('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b60('0x9'),'collate':_0x6b60('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7bf0bef..dceb77f 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 _0xda1a=['raw','where','attributes','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','body','options'];(function(_0x46c5e2,_0x60e240){var _0x160b0f=function(_0x4df90b){while(--_0x4df90b){_0x46c5e2['push'](_0x46c5e2['shift']());}};_0x160b0f(++_0x60e240);}(_0xda1a,0x154));var _0xada1=function(_0x54ce9c,_0xb84580){_0x54ce9c=_0x54ce9c-0x0;var _0x1c2e76=_0xda1a[_0x54ce9c];return _0x1c2e76;};'use strict';var _=require(_0xada1('0x0'));var util=require(_0xada1('0x1'));var moment=require('moment');var BPromise=require(_0xada1('0x2'));var rs=require(_0xada1('0x3'));var fs=require('fs');var Redis=require(_0xada1('0x4'));var db=require(_0xada1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xada1('0x6'));var jayson=require(_0xada1('0x7'));var client=jayson[_0xada1('0x8')][_0xada1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x133c25,_0xa2fb10,_0x437c15){return new BPromise(function(_0x3418b4,_0x544494){return client[_0xada1('0xa')](_0x133c25,_0x437c15)['then'](function(_0x16564a){logger['info'](_0xada1('0xb'),_0xa2fb10,_0xada1('0xc'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0xa2fb10,_0xada1('0xc'),JSON[_0xada1('0xd')](_0x16564a));if(_0x16564a['error']){if(_0x16564a[_0xada1('0xe')][_0xada1('0xf')]===0x1f4){logger[_0xada1('0xe')](_0xada1('0xb'),_0xa2fb10,_0x16564a[_0xada1('0xe')][_0xada1('0x10')]);return _0x544494(_0x16564a[_0xada1('0xe')]['message']);}logger['error'](_0xada1('0xb'),_0xa2fb10,_0x16564a[_0xada1('0xe')][_0xada1('0x10')]);return _0x3418b4(_0x16564a[_0xada1('0xe')]['message']);}else{logger[_0xada1('0x11')](_0xada1('0xb'),_0xa2fb10,_0xada1('0xc'));_0x3418b4(_0x16564a[_0xada1('0x12')]['message']);}})[_0xada1('0x13')](function(_0x3c695b){logger[_0xada1('0xe')](_0xada1('0xb'),_0xa2fb10,_0x3c695b);_0x544494(_0x3c695b);});});}exports[_0xada1('0x14')]=function(_0x121f57){var _0x719f39=this;return new Promise(function(_0x38a407,_0x5c13bb){return db[_0xada1('0x15')]['update'](_0x121f57[_0xada1('0x16')],{'raw':_0x121f57[_0xada1('0x17')]?_0x121f57[_0xada1('0x17')][_0xada1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x121f57[_0xada1('0x17')]?_0x121f57[_0xada1('0x17')][_0xada1('0x19')]||null:null,'attributes':_0x121f57[_0xada1('0x17')]?_0x121f57[_0xada1('0x17')][_0xada1('0x1a')]||null:null,'limit':_0x121f57[_0xada1('0x17')]?_0x121f57[_0xada1('0x17')]['limit']||null:null})['then'](function(_0x588e3e){logger[_0xada1('0x11')]('UpdateMailApplication',_0x121f57);logger[_0xada1('0x1b')]('UpdateMailApplication',_0x121f57,JSON[_0xada1('0xd')](_0x588e3e));_0x38a407(_0x588e3e);})[_0xada1('0x13')](function(_0x24d25d){logger[_0xada1('0xe')](_0xada1('0x14'),_0x24d25d[_0xada1('0x10')],_0x121f57);_0x5c13bb(_0x719f39[_0xada1('0xe')](0x1f4,_0x24d25d['message']));});});}; \ No newline at end of file +var _0xcaf6=['error','code','message','info','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcaf6,0x144));var _0x6caf=function(_0x3c04d7,_0x472801){_0x3c04d7=_0x3c04d7-0x0;var _0x2fb24=_0xcaf6[_0x3c04d7];return _0x2fb24;};'use strict';var _=require('lodash');var util=require(_0x6caf('0x0'));var moment=require(_0x6caf('0x1'));var BPromise=require(_0x6caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6caf('0x3'));var db=require(_0x6caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6caf('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6caf('0x6')][_0x6caf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a3ac1,_0x32a723,_0x38521f){return new BPromise(function(_0x5961d7,_0x38148b){return client[_0x6caf('0x8')](_0x3a3ac1,_0x38521f)[_0x6caf('0x9')](function(_0x25ba88){logger['info'](_0x6caf('0xa'),_0x32a723,_0x6caf('0xb'));logger[_0x6caf('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x32a723,_0x6caf('0xb'),JSON[_0x6caf('0xd')](_0x25ba88));if(_0x25ba88[_0x6caf('0xe')]){if(_0x25ba88[_0x6caf('0xe')][_0x6caf('0xf')]===0x1f4){logger[_0x6caf('0xe')](_0x6caf('0xa'),_0x32a723,_0x25ba88['error'][_0x6caf('0x10')]);return _0x38148b(_0x25ba88[_0x6caf('0xe')]['message']);}logger[_0x6caf('0xe')](_0x6caf('0xa'),_0x32a723,_0x25ba88[_0x6caf('0xe')][_0x6caf('0x10')]);return _0x5961d7(_0x25ba88[_0x6caf('0xe')][_0x6caf('0x10')]);}else{logger[_0x6caf('0x11')]('MailApplication,\x20%s,\x20%s',_0x32a723,_0x6caf('0xb'));_0x5961d7(_0x25ba88[_0x6caf('0x12')][_0x6caf('0x10')]);}})[_0x6caf('0x13')](function(_0x1a9f50){logger[_0x6caf('0xe')](_0x6caf('0xa'),_0x32a723,_0x1a9f50);_0x38148b(_0x1a9f50);});});}exports[_0x6caf('0x14')]=function(_0x52f541){var _0x36fc73=this;return new Promise(function(_0x3d5fc4,_0x263cc3){return db['MailApplication'][_0x6caf('0x15')](_0x52f541['body'],{'raw':_0x52f541['options']?_0x52f541[_0x6caf('0x16')][_0x6caf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52f541['options']?_0x52f541[_0x6caf('0x16')]['where']||null:null,'attributes':_0x52f541[_0x6caf('0x16')]?_0x52f541[_0x6caf('0x16')][_0x6caf('0x18')]||null:null,'limit':_0x52f541[_0x6caf('0x16')]?_0x52f541[_0x6caf('0x16')][_0x6caf('0x19')]||null:null})['then'](function(_0x41c0a0){logger['info'](_0x6caf('0x14'),_0x52f541);logger[_0x6caf('0xc')](_0x6caf('0x14'),_0x52f541,JSON['stringify'](_0x41c0a0));_0x3d5fc4(_0x41c0a0);})[_0x6caf('0x13')](function(_0x3b9ebb){logger[_0x6caf('0xe')](_0x6caf('0x14'),_0x3b9ebb[_0x6caf('0x10')],_0x52f541);_0x263cc3(_0x36fc73['error'](0x1f4,_0x3b9ebb[_0x6caf('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 66a2138..7b18e22 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 _0x91af=['update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put'];(function(_0x42bf59,_0x3848d3){var _0x428760=function(_0x467cf4){while(--_0x467cf4){_0x42bf59['push'](_0x42bf59['shift']());}};_0x428760(++_0x3848d3);}(_0x91af,0x1d9));var _0xf91a=function(_0x2510be,_0x35c002){_0x2510be=_0x2510be-0x0;var _0x803197=_0x91af[_0x2510be];return _0x803197;};'use strict';var express=require(_0xf91a('0x0'));var router=express[_0xf91a('0x1')]();var auth=require(_0xf91a('0x2'));var interaction=require(_0xf91a('0x3'));var controller=require('./mailInteraction.controller');router[_0xf91a('0x4')]('/',auth[_0xf91a('0x5')](),controller['index']);router[_0xf91a('0x4')](_0xf91a('0x6'),auth[_0xf91a('0x5')](),controller['describe']);router['get'](_0xf91a('0x7'),auth['isAuthenticated'](),controller[_0xf91a('0x8')]);router['get'](_0xf91a('0x9'),auth[_0xf91a('0x5')](),controller[_0xf91a('0xa')]);router[_0xf91a('0x4')]('/:id/download',auth[_0xf91a('0x5')](),controller[_0xf91a('0xb')]);router[_0xf91a('0xc')]('/',auth[_0xf91a('0x5')](),controller[_0xf91a('0xd')]);router[_0xf91a('0xc')](_0xf91a('0x9'),auth[_0xf91a('0x5')](),controller[_0xf91a('0xe')]);router[_0xf91a('0xc')](_0xf91a('0xf'),auth[_0xf91a('0x5')](),interaction[_0xf91a('0x10')](_0xf91a('0x11'),_0xf91a('0x12')),controller[_0xf91a('0x13')]);router[_0xf91a('0x14')](_0xf91a('0x7'),auth['isAuthenticated'](),interaction[_0xf91a('0x10')](_0xf91a('0x11'),'mailinteraction:update'),controller[_0xf91a('0x15')]);router['delete'](_0xf91a('0x7'),auth[_0xf91a('0x5')](),interaction[_0xf91a('0x10')](_0xf91a('0x11'),_0xf91a('0x16')),controller[_0xf91a('0x17')]);router[_0xf91a('0x18')]('/:id/tags',auth[_0xf91a('0x5')](),controller[_0xf91a('0x19')]);module['exports']=router; \ No newline at end of file +var _0x4cc7=['get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','mail','mailinteraction:update','destroy','delete','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller'];(function(_0x3a1b3d,_0x5964dc){var _0x528653=function(_0x212799){while(--_0x212799){_0x3a1b3d['push'](_0x3a1b3d['shift']());}};_0x528653(++_0x5964dc);}(_0x4cc7,0x1c4));var _0x74cc=function(_0x316b85,_0x1e3721){_0x316b85=_0x316b85-0x0;var _0x38ecc9=_0x4cc7[_0x316b85];return _0x38ecc9;};'use strict';var express=require(_0x74cc('0x0'));var router=express['Router']();var auth=require(_0x74cc('0x1'));var interaction=require(_0x74cc('0x2'));var controller=require(_0x74cc('0x3'));router[_0x74cc('0x4')]('/',auth[_0x74cc('0x5')](),controller[_0x74cc('0x6')]);router[_0x74cc('0x4')](_0x74cc('0x7'),auth[_0x74cc('0x5')](),controller[_0x74cc('0x8')]);router[_0x74cc('0x4')](_0x74cc('0x9'),auth[_0x74cc('0x5')](),controller['show']);router[_0x74cc('0x4')](_0x74cc('0xa'),auth[_0x74cc('0x5')](),controller[_0x74cc('0xb')]);router[_0x74cc('0x4')](_0x74cc('0xc'),auth['isAuthenticated'](),controller[_0x74cc('0xd')]);router[_0x74cc('0xe')]('/',auth['isAuthenticated'](),controller[_0x74cc('0xf')]);router[_0x74cc('0xe')]('/:id/messages',auth[_0x74cc('0x5')](),controller[_0x74cc('0x10')]);router[_0x74cc('0xe')](_0x74cc('0x11'),auth[_0x74cc('0x5')](),interaction[_0x74cc('0x12')]('mail',_0x74cc('0x13')),controller['addTags']);router['put'](_0x74cc('0x9'),auth[_0x74cc('0x5')](),interaction['tracked'](_0x74cc('0x14'),_0x74cc('0x15')),controller['update']);router['delete'](_0x74cc('0x9'),auth['isAuthenticated'](),interaction[_0x74cc('0x12')]('mail','mailinteraction:destroy'),controller[_0x74cc('0x16')]);router[_0x74cc('0x17')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);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 12eeb3d..13fcb27 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 _0xdfcf=['iconv','exports','DATE','STRING','long','TEXT','BOOLEAN','out','ENUM','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdfcf,0x1df));var _0xfdfc=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xdfcf[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xfdfc('0x0'));var iconv=require(_0xfdfc('0x1'));module[_0xfdfc('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfdfc('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xfdfc('0x4')]},'thirdDisposition':{'type':Sequelize[_0xfdfc('0x4')]},'note':{'type':Sequelize[_0xfdfc('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xfdfc('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xfdfc('0x5'))},'subject':{'type':Sequelize[_0xfdfc('0x6')]()},'attach':{'type':Sequelize[_0xfdfc('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xfdfc('0x3')]},'substatus':{'type':Sequelize[_0xfdfc('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfdfc('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xfdfc('0x9')]('in',_0xfdfc('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0dc1=['TEXT','ENUM','out','iconv','exports','BOOLEAN','DATE','STRING','long'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x0dc1,0x198));var _0x10dc=function(_0x2646f6,_0x287adf){_0x2646f6=_0x2646f6-0x0;var _0x577237=_0x0dc1[_0x2646f6];return _0x577237;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x10dc('0x0'));module[_0x10dc('0x1')]={'closed':{'type':Sequelize[_0x10dc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x10dc('0x3')]},'disposition':{'type':Sequelize[_0x10dc('0x4')]},'secondDisposition':{'type':Sequelize[_0x10dc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x10dc('0x4')]},'note':{'type':Sequelize[_0x10dc('0x4')]},'inReplyTo':{'type':Sequelize[_0x10dc('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x10dc('0x5'))},'subject':{'type':Sequelize[_0x10dc('0x6')]()},'attach':{'type':Sequelize[_0x10dc('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x10dc('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x10dc('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x10dc('0x7')]('in',_0x10dc('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x10dc('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x10dc('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8049477..d0d0161 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x57b563,_0x10cfcc){var _0x7789fe=function(_0x5910d3){while(--_0x5910d3){_0x57b563['push'](_0x57b563['shift']());}};_0x7789fe(++_0x10cfcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xb10b,0x12a));var _0xbb10=function(_0x2976de,_0x4c546d){_0x2976de=_0x2976de-0x0;var _0xecbf51=_0xb10b[_0x2976de];return _0xecbf51;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 8d761cf..43e2743 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 _0x4559=['save','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x2ed4b9,_0x155ac2){var _0x2eaf14=function(_0x1eb9b9){while(--_0x1eb9b9){_0x2ed4b9['push'](_0x2ed4b9['shift']());}};_0x2eaf14(++_0x155ac2);}(_0x4559,0x13f));var _0x9455=function(_0x5d851d,_0x53c51c){_0x5d851d=_0x5d851d-0x0;var _0xbaaa92=_0x4559[_0x5d851d];return _0xbaaa92;};'use strict';var EventEmitter=require(_0x9455('0x0'));var MailInteraction=require(_0x9455('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x9455('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9455('0x3')](0x0);var events={'afterCreate':_0x9455('0x4'),'afterUpdate':'update','afterDestroy':_0x9455('0x5')};function emitEvent(_0x2186ab){return function(_0x7e97bb,_0x5aa7d9,_0x3c2fe2){_0x7e97bb[_0x9455('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2cea45){_0x7e97bb[_0x9455('0x7')](_0x9455('0x8'),_0x2cea45[_0x9455('0x9')](function(_0x590f2f){return{'id':_0x590f2f['id']};}));return MailMessage[_0x9455('0xa')]({'where':{'MailInteractionId':_0x7e97bb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9455('0xb')](function(_0x2305b1){_0x7e97bb['setDataValue'](_0x9455('0xc'),_0x2305b1[_0x9455('0xd')]);MailInteractionEvents['emit'](_0x2186ab+':'+_0x7e97bb['id'],_0x7e97bb);MailInteractionEvents[_0x9455('0xe')](_0x2186ab,_0x7e97bb);_0x3c2fe2(null);})['catch'](_0x3c2fe2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x9455('0xf')](e,emitEvent(event));}}module[_0x9455('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x633c=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','update','remove','then','setDataValue','Users','map'];(function(_0x5d2bd6,_0x377005){var _0x796b32=function(_0x40014c){while(--_0x40014c){_0x5d2bd6['push'](_0x5d2bd6['shift']());}};_0x796b32(++_0x377005);}(_0x633c,0x1d2));var _0xc633=function(_0x37f0d5,_0x2603f2){_0x37f0d5=_0x37f0d5-0x0;var _0x489a1d=_0x633c[_0x37f0d5];return _0x489a1d;};'use strict';var EventEmitter=require(_0xc633('0x0'));var MailInteraction=require(_0xc633('0x1'))['db'][_0xc633('0x2')];var MailMessage=require(_0xc633('0x1'))['db'][_0xc633('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc633('0x4'),'afterDestroy':_0xc633('0x5')};function emitEvent(_0xb00855){return function(_0xdbb575,_0x2bc70e,_0x3333eb){_0xdbb575['getUsers']({'attributes':['id'],'raw':!![]})[_0xc633('0x6')](function(_0x5865ad){_0xdbb575[_0xc633('0x7')](_0xc633('0x8'),_0x5865ad[_0xc633('0x9')](function(_0xf66312){return{'id':_0xf66312['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0xdbb575['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc633('0x6')](function(_0x59c86b){_0xdbb575['setDataValue'](_0xc633('0xa'),_0x59c86b[_0xc633('0xb')]);MailInteractionEvents[_0xc633('0xc')](_0xb00855+':'+_0xdbb575['id'],_0xdbb575);MailInteractionEvents[_0xc633('0xc')](_0xb00855,_0xdbb575);_0x3333eb(null);})[_0xc633('0xd')](_0x3333eb(null));};}for(var e in events){if(events[_0xc633('0xe')](e)){var event=events[e];MailInteraction[_0xc633('0xf')](e,emitEvent(event));}}module[_0xc633('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index f031cb0..952b677 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 _0xc129=['format','closed','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','models','get','MailMessage','update','then','catch','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt'];(function(_0x1ee970,_0x3ce458){var _0x41eb5c=function(_0x586098){while(--_0x586098){_0x1ee970['push'](_0x1ee970['shift']());}};_0x41eb5c(++_0x3ce458);}(_0xc129,0x150));var _0x9c12=function(_0x56260c,_0x3594bc){_0x56260c=_0x56260c-0x0;var _0x3293b9=_0xc129[_0x56260c];return _0x3293b9;};'use strict';var _=require(_0x9c12('0x0'));var util=require('util');var logger=require(_0x9c12('0x1'))(_0x9c12('0x2'));var moment=require('moment');var BPromise=require(_0x9c12('0x3'));var rp=require(_0x9c12('0x4'));var fs=require('fs');var path=require(_0x9c12('0x5'));var rimraf=require(_0x9c12('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c12('0x7'));module[_0x9c12('0x8')]=function(_0x19fe39,_0x591f5f){return _0x19fe39['define']('MailInteraction',attributes,{'tableName':_0x9c12('0x9'),'paranoid':![],'indexes':[{'name':_0x9c12('0xa'),'fields':[_0x9c12('0xb'),'to'],'type':_0x9c12('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x84ad8b,_0x23cf80,_0x44759a){if(_0x84ad8b[_0x9c12('0xd')]){_0x84ad8b[_0x9c12('0xe')]=moment()[_0x9c12('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x84ad8b[_0x9c12('0x10')]){_0x84ad8b[_0x9c12('0x11')]=moment()[_0x9c12('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x44759a(null,_0x23cf80);},'beforeUpdate':function(_0x1f13fa,_0x13f5d5,_0x2fff8b){if(_0x1f13fa[_0x9c12('0x12')](_0x9c12('0xd'))){_0x1f13fa[_0x9c12('0xe')]=_0x1f13fa['substatus']?moment()[_0x9c12('0xf')](_0x9c12('0x13')):null;}if(_0x1f13fa[_0x9c12('0x12')]('closed')){_0x1f13fa[_0x9c12('0x11')]=moment()[_0x9c12('0xf')](_0x9c12('0x13'));_0x1f13fa[_0x9c12('0xd')]=null;_0x1f13fa[_0x9c12('0xe')]=null;}_0x2fff8b(null,_0x1f13fa);},'afterUpdate':function(_0x55d4c0,_0x8a9972,_0x84b67b){var _0x4c3fea=_0x19fe39[_0x9c12('0x14')];var _0x3238b1=_0x55d4c0[_0x9c12('0x15')]({'plain':!![]});if(_0x3238b1[_0x9c12('0x10')]){return _0x4c3fea[_0x9c12('0x16')][_0x9c12('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x3238b1['id']}})[_0x9c12('0x18')](function(){_0x84b67b();})[_0x9c12('0x19')](function(_0x328c39){_0x84b67b(_0x328c39);});}else{_0x84b67b();}}},'charset':_0x9c12('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd32a=['substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions','FULLTEXT'];(function(_0x2bd443,_0x3b60d8){var _0x45159a=function(_0x1ddbec){while(--_0x1ddbec){_0x2bd443['push'](_0x2bd443['shift']());}};_0x45159a(++_0x3b60d8);}(_0xd32a,0x1a5));var _0xad32=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xd32a[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require(_0xad32('0x0'));var logger=require('../../config/logger')(_0xad32('0x1'));var moment=require('moment');var BPromise=require(_0xad32('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad32('0x3'));var rimraf=require(_0xad32('0x4'));var config=require(_0xad32('0x5'));var attributes=require(_0xad32('0x6'));module[_0xad32('0x7')]=function(_0x4c3d90,_0x40c9cb){return _0x4c3d90['define'](_0xad32('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xad32('0x9'),'fields':['subject','to'],'type':_0xad32('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5ba951,_0x947dfc,_0x53bb8b){if(_0x5ba951[_0xad32('0xb')]){_0x5ba951[_0xad32('0xc')]=moment()['format'](_0xad32('0xd'));}if(_0x5ba951[_0xad32('0xe')]){_0x5ba951[_0xad32('0xf')]=moment()[_0xad32('0x10')](_0xad32('0xd'));}_0x53bb8b(null,_0x947dfc);},'beforeUpdate':function(_0x23f383,_0x4a58c1,_0x4087f2){if(_0x23f383[_0xad32('0x11')](_0xad32('0xb'))){_0x23f383[_0xad32('0xc')]=_0x23f383[_0xad32('0xb')]?moment()[_0xad32('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x23f383[_0xad32('0x11')](_0xad32('0xe'))){_0x23f383['closedAt']=moment()[_0xad32('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x23f383[_0xad32('0xb')]=null;_0x23f383['substatusAt']=null;}_0x4087f2(null,_0x23f383);},'afterUpdate':function(_0x5cbe33,_0x565a2f,_0x352374){var _0x4ce97e=_0x4c3d90[_0xad32('0x12')];var _0x375993=_0x5cbe33['get']({'plain':!![]});if(_0x375993[_0xad32('0xe')]){return _0x4ce97e[_0xad32('0x13')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x375993['id']}})[_0xad32('0x14')](function(){_0x352374();})[_0xad32('0x15')](function(_0x5c3313){_0x352374(_0x5c3313);});}else{_0x352374();}}},'charset':_0xad32('0x16'),'collate':_0xad32('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 7cb8354..c459234 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 _0x3adf=['MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','then','stringify','AddTagsToMailInteraction','find','where','addTags','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','redis','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3adf,0x1a6));var _0xf3ad=function(_0x41c088,_0x155e0f){_0x41c088=_0x41c088-0x0;var _0x273b77=_0x3adf[_0x41c088];return _0x273b77;};'use strict';var _=require(_0xf3ad('0x0'));var util=require(_0xf3ad('0x1'));var moment=require(_0xf3ad('0x2'));var BPromise=require(_0xf3ad('0x3'));var rs=require(_0xf3ad('0x4'));var fs=require('fs');var Redis=require(_0xf3ad('0x5'));var db=require(_0xf3ad('0x6'))['db'];var utils=require(_0xf3ad('0x7'));var logger=require(_0xf3ad('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xf3ad('0x9')]=_['defaults'](config[_0xf3ad('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf3ad('0xa'))(new Redis(config[_0xf3ad('0x9')]));require(_0xf3ad('0xb'))[_0xf3ad('0xc')](socket);function respondWithRpcPromise(_0x38bcb6,_0x2e6387,_0x393309){return new BPromise(function(_0xbfaf2b,_0x61070d){return client[_0xf3ad('0xd')](_0x38bcb6,_0x393309)['then'](function(_0x145529){logger[_0xf3ad('0xe')](_0xf3ad('0xf'),_0x2e6387,_0xf3ad('0x10'));logger[_0xf3ad('0x11')](_0xf3ad('0x12'),_0x2e6387,_0xf3ad('0x10'),JSON['stringify'](_0x145529));if(_0x145529[_0xf3ad('0x13')]){if(_0x145529[_0xf3ad('0x13')][_0xf3ad('0x14')]===0x1f4){logger[_0xf3ad('0x13')](_0xf3ad('0xf'),_0x2e6387,_0x145529[_0xf3ad('0x13')][_0xf3ad('0x15')]);return _0x61070d(_0x145529[_0xf3ad('0x13')][_0xf3ad('0x15')]);}logger[_0xf3ad('0x13')](_0xf3ad('0xf'),_0x2e6387,_0x145529[_0xf3ad('0x13')][_0xf3ad('0x15')]);return _0xbfaf2b(_0x145529['error'][_0xf3ad('0x15')]);}else{logger['info'](_0xf3ad('0xf'),_0x2e6387,'request\x20sent');_0xbfaf2b(_0x145529['result'][_0xf3ad('0x15')]);}})['catch'](function(_0x46f725){logger['error'](_0xf3ad('0xf'),_0x2e6387,_0x46f725);_0x61070d(_0x46f725);});});}exports[_0xf3ad('0x16')]=function(_0x2db4f1){var _0x2b0508=this;return new Promise(function(_0x46ed6b,_0x792ea7){return db[_0xf3ad('0x17')][_0xf3ad('0x18')](_0x2db4f1[_0xf3ad('0x19')],{'raw':_0x2db4f1[_0xf3ad('0x1a')]?_0x2db4f1['options'][_0xf3ad('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2db4f1[_0xf3ad('0x1a')]?_0x2db4f1[_0xf3ad('0x1a')]['where']||null:null,'attributes':_0x2db4f1['options']?_0x2db4f1[_0xf3ad('0x1a')][_0xf3ad('0x1c')]||null:null,'limit':_0x2db4f1[_0xf3ad('0x1a')]?_0x2db4f1[_0xf3ad('0x1a')][_0xf3ad('0x1d')]||null:null})[_0xf3ad('0x1e')](function(_0x3979a0){logger[_0xf3ad('0xe')](_0xf3ad('0x16'),_0x2db4f1);logger[_0xf3ad('0x11')]('UpdateMailInteraction',_0x2db4f1,JSON[_0xf3ad('0x1f')](_0x3979a0));_0x46ed6b(_0x3979a0);})['catch'](function(_0x27b77e){logger[_0xf3ad('0x13')](_0xf3ad('0x16'),_0x27b77e['message'],_0x2db4f1);_0x792ea7(_0x2b0508[_0xf3ad('0x13')](0x1f4,_0x27b77e['message']));});});};exports[_0xf3ad('0x20')]=function(_0x453b25){return new Promise(function(_0x258ffd,_0x25fd75){return db['MailInteraction'][_0xf3ad('0x21')]({'where':_0x453b25[_0xf3ad('0x1a')]?_0x453b25['options'][_0xf3ad('0x22')]||null:null})['then'](function(_0x7eb286){if(_0x7eb286){return _0x7eb286[_0xf3ad('0x23')](_0x453b25[_0xf3ad('0x19')][_0xf3ad('0x24')],_['omit'](_0x453b25['body'],[_0xf3ad('0x24'),'id'])||{});}})[_0xf3ad('0x25')](function(_0x1f48d4){logger[_0xf3ad('0xe')](_0xf3ad('0x26'),_0x453b25);logger[_0xf3ad('0x11')](_0xf3ad('0x26'),_0x453b25,JSON[_0xf3ad('0x1f')](_0x1f48d4));_0x258ffd(_0x1f48d4);})[_0xf3ad('0x27')](function(_0x445722){logger[_0xf3ad('0x13')](_0xf3ad('0x26'),_0x445722[_0xf3ad('0x15')],_0x453b25);_0x25fd75(_this[_0xf3ad('0x13')](0x1f4,_0x445722[_0xf3ad('0x15')]));});});}; \ No newline at end of file +var _0x4a38=['bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','request\x20sent','result','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','catch','find','addTags','ids','spread','AddTags','lodash','util'];(function(_0x4d1b96,_0x569b10){var _0x1e5e25=function(_0x3fac95){while(--_0x3fac95){_0x4d1b96['push'](_0x4d1b96['shift']());}};_0x1e5e25(++_0x569b10);}(_0x4a38,0x1de));var _0x84a3=function(_0x564eb4,_0x33e0b5){_0x564eb4=_0x564eb4-0x0;var _0x55f8f9=_0x4a38[_0x564eb4];return _0x55f8f9;};'use strict';var _=require(_0x84a3('0x0'));var util=require(_0x84a3('0x1'));var moment=require('moment');var BPromise=require(_0x84a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84a3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x84a3('0x4'));var logger=require(_0x84a3('0x5'))('rpc');var config=require(_0x84a3('0x6'));var jayson=require(_0x84a3('0x7'));var client=jayson['client'][_0x84a3('0x8')]({'port':0x232a});config[_0x84a3('0x9')]=_['defaults'](config[_0x84a3('0x9')],{'host':_0x84a3('0xa'),'port':0x18eb});var socket=require(_0x84a3('0xb'))(new Redis(config[_0x84a3('0x9')]));require(_0x84a3('0xc'))[_0x84a3('0xd')](socket);function respondWithRpcPromise(_0x4c2170,_0x2f3bda,_0x164939){return new BPromise(function(_0x298935,_0x31f67d){return client[_0x84a3('0xe')](_0x4c2170,_0x164939)[_0x84a3('0xf')](function(_0x1ca9ad){logger[_0x84a3('0x10')]('MailInteraction,\x20%s,\x20%s',_0x2f3bda,'request\x20sent');logger[_0x84a3('0x11')](_0x84a3('0x12'),_0x2f3bda,'request\x20sent',JSON[_0x84a3('0x13')](_0x1ca9ad));if(_0x1ca9ad[_0x84a3('0x14')]){if(_0x1ca9ad[_0x84a3('0x14')][_0x84a3('0x15')]===0x1f4){logger['error'](_0x84a3('0x16'),_0x2f3bda,_0x1ca9ad['error']['message']);return _0x31f67d(_0x1ca9ad[_0x84a3('0x14')][_0x84a3('0x17')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x2f3bda,_0x1ca9ad[_0x84a3('0x14')]['message']);return _0x298935(_0x1ca9ad[_0x84a3('0x14')][_0x84a3('0x17')]);}else{logger[_0x84a3('0x10')]('MailInteraction,\x20%s,\x20%s',_0x2f3bda,_0x84a3('0x18'));_0x298935(_0x1ca9ad[_0x84a3('0x19')][_0x84a3('0x17')]);}})['catch'](function(_0x510f27){logger[_0x84a3('0x14')](_0x84a3('0x16'),_0x2f3bda,_0x510f27);_0x31f67d(_0x510f27);});});}exports[_0x84a3('0x1a')]=function(_0x14bd8c){var _0x874fea=this;return new Promise(function(_0x1adf58,_0x1eb8b0){return db[_0x84a3('0x1b')]['update'](_0x14bd8c[_0x84a3('0x1c')],{'raw':_0x14bd8c[_0x84a3('0x1d')]?_0x14bd8c['options'][_0x84a3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14bd8c['options']?_0x14bd8c['options'][_0x84a3('0x1f')]||null:null,'attributes':_0x14bd8c['options']?_0x14bd8c[_0x84a3('0x1d')][_0x84a3('0x20')]||null:null,'limit':_0x14bd8c[_0x84a3('0x1d')]?_0x14bd8c['options'][_0x84a3('0x21')]||null:null})[_0x84a3('0xf')](function(_0x40d4ec){logger['info'](_0x84a3('0x1a'),_0x14bd8c);logger['debug']('UpdateMailInteraction',_0x14bd8c,JSON['stringify'](_0x40d4ec));_0x1adf58(_0x40d4ec);})[_0x84a3('0x22')](function(_0x568bad){logger[_0x84a3('0x14')]('UpdateMailInteraction',_0x568bad['message'],_0x14bd8c);_0x1eb8b0(_0x874fea[_0x84a3('0x14')](0x1f4,_0x568bad[_0x84a3('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0xcad062){return new Promise(function(_0x27c8ac,_0x3855d5){return db[_0x84a3('0x1b')][_0x84a3('0x23')]({'where':_0xcad062[_0x84a3('0x1d')]?_0xcad062[_0x84a3('0x1d')][_0x84a3('0x1f')]||null:null})[_0x84a3('0xf')](function(_0x2e1a86){if(_0x2e1a86){return _0x2e1a86[_0x84a3('0x24')](_0xcad062[_0x84a3('0x1c')][_0x84a3('0x25')],_['omit'](_0xcad062[_0x84a3('0x1c')],[_0x84a3('0x25'),'id'])||{});}})[_0x84a3('0x26')](function(_0x54ef1d){logger[_0x84a3('0x10')](_0x84a3('0x27'),_0xcad062);logger[_0x84a3('0x11')]('AddTags',_0xcad062,JSON[_0x84a3('0x13')](_0x54ef1d));_0x27c8ac(_0x54ef1d);})[_0x84a3('0x22')](function(_0x5cf7d0){logger[_0x84a3('0x14')](_0x84a3('0x27'),_0x5cf7d0[_0x84a3('0x17')],_0xcad062);_0x3855d5(_this[_0x84a3('0x14')](0x1f4,_0x5cf7d0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index c36940f..da21791 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 _0xe242=['emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','remove','update'];(function(_0x32412a,_0x4fc1c1){var _0x233a77=function(_0x2f36f9){while(--_0x2f36f9){_0x32412a['push'](_0x32412a['shift']());}};_0x233a77(++_0x4fc1c1);}(_0xe242,0x1ad));var _0x2e24=function(_0x5e54c3,_0x4a5891){_0x5e54c3=_0x5e54c3-0x0;var _0x10c050=_0xe242[_0x5e54c3];return _0x10c050;};'use strict';var MailInteractionEvents=require(_0x2e24('0x0'));var events=['save',_0x2e24('0x1'),_0x2e24('0x2')];function createListener(_0x4869a5,_0x289ca0){return function(_0x34f49a){_0x289ca0[_0x2e24('0x3')](_0x4869a5,_0x34f49a);};}function removeListener(_0x47661c,_0xe47714){return function(){MailInteractionEvents[_0x2e24('0x4')](_0x47661c,_0xe47714);};}exports[_0x2e24('0x5')]=function(_0x301ad0){for(var _0x118262=0x0,_0x3dd3ee=events[_0x2e24('0x6')];_0x118262<_0x3dd3ee;_0x118262++){var _0x4e7b22=events[_0x118262];var _0x2bfb73=createListener(_0x2e24('0x7')+_0x4e7b22,_0x301ad0);MailInteractionEvents['on'](_0x4e7b22,_0x2bfb73);}}; \ No newline at end of file +var _0x2572=['removeListener','register','length','mailInteraction:','save','remove','update','emit'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2572,0x10c));var _0x2257=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x2572[_0x484e36];return _0xafc85d;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2257('0x0'),_0x2257('0x1'),_0x2257('0x2')];function createListener(_0x27580f,_0x5f3c38){return function(_0x2f8439){_0x5f3c38[_0x2257('0x3')](_0x27580f,_0x2f8439);};}function removeListener(_0x5349d0,_0x4574f5){return function(){MailInteractionEvents[_0x2257('0x4')](_0x5349d0,_0x4574f5);};}exports[_0x2257('0x5')]=function(_0x2f52f5){for(var _0x14b02d=0x0,_0x1a440c=events[_0x2257('0x6')];_0x14b02d<_0x1a440c;_0x14b02d++){var _0x2b4b6d=events[_0x14b02d];var _0x5c8024=createListener(_0x2257('0x7')+_0x2b4b6d,_0x2f52f5);MailInteractionEvents['on'](_0x2b4b6d,_0x5c8024);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index da70d9d..01e256a 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 _0xbc4a=['delete','exports','multer','util','path','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','accept','reject'];(function(_0xc75e69,_0x19ac94){var _0x447f25=function(_0x25125c){while(--_0x25125c){_0xc75e69['push'](_0xc75e69['shift']());}};_0x447f25(++_0x19ac94);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x300f01,_0x3698b7){_0x300f01=_0x300f01-0x0;var _0x8b2f7a=_0xbc4a[_0x300f01];return _0x8b2f7a;};'use strict';var multer=require(_0xabc4('0x0'));var util=require(_0xabc4('0x1'));var path=require(_0xabc4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xabc4('0x3'));var config=require('../../config/environment');var controller=require(_0xabc4('0x4'));router[_0xabc4('0x5')]('/',auth[_0xabc4('0x6')](),controller[_0xabc4('0x7')]);router[_0xabc4('0x5')](_0xabc4('0x8'),auth[_0xabc4('0x6')](),controller[_0xabc4('0x9')]);router[_0xabc4('0x5')](_0xabc4('0xa'),auth[_0xabc4('0x6')](),controller[_0xabc4('0xb')]);router[_0xabc4('0x5')](_0xabc4('0xc'),auth[_0xabc4('0x6')](),controller[_0xabc4('0xd')]);router[_0xabc4('0xe')]('/',auth[_0xabc4('0x6')](),interaction[_0xabc4('0xf')](_0xabc4('0x10'),_0xabc4('0x11')),controller[_0xabc4('0x12')]);router[_0xabc4('0x13')](_0xabc4('0xa'),auth[_0xabc4('0x6')](),controller[_0xabc4('0x14')]);router[_0xabc4('0x13')]('/:id/accept',auth[_0xabc4('0x6')](),controller[_0xabc4('0x15')]);router['put']('/:id/reject',auth[_0xabc4('0x6')](),controller[_0xabc4('0x16')]);router[_0xabc4('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xabc4('0x18')]=router; \ No newline at end of file +var _0x62c0=['util','path','connect-timeout','../../components/auth/service','../../config/environment','./mailMessage.controller','get','index','isAuthenticated','/:id','show','/:id/download','post','tracked','mail','put','accept','/:id/reject','reject','multer'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x62c0,0xdb));var _0x062c=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0x62c0[_0x69a451];return _0x3d6ef5;};'use strict';var multer=require(_0x062c('0x0'));var util=require(_0x062c('0x1'));var path=require(_0x062c('0x2'));var timeout=require(_0x062c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x062c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x062c('0x5'));var controller=require(_0x062c('0x6'));router[_0x062c('0x7')]('/',auth['isAuthenticated'](),controller[_0x062c('0x8')]);router[_0x062c('0x7')]('/describe',auth[_0x062c('0x9')](),controller['describe']);router[_0x062c('0x7')](_0x062c('0xa'),auth[_0x062c('0x9')](),controller[_0x062c('0xb')]);router[_0x062c('0x7')](_0x062c('0xc'),auth[_0x062c('0x9')](),controller['download']);router[_0x062c('0xd')]('/',auth[_0x062c('0x9')](),interaction[_0x062c('0xe')](_0x062c('0xf'),'mailmessage:create'),controller['create']);router[_0x062c('0x10')](_0x062c('0xa'),auth[_0x062c('0x9')](),controller['update']);router[_0x062c('0x10')]('/:id/accept',auth[_0x062c('0x9')](),controller[_0x062c('0x11')]);router[_0x062c('0x10')](_0x062c('0x12'),auth[_0x062c('0x9')](),controller[_0x062c('0x13')]);router['delete'](_0x062c('0xa'),auth[_0x062c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 768b536..63aa2b8 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 _0x3800=['out','STRING','DATE','INTEGER','exports','TEXT','long','medium','BOOLEAN','ENUM'];(function(_0x26574b,_0x1c8728){var _0x14f025=function(_0x53f910){while(--_0x53f910){_0x26574b['push'](_0x26574b['shift']());}};_0x14f025(++_0x1c8728);}(_0x3800,0x68));var _0x0380=function(_0x14c872,_0x31176a){_0x14c872=_0x14c872-0x0;var _0x8fa41=_0x3800[_0x14c872];return _0x8fa41;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x0380('0x0')]={'body':{'type':Sequelize[_0x0380('0x1')](_0x0380('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0380('0x1')](_0x0380('0x3'))},'read':{'type':Sequelize[_0x0380('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0380('0x5')]('in',_0x0380('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x0380('0x7')](0x1fe)},'from':{'type':Sequelize[_0x0380('0x7')]},'to':{'type':Sequelize['TEXT'](_0x0380('0x2'))},'cc':{'type':Sequelize[_0x0380('0x1')](_0x0380('0x2'))},'bcc':{'type':Sequelize[_0x0380('0x1')](_0x0380('0x2'))},'subject':{'type':Sequelize[_0x0380('0x1')]},'sentAt':{'type':Sequelize[_0x0380('0x8')]},'attach':{'type':Sequelize[_0x0380('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0380('0x8')]},'originTo':{'type':Sequelize[_0x0380('0x1')]('long')},'originCc':{'type':Sequelize[_0x0380('0x1')]('long')},'originChannel':{'type':Sequelize[_0x0380('0x5')]('Email','Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x14e2=['sequelize','lodash','exports','TEXT','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email','Chat'];(function(_0x4dbbeb,_0x1b94e8){var _0x275605=function(_0x56cd2f){while(--_0x56cd2f){_0x4dbbeb['push'](_0x4dbbeb['shift']());}};_0x275605(++_0x1b94e8);}(_0x14e2,0x1ba));var _0x214e=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x14e2[_0x18abd2];return _0x1dcad6;};'use strict';var Sequelize=require(_0x214e('0x0'));var _=require(_0x214e('0x1'));module[_0x214e('0x2')]={'body':{'type':Sequelize[_0x214e('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x214e('0x3')]('medium')},'read':{'type':Sequelize[_0x214e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x214e('0x5')]('in',_0x214e('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x214e('0x7')](0x1fe)},'from':{'type':Sequelize[_0x214e('0x7')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT'](_0x214e('0x8'))},'bcc':{'type':Sequelize[_0x214e('0x3')](_0x214e('0x8'))},'subject':{'type':Sequelize[_0x214e('0x3')]},'sentAt':{'type':Sequelize[_0x214e('0x9')]},'attach':{'type':Sequelize[_0x214e('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x214e('0x9')]},'originTo':{'type':Sequelize[_0x214e('0x3')](_0x214e('0x8'))},'originCc':{'type':Sequelize['TEXT'](_0x214e('0x8'))},'originChannel':{'type':Sequelize[_0x214e('0x5')](_0x214e('0xb'),_0x214e('0xc')),'defaultValue':_0x214e('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 82e99f9..c6fa941 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 _0x8d89=['CmList','List','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','user','pass','attachments','join','root','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','accept','fromString','EventManager','acceptmessage','reject','rejectMessage','event','rejectmessage','toString','server','files','tmp','message-%s.eml','from','Attachment','Attachments','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','./mailMessage.socket','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','undefined','limit','count','Content-Range','update','destroy','end','stack','name','send','MailMessage','rawAttributes','fieldName','key','model','map','keys','intersection','query','attributes','length','nolimit','offset','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','fields','includeAll','find','body','params','create','direction','secret','MailAccount'];(function(_0x2fc5d4,_0x514199){var _0x3b273c=function(_0x46665a){while(--_0x46665a){_0x2fc5d4['push'](_0x2fc5d4['shift']());}};_0x3b273c(++_0x514199);}(_0x8d89,0x193));var _0x98d8=function(_0x2759ee,_0x2a755c){_0x2759ee=_0x2759ee-0x0;var _0x56e6e5=_0x8d89[_0x2759ee];return _0x56e6e5;};'use strict';var emlformat=require(_0x98d8('0x0'));var moment=require('moment');var BPromise=require(_0x98d8('0x1'));var util=require(_0x98d8('0x2'));var path=require(_0x98d8('0x3'));var fs=require('fs');var _=require(_0x98d8('0x4'));var Redis=require(_0x98d8('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x98d8('0x6'));var logger=require(_0x98d8('0x7'))('api');var interaction_log=require(_0x98d8('0x7'))('mail-interactions');var config=require(_0x98d8('0x8'));var db=require(_0x98d8('0x9'))['db'];config[_0x98d8('0xa')]=_['defaults'](config[_0x98d8('0xa')],{'host':_0x98d8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x98d8('0xc'))['register'](socket);var jayson=require(_0x98d8('0xd'));var client=jayson['client'][_0x98d8('0xe')]({'port':0x232c});var client9003=jayson[_0x98d8('0xf')]['http']({'port':0x232b});var client9002=jayson['client'][_0x98d8('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x2cc659,_0x1a406a,_0x34ce21,_0x113226){return new BPromise(function(_0xae0c7,_0x568ad9){var _0x5d355b=_0x113226||client;return _0x5d355b[_0x98d8('0x10')](_0x2cc659,_0x34ce21)[_0x98d8('0x11')](function(_0x31220f){logger[_0x98d8('0x12')](_0x98d8('0x13'),_0x1a406a,_0x98d8('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x1a406a,_0x98d8('0x14'),JSON[_0x98d8('0x15')](_0x31220f));if(_0x31220f[_0x98d8('0x16')]){if(_0x31220f[_0x98d8('0x16')][_0x98d8('0x17')]===0x1f4){logger[_0x98d8('0x16')](_0x98d8('0x13'),_0x1a406a,_0x31220f['error'][_0x98d8('0x18')]);return _0x568ad9(_0x31220f[_0x98d8('0x16')][_0x98d8('0x18')]);}logger[_0x98d8('0x16')]('MailMessage,\x20%s,\x20%s',_0x1a406a,_0x31220f[_0x98d8('0x16')][_0x98d8('0x18')]);return _0xae0c7(_0x31220f[_0x98d8('0x16')][_0x98d8('0x18')]);}else{logger[_0x98d8('0x12')](_0x98d8('0x13'),_0x1a406a,_0x98d8('0x14'));_0xae0c7(_0x31220f[_0x98d8('0x19')][_0x98d8('0x18')]);}})[_0x98d8('0x1a')](function(_0x4b2a10){logger['error'](_0x98d8('0x13'),_0x1a406a,_0x4b2a10);_0x568ad9(_0x4b2a10);});});}function respondWithResult(_0x3d105b,_0x5b5c47){_0x5b5c47=_0x5b5c47||0xc8;return function(_0x4e58d6){if(_0x4e58d6){return _0x3d105b[_0x98d8('0x1b')](_0x5b5c47)[_0x98d8('0x1c')](_0x4e58d6);}};}function respondWithFilteredResult(_0x19dda5,_0x2b3ecd){return function(_0x4e533f){if(_0x4e533f){var _0x355941=typeof _0x2b3ecd['offset']===_0x98d8('0x1d')&&typeof _0x2b3ecd[_0x98d8('0x1e')]==='undefined';var _0x556aba=_0x4e533f['count'];var _0x2477aa=_0x355941?0x0:_0x2b3ecd['offset'];var _0x4e1062=_0x355941?_0x4e533f[_0x98d8('0x1f')]:_0x2b3ecd['offset']+_0x2b3ecd[_0x98d8('0x1e')];var _0x296781;if(_0x4e1062>=_0x556aba){_0x4e1062=_0x556aba;_0x296781=0xc8;}else{_0x296781=0xce;}_0x19dda5['status'](_0x296781);return _0x19dda5['set'](_0x98d8('0x20'),_0x2477aa+'-'+_0x4e1062+'/'+_0x556aba)['json'](_0x4e533f);}return null;};}function saveUpdates(_0xa66bbf){return function(_0x76fc7c){if(_0x76fc7c){return _0x76fc7c[_0x98d8('0x21')](_0xa66bbf)['then'](function(_0x12084f){return _0x12084f;});}return null;};}function removeEntity(_0x7dc130){return function(_0x449b42){if(_0x449b42){return _0x449b42[_0x98d8('0x22')]()[_0x98d8('0x11')](function(){_0x7dc130[_0x98d8('0x1b')](0xcc)[_0x98d8('0x23')]();});}};}function handleEntityNotFound(_0x56fee0){return function(_0x2502cd){if(!_0x2502cd){_0x56fee0['sendStatus'](0x194);}return _0x2502cd;};}function handleError(_0x39e5ae,_0x4ce1b0){_0x4ce1b0=_0x4ce1b0||0x1f4;return function(_0x48ad28){logger[_0x98d8('0x16')](_0x48ad28[_0x98d8('0x24')]);if(_0x48ad28[_0x98d8('0x25')]){delete _0x48ad28[_0x98d8('0x25')];}_0x39e5ae['status'](_0x4ce1b0)[_0x98d8('0x26')](_0x48ad28);};}exports['index']=function(_0xc7afae,_0x241b53){var _0x170b9a={},_0x388ab9={},_0x474b2b={'count':0x0,'rows':[]};var _0x579f55=_['map'](db[_0x98d8('0x27')][_0x98d8('0x28')],function(_0x4f7b2c){return{'name':_0x4f7b2c[_0x98d8('0x29')],'type':_0x4f7b2c['type'][_0x98d8('0x2a')]};});_0x388ab9[_0x98d8('0x2b')]=_[_0x98d8('0x2c')](_0x579f55,_0x98d8('0x25'));_0x388ab9['query']=_[_0x98d8('0x2d')](_0xc7afae['query']);_0x388ab9['filters']=_[_0x98d8('0x2e')](_0x388ab9[_0x98d8('0x2b')],_0x388ab9[_0x98d8('0x2f')]);_0x170b9a[_0x98d8('0x30')]=_[_0x98d8('0x2e')](_0x388ab9['model'],qs['fields'](_0xc7afae['query']['fields']));_0x170b9a[_0x98d8('0x30')]=_0x170b9a[_0x98d8('0x30')][_0x98d8('0x31')]?_0x170b9a['attributes']:_0x388ab9[_0x98d8('0x2b')];if(!_0xc7afae['query']['hasOwnProperty'](_0x98d8('0x32'))){_0x170b9a['limit']=qs['limit'](_0xc7afae[_0x98d8('0x2f')][_0x98d8('0x1e')]);_0x170b9a[_0x98d8('0x33')]=qs[_0x98d8('0x33')](_0xc7afae[_0x98d8('0x2f')][_0x98d8('0x33')]);}_0x170b9a[_0x98d8('0x34')]=qs['sort'](_0xc7afae[_0x98d8('0x2f')][_0x98d8('0x35')]);_0x170b9a[_0x98d8('0x36')]=qs[_0x98d8('0x37')](_[_0x98d8('0x38')](_0xc7afae[_0x98d8('0x2f')],_0x388ab9[_0x98d8('0x37')]),_0x579f55);if(_0xc7afae[_0x98d8('0x2f')][_0x98d8('0x39')]){_0x170b9a[_0x98d8('0x36')]=_[_0x98d8('0x3a')](_0x170b9a[_0x98d8('0x36')],{'$or':_[_0x98d8('0x2c')](_0x579f55,function(_0x286e78){if(_0x286e78[_0x98d8('0x3b')]!==_0x98d8('0x3c')){var _0x5b8462={};_0x5b8462[_0x286e78[_0x98d8('0x25')]]={'$like':'%'+_0xc7afae[_0x98d8('0x2f')][_0x98d8('0x39')]+'%'};return _0x5b8462;}})});}_0x170b9a=_[_0x98d8('0x3a')]({},_0x170b9a,_0xc7afae[_0x98d8('0x3d')]);var _0x2de155={'where':_0x170b9a[_0x98d8('0x36')]};return db[_0x98d8('0x27')][_0x98d8('0x1f')](_0x2de155)[_0x98d8('0x11')](function(_0x2355a1){_0x474b2b[_0x98d8('0x1f')]=_0x2355a1;if(_0xc7afae[_0x98d8('0x2f')]['includeAll']){_0x170b9a[_0x98d8('0x3e')]=[{'all':!![]}];}return db[_0x98d8('0x27')][_0x98d8('0x3f')](_0x170b9a);})[_0x98d8('0x11')](function(_0x4eedcf){_0x474b2b[_0x98d8('0x40')]=_0x4eedcf;return _0x474b2b;})['then'](respondWithFilteredResult(_0x241b53,_0x170b9a))[_0x98d8('0x1a')](handleError(_0x241b53,null));};exports['show']=function(_0x239ffb,_0x5217fa){var _0x21ab0a={'raw':!![],'where':{'id':_0x239ffb['params']['id']}},_0x38387b={};_0x38387b[_0x98d8('0x2b')]=_[_0x98d8('0x2d')](db[_0x98d8('0x27')][_0x98d8('0x28')]);_0x38387b['query']=_[_0x98d8('0x2d')](_0x239ffb['query']);_0x38387b[_0x98d8('0x37')]=_['intersection'](_0x38387b[_0x98d8('0x2b')],_0x38387b[_0x98d8('0x2f')]);_0x21ab0a[_0x98d8('0x30')]=_[_0x98d8('0x2e')](_0x38387b['model'],qs[_0x98d8('0x41')](_0x239ffb[_0x98d8('0x2f')][_0x98d8('0x41')]));_0x21ab0a[_0x98d8('0x30')]=_0x21ab0a['attributes']['length']?_0x21ab0a[_0x98d8('0x30')]:_0x38387b[_0x98d8('0x2b')];if(_0x239ffb[_0x98d8('0x2f')][_0x98d8('0x42')]){_0x21ab0a[_0x98d8('0x3e')]=[{'all':!![]}];}_0x21ab0a=_[_0x98d8('0x3a')]({},_0x21ab0a,_0x239ffb[_0x98d8('0x3d')]);return db[_0x98d8('0x27')][_0x98d8('0x43')](_0x21ab0a)[_0x98d8('0x11')](handleEntityNotFound(_0x5217fa,null))['then'](respondWithResult(_0x5217fa,null))[_0x98d8('0x1a')](handleError(_0x5217fa,null));};exports[_0x98d8('0x21')]=function(_0x2a32fd,_0x3056af){if(_0x2a32fd['body']['id']){delete _0x2a32fd[_0x98d8('0x44')]['id'];}return db[_0x98d8('0x27')][_0x98d8('0x43')]({'where':{'id':_0x2a32fd[_0x98d8('0x45')]['id']}})[_0x98d8('0x11')](handleEntityNotFound(_0x3056af,null))[_0x98d8('0x11')](saveUpdates(_0x2a32fd['body'],null))[_0x98d8('0x11')](respondWithResult(_0x3056af,null))['catch'](handleError(_0x3056af,null));};exports[_0x98d8('0x22')]=function(_0x4c622b,_0x2cd4f4){return db[_0x98d8('0x27')]['find']({'where':{'id':_0x4c622b[_0x98d8('0x45')]['id']}})[_0x98d8('0x11')](handleEntityNotFound(_0x2cd4f4,null))[_0x98d8('0x11')](removeEntity(_0x2cd4f4,null))[_0x98d8('0x1a')](handleError(_0x2cd4f4,null));};exports['describe']=function(_0x3d4688,_0x7a6b51){return db[_0x98d8('0x27')]['describe']()['then'](respondWithResult(_0x7a6b51,null))['catch'](handleError(_0x7a6b51,null));};exports[_0x98d8('0x46')]=function(_0x42e451,_0x2b926d){return db[_0x98d8('0x27')][_0x98d8('0x46')](_0x42e451[_0x98d8('0x44')])[_0x98d8('0x11')](function(_0x4eac5c){if(_0x4eac5c){if(_0x4eac5c[_0x98d8('0x47')]==='out'&&!_0x4eac5c[_0x98d8('0x48')]){var _0xa73afb,_0x5a3c3d,_0x28bbe5;if(_0x42e451[_0x98d8('0x44')]['to']){_0x5a3c3d=_0x42e451[_0x98d8('0x44')]['to']['split'](',')[0x0];}return db[_0x98d8('0x49')]['findOne']({'where':{'id':_0x4eac5c['MailAccountId']},'include':[{'model':db[_0x98d8('0x4a')],'as':_0x98d8('0x4b'),'include':[{'model':db[_0x98d8('0x4c')],'as':_0x98d8('0x4d'),'where':{'email':_0x5a3c3d},'limit':0x1,'order':[[_0x98d8('0x4e'),_0x98d8('0x4f')]]}]},{'model':db['MailServerOut'],'as':_0x98d8('0x50'),'raw':!![]}]})[_0x98d8('0x11')](function(_0x296d6d){_0xa73afb=_0x296d6d;if(_0xa73afb&&_0xa73afb['Smtp']){var _0x24da50={'tls':{'rejectUnauthorized':![]}};if(_[_0x98d8('0x51')](_0xa73afb[_0x98d8('0x50')][_0x98d8('0x52')])){_0x24da50[_0x98d8('0x53')]=_0xa73afb[_0x98d8('0x50')][_0x98d8('0x53')];_0x24da50[_0x98d8('0x54')]=_0xa73afb[_0x98d8('0x50')][_0x98d8('0x54')];_0x24da50[_0x98d8('0x55')]=_0xa73afb[_0x98d8('0x50')][_0x98d8('0x55')];if(_0xa73afb[_0x98d8('0x50')][_0x98d8('0x56')]){_0x24da50['auth']={'user':_0xa73afb['Smtp'][_0x98d8('0x57')],'pass':_0xa73afb[_0x98d8('0x50')]['pass']};}}else{_0x24da50[_0x98d8('0x52')]=_0xa73afb[_0x98d8('0x50')][_0x98d8('0x52')];_0x24da50['auth']={'user':_0xa73afb[_0x98d8('0x50')][_0x98d8('0x57')],'pass':_0xa73afb[_0x98d8('0x50')][_0x98d8('0x58')]};_0x24da50['secure']=_0xa73afb[_0x98d8('0x50')]['secure'];}if(_0x42e451[_0x98d8('0x44')][_0x98d8('0x59')]&&_0x42e451['body'][_0x98d8('0x59')][_0x98d8('0x31')]){for(var _0x544b91=0x0;_0x544b91<_0x42e451[_0x98d8('0x44')][_0x98d8('0x59')][_0x98d8('0x31')];_0x544b91+=0x1){_0x42e451[_0x98d8('0x44')][_0x98d8('0x59')][_0x544b91]={'filename':_0x42e451[_0x98d8('0x44')][_0x98d8('0x59')][_0x544b91][_0x98d8('0x25')],'path':path[_0x98d8('0x5a')](config[_0x98d8('0x5b')],_0x98d8('0x5c'),_0x42e451[_0x98d8('0x44')][_0x98d8('0x59')][_0x544b91][_0x98d8('0x5d')])};}}_0x28bbe5={'account':_0x24da50,'message':_0x42e451[_0x98d8('0x44')]};return;}})['then'](function(){if(_0xa73afb[_0x98d8('0x4b')]){if(_0xa73afb[_0x98d8('0x4b')]['Contacts'][_0x98d8('0x31')]){return _0xa73afb['List']['Contacts'][0x0];}else{return db['CmContact'][_0x98d8('0x46')](_[_0x98d8('0x5e')](_0x42e451[_0x98d8('0x44')],{'firstName':_0x42e451['body']['to'],'email':_0x42e451['body']['to'],'phone':_0x42e451[_0x98d8('0x44')]['to'],'ListId':_0xa73afb[_0x98d8('0x5f')]}));}}else{throw new Error(_0x98d8('0x60'));}})['then'](function(){if(_0x28bbe5){return respondWithRpcPromise(_0x98d8('0x61'),'sendMail',_0x28bbe5,client9003)['then'](function(_0x5a6ce2){return _0x4eac5c[_0x98d8('0x21')]({'read':!![],'messageId':_0x5a6ce2[_0x98d8('0x62')],'sentAt':moment()[_0x98d8('0x63')](_0x98d8('0x64'))});})[_0x98d8('0x1a')](function(_0x193b6b){logger['error']('%s',JSON[_0x98d8('0x15')](_0x193b6b));return _0x4eac5c;});}return _0x4eac5c;});}return _0x4eac5c;}})['then'](respondWithResult(_0x2b926d,0xc9))[_0x98d8('0x1a')](handleError(_0x2b926d,null));};exports['accept']=function(_0x4b822c,_0xe6762){var _0x4315b9={'agent':{},'channel':_0x98d8('0x65')};if(_0x4b822c['body']['id']){delete _0x4b822c[_0x98d8('0x44')]['id'];}_0x4b822c[_0x98d8('0x44')][_0x98d8('0x66')]=!![];_0x4b822c[_0x98d8('0x44')]['readAt']=moment()[_0x98d8('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b822c[_0x98d8('0x44')][_0x98d8('0x67')]=_0x4b822c[_0x98d8('0x44')][_0x98d8('0x67')]||_0x4b822c['user']['id'];_0x4315b9[_0x98d8('0x68')]['id']=_0x4b822c['body'][_0x98d8('0x67')];return db['MailMessage'][_0x98d8('0x43')]({'where':{'id':_0x4b822c[_0x98d8('0x45')]['id'],'UserId':null}})[_0x98d8('0x11')](handleEntityNotFound(_0xe6762,null))['then'](saveUpdates(_0x4b822c[_0x98d8('0x44')],null))['then'](function(_0x4b610b){if(_0x4b610b){_0x4315b9[_0x98d8('0x18')]=_0x4b610b[_0x98d8('0x69')]({'plain':!![]});return db[_0x98d8('0x6a')][_0x98d8('0x43')]({'where':{'id':_0x4b610b[_0x98d8('0x6b')]}});}return null;})[_0x98d8('0x11')](handleEntityNotFound(_0xe6762,null))[_0x98d8('0x11')](function(_0x12b1ae){if(_0x12b1ae){return _0x12b1ae[_0x98d8('0x21')]({'UserId':_0x4b822c[_0x98d8('0x44')][_0x98d8('0x67')],'read1stAt':_['isNil'](_0x12b1ae[_0x98d8('0x6c')])?moment()[_0x98d8('0x63')](_0x98d8('0x64')):undefined});}return null;})[_0x98d8('0x11')](function(_0x34291d){if(_0x34291d){_0x4315b9[_0x98d8('0x6d')]=_0x34291d[_0x98d8('0x69')]({'plain':!![]});interaction_log[_0x98d8('0x12')](_0x98d8('0x6e'),_0x4b822c[_0x98d8('0x57')]['id'],_0x4b822c[_0x98d8('0x57')]['name'],_0x4b822c[_0x98d8('0x57')][_0x98d8('0x6f')],_0x4315b9['interaction']['id'],_0x4b822c['body']?JSON[_0x98d8('0x15')](_0x4b822c[_0x98d8('0x44')]):_0x98d8('0x70'));return respondWithRpcPromise(_0x98d8('0x71'),_0x98d8('0x72'),_0x4315b9);}return null;})['then'](function(_0x4871a2){var _0x3a7e77=_0x98d8('0x73')+_0x4871a2[_0x98d8('0x18')][_0x98d8('0x74')];return db[_0x98d8('0x75')][_0x98d8('0x2f')](_0x3a7e77,{'type':db[_0x98d8('0x76')][_0x98d8('0x77')][_0x98d8('0x78')],'raw':!![]})[_0x98d8('0x11')](function(_0x452502){return _0x452502;});})['then'](function(_0x35c882){if(_0x35c882){_0x4315b9['message'][_0x98d8('0x79')]=_0x35c882[0x0];if(!_0x4b822c[_0x98d8('0x44')][_0x98d8('0x67')])return;return db[_0x98d8('0x7a')][_0x98d8('0x43')]({'where':{'id':_0x4b822c['body'][_0x98d8('0x67')],'role':_0x98d8('0x68')},'attributes':['id',_0x98d8('0x25'),_0x98d8('0x7b'),_0x98d8('0x7c'),_0x98d8('0x7d')],'raw':!![]});}return null;})[_0x98d8('0x11')](function(_0x3bf46e){if(!_0x3bf46e)return null;_0x4315b9[_0x98d8('0x18')][_0x98d8('0x68')]=_0x3bf46e;return _0x4315b9;})[_0x98d8('0x11')](function(_0x318d8e){if(_0x318d8e){if(_0x4b822c['body']['manual']){_0x4315b9[_0x98d8('0x18')][_0x98d8('0x7e')]=util['format'](_0x98d8('0x7f'),_0x4b822c['user'][_0x98d8('0x25')]);_0x4315b9[_0x98d8('0x18')][_0x98d8('0x80')]=_0x4315b9[_0x98d8('0x80')];_0x4315b9[_0x98d8('0x18')][_0x98d8('0x81')]=_0x4315b9['channel'];_0x4315b9[_0x98d8('0x18')]['event']=_0x98d8('0x82');_0x4315b9[_0x98d8('0x18')][_0x98d8('0x44')]=htmlToText[_0x98d8('0x83')](_0x4315b9[_0x98d8('0x18')]['body']);return respondWithRpcPromise(_0x98d8('0x84'),_0x98d8('0x84'),{'event':_0x98d8('0x85'),'message':_0x4315b9[_0x98d8('0x18')]},client9002)[_0x98d8('0x11')](function(){return _0x4315b9;});}return _0x4315b9;}return null;})['then'](respondWithResult(_0xe6762,null))[_0x98d8('0x1a')](handleError(_0xe6762,null));};exports[_0x98d8('0x86')]=function(_0x119697,_0xd263c4){var _0x4df7bb={'agent':{},'channel':_0x98d8('0x65')};if(_0x119697[_0x98d8('0x44')]['id']){delete _0x119697['body']['id'];}_0x119697['body'][_0x98d8('0x67')]=_0x119697[_0x98d8('0x44')][_0x98d8('0x67')]||_0x119697['user']['id'];_0x4df7bb['agent']['id']=_0x119697[_0x98d8('0x44')][_0x98d8('0x67')];return db['MailMessage'][_0x98d8('0x43')]({'where':{'id':_0x119697['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xd263c4,null))[_0x98d8('0x11')](function(_0x4279ea){if(_0x4279ea){_0x4df7bb[_0x98d8('0x18')]=_0x4279ea[_0x98d8('0x69')]({'plain':!![]});return db['MailInteraction'][_0x98d8('0x43')]({'where':{'id':_0x4279ea[_0x98d8('0x6b')]}});}return null;})[_0x98d8('0x11')](handleEntityNotFound(_0xd263c4,null))['then'](function(_0x3f85cb){if(_0x3f85cb){_0x4df7bb[_0x98d8('0x6d')]=_0x3f85cb[_0x98d8('0x69')]({'plain':!![]});interaction_log[_0x98d8('0x12')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x119697[_0x98d8('0x57')]['id'],_0x119697[_0x98d8('0x57')][_0x98d8('0x25')],_0x119697[_0x98d8('0x57')][_0x98d8('0x6f')],_0x4df7bb[_0x98d8('0x6d')]['id'],_0x119697[_0x98d8('0x44')]?JSON['stringify'](_0x119697[_0x98d8('0x44')]):'null');return respondWithRpcPromise('RejectMessage',_0x98d8('0x87'),_0x4df7bb);}return null;})[_0x98d8('0x11')](function(_0x15f4f4){var _0x10fc7f=_0x98d8('0x73')+_0x15f4f4['message'][_0x98d8('0x74')];return db[_0x98d8('0x75')][_0x98d8('0x2f')](_0x10fc7f,{'type':db[_0x98d8('0x76')][_0x98d8('0x77')]['SELECT'],'raw':!![]})['then'](function(_0xdc9536){return _0xdc9536;});})[_0x98d8('0x11')](function(_0x20125a){if(_0x20125a){_0x4df7bb['message'][_0x98d8('0x79')]=_0x20125a[0x0];if(!_0x119697[_0x98d8('0x44')]['UserId'])return;return db[_0x98d8('0x7a')][_0x98d8('0x43')]({'where':{'id':_0x119697[_0x98d8('0x44')][_0x98d8('0x67')],'role':'agent'},'attributes':['id','name',_0x98d8('0x7b'),_0x98d8('0x7c'),'internal'],'raw':!![]});}return null;})[_0x98d8('0x11')](function(_0x3b5741){if(!_0x3b5741)return null;_0x4df7bb['message'][_0x98d8('0x68')]=_0x3b5741;return _0x4df7bb;})[_0x98d8('0x11')](function(_0x3ceed2){if(_0x3ceed2){_0x3ceed2[_0x98d8('0x18')][_0x98d8('0x7e')]=util[_0x98d8('0x63')](_0x98d8('0x7f'),_0x119697[_0x98d8('0x57')][_0x98d8('0x25')]);_0x3ceed2['message'][_0x98d8('0x80')]=_0x4df7bb[_0x98d8('0x80')];_0x3ceed2[_0x98d8('0x18')][_0x98d8('0x81')]=_0x4df7bb[_0x98d8('0x80')];_0x3ceed2[_0x98d8('0x18')][_0x98d8('0x88')]=_0x98d8('0x86');_0x3ceed2['message'][_0x98d8('0x44')]=htmlToText[_0x98d8('0x83')](_0x4df7bb[_0x98d8('0x18')]['body']);respondWithRpcPromise(_0x98d8('0x84'),'EventManager',{'event':_0x98d8('0x89'),'message':_0x3ceed2['message']},client9002);return _0x4df7bb;}return null;})[_0x98d8('0x11')](respondWithResult(_0xd263c4,null))[_0x98d8('0x1a')](handleError(_0xd263c4,null));};exports['download']=function(_0x225cd3,_0x2a92bb){var _0x44716d=moment()['unix']()[_0x98d8('0x8a')]();var _0x474138=path[_0x98d8('0x5a')](config[_0x98d8('0x5b')],_0x98d8('0x8b'),_0x98d8('0x8c'),_0x98d8('0x8d'));var _0xda047c=path[_0x98d8('0x5a')](config['root'],'server',_0x98d8('0x8c'),'attachments');var _0x1ef89a=util[_0x98d8('0x63')](_0x98d8('0x8e'),_0x44716d);return db[_0x98d8('0x27')][_0x98d8('0x43')]({'where':{'id':_0x225cd3[_0x98d8('0x45')]['id']},'attributes':['id',_0x98d8('0x44'),_0x98d8('0x8f'),'to','cc','bcc','subject','createdAt'],'include':_0x225cd3[_0x98d8('0x2f')][_0x98d8('0x59')]?[{'model':db[_0x98d8('0x90')],'as':_0x98d8('0x91')}]:undefined})[_0x98d8('0x11')](handleEntityNotFound(_0x2a92bb,null))[_0x98d8('0x11')](function(_0x5d3898){if(_0x5d3898){var _0x2613f3=_0x5d3898;var _0x38781f={'from':_0x2613f3[_0x98d8('0x8f')],'to':_0x2613f3['to'],'subject':_0x2613f3[_0x98d8('0x92')],'html':_0x2613f3[_0x98d8('0x44')],'headers':{'Date':moment(_0x2613f3[_0x98d8('0x93')])[_0x98d8('0x63')](_0x98d8('0x94'))},'attachments':[]};if(_0x5d3898['cc']){_0x38781f['headers']['Cc']=_0x5d3898['cc'];}if(_0x5d3898[_0x98d8('0x95')]){_0x38781f[_0x98d8('0x96')][_0x98d8('0x97')]=_0x5d3898[_0x98d8('0x95')];}return new BPromise(function(_0x3f9a1a,_0x17a7f4){if(_0x5d3898[_0x98d8('0x91')]){for(var _0x6f9133=0x0;_0x6f9133<_0x5d3898[_0x98d8('0x91')]['length'];_0x6f9133++){var _0x370744=_0x5d3898[_0x98d8('0x91')][_0x6f9133];var _0x4b1412=path[_0x98d8('0x5a')](_0xda047c,_0x370744[_0x98d8('0x5d')]);if(fs[_0x98d8('0x98')](_0x4b1412)){_0x38781f['attachments'][_0x98d8('0x99')]({'name':_0x370744[_0x98d8('0x25')],'contentType':_0x370744[_0x98d8('0x3b')],'data':fs[_0x98d8('0x9a')](_0x4b1412)});}}}emlformat[_0x98d8('0x9b')](_0x38781f,function(_0x5dfe36,_0x52a88f){if(_0x5dfe36)return _0x17a7f4(_0x5dfe36);fs[_0x98d8('0x9c')](path[_0x98d8('0x5a')](_0x474138,_0x1ef89a),_0x52a88f);return _0x3f9a1a(_0x52a88f);});});}})[_0x98d8('0x11')](function(_0x55cf5d){if(_0x55cf5d){return _0x2a92bb[_0x98d8('0x9d')](path[_0x98d8('0x5a')](_0x474138,_0x1ef89a),_0x1ef89a,function(_0x3d6a4b){if(!_0x3d6a4b)fs[_0x98d8('0x9e')](path['join'](_0x474138,_0x1ef89a));});}})[_0x98d8('0x1a')](handleError(_0x2a92bb,null));}; \ No newline at end of file +var _0xa496=['../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','undefined','count','limit','set','json','update','destroy','end','sendStatus','name','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','MailMessage','includeAll','findAll','rows','show','params','rawAttributes','options','find','body','describe','create','out','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','role','RejectMessage','rejectMessage','email','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','push','readFileSync','build','writeFileSync','eml-format','moment','util','path','lodash','ioredis','html-to-text'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa496,0x13d));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6a49('0x0'));var moment=require(_0x6a49('0x1'));var BPromise=require('bluebird');var util=require(_0x6a49('0x2'));var path=require(_0x6a49('0x3'));var fs=require('fs');var _=require(_0x6a49('0x4'));var Redis=require(_0x6a49('0x5'));var htmlToText=require(_0x6a49('0x6'));var qs=require(_0x6a49('0x7'));var logger=require(_0x6a49('0x8'))('api');var interaction_log=require('../../config/logger')(_0x6a49('0x9'));var config=require(_0x6a49('0xa'));var db=require(_0x6a49('0xb'))['db'];config['redis']=_[_0x6a49('0xc')](config[_0x6a49('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6a49('0xe'))(new Redis(config[_0x6a49('0xd')]));require(_0x6a49('0xf'))['register'](socket);var jayson=require(_0x6a49('0x10'));var client=jayson[_0x6a49('0x11')][_0x6a49('0x12')]({'port':0x232c});var client9003=jayson[_0x6a49('0x11')][_0x6a49('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x6a49('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x2ee1d5,_0x4ab908,_0x503514,_0x4a3ee9){return new BPromise(function(_0x1de16e,_0x3429a3){var _0x14c0e8=_0x4a3ee9||client;return _0x14c0e8[_0x6a49('0x13')](_0x2ee1d5,_0x503514)[_0x6a49('0x14')](function(_0x14b99c){logger[_0x6a49('0x15')](_0x6a49('0x16'),_0x4ab908,'request\x20sent');logger[_0x6a49('0x17')](_0x6a49('0x18'),_0x4ab908,_0x6a49('0x19'),JSON[_0x6a49('0x1a')](_0x14b99c));if(_0x14b99c[_0x6a49('0x1b')]){if(_0x14b99c[_0x6a49('0x1b')][_0x6a49('0x1c')]===0x1f4){logger[_0x6a49('0x1b')]('MailMessage,\x20%s,\x20%s',_0x4ab908,_0x14b99c[_0x6a49('0x1b')][_0x6a49('0x1d')]);return _0x3429a3(_0x14b99c['error'][_0x6a49('0x1d')]);}logger[_0x6a49('0x1b')](_0x6a49('0x16'),_0x4ab908,_0x14b99c[_0x6a49('0x1b')][_0x6a49('0x1d')]);return _0x1de16e(_0x14b99c[_0x6a49('0x1b')][_0x6a49('0x1d')]);}else{logger[_0x6a49('0x15')](_0x6a49('0x16'),_0x4ab908,'request\x20sent');_0x1de16e(_0x14b99c[_0x6a49('0x1e')][_0x6a49('0x1d')]);}})[_0x6a49('0x1f')](function(_0x53a54d){logger[_0x6a49('0x1b')](_0x6a49('0x16'),_0x4ab908,_0x53a54d);_0x3429a3(_0x53a54d);});});}function respondWithResult(_0x4773c6,_0x2a21a2){_0x2a21a2=_0x2a21a2||0xc8;return function(_0x2ef8d7){if(_0x2ef8d7){return _0x4773c6[_0x6a49('0x20')](_0x2a21a2)['json'](_0x2ef8d7);}};}function respondWithFilteredResult(_0x4d784d,_0x2c2b55){return function(_0x29d75b){if(_0x29d75b){var _0x2006e6=typeof _0x2c2b55[_0x6a49('0x21')]===_0x6a49('0x22')&&typeof _0x2c2b55['limit']==='undefined';var _0x5d26f6=_0x29d75b[_0x6a49('0x23')];var _0x3da845=_0x2006e6?0x0:_0x2c2b55[_0x6a49('0x21')];var _0x223288=_0x2006e6?_0x29d75b[_0x6a49('0x23')]:_0x2c2b55[_0x6a49('0x21')]+_0x2c2b55[_0x6a49('0x24')];var _0x22d24d;if(_0x223288>=_0x5d26f6){_0x223288=_0x5d26f6;_0x22d24d=0xc8;}else{_0x22d24d=0xce;}_0x4d784d[_0x6a49('0x20')](_0x22d24d);return _0x4d784d[_0x6a49('0x25')]('Content-Range',_0x3da845+'-'+_0x223288+'/'+_0x5d26f6)[_0x6a49('0x26')](_0x29d75b);}return null;};}function saveUpdates(_0x3a0cb0){return function(_0x2e4bc7){if(_0x2e4bc7){return _0x2e4bc7[_0x6a49('0x27')](_0x3a0cb0)[_0x6a49('0x14')](function(_0x360d1a){return _0x360d1a;});}return null;};}function removeEntity(_0x3d986e){return function(_0x301363){if(_0x301363){return _0x301363[_0x6a49('0x28')]()[_0x6a49('0x14')](function(){_0x3d986e[_0x6a49('0x20')](0xcc)[_0x6a49('0x29')]();});}};}function handleEntityNotFound(_0x137f42){return function(_0x55b726){if(!_0x55b726){_0x137f42[_0x6a49('0x2a')](0x194);}return _0x55b726;};}function handleError(_0x2b439d,_0x51fb07){_0x51fb07=_0x51fb07||0x1f4;return function(_0x29e2fe){logger[_0x6a49('0x1b')](_0x29e2fe['stack']);if(_0x29e2fe[_0x6a49('0x2b')]){delete _0x29e2fe[_0x6a49('0x2b')];}_0x2b439d[_0x6a49('0x20')](_0x51fb07)['send'](_0x29e2fe);};}exports[_0x6a49('0x2c')]=function(_0xf5f9cf,_0x5b1395){var _0x4e9b28={},_0x624fe3={},_0x12b352={'count':0x0,'rows':[]};var _0x148103=_[_0x6a49('0x2d')](db['MailMessage']['rawAttributes'],function(_0x81f6c3){return{'name':_0x81f6c3['fieldName'],'type':_0x81f6c3[_0x6a49('0x2e')][_0x6a49('0x2f')]};});_0x624fe3[_0x6a49('0x30')]=_[_0x6a49('0x2d')](_0x148103,_0x6a49('0x2b'));_0x624fe3[_0x6a49('0x31')]=_[_0x6a49('0x32')](_0xf5f9cf['query']);_0x624fe3[_0x6a49('0x33')]=_[_0x6a49('0x34')](_0x624fe3[_0x6a49('0x30')],_0x624fe3[_0x6a49('0x31')]);_0x4e9b28[_0x6a49('0x35')]=_[_0x6a49('0x34')](_0x624fe3['model'],qs[_0x6a49('0x36')](_0xf5f9cf[_0x6a49('0x31')][_0x6a49('0x36')]));_0x4e9b28['attributes']=_0x4e9b28[_0x6a49('0x35')][_0x6a49('0x37')]?_0x4e9b28['attributes']:_0x624fe3['model'];if(!_0xf5f9cf[_0x6a49('0x31')]['hasOwnProperty'](_0x6a49('0x38'))){_0x4e9b28[_0x6a49('0x24')]=qs[_0x6a49('0x24')](_0xf5f9cf[_0x6a49('0x31')]['limit']);_0x4e9b28[_0x6a49('0x21')]=qs[_0x6a49('0x21')](_0xf5f9cf[_0x6a49('0x31')]['offset']);}_0x4e9b28[_0x6a49('0x39')]=qs['sort'](_0xf5f9cf[_0x6a49('0x31')][_0x6a49('0x3a')]);_0x4e9b28[_0x6a49('0x3b')]=qs[_0x6a49('0x33')](_[_0x6a49('0x3c')](_0xf5f9cf[_0x6a49('0x31')],_0x624fe3[_0x6a49('0x33')]),_0x148103);if(_0xf5f9cf['query'][_0x6a49('0x3d')]){_0x4e9b28[_0x6a49('0x3b')]=_['merge'](_0x4e9b28['where'],{'$or':_[_0x6a49('0x2d')](_0x148103,function(_0x4909ae){if(_0x4909ae[_0x6a49('0x2e')]!=='VIRTUAL'){var _0x4fb483={};_0x4fb483[_0x4909ae[_0x6a49('0x2b')]]={'$like':'%'+_0xf5f9cf['query'][_0x6a49('0x3d')]+'%'};return _0x4fb483;}})});}_0x4e9b28=_[_0x6a49('0x3e')]({},_0x4e9b28,_0xf5f9cf['options']);var _0x4fdca2={'where':_0x4e9b28[_0x6a49('0x3b')]};return db[_0x6a49('0x3f')][_0x6a49('0x23')](_0x4fdca2)[_0x6a49('0x14')](function(_0x264548){_0x12b352[_0x6a49('0x23')]=_0x264548;if(_0xf5f9cf['query'][_0x6a49('0x40')]){_0x4e9b28['include']=[{'all':!![]}];}return db[_0x6a49('0x3f')][_0x6a49('0x41')](_0x4e9b28);})['then'](function(_0x3dbe09){_0x12b352[_0x6a49('0x42')]=_0x3dbe09;return _0x12b352;})[_0x6a49('0x14')](respondWithFilteredResult(_0x5b1395,_0x4e9b28))[_0x6a49('0x1f')](handleError(_0x5b1395,null));};exports[_0x6a49('0x43')]=function(_0x3b37a8,_0x228975){var _0x4c7f40={'raw':!![],'where':{'id':_0x3b37a8[_0x6a49('0x44')]['id']}},_0xa5ade7={};_0xa5ade7[_0x6a49('0x30')]=_['keys'](db[_0x6a49('0x3f')][_0x6a49('0x45')]);_0xa5ade7[_0x6a49('0x31')]=_[_0x6a49('0x32')](_0x3b37a8[_0x6a49('0x31')]);_0xa5ade7[_0x6a49('0x33')]=_[_0x6a49('0x34')](_0xa5ade7[_0x6a49('0x30')],_0xa5ade7[_0x6a49('0x31')]);_0x4c7f40[_0x6a49('0x35')]=_['intersection'](_0xa5ade7[_0x6a49('0x30')],qs[_0x6a49('0x36')](_0x3b37a8[_0x6a49('0x31')]['fields']));_0x4c7f40[_0x6a49('0x35')]=_0x4c7f40['attributes'][_0x6a49('0x37')]?_0x4c7f40[_0x6a49('0x35')]:_0xa5ade7[_0x6a49('0x30')];if(_0x3b37a8[_0x6a49('0x31')][_0x6a49('0x40')]){_0x4c7f40['include']=[{'all':!![]}];}_0x4c7f40=_[_0x6a49('0x3e')]({},_0x4c7f40,_0x3b37a8[_0x6a49('0x46')]);return db[_0x6a49('0x3f')][_0x6a49('0x47')](_0x4c7f40)[_0x6a49('0x14')](handleEntityNotFound(_0x228975,null))[_0x6a49('0x14')](respondWithResult(_0x228975,null))[_0x6a49('0x1f')](handleError(_0x228975,null));};exports['update']=function(_0x5e071c,_0x5ee421){if(_0x5e071c['body']['id']){delete _0x5e071c[_0x6a49('0x48')]['id'];}return db[_0x6a49('0x3f')]['find']({'where':{'id':_0x5e071c[_0x6a49('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ee421,null))[_0x6a49('0x14')](saveUpdates(_0x5e071c[_0x6a49('0x48')],null))[_0x6a49('0x14')](respondWithResult(_0x5ee421,null))[_0x6a49('0x1f')](handleError(_0x5ee421,null));};exports[_0x6a49('0x28')]=function(_0x77e6b2,_0x11fb06){return db[_0x6a49('0x3f')][_0x6a49('0x47')]({'where':{'id':_0x77e6b2[_0x6a49('0x44')]['id']}})[_0x6a49('0x14')](handleEntityNotFound(_0x11fb06,null))[_0x6a49('0x14')](removeEntity(_0x11fb06,null))[_0x6a49('0x1f')](handleError(_0x11fb06,null));};exports[_0x6a49('0x49')]=function(_0x5857e4,_0x4e12be){return db[_0x6a49('0x3f')][_0x6a49('0x49')]()[_0x6a49('0x14')](respondWithResult(_0x4e12be,null))[_0x6a49('0x1f')](handleError(_0x4e12be,null));};exports['create']=function(_0x537ace,_0x4a24f1){return db['MailMessage'][_0x6a49('0x4a')](_0x537ace[_0x6a49('0x48')])[_0x6a49('0x14')](function(_0x3b6e37){if(_0x3b6e37){if(_0x3b6e37['direction']===_0x6a49('0x4b')&&!_0x3b6e37['secret']){var _0x9134be,_0x379e76,_0x4bde7d;if(_0x537ace[_0x6a49('0x48')]['to']){_0x379e76=_0x537ace['body']['to'][_0x6a49('0x4c')](',')[0x0];}return db['MailAccount'][_0x6a49('0x4d')]({'where':{'id':_0x3b6e37[_0x6a49('0x4e')]},'include':[{'model':db[_0x6a49('0x4f')],'as':_0x6a49('0x50'),'include':[{'model':db[_0x6a49('0x51')],'as':_0x6a49('0x52'),'where':{'email':_0x379e76},'limit':0x1,'order':[[_0x6a49('0x53'),_0x6a49('0x54')]]}]},{'model':db[_0x6a49('0x55')],'as':_0x6a49('0x56'),'raw':!![]}]})[_0x6a49('0x14')](function(_0x41849d){_0x9134be=_0x41849d;if(_0x9134be&&_0x9134be[_0x6a49('0x56')]){var _0x3c93f4={'tls':{'rejectUnauthorized':![]}};if(_[_0x6a49('0x57')](_0x9134be[_0x6a49('0x56')][_0x6a49('0x58')])){_0x3c93f4['host']=_0x9134be['Smtp']['host'];_0x3c93f4['port']=_0x9134be[_0x6a49('0x56')][_0x6a49('0x59')];_0x3c93f4[_0x6a49('0x5a')]=_0x9134be[_0x6a49('0x56')][_0x6a49('0x5a')];if(_0x9134be['Smtp'][_0x6a49('0x5b')]){_0x3c93f4[_0x6a49('0x5c')]={'user':_0x9134be['Smtp'][_0x6a49('0x5d')],'pass':_0x9134be[_0x6a49('0x56')][_0x6a49('0x5e')]};}}else{_0x3c93f4[_0x6a49('0x58')]=_0x9134be[_0x6a49('0x56')][_0x6a49('0x58')];_0x3c93f4['auth']={'user':_0x9134be[_0x6a49('0x56')][_0x6a49('0x5d')],'pass':_0x9134be[_0x6a49('0x56')][_0x6a49('0x5e')]};_0x3c93f4[_0x6a49('0x5a')]=_0x9134be[_0x6a49('0x56')][_0x6a49('0x5a')];}if(_0x537ace[_0x6a49('0x48')][_0x6a49('0x5f')]&&_0x537ace[_0x6a49('0x48')][_0x6a49('0x5f')][_0x6a49('0x37')]){for(var _0xaf72ee=0x0;_0xaf72ee<_0x537ace['body'][_0x6a49('0x5f')][_0x6a49('0x37')];_0xaf72ee+=0x1){_0x537ace[_0x6a49('0x48')][_0x6a49('0x5f')][_0xaf72ee]={'filename':_0x537ace[_0x6a49('0x48')]['attachments'][_0xaf72ee][_0x6a49('0x2b')],'path':path[_0x6a49('0x60')](config[_0x6a49('0x61')],_0x6a49('0x62'),_0x537ace[_0x6a49('0x48')]['attachments'][_0xaf72ee][_0x6a49('0x63')])};}}_0x4bde7d={'account':_0x3c93f4,'message':_0x537ace[_0x6a49('0x48')]};return;}})[_0x6a49('0x14')](function(){if(_0x9134be[_0x6a49('0x50')]){if(_0x9134be[_0x6a49('0x50')][_0x6a49('0x52')][_0x6a49('0x37')]){return _0x9134be['List'][_0x6a49('0x52')][0x0];}else{return db[_0x6a49('0x51')][_0x6a49('0x4a')](_['defaults'](_0x537ace[_0x6a49('0x48')],{'firstName':_0x537ace['body']['to'],'email':_0x537ace[_0x6a49('0x48')]['to'],'phone':_0x537ace[_0x6a49('0x48')]['to'],'ListId':_0x9134be[_0x6a49('0x64')]}));}}else{throw new Error(_0x6a49('0x65'));}})[_0x6a49('0x14')](function(){if(_0x4bde7d){return respondWithRpcPromise(_0x6a49('0x66'),_0x6a49('0x67'),_0x4bde7d,client9003)[_0x6a49('0x14')](function(_0xbf06e3){return _0x3b6e37[_0x6a49('0x27')]({'read':!![],'messageId':_0xbf06e3['messageId'],'sentAt':moment()[_0x6a49('0x68')](_0x6a49('0x69'))});})[_0x6a49('0x1f')](function(_0x42a1b6){logger[_0x6a49('0x1b')]('%s',JSON['stringify'](_0x42a1b6));return _0x3b6e37;});}return _0x3b6e37;});}return _0x3b6e37;}})[_0x6a49('0x14')](respondWithResult(_0x4a24f1,0xc9))[_0x6a49('0x1f')](handleError(_0x4a24f1,null));};exports[_0x6a49('0x6a')]=function(_0x45892c,_0x2cd200){var _0x195867={'agent':{},'channel':'mail'};if(_0x45892c['body']['id']){delete _0x45892c['body']['id'];}_0x45892c['body'][_0x6a49('0x6b')]=!![];_0x45892c[_0x6a49('0x48')][_0x6a49('0x6c')]=moment()[_0x6a49('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x45892c['body'][_0x6a49('0x6d')]=_0x45892c[_0x6a49('0x48')][_0x6a49('0x6d')]||_0x45892c['user']['id'];_0x195867[_0x6a49('0x6e')]['id']=_0x45892c[_0x6a49('0x48')]['UserId'];return db[_0x6a49('0x3f')][_0x6a49('0x47')]({'where':{'id':_0x45892c[_0x6a49('0x44')]['id'],'UserId':null}})[_0x6a49('0x14')](handleEntityNotFound(_0x2cd200,null))[_0x6a49('0x14')](saveUpdates(_0x45892c[_0x6a49('0x48')],null))[_0x6a49('0x14')](function(_0x388f28){if(_0x388f28){_0x195867[_0x6a49('0x1d')]=_0x388f28[_0x6a49('0x6f')]({'plain':!![]});return db[_0x6a49('0x70')][_0x6a49('0x47')]({'where':{'id':_0x388f28[_0x6a49('0x71')]}});}return null;})[_0x6a49('0x14')](handleEntityNotFound(_0x2cd200,null))[_0x6a49('0x14')](function(_0xe874cf){if(_0xe874cf){return _0xe874cf[_0x6a49('0x27')]({'UserId':_0x45892c[_0x6a49('0x48')][_0x6a49('0x6d')],'read1stAt':_['isNil'](_0xe874cf[_0x6a49('0x72')])?moment()[_0x6a49('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6a49('0x14')](function(_0x4efe7d){if(_0x4efe7d){_0x195867[_0x6a49('0x73')]=_0x4efe7d[_0x6a49('0x6f')]({'plain':!![]});interaction_log[_0x6a49('0x15')](_0x6a49('0x74'),_0x45892c[_0x6a49('0x5d')]['id'],_0x45892c['user'][_0x6a49('0x2b')],_0x45892c[_0x6a49('0x5d')]['role'],_0x195867['interaction']['id'],_0x45892c[_0x6a49('0x48')]?JSON[_0x6a49('0x1a')](_0x45892c[_0x6a49('0x48')]):_0x6a49('0x75'));return respondWithRpcPromise('AcceptMessage',_0x6a49('0x76'),_0x195867);}return null;})[_0x6a49('0x14')](function(_0x15e166){var _0x330b5f=_0x6a49('0x77')+_0x15e166[_0x6a49('0x1d')][_0x6a49('0x78')];return db['sequelize'][_0x6a49('0x31')](_0x330b5f,{'type':db[_0x6a49('0x79')][_0x6a49('0x7a')][_0x6a49('0x7b')],'raw':!![]})['then'](function(_0x57216){return _0x57216;});})['then'](function(_0xbf797c){if(_0xbf797c){_0x195867[_0x6a49('0x1d')][_0x6a49('0x7c')]=_0xbf797c[0x0];if(!_0x45892c['body']['UserId'])return;return db[_0x6a49('0x7d')]['find']({'where':{'id':_0x45892c['body'][_0x6a49('0x6d')],'role':_0x6a49('0x6e')},'attributes':['id',_0x6a49('0x2b'),_0x6a49('0x7e'),'email',_0x6a49('0x7f')],'raw':!![]});}return null;})['then'](function(_0x4d8569){if(!_0x4d8569)return null;_0x195867[_0x6a49('0x1d')]['agent']=_0x4d8569;return _0x195867;})[_0x6a49('0x14')](function(_0xcfefa){if(_0xcfefa){if(_0x45892c[_0x6a49('0x48')][_0x6a49('0x80')]){_0x195867[_0x6a49('0x1d')]['interface']=util[_0x6a49('0x68')](_0x6a49('0x81'),_0x45892c[_0x6a49('0x5d')][_0x6a49('0x2b')]);_0x195867[_0x6a49('0x1d')]['channel']=_0x195867[_0x6a49('0x82')];_0x195867[_0x6a49('0x1d')][_0x6a49('0x83')]=_0x195867['channel'];_0x195867[_0x6a49('0x1d')][_0x6a49('0x84')]=_0x6a49('0x6a');_0x195867[_0x6a49('0x1d')]['body']=htmlToText[_0x6a49('0x85')](_0x195867[_0x6a49('0x1d')]['body']);return respondWithRpcPromise('EventManager',_0x6a49('0x86'),{'event':_0x6a49('0x87'),'message':_0x195867[_0x6a49('0x1d')]},client9002)[_0x6a49('0x14')](function(){return _0x195867;});}return _0x195867;}return null;})['then'](respondWithResult(_0x2cd200,null))[_0x6a49('0x1f')](handleError(_0x2cd200,null));};exports[_0x6a49('0x88')]=function(_0x268b3e,_0x5b4330){var _0x382547={'agent':{},'channel':'mail'};if(_0x268b3e[_0x6a49('0x48')]['id']){delete _0x268b3e[_0x6a49('0x48')]['id'];}_0x268b3e['body']['UserId']=_0x268b3e[_0x6a49('0x48')][_0x6a49('0x6d')]||_0x268b3e['user']['id'];_0x382547[_0x6a49('0x6e')]['id']=_0x268b3e[_0x6a49('0x48')][_0x6a49('0x6d')];return db[_0x6a49('0x3f')][_0x6a49('0x47')]({'where':{'id':_0x268b3e['params']['id'],'UserId':null}})[_0x6a49('0x14')](handleEntityNotFound(_0x5b4330,null))[_0x6a49('0x14')](function(_0x1c8a8b){if(_0x1c8a8b){_0x382547[_0x6a49('0x1d')]=_0x1c8a8b[_0x6a49('0x6f')]({'plain':!![]});return db[_0x6a49('0x70')][_0x6a49('0x47')]({'where':{'id':_0x1c8a8b['MailInteractionId']}});}return null;})[_0x6a49('0x14')](handleEntityNotFound(_0x5b4330,null))[_0x6a49('0x14')](function(_0x51010a){if(_0x51010a){_0x382547[_0x6a49('0x73')]=_0x51010a[_0x6a49('0x6f')]({'plain':!![]});interaction_log[_0x6a49('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x268b3e['user']['id'],_0x268b3e[_0x6a49('0x5d')]['name'],_0x268b3e['user'][_0x6a49('0x89')],_0x382547[_0x6a49('0x73')]['id'],_0x268b3e[_0x6a49('0x48')]?JSON[_0x6a49('0x1a')](_0x268b3e[_0x6a49('0x48')]):'null');return respondWithRpcPromise(_0x6a49('0x8a'),_0x6a49('0x8b'),_0x382547);}return null;})[_0x6a49('0x14')](function(_0x164ee4){var _0x582dfa=_0x6a49('0x77')+_0x164ee4['message']['ContactId'];return db['sequelize'][_0x6a49('0x31')](_0x582dfa,{'type':db[_0x6a49('0x79')][_0x6a49('0x7a')]['SELECT'],'raw':!![]})[_0x6a49('0x14')](function(_0x3add19){return _0x3add19;});})[_0x6a49('0x14')](function(_0x56344c){if(_0x56344c){_0x382547[_0x6a49('0x1d')][_0x6a49('0x7c')]=_0x56344c[0x0];if(!_0x268b3e[_0x6a49('0x48')][_0x6a49('0x6d')])return;return db[_0x6a49('0x7d')][_0x6a49('0x47')]({'where':{'id':_0x268b3e[_0x6a49('0x48')][_0x6a49('0x6d')],'role':_0x6a49('0x6e')},'attributes':['id',_0x6a49('0x2b'),_0x6a49('0x7e'),_0x6a49('0x8c'),_0x6a49('0x7f')],'raw':!![]});}return null;})[_0x6a49('0x14')](function(_0x49ab57){if(!_0x49ab57)return null;_0x382547[_0x6a49('0x1d')][_0x6a49('0x6e')]=_0x49ab57;return _0x382547;})[_0x6a49('0x14')](function(_0x331c18){if(_0x331c18){_0x331c18[_0x6a49('0x1d')]['interface']=util[_0x6a49('0x68')](_0x6a49('0x81'),_0x268b3e['user'][_0x6a49('0x2b')]);_0x331c18['message']['channel']=_0x382547['channel'];_0x331c18[_0x6a49('0x1d')][_0x6a49('0x83')]=_0x382547['channel'];_0x331c18['message'][_0x6a49('0x84')]=_0x6a49('0x88');_0x331c18[_0x6a49('0x1d')][_0x6a49('0x48')]=htmlToText[_0x6a49('0x85')](_0x382547[_0x6a49('0x1d')][_0x6a49('0x48')]);respondWithRpcPromise(_0x6a49('0x86'),_0x6a49('0x86'),{'event':_0x6a49('0x8d'),'message':_0x331c18[_0x6a49('0x1d')]},client9002);return _0x382547;}return null;})[_0x6a49('0x14')](respondWithResult(_0x5b4330,null))['catch'](handleError(_0x5b4330,null));};exports['download']=function(_0x54e51e,_0x25b69b){var _0x490a62=moment()[_0x6a49('0x8e')]()[_0x6a49('0x8f')]();var _0x467fd4=path[_0x6a49('0x60')](config[_0x6a49('0x61')],_0x6a49('0x90'),_0x6a49('0x91'),_0x6a49('0x92'));var _0x2f86bb=path['join'](config[_0x6a49('0x61')],_0x6a49('0x90'),_0x6a49('0x91'),_0x6a49('0x5f'));var _0x4a5971=util['format'](_0x6a49('0x93'),_0x490a62);return db[_0x6a49('0x3f')][_0x6a49('0x47')]({'where':{'id':_0x54e51e[_0x6a49('0x44')]['id']},'attributes':['id','body',_0x6a49('0x94'),'to','cc','bcc',_0x6a49('0x95'),_0x6a49('0x96')],'include':_0x54e51e[_0x6a49('0x31')]['attachments']?[{'model':db[_0x6a49('0x97')],'as':_0x6a49('0x98')}]:undefined})[_0x6a49('0x14')](handleEntityNotFound(_0x25b69b,null))[_0x6a49('0x14')](function(_0x187d75){if(_0x187d75){var _0x12e47a=_0x187d75;var _0x45db52={'from':_0x12e47a['from'],'to':_0x12e47a['to'],'subject':_0x12e47a['subject'],'html':_0x12e47a['body'],'headers':{'Date':moment(_0x12e47a[_0x6a49('0x96')])[_0x6a49('0x68')](_0x6a49('0x99'))},'attachments':[]};if(_0x187d75['cc']){_0x45db52[_0x6a49('0x9a')]['Cc']=_0x187d75['cc'];}if(_0x187d75[_0x6a49('0x9b')]){_0x45db52['headers'][_0x6a49('0x9c')]=_0x187d75['bcc'];}return new BPromise(function(_0x12016a,_0x1dcf2c){if(_0x187d75[_0x6a49('0x98')]){for(var _0x2a5396=0x0;_0x2a5396<_0x187d75['Attachments'][_0x6a49('0x37')];_0x2a5396++){var _0x5a149f=_0x187d75[_0x6a49('0x98')][_0x2a5396];var _0x538fb0=path['join'](_0x2f86bb,_0x5a149f[_0x6a49('0x63')]);if(fs[_0x6a49('0x9d')](_0x538fb0)){_0x45db52['attachments'][_0x6a49('0x9e')]({'name':_0x5a149f[_0x6a49('0x2b')],'contentType':_0x5a149f['type'],'data':fs[_0x6a49('0x9f')](_0x538fb0)});}}}emlformat[_0x6a49('0xa0')](_0x45db52,function(_0x1be5f5,_0x2c46b4){if(_0x1be5f5)return _0x1dcf2c(_0x1be5f5);fs[_0x6a49('0xa1')](path['join'](_0x467fd4,_0x4a5971),_0x2c46b4);return _0x12016a(_0x2c46b4);});});}})[_0x6a49('0x14')](function(_0x1ed25e){if(_0x1ed25e){return _0x25b69b['download'](path[_0x6a49('0x60')](_0x467fd4,_0x4a5971),_0x4a5971,function(_0x5d6fc4){if(!_0x5d6fc4)fs['unlinkSync'](path[_0x6a49('0x60')](_0x467fd4,_0x4a5971));});}})[_0x6a49('0x1f')](handleError(_0x25b69b,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 67e81d3..4d64302 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 _0xb44a=['hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','emit'];(function(_0xb9fe33,_0x47a545){var _0x15f7c2=function(_0x24f0e3){while(--_0x24f0e3){_0xb9fe33['push'](_0xb9fe33['shift']());}};_0x15f7c2(++_0x47a545);}(_0xb44a,0x7b));var _0xab44=function(_0x12f4af,_0x4a2bb9){_0x12f4af=_0x12f4af-0x0;var _0x4c4d50=_0xb44a[_0x12f4af];return _0x4c4d50;};'use strict';var EventEmitter=require(_0xab44('0x0'));var MailMessage=require(_0xab44('0x1'))['db'][_0xab44('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xab44('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x567eef){return function(_0x35bacc,_0x972686,_0x892d35){MailMessageEvents[_0xab44('0x4')](_0x567eef+':'+_0x35bacc['id'],_0x35bacc);MailMessageEvents[_0xab44('0x4')](_0x567eef,_0x35bacc);_0x892d35(null);};}for(var e in events){if(events[_0xab44('0x5')](e)){var event=events[e];MailMessage[_0xab44('0x6')](e,emitEvent(event));}}module[_0xab44('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xc17e=['remove','emit','hasOwnProperty','exports','events','MailMessage','setMaxListeners'];(function(_0x1ff3e6,_0x17402e){var _0x411b05=function(_0x126ad0){while(--_0x126ad0){_0x1ff3e6['push'](_0x1ff3e6['shift']());}};_0x411b05(++_0x17402e);}(_0xc17e,0x123));var _0xec17=function(_0x5f0305,_0x4bdfa8){_0x5f0305=_0x5f0305-0x0;var _0x344ecf=_0xc17e[_0x5f0305];return _0x344ecf;};'use strict';var EventEmitter=require(_0xec17('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xec17('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xec17('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xec17('0x3')};function emitEvent(_0x5aec68){return function(_0x397716,_0x177509,_0x12015a){MailMessageEvents[_0xec17('0x4')](_0x5aec68+':'+_0x397716['id'],_0x397716);MailMessageEvents['emit'](_0x5aec68,_0x397716);_0x12015a(null);};}for(var e in events){if(events[_0xec17('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xec17('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index b4bcfa9..4c22a28 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 _0xcb3c=['lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','error','utf8mb4_unicode_ci'];(function(_0x8f25d5,_0x29057a){var _0x29bca8=function(_0x1400de){while(--_0x1400de){_0x8f25d5['push'](_0x8f25d5['shift']());}};_0x29bca8(++_0x29057a);}(_0xcb3c,0x132));var _0xccb3=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0xcb3c[_0x4914ad];return _0x3cd61f;};'use strict';var _=require(_0xccb3('0x0'));var util=require(_0xccb3('0x1'));var logger=require(_0xccb3('0x2'))(_0xccb3('0x3'));var moment=require(_0xccb3('0x4'));var BPromise=require(_0xccb3('0x5'));var rp=require('request-promise');var htmlToText=require(_0xccb3('0x6'));var fs=require('fs');var path=require(_0xccb3('0x7'));var rimraf=require(_0xccb3('0x8'));var config=require(_0xccb3('0x9'));var attributes=require(_0xccb3('0xa'));module[_0xccb3('0xb')]=function(_0x32d916,_0x4bae08){return _0x32d916[_0xccb3('0xc')](_0xccb3('0xd'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_mail_messages','fields':[_0xccb3('0xe'),_0xccb3('0xf')],'type':_0xccb3('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4450f6,_0x405b04,_0x2064c6){if(_0x4450f6[_0xccb3('0x11')]){_0x4450f6[_0xccb3('0xe')]=htmlToText[_0xccb3('0x12')](_0x4450f6[_0xccb3('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2064c6(null,_0x405b04);},'afterCreate':function(_0x16e131,_0x53a751,_0x59c3ab){var _0x56fb56=_0x32d916[_0xccb3('0x13')];var _0x1e8ec2=_0x16e131[_0xccb3('0x14')]({'plain':!![]});if(_0x1e8ec2['direction'][_0xccb3('0x15')]()==='in'||_0x1e8ec2[_0xccb3('0x16')][_0xccb3('0x15')]()===_0xccb3('0x17')&&!_0x1e8ec2[_0xccb3('0x18')]&&!_[_0xccb3('0x19')](_0x1e8ec2[_0xccb3('0x1a')])){_0x56fb56[_0xccb3('0x1b')][_0xccb3('0x1c')]({'where':{'id':_0x1e8ec2[_0xccb3('0x1d')]}})[_0xccb3('0x1e')](function(_0x1117de){if(_0x1117de){_0x1117de[_0xccb3('0x1f')]({'lastMsgAt':_0x1e8ec2['createdAt'],'lastMsgDirection':_0x1e8ec2[_0xccb3('0x16')][_0xccb3('0x15')]()});}})['catch'](function(_0x5537fe){console[_0xccb3('0x20')](_0x5537fe);});}_0x59c3ab();}},'charset':'utf8mb4','collate':_0xccb3('0x21')});}; \ No newline at end of file +var _0x4f91=['lodash','util','../../config/logger','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','models','get','direction','out','secret','isNil','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4f91,0x174));var _0x14f9=function(_0x3da605,_0x26492a){_0x3da605=_0x3da605-0x0;var _0x340dd0=_0x4f91[_0x3da605];return _0x340dd0;};'use strict';var _=require(_0x14f9('0x0'));var util=require(_0x14f9('0x1'));var logger=require(_0x14f9('0x2'))('api');var moment=require(_0x14f9('0x3'));var BPromise=require(_0x14f9('0x4'));var rp=require('request-promise');var htmlToText=require(_0x14f9('0x5'));var fs=require('fs');var path=require(_0x14f9('0x6'));var rimraf=require(_0x14f9('0x7'));var config=require(_0x14f9('0x8'));var attributes=require(_0x14f9('0x9'));module['exports']=function(_0x4478b0,_0x4c67d9){return _0x4478b0[_0x14f9('0xa')](_0x14f9('0xb'),attributes,{'tableName':_0x14f9('0xc'),'paranoid':![],'indexes':[{'name':_0x14f9('0xd'),'fields':[_0x14f9('0xd')]},{'name':'fti_mail_messages','fields':[_0x14f9('0xe'),_0x14f9('0xf')],'type':_0x14f9('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4734dd,_0x3fde54,_0x210c10){if(_0x4734dd[_0x14f9('0x11')]){_0x4734dd[_0x14f9('0xe')]=htmlToText['fromString'](_0x4734dd['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x210c10(null,_0x3fde54);},'afterCreate':function(_0x545feb,_0x38c74b,_0x465aed){var _0x134896=_0x4478b0[_0x14f9('0x12')];var _0x931b79=_0x545feb[_0x14f9('0x13')]({'plain':!![]});if(_0x931b79[_0x14f9('0x14')]['toLowerCase']()==='in'||_0x931b79['direction']['toLowerCase']()===_0x14f9('0x15')&&!_0x931b79[_0x14f9('0x16')]&&!_[_0x14f9('0x17')](_0x931b79['UserId'])){_0x134896['MailInteraction']['findOne']({'where':{'id':_0x931b79['MailInteractionId']}})['then'](function(_0x66c7e1){if(_0x66c7e1){_0x66c7e1[_0x14f9('0x18')]({'lastMsgAt':_0x931b79[_0x14f9('0x19')],'lastMsgDirection':_0x931b79[_0x14f9('0x14')][_0x14f9('0x1a')]()});}})[_0x14f9('0x1b')](function(_0xb5d69f){console[_0x14f9('0x1c')](_0xb5d69f);});}_0x465aed();}},'charset':_0x14f9('0x1d'),'collate':_0x14f9('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 874862b..5c7d589 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 _0x955f=['../../mysqldb','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0xc645c7,_0x9e8be8){var _0x13bc0f=function(_0x15a08c){while(--_0x15a08c){_0xc645c7['push'](_0xc645c7['shift']());}};_0x13bc0f(++_0x9e8be8);}(_0x955f,0x1eb));var _0xf955=function(_0x2fee4d,_0x5ee7a2){_0x2fee4d=_0x2fee4d-0x0;var _0x2ba392=_0x955f[_0x2fee4d];return _0x2ba392;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});config['redis']=_[_0xf955('0xa')](config[_0xf955('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf955('0xc'))(new Redis(config[_0xf955('0xb')]));require(_0xf955('0xd'))[_0xf955('0xe')](socket);function respondWithRpcPromise(_0x134c1b,_0x421e4a,_0x186719){return new BPromise(function(_0x4d213a,_0xf7e3e){return client['request'](_0x134c1b,_0x186719)[_0xf955('0xf')](function(_0x5d6211){logger[_0xf955('0x10')]('MailMessage,\x20%s,\x20%s',_0x421e4a,_0xf955('0x11'));logger['debug'](_0xf955('0x12'),_0x421e4a,'request\x20sent',JSON[_0xf955('0x13')](_0x5d6211));if(_0x5d6211[_0xf955('0x14')]){if(_0x5d6211[_0xf955('0x14')][_0xf955('0x15')]===0x1f4){logger[_0xf955('0x14')](_0xf955('0x16'),_0x421e4a,_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);return _0xf7e3e(_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);}logger['error'](_0xf955('0x16'),_0x421e4a,_0x5d6211['error'][_0xf955('0x17')]);return _0x4d213a(_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);}else{logger[_0xf955('0x10')]('MailMessage,\x20%s,\x20%s',_0x421e4a,'request\x20sent');_0x4d213a(_0x5d6211[_0xf955('0x18')][_0xf955('0x17')]);}})[_0xf955('0x19')](function(_0x4d7b5b){logger[_0xf955('0x14')](_0xf955('0x16'),_0x421e4a,_0x4d7b5b);_0xf7e3e(_0x4d7b5b);});});}exports[_0xf955('0x1a')]=function(_0x3f960e){var _0x3ae4fb=this;return new Promise(function(_0x5f4d9a,_0x17d86a){return db[_0xf955('0x1b')][_0xf955('0x1c')](_0x3f960e['body'],{'raw':_0x3f960e[_0xf955('0x1d')]?_0x3f960e['options'][_0xf955('0x1e')]===undefined?!![]:![]:!![]})[_0xf955('0xf')](function(_0x37143d){logger[_0xf955('0x10')](_0xf955('0x1a'),_0x3f960e);logger['debug'](_0xf955('0x1a'),_0x3f960e,JSON[_0xf955('0x13')](_0x37143d));_0x5f4d9a(_0x37143d);})[_0xf955('0x19')](function(_0x13a1a7){logger[_0xf955('0x14')](_0xf955('0x1a'),_0x13a1a7[_0xf955('0x17')],_0x3f960e);_0x17d86a(_0x3ae4fb['error'](0x1f4,_0x13a1a7[_0xf955('0x17')]));});});}; \ No newline at end of file +var _0xda2d=['body','options','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xda2d,0x102));var _0xdda2=function(_0x21df10,_0x2a9bbc){_0x21df10=_0x21df10-0x0;var _0x549367=_0xda2d[_0x21df10];return _0x549367;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});config[_0xdda2('0xa')]=_[_0xdda2('0xb')](config[_0xdda2('0xa')],{'host':_0xdda2('0xc'),'port':0x18eb});var socket=require(_0xdda2('0xd'))(new Redis(config['redis']));require(_0xdda2('0xe'))[_0xdda2('0xf')](socket);function respondWithRpcPromise(_0x4df6b8,_0x1c11b2,_0x2f3454){return new BPromise(function(_0x42d990,_0x346119){return client[_0xdda2('0x10')](_0x4df6b8,_0x2f3454)[_0xdda2('0x11')](function(_0x26fe81){logger[_0xdda2('0x12')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,'request\x20sent');logger['debug'](_0xdda2('0x13'),_0x1c11b2,_0xdda2('0x14'),JSON[_0xdda2('0x15')](_0x26fe81));if(_0x26fe81[_0xdda2('0x16')]){if(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x17')]===0x1f4){logger[_0xdda2('0x16')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x346119(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x18')]);}logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x42d990(_0x26fe81['error'][_0xdda2('0x18')]);}else{logger['info'](_0xdda2('0x19'),_0x1c11b2,_0xdda2('0x14'));_0x42d990(_0x26fe81[_0xdda2('0x1a')][_0xdda2('0x18')]);}})[_0xdda2('0x1b')](function(_0x17015f){logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x17015f);_0x346119(_0x17015f);});});}exports[_0xdda2('0x1c')]=function(_0x337b0b){var _0x312ef1=this;return new Promise(function(_0x6fdede,_0x4eed30){return db[_0xdda2('0x1d')]['create'](_0x337b0b[_0xdda2('0x1e')],{'raw':_0x337b0b[_0xdda2('0x1f')]?_0x337b0b[_0xdda2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xdda2('0x11')](function(_0x5a9bb8){logger[_0xdda2('0x12')](_0xdda2('0x1c'),_0x337b0b);logger['debug'](_0xdda2('0x1c'),_0x337b0b,JSON[_0xdda2('0x15')](_0x5a9bb8));_0x6fdede(_0x5a9bb8);})[_0xdda2('0x1b')](function(_0x13b0f3){logger[_0xdda2('0x16')]('CreateMailMessage',_0x13b0f3[_0xdda2('0x18')],_0x337b0b);_0x4eed30(_0x312ef1[_0xdda2('0x16')](0x1f4,_0x13b0f3[_0xdda2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 20ae1a3..6e8be3f 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 _0x7f22=['remove','update','emit','removeListener','register','./mailMessage.events','save'];(function(_0x4a85b6,_0x30d7cb){var _0x104df8=function(_0x31ab1d){while(--_0x31ab1d){_0x4a85b6['push'](_0x4a85b6['shift']());}};_0x104df8(++_0x30d7cb);}(_0x7f22,0x1c5));var _0x27f2=function(_0x4a9314,_0x5b341f){_0x4a9314=_0x4a9314-0x0;var _0x468da9=_0x7f22[_0x4a9314];return _0x468da9;};'use strict';var MailMessageEvents=require(_0x27f2('0x0'));var events=[_0x27f2('0x1'),_0x27f2('0x2'),_0x27f2('0x3')];function createListener(_0x3bd1f4,_0x50df2c){return function(_0x5c7cc2){_0x50df2c[_0x27f2('0x4')](_0x3bd1f4,_0x5c7cc2);};}function removeListener(_0xb3f385,_0x55656e){return function(){MailMessageEvents[_0x27f2('0x5')](_0xb3f385,_0x55656e);};}exports[_0x27f2('0x6')]=function(_0x273d4c){for(var _0x41fa0d=0x0,_0x2944dd=events['length'];_0x41fa0d<_0x2944dd;_0x41fa0d++){var _0x28dadf=events[_0x41fa0d];var _0x346336=createListener('mailMessage:'+_0x28dadf,_0x273d4c);MailMessageEvents['on'](_0x28dadf,_0x346336);}}; \ No newline at end of file +var _0x6b19=['emit','removeListener','./mailMessage.events','save','update'];(function(_0x540a03,_0x46a54c){var _0x5ee454=function(_0x479f05){while(--_0x479f05){_0x540a03['push'](_0x540a03['shift']());}};_0x5ee454(++_0x46a54c);}(_0x6b19,0xe8));var _0x96b1=function(_0x4027d7,_0x5d1ee4){_0x4027d7=_0x4027d7-0x0;var _0x2958fb=_0x6b19[_0x4027d7];return _0x2958fb;};'use strict';var MailMessageEvents=require(_0x96b1('0x0'));var events=[_0x96b1('0x1'),'remove',_0x96b1('0x2')];function createListener(_0x582556,_0x573f03){return function(_0x2cf16d){_0x573f03[_0x96b1('0x3')](_0x582556,_0x2cf16d);};}function removeListener(_0x1a104c,_0x31332a){return function(){MailMessageEvents[_0x96b1('0x4')](_0x1a104c,_0x31332a);};}exports['register']=function(_0x8b5ab8){for(var _0x546193=0x0,_0x3e3e1a=events['length'];_0x546193<_0x3e3e1a;_0x546193++){var _0x57a23a=events[_0x546193];var _0x307e65=createListener('mailMessage:'+_0x57a23a,_0x8b5ab8);MailMessageEvents['on'](_0x57a23a,_0x307e65);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 193269c..a271237 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 _0x1442=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','multer','path','connect-timeout'];(function(_0x21dcee,_0x15898c){var _0x5a24ba=function(_0x2aefad){while(--_0x2aefad){_0x21dcee['push'](_0x21dcee['shift']());}};_0x5a24ba(++_0x15898c);}(_0x1442,0x183));var _0x2144=function(_0x56e08e,_0x5b54d0){_0x56e08e=_0x56e08e-0x0;var _0x25e7b3=_0x1442[_0x56e08e];return _0x25e7b3;};'use strict';var multer=require(_0x2144('0x0'));var util=require('util');var path=require(_0x2144('0x1'));var timeout=require(_0x2144('0x2'));var express=require('express');var router=express[_0x2144('0x3')]();var fs_extra=require(_0x2144('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2144('0x5'));var config=require(_0x2144('0x6'));var controller=require(_0x2144('0x7'));router[_0x2144('0x8')]('/',auth[_0x2144('0x9')](),controller[_0x2144('0xa')]);router['get'](_0x2144('0xb'),auth[_0x2144('0x9')](),controller['describe']);router[_0x2144('0x8')](_0x2144('0xc'),auth[_0x2144('0x9')](),controller[_0x2144('0xd')]);router[_0x2144('0x8')](_0x2144('0xe'),auth[_0x2144('0x9')](),controller[_0x2144('0xf')]);router[_0x2144('0x8')](_0x2144('0x10'),auth['isAuthenticated'](),controller[_0x2144('0x11')]);router[_0x2144('0x8')](_0x2144('0x12'),auth[_0x2144('0x9')](),controller[_0x2144('0x13')]);router[_0x2144('0x14')]('/',auth[_0x2144('0x9')](),controller[_0x2144('0x15')]);router['post'](_0x2144('0x10'),auth[_0x2144('0x9')](),controller['addTeams']);router[_0x2144('0x14')]('/:id/users',auth[_0x2144('0x9')](),controller[_0x2144('0x16')]);router[_0x2144('0x17')](_0x2144('0xc'),auth['isAuthenticated'](),controller[_0x2144('0x18')]);router['delete'](_0x2144('0xc'),auth['isAuthenticated'](),controller[_0x2144('0x19')]);router['delete']('/:id/teams',auth[_0x2144('0x9')](),controller[_0x2144('0x1a')]);router[_0x2144('0x1b')](_0x2144('0x12'),auth[_0x2144('0x9')](),controller[_0x2144('0x1c')]);module[_0x2144('0x1d')]=router; \ No newline at end of file +var _0xbfba=['/:id/members','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show'];(function(_0x3edc6f,_0x30dc72){var _0xa77a67=function(_0x3e7a9c){while(--_0x3e7a9c){_0x3edc6f['push'](_0x3edc6f['shift']());}};_0xa77a67(++_0x30dc72);}(_0xbfba,0x65));var _0xabfb=function(_0x4f8445,_0x35deb0){_0x4f8445=_0x4f8445-0x0;var _0x29ce25=_0xbfba[_0x4f8445];return _0x29ce25;};'use strict';var multer=require(_0xabfb('0x0'));var util=require(_0xabfb('0x1'));var path=require(_0xabfb('0x2'));var timeout=require(_0xabfb('0x3'));var express=require(_0xabfb('0x4'));var router=express[_0xabfb('0x5')]();var fs_extra=require(_0xabfb('0x6'));var auth=require(_0xabfb('0x7'));var interaction=require(_0xabfb('0x8'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0xabfb('0x9')]('/',auth[_0xabfb('0xa')](),controller[_0xabfb('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xabfb('0xc')]);router[_0xabfb('0x9')](_0xabfb('0xd'),auth['isAuthenticated'](),controller[_0xabfb('0xe')]);router[_0xabfb('0x9')](_0xabfb('0xf'),auth[_0xabfb('0xa')](),controller['getMembers']);router[_0xabfb('0x9')]('/:id/teams',auth[_0xabfb('0xa')](),controller[_0xabfb('0x10')]);router[_0xabfb('0x9')](_0xabfb('0x11'),auth[_0xabfb('0xa')](),controller[_0xabfb('0x12')]);router[_0xabfb('0x13')]('/',auth[_0xabfb('0xa')](),controller['create']);router[_0xabfb('0x13')](_0xabfb('0x14'),auth[_0xabfb('0xa')](),controller[_0xabfb('0x15')]);router[_0xabfb('0x13')](_0xabfb('0x11'),auth[_0xabfb('0xa')](),controller[_0xabfb('0x16')]);router[_0xabfb('0x17')](_0xabfb('0xd'),auth[_0xabfb('0xa')](),controller['update']);router['delete'](_0xabfb('0xd'),auth[_0xabfb('0xa')](),controller[_0xabfb('0x18')]);router[_0xabfb('0x19')](_0xabfb('0x14'),auth['isAuthenticated'](),controller[_0xabfb('0x1a')]);router[_0xabfb('0x19')]('/:id/users',auth[_0xabfb('0xa')](),controller[_0xabfb('0x1b')]);module[_0xabfb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 040b5bf..d793872 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 _0xa2b7=['exports','STRING','name','INTEGER','beepall','roundrobin','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa2b7,0x172));var _0x7a2b=function(_0x4abc8f,_0xef597d){_0x4abc8f=_0x4abc8f-0x0;var _0x5d7939=_0xa2b7[_0x4abc8f];return _0x5d7939;};'use strict';var Sequelize=require(_0x7a2b('0x0'));module[_0x7a2b('0x1')]={'name':{'type':Sequelize[_0x7a2b('0x2')],'unique':_0x7a2b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7a2b('0x2')]},'timeout':{'type':Sequelize[_0x7a2b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x7a2b('0x5'),_0x7a2b('0x6'))}}; \ No newline at end of file +var _0xd1b4=['STRING','INTEGER','ENUM','rrmemory','beepall','exports'];(function(_0x186404,_0x2ccb83){var _0x50a770=function(_0x4aa6cd){while(--_0x4aa6cd){_0x186404['push'](_0x186404['shift']());}};_0x50a770(++_0x2ccb83);}(_0xd1b4,0x6b));var _0x4d1b=function(_0x4e622f,_0x2d0f6f){_0x4e622f=_0x4e622f-0x0;var _0xdc4092=_0xd1b4[_0x4e622f];return _0xdc4092;};'use strict';var Sequelize=require('sequelize');module[_0x4d1b('0x0')]={'name':{'type':Sequelize[_0x4d1b('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4d1b('0x1')]},'timeout':{'type':Sequelize[_0x4d1b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4d1b('0x3')](_0x4d1b('0x4'),_0x4d1b('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 d9bcf35..b7f6d37 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 _0x2dff=['union','compact','value','removeAgents','addAgents','userMailQueue:save','isArray','userMailQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','get','MailQueues','destroy','error','name','index','MailQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','update','describe','UserMailQueue','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId'];(function(_0x823695,_0x2db982){var _0x2097eb=function(_0x518fba){while(--_0x518fba){_0x823695['push'](_0x823695['shift']());}};_0x2097eb(++_0x2db982);}(_0x2dff,0x11d));var _0xf2df=function(_0x2ff372,_0x10408d){_0x2ff372=_0x2ff372-0x0;var _0x682902=_0x2dff[_0x2ff372];return _0x682902;};'use strict';var emlformat=require(_0xf2df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf2df('0x1'));var jsonpatch=require(_0xf2df('0x2'));var rp=require(_0xf2df('0x3'));var moment=require(_0xf2df('0x4'));var BPromise=require(_0xf2df('0x5'));var Mustache=require(_0xf2df('0x6'));var util=require(_0xf2df('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf2df('0x8'));var ejs=require(_0xf2df('0x9'));var fs=require('fs');var fs_extra=require(_0xf2df('0xa'));var _=require(_0xf2df('0xb'));var squel=require('squel');var crypto=require(_0xf2df('0xc'));var jsforce=require(_0xf2df('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf2df('0x8'));var querystring=require(_0xf2df('0xe'));var Papa=require(_0xf2df('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf2df('0x10'));var as=require(_0xf2df('0x11'));var hardwareService=require(_0xf2df('0x12'));var logger=require(_0xf2df('0x13'))(_0xf2df('0x14'));var utils=require(_0xf2df('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf2df('0x16'))['db'];config[_0xf2df('0x17')]=_['defaults'](config[_0xf2df('0x17')],{'host':_0xf2df('0x18'),'port':0x18eb});var socket=require(_0xf2df('0x19'))(new Redis(config['redis']));require(_0xf2df('0x1a'))['register'](socket);function respondWithStatusCode(_0x1d3306,_0x449920){_0x449920=_0x449920||0xcc;return function(_0x54e1c4){if(_0x54e1c4){return _0x1d3306[_0xf2df('0x1b')](_0x449920);}return _0x1d3306['status'](_0x449920)[_0xf2df('0x1c')]();};}function respondWithResult(_0x27f9a5,_0x164ecd){_0x164ecd=_0x164ecd||0xc8;return function(_0x4e3fff){if(_0x4e3fff){return _0x27f9a5[_0xf2df('0x1d')](_0x164ecd)[_0xf2df('0x1e')](_0x4e3fff);}};}function respondWithFilteredResult(_0x2a6ef1,_0x34fcd7){return function(_0x38460b){if(_0x38460b){var _0x64ac49=typeof _0x34fcd7['offset']===_0xf2df('0x1f')&&typeof _0x34fcd7[_0xf2df('0x20')]===_0xf2df('0x1f');var _0x58ad29=_0x38460b[_0xf2df('0x21')];var _0xafe5f7=_0x64ac49?0x0:_0x34fcd7[_0xf2df('0x22')];var _0x1dc2fd=_0x64ac49?_0x38460b[_0xf2df('0x21')]:_0x34fcd7[_0xf2df('0x22')]+_0x34fcd7[_0xf2df('0x20')];var _0x108b2d;if(_0x1dc2fd>=_0x58ad29){_0x1dc2fd=_0x58ad29;_0x108b2d=0xc8;}else{_0x108b2d=0xce;}_0x2a6ef1['status'](_0x108b2d);return _0x2a6ef1[_0xf2df('0x23')](_0xf2df('0x24'),_0xafe5f7+'-'+_0x1dc2fd+'/'+_0x58ad29)['json'](_0x38460b);}return null;};}function patchUpdates(_0x1ca68b){return function(_0x22e21){try{jsonpatch[_0xf2df('0x25')](_0x22e21,_0x1ca68b,!![]);}catch(_0x2c79ea){return BPromise['reject'](_0x2c79ea);}return _0x22e21[_0xf2df('0x26')]();};}function saveUpdates(_0x1c30ad,_0x152fd5){return function(_0x2bb07e){if(_0x2bb07e){return _0x2bb07e['update'](_0x1c30ad)[_0xf2df('0x27')](function(_0x4b9443){return _0x4b9443;});}return null;};}function removeEntity(_0xaf5cb3,_0x19c07b){return function(_0x11d473){if(_0x11d473){return _0x11d473['destroy']()[_0xf2df('0x27')](function(){var _0x377fc5=_0x11d473[_0xf2df('0x28')]({'plain':!![]});var _0x18b602=_0xf2df('0x29');return db['UserProfileResource'][_0xf2df('0x2a')]({'where':{'type':_0x18b602,'resourceId':_0x377fc5['id']}})[_0xf2df('0x27')](function(){return _0x11d473;});})[_0xf2df('0x27')](function(){_0xaf5cb3['status'](0xcc)[_0xf2df('0x1c')]();});}};}function handleEntityNotFound(_0x2c8361,_0x42daf6){return function(_0x204e2e){if(!_0x204e2e){_0x2c8361['sendStatus'](0x194);}return _0x204e2e;};}function handleError(_0x1162ff,_0xd6b383){_0xd6b383=_0xd6b383||0x1f4;return function(_0x1a5050){logger[_0xf2df('0x2b')](_0x1a5050['stack']);if(_0x1a5050[_0xf2df('0x2c')]){delete _0x1a5050[_0xf2df('0x2c')];}_0x1162ff[_0xf2df('0x1d')](_0xd6b383)['send'](_0x1a5050);};}exports[_0xf2df('0x2d')]=function(_0x5e71aa,_0x268ab){var _0x3f44a4={},_0x36338f={},_0x43e725={'count':0x0,'rows':[]};var _0x3f81a8=_['map'](db[_0xf2df('0x2e')][_0xf2df('0x2f')],function(_0x473ead){return{'name':_0x473ead[_0xf2df('0x30')],'type':_0x473ead[_0xf2df('0x31')][_0xf2df('0x32')]};});_0x36338f[_0xf2df('0x33')]=_[_0xf2df('0x34')](_0x3f81a8,'name');_0x36338f[_0xf2df('0x35')]=_[_0xf2df('0x36')](_0x5e71aa['query']);_0x36338f[_0xf2df('0x37')]=_[_0xf2df('0x38')](_0x36338f[_0xf2df('0x33')],_0x36338f[_0xf2df('0x35')]);_0x3f44a4[_0xf2df('0x39')]=_[_0xf2df('0x38')](_0x36338f[_0xf2df('0x33')],qs['fields'](_0x5e71aa[_0xf2df('0x35')][_0xf2df('0x3a')]));_0x3f44a4[_0xf2df('0x39')]=_0x3f44a4['attributes'][_0xf2df('0x3b')]?_0x3f44a4[_0xf2df('0x39')]:_0x36338f['model'];if(!_0x5e71aa[_0xf2df('0x35')][_0xf2df('0x3c')](_0xf2df('0x3d'))){_0x3f44a4[_0xf2df('0x20')]=qs[_0xf2df('0x20')](_0x5e71aa[_0xf2df('0x35')]['limit']);_0x3f44a4[_0xf2df('0x22')]=qs[_0xf2df('0x22')](_0x5e71aa[_0xf2df('0x35')][_0xf2df('0x22')]);}_0x3f44a4[_0xf2df('0x3e')]=qs[_0xf2df('0x3f')](_0x5e71aa[_0xf2df('0x35')][_0xf2df('0x3f')]);_0x3f44a4[_0xf2df('0x40')]=qs[_0xf2df('0x37')](_[_0xf2df('0x41')](_0x5e71aa[_0xf2df('0x35')],_0x36338f[_0xf2df('0x37')]),_0x3f81a8);if(_0x5e71aa[_0xf2df('0x35')][_0xf2df('0x42')]){_0x3f44a4[_0xf2df('0x40')]=_[_0xf2df('0x43')](_0x3f44a4[_0xf2df('0x40')],{'$or':_[_0xf2df('0x34')](_0x3f81a8,function(_0x5c5c69){if(_0x5c5c69[_0xf2df('0x31')]!==_0xf2df('0x44')){var _0x498e62={};_0x498e62[_0x5c5c69[_0xf2df('0x2c')]]={'$like':'%'+_0x5e71aa[_0xf2df('0x35')][_0xf2df('0x42')]+'%'};return _0x498e62;}})});}_0x3f44a4=_[_0xf2df('0x43')]({},_0x3f44a4,_0x5e71aa['options']);var _0x2e0fc9={'where':_0x3f44a4[_0xf2df('0x40')]};return db['MailQueue'][_0xf2df('0x21')](_0x2e0fc9)['then'](function(_0x4380d9){_0x43e725[_0xf2df('0x21')]=_0x4380d9;if(_0x5e71aa['query'][_0xf2df('0x45')]){_0x3f44a4[_0xf2df('0x46')]=[{'all':!![]}];}return db['MailQueue'][_0xf2df('0x47')](_0x3f44a4);})[_0xf2df('0x27')](function(_0x5e1ba1){_0x43e725[_0xf2df('0x48')]=_0x5e1ba1;return _0x43e725;})[_0xf2df('0x27')](respondWithFilteredResult(_0x268ab,_0x3f44a4))[_0xf2df('0x49')](handleError(_0x268ab,null));};exports[_0xf2df('0x4a')]=function(_0x11425e,_0x2ac39a){var _0x22d615={'raw':!![],'where':{'id':_0x11425e[_0xf2df('0x4b')]['id']}},_0x5645aa={};_0x5645aa['model']=_[_0xf2df('0x36')](db['MailQueue']['rawAttributes']);_0x5645aa[_0xf2df('0x35')]=_[_0xf2df('0x36')](_0x11425e[_0xf2df('0x35')]);_0x5645aa['filters']=_['intersection'](_0x5645aa['model'],_0x5645aa['query']);_0x22d615[_0xf2df('0x39')]=_[_0xf2df('0x38')](_0x5645aa['model'],qs['fields'](_0x11425e[_0xf2df('0x35')][_0xf2df('0x3a')]));_0x22d615[_0xf2df('0x39')]=_0x22d615[_0xf2df('0x39')][_0xf2df('0x3b')]?_0x22d615[_0xf2df('0x39')]:_0x5645aa[_0xf2df('0x33')];if(_0x11425e[_0xf2df('0x35')][_0xf2df('0x45')]){_0x22d615['include']=[{'all':!![]}];}_0x22d615=_[_0xf2df('0x43')]({},_0x22d615,_0x11425e[_0xf2df('0x4c')]);return db[_0xf2df('0x2e')][_0xf2df('0x4d')](_0x22d615)[_0xf2df('0x27')](handleEntityNotFound(_0x2ac39a,null))[_0xf2df('0x27')](respondWithResult(_0x2ac39a,null))[_0xf2df('0x49')](handleError(_0x2ac39a,null));};exports[_0xf2df('0x4e')]=function(_0x32a94b,_0x5b4f78){return db['MailQueue'][_0xf2df('0x4e')](_0x32a94b[_0xf2df('0x4f')],{})['then'](function(_0x554ca3){var _0xcc8d92=_0x32a94b['user']['get']({'plain':!![]});if(!_0xcc8d92)throw new Error(_0xf2df('0x50'));if(_0xcc8d92[_0xf2df('0x51')]==='user'){var _0x5ca485=_0x554ca3[_0xf2df('0x28')]({'plain':!![]});var _0x572c65=_0xf2df('0x29');return db[_0xf2df('0x52')][_0xf2df('0x4d')]({'where':{'name':_0x572c65,'userProfileId':_0xcc8d92['userProfileId']},'raw':!![]})[_0xf2df('0x27')](function(_0x39ae3c){if(_0x39ae3c&&_0x39ae3c[_0xf2df('0x53')]===0x0){return db[_0xf2df('0x54')][_0xf2df('0x4e')]({'name':_0x5ca485[_0xf2df('0x2c')],'resourceId':_0x5ca485['id'],'type':_0x39ae3c[_0xf2df('0x2c')],'sectionId':_0x39ae3c['id']},{})['then'](function(){return _0x554ca3;});}else{return _0x554ca3;}})[_0xf2df('0x49')](function(_0x299466){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x299466);throw _0x299466;});}return _0x554ca3;})[_0xf2df('0x27')](respondWithResult(_0x5b4f78,0xc9))[_0xf2df('0x49')](handleError(_0x5b4f78,null));};exports[_0xf2df('0x55')]=function(_0x4af796,_0x30592a){if(_0x4af796['body']['id']){delete _0x4af796['body']['id'];}return db['MailQueue'][_0xf2df('0x4d')]({'where':{'id':_0x4af796[_0xf2df('0x4b')]['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x30592a,null))[_0xf2df('0x27')](saveUpdates(_0x4af796[_0xf2df('0x4f')],null))['then'](respondWithResult(_0x30592a,null))[_0xf2df('0x49')](handleError(_0x30592a,null));};exports['destroy']=function(_0x50b037,_0x2fbc04){return db[_0xf2df('0x2e')][_0xf2df('0x4d')]({'where':{'id':_0x50b037[_0xf2df('0x4b')]['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x2fbc04,null))[_0xf2df('0x27')](removeEntity(_0x2fbc04,null))['catch'](handleError(_0x2fbc04,null));};exports[_0xf2df('0x56')]=function(_0x3a551d,_0x3d767b){return db[_0xf2df('0x2e')][_0xf2df('0x56')]()['then'](respondWithResult(_0x3d767b,null))['catch'](handleError(_0x3d767b,null));};exports['getMembers']=function(_0x5d6a9f,_0x42e59e,_0x2201e9){var _0x25592d={'raw':!![],'where':{}},_0x5450d8={},_0x4539c2;return db[_0xf2df('0x2e')]['findOne']({'where':{'id':_0x5d6a9f['params']['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x42e59e,null))[_0xf2df('0x27')](function(_0x5dc2d9){if(_0x5dc2d9){_0x4539c2=_0x5dc2d9[_0xf2df('0x28')]({'plain':!![]});_0x5450d8['model']=_[_0xf2df('0x36')](db['UserMailQueue'][_0xf2df('0x2f')]);_0x5450d8[_0xf2df('0x35')]=_['keys'](_0x5d6a9f[_0xf2df('0x35')]);_0x5450d8['filters']=_[_0xf2df('0x38')](_0x5450d8[_0xf2df('0x33')],_0x5450d8['query']);_0x25592d['attributes']=_[_0xf2df('0x38')](_0x5450d8[_0xf2df('0x33')],qs['fields'](_0x5d6a9f['query'][_0xf2df('0x3a')]));_0x25592d[_0xf2df('0x39')]=_0x25592d[_0xf2df('0x39')][_0xf2df('0x3b')]?_0x25592d[_0xf2df('0x39')]:_0x5450d8[_0xf2df('0x33')];if(!_0x5d6a9f[_0xf2df('0x35')][_0xf2df('0x3c')](_0xf2df('0x3d'))){_0x25592d[_0xf2df('0x20')]=qs['limit'](_0x5d6a9f[_0xf2df('0x35')][_0xf2df('0x20')]);_0x25592d[_0xf2df('0x22')]=qs[_0xf2df('0x22')](_0x5d6a9f[_0xf2df('0x35')][_0xf2df('0x22')]);}_0x25592d[_0xf2df('0x3e')]=qs[_0xf2df('0x3f')](_0x5d6a9f[_0xf2df('0x35')][_0xf2df('0x3f')]);_0x25592d[_0xf2df('0x40')]=qs[_0xf2df('0x37')](_[_0xf2df('0x41')](_0x5d6a9f[_0xf2df('0x35')],_0x5450d8[_0xf2df('0x37')]));_0x25592d[_0xf2df('0x40')]['MailQueueId']=_0x5dc2d9['id'];if(_0x5d6a9f['query'][_0xf2df('0x42')]){_0x25592d['where']=_[_0xf2df('0x43')](_0x25592d[_0xf2df('0x40')],{'$or':_[_0xf2df('0x34')](_0x25592d['attributes'],function(_0x35e0b0){var _0x4b2b0e={};_0x4b2b0e[_0x35e0b0]={'$like':'%'+_0x5d6a9f[_0xf2df('0x35')][_0xf2df('0x42')]+'%'};return _0x4b2b0e;})});}_0x25592d=_[_0xf2df('0x43')]({},_0x25592d,_0x5d6a9f[_0xf2df('0x4c')]);return db[_0xf2df('0x57')][_0xf2df('0x47')](_0x25592d);}})[_0xf2df('0x27')](function(_0x306469){if(_0x306469){return db['User'][_0xf2df('0x58')]({'where':{'id':_[_0xf2df('0x34')](_0x306469,_0xf2df('0x59')),'role':_0xf2df('0x5a')},'attributes':['id',_0xf2df('0x2c'),_0xf2df('0x5b'),_0xf2df('0x5c'),_0xf2df('0x5d')]});}})['then'](function(_0x527161){if(_0x527161){return{'count':_0x527161['count'],'rows':_[_0xf2df('0x34')](_0x527161[_0xf2df('0x48')],function(_0x44bfbe){return{'membername':_0x44bfbe['name'],'UserId':_0x44bfbe['id'],'queue_name':_0x4539c2['name'],'MailQueueId':_0x4539c2['id'],'interface':util[_0xf2df('0x5e')](_0xf2df('0x5f'),_0xf2df('0x60'),_0x44bfbe['name']),'penalty':0x0,'paused':_0x44bfbe['mailPause'],'createdAt':_0x44bfbe[_0xf2df('0x5d')],'updatedAt':_0x44bfbe[_0xf2df('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf2df('0x27')](respondWithFilteredResult(_0x42e59e,_0x25592d))[_0xf2df('0x49')](handleError(_0x42e59e,null));};exports['getTeams']=function(_0x6e7196,_0x8f7690,_0x124267){var _0x1c7f1e={};var _0x2e5de6={};var _0x2264db;var _0x8bae48;return db[_0xf2df('0x2e')][_0xf2df('0x61')]({'where':{'id':_0x6e7196[_0xf2df('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8f7690,null))[_0xf2df('0x27')](function(_0xb16a17){if(_0xb16a17){_0x2264db=_0xb16a17;_0x2e5de6[_0xf2df('0x33')]=_[_0xf2df('0x36')](db['Team']['rawAttributes']);_0x2e5de6[_0xf2df('0x35')]=_['keys'](_0x6e7196[_0xf2df('0x35')]);_0x2e5de6[_0xf2df('0x37')]=_[_0xf2df('0x38')](_0x2e5de6['model'],_0x2e5de6['query']);_0x1c7f1e[_0xf2df('0x39')]=_[_0xf2df('0x38')](_0x2e5de6[_0xf2df('0x33')],qs['fields'](_0x6e7196[_0xf2df('0x35')][_0xf2df('0x3a')]));_0x1c7f1e[_0xf2df('0x39')]=_0x1c7f1e[_0xf2df('0x39')]['length']?_0x1c7f1e[_0xf2df('0x39')]:_0x2e5de6[_0xf2df('0x33')];_0x1c7f1e[_0xf2df('0x3e')]=qs['sort'](_0x6e7196[_0xf2df('0x35')][_0xf2df('0x3f')]);_0x1c7f1e[_0xf2df('0x40')]=qs['filters'](_[_0xf2df('0x41')](_0x6e7196[_0xf2df('0x35')],_0x2e5de6['filters']));if(_0x6e7196[_0xf2df('0x35')]['filter']){_0x1c7f1e[_0xf2df('0x40')]=_[_0xf2df('0x43')](_0x1c7f1e[_0xf2df('0x40')],{'$or':_['map'](_0x1c7f1e[_0xf2df('0x39')],function(_0xb6b423){var _0x20ddc4={};_0x20ddc4[_0xb6b423]={'$like':'%'+_0x6e7196[_0xf2df('0x35')][_0xf2df('0x42')]+'%'};return _0x20ddc4;})});}_0x1c7f1e=_[_0xf2df('0x43')]({},_0x1c7f1e,_0x6e7196[_0xf2df('0x4c')]);return _0x2264db[_0xf2df('0x62')](_0x1c7f1e);}})[_0xf2df('0x27')](function(_0x54e869){if(_0x54e869){_0x8bae48=_0x54e869[_0xf2df('0x3b')];if(!_0x6e7196['query'][_0xf2df('0x3c')]('nolimit')){_0x1c7f1e['limit']=qs[_0xf2df('0x20')](_0x6e7196[_0xf2df('0x35')][_0xf2df('0x20')]);_0x1c7f1e[_0xf2df('0x22')]=qs[_0xf2df('0x22')](_0x6e7196[_0xf2df('0x35')][_0xf2df('0x22')]);}return _0x2264db['getTeams'](_0x1c7f1e);}})[_0xf2df('0x27')](function(_0x51d12b){if(_0x51d12b){return _0x51d12b?{'count':_0x8bae48,'rows':_0x51d12b}:null;}})[_0xf2df('0x27')](respondWithResult(_0x8f7690,null))[_0xf2df('0x49')](handleError(_0x8f7690,null));};exports[_0xf2df('0x63')]=function(_0x3c44d2,_0x25df3b,_0x8f16af){var _0x13414d=_0x3c44d2[_0xf2df('0x4f')][_0xf2df('0x64')];return db[_0xf2df('0x65')]['findAll']({'where':{'id':_0x13414d},'attributes':['id'],'include':[{'model':db[_0xf2df('0x66')],'as':_0xf2df('0x67'),'attributes':['id',_0xf2df('0x2c'),_0xf2df('0x68'),_0xf2df('0x69'),_0xf2df('0x6a')],'raw':!![]}]})[_0xf2df('0x27')](function(_0x39f7aa){if(_0x39f7aa){var _0x574999=_[_0xf2df('0x6b')](_0x39f7aa,function(_0x3be772){var _0x309c1b=_0x3be772[_0xf2df('0x28')]({'plain':!![]});return _0x309c1b['Agents'];});return db[_0xf2df('0x2e')][_0xf2df('0x4d')]({'where':{'id':_0x3c44d2[_0xf2df('0x4b')]['id']}})[_0xf2df('0x27')](function(_0x3237f2){return db[_0xf2df('0x6c')][_0xf2df('0x6d')](function(_0x43b4fb){return _0x3237f2[_0xf2df('0x63')](_0x13414d,{'transaction':_0x43b4fb})[_0xf2df('0x27')](function(){return BPromise[_0xf2df('0x6e')](_0x574999,function(_0x4a52f9){return db['UserMailQueue'][_0xf2df('0x6f')]({'where':{'UserId':_0x4a52f9['id'],'MailQueueId':_0x3c44d2[_0xf2df('0x4b')]['id']},'transaction':_0x43b4fb});});})['then'](function(){_0x574999[_0xf2df('0x70')](function(_0x9491c4){socket[_0xf2df('0x71')]('userMailQueue:save',{'UserId':_0x9491c4['id'],'MailQueueId':_0x3237f2['id']});});});});});}})[_0xf2df('0x27')](respondWithStatusCode(_0x25df3b,null))['catch'](handleError(_0x25df3b,null));};exports[_0xf2df('0x72')]=function(_0x3052f2,_0x3eb336,_0xa99ef9){return db[_0xf2df('0x65')][_0xf2df('0x47')]({'where':{'id':_0x3052f2['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf2df('0x67'),'attributes':['id'],'raw':!![]}]})[_0xf2df('0x27')](handleEntityNotFound(_0x3eb336,null))['then'](function(_0x123975){var _0x4743f3=_[_0xf2df('0x34')](_0x123975,'id');var _0x1e67f9=[];var _0x152d48=[];var _0x21d885=squel[_0xf2df('0x73')]();_0x21d885[_0xf2df('0x74')](_0xf2df('0x75'))[_0xf2df('0x76')]('team_has_mail_queues','tq')[_0xf2df('0x77')](_0xf2df('0x78'),'ut',_0xf2df('0x79'))[_0xf2df('0x40')](_0xf2df('0x7a'),_0x3052f2[_0xf2df('0x4b')]['id']);for(var _0x3140cb=0x0;_0x3140cb<_0x123975[_0xf2df('0x3b')];_0x3140cb+=0x1){let _0x1538e4=_0x123975[_0x3140cb];for(var _0x546ec6=0x0;_0x546ec6<_0x1538e4[_0xf2df('0x67')][_0xf2df('0x3b')];_0x546ec6+=0x1){let _0x40d2e7=_0x1538e4[_0xf2df('0x67')][_0x546ec6];var _0x248cb5=_0x21d885['clone']();_0x248cb5[_0xf2df('0x40')](_0xf2df('0x7b'),_0x40d2e7['id']);_0x152d48[_0xf2df('0x7c')](db[_0xf2df('0x6c')][_0xf2df('0x35')](_0x248cb5[_0xf2df('0x7d')](),{'type':db[_0xf2df('0x6c')]['QueryTypes'][_0xf2df('0x7e')]})['then'](function(_0xcc32fc){if(_0xcc32fc[_0xf2df('0x3b')]===0x1){return _0x40d2e7['id'];}else{var _0x2ab2b9=_[_0xf2df('0x7f')](_[_0xf2df('0x34')](_0xcc32fc,_0xf2df('0x80')),function(_0x20485c){return _['includes'](_0x4743f3,_0x20485c);});if(_0x2ab2b9){return _0x40d2e7['id'];}}}));}}return BPromise['all'](_0x152d48)['then'](function(_0x4103be){_0x1e67f9=_(_0x1e67f9)[_0xf2df('0x81')](_0x4103be)[_0xf2df('0x82')]()[_0xf2df('0x83')]();return db['MailQueue'][_0xf2df('0x4d')]({'where':{'id':_0x3052f2['params']['id']}})['then'](function(_0x4320ec){return db[_0xf2df('0x6c')][_0xf2df('0x6d')](function(_0x542055){return _0x4320ec[_0xf2df('0x72')](_0x3052f2[_0xf2df('0x35')][_0xf2df('0x64')],{'transaction':_0x542055})[_0xf2df('0x27')](function(){if(!_['isEmpty'](_0x1e67f9)){return _0x4320ec[_0xf2df('0x84')](_0x1e67f9,{'transaction':_0x542055});}})[_0xf2df('0x27')](function(){_0x1e67f9[_0xf2df('0x70')](function(_0x5f176a){socket[_0xf2df('0x71')]('userMailQueue:remove',{'UserId':_0x5f176a,'MailQueueId':_0x4320ec['id']});});});});});});})[_0xf2df('0x27')](respondWithStatusCode(_0x3eb336,null))[_0xf2df('0x49')](handleError(_0x3eb336,null));};exports['addAgents']=function(_0xd2790e,_0x1a83f0,_0x22a21a){return db[_0xf2df('0x2e')][_0xf2df('0x4d')]({'where':{'id':_0xd2790e[_0xf2df('0x4b')]['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x1a83f0,null))['then'](function(_0x21aad7){if(_0x21aad7){return _0x21aad7[_0xf2df('0x85')](_0xd2790e[_0xf2df('0x4f')][_0xf2df('0x64')],_['omit'](_0xd2790e[_0xf2df('0x4f')],[_0xf2df('0x64'),'id'])||{})['spread'](function(_0xacf17b){for(var _0x39dc71=0x0;_0x39dc71<_0xd2790e['body'][_0xf2df('0x64')][_0xf2df('0x3b')];_0x39dc71+=0x1){socket['emit'](_0xf2df('0x86'),{'UserId':Number(_0xd2790e[_0xf2df('0x4f')][_0xf2df('0x64')][_0x39dc71]),'MailQueueId':Number(_0xd2790e[_0xf2df('0x4b')]['id'])});}return _0xacf17b;});}})[_0xf2df('0x27')](respondWithResult(_0x1a83f0,null))[_0xf2df('0x49')](handleError(_0x1a83f0,null));};exports[_0xf2df('0x84')]=function(_0x4fd3e9,_0x181386,_0x36d20c){return db[_0xf2df('0x2e')][_0xf2df('0x4d')]({'where':{'id':_0x4fd3e9[_0xf2df('0x4b')]['id']}})['then'](handleEntityNotFound(_0x181386,null))['then'](function(_0x8b5ae9){if(_0x8b5ae9){return _0x8b5ae9[_0xf2df('0x84')](_0x4fd3e9[_0xf2df('0x35')][_0xf2df('0x64')])[_0xf2df('0x27')](function(){if(_[_0xf2df('0x87')](_0x4fd3e9[_0xf2df('0x35')]['ids'])){for(var _0x4e9162=0x0;_0x4e9162<_0x4fd3e9['query'][_0xf2df('0x64')][_0xf2df('0x3b')];_0x4e9162+=0x1){socket[_0xf2df('0x71')](_0xf2df('0x88'),{'UserId':Number(_0x4fd3e9[_0xf2df('0x35')]['ids'][_0x4e9162]),'MailQueueId':Number(_0x4fd3e9[_0xf2df('0x4b')]['id'])});}}else{socket[_0xf2df('0x71')]('userMailQueue:remove',{'UserId':Number(_0x4fd3e9[_0xf2df('0x35')][_0xf2df('0x64')]),'MailQueueId':Number(_0x4fd3e9[_0xf2df('0x4b')]['id'])});}});}})[_0xf2df('0x27')](respondWithStatusCode(_0x181386,null))['catch'](handleError(_0x181386,null));};exports[_0xf2df('0x89')]=function(_0xb6cfc5,_0x5a42f3,_0x33d1f4){var _0x48c6a0={};var _0x4f4587={};var _0x297b0c;var _0x33ba55;return db['MailQueue'][_0xf2df('0x61')]({'where':{'id':_0xb6cfc5[_0xf2df('0x4b')]['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x5a42f3,null))[_0xf2df('0x27')](function(_0x295cfb){if(_0x295cfb){_0x297b0c=_0x295cfb;_0x4f4587[_0xf2df('0x33')]=_[_0xf2df('0x36')](db[_0xf2df('0x66')]['rawAttributes']);_0x4f4587[_0xf2df('0x35')]=_[_0xf2df('0x36')](_0xb6cfc5[_0xf2df('0x35')]);_0x4f4587[_0xf2df('0x37')]=_[_0xf2df('0x38')](_0x4f4587[_0xf2df('0x33')],_0x4f4587[_0xf2df('0x35')]);_0x48c6a0[_0xf2df('0x39')]=_['intersection'](_0x4f4587[_0xf2df('0x33')],qs[_0xf2df('0x3a')](_0xb6cfc5[_0xf2df('0x35')][_0xf2df('0x3a')]));_0x48c6a0['attributes']=_0x48c6a0['attributes'][_0xf2df('0x3b')]?_0x48c6a0[_0xf2df('0x39')]:_0x4f4587[_0xf2df('0x33')];_0x48c6a0[_0xf2df('0x3e')]=qs[_0xf2df('0x3f')](_0xb6cfc5['query'][_0xf2df('0x3f')]);_0x48c6a0['where']=qs[_0xf2df('0x37')](_[_0xf2df('0x41')](_0xb6cfc5[_0xf2df('0x35')],_0x4f4587[_0xf2df('0x37')]));if(_0xb6cfc5[_0xf2df('0x35')]['filter']){_0x48c6a0[_0xf2df('0x40')]=_[_0xf2df('0x43')](_0x48c6a0[_0xf2df('0x40')],{'$or':_[_0xf2df('0x34')](_0x48c6a0['attributes'],function(_0x25f2c4){var _0xe399a9={};_0xe399a9[_0x25f2c4]={'$like':'%'+_0xb6cfc5[_0xf2df('0x35')][_0xf2df('0x42')]+'%'};return _0xe399a9;})});}_0x48c6a0=_['merge']({},_0x48c6a0,_0xb6cfc5[_0xf2df('0x4c')]);return _0x297b0c['getAgents'](_0x48c6a0);}})[_0xf2df('0x27')](function(_0x21396c){if(_0x21396c){_0x33ba55=_0x21396c[_0xf2df('0x3b')];if(!_0xb6cfc5['query'][_0xf2df('0x3c')]('nolimit')){_0x48c6a0['limit']=qs[_0xf2df('0x20')](_0xb6cfc5[_0xf2df('0x35')][_0xf2df('0x20')]);_0x48c6a0['offset']=qs[_0xf2df('0x22')](_0xb6cfc5[_0xf2df('0x35')][_0xf2df('0x22')]);}return _0x297b0c['getAgents'](_0x48c6a0);}})[_0xf2df('0x27')](function(_0x556e93){if(_0x556e93){return _0x556e93?{'count':_0x33ba55,'rows':_0x556e93}:null;}})['then'](respondWithResult(_0x5a42f3,null))[_0xf2df('0x49')](handleError(_0x5a42f3,null));}; \ No newline at end of file +var _0x0b96=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','nolimit','addTeams','ids','voicePause','flatMap','get','emit','userMailQueue:save','Agents','select','field','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','redis','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','index','MailQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x0b96,0xc2));var _0x60b9=function(_0x20522a,_0x11bb0){_0x20522a=_0x20522a-0x0;var _0x3105e0=_0x0b96[_0x20522a];return _0x3105e0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x60b9('0x0'));var jsonpatch=require(_0x60b9('0x1'));var rp=require('request-promise');var moment=require(_0x60b9('0x2'));var BPromise=require(_0x60b9('0x3'));var Mustache=require(_0x60b9('0x4'));var util=require(_0x60b9('0x5'));var path=require('path');var sox=require(_0x60b9('0x6'));var csv=require('to-csv');var ejs=require(_0x60b9('0x7'));var fs=require('fs');var fs_extra=require(_0x60b9('0x8'));var _=require(_0x60b9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x60b9('0xa'));var toCsv=require(_0x60b9('0xb'));var querystring=require(_0x60b9('0xc'));var Papa=require('papaparse');var Redis=require(_0x60b9('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x60b9('0xe'));var hardwareService=require(_0x60b9('0xf'));var logger=require(_0x60b9('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x60b9('0x11')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x60b9('0x11')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x59bdfb,_0x17e558){_0x17e558=_0x17e558||0xcc;return function(_0x37c303){if(_0x37c303){return _0x59bdfb['sendStatus'](_0x17e558);}return _0x59bdfb['status'](_0x17e558)[_0x60b9('0x12')]();};}function respondWithResult(_0xe9da77,_0x56033d){_0x56033d=_0x56033d||0xc8;return function(_0x290deb){if(_0x290deb){return _0xe9da77[_0x60b9('0x13')](_0x56033d)[_0x60b9('0x14')](_0x290deb);}};}function respondWithFilteredResult(_0x14239e,_0x2f2335){return function(_0x767b4f){if(_0x767b4f){var _0x16a7c7=typeof _0x2f2335[_0x60b9('0x15')]==='undefined'&&typeof _0x2f2335['limit']===_0x60b9('0x16');var _0x1f3f1d=_0x767b4f[_0x60b9('0x17')];var _0x1a6ca0=_0x16a7c7?0x0:_0x2f2335[_0x60b9('0x15')];var _0x232d5e=_0x16a7c7?_0x767b4f[_0x60b9('0x17')]:_0x2f2335['offset']+_0x2f2335[_0x60b9('0x18')];var _0x4f533d;if(_0x232d5e>=_0x1f3f1d){_0x232d5e=_0x1f3f1d;_0x4f533d=0xc8;}else{_0x4f533d=0xce;}_0x14239e['status'](_0x4f533d);return _0x14239e[_0x60b9('0x19')](_0x60b9('0x1a'),_0x1a6ca0+'-'+_0x232d5e+'/'+_0x1f3f1d)[_0x60b9('0x14')](_0x767b4f);}return null;};}function patchUpdates(_0x55a274){return function(_0x3e237d){try{jsonpatch[_0x60b9('0x1b')](_0x3e237d,_0x55a274,!![]);}catch(_0x1b20a8){return BPromise[_0x60b9('0x1c')](_0x1b20a8);}return _0x3e237d[_0x60b9('0x1d')]();};}function saveUpdates(_0xb39049,_0x1e2658){return function(_0x6ab6c6){if(_0x6ab6c6){return _0x6ab6c6['update'](_0xb39049)[_0x60b9('0x1e')](function(_0x42f927){return _0x42f927;});}return null;};}function removeEntity(_0x4e2170,_0x5791b2){return function(_0x5dac51){if(_0x5dac51){return _0x5dac51[_0x60b9('0x1f')]()[_0x60b9('0x1e')](function(){var _0x458924=_0x5dac51['get']({'plain':!![]});var _0x2ad13a=_0x60b9('0x20');return db[_0x60b9('0x21')][_0x60b9('0x1f')]({'where':{'type':_0x2ad13a,'resourceId':_0x458924['id']}})['then'](function(){return _0x5dac51;});})[_0x60b9('0x1e')](function(){_0x4e2170[_0x60b9('0x13')](0xcc)[_0x60b9('0x12')]();});}};}function handleEntityNotFound(_0x155050,_0x3b489b){return function(_0x3f65ec){if(!_0x3f65ec){_0x155050['sendStatus'](0x194);}return _0x3f65ec;};}function handleError(_0x4b8abf,_0x2b6643){_0x2b6643=_0x2b6643||0x1f4;return function(_0x367db0){logger[_0x60b9('0x22')](_0x367db0[_0x60b9('0x23')]);if(_0x367db0[_0x60b9('0x24')]){delete _0x367db0['name'];}_0x4b8abf[_0x60b9('0x13')](_0x2b6643)[_0x60b9('0x25')](_0x367db0);};}exports[_0x60b9('0x26')]=function(_0x2139e9,_0x1a9820){var _0x19b13d={},_0x5016a4={},_0x47ab49={'count':0x0,'rows':[]};var _0xb32af5=_['map'](db[_0x60b9('0x27')][_0x60b9('0x28')],function(_0x2432f0){return{'name':_0x2432f0['fieldName'],'type':_0x2432f0[_0x60b9('0x29')][_0x60b9('0x2a')]};});_0x5016a4[_0x60b9('0x2b')]=_[_0x60b9('0x2c')](_0xb32af5,_0x60b9('0x24'));_0x5016a4[_0x60b9('0x2d')]=_[_0x60b9('0x2e')](_0x2139e9[_0x60b9('0x2d')]);_0x5016a4[_0x60b9('0x2f')]=_[_0x60b9('0x30')](_0x5016a4['model'],_0x5016a4[_0x60b9('0x2d')]);_0x19b13d[_0x60b9('0x31')]=_[_0x60b9('0x30')](_0x5016a4[_0x60b9('0x2b')],qs[_0x60b9('0x32')](_0x2139e9[_0x60b9('0x2d')][_0x60b9('0x32')]));_0x19b13d['attributes']=_0x19b13d[_0x60b9('0x31')][_0x60b9('0x33')]?_0x19b13d[_0x60b9('0x31')]:_0x5016a4[_0x60b9('0x2b')];if(!_0x2139e9['query'][_0x60b9('0x34')]('nolimit')){_0x19b13d['limit']=qs[_0x60b9('0x18')](_0x2139e9[_0x60b9('0x2d')][_0x60b9('0x18')]);_0x19b13d['offset']=qs[_0x60b9('0x15')](_0x2139e9[_0x60b9('0x2d')]['offset']);}_0x19b13d[_0x60b9('0x35')]=qs['sort'](_0x2139e9[_0x60b9('0x2d')][_0x60b9('0x36')]);_0x19b13d[_0x60b9('0x37')]=qs['filters'](_[_0x60b9('0x38')](_0x2139e9[_0x60b9('0x2d')],_0x5016a4['filters']),_0xb32af5);if(_0x2139e9[_0x60b9('0x2d')][_0x60b9('0x39')]){_0x19b13d[_0x60b9('0x37')]=_[_0x60b9('0x3a')](_0x19b13d[_0x60b9('0x37')],{'$or':_[_0x60b9('0x2c')](_0xb32af5,function(_0x54f7f7){if(_0x54f7f7[_0x60b9('0x29')]!=='VIRTUAL'){var _0x25836b={};_0x25836b[_0x54f7f7['name']]={'$like':'%'+_0x2139e9['query'][_0x60b9('0x39')]+'%'};return _0x25836b;}})});}_0x19b13d=_[_0x60b9('0x3a')]({},_0x19b13d,_0x2139e9[_0x60b9('0x3b')]);var _0xc33810={'where':_0x19b13d['where']};return db[_0x60b9('0x27')][_0x60b9('0x17')](_0xc33810)['then'](function(_0x10305d){_0x47ab49[_0x60b9('0x17')]=_0x10305d;if(_0x2139e9[_0x60b9('0x2d')][_0x60b9('0x3c')]){_0x19b13d[_0x60b9('0x3d')]=[{'all':!![]}];}return db[_0x60b9('0x27')][_0x60b9('0x3e')](_0x19b13d);})[_0x60b9('0x1e')](function(_0x29fe47){_0x47ab49[_0x60b9('0x3f')]=_0x29fe47;return _0x47ab49;})[_0x60b9('0x1e')](respondWithFilteredResult(_0x1a9820,_0x19b13d))[_0x60b9('0x40')](handleError(_0x1a9820,null));};exports[_0x60b9('0x41')]=function(_0x152b0d,_0xdd671e){var _0xe63893={'raw':!![],'where':{'id':_0x152b0d[_0x60b9('0x42')]['id']}},_0x547808={};_0x547808[_0x60b9('0x2b')]=_[_0x60b9('0x2e')](db['MailQueue'][_0x60b9('0x28')]);_0x547808[_0x60b9('0x2d')]=_[_0x60b9('0x2e')](_0x152b0d['query']);_0x547808['filters']=_[_0x60b9('0x30')](_0x547808[_0x60b9('0x2b')],_0x547808[_0x60b9('0x2d')]);_0xe63893[_0x60b9('0x31')]=_[_0x60b9('0x30')](_0x547808[_0x60b9('0x2b')],qs[_0x60b9('0x32')](_0x152b0d['query'][_0x60b9('0x32')]));_0xe63893['attributes']=_0xe63893['attributes'][_0x60b9('0x33')]?_0xe63893['attributes']:_0x547808['model'];if(_0x152b0d[_0x60b9('0x2d')][_0x60b9('0x3c')]){_0xe63893[_0x60b9('0x3d')]=[{'all':!![]}];}_0xe63893=_[_0x60b9('0x3a')]({},_0xe63893,_0x152b0d[_0x60b9('0x3b')]);return db[_0x60b9('0x27')][_0x60b9('0x43')](_0xe63893)[_0x60b9('0x1e')](handleEntityNotFound(_0xdd671e,null))[_0x60b9('0x1e')](respondWithResult(_0xdd671e,null))[_0x60b9('0x40')](handleError(_0xdd671e,null));};exports['create']=function(_0x1162b4,_0x439063){return db[_0x60b9('0x27')][_0x60b9('0x44')](_0x1162b4[_0x60b9('0x45')],{})[_0x60b9('0x1e')](function(_0x2eada4){var _0x121690=_0x1162b4[_0x60b9('0x46')]['get']({'plain':!![]});if(!_0x121690)throw new Error(_0x60b9('0x47'));if(_0x121690[_0x60b9('0x48')]===_0x60b9('0x46')){var _0x13aaa2=_0x2eada4['get']({'plain':!![]});var _0x62a8c2=_0x60b9('0x20');return db[_0x60b9('0x49')][_0x60b9('0x43')]({'where':{'name':_0x62a8c2,'userProfileId':_0x121690[_0x60b9('0x4a')]},'raw':!![]})[_0x60b9('0x1e')](function(_0x2ec1cf){if(_0x2ec1cf&&_0x2ec1cf[_0x60b9('0x4b')]===0x0){return db['UserProfileResource'][_0x60b9('0x44')]({'name':_0x13aaa2[_0x60b9('0x24')],'resourceId':_0x13aaa2['id'],'type':_0x2ec1cf[_0x60b9('0x24')],'sectionId':_0x2ec1cf['id']},{})['then'](function(){return _0x2eada4;});}else{return _0x2eada4;}})[_0x60b9('0x40')](function(_0x1af127){logger['error'](_0x60b9('0x4c'),_0x1af127);throw _0x1af127;});}return _0x2eada4;})[_0x60b9('0x1e')](respondWithResult(_0x439063,0xc9))[_0x60b9('0x40')](handleError(_0x439063,null));};exports[_0x60b9('0x4d')]=function(_0xbfb79f,_0x5c3eae){if(_0xbfb79f[_0x60b9('0x45')]['id']){delete _0xbfb79f['body']['id'];}return db['MailQueue'][_0x60b9('0x43')]({'where':{'id':_0xbfb79f['params']['id']}})[_0x60b9('0x1e')](handleEntityNotFound(_0x5c3eae,null))[_0x60b9('0x1e')](saveUpdates(_0xbfb79f[_0x60b9('0x45')],null))[_0x60b9('0x1e')](respondWithResult(_0x5c3eae,null))['catch'](handleError(_0x5c3eae,null));};exports['destroy']=function(_0x260e52,_0x36621b){return db[_0x60b9('0x27')][_0x60b9('0x43')]({'where':{'id':_0x260e52['params']['id']}})['then'](handleEntityNotFound(_0x36621b,null))['then'](removeEntity(_0x36621b,null))['catch'](handleError(_0x36621b,null));};exports[_0x60b9('0x4e')]=function(_0x4a5c3,_0x4e25c1){return db[_0x60b9('0x27')]['describe']()[_0x60b9('0x1e')](respondWithResult(_0x4e25c1,null))[_0x60b9('0x40')](handleError(_0x4e25c1,null));};exports[_0x60b9('0x4f')]=function(_0xd0a09a,_0x1ce370,_0x29704c){var _0x5529e6={'raw':!![],'where':{}},_0x122168={},_0x5a3742;return db['MailQueue'][_0x60b9('0x50')]({'where':{'id':_0xd0a09a[_0x60b9('0x42')]['id']}})[_0x60b9('0x1e')](handleEntityNotFound(_0x1ce370,null))['then'](function(_0x37fccf){if(_0x37fccf){_0x5a3742=_0x37fccf['get']({'plain':!![]});_0x122168[_0x60b9('0x2b')]=_['keys'](db[_0x60b9('0x51')]['rawAttributes']);_0x122168['query']=_['keys'](_0xd0a09a[_0x60b9('0x2d')]);_0x122168['filters']=_[_0x60b9('0x30')](_0x122168['model'],_0x122168[_0x60b9('0x2d')]);_0x5529e6[_0x60b9('0x31')]=_[_0x60b9('0x30')](_0x122168[_0x60b9('0x2b')],qs[_0x60b9('0x32')](_0xd0a09a[_0x60b9('0x2d')][_0x60b9('0x32')]));_0x5529e6[_0x60b9('0x31')]=_0x5529e6[_0x60b9('0x31')][_0x60b9('0x33')]?_0x5529e6[_0x60b9('0x31')]:_0x122168[_0x60b9('0x2b')];if(!_0xd0a09a[_0x60b9('0x2d')][_0x60b9('0x34')]('nolimit')){_0x5529e6[_0x60b9('0x18')]=qs['limit'](_0xd0a09a[_0x60b9('0x2d')][_0x60b9('0x18')]);_0x5529e6[_0x60b9('0x15')]=qs['offset'](_0xd0a09a[_0x60b9('0x2d')]['offset']);}_0x5529e6['order']=qs['sort'](_0xd0a09a[_0x60b9('0x2d')][_0x60b9('0x36')]);_0x5529e6['where']=qs['filters'](_['pick'](_0xd0a09a[_0x60b9('0x2d')],_0x122168[_0x60b9('0x2f')]));_0x5529e6['where'][_0x60b9('0x52')]=_0x37fccf['id'];if(_0xd0a09a[_0x60b9('0x2d')][_0x60b9('0x39')]){_0x5529e6[_0x60b9('0x37')]=_['merge'](_0x5529e6[_0x60b9('0x37')],{'$or':_['map'](_0x5529e6[_0x60b9('0x31')],function(_0x4d443d){var _0x3b1954={};_0x3b1954[_0x4d443d]={'$like':'%'+_0xd0a09a['query'][_0x60b9('0x39')]+'%'};return _0x3b1954;})});}_0x5529e6=_[_0x60b9('0x3a')]({},_0x5529e6,_0xd0a09a[_0x60b9('0x3b')]);return db[_0x60b9('0x51')][_0x60b9('0x3e')](_0x5529e6);}})[_0x60b9('0x1e')](function(_0x55eabc){if(_0x55eabc){return db[_0x60b9('0x53')][_0x60b9('0x54')]({'where':{'id':_[_0x60b9('0x2c')](_0x55eabc,_0x60b9('0x55')),'role':_0x60b9('0x56')},'attributes':['id',_0x60b9('0x24'),_0x60b9('0x57'),_0x60b9('0x58'),'createdAt']});}})[_0x60b9('0x1e')](function(_0x239094){if(_0x239094){return{'count':_0x239094[_0x60b9('0x17')],'rows':_[_0x60b9('0x2c')](_0x239094[_0x60b9('0x3f')],function(_0x407784){return{'membername':_0x407784[_0x60b9('0x24')],'UserId':_0x407784['id'],'queue_name':_0x5a3742[_0x60b9('0x24')],'MailQueueId':_0x5a3742['id'],'interface':util[_0x60b9('0x59')](_0x60b9('0x5a'),_0x60b9('0x5b'),_0x407784[_0x60b9('0x24')]),'penalty':0x0,'paused':_0x407784[_0x60b9('0x57')],'createdAt':_0x407784[_0x60b9('0x5c')],'updatedAt':_0x407784[_0x60b9('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x60b9('0x1e')](respondWithFilteredResult(_0x1ce370,_0x5529e6))[_0x60b9('0x40')](handleError(_0x1ce370,null));};exports[_0x60b9('0x5d')]=function(_0x1a5b14,_0x14bd5d,_0x51a824){var _0x515902={};var _0x41f4b0={};var _0x194ff4;var _0x2e53c4;return db[_0x60b9('0x27')][_0x60b9('0x50')]({'where':{'id':_0x1a5b14[_0x60b9('0x42')]['id']}})['then'](handleEntityNotFound(_0x14bd5d,null))[_0x60b9('0x1e')](function(_0x3b2198){if(_0x3b2198){_0x194ff4=_0x3b2198;_0x41f4b0[_0x60b9('0x2b')]=_[_0x60b9('0x2e')](db[_0x60b9('0x5e')][_0x60b9('0x28')]);_0x41f4b0[_0x60b9('0x2d')]=_[_0x60b9('0x2e')](_0x1a5b14[_0x60b9('0x2d')]);_0x41f4b0[_0x60b9('0x2f')]=_[_0x60b9('0x30')](_0x41f4b0['model'],_0x41f4b0[_0x60b9('0x2d')]);_0x515902[_0x60b9('0x31')]=_['intersection'](_0x41f4b0[_0x60b9('0x2b')],qs[_0x60b9('0x32')](_0x1a5b14[_0x60b9('0x2d')]['fields']));_0x515902['attributes']=_0x515902[_0x60b9('0x31')][_0x60b9('0x33')]?_0x515902[_0x60b9('0x31')]:_0x41f4b0[_0x60b9('0x2b')];_0x515902[_0x60b9('0x35')]=qs[_0x60b9('0x36')](_0x1a5b14['query'][_0x60b9('0x36')]);_0x515902[_0x60b9('0x37')]=qs['filters'](_[_0x60b9('0x38')](_0x1a5b14[_0x60b9('0x2d')],_0x41f4b0['filters']));if(_0x1a5b14[_0x60b9('0x2d')]['filter']){_0x515902[_0x60b9('0x37')]=_[_0x60b9('0x3a')](_0x515902['where'],{'$or':_['map'](_0x515902[_0x60b9('0x31')],function(_0x23e178){var _0x28e057={};_0x28e057[_0x23e178]={'$like':'%'+_0x1a5b14['query'][_0x60b9('0x39')]+'%'};return _0x28e057;})});}_0x515902=_[_0x60b9('0x3a')]({},_0x515902,_0x1a5b14[_0x60b9('0x3b')]);return _0x194ff4[_0x60b9('0x5d')](_0x515902);}})[_0x60b9('0x1e')](function(_0x173889){if(_0x173889){_0x2e53c4=_0x173889[_0x60b9('0x33')];if(!_0x1a5b14[_0x60b9('0x2d')][_0x60b9('0x34')](_0x60b9('0x5f'))){_0x515902[_0x60b9('0x18')]=qs[_0x60b9('0x18')](_0x1a5b14['query'][_0x60b9('0x18')]);_0x515902[_0x60b9('0x15')]=qs[_0x60b9('0x15')](_0x1a5b14[_0x60b9('0x2d')]['offset']);}return _0x194ff4['getTeams'](_0x515902);}})['then'](function(_0x45f6a4){if(_0x45f6a4){return _0x45f6a4?{'count':_0x2e53c4,'rows':_0x45f6a4}:null;}})[_0x60b9('0x1e')](respondWithResult(_0x14bd5d,null))[_0x60b9('0x40')](handleError(_0x14bd5d,null));};exports[_0x60b9('0x60')]=function(_0x406252,_0x5eb133,_0x37391d){var _0x3b5847=_0x406252[_0x60b9('0x45')][_0x60b9('0x61')];return db['Team'][_0x60b9('0x3e')]({'where':{'id':_0x3b5847},'attributes':['id'],'include':[{'model':db[_0x60b9('0x53')],'as':'Agents','attributes':['id',_0x60b9('0x24'),'online',_0x60b9('0x62'),'interface'],'raw':!![]}]})[_0x60b9('0x1e')](function(_0x162805){if(_0x162805){var _0x331cfc=_[_0x60b9('0x63')](_0x162805,function(_0x258573){var _0x52429b=_0x258573[_0x60b9('0x64')]({'plain':!![]});return _0x52429b['Agents'];});return db['MailQueue'][_0x60b9('0x43')]({'where':{'id':_0x406252['params']['id']}})[_0x60b9('0x1e')](function(_0x38da11){return db['sequelize']['transaction'](function(_0xbb8eee){return _0x38da11[_0x60b9('0x60')](_0x3b5847,{'transaction':_0xbb8eee})[_0x60b9('0x1e')](function(){return BPromise['each'](_0x331cfc,function(_0xcbd461){return db[_0x60b9('0x51')]['findOrCreate']({'where':{'UserId':_0xcbd461['id'],'MailQueueId':_0x406252[_0x60b9('0x42')]['id']},'transaction':_0xbb8eee});});})[_0x60b9('0x1e')](function(){_0x331cfc['forEach'](function(_0x4b6006){socket[_0x60b9('0x65')](_0x60b9('0x66'),{'UserId':_0x4b6006['id'],'MailQueueId':_0x38da11['id']});});});});});}})[_0x60b9('0x1e')](respondWithStatusCode(_0x5eb133,null))['catch'](handleError(_0x5eb133,null));};exports['removeTeams']=function(_0x2c7cea,_0x30541c,_0xe9b376){return db['Team'][_0x60b9('0x3e')]({'where':{'id':_0x2c7cea['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x60b9('0x53')],'as':_0x60b9('0x67'),'attributes':['id'],'raw':!![]}]})[_0x60b9('0x1e')](handleEntityNotFound(_0x30541c,null))[_0x60b9('0x1e')](function(_0x19393b){var _0x44e8b0=_[_0x60b9('0x2c')](_0x19393b,'id');var _0x40b5d3=[];var _0x42db17=[];var _0x5944ff=squel[_0x60b9('0x68')]();_0x5944ff[_0x60b9('0x69')]('tq.TeamId')[_0x60b9('0x6a')](_0x60b9('0x6b'),'tq')['join'](_0x60b9('0x6c'),'ut',_0x60b9('0x6d'))[_0x60b9('0x37')](_0x60b9('0x6e'),_0x2c7cea[_0x60b9('0x42')]['id']);for(var _0x42410b=0x0;_0x42410b<_0x19393b[_0x60b9('0x33')];_0x42410b+=0x1){let _0x1ec048=_0x19393b[_0x42410b];for(var _0x584504=0x0;_0x584504<_0x1ec048['Agents'][_0x60b9('0x33')];_0x584504+=0x1){let _0x473232=_0x1ec048[_0x60b9('0x67')][_0x584504];var _0xf19d19=_0x5944ff[_0x60b9('0x6f')]();_0xf19d19[_0x60b9('0x37')]('ut.UserId\x20=\x20?',_0x473232['id']);_0x42db17[_0x60b9('0x70')](db[_0x60b9('0x71')][_0x60b9('0x2d')](_0xf19d19[_0x60b9('0x72')](),{'type':db[_0x60b9('0x71')][_0x60b9('0x73')][_0x60b9('0x74')]})[_0x60b9('0x1e')](function(_0x4bc295){if(_0x4bc295[_0x60b9('0x33')]===0x1){return _0x473232['id'];}else{var _0x559baa=_[_0x60b9('0x75')](_[_0x60b9('0x2c')](_0x4bc295,_0x60b9('0x76')),function(_0xdc0b7d){return _[_0x60b9('0x77')](_0x44e8b0,_0xdc0b7d);});if(_0x559baa){return _0x473232['id'];}}}));}}return BPromise['all'](_0x42db17)[_0x60b9('0x1e')](function(_0x133b68){_0x40b5d3=_(_0x40b5d3)[_0x60b9('0x78')](_0x133b68)[_0x60b9('0x79')]()[_0x60b9('0x7a')]();return db[_0x60b9('0x27')]['find']({'where':{'id':_0x2c7cea[_0x60b9('0x42')]['id']}})[_0x60b9('0x1e')](function(_0x3a0f35){return db[_0x60b9('0x71')][_0x60b9('0x7b')](function(_0x4883d6){return _0x3a0f35[_0x60b9('0x7c')](_0x2c7cea[_0x60b9('0x2d')][_0x60b9('0x61')],{'transaction':_0x4883d6})[_0x60b9('0x1e')](function(){if(!_[_0x60b9('0x7d')](_0x40b5d3)){return _0x3a0f35[_0x60b9('0x7e')](_0x40b5d3,{'transaction':_0x4883d6});}})['then'](function(){_0x40b5d3[_0x60b9('0x7f')](function(_0x296efc){socket[_0x60b9('0x65')](_0x60b9('0x80'),{'UserId':_0x296efc,'MailQueueId':_0x3a0f35['id']});});});});});});})[_0x60b9('0x1e')](respondWithStatusCode(_0x30541c,null))[_0x60b9('0x40')](handleError(_0x30541c,null));};exports[_0x60b9('0x81')]=function(_0x2cd9ff,_0x110370,_0x3a2b17){return db[_0x60b9('0x27')][_0x60b9('0x43')]({'where':{'id':_0x2cd9ff[_0x60b9('0x42')]['id']}})[_0x60b9('0x1e')](handleEntityNotFound(_0x110370,null))[_0x60b9('0x1e')](function(_0x491be5){if(_0x491be5){return _0x491be5[_0x60b9('0x81')](_0x2cd9ff[_0x60b9('0x45')][_0x60b9('0x61')],_[_0x60b9('0x82')](_0x2cd9ff[_0x60b9('0x45')],['ids','id'])||{})[_0x60b9('0x83')](function(_0x26795c){for(var _0x4f37ec=0x0;_0x4f37ec<_0x2cd9ff[_0x60b9('0x45')]['ids']['length'];_0x4f37ec+=0x1){socket[_0x60b9('0x65')](_0x60b9('0x66'),{'UserId':Number(_0x2cd9ff['body'][_0x60b9('0x61')][_0x4f37ec]),'MailQueueId':Number(_0x2cd9ff['params']['id'])});}return _0x26795c;});}})[_0x60b9('0x1e')](respondWithResult(_0x110370,null))[_0x60b9('0x40')](handleError(_0x110370,null));};exports['removeAgents']=function(_0x78a7aa,_0xadfa41,_0x5076b5){return db[_0x60b9('0x27')][_0x60b9('0x43')]({'where':{'id':_0x78a7aa[_0x60b9('0x42')]['id']}})[_0x60b9('0x1e')](handleEntityNotFound(_0xadfa41,null))[_0x60b9('0x1e')](function(_0x2cfecb){if(_0x2cfecb){return _0x2cfecb[_0x60b9('0x7e')](_0x78a7aa['query']['ids'])['then'](function(){if(_[_0x60b9('0x84')](_0x78a7aa['query'][_0x60b9('0x61')])){for(var _0x4dd50f=0x0;_0x4dd50f<_0x78a7aa[_0x60b9('0x2d')][_0x60b9('0x61')][_0x60b9('0x33')];_0x4dd50f+=0x1){socket['emit'](_0x60b9('0x80'),{'UserId':Number(_0x78a7aa[_0x60b9('0x2d')][_0x60b9('0x61')][_0x4dd50f]),'MailQueueId':Number(_0x78a7aa['params']['id'])});}}else{socket[_0x60b9('0x65')]('userMailQueue:remove',{'UserId':Number(_0x78a7aa[_0x60b9('0x2d')][_0x60b9('0x61')]),'MailQueueId':Number(_0x78a7aa[_0x60b9('0x42')]['id'])});}});}})[_0x60b9('0x1e')](respondWithStatusCode(_0xadfa41,null))[_0x60b9('0x40')](handleError(_0xadfa41,null));};exports[_0x60b9('0x85')]=function(_0x1e0faf,_0x5092c1,_0x15d916){var _0x47b77f={};var _0x28ed02={};var _0x6232c3;var _0x160f41;return db['MailQueue']['findOne']({'where':{'id':_0x1e0faf[_0x60b9('0x42')]['id']}})[_0x60b9('0x1e')](handleEntityNotFound(_0x5092c1,null))[_0x60b9('0x1e')](function(_0x52a12a){if(_0x52a12a){_0x6232c3=_0x52a12a;_0x28ed02['model']=_['keys'](db[_0x60b9('0x53')][_0x60b9('0x28')]);_0x28ed02[_0x60b9('0x2d')]=_[_0x60b9('0x2e')](_0x1e0faf[_0x60b9('0x2d')]);_0x28ed02[_0x60b9('0x2f')]=_[_0x60b9('0x30')](_0x28ed02[_0x60b9('0x2b')],_0x28ed02[_0x60b9('0x2d')]);_0x47b77f[_0x60b9('0x31')]=_[_0x60b9('0x30')](_0x28ed02[_0x60b9('0x2b')],qs[_0x60b9('0x32')](_0x1e0faf['query']['fields']));_0x47b77f[_0x60b9('0x31')]=_0x47b77f[_0x60b9('0x31')][_0x60b9('0x33')]?_0x47b77f[_0x60b9('0x31')]:_0x28ed02[_0x60b9('0x2b')];_0x47b77f[_0x60b9('0x35')]=qs[_0x60b9('0x36')](_0x1e0faf['query']['sort']);_0x47b77f[_0x60b9('0x37')]=qs[_0x60b9('0x2f')](_[_0x60b9('0x38')](_0x1e0faf['query'],_0x28ed02[_0x60b9('0x2f')]));if(_0x1e0faf['query']['filter']){_0x47b77f[_0x60b9('0x37')]=_[_0x60b9('0x3a')](_0x47b77f[_0x60b9('0x37')],{'$or':_[_0x60b9('0x2c')](_0x47b77f[_0x60b9('0x31')],function(_0x613025){var _0x838559={};_0x838559[_0x613025]={'$like':'%'+_0x1e0faf[_0x60b9('0x2d')][_0x60b9('0x39')]+'%'};return _0x838559;})});}_0x47b77f=_['merge']({},_0x47b77f,_0x1e0faf[_0x60b9('0x3b')]);return _0x6232c3[_0x60b9('0x85')](_0x47b77f);}})['then'](function(_0xefc606){if(_0xefc606){_0x160f41=_0xefc606[_0x60b9('0x33')];if(!_0x1e0faf['query'][_0x60b9('0x34')](_0x60b9('0x5f'))){_0x47b77f['limit']=qs[_0x60b9('0x18')](_0x1e0faf['query'][_0x60b9('0x18')]);_0x47b77f[_0x60b9('0x15')]=qs['offset'](_0x1e0faf[_0x60b9('0x2d')][_0x60b9('0x15')]);}return _0x6232c3['getAgents'](_0x47b77f);}})['then'](function(_0x5b1e37){if(_0x5b1e37){return _0x5b1e37?{'count':_0x160f41,'rows':_0x5b1e37}:null;}})[_0x60b9('0x1e')](respondWithResult(_0x5092c1,null))[_0x60b9('0x40')](handleError(_0x5092c1,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 54ffb58..7eb1eee 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 _0x5909=['remove','emit','hook','events','MailQueue','setMaxListeners','save','update'];(function(_0x4f80fd,_0x32cb7b){var _0x3eb190=function(_0xe123c5){while(--_0xe123c5){_0x4f80fd['push'](_0x4f80fd['shift']());}};_0x3eb190(++_0x32cb7b);}(_0x5909,0xeb));var _0x9590=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0x5909[_0x11e03f];return _0x5666fe;};'use strict';var EventEmitter=require(_0x9590('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x9590('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9590('0x2')](0x0);var events={'afterCreate':_0x9590('0x3'),'afterUpdate':_0x9590('0x4'),'afterDestroy':_0x9590('0x5')};function emitEvent(_0x3a2e6f){return function(_0x193d6d,_0x58f7c3,_0x4070bf){MailQueueEvents[_0x9590('0x6')](_0x3a2e6f+':'+_0x193d6d['id'],_0x193d6d);MailQueueEvents[_0x9590('0x6')](_0x3a2e6f,_0x193d6d);_0x4070bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x9590('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xb01d=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xb01d,0xb2));var _0xdb01=function(_0x4632d1,_0x455bd8){_0x4632d1=_0x4632d1-0x0;var _0x4c20b6=_0xb01d[_0x4632d1];return _0x4c20b6;};'use strict';var EventEmitter=require(_0xdb01('0x0'));var MailQueue=require(_0xdb01('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdb01('0x2'),'afterUpdate':_0xdb01('0x3'),'afterDestroy':_0xdb01('0x4')};function emitEvent(_0x2bc48f){return function(_0x15a029,_0xa888d7,_0x44584c){MailQueueEvents[_0xdb01('0x5')](_0x2bc48f+':'+_0x15a029['id'],_0x15a029);MailQueueEvents['emit'](_0x2bc48f,_0x15a029);_0x44584c(null);};}for(var e in events){if(events[_0xdb01('0x6')](e)){var event=events[e];MailQueue[_0xdb01('0x7')](e,emitEvent(event));}}module[_0xdb01('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 95ddba0..b390c30 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 _0x4a56=['bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','util','api','moment'];(function(_0x494e0d,_0x518118){var _0x4c21b9=function(_0x4aa178){while(--_0x4aa178){_0x494e0d['push'](_0x494e0d['shift']());}};_0x4c21b9(++_0x518118);}(_0x4a56,0x17c));var _0x64a5=function(_0x549188,_0x49c316){_0x549188=_0x549188-0x0;var _0x2e13bb=_0x4a56[_0x549188];return _0x2e13bb;};'use strict';var _=require(_0x64a5('0x0'));var util=require(_0x64a5('0x1'));var logger=require('../../config/logger')(_0x64a5('0x2'));var moment=require(_0x64a5('0x3'));var BPromise=require(_0x64a5('0x4'));var rp=require(_0x64a5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64a5('0x6'));var config=require(_0x64a5('0x7'));var attributes=require(_0x64a5('0x8'));module[_0x64a5('0x9')]=function(_0x4d7361,_0x17317b){return _0x4d7361['define'](_0x64a5('0xa'),attributes,{'tableName':_0x64a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21cd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailQueue.attributes','exports','MailQueue','mail_queues','util'];(function(_0x29734a,_0x16fb77){var _0x41eb5f=function(_0xfd3597){while(--_0xfd3597){_0x29734a['push'](_0x29734a['shift']());}};_0x41eb5f(++_0x16fb77);}(_0x21cd,0x18b));var _0xd21c=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x21cd[_0x1a7846];return _0x48049;};'use strict';var _=require('lodash');var util=require(_0xd21c('0x0'));var logger=require(_0xd21c('0x1'))(_0xd21c('0x2'));var moment=require(_0xd21c('0x3'));var BPromise=require(_0xd21c('0x4'));var rp=require(_0xd21c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd21c('0x6'));var config=require('../../config/environment');var attributes=require(_0xd21c('0x7'));module[_0xd21c('0x8')]=function(_0x2c3e0b,_0x3ccc76){return _0x2c3e0b['define'](_0xd21c('0x9'),attributes,{'tableName':_0xd21c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index da0a539..346c6ae 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 _0x49c9=['ioredis','../../config/logger','../../config/environment','client','redis','localhost','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','model','map','ShowMailQueue','find','lodash','util','bluebird','randomstring'];(function(_0x428de5,_0x464f3f){var _0x2f9bfc=function(_0x3e2d4f){while(--_0x3e2d4f){_0x428de5['push'](_0x428de5['shift']());}};_0x2f9bfc(++_0x464f3f);}(_0x49c9,0x164));var _0x949c=function(_0x295dac,_0x4f0f65){_0x295dac=_0x295dac-0x0;var _0x52b1cc=_0x49c9[_0x295dac];return _0x52b1cc;};'use strict';var _=require(_0x949c('0x0'));var util=require(_0x949c('0x1'));var moment=require('moment');var BPromise=require(_0x949c('0x2'));var rs=require(_0x949c('0x3'));var fs=require('fs');var Redis=require(_0x949c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949c('0x5'))('rpc');var config=require(_0x949c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x949c('0x7')]['http']({'port':0x232a});config[_0x949c('0x8')]=_['defaults'](config[_0x949c('0x8')],{'host':_0x949c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x949c('0x8')]));require(_0x949c('0xa'))[_0x949c('0xb')](socket);function respondWithRpcPromise(_0xb5d26b,_0x2744dc,_0x3e1476){return new BPromise(function(_0x1e8d94,_0x250b74){return client['request'](_0xb5d26b,_0x3e1476)[_0x949c('0xc')](function(_0x2c9736){logger[_0x949c('0xd')](_0x949c('0xe'),_0x2744dc,_0x949c('0xf'));logger[_0x949c('0x10')](_0x949c('0x11'),_0x2744dc,'request\x20sent',JSON[_0x949c('0x12')](_0x2c9736));if(_0x2c9736['error']){if(_0x2c9736['error'][_0x949c('0x13')]===0x1f4){logger[_0x949c('0x14')](_0x949c('0xe'),_0x2744dc,_0x2c9736[_0x949c('0x14')][_0x949c('0x15')]);return _0x250b74(_0x2c9736[_0x949c('0x14')][_0x949c('0x15')]);}logger[_0x949c('0x14')](_0x949c('0xe'),_0x2744dc,_0x2c9736[_0x949c('0x14')][_0x949c('0x15')]);return _0x1e8d94(_0x2c9736['error'][_0x949c('0x15')]);}else{logger['info'](_0x949c('0xe'),_0x2744dc,_0x949c('0xf'));_0x1e8d94(_0x2c9736[_0x949c('0x16')]['message']);}})[_0x949c('0x17')](function(_0x8bba12){logger[_0x949c('0x14')](_0x949c('0xe'),_0x2744dc,_0x8bba12);_0x250b74(_0x8bba12);});});}exports[_0x949c('0x18')]=function(_0x27e2cf){var _0x214904=this;return new Promise(function(_0x54dd79,_0x2ff8aa){return db[_0x949c('0x19')]['findAll']({'raw':_0x27e2cf[_0x949c('0x1a')]?_0x27e2cf['options'][_0x949c('0x1b')]===undefined?!![]:![]:!![],'where':_0x27e2cf[_0x949c('0x1a')]?_0x27e2cf[_0x949c('0x1a')][_0x949c('0x1c')]||null:null,'attributes':_0x27e2cf[_0x949c('0x1a')]?_0x27e2cf[_0x949c('0x1a')][_0x949c('0x1d')]||null:null,'limit':_0x27e2cf[_0x949c('0x1a')]?_0x27e2cf['options'][_0x949c('0x1e')]||null:null,'include':_0x27e2cf[_0x949c('0x1a')]?_0x27e2cf[_0x949c('0x1a')][_0x949c('0x1f')]?_['map'](_0x27e2cf[_0x949c('0x1a')][_0x949c('0x1f')],function(_0x2449b0){return{'model':db[_0x2449b0[_0x949c('0x20')]],'as':_0x2449b0['as'],'attributes':_0x2449b0[_0x949c('0x1d')],'include':_0x2449b0[_0x949c('0x1f')]?_[_0x949c('0x21')](_0x2449b0[_0x949c('0x1f')],function(_0x49d968){return{'model':db[_0x49d968[_0x949c('0x20')]],'as':_0x49d968['as'],'attributes':_0x49d968[_0x949c('0x1d')],'include':_0x49d968['include']?_['map'](_0x49d968['include'],function(_0x309edf){return{'model':db[_0x309edf[_0x949c('0x20')]],'as':_0x309edf['as'],'attributes':_0x309edf[_0x949c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x949c('0xc')](function(_0x5813eb){logger['info'](_0x949c('0x18'),_0x27e2cf);logger[_0x949c('0x10')](_0x949c('0x18'),_0x27e2cf,JSON[_0x949c('0x12')](_0x5813eb));_0x54dd79(_0x5813eb);})['catch'](function(_0x4350f2){logger[_0x949c('0x14')]('GetMailQueue',_0x4350f2['message'],_0x27e2cf);_0x2ff8aa(_0x214904[_0x949c('0x14')](0x1f4,_0x4350f2['message']));});});};exports[_0x949c('0x22')]=function(_0x5bca85){var _0x3e2a8a=this;return new Promise(function(_0x48fbce,_0x442aca){return db[_0x949c('0x19')][_0x949c('0x23')]({'raw':_0x5bca85[_0x949c('0x1a')]?_0x5bca85[_0x949c('0x1a')][_0x949c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5bca85[_0x949c('0x1a')]?_0x5bca85[_0x949c('0x1a')][_0x949c('0x1c')]||null:null,'attributes':_0x5bca85[_0x949c('0x1a')]?_0x5bca85['options'][_0x949c('0x1d')]||null:null,'include':_0x5bca85[_0x949c('0x1a')]?_0x5bca85[_0x949c('0x1a')][_0x949c('0x1f')]?_[_0x949c('0x21')](_0x5bca85[_0x949c('0x1a')][_0x949c('0x1f')],function(_0x76ddb1){return{'model':db[_0x76ddb1['model']],'as':_0x76ddb1['as'],'attributes':_0x76ddb1[_0x949c('0x1d')],'include':_0x76ddb1[_0x949c('0x1f')]?_['map'](_0x76ddb1[_0x949c('0x1f')],function(_0x2c16ac){return{'model':db[_0x2c16ac[_0x949c('0x20')]],'as':_0x2c16ac['as'],'attributes':_0x2c16ac[_0x949c('0x1d')],'include':_0x2c16ac[_0x949c('0x1f')]?_[_0x949c('0x21')](_0x2c16ac[_0x949c('0x1f')],function(_0x2eff43){return{'model':db[_0x2eff43[_0x949c('0x20')]],'as':_0x2eff43['as'],'attributes':_0x2eff43[_0x949c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b51a6){logger['info'](_0x949c('0x22'),_0x5bca85);logger[_0x949c('0x10')](_0x949c('0x22'),_0x5bca85,JSON['stringify'](_0x4b51a6));_0x48fbce(_0x4b51a6);})[_0x949c('0x17')](function(_0x5e0ebd){logger['error'](_0x949c('0x22'),_0x5e0ebd['message'],_0x5bca85);_0x442aca(_0x3e2a8a[_0x949c('0x14')](0x1f4,_0x5e0ebd[_0x949c('0x15')]));});});}; \ No newline at end of file +var _0x7cd2=['util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','GetMailQueue','ShowMailQueue','find'];(function(_0x385c76,_0xb97335){var _0x5c8367=function(_0xdfcd3){while(--_0xdfcd3){_0x385c76['push'](_0x385c76['shift']());}};_0x5c8367(++_0xb97335);}(_0x7cd2,0x118));var _0x27cd=function(_0x4beb19,_0x289cd4){_0x4beb19=_0x4beb19-0x0;var _0x4bd768=_0x7cd2[_0x4beb19];return _0x4bd768;};'use strict';var _=require('lodash');var util=require(_0x27cd('0x0'));var moment=require(_0x27cd('0x1'));var BPromise=require(_0x27cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27cd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x27cd('0x4'))(_0x27cd('0x5'));var config=require(_0x27cd('0x6'));var jayson=require(_0x27cd('0x7'));var client=jayson[_0x27cd('0x8')][_0x27cd('0x9')]({'port':0x232a});config['redis']=_[_0x27cd('0xa')](config['redis'],{'host':_0x27cd('0xb'),'port':0x18eb});var socket=require(_0x27cd('0xc'))(new Redis(config['redis']));require(_0x27cd('0xd'))[_0x27cd('0xe')](socket);function respondWithRpcPromise(_0x13733c,_0x508c0e,_0x1157a9){return new BPromise(function(_0x15f3ef,_0x336959){return client[_0x27cd('0xf')](_0x13733c,_0x1157a9)['then'](function(_0xe19837){logger[_0x27cd('0x10')](_0x27cd('0x11'),_0x508c0e,_0x27cd('0x12'));logger[_0x27cd('0x13')](_0x27cd('0x14'),_0x508c0e,'request\x20sent',JSON[_0x27cd('0x15')](_0xe19837));if(_0xe19837[_0x27cd('0x16')]){if(_0xe19837['error'][_0x27cd('0x17')]===0x1f4){logger[_0x27cd('0x16')](_0x27cd('0x11'),_0x508c0e,_0xe19837[_0x27cd('0x16')]['message']);return _0x336959(_0xe19837[_0x27cd('0x16')][_0x27cd('0x18')]);}logger[_0x27cd('0x16')]('MailQueue,\x20%s,\x20%s',_0x508c0e,_0xe19837[_0x27cd('0x16')][_0x27cd('0x18')]);return _0x15f3ef(_0xe19837[_0x27cd('0x16')][_0x27cd('0x18')]);}else{logger[_0x27cd('0x10')](_0x27cd('0x11'),_0x508c0e,_0x27cd('0x12'));_0x15f3ef(_0xe19837['result']['message']);}})[_0x27cd('0x19')](function(_0x58574e){logger[_0x27cd('0x16')](_0x27cd('0x11'),_0x508c0e,_0x58574e);_0x336959(_0x58574e);});});}exports['GetMailQueue']=function(_0x210a27){var _0x11cb6b=this;return new Promise(function(_0x96622f,_0x4c3cc8){return db[_0x27cd('0x1a')][_0x27cd('0x1b')]({'raw':_0x210a27[_0x27cd('0x1c')]?_0x210a27[_0x27cd('0x1c')][_0x27cd('0x1d')]===undefined?!![]:![]:!![],'where':_0x210a27[_0x27cd('0x1c')]?_0x210a27[_0x27cd('0x1c')][_0x27cd('0x1e')]||null:null,'attributes':_0x210a27[_0x27cd('0x1c')]?_0x210a27[_0x27cd('0x1c')]['attributes']||null:null,'limit':_0x210a27['options']?_0x210a27[_0x27cd('0x1c')][_0x27cd('0x1f')]||null:null,'include':_0x210a27['options']?_0x210a27['options'][_0x27cd('0x20')]?_[_0x27cd('0x21')](_0x210a27[_0x27cd('0x1c')]['include'],function(_0x368c84){return{'model':db[_0x368c84[_0x27cd('0x22')]],'as':_0x368c84['as'],'attributes':_0x368c84[_0x27cd('0x23')],'include':_0x368c84[_0x27cd('0x20')]?_[_0x27cd('0x21')](_0x368c84[_0x27cd('0x20')],function(_0x299153){return{'model':db[_0x299153[_0x27cd('0x22')]],'as':_0x299153['as'],'attributes':_0x299153[_0x27cd('0x23')],'include':_0x299153[_0x27cd('0x20')]?_['map'](_0x299153['include'],function(_0x7eb2e7){return{'model':db[_0x7eb2e7[_0x27cd('0x22')]],'as':_0x7eb2e7['as'],'attributes':_0x7eb2e7[_0x27cd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x27cd('0x24')](function(_0x55cfe7){logger[_0x27cd('0x10')](_0x27cd('0x25'),_0x210a27);logger[_0x27cd('0x13')](_0x27cd('0x25'),_0x210a27,JSON[_0x27cd('0x15')](_0x55cfe7));_0x96622f(_0x55cfe7);})[_0x27cd('0x19')](function(_0x1d7316){logger[_0x27cd('0x16')]('GetMailQueue',_0x1d7316[_0x27cd('0x18')],_0x210a27);_0x4c3cc8(_0x11cb6b[_0x27cd('0x16')](0x1f4,_0x1d7316['message']));});});};exports[_0x27cd('0x26')]=function(_0x353ecd){var _0x5edd3=this;return new Promise(function(_0x39e8da,_0x3d5b70){return db[_0x27cd('0x1a')][_0x27cd('0x27')]({'raw':_0x353ecd[_0x27cd('0x1c')]?_0x353ecd[_0x27cd('0x1c')][_0x27cd('0x1d')]===undefined?!![]:![]:!![],'where':_0x353ecd[_0x27cd('0x1c')]?_0x353ecd['options']['where']||null:null,'attributes':_0x353ecd[_0x27cd('0x1c')]?_0x353ecd[_0x27cd('0x1c')]['attributes']||null:null,'include':_0x353ecd[_0x27cd('0x1c')]?_0x353ecd[_0x27cd('0x1c')][_0x27cd('0x20')]?_[_0x27cd('0x21')](_0x353ecd[_0x27cd('0x1c')][_0x27cd('0x20')],function(_0x156619){return{'model':db[_0x156619['model']],'as':_0x156619['as'],'attributes':_0x156619[_0x27cd('0x23')],'include':_0x156619['include']?_[_0x27cd('0x21')](_0x156619[_0x27cd('0x20')],function(_0x3ba81){return{'model':db[_0x3ba81[_0x27cd('0x22')]],'as':_0x3ba81['as'],'attributes':_0x3ba81['attributes'],'include':_0x3ba81['include']?_[_0x27cd('0x21')](_0x3ba81[_0x27cd('0x20')],function(_0x414fae){return{'model':db[_0x414fae[_0x27cd('0x22')]],'as':_0x414fae['as'],'attributes':_0x414fae['attributes']};}):[]};}):[]};}):[]:[]})[_0x27cd('0x24')](function(_0xf2daca){logger[_0x27cd('0x10')](_0x27cd('0x26'),_0x353ecd);logger[_0x27cd('0x13')](_0x27cd('0x26'),_0x353ecd,JSON['stringify'](_0xf2daca));_0x39e8da(_0xf2daca);})[_0x27cd('0x19')](function(_0x2298af){logger[_0x27cd('0x16')](_0x27cd('0x26'),_0x2298af[_0x27cd('0x18')],_0x353ecd);_0x3d5b70(_0x5edd3['error'](0x1f4,_0x2298af['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index b8ab8c3..184de7a 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 _0x92ac=['length','./mailQueue.events','save','remove','emit','removeListener'];(function(_0x4e967e,_0x54db99){var _0x438517=function(_0x897c7f){while(--_0x897c7f){_0x4e967e['push'](_0x4e967e['shift']());}};_0x438517(++_0x54db99);}(_0x92ac,0x151));var _0xc92a=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x92ac[_0x247fa1];return _0x244f35;};'use strict';var MailQueueEvents=require(_0xc92a('0x0'));var events=[_0xc92a('0x1'),_0xc92a('0x2'),'update'];function createListener(_0x4cc5b3,_0x2d2db5){return function(_0x3f1301){_0x2d2db5[_0xc92a('0x3')](_0x4cc5b3,_0x3f1301);};}function removeListener(_0x4d3ce8,_0xd28bb9){return function(){MailQueueEvents[_0xc92a('0x4')](_0x4d3ce8,_0xd28bb9);};}exports['register']=function(_0x11407d){for(var _0xc01dc2=0x0,_0x30f693=events[_0xc92a('0x5')];_0xc01dc2<_0x30f693;_0xc01dc2++){var _0x22e746=events[_0xc01dc2];var _0x58370f=createListener('mailQueue:'+_0x22e746,_0x11407d);MailQueueEvents['on'](_0x22e746,_0x58370f);}}; \ No newline at end of file +var _0x0606=['register','length','mailQueue:','./mailQueue.events','save','remove','update','emit'];(function(_0x263971,_0x1480c9){var _0x5ad3d1=function(_0x356ef2){while(--_0x356ef2){_0x263971['push'](_0x263971['shift']());}};_0x5ad3d1(++_0x1480c9);}(_0x0606,0x17b));var _0x6060=function(_0x15a2c5,_0x4a810d){_0x15a2c5=_0x15a2c5-0x0;var _0x2b9b45=_0x0606[_0x15a2c5];return _0x2b9b45;};'use strict';var MailQueueEvents=require(_0x6060('0x0'));var events=[_0x6060('0x1'),_0x6060('0x2'),_0x6060('0x3')];function createListener(_0x2d1dbf,_0x4bbca0){return function(_0x5af90a){_0x4bbca0[_0x6060('0x4')](_0x2d1dbf,_0x5af90a);};}function removeListener(_0x78b1f0,_0x4f5418){return function(){MailQueueEvents['removeListener'](_0x78b1f0,_0x4f5418);};}exports[_0x6060('0x5')]=function(_0x9a1242){for(var _0x1a7a52=0x0,_0x2367d2=events[_0x6060('0x6')];_0x1a7a52<_0x2367d2;_0x1a7a52++){var _0x22a96f=events[_0x1a7a52];var _0x141d99=createListener(_0x6060('0x7')+_0x22a96f,_0x9a1242);MailQueueEvents['on'](_0x22a96f,_0x141d99);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index db1361e..7e2e402 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 _0xabbb=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x3c8ef1,_0xffc911){var _0x33a620=function(_0x345b8b){while(--_0x345b8b){_0x3c8ef1['push'](_0x3c8ef1['shift']());}};_0x33a620(++_0xffc911);}(_0xabbb,0xd5));var _0xbabb=function(_0x5e171b,_0x490274){_0x5e171b=_0x5e171b-0x0;var _0x6c9dbf=_0xabbb[_0x5e171b];return _0x6c9dbf;};'use strict';var multer=require('multer');var util=require(_0xbabb('0x0'));var path=require(_0xbabb('0x1'));var timeout=require(_0xbabb('0x2'));var express=require(_0xbabb('0x3'));var router=express[_0xbabb('0x4')]();var fs_extra=require(_0xbabb('0x5'));var auth=require(_0xbabb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbabb('0x7'));var controller=require('./mailQueueReport.controller');router[_0xbabb('0x8')]('/',auth[_0xbabb('0x9')](),controller[_0xbabb('0xa')]);router[_0xbabb('0x8')](_0xbabb('0xb'),auth['isAuthenticated'](),controller[_0xbabb('0xc')]);router['get'](_0xbabb('0xd'),auth[_0xbabb('0x9')](),controller[_0xbabb('0xe')]);router[_0xbabb('0xf')]('/',auth[_0xbabb('0x9')](),controller[_0xbabb('0x10')]);router['put'](_0xbabb('0xd'),auth['isAuthenticated'](),controller[_0xbabb('0x11')]);router[_0xbabb('0x12')]('/:id',auth[_0xbabb('0x9')](),controller[_0xbabb('0x13')]);module[_0xbabb('0x14')]=router; \ No newline at end of file +var _0x31c2=['/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','describe'];(function(_0x557704,_0x3004c2){var _0x299541=function(_0x37fbff){while(--_0x37fbff){_0x557704['push'](_0x557704['shift']());}};_0x299541(++_0x3004c2);}(_0x31c2,0x7f));var _0x231c=function(_0x484fb7,_0x2e00d0){_0x484fb7=_0x484fb7-0x0;var _0x132e7b=_0x31c2[_0x484fb7];return _0x132e7b;};'use strict';var multer=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var path=require('path');var timeout=require(_0x231c('0x2'));var express=require(_0x231c('0x3'));var router=express[_0x231c('0x4')]();var fs_extra=require(_0x231c('0x5'));var auth=require(_0x231c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x231c('0x7'));var controller=require(_0x231c('0x8'));router['get']('/',auth[_0x231c('0x9')](),controller[_0x231c('0xa')]);router[_0x231c('0xb')]('/describe',auth[_0x231c('0x9')](),controller[_0x231c('0xc')]);router[_0x231c('0xb')](_0x231c('0xd'),auth[_0x231c('0x9')](),controller[_0x231c('0xe')]);router[_0x231c('0xf')]('/',auth[_0x231c('0x9')](),controller[_0x231c('0x10')]);router[_0x231c('0x11')](_0x231c('0xd'),auth[_0x231c('0x9')](),controller[_0x231c('0x12')]);router[_0x231c('0x13')](_0x231c('0xd'),auth[_0x231c('0x9')](),controller['destroy']);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 9e6e37e..af5ae43 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 _0x2942=['STRING','moment','sequelize','exports','DATE'];(function(_0xc308aa,_0x104911){var _0x140cda=function(_0x280a40){while(--_0x280a40){_0xc308aa['push'](_0xc308aa['shift']());}};_0x140cda(++_0x104911);}(_0x2942,0x15f));var _0x2294=function(_0x1d0289,_0x330d13){_0x1d0289=_0x1d0289-0x0;var _0x1e9d9a=_0x2942[_0x1d0289];return _0x1e9d9a;};'use strict';var moment=require(_0x2294('0x0'));var Sequelize=require(_0x2294('0x1'));module[_0x2294('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2294('0x3')]},'acceptAt':{'type':Sequelize[_0x2294('0x3')]},'exitAt':{'type':Sequelize[_0x2294('0x3')]},'reason':{'type':Sequelize[_0x2294('0x4')]}}; \ No newline at end of file +var _0x05e4=['sequelize','STRING','DATE','moment'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x05e4,0x173));var _0x405e=function(_0x87d42,_0x36d77b){_0x87d42=_0x87d42-0x0;var _0x1d1a3f=_0x05e4[_0x87d42];return _0x1d1a3f;};'use strict';var moment=require(_0x405e('0x0'));var Sequelize=require(_0x405e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x405e('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x405e('0x3')]},'acceptAt':{'type':Sequelize[_0x405e('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index a998ca5..b9174c5 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 _0x0b0e=['merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','MailQueueReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter'];(function(_0xa909a3,_0x5cc944){var _0x5ba19e=function(_0x5e4ea8){while(--_0x5e4ea8){_0xa909a3['push'](_0xa909a3['shift']());}};_0x5ba19e(++_0x5cc944);}(_0x0b0e,0x187));var _0xe0b0=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x0b0e[_0x479509];return _0x382da8;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['MailQueueReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['MailQueueReport'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['MailQueueReport']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};exports[_0xe0b0('0x4a')]=function(_0x54cf7b,_0x4b65d1){return db[_0xe0b0('0x2a')][_0xe0b0('0x4a')]()[_0xe0b0('0x23')](respondWithResult(_0x4b65d1,null))[_0xe0b0('0x43')](handleError(_0x4b65d1,null));}; \ No newline at end of file +var _0xadb5=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','MailQueueReport','fieldName','type','key','model','query','keys'];(function(_0x120fdb,_0x586aa3){var _0xc2f5ba=function(_0x34c71a){while(--_0x34c71a){_0x120fdb['push'](_0x120fdb['shift']());}};_0xc2f5ba(++_0x586aa3);}(_0xadb5,0xad));var _0x5adb=function(_0x2f8ee1,_0x23a0a6){_0x2f8ee1=_0x2f8ee1-0x0;var _0x4bdb16=_0xadb5[_0x2f8ee1];return _0x4bdb16;};'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['MailQueueReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};exports['describe']=function(_0x36b847,_0x3a5703){return db[_0x5adb('0x2a')][_0x5adb('0x49')]()['then'](respondWithResult(_0x3a5703,null))[_0x5adb('0x42')](handleError(_0x3a5703,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 62ed6ad..363af33 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 _0x7a4b=['uniqueid','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue'];(function(_0x3bfc8e,_0x22bcdb){var _0x74bb71=function(_0x327cc9){while(--_0x327cc9){_0x3bfc8e['push'](_0x3bfc8e['shift']());}};_0x74bb71(++_0x22bcdb);}(_0x7a4b,0x18d));var _0xb7a4=function(_0x161387,_0x292bae){_0x161387=_0x161387-0x0;var _0x3aa06f=_0x7a4b[_0x161387];return _0x3aa06f;};'use strict';var _=require(_0xb7a4('0x0'));var util=require('util');var logger=require(_0xb7a4('0x1'))(_0xb7a4('0x2'));var moment=require(_0xb7a4('0x3'));var BPromise=require(_0xb7a4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb7a4('0x5'));var config=require(_0xb7a4('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0xb7a4('0x7')]=function(_0x4e12a7,_0x1a68f5){return _0x4e12a7[_0xb7a4('0x8')](_0xb7a4('0x9'),attributes,{'tableName':_0xb7a4('0xa'),'paranoid':![],'indexes':[{'name':_0xb7a4('0xb'),'fields':[_0xb7a4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a39=['request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','../../config/logger','api','moment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8a39,0x17d));var _0x98a3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a39[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x98a3('0x0'))(_0x98a3('0x1'));var moment=require(_0x98a3('0x2'));var BPromise=require('bluebird');var rp=require(_0x98a3('0x3'));var fs=require('fs');var path=require(_0x98a3('0x4'));var rimraf=require(_0x98a3('0x5'));var config=require(_0x98a3('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x98a3('0x7')]=function(_0x360fa,_0x427586){return _0x360fa[_0x98a3('0x8')](_0x98a3('0x9'),attributes,{'tableName':_0x98a3('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x98a3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 8737c53..1229476 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x1ee84f,_0x429152){var _0x491216=function(_0x22b6f6){while(--_0x22b6f6){_0x1ee84f['push'](_0x1ee84f['shift']());}};_0x491216(++_0x429152);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x45be3c,_0x270c21){var _0xfe48ef=function(_0x244582){while(--_0x244582){_0x45be3c['push'](_0x45be3c['shift']());}};_0xfe48ef(++_0x270c21);}(_0xadb5,0xad));var _0x5adb=function(_0x29e794,_0x4d8992){_0x29e794=_0x29e794-0x0;var _0x2b09e1=_0xadb5[_0x29e794];return _0x2b09e1;};'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']('MailQueueReport,\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);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index fa63043..3910976 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x8f1dcd,_0x1cc0a3){var _0x59d077=function(_0x35c618){while(--_0x35c618){_0x8f1dcd['push'](_0x8f1dcd['shift']());}};_0x59d077(++_0x1cc0a3);}(_0xe706,0xa3));var _0x6e70=function(_0x5e4fdc,_0x183475){_0x5e4fdc=_0x5e4fdc-0x0;var _0xe2d401=_0xe706[_0x5e4fdc];return _0xe2d401;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x23aade,_0x1053bf){var _0x148b47=function(_0x2b0873){while(--_0x2b0873){_0x23aade['push'](_0x23aade['shift']());}};_0x148b47(++_0x1053bf);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index af11f26..647e089 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 _0xe130=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xe130,0x127));var _0x0e13=function(_0x2f9255,_0x6c97c4){_0x2f9255=_0x2f9255-0x0;var _0x3861f4=_0xe130[_0x2f9255];return _0x3861f4;};'use strict';var Sequelize=require(_0x0e13('0x0'));module[_0x0e13('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0e13('0x2')]},'authentication':{'type':Sequelize[_0x0e13('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0e13('0x2')]},'password':{'type':Sequelize[_0x0e13('0x2')]},'port':{'type':Sequelize[_0x0e13('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0e13('0x2')],'defaultValue':_0x0e13('0x5')},'connTimeout':{'type':Sequelize[_0x0e13('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0e13('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2f3a=['INBOX','sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x40bc7e,_0x2e4594){_0x40bc7e=_0x40bc7e-0x0;var _0x2f3ffa=_0x2f3a[_0x40bc7e];return _0x2f3ffa;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa2f3('0x1')]},'authentication':{'type':Sequelize[_0xa2f3('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa2f3('0x1')]},'password':{'type':Sequelize[_0xa2f3('0x1')]},'port':{'type':Sequelize[_0xa2f3('0x3')]},'tls':{'type':Sequelize[_0xa2f3('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xa2f3('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa2f3('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa2f3('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ef52279..0351169 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 _0xab09=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','api','request-promise','path','rimraf','../../config/environment'];(function(_0x56ae02,_0xe52aee){var _0x230969=function(_0x4e28ce){while(--_0x4e28ce){_0x56ae02['push'](_0x56ae02['shift']());}};_0x230969(++_0xe52aee);}(_0xab09,0xc0));var _0x9ab0=function(_0x37ce45,_0xda6746){_0x37ce45=_0x37ce45-0x0;var _0x17d5f7=_0xab09[_0x37ce45];return _0x17d5f7;};'use strict';var _=require(_0x9ab0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9ab0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9ab0('0x2'));var fs=require('fs');var path=require(_0x9ab0('0x3'));var rimraf=require(_0x9ab0('0x4'));var config=require(_0x9ab0('0x5'));var attributes=require(_0x9ab0('0x6'));module[_0x9ab0('0x7')]=function(_0x3d5d8a,_0x1b9905){return _0x3d5d8a[_0x9ab0('0x8')](_0x9ab0('0x9'),attributes,{'tableName':_0x9ab0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd360=['path','rimraf','../../config/environment','./mailServerIn.attributes','define','mail_servers_in','../../config/logger','api','bluebird','request-promise'];(function(_0x35968f,_0x2117c7){var _0x1271f2=function(_0xbcf25){while(--_0xbcf25){_0x35968f['push'](_0x35968f['shift']());}};_0x1271f2(++_0x2117c7);}(_0xd360,0xb0));var _0x0d36=function(_0x1e46ea,_0x59ca80){_0x1e46ea=_0x1e46ea-0x0;var _0x4008cd=_0xd360[_0x1e46ea];return _0x4008cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d36('0x0'))(_0x0d36('0x1'));var moment=require('moment');var BPromise=require(_0x0d36('0x2'));var rp=require(_0x0d36('0x3'));var fs=require('fs');var path=require(_0x0d36('0x4'));var rimraf=require(_0x0d36('0x5'));var config=require(_0x0d36('0x6'));var attributes=require(_0x0d36('0x7'));module['exports']=function(_0x5bbcc9,_0xea59e6){return _0x5bbcc9[_0x0d36('0x8')]('MailServerIn',attributes,{'tableName':_0x0d36('0x9'),'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 777628f..f4e3184 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 _0xd17b=['debug','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','model','attributes','map','include','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0xa3ced,_0x32ae57){var _0xabf66=function(_0x4f3705){while(--_0x4f3705){_0xa3ced['push'](_0xa3ced['shift']());}};_0xabf66(++_0x32ae57);}(_0xd17b,0x16c));var _0xbd17=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xd17b[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xbd17('0x0'));var util=require(_0xbd17('0x1'));var moment=require(_0xbd17('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd17('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd17('0x4'))['db'];var utils=require(_0xbd17('0x5'));var logger=require('../../config/logger')(_0xbd17('0x6'));var config=require(_0xbd17('0x7'));var jayson=require(_0xbd17('0x8'));var client=jayson[_0xbd17('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1797b5,_0xf32a90,_0x53880c){return new BPromise(function(_0x2f72ad,_0x22030f){return client['request'](_0x1797b5,_0x53880c)['then'](function(_0x209dd6){logger[_0xbd17('0xa')](_0xbd17('0xb'),_0xf32a90,_0xbd17('0xc'));logger[_0xbd17('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0xf32a90,'request\x20sent',JSON[_0xbd17('0xe')](_0x209dd6));if(_0x209dd6[_0xbd17('0xf')]){if(_0x209dd6['error'][_0xbd17('0x10')]===0x1f4){logger[_0xbd17('0xf')](_0xbd17('0xb'),_0xf32a90,_0x209dd6['error'][_0xbd17('0x11')]);return _0x22030f(_0x209dd6['error'][_0xbd17('0x11')]);}logger['error'](_0xbd17('0xb'),_0xf32a90,_0x209dd6[_0xbd17('0xf')]['message']);return _0x2f72ad(_0x209dd6[_0xbd17('0xf')][_0xbd17('0x11')]);}else{logger[_0xbd17('0xa')](_0xbd17('0xb'),_0xf32a90,_0xbd17('0xc'));_0x2f72ad(_0x209dd6[_0xbd17('0x12')]['message']);}})[_0xbd17('0x13')](function(_0x564e17){logger[_0xbd17('0xf')](_0xbd17('0xb'),_0xf32a90,_0x564e17);_0x22030f(_0x564e17);});});}exports[_0xbd17('0x14')]=function(_0x429285){var _0x47be4b=this;return new Promise(function(_0xbff5fd,_0x1e3c58){return db[_0xbd17('0x15')][_0xbd17('0x16')]({'raw':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['where']||null:null,'attributes':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['attributes']||null:null,'limit':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['limit']||null:null,'include':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['include']?_['map'](_0x429285[_0xbd17('0x17')]['include'],function(_0x3c4ca2){return{'model':db[_0x3c4ca2[_0xbd17('0x18')]],'as':_0x3c4ca2['as'],'attributes':_0x3c4ca2[_0xbd17('0x19')],'include':_0x3c4ca2['include']?_[_0xbd17('0x1a')](_0x3c4ca2[_0xbd17('0x1b')],function(_0x2e9cf4){return{'model':db[_0x2e9cf4['model']],'as':_0x2e9cf4['as'],'attributes':_0x2e9cf4[_0xbd17('0x19')],'include':_0x2e9cf4['include']?_[_0xbd17('0x1a')](_0x2e9cf4[_0xbd17('0x1b')],function(_0x160980){return{'model':db[_0x160980[_0xbd17('0x18')]],'as':_0x160980['as'],'attributes':_0x160980['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd17('0x1c')](function(_0x28af0c){logger[_0xbd17('0xa')](_0xbd17('0x14'),_0x429285);logger[_0xbd17('0xd')]('GetMailServerIn',_0x429285,JSON['stringify'](_0x28af0c));_0xbff5fd(_0x28af0c);})['catch'](function(_0x5cacf2){logger[_0xbd17('0xf')](_0xbd17('0x14'),_0x5cacf2[_0xbd17('0x11')],_0x429285);_0x1e3c58(_0x47be4b[_0xbd17('0xf')](0x1f4,_0x5cacf2['message']));});});}; \ No newline at end of file +var _0x8445=['../../config/logger','../../config/environment','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailServerIn','findAll','options','where','attributes','limit','model','include','map','then','GetMailServerIn','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2683d4,_0x1148c2){var _0x493266=function(_0x566c4a){while(--_0x566c4a){_0x2683d4['push'](_0x2683d4['shift']());}};_0x493266(++_0x1148c2);}(_0x8445,0x1a7));var _0x5844=function(_0x46af7e,_0x3e32c7){_0x46af7e=_0x46af7e-0x0;var _0x4c0447=_0x8445[_0x46af7e];return _0x4c0447;};'use strict';var _=require(_0x5844('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5844('0x1'));var rs=require(_0x5844('0x2'));var fs=require('fs');var Redis=require(_0x5844('0x3'));var db=require(_0x5844('0x4'))['db'];var utils=require(_0x5844('0x5'));var logger=require(_0x5844('0x6'))('rpc');var config=require(_0x5844('0x7'));var jayson=require(_0x5844('0x8'));var client=jayson['client'][_0x5844('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57e6ca,_0x5dacca,_0x3848e5){return new BPromise(function(_0x2863e5,_0x554b9f){return client[_0x5844('0xa')](_0x57e6ca,_0x3848e5)['then'](function(_0x40762f){logger[_0x5844('0xb')](_0x5844('0xc'),_0x5dacca,_0x5844('0xd'));logger[_0x5844('0xe')](_0x5844('0xf'),_0x5dacca,_0x5844('0xd'),JSON[_0x5844('0x10')](_0x40762f));if(_0x40762f[_0x5844('0x11')]){if(_0x40762f['error'][_0x5844('0x12')]===0x1f4){logger[_0x5844('0x11')]('MailServerIn,\x20%s,\x20%s',_0x5dacca,_0x40762f[_0x5844('0x11')][_0x5844('0x13')]);return _0x554b9f(_0x40762f['error'][_0x5844('0x13')]);}logger[_0x5844('0x11')]('MailServerIn,\x20%s,\x20%s',_0x5dacca,_0x40762f[_0x5844('0x11')][_0x5844('0x13')]);return _0x2863e5(_0x40762f[_0x5844('0x11')][_0x5844('0x13')]);}else{logger[_0x5844('0xb')]('MailServerIn,\x20%s,\x20%s',_0x5dacca,'request\x20sent');_0x2863e5(_0x40762f[_0x5844('0x14')]['message']);}})[_0x5844('0x15')](function(_0xeaa061){logger[_0x5844('0x11')](_0x5844('0xc'),_0x5dacca,_0xeaa061);_0x554b9f(_0xeaa061);});});}exports['GetMailServerIn']=function(_0x12e0af){var _0x398461=this;return new Promise(function(_0x5db3fc,_0x4b2fae){return db[_0x5844('0x16')][_0x5844('0x17')]({'raw':_0x12e0af[_0x5844('0x18')]?_0x12e0af['options']['raw']===undefined?!![]:![]:!![],'where':_0x12e0af[_0x5844('0x18')]?_0x12e0af[_0x5844('0x18')][_0x5844('0x19')]||null:null,'attributes':_0x12e0af['options']?_0x12e0af[_0x5844('0x18')][_0x5844('0x1a')]||null:null,'limit':_0x12e0af['options']?_0x12e0af[_0x5844('0x18')][_0x5844('0x1b')]||null:null,'include':_0x12e0af[_0x5844('0x18')]?_0x12e0af[_0x5844('0x18')]['include']?_['map'](_0x12e0af[_0x5844('0x18')]['include'],function(_0x211288){return{'model':db[_0x211288[_0x5844('0x1c')]],'as':_0x211288['as'],'attributes':_0x211288['attributes'],'include':_0x211288[_0x5844('0x1d')]?_[_0x5844('0x1e')](_0x211288[_0x5844('0x1d')],function(_0x238f82){return{'model':db[_0x238f82[_0x5844('0x1c')]],'as':_0x238f82['as'],'attributes':_0x238f82[_0x5844('0x1a')],'include':_0x238f82[_0x5844('0x1d')]?_[_0x5844('0x1e')](_0x238f82[_0x5844('0x1d')],function(_0x227799){return{'model':db[_0x227799[_0x5844('0x1c')]],'as':_0x227799['as'],'attributes':_0x227799[_0x5844('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5844('0x1f')](function(_0x469384){logger[_0x5844('0xb')]('GetMailServerIn',_0x12e0af);logger['debug'](_0x5844('0x20'),_0x12e0af,JSON['stringify'](_0x469384));_0x5db3fc(_0x469384);})[_0x5844('0x15')](function(_0x55a862){logger[_0x5844('0x11')](_0x5844('0x20'),_0x55a862[_0x5844('0x13')],_0x12e0af);_0x4b2fae(_0x398461['error'](0x1f4,_0x55a862[_0x5844('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 54233e1..382e912 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(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x7a54,0x106));var _0x47a5=function(_0x4fe5a3,_0x209905){_0x4fe5a3=_0x4fe5a3-0x0;var _0x208ecc=_0x7a54[_0x4fe5a3];return _0x208ecc;};'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(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 38ca8fc..045dd00 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 _0x3cb6=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x2d91f2,_0x4b56ae){var _0x1ba446=function(_0x1668e0){while(--_0x1668e0){_0x2d91f2['push'](_0x2d91f2['shift']());}};_0x1ba446(++_0x4b56ae);}(_0x3cb6,0x7e));var _0x63cb=function(_0x28a4c0,_0x2206d0){_0x28a4c0=_0x28a4c0-0x0;var _0x320be8=_0x3cb6[_0x28a4c0];return _0x320be8;};'use strict';var Sequelize=require(_0x63cb('0x0'));module[_0x63cb('0x1')]={'description':{'type':Sequelize[_0x63cb('0x2')]},'host':{'type':Sequelize[_0x63cb('0x2')]},'user':{'type':Sequelize[_0x63cb('0x2')]},'pass':{'type':Sequelize[_0x63cb('0x2')]},'port':{'type':Sequelize[_0x63cb('0x3')]},'secure':{'type':Sequelize[_0x63cb('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x63cb('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa1d5=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x150c44,_0x5636d5){var _0xe7b06=function(_0x386bc0){while(--_0x386bc0){_0x150c44['push'](_0x150c44['shift']());}};_0xe7b06(++_0x5636d5);}(_0xa1d5,0x145));var _0x5a1d=function(_0x102d85,_0x55c0d8){_0x102d85=_0x102d85-0x0;var _0x7f8ef0=_0xa1d5[_0x102d85];return _0x7f8ef0;};'use strict';var Sequelize=require('sequelize');module[_0x5a1d('0x0')]={'description':{'type':Sequelize[_0x5a1d('0x1')]},'host':{'type':Sequelize[_0x5a1d('0x1')]},'user':{'type':Sequelize[_0x5a1d('0x1')]},'pass':{'type':Sequelize[_0x5a1d('0x1')]},'port':{'type':Sequelize[_0x5a1d('0x2')]},'secure':{'type':Sequelize[_0x5a1d('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x5a1d('0x1')]},'authentication':{'type':Sequelize[_0x5a1d('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index f00d6fc..83fefd1 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 _0x16e8=['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','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','keys','attributes','intersection','fields','query','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x16e8,0xde));var _0x816e=function(_0x5cc01f,_0x48a222){_0x5cc01f=_0x5cc01f-0x0;var _0x30dd16=_0x16e8[_0x5cc01f];return _0x30dd16;};'use strict';var emlformat=require(_0x816e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x816e('0x1'));var jsonpatch=require(_0x816e('0x2'));var rp=require(_0x816e('0x3'));var moment=require(_0x816e('0x4'));var BPromise=require(_0x816e('0x5'));var Mustache=require('mustache');var util=require(_0x816e('0x6'));var path=require(_0x816e('0x7'));var sox=require(_0x816e('0x8'));var csv=require(_0x816e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x816e('0xa'));var _=require(_0x816e('0xb'));var squel=require(_0x816e('0xc'));var crypto=require(_0x816e('0xd'));var jsforce=require(_0x816e('0xe'));var deskjs=require(_0x816e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x816e('0x10'));var Papa=require('papaparse');var Redis=require(_0x816e('0x11'));var authService=require(_0x816e('0x12'));var qs=require(_0x816e('0x13'));var as=require(_0x816e('0x14'));var hardwareService=require(_0x816e('0x15'));var logger=require('../../config/logger')(_0x816e('0x16'));var utils=require(_0x816e('0x17'));var config=require(_0x816e('0x18'));var licenseUtil=require(_0x816e('0x19'));var db=require(_0x816e('0x1a'))['db'];function respondWithStatusCode(_0x254c7a,_0x1dd92e){_0x1dd92e=_0x1dd92e||0xcc;return function(_0x2735b9){if(_0x2735b9){return _0x254c7a['sendStatus'](_0x1dd92e);}return _0x254c7a[_0x816e('0x1b')](_0x1dd92e)[_0x816e('0x1c')]();};}function respondWithResult(_0x1b3da3,_0x9deabd){_0x9deabd=_0x9deabd||0xc8;return function(_0x193fc2){if(_0x193fc2){return _0x1b3da3[_0x816e('0x1b')](_0x9deabd)['json'](_0x193fc2);}};}function respondWithFilteredResult(_0x4327e9,_0x6a5e2){return function(_0x2cd60a){if(_0x2cd60a){var _0x3d6157=typeof _0x6a5e2[_0x816e('0x1d')]===_0x816e('0x1e')&&typeof _0x6a5e2[_0x816e('0x1f')]==='undefined';var _0x39fe50=_0x2cd60a[_0x816e('0x20')];var _0x2d0854=_0x3d6157?0x0:_0x6a5e2['offset'];var _0x49f695=_0x3d6157?_0x2cd60a[_0x816e('0x20')]:_0x6a5e2['offset']+_0x6a5e2[_0x816e('0x1f')];var _0x596290;if(_0x49f695>=_0x39fe50){_0x49f695=_0x39fe50;_0x596290=0xc8;}else{_0x596290=0xce;}_0x4327e9[_0x816e('0x1b')](_0x596290);return _0x4327e9[_0x816e('0x21')](_0x816e('0x22'),_0x2d0854+'-'+_0x49f695+'/'+_0x39fe50)[_0x816e('0x23')](_0x2cd60a);}return null;};}function patchUpdates(_0x326298){return function(_0x44adba){try{jsonpatch[_0x816e('0x24')](_0x44adba,_0x326298,!![]);}catch(_0x2e51cf){return BPromise[_0x816e('0x25')](_0x2e51cf);}return _0x44adba[_0x816e('0x26')]();};}function saveUpdates(_0xb85740,_0x3d5ee3){return function(_0x383c33){if(_0x383c33){return _0x383c33['update'](_0xb85740)[_0x816e('0x27')](function(_0x47fbac){return _0x47fbac;});}return null;};}function removeEntity(_0x3582c0,_0x24c1a9){return function(_0x422ae1){if(_0x422ae1){return _0x422ae1[_0x816e('0x28')]()[_0x816e('0x27')](function(){_0x3582c0['status'](0xcc)[_0x816e('0x1c')]();});}};}function handleEntityNotFound(_0x1685b1,_0x5bfb3c){return function(_0x2e90cd){if(!_0x2e90cd){_0x1685b1[_0x816e('0x29')](0x194);}return _0x2e90cd;};}function handleError(_0x19ad73,_0x3ada7c){_0x3ada7c=_0x3ada7c||0x1f4;return function(_0x508dfd){logger[_0x816e('0x2a')](_0x508dfd[_0x816e('0x2b')]);if(_0x508dfd['name']){delete _0x508dfd[_0x816e('0x2c')];}_0x19ad73[_0x816e('0x1b')](_0x3ada7c)[_0x816e('0x2d')](_0x508dfd);};}exports[_0x816e('0x2e')]=function(_0x58062f,_0x1d8810){var _0x390f80={},_0x503136={},_0x10050a={'count':0x0,'rows':[]};var _0x148eb8=_[_0x816e('0x2f')](db[_0x816e('0x30')][_0x816e('0x31')],function(_0x231f2f){return{'name':_0x231f2f[_0x816e('0x32')],'type':_0x231f2f[_0x816e('0x33')][_0x816e('0x34')]};});_0x503136[_0x816e('0x35')]=_['map'](_0x148eb8,_0x816e('0x2c'));_0x503136['query']=_[_0x816e('0x36')](_0x58062f['query']);_0x503136['filters']=_['intersection'](_0x503136[_0x816e('0x35')],_0x503136['query']);_0x390f80[_0x816e('0x37')]=_[_0x816e('0x38')](_0x503136[_0x816e('0x35')],qs[_0x816e('0x39')](_0x58062f[_0x816e('0x3a')][_0x816e('0x39')]));_0x390f80['attributes']=_0x390f80[_0x816e('0x37')][_0x816e('0x3b')]?_0x390f80[_0x816e('0x37')]:_0x503136['model'];if(!_0x58062f[_0x816e('0x3a')]['hasOwnProperty'](_0x816e('0x3c'))){_0x390f80[_0x816e('0x1f')]=qs['limit'](_0x58062f[_0x816e('0x3a')][_0x816e('0x1f')]);_0x390f80[_0x816e('0x1d')]=qs[_0x816e('0x1d')](_0x58062f['query'][_0x816e('0x1d')]);}_0x390f80[_0x816e('0x3d')]=qs[_0x816e('0x3e')](_0x58062f[_0x816e('0x3a')][_0x816e('0x3e')]);_0x390f80[_0x816e('0x3f')]=qs[_0x816e('0x40')](_[_0x816e('0x41')](_0x58062f[_0x816e('0x3a')],_0x503136[_0x816e('0x40')]),_0x148eb8);if(_0x58062f[_0x816e('0x3a')][_0x816e('0x42')]){_0x390f80[_0x816e('0x3f')]=_[_0x816e('0x43')](_0x390f80[_0x816e('0x3f')],{'$or':_[_0x816e('0x2f')](_0x148eb8,function(_0x1190e5){if(_0x1190e5[_0x816e('0x33')]!==_0x816e('0x44')){var _0x102dde={};_0x102dde[_0x1190e5[_0x816e('0x2c')]]={'$like':'%'+_0x58062f[_0x816e('0x3a')][_0x816e('0x42')]+'%'};return _0x102dde;}})});}_0x390f80=_[_0x816e('0x43')]({},_0x390f80,_0x58062f[_0x816e('0x45')]);var _0x310c67={'where':_0x390f80[_0x816e('0x3f')]};return db['MailServerOut'][_0x816e('0x20')](_0x310c67)[_0x816e('0x27')](function(_0x59be79){_0x10050a[_0x816e('0x20')]=_0x59be79;if(_0x58062f['query'][_0x816e('0x46')]){_0x390f80[_0x816e('0x47')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x390f80);})[_0x816e('0x27')](function(_0x125bfa){_0x10050a['rows']=_0x125bfa;return _0x10050a;})[_0x816e('0x27')](respondWithFilteredResult(_0x1d8810,_0x390f80))[_0x816e('0x48')](handleError(_0x1d8810,null));};exports[_0x816e('0x49')]=function(_0x4eb367,_0x3b0354){var _0x27f40b={'raw':!![],'where':{'id':_0x4eb367['params']['id']}},_0x248c3c={};_0x248c3c[_0x816e('0x35')]=_[_0x816e('0x36')](db['MailServerOut'][_0x816e('0x31')]);_0x248c3c[_0x816e('0x3a')]=_[_0x816e('0x36')](_0x4eb367[_0x816e('0x3a')]);_0x248c3c['filters']=_[_0x816e('0x38')](_0x248c3c[_0x816e('0x35')],_0x248c3c[_0x816e('0x3a')]);_0x27f40b[_0x816e('0x37')]=_[_0x816e('0x38')](_0x248c3c[_0x816e('0x35')],qs[_0x816e('0x39')](_0x4eb367['query'][_0x816e('0x39')]));_0x27f40b[_0x816e('0x37')]=_0x27f40b['attributes'][_0x816e('0x3b')]?_0x27f40b['attributes']:_0x248c3c[_0x816e('0x35')];if(_0x4eb367[_0x816e('0x3a')][_0x816e('0x46')]){_0x27f40b[_0x816e('0x47')]=[{'all':!![]}];}_0x27f40b=_[_0x816e('0x43')]({},_0x27f40b,_0x4eb367[_0x816e('0x45')]);return db['MailServerOut'][_0x816e('0x4a')](_0x27f40b)['then'](handleEntityNotFound(_0x3b0354,null))[_0x816e('0x27')](respondWithResult(_0x3b0354,null))[_0x816e('0x48')](handleError(_0x3b0354,null));};exports[_0x816e('0x4b')]=function(_0xd0b52e,_0x22fa1d){return db['MailServerOut'][_0x816e('0x4b')](_0xd0b52e[_0x816e('0x4c')],{})['then'](respondWithResult(_0x22fa1d,0xc9))[_0x816e('0x48')](handleError(_0x22fa1d,null));};exports['update']=function(_0x545b2d,_0x4e48ff){if(_0x545b2d[_0x816e('0x4c')]['id']){delete _0x545b2d[_0x816e('0x4c')]['id'];}return db['MailServerOut'][_0x816e('0x4a')]({'where':{'id':_0x545b2d[_0x816e('0x4d')]['id']}})[_0x816e('0x27')](handleEntityNotFound(_0x4e48ff,null))[_0x816e('0x27')](saveUpdates(_0x545b2d[_0x816e('0x4c')],null))[_0x816e('0x27')](respondWithResult(_0x4e48ff,null))['catch'](handleError(_0x4e48ff,null));};exports[_0x816e('0x28')]=function(_0x479949,_0x51290f){return db[_0x816e('0x30')][_0x816e('0x4a')]({'where':{'id':_0x479949[_0x816e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x51290f,null))[_0x816e('0x27')](removeEntity(_0x51290f,null))[_0x816e('0x48')](handleError(_0x51290f,null));}; \ No newline at end of file +var _0xa0bb=['update','destroy','then','error','name','send','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','params','merge','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save'];(function(_0x15a3c1,_0x50d648){var _0x2baeba=function(_0x2c51b2){while(--_0x2c51b2){_0x15a3c1['push'](_0x15a3c1['shift']());}};_0x2baeba(++_0x50d648);}(_0xa0bb,0x1cf));var _0xba0b=function(_0xdc09bf,_0x420749){_0xdc09bf=_0xdc09bf-0x0;var _0x4cfaa3=_0xa0bb[_0xdc09bf];return _0x4cfaa3;};'use strict';var emlformat=require(_0xba0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba0b('0x1'));var jsonpatch=require(_0xba0b('0x2'));var rp=require(_0xba0b('0x3'));var moment=require(_0xba0b('0x4'));var BPromise=require(_0xba0b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xba0b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba0b('0x7'));var _=require(_0xba0b('0x8'));var squel=require(_0xba0b('0x9'));var crypto=require(_0xba0b('0xa'));var jsforce=require(_0xba0b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xba0b('0x6'));var querystring=require(_0xba0b('0xc'));var Papa=require(_0xba0b('0xd'));var Redis=require(_0xba0b('0xe'));var authService=require(_0xba0b('0xf'));var qs=require(_0xba0b('0x10'));var as=require(_0xba0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba0b('0x12'))('api');var utils=require(_0xba0b('0x13'));var config=require(_0xba0b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52d8dc,_0x2fdaef){_0x2fdaef=_0x2fdaef||0xcc;return function(_0x18cc27){if(_0x18cc27){return _0x52d8dc[_0xba0b('0x15')](_0x2fdaef);}return _0x52d8dc[_0xba0b('0x16')](_0x2fdaef)[_0xba0b('0x17')]();};}function respondWithResult(_0x21bde3,_0x4130f3){_0x4130f3=_0x4130f3||0xc8;return function(_0x6d653a){if(_0x6d653a){return _0x21bde3['status'](_0x4130f3)[_0xba0b('0x18')](_0x6d653a);}};}function respondWithFilteredResult(_0x200ba4,_0x3038c5){return function(_0x499981){if(_0x499981){var _0x45bc4c=typeof _0x3038c5[_0xba0b('0x19')]===_0xba0b('0x1a')&&typeof _0x3038c5['limit']==='undefined';var _0x2b7250=_0x499981['count'];var _0x24582d=_0x45bc4c?0x0:_0x3038c5[_0xba0b('0x19')];var _0xdabae8=_0x45bc4c?_0x499981[_0xba0b('0x1b')]:_0x3038c5[_0xba0b('0x19')]+_0x3038c5[_0xba0b('0x1c')];var _0xe67307;if(_0xdabae8>=_0x2b7250){_0xdabae8=_0x2b7250;_0xe67307=0xc8;}else{_0xe67307=0xce;}_0x200ba4[_0xba0b('0x16')](_0xe67307);return _0x200ba4[_0xba0b('0x1d')](_0xba0b('0x1e'),_0x24582d+'-'+_0xdabae8+'/'+_0x2b7250)[_0xba0b('0x18')](_0x499981);}return null;};}function patchUpdates(_0x3db9e2){return function(_0x134c87){try{jsonpatch[_0xba0b('0x1f')](_0x134c87,_0x3db9e2,!![]);}catch(_0x2b4327){return BPromise[_0xba0b('0x20')](_0x2b4327);}return _0x134c87[_0xba0b('0x21')]();};}function saveUpdates(_0x3c8fd7,_0x1fdf85){return function(_0xe8d0b1){if(_0xe8d0b1){return _0xe8d0b1[_0xba0b('0x22')](_0x3c8fd7)['then'](function(_0x55c26f){return _0x55c26f;});}return null;};}function removeEntity(_0x244b8e,_0x45db73){return function(_0x300bc5){if(_0x300bc5){return _0x300bc5[_0xba0b('0x23')]()[_0xba0b('0x24')](function(){_0x244b8e[_0xba0b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32eb4e,_0x418fab){return function(_0xbe3fb6){if(!_0xbe3fb6){_0x32eb4e[_0xba0b('0x15')](0x194);}return _0xbe3fb6;};}function handleError(_0x63c6f6,_0x136f22){_0x136f22=_0x136f22||0x1f4;return function(_0x1d19d0){logger[_0xba0b('0x25')](_0x1d19d0['stack']);if(_0x1d19d0[_0xba0b('0x26')]){delete _0x1d19d0['name'];}_0x63c6f6[_0xba0b('0x16')](_0x136f22)[_0xba0b('0x27')](_0x1d19d0);};}exports['index']=function(_0x54fb1f,_0x26480e){var _0xafbba4={},_0x26cd11={},_0x369ad9={'count':0x0,'rows':[]};var _0x341b7c=_[_0xba0b('0x28')](db[_0xba0b('0x29')][_0xba0b('0x2a')],function(_0x53a0a7){return{'name':_0x53a0a7[_0xba0b('0x2b')],'type':_0x53a0a7['type'][_0xba0b('0x2c')]};});_0x26cd11[_0xba0b('0x2d')]=_[_0xba0b('0x28')](_0x341b7c,_0xba0b('0x26'));_0x26cd11[_0xba0b('0x2e')]=_[_0xba0b('0x2f')](_0x54fb1f[_0xba0b('0x2e')]);_0x26cd11['filters']=_[_0xba0b('0x30')](_0x26cd11[_0xba0b('0x2d')],_0x26cd11['query']);_0xafbba4[_0xba0b('0x31')]=_[_0xba0b('0x30')](_0x26cd11['model'],qs[_0xba0b('0x32')](_0x54fb1f[_0xba0b('0x2e')][_0xba0b('0x32')]));_0xafbba4[_0xba0b('0x31')]=_0xafbba4[_0xba0b('0x31')][_0xba0b('0x33')]?_0xafbba4[_0xba0b('0x31')]:_0x26cd11[_0xba0b('0x2d')];if(!_0x54fb1f[_0xba0b('0x2e')][_0xba0b('0x34')]('nolimit')){_0xafbba4[_0xba0b('0x1c')]=qs[_0xba0b('0x1c')](_0x54fb1f[_0xba0b('0x2e')][_0xba0b('0x1c')]);_0xafbba4['offset']=qs[_0xba0b('0x19')](_0x54fb1f[_0xba0b('0x2e')][_0xba0b('0x19')]);}_0xafbba4[_0xba0b('0x35')]=qs[_0xba0b('0x36')](_0x54fb1f[_0xba0b('0x2e')][_0xba0b('0x36')]);_0xafbba4[_0xba0b('0x37')]=qs[_0xba0b('0x38')](_[_0xba0b('0x39')](_0x54fb1f[_0xba0b('0x2e')],_0x26cd11[_0xba0b('0x38')]),_0x341b7c);if(_0x54fb1f[_0xba0b('0x2e')][_0xba0b('0x3a')]){_0xafbba4[_0xba0b('0x37')]=_['merge'](_0xafbba4[_0xba0b('0x37')],{'$or':_[_0xba0b('0x28')](_0x341b7c,function(_0x352388){if(_0x352388[_0xba0b('0x3b')]!==_0xba0b('0x3c')){var _0x2cedbf={};_0x2cedbf[_0x352388[_0xba0b('0x26')]]={'$like':'%'+_0x54fb1f[_0xba0b('0x2e')][_0xba0b('0x3a')]+'%'};return _0x2cedbf;}})});}_0xafbba4=_['merge']({},_0xafbba4,_0x54fb1f[_0xba0b('0x3d')]);var _0x584cad={'where':_0xafbba4[_0xba0b('0x37')]};return db['MailServerOut']['count'](_0x584cad)[_0xba0b('0x24')](function(_0x10ad58){_0x369ad9[_0xba0b('0x1b')]=_0x10ad58;if(_0x54fb1f[_0xba0b('0x2e')][_0xba0b('0x3e')]){_0xafbba4[_0xba0b('0x3f')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0xafbba4);})[_0xba0b('0x24')](function(_0x4ce102){_0x369ad9[_0xba0b('0x40')]=_0x4ce102;return _0x369ad9;})[_0xba0b('0x24')](respondWithFilteredResult(_0x26480e,_0xafbba4))[_0xba0b('0x41')](handleError(_0x26480e,null));};exports['show']=function(_0x24f60b,_0x47f23e){var _0x2ae4de={'raw':!![],'where':{'id':_0x24f60b[_0xba0b('0x42')]['id']}},_0x4ce474={};_0x4ce474[_0xba0b('0x2d')]=_[_0xba0b('0x2f')](db[_0xba0b('0x29')][_0xba0b('0x2a')]);_0x4ce474['query']=_['keys'](_0x24f60b[_0xba0b('0x2e')]);_0x4ce474['filters']=_[_0xba0b('0x30')](_0x4ce474[_0xba0b('0x2d')],_0x4ce474[_0xba0b('0x2e')]);_0x2ae4de[_0xba0b('0x31')]=_[_0xba0b('0x30')](_0x4ce474['model'],qs['fields'](_0x24f60b[_0xba0b('0x2e')]['fields']));_0x2ae4de[_0xba0b('0x31')]=_0x2ae4de[_0xba0b('0x31')][_0xba0b('0x33')]?_0x2ae4de[_0xba0b('0x31')]:_0x4ce474[_0xba0b('0x2d')];if(_0x24f60b[_0xba0b('0x2e')][_0xba0b('0x3e')]){_0x2ae4de[_0xba0b('0x3f')]=[{'all':!![]}];}_0x2ae4de=_[_0xba0b('0x43')]({},_0x2ae4de,_0x24f60b[_0xba0b('0x3d')]);return db[_0xba0b('0x29')]['find'](_0x2ae4de)[_0xba0b('0x24')](handleEntityNotFound(_0x47f23e,null))[_0xba0b('0x24')](respondWithResult(_0x47f23e,null))[_0xba0b('0x41')](handleError(_0x47f23e,null));};exports[_0xba0b('0x44')]=function(_0x188f1c,_0x22a002){return db[_0xba0b('0x29')][_0xba0b('0x44')](_0x188f1c['body'],{})[_0xba0b('0x24')](respondWithResult(_0x22a002,0xc9))[_0xba0b('0x41')](handleError(_0x22a002,null));};exports[_0xba0b('0x22')]=function(_0x15ee8f,_0x1f0d91){if(_0x15ee8f[_0xba0b('0x45')]['id']){delete _0x15ee8f[_0xba0b('0x45')]['id'];}return db[_0xba0b('0x29')]['find']({'where':{'id':_0x15ee8f[_0xba0b('0x42')]['id']}})[_0xba0b('0x24')](handleEntityNotFound(_0x1f0d91,null))[_0xba0b('0x24')](saveUpdates(_0x15ee8f[_0xba0b('0x45')],null))[_0xba0b('0x24')](respondWithResult(_0x1f0d91,null))[_0xba0b('0x41')](handleError(_0x1f0d91,null));};exports[_0xba0b('0x23')]=function(_0x16e4ee,_0xfcfc4){return db['MailServerOut'][_0xba0b('0x46')]({'where':{'id':_0x16e4ee['params']['id']}})[_0xba0b('0x24')](handleEntityNotFound(_0xfcfc4,null))['then'](removeEntity(_0xfcfc4,null))[_0xba0b('0x41')](handleError(_0xfcfc4,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 27221c6..5fdfc2b 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 _0x69c0=['../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','request-promise','path'];(function(_0x5bdf58,_0x2a3a6f){var _0x100b14=function(_0x1430eb){while(--_0x1430eb){_0x5bdf58['push'](_0x5bdf58['shift']());}};_0x100b14(++_0x2a3a6f);}(_0x69c0,0x1db));var _0x069c=function(_0x2b07a1,_0x25c79a){_0x2b07a1=_0x2b07a1-0x0;var _0x4bb96b=_0x69c0[_0x2b07a1];return _0x4bb96b;};'use strict';var _=require(_0x069c('0x0'));var util=require('util');var logger=require(_0x069c('0x1'))(_0x069c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x069c('0x3'));var fs=require('fs');var path=require(_0x069c('0x4'));var rimraf=require('rimraf');var config=require(_0x069c('0x5'));var attributes=require('./mailServerOut.attributes');module[_0x069c('0x6')]=function(_0x2d632d,_0x351318){return _0x2d632d[_0x069c('0x7')](_0x069c('0x8'),attributes,{'tableName':_0x069c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe26d=['rimraf','../../config/environment','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3acf41,_0x5285dd){var _0x5b51e7=function(_0x1d965f){while(--_0x1d965f){_0x3acf41['push'](_0x3acf41['shift']());}};_0x5b51e7(++_0x5285dd);}(_0xe26d,0xf7));var _0xde26=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe26d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xde26('0x0'));var util=require('util');var logger=require(_0xde26('0x1'))(_0xde26('0x2'));var moment=require(_0xde26('0x3'));var BPromise=require(_0xde26('0x4'));var rp=require(_0xde26('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde26('0x6'));var config=require(_0xde26('0x7'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x29ea11,_0x270583){return _0x29ea11[_0xde26('0x8')](_0xde26('0x9'),attributes,{'tableName':_0xde26('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 8da20e9..a7ab8b6 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x123c08,_0x584a0e){var _0x4d2bd4=function(_0x39431e){while(--_0x39431e){_0x123c08['push'](_0x123c08['shift']());}};_0x4d2bd4(++_0x584a0e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x456852,_0x39b320){_0x456852=_0x456852-0x0;var _0x25b8cb=_0x5f2f[_0x456852];return _0x25b8cb;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x202686,_0x5c3908){var _0x35ade5=function(_0x4b8ed0){while(--_0x4b8ed0){_0x202686['push'](_0x202686['shift']());}};_0x35ade5(++_0x5c3908);}(_0x2ef3,0xba));var _0x32ef=function(_0x9c2fd1,_0x558eef){_0x9c2fd1=_0x9c2fd1-0x0;var _0x3154cb=_0x2ef3[_0x9c2fd1];return _0x3154cb;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index bdd72ae..5fd3c36 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 _0xa17f=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2e071c,_0x5887d3){var _0x2d0c48=function(_0x3ed70d){while(--_0x3ed70d){_0x2e071c['push'](_0x2e071c['shift']());}};_0x2d0c48(++_0x5887d3);}(_0xa17f,0xc8));var _0xfa17=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0xa17f[_0xf48cce];return _0x2a5c38;};'use strict';var multer=require(_0xfa17('0x0'));var util=require(_0xfa17('0x1'));var path=require(_0xfa17('0x2'));var timeout=require(_0xfa17('0x3'));var express=require('express');var router=express[_0xfa17('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfa17('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa17('0x6'));var controller=require('./mailSubstatus.controller');router[_0xfa17('0x7')]('/',auth[_0xfa17('0x8')](),controller['index']);router[_0xfa17('0x7')](_0xfa17('0x9'),auth[_0xfa17('0x8')](),controller[_0xfa17('0xa')]);router['get'](_0xfa17('0xb'),auth[_0xfa17('0x8')](),controller[_0xfa17('0xc')]);router[_0xfa17('0xd')]('/',auth['isAuthenticated'](),controller[_0xfa17('0xe')]);router[_0xfa17('0xf')](_0xfa17('0xb'),auth[_0xfa17('0x8')](),controller[_0xfa17('0x10')]);router[_0xfa17('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xfa17('0x12')]);module[_0xfa17('0x13')]=router; \ No newline at end of file +var _0xf5e4=['../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xf5e4,0x187));var _0x4f5e=function(_0x36714c,_0x1cc729){_0x36714c=_0x36714c-0x0;var _0x4cf066=_0xf5e4[_0x36714c];return _0x4cf066;};'use strict';var multer=require(_0x4f5e('0x0'));var util=require(_0x4f5e('0x1'));var path=require(_0x4f5e('0x2'));var timeout=require(_0x4f5e('0x3'));var express=require('express');var router=express[_0x4f5e('0x4')]();var fs_extra=require(_0x4f5e('0x5'));var auth=require(_0x4f5e('0x6'));var interaction=require(_0x4f5e('0x7'));var config=require(_0x4f5e('0x8'));var controller=require(_0x4f5e('0x9'));router[_0x4f5e('0xa')]('/',auth[_0x4f5e('0xb')](),controller[_0x4f5e('0xc')]);router[_0x4f5e('0xa')](_0x4f5e('0xd'),auth[_0x4f5e('0xb')](),controller['describe']);router[_0x4f5e('0xa')](_0x4f5e('0xe'),auth[_0x4f5e('0xb')](),controller[_0x4f5e('0xf')]);router[_0x4f5e('0x10')]('/',auth[_0x4f5e('0xb')](),controller[_0x4f5e('0x11')]);router[_0x4f5e('0x12')](_0x4f5e('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x4f5e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f5e('0x14')]);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 7e2be6d..4459b7e 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 _0x0a6b=['sequelize','STRING'];(function(_0x54e65b,_0x4b6548){var _0x3b8e01=function(_0x4dc7df){while(--_0x4dc7df){_0x54e65b['push'](_0x54e65b['shift']());}};_0x3b8e01(++_0x4b6548);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x1c3186,_0x24126e){_0x1c3186=_0x1c3186-0x0;var _0x5df9ed=_0x0a6b[_0x1c3186];return _0x5df9ed;};'use strict';var Sequelize=require(_0xb0a6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb0a6('0x1')]}}; \ No newline at end of file +var _0xcde7=['name','STRING'];(function(_0x1012c1,_0x251951){var _0x580111=function(_0x4999){while(--_0x4999){_0x1012c1['push'](_0x1012c1['shift']());}};_0x580111(++_0x251951);}(_0xcde7,0x65));var _0x7cde=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xcde7[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7cde('0x0')],'unique':_0x7cde('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7cde('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index a38d9f9..0052748 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 _0x5a3e=['count','set','apply','reject','save','update','destroy','then','status','error','stack','name','send','index','map','MailSubstatus','rawAttributes','type','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit'];(function(_0x4ed021,_0x64edf3){var _0x21a308=function(_0x1c2084){while(--_0x1c2084){_0x4ed021['push'](_0x4ed021['shift']());}};_0x21a308(++_0x64edf3);}(_0x5a3e,0x110));var _0xe5a3=function(_0x58f1c6,_0x216488){_0x58f1c6=_0x58f1c6-0x0;var _0x766911=_0x5a3e[_0x58f1c6];return _0x766911;};'use strict';var emlformat=require(_0xe5a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5a3('0x1'));var jsonpatch=require(_0xe5a3('0x2'));var rp=require(_0xe5a3('0x3'));var moment=require(_0xe5a3('0x4'));var BPromise=require(_0xe5a3('0x5'));var Mustache=require(_0xe5a3('0x6'));var util=require(_0xe5a3('0x7'));var path=require('path');var sox=require(_0xe5a3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5a3('0x9'));var _=require(_0xe5a3('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe5a3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe5a3('0xc'));var Papa=require(_0xe5a3('0xd'));var Redis=require('ioredis');var authService=require(_0xe5a3('0xe'));var qs=require(_0xe5a3('0xf'));var as=require(_0xe5a3('0x10'));var hardwareService=require(_0xe5a3('0x11'));var logger=require(_0xe5a3('0x12'))(_0xe5a3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe5a3('0x14'));var db=require(_0xe5a3('0x15'))['db'];function respondWithStatusCode(_0x4ec110,_0x5dd8b1){_0x5dd8b1=_0x5dd8b1||0xcc;return function(_0x5841f8){if(_0x5841f8){return _0x4ec110[_0xe5a3('0x16')](_0x5dd8b1);}return _0x4ec110['status'](_0x5dd8b1)[_0xe5a3('0x17')]();};}function respondWithResult(_0x4c1407,_0x588538){_0x588538=_0x588538||0xc8;return function(_0x5108fc){if(_0x5108fc){return _0x4c1407['status'](_0x588538)[_0xe5a3('0x18')](_0x5108fc);}};}function respondWithFilteredResult(_0x62d572,_0x3e6e32){return function(_0x30bf01){if(_0x30bf01){var _0x6638d9=typeof _0x3e6e32[_0xe5a3('0x19')]===_0xe5a3('0x1a')&&typeof _0x3e6e32[_0xe5a3('0x1b')]===_0xe5a3('0x1a');var _0x3d750b=_0x30bf01['count'];var _0x1f941c=_0x6638d9?0x0:_0x3e6e32['offset'];var _0x4289f5=_0x6638d9?_0x30bf01[_0xe5a3('0x1c')]:_0x3e6e32[_0xe5a3('0x19')]+_0x3e6e32[_0xe5a3('0x1b')];var _0x2d47d1;if(_0x4289f5>=_0x3d750b){_0x4289f5=_0x3d750b;_0x2d47d1=0xc8;}else{_0x2d47d1=0xce;}_0x62d572['status'](_0x2d47d1);return _0x62d572[_0xe5a3('0x1d')]('Content-Range',_0x1f941c+'-'+_0x4289f5+'/'+_0x3d750b)[_0xe5a3('0x18')](_0x30bf01);}return null;};}function patchUpdates(_0x48f4d1){return function(_0x10805b){try{jsonpatch[_0xe5a3('0x1e')](_0x10805b,_0x48f4d1,!![]);}catch(_0x15bdb0){return BPromise[_0xe5a3('0x1f')](_0x15bdb0);}return _0x10805b[_0xe5a3('0x20')]();};}function saveUpdates(_0x41facb,_0x970411){return function(_0x141371){if(_0x141371){return _0x141371[_0xe5a3('0x21')](_0x41facb)['then'](function(_0x5b619a){return _0x5b619a;});}return null;};}function removeEntity(_0x3ce499,_0x413e67){return function(_0x35c9fe){if(_0x35c9fe){return _0x35c9fe[_0xe5a3('0x22')]()[_0xe5a3('0x23')](function(){_0x3ce499[_0xe5a3('0x24')](0xcc)[_0xe5a3('0x17')]();});}};}function handleEntityNotFound(_0x2336c2,_0x51f4de){return function(_0x33a535){if(!_0x33a535){_0x2336c2[_0xe5a3('0x16')](0x194);}return _0x33a535;};}function handleError(_0x525953,_0x2930d5){_0x2930d5=_0x2930d5||0x1f4;return function(_0x54f964){logger[_0xe5a3('0x25')](_0x54f964[_0xe5a3('0x26')]);if(_0x54f964[_0xe5a3('0x27')]){delete _0x54f964[_0xe5a3('0x27')];}_0x525953[_0xe5a3('0x24')](_0x2930d5)[_0xe5a3('0x28')](_0x54f964);};}exports[_0xe5a3('0x29')]=function(_0xfa739f,_0x307ece){var _0x570ec0={},_0x39c791={},_0x426360={'count':0x0,'rows':[]};var _0x5d73f7=_[_0xe5a3('0x2a')](db[_0xe5a3('0x2b')][_0xe5a3('0x2c')],function(_0x3c6bbf){return{'name':_0x3c6bbf['fieldName'],'type':_0x3c6bbf[_0xe5a3('0x2d')]['key']};});_0x39c791[_0xe5a3('0x2e')]=_[_0xe5a3('0x2a')](_0x5d73f7,_0xe5a3('0x27'));_0x39c791[_0xe5a3('0x2f')]=_[_0xe5a3('0x30')](_0xfa739f['query']);_0x39c791[_0xe5a3('0x31')]=_[_0xe5a3('0x32')](_0x39c791[_0xe5a3('0x2e')],_0x39c791[_0xe5a3('0x2f')]);_0x570ec0['attributes']=_[_0xe5a3('0x32')](_0x39c791[_0xe5a3('0x2e')],qs[_0xe5a3('0x33')](_0xfa739f[_0xe5a3('0x2f')]['fields']));_0x570ec0['attributes']=_0x570ec0['attributes'][_0xe5a3('0x34')]?_0x570ec0[_0xe5a3('0x35')]:_0x39c791[_0xe5a3('0x2e')];if(!_0xfa739f['query'][_0xe5a3('0x36')](_0xe5a3('0x37'))){_0x570ec0['limit']=qs[_0xe5a3('0x1b')](_0xfa739f[_0xe5a3('0x2f')][_0xe5a3('0x1b')]);_0x570ec0['offset']=qs[_0xe5a3('0x19')](_0xfa739f[_0xe5a3('0x2f')][_0xe5a3('0x19')]);}_0x570ec0[_0xe5a3('0x38')]=qs[_0xe5a3('0x39')](_0xfa739f[_0xe5a3('0x2f')][_0xe5a3('0x39')]);_0x570ec0[_0xe5a3('0x3a')]=qs[_0xe5a3('0x31')](_[_0xe5a3('0x3b')](_0xfa739f['query'],_0x39c791[_0xe5a3('0x31')]),_0x5d73f7);if(_0xfa739f[_0xe5a3('0x2f')][_0xe5a3('0x3c')]){_0x570ec0[_0xe5a3('0x3a')]=_[_0xe5a3('0x3d')](_0x570ec0[_0xe5a3('0x3a')],{'$or':_[_0xe5a3('0x2a')](_0x5d73f7,function(_0x2dd95f){if(_0x2dd95f[_0xe5a3('0x2d')]!==_0xe5a3('0x3e')){var _0x3d65bb={};_0x3d65bb[_0x2dd95f[_0xe5a3('0x27')]]={'$like':'%'+_0xfa739f[_0xe5a3('0x2f')][_0xe5a3('0x3c')]+'%'};return _0x3d65bb;}})});}_0x570ec0=_['merge']({},_0x570ec0,_0xfa739f[_0xe5a3('0x3f')]);var _0x509aca={'where':_0x570ec0[_0xe5a3('0x3a')]};return db[_0xe5a3('0x2b')][_0xe5a3('0x1c')](_0x509aca)['then'](function(_0x2d5aff){_0x426360[_0xe5a3('0x1c')]=_0x2d5aff;if(_0xfa739f['query'][_0xe5a3('0x40')]){_0x570ec0['include']=[{'all':!![]}];}return db[_0xe5a3('0x2b')][_0xe5a3('0x41')](_0x570ec0);})[_0xe5a3('0x23')](function(_0x2ae23d){_0x426360[_0xe5a3('0x42')]=_0x2ae23d;return _0x426360;})[_0xe5a3('0x23')](respondWithFilteredResult(_0x307ece,_0x570ec0))[_0xe5a3('0x43')](handleError(_0x307ece,null));};exports[_0xe5a3('0x44')]=function(_0x483190,_0x113462){var _0x25bebc={'raw':!![],'where':{'id':_0x483190[_0xe5a3('0x45')]['id']}},_0x1d3895={};_0x1d3895['model']=_[_0xe5a3('0x30')](db[_0xe5a3('0x2b')][_0xe5a3('0x2c')]);_0x1d3895[_0xe5a3('0x2f')]=_[_0xe5a3('0x30')](_0x483190['query']);_0x1d3895[_0xe5a3('0x31')]=_['intersection'](_0x1d3895[_0xe5a3('0x2e')],_0x1d3895['query']);_0x25bebc[_0xe5a3('0x35')]=_['intersection'](_0x1d3895[_0xe5a3('0x2e')],qs[_0xe5a3('0x33')](_0x483190[_0xe5a3('0x2f')][_0xe5a3('0x33')]));_0x25bebc[_0xe5a3('0x35')]=_0x25bebc[_0xe5a3('0x35')][_0xe5a3('0x34')]?_0x25bebc[_0xe5a3('0x35')]:_0x1d3895[_0xe5a3('0x2e')];if(_0x483190[_0xe5a3('0x2f')][_0xe5a3('0x40')]){_0x25bebc[_0xe5a3('0x46')]=[{'all':!![]}];}_0x25bebc=_[_0xe5a3('0x3d')]({},_0x25bebc,_0x483190[_0xe5a3('0x3f')]);return db[_0xe5a3('0x2b')][_0xe5a3('0x47')](_0x25bebc)['then'](handleEntityNotFound(_0x113462,null))[_0xe5a3('0x23')](respondWithResult(_0x113462,null))[_0xe5a3('0x43')](handleError(_0x113462,null));};exports[_0xe5a3('0x48')]=function(_0x49c413,_0x2c6a13){return db[_0xe5a3('0x2b')][_0xe5a3('0x48')](_0x49c413['body'],{})[_0xe5a3('0x23')](respondWithResult(_0x2c6a13,0xc9))[_0xe5a3('0x43')](handleError(_0x2c6a13,null));};exports['update']=function(_0x2ed025,_0xc00dbf){if(_0x2ed025[_0xe5a3('0x49')]['id']){delete _0x2ed025[_0xe5a3('0x49')]['id'];}return db[_0xe5a3('0x2b')]['find']({'where':{'id':_0x2ed025[_0xe5a3('0x45')]['id']}})[_0xe5a3('0x23')](handleEntityNotFound(_0xc00dbf,null))[_0xe5a3('0x23')](saveUpdates(_0x2ed025['body'],null))[_0xe5a3('0x23')](respondWithResult(_0xc00dbf,null))[_0xe5a3('0x43')](handleError(_0xc00dbf,null));};exports[_0xe5a3('0x22')]=function(_0x4cb823,_0x586b04){return db[_0xe5a3('0x2b')]['find']({'where':{'id':_0x4cb823[_0xe5a3('0x45')]['id']}})['then'](handleEntityNotFound(_0x586b04,null))[_0xe5a3('0x23')](removeEntity(_0x586b04,null))[_0xe5a3('0x43')](handleError(_0x586b04,null));};exports[_0xe5a3('0x4a')]=function(_0x51a0f1,_0xe5966b){return db['MailSubstatus'][_0xe5a3('0x4a')]()[_0xe5a3('0x23')](respondWithResult(_0xe5966b,null))[_0xe5a3('0x43')](handleError(_0xe5966b,null));}; \ No newline at end of file +var _0x6306=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','MailSubstatus','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0x6306,0xcc));var _0x6630=function(_0x502598,_0x1e95c8){_0x502598=_0x502598-0x0;var _0xbdee21=_0x6306[_0x502598];return _0xbdee21;};'use strict';var emlformat=require(_0x6630('0x0'));var rimraf=require(_0x6630('0x1'));var zipdir=require(_0x6630('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6630('0x3'));var moment=require(_0x6630('0x4'));var BPromise=require(_0x6630('0x5'));var Mustache=require(_0x6630('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6630('0x7'));var csv=require('to-csv');var ejs=require(_0x6630('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6630('0x9'));var squel=require(_0x6630('0xa'));var crypto=require(_0x6630('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6630('0xc'));var Redis=require(_0x6630('0xd'));var authService=require(_0x6630('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6630('0xf'));var logger=require(_0x6630('0x10'))(_0x6630('0x11'));var utils=require(_0x6630('0x12'));var config=require(_0x6630('0x13'));var licenseUtil=require(_0x6630('0x14'));var db=require(_0x6630('0x15'))['db'];function respondWithStatusCode(_0x55a585,_0xf0c0d9){_0xf0c0d9=_0xf0c0d9||0xcc;return function(_0x4d5e44){if(_0x4d5e44){return _0x55a585[_0x6630('0x16')](_0xf0c0d9);}return _0x55a585[_0x6630('0x17')](_0xf0c0d9)[_0x6630('0x18')]();};}function respondWithResult(_0x4b33de,_0x142ac4){_0x142ac4=_0x142ac4||0xc8;return function(_0x575644){if(_0x575644){return _0x4b33de['status'](_0x142ac4)[_0x6630('0x19')](_0x575644);}};}function respondWithFilteredResult(_0x490de3,_0x4c66ca){return function(_0x5a4b58){if(_0x5a4b58){var _0xa2be5f=typeof _0x4c66ca[_0x6630('0x1a')]===_0x6630('0x1b')&&typeof _0x4c66ca[_0x6630('0x1c')]===_0x6630('0x1b');var _0x36c26f=_0x5a4b58[_0x6630('0x1d')];var _0x45d5e2=_0xa2be5f?0x0:_0x4c66ca[_0x6630('0x1a')];var _0x5684c9=_0xa2be5f?_0x5a4b58[_0x6630('0x1d')]:_0x4c66ca[_0x6630('0x1a')]+_0x4c66ca[_0x6630('0x1c')];var _0x32dcbb;if(_0x5684c9>=_0x36c26f){_0x5684c9=_0x36c26f;_0x32dcbb=0xc8;}else{_0x32dcbb=0xce;}_0x490de3[_0x6630('0x17')](_0x32dcbb);return _0x490de3[_0x6630('0x1e')](_0x6630('0x1f'),_0x45d5e2+'-'+_0x5684c9+'/'+_0x36c26f)[_0x6630('0x19')](_0x5a4b58);}return null;};}function patchUpdates(_0x249641){return function(_0x11236e){try{jsonpatch[_0x6630('0x20')](_0x11236e,_0x249641,!![]);}catch(_0x507a8a){return BPromise[_0x6630('0x21')](_0x507a8a);}return _0x11236e[_0x6630('0x22')]();};}function saveUpdates(_0x17d284,_0x20cad7){return function(_0x504d2f){if(_0x504d2f){return _0x504d2f[_0x6630('0x23')](_0x17d284)[_0x6630('0x24')](function(_0x2f6132){return _0x2f6132;});}return null;};}function removeEntity(_0x2c3d4c,_0x4d859f){return function(_0x359508){if(_0x359508){return _0x359508[_0x6630('0x25')]()[_0x6630('0x24')](function(){_0x2c3d4c[_0x6630('0x17')](0xcc)[_0x6630('0x18')]();});}};}function handleEntityNotFound(_0x271a1f,_0x74c98){return function(_0x36dd59){if(!_0x36dd59){_0x271a1f[_0x6630('0x16')](0x194);}return _0x36dd59;};}function handleError(_0x4522fd,_0x1e6faf){_0x1e6faf=_0x1e6faf||0x1f4;return function(_0x557b37){logger[_0x6630('0x26')](_0x557b37['stack']);if(_0x557b37['name']){delete _0x557b37[_0x6630('0x27')];}_0x4522fd[_0x6630('0x17')](_0x1e6faf)[_0x6630('0x28')](_0x557b37);};}exports[_0x6630('0x29')]=function(_0x4e327b,_0x585b5f){var _0x585b92={},_0x20334e={},_0x4b6484={'count':0x0,'rows':[]};var _0x3c9ffa=_['map'](db[_0x6630('0x2a')][_0x6630('0x2b')],function(_0x114768){return{'name':_0x114768[_0x6630('0x2c')],'type':_0x114768[_0x6630('0x2d')][_0x6630('0x2e')]};});_0x20334e['model']=_[_0x6630('0x2f')](_0x3c9ffa,_0x6630('0x27'));_0x20334e['query']=_[_0x6630('0x30')](_0x4e327b[_0x6630('0x31')]);_0x20334e[_0x6630('0x32')]=_[_0x6630('0x33')](_0x20334e['model'],_0x20334e['query']);_0x585b92[_0x6630('0x34')]=_[_0x6630('0x33')](_0x20334e['model'],qs[_0x6630('0x35')](_0x4e327b['query']['fields']));_0x585b92[_0x6630('0x34')]=_0x585b92['attributes']['length']?_0x585b92[_0x6630('0x34')]:_0x20334e[_0x6630('0x36')];if(!_0x4e327b[_0x6630('0x31')][_0x6630('0x37')](_0x6630('0x38'))){_0x585b92[_0x6630('0x1c')]=qs[_0x6630('0x1c')](_0x4e327b[_0x6630('0x31')][_0x6630('0x1c')]);_0x585b92[_0x6630('0x1a')]=qs[_0x6630('0x1a')](_0x4e327b['query'][_0x6630('0x1a')]);}_0x585b92[_0x6630('0x39')]=qs[_0x6630('0x3a')](_0x4e327b[_0x6630('0x31')][_0x6630('0x3a')]);_0x585b92[_0x6630('0x3b')]=qs['filters'](_[_0x6630('0x3c')](_0x4e327b[_0x6630('0x31')],_0x20334e[_0x6630('0x32')]),_0x3c9ffa);if(_0x4e327b['query'][_0x6630('0x3d')]){_0x585b92[_0x6630('0x3b')]=_[_0x6630('0x3e')](_0x585b92['where'],{'$or':_[_0x6630('0x2f')](_0x3c9ffa,function(_0x3f96e2){if(_0x3f96e2[_0x6630('0x2d')]!==_0x6630('0x3f')){var _0x1c986f={};_0x1c986f[_0x3f96e2[_0x6630('0x27')]]={'$like':'%'+_0x4e327b[_0x6630('0x31')][_0x6630('0x3d')]+'%'};return _0x1c986f;}})});}_0x585b92=_['merge']({},_0x585b92,_0x4e327b[_0x6630('0x40')]);var _0x563763={'where':_0x585b92[_0x6630('0x3b')]};return db[_0x6630('0x2a')][_0x6630('0x1d')](_0x563763)[_0x6630('0x24')](function(_0x48526d){_0x4b6484[_0x6630('0x1d')]=_0x48526d;if(_0x4e327b[_0x6630('0x31')]['includeAll']){_0x585b92[_0x6630('0x41')]=[{'all':!![]}];}return db[_0x6630('0x2a')][_0x6630('0x42')](_0x585b92);})[_0x6630('0x24')](function(_0x3658e2){_0x4b6484[_0x6630('0x43')]=_0x3658e2;return _0x4b6484;})[_0x6630('0x24')](respondWithFilteredResult(_0x585b5f,_0x585b92))[_0x6630('0x44')](handleError(_0x585b5f,null));};exports[_0x6630('0x45')]=function(_0x38db84,_0x285292){var _0x1dd3aa={'raw':!![],'where':{'id':_0x38db84[_0x6630('0x46')]['id']}},_0x4cd789={};_0x4cd789[_0x6630('0x36')]=_['keys'](db['MailSubstatus'][_0x6630('0x2b')]);_0x4cd789[_0x6630('0x31')]=_['keys'](_0x38db84[_0x6630('0x31')]);_0x4cd789[_0x6630('0x32')]=_[_0x6630('0x33')](_0x4cd789['model'],_0x4cd789[_0x6630('0x31')]);_0x1dd3aa['attributes']=_['intersection'](_0x4cd789[_0x6630('0x36')],qs[_0x6630('0x35')](_0x38db84[_0x6630('0x31')][_0x6630('0x35')]));_0x1dd3aa['attributes']=_0x1dd3aa[_0x6630('0x34')][_0x6630('0x47')]?_0x1dd3aa[_0x6630('0x34')]:_0x4cd789[_0x6630('0x36')];if(_0x38db84[_0x6630('0x31')][_0x6630('0x48')]){_0x1dd3aa['include']=[{'all':!![]}];}_0x1dd3aa=_[_0x6630('0x3e')]({},_0x1dd3aa,_0x38db84[_0x6630('0x40')]);return db[_0x6630('0x2a')][_0x6630('0x49')](_0x1dd3aa)[_0x6630('0x24')](handleEntityNotFound(_0x285292,null))[_0x6630('0x24')](respondWithResult(_0x285292,null))[_0x6630('0x44')](handleError(_0x285292,null));};exports[_0x6630('0x4a')]=function(_0x528188,_0x56163b){return db[_0x6630('0x2a')][_0x6630('0x4a')](_0x528188[_0x6630('0x4b')],{})[_0x6630('0x24')](respondWithResult(_0x56163b,0xc9))[_0x6630('0x44')](handleError(_0x56163b,null));};exports[_0x6630('0x23')]=function(_0x3185f3,_0xffa9a0){if(_0x3185f3[_0x6630('0x4b')]['id']){delete _0x3185f3['body']['id'];}return db['MailSubstatus'][_0x6630('0x49')]({'where':{'id':_0x3185f3['params']['id']}})[_0x6630('0x24')](handleEntityNotFound(_0xffa9a0,null))[_0x6630('0x24')](saveUpdates(_0x3185f3[_0x6630('0x4b')],null))[_0x6630('0x24')](respondWithResult(_0xffa9a0,null))[_0x6630('0x44')](handleError(_0xffa9a0,null));};exports['destroy']=function(_0x4bf38a,_0x4e634a){return db[_0x6630('0x2a')][_0x6630('0x49')]({'where':{'id':_0x4bf38a[_0x6630('0x46')]['id']}})[_0x6630('0x24')](handleEntityNotFound(_0x4e634a,null))['then'](removeEntity(_0x4e634a,null))['catch'](handleError(_0x4e634a,null));};exports[_0x6630('0x4c')]=function(_0x37dd07,_0x29dc9e){return db['MailSubstatus'][_0x6630('0x4c')]()[_0x6630('0x24')](respondWithResult(_0x29dc9e,null))[_0x6630('0x44')](handleError(_0x29dc9e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 8f4ee6a..975fcf6 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 _0xe8d9=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5f1384,_0x4eb1a4){var _0x3fb9c1=function(_0x28047b){while(--_0x28047b){_0x5f1384['push'](_0x5f1384['shift']());}};_0x3fb9c1(++_0x4eb1a4);}(_0xe8d9,0xcc));var _0x9e8d=function(_0x30ec6c,_0x446a45){_0x30ec6c=_0x30ec6c-0x0;var _0x51bda1=_0xe8d9[_0x30ec6c];return _0x51bda1;};'use strict';var _=require(_0x9e8d('0x0'));var util=require(_0x9e8d('0x1'));var logger=require(_0x9e8d('0x2'))(_0x9e8d('0x3'));var moment=require(_0x9e8d('0x4'));var BPromise=require(_0x9e8d('0x5'));var rp=require(_0x9e8d('0x6'));var fs=require('fs');var path=require(_0x9e8d('0x7'));var rimraf=require(_0x9e8d('0x8'));var config=require(_0x9e8d('0x9'));var attributes=require(_0x9e8d('0xa'));module[_0x9e8d('0xb')]=function(_0x9252f1,_0x540de0){return _0x9252f1[_0x9e8d('0xc')](_0x9e8d('0xd'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ced=['./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x3e4d1b,_0x51f615){var _0x659cfa=function(_0x47227f){while(--_0x47227f){_0x3e4d1b['push'](_0x3e4d1b['shift']());}};_0x659cfa(++_0x51f615);}(_0x4ced,0x7d));var _0xd4ce=function(_0x207984,_0x481248){_0x207984=_0x207984-0x0;var _0x3fbcd0=_0x4ced[_0x207984];return _0x3fbcd0;};'use strict';var _=require(_0xd4ce('0x0'));var util=require(_0xd4ce('0x1'));var logger=require('../../config/logger')(_0xd4ce('0x2'));var moment=require(_0xd4ce('0x3'));var BPromise=require('bluebird');var rp=require(_0xd4ce('0x4'));var fs=require('fs');var path=require(_0xd4ce('0x5'));var rimraf=require(_0xd4ce('0x6'));var config=require('../../config/environment');var attributes=require(_0xd4ce('0x7'));module[_0xd4ce('0x8')]=function(_0x53c692,_0x1f2d9e){return _0x53c692[_0xd4ce('0x9')](_0xd4ce('0xa'),attributes,{'tableName':_0xd4ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index f684029..4bb8ff0 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 _0xbbc3=['info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbbc3,0x128));var _0x3bbc=function(_0x3f7adf,_0x583273){_0x3f7adf=_0x3f7adf-0x0;var _0x170994=_0xbbc3[_0x3f7adf];return _0x170994;};'use strict';var _=require('lodash');var util=require(_0x3bbc('0x0'));var moment=require(_0x3bbc('0x1'));var BPromise=require(_0x3bbc('0x2'));var rs=require(_0x3bbc('0x3'));var fs=require('fs');var Redis=require(_0x3bbc('0x4'));var db=require(_0x3bbc('0x5'))['db'];var utils=require(_0x3bbc('0x6'));var logger=require(_0x3bbc('0x7'))(_0x3bbc('0x8'));var config=require('../../config/environment');var jayson=require(_0x3bbc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19526a,_0x509569,_0x3cc329){return new BPromise(function(_0x24b659,_0x3da8ef){return client[_0x3bbc('0xa')](_0x19526a,_0x3cc329)[_0x3bbc('0xb')](function(_0x4eeb21){logger[_0x3bbc('0xc')](_0x3bbc('0xd'),_0x509569,_0x3bbc('0xe'));logger[_0x3bbc('0xf')](_0x3bbc('0x10'),_0x509569,'request\x20sent',JSON[_0x3bbc('0x11')](_0x4eeb21));if(_0x4eeb21[_0x3bbc('0x12')]){if(_0x4eeb21[_0x3bbc('0x12')]['code']===0x1f4){logger['error'](_0x3bbc('0xd'),_0x509569,_0x4eeb21['error']['message']);return _0x3da8ef(_0x4eeb21['error']['message']);}logger[_0x3bbc('0x12')](_0x3bbc('0xd'),_0x509569,_0x4eeb21[_0x3bbc('0x12')][_0x3bbc('0x13')]);return _0x24b659(_0x4eeb21[_0x3bbc('0x12')][_0x3bbc('0x13')]);}else{logger['info'](_0x3bbc('0xd'),_0x509569,_0x3bbc('0xe'));_0x24b659(_0x4eeb21[_0x3bbc('0x14')][_0x3bbc('0x13')]);}})[_0x3bbc('0x15')](function(_0x41ffa7){logger[_0x3bbc('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x509569,_0x41ffa7);_0x3da8ef(_0x41ffa7);});});} \ No newline at end of file +var _0x1964=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x1964,0xe1));var _0x4196=function(_0xb504c0,_0x1d569e){_0xb504c0=_0xb504c0-0x0;var _0x2669e9=_0x1964[_0xb504c0];return _0x2669e9;};'use strict';var _=require(_0x4196('0x0'));var util=require(_0x4196('0x1'));var moment=require(_0x4196('0x2'));var BPromise=require(_0x4196('0x3'));var rs=require(_0x4196('0x4'));var fs=require('fs');var Redis=require(_0x4196('0x5'));var db=require(_0x4196('0x6'))['db'];var utils=require(_0x4196('0x7'));var logger=require(_0x4196('0x8'))(_0x4196('0x9'));var config=require(_0x4196('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4196('0xb')][_0x4196('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3437de,_0x5c24dd,_0x2abdeb){return new BPromise(function(_0x22f618,_0x2af109){return client['request'](_0x3437de,_0x2abdeb)[_0x4196('0xd')](function(_0x31611b){logger[_0x4196('0xe')](_0x4196('0xf'),_0x5c24dd,_0x4196('0x10'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5c24dd,_0x4196('0x10'),JSON[_0x4196('0x11')](_0x31611b));if(_0x31611b[_0x4196('0x12')]){if(_0x31611b[_0x4196('0x12')][_0x4196('0x13')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x5c24dd,_0x31611b[_0x4196('0x12')][_0x4196('0x14')]);return _0x2af109(_0x31611b[_0x4196('0x12')]['message']);}logger[_0x4196('0x12')](_0x4196('0xf'),_0x5c24dd,_0x31611b['error'][_0x4196('0x14')]);return _0x22f618(_0x31611b[_0x4196('0x12')][_0x4196('0x14')]);}else{logger[_0x4196('0xe')](_0x4196('0xf'),_0x5c24dd,_0x4196('0x10'));_0x22f618(_0x31611b[_0x4196('0x15')][_0x4196('0x14')]);}})[_0x4196('0x16')](function(_0x2e1432){logger[_0x4196('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x5c24dd,_0x2e1432);_0x2af109(_0x2e1432);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 515246a..45790c0 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 _0xf3de=['./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27aa51,_0x2a4b0d){var _0x4169e7=function(_0x562b85){while(--_0x562b85){_0x27aa51['push'](_0x27aa51['shift']());}};_0x4169e7(++_0x2a4b0d);}(_0xf3de,0x1c5));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xef3d('0x0'));var util=require(_0xef3d('0x1'));var path=require('path');var timeout=require(_0xef3d('0x2'));var express=require(_0xef3d('0x3'));var router=express[_0xef3d('0x4')]();var fs_extra=require(_0xef3d('0x5'));var auth=require(_0xef3d('0x6'));var interaction=require(_0xef3d('0x7'));var config=require(_0xef3d('0x8'));var controller=require(_0xef3d('0x9'));router[_0xef3d('0xa')]('/',auth[_0xef3d('0xb')](),controller[_0xef3d('0xc')]);router['get'](_0xef3d('0xd'),auth[_0xef3d('0xb')](),controller[_0xef3d('0xe')]);router[_0xef3d('0xa')](_0xef3d('0xf'),auth[_0xef3d('0xb')](),controller['show']);router['post']('/',auth[_0xef3d('0xb')](),controller[_0xef3d('0x10')]);router[_0xef3d('0x11')](_0xef3d('0xf'),auth[_0xef3d('0xb')](),controller[_0xef3d('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xef3d('0x13')]);module[_0xef3d('0x14')]=router; \ No newline at end of file +var _0xb93e=['update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','describe','get','/:id','show','post','create','put'];(function(_0x5a08b3,_0x411f06){var _0x5b9283=function(_0x4dd789){while(--_0x4dd789){_0x5a08b3['push'](_0x5a08b3['shift']());}};_0x5b9283(++_0x411f06);}(_0xb93e,0x169));var _0xeb93=function(_0x3e098c,_0x1cdaa3){_0x3e098c=_0x3e098c-0x0;var _0x51ce46=_0xb93e[_0x3e098c];return _0x51ce46;};'use strict';var multer=require('multer');var util=require(_0xeb93('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeb93('0x1'));var router=express[_0xeb93('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xeb93('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xeb93('0x4'));var controller=require('./mailTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xeb93('0x5')](),controller[_0xeb93('0x6')]);router[_0xeb93('0x7')](_0xeb93('0x8'),auth[_0xeb93('0x5')](),controller[_0xeb93('0x9')]);router[_0xeb93('0xa')]('/',auth[_0xeb93('0x5')](),controller[_0xeb93('0xb')]);router[_0xeb93('0xc')](_0xeb93('0x8'),auth[_0xeb93('0x5')](),controller[_0xeb93('0xd')]);router[_0xeb93('0xe')](_0xeb93('0x8'),auth[_0xeb93('0x5')](),controller[_0xeb93('0xf')]);module[_0xeb93('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index a599513..19ddcd7 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3fef42,_0x55021d){var _0x2728ba=function(_0x417cc4){while(--_0x417cc4){_0x3fef42['push'](_0x3fef42['shift']());}};_0x2728ba(++_0x55021d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x00bb[_0x5b644e];return _0x49c6bf;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x227427,_0x39a41d){var _0x2f3aef=function(_0x391c69){while(--_0x391c69){_0x227427['push'](_0x227427['shift']());}};_0x2f3aef(++_0x39a41d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ac97b1b..cdb6e38 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 _0x0c6f=['index','map','MailTransferReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','count','include','findAll','rows','catch','fields','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','error','name'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0c6f,0x140));var _0xf0c6=function(_0x3bb7ef,_0xaa1be){_0x3bb7ef=_0x3bb7ef-0x0;var _0x32ea46=_0x0c6f[_0x3bb7ef];return _0x32ea46;};'use strict';var emlformat=require(_0xf0c6('0x0'));var rimraf=require(_0xf0c6('0x1'));var zipdir=require(_0xf0c6('0x2'));var jsonpatch=require(_0xf0c6('0x3'));var rp=require(_0xf0c6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf0c6('0x5'));var util=require('util');var path=require(_0xf0c6('0x6'));var sox=require(_0xf0c6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0c6('0x8'));var _=require(_0xf0c6('0x9'));var squel=require(_0xf0c6('0xa'));var crypto=require('crypto');var jsforce=require(_0xf0c6('0xb'));var deskjs=require(_0xf0c6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf0c6('0xd'));var Papa=require(_0xf0c6('0xe'));var Redis=require(_0xf0c6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf0c6('0x10'));var as=require(_0xf0c6('0x11'));var hardwareService=require(_0xf0c6('0x12'));var logger=require(_0xf0c6('0x13'))(_0xf0c6('0x14'));var utils=require('../../config/utils');var config=require(_0xf0c6('0x15'));var licenseUtil=require(_0xf0c6('0x16'));var db=require(_0xf0c6('0x17'))['db'];function respondWithStatusCode(_0x54cae2,_0x437e61){_0x437e61=_0x437e61||0xcc;return function(_0x3dd829){if(_0x3dd829){return _0x54cae2[_0xf0c6('0x18')](_0x437e61);}return _0x54cae2[_0xf0c6('0x19')](_0x437e61)[_0xf0c6('0x1a')]();};}function respondWithResult(_0x343934,_0x586115){_0x586115=_0x586115||0xc8;return function(_0xd54ae8){if(_0xd54ae8){return _0x343934[_0xf0c6('0x19')](_0x586115)[_0xf0c6('0x1b')](_0xd54ae8);}};}function respondWithFilteredResult(_0x206f0e,_0x186f1f){return function(_0x38d0a7){if(_0x38d0a7){var _0x171ab8=typeof _0x186f1f['offset']===_0xf0c6('0x1c')&&typeof _0x186f1f[_0xf0c6('0x1d')]==='undefined';var _0x1767b9=_0x38d0a7['count'];var _0x2b96c3=_0x171ab8?0x0:_0x186f1f[_0xf0c6('0x1e')];var _0x134506=_0x171ab8?_0x38d0a7['count']:_0x186f1f['offset']+_0x186f1f[_0xf0c6('0x1d')];var _0x4b096a;if(_0x134506>=_0x1767b9){_0x134506=_0x1767b9;_0x4b096a=0xc8;}else{_0x4b096a=0xce;}_0x206f0e[_0xf0c6('0x19')](_0x4b096a);return _0x206f0e['set'](_0xf0c6('0x1f'),_0x2b96c3+'-'+_0x134506+'/'+_0x1767b9)[_0xf0c6('0x1b')](_0x38d0a7);}return null;};}function patchUpdates(_0x2fb0fd){return function(_0x3c1d9d){try{jsonpatch[_0xf0c6('0x20')](_0x3c1d9d,_0x2fb0fd,!![]);}catch(_0x11a9b7){return BPromise[_0xf0c6('0x21')](_0x11a9b7);}return _0x3c1d9d[_0xf0c6('0x22')]();};}function saveUpdates(_0x541027,_0x53bf5d){return function(_0x425b1d){if(_0x425b1d){return _0x425b1d[_0xf0c6('0x23')](_0x541027)[_0xf0c6('0x24')](function(_0x3c4d29){return _0x3c4d29;});}return null;};}function removeEntity(_0x6486cb,_0x45c86d){return function(_0xc9f67f){if(_0xc9f67f){return _0xc9f67f[_0xf0c6('0x25')]()['then'](function(){_0x6486cb[_0xf0c6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22346f,_0x4a47e8){return function(_0x172425){if(!_0x172425){_0x22346f['sendStatus'](0x194);}return _0x172425;};}function handleError(_0x41f6d9,_0x545176){_0x545176=_0x545176||0x1f4;return function(_0x58b2cc){logger[_0xf0c6('0x26')](_0x58b2cc['stack']);if(_0x58b2cc[_0xf0c6('0x27')]){delete _0x58b2cc['name'];}_0x41f6d9[_0xf0c6('0x19')](_0x545176)['send'](_0x58b2cc);};}exports[_0xf0c6('0x28')]=function(_0x10eae0,_0x463b82){var _0x278c0a={},_0x4671f8={},_0x225aee={'count':0x0,'rows':[]};var _0x1251e2=_[_0xf0c6('0x29')](db[_0xf0c6('0x2a')][_0xf0c6('0x2b')],function(_0x40a054){return{'name':_0x40a054['fieldName'],'type':_0x40a054[_0xf0c6('0x2c')]['key']};});_0x4671f8[_0xf0c6('0x2d')]=_[_0xf0c6('0x29')](_0x1251e2,_0xf0c6('0x27'));_0x4671f8['query']=_[_0xf0c6('0x2e')](_0x10eae0[_0xf0c6('0x2f')]);_0x4671f8[_0xf0c6('0x30')]=_[_0xf0c6('0x31')](_0x4671f8['model'],_0x4671f8[_0xf0c6('0x2f')]);_0x278c0a['attributes']=_['intersection'](_0x4671f8['model'],qs['fields'](_0x10eae0[_0xf0c6('0x2f')]['fields']));_0x278c0a[_0xf0c6('0x32')]=_0x278c0a[_0xf0c6('0x32')]['length']?_0x278c0a[_0xf0c6('0x32')]:_0x4671f8['model'];if(!_0x10eae0[_0xf0c6('0x2f')][_0xf0c6('0x33')](_0xf0c6('0x34'))){_0x278c0a[_0xf0c6('0x1d')]=qs[_0xf0c6('0x1d')](_0x10eae0[_0xf0c6('0x2f')][_0xf0c6('0x1d')]);_0x278c0a['offset']=qs['offset'](_0x10eae0[_0xf0c6('0x2f')][_0xf0c6('0x1e')]);}_0x278c0a['order']=qs['sort'](_0x10eae0['query'][_0xf0c6('0x35')]);_0x278c0a['where']=qs['filters'](_[_0xf0c6('0x36')](_0x10eae0[_0xf0c6('0x2f')],_0x4671f8[_0xf0c6('0x30')]),_0x1251e2);if(_0x10eae0[_0xf0c6('0x2f')][_0xf0c6('0x37')]){_0x278c0a[_0xf0c6('0x38')]=_['merge'](_0x278c0a[_0xf0c6('0x38')],{'$or':_[_0xf0c6('0x29')](_0x1251e2,function(_0x3610e5){if(_0x3610e5[_0xf0c6('0x2c')]!==_0xf0c6('0x39')){var _0x544b0c={};_0x544b0c[_0x3610e5[_0xf0c6('0x27')]]={'$like':'%'+_0x10eae0[_0xf0c6('0x2f')]['filter']+'%'};return _0x544b0c;}})});}_0x278c0a=_[_0xf0c6('0x3a')]({},_0x278c0a,_0x10eae0[_0xf0c6('0x3b')]);var _0x3f7473={'where':_0x278c0a['where']};return db['MailTransferReport'][_0xf0c6('0x3c')](_0x3f7473)['then'](function(_0x4efffa){_0x225aee[_0xf0c6('0x3c')]=_0x4efffa;if(_0x10eae0[_0xf0c6('0x2f')]['includeAll']){_0x278c0a[_0xf0c6('0x3d')]=[{'all':!![]}];}return db['MailTransferReport'][_0xf0c6('0x3e')](_0x278c0a);})[_0xf0c6('0x24')](function(_0x27f768){_0x225aee[_0xf0c6('0x3f')]=_0x27f768;return _0x225aee;})[_0xf0c6('0x24')](respondWithFilteredResult(_0x463b82,_0x278c0a))[_0xf0c6('0x40')](handleError(_0x463b82,null));};exports['show']=function(_0x39b676,_0x4edcfd){var _0xe27cb4={'raw':!![],'where':{'id':_0x39b676['params']['id']}},_0x311f63={};_0x311f63[_0xf0c6('0x2d')]=_[_0xf0c6('0x2e')](db[_0xf0c6('0x2a')][_0xf0c6('0x2b')]);_0x311f63[_0xf0c6('0x2f')]=_[_0xf0c6('0x2e')](_0x39b676['query']);_0x311f63[_0xf0c6('0x30')]=_[_0xf0c6('0x31')](_0x311f63[_0xf0c6('0x2d')],_0x311f63[_0xf0c6('0x2f')]);_0xe27cb4[_0xf0c6('0x32')]=_[_0xf0c6('0x31')](_0x311f63[_0xf0c6('0x2d')],qs[_0xf0c6('0x41')](_0x39b676[_0xf0c6('0x2f')]['fields']));_0xe27cb4[_0xf0c6('0x32')]=_0xe27cb4[_0xf0c6('0x32')]['length']?_0xe27cb4[_0xf0c6('0x32')]:_0x311f63[_0xf0c6('0x2d')];if(_0x39b676[_0xf0c6('0x2f')][_0xf0c6('0x42')]){_0xe27cb4[_0xf0c6('0x3d')]=[{'all':!![]}];}_0xe27cb4=_[_0xf0c6('0x3a')]({},_0xe27cb4,_0x39b676['options']);return db[_0xf0c6('0x2a')][_0xf0c6('0x43')](_0xe27cb4)[_0xf0c6('0x24')](handleEntityNotFound(_0x4edcfd,null))[_0xf0c6('0x24')](respondWithResult(_0x4edcfd,null))[_0xf0c6('0x40')](handleError(_0x4edcfd,null));};exports[_0xf0c6('0x44')]=function(_0xf34818,_0x289fdd){return db[_0xf0c6('0x2a')][_0xf0c6('0x44')](_0xf34818[_0xf0c6('0x45')],{})[_0xf0c6('0x24')](respondWithResult(_0x289fdd,0xc9))[_0xf0c6('0x40')](handleError(_0x289fdd,null));};exports[_0xf0c6('0x23')]=function(_0x14ba01,_0xa03a91){if(_0x14ba01[_0xf0c6('0x45')]['id']){delete _0x14ba01[_0xf0c6('0x45')]['id'];}return db[_0xf0c6('0x2a')]['find']({'where':{'id':_0x14ba01[_0xf0c6('0x46')]['id']}})[_0xf0c6('0x24')](handleEntityNotFound(_0xa03a91,null))[_0xf0c6('0x24')](saveUpdates(_0x14ba01['body'],null))[_0xf0c6('0x24')](respondWithResult(_0xa03a91,null))[_0xf0c6('0x40')](handleError(_0xa03a91,null));};exports[_0xf0c6('0x25')]=function(_0x200299,_0x2e7a46){return db['MailTransferReport'][_0xf0c6('0x43')]({'where':{'id':_0x200299[_0xf0c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e7a46,null))[_0xf0c6('0x24')](removeEntity(_0x2e7a46,null))[_0xf0c6('0x40')](handleError(_0x2e7a46,null));};exports[_0xf0c6('0x47')]=function(_0x117324,_0x40981e){return db[_0xf0c6('0x2a')]['describe']()[_0xf0c6('0x24')](respondWithResult(_0x40981e,null))[_0xf0c6('0x40')](handleError(_0x40981e,null));}; \ No newline at end of file +var _0x30fb=['describe','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','destroy','then','error','stack','send','index','map','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','MailTransferReport','rows','catch','show','params','rawAttributes','merge','find','create','body'];(function(_0x306f53,_0x184aae){var _0x5ef4fa=function(_0x105934){while(--_0x105934){_0x306f53['push'](_0x306f53['shift']());}};_0x5ef4fa(++_0x184aae);}(_0x30fb,0xd9));var _0xb30f=function(_0x14a8c4,_0x3ff392){_0x14a8c4=_0x14a8c4-0x0;var _0x3e3a53=_0x30fb[_0x14a8c4];return _0x3e3a53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb30f('0x0'));var zipdir=require(_0xb30f('0x1'));var jsonpatch=require(_0xb30f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb30f('0x3'));var util=require(_0xb30f('0x4'));var path=require(_0xb30f('0x5'));var sox=require(_0xb30f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb30f('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb30f('0x8'));var deskjs=require(_0xb30f('0x9'));var toCsv=require(_0xb30f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb30f('0xb'));var authService=require(_0xb30f('0xc'));var qs=require(_0xb30f('0xd'));var as=require(_0xb30f('0xe'));var hardwareService=require(_0xb30f('0xf'));var logger=require(_0xb30f('0x10'))('api');var utils=require(_0xb30f('0x11'));var config=require(_0xb30f('0x12'));var licenseUtil=require(_0xb30f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29f17e,_0x438c33){_0x438c33=_0x438c33||0xcc;return function(_0xb81cc0){if(_0xb81cc0){return _0x29f17e[_0xb30f('0x14')](_0x438c33);}return _0x29f17e[_0xb30f('0x15')](_0x438c33)[_0xb30f('0x16')]();};}function respondWithResult(_0x2c03a8,_0x4c2343){_0x4c2343=_0x4c2343||0xc8;return function(_0xbc74dc){if(_0xbc74dc){return _0x2c03a8['status'](_0x4c2343)[_0xb30f('0x17')](_0xbc74dc);}};}function respondWithFilteredResult(_0x3bec61,_0x33a087){return function(_0x18e306){if(_0x18e306){var _0x484743=typeof _0x33a087[_0xb30f('0x18')]==='undefined'&&typeof _0x33a087[_0xb30f('0x19')]===_0xb30f('0x1a');var _0x3248c3=_0x18e306[_0xb30f('0x1b')];var _0x37f8b6=_0x484743?0x0:_0x33a087['offset'];var _0x246173=_0x484743?_0x18e306['count']:_0x33a087[_0xb30f('0x18')]+_0x33a087['limit'];var _0xfb15a6;if(_0x246173>=_0x3248c3){_0x246173=_0x3248c3;_0xfb15a6=0xc8;}else{_0xfb15a6=0xce;}_0x3bec61[_0xb30f('0x15')](_0xfb15a6);return _0x3bec61[_0xb30f('0x1c')]('Content-Range',_0x37f8b6+'-'+_0x246173+'/'+_0x3248c3)['json'](_0x18e306);}return null;};}function patchUpdates(_0x513abd){return function(_0x2e6612){try{jsonpatch['apply'](_0x2e6612,_0x513abd,!![]);}catch(_0xd88e29){return BPromise['reject'](_0xd88e29);}return _0x2e6612[_0xb30f('0x1d')]();};}function saveUpdates(_0x2c4b04,_0x353425){return function(_0x3c4063){if(_0x3c4063){return _0x3c4063[_0xb30f('0x1e')](_0x2c4b04)['then'](function(_0x126f79){return _0x126f79;});}return null;};}function removeEntity(_0x290214,_0x5487f9){return function(_0x5a1b8e){if(_0x5a1b8e){return _0x5a1b8e[_0xb30f('0x1f')]()[_0xb30f('0x20')](function(){_0x290214[_0xb30f('0x15')](0xcc)[_0xb30f('0x16')]();});}};}function handleEntityNotFound(_0x56c907,_0x5c1f09){return function(_0x34d536){if(!_0x34d536){_0x56c907[_0xb30f('0x14')](0x194);}return _0x34d536;};}function handleError(_0x5d5522,_0x5dd2fc){_0x5dd2fc=_0x5dd2fc||0x1f4;return function(_0x4faa93){logger[_0xb30f('0x21')](_0x4faa93[_0xb30f('0x22')]);if(_0x4faa93['name']){delete _0x4faa93['name'];}_0x5d5522[_0xb30f('0x15')](_0x5dd2fc)[_0xb30f('0x23')](_0x4faa93);};}exports[_0xb30f('0x24')]=function(_0x53374a,_0x2c9eab){var _0x3881a8={},_0xa8990={},_0x4b92c2={'count':0x0,'rows':[]};var _0x321be5=_[_0xb30f('0x25')](db['MailTransferReport']['rawAttributes'],function(_0x520d57){return{'name':_0x520d57[_0xb30f('0x26')],'type':_0x520d57[_0xb30f('0x27')][_0xb30f('0x28')]};});_0xa8990[_0xb30f('0x29')]=_[_0xb30f('0x25')](_0x321be5,_0xb30f('0x2a'));_0xa8990['query']=_[_0xb30f('0x2b')](_0x53374a[_0xb30f('0x2c')]);_0xa8990[_0xb30f('0x2d')]=_[_0xb30f('0x2e')](_0xa8990[_0xb30f('0x29')],_0xa8990['query']);_0x3881a8['attributes']=_[_0xb30f('0x2e')](_0xa8990[_0xb30f('0x29')],qs[_0xb30f('0x2f')](_0x53374a['query']['fields']));_0x3881a8[_0xb30f('0x30')]=_0x3881a8[_0xb30f('0x30')][_0xb30f('0x31')]?_0x3881a8['attributes']:_0xa8990[_0xb30f('0x29')];if(!_0x53374a[_0xb30f('0x2c')][_0xb30f('0x32')](_0xb30f('0x33'))){_0x3881a8[_0xb30f('0x19')]=qs[_0xb30f('0x19')](_0x53374a[_0xb30f('0x2c')][_0xb30f('0x19')]);_0x3881a8[_0xb30f('0x18')]=qs['offset'](_0x53374a['query']['offset']);}_0x3881a8[_0xb30f('0x34')]=qs[_0xb30f('0x35')](_0x53374a['query'][_0xb30f('0x35')]);_0x3881a8[_0xb30f('0x36')]=qs[_0xb30f('0x2d')](_[_0xb30f('0x37')](_0x53374a[_0xb30f('0x2c')],_0xa8990['filters']),_0x321be5);if(_0x53374a[_0xb30f('0x2c')][_0xb30f('0x38')]){_0x3881a8[_0xb30f('0x36')]=_['merge'](_0x3881a8[_0xb30f('0x36')],{'$or':_['map'](_0x321be5,function(_0x1447d6){if(_0x1447d6[_0xb30f('0x27')]!==_0xb30f('0x39')){var _0x1fca92={};_0x1fca92[_0x1447d6[_0xb30f('0x2a')]]={'$like':'%'+_0x53374a[_0xb30f('0x2c')][_0xb30f('0x38')]+'%'};return _0x1fca92;}})});}_0x3881a8=_['merge']({},_0x3881a8,_0x53374a[_0xb30f('0x3a')]);var _0x11640a={'where':_0x3881a8[_0xb30f('0x36')]};return db['MailTransferReport']['count'](_0x11640a)[_0xb30f('0x20')](function(_0xfb0c2d){_0x4b92c2['count']=_0xfb0c2d;if(_0x53374a[_0xb30f('0x2c')][_0xb30f('0x3b')]){_0x3881a8[_0xb30f('0x3c')]=[{'all':!![]}];}return db[_0xb30f('0x3d')]['findAll'](_0x3881a8);})['then'](function(_0xec4c2d){_0x4b92c2[_0xb30f('0x3e')]=_0xec4c2d;return _0x4b92c2;})['then'](respondWithFilteredResult(_0x2c9eab,_0x3881a8))[_0xb30f('0x3f')](handleError(_0x2c9eab,null));};exports[_0xb30f('0x40')]=function(_0x2fcb55,_0x20be58){var _0x2f00f4={'raw':!![],'where':{'id':_0x2fcb55[_0xb30f('0x41')]['id']}},_0x1c022c={};_0x1c022c['model']=_['keys'](db[_0xb30f('0x3d')][_0xb30f('0x42')]);_0x1c022c[_0xb30f('0x2c')]=_[_0xb30f('0x2b')](_0x2fcb55[_0xb30f('0x2c')]);_0x1c022c['filters']=_[_0xb30f('0x2e')](_0x1c022c[_0xb30f('0x29')],_0x1c022c[_0xb30f('0x2c')]);_0x2f00f4['attributes']=_[_0xb30f('0x2e')](_0x1c022c[_0xb30f('0x29')],qs[_0xb30f('0x2f')](_0x2fcb55[_0xb30f('0x2c')]['fields']));_0x2f00f4[_0xb30f('0x30')]=_0x2f00f4[_0xb30f('0x30')][_0xb30f('0x31')]?_0x2f00f4[_0xb30f('0x30')]:_0x1c022c[_0xb30f('0x29')];if(_0x2fcb55[_0xb30f('0x2c')]['includeAll']){_0x2f00f4[_0xb30f('0x3c')]=[{'all':!![]}];}_0x2f00f4=_[_0xb30f('0x43')]({},_0x2f00f4,_0x2fcb55[_0xb30f('0x3a')]);return db[_0xb30f('0x3d')][_0xb30f('0x44')](_0x2f00f4)['then'](handleEntityNotFound(_0x20be58,null))['then'](respondWithResult(_0x20be58,null))[_0xb30f('0x3f')](handleError(_0x20be58,null));};exports['create']=function(_0x4bd8ed,_0x197f94){return db['MailTransferReport'][_0xb30f('0x45')](_0x4bd8ed[_0xb30f('0x46')],{})[_0xb30f('0x20')](respondWithResult(_0x197f94,0xc9))[_0xb30f('0x3f')](handleError(_0x197f94,null));};exports[_0xb30f('0x1e')]=function(_0x1c7841,_0x1e40f8){if(_0x1c7841[_0xb30f('0x46')]['id']){delete _0x1c7841[_0xb30f('0x46')]['id'];}return db['MailTransferReport'][_0xb30f('0x44')]({'where':{'id':_0x1c7841[_0xb30f('0x41')]['id']}})[_0xb30f('0x20')](handleEntityNotFound(_0x1e40f8,null))[_0xb30f('0x20')](saveUpdates(_0x1c7841[_0xb30f('0x46')],null))[_0xb30f('0x20')](respondWithResult(_0x1e40f8,null))['catch'](handleError(_0x1e40f8,null));};exports[_0xb30f('0x1f')]=function(_0x10706f,_0x100db4){return db[_0xb30f('0x3d')][_0xb30f('0x44')]({'where':{'id':_0x10706f['params']['id']}})[_0xb30f('0x20')](handleEntityNotFound(_0x100db4,null))[_0xb30f('0x20')](removeEntity(_0x100db4,null))[_0xb30f('0x3f')](handleError(_0x100db4,null));};exports[_0xb30f('0x47')]=function(_0x3a0884,_0x17a818){return db[_0xb30f('0x3d')][_0xb30f('0x47')]()['then'](respondWithResult(_0x17a818,null))['catch'](handleError(_0x17a818,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 2050a74..8b0ae14 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 _0x2090=['rimraf','./mailTransferReport.attributes','MailTransferReport','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3cd77a,_0x5406f8){var _0x8bd19=function(_0x5347e7){while(--_0x5347e7){_0x3cd77a['push'](_0x3cd77a['shift']());}};_0x8bd19(++_0x5406f8);}(_0x2090,0xae));var _0x0209=function(_0x26135a,_0x277e73){_0x26135a=_0x26135a-0x0;var _0x5729a2=_0x2090[_0x26135a];return _0x5729a2;};'use strict';var _=require('lodash');var util=require(_0x0209('0x0'));var logger=require(_0x0209('0x1'))('api');var moment=require(_0x0209('0x2'));var BPromise=require(_0x0209('0x3'));var rp=require(_0x0209('0x4'));var fs=require('fs');var path=require(_0x0209('0x5'));var rimraf=require(_0x0209('0x6'));var config=require('../../config/environment');var attributes=require(_0x0209('0x7'));module['exports']=function(_0x2aaa17,_0x8c2e0b){return _0x2aaa17['define'](_0x0209('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x0209('0x9'),'fields':[_0x0209('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x47d6=['bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0x47d6,0x1de));var _0x647d=function(_0x585e86,_0x501992){_0x585e86=_0x585e86-0x0;var _0x339db2=_0x47d6[_0x585e86];return _0x339db2;};'use strict';var _=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var logger=require(_0x647d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x647d('0x3'));var rp=require(_0x647d('0x4'));var fs=require('fs');var path=require(_0x647d('0x5'));var rimraf=require('rimraf');var config=require(_0x647d('0x6'));var attributes=require(_0x647d('0x7'));module[_0x647d('0x8')]=function(_0x4e18a7,_0x13797c){return _0x4e18a7[_0x647d('0x9')](_0x647d('0xa'),attributes,{'tableName':_0x647d('0xb'),'paranoid':![],'indexes':[{'name':_0x647d('0xc'),'fields':[_0x647d('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 d7f4b7c..d54467a 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 _0xbff8=['client','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0xbff8,0x129));var _0x8bff=function(_0x243e82,_0x50326d){_0x243e82=_0x243e82-0x0;var _0x44babd=_0xbff8[_0x243e82];return _0x44babd;};'use strict';var _=require(_0x8bff('0x0'));var util=require(_0x8bff('0x1'));var moment=require(_0x8bff('0x2'));var BPromise=require(_0x8bff('0x3'));var rs=require(_0x8bff('0x4'));var fs=require('fs');var Redis=require(_0x8bff('0x5'));var db=require(_0x8bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bff('0x7'))(_0x8bff('0x8'));var config=require(_0x8bff('0x9'));var jayson=require(_0x8bff('0xa'));var client=jayson[_0x8bff('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24f6c4,_0x3d999a,_0x633712){return new BPromise(function(_0x2c5968,_0x4541e9){return client[_0x8bff('0xc')](_0x24f6c4,_0x633712)['then'](function(_0x4a5756){logger['info'](_0x8bff('0xd'),_0x3d999a,_0x8bff('0xe'));logger['debug'](_0x8bff('0xf'),_0x3d999a,'request\x20sent',JSON[_0x8bff('0x10')](_0x4a5756));if(_0x4a5756[_0x8bff('0x11')]){if(_0x4a5756['error'][_0x8bff('0x12')]===0x1f4){logger['error'](_0x8bff('0xd'),_0x3d999a,_0x4a5756['error'][_0x8bff('0x13')]);return _0x4541e9(_0x4a5756[_0x8bff('0x11')]['message']);}logger['error'](_0x8bff('0xd'),_0x3d999a,_0x4a5756[_0x8bff('0x11')][_0x8bff('0x13')]);return _0x2c5968(_0x4a5756['error']['message']);}else{logger[_0x8bff('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x3d999a,_0x8bff('0xe'));_0x2c5968(_0x4a5756['result'][_0x8bff('0x13')]);}})[_0x8bff('0x15')](function(_0x3438a0){logger[_0x8bff('0x11')](_0x8bff('0xd'),_0x3d999a,_0x3438a0);_0x4541e9(_0x3438a0);});});} \ No newline at end of file +var _0xad21=['request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','MailTransferReport,\x20%s,\x20%s'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xad21,0x1a0));var _0x1ad2=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xad21[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x1ad2('0x0'));var util=require(_0x1ad2('0x1'));var moment=require(_0x1ad2('0x2'));var BPromise=require(_0x1ad2('0x3'));var rs=require(_0x1ad2('0x4'));var fs=require('fs');var Redis=require(_0x1ad2('0x5'));var db=require(_0x1ad2('0x6'))['db'];var utils=require(_0x1ad2('0x7'));var logger=require(_0x1ad2('0x8'))(_0x1ad2('0x9'));var config=require(_0x1ad2('0xa'));var jayson=require(_0x1ad2('0xb'));var client=jayson[_0x1ad2('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8205,_0x5136f5,_0x32f0b2){return new BPromise(function(_0x426d37,_0x2910a6){return client[_0x1ad2('0xd')](_0x2d8205,_0x32f0b2)[_0x1ad2('0xe')](function(_0x482e86){logger['info'](_0x1ad2('0xf'),_0x5136f5,_0x1ad2('0x10'));logger[_0x1ad2('0x11')](_0x1ad2('0x12'),_0x5136f5,_0x1ad2('0x10'),JSON[_0x1ad2('0x13')](_0x482e86));if(_0x482e86[_0x1ad2('0x14')]){if(_0x482e86['error']['code']===0x1f4){logger[_0x1ad2('0x14')](_0x1ad2('0xf'),_0x5136f5,_0x482e86['error']['message']);return _0x2910a6(_0x482e86['error']['message']);}logger[_0x1ad2('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x5136f5,_0x482e86['error'][_0x1ad2('0x15')]);return _0x426d37(_0x482e86[_0x1ad2('0x14')]['message']);}else{logger['info'](_0x1ad2('0xf'),_0x5136f5,'request\x20sent');_0x426d37(_0x482e86[_0x1ad2('0x16')]['message']);}})[_0x1ad2('0x17')](function(_0x39c5f5){logger[_0x1ad2('0x14')](_0x1ad2('0xf'),_0x5136f5,_0x39c5f5);_0x2910a6(_0x39c5f5);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 3235caf..ed9d135 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 _0xe9e9=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x505088,_0x23a321){var _0x3eb2c9=function(_0x2fcf8d){while(--_0x2fcf8d){_0x505088['push'](_0x505088['shift']());}};_0x3eb2c9(++_0x23a321);}(_0xe9e9,0x10f));var _0x9e9e=function(_0x379054,_0x707745){_0x379054=_0x379054-0x0;var _0x5d2781=_0xe9e9[_0x379054];return _0x5d2781;};'use strict';var multer=require(_0x9e9e('0x0'));var util=require(_0x9e9e('0x1'));var path=require(_0x9e9e('0x2'));var timeout=require(_0x9e9e('0x3'));var express=require(_0x9e9e('0x4'));var router=express['Router']();var fs_extra=require(_0x9e9e('0x5'));var auth=require(_0x9e9e('0x6'));var interaction=require(_0x9e9e('0x7'));var config=require(_0x9e9e('0x8'));var controller=require('./memberReport.controller');router[_0x9e9e('0x9')]('/',auth[_0x9e9e('0xa')](),controller[_0x9e9e('0xb')]);router[_0x9e9e('0x9')]('/describe',auth[_0x9e9e('0xa')](),controller[_0x9e9e('0xc')]);router[_0x9e9e('0x9')](_0x9e9e('0xd'),auth[_0x9e9e('0xa')](),controller[_0x9e9e('0xe')]);router[_0x9e9e('0xf')]('/',auth[_0x9e9e('0xa')](),controller[_0x9e9e('0x10')]);router[_0x9e9e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9e9e('0x12')]);router[_0x9e9e('0x13')](_0x9e9e('0xd'),auth[_0x9e9e('0xa')](),controller[_0x9e9e('0x14')]);module[_0x9e9e('0x15')]=router; \ No newline at end of file +var _0x30b1=['index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated'];(function(_0x18d94e,_0x1550aa){var _0x4d8d7d=function(_0x299952){while(--_0x299952){_0x18d94e['push'](_0x18d94e['shift']());}};_0x4d8d7d(++_0x1550aa);}(_0x30b1,0xfc));var _0x130b=function(_0xa52af2,_0x287e5f){_0xa52af2=_0xa52af2-0x0;var _0x456f65=_0x30b1[_0xa52af2];return _0x456f65;};'use strict';var multer=require(_0x130b('0x0'));var util=require(_0x130b('0x1'));var path=require(_0x130b('0x2'));var timeout=require(_0x130b('0x3'));var express=require(_0x130b('0x4'));var router=express['Router']();var fs_extra=require(_0x130b('0x5'));var auth=require(_0x130b('0x6'));var interaction=require(_0x130b('0x7'));var config=require(_0x130b('0x8'));var controller=require(_0x130b('0x9'));router[_0x130b('0xa')]('/',auth[_0x130b('0xb')](),controller[_0x130b('0xc')]);router[_0x130b('0xa')](_0x130b('0xd'),auth['isAuthenticated'](),controller[_0x130b('0xe')]);router[_0x130b('0xa')](_0x130b('0xf'),auth[_0x130b('0xb')](),controller[_0x130b('0x10')]);router[_0x130b('0x11')]('/',auth[_0x130b('0xb')](),controller[_0x130b('0x12')]);router[_0x130b('0x13')](_0x130b('0xf'),auth['isAuthenticated'](),controller[_0x130b('0x14')]);router[_0x130b('0x15')](_0x130b('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index c6e112d..a5d0d66 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 _0x6c4b=['INTEGER','getDataValue','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0xd538f2,_0x43aafe){var _0x171bad=function(_0x483a34){while(--_0x483a34){_0xd538f2['push'](_0xd538f2['shift']());}};_0x171bad(++_0x43aafe);}(_0x6c4b,0x93));var _0xb6c4=function(_0x333755,_0x47aadf){_0x333755=_0x333755-0x0;var _0x1335ce=_0x6c4b[_0x333755];return _0x1335ce;};'use strict';var Sequelize=require(_0xb6c4('0x0'));var moment=require(_0xb6c4('0x1'));module[_0xb6c4('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb6c4('0x3')]},'interface':{'type':Sequelize[_0xb6c4('0x3')]},'type':{'type':Sequelize[_0xb6c4('0x3')],'defaultValue':_0xb6c4('0x4'),'comment':_0xb6c4('0x5')},'duration':{'type':Sequelize[_0xb6c4('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x1f7abc){var _0x5a290a=moment(_0x1f7abc);var _0x109973=moment(this[_0xb6c4('0x7')]('enterAt'));var _0x312141=_0x5a290a[_0xb6c4('0x8')](_0x109973,_0xb6c4('0x9'));this[_0xb6c4('0xa')](_0xb6c4('0xb'),_0x1f7abc);this[_0xb6c4('0xa')](_0xb6c4('0xc'),_0x312141||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xb6c4('0xd')},'data2':{'type':Sequelize[_0xb6c4('0x3')],'comment':_0xb6c4('0xe')},'data3':{'type':Sequelize[_0xb6c4('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xb6c4('0x3')],'comment':_0xb6c4('0xf')},'data5':{'type':Sequelize[_0xb6c4('0x3')],'comment':_0xb6c4('0x10')},'role':{'type':Sequelize[_0xb6c4('0x3')]},'internal':{'type':Sequelize[_0xb6c4('0x6')]},'uniqueid':{'type':Sequelize[_0xb6c4('0x3')]}}; \ No newline at end of file +var _0x8d53=['sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]'];(function(_0x485556,_0x28422c){var _0x3d2062=function(_0x45cf5a){while(--_0x45cf5a){_0x485556['push'](_0x485556['shift']());}};_0x3d2062(++_0x28422c);}(_0x8d53,0x1c2));var _0x38d5=function(_0x1c2fd7,_0x595cf1){_0x1c2fd7=_0x1c2fd7-0x0;var _0x369e9d=_0x8d53[_0x1c2fd7];return _0x369e9d;};'use strict';var Sequelize=require(_0x38d5('0x0'));var moment=require(_0x38d5('0x1'));module['exports']={'channel':{'type':Sequelize[_0x38d5('0x2')]},'membername':{'type':Sequelize[_0x38d5('0x2')]},'interface':{'type':Sequelize[_0x38d5('0x2')]},'type':{'type':Sequelize[_0x38d5('0x2')],'defaultValue':_0x38d5('0x3'),'comment':_0x38d5('0x4')},'duration':{'type':Sequelize[_0x38d5('0x5')]},'enterAt':{'type':Sequelize[_0x38d5('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x31ccc0){var _0x5c6cc6=moment(_0x31ccc0);var _0xeb7913=moment(this['getDataValue'](_0x38d5('0x7')));var _0x284f7b=_0x5c6cc6[_0x38d5('0x8')](_0xeb7913,_0x38d5('0x9'));this[_0x38d5('0xa')]('exitAt',_0x31ccc0);this[_0x38d5('0xa')](_0x38d5('0xb'),_0x284f7b||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x38d5('0xc')},'data2':{'type':Sequelize[_0x38d5('0x2')],'comment':_0x38d5('0xd')},'data3':{'type':Sequelize[_0x38d5('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x38d5('0xe')},'data5':{'type':Sequelize[_0x38d5('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x38d5('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x38d5('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 3c9263c..a9f7239 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x422d9c,_0x4d5fe6){var _0x13c086=function(_0x446318){while(--_0x446318){_0x422d9c['push'](_0x422d9c['shift']());}};_0x13c086(++_0x4d5fe6);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x4a551d,_0x3a1b29){var _0x13f9cf=function(_0x18a5f4){while(--_0x18a5f4){_0x4a551d['push'](_0x4a551d['shift']());}};_0x13f9cf(++_0x3a1b29);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index d97d78b..e8f4c29 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 _0xcfae=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','membername','interface','lodash','../../config/logger','api','moment'];(function(_0x2c4910,_0x17775f){var _0x47939d=function(_0x53574d){while(--_0x53574d){_0x2c4910['push'](_0x2c4910['shift']());}};_0x47939d(++_0x17775f);}(_0xcfae,0x1ca));var _0xecfa=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xcfae[_0x133277];return _0x5b4a22;};'use strict';var _=require(_0xecfa('0x0'));var util=require('util');var logger=require(_0xecfa('0x1'))(_0xecfa('0x2'));var moment=require(_0xecfa('0x3'));var BPromise=require(_0xecfa('0x4'));var rp=require(_0xecfa('0x5'));var fs=require('fs');var path=require(_0xecfa('0x6'));var rimraf=require(_0xecfa('0x7'));var config=require(_0xecfa('0x8'));var attributes=require(_0xecfa('0x9'));module[_0xecfa('0xa')]=function(_0x2af3ff,_0x3ffffc){return _0x2af3ff['define'](_0xecfa('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xecfa('0xc'),_0xecfa('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6066=['request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2c94ba,_0x2c8883){var _0x12fa96=function(_0x3aaf87){while(--_0x3aaf87){_0x2c94ba['push'](_0x2c94ba['shift']());}};_0x12fa96(++_0x2c8883);}(_0x6066,0x1c6));var _0x6606=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x6066[_0x4f35f4];return _0x2e9a70;};'use strict';var _=require(_0x6606('0x0'));var util=require('util');var logger=require(_0x6606('0x1'))(_0x6606('0x2'));var moment=require(_0x6606('0x3'));var BPromise=require(_0x6606('0x4'));var rp=require(_0x6606('0x5'));var fs=require('fs');var path=require(_0x6606('0x6'));var rimraf=require(_0x6606('0x7'));var config=require(_0x6606('0x8'));var attributes=require(_0x6606('0x9'));module[_0x6606('0xa')]=function(_0x5dd8dc,_0x2202e0){return _0x5dd8dc[_0x6606('0xb')](_0x6606('0xc'),attributes,{'tableName':_0x6606('0xd'),'paranoid':![],'indexes':[{'name':_0x6606('0xe'),'fields':[_0x6606('0xf'),_0x6606('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index fd27f28..fb8feda 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 _0x5d59=['raw','attributes','limit','include','map','model','catch','CreateMemberReport','create','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options'];(function(_0x140fd6,_0x5d8037){var _0x16a6ad=function(_0x5adbf7){while(--_0x5adbf7){_0x140fd6['push'](_0x140fd6['shift']());}};_0x16a6ad(++_0x5d8037);}(_0x5d59,0x15f));var _0x95d5=function(_0x59c6dc,_0x2f43d2){_0x59c6dc=_0x59c6dc-0x0;var _0x3ae1b6=_0x5d59[_0x59c6dc];return _0x3ae1b6;};'use strict';var _=require('lodash');var util=require(_0x95d5('0x0'));var moment=require(_0x95d5('0x1'));var BPromise=require(_0x95d5('0x2'));var rs=require(_0x95d5('0x3'));var fs=require('fs');var Redis=require(_0x95d5('0x4'));var db=require(_0x95d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95d5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x95d5('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfe94c,_0x11b2d4,_0x121537){return new BPromise(function(_0x489fab,_0x179d43){return client['request'](_0xfe94c,_0x121537)[_0x95d5('0x8')](function(_0x55249d){logger[_0x95d5('0x9')](_0x95d5('0xa'),_0x11b2d4,_0x95d5('0xb'));logger[_0x95d5('0xc')](_0x95d5('0xd'),_0x11b2d4,_0x95d5('0xb'),JSON[_0x95d5('0xe')](_0x55249d));if(_0x55249d[_0x95d5('0xf')]){if(_0x55249d['error'][_0x95d5('0x10')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x11b2d4,_0x55249d[_0x95d5('0xf')][_0x95d5('0x11')]);return _0x179d43(_0x55249d[_0x95d5('0xf')][_0x95d5('0x11')]);}logger['error'](_0x95d5('0xa'),_0x11b2d4,_0x55249d[_0x95d5('0xf')][_0x95d5('0x11')]);return _0x489fab(_0x55249d[_0x95d5('0xf')][_0x95d5('0x11')]);}else{logger[_0x95d5('0x9')](_0x95d5('0xa'),_0x11b2d4,_0x95d5('0xb'));_0x489fab(_0x55249d[_0x95d5('0x12')]['message']);}})['catch'](function(_0x1747f2){logger['error'](_0x95d5('0xa'),_0x11b2d4,_0x1747f2);_0x179d43(_0x1747f2);});});}exports[_0x95d5('0x13')]=function(_0x5bdf14){var _0x1fe609=this;return new Promise(function(_0x3793eb,_0x233a32){return db[_0x95d5('0x14')][_0x95d5('0x15')]({'raw':_0x5bdf14[_0x95d5('0x16')]?_0x5bdf14['options'][_0x95d5('0x17')]===undefined?!![]:![]:!![],'where':_0x5bdf14[_0x95d5('0x16')]?_0x5bdf14[_0x95d5('0x16')]['where']||null:null,'attributes':_0x5bdf14['options']?_0x5bdf14[_0x95d5('0x16')][_0x95d5('0x18')]||null:null,'limit':_0x5bdf14['options']?_0x5bdf14[_0x95d5('0x16')][_0x95d5('0x19')]||null:null,'include':_0x5bdf14[_0x95d5('0x16')]?_0x5bdf14['options'][_0x95d5('0x1a')]?_['map'](_0x5bdf14['options']['include'],function(_0x554f4d){return{'model':db[_0x554f4d['model']],'as':_0x554f4d['as'],'attributes':_0x554f4d['attributes'],'include':_0x554f4d[_0x95d5('0x1a')]?_[_0x95d5('0x1b')](_0x554f4d[_0x95d5('0x1a')],function(_0x260582){return{'model':db[_0x260582['model']],'as':_0x260582['as'],'attributes':_0x260582[_0x95d5('0x18')],'include':_0x260582[_0x95d5('0x1a')]?_[_0x95d5('0x1b')](_0x260582[_0x95d5('0x1a')],function(_0xe12a95){return{'model':db[_0xe12a95[_0x95d5('0x1c')]],'as':_0xe12a95['as'],'attributes':_0xe12a95[_0x95d5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x95d5('0x8')](function(_0x3fde81){logger[_0x95d5('0x9')]('GetMemberReport',_0x5bdf14);logger['debug'](_0x95d5('0x13'),_0x5bdf14,JSON[_0x95d5('0xe')](_0x3fde81));_0x3793eb(_0x3fde81);})[_0x95d5('0x1d')](function(_0x5dfe00){logger[_0x95d5('0xf')]('GetMemberReport',_0x5dfe00[_0x95d5('0x11')],_0x5bdf14);_0x233a32(_0x1fe609['error'](0x1f4,_0x5dfe00[_0x95d5('0x11')]));});});};exports[_0x95d5('0x1e')]=function(_0x333459){var _0x21d4ff=this;return new Promise(function(_0x44d803,_0x362b8){return db[_0x95d5('0x14')][_0x95d5('0x1f')](_0x333459['body'],{'raw':_0x333459['options']?_0x333459['options'][_0x95d5('0x17')]===undefined?!![]:![]:!![]})[_0x95d5('0x8')](function(_0x243210){logger[_0x95d5('0x9')](_0x95d5('0x1e'),_0x333459);logger[_0x95d5('0xc')]('CreateMemberReport',_0x333459,JSON[_0x95d5('0xe')](_0x243210));_0x44d803(_0x243210);})[_0x95d5('0x1d')](function(_0x37c8c4){logger[_0x95d5('0xf')](_0x95d5('0x1e'),_0x37c8c4[_0x95d5('0x11')],_0x333459);_0x362b8(_0x21d4ff[_0x95d5('0xf')](0x1f4,_0x37c8c4[_0x95d5('0x11')]));});});};exports[_0x95d5('0x20')]=function(_0x47d034){var _0x5031cd=this;return new Promise(function(_0x294314,_0x3201dc){return db[_0x95d5('0x14')][_0x95d5('0x21')](_0x47d034['body'],{'raw':_0x47d034[_0x95d5('0x16')]?_0x47d034['options'][_0x95d5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47d034[_0x95d5('0x16')]?_0x47d034[_0x95d5('0x16')]['where']||null:null,'attributes':_0x47d034[_0x95d5('0x16')]?_0x47d034[_0x95d5('0x16')][_0x95d5('0x18')]||null:null,'limit':_0x47d034[_0x95d5('0x16')]?_0x47d034[_0x95d5('0x16')][_0x95d5('0x19')]||null:null})['then'](function(_0x1b1b0e){logger[_0x95d5('0x9')](_0x95d5('0x20'),_0x47d034);logger[_0x95d5('0xc')](_0x95d5('0x20'),_0x47d034,JSON[_0x95d5('0xe')](_0x1b1b0e));_0x294314(_0x1b1b0e);})[_0x95d5('0x1d')](function(_0x459059){logger[_0x95d5('0xf')](_0x95d5('0x20'),_0x459059['message'],_0x47d034);_0x3201dc(_0x5031cd['error'](0x1f4,_0x459059[_0x95d5('0x11')]));});});}; \ No newline at end of file +var _0xf9d5=['../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','map','include','model','create','CreateMemberReport','UpdateMemberReport','update','body','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x246255,_0x14c698){var _0xf1363=function(_0x5e337f){while(--_0x5e337f){_0x246255['push'](_0x246255['shift']());}};_0xf1363(++_0x14c698);}(_0xf9d5,0x122));var _0x5f9d=function(_0xfa44b8,_0x3e6c66){_0xfa44b8=_0xfa44b8-0x0;var _0x20dcad=_0xf9d5[_0xfa44b8];return _0x20dcad;};'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')]('MemberReport,\x20%s,\x20%s',_0x38fb6b,_0x5f9d('0xd'));logger[_0x5f9d('0xe')]('MemberReport,\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']('MemberReport,\x20%s,\x20%s',_0x38fb6b,_0x47f480);_0x23e865(_0x47f480);});});}exports[_0x5f9d('0x15')]=function(_0x4fb9a5){var _0x432f1a=this;return new Promise(function(_0x48448e,_0x3cb370){return db[_0x5f9d('0x16')][_0x5f9d('0x17')]({'raw':_0x4fb9a5['options']?_0x4fb9a5[_0x5f9d('0x18')][_0x5f9d('0x19')]===undefined?!![]:![]:!![],'where':_0x4fb9a5[_0x5f9d('0x18')]?_0x4fb9a5[_0x5f9d('0x18')][_0x5f9d('0x1a')]||null:null,'attributes':_0x4fb9a5[_0x5f9d('0x18')]?_0x4fb9a5[_0x5f9d('0x18')][_0x5f9d('0x1b')]||null:null,'limit':_0x4fb9a5[_0x5f9d('0x18')]?_0x4fb9a5['options']['limit']||null:null,'include':_0x4fb9a5['options']?_0x4fb9a5[_0x5f9d('0x18')]['include']?_[_0x5f9d('0x1c')](_0x4fb9a5['options'][_0x5f9d('0x1d')],function(_0x564886){return{'model':db[_0x564886['model']],'as':_0x564886['as'],'attributes':_0x564886['attributes'],'include':_0x564886[_0x5f9d('0x1d')]?_[_0x5f9d('0x1c')](_0x564886[_0x5f9d('0x1d')],function(_0x234511){return{'model':db[_0x234511['model']],'as':_0x234511['as'],'attributes':_0x234511[_0x5f9d('0x1b')],'include':_0x234511[_0x5f9d('0x1d')]?_[_0x5f9d('0x1c')](_0x234511[_0x5f9d('0x1d')],function(_0x2d097f){return{'model':db[_0x2d097f[_0x5f9d('0x1e')]],'as':_0x2d097f['as'],'attributes':_0x2d097f[_0x5f9d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5f9d('0xb')](function(_0x3b1efc){logger[_0x5f9d('0xc')]('GetMemberReport',_0x4fb9a5);logger[_0x5f9d('0xe')](_0x5f9d('0x15'),_0x4fb9a5,JSON[_0x5f9d('0xf')](_0x3b1efc));_0x48448e(_0x3b1efc);})[_0x5f9d('0x14')](function(_0x10e542){logger[_0x5f9d('0x10')](_0x5f9d('0x15'),_0x10e542[_0x5f9d('0x12')],_0x4fb9a5);_0x3cb370(_0x432f1a[_0x5f9d('0x10')](0x1f4,_0x10e542['message']));});});};exports['CreateMemberReport']=function(_0x4ba714){var _0x118f77=this;return new Promise(function(_0x5b7bd4,_0x461a2a){return db['MemberReport'][_0x5f9d('0x1f')](_0x4ba714['body'],{'raw':_0x4ba714[_0x5f9d('0x18')]?_0x4ba714[_0x5f9d('0x18')][_0x5f9d('0x19')]===undefined?!![]:![]:!![]})[_0x5f9d('0xb')](function(_0x3c46e8){logger['info'](_0x5f9d('0x20'),_0x4ba714);logger['debug'](_0x5f9d('0x20'),_0x4ba714,JSON['stringify'](_0x3c46e8));_0x5b7bd4(_0x3c46e8);})[_0x5f9d('0x14')](function(_0x20f1ba){logger['error'](_0x5f9d('0x20'),_0x20f1ba[_0x5f9d('0x12')],_0x4ba714);_0x461a2a(_0x118f77[_0x5f9d('0x10')](0x1f4,_0x20f1ba['message']));});});};exports[_0x5f9d('0x21')]=function(_0x3f20c4){var _0x20ae2c=this;return new Promise(function(_0x2eb259,_0x3377af){return db['MemberReport'][_0x5f9d('0x22')](_0x3f20c4[_0x5f9d('0x23')],{'raw':_0x3f20c4[_0x5f9d('0x18')]?_0x3f20c4[_0x5f9d('0x18')][_0x5f9d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f20c4[_0x5f9d('0x18')]?_0x3f20c4['options'][_0x5f9d('0x1a')]||null:null,'attributes':_0x3f20c4[_0x5f9d('0x18')]?_0x3f20c4[_0x5f9d('0x18')]['attributes']||null:null,'limit':_0x3f20c4['options']?_0x3f20c4[_0x5f9d('0x18')][_0x5f9d('0x24')]||null:null})[_0x5f9d('0xb')](function(_0xf076f9){logger[_0x5f9d('0xc')]('UpdateMemberReport',_0x3f20c4);logger['debug'](_0x5f9d('0x21'),_0x3f20c4,JSON[_0x5f9d('0xf')](_0xf076f9));_0x2eb259(_0xf076f9);})['catch'](function(_0x2e3d95){logger['error'](_0x5f9d('0x21'),_0x2e3d95[_0x5f9d('0x12')],_0x3f20c4);_0x3377af(_0x20ae2c['error'](0x1f4,_0x2e3d95[_0x5f9d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4ee2213..74b996a 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 _0x4502=['multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x5c94aa,_0x448429){var _0x470c76=function(_0x57ecd8){while(--_0x57ecd8){_0x5c94aa['push'](_0x5c94aa['shift']());}};_0x470c76(++_0x448429);}(_0x4502,0x157));var _0x2450=function(_0x24c3a4,_0x206db5){_0x24c3a4=_0x24c3a4-0x0;var _0x5274ac=_0x4502[_0x24c3a4];return _0x5274ac;};'use strict';var multer=require(_0x2450('0x0'));var util=require('util');var path=require(_0x2450('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2450('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2450('0x3'));var interaction=require(_0x2450('0x4'));var config=require(_0x2450('0x5'));var controller=require(_0x2450('0x6'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0x2499=['../../components/interaction/service','./migration.controller','get','index','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2499,0x7d));var _0x9249=function(_0xc0377d,_0x17664a){_0xc0377d=_0xc0377d-0x0;var _0x4e4b86=_0x2499[_0xc0377d];return _0x4e4b86;};'use strict';var multer=require(_0x9249('0x0'));var util=require(_0x9249('0x1'));var path=require(_0x9249('0x2'));var timeout=require(_0x9249('0x3'));var express=require(_0x9249('0x4'));var router=express['Router']();var fs_extra=require(_0x9249('0x5'));var auth=require(_0x9249('0x6'));var interaction=require(_0x9249('0x7'));var config=require('../../config/environment');var controller=require(_0x9249('0x8'));router[_0x9249('0x9')]('/',controller[_0x9249('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index caba89e..9db480d 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 _0x0624=['exports','STRING','sequelize'];(function(_0x3f38eb,_0xa118c7){var _0x159726=function(_0x2649b5){while(--_0x2649b5){_0x3f38eb['push'](_0x3f38eb['shift']());}};_0x159726(++_0xa118c7);}(_0x0624,0x65));var _0x4062=function(_0x23f1f7,_0x52224a){_0x23f1f7=_0x23f1f7-0x0;var _0x325c07=_0x0624[_0x23f1f7];return _0x325c07;};'use strict';var Sequelize=require(_0x4062('0x0'));module[_0x4062('0x1')]={'version':{'type':Sequelize[_0x4062('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x8744=['STRING','version','sequelize'];(function(_0x5a9130,_0x1a32f3){var _0x53580d=function(_0x357363){while(--_0x357363){_0x5a9130['push'](_0x5a9130['shift']());}};_0x53580d(++_0x1a32f3);}(_0x8744,0x1ca));var _0x4874=function(_0x4c6164,_0xcc1c21){_0x4c6164=_0x4c6164-0x0;var _0x599457=_0x8744[_0x4c6164];return _0x599457;};'use strict';var Sequelize=require(_0x4874('0x0'));module['exports']={'version':{'type':Sequelize[_0x4874('0x1')],'unique':_0x4874('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0cbedcf..137c467 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 _0x050a=['type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Migration','includeAll','rows','then','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','error','stack','name','send','index','fieldName'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_0x050a,0x1a5));var _0xa050=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x050a[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xa050('0x0'));var rimraf=require(_0xa050('0x1'));var zipdir=require(_0xa050('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa050('0x3'));var moment=require(_0xa050('0x4'));var BPromise=require(_0xa050('0x5'));var Mustache=require(_0xa050('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa050('0x7'));var csv=require(_0xa050('0x8'));var ejs=require(_0xa050('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa050('0xa'));var squel=require(_0xa050('0xb'));var crypto=require(_0xa050('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa050('0xd'));var toCsv=require(_0xa050('0x8'));var querystring=require(_0xa050('0xe'));var Papa=require('papaparse');var Redis=require(_0xa050('0xf'));var authService=require(_0xa050('0x10'));var qs=require(_0xa050('0x11'));var as=require(_0xa050('0x12'));var hardwareService=require(_0xa050('0x13'));var logger=require('../../config/logger')(_0xa050('0x14'));var utils=require(_0xa050('0x15'));var config=require(_0xa050('0x16'));var licenseUtil=require(_0xa050('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fe7e,_0x1a4205){_0x1a4205=_0x1a4205||0xcc;return function(_0x22739f){if(_0x22739f){return _0x17fe7e[_0xa050('0x18')](_0x1a4205);}return _0x17fe7e[_0xa050('0x19')](_0x1a4205)['end']();};}function respondWithResult(_0x5ae834,_0x1eb8b7){_0x1eb8b7=_0x1eb8b7||0xc8;return function(_0x3c1bca){if(_0x3c1bca){return _0x5ae834['status'](_0x1eb8b7)[_0xa050('0x1a')](_0x3c1bca);}};}function respondWithFilteredResult(_0x302f0a,_0x31b43c){return function(_0xa40ae9){if(_0xa40ae9){var _0x5040e3=typeof _0x31b43c[_0xa050('0x1b')]===_0xa050('0x1c')&&typeof _0x31b43c[_0xa050('0x1d')]==='undefined';var _0x34cd7f=_0xa40ae9[_0xa050('0x1e')];var _0x2c44a3=_0x5040e3?0x0:_0x31b43c[_0xa050('0x1b')];var _0x52863f=_0x5040e3?_0xa40ae9['count']:_0x31b43c[_0xa050('0x1b')]+_0x31b43c[_0xa050('0x1d')];var _0x45025c;if(_0x52863f>=_0x34cd7f){_0x52863f=_0x34cd7f;_0x45025c=0xc8;}else{_0x45025c=0xce;}_0x302f0a[_0xa050('0x19')](_0x45025c);return _0x302f0a['set'](_0xa050('0x1f'),_0x2c44a3+'-'+_0x52863f+'/'+_0x34cd7f)[_0xa050('0x1a')](_0xa40ae9);}return null;};}function patchUpdates(_0x39c72f){return function(_0xbeac56){try{jsonpatch['apply'](_0xbeac56,_0x39c72f,!![]);}catch(_0x326fd1){return BPromise[_0xa050('0x20')](_0x326fd1);}return _0xbeac56['save']();};}function saveUpdates(_0x49683d,_0x11dbaa){return function(_0x294bdf){if(_0x294bdf){return _0x294bdf[_0xa050('0x21')](_0x49683d)['then'](function(_0x4e32b1){return _0x4e32b1;});}return null;};}function removeEntity(_0x123d5d,_0x1c5d16){return function(_0x3aeeef){if(_0x3aeeef){return _0x3aeeef[_0xa050('0x22')]()['then'](function(){_0x123d5d[_0xa050('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ed870,_0x26ac0f){return function(_0x4d05db){if(!_0x4d05db){_0x5ed870[_0xa050('0x18')](0x194);}return _0x4d05db;};}function handleError(_0x1396d3,_0x131b62){_0x131b62=_0x131b62||0x1f4;return function(_0x14c5c3){logger[_0xa050('0x23')](_0x14c5c3[_0xa050('0x24')]);if(_0x14c5c3[_0xa050('0x25')]){delete _0x14c5c3[_0xa050('0x25')];}_0x1396d3[_0xa050('0x19')](_0x131b62)[_0xa050('0x26')](_0x14c5c3);};}exports[_0xa050('0x27')]=function(_0x5c67a7,_0x1598dc){var _0x422578={},_0x41da0a={},_0x5c04c0={'count':0x0,'rows':[]};var _0x3aed65=_['map'](db['Migration']['rawAttributes'],function(_0x1180bf){return{'name':_0x1180bf[_0xa050('0x28')],'type':_0x1180bf[_0xa050('0x29')][_0xa050('0x2a')]};});_0x41da0a[_0xa050('0x2b')]=_[_0xa050('0x2c')](_0x3aed65,'name');_0x41da0a[_0xa050('0x2d')]=_[_0xa050('0x2e')](_0x5c67a7[_0xa050('0x2d')]);_0x41da0a[_0xa050('0x2f')]=_[_0xa050('0x30')](_0x41da0a[_0xa050('0x2b')],_0x41da0a[_0xa050('0x2d')]);_0x422578[_0xa050('0x31')]=_['intersection'](_0x41da0a[_0xa050('0x2b')],qs['fields'](_0x5c67a7['query'][_0xa050('0x32')]));_0x422578[_0xa050('0x31')]=_0x422578[_0xa050('0x31')][_0xa050('0x33')]?_0x422578[_0xa050('0x31')]:_0x41da0a[_0xa050('0x2b')];if(!_0x5c67a7[_0xa050('0x2d')][_0xa050('0x34')]('nolimit')){_0x422578[_0xa050('0x1d')]=qs[_0xa050('0x1d')](_0x5c67a7[_0xa050('0x2d')][_0xa050('0x1d')]);_0x422578[_0xa050('0x1b')]=qs['offset'](_0x5c67a7[_0xa050('0x2d')][_0xa050('0x1b')]);}_0x422578[_0xa050('0x35')]=qs['sort'](_0x5c67a7['query'][_0xa050('0x36')]);_0x422578[_0xa050('0x37')]=qs['filters'](_[_0xa050('0x38')](_0x5c67a7['query'],_0x41da0a['filters']),_0x3aed65);if(_0x5c67a7['query'][_0xa050('0x39')]){_0x422578[_0xa050('0x37')]=_[_0xa050('0x3a')](_0x422578[_0xa050('0x37')],{'$or':_['map'](_0x3aed65,function(_0x4bafdb){if(_0x4bafdb[_0xa050('0x29')]!==_0xa050('0x3b')){var _0x5b070b={};_0x5b070b[_0x4bafdb['name']]={'$like':'%'+_0x5c67a7[_0xa050('0x2d')]['filter']+'%'};return _0x5b070b;}})});}_0x422578=_[_0xa050('0x3a')]({},_0x422578,_0x5c67a7[_0xa050('0x3c')]);var _0x3272fc={'where':_0x422578[_0xa050('0x37')]};return db[_0xa050('0x3d')][_0xa050('0x1e')](_0x3272fc)['then'](function(_0x52626b){_0x5c04c0[_0xa050('0x1e')]=_0x52626b;if(_0x5c67a7['query'][_0xa050('0x3e')]){_0x422578['include']=[{'all':!![]}];}return db[_0xa050('0x3d')]['findAll'](_0x422578);})['then'](function(_0x32d693){_0x5c04c0[_0xa050('0x3f')]=_0x32d693;return _0x5c04c0;})[_0xa050('0x40')](respondWithFilteredResult(_0x1598dc,_0x422578))[_0xa050('0x41')](handleError(_0x1598dc,null));}; \ No newline at end of file +var _0xa990=['includeAll','findAll','catch','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','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','json','save','update','then','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options'];(function(_0x16e580,_0x21d59b){var _0x515673=function(_0x2b540f){while(--_0x2b540f){_0x16e580['push'](_0x16e580['shift']());}};_0x515673(++_0x21d59b);}(_0xa990,0xc9));var _0x0a99=function(_0x3a5462,_0x3b9bd2){_0x3a5462=_0x3a5462-0x0;var _0x3a302a=_0xa990[_0x3a5462];return _0x3a302a;};'use strict';var emlformat=require(_0x0a99('0x0'));var rimraf=require(_0x0a99('0x1'));var zipdir=require(_0x0a99('0x2'));var jsonpatch=require(_0x0a99('0x3'));var rp=require(_0x0a99('0x4'));var moment=require(_0x0a99('0x5'));var BPromise=require(_0x0a99('0x6'));var Mustache=require(_0x0a99('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0a99('0x8'));var csv=require(_0x0a99('0x9'));var ejs=require(_0x0a99('0xa'));var fs=require('fs');var fs_extra=require(_0x0a99('0xb'));var _=require(_0x0a99('0xc'));var squel=require(_0x0a99('0xd'));var crypto=require(_0x0a99('0xe'));var jsforce=require(_0x0a99('0xf'));var deskjs=require(_0x0a99('0x10'));var toCsv=require(_0x0a99('0x9'));var querystring=require(_0x0a99('0x11'));var Papa=require('papaparse');var Redis=require(_0x0a99('0x12'));var authService=require(_0x0a99('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a99('0x14'));var logger=require(_0x0a99('0x15'))(_0x0a99('0x16'));var utils=require(_0x0a99('0x17'));var config=require(_0x0a99('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a99('0x19'))['db'];function respondWithStatusCode(_0x3aaaad,_0x57ab88){_0x57ab88=_0x57ab88||0xcc;return function(_0xb6a34d){if(_0xb6a34d){return _0x3aaaad[_0x0a99('0x1a')](_0x57ab88);}return _0x3aaaad[_0x0a99('0x1b')](_0x57ab88)[_0x0a99('0x1c')]();};}function respondWithResult(_0x346061,_0x23d018){_0x23d018=_0x23d018||0xc8;return function(_0x18c124){if(_0x18c124){return _0x346061[_0x0a99('0x1b')](_0x23d018)['json'](_0x18c124);}};}function respondWithFilteredResult(_0x5a17e1,_0x2c40db){return function(_0x3ac17e){if(_0x3ac17e){var _0xb7356c=typeof _0x2c40db['offset']===_0x0a99('0x1d')&&typeof _0x2c40db['limit']==='undefined';var _0x20104c=_0x3ac17e[_0x0a99('0x1e')];var _0x3de006=_0xb7356c?0x0:_0x2c40db[_0x0a99('0x1f')];var _0x572ce5=_0xb7356c?_0x3ac17e['count']:_0x2c40db[_0x0a99('0x1f')]+_0x2c40db[_0x0a99('0x20')];var _0xbe23f3;if(_0x572ce5>=_0x20104c){_0x572ce5=_0x20104c;_0xbe23f3=0xc8;}else{_0xbe23f3=0xce;}_0x5a17e1[_0x0a99('0x1b')](_0xbe23f3);return _0x5a17e1['set']('Content-Range',_0x3de006+'-'+_0x572ce5+'/'+_0x20104c)[_0x0a99('0x21')](_0x3ac17e);}return null;};}function patchUpdates(_0x4d0c78){return function(_0x1e8d30){try{jsonpatch['apply'](_0x1e8d30,_0x4d0c78,!![]);}catch(_0x191ee4){return BPromise['reject'](_0x191ee4);}return _0x1e8d30[_0x0a99('0x22')]();};}function saveUpdates(_0x356681,_0x3b1d60){return function(_0x1c1e5c){if(_0x1c1e5c){return _0x1c1e5c[_0x0a99('0x23')](_0x356681)[_0x0a99('0x24')](function(_0x19c870){return _0x19c870;});}return null;};}function removeEntity(_0x1d803c,_0x398dd2){return function(_0x5745ca){if(_0x5745ca){return _0x5745ca['destroy']()[_0x0a99('0x24')](function(){_0x1d803c[_0x0a99('0x1b')](0xcc)[_0x0a99('0x1c')]();});}};}function handleEntityNotFound(_0x518617,_0x5d917c){return function(_0x371b31){if(!_0x371b31){_0x518617[_0x0a99('0x1a')](0x194);}return _0x371b31;};}function handleError(_0x1b0e94,_0x40e765){_0x40e765=_0x40e765||0x1f4;return function(_0x10e70f){logger[_0x0a99('0x25')](_0x10e70f[_0x0a99('0x26')]);if(_0x10e70f[_0x0a99('0x27')]){delete _0x10e70f[_0x0a99('0x27')];}_0x1b0e94['status'](_0x40e765)[_0x0a99('0x28')](_0x10e70f);};}exports['index']=function(_0x47bc34,_0x4e597b){var _0x223bdb={},_0x379c7e={},_0x13d26a={'count':0x0,'rows':[]};var _0x26c0c0=_[_0x0a99('0x29')](db[_0x0a99('0x2a')][_0x0a99('0x2b')],function(_0x47da33){return{'name':_0x47da33[_0x0a99('0x2c')],'type':_0x47da33[_0x0a99('0x2d')][_0x0a99('0x2e')]};});_0x379c7e[_0x0a99('0x2f')]=_['map'](_0x26c0c0,'name');_0x379c7e['query']=_[_0x0a99('0x30')](_0x47bc34[_0x0a99('0x31')]);_0x379c7e[_0x0a99('0x32')]=_['intersection'](_0x379c7e[_0x0a99('0x2f')],_0x379c7e[_0x0a99('0x31')]);_0x223bdb[_0x0a99('0x33')]=_[_0x0a99('0x34')](_0x379c7e[_0x0a99('0x2f')],qs[_0x0a99('0x35')](_0x47bc34[_0x0a99('0x31')]['fields']));_0x223bdb[_0x0a99('0x33')]=_0x223bdb[_0x0a99('0x33')][_0x0a99('0x36')]?_0x223bdb[_0x0a99('0x33')]:_0x379c7e[_0x0a99('0x2f')];if(!_0x47bc34['query'][_0x0a99('0x37')]('nolimit')){_0x223bdb['limit']=qs['limit'](_0x47bc34['query'][_0x0a99('0x20')]);_0x223bdb['offset']=qs[_0x0a99('0x1f')](_0x47bc34[_0x0a99('0x31')][_0x0a99('0x1f')]);}_0x223bdb[_0x0a99('0x38')]=qs[_0x0a99('0x39')](_0x47bc34[_0x0a99('0x31')][_0x0a99('0x39')]);_0x223bdb[_0x0a99('0x3a')]=qs[_0x0a99('0x32')](_[_0x0a99('0x3b')](_0x47bc34[_0x0a99('0x31')],_0x379c7e[_0x0a99('0x32')]),_0x26c0c0);if(_0x47bc34[_0x0a99('0x31')]['filter']){_0x223bdb[_0x0a99('0x3a')]=_[_0x0a99('0x3c')](_0x223bdb['where'],{'$or':_[_0x0a99('0x29')](_0x26c0c0,function(_0x549bb9){if(_0x549bb9[_0x0a99('0x2d')]!=='VIRTUAL'){var _0x541178={};_0x541178[_0x549bb9[_0x0a99('0x27')]]={'$like':'%'+_0x47bc34[_0x0a99('0x31')][_0x0a99('0x3d')]+'%'};return _0x541178;}})});}_0x223bdb=_['merge']({},_0x223bdb,_0x47bc34[_0x0a99('0x3e')]);var _0x11e046={'where':_0x223bdb[_0x0a99('0x3a')]};return db['Migration'][_0x0a99('0x1e')](_0x11e046)[_0x0a99('0x24')](function(_0x23e4b9){_0x13d26a[_0x0a99('0x1e')]=_0x23e4b9;if(_0x47bc34['query'][_0x0a99('0x3f')]){_0x223bdb['include']=[{'all':!![]}];}return db['Migration'][_0x0a99('0x40')](_0x223bdb);})['then'](function(_0x185495){_0x13d26a['rows']=_0x185495;return _0x13d26a;})[_0x0a99('0x24')](respondWithFilteredResult(_0x4e597b,_0x223bdb))[_0x0a99('0x41')](handleError(_0x4e597b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index cdc7d7d..1ebba07 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 _0xc5f5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Migration','migrations'];(function(_0x1fd155,_0x340af9){var _0x250e2f=function(_0x3cef99){while(--_0x3cef99){_0x1fd155['push'](_0x1fd155['shift']());}};_0x250e2f(++_0x340af9);}(_0xc5f5,0x17a));var _0x5c5f=function(_0x1e399a,_0x351c59){_0x1e399a=_0x1e399a-0x0;var _0x539897=_0xc5f5[_0x1e399a];return _0x539897;};'use strict';var _=require(_0x5c5f('0x0'));var util=require(_0x5c5f('0x1'));var logger=require(_0x5c5f('0x2'))(_0x5c5f('0x3'));var moment=require(_0x5c5f('0x4'));var BPromise=require(_0x5c5f('0x5'));var rp=require(_0x5c5f('0x6'));var fs=require('fs');var path=require(_0x5c5f('0x7'));var rimraf=require(_0x5c5f('0x8'));var config=require(_0x5c5f('0x9'));var attributes=require('./migration.attributes');module[_0x5c5f('0xa')]=function(_0x595682,_0x4e3a7a){return _0x595682[_0x5c5f('0xb')](_0x5c5f('0xc'),attributes,{'tableName':_0x5c5f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e33=['bluebird','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','util','../../config/logger','api','moment'];(function(_0x499496,_0x102a20){var _0x3068c0=function(_0x29647a){while(--_0x29647a){_0x499496['push'](_0x499496['shift']());}};_0x3068c0(++_0x102a20);}(_0x6e33,0x97));var _0x36e3=function(_0x491c67,_0x4409e8){_0x491c67=_0x491c67-0x0;var _0x27394d=_0x6e33[_0x491c67];return _0x27394d;};'use strict';var _=require(_0x36e3('0x0'));var util=require(_0x36e3('0x1'));var logger=require(_0x36e3('0x2'))(_0x36e3('0x3'));var moment=require(_0x36e3('0x4'));var BPromise=require(_0x36e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x36e3('0x6'));var config=require(_0x36e3('0x7'));var attributes=require(_0x36e3('0x8'));module[_0x36e3('0x9')]=function(_0x4cf6d7,_0x5c921d){return _0x4cf6d7['define'](_0x36e3('0xa'),attributes,{'tableName':_0x36e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 48691cf..78187e2 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 _0x45c8=['request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client'];(function(_0x4364bf,_0x266759){var _0x13b177=function(_0x4e60c3){while(--_0x4e60c3){_0x4364bf['push'](_0x4364bf['shift']());}};_0x13b177(++_0x266759);}(_0x45c8,0xef));var _0x845c=function(_0x4d33bc,_0x2e118a){_0x4d33bc=_0x4d33bc-0x0;var _0x11cb48=_0x45c8[_0x4d33bc];return _0x11cb48;};'use strict';var _=require(_0x845c('0x0'));var util=require('util');var moment=require(_0x845c('0x1'));var BPromise=require(_0x845c('0x2'));var rs=require(_0x845c('0x3'));var fs=require('fs');var Redis=require(_0x845c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x845c('0x5'));var jayson=require(_0x845c('0x6'));var client=jayson[_0x845c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335f38,_0x4a1a42,_0x42b569){return new BPromise(function(_0x4648e1,_0x3075cd){return client[_0x845c('0x8')](_0x335f38,_0x42b569)[_0x845c('0x9')](function(_0x34a8ae){logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));logger[_0x845c('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x4a1a42,'request\x20sent',JSON[_0x845c('0xe')](_0x34a8ae));if(_0x34a8ae[_0x845c('0xf')]){if(_0x34a8ae['error'][_0x845c('0x10')]===0x1f4){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);return _0x3075cd(_0x34a8ae[_0x845c('0xf')]['message']);}logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae['error'][_0x845c('0x11')]);return _0x4648e1(_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);}else{logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));_0x4648e1(_0x34a8ae[_0x845c('0x12')]['message']);}})['catch'](function(_0x3b1ff9){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x3b1ff9);_0x3075cd(_0x3b1ff9);});});} \ No newline at end of file +var _0x750a=['error','code','Migration,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x255c49,_0x3d8b9e){var _0x14c7c4=function(_0x244c53){while(--_0x244c53){_0x255c49['push'](_0x255c49['shift']());}};_0x14c7c4(++_0x3d8b9e);}(_0x750a,0x140));var _0xa750=function(_0x3e9d81,_0x4478c2){_0x3e9d81=_0x3e9d81-0x0;var _0x589c9e=_0x750a[_0x3e9d81];return _0x589c9e;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('Migration,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index eea2796..ab5e7d0 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 _0xa786=['post','create','put','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show'];(function(_0x592a9d,_0x434abb){var _0x59d2b3=function(_0x4661dc){while(--_0x4661dc){_0x592a9d['push'](_0x592a9d['shift']());}};_0x59d2b3(++_0x434abb);}(_0xa786,0x71));var _0x6a78=function(_0x3d2d7e,_0x5b7289){_0x3d2d7e=_0x3d2d7e-0x0;var _0x7c8dc6=_0xa786[_0x3d2d7e];return _0x7c8dc6;};'use strict';var multer=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var path=require(_0x6a78('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a78('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a78('0x4'));var interaction=require(_0x6a78('0x5'));var config=require(_0x6a78('0x6'));var controller=require(_0x6a78('0x7'));router[_0x6a78('0x8')]('/',auth[_0x6a78('0x9')](),controller[_0x6a78('0xa')]);router['get'](_0x6a78('0xb'),auth[_0x6a78('0x9')](),controller[_0x6a78('0xc')]);router[_0x6a78('0xd')]('/',auth[_0x6a78('0x9')](),controller[_0x6a78('0xe')]);router[_0x6a78('0xf')](_0x6a78('0xb'),auth[_0x6a78('0x9')](),controller['update']);router[_0x6a78('0x10')](_0x6a78('0xb'),auth[_0x6a78('0x9')](),controller['destroy']);module[_0x6a78('0x11')]=router; \ No newline at end of file +var _0x4bc7=['destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','get','/:id','create','update','delete'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x4bc7,0x188));var _0x74bc=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0x4bc7[_0x9d639c];return _0x1671de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x74bc('0x0'));var timeout=require(_0x74bc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74bc('0x2'));var auth=require(_0x74bc('0x3'));var interaction=require(_0x74bc('0x4'));var config=require(_0x74bc('0x5'));var controller=require(_0x74bc('0x6'));router['get']('/',auth[_0x74bc('0x7')](),controller['index']);router[_0x74bc('0x8')](_0x74bc('0x9'),auth[_0x74bc('0x7')](),controller['show']);router['post']('/',auth[_0x74bc('0x7')](),controller[_0x74bc('0xa')]);router['put'](_0x74bc('0x9'),auth[_0x74bc('0x7')](),controller[_0x74bc('0xb')]);router[_0x74bc('0xc')](_0x74bc('0x9'),auth[_0x74bc('0x7')](),controller[_0x74bc('0xd')]);module[_0x74bc('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 8531701..56db86e 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 _0x0da2=['STRING','sequelize','exports','ENUM','externip','stun','turn'];(function(_0x38ef5a,_0x2aea7d){var _0x15470f=function(_0x1f194c){while(--_0x1f194c){_0x38ef5a['push'](_0x38ef5a['shift']());}};_0x15470f(++_0x2aea7d);}(_0x0da2,0xe8));var _0x20da=function(_0x516ca3,_0x348de){_0x516ca3=_0x516ca3-0x0;var _0x31ee10=_0x0da2[_0x516ca3];return _0x31ee10;};'use strict';var Sequelize=require(_0x20da('0x0'));module[_0x20da('0x1')]={'type':{'type':Sequelize[_0x20da('0x2')]('localnet',_0x20da('0x3'),_0x20da('0x4'),_0x20da('0x5'))},'value':{'type':Sequelize[_0x20da('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x59af=['turn','STRING','exports','ENUM','localnet','externip','stun'];(function(_0x43e180,_0x41c5b4){var _0x3a543a=function(_0x25decc){while(--_0x25decc){_0x43e180['push'](_0x43e180['shift']());}};_0x3a543a(++_0x41c5b4);}(_0x59af,0xdb));var _0xf59a=function(_0x5b78a1,_0x55a96c){_0x5b78a1=_0x5b78a1-0x0;var _0x2a0320=_0x59af[_0x5b78a1];return _0x2a0320;};'use strict';var Sequelize=require('sequelize');module[_0xf59a('0x0')]={'type':{'type':Sequelize[_0xf59a('0x1')](_0xf59a('0x2'),_0xf59a('0x3'),_0xf59a('0x4'),_0xf59a('0x5'))},'value':{'type':Sequelize[_0xf59a('0x6')]},'username':{'type':Sequelize[_0xf59a('0x6')]},'password':{'type':Sequelize[_0xf59a('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index c97f8e4..f5ac651 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 _0xd06e=['undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','Network','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','params','intersection','includeAll','find','create','transaction','body','toUpperCase','STUN','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','root','join','TURN','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','destroy','format','eml-format','rimraf','fast-json-patch','request-promise','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','sendStatus','status','end','json'];(function(_0x92b4dc,_0x20f18a){var _0xe68d92=function(_0x707cc1){while(--_0x707cc1){_0x92b4dc['push'](_0x92b4dc['shift']());}};_0xe68d92(++_0x20f18a);}(_0xd06e,0x122));var _0xed06=function(_0x469faa,_0x1d1f2d){_0x469faa=_0x469faa-0x0;var _0x101ee1=_0xd06e[_0x469faa];return _0x101ee1;};'use strict';var emlformat=require(_0xed06('0x0'));var rimraf=require(_0xed06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed06('0x2'));var rp=require(_0xed06('0x3'));var moment=require('moment');var BPromise=require(_0xed06('0x4'));var Mustache=require(_0xed06('0x5'));var util=require(_0xed06('0x6'));var path=require(_0xed06('0x7'));var sox=require(_0xed06('0x8'));var csv=require(_0xed06('0x9'));var ejs=require(_0xed06('0xa'));var fs=require('fs');var fs_extra=require(_0xed06('0xb'));var _=require('lodash');var squel=require(_0xed06('0xc'));var crypto=require(_0xed06('0xd'));var jsforce=require(_0xed06('0xe'));var deskjs=require(_0xed06('0xf'));var toCsv=require(_0xed06('0x9'));var querystring=require(_0xed06('0x10'));var Papa=require(_0xed06('0x11'));var Redis=require(_0xed06('0x12'));var authService=require(_0xed06('0x13'));var qs=require(_0xed06('0x14'));var as=require(_0xed06('0x15'));var hardwareService=require(_0xed06('0x16'));var logger=require(_0xed06('0x17'))(_0xed06('0x18'));var utils=require(_0xed06('0x19'));var config=require(_0xed06('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xed06('0x1b'))['db'];var jayson=require(_0xed06('0x1c'));var client=jayson[_0xed06('0x1d')][_0xed06('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x10a4f5,_0x5658fe,_0x58fcc2,_0x35bfc4){return new BPromise(function(_0x29f7ec,_0x45f911){var _0x1398b3=_0x35bfc4||client;return _0x1398b3['request'](_0x10a4f5,_0x58fcc2)['then'](function(_0x414fb5){logger['info'](_0xed06('0x1f'),_0x5658fe,_0xed06('0x20'));logger[_0xed06('0x21')]('Network,\x20%s,\x20%s,\x20%s',_0x5658fe,_0xed06('0x20'),JSON[_0xed06('0x22')](_0x414fb5));if(_0x414fb5[_0xed06('0x23')]){if(_0x414fb5['error']['code']===0x1f4){logger[_0xed06('0x23')](_0xed06('0x1f'),_0x5658fe,_0x414fb5[_0xed06('0x23')][_0xed06('0x24')]);return _0x45f911(_0x414fb5[_0xed06('0x23')]['message']);}logger[_0xed06('0x23')]('Network,\x20%s,\x20%s',_0x5658fe,_0x414fb5['error']['message']);return _0x29f7ec(_0x414fb5[_0xed06('0x23')][_0xed06('0x24')]);}else{logger[_0xed06('0x25')]('Network,\x20%s,\x20%s',_0x5658fe,_0xed06('0x20'));_0x29f7ec(_0x414fb5['result'][_0xed06('0x24')]);}})[_0xed06('0x26')](function(_0x54d451){logger[_0xed06('0x23')](_0xed06('0x1f'),_0x5658fe,_0x54d451);_0x45f911(_0x54d451);});});}function respondWithStatusCode(_0x30d697,_0x104b3b){_0x104b3b=_0x104b3b||0xcc;return function(_0x367eed){if(_0x367eed){return _0x30d697[_0xed06('0x27')](_0x104b3b);}return _0x30d697[_0xed06('0x28')](_0x104b3b)[_0xed06('0x29')]();};}function respondWithResult(_0x1d9987,_0x44a702){_0x44a702=_0x44a702||0xc8;return function(_0xd9030e){if(_0xd9030e){return _0x1d9987['status'](_0x44a702)[_0xed06('0x2a')](_0xd9030e);}};}function respondWithFilteredResult(_0x12b77a,_0x9dd4d7){return function(_0x4eb049){if(_0x4eb049){var _0x5e80fd=typeof _0x9dd4d7['offset']===_0xed06('0x2b')&&typeof _0x9dd4d7[_0xed06('0x2c')]===_0xed06('0x2b');var _0x47d685=_0x4eb049['count'];var _0x491ec6=_0x5e80fd?0x0:_0x9dd4d7[_0xed06('0x2d')];var _0x5b4000=_0x5e80fd?_0x4eb049['count']:_0x9dd4d7[_0xed06('0x2d')]+_0x9dd4d7[_0xed06('0x2c')];var _0x33350;if(_0x5b4000>=_0x47d685){_0x5b4000=_0x47d685;_0x33350=0xc8;}else{_0x33350=0xce;}_0x12b77a[_0xed06('0x28')](_0x33350);return _0x12b77a[_0xed06('0x2e')](_0xed06('0x2f'),_0x491ec6+'-'+_0x5b4000+'/'+_0x47d685)[_0xed06('0x2a')](_0x4eb049);}return null;};}function patchUpdates(_0x302939){return function(_0x1890ba){try{jsonpatch[_0xed06('0x30')](_0x1890ba,_0x302939,!![]);}catch(_0x555b07){return BPromise[_0xed06('0x31')](_0x555b07);}return _0x1890ba[_0xed06('0x32')]();};}function saveUpdates(_0x1acbd5,_0x2ea7fc){return function(_0x5f30bf){if(_0x5f30bf){return _0x5f30bf[_0xed06('0x33')](_0x1acbd5)[_0xed06('0x34')](function(_0x1954d7){return _0x1954d7;});}return null;};}function removeEntity(_0x37d0a8,_0x4b3ea3){return function(_0x1e261b){if(_0x1e261b){return _0x1e261b['destroy']()[_0xed06('0x34')](function(){_0x37d0a8[_0xed06('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2973b6,_0x91c7c5){return function(_0x5825a6){if(!_0x5825a6){_0x2973b6['sendStatus'](0x194);}return _0x5825a6;};}function handleError(_0x5350f9,_0x313545){_0x313545=_0x313545||0x1f4;return function(_0x57d00c){logger[_0xed06('0x23')](_0x57d00c[_0xed06('0x35')]);if(_0x57d00c[_0xed06('0x36')]){delete _0x57d00c[_0xed06('0x36')];}_0x5350f9[_0xed06('0x28')](_0x313545)[_0xed06('0x37')](_0x57d00c);};}exports['index']=function(_0x2fa125,_0x1b9d9d){var _0x50c0da={},_0xec4cf4={},_0x5d3d9={'count':0x0,'rows':[]};var _0x2729e3=_[_0xed06('0x38')](db[_0xed06('0x39')][_0xed06('0x3a')],function(_0x161dd3){return{'name':_0x161dd3[_0xed06('0x3b')],'type':_0x161dd3[_0xed06('0x3c')][_0xed06('0x3d')]};});_0xec4cf4['model']=_['map'](_0x2729e3,'name');_0xec4cf4[_0xed06('0x3e')]=_[_0xed06('0x3f')](_0x2fa125[_0xed06('0x3e')]);_0xec4cf4['filters']=_['intersection'](_0xec4cf4[_0xed06('0x40')],_0xec4cf4[_0xed06('0x3e')]);_0x50c0da[_0xed06('0x41')]=_['intersection'](_0xec4cf4['model'],qs['fields'](_0x2fa125[_0xed06('0x3e')][_0xed06('0x42')]));_0x50c0da[_0xed06('0x41')]=_0x50c0da['attributes'][_0xed06('0x43')]?_0x50c0da[_0xed06('0x41')]:_0xec4cf4[_0xed06('0x40')];if(!_0x2fa125[_0xed06('0x3e')][_0xed06('0x44')](_0xed06('0x45'))){_0x50c0da[_0xed06('0x2c')]=qs[_0xed06('0x2c')](_0x2fa125[_0xed06('0x3e')][_0xed06('0x2c')]);_0x50c0da[_0xed06('0x2d')]=qs[_0xed06('0x2d')](_0x2fa125[_0xed06('0x3e')][_0xed06('0x2d')]);}_0x50c0da[_0xed06('0x46')]=qs[_0xed06('0x47')](_0x2fa125[_0xed06('0x3e')][_0xed06('0x47')]);_0x50c0da['where']=qs[_0xed06('0x48')](_[_0xed06('0x49')](_0x2fa125[_0xed06('0x3e')],_0xec4cf4[_0xed06('0x48')]),_0x2729e3);if(_0x2fa125[_0xed06('0x3e')][_0xed06('0x4a')]){_0x50c0da[_0xed06('0x4b')]=_[_0xed06('0x4c')](_0x50c0da[_0xed06('0x4b')],{'$or':_[_0xed06('0x38')](_0x2729e3,function(_0x11710a){if(_0x11710a[_0xed06('0x3c')]!==_0xed06('0x4d')){var _0x51e15e={};_0x51e15e[_0x11710a[_0xed06('0x36')]]={'$like':'%'+_0x2fa125[_0xed06('0x3e')][_0xed06('0x4a')]+'%'};return _0x51e15e;}})});}_0x50c0da=_[_0xed06('0x4c')]({},_0x50c0da,_0x2fa125[_0xed06('0x4e')]);var _0x316fdb={'where':_0x50c0da[_0xed06('0x4b')]};return db[_0xed06('0x39')][_0xed06('0x4f')](_0x316fdb)[_0xed06('0x34')](function(_0x374e6c){_0x5d3d9[_0xed06('0x4f')]=_0x374e6c;if(_0x2fa125[_0xed06('0x3e')]['includeAll']){_0x50c0da[_0xed06('0x50')]=[{'all':!![]}];}return db[_0xed06('0x39')][_0xed06('0x51')](_0x50c0da);})[_0xed06('0x34')](function(_0x1cbcae){_0x5d3d9[_0xed06('0x52')]=_0x1cbcae;return _0x5d3d9;})['then'](respondWithFilteredResult(_0x1b9d9d,_0x50c0da))[_0xed06('0x26')](handleError(_0x1b9d9d,null));};exports['show']=function(_0x3ec07d,_0x547986){var _0x2b5c1d={'raw':!![],'where':{'id':_0x3ec07d[_0xed06('0x53')]['id']}},_0x365c72={};_0x365c72[_0xed06('0x40')]=_[_0xed06('0x3f')](db['Network']['rawAttributes']);_0x365c72[_0xed06('0x3e')]=_['keys'](_0x3ec07d[_0xed06('0x3e')]);_0x365c72['filters']=_['intersection'](_0x365c72[_0xed06('0x40')],_0x365c72['query']);_0x2b5c1d[_0xed06('0x41')]=_[_0xed06('0x54')](_0x365c72[_0xed06('0x40')],qs[_0xed06('0x42')](_0x3ec07d[_0xed06('0x3e')]['fields']));_0x2b5c1d['attributes']=_0x2b5c1d[_0xed06('0x41')][_0xed06('0x43')]?_0x2b5c1d[_0xed06('0x41')]:_0x365c72[_0xed06('0x40')];if(_0x3ec07d[_0xed06('0x3e')][_0xed06('0x55')]){_0x2b5c1d[_0xed06('0x50')]=[{'all':!![]}];}_0x2b5c1d=_[_0xed06('0x4c')]({},_0x2b5c1d,_0x3ec07d[_0xed06('0x4e')]);return db[_0xed06('0x39')][_0xed06('0x56')](_0x2b5c1d)[_0xed06('0x34')](handleEntityNotFound(_0x547986,null))[_0xed06('0x34')](respondWithResult(_0x547986,null))[_0xed06('0x26')](handleError(_0x547986,null));};exports[_0xed06('0x57')]=function(_0x137421,_0x4d8335,_0xe3b8f1){var _0x554ee2;return db['sequelize'][_0xed06('0x58')](function(_0x4ff7ff){return db['Network'][_0xed06('0x57')](_0x137421[_0xed06('0x59')],{'raw':!![]})['then'](function(_0x34408d){_0x554ee2=_0x34408d;return db[_0xed06('0x39')][_0xed06('0x51')]({'where':{'type':_0x137421[_0xed06('0x59')]['type']},'raw':!![]});})[_0xed06('0x34')](function(_0x4cc3ce){if(_0x554ee2['type'][_0xed06('0x5a')]()==_0xed06('0x5b')){var _0x13c135=fs['readFileSync'](path['join'](config['root'],_0xed06('0x5c')),_0xed06('0x5d'));var _0x4d2b27=ejs[_0xed06('0x5e')](_0x13c135,{'networks':_0x4cc3ce||[]});fs[_0xed06('0x5f')](_0xed06('0x60'),_0x4d2b27);return respondWithRpcPromise(_0xed06('0x61'),_0xed06('0x57'),{'module':_0xed06('0x62')});}else if(_0x554ee2['type'][_0xed06('0x5a')]()=='TURN'){var _0x259daa=fs[_0xed06('0x63')](path['join'](config['root'],_0xed06('0x64')),_0xed06('0x5d'));var _0x4fd70f=ejs[_0xed06('0x5e')](_0x259daa,{'networks':_0x4cc3ce||[]});fs[_0xed06('0x5f')](_0xed06('0x65'),_0x4fd70f);return respondWithRpcPromise(_0xed06('0x61'),_0xed06('0x57'),{'module':_0xed06('0x62')});}else{var _0x236497=fs['readFileSync'](path['join'](config[_0xed06('0x66')],'server/files/templates/network.ejs'),_0xed06('0x5d'));var _0x24df1a=ejs[_0xed06('0x5e')](_0x236497,{'networks':_0x4cc3ce||[]});fs[_0xed06('0x5f')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x137421[_0xed06('0x59')]['type']['toLowerCase']()),_0x24df1a);return respondWithRpcPromise(_0xed06('0x61'),_0xed06('0x57'),{'module':'chan_sip.so'});}return null;})[_0xed06('0x34')](function(){return _0x554ee2;});})['then'](respondWithResult(_0x4d8335,0xc9))[_0xed06('0x26')](handleError(_0x4d8335,null));};exports[_0xed06('0x33')]=function(_0x4fa1c3,_0x2f2641,_0x27cbd5){var _0x1a7d94;return db['sequelize']['transaction'](function(_0x4ce780){return db[_0xed06('0x39')]['find']({'where':{'id':_0x4fa1c3[_0xed06('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f2641,null))[_0xed06('0x34')](saveUpdates(_0x4fa1c3[_0xed06('0x59')],null))[_0xed06('0x34')](function(_0x1140bf){if(_0x1140bf){_0x1a7d94=_0x1140bf;return db[_0xed06('0x39')][_0xed06('0x51')]({'where':{'type':_0x1a7d94[_0xed06('0x3c')]},'raw':!![]});}return null;})[_0xed06('0x34')](function(_0x8f217b){if(_0x1a7d94[_0xed06('0x3c')][_0xed06('0x5a')]()==_0xed06('0x5b')){var _0x31ae37=fs[_0xed06('0x63')](path[_0xed06('0x67')](config['root'],_0xed06('0x5c')),_0xed06('0x5d'));var _0x5b1581=ejs[_0xed06('0x5e')](_0x31ae37,{'networks':_0x8f217b||[]});fs[_0xed06('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x5b1581);return respondWithRpcPromise(_0xed06('0x61'),_0xed06('0x33'),{'module':_0xed06('0x62')});}else if(_0x1a7d94['type'][_0xed06('0x5a')]()==_0xed06('0x68')){var _0x1ed830=fs[_0xed06('0x63')](path[_0xed06('0x67')](config[_0xed06('0x66')],_0xed06('0x64')),_0xed06('0x5d'));var _0x4efdac=ejs[_0xed06('0x5e')](_0x1ed830,{'networks':_0x8f217b||[]});fs['writeFileSync'](_0xed06('0x65'),_0x4efdac);return respondWithRpcPromise(_0xed06('0x61'),_0xed06('0x33'),{'module':'res_stun_monitor.so'});}else{var _0x11ba41=fs['readFileSync'](path[_0xed06('0x67')](config['root'],_0xed06('0x69')),'utf8');var _0x282b8f=ejs['render'](_0x11ba41,{'networks':_0x8f217b||[]});fs['writeFileSync'](util['format'](_0xed06('0x6a'),_0x4fa1c3['body'][_0xed06('0x3c')][_0xed06('0x6b')]()),_0x282b8f);return respondWithRpcPromise(_0xed06('0x61'),_0xed06('0x33'),{'module':_0xed06('0x6c')});}return null;})[_0xed06('0x34')](function(_0x3b48b5){if(_0x3b48b5){return _0x1a7d94;}return null;});})[_0xed06('0x34')](respondWithResult(_0x2f2641,null))[_0xed06('0x26')](handleError(_0x2f2641,null));};exports[_0xed06('0x6d')]=function(_0x1770b8,_0x2033e4,_0x23720f){var _0x52cfa8;return db[_0xed06('0x39')][_0xed06('0x56')]({'where':{'id':_0x1770b8[_0xed06('0x53')]['id']}})[_0xed06('0x34')](function(_0x30d35a){_0x52cfa8=_0x30d35a;return _0x30d35a;})[_0xed06('0x34')](handleEntityNotFound(_0x2033e4,null))[_0xed06('0x34')](removeEntity(_0x2033e4,null))[_0xed06('0x34')](function(){if(_0x52cfa8){return db[_0xed06('0x39')][_0xed06('0x51')]({'where':{'type':_0x52cfa8[_0xed06('0x3c')]},'raw':!![]});}})[_0xed06('0x34')](function(_0x582696){if(_0x52cfa8[_0xed06('0x3c')]['toUpperCase']()==_0xed06('0x5b')){var _0x436609=fs[_0xed06('0x63')](path['join'](config[_0xed06('0x66')],'server/files/templates/stun_multiple.ejs'),_0xed06('0x5d'));var _0x5d5b6c=ejs[_0xed06('0x5e')](_0x436609,{'networks':_0x582696||[]});fs[_0xed06('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x5d5b6c);return respondWithRpcPromise(_0xed06('0x61'),_0xed06('0x6d'),{'module':_0xed06('0x62')});}else if(_0x52cfa8['type']['toUpperCase']()==_0xed06('0x68')){var _0x40680b=fs['readFileSync'](path['join'](config[_0xed06('0x66')],_0xed06('0x64')),'utf8');var _0x481ec3=ejs[_0xed06('0x5e')](_0x40680b,{'networks':_0x582696||[]});fs[_0xed06('0x5f')](_0xed06('0x65'),_0x481ec3);return respondWithRpcPromise(_0xed06('0x61'),_0xed06('0x6d'),{'module':_0xed06('0x62')});}else{var _0x797951=fs[_0xed06('0x63')](path[_0xed06('0x67')](config['root'],_0xed06('0x69')),_0xed06('0x5d'));var _0x14094c=ejs[_0xed06('0x5e')](_0x797951,{'networks':_0x582696||[]});fs['writeFileSync'](util[_0xed06('0x6e')](_0xed06('0x6a'),_0x1770b8[_0xed06('0x59')][_0xed06('0x3c')][_0xed06('0x6b')]()),_0x14094c);return respondWithRpcPromise('Reload','destroy',{'module':_0xed06('0x6c')});}return null;})['catch'](handleError(_0x2033e4,null));}; \ No newline at end of file +var _0x090b=['chan_sip.so','update','find','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','format','toLowerCase','destroy','server/files/templates/network.ejs','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','end','stack','name','map','Network','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','includeAll','include','findAll','catch','show','params','keys','options','sequelize','transaction','create','body','toUpperCase','STUN','join','root','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','render','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf'];(function(_0x128c8d,_0x5420b4){var _0xab3422=function(_0x10bb73){while(--_0x10bb73){_0x128c8d['push'](_0x128c8d['shift']());}};_0xab3422(++_0x5420b4);}(_0x090b,0x13e));var _0xb090=function(_0x55bdfb,_0x1acc12){_0x55bdfb=_0x55bdfb-0x0;var _0x5b27d0=_0x090b[_0x55bdfb];return _0x5b27d0;};'use strict';var emlformat=require(_0xb090('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb090('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb090('0x2'));var BPromise=require(_0xb090('0x3'));var Mustache=require(_0xb090('0x4'));var util=require(_0xb090('0x5'));var path=require('path');var sox=require(_0xb090('0x6'));var csv=require(_0xb090('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb090('0x8'));var squel=require(_0xb090('0x9'));var crypto=require(_0xb090('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb090('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb090('0xc'));var Redis=require(_0xb090('0xd'));var authService=require(_0xb090('0xe'));var qs=require(_0xb090('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb090('0x10'));var logger=require(_0xb090('0x11'))(_0xb090('0x12'));var utils=require('../../config/utils');var config=require(_0xb090('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb090('0x14'))['db'];var jayson=require(_0xb090('0x15'));var client=jayson[_0xb090('0x16')][_0xb090('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x169d44,_0x5d995b,_0x3f15ae,_0x5b4b51){return new BPromise(function(_0x1d0307,_0x463ccc){var _0x42b831=_0x5b4b51||client;return _0x42b831['request'](_0x169d44,_0x3f15ae)[_0xb090('0x18')](function(_0x4cd52f){logger[_0xb090('0x19')](_0xb090('0x1a'),_0x5d995b,_0xb090('0x1b'));logger[_0xb090('0x1c')](_0xb090('0x1d'),_0x5d995b,_0xb090('0x1b'),JSON[_0xb090('0x1e')](_0x4cd52f));if(_0x4cd52f[_0xb090('0x1f')]){if(_0x4cd52f[_0xb090('0x1f')][_0xb090('0x20')]===0x1f4){logger[_0xb090('0x1f')](_0xb090('0x1a'),_0x5d995b,_0x4cd52f['error'][_0xb090('0x21')]);return _0x463ccc(_0x4cd52f[_0xb090('0x1f')][_0xb090('0x21')]);}logger[_0xb090('0x1f')](_0xb090('0x1a'),_0x5d995b,_0x4cd52f['error']['message']);return _0x1d0307(_0x4cd52f[_0xb090('0x1f')][_0xb090('0x21')]);}else{logger[_0xb090('0x19')](_0xb090('0x1a'),_0x5d995b,_0xb090('0x1b'));_0x1d0307(_0x4cd52f[_0xb090('0x22')]['message']);}})['catch'](function(_0x8fa1bc){logger['error'](_0xb090('0x1a'),_0x5d995b,_0x8fa1bc);_0x463ccc(_0x8fa1bc);});});}function respondWithStatusCode(_0x57f8fb,_0x14067f){_0x14067f=_0x14067f||0xcc;return function(_0x4eface){if(_0x4eface){return _0x57f8fb[_0xb090('0x23')](_0x14067f);}return _0x57f8fb[_0xb090('0x24')](_0x14067f)['end']();};}function respondWithResult(_0x52819a,_0x409e5a){_0x409e5a=_0x409e5a||0xc8;return function(_0x100491){if(_0x100491){return _0x52819a['status'](_0x409e5a)[_0xb090('0x25')](_0x100491);}};}function respondWithFilteredResult(_0x401275,_0x19eb28){return function(_0x417d9e){if(_0x417d9e){var _0x41b905=typeof _0x19eb28[_0xb090('0x26')]===_0xb090('0x27')&&typeof _0x19eb28[_0xb090('0x28')]===_0xb090('0x27');var _0x54a621=_0x417d9e[_0xb090('0x29')];var _0x29334c=_0x41b905?0x0:_0x19eb28['offset'];var _0xcaf5b3=_0x41b905?_0x417d9e[_0xb090('0x29')]:_0x19eb28['offset']+_0x19eb28[_0xb090('0x28')];var _0x2ea82d;if(_0xcaf5b3>=_0x54a621){_0xcaf5b3=_0x54a621;_0x2ea82d=0xc8;}else{_0x2ea82d=0xce;}_0x401275[_0xb090('0x24')](_0x2ea82d);return _0x401275[_0xb090('0x2a')](_0xb090('0x2b'),_0x29334c+'-'+_0xcaf5b3+'/'+_0x54a621)[_0xb090('0x25')](_0x417d9e);}return null;};}function patchUpdates(_0xfc4780){return function(_0x2017ac){try{jsonpatch[_0xb090('0x2c')](_0x2017ac,_0xfc4780,!![]);}catch(_0x2f62de){return BPromise[_0xb090('0x2d')](_0x2f62de);}return _0x2017ac['save']();};}function saveUpdates(_0x39289f,_0x4a489d){return function(_0x40b5f2){if(_0x40b5f2){return _0x40b5f2['update'](_0x39289f)[_0xb090('0x18')](function(_0x59b6d5){return _0x59b6d5;});}return null;};}function removeEntity(_0x568168,_0x241975){return function(_0x33e143){if(_0x33e143){return _0x33e143['destroy']()[_0xb090('0x18')](function(){_0x568168['status'](0xcc)[_0xb090('0x2e')]();});}};}function handleEntityNotFound(_0x35fb23,_0x5f357f){return function(_0xb5fab0){if(!_0xb5fab0){_0x35fb23[_0xb090('0x23')](0x194);}return _0xb5fab0;};}function handleError(_0x9c8169,_0x3f783e){_0x3f783e=_0x3f783e||0x1f4;return function(_0x328c9f){logger[_0xb090('0x1f')](_0x328c9f[_0xb090('0x2f')]);if(_0x328c9f[_0xb090('0x30')]){delete _0x328c9f[_0xb090('0x30')];}_0x9c8169['status'](_0x3f783e)['send'](_0x328c9f);};}exports['index']=function(_0x5e767c,_0x3275cf){var _0x468b93={},_0xc9ebd3={},_0x198b5b={'count':0x0,'rows':[]};var _0x19137a=_[_0xb090('0x31')](db[_0xb090('0x32')][_0xb090('0x33')],function(_0x3b07f3){return{'name':_0x3b07f3[_0xb090('0x34')],'type':_0x3b07f3[_0xb090('0x35')][_0xb090('0x36')]};});_0xc9ebd3['model']=_[_0xb090('0x31')](_0x19137a,_0xb090('0x30'));_0xc9ebd3[_0xb090('0x37')]=_['keys'](_0x5e767c[_0xb090('0x37')]);_0xc9ebd3[_0xb090('0x38')]=_[_0xb090('0x39')](_0xc9ebd3['model'],_0xc9ebd3[_0xb090('0x37')]);_0x468b93[_0xb090('0x3a')]=_[_0xb090('0x39')](_0xc9ebd3[_0xb090('0x3b')],qs['fields'](_0x5e767c[_0xb090('0x37')][_0xb090('0x3c')]));_0x468b93[_0xb090('0x3a')]=_0x468b93[_0xb090('0x3a')][_0xb090('0x3d')]?_0x468b93['attributes']:_0xc9ebd3[_0xb090('0x3b')];if(!_0x5e767c[_0xb090('0x37')][_0xb090('0x3e')](_0xb090('0x3f'))){_0x468b93[_0xb090('0x28')]=qs[_0xb090('0x28')](_0x5e767c[_0xb090('0x37')][_0xb090('0x28')]);_0x468b93['offset']=qs[_0xb090('0x26')](_0x5e767c['query'][_0xb090('0x26')]);}_0x468b93[_0xb090('0x40')]=qs['sort'](_0x5e767c[_0xb090('0x37')][_0xb090('0x41')]);_0x468b93[_0xb090('0x42')]=qs[_0xb090('0x38')](_['pick'](_0x5e767c[_0xb090('0x37')],_0xc9ebd3[_0xb090('0x38')]),_0x19137a);if(_0x5e767c['query']['filter']){_0x468b93['where']=_['merge'](_0x468b93['where'],{'$or':_[_0xb090('0x31')](_0x19137a,function(_0x1d2715){if(_0x1d2715[_0xb090('0x35')]!=='VIRTUAL'){var _0x59a723={};_0x59a723[_0x1d2715['name']]={'$like':'%'+_0x5e767c['query'][_0xb090('0x43')]+'%'};return _0x59a723;}})});}_0x468b93=_['merge']({},_0x468b93,_0x5e767c['options']);var _0x4e863e={'where':_0x468b93[_0xb090('0x42')]};return db[_0xb090('0x32')][_0xb090('0x29')](_0x4e863e)[_0xb090('0x18')](function(_0x530995){_0x198b5b[_0xb090('0x29')]=_0x530995;if(_0x5e767c[_0xb090('0x37')][_0xb090('0x44')]){_0x468b93[_0xb090('0x45')]=[{'all':!![]}];}return db[_0xb090('0x32')][_0xb090('0x46')](_0x468b93);})[_0xb090('0x18')](function(_0x513538){_0x198b5b['rows']=_0x513538;return _0x198b5b;})[_0xb090('0x18')](respondWithFilteredResult(_0x3275cf,_0x468b93))[_0xb090('0x47')](handleError(_0x3275cf,null));};exports[_0xb090('0x48')]=function(_0x2aa121,_0x5b3e11){var _0x2cf695={'raw':!![],'where':{'id':_0x2aa121[_0xb090('0x49')]['id']}},_0x247b27={};_0x247b27['model']=_[_0xb090('0x4a')](db[_0xb090('0x32')][_0xb090('0x33')]);_0x247b27[_0xb090('0x37')]=_[_0xb090('0x4a')](_0x2aa121[_0xb090('0x37')]);_0x247b27[_0xb090('0x38')]=_[_0xb090('0x39')](_0x247b27[_0xb090('0x3b')],_0x247b27[_0xb090('0x37')]);_0x2cf695[_0xb090('0x3a')]=_['intersection'](_0x247b27[_0xb090('0x3b')],qs[_0xb090('0x3c')](_0x2aa121[_0xb090('0x37')]['fields']));_0x2cf695[_0xb090('0x3a')]=_0x2cf695['attributes'][_0xb090('0x3d')]?_0x2cf695['attributes']:_0x247b27['model'];if(_0x2aa121[_0xb090('0x37')][_0xb090('0x44')]){_0x2cf695[_0xb090('0x45')]=[{'all':!![]}];}_0x2cf695=_['merge']({},_0x2cf695,_0x2aa121[_0xb090('0x4b')]);return db[_0xb090('0x32')]['find'](_0x2cf695)['then'](handleEntityNotFound(_0x5b3e11,null))[_0xb090('0x18')](respondWithResult(_0x5b3e11,null))[_0xb090('0x47')](handleError(_0x5b3e11,null));};exports['create']=function(_0x34cbc8,_0x3e6110,_0x1dce83){var _0x528b1a;return db[_0xb090('0x4c')][_0xb090('0x4d')](function(_0x3723c2){return db['Network'][_0xb090('0x4e')](_0x34cbc8['body'],{'raw':!![]})[_0xb090('0x18')](function(_0x4a3e70){_0x528b1a=_0x4a3e70;return db[_0xb090('0x32')][_0xb090('0x46')]({'where':{'type':_0x34cbc8[_0xb090('0x4f')][_0xb090('0x35')]},'raw':!![]});})[_0xb090('0x18')](function(_0x3d7c2f){if(_0x528b1a[_0xb090('0x35')][_0xb090('0x50')]()==_0xb090('0x51')){var _0x1694b1=fs['readFileSync'](path[_0xb090('0x52')](config[_0xb090('0x53')],'server/files/templates/stun_multiple.ejs'),_0xb090('0x54'));var _0x4eb936=ejs['render'](_0x1694b1,{'networks':_0x3d7c2f||[]});fs[_0xb090('0x55')](_0xb090('0x56'),_0x4eb936);return respondWithRpcPromise(_0xb090('0x57'),_0xb090('0x4e'),{'module':_0xb090('0x58')});}else if(_0x528b1a[_0xb090('0x35')][_0xb090('0x50')]()==_0xb090('0x59')){var _0x4fbc42=fs[_0xb090('0x5a')](path[_0xb090('0x52')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xb090('0x54'));var _0x52c974=ejs[_0xb090('0x5b')](_0x4fbc42,{'networks':_0x3d7c2f||[]});fs[_0xb090('0x55')](_0xb090('0x5c'),_0x52c974);return respondWithRpcPromise(_0xb090('0x57'),_0xb090('0x4e'),{'module':_0xb090('0x58')});}else{var _0x4a3174=fs[_0xb090('0x5a')](path['join'](config[_0xb090('0x53')],'server/files/templates/network.ejs'),_0xb090('0x54'));var _0x173bbb=ejs[_0xb090('0x5b')](_0x4a3174,{'networks':_0x3d7c2f||[]});fs[_0xb090('0x55')](util['format'](_0xb090('0x5d'),_0x34cbc8[_0xb090('0x4f')][_0xb090('0x35')]['toLowerCase']()),_0x173bbb);return respondWithRpcPromise('Reload',_0xb090('0x4e'),{'module':_0xb090('0x5e')});}return null;})['then'](function(){return _0x528b1a;});})[_0xb090('0x18')](respondWithResult(_0x3e6110,0xc9))['catch'](handleError(_0x3e6110,null));};exports[_0xb090('0x5f')]=function(_0x4f6eed,_0x386f09,_0x48a1ec){var _0x34ca7d;return db[_0xb090('0x4c')][_0xb090('0x4d')](function(_0x498294){return db['Network'][_0xb090('0x60')]({'where':{'id':_0x4f6eed['params']['id']}})[_0xb090('0x18')](handleEntityNotFound(_0x386f09,null))[_0xb090('0x18')](saveUpdates(_0x4f6eed[_0xb090('0x4f')],null))[_0xb090('0x18')](function(_0x29ec7f){if(_0x29ec7f){_0x34ca7d=_0x29ec7f;return db[_0xb090('0x32')][_0xb090('0x46')]({'where':{'type':_0x34ca7d[_0xb090('0x35')]},'raw':!![]});}return null;})[_0xb090('0x18')](function(_0x33b0a3){if(_0x34ca7d['type']['toUpperCase']()=='STUN'){var _0x44b8b4=fs['readFileSync'](path['join'](config[_0xb090('0x53')],_0xb090('0x61')),_0xb090('0x54'));var _0x132921=ejs['render'](_0x44b8b4,{'networks':_0x33b0a3||[]});fs['writeFileSync'](_0xb090('0x56'),_0x132921);return respondWithRpcPromise(_0xb090('0x57'),_0xb090('0x5f'),{'module':_0xb090('0x58')});}else if(_0x34ca7d[_0xb090('0x35')][_0xb090('0x50')]()=='TURN'){var _0x497abd=fs['readFileSync'](path[_0xb090('0x52')](config[_0xb090('0x53')],_0xb090('0x62')),'utf8');var _0x207f48=ejs[_0xb090('0x5b')](_0x497abd,{'networks':_0x33b0a3||[]});fs['writeFileSync'](_0xb090('0x5c'),_0x207f48);return respondWithRpcPromise(_0xb090('0x57'),'update',{'module':'res_stun_monitor.so'});}else{var _0x4f87de=fs[_0xb090('0x5a')](path['join'](config[_0xb090('0x53')],'server/files/templates/network.ejs'),'utf8');var _0x31ce0a=ejs[_0xb090('0x5b')](_0x4f87de,{'networks':_0x33b0a3||[]});fs[_0xb090('0x55')](util[_0xb090('0x63')](_0xb090('0x5d'),_0x4f6eed[_0xb090('0x4f')][_0xb090('0x35')][_0xb090('0x64')]()),_0x31ce0a);return respondWithRpcPromise('Reload',_0xb090('0x5f'),{'module':_0xb090('0x5e')});}return null;})['then'](function(_0x248186){if(_0x248186){return _0x34ca7d;}return null;});})[_0xb090('0x18')](respondWithResult(_0x386f09,null))['catch'](handleError(_0x386f09,null));};exports[_0xb090('0x65')]=function(_0x2884c6,_0x3494e0,_0x39be6d){var _0x222db0;return db[_0xb090('0x32')]['find']({'where':{'id':_0x2884c6[_0xb090('0x49')]['id']}})[_0xb090('0x18')](function(_0x3c4264){_0x222db0=_0x3c4264;return _0x3c4264;})['then'](handleEntityNotFound(_0x3494e0,null))[_0xb090('0x18')](removeEntity(_0x3494e0,null))[_0xb090('0x18')](function(){if(_0x222db0){return db[_0xb090('0x32')][_0xb090('0x46')]({'where':{'type':_0x222db0[_0xb090('0x35')]},'raw':!![]});}})[_0xb090('0x18')](function(_0x19f93b){if(_0x222db0[_0xb090('0x35')][_0xb090('0x50')]()==_0xb090('0x51')){var _0x28eafd=fs[_0xb090('0x5a')](path[_0xb090('0x52')](config[_0xb090('0x53')],'server/files/templates/stun_multiple.ejs'),_0xb090('0x54'));var _0x4282d2=ejs[_0xb090('0x5b')](_0x28eafd,{'networks':_0x19f93b||[]});fs[_0xb090('0x55')]('/etc/asterisk/stun_xcally.conf',_0x4282d2);return respondWithRpcPromise('Reload',_0xb090('0x65'),{'module':_0xb090('0x58')});}else if(_0x222db0[_0xb090('0x35')][_0xb090('0x50')]()==_0xb090('0x59')){var _0x262e79=fs[_0xb090('0x5a')](path[_0xb090('0x52')](config[_0xb090('0x53')],'server/files/templates/turn_multiple.ejs'),_0xb090('0x54'));var _0xd74124=ejs[_0xb090('0x5b')](_0x262e79,{'networks':_0x19f93b||[]});fs[_0xb090('0x55')](_0xb090('0x5c'),_0xd74124);return respondWithRpcPromise(_0xb090('0x57'),'destroy',{'module':_0xb090('0x58')});}else{var _0x57bd28=fs['readFileSync'](path[_0xb090('0x52')](config['root'],_0xb090('0x66')),_0xb090('0x54'));var _0x4f522b=ejs['render'](_0x57bd28,{'networks':_0x19f93b||[]});fs['writeFileSync'](util['format'](_0xb090('0x5d'),_0x2884c6[_0xb090('0x4f')][_0xb090('0x35')][_0xb090('0x64')]()),_0x4f522b);return respondWithRpcPromise(_0xb090('0x57'),_0xb090('0x65'),{'module':_0xb090('0x5e')});}return null;})['catch'](handleError(_0x3494e0,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 6e84ac3..f0af701 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 _0xa45c=['request-promise','rimraf','exports','define','network','lodash','util','moment'];(function(_0x4986f2,_0x339564){var _0x4d7553=function(_0x59b77a){while(--_0x59b77a){_0x4986f2['push'](_0x4986f2['shift']());}};_0x4d7553(++_0x339564);}(_0xa45c,0x6d));var _0xca45=function(_0x11b9bc,_0x13d34c){_0x11b9bc=_0x11b9bc-0x0;var _0x551c8f=_0xa45c[_0x11b9bc];return _0x551c8f;};'use strict';var _=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xca45('0x2'));var BPromise=require('bluebird');var rp=require(_0xca45('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca45('0x4'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xca45('0x5')]=function(_0x3803d6,_0x18d789){return _0x3803d6[_0xca45('0x6')]('Network',attributes,{'tableName':_0xca45('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','Network','network','lodash'];(function(_0x5e4015,_0x43aab1){var _0x37b75d=function(_0x30520e){while(--_0x30520e){_0x5e4015['push'](_0x5e4015['shift']());}};_0x37b75d(++_0x43aab1);}(_0xaa88,0x137));var _0x8aa8=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0xaa88[_0x4fbb86];return _0xb141fe;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'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 853a436..e2ddade 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x14bf61,_0x447a8f){_0x14bf61=_0x14bf61-0x0;var _0xcea8a=_0x7a54[_0x14bf61];return _0xcea8a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x200c18,_0x53748f){_0x200c18=_0x200c18-0x0;var _0x55563f=_0x7a54[_0x200c18];return _0x55563f;};'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 185bbf2..3728a85 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 _0xd235=['update','delete','destroy','/:id/dispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','getDispositions','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','notify','/:id/applications','addApplications','addAgents','send','put','/:id'];(function(_0x595d11,_0x2178f1){var _0x1aa8eb=function(_0x2d9235){while(--_0x2d9235){_0x595d11['push'](_0x595d11['shift']());}};_0x1aa8eb(++_0x2178f1);}(_0xd235,0xb9));var _0x5d23=function(_0x1966b4,_0xfc0d64){_0x1966b4=_0x1966b4-0x0;var _0x3f1c2b=_0xd235[_0x1966b4];return _0x3f1c2b;};'use strict';var multer=require(_0x5d23('0x0'));var util=require(_0x5d23('0x1'));var path=require(_0x5d23('0x2'));var timeout=require(_0x5d23('0x3'));var express=require(_0x5d23('0x4'));var router=express[_0x5d23('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5d23('0x6'));var interaction=require(_0x5d23('0x7'));var config=require(_0x5d23('0x8'));var controller=require(_0x5d23('0x9'));router[_0x5d23('0xa')]('/',auth[_0x5d23('0xb')](),controller[_0x5d23('0xc')]);router['get']('/describe',auth[_0x5d23('0xb')](),controller[_0x5d23('0xd')]);router[_0x5d23('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5d23('0xa')]('/:id/dispositions',auth[_0x5d23('0xb')](),controller[_0x5d23('0xe')]);router[_0x5d23('0xa')]('/:id/canned_answers',auth[_0x5d23('0xb')](),controller['getAnswers']);router[_0x5d23('0xa')]('/:id/applications',auth[_0x5d23('0xb')](),controller[_0x5d23('0xf')]);router['get'](_0x5d23('0x10'),auth['isAuthenticated'](),controller[_0x5d23('0x11')]);router[_0x5d23('0xa')](_0x5d23('0x12'),auth[_0x5d23('0xb')](),controller[_0x5d23('0x13')]);router[_0x5d23('0x14')]('/',auth[_0x5d23('0xb')](),controller[_0x5d23('0x15')]);router['post']('/:id/dispositions',auth[_0x5d23('0xb')](),controller[_0x5d23('0x16')]);router[_0x5d23('0x14')](_0x5d23('0x17'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x5d23('0x14')]('/:id/notify',controller[_0x5d23('0x18')]);router[_0x5d23('0x14')](_0x5d23('0x19'),auth['isAuthenticated'](),controller[_0x5d23('0x1a')]);router[_0x5d23('0x14')]('/:id/users',auth[_0x5d23('0xb')](),controller[_0x5d23('0x1b')]);router['post']('/:id/send',auth[_0x5d23('0xb')](),controller[_0x5d23('0x1c')]);router[_0x5d23('0x1d')](_0x5d23('0x1e'),auth[_0x5d23('0xb')](),controller[_0x5d23('0x1f')]);router[_0x5d23('0x20')](_0x5d23('0x1e'),auth[_0x5d23('0xb')](),controller[_0x5d23('0x21')]);router['delete'](_0x5d23('0x22'),auth[_0x5d23('0xb')](),controller['removeDispositions']);router[_0x5d23('0x20')](_0x5d23('0x17'),auth[_0x5d23('0xb')](),controller['removeAnswers']);router[_0x5d23('0x20')]('/:id/users',auth[_0x5d23('0xb')](),controller[_0x5d23('0x23')]);module['exports']=router; \ No newline at end of file +var _0x5e71=['getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5e71,0x10a));var _0x15e7=function(_0x3cb117,_0x346347){_0x3cb117=_0x3cb117-0x0;var _0x5a2f14=_0x5e71[_0x3cb117];return _0x5a2f14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x15e7('0x0'));var timeout=require('connect-timeout');var express=require(_0x15e7('0x1'));var router=express[_0x15e7('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x15e7('0x3'));var interaction=require(_0x15e7('0x4'));var config=require('../../config/environment');var controller=require(_0x15e7('0x5'));router['get']('/',auth[_0x15e7('0x6')](),controller[_0x15e7('0x7')]);router[_0x15e7('0x8')](_0x15e7('0x9'),auth[_0x15e7('0x6')](),controller[_0x15e7('0xa')]);router[_0x15e7('0x8')](_0x15e7('0xb'),auth['isAuthenticated'](),controller[_0x15e7('0xc')]);router[_0x15e7('0x8')](_0x15e7('0xd'),auth[_0x15e7('0x6')](),controller[_0x15e7('0xe')]);router[_0x15e7('0x8')]('/:id/canned_answers',auth[_0x15e7('0x6')](),controller[_0x15e7('0xf')]);router[_0x15e7('0x8')](_0x15e7('0x10'),auth[_0x15e7('0x6')](),controller[_0x15e7('0x11')]);router[_0x15e7('0x8')](_0x15e7('0x12'),auth[_0x15e7('0x6')](),controller[_0x15e7('0x13')]);router[_0x15e7('0x8')](_0x15e7('0x14'),auth[_0x15e7('0x6')](),controller[_0x15e7('0x15')]);router[_0x15e7('0x16')]('/',auth[_0x15e7('0x6')](),controller[_0x15e7('0x17')]);router[_0x15e7('0x16')](_0x15e7('0xd'),auth[_0x15e7('0x6')](),controller[_0x15e7('0x18')]);router['post'](_0x15e7('0x19'),auth[_0x15e7('0x6')](),controller[_0x15e7('0x1a')]);router['post'](_0x15e7('0x1b'),controller[_0x15e7('0x1c')]);router['post'](_0x15e7('0x10'),auth['isAuthenticated'](),controller[_0x15e7('0x1d')]);router[_0x15e7('0x16')]('/:id/users',auth[_0x15e7('0x6')](),controller[_0x15e7('0x1e')]);router[_0x15e7('0x16')](_0x15e7('0x1f'),auth[_0x15e7('0x6')](),controller[_0x15e7('0x20')]);router['put']('/:id',auth[_0x15e7('0x6')](),controller[_0x15e7('0x21')]);router['delete']('/:id',auth[_0x15e7('0x6')](),controller[_0x15e7('0x22')]);router[_0x15e7('0x23')](_0x15e7('0xd'),auth['isAuthenticated'](),controller[_0x15e7('0x24')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x15e7('0x25')]);router['delete'](_0x15e7('0x14'),auth[_0x15e7('0x6')](),controller[_0x15e7('0x26')]);module[_0x15e7('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 538ec22..48ad580 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 _0x4921=['exports','STRING','name','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4921,0xde));var _0x1492=function(_0x43f47b,_0x311636){_0x43f47b=_0x43f47b-0x0;var _0x4af9a6=_0x4921[_0x43f47b];return _0x4af9a6;};'use strict';var Sequelize=require(_0x1492('0x0'));var rs=require(_0x1492('0x1'));module[_0x1492('0x2')]={'name':{'type':Sequelize[_0x1492('0x3')],'unique':_0x1492('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x1492('0x3')]},'token':{'type':Sequelize[_0x1492('0x3')],'defaultValue':function(){return rs[_0x1492('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1492('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1492('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1492('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1492('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1492('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1492('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1492('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1492('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x1492('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1492('0xa'),'set':function(_0x202a1){if(!_0x202a1)this['setDataValue'](_0x1492('0xb'),null);this[_0x1492('0xc')](_0x1492('0xd'),_0x202a1);}}}; \ No newline at end of file +var _0xff8c=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2254a0,_0x41f33e){var _0x35cd31=function(_0x5242d5){while(--_0x5242d5){_0x2254a0['push'](_0x2254a0['shift']());}};_0x35cd31(++_0x41f33e);}(_0xff8c,0x148));var _0xcff8=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0xff8c[_0xc471d2];return _0x334c68;};'use strict';var Sequelize=require(_0xcff8('0x0'));var rs=require(_0xcff8('0x1'));module[_0xcff8('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xcff8('0x3')]},'token':{'type':Sequelize[_0xcff8('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xcff8('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xcff8('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xcff8('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcff8('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xcff8('0x3')]},'queueTransfer':{'type':Sequelize[_0xcff8('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcff8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcff8('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcff8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcff8('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xcff8('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcff8('0x8'),'set':function(_0x5248a8){if(!_0x5248a8)this[_0xcff8('0x9')](_0xcff8('0xa'),null);this[_0xcff8('0x9')](_0xcff8('0xb'),_0x5248a8);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index e0dc681..939b853 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 _0x5bb8=['fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','CmList','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','destroy','OpenchannelAccounts','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','name','query','keys','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filters','filter','VIRTUAL','includeAll','findAll','rows','show','params','include','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','OpenchannelAccountId','getDispositions','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','describe','Sequelize','ValidationError','difference','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','account','applications','list','priority','asc','Applications','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','update','interaction','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','findOne','transaction','bulkCreate','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','hasOwnProperty','Contact'];(function(_0x57f398,_0x50beb8){var _0x4cc9a9=function(_0x3ad249){while(--_0x3ad249){_0x57f398['push'](_0x57f398['shift']());}};_0x4cc9a9(++_0x50beb8);}(_0x5bb8,0xc6));var _0x85bb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5bb8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x85bb('0x0'));var rimraf=require(_0x85bb('0x1'));var zipdir=require(_0x85bb('0x2'));var jsonpatch=require(_0x85bb('0x3'));var rp=require(_0x85bb('0x4'));var moment=require(_0x85bb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x85bb('0x6'));var path=require('path');var sox=require(_0x85bb('0x7'));var csv=require(_0x85bb('0x8'));var ejs=require(_0x85bb('0x9'));var fs=require('fs');var fs_extra=require(_0x85bb('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x85bb('0xb'));var jsforce=require(_0x85bb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x85bb('0x8'));var querystring=require(_0x85bb('0xd'));var Papa=require('papaparse');var Redis=require(_0x85bb('0xe'));var authService=require(_0x85bb('0xf'));var qs=require(_0x85bb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85bb('0x11'));var logger=require('../../config/logger')(_0x85bb('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x85bb('0x13'));var db=require(_0x85bb('0x14'))['db'];config[_0x85bb('0x15')]=_[_0x85bb('0x16')](config[_0x85bb('0x15')],{'host':_0x85bb('0x17'),'port':0x18eb});var socket=require(_0x85bb('0x18'))(new Redis(config[_0x85bb('0x15')]));require(_0x85bb('0x19'))[_0x85bb('0x1a')](socket);var jayson=require(_0x85bb('0x1b'));var client=jayson[_0x85bb('0x1c')][_0x85bb('0x1d')]({'port':0x232c});var client9002=jayson[_0x85bb('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19b18a,_0x33196c,_0x36cc6e,_0x3963cd){return new BPromise(function(_0x586b39,_0x340c0c){var _0x4fe8c0=_0x3963cd||client;return _0x4fe8c0['request'](_0x19b18a,_0x36cc6e)[_0x85bb('0x1e')](function(_0x1aac94){logger[_0x85bb('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x33196c,'request\x20sent');logger['debug'](_0x85bb('0x20'),_0x33196c,_0x85bb('0x21'),JSON['stringify'](_0x1aac94));if(_0x1aac94[_0x85bb('0x22')]){if(_0x1aac94[_0x85bb('0x22')][_0x85bb('0x23')]===0x1f4){logger[_0x85bb('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x33196c,_0x1aac94[_0x85bb('0x22')]['message']);return _0x340c0c(_0x1aac94['error'][_0x85bb('0x24')]);}logger[_0x85bb('0x22')](_0x85bb('0x25'),_0x33196c,_0x1aac94[_0x85bb('0x22')][_0x85bb('0x24')]);return _0x586b39(_0x1aac94[_0x85bb('0x22')][_0x85bb('0x24')]);}else{logger[_0x85bb('0x1f')](_0x85bb('0x25'),_0x33196c,'request\x20sent');_0x586b39(_0x1aac94[_0x85bb('0x26')][_0x85bb('0x24')]);}})[_0x85bb('0x27')](function(_0x3e3768){logger[_0x85bb('0x22')](_0x85bb('0x25'),_0x33196c,_0x3e3768);_0x340c0c(_0x3e3768);});});}function respondWithStatusCode(_0xa31d9c,_0xf3a249){_0xf3a249=_0xf3a249||0xcc;return function(_0x34070c){if(_0x34070c){return _0xa31d9c[_0x85bb('0x28')](_0xf3a249);}return _0xa31d9c['status'](_0xf3a249)[_0x85bb('0x29')]();};}function respondWithResult(_0x181f57,_0x11bdb9){_0x11bdb9=_0x11bdb9||0xc8;return function(_0xd89a5f){if(_0xd89a5f){return _0x181f57['status'](_0x11bdb9)[_0x85bb('0x2a')](_0xd89a5f);}};}function respondWithFilteredResult(_0x5af5f5,_0x3f20a6){return function(_0x6268f2){if(_0x6268f2){var _0x144da8=typeof _0x3f20a6[_0x85bb('0x2b')]===_0x85bb('0x2c')&&typeof _0x3f20a6[_0x85bb('0x2d')]===_0x85bb('0x2c');var _0x31b8aa=_0x6268f2[_0x85bb('0x2e')];var _0x276e6c=_0x144da8?0x0:_0x3f20a6[_0x85bb('0x2b')];var _0x3aa4e8=_0x144da8?_0x6268f2[_0x85bb('0x2e')]:_0x3f20a6[_0x85bb('0x2b')]+_0x3f20a6[_0x85bb('0x2d')];var _0x3f2284;if(_0x3aa4e8>=_0x31b8aa){_0x3aa4e8=_0x31b8aa;_0x3f2284=0xc8;}else{_0x3f2284=0xce;}_0x5af5f5[_0x85bb('0x2f')](_0x3f2284);return _0x5af5f5[_0x85bb('0x30')]('Content-Range',_0x276e6c+'-'+_0x3aa4e8+'/'+_0x31b8aa)[_0x85bb('0x2a')](_0x6268f2);}return null;};}function patchUpdates(_0x2d1e8e){return function(_0x38b70f){try{jsonpatch[_0x85bb('0x31')](_0x38b70f,_0x2d1e8e,!![]);}catch(_0x4a2bd9){return BPromise['reject'](_0x4a2bd9);}return _0x38b70f['save']();};}function saveUpdates(_0x589133,_0x2b7c11){return function(_0x135f84){if(_0x135f84){return _0x135f84['update'](_0x589133)[_0x85bb('0x1e')](function(_0x2a2263){return _0x2a2263;});}return null;};}function removeEntity(_0x2f0e02,_0x56e456){return function(_0x21a971){if(_0x21a971){return _0x21a971[_0x85bb('0x32')]()[_0x85bb('0x1e')](function(){var _0x177fb3=_0x21a971['get']({'plain':!![]});var _0x1d00b9=_0x85bb('0x33');return db[_0x85bb('0x34')]['destroy']({'where':{'type':_0x1d00b9,'resourceId':_0x177fb3['id']}})['then'](function(){return _0x21a971;});})[_0x85bb('0x1e')](function(){_0x2f0e02[_0x85bb('0x2f')](0xcc)[_0x85bb('0x29')]();});}};}function handleEntityNotFound(_0x44368,_0xdb10f7){return function(_0x55108b){if(!_0x55108b){_0x44368['sendStatus'](0x194);}return _0x55108b;};}function handleError(_0x50e3f9,_0x259850){_0x259850=_0x259850||0x1f4;return function(_0x4a894f){logger[_0x85bb('0x22')](_0x4a894f[_0x85bb('0x35')]);if(_0x4a894f['name']){delete _0x4a894f['name'];}_0x50e3f9['status'](_0x259850)[_0x85bb('0x36')](_0x4a894f);};}exports[_0x85bb('0x37')]=function(_0x56b88a,_0x2fae61){var _0x2074a4={'include':[{'model':db[_0x85bb('0x38')],'as':_0x85bb('0x39')}]},_0x35b90b={},_0x567c35={'count':0x0,'rows':[]};var _0x205863=_[_0x85bb('0x3a')](db[_0x85bb('0x3b')][_0x85bb('0x3c')],function(_0x2120ef){return{'name':_0x2120ef[_0x85bb('0x3d')],'type':_0x2120ef[_0x85bb('0x3e')]['key']};});_0x35b90b['model']=_[_0x85bb('0x3a')](_0x205863,_0x85bb('0x3f'));_0x35b90b[_0x85bb('0x40')]=_[_0x85bb('0x41')](_0x56b88a[_0x85bb('0x40')]);_0x35b90b['filters']=_[_0x85bb('0x42')](_0x35b90b['model'],_0x35b90b[_0x85bb('0x40')]);_0x2074a4[_0x85bb('0x43')]=_[_0x85bb('0x42')](_0x35b90b[_0x85bb('0x44')],qs[_0x85bb('0x45')](_0x56b88a[_0x85bb('0x40')][_0x85bb('0x45')]));_0x2074a4['attributes']=_0x2074a4[_0x85bb('0x43')][_0x85bb('0x46')]?_0x2074a4[_0x85bb('0x43')]:_0x35b90b[_0x85bb('0x44')];if(!_0x56b88a[_0x85bb('0x40')]['hasOwnProperty'](_0x85bb('0x47'))){_0x2074a4['limit']=qs['limit'](_0x56b88a[_0x85bb('0x40')]['limit']);_0x2074a4[_0x85bb('0x2b')]=qs[_0x85bb('0x2b')](_0x56b88a[_0x85bb('0x40')]['offset']);}_0x2074a4['order']=qs['sort'](_0x56b88a[_0x85bb('0x40')][_0x85bb('0x48')]);_0x2074a4[_0x85bb('0x49')]=qs['filters'](_[_0x85bb('0x4a')](_0x56b88a[_0x85bb('0x40')],_0x35b90b[_0x85bb('0x4b')]),_0x205863);if(_0x56b88a[_0x85bb('0x40')][_0x85bb('0x4c')]){_0x2074a4[_0x85bb('0x49')]=_['merge'](_0x2074a4[_0x85bb('0x49')],{'$or':_[_0x85bb('0x3a')](_0x205863,function(_0x181fe7){if(_0x181fe7['type']!==_0x85bb('0x4d')){var _0x2a058c={};_0x2a058c[_0x181fe7[_0x85bb('0x3f')]]={'$like':'%'+_0x56b88a[_0x85bb('0x40')]['filter']+'%'};return _0x2a058c;}})});}_0x2074a4=_['merge']({},_0x2074a4,_0x56b88a['options']);var _0x551982={'where':_0x2074a4[_0x85bb('0x49')]};return db[_0x85bb('0x3b')][_0x85bb('0x2e')](_0x551982)['then'](function(_0x44d9b9){_0x567c35[_0x85bb('0x2e')]=_0x44d9b9;if(_0x56b88a[_0x85bb('0x40')][_0x85bb('0x4e')]){_0x2074a4['include']=[{'all':!![]}];}return db[_0x85bb('0x3b')][_0x85bb('0x4f')](_0x2074a4);})[_0x85bb('0x1e')](function(_0x4d9389){_0x567c35[_0x85bb('0x50')]=_0x4d9389;return _0x567c35;})[_0x85bb('0x1e')](respondWithFilteredResult(_0x2fae61,_0x2074a4))[_0x85bb('0x27')](handleError(_0x2fae61,null));};exports[_0x85bb('0x51')]=function(_0x380178,_0x57a22a){var _0x37c53d={'raw':![],'where':{'id':_0x380178[_0x85bb('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x326356={};_0x326356['model']=_[_0x85bb('0x41')](db['OpenchannelAccount'][_0x85bb('0x3c')]);_0x326356['query']=_[_0x85bb('0x41')](_0x380178[_0x85bb('0x40')]);_0x326356[_0x85bb('0x4b')]=_[_0x85bb('0x42')](_0x326356[_0x85bb('0x44')],_0x326356[_0x85bb('0x40')]);_0x37c53d[_0x85bb('0x43')]=_[_0x85bb('0x42')](_0x326356[_0x85bb('0x44')],qs[_0x85bb('0x45')](_0x380178[_0x85bb('0x40')][_0x85bb('0x45')]));_0x37c53d[_0x85bb('0x43')]=_0x37c53d[_0x85bb('0x43')][_0x85bb('0x46')]?_0x37c53d[_0x85bb('0x43')]:_0x326356[_0x85bb('0x44')];if(_0x380178[_0x85bb('0x40')][_0x85bb('0x4e')]){_0x37c53d[_0x85bb('0x53')]=[{'all':!![]}];}_0x37c53d=_[_0x85bb('0x54')]({},_0x37c53d,_0x380178[_0x85bb('0x55')]);return db[_0x85bb('0x3b')]['find'](_0x37c53d)[_0x85bb('0x1e')](handleEntityNotFound(_0x57a22a,null))[_0x85bb('0x1e')](respondWithResult(_0x57a22a,null))[_0x85bb('0x27')](handleError(_0x57a22a,null));};exports['create']=function(_0x3b004c,_0x5dc2b2){return db[_0x85bb('0x3b')][_0x85bb('0x56')](_0x3b004c[_0x85bb('0x57')],{})[_0x85bb('0x1e')](function(_0x52f683){var _0x122bb9=_0x3b004c['user']['get']({'plain':!![]});if(!_0x122bb9)throw new Error(_0x85bb('0x58'));if(_0x122bb9['role']===_0x85bb('0x59')){var _0x13109b=_0x52f683[_0x85bb('0x5a')]({'plain':!![]});var _0x22ac15=_0x85bb('0x33');return db['UserProfileSection'][_0x85bb('0x5b')]({'where':{'name':_0x22ac15,'userProfileId':_0x122bb9['userProfileId']},'raw':!![]})[_0x85bb('0x1e')](function(_0x3a2142){if(_0x3a2142&&_0x3a2142[_0x85bb('0x5c')]===0x0){return db[_0x85bb('0x34')][_0x85bb('0x56')]({'name':_0x13109b[_0x85bb('0x3f')],'resourceId':_0x13109b['id'],'type':_0x3a2142[_0x85bb('0x3f')],'sectionId':_0x3a2142['id']},{})[_0x85bb('0x1e')](function(){return _0x52f683;});}else{return _0x52f683;}})['catch'](function(_0x14f751){logger[_0x85bb('0x22')](_0x85bb('0x5d'),_0x14f751);throw _0x14f751;});}return _0x52f683;})[_0x85bb('0x1e')](respondWithResult(_0x5dc2b2,0xc9))[_0x85bb('0x27')](handleError(_0x5dc2b2,null));};exports['update']=function(_0x478939,_0x3c36e4){if(_0x478939['body']['id']){delete _0x478939[_0x85bb('0x57')]['id'];}return db['OpenchannelAccount'][_0x85bb('0x5b')]({'where':{'id':_0x478939[_0x85bb('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3c36e4,null))[_0x85bb('0x1e')](saveUpdates(_0x478939[_0x85bb('0x57')],null))[_0x85bb('0x1e')](respondWithResult(_0x3c36e4,null))['catch'](handleError(_0x3c36e4,null));};exports['destroy']=function(_0x24d255,_0x105ecd){return db[_0x85bb('0x3b')][_0x85bb('0x5b')]({'where':{'id':_0x24d255[_0x85bb('0x52')]['id']}})['then'](handleEntityNotFound(_0x105ecd,null))[_0x85bb('0x1e')](removeEntity(_0x105ecd,null))[_0x85bb('0x27')](handleError(_0x105ecd,null));};exports['describe']=function(_0x448388,_0xf0c4f7){return db[_0x85bb('0x3b')]['describe']()[_0x85bb('0x1e')](respondWithResult(_0xf0c4f7,null))[_0x85bb('0x27')](handleError(_0xf0c4f7,null));};exports[_0x85bb('0x5e')]=function(_0x4533bf,_0xdbe3d2,_0x2eade9){if(_0x4533bf['body']['id']){delete _0x4533bf[_0x85bb('0x57')]['id'];}return db[_0x85bb('0x3b')][_0x85bb('0x5b')]({'where':{'id':_0x4533bf[_0x85bb('0x52')]['id']}})['then'](handleEntityNotFound(_0xdbe3d2,null))[_0x85bb('0x1e')](function(_0x4add21){if(_0x4add21){_0x4533bf[_0x85bb('0x57')][_0x85bb('0x5f')]=_0x4add21['id'];return db['Disposition'][_0x85bb('0x56')](_0x4533bf[_0x85bb('0x57')]);}})[_0x85bb('0x1e')](respondWithResult(_0xdbe3d2,null))[_0x85bb('0x27')](handleError(_0xdbe3d2,null));};exports[_0x85bb('0x60')]=function(_0x4a46a4,_0x2f6e76,_0x502afe){var _0x19f586={'raw':![],'where':{}};var _0x28321c={};var _0x3d4701={'count':0x0,'rows':[]};return db[_0x85bb('0x3b')]['findOne']({'where':{'id':_0x4a46a4[_0x85bb('0x52')]['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x2f6e76,null))['then'](function(_0x4d3c35){if(_0x4d3c35){_0x28321c['model']=_['keys'](db[_0x85bb('0x61')]['rawAttributes']);_0x28321c[_0x85bb('0x40')]=_[_0x85bb('0x41')](_0x4a46a4[_0x85bb('0x40')]);_0x28321c[_0x85bb('0x4b')]=_['intersection'](_0x28321c['model'],_0x28321c[_0x85bb('0x40')]);_0x19f586['attributes']=_[_0x85bb('0x42')](_0x28321c['model'],qs[_0x85bb('0x45')](_0x4a46a4['query'][_0x85bb('0x45')]));_0x19f586[_0x85bb('0x43')]=_0x19f586[_0x85bb('0x43')][_0x85bb('0x46')]?_0x19f586[_0x85bb('0x43')]:_0x28321c['model'];if(!_0x4a46a4[_0x85bb('0x40')]['hasOwnProperty']('nolimit')){_0x19f586[_0x85bb('0x2d')]=qs[_0x85bb('0x2d')](_0x4a46a4[_0x85bb('0x40')]['limit']);_0x19f586[_0x85bb('0x2b')]=qs[_0x85bb('0x2b')](_0x4a46a4[_0x85bb('0x40')][_0x85bb('0x2b')]);}_0x19f586[_0x85bb('0x62')]=qs[_0x85bb('0x48')](_0x4a46a4[_0x85bb('0x40')][_0x85bb('0x48')]);_0x19f586[_0x85bb('0x49')]=qs[_0x85bb('0x4b')](_[_0x85bb('0x4a')](_0x4a46a4[_0x85bb('0x40')],_0x28321c[_0x85bb('0x4b')]));_0x19f586[_0x85bb('0x49')][_0x85bb('0x5f')]=_0x4d3c35['id'];if(_0x4a46a4[_0x85bb('0x40')][_0x85bb('0x4c')]){_0x19f586['where']=_[_0x85bb('0x54')](_0x19f586[_0x85bb('0x49')],{'$or':_[_0x85bb('0x3a')](_0x19f586[_0x85bb('0x43')],function(_0x15adcf){var _0x127b9b={};_0x127b9b[_0x15adcf]={'$like':'%'+_0x4a46a4[_0x85bb('0x40')][_0x85bb('0x4c')]+'%'};return _0x127b9b;})});}_0x19f586=_[_0x85bb('0x54')]({},_0x19f586,_0x4a46a4[_0x85bb('0x55')]);return db[_0x85bb('0x61')]['count']({'where':_0x19f586[_0x85bb('0x49')]})[_0x85bb('0x1e')](function(_0xbc890f){_0x3d4701[_0x85bb('0x2e')]=_0xbc890f;if(_0x4a46a4[_0x85bb('0x40')][_0x85bb('0x4e')]){_0x19f586[_0x85bb('0x53')]=[{'all':!![]}];}return db[_0x85bb('0x61')]['findAll'](_0x19f586);})[_0x85bb('0x1e')](function(_0x3c9140){_0x3d4701[_0x85bb('0x50')]=_0x3c9140;return _0x3d4701;});}})[_0x85bb('0x1e')](respondWithFilteredResult(_0x2f6e76,_0x19f586))[_0x85bb('0x27')](handleError(_0x2f6e76,null));};exports['removeDispositions']=function(_0x58b3d0,_0x26e08e,_0x1284fb){return db[_0x85bb('0x3b')][_0x85bb('0x5b')]({'where':{'id':_0x58b3d0[_0x85bb('0x52')]['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x26e08e,null))[_0x85bb('0x1e')](function(_0x2e6ee7){if(_0x2e6ee7){return _0x2e6ee7[_0x85bb('0x63')](_0x58b3d0[_0x85bb('0x40')][_0x85bb('0x64')]);}})['then'](respondWithStatusCode(_0x26e08e,null))['catch'](handleError(_0x26e08e,null));};exports[_0x85bb('0x65')]=function(_0x2b324f,_0x183cce,_0x4c3eef){if(_0x2b324f[_0x85bb('0x57')]['id']){delete _0x2b324f[_0x85bb('0x57')]['id'];}return db[_0x85bb('0x3b')][_0x85bb('0x5b')]({'where':{'id':_0x2b324f['params']['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x183cce,null))[_0x85bb('0x1e')](function(_0x5483a8){if(_0x5483a8){_0x2b324f['body'][_0x85bb('0x5f')]=_0x5483a8['id'];return db[_0x85bb('0x66')][_0x85bb('0x56')](_0x2b324f[_0x85bb('0x57')]);}})[_0x85bb('0x1e')](respondWithResult(_0x183cce,null))[_0x85bb('0x27')](handleError(_0x183cce,null));};exports['getAnswers']=function(_0x2048e9,_0x2361b2,_0x1906a9){var _0x3daa94={'raw':![],'where':{}};var _0x5eb2ed={};var _0x322bbc={'count':0x0,'rows':[]};return db[_0x85bb('0x3b')]['findOne']({'where':{'id':_0x2048e9['params']['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x2361b2,null))[_0x85bb('0x1e')](function(_0x41fb00){if(_0x41fb00){_0x5eb2ed[_0x85bb('0x44')]=_[_0x85bb('0x41')](db[_0x85bb('0x66')][_0x85bb('0x3c')]);_0x5eb2ed[_0x85bb('0x40')]=_[_0x85bb('0x41')](_0x2048e9[_0x85bb('0x40')]);_0x5eb2ed['filters']=_[_0x85bb('0x42')](_0x5eb2ed[_0x85bb('0x44')],_0x5eb2ed['query']);_0x3daa94[_0x85bb('0x43')]=_[_0x85bb('0x42')](_0x5eb2ed[_0x85bb('0x44')],qs['fields'](_0x2048e9['query']['fields']));_0x3daa94[_0x85bb('0x43')]=_0x3daa94[_0x85bb('0x43')][_0x85bb('0x46')]?_0x3daa94['attributes']:_0x5eb2ed['model'];if(!_0x2048e9[_0x85bb('0x40')]['hasOwnProperty'](_0x85bb('0x47'))){_0x3daa94[_0x85bb('0x2d')]=qs[_0x85bb('0x2d')](_0x2048e9[_0x85bb('0x40')]['limit']);_0x3daa94[_0x85bb('0x2b')]=qs['offset'](_0x2048e9[_0x85bb('0x40')][_0x85bb('0x2b')]);}_0x3daa94[_0x85bb('0x62')]=qs[_0x85bb('0x48')](_0x2048e9[_0x85bb('0x40')][_0x85bb('0x48')]);_0x3daa94[_0x85bb('0x49')]=qs['filters'](_[_0x85bb('0x4a')](_0x2048e9['query'],_0x5eb2ed[_0x85bb('0x4b')]));_0x3daa94['where'][_0x85bb('0x5f')]=_0x41fb00['id'];if(_0x2048e9[_0x85bb('0x40')][_0x85bb('0x4c')]){_0x3daa94[_0x85bb('0x49')]=_[_0x85bb('0x54')](_0x3daa94[_0x85bb('0x49')],{'$or':_[_0x85bb('0x3a')](_0x3daa94[_0x85bb('0x43')],function(_0x37e6f5){var _0x151966={};_0x151966[_0x37e6f5]={'$like':'%'+_0x2048e9[_0x85bb('0x40')][_0x85bb('0x4c')]+'%'};return _0x151966;})});}_0x3daa94=_['merge']({},_0x3daa94,_0x2048e9[_0x85bb('0x55')]);return db[_0x85bb('0x66')][_0x85bb('0x2e')]({'where':_0x3daa94[_0x85bb('0x49')]})[_0x85bb('0x1e')](function(_0x5b45a3){_0x322bbc[_0x85bb('0x2e')]=_0x5b45a3;if(_0x2048e9[_0x85bb('0x40')]['includeAll']){_0x3daa94[_0x85bb('0x53')]=[{'all':!![]}];}return db[_0x85bb('0x66')][_0x85bb('0x4f')](_0x3daa94);})[_0x85bb('0x1e')](function(_0x357cda){_0x322bbc[_0x85bb('0x50')]=_0x357cda;return _0x322bbc;});}})[_0x85bb('0x1e')](respondWithFilteredResult(_0x2361b2,_0x3daa94))[_0x85bb('0x27')](handleError(_0x2361b2,null));};exports[_0x85bb('0x67')]=function(_0x526699,_0x1e6725,_0x1880ee){return db['OpenchannelAccount'][_0x85bb('0x5b')]({'where':{'id':_0x526699[_0x85bb('0x52')]['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x1e6725,null))['then'](function(_0x128efa){if(_0x128efa){return _0x128efa[_0x85bb('0x67')](_0x526699[_0x85bb('0x40')][_0x85bb('0x64')]);}})[_0x85bb('0x1e')](respondWithStatusCode(_0x1e6725,null))[_0x85bb('0x27')](handleError(_0x1e6725,null));};exports[_0x85bb('0x68')]=function(_0xfe96d5,_0x1a1c80,_0x1f5c0b){var _0x19ab38={'body':_0xfe96d5[_0x85bb('0x57')],'channel':'openchannel'};var _0x4339ee=[];var _0x44ce4b=[];var _0x37cfa4={};var _0x4ee054=![];return db['CmContact'][_0x85bb('0x69')]()['then'](function(_0xd83a9){if(!_0xd83a9){throw new db[(_0x85bb('0x6a'))][(_0x85bb('0x6b'))]('no\x20available\x20attributes');}_0x4339ee=_[_0x85bb('0x6c')](_[_0x85bb('0x41')](_0xd83a9),['createdAt',_0x85bb('0x6d')]);_0x44ce4b=_[_0x85bb('0x6c')](_[_0x85bb('0x41')](_0xd83a9),['createdAt',_0x85bb('0x6d'),'CompanyId',_0x85bb('0x6e')]);if(_0xfe96d5[_0x85bb('0x57')]['id']){delete _0xfe96d5['body']['id'];}if(_[_0x85bb('0x6f')](_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x70')])){throw new db['Sequelize']['ValidationError'](_0x85bb('0x71'));}if(_[_0x85bb('0x6f')](_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x57')])||_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x57')]===''){throw new db[(_0x85bb('0x6a'))][(_0x85bb('0x6b'))](_0x85bb('0x72'));}if(_[_0x85bb('0x6f')](_0xfe96d5[_0x85bb('0x57')]['mapKey'])){throw new db[(_0x85bb('0x6a'))][(_0x85bb('0x6b'))](_0x85bb('0x73')+_0x44ce4b);}if(!_['includes'](_0x44ce4b,_0xfe96d5['body'][_0x85bb('0x74')])){throw new db[(_0x85bb('0x6a'))]['ValidationError'](_0x85bb('0x75')+_0x44ce4b);}_0x37cfa4[_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x74')]]=_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x70')];})['then'](function(){return db[_0x85bb('0x3b')][_0x85bb('0x5b')]({'where':{'id':_0xfe96d5[_0x85bb('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x85bb('0x76'),'include':[{'model':db[_0x85bb('0x77')],'as':_0x85bb('0x78'),'where':_0x37cfa4,'limit':0x1,'order':[[_0x85bb('0x6d'),_0x85bb('0x79')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1a1c80,null))[_0x85bb('0x1e')](function(_0x517d55){if(_0x517d55&&_0x517d55[_0x85bb('0x76')]){_0x19ab38[_0x85bb('0x7a')]=_0x517d55;_0x19ab38[_0x85bb('0x7b')]=_0x517d55['Applications'];_0x19ab38[_0x85bb('0x7c')]=_0x517d55['List'];_0x19ab38['applications']=_['orderBy'](_0x19ab38[_0x85bb('0x7b')],[_0x85bb('0x7d')],[_0x85bb('0x7e')]);if(_0x19ab38[_0x85bb('0x7a')][_0x85bb('0x7f')]){delete _0x19ab38[_0x85bb('0x7a')][_0x85bb('0x7f')];}if(_0x19ab38[_0x85bb('0x7a')][_0x85bb('0x76')]&&_0x19ab38[_0x85bb('0x7a')][_0x85bb('0x76')]['Contacts'][_0x85bb('0x46')]){return _0x19ab38[_0x85bb('0x7a')][_0x85bb('0x76')][_0x85bb('0x78')][0x0];}var _0x3700b4=_[_0x85bb('0x16')](_0xfe96d5[_0x85bb('0x57')],{'firstName':_0xfe96d5[_0x85bb('0x57')]['from'],'ListId':_0x517d55['ListId']});_0x3700b4[_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x74')]]=_0xfe96d5[_0x85bb('0x57')]['from'];return db['CmContact'][_0x85bb('0x56')](_0x3700b4,{'fields':_0x4339ee,'raw':!![]});}})[_0x85bb('0x1e')](handleEntityNotFound(_0x1a1c80,null))[_0x85bb('0x1e')](function(_0x51236f){_0x19ab38[_0x85bb('0x80')]=_0x51236f;if(_0x51236f){var _0x17068b={'ContactId':_0x51236f['id'],'OpenchannelAccountId':_0xfe96d5[_0x85bb('0x52')]['id'],'from':(_0x51236f[_0x85bb('0x81')]||'')+'\x20'+(_0x51236f[_0x85bb('0x82')]||'')};var _0x100725={'OpenchannelAccountId':_0xfe96d5[_0x85bb('0x52')]['id'],'closed':![]};if(_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x83')]){_0x100725['threadId']=_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x83')];return db[_0x85bb('0x84')]['find']({'where':_0x100725})[_0x85bb('0x1e')](function(_0x45172c){if(_0x45172c){return[_0x45172c,![]];}_0x17068b[_0x85bb('0x83')]=_0xfe96d5['body'][_0x85bb('0x83')];_0x17068b[_0x85bb('0x85')]=_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x85')];return db[_0x85bb('0x84')][_0x85bb('0x56')](_0x17068b)['then'](function(_0x3d77c4){return[_0x3d77c4,!![]];});});}else{_0x100725['threadId']=null;}_0x100725['ContactId']=_0x51236f['id'];return db[_0x85bb('0x84')][_0x85bb('0x5b')]({'where':_0x100725})[_0x85bb('0x1e')](function(_0x512d40){if(_0x512d40){return[_0x512d40,![]];}return db['OpenchannelInteraction'][_0x85bb('0x56')](_0x17068b)[_0x85bb('0x1e')](function(_0x1b3d52){return[_0x1b3d52,!![]];});});}})[_0x85bb('0x86')](function(_0x39372a,_0x31f927){if(_0x39372a){_0x4ee054=_0x31f927;if(!_0x31f927){var _0x4dcaef={'from':(_0x19ab38[_0x85bb('0x80')]['firstName']||'')+'\x20'+(_0x19ab38[_0x85bb('0x80')][_0x85bb('0x82')]||'')};if(_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x83')]&&_0xfe96d5['body'][_0x85bb('0x87')]&&_0xfe96d5[_0x85bb('0x57')]['threadId']!=_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x87')]){_0x4dcaef[_0x85bb('0x83')]=_0xfe96d5[_0x85bb('0x57')]['messageId'];}return _0x39372a[_0x85bb('0x88')](_0x4dcaef);}else{return _0x39372a;}}})[_0x85bb('0x1e')](function(_0x11ed0e){_0x19ab38[_0x85bb('0x89')]=_0x11ed0e['get']({'plain':!![]});_0x19ab38[_0x85bb('0x89')]['created']=_0x4ee054;if(_0x19ab38[_0x85bb('0x89')]['created']){if(_0x19ab38[_0x85bb('0x7a')][_0x85bb('0x8a')]){_0x19ab38[_0x85bb('0x7b')]['push']({'id':0x0,'priority':_0x19ab38[_0x85bb('0x7b')]['length']+0x1,'app':_0x85bb('0x8b'),'appdata':_0x85bb('0x8c'),'interval':_0x85bb('0x8d')});}}return db[_0x85bb('0x8e')][_0x85bb('0x56')]({'body':_0xfe96d5[_0x85bb('0x57')][_0x85bb('0x57')],'OpenchannelAccountId':_0xfe96d5[_0x85bb('0x52')]['id'],'OpenchannelInteractionId':_0x11ed0e['id'],'direction':'in','ContactId':_0x19ab38[_0x85bb('0x80')]['id'],'AttachmentId':_0xfe96d5['body'][_0x85bb('0x8f')]});})[_0x85bb('0x1e')](function(_0x1ef352){_0x19ab38[_0x85bb('0x24')]=_0x1ef352;if(_0x19ab38[_0x85bb('0x89')]['UserId']){return db[_0x85bb('0x90')]['find']({'attributes':['id',_0x85bb('0x3f')],'where':{'id':_0x19ab38[_0x85bb('0x89')][_0x85bb('0x91')]}})[_0x85bb('0x1e')](function(_0x4a89cb){if(_0x4a89cb){_0x19ab38[_0x85bb('0x7b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x85bb('0x92'),'appdata':_0x4a89cb['name']+','+(_0x19ab38[_0x85bb('0x7a')][_0x85bb('0x93')]||0xa),'interval':'*,*,*,*'});_0x19ab38[_0x85bb('0x94')]=![];}return respondWithRpcPromise(_0x85bb('0x95'),_0x85bb('0x96'),_0x19ab38);});}return respondWithRpcPromise(_0x85bb('0x95'),_0x85bb('0x96'),_0x19ab38);})[_0x85bb('0x1e')](function(_0x4240ce){respondWithRpcPromise('EventManager',_0x85bb('0x97'),{'event':'notify','message':_0x4240ce},client9002);return _0x4240ce;})[_0x85bb('0x1e')](respondWithResult(_0x1a1c80,null))[_0x85bb('0x27')](handleError(_0x1a1c80,null));};exports[_0x85bb('0x98')]=function(_0x21f6e5,_0x55ee45,_0x5ab8f1){return db[_0x85bb('0x3b')][_0x85bb('0x99')]({'where':{'id':_0x21f6e5[_0x85bb('0x52')]['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x55ee45,null))[_0x85bb('0x1e')](function(_0x3187e9){if(_0x3187e9){return db['sequelize'][_0x85bb('0x9a')](function(_0x383185){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x21f6e5[_0x85bb('0x52')]['id']},'transaction':_0x383185})[_0x85bb('0x1e')](function(_0x3ff307){var _0x1a1d1d=_['map'](_0x21f6e5['body'],function(_0x4f18ed){_0x4f18ed[_0x85bb('0x5f')]=_0x21f6e5['params']['id'];return _0x4f18ed;});return db['OpenchannelApplication'][_0x85bb('0x9b')](_0x1a1d1d,{'transaction':_0x383185});});})[_0x85bb('0x1e')](function(){return db[_0x85bb('0x9c')][_0x85bb('0x9d')]({'where':{'OpenchannelAccountId':_0x21f6e5[_0x85bb('0x52')]['id']},'order':'priority'});});}})[_0x85bb('0x1e')](respondWithResult(_0x55ee45,null))[_0x85bb('0x27')](handleError(_0x55ee45,null));};exports[_0x85bb('0x9e')]=function(_0x252f74,_0x5dc884,_0x512524){var _0x51671b={};var _0x437f8a={};var _0x5a3940;var _0x1406d5;return db[_0x85bb('0x3b')][_0x85bb('0x99')]({'where':{'id':_0x252f74[_0x85bb('0x52')]['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x5dc884,null))[_0x85bb('0x1e')](function(_0x5a5bdf){if(_0x5a5bdf){_0x5a3940=_0x5a5bdf;_0x437f8a[_0x85bb('0x44')]=_[_0x85bb('0x41')](db[_0x85bb('0x9c')][_0x85bb('0x3c')]);_0x437f8a[_0x85bb('0x40')]=_[_0x85bb('0x41')](_0x252f74[_0x85bb('0x40')]);_0x437f8a[_0x85bb('0x4b')]=_[_0x85bb('0x42')](_0x437f8a[_0x85bb('0x44')],_0x437f8a[_0x85bb('0x40')]);_0x51671b[_0x85bb('0x43')]=_[_0x85bb('0x42')](_0x437f8a[_0x85bb('0x44')],qs[_0x85bb('0x45')](_0x252f74[_0x85bb('0x40')]['fields']));_0x51671b[_0x85bb('0x43')]=_0x51671b['attributes'][_0x85bb('0x46')]?_0x51671b[_0x85bb('0x43')]:_0x437f8a[_0x85bb('0x44')];_0x51671b[_0x85bb('0x62')]=qs[_0x85bb('0x48')](_0x252f74[_0x85bb('0x40')]['sort']);_0x51671b['where']=qs[_0x85bb('0x4b')](_['pick'](_0x252f74[_0x85bb('0x40')],_0x437f8a[_0x85bb('0x4b')]));if(_0x252f74[_0x85bb('0x40')][_0x85bb('0x4c')]){_0x51671b['where']=_[_0x85bb('0x54')](_0x51671b['where'],{'$or':_[_0x85bb('0x3a')](_0x51671b[_0x85bb('0x43')],function(_0x3900b6){var _0x20c602={};_0x20c602[_0x3900b6]={'$like':'%'+_0x252f74[_0x85bb('0x40')][_0x85bb('0x4c')]+'%'};return _0x20c602;})});}_0x51671b=_[_0x85bb('0x54')]({},_0x51671b,_0x252f74[_0x85bb('0x55')]);return _0x5a3940[_0x85bb('0x9e')](_0x51671b);}})[_0x85bb('0x1e')](function(_0x44d6d0){if(_0x44d6d0){_0x1406d5=_0x44d6d0[_0x85bb('0x46')];if(!_0x252f74[_0x85bb('0x40')]['hasOwnProperty']('nolimit')){_0x51671b[_0x85bb('0x2d')]=qs[_0x85bb('0x2d')](_0x252f74[_0x85bb('0x40')][_0x85bb('0x2d')]);_0x51671b[_0x85bb('0x2b')]=qs['offset'](_0x252f74[_0x85bb('0x40')][_0x85bb('0x2b')]);}return _0x5a3940[_0x85bb('0x9e')](_0x51671b);}})[_0x85bb('0x1e')](function(_0x5dbb63){if(_0x5dbb63){return _0x5dbb63?{'count':_0x1406d5,'rows':_0x5dbb63}:null;}})[_0x85bb('0x1e')](respondWithResult(_0x5dc884,null))[_0x85bb('0x27')](handleError(_0x5dc884,null));};exports[_0x85bb('0x9f')]=function(_0x2042d5,_0x4003f0,_0x69b160){var _0x20c57d={'raw':![],'where':{}};var _0x204ce2={};var _0x4346bb={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x85bb('0x99')]({'where':{'id':_0x2042d5['params']['id']}})['then'](handleEntityNotFound(_0x4003f0,null))[_0x85bb('0x1e')](function(_0x327464){if(_0x327464){_0x204ce2[_0x85bb('0x44')]=_[_0x85bb('0x41')](db[_0x85bb('0x84')][_0x85bb('0x3c')]);_0x204ce2['query']=_[_0x85bb('0x41')](_0x2042d5['query']);_0x204ce2[_0x85bb('0x4b')]=_['intersection'](_0x204ce2[_0x85bb('0x44')],_0x204ce2[_0x85bb('0x40')]);_0x20c57d[_0x85bb('0x43')]=_[_0x85bb('0x42')](_0x204ce2[_0x85bb('0x44')],qs[_0x85bb('0x45')](_0x2042d5['query']['fields']));_0x20c57d['attributes']=_0x20c57d[_0x85bb('0x43')][_0x85bb('0x46')]?_0x20c57d[_0x85bb('0x43')]:_0x204ce2[_0x85bb('0x44')];if(!_0x2042d5['query'][_0x85bb('0xa0')](_0x85bb('0x47'))){_0x20c57d[_0x85bb('0x2d')]=qs[_0x85bb('0x2d')](_0x2042d5['query'][_0x85bb('0x2d')]);_0x20c57d[_0x85bb('0x2b')]=qs[_0x85bb('0x2b')](_0x2042d5[_0x85bb('0x40')][_0x85bb('0x2b')]);}_0x20c57d['order']=qs[_0x85bb('0x48')](_0x2042d5[_0x85bb('0x40')][_0x85bb('0x48')]);_0x20c57d[_0x85bb('0x49')]=qs['filters'](_[_0x85bb('0x4a')](_0x2042d5[_0x85bb('0x40')],_0x204ce2[_0x85bb('0x4b')]));_0x20c57d['where'][_0x85bb('0x5f')]=_0x327464['id'];if(_0x2042d5[_0x85bb('0x40')][_0x85bb('0x4c')]){_0x20c57d[_0x85bb('0x49')]=_[_0x85bb('0x54')](_0x20c57d[_0x85bb('0x49')],{'$or':_['map'](_0x20c57d[_0x85bb('0x43')],function(_0xc92eba){var _0x56eb09={};_0x56eb09[_0xc92eba]={'$like':'%'+_0x2042d5[_0x85bb('0x40')][_0x85bb('0x4c')]+'%'};return _0x56eb09;})});}_0x20c57d=_['merge']({},_0x20c57d,_0x2042d5[_0x85bb('0x55')]);return db[_0x85bb('0x84')][_0x85bb('0x2e')]({'where':_0x20c57d[_0x85bb('0x49')]})['then'](function(_0x15bd3a){_0x4346bb['count']=_0x15bd3a;if(_0x2042d5['query'][_0x85bb('0x4e')]){_0x20c57d['include']=[{'model':db[_0x85bb('0x77')],'as':_0x85bb('0xa1'),'required':![]},{'model':db[_0x85bb('0x90')],'as':'Owner','attributes':[_0x85bb('0x3f'),_0x85bb('0xa2'),_0x85bb('0xa3')],'required':![]},{'model':db[_0x85bb('0xa4')],'as':_0x85bb('0xa5'),'attributes':['id',_0x85bb('0x3f'),_0x85bb('0xa6')],'where':_0x2042d5[_0x85bb('0x40')][_0x85bb('0xa7')]?{'id':_0x2042d5[_0x85bb('0x40')][_0x85bb('0xa7')]}:undefined,'required':_0x2042d5[_0x85bb('0x40')][_0x85bb('0xa7')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x85bb('0x4f')](_0x20c57d);})['then'](function(_0x28b957){_0x4346bb[_0x85bb('0x50')]=_0x28b957;return _0x4346bb;});}})['then'](respondWithFilteredResult(_0x4003f0,_0x20c57d))[_0x85bb('0x27')](handleError(_0x4003f0,null));};exports[_0x85bb('0xa8')]=function(_0x5414a4,_0x249e02,_0x32fd22){return db[_0x85bb('0x3b')][_0x85bb('0x5b')]({'where':{'id':_0x5414a4[_0x85bb('0x52')]['id']}})['then'](handleEntityNotFound(_0x249e02,null))[_0x85bb('0x1e')](function(_0x21742b){if(_0x21742b){return _0x21742b[_0x85bb('0xa8')](_0x5414a4[_0x85bb('0x57')][_0x85bb('0x64')],_[_0x85bb('0xa9')](_0x5414a4[_0x85bb('0x57')],[_0x85bb('0x64'),'id'])||{})[_0x85bb('0x86')](function(_0x4555d4){for(var _0x13896f=0x0;_0x13896f<_0x5414a4['body'][_0x85bb('0x64')][_0x85bb('0x46')];_0x13896f+=0x1){socket['emit'](_0x85bb('0xaa'),{'UserId':Number(_0x5414a4[_0x85bb('0x57')]['ids'][_0x13896f]),'OpenchannelAccountId':Number(_0x5414a4[_0x85bb('0x52')]['id'])});}return _0x4555d4;});}})[_0x85bb('0x1e')](respondWithResult(_0x249e02,null))['catch'](handleError(_0x249e02,null));};exports['removeAgents']=function(_0x5717f0,_0x3b1d75,_0x561be7){return db[_0x85bb('0x3b')][_0x85bb('0x5b')]({'where':{'id':_0x5717f0[_0x85bb('0x52')]['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x3b1d75,null))['then'](function(_0x516cfd){if(_0x516cfd){return _0x516cfd[_0x85bb('0xab')](_0x5717f0[_0x85bb('0x40')]['ids'])['then'](function(){if(_[_0x85bb('0xac')](_0x5717f0[_0x85bb('0x40')]['ids'])){for(var _0x47fb12=0x0;_0x47fb12<_0x5717f0[_0x85bb('0x40')]['ids']['length'];_0x47fb12+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x5717f0['query'][_0x85bb('0x64')][_0x47fb12]),'OpenchannelAccountId':Number(_0x5717f0[_0x85bb('0x52')]['id'])});}}else{socket[_0x85bb('0xad')](_0x85bb('0xae'),{'UserId':Number(_0x5717f0[_0x85bb('0x40')][_0x85bb('0x64')]),'OpenchannelAccountId':Number(_0x5717f0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3b1d75,null))['catch'](handleError(_0x3b1d75,null));};exports[_0x85bb('0xaf')]=function(_0x2848ff,_0x57d7fc,_0x5bd6b9){var _0x3600ef={};var _0x152e2b={};var _0x1d5691;var _0x19cb72;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2848ff[_0x85bb('0x52')]['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x57d7fc,null))[_0x85bb('0x1e')](function(_0x243f00){if(_0x243f00){_0x1d5691=_0x243f00;_0x152e2b['model']=_[_0x85bb('0x41')](db['User'][_0x85bb('0x3c')]);_0x152e2b[_0x85bb('0x40')]=_['keys'](_0x2848ff[_0x85bb('0x40')]);_0x152e2b[_0x85bb('0x4b')]=_[_0x85bb('0x42')](_0x152e2b['model'],_0x152e2b[_0x85bb('0x40')]);_0x3600ef['attributes']=_['intersection'](_0x152e2b[_0x85bb('0x44')],qs[_0x85bb('0x45')](_0x2848ff[_0x85bb('0x40')][_0x85bb('0x45')]));_0x3600ef[_0x85bb('0x43')]=_0x3600ef[_0x85bb('0x43')][_0x85bb('0x46')]?_0x3600ef[_0x85bb('0x43')]:_0x152e2b[_0x85bb('0x44')];_0x3600ef[_0x85bb('0x62')]=qs[_0x85bb('0x48')](_0x2848ff[_0x85bb('0x40')][_0x85bb('0x48')]);_0x3600ef[_0x85bb('0x49')]=qs['filters'](_[_0x85bb('0x4a')](_0x2848ff['query'],_0x152e2b['filters']));if(_0x2848ff[_0x85bb('0x40')][_0x85bb('0x4c')]){_0x3600ef[_0x85bb('0x49')]=_[_0x85bb('0x54')](_0x3600ef[_0x85bb('0x49')],{'$or':_[_0x85bb('0x3a')](_0x3600ef['attributes'],function(_0x4862eb){var _0xb83217={};_0xb83217[_0x4862eb]={'$like':'%'+_0x2848ff[_0x85bb('0x40')][_0x85bb('0x4c')]+'%'};return _0xb83217;})});}_0x3600ef=_['merge']({},_0x3600ef,_0x2848ff['options']);return _0x1d5691['getAgents'](_0x3600ef);}})[_0x85bb('0x1e')](function(_0x49f677){if(_0x49f677){_0x19cb72=_0x49f677[_0x85bb('0x46')];if(!_0x2848ff[_0x85bb('0x40')][_0x85bb('0xa0')](_0x85bb('0x47'))){_0x3600ef[_0x85bb('0x2d')]=qs[_0x85bb('0x2d')](_0x2848ff['query']['limit']);_0x3600ef['offset']=qs[_0x85bb('0x2b')](_0x2848ff[_0x85bb('0x40')][_0x85bb('0x2b')]);}return _0x1d5691[_0x85bb('0xaf')](_0x3600ef);}})[_0x85bb('0x1e')](function(_0x370cf7){if(_0x370cf7){return _0x370cf7?{'count':_0x19cb72,'rows':_0x370cf7}:null;}})[_0x85bb('0x1e')](respondWithResult(_0x57d7fc,null))[_0x85bb('0x27')](handleError(_0x57d7fc,null));};exports[_0x85bb('0x36')]=function(_0x327596,_0x2d4440,_0x1445b3){var _0x51df06,_0x4361d2,_0x20b407;if(_[_0x85bb('0x6f')](_0x327596['body'][_0x85bb('0x57')])||_0x327596[_0x85bb('0x57')]['body']===''){throw new db[(_0x85bb('0x6a'))]['ValidationError'](_0x85bb('0x72'));}if(_[_0x85bb('0x6f')](_0x327596[_0x85bb('0x57')]['to'])){}_0x51df06=_0x327596['body']['to'];return db[_0x85bb('0x3b')][_0x85bb('0x99')]({'where':{'id':_0x327596[_0x85bb('0x52')]['id']}})[_0x85bb('0x1e')](handleEntityNotFound(_0x2d4440,null))['then'](function(_0x454dac){if(_0x454dac){return db[_0x85bb('0x3b')]['find']({'where':{'id':_0x454dac['id']},'include':[{'model':db[_0x85bb('0xb0')],'as':_0x85bb('0x76'),'include':[{'model':db[_0x85bb('0x77')],'as':'Contacts','where':{[_0x454dac[_0x85bb('0x74')]]:_0x51df06},'limit':0x1,'order':[[_0x85bb('0x6d'),_0x85bb('0x79')]]}]}]})['then'](handleEntityNotFound(_0x2d4440,null))['then'](function(_0x2597ce){if(_0x2597ce&&_0x2597ce[_0x85bb('0x76')]){_0x4361d2=_0x2597ce[_0x85bb('0x5a')]({'plain':!![]});if(_0x4361d2[_0x85bb('0x76')]&&_0x4361d2['List'][_0x85bb('0x78')][_0x85bb('0x46')]){return _0x4361d2['List']['Contacts'][0x0];}return db['CmContact'][_0x85bb('0x56')](_[_0x85bb('0x16')](_0x327596[_0x85bb('0x57')],{'firstName':_0x51df06,[_0x2597ce[_0x85bb('0x74')]]:_0x51df06,'phone':_0x51df06,'ListId':_0x4361d2[_0x85bb('0x6e')]}));}})['then'](handleEntityNotFound(_0x2d4440,null))[_0x85bb('0x1e')](function(_0x5a7646){if(_0x5a7646){_0x20b407=_0x5a7646;return db[_0x85bb('0x84')][_0x85bb('0x5b')]({'where':{'ContactId':_0x20b407['id'],'closed':![],'OpenchannelAccountId':_0x4361d2['id']}})[_0x85bb('0x1e')](function(_0x19096d){if(_0x19096d){return[_0x19096d,![]];}return db[_0x85bb('0x84')][_0x85bb('0x56')]({'UserId':_0x327596[_0x85bb('0x59')]['id'],'ContactId':_0x20b407['id'],'OpenchannelAccountId':_0x4361d2['id'],'lastMsgDirection':'out','Messages':[_[_0x85bb('0x54')](_0x327596[_0x85bb('0x57')],{'read':![],'body':_0x327596[_0x85bb('0x57')][_0x85bb('0x57')],'OpenchannelAccountId':_0x4361d2['id'],'UserId':_0x327596[_0x85bb('0x59')]['id'],'ContactId':_0x20b407['id']})]},{'include':[{'model':db[_0x85bb('0x8e')],'as':_0x85bb('0xb1')}]})[_0x85bb('0x1e')](function(_0x45c72b){return[_0x45c72b,!![]];});});}})['spread'](function(_0xce5cac,_0xf9bfdf){if(_0xf9bfdf){return _0xce5cac;}return db[_0x85bb('0x8e')][_0x85bb('0x56')](_[_0x85bb('0x54')](_0x327596[_0x85bb('0x57')],{'read':![],'body':_0x327596[_0x85bb('0x57')][_0x85bb('0x57')],'OpenchannelAccountId':_0x4361d2['id'],'OpenchannelInteractionId':_0xce5cac['id'],'UserId':_0x327596[_0x85bb('0x59')]['id'],'ContactId':_0x20b407['id']}))[_0x85bb('0x1e')](function(_0x44ecf2){_0xce5cac['dataValues'][_0x85bb('0xb1')]=[];_0xce5cac[_0x85bb('0xb2')][_0x85bb('0xb1')][_0x85bb('0xb3')](_0x44ecf2[_0x85bb('0xb2')]);return _0xce5cac;});});}})[_0x85bb('0x1e')](respondWithResult(_0x2d4440,null))[_0x85bb('0x27')](handleError(_0x2d4440,null));}; \ No newline at end of file +var _0xc9bc=['EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','color','tag','addAgents','omit','removeAgents','emit','userOpenchannelAccount:remove','getAgents','out','Messages','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../mysqldb','localhost','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','VIRTUAL','merge','includeAll','include','rows','show','params','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','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','nolimit','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','notify','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','interaction','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start'];(function(_0x27d6c5,_0x4c0e92){var _0x51fba6=function(_0xc58e1a){while(--_0xc58e1a){_0x27d6c5['push'](_0x27d6c5['shift']());}};_0x51fba6(++_0x4c0e92);}(_0xc9bc,0xd2));var _0xcc9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcc9b('0x0'));var rimraf=require(_0xcc9b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc9b('0x2'));var rp=require(_0xcc9b('0x3'));var moment=require('moment');var BPromise=require(_0xcc9b('0x4'));var Mustache=require(_0xcc9b('0x5'));var util=require('util');var path=require(_0xcc9b('0x6'));var sox=require(_0xcc9b('0x7'));var csv=require(_0xcc9b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc9b('0x9'));var _=require(_0xcc9b('0xa'));var squel=require(_0xcc9b('0xb'));var crypto=require(_0xcc9b('0xc'));var jsforce=require(_0xcc9b('0xd'));var deskjs=require(_0xcc9b('0xe'));var toCsv=require(_0xcc9b('0x8'));var querystring=require('querystring');var Papa=require(_0xcc9b('0xf'));var Redis=require(_0xcc9b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcc9b('0x11'));var as=require(_0xcc9b('0x12'));var hardwareService=require(_0xcc9b('0x13'));var logger=require(_0xcc9b('0x14'))(_0xcc9b('0x15'));var utils=require(_0xcc9b('0x16'));var config=require(_0xcc9b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc9b('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xcc9b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcc9b('0x1a'))['register'](socket);var jayson=require(_0xcc9b('0x1b'));var client=jayson[_0xcc9b('0x1c')][_0xcc9b('0x1d')]({'port':0x232c});var client9002=jayson[_0xcc9b('0x1c')][_0xcc9b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xa1f40b,_0x3d7d90,_0x8e1ab8,_0x1858f9){return new BPromise(function(_0xa2824c,_0x1303ed){var _0x3b6625=_0x1858f9||client;return _0x3b6625[_0xcc9b('0x1e')](_0xa1f40b,_0x8e1ab8)[_0xcc9b('0x1f')](function(_0x1aecab){logger[_0xcc9b('0x20')](_0xcc9b('0x21'),_0x3d7d90,_0xcc9b('0x22'));logger[_0xcc9b('0x23')](_0xcc9b('0x24'),_0x3d7d90,_0xcc9b('0x22'),JSON[_0xcc9b('0x25')](_0x1aecab));if(_0x1aecab[_0xcc9b('0x26')]){if(_0x1aecab[_0xcc9b('0x26')]['code']===0x1f4){logger[_0xcc9b('0x26')](_0xcc9b('0x21'),_0x3d7d90,_0x1aecab[_0xcc9b('0x26')][_0xcc9b('0x27')]);return _0x1303ed(_0x1aecab[_0xcc9b('0x26')][_0xcc9b('0x27')]);}logger[_0xcc9b('0x26')](_0xcc9b('0x21'),_0x3d7d90,_0x1aecab[_0xcc9b('0x26')]['message']);return _0xa2824c(_0x1aecab['error'][_0xcc9b('0x27')]);}else{logger[_0xcc9b('0x20')](_0xcc9b('0x21'),_0x3d7d90,'request\x20sent');_0xa2824c(_0x1aecab['result'][_0xcc9b('0x27')]);}})[_0xcc9b('0x28')](function(_0x141849){logger[_0xcc9b('0x26')](_0xcc9b('0x21'),_0x3d7d90,_0x141849);_0x1303ed(_0x141849);});});}function respondWithStatusCode(_0x1f450b,_0xffec1a){_0xffec1a=_0xffec1a||0xcc;return function(_0x39ec20){if(_0x39ec20){return _0x1f450b[_0xcc9b('0x29')](_0xffec1a);}return _0x1f450b[_0xcc9b('0x2a')](_0xffec1a)[_0xcc9b('0x2b')]();};}function respondWithResult(_0x39349e,_0x3c3fea){_0x3c3fea=_0x3c3fea||0xc8;return function(_0x3b3682){if(_0x3b3682){return _0x39349e['status'](_0x3c3fea)[_0xcc9b('0x2c')](_0x3b3682);}};}function respondWithFilteredResult(_0x1d5887,_0x2e3f2b){return function(_0x54115f){if(_0x54115f){var _0x54f625=typeof _0x2e3f2b[_0xcc9b('0x2d')]===_0xcc9b('0x2e')&&typeof _0x2e3f2b[_0xcc9b('0x2f')]===_0xcc9b('0x2e');var _0x1ad804=_0x54115f[_0xcc9b('0x30')];var _0x2423dc=_0x54f625?0x0:_0x2e3f2b['offset'];var _0x3c50c0=_0x54f625?_0x54115f[_0xcc9b('0x30')]:_0x2e3f2b[_0xcc9b('0x2d')]+_0x2e3f2b[_0xcc9b('0x2f')];var _0x345da4;if(_0x3c50c0>=_0x1ad804){_0x3c50c0=_0x1ad804;_0x345da4=0xc8;}else{_0x345da4=0xce;}_0x1d5887[_0xcc9b('0x2a')](_0x345da4);return _0x1d5887['set'](_0xcc9b('0x31'),_0x2423dc+'-'+_0x3c50c0+'/'+_0x1ad804)[_0xcc9b('0x2c')](_0x54115f);}return null;};}function patchUpdates(_0x3c4a6d){return function(_0xb7d50c){try{jsonpatch[_0xcc9b('0x32')](_0xb7d50c,_0x3c4a6d,!![]);}catch(_0x417f08){return BPromise[_0xcc9b('0x33')](_0x417f08);}return _0xb7d50c[_0xcc9b('0x34')]();};}function saveUpdates(_0x46a48d,_0x53045c){return function(_0x48c9c9){if(_0x48c9c9){return _0x48c9c9['update'](_0x46a48d)[_0xcc9b('0x1f')](function(_0x1157da){return _0x1157da;});}return null;};}function removeEntity(_0x47b153,_0x47c610){return function(_0x3c3565){if(_0x3c3565){return _0x3c3565[_0xcc9b('0x35')]()[_0xcc9b('0x1f')](function(){var _0x576f0a=_0x3c3565[_0xcc9b('0x36')]({'plain':!![]});var _0x34e323=_0xcc9b('0x37');return db[_0xcc9b('0x38')]['destroy']({'where':{'type':_0x34e323,'resourceId':_0x576f0a['id']}})[_0xcc9b('0x1f')](function(){return _0x3c3565;});})['then'](function(){_0x47b153[_0xcc9b('0x2a')](0xcc)[_0xcc9b('0x2b')]();});}};}function handleEntityNotFound(_0x5c1645,_0x4def9b){return function(_0x4650f9){if(!_0x4650f9){_0x5c1645[_0xcc9b('0x29')](0x194);}return _0x4650f9;};}function handleError(_0x4a92c5,_0x1f179d){_0x1f179d=_0x1f179d||0x1f4;return function(_0x573de7){logger[_0xcc9b('0x26')](_0x573de7['stack']);if(_0x573de7[_0xcc9b('0x39')]){delete _0x573de7[_0xcc9b('0x39')];}_0x4a92c5[_0xcc9b('0x2a')](_0x1f179d)[_0xcc9b('0x3a')](_0x573de7);};}exports['index']=function(_0x2bbd77,_0x2e55b2){var _0x1533ae={'include':[{'model':db[_0xcc9b('0x3b')],'as':_0xcc9b('0x3c')}]},_0x5012bf={},_0x17d678={'count':0x0,'rows':[]};var _0x35b2da=_['map'](db[_0xcc9b('0x3d')][_0xcc9b('0x3e')],function(_0x1b2ae8){return{'name':_0x1b2ae8[_0xcc9b('0x3f')],'type':_0x1b2ae8[_0xcc9b('0x40')][_0xcc9b('0x41')]};});_0x5012bf['model']=_['map'](_0x35b2da,_0xcc9b('0x39'));_0x5012bf['query']=_[_0xcc9b('0x42')](_0x2bbd77[_0xcc9b('0x43')]);_0x5012bf[_0xcc9b('0x44')]=_[_0xcc9b('0x45')](_0x5012bf[_0xcc9b('0x46')],_0x5012bf[_0xcc9b('0x43')]);_0x1533ae[_0xcc9b('0x47')]=_['intersection'](_0x5012bf[_0xcc9b('0x46')],qs[_0xcc9b('0x48')](_0x2bbd77[_0xcc9b('0x43')][_0xcc9b('0x48')]));_0x1533ae['attributes']=_0x1533ae[_0xcc9b('0x47')][_0xcc9b('0x49')]?_0x1533ae[_0xcc9b('0x47')]:_0x5012bf[_0xcc9b('0x46')];if(!_0x2bbd77[_0xcc9b('0x43')][_0xcc9b('0x4a')]('nolimit')){_0x1533ae[_0xcc9b('0x2f')]=qs[_0xcc9b('0x2f')](_0x2bbd77['query'][_0xcc9b('0x2f')]);_0x1533ae['offset']=qs[_0xcc9b('0x2d')](_0x2bbd77[_0xcc9b('0x43')][_0xcc9b('0x2d')]);}_0x1533ae[_0xcc9b('0x4b')]=qs[_0xcc9b('0x4c')](_0x2bbd77[_0xcc9b('0x43')]['sort']);_0x1533ae[_0xcc9b('0x4d')]=qs['filters'](_[_0xcc9b('0x4e')](_0x2bbd77[_0xcc9b('0x43')],_0x5012bf[_0xcc9b('0x44')]),_0x35b2da);if(_0x2bbd77['query'][_0xcc9b('0x4f')]){_0x1533ae[_0xcc9b('0x4d')]=_['merge'](_0x1533ae[_0xcc9b('0x4d')],{'$or':_[_0xcc9b('0x50')](_0x35b2da,function(_0x148d9b){if(_0x148d9b[_0xcc9b('0x40')]!==_0xcc9b('0x51')){var _0x2aa8a={};_0x2aa8a[_0x148d9b['name']]={'$like':'%'+_0x2bbd77['query']['filter']+'%'};return _0x2aa8a;}})});}_0x1533ae=_[_0xcc9b('0x52')]({},_0x1533ae,_0x2bbd77['options']);var _0x1c8d32={'where':_0x1533ae[_0xcc9b('0x4d')]};return db['OpenchannelAccount']['count'](_0x1c8d32)[_0xcc9b('0x1f')](function(_0x411d25){_0x17d678[_0xcc9b('0x30')]=_0x411d25;if(_0x2bbd77[_0xcc9b('0x43')][_0xcc9b('0x53')]){_0x1533ae[_0xcc9b('0x54')]=[{'all':!![]}];}return db[_0xcc9b('0x3d')]['findAll'](_0x1533ae);})[_0xcc9b('0x1f')](function(_0x2fb60f){_0x17d678[_0xcc9b('0x55')]=_0x2fb60f;return _0x17d678;})['then'](respondWithFilteredResult(_0x2e55b2,_0x1533ae))[_0xcc9b('0x28')](handleError(_0x2e55b2,null));};exports[_0xcc9b('0x56')]=function(_0x38fd44,_0x596b63){var _0x3afddd={'raw':![],'where':{'id':_0x38fd44[_0xcc9b('0x57')]['id']},'include':[{'model':db[_0xcc9b('0x3b')],'as':_0xcc9b('0x3c')}]},_0x5d6d55={};_0x5d6d55[_0xcc9b('0x46')]=_[_0xcc9b('0x42')](db['OpenchannelAccount'][_0xcc9b('0x3e')]);_0x5d6d55[_0xcc9b('0x43')]=_[_0xcc9b('0x42')](_0x38fd44[_0xcc9b('0x43')]);_0x5d6d55['filters']=_[_0xcc9b('0x45')](_0x5d6d55[_0xcc9b('0x46')],_0x5d6d55[_0xcc9b('0x43')]);_0x3afddd['attributes']=_[_0xcc9b('0x45')](_0x5d6d55[_0xcc9b('0x46')],qs[_0xcc9b('0x48')](_0x38fd44[_0xcc9b('0x43')][_0xcc9b('0x48')]));_0x3afddd[_0xcc9b('0x47')]=_0x3afddd[_0xcc9b('0x47')][_0xcc9b('0x49')]?_0x3afddd[_0xcc9b('0x47')]:_0x5d6d55['model'];if(_0x38fd44['query'][_0xcc9b('0x53')]){_0x3afddd[_0xcc9b('0x54')]=[{'all':!![]}];}_0x3afddd=_['merge']({},_0x3afddd,_0x38fd44['options']);return db[_0xcc9b('0x3d')]['find'](_0x3afddd)['then'](handleEntityNotFound(_0x596b63,null))[_0xcc9b('0x1f')](respondWithResult(_0x596b63,null))[_0xcc9b('0x28')](handleError(_0x596b63,null));};exports[_0xcc9b('0x58')]=function(_0x7bdcba,_0x43f2d8){return db[_0xcc9b('0x3d')][_0xcc9b('0x58')](_0x7bdcba[_0xcc9b('0x59')],{})[_0xcc9b('0x1f')](function(_0x34527b){var _0x3f34ca=_0x7bdcba[_0xcc9b('0x5a')][_0xcc9b('0x36')]({'plain':!![]});if(!_0x3f34ca)throw new Error(_0xcc9b('0x5b'));if(_0x3f34ca[_0xcc9b('0x5c')]===_0xcc9b('0x5a')){var _0x34f943=_0x34527b[_0xcc9b('0x36')]({'plain':!![]});var _0x2a2290=_0xcc9b('0x37');return db[_0xcc9b('0x5d')][_0xcc9b('0x5e')]({'where':{'name':_0x2a2290,'userProfileId':_0x3f34ca['userProfileId']},'raw':!![]})[_0xcc9b('0x1f')](function(_0x516f6e){if(_0x516f6e&&_0x516f6e[_0xcc9b('0x5f')]===0x0){return db[_0xcc9b('0x38')]['create']({'name':_0x34f943['name'],'resourceId':_0x34f943['id'],'type':_0x516f6e[_0xcc9b('0x39')],'sectionId':_0x516f6e['id']},{})['then'](function(){return _0x34527b;});}else{return _0x34527b;}})['catch'](function(_0xe245d){logger[_0xcc9b('0x26')](_0xcc9b('0x60'),_0xe245d);throw _0xe245d;});}return _0x34527b;})[_0xcc9b('0x1f')](respondWithResult(_0x43f2d8,0xc9))[_0xcc9b('0x28')](handleError(_0x43f2d8,null));};exports[_0xcc9b('0x61')]=function(_0x5e5468,_0x4d2de8){if(_0x5e5468[_0xcc9b('0x59')]['id']){delete _0x5e5468[_0xcc9b('0x59')]['id'];}return db[_0xcc9b('0x3d')][_0xcc9b('0x5e')]({'where':{'id':_0x5e5468[_0xcc9b('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xcc9b('0x3c')}]})['then'](handleEntityNotFound(_0x4d2de8,null))[_0xcc9b('0x1f')](saveUpdates(_0x5e5468[_0xcc9b('0x59')],null))['then'](respondWithResult(_0x4d2de8,null))[_0xcc9b('0x28')](handleError(_0x4d2de8,null));};exports[_0xcc9b('0x35')]=function(_0x1095d1,_0x2cc481){return db[_0xcc9b('0x3d')][_0xcc9b('0x5e')]({'where':{'id':_0x1095d1['params']['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x2cc481,null))['then'](removeEntity(_0x2cc481,null))[_0xcc9b('0x28')](handleError(_0x2cc481,null));};exports[_0xcc9b('0x62')]=function(_0x21c50c,_0x5b2868){return db['OpenchannelAccount'][_0xcc9b('0x62')]()[_0xcc9b('0x1f')](respondWithResult(_0x5b2868,null))[_0xcc9b('0x28')](handleError(_0x5b2868,null));};exports[_0xcc9b('0x63')]=function(_0x4d7cbb,_0x11f00a,_0x2b7123){if(_0x4d7cbb[_0xcc9b('0x59')]['id']){delete _0x4d7cbb[_0xcc9b('0x59')]['id'];}return db[_0xcc9b('0x3d')][_0xcc9b('0x5e')]({'where':{'id':_0x4d7cbb[_0xcc9b('0x57')]['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x11f00a,null))[_0xcc9b('0x1f')](function(_0x26e372){if(_0x26e372){_0x4d7cbb[_0xcc9b('0x59')][_0xcc9b('0x64')]=_0x26e372['id'];return db[_0xcc9b('0x65')]['create'](_0x4d7cbb[_0xcc9b('0x59')]);}})[_0xcc9b('0x1f')](respondWithResult(_0x11f00a,null))['catch'](handleError(_0x11f00a,null));};exports['getDispositions']=function(_0x5074a5,_0x5250e2,_0xb60356){var _0xab3a3b={'raw':![],'where':{}};var _0x5158d1={};var _0xbcfe96={'count':0x0,'rows':[]};return db[_0xcc9b('0x3d')][_0xcc9b('0x66')]({'where':{'id':_0x5074a5[_0xcc9b('0x57')]['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x5250e2,null))['then'](function(_0x55e356){if(_0x55e356){_0x5158d1['model']=_[_0xcc9b('0x42')](db['Disposition'][_0xcc9b('0x3e')]);_0x5158d1[_0xcc9b('0x43')]=_[_0xcc9b('0x42')](_0x5074a5['query']);_0x5158d1['filters']=_['intersection'](_0x5158d1[_0xcc9b('0x46')],_0x5158d1[_0xcc9b('0x43')]);_0xab3a3b[_0xcc9b('0x47')]=_[_0xcc9b('0x45')](_0x5158d1[_0xcc9b('0x46')],qs[_0xcc9b('0x48')](_0x5074a5[_0xcc9b('0x43')][_0xcc9b('0x48')]));_0xab3a3b['attributes']=_0xab3a3b['attributes'][_0xcc9b('0x49')]?_0xab3a3b[_0xcc9b('0x47')]:_0x5158d1[_0xcc9b('0x46')];if(!_0x5074a5[_0xcc9b('0x43')][_0xcc9b('0x4a')](_0xcc9b('0x67'))){_0xab3a3b[_0xcc9b('0x2f')]=qs[_0xcc9b('0x2f')](_0x5074a5[_0xcc9b('0x43')][_0xcc9b('0x2f')]);_0xab3a3b[_0xcc9b('0x2d')]=qs['offset'](_0x5074a5['query'][_0xcc9b('0x2d')]);}_0xab3a3b[_0xcc9b('0x4b')]=qs[_0xcc9b('0x4c')](_0x5074a5[_0xcc9b('0x43')][_0xcc9b('0x4c')]);_0xab3a3b[_0xcc9b('0x4d')]=qs[_0xcc9b('0x44')](_[_0xcc9b('0x4e')](_0x5074a5[_0xcc9b('0x43')],_0x5158d1[_0xcc9b('0x44')]));_0xab3a3b['where']['OpenchannelAccountId']=_0x55e356['id'];if(_0x5074a5[_0xcc9b('0x43')]['filter']){_0xab3a3b[_0xcc9b('0x4d')]=_[_0xcc9b('0x52')](_0xab3a3b[_0xcc9b('0x4d')],{'$or':_[_0xcc9b('0x50')](_0xab3a3b[_0xcc9b('0x47')],function(_0x3c47ba){var _0x5a72a9={};_0x5a72a9[_0x3c47ba]={'$like':'%'+_0x5074a5[_0xcc9b('0x43')][_0xcc9b('0x4f')]+'%'};return _0x5a72a9;})});}_0xab3a3b=_[_0xcc9b('0x52')]({},_0xab3a3b,_0x5074a5[_0xcc9b('0x68')]);return db[_0xcc9b('0x65')][_0xcc9b('0x30')]({'where':_0xab3a3b['where']})[_0xcc9b('0x1f')](function(_0x2b140d){_0xbcfe96[_0xcc9b('0x30')]=_0x2b140d;if(_0x5074a5[_0xcc9b('0x43')]['includeAll']){_0xab3a3b[_0xcc9b('0x54')]=[{'all':!![]}];}return db[_0xcc9b('0x65')]['findAll'](_0xab3a3b);})[_0xcc9b('0x1f')](function(_0x58b462){_0xbcfe96[_0xcc9b('0x55')]=_0x58b462;return _0xbcfe96;});}})[_0xcc9b('0x1f')](respondWithFilteredResult(_0x5250e2,_0xab3a3b))[_0xcc9b('0x28')](handleError(_0x5250e2,null));};exports['removeDispositions']=function(_0xd23fdf,_0x22e149,_0x4579df){return db['OpenchannelAccount']['find']({'where':{'id':_0xd23fdf['params']['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x22e149,null))['then'](function(_0x3aff7e){if(_0x3aff7e){return _0x3aff7e[_0xcc9b('0x69')](_0xd23fdf[_0xcc9b('0x43')][_0xcc9b('0x6a')]);}})[_0xcc9b('0x1f')](respondWithStatusCode(_0x22e149,null))['catch'](handleError(_0x22e149,null));};exports[_0xcc9b('0x6b')]=function(_0x2c2721,_0x238238,_0x742ff){if(_0x2c2721['body']['id']){delete _0x2c2721[_0xcc9b('0x59')]['id'];}return db[_0xcc9b('0x3d')][_0xcc9b('0x5e')]({'where':{'id':_0x2c2721[_0xcc9b('0x57')]['id']}})['then'](handleEntityNotFound(_0x238238,null))[_0xcc9b('0x1f')](function(_0x2d575f){if(_0x2d575f){_0x2c2721[_0xcc9b('0x59')][_0xcc9b('0x64')]=_0x2d575f['id'];return db[_0xcc9b('0x6c')]['create'](_0x2c2721['body']);}})[_0xcc9b('0x1f')](respondWithResult(_0x238238,null))['catch'](handleError(_0x238238,null));};exports[_0xcc9b('0x6d')]=function(_0x4ad2f1,_0x50c433,_0x4384c3){var _0x4e528a={'raw':![],'where':{}};var _0x1cb332={};var _0x5b1260={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xcc9b('0x66')]({'where':{'id':_0x4ad2f1['params']['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x50c433,null))[_0xcc9b('0x1f')](function(_0x5a341f){if(_0x5a341f){_0x1cb332[_0xcc9b('0x46')]=_[_0xcc9b('0x42')](db[_0xcc9b('0x6c')][_0xcc9b('0x3e')]);_0x1cb332[_0xcc9b('0x43')]=_[_0xcc9b('0x42')](_0x4ad2f1[_0xcc9b('0x43')]);_0x1cb332[_0xcc9b('0x44')]=_[_0xcc9b('0x45')](_0x1cb332['model'],_0x1cb332['query']);_0x4e528a[_0xcc9b('0x47')]=_[_0xcc9b('0x45')](_0x1cb332[_0xcc9b('0x46')],qs[_0xcc9b('0x48')](_0x4ad2f1['query']['fields']));_0x4e528a['attributes']=_0x4e528a[_0xcc9b('0x47')]['length']?_0x4e528a[_0xcc9b('0x47')]:_0x1cb332[_0xcc9b('0x46')];if(!_0x4ad2f1['query']['hasOwnProperty']('nolimit')){_0x4e528a[_0xcc9b('0x2f')]=qs[_0xcc9b('0x2f')](_0x4ad2f1[_0xcc9b('0x43')]['limit']);_0x4e528a[_0xcc9b('0x2d')]=qs['offset'](_0x4ad2f1[_0xcc9b('0x43')][_0xcc9b('0x2d')]);}_0x4e528a[_0xcc9b('0x4b')]=qs[_0xcc9b('0x4c')](_0x4ad2f1[_0xcc9b('0x43')]['sort']);_0x4e528a[_0xcc9b('0x4d')]=qs[_0xcc9b('0x44')](_[_0xcc9b('0x4e')](_0x4ad2f1['query'],_0x1cb332[_0xcc9b('0x44')]));_0x4e528a[_0xcc9b('0x4d')][_0xcc9b('0x64')]=_0x5a341f['id'];if(_0x4ad2f1[_0xcc9b('0x43')]['filter']){_0x4e528a['where']=_['merge'](_0x4e528a[_0xcc9b('0x4d')],{'$or':_['map'](_0x4e528a[_0xcc9b('0x47')],function(_0x2d8eee){var _0x3ec2e0={};_0x3ec2e0[_0x2d8eee]={'$like':'%'+_0x4ad2f1[_0xcc9b('0x43')][_0xcc9b('0x4f')]+'%'};return _0x3ec2e0;})});}_0x4e528a=_[_0xcc9b('0x52')]({},_0x4e528a,_0x4ad2f1[_0xcc9b('0x68')]);return db['CannedAnswer'][_0xcc9b('0x30')]({'where':_0x4e528a[_0xcc9b('0x4d')]})[_0xcc9b('0x1f')](function(_0x1ce928){_0x5b1260['count']=_0x1ce928;if(_0x4ad2f1[_0xcc9b('0x43')][_0xcc9b('0x53')]){_0x4e528a[_0xcc9b('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcc9b('0x6e')](_0x4e528a);})['then'](function(_0x1d55f9){_0x5b1260[_0xcc9b('0x55')]=_0x1d55f9;return _0x5b1260;});}})['then'](respondWithFilteredResult(_0x50c433,_0x4e528a))[_0xcc9b('0x28')](handleError(_0x50c433,null));};exports[_0xcc9b('0x6f')]=function(_0x400232,_0x527d4f,_0x271a92){return db[_0xcc9b('0x3d')][_0xcc9b('0x5e')]({'where':{'id':_0x400232[_0xcc9b('0x57')]['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x527d4f,null))['then'](function(_0x43c5cc){if(_0x43c5cc){return _0x43c5cc[_0xcc9b('0x6f')](_0x400232[_0xcc9b('0x43')][_0xcc9b('0x6a')]);}})[_0xcc9b('0x1f')](respondWithStatusCode(_0x527d4f,null))['catch'](handleError(_0x527d4f,null));};exports[_0xcc9b('0x70')]=function(_0x32617c,_0x1fa056,_0x47c88a){var _0x35897b={'body':_0x32617c[_0xcc9b('0x59')],'channel':'openchannel'};var _0x3b899f=[];var _0x565587=[];var _0x128beb={};var _0x604061=![];return db[_0xcc9b('0x71')][_0xcc9b('0x62')]()['then'](function(_0x1fdb01){if(!_0x1fdb01){throw new db['Sequelize']['ValidationError'](_0xcc9b('0x72'));}_0x3b899f=_[_0xcc9b('0x73')](_[_0xcc9b('0x42')](_0x1fdb01),['createdAt',_0xcc9b('0x74')]);_0x565587=_[_0xcc9b('0x73')](_[_0xcc9b('0x42')](_0x1fdb01),[_0xcc9b('0x75'),_0xcc9b('0x74'),_0xcc9b('0x76'),_0xcc9b('0x77')]);if(_0x32617c[_0xcc9b('0x59')]['id']){delete _0x32617c[_0xcc9b('0x59')]['id'];}if(_['isNil'](_0x32617c[_0xcc9b('0x59')]['from'])){throw new db['Sequelize'][(_0xcc9b('0x78'))](_0xcc9b('0x79'));}if(_[_0xcc9b('0x7a')](_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x59')])||_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x59')]===''){throw new db['Sequelize'][(_0xcc9b('0x78'))](_0xcc9b('0x7b'));}if(_[_0xcc9b('0x7a')](_0x32617c['body']['mapKey'])){throw new db[(_0xcc9b('0x7c'))][(_0xcc9b('0x78'))](_0xcc9b('0x7d')+_0x565587);}if(!_[_0xcc9b('0x7e')](_0x565587,_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x7f')])){throw new db[(_0xcc9b('0x7c'))]['ValidationError'](_0xcc9b('0x80')+_0x565587);}_0x128beb[_0x32617c['body'][_0xcc9b('0x7f')]]=_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x81')];})[_0xcc9b('0x1f')](function(){return db[_0xcc9b('0x3d')][_0xcc9b('0x5e')]({'where':{'id':_0x32617c['params']['id']},'include':[{'model':db[_0xcc9b('0x82')],'as':'List','include':[{'model':db[_0xcc9b('0x71')],'as':_0xcc9b('0x83'),'where':_0x128beb,'limit':0x1,'order':[[_0xcc9b('0x74'),_0xcc9b('0x84')]]}]},{'model':db[_0xcc9b('0x85')],'as':_0xcc9b('0x86')}]});})[_0xcc9b('0x1f')](handleEntityNotFound(_0x1fa056,null))['then'](function(_0x54066d){if(_0x54066d&&_0x54066d[_0xcc9b('0x87')]){_0x35897b[_0xcc9b('0x88')]=_0x54066d;_0x35897b[_0xcc9b('0x89')]=_0x54066d[_0xcc9b('0x86')];_0x35897b[_0xcc9b('0x8a')]=_0x54066d[_0xcc9b('0x87')];_0x35897b['applications']=_[_0xcc9b('0x8b')](_0x35897b[_0xcc9b('0x89')],[_0xcc9b('0x8c')],['asc']);if(_0x35897b[_0xcc9b('0x88')][_0xcc9b('0x86')]){delete _0x35897b[_0xcc9b('0x88')][_0xcc9b('0x86')];}if(_0x35897b[_0xcc9b('0x88')][_0xcc9b('0x87')]&&_0x35897b[_0xcc9b('0x88')][_0xcc9b('0x87')]['Contacts'][_0xcc9b('0x49')]){return _0x35897b[_0xcc9b('0x88')]['List'][_0xcc9b('0x83')][0x0];}var _0x393eb2=_[_0xcc9b('0x8d')](_0x32617c[_0xcc9b('0x59')],{'firstName':_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x81')],'ListId':_0x54066d[_0xcc9b('0x77')]});_0x393eb2[_0x32617c[_0xcc9b('0x59')]['mapKey']]=_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x81')];return db[_0xcc9b('0x71')][_0xcc9b('0x58')](_0x393eb2,{'fields':_0x3b899f,'raw':!![]});}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x1fa056,null))[_0xcc9b('0x1f')](function(_0x2fad90){_0x35897b[_0xcc9b('0x8e')]=_0x2fad90;if(_0x2fad90){var _0x34681c={'ContactId':_0x2fad90['id'],'OpenchannelAccountId':_0x32617c[_0xcc9b('0x57')]['id'],'from':(_0x2fad90[_0xcc9b('0x8f')]||'')+'\x20'+(_0x2fad90[_0xcc9b('0x90')]||'')};var _0x525afe={'OpenchannelAccountId':_0x32617c[_0xcc9b('0x57')]['id'],'closed':![]};if(_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x91')]){_0x525afe[_0xcc9b('0x91')]=_0x32617c['body'][_0xcc9b('0x91')];return db[_0xcc9b('0x92')][_0xcc9b('0x5e')]({'where':_0x525afe})['then'](function(_0x541a68){if(_0x541a68){return[_0x541a68,![]];}_0x34681c[_0xcc9b('0x91')]=_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x91')];_0x34681c[_0xcc9b('0x93')]=_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x93')];return db[_0xcc9b('0x92')][_0xcc9b('0x58')](_0x34681c)[_0xcc9b('0x1f')](function(_0x48ad42){return[_0x48ad42,!![]];});});}else{_0x525afe[_0xcc9b('0x91')]=null;}_0x525afe[_0xcc9b('0x94')]=_0x2fad90['id'];return db[_0xcc9b('0x92')]['find']({'where':_0x525afe})['then'](function(_0x22c831){if(_0x22c831){return[_0x22c831,![]];}return db[_0xcc9b('0x92')][_0xcc9b('0x58')](_0x34681c)[_0xcc9b('0x1f')](function(_0x13a56b){return[_0x13a56b,!![]];});});}})[_0xcc9b('0x95')](function(_0x4a992b,_0x476207){if(_0x4a992b){_0x604061=_0x476207;if(!_0x476207){var _0x3c4a19={'from':(_0x35897b['contact'][_0xcc9b('0x8f')]||'')+'\x20'+(_0x35897b[_0xcc9b('0x8e')][_0xcc9b('0x90')]||'')};if(_0x32617c['body'][_0xcc9b('0x91')]&&_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x96')]&&_0x32617c[_0xcc9b('0x59')]['threadId']!=_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x96')]){_0x3c4a19[_0xcc9b('0x91')]=_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x96')];}return _0x4a992b[_0xcc9b('0x61')](_0x3c4a19);}else{return _0x4a992b;}}})[_0xcc9b('0x1f')](function(_0x542cb2){_0x35897b['interaction']=_0x542cb2['get']({'plain':!![]});_0x35897b['interaction'][_0xcc9b('0x97')]=_0x604061;if(_0x35897b['interaction']['created']){if(_0x35897b[_0xcc9b('0x88')][_0xcc9b('0x98')]){_0x35897b[_0xcc9b('0x89')][_0xcc9b('0x99')]({'id':0x0,'priority':_0x35897b[_0xcc9b('0x89')]['length']+0x1,'app':_0xcc9b('0x9a'),'appdata':'unmanaged','interval':_0xcc9b('0x9b')});}}return db[_0xcc9b('0x9c')][_0xcc9b('0x58')]({'body':_0x32617c[_0xcc9b('0x59')][_0xcc9b('0x59')],'OpenchannelAccountId':_0x32617c['params']['id'],'OpenchannelInteractionId':_0x542cb2['id'],'direction':'in','ContactId':_0x35897b['contact']['id'],'AttachmentId':_0x32617c['body'][_0xcc9b('0x9d')]});})['then'](function(_0x3db883){_0x35897b[_0xcc9b('0x27')]=_0x3db883;if(_0x35897b[_0xcc9b('0x9e')][_0xcc9b('0x9f')]){return db['User']['find']({'attributes':['id',_0xcc9b('0x39')],'where':{'id':_0x35897b[_0xcc9b('0x9e')][_0xcc9b('0x9f')]}})['then'](function(_0x37dd0e){if(_0x37dd0e){_0x35897b[_0xcc9b('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcc9b('0xa0'),'appdata':_0x37dd0e[_0xcc9b('0x39')]+','+(_0x35897b[_0xcc9b('0x88')][_0xcc9b('0xa1')]||0xa),'interval':_0xcc9b('0x9b')});_0x35897b[_0xcc9b('0xa2')]=![];}return respondWithRpcPromise(_0xcc9b('0xa3'),'startRouting',_0x35897b);});}return respondWithRpcPromise(_0xcc9b('0xa3'),'startRouting',_0x35897b);})[_0xcc9b('0x1f')](function(_0x2ce894){respondWithRpcPromise(_0xcc9b('0xa4'),'EventManager',{'event':_0xcc9b('0x70'),'message':_0x2ce894},client9002);return _0x2ce894;})[_0xcc9b('0x1f')](respondWithResult(_0x1fa056,null))[_0xcc9b('0x28')](handleError(_0x1fa056,null));};exports[_0xcc9b('0xa5')]=function(_0x1f39a8,_0x265208,_0x4843c3){return db[_0xcc9b('0x3d')]['findOne']({'where':{'id':_0x1f39a8['params']['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x265208,null))['then'](function(_0x44c5d3){if(_0x44c5d3){return db[_0xcc9b('0xa6')][_0xcc9b('0xa7')](function(_0x2188b3){return db[_0xcc9b('0x85')][_0xcc9b('0x35')]({'where':{'OpenchannelAccountId':_0x1f39a8['params']['id']},'transaction':_0x2188b3})['then'](function(_0x54ed47){var _0x2cf6d9=_[_0xcc9b('0x50')](_0x1f39a8[_0xcc9b('0x59')],function(_0x51e7b8){_0x51e7b8[_0xcc9b('0x64')]=_0x1f39a8[_0xcc9b('0x57')]['id'];return _0x51e7b8;});return db[_0xcc9b('0x85')][_0xcc9b('0xa8')](_0x2cf6d9,{'transaction':_0x2188b3});});})['then'](function(){return db[_0xcc9b('0x85')][_0xcc9b('0xa9')]({'where':{'OpenchannelAccountId':_0x1f39a8[_0xcc9b('0x57')]['id']},'order':_0xcc9b('0x8c')});});}})[_0xcc9b('0x1f')](respondWithResult(_0x265208,null))[_0xcc9b('0x28')](handleError(_0x265208,null));};exports['getApplications']=function(_0x2612bd,_0x3a0eb4,_0x17c692){var _0x58326f={};var _0x1388bc={};var _0x202f0d;var _0x4cb0f3;return db[_0xcc9b('0x3d')]['findOne']({'where':{'id':_0x2612bd[_0xcc9b('0x57')]['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x3a0eb4,null))['then'](function(_0x3bee22){if(_0x3bee22){_0x202f0d=_0x3bee22;_0x1388bc[_0xcc9b('0x46')]=_[_0xcc9b('0x42')](db['OpenchannelApplication'][_0xcc9b('0x3e')]);_0x1388bc[_0xcc9b('0x43')]=_[_0xcc9b('0x42')](_0x2612bd['query']);_0x1388bc[_0xcc9b('0x44')]=_[_0xcc9b('0x45')](_0x1388bc[_0xcc9b('0x46')],_0x1388bc[_0xcc9b('0x43')]);_0x58326f[_0xcc9b('0x47')]=_['intersection'](_0x1388bc[_0xcc9b('0x46')],qs[_0xcc9b('0x48')](_0x2612bd[_0xcc9b('0x43')][_0xcc9b('0x48')]));_0x58326f[_0xcc9b('0x47')]=_0x58326f[_0xcc9b('0x47')][_0xcc9b('0x49')]?_0x58326f['attributes']:_0x1388bc[_0xcc9b('0x46')];_0x58326f[_0xcc9b('0x4b')]=qs['sort'](_0x2612bd[_0xcc9b('0x43')][_0xcc9b('0x4c')]);_0x58326f[_0xcc9b('0x4d')]=qs[_0xcc9b('0x44')](_[_0xcc9b('0x4e')](_0x2612bd[_0xcc9b('0x43')],_0x1388bc[_0xcc9b('0x44')]));if(_0x2612bd[_0xcc9b('0x43')][_0xcc9b('0x4f')]){_0x58326f[_0xcc9b('0x4d')]=_['merge'](_0x58326f[_0xcc9b('0x4d')],{'$or':_[_0xcc9b('0x50')](_0x58326f['attributes'],function(_0x3fbb13){var _0x25a3be={};_0x25a3be[_0x3fbb13]={'$like':'%'+_0x2612bd['query'][_0xcc9b('0x4f')]+'%'};return _0x25a3be;})});}_0x58326f=_[_0xcc9b('0x52')]({},_0x58326f,_0x2612bd[_0xcc9b('0x68')]);return _0x202f0d[_0xcc9b('0xaa')](_0x58326f);}})[_0xcc9b('0x1f')](function(_0x3ba7c1){if(_0x3ba7c1){_0x4cb0f3=_0x3ba7c1['length'];if(!_0x2612bd[_0xcc9b('0x43')][_0xcc9b('0x4a')](_0xcc9b('0x67'))){_0x58326f[_0xcc9b('0x2f')]=qs[_0xcc9b('0x2f')](_0x2612bd['query'][_0xcc9b('0x2f')]);_0x58326f['offset']=qs[_0xcc9b('0x2d')](_0x2612bd[_0xcc9b('0x43')][_0xcc9b('0x2d')]);}return _0x202f0d[_0xcc9b('0xaa')](_0x58326f);}})[_0xcc9b('0x1f')](function(_0x4dc657){if(_0x4dc657){return _0x4dc657?{'count':_0x4cb0f3,'rows':_0x4dc657}:null;}})[_0xcc9b('0x1f')](respondWithResult(_0x3a0eb4,null))[_0xcc9b('0x28')](handleError(_0x3a0eb4,null));};exports[_0xcc9b('0xab')]=function(_0xe0f1f1,_0x37a908,_0x3f01a0){var _0x2be0b0={'raw':![],'where':{}};var _0x2863aa={};var _0x5b10d9={'count':0x0,'rows':[]};return db[_0xcc9b('0x3d')][_0xcc9b('0x66')]({'where':{'id':_0xe0f1f1[_0xcc9b('0x57')]['id']}})['then'](handleEntityNotFound(_0x37a908,null))[_0xcc9b('0x1f')](function(_0x294407){if(_0x294407){_0x2863aa[_0xcc9b('0x46')]=_[_0xcc9b('0x42')](db['OpenchannelInteraction'][_0xcc9b('0x3e')]);_0x2863aa[_0xcc9b('0x43')]=_['keys'](_0xe0f1f1[_0xcc9b('0x43')]);_0x2863aa['filters']=_[_0xcc9b('0x45')](_0x2863aa[_0xcc9b('0x46')],_0x2863aa[_0xcc9b('0x43')]);_0x2be0b0['attributes']=_['intersection'](_0x2863aa[_0xcc9b('0x46')],qs[_0xcc9b('0x48')](_0xe0f1f1['query'][_0xcc9b('0x48')]));_0x2be0b0['attributes']=_0x2be0b0[_0xcc9b('0x47')][_0xcc9b('0x49')]?_0x2be0b0[_0xcc9b('0x47')]:_0x2863aa['model'];if(!_0xe0f1f1['query'][_0xcc9b('0x4a')](_0xcc9b('0x67'))){_0x2be0b0[_0xcc9b('0x2f')]=qs[_0xcc9b('0x2f')](_0xe0f1f1['query'][_0xcc9b('0x2f')]);_0x2be0b0['offset']=qs[_0xcc9b('0x2d')](_0xe0f1f1[_0xcc9b('0x43')][_0xcc9b('0x2d')]);}_0x2be0b0[_0xcc9b('0x4b')]=qs['sort'](_0xe0f1f1[_0xcc9b('0x43')][_0xcc9b('0x4c')]);_0x2be0b0['where']=qs[_0xcc9b('0x44')](_[_0xcc9b('0x4e')](_0xe0f1f1['query'],_0x2863aa[_0xcc9b('0x44')]));_0x2be0b0[_0xcc9b('0x4d')][_0xcc9b('0x64')]=_0x294407['id'];if(_0xe0f1f1['query'][_0xcc9b('0x4f')]){_0x2be0b0[_0xcc9b('0x4d')]=_[_0xcc9b('0x52')](_0x2be0b0[_0xcc9b('0x4d')],{'$or':_[_0xcc9b('0x50')](_0x2be0b0['attributes'],function(_0x1513f0){var _0x2e05c8={};_0x2e05c8[_0x1513f0]={'$like':'%'+_0xe0f1f1[_0xcc9b('0x43')][_0xcc9b('0x4f')]+'%'};return _0x2e05c8;})});}_0x2be0b0=_[_0xcc9b('0x52')]({},_0x2be0b0,_0xe0f1f1[_0xcc9b('0x68')]);return db['OpenchannelInteraction'][_0xcc9b('0x30')]({'where':_0x2be0b0[_0xcc9b('0x4d')]})['then'](function(_0x12ee32){_0x5b10d9[_0xcc9b('0x30')]=_0x12ee32;if(_0xe0f1f1['query'][_0xcc9b('0x53')]){_0x2be0b0['include']=[{'model':db[_0xcc9b('0x71')],'as':_0xcc9b('0xac'),'required':![]},{'model':db[_0xcc9b('0xad')],'as':_0xcc9b('0xae'),'attributes':[_0xcc9b('0x39'),_0xcc9b('0xaf'),_0xcc9b('0xb0')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xcc9b('0x39'),_0xcc9b('0xb1')],'where':_0xe0f1f1[_0xcc9b('0x43')]['tag']?{'id':_0xe0f1f1['query'][_0xcc9b('0xb2')]}:undefined,'required':_0xe0f1f1[_0xcc9b('0x43')][_0xcc9b('0xb2')]?!![]:![]}];}return db[_0xcc9b('0x92')][_0xcc9b('0x6e')](_0x2be0b0);})[_0xcc9b('0x1f')](function(_0x79a6c2){_0x5b10d9[_0xcc9b('0x55')]=_0x79a6c2;return _0x5b10d9;});}})[_0xcc9b('0x1f')](respondWithFilteredResult(_0x37a908,_0x2be0b0))[_0xcc9b('0x28')](handleError(_0x37a908,null));};exports['addAgents']=function(_0x261aca,_0x4b7db0,_0x3bb4cd){return db[_0xcc9b('0x3d')]['find']({'where':{'id':_0x261aca[_0xcc9b('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b7db0,null))[_0xcc9b('0x1f')](function(_0x50f819){if(_0x50f819){return _0x50f819[_0xcc9b('0xb3')](_0x261aca[_0xcc9b('0x59')]['ids'],_[_0xcc9b('0xb4')](_0x261aca['body'],['ids','id'])||{})['spread'](function(_0xfe2268){for(var _0x5b9313=0x0;_0x5b9313<_0x261aca['body'][_0xcc9b('0x6a')][_0xcc9b('0x49')];_0x5b9313+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x261aca['body']['ids'][_0x5b9313]),'OpenchannelAccountId':Number(_0x261aca[_0xcc9b('0x57')]['id'])});}return _0xfe2268;});}})[_0xcc9b('0x1f')](respondWithResult(_0x4b7db0,null))[_0xcc9b('0x28')](handleError(_0x4b7db0,null));};exports['removeAgents']=function(_0x352938,_0x4a72ea,_0x579746){return db['OpenchannelAccount'][_0xcc9b('0x5e')]({'where':{'id':_0x352938[_0xcc9b('0x57')]['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x4a72ea,null))[_0xcc9b('0x1f')](function(_0x1c7225){if(_0x1c7225){return _0x1c7225[_0xcc9b('0xb5')](_0x352938[_0xcc9b('0x43')]['ids'])[_0xcc9b('0x1f')](function(){if(_['isArray'](_0x352938[_0xcc9b('0x43')][_0xcc9b('0x6a')])){for(var _0x7bca56=0x0;_0x7bca56<_0x352938['query'][_0xcc9b('0x6a')]['length'];_0x7bca56+=0x1){socket[_0xcc9b('0xb6')](_0xcc9b('0xb7'),{'UserId':Number(_0x352938['query']['ids'][_0x7bca56]),'OpenchannelAccountId':Number(_0x352938[_0xcc9b('0x57')]['id'])});}}else{socket['emit'](_0xcc9b('0xb7'),{'UserId':Number(_0x352938[_0xcc9b('0x43')][_0xcc9b('0x6a')]),'OpenchannelAccountId':Number(_0x352938[_0xcc9b('0x57')]['id'])});}});}})[_0xcc9b('0x1f')](respondWithStatusCode(_0x4a72ea,null))['catch'](handleError(_0x4a72ea,null));};exports[_0xcc9b('0xb8')]=function(_0x37489c,_0x3f97cc,_0x53b1cb){var _0x49d551={};var _0x1695dd={};var _0x5c9639;var _0x447afa;return db[_0xcc9b('0x3d')][_0xcc9b('0x66')]({'where':{'id':_0x37489c[_0xcc9b('0x57')]['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x3f97cc,null))[_0xcc9b('0x1f')](function(_0x4b1109){if(_0x4b1109){_0x5c9639=_0x4b1109;_0x1695dd[_0xcc9b('0x46')]=_[_0xcc9b('0x42')](db[_0xcc9b('0xad')][_0xcc9b('0x3e')]);_0x1695dd[_0xcc9b('0x43')]=_['keys'](_0x37489c['query']);_0x1695dd[_0xcc9b('0x44')]=_['intersection'](_0x1695dd['model'],_0x1695dd[_0xcc9b('0x43')]);_0x49d551[_0xcc9b('0x47')]=_[_0xcc9b('0x45')](_0x1695dd[_0xcc9b('0x46')],qs[_0xcc9b('0x48')](_0x37489c[_0xcc9b('0x43')][_0xcc9b('0x48')]));_0x49d551[_0xcc9b('0x47')]=_0x49d551[_0xcc9b('0x47')][_0xcc9b('0x49')]?_0x49d551[_0xcc9b('0x47')]:_0x1695dd[_0xcc9b('0x46')];_0x49d551['order']=qs[_0xcc9b('0x4c')](_0x37489c['query'][_0xcc9b('0x4c')]);_0x49d551[_0xcc9b('0x4d')]=qs[_0xcc9b('0x44')](_[_0xcc9b('0x4e')](_0x37489c[_0xcc9b('0x43')],_0x1695dd[_0xcc9b('0x44')]));if(_0x37489c[_0xcc9b('0x43')]['filter']){_0x49d551[_0xcc9b('0x4d')]=_[_0xcc9b('0x52')](_0x49d551[_0xcc9b('0x4d')],{'$or':_['map'](_0x49d551[_0xcc9b('0x47')],function(_0x36e4b1){var _0x38968f={};_0x38968f[_0x36e4b1]={'$like':'%'+_0x37489c[_0xcc9b('0x43')][_0xcc9b('0x4f')]+'%'};return _0x38968f;})});}_0x49d551=_['merge']({},_0x49d551,_0x37489c[_0xcc9b('0x68')]);return _0x5c9639[_0xcc9b('0xb8')](_0x49d551);}})['then'](function(_0xe736f2){if(_0xe736f2){_0x447afa=_0xe736f2[_0xcc9b('0x49')];if(!_0x37489c[_0xcc9b('0x43')][_0xcc9b('0x4a')]('nolimit')){_0x49d551[_0xcc9b('0x2f')]=qs[_0xcc9b('0x2f')](_0x37489c[_0xcc9b('0x43')][_0xcc9b('0x2f')]);_0x49d551[_0xcc9b('0x2d')]=qs[_0xcc9b('0x2d')](_0x37489c[_0xcc9b('0x43')][_0xcc9b('0x2d')]);}return _0x5c9639[_0xcc9b('0xb8')](_0x49d551);}})['then'](function(_0x28df7d){if(_0x28df7d){return _0x28df7d?{'count':_0x447afa,'rows':_0x28df7d}:null;}})['then'](respondWithResult(_0x3f97cc,null))[_0xcc9b('0x28')](handleError(_0x3f97cc,null));};exports[_0xcc9b('0x3a')]=function(_0x10c386,_0x14bf23,_0x488edc){var _0x25092f,_0x55068f,_0x5ac8aa;if(_['isNil'](_0x10c386[_0xcc9b('0x59')]['body'])||_0x10c386[_0xcc9b('0x59')]['body']===''){throw new db[(_0xcc9b('0x7c'))][(_0xcc9b('0x78'))](_0xcc9b('0x7b'));}if(_[_0xcc9b('0x7a')](_0x10c386[_0xcc9b('0x59')]['to'])){}_0x25092f=_0x10c386[_0xcc9b('0x59')]['to'];return db['OpenchannelAccount'][_0xcc9b('0x66')]({'where':{'id':_0x10c386[_0xcc9b('0x57')]['id']}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x14bf23,null))[_0xcc9b('0x1f')](function(_0x4473e0){if(_0x4473e0){return db['OpenchannelAccount'][_0xcc9b('0x5e')]({'where':{'id':_0x4473e0['id']},'include':[{'model':db[_0xcc9b('0x82')],'as':'List','include':[{'model':db['CmContact'],'as':_0xcc9b('0x83'),'where':{[_0x4473e0[_0xcc9b('0x7f')]]:_0x25092f},'limit':0x1,'order':[[_0xcc9b('0x74'),_0xcc9b('0x84')]]}]}]})[_0xcc9b('0x1f')](handleEntityNotFound(_0x14bf23,null))[_0xcc9b('0x1f')](function(_0x445a70){if(_0x445a70&&_0x445a70[_0xcc9b('0x87')]){_0x55068f=_0x445a70['get']({'plain':!![]});if(_0x55068f['List']&&_0x55068f[_0xcc9b('0x87')][_0xcc9b('0x83')][_0xcc9b('0x49')]){return _0x55068f[_0xcc9b('0x87')][_0xcc9b('0x83')][0x0];}return db[_0xcc9b('0x71')][_0xcc9b('0x58')](_[_0xcc9b('0x8d')](_0x10c386['body'],{'firstName':_0x25092f,[_0x445a70[_0xcc9b('0x7f')]]:_0x25092f,'phone':_0x25092f,'ListId':_0x55068f[_0xcc9b('0x77')]}));}})[_0xcc9b('0x1f')](handleEntityNotFound(_0x14bf23,null))[_0xcc9b('0x1f')](function(_0x2eac18){if(_0x2eac18){_0x5ac8aa=_0x2eac18;return db[_0xcc9b('0x92')]['find']({'where':{'ContactId':_0x5ac8aa['id'],'closed':![],'OpenchannelAccountId':_0x55068f['id']}})['then'](function(_0x20e101){if(_0x20e101){return[_0x20e101,![]];}return db[_0xcc9b('0x92')][_0xcc9b('0x58')]({'UserId':_0x10c386[_0xcc9b('0x5a')]['id'],'ContactId':_0x5ac8aa['id'],'OpenchannelAccountId':_0x55068f['id'],'lastMsgDirection':_0xcc9b('0xb9'),'Messages':[_['merge'](_0x10c386[_0xcc9b('0x59')],{'read':![],'body':_0x10c386[_0xcc9b('0x59')]['body'],'OpenchannelAccountId':_0x55068f['id'],'UserId':_0x10c386[_0xcc9b('0x5a')]['id'],'ContactId':_0x5ac8aa['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xcc9b('0xba')}]})[_0xcc9b('0x1f')](function(_0x2372f2){return[_0x2372f2,!![]];});});}})[_0xcc9b('0x95')](function(_0x3fc820,_0x31952){if(_0x31952){return _0x3fc820;}return db['OpenchannelMessage'][_0xcc9b('0x58')](_[_0xcc9b('0x52')](_0x10c386[_0xcc9b('0x59')],{'read':![],'body':_0x10c386[_0xcc9b('0x59')][_0xcc9b('0x59')],'OpenchannelAccountId':_0x55068f['id'],'OpenchannelInteractionId':_0x3fc820['id'],'UserId':_0x10c386['user']['id'],'ContactId':_0x5ac8aa['id']}))[_0xcc9b('0x1f')](function(_0x528882){_0x3fc820['dataValues'][_0xcc9b('0xba')]=[];_0x3fc820['dataValues'][_0xcc9b('0xba')][_0xcc9b('0x99')](_0x528882['dataValues']);return _0x3fc820;});});}})[_0xcc9b('0x1f')](respondWithResult(_0x14bf23,null))[_0xcc9b('0x28')](handleError(_0x14bf23,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index c353c7c..1e89f78 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 _0x2750=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x4d2418,_0x21a6cf){var _0x82dfab=function(_0x228928){while(--_0x228928){_0x4d2418['push'](_0x4d2418['shift']());}};_0x82dfab(++_0x21a6cf);}(_0x2750,0x13b));var _0x0275=function(_0x1dc791,_0x45456e){_0x1dc791=_0x1dc791-0x0;var _0x4b0882=_0x2750[_0x1dc791];return _0x4b0882;};'use strict';var EventEmitter=require(_0x0275('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x0275('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x0275('0x2')](0x0);var events={'afterCreate':_0x0275('0x3'),'afterUpdate':_0x0275('0x4'),'afterDestroy':_0x0275('0x5')};function emitEvent(_0x41ec06){return function(_0x20273d,_0x4960,_0x3d0c9c){OpenchannelAccountEvents[_0x0275('0x6')](_0x41ec06+':'+_0x20273d['id'],_0x20273d);OpenchannelAccountEvents['emit'](_0x41ec06,_0x20273d);_0x3d0c9c(null);};}for(var e in events){if(events[_0x0275('0x7')](e)){var event=events[e];OpenchannelAccount[_0x0275('0x8')](e,emitEvent(event));}}module[_0x0275('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xe5b5=['hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2a5189,_0x52354d){var _0x30c5fd=function(_0x1db2da){while(--_0x1db2da){_0x2a5189['push'](_0x2a5189['shift']());}};_0x30c5fd(++_0x52354d);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0xe5b5[_0x5d61b4];return _0x183fc5;};'use strict';var EventEmitter=require(_0x5e5b('0x0'));var OpenchannelAccount=require(_0x5e5b('0x1'))['db'][_0x5e5b('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x5e5b('0x3')](0x0);var events={'afterCreate':_0x5e5b('0x4'),'afterUpdate':_0x5e5b('0x5'),'afterDestroy':_0x5e5b('0x6')};function emitEvent(_0x3dc763){return function(_0xf20c6a,_0x20a50c,_0xdc6616){OpenchannelAccountEvents[_0x5e5b('0x7')](_0x3dc763+':'+_0xf20c6a['id'],_0xf20c6a);OpenchannelAccountEvents[_0x5e5b('0x7')](_0x3dc763,_0xf20c6a);_0xdc6616(null);};}for(var e in events){if(events[_0x5e5b('0x8')](e)){var event=events[e];OpenchannelAccount[_0x5e5b('0x9')](e,emitEvent(event));}}module[_0x5e5b('0xa')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index c4ad303..4ac3613 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(_0x59500a,_0xe87b65){var _0x1b4b34=function(_0x14026e){while(--_0x14026e){_0x59500a['push'](_0x59500a['shift']());}};_0x1b4b34(++_0xe87b65);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x46f3b5,_0x8ca1c0){var _0x3cd523=function(_0x3e694f){while(--_0x3e694f){_0x46f3b5['push'](_0x46f3b5['shift']());}};_0x3cd523(++_0x8ca1c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 94e70c4..500c1f3 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 _0x3495=['../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','redis','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4fd171,_0x2f99dc){var _0x5449cc=function(_0x3f6eea){while(--_0x3f6eea){_0x4fd171['push'](_0x4fd171['shift']());}};_0x5449cc(++_0x2f99dc);}(_0x3495,0x1de));var _0x5349=function(_0x28673e,_0x5a37c0){_0x28673e=_0x28673e-0x0;var _0x192b67=_0x3495[_0x28673e];return _0x192b67;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});config['redis']=_[_0x5349('0xc')](config['redis'],{'host':_0x5349('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5349('0xe')]));require(_0x5349('0xf'))[_0x5349('0x10')](socket);function respondWithRpcPromise(_0x23a1c7,_0x21bf91,_0x3a416e){return new BPromise(function(_0x35d425,_0x4bf160){return client[_0x5349('0x11')](_0x23a1c7,_0x3a416e)['then'](function(_0x2cbd83){logger[_0x5349('0x12')](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));logger[_0x5349('0x15')](_0x5349('0x16'),_0x21bf91,_0x5349('0x14'),JSON[_0x5349('0x17')](_0x2cbd83));if(_0x2cbd83[_0x5349('0x18')]){if(_0x2cbd83[_0x5349('0x18')]['code']===0x1f4){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x4bf160(_0x2cbd83[_0x5349('0x18')][_0x5349('0x19')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x35d425(_0x2cbd83['error'][_0x5349('0x19')]);}else{logger['info'](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));_0x35d425(_0x2cbd83[_0x5349('0x1a')][_0x5349('0x19')]);}})['catch'](function(_0x22d1ca){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x22d1ca);_0x4bf160(_0x22d1ca);});});} \ No newline at end of file +var _0x0565=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash'];(function(_0x419099,_0x2065c4){var _0xcce761=function(_0x276f1f){while(--_0x276f1f){_0x419099['push'](_0x419099['shift']());}};_0xcce761(++_0x2065c4);}(_0x0565,0xf2));var _0x5056=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x0565[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});config[_0x5056('0xd')]=_['defaults'](config['redis'],{'host':_0x5056('0xe'),'port':0x18eb});var socket=require(_0x5056('0xf'))(new Redis(config[_0x5056('0xd')]));require(_0x5056('0x10'))[_0x5056('0x11')](socket);function respondWithRpcPromise(_0x68efb2,_0x1fa531,_0x332cd7){return new BPromise(function(_0x5d2e60,_0x78f7e4){return client[_0x5056('0x12')](_0x68efb2,_0x332cd7)[_0x5056('0x13')](function(_0x5ab4b2){logger['info'](_0x5056('0x14'),_0x1fa531,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1fa531,_0x5056('0x15'),JSON['stringify'](_0x5ab4b2));if(_0x5ab4b2[_0x5056('0x16')]){if(_0x5ab4b2[_0x5056('0x16')][_0x5056('0x17')]===0x1f4){logger['error'](_0x5056('0x14'),_0x1fa531,_0x5ab4b2[_0x5056('0x16')][_0x5056('0x18')]);return _0x78f7e4(_0x5ab4b2[_0x5056('0x16')][_0x5056('0x18')]);}logger[_0x5056('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fa531,_0x5ab4b2[_0x5056('0x16')]['message']);return _0x5d2e60(_0x5ab4b2[_0x5056('0x16')][_0x5056('0x18')]);}else{logger[_0x5056('0x19')](_0x5056('0x14'),_0x1fa531,_0x5056('0x15'));_0x5d2e60(_0x5ab4b2['result'][_0x5056('0x18')]);}})[_0x5056('0x1a')](function(_0x4f8fa7){logger['error'](_0x5056('0x14'),_0x1fa531,_0x4f8fa7);_0x78f7e4(_0x4f8fa7);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index af3926a..e32d47c 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 _0xc964=['update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x4fffb9,_0x560a3c){var _0x342090=function(_0x1a4de9){while(--_0x1a4de9){_0x4fffb9['push'](_0x4fffb9['shift']());}};_0x342090(++_0x560a3c);}(_0xc964,0x7e));var _0x4c96=function(_0x548653,_0x4bbd91){_0x548653=_0x548653-0x0;var _0x4b02fe=_0xc964[_0x548653];return _0x4b02fe;};'use strict';var OpenchannelAccountEvents=require(_0x4c96('0x0'));var events=[_0x4c96('0x1'),'remove',_0x4c96('0x2')];function createListener(_0x8d390f,_0x90fbb1){return function(_0x591daa){_0x90fbb1[_0x4c96('0x3')](_0x8d390f,_0x591daa);};}function removeListener(_0x491d1e,_0x1b0a58){return function(){OpenchannelAccountEvents[_0x4c96('0x4')](_0x491d1e,_0x1b0a58);};}exports[_0x4c96('0x5')]=function(_0x2f6461){for(var _0x45bb27=0x0,_0x1fa8a0=events[_0x4c96('0x6')];_0x45bb27<_0x1fa8a0;_0x45bb27++){var _0x493618=events[_0x45bb27];var _0x19ed76=createListener(_0x4c96('0x7')+_0x493618,_0x2f6461);OpenchannelAccountEvents['on'](_0x493618,_0x19ed76);}}; \ No newline at end of file +var _0xf194=['remove','update','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x14c0f3,_0x2971ce){var _0x3747bb=function(_0x59802f){while(--_0x59802f){_0x14c0f3['push'](_0x14c0f3['shift']());}};_0x3747bb(++_0x2971ce);}(_0xf194,0x91));var _0x4f19=function(_0x20f1b0,_0x300e96){_0x20f1b0=_0x20f1b0-0x0;var _0x55554d=_0xf194[_0x20f1b0];return _0x55554d;};'use strict';var OpenchannelAccountEvents=require(_0x4f19('0x0'));var events=[_0x4f19('0x1'),_0x4f19('0x2'),_0x4f19('0x3')];function createListener(_0x52e2fb,_0x13475c){return function(_0x533c58){_0x13475c['emit'](_0x52e2fb,_0x533c58);};}function removeListener(_0x5c0587,_0x2db75c){return function(){OpenchannelAccountEvents[_0x4f19('0x4')](_0x5c0587,_0x2db75c);};}exports[_0x4f19('0x5')]=function(_0x57c148){for(var _0x1fbd23=0x0,_0x45c88a=events['length'];_0x1fbd23<_0x45c88a;_0x1fbd23++){var _0x4b023f=events[_0x1fbd23];var _0x265d15=createListener(_0x4f19('0x6')+_0x4b023f,_0x57c148);OpenchannelAccountEvents['on'](_0x4b023f,_0x265d15);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 92b13a4..14cb0f1 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 _0x7dd6=['destroy','multer','path','connect-timeout','express','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x1a4b4e,_0x1a51e3){var _0x3da946=function(_0x5b03ff){while(--_0x5b03ff){_0x1a4b4e['push'](_0x1a4b4e['shift']());}};_0x3da946(++_0x1a51e3);}(_0x7dd6,0x191));var _0x67dd=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0x7dd6[_0xfb0281];return _0x408dd3;};'use strict';var multer=require(_0x67dd('0x0'));var util=require('util');var path=require(_0x67dd('0x1'));var timeout=require(_0x67dd('0x2'));var express=require(_0x67dd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x67dd('0x4'));var config=require('../../config/environment');var controller=require(_0x67dd('0x5'));router[_0x67dd('0x6')]('/',auth[_0x67dd('0x7')](),controller['index']);router['get'](_0x67dd('0x8'),auth[_0x67dd('0x7')](),controller[_0x67dd('0x9')]);router[_0x67dd('0xa')]('/',auth[_0x67dd('0x7')](),controller[_0x67dd('0xb')]);router[_0x67dd('0xc')]('/:id',auth[_0x67dd('0x7')](),controller[_0x67dd('0xd')]);router[_0x67dd('0xe')](_0x67dd('0x8'),auth[_0x67dd('0x7')](),controller[_0x67dd('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcfa6=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra'];(function(_0x3232b3,_0x37a10d){var _0x3d046f=function(_0x1da401){while(--_0x1da401){_0x3232b3['push'](_0x3232b3['shift']());}};_0x3d046f(++_0x37a10d);}(_0xcfa6,0xb0));var _0x6cfa=function(_0x517e22,_0x213046){_0x517e22=_0x517e22-0x0;var _0x7ea868=_0xcfa6[_0x517e22];return _0x7ea868;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6cfa('0x0'));var express=require(_0x6cfa('0x1'));var router=express[_0x6cfa('0x2')]();var fs_extra=require(_0x6cfa('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6cfa('0x4'));var config=require(_0x6cfa('0x5'));var controller=require('./openchannelApplication.controller');router[_0x6cfa('0x6')]('/',auth[_0x6cfa('0x7')](),controller[_0x6cfa('0x8')]);router[_0x6cfa('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x6cfa('0x9')]);router[_0x6cfa('0xa')]('/',auth[_0x6cfa('0x7')](),controller[_0x6cfa('0xb')]);router[_0x6cfa('0xc')](_0x6cfa('0xd'),auth[_0x6cfa('0x7')](),controller[_0x6cfa('0xe')]);router[_0x6cfa('0xf')](_0x6cfa('0xd'),auth[_0x6cfa('0x7')](),controller[_0x6cfa('0x10')]);module[_0x6cfa('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index d2a6b4f..ac99f0e 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 _0xc93f=['exports','INTEGER','noop','TEXT','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc93f,0x127));var _0xfc93=function(_0x4b008f,_0x5a0eac){_0x4b008f=_0x4b008f-0x0;var _0x3b4065=_0xc93f[_0x4b008f];return _0x3b4065;};'use strict';var Sequelize=require('sequelize');module[_0xfc93('0x0')]={'priority':{'type':Sequelize[_0xfc93('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfc93('0x2')},'appdata':{'type':Sequelize[_0xfc93('0x3')]()},'description':{'type':Sequelize[_0xfc93('0x4')]},'interval':{'type':Sequelize[_0xfc93('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x61ee=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x5ab173,_0x21fc5a){var _0x38a681=function(_0x3a7518){while(--_0x3a7518){_0x5ab173['push'](_0x5ab173['shift']());}};_0x38a681(++_0x21fc5a);}(_0x61ee,0x163));var _0xe61e=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0x61ee[_0x4bcfa6];return _0x1c0165;};'use strict';var Sequelize=require(_0xe61e('0x0'));module[_0xe61e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe61e('0x2')],'allowNull':![],'defaultValue':_0xe61e('0x3')},'appdata':{'type':Sequelize[_0xe61e('0x4')]()},'description':{'type':Sequelize[_0xe61e('0x2')]},'interval':{'type':Sequelize[_0xe61e('0x2')],'defaultValue':_0xe61e('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 75f875b..780e74b 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 _0x9682=['create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','OpenchannelApplication','includeAll','include','findAll','rows','show','params','find','catch'];(function(_0x413ae6,_0x13f177){var _0x29816f=function(_0xc98d3d){while(--_0xc98d3d){_0x413ae6['push'](_0x413ae6['shift']());}};_0x29816f(++_0x13f177);}(_0x9682,0xd7));var _0x2968=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9682[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2968('0x0'));var jsonpatch=require(_0x2968('0x1'));var rp=require(_0x2968('0x2'));var moment=require(_0x2968('0x3'));var BPromise=require(_0x2968('0x4'));var Mustache=require(_0x2968('0x5'));var util=require(_0x2968('0x6'));var path=require(_0x2968('0x7'));var sox=require(_0x2968('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2968('0x9'));var _=require(_0x2968('0xa'));var squel=require(_0x2968('0xb'));var crypto=require(_0x2968('0xc'));var jsforce=require(_0x2968('0xd'));var deskjs=require(_0x2968('0xe'));var toCsv=require(_0x2968('0xf'));var querystring=require('querystring');var Papa=require(_0x2968('0x10'));var Redis=require(_0x2968('0x11'));var authService=require(_0x2968('0x12'));var qs=require(_0x2968('0x13'));var as=require(_0x2968('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2968('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2968('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x101a63,_0xe3fa34){_0xe3fa34=_0xe3fa34||0xcc;return function(_0x3a363c){if(_0x3a363c){return _0x101a63['sendStatus'](_0xe3fa34);}return _0x101a63['status'](_0xe3fa34)['end']();};}function respondWithResult(_0xf9543d,_0x4d47fc){_0x4d47fc=_0x4d47fc||0xc8;return function(_0x2869ba){if(_0x2869ba){return _0xf9543d[_0x2968('0x17')](_0x4d47fc)[_0x2968('0x18')](_0x2869ba);}};}function respondWithFilteredResult(_0x3feb1d,_0x345b7c){return function(_0x13b0c2){if(_0x13b0c2){var _0x3eac06=typeof _0x345b7c[_0x2968('0x19')]===_0x2968('0x1a')&&typeof _0x345b7c[_0x2968('0x1b')]===_0x2968('0x1a');var _0x4bac6f=_0x13b0c2[_0x2968('0x1c')];var _0x4e95fb=_0x3eac06?0x0:_0x345b7c[_0x2968('0x19')];var _0x13ae5a=_0x3eac06?_0x13b0c2[_0x2968('0x1c')]:_0x345b7c[_0x2968('0x19')]+_0x345b7c[_0x2968('0x1b')];var _0x40a220;if(_0x13ae5a>=_0x4bac6f){_0x13ae5a=_0x4bac6f;_0x40a220=0xc8;}else{_0x40a220=0xce;}_0x3feb1d[_0x2968('0x17')](_0x40a220);return _0x3feb1d[_0x2968('0x1d')](_0x2968('0x1e'),_0x4e95fb+'-'+_0x13ae5a+'/'+_0x4bac6f)[_0x2968('0x18')](_0x13b0c2);}return null;};}function patchUpdates(_0x4aeb52){return function(_0x4800ef){try{jsonpatch[_0x2968('0x1f')](_0x4800ef,_0x4aeb52,!![]);}catch(_0x4876b5){return BPromise['reject'](_0x4876b5);}return _0x4800ef[_0x2968('0x20')]();};}function saveUpdates(_0x5c49ba,_0xb24dd5){return function(_0x4fc04b){if(_0x4fc04b){return _0x4fc04b[_0x2968('0x21')](_0x5c49ba)['then'](function(_0x3509fe){return _0x3509fe;});}return null;};}function removeEntity(_0x255529,_0x5ada09){return function(_0x38dc8d){if(_0x38dc8d){return _0x38dc8d[_0x2968('0x22')]()[_0x2968('0x23')](function(){_0x255529[_0x2968('0x17')](0xcc)[_0x2968('0x24')]();});}};}function handleEntityNotFound(_0x1e419d,_0x550524){return function(_0x44b8f7){if(!_0x44b8f7){_0x1e419d[_0x2968('0x25')](0x194);}return _0x44b8f7;};}function handleError(_0x23d772,_0x53645b){_0x53645b=_0x53645b||0x1f4;return function(_0x166fd6){logger['error'](_0x166fd6['stack']);if(_0x166fd6['name']){delete _0x166fd6[_0x2968('0x26')];}_0x23d772[_0x2968('0x17')](_0x53645b)['send'](_0x166fd6);};}exports[_0x2968('0x27')]=function(_0x2d621d,_0x2902b0){var _0x404892={},_0x1fb2b6={},_0x352937={'count':0x0,'rows':[]};var _0x2dc68d=_['map'](db['OpenchannelApplication'][_0x2968('0x28')],function(_0x10fca3){return{'name':_0x10fca3[_0x2968('0x29')],'type':_0x10fca3[_0x2968('0x2a')][_0x2968('0x2b')]};});_0x1fb2b6['model']=_[_0x2968('0x2c')](_0x2dc68d,'name');_0x1fb2b6[_0x2968('0x2d')]=_[_0x2968('0x2e')](_0x2d621d[_0x2968('0x2d')]);_0x1fb2b6[_0x2968('0x2f')]=_[_0x2968('0x30')](_0x1fb2b6['model'],_0x1fb2b6[_0x2968('0x2d')]);_0x404892[_0x2968('0x31')]=_['intersection'](_0x1fb2b6['model'],qs[_0x2968('0x32')](_0x2d621d['query']['fields']));_0x404892[_0x2968('0x31')]=_0x404892['attributes']['length']?_0x404892[_0x2968('0x31')]:_0x1fb2b6[_0x2968('0x33')];if(!_0x2d621d[_0x2968('0x2d')][_0x2968('0x34')](_0x2968('0x35'))){_0x404892['limit']=qs[_0x2968('0x1b')](_0x2d621d[_0x2968('0x2d')]['limit']);_0x404892[_0x2968('0x19')]=qs[_0x2968('0x19')](_0x2d621d['query'][_0x2968('0x19')]);}_0x404892['order']=qs[_0x2968('0x36')](_0x2d621d[_0x2968('0x2d')][_0x2968('0x36')]);_0x404892[_0x2968('0x37')]=qs[_0x2968('0x2f')](_[_0x2968('0x38')](_0x2d621d[_0x2968('0x2d')],_0x1fb2b6[_0x2968('0x2f')]),_0x2dc68d);if(_0x2d621d[_0x2968('0x2d')][_0x2968('0x39')]){_0x404892[_0x2968('0x37')]=_[_0x2968('0x3a')](_0x404892[_0x2968('0x37')],{'$or':_[_0x2968('0x2c')](_0x2dc68d,function(_0x1c5009){if(_0x1c5009[_0x2968('0x2a')]!=='VIRTUAL'){var _0x538591={};_0x538591[_0x1c5009[_0x2968('0x26')]]={'$like':'%'+_0x2d621d['query']['filter']+'%'};return _0x538591;}})});}_0x404892=_[_0x2968('0x3a')]({},_0x404892,_0x2d621d[_0x2968('0x3b')]);var _0x127858={'where':_0x404892[_0x2968('0x37')]};return db[_0x2968('0x3c')][_0x2968('0x1c')](_0x127858)[_0x2968('0x23')](function(_0xb8a371){_0x352937['count']=_0xb8a371;if(_0x2d621d[_0x2968('0x2d')][_0x2968('0x3d')]){_0x404892[_0x2968('0x3e')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x2968('0x3f')](_0x404892);})[_0x2968('0x23')](function(_0x6d6916){_0x352937[_0x2968('0x40')]=_0x6d6916;return _0x352937;})[_0x2968('0x23')](respondWithFilteredResult(_0x2902b0,_0x404892))['catch'](handleError(_0x2902b0,null));};exports[_0x2968('0x41')]=function(_0x2ec447,_0x4d65f7){var _0x179a8f={'raw':!![],'where':{'id':_0x2ec447[_0x2968('0x42')]['id']}},_0x28fda6={};_0x28fda6[_0x2968('0x33')]=_[_0x2968('0x2e')](db[_0x2968('0x3c')][_0x2968('0x28')]);_0x28fda6['query']=_[_0x2968('0x2e')](_0x2ec447['query']);_0x28fda6[_0x2968('0x2f')]=_[_0x2968('0x30')](_0x28fda6[_0x2968('0x33')],_0x28fda6[_0x2968('0x2d')]);_0x179a8f[_0x2968('0x31')]=_[_0x2968('0x30')](_0x28fda6[_0x2968('0x33')],qs[_0x2968('0x32')](_0x2ec447[_0x2968('0x2d')][_0x2968('0x32')]));_0x179a8f[_0x2968('0x31')]=_0x179a8f['attributes']['length']?_0x179a8f[_0x2968('0x31')]:_0x28fda6[_0x2968('0x33')];if(_0x2ec447[_0x2968('0x2d')][_0x2968('0x3d')]){_0x179a8f[_0x2968('0x3e')]=[{'all':!![]}];}_0x179a8f=_[_0x2968('0x3a')]({},_0x179a8f,_0x2ec447[_0x2968('0x3b')]);return db[_0x2968('0x3c')][_0x2968('0x43')](_0x179a8f)['then'](handleEntityNotFound(_0x4d65f7,null))['then'](respondWithResult(_0x4d65f7,null))[_0x2968('0x44')](handleError(_0x4d65f7,null));};exports['create']=function(_0x779279,_0x795d6d){return db['OpenchannelApplication'][_0x2968('0x45')](_0x779279['body'],{})[_0x2968('0x23')](respondWithResult(_0x795d6d,0xc9))[_0x2968('0x44')](handleError(_0x795d6d,null));};exports[_0x2968('0x21')]=function(_0x597e11,_0x4f11c9){if(_0x597e11[_0x2968('0x46')]['id']){delete _0x597e11[_0x2968('0x46')]['id'];}return db['OpenchannelApplication'][_0x2968('0x43')]({'where':{'id':_0x597e11[_0x2968('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f11c9,null))[_0x2968('0x23')](saveUpdates(_0x597e11['body'],null))['then'](respondWithResult(_0x4f11c9,null))[_0x2968('0x44')](handleError(_0x4f11c9,null));};exports['destroy']=function(_0x20f678,_0x467dc5){return db[_0x2968('0x3c')][_0x2968('0x43')]({'where':{'id':_0x20f678[_0x2968('0x42')]['id']}})['then'](handleEntityNotFound(_0x467dc5,null))['then'](removeEntity(_0x467dc5,null))['catch'](handleError(_0x467dc5,null));}; \ No newline at end of file +var _0x6eb8=['options','find','create','update','body','params','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','includeAll','findAll','rows','catch','show','include','merge'];(function(_0x1772ad,_0x3a000a){var _0x5430a7=function(_0x5b10f1){while(--_0x5b10f1){_0x1772ad['push'](_0x1772ad['shift']());}};_0x5430a7(++_0x3a000a);}(_0x6eb8,0x9e));var _0x86eb=function(_0xb98d8d,_0x481423){_0xb98d8d=_0xb98d8d-0x0;var _0x489b15=_0x6eb8[_0xb98d8d];return _0x489b15;};'use strict';var emlformat=require(_0x86eb('0x0'));var rimraf=require(_0x86eb('0x1'));var zipdir=require(_0x86eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86eb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x86eb('0x4'));var path=require(_0x86eb('0x5'));var sox=require(_0x86eb('0x6'));var csv=require(_0x86eb('0x7'));var ejs=require(_0x86eb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86eb('0x9'));var squel=require(_0x86eb('0xa'));var crypto=require('crypto');var jsforce=require(_0x86eb('0xb'));var deskjs=require(_0x86eb('0xc'));var toCsv=require(_0x86eb('0x7'));var querystring=require('querystring');var Papa=require(_0x86eb('0xd'));var Redis=require(_0x86eb('0xe'));var authService=require(_0x86eb('0xf'));var qs=require(_0x86eb('0x10'));var as=require(_0x86eb('0x11'));var hardwareService=require(_0x86eb('0x12'));var logger=require(_0x86eb('0x13'))(_0x86eb('0x14'));var utils=require(_0x86eb('0x15'));var config=require(_0x86eb('0x16'));var licenseUtil=require(_0x86eb('0x17'));var db=require(_0x86eb('0x18'))['db'];function respondWithStatusCode(_0x4f8581,_0x478d16){_0x478d16=_0x478d16||0xcc;return function(_0x580e84){if(_0x580e84){return _0x4f8581['sendStatus'](_0x478d16);}return _0x4f8581[_0x86eb('0x19')](_0x478d16)[_0x86eb('0x1a')]();};}function respondWithResult(_0x45f2ed,_0x23dd34){_0x23dd34=_0x23dd34||0xc8;return function(_0x595b0a){if(_0x595b0a){return _0x45f2ed[_0x86eb('0x19')](_0x23dd34)[_0x86eb('0x1b')](_0x595b0a);}};}function respondWithFilteredResult(_0x1dbf4f,_0x486fbd){return function(_0x11d248){if(_0x11d248){var _0x4a00c8=typeof _0x486fbd[_0x86eb('0x1c')]===_0x86eb('0x1d')&&typeof _0x486fbd[_0x86eb('0x1e')]===_0x86eb('0x1d');var _0x5197fb=_0x11d248['count'];var _0x48439e=_0x4a00c8?0x0:_0x486fbd['offset'];var _0x3092d2=_0x4a00c8?_0x11d248[_0x86eb('0x1f')]:_0x486fbd[_0x86eb('0x1c')]+_0x486fbd[_0x86eb('0x1e')];var _0x11fea2;if(_0x3092d2>=_0x5197fb){_0x3092d2=_0x5197fb;_0x11fea2=0xc8;}else{_0x11fea2=0xce;}_0x1dbf4f[_0x86eb('0x19')](_0x11fea2);return _0x1dbf4f['set'](_0x86eb('0x20'),_0x48439e+'-'+_0x3092d2+'/'+_0x5197fb)['json'](_0x11d248);}return null;};}function patchUpdates(_0x4981eb){return function(_0x1d7652){try{jsonpatch[_0x86eb('0x21')](_0x1d7652,_0x4981eb,!![]);}catch(_0x1e20e0){return BPromise[_0x86eb('0x22')](_0x1e20e0);}return _0x1d7652[_0x86eb('0x23')]();};}function saveUpdates(_0x3c80ed,_0x28d031){return function(_0x261f07){if(_0x261f07){return _0x261f07['update'](_0x3c80ed)[_0x86eb('0x24')](function(_0x39de01){return _0x39de01;});}return null;};}function removeEntity(_0x4f523c,_0x2900c3){return function(_0x4d8051){if(_0x4d8051){return _0x4d8051[_0x86eb('0x25')]()[_0x86eb('0x24')](function(){_0x4f523c[_0x86eb('0x19')](0xcc)[_0x86eb('0x1a')]();});}};}function handleEntityNotFound(_0x33c78f,_0x29aefe){return function(_0x5d5936){if(!_0x5d5936){_0x33c78f[_0x86eb('0x26')](0x194);}return _0x5d5936;};}function handleError(_0x1c93cb,_0x673e04){_0x673e04=_0x673e04||0x1f4;return function(_0x2b6338){logger[_0x86eb('0x27')](_0x2b6338[_0x86eb('0x28')]);if(_0x2b6338[_0x86eb('0x29')]){delete _0x2b6338[_0x86eb('0x29')];}_0x1c93cb[_0x86eb('0x19')](_0x673e04)['send'](_0x2b6338);};}exports[_0x86eb('0x2a')]=function(_0x2db1cf,_0x474594){var _0x12f502={},_0x135ffd={},_0x19a717={'count':0x0,'rows':[]};var _0xfb9a61=_[_0x86eb('0x2b')](db[_0x86eb('0x2c')][_0x86eb('0x2d')],function(_0x363efb){return{'name':_0x363efb[_0x86eb('0x2e')],'type':_0x363efb[_0x86eb('0x2f')][_0x86eb('0x30')]};});_0x135ffd[_0x86eb('0x31')]=_[_0x86eb('0x2b')](_0xfb9a61,_0x86eb('0x29'));_0x135ffd[_0x86eb('0x32')]=_[_0x86eb('0x33')](_0x2db1cf[_0x86eb('0x32')]);_0x135ffd[_0x86eb('0x34')]=_[_0x86eb('0x35')](_0x135ffd[_0x86eb('0x31')],_0x135ffd[_0x86eb('0x32')]);_0x12f502[_0x86eb('0x36')]=_[_0x86eb('0x35')](_0x135ffd[_0x86eb('0x31')],qs[_0x86eb('0x37')](_0x2db1cf[_0x86eb('0x32')][_0x86eb('0x37')]));_0x12f502[_0x86eb('0x36')]=_0x12f502['attributes'][_0x86eb('0x38')]?_0x12f502[_0x86eb('0x36')]:_0x135ffd[_0x86eb('0x31')];if(!_0x2db1cf['query'][_0x86eb('0x39')](_0x86eb('0x3a'))){_0x12f502[_0x86eb('0x1e')]=qs['limit'](_0x2db1cf[_0x86eb('0x32')][_0x86eb('0x1e')]);_0x12f502[_0x86eb('0x1c')]=qs[_0x86eb('0x1c')](_0x2db1cf[_0x86eb('0x32')][_0x86eb('0x1c')]);}_0x12f502['order']=qs[_0x86eb('0x3b')](_0x2db1cf['query']['sort']);_0x12f502['where']=qs[_0x86eb('0x34')](_['pick'](_0x2db1cf[_0x86eb('0x32')],_0x135ffd[_0x86eb('0x34')]),_0xfb9a61);if(_0x2db1cf['query'][_0x86eb('0x3c')]){_0x12f502[_0x86eb('0x3d')]=_['merge'](_0x12f502[_0x86eb('0x3d')],{'$or':_[_0x86eb('0x2b')](_0xfb9a61,function(_0x32c893){if(_0x32c893[_0x86eb('0x2f')]!==_0x86eb('0x3e')){var _0x2e8deb={};_0x2e8deb[_0x32c893[_0x86eb('0x29')]]={'$like':'%'+_0x2db1cf[_0x86eb('0x32')][_0x86eb('0x3c')]+'%'};return _0x2e8deb;}})});}_0x12f502=_['merge']({},_0x12f502,_0x2db1cf['options']);var _0x3c6172={'where':_0x12f502[_0x86eb('0x3d')]};return db[_0x86eb('0x2c')]['count'](_0x3c6172)['then'](function(_0x20de42){_0x19a717['count']=_0x20de42;if(_0x2db1cf[_0x86eb('0x32')][_0x86eb('0x3f')]){_0x12f502['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x86eb('0x40')](_0x12f502);})['then'](function(_0x23fc8d){_0x19a717[_0x86eb('0x41')]=_0x23fc8d;return _0x19a717;})[_0x86eb('0x24')](respondWithFilteredResult(_0x474594,_0x12f502))[_0x86eb('0x42')](handleError(_0x474594,null));};exports[_0x86eb('0x43')]=function(_0x4bebb9,_0x247e1a){var _0x2de563={'raw':!![],'where':{'id':_0x4bebb9['params']['id']}},_0x1e0729={};_0x1e0729[_0x86eb('0x31')]=_[_0x86eb('0x33')](db[_0x86eb('0x2c')][_0x86eb('0x2d')]);_0x1e0729['query']=_[_0x86eb('0x33')](_0x4bebb9[_0x86eb('0x32')]);_0x1e0729[_0x86eb('0x34')]=_[_0x86eb('0x35')](_0x1e0729[_0x86eb('0x31')],_0x1e0729[_0x86eb('0x32')]);_0x2de563[_0x86eb('0x36')]=_[_0x86eb('0x35')](_0x1e0729[_0x86eb('0x31')],qs['fields'](_0x4bebb9[_0x86eb('0x32')][_0x86eb('0x37')]));_0x2de563[_0x86eb('0x36')]=_0x2de563['attributes'][_0x86eb('0x38')]?_0x2de563[_0x86eb('0x36')]:_0x1e0729[_0x86eb('0x31')];if(_0x4bebb9[_0x86eb('0x32')][_0x86eb('0x3f')]){_0x2de563[_0x86eb('0x44')]=[{'all':!![]}];}_0x2de563=_[_0x86eb('0x45')]({},_0x2de563,_0x4bebb9[_0x86eb('0x46')]);return db[_0x86eb('0x2c')][_0x86eb('0x47')](_0x2de563)[_0x86eb('0x24')](handleEntityNotFound(_0x247e1a,null))[_0x86eb('0x24')](respondWithResult(_0x247e1a,null))[_0x86eb('0x42')](handleError(_0x247e1a,null));};exports[_0x86eb('0x48')]=function(_0x4b1eb9,_0xcead97){return db[_0x86eb('0x2c')]['create'](_0x4b1eb9['body'],{})[_0x86eb('0x24')](respondWithResult(_0xcead97,0xc9))[_0x86eb('0x42')](handleError(_0xcead97,null));};exports[_0x86eb('0x49')]=function(_0x109003,_0xa2d680){if(_0x109003[_0x86eb('0x4a')]['id']){delete _0x109003[_0x86eb('0x4a')]['id'];}return db[_0x86eb('0x2c')][_0x86eb('0x47')]({'where':{'id':_0x109003['params']['id']}})[_0x86eb('0x24')](handleEntityNotFound(_0xa2d680,null))[_0x86eb('0x24')](saveUpdates(_0x109003['body'],null))['then'](respondWithResult(_0xa2d680,null))[_0x86eb('0x42')](handleError(_0xa2d680,null));};exports['destroy']=function(_0x471a1c,_0xba7913){return db[_0x86eb('0x2c')][_0x86eb('0x47')]({'where':{'id':_0x471a1c[_0x86eb('0x4b')]['id']}})[_0x86eb('0x24')](handleEntityNotFound(_0xba7913,null))[_0x86eb('0x24')](removeEntity(_0xba7913,null))['catch'](handleError(_0xba7913,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index d30dee2..1eb0c0e 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 _0x20ac=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelApplication.attributes'];(function(_0x289215,_0x429d66){var _0x4135b3=function(_0x59e8ea){while(--_0x59e8ea){_0x289215['push'](_0x289215['shift']());}};_0x4135b3(++_0x429d66);}(_0x20ac,0xbc));var _0xc20a=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x20ac[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0xc20a('0x0'));var util=require(_0xc20a('0x1'));var logger=require(_0xc20a('0x2'))(_0xc20a('0x3'));var moment=require(_0xc20a('0x4'));var BPromise=require(_0xc20a('0x5'));var rp=require(_0xc20a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc20a('0x7'));module[_0xc20a('0x8')]=function(_0x1aa07f,_0x221f1b){return _0x1aa07f[_0xc20a('0x9')](_0xc20a('0xa'),attributes,{'tableName':_0xc20a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc20a('0xc'),'collate':_0xc20a('0xd')});}; \ No newline at end of file +var _0x9d94=['path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2ebc27,_0x5299be){var _0x265af7=function(_0x40d51e){while(--_0x40d51e){_0x2ebc27['push'](_0x2ebc27['shift']());}};_0x265af7(++_0x5299be);}(_0x9d94,0x1ca));var _0x49d9=function(_0xc50f8b,_0x3d9de8){_0xc50f8b=_0xc50f8b-0x0;var _0x4a8469=_0x9d94[_0xc50f8b];return _0x4a8469;};'use strict';var _=require(_0x49d9('0x0'));var util=require(_0x49d9('0x1'));var logger=require(_0x49d9('0x2'))(_0x49d9('0x3'));var moment=require(_0x49d9('0x4'));var BPromise=require(_0x49d9('0x5'));var rp=require(_0x49d9('0x6'));var fs=require('fs');var path=require(_0x49d9('0x7'));var rimraf=require(_0x49d9('0x8'));var config=require(_0x49d9('0x9'));var attributes=require(_0x49d9('0xa'));module[_0x49d9('0xb')]=function(_0x51c64e,_0x37ab25){return _0x51c64e[_0x49d9('0xc')]('OpenchannelApplication',attributes,{'tableName':_0x49d9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x49d9('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index d1542f0..d69d237 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 _0xc973=['result','catch','UpdateOpenchannelApplication','update','body','options','raw','attributes','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x18899c,_0xea0ce5){var _0x1ee5e1=function(_0x47cdd2){while(--_0x47cdd2){_0x18899c['push'](_0x18899c['shift']());}};_0x1ee5e1(++_0xea0ce5);}(_0xc973,0x15e));var _0x3c97=function(_0x406ba9,_0x175723){_0x406ba9=_0x406ba9-0x0;var _0x2b8015=_0xc973[_0x406ba9];return _0x2b8015;};'use strict';var _=require(_0x3c97('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3c97('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c97('0x2'));var db=require(_0x3c97('0x3'))['db'];var utils=require(_0x3c97('0x4'));var logger=require(_0x3c97('0x5'))(_0x3c97('0x6'));var config=require(_0x3c97('0x7'));var jayson=require(_0x3c97('0x8'));var client=jayson[_0x3c97('0x9')][_0x3c97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24798b,_0xdd9afb,_0x30e9f7){return new BPromise(function(_0x58efc1,_0x11f83d){return client[_0x3c97('0xb')](_0x24798b,_0x30e9f7)[_0x3c97('0xc')](function(_0x9d816b){logger[_0x3c97('0xd')](_0x3c97('0xe'),_0xdd9afb,_0x3c97('0xf'));logger[_0x3c97('0x10')](_0x3c97('0x11'),_0xdd9afb,_0x3c97('0xf'),JSON[_0x3c97('0x12')](_0x9d816b));if(_0x9d816b['error']){if(_0x9d816b[_0x3c97('0x13')][_0x3c97('0x14')]===0x1f4){logger[_0x3c97('0x13')](_0x3c97('0xe'),_0xdd9afb,_0x9d816b['error'][_0x3c97('0x15')]);return _0x11f83d(_0x9d816b[_0x3c97('0x13')][_0x3c97('0x15')]);}logger['error'](_0x3c97('0xe'),_0xdd9afb,_0x9d816b[_0x3c97('0x13')][_0x3c97('0x15')]);return _0x58efc1(_0x9d816b[_0x3c97('0x13')][_0x3c97('0x15')]);}else{logger[_0x3c97('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0xdd9afb,'request\x20sent');_0x58efc1(_0x9d816b[_0x3c97('0x16')][_0x3c97('0x15')]);}})[_0x3c97('0x17')](function(_0x292a7f){logger[_0x3c97('0x13')](_0x3c97('0xe'),_0xdd9afb,_0x292a7f);_0x11f83d(_0x292a7f);});});}exports[_0x3c97('0x18')]=function(_0x1c1108){var _0x3e8f19=this;return new Promise(function(_0x1d4184,_0x49d4b2){return db['OpenchannelApplication'][_0x3c97('0x19')](_0x1c1108[_0x3c97('0x1a')],{'raw':_0x1c1108[_0x3c97('0x1b')]?_0x1c1108[_0x3c97('0x1b')][_0x3c97('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1108[_0x3c97('0x1b')]?_0x1c1108['options']['where']||null:null,'attributes':_0x1c1108[_0x3c97('0x1b')]?_0x1c1108['options'][_0x3c97('0x1d')]||null:null,'limit':_0x1c1108[_0x3c97('0x1b')]?_0x1c1108[_0x3c97('0x1b')][_0x3c97('0x1e')]||null:null})[_0x3c97('0xc')](function(_0x59bea8){logger['info'](_0x3c97('0x18'),_0x1c1108);logger[_0x3c97('0x10')](_0x3c97('0x18'),_0x1c1108,JSON[_0x3c97('0x12')](_0x59bea8));_0x1d4184(_0x59bea8);})['catch'](function(_0x51ecbe){logger[_0x3c97('0x13')]('UpdateOpenchannelApplication',_0x51ecbe[_0x3c97('0x15')],_0x1c1108);_0x49d4b2(_0x3e8f19[_0x3c97('0x13')](0x1f4,_0x51ecbe[_0x3c97('0x15')]));});});}; \ No newline at end of file +var _0x4a60=['options','raw','where','attributes','limit','debug','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body'];(function(_0x11f893,_0x259935){var _0x400fa8=function(_0x25933b){while(--_0x25933b){_0x11f893['push'](_0x11f893['shift']());}};_0x400fa8(++_0x259935);}(_0x4a60,0xa2));var _0x04a6=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x4a60[_0x737a1f];return _0x16eba1;};'use strict';var _=require('lodash');var util=require(_0x04a6('0x0'));var moment=require(_0x04a6('0x1'));var BPromise=require('bluebird');var rs=require(_0x04a6('0x2'));var fs=require('fs');var Redis=require(_0x04a6('0x3'));var db=require(_0x04a6('0x4'))['db'];var utils=require(_0x04a6('0x5'));var logger=require(_0x04a6('0x6'))(_0x04a6('0x7'));var config=require('../../config/environment');var jayson=require(_0x04a6('0x8'));var client=jayson[_0x04a6('0x9')][_0x04a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54cdb8,_0x3d5bbd,_0x8bf96d){return new BPromise(function(_0x4255d8,_0x2c20b4){return client['request'](_0x54cdb8,_0x8bf96d)[_0x04a6('0xb')](function(_0xa8434b){logger[_0x04a6('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x3d5bbd,'request\x20sent');logger['debug'](_0x04a6('0xd'),_0x3d5bbd,'request\x20sent',JSON['stringify'](_0xa8434b));if(_0xa8434b[_0x04a6('0xe')]){if(_0xa8434b[_0x04a6('0xe')][_0x04a6('0xf')]===0x1f4){logger[_0x04a6('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x3d5bbd,_0xa8434b[_0x04a6('0xe')][_0x04a6('0x10')]);return _0x2c20b4(_0xa8434b[_0x04a6('0xe')][_0x04a6('0x10')]);}logger['error'](_0x04a6('0x11'),_0x3d5bbd,_0xa8434b[_0x04a6('0xe')][_0x04a6('0x10')]);return _0x4255d8(_0xa8434b[_0x04a6('0xe')][_0x04a6('0x10')]);}else{logger[_0x04a6('0xc')](_0x04a6('0x11'),_0x3d5bbd,_0x04a6('0x12'));_0x4255d8(_0xa8434b[_0x04a6('0x13')]['message']);}})[_0x04a6('0x14')](function(_0x5a5ee6){logger[_0x04a6('0xe')](_0x04a6('0x11'),_0x3d5bbd,_0x5a5ee6);_0x2c20b4(_0x5a5ee6);});});}exports[_0x04a6('0x15')]=function(_0x5803c4){var _0x543bd6=this;return new Promise(function(_0x5d65a6,_0x25a89b){return db[_0x04a6('0x16')]['update'](_0x5803c4[_0x04a6('0x17')],{'raw':_0x5803c4[_0x04a6('0x18')]?_0x5803c4[_0x04a6('0x18')][_0x04a6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5803c4['options']?_0x5803c4[_0x04a6('0x18')][_0x04a6('0x1a')]||null:null,'attributes':_0x5803c4[_0x04a6('0x18')]?_0x5803c4[_0x04a6('0x18')][_0x04a6('0x1b')]||null:null,'limit':_0x5803c4[_0x04a6('0x18')]?_0x5803c4[_0x04a6('0x18')][_0x04a6('0x1c')]||null:null})['then'](function(_0x5ec5b7){logger[_0x04a6('0xc')](_0x04a6('0x15'),_0x5803c4);logger[_0x04a6('0x1d')](_0x04a6('0x15'),_0x5803c4,JSON[_0x04a6('0x1e')](_0x5ec5b7));_0x5d65a6(_0x5ec5b7);})[_0x04a6('0x14')](function(_0x478006){logger[_0x04a6('0xe')]('UpdateOpenchannelApplication',_0x478006[_0x04a6('0x10')],_0x5803c4);_0x25a89b(_0x543bd6[_0x04a6('0xe')](0x1f4,_0x478006[_0x04a6('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 94442ee..a25e11c 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 _0x1710=['fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','download','post','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','path','connect-timeout','Router'];(function(_0x2e4b67,_0x3533af){var _0x3932c6=function(_0x199558){while(--_0x199558){_0x2e4b67['push'](_0x2e4b67['shift']());}};_0x3932c6(++_0x3533af);}(_0x1710,0xb7));var _0x0171=function(_0x37d2ee,_0x269f86){_0x37d2ee=_0x37d2ee-0x0;var _0x497d29=_0x1710[_0x37d2ee];return _0x497d29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0171('0x0'));var timeout=require(_0x0171('0x1'));var express=require('express');var router=express[_0x0171('0x2')]();var fs_extra=require(_0x0171('0x3'));var auth=require(_0x0171('0x4'));var interaction=require(_0x0171('0x5'));var config=require('../../config/environment');var controller=require(_0x0171('0x6'));router[_0x0171('0x7')]('/',auth[_0x0171('0x8')](),controller[_0x0171('0x9')]);router[_0x0171('0x7')](_0x0171('0xa'),auth['isAuthenticated'](),controller[_0x0171('0xb')]);router[_0x0171('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0171('0xc')]);router[_0x0171('0x7')](_0x0171('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0171('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x0171('0xe')]);router[_0x0171('0xf')]('/',auth[_0x0171('0x8')](),controller['create']);router[_0x0171('0xf')](_0x0171('0xd'),auth['isAuthenticated'](),controller[_0x0171('0x10')]);router[_0x0171('0xf')]('/:id/tags',auth[_0x0171('0x8')](),interaction[_0x0171('0x11')](_0x0171('0x12'),_0x0171('0x13')),controller[_0x0171('0x14')]);router[_0x0171('0x15')](_0x0171('0x16'),auth[_0x0171('0x8')](),interaction[_0x0171('0x11')](_0x0171('0x12'),_0x0171('0x17')),controller[_0x0171('0x18')]);router[_0x0171('0x19')](_0x0171('0x16'),auth[_0x0171('0x8')](),interaction[_0x0171('0x11')](_0x0171('0x12'),_0x0171('0x1a')),controller[_0x0171('0x1b')]);router[_0x0171('0x19')](_0x0171('0x1c'),auth[_0x0171('0x8')](),controller[_0x0171('0x1d')]);module[_0x0171('0x1e')]=router; \ No newline at end of file +var _0x7412=['removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannel','openchannelinteraction:update','update','delete'];(function(_0x484b66,_0x51c8de){var _0x23992=function(_0x317b9f){while(--_0x317b9f){_0x484b66['push'](_0x484b66['shift']());}};_0x23992(++_0x51c8de);}(_0x7412,0x16d));var _0x2741=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x7412[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0x2741('0x0'));var util=require('util');var path=require(_0x2741('0x1'));var timeout=require('connect-timeout');var express=require(_0x2741('0x2'));var router=express[_0x2741('0x3')]();var fs_extra=require(_0x2741('0x4'));var auth=require(_0x2741('0x5'));var interaction=require(_0x2741('0x6'));var config=require(_0x2741('0x7'));var controller=require(_0x2741('0x8'));router[_0x2741('0x9')]('/',auth[_0x2741('0xa')](),controller[_0x2741('0xb')]);router['get'](_0x2741('0xc'),auth[_0x2741('0xa')](),controller[_0x2741('0xd')]);router['get'](_0x2741('0xe'),auth[_0x2741('0xa')](),controller[_0x2741('0xf')]);router['get'](_0x2741('0x10'),auth[_0x2741('0xa')](),controller[_0x2741('0x11')]);router[_0x2741('0x9')](_0x2741('0x12'),auth[_0x2741('0xa')](),controller[_0x2741('0x13')]);router[_0x2741('0x14')]('/',auth['isAuthenticated'](),controller[_0x2741('0x15')]);router[_0x2741('0x14')](_0x2741('0x10'),auth[_0x2741('0xa')](),controller[_0x2741('0x16')]);router[_0x2741('0x14')](_0x2741('0x17'),auth['isAuthenticated'](),interaction[_0x2741('0x18')]('openchannel',_0x2741('0x19')),controller['addTags']);router[_0x2741('0x1a')](_0x2741('0xe'),auth['isAuthenticated'](),interaction[_0x2741('0x18')](_0x2741('0x1b'),_0x2741('0x1c')),controller[_0x2741('0x1d')]);router[_0x2741('0x1e')]('/:id',auth[_0x2741('0xa')](),interaction[_0x2741('0x18')](_0x2741('0x1b'),'openchannelinteraction:destroy'),controller['destroy']);router['delete'](_0x2741('0x17'),auth['isAuthenticated'](),controller[_0x2741('0x1f')]);module[_0x2741('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 93128cf..943a902 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 _0x92e0=['sequelize','BOOLEAN','DATE','STRING'];(function(_0x545d13,_0x9eac3d){var _0x110e77=function(_0x20aa48){while(--_0x20aa48){_0x545d13['push'](_0x545d13['shift']());}};_0x110e77(++_0x9eac3d);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x092e('0x0'));module['exports']={'closed':{'type':Sequelize[_0x092e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x092e('0x2')]},'disposition':{'type':Sequelize[_0x092e('0x3')]},'secondDisposition':{'type':Sequelize[_0x092e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x092e('0x3')]},'note':{'type':Sequelize[_0x092e('0x3')]},'read1stAt':{'type':Sequelize[_0x092e('0x2')]},'threadId':{'type':Sequelize[_0x092e('0x3')]},'externalUrl':{'type':Sequelize[_0x092e('0x3')]},'lastMsgAt':{'type':Sequelize[_0x092e('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x092e('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x092e('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x9917=['ENUM','out','sequelize','BOOLEAN','DATE','STRING'];(function(_0x3c0b2d,_0x342562){var _0x3c01fc=function(_0x54ca2b){while(--_0x54ca2b){_0x3c0b2d['push'](_0x3c0b2d['shift']());}};_0x3c01fc(++_0x342562);}(_0x9917,0xe6));var _0x7991=function(_0x4b048b,_0x35eb15){_0x4b048b=_0x4b048b-0x0;var _0x1aa533=_0x9917[_0x4b048b];return _0x1aa533;};'use strict';var Sequelize=require(_0x7991('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7991('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7991('0x2')]},'disposition':{'type':Sequelize[_0x7991('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7991('0x3')]},'note':{'type':Sequelize[_0x7991('0x3')]},'read1stAt':{'type':Sequelize[_0x7991('0x2')]},'threadId':{'type':Sequelize[_0x7991('0x3')]},'externalUrl':{'type':Sequelize[_0x7991('0x3')]},'lastMsgAt':{'type':Sequelize[_0x7991('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7991('0x4')]('in',_0x7991('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7991('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 95f1fd4..9f04887 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 _0xabbd=['Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','params','rawAttributes','merge','options','create','describe','OpenchannelMessage','addMessage','omit','findOne','hasOwnProperty','$gte','format','includeAll','addTags','setTags','ids','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','User','CmContact','firstName','lastName','Attachment','secret','OpenchannelAccount','Account','fullname','mkdirSync','Openchannel','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','Tags','TagIds','split','forEach','catch','fieldName','type','query','keys','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filters','field','from','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','Contact','operator','$substring','value','length','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','OpenchannelInteraction','a.key','Account.key'];(function(_0x511f35,_0x441556){var _0x40f62a=function(_0x1d8ad0){while(--_0x1d8ad0){_0x511f35['push'](_0x511f35['shift']());}};_0x40f62a(++_0x441556);}(_0xabbd,0x13e));var _0xdabb=function(_0x5af947,_0x1250f9){_0x5af947=_0x5af947-0x0;var _0x637853=_0xabbd[_0x5af947];return _0x637853;};'use strict';var emlformat=require(_0xdabb('0x0'));var rimraf=require(_0xdabb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdabb('0x2'));var rp=require(_0xdabb('0x3'));var moment=require(_0xdabb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdabb('0x5'));var sox=require(_0xdabb('0x6'));var csv=require(_0xdabb('0x7'));var ejs=require(_0xdabb('0x8'));var fs=require('fs');var fs_extra=require(_0xdabb('0x9'));var _=require('lodash');var squel=require(_0xdabb('0xa'));var crypto=require(_0xdabb('0xb'));var jsforce=require(_0xdabb('0xc'));var deskjs=require(_0xdabb('0xd'));var toCsv=require(_0xdabb('0x7'));var querystring=require(_0xdabb('0xe'));var Papa=require(_0xdabb('0xf'));var Redis=require(_0xdabb('0x10'));var authService=require(_0xdabb('0x11'));var qs=require(_0xdabb('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xdabb('0x13'));var logger=require('../../config/logger')(_0xdabb('0x14'));var utils=require('../../config/utils');var config=require(_0xdabb('0x15'));var licenseUtil=require(_0xdabb('0x16'));var db=require('../../mysqldb')['db'];config[_0xdabb('0x17')]=_[_0xdabb('0x18')](config['redis'],{'host':_0xdabb('0x19'),'port':0x18eb});var socket=require(_0xdabb('0x1a'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xdabb('0x1b')](socket);function respondWithStatusCode(_0x2357e5,_0x82df95){_0x82df95=_0x82df95||0xcc;return function(_0x2a9ed5){if(_0x2a9ed5){return _0x2357e5[_0xdabb('0x1c')](_0x82df95);}return _0x2357e5[_0xdabb('0x1d')](_0x82df95)[_0xdabb('0x1e')]();};}function respondWithResult(_0x14bd20,_0x4f9dd6){_0x4f9dd6=_0x4f9dd6||0xc8;return function(_0x1f6d6c){if(_0x1f6d6c){return _0x14bd20[_0xdabb('0x1d')](_0x4f9dd6)[_0xdabb('0x1f')](_0x1f6d6c);}};}function respondWithFilteredResult(_0x4d491c,_0x1f8869){return function(_0x20d4c9){if(_0x20d4c9){var _0x431d4c=typeof _0x1f8869[_0xdabb('0x20')]===_0xdabb('0x21')&&typeof _0x1f8869[_0xdabb('0x22')]===_0xdabb('0x21');var _0x82834a=_0x20d4c9[_0xdabb('0x23')];var _0x926c5b=_0x431d4c?0x0:_0x1f8869['offset'];var _0x13a08c=_0x431d4c?_0x20d4c9[_0xdabb('0x23')]:_0x1f8869[_0xdabb('0x20')]+_0x1f8869['limit'];var _0xaffeb6;if(_0x13a08c>=_0x82834a){_0x13a08c=_0x82834a;_0xaffeb6=0xc8;}else{_0xaffeb6=0xce;}_0x4d491c[_0xdabb('0x1d')](_0xaffeb6);return _0x4d491c[_0xdabb('0x24')]('Content-Range',_0x926c5b+'-'+_0x13a08c+'/'+_0x82834a)[_0xdabb('0x1f')](_0x20d4c9);}return null;};}function patchUpdates(_0x3e7deb){return function(_0x2cc1c9){try{jsonpatch[_0xdabb('0x25')](_0x2cc1c9,_0x3e7deb,!![]);}catch(_0x553d1a){return BPromise[_0xdabb('0x26')](_0x553d1a);}return _0x2cc1c9[_0xdabb('0x27')]();};}function saveUpdates(_0x33c353,_0x37606d){return function(_0x221dbe){if(_0x221dbe){return _0x221dbe[_0xdabb('0x28')](_0x33c353)[_0xdabb('0x29')](function(_0x285e16){return _0x285e16;});}return null;};}function removeEntity(_0x1eb457,_0x577454){return function(_0x3b9891){if(_0x3b9891){return _0x3b9891[_0xdabb('0x2a')]()['then'](function(){_0x1eb457[_0xdabb('0x1d')](0xcc)[_0xdabb('0x1e')]();});}};}function handleEntityNotFound(_0x4cd6c7,_0x1514db){return function(_0x4e8176){if(!_0x4e8176){_0x4cd6c7[_0xdabb('0x1c')](0x194);}return _0x4e8176;};}function handleError(_0x58de42,_0x4f6fb3){_0x4f6fb3=_0x4f6fb3||0x1f4;return function(_0x440c6e){logger[_0xdabb('0x2b')](_0x440c6e[_0xdabb('0x2c')]);if(_0x440c6e[_0xdabb('0x2d')]){delete _0x440c6e[_0xdabb('0x2d')];}_0x58de42['status'](_0x4f6fb3)[_0xdabb('0x2e')](_0x440c6e);};}function getInteractionUsers(_0x393ab1,_0x56f248){return new BPromise(function(_0x2e4111,_0x11e59a){try{if(_0x56f248[_0x393ab1['id']]){_0x393ab1['Users']=_[_0xdabb('0x2f')](_0x56f248[_0x393ab1['id']],function(_0x4bbf28){return{'id':_0x4bbf28['id'],'fullname':_0x4bbf28['fullname']};});}}catch(_0x578527){_0x11e59a(_0x578527);}_0x2e4111(_0x393ab1);});}function getInteractionTags(_0x5608ad,_0x323680){return new BPromise(function(_0x8b940e,_0x270403){try{if(_0x5608ad['TagIds']){_0x5608ad[_0xdabb('0x30')]=[];_0x5608ad[_0xdabb('0x31')][_0xdabb('0x32')](',')[_0xdabb('0x33')](function(_0x338f12){_0x5608ad[_0xdabb('0x30')]['push'](_0x323680[_0x338f12]);});}delete _0x5608ad[_0xdabb('0x31')];}catch(_0x430eb5){_0x270403(_0x430eb5);}_0x8b940e(_0x5608ad);});}function updateOpenchannelInteraction(_0x108919,_0x1c136e,_0x1c5e44){return new BPromise(function(_0x411bbd,_0x2c2e5d){return getInteractionUsers(_0x108919,_0x1c5e44)[_0xdabb('0x29')](function(_0x9f155d){return getInteractionTags(_0x9f155d,_0x1c136e);})['then'](function(_0x3edee0){_0x411bbd(_0x3edee0);})[_0xdabb('0x34')](function(_0x510756){_0x2c2e5d(_0x510756);});});}exports['index']=function(_0x317022,_0xd5002c){var _0x279076={},_0x5d57ac={},_0x1f5cc7={'count':0x0,'rows':[]};var _0x434a2f=_[_0xdabb('0x2f')](db['OpenchannelInteraction']['rawAttributes'],function(_0x13c4f3){return{'name':_0x13c4f3[_0xdabb('0x35')],'type':_0x13c4f3[_0xdabb('0x36')]['key']};});_0x5d57ac['model']=_[_0xdabb('0x2f')](_0x434a2f,'name');_0x5d57ac[_0xdabb('0x37')]=_[_0xdabb('0x38')](_0x317022['query']);_0x5d57ac['filters']=_['intersection'](_0x5d57ac[_0xdabb('0x39')],_0x5d57ac[_0xdabb('0x37')]);_0x279076[_0xdabb('0x3a')]=_[_0xdabb('0x3b')](_0x5d57ac[_0xdabb('0x39')],qs[_0xdabb('0x3c')](_0x317022[_0xdabb('0x37')]['fields']));_0x279076['attributes']=_0x279076[_0xdabb('0x3a')]['length']?_0x279076[_0xdabb('0x3a')]:_0x5d57ac[_0xdabb('0x39')];if(!_0x317022[_0xdabb('0x37')]['hasOwnProperty'](_0xdabb('0x3d'))){_0x279076[_0xdabb('0x22')]=qs[_0xdabb('0x22')](_0x317022[_0xdabb('0x37')]['limit']);_0x279076[_0xdabb('0x20')]=qs[_0xdabb('0x20')](_0x317022[_0xdabb('0x37')][_0xdabb('0x20')]);}_0x279076[_0xdabb('0x3e')]=qs[_0xdabb('0x3f')](_0x317022[_0xdabb('0x37')]['sort']);_0x279076[_0xdabb('0x40')]=qs['filters'](_[_0xdabb('0x41')](_0x317022['query'],_0x5d57ac[_0xdabb('0x42')]),_0x434a2f);var _0x31c619=[];var _0x44a187=squel['select']()[_0xdabb('0x43')]('id')[_0xdabb('0x43')](_0xdabb('0x2d'))[_0xdabb('0x43')]('color')[_0xdabb('0x44')]('tools_tags');var _0x576ecb=squel[_0xdabb('0x45')]()[_0xdabb('0x43')](_0xdabb('0x46'))[_0xdabb('0x43')](_0xdabb('0x47'))[_0xdabb('0x43')](_0xdabb('0x48'))[_0xdabb('0x44')](_0xdabb('0x49'),'ui')[_0xdabb('0x4a')]('users','u','u.id\x20=\x20ui.UserId');var _0x564427=squel[_0xdabb('0x45')]()['from']('openchannel_interactions','i')[_0xdabb('0x4a')](_0xdabb('0x4b'),'c',_0xdabb('0x4c'))[_0xdabb('0x4a')](_0xdabb('0x4d'),'o',_0xdabb('0x4e'))[_0xdabb('0x4a')](_0xdabb('0x4f'),'a',_0xdabb('0x50'))[_0xdabb('0x4a')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xdabb('0x4a')](_0xdabb('0x51'),'it',_0xdabb('0x52'))['left_join'](_0xdabb('0x53'),'t',_0xdabb('0x54'));var _0x1427ab=squel[_0xdabb('0x55')]();var _0x26551d=[];var _0x37ef98=squel['expr']();var _0x45710e;if(_0x317022['query'][_0xdabb('0x56')]){_0x45710e=as[_0xdabb('0x57')](_0x317022[_0xdabb('0x37')][_0xdabb('0x56')]);var _0x543084=_0x45710e[_0xdabb('0x58')];for(var _0x2b47bd=0x0;_0x2b47bd<_0x45710e['conditions']['length'];_0x2b47bd++){var _0x1af275=_0x45710e[_0xdabb('0x59')][_0x2b47bd];var _0x47890a='i';var _0x4ce38b=_[_0xdabb('0x5a')](_0x434a2f,['name',_0x1af275[_0xdabb('0x43')]]);if(!_0x4ce38b){switch(_0x1af275['field']){case _0xdabb('0x5b'):if(_0x1af275['value']==0x1){_0x564427[_0xdabb('0x5c')]('`'+_0x1af275[_0xdabb('0x43')]+'`\x20=\x200');}else{_0x564427[_0xdabb('0x5c')]('`'+_0x1af275[_0xdabb('0x43')]+'`\x20>\x200');}break;case _0xdabb('0x5d'):if(_0x1af275[_0xdabb('0x5e')]===_0xdabb('0x5f')){if(_0x1af275[_0xdabb('0x60')][_0xdabb('0x32')]('\x20')[_0xdabb('0x61')]>0x1){_0x1427ab[_0x543084]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdabb('0x62')](_0x1af275[_0xdabb('0x60')]),null);}else{var _0x1d46ef='%'+_0x1af275[_0xdabb('0x60')]+'%';_0x1427ab[_0x543084](_0xdabb('0x63'),_0x1d46ef,_0x1d46ef,_0x1d46ef);}}else{_0x4ce38b=_[_0xdabb('0x5a')](_0x434a2f,[_0xdabb('0x2d'),'ContactId']);_0x1af275[_0xdabb('0x43')]=_0xdabb('0x64');_0x412170=as[_0xdabb('0x65')](_0x47890a,_0x4ce38b['type'],_0x1af275);_0x1427ab[_0x543084](_0x412170[_0xdabb('0x66')],_0x412170[_0xdabb('0x60')][_0xdabb('0x67')],_0x412170[_0xdabb('0x60')][_0xdabb('0x1e')]);}break;case _0xdabb('0x68'):var _0x4088cc=_0x1af275['value']['split'](',')[_0xdabb('0x2f')](function(_0x84bced){return Number(_0x84bced);});_0x4088cc[_0xdabb('0x33')](function(_0x393f0b){_0x37ef98['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x393f0b+',%');});_0x26551d=_['union'](_0x26551d,_0x4088cc);break;case'User':if(_0x1af275[_0xdabb('0x5e')]===_0xdabb('0x5f')){_0x1427ab[_0x543084](_0xdabb('0x69'),'%'+_0x1af275[_0xdabb('0x60')]+'%',null);}else{_0x4ce38b=_['find'](_0x434a2f,[_0xdabb('0x2d'),_0xdabb('0x6a')]);_0x1af275[_0xdabb('0x43')]='UserId';_0x412170=as[_0xdabb('0x65')](_0x47890a,_0x4ce38b['type'],_0x1af275);_0x1427ab[_0x543084](_0x412170[_0xdabb('0x66')],_0x412170['value'][_0xdabb('0x67')],_0x412170[_0xdabb('0x60')]['end']);}break;case _0xdabb('0x6b'):_0x412170=as['buildExpression']('me',null,_0x1af275);_0x1427ab[_0x543084](_0x412170[_0xdabb('0x66')],_0x412170[_0xdabb('0x60')][_0xdabb('0x67')],_0x412170[_0xdabb('0x60')][_0xdabb('0x1e')]);break;}}else{var _0x412170=as[_0xdabb('0x65')](_0x47890a,_0x4ce38b[_0xdabb('0x36')],_0x1af275);_0x1427ab[_0x543084](_0x412170[_0xdabb('0x66')],_0x412170[_0xdabb('0x60')][_0xdabb('0x67')],_0x412170[_0xdabb('0x60')][_0xdabb('0x1e')]);}}}else{var _0x3ab19e=_(_0x317022[_0xdabb('0x37')])[_0xdabb('0x38')]()['map'](function(_0x9ae29d){return _[_0xdabb('0x6c')](_0x434a2f,[_0xdabb('0x2d'),_0x9ae29d])?_0x9ae29d:undefined;})[_0xdabb('0x6d')]()[_0xdabb('0x60')]();if(!_['isEmpty'](_0x3ab19e)){_0x3ab19e[_0xdabb('0x33')](function(_0x5bdb34){if(_0x5bdb34===_0xdabb('0x6e')){_0x564427[_0xdabb('0x40')](_0xdabb('0x6f'),[][_0xdabb('0x70')](_0x317022[_0xdabb('0x37')][_0x5bdb34]));}else if(_0x5bdb34===_0xdabb('0x71')){var _0x300aed=JSON[_0xdabb('0x72')](_0x317022[_0xdabb('0x37')][_0x5bdb34])['$gte'];var _0x8e90e3=JSON[_0xdabb('0x72')](_0x317022[_0xdabb('0x37')][_0x5bdb34])['$lte'];_0x564427[_0xdabb('0x40')](_0xdabb('0x73'),_0x300aed,_0x8e90e3);}else{if(_0x317022[_0xdabb('0x37')][_0x5bdb34]===_0xdabb('0x74')){_0x564427['where']('i.'+_0x5bdb34+_0xdabb('0x75'));}else{_0x564427[_0xdabb('0x40')]('i.'+_0x5bdb34+'\x20=\x20?',_0x317022['query'][_0x5bdb34]);}}});}if(_0x317022[_0xdabb('0x37')][_0xdabb('0x76')]){if(_0x317022['query'][_0xdabb('0x76')]==0x1){_0x564427[_0xdabb('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x564427[_0xdabb('0x5c')]('`unreadMessages`\x20>\x200');}}if(_0x317022[_0xdabb('0x37')][_0xdabb('0x77')]){_0x26551d=_[_0xdabb('0x78')](_0x317022[_0xdabb('0x37')][_0xdabb('0x77')])?_0x317022[_0xdabb('0x37')]['tag']:new Array(_0x317022[_0xdabb('0x37')][_0xdabb('0x77')]);_0x26551d[_0xdabb('0x33')](function(_0x470084){_0x37ef98['or'](_0xdabb('0x79'),'%,'+_0x470084+',%');});}if(_0x317022['query']['filter']){var _0x26f4fd=_0x317022['query'][_0xdabb('0x7a')][_0xdabb('0x7b')]('\x5c','\x5c\x5c')[_0xdabb('0x7b')](/'/g,'\x27\x27');if(qs[_0xdabb('0x7c')](_0x26f4fd)){_0x1427ab['or'](_0xdabb('0x7d'),_0x26f4fd+'%');}else{_0x1427ab['or'](_0xdabb('0x7e'),qs[_0xdabb('0x62')](_0x26f4fd))['or'](_0xdabb('0x7f'),_0x26f4fd+'%')['or'](_0xdabb('0x80'),_0x26f4fd+'%');}}}_0x564427[_0xdabb('0x40')](_0x1427ab);_0x564427[_0xdabb('0x81')]('i.id');var _0x55d019={'type':db['Sequelize']['QueryTypes'][_0xdabb('0x82')],'raw':!![]};var _0x2d7fbe=_0x564427['clone']();_0x2d7fbe[_0xdabb('0x43')]('i.id');_0x2d7fbe[_0xdabb('0x43')](_0xdabb('0x83'),'unreadMessages');if(_0x279076['order']){_0x279076[_0xdabb('0x3e')]['forEach'](function(_0x593b3d){var _0x65d4f1=_0x593b3d[0x0]===_0xdabb('0x84')?_0x593b3d[0x0]:'i.'+_0x593b3d[0x0];_0x564427['order'](_0x65d4f1,_0x593b3d[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x26551d)){_0x564427[_0xdabb('0x5c')](_0x37ef98);_0x2d7fbe[_0xdabb('0x40')]('t.id\x20IN\x20?',_0x26551d);}BPromise[_0xdabb('0x85')]()[_0xdabb('0x29')](function(){if(!_0x45710e){if(_0x317022['query'][_0xdabb('0x6e')])return;_0x2d7fbe['where'](_0xdabb('0x86'));_0x564427['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x317022[_0xdabb('0x87')][_0xdabb('0x88')]!==_0xdabb('0x89'))return;return _0x317022[_0xdabb('0x87')][_0xdabb('0x8a')]({'attributes':['id'],'raw':!![]})[_0xdabb('0x29')](function(_0xa99675){if(_[_0xdabb('0x8b')](_0xa99675)){_0x2d7fbe[_0xdabb('0x40')](_0xdabb('0x8c'));_0x564427[_0xdabb('0x40')](_0xdabb('0x8c'));}else{_0x2d7fbe[_0xdabb('0x40')](_0xdabb('0x6f'),_[_0xdabb('0x2f')](_0xa99675,'id'));_0x564427['where'](_0xdabb('0x6f'),_[_0xdabb('0x2f')](_0xa99675,'id'));}});})[_0xdabb('0x29')](function(){if(_0x317022[_0xdabb('0x87')][_0xdabb('0x88')]===_0xdabb('0x89')&&!_0x45710e&&!_0x317022[_0xdabb('0x37')][_0xdabb('0x6e')])return[];return db[_0xdabb('0x8d')]['query'](_0x2d7fbe['toString'](),_0x55d019);})['then'](function(_0xf0f941){_0x1f5cc7[_0xdabb('0x23')]=_0xf0f941['length'];if(_0x1f5cc7[_0xdabb('0x23')]===0x0)return[];return db[_0xdabb('0x8d')][_0xdabb('0x37')](_0x44a187[_0xdabb('0x8e')](),_0x55d019)[_0xdabb('0x29')](function(_0x472b9d){_0x31c619=_['keyBy'](_0x472b9d,'id');_0x55d019=_['merge'](_0x55d019,{'model':db[_0xdabb('0x8f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x317022[_0xdabb('0x37')][_0xdabb('0x3c')]){_0x279076['attributes'][_0xdabb('0x33')](function(_0x161d03){_0x564427[_0xdabb('0x43')]('i.'+_0x161d03);});}else{_0x564427[_0xdabb('0x43')](_0xdabb('0x83'),_0xdabb('0x5b'));_0x564427[_0xdabb('0x43')](_0xdabb('0x90'),_0xdabb('0x91'));_0x564427[_0xdabb('0x43')]('a.mandatoryDisposition',_0xdabb('0x92'));_0x564427[_0xdabb('0x43')](_0xdabb('0x93'),_0xdabb('0x84'));_0x564427[_0xdabb('0x43')](_0xdabb('0x94'));_0x564427['field'](_0xdabb('0x95'),_0xdabb('0x96'));_0x564427[_0xdabb('0x43')](_0xdabb('0x97'),'Contact.lastName');_0x564427['field'](_0xdabb('0x98'),_0xdabb('0x99'));_0x564427['field']('c.phone',_0xdabb('0x9a'));_0x564427[_0xdabb('0x43')](_0xdabb('0x9b'),'Contact.mobile');_0x564427['field'](_0xdabb('0x9c'),_0xdabb('0x9d'));_0x564427['field'](_0xdabb('0x9e'),'Owner.fullname');_0x564427[_0xdabb('0x43')](_0xdabb('0x9f'),_0xdabb('0xa0'));_0x564427['field'](_0xdabb('0xa1'),_0xdabb('0x31'));}if(_0x279076[_0xdabb('0x22')])_0x564427['limit'](_0x279076[_0xdabb('0x22')]);if(_0x279076[_0xdabb('0x20')])_0x564427[_0xdabb('0x20')](_0x279076[_0xdabb('0x20')]);return db[_0xdabb('0x8d')]['query'](_0x564427['toString'](),_0x55d019);})[_0xdabb('0x29')](function(_0x2dddd6){if(_0x2dddd6[_0xdabb('0x61')]>0x0)_0x576ecb['where'](_0xdabb('0xa2'),_[_0xdabb('0x2f')](_0x2dddd6,'id'));return db[_0xdabb('0x8d')][_0xdabb('0x37')](_0x576ecb['toString'](),_0x55d019)['then'](function(_0x2ef7bc){var _0x14dc7a=_[_0xdabb('0xa3')](_0x2ef7bc,_0xdabb('0xa4'));var _0x19057f=[];_0x2dddd6[_0xdabb('0x33')](function(_0x4676a0){_0x19057f[_0xdabb('0xa5')](updateOpenchannelInteraction(_0x4676a0,_0x31c619,_0x14dc7a));});return BPromise[_0xdabb('0xa6')](_0x19057f);});});})[_0xdabb('0x29')](function(_0xbef8b){_0x1f5cc7[_0xdabb('0xa7')]=_0xbef8b;return _0x1f5cc7;})[_0xdabb('0x29')](respondWithFilteredResult(_0xd5002c,_0x279076))[_0xdabb('0x34')](handleError(_0xd5002c,null));};exports['show']=function(_0x44b140,_0x55a04a){var _0x1a8029={};if(_0x44b140[_0xdabb('0x37')][_0xdabb('0x36')]&&_0x44b140[_0xdabb('0x37')][_0xdabb('0x36')]===_0xdabb('0x44')){_0x1a8029[_0xdabb('0x44')]=_0x44b140[_0xdabb('0xa8')]['id'];}else{_0x1a8029['id']=_0x44b140[_0xdabb('0xa8')]['id'];}var _0x504904={'raw':![],'where':_0x1a8029},_0x197ac7={};_0x197ac7[_0xdabb('0x39')]=_[_0xdabb('0x38')](db[_0xdabb('0x8f')][_0xdabb('0xa9')]);_0x197ac7[_0xdabb('0x37')]=_[_0xdabb('0x38')](_0x44b140[_0xdabb('0x37')]);_0x197ac7[_0xdabb('0x42')]=_[_0xdabb('0x3b')](_0x197ac7[_0xdabb('0x39')],_0x197ac7['query']);_0x504904[_0xdabb('0x3a')]=_[_0xdabb('0x3b')](_0x197ac7[_0xdabb('0x39')],qs[_0xdabb('0x3c')](_0x44b140[_0xdabb('0x37')][_0xdabb('0x3c')]));_0x504904[_0xdabb('0x3a')]=_0x504904['attributes'][_0xdabb('0x61')]?_0x504904['attributes']:_0x197ac7['model'];if(_0x44b140['query']['includeAll']){_0x504904['include']=[{'all':!![]}];}_0x504904=_[_0xdabb('0xaa')]({},_0x504904,_0x44b140[_0xdabb('0xab')]);return db[_0xdabb('0x8f')][_0xdabb('0x5a')](_0x504904)[_0xdabb('0x29')](handleEntityNotFound(_0x55a04a,null))[_0xdabb('0x29')](respondWithResult(_0x55a04a,null))['catch'](handleError(_0x55a04a,null));};exports[_0xdabb('0xac')]=function(_0x35133e,_0x246320){return db[_0xdabb('0x8f')][_0xdabb('0xac')](_0x35133e[_0xdabb('0x6b')],{})[_0xdabb('0x29')](respondWithResult(_0x246320,0xc9))[_0xdabb('0x34')](handleError(_0x246320,null));};exports['update']=function(_0x48f6d2,_0x10313b){if(_0x48f6d2[_0xdabb('0x6b')]['id']){delete _0x48f6d2[_0xdabb('0x6b')]['id'];}return db[_0xdabb('0x8f')][_0xdabb('0x5a')]({'where':{'id':_0x48f6d2[_0xdabb('0xa8')]['id']}})[_0xdabb('0x29')](handleEntityNotFound(_0x10313b,null))[_0xdabb('0x29')](saveUpdates(_0x48f6d2[_0xdabb('0x6b')],null))[_0xdabb('0x29')](respondWithResult(_0x10313b,null))[_0xdabb('0x34')](handleError(_0x10313b,null));};exports['destroy']=function(_0x39c3b2,_0x23bb77){return db[_0xdabb('0x8f')][_0xdabb('0x5a')]({'where':{'id':_0x39c3b2[_0xdabb('0xa8')]['id']}})['then'](handleEntityNotFound(_0x23bb77,null))[_0xdabb('0x29')](removeEntity(_0x23bb77,null))[_0xdabb('0x34')](handleError(_0x23bb77,null));};exports[_0xdabb('0xad')]=function(_0x818e3e,_0x28e9bd){return db['OpenchannelInteraction'][_0xdabb('0xad')]()[_0xdabb('0x29')](respondWithResult(_0x28e9bd,null))[_0xdabb('0x34')](handleError(_0x28e9bd,null));};exports['addMessage']=function(_0x5b249f,_0x110dec,_0x283ebf){return db[_0xdabb('0xae')][_0xdabb('0x5a')]({'where':{'id':_0x5b249f[_0xdabb('0xa8')]['id']}})[_0xdabb('0x29')](handleEntityNotFound(_0x110dec,null))[_0xdabb('0x29')](function(_0x552347){if(_0x552347){return _0x552347[_0xdabb('0xaf')](_0x5b249f['body']['ids'],_[_0xdabb('0xb0')](_0x5b249f[_0xdabb('0x6b')],['ids','id'])||{});}})[_0xdabb('0x29')](respondWithResult(_0x110dec,null))[_0xdabb('0x34')](handleError(_0x110dec,null));};exports['getMessages']=function(_0x3380df,_0x2974d4,_0x17f27f){var _0x299889={'raw':![],'where':{}};var _0x2199ff={};var _0x4fdbe5={'count':0x0,'rows':[]};return db[_0xdabb('0x8f')][_0xdabb('0xb1')]({'where':{'id':_0x3380df[_0xdabb('0xa8')]['id']}})[_0xdabb('0x29')](handleEntityNotFound(_0x2974d4,null))[_0xdabb('0x29')](function(_0x5463c6){if(_0x5463c6){_0x2199ff[_0xdabb('0x39')]=_[_0xdabb('0x38')](db[_0xdabb('0xae')][_0xdabb('0xa9')]);_0x2199ff['query']=_['keys'](_0x3380df[_0xdabb('0x37')]);_0x2199ff['filters']=_[_0xdabb('0x3b')](_0x2199ff['model'],_0x2199ff['query']);_0x299889[_0xdabb('0x3a')]=_['intersection'](_0x2199ff[_0xdabb('0x39')],qs[_0xdabb('0x3c')](_0x3380df[_0xdabb('0x37')]['fields']));_0x299889[_0xdabb('0x3a')]=_0x299889[_0xdabb('0x3a')]['length']?_0x299889[_0xdabb('0x3a')]:_0x2199ff[_0xdabb('0x39')];if(!_0x3380df[_0xdabb('0x37')][_0xdabb('0xb2')](_0xdabb('0x3d'))){_0x299889['limit']=qs[_0xdabb('0x22')](_0x3380df['query']['limit']);_0x299889[_0xdabb('0x20')]=qs[_0xdabb('0x20')](_0x3380df[_0xdabb('0x37')][_0xdabb('0x20')]);}_0x299889[_0xdabb('0x3e')]=qs['sort'](_0x3380df[_0xdabb('0x37')]['sort']);_0x299889[_0xdabb('0x40')]=qs[_0xdabb('0x42')](_[_0xdabb('0x41')](_0x3380df['query'],_0x2199ff['filters']));_0x299889['where'][_0xdabb('0xa4')]=_0x5463c6['id'];if(_0x3380df[_0xdabb('0x37')]['filter']){_0x299889[_0xdabb('0x40')]=_[_0xdabb('0xaa')](_0x299889[_0xdabb('0x40')],{'$or':_['map'](_0x299889[_0xdabb('0x3a')],function(_0x3f1f39){var _0x3c1ecf={};_0x3c1ecf[_0x3f1f39]={'$like':'%'+_0x3380df[_0xdabb('0x37')]['filter']+'%'};return _0x3c1ecf;})});}if(_0x3380df[_0xdabb('0x37')][_0xdabb('0xb3')]){var _0x3f0e94=_0x3380df['query'][_0xdabb('0xb3')][_0xdabb('0x32')](',');var _0x11a8e2={};_0x11a8e2[_0x3f0e94[0x0]]={'$gte':moment(_0x3f0e94[0x1])[_0xdabb('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x299889['where']=_[_0xdabb('0xaa')](_0x299889['where'],_0x11a8e2);}_0x299889=_[_0xdabb('0xaa')]({},_0x299889,_0x3380df[_0xdabb('0xab')]);return db[_0xdabb('0xae')][_0xdabb('0x23')]({'where':_0x299889['where']})[_0xdabb('0x29')](function(_0x1a9898){_0x4fdbe5[_0xdabb('0x23')]=_0x1a9898;if(_0x3380df[_0xdabb('0x37')][_0xdabb('0xb5')]){_0x299889['include']=[{'all':!![]}];}return db[_0xdabb('0xae')]['findAll'](_0x299889);})[_0xdabb('0x29')](function(_0x77fb51){_0x4fdbe5[_0xdabb('0xa7')]=_0x77fb51;return _0x4fdbe5;});}})[_0xdabb('0x29')](respondWithFilteredResult(_0x2974d4,_0x299889))[_0xdabb('0x34')](handleError(_0x2974d4,null));};exports[_0xdabb('0xb6')]=function(_0x335a7e,_0x414717,_0x2df2ab){return db['OpenchannelInteraction'][_0xdabb('0x5a')]({'where':{'id':_0x335a7e[_0xdabb('0xa8')]['id']}})[_0xdabb('0x29')](handleEntityNotFound(_0x414717,null))[_0xdabb('0x29')](function(_0x1dde91){if(_0x1dde91){return _0x1dde91[_0xdabb('0xb7')](_0x335a7e[_0xdabb('0x6b')][_0xdabb('0xb8')],_[_0xdabb('0xb0')](_0x335a7e[_0xdabb('0x6b')],[_0xdabb('0xb8'),'id'])||{})[_0xdabb('0xb9')](function(){return db[_0xdabb('0x68')]['findAll']({'attributes':['id',_0xdabb('0x2d'),_0xdabb('0xba')],'where':{'id':_0x335a7e['body'][_0xdabb('0xb8')]}});})['then'](function(_0x451fe8){socket[_0xdabb('0xbb')](_0xdabb('0xbc'),{'id':Number(_0x335a7e[_0xdabb('0xa8')]['id']),'tags':_0x451fe8||[]});return{'id':Number(_0x335a7e['params']['id']),'tags':_0x451fe8||[]};});}})[_0xdabb('0x29')](respondWithResult(_0x414717,null))[_0xdabb('0x34')](handleError(_0x414717,null));};exports[_0xdabb('0xbd')]=function(_0x18472e,_0x197447,_0x2a06c2){return db[_0xdabb('0x8f')]['find']({'where':{'id':_0x18472e[_0xdabb('0xa8')]['id']}})[_0xdabb('0x29')](handleEntityNotFound(_0x197447,null))[_0xdabb('0x29')](function(_0x6778b7){if(_0x6778b7){return _0x6778b7[_0xdabb('0xbd')](_0x18472e[_0xdabb('0x37')][_0xdabb('0xb8')]);}})['then'](respondWithStatusCode(_0x197447,null))[_0xdabb('0x34')](handleError(_0x197447,null));};exports[_0xdabb('0xbe')]=function(_0x53b3a7,_0x2ba6a4){var _0x404fc1=moment()[_0xdabb('0xbf')]()[_0xdabb('0x8e')]();var _0x5b524a=path[_0xdabb('0xc0')](config[_0xdabb('0xc1')],_0xdabb('0xc2'),_0xdabb('0xc3'),'tmp');var _0xc2cc3d=path['join'](config[_0xdabb('0xc1')],_0xdabb('0xc2'),_0xdabb('0xc3'),_0xdabb('0xc4'));var _0x46f574=path['join'](_0x5b524a,_0x404fc1);var _0x31aee3=util[_0xdabb('0xb4')]('transcript-%d-%s.zip',_0x53b3a7[_0xdabb('0xa8')]['id'],_0x404fc1);var _0x38774a=path[_0xdabb('0xc0')](_0x5b524a,_0x31aee3);var _0xad1340=[];_0xad1340['push']({'model':db[_0xdabb('0xc5')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0xad1340[_0xdabb('0xa5')]({'model':db[_0xdabb('0xc6')],'as':'Contact','attributes':['id',_0xdabb('0xc7'),_0xdabb('0xc8')],'raw':!![]});if(_0x53b3a7[_0xdabb('0x37')][_0xdabb('0xc4')]){_0xad1340[_0xdabb('0xa5')]({'model':db[_0xdabb('0xc9')],'as':_0xdabb('0xc9'),'raw':!![]});}var _0xb64c78=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xdabb('0x6b'),_0xdabb('0x71'),'direction',_0xdabb('0xca'),'read'],'include':_0xad1340}];_0xb64c78['push']({'model':db[_0xdabb('0xcb')],'as':_0xdabb('0xcc'),'attributes':['id',_0xdabb('0x2d')]});_0xb64c78[_0xdabb('0xa5')]({'model':db[_0xdabb('0xc5')],'as':'Owner','attributes':['id',_0xdabb('0xcd')]});return db[_0xdabb('0x8f')][_0xdabb('0x5a')]({'where':{'id':_0x53b3a7[_0xdabb('0xa8')]['id']},'include':_0xb64c78})[_0xdabb('0x29')](handleEntityNotFound(_0x2ba6a4,null))[_0xdabb('0x29')](function(_0x472e6b){if(_0x472e6b){var _0x332999=_0x472e6b['get']({'plain':!![]});fs[_0xdabb('0xce')](_0x46f574);var _0xfe3599={'channel':_0xdabb('0xcf'),'account':_0x332999[_0xdabb('0xcc')]['name'],'agent':_0x332999[_0xdabb('0xd0')]?_0x332999[_0xdabb('0xd0')][_0xdabb('0xcd')]:_0xdabb('0xd1'),'createdAt':moment(_0x332999[_0xdabb('0x71')])[_0xdabb('0xb4')](_0xdabb('0xd2'))[_0xdabb('0x8e')](),'closedAt':_0x332999['closed']?moment(_0x332999[_0xdabb('0xd3')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x332999[_0xdabb('0xd4')],'visibility':_0x332999['threadId']?'Public':_0xdabb('0xd5'),'messages':_(_0x332999[_0xdabb('0xd6')])[_0xdabb('0x7a')]({'secret':![]})[_0xdabb('0x2f')](function(_0x3ada7e){if(_0x3ada7e['Attachment']){var _0x27a94b=path['join'](_0xc2cc3d,_0x3ada7e['Attachment'][_0xdabb('0xd7')]);if(fs[_0xdabb('0xd8')](_0x27a94b)){fs[_0xdabb('0xd9')](_0x27a94b)[_0xdabb('0xda')](fs[_0xdabb('0xdb')](path[_0xdabb('0xc0')](_0x46f574,_0x3ada7e[_0xdabb('0xc9')][_0xdabb('0xd7')])));}}return{'date':moment(_0x3ada7e['createdAt'])['format'](_0xdabb('0xd2'))[_0xdabb('0x8e')](),'sender':_0x3ada7e[_0xdabb('0xdc')]===_0xdabb('0xdd')?_0x3ada7e[_0xdabb('0xc5')]?_0x3ada7e[_0xdabb('0xc5')][_0xdabb('0xcd')]:_0xdabb('0xde'):_0x3ada7e[_0xdabb('0x5d')][_0xdabb('0xc7')]+(_0x3ada7e[_0xdabb('0x5d')][_0xdabb('0xc8')]?'\x20'+_0x3ada7e[_0xdabb('0x5d')]['lastName']:''),'body':_0x3ada7e[_0xdabb('0xc9')]?_0x3ada7e['Attachment'][_0xdabb('0xd7')]:_0x3ada7e['body'],'direction':_0x3ada7e[_0xdabb('0xdc')]===_0xdabb('0xdd')?'A':'C','secret':_0x3ada7e[_0xdabb('0xca')],'read':_0x3ada7e[_0xdabb('0x76')],'attachment':_0x3ada7e['Attachment']};})[_0xdabb('0x60')]()};return ejs[_0xdabb('0xdf')](path[_0xdabb('0xc0')](config[_0xdabb('0xc1')],_0xdabb('0xc2'),_0xdabb('0xe0'),_0xdabb('0xe1')),{'interaction':_0xfe3599})[_0xdabb('0x29')](function(_0x26ee86){var _0x30b1d8=path[_0xdabb('0xc0')](_0x46f574,_0xdabb('0xe2')+_0x332999['id']+'-'+_0x404fc1+_0xdabb('0xe3'));var _0x2c679e={'path':_0x30b1d8,'channel':_0xdabb('0xcf'),'interactionId':_0x332999['id']};return pdf[_0xdabb('0xe4')](_0x26ee86,_0x2c679e);})[_0xdabb('0x29')](function(){return new BPromise(function(_0xb95dc7,_0x183b90){zipdir(_0x46f574,{'saveTo':_0x38774a},function(_0x31ff97,_0x2590ec){if(_0x31ff97)return _0x183b90(_0x31ff97);return _0xb95dc7(_0x2590ec);});})[_0xdabb('0x29')](function(){return new BPromise(function(_0x17dcac,_0x121ad3){rimraf(_0x46f574,function(_0x4013fb){if(_0x4013fb)_0x121ad3(_0x4013fb);return _0x17dcac();});});})[_0xdabb('0x29')](function(){return _0x2ba6a4['download'](_0x38774a,_0x31aee3,function(_0x973110){if(_0x973110){console[_0xdabb('0xe5')](_0xdabb('0xe6'),_0x973110);}else{fs[_0xdabb('0xe7')](_0x38774a);}});});});}else{return _0x2ba6a4[_0xdabb('0x1c')](0xc8);}})[_0xdabb('0x34')](handleError(_0x2ba6a4,null));}; \ No newline at end of file +var _0xad86=['some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','user','role','sequelize','toString','merge','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','Attachment','Messages','secret','OpenchannelAccount','Owner','get','Openchannel','Account','N.A.','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','direction','out','Contact','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','Users','map','fullname','Tags','TagIds','forEach','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','field','color','u.id','u.fullname','ui.OpenchannelInteractionId','from','users','select','left_join','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','split','union','User','$substring','UserId','body'];(function(_0x2e2fda,_0x455065){var _0xf52075=function(_0x1524a1){while(--_0x1524a1){_0x2e2fda['push'](_0x2e2fda['shift']());}};_0xf52075(++_0x455065);}(_0xad86,0x165));var _0x6ad8=function(_0x40fea4,_0x1f3098){_0x40fea4=_0x40fea4-0x0;var _0x1e9687=_0xad86[_0x40fea4];return _0x1e9687;};'use strict';var emlformat=require(_0x6ad8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ad8('0x1'));var jsonpatch=require(_0x6ad8('0x2'));var rp=require(_0x6ad8('0x3'));var moment=require(_0x6ad8('0x4'));var BPromise=require(_0x6ad8('0x5'));var Mustache=require(_0x6ad8('0x6'));var util=require('util');var path=require(_0x6ad8('0x7'));var sox=require(_0x6ad8('0x8'));var csv=require(_0x6ad8('0x9'));var ejs=require(_0x6ad8('0xa'));var fs=require('fs');var fs_extra=require(_0x6ad8('0xb'));var _=require(_0x6ad8('0xc'));var squel=require('squel');var crypto=require(_0x6ad8('0xd'));var jsforce=require(_0x6ad8('0xe'));var deskjs=require(_0x6ad8('0xf'));var toCsv=require(_0x6ad8('0x9'));var querystring=require('querystring');var Papa=require(_0x6ad8('0x10'));var Redis=require(_0x6ad8('0x11'));var authService=require(_0x6ad8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x6ad8('0x13'));var hardwareService=require(_0x6ad8('0x14'));var logger=require('../../config/logger')(_0x6ad8('0x15'));var utils=require(_0x6ad8('0x16'));var config=require(_0x6ad8('0x17'));var licenseUtil=require(_0x6ad8('0x18'));var db=require(_0x6ad8('0x19'))['db'];config[_0x6ad8('0x1a')]=_[_0x6ad8('0x1b')](config['redis'],{'host':_0x6ad8('0x1c'),'port':0x18eb});var socket=require(_0x6ad8('0x1d'))(new Redis(config[_0x6ad8('0x1a')]));require('./openchannelInteraction.socket')[_0x6ad8('0x1e')](socket);function respondWithStatusCode(_0x58b235,_0x2e1c76){_0x2e1c76=_0x2e1c76||0xcc;return function(_0x317e6a){if(_0x317e6a){return _0x58b235['sendStatus'](_0x2e1c76);}return _0x58b235[_0x6ad8('0x1f')](_0x2e1c76)[_0x6ad8('0x20')]();};}function respondWithResult(_0x178907,_0x5eae44){_0x5eae44=_0x5eae44||0xc8;return function(_0xc87dac){if(_0xc87dac){return _0x178907[_0x6ad8('0x1f')](_0x5eae44)[_0x6ad8('0x21')](_0xc87dac);}};}function respondWithFilteredResult(_0xe2045d,_0x8ef506){return function(_0x173549){if(_0x173549){var _0x26d907=typeof _0x8ef506[_0x6ad8('0x22')]===_0x6ad8('0x23')&&typeof _0x8ef506[_0x6ad8('0x24')]==='undefined';var _0x4021f6=_0x173549[_0x6ad8('0x25')];var _0x1bd72d=_0x26d907?0x0:_0x8ef506[_0x6ad8('0x22')];var _0x590364=_0x26d907?_0x173549['count']:_0x8ef506[_0x6ad8('0x22')]+_0x8ef506['limit'];var _0x58e220;if(_0x590364>=_0x4021f6){_0x590364=_0x4021f6;_0x58e220=0xc8;}else{_0x58e220=0xce;}_0xe2045d[_0x6ad8('0x1f')](_0x58e220);return _0xe2045d[_0x6ad8('0x26')](_0x6ad8('0x27'),_0x1bd72d+'-'+_0x590364+'/'+_0x4021f6)[_0x6ad8('0x21')](_0x173549);}return null;};}function patchUpdates(_0x5a7416){return function(_0x29eda1){try{jsonpatch[_0x6ad8('0x28')](_0x29eda1,_0x5a7416,!![]);}catch(_0x1f7139){return BPromise['reject'](_0x1f7139);}return _0x29eda1[_0x6ad8('0x29')]();};}function saveUpdates(_0x43c924,_0x2ed11a){return function(_0x2161cc){if(_0x2161cc){return _0x2161cc[_0x6ad8('0x2a')](_0x43c924)['then'](function(_0x2452a4){return _0x2452a4;});}return null;};}function removeEntity(_0x41b075,_0x498b1c){return function(_0x1b91d5){if(_0x1b91d5){return _0x1b91d5[_0x6ad8('0x2b')]()[_0x6ad8('0x2c')](function(){_0x41b075[_0x6ad8('0x1f')](0xcc)[_0x6ad8('0x20')]();});}};}function handleEntityNotFound(_0xa31e52,_0x58f5d1){return function(_0x4eeae6){if(!_0x4eeae6){_0xa31e52[_0x6ad8('0x2d')](0x194);}return _0x4eeae6;};}function handleError(_0x28f24a,_0x53f810){_0x53f810=_0x53f810||0x1f4;return function(_0x192fbd){logger[_0x6ad8('0x2e')](_0x192fbd[_0x6ad8('0x2f')]);if(_0x192fbd[_0x6ad8('0x30')]){delete _0x192fbd['name'];}_0x28f24a[_0x6ad8('0x1f')](_0x53f810)[_0x6ad8('0x31')](_0x192fbd);};}function getInteractionUsers(_0x4d9be9,_0x1c7fd5){return new BPromise(function(_0x4c49b1,_0x33754d){try{if(_0x1c7fd5[_0x4d9be9['id']]){_0x4d9be9[_0x6ad8('0x32')]=_[_0x6ad8('0x33')](_0x1c7fd5[_0x4d9be9['id']],function(_0x4a8359){return{'id':_0x4a8359['id'],'fullname':_0x4a8359[_0x6ad8('0x34')]};});}}catch(_0x206669){_0x33754d(_0x206669);}_0x4c49b1(_0x4d9be9);});}function getInteractionTags(_0x3c485,_0x4402d6){return new BPromise(function(_0x460bbc,_0x5ef37f){try{if(_0x3c485['TagIds']){_0x3c485[_0x6ad8('0x35')]=[];_0x3c485[_0x6ad8('0x36')]['split'](',')[_0x6ad8('0x37')](function(_0x226a40){_0x3c485['Tags']['push'](_0x4402d6[_0x226a40]);});}delete _0x3c485['TagIds'];}catch(_0x4c6940){_0x5ef37f(_0x4c6940);}_0x460bbc(_0x3c485);});}function updateOpenchannelInteraction(_0x118b3b,_0x26fc68,_0x2985e8){return new BPromise(function(_0x568103,_0x4aa00f){return getInteractionUsers(_0x118b3b,_0x2985e8)[_0x6ad8('0x2c')](function(_0x2f41d9){return getInteractionTags(_0x2f41d9,_0x26fc68);})['then'](function(_0x23d0b7){_0x568103(_0x23d0b7);})[_0x6ad8('0x38')](function(_0x2bcf8b){_0x4aa00f(_0x2bcf8b);});});}exports[_0x6ad8('0x39')]=function(_0x4bdf37,_0x10ecb3){var _0x484b87={},_0xdcdcd3={},_0xee9623={'count':0x0,'rows':[]};var _0x537b1c=_[_0x6ad8('0x33')](db[_0x6ad8('0x3a')][_0x6ad8('0x3b')],function(_0x3859c4){return{'name':_0x3859c4[_0x6ad8('0x3c')],'type':_0x3859c4[_0x6ad8('0x3d')][_0x6ad8('0x3e')]};});_0xdcdcd3[_0x6ad8('0x3f')]=_[_0x6ad8('0x33')](_0x537b1c,_0x6ad8('0x30'));_0xdcdcd3[_0x6ad8('0x40')]=_[_0x6ad8('0x41')](_0x4bdf37[_0x6ad8('0x40')]);_0xdcdcd3[_0x6ad8('0x42')]=_['intersection'](_0xdcdcd3['model'],_0xdcdcd3[_0x6ad8('0x40')]);_0x484b87['attributes']=_[_0x6ad8('0x43')](_0xdcdcd3[_0x6ad8('0x3f')],qs[_0x6ad8('0x44')](_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x44')]));_0x484b87[_0x6ad8('0x45')]=_0x484b87['attributes'][_0x6ad8('0x46')]?_0x484b87[_0x6ad8('0x45')]:_0xdcdcd3[_0x6ad8('0x3f')];if(!_0x4bdf37[_0x6ad8('0x40')]['hasOwnProperty']('nolimit')){_0x484b87[_0x6ad8('0x24')]=qs[_0x6ad8('0x24')](_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x24')]);_0x484b87[_0x6ad8('0x22')]=qs['offset'](_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x22')]);}_0x484b87[_0x6ad8('0x47')]=qs[_0x6ad8('0x48')](_0x4bdf37[_0x6ad8('0x40')]['sort']);_0x484b87[_0x6ad8('0x49')]=qs['filters'](_[_0x6ad8('0x4a')](_0x4bdf37[_0x6ad8('0x40')],_0xdcdcd3[_0x6ad8('0x42')]),_0x537b1c);var _0x12005f=[];var _0x1c4529=squel['select']()['field']('id')[_0x6ad8('0x4b')]('name')[_0x6ad8('0x4b')](_0x6ad8('0x4c'))['from']('tools_tags');var _0x205506=squel['select']()['field'](_0x6ad8('0x4d'))[_0x6ad8('0x4b')](_0x6ad8('0x4e'))[_0x6ad8('0x4b')](_0x6ad8('0x4f'))[_0x6ad8('0x50')]('user_has_openchannel_interactions','ui')['left_join'](_0x6ad8('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x53686a=squel[_0x6ad8('0x52')]()[_0x6ad8('0x50')]('openchannel_interactions','i')[_0x6ad8('0x53')](_0x6ad8('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6ad8('0x53')]('users','o',_0x6ad8('0x55'))['left_join'](_0x6ad8('0x56'),'a',_0x6ad8('0x57'))[_0x6ad8('0x53')](_0x6ad8('0x58'),'me',_0x6ad8('0x59'))['left_join'](_0x6ad8('0x5a'),'it',_0x6ad8('0x5b'))[_0x6ad8('0x53')](_0x6ad8('0x5c'),'t','t.id\x20=\x20it.TagId');var _0x11064f=squel['expr']();var _0x3b4ba8=[];var _0x3cafd8=squel[_0x6ad8('0x5d')]();var _0x34cd13;if(_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x5e')]){_0x34cd13=as[_0x6ad8('0x5f')](_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x5e')]);var _0x5daedd=_0x34cd13[_0x6ad8('0x60')];for(var _0xb4adea=0x0;_0xb4adea<_0x34cd13[_0x6ad8('0x61')][_0x6ad8('0x46')];_0xb4adea++){var _0x409ff8=_0x34cd13[_0x6ad8('0x61')][_0xb4adea];var _0x3de7a4='i';var _0x23380f=_[_0x6ad8('0x62')](_0x537b1c,['name',_0x409ff8['field']]);if(!_0x23380f){switch(_0x409ff8[_0x6ad8('0x4b')]){case _0x6ad8('0x63'):if(_0x409ff8[_0x6ad8('0x64')]==0x1){_0x53686a[_0x6ad8('0x65')]('`'+_0x409ff8[_0x6ad8('0x4b')]+_0x6ad8('0x66'));}else{_0x53686a[_0x6ad8('0x65')]('`'+_0x409ff8['field']+_0x6ad8('0x67'));}break;case'Contact':if(_0x409ff8['operator']==='$substring'){if(_0x409ff8[_0x6ad8('0x64')]['split']('\x20')[_0x6ad8('0x46')]>0x1){_0x11064f[_0x5daedd](_0x6ad8('0x68'),qs[_0x6ad8('0x69')](_0x409ff8[_0x6ad8('0x64')]),null);}else{var _0x3bf62d='%'+_0x409ff8[_0x6ad8('0x64')]+'%';_0x11064f[_0x5daedd]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3bf62d,_0x3bf62d,_0x3bf62d);}}else{_0x23380f=_[_0x6ad8('0x62')](_0x537b1c,[_0x6ad8('0x30'),_0x6ad8('0x6a')]);_0x409ff8['field']=_0x6ad8('0x6a');_0x48b4d0=as[_0x6ad8('0x6b')](_0x3de7a4,_0x23380f[_0x6ad8('0x3d')],_0x409ff8);_0x11064f[_0x5daedd](_0x48b4d0[_0x6ad8('0x6c')],_0x48b4d0[_0x6ad8('0x64')][_0x6ad8('0x6d')],_0x48b4d0[_0x6ad8('0x64')][_0x6ad8('0x20')]);}break;case _0x6ad8('0x6e'):var _0x32279b=_0x409ff8['value'][_0x6ad8('0x6f')](',')[_0x6ad8('0x33')](function(_0x16f1f4){return Number(_0x16f1f4);});_0x32279b[_0x6ad8('0x37')](function(_0xeb628e){_0x3cafd8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xeb628e+',%');});_0x3b4ba8=_[_0x6ad8('0x70')](_0x3b4ba8,_0x32279b);break;case _0x6ad8('0x71'):if(_0x409ff8['operator']===_0x6ad8('0x72')){_0x11064f[_0x5daedd]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x409ff8[_0x6ad8('0x64')]+'%',null);}else{_0x23380f=_[_0x6ad8('0x62')](_0x537b1c,[_0x6ad8('0x30'),_0x6ad8('0x73')]);_0x409ff8[_0x6ad8('0x4b')]=_0x6ad8('0x73');_0x48b4d0=as[_0x6ad8('0x6b')](_0x3de7a4,_0x23380f[_0x6ad8('0x3d')],_0x409ff8);_0x11064f[_0x5daedd](_0x48b4d0[_0x6ad8('0x6c')],_0x48b4d0[_0x6ad8('0x64')][_0x6ad8('0x6d')],_0x48b4d0['value'][_0x6ad8('0x20')]);}break;case _0x6ad8('0x74'):_0x48b4d0=as['buildExpression']('me',null,_0x409ff8);_0x11064f[_0x5daedd](_0x48b4d0[_0x6ad8('0x6c')],_0x48b4d0[_0x6ad8('0x64')][_0x6ad8('0x6d')],_0x48b4d0['value']['end']);break;}}else{var _0x48b4d0=as[_0x6ad8('0x6b')](_0x3de7a4,_0x23380f[_0x6ad8('0x3d')],_0x409ff8);_0x11064f[_0x5daedd](_0x48b4d0[_0x6ad8('0x6c')],_0x48b4d0['value'][_0x6ad8('0x6d')],_0x48b4d0[_0x6ad8('0x64')]['end']);}}}else{var _0x5597f6=_(_0x4bdf37[_0x6ad8('0x40')])['keys']()[_0x6ad8('0x33')](function(_0x196ce8){return _[_0x6ad8('0x75')](_0x537b1c,['name',_0x196ce8])?_0x196ce8:undefined;})[_0x6ad8('0x76')]()[_0x6ad8('0x64')]();if(!_[_0x6ad8('0x77')](_0x5597f6)){_0x5597f6[_0x6ad8('0x37')](function(_0x34beaf){if(_0x34beaf===_0x6ad8('0x78')){_0x53686a[_0x6ad8('0x49')](_0x6ad8('0x79'),[][_0x6ad8('0x7a')](_0x4bdf37[_0x6ad8('0x40')][_0x34beaf]));}else if(_0x34beaf===_0x6ad8('0x7b')){var _0x4f4700=JSON['parse'](_0x4bdf37[_0x6ad8('0x40')][_0x34beaf])[_0x6ad8('0x7c')];var _0x526818=JSON[_0x6ad8('0x7d')](_0x4bdf37[_0x6ad8('0x40')][_0x34beaf])[_0x6ad8('0x7e')];_0x53686a['where'](_0x6ad8('0x7f'),_0x4f4700,_0x526818);}else{if(_0x4bdf37['query'][_0x34beaf]===_0x6ad8('0x80')){_0x53686a[_0x6ad8('0x49')]('i.'+_0x34beaf+_0x6ad8('0x81'));}else{_0x53686a[_0x6ad8('0x49')]('i.'+_0x34beaf+'\x20=\x20?',_0x4bdf37[_0x6ad8('0x40')][_0x34beaf]);}}});}if(_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x82')]){if(_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x82')]==0x1){_0x53686a[_0x6ad8('0x65')](_0x6ad8('0x83'));}else{_0x53686a[_0x6ad8('0x65')]('`unreadMessages`\x20>\x200');}}if(_0x4bdf37['query'][_0x6ad8('0x84')]){_0x3b4ba8=_[_0x6ad8('0x85')](_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x84')])?_0x4bdf37[_0x6ad8('0x40')]['tag']:new Array(_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x84')]);_0x3b4ba8[_0x6ad8('0x37')](function(_0x4a772c){_0x3cafd8['or'](_0x6ad8('0x86'),'%,'+_0x4a772c+',%');});}if(_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x87')]){var _0x1dfadf=_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x87')]['replace']('\x5c','\x5c\x5c')[_0x6ad8('0x88')](/'/g,'\x27\x27');if(qs[_0x6ad8('0x89')](_0x1dfadf)){_0x11064f['or'](_0x6ad8('0x8a'),_0x1dfadf+'%');}else{_0x11064f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6ad8('0x69')](_0x1dfadf))['or'](_0x6ad8('0x8b'),_0x1dfadf+'%')['or'](_0x6ad8('0x8c'),_0x1dfadf+'%');}}}_0x53686a[_0x6ad8('0x49')](_0x11064f);_0x53686a['group']('i.id');var _0x561c53={'type':db[_0x6ad8('0x8d')]['QueryTypes'][_0x6ad8('0x8e')],'raw':!![]};var _0x1ae7ce=_0x53686a[_0x6ad8('0x8f')]();_0x1ae7ce['field'](_0x6ad8('0x90'));_0x1ae7ce['field'](_0x6ad8('0x91'),_0x6ad8('0x63'));if(_0x484b87[_0x6ad8('0x47')]){_0x484b87[_0x6ad8('0x47')][_0x6ad8('0x37')](function(_0xb9bcaf){var _0x12e6b1=_0xb9bcaf[0x0]==='contactName'?_0xb9bcaf[0x0]:'i.'+_0xb9bcaf[0x0];_0x53686a['order'](_0x12e6b1,_0xb9bcaf[0x1]===_0x6ad8('0x92')?![]:!![]);});}if(!_[_0x6ad8('0x77')](_0x3b4ba8)){_0x53686a[_0x6ad8('0x65')](_0x3cafd8);_0x1ae7ce[_0x6ad8('0x49')](_0x6ad8('0x93'),_0x3b4ba8);}BPromise[_0x6ad8('0x94')]()[_0x6ad8('0x2c')](function(){if(!_0x34cd13){if(_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x78')])return;_0x1ae7ce[_0x6ad8('0x49')](_0x6ad8('0x95'));_0x53686a[_0x6ad8('0x49')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4bdf37['user']['role']!==_0x6ad8('0x96'))return;return _0x4bdf37['user'][_0x6ad8('0x97')]({'attributes':['id'],'raw':!![]})[_0x6ad8('0x2c')](function(_0x1d199b){if(_[_0x6ad8('0x77')](_0x1d199b)){_0x1ae7ce[_0x6ad8('0x49')](_0x6ad8('0x98'));_0x53686a['where'](_0x6ad8('0x98'));}else{_0x1ae7ce[_0x6ad8('0x49')](_0x6ad8('0x79'),_[_0x6ad8('0x33')](_0x1d199b,'id'));_0x53686a[_0x6ad8('0x49')](_0x6ad8('0x79'),_[_0x6ad8('0x33')](_0x1d199b,'id'));}});})[_0x6ad8('0x2c')](function(){if(_0x4bdf37[_0x6ad8('0x99')][_0x6ad8('0x9a')]===_0x6ad8('0x96')&&!_0x34cd13&&!_0x4bdf37[_0x6ad8('0x40')][_0x6ad8('0x78')])return[];return db[_0x6ad8('0x9b')]['query'](_0x1ae7ce[_0x6ad8('0x9c')](),_0x561c53);})[_0x6ad8('0x2c')](function(_0x6408c){_0xee9623[_0x6ad8('0x25')]=_0x6408c['length'];if(_0xee9623['count']===0x0)return[];return db[_0x6ad8('0x9b')]['query'](_0x1c4529[_0x6ad8('0x9c')](),_0x561c53)[_0x6ad8('0x2c')](function(_0x20ad98){_0x12005f=_['keyBy'](_0x20ad98,'id');_0x561c53=_[_0x6ad8('0x9d')](_0x561c53,{'model':db[_0x6ad8('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bdf37[_0x6ad8('0x40')]['fields']){_0x484b87['attributes'][_0x6ad8('0x37')](function(_0x43398b){_0x53686a[_0x6ad8('0x4b')]('i.'+_0x43398b);});}else{_0x53686a[_0x6ad8('0x4b')](_0x6ad8('0x91'),_0x6ad8('0x63'));_0x53686a[_0x6ad8('0x4b')]('a.key',_0x6ad8('0x9e'));_0x53686a[_0x6ad8('0x4b')]('a.mandatoryDisposition',_0x6ad8('0x9f'));_0x53686a[_0x6ad8('0x4b')](_0x6ad8('0xa0'),_0x6ad8('0xa1'));_0x53686a[_0x6ad8('0x4b')](_0x6ad8('0xa2'));_0x53686a['field']('c.firstName',_0x6ad8('0xa3'));_0x53686a[_0x6ad8('0x4b')](_0x6ad8('0xa4'),_0x6ad8('0xa5'));_0x53686a[_0x6ad8('0x4b')](_0x6ad8('0xa6'),_0x6ad8('0xa7'));_0x53686a['field'](_0x6ad8('0xa8'),'Contact.phone');_0x53686a[_0x6ad8('0x4b')](_0x6ad8('0xa9'),_0x6ad8('0xaa'));_0x53686a[_0x6ad8('0x4b')](_0x6ad8('0xab'),'Contact.fax');_0x53686a['field']('o.fullname','Owner.fullname');_0x53686a['field']('o.internal','Owner.internal');_0x53686a['field'](_0x6ad8('0xac'),_0x6ad8('0x36'));}if(_0x484b87[_0x6ad8('0x24')])_0x53686a['limit'](_0x484b87[_0x6ad8('0x24')]);if(_0x484b87['offset'])_0x53686a[_0x6ad8('0x22')](_0x484b87[_0x6ad8('0x22')]);return db[_0x6ad8('0x9b')][_0x6ad8('0x40')](_0x53686a[_0x6ad8('0x9c')](),_0x561c53);})[_0x6ad8('0x2c')](function(_0x33211c){if(_0x33211c['length']>0x0)_0x205506[_0x6ad8('0x49')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x6ad8('0x33')](_0x33211c,'id'));return db[_0x6ad8('0x9b')][_0x6ad8('0x40')](_0x205506[_0x6ad8('0x9c')](),_0x561c53)[_0x6ad8('0x2c')](function(_0x4d15f1){var _0x372474=_['groupBy'](_0x4d15f1,_0x6ad8('0xad'));var _0xcfbdb5=[];_0x33211c['forEach'](function(_0x294354){_0xcfbdb5['push'](updateOpenchannelInteraction(_0x294354,_0x12005f,_0x372474));});return BPromise[_0x6ad8('0xae')](_0xcfbdb5);});});})[_0x6ad8('0x2c')](function(_0x47a777){_0xee9623[_0x6ad8('0xaf')]=_0x47a777;return _0xee9623;})[_0x6ad8('0x2c')](respondWithFilteredResult(_0x10ecb3,_0x484b87))[_0x6ad8('0x38')](handleError(_0x10ecb3,null));};exports[_0x6ad8('0xb0')]=function(_0x4d763f,_0xa7afe5){var _0x5f03c8={};if(_0x4d763f[_0x6ad8('0x40')][_0x6ad8('0x3d')]&&_0x4d763f[_0x6ad8('0x40')]['type']===_0x6ad8('0x50')){_0x5f03c8['from']=_0x4d763f[_0x6ad8('0xb1')]['id'];}else{_0x5f03c8['id']=_0x4d763f[_0x6ad8('0xb1')]['id'];}var _0x1d2930={'raw':![],'where':_0x5f03c8},_0x5dbecc={};_0x5dbecc[_0x6ad8('0x3f')]=_['keys'](db[_0x6ad8('0x3a')][_0x6ad8('0x3b')]);_0x5dbecc[_0x6ad8('0x40')]=_[_0x6ad8('0x41')](_0x4d763f[_0x6ad8('0x40')]);_0x5dbecc[_0x6ad8('0x42')]=_[_0x6ad8('0x43')](_0x5dbecc[_0x6ad8('0x3f')],_0x5dbecc[_0x6ad8('0x40')]);_0x1d2930[_0x6ad8('0x45')]=_[_0x6ad8('0x43')](_0x5dbecc[_0x6ad8('0x3f')],qs[_0x6ad8('0x44')](_0x4d763f[_0x6ad8('0x40')]['fields']));_0x1d2930[_0x6ad8('0x45')]=_0x1d2930[_0x6ad8('0x45')][_0x6ad8('0x46')]?_0x1d2930['attributes']:_0x5dbecc[_0x6ad8('0x3f')];if(_0x4d763f[_0x6ad8('0x40')][_0x6ad8('0xb2')]){_0x1d2930[_0x6ad8('0xb3')]=[{'all':!![]}];}_0x1d2930=_[_0x6ad8('0x9d')]({},_0x1d2930,_0x4d763f[_0x6ad8('0xb4')]);return db[_0x6ad8('0x3a')][_0x6ad8('0x62')](_0x1d2930)[_0x6ad8('0x2c')](handleEntityNotFound(_0xa7afe5,null))[_0x6ad8('0x2c')](respondWithResult(_0xa7afe5,null))['catch'](handleError(_0xa7afe5,null));};exports['create']=function(_0x3472cf,_0x4202ad){return db[_0x6ad8('0x3a')][_0x6ad8('0xb5')](_0x3472cf['body'],{})['then'](respondWithResult(_0x4202ad,0xc9))['catch'](handleError(_0x4202ad,null));};exports[_0x6ad8('0x2a')]=function(_0x34b3b6,_0x52c69c){if(_0x34b3b6[_0x6ad8('0x74')]['id']){delete _0x34b3b6[_0x6ad8('0x74')]['id'];}return db[_0x6ad8('0x3a')][_0x6ad8('0x62')]({'where':{'id':_0x34b3b6[_0x6ad8('0xb1')]['id']}})[_0x6ad8('0x2c')](handleEntityNotFound(_0x52c69c,null))['then'](saveUpdates(_0x34b3b6['body'],null))[_0x6ad8('0x2c')](respondWithResult(_0x52c69c,null))[_0x6ad8('0x38')](handleError(_0x52c69c,null));};exports[_0x6ad8('0x2b')]=function(_0x32a5b9,_0x2a7ea9){return db[_0x6ad8('0x3a')]['find']({'where':{'id':_0x32a5b9[_0x6ad8('0xb1')]['id']}})['then'](handleEntityNotFound(_0x2a7ea9,null))['then'](removeEntity(_0x2a7ea9,null))[_0x6ad8('0x38')](handleError(_0x2a7ea9,null));};exports['describe']=function(_0x359e44,_0x6ca1f){return db[_0x6ad8('0x3a')][_0x6ad8('0xb6')]()['then'](respondWithResult(_0x6ca1f,null))[_0x6ad8('0x38')](handleError(_0x6ca1f,null));};exports['addMessage']=function(_0x43c63a,_0x37061f,_0x248065){return db[_0x6ad8('0xb7')][_0x6ad8('0x62')]({'where':{'id':_0x43c63a[_0x6ad8('0xb1')]['id']}})[_0x6ad8('0x2c')](handleEntityNotFound(_0x37061f,null))['then'](function(_0x5123f6){if(_0x5123f6){return _0x5123f6[_0x6ad8('0xb8')](_0x43c63a['body'][_0x6ad8('0xb9')],_[_0x6ad8('0xba')](_0x43c63a[_0x6ad8('0x74')],[_0x6ad8('0xb9'),'id'])||{});}})[_0x6ad8('0x2c')](respondWithResult(_0x37061f,null))[_0x6ad8('0x38')](handleError(_0x37061f,null));};exports[_0x6ad8('0xbb')]=function(_0x326d09,_0x454f25,_0xad183f){var _0x4fb5a4={'raw':![],'where':{}};var _0x566f3f={};var _0x4251f5={'count':0x0,'rows':[]};return db[_0x6ad8('0x3a')][_0x6ad8('0xbc')]({'where':{'id':_0x326d09[_0x6ad8('0xb1')]['id']}})[_0x6ad8('0x2c')](handleEntityNotFound(_0x454f25,null))[_0x6ad8('0x2c')](function(_0x1d9a88){if(_0x1d9a88){_0x566f3f[_0x6ad8('0x3f')]=_[_0x6ad8('0x41')](db[_0x6ad8('0xb7')][_0x6ad8('0x3b')]);_0x566f3f[_0x6ad8('0x40')]=_[_0x6ad8('0x41')](_0x326d09[_0x6ad8('0x40')]);_0x566f3f[_0x6ad8('0x42')]=_[_0x6ad8('0x43')](_0x566f3f[_0x6ad8('0x3f')],_0x566f3f[_0x6ad8('0x40')]);_0x4fb5a4[_0x6ad8('0x45')]=_['intersection'](_0x566f3f['model'],qs[_0x6ad8('0x44')](_0x326d09['query'][_0x6ad8('0x44')]));_0x4fb5a4[_0x6ad8('0x45')]=_0x4fb5a4['attributes'][_0x6ad8('0x46')]?_0x4fb5a4[_0x6ad8('0x45')]:_0x566f3f[_0x6ad8('0x3f')];if(!_0x326d09[_0x6ad8('0x40')][_0x6ad8('0xbd')](_0x6ad8('0xbe'))){_0x4fb5a4['limit']=qs[_0x6ad8('0x24')](_0x326d09['query'][_0x6ad8('0x24')]);_0x4fb5a4[_0x6ad8('0x22')]=qs[_0x6ad8('0x22')](_0x326d09[_0x6ad8('0x40')]['offset']);}_0x4fb5a4['order']=qs[_0x6ad8('0x48')](_0x326d09['query'][_0x6ad8('0x48')]);_0x4fb5a4['where']=qs[_0x6ad8('0x42')](_['pick'](_0x326d09['query'],_0x566f3f[_0x6ad8('0x42')]));_0x4fb5a4[_0x6ad8('0x49')]['OpenchannelInteractionId']=_0x1d9a88['id'];if(_0x326d09[_0x6ad8('0x40')]['filter']){_0x4fb5a4[_0x6ad8('0x49')]=_[_0x6ad8('0x9d')](_0x4fb5a4[_0x6ad8('0x49')],{'$or':_['map'](_0x4fb5a4[_0x6ad8('0x45')],function(_0x5adcf8){var _0x4b3a1f={};_0x4b3a1f[_0x5adcf8]={'$like':'%'+_0x326d09[_0x6ad8('0x40')]['filter']+'%'};return _0x4b3a1f;})});}if(_0x326d09[_0x6ad8('0x40')]['$gte']){var _0x15826b=_0x326d09[_0x6ad8('0x40')][_0x6ad8('0x7c')]['split'](',');var _0x3928b5={};_0x3928b5[_0x15826b[0x0]]={'$gte':moment(_0x15826b[0x1])[_0x6ad8('0xbf')](_0x6ad8('0xc0'))};_0x4fb5a4[_0x6ad8('0x49')]=_[_0x6ad8('0x9d')](_0x4fb5a4[_0x6ad8('0x49')],_0x3928b5);}_0x4fb5a4=_[_0x6ad8('0x9d')]({},_0x4fb5a4,_0x326d09[_0x6ad8('0xb4')]);return db[_0x6ad8('0xb7')][_0x6ad8('0x25')]({'where':_0x4fb5a4[_0x6ad8('0x49')]})[_0x6ad8('0x2c')](function(_0x2dc05a){_0x4251f5['count']=_0x2dc05a;if(_0x326d09[_0x6ad8('0x40')]['includeAll']){_0x4fb5a4[_0x6ad8('0xb3')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6ad8('0xc1')](_0x4fb5a4);})[_0x6ad8('0x2c')](function(_0x907c4b){_0x4251f5[_0x6ad8('0xaf')]=_0x907c4b;return _0x4251f5;});}})['then'](respondWithFilteredResult(_0x454f25,_0x4fb5a4))['catch'](handleError(_0x454f25,null));};exports['addTags']=function(_0x5ad34a,_0x3dc85e,_0x3f5b7e){return db[_0x6ad8('0x3a')][_0x6ad8('0x62')]({'where':{'id':_0x5ad34a['params']['id']}})[_0x6ad8('0x2c')](handleEntityNotFound(_0x3dc85e,null))['then'](function(_0x5d2475){if(_0x5d2475){return _0x5d2475[_0x6ad8('0xc2')](_0x5ad34a[_0x6ad8('0x74')][_0x6ad8('0xb9')],_[_0x6ad8('0xba')](_0x5ad34a[_0x6ad8('0x74')],[_0x6ad8('0xb9'),'id'])||{})[_0x6ad8('0xc3')](function(){return db['Tag'][_0x6ad8('0xc1')]({'attributes':['id',_0x6ad8('0x30'),'color'],'where':{'id':_0x5ad34a['body']['ids']}});})['then'](function(_0x4fee23){socket['emit'](_0x6ad8('0xc4'),{'id':Number(_0x5ad34a['params']['id']),'tags':_0x4fee23||[]});return{'id':Number(_0x5ad34a[_0x6ad8('0xb1')]['id']),'tags':_0x4fee23||[]};});}})[_0x6ad8('0x2c')](respondWithResult(_0x3dc85e,null))[_0x6ad8('0x38')](handleError(_0x3dc85e,null));};exports[_0x6ad8('0xc5')]=function(_0x23526f,_0x5a88e4,_0xb53020){return db[_0x6ad8('0x3a')]['find']({'where':{'id':_0x23526f['params']['id']}})[_0x6ad8('0x2c')](handleEntityNotFound(_0x5a88e4,null))[_0x6ad8('0x2c')](function(_0x709f3c){if(_0x709f3c){return _0x709f3c[_0x6ad8('0xc5')](_0x23526f['query'][_0x6ad8('0xb9')]);}})['then'](respondWithStatusCode(_0x5a88e4,null))[_0x6ad8('0x38')](handleError(_0x5a88e4,null));};exports['download']=function(_0x17081e,_0x1368b1){var _0x114506=moment()[_0x6ad8('0xc6')]()[_0x6ad8('0x9c')]();var _0x5d5c7a=path[_0x6ad8('0xc7')](config[_0x6ad8('0xc8')],_0x6ad8('0xc9'),_0x6ad8('0xca'),_0x6ad8('0xcb'));var _0x2b4e93=path[_0x6ad8('0xc7')](config[_0x6ad8('0xc8')],_0x6ad8('0xc9'),_0x6ad8('0xca'),_0x6ad8('0xcc'));var _0x37eb38=path[_0x6ad8('0xc7')](_0x5d5c7a,_0x114506);var _0xfe416d=util[_0x6ad8('0xbf')](_0x6ad8('0xcd'),_0x17081e['params']['id'],_0x114506);var _0x83592a=path[_0x6ad8('0xc7')](_0x5d5c7a,_0xfe416d);var _0x5a6b76=[];_0x5a6b76[_0x6ad8('0xce')]({'model':db[_0x6ad8('0x71')],'as':_0x6ad8('0x71'),'attributes':['id',_0x6ad8('0x34')],'raw':!![]});_0x5a6b76['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x6ad8('0xcf'),'lastName'],'raw':!![]});if(_0x17081e['query']['attachments']){_0x5a6b76[_0x6ad8('0xce')]({'model':db[_0x6ad8('0xd0')],'as':_0x6ad8('0xd0'),'raw':!![]});}var _0x3370e5=[{'model':db['OpenchannelMessage'],'as':_0x6ad8('0xd1'),'attributes':['id',_0x6ad8('0x74'),_0x6ad8('0x7b'),'direction',_0x6ad8('0xd2'),_0x6ad8('0x82')],'include':_0x5a6b76}];_0x3370e5[_0x6ad8('0xce')]({'model':db[_0x6ad8('0xd3')],'as':'Account','attributes':['id','name']});_0x3370e5['push']({'model':db[_0x6ad8('0x71')],'as':_0x6ad8('0xd4'),'attributes':['id',_0x6ad8('0x34')]});return db[_0x6ad8('0x3a')][_0x6ad8('0x62')]({'where':{'id':_0x17081e[_0x6ad8('0xb1')]['id']},'include':_0x3370e5})[_0x6ad8('0x2c')](handleEntityNotFound(_0x1368b1,null))[_0x6ad8('0x2c')](function(_0xdfc963){if(_0xdfc963){var _0xea2f59=_0xdfc963[_0x6ad8('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x37eb38);var _0x5bd310={'channel':_0x6ad8('0xd6'),'account':_0xea2f59[_0x6ad8('0xd7')][_0x6ad8('0x30')],'agent':_0xea2f59[_0x6ad8('0xd4')]?_0xea2f59[_0x6ad8('0xd4')][_0x6ad8('0x34')]:_0x6ad8('0xd8'),'createdAt':moment(_0xea2f59[_0x6ad8('0x7b')])[_0x6ad8('0xbf')](_0x6ad8('0xc0'))['toString'](),'closedAt':_0xea2f59['closed']?moment(_0xea2f59[_0x6ad8('0xd9')])[_0x6ad8('0xbf')](_0x6ad8('0xc0'))[_0x6ad8('0x9c')]():'','disposition':_0xea2f59['disposition'],'visibility':_0xea2f59[_0x6ad8('0xda')]?_0x6ad8('0xdb'):_0x6ad8('0xdc'),'messages':_(_0xea2f59['Messages'])[_0x6ad8('0x87')]({'secret':![]})[_0x6ad8('0x33')](function(_0x43e6f5){if(_0x43e6f5[_0x6ad8('0xd0')]){var _0x1284e9=path[_0x6ad8('0xc7')](_0x2b4e93,_0x43e6f5[_0x6ad8('0xd0')][_0x6ad8('0xdd')]);if(fs[_0x6ad8('0xde')](_0x1284e9)){fs[_0x6ad8('0xdf')](_0x1284e9)['pipe'](fs[_0x6ad8('0xe0')](path[_0x6ad8('0xc7')](_0x37eb38,_0x43e6f5[_0x6ad8('0xd0')]['basename'])));}}return{'date':moment(_0x43e6f5[_0x6ad8('0x7b')])[_0x6ad8('0xbf')](_0x6ad8('0xc0'))[_0x6ad8('0x9c')](),'sender':_0x43e6f5[_0x6ad8('0xe1')]===_0x6ad8('0xe2')?_0x43e6f5[_0x6ad8('0x71')]?_0x43e6f5[_0x6ad8('0x71')][_0x6ad8('0x34')]:'System':_0x43e6f5[_0x6ad8('0xe3')][_0x6ad8('0xcf')]+(_0x43e6f5[_0x6ad8('0xe3')][_0x6ad8('0xe4')]?'\x20'+_0x43e6f5[_0x6ad8('0xe3')][_0x6ad8('0xe4')]:''),'body':_0x43e6f5['Attachment']?_0x43e6f5['Attachment'][_0x6ad8('0xdd')]:_0x43e6f5[_0x6ad8('0x74')],'direction':_0x43e6f5[_0x6ad8('0xe1')]===_0x6ad8('0xe2')?'A':'C','secret':_0x43e6f5['secret'],'read':_0x43e6f5[_0x6ad8('0x82')],'attachment':_0x43e6f5['Attachment']};})['value']()};return ejs['renderFile'](path['join'](config['root'],_0x6ad8('0xc9'),_0x6ad8('0xe5'),_0x6ad8('0xe6')),{'interaction':_0x5bd310})[_0x6ad8('0x2c')](function(_0x13448d){var _0x12938c=path[_0x6ad8('0xc7')](_0x37eb38,_0x6ad8('0xe7')+_0xea2f59['id']+'-'+_0x114506+_0x6ad8('0xe8'));var _0x1a8dfe={'path':_0x12938c,'channel':_0x6ad8('0xd6'),'interactionId':_0xea2f59['id']};return pdf[_0x6ad8('0xe9')](_0x13448d,_0x1a8dfe);})[_0x6ad8('0x2c')](function(){return new BPromise(function(_0x22af98,_0x1df68e){zipdir(_0x37eb38,{'saveTo':_0x83592a},function(_0x3b27fd,_0x1ec887){if(_0x3b27fd)return _0x1df68e(_0x3b27fd);return _0x22af98(_0x1ec887);});})[_0x6ad8('0x2c')](function(){return new BPromise(function(_0x47fe8f,_0x144e90){rimraf(_0x37eb38,function(_0x573377){if(_0x573377)_0x144e90(_0x573377);return _0x47fe8f();});});})['then'](function(){return _0x1368b1[_0x6ad8('0xea')](_0x83592a,_0xfe416d,function(_0x1d89f2){if(_0x1d89f2){console[_0x6ad8('0xeb')](_0x6ad8('0xec'),_0x1d89f2);}else{fs['unlinkSync'](_0x83592a);}});});});}else{return _0x1368b1[_0x6ad8('0x2d')](0xc8);}})['catch'](handleError(_0x1368b1,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index fb948bc..58ee4d1 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 _0xbe67=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','save','getUsers','setDataValue','Users','findAll','then'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xbe67,0x15f));var _0x7be6=function(_0x391065,_0x2b25e6){_0x391065=_0x391065-0x0;var _0x226fc0=_0xbe67[_0x391065];return _0x226fc0;};'use strict';var EventEmitter=require(_0x7be6('0x0'));var OpenchannelInteraction=require(_0x7be6('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x7be6('0x1'))['db'][_0x7be6('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7be6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x43010d){return function(_0x11a2c3,_0x200603,_0x136d8f){_0x11a2c3[_0x7be6('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3a1e13){_0x11a2c3[_0x7be6('0x5')](_0x7be6('0x6'),_0x3a1e13['map'](function(_0x1dc658){return{'id':_0x1dc658['id']};}));return OpenchannelMessage[_0x7be6('0x7')]({'where':{'OpenchannelInteractionId':_0x11a2c3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7be6('0x8')](function(_0x32eb9c){_0x11a2c3[_0x7be6('0x5')](_0x7be6('0x9'),_0x32eb9c[_0x7be6('0xa')]);OpenchannelInteractionEvents[_0x7be6('0xb')](_0x43010d+':'+_0x11a2c3['id'],_0x11a2c3);OpenchannelInteractionEvents['emit'](_0x43010d,_0x11a2c3);_0x136d8f(null);})[_0x7be6('0xc')](_0x136d8f(null));};}for(var e in events){if(events[_0x7be6('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x7be6('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xe9f1=['then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xe9f1,0x1d0));var _0x1e9f=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xe9f1[_0x373dee];return _0x46798f;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x1e9f('0x0'))['db'][_0x1e9f('0x1')];var OpenchannelMessage=require(_0x1e9f('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1e9f('0x2')](0x0);var events={'afterCreate':_0x1e9f('0x3'),'afterUpdate':_0x1e9f('0x4'),'afterDestroy':_0x1e9f('0x5')};function emitEvent(_0x3cbf99){return function(_0x48ec50,_0x4a99e6,_0x166762){_0x48ec50[_0x1e9f('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x524acd){_0x48ec50[_0x1e9f('0x7')](_0x1e9f('0x8'),_0x524acd[_0x1e9f('0x9')](function(_0x4061a0){return{'id':_0x4061a0['id']};}));return OpenchannelMessage[_0x1e9f('0xa')]({'where':{'OpenchannelInteractionId':_0x48ec50['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1e9f('0xb')](function(_0x5dccc1){_0x48ec50[_0x1e9f('0x7')](_0x1e9f('0xc'),_0x5dccc1[_0x1e9f('0xd')]);OpenchannelInteractionEvents[_0x1e9f('0xe')](_0x3cbf99+':'+_0x48ec50['id'],_0x48ec50);OpenchannelInteractionEvents[_0x1e9f('0xe')](_0x3cbf99,_0x48ec50);_0x166762(null);})[_0x1e9f('0xf')](_0x166762(null));};}for(var e in events){if(events[_0x1e9f('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x1e9f('0x11')](e,emitEvent(event));}}module[_0x1e9f('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index cf42825..a263d4a 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 _0x2365=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2365,0x12c));var _0x5236=function(_0x44606e,_0x3aa901){_0x44606e=_0x44606e-0x0;var _0x4bd104=_0x2365[_0x44606e];return _0x4bd104;};'use strict';var _=require(_0x5236('0x0'));var util=require(_0x5236('0x1'));var logger=require(_0x5236('0x2'))('api');var moment=require(_0x5236('0x3'));var BPromise=require('bluebird');var rp=require(_0x5236('0x4'));var fs=require('fs');var path=require(_0x5236('0x5'));var rimraf=require('rimraf');var config=require(_0x5236('0x6'));var attributes=require(_0x5236('0x7'));module[_0x5236('0x8')]=function(_0x2adc60,_0x34efc4){return _0x2adc60[_0x5236('0x9')](_0x5236('0xa'),attributes,{'tableName':_0x5236('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5236('0xc'),'hooks':{'beforeUpdate':function(_0x34f573,_0x7d43c,_0x20da4c){if(_0x34f573[_0x5236('0xd')](_0x5236('0xe'))){_0x34f573[_0x5236('0xf')]=moment()[_0x5236('0x10')](_0x5236('0x11'));}_0x20da4c(null,_0x34f573);}}});}; \ No newline at end of file +var _0x6144=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format'];(function(_0x1aedfe,_0x56c6ca){var _0x264539=function(_0x36d18e){while(--_0x36d18e){_0x1aedfe['push'](_0x1aedfe['shift']());}};_0x264539(++_0x56c6ca);}(_0x6144,0x99));var _0x4614=function(_0x5053f2,_0x49c4aa){_0x5053f2=_0x5053f2-0x0;var _0x431519=_0x6144[_0x5053f2];return _0x431519;};'use strict';var _=require(_0x4614('0x0'));var util=require(_0x4614('0x1'));var logger=require(_0x4614('0x2'))(_0x4614('0x3'));var moment=require('moment');var BPromise=require(_0x4614('0x4'));var rp=require(_0x4614('0x5'));var fs=require('fs');var path=require(_0x4614('0x6'));var rimraf=require(_0x4614('0x7'));var config=require('../../config/environment');var attributes=require(_0x4614('0x8'));module[_0x4614('0x9')]=function(_0x40832b,_0x935177){return _0x40832b[_0x4614('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0x4614('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4614('0xc'),'collate':_0x4614('0xd'),'hooks':{'beforeUpdate':function(_0x13b585,_0x54d480,_0x3c3afa){if(_0x13b585[_0x4614('0xe')](_0x4614('0xf'))){_0x13b585[_0x4614('0x10')]=moment()[_0x4614('0x11')](_0x4614('0x12'));}_0x3c3afa(null,_0x13b585);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 864656e..129a528 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 _0x6105=['where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw'];(function(_0x3ff66c,_0x388426){var _0x8cab83=function(_0x165a9c){while(--_0x165a9c){_0x3ff66c['push'](_0x3ff66c['shift']());}};_0x8cab83(++_0x388426);}(_0x6105,0xb7));var _0x5610=function(_0x345f32,_0x4d866a){_0x345f32=_0x345f32-0x0;var _0x267146=_0x6105[_0x345f32];return _0x267146;};'use strict';var _=require(_0x5610('0x0'));var util=require(_0x5610('0x1'));var moment=require('moment');var BPromise=require(_0x5610('0x2'));var rs=require(_0x5610('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5610('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5610('0x5'))(_0x5610('0x6'));var config=require('../../config/environment');var jayson=require(_0x5610('0x7'));var client=jayson[_0x5610('0x8')][_0x5610('0x9')]({'port':0x232a});config['redis']=_[_0x5610('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5610('0xb'))(new Redis(config['redis']));require(_0x5610('0xc'))[_0x5610('0xd')](socket);function respondWithRpcPromise(_0x59a31d,_0x46b92c,_0xe4fa35){return new BPromise(function(_0x386f5a,_0xeec219){return client[_0x5610('0xe')](_0x59a31d,_0xe4fa35)[_0x5610('0xf')](function(_0x5ad738){logger[_0x5610('0x10')](_0x5610('0x11'),_0x46b92c,_0x5610('0x12'));logger[_0x5610('0x13')](_0x5610('0x14'),_0x46b92c,_0x5610('0x12'),JSON[_0x5610('0x15')](_0x5ad738));if(_0x5ad738[_0x5610('0x16')]){if(_0x5ad738[_0x5610('0x16')][_0x5610('0x17')]===0x1f4){logger[_0x5610('0x16')](_0x5610('0x11'),_0x46b92c,_0x5ad738[_0x5610('0x16')]['message']);return _0xeec219(_0x5ad738[_0x5610('0x16')][_0x5610('0x18')]);}logger[_0x5610('0x16')](_0x5610('0x11'),_0x46b92c,_0x5ad738[_0x5610('0x16')][_0x5610('0x18')]);return _0x386f5a(_0x5ad738[_0x5610('0x16')][_0x5610('0x18')]);}else{logger[_0x5610('0x10')](_0x5610('0x11'),_0x46b92c,_0x5610('0x12'));_0x386f5a(_0x5ad738[_0x5610('0x19')][_0x5610('0x18')]);}})[_0x5610('0x1a')](function(_0x9acf54){logger[_0x5610('0x16')](_0x5610('0x11'),_0x46b92c,_0x9acf54);_0xeec219(_0x9acf54);});});}exports[_0x5610('0x1b')]=function(_0x25af18){var _0x1790ca=this;return new Promise(function(_0xd0fde8,_0x48573e){return db[_0x5610('0x1c')][_0x5610('0x1d')](_0x25af18['body'],{'raw':_0x25af18[_0x5610('0x1e')]?_0x25af18[_0x5610('0x1e')][_0x5610('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25af18['options']?_0x25af18[_0x5610('0x1e')][_0x5610('0x20')]||null:null,'attributes':_0x25af18[_0x5610('0x1e')]?_0x25af18[_0x5610('0x1e')][_0x5610('0x21')]||null:null,'limit':_0x25af18['options']?_0x25af18[_0x5610('0x1e')][_0x5610('0x22')]||null:null})[_0x5610('0xf')](function(_0x2dd1c7){logger[_0x5610('0x10')](_0x5610('0x1b'),_0x25af18);logger[_0x5610('0x13')]('UpdateOpenchannelInteraction',_0x25af18,JSON[_0x5610('0x15')](_0x2dd1c7));_0xd0fde8(_0x2dd1c7);})[_0x5610('0x1a')](function(_0x312dae){logger['error'](_0x5610('0x1b'),_0x312dae['message'],_0x25af18);_0x48573e(_0x1790ca[_0x5610('0x16')](0x1f4,_0x312dae[_0x5610('0x18')]));});});};exports[_0x5610('0x23')]=function(_0x13623e){return new Promise(function(_0x19af32,_0xd10272){return db[_0x5610('0x1c')][_0x5610('0x24')]({'where':_0x13623e[_0x5610('0x1e')]?_0x13623e[_0x5610('0x1e')][_0x5610('0x20')]||null:null})[_0x5610('0xf')](function(_0x524771){if(_0x524771){return _0x524771[_0x5610('0x25')](_0x13623e[_0x5610('0x26')][_0x5610('0x27')],_[_0x5610('0x28')](_0x13623e[_0x5610('0x26')],[_0x5610('0x27'),'id'])||{});}})[_0x5610('0x29')](function(_0x345c15){logger[_0x5610('0x10')](_0x5610('0x2a'),_0x13623e);logger['debug']('AddTags',_0x13623e,JSON[_0x5610('0x15')](_0x345c15));_0x19af32(_0x345c15);})[_0x5610('0x1a')](function(_0x155a93){logger[_0x5610('0x16')](_0x5610('0x2a'),_0x155a93[_0x5610('0x18')],_0x13623e);_0xd10272(_this[_0x5610('0x16')](0x1f4,_0x155a93[_0x5610('0x18')]));});});}; \ No newline at end of file +var _0x8952=['result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x2e0ce1,_0x471bf4){var _0x34b69b=function(_0x1d1cfb){while(--_0x1d1cfb){_0x2e0ce1['push'](_0x2e0ce1['shift']());}};_0x34b69b(++_0x471bf4);}(_0x8952,0x1d8));var _0x2895=function(_0x485172,_0x58eb58){_0x485172=_0x485172-0x0;var _0x28a077=_0x8952[_0x485172];return _0x28a077;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require('bluebird');var rs=require(_0x2895('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2895('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2895('0x4'));var config=require(_0x2895('0x5'));var jayson=require(_0x2895('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x2895('0x7')]=_['defaults'](config['redis'],{'host':_0x2895('0x8'),'port':0x18eb});var socket=require(_0x2895('0x9'))(new Redis(config[_0x2895('0x7')]));require(_0x2895('0xa'))[_0x2895('0xb')](socket);function respondWithRpcPromise(_0x1f72c8,_0xedffa2,_0x6cf75f){return new BPromise(function(_0x31705a,_0x23a06e){return client[_0x2895('0xc')](_0x1f72c8,_0x6cf75f)[_0x2895('0xd')](function(_0x4a42ac){logger['info'](_0x2895('0xe'),_0xedffa2,'request\x20sent');logger[_0x2895('0xf')](_0x2895('0x10'),_0xedffa2,_0x2895('0x11'),JSON['stringify'](_0x4a42ac));if(_0x4a42ac['error']){if(_0x4a42ac[_0x2895('0x12')][_0x2895('0x13')]===0x1f4){logger[_0x2895('0x12')](_0x2895('0xe'),_0xedffa2,_0x4a42ac[_0x2895('0x12')][_0x2895('0x14')]);return _0x23a06e(_0x4a42ac['error']['message']);}logger[_0x2895('0x12')](_0x2895('0xe'),_0xedffa2,_0x4a42ac[_0x2895('0x12')][_0x2895('0x14')]);return _0x31705a(_0x4a42ac['error'][_0x2895('0x14')]);}else{logger[_0x2895('0x15')](_0x2895('0xe'),_0xedffa2,_0x2895('0x11'));_0x31705a(_0x4a42ac[_0x2895('0x16')][_0x2895('0x14')]);}})['catch'](function(_0x266d08){logger[_0x2895('0x12')](_0x2895('0xe'),_0xedffa2,_0x266d08);_0x23a06e(_0x266d08);});});}exports[_0x2895('0x17')]=function(_0x251eef){var _0x90c9bf=this;return new Promise(function(_0x55e239,_0x470061){return db[_0x2895('0x18')]['update'](_0x251eef[_0x2895('0x19')],{'raw':_0x251eef[_0x2895('0x1a')]?_0x251eef['options'][_0x2895('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x251eef[_0x2895('0x1a')]?_0x251eef[_0x2895('0x1a')][_0x2895('0x1c')]||null:null,'attributes':_0x251eef[_0x2895('0x1a')]?_0x251eef['options'][_0x2895('0x1d')]||null:null,'limit':_0x251eef['options']?_0x251eef[_0x2895('0x1a')][_0x2895('0x1e')]||null:null})[_0x2895('0xd')](function(_0xcf68ba){logger[_0x2895('0x15')]('UpdateOpenchannelInteraction',_0x251eef);logger['debug'](_0x2895('0x17'),_0x251eef,JSON[_0x2895('0x1f')](_0xcf68ba));_0x55e239(_0xcf68ba);})['catch'](function(_0x1468f8){logger[_0x2895('0x12')](_0x2895('0x17'),_0x1468f8[_0x2895('0x14')],_0x251eef);_0x470061(_0x90c9bf['error'](0x1f4,_0x1468f8['message']));});});};exports[_0x2895('0x20')]=function(_0x23de08){return new Promise(function(_0x1dff06,_0x5682d8){return db[_0x2895('0x18')][_0x2895('0x21')]({'where':_0x23de08['options']?_0x23de08[_0x2895('0x1a')][_0x2895('0x1c')]||null:null})['then'](function(_0x3787d5){if(_0x3787d5){return _0x3787d5[_0x2895('0x22')](_0x23de08['body'][_0x2895('0x23')],_['omit'](_0x23de08[_0x2895('0x19')],[_0x2895('0x23'),'id'])||{});}})[_0x2895('0x24')](function(_0x510631){logger[_0x2895('0x15')](_0x2895('0x25'),_0x23de08);logger[_0x2895('0xf')](_0x2895('0x25'),_0x23de08,JSON[_0x2895('0x1f')](_0x510631));_0x1dff06(_0x510631);})['catch'](function(_0x21c5ba){logger[_0x2895('0x12')]('AddTags',_0x21c5ba[_0x2895('0x14')],_0x23de08);_0x5682d8(_this[_0x2895('0x12')](0x1f4,_0x21c5ba['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 4253154..f3b4b4e 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 _0x5574=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x5574,0xa6));var _0x4557=function(_0x3309e6,_0x5dcc7c){_0x3309e6=_0x3309e6-0x0;var _0x5219a5=_0x5574[_0x3309e6];return _0x5219a5;};'use strict';var OpenchannelInteractionEvents=require(_0x4557('0x0'));var events=[_0x4557('0x1'),_0x4557('0x2'),_0x4557('0x3')];function createListener(_0x400a9d,_0x3a968f){return function(_0xf6fd46){_0x3a968f[_0x4557('0x4')](_0x400a9d,_0xf6fd46);};}function removeListener(_0x4ada44,_0x5b3c67){return function(){OpenchannelInteractionEvents[_0x4557('0x5')](_0x4ada44,_0x5b3c67);};}exports[_0x4557('0x6')]=function(_0x59d072){for(var _0x2c8243=0x0,_0x256992=events[_0x4557('0x7')];_0x2c8243<_0x256992;_0x2c8243++){var _0x26bea1=events[_0x2c8243];var _0x20e971=createListener(_0x4557('0x8')+_0x26bea1,_0x59d072);OpenchannelInteractionEvents['on'](_0x26bea1,_0x20e971);}}; \ No newline at end of file +var _0x4f46=['save','remove','update','emit','removeListener','register','length'];(function(_0x21d45c,_0x589660){var _0xd30a97=function(_0x40514f){while(--_0x40514f){_0x21d45c['push'](_0x21d45c['shift']());}};_0xd30a97(++_0x589660);}(_0x4f46,0xf5));var _0x64f4=function(_0x5de967,_0x515918){_0x5de967=_0x5de967-0x0;var _0x5b07a3=_0x4f46[_0x5de967];return _0x5b07a3;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x64f4('0x0'),_0x64f4('0x1'),_0x64f4('0x2')];function createListener(_0x5361a7,_0x4371b2){return function(_0x2b1af5){_0x4371b2[_0x64f4('0x3')](_0x5361a7,_0x2b1af5);};}function removeListener(_0x5b49a5,_0x21bb19){return function(){OpenchannelInteractionEvents[_0x64f4('0x4')](_0x5b49a5,_0x21bb19);};}exports[_0x64f4('0x5')]=function(_0x196c6f){for(var _0x58029a=0x0,_0x42ef8e=events[_0x64f4('0x6')];_0x58029a<_0x42ef8e;_0x58029a++){var _0x17c74=events[_0x58029a];var _0xf3425=createListener('openchannelInteraction:'+_0x17c74,_0x196c6f);OpenchannelInteractionEvents['on'](_0x17c74,_0xf3425);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 79901de..7540b0a 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 _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0xae1364,_0x44863f){var _0x55104f=function(_0x83d4f1){while(--_0x83d4f1){_0xae1364['push'](_0xae1364['shift']());}};_0x55104f(++_0x44863f);}(_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('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 8642688..defc0e8 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 _0x9d5b=['BOOLEAN','out','DATE','STRING','exports','TEXT','medium'];(function(_0x2f1cc2,_0x405f6c){var _0x2273c7=function(_0x4c5a8f){while(--_0x4c5a8f){_0x2f1cc2['push'](_0x2f1cc2['shift']());}};_0x2273c7(++_0x405f6c);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x5b3c24,_0x3bd2ed){_0x5b3c24=_0x5b3c24-0x0;var _0x4b397f=_0x9d5b[_0x5b3c24];return _0x4b397f;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'body':{'type':Sequelize[_0xb9d5('0x1')](_0xb9d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9d5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb9d5('0x5')]},'providerName':{'type':Sequelize[_0xb9d5('0x6')]},'providerResponse':{'type':Sequelize[_0xb9d5('0x1')]}}; \ No newline at end of file +var _0x693f=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0xc56aa9,_0x34ec6c){var _0x139406=function(_0xf23ae4){while(--_0xf23ae4){_0xc56aa9['push'](_0xc56aa9['shift']());}};_0x139406(++_0x34ec6c);}(_0x693f,0x9d));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf693('0x0'));module[_0xf693('0x1')]={'body':{'type':Sequelize[_0xf693('0x2')](_0xf693('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf693('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf693('0x5')]('in',_0xf693('0x6')),'defaultValue':_0xf693('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf693('0x7')]},'providerName':{'type':Sequelize[_0xf693('0x8')]},'providerResponse':{'type':Sequelize[_0xf693('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 4eb76df..3601983 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 _0xc4bd=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','offset','undefined','limit','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','create','body','find','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','internal','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x2d0fb9,_0xe9db88){var _0x5be565=function(_0x2bf5e5){while(--_0x2bf5e5){_0x2d0fb9['push'](_0x2d0fb9['shift']());}};_0x5be565(++_0xe9db88);}(_0xc4bd,0x75));var _0xdc4b=function(_0x4ad02a,_0x3ee848){_0x4ad02a=_0x4ad02a-0x0;var _0x359e84=_0xc4bd[_0x4ad02a];return _0x359e84;};'use strict';var emlformat=require(_0xdc4b('0x0'));var rimraf=require(_0xdc4b('0x1'));var zipdir=require(_0xdc4b('0x2'));var jsonpatch=require(_0xdc4b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdc4b('0x4'));var Mustache=require(_0xdc4b('0x5'));var util=require(_0xdc4b('0x6'));var path=require(_0xdc4b('0x7'));var sox=require(_0xdc4b('0x8'));var csv=require(_0xdc4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc4b('0xa'));var squel=require(_0xdc4b('0xb'));var crypto=require(_0xdc4b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdc4b('0xd'));var toCsv=require(_0xdc4b('0x9'));var querystring=require(_0xdc4b('0xe'));var Papa=require(_0xdc4b('0xf'));var Redis=require(_0xdc4b('0x10'));var authService=require(_0xdc4b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdc4b('0x12'));var hardwareService=require(_0xdc4b('0x13'));var logger=require(_0xdc4b('0x14'))('api');var utils=require(_0xdc4b('0x15'));var config=require(_0xdc4b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc4b('0x17'))['db'];config[_0xdc4b('0x18')]=_[_0xdc4b('0x19')](config[_0xdc4b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc4b('0x1a'))(new Redis(config[_0xdc4b('0x18')]));require(_0xdc4b('0x1b'))[_0xdc4b('0x1c')](socket);var jayson=require(_0xdc4b('0x1d'));var client=jayson['client'][_0xdc4b('0x1e')]({'port':0x232c});var client9002=jayson[_0xdc4b('0x1f')][_0xdc4b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1817ae,_0x1d23ff,_0x595f5d,_0x32e25c){return new BPromise(function(_0x3b08c7,_0x463182){var _0x36db2c=_0x32e25c||client;return _0x36db2c[_0xdc4b('0x20')](_0x1817ae,_0x595f5d)[_0xdc4b('0x21')](function(_0x1d49f0){logger[_0xdc4b('0x22')](_0xdc4b('0x23'),_0x1d23ff,_0xdc4b('0x24'));logger[_0xdc4b('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1d23ff,_0xdc4b('0x24'),JSON[_0xdc4b('0x26')](_0x1d49f0));if(_0x1d49f0['error']){if(_0x1d49f0[_0xdc4b('0x27')][_0xdc4b('0x28')]===0x1f4){logger[_0xdc4b('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d23ff,_0x1d49f0[_0xdc4b('0x27')][_0xdc4b('0x29')]);return _0x463182(_0x1d49f0[_0xdc4b('0x27')][_0xdc4b('0x29')]);}logger[_0xdc4b('0x27')](_0xdc4b('0x23'),_0x1d23ff,_0x1d49f0[_0xdc4b('0x27')][_0xdc4b('0x29')]);return _0x3b08c7(_0x1d49f0['error'][_0xdc4b('0x29')]);}else{logger[_0xdc4b('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d23ff,_0xdc4b('0x24'));_0x3b08c7(_0x1d49f0[_0xdc4b('0x2a')][_0xdc4b('0x29')]);}})['catch'](function(_0x26c492){logger[_0xdc4b('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d23ff,_0x26c492);_0x463182(_0x26c492);});});}function respondWithStatusCode(_0x542dbc,_0x5ba65a){_0x5ba65a=_0x5ba65a||0xcc;return function(_0x966e7f){if(_0x966e7f){return _0x542dbc['sendStatus'](_0x5ba65a);}return _0x542dbc[_0xdc4b('0x2b')](_0x5ba65a)[_0xdc4b('0x2c')]();};}function respondWithResult(_0x230393,_0x4b7b26){_0x4b7b26=_0x4b7b26||0xc8;return function(_0x37eefc){if(_0x37eefc){return _0x230393['status'](_0x4b7b26)['json'](_0x37eefc);}};}function respondWithFilteredResult(_0x910415,_0x9a99b7){return function(_0x19f585){if(_0x19f585){var _0x48f578=typeof _0x9a99b7[_0xdc4b('0x2d')]===_0xdc4b('0x2e')&&typeof _0x9a99b7['limit']==='undefined';var _0x51c017=_0x19f585['count'];var _0x15d9db=_0x48f578?0x0:_0x9a99b7['offset'];var _0x2b2762=_0x48f578?_0x19f585['count']:_0x9a99b7['offset']+_0x9a99b7[_0xdc4b('0x2f')];var _0x1c1a77;if(_0x2b2762>=_0x51c017){_0x2b2762=_0x51c017;_0x1c1a77=0xc8;}else{_0x1c1a77=0xce;}_0x910415[_0xdc4b('0x2b')](_0x1c1a77);return _0x910415[_0xdc4b('0x30')](_0xdc4b('0x31'),_0x15d9db+'-'+_0x2b2762+'/'+_0x51c017)[_0xdc4b('0x32')](_0x19f585);}return null;};}function patchUpdates(_0x1e11b1){return function(_0x444a84){try{jsonpatch['apply'](_0x444a84,_0x1e11b1,!![]);}catch(_0x1fae29){return BPromise[_0xdc4b('0x33')](_0x1fae29);}return _0x444a84[_0xdc4b('0x34')]();};}function saveUpdates(_0xf3e3fb,_0x59be8e){return function(_0x3e02f9){if(_0x3e02f9){return _0x3e02f9[_0xdc4b('0x35')](_0xf3e3fb)[_0xdc4b('0x21')](function(_0x85d08f){return _0x85d08f;});}return null;};}function removeEntity(_0x1ae979,_0x238783){return function(_0x536973){if(_0x536973){return _0x536973[_0xdc4b('0x36')]()[_0xdc4b('0x21')](function(){_0x1ae979[_0xdc4b('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c603c,_0x130b59){return function(_0x7002bf){if(!_0x7002bf){_0x3c603c[_0xdc4b('0x37')](0x194);}return _0x7002bf;};}function handleError(_0x2e4b9c,_0xd5101){_0xd5101=_0xd5101||0x1f4;return function(_0x32b5db){logger[_0xdc4b('0x27')](_0x32b5db[_0xdc4b('0x38')]);if(_0x32b5db[_0xdc4b('0x39')]){delete _0x32b5db['name'];}_0x2e4b9c[_0xdc4b('0x2b')](_0xd5101)[_0xdc4b('0x3a')](_0x32b5db);};}exports['index']=function(_0x543964,_0x4671db){var _0x2c7be3={},_0x38bdb4={},_0x29af24={'count':0x0,'rows':[]};var _0x4debd0=_[_0xdc4b('0x3b')](db[_0xdc4b('0x3c')][_0xdc4b('0x3d')],function(_0x1dcc6e){return{'name':_0x1dcc6e[_0xdc4b('0x3e')],'type':_0x1dcc6e[_0xdc4b('0x3f')]['key']};});_0x38bdb4['model']=_[_0xdc4b('0x3b')](_0x4debd0,_0xdc4b('0x39'));_0x38bdb4[_0xdc4b('0x40')]=_[_0xdc4b('0x41')](_0x543964[_0xdc4b('0x40')]);_0x38bdb4[_0xdc4b('0x42')]=_['intersection'](_0x38bdb4['model'],_0x38bdb4[_0xdc4b('0x40')]);_0x2c7be3[_0xdc4b('0x43')]=_[_0xdc4b('0x44')](_0x38bdb4[_0xdc4b('0x45')],qs[_0xdc4b('0x46')](_0x543964[_0xdc4b('0x40')][_0xdc4b('0x46')]));_0x2c7be3[_0xdc4b('0x43')]=_0x2c7be3[_0xdc4b('0x43')][_0xdc4b('0x47')]?_0x2c7be3[_0xdc4b('0x43')]:_0x38bdb4[_0xdc4b('0x45')];if(!_0x543964[_0xdc4b('0x40')][_0xdc4b('0x48')](_0xdc4b('0x49'))){_0x2c7be3[_0xdc4b('0x2f')]=qs[_0xdc4b('0x2f')](_0x543964[_0xdc4b('0x40')][_0xdc4b('0x2f')]);_0x2c7be3[_0xdc4b('0x2d')]=qs['offset'](_0x543964[_0xdc4b('0x40')]['offset']);}_0x2c7be3[_0xdc4b('0x4a')]=qs[_0xdc4b('0x4b')](_0x543964['query']['sort']);_0x2c7be3[_0xdc4b('0x4c')]=qs['filters'](_[_0xdc4b('0x4d')](_0x543964[_0xdc4b('0x40')],_0x38bdb4[_0xdc4b('0x42')]),_0x4debd0);if(_0x543964[_0xdc4b('0x40')][_0xdc4b('0x4e')]){_0x2c7be3['where']=_[_0xdc4b('0x4f')](_0x2c7be3[_0xdc4b('0x4c')],{'$or':_[_0xdc4b('0x3b')](_0x4debd0,function(_0x75b5bc){if(_0x75b5bc[_0xdc4b('0x3f')]!==_0xdc4b('0x50')){var _0x2952f4={};_0x2952f4[_0x75b5bc[_0xdc4b('0x39')]]={'$like':'%'+_0x543964[_0xdc4b('0x40')][_0xdc4b('0x4e')]+'%'};return _0x2952f4;}})});}_0x2c7be3=_[_0xdc4b('0x4f')]({},_0x2c7be3,_0x543964[_0xdc4b('0x51')]);var _0x583c43={'where':_0x2c7be3[_0xdc4b('0x4c')]};return db['OpenchannelMessage']['count'](_0x583c43)['then'](function(_0x14f26b){_0x29af24[_0xdc4b('0x52')]=_0x14f26b;if(_0x543964['query'][_0xdc4b('0x53')]){_0x2c7be3[_0xdc4b('0x54')]=[{'all':!![]}];}return db[_0xdc4b('0x3c')][_0xdc4b('0x55')](_0x2c7be3);})[_0xdc4b('0x21')](function(_0x1d36c6){_0x29af24[_0xdc4b('0x56')]=_0x1d36c6;return _0x29af24;})[_0xdc4b('0x21')](respondWithFilteredResult(_0x4671db,_0x2c7be3))[_0xdc4b('0x57')](handleError(_0x4671db,null));};exports['show']=function(_0x111665,_0x3a5569){var _0x43cc8e={'raw':!![],'where':{'id':_0x111665[_0xdc4b('0x58')]['id']}},_0x2f8a0e={};_0x2f8a0e[_0xdc4b('0x45')]=_[_0xdc4b('0x41')](db['OpenchannelMessage'][_0xdc4b('0x3d')]);_0x2f8a0e['query']=_[_0xdc4b('0x41')](_0x111665[_0xdc4b('0x40')]);_0x2f8a0e[_0xdc4b('0x42')]=_[_0xdc4b('0x44')](_0x2f8a0e[_0xdc4b('0x45')],_0x2f8a0e[_0xdc4b('0x40')]);_0x43cc8e[_0xdc4b('0x43')]=_[_0xdc4b('0x44')](_0x2f8a0e[_0xdc4b('0x45')],qs[_0xdc4b('0x46')](_0x111665[_0xdc4b('0x40')]['fields']));_0x43cc8e[_0xdc4b('0x43')]=_0x43cc8e[_0xdc4b('0x43')][_0xdc4b('0x47')]?_0x43cc8e['attributes']:_0x2f8a0e[_0xdc4b('0x45')];if(_0x111665[_0xdc4b('0x40')]['includeAll']){_0x43cc8e[_0xdc4b('0x54')]=[{'all':!![]}];}_0x43cc8e=_[_0xdc4b('0x4f')]({},_0x43cc8e,_0x111665[_0xdc4b('0x51')]);return db['OpenchannelMessage']['find'](_0x43cc8e)[_0xdc4b('0x21')](handleEntityNotFound(_0x3a5569,null))[_0xdc4b('0x21')](respondWithResult(_0x3a5569,null))[_0xdc4b('0x57')](handleError(_0x3a5569,null));};exports[_0xdc4b('0x59')]=function(_0x5a2678,_0x527b02){return db[_0xdc4b('0x3c')][_0xdc4b('0x59')](_0x5a2678[_0xdc4b('0x5a')],{})[_0xdc4b('0x21')](respondWithResult(_0x527b02,0xc9))[_0xdc4b('0x57')](handleError(_0x527b02,null));};exports[_0xdc4b('0x35')]=function(_0x46ec98,_0x5e13a3){if(_0x46ec98['body']['id']){delete _0x46ec98[_0xdc4b('0x5a')]['id'];}return db[_0xdc4b('0x3c')][_0xdc4b('0x5b')]({'where':{'id':_0x46ec98['params']['id']}})[_0xdc4b('0x21')](handleEntityNotFound(_0x5e13a3,null))[_0xdc4b('0x21')](saveUpdates(_0x46ec98[_0xdc4b('0x5a')],null))[_0xdc4b('0x21')](respondWithResult(_0x5e13a3,null))[_0xdc4b('0x57')](handleError(_0x5e13a3,null));};exports[_0xdc4b('0x36')]=function(_0x1cafb6,_0x1f3a64){return db[_0xdc4b('0x3c')][_0xdc4b('0x5b')]({'where':{'id':_0x1cafb6['params']['id']}})[_0xdc4b('0x21')](handleEntityNotFound(_0x1f3a64,null))[_0xdc4b('0x21')](removeEntity(_0x1f3a64,null))[_0xdc4b('0x57')](handleError(_0x1f3a64,null));};exports[_0xdc4b('0x5c')]=function(_0x2a4f86,_0x4883cd){return db[_0xdc4b('0x3c')][_0xdc4b('0x5c')]()['then'](respondWithResult(_0x4883cd,null))[_0xdc4b('0x57')](handleError(_0x4883cd,null));};var interaction_log=require(_0xdc4b('0x14'))(_0xdc4b('0x5d'));exports['accept']=function(_0x4dcb57,_0x2f3183,_0x279e7d){var _0x486984={'agent':{},'channel':_0xdc4b('0x5e')};if(_0x4dcb57[_0xdc4b('0x5a')]['id']){delete _0x4dcb57['body']['id'];}_0x4dcb57[_0xdc4b('0x5a')][_0xdc4b('0x5f')]=!![];_0x4dcb57['body'][_0xdc4b('0x60')]=moment()[_0xdc4b('0x61')](_0xdc4b('0x62'));_0x4dcb57['body']['UserId']=_0x4dcb57[_0xdc4b('0x5a')][_0xdc4b('0x63')]||_0x4dcb57['user']['id'];_0x486984[_0xdc4b('0x64')]['id']=_0x4dcb57[_0xdc4b('0x5a')][_0xdc4b('0x63')];return db[_0xdc4b('0x3c')]['find']({'where':{'id':_0x4dcb57[_0xdc4b('0x58')]['id'],'UserId':null}})[_0xdc4b('0x21')](handleEntityNotFound(_0x2f3183,null))[_0xdc4b('0x21')](saveUpdates(_0x4dcb57[_0xdc4b('0x5a')],null))[_0xdc4b('0x21')](function(_0x183551){if(_0x183551){_0x486984['message']=_0x183551[_0xdc4b('0x65')]({'plain':!![]});return db[_0xdc4b('0x66')][_0xdc4b('0x5b')]({'where':{'id':_0x183551['OpenchannelInteractionId']}});}return null;})[_0xdc4b('0x21')](handleEntityNotFound(_0x2f3183,null))[_0xdc4b('0x21')](function(_0xf4b460){if(_0xf4b460){return _0xf4b460[_0xdc4b('0x35')]({'UserId':_0x4dcb57[_0xdc4b('0x5a')][_0xdc4b('0x63')],'read1stAt':_[_0xdc4b('0x67')](_0xf4b460[_0xdc4b('0x68')])?moment()[_0xdc4b('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdc4b('0x21')](function(_0x38312a){if(_0x38312a){_0x486984[_0xdc4b('0x69')]=_0x38312a[_0xdc4b('0x65')]({'plain':!![]});interaction_log[_0xdc4b('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4dcb57[_0xdc4b('0x6a')]['id'],_0x4dcb57[_0xdc4b('0x6a')][_0xdc4b('0x39')],_0x4dcb57[_0xdc4b('0x6a')][_0xdc4b('0x6b')],_0x486984[_0xdc4b('0x69')]['id'],_0x4dcb57[_0xdc4b('0x5a')]?JSON['stringify'](_0x4dcb57[_0xdc4b('0x5a')]):_0xdc4b('0x6c'));return respondWithRpcPromise(_0xdc4b('0x6d'),_0xdc4b('0x6e'),_0x486984);}return null;})[_0xdc4b('0x21')](function(_0x2ed26f){var _0x480c5b=_0xdc4b('0x6f')+_0x2ed26f[_0xdc4b('0x29')][_0xdc4b('0x70')];return db['sequelize'][_0xdc4b('0x40')](_0x480c5b,{'type':db[_0xdc4b('0x71')][_0xdc4b('0x72')][_0xdc4b('0x73')],'raw':!![]})['then'](function(_0x31ed26){return _0x31ed26;});})[_0xdc4b('0x21')](function(_0x2d92c1){if(_0x2d92c1){_0x486984[_0xdc4b('0x29')]['contact']=_0x2d92c1[0x0];if(!_0x4dcb57[_0xdc4b('0x5a')][_0xdc4b('0x63')])return;return db[_0xdc4b('0x74')][_0xdc4b('0x5b')]({'where':{'id':_0x4dcb57[_0xdc4b('0x5a')][_0xdc4b('0x63')],'role':'agent'},'attributes':['id',_0xdc4b('0x39'),_0xdc4b('0x75'),_0xdc4b('0x76'),'internal'],'raw':!![]});}return null;})[_0xdc4b('0x21')](function(_0x4e8a6d){if(!_0x4e8a6d)return null;_0x486984[_0xdc4b('0x29')]['agent']=_0x4e8a6d;return _0x486984;})[_0xdc4b('0x21')](function(_0x5df33d){if(_0x5df33d){if(_0x4dcb57[_0xdc4b('0x5a')][_0xdc4b('0x77')]){_0x486984['message'][_0xdc4b('0x78')]=util[_0xdc4b('0x61')](_0xdc4b('0x79'),_0x4dcb57['user']['name']);_0x486984['message'][_0xdc4b('0x7a')]=_0x486984['channel'];_0x486984[_0xdc4b('0x29')][_0xdc4b('0x7b')]=_0x486984[_0xdc4b('0x7a')];_0x486984[_0xdc4b('0x29')]['event']='accept';return respondWithRpcPromise(_0xdc4b('0x7c'),_0xdc4b('0x7c'),{'event':'acceptmessage','message':_0x486984[_0xdc4b('0x29')]},client9002)[_0xdc4b('0x21')](function(){return _0x486984;});}return _0x486984;}return null;})[_0xdc4b('0x21')](respondWithResult(_0x2f3183,null))[_0xdc4b('0x57')](handleError(_0x2f3183,null));};var interaction_log=require(_0xdc4b('0x14'))(_0xdc4b('0x5d'));exports[_0xdc4b('0x33')]=function(_0x1af9d6,_0x66783b,_0x1b9d5f){var _0x382e39={'agent':{},'channel':_0xdc4b('0x5e')};if(_0x1af9d6['body']['id']){delete _0x1af9d6[_0xdc4b('0x5a')]['id'];}_0x1af9d6['body'][_0xdc4b('0x63')]=_0x1af9d6[_0xdc4b('0x5a')]['UserId']||_0x1af9d6['user']['id'];_0x382e39[_0xdc4b('0x64')]['id']=_0x1af9d6[_0xdc4b('0x5a')][_0xdc4b('0x63')];return db[_0xdc4b('0x3c')]['find']({'where':{'id':_0x1af9d6[_0xdc4b('0x58')]['id'],'UserId':null}})[_0xdc4b('0x21')](handleEntityNotFound(_0x66783b,null))[_0xdc4b('0x21')](function(_0x33c26b){if(_0x33c26b){_0x382e39[_0xdc4b('0x29')]=_0x33c26b[_0xdc4b('0x65')]({'plain':!![]});return db[_0xdc4b('0x66')]['find']({'where':{'id':_0x33c26b[_0xdc4b('0x7d')]}});}return null;})[_0xdc4b('0x21')](handleEntityNotFound(_0x66783b,null))[_0xdc4b('0x21')](function(_0x45f098){if(_0x45f098){_0x382e39[_0xdc4b('0x69')]=_0x45f098[_0xdc4b('0x65')]({'plain':!![]});interaction_log['info'](_0xdc4b('0x7e'),_0x1af9d6[_0xdc4b('0x6a')]['id'],_0x1af9d6[_0xdc4b('0x6a')]['name'],_0x1af9d6[_0xdc4b('0x6a')][_0xdc4b('0x6b')],_0x382e39[_0xdc4b('0x69')]['id'],_0x1af9d6['body']?JSON[_0xdc4b('0x26')](_0x1af9d6['body']):_0xdc4b('0x6c'));return respondWithRpcPromise(_0xdc4b('0x7f'),_0xdc4b('0x80'),_0x382e39);}return null;})['then'](function(_0x4c1e11){var _0x20136f=_0xdc4b('0x6f')+_0x4c1e11[_0xdc4b('0x29')][_0xdc4b('0x70')];return db['sequelize']['query'](_0x20136f,{'type':db['Sequelize'][_0xdc4b('0x72')]['SELECT'],'raw':!![]})[_0xdc4b('0x21')](function(_0x50aa4d){return _0x50aa4d;});})[_0xdc4b('0x21')](function(_0x2db5ba){if(_0x2db5ba){_0x382e39[_0xdc4b('0x29')][_0xdc4b('0x81')]=_0x2db5ba[0x0];if(!_0x1af9d6[_0xdc4b('0x5a')][_0xdc4b('0x63')])return;return db[_0xdc4b('0x74')][_0xdc4b('0x5b')]({'where':{'id':_0x1af9d6[_0xdc4b('0x5a')][_0xdc4b('0x63')],'role':'agent'},'attributes':['id',_0xdc4b('0x39'),_0xdc4b('0x75'),_0xdc4b('0x76'),_0xdc4b('0x82')],'raw':!![]});}return null;})[_0xdc4b('0x21')](function(_0x10b6a8){if(!_0x10b6a8)return null;_0x382e39[_0xdc4b('0x29')][_0xdc4b('0x64')]=_0x10b6a8;return _0x382e39;})[_0xdc4b('0x21')](function(_0x3e8d48){if(_0x3e8d48){_0x3e8d48[_0xdc4b('0x29')][_0xdc4b('0x78')]=util[_0xdc4b('0x61')](_0xdc4b('0x79'),_0x1af9d6[_0xdc4b('0x6a')][_0xdc4b('0x39')]);_0x3e8d48[_0xdc4b('0x29')][_0xdc4b('0x7a')]=_0x382e39[_0xdc4b('0x7a')];_0x3e8d48[_0xdc4b('0x29')][_0xdc4b('0x7b')]=_0x382e39[_0xdc4b('0x7a')];_0x3e8d48[_0xdc4b('0x29')][_0xdc4b('0x83')]='reject';respondWithRpcPromise(_0xdc4b('0x7c'),'EventManager',{'event':_0xdc4b('0x84'),'message':_0x3e8d48['message']},client9002);return _0x382e39;}return null;})[_0xdc4b('0x21')](respondWithResult(_0x66783b,null))[_0xdc4b('0x57')](handleError(_0x66783b,null));}; \ No newline at end of file +var _0xad07=['rows','show','params','rawAttributes','includeAll','find','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','interaction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','rejectmessage','eml-format','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','stack','name','index','map','OpenchannelMessage','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll'];(function(_0x1b6104,_0x201137){var _0x1a06e6=function(_0x130726){while(--_0x130726){_0x1b6104['push'](_0x1b6104['shift']());}};_0x1a06e6(++_0x201137);}(_0xad07,0x1ab));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7ad0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7ad0('0x1'));var rp=require('request-promise');var moment=require(_0x7ad0('0x2'));var BPromise=require(_0x7ad0('0x3'));var Mustache=require('mustache');var util=require(_0x7ad0('0x4'));var path=require(_0x7ad0('0x5'));var sox=require('sox');var csv=require(_0x7ad0('0x6'));var ejs=require(_0x7ad0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ad0('0x8'));var squel=require(_0x7ad0('0x9'));var crypto=require(_0x7ad0('0xa'));var jsforce=require(_0x7ad0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7ad0('0x6'));var querystring=require('querystring');var Papa=require(_0x7ad0('0xc'));var Redis=require(_0x7ad0('0xd'));var authService=require(_0x7ad0('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ad0('0xf'))(_0x7ad0('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ad0('0x11'));var db=require(_0x7ad0('0x12'))['db'];config[_0x7ad0('0x13')]=_[_0x7ad0('0x14')](config[_0x7ad0('0x13')],{'host':_0x7ad0('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ad0('0x13')]));require(_0x7ad0('0x16'))[_0x7ad0('0x17')](socket);var jayson=require(_0x7ad0('0x18'));var client=jayson[_0x7ad0('0x19')][_0x7ad0('0x1a')]({'port':0x232c});var client9002=jayson[_0x7ad0('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc9fc6d,_0x2157a5,_0x572096,_0x4e53f4){return new BPromise(function(_0x448ef6,_0x4454d1){var _0x40370b=_0x4e53f4||client;return _0x40370b[_0x7ad0('0x1b')](_0xc9fc6d,_0x572096)[_0x7ad0('0x1c')](function(_0x437c62){logger['info'](_0x7ad0('0x1d'),_0x2157a5,_0x7ad0('0x1e'));logger[_0x7ad0('0x1f')](_0x7ad0('0x20'),_0x2157a5,'request\x20sent',JSON[_0x7ad0('0x21')](_0x437c62));if(_0x437c62[_0x7ad0('0x22')]){if(_0x437c62['error'][_0x7ad0('0x23')]===0x1f4){logger[_0x7ad0('0x22')](_0x7ad0('0x1d'),_0x2157a5,_0x437c62['error']['message']);return _0x4454d1(_0x437c62[_0x7ad0('0x22')][_0x7ad0('0x24')]);}logger[_0x7ad0('0x22')](_0x7ad0('0x1d'),_0x2157a5,_0x437c62[_0x7ad0('0x22')][_0x7ad0('0x24')]);return _0x448ef6(_0x437c62[_0x7ad0('0x22')][_0x7ad0('0x24')]);}else{logger[_0x7ad0('0x25')](_0x7ad0('0x1d'),_0x2157a5,'request\x20sent');_0x448ef6(_0x437c62['result'][_0x7ad0('0x24')]);}})[_0x7ad0('0x26')](function(_0x3a2300){logger['error'](_0x7ad0('0x1d'),_0x2157a5,_0x3a2300);_0x4454d1(_0x3a2300);});});}function respondWithStatusCode(_0x2789a0,_0x25be30){_0x25be30=_0x25be30||0xcc;return function(_0x533edf){if(_0x533edf){return _0x2789a0[_0x7ad0('0x27')](_0x25be30);}return _0x2789a0['status'](_0x25be30)[_0x7ad0('0x28')]();};}function respondWithResult(_0x1a4329,_0x3d8dfa){_0x3d8dfa=_0x3d8dfa||0xc8;return function(_0x15c563){if(_0x15c563){return _0x1a4329[_0x7ad0('0x29')](_0x3d8dfa)[_0x7ad0('0x2a')](_0x15c563);}};}function respondWithFilteredResult(_0x352843,_0x4e34ae){return function(_0x4908c0){if(_0x4908c0){var _0x55143a=typeof _0x4e34ae[_0x7ad0('0x2b')]===_0x7ad0('0x2c')&&typeof _0x4e34ae[_0x7ad0('0x2d')]==='undefined';var _0x6695f=_0x4908c0[_0x7ad0('0x2e')];var _0x55db68=_0x55143a?0x0:_0x4e34ae[_0x7ad0('0x2b')];var _0x1533b9=_0x55143a?_0x4908c0[_0x7ad0('0x2e')]:_0x4e34ae[_0x7ad0('0x2b')]+_0x4e34ae['limit'];var _0x9fadf5;if(_0x1533b9>=_0x6695f){_0x1533b9=_0x6695f;_0x9fadf5=0xc8;}else{_0x9fadf5=0xce;}_0x352843[_0x7ad0('0x29')](_0x9fadf5);return _0x352843['set'](_0x7ad0('0x2f'),_0x55db68+'-'+_0x1533b9+'/'+_0x6695f)[_0x7ad0('0x2a')](_0x4908c0);}return null;};}function patchUpdates(_0x10b01a){return function(_0x3beff6){try{jsonpatch[_0x7ad0('0x30')](_0x3beff6,_0x10b01a,!![]);}catch(_0x32d257){return BPromise[_0x7ad0('0x31')](_0x32d257);}return _0x3beff6['save']();};}function saveUpdates(_0x490b11,_0x28bbf8){return function(_0x3a0f72){if(_0x3a0f72){return _0x3a0f72['update'](_0x490b11)[_0x7ad0('0x1c')](function(_0x2a5097){return _0x2a5097;});}return null;};}function removeEntity(_0x4bce58,_0x17c92d){return function(_0x82e4cf){if(_0x82e4cf){return _0x82e4cf[_0x7ad0('0x32')]()[_0x7ad0('0x1c')](function(){_0x4bce58['status'](0xcc)[_0x7ad0('0x28')]();});}};}function handleEntityNotFound(_0xd4677d,_0x228e44){return function(_0x39e6b5){if(!_0x39e6b5){_0xd4677d[_0x7ad0('0x27')](0x194);}return _0x39e6b5;};}function handleError(_0x5b2253,_0x2e70ff){_0x2e70ff=_0x2e70ff||0x1f4;return function(_0x2c5d80){logger[_0x7ad0('0x22')](_0x2c5d80[_0x7ad0('0x33')]);if(_0x2c5d80[_0x7ad0('0x34')]){delete _0x2c5d80[_0x7ad0('0x34')];}_0x5b2253['status'](_0x2e70ff)['send'](_0x2c5d80);};}exports[_0x7ad0('0x35')]=function(_0x39d362,_0x5178ad){var _0x321ccb={},_0x2388ba={},_0x24c04b={'count':0x0,'rows':[]};var _0x1dc249=_[_0x7ad0('0x36')](db[_0x7ad0('0x37')]['rawAttributes'],function(_0x3efa6c){return{'name':_0x3efa6c[_0x7ad0('0x38')],'type':_0x3efa6c[_0x7ad0('0x39')]['key']};});_0x2388ba[_0x7ad0('0x3a')]=_[_0x7ad0('0x36')](_0x1dc249,_0x7ad0('0x34'));_0x2388ba['query']=_[_0x7ad0('0x3b')](_0x39d362[_0x7ad0('0x3c')]);_0x2388ba[_0x7ad0('0x3d')]=_['intersection'](_0x2388ba['model'],_0x2388ba[_0x7ad0('0x3c')]);_0x321ccb[_0x7ad0('0x3e')]=_[_0x7ad0('0x3f')](_0x2388ba['model'],qs[_0x7ad0('0x40')](_0x39d362[_0x7ad0('0x3c')][_0x7ad0('0x40')]));_0x321ccb[_0x7ad0('0x3e')]=_0x321ccb['attributes'][_0x7ad0('0x41')]?_0x321ccb[_0x7ad0('0x3e')]:_0x2388ba[_0x7ad0('0x3a')];if(!_0x39d362[_0x7ad0('0x3c')][_0x7ad0('0x42')]('nolimit')){_0x321ccb[_0x7ad0('0x2d')]=qs[_0x7ad0('0x2d')](_0x39d362[_0x7ad0('0x3c')]['limit']);_0x321ccb[_0x7ad0('0x2b')]=qs[_0x7ad0('0x2b')](_0x39d362['query'][_0x7ad0('0x2b')]);}_0x321ccb[_0x7ad0('0x43')]=qs[_0x7ad0('0x44')](_0x39d362[_0x7ad0('0x3c')]['sort']);_0x321ccb[_0x7ad0('0x45')]=qs[_0x7ad0('0x3d')](_[_0x7ad0('0x46')](_0x39d362['query'],_0x2388ba[_0x7ad0('0x3d')]),_0x1dc249);if(_0x39d362['query'][_0x7ad0('0x47')]){_0x321ccb[_0x7ad0('0x45')]=_[_0x7ad0('0x48')](_0x321ccb[_0x7ad0('0x45')],{'$or':_[_0x7ad0('0x36')](_0x1dc249,function(_0x4cb71e){if(_0x4cb71e[_0x7ad0('0x39')]!==_0x7ad0('0x49')){var _0x3e737c={};_0x3e737c[_0x4cb71e[_0x7ad0('0x34')]]={'$like':'%'+_0x39d362[_0x7ad0('0x3c')][_0x7ad0('0x47')]+'%'};return _0x3e737c;}})});}_0x321ccb=_['merge']({},_0x321ccb,_0x39d362[_0x7ad0('0x4a')]);var _0x455cd0={'where':_0x321ccb['where']};return db[_0x7ad0('0x37')]['count'](_0x455cd0)['then'](function(_0x1b6736){_0x24c04b['count']=_0x1b6736;if(_0x39d362[_0x7ad0('0x3c')]['includeAll']){_0x321ccb[_0x7ad0('0x4b')]=[{'all':!![]}];}return db[_0x7ad0('0x37')][_0x7ad0('0x4c')](_0x321ccb);})['then'](function(_0x304bd3){_0x24c04b[_0x7ad0('0x4d')]=_0x304bd3;return _0x24c04b;})['then'](respondWithFilteredResult(_0x5178ad,_0x321ccb))[_0x7ad0('0x26')](handleError(_0x5178ad,null));};exports[_0x7ad0('0x4e')]=function(_0x340eab,_0x56a533){var _0x53db7a={'raw':!![],'where':{'id':_0x340eab[_0x7ad0('0x4f')]['id']}},_0x2e7fe8={};_0x2e7fe8[_0x7ad0('0x3a')]=_[_0x7ad0('0x3b')](db[_0x7ad0('0x37')][_0x7ad0('0x50')]);_0x2e7fe8[_0x7ad0('0x3c')]=_[_0x7ad0('0x3b')](_0x340eab[_0x7ad0('0x3c')]);_0x2e7fe8[_0x7ad0('0x3d')]=_[_0x7ad0('0x3f')](_0x2e7fe8['model'],_0x2e7fe8[_0x7ad0('0x3c')]);_0x53db7a['attributes']=_[_0x7ad0('0x3f')](_0x2e7fe8[_0x7ad0('0x3a')],qs[_0x7ad0('0x40')](_0x340eab[_0x7ad0('0x3c')][_0x7ad0('0x40')]));_0x53db7a[_0x7ad0('0x3e')]=_0x53db7a[_0x7ad0('0x3e')][_0x7ad0('0x41')]?_0x53db7a['attributes']:_0x2e7fe8[_0x7ad0('0x3a')];if(_0x340eab[_0x7ad0('0x3c')][_0x7ad0('0x51')]){_0x53db7a['include']=[{'all':!![]}];}_0x53db7a=_['merge']({},_0x53db7a,_0x340eab[_0x7ad0('0x4a')]);return db['OpenchannelMessage'][_0x7ad0('0x52')](_0x53db7a)[_0x7ad0('0x1c')](handleEntityNotFound(_0x56a533,null))[_0x7ad0('0x1c')](respondWithResult(_0x56a533,null))['catch'](handleError(_0x56a533,null));};exports['create']=function(_0x41b1d5,_0x398437){return db['OpenchannelMessage']['create'](_0x41b1d5[_0x7ad0('0x53')],{})['then'](respondWithResult(_0x398437,0xc9))[_0x7ad0('0x26')](handleError(_0x398437,null));};exports['update']=function(_0x27779a,_0x2aefa5){if(_0x27779a[_0x7ad0('0x53')]['id']){delete _0x27779a[_0x7ad0('0x53')]['id'];}return db[_0x7ad0('0x37')][_0x7ad0('0x52')]({'where':{'id':_0x27779a[_0x7ad0('0x4f')]['id']}})[_0x7ad0('0x1c')](handleEntityNotFound(_0x2aefa5,null))[_0x7ad0('0x1c')](saveUpdates(_0x27779a['body'],null))[_0x7ad0('0x1c')](respondWithResult(_0x2aefa5,null))[_0x7ad0('0x26')](handleError(_0x2aefa5,null));};exports[_0x7ad0('0x32')]=function(_0x106153,_0x140192){return db[_0x7ad0('0x37')][_0x7ad0('0x52')]({'where':{'id':_0x106153[_0x7ad0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x140192,null))[_0x7ad0('0x1c')](removeEntity(_0x140192,null))[_0x7ad0('0x26')](handleError(_0x140192,null));};exports[_0x7ad0('0x54')]=function(_0x30021a,_0x375dd4){return db[_0x7ad0('0x37')]['describe']()[_0x7ad0('0x1c')](respondWithResult(_0x375dd4,null))['catch'](handleError(_0x375dd4,null));};var interaction_log=require(_0x7ad0('0xf'))(_0x7ad0('0x55'));exports[_0x7ad0('0x56')]=function(_0x58565b,_0x27faa6,_0x24225c){var _0x15816b={'agent':{},'channel':_0x7ad0('0x57')};if(_0x58565b[_0x7ad0('0x53')]['id']){delete _0x58565b[_0x7ad0('0x53')]['id'];}_0x58565b[_0x7ad0('0x53')][_0x7ad0('0x58')]=!![];_0x58565b[_0x7ad0('0x53')][_0x7ad0('0x59')]=moment()[_0x7ad0('0x5a')](_0x7ad0('0x5b'));_0x58565b[_0x7ad0('0x53')]['UserId']=_0x58565b[_0x7ad0('0x53')][_0x7ad0('0x5c')]||_0x58565b[_0x7ad0('0x5d')]['id'];_0x15816b[_0x7ad0('0x5e')]['id']=_0x58565b[_0x7ad0('0x53')][_0x7ad0('0x5c')];return db['OpenchannelMessage'][_0x7ad0('0x52')]({'where':{'id':_0x58565b[_0x7ad0('0x4f')]['id'],'UserId':null}})[_0x7ad0('0x1c')](handleEntityNotFound(_0x27faa6,null))['then'](saveUpdates(_0x58565b[_0x7ad0('0x53')],null))['then'](function(_0x437e8c){if(_0x437e8c){_0x15816b[_0x7ad0('0x24')]=_0x437e8c[_0x7ad0('0x5f')]({'plain':!![]});return db[_0x7ad0('0x60')][_0x7ad0('0x52')]({'where':{'id':_0x437e8c[_0x7ad0('0x61')]}});}return null;})[_0x7ad0('0x1c')](handleEntityNotFound(_0x27faa6,null))[_0x7ad0('0x1c')](function(_0x52b218){if(_0x52b218){return _0x52b218['update']({'UserId':_0x58565b[_0x7ad0('0x53')][_0x7ad0('0x5c')],'read1stAt':_[_0x7ad0('0x62')](_0x52b218['read1stAt'])?moment()[_0x7ad0('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7ad0('0x1c')](function(_0x4d13e3){if(_0x4d13e3){_0x15816b['interaction']=_0x4d13e3[_0x7ad0('0x5f')]({'plain':!![]});interaction_log['info'](_0x7ad0('0x63'),_0x58565b['user']['id'],_0x58565b['user'][_0x7ad0('0x34')],_0x58565b[_0x7ad0('0x5d')][_0x7ad0('0x64')],_0x15816b['interaction']['id'],_0x58565b[_0x7ad0('0x53')]?JSON[_0x7ad0('0x21')](_0x58565b['body']):_0x7ad0('0x65'));return respondWithRpcPromise('AcceptMessage',_0x7ad0('0x66'),_0x15816b);}return null;})[_0x7ad0('0x1c')](function(_0x996d68){var _0x5d956c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x996d68['message']['ContactId'];return db['sequelize'][_0x7ad0('0x3c')](_0x5d956c,{'type':db['Sequelize'][_0x7ad0('0x67')]['SELECT'],'raw':!![]})['then'](function(_0x16d453){return _0x16d453;});})[_0x7ad0('0x1c')](function(_0x5d388a){if(_0x5d388a){_0x15816b[_0x7ad0('0x24')][_0x7ad0('0x68')]=_0x5d388a[0x0];if(!_0x58565b[_0x7ad0('0x53')][_0x7ad0('0x5c')])return;return db[_0x7ad0('0x69')][_0x7ad0('0x52')]({'where':{'id':_0x58565b[_0x7ad0('0x53')]['UserId'],'role':_0x7ad0('0x5e')},'attributes':['id',_0x7ad0('0x34'),'fullname',_0x7ad0('0x6a'),_0x7ad0('0x6b')],'raw':!![]});}return null;})[_0x7ad0('0x1c')](function(_0x45c621){if(!_0x45c621)return null;_0x15816b['message']['agent']=_0x45c621;return _0x15816b;})[_0x7ad0('0x1c')](function(_0x12667b){if(_0x12667b){if(_0x58565b[_0x7ad0('0x53')][_0x7ad0('0x6c')]){_0x15816b[_0x7ad0('0x24')][_0x7ad0('0x6d')]=util['format'](_0x7ad0('0x6e'),_0x58565b[_0x7ad0('0x5d')][_0x7ad0('0x34')]);_0x15816b['message'][_0x7ad0('0x6f')]=_0x15816b[_0x7ad0('0x6f')];_0x15816b[_0x7ad0('0x24')][_0x7ad0('0x70')]=_0x15816b[_0x7ad0('0x6f')];_0x15816b[_0x7ad0('0x24')][_0x7ad0('0x71')]=_0x7ad0('0x56');return respondWithRpcPromise(_0x7ad0('0x72'),'EventManager',{'event':_0x7ad0('0x73'),'message':_0x15816b[_0x7ad0('0x24')]},client9002)[_0x7ad0('0x1c')](function(){return _0x15816b;});}return _0x15816b;}return null;})[_0x7ad0('0x1c')](respondWithResult(_0x27faa6,null))[_0x7ad0('0x26')](handleError(_0x27faa6,null));};var interaction_log=require(_0x7ad0('0xf'))(_0x7ad0('0x55'));exports[_0x7ad0('0x31')]=function(_0xf4f80,_0x4e7d17,_0x16fe49){var _0x52e6c0={'agent':{},'channel':_0x7ad0('0x57')};if(_0xf4f80[_0x7ad0('0x53')]['id']){delete _0xf4f80[_0x7ad0('0x53')]['id'];}_0xf4f80['body'][_0x7ad0('0x5c')]=_0xf4f80[_0x7ad0('0x53')]['UserId']||_0xf4f80[_0x7ad0('0x5d')]['id'];_0x52e6c0[_0x7ad0('0x5e')]['id']=_0xf4f80[_0x7ad0('0x53')]['UserId'];return db['OpenchannelMessage'][_0x7ad0('0x52')]({'where':{'id':_0xf4f80[_0x7ad0('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e7d17,null))[_0x7ad0('0x1c')](function(_0x84b5b7){if(_0x84b5b7){_0x52e6c0[_0x7ad0('0x24')]=_0x84b5b7['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x7ad0('0x52')]({'where':{'id':_0x84b5b7['OpenchannelInteractionId']}});}return null;})[_0x7ad0('0x1c')](handleEntityNotFound(_0x4e7d17,null))[_0x7ad0('0x1c')](function(_0x139815){if(_0x139815){_0x52e6c0[_0x7ad0('0x74')]=_0x139815[_0x7ad0('0x5f')]({'plain':!![]});interaction_log[_0x7ad0('0x25')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf4f80[_0x7ad0('0x5d')]['id'],_0xf4f80[_0x7ad0('0x5d')]['name'],_0xf4f80[_0x7ad0('0x5d')][_0x7ad0('0x64')],_0x52e6c0[_0x7ad0('0x74')]['id'],_0xf4f80[_0x7ad0('0x53')]?JSON[_0x7ad0('0x21')](_0xf4f80['body']):_0x7ad0('0x65'));return respondWithRpcPromise(_0x7ad0('0x75'),_0x7ad0('0x76'),_0x52e6c0);}return null;})[_0x7ad0('0x1c')](function(_0x52c0d1){var _0x35ccd3=_0x7ad0('0x77')+_0x52c0d1['message'][_0x7ad0('0x78')];return db[_0x7ad0('0x79')]['query'](_0x35ccd3,{'type':db[_0x7ad0('0x7a')]['QueryTypes'][_0x7ad0('0x7b')],'raw':!![]})[_0x7ad0('0x1c')](function(_0x303ab0){return _0x303ab0;});})[_0x7ad0('0x1c')](function(_0x3c810e){if(_0x3c810e){_0x52e6c0[_0x7ad0('0x24')][_0x7ad0('0x68')]=_0x3c810e[0x0];if(!_0xf4f80[_0x7ad0('0x53')][_0x7ad0('0x5c')])return;return db[_0x7ad0('0x69')][_0x7ad0('0x52')]({'where':{'id':_0xf4f80[_0x7ad0('0x53')][_0x7ad0('0x5c')],'role':_0x7ad0('0x5e')},'attributes':['id',_0x7ad0('0x34'),_0x7ad0('0x7c'),'email',_0x7ad0('0x6b')],'raw':!![]});}return null;})[_0x7ad0('0x1c')](function(_0x4b3c8a){if(!_0x4b3c8a)return null;_0x52e6c0[_0x7ad0('0x24')]['agent']=_0x4b3c8a;return _0x52e6c0;})['then'](function(_0x21dffe){if(_0x21dffe){_0x21dffe[_0x7ad0('0x24')][_0x7ad0('0x6d')]=util[_0x7ad0('0x5a')](_0x7ad0('0x6e'),_0xf4f80[_0x7ad0('0x5d')][_0x7ad0('0x34')]);_0x21dffe[_0x7ad0('0x24')][_0x7ad0('0x6f')]=_0x52e6c0['channel'];_0x21dffe[_0x7ad0('0x24')]['motionChannel']=_0x52e6c0[_0x7ad0('0x6f')];_0x21dffe['message'][_0x7ad0('0x71')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x7ad0('0x7d'),'message':_0x21dffe['message']},client9002);return _0x52e6c0;}return null;})[_0x7ad0('0x1c')](respondWithResult(_0x4e7d17,null))[_0x7ad0('0x26')](handleError(_0x4e7d17,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index e17ce61..5ac1f0a 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 _0x7dc1=['hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove'];(function(_0x154505,_0x318c40){var _0x2701f7=function(_0x5507b0){while(--_0x5507b0){_0x154505['push'](_0x154505['shift']());}};_0x2701f7(++_0x318c40);}(_0x7dc1,0x113));var _0x17dc=function(_0x485488,_0x20a8eb){_0x485488=_0x485488-0x0;var _0x3f6d0f=_0x7dc1[_0x485488];return _0x3f6d0f;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x17dc('0x0'))['db'][_0x17dc('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x17dc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x17dc('0x3'),'afterDestroy':_0x17dc('0x4')};function emitEvent(_0xe2f3d4){return function(_0x32325c,_0x4f8a8d,_0x22facd){OpenchannelMessageEvents['emit'](_0xe2f3d4+':'+_0x32325c['id'],_0x32325c);OpenchannelMessageEvents['emit'](_0xe2f3d4,_0x32325c);_0x22facd(null);};}for(var e in events){if(events[_0x17dc('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x17dc('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x5cdb=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5cdb,0x1e1));var _0xb5cd=function(_0x58fcef,_0xd186f8){_0x58fcef=_0x58fcef-0x0;var _0xa9e4ce=_0x5cdb[_0x58fcef];return _0xa9e4ce;};'use strict';var EventEmitter=require(_0xb5cd('0x0'));var OpenchannelMessage=require(_0xb5cd('0x1'))['db'][_0xb5cd('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb5cd('0x3')](0x0);var events={'afterCreate':_0xb5cd('0x4'),'afterUpdate':_0xb5cd('0x5'),'afterDestroy':_0xb5cd('0x6')};function emitEvent(_0x3fce56){return function(_0x11c0ec,_0x1c2a90,_0x3c9a59){OpenchannelMessageEvents[_0xb5cd('0x7')](_0x3fce56+':'+_0x11c0ec['id'],_0x11c0ec);OpenchannelMessageEvents[_0xb5cd('0x7')](_0x3fce56,_0x11c0ec);_0x3c9a59(null);};}for(var e in events){if(events[_0xb5cd('0x8')](e)){var event=events[e];OpenchannelMessage[_0xb5cd('0x9')](e,emitEvent(event));}}module[_0xb5cd('0xa')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index f2552ea..fef14d5 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 _0xb03e=['info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','threadId','inspect','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','get','replyUri'];(function(_0x52cc00,_0x38520b){var _0x23cbad=function(_0x34affd){while(--_0x34affd){_0x52cc00['push'](_0x52cc00['shift']());}};_0x23cbad(++_0x38520b);}(_0xb03e,0x1eb));var _0xeb03=function(_0x14edcf,_0x4fdb8e){_0x14edcf=_0x14edcf-0x0;var _0x3c58ab=_0xb03e[_0x14edcf];return _0x3c58ab;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var logger=require(_0xeb03('0x1'))(_0xeb03('0x2'));var moment=require(_0xeb03('0x3'));var BPromise=require(_0xeb03('0x4'));var rp=require(_0xeb03('0x5'));var fs=require('fs');var path=require(_0xeb03('0x6'));var rimraf=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var attributes=require(_0xeb03('0x9'));module[_0xeb03('0xa')]=function(_0xee2291,_0x4e1cea){return _0xee2291[_0xeb03('0xb')](_0xeb03('0xc'),attributes,{'tableName':_0xeb03('0xd'),'paranoid':![],'indexes':[{'name':_0xeb03('0xe'),'fields':[_0xeb03('0xf')],'type':_0xeb03('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a8491,_0x403b77,_0x99f4e2){var _0x14cfa0=_0xee2291['models'];var _0x31af2c=_0x5a8491['get']({'plain':!![]});if(_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()==='in'||_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()===_0xeb03('0x13')&&!_0x31af2c[_0xeb03('0x14')]&&!_[_0xeb03('0x15')](_0x31af2c[_0xeb03('0x16')])){_0x14cfa0[_0xeb03('0x17')][_0xeb03('0x18')]({'where':{'id':_0x31af2c[_0xeb03('0x19')]}})[_0xeb03('0x1a')](function(_0x4d9c8e){if(_0x4d9c8e){_0x4d9c8e[_0xeb03('0x1b')]({'lastMsgAt':_0x31af2c[_0xeb03('0x1c')],'lastMsgDirection':_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()});}})['catch'](function(_0x15f4fe){console[_0xeb03('0x1d')](_0x15f4fe);});}if(_0x31af2c[_0xeb03('0x11')]==='out'&&!_0x31af2c[_0xeb03('0x14')]){var _0x46dd1b;_0x14cfa0[_0xeb03('0x1e')][_0xeb03('0x1f')]()[_0xeb03('0x1a')](function(_0x1b4cbd){return _0x14cfa0[_0xeb03('0x20')][_0xeb03('0x21')]({'where':{'id':_0x31af2c[_0xeb03('0x22')]},'include':[{'model':_0x14cfa0[_0xeb03('0x17')],'as':_0xeb03('0x23'),'where':{'id':_0x31af2c[_0xeb03('0x19')]},'limit':0x1,'include':[{'model':_0x14cfa0[_0xeb03('0x1e')],'as':_0xeb03('0x24'),'attributes':_['keys'](_0x1b4cbd)}]}]});})[_0xeb03('0x1a')](function(_0x3855dd){_0x46dd1b=_0x3855dd[_0xeb03('0x25')]({'plain':!![]});if(_0x46dd1b&&_0x46dd1b[_0xeb03('0x26')]){logger[_0xeb03('0x27')](_0xeb03('0x28'),_0xeb03('0x29'),util[_0xeb03('0x2a')](_0xeb03('0x2b'),_0x31af2c['id'],_0x46dd1b['replyUri']));if(_0x46dd1b[_0xeb03('0x23')]&&_0x46dd1b[_0xeb03('0x23')][_0xeb03('0x2c')]){_0x31af2c[_0xeb03('0x2d')]=_[_0xeb03('0x2e')](_0x46dd1b['Interactions'][0x0],_0xeb03('0x24'));_0x31af2c[_0xeb03('0x24')]=_0x46dd1b[_0xeb03('0x23')][0x0][_0xeb03('0x24')];}var _0x403b77={'method':_0xeb03('0x2f'),'uri':encodeURI(_0x46dd1b[_0xeb03('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x403b77[_0xeb03('0x30')]){case _0xeb03('0x31'):_0x403b77['qs']=_0x31af2c;break;case'POST':_0x403b77[_0xeb03('0xf')]=_0x31af2c;break;}return rp(_0x403b77)[_0xeb03('0x1a')](function(_0x2683f9){logger[_0xeb03('0x27')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xeb03('0x2a')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x31af2c['id'],_0x46dd1b[_0xeb03('0x26')]));if(_0x2683f9[_0xeb03('0xf')][_0xeb03('0x32')]&&_0x2683f9['body'][_0xeb03('0x32')]!=_0x31af2c['Interaction']['threadId']){return _0x14cfa0['OpenchannelInteraction']['update']({'threadId':_0x2683f9[_0xeb03('0xf')][_0xeb03('0x32')]},{'logging':!![],'where':{'id':_0x31af2c['Interaction']['id']}});}else{return;}})['then'](function(){return _0x5a8491['update']({'read':!![]});})['catch'](function(_0x1e8009){logger[_0xeb03('0x1d')](_0xeb03('0x28'),_0xeb03('0x29'),util[_0xeb03('0x33')](_0x1e8009,{'showHidden':![],'depth':null}));_0x99f4e2();});}else{_0x99f4e2();}})['finally'](function(){_0x99f4e2();});}else{_0x99f4e2();}}},'charset':_0xeb03('0x34'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3266=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','define','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','OpenchannelInteractionId','createdAt','catch','error','OpenchannelAccount','find','OpenchannelAccountId','CmContact','Contact','keys','then','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','method','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5656ba,_0x4f0dad){var _0x524794=function(_0x11b35e){while(--_0x11b35e){_0x5656ba['push'](_0x5656ba['shift']());}};_0x524794(++_0x4f0dad);}(_0x3266,0x6a));var _0x6326=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x3266[_0x5e4563];return _0x8d1bf5;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var logger=require(_0x6326('0x2'))(_0x6326('0x3'));var moment=require(_0x6326('0x4'));var BPromise=require(_0x6326('0x5'));var rp=require(_0x6326('0x6'));var fs=require('fs');var path=require(_0x6326('0x7'));var rimraf=require(_0x6326('0x8'));var config=require('../../config/environment');var attributes=require(_0x6326('0x9'));module['exports']=function(_0x25ecd8,_0x44460c){return _0x25ecd8[_0x6326('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x6326('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x6326('0xc')],'type':_0x6326('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x249eca,_0x1aee60,_0x37a23d){var _0x53c3e1=_0x25ecd8[_0x6326('0xe')];var _0x464a36=_0x249eca[_0x6326('0xf')]({'plain':!![]});if(_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()==='in'||_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()===_0x6326('0x12')&&!_0x464a36[_0x6326('0x13')]&&!_[_0x6326('0x14')](_0x464a36['UserId'])){_0x53c3e1['OpenchannelInteraction'][_0x6326('0x15')]({'where':{'id':_0x464a36[_0x6326('0x16')]}})['then'](function(_0x425878){if(_0x425878){_0x425878['update']({'lastMsgAt':_0x464a36[_0x6326('0x17')],'lastMsgDirection':_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()});}})[_0x6326('0x18')](function(_0x1ed3a3){console[_0x6326('0x19')](_0x1ed3a3);});}if(_0x464a36['direction']===_0x6326('0x12')&&!_0x464a36['secret']){var _0x5945ee;_0x53c3e1['CmContact']['describe']()['then'](function(_0x58e960){return _0x53c3e1[_0x6326('0x1a')][_0x6326('0x1b')]({'where':{'id':_0x464a36[_0x6326('0x1c')]},'include':[{'model':_0x53c3e1['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x464a36[_0x6326('0x16')]},'limit':0x1,'include':[{'model':_0x53c3e1[_0x6326('0x1d')],'as':_0x6326('0x1e'),'attributes':_[_0x6326('0x1f')](_0x58e960)}]}]});})[_0x6326('0x20')](function(_0x25957a){_0x5945ee=_0x25957a[_0x6326('0xf')]({'plain':!![]});if(_0x5945ee&&_0x5945ee['replyUri']){logger[_0x6326('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x6326('0x22'),util[_0x6326('0x23')](_0x6326('0x24'),_0x464a36['id'],_0x5945ee[_0x6326('0x25')]));if(_0x5945ee[_0x6326('0x26')]&&_0x5945ee[_0x6326('0x26')][_0x6326('0x27')]){_0x464a36[_0x6326('0x28')]=_[_0x6326('0x29')](_0x5945ee[_0x6326('0x26')][0x0],_0x6326('0x1e'));_0x464a36['Contact']=_0x5945ee[_0x6326('0x26')][0x0][_0x6326('0x1e')];}var _0x1aee60={'method':'POST','uri':encodeURI(_0x5945ee['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1aee60[_0x6326('0x2a')]){case'GET':_0x1aee60['qs']=_0x464a36;break;case _0x6326('0x2b'):_0x1aee60[_0x6326('0xc')]=_0x464a36;break;}return rp(_0x1aee60)['then'](function(_0x15e33d){logger[_0x6326('0x21')](_0x6326('0x2c'),_0x6326('0x22'),util[_0x6326('0x23')](_0x6326('0x2d'),_0x464a36['id'],_0x5945ee[_0x6326('0x25')]));if(_0x15e33d[_0x6326('0xc')][_0x6326('0x2e')]&&_0x15e33d[_0x6326('0xc')][_0x6326('0x2e')]!=_0x464a36[_0x6326('0x28')][_0x6326('0x2e')]){return _0x53c3e1[_0x6326('0x2f')][_0x6326('0x30')]({'threadId':_0x15e33d[_0x6326('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x464a36[_0x6326('0x28')]['id']}});}else{return;}})[_0x6326('0x20')](function(){return _0x249eca[_0x6326('0x30')]({'read':!![]});})['catch'](function(_0x1bd9a6){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x6326('0x22'),util[_0x6326('0x31')](_0x1bd9a6,{'showHidden':![],'depth':null}));_0x37a23d();});}else{_0x37a23d();}})[_0x6326('0x32')](function(){_0x37a23d();});}else{_0x37a23d();}}},'charset':_0x6326('0x33'),'collate':_0x6326('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 03b2243..7ddc74a 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x7589af,_0x16862f){var _0x5e9f3d=function(_0x4c9a7b){while(--_0x4c9a7b){_0x7589af['push'](_0x7589af['shift']());}};_0x5e9f3d(++_0x16862f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +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(_0x5d0cea,_0x5a7a5a){var _0x19f1f9=function(_0x2bc405){while(--_0x2bc405){_0x5d0cea['push'](_0x5d0cea['shift']());}};_0x19f1f9(++_0x5a7a5a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x106086,_0x2d8dbf){_0x106086=_0x106086-0x0;var _0x188a50=_0x5f2f[_0x106086];return _0x188a50;};'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 3c5b2af..61ac4b7 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 _0x2192=['register','length','openchannelMessage:','./openchannelMessage.events','save','update','removeListener'];(function(_0x59c792,_0x2e55d0){var _0x3c4475=function(_0x2798f0){while(--_0x2798f0){_0x59c792['push'](_0x59c792['shift']());}};_0x3c4475(++_0x2e55d0);}(_0x2192,0x1a0));var _0x2219=function(_0x5cf951,_0x3a9415){_0x5cf951=_0x5cf951-0x0;var _0x1145e5=_0x2192[_0x5cf951];return _0x1145e5;};'use strict';var OpenchannelMessageEvents=require(_0x2219('0x0'));var events=[_0x2219('0x1'),'remove',_0x2219('0x2')];function createListener(_0xbb5ad5,_0x15861e){return function(_0x48f698){_0x15861e['emit'](_0xbb5ad5,_0x48f698);};}function removeListener(_0x9cd51f,_0x529302){return function(){OpenchannelMessageEvents[_0x2219('0x3')](_0x9cd51f,_0x529302);};}exports[_0x2219('0x4')]=function(_0x1b28ca){for(var _0x2dc670=0x0,_0x1950b8=events[_0x2219('0x5')];_0x2dc670<_0x1950b8;_0x2dc670++){var _0x2b40d2=events[_0x2dc670];var _0x4c3df8=createListener(_0x2219('0x6')+_0x2b40d2,_0x1b28ca);OpenchannelMessageEvents['on'](_0x2b40d2,_0x4c3df8);}}; \ No newline at end of file +var _0x7f3f=['openchannelMessage:','./openchannelMessage.events','save','update','emit','removeListener','length'];(function(_0x5afbd5,_0x48a693){var _0x298511=function(_0x2f4262){while(--_0x2f4262){_0x5afbd5['push'](_0x5afbd5['shift']());}};_0x298511(++_0x48a693);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x1ce236,_0xca922e){_0x1ce236=_0x1ce236-0x0;var _0x241819=_0x7f3f[_0x1ce236];return _0x241819;};'use strict';var OpenchannelMessageEvents=require(_0xf7f3('0x0'));var events=[_0xf7f3('0x1'),'remove',_0xf7f3('0x2')];function createListener(_0x445831,_0x2925b0){return function(_0x1354ec){_0x2925b0[_0xf7f3('0x3')](_0x445831,_0x1354ec);};}function removeListener(_0x4b4dbb,_0x19374c){return function(){OpenchannelMessageEvents[_0xf7f3('0x4')](_0x4b4dbb,_0x19374c);};}exports['register']=function(_0x163eab){for(var _0x2c1059=0x0,_0xe75375=events[_0xf7f3('0x5')];_0x2c1059<_0xe75375;_0x2c1059++){var _0x14b371=events[_0x2c1059];var _0x31beac=createListener(_0xf7f3('0x6')+_0x14b371,_0x163eab);OpenchannelMessageEvents['on'](_0x14b371,_0x31beac);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index d3a7329..50461de 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 _0x5d2d=['/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','create','post','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3e36b6,_0x43de3b){var _0x4a3a36=function(_0x13f6a0){while(--_0x13f6a0){_0x3e36b6['push'](_0x3e36b6['shift']());}};_0x4a3a36(++_0x43de3b);}(_0x5d2d,0x8e));var _0xd5d2=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x5d2d[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0xd5d2('0x0'));var util=require(_0xd5d2('0x1'));var path=require(_0xd5d2('0x2'));var timeout=require(_0xd5d2('0x3'));var express=require(_0xd5d2('0x4'));var router=express[_0xd5d2('0x5')]();var fs_extra=require(_0xd5d2('0x6'));var auth=require(_0xd5d2('0x7'));var interaction=require(_0xd5d2('0x8'));var config=require(_0xd5d2('0x9'));var controller=require('./openchannelQueue.controller');router[_0xd5d2('0xa')]('/',auth[_0xd5d2('0xb')](),controller[_0xd5d2('0xc')]);router[_0xd5d2('0xa')](_0xd5d2('0xd'),auth['isAuthenticated'](),controller[_0xd5d2('0xe')]);router[_0xd5d2('0xa')](_0xd5d2('0xf'),auth[_0xd5d2('0xb')](),controller[_0xd5d2('0x10')]);router[_0xd5d2('0xa')](_0xd5d2('0x11'),auth[_0xd5d2('0xb')](),controller[_0xd5d2('0x12')]);router[_0xd5d2('0xa')](_0xd5d2('0x13'),auth[_0xd5d2('0xb')](),controller['getTeams']);router[_0xd5d2('0xa')]('/:id/users',auth[_0xd5d2('0xb')](),controller[_0xd5d2('0x14')]);router['post']('/',auth[_0xd5d2('0xb')](),controller[_0xd5d2('0x15')]);router[_0xd5d2('0x16')](_0xd5d2('0x13'),auth[_0xd5d2('0xb')](),controller[_0xd5d2('0x17')]);router[_0xd5d2('0x16')](_0xd5d2('0x18'),auth[_0xd5d2('0xb')](),controller[_0xd5d2('0x19')]);router[_0xd5d2('0x1a')](_0xd5d2('0xf'),auth[_0xd5d2('0xb')](),controller[_0xd5d2('0x1b')]);router['delete'](_0xd5d2('0xf'),auth[_0xd5d2('0xb')](),controller['destroy']);router[_0xd5d2('0x1c')](_0xd5d2('0x13'),auth[_0xd5d2('0xb')](),controller['removeTeams']);router['delete'](_0xd5d2('0x18'),auth[_0xd5d2('0xb')](),controller[_0xd5d2('0x1d')]);module[_0xd5d2('0x1e')]=router; \ No newline at end of file +var _0x202d=['./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x202d,0xef));var _0xd202=function(_0x28e72b,_0x5e16ab){_0x28e72b=_0x28e72b-0x0;var _0x77418f=_0x202d[_0x28e72b];return _0x77418f;};'use strict';var multer=require(_0xd202('0x0'));var util=require(_0xd202('0x1'));var path=require(_0xd202('0x2'));var timeout=require(_0xd202('0x3'));var express=require(_0xd202('0x4'));var router=express[_0xd202('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd202('0x6'));var interaction=require(_0xd202('0x7'));var config=require(_0xd202('0x8'));var controller=require(_0xd202('0x9'));router[_0xd202('0xa')]('/',auth[_0xd202('0xb')](),controller[_0xd202('0xc')]);router['get'](_0xd202('0xd'),auth[_0xd202('0xb')](),controller[_0xd202('0xe')]);router['get'](_0xd202('0xf'),auth['isAuthenticated'](),controller[_0xd202('0x10')]);router[_0xd202('0xa')](_0xd202('0x11'),auth[_0xd202('0xb')](),controller[_0xd202('0x12')]);router[_0xd202('0xa')](_0xd202('0x13'),auth[_0xd202('0xb')](),controller[_0xd202('0x14')]);router[_0xd202('0xa')](_0xd202('0x15'),auth[_0xd202('0xb')](),controller[_0xd202('0x16')]);router[_0xd202('0x17')]('/',auth[_0xd202('0xb')](),controller[_0xd202('0x18')]);router[_0xd202('0x17')](_0xd202('0x13'),auth[_0xd202('0xb')](),controller[_0xd202('0x19')]);router['post'](_0xd202('0x15'),auth[_0xd202('0xb')](),controller[_0xd202('0x1a')]);router['put']('/:id',auth[_0xd202('0xb')](),controller['update']);router[_0xd202('0x1b')](_0xd202('0xf'),auth[_0xd202('0xb')](),controller[_0xd202('0x1c')]);router[_0xd202('0x1b')](_0xd202('0x13'),auth[_0xd202('0xb')](),controller[_0xd202('0x1d')]);router[_0xd202('0x1b')](_0xd202('0x15'),auth[_0xd202('0xb')](),controller[_0xd202('0x1e')]);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 040c758..35bd8c7 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 _0xabdf=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x316ee1,_0x13906c){var _0x13cdd9=function(_0x58a701){while(--_0x58a701){_0x316ee1['push'](_0x316ee1['shift']());}};_0x13cdd9(++_0x13906c);}(_0xabdf,0x128));var _0xfabd=function(_0x565c29,_0x5aa28d){_0x565c29=_0x565c29-0x0;var _0x4df924=_0xabdf[_0x565c29];return _0x4df924;};'use strict';var Sequelize=require(_0xfabd('0x0'));module[_0xfabd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfabd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfabd('0x3')]},'timeout':{'type':Sequelize[_0xfabd('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfabd('0x5')](_0xfabd('0x6'),_0xfabd('0x7'),_0xfabd('0x8'))}}; \ No newline at end of file +var _0x4c0f=['exports','name','ENUM','beepall','roundrobin','sequelize'];(function(_0x44e0a4,_0x4dbc5a){var _0x16c53b=function(_0x460617){while(--_0x460617){_0x44e0a4['push'](_0x44e0a4['shift']());}};_0x16c53b(++_0x4dbc5a);}(_0x4c0f,0x107));var _0xf4c0=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x4c0f[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0xf4c0('0x0'));module[_0xf4c0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf4c0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf4c0('0x3')]('rrmemory',_0xf4c0('0x4'),_0xf4c0('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f4170f9..4daabe8 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 _0xab55=['pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','keys','find','catch','create','body','user','get','UserProfileSection','autoAssociation','findOne','UserOpenchannelQueue','length','findAll','findAndCountAll','agent','updatedAt','createdAt','format','SIP','openchannelPause','options','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','every','includes','all','union','value','omit','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','offset','limit','count','set','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','OpenchannelQueue','rawAttributes','fieldName','type','map','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x158a01,_0x3e708b){var _0x595e32=function(_0x1f52e0){while(--_0x1f52e0){_0x158a01['push'](_0x158a01['shift']());}};_0x595e32(++_0x3e708b);}(_0xab55,0x1bc));var _0x5ab5=function(_0x5f0bce,_0x103294){_0x5f0bce=_0x5f0bce-0x0;var _0x6fa2b=_0xab55[_0x5f0bce];return _0x6fa2b;};'use strict';var emlformat=require(_0x5ab5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ab5('0x1'));var jsonpatch=require(_0x5ab5('0x2'));var rp=require('request-promise');var moment=require(_0x5ab5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5ab5('0x4'));var path=require(_0x5ab5('0x5'));var sox=require(_0x5ab5('0x6'));var csv=require(_0x5ab5('0x7'));var ejs=require(_0x5ab5('0x8'));var fs=require('fs');var fs_extra=require(_0x5ab5('0x9'));var _=require(_0x5ab5('0xa'));var squel=require('squel');var crypto=require(_0x5ab5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5ab5('0xc'));var toCsv=require(_0x5ab5('0x7'));var querystring=require(_0x5ab5('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ab5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5ab5('0xf'));var hardwareService=require(_0x5ab5('0x10'));var logger=require(_0x5ab5('0x11'))(_0x5ab5('0x12'));var utils=require('../../config/utils');var config=require(_0x5ab5('0x13'));var licenseUtil=require(_0x5ab5('0x14'));var db=require(_0x5ab5('0x15'))['db'];config['redis']=_[_0x5ab5('0x16')](config[_0x5ab5('0x17')],{'host':_0x5ab5('0x18'),'port':0x18eb});var socket=require(_0x5ab5('0x19'))(new Redis(config[_0x5ab5('0x17')]));require(_0x5ab5('0x1a'))['register'](socket);function respondWithStatusCode(_0x2eda4c,_0x1b5c45){_0x1b5c45=_0x1b5c45||0xcc;return function(_0x4090c5){if(_0x4090c5){return _0x2eda4c[_0x5ab5('0x1b')](_0x1b5c45);}return _0x2eda4c[_0x5ab5('0x1c')](_0x1b5c45)[_0x5ab5('0x1d')]();};}function respondWithResult(_0x48b17e,_0x1f4aff){_0x1f4aff=_0x1f4aff||0xc8;return function(_0x1b7f0c){if(_0x1b7f0c){return _0x48b17e[_0x5ab5('0x1c')](_0x1f4aff)['json'](_0x1b7f0c);}};}function respondWithFilteredResult(_0x664d4d,_0x4d773d){return function(_0x2280dc){if(_0x2280dc){var _0x5c4e0d=typeof _0x4d773d[_0x5ab5('0x1e')]==='undefined'&&typeof _0x4d773d[_0x5ab5('0x1f')]==='undefined';var _0x2be62d=_0x2280dc[_0x5ab5('0x20')];var _0x239327=_0x5c4e0d?0x0:_0x4d773d['offset'];var _0x1d81dc=_0x5c4e0d?_0x2280dc[_0x5ab5('0x20')]:_0x4d773d['offset']+_0x4d773d[_0x5ab5('0x1f')];var _0x2a6d7a;if(_0x1d81dc>=_0x2be62d){_0x1d81dc=_0x2be62d;_0x2a6d7a=0xc8;}else{_0x2a6d7a=0xce;}_0x664d4d[_0x5ab5('0x1c')](_0x2a6d7a);return _0x664d4d[_0x5ab5('0x21')]('Content-Range',_0x239327+'-'+_0x1d81dc+'/'+_0x2be62d)['json'](_0x2280dc);}return null;};}function patchUpdates(_0x1aadcd){return function(_0x5ee3b5){try{jsonpatch['apply'](_0x5ee3b5,_0x1aadcd,!![]);}catch(_0x4ce979){return BPromise[_0x5ab5('0x22')](_0x4ce979);}return _0x5ee3b5[_0x5ab5('0x23')]();};}function saveUpdates(_0x4e7a02,_0x5d9316){return function(_0x5dc16b){if(_0x5dc16b){return _0x5dc16b[_0x5ab5('0x24')](_0x4e7a02)[_0x5ab5('0x25')](function(_0x537e6b){return _0x537e6b;});}return null;};}function removeEntity(_0x44d530,_0x560436){return function(_0x1b5182){if(_0x1b5182){return _0x1b5182[_0x5ab5('0x26')]()['then'](function(){var _0x831799=_0x1b5182['get']({'plain':!![]});var _0x1a83d6=_0x5ab5('0x27');return db[_0x5ab5('0x28')]['destroy']({'where':{'type':_0x1a83d6,'resourceId':_0x831799['id']}})['then'](function(){return _0x1b5182;});})[_0x5ab5('0x25')](function(){_0x44d530[_0x5ab5('0x1c')](0xcc)[_0x5ab5('0x1d')]();});}};}function handleEntityNotFound(_0x4aafd4,_0xe50833){return function(_0x7b2cd4){if(!_0x7b2cd4){_0x4aafd4[_0x5ab5('0x1b')](0x194);}return _0x7b2cd4;};}function handleError(_0x4f5774,_0x5ac22f){_0x5ac22f=_0x5ac22f||0x1f4;return function(_0x256098){logger[_0x5ab5('0x29')](_0x256098[_0x5ab5('0x2a')]);if(_0x256098['name']){delete _0x256098[_0x5ab5('0x2b')];}_0x4f5774[_0x5ab5('0x1c')](_0x5ac22f)[_0x5ab5('0x2c')](_0x256098);};}exports['index']=function(_0x5be99e,_0x507b28){var _0x5d3e73={},_0x499ad8={},_0x2937f0={'count':0x0,'rows':[]};var _0x1f0f66=_['map'](db[_0x5ab5('0x2d')][_0x5ab5('0x2e')],function(_0x3c979e){return{'name':_0x3c979e[_0x5ab5('0x2f')],'type':_0x3c979e[_0x5ab5('0x30')]['key']};});_0x499ad8['model']=_[_0x5ab5('0x31')](_0x1f0f66,_0x5ab5('0x2b'));_0x499ad8[_0x5ab5('0x32')]=_['keys'](_0x5be99e['query']);_0x499ad8['filters']=_[_0x5ab5('0x33')](_0x499ad8['model'],_0x499ad8[_0x5ab5('0x32')]);_0x5d3e73[_0x5ab5('0x34')]=_[_0x5ab5('0x33')](_0x499ad8[_0x5ab5('0x35')],qs[_0x5ab5('0x36')](_0x5be99e['query'][_0x5ab5('0x36')]));_0x5d3e73[_0x5ab5('0x34')]=_0x5d3e73[_0x5ab5('0x34')]['length']?_0x5d3e73['attributes']:_0x499ad8[_0x5ab5('0x35')];if(!_0x5be99e['query'][_0x5ab5('0x37')](_0x5ab5('0x38'))){_0x5d3e73['limit']=qs[_0x5ab5('0x1f')](_0x5be99e['query'][_0x5ab5('0x1f')]);_0x5d3e73[_0x5ab5('0x1e')]=qs['offset'](_0x5be99e[_0x5ab5('0x32')][_0x5ab5('0x1e')]);}_0x5d3e73[_0x5ab5('0x39')]=qs[_0x5ab5('0x3a')](_0x5be99e['query'][_0x5ab5('0x3a')]);_0x5d3e73['where']=qs[_0x5ab5('0x3b')](_[_0x5ab5('0x3c')](_0x5be99e[_0x5ab5('0x32')],_0x499ad8[_0x5ab5('0x3b')]),_0x1f0f66);if(_0x5be99e[_0x5ab5('0x32')][_0x5ab5('0x3d')]){_0x5d3e73[_0x5ab5('0x3e')]=_[_0x5ab5('0x3f')](_0x5d3e73[_0x5ab5('0x3e')],{'$or':_[_0x5ab5('0x31')](_0x1f0f66,function(_0x463a75){if(_0x463a75[_0x5ab5('0x30')]!==_0x5ab5('0x40')){var _0x13c376={};_0x13c376[_0x463a75[_0x5ab5('0x2b')]]={'$like':'%'+_0x5be99e['query']['filter']+'%'};return _0x13c376;}})});}_0x5d3e73=_[_0x5ab5('0x3f')]({},_0x5d3e73,_0x5be99e['options']);var _0x562de4={'where':_0x5d3e73[_0x5ab5('0x3e')]};return db['OpenchannelQueue']['count'](_0x562de4)[_0x5ab5('0x25')](function(_0x49ddb3){_0x2937f0[_0x5ab5('0x20')]=_0x49ddb3;if(_0x5be99e[_0x5ab5('0x32')][_0x5ab5('0x41')]){_0x5d3e73[_0x5ab5('0x42')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x5d3e73);})[_0x5ab5('0x25')](function(_0x52321b){_0x2937f0[_0x5ab5('0x43')]=_0x52321b;return _0x2937f0;})[_0x5ab5('0x25')](respondWithFilteredResult(_0x507b28,_0x5d3e73))['catch'](handleError(_0x507b28,null));};exports[_0x5ab5('0x44')]=function(_0x4544e9,_0x23c36d){var _0x116751={'raw':!![],'where':{'id':_0x4544e9[_0x5ab5('0x45')]['id']}},_0x2e2674={};_0x2e2674[_0x5ab5('0x35')]=_[_0x5ab5('0x46')](db[_0x5ab5('0x2d')]['rawAttributes']);_0x2e2674[_0x5ab5('0x32')]=_[_0x5ab5('0x46')](_0x4544e9['query']);_0x2e2674['filters']=_['intersection'](_0x2e2674[_0x5ab5('0x35')],_0x2e2674[_0x5ab5('0x32')]);_0x116751[_0x5ab5('0x34')]=_['intersection'](_0x2e2674[_0x5ab5('0x35')],qs[_0x5ab5('0x36')](_0x4544e9[_0x5ab5('0x32')][_0x5ab5('0x36')]));_0x116751[_0x5ab5('0x34')]=_0x116751[_0x5ab5('0x34')]['length']?_0x116751[_0x5ab5('0x34')]:_0x2e2674[_0x5ab5('0x35')];if(_0x4544e9[_0x5ab5('0x32')][_0x5ab5('0x41')]){_0x116751[_0x5ab5('0x42')]=[{'all':!![]}];}_0x116751=_[_0x5ab5('0x3f')]({},_0x116751,_0x4544e9['options']);return db['OpenchannelQueue'][_0x5ab5('0x47')](_0x116751)[_0x5ab5('0x25')](handleEntityNotFound(_0x23c36d,null))[_0x5ab5('0x25')](respondWithResult(_0x23c36d,null))[_0x5ab5('0x48')](handleError(_0x23c36d,null));};exports[_0x5ab5('0x49')]=function(_0x30053e,_0x39622d){return db[_0x5ab5('0x2d')][_0x5ab5('0x49')](_0x30053e[_0x5ab5('0x4a')],{})[_0x5ab5('0x25')](function(_0x555ad6){var _0x5876c3=_0x30053e[_0x5ab5('0x4b')][_0x5ab5('0x4c')]({'plain':!![]});if(!_0x5876c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5876c3['role']===_0x5ab5('0x4b')){var _0x32e8a7=_0x555ad6[_0x5ab5('0x4c')]({'plain':!![]});var _0x485f95=_0x5ab5('0x27');return db[_0x5ab5('0x4d')][_0x5ab5('0x47')]({'where':{'name':_0x485f95,'userProfileId':_0x5876c3['userProfileId']},'raw':!![]})[_0x5ab5('0x25')](function(_0x4eb006){if(_0x4eb006&&_0x4eb006[_0x5ab5('0x4e')]===0x0){return db[_0x5ab5('0x28')][_0x5ab5('0x49')]({'name':_0x32e8a7['name'],'resourceId':_0x32e8a7['id'],'type':_0x4eb006[_0x5ab5('0x2b')],'sectionId':_0x4eb006['id']},{})[_0x5ab5('0x25')](function(){return _0x555ad6;});}else{return _0x555ad6;}})[_0x5ab5('0x48')](function(_0x5a83b5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a83b5);throw _0x5a83b5;});}return _0x555ad6;})['then'](respondWithResult(_0x39622d,0xc9))[_0x5ab5('0x48')](handleError(_0x39622d,null));};exports[_0x5ab5('0x24')]=function(_0xf3062,_0x56ddad){if(_0xf3062[_0x5ab5('0x4a')]['id']){delete _0xf3062[_0x5ab5('0x4a')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0xf3062[_0x5ab5('0x45')]['id']}})['then'](handleEntityNotFound(_0x56ddad,null))[_0x5ab5('0x25')](saveUpdates(_0xf3062[_0x5ab5('0x4a')],null))[_0x5ab5('0x25')](respondWithResult(_0x56ddad,null))[_0x5ab5('0x48')](handleError(_0x56ddad,null));};exports[_0x5ab5('0x26')]=function(_0x3ac311,_0x2fc6cf){return db[_0x5ab5('0x2d')][_0x5ab5('0x47')]({'where':{'id':_0x3ac311['params']['id']}})['then'](handleEntityNotFound(_0x2fc6cf,null))['then'](removeEntity(_0x2fc6cf,null))[_0x5ab5('0x48')](handleError(_0x2fc6cf,null));};exports['describe']=function(_0x30e2c4,_0xef1cb4){return db[_0x5ab5('0x2d')]['describe']()[_0x5ab5('0x25')](respondWithResult(_0xef1cb4,null))[_0x5ab5('0x48')](handleError(_0xef1cb4,null));};exports['getMembers']=function(_0x2f4841,_0x535f89,_0xc9f950){var _0x3e5276={'raw':!![],'where':{}},_0x1f7b8f={},_0x45b3be;return db[_0x5ab5('0x2d')][_0x5ab5('0x4f')]({'where':{'id':_0x2f4841[_0x5ab5('0x45')]['id']}})[_0x5ab5('0x25')](handleEntityNotFound(_0x535f89,null))[_0x5ab5('0x25')](function(_0x3d6ade){if(_0x3d6ade){_0x45b3be=_0x3d6ade[_0x5ab5('0x4c')]({'plain':!![]});_0x1f7b8f[_0x5ab5('0x35')]=_[_0x5ab5('0x46')](db[_0x5ab5('0x50')][_0x5ab5('0x2e')]);_0x1f7b8f[_0x5ab5('0x32')]=_[_0x5ab5('0x46')](_0x2f4841[_0x5ab5('0x32')]);_0x1f7b8f['filters']=_['intersection'](_0x1f7b8f[_0x5ab5('0x35')],_0x1f7b8f[_0x5ab5('0x32')]);_0x3e5276['attributes']=_[_0x5ab5('0x33')](_0x1f7b8f[_0x5ab5('0x35')],qs[_0x5ab5('0x36')](_0x2f4841['query'][_0x5ab5('0x36')]));_0x3e5276[_0x5ab5('0x34')]=_0x3e5276[_0x5ab5('0x34')][_0x5ab5('0x51')]?_0x3e5276['attributes']:_0x1f7b8f[_0x5ab5('0x35')];if(!_0x2f4841[_0x5ab5('0x32')]['hasOwnProperty'](_0x5ab5('0x38'))){_0x3e5276['limit']=qs[_0x5ab5('0x1f')](_0x2f4841[_0x5ab5('0x32')]['limit']);_0x3e5276[_0x5ab5('0x1e')]=qs[_0x5ab5('0x1e')](_0x2f4841[_0x5ab5('0x32')][_0x5ab5('0x1e')]);}_0x3e5276[_0x5ab5('0x39')]=qs[_0x5ab5('0x3a')](_0x2f4841[_0x5ab5('0x32')][_0x5ab5('0x3a')]);_0x3e5276[_0x5ab5('0x3e')]=qs['filters'](_[_0x5ab5('0x3c')](_0x2f4841[_0x5ab5('0x32')],_0x1f7b8f['filters']));_0x3e5276[_0x5ab5('0x3e')]['OpenchannelQueueId']=_0x3d6ade['id'];if(_0x2f4841[_0x5ab5('0x32')][_0x5ab5('0x3d')]){_0x3e5276[_0x5ab5('0x3e')]=_['merge'](_0x3e5276[_0x5ab5('0x3e')],{'$or':_[_0x5ab5('0x31')](_0x3e5276[_0x5ab5('0x34')],function(_0x5e1954){var _0x45b00f={};_0x45b00f[_0x5e1954]={'$like':'%'+_0x2f4841[_0x5ab5('0x32')]['filter']+'%'};return _0x45b00f;})});}_0x3e5276=_['merge']({},_0x3e5276,_0x2f4841['options']);return db[_0x5ab5('0x50')][_0x5ab5('0x52')](_0x3e5276);}})[_0x5ab5('0x25')](function(_0x269928){if(_0x269928){return db['User'][_0x5ab5('0x53')]({'where':{'id':_['map'](_0x269928,'UserId'),'role':_0x5ab5('0x54')},'attributes':['id','name','openchannelPause',_0x5ab5('0x55'),_0x5ab5('0x56')]});}})[_0x5ab5('0x25')](function(_0x3b7f4f){if(_0x3b7f4f){return{'count':_0x3b7f4f[_0x5ab5('0x20')],'rows':_[_0x5ab5('0x31')](_0x3b7f4f[_0x5ab5('0x43')],function(_0x268226){return{'membername':_0x268226['name'],'UserId':_0x268226['id'],'queue_name':_0x45b3be[_0x5ab5('0x2b')],'OpenchannelQueueId':_0x45b3be['id'],'interface':util[_0x5ab5('0x57')]('%s/%s',_0x5ab5('0x58'),_0x268226['name']),'penalty':0x0,'paused':_0x268226[_0x5ab5('0x59')],'createdAt':_0x268226['createdAt'],'updatedAt':_0x268226['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5ab5('0x25')](respondWithFilteredResult(_0x535f89,_0x3e5276))[_0x5ab5('0x48')](handleError(_0x535f89,null));};exports['getTeams']=function(_0x1bd4c9,_0x2ad9af,_0x214fbc){var _0x1a5680={};var _0x3571ba={};var _0x5a76a4;var _0xf5f36a;return db[_0x5ab5('0x2d')][_0x5ab5('0x4f')]({'where':{'id':_0x1bd4c9['params']['id']}})[_0x5ab5('0x25')](handleEntityNotFound(_0x2ad9af,null))['then'](function(_0x5633f3){if(_0x5633f3){_0x5a76a4=_0x5633f3;_0x3571ba['model']=_[_0x5ab5('0x46')](db['Team'][_0x5ab5('0x2e')]);_0x3571ba[_0x5ab5('0x32')]=_[_0x5ab5('0x46')](_0x1bd4c9[_0x5ab5('0x32')]);_0x3571ba[_0x5ab5('0x3b')]=_[_0x5ab5('0x33')](_0x3571ba[_0x5ab5('0x35')],_0x3571ba[_0x5ab5('0x32')]);_0x1a5680[_0x5ab5('0x34')]=_[_0x5ab5('0x33')](_0x3571ba[_0x5ab5('0x35')],qs[_0x5ab5('0x36')](_0x1bd4c9[_0x5ab5('0x32')][_0x5ab5('0x36')]));_0x1a5680['attributes']=_0x1a5680[_0x5ab5('0x34')][_0x5ab5('0x51')]?_0x1a5680[_0x5ab5('0x34')]:_0x3571ba[_0x5ab5('0x35')];_0x1a5680['order']=qs[_0x5ab5('0x3a')](_0x1bd4c9[_0x5ab5('0x32')][_0x5ab5('0x3a')]);_0x1a5680[_0x5ab5('0x3e')]=qs[_0x5ab5('0x3b')](_[_0x5ab5('0x3c')](_0x1bd4c9[_0x5ab5('0x32')],_0x3571ba[_0x5ab5('0x3b')]));if(_0x1bd4c9['query'][_0x5ab5('0x3d')]){_0x1a5680[_0x5ab5('0x3e')]=_[_0x5ab5('0x3f')](_0x1a5680[_0x5ab5('0x3e')],{'$or':_['map'](_0x1a5680[_0x5ab5('0x34')],function(_0x1ad2d0){var _0x29bc90={};_0x29bc90[_0x1ad2d0]={'$like':'%'+_0x1bd4c9['query'][_0x5ab5('0x3d')]+'%'};return _0x29bc90;})});}_0x1a5680=_['merge']({},_0x1a5680,_0x1bd4c9[_0x5ab5('0x5a')]);return _0x5a76a4[_0x5ab5('0x5b')](_0x1a5680);}})['then'](function(_0x18e275){if(_0x18e275){_0xf5f36a=_0x18e275[_0x5ab5('0x51')];if(!_0x1bd4c9[_0x5ab5('0x32')]['hasOwnProperty'](_0x5ab5('0x38'))){_0x1a5680['limit']=qs[_0x5ab5('0x1f')](_0x1bd4c9[_0x5ab5('0x32')][_0x5ab5('0x1f')]);_0x1a5680['offset']=qs['offset'](_0x1bd4c9[_0x5ab5('0x32')][_0x5ab5('0x1e')]);}return _0x5a76a4[_0x5ab5('0x5b')](_0x1a5680);}})[_0x5ab5('0x25')](function(_0x258955){if(_0x258955){return _0x258955?{'count':_0xf5f36a,'rows':_0x258955}:null;}})[_0x5ab5('0x25')](respondWithResult(_0x2ad9af,null))['catch'](handleError(_0x2ad9af,null));};exports[_0x5ab5('0x5c')]=function(_0x35f3e3,_0x40cfd7,_0x184c04){var _0x28c248=_0x35f3e3['body'][_0x5ab5('0x5d')];return db['Team'][_0x5ab5('0x52')]({'where':{'id':_0x28c248},'attributes':['id'],'include':[{'model':db[_0x5ab5('0x5e')],'as':_0x5ab5('0x5f'),'attributes':['id','name',_0x5ab5('0x60'),_0x5ab5('0x61'),_0x5ab5('0x62')],'raw':!![]}]})['then'](function(_0x477234){if(_0x477234){var _0x3f5452=_[_0x5ab5('0x63')](_0x477234,function(_0x56f64c){var _0x44b7d3=_0x56f64c[_0x5ab5('0x4c')]({'plain':!![]});return _0x44b7d3[_0x5ab5('0x5f')];});return db[_0x5ab5('0x2d')][_0x5ab5('0x47')]({'where':{'id':_0x35f3e3['params']['id']}})['then'](function(_0x3f28eb){return db[_0x5ab5('0x64')][_0x5ab5('0x65')](function(_0x531471){return _0x3f28eb[_0x5ab5('0x5c')](_0x28c248,{'transaction':_0x531471})['then'](function(){return BPromise[_0x5ab5('0x66')](_0x3f5452,function(_0x360326){return db[_0x5ab5('0x50')]['findOrCreate']({'where':{'UserId':_0x360326['id'],'OpenchannelQueueId':_0x35f3e3[_0x5ab5('0x45')]['id']},'transaction':_0x531471});});})['then'](function(){_0x3f5452[_0x5ab5('0x67')](function(_0x367157){socket[_0x5ab5('0x68')](_0x5ab5('0x69'),{'UserId':_0x367157['id'],'OpenchannelQueueId':_0x3f28eb['id']});});});});});}})[_0x5ab5('0x25')](respondWithStatusCode(_0x40cfd7,null))['catch'](handleError(_0x40cfd7,null));};exports[_0x5ab5('0x6a')]=function(_0x305eec,_0x24cf0e,_0x12212f){return db['Team'][_0x5ab5('0x52')]({'where':{'id':_0x305eec[_0x5ab5('0x32')][_0x5ab5('0x5d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5ab5('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x5ab5('0x25')](handleEntityNotFound(_0x24cf0e,null))[_0x5ab5('0x25')](function(_0x32899b){var _0x1fe5e5=_[_0x5ab5('0x31')](_0x32899b,'id');var _0x119e94=[];var _0x15e43a=[];var _0x989ece=squel['select']();_0x989ece[_0x5ab5('0x6b')](_0x5ab5('0x6c'))[_0x5ab5('0x6d')](_0x5ab5('0x6e'),'tq')[_0x5ab5('0x6f')](_0x5ab5('0x70'),'ut',_0x5ab5('0x71'))[_0x5ab5('0x3e')]('OpenchannelQueueId\x20=\x20?',_0x305eec[_0x5ab5('0x45')]['id']);for(var _0x1ee656=0x0;_0x1ee656<_0x32899b[_0x5ab5('0x51')];_0x1ee656+=0x1){let _0x36b448=_0x32899b[_0x1ee656];for(var _0xf0a5d4=0x0;_0xf0a5d4<_0x36b448[_0x5ab5('0x5f')][_0x5ab5('0x51')];_0xf0a5d4+=0x1){let _0x54f25c=_0x36b448[_0x5ab5('0x5f')][_0xf0a5d4];var _0x4527f1=_0x989ece[_0x5ab5('0x72')]();_0x4527f1[_0x5ab5('0x3e')](_0x5ab5('0x73'),_0x54f25c['id']);_0x15e43a['push'](db[_0x5ab5('0x64')][_0x5ab5('0x32')](_0x4527f1['toString'](),{'type':db[_0x5ab5('0x64')]['QueryTypes']['SELECT']})['then'](function(_0x17e881){if(_0x17e881[_0x5ab5('0x51')]===0x1){return _0x54f25c['id'];}else{var _0x1e8b71=_[_0x5ab5('0x74')](_[_0x5ab5('0x31')](_0x17e881,'TeamId'),function(_0x2daaf8){return _[_0x5ab5('0x75')](_0x1fe5e5,_0x2daaf8);});if(_0x1e8b71){return _0x54f25c['id'];}}}));}}return BPromise[_0x5ab5('0x76')](_0x15e43a)[_0x5ab5('0x25')](function(_0x58f8c2){_0x119e94=_(_0x119e94)[_0x5ab5('0x77')](_0x58f8c2)['compact']()[_0x5ab5('0x78')]();return db[_0x5ab5('0x2d')][_0x5ab5('0x47')]({'where':{'id':_0x305eec[_0x5ab5('0x45')]['id']}})[_0x5ab5('0x25')](function(_0x242e98){return db[_0x5ab5('0x64')][_0x5ab5('0x65')](function(_0x4a52cf){return _0x242e98['removeTeams'](_0x305eec[_0x5ab5('0x32')][_0x5ab5('0x5d')],{'transaction':_0x4a52cf})[_0x5ab5('0x25')](function(){if(!_['isEmpty'](_0x119e94)){return _0x242e98['removeAgents'](_0x119e94,{'transaction':_0x4a52cf});}})[_0x5ab5('0x25')](function(){_0x119e94[_0x5ab5('0x67')](function(_0x5b38a8){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x5b38a8,'OpenchannelQueueId':_0x242e98['id']});});});});});});})[_0x5ab5('0x25')](respondWithStatusCode(_0x24cf0e,null))['catch'](handleError(_0x24cf0e,null));};exports['addAgents']=function(_0x5f051c,_0xd8ebbd,_0x1412b3){return db[_0x5ab5('0x2d')][_0x5ab5('0x47')]({'where':{'id':_0x5f051c['params']['id']}})[_0x5ab5('0x25')](handleEntityNotFound(_0xd8ebbd,null))['then'](function(_0x33baf6){if(_0x33baf6){return _0x33baf6['addAgents'](_0x5f051c['body'][_0x5ab5('0x5d')],_[_0x5ab5('0x79')](_0x5f051c[_0x5ab5('0x4a')],['ids','id'])||{})['spread'](function(_0x1e47fd){for(var _0x952997=0x0;_0x952997<_0x5f051c[_0x5ab5('0x4a')]['ids']['length'];_0x952997+=0x1){socket[_0x5ab5('0x68')]('userOpenchannelQueue:save',{'UserId':Number(_0x5f051c['body'][_0x5ab5('0x5d')][_0x952997]),'OpenchannelQueueId':Number(_0x5f051c['params']['id'])});}return _0x1e47fd;});}})[_0x5ab5('0x25')](respondWithResult(_0xd8ebbd,null))['catch'](handleError(_0xd8ebbd,null));};exports[_0x5ab5('0x7a')]=function(_0x24e512,_0x143fa3,_0x5553e2){return db['OpenchannelQueue'][_0x5ab5('0x47')]({'where':{'id':_0x24e512[_0x5ab5('0x45')]['id']}})[_0x5ab5('0x25')](handleEntityNotFound(_0x143fa3,null))[_0x5ab5('0x25')](function(_0x3d1e6e){if(_0x3d1e6e){return _0x3d1e6e['removeAgents'](_0x24e512[_0x5ab5('0x32')][_0x5ab5('0x5d')])['then'](function(){if(_[_0x5ab5('0x7b')](_0x24e512[_0x5ab5('0x32')]['ids'])){for(var _0x3a41e5=0x0;_0x3a41e5<_0x24e512[_0x5ab5('0x32')][_0x5ab5('0x5d')][_0x5ab5('0x51')];_0x3a41e5+=0x1){socket[_0x5ab5('0x68')](_0x5ab5('0x7c'),{'UserId':Number(_0x24e512[_0x5ab5('0x32')][_0x5ab5('0x5d')][_0x3a41e5]),'OpenchannelQueueId':Number(_0x24e512[_0x5ab5('0x45')]['id'])});}}else{socket[_0x5ab5('0x68')](_0x5ab5('0x7c'),{'UserId':Number(_0x24e512[_0x5ab5('0x32')][_0x5ab5('0x5d')]),'OpenchannelQueueId':Number(_0x24e512[_0x5ab5('0x45')]['id'])});}});}})[_0x5ab5('0x25')](respondWithStatusCode(_0x143fa3,null))[_0x5ab5('0x48')](handleError(_0x143fa3,null));};exports[_0x5ab5('0x7d')]=function(_0x37b6b0,_0x2c8113,_0x1e1642){var _0x4f8ef4={};var _0x409b5={};var _0x42d13f;var _0xa6e6ac;return db[_0x5ab5('0x2d')][_0x5ab5('0x4f')]({'where':{'id':_0x37b6b0[_0x5ab5('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c8113,null))[_0x5ab5('0x25')](function(_0x21b562){if(_0x21b562){_0x42d13f=_0x21b562;_0x409b5[_0x5ab5('0x35')]=_['keys'](db[_0x5ab5('0x5e')][_0x5ab5('0x2e')]);_0x409b5[_0x5ab5('0x32')]=_[_0x5ab5('0x46')](_0x37b6b0[_0x5ab5('0x32')]);_0x409b5[_0x5ab5('0x3b')]=_[_0x5ab5('0x33')](_0x409b5[_0x5ab5('0x35')],_0x409b5[_0x5ab5('0x32')]);_0x4f8ef4[_0x5ab5('0x34')]=_[_0x5ab5('0x33')](_0x409b5['model'],qs[_0x5ab5('0x36')](_0x37b6b0['query'][_0x5ab5('0x36')]));_0x4f8ef4[_0x5ab5('0x34')]=_0x4f8ef4[_0x5ab5('0x34')][_0x5ab5('0x51')]?_0x4f8ef4[_0x5ab5('0x34')]:_0x409b5['model'];_0x4f8ef4[_0x5ab5('0x39')]=qs[_0x5ab5('0x3a')](_0x37b6b0[_0x5ab5('0x32')]['sort']);_0x4f8ef4['where']=qs[_0x5ab5('0x3b')](_[_0x5ab5('0x3c')](_0x37b6b0[_0x5ab5('0x32')],_0x409b5[_0x5ab5('0x3b')]));if(_0x37b6b0[_0x5ab5('0x32')][_0x5ab5('0x3d')]){_0x4f8ef4[_0x5ab5('0x3e')]=_['merge'](_0x4f8ef4[_0x5ab5('0x3e')],{'$or':_[_0x5ab5('0x31')](_0x4f8ef4['attributes'],function(_0x1e0de2){var _0x23d1d3={};_0x23d1d3[_0x1e0de2]={'$like':'%'+_0x37b6b0[_0x5ab5('0x32')]['filter']+'%'};return _0x23d1d3;})});}_0x4f8ef4=_['merge']({},_0x4f8ef4,_0x37b6b0[_0x5ab5('0x5a')]);return _0x42d13f['getAgents'](_0x4f8ef4);}})[_0x5ab5('0x25')](function(_0x53ff55){if(_0x53ff55){_0xa6e6ac=_0x53ff55[_0x5ab5('0x51')];if(!_0x37b6b0[_0x5ab5('0x32')][_0x5ab5('0x37')](_0x5ab5('0x38'))){_0x4f8ef4[_0x5ab5('0x1f')]=qs[_0x5ab5('0x1f')](_0x37b6b0[_0x5ab5('0x32')][_0x5ab5('0x1f')]);_0x4f8ef4[_0x5ab5('0x1e')]=qs[_0x5ab5('0x1e')](_0x37b6b0['query'][_0x5ab5('0x1e')]);}return _0x42d13f[_0x5ab5('0x7d')](_0x4f8ef4);}})[_0x5ab5('0x25')](function(_0x454799){if(_0x454799){return _0x454799?{'count':_0xa6e6ac,'rows':_0x454799}:null;}})[_0x5ab5('0x25')](respondWithResult(_0x2c8113,null))[_0x5ab5('0x48')](handleError(_0x2c8113,null));}; \ No newline at end of file +var _0x5e90=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','redis','./openchannelQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','destroy','get','UserProfileResource','then','stack','name','index','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelQueue','findAll','show','params','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','OpenchannelQueueId','UserOpenchannelQueue','User','UserId','agent','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','findOne','order','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x37bff9,_0x194334){var _0x4c57cc=function(_0x72c44e){while(--_0x72c44e){_0x37bff9['push'](_0x37bff9['shift']());}};_0x4c57cc(++_0x194334);}(_0x5e90,0x104));var _0x05e9=function(_0x292690,_0x209f59){_0x292690=_0x292690-0x0;var _0x1972a9=_0x5e90[_0x292690];return _0x1972a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05e9('0x0'));var zipdir=require(_0x05e9('0x1'));var jsonpatch=require(_0x05e9('0x2'));var rp=require(_0x05e9('0x3'));var moment=require(_0x05e9('0x4'));var BPromise=require(_0x05e9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x05e9('0x6'));var sox=require(_0x05e9('0x7'));var csv=require(_0x05e9('0x8'));var ejs=require(_0x05e9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05e9('0xa'));var squel=require('squel');var crypto=require(_0x05e9('0xb'));var jsforce=require(_0x05e9('0xc'));var deskjs=require(_0x05e9('0xd'));var toCsv=require(_0x05e9('0x8'));var querystring=require(_0x05e9('0xe'));var Papa=require('papaparse');var Redis=require(_0x05e9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x05e9('0x10'));var as=require(_0x05e9('0x11'));var hardwareService=require(_0x05e9('0x12'));var logger=require('../../config/logger')(_0x05e9('0x13'));var utils=require('../../config/utils');var config=require(_0x05e9('0x14'));var licenseUtil=require(_0x05e9('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x05e9('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05e9('0x17')]));require(_0x05e9('0x18'))['register'](socket);function respondWithStatusCode(_0x48f818,_0x26cd1f){_0x26cd1f=_0x26cd1f||0xcc;return function(_0x8237d6){if(_0x8237d6){return _0x48f818[_0x05e9('0x19')](_0x26cd1f);}return _0x48f818[_0x05e9('0x1a')](_0x26cd1f)[_0x05e9('0x1b')]();};}function respondWithResult(_0x2ea43d,_0x3bcc5c){_0x3bcc5c=_0x3bcc5c||0xc8;return function(_0x2ae119){if(_0x2ae119){return _0x2ea43d[_0x05e9('0x1a')](_0x3bcc5c)[_0x05e9('0x1c')](_0x2ae119);}};}function respondWithFilteredResult(_0x9511c7,_0x39a9fe){return function(_0x25c654){if(_0x25c654){var _0x246f1f=typeof _0x39a9fe[_0x05e9('0x1d')]==='undefined'&&typeof _0x39a9fe[_0x05e9('0x1e')]===_0x05e9('0x1f');var _0x1140a6=_0x25c654[_0x05e9('0x20')];var _0x378aa8=_0x246f1f?0x0:_0x39a9fe[_0x05e9('0x1d')];var _0x5bd1c8=_0x246f1f?_0x25c654[_0x05e9('0x20')]:_0x39a9fe[_0x05e9('0x1d')]+_0x39a9fe[_0x05e9('0x1e')];var _0x28ef20;if(_0x5bd1c8>=_0x1140a6){_0x5bd1c8=_0x1140a6;_0x28ef20=0xc8;}else{_0x28ef20=0xce;}_0x9511c7[_0x05e9('0x1a')](_0x28ef20);return _0x9511c7[_0x05e9('0x21')](_0x05e9('0x22'),_0x378aa8+'-'+_0x5bd1c8+'/'+_0x1140a6)[_0x05e9('0x1c')](_0x25c654);}return null;};}function patchUpdates(_0x2e66f7){return function(_0x4260e0){try{jsonpatch[_0x05e9('0x23')](_0x4260e0,_0x2e66f7,!![]);}catch(_0x4dc72c){return BPromise['reject'](_0x4dc72c);}return _0x4260e0['save']();};}function saveUpdates(_0x589eff,_0x5b47e5){return function(_0x557113){if(_0x557113){return _0x557113['update'](_0x589eff)['then'](function(_0xb0658b){return _0xb0658b;});}return null;};}function removeEntity(_0x4d26d6,_0xf502a3){return function(_0x42118a){if(_0x42118a){return _0x42118a[_0x05e9('0x24')]()['then'](function(){var _0x1e7e6b=_0x42118a[_0x05e9('0x25')]({'plain':!![]});var _0x972936='OpenchannelQueues';return db[_0x05e9('0x26')][_0x05e9('0x24')]({'where':{'type':_0x972936,'resourceId':_0x1e7e6b['id']}})[_0x05e9('0x27')](function(){return _0x42118a;});})[_0x05e9('0x27')](function(){_0x4d26d6[_0x05e9('0x1a')](0xcc)[_0x05e9('0x1b')]();});}};}function handleEntityNotFound(_0x4f62fb,_0x2797e1){return function(_0x55493e){if(!_0x55493e){_0x4f62fb['sendStatus'](0x194);}return _0x55493e;};}function handleError(_0x3eb1af,_0x1e468a){_0x1e468a=_0x1e468a||0x1f4;return function(_0x17c4e8){logger['error'](_0x17c4e8[_0x05e9('0x28')]);if(_0x17c4e8[_0x05e9('0x29')]){delete _0x17c4e8['name'];}_0x3eb1af[_0x05e9('0x1a')](_0x1e468a)['send'](_0x17c4e8);};}exports[_0x05e9('0x2a')]=function(_0x2d16f9,_0x4577ae){var _0x41449a={},_0x291a95={},_0x2827da={'count':0x0,'rows':[]};var _0xa25756=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x4ebe4a){return{'name':_0x4ebe4a[_0x05e9('0x2b')],'type':_0x4ebe4a[_0x05e9('0x2c')][_0x05e9('0x2d')]};});_0x291a95[_0x05e9('0x2e')]=_[_0x05e9('0x2f')](_0xa25756,_0x05e9('0x29'));_0x291a95[_0x05e9('0x30')]=_['keys'](_0x2d16f9[_0x05e9('0x30')]);_0x291a95['filters']=_[_0x05e9('0x31')](_0x291a95[_0x05e9('0x2e')],_0x291a95[_0x05e9('0x30')]);_0x41449a['attributes']=_[_0x05e9('0x31')](_0x291a95['model'],qs[_0x05e9('0x32')](_0x2d16f9[_0x05e9('0x30')][_0x05e9('0x32')]));_0x41449a[_0x05e9('0x33')]=_0x41449a['attributes'][_0x05e9('0x34')]?_0x41449a[_0x05e9('0x33')]:_0x291a95[_0x05e9('0x2e')];if(!_0x2d16f9[_0x05e9('0x30')][_0x05e9('0x35')](_0x05e9('0x36'))){_0x41449a[_0x05e9('0x1e')]=qs[_0x05e9('0x1e')](_0x2d16f9[_0x05e9('0x30')][_0x05e9('0x1e')]);_0x41449a['offset']=qs[_0x05e9('0x1d')](_0x2d16f9[_0x05e9('0x30')][_0x05e9('0x1d')]);}_0x41449a['order']=qs[_0x05e9('0x37')](_0x2d16f9[_0x05e9('0x30')][_0x05e9('0x37')]);_0x41449a[_0x05e9('0x38')]=qs[_0x05e9('0x39')](_[_0x05e9('0x3a')](_0x2d16f9[_0x05e9('0x30')],_0x291a95[_0x05e9('0x39')]),_0xa25756);if(_0x2d16f9[_0x05e9('0x30')][_0x05e9('0x3b')]){_0x41449a[_0x05e9('0x38')]=_[_0x05e9('0x3c')](_0x41449a['where'],{'$or':_[_0x05e9('0x2f')](_0xa25756,function(_0x237723){if(_0x237723[_0x05e9('0x2c')]!==_0x05e9('0x3d')){var _0x2bb627={};_0x2bb627[_0x237723[_0x05e9('0x29')]]={'$like':'%'+_0x2d16f9[_0x05e9('0x30')][_0x05e9('0x3b')]+'%'};return _0x2bb627;}})});}_0x41449a=_[_0x05e9('0x3c')]({},_0x41449a,_0x2d16f9[_0x05e9('0x3e')]);var _0x1b1f00={'where':_0x41449a[_0x05e9('0x38')]};return db['OpenchannelQueue'][_0x05e9('0x20')](_0x1b1f00)[_0x05e9('0x27')](function(_0x1fed0d){_0x2827da['count']=_0x1fed0d;if(_0x2d16f9['query'][_0x05e9('0x3f')]){_0x41449a[_0x05e9('0x40')]=[{'all':!![]}];}return db[_0x05e9('0x41')][_0x05e9('0x42')](_0x41449a);})['then'](function(_0x5ace69){_0x2827da['rows']=_0x5ace69;return _0x2827da;})[_0x05e9('0x27')](respondWithFilteredResult(_0x4577ae,_0x41449a))['catch'](handleError(_0x4577ae,null));};exports[_0x05e9('0x43')]=function(_0xf7608a,_0x23e89a){var _0x45c6a0={'raw':!![],'where':{'id':_0xf7608a[_0x05e9('0x44')]['id']}},_0x38e365={};_0x38e365[_0x05e9('0x2e')]=_[_0x05e9('0x45')](db[_0x05e9('0x41')][_0x05e9('0x46')]);_0x38e365['query']=_[_0x05e9('0x45')](_0xf7608a[_0x05e9('0x30')]);_0x38e365[_0x05e9('0x39')]=_[_0x05e9('0x31')](_0x38e365[_0x05e9('0x2e')],_0x38e365['query']);_0x45c6a0[_0x05e9('0x33')]=_[_0x05e9('0x31')](_0x38e365[_0x05e9('0x2e')],qs[_0x05e9('0x32')](_0xf7608a[_0x05e9('0x30')][_0x05e9('0x32')]));_0x45c6a0[_0x05e9('0x33')]=_0x45c6a0[_0x05e9('0x33')][_0x05e9('0x34')]?_0x45c6a0[_0x05e9('0x33')]:_0x38e365['model'];if(_0xf7608a[_0x05e9('0x30')]['includeAll']){_0x45c6a0[_0x05e9('0x40')]=[{'all':!![]}];}_0x45c6a0=_[_0x05e9('0x3c')]({},_0x45c6a0,_0xf7608a[_0x05e9('0x3e')]);return db[_0x05e9('0x41')][_0x05e9('0x47')](_0x45c6a0)[_0x05e9('0x27')](handleEntityNotFound(_0x23e89a,null))[_0x05e9('0x27')](respondWithResult(_0x23e89a,null))['catch'](handleError(_0x23e89a,null));};exports[_0x05e9('0x48')]=function(_0x43fe85,_0x5a6d76){return db[_0x05e9('0x41')][_0x05e9('0x48')](_0x43fe85[_0x05e9('0x49')],{})[_0x05e9('0x27')](function(_0x4f03c6){var _0x295d30=_0x43fe85['user'][_0x05e9('0x25')]({'plain':!![]});if(!_0x295d30)throw new Error(_0x05e9('0x4a'));if(_0x295d30[_0x05e9('0x4b')]===_0x05e9('0x4c')){var _0x145304=_0x4f03c6['get']({'plain':!![]});var _0x4425a1=_0x05e9('0x4d');return db[_0x05e9('0x4e')][_0x05e9('0x47')]({'where':{'name':_0x4425a1,'userProfileId':_0x295d30[_0x05e9('0x4f')]},'raw':!![]})[_0x05e9('0x27')](function(_0x36625d){if(_0x36625d&&_0x36625d[_0x05e9('0x50')]===0x0){return db[_0x05e9('0x26')][_0x05e9('0x48')]({'name':_0x145304[_0x05e9('0x29')],'resourceId':_0x145304['id'],'type':_0x36625d['name'],'sectionId':_0x36625d['id']},{})['then'](function(){return _0x4f03c6;});}else{return _0x4f03c6;}})[_0x05e9('0x51')](function(_0xf75c74){logger['error'](_0x05e9('0x52'),_0xf75c74);throw _0xf75c74;});}return _0x4f03c6;})[_0x05e9('0x27')](respondWithResult(_0x5a6d76,0xc9))[_0x05e9('0x51')](handleError(_0x5a6d76,null));};exports[_0x05e9('0x53')]=function(_0x3e3f43,_0x3255d4){if(_0x3e3f43['body']['id']){delete _0x3e3f43['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x3e3f43[_0x05e9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3255d4,null))[_0x05e9('0x27')](saveUpdates(_0x3e3f43['body'],null))['then'](respondWithResult(_0x3255d4,null))[_0x05e9('0x51')](handleError(_0x3255d4,null));};exports[_0x05e9('0x24')]=function(_0x391897,_0x3c6811){return db[_0x05e9('0x41')][_0x05e9('0x47')]({'where':{'id':_0x391897[_0x05e9('0x44')]['id']}})[_0x05e9('0x27')](handleEntityNotFound(_0x3c6811,null))['then'](removeEntity(_0x3c6811,null))[_0x05e9('0x51')](handleError(_0x3c6811,null));};exports[_0x05e9('0x54')]=function(_0x4e3488,_0x55fe5f){return db[_0x05e9('0x41')]['describe']()[_0x05e9('0x27')](respondWithResult(_0x55fe5f,null))['catch'](handleError(_0x55fe5f,null));};exports[_0x05e9('0x55')]=function(_0x2a5ec3,_0x57a52b,_0x469a3a){var _0x24c674={'raw':!![],'where':{}},_0x116d83={},_0x151113;return db[_0x05e9('0x41')]['findOne']({'where':{'id':_0x2a5ec3[_0x05e9('0x44')]['id']}})[_0x05e9('0x27')](handleEntityNotFound(_0x57a52b,null))[_0x05e9('0x27')](function(_0x2c715c){if(_0x2c715c){_0x151113=_0x2c715c[_0x05e9('0x25')]({'plain':!![]});_0x116d83['model']=_[_0x05e9('0x45')](db['UserOpenchannelQueue'][_0x05e9('0x46')]);_0x116d83['query']=_['keys'](_0x2a5ec3[_0x05e9('0x30')]);_0x116d83[_0x05e9('0x39')]=_[_0x05e9('0x31')](_0x116d83['model'],_0x116d83['query']);_0x24c674['attributes']=_[_0x05e9('0x31')](_0x116d83[_0x05e9('0x2e')],qs[_0x05e9('0x32')](_0x2a5ec3[_0x05e9('0x30')]['fields']));_0x24c674[_0x05e9('0x33')]=_0x24c674[_0x05e9('0x33')]['length']?_0x24c674[_0x05e9('0x33')]:_0x116d83[_0x05e9('0x2e')];if(!_0x2a5ec3[_0x05e9('0x30')][_0x05e9('0x35')]('nolimit')){_0x24c674[_0x05e9('0x1e')]=qs['limit'](_0x2a5ec3['query'][_0x05e9('0x1e')]);_0x24c674['offset']=qs[_0x05e9('0x1d')](_0x2a5ec3[_0x05e9('0x30')][_0x05e9('0x1d')]);}_0x24c674['order']=qs[_0x05e9('0x37')](_0x2a5ec3[_0x05e9('0x30')][_0x05e9('0x37')]);_0x24c674['where']=qs[_0x05e9('0x39')](_[_0x05e9('0x3a')](_0x2a5ec3[_0x05e9('0x30')],_0x116d83[_0x05e9('0x39')]));_0x24c674[_0x05e9('0x38')][_0x05e9('0x56')]=_0x2c715c['id'];if(_0x2a5ec3[_0x05e9('0x30')][_0x05e9('0x3b')]){_0x24c674[_0x05e9('0x38')]=_[_0x05e9('0x3c')](_0x24c674[_0x05e9('0x38')],{'$or':_[_0x05e9('0x2f')](_0x24c674[_0x05e9('0x33')],function(_0x6d6d3e){var _0x448e8f={};_0x448e8f[_0x6d6d3e]={'$like':'%'+_0x2a5ec3[_0x05e9('0x30')][_0x05e9('0x3b')]+'%'};return _0x448e8f;})});}_0x24c674=_[_0x05e9('0x3c')]({},_0x24c674,_0x2a5ec3[_0x05e9('0x3e')]);return db[_0x05e9('0x57')][_0x05e9('0x42')](_0x24c674);}})[_0x05e9('0x27')](function(_0x57fd34){if(_0x57fd34){return db[_0x05e9('0x58')]['findAndCountAll']({'where':{'id':_['map'](_0x57fd34,_0x05e9('0x59')),'role':_0x05e9('0x5a')},'attributes':['id',_0x05e9('0x29'),'openchannelPause',_0x05e9('0x5b'),_0x05e9('0x5c')]});}})['then'](function(_0x93d092){if(_0x93d092){return{'count':_0x93d092[_0x05e9('0x20')],'rows':_[_0x05e9('0x2f')](_0x93d092[_0x05e9('0x5d')],function(_0x50ba97){return{'membername':_0x50ba97['name'],'UserId':_0x50ba97['id'],'queue_name':_0x151113[_0x05e9('0x29')],'OpenchannelQueueId':_0x151113['id'],'interface':util['format'](_0x05e9('0x5e'),_0x05e9('0x5f'),_0x50ba97[_0x05e9('0x29')]),'penalty':0x0,'paused':_0x50ba97['openchannelPause'],'createdAt':_0x50ba97[_0x05e9('0x5c')],'updatedAt':_0x50ba97[_0x05e9('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x05e9('0x27')](respondWithFilteredResult(_0x57a52b,_0x24c674))[_0x05e9('0x51')](handleError(_0x57a52b,null));};exports[_0x05e9('0x60')]=function(_0x164015,_0xbdb920,_0x3139a7){var _0x254613={};var _0x3aca6f={};var _0x3527a1;var _0x182fc7;return db[_0x05e9('0x41')][_0x05e9('0x61')]({'where':{'id':_0x164015[_0x05e9('0x44')]['id']}})[_0x05e9('0x27')](handleEntityNotFound(_0xbdb920,null))['then'](function(_0x588fcd){if(_0x588fcd){_0x3527a1=_0x588fcd;_0x3aca6f[_0x05e9('0x2e')]=_[_0x05e9('0x45')](db['Team'][_0x05e9('0x46')]);_0x3aca6f[_0x05e9('0x30')]=_[_0x05e9('0x45')](_0x164015[_0x05e9('0x30')]);_0x3aca6f['filters']=_['intersection'](_0x3aca6f[_0x05e9('0x2e')],_0x3aca6f[_0x05e9('0x30')]);_0x254613['attributes']=_[_0x05e9('0x31')](_0x3aca6f['model'],qs[_0x05e9('0x32')](_0x164015[_0x05e9('0x30')][_0x05e9('0x32')]));_0x254613[_0x05e9('0x33')]=_0x254613[_0x05e9('0x33')][_0x05e9('0x34')]?_0x254613[_0x05e9('0x33')]:_0x3aca6f[_0x05e9('0x2e')];_0x254613[_0x05e9('0x62')]=qs[_0x05e9('0x37')](_0x164015[_0x05e9('0x30')]['sort']);_0x254613['where']=qs[_0x05e9('0x39')](_['pick'](_0x164015[_0x05e9('0x30')],_0x3aca6f[_0x05e9('0x39')]));if(_0x164015[_0x05e9('0x30')][_0x05e9('0x3b')]){_0x254613['where']=_[_0x05e9('0x3c')](_0x254613[_0x05e9('0x38')],{'$or':_[_0x05e9('0x2f')](_0x254613[_0x05e9('0x33')],function(_0x18afd4){var _0x2245b6={};_0x2245b6[_0x18afd4]={'$like':'%'+_0x164015['query'][_0x05e9('0x3b')]+'%'};return _0x2245b6;})});}_0x254613=_['merge']({},_0x254613,_0x164015[_0x05e9('0x3e')]);return _0x3527a1[_0x05e9('0x60')](_0x254613);}})[_0x05e9('0x27')](function(_0x4090e2){if(_0x4090e2){_0x182fc7=_0x4090e2[_0x05e9('0x34')];if(!_0x164015[_0x05e9('0x30')][_0x05e9('0x35')](_0x05e9('0x36'))){_0x254613[_0x05e9('0x1e')]=qs[_0x05e9('0x1e')](_0x164015['query']['limit']);_0x254613[_0x05e9('0x1d')]=qs[_0x05e9('0x1d')](_0x164015[_0x05e9('0x30')]['offset']);}return _0x3527a1[_0x05e9('0x60')](_0x254613);}})[_0x05e9('0x27')](function(_0x151608){if(_0x151608){return _0x151608?{'count':_0x182fc7,'rows':_0x151608}:null;}})['then'](respondWithResult(_0xbdb920,null))[_0x05e9('0x51')](handleError(_0xbdb920,null));};exports[_0x05e9('0x63')]=function(_0x7f4c36,_0x43879c,_0x2726b0){var _0x27df4b=_0x7f4c36[_0x05e9('0x49')][_0x05e9('0x64')];return db[_0x05e9('0x65')][_0x05e9('0x42')]({'where':{'id':_0x27df4b},'attributes':['id'],'include':[{'model':db[_0x05e9('0x58')],'as':_0x05e9('0x66'),'attributes':['id',_0x05e9('0x29'),'online',_0x05e9('0x67'),_0x05e9('0x68')],'raw':!![]}]})[_0x05e9('0x27')](function(_0x241bb3){if(_0x241bb3){var _0x94b0ba=_[_0x05e9('0x69')](_0x241bb3,function(_0x2d330f){var _0x209c71=_0x2d330f['get']({'plain':!![]});return _0x209c71[_0x05e9('0x66')];});return db['OpenchannelQueue'][_0x05e9('0x47')]({'where':{'id':_0x7f4c36[_0x05e9('0x44')]['id']}})[_0x05e9('0x27')](function(_0x278d17){return db[_0x05e9('0x6a')][_0x05e9('0x6b')](function(_0x2c074e){return _0x278d17[_0x05e9('0x63')](_0x27df4b,{'transaction':_0x2c074e})[_0x05e9('0x27')](function(){return BPromise[_0x05e9('0x6c')](_0x94b0ba,function(_0x338b70){return db['UserOpenchannelQueue'][_0x05e9('0x6d')]({'where':{'UserId':_0x338b70['id'],'OpenchannelQueueId':_0x7f4c36['params']['id']},'transaction':_0x2c074e});});})[_0x05e9('0x27')](function(){_0x94b0ba['forEach'](function(_0x274bcf){socket[_0x05e9('0x6e')](_0x05e9('0x6f'),{'UserId':_0x274bcf['id'],'OpenchannelQueueId':_0x278d17['id']});});});});});}})[_0x05e9('0x27')](respondWithStatusCode(_0x43879c,null))[_0x05e9('0x51')](handleError(_0x43879c,null));};exports['removeTeams']=function(_0x138712,_0x20e74e,_0x12aa2b){return db[_0x05e9('0x65')][_0x05e9('0x42')]({'where':{'id':_0x138712[_0x05e9('0x30')][_0x05e9('0x64')]},'attributes':['id'],'include':[{'model':db[_0x05e9('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x05e9('0x27')](handleEntityNotFound(_0x20e74e,null))[_0x05e9('0x27')](function(_0x479576){var _0x2a20fa=_[_0x05e9('0x2f')](_0x479576,'id');var _0x5f2e5f=[];var _0xfd2b99=[];var _0x52dd72=squel['select']();_0x52dd72[_0x05e9('0x70')](_0x05e9('0x71'))['from'](_0x05e9('0x72'),'tq')[_0x05e9('0x73')](_0x05e9('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x05e9('0x38')](_0x05e9('0x75'),_0x138712[_0x05e9('0x44')]['id']);for(var _0xeea042=0x0;_0xeea042<_0x479576[_0x05e9('0x34')];_0xeea042+=0x1){let _0x57b03d=_0x479576[_0xeea042];for(var _0x262241=0x0;_0x262241<_0x57b03d[_0x05e9('0x66')][_0x05e9('0x34')];_0x262241+=0x1){let _0x69b147=_0x57b03d[_0x05e9('0x66')][_0x262241];var _0x4bc147=_0x52dd72[_0x05e9('0x76')]();_0x4bc147[_0x05e9('0x38')](_0x05e9('0x77'),_0x69b147['id']);_0xfd2b99['push'](db[_0x05e9('0x6a')][_0x05e9('0x30')](_0x4bc147['toString'](),{'type':db[_0x05e9('0x6a')][_0x05e9('0x78')]['SELECT']})[_0x05e9('0x27')](function(_0x281930){if(_0x281930[_0x05e9('0x34')]===0x1){return _0x69b147['id'];}else{var _0xf8be52=_[_0x05e9('0x79')](_[_0x05e9('0x2f')](_0x281930,'TeamId'),function(_0x1ef62d){return _['includes'](_0x2a20fa,_0x1ef62d);});if(_0xf8be52){return _0x69b147['id'];}}}));}}return BPromise['all'](_0xfd2b99)[_0x05e9('0x27')](function(_0x403d83){_0x5f2e5f=_(_0x5f2e5f)[_0x05e9('0x7a')](_0x403d83)[_0x05e9('0x7b')]()[_0x05e9('0x7c')]();return db[_0x05e9('0x41')][_0x05e9('0x47')]({'where':{'id':_0x138712['params']['id']}})['then'](function(_0x1d6276){return db[_0x05e9('0x6a')][_0x05e9('0x6b')](function(_0x44b35b){return _0x1d6276[_0x05e9('0x7d')](_0x138712[_0x05e9('0x30')]['ids'],{'transaction':_0x44b35b})[_0x05e9('0x27')](function(){if(!_[_0x05e9('0x7e')](_0x5f2e5f)){return _0x1d6276[_0x05e9('0x7f')](_0x5f2e5f,{'transaction':_0x44b35b});}})[_0x05e9('0x27')](function(){_0x5f2e5f[_0x05e9('0x80')](function(_0x1cc0a0){socket[_0x05e9('0x6e')](_0x05e9('0x81'),{'UserId':_0x1cc0a0,'OpenchannelQueueId':_0x1d6276['id']});});});});});});})['then'](respondWithStatusCode(_0x20e74e,null))['catch'](handleError(_0x20e74e,null));};exports['addAgents']=function(_0x52bab8,_0x3aed73,_0x131ebc){return db['OpenchannelQueue'][_0x05e9('0x47')]({'where':{'id':_0x52bab8[_0x05e9('0x44')]['id']}})[_0x05e9('0x27')](handleEntityNotFound(_0x3aed73,null))[_0x05e9('0x27')](function(_0x1a0b0d){if(_0x1a0b0d){return _0x1a0b0d[_0x05e9('0x82')](_0x52bab8['body'][_0x05e9('0x64')],_['omit'](_0x52bab8[_0x05e9('0x49')],[_0x05e9('0x64'),'id'])||{})[_0x05e9('0x83')](function(_0x1ab1a6){for(var _0x5132aa=0x0;_0x5132aa<_0x52bab8[_0x05e9('0x49')][_0x05e9('0x64')]['length'];_0x5132aa+=0x1){socket[_0x05e9('0x6e')](_0x05e9('0x6f'),{'UserId':Number(_0x52bab8[_0x05e9('0x49')]['ids'][_0x5132aa]),'OpenchannelQueueId':Number(_0x52bab8[_0x05e9('0x44')]['id'])});}return _0x1ab1a6;});}})[_0x05e9('0x27')](respondWithResult(_0x3aed73,null))[_0x05e9('0x51')](handleError(_0x3aed73,null));};exports[_0x05e9('0x7f')]=function(_0x269783,_0x50932d,_0x2d6f1a){return db['OpenchannelQueue'][_0x05e9('0x47')]({'where':{'id':_0x269783[_0x05e9('0x44')]['id']}})[_0x05e9('0x27')](handleEntityNotFound(_0x50932d,null))[_0x05e9('0x27')](function(_0x14aca3){if(_0x14aca3){return _0x14aca3['removeAgents'](_0x269783['query']['ids'])[_0x05e9('0x27')](function(){if(_['isArray'](_0x269783[_0x05e9('0x30')][_0x05e9('0x64')])){for(var _0x15e921=0x0;_0x15e921<_0x269783['query']['ids'][_0x05e9('0x34')];_0x15e921+=0x1){socket[_0x05e9('0x6e')](_0x05e9('0x81'),{'UserId':Number(_0x269783[_0x05e9('0x30')][_0x05e9('0x64')][_0x15e921]),'OpenchannelQueueId':Number(_0x269783[_0x05e9('0x44')]['id'])});}}else{socket['emit'](_0x05e9('0x81'),{'UserId':Number(_0x269783['query'][_0x05e9('0x64')]),'OpenchannelQueueId':Number(_0x269783[_0x05e9('0x44')]['id'])});}});}})[_0x05e9('0x27')](respondWithStatusCode(_0x50932d,null))['catch'](handleError(_0x50932d,null));};exports[_0x05e9('0x84')]=function(_0x58aee4,_0x3e9445,_0x52be69){var _0x5a18b4={};var _0x5bc4b8={};var _0x1a790f;var _0x38aeac;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x58aee4[_0x05e9('0x44')]['id']}})[_0x05e9('0x27')](handleEntityNotFound(_0x3e9445,null))['then'](function(_0x41ad85){if(_0x41ad85){_0x1a790f=_0x41ad85;_0x5bc4b8[_0x05e9('0x2e')]=_[_0x05e9('0x45')](db[_0x05e9('0x58')][_0x05e9('0x46')]);_0x5bc4b8['query']=_[_0x05e9('0x45')](_0x58aee4[_0x05e9('0x30')]);_0x5bc4b8[_0x05e9('0x39')]=_[_0x05e9('0x31')](_0x5bc4b8['model'],_0x5bc4b8[_0x05e9('0x30')]);_0x5a18b4[_0x05e9('0x33')]=_['intersection'](_0x5bc4b8[_0x05e9('0x2e')],qs['fields'](_0x58aee4[_0x05e9('0x30')][_0x05e9('0x32')]));_0x5a18b4['attributes']=_0x5a18b4['attributes']['length']?_0x5a18b4[_0x05e9('0x33')]:_0x5bc4b8[_0x05e9('0x2e')];_0x5a18b4[_0x05e9('0x62')]=qs['sort'](_0x58aee4[_0x05e9('0x30')][_0x05e9('0x37')]);_0x5a18b4[_0x05e9('0x38')]=qs[_0x05e9('0x39')](_[_0x05e9('0x3a')](_0x58aee4[_0x05e9('0x30')],_0x5bc4b8[_0x05e9('0x39')]));if(_0x58aee4[_0x05e9('0x30')][_0x05e9('0x3b')]){_0x5a18b4[_0x05e9('0x38')]=_[_0x05e9('0x3c')](_0x5a18b4['where'],{'$or':_[_0x05e9('0x2f')](_0x5a18b4[_0x05e9('0x33')],function(_0x4f6f9d){var _0x17cc15={};_0x17cc15[_0x4f6f9d]={'$like':'%'+_0x58aee4[_0x05e9('0x30')]['filter']+'%'};return _0x17cc15;})});}_0x5a18b4=_[_0x05e9('0x3c')]({},_0x5a18b4,_0x58aee4[_0x05e9('0x3e')]);return _0x1a790f[_0x05e9('0x84')](_0x5a18b4);}})[_0x05e9('0x27')](function(_0xe62ecd){if(_0xe62ecd){_0x38aeac=_0xe62ecd['length'];if(!_0x58aee4['query']['hasOwnProperty'](_0x05e9('0x36'))){_0x5a18b4[_0x05e9('0x1e')]=qs['limit'](_0x58aee4['query'][_0x05e9('0x1e')]);_0x5a18b4[_0x05e9('0x1d')]=qs[_0x05e9('0x1d')](_0x58aee4[_0x05e9('0x30')]['offset']);}return _0x1a790f[_0x05e9('0x84')](_0x5a18b4);}})[_0x05e9('0x27')](function(_0x4ee3eb){if(_0x4ee3eb){return _0x4ee3eb?{'count':_0x38aeac,'rows':_0x4ee3eb}:null;}})[_0x05e9('0x27')](respondWithResult(_0x3e9445,null))[_0x05e9('0x51')](handleError(_0x3e9445,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 2545c74..68a52a3 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 _0x20d6=['hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners','remove','emit'];(function(_0x4e82b7,_0x354327){var _0xc6f6bb=function(_0x4a418f){while(--_0x4a418f){_0x4e82b7['push'](_0x4e82b7['shift']());}};_0xc6f6bb(++_0x354327);}(_0x20d6,0x167));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x620d('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x620d('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x620d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x620d('0x3')};function emitEvent(_0x1e9148){return function(_0x52dbd7,_0x342177,_0x3e4f00){OpenchannelQueueEvents[_0x620d('0x4')](_0x1e9148+':'+_0x52dbd7['id'],_0x52dbd7);OpenchannelQueueEvents[_0x620d('0x4')](_0x1e9148,_0x52dbd7);_0x3e4f00(null);};}for(var e in events){if(events[_0x620d('0x5')](e)){var event=events[e];OpenchannelQueue[_0x620d('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x8781=['update','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x54d06e,_0x198577){var _0x2c43a0=function(_0x465d26){while(--_0x465d26){_0x54d06e['push'](_0x54d06e['shift']());}};_0x2c43a0(++_0x198577);}(_0x8781,0x19d));var _0x1878=function(_0x1e54f9,_0x85e1c){_0x1e54f9=_0x1e54f9-0x0;var _0x435794=_0x8781[_0x1e54f9];return _0x435794;};'use strict';var EventEmitter=require(_0x1878('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1878('0x1')](0x0);var events={'afterCreate':_0x1878('0x2'),'afterUpdate':_0x1878('0x3'),'afterDestroy':'remove'};function emitEvent(_0xb3124c){return function(_0xe950f6,_0x3ed5f7,_0x41aa0d){OpenchannelQueueEvents['emit'](_0xb3124c+':'+_0xe950f6['id'],_0xe950f6);OpenchannelQueueEvents[_0x1878('0x4')](_0xb3124c,_0xe950f6);_0x41aa0d(null);};}for(var e in events){if(events[_0x1878('0x5')](e)){var event=events[e];OpenchannelQueue[_0x1878('0x6')](e,emitEvent(event));}}module[_0x1878('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 f2b7b8a..bacd402 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 _0xf257=['rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x10c42d,_0x209a11){var _0x5c247b=function(_0x1db107){while(--_0x1db107){_0x10c42d['push'](_0x10c42d['shift']());}};_0x5c247b(++_0x209a11);}(_0xf257,0x1c0));var _0x7f25=function(_0x9388c8,_0x2cdf84){_0x9388c8=_0x9388c8-0x0;var _0x6f1d3a=_0xf257[_0x9388c8];return _0x6f1d3a;};'use strict';var _=require(_0x7f25('0x0'));var util=require(_0x7f25('0x1'));var logger=require(_0x7f25('0x2'))('api');var moment=require(_0x7f25('0x3'));var BPromise=require(_0x7f25('0x4'));var rp=require(_0x7f25('0x5'));var fs=require('fs');var path=require(_0x7f25('0x6'));var rimraf=require(_0x7f25('0x7'));var config=require(_0x7f25('0x8'));var attributes=require(_0x7f25('0x9'));module['exports']=function(_0x5df169,_0x278e19){return _0x5df169[_0x7f25('0xa')](_0x7f25('0xb'),attributes,{'tableName':_0x7f25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a63=['moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','api'];(function(_0xa4b9b8,_0x377218){var _0x380e55=function(_0x401d1a){while(--_0x401d1a){_0xa4b9b8['push'](_0xa4b9b8['shift']());}};_0x380e55(++_0x377218);}(_0x9a63,0xfb));var _0x39a6=function(_0x8935ce,_0x3621c3){_0x8935ce=_0x8935ce-0x0;var _0x1a422f=_0x9a63[_0x8935ce];return _0x1a422f;};'use strict';var _=require(_0x39a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x39a6('0x1'));var moment=require(_0x39a6('0x2'));var BPromise=require(_0x39a6('0x3'));var rp=require(_0x39a6('0x4'));var fs=require('fs');var path=require(_0x39a6('0x5'));var rimraf=require(_0x39a6('0x6'));var config=require('../../config/environment');var attributes=require(_0x39a6('0x7'));module[_0x39a6('0x8')]=function(_0x16deea,_0x274451){return _0x16deea[_0x39a6('0x9')](_0x39a6('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index b0be666..73bae39 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 _0x3a5b=['../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','include','model','attributes','map','ShowOpenchannelQueue','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x3a5b,0x122));var _0xb3a5=function(_0x2f88bf,_0x761a0e){_0x2f88bf=_0x2f88bf-0x0;var _0x1b451e=_0x3a5b[_0x2f88bf];return _0x1b451e;};'use strict';var _=require(_0xb3a5('0x0'));var util=require(_0xb3a5('0x1'));var moment=require(_0xb3a5('0x2'));var BPromise=require(_0xb3a5('0x3'));var rs=require(_0xb3a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3a5('0x5'))['db'];var utils=require(_0xb3a5('0x6'));var logger=require('../../config/logger')(_0xb3a5('0x7'));var config=require(_0xb3a5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb3a5('0x9')][_0xb3a5('0xa')]({'port':0x232a});config[_0xb3a5('0xb')]=_[_0xb3a5('0xc')](config[_0xb3a5('0xb')],{'host':_0xb3a5('0xd'),'port':0x18eb});var socket=require(_0xb3a5('0xe'))(new Redis(config['redis']));require(_0xb3a5('0xf'))[_0xb3a5('0x10')](socket);function respondWithRpcPromise(_0x4b85c9,_0x5bcc60,_0x1d8333){return new BPromise(function(_0x814442,_0xe10def){return client['request'](_0x4b85c9,_0x1d8333)[_0xb3a5('0x11')](function(_0x5977de){logger[_0xb3a5('0x12')](_0xb3a5('0x13'),_0x5bcc60,'request\x20sent');logger[_0xb3a5('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5bcc60,'request\x20sent',JSON[_0xb3a5('0x15')](_0x5977de));if(_0x5977de['error']){if(_0x5977de[_0xb3a5('0x16')]['code']===0x1f4){logger[_0xb3a5('0x16')](_0xb3a5('0x13'),_0x5bcc60,_0x5977de[_0xb3a5('0x16')][_0xb3a5('0x17')]);return _0xe10def(_0x5977de[_0xb3a5('0x16')][_0xb3a5('0x17')]);}logger[_0xb3a5('0x16')](_0xb3a5('0x13'),_0x5bcc60,_0x5977de[_0xb3a5('0x16')][_0xb3a5('0x17')]);return _0x814442(_0x5977de[_0xb3a5('0x16')][_0xb3a5('0x17')]);}else{logger[_0xb3a5('0x12')](_0xb3a5('0x13'),_0x5bcc60,_0xb3a5('0x18'));_0x814442(_0x5977de['result'][_0xb3a5('0x17')]);}})[_0xb3a5('0x19')](function(_0x51e28c){logger[_0xb3a5('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x5bcc60,_0x51e28c);_0xe10def(_0x51e28c);});});}exports[_0xb3a5('0x1a')]=function(_0x43dee9){var _0x2cc683=this;return new Promise(function(_0x13be4a,_0x5bcf36){return db[_0xb3a5('0x1b')][_0xb3a5('0x1c')]({'raw':_0x43dee9[_0xb3a5('0x1d')]?_0x43dee9[_0xb3a5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x43dee9['options']?_0x43dee9[_0xb3a5('0x1d')][_0xb3a5('0x1e')]||null:null,'attributes':_0x43dee9[_0xb3a5('0x1d')]?_0x43dee9[_0xb3a5('0x1d')]['attributes']||null:null,'limit':_0x43dee9[_0xb3a5('0x1d')]?_0x43dee9[_0xb3a5('0x1d')]['limit']||null:null,'include':_0x43dee9[_0xb3a5('0x1d')]?_0x43dee9[_0xb3a5('0x1d')][_0xb3a5('0x1f')]?_['map'](_0x43dee9[_0xb3a5('0x1d')][_0xb3a5('0x1f')],function(_0x2f18d5){return{'model':db[_0x2f18d5[_0xb3a5('0x20')]],'as':_0x2f18d5['as'],'attributes':_0x2f18d5[_0xb3a5('0x21')],'include':_0x2f18d5[_0xb3a5('0x1f')]?_['map'](_0x2f18d5['include'],function(_0x5d3882){return{'model':db[_0x5d3882[_0xb3a5('0x20')]],'as':_0x5d3882['as'],'attributes':_0x5d3882[_0xb3a5('0x21')],'include':_0x5d3882[_0xb3a5('0x1f')]?_[_0xb3a5('0x22')](_0x5d3882[_0xb3a5('0x1f')],function(_0x273ed6){return{'model':db[_0x273ed6[_0xb3a5('0x20')]],'as':_0x273ed6['as'],'attributes':_0x273ed6[_0xb3a5('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a16dd){logger[_0xb3a5('0x12')]('GetOpenchannelQueue',_0x43dee9);logger[_0xb3a5('0x14')](_0xb3a5('0x1a'),_0x43dee9,JSON['stringify'](_0x3a16dd));_0x13be4a(_0x3a16dd);})[_0xb3a5('0x19')](function(_0x1a13fb){logger[_0xb3a5('0x16')](_0xb3a5('0x1a'),_0x1a13fb[_0xb3a5('0x17')],_0x43dee9);_0x5bcf36(_0x2cc683['error'](0x1f4,_0x1a13fb[_0xb3a5('0x17')]));});});};exports[_0xb3a5('0x23')]=function(_0x5bcf17){var _0x3aa87b=this;return new Promise(function(_0x1edeab,_0x58f27f){return db['OpenchannelQueue']['find']({'raw':_0x5bcf17[_0xb3a5('0x1d')]?_0x5bcf17[_0xb3a5('0x1d')][_0xb3a5('0x24')]===undefined?!![]:![]:!![],'where':_0x5bcf17['options']?_0x5bcf17[_0xb3a5('0x1d')][_0xb3a5('0x1e')]||null:null,'attributes':_0x5bcf17[_0xb3a5('0x1d')]?_0x5bcf17[_0xb3a5('0x1d')][_0xb3a5('0x21')]||null:null,'include':_0x5bcf17['options']?_0x5bcf17['options'][_0xb3a5('0x1f')]?_[_0xb3a5('0x22')](_0x5bcf17[_0xb3a5('0x1d')][_0xb3a5('0x1f')],function(_0x5be91c){return{'model':db[_0x5be91c['model']],'as':_0x5be91c['as'],'attributes':_0x5be91c[_0xb3a5('0x21')],'include':_0x5be91c[_0xb3a5('0x1f')]?_[_0xb3a5('0x22')](_0x5be91c[_0xb3a5('0x1f')],function(_0x5df45d){return{'model':db[_0x5df45d['model']],'as':_0x5df45d['as'],'attributes':_0x5df45d['attributes'],'include':_0x5df45d[_0xb3a5('0x1f')]?_[_0xb3a5('0x22')](_0x5df45d['include'],function(_0x406c95){return{'model':db[_0x406c95[_0xb3a5('0x20')]],'as':_0x406c95['as'],'attributes':_0x406c95[_0xb3a5('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb3a5('0x11')](function(_0x4caf46){logger[_0xb3a5('0x12')](_0xb3a5('0x23'),_0x5bcf17);logger[_0xb3a5('0x14')](_0xb3a5('0x23'),_0x5bcf17,JSON[_0xb3a5('0x15')](_0x4caf46));_0x1edeab(_0x4caf46);})[_0xb3a5('0x19')](function(_0x12f0ba){logger[_0xb3a5('0x16')](_0xb3a5('0x23'),_0x12f0ba['message'],_0x5bcf17);_0x58f27f(_0x3aa87b[_0xb3a5('0x16')](0x1f4,_0x12f0ba[_0xb3a5('0x17')]));});});}; \ No newline at end of file +var _0x6cbf=['result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x1f909a,_0x15d56f){var _0x543f16=function(_0x17a991){while(--_0x17a991){_0x1f909a['push'](_0x1f909a['shift']());}};_0x543f16(++_0x15d56f);}(_0x6cbf,0x1d2));var _0xf6cb=function(_0x4acc32,_0x1685e7){_0x4acc32=_0x4acc32-0x0;var _0x5b019a=_0x6cbf[_0x4acc32];return _0x5b019a;};'use strict';var _=require(_0xf6cb('0x0'));var util=require(_0xf6cb('0x1'));var moment=require(_0xf6cb('0x2'));var BPromise=require('bluebird');var rs=require(_0xf6cb('0x3'));var fs=require('fs');var Redis=require(_0xf6cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6cb('0x5'));var logger=require('../../config/logger')(_0xf6cb('0x6'));var config=require('../../config/environment');var jayson=require(_0xf6cb('0x7'));var client=jayson[_0xf6cb('0x8')]['http']({'port':0x232a});config[_0xf6cb('0x9')]=_[_0xf6cb('0xa')](config[_0xf6cb('0x9')],{'host':_0xf6cb('0xb'),'port':0x18eb});var socket=require(_0xf6cb('0xc'))(new Redis(config[_0xf6cb('0x9')]));require(_0xf6cb('0xd'))[_0xf6cb('0xe')](socket);function respondWithRpcPromise(_0x4b744f,_0x1a3c08,_0x452b85){return new BPromise(function(_0x467f94,_0x150f01){return client[_0xf6cb('0xf')](_0x4b744f,_0x452b85)[_0xf6cb('0x10')](function(_0x38ff0e){logger['info'](_0xf6cb('0x11'),_0x1a3c08,'request\x20sent');logger[_0xf6cb('0x12')](_0xf6cb('0x13'),_0x1a3c08,_0xf6cb('0x14'),JSON[_0xf6cb('0x15')](_0x38ff0e));if(_0x38ff0e['error']){if(_0x38ff0e[_0xf6cb('0x16')][_0xf6cb('0x17')]===0x1f4){logger[_0xf6cb('0x16')](_0xf6cb('0x11'),_0x1a3c08,_0x38ff0e[_0xf6cb('0x16')][_0xf6cb('0x18')]);return _0x150f01(_0x38ff0e[_0xf6cb('0x16')]['message']);}logger[_0xf6cb('0x16')](_0xf6cb('0x11'),_0x1a3c08,_0x38ff0e[_0xf6cb('0x16')][_0xf6cb('0x18')]);return _0x467f94(_0x38ff0e['error'][_0xf6cb('0x18')]);}else{logger[_0xf6cb('0x19')](_0xf6cb('0x11'),_0x1a3c08,_0xf6cb('0x14'));_0x467f94(_0x38ff0e[_0xf6cb('0x1a')][_0xf6cb('0x18')]);}})[_0xf6cb('0x1b')](function(_0x32c888){logger[_0xf6cb('0x16')](_0xf6cb('0x11'),_0x1a3c08,_0x32c888);_0x150f01(_0x32c888);});});}exports[_0xf6cb('0x1c')]=function(_0x29acce){var _0x1be839=this;return new Promise(function(_0x4917ff,_0x170933){return db[_0xf6cb('0x1d')][_0xf6cb('0x1e')]({'raw':_0x29acce[_0xf6cb('0x1f')]?_0x29acce[_0xf6cb('0x1f')][_0xf6cb('0x20')]===undefined?!![]:![]:!![],'where':_0x29acce[_0xf6cb('0x1f')]?_0x29acce[_0xf6cb('0x1f')][_0xf6cb('0x21')]||null:null,'attributes':_0x29acce[_0xf6cb('0x1f')]?_0x29acce[_0xf6cb('0x1f')][_0xf6cb('0x22')]||null:null,'limit':_0x29acce['options']?_0x29acce[_0xf6cb('0x1f')][_0xf6cb('0x23')]||null:null,'include':_0x29acce[_0xf6cb('0x1f')]?_0x29acce['options']['include']?_['map'](_0x29acce[_0xf6cb('0x1f')][_0xf6cb('0x24')],function(_0x20fbf9){return{'model':db[_0x20fbf9[_0xf6cb('0x25')]],'as':_0x20fbf9['as'],'attributes':_0x20fbf9['attributes'],'include':_0x20fbf9[_0xf6cb('0x24')]?_[_0xf6cb('0x26')](_0x20fbf9[_0xf6cb('0x24')],function(_0xb0fcdd){return{'model':db[_0xb0fcdd[_0xf6cb('0x25')]],'as':_0xb0fcdd['as'],'attributes':_0xb0fcdd['attributes'],'include':_0xb0fcdd[_0xf6cb('0x24')]?_['map'](_0xb0fcdd[_0xf6cb('0x24')],function(_0x39674b){return{'model':db[_0x39674b[_0xf6cb('0x25')]],'as':_0x39674b['as'],'attributes':_0x39674b[_0xf6cb('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x382ab8){logger[_0xf6cb('0x19')](_0xf6cb('0x1c'),_0x29acce);logger[_0xf6cb('0x12')](_0xf6cb('0x1c'),_0x29acce,JSON[_0xf6cb('0x15')](_0x382ab8));_0x4917ff(_0x382ab8);})[_0xf6cb('0x1b')](function(_0x3ec21){logger['error']('GetOpenchannelQueue',_0x3ec21[_0xf6cb('0x18')],_0x29acce);_0x170933(_0x1be839[_0xf6cb('0x16')](0x1f4,_0x3ec21[_0xf6cb('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x374747){var _0x19d125=this;return new Promise(function(_0x468161,_0x59b964){return db['OpenchannelQueue'][_0xf6cb('0x27')]({'raw':_0x374747['options']?_0x374747[_0xf6cb('0x1f')][_0xf6cb('0x20')]===undefined?!![]:![]:!![],'where':_0x374747['options']?_0x374747[_0xf6cb('0x1f')]['where']||null:null,'attributes':_0x374747[_0xf6cb('0x1f')]?_0x374747[_0xf6cb('0x1f')][_0xf6cb('0x22')]||null:null,'include':_0x374747['options']?_0x374747['options']['include']?_[_0xf6cb('0x26')](_0x374747[_0xf6cb('0x1f')][_0xf6cb('0x24')],function(_0x23dc88){return{'model':db[_0x23dc88[_0xf6cb('0x25')]],'as':_0x23dc88['as'],'attributes':_0x23dc88[_0xf6cb('0x22')],'include':_0x23dc88['include']?_['map'](_0x23dc88[_0xf6cb('0x24')],function(_0x19ad12){return{'model':db[_0x19ad12[_0xf6cb('0x25')]],'as':_0x19ad12['as'],'attributes':_0x19ad12[_0xf6cb('0x22')],'include':_0x19ad12['include']?_[_0xf6cb('0x26')](_0x19ad12[_0xf6cb('0x24')],function(_0x559f95){return{'model':db[_0x559f95['model']],'as':_0x559f95['as'],'attributes':_0x559f95[_0xf6cb('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x335f3d){logger[_0xf6cb('0x19')](_0xf6cb('0x28'),_0x374747);logger[_0xf6cb('0x12')](_0xf6cb('0x28'),_0x374747,JSON['stringify'](_0x335f3d));_0x468161(_0x335f3d);})['catch'](function(_0x182469){logger[_0xf6cb('0x16')](_0xf6cb('0x28'),_0x182469['message'],_0x374747);_0x59b964(_0x19d125[_0xf6cb('0x16')](0x1f4,_0x182469['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index a6744b0..4605433 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 _0x1903=['length','openchannelQueue:','./openchannelQueue.events','emit','removeListener','register'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x1903,0xe6));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';var OpenchannelQueueEvents=require(_0x3190('0x0'));var events=['save','remove','update'];function createListener(_0x4ade62,_0x1248d2){return function(_0x2d4e52){_0x1248d2[_0x3190('0x1')](_0x4ade62,_0x2d4e52);};}function removeListener(_0x533c05,_0x1a4973){return function(){OpenchannelQueueEvents[_0x3190('0x2')](_0x533c05,_0x1a4973);};}exports[_0x3190('0x3')]=function(_0x51905d){for(var _0x1ddf90=0x0,_0x5033b=events[_0x3190('0x4')];_0x1ddf90<_0x5033b;_0x1ddf90++){var _0x506b76=events[_0x1ddf90];var _0x1af23b=createListener(_0x3190('0x5')+_0x506b76,_0x51905d);OpenchannelQueueEvents['on'](_0x506b76,_0x1af23b);}}; \ No newline at end of file +var _0x404d=['./openchannelQueue.events','save','update','emit','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x404d,0x78));var _0xd404=function(_0x40a949,_0x2a0c1b){_0x40a949=_0x40a949-0x0;var _0x14f2c3=_0x404d[_0x40a949];return _0x14f2c3;};'use strict';var OpenchannelQueueEvents=require(_0xd404('0x0'));var events=[_0xd404('0x1'),'remove',_0xd404('0x2')];function createListener(_0x1c1d9c,_0x841922){return function(_0x56400a){_0x841922[_0xd404('0x3')](_0x1c1d9c,_0x56400a);};}function removeListener(_0x2587bb,_0x480891){return function(){OpenchannelQueueEvents[_0xd404('0x4')](_0x2587bb,_0x480891);};}exports['register']=function(_0x508a68){for(var _0x38f19e=0x0,_0x58a72e=events[_0xd404('0x5')];_0x38f19e<_0x58a72e;_0x38f19e++){var _0x1f8d1f=events[_0x38f19e];var _0x448596=createListener('openchannelQueue:'+_0x1f8d1f,_0x508a68);OpenchannelQueueEvents['on'](_0x1f8d1f,_0x448596);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 39c622f..ec97372 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 _0x5aa1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports','multer','util'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5aa1,0x163));var _0x15aa=function(_0x57e34f,_0x475a13){_0x57e34f=_0x57e34f-0x0;var _0x4d047d=_0x5aa1[_0x57e34f];return _0x4d047d;};'use strict';var multer=require(_0x15aa('0x0'));var util=require(_0x15aa('0x1'));var path=require(_0x15aa('0x2'));var timeout=require(_0x15aa('0x3'));var express=require(_0x15aa('0x4'));var router=express[_0x15aa('0x5')]();var fs_extra=require(_0x15aa('0x6'));var auth=require(_0x15aa('0x7'));var interaction=require(_0x15aa('0x8'));var config=require('../../config/environment');var controller=require(_0x15aa('0x9'));router[_0x15aa('0xa')]('/',auth[_0x15aa('0xb')](),controller[_0x15aa('0xc')]);router[_0x15aa('0xa')](_0x15aa('0xd'),auth[_0x15aa('0xb')](),controller[_0x15aa('0xe')]);router[_0x15aa('0xa')](_0x15aa('0xf'),auth[_0x15aa('0xb')](),controller[_0x15aa('0x10')]);router[_0x15aa('0x11')]('/',auth[_0x15aa('0xb')](),controller['create']);router['put'](_0x15aa('0xf'),auth[_0x15aa('0xb')](),controller[_0x15aa('0x12')]);router[_0x15aa('0x13')](_0x15aa('0xf'),auth[_0x15aa('0xb')](),controller['destroy']);module[_0x15aa('0x14')]=router; \ No newline at end of file +var _0x612c=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','multer','express','Router'];(function(_0xed26bf,_0x33fc8a){var _0x3ad8f9=function(_0x309348){while(--_0x309348){_0xed26bf['push'](_0xed26bf['shift']());}};_0x3ad8f9(++_0x33fc8a);}(_0x612c,0x184));var _0xc612=function(_0x2faa5f,_0x5cd25b){_0x2faa5f=_0x2faa5f-0x0;var _0x458429=_0x612c[_0x2faa5f];return _0x458429;};'use strict';var multer=require(_0xc612('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc612('0x1'));var router=express[_0xc612('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc612('0x3'));var config=require(_0xc612('0x4'));var controller=require(_0xc612('0x5'));router[_0xc612('0x6')]('/',auth[_0xc612('0x7')](),controller[_0xc612('0x8')]);router[_0xc612('0x6')](_0xc612('0x9'),auth[_0xc612('0x7')](),controller['describe']);router['get'](_0xc612('0xa'),auth[_0xc612('0x7')](),controller['show']);router[_0xc612('0xb')]('/',auth['isAuthenticated'](),controller[_0xc612('0xc')]);router[_0xc612('0xd')]('/:id',auth[_0xc612('0x7')](),controller[_0xc612('0xe')]);router[_0xc612('0xf')](_0xc612('0xa'),auth['isAuthenticated'](),controller[_0xc612('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index c5bedd1..64a3d9b 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 _0x9eb9=['sequelize','exports','STRING','DATE','moment'];(function(_0x6aa5d4,_0x398288){var _0x274a2d=function(_0x3ac66c){while(--_0x3ac66c){_0x6aa5d4['push'](_0x6aa5d4['shift']());}};_0x274a2d(++_0x398288);}(_0x9eb9,0x11c));var _0x99eb=function(_0xf46679,_0x5f35f6){_0xf46679=_0xf46679-0x0;var _0x2b1ace=_0x9eb9[_0xf46679];return _0x2b1ace;};'use strict';var moment=require(_0x99eb('0x0'));var Sequelize=require(_0x99eb('0x1'));module[_0x99eb('0x2')]={'uniqueid':{'type':Sequelize[_0x99eb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x99eb('0x3')]},'joinAt':{'type':Sequelize[_0x99eb('0x4')]},'leaveAt':{'type':Sequelize[_0x99eb('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x99eb('0x3')]}}; \ No newline at end of file +var _0xdfaa=['exports','STRING','DATE','moment','sequelize'];(function(_0x44383f,_0x1a2522){var _0x4b9b48=function(_0x4e5f12){while(--_0x4e5f12){_0x44383f['push'](_0x44383f['shift']());}};_0x4b9b48(++_0x1a2522);}(_0xdfaa,0xd0));var _0xadfa=function(_0xdb136c,_0x288d99){_0xdb136c=_0xdb136c-0x0;var _0x1bdcaf=_0xdfaa[_0xdb136c];return _0x1bdcaf;};'use strict';var moment=require(_0xadfa('0x0'));var Sequelize=require(_0xadfa('0x1'));module[_0xadfa('0x2')]={'uniqueid':{'type':Sequelize[_0xadfa('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xadfa('0x3')]},'joinAt':{'type':Sequelize[_0xadfa('0x4')]},'leaveAt':{'type':Sequelize[_0xadfa('0x4')]},'acceptAt':{'type':Sequelize[_0xadfa('0x4')]},'exitAt':{'type':Sequelize[_0xadfa('0x4')]},'reason':{'type':Sequelize[_0xadfa('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index a73a3c5..6a9485c 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 _0x87a8=['catch','show','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','sendStatus','stack','name','send','OpenchannelQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows'];(function(_0x50ccf4,_0x45dede){var _0x1f9a08=function(_0x4078b9){while(--_0x4078b9){_0x50ccf4['push'](_0x50ccf4['shift']());}};_0x1f9a08(++_0x45dede);}(_0x87a8,0x144));var _0x887a=function(_0xa5d9f9,_0x17c6bf){_0xa5d9f9=_0xa5d9f9-0x0;var _0x40e9f6=_0x87a8[_0xa5d9f9];return _0x40e9f6;};'use strict';var emlformat=require(_0x887a('0x0'));var rimraf=require(_0x887a('0x1'));var zipdir=require(_0x887a('0x2'));var jsonpatch=require(_0x887a('0x3'));var rp=require('request-promise');var moment=require(_0x887a('0x4'));var BPromise=require(_0x887a('0x5'));var Mustache=require(_0x887a('0x6'));var util=require(_0x887a('0x7'));var path=require('path');var sox=require(_0x887a('0x8'));var csv=require(_0x887a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x887a('0xa'));var _=require(_0x887a('0xb'));var squel=require(_0x887a('0xc'));var crypto=require(_0x887a('0xd'));var jsforce=require(_0x887a('0xe'));var deskjs=require(_0x887a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x887a('0x10'));var Redis=require(_0x887a('0x11'));var authService=require(_0x887a('0x12'));var qs=require(_0x887a('0x13'));var as=require(_0x887a('0x14'));var hardwareService=require(_0x887a('0x15'));var logger=require(_0x887a('0x16'))(_0x887a('0x17'));var utils=require(_0x887a('0x18'));var config=require(_0x887a('0x19'));var licenseUtil=require(_0x887a('0x1a'));var db=require(_0x887a('0x1b'))['db'];function respondWithStatusCode(_0x48a3b6,_0x216e75){_0x216e75=_0x216e75||0xcc;return function(_0x27dc84){if(_0x27dc84){return _0x48a3b6['sendStatus'](_0x216e75);}return _0x48a3b6[_0x887a('0x1c')](_0x216e75)[_0x887a('0x1d')]();};}function respondWithResult(_0x5269ee,_0x5d9c6e){_0x5d9c6e=_0x5d9c6e||0xc8;return function(_0x37d0be){if(_0x37d0be){return _0x5269ee[_0x887a('0x1c')](_0x5d9c6e)[_0x887a('0x1e')](_0x37d0be);}};}function respondWithFilteredResult(_0x2607ea,_0x3b6d9c){return function(_0x5ede70){if(_0x5ede70){var _0xa088ba=typeof _0x3b6d9c[_0x887a('0x1f')]===_0x887a('0x20')&&typeof _0x3b6d9c['limit']===_0x887a('0x20');var _0x1a2f46=_0x5ede70[_0x887a('0x21')];var _0x2876cc=_0xa088ba?0x0:_0x3b6d9c[_0x887a('0x1f')];var _0x53d00c=_0xa088ba?_0x5ede70[_0x887a('0x21')]:_0x3b6d9c[_0x887a('0x1f')]+_0x3b6d9c[_0x887a('0x22')];var _0x5356d8;if(_0x53d00c>=_0x1a2f46){_0x53d00c=_0x1a2f46;_0x5356d8=0xc8;}else{_0x5356d8=0xce;}_0x2607ea[_0x887a('0x1c')](_0x5356d8);return _0x2607ea[_0x887a('0x23')](_0x887a('0x24'),_0x2876cc+'-'+_0x53d00c+'/'+_0x1a2f46)['json'](_0x5ede70);}return null;};}function patchUpdates(_0x2f5e55){return function(_0x4988fd){try{jsonpatch[_0x887a('0x25')](_0x4988fd,_0x2f5e55,!![]);}catch(_0x4b5081){return BPromise['reject'](_0x4b5081);}return _0x4988fd[_0x887a('0x26')]();};}function saveUpdates(_0x2f2ab1,_0x241cbc){return function(_0x5c8ff6){if(_0x5c8ff6){return _0x5c8ff6[_0x887a('0x27')](_0x2f2ab1)['then'](function(_0x5b1797){return _0x5b1797;});}return null;};}function removeEntity(_0xd989cd,_0x40918e){return function(_0x2a0197){if(_0x2a0197){return _0x2a0197['destroy']()[_0x887a('0x28')](function(){_0xd989cd['status'](0xcc)[_0x887a('0x1d')]();});}};}function handleEntityNotFound(_0x427e24,_0x5a7469){return function(_0x547301){if(!_0x547301){_0x427e24[_0x887a('0x29')](0x194);}return _0x547301;};}function handleError(_0x17031e,_0x7df621){_0x7df621=_0x7df621||0x1f4;return function(_0x252d5c){logger['error'](_0x252d5c[_0x887a('0x2a')]);if(_0x252d5c[_0x887a('0x2b')]){delete _0x252d5c[_0x887a('0x2b')];}_0x17031e[_0x887a('0x1c')](_0x7df621)[_0x887a('0x2c')](_0x252d5c);};}exports['index']=function(_0x3ffb11,_0x50af39){var _0x5eb913={},_0x1c6614={},_0x4597fe={'count':0x0,'rows':[]};var _0x38f3c8=_['map'](db[_0x887a('0x2d')][_0x887a('0x2e')],function(_0x2aecf6){return{'name':_0x2aecf6['fieldName'],'type':_0x2aecf6[_0x887a('0x2f')][_0x887a('0x30')]};});_0x1c6614[_0x887a('0x31')]=_[_0x887a('0x32')](_0x38f3c8,_0x887a('0x2b'));_0x1c6614[_0x887a('0x33')]=_[_0x887a('0x34')](_0x3ffb11['query']);_0x1c6614[_0x887a('0x35')]=_[_0x887a('0x36')](_0x1c6614[_0x887a('0x31')],_0x1c6614[_0x887a('0x33')]);_0x5eb913['attributes']=_[_0x887a('0x36')](_0x1c6614[_0x887a('0x31')],qs[_0x887a('0x37')](_0x3ffb11[_0x887a('0x33')][_0x887a('0x37')]));_0x5eb913[_0x887a('0x38')]=_0x5eb913['attributes'][_0x887a('0x39')]?_0x5eb913[_0x887a('0x38')]:_0x1c6614[_0x887a('0x31')];if(!_0x3ffb11[_0x887a('0x33')]['hasOwnProperty'](_0x887a('0x3a'))){_0x5eb913[_0x887a('0x22')]=qs[_0x887a('0x22')](_0x3ffb11[_0x887a('0x33')][_0x887a('0x22')]);_0x5eb913[_0x887a('0x1f')]=qs[_0x887a('0x1f')](_0x3ffb11[_0x887a('0x33')][_0x887a('0x1f')]);}_0x5eb913[_0x887a('0x3b')]=qs[_0x887a('0x3c')](_0x3ffb11[_0x887a('0x33')][_0x887a('0x3c')]);_0x5eb913[_0x887a('0x3d')]=qs[_0x887a('0x35')](_[_0x887a('0x3e')](_0x3ffb11['query'],_0x1c6614[_0x887a('0x35')]),_0x38f3c8);if(_0x3ffb11[_0x887a('0x33')]['filter']){_0x5eb913[_0x887a('0x3d')]=_[_0x887a('0x3f')](_0x5eb913['where'],{'$or':_[_0x887a('0x32')](_0x38f3c8,function(_0x58f331){if(_0x58f331[_0x887a('0x2f')]!==_0x887a('0x40')){var _0x56b76c={};_0x56b76c[_0x58f331[_0x887a('0x2b')]]={'$like':'%'+_0x3ffb11[_0x887a('0x33')][_0x887a('0x41')]+'%'};return _0x56b76c;}})});}_0x5eb913=_[_0x887a('0x3f')]({},_0x5eb913,_0x3ffb11[_0x887a('0x42')]);var _0xa133ea={'where':_0x5eb913[_0x887a('0x3d')]};return db[_0x887a('0x2d')][_0x887a('0x21')](_0xa133ea)[_0x887a('0x28')](function(_0x43418c){_0x4597fe[_0x887a('0x21')]=_0x43418c;if(_0x3ffb11['query'][_0x887a('0x43')]){_0x5eb913[_0x887a('0x44')]=[{'all':!![]}];}return db[_0x887a('0x2d')][_0x887a('0x45')](_0x5eb913);})[_0x887a('0x28')](function(_0x47f388){_0x4597fe[_0x887a('0x46')]=_0x47f388;return _0x4597fe;})[_0x887a('0x28')](respondWithFilteredResult(_0x50af39,_0x5eb913))[_0x887a('0x47')](handleError(_0x50af39,null));};exports[_0x887a('0x48')]=function(_0x14695d,_0x40b037){var _0x336587={'raw':!![],'where':{'id':_0x14695d['params']['id']}},_0x450bdf={};_0x450bdf['model']=_[_0x887a('0x34')](db[_0x887a('0x2d')][_0x887a('0x2e')]);_0x450bdf[_0x887a('0x33')]=_[_0x887a('0x34')](_0x14695d['query']);_0x450bdf[_0x887a('0x35')]=_['intersection'](_0x450bdf[_0x887a('0x31')],_0x450bdf[_0x887a('0x33')]);_0x336587['attributes']=_['intersection'](_0x450bdf['model'],qs['fields'](_0x14695d['query'][_0x887a('0x37')]));_0x336587[_0x887a('0x38')]=_0x336587['attributes'][_0x887a('0x39')]?_0x336587[_0x887a('0x38')]:_0x450bdf[_0x887a('0x31')];if(_0x14695d[_0x887a('0x33')]['includeAll']){_0x336587[_0x887a('0x44')]=[{'all':!![]}];}_0x336587=_[_0x887a('0x3f')]({},_0x336587,_0x14695d[_0x887a('0x42')]);return db[_0x887a('0x2d')][_0x887a('0x49')](_0x336587)[_0x887a('0x28')](handleEntityNotFound(_0x40b037,null))[_0x887a('0x28')](respondWithResult(_0x40b037,null))[_0x887a('0x47')](handleError(_0x40b037,null));};exports[_0x887a('0x4a')]=function(_0x163bf0,_0x5c8d6a){return db['OpenchannelQueueReport'][_0x887a('0x4a')](_0x163bf0[_0x887a('0x4b')],{})[_0x887a('0x28')](respondWithResult(_0x5c8d6a,0xc9))['catch'](handleError(_0x5c8d6a,null));};exports[_0x887a('0x27')]=function(_0x5c02ff,_0x445593){if(_0x5c02ff[_0x887a('0x4b')]['id']){delete _0x5c02ff[_0x887a('0x4b')]['id'];}return db[_0x887a('0x2d')][_0x887a('0x49')]({'where':{'id':_0x5c02ff['params']['id']}})[_0x887a('0x28')](handleEntityNotFound(_0x445593,null))[_0x887a('0x28')](saveUpdates(_0x5c02ff[_0x887a('0x4b')],null))['then'](respondWithResult(_0x445593,null))[_0x887a('0x47')](handleError(_0x445593,null));};exports[_0x887a('0x4c')]=function(_0x1f11c6,_0x7a1910){return db[_0x887a('0x2d')][_0x887a('0x49')]({'where':{'id':_0x1f11c6[_0x887a('0x4d')]['id']}})[_0x887a('0x28')](handleEntityNotFound(_0x7a1910,null))[_0x887a('0x28')](removeEntity(_0x7a1910,null))[_0x887a('0x47')](handleError(_0x7a1910,null));};exports[_0x887a('0x4e')]=function(_0x20c1ad,_0x48e1d4){return db['OpenchannelQueueReport'][_0x887a('0x4e')]()[_0x887a('0x28')](respondWithResult(_0x48e1d4,null))['catch'](handleError(_0x48e1d4,null));}; \ No newline at end of file +var _0x69cf=['status','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','stack','name','map','OpenchannelQueueReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x5d8b4b,_0xcd8c9b){var _0x3c7e8e=function(_0xb72965){while(--_0xb72965){_0x5d8b4b['push'](_0x5d8b4b['shift']());}};_0x3c7e8e(++_0xcd8c9b);}(_0x69cf,0x1d3));var _0xf69c=function(_0x294aef,_0x378f98){_0x294aef=_0x294aef-0x0;var _0x4d235d=_0x69cf[_0x294aef];return _0x4d235d;};'use strict';var emlformat=require(_0xf69c('0x0'));var rimraf=require(_0xf69c('0x1'));var zipdir=require(_0xf69c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf69c('0x3'));var moment=require(_0xf69c('0x4'));var BPromise=require(_0xf69c('0x5'));var Mustache=require(_0xf69c('0x6'));var util=require(_0xf69c('0x7'));var path=require(_0xf69c('0x8'));var sox=require(_0xf69c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf69c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf69c('0xb'));var jsforce=require(_0xf69c('0xc'));var deskjs=require(_0xf69c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf69c('0xe'));var Redis=require('ioredis');var authService=require(_0xf69c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf69c('0x10'));var hardwareService=require(_0xf69c('0x11'));var logger=require(_0xf69c('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf69c('0x13'));var db=require(_0xf69c('0x14'))['db'];function respondWithStatusCode(_0x4f8aaa,_0x62447){_0x62447=_0x62447||0xcc;return function(_0x99b78a){if(_0x99b78a){return _0x4f8aaa[_0xf69c('0x15')](_0x62447);}return _0x4f8aaa['status'](_0x62447)[_0xf69c('0x16')]();};}function respondWithResult(_0x1fc778,_0x3f723f){_0x3f723f=_0x3f723f||0xc8;return function(_0xd5205a){if(_0xd5205a){return _0x1fc778[_0xf69c('0x17')](_0x3f723f)[_0xf69c('0x18')](_0xd5205a);}};}function respondWithFilteredResult(_0x2be7c2,_0x8163d2){return function(_0xc14f3b){if(_0xc14f3b){var _0x2e3c80=typeof _0x8163d2['offset']===_0xf69c('0x19')&&typeof _0x8163d2[_0xf69c('0x1a')]===_0xf69c('0x19');var _0x5c3e71=_0xc14f3b[_0xf69c('0x1b')];var _0x2c3962=_0x2e3c80?0x0:_0x8163d2[_0xf69c('0x1c')];var _0x529ce3=_0x2e3c80?_0xc14f3b[_0xf69c('0x1b')]:_0x8163d2[_0xf69c('0x1c')]+_0x8163d2['limit'];var _0xca6894;if(_0x529ce3>=_0x5c3e71){_0x529ce3=_0x5c3e71;_0xca6894=0xc8;}else{_0xca6894=0xce;}_0x2be7c2[_0xf69c('0x17')](_0xca6894);return _0x2be7c2['set'](_0xf69c('0x1d'),_0x2c3962+'-'+_0x529ce3+'/'+_0x5c3e71)[_0xf69c('0x18')](_0xc14f3b);}return null;};}function patchUpdates(_0xa6db0e){return function(_0xfc2aba){try{jsonpatch[_0xf69c('0x1e')](_0xfc2aba,_0xa6db0e,!![]);}catch(_0x2d8a4f){return BPromise[_0xf69c('0x1f')](_0x2d8a4f);}return _0xfc2aba['save']();};}function saveUpdates(_0x2a2cc5,_0x13a047){return function(_0x25b4c2){if(_0x25b4c2){return _0x25b4c2['update'](_0x2a2cc5)[_0xf69c('0x20')](function(_0x3872a3){return _0x3872a3;});}return null;};}function removeEntity(_0x1ee840,_0x27504d){return function(_0x15ed49){if(_0x15ed49){return _0x15ed49[_0xf69c('0x21')]()[_0xf69c('0x20')](function(){_0x1ee840[_0xf69c('0x17')](0xcc)[_0xf69c('0x16')]();});}};}function handleEntityNotFound(_0x1fb76c,_0x1d38a1){return function(_0x3cd15d){if(!_0x3cd15d){_0x1fb76c['sendStatus'](0x194);}return _0x3cd15d;};}function handleError(_0xb2fc9d,_0x57fd8f){_0x57fd8f=_0x57fd8f||0x1f4;return function(_0x1b28d9){logger[_0xf69c('0x22')](_0x1b28d9[_0xf69c('0x23')]);if(_0x1b28d9[_0xf69c('0x24')]){delete _0x1b28d9[_0xf69c('0x24')];}_0xb2fc9d['status'](_0x57fd8f)['send'](_0x1b28d9);};}exports['index']=function(_0x2273e5,_0x951000){var _0x56d2ec={},_0x1ed03e={},_0x101e3a={'count':0x0,'rows':[]};var _0x49c18b=_[_0xf69c('0x25')](db[_0xf69c('0x26')][_0xf69c('0x27')],function(_0x57d835){return{'name':_0x57d835['fieldName'],'type':_0x57d835[_0xf69c('0x28')]['key']};});_0x1ed03e[_0xf69c('0x29')]=_['map'](_0x49c18b,_0xf69c('0x24'));_0x1ed03e[_0xf69c('0x2a')]=_[_0xf69c('0x2b')](_0x2273e5[_0xf69c('0x2a')]);_0x1ed03e['filters']=_[_0xf69c('0x2c')](_0x1ed03e[_0xf69c('0x29')],_0x1ed03e[_0xf69c('0x2a')]);_0x56d2ec['attributes']=_[_0xf69c('0x2c')](_0x1ed03e[_0xf69c('0x29')],qs[_0xf69c('0x2d')](_0x2273e5[_0xf69c('0x2a')]['fields']));_0x56d2ec['attributes']=_0x56d2ec[_0xf69c('0x2e')][_0xf69c('0x2f')]?_0x56d2ec[_0xf69c('0x2e')]:_0x1ed03e['model'];if(!_0x2273e5[_0xf69c('0x2a')][_0xf69c('0x30')](_0xf69c('0x31'))){_0x56d2ec[_0xf69c('0x1a')]=qs[_0xf69c('0x1a')](_0x2273e5[_0xf69c('0x2a')]['limit']);_0x56d2ec[_0xf69c('0x1c')]=qs[_0xf69c('0x1c')](_0x2273e5['query']['offset']);}_0x56d2ec[_0xf69c('0x32')]=qs[_0xf69c('0x33')](_0x2273e5[_0xf69c('0x2a')][_0xf69c('0x33')]);_0x56d2ec[_0xf69c('0x34')]=qs[_0xf69c('0x35')](_[_0xf69c('0x36')](_0x2273e5[_0xf69c('0x2a')],_0x1ed03e[_0xf69c('0x35')]),_0x49c18b);if(_0x2273e5[_0xf69c('0x2a')][_0xf69c('0x37')]){_0x56d2ec['where']=_[_0xf69c('0x38')](_0x56d2ec[_0xf69c('0x34')],{'$or':_[_0xf69c('0x25')](_0x49c18b,function(_0x3b3010){if(_0x3b3010[_0xf69c('0x28')]!==_0xf69c('0x39')){var _0x2dea54={};_0x2dea54[_0x3b3010[_0xf69c('0x24')]]={'$like':'%'+_0x2273e5[_0xf69c('0x2a')][_0xf69c('0x37')]+'%'};return _0x2dea54;}})});}_0x56d2ec=_[_0xf69c('0x38')]({},_0x56d2ec,_0x2273e5[_0xf69c('0x3a')]);var _0x4ab4ba={'where':_0x56d2ec[_0xf69c('0x34')]};return db[_0xf69c('0x26')][_0xf69c('0x1b')](_0x4ab4ba)['then'](function(_0x30a8dc){_0x101e3a[_0xf69c('0x1b')]=_0x30a8dc;if(_0x2273e5[_0xf69c('0x2a')][_0xf69c('0x3b')]){_0x56d2ec[_0xf69c('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xf69c('0x3d')](_0x56d2ec);})[_0xf69c('0x20')](function(_0x3d2b2a){_0x101e3a[_0xf69c('0x3e')]=_0x3d2b2a;return _0x101e3a;})[_0xf69c('0x20')](respondWithFilteredResult(_0x951000,_0x56d2ec))['catch'](handleError(_0x951000,null));};exports[_0xf69c('0x3f')]=function(_0x2b2a09,_0x23e231){var _0x59daf7={'raw':!![],'where':{'id':_0x2b2a09['params']['id']}},_0x52ee5a={};_0x52ee5a['model']=_[_0xf69c('0x2b')](db[_0xf69c('0x26')]['rawAttributes']);_0x52ee5a['query']=_['keys'](_0x2b2a09[_0xf69c('0x2a')]);_0x52ee5a[_0xf69c('0x35')]=_[_0xf69c('0x2c')](_0x52ee5a[_0xf69c('0x29')],_0x52ee5a['query']);_0x59daf7[_0xf69c('0x2e')]=_[_0xf69c('0x2c')](_0x52ee5a[_0xf69c('0x29')],qs[_0xf69c('0x2d')](_0x2b2a09[_0xf69c('0x2a')][_0xf69c('0x2d')]));_0x59daf7[_0xf69c('0x2e')]=_0x59daf7[_0xf69c('0x2e')][_0xf69c('0x2f')]?_0x59daf7['attributes']:_0x52ee5a[_0xf69c('0x29')];if(_0x2b2a09[_0xf69c('0x2a')][_0xf69c('0x3b')]){_0x59daf7[_0xf69c('0x3c')]=[{'all':!![]}];}_0x59daf7=_['merge']({},_0x59daf7,_0x2b2a09['options']);return db['OpenchannelQueueReport'][_0xf69c('0x40')](_0x59daf7)[_0xf69c('0x20')](handleEntityNotFound(_0x23e231,null))[_0xf69c('0x20')](respondWithResult(_0x23e231,null))['catch'](handleError(_0x23e231,null));};exports[_0xf69c('0x41')]=function(_0x57a080,_0x31ce29){return db[_0xf69c('0x26')][_0xf69c('0x41')](_0x57a080[_0xf69c('0x42')],{})[_0xf69c('0x20')](respondWithResult(_0x31ce29,0xc9))[_0xf69c('0x43')](handleError(_0x31ce29,null));};exports[_0xf69c('0x44')]=function(_0x16aad1,_0x3056bf){if(_0x16aad1[_0xf69c('0x42')]['id']){delete _0x16aad1['body']['id'];}return db[_0xf69c('0x26')]['find']({'where':{'id':_0x16aad1['params']['id']}})['then'](handleEntityNotFound(_0x3056bf,null))[_0xf69c('0x20')](saveUpdates(_0x16aad1[_0xf69c('0x42')],null))['then'](respondWithResult(_0x3056bf,null))[_0xf69c('0x43')](handleError(_0x3056bf,null));};exports['destroy']=function(_0x456275,_0x459397){return db[_0xf69c('0x26')][_0xf69c('0x40')]({'where':{'id':_0x456275['params']['id']}})['then'](handleEntityNotFound(_0x459397,null))[_0xf69c('0x20')](removeEntity(_0x459397,null))[_0xf69c('0x43')](handleError(_0x459397,null));};exports[_0xf69c('0x45')]=function(_0x136165,_0x472273){return db[_0xf69c('0x26')][_0xf69c('0x45')]()['then'](respondWithResult(_0x472273,null))[_0xf69c('0x43')](handleError(_0x472273,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 569f570..40e645f 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x2dc95a,_0xa5be6d){var _0x43876b=function(_0x50db84){while(--_0x50db84){_0x2dc95a['push'](_0x2dc95a['shift']());}};_0x43876b(++_0xa5be6d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0x5fc3[_0x4e0a03];return _0x2478fc;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x2eefbf,_0x3c990e){var _0x8ed1b5=function(_0x8e7e44){while(--_0x8e7e44){_0x2eefbf['push'](_0x2eefbf['shift']());}};_0x8ed1b5(++_0x3c990e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index ffebe80..56b4088 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 _0x93e6=['error','code','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','stringify','update','body','where','attributes','UpdateOpenchannelQueueReport','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x48026e,_0x2bb295){var _0x4b42aa=function(_0x42c647){while(--_0x42c647){_0x48026e['push'](_0x48026e['shift']());}};_0x4b42aa(++_0x2bb295);}(_0x93e6,0x11e));var _0x693e=function(_0x2a3bad,_0x227f4e){_0x2a3bad=_0x2a3bad-0x0;var _0x4bd6ea=_0x93e6[_0x2a3bad];return _0x4bd6ea;};'use strict';var _=require(_0x693e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x693e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x693e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x693e('0x3'));var logger=require(_0x693e('0x4'))(_0x693e('0x5'));var config=require('../../config/environment');var jayson=require(_0x693e('0x6'));var client=jayson[_0x693e('0x7')][_0x693e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x520113,_0x577dcb,_0x57897c){return new BPromise(function(_0x155601,_0x4b30f6){return client[_0x693e('0x9')](_0x520113,_0x57897c)[_0x693e('0xa')](function(_0x14b901){logger['info'](_0x693e('0xb'),_0x577dcb,'request\x20sent');logger[_0x693e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x577dcb,_0x693e('0xd'),JSON['stringify'](_0x14b901));if(_0x14b901['error']){if(_0x14b901[_0x693e('0xe')][_0x693e('0xf')]===0x1f4){logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0x14b901['error'][_0x693e('0x10')]);return _0x4b30f6(_0x14b901[_0x693e('0xe')][_0x693e('0x10')]);}logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0x14b901[_0x693e('0xe')][_0x693e('0x10')]);return _0x155601(_0x14b901['error'][_0x693e('0x10')]);}else{logger[_0x693e('0x11')](_0x693e('0xb'),_0x577dcb,'request\x20sent');_0x155601(_0x14b901[_0x693e('0x12')][_0x693e('0x10')]);}})[_0x693e('0x13')](function(_0xb3a90a){logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0xb3a90a);_0x4b30f6(_0xb3a90a);});});}exports[_0x693e('0x14')]=function(_0x4f4264){var _0x593916=this;return new Promise(function(_0x5e842f,_0x149325){return db[_0x693e('0x15')]['create'](_0x4f4264['body'],{'raw':_0x4f4264[_0x693e('0x16')]?_0x4f4264[_0x693e('0x16')][_0x693e('0x17')]===undefined?!![]:![]:!![]})[_0x693e('0xa')](function(_0x49614c){logger[_0x693e('0x11')](_0x693e('0x14'),_0x4f4264);logger[_0x693e('0xc')]('CreateOpenchannelQueueReport',_0x4f4264,JSON[_0x693e('0x18')](_0x49614c));_0x5e842f(_0x49614c);})[_0x693e('0x13')](function(_0x569646){logger[_0x693e('0xe')](_0x693e('0x14'),_0x569646['message'],_0x4f4264);_0x149325(_0x593916[_0x693e('0xe')](0x1f4,_0x569646[_0x693e('0x10')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x3847be){var _0x25c39e=this;return new Promise(function(_0x1fd85,_0x32b552){return db[_0x693e('0x15')][_0x693e('0x19')](_0x3847be[_0x693e('0x1a')],{'raw':_0x3847be[_0x693e('0x16')]?_0x3847be[_0x693e('0x16')][_0x693e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3847be[_0x693e('0x16')]?_0x3847be[_0x693e('0x16')][_0x693e('0x1b')]||null:null,'attributes':_0x3847be[_0x693e('0x16')]?_0x3847be[_0x693e('0x16')][_0x693e('0x1c')]||null:null,'limit':_0x3847be[_0x693e('0x16')]?_0x3847be[_0x693e('0x16')]['limit']||null:null})[_0x693e('0xa')](function(_0x1c002d){logger[_0x693e('0x11')](_0x693e('0x1d'),_0x3847be);logger[_0x693e('0xc')]('UpdateOpenchannelQueueReport',_0x3847be,JSON[_0x693e('0x18')](_0x1c002d));_0x1fd85(_0x1c002d);})['catch'](function(_0x3b6cf7){logger['error'](_0x693e('0x1d'),_0x3b6cf7[_0x693e('0x10')],_0x3847be);_0x32b552(_0x25c39e['error'](0x1f4,_0x3b6cf7[_0x693e('0x10')]));});});}; \ No newline at end of file +var _0x9c00=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','limit','lodash','util','randomstring','ioredis'];(function(_0x224067,_0xe73c38){var _0x4af627=function(_0x25acc5){while(--_0x25acc5){_0x224067['push'](_0x224067['shift']());}};_0x4af627(++_0xe73c38);}(_0x9c00,0x1a0));var _0x09c0=function(_0x253b45,_0x32b9da){_0x253b45=_0x253b45-0x0;var _0x3e1947=_0x9c00[_0x253b45];return _0x3e1947;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x09c0('0x2'));var fs=require('fs');var Redis=require(_0x09c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c0('0x4'));var logger=require(_0x09c0('0x5'))(_0x09c0('0x6'));var config=require(_0x09c0('0x7'));var jayson=require(_0x09c0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3d7e,_0x17d11f,_0x1b633b){return new BPromise(function(_0x3187aa,_0x17cd9d){return client['request'](_0x1f3d7e,_0x1b633b)[_0x09c0('0x9')](function(_0x1c1246){logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,_0x09c0('0xc'));logger[_0x09c0('0xd')](_0x09c0('0xe'),_0x17d11f,_0x09c0('0xc'),JSON[_0x09c0('0xf')](_0x1c1246));if(_0x1c1246[_0x09c0('0x10')]){if(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x11')]===0x1f4){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x17cd9d(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x3187aa(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}else{logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,'request\x20sent');_0x3187aa(_0x1c1246['result']['message']);}})[_0x09c0('0x13')](function(_0x11f4b2){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x11f4b2);_0x17cd9d(_0x11f4b2);});});}exports['CreateOpenchannelQueueReport']=function(_0x2c4440){var _0x4aa8a5=this;return new Promise(function(_0x4c29a7,_0x2c12da){return db['OpenchannelQueueReport'][_0x09c0('0x14')](_0x2c4440[_0x09c0('0x15')],{'raw':_0x2c4440[_0x09c0('0x16')]?_0x2c4440['options'][_0x09c0('0x17')]===undefined?!![]:![]:!![]})[_0x09c0('0x9')](function(_0x8ad645){logger[_0x09c0('0xa')](_0x09c0('0x18'),_0x2c4440);logger[_0x09c0('0xd')](_0x09c0('0x18'),_0x2c4440,JSON['stringify'](_0x8ad645));_0x4c29a7(_0x8ad645);})[_0x09c0('0x13')](function(_0x46f171){logger[_0x09c0('0x10')](_0x09c0('0x18'),_0x46f171['message'],_0x2c4440);_0x2c12da(_0x4aa8a5['error'](0x1f4,_0x46f171[_0x09c0('0x12')]));});});};exports[_0x09c0('0x19')]=function(_0x1e8a1c){var _0x3a5370=this;return new Promise(function(_0x491e6f,_0x42ebfc){return db[_0x09c0('0x1a')]['update'](_0x1e8a1c[_0x09c0('0x15')],{'raw':_0x1e8a1c[_0x09c0('0x16')]?_0x1e8a1c[_0x09c0('0x16')][_0x09c0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8a1c[_0x09c0('0x16')]?_0x1e8a1c[_0x09c0('0x16')][_0x09c0('0x1b')]||null:null,'attributes':_0x1e8a1c[_0x09c0('0x16')]?_0x1e8a1c[_0x09c0('0x16')][_0x09c0('0x1c')]||null:null,'limit':_0x1e8a1c[_0x09c0('0x16')]?_0x1e8a1c['options'][_0x09c0('0x1d')]||null:null})[_0x09c0('0x9')](function(_0x53a7b8){logger[_0x09c0('0xa')]('UpdateOpenchannelQueueReport',_0x1e8a1c);logger[_0x09c0('0xd')]('UpdateOpenchannelQueueReport',_0x1e8a1c,JSON[_0x09c0('0xf')](_0x53a7b8));_0x491e6f(_0x53a7b8);})[_0x09c0('0x13')](function(_0x108409){logger[_0x09c0('0x10')]('UpdateOpenchannelQueueReport',_0x108409['message'],_0x1e8a1c);_0x42ebfc(_0x3a5370[_0x09c0('0x10')](0x1f4,_0x108409[_0x09c0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0eaf8de..027bdd5 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 _0xf2c7=['/:id','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','post','create','put'];(function(_0x2117a2,_0x53c2b4){var _0x48b35c=function(_0x2c10ed){while(--_0x2c10ed){_0x2117a2['push'](_0x2117a2['shift']());}};_0x48b35c(++_0x53c2b4);}(_0xf2c7,0x100));var _0x7f2c=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0xf2c7[_0x2ce6d5];return _0x32d272;};'use strict';var multer=require(_0x7f2c('0x0'));var util=require('util');var path=require(_0x7f2c('0x1'));var timeout=require('connect-timeout');var express=require(_0x7f2c('0x2'));var router=express[_0x7f2c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f2c('0x4'));var interaction=require(_0x7f2c('0x5'));var config=require(_0x7f2c('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x7f2c('0x7')]('/',auth['isAuthenticated'](),controller[_0x7f2c('0x8')]);router[_0x7f2c('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x7f2c('0x9')]);router[_0x7f2c('0x7')]('/:id',auth[_0x7f2c('0xa')](),controller['show']);router[_0x7f2c('0xb')]('/',auth[_0x7f2c('0xa')](),controller[_0x7f2c('0xc')]);router[_0x7f2c('0xd')](_0x7f2c('0xe'),auth[_0x7f2c('0xa')](),controller[_0x7f2c('0xf')]);router[_0x7f2c('0x10')](_0x7f2c('0xe'),auth[_0x7f2c('0xa')](),controller['destroy']);module[_0x7f2c('0x11')]=router; \ No newline at end of file +var _0xb3bf=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','show','create','/:id','update'];(function(_0x1d453f,_0x5793a9){var _0x50996a=function(_0x59bdf3){while(--_0x59bdf3){_0x1d453f['push'](_0x1d453f['shift']());}};_0x50996a(++_0x5793a9);}(_0xb3bf,0x1e3));var _0xfb3b=function(_0x5ee823,_0x24650b){_0x5ee823=_0x5ee823-0x0;var _0x209bd2=_0xb3bf[_0x5ee823];return _0x209bd2;};'use strict';var multer=require('multer');var util=require(_0xfb3b('0x0'));var path=require(_0xfb3b('0x1'));var timeout=require(_0xfb3b('0x2'));var express=require(_0xfb3b('0x3'));var router=express[_0xfb3b('0x4')]();var fs_extra=require(_0xfb3b('0x5'));var auth=require(_0xfb3b('0x6'));var interaction=require(_0xfb3b('0x7'));var config=require(_0xfb3b('0x8'));var controller=require(_0xfb3b('0x9'));router[_0xfb3b('0xa')]('/',auth[_0xfb3b('0xb')](),controller['index']);router['get'](_0xfb3b('0xc'),auth[_0xfb3b('0xb')](),controller['describe']);router[_0xfb3b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xfb3b('0xd')]);router['post']('/',auth[_0xfb3b('0xb')](),controller[_0xfb3b('0xe')]);router['put'](_0xfb3b('0xf'),auth[_0xfb3b('0xb')](),controller[_0xfb3b('0x10')]);router[_0xfb3b('0x11')](_0xfb3b('0xf'),auth[_0xfb3b('0xb')](),controller[_0xfb3b('0x12')]);module[_0xfb3b('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index e67f0e1..6b72c85 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x4c7373,_0x4ff28e){var _0x34a3c2=function(_0x365aae){while(--_0x365aae){_0x4c7373['push'](_0x4c7373['shift']());}};_0x34a3c2(++_0x4ff28e);}(_0xedd9,0xfc));var _0x9edd=function(_0x5205ff,_0x4b1398){_0x5205ff=_0x5205ff-0x0;var _0x4b6e51=_0xedd9[_0x5205ff];return _0x4b6e51;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x339dbd,_0x325df9){_0x339dbd=_0x339dbd-0x0;var _0x249fc0=_0xb43b[_0x339dbd];return _0x249fc0;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ac57ee0..05ea4af 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 _0x59b6=['request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','VIRTUAL','filter','merge','includeAll','include','catch','params','options','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch'];(function(_0x2cfcc3,_0x9291bd){var _0xbf9249=function(_0x4fe5d3){while(--_0x4fe5d3){_0x2cfcc3['push'](_0x2cfcc3['shift']());}};_0xbf9249(++_0x9291bd);}(_0x59b6,0x160));var _0x659b=function(_0xa6550b,_0xe3d025){_0xa6550b=_0xa6550b-0x0;var _0x4e3e3e=_0x59b6[_0xa6550b];return _0x4e3e3e;};'use strict';var emlformat=require(_0x659b('0x0'));var rimraf=require(_0x659b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x659b('0x2'));var rp=require(_0x659b('0x3'));var moment=require(_0x659b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x659b('0x5'));var util=require(_0x659b('0x6'));var path=require('path');var sox=require(_0x659b('0x7'));var csv=require(_0x659b('0x8'));var ejs=require(_0x659b('0x9'));var fs=require('fs');var fs_extra=require(_0x659b('0xa'));var _=require('lodash');var squel=require(_0x659b('0xb'));var crypto=require(_0x659b('0xc'));var jsforce=require(_0x659b('0xd'));var deskjs=require(_0x659b('0xe'));var toCsv=require(_0x659b('0x8'));var querystring=require(_0x659b('0xf'));var Papa=require(_0x659b('0x10'));var Redis=require(_0x659b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x659b('0x12'));var logger=require(_0x659b('0x13'))('api');var utils=require(_0x659b('0x14'));var config=require(_0x659b('0x15'));var licenseUtil=require(_0x659b('0x16'));var db=require(_0x659b('0x17'))['db'];function respondWithStatusCode(_0x108d09,_0x186550){_0x186550=_0x186550||0xcc;return function(_0x265dd7){if(_0x265dd7){return _0x108d09['sendStatus'](_0x186550);}return _0x108d09['status'](_0x186550)[_0x659b('0x18')]();};}function respondWithResult(_0x1f927a,_0x41e343){_0x41e343=_0x41e343||0xc8;return function(_0x593c43){if(_0x593c43){return _0x1f927a[_0x659b('0x19')](_0x41e343)[_0x659b('0x1a')](_0x593c43);}};}function respondWithFilteredResult(_0x4f755c,_0x11aef1){return function(_0x21ae07){if(_0x21ae07){var _0x5b52b9=typeof _0x11aef1[_0x659b('0x1b')]===_0x659b('0x1c')&&typeof _0x11aef1[_0x659b('0x1d')]===_0x659b('0x1c');var _0x1f0449=_0x21ae07[_0x659b('0x1e')];var _0x27cf74=_0x5b52b9?0x0:_0x11aef1[_0x659b('0x1b')];var _0x14495b=_0x5b52b9?_0x21ae07[_0x659b('0x1e')]:_0x11aef1['offset']+_0x11aef1[_0x659b('0x1d')];var _0x4d1557;if(_0x14495b>=_0x1f0449){_0x14495b=_0x1f0449;_0x4d1557=0xc8;}else{_0x4d1557=0xce;}_0x4f755c[_0x659b('0x19')](_0x4d1557);return _0x4f755c[_0x659b('0x1f')](_0x659b('0x20'),_0x27cf74+'-'+_0x14495b+'/'+_0x1f0449)[_0x659b('0x1a')](_0x21ae07);}return null;};}function patchUpdates(_0x3a7a70){return function(_0x47ed96){try{jsonpatch['apply'](_0x47ed96,_0x3a7a70,!![]);}catch(_0x1be29f){return BPromise[_0x659b('0x21')](_0x1be29f);}return _0x47ed96[_0x659b('0x22')]();};}function saveUpdates(_0x1ee7d0,_0x1c12ae){return function(_0x532ff4){if(_0x532ff4){return _0x532ff4[_0x659b('0x23')](_0x1ee7d0)[_0x659b('0x24')](function(_0x4d3e2c){return _0x4d3e2c;});}return null;};}function removeEntity(_0x2cc5b4,_0x4c1ebe){return function(_0x42071a){if(_0x42071a){return _0x42071a['destroy']()[_0x659b('0x24')](function(){_0x2cc5b4[_0x659b('0x19')](0xcc)[_0x659b('0x18')]();});}};}function handleEntityNotFound(_0x523960,_0x45871f){return function(_0x1c9193){if(!_0x1c9193){_0x523960['sendStatus'](0x194);}return _0x1c9193;};}function handleError(_0x2a309f,_0xd08963){_0xd08963=_0xd08963||0x1f4;return function(_0x209d30){logger[_0x659b('0x25')](_0x209d30[_0x659b('0x26')]);if(_0x209d30[_0x659b('0x27')]){delete _0x209d30['name'];}_0x2a309f['status'](_0xd08963)['send'](_0x209d30);};}exports[_0x659b('0x28')]=function(_0x3cb032,_0x1c028d){var _0x328502={},_0x230e05={},_0x3f044a={'count':0x0,'rows':[]};var _0x5e5e8=_[_0x659b('0x29')](db[_0x659b('0x2a')][_0x659b('0x2b')],function(_0x1776ed){return{'name':_0x1776ed[_0x659b('0x2c')],'type':_0x1776ed[_0x659b('0x2d')][_0x659b('0x2e')]};});_0x230e05[_0x659b('0x2f')]=_['map'](_0x5e5e8,_0x659b('0x27'));_0x230e05[_0x659b('0x30')]=_[_0x659b('0x31')](_0x3cb032[_0x659b('0x30')]);_0x230e05[_0x659b('0x32')]=_[_0x659b('0x33')](_0x230e05[_0x659b('0x2f')],_0x230e05[_0x659b('0x30')]);_0x328502[_0x659b('0x34')]=_[_0x659b('0x33')](_0x230e05[_0x659b('0x2f')],qs['fields'](_0x3cb032[_0x659b('0x30')][_0x659b('0x35')]));_0x328502[_0x659b('0x34')]=_0x328502['attributes'][_0x659b('0x36')]?_0x328502[_0x659b('0x34')]:_0x230e05[_0x659b('0x2f')];if(!_0x3cb032[_0x659b('0x30')]['hasOwnProperty'](_0x659b('0x37'))){_0x328502[_0x659b('0x1d')]=qs[_0x659b('0x1d')](_0x3cb032[_0x659b('0x30')]['limit']);_0x328502[_0x659b('0x1b')]=qs['offset'](_0x3cb032[_0x659b('0x30')][_0x659b('0x1b')]);}_0x328502['order']=qs['sort'](_0x3cb032['query']['sort']);_0x328502[_0x659b('0x38')]=qs['filters'](_[_0x659b('0x39')](_0x3cb032[_0x659b('0x30')],_0x230e05[_0x659b('0x32')]),_0x5e5e8);if(_0x3cb032[_0x659b('0x30')]['filter']){_0x328502[_0x659b('0x38')]=_['merge'](_0x328502['where'],{'$or':_[_0x659b('0x29')](_0x5e5e8,function(_0x58233a){if(_0x58233a[_0x659b('0x2d')]!==_0x659b('0x3a')){var _0x18612e={};_0x18612e[_0x58233a[_0x659b('0x27')]]={'$like':'%'+_0x3cb032['query'][_0x659b('0x3b')]+'%'};return _0x18612e;}})});}_0x328502=_[_0x659b('0x3c')]({},_0x328502,_0x3cb032['options']);var _0x23bf30={'where':_0x328502[_0x659b('0x38')]};return db[_0x659b('0x2a')][_0x659b('0x1e')](_0x23bf30)[_0x659b('0x24')](function(_0x504317){_0x3f044a[_0x659b('0x1e')]=_0x504317;if(_0x3cb032[_0x659b('0x30')][_0x659b('0x3d')]){_0x328502[_0x659b('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x328502);})['then'](function(_0x143271){_0x3f044a['rows']=_0x143271;return _0x3f044a;})[_0x659b('0x24')](respondWithFilteredResult(_0x1c028d,_0x328502))[_0x659b('0x3f')](handleError(_0x1c028d,null));};exports['show']=function(_0x4c82a3,_0x4aa8d5){var _0xaf24f={'raw':!![],'where':{'id':_0x4c82a3[_0x659b('0x40')]['id']}},_0x21512e={};_0x21512e[_0x659b('0x2f')]=_['keys'](db[_0x659b('0x2a')][_0x659b('0x2b')]);_0x21512e[_0x659b('0x30')]=_[_0x659b('0x31')](_0x4c82a3[_0x659b('0x30')]);_0x21512e[_0x659b('0x32')]=_[_0x659b('0x33')](_0x21512e[_0x659b('0x2f')],_0x21512e[_0x659b('0x30')]);_0xaf24f[_0x659b('0x34')]=_[_0x659b('0x33')](_0x21512e['model'],qs['fields'](_0x4c82a3[_0x659b('0x30')][_0x659b('0x35')]));_0xaf24f[_0x659b('0x34')]=_0xaf24f[_0x659b('0x34')][_0x659b('0x36')]?_0xaf24f['attributes']:_0x21512e[_0x659b('0x2f')];if(_0x4c82a3[_0x659b('0x30')][_0x659b('0x3d')]){_0xaf24f[_0x659b('0x3e')]=[{'all':!![]}];}_0xaf24f=_[_0x659b('0x3c')]({},_0xaf24f,_0x4c82a3[_0x659b('0x41')]);return db[_0x659b('0x2a')]['find'](_0xaf24f)[_0x659b('0x24')](handleEntityNotFound(_0x4aa8d5,null))[_0x659b('0x24')](respondWithResult(_0x4aa8d5,null))['catch'](handleError(_0x4aa8d5,null));};exports[_0x659b('0x42')]=function(_0x4318cd,_0x507897){return db[_0x659b('0x2a')]['create'](_0x4318cd['body'],{})[_0x659b('0x24')](respondWithResult(_0x507897,0xc9))[_0x659b('0x3f')](handleError(_0x507897,null));};exports[_0x659b('0x23')]=function(_0x3af397,_0x26ab04){if(_0x3af397[_0x659b('0x43')]['id']){delete _0x3af397[_0x659b('0x43')]['id'];}return db['OpenchannelTransferReport'][_0x659b('0x44')]({'where':{'id':_0x3af397['params']['id']}})[_0x659b('0x24')](handleEntityNotFound(_0x26ab04,null))[_0x659b('0x24')](saveUpdates(_0x3af397[_0x659b('0x43')],null))[_0x659b('0x24')](respondWithResult(_0x26ab04,null))['catch'](handleError(_0x26ab04,null));};exports[_0x659b('0x45')]=function(_0x5cd846,_0x59c478){return db[_0x659b('0x2a')][_0x659b('0x44')]({'where':{'id':_0x5cd846['params']['id']}})['then'](handleEntityNotFound(_0x59c478,null))[_0x659b('0x24')](removeEntity(_0x59c478,null))[_0x659b('0x3f')](handleError(_0x59c478,null));};exports[_0x659b('0x46')]=function(_0x42510c,_0x5e39e7){return db[_0x659b('0x2a')]['describe']()[_0x659b('0x24')](respondWithResult(_0x5e39e7,null))[_0x659b('0x3f')](handleError(_0x5e39e7,null));}; \ No newline at end of file +var _0x3369=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','OpenchannelTransferReport','findAll','rows','show','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x563bf8,_0x16004b){var _0x1b39dc=function(_0x19b552){while(--_0x19b552){_0x563bf8['push'](_0x563bf8['shift']());}};_0x1b39dc(++_0x16004b);}(_0x3369,0x1c7));var _0x9336=function(_0x2fcb60,_0x51be6f){_0x2fcb60=_0x2fcb60-0x0;var _0x25bfd1=_0x3369[_0x2fcb60];return _0x25bfd1;};'use strict';var emlformat=require(_0x9336('0x0'));var rimraf=require(_0x9336('0x1'));var zipdir=require(_0x9336('0x2'));var jsonpatch=require(_0x9336('0x3'));var rp=require('request-promise');var moment=require(_0x9336('0x4'));var BPromise=require(_0x9336('0x5'));var Mustache=require(_0x9336('0x6'));var util=require(_0x9336('0x7'));var path=require('path');var sox=require(_0x9336('0x8'));var csv=require('to-csv');var ejs=require(_0x9336('0x9'));var fs=require('fs');var fs_extra=require(_0x9336('0xa'));var _=require(_0x9336('0xb'));var squel=require(_0x9336('0xc'));var crypto=require('crypto');var jsforce=require(_0x9336('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9336('0xe'));var Papa=require(_0x9336('0xf'));var Redis=require(_0x9336('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9336('0x11'));var as=require(_0x9336('0x12'));var hardwareService=require(_0x9336('0x13'));var logger=require('../../config/logger')(_0x9336('0x14'));var utils=require(_0x9336('0x15'));var config=require(_0x9336('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9336('0x17'))['db'];function respondWithStatusCode(_0x15385e,_0x30699d){_0x30699d=_0x30699d||0xcc;return function(_0x20f71d){if(_0x20f71d){return _0x15385e['sendStatus'](_0x30699d);}return _0x15385e[_0x9336('0x18')](_0x30699d)['end']();};}function respondWithResult(_0x57e7a7,_0x2c5d6e){_0x2c5d6e=_0x2c5d6e||0xc8;return function(_0x349c3d){if(_0x349c3d){return _0x57e7a7[_0x9336('0x18')](_0x2c5d6e)[_0x9336('0x19')](_0x349c3d);}};}function respondWithFilteredResult(_0x3122bd,_0x3e0c2e){return function(_0x5bea09){if(_0x5bea09){var _0x2f1b20=typeof _0x3e0c2e['offset']===_0x9336('0x1a')&&typeof _0x3e0c2e[_0x9336('0x1b')]===_0x9336('0x1a');var _0x20e305=_0x5bea09[_0x9336('0x1c')];var _0x272355=_0x2f1b20?0x0:_0x3e0c2e[_0x9336('0x1d')];var _0xa209bf=_0x2f1b20?_0x5bea09['count']:_0x3e0c2e[_0x9336('0x1d')]+_0x3e0c2e[_0x9336('0x1b')];var _0x362cd9;if(_0xa209bf>=_0x20e305){_0xa209bf=_0x20e305;_0x362cd9=0xc8;}else{_0x362cd9=0xce;}_0x3122bd['status'](_0x362cd9);return _0x3122bd[_0x9336('0x1e')](_0x9336('0x1f'),_0x272355+'-'+_0xa209bf+'/'+_0x20e305)[_0x9336('0x19')](_0x5bea09);}return null;};}function patchUpdates(_0xffc7b3){return function(_0x3153fe){try{jsonpatch[_0x9336('0x20')](_0x3153fe,_0xffc7b3,!![]);}catch(_0xf2602){return BPromise[_0x9336('0x21')](_0xf2602);}return _0x3153fe[_0x9336('0x22')]();};}function saveUpdates(_0xd2c9ae,_0x485dd8){return function(_0x1d2c81){if(_0x1d2c81){return _0x1d2c81[_0x9336('0x23')](_0xd2c9ae)[_0x9336('0x24')](function(_0x3983eb){return _0x3983eb;});}return null;};}function removeEntity(_0x23e28e,_0x864249){return function(_0x1e3205){if(_0x1e3205){return _0x1e3205[_0x9336('0x25')]()[_0x9336('0x24')](function(){_0x23e28e[_0x9336('0x18')](0xcc)[_0x9336('0x26')]();});}};}function handleEntityNotFound(_0x385436,_0x404b38){return function(_0x18b0e0){if(!_0x18b0e0){_0x385436[_0x9336('0x27')](0x194);}return _0x18b0e0;};}function handleError(_0x47312c,_0x60a14d){_0x60a14d=_0x60a14d||0x1f4;return function(_0x16c991){logger[_0x9336('0x28')](_0x16c991[_0x9336('0x29')]);if(_0x16c991['name']){delete _0x16c991[_0x9336('0x2a')];}_0x47312c[_0x9336('0x18')](_0x60a14d)[_0x9336('0x2b')](_0x16c991);};}exports[_0x9336('0x2c')]=function(_0x49f401,_0x1633c4){var _0x502aff={},_0x180420={},_0x25e07b={'count':0x0,'rows':[]};var _0x1bad40=_['map'](db['OpenchannelTransferReport'][_0x9336('0x2d')],function(_0x3f38eb){return{'name':_0x3f38eb[_0x9336('0x2e')],'type':_0x3f38eb[_0x9336('0x2f')][_0x9336('0x30')]};});_0x180420['model']=_[_0x9336('0x31')](_0x1bad40,_0x9336('0x2a'));_0x180420['query']=_[_0x9336('0x32')](_0x49f401[_0x9336('0x33')]);_0x180420[_0x9336('0x34')]=_[_0x9336('0x35')](_0x180420[_0x9336('0x36')],_0x180420[_0x9336('0x33')]);_0x502aff[_0x9336('0x37')]=_['intersection'](_0x180420[_0x9336('0x36')],qs[_0x9336('0x38')](_0x49f401[_0x9336('0x33')]['fields']));_0x502aff[_0x9336('0x37')]=_0x502aff[_0x9336('0x37')][_0x9336('0x39')]?_0x502aff[_0x9336('0x37')]:_0x180420[_0x9336('0x36')];if(!_0x49f401[_0x9336('0x33')][_0x9336('0x3a')](_0x9336('0x3b'))){_0x502aff[_0x9336('0x1b')]=qs['limit'](_0x49f401[_0x9336('0x33')][_0x9336('0x1b')]);_0x502aff[_0x9336('0x1d')]=qs['offset'](_0x49f401[_0x9336('0x33')]['offset']);}_0x502aff[_0x9336('0x3c')]=qs['sort'](_0x49f401[_0x9336('0x33')][_0x9336('0x3d')]);_0x502aff[_0x9336('0x3e')]=qs[_0x9336('0x34')](_[_0x9336('0x3f')](_0x49f401[_0x9336('0x33')],_0x180420[_0x9336('0x34')]),_0x1bad40);if(_0x49f401[_0x9336('0x33')][_0x9336('0x40')]){_0x502aff[_0x9336('0x3e')]=_[_0x9336('0x41')](_0x502aff[_0x9336('0x3e')],{'$or':_['map'](_0x1bad40,function(_0x5d6aee){if(_0x5d6aee[_0x9336('0x2f')]!=='VIRTUAL'){var _0x3cf2e1={};_0x3cf2e1[_0x5d6aee[_0x9336('0x2a')]]={'$like':'%'+_0x49f401['query']['filter']+'%'};return _0x3cf2e1;}})});}_0x502aff=_[_0x9336('0x41')]({},_0x502aff,_0x49f401[_0x9336('0x42')]);var _0x4abbda={'where':_0x502aff[_0x9336('0x3e')]};return db['OpenchannelTransferReport'][_0x9336('0x1c')](_0x4abbda)[_0x9336('0x24')](function(_0x5d9359){_0x25e07b['count']=_0x5d9359;if(_0x49f401['query'][_0x9336('0x43')]){_0x502aff[_0x9336('0x44')]=[{'all':!![]}];}return db[_0x9336('0x45')][_0x9336('0x46')](_0x502aff);})['then'](function(_0x12add6){_0x25e07b[_0x9336('0x47')]=_0x12add6;return _0x25e07b;})[_0x9336('0x24')](respondWithFilteredResult(_0x1633c4,_0x502aff))['catch'](handleError(_0x1633c4,null));};exports[_0x9336('0x48')]=function(_0x537a37,_0x58ca00){var _0x4de9c1={'raw':!![],'where':{'id':_0x537a37['params']['id']}},_0x242108={};_0x242108[_0x9336('0x36')]=_['keys'](db['OpenchannelTransferReport'][_0x9336('0x2d')]);_0x242108[_0x9336('0x33')]=_['keys'](_0x537a37[_0x9336('0x33')]);_0x242108['filters']=_[_0x9336('0x35')](_0x242108['model'],_0x242108[_0x9336('0x33')]);_0x4de9c1[_0x9336('0x37')]=_[_0x9336('0x35')](_0x242108[_0x9336('0x36')],qs[_0x9336('0x38')](_0x537a37[_0x9336('0x33')][_0x9336('0x38')]));_0x4de9c1['attributes']=_0x4de9c1[_0x9336('0x37')][_0x9336('0x39')]?_0x4de9c1[_0x9336('0x37')]:_0x242108[_0x9336('0x36')];if(_0x537a37['query'][_0x9336('0x43')]){_0x4de9c1[_0x9336('0x44')]=[{'all':!![]}];}_0x4de9c1=_[_0x9336('0x41')]({},_0x4de9c1,_0x537a37[_0x9336('0x42')]);return db['OpenchannelTransferReport'][_0x9336('0x49')](_0x4de9c1)[_0x9336('0x24')](handleEntityNotFound(_0x58ca00,null))[_0x9336('0x24')](respondWithResult(_0x58ca00,null))['catch'](handleError(_0x58ca00,null));};exports['create']=function(_0x13a2e4,_0x45c8c2){return db[_0x9336('0x45')][_0x9336('0x4a')](_0x13a2e4[_0x9336('0x4b')],{})[_0x9336('0x24')](respondWithResult(_0x45c8c2,0xc9))[_0x9336('0x4c')](handleError(_0x45c8c2,null));};exports[_0x9336('0x23')]=function(_0xad9820,_0x5e2454){if(_0xad9820[_0x9336('0x4b')]['id']){delete _0xad9820[_0x9336('0x4b')]['id'];}return db['OpenchannelTransferReport'][_0x9336('0x49')]({'where':{'id':_0xad9820[_0x9336('0x4d')]['id']}})[_0x9336('0x24')](handleEntityNotFound(_0x5e2454,null))['then'](saveUpdates(_0xad9820[_0x9336('0x4b')],null))['then'](respondWithResult(_0x5e2454,null))[_0x9336('0x4c')](handleError(_0x5e2454,null));};exports[_0x9336('0x25')]=function(_0x25da61,_0x3ab1e6){return db[_0x9336('0x45')][_0x9336('0x49')]({'where':{'id':_0x25da61['params']['id']}})[_0x9336('0x24')](handleEntityNotFound(_0x3ab1e6,null))[_0x9336('0x24')](removeEntity(_0x3ab1e6,null))['catch'](handleError(_0x3ab1e6,null));};exports[_0x9336('0x4e')]=function(_0x5666f0,_0x2df1e2){return db['OpenchannelTransferReport'][_0x9336('0x4e')]()['then'](respondWithResult(_0x2df1e2,null))['catch'](handleError(_0x2df1e2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index c445931..1fccfa1 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 _0xf1cf=['util','../../config/logger','moment','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x446867,_0xd8c68c){var _0x52e366=function(_0xc467d){while(--_0xc467d){_0x446867['push'](_0x446867['shift']());}};_0x52e366(++_0xd8c68c);}(_0xf1cf,0xfb));var _0xff1c=function(_0x4858cf,_0x45cc07){_0x4858cf=_0x4858cf-0x0;var _0x461702=_0xf1cf[_0x4858cf];return _0x461702;};'use strict';var _=require(_0xff1c('0x0'));var util=require(_0xff1c('0x1'));var logger=require(_0xff1c('0x2'))('api');var moment=require(_0xff1c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xff1c('0x4'));var config=require(_0xff1c('0x5'));var attributes=require(_0xff1c('0x6'));module[_0xff1c('0x7')]=function(_0x2affad,_0x111c0a){return _0x2affad[_0xff1c('0x8')](_0xff1c('0x9'),attributes,{'tableName':_0xff1c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xff1c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1ea=['uniqueid','lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x490e0a,_0x1eca50){var _0x212ff2=function(_0x281eb2){while(--_0x281eb2){_0x490e0a['push'](_0x490e0a['shift']());}};_0x212ff2(++_0x1eca50);}(_0xf1ea,0x1d5));var _0xaf1e=function(_0x19afde,_0x2070b9){_0x19afde=_0x19afde-0x0;var _0x7ee16d=_0xf1ea[_0x19afde];return _0x7ee16d;};'use strict';var _=require(_0xaf1e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaf1e('0x1'));var moment=require(_0xaf1e('0x2'));var BPromise=require(_0xaf1e('0x3'));var rp=require(_0xaf1e('0x4'));var fs=require('fs');var path=require(_0xaf1e('0x5'));var rimraf=require('rimraf');var config=require(_0xaf1e('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0xaf1e('0x7')]=function(_0x46891b,_0x46c206){return _0x46891b[_0xaf1e('0x8')](_0xaf1e('0x9'),attributes,{'tableName':_0xaf1e('0xa'),'paranoid':![],'indexes':[{'name':_0xaf1e('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 8828d65..9a305d0 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 _0xa751=['rpc','jayson/promise','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x5a6b12,_0x220453){var _0x4a1656=function(_0x33fc6f){while(--_0x33fc6f){_0x5a6b12['push'](_0x5a6b12['shift']());}};_0x4a1656(++_0x220453);}(_0xa751,0x175));var _0x1a75=function(_0x429e48,_0x17964a){_0x429e48=_0x429e48-0x0;var _0x832e99=_0xa751[_0x429e48];return _0x832e99;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var moment=require(_0x1a75('0x2'));var BPromise=require(_0x1a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a75('0x5'));var logger=require(_0x1a75('0x6'))(_0x1a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a75('0x8'));var client=jayson[_0x1a75('0x9')][_0x1a75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2af95b,_0x1ec106,_0x692ac0){return new BPromise(function(_0x4537f6,_0x5d6faa){return client['request'](_0x2af95b,_0x692ac0)['then'](function(_0x41aa8f){logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));logger[_0x1a75('0xe')](_0x1a75('0xf'),_0x1ec106,_0x1a75('0xd'),JSON[_0x1a75('0x10')](_0x41aa8f));if(_0x41aa8f['error']){if(_0x41aa8f['error']['code']===0x1f4){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f[_0x1a75('0x11')][_0x1a75('0x12')]);return _0x5d6faa(_0x41aa8f['error']['message']);}logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f['error'][_0x1a75('0x12')]);return _0x4537f6(_0x41aa8f[_0x1a75('0x11')]['message']);}else{logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));_0x4537f6(_0x41aa8f['result']['message']);}})['catch'](function(_0x471b90){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x471b90);_0x5d6faa(_0x471b90);});});} \ No newline at end of file +var _0xec46=['jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x43c3bc,_0x4bfa56){var _0x50033f=function(_0x552feb){while(--_0x552feb){_0x43c3bc['push'](_0x43c3bc['shift']());}};_0x50033f(++_0x4bfa56);}(_0xec46,0x19c));var _0x6ec4=function(_0x25ccbe,_0xc935c0){_0x25ccbe=_0x25ccbe-0x0;var _0x289529=_0xec46[_0x25ccbe];return _0x289529;};'use strict';var _=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var moment=require(_0x6ec4('0x2'));var BPromise=require(_0x6ec4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ec4('0x4'))['db'];var utils=require(_0x6ec4('0x5'));var logger=require(_0x6ec4('0x6'))('rpc');var config=require(_0x6ec4('0x7'));var jayson=require(_0x6ec4('0x8'));var client=jayson['client'][_0x6ec4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d260,_0x1f6d1a,_0x391ed9){return new BPromise(function(_0x42b81b,_0xe47f57){return client[_0x6ec4('0xa')](_0x55d260,_0x391ed9)[_0x6ec4('0xb')](function(_0x384cf){logger[_0x6ec4('0xc')](_0x6ec4('0xd'),_0x1f6d1a,_0x6ec4('0xe'));logger[_0x6ec4('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x1f6d1a,'request\x20sent',JSON[_0x6ec4('0x10')](_0x384cf));if(_0x384cf[_0x6ec4('0x11')]){if(_0x384cf[_0x6ec4('0x11')]['code']===0x1f4){logger[_0x6ec4('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6d1a,_0x384cf[_0x6ec4('0x11')]['message']);return _0xe47f57(_0x384cf[_0x6ec4('0x11')][_0x6ec4('0x12')]);}logger[_0x6ec4('0x11')](_0x6ec4('0xd'),_0x1f6d1a,_0x384cf[_0x6ec4('0x11')]['message']);return _0x42b81b(_0x384cf[_0x6ec4('0x11')][_0x6ec4('0x12')]);}else{logger[_0x6ec4('0xc')](_0x6ec4('0xd'),_0x1f6d1a,_0x6ec4('0xe'));_0x42b81b(_0x384cf[_0x6ec4('0x13')][_0x6ec4('0x12')]);}})[_0x6ec4('0x14')](function(_0x19ffc8){logger[_0x6ec4('0x11')](_0x6ec4('0xd'),_0x1f6d1a,_0x19ffc8);_0xe47f57(_0x19ffc8);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index fec315f..12e5443 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 _0x72ee=['express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','isAuthenticated','index','get','/:id','show','create','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x72ee,0x1ac));var _0xe72e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x72ee[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xe72e('0x0'));var util=require(_0xe72e('0x1'));var path=require(_0xe72e('0x2'));var timeout=require(_0xe72e('0x3'));var express=require(_0xe72e('0x4'));var router=express[_0xe72e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe72e('0x6'));var interaction=require(_0xe72e('0x7'));var config=require('../../config/environment');var controller=require(_0xe72e('0x8'));router['get']('/',auth[_0xe72e('0x9')](),controller[_0xe72e('0xa')]);router[_0xe72e('0xb')](_0xe72e('0xc'),auth[_0xe72e('0x9')](),controller[_0xe72e('0xd')]);router['post']('/',auth[_0xe72e('0x9')](),controller[_0xe72e('0xe')]);router[_0xe72e('0xf')](_0xe72e('0xc'),auth['isAuthenticated'](),controller[_0xe72e('0x10')]);router['delete'](_0xe72e('0xc'),auth[_0xe72e('0x9')](),controller[_0xe72e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5542=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','index','get','isAuthenticated','post','create','put','delete','/:id','exports'];(function(_0x3cb82a,_0x408bfc){var _0x918997=function(_0x340c5a){while(--_0x340c5a){_0x3cb82a['push'](_0x3cb82a['shift']());}};_0x918997(++_0x408bfc);}(_0x5542,0x1cb));var _0x2554=function(_0x2b9630,_0x394f14){_0x2b9630=_0x2b9630-0x0;var _0x5cb3ba=_0x5542[_0x2b9630];return _0x5cb3ba;};'use strict';var multer=require('multer');var util=require(_0x2554('0x0'));var path=require(_0x2554('0x1'));var timeout=require('connect-timeout');var express=require(_0x2554('0x2'));var router=express[_0x2554('0x3')]();var fs_extra=require(_0x2554('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2554('0x5'));var config=require(_0x2554('0x6'));var controller=require(_0x2554('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2554('0x8')]);router[_0x2554('0x9')]('/:id',auth[_0x2554('0xa')](),controller['show']);router[_0x2554('0xb')]('/',auth[_0x2554('0xa')](),controller[_0x2554('0xc')]);router[_0x2554('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2554('0xe')](_0x2554('0xf'),auth[_0x2554('0xa')](),controller['destroy']);module[_0x2554('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 0f5bdf4..a623d93 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 _0xd637=['name','sequelize','exports','STRING'];(function(_0x5c8af7,_0x1500ca){var _0x1fd5f4=function(_0x3cef1f){while(--_0x3cef1f){_0x5c8af7['push'](_0x5c8af7['shift']());}};_0x1fd5f4(++_0x1500ca);}(_0xd637,0x15d));var _0x7d63=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd637[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x7d63('0x0'));module[_0x7d63('0x1')]={'name':{'type':Sequelize[_0x7d63('0x2')],'unique':_0x7d63('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7d63('0x2')]}}; \ No newline at end of file +var _0x83fe=['STRING','sequelize','exports','name'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x83fe,0x16d));var _0xe83f=function(_0x2394d3,_0x574341){_0x2394d3=_0x2394d3-0x0;var _0xcce1b7=_0x83fe[_0x2394d3];return _0xcce1b7;};'use strict';var Sequelize=require(_0xe83f('0x0'));module[_0xe83f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe83f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xe83f('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c4ac86a..d67c5b3 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 _0x7b61=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','save','update','then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','index','map','Pause','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','VIRTUAL','options','count','findAll','catch','show','params','keys','include','merge','body','user','role','UserProfileSection','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0x7b61,0x15f));var _0x17b6=function(_0x4618b0,_0x3dfe3a){_0x4618b0=_0x4618b0-0x0;var _0x576536=_0x7b61[_0x4618b0];return _0x576536;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x17b6('0x0'));var jsonpatch=require(_0x17b6('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x17b6('0x2'));var util=require(_0x17b6('0x3'));var path=require(_0x17b6('0x4'));var sox=require(_0x17b6('0x5'));var csv=require(_0x17b6('0x6'));var ejs=require(_0x17b6('0x7'));var fs=require('fs');var fs_extra=require(_0x17b6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x17b6('0x6'));var querystring=require(_0x17b6('0x9'));var Papa=require(_0x17b6('0xa'));var Redis=require(_0x17b6('0xb'));var authService=require(_0x17b6('0xc'));var qs=require(_0x17b6('0xd'));var as=require(_0x17b6('0xe'));var hardwareService=require(_0x17b6('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x17b6('0x10'));var config=require(_0x17b6('0x11'));var licenseUtil=require(_0x17b6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x474054,_0x46d9d9){_0x46d9d9=_0x46d9d9||0xcc;return function(_0xdda047){if(_0xdda047){return _0x474054[_0x17b6('0x13')](_0x46d9d9);}return _0x474054['status'](_0x46d9d9)[_0x17b6('0x14')]();};}function respondWithResult(_0x276028,_0x1f0c61){_0x1f0c61=_0x1f0c61||0xc8;return function(_0xf7d4f3){if(_0xf7d4f3){return _0x276028[_0x17b6('0x15')](_0x1f0c61)[_0x17b6('0x16')](_0xf7d4f3);}};}function respondWithFilteredResult(_0x5ac68b,_0x5517ac){return function(_0x5a531a){if(_0x5a531a){var _0x150b03=typeof _0x5517ac[_0x17b6('0x17')]==='undefined'&&typeof _0x5517ac['limit']===_0x17b6('0x18');var _0x2457fe=_0x5a531a['count'];var _0x1c12f2=_0x150b03?0x0:_0x5517ac[_0x17b6('0x17')];var _0x40eb01=_0x150b03?_0x5a531a['count']:_0x5517ac[_0x17b6('0x17')]+_0x5517ac[_0x17b6('0x19')];var _0xf7b3ac;if(_0x40eb01>=_0x2457fe){_0x40eb01=_0x2457fe;_0xf7b3ac=0xc8;}else{_0xf7b3ac=0xce;}_0x5ac68b['status'](_0xf7b3ac);return _0x5ac68b[_0x17b6('0x1a')]('Content-Range',_0x1c12f2+'-'+_0x40eb01+'/'+_0x2457fe)['json'](_0x5a531a);}return null;};}function patchUpdates(_0x33353b){return function(_0x3aee97){try{jsonpatch['apply'](_0x3aee97,_0x33353b,!![]);}catch(_0x369b15){return BPromise['reject'](_0x369b15);}return _0x3aee97[_0x17b6('0x1b')]();};}function saveUpdates(_0x327573,_0x1b999f){return function(_0x2adbd0){if(_0x2adbd0){return _0x2adbd0[_0x17b6('0x1c')](_0x327573)[_0x17b6('0x1d')](function(_0x4a910d){return _0x4a910d;});}return null;};}function removeEntity(_0xb10a55,_0x35b951){return function(_0x4fbfc0){if(_0x4fbfc0){return _0x4fbfc0['destroy']()[_0x17b6('0x1d')](function(){var _0x952c1a=_0x4fbfc0[_0x17b6('0x1e')]({'plain':!![]});var _0x141086=_0x17b6('0x1f');return db[_0x17b6('0x20')][_0x17b6('0x21')]({'where':{'type':_0x141086,'resourceId':_0x952c1a['id']}})[_0x17b6('0x1d')](function(){return _0x4fbfc0;});})[_0x17b6('0x1d')](function(){_0xb10a55['status'](0xcc)[_0x17b6('0x14')]();});}};}function handleEntityNotFound(_0xf50bc1,_0x59507a){return function(_0x230f2f){if(!_0x230f2f){_0xf50bc1['sendStatus'](0x194);}return _0x230f2f;};}function handleError(_0x1ec443,_0x5afa59){_0x5afa59=_0x5afa59||0x1f4;return function(_0x212485){logger[_0x17b6('0x22')](_0x212485[_0x17b6('0x23')]);if(_0x212485[_0x17b6('0x24')]){delete _0x212485[_0x17b6('0x24')];}_0x1ec443['status'](_0x5afa59)[_0x17b6('0x25')](_0x212485);};}exports[_0x17b6('0x26')]=function(_0x155001,_0x4adb80){var _0x1732a0={},_0x1d806b={},_0x1be838={'count':0x0,'rows':[]};var _0x10c4c1=_[_0x17b6('0x27')](db[_0x17b6('0x28')][_0x17b6('0x29')],function(_0x69b4aa){return{'name':_0x69b4aa['fieldName'],'type':_0x69b4aa[_0x17b6('0x2a')][_0x17b6('0x2b')]};});_0x1d806b[_0x17b6('0x2c')]=_['map'](_0x10c4c1,_0x17b6('0x24'));_0x1d806b[_0x17b6('0x2d')]=_['keys'](_0x155001[_0x17b6('0x2d')]);_0x1d806b[_0x17b6('0x2e')]=_[_0x17b6('0x2f')](_0x1d806b[_0x17b6('0x2c')],_0x1d806b[_0x17b6('0x2d')]);_0x1732a0[_0x17b6('0x30')]=_[_0x17b6('0x2f')](_0x1d806b['model'],qs[_0x17b6('0x31')](_0x155001[_0x17b6('0x2d')][_0x17b6('0x31')]));_0x1732a0[_0x17b6('0x30')]=_0x1732a0['attributes'][_0x17b6('0x32')]?_0x1732a0[_0x17b6('0x30')]:_0x1d806b[_0x17b6('0x2c')];if(!_0x155001[_0x17b6('0x2d')][_0x17b6('0x33')]('nolimit')){_0x1732a0['limit']=qs[_0x17b6('0x19')](_0x155001['query']['limit']);_0x1732a0[_0x17b6('0x17')]=qs[_0x17b6('0x17')](_0x155001[_0x17b6('0x2d')][_0x17b6('0x17')]);}_0x1732a0['order']=qs[_0x17b6('0x34')](_0x155001[_0x17b6('0x2d')][_0x17b6('0x34')]);_0x1732a0['where']=qs[_0x17b6('0x2e')](_['pick'](_0x155001[_0x17b6('0x2d')],_0x1d806b['filters']),_0x10c4c1);if(_0x155001[_0x17b6('0x2d')]['filter']){_0x1732a0[_0x17b6('0x35')]=_['merge'](_0x1732a0['where'],{'$or':_['map'](_0x10c4c1,function(_0xd50fb3){if(_0xd50fb3[_0x17b6('0x2a')]!==_0x17b6('0x36')){var _0x5d495d={};_0x5d495d[_0xd50fb3[_0x17b6('0x24')]]={'$like':'%'+_0x155001[_0x17b6('0x2d')]['filter']+'%'};return _0x5d495d;}})});}_0x1732a0=_['merge']({},_0x1732a0,_0x155001[_0x17b6('0x37')]);var _0x28c1e6={'where':_0x1732a0['where']};return db[_0x17b6('0x28')]['count'](_0x28c1e6)[_0x17b6('0x1d')](function(_0x5e637d){_0x1be838[_0x17b6('0x38')]=_0x5e637d;if(_0x155001[_0x17b6('0x2d')]['includeAll']){_0x1732a0['include']=[{'all':!![]}];}return db['Pause'][_0x17b6('0x39')](_0x1732a0);})[_0x17b6('0x1d')](function(_0x595abd){_0x1be838['rows']=_0x595abd;return _0x1be838;})[_0x17b6('0x1d')](respondWithFilteredResult(_0x4adb80,_0x1732a0))[_0x17b6('0x3a')](handleError(_0x4adb80,null));};exports[_0x17b6('0x3b')]=function(_0x4828b5,_0x3aace9){var _0x469542={'raw':!![],'where':{'id':_0x4828b5[_0x17b6('0x3c')]['id']}},_0xe4aad={};_0xe4aad['model']=_[_0x17b6('0x3d')](db[_0x17b6('0x28')]['rawAttributes']);_0xe4aad[_0x17b6('0x2d')]=_[_0x17b6('0x3d')](_0x4828b5['query']);_0xe4aad[_0x17b6('0x2e')]=_[_0x17b6('0x2f')](_0xe4aad['model'],_0xe4aad[_0x17b6('0x2d')]);_0x469542[_0x17b6('0x30')]=_[_0x17b6('0x2f')](_0xe4aad[_0x17b6('0x2c')],qs[_0x17b6('0x31')](_0x4828b5['query'][_0x17b6('0x31')]));_0x469542['attributes']=_0x469542['attributes']['length']?_0x469542[_0x17b6('0x30')]:_0xe4aad[_0x17b6('0x2c')];if(_0x4828b5[_0x17b6('0x2d')]['includeAll']){_0x469542[_0x17b6('0x3e')]=[{'all':!![]}];}_0x469542=_[_0x17b6('0x3f')]({},_0x469542,_0x4828b5[_0x17b6('0x37')]);return db[_0x17b6('0x28')]['find'](_0x469542)[_0x17b6('0x1d')](handleEntityNotFound(_0x3aace9,null))[_0x17b6('0x1d')](respondWithResult(_0x3aace9,null))[_0x17b6('0x3a')](handleError(_0x3aace9,null));};exports['create']=function(_0x4c4413,_0x2e5619){return db['Pause']['create'](_0x4c4413[_0x17b6('0x40')],{})['then'](function(_0x2b8b7f){var _0xe627d7=_0x4c4413[_0x17b6('0x41')][_0x17b6('0x1e')]({'plain':!![]});if(!_0xe627d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe627d7[_0x17b6('0x42')]===_0x17b6('0x41')){var _0x12f4f0=_0x2b8b7f['get']({'plain':!![]});var _0xd0dbb6=_0x17b6('0x1f');return db[_0x17b6('0x43')][_0x17b6('0x44')]({'where':{'name':_0xd0dbb6,'userProfileId':_0xe627d7[_0x17b6('0x45')]},'raw':!![]})['then'](function(_0x4c1595){if(_0x4c1595&&_0x4c1595['autoAssociation']===0x0){return db[_0x17b6('0x20')][_0x17b6('0x46')]({'name':_0x12f4f0['name'],'resourceId':_0x12f4f0['id'],'type':_0x4c1595['name'],'sectionId':_0x4c1595['id']},{})[_0x17b6('0x1d')](function(){return _0x2b8b7f;});}else{return _0x2b8b7f;}})[_0x17b6('0x3a')](function(_0x36fe00){logger[_0x17b6('0x22')](_0x17b6('0x47'),_0x36fe00);throw _0x36fe00;});}return _0x2b8b7f;})['then'](respondWithResult(_0x2e5619,0xc9))[_0x17b6('0x3a')](handleError(_0x2e5619,null));};exports[_0x17b6('0x1c')]=function(_0x2d782a,_0x5f348c){if(_0x2d782a[_0x17b6('0x40')]['id']){delete _0x2d782a[_0x17b6('0x40')]['id'];}return db[_0x17b6('0x28')][_0x17b6('0x44')]({'where':{'id':_0x2d782a['params']['id']}})[_0x17b6('0x1d')](handleEntityNotFound(_0x5f348c,null))[_0x17b6('0x1d')](saveUpdates(_0x2d782a[_0x17b6('0x40')],null))['then'](respondWithResult(_0x5f348c,null))[_0x17b6('0x3a')](handleError(_0x5f348c,null));};exports[_0x17b6('0x21')]=function(_0x1edb71,_0xf5d6a2){return db[_0x17b6('0x28')][_0x17b6('0x44')]({'where':{'id':_0x1edb71['params']['id']}})[_0x17b6('0x1d')](handleEntityNotFound(_0xf5d6a2,null))[_0x17b6('0x1d')](removeEntity(_0xf5d6a2,null))[_0x17b6('0x3a')](handleError(_0xf5d6a2,null));}; \ No newline at end of file +var _0x4ad2=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','update','destroy','then','get','Pauses','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','rows','catch','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse'];(function(_0x213631,_0x4444cf){var _0x3465ed=function(_0x1fdf29){while(--_0x1fdf29){_0x213631['push'](_0x213631['shift']());}};_0x3465ed(++_0x4444cf);}(_0x4ad2,0x1db));var _0x24ad=function(_0x3ca9c3,_0x55a15f){_0x3ca9c3=_0x3ca9c3-0x0;var _0x53efbc=_0x4ad2[_0x3ca9c3];return _0x53efbc;};'use strict';var emlformat=require(_0x24ad('0x0'));var rimraf=require(_0x24ad('0x1'));var zipdir=require(_0x24ad('0x2'));var jsonpatch=require(_0x24ad('0x3'));var rp=require(_0x24ad('0x4'));var moment=require(_0x24ad('0x5'));var BPromise=require(_0x24ad('0x6'));var Mustache=require('mustache');var util=require(_0x24ad('0x7'));var path=require(_0x24ad('0x8'));var sox=require('sox');var csv=require(_0x24ad('0x9'));var ejs=require(_0x24ad('0xa'));var fs=require('fs');var fs_extra=require(_0x24ad('0xb'));var _=require(_0x24ad('0xc'));var squel=require('squel');var crypto=require(_0x24ad('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x24ad('0xe'));var toCsv=require(_0x24ad('0x9'));var querystring=require(_0x24ad('0xf'));var Papa=require(_0x24ad('0x10'));var Redis=require('ioredis');var authService=require(_0x24ad('0x11'));var qs=require(_0x24ad('0x12'));var as=require(_0x24ad('0x13'));var hardwareService=require(_0x24ad('0x14'));var logger=require(_0x24ad('0x15'))(_0x24ad('0x16'));var utils=require(_0x24ad('0x17'));var config=require(_0x24ad('0x18'));var licenseUtil=require(_0x24ad('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a842d,_0x166c74){_0x166c74=_0x166c74||0xcc;return function(_0x11ad18){if(_0x11ad18){return _0x1a842d[_0x24ad('0x1a')](_0x166c74);}return _0x1a842d[_0x24ad('0x1b')](_0x166c74)[_0x24ad('0x1c')]();};}function respondWithResult(_0x539d6e,_0x4d6075){_0x4d6075=_0x4d6075||0xc8;return function(_0x3cc3f6){if(_0x3cc3f6){return _0x539d6e['status'](_0x4d6075)['json'](_0x3cc3f6);}};}function respondWithFilteredResult(_0x431702,_0x25dca9){return function(_0x63c184){if(_0x63c184){var _0x16d2e5=typeof _0x25dca9['offset']===_0x24ad('0x1d')&&typeof _0x25dca9[_0x24ad('0x1e')]==='undefined';var _0x5d5bea=_0x63c184[_0x24ad('0x1f')];var _0x3d711f=_0x16d2e5?0x0:_0x25dca9[_0x24ad('0x20')];var _0x59c35a=_0x16d2e5?_0x63c184[_0x24ad('0x1f')]:_0x25dca9[_0x24ad('0x20')]+_0x25dca9[_0x24ad('0x1e')];var _0x21f5d8;if(_0x59c35a>=_0x5d5bea){_0x59c35a=_0x5d5bea;_0x21f5d8=0xc8;}else{_0x21f5d8=0xce;}_0x431702['status'](_0x21f5d8);return _0x431702[_0x24ad('0x21')](_0x24ad('0x22'),_0x3d711f+'-'+_0x59c35a+'/'+_0x5d5bea)[_0x24ad('0x23')](_0x63c184);}return null;};}function patchUpdates(_0x23c24){return function(_0x535e85){try{jsonpatch[_0x24ad('0x24')](_0x535e85,_0x23c24,!![]);}catch(_0x58b473){return BPromise['reject'](_0x58b473);}return _0x535e85['save']();};}function saveUpdates(_0x3a76c1,_0x26b094){return function(_0x339397){if(_0x339397){return _0x339397[_0x24ad('0x25')](_0x3a76c1)['then'](function(_0x5d821d){return _0x5d821d;});}return null;};}function removeEntity(_0x1818e9,_0x3e266b){return function(_0x27c225){if(_0x27c225){return _0x27c225[_0x24ad('0x26')]()[_0x24ad('0x27')](function(){var _0x3ffe73=_0x27c225[_0x24ad('0x28')]({'plain':!![]});var _0x24d2b9=_0x24ad('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x24d2b9,'resourceId':_0x3ffe73['id']}})[_0x24ad('0x27')](function(){return _0x27c225;});})[_0x24ad('0x27')](function(){_0x1818e9['status'](0xcc)[_0x24ad('0x1c')]();});}};}function handleEntityNotFound(_0x412e61,_0x736bea){return function(_0x18f2d1){if(!_0x18f2d1){_0x412e61[_0x24ad('0x1a')](0x194);}return _0x18f2d1;};}function handleError(_0x260108,_0x24246d){_0x24246d=_0x24246d||0x1f4;return function(_0x13f82d){logger[_0x24ad('0x2a')](_0x13f82d[_0x24ad('0x2b')]);if(_0x13f82d[_0x24ad('0x2c')]){delete _0x13f82d[_0x24ad('0x2c')];}_0x260108[_0x24ad('0x1b')](_0x24246d)[_0x24ad('0x2d')](_0x13f82d);};}exports[_0x24ad('0x2e')]=function(_0x16d8fa,_0x117da1){var _0x2546fb={},_0x3a55e2={},_0x42d07b={'count':0x0,'rows':[]};var _0x441a9c=_[_0x24ad('0x2f')](db[_0x24ad('0x30')][_0x24ad('0x31')],function(_0x3908dd){return{'name':_0x3908dd[_0x24ad('0x32')],'type':_0x3908dd[_0x24ad('0x33')][_0x24ad('0x34')]};});_0x3a55e2[_0x24ad('0x35')]=_['map'](_0x441a9c,_0x24ad('0x2c'));_0x3a55e2[_0x24ad('0x36')]=_[_0x24ad('0x37')](_0x16d8fa[_0x24ad('0x36')]);_0x3a55e2[_0x24ad('0x38')]=_['intersection'](_0x3a55e2[_0x24ad('0x35')],_0x3a55e2[_0x24ad('0x36')]);_0x2546fb[_0x24ad('0x39')]=_[_0x24ad('0x3a')](_0x3a55e2[_0x24ad('0x35')],qs[_0x24ad('0x3b')](_0x16d8fa[_0x24ad('0x36')][_0x24ad('0x3b')]));_0x2546fb[_0x24ad('0x39')]=_0x2546fb[_0x24ad('0x39')][_0x24ad('0x3c')]?_0x2546fb['attributes']:_0x3a55e2[_0x24ad('0x35')];if(!_0x16d8fa[_0x24ad('0x36')]['hasOwnProperty'](_0x24ad('0x3d'))){_0x2546fb[_0x24ad('0x1e')]=qs[_0x24ad('0x1e')](_0x16d8fa[_0x24ad('0x36')][_0x24ad('0x1e')]);_0x2546fb[_0x24ad('0x20')]=qs[_0x24ad('0x20')](_0x16d8fa[_0x24ad('0x36')]['offset']);}_0x2546fb['order']=qs[_0x24ad('0x3e')](_0x16d8fa[_0x24ad('0x36')][_0x24ad('0x3e')]);_0x2546fb[_0x24ad('0x3f')]=qs[_0x24ad('0x38')](_[_0x24ad('0x40')](_0x16d8fa[_0x24ad('0x36')],_0x3a55e2[_0x24ad('0x38')]),_0x441a9c);if(_0x16d8fa[_0x24ad('0x36')]['filter']){_0x2546fb[_0x24ad('0x3f')]=_[_0x24ad('0x41')](_0x2546fb[_0x24ad('0x3f')],{'$or':_['map'](_0x441a9c,function(_0x2f096c){if(_0x2f096c['type']!==_0x24ad('0x42')){var _0x3a14f7={};_0x3a14f7[_0x2f096c['name']]={'$like':'%'+_0x16d8fa[_0x24ad('0x36')]['filter']+'%'};return _0x3a14f7;}})});}_0x2546fb=_['merge']({},_0x2546fb,_0x16d8fa['options']);var _0x32b17d={'where':_0x2546fb[_0x24ad('0x3f')]};return db[_0x24ad('0x30')]['count'](_0x32b17d)['then'](function(_0xbb06a3){_0x42d07b[_0x24ad('0x1f')]=_0xbb06a3;if(_0x16d8fa[_0x24ad('0x36')][_0x24ad('0x43')]){_0x2546fb['include']=[{'all':!![]}];}return db['Pause']['findAll'](_0x2546fb);})['then'](function(_0x2d51d3){_0x42d07b[_0x24ad('0x44')]=_0x2d51d3;return _0x42d07b;})[_0x24ad('0x27')](respondWithFilteredResult(_0x117da1,_0x2546fb))[_0x24ad('0x45')](handleError(_0x117da1,null));};exports['show']=function(_0x16fdac,_0x4c1ba6){var _0x231d91={'raw':!![],'where':{'id':_0x16fdac[_0x24ad('0x46')]['id']}},_0x1347a0={};_0x1347a0[_0x24ad('0x35')]=_[_0x24ad('0x37')](db['Pause'][_0x24ad('0x31')]);_0x1347a0[_0x24ad('0x36')]=_['keys'](_0x16fdac[_0x24ad('0x36')]);_0x1347a0['filters']=_[_0x24ad('0x3a')](_0x1347a0['model'],_0x1347a0[_0x24ad('0x36')]);_0x231d91[_0x24ad('0x39')]=_['intersection'](_0x1347a0[_0x24ad('0x35')],qs[_0x24ad('0x3b')](_0x16fdac['query']['fields']));_0x231d91[_0x24ad('0x39')]=_0x231d91[_0x24ad('0x39')]['length']?_0x231d91[_0x24ad('0x39')]:_0x1347a0[_0x24ad('0x35')];if(_0x16fdac[_0x24ad('0x36')][_0x24ad('0x43')]){_0x231d91[_0x24ad('0x47')]=[{'all':!![]}];}_0x231d91=_[_0x24ad('0x41')]({},_0x231d91,_0x16fdac[_0x24ad('0x48')]);return db[_0x24ad('0x30')][_0x24ad('0x49')](_0x231d91)[_0x24ad('0x27')](handleEntityNotFound(_0x4c1ba6,null))[_0x24ad('0x27')](respondWithResult(_0x4c1ba6,null))[_0x24ad('0x45')](handleError(_0x4c1ba6,null));};exports[_0x24ad('0x4a')]=function(_0x1b2002,_0x492cc8){return db[_0x24ad('0x30')][_0x24ad('0x4a')](_0x1b2002[_0x24ad('0x4b')],{})['then'](function(_0x35ed2e){var _0x7c14ba=_0x1b2002[_0x24ad('0x4c')]['get']({'plain':!![]});if(!_0x7c14ba)throw new Error(_0x24ad('0x4d'));if(_0x7c14ba[_0x24ad('0x4e')]===_0x24ad('0x4c')){var _0x558c9e=_0x35ed2e['get']({'plain':!![]});var _0x4622c4=_0x24ad('0x29');return db[_0x24ad('0x4f')][_0x24ad('0x49')]({'where':{'name':_0x4622c4,'userProfileId':_0x7c14ba['userProfileId']},'raw':!![]})[_0x24ad('0x27')](function(_0x4e5c2c){if(_0x4e5c2c&&_0x4e5c2c['autoAssociation']===0x0){return db[_0x24ad('0x50')][_0x24ad('0x4a')]({'name':_0x558c9e[_0x24ad('0x2c')],'resourceId':_0x558c9e['id'],'type':_0x4e5c2c[_0x24ad('0x2c')],'sectionId':_0x4e5c2c['id']},{})['then'](function(){return _0x35ed2e;});}else{return _0x35ed2e;}})[_0x24ad('0x45')](function(_0x614bcd){logger[_0x24ad('0x2a')](_0x24ad('0x51'),_0x614bcd);throw _0x614bcd;});}return _0x35ed2e;})[_0x24ad('0x27')](respondWithResult(_0x492cc8,0xc9))[_0x24ad('0x45')](handleError(_0x492cc8,null));};exports['update']=function(_0x2989b0,_0x5dc8b0){if(_0x2989b0[_0x24ad('0x4b')]['id']){delete _0x2989b0[_0x24ad('0x4b')]['id'];}return db[_0x24ad('0x30')]['find']({'where':{'id':_0x2989b0[_0x24ad('0x46')]['id']}})[_0x24ad('0x27')](handleEntityNotFound(_0x5dc8b0,null))['then'](saveUpdates(_0x2989b0[_0x24ad('0x4b')],null))[_0x24ad('0x27')](respondWithResult(_0x5dc8b0,null))['catch'](handleError(_0x5dc8b0,null));};exports[_0x24ad('0x26')]=function(_0x48374d,_0x261efb){return db[_0x24ad('0x30')][_0x24ad('0x49')]({'where':{'id':_0x48374d['params']['id']}})[_0x24ad('0x27')](handleEntityNotFound(_0x261efb,null))[_0x24ad('0x27')](removeEntity(_0x261efb,null))[_0x24ad('0x45')](handleError(_0x261efb,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index df4f7f0..b1508e7 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 _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x3daec9,_0x4a911d){var _0x20b57b=function(_0x500b6a){while(--_0x500b6a){_0x3daec9['push'](_0x3daec9['shift']());}};_0x20b57b(++_0x4a911d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5333bb,_0x47a0cd){_0x5333bb=_0x5333bb-0x0;var _0x4e8910=_0x8ef6[_0x5333bb];return _0x4e8910;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'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 72fcd3c..2c6a725 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x3cfc26,_0x3d31b8){var _0x15f733=function(_0x43c6db){while(--_0x43c6db){_0x3cfc26['push'](_0x3cfc26['shift']());}};_0x15f733(++_0x3d31b8);}(_0xb10b,0x12a));var _0xbb10=function(_0xd948e7,_0x2f9dd1){_0xd948e7=_0xd948e7-0x0;var _0x323d00=_0xb10b[_0xd948e7];return _0x323d00;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x3a80be,_0x1cacd2){var _0x9620df=function(_0x3bec16){while(--_0x3bec16){_0x3a80be['push'](_0x3a80be['shift']());}};_0x9620df(++_0x1cacd2);}(_0x7a54,0x106));var _0x47a5=function(_0x31e3c6,_0x287245){_0x31e3c6=_0x31e3c6-0x0;var _0x10f088=_0x7a54[_0x31e3c6];return _0x10f088;};'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 6af45d0..7a45640 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 _0xedd9=['/webhook','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','single','file','upload','webhookPost','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index'];(function(_0x44210b,_0x52524e){var _0x8b1fca=function(_0x54a7e4){while(--_0x54a7e4){_0x44210b['push'](_0x44210b['shift']());}};_0x8b1fca(++_0x52524e);}(_0xedd9,0xfc));var _0x9edd=function(_0x3915d9,_0x307b68){_0x3915d9=_0x3915d9-0x0;var _0x1f35d4=_0xedd9[_0x3915d9];return _0x1f35d4;};'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'),controller['webhookGet']);router[_0x9edd('0x9')](_0x9edd('0xd'),auth[_0x9edd('0xa')](),controller[_0x9edd('0xe')]);router['get'](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);var upload=multer({'storage':multer[_0x9edd('0x11')]({'destination':function(_0x523026,_0xbf9da6,_0x13dc4f){_0x13dc4f(null,path['join'](config[_0x9edd('0x12')],_0x9edd('0x13')));},'filename':function(_0x25e64c,_0xfd544a,_0x287ddd){_0xfd544a[_0x9edd('0x14')]=_0xfd544a[_0x9edd('0x14')][_0x9edd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x287ddd(null,util['format'](_0x9edd('0x16'),path[_0x9edd('0x17')](_0xfd544a[_0x9edd('0x14')],path[_0x9edd('0x18')](_0xfd544a[_0x9edd('0x14')])),Date[_0x9edd('0x19')](),path[_0x9edd('0x18')](_0xfd544a[_0x9edd('0x14')])));}})});router['post']('/',upload[_0x9edd('0x1a')](_0x9edd('0x1b')),controller[_0x9edd('0x1c')]);router['post'](_0x9edd('0xc'),controller[_0x9edd('0x1d')]);router[_0x9edd('0x1e')]('/:id',auth[_0x9edd('0xa')](),controller['update']);router[_0x9edd('0x1f')](_0x9edd('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0x9edd('0x20')]=router; \ No newline at end of file +var _0xedd9=['/webhook','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','single','file','upload','webhookPost','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index'];(function(_0x12729a,_0x2d188a){var _0x32e770=function(_0x2e7c2f){while(--_0x2e7c2f){_0x12729a['push'](_0x12729a['shift']());}};_0x32e770(++_0x2d188a);}(_0xedd9,0xfc));var _0x9edd=function(_0x256d12,_0x3f5735){_0x256d12=_0x256d12-0x0;var _0xc4ec66=_0xedd9[_0x256d12];return _0xc4ec66;};'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'),controller['webhookGet']);router[_0x9edd('0x9')](_0x9edd('0xd'),auth[_0x9edd('0xa')](),controller[_0x9edd('0xe')]);router['get'](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);var upload=multer({'storage':multer[_0x9edd('0x11')]({'destination':function(_0x523026,_0xbf9da6,_0x13dc4f){_0x13dc4f(null,path['join'](config[_0x9edd('0x12')],_0x9edd('0x13')));},'filename':function(_0x25e64c,_0xfd544a,_0x287ddd){_0xfd544a[_0x9edd('0x14')]=_0xfd544a[_0x9edd('0x14')][_0x9edd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x287ddd(null,util['format'](_0x9edd('0x16'),path[_0x9edd('0x17')](_0xfd544a[_0x9edd('0x14')],path[_0x9edd('0x18')](_0xfd544a[_0x9edd('0x14')])),Date[_0x9edd('0x19')](),path[_0x9edd('0x18')](_0xfd544a[_0x9edd('0x14')])));}})});router['post']('/',upload[_0x9edd('0x1a')](_0x9edd('0x1b')),controller[_0x9edd('0x1c')]);router['post'](_0x9edd('0xc'),controller[_0x9edd('0x1d')]);router[_0x9edd('0x1e')]('/:id',auth[_0x9edd('0xa')](),controller['update']);router[_0x9edd('0x1f')](_0x9edd('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0x9edd('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index fbd6b1a..229cc82 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 _0xc57b=['agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','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'];(function(_0x3da3c4,_0x2b874d){var _0x36a3af=function(_0x6d3f2d){while(--_0x6d3f2d){_0x3da3c4['push'](_0x3da3c4['shift']());}};_0x36a3af(++_0x2b874d);}(_0xc57b,0x90));var _0xbc57=function(_0x126b67,_0x331b2e){_0x126b67=_0x126b67-0x0;var _0x351931=_0xc57b[_0x126b67];return _0x351931;};'use strict';var Sequelize=require('sequelize');module[_0xbc57('0x0')]={'name':{'type':Sequelize[_0xbc57('0x1')]},'type':{'type':Sequelize[_0xbc57('0x2')](_0xbc57('0x3'),_0xbc57('0x4'))},'description':{'type':Sequelize[_0xbc57('0x5')]},'version':{'type':Sequelize[_0xbc57('0x5')]},'path':{'type':Sequelize[_0xbc57('0x1')],'comment':_0xbc57('0x6')},'active':{'type':Sequelize[_0xbc57('0x7')],'defaultValue':0x0,'comment':_0xbc57('0x8')},'sidebar':{'type':Sequelize[_0xbc57('0x2')](_0xbc57('0x9'),_0xbc57('0xa'),'always',_0xbc57('0xb')),'defaultValue':_0xbc57('0xc'),'comment':_0xbc57('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xbc57('0x1')]},'agentUrl':{'type':Sequelize[_0xbc57('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xbc57('0x1')]}}; \ No newline at end of file +var _0x3038=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0xd8d9cd,_0x29007c){var _0x37fa89=function(_0x125104){while(--_0x125104){_0xd8d9cd['push'](_0xd8d9cd['shift']());}};_0x37fa89(++_0x29007c);}(_0x3038,0xe6));var _0x8303=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0x3038[_0x3186aa];return _0x2d8c36;};'use strict';var Sequelize=require('sequelize');module[_0x8303('0x0')]={'name':{'type':Sequelize[_0x8303('0x1')]},'type':{'type':Sequelize[_0x8303('0x2')](_0x8303('0x3'),_0x8303('0x4'))},'description':{'type':Sequelize[_0x8303('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x8303('0x6')},'active':{'type':Sequelize[_0x8303('0x7')],'defaultValue':0x0,'comment':_0x8303('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x8303('0x9'),_0x8303('0xa'),_0x8303('0xb'),_0x8303('0xc')),'defaultValue':'always','comment':_0x8303('0xd')},'icon':{'type':Sequelize[_0x8303('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x8303('0x1')]},'scriptName':{'type':Sequelize[_0x8303('0x1')]},'scriptPath':{'type':Sequelize[_0x8303('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 34edaba..e60cb26 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 _0xee18=['Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','version','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','content-type','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','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','offset','count','limit','set','reject','save','update','then','destroy','get','end','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','params','include','find','download','join','root','format','%s.zip','basename','path','createWriteStream','zip','warning','code','ENOENT','Sequelize'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xee18,0xfb));var _0x8ee1=function(_0x5c0232,_0x1c449f){_0x5c0232=_0x5c0232-0x0;var _0x589366=_0xee18[_0x5c0232];return _0x589366;};'use strict';var emlformat=require(_0x8ee1('0x0'));var rimraf=require(_0x8ee1('0x1'));var zipdir=require(_0x8ee1('0x2'));var jsonpatch=require(_0x8ee1('0x3'));var rp=require(_0x8ee1('0x4'));var moment=require(_0x8ee1('0x5'));var BPromise=require(_0x8ee1('0x6'));var Mustache=require(_0x8ee1('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8ee1('0x8'));var csv=require(_0x8ee1('0x9'));var ejs=require(_0x8ee1('0xa'));var fs=require('fs');var fs_extra=require(_0x8ee1('0xb'));var _=require(_0x8ee1('0xc'));var squel=require(_0x8ee1('0xd'));var crypto=require(_0x8ee1('0xe'));var jsforce=require(_0x8ee1('0xf'));var deskjs=require(_0x8ee1('0x10'));var toCsv=require(_0x8ee1('0x9'));var querystring=require('querystring');var Papa=require(_0x8ee1('0x11'));var extract=require(_0x8ee1('0x12'));var rimraf=require('rimraf');var archiver=require(_0x8ee1('0x13'));var Redis=require(_0x8ee1('0x14'));var authService=require(_0x8ee1('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x8ee1('0x16'));var hardwareService=require(_0x8ee1('0x17'));var logger=require(_0x8ee1('0x18'))(_0x8ee1('0x19'));var utils=require(_0x8ee1('0x1a'));var config=require(_0x8ee1('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ee1('0x1c'))['db'];config['redis']=_[_0x8ee1('0x1d')](config[_0x8ee1('0x1e')],{'host':_0x8ee1('0x1f'),'port':0x18eb});var socket=require(_0x8ee1('0x20'))(new Redis(config['redis']));require('./plugin.socket')[_0x8ee1('0x21')](socket);function respondWithStatusCode(_0x2319dd,_0x1f7658){_0x1f7658=_0x1f7658||0xcc;return function(_0x331c05){if(_0x331c05){return _0x2319dd[_0x8ee1('0x22')](_0x1f7658);}return _0x2319dd[_0x8ee1('0x23')](_0x1f7658)['end']();};}function respondWithResult(_0xc74a4b,_0xb88993){_0xb88993=_0xb88993||0xc8;return function(_0x381f99){if(_0x381f99){return _0xc74a4b['status'](_0xb88993)[_0x8ee1('0x24')](_0x381f99);}};}function respondWithFilteredResult(_0x11b6ec,_0x28ff6f){return function(_0x2766aa){if(_0x2766aa){var _0x248f68=typeof _0x28ff6f['offset']===_0x8ee1('0x25')&&typeof _0x28ff6f['limit']===_0x8ee1('0x25');var _0x204c26=_0x2766aa['count'];var _0x3a5570=_0x248f68?0x0:_0x28ff6f[_0x8ee1('0x26')];var _0x5c3545=_0x248f68?_0x2766aa[_0x8ee1('0x27')]:_0x28ff6f[_0x8ee1('0x26')]+_0x28ff6f[_0x8ee1('0x28')];var _0xeb0b02;if(_0x5c3545>=_0x204c26){_0x5c3545=_0x204c26;_0xeb0b02=0xc8;}else{_0xeb0b02=0xce;}_0x11b6ec[_0x8ee1('0x23')](_0xeb0b02);return _0x11b6ec[_0x8ee1('0x29')]('Content-Range',_0x3a5570+'-'+_0x5c3545+'/'+_0x204c26)[_0x8ee1('0x24')](_0x2766aa);}return null;};}function patchUpdates(_0x39ff44){return function(_0x22d19b){try{jsonpatch['apply'](_0x22d19b,_0x39ff44,!![]);}catch(_0x36cb6a){return BPromise[_0x8ee1('0x2a')](_0x36cb6a);}return _0x22d19b[_0x8ee1('0x2b')]();};}function saveUpdates(_0x2a7efa,_0x1c083e){return function(_0x18fc65){if(_0x18fc65){return _0x18fc65[_0x8ee1('0x2c')](_0x2a7efa)[_0x8ee1('0x2d')](function(_0x2a2886){return _0x2a2886;});}return null;};}function removeEntity(_0x3771a7,_0x3979c7){return function(_0x55b4e9){if(_0x55b4e9){return _0x55b4e9[_0x8ee1('0x2e')]()['then'](function(){var _0x2af452=_0x55b4e9[_0x8ee1('0x2f')]({'plain':!![]});var _0xc093b1='Plugins';return db['UserProfileResource'][_0x8ee1('0x2e')]({'where':{'type':_0xc093b1,'resourceId':_0x2af452['id']}})[_0x8ee1('0x2d')](function(){return _0x55b4e9;});})[_0x8ee1('0x2d')](function(){_0x3771a7[_0x8ee1('0x23')](0xcc)[_0x8ee1('0x30')]();});}};}function handleEntityNotFound(_0x8bc065,_0x5575ec){return function(_0x10b7c1){if(!_0x10b7c1){_0x8bc065['sendStatus'](0x194);}return _0x10b7c1;};}function handleError(_0x23b38d,_0x18eec7){_0x18eec7=_0x18eec7||0x1f4;return function(_0x3266b8){logger[_0x8ee1('0x31')](_0x3266b8[_0x8ee1('0x32')]);if(_0x3266b8['name']){delete _0x3266b8[_0x8ee1('0x33')];}_0x23b38d[_0x8ee1('0x23')](_0x18eec7)['send'](_0x3266b8);};}exports[_0x8ee1('0x34')]=function(_0xac5f38,_0x433ea1){var _0x5ae5ea={},_0x169472={},_0x49bc80={'count':0x0,'rows':[]};var _0x452f4b=_[_0x8ee1('0x35')](db[_0x8ee1('0x36')][_0x8ee1('0x37')],function(_0x10bbd8){return{'name':_0x10bbd8[_0x8ee1('0x38')],'type':_0x10bbd8[_0x8ee1('0x39')]['key']};});_0x169472[_0x8ee1('0x3a')]=_[_0x8ee1('0x35')](_0x452f4b,'name');_0x169472[_0x8ee1('0x3b')]=_[_0x8ee1('0x3c')](_0xac5f38[_0x8ee1('0x3b')]);_0x169472[_0x8ee1('0x3d')]=_['intersection'](_0x169472['model'],_0x169472[_0x8ee1('0x3b')]);_0x5ae5ea[_0x8ee1('0x3e')]=_[_0x8ee1('0x3f')](_0x169472[_0x8ee1('0x3a')],qs[_0x8ee1('0x40')](_0xac5f38[_0x8ee1('0x3b')][_0x8ee1('0x40')]));_0x5ae5ea[_0x8ee1('0x3e')]=_0x5ae5ea[_0x8ee1('0x3e')][_0x8ee1('0x41')]?_0x5ae5ea[_0x8ee1('0x3e')]:_0x169472[_0x8ee1('0x3a')];if(!_0xac5f38['query'][_0x8ee1('0x42')](_0x8ee1('0x43'))){_0x5ae5ea[_0x8ee1('0x28')]=qs[_0x8ee1('0x28')](_0xac5f38[_0x8ee1('0x3b')]['limit']);_0x5ae5ea[_0x8ee1('0x26')]=qs['offset'](_0xac5f38[_0x8ee1('0x3b')][_0x8ee1('0x26')]);}_0x5ae5ea['order']=qs[_0x8ee1('0x44')](_0xac5f38[_0x8ee1('0x3b')][_0x8ee1('0x44')]);_0x5ae5ea[_0x8ee1('0x45')]=qs['filters'](_[_0x8ee1('0x46')](_0xac5f38['query'],_0x169472['filters']),_0x452f4b);if(_0xac5f38[_0x8ee1('0x3b')][_0x8ee1('0x47')]){_0x5ae5ea[_0x8ee1('0x45')]=_['merge'](_0x5ae5ea[_0x8ee1('0x45')],{'$or':_[_0x8ee1('0x35')](_0x452f4b,function(_0x280837){if(_0x280837[_0x8ee1('0x39')]!==_0x8ee1('0x48')){var _0x81ead1={};_0x81ead1[_0x280837[_0x8ee1('0x33')]]={'$like':'%'+_0xac5f38[_0x8ee1('0x3b')][_0x8ee1('0x47')]+'%'};return _0x81ead1;}})});}_0x5ae5ea=_[_0x8ee1('0x49')]({},_0x5ae5ea,_0xac5f38[_0x8ee1('0x4a')]);var _0x148183={'where':_0x5ae5ea['where']};return db[_0x8ee1('0x36')][_0x8ee1('0x27')](_0x148183)[_0x8ee1('0x2d')](function(_0x3b632b){_0x49bc80[_0x8ee1('0x27')]=_0x3b632b;if(_0xac5f38[_0x8ee1('0x3b')][_0x8ee1('0x4b')]){_0x5ae5ea['include']=[{'all':!![]}];}return db[_0x8ee1('0x36')]['findAll'](_0x5ae5ea);})['then'](function(_0x139d69){_0x49bc80['rows']=_0x139d69;return _0x49bc80;})[_0x8ee1('0x2d')](respondWithFilteredResult(_0x433ea1,_0x5ae5ea))[_0x8ee1('0x4c')](handleError(_0x433ea1,null));};exports['show']=function(_0x25e118,_0x13e0e6){var _0x1bffab={'raw':!![],'where':{'id':_0x25e118[_0x8ee1('0x4d')]['id']}},_0xf1676c={};_0xf1676c[_0x8ee1('0x3a')]=_[_0x8ee1('0x3c')](db['Plugin'][_0x8ee1('0x37')]);_0xf1676c[_0x8ee1('0x3b')]=_[_0x8ee1('0x3c')](_0x25e118[_0x8ee1('0x3b')]);_0xf1676c[_0x8ee1('0x3d')]=_['intersection'](_0xf1676c[_0x8ee1('0x3a')],_0xf1676c[_0x8ee1('0x3b')]);_0x1bffab[_0x8ee1('0x3e')]=_[_0x8ee1('0x3f')](_0xf1676c[_0x8ee1('0x3a')],qs[_0x8ee1('0x40')](_0x25e118['query'][_0x8ee1('0x40')]));_0x1bffab[_0x8ee1('0x3e')]=_0x1bffab[_0x8ee1('0x3e')][_0x8ee1('0x41')]?_0x1bffab[_0x8ee1('0x3e')]:_0xf1676c[_0x8ee1('0x3a')];if(_0x25e118['query'][_0x8ee1('0x4b')]){_0x1bffab[_0x8ee1('0x4e')]=[{'all':!![]}];}_0x1bffab=_[_0x8ee1('0x49')]({},_0x1bffab,_0x25e118[_0x8ee1('0x4a')]);return db[_0x8ee1('0x36')][_0x8ee1('0x4f')](_0x1bffab)[_0x8ee1('0x2d')](handleEntityNotFound(_0x13e0e6,null))[_0x8ee1('0x2d')](respondWithResult(_0x13e0e6,null))[_0x8ee1('0x4c')](handleError(_0x13e0e6,null));};exports[_0x8ee1('0x50')]=function(_0x5553a4,_0x23fe8d,_0x5be3c0){return db[_0x8ee1('0x36')][_0x8ee1('0x4f')]({'where':{'id':_0x5553a4[_0x8ee1('0x4d')]['id']},'attributes':['name','path'],'raw':!![]})[_0x8ee1('0x2d')](handleEntityNotFound(_0x23fe8d,null))['then'](function(_0x271035){if(_0x271035){var _0x1ff73a=path[_0x8ee1('0x51')](config[_0x8ee1('0x52')],'server/files/plugins',util[_0x8ee1('0x53')](_0x8ee1('0x54'),path[_0x8ee1('0x55')](_0x271035[_0x8ee1('0x56')])));var _0x462f0c=fs[_0x8ee1('0x57')](_0x1ff73a);var _0x2215bb=archiver(_0x8ee1('0x58'),{'zlib':{'level':0x9}});_0x2215bb['on'](_0x8ee1('0x59'),function(_0x4a61df){if(_0x4a61df[_0x8ee1('0x5a')]===_0x8ee1('0x5b')){logger[_0x8ee1('0x31')](_0x4a61df);}else{throw new db[(_0x8ee1('0x5c'))][(_0x8ee1('0x5d'))](_0x8ee1('0x5e'));}});_0x2215bb['on'](_0x8ee1('0x31'),function(_0x31c3e4){throw new db[(_0x8ee1('0x5c'))][(_0x8ee1('0x5d'))](_0x8ee1('0x5e'));});_0x2215bb[_0x8ee1('0x5f')](_0x462f0c);_0x2215bb[_0x8ee1('0x60')]('**/*',{'cwd':path['join'](config[_0x8ee1('0x52')],_0x8ee1('0x61'),path[_0x8ee1('0x62')](_0x271035['path'])),'ignore':[path[_0x8ee1('0x51')](path[_0x8ee1('0x55')](_0x271035[_0x8ee1('0x56')]),_0x8ee1('0x63')),path['join'](path[_0x8ee1('0x55')](_0x271035[_0x8ee1('0x56')]),_0x8ee1('0x64'))],'nodir':!![]})['finalize']();_0x462f0c['on'](_0x8ee1('0x65'),function(){if(!fs[_0x8ee1('0x66')](_0x1ff73a)){throw new db[(_0x8ee1('0x5c'))][(_0x8ee1('0x5d'))](_0x8ee1('0x67'));}return _0x23fe8d[_0x8ee1('0x50')](_0x1ff73a,util[_0x8ee1('0x53')](_0x8ee1('0x54'),path[_0x8ee1('0x55')](_0x271035[_0x8ee1('0x56')])),function(_0x2a9606){if(_0x2a9606){throw new db[(_0x8ee1('0x5c'))][(_0x8ee1('0x5d'))](_0x8ee1('0x68'));}fs[_0x8ee1('0x69')](_0x1ff73a);logger['info'](_0x8ee1('0x6a'));logger[_0x8ee1('0x6b')](_0x8ee1('0x6c'));});});}return null;})[_0x8ee1('0x4c')](handleError(_0x23fe8d,null));};exports[_0x8ee1('0x6d')]=function(_0xf3e2cc,_0x561d4c,_0x562738){var _0x1e0d75=path[_0x8ee1('0x55')](_0xf3e2cc['file'][_0x8ee1('0x6e')],path[_0x8ee1('0x6f')](_0xf3e2cc[_0x8ee1('0x70')]['filename']));var _0x30643c=path[_0x8ee1('0x51')](config[_0x8ee1('0x52')],_0x8ee1('0x61'),_0xf3e2cc[_0x8ee1('0x70')]['filename']);var _0x1afaf3=path['join'](config[_0x8ee1('0x52')],_0x8ee1('0x61'),_0x1e0d75);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x30643c);logger[_0x8ee1('0x6b')](_0x8ee1('0x71'),_0x1afaf3);try{fs[_0x8ee1('0x72')](_0x30643c,parseInt('0777',0x8));extract(_0x30643c,{'dir':_0x1afaf3},function(_0x6bf7e6){if(_0x6bf7e6){logger['error'](_0x6bf7e6);handleError(_0x6bf7e6,!![]);};var _0x2fc682=fs[_0x8ee1('0x73')](_0x1afaf3);if(_0x2fc682['length']>0x1){removeReferences(_0x30643c,_0x1afaf3);logger[_0x8ee1('0x31')](_0x8ee1('0x74'));return _0x562738(new Error('Invalid\x20plugin\x20structure'));}var _0x182d5c=fs['lstatSync'](path[_0x8ee1('0x51')](_0x1afaf3,_0x2fc682[0x0]));if(_0x182d5c[_0x8ee1('0x75')]()){removeReferences(_0x30643c,_0x1afaf3);logger['error'](_0x8ee1('0x74'));return _0x562738(new Error(_0x8ee1('0x74')));}if(_0x182d5c[_0x8ee1('0x76')]()){var _0xfe809=fs[_0x8ee1('0x73')](path['join'](_0x1afaf3,_0x2fc682[0x0]));if(_0xfe809[_0x8ee1('0x41')]===0x0){removeReferences(_0x30643c,_0x1afaf3);logger[_0x8ee1('0x31')](_0x8ee1('0x74'));return _0x562738(new Error(_0x8ee1('0x74')));}var _0x48b0d7=_0xfe809[_0x8ee1('0x77')](function(_0x22b3aa){return _0x22b3aa===_0x8ee1('0x78');});if(!_0x48b0d7){return _0x562738(new Error(_0x8ee1('0x79')));}var _0xdf8777=fs['readFileSync'](path['join'](_0x1afaf3,_0x2fc682[0x0],'manifest.json'));var _0x3939d7=JSON['parse'](_0xdf8777);if(_0x8ee1('0x25')==typeof _0x3939d7[_0x8ee1('0x33')]){return _0x562738(new Error(_0x8ee1('0x7a')));}if(_0x8ee1('0x25')==typeof _0x3939d7[_0x8ee1('0x39')]){return _0x562738(new Error(_0x8ee1('0x7b')));}if(_0x8ee1('0x25')==typeof _0x3939d7['version']){return _0x562738(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x8ee1('0x25')==typeof _0x3939d7[_0x8ee1('0x7c')]){return _0x562738(new Error(_0x8ee1('0x7d')));}if(_0x3939d7[_0x8ee1('0x39')]===_0x8ee1('0x7e')){if(_0x8ee1('0x25')==typeof _0x3939d7['parameters'][_0x8ee1('0x7f')]){return _0x562738(new Error(_0x8ee1('0x80')));}if(_0x8ee1('0x25')==typeof _0x3939d7[_0x8ee1('0x7c')]['views']['admin']&&'undefined'==typeof _0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x7f')][_0x8ee1('0x81')]){return _0x562738(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3939d7[_0x8ee1('0x39')]===_0x8ee1('0x82')){if(_0x8ee1('0x25')==typeof _0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x83')]){return _0x562738(new Error(_0x8ee1('0x84')));}if('undefined'==typeof _0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x85')]){return _0x562738(new Error(_0x8ee1('0x86')));}}else{return _0x562738(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x58a3a2=_0x3939d7[_0x8ee1('0x33')];var _0x4a5542=_0x3939d7['description'];var _0x2576f8=_0x3939d7['type'];var _0x11266b=_0x3939d7[_0x8ee1('0x87')]?_0x3939d7['sidebar']:_0x8ee1('0x88');var _0x5c28b6=_0x3939d7[_0x8ee1('0x89')]?_0x3939d7['icon']:'icon-apps';var _0x5c6c82='';var _0x480bc4='';var _0x4ee0b2='';var _0x2a5a18='';var _0x1151a0=_0x3939d7[_0x8ee1('0x8a')];if(_0x2576f8==='html'){if('undefined'!=typeof _0x3939d7[_0x8ee1('0x7c')]['views'][_0x8ee1('0x8b')]){var _0x14b89a=_0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x14b89a)){_0x5c6c82=path[_0x8ee1('0x51')](_0x8ee1('0x8c'),_0x1e0d75,_0x2fc682[0x0],_0x14b89a);}else{_0x5c6c82=_0x14b89a;}}else{logger[_0x8ee1('0x6b')](_0x8ee1('0x8d'));}if(_0x8ee1('0x25')!=typeof _0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x7f')]['agent']){var _0x4b76f8=_0x3939d7['parameters']['views'][_0x8ee1('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4b76f8)){_0x480bc4=path[_0x8ee1('0x51')](_0x8ee1('0x8c'),_0x1e0d75,_0x2fc682[0x0],_0x4b76f8);}else{_0x480bc4=_0x4b76f8;}}else{logger[_0x8ee1('0x6b')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2576f8===_0x8ee1('0x82')){_0x4ee0b2=_0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x83')];_0x2a5a18=_0x3939d7[_0x8ee1('0x7c')]['scriptPath'];if('undefined'!=typeof _0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x7f')]){if(_0x8ee1('0x25')!=typeof _0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x7f')][_0x8ee1('0x8b')]){var _0x14b89a=_0x3939d7['parameters'][_0x8ee1('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x8ee1('0x8e')](_0x14b89a)){_0x5c6c82=path[_0x8ee1('0x51')](_0x8ee1('0x8c'),_0x1e0d75,_0x2fc682[0x0],_0x14b89a);}else{_0x5c6c82=_0x14b89a;}}if('undefined'!=typeof _0x3939d7[_0x8ee1('0x7c')][_0x8ee1('0x7f')][_0x8ee1('0x81')]){var _0x4b76f8=_0x3939d7[_0x8ee1('0x7c')]['views'][_0x8ee1('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x8ee1('0x8e')](_0x4b76f8)){_0x480bc4=path[_0x8ee1('0x51')]('plugins',_0x1e0d75,_0x2fc682[0x0],_0x4b76f8);}else{_0x480bc4=_0x4b76f8;}}}}var _0x414846={'name':_0x58a3a2,'description':_0x4a5542,'path':path[_0x8ee1('0x51')](_0x1e0d75,_0x2fc682[0x0]),'type':_0x2576f8,'sidebar':_0x11266b,'icon':_0x5c28b6,'adminUrl':_0x5c6c82,'agentUrl':_0x480bc4,'scriptName':_0x4ee0b2,'scriptPath':_0x2a5a18,'version':_0x1151a0};removeReferences(_0x30643c,null);return db['Plugin'][_0x8ee1('0x8f')](_0x414846)[_0x8ee1('0x2d')](function(_0x3247a2){var _0x1aad1d={'role':_0xf3e2cc[_0x8ee1('0x90')][_0x8ee1('0x91')],'userProfileId':_0xf3e2cc[_0x8ee1('0x90')][_0x8ee1('0x92')]};if(!_0x1aad1d)throw new Error(_0x8ee1('0x93'));if(_0x1aad1d[_0x8ee1('0x91')]===_0x8ee1('0x94')){var _0x4b058a=_0x3247a2[_0x8ee1('0x2f')]({'plain':!![]});return db[_0x8ee1('0x95')]['find']({'where':{'name':_0x8ee1('0x96'),'userProfileId':_0x1aad1d[_0x8ee1('0x92')]},'raw':!![]})[_0x8ee1('0x2d')](function(_0x45cdc2){if(_0x45cdc2&&_0x45cdc2[_0x8ee1('0x97')]===0x0){return db[_0x8ee1('0x98')][_0x8ee1('0x8f')]({'name':_0x4b058a[_0x8ee1('0x33')],'resourceId':_0x4b058a['id'],'type':_0x45cdc2[_0x8ee1('0x33')],'sectionId':_0x45cdc2['id']},{})[_0x8ee1('0x2d')](function(){return _0x3247a2;});}else{return _0x3247a2;}})[_0x8ee1('0x4c')](function(_0x878db0){logger[_0x8ee1('0x31')](_0x8ee1('0x99'),_0x878db0);throw _0x878db0;});}return _0x3247a2;})['then'](respondWithResult(_0x561d4c,null))[_0x8ee1('0x4c')](handleError(_0x561d4c,null));}});}catch(_0x2df77d){_0x561d4c[_0x8ee1('0x23')](0x1f4)[_0x8ee1('0x9a')](_0x2df77d);}};function removeReferences(_0x6cd03b,_0x2ad9c2){try{if(_0x6cd03b){fs['unlinkSync'](_0x6cd03b);logger[_0x8ee1('0x6b')](_0x8ee1('0x9b'));}if(_0x2ad9c2){rimraf(_0x2ad9c2,function(){});logger[_0x8ee1('0x6b')]('Extracted\x20folder\x20removed');}}catch(_0x3f120d){logger[_0x8ee1('0x31')](_0x3f120d);}}exports[_0x8ee1('0x2c')]=function(_0x2f87c5,_0x1b0f14,_0xae9c2f){return db[_0x8ee1('0x36')]['find']({'where':{'id':_0x2f87c5[_0x8ee1('0x4d')]['id']}})[_0x8ee1('0x2d')](handleEntityNotFound(_0x1b0f14,null))[_0x8ee1('0x2d')](saveUpdates(_0x2f87c5[_0x8ee1('0x90')],null))[_0x8ee1('0x2d')](respondWithResult(_0x1b0f14,null))[_0x8ee1('0x4c')](handleError(_0x1b0f14,null));};exports['delete']=function(_0x13c045,_0x5e38ee,_0x5193c5){return db['Plugin'][_0x8ee1('0x4f')]({'where':{'id':_0x13c045['params']['id']}})[_0x8ee1('0x2d')](function(_0x231eb3){if(_0x231eb3){return _0x231eb3[_0x8ee1('0x2e')]();}})[_0x8ee1('0x2d')](function(_0x1ece80){rimraf(path[_0x8ee1('0x51')](config[_0x8ee1('0x52')],_0x8ee1('0x61'),path[_0x8ee1('0x62')](_0x1ece80[_0x8ee1('0x56')])),function(){});return _0x1ece80;})[_0x8ee1('0x2d')](handleEntityNotFound(_0x5e38ee,null))[_0x8ee1('0x2d')](respondWithStatusCode(_0x5e38ee,null))[_0x8ee1('0x4c')](handleError(_0x5e38ee,null));};exports[_0x8ee1('0x9c')]=function(_0x583358,_0x463f67,_0x5423b1){return BPromise['resolve']()[_0x8ee1('0x2d')](function(){if(!_0x583358['query'][_0x8ee1('0x56')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x583358[_0x8ee1('0x3b')][_0x8ee1('0x9d')]){throw new Error(_0x8ee1('0x9e'));}var _0x4273c6=_0x583358['query'][_0x8ee1('0x9f')]?_0x583358[_0x8ee1('0x3b')]['hostname']+':'+_0x583358[_0x8ee1('0x3b')][_0x8ee1('0x9d')]:_0x8ee1('0xa0')+_0x583358[_0x8ee1('0x3b')][_0x8ee1('0x9d')];var _0x192690=_0x583358[_0x8ee1('0x3b')][_0x8ee1('0x24')]?_0x583358[_0x8ee1('0x3b')]['json']:!![];var _0x3bc8d0=_0x583358[_0x8ee1('0x3b')][_0x8ee1('0xa1')]?_0x583358[_0x8ee1('0x3b')]['encoding']:null;var _0x2adedf={'method':_0x583358[_0x8ee1('0xa2')],'uri':util[_0x8ee1('0x53')]('%s%s',_0x4273c6,_0x583358[_0x8ee1('0x3b')]['path']),'json':_0x192690,'resolveWithFullResponse':!![],'encoding':_0x3bc8d0,'qs':_0x583358[_0x8ee1('0x3b')]};if(_0x583358[_0x8ee1('0xa3')]){_0x2adedf['headers']=_0x583358['headers'];if(_0x2adedf['headers']['content-length']){delete _0x2adedf[_0x8ee1('0xa3')][_0x8ee1('0xa4')];}}if(_0x2adedf[_0x8ee1('0xa3')]['content-type']){delete _0x2adedf[_0x8ee1('0xa3')]['content-type'];}return rp(_0x2adedf);})[_0x8ee1('0x2d')](function(_0x1cc1ee){if(_0x1cc1ee){_0x463f67['set'](_0x1cc1ee[_0x8ee1('0xa3')]);logger[_0x8ee1('0x6b')](_0x1cc1ee[_0x8ee1('0x90')]);if(_[_0x8ee1('0xa5')](_0x583358[_0x8ee1('0x3b')][_0x8ee1('0x56')],_0x8ee1('0x50'))&&_0x1cc1ee[_0x8ee1('0xa6')]==0x1f4){return _0x463f67['sendStatus'](_0x1cc1ee[_0x8ee1('0xa6')]);}else{return _0x463f67[_0x8ee1('0x23')](_0x1cc1ee[_0x8ee1('0xa6')])[_0x8ee1('0x9a')](_0x1cc1ee[_0x8ee1('0x90')]);}}else{return _0x463f67[_0x8ee1('0x22')](0xc8);}})[_0x8ee1('0x4c')](handleError(_0x463f67,null));};exports[_0x8ee1('0xa7')]=function(_0x2d2994,_0x1af1cd,_0x16c13f){return BPromise[_0x8ee1('0xa8')]()['then'](function(){if(!_0x2d2994['query'][_0x8ee1('0x56')]){throw new Error(_0x8ee1('0xa9'));}if(!_0x2d2994[_0x8ee1('0x3b')][_0x8ee1('0x9d')]){throw new Error(_0x8ee1('0x9e'));}var _0x16ed42=_0x2d2994[_0x8ee1('0x3b')]['hostname']?_0x2d2994[_0x8ee1('0x3b')][_0x8ee1('0x9f')]+':'+_0x2d2994['query'][_0x8ee1('0x9d')]:_0x8ee1('0xa0')+_0x2d2994[_0x8ee1('0x3b')][_0x8ee1('0x9d')];var _0x56bfaf=_0x2d2994['query'][_0x8ee1('0x24')]?_0x2d2994['query'][_0x8ee1('0x24')]:!![];var _0x2abe5b=_0x2d2994[_0x8ee1('0x3b')][_0x8ee1('0xa1')]?_0x2d2994[_0x8ee1('0x3b')][_0x8ee1('0xa1')]:null;var _0x3ca5b1={'method':_0x2d2994[_0x8ee1('0xa2')],'uri':util[_0x8ee1('0x53')](_0x8ee1('0xaa'),_0x16ed42,_0x2d2994[_0x8ee1('0x3b')][_0x8ee1('0x56')]),'json':_0x56bfaf,'resolveWithFullResponse':!![],'encoding':_0x2abe5b,'body':_0x2d2994[_0x8ee1('0x90')]};if(_0x2d2994[_0x8ee1('0xa3')]){_0x3ca5b1[_0x8ee1('0xa3')]=_0x2d2994[_0x8ee1('0xa3')];if(_0x3ca5b1[_0x8ee1('0xa3')][_0x8ee1('0xa4')]){delete _0x3ca5b1[_0x8ee1('0xa3')][_0x8ee1('0xa4')];}}if(_0x3ca5b1[_0x8ee1('0xa3')]['content-type']){delete _0x3ca5b1[_0x8ee1('0xa3')][_0x8ee1('0xab')];}return rp(_0x3ca5b1);})['then'](function(_0x3ce27c){if(_0x3ce27c){_0x1af1cd['set'](_0x3ce27c[_0x8ee1('0xa3')]);logger['info'](_0x3ce27c['body']);return _0x1af1cd[_0x8ee1('0x23')](_0x3ce27c['statusCode'])['send'](_0x3ce27c[_0x8ee1('0x90')]);}else{return _0x1af1cd[_0x8ee1('0x22')](0xc8);}})[_0x8ee1('0x4c')](handleError(_0x1af1cd,null));}; \ No newline at end of file +var _0x3d4c=['intersection','fields','attributes','length','hasOwnProperty','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','catch','rawAttributes','include','merge','download','find','path','join','root','%s.zip','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','server/files/plugins','dirname','basename','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','filename','file','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon-apps','admin','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','params','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','format','%s%s','headers','content-length','content-type','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','get','Plugins','UserProfileResource','destroy','then','sendStatus','error','stack','name','send','index','Plugin','type','key','model','map','query','keys','filters'];(function(_0x52e1b3,_0x3126ce){var _0x20a09d=function(_0x3b2e80){while(--_0x3b2e80){_0x52e1b3['push'](_0x52e1b3['shift']());}};_0x20a09d(++_0x3126ce);}(_0x3d4c,0x1b1));var _0xc3d4=function(_0x2f48a3,_0x46bd59){_0x2f48a3=_0x2f48a3-0x0;var _0x2836ee=_0x3d4c[_0x2f48a3];return _0x2836ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3d4('0x0'));var zipdir=require(_0xc3d4('0x1'));var jsonpatch=require(_0xc3d4('0x2'));var rp=require(_0xc3d4('0x3'));var moment=require(_0xc3d4('0x4'));var BPromise=require(_0xc3d4('0x5'));var Mustache=require(_0xc3d4('0x6'));var util=require(_0xc3d4('0x7'));var path=require('path');var sox=require(_0xc3d4('0x8'));var csv=require(_0xc3d4('0x9'));var ejs=require(_0xc3d4('0xa'));var fs=require('fs');var fs_extra=require(_0xc3d4('0xb'));var _=require('lodash');var squel=require(_0xc3d4('0xc'));var crypto=require('crypto');var jsforce=require(_0xc3d4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc3d4('0x9'));var querystring=require(_0xc3d4('0xe'));var Papa=require(_0xc3d4('0xf'));var extract=require(_0xc3d4('0x10'));var rimraf=require(_0xc3d4('0x0'));var archiver=require('archiver');var Redis=require(_0xc3d4('0x11'));var authService=require(_0xc3d4('0x12'));var qs=require(_0xc3d4('0x13'));var as=require(_0xc3d4('0x14'));var hardwareService=require(_0xc3d4('0x15'));var logger=require(_0xc3d4('0x16'))(_0xc3d4('0x17'));var utils=require('../../config/utils');var config=require(_0xc3d4('0x18'));var licenseUtil=require(_0xc3d4('0x19'));var db=require(_0xc3d4('0x1a'))['db'];config[_0xc3d4('0x1b')]=_[_0xc3d4('0x1c')](config[_0xc3d4('0x1b')],{'host':_0xc3d4('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3d4('0x1b')]));require(_0xc3d4('0x1e'))[_0xc3d4('0x1f')](socket);function respondWithStatusCode(_0x1d3054,_0x4ad23d){_0x4ad23d=_0x4ad23d||0xcc;return function(_0xceba36){if(_0xceba36){return _0x1d3054['sendStatus'](_0x4ad23d);}return _0x1d3054[_0xc3d4('0x20')](_0x4ad23d)[_0xc3d4('0x21')]();};}function respondWithResult(_0x25c90d,_0x5969ab){_0x5969ab=_0x5969ab||0xc8;return function(_0x28c76){if(_0x28c76){return _0x25c90d[_0xc3d4('0x20')](_0x5969ab)[_0xc3d4('0x22')](_0x28c76);}};}function respondWithFilteredResult(_0xc6fe87,_0x446666){return function(_0x3dacf1){if(_0x3dacf1){var _0x5778c3=typeof _0x446666[_0xc3d4('0x23')]===_0xc3d4('0x24')&&typeof _0x446666[_0xc3d4('0x25')]===_0xc3d4('0x24');var _0x50e57b=_0x3dacf1[_0xc3d4('0x26')];var _0x4c449d=_0x5778c3?0x0:_0x446666[_0xc3d4('0x23')];var _0x42f0ae=_0x5778c3?_0x3dacf1['count']:_0x446666[_0xc3d4('0x23')]+_0x446666[_0xc3d4('0x25')];var _0x35dc10;if(_0x42f0ae>=_0x50e57b){_0x42f0ae=_0x50e57b;_0x35dc10=0xc8;}else{_0x35dc10=0xce;}_0xc6fe87[_0xc3d4('0x20')](_0x35dc10);return _0xc6fe87[_0xc3d4('0x27')](_0xc3d4('0x28'),_0x4c449d+'-'+_0x42f0ae+'/'+_0x50e57b)[_0xc3d4('0x22')](_0x3dacf1);}return null;};}function patchUpdates(_0xed3224){return function(_0x3f21e4){try{jsonpatch[_0xc3d4('0x29')](_0x3f21e4,_0xed3224,!![]);}catch(_0x33f9cd){return BPromise[_0xc3d4('0x2a')](_0x33f9cd);}return _0x3f21e4['save']();};}function saveUpdates(_0x2f97b1,_0x5a7f6c){return function(_0x5e2084){if(_0x5e2084){return _0x5e2084['update'](_0x2f97b1)['then'](function(_0xa375d0){return _0xa375d0;});}return null;};}function removeEntity(_0x5e30bb,_0xa92ef4){return function(_0x216dea){if(_0x216dea){return _0x216dea['destroy']()['then'](function(){var _0x17236b=_0x216dea[_0xc3d4('0x2b')]({'plain':!![]});var _0x4e7999=_0xc3d4('0x2c');return db[_0xc3d4('0x2d')][_0xc3d4('0x2e')]({'where':{'type':_0x4e7999,'resourceId':_0x17236b['id']}})[_0xc3d4('0x2f')](function(){return _0x216dea;});})[_0xc3d4('0x2f')](function(){_0x5e30bb['status'](0xcc)[_0xc3d4('0x21')]();});}};}function handleEntityNotFound(_0x429b63,_0x220050){return function(_0x570763){if(!_0x570763){_0x429b63[_0xc3d4('0x30')](0x194);}return _0x570763;};}function handleError(_0x49560c,_0x2ac552){_0x2ac552=_0x2ac552||0x1f4;return function(_0x5330d6){logger[_0xc3d4('0x31')](_0x5330d6[_0xc3d4('0x32')]);if(_0x5330d6[_0xc3d4('0x33')]){delete _0x5330d6[_0xc3d4('0x33')];}_0x49560c[_0xc3d4('0x20')](_0x2ac552)[_0xc3d4('0x34')](_0x5330d6);};}exports[_0xc3d4('0x35')]=function(_0x4305d9,_0x305e04){var _0x242cb2={},_0x3b057a={},_0x2d3bda={'count':0x0,'rows':[]};var _0x508d1b=_['map'](db[_0xc3d4('0x36')]['rawAttributes'],function(_0x5b2a28){return{'name':_0x5b2a28['fieldName'],'type':_0x5b2a28[_0xc3d4('0x37')][_0xc3d4('0x38')]};});_0x3b057a[_0xc3d4('0x39')]=_[_0xc3d4('0x3a')](_0x508d1b,'name');_0x3b057a[_0xc3d4('0x3b')]=_[_0xc3d4('0x3c')](_0x4305d9[_0xc3d4('0x3b')]);_0x3b057a[_0xc3d4('0x3d')]=_['intersection'](_0x3b057a[_0xc3d4('0x39')],_0x3b057a[_0xc3d4('0x3b')]);_0x242cb2['attributes']=_[_0xc3d4('0x3e')](_0x3b057a[_0xc3d4('0x39')],qs['fields'](_0x4305d9[_0xc3d4('0x3b')][_0xc3d4('0x3f')]));_0x242cb2[_0xc3d4('0x40')]=_0x242cb2[_0xc3d4('0x40')][_0xc3d4('0x41')]?_0x242cb2[_0xc3d4('0x40')]:_0x3b057a[_0xc3d4('0x39')];if(!_0x4305d9[_0xc3d4('0x3b')][_0xc3d4('0x42')]('nolimit')){_0x242cb2['limit']=qs[_0xc3d4('0x25')](_0x4305d9[_0xc3d4('0x3b')][_0xc3d4('0x25')]);_0x242cb2[_0xc3d4('0x23')]=qs[_0xc3d4('0x23')](_0x4305d9[_0xc3d4('0x3b')]['offset']);}_0x242cb2['order']=qs['sort'](_0x4305d9[_0xc3d4('0x3b')]['sort']);_0x242cb2['where']=qs[_0xc3d4('0x3d')](_[_0xc3d4('0x43')](_0x4305d9[_0xc3d4('0x3b')],_0x3b057a['filters']),_0x508d1b);if(_0x4305d9[_0xc3d4('0x3b')][_0xc3d4('0x44')]){_0x242cb2[_0xc3d4('0x45')]=_['merge'](_0x242cb2[_0xc3d4('0x45')],{'$or':_[_0xc3d4('0x3a')](_0x508d1b,function(_0x45e8aa){if(_0x45e8aa['type']!==_0xc3d4('0x46')){var _0x37f6d1={};_0x37f6d1[_0x45e8aa[_0xc3d4('0x33')]]={'$like':'%'+_0x4305d9[_0xc3d4('0x3b')]['filter']+'%'};return _0x37f6d1;}})});}_0x242cb2=_['merge']({},_0x242cb2,_0x4305d9[_0xc3d4('0x47')]);var _0x296884={'where':_0x242cb2[_0xc3d4('0x45')]};return db[_0xc3d4('0x36')]['count'](_0x296884)[_0xc3d4('0x2f')](function(_0x4b67ab){_0x2d3bda[_0xc3d4('0x26')]=_0x4b67ab;if(_0x4305d9[_0xc3d4('0x3b')][_0xc3d4('0x48')]){_0x242cb2['include']=[{'all':!![]}];}return db[_0xc3d4('0x36')][_0xc3d4('0x49')](_0x242cb2);})[_0xc3d4('0x2f')](function(_0x3d8c29){_0x2d3bda[_0xc3d4('0x4a')]=_0x3d8c29;return _0x2d3bda;})[_0xc3d4('0x2f')](respondWithFilteredResult(_0x305e04,_0x242cb2))[_0xc3d4('0x4b')](handleError(_0x305e04,null));};exports['show']=function(_0x3eeac6,_0x1a6c83){var _0x47111e={'raw':!![],'where':{'id':_0x3eeac6['params']['id']}},_0x143a85={};_0x143a85[_0xc3d4('0x39')]=_['keys'](db[_0xc3d4('0x36')][_0xc3d4('0x4c')]);_0x143a85[_0xc3d4('0x3b')]=_[_0xc3d4('0x3c')](_0x3eeac6[_0xc3d4('0x3b')]);_0x143a85[_0xc3d4('0x3d')]=_[_0xc3d4('0x3e')](_0x143a85[_0xc3d4('0x39')],_0x143a85[_0xc3d4('0x3b')]);_0x47111e[_0xc3d4('0x40')]=_[_0xc3d4('0x3e')](_0x143a85[_0xc3d4('0x39')],qs[_0xc3d4('0x3f')](_0x3eeac6[_0xc3d4('0x3b')][_0xc3d4('0x3f')]));_0x47111e['attributes']=_0x47111e['attributes'][_0xc3d4('0x41')]?_0x47111e[_0xc3d4('0x40')]:_0x143a85[_0xc3d4('0x39')];if(_0x3eeac6[_0xc3d4('0x3b')][_0xc3d4('0x48')]){_0x47111e[_0xc3d4('0x4d')]=[{'all':!![]}];}_0x47111e=_[_0xc3d4('0x4e')]({},_0x47111e,_0x3eeac6[_0xc3d4('0x47')]);return db[_0xc3d4('0x36')]['find'](_0x47111e)[_0xc3d4('0x2f')](handleEntityNotFound(_0x1a6c83,null))[_0xc3d4('0x2f')](respondWithResult(_0x1a6c83,null))['catch'](handleError(_0x1a6c83,null));};exports[_0xc3d4('0x4f')]=function(_0x172698,_0x2fef2f,_0x422f7b){return db['Plugin'][_0xc3d4('0x50')]({'where':{'id':_0x172698['params']['id']},'attributes':['name',_0xc3d4('0x51')],'raw':!![]})[_0xc3d4('0x2f')](handleEntityNotFound(_0x2fef2f,null))['then'](function(_0x2c071c){if(_0x2c071c){var _0x3bc146=path[_0xc3d4('0x52')](config[_0xc3d4('0x53')],'server/files/plugins',util['format'](_0xc3d4('0x54'),path['basename'](_0x2c071c['path'])));var _0x464180=fs[_0xc3d4('0x55')](_0x3bc146);var _0x25a116=archiver(_0xc3d4('0x56'),{'zlib':{'level':0x9}});_0x25a116['on'](_0xc3d4('0x57'),function(_0x138c19){if(_0x138c19['code']===_0xc3d4('0x58')){logger[_0xc3d4('0x31')](_0x138c19);}else{throw new db[(_0xc3d4('0x59'))][(_0xc3d4('0x5a'))](_0xc3d4('0x5b'));}});_0x25a116['on']('error',function(_0x1c63e6){throw new db[(_0xc3d4('0x59'))][(_0xc3d4('0x5a'))](_0xc3d4('0x5b'));});_0x25a116['pipe'](_0x464180);_0x25a116[_0xc3d4('0x5c')](_0xc3d4('0x5d'),{'cwd':path[_0xc3d4('0x52')](config[_0xc3d4('0x53')],_0xc3d4('0x5e'),path[_0xc3d4('0x5f')](_0x2c071c[_0xc3d4('0x51')])),'ignore':[path[_0xc3d4('0x52')](path[_0xc3d4('0x60')](_0x2c071c[_0xc3d4('0x51')]),_0xc3d4('0x61')),path['join'](path['basename'](_0x2c071c['path']),_0xc3d4('0x62'))],'nodir':!![]})[_0xc3d4('0x63')]();_0x464180['on']('close',function(){if(!fs[_0xc3d4('0x64')](_0x3bc146)){throw new db[(_0xc3d4('0x59'))]['Error'](_0xc3d4('0x65'));}return _0x2fef2f[_0xc3d4('0x4f')](_0x3bc146,util['format'](_0xc3d4('0x54'),path['basename'](_0x2c071c[_0xc3d4('0x51')])),function(_0x46d7d9){if(_0x46d7d9){throw new db[(_0xc3d4('0x59'))][(_0xc3d4('0x5a'))](_0xc3d4('0x66'));}fs[_0xc3d4('0x67')](_0x3bc146);logger[_0xc3d4('0x68')]('Download\x20completed');logger[_0xc3d4('0x68')](_0xc3d4('0x69'));});});}return null;})['catch'](handleError(_0x2fef2f,null));};exports['upload']=function(_0xea6299,_0x2ea73c,_0x20d24d){var _0xe6d23d=path[_0xc3d4('0x60')](_0xea6299['file'][_0xc3d4('0x6a')],path['extname'](_0xea6299[_0xc3d4('0x6b')]['filename']));var _0x47a949=path[_0xc3d4('0x52')](config['root'],'server/files/plugins',_0xea6299[_0xc3d4('0x6b')][_0xc3d4('0x6a')]);var _0x4c063f=path['join'](config[_0xc3d4('0x53')],'server/files/plugins',_0xe6d23d);logger[_0xc3d4('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x47a949);logger[_0xc3d4('0x68')](_0xc3d4('0x6c'),_0x4c063f);try{fs[_0xc3d4('0x6d')](_0x47a949,parseInt(_0xc3d4('0x6e'),0x8));extract(_0x47a949,{'dir':_0x4c063f},function(_0x25a468){if(_0x25a468){logger[_0xc3d4('0x31')](_0x25a468);handleError(_0x25a468,!![]);};var _0xaeecc5=fs['readdirSync'](_0x4c063f);if(_0xaeecc5[_0xc3d4('0x41')]>0x1){removeReferences(_0x47a949,_0x4c063f);logger[_0xc3d4('0x31')]('Invalid\x20plugin\x20structure');return _0x20d24d(new Error(_0xc3d4('0x6f')));}var _0x52d85f=fs['lstatSync'](path[_0xc3d4('0x52')](_0x4c063f,_0xaeecc5[0x0]));if(_0x52d85f['isFile']()){removeReferences(_0x47a949,_0x4c063f);logger[_0xc3d4('0x31')]('Invalid\x20plugin\x20structure');return _0x20d24d(new Error(_0xc3d4('0x6f')));}if(_0x52d85f[_0xc3d4('0x70')]()){var _0x3a8843=fs[_0xc3d4('0x71')](path[_0xc3d4('0x52')](_0x4c063f,_0xaeecc5[0x0]));if(_0x3a8843[_0xc3d4('0x41')]===0x0){removeReferences(_0x47a949,_0x4c063f);logger[_0xc3d4('0x31')](_0xc3d4('0x6f'));return _0x20d24d(new Error(_0xc3d4('0x6f')));}var _0x5ce177=_0x3a8843[_0xc3d4('0x72')](function(_0x3cdcc7){return _0x3cdcc7===_0xc3d4('0x73');});if(!_0x5ce177){return _0x20d24d(new Error(_0xc3d4('0x74')));}var _0xde4818=fs[_0xc3d4('0x75')](path[_0xc3d4('0x52')](_0x4c063f,_0xaeecc5[0x0],_0xc3d4('0x73')));var _0x51b499=JSON[_0xc3d4('0x76')](_0xde4818);if(_0xc3d4('0x24')==typeof _0x51b499[_0xc3d4('0x33')]){return _0x20d24d(new Error(_0xc3d4('0x77')));}if(_0xc3d4('0x24')==typeof _0x51b499[_0xc3d4('0x37')]){return _0x20d24d(new Error(_0xc3d4('0x78')));}if(_0xc3d4('0x24')==typeof _0x51b499[_0xc3d4('0x79')]){return _0x20d24d(new Error(_0xc3d4('0x7a')));}if('undefined'==typeof _0x51b499[_0xc3d4('0x7b')]){return _0x20d24d(new Error(_0xc3d4('0x7c')));}if(_0x51b499['type']===_0xc3d4('0x7d')){if(_0xc3d4('0x24')==typeof _0x51b499['parameters'][_0xc3d4('0x7e')]){return _0x20d24d(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')]['admin']&&'undefined'==typeof _0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')]['agent']){return _0x20d24d(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x51b499[_0xc3d4('0x37')]===_0xc3d4('0x7f')){if('undefined'==typeof _0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x80')]){return _0x20d24d(new Error(_0xc3d4('0x81')));}if(_0xc3d4('0x24')==typeof _0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x82')]){return _0x20d24d(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x20d24d(new Error(_0xc3d4('0x83')));}var _0x130425=_0x51b499[_0xc3d4('0x33')];var _0x4d2e3c=_0x51b499['description'];var _0x631be0=_0x51b499[_0xc3d4('0x37')];var _0x470b0b=_0x51b499['sidebar']?_0x51b499[_0xc3d4('0x84')]:_0xc3d4('0x85');var _0x544f3b=_0x51b499['icon']?_0x51b499['icon']:_0xc3d4('0x86');var _0x58ae4e='';var _0x3dcc78='';var _0x53e1a9='';var _0x31d6d0='';var _0x3e5911=_0x51b499['version'];if(_0x631be0===_0xc3d4('0x7d')){if('undefined'!=typeof _0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')][_0xc3d4('0x87')]){var _0x566214=_0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xc3d4('0x88')](_0x566214)){_0x58ae4e=path['join'](_0xc3d4('0x89'),_0xe6d23d,_0xaeecc5[0x0],_0x566214);}else{_0x58ae4e=_0x566214;}}else{logger[_0xc3d4('0x68')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xc3d4('0x24')!=typeof _0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')][_0xc3d4('0x8a')]){var _0x4ea6a9=_0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')][_0xc3d4('0x8a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4ea6a9)){_0x3dcc78=path[_0xc3d4('0x52')](_0xc3d4('0x89'),_0xe6d23d,_0xaeecc5[0x0],_0x4ea6a9);}else{_0x3dcc78=_0x4ea6a9;}}else{logger[_0xc3d4('0x68')](_0xc3d4('0x8b'));}}else if(_0x631be0===_0xc3d4('0x7f')){_0x53e1a9=_0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x80')];_0x31d6d0=_0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x82')];if('undefined'!=typeof _0x51b499['parameters'][_0xc3d4('0x7e')]){if('undefined'!=typeof _0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')]['admin']){var _0x566214=_0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')][_0xc3d4('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xc3d4('0x88')](_0x566214)){_0x58ae4e=path['join'](_0xc3d4('0x89'),_0xe6d23d,_0xaeecc5[0x0],_0x566214);}else{_0x58ae4e=_0x566214;}}if(_0xc3d4('0x24')!=typeof _0x51b499['parameters']['views'][_0xc3d4('0x8a')]){var _0x4ea6a9=_0x51b499[_0xc3d4('0x7b')][_0xc3d4('0x7e')][_0xc3d4('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xc3d4('0x88')](_0x4ea6a9)){_0x3dcc78=path['join'](_0xc3d4('0x89'),_0xe6d23d,_0xaeecc5[0x0],_0x4ea6a9);}else{_0x3dcc78=_0x4ea6a9;}}}}var _0x2b5cde={'name':_0x130425,'description':_0x4d2e3c,'path':path[_0xc3d4('0x52')](_0xe6d23d,_0xaeecc5[0x0]),'type':_0x631be0,'sidebar':_0x470b0b,'icon':_0x544f3b,'adminUrl':_0x58ae4e,'agentUrl':_0x3dcc78,'scriptName':_0x53e1a9,'scriptPath':_0x31d6d0,'version':_0x3e5911};removeReferences(_0x47a949,null);return db[_0xc3d4('0x36')][_0xc3d4('0x8c')](_0x2b5cde)[_0xc3d4('0x2f')](function(_0x4b1684){var _0x4f21ec={'role':_0xea6299[_0xc3d4('0x8d')][_0xc3d4('0x8e')],'userProfileId':_0xea6299[_0xc3d4('0x8d')][_0xc3d4('0x8f')]};if(!_0x4f21ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f21ec[_0xc3d4('0x8e')]===_0xc3d4('0x90')){var _0x516fef=_0x4b1684[_0xc3d4('0x2b')]({'plain':!![]});return db[_0xc3d4('0x91')]['find']({'where':{'name':'Plugins','userProfileId':_0x4f21ec[_0xc3d4('0x8f')]},'raw':!![]})['then'](function(_0x4d10b3){if(_0x4d10b3&&_0x4d10b3[_0xc3d4('0x92')]===0x0){return db['UserProfileResource']['create']({'name':_0x516fef[_0xc3d4('0x33')],'resourceId':_0x516fef['id'],'type':_0x4d10b3['name'],'sectionId':_0x4d10b3['id']},{})['then'](function(){return _0x4b1684;});}else{return _0x4b1684;}})[_0xc3d4('0x4b')](function(_0x66f8d3){logger[_0xc3d4('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x66f8d3);throw _0x66f8d3;});}return _0x4b1684;})[_0xc3d4('0x2f')](respondWithResult(_0x2ea73c,null))[_0xc3d4('0x4b')](handleError(_0x2ea73c,null));}});}catch(_0x3d4e70){_0x2ea73c[_0xc3d4('0x20')](0x1f4)[_0xc3d4('0x34')](_0x3d4e70);}};function removeReferences(_0x5d8054,_0x351a13){try{if(_0x5d8054){fs[_0xc3d4('0x67')](_0x5d8054);logger[_0xc3d4('0x68')](_0xc3d4('0x93'));}if(_0x351a13){rimraf(_0x351a13,function(){});logger[_0xc3d4('0x68')](_0xc3d4('0x94'));}}catch(_0x422aee){logger[_0xc3d4('0x31')](_0x422aee);}}exports['update']=function(_0x45f770,_0x48c66b,_0x110ab7){return db['Plugin'][_0xc3d4('0x50')]({'where':{'id':_0x45f770[_0xc3d4('0x95')]['id']}})['then'](handleEntityNotFound(_0x48c66b,null))[_0xc3d4('0x2f')](saveUpdates(_0x45f770['body'],null))['then'](respondWithResult(_0x48c66b,null))[_0xc3d4('0x4b')](handleError(_0x48c66b,null));};exports[_0xc3d4('0x96')]=function(_0x2632e2,_0x22a4ae,_0x2a0f15){return db[_0xc3d4('0x36')][_0xc3d4('0x50')]({'where':{'id':_0x2632e2[_0xc3d4('0x95')]['id']}})['then'](function(_0x319070){if(_0x319070){return _0x319070['destroy']();}})[_0xc3d4('0x2f')](function(_0x58fa64){rimraf(path[_0xc3d4('0x52')](config[_0xc3d4('0x53')],'server/files/plugins',path[_0xc3d4('0x5f')](_0x58fa64[_0xc3d4('0x51')])),function(){});return _0x58fa64;})[_0xc3d4('0x2f')](handleEntityNotFound(_0x22a4ae,null))['then'](respondWithStatusCode(_0x22a4ae,null))['catch'](handleError(_0x22a4ae,null));};exports['webhookGet']=function(_0x267223,_0x299c48,_0x5d0f95){return BPromise[_0xc3d4('0x97')]()[_0xc3d4('0x2f')](function(){if(!_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x51')]){throw new Error(_0xc3d4('0x98'));}if(!_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x99')]){throw new Error(_0xc3d4('0x9a'));}var _0xc2c4c8=_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x9b')]?_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x9b')]+':'+_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x99')]:_0xc3d4('0x9c')+_0x267223['query'][_0xc3d4('0x99')];var _0x1f1ee3=_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x22')]?_0x267223[_0xc3d4('0x3b')]['json']:!![];var _0x677445=_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x9d')]?_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x9d')]:null;var _0x403bc1={'method':_0x267223[_0xc3d4('0x9e')],'uri':util[_0xc3d4('0x9f')](_0xc3d4('0xa0'),_0xc2c4c8,_0x267223['query'][_0xc3d4('0x51')]),'json':_0x1f1ee3,'resolveWithFullResponse':!![],'encoding':_0x677445,'qs':_0x267223['query']};if(_0x267223[_0xc3d4('0xa1')]){_0x403bc1['headers']=_0x267223[_0xc3d4('0xa1')];if(_0x403bc1[_0xc3d4('0xa1')][_0xc3d4('0xa2')]){delete _0x403bc1[_0xc3d4('0xa1')]['content-length'];}}if(_0x403bc1[_0xc3d4('0xa1')][_0xc3d4('0xa3')]){delete _0x403bc1[_0xc3d4('0xa1')][_0xc3d4('0xa3')];}return rp(_0x403bc1);})[_0xc3d4('0x2f')](function(_0x215d20){if(_0x215d20){_0x299c48[_0xc3d4('0x27')](_0x215d20[_0xc3d4('0xa1')]);logger[_0xc3d4('0x68')](_0x215d20[_0xc3d4('0x8d')]);if(_['endsWith'](_0x267223[_0xc3d4('0x3b')][_0xc3d4('0x51')],'download')&&_0x215d20['statusCode']==0x1f4){return _0x299c48['sendStatus'](_0x215d20[_0xc3d4('0xa4')]);}else{return _0x299c48[_0xc3d4('0x20')](_0x215d20['statusCode'])['send'](_0x215d20['body']);}}else{return _0x299c48[_0xc3d4('0x30')](0xc8);}})[_0xc3d4('0x4b')](handleError(_0x299c48,null));};exports['webhookPost']=function(_0x27e0cb,_0x5128d6,_0x16ff49){return BPromise[_0xc3d4('0x97')]()[_0xc3d4('0x2f')](function(){if(!_0x27e0cb['query'][_0xc3d4('0x51')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x27e0cb['query'][_0xc3d4('0x99')]){throw new Error(_0xc3d4('0x9a'));}var _0x543d40=_0x27e0cb[_0xc3d4('0x3b')]['hostname']?_0x27e0cb[_0xc3d4('0x3b')]['hostname']+':'+_0x27e0cb[_0xc3d4('0x3b')]['port']:'http://localhost:'+_0x27e0cb[_0xc3d4('0x3b')][_0xc3d4('0x99')];var _0x535c03=_0x27e0cb[_0xc3d4('0x3b')][_0xc3d4('0x22')]?_0x27e0cb[_0xc3d4('0x3b')][_0xc3d4('0x22')]:!![];var _0x41310e=_0x27e0cb[_0xc3d4('0x3b')]['encoding']?_0x27e0cb[_0xc3d4('0x3b')]['encoding']:null;var _0x310d84={'method':_0x27e0cb[_0xc3d4('0x9e')],'uri':util[_0xc3d4('0x9f')](_0xc3d4('0xa0'),_0x543d40,_0x27e0cb[_0xc3d4('0x3b')][_0xc3d4('0x51')]),'json':_0x535c03,'resolveWithFullResponse':!![],'encoding':_0x41310e,'body':_0x27e0cb[_0xc3d4('0x8d')]};if(_0x27e0cb[_0xc3d4('0xa1')]){_0x310d84[_0xc3d4('0xa1')]=_0x27e0cb['headers'];if(_0x310d84[_0xc3d4('0xa1')][_0xc3d4('0xa2')]){delete _0x310d84[_0xc3d4('0xa1')][_0xc3d4('0xa2')];}}if(_0x310d84[_0xc3d4('0xa1')][_0xc3d4('0xa3')]){delete _0x310d84['headers'][_0xc3d4('0xa3')];}return rp(_0x310d84);})[_0xc3d4('0x2f')](function(_0x2a5e64){if(_0x2a5e64){_0x5128d6[_0xc3d4('0x27')](_0x2a5e64[_0xc3d4('0xa1')]);logger[_0xc3d4('0x68')](_0x2a5e64[_0xc3d4('0x8d')]);return _0x5128d6[_0xc3d4('0x20')](_0x2a5e64[_0xc3d4('0xa4')])[_0xc3d4('0x34')](_0x2a5e64[_0xc3d4('0x8d')]);}else{return _0x5128d6['sendStatus'](0xc8);}})['catch'](handleError(_0x5128d6,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index a60d958..25bc743 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 _0x15c6=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1a170a,_0x52e2af){var _0x29f090=function(_0x41a09d){while(--_0x41a09d){_0x1a170a['push'](_0x1a170a['shift']());}};_0x29f090(++_0x52e2af);}(_0x15c6,0x1cd));var _0x615c=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x15c6[_0x280f4a];return _0x1bb157;};'use strict';var EventEmitter=require(_0x615c('0x0'));var Plugin=require(_0x615c('0x1'))['db'][_0x615c('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x615c('0x3')](0x0);var events={'afterCreate':_0x615c('0x4'),'afterUpdate':_0x615c('0x5'),'afterDestroy':_0x615c('0x6')};function emitEvent(_0x28cf45){return function(_0x4bb54c,_0x5143f9,_0x5ea94e){PluginEvents[_0x615c('0x7')](_0x28cf45+':'+_0x4bb54c['id'],_0x4bb54c);PluginEvents[_0x615c('0x7')](_0x28cf45,_0x4bb54c);_0x5ea94e(null);};}for(var e in events){if(events[_0x615c('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x615c('0x9')]=PluginEvents; \ No newline at end of file +var _0x870d=['save','update','remove','emit','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x870d,0xde));var _0xd870=function(_0x52eaad,_0x4226d9){_0x52eaad=_0x52eaad-0x0;var _0x87d78e=_0x870d[_0x52eaad];return _0x87d78e;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xd870('0x0'))['db'][_0xd870('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xd870('0x2')](0x0);var events={'afterCreate':_0xd870('0x3'),'afterUpdate':_0xd870('0x4'),'afterDestroy':_0xd870('0x5')};function emitEvent(_0x54e456){return function(_0x78293f,_0x2a0582,_0x3fb08f){PluginEvents[_0xd870('0x6')](_0x54e456+':'+_0x78293f['id'],_0x78293f);PluginEvents[_0xd870('0x6')](_0x54e456,_0x78293f);_0x3fb08f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xd870('0x7')](e,emitEvent(event));}}module[_0xd870('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index e5c9d64..ee81c25 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 _0x0cc9=['api','moment','bluebird','path','rimraf','../../config/environment','exports','Plugin','plugins','../../config/logger'];(function(_0x5cabfd,_0x5dea47){var _0x4bc06c=function(_0x4a2fea){while(--_0x4a2fea){_0x5cabfd['push'](_0x5cabfd['shift']());}};_0x4bc06c(++_0x5dea47);}(_0x0cc9,0x121));var _0x90cc=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0x0cc9[_0x2fa1c6];return _0x5f3257;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90cc('0x0'))(_0x90cc('0x1'));var moment=require(_0x90cc('0x2'));var BPromise=require(_0x90cc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90cc('0x4'));var rimraf=require(_0x90cc('0x5'));var config=require(_0x90cc('0x6'));var attributes=require('./plugin.attributes');module[_0x90cc('0x7')]=function(_0x125401,_0x1f4ba5){return _0x125401['define'](_0x90cc('0x8'),attributes,{'tableName':_0x90cc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7080=['exports','define','Plugin','plugins','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7080,0xa0));var _0x0708=function(_0x4a2217,_0x9c653a){_0x4a2217=_0x4a2217-0x0;var _0x24cb1c=_0x7080[_0x4a2217];return _0x24cb1c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0708('0x0'))(_0x0708('0x1'));var moment=require(_0x0708('0x2'));var BPromise=require(_0x0708('0x3'));var rp=require(_0x0708('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0708('0x5'));var config=require(_0x0708('0x6'));var attributes=require(_0x0708('0x7'));module[_0x0708('0x8')]=function(_0x485d5a,_0x278cab){return _0x485d5a[_0x0708('0x9')](_0x0708('0xa'),attributes,{'tableName':_0x0708('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 54cd0c5..b6bd3f8 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 _0x2a2b=['raw','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','redis','socket.io-emitter','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','CreatePlugin','Plugin','create','options'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x2a2b,0x1d5));var _0xb2a2=function(_0x2b7810,_0xb69116){_0x2b7810=_0x2b7810-0x0;var _0x86d8ee=_0x2a2b[_0x2b7810];return _0x86d8ee;};'use strict';var _=require(_0xb2a2('0x0'));var util=require('util');var moment=require(_0xb2a2('0x1'));var BPromise=require(_0xb2a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2a2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb2a2('0x4'))('rpc');var config=require(_0xb2a2('0x5'));var jayson=require(_0xb2a2('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xb2a2('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb2a2('0x8'))(new Redis(config['redis']));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x562b09,_0x3a99c0,_0x243619){return new BPromise(function(_0x42839c,_0x1f489d){return client[_0xb2a2('0x9')](_0x562b09,_0x243619)[_0xb2a2('0xa')](function(_0x4ed32b){logger['info'](_0xb2a2('0xb'),_0x3a99c0,'request\x20sent');logger[_0xb2a2('0xc')](_0xb2a2('0xd'),_0x3a99c0,'request\x20sent',JSON[_0xb2a2('0xe')](_0x4ed32b));if(_0x4ed32b[_0xb2a2('0xf')]){if(_0x4ed32b[_0xb2a2('0xf')][_0xb2a2('0x10')]===0x1f4){logger[_0xb2a2('0xf')](_0xb2a2('0xb'),_0x3a99c0,_0x4ed32b[_0xb2a2('0xf')][_0xb2a2('0x11')]);return _0x1f489d(_0x4ed32b[_0xb2a2('0xf')][_0xb2a2('0x11')]);}logger[_0xb2a2('0xf')]('Plugin,\x20%s,\x20%s',_0x3a99c0,_0x4ed32b[_0xb2a2('0xf')]['message']);return _0x42839c(_0x4ed32b[_0xb2a2('0xf')][_0xb2a2('0x11')]);}else{logger[_0xb2a2('0x12')](_0xb2a2('0xb'),_0x3a99c0,_0xb2a2('0x13'));_0x42839c(_0x4ed32b['result'][_0xb2a2('0x11')]);}})[_0xb2a2('0x14')](function(_0x247de7){logger['error'](_0xb2a2('0xb'),_0x3a99c0,_0x247de7);_0x1f489d(_0x247de7);});});}exports[_0xb2a2('0x15')]=function(_0x4f7caf){var _0xf0cc57=this;return new Promise(function(_0x2933d5,_0x2e6e70){return db[_0xb2a2('0x16')][_0xb2a2('0x17')](_0x4f7caf['body'],{'raw':_0x4f7caf[_0xb2a2('0x18')]?_0x4f7caf['options'][_0xb2a2('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5411c6){logger[_0xb2a2('0x12')]('CreatePlugin',_0x4f7caf);logger['debug'](_0xb2a2('0x15'),_0x4f7caf,JSON[_0xb2a2('0xe')](_0x5411c6));_0x2933d5(_0x5411c6);})['catch'](function(_0x2fc6df){logger[_0xb2a2('0xf')]('CreatePlugin',_0x2fc6df['message'],_0x4f7caf);_0x2e6e70(_0xf0cc57[_0xb2a2('0xf')](0x1f4,_0x2fc6df[_0xb2a2('0x11')]));});});}; \ No newline at end of file +var _0x12c6=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','request','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xf4f9d3,_0x4c0c89){var _0x2e6d93=function(_0x252985){while(--_0x252985){_0xf4f9d3['push'](_0xf4f9d3['shift']());}};_0x2e6d93(++_0x4c0c89);}(_0x12c6,0x1b4));var _0x612c=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x12c6[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x612c('0x0'));var util=require(_0x612c('0x1'));var moment=require(_0x612c('0x2'));var BPromise=require(_0x612c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x612c('0x4'));var db=require(_0x612c('0x5'))['db'];var utils=require(_0x612c('0x6'));var logger=require(_0x612c('0x7'))(_0x612c('0x8'));var config=require(_0x612c('0x9'));var jayson=require(_0x612c('0xa'));var client=jayson[_0x612c('0xb')][_0x612c('0xc')]({'port':0x232a});config['redis']=_[_0x612c('0xd')](config[_0x612c('0xe')],{'host':_0x612c('0xf'),'port':0x18eb});var socket=require(_0x612c('0x10'))(new Redis(config[_0x612c('0xe')]));require(_0x612c('0x11'))['register'](socket);function respondWithRpcPromise(_0x4bf2a5,_0x1369da,_0xcc038a){return new BPromise(function(_0x4a75b1,_0x4860b7){return client[_0x612c('0x12')](_0x4bf2a5,_0xcc038a)[_0x612c('0x13')](function(_0x13142b){logger[_0x612c('0x14')]('Plugin,\x20%s,\x20%s',_0x1369da,_0x612c('0x15'));logger['debug'](_0x612c('0x16'),_0x1369da,'request\x20sent',JSON['stringify'](_0x13142b));if(_0x13142b[_0x612c('0x17')]){if(_0x13142b[_0x612c('0x17')][_0x612c('0x18')]===0x1f4){logger[_0x612c('0x17')](_0x612c('0x19'),_0x1369da,_0x13142b[_0x612c('0x17')][_0x612c('0x1a')]);return _0x4860b7(_0x13142b[_0x612c('0x17')]['message']);}logger[_0x612c('0x17')](_0x612c('0x19'),_0x1369da,_0x13142b[_0x612c('0x17')][_0x612c('0x1a')]);return _0x4a75b1(_0x13142b['error'][_0x612c('0x1a')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x1369da,_0x612c('0x15'));_0x4a75b1(_0x13142b['result'][_0x612c('0x1a')]);}})[_0x612c('0x1b')](function(_0x82670e){logger[_0x612c('0x17')](_0x612c('0x19'),_0x1369da,_0x82670e);_0x4860b7(_0x82670e);});});}exports[_0x612c('0x1c')]=function(_0x49388c){var _0x16f4c4=this;return new Promise(function(_0x48c321,_0x22acda){return db[_0x612c('0x1d')][_0x612c('0x1e')](_0x49388c[_0x612c('0x1f')],{'raw':_0x49388c[_0x612c('0x20')]?_0x49388c[_0x612c('0x20')][_0x612c('0x21')]===undefined?!![]:![]:!![]})[_0x612c('0x13')](function(_0x33a305){logger[_0x612c('0x14')]('CreatePlugin',_0x49388c);logger['debug'](_0x612c('0x1c'),_0x49388c,JSON['stringify'](_0x33a305));_0x48c321(_0x33a305);})[_0x612c('0x1b')](function(_0x153dc8){logger[_0x612c('0x17')](_0x612c('0x1c'),_0x153dc8[_0x612c('0x1a')],_0x49388c);_0x22acda(_0x16f4c4[_0x612c('0x17')](0x1f4,_0x153dc8[_0x612c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 7ad4e6a..e97643a 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 _0x011c=['plugin:','./plugin.events','save','remove','emit','removeListener','register','length'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x011c,0x141));var _0xc011=function(_0x31d4ef,_0x38ffbb){_0x31d4ef=_0x31d4ef-0x0;var _0x56ca8c=_0x011c[_0x31d4ef];return _0x56ca8c;};'use strict';var PluginEvents=require(_0xc011('0x0'));var events=[_0xc011('0x1'),_0xc011('0x2'),'update'];function createListener(_0x4f38d0,_0x3b5692){return function(_0x365411){_0x3b5692[_0xc011('0x3')](_0x4f38d0,_0x365411);};}function removeListener(_0x3bd84f,_0x176684){return function(){PluginEvents[_0xc011('0x4')](_0x3bd84f,_0x176684);};}exports[_0xc011('0x5')]=function(_0x5c315e){for(var _0x496233=0x0,_0x499965=events[_0xc011('0x6')];_0x496233<_0x499965;_0x496233++){var _0x161ada=events[_0x496233];var _0x541525=createListener(_0xc011('0x7')+_0x161ada,_0x5c315e);PluginEvents['on'](_0x161ada,_0x541525);}}; \ No newline at end of file +var _0x57af=['emit','removeListener','register','length','plugin:','./plugin.events','save','update'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x57af,0xcd));var _0xf57a=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x57af[_0x122096];return _0x3d1966;};'use strict';var PluginEvents=require(_0xf57a('0x0'));var events=[_0xf57a('0x1'),'remove',_0xf57a('0x2')];function createListener(_0x447db4,_0x46e321){return function(_0x5e023b){_0x46e321[_0xf57a('0x3')](_0x447db4,_0x5e023b);};}function removeListener(_0x4c91ba,_0x13f2e4){return function(){PluginEvents[_0xf57a('0x4')](_0x4c91ba,_0x13f2e4);};}exports[_0xf57a('0x5')]=function(_0x401ac7){for(var _0x1d50c3=0x0,_0x41b062=events[_0xf57a('0x6')];_0x1d50c3<_0x41b062;_0x1d50c3++){var _0x4f67fe=events[_0x1d50c3];var _0x6de64=createListener(_0xf57a('0x7')+_0x4f67fe,_0x401ac7);PluginEvents['on'](_0x4f67fe,_0x6de64);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 5ffb5fe..570943c 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(_0x1e8e02,_0xf2e3e3){var _0x393116=function(_0x479868){while(--_0x479868){_0x1e8e02['push'](_0x1e8e02['shift']());}};_0x393116(++_0xf2e3e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x28b00e,_0x1a9c96){var _0x5a1fbd=function(_0x36a34a){while(--_0x36a34a){_0x28b00e['push'](_0x28b00e['shift']());}};_0x5a1fbd(++_0x1a9c96);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 d932ef0..beff89e 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 _0xb58b=['Unknown\x20status','destroy','params','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','child_process','exec','sendStatus','status','json','error','stack','name','npm\x20install','info','list','then','reject','motion2','length','describe','catch','create','body','join','../../files/plugins','script','cwd','chdir','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x76e753,_0x38d57f){var _0x503325=function(_0x264b2c){while(--_0x264b2c){_0x76e753['push'](_0x76e753['shift']());}};_0x503325(++_0x38d57f);}(_0xb58b,0x1f1));var _0xbb58=function(_0x28ce33,_0xa5e455){_0x28ce33=_0x28ce33-0x0;var _0x4e97b0=_0xb58b[_0x28ce33];return _0x4e97b0;};'use strict';var _=require('lodash');var pm2=require(_0xbb58('0x0'));var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var path=require('path');var exec=require(_0xbb58('0x3'))[_0xbb58('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x226363,_0x546510){return function(_0x2edb10){if(!_0x2edb10){_0x226363[_0xbb58('0x5')](0x194);;}return _0x2edb10;};}function respondWithResult(_0x33fe85,_0x5cf8b1){_0x5cf8b1=_0x5cf8b1||0xc8;return function(_0x27cbda){if(_0x27cbda){return _0x33fe85[_0xbb58('0x6')](_0x5cf8b1)[_0xbb58('0x7')](_0x27cbda);}return null;};}function handleError(_0x5d7fe8,_0xd94f1){_0xd94f1=_0xd94f1||0x1f4;return function(_0x3e3144){logger[_0xbb58('0x8')](_0x3e3144[_0xbb58('0x9')]);if(_0x3e3144[_0xbb58('0xa')]){delete _0x3e3144[_0xbb58('0xa')];}_0x5d7fe8[_0xbb58('0x6')](_0xd94f1)['send'](_0x3e3144);};}function execChildProcess(){return new BPromise(function(_0x80ab3a,_0x5c3bf7){exec(_0xbb58('0xb'),function(_0x440392,_0x26d8e6,_0x19d185){logger['info'](_0x26d8e6);logger[_0xbb58('0xc')](_0x19d185);if(_0x440392){logger[_0xbb58('0x8')](_0x440392);return _0x5c3bf7(_0x440392);}return _0x80ab3a(_0x26d8e6);});});}exports['index']=function(_0x132511,_0xdc68b9){return pm2[_0xbb58('0xd')]()[_0xbb58('0xe')](function(_0x19ceda){if(_0x19ceda){var _0x58245f=_[_0xbb58('0xf')](_0x19ceda,function(_0x23fd15){return _0x23fd15['name']==='express'||_0x23fd15[_0xbb58('0xa')]===_0xbb58('0x10');});return{'rows':_0x58245f,'count':_0x58245f[_0xbb58('0x11')]};}return null;})['then'](respondWithResult(_0xdc68b9,null))['catch'](handleError(_0xdc68b9,null));};exports['show']=function(_0x55156e,_0x28637b){return pm2[_0xbb58('0x12')](_0x55156e['params']['id'])[_0xbb58('0xe')](respondWithResult(_0x28637b,null))['then'](handleEntityNotFound(_0x28637b,null))[_0xbb58('0x13')](handleError(_0x28637b,null));};exports[_0xbb58('0x14')]=function(_0x3c33d9,_0xb8f982){if(_0x3c33d9[_0xbb58('0x15')][_0xbb58('0xa')]&&_0x3c33d9[_0xbb58('0x15')]['script']){var _0x84f34=path[_0xbb58('0x16')](__dirname,_0xbb58('0x17'),_0x3c33d9[_0xbb58('0x15')][_0xbb58('0x18')]);var _0x5d4a91=process[_0xbb58('0x19')]();process[_0xbb58('0x1a')](path[_0xbb58('0x1b')](_0x84f34));return execChildProcess()['then'](function(_0x27806d){process['chdir'](_0x5d4a91);return pm2[_0xbb58('0x1c')]({'name':_0x3c33d9[_0xbb58('0x15')][_0xbb58('0xa')],'script':_0x84f34});})[_0xbb58('0xe')](function(_0x2d111c){pm2[_0xbb58('0x1d')]();return _0x2d111c[0x0];})[_0xbb58('0xe')](respondWithResult(_0xb8f982,0xc9))[_0xbb58('0x13')](handleError(_0xb8f982,null));}else{return _0xb8f982['status'](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x1f')});}};exports[_0xbb58('0x20')]=function(_0x129094,_0x8e9ed9){if(_0x129094[_0xbb58('0x15')]['id']){delete _0x129094[_0xbb58('0x15')]['id'];}var _0x2ce7c3={'online':_0xbb58('0x21'),'stopped':_0xbb58('0x22')};if(_0x2ce7c3[_0xbb58('0x23')](_0x129094[_0xbb58('0x15')][_0xbb58('0x6')])){return pm2[_0x2ce7c3[_0x129094[_0xbb58('0x15')][_0xbb58('0x6')]]](_0x129094['params']['id'])[_0xbb58('0xe')](respondWithResult(_0x8e9ed9,0xc8))[_0xbb58('0x13')](handleError(_0x8e9ed9,null));}else{return _0x8e9ed9[_0xbb58('0x6')](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x24')});}};exports[_0xbb58('0x25')]=function(_0x1ba526,_0x643e0e){if(_0x1ba526[_0xbb58('0x15')]['id']){delete _0x1ba526['body']['id'];}if(_0x1ba526[_0xbb58('0x26')]['id']){return pm2[_0xbb58('0x27')](_0x1ba526[_0xbb58('0x26')]['id'])[_0xbb58('0xe')](function(_0xdbbe7b){pm2[_0xbb58('0x1d')]();return _0xdbbe7b[0x0];})[_0xbb58('0xe')](respondWithResult(_0x643e0e,null))[_0xbb58('0x13')](handleError(_0x643e0e,null));}else{return _0x643e0e[_0xbb58('0x6')](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x28')});}}; \ No newline at end of file +var _0x593e=['start','dump','update','stop','Unknown\x20status','destroy','params','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','index','list','motion2','length','then','catch','show','describe','create','body','script','../../files/plugins','cwd','dirname','chdir'];(function(_0x295727,_0x135c70){var _0xcda60=function(_0x593e87){while(--_0x593e87){_0x295727['push'](_0x295727['shift']());}};_0xcda60(++_0x135c70);}(_0x593e,0xcb));var _0xe593=function(_0x575a6c,_0x524fb1){_0x575a6c=_0x575a6c-0x0;var _0x2408a8=_0x593e[_0x575a6c];return _0x2408a8;};'use strict';var _=require(_0xe593('0x0'));var pm2=require(_0xe593('0x1'));var logger=require(_0xe593('0x2'))(_0xe593('0x3'));var path=require(_0xe593('0x4'));var exec=require(_0xe593('0x5'))[_0xe593('0x6')];var BPromise=require(_0xe593('0x7'));function handleEntityNotFound(_0x550574,_0x8a87e8){return function(_0x2475f5){if(!_0x2475f5){_0x550574[_0xe593('0x8')](0x194);;}return _0x2475f5;};}function respondWithResult(_0x1e50d3,_0x3b7082){_0x3b7082=_0x3b7082||0xc8;return function(_0x14cff3){if(_0x14cff3){return _0x1e50d3[_0xe593('0x9')](_0x3b7082)[_0xe593('0xa')](_0x14cff3);}return null;};}function handleError(_0x169c08,_0x265099){_0x265099=_0x265099||0x1f4;return function(_0x51b862){logger[_0xe593('0xb')](_0x51b862[_0xe593('0xc')]);if(_0x51b862[_0xe593('0xd')]){delete _0x51b862['name'];}_0x169c08['status'](_0x265099)[_0xe593('0xe')](_0x51b862);};}function execChildProcess(){return new BPromise(function(_0xeefe30,_0xaa42f7){exec('npm\x20install',function(_0x6a5d4f,_0x6bc1b8,_0x137f0b){logger[_0xe593('0xf')](_0x6bc1b8);logger[_0xe593('0xf')](_0x137f0b);if(_0x6a5d4f){logger[_0xe593('0xb')](_0x6a5d4f);return _0xaa42f7(_0x6a5d4f);}return _0xeefe30(_0x6bc1b8);});});}exports[_0xe593('0x10')]=function(_0xa4d5e9,_0x328a5a){return pm2[_0xe593('0x11')]()['then'](function(_0x2907e4){if(_0x2907e4){var _0x1de391=_['reject'](_0x2907e4,function(_0x38418c){return _0x38418c[_0xe593('0xd')]==='express'||_0x38418c[_0xe593('0xd')]===_0xe593('0x12');});return{'rows':_0x1de391,'count':_0x1de391[_0xe593('0x13')]};}return null;})[_0xe593('0x14')](respondWithResult(_0x328a5a,null))[_0xe593('0x15')](handleError(_0x328a5a,null));};exports[_0xe593('0x16')]=function(_0x48f3b4,_0xfbc79f){return pm2[_0xe593('0x17')](_0x48f3b4['params']['id'])[_0xe593('0x14')](respondWithResult(_0xfbc79f,null))[_0xe593('0x14')](handleEntityNotFound(_0xfbc79f,null))['catch'](handleError(_0xfbc79f,null));};exports[_0xe593('0x18')]=function(_0x3dba1b,_0x862672){if(_0x3dba1b[_0xe593('0x19')][_0xe593('0xd')]&&_0x3dba1b[_0xe593('0x19')][_0xe593('0x1a')]){var _0x4ea53f=path['join'](__dirname,_0xe593('0x1b'),_0x3dba1b['body']['script']);var _0x1bb8e8=process[_0xe593('0x1c')]();process['chdir'](path[_0xe593('0x1d')](_0x4ea53f));return execChildProcess()['then'](function(_0x1672bf){process[_0xe593('0x1e')](_0x1bb8e8);return pm2[_0xe593('0x1f')]({'name':_0x3dba1b[_0xe593('0x19')][_0xe593('0xd')],'script':_0x4ea53f});})[_0xe593('0x14')](function(_0x20a098){pm2[_0xe593('0x20')]();return _0x20a098[0x0];})['then'](respondWithResult(_0x862672,0xc9))[_0xe593('0x15')](handleError(_0x862672,null));}else{return _0x862672[_0xe593('0x9')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xe593('0x21')]=function(_0x25238f,_0x21eefc){if(_0x25238f[_0xe593('0x19')]['id']){delete _0x25238f[_0xe593('0x19')]['id'];}var _0x27a3d2={'online':'restart','stopped':_0xe593('0x22')};if(_0x27a3d2['hasOwnProperty'](_0x25238f[_0xe593('0x19')][_0xe593('0x9')])){return pm2[_0x27a3d2[_0x25238f['body'][_0xe593('0x9')]]](_0x25238f['params']['id'])[_0xe593('0x14')](respondWithResult(_0x21eefc,0xc8))[_0xe593('0x15')](handleError(_0x21eefc,null));}else{return _0x21eefc[_0xe593('0x9')](0x1f4)['send']({'message':_0xe593('0x23')});}};exports[_0xe593('0x24')]=function(_0x3066ed,_0x338222){if(_0x3066ed[_0xe593('0x19')]['id']){delete _0x3066ed[_0xe593('0x19')]['id'];}if(_0x3066ed[_0xe593('0x25')]['id']){return pm2['delete'](_0x3066ed[_0xe593('0x25')]['id'])[_0xe593('0x14')](function(_0x4e8448){pm2[_0xe593('0x20')]();return _0x4e8448[0x0];})['then'](respondWithResult(_0x338222,null))[_0xe593('0x15')](handleError(_0x338222,null));}else{return _0x338222[_0xe593('0x9')](0x1f4)[_0xe593('0xe')]({'message':_0xe593('0x26')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index e745adb..265f0d9 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 _0xa99b=['../../components/auth/service','/queues','getQueues','exports','express'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa99b,0x1f3));var _0xba99=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xa99b[_0x50aa2e];return _0x5e07f0;};'use strict';var express=require(_0xba99('0x0'));var router=express['Router']();var auth=require(_0xba99('0x1'));var controller=require('./realtime.controller');router['get'](_0xba99('0x2'),auth['isAuthenticated'](),controller[_0xba99('0x3')]);module[_0xba99('0x4')]=router; \ No newline at end of file +var _0xe139=['exports','express','../../components/auth/service','./realtime.controller','get','isAuthenticated','getQueues'];(function(_0x14e379,_0x25e449){var _0x125a12=function(_0x384c9e){while(--_0x384c9e){_0x14e379['push'](_0x14e379['shift']());}};_0x125a12(++_0x25e449);}(_0xe139,0x1eb));var _0x9e13=function(_0x146198,_0x463681){_0x146198=_0x146198-0x0;var _0x585223=_0xe139[_0x146198];return _0x585223;};'use strict';var express=require(_0x9e13('0x0'));var router=express['Router']();var auth=require(_0x9e13('0x1'));var controller=require(_0x9e13('0x2'));router[_0x9e13('0x3')]('/queues',auth[_0x9e13('0x4')](),controller[_0x9e13('0x5')]);module[_0x9e13('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index bd8a85b..c20daa9 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 _0x4819=['get','loggedInDb','available','talking','agents','find','merge','pick','getAgents','online','getMembers','length','UserId','push','User','Pause','QueueId','agent','all','rows','catch','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','status','set','Content-Range','json','stack','name','send','getQueues','mail','sms','fax','whatsapp','voice','resolve','channel','includes','query','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','user','outbound','QueueCampaigns','Queues','UserProfile','findAndCountAll','then','count','request','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','waiting','paused','pTalking','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];(function(_0x306152,_0x5de087){var _0x58da64=function(_0x235c24){while(--_0x235c24){_0x306152['push'](_0x306152['shift']());}};_0x58da64(++_0x5de087);}(_0x4819,0xcd));var _0x9481=function(_0xe72729,_0x503951){_0xe72729=_0xe72729-0x0;var _0x3f679b=_0x4819[_0xe72729];return _0x3f679b;};'use strict';var util=require('util');var _=require(_0x9481('0x0'));var jayson=require(_0x9481('0x1'));var qs=require(_0x9481('0x2'));var logger=require(_0x9481('0x3'))(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var client=jayson[_0x9481('0x6')][_0x9481('0x7')]({'port':0x232a});var routingClient=jayson[_0x9481('0x6')][_0x9481('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x5ac51c,_0x4d9e3a){return function(_0x5def07){if(_0x5def07){var _0x54cc78=typeof _0x4d9e3a[_0x9481('0x8')]===_0x9481('0x9')&&typeof _0x4d9e3a[_0x9481('0xa')]===_0x9481('0x9');var _0x15d895=_0x5def07['count'];var _0x1818cf=_0x54cc78?0x0:_0x4d9e3a['offset'];var _0x2fabf1=_0x54cc78?_0x5def07['count']:_0x4d9e3a[_0x9481('0x8')]+_0x4d9e3a[_0x9481('0xa')];var _0x2d4d44;if(_0x2fabf1>=_0x15d895){_0x2fabf1=_0x15d895;_0x2d4d44=0xc8;}else{_0x2d4d44=0xce;}_0x5ac51c[_0x9481('0xb')](_0x2d4d44);return _0x5ac51c[_0x9481('0xc')](_0x9481('0xd'),_0x1818cf+'-'+_0x2fabf1+'/'+_0x15d895)[_0x9481('0xe')](_0x5def07);}return null;};}function handleError(_0xe410c3,_0xed8e9){_0xed8e9=_0xed8e9||0x1f4;return function(_0x499b87){logger['error'](_0x499b87[_0x9481('0xf')]);if(_0x499b87[_0x9481('0x10')]){delete _0x499b87[_0x9481('0x10')];}_0xe410c3[_0x9481('0xb')](_0xed8e9)[_0x9481('0x11')](_0x499b87);};}exports[_0x9481('0x12')]=function(_0x3fb97f,_0x495b30){var _0x4220f1=[_0x9481('0x13'),'chat',_0x9481('0x14'),'openchannel',_0x9481('0x15'),_0x9481('0x16'),_0x9481('0x17')];var _0x2bb2a4={'count':0x0,'rows':[]},_0x546fce={},_0x5eda66;Promise[_0x9481('0x18')]()['then'](function(){if(_0x3fb97f['query'][_0x9481('0x19')]){if(!_[_0x9481('0x1a')](_0x4220f1,_0x3fb97f[_0x9481('0x1b')][_0x9481('0x19')][_0x9481('0x1c')]()))throw new Error(_0x9481('0x1d'));_0x5eda66=_0x3fb97f['query'][_0x9481('0x19')][_0x9481('0x1c')]();}var _0x45f9df=_[_0x9481('0x1e')](_0x5eda66)+_0x9481('0x1f');var _0x56da97=_[_0x9481('0x20')](db[_0x45f9df][_0x9481('0x21')],function(_0x572599){return{'name':_0x572599[_0x9481('0x22')],'type':_0x572599[_0x9481('0x23')][_0x9481('0x24')]};});_0x546fce=qs[_0x9481('0x25')](_0x56da97,_0x3fb97f);if(_0x3fb97f[_0x9481('0x26')]['role']===_0x9481('0x26')){var _0x22f0b5={'params':{'id':_0x3fb97f['user']['userProfileId']},'query':{'section':_0x5eda66===_0x9481('0x17')&&_0x3fb97f[_0x9481('0x1b')]['type']===_0x9481('0x27')?_0x9481('0x28'):_[_0x9481('0x1e')](_0x5eda66)+_0x9481('0x29'),'type':_0x3fb97f['query'][_0x9481('0x23')],'nolimit':!![],'sort':_0x9481('0x10'),'filter':_0x3fb97f[_0x9481('0x1b')]['filter']}};return db[_0x9481('0x2a')]['getResources'](_0x22f0b5);}return db[_0x45f9df][_0x9481('0x2b')](_0x546fce);})[_0x9481('0x2c')](function(_0x22ab26){_0x2bb2a4[_0x9481('0x2d')]=_0x22ab26[_0x9481('0x2d')];var _0x53560d=_0x5eda66===_0x9481('0x17')?client:routingClient;return _0x53560d[_0x9481('0x2e')](_[_0x9481('0x1e')](_0x5eda66)+'Queues',_0x3fb97f)['then'](function(_0x1addc8){if(_0x1addc8[_0x9481('0x2f')])throw new Error(util[_0x9481('0x30')](_0x9481('0x31'),_0x5eda66));var _0x5d9926=_0x1addc8['result'];var _0x5e7d16=[_0x9481('0x32'),'available',_0x9481('0x33'),'talking',_0x9481('0x34')];if(_0x5eda66===_0x9481('0x17')&&_0x3fb97f[_0x9481('0x1b')][_0x9481('0x23')]===_0x9481('0x27')){_0x5e7d16['push'](_0x9481('0x35'),_0x9481('0x36'),_0x9481('0x37'),'dialActive',_0x9481('0x38'),_0x9481('0x39'),_0x9481('0x3a'),_0x9481('0x3b'),_0x9481('0x3c'),_0x9481('0x3d'),'erlangAbandonmentRate',_0x9481('0x3e'),'dialPredictiveInterval',_0x9481('0x3f'),_0x9481('0x40'),_0x9481('0x41'),_0x9481('0x42'),_0x9481('0x43'),_0x9481('0x44'),'predictiveIntervalDroppedCallsCallersExit',_0x9481('0x45'),_0x9481('0x46'));}var _0x4ed991=_0x22ab26['rows'][_0x9481('0x20')](function(_0x5ab28f){var _0x224b88=_0x5ab28f[_0x9481('0x47')]({'plain':!![]});_0x224b88[_0x9481('0x34')]=0x0;_0x224b88[_0x9481('0x48')]=0x0;_0x224b88['loggedIn']=0x0;_0x224b88[_0x9481('0x49')]=0x0;_0x224b88['paused']=0x0;_0x224b88[_0x9481('0x33')]=0x0;if(_0x5eda66==='voice'){_0x224b88[_0x9481('0x4a')]=0x0;if(_0x3fb97f['query'][_0x9481('0x23')]===_0x9481('0x27')){_0x224b88[_0x9481('0x35')]=0x0;_0x224b88[_0x9481('0x36')]=0x0;}}_0x224b88[_0x9481('0x4b')]=[];var _0x3b7998=_[_0x9481('0x4c')](_0x5d9926['rows'],['id',_0x224b88['id']]);if(_0x3b7998)_[_0x9481('0x4d')](_0x224b88,_[_0x9481('0x4e')](_0x3b7998,_0x5e7d16));if(_0x5eda66===_0x9481('0x17')){return _0x5ab28f[_0x9481('0x4f')]({'attributes':['id',_0x9481('0x10'),_0x9481('0x50')],'joinTableAttributes':[],'raw':!![]})[_0x9481('0x2c')](function(_0x4e081d){return _0x5ab28f[_0x9481('0x51')]({'raw':!![]})[_0x9481('0x2c')](function(_0x4b6fe0){for(var _0x704e81=0x0;_0x704e81<_0x4e081d[_0x9481('0x52')];_0x704e81++){var _0x1eee80=_[_0x9481('0x4c')](_0x4b6fe0,[_0x9481('0x53'),_0x4e081d[_0x704e81]['id']]);var _0x5a8ffd={'id':_0x4e081d[_0x704e81]['id'],'name':_0x4e081d[_0x704e81][_0x9481('0x10')],'online':Boolean(_0x4e081d[_0x704e81]['online']),'paused':_0x1eee80?Boolean(_0x1eee80[_0x9481('0x34')]):![]};if(_0x5a8ffd[_0x9481('0x50')])_0x224b88['loggedInDb']++;if(_0x5a8ffd['paused'])_0x224b88[_0x9481('0x34')]++;_0x224b88[_0x9481('0x4b')][_0x9481('0x54')](_0x5a8ffd);}return _0x224b88;});});}else{var _0x4c4caf=_0x9481('0x55')+_[_0x9481('0x1e')](_0x5eda66)+'Queue';var _0x59fc26=_0x5eda66+_0x9481('0x56');return db[_0x4c4caf]['findAll']({'where':{[_[_0x9481('0x1e')](_0x5eda66)+_0x9481('0x57')]:_0x5ab28f['id']},'raw':!![]})[_0x9481('0x2c')](function(_0xf0e5e1){return db[_0x9481('0x55')]['findAll']({'attributes':['id',_0x9481('0x10'),_0x9481('0x50'),_0x59fc26],'where':{'id':_['map'](_0xf0e5e1,_0x9481('0x53')),'role':_0x9481('0x58')},'raw':!![]});})[_0x9481('0x2c')](function(_0x349d09){for(var _0x4db2d3=0x0;_0x4db2d3<_0x349d09[_0x9481('0x52')];_0x4db2d3++){var _0x3a1bee={'id':_0x349d09[_0x4db2d3]['id'],'name':_0x349d09[_0x4db2d3][_0x9481('0x10')],'online':Boolean(_0x349d09[_0x4db2d3][_0x9481('0x50')]),'paused':Boolean(_0x349d09[_0x4db2d3][_0x59fc26])};if(_0x3a1bee['online'])_0x224b88[_0x9481('0x48')]++;if(_0x3a1bee['paused'])_0x224b88['paused']++;_0x224b88[_0x9481('0x4b')]['push'](_0x3a1bee);}return _0x224b88;});}});return Promise[_0x9481('0x59')](_0x4ed991);});})[_0x9481('0x2c')](function(_0x47f8b2){_0x2bb2a4[_0x9481('0x5a')]=_0x47f8b2;return _0x2bb2a4;})[_0x9481('0x2c')](respondWithFilteredResult(_0x495b30,_0x546fce))[_0x9481('0x5b')](handleError(_0x495b30,null));}; \ No newline at end of file +var _0xadb5=['api','client','http','offset','undefined','limit','count','status','set','json','error','stack','name','send','getQueues','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','query','includes','toLowerCase','Invalid\x20channel','channel','startCase','map','rawAttributes','fieldName','type','key','getOptions','role','user','userProfileId','QueueCampaigns','Queues','filter','UserProfile','getResources','request','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','waiting','paused','outbound','push','originated','message','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','rows','get','pTalking','merge','pick','getAgents','online','length','find','UserId','loggedInDb','agents','User','Queue','QueueId','agent','all','catch','lodash','../../components/parsers/qs','../../config/logger'];(function(_0x2dc965,_0x3f6a1e){var _0x2eb776=function(_0xc645e0){while(--_0xc645e0){_0x2dc965['push'](_0x2dc965['shift']());}};_0x2eb776(++_0x3f6a1e);}(_0xadb5,0xad));var _0x5adb=function(_0x1ac33a,_0x2cad11){_0x1ac33a=_0x1ac33a-0x0;var _0x2f7ecf=_0xadb5[_0x1ac33a];return _0x2f7ecf;};'use strict';var util=require('util');var _=require(_0x5adb('0x0'));var jayson=require('jayson/promise');var qs=require(_0x5adb('0x1'));var logger=require(_0x5adb('0x2'))(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var client=jayson[_0x5adb('0x4')][_0x5adb('0x5')]({'port':0x232a});var routingClient=jayson[_0x5adb('0x4')]['http']({'port':0x232c});function respondWithFilteredResult(_0x35a5d3,_0x168d89){return function(_0x3e2555){if(_0x3e2555){var _0x3213e8=typeof _0x168d89[_0x5adb('0x6')]===_0x5adb('0x7')&&typeof _0x168d89[_0x5adb('0x8')]===_0x5adb('0x7');var _0x41261c=_0x3e2555[_0x5adb('0x9')];var _0x34f59d=_0x3213e8?0x0:_0x168d89[_0x5adb('0x6')];var _0x129f5a=_0x3213e8?_0x3e2555[_0x5adb('0x9')]:_0x168d89['offset']+_0x168d89['limit'];var _0x1a8f66;if(_0x129f5a>=_0x41261c){_0x129f5a=_0x41261c;_0x1a8f66=0xc8;}else{_0x1a8f66=0xce;}_0x35a5d3[_0x5adb('0xa')](_0x1a8f66);return _0x35a5d3[_0x5adb('0xb')]('Content-Range',_0x34f59d+'-'+_0x129f5a+'/'+_0x41261c)[_0x5adb('0xc')](_0x3e2555);}return null;};}function handleError(_0x56012f,_0x2a0b70){_0x2a0b70=_0x2a0b70||0x1f4;return function(_0x5433bf){logger[_0x5adb('0xd')](_0x5433bf[_0x5adb('0xe')]);if(_0x5433bf[_0x5adb('0xf')]){delete _0x5433bf['name'];}_0x56012f[_0x5adb('0xa')](_0x2a0b70)[_0x5adb('0x10')](_0x5433bf);};}exports[_0x5adb('0x11')]=function(_0x5263ec,_0x2312de){var _0x518823=[_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),_0x5adb('0x18')];var _0x42f4c6={'count':0x0,'rows':[]},_0xb953a6={},_0x529b65;Promise[_0x5adb('0x19')]()['then'](function(){if(_0x5263ec[_0x5adb('0x1a')]['channel']){if(!_[_0x5adb('0x1b')](_0x518823,_0x5263ec['query']['channel'][_0x5adb('0x1c')]()))throw new Error(_0x5adb('0x1d'));_0x529b65=_0x5263ec[_0x5adb('0x1a')][_0x5adb('0x1e')][_0x5adb('0x1c')]();}var _0x5af69d=_[_0x5adb('0x1f')](_0x529b65)+'Queue';var _0x4e9f16=_[_0x5adb('0x20')](db[_0x5af69d][_0x5adb('0x21')],function(_0x1a38d3){return{'name':_0x1a38d3[_0x5adb('0x22')],'type':_0x1a38d3[_0x5adb('0x23')][_0x5adb('0x24')]};});_0xb953a6=qs[_0x5adb('0x25')](_0x4e9f16,_0x5263ec);if(_0x5263ec['user'][_0x5adb('0x26')]===_0x5adb('0x27')){var _0x3220cd={'params':{'id':_0x5263ec[_0x5adb('0x27')][_0x5adb('0x28')]},'query':{'section':_0x529b65==='voice'&&_0x5263ec[_0x5adb('0x1a')][_0x5adb('0x23')]==='outbound'?_0x5adb('0x29'):_[_0x5adb('0x1f')](_0x529b65)+_0x5adb('0x2a'),'type':_0x5263ec['query'][_0x5adb('0x23')],'nolimit':!![],'sort':_0x5adb('0xf'),'filter':_0x5263ec[_0x5adb('0x1a')][_0x5adb('0x2b')]}};return db[_0x5adb('0x2c')][_0x5adb('0x2d')](_0x3220cd);}return db[_0x5af69d]['findAndCountAll'](_0xb953a6);})['then'](function(_0x5d457e){_0x42f4c6[_0x5adb('0x9')]=_0x5d457e[_0x5adb('0x9')];var _0x60a672=_0x529b65===_0x5adb('0x18')?client:routingClient;return _0x60a672[_0x5adb('0x2e')](_['startCase'](_0x529b65)+_0x5adb('0x2a'),_0x5263ec)[_0x5adb('0x2f')](function(_0x372da1){if(_0x372da1[_0x5adb('0xd')])throw new Error(util[_0x5adb('0x30')](_0x5adb('0x31'),_0x529b65));var _0x28190d=_0x372da1[_0x5adb('0x32')];var _0x138bf6=[_0x5adb('0x33'),'available',_0x5adb('0x34'),'talking',_0x5adb('0x35')];if(_0x529b65===_0x5adb('0x18')&&_0x5263ec['query'][_0x5adb('0x23')]===_0x5adb('0x36')){_0x138bf6[_0x5adb('0x37')]('pTalking',_0x5adb('0x38'),_0x5adb('0x39'),'dialActive','dialMethod',_0x5adb('0x3a'),'startPredictive',_0x5adb('0x3b'),_0x5adb('0x3c'),_0x5adb('0x3d'),_0x5adb('0x3e'),_0x5adb('0x3f'),'dialPredictiveInterval',_0x5adb('0x40'),_0x5adb('0x41'),_0x5adb('0x42'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x5adb('0x43'),_0x5adb('0x44'),'predictiveIntervalAvgHoldtime',_0x5adb('0x45'));}var _0x4a4260=_0x5d457e[_0x5adb('0x46')]['map'](function(_0x11cb37){var _0x4d052f=_0x11cb37[_0x5adb('0x47')]({'plain':!![]});_0x4d052f[_0x5adb('0x35')]=0x0;_0x4d052f['loggedInDb']=0x0;_0x4d052f[_0x5adb('0x33')]=0x0;_0x4d052f['available']=0x0;_0x4d052f[_0x5adb('0x35')]=0x0;_0x4d052f[_0x5adb('0x34')]=0x0;if(_0x529b65===_0x5adb('0x18')){_0x4d052f['talking']=0x0;if(_0x5263ec[_0x5adb('0x1a')][_0x5adb('0x23')]===_0x5adb('0x36')){_0x4d052f[_0x5adb('0x48')]=0x0;_0x4d052f[_0x5adb('0x38')]=0x0;}}_0x4d052f['agents']=[];var _0x50fe99=_['find'](_0x28190d['rows'],['id',_0x4d052f['id']]);if(_0x50fe99)_[_0x5adb('0x49')](_0x4d052f,_[_0x5adb('0x4a')](_0x50fe99,_0x138bf6));if(_0x529b65===_0x5adb('0x18')){return _0x11cb37[_0x5adb('0x4b')]({'attributes':['id',_0x5adb('0xf'),_0x5adb('0x4c')],'joinTableAttributes':[],'raw':!![]})[_0x5adb('0x2f')](function(_0x3bf282){return _0x11cb37['getMembers']({'raw':!![]})['then'](function(_0x27dbb7){for(var _0x48eb26=0x0;_0x48eb26<_0x3bf282[_0x5adb('0x4d')];_0x48eb26++){var _0x3300ae=_[_0x5adb('0x4e')](_0x27dbb7,[_0x5adb('0x4f'),_0x3bf282[_0x48eb26]['id']]);var _0xdfecfd={'id':_0x3bf282[_0x48eb26]['id'],'name':_0x3bf282[_0x48eb26]['name'],'online':Boolean(_0x3bf282[_0x48eb26][_0x5adb('0x4c')]),'paused':_0x3300ae?Boolean(_0x3300ae[_0x5adb('0x35')]):![]};if(_0xdfecfd['online'])_0x4d052f[_0x5adb('0x50')]++;if(_0xdfecfd[_0x5adb('0x35')])_0x4d052f['paused']++;_0x4d052f[_0x5adb('0x51')][_0x5adb('0x37')](_0xdfecfd);}return _0x4d052f;});});}else{var _0x1d6bef=_0x5adb('0x52')+_[_0x5adb('0x1f')](_0x529b65)+_0x5adb('0x53');var _0x33ef58=_0x529b65+'Pause';return db[_0x1d6bef]['findAll']({'where':{[_[_0x5adb('0x1f')](_0x529b65)+_0x5adb('0x54')]:_0x11cb37['id']},'raw':!![]})[_0x5adb('0x2f')](function(_0xb79d85){return db['User']['findAll']({'attributes':['id',_0x5adb('0xf'),_0x5adb('0x4c'),_0x33ef58],'where':{'id':_[_0x5adb('0x20')](_0xb79d85,_0x5adb('0x4f')),'role':_0x5adb('0x55')},'raw':!![]});})['then'](function(_0x182cbc){for(var _0x437f52=0x0;_0x437f52<_0x182cbc['length'];_0x437f52++){var _0x7786c4={'id':_0x182cbc[_0x437f52]['id'],'name':_0x182cbc[_0x437f52][_0x5adb('0xf')],'online':Boolean(_0x182cbc[_0x437f52][_0x5adb('0x4c')]),'paused':Boolean(_0x182cbc[_0x437f52][_0x33ef58])};if(_0x7786c4[_0x5adb('0x4c')])_0x4d052f[_0x5adb('0x50')]++;if(_0x7786c4[_0x5adb('0x35')])_0x4d052f[_0x5adb('0x35')]++;_0x4d052f[_0x5adb('0x51')]['push'](_0x7786c4);}return _0x4d052f;});}});return Promise[_0x5adb('0x56')](_0x4a4260);});})['then'](function(_0x51bc49){_0x42f4c6['rows']=_0x51bc49;return _0x42f4c6;})[_0x5adb('0x2f')](respondWithFilteredResult(_0x2312de,_0xb953a6))[_0x5adb('0x57')](handleError(_0x2312de,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 5970448..a4a92f1 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x163713,_0xa069e8){var _0x48cec7=function(_0x13b738){while(--_0x13b738){_0x163713['push'](_0x163713['shift']());}};_0x48cec7(++_0xa069e8);}(_0x70e0,0x17b));var _0x070e=function(_0x41da7a,_0x82e1c1){_0x41da7a=_0x41da7a-0x0;var _0x2fd703=_0x70e0[_0x41da7a];return _0x2fd703;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x49d5c7,_0x3f77aa){var _0x2f1f5e=function(_0x58d445){while(--_0x58d445){_0x49d5c7['push'](_0x49d5c7['shift']());}};_0x2f1f5e(++_0x3f77aa);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 30f499a..0b930b3 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 _0xfafd=['exports','INTEGER','STRING','DATE'];(function(_0x477805,_0x4b6f9b){var _0x388fe8=function(_0xa72394){while(--_0xa72394){_0x477805['push'](_0x477805['shift']());}};_0x388fe8(++_0x4b6f9b);}(_0xfafd,0xcc));var _0xdfaf=function(_0xc333f7,_0x486184){_0xc333f7=_0xc333f7-0x0;var _0x40d5d7=_0xfafd[_0xc333f7];return _0x40d5d7;};'use strict';var Sequelize=require('sequelize');module[_0xdfaf('0x0')]={'state':{'type':Sequelize[_0xdfaf('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xdfaf('0x2')]},'scheduledat':{'type':Sequelize[_0xdfaf('0x3')]},'uniqueid':{'type':Sequelize[_0xdfaf('0x2')]},'starttime':{'type':Sequelize[_0xdfaf('0x3')]},'responsetime':{'type':Sequelize[_0xdfaf('0x3')]},'ringtime':{'type':Sequelize[_0xdfaf('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xdfaf('0x2')]},'campaigntype':{'type':Sequelize[_0xdfaf('0x2')]},'membername':{'type':Sequelize[_0xdfaf('0x2')]}}; \ No newline at end of file +var _0x0e17=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x404b9a,_0xca0480){var _0x30ba61=function(_0x1cdde1){while(--_0x1cdde1){_0x404b9a['push'](_0x404b9a['shift']());}};_0x30ba61(++_0xca0480);}(_0x0e17,0xd6));var _0x70e1=function(_0x54a9b0,_0x2cff5d){_0x54a9b0=_0x54a9b0-0x0;var _0x2f2b2b=_0x0e17[_0x54a9b0];return _0x2f2b2b;};'use strict';var Sequelize=require(_0x70e1('0x0'));module[_0x70e1('0x1')]={'state':{'type':Sequelize[_0x70e1('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x70e1('0x3')]},'scheduledat':{'type':Sequelize[_0x70e1('0x4')]},'uniqueid':{'type':Sequelize[_0x70e1('0x3')]},'starttime':{'type':Sequelize[_0x70e1('0x4')]},'responsetime':{'type':Sequelize[_0x70e1('0x4')]},'ringtime':{'type':Sequelize[_0x70e1('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x70e1('0x3')]},'campaigntype':{'type':Sequelize[_0x70e1('0x3')]},'membername':{'type':Sequelize[_0x70e1('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b750d2e..3dc3921 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 _0xc2ec=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0xc2ec,0x96));var _0xcc2e=function(_0x403863,_0x39bdf2){_0x403863=_0x403863-0x0;var _0x2c145d=_0xc2ec[_0x403863];return _0x2c145d;};'use strict';var _=require(_0xcc2e('0x0'));var util=require(_0xcc2e('0x1'));var logger=require(_0xcc2e('0x2'))(_0xcc2e('0x3'));var moment=require(_0xcc2e('0x4'));var BPromise=require(_0xcc2e('0x5'));var rp=require(_0xcc2e('0x6'));var fs=require('fs');var path=require(_0xcc2e('0x7'));var rimraf=require(_0xcc2e('0x8'));var config=require(_0xcc2e('0x9'));var attributes=require(_0xcc2e('0xa'));module[_0xcc2e('0xb')]=function(_0x559910,_0x2ad432){return _0x559910[_0xcc2e('0xc')](_0xcc2e('0xd'),attributes,{'tableName':_0xcc2e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x001a=['../../config/environment','./reportAgentPreview.attributes','define','lodash','util','request-promise','path','rimraf'];(function(_0x125543,_0x57239f){var _0x79d366=function(_0x50846f){while(--_0x50846f){_0x125543['push'](_0x125543['shift']());}};_0x79d366(++_0x57239f);}(_0x001a,0x18b));var _0xa001=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x001a[_0x599e60];return _0x468e19;};'use strict';var _=require(_0xa001('0x0'));var util=require(_0xa001('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa001('0x2'));var fs=require('fs');var path=require(_0xa001('0x3'));var rimraf=require(_0xa001('0x4'));var config=require(_0xa001('0x5'));var attributes=require(_0xa001('0x6'));module['exports']=function(_0x429d50,_0x3f3abc){return _0x429d50[_0xa001('0x7')]('ReportAgentPreview',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 c67d189..26f1642 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 _0x1699=['code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','options','raw','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x1699,0x1ef));var _0x9169=function(_0x28eedc,_0x176917){_0x28eedc=_0x28eedc-0x0;var _0x575e59=_0x1699[_0x28eedc];return _0x575e59;};'use strict';var _=require(_0x9169('0x0'));var util=require(_0x9169('0x1'));var moment=require('moment');var BPromise=require(_0x9169('0x2'));var rs=require(_0x9169('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9169('0x4'))['db'];var utils=require(_0x9169('0x5'));var logger=require(_0x9169('0x6'))(_0x9169('0x7'));var config=require(_0x9169('0x8'));var jayson=require(_0x9169('0x9'));var client=jayson[_0x9169('0xa')][_0x9169('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x138014,_0x452d5d,_0x692104){return new BPromise(function(_0x462c09,_0x47597d){return client['request'](_0x138014,_0x692104)[_0x9169('0xc')](function(_0x595ab3){logger[_0x9169('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x452d5d,'request\x20sent');logger[_0x9169('0xe')](_0x9169('0xf'),_0x452d5d,_0x9169('0x10'),JSON['stringify'](_0x595ab3));if(_0x595ab3[_0x9169('0x11')]){if(_0x595ab3['error'][_0x9169('0x12')]===0x1f4){logger[_0x9169('0x11')](_0x9169('0x13'),_0x452d5d,_0x595ab3[_0x9169('0x11')][_0x9169('0x14')]);return _0x47597d(_0x595ab3[_0x9169('0x11')]['message']);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x452d5d,_0x595ab3['error'][_0x9169('0x14')]);return _0x462c09(_0x595ab3[_0x9169('0x11')]['message']);}else{logger[_0x9169('0xd')](_0x9169('0x13'),_0x452d5d,_0x9169('0x10'));_0x462c09(_0x595ab3[_0x9169('0x15')][_0x9169('0x14')]);}})[_0x9169('0x16')](function(_0x3101ae){logger[_0x9169('0x11')](_0x9169('0x13'),_0x452d5d,_0x3101ae);_0x47597d(_0x3101ae);});});}exports[_0x9169('0x17')]=function(_0x3b0f21){var _0x112c43=this;return new Promise(function(_0x39b0a3,_0x4752ae){return db['ReportAgentPreview']['create'](_0x3b0f21['body'],{'raw':_0x3b0f21[_0x9169('0x18')]?_0x3b0f21[_0x9169('0x18')][_0x9169('0x19')]===undefined?!![]:![]:!![]})[_0x9169('0xc')](function(_0xc97e69){logger[_0x9169('0xd')](_0x9169('0x17'),_0x3b0f21);logger[_0x9169('0xe')](_0x9169('0x17'),_0x3b0f21,JSON[_0x9169('0x1a')](_0xc97e69));_0x39b0a3(_0xc97e69);})[_0x9169('0x16')](function(_0x196ce1){logger[_0x9169('0x11')](_0x9169('0x17'),_0x196ce1['message'],_0x3b0f21);_0x4752ae(_0x112c43[_0x9169('0x11')](0x1f4,_0x196ce1[_0x9169('0x14')]));});});}; \ No newline at end of file +var _0x1fea=['info','debug','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','then','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x1fea,0x121));var _0xa1fe=function(_0x28f589,_0x284181){_0x28f589=_0x28f589-0x0;var _0xf5db5c=_0x1fea[_0x28f589];return _0xf5db5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa1fe('0x0'));var rs=require(_0xa1fe('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1fe('0x2'))['db'];var utils=require(_0xa1fe('0x3'));var logger=require(_0xa1fe('0x4'))(_0xa1fe('0x5'));var config=require(_0xa1fe('0x6'));var jayson=require(_0xa1fe('0x7'));var client=jayson[_0xa1fe('0x8')][_0xa1fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42a60b,_0x49d36b,_0x32db00){return new BPromise(function(_0x3e1af3,_0x276c91){return client[_0xa1fe('0xa')](_0x42a60b,_0x32db00)['then'](function(_0x2d6234){logger[_0xa1fe('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x49d36b,'request\x20sent');logger[_0xa1fe('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x49d36b,'request\x20sent',JSON[_0xa1fe('0xd')](_0x2d6234));if(_0x2d6234[_0xa1fe('0xe')]){if(_0x2d6234[_0xa1fe('0xe')][_0xa1fe('0xf')]===0x1f4){logger['error'](_0xa1fe('0x10'),_0x49d36b,_0x2d6234[_0xa1fe('0xe')]['message']);return _0x276c91(_0x2d6234[_0xa1fe('0xe')][_0xa1fe('0x11')]);}logger[_0xa1fe('0xe')](_0xa1fe('0x10'),_0x49d36b,_0x2d6234[_0xa1fe('0xe')][_0xa1fe('0x11')]);return _0x3e1af3(_0x2d6234['error'][_0xa1fe('0x11')]);}else{logger['info'](_0xa1fe('0x10'),_0x49d36b,'request\x20sent');_0x3e1af3(_0x2d6234[_0xa1fe('0x12')][_0xa1fe('0x11')]);}})[_0xa1fe('0x13')](function(_0x2a19b5){logger['error'](_0xa1fe('0x10'),_0x49d36b,_0x2a19b5);_0x276c91(_0x2a19b5);});});}exports[_0xa1fe('0x14')]=function(_0x5aa842){var _0x1a1f0a=this;return new Promise(function(_0x164744,_0x33361f){return db[_0xa1fe('0x15')]['create'](_0x5aa842[_0xa1fe('0x16')],{'raw':_0x5aa842[_0xa1fe('0x17')]?_0x5aa842[_0xa1fe('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xa1fe('0x18')](function(_0x5206a0){logger['info'](_0xa1fe('0x14'),_0x5aa842);logger['debug'](_0xa1fe('0x14'),_0x5aa842,JSON['stringify'](_0x5206a0));_0x164744(_0x5206a0);})[_0xa1fe('0x13')](function(_0x76cb0b){logger[_0xa1fe('0xe')](_0xa1fe('0x14'),_0x76cb0b['message'],_0x5aa842);_0x33361f(_0x1a1f0a['error'](0x1f4,_0x76cb0b[_0xa1fe('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1aea8db..e28f6b2 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 _0x6b9d=['/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','chat','showChatQueues','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','agentCapacity','/telephones','telephones'];(function(_0x58fe73,_0x27d710){var _0x3cf05a=function(_0x57a2fb){while(--_0x57a2fb){_0x58fe73['push'](_0x58fe73['shift']());}};_0x3cf05a(++_0x27d710);}(_0x6b9d,0x1e4));var _0xd6b9=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x6b9d[_0x4a0e68];return _0x4fb274;};'use strict';var multer=require(_0xd6b9('0x0'));var util=require(_0xd6b9('0x1'));var path=require(_0xd6b9('0x2'));var express=require(_0xd6b9('0x3'));var router=express[_0xd6b9('0x4')]();var auth=require(_0xd6b9('0x5'));var controller=require(_0xd6b9('0x6'));router[_0xd6b9('0x7')](_0xd6b9('0x8'),auth[_0xd6b9('0x9')](),controller['voiceChannels']);router[_0xd6b9('0x7')](_0xd6b9('0xa'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0xb')]);router[_0xd6b9('0x7')](_0xd6b9('0xc'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0xd')]);router[_0xd6b9('0x7')](_0xd6b9('0xe'),auth[_0xd6b9('0x9')](),controller['voiceQueues']);router[_0xd6b9('0x7')]('/chat/queues',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0xf')]);router['get'](_0xd6b9('0x10'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x11')]);router[_0xd6b9('0x7')]('/mail/accounts',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x12')]);router[_0xd6b9('0x7')](_0xd6b9('0x13'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x14')]);router['get']('/sms/queues',auth['isAuthenticated'](),controller[_0xd6b9('0x15')]);router[_0xd6b9('0x7')](_0xd6b9('0x16'),auth['isAuthenticated'](),controller[_0xd6b9('0x17')]);router[_0xd6b9('0x7')](_0xd6b9('0x18'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x19')]);router['get']('/voice/queues/preview/:id',auth[_0xd6b9('0x9')](),controller['voiceQueuesPreview']);router[_0xd6b9('0x7')](_0xd6b9('0x1a'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x1b')]);router[_0xd6b9('0x7')]('/voice/queues/channels/:uniqueid',auth[_0xd6b9('0x9')](),controller['voiceQueuesChannel']);router[_0xd6b9('0x7')](_0xd6b9('0x1c'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x1d')]);router[_0xd6b9('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xd6b9('0x9')](),controller['voiceQueuesChannelRedirect']);router[_0xd6b9('0x7')](_0xd6b9('0x1e'),auth[_0xd6b9('0x9')](),controller['showVoiceQueues']);router[_0xd6b9('0x1f')](_0xd6b9('0x1e'),auth['isAuthenticated'](),controller[_0xd6b9('0x20')]);router[_0xd6b9('0x7')](_0xd6b9('0x21'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x22')]);router[_0xd6b9('0x7')](_0xd6b9('0x23'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x24')]);router[_0xd6b9('0x7')]('/agents',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x25')]);router[_0xd6b9('0x1f')]('/agents/:id/capacity',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x26')]);router[_0xd6b9('0x7')](_0xd6b9('0x27'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x28')]);router['get'](_0xd6b9('0x29'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x2a')]);router[_0xd6b9('0x7')](_0xd6b9('0x2b'),auth['isAuthenticated'](),controller[_0xd6b9('0x2c')]);router[_0xd6b9('0x7')](_0xd6b9('0x2d'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x2e')]);router[_0xd6b9('0x7')]('/chat/queues/waitinginteractions',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x2f')]);router[_0xd6b9('0x7')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0xd6b9('0x7')](_0xd6b9('0x30'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x31')]);router[_0xd6b9('0x7')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xd6b9('0x32')]);router['get'](_0xd6b9('0x33'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x34')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x35')]);router[_0xd6b9('0x7')](_0xd6b9('0x36'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x37')]);router['post'](_0xd6b9('0x38'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x39')](_0xd6b9('0x3a')));router[_0xd6b9('0x7')](_0xd6b9('0x3b'),auth['isAuthenticated'](),controller[_0xd6b9('0x3c')]);router[_0xd6b9('0x3d')]('/chat/queues/:id/notify',auth[_0xd6b9('0x9')](),controller['queueNotify'](_0xd6b9('0x3e')));router['get']('/chat/queues/:id',auth['isAuthenticated'](),controller[_0xd6b9('0x3f')]);router[_0xd6b9('0x3d')]('/fax/queues/:id/notify',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x39')]('fax'));router[_0xd6b9('0x7')]('/fax/queues/:id',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x40')]);router[_0xd6b9('0x3d')](_0xd6b9('0x41'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x39')](_0xd6b9('0x42')));router[_0xd6b9('0x7')](_0xd6b9('0x43'),auth[_0xd6b9('0x9')](),controller['showOpenchannelQueues']);router[_0xd6b9('0x3d')]('/sms/queues/:id/notify',auth[_0xd6b9('0x9')](),controller['queueNotify']('sms'));router[_0xd6b9('0x3d')](_0xd6b9('0x44'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x39')](_0xd6b9('0x45')));router['get'](_0xd6b9('0x46'),auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x47')]);router[_0xd6b9('0x7')]('/whatsapp/queues/:id',auth[_0xd6b9('0x9')](),controller[_0xd6b9('0x48')]);router[_0xd6b9('0x3d')](_0xd6b9('0x49'),auth['isAuthenticated'](),controller[_0xd6b9('0x4a')]);module['exports']=router; \ No newline at end of file +var _0xeea5=['telephones','/trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','post','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity'];(function(_0x381956,_0x21e776){var _0x105c38=function(_0x4441e7){while(--_0x4441e7){_0x381956['push'](_0x381956['shift']());}};_0x105c38(++_0x21e776);}(_0xeea5,0x1b0));var _0x5eea=function(_0x28d1b3,_0x49280a){_0x28d1b3=_0x28d1b3-0x0;var _0x12d19b=_0xeea5[_0x28d1b3];return _0x12d19b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5eea('0x0'));var express=require(_0x5eea('0x1'));var router=express[_0x5eea('0x2')]();var auth=require(_0x5eea('0x3'));var controller=require(_0x5eea('0x4'));router[_0x5eea('0x5')](_0x5eea('0x6'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0x5eea('0x5')](_0x5eea('0x7'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x9')]);router['get'](_0x5eea('0xa'),auth[_0x5eea('0x8')](),controller[_0x5eea('0xb')]);router[_0x5eea('0x5')](_0x5eea('0xc'),auth['isAuthenticated'](),controller[_0x5eea('0xd')]);router[_0x5eea('0x5')]('/chat/queues',auth[_0x5eea('0x8')](),controller[_0x5eea('0xe')]);router[_0x5eea('0x5')]('/mail/queues',auth[_0x5eea('0x8')](),controller[_0x5eea('0xf')]);router[_0x5eea('0x5')](_0x5eea('0x10'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x11')]);router[_0x5eea('0x5')](_0x5eea('0x12'),auth[_0x5eea('0x8')](),controller['openchannelQueues']);router['get'](_0x5eea('0x13'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x14')]);router[_0x5eea('0x5')](_0x5eea('0x15'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0x5eea('0x16')]);router[_0x5eea('0x5')](_0x5eea('0x17'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x18')]);router[_0x5eea('0x5')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x5eea('0x19')]);router[_0x5eea('0x5')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x5eea('0x1a')]);router[_0x5eea('0x5')](_0x5eea('0x1b'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x1c')]);router[_0x5eea('0x5')](_0x5eea('0x1d'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x1e')]);router['get'](_0x5eea('0x1f'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x20')]);router['put'](_0x5eea('0x1f'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x21')]);router[_0x5eea('0x5')](_0x5eea('0x22'),auth['isAuthenticated'](),controller[_0x5eea('0x23')]);router[_0x5eea('0x5')](_0x5eea('0x24'),auth['isAuthenticated'](),controller[_0x5eea('0x25')]);router['get'](_0x5eea('0x26'),auth[_0x5eea('0x8')](),controller['agents']);router[_0x5eea('0x27')](_0x5eea('0x28'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x29')]);router[_0x5eea('0x5')]('/telephones',auth[_0x5eea('0x8')](),controller[_0x5eea('0x2a')]);router[_0x5eea('0x5')](_0x5eea('0x2b'),auth[_0x5eea('0x8')](),controller['trunks']);router[_0x5eea('0x5')](_0x5eea('0x2c'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x2d')]);router[_0x5eea('0x5')](_0x5eea('0x2e'),auth[_0x5eea('0x8')](),controller['faxAccounts']);router[_0x5eea('0x5')](_0x5eea('0x2f'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x30')]);router[_0x5eea('0x5')](_0x5eea('0x31'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x32')]);router[_0x5eea('0x5')](_0x5eea('0x33'),auth['isAuthenticated'](),controller[_0x5eea('0x34')]);router['get'](_0x5eea('0x35'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x36')]);router[_0x5eea('0x5')](_0x5eea('0x37'),auth[_0x5eea('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0x5eea('0x5')](_0x5eea('0x38'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x5eea('0x5')](_0x5eea('0x39'),auth['isAuthenticated'](),controller[_0x5eea('0x3a')]);router['post']('/mail/queues/:id/notify',auth[_0x5eea('0x8')](),controller[_0x5eea('0x3b')]('mail'));router[_0x5eea('0x5')](_0x5eea('0x3c'),auth['isAuthenticated'](),controller[_0x5eea('0x3d')]);router['post'](_0x5eea('0x3e'),auth['isAuthenticated'](),controller[_0x5eea('0x3b')]('chat'));router[_0x5eea('0x5')](_0x5eea('0x3f'),auth[_0x5eea('0x8')](),controller['showChatQueues']);router[_0x5eea('0x40')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x5eea('0x3b')](_0x5eea('0x41')));router[_0x5eea('0x5')](_0x5eea('0x42'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x43')]);router[_0x5eea('0x40')](_0x5eea('0x44'),auth['isAuthenticated'](),controller['queueNotify']('openchannel'));router['get'](_0x5eea('0x45'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x5eea('0x40')]('/sms/queues/:id/notify',auth[_0x5eea('0x8')](),controller['queueNotify'](_0x5eea('0x46')));router[_0x5eea('0x40')](_0x5eea('0x47'),auth[_0x5eea('0x8')](),controller['queueNotify'](_0x5eea('0x48')));router[_0x5eea('0x5')](_0x5eea('0x49'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x4a')]);router['get'](_0x5eea('0x4b'),auth[_0x5eea('0x8')](),controller['showWhatsappQueues']);router[_0x5eea('0x40')](_0x5eea('0x4c'),auth[_0x5eea('0x8')](),controller[_0x5eea('0x4d')]);module[_0x5eea('0x4e')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index f30989e..5b2d4b6 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 _0x8958=['faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','TransferReport','create','agentNotify','channel','Agent\x20not\x20found','Message','Start','agentTransferTimeout','*,*,*,*','moment','api','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','interaction','MemberReport','findAll','user','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions'];(function(_0x35377c,_0x2089bf){var _0x48b229=function(_0x21cbc4){while(--_0x21cbc4){_0x35377c['push'](_0x35377c['shift']());}};_0x48b229(++_0x2089bf);}(_0x8958,0x93));var _0x8895=function(_0x14bb26,_0x338a81){_0x14bb26=_0x14bb26-0x0;var _0x7c0e19=_0x8958[_0x14bb26];return _0x7c0e19;};'use strict';var BPromise=require('bluebird');var moment=require(_0x8895('0x0'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x8895('0x1'));var jayson=require('jayson/promise');var amiClient=jayson[_0x8895('0x2')][_0x8895('0x3')]({'port':0x232a});var mailClient=jayson[_0x8895('0x2')]['http']({'port':0x232b});var routingClient=jayson[_0x8895('0x2')][_0x8895('0x3')]({'port':0x232c});function respondWithRpcPromise(_0x124e1e,_0x40cec6,_0x33013a){return new BPromise(function(_0x51376b,_0xe018b8){var _0xc2be9f=_0x33013a?_0x33013a:amiClient;return _0xc2be9f[_0x8895('0x4')](_0x124e1e,_0x40cec6)[_0x8895('0x5')](function(_0x6eab1e){if(_0x6eab1e[_0x8895('0x6')]){if(_0x6eab1e[_0x8895('0x6')][_0x8895('0x7')]===0x1f4){return _0xe018b8(_0x6eab1e[_0x8895('0x6')][_0x8895('0x8')]);}return _0x51376b(_0x6eab1e['error'][_0x8895('0x8')]);}else{_0x51376b(_0x6eab1e[_0x8895('0x9')]);}})[_0x8895('0xa')](function(_0x301bec){_0xe018b8(_0x301bec);});});}function respondWithResult(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xc8;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0xb')](_0xaf93bc)[_0x8895('0xc')](_0x5af0ef);}return _0x446e1a[_0x8895('0xd')](0x194);};}function handleError(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0x1f4;return function(_0x9191b8){logger['error'](_0x9191b8[_0x8895('0xe')]);if(_0x9191b8[_0x8895('0xf')]){delete _0x9191b8[_0x8895('0xf')];}_0x57d40a[_0x8895('0xb')](_0x47b9fe)[_0x8895('0x10')](_0x9191b8);};}function findById(_0x5b4c2e){return function(_0x4128e2){if(!_[_0x8895('0x11')](_0x5b4c2e)&&!_[_0x8895('0x11')](_0x4128e2)&&!_[_0x8895('0x11')](_0x4128e2[_0x8895('0x12')])){return _[_0x8895('0x13')](_0x4128e2[_0x8895('0x12')],function(_0x26cee0){return _0x26cee0['id']==_0x5b4c2e;});}return null;};}exports[_0x8895('0x14')]=function(_0x2da618,_0x24fef0){return respondWithRpcPromise(_0x8895('0x15'),_0x2da618[_0x8895('0x16')])['then'](respondWithResult(_0x24fef0,null))['catch'](handleError(_0x24fef0,null));};exports['voiceChannelMixMonitor']=function(_0x3daf43,_0x456282){return respondWithRpcPromise(_0x8895('0x17'),_[_0x8895('0x18')](_0x3daf43[_0x8895('0x16')],_0x3daf43[_0x8895('0x19')]))[_0x8895('0x5')](respondWithResult(_0x456282,null))[_0x8895('0xa')](handleError(_0x456282,null));};exports['voiceChannelStopMixMonitor']=function(_0x1a4c5b,_0x5db3a0){return respondWithRpcPromise(_0x8895('0x1a'),_[_0x8895('0x18')](_0x1a4c5b[_0x8895('0x16')],_0x1a4c5b['params']))['then'](respondWithResult(_0x5db3a0,null))[_0x8895('0xa')](handleError(_0x5db3a0,null));};exports[_0x8895('0x1b')]=function(_0x38f7ad,_0x24a376){return respondWithRpcPromise('VoiceQueues',_0x38f7ad[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x24a376,null))[_0x8895('0xa')](handleError(_0x24a376,null));};exports['showVoiceQueues']=function(_0x4aee03,_0x78b57){return respondWithRpcPromise('VoiceQueues',_0x4aee03[_0x8895('0x16')])[_0x8895('0x5')](findById(_0x4aee03[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x78b57,null))[_0x8895('0xa')](handleError(_0x78b57,null));};exports['updateVoiceQueue']=function(_0x4d567a,_0x6e449d){return respondWithRpcPromise(_0x8895('0x1c'),_[_0x8895('0x18')](_0x4d567a[_0x8895('0x1d')],_0x4d567a[_0x8895('0x19')]))['then'](respondWithResult(_0x6e449d,null))['catch'](handleError(_0x6e449d,null));};exports[_0x8895('0x1e')]=function(_0x848a11,_0x1c16f6){return respondWithRpcPromise(_0x8895('0x1f'),_[_0x8895('0x18')](_0x848a11['query'],_0x848a11[_0x8895('0x19')]))['then'](respondWithResult(_0x1c16f6,null))[_0x8895('0xa')](handleError(_0x1c16f6,null));};exports['voiceQueuesChannels']=function(_0x40ba14,_0x1a3fe5){return respondWithRpcPromise(_0x8895('0x20'),_0x40ba14[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x1a3fe5,null))['catch'](handleError(_0x1a3fe5,null));};exports[_0x8895('0x21')]=function(_0xcba076,_0x1b5359){return respondWithRpcPromise(_0x8895('0x22'),_[_0x8895('0x18')](_0xcba076['query'],_0xcba076[_0x8895('0x19')]))['then'](respondWithResult(_0x1b5359,null))[_0x8895('0xa')](handleError(_0x1b5359,null));};exports['voiceQueuesChannelHangup']=function(_0x21c22b,_0x15a865){return respondWithRpcPromise(_0x8895('0x23'),_[_0x8895('0x18')](_0x21c22b[_0x8895('0x16')],_0x21c22b['params']))[_0x8895('0x5')](respondWithResult(_0x15a865,null))['catch'](handleError(_0x15a865,null));};exports[_0x8895('0x24')]=function(_0xcc735f,_0x36e13b){return respondWithRpcPromise(_0x8895('0x25'),_[_0x8895('0x18')](_0xcc735f[_0x8895('0x16')],_0xcc735f['params']))[_0x8895('0x5')](respondWithResult(_0x36e13b,null))[_0x8895('0xa')](handleError(_0x36e13b,null));};exports['outbound']=function(_0x2557fc,_0x54ca09){return respondWithRpcPromise(_0x8895('0x26'),_0x2557fc[_0x8895('0x16')])['then'](respondWithResult(_0x54ca09,null))[_0x8895('0xa')](handleError(_0x54ca09,null));};exports[_0x8895('0x27')]=function(_0x5b7204,_0x58751a){return respondWithRpcPromise(_0x8895('0x28'),_0x5b7204[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x58751a,null))[_0x8895('0xa')](handleError(_0x58751a,null));};exports[_0x8895('0x29')]=function(_0x4917d1,_0x42ed1f){var _0x25c854;return respondWithRpcPromise(_0x8895('0x2a'),_0x4917d1[_0x8895('0x16')])[_0x8895('0x5')](function(_0x534876){_0x25c854=_0x534876;return respondWithRpcPromise('Agents',_0x4917d1[_0x8895('0x16')],routingClient);})['then'](function(_0x20a521){return _[_0x8895('0x18')]({},_0x20a521,_0x25c854);})['then'](respondWithResult(_0x42ed1f,null))[_0x8895('0xa')](handleError(_0x42ed1f,null));};exports['agentCapacity']=function(_0x1e6395,_0x5e6413){if(_0x1e6395['body']&&_0x1e6395['body']['interaction']&&_0x1e6395['user']&&_0x1e6395['user'][_0x8895('0xf')]){for(var _0x206f57 in _0x1e6395['body']['interaction']){if(_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')]['hasOwnProperty'](_0x206f57)){db[_0x8895('0x2c')][_0x8895('0x2d')]({'where':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')][_0x8895('0xf')],'type':_0x8895('0x2f'),'exitAt':null,'uniqueid':_0x1e6395['body']['interaction'][_0x206f57]&&_0x1e6395['body'][_0x8895('0x2b')][_0x206f57]['length']?{'$notIn':_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')][_0x206f57]}:{'$ne':null}}})[_0x8895('0x5')](function(_0x28aaa9){var _0x587ccb=moment()[_0x8895('0x30')](_0x8895('0x31'));for(var _0x3413cd=0x0,_0x167302=_0x28aaa9[_0x8895('0x32')];_0x3413cd<_0x167302;_0x3413cd+=0x1){_0x28aaa9[_0x3413cd][_0x8895('0x33')]({'exitAt':_0x587ccb});}});for(var _0x14295a=0x0;_0x14295a<_0x1e6395[_0x8895('0x1d')]['interaction'][_0x206f57][_0x8895('0x32')];_0x14295a+=0x1){db[_0x8895('0x2c')]['findOrCreate']({'where':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')]['name'],'type':'INTERACTION','uniqueid':_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')][_0x206f57][_0x14295a],'exitAt':null},'defaults':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')]['name'],'interface':_[_0x8895('0x11')](_0x1e6395['user'][_0x8895('0x34')])?util[_0x8895('0x30')](_0x8895('0x35'),_0x1e6395[_0x8895('0x2e')][_0x8895('0xf')]):_0x1e6395[_0x8895('0x2e')][_0x8895('0x34')],'type':'INTERACTION','enterAt':moment()['format'](_0x8895('0x31')),'role':_0x8895('0x36'),'internal':_0x1e6395['user'][_0x8895('0x37')],'uniqueid':_0x1e6395['body']['interaction'][_0x206f57][_0x14295a]}});}}}}return respondWithRpcPromise(_0x8895('0x38'),{'id':_0x1e6395['params']['id'],'capacity':_0x1e6395[_0x8895('0x1d')][_0x8895('0x39')]},routingClient)[_0x8895('0x5')](respondWithResult(_0x5e6413,null))[_0x8895('0xa')](handleError(_0x5e6413,null));};exports[_0x8895('0x3a')]=function(_0x39a1d9,_0x306481){return respondWithRpcPromise(_0x8895('0x3b'),_0x39a1d9['query'])[_0x8895('0x5')](respondWithResult(_0x306481,null))[_0x8895('0xa')](handleError(_0x306481,null));};exports[_0x8895('0x3c')]=function(_0x5a5bc6,_0x1935aa){return respondWithRpcPromise(_0x8895('0x3d'),_0x5a5bc6[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x1935aa,null))[_0x8895('0xa')](handleError(_0x1935aa,null));};exports[_0x8895('0x3e')]=function(_0x434ab8,_0x216e6e){return respondWithRpcPromise(_0x8895('0x3f'),_0x434ab8[_0x8895('0x16')])['then'](respondWithResult(_0x216e6e,null))[_0x8895('0xa')](handleError(_0x216e6e,null));};exports[_0x8895('0x40')]=function(_0xb3d1ab,_0x10560a){return respondWithRpcPromise(_0x8895('0x41'),_0xb3d1ab['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x10560a,null))[_0x8895('0xa')](handleError(_0x10560a,null));};exports[_0x8895('0x42')]=function(_0x3d17bd,_0x37a7b4){return respondWithRpcPromise('ChatQueues',_0x3d17bd[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x3d17bd[_0x8895('0x19')]['id']))['then'](respondWithResult(_0x37a7b4,null))[_0x8895('0xa')](handleError(_0x37a7b4,null));};exports[_0x8895('0x43')]=function(_0x2c777b,_0x4ec8eb){return respondWithRpcPromise(_0x8895('0x44'),_0x2c777b[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x4ec8eb,null))[_0x8895('0xa')](handleError(_0x4ec8eb,null));};exports[_0x8895('0x45')]=function(_0x5198f8,_0x2f990a){return respondWithRpcPromise(_0x8895('0x44'),_0x5198f8[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x5198f8['params']['id']))['then'](respondWithResult(_0x2f990a,null))[_0x8895('0xa')](handleError(_0x2f990a,null));};exports[_0x8895('0x46')]=function(_0x49877,_0x51eb9c){return respondWithRpcPromise(_0x8895('0x47'),_0x49877[_0x8895('0x16')],mailClient)['then'](respondWithResult(_0x51eb9c,null))[_0x8895('0xa')](handleError(_0x51eb9c,null));};exports['openchannelQueues']=function(_0x435e36,_0x2bd955){return respondWithRpcPromise(_0x8895('0x48'),_0x435e36[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x2bd955,null))['catch'](handleError(_0x2bd955,null));};exports['showOpenchannelQueues']=function(_0x239401,_0x216abb){return respondWithRpcPromise('OpenchannelQueues',_0x239401[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x239401[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x216abb,null))['catch'](handleError(_0x216abb,null));};exports[_0x8895('0x49')]=function(_0x2d2bf9,_0x1b1bc0){return respondWithRpcPromise(_0x8895('0x4a'),_0x2d2bf9[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x1b1bc0,null))[_0x8895('0xa')](handleError(_0x1b1bc0,null));};exports[_0x8895('0x4b')]=function(_0x2bffd7,_0x21c7bb){return respondWithRpcPromise(_0x8895('0x4a'),_0x2bffd7[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x2bffd7[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x21c7bb,null))['catch'](handleError(_0x21c7bb,null));};exports['whatsappQueues']=function(_0x5b96fe,_0x13b143){return respondWithRpcPromise(_0x8895('0x4c'),_0x5b96fe[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x13b143,null))[_0x8895('0xa')](handleError(_0x13b143,null));};exports['showWhatsappQueues']=function(_0x816803,_0xc6af80){return respondWithRpcPromise('WhatsappQueues',_0x816803[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x816803[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0xc6af80,null))[_0x8895('0xa')](handleError(_0xc6af80,null));};exports['faxQueues']=function(_0x6440ea,_0x3c318c){return respondWithRpcPromise(_0x8895('0x4d'),_0x6440ea[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x3c318c,null))[_0x8895('0xa')](handleError(_0x3c318c,null));};exports[_0x8895('0x4e')]=function(_0x5e7048,_0x10d395){return respondWithRpcPromise(_0x8895('0x4d'),_0x5e7048['query'],routingClient)[_0x8895('0x5')](findById(_0x5e7048[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x10d395,null))[_0x8895('0xa')](handleError(_0x10d395,null));};exports[_0x8895('0x4f')]=function(_0x560381,_0x16cd17){return respondWithRpcPromise('FaxAccounts',_0x560381[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x16cd17,null))['catch'](handleError(_0x16cd17,null));};exports[_0x8895('0x50')]=function(_0x24f1c5,_0x140b2a){return respondWithRpcPromise(_0x8895('0x51'),_0x24f1c5['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x140b2a,null))['catch'](handleError(_0x140b2a,null));};exports['mailQueuesWaitingInteractions']=function(_0x1a198d,_0x185351){return respondWithRpcPromise(_0x8895('0x52'),_0x1a198d['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x185351,null))['catch'](handleError(_0x185351,null));};exports[_0x8895('0x53')]=function(_0x930a13,_0x3893fb){return respondWithRpcPromise(_0x8895('0x54'),_0x930a13[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x3893fb,null))['catch'](handleError(_0x3893fb,null));};exports[_0x8895('0x55')]=function(_0x5517a2,_0x3707a6){return respondWithRpcPromise(_0x8895('0x54'),_0x5517a2['query'],routingClient)[_0x8895('0x5')](function(_0xd9637a){if(_0x5517a2[_0x8895('0x16')][_0x8895('0x56')]!==undefined){var _0x166e9a=_(_0xd9637a['rows'])[_0x8895('0x57')]([_0x5517a2['query']['type'],_0x5517a2[_0x8895('0x19')]['id']])['map'](_0x8895('0x58'))[_0x8895('0x59')]()[_0x8895('0x5a')]();return _0xd9637a[_0x8895('0x12')]['filter'](function(_0x4d802e){return _0x166e9a['indexOf'](_0x4d802e[_0x8895('0x58')])>-0x1;});}else{return _0xd9637a[_0x8895('0x12')][_0x8895('0x57')](function(_0x14fd1f){return _0x14fd1f[_0x8895('0x58')]===parseInt(_0x5517a2[_0x8895('0x19')]['id']);});}})['then'](respondWithResult(_0x3707a6,null))[_0x8895('0xa')](handleError(_0x3707a6,null));};exports[_0x8895('0x5b')]=function(_0x4deccc,_0x584a1f){return respondWithRpcPromise(_0x8895('0x5c'),_0x4deccc['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x584a1f,null))['catch'](handleError(_0x584a1f,null));};exports[_0x8895('0x5d')]=function(_0x452756,_0x553437){return respondWithRpcPromise(_0x8895('0x5e'),_0x452756[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x553437,null))[_0x8895('0xa')](handleError(_0x553437,null));};exports[_0x8895('0x5f')]=function(_0x2af98f,_0xef59db){return respondWithRpcPromise(_0x8895('0x60'),_0x2af98f[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0xef59db,null))['catch'](handleError(_0xef59db,null));};exports[_0x8895('0x61')]=function(_0x5ada19){return function(_0x330506,_0x1f583a){var _0x32d52c,_0x325597;var _0x4e6691=_[_0x8895('0x62')](_0x5ada19);var _0x1d50f6=_0x5ada19===_0x8895('0x63')?_0x8895('0x64'):_0x8895('0x65');return db[_0x4e6691+_0x8895('0x66')][_0x8895('0x67')]({'raw':!![],'where':{'id':_0x330506[_0x8895('0x19')]['id']}})['then'](function(_0x3b4092){if(_[_0x8895('0x11')](_0x3b4092)){throw new Error(_0x4e6691+'\x20Queue\x20not\x20found');}_0x32d52c=_0x3b4092;return db[_0x4e6691+'Message'][_0x8895('0x67')]({'where':{'id':_0x330506[_0x8895('0x1d')][_0x8895('0x68')]},'include':[{'model':db[_0x4e6691+_0x8895('0x69')],'as':'Interaction'},{'model':db[_0x4e6691+_0x1d50f6],'as':'Account'}]});})[_0x8895('0x5')](function(_0x42ebe2){if(_[_0x8895('0x11')](_0x42ebe2)){throw new Error(_0x4e6691+_0x8895('0x6a'));}_0x325597=_0x42ebe2;return _0x42ebe2[_0x8895('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2cd8b0={'uniqueid':_0x5ada19+'.'+_0x325597['id']+'.'+_0x325597[_0x8895('0x69')]['id'],'FromUserId':_0x330506['user']['id'],'type':_0x8895('0x6c')};_0x2cd8b0[_0x4e6691+_0x8895('0x6d')]=_0x325597['id'];_0x2cd8b0[_0x4e6691+_0x8895('0x6e')]=_0x325597[_0x8895('0x69')]['id'];_0x2cd8b0[_0x8895('0x6f')+_0x4e6691+_0x1d50f6+'Id']=_0x325597[_0x8895('0x65')]['id'];_0x2cd8b0['To'+_0x4e6691+'QueueId']=_0x32d52c['id'];return db[_0x4e6691+_0x8895('0x70')][_0x8895('0x71')](_0x2cd8b0);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5ada19,'interaction':_0x325597['Interaction'],'message':_0x325597,'account':_0x325597[_0x8895('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8895('0x6c'),'appdata':_0x32d52c['name']+','+(_0x325597[_0x8895('0x65')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x1f583a,null))[_0x8895('0xa')](handleError(_0x1f583a,null));};};exports[_0x8895('0x72')]=function(_0x28d7ab,_0x20b607){var _0x605f47,_0x54cf18;if(_[_0x8895('0x11')](_0x28d7ab[_0x8895('0x1d')][_0x8895('0x73')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4a4d4b=_0x28d7ab['body'][_0x8895('0x73')];var _0x1d796a=_[_0x8895('0x62')](_0x4a4d4b);var _0x2084b1=_0x4a4d4b===_0x8895('0x63')?_0x8895('0x64'):_0x8895('0x65');return db['User'][_0x8895('0x67')]({'raw':!![],'where':{'id':_0x28d7ab['params']['id'],'role':_0x8895('0x36')}})['then'](function(_0x2f2908){if(_[_0x8895('0x11')](_0x2f2908)){throw new Error(_0x8895('0x74'));}_0x605f47=_0x2f2908;return db[_0x1d796a+_0x8895('0x75')][_0x8895('0x67')]({'where':{'id':_0x28d7ab[_0x8895('0x1d')][_0x8895('0x68')]},'include':[{'model':db[_0x1d796a+'Interaction'],'as':_0x8895('0x69')},{'model':db[_0x1d796a+_0x2084b1],'as':_0x8895('0x65')}]});})[_0x8895('0x5')](function(_0x3ce240){if(_[_0x8895('0x11')](_0x3ce240)){throw new Error(_0x1d796a+'\x20Message\x20not\x20found');}_0x54cf18=_0x3ce240;return _0x3ce240[_0x8895('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x20f574={'uniqueid':_0x4a4d4b+'.'+_0x54cf18['id']+'.'+_0x54cf18[_0x8895('0x69')]['id'],'FromUserId':_0x28d7ab[_0x8895('0x2e')]['id'],'type':_0x8895('0x6c'),'ToUserId':_0x605f47['id']};_0x20f574[_0x1d796a+_0x8895('0x6d')]=_0x54cf18['id'];_0x20f574[_0x1d796a+_0x8895('0x6e')]=_0x54cf18[_0x8895('0x69')]['id'];_0x20f574[_0x8895('0x6f')+_0x1d796a+_0x2084b1+'Id']=_0x54cf18[_0x8895('0x65')]['id'];return db[_0x1d796a+'TransferReport'][_0x8895('0x71')](_0x20f574);})['then'](function(){return respondWithRpcPromise(_0x8895('0x76'),{'channel':_0x4a4d4b,'interaction':_0x54cf18[_0x8895('0x69')],'message':_0x54cf18,'account':_0x54cf18[_0x8895('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x605f47[_0x8895('0xf')]+','+(_0x54cf18['Account'][_0x8895('0x77')]||0x12c),'interval':_0x8895('0x78')}]},routingClient);})[_0x8895('0x5')](respondWithResult(_0x20b607,null))[_0x8895('0xa')](handleError(_0x20b607,null));}; \ No newline at end of file +var _0x55ca=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','create','Start','queue','*,*,*,*','agentNotify','channel','Website','User','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','agentTransferTimeout','bluebird','moment','../../config/logger','api','client','http','request','error','code','message','result','catch','stack','name','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','params','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions'];(function(_0x2d9173,_0x2f777a){var _0x5852ae=function(_0x564264){while(--_0x564264){_0x2d9173['push'](_0x2d9173['shift']());}};_0x5852ae(++_0x2f777a);}(_0x55ca,0x126));var _0xa55c=function(_0x1085db,_0x41e087){_0x1085db=_0x1085db-0x0;var _0x392a60=_0x55ca[_0x1085db];return _0x392a60;};'use strict';var BPromise=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0xa55c('0x2'))(_0xa55c('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232a});var mailClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232b});var routingClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){var _0x291996=_0x2121fd?_0x2121fd:amiClient;return _0x291996[_0xa55c('0x6')](_0x36b623,_0x4d0624)['then'](function(_0x5849ad){if(_0x5849ad[_0xa55c('0x7')]){if(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x8')]===0x1f4){return _0x57e069(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}return _0x2537f0(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}else{_0x2537f0(_0x5849ad[_0xa55c('0xa')]);}})[_0xa55c('0xb')](function(_0x15eec8){_0x57e069(_0x15eec8);});});}function respondWithResult(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xc8;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['status'](_0x59d84a)['json'](_0x2a35be);}return _0x5d47ff['sendStatus'](0x194);};}function handleError(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0x1f4;return function(_0x462cd6){logger[_0xa55c('0x7')](_0x462cd6[_0xa55c('0xc')]);if(_0x462cd6[_0xa55c('0xd')]){delete _0x462cd6['name'];}_0x18ee85[_0xa55c('0xe')](_0x3930e4)[_0xa55c('0xf')](_0x462cd6);};}function findById(_0x25934f){return function(_0x31e10d){if(!_[_0xa55c('0x10')](_0x25934f)&&!_[_0xa55c('0x10')](_0x31e10d)&&!_[_0xa55c('0x10')](_0x31e10d[_0xa55c('0x11')])){return _[_0xa55c('0x12')](_0x31e10d['rows'],function(_0x3d4c9e){return _0x3d4c9e['id']==_0x25934f;});}return null;};}exports[_0xa55c('0x13')]=function(_0x461284,_0x358b61){return respondWithRpcPromise(_0xa55c('0x14'),_0x461284[_0xa55c('0x15')])['then'](respondWithResult(_0x358b61,null))['catch'](handleError(_0x358b61,null));};exports[_0xa55c('0x16')]=function(_0x3776ac,_0xade4c4){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xa55c('0x17')](_0x3776ac[_0xa55c('0x15')],_0x3776ac['params']))[_0xa55c('0x18')](respondWithResult(_0xade4c4,null))[_0xa55c('0xb')](handleError(_0xade4c4,null));};exports[_0xa55c('0x19')]=function(_0x1965f1,_0x234372){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa55c('0x17')](_0x1965f1['query'],_0x1965f1['params']))['then'](respondWithResult(_0x234372,null))[_0xa55c('0xb')](handleError(_0x234372,null));};exports['voiceQueues']=function(_0x3ecbe7,_0x190757){return respondWithRpcPromise(_0xa55c('0x1a'),_0x3ecbe7[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x190757,null))[_0xa55c('0xb')](handleError(_0x190757,null));};exports[_0xa55c('0x1b')]=function(_0x11e7f7,_0x192df2){return respondWithRpcPromise(_0xa55c('0x1a'),_0x11e7f7[_0xa55c('0x15')])['then'](findById(_0x11e7f7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x192df2,null))[_0xa55c('0xb')](handleError(_0x192df2,null));};exports[_0xa55c('0x1d')]=function(_0x5d940d,_0x1377b0){return respondWithRpcPromise(_0xa55c('0x1e'),_[_0xa55c('0x17')](_0x5d940d[_0xa55c('0x1f')],_0x5d940d[_0xa55c('0x1c')]))[_0xa55c('0x18')](respondWithResult(_0x1377b0,null))['catch'](handleError(_0x1377b0,null));};exports[_0xa55c('0x20')]=function(_0x490b7d,_0x35c9c2){return respondWithRpcPromise(_0xa55c('0x21'),_[_0xa55c('0x17')](_0x490b7d[_0xa55c('0x15')],_0x490b7d['params']))[_0xa55c('0x18')](respondWithResult(_0x35c9c2,null))[_0xa55c('0xb')](handleError(_0x35c9c2,null));};exports[_0xa55c('0x22')]=function(_0x20da31,_0x10f4b7){return respondWithRpcPromise(_0xa55c('0x23'),_0x20da31[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x10f4b7,null))[_0xa55c('0xb')](handleError(_0x10f4b7,null));};exports[_0xa55c('0x24')]=function(_0x197099,_0x4eb7c4){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xa55c('0x17')](_0x197099[_0xa55c('0x15')],_0x197099['params']))[_0xa55c('0x18')](respondWithResult(_0x4eb7c4,null))[_0xa55c('0xb')](handleError(_0x4eb7c4,null));};exports[_0xa55c('0x25')]=function(_0x1839ac,_0x30d4f8){return respondWithRpcPromise(_0xa55c('0x26'),_[_0xa55c('0x17')](_0x1839ac[_0xa55c('0x15')],_0x1839ac[_0xa55c('0x1c')]))['then'](respondWithResult(_0x30d4f8,null))['catch'](handleError(_0x30d4f8,null));};exports['voiceQueuesChannelRedirect']=function(_0x3fd75f,_0x18e00e){return respondWithRpcPromise(_0xa55c('0x27'),_['merge'](_0x3fd75f[_0xa55c('0x15')],_0x3fd75f['params']))[_0xa55c('0x18')](respondWithResult(_0x18e00e,null))['catch'](handleError(_0x18e00e,null));};exports[_0xa55c('0x28')]=function(_0x39267c,_0x3c0ec1){return respondWithRpcPromise('Outbound',_0x39267c[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x3c0ec1,null))['catch'](handleError(_0x3c0ec1,null));};exports[_0xa55c('0x29')]=function(_0x194e78,_0x4d9083){return respondWithRpcPromise('OutboundChannels',_0x194e78[_0xa55c('0x15')])['then'](respondWithResult(_0x4d9083,null))[_0xa55c('0xb')](handleError(_0x4d9083,null));};exports[_0xa55c('0x2a')]=function(_0x5427bf,_0x542d76){var _0x5e50b6;return respondWithRpcPromise('Agents',_0x5427bf[_0xa55c('0x15')])[_0xa55c('0x18')](function(_0x429336){_0x5e50b6=_0x429336;return respondWithRpcPromise(_0xa55c('0x2b'),_0x5427bf[_0xa55c('0x15')],routingClient);})['then'](function(_0x3d52d8){return _[_0xa55c('0x17')]({},_0x3d52d8,_0x5e50b6);})[_0xa55c('0x18')](respondWithResult(_0x542d76,null))[_0xa55c('0xb')](handleError(_0x542d76,null));};exports[_0xa55c('0x2c')]=function(_0x23cef5,_0x554620){if(_0x23cef5[_0xa55c('0x1f')]&&_0x23cef5['body']['interaction']&&_0x23cef5[_0xa55c('0x2d')]&&_0x23cef5[_0xa55c('0x2d')]['name']){for(var _0x2bd98b in _0x23cef5['body']['interaction']){if(_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0xa55c('0x2f')](_0x2bd98b)){db['MemberReport'][_0xa55c('0x30')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')]['name'],'type':_0xa55c('0x31'),'exitAt':null,'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b]&&_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b][_0xa55c('0x32')]?{'$notIn':_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b]}:{'$ne':null}}})[_0xa55c('0x18')](function(_0x187e09){var _0x204767=moment()['format'](_0xa55c('0x33'));for(var _0x582901=0x0,_0x2f9717=_0x187e09[_0xa55c('0x32')];_0x582901<_0x2f9717;_0x582901+=0x1){_0x187e09[_0x582901][_0xa55c('0x34')]({'exitAt':_0x204767});}});for(var _0x51d663=0x0;_0x51d663<_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b]['length'];_0x51d663+=0x1){db[_0xa55c('0x35')][_0xa55c('0x36')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5['user'][_0xa55c('0xd')],'type':_0xa55c('0x31'),'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b][_0x51d663],'exitAt':null},'defaults':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')],'interface':_[_0xa55c('0x10')](_0x23cef5['user'][_0xa55c('0x37')])?util['format'](_0xa55c('0x38'),_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')]):_0x23cef5['user'][_0xa55c('0x37')],'type':_0xa55c('0x31'),'enterAt':moment()['format'](_0xa55c('0x33')),'role':_0xa55c('0x39'),'internal':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0x3a')],'uniqueid':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b][_0x51d663]}});}}}}return respondWithRpcPromise(_0xa55c('0x3b'),{'id':_0x23cef5[_0xa55c('0x1c')]['id'],'capacity':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x3c')]},routingClient)['then'](respondWithResult(_0x554620,null))[_0xa55c('0xb')](handleError(_0x554620,null));};exports[_0xa55c('0x3d')]=function(_0x216de8,_0x4f73b6){return respondWithRpcPromise(_0xa55c('0x3e'),_0x216de8[_0xa55c('0x15')])['then'](respondWithResult(_0x4f73b6,null))[_0xa55c('0xb')](handleError(_0x4f73b6,null));};exports['trunks']=function(_0x2b6a0e,_0x228df4){return respondWithRpcPromise(_0xa55c('0x3f'),_0x2b6a0e[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x228df4,null))['catch'](handleError(_0x228df4,null));};exports[_0xa55c('0x40')]=function(_0x4607ca,_0x4b85cc){return respondWithRpcPromise(_0xa55c('0x41'),_0x4607ca[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4b85cc,null))[_0xa55c('0xb')](handleError(_0x4b85cc,null));};exports['chatQueues']=function(_0x4def35,_0x267965){return respondWithRpcPromise(_0xa55c('0x42'),_0x4def35[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x43')]=function(_0x5ce463,_0x2742e4){return respondWithRpcPromise(_0xa55c('0x42'),_0x5ce463[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x5ce463[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x2742e4,null))[_0xa55c('0xb')](handleError(_0x2742e4,null));};exports['mailQueues']=function(_0x23f67f,_0x157afe){return respondWithRpcPromise(_0xa55c('0x44'),_0x23f67f[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x157afe,null))[_0xa55c('0xb')](handleError(_0x157afe,null));};exports[_0xa55c('0x45')]=function(_0x53e2be,_0x450567){return respondWithRpcPromise(_0xa55c('0x44'),_0x53e2be[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x53e2be[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x450567,null))[_0xa55c('0xb')](handleError(_0x450567,null));};exports[_0xa55c('0x46')]=function(_0x28bac4,_0x20e53c){return respondWithRpcPromise(_0xa55c('0x47'),_0x28bac4['query'],mailClient)[_0xa55c('0x18')](respondWithResult(_0x20e53c,null))[_0xa55c('0xb')](handleError(_0x20e53c,null));};exports[_0xa55c('0x48')]=function(_0x16d9b2,_0x3ba56d){return respondWithRpcPromise('OpenchannelQueues',_0x16d9b2[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x3ba56d,null))[_0xa55c('0xb')](handleError(_0x3ba56d,null));};exports['showOpenchannelQueues']=function(_0x3495a7,_0x5a8897){return respondWithRpcPromise(_0xa55c('0x49'),_0x3495a7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x3495a7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x5a8897,null))[_0xa55c('0xb')](handleError(_0x5a8897,null));};exports[_0xa55c('0x4a')]=function(_0x2f2226,_0x14b515){return respondWithRpcPromise(_0xa55c('0x4b'),_0x2f2226['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14b515,null))[_0xa55c('0xb')](handleError(_0x14b515,null));};exports['showSmsQueues']=function(_0x18b928,_0x2b8b88){return respondWithRpcPromise(_0xa55c('0x4b'),_0x18b928[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x18b928[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x2b8b88,null))[_0xa55c('0xb')](handleError(_0x2b8b88,null));};exports['whatsappQueues']=function(_0x1dfaf7,_0x475131){return respondWithRpcPromise(_0xa55c('0x4c'),_0x1dfaf7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x475131,null))[_0xa55c('0xb')](handleError(_0x475131,null));};exports[_0xa55c('0x4d')]=function(_0x4249c1,_0x25d5a1){return respondWithRpcPromise('WhatsappQueues',_0x4249c1[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x4249c1[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x25d5a1,null))[_0xa55c('0xb')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x4e')]=function(_0x3ea755,_0x3606b2){return respondWithRpcPromise(_0xa55c('0x4f'),_0x3ea755[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x3606b2,null))['catch'](handleError(_0x3606b2,null));};exports[_0xa55c('0x50')]=function(_0x531eee,_0x1228a4){return respondWithRpcPromise(_0xa55c('0x4f'),_0x531eee[_0xa55c('0x15')],routingClient)['then'](findById(_0x531eee['params']['id']))[_0xa55c('0x18')](respondWithResult(_0x1228a4,null))[_0xa55c('0xb')](handleError(_0x1228a4,null));};exports[_0xa55c('0x51')]=function(_0x42529f,_0x4c7ee1){return respondWithRpcPromise(_0xa55c('0x52'),_0x42529f[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4c7ee1,null))[_0xa55c('0xb')](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x53')]=function(_0x500968,_0x4b090c){return respondWithRpcPromise(_0xa55c('0x54'),_0x500968[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x4b090c,null))[_0xa55c('0xb')](handleError(_0x4b090c,null));};exports[_0xa55c('0x55')]=function(_0x4b2032,_0x14febc){return respondWithRpcPromise(_0xa55c('0x56'),_0x4b2032['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14febc,null))[_0xa55c('0xb')](handleError(_0x14febc,null));};exports[_0xa55c('0x57')]=function(_0x4dcb93,_0x1521d5){return respondWithRpcPromise(_0xa55c('0x58'),_0x4dcb93[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x1521d5,null))[_0xa55c('0xb')](handleError(_0x1521d5,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x25bd5b,_0x2e2cf6){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x25bd5b['query'],routingClient)[_0xa55c('0x18')](function(_0x4e1cbd){if(_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')]!==undefined){var _0x2f13db=_(_0x4e1cbd[_0xa55c('0x11')])[_0xa55c('0x5a')]([_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')],_0x25bd5b[_0xa55c('0x1c')]['id']])[_0xa55c('0x5b')]('queue_id')[_0xa55c('0x5c')]()[_0xa55c('0x5d')]();return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x4f0a26){return _0x2f13db[_0xa55c('0x5e')](_0x4f0a26[_0xa55c('0x5f')])>-0x1;});}else{return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x5d766e){return _0x5d766e['queue_id']===parseInt(_0x25bd5b[_0xa55c('0x1c')]['id']);});}})[_0xa55c('0x18')](respondWithResult(_0x2e2cf6,null))[_0xa55c('0xb')](handleError(_0x2e2cf6,null));};exports[_0xa55c('0x60')]=function(_0x5e87cb,_0x55ee0d){return respondWithRpcPromise(_0xa55c('0x61'),_0x5e87cb[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x55ee0d,null))[_0xa55c('0xb')](handleError(_0x55ee0d,null));};exports[_0xa55c('0x62')]=function(_0x346060,_0x239269){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x346060[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x239269,null))[_0xa55c('0xb')](handleError(_0x239269,null));};exports['faxQueuesWaitingInteractions']=function(_0x36ded7,_0x313cdc){return respondWithRpcPromise(_0xa55c('0x63'),_0x36ded7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x313cdc,null))[_0xa55c('0xb')](handleError(_0x313cdc,null));};exports[_0xa55c('0x64')]=function(_0x2c71ca){return function(_0x576a1b,_0x59414d){var _0x14cb74,_0x2948b1;var _0xc2ad5c=_[_0xa55c('0x65')](_0x2c71ca);var _0x1622cb=_0x2c71ca===_0xa55c('0x66')?'Website':_0xa55c('0x67');return db[_0xc2ad5c+_0xa55c('0x68')][_0xa55c('0x69')]({'raw':!![],'where':{'id':_0x576a1b[_0xa55c('0x1c')]['id']}})[_0xa55c('0x18')](function(_0x3b1cd7){if(_[_0xa55c('0x10')](_0x3b1cd7)){throw new Error(_0xc2ad5c+_0xa55c('0x6a'));}_0x14cb74=_0x3b1cd7;return db[_0xc2ad5c+'Message'][_0xa55c('0x69')]({'where':{'id':_0x576a1b[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0xc2ad5c+_0xa55c('0x6c')],'as':_0xa55c('0x6c')},{'model':db[_0xc2ad5c+_0x1622cb],'as':'Account'}]});})[_0xa55c('0x18')](function(_0x2ab1f2){if(_['isNil'](_0x2ab1f2)){throw new Error(_0xc2ad5c+'\x20Message\x20not\x20found');}_0x2948b1=_0x2ab1f2;return _0x2ab1f2[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa55c('0x18')](function(){var _0x5c2229={'uniqueid':_0x2c71ca+'.'+_0x2948b1['id']+'.'+_0x2948b1['Interaction']['id'],'FromUserId':_0x576a1b['user']['id'],'type':'queue'};_0x5c2229[_0xc2ad5c+_0xa55c('0x6e')]=_0x2948b1['id'];_0x5c2229[_0xc2ad5c+_0xa55c('0x6f')]=_0x2948b1[_0xa55c('0x6c')]['id'];_0x5c2229[_0xa55c('0x70')+_0xc2ad5c+_0x1622cb+'Id']=_0x2948b1[_0xa55c('0x67')]['id'];_0x5c2229['To'+_0xc2ad5c+_0xa55c('0x71')]=_0x14cb74['id'];return db[_0xc2ad5c+'TransferReport'][_0xa55c('0x72')](_0x5c2229);})[_0xa55c('0x18')](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x2c71ca,'interaction':_0x2948b1[_0xa55c('0x6c')],'message':_0x2948b1,'account':_0x2948b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x74'),'appdata':_0x14cb74[_0xa55c('0xd')]+','+(_0x2948b1[_0xa55c('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})['then'](respondWithResult(_0x59414d,null))['catch'](handleError(_0x59414d,null));};};exports[_0xa55c('0x76')]=function(_0x413b45,_0x1e298d){var _0x249b0c,_0x2544c1;if(_[_0xa55c('0x10')](_0x413b45[_0xa55c('0x1f')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x71bd0d=_0x413b45[_0xa55c('0x1f')][_0xa55c('0x77')];var _0x1f4bc8=_[_0xa55c('0x65')](_0x71bd0d);var _0x2a0805=_0x71bd0d===_0xa55c('0x66')?_0xa55c('0x78'):_0xa55c('0x67');return db[_0xa55c('0x79')]['findOne']({'raw':!![],'where':{'id':_0x413b45[_0xa55c('0x1c')]['id'],'role':_0xa55c('0x39')}})['then'](function(_0xb9708){if(_['isNil'](_0xb9708)){throw new Error(_0xa55c('0x7a'));}_0x249b0c=_0xb9708;return db[_0x1f4bc8+_0xa55c('0x7b')][_0xa55c('0x69')]({'where':{'id':_0x413b45[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0x1f4bc8+'Interaction'],'as':_0xa55c('0x6c')},{'model':db[_0x1f4bc8+_0x2a0805],'as':_0xa55c('0x67')}]});})[_0xa55c('0x18')](function(_0x376c1f){if(_[_0xa55c('0x10')](_0x376c1f)){throw new Error(_0x1f4bc8+_0xa55c('0x7c'));}_0x2544c1=_0x376c1f;return _0x376c1f[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x49a307={'uniqueid':_0x71bd0d+'.'+_0x2544c1['id']+'.'+_0x2544c1['Interaction']['id'],'FromUserId':_0x413b45[_0xa55c('0x2d')]['id'],'type':'queue','ToUserId':_0x249b0c['id']};_0x49a307[_0x1f4bc8+_0xa55c('0x6e')]=_0x2544c1['id'];_0x49a307[_0x1f4bc8+_0xa55c('0x6f')]=_0x2544c1[_0xa55c('0x6c')]['id'];_0x49a307[_0xa55c('0x70')+_0x1f4bc8+_0x2a0805+'Id']=_0x2544c1[_0xa55c('0x67')]['id'];return db[_0x1f4bc8+'TransferReport'][_0xa55c('0x72')](_0x49a307);})['then'](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x71bd0d,'interaction':_0x2544c1[_0xa55c('0x6c')],'message':_0x2544c1,'account':_0x2544c1[_0xa55c('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x39'),'appdata':_0x249b0c['name']+','+(_0x2544c1[_0xa55c('0x67')][_0xa55c('0x7d')]||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})[_0xa55c('0x18')](respondWithResult(_0x1e298d,null))[_0xa55c('0xb')](handleError(_0x1e298d,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a12222b..1f11ea6 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 _0x4565=['exports','util','path','express','Router','../../components/auth/service','./schedule.controller','isAuthenticated','/:id','show','get','/:id/run','run','post','put','update','delete','destroy'];(function(_0x3d38b1,_0xa516ca){var _0x3219ab=function(_0x23897a){while(--_0x23897a){_0x3d38b1['push'](_0x3d38b1['shift']());}};_0x3219ab(++_0xa516ca);}(_0x4565,0xc7));var _0x5456=function(_0xd719d2,_0x88d330){_0xd719d2=_0xd719d2-0x0;var _0x2c1995=_0x4565[_0xd719d2];return _0x2c1995;};'use strict';var multer=require('multer');var util=require(_0x5456('0x0'));var path=require(_0x5456('0x1'));var timeout=require('connect-timeout');var express=require(_0x5456('0x2'));var router=express[_0x5456('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5456('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5456('0x5'));router['get']('/',auth[_0x5456('0x6')](),controller['index']);router['get'](_0x5456('0x7'),auth[_0x5456('0x6')](),controller[_0x5456('0x8')]);router[_0x5456('0x9')](_0x5456('0xa'),auth[_0x5456('0x6')](),controller[_0x5456('0xb')]);router[_0x5456('0xc')]('/',auth[_0x5456('0x6')](),controller['create']);router[_0x5456('0xd')](_0x5456('0x7'),auth[_0x5456('0x6')](),controller[_0x5456('0xe')]);router[_0x5456('0xf')](_0x5456('0x7'),auth['isAuthenticated'](),controller[_0x5456('0x10')]);module[_0x5456('0x11')]=router; \ No newline at end of file +var _0xf6d0=['../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','run','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xf6d0,0xe1));var _0x0f6d=function(_0x3fe24a,_0x464130){_0x3fe24a=_0x3fe24a-0x0;var _0x4934cc=_0xf6d0[_0x3fe24a];return _0x4934cc;};'use strict';var multer=require(_0x0f6d('0x0'));var util=require(_0x0f6d('0x1'));var path=require(_0x0f6d('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f6d('0x3'));var router=express[_0x0f6d('0x4')]();var fs_extra=require(_0x0f6d('0x5'));var auth=require(_0x0f6d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0f6d('0x7'));var controller=require(_0x0f6d('0x8'));router[_0x0f6d('0x9')]('/',auth[_0x0f6d('0xa')](),controller['index']);router[_0x0f6d('0x9')](_0x0f6d('0xb'),auth[_0x0f6d('0xa')](),controller[_0x0f6d('0xc')]);router[_0x0f6d('0x9')](_0x0f6d('0xd'),auth[_0x0f6d('0xa')](),controller[_0x0f6d('0xe')]);router[_0x0f6d('0xf')]('/',auth[_0x0f6d('0xa')](),controller[_0x0f6d('0x10')]);router[_0x0f6d('0x11')](_0x0f6d('0xb'),auth[_0x0f6d('0xa')](),controller[_0x0f6d('0x12')]);router['delete'](_0x0f6d('0xb'),auth[_0x0f6d('0xa')](),controller[_0x0f6d('0x13')]);module[_0x0f6d('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a1dbc25..2c9eb4a 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 _0x44fe=['hours','minutes','csv','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days'];(function(_0x4639d2,_0x41bf0a){var _0x5c1f9d=function(_0x2079fb){while(--_0x2079fb){_0x4639d2['push'](_0x4639d2['shift']());}};_0x5c1f9d(++_0x41bf0a);}(_0x44fe,0x1ed));var _0xe44f=function(_0x561df4,_0x10c459){_0x561df4=_0x561df4-0x0;var _0x2687c0=_0x44fe[_0x561df4];return _0x2687c0;};'use strict';var Sequelize=require('sequelize');module[_0xe44f('0x0')]={'name':{'type':Sequelize[_0xe44f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe44f('0x1')]},'active':{'type':Sequelize[_0xe44f('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe44f('0x1')],'allowNull':![],'defaultValue':_0xe44f('0x3')},'startAt':{'type':Sequelize[_0xe44f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe44f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe44f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe44f('0x6')]('years',_0xe44f('0x7'),_0xe44f('0x8'),_0xe44f('0x9'),_0xe44f('0xa'),_0xe44f('0xb'),_0xe44f('0xc')),'allowNull':![],'defaultValue':_0xe44f('0xa')},'output':{'type':Sequelize[_0xe44f('0x6')](_0xe44f('0xd'),'pdf',_0xe44f('0xe')),'allowNull':![],'defaultValue':_0xe44f('0xd')},'type':{'type':Sequelize[_0xe44f('0x6')](_0xe44f('0xf'),_0xe44f('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xe44f('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe44f('0x11')]},'bcc':{'type':Sequelize[_0xe44f('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xe44f('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2fbb=['months','weeks','days','hours','minutes','csv','pdf','xlsx','ENUM','custom','TEXT','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years'];(function(_0x14dad8,_0x595247){var _0x3713f2=function(_0xc703ed){while(--_0xc703ed){_0x14dad8['push'](_0x14dad8['shift']());}};_0x3713f2(++_0x595247);}(_0x2fbb,0x1d4));var _0xb2fb=function(_0x4eba17,_0x4e999a){_0x4eba17=_0x4eba17-0x0;var _0x4c0a3e=_0x2fbb[_0x4eba17];return _0x4c0a3e;};'use strict';var Sequelize=require(_0xb2fb('0x0'));module[_0xb2fb('0x1')]={'name':{'type':Sequelize[_0xb2fb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb2fb('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb2fb('0x3')},'startAt':{'type':Sequelize[_0xb2fb('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb2fb('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb2fb('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xb2fb('0x6'),'quarters',_0xb2fb('0x7'),_0xb2fb('0x8'),_0xb2fb('0x9'),_0xb2fb('0xa'),_0xb2fb('0xb')),'allowNull':![],'defaultValue':_0xb2fb('0x9')},'output':{'type':Sequelize['ENUM'](_0xb2fb('0xc'),_0xb2fb('0xd'),_0xb2fb('0xe')),'allowNull':![],'defaultValue':_0xb2fb('0xc')},'type':{'type':Sequelize[_0xb2fb('0xf')](_0xb2fb('0x10'),'default'),'allowNull':![],'defaultValue':_0xb2fb('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xb2fb('0x2')]},'cc':{'type':Sequelize[_0xb2fb('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xb2fb('0x12')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index e2117a8..c4d7a1b 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 _0xbe63=['fields','query','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','run','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Scheduler','sendStatus','error','stack','name','map','Schedule','fieldName','type','key','model','keys','filters','attributes','intersection'];(function(_0x179af7,_0x4bca78){var _0x4f16e1=function(_0x484cf5){while(--_0x484cf5){_0x179af7['push'](_0x179af7['shift']());}};_0x4f16e1(++_0x4bca78);}(_0xbe63,0x1ca));var _0x3be6=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0xbe63[_0x1c0991];return _0x5034de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3be6('0x0'));var zipdir=require(_0x3be6('0x1'));var jsonpatch=require(_0x3be6('0x2'));var rp=require(_0x3be6('0x3'));var moment=require(_0x3be6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3be6('0x5'));var util=require(_0x3be6('0x6'));var path=require(_0x3be6('0x7'));var sox=require(_0x3be6('0x8'));var csv=require(_0x3be6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3be6('0xa'));var crypto=require(_0x3be6('0xb'));var jsforce=require(_0x3be6('0xc'));var deskjs=require(_0x3be6('0xd'));var toCsv=require(_0x3be6('0x9'));var querystring=require(_0x3be6('0xe'));var Papa=require(_0x3be6('0xf'));var Redis=require(_0x3be6('0x10'));var authService=require(_0x3be6('0x11'));var qs=require(_0x3be6('0x12'));var as=require(_0x3be6('0x13'));var hardwareService=require(_0x3be6('0x14'));var logger=require(_0x3be6('0x15'))(_0x3be6('0x16'));var utils=require(_0x3be6('0x17'));var config=require(_0x3be6('0x18'));var licenseUtil=require(_0x3be6('0x19'));var db=require(_0x3be6('0x1a'))['db'];function respondWithStatusCode(_0x1a7747,_0x357f55){_0x357f55=_0x357f55||0xcc;return function(_0xaf00bd){if(_0xaf00bd){return _0x1a7747['sendStatus'](_0x357f55);}return _0x1a7747[_0x3be6('0x1b')](_0x357f55)[_0x3be6('0x1c')]();};}function respondWithResult(_0x2d611a,_0x5ac7cf){_0x5ac7cf=_0x5ac7cf||0xc8;return function(_0x157e85){if(_0x157e85){return _0x2d611a[_0x3be6('0x1b')](_0x5ac7cf)[_0x3be6('0x1d')](_0x157e85);}};}function respondWithFilteredResult(_0x35a768,_0x727a46){return function(_0x2344e9){if(_0x2344e9){var _0x6f0c23=typeof _0x727a46[_0x3be6('0x1e')]===_0x3be6('0x1f')&&typeof _0x727a46['limit']===_0x3be6('0x1f');var _0x17363c=_0x2344e9[_0x3be6('0x20')];var _0x35d7e5=_0x6f0c23?0x0:_0x727a46[_0x3be6('0x1e')];var _0xac0491=_0x6f0c23?_0x2344e9[_0x3be6('0x20')]:_0x727a46[_0x3be6('0x1e')]+_0x727a46[_0x3be6('0x21')];var _0x39f258;if(_0xac0491>=_0x17363c){_0xac0491=_0x17363c;_0x39f258=0xc8;}else{_0x39f258=0xce;}_0x35a768[_0x3be6('0x1b')](_0x39f258);return _0x35a768[_0x3be6('0x22')](_0x3be6('0x23'),_0x35d7e5+'-'+_0xac0491+'/'+_0x17363c)[_0x3be6('0x1d')](_0x2344e9);}return null;};}function patchUpdates(_0x5267a6){return function(_0x3d8f04){try{jsonpatch[_0x3be6('0x24')](_0x3d8f04,_0x5267a6,!![]);}catch(_0xb845c9){return BPromise[_0x3be6('0x25')](_0xb845c9);}return _0x3d8f04[_0x3be6('0x26')]();};}function saveUpdates(_0x55ce07,_0x115517){return function(_0x2f24fd){if(_0x2f24fd){return _0x2f24fd[_0x3be6('0x27')](_0x55ce07)['then'](function(_0x31c168){return _0x31c168;});}return null;};}function removeEntity(_0x22e74a,_0x40b498){return function(_0x314819){if(_0x314819){return _0x314819[_0x3be6('0x28')]()[_0x3be6('0x29')](function(){var _0x1bbe18=_0x314819[_0x3be6('0x2a')]({'plain':!![]});var _0x368ecb=_0x3be6('0x2b');return db['UserProfileResource'][_0x3be6('0x28')]({'where':{'type':_0x368ecb,'resourceId':_0x1bbe18['id']}})[_0x3be6('0x29')](function(){return _0x314819;});})[_0x3be6('0x29')](function(){_0x22e74a[_0x3be6('0x1b')](0xcc)[_0x3be6('0x1c')]();});}};}function handleEntityNotFound(_0x385122,_0x2deeb4){return function(_0x4d4a35){if(!_0x4d4a35){_0x385122[_0x3be6('0x2c')](0x194);}return _0x4d4a35;};}function handleError(_0x45ea85,_0x539bd4){_0x539bd4=_0x539bd4||0x1f4;return function(_0x4d3104){logger[_0x3be6('0x2d')](_0x4d3104[_0x3be6('0x2e')]);if(_0x4d3104[_0x3be6('0x2f')]){delete _0x4d3104['name'];}_0x45ea85[_0x3be6('0x1b')](_0x539bd4)['send'](_0x4d3104);};}exports['index']=function(_0x236982,_0x257738){var _0x1c9334={},_0x1fa55e={},_0x503f11={'count':0x0,'rows':[]};var _0x1a122c=_[_0x3be6('0x30')](db[_0x3be6('0x31')]['rawAttributes'],function(_0x4c4945){return{'name':_0x4c4945[_0x3be6('0x32')],'type':_0x4c4945[_0x3be6('0x33')][_0x3be6('0x34')]};});_0x1fa55e[_0x3be6('0x35')]=_[_0x3be6('0x30')](_0x1a122c,_0x3be6('0x2f'));_0x1fa55e['query']=_[_0x3be6('0x36')](_0x236982['query']);_0x1fa55e[_0x3be6('0x37')]=_['intersection'](_0x1fa55e[_0x3be6('0x35')],_0x1fa55e['query']);_0x1c9334[_0x3be6('0x38')]=_[_0x3be6('0x39')](_0x1fa55e[_0x3be6('0x35')],qs[_0x3be6('0x3a')](_0x236982[_0x3be6('0x3b')][_0x3be6('0x3a')]));_0x1c9334[_0x3be6('0x38')]=_0x1c9334[_0x3be6('0x38')][_0x3be6('0x3c')]?_0x1c9334[_0x3be6('0x38')]:_0x1fa55e['model'];if(!_0x236982[_0x3be6('0x3b')][_0x3be6('0x3d')](_0x3be6('0x3e'))){_0x1c9334[_0x3be6('0x21')]=qs['limit'](_0x236982[_0x3be6('0x3b')]['limit']);_0x1c9334[_0x3be6('0x1e')]=qs[_0x3be6('0x1e')](_0x236982[_0x3be6('0x3b')][_0x3be6('0x1e')]);}_0x1c9334[_0x3be6('0x3f')]=qs[_0x3be6('0x40')](_0x236982[_0x3be6('0x3b')][_0x3be6('0x40')]);_0x1c9334[_0x3be6('0x41')]=qs['filters'](_['pick'](_0x236982[_0x3be6('0x3b')],_0x1fa55e[_0x3be6('0x37')]),_0x1a122c);if(_0x236982['query'][_0x3be6('0x42')]){_0x1c9334[_0x3be6('0x41')]=_['merge'](_0x1c9334[_0x3be6('0x41')],{'$or':_[_0x3be6('0x30')](_0x1a122c,function(_0x5dbc85){if(_0x5dbc85[_0x3be6('0x33')]!==_0x3be6('0x43')){var _0x221c3d={};_0x221c3d[_0x5dbc85['name']]={'$like':'%'+_0x236982[_0x3be6('0x3b')][_0x3be6('0x42')]+'%'};return _0x221c3d;}})});}_0x1c9334=_[_0x3be6('0x44')]({},_0x1c9334,_0x236982[_0x3be6('0x45')]);var _0x37e84e={'where':_0x1c9334[_0x3be6('0x41')]};return db['Schedule'][_0x3be6('0x20')](_0x37e84e)['then'](function(_0x462ec1){_0x503f11['count']=_0x462ec1;if(_0x236982[_0x3be6('0x3b')][_0x3be6('0x46')]){_0x1c9334[_0x3be6('0x47')]=[{'all':!![]}];}return db[_0x3be6('0x31')][_0x3be6('0x48')](_0x1c9334);})[_0x3be6('0x29')](function(_0x261bfb){_0x503f11[_0x3be6('0x49')]=_0x261bfb;return _0x503f11;})[_0x3be6('0x29')](respondWithFilteredResult(_0x257738,_0x1c9334))[_0x3be6('0x4a')](handleError(_0x257738,null));};exports[_0x3be6('0x4b')]=function(_0x4c15c3,_0x3a65f3){var _0x3cb3a5={'raw':![],'where':{'id':_0x4c15c3[_0x3be6('0x4c')]['id']}},_0x3945c4={};_0x3945c4[_0x3be6('0x35')]=_[_0x3be6('0x36')](db[_0x3be6('0x31')]['rawAttributes']);_0x3945c4[_0x3be6('0x3b')]=_[_0x3be6('0x36')](_0x4c15c3['query']);_0x3945c4[_0x3be6('0x37')]=_['intersection'](_0x3945c4[_0x3be6('0x35')],_0x3945c4[_0x3be6('0x3b')]);_0x3cb3a5[_0x3be6('0x38')]=_[_0x3be6('0x39')](_0x3945c4[_0x3be6('0x35')],qs[_0x3be6('0x3a')](_0x4c15c3['query']['fields']));_0x3cb3a5[_0x3be6('0x38')]=_0x3cb3a5[_0x3be6('0x38')][_0x3be6('0x3c')]?_0x3cb3a5[_0x3be6('0x38')]:_0x3945c4[_0x3be6('0x35')];if(_0x4c15c3[_0x3be6('0x3b')][_0x3be6('0x46')]){_0x3cb3a5['include']=[{'all':!![]}];}_0x3cb3a5=_['merge']({},_0x3cb3a5,_0x4c15c3[_0x3be6('0x45')]);return db['Schedule']['find'](_0x3cb3a5)[_0x3be6('0x29')](handleEntityNotFound(_0x3a65f3,null))[_0x3be6('0x29')](respondWithResult(_0x3a65f3,null))[_0x3be6('0x4a')](handleError(_0x3a65f3,null));};exports[_0x3be6('0x4d')]=function(_0x391bab,_0x54e15d){return db[_0x3be6('0x31')][_0x3be6('0x4d')](_0x391bab[_0x3be6('0x4e')],{})[_0x3be6('0x29')](function(_0x3aea1a){var _0x256545=_0x391bab[_0x3be6('0x4f')][_0x3be6('0x2a')]({'plain':!![]});if(!_0x256545)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x256545[_0x3be6('0x50')]==='user'){var _0x366392=_0x3aea1a[_0x3be6('0x2a')]({'plain':!![]});var _0x592f60=_0x3be6('0x2b');return db[_0x3be6('0x51')][_0x3be6('0x52')]({'where':{'name':_0x592f60,'userProfileId':_0x256545[_0x3be6('0x53')]},'raw':!![]})[_0x3be6('0x29')](function(_0x36c548){if(_0x36c548&&_0x36c548[_0x3be6('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x366392['name'],'resourceId':_0x366392['id'],'type':_0x36c548['name'],'sectionId':_0x36c548['id']},{})['then'](function(){return _0x3aea1a;});}else{return _0x3aea1a;}})[_0x3be6('0x4a')](function(_0x158554){logger[_0x3be6('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x158554);throw _0x158554;});}return _0x3aea1a;})[_0x3be6('0x29')](respondWithResult(_0x54e15d,0xc9))[_0x3be6('0x4a')](handleError(_0x54e15d,null));};exports['update']=function(_0x59e408,_0x2ada9b){if(_0x59e408[_0x3be6('0x4e')]['id']){delete _0x59e408[_0x3be6('0x4e')]['id'];}return db[_0x3be6('0x31')]['find']({'where':{'id':_0x59e408[_0x3be6('0x4c')]['id']}})[_0x3be6('0x29')](handleEntityNotFound(_0x2ada9b,null))[_0x3be6('0x29')](saveUpdates(_0x59e408[_0x3be6('0x4e')],null))[_0x3be6('0x29')](respondWithResult(_0x2ada9b,null))[_0x3be6('0x4a')](handleError(_0x2ada9b,null));};exports['destroy']=function(_0x52d56b,_0x51d330){return db[_0x3be6('0x31')]['find']({'where':{'id':_0x52d56b[_0x3be6('0x4c')]['id']}})[_0x3be6('0x29')](handleEntityNotFound(_0x51d330,null))[_0x3be6('0x29')](removeEntity(_0x51d330,null))[_0x3be6('0x4a')](handleError(_0x51d330,null));};exports[_0x3be6('0x55')]=function(_0xaffc32,_0x42f5b5,_0x528ad5){var _0x3be3e8=require('../../config/schedule');return db[_0x3be6('0x31')][_0x3be6('0x52')]({'where':{'id':_0xaffc32[_0x3be6('0x4c')]['id']},'raw':!![]})[_0x3be6('0x29')](handleEntityNotFound(_0x42f5b5,null))[_0x3be6('0x29')](function(){_0x3be3e8[_0x3be6('0x55')](_0xaffc32[_0x3be6('0x4c')]['id']);})[_0x3be6('0x29')](respondWithStatusCode(_0x42f5b5,null))[_0x3be6('0x4a')](handleError(_0x42f5b5,null));}; \ No newline at end of file +var _0xf322=['sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','show','params','Schedule','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','run','../../config/schedule','rimraf','request-promise','bluebird','mustache','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf322,0x1ce));var _0x2f32=function(_0x2afb17,_0xb56d2f){_0x2afb17=_0x2afb17-0x0;var _0x12c7a1=_0xf322[_0x2afb17];return _0x12c7a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f32('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2f32('0x1'));var moment=require('moment');var BPromise=require(_0x2f32('0x2'));var Mustache=require(_0x2f32('0x3'));var util=require(_0x2f32('0x4'));var path=require(_0x2f32('0x5'));var sox=require(_0x2f32('0x6'));var csv=require(_0x2f32('0x7'));var ejs=require(_0x2f32('0x8'));var fs=require('fs');var fs_extra=require(_0x2f32('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2f32('0xa'));var jsforce=require(_0x2f32('0xb'));var deskjs=require(_0x2f32('0xc'));var toCsv=require(_0x2f32('0x7'));var querystring=require(_0x2f32('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2f32('0xe'));var qs=require(_0x2f32('0xf'));var as=require(_0x2f32('0x10'));var hardwareService=require(_0x2f32('0x11'));var logger=require(_0x2f32('0x12'))('api');var utils=require(_0x2f32('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2f32('0x14'))['db'];function respondWithStatusCode(_0xdb7ec6,_0x56b849){_0x56b849=_0x56b849||0xcc;return function(_0xa2205c){if(_0xa2205c){return _0xdb7ec6[_0x2f32('0x15')](_0x56b849);}return _0xdb7ec6[_0x2f32('0x16')](_0x56b849)['end']();};}function respondWithResult(_0x4eb5bb,_0x4eeb44){_0x4eeb44=_0x4eeb44||0xc8;return function(_0x5bb5e9){if(_0x5bb5e9){return _0x4eb5bb['status'](_0x4eeb44)['json'](_0x5bb5e9);}};}function respondWithFilteredResult(_0x238012,_0x4897c8){return function(_0x3d2240){if(_0x3d2240){var _0x423851=typeof _0x4897c8[_0x2f32('0x17')]===_0x2f32('0x18')&&typeof _0x4897c8['limit']==='undefined';var _0x43b7d9=_0x3d2240['count'];var _0x211907=_0x423851?0x0:_0x4897c8[_0x2f32('0x17')];var _0x13f0c0=_0x423851?_0x3d2240[_0x2f32('0x19')]:_0x4897c8[_0x2f32('0x17')]+_0x4897c8[_0x2f32('0x1a')];var _0x18c0b7;if(_0x13f0c0>=_0x43b7d9){_0x13f0c0=_0x43b7d9;_0x18c0b7=0xc8;}else{_0x18c0b7=0xce;}_0x238012[_0x2f32('0x16')](_0x18c0b7);return _0x238012[_0x2f32('0x1b')]('Content-Range',_0x211907+'-'+_0x13f0c0+'/'+_0x43b7d9)['json'](_0x3d2240);}return null;};}function patchUpdates(_0x27c62f){return function(_0x1c5733){try{jsonpatch[_0x2f32('0x1c')](_0x1c5733,_0x27c62f,!![]);}catch(_0x34577b){return BPromise[_0x2f32('0x1d')](_0x34577b);}return _0x1c5733[_0x2f32('0x1e')]();};}function saveUpdates(_0x26b598,_0x533176){return function(_0x545ac7){if(_0x545ac7){return _0x545ac7['update'](_0x26b598)[_0x2f32('0x1f')](function(_0x5b5eb3){return _0x5b5eb3;});}return null;};}function removeEntity(_0x277520,_0x109cbb){return function(_0x443296){if(_0x443296){return _0x443296[_0x2f32('0x20')]()[_0x2f32('0x1f')](function(){var _0x5f1d7a=_0x443296[_0x2f32('0x21')]({'plain':!![]});var _0x28ffc6=_0x2f32('0x22');return db[_0x2f32('0x23')][_0x2f32('0x20')]({'where':{'type':_0x28ffc6,'resourceId':_0x5f1d7a['id']}})[_0x2f32('0x1f')](function(){return _0x443296;});})[_0x2f32('0x1f')](function(){_0x277520['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc656,_0xe8ecbb){return function(_0x150831){if(!_0x150831){_0x4fc656[_0x2f32('0x15')](0x194);}return _0x150831;};}function handleError(_0x3fa32b,_0x26a6e4){_0x26a6e4=_0x26a6e4||0x1f4;return function(_0xcc1fcb){logger['error'](_0xcc1fcb[_0x2f32('0x24')]);if(_0xcc1fcb[_0x2f32('0x25')]){delete _0xcc1fcb[_0x2f32('0x25')];}_0x3fa32b[_0x2f32('0x16')](_0x26a6e4)[_0x2f32('0x26')](_0xcc1fcb);};}exports[_0x2f32('0x27')]=function(_0x5e30ae,_0x5f0d66){var _0x624aa3={},_0xf99901={},_0x5c3c54={'count':0x0,'rows':[]};var _0x499bcb=_[_0x2f32('0x28')](db['Schedule']['rawAttributes'],function(_0x5b3e38){return{'name':_0x5b3e38[_0x2f32('0x29')],'type':_0x5b3e38[_0x2f32('0x2a')][_0x2f32('0x2b')]};});_0xf99901[_0x2f32('0x2c')]=_[_0x2f32('0x28')](_0x499bcb,'name');_0xf99901[_0x2f32('0x2d')]=_[_0x2f32('0x2e')](_0x5e30ae[_0x2f32('0x2d')]);_0xf99901[_0x2f32('0x2f')]=_[_0x2f32('0x30')](_0xf99901[_0x2f32('0x2c')],_0xf99901[_0x2f32('0x2d')]);_0x624aa3[_0x2f32('0x31')]=_[_0x2f32('0x30')](_0xf99901[_0x2f32('0x2c')],qs[_0x2f32('0x32')](_0x5e30ae[_0x2f32('0x2d')][_0x2f32('0x32')]));_0x624aa3[_0x2f32('0x31')]=_0x624aa3[_0x2f32('0x31')][_0x2f32('0x33')]?_0x624aa3[_0x2f32('0x31')]:_0xf99901[_0x2f32('0x2c')];if(!_0x5e30ae['query'][_0x2f32('0x34')]('nolimit')){_0x624aa3[_0x2f32('0x1a')]=qs[_0x2f32('0x1a')](_0x5e30ae[_0x2f32('0x2d')][_0x2f32('0x1a')]);_0x624aa3[_0x2f32('0x17')]=qs[_0x2f32('0x17')](_0x5e30ae[_0x2f32('0x2d')][_0x2f32('0x17')]);}_0x624aa3[_0x2f32('0x35')]=qs[_0x2f32('0x36')](_0x5e30ae[_0x2f32('0x2d')][_0x2f32('0x36')]);_0x624aa3[_0x2f32('0x37')]=qs[_0x2f32('0x2f')](_[_0x2f32('0x38')](_0x5e30ae[_0x2f32('0x2d')],_0xf99901[_0x2f32('0x2f')]),_0x499bcb);if(_0x5e30ae[_0x2f32('0x2d')]['filter']){_0x624aa3[_0x2f32('0x37')]=_[_0x2f32('0x39')](_0x624aa3[_0x2f32('0x37')],{'$or':_[_0x2f32('0x28')](_0x499bcb,function(_0x1ee7e4){if(_0x1ee7e4[_0x2f32('0x2a')]!==_0x2f32('0x3a')){var _0x24b63f={};_0x24b63f[_0x1ee7e4[_0x2f32('0x25')]]={'$like':'%'+_0x5e30ae[_0x2f32('0x2d')]['filter']+'%'};return _0x24b63f;}})});}_0x624aa3=_['merge']({},_0x624aa3,_0x5e30ae['options']);var _0x2db190={'where':_0x624aa3[_0x2f32('0x37')]};return db['Schedule'][_0x2f32('0x19')](_0x2db190)[_0x2f32('0x1f')](function(_0x569ba8){_0x5c3c54[_0x2f32('0x19')]=_0x569ba8;if(_0x5e30ae[_0x2f32('0x2d')][_0x2f32('0x3b')]){_0x624aa3['include']=[{'all':!![]}];}return db['Schedule'][_0x2f32('0x3c')](_0x624aa3);})['then'](function(_0x5c6939){_0x5c3c54[_0x2f32('0x3d')]=_0x5c6939;return _0x5c3c54;})['then'](respondWithFilteredResult(_0x5f0d66,_0x624aa3))['catch'](handleError(_0x5f0d66,null));};exports[_0x2f32('0x3e')]=function(_0x5aeabf,_0x79306f){var _0x3d4b4f={'raw':![],'where':{'id':_0x5aeabf[_0x2f32('0x3f')]['id']}},_0x36065e={};_0x36065e[_0x2f32('0x2c')]=_[_0x2f32('0x2e')](db[_0x2f32('0x40')]['rawAttributes']);_0x36065e[_0x2f32('0x2d')]=_['keys'](_0x5aeabf[_0x2f32('0x2d')]);_0x36065e[_0x2f32('0x2f')]=_['intersection'](_0x36065e[_0x2f32('0x2c')],_0x36065e[_0x2f32('0x2d')]);_0x3d4b4f[_0x2f32('0x31')]=_[_0x2f32('0x30')](_0x36065e['model'],qs[_0x2f32('0x32')](_0x5aeabf[_0x2f32('0x2d')]['fields']));_0x3d4b4f[_0x2f32('0x31')]=_0x3d4b4f[_0x2f32('0x31')][_0x2f32('0x33')]?_0x3d4b4f[_0x2f32('0x31')]:_0x36065e[_0x2f32('0x2c')];if(_0x5aeabf[_0x2f32('0x2d')]['includeAll']){_0x3d4b4f['include']=[{'all':!![]}];}_0x3d4b4f=_[_0x2f32('0x39')]({},_0x3d4b4f,_0x5aeabf['options']);return db['Schedule'][_0x2f32('0x41')](_0x3d4b4f)['then'](handleEntityNotFound(_0x79306f,null))[_0x2f32('0x1f')](respondWithResult(_0x79306f,null))['catch'](handleError(_0x79306f,null));};exports[_0x2f32('0x42')]=function(_0x254ef2,_0x362f4a){return db[_0x2f32('0x40')][_0x2f32('0x42')](_0x254ef2[_0x2f32('0x43')],{})[_0x2f32('0x1f')](function(_0x31c7e3){var _0x147407=_0x254ef2[_0x2f32('0x44')][_0x2f32('0x21')]({'plain':!![]});if(!_0x147407)throw new Error(_0x2f32('0x45'));if(_0x147407[_0x2f32('0x46')]==='user'){var _0x311d23=_0x31c7e3['get']({'plain':!![]});var _0x37bcbd='Scheduler';return db[_0x2f32('0x47')]['find']({'where':{'name':_0x37bcbd,'userProfileId':_0x147407[_0x2f32('0x48')]},'raw':!![]})[_0x2f32('0x1f')](function(_0x5aae7e){if(_0x5aae7e&&_0x5aae7e[_0x2f32('0x49')]===0x0){return db[_0x2f32('0x23')][_0x2f32('0x42')]({'name':_0x311d23[_0x2f32('0x25')],'resourceId':_0x311d23['id'],'type':_0x5aae7e['name'],'sectionId':_0x5aae7e['id']},{})[_0x2f32('0x1f')](function(){return _0x31c7e3;});}else{return _0x31c7e3;}})['catch'](function(_0x59fe62){logger['error'](_0x2f32('0x4a'),_0x59fe62);throw _0x59fe62;});}return _0x31c7e3;})[_0x2f32('0x1f')](respondWithResult(_0x362f4a,0xc9))[_0x2f32('0x4b')](handleError(_0x362f4a,null));};exports['update']=function(_0x10985d,_0x313ac7){if(_0x10985d[_0x2f32('0x43')]['id']){delete _0x10985d[_0x2f32('0x43')]['id'];}return db[_0x2f32('0x40')][_0x2f32('0x41')]({'where':{'id':_0x10985d[_0x2f32('0x3f')]['id']}})['then'](handleEntityNotFound(_0x313ac7,null))[_0x2f32('0x1f')](saveUpdates(_0x10985d[_0x2f32('0x43')],null))[_0x2f32('0x1f')](respondWithResult(_0x313ac7,null))[_0x2f32('0x4b')](handleError(_0x313ac7,null));};exports[_0x2f32('0x20')]=function(_0x150636,_0x5d2ddf){return db[_0x2f32('0x40')][_0x2f32('0x41')]({'where':{'id':_0x150636[_0x2f32('0x3f')]['id']}})[_0x2f32('0x1f')](handleEntityNotFound(_0x5d2ddf,null))[_0x2f32('0x1f')](removeEntity(_0x5d2ddf,null))[_0x2f32('0x4b')](handleError(_0x5d2ddf,null));};exports[_0x2f32('0x4c')]=function(_0x161786,_0xc19a21,_0x3965fe){var _0x5ef820=require(_0x2f32('0x4d'));return db[_0x2f32('0x40')][_0x2f32('0x41')]({'where':{'id':_0x161786['params']['id']},'raw':!![]})[_0x2f32('0x1f')](handleEntityNotFound(_0xc19a21,null))['then'](function(){_0x5ef820[_0x2f32('0x4c')](_0x161786['params']['id']);})[_0x2f32('0x1f')](respondWithStatusCode(_0xc19a21,null))[_0x2f32('0x4b')](handleError(_0xc19a21,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 36bd7c9..e184f17 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 _0x08a5=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule'];(function(_0x4962e8,_0x295a6c){var _0x45ee77=function(_0x339d66){while(--_0x339d66){_0x4962e8['push'](_0x4962e8['shift']());}};_0x45ee77(++_0x295a6c);}(_0x08a5,0x108));var _0x508a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x508a('0x0'));var util=require('util');var logger=require(_0x508a('0x1'))(_0x508a('0x2'));var moment=require(_0x508a('0x3'));var BPromise=require(_0x508a('0x4'));var rp=require(_0x508a('0x5'));var fs=require('fs');var path=require(_0x508a('0x6'));var rimraf=require(_0x508a('0x7'));var config=require(_0x508a('0x8'));var attributes=require(_0x508a('0x9'));module[_0x508a('0xa')]=function(_0x49fee2,_0x5ed598){return _0x49fee2['define'](_0x508a('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1446=['lodash','util','../../config/logger','api','moment','rimraf','exports','define','Schedule','tools_schedules'];(function(_0x5c440e,_0x36bf6f){var _0x214d8b=function(_0x12c024){while(--_0x12c024){_0x5c440e['push'](_0x5c440e['shift']());}};_0x214d8b(++_0x36bf6f);}(_0x1446,0xe6));var _0x6144=function(_0x2f6391,_0x4e8a92){_0x2f6391=_0x2f6391-0x0;var _0x3c2066=_0x1446[_0x2f6391];return _0x3c2066;};'use strict';var _=require(_0x6144('0x0'));var util=require(_0x6144('0x1'));var logger=require(_0x6144('0x2'))(_0x6144('0x3'));var moment=require(_0x6144('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6144('0x5'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x6144('0x6')]=function(_0x5b8b67,_0x1e1ad0){return _0x5b8b67[_0x6144('0x7')](_0x6144('0x8'),attributes,{'tableName':_0x6144('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index fc0bdc9..d213490 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 _0xd73b=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s'];(function(_0x3024df,_0x2858aa){var _0xacaefe=function(_0x1a8b65){while(--_0x1a8b65){_0x3024df['push'](_0x3024df['shift']());}};_0xacaefe(++_0x2858aa);}(_0xd73b,0x183));var _0xbd73=function(_0x5eeb55,_0x5615e6){_0x5eeb55=_0x5eeb55-0x0;var _0x5a2296=_0xd73b[_0x5eeb55];return _0x5a2296;};'use strict';var _=require('lodash');var util=require(_0xbd73('0x0'));var moment=require(_0xbd73('0x1'));var BPromise=require(_0xbd73('0x2'));var rs=require(_0xbd73('0x3'));var fs=require('fs');var Redis=require(_0xbd73('0x4'));var db=require(_0xbd73('0x5'))['db'];var utils=require(_0xbd73('0x6'));var logger=require('../../config/logger')(_0xbd73('0x7'));var config=require(_0xbd73('0x8'));var jayson=require(_0xbd73('0x9'));var client=jayson['client'][_0xbd73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x238104,_0x159742,_0x4a9764){return new BPromise(function(_0x202703,_0x88a27e){return client[_0xbd73('0xb')](_0x238104,_0x4a9764)[_0xbd73('0xc')](function(_0x126337){logger[_0xbd73('0xd')]('Schedule,\x20%s,\x20%s',_0x159742,_0xbd73('0xe'));logger[_0xbd73('0xf')](_0xbd73('0x10'),_0x159742,_0xbd73('0xe'),JSON[_0xbd73('0x11')](_0x126337));if(_0x126337[_0xbd73('0x12')]){if(_0x126337[_0xbd73('0x12')][_0xbd73('0x13')]===0x1f4){logger[_0xbd73('0x12')](_0xbd73('0x14'),_0x159742,_0x126337['error'][_0xbd73('0x15')]);return _0x88a27e(_0x126337[_0xbd73('0x12')][_0xbd73('0x15')]);}logger[_0xbd73('0x12')]('Schedule,\x20%s,\x20%s',_0x159742,_0x126337['error']['message']);return _0x202703(_0x126337[_0xbd73('0x12')][_0xbd73('0x15')]);}else{logger[_0xbd73('0xd')](_0xbd73('0x14'),_0x159742,_0xbd73('0xe'));_0x202703(_0x126337[_0xbd73('0x16')][_0xbd73('0x15')]);}})[_0xbd73('0x17')](function(_0x3f2aed){logger['error'](_0xbd73('0x14'),_0x159742,_0x3f2aed);_0x88a27e(_0x3f2aed);});});} \ No newline at end of file +var _0x5372=['error','code','Schedule,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','request\x20sent'];(function(_0x5a6497,_0xb2da19){var _0x5a4b45=function(_0x40060c){while(--_0x40060c){_0x5a6497['push'](_0x5a6497['shift']());}};_0x5a4b45(++_0xb2da19);}(_0x5372,0x95));var _0x2537=function(_0x19908f,_0xc32e70){_0x19908f=_0x19908f-0x0;var _0x36cfbe=_0x5372[_0x19908f];return _0x36cfbe;};'use strict';var _=require('lodash');var util=require(_0x2537('0x0'));var moment=require(_0x2537('0x1'));var BPromise=require('bluebird');var rs=require(_0x2537('0x2'));var fs=require('fs');var Redis=require(_0x2537('0x3'));var db=require(_0x2537('0x4'))['db'];var utils=require(_0x2537('0x5'));var logger=require(_0x2537('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2537('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ebe20,_0x3a85e3,_0x51e373){return new BPromise(function(_0x5c5e48,_0x21b026){return client[_0x2537('0x8')](_0x5ebe20,_0x51e373)['then'](function(_0x44f05a){logger[_0x2537('0x9')]('Schedule,\x20%s,\x20%s',_0x3a85e3,_0x2537('0xa'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x3a85e3,'request\x20sent',JSON['stringify'](_0x44f05a));if(_0x44f05a[_0x2537('0xb')]){if(_0x44f05a[_0x2537('0xb')][_0x2537('0xc')]===0x1f4){logger['error'](_0x2537('0xd'),_0x3a85e3,_0x44f05a['error']['message']);return _0x21b026(_0x44f05a[_0x2537('0xb')][_0x2537('0xe')]);}logger['error'](_0x2537('0xd'),_0x3a85e3,_0x44f05a['error'][_0x2537('0xe')]);return _0x5c5e48(_0x44f05a[_0x2537('0xb')][_0x2537('0xe')]);}else{logger[_0x2537('0x9')](_0x2537('0xd'),_0x3a85e3,'request\x20sent');_0x5c5e48(_0x44f05a['result'][_0x2537('0xe')]);}})[_0x2537('0xf')](function(_0x6bf7a2){logger[_0x2537('0xb')]('Schedule,\x20%s,\x20%s',_0x3a85e3,_0x6bf7a2);_0x21b026(_0x6bf7a2);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index e6464af..0aee6dc 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 _0xbde3=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','download','post','destroy','exports'];(function(_0x4dd571,_0x18b238){var _0x9000e0=function(_0x2e7c26){while(--_0x2e7c26){_0x4dd571['push'](_0x4dd571['shift']());}};_0x9000e0(++_0x18b238);}(_0xbde3,0x143));var _0x3bde=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0xbde3[_0x3f3f06];return _0x140feb;};'use strict';var multer=require(_0x3bde('0x0'));var util=require(_0x3bde('0x1'));var path=require(_0x3bde('0x2'));var timeout=require(_0x3bde('0x3'));var express=require('express');var router=express[_0x3bde('0x4')]();var fs_extra=require(_0x3bde('0x5'));var auth=require(_0x3bde('0x6'));var interaction=require(_0x3bde('0x7'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x3bde('0x8')]('/',auth[_0x3bde('0x9')](),controller[_0x3bde('0xa')]);router[_0x3bde('0x8')](_0x3bde('0xb'),auth[_0x3bde('0x9')](),controller[_0x3bde('0xc')]);router[_0x3bde('0x8')](_0x3bde('0xd'),auth[_0x3bde('0x9')](),controller[_0x3bde('0xe')]);router[_0x3bde('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x3bde('0xf')]);router[_0x3bde('0x10')]('/',auth[_0x3bde('0x9')](),controller['create']);router['put'](_0x3bde('0xd'),auth[_0x3bde('0x9')](),controller['update']);router['delete'](_0x3bde('0xd'),auth['isAuthenticated'](),controller[_0x3bde('0x11')]);module[_0x3bde('0x12')]=router; \ No newline at end of file +var _0x276e=['describe','/:id','show','/:id/download','download','post','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe'];(function(_0x4fba44,_0x10e53c){var _0x1b87ec=function(_0x20015c){while(--_0x20015c){_0x4fba44['push'](_0x4fba44['shift']());}};_0x1b87ec(++_0x10e53c);}(_0x276e,0x1d4));var _0xe276=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x276e[_0x1ac120];return _0x19b703;};'use strict';var multer=require(_0xe276('0x0'));var util=require(_0xe276('0x1'));var path=require(_0xe276('0x2'));var timeout=require(_0xe276('0x3'));var express=require(_0xe276('0x4'));var router=express['Router']();var fs_extra=require(_0xe276('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe276('0x6'));var config=require(_0xe276('0x7'));var controller=require(_0xe276('0x8'));router[_0xe276('0x9')]('/',auth[_0xe276('0xa')](),controller['index']);router[_0xe276('0x9')](_0xe276('0xb'),auth[_0xe276('0xa')](),controller[_0xe276('0xc')]);router['get'](_0xe276('0xd'),auth[_0xe276('0xa')](),controller[_0xe276('0xe')]);router[_0xe276('0x9')](_0xe276('0xf'),auth['isAuthenticated'](),controller[_0xe276('0x10')]);router[_0xe276('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe276('0x12')](_0xe276('0xd'),auth[_0xe276('0xa')](),controller['update']);router[_0xe276('0x13')](_0xe276('0xd'),auth[_0xe276('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2f7a1e5..8110fc0 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 _0x79e2=['setDataValue','INTEGER','subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports','getDataValue','extname','value','STRING','replace'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x79e2,0x1c3));var _0x279e=function(_0xf8ddf5,_0x5352e7){_0xf8ddf5=_0xf8ddf5-0x0;var _0x5a02d7=_0x79e2[_0xf8ddf5];return _0x5a02d7;};'use strict';var Sequelize=require(_0x279e('0x0'));var moment=require('moment');var path=require(_0x279e('0x1'));var config=require(_0x279e('0x2'));module[_0x279e('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x279e('0x4')]('value')?path[_0x279e('0x5')](this[_0x279e('0x4')](_0x279e('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x279e('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x1c6b6f){var _0x26c072=_0x1c6b6f[_0x279e('0x8')](/\\/g,'/');this[_0x279e('0x9')](_0x279e('0x6'),_0x26c072);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x279e('0xa')],'set':function(_0x1ec1b7){this[_0x279e('0x9')]('startedAt',moment()[_0x279e('0xb')](_0x1ec1b7,'ms'));this[_0x279e('0x9')]('closedAt',moment());this[_0x279e('0x9')](_0x279e('0xc'),_0x1ec1b7);}},'startedAt':{'type':Sequelize[_0x279e('0xd')],'get':function(){return moment(this[_0x279e('0x4')](_0x279e('0xe')))[_0x279e('0xf')](_0x279e('0x10'))[_0x279e('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x279e('0x4')]('closedAt'))[_0x279e('0xf')](_0x279e('0x10'))[_0x279e('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x279e('0x4')](_0x279e('0x12')))[_0x279e('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x279e('0x11')]();}},'updatedAt':{'type':Sequelize[_0x279e('0xd')],'get':function(){return moment(this[_0x279e('0x4')](_0x279e('0x13')))[_0x279e('0xf')](_0x279e('0x10'))['toString']();}}}; \ No newline at end of file +var _0xb515=['path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize'];(function(_0x450fe2,_0x15afd4){var _0x3133a5=function(_0x551de7){while(--_0x551de7){_0x450fe2['push'](_0x450fe2['shift']());}};_0x3133a5(++_0x15afd4);}(_0xb515,0x1b8));var _0x5b51=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0xb515[_0x239dba];return _0x1ceb11;};'use strict';var Sequelize=require(_0x5b51('0x0'));var moment=require('moment');var path=require(_0x5b51('0x1'));var config=require(_0x5b51('0x2'));module[_0x5b51('0x3')]={'format':{'type':Sequelize[_0x5b51('0x4')],'get':function(){return this[_0x5b51('0x5')](_0x5b51('0x6'))?path[_0x5b51('0x7')](this[_0x5b51('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x5b51('0x8')]},'channel':{'type':Sequelize[_0x5b51('0x8')]},'value':{'type':Sequelize[_0x5b51('0x8')],'set':function(_0x293d82){var _0x396b3f=_0x293d82[_0x5b51('0x9')](/\\/g,'/');this[_0x5b51('0xa')](_0x5b51('0x6'),_0x396b3f);}},'rating':{'type':Sequelize[_0x5b51('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x5b51('0xb')],'set':function(_0x1085e6){this[_0x5b51('0xa')]('startedAt',moment()[_0x5b51('0xc')](_0x1085e6,'ms'));this[_0x5b51('0xa')](_0x5b51('0xd'),moment());this[_0x5b51('0xa')](_0x5b51('0xe'),_0x1085e6);}},'startedAt':{'type':Sequelize[_0x5b51('0xf')],'get':function(){return moment(this['getDataValue']('startedAt'))['format'](_0x5b51('0x10'))[_0x5b51('0x11')]();}},'closedAt':{'type':Sequelize[_0x5b51('0xf')],'get':function(){return moment(this[_0x5b51('0x5')]('closedAt'))[_0x5b51('0x12')](_0x5b51('0x10'))[_0x5b51('0x11')]();}},'createdAt':{'type':Sequelize[_0x5b51('0xf')],'get':function(){return moment(this[_0x5b51('0x5')](_0x5b51('0x13')))[_0x5b51('0x12')](_0x5b51('0x10'))[_0x5b51('0x11')]();}},'updatedAt':{'type':Sequelize[_0x5b51('0xf')],'get':function(){return moment(this[_0x5b51('0x5')](_0x5b51('0x14')))['format'](_0x5b51('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 416124e..b2ff182 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 _0x425d=['include','findAll','rows','catch','show','params','length','includeAll','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','value','%s.cypher','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x425d,0x1e0));var _0xd425=function(_0x45b1de,_0x1dcb97){_0x45b1de=_0x45b1de-0x0;var _0x4a88fa=_0x425d[_0x45b1de];return _0x4a88fa;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x36')](_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c')),['format']);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x185d7e[_0xd425('0x37')]);_0x24da23[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x24da23['model'],_0x24da23[_0xd425('0x37')]);_0x37b63c[_0xd425('0x3b')]=_['intersection'](_0x24da23['model'],qs['fields'](_0x185d7e[_0xd425('0x37')][_0xd425('0x3c')]));_0x37b63c[_0xd425('0x3b')]=_0x37b63c[_0xd425('0x3b')]['length']?_0x37b63c[_0xd425('0x3b')]:_0x24da23[_0xd425('0x35')];if(!_0x185d7e[_0xd425('0x37')][_0xd425('0x3d')](_0xd425('0x3e'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e['query'][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e[_0xd425('0x37')][_0xd425('0x21')]);}_0x37b63c['order']=qs[_0xd425('0x3f')](_0x185d7e[_0xd425('0x37')][_0xd425('0x3f')]);_0x37b63c[_0xd425('0x40')]=qs['filters'](_[_0xd425('0x41')](_0x185d7e[_0xd425('0x37')],_0x24da23['filters']),_0x482ba6);if(_0x185d7e['query']['filter']){_0x37b63c[_0xd425('0x40')]=_[_0xd425('0x42')](_0x37b63c[_0xd425('0x40')],{'$or':_['map'](_0x482ba6,function(_0x4f8323){if(_0x4f8323['type']!==_0xd425('0x43')){var _0x3f9090={};_0x3f9090[_0x4f8323[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x37')][_0xd425('0x44')]+'%'};return _0x3f9090;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x45')]);var _0x4b922f={'where':_0x37b63c[_0xd425('0x40')]};return db[_0xd425('0x30')][_0xd425('0x24')](_0x4b922f)['then'](function(_0x3adc67){_0x1cac61[_0xd425('0x24')]=_0x3adc67;if(_0x185d7e[_0xd425('0x37')]['includeAll']){_0x37b63c[_0xd425('0x46')]=[{'all':!![]}];}return db[_0xd425('0x30')][_0xd425('0x47')](_0x37b63c);})[_0xd425('0x2a')](function(_0x5afd62){_0x1cac61[_0xd425('0x48')]=_0x5afd62;return _0x1cac61;})[_0xd425('0x2a')](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x49')](handleError(_0x2fd17a,null));};exports[_0xd425('0x4a')]=function(_0x3f24fb,_0x2f6bf7){var _0x2d799b={'raw':![],'where':{'id':_0x3f24fb[_0xd425('0x4b')]['id']}},_0x524fad={};_0x524fad[_0xd425('0x35')]=_['keys'](db[_0xd425('0x30')]['rawAttributes']);_0x524fad['query']=_[_0xd425('0x38')](_0x3f24fb['query']);_0x524fad[_0xd425('0x39')]=_['intersection'](_0x524fad[_0xd425('0x35')],_0x524fad[_0xd425('0x37')]);_0x2d799b[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x524fad[_0xd425('0x35')],qs['fields'](_0x3f24fb[_0xd425('0x37')]['fields']));_0x2d799b[_0xd425('0x3b')]=_0x2d799b['attributes'][_0xd425('0x4c')]?_0x2d799b[_0xd425('0x3b')]:_0x524fad[_0xd425('0x35')];if(_0x3f24fb[_0xd425('0x37')][_0xd425('0x4d')]){_0x2d799b['include']=[{'all':!![]}];}_0x2d799b=_[_0xd425('0x42')]({},_0x2d799b,_0x3f24fb[_0xd425('0x45')]);return db[_0xd425('0x30')][_0xd425('0x4e')](_0x2d799b)[_0xd425('0x2a')](handleEntityNotFound(_0x2f6bf7,null))['then'](respondWithResult(_0x2f6bf7,null))[_0xd425('0x49')](handleError(_0x2f6bf7,null));};exports[_0xd425('0x4f')]=function(_0x1450f2,_0x2a2ab4){return db[_0xd425('0x30')][_0xd425('0x4f')](_0x1450f2['body'],{})[_0xd425('0x2a')](respondWithResult(_0x2a2ab4,0xc9))[_0xd425('0x49')](handleError(_0x2a2ab4,null));};exports['update']=function(_0x3f305,_0x42c084){if(_0x3f305[_0xd425('0x50')]['id']){delete _0x3f305[_0xd425('0x50')]['id'];}delete _0x3f305['body'][_0xd425('0x51')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x52')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x53')];delete _0x3f305['body']['value'];return db[_0xd425('0x30')]['find']({'where':{'id':_0x3f305[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x42c084,null))['then'](saveUpdates(_0x3f305[_0xd425('0x50')],null))['then'](respondWithResult(_0x42c084,null))['catch'](handleError(_0x42c084,null));};exports[_0xd425('0x54')]=function(_0x111905,_0xe6451f){return db[_0xd425('0x30')][_0xd425('0x54')]()[_0xd425('0x2a')](respondWithResult(_0xe6451f,null))[_0xd425('0x49')](handleError(_0xe6451f,null));};exports[_0xd425('0x55')]=function(_0x54d437,_0x11ed71,_0x1c6141){var _0x1be9bb=require(_0xd425('0x56'));var _0x7b1080=![];var _0x1c80c2={};if(_0x54d437[_0xd425('0x37')][_0xd425('0x33')]&&_0x54d437['query']['type']==='uniqueid'){_0x1c80c2[_0xd425('0x57')]=_0x54d437[_0xd425('0x4b')]['id'];}else{_0x1c80c2['id']=_0x54d437[_0xd425('0x4b')]['id'];}return db[_0xd425('0x30')]['find']({'where':_0x1c80c2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ed71,null))['then'](function(_0x254b8b){if(_0x254b8b){var _0x44c5e4=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x254b8b[_0xd425('0x5a')]);var _0x57e23e=util['format'](_0xd425('0x5b'),_0x44c5e4);if(fs['existsSync'](_0x57e23e)){_0x7b1080=!![];return _0x1be9bb['decryptFile'](_0x57e23e,_0x44c5e4,config['secrets'][_0xd425('0x5c')])[_0xd425('0x2a')](function(){return _0x254b8b;});}return _0x254b8b;}})[_0xd425('0x2a')](function(_0x5b2323){if(_0x5b2323){var _0x3395d8=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x5b2323[_0xd425('0x5a')]);if(!fs[_0xd425('0x5d')](_0x3395d8)){throw new db[(_0xd425('0x5e'))][(_0xd425('0x5f'))](_0xd425('0x60'));}if(_0x5b2323[_0xd425('0x61')]){return _0x11ed71[_0xd425('0x55')](_0x3395d8,_0x5b2323['filename']+path[_0xd425('0x62')](_0x3395d8),function(){if(_0x7b1080){fs[_0xd425('0x63')](_0x3395d8);}});}else{return _0x11ed71[_0xd425('0x55')](_0x3395d8,function(_0xf22906){if(_0x7b1080){fs['unlink'](_0x3395d8);}});}}})['catch'](function(_0x307e9a){if(_0x307e9a[_0xd425('0x64')]===_0xd425('0x60')){_0x11ed71[_0xd425('0x1f')](0x194)[_0xd425('0x2d')](_0xd425('0x65'));}else{return handleError(_0x11ed71,null);}});};exports[_0xd425('0x66')]=function(_0x44782a,_0x1fcde4){return db[_0xd425('0x30')][_0xd425('0x4e')]({'where':{'id':_0x44782a[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](function(_0x28979e){if(_['isNil'](_0x28979e)){throw new ReferenceError(_0xd425('0x67'));}return _0x28979e;})[_0xd425('0x2a')](function(_0xd2f2e8){var _0x4fd793=path['join'](config['root'],_0xd425('0x59'),_0xd2f2e8[_0xd425('0x5a')]);logger[_0xd425('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x4fd793);if(!_[_0xd425('0x69')](_0xd2f2e8['value'])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd425('0x6b')](_0x4fd793);}_0x4fd793=_0x4fd793+_0xd425('0x6c');if(!_[_0xd425('0x69')](_0xd2f2e8[_0xd425('0x5a')])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+_0xd425('0x6d'));fs[_0xd425('0x6b')](_0x4fd793);}return _0xd2f2e8;})[_0xd425('0x2a')](function(_0x2ba77b){if(!_0x2ba77b)throw new InternalError();return _0x2ba77b[_0xd425('0x66')]();})[_0xd425('0x2a')](function(){_0x1fcde4[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();})[_0xd425('0x49')](handleError(_0x1fcde4,null));}; \ No newline at end of file +var _0xae24=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','ScreenRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','duration','createdAt','closedAt','find','describe','download','../../components/encryptor','uniqueid','value','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xae24,0x182));var _0x4ae2=function(_0x463ad9,_0x1a9582){_0x463ad9=_0x463ad9-0x0;var _0x5ce8c8=_0xae24[_0x463ad9];return _0x5ce8c8;};'use strict';var emlformat=require(_0x4ae2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ae2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ae2('0x2'));var moment=require(_0x4ae2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ae2('0x4'));var path=require('path');var sox=require(_0x4ae2('0x5'));var csv=require(_0x4ae2('0x6'));var ejs=require(_0x4ae2('0x7'));var fs=require('fs');var fs_extra=require(_0x4ae2('0x8'));var _=require(_0x4ae2('0x9'));var squel=require(_0x4ae2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ae2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ae2('0xc'));var Redis=require(_0x4ae2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4ae2('0xe'));var as=require(_0x4ae2('0xf'));var hardwareService=require(_0x4ae2('0x10'));var logger=require(_0x4ae2('0x11'))('api');var utils=require(_0x4ae2('0x12'));var config=require(_0x4ae2('0x13'));var licenseUtil=require(_0x4ae2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d2b4,_0x22ac1e){_0x22ac1e=_0x22ac1e||0xcc;return function(_0x30d6c4){if(_0x30d6c4){return _0x25d2b4[_0x4ae2('0x15')](_0x22ac1e);}return _0x25d2b4[_0x4ae2('0x16')](_0x22ac1e)[_0x4ae2('0x17')]();};}function respondWithResult(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0xc8;return function(_0xd527a0){if(_0xd527a0){return _0x145287['status'](_0x3cabc9)['json'](_0xd527a0);}};}function respondWithFilteredResult(_0x4d5cab,_0x2f3936){return function(_0xf834a1){if(_0xf834a1){var _0x5f447a=typeof _0x2f3936[_0x4ae2('0x18')]===_0x4ae2('0x19')&&typeof _0x2f3936[_0x4ae2('0x1a')]===_0x4ae2('0x19');var _0x428d24=_0xf834a1[_0x4ae2('0x1b')];var _0x3d4259=_0x5f447a?0x0:_0x2f3936[_0x4ae2('0x18')];var _0x41b672=_0x5f447a?_0xf834a1[_0x4ae2('0x1b')]:_0x2f3936['offset']+_0x2f3936['limit'];var _0x44a2d3;if(_0x41b672>=_0x428d24){_0x41b672=_0x428d24;_0x44a2d3=0xc8;}else{_0x44a2d3=0xce;}_0x4d5cab[_0x4ae2('0x16')](_0x44a2d3);return _0x4d5cab['set'](_0x4ae2('0x1c'),_0x3d4259+'-'+_0x41b672+'/'+_0x428d24)[_0x4ae2('0x1d')](_0xf834a1);}return null;};}function patchUpdates(_0xccb3b){return function(_0x2ad222){try{jsonpatch[_0x4ae2('0x1e')](_0x2ad222,_0xccb3b,!![]);}catch(_0x497218){return BPromise[_0x4ae2('0x1f')](_0x497218);}return _0x2ad222['save']();};}function saveUpdates(_0x522165,_0x2ceec4){return function(_0x151b70){if(_0x151b70){return _0x151b70[_0x4ae2('0x20')](_0x522165)[_0x4ae2('0x21')](function(_0xca16bf){return _0xca16bf;});}return null;};}function removeEntity(_0x526768,_0x1005e0){return function(_0x4a0ddb){if(_0x4a0ddb){return _0x4a0ddb[_0x4ae2('0x22')]()[_0x4ae2('0x21')](function(){_0x526768[_0x4ae2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43f112,_0x6f0cc6){return function(_0x2454b3){if(!_0x2454b3){_0x43f112[_0x4ae2('0x15')](0x194);}return _0x2454b3;};}function handleError(_0x1c2934,_0x255772){_0x255772=_0x255772||0x1f4;return function(_0x5b2e65){logger['error'](_0x5b2e65[_0x4ae2('0x23')]);if(_0x5b2e65[_0x4ae2('0x24')]){delete _0x5b2e65[_0x4ae2('0x24')];}_0x1c2934[_0x4ae2('0x16')](_0x255772)[_0x4ae2('0x25')](_0x5b2e65);};}exports[_0x4ae2('0x26')]=function(_0x57a377,_0x5ec1fd){var _0x3e2666={},_0x4e7741={},_0x554cff={'count':0x0,'rows':[]};var _0x5e9f03=_[_0x4ae2('0x27')](db[_0x4ae2('0x28')]['rawAttributes'],function(_0x883fd5){return{'name':_0x883fd5[_0x4ae2('0x29')],'type':_0x883fd5[_0x4ae2('0x2a')][_0x4ae2('0x2b')]};});_0x4e7741[_0x4ae2('0x2c')]=_[_0x4ae2('0x2d')](_[_0x4ae2('0x27')](_0x5e9f03,_0x4ae2('0x24')),[_0x4ae2('0x2e')]);_0x4e7741[_0x4ae2('0x2f')]=_[_0x4ae2('0x30')](_0x57a377[_0x4ae2('0x2f')]);_0x4e7741[_0x4ae2('0x31')]=_[_0x4ae2('0x32')](_0x4e7741[_0x4ae2('0x2c')],_0x4e7741[_0x4ae2('0x2f')]);_0x3e2666[_0x4ae2('0x33')]=_['intersection'](_0x4e7741[_0x4ae2('0x2c')],qs['fields'](_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x34')]));_0x3e2666['attributes']=_0x3e2666[_0x4ae2('0x33')][_0x4ae2('0x35')]?_0x3e2666[_0x4ae2('0x33')]:_0x4e7741[_0x4ae2('0x2c')];if(!_0x57a377['query'][_0x4ae2('0x36')](_0x4ae2('0x37'))){_0x3e2666[_0x4ae2('0x1a')]=qs[_0x4ae2('0x1a')](_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x1a')]);_0x3e2666[_0x4ae2('0x18')]=qs[_0x4ae2('0x18')](_0x57a377[_0x4ae2('0x2f')]['offset']);}_0x3e2666[_0x4ae2('0x38')]=qs['sort'](_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x39')]);_0x3e2666[_0x4ae2('0x3a')]=qs[_0x4ae2('0x31')](_[_0x4ae2('0x3b')](_0x57a377[_0x4ae2('0x2f')],_0x4e7741['filters']),_0x5e9f03);if(_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x3c')]){_0x3e2666[_0x4ae2('0x3a')]=_[_0x4ae2('0x3d')](_0x3e2666['where'],{'$or':_[_0x4ae2('0x27')](_0x5e9f03,function(_0x34a784){if(_0x34a784[_0x4ae2('0x2a')]!==_0x4ae2('0x3e')){var _0x232243={};_0x232243[_0x34a784[_0x4ae2('0x24')]]={'$like':'%'+_0x57a377[_0x4ae2('0x2f')][_0x4ae2('0x3c')]+'%'};return _0x232243;}})});}_0x3e2666=_[_0x4ae2('0x3d')]({},_0x3e2666,_0x57a377[_0x4ae2('0x3f')]);var _0x2aaef1={'where':_0x3e2666['where']};return db[_0x4ae2('0x28')][_0x4ae2('0x1b')](_0x2aaef1)[_0x4ae2('0x21')](function(_0x1473e6){_0x554cff['count']=_0x1473e6;if(_0x57a377['query'][_0x4ae2('0x40')]){_0x3e2666[_0x4ae2('0x41')]=[{'all':!![]}];}return db[_0x4ae2('0x28')][_0x4ae2('0x42')](_0x3e2666);})['then'](function(_0x3c0a56){_0x554cff[_0x4ae2('0x43')]=_0x3c0a56;return _0x554cff;})['then'](respondWithFilteredResult(_0x5ec1fd,_0x3e2666))[_0x4ae2('0x44')](handleError(_0x5ec1fd,null));};exports[_0x4ae2('0x45')]=function(_0x11a5d9,_0x5a9126){var _0x2f6431={'raw':![],'where':{'id':_0x11a5d9[_0x4ae2('0x46')]['id']}},_0x29e12c={};_0x29e12c[_0x4ae2('0x2c')]=_[_0x4ae2('0x30')](db[_0x4ae2('0x28')][_0x4ae2('0x47')]);_0x29e12c[_0x4ae2('0x2f')]=_['keys'](_0x11a5d9[_0x4ae2('0x2f')]);_0x29e12c[_0x4ae2('0x31')]=_['intersection'](_0x29e12c[_0x4ae2('0x2c')],_0x29e12c[_0x4ae2('0x2f')]);_0x2f6431['attributes']=_[_0x4ae2('0x32')](_0x29e12c[_0x4ae2('0x2c')],qs['fields'](_0x11a5d9[_0x4ae2('0x2f')][_0x4ae2('0x34')]));_0x2f6431[_0x4ae2('0x33')]=_0x2f6431['attributes']['length']?_0x2f6431[_0x4ae2('0x33')]:_0x29e12c[_0x4ae2('0x2c')];if(_0x11a5d9[_0x4ae2('0x2f')][_0x4ae2('0x40')]){_0x2f6431['include']=[{'all':!![]}];}_0x2f6431=_[_0x4ae2('0x3d')]({},_0x2f6431,_0x11a5d9[_0x4ae2('0x3f')]);return db[_0x4ae2('0x28')]['find'](_0x2f6431)[_0x4ae2('0x21')](handleEntityNotFound(_0x5a9126,null))[_0x4ae2('0x21')](respondWithResult(_0x5a9126,null))[_0x4ae2('0x44')](handleError(_0x5a9126,null));};exports['create']=function(_0x16bf0b,_0x24ec08){return db[_0x4ae2('0x28')][_0x4ae2('0x48')](_0x16bf0b[_0x4ae2('0x49')],{})[_0x4ae2('0x21')](respondWithResult(_0x24ec08,0xc9))[_0x4ae2('0x44')](handleError(_0x24ec08,null));};exports[_0x4ae2('0x20')]=function(_0x3a6110,_0xf6d12a){if(_0x3a6110['body']['id']){delete _0x3a6110[_0x4ae2('0x49')]['id'];}delete _0x3a6110[_0x4ae2('0x49')][_0x4ae2('0x4a')];delete _0x3a6110[_0x4ae2('0x49')][_0x4ae2('0x4b')];delete _0x3a6110[_0x4ae2('0x49')][_0x4ae2('0x4c')];delete _0x3a6110[_0x4ae2('0x49')]['value'];return db[_0x4ae2('0x28')][_0x4ae2('0x4d')]({'where':{'id':_0x3a6110['params']['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0xf6d12a,null))[_0x4ae2('0x21')](saveUpdates(_0x3a6110['body'],null))[_0x4ae2('0x21')](respondWithResult(_0xf6d12a,null))['catch'](handleError(_0xf6d12a,null));};exports[_0x4ae2('0x4e')]=function(_0x5e1c80,_0x1ae8bb){return db[_0x4ae2('0x28')][_0x4ae2('0x4e')]()[_0x4ae2('0x21')](respondWithResult(_0x1ae8bb,null))[_0x4ae2('0x44')](handleError(_0x1ae8bb,null));};exports[_0x4ae2('0x4f')]=function(_0x201260,_0xf77b17,_0x28de70){var _0x529355=require(_0x4ae2('0x50'));var _0x4284b4=![];var _0x825c3a={};if(_0x201260[_0x4ae2('0x2f')]['type']&&_0x201260[_0x4ae2('0x2f')][_0x4ae2('0x2a')]===_0x4ae2('0x51')){_0x825c3a['uniqueid']=_0x201260['params']['id'];}else{_0x825c3a['id']=_0x201260[_0x4ae2('0x46')]['id'];}return db[_0x4ae2('0x28')][_0x4ae2('0x4d')]({'where':_0x825c3a,'attributes':['id',_0x4ae2('0x52')],'raw':!![]})[_0x4ae2('0x21')](handleEntityNotFound(_0xf77b17,null))[_0x4ae2('0x21')](function(_0x18a8e6){if(_0x18a8e6){var _0x390c1f=path[_0x4ae2('0x53')](config['root'],_0x4ae2('0x54'),_0x18a8e6['value']);var _0x11f028=util[_0x4ae2('0x2e')](_0x4ae2('0x55'),_0x390c1f);if(fs[_0x4ae2('0x56')](_0x11f028)){_0x4284b4=!![];return _0x529355[_0x4ae2('0x57')](_0x11f028,_0x390c1f,config[_0x4ae2('0x58')][_0x4ae2('0x59')])[_0x4ae2('0x21')](function(){return _0x18a8e6;});}return _0x18a8e6;}})['then'](function(_0x496f98){if(_0x496f98){var _0x33fb77=path[_0x4ae2('0x53')](config[_0x4ae2('0x5a')],'server/files/screen_recordings',_0x496f98['value']);if(!fs[_0x4ae2('0x56')](_0x33fb77)){throw new db[(_0x4ae2('0x5b'))][(_0x4ae2('0x5c'))](_0x4ae2('0x5d'));}if(_0x496f98[_0x4ae2('0x5e')]){return _0xf77b17['download'](_0x33fb77,_0x496f98['filename']+path['extname'](_0x33fb77),function(){if(_0x4284b4){fs[_0x4ae2('0x5f')](_0x33fb77);}});}else{return _0xf77b17['download'](_0x33fb77,function(_0x4e54d1){if(_0x4284b4){fs[_0x4ae2('0x5f')](_0x33fb77);}});}}})['catch'](function(_0x3efbaf){if(_0x3efbaf['message']===_0x4ae2('0x5d')){_0xf77b17['status'](0x194)[_0x4ae2('0x25')]('Not\x20found');}else{return handleError(_0xf77b17,null);}});};exports[_0x4ae2('0x22')]=function(_0x981338,_0x3f46f3){return db[_0x4ae2('0x28')][_0x4ae2('0x4d')]({'where':{'id':_0x981338['params']['id']}})['then'](function(_0x344963){if(_[_0x4ae2('0x60')](_0x344963)){throw new ReferenceError('Entity\x20not\x20found');}return _0x344963;})[_0x4ae2('0x21')](function(_0x29183d){var _0x517800=path[_0x4ae2('0x53')](config[_0x4ae2('0x5a')],'server/files/screen_recordings',_0x29183d['value']);logger[_0x4ae2('0x61')](_0x4ae2('0x62'),_0x517800);if(!_['isNil'](_0x29183d[_0x4ae2('0x52')])&&fs[_0x4ae2('0x56')](_0x517800)){logger[_0x4ae2('0x61')](_0x4ae2('0x63')+_0x517800+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4ae2('0x64')](_0x517800);}_0x517800=_0x517800+_0x4ae2('0x65');if(!_['isNil'](_0x29183d[_0x4ae2('0x52')])&&fs[_0x4ae2('0x56')](_0x517800)){logger[_0x4ae2('0x61')]('File:\x20\x22'+_0x517800+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4ae2('0x64')](_0x517800);}return _0x29183d;})['then'](function(_0x3f24bb){if(!_0x3f24bb)throw new InternalError();return _0x3f24bb['destroy']();})[_0x4ae2('0x21')](function(){_0x3f46f3['status'](0xcc)[_0x4ae2('0x17')]();})['catch'](handleError(_0x3f46f3,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3d955cd..1f51d83 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 _0xe1f5=['util','../../config/logger','api','moment','bluebird','request-promise','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x10ee40,_0x1c4261){var _0x322ed6=function(_0x24fc02){while(--_0x24fc02){_0x10ee40['push'](_0x10ee40['shift']());}};_0x322ed6(++_0x1c4261);}(_0xe1f5,0x108));var _0x5e1f=function(_0x5c350d,_0x49f765){_0x5c350d=_0x5c350d-0x0;var _0x57d613=_0xe1f5[_0x5c350d];return _0x57d613;};'use strict';var _=require('lodash');var util=require(_0x5e1f('0x0'));var logger=require(_0x5e1f('0x1'))(_0x5e1f('0x2'));var moment=require(_0x5e1f('0x3'));var BPromise=require(_0x5e1f('0x4'));var rp=require(_0x5e1f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5e1f('0x6'));module['exports']=function(_0x5a6ea7,_0x1e9de0){return _0x5a6ea7[_0x5e1f('0x7')](_0x5e1f('0x8'),attributes,{'tableName':_0x5e1f('0x9'),'paranoid':![],'indexes':[{'name':_0x5e1f('0xa'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c8e=['interactionid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./screenRecording.attributes','define','ScreenRecording','screen_recordings'];(function(_0x5339d3,_0x2a0805){var _0x3f0463=function(_0x5a2c84){while(--_0x5a2c84){_0x5339d3['push'](_0x5339d3['shift']());}};_0x3f0463(++_0x2a0805);}(_0x6c8e,0x199));var _0xe6c8=function(_0x17529e,_0x315ac9){_0x17529e=_0x17529e-0x0;var _0x1ef68e=_0x6c8e[_0x17529e];return _0x1ef68e;};'use strict';var _=require(_0xe6c8('0x0'));var util=require('util');var logger=require(_0xe6c8('0x1'))(_0xe6c8('0x2'));var moment=require(_0xe6c8('0x3'));var BPromise=require('bluebird');var rp=require(_0xe6c8('0x4'));var fs=require('fs');var path=require(_0xe6c8('0x5'));var rimraf=require(_0xe6c8('0x6'));var config=require('../../config/environment');var attributes=require(_0xe6c8('0x7'));module['exports']=function(_0x2dca69,_0x326936){return _0x2dca69[_0xe6c8('0x8')](_0xe6c8('0x9'),attributes,{'tableName':_0xe6c8('0xa'),'paranoid':![],'indexes':[{'name':_0xe6c8('0xb'),'fields':[_0xe6c8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 52aa4b1..5ff7725 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 _0x1773=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x1773,0x119));var _0x3177=function(_0x4153b1,_0x3f094e){_0x4153b1=_0x4153b1-0x0;var _0x1ef548=_0x1773[_0x4153b1];return _0x1ef548;};'use strict';var _=require(_0x3177('0x0'));var util=require(_0x3177('0x1'));var moment=require(_0x3177('0x2'));var BPromise=require(_0x3177('0x3'));var rs=require(_0x3177('0x4'));var fs=require('fs');var Redis=require(_0x3177('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3177('0x6'));var logger=require(_0x3177('0x7'))(_0x3177('0x8'));var config=require(_0x3177('0x9'));var jayson=require(_0x3177('0xa'));var client=jayson['client'][_0x3177('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xff55db,_0xca901e,_0xc9d144){return new BPromise(function(_0x3b932c,_0x8aa6ba){return client[_0x3177('0xc')](_0xff55db,_0xc9d144)[_0x3177('0xd')](function(_0x5e1e9a){logger['info'](_0x3177('0xe'),_0xca901e,_0x3177('0xf'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0xca901e,'request\x20sent',JSON[_0x3177('0x10')](_0x5e1e9a));if(_0x5e1e9a[_0x3177('0x11')]){if(_0x5e1e9a['error'][_0x3177('0x12')]===0x1f4){logger[_0x3177('0x11')](_0x3177('0xe'),_0xca901e,_0x5e1e9a[_0x3177('0x11')]['message']);return _0x8aa6ba(_0x5e1e9a[_0x3177('0x11')]['message']);}logger[_0x3177('0x11')](_0x3177('0xe'),_0xca901e,_0x5e1e9a[_0x3177('0x11')][_0x3177('0x13')]);return _0x3b932c(_0x5e1e9a[_0x3177('0x11')][_0x3177('0x13')]);}else{logger['info'](_0x3177('0xe'),_0xca901e,'request\x20sent');_0x3b932c(_0x5e1e9a[_0x3177('0x14')]['message']);}})[_0x3177('0x15')](function(_0x1c13c0){logger[_0x3177('0x11')](_0x3177('0xe'),_0xca901e,_0x1c13c0);_0x8aa6ba(_0x1c13c0);});});} \ No newline at end of file +var _0xc107=['message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','ScreenRecording,\x20%s,\x20%s'];(function(_0x13292f,_0x203f6f){var _0x4a2038=function(_0x567787){while(--_0x567787){_0x13292f['push'](_0x13292f['shift']());}};_0x4a2038(++_0x203f6f);}(_0xc107,0x88));var _0x7c10=function(_0x4c2604,_0x50a744){_0x4c2604=_0x4c2604-0x0;var _0x17e6a6=_0xc107[_0x4c2604];return _0x17e6a6;};'use strict';var _=require('lodash');var util=require(_0x7c10('0x0'));var moment=require(_0x7c10('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c10('0x2'))['db'];var utils=require(_0x7c10('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x7c10('0x4'));var jayson=require(_0x7c10('0x5'));var client=jayson[_0x7c10('0x6')][_0x7c10('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1545d1,_0x306f5e,_0x1343c5){return new BPromise(function(_0xc09974,_0x566c3b){return client[_0x7c10('0x8')](_0x1545d1,_0x1343c5)['then'](function(_0x39bd11){logger[_0x7c10('0x9')]('ScreenRecording,\x20%s,\x20%s',_0x306f5e,_0x7c10('0xa'));logger[_0x7c10('0xb')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x306f5e,_0x7c10('0xa'),JSON[_0x7c10('0xc')](_0x39bd11));if(_0x39bd11[_0x7c10('0xd')]){if(_0x39bd11[_0x7c10('0xd')][_0x7c10('0xe')]===0x1f4){logger[_0x7c10('0xd')](_0x7c10('0xf'),_0x306f5e,_0x39bd11[_0x7c10('0xd')][_0x7c10('0x10')]);return _0x566c3b(_0x39bd11[_0x7c10('0xd')][_0x7c10('0x10')]);}logger[_0x7c10('0xd')](_0x7c10('0xf'),_0x306f5e,_0x39bd11[_0x7c10('0xd')]['message']);return _0xc09974(_0x39bd11[_0x7c10('0xd')][_0x7c10('0x10')]);}else{logger[_0x7c10('0x9')](_0x7c10('0xf'),_0x306f5e,_0x7c10('0xa'));_0xc09974(_0x39bd11[_0x7c10('0x11')][_0x7c10('0x10')]);}})[_0x7c10('0x12')](function(_0x26c52f){logger[_0x7c10('0xd')](_0x7c10('0xf'),_0x306f5e,_0x26c52f);_0x566c3b(_0x26c52f);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 669848e..4f9468d 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 _0x24c9=['file','addLogoLogin','format','preferred','/:id/preferred','addPreferred','favicon','addFavicon','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','getDate','/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','extname','single','addLogo','root','%s%s','originalname','post'];(function(_0x211576,_0xcc41af){var _0x3ce235=function(_0x28bd8a){while(--_0x28bd8a){_0x211576['push'](_0x211576['shift']());}};_0x3ce235(++_0xcc41af);}(_0x24c9,0x1ab));var _0x924c=function(_0x1fc034,_0x150717){_0x1fc034=_0x1fc034-0x0;var _0x4ab169=_0x24c9[_0x1fc034];return _0x4ab169;};'use strict';var multer=require(_0x924c('0x0'));var util=require('util');var path=require(_0x924c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x924c('0x2')]();var fs_extra=require(_0x924c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x924c('0x4'));var config=require(_0x924c('0x5'));var controller=require(_0x924c('0x6'));router[_0x924c('0x7')]('/',auth[_0x924c('0x8')](),controller[_0x924c('0x9')]);router[_0x924c('0x7')]('/now',controller[_0x924c('0xa')]);router['get'](_0x924c('0xb'),controller['show']);router[_0x924c('0x7')](_0x924c('0xc'),controller['getLogo']);router['get'](_0x924c('0xd'),controller[_0x924c('0xe')]);router[_0x924c('0x7')](_0x924c('0xf'),controller[_0x924c('0x10')]);router['get']('/:id/preferred',controller['getPreferred']);router[_0x924c('0x7')](_0x924c('0x11'),controller[_0x924c('0x12')]);var upload=multer({'storage':multer[_0x924c('0x13')]({'destination':function(_0x5f245b,_0x24faa9,_0x1e9ac2){_0x1e9ac2(null,path[_0x924c('0x14')](config['root'],_0x924c('0x15')));},'filename':function(_0x353ec3,_0x56ed72,_0x1675fa){_0x1675fa(null,util['format']('%s%s','logo',path[_0x924c('0x16')](_0x56ed72['originalname'])));}})});router['post'](_0x924c('0xc'),upload[_0x924c('0x17')]('file'),controller[_0x924c('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21cb39,_0x16f50f,_0x249e66){_0x249e66(null,path[_0x924c('0x14')](config[_0x924c('0x19')],'server/files/images/logos/'));},'filename':function(_0x5eefdc,_0x3b29e8,_0xdb2f96){_0xdb2f96(null,util['format'](_0x924c('0x1a'),'logologin',path[_0x924c('0x16')](_0x3b29e8[_0x924c('0x1b')])));}})});router[_0x924c('0x1c')](_0x924c('0xd'),upload['single'](_0x924c('0x1d')),controller[_0x924c('0x1e')]);var upload=multer({'storage':multer[_0x924c('0x13')]({'destination':function(_0x522b6d,_0x5398b8,_0x3b5c8f){_0x3b5c8f(null,path['join'](config[_0x924c('0x19')],_0x924c('0x15')));},'filename':function(_0x2deb3a,_0x408ac7,_0x23c6f1){_0x23c6f1(null,util[_0x924c('0x1f')]('%s%s',_0x924c('0x20'),path[_0x924c('0x16')](_0x408ac7['originalname'])));}})});router['post'](_0x924c('0x21'),upload['single']('file'),controller[_0x924c('0x22')]);var upload=multer({'storage':multer[_0x924c('0x13')]({'destination':function(_0xedd590,_0x3c7486,_0x2b5b91){_0x2b5b91(null,path[_0x924c('0x14')](config[_0x924c('0x19')],_0x924c('0x15')));},'filename':function(_0x321294,_0x36d294,_0x2cec2b){_0x2cec2b(null,util[_0x924c('0x1f')]('%s%s',_0x924c('0x23'),path[_0x924c('0x16')](_0x36d294[_0x924c('0x1b')])));}})});router['post'](_0x924c('0x11'),upload['single'](_0x924c('0x1d')),controller[_0x924c('0x24')]);router['put'](_0x924c('0xb'),auth[_0x924c('0x8')](),controller['update']);module[_0x924c('0x25')]=router; \ No newline at end of file +var _0xeef5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','getDate','/:id','show','/:id/logo','getLogo','/:id/gdpr','/:id/preferred','getPreferred','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','addLogo','root','logologin','file','addLogoLogin','preferred','addPreferred','/:id/favicon','multer','util'];(function(_0x33ce36,_0x38e508){var _0x23aec7=function(_0x55c6d7){while(--_0x55c6d7){_0x33ce36['push'](_0x33ce36['shift']());}};_0x23aec7(++_0x38e508);}(_0xeef5,0x1ab));var _0x5eef=function(_0x124ffa,_0x11dd3c){_0x124ffa=_0x124ffa-0x0;var _0x450cc0=_0xeef5[_0x124ffa];return _0x450cc0;};'use strict';var multer=require(_0x5eef('0x0'));var util=require(_0x5eef('0x1'));var path=require('path');var timeout=require(_0x5eef('0x2'));var express=require(_0x5eef('0x3'));var router=express[_0x5eef('0x4')]();var fs_extra=require(_0x5eef('0x5'));var auth=require(_0x5eef('0x6'));var interaction=require(_0x5eef('0x7'));var config=require(_0x5eef('0x8'));var controller=require(_0x5eef('0x9'));router[_0x5eef('0xa')]('/',auth[_0x5eef('0xb')](),controller[_0x5eef('0xc')]);router[_0x5eef('0xa')]('/now',controller[_0x5eef('0xd')]);router['get'](_0x5eef('0xe'),controller[_0x5eef('0xf')]);router[_0x5eef('0xa')](_0x5eef('0x10'),controller[_0x5eef('0x11')]);router[_0x5eef('0xa')]('/:id/logo_login',controller['getLogoLogin']);router[_0x5eef('0xa')](_0x5eef('0x12'),controller['gdpr']);router['get'](_0x5eef('0x13'),controller[_0x5eef('0x14')]);router[_0x5eef('0xa')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x5eef('0x15')]({'destination':function(_0x29e17a,_0x5c07c5,_0x1fb5ef){_0x1fb5ef(null,path[_0x5eef('0x16')](config['root'],_0x5eef('0x17')));},'filename':function(_0x431027,_0x2ea5ce,_0x17be36){_0x17be36(null,util[_0x5eef('0x18')](_0x5eef('0x19'),_0x5eef('0x1a'),path[_0x5eef('0x1b')](_0x2ea5ce[_0x5eef('0x1c')])));}})});router[_0x5eef('0x1d')](_0x5eef('0x10'),upload[_0x5eef('0x1e')]('file'),controller[_0x5eef('0x1f')]);var upload=multer({'storage':multer[_0x5eef('0x15')]({'destination':function(_0x2a32ac,_0x15b4a8,_0x4067ff){_0x4067ff(null,path[_0x5eef('0x16')](config[_0x5eef('0x20')],_0x5eef('0x17')));},'filename':function(_0x4194f2,_0x3e8347,_0x539db9){_0x539db9(null,util['format']('%s%s',_0x5eef('0x21'),path['extname'](_0x3e8347[_0x5eef('0x1c')])));}})});router['post']('/:id/logo_login',upload[_0x5eef('0x1e')](_0x5eef('0x22')),controller[_0x5eef('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2edc48,_0x23719a,_0x510fbf){_0x510fbf(null,path[_0x5eef('0x16')](config['root'],_0x5eef('0x17')));},'filename':function(_0x2c279e,_0x2f5b0c,_0x3325b1){_0x3325b1(null,util[_0x5eef('0x18')](_0x5eef('0x19'),_0x5eef('0x24'),path[_0x5eef('0x1b')](_0x2f5b0c[_0x5eef('0x1c')])));}})});router[_0x5eef('0x1d')](_0x5eef('0x13'),upload[_0x5eef('0x1e')](_0x5eef('0x22')),controller[_0x5eef('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x47bf7f,_0x291cd0,_0x1f8a1a){_0x1f8a1a(null,path['join'](config[_0x5eef('0x20')],'server/files/images/logos/'));},'filename':function(_0x81979e,_0x47c5d8,_0x176181){_0x176181(null,util[_0x5eef('0x18')]('%s%s','favicon',path['extname'](_0x47c5d8[_0x5eef('0x1c')])));}})});router[_0x5eef('0x1d')](_0x5eef('0x26'),upload[_0x5eef('0x1e')]('file'),controller['addFavicon']);router['put'](_0x5eef('0xe'),auth[_0x5eef('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index d77cd15..b51ade8 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x131763,_0x47f2d4){var _0x3ea3ef=function(_0x49346e){while(--_0x49346e){_0x131763['push'](_0x131763['shift']());}};_0x3ea3ef(++_0x47f2d4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0x0b0e[_0x2390bd];return _0x3a969d;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x547596,_0x4d1935){var _0x3ea693=function(_0x34e174){while(--_0x34e174){_0x547596['push'](_0x547596['shift']());}};_0x3ea693(++_0x4d1935);}(_0x7a54,0x106));var _0x47a5=function(_0x4267c0,_0x206ddd){_0x4267c0=_0x4267c0-0x0;var _0x386ac0=_0x7a54[_0x4267c0];return _0x386ac0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 7639cf3..e36b9fa 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 _0x8d5b=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','keys','options','find','body','file','filename','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','loginLogo','preferred','favicon','defaultLoginLogo','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','defaultFavicon','default_loginLogo.svg','download','gdpr','securePassword','getPreferred','defaultLogo','defaultPreferred','default','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','map','Setting','type','key','model','query','filters','intersection','attributes'];(function(_0x349509,_0x2e032f){var _0x5a8fea=function(_0x317ee2){while(--_0x317ee2){_0x349509['push'](_0x349509['shift']());}};_0x5a8fea(++_0x2e032f);}(_0x8d5b,0x19f));var _0xb8d5=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x8d5b[_0x43776a];return _0x18eb8f;};'use strict';var emlformat=require(_0xb8d5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb8d5('0x1'));var rp=require(_0xb8d5('0x2'));var moment=require(_0xb8d5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb8d5('0x4'));var util=require(_0xb8d5('0x5'));var path=require(_0xb8d5('0x6'));var sox=require(_0xb8d5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8d5('0x8'));var _=require('lodash');var squel=require(_0xb8d5('0x9'));var crypto=require(_0xb8d5('0xa'));var jsforce=require(_0xb8d5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb8d5('0xc'));var querystring=require(_0xb8d5('0xd'));var Papa=require(_0xb8d5('0xe'));var Redis=require(_0xb8d5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8d5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8d5('0x11'));var logger=require(_0xb8d5('0x12'))(_0xb8d5('0x13'));var utils=require(_0xb8d5('0x14'));var config=require(_0xb8d5('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xb8d5('0x16'));var client=jayson[_0xb8d5('0x17')][_0xb8d5('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x564743,_0x290cc5,_0x328bf9,_0x164d38){return new BPromise(function(_0x3b1c77,_0x10c370){var _0x12d52a=_0x164d38||client;return _0x12d52a[_0xb8d5('0x19')](_0x564743,_0x328bf9)[_0xb8d5('0x1a')](function(_0x308414){logger[_0xb8d5('0x1b')](_0xb8d5('0x1c'),_0x290cc5,_0xb8d5('0x1d'));logger[_0xb8d5('0x1e')](_0xb8d5('0x1f'),_0x290cc5,_0xb8d5('0x1d'),JSON[_0xb8d5('0x20')](_0x308414));if(_0x308414[_0xb8d5('0x21')]){if(_0x308414['error'][_0xb8d5('0x22')]===0x1f4){logger[_0xb8d5('0x21')](_0xb8d5('0x1c'),_0x290cc5,_0x308414[_0xb8d5('0x21')]['message']);return _0x10c370(_0x308414[_0xb8d5('0x21')]['message']);}logger['error'](_0xb8d5('0x1c'),_0x290cc5,_0x308414[_0xb8d5('0x21')]['message']);return _0x3b1c77(_0x308414['error'][_0xb8d5('0x23')]);}else{logger[_0xb8d5('0x1b')](_0xb8d5('0x1c'),_0x290cc5,_0xb8d5('0x1d'));_0x3b1c77(_0x308414[_0xb8d5('0x24')][_0xb8d5('0x23')]);}})[_0xb8d5('0x25')](function(_0x3daf43){logger[_0xb8d5('0x21')]('Setting,\x20%s,\x20%s',_0x290cc5,_0x3daf43);_0x10c370(_0x3daf43);});});}function respondWithStatusCode(_0x3d5622,_0x36f66c){_0x36f66c=_0x36f66c||0xcc;return function(_0x40fb9c){if(_0x40fb9c){return _0x3d5622[_0xb8d5('0x26')](_0x36f66c);}return _0x3d5622[_0xb8d5('0x27')](_0x36f66c)[_0xb8d5('0x28')]();};}function respondWithResult(_0x49c11e,_0x30cea0){_0x30cea0=_0x30cea0||0xc8;return function(_0x377dcf){if(_0x377dcf){return _0x49c11e[_0xb8d5('0x27')](_0x30cea0)['json'](_0x377dcf);}};}function respondWithFilteredResult(_0x4fcc39,_0x130417){return function(_0x3f9a98){if(_0x3f9a98){var _0x4b741b=typeof _0x130417[_0xb8d5('0x29')]===_0xb8d5('0x2a')&&typeof _0x130417[_0xb8d5('0x2b')]===_0xb8d5('0x2a');var _0x4d44f9=_0x3f9a98[_0xb8d5('0x2c')];var _0x543e65=_0x4b741b?0x0:_0x130417[_0xb8d5('0x29')];var _0x488fc8=_0x4b741b?_0x3f9a98[_0xb8d5('0x2c')]:_0x130417['offset']+_0x130417[_0xb8d5('0x2b')];var _0x4855e0;if(_0x488fc8>=_0x4d44f9){_0x488fc8=_0x4d44f9;_0x4855e0=0xc8;}else{_0x4855e0=0xce;}_0x4fcc39[_0xb8d5('0x27')](_0x4855e0);return _0x4fcc39[_0xb8d5('0x2d')](_0xb8d5('0x2e'),_0x543e65+'-'+_0x488fc8+'/'+_0x4d44f9)[_0xb8d5('0x2f')](_0x3f9a98);}return null;};}function patchUpdates(_0x508829){return function(_0x515be2){try{jsonpatch[_0xb8d5('0x30')](_0x515be2,_0x508829,!![]);}catch(_0x5c1cb6){return BPromise[_0xb8d5('0x31')](_0x5c1cb6);}return _0x515be2[_0xb8d5('0x32')]();};}function saveUpdates(_0x398ef1,_0x173839){return function(_0x717ea0){if(_0x717ea0){return _0x717ea0[_0xb8d5('0x33')](_0x398ef1)[_0xb8d5('0x1a')](function(_0x516871){return _0x516871;});}return null;};}function removeEntity(_0x29e650,_0x385865){return function(_0x372df4){if(_0x372df4){return _0x372df4['destroy']()[_0xb8d5('0x1a')](function(){_0x29e650['status'](0xcc)[_0xb8d5('0x28')]();});}};}function handleEntityNotFound(_0x256464,_0x102f61){return function(_0x5e3104){if(!_0x5e3104){_0x256464['sendStatus'](0x194);}return _0x5e3104;};}function handleError(_0x533f2d,_0x1b9b5b){_0x1b9b5b=_0x1b9b5b||0x1f4;return function(_0x4d2eca){logger['error'](_0x4d2eca[_0xb8d5('0x34')]);if(_0x4d2eca[_0xb8d5('0x35')]){delete _0x4d2eca[_0xb8d5('0x35')];}_0x533f2d[_0xb8d5('0x27')](_0x1b9b5b)[_0xb8d5('0x36')](_0x4d2eca);};}exports[_0xb8d5('0x37')]=function(_0x17229d,_0x5914ee){var _0x47b2fa={},_0x136748={},_0x3d3e04={'count':0x0,'rows':[]};var _0x4d4933=_[_0xb8d5('0x38')](db[_0xb8d5('0x39')]['rawAttributes'],function(_0x226c04){return{'name':_0x226c04['fieldName'],'type':_0x226c04[_0xb8d5('0x3a')][_0xb8d5('0x3b')]};});_0x136748[_0xb8d5('0x3c')]=_[_0xb8d5('0x38')](_0x4d4933,_0xb8d5('0x35'));_0x136748[_0xb8d5('0x3d')]=_['keys'](_0x17229d[_0xb8d5('0x3d')]);_0x136748[_0xb8d5('0x3e')]=_[_0xb8d5('0x3f')](_0x136748[_0xb8d5('0x3c')],_0x136748['query']);_0x47b2fa[_0xb8d5('0x40')]=_['intersection'](_0x136748[_0xb8d5('0x3c')],qs[_0xb8d5('0x41')](_0x17229d[_0xb8d5('0x3d')][_0xb8d5('0x41')]));_0x47b2fa['attributes']=_0x47b2fa[_0xb8d5('0x40')][_0xb8d5('0x42')]?_0x47b2fa[_0xb8d5('0x40')]:_0x136748[_0xb8d5('0x3c')];if(!_0x17229d[_0xb8d5('0x3d')][_0xb8d5('0x43')](_0xb8d5('0x44'))){_0x47b2fa['limit']=qs[_0xb8d5('0x2b')](_0x17229d['query'][_0xb8d5('0x2b')]);_0x47b2fa[_0xb8d5('0x29')]=qs[_0xb8d5('0x29')](_0x17229d['query'][_0xb8d5('0x29')]);}_0x47b2fa[_0xb8d5('0x45')]=qs['sort'](_0x17229d['query'][_0xb8d5('0x46')]);_0x47b2fa[_0xb8d5('0x47')]=qs[_0xb8d5('0x3e')](_['pick'](_0x17229d[_0xb8d5('0x3d')],_0x136748[_0xb8d5('0x3e')]),_0x4d4933);if(_0x17229d[_0xb8d5('0x3d')][_0xb8d5('0x48')]){_0x47b2fa['where']=_[_0xb8d5('0x49')](_0x47b2fa[_0xb8d5('0x47')],{'$or':_[_0xb8d5('0x38')](_0x4d4933,function(_0x17e275){if(_0x17e275['type']!=='VIRTUAL'){var _0x3cd733={};_0x3cd733[_0x17e275[_0xb8d5('0x35')]]={'$like':'%'+_0x17229d[_0xb8d5('0x3d')]['filter']+'%'};return _0x3cd733;}})});}_0x47b2fa=_[_0xb8d5('0x49')]({},_0x47b2fa,_0x17229d['options']);var _0x35fb9f={'where':_0x47b2fa[_0xb8d5('0x47')]};return db[_0xb8d5('0x39')][_0xb8d5('0x2c')](_0x35fb9f)[_0xb8d5('0x1a')](function(_0x40b45a){_0x3d3e04['count']=_0x40b45a;if(_0x17229d[_0xb8d5('0x3d')][_0xb8d5('0x4a')]){_0x47b2fa[_0xb8d5('0x4b')]=[{'all':!![]}];}return db['Setting'][_0xb8d5('0x4c')](_0x47b2fa);})[_0xb8d5('0x1a')](function(_0xee7884){_0x3d3e04[_0xb8d5('0x4d')]=_0xee7884;return _0x3d3e04;})[_0xb8d5('0x1a')](respondWithFilteredResult(_0x5914ee,_0x47b2fa))[_0xb8d5('0x25')](handleError(_0x5914ee,null));};exports[_0xb8d5('0x4e')]=function(_0x2bcb89,_0x5e08eb){var _0x7fc540={'raw':![],'where':{'id':_0x2bcb89[_0xb8d5('0x4f')]['id']}},_0x349e60={};_0x349e60['model']=_[_0xb8d5('0x50')](db[_0xb8d5('0x39')]['rawAttributes']);_0x349e60[_0xb8d5('0x3d')]=_[_0xb8d5('0x50')](_0x2bcb89[_0xb8d5('0x3d')]);_0x349e60[_0xb8d5('0x3e')]=_[_0xb8d5('0x3f')](_0x349e60[_0xb8d5('0x3c')],_0x349e60[_0xb8d5('0x3d')]);_0x7fc540[_0xb8d5('0x40')]=_[_0xb8d5('0x3f')](_0x349e60[_0xb8d5('0x3c')],qs[_0xb8d5('0x41')](_0x2bcb89['query'][_0xb8d5('0x41')]));_0x7fc540[_0xb8d5('0x40')]=_0x7fc540[_0xb8d5('0x40')][_0xb8d5('0x42')]?_0x7fc540[_0xb8d5('0x40')]:_0x349e60[_0xb8d5('0x3c')];if(_0x2bcb89['query'][_0xb8d5('0x4a')]){_0x7fc540[_0xb8d5('0x4b')]=[{'all':!![]}];}_0x7fc540=_['merge']({},_0x7fc540,_0x2bcb89[_0xb8d5('0x51')]);return db['Setting'][_0xb8d5('0x52')](_0x7fc540)[_0xb8d5('0x1a')](handleEntityNotFound(_0x5e08eb,null))[_0xb8d5('0x1a')](respondWithResult(_0x5e08eb,null))[_0xb8d5('0x25')](handleError(_0x5e08eb,null));};exports['update']=function(_0xa05550,_0x30ac8f){if(_0xa05550[_0xb8d5('0x53')]['id']){delete _0xa05550['body']['id'];}return db[_0xb8d5('0x39')]['find']({'where':{'id':_0xa05550['params']['id']}})[_0xb8d5('0x1a')](handleEntityNotFound(_0x30ac8f,null))['then'](saveUpdates(_0xa05550[_0xb8d5('0x53')],null))[_0xb8d5('0x1a')](respondWithResult(_0x30ac8f,null))[_0xb8d5('0x25')](handleError(_0x30ac8f,null));};exports['addLogo']=function(_0x4b333f,_0x4999c3,_0x472305){if(_0x4b333f['file']&&_0x4b333f[_0xb8d5('0x54')][_0xb8d5('0x55')]){_0x4b333f[_0xb8d5('0x53')]['logo']=_0x4b333f['file'][_0xb8d5('0x55')];}return db['Setting'][_0xb8d5('0x52')]({'where':{'id':_0x4b333f[_0xb8d5('0x4f')]['id']}})[_0xb8d5('0x1a')](handleEntityNotFound(_0x4999c3,null))[_0xb8d5('0x1a')](saveUpdates(_0x4b333f[_0xb8d5('0x53')],null))['then'](respondWithResult(_0x4999c3,null))['catch'](handleError(_0x4999c3,null));};exports['addLogoLogin']=function(_0x2a195a,_0x2e867d,_0x243623){if(_0x2a195a[_0xb8d5('0x54')]&&_0x2a195a['file'][_0xb8d5('0x55')]){_0x2a195a[_0xb8d5('0x53')]['loginLogo']=_0x2a195a['file'][_0xb8d5('0x55')];}return db['Setting'][_0xb8d5('0x52')]({'where':{'id':_0x2a195a[_0xb8d5('0x4f')]['id']}})[_0xb8d5('0x1a')](handleEntityNotFound(_0x2e867d,null))['then'](saveUpdates(_0x2a195a[_0xb8d5('0x53')],null))[_0xb8d5('0x1a')](respondWithResult(_0x2e867d,null))['catch'](handleError(_0x2e867d,null));};var utilLicense=require(_0xb8d5('0x56'));exports[_0xb8d5('0x57')]=function(_0x2ab3e4,_0x507f96,_0x38580f){var _0x2959a8=_0xb8d5('0x58');var _0x4fa30e={'custom':![]};return utilLicense[_0xb8d5('0x59')]()['then'](function(_0x5416b7){if(_0x5416b7){_0x4fa30e=_0x5416b7;}return db['Setting'][_0xb8d5('0x52')]({'where':{'id':_0x2ab3e4[_0xb8d5('0x4f')]['id']},'attributes':[_0xb8d5('0x5a'),_0xb8d5('0x5b'),_0xb8d5('0x5c'),_0xb8d5('0x5d'),'defaultLogo',_0xb8d5('0x5e'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xb8d5('0x1a')](handleEntityNotFound(_0x507f96,null))[_0xb8d5('0x1a')](function(_0x1f8b0e){if(_0x1f8b0e){var _0xa14c0a=_0x1f8b0e[_0xb8d5('0x5a')]&&fs[_0xb8d5('0x5f')](path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x2959a8,_[_0xb8d5('0x62')](_0x1f8b0e[_0xb8d5('0x5a')])))?path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x2959a8,_[_0xb8d5('0x62')](_0x1f8b0e['logo'])):path[_0xb8d5('0x60')](config['root'],_0x2959a8,_['toLower'](_0xb8d5('0x63')));var _0x54178b='default'+_[_0xb8d5('0x64')]('logo');if(_0x1f8b0e[_0x54178b]||!_0x4fa30e[_0xb8d5('0x65')]){_0xa14c0a=path['join'](config[_0xb8d5('0x61')],_0x2959a8,_[_0xb8d5('0x62')](_0xb8d5('0x63')));}if(!fs['existsSync'](_0xa14c0a)){throw new db[(_0xb8d5('0x66'))][(_0xb8d5('0x67'))](_['upperFirst']('logo')+_0xb8d5('0x68'));}return _0x507f96['download'](_0xa14c0a);}})[_0xb8d5('0x25')](handleError(_0x507f96,null));};var utilLicense=require('../../config/license/util');exports[_0xb8d5('0x69')]=function(_0xcaa70d,_0x30fd99,_0xdcd433){var _0x446321=_0xb8d5('0x58');var _0x30d29e={'custom':![]};return utilLicense[_0xb8d5('0x59')]()[_0xb8d5('0x1a')](function(_0x4cf8a5){if(_0x4cf8a5){_0x30d29e=_0x4cf8a5;}return db[_0xb8d5('0x39')]['find']({'where':{'id':_0xcaa70d[_0xb8d5('0x4f')]['id']},'attributes':[_0xb8d5('0x5a'),_0xb8d5('0x5b'),_0xb8d5('0x5c'),_0xb8d5('0x5d'),'defaultLogo',_0xb8d5('0x5e'),'defaultPreferred',_0xb8d5('0x6a')],'raw':!![]});})[_0xb8d5('0x1a')](handleEntityNotFound(_0x30fd99,null))[_0xb8d5('0x1a')](function(_0x4c556f){if(_0x4c556f){var _0x285514=_0x4c556f[_0xb8d5('0x5b')]&&fs['existsSync'](path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x446321,_[_0xb8d5('0x62')](_0x4c556f[_0xb8d5('0x5b')])))?path['join'](config[_0xb8d5('0x61')],_0x446321,_[_0xb8d5('0x62')](_0x4c556f[_0xb8d5('0x5b')])):path[_0xb8d5('0x60')](config['root'],_0x446321,_[_0xb8d5('0x62')](_0xb8d5('0x6b')));var _0x3a6538='default'+_['upperFirst'](_0xb8d5('0x5b'));if(_0x4c556f[_0x3a6538]||!_0x30d29e[_0xb8d5('0x65')]){_0x285514=path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x446321,_['toLower'](_0xb8d5('0x6b')));}if(!fs[_0xb8d5('0x5f')](_0x285514)){throw new db[(_0xb8d5('0x66'))][(_0xb8d5('0x67'))](_[_0xb8d5('0x64')](_0xb8d5('0x5b'))+_0xb8d5('0x68'));}return _0x30fd99[_0xb8d5('0x6c')](_0x285514);}})[_0xb8d5('0x25')](handleError(_0x30fd99,null));};exports[_0xb8d5('0x6d')]=function(_0x1bf8d0,_0x3a1529){return db[_0xb8d5('0x39')][_0xb8d5('0x52')]({'where':{'id':_0x1bf8d0['params']['id']},'attributes':[_0xb8d5('0x6e')]})[_0xb8d5('0x1a')](respondWithResult(_0x3a1529,null))[_0xb8d5('0x25')](handleError(_0x3a1529,null));};exports['addPreferred']=function(_0x328100,_0x48ee2b,_0x4b3948){if(_0x328100[_0xb8d5('0x54')]&&_0x328100[_0xb8d5('0x54')][_0xb8d5('0x55')]){_0x328100[_0xb8d5('0x53')][_0xb8d5('0x5c')]=_0x328100[_0xb8d5('0x54')]['filename'];}return db[_0xb8d5('0x39')][_0xb8d5('0x52')]({'where':{'id':_0x328100['params']['id']}})[_0xb8d5('0x1a')](handleEntityNotFound(_0x48ee2b,null))[_0xb8d5('0x1a')](saveUpdates(_0x328100[_0xb8d5('0x53')],null))['then'](respondWithResult(_0x48ee2b,null))[_0xb8d5('0x25')](handleError(_0x48ee2b,null));};var utilLicense=require(_0xb8d5('0x56'));exports[_0xb8d5('0x6f')]=function(_0x5a283d,_0xe98c6b,_0x50e4d1){var _0x1da470='server/files/images/logos';var _0x15e8f5={'custom':![]};return utilLicense[_0xb8d5('0x59')]()['then'](function(_0x42e7d0){if(_0x42e7d0){_0x15e8f5=_0x42e7d0;}return db[_0xb8d5('0x39')]['find']({'where':{'id':_0x5a283d[_0xb8d5('0x4f')]['id']},'attributes':['logo','loginLogo',_0xb8d5('0x5c'),_0xb8d5('0x5d'),_0xb8d5('0x70'),_0xb8d5('0x5e'),_0xb8d5('0x71'),_0xb8d5('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0xe98c6b,null))[_0xb8d5('0x1a')](function(_0x356887){if(_0x356887){var _0x2104ce=_0x356887[_0xb8d5('0x5c')]&&fs[_0xb8d5('0x5f')](path['join'](config[_0xb8d5('0x61')],_0x1da470,_['toLower'](_0x356887[_0xb8d5('0x5c')])))?path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x1da470,_['toLower'](_0x356887[_0xb8d5('0x5c')])):path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x1da470,_[_0xb8d5('0x62')]('default_preferred.png'));var _0x4d7909=_0xb8d5('0x72')+_[_0xb8d5('0x64')]('preferred');if(_0x356887[_0x4d7909]||!_0x15e8f5[_0xb8d5('0x65')]||!_0x15e8f5[_0xb8d5('0x5c')]){_0x2104ce=path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x1da470,_[_0xb8d5('0x62')]('default_preferred.png'));}if(!fs[_0xb8d5('0x5f')](_0x2104ce)){throw new db[(_0xb8d5('0x66'))][(_0xb8d5('0x67'))](_[_0xb8d5('0x64')]('preferred')+_0xb8d5('0x68'));}return _0xe98c6b['download'](_0x2104ce);}})[_0xb8d5('0x25')](handleError(_0xe98c6b,null));};exports[_0xb8d5('0x73')]=function(_0x5e6a7b,_0x3611cf,_0x51a102){if(_0x5e6a7b[_0xb8d5('0x54')]&&_0x5e6a7b['file'][_0xb8d5('0x55')]){_0x5e6a7b[_0xb8d5('0x53')][_0xb8d5('0x5d')]=_0x5e6a7b[_0xb8d5('0x54')][_0xb8d5('0x55')];}return db['Setting'][_0xb8d5('0x52')]({'where':{'id':_0x5e6a7b['params']['id']}})[_0xb8d5('0x1a')](handleEntityNotFound(_0x3611cf,null))[_0xb8d5('0x1a')](saveUpdates(_0x5e6a7b[_0xb8d5('0x53')],null))[_0xb8d5('0x1a')](respondWithResult(_0x3611cf,null))['catch'](handleError(_0x3611cf,null));};var utilLicense=require(_0xb8d5('0x56'));exports[_0xb8d5('0x74')]=function(_0x125a81,_0x4e49b4,_0x13abfd){var _0x26687b='server/files/images/logos';var _0x658c9b={'custom':![]};return utilLicense[_0xb8d5('0x59')]()[_0xb8d5('0x1a')](function(_0xc88e8b){if(_0xc88e8b){_0x658c9b=_0xc88e8b;}return db[_0xb8d5('0x39')][_0xb8d5('0x52')]({'where':{'id':_0x125a81[_0xb8d5('0x4f')]['id']},'attributes':[_0xb8d5('0x5a'),_0xb8d5('0x5b'),_0xb8d5('0x5c'),'favicon','defaultLogo',_0xb8d5('0x5e'),_0xb8d5('0x71'),_0xb8d5('0x6a')],'raw':!![]});})[_0xb8d5('0x1a')](handleEntityNotFound(_0x4e49b4,null))[_0xb8d5('0x1a')](function(_0x47d1bc){if(_0x47d1bc){var _0x3409f3=_0x47d1bc[_0xb8d5('0x5d')]&&fs[_0xb8d5('0x5f')](path[_0xb8d5('0x60')](config['root'],_0x26687b,_['toLower'](_0x47d1bc[_0xb8d5('0x5d')])))?path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x26687b,_[_0xb8d5('0x62')](_0x47d1bc[_0xb8d5('0x5d')])):path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x26687b,_[_0xb8d5('0x62')](_0xb8d5('0x75')));var _0xc14dc5=_0xb8d5('0x72')+_[_0xb8d5('0x64')](_0xb8d5('0x5d'));if(_0x47d1bc[_0xc14dc5]||!_0x658c9b['custom']){_0x3409f3=path[_0xb8d5('0x60')](config[_0xb8d5('0x61')],_0x26687b,_[_0xb8d5('0x62')](_0xb8d5('0x75')));}if(!fs[_0xb8d5('0x5f')](_0x3409f3)){throw new db['Sequelize'][(_0xb8d5('0x67'))](_[_0xb8d5('0x64')]('favicon')+_0xb8d5('0x68'));}return _0x4e49b4['download'](_0x3409f3);}})[_0xb8d5('0x25')](handleError(_0x4e49b4,null));};exports['getDate']=function(_0x2b1f48,_0x444b7b){var _0x494663={'offset':moment()['utcOffset']()};_0x494663['now']=moment()[_0xb8d5('0x76')](_0x494663[_0xb8d5('0x29')])[_0xb8d5('0x77')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x444b7b[_0xb8d5('0x27')](0xc8)['send'](_0x494663);}; \ No newline at end of file +var _0xe0c3=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','destroy','end','stack','name','send','index','map','Setting','fieldName','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','show','rawAttributes','fields','includeAll','find','update','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLoginLogo','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x5904b9,_0x366cb5){var _0x43306e=function(_0x1fa996){while(--_0x1fa996){_0x5904b9['push'](_0x5904b9['shift']());}};_0x43306e(++_0x366cb5);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e0c('0x1'));var jsonpatch=require(_0x3e0c('0x2'));var rp=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var BPromise=require(_0x3e0c('0x5'));var Mustache=require(_0x3e0c('0x6'));var util=require(_0x3e0c('0x7'));var path=require(_0x3e0c('0x8'));var sox=require(_0x3e0c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e0c('0xa'));var _=require(_0x3e0c('0xb'));var squel=require(_0x3e0c('0xc'));var crypto=require(_0x3e0c('0xd'));var jsforce=require(_0x3e0c('0xe'));var deskjs=require(_0x3e0c('0xf'));var toCsv=require(_0x3e0c('0x10'));var querystring=require(_0x3e0c('0x11'));var Papa=require(_0x3e0c('0x12'));var Redis=require(_0x3e0c('0x13'));var authService=require(_0x3e0c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e0c('0x15'));var logger=require(_0x3e0c('0x16'))(_0x3e0c('0x17'));var utils=require(_0x3e0c('0x18'));var config=require(_0x3e0c('0x19'));var licenseUtil=require(_0x3e0c('0x1a'));var db=require(_0x3e0c('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3e0c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2589fc,_0x23a6a8,_0x5d0ab7,_0x5f2654){return new BPromise(function(_0x6d9c61,_0x409b2c){var _0x40e308=_0x5f2654||client;return _0x40e308[_0x3e0c('0x1d')](_0x2589fc,_0x5d0ab7)[_0x3e0c('0x1e')](function(_0x24fcf9){logger[_0x3e0c('0x1f')](_0x3e0c('0x20'),_0x23a6a8,_0x3e0c('0x21'));logger[_0x3e0c('0x22')](_0x3e0c('0x23'),_0x23a6a8,'request\x20sent',JSON['stringify'](_0x24fcf9));if(_0x24fcf9[_0x3e0c('0x24')]){if(_0x24fcf9[_0x3e0c('0x24')][_0x3e0c('0x25')]===0x1f4){logger[_0x3e0c('0x24')](_0x3e0c('0x20'),_0x23a6a8,_0x24fcf9[_0x3e0c('0x24')]['message']);return _0x409b2c(_0x24fcf9[_0x3e0c('0x24')][_0x3e0c('0x26')]);}logger[_0x3e0c('0x24')]('Setting,\x20%s,\x20%s',_0x23a6a8,_0x24fcf9[_0x3e0c('0x24')]['message']);return _0x6d9c61(_0x24fcf9['error'][_0x3e0c('0x26')]);}else{logger[_0x3e0c('0x1f')](_0x3e0c('0x20'),_0x23a6a8,_0x3e0c('0x21'));_0x6d9c61(_0x24fcf9['result']['message']);}})[_0x3e0c('0x27')](function(_0x4fa955){logger['error'](_0x3e0c('0x20'),_0x23a6a8,_0x4fa955);_0x409b2c(_0x4fa955);});});}function respondWithStatusCode(_0x1769b1,_0x44ce68){_0x44ce68=_0x44ce68||0xcc;return function(_0x5bb7aa){if(_0x5bb7aa){return _0x1769b1[_0x3e0c('0x28')](_0x44ce68);}return _0x1769b1[_0x3e0c('0x29')](_0x44ce68)['end']();};}function respondWithResult(_0x7dba09,_0x3de58b){_0x3de58b=_0x3de58b||0xc8;return function(_0x308fd5){if(_0x308fd5){return _0x7dba09[_0x3e0c('0x29')](_0x3de58b)['json'](_0x308fd5);}};}function respondWithFilteredResult(_0x412960,_0xc2f3cc){return function(_0x2c5fba){if(_0x2c5fba){var _0x26e01f=typeof _0xc2f3cc['offset']===_0x3e0c('0x2a')&&typeof _0xc2f3cc['limit']==='undefined';var _0x477ebc=_0x2c5fba[_0x3e0c('0x2b')];var _0x4d3ce2=_0x26e01f?0x0:_0xc2f3cc[_0x3e0c('0x2c')];var _0x3f22b1=_0x26e01f?_0x2c5fba[_0x3e0c('0x2b')]:_0xc2f3cc['offset']+_0xc2f3cc[_0x3e0c('0x2d')];var _0x1caf48;if(_0x3f22b1>=_0x477ebc){_0x3f22b1=_0x477ebc;_0x1caf48=0xc8;}else{_0x1caf48=0xce;}_0x412960['status'](_0x1caf48);return _0x412960[_0x3e0c('0x2e')](_0x3e0c('0x2f'),_0x4d3ce2+'-'+_0x3f22b1+'/'+_0x477ebc)[_0x3e0c('0x30')](_0x2c5fba);}return null;};}function patchUpdates(_0x8eb04b){return function(_0x51b0e5){try{jsonpatch[_0x3e0c('0x31')](_0x51b0e5,_0x8eb04b,!![]);}catch(_0x132d69){return BPromise[_0x3e0c('0x32')](_0x132d69);}return _0x51b0e5['save']();};}function saveUpdates(_0x1dcfe2,_0x1832c5){return function(_0x90052d){if(_0x90052d){return _0x90052d['update'](_0x1dcfe2)[_0x3e0c('0x1e')](function(_0x46ab78){return _0x46ab78;});}return null;};}function removeEntity(_0x5d592e,_0x119409){return function(_0x43bf5){if(_0x43bf5){return _0x43bf5[_0x3e0c('0x33')]()[_0x3e0c('0x1e')](function(){_0x5d592e[_0x3e0c('0x29')](0xcc)[_0x3e0c('0x34')]();});}};}function handleEntityNotFound(_0x3b41dd,_0x5d9473){return function(_0x159bc6){if(!_0x159bc6){_0x3b41dd[_0x3e0c('0x28')](0x194);}return _0x159bc6;};}function handleError(_0x6c96c5,_0x48c307){_0x48c307=_0x48c307||0x1f4;return function(_0x1bf622){logger[_0x3e0c('0x24')](_0x1bf622[_0x3e0c('0x35')]);if(_0x1bf622[_0x3e0c('0x36')]){delete _0x1bf622[_0x3e0c('0x36')];}_0x6c96c5[_0x3e0c('0x29')](_0x48c307)[_0x3e0c('0x37')](_0x1bf622);};}exports[_0x3e0c('0x38')]=function(_0x4b7643,_0x4ce63b){var _0x12b8b9={},_0x120b35={},_0x3bdde2={'count':0x0,'rows':[]};var _0x319cd4=_[_0x3e0c('0x39')](db[_0x3e0c('0x3a')]['rawAttributes'],function(_0x2a91e3){return{'name':_0x2a91e3[_0x3e0c('0x3b')],'type':_0x2a91e3['type']['key']};});_0x120b35['model']=_[_0x3e0c('0x39')](_0x319cd4,_0x3e0c('0x36'));_0x120b35[_0x3e0c('0x3c')]=_[_0x3e0c('0x3d')](_0x4b7643[_0x3e0c('0x3c')]);_0x120b35[_0x3e0c('0x3e')]=_[_0x3e0c('0x3f')](_0x120b35[_0x3e0c('0x40')],_0x120b35[_0x3e0c('0x3c')]);_0x12b8b9[_0x3e0c('0x41')]=_[_0x3e0c('0x3f')](_0x120b35[_0x3e0c('0x40')],qs['fields'](_0x4b7643['query']['fields']));_0x12b8b9[_0x3e0c('0x41')]=_0x12b8b9[_0x3e0c('0x41')]['length']?_0x12b8b9['attributes']:_0x120b35[_0x3e0c('0x40')];if(!_0x4b7643[_0x3e0c('0x3c')][_0x3e0c('0x42')](_0x3e0c('0x43'))){_0x12b8b9['limit']=qs[_0x3e0c('0x2d')](_0x4b7643[_0x3e0c('0x3c')][_0x3e0c('0x2d')]);_0x12b8b9[_0x3e0c('0x2c')]=qs[_0x3e0c('0x2c')](_0x4b7643['query'][_0x3e0c('0x2c')]);}_0x12b8b9['order']=qs[_0x3e0c('0x44')](_0x4b7643[_0x3e0c('0x3c')]['sort']);_0x12b8b9['where']=qs[_0x3e0c('0x3e')](_[_0x3e0c('0x45')](_0x4b7643['query'],_0x120b35[_0x3e0c('0x3e')]),_0x319cd4);if(_0x4b7643[_0x3e0c('0x3c')][_0x3e0c('0x46')]){_0x12b8b9[_0x3e0c('0x47')]=_[_0x3e0c('0x48')](_0x12b8b9[_0x3e0c('0x47')],{'$or':_['map'](_0x319cd4,function(_0x129da7){if(_0x129da7[_0x3e0c('0x49')]!==_0x3e0c('0x4a')){var _0x301c07={};_0x301c07[_0x129da7[_0x3e0c('0x36')]]={'$like':'%'+_0x4b7643[_0x3e0c('0x3c')]['filter']+'%'};return _0x301c07;}})});}_0x12b8b9=_[_0x3e0c('0x48')]({},_0x12b8b9,_0x4b7643[_0x3e0c('0x4b')]);var _0x323246={'where':_0x12b8b9['where']};return db[_0x3e0c('0x3a')][_0x3e0c('0x2b')](_0x323246)['then'](function(_0x19216d){_0x3bdde2[_0x3e0c('0x2b')]=_0x19216d;if(_0x4b7643[_0x3e0c('0x3c')]['includeAll']){_0x12b8b9[_0x3e0c('0x4c')]=[{'all':!![]}];}return db[_0x3e0c('0x3a')][_0x3e0c('0x4d')](_0x12b8b9);})[_0x3e0c('0x1e')](function(_0x109078){_0x3bdde2[_0x3e0c('0x4e')]=_0x109078;return _0x3bdde2;})[_0x3e0c('0x1e')](respondWithFilteredResult(_0x4ce63b,_0x12b8b9))[_0x3e0c('0x27')](handleError(_0x4ce63b,null));};exports[_0x3e0c('0x4f')]=function(_0x2e499b,_0x1b0432){var _0x4efbf2={'raw':![],'where':{'id':_0x2e499b['params']['id']}},_0x20c9df={};_0x20c9df['model']=_[_0x3e0c('0x3d')](db['Setting'][_0x3e0c('0x50')]);_0x20c9df[_0x3e0c('0x3c')]=_['keys'](_0x2e499b[_0x3e0c('0x3c')]);_0x20c9df[_0x3e0c('0x3e')]=_['intersection'](_0x20c9df[_0x3e0c('0x40')],_0x20c9df[_0x3e0c('0x3c')]);_0x4efbf2[_0x3e0c('0x41')]=_[_0x3e0c('0x3f')](_0x20c9df[_0x3e0c('0x40')],qs[_0x3e0c('0x51')](_0x2e499b[_0x3e0c('0x3c')][_0x3e0c('0x51')]));_0x4efbf2[_0x3e0c('0x41')]=_0x4efbf2[_0x3e0c('0x41')]['length']?_0x4efbf2[_0x3e0c('0x41')]:_0x20c9df[_0x3e0c('0x40')];if(_0x2e499b[_0x3e0c('0x3c')][_0x3e0c('0x52')]){_0x4efbf2[_0x3e0c('0x4c')]=[{'all':!![]}];}_0x4efbf2=_[_0x3e0c('0x48')]({},_0x4efbf2,_0x2e499b[_0x3e0c('0x4b')]);return db[_0x3e0c('0x3a')][_0x3e0c('0x53')](_0x4efbf2)[_0x3e0c('0x1e')](handleEntityNotFound(_0x1b0432,null))[_0x3e0c('0x1e')](respondWithResult(_0x1b0432,null))[_0x3e0c('0x27')](handleError(_0x1b0432,null));};exports[_0x3e0c('0x54')]=function(_0x386f46,_0x5e9ede){if(_0x386f46[_0x3e0c('0x55')]['id']){delete _0x386f46[_0x3e0c('0x55')]['id'];}return db[_0x3e0c('0x3a')]['find']({'where':{'id':_0x386f46[_0x3e0c('0x56')]['id']}})[_0x3e0c('0x1e')](handleEntityNotFound(_0x5e9ede,null))[_0x3e0c('0x1e')](saveUpdates(_0x386f46[_0x3e0c('0x55')],null))[_0x3e0c('0x1e')](respondWithResult(_0x5e9ede,null))[_0x3e0c('0x27')](handleError(_0x5e9ede,null));};exports[_0x3e0c('0x57')]=function(_0x29cedc,_0x994b2c,_0x2f9547){if(_0x29cedc['file']&&_0x29cedc[_0x3e0c('0x58')][_0x3e0c('0x59')]){_0x29cedc['body'][_0x3e0c('0x5a')]=_0x29cedc['file'][_0x3e0c('0x59')];}return db[_0x3e0c('0x3a')][_0x3e0c('0x53')]({'where':{'id':_0x29cedc[_0x3e0c('0x56')]['id']}})[_0x3e0c('0x1e')](handleEntityNotFound(_0x994b2c,null))[_0x3e0c('0x1e')](saveUpdates(_0x29cedc[_0x3e0c('0x55')],null))[_0x3e0c('0x1e')](respondWithResult(_0x994b2c,null))[_0x3e0c('0x27')](handleError(_0x994b2c,null));};exports[_0x3e0c('0x5b')]=function(_0x3d3f48,_0x3b6c40,_0x43a06e){if(_0x3d3f48[_0x3e0c('0x58')]&&_0x3d3f48[_0x3e0c('0x58')][_0x3e0c('0x59')]){_0x3d3f48[_0x3e0c('0x55')][_0x3e0c('0x5c')]=_0x3d3f48[_0x3e0c('0x58')][_0x3e0c('0x59')];}return db[_0x3e0c('0x3a')][_0x3e0c('0x53')]({'where':{'id':_0x3d3f48[_0x3e0c('0x56')]['id']}})[_0x3e0c('0x1e')](handleEntityNotFound(_0x3b6c40,null))[_0x3e0c('0x1e')](saveUpdates(_0x3d3f48[_0x3e0c('0x55')],null))['then'](respondWithResult(_0x3b6c40,null))[_0x3e0c('0x27')](handleError(_0x3b6c40,null));};var utilLicense=require(_0x3e0c('0x1a'));exports[_0x3e0c('0x5d')]=function(_0x874b04,_0x56ed00,_0xb06232){var _0x42637d=_0x3e0c('0x5e');var _0x155a5a={'custom':![]};return utilLicense[_0x3e0c('0x5f')]()[_0x3e0c('0x1e')](function(_0x4f105e){if(_0x4f105e){_0x155a5a=_0x4f105e;}return db[_0x3e0c('0x3a')][_0x3e0c('0x53')]({'where':{'id':_0x874b04['params']['id']},'attributes':[_0x3e0c('0x5a'),_0x3e0c('0x5c'),_0x3e0c('0x60'),_0x3e0c('0x61'),_0x3e0c('0x62'),'defaultLoginLogo','defaultPreferred',_0x3e0c('0x63')],'raw':!![]});})[_0x3e0c('0x1e')](handleEntityNotFound(_0x56ed00,null))['then'](function(_0x490671){if(_0x490671){var _0x5549c2=_0x490671[_0x3e0c('0x5a')]&&fs[_0x3e0c('0x64')](path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x42637d,_[_0x3e0c('0x67')](_0x490671[_0x3e0c('0x5a')])))?path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x42637d,_[_0x3e0c('0x67')](_0x490671[_0x3e0c('0x5a')])):path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x42637d,_[_0x3e0c('0x67')](_0x3e0c('0x68')));var _0x268e5b=_0x3e0c('0x69')+_[_0x3e0c('0x6a')]('logo');if(_0x490671[_0x268e5b]||!_0x155a5a[_0x3e0c('0x6b')]){_0x5549c2=path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x42637d,_['toLower'](_0x3e0c('0x68')));}if(!fs[_0x3e0c('0x64')](_0x5549c2)){throw new db[(_0x3e0c('0x6c'))][(_0x3e0c('0x6d'))](_[_0x3e0c('0x6a')](_0x3e0c('0x5a'))+_0x3e0c('0x6e'));}return _0x56ed00[_0x3e0c('0x6f')](_0x5549c2);}})['catch'](handleError(_0x56ed00,null));};var utilLicense=require(_0x3e0c('0x1a'));exports[_0x3e0c('0x70')]=function(_0x4eb4a6,_0x54f31e,_0x527379){var _0x21fd92='server/files/images/logos';var _0x329ae4={'custom':![]};return utilLicense[_0x3e0c('0x5f')]()['then'](function(_0x45afe4){if(_0x45afe4){_0x329ae4=_0x45afe4;}return db['Setting'][_0x3e0c('0x53')]({'where':{'id':_0x4eb4a6[_0x3e0c('0x56')]['id']},'attributes':[_0x3e0c('0x5a'),'loginLogo',_0x3e0c('0x60'),_0x3e0c('0x61'),_0x3e0c('0x62'),_0x3e0c('0x71'),'defaultPreferred',_0x3e0c('0x63')],'raw':!![]});})[_0x3e0c('0x1e')](handleEntityNotFound(_0x54f31e,null))['then'](function(_0x24c042){if(_0x24c042){var _0x1ae11b=_0x24c042[_0x3e0c('0x5c')]&&fs[_0x3e0c('0x64')](path['join'](config[_0x3e0c('0x66')],_0x21fd92,_['toLower'](_0x24c042[_0x3e0c('0x5c')])))?path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x21fd92,_[_0x3e0c('0x67')](_0x24c042[_0x3e0c('0x5c')])):path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x21fd92,_[_0x3e0c('0x67')](_0x3e0c('0x72')));var _0x5c0063=_0x3e0c('0x69')+_['upperFirst'](_0x3e0c('0x5c'));if(_0x24c042[_0x5c0063]||!_0x329ae4[_0x3e0c('0x6b')]){_0x1ae11b=path[_0x3e0c('0x65')](config['root'],_0x21fd92,_[_0x3e0c('0x67')](_0x3e0c('0x72')));}if(!fs[_0x3e0c('0x64')](_0x1ae11b)){throw new db['Sequelize'][(_0x3e0c('0x6d'))](_[_0x3e0c('0x6a')](_0x3e0c('0x5c'))+_0x3e0c('0x6e'));}return _0x54f31e[_0x3e0c('0x6f')](_0x1ae11b);}})[_0x3e0c('0x27')](handleError(_0x54f31e,null));};exports[_0x3e0c('0x73')]=function(_0x9d74bd,_0xf1b265){return db['Setting'][_0x3e0c('0x53')]({'where':{'id':_0x9d74bd[_0x3e0c('0x56')]['id']},'attributes':[_0x3e0c('0x74')]})[_0x3e0c('0x1e')](respondWithResult(_0xf1b265,null))['catch'](handleError(_0xf1b265,null));};exports[_0x3e0c('0x75')]=function(_0x32cfab,_0x140938,_0x234fae){if(_0x32cfab['file']&&_0x32cfab[_0x3e0c('0x58')][_0x3e0c('0x59')]){_0x32cfab[_0x3e0c('0x55')][_0x3e0c('0x60')]=_0x32cfab[_0x3e0c('0x58')][_0x3e0c('0x59')];}return db[_0x3e0c('0x3a')][_0x3e0c('0x53')]({'where':{'id':_0x32cfab[_0x3e0c('0x56')]['id']}})[_0x3e0c('0x1e')](handleEntityNotFound(_0x140938,null))[_0x3e0c('0x1e')](saveUpdates(_0x32cfab[_0x3e0c('0x55')],null))[_0x3e0c('0x1e')](respondWithResult(_0x140938,null))[_0x3e0c('0x27')](handleError(_0x140938,null));};var utilLicense=require('../../config/license/util');exports[_0x3e0c('0x76')]=function(_0x2636c3,_0x1da632,_0x39f363){var _0x265b75=_0x3e0c('0x5e');var _0x4a4b34={'custom':![]};return utilLicense['getLicense']()[_0x3e0c('0x1e')](function(_0x4e0325){if(_0x4e0325){_0x4a4b34=_0x4e0325;}return db[_0x3e0c('0x3a')][_0x3e0c('0x53')]({'where':{'id':_0x2636c3[_0x3e0c('0x56')]['id']},'attributes':[_0x3e0c('0x5a'),_0x3e0c('0x5c'),_0x3e0c('0x60'),_0x3e0c('0x61'),'defaultLogo',_0x3e0c('0x71'),_0x3e0c('0x77'),_0x3e0c('0x63')],'raw':!![]});})[_0x3e0c('0x1e')](handleEntityNotFound(_0x1da632,null))[_0x3e0c('0x1e')](function(_0x373b81){if(_0x373b81){var _0x5a7136=_0x373b81[_0x3e0c('0x60')]&&fs[_0x3e0c('0x64')](path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x265b75,_['toLower'](_0x373b81[_0x3e0c('0x60')])))?path['join'](config['root'],_0x265b75,_[_0x3e0c('0x67')](_0x373b81[_0x3e0c('0x60')])):path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x265b75,_['toLower']('default_preferred.png'));var _0x3a0993=_0x3e0c('0x69')+_[_0x3e0c('0x6a')](_0x3e0c('0x60'));if(_0x373b81[_0x3a0993]||!_0x4a4b34[_0x3e0c('0x6b')]||!_0x4a4b34['preferred']){_0x5a7136=path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x265b75,_['toLower'](_0x3e0c('0x78')));}if(!fs[_0x3e0c('0x64')](_0x5a7136)){throw new db['Sequelize']['ValidationError'](_[_0x3e0c('0x6a')](_0x3e0c('0x60'))+_0x3e0c('0x6e'));}return _0x1da632[_0x3e0c('0x6f')](_0x5a7136);}})[_0x3e0c('0x27')](handleError(_0x1da632,null));};exports[_0x3e0c('0x79')]=function(_0x23700f,_0x15aef9,_0x5ac21a){if(_0x23700f[_0x3e0c('0x58')]&&_0x23700f[_0x3e0c('0x58')]['filename']){_0x23700f['body'][_0x3e0c('0x61')]=_0x23700f[_0x3e0c('0x58')]['filename'];}return db['Setting'][_0x3e0c('0x53')]({'where':{'id':_0x23700f['params']['id']}})[_0x3e0c('0x1e')](handleEntityNotFound(_0x15aef9,null))['then'](saveUpdates(_0x23700f[_0x3e0c('0x55')],null))[_0x3e0c('0x1e')](respondWithResult(_0x15aef9,null))[_0x3e0c('0x27')](handleError(_0x15aef9,null));};var utilLicense=require(_0x3e0c('0x1a'));exports['getFavicon']=function(_0x27718c,_0x165116,_0x48007e){var _0x33371b=_0x3e0c('0x5e');var _0x2ea626={'custom':![]};return utilLicense[_0x3e0c('0x5f')]()[_0x3e0c('0x1e')](function(_0xd317b4){if(_0xd317b4){_0x2ea626=_0xd317b4;}return db[_0x3e0c('0x3a')]['find']({'where':{'id':_0x27718c[_0x3e0c('0x56')]['id']},'attributes':[_0x3e0c('0x5a'),_0x3e0c('0x5c'),_0x3e0c('0x60'),_0x3e0c('0x61'),_0x3e0c('0x62'),_0x3e0c('0x71'),_0x3e0c('0x77'),_0x3e0c('0x63')],'raw':!![]});})[_0x3e0c('0x1e')](handleEntityNotFound(_0x165116,null))[_0x3e0c('0x1e')](function(_0x7878b3){if(_0x7878b3){var _0x12eb3f=_0x7878b3['favicon']&&fs[_0x3e0c('0x64')](path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x33371b,_['toLower'](_0x7878b3['favicon'])))?path[_0x3e0c('0x65')](config['root'],_0x33371b,_[_0x3e0c('0x67')](_0x7878b3[_0x3e0c('0x61')])):path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x33371b,_[_0x3e0c('0x67')](_0x3e0c('0x7a')));var _0x5405d2=_0x3e0c('0x69')+_[_0x3e0c('0x6a')](_0x3e0c('0x61'));if(_0x7878b3[_0x5405d2]||!_0x2ea626[_0x3e0c('0x6b')]){_0x12eb3f=path[_0x3e0c('0x65')](config[_0x3e0c('0x66')],_0x33371b,_[_0x3e0c('0x67')](_0x3e0c('0x7a')));}if(!fs['existsSync'](_0x12eb3f)){throw new db[(_0x3e0c('0x6c'))][(_0x3e0c('0x6d'))](_[_0x3e0c('0x6a')](_0x3e0c('0x61'))+_0x3e0c('0x6e'));}return _0x165116[_0x3e0c('0x6f')](_0x12eb3f);}})[_0x3e0c('0x27')](handleError(_0x165116,null));};exports[_0x3e0c('0x7b')]=function(_0x535d55,_0x423db7){var _0x437fd0={'offset':moment()[_0x3e0c('0x7c')]()};_0x437fd0[_0x3e0c('0x7d')]=moment()[_0x3e0c('0x7c')](_0x437fd0[_0x3e0c('0x2c')])[_0x3e0c('0x7e')](_0x3e0c('0x7f'));return _0x423db7[_0x3e0c('0x29')](0xc8)['send'](_0x437fd0);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 9be3437..061d391 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x589589,_0x484d80){var _0x1ae411=function(_0x193408){while(--_0x193408){_0x589589['push'](_0x589589['shift']());}};_0x1ae411(++_0x484d80);}(_0x3e74,0x175));var _0x43e7=function(_0x18a838,_0x5ec9e6){_0x18a838=_0x18a838-0x0;var _0x5a1a35=_0x3e74[_0x18a838];return _0x5a1a35;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x55ca,0x126));var _0xa55c=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x55ca[_0x15ca1a];return _0x507626;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index f67f182..4257adf 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 _0x1d41=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','attributes','model','map','include','lodash','util','bluebird','randomstring'];(function(_0x5bd3c3,_0x4e31d9){var _0x5d5990=function(_0x748490){while(--_0x748490){_0x5bd3c3['push'](_0x5bd3c3['shift']());}};_0x5d5990(++_0x4e31d9);}(_0x1d41,0x10a));var _0x11d4=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0x1d41[_0x257a28];return _0x13bccc;};'use strict';var _=require(_0x11d4('0x0'));var util=require(_0x11d4('0x1'));var moment=require('moment');var BPromise=require(_0x11d4('0x2'));var rs=require(_0x11d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11d4('0x4'))['db'];var utils=require(_0x11d4('0x5'));var logger=require('../../config/logger')(_0x11d4('0x6'));var config=require(_0x11d4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x11d4('0x8')][_0x11d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e4731,_0x260907,_0x1e17da){return new BPromise(function(_0x409500,_0x40e528){return client[_0x11d4('0xa')](_0x4e4731,_0x1e17da)['then'](function(_0xc8c74e){logger[_0x11d4('0xb')](_0x11d4('0xc'),_0x260907,_0x11d4('0xd'));logger[_0x11d4('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x260907,_0x11d4('0xd'),JSON[_0x11d4('0xf')](_0xc8c74e));if(_0xc8c74e[_0x11d4('0x10')]){if(_0xc8c74e[_0x11d4('0x10')][_0x11d4('0x11')]===0x1f4){logger[_0x11d4('0x10')]('Setting,\x20%s,\x20%s',_0x260907,_0xc8c74e[_0x11d4('0x10')][_0x11d4('0x12')]);return _0x40e528(_0xc8c74e['error'][_0x11d4('0x12')]);}logger[_0x11d4('0x10')](_0x11d4('0xc'),_0x260907,_0xc8c74e['error']['message']);return _0x409500(_0xc8c74e[_0x11d4('0x10')][_0x11d4('0x12')]);}else{logger[_0x11d4('0xb')](_0x11d4('0xc'),_0x260907,_0x11d4('0xd'));_0x409500(_0xc8c74e[_0x11d4('0x13')][_0x11d4('0x12')]);}})[_0x11d4('0x14')](function(_0x18dce5){logger[_0x11d4('0x10')](_0x11d4('0xc'),_0x260907,_0x18dce5);_0x40e528(_0x18dce5);});});}exports[_0x11d4('0x15')]=function(_0x270f50){var _0x2eefe0=this;return new Promise(function(_0x5d795e,_0x42292c){return db[_0x11d4('0x16')][_0x11d4('0x17')]({'raw':_0x270f50[_0x11d4('0x18')]?_0x270f50[_0x11d4('0x18')][_0x11d4('0x19')]===undefined?!![]:![]:!![],'where':_0x270f50[_0x11d4('0x18')]?_0x270f50[_0x11d4('0x18')]['where']||null:null,'attributes':_0x270f50[_0x11d4('0x18')]?_0x270f50[_0x11d4('0x18')][_0x11d4('0x1a')]||null:null,'include':_0x270f50[_0x11d4('0x18')]?_0x270f50[_0x11d4('0x18')]['include']?_['map'](_0x270f50[_0x11d4('0x18')]['include'],function(_0x4c1168){return{'model':db[_0x4c1168[_0x11d4('0x1b')]],'as':_0x4c1168['as'],'attributes':_0x4c1168['attributes'],'include':_0x4c1168['include']?_[_0x11d4('0x1c')](_0x4c1168['include'],function(_0x38426a){return{'model':db[_0x38426a[_0x11d4('0x1b')]],'as':_0x38426a['as'],'attributes':_0x38426a[_0x11d4('0x1a')],'include':_0x38426a['include']?_[_0x11d4('0x1c')](_0x38426a[_0x11d4('0x1d')],function(_0x219085){return{'model':db[_0x219085[_0x11d4('0x1b')]],'as':_0x219085['as'],'attributes':_0x219085[_0x11d4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x100cc5){logger[_0x11d4('0xb')]('ShowSetting',_0x270f50);logger[_0x11d4('0xe')](_0x11d4('0x15'),_0x270f50,JSON[_0x11d4('0xf')](_0x100cc5));_0x5d795e(_0x100cc5);})[_0x11d4('0x14')](function(_0x3b6815){logger[_0x11d4('0x10')](_0x11d4('0x15'),_0x3b6815[_0x11d4('0x12')],_0x270f50);_0x42292c(_0x2eefe0['error'](0x1f4,_0x3b6815[_0x11d4('0x12')]));});});}; \ No newline at end of file +var _0x170a=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ShowSetting','find','raw','options','where','attributes','include','model','map','lodash','moment','bluebird'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x170a,0xfd));var _0xa170=function(_0x1fff82,_0x493e1e){_0x1fff82=_0x1fff82-0x0;var _0x421de5=_0x170a[_0x1fff82];return _0x421de5;};'use strict';var _=require(_0xa170('0x0'));var util=require('util');var moment=require(_0xa170('0x1'));var BPromise=require(_0xa170('0x2'));var rs=require(_0xa170('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa170('0x4'))['db'];var utils=require(_0xa170('0x5'));var logger=require(_0xa170('0x6'))(_0xa170('0x7'));var config=require('../../config/environment');var jayson=require(_0xa170('0x8'));var client=jayson[_0xa170('0x9')][_0xa170('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x82fc9e,_0x1915ce,_0x46e798){return new BPromise(function(_0x5b7ad2,_0x2c87be){return client[_0xa170('0xb')](_0x82fc9e,_0x46e798)[_0xa170('0xc')](function(_0x2048b5){logger['info'](_0xa170('0xd'),_0x1915ce,_0xa170('0xe'));logger[_0xa170('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x1915ce,'request\x20sent',JSON[_0xa170('0x10')](_0x2048b5));if(_0x2048b5[_0xa170('0x11')]){if(_0x2048b5[_0xa170('0x11')][_0xa170('0x12')]===0x1f4){logger['error'](_0xa170('0xd'),_0x1915ce,_0x2048b5[_0xa170('0x11')][_0xa170('0x13')]);return _0x2c87be(_0x2048b5[_0xa170('0x11')][_0xa170('0x13')]);}logger['error'](_0xa170('0xd'),_0x1915ce,_0x2048b5['error'][_0xa170('0x13')]);return _0x5b7ad2(_0x2048b5[_0xa170('0x11')][_0xa170('0x13')]);}else{logger[_0xa170('0x14')]('Setting,\x20%s,\x20%s',_0x1915ce,'request\x20sent');_0x5b7ad2(_0x2048b5[_0xa170('0x15')]['message']);}})[_0xa170('0x16')](function(_0x1f0082){logger['error'](_0xa170('0xd'),_0x1915ce,_0x1f0082);_0x2c87be(_0x1f0082);});});}exports[_0xa170('0x17')]=function(_0x42e9cb){var _0x3a98a5=this;return new Promise(function(_0x328963,_0x38d69c){return db['Setting'][_0xa170('0x18')]({'raw':_0x42e9cb['options']?_0x42e9cb['options'][_0xa170('0x19')]===undefined?!![]:![]:!![],'where':_0x42e9cb[_0xa170('0x1a')]?_0x42e9cb['options'][_0xa170('0x1b')]||null:null,'attributes':_0x42e9cb[_0xa170('0x1a')]?_0x42e9cb[_0xa170('0x1a')][_0xa170('0x1c')]||null:null,'include':_0x42e9cb[_0xa170('0x1a')]?_0x42e9cb[_0xa170('0x1a')][_0xa170('0x1d')]?_['map'](_0x42e9cb[_0xa170('0x1a')][_0xa170('0x1d')],function(_0x12748d){return{'model':db[_0x12748d[_0xa170('0x1e')]],'as':_0x12748d['as'],'attributes':_0x12748d[_0xa170('0x1c')],'include':_0x12748d[_0xa170('0x1d')]?_[_0xa170('0x1f')](_0x12748d[_0xa170('0x1d')],function(_0x4e9271){return{'model':db[_0x4e9271[_0xa170('0x1e')]],'as':_0x4e9271['as'],'attributes':_0x4e9271['attributes'],'include':_0x4e9271['include']?_[_0xa170('0x1f')](_0x4e9271[_0xa170('0x1d')],function(_0x293436){return{'model':db[_0x293436[_0xa170('0x1e')]],'as':_0x293436['as'],'attributes':_0x293436[_0xa170('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa170('0xc')](function(_0x3b9c11){logger[_0xa170('0x14')](_0xa170('0x17'),_0x42e9cb);logger[_0xa170('0xf')](_0xa170('0x17'),_0x42e9cb,JSON['stringify'](_0x3b9c11));_0x328963(_0x3b9c11);})[_0xa170('0x16')](function(_0x3d5186){logger[_0xa170('0x11')](_0xa170('0x17'),_0x3d5186[_0xa170('0x13')],_0x42e9cb);_0x38d69c(_0x3a98a5['error'](0x1f4,_0x3d5186[_0xa170('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 230deec..efaa6de 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 _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x2a04a2,_0x1dfce8){var _0x54c68a=function(_0x2d23c7){while(--_0x2d23c7){_0x2a04a2['push'](_0x2a04a2['shift']());}};_0x54c68a(++_0x1dfce8);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x35de8a,_0x7acd4b){_0x35de8a=_0x35de8a-0x0;var _0x9c759d=_0x7fbe[_0x35de8a];return _0x9c759d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=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(_0x3ba5a4,_0x1ab3a2){var _0x361851=function(_0x2711bb){while(--_0x2711bb){_0x3ba5a4['push'](_0x3ba5a4['shift']());}};_0x361851(++_0x1ab3a2);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 ba06b5d..08c23e8 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 _0x7f97=['exports','STRING','name','generate','ENUM','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x7f97,0x1f2));var _0x77f9=function(_0x3be4ea,_0x2e8a96){_0x3be4ea=_0x3be4ea-0x0;var _0x91b6e6=_0x7f97[_0x3be4ea];return _0x91b6e6;};'use strict';var Sequelize=require(_0x77f9('0x0'));var rs=require(_0x77f9('0x1'));module[_0x77f9('0x2')]={'name':{'type':Sequelize[_0x77f9('0x3')],'unique':_0x77f9('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x77f9('0x5')]();}},'phone':{'type':Sequelize[_0x77f9('0x3')]},'type':{'type':Sequelize[_0x77f9('0x6')]('twilio','skebby',_0x77f9('0x7'),_0x77f9('0x8'),_0x77f9('0x9'),_0x77f9('0xa'),_0x77f9('0xb'),_0x77f9('0xc'),_0x77f9('0xd'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x77f9('0x3')]},'authToken':{'type':Sequelize[_0x77f9('0x3')]},'smsMethod':{'type':Sequelize[_0x77f9('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x77f9('0x3')]},'apiKey':{'type':Sequelize[_0x77f9('0x3')]},'applicationId':{'type':Sequelize[_0x77f9('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x77f9('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x77f9('0x3')]},'notificationTemplate':{'type':Sequelize[_0x77f9('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x77f9('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x77f9('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x77f9('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x77f9('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x77f9('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x77f9('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x77f9('0xf')],'defaultValue':![],'comment':_0x77f9('0x11'),'set':function(_0x1b36c4){if(!_0x1b36c4)this[_0x77f9('0x12')](_0x77f9('0x13'),null);this[_0x77f9('0x12')]('mandatoryDisposition',_0x1b36c4);}}}; \ No newline at end of file +var _0x42a2=['exports','name','STRING','generate','ENUM','skebby','clicksend','plivo','clickatell','bandwidth','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','mandatoryDisposition','sequelize'];(function(_0x2cc448,_0x4a3b2a){var _0x41d546=function(_0x4e0155){while(--_0x4e0155){_0x2cc448['push'](_0x2cc448['shift']());}};_0x41d546(++_0x4a3b2a);}(_0x42a2,0x1e3));var _0x242a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x42a2[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x242a('0x0'));var rs=require('randomstring');module[_0x242a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x242a('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x242a('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x242a('0x3')],'defaultValue':function(){return rs[_0x242a('0x4')]();}},'phone':{'type':Sequelize[_0x242a('0x3')]},'type':{'type':Sequelize[_0x242a('0x5')]('twilio',_0x242a('0x6'),'connectel',_0x242a('0x7'),_0x242a('0x8'),_0x242a('0x9'),_0x242a('0xa'),_0x242a('0xb'),_0x242a('0xc'),_0x242a('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x242a('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x242a('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x242a('0x3')]},'applicationId':{'type':Sequelize[_0x242a('0x3')]},'accountId':{'type':Sequelize[_0x242a('0x3')]},'senderString':{'type':Sequelize[_0x242a('0x3')]},'deliveryReport':{'type':Sequelize[_0x242a('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x242a('0xf')],'defaultValue':function(){return _0x242a('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x242a('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x242a('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x242a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x242a('0x11')],'comment':_0x242a('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x242a('0xe')],'defaultValue':![],'comment':_0x242a('0x13'),'set':function(_0x1d4b7b){if(!_0x1d4b7b)this[_0x242a('0x14')]('mandatoryDispositionPauseId',null);this[_0x242a('0x14')](_0x242a('0x15'),_0x1d4b7b);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 0890d26..e321051 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 _0x5afa=['groupName','redif','DELIVERED','update','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsAccount,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','undefined','offset','count','limit','set','reject','save','then','get','name','send','Pause','map','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsAccount','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','UserProfileResource','destroy','describe','SmsAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','text','connectel','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','Sequelize','ValidationError','mapKey','includes','CmList','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','info','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','addApplications','transaction','findAndCountAll','getApplications','Contact','Owner','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','clicksend','status_code'];(function(_0xda6d0f,_0x35e271){var _0x244540=function(_0x30f643){while(--_0x30f643){_0xda6d0f['push'](_0xda6d0f['shift']());}};_0x244540(++_0x35e271);}(_0x5afa,0x1c7));var _0xa5af=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5afa[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require(_0xa5af('0x0'));var rimraf=require(_0xa5af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5af('0x2'));var rp=require('request-promise');var moment=require(_0xa5af('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa5af('0x4'));var util=require('util');var path=require(_0xa5af('0x5'));var sox=require('sox');var csv=require(_0xa5af('0x6'));var ejs=require(_0xa5af('0x7'));var fs=require('fs');var fs_extra=require(_0xa5af('0x8'));var _=require(_0xa5af('0x9'));var squel=require(_0xa5af('0xa'));var crypto=require('crypto');var jsforce=require(_0xa5af('0xb'));var deskjs=require(_0xa5af('0xc'));var toCsv=require(_0xa5af('0x6'));var querystring=require('querystring');var Papa=require(_0xa5af('0xd'));var Redis=require(_0xa5af('0xe'));var authService=require(_0xa5af('0xf'));var qs=require(_0xa5af('0x10'));var as=require(_0xa5af('0x11'));var hardwareService=require(_0xa5af('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa5af('0x13'));var config=require(_0xa5af('0x14'));var licenseUtil=require(_0xa5af('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa5af('0x16'),'port':0x18eb});var socket=require(_0xa5af('0x17'))(new Redis(config['redis']));require(_0xa5af('0x18'))[_0xa5af('0x19')](socket);var jayson=require(_0xa5af('0x1a'));var client=jayson[_0xa5af('0x1b')][_0xa5af('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x30be5f,_0x3a473b,_0x3ceb8a,_0x167b32){return new BPromise(function(_0x254b64,_0x2ae739){var _0x804ae1=_0x167b32||client;return _0x804ae1[_0xa5af('0x1d')](_0x30be5f,_0x3ceb8a)['then'](function(_0x1168a0){logger['info']('SmsAccount,\x20%s,\x20%s',_0x3a473b,_0xa5af('0x1e'));logger[_0xa5af('0x1f')](_0xa5af('0x20'),_0x3a473b,_0xa5af('0x1e'),JSON[_0xa5af('0x21')](_0x1168a0));if(_0x1168a0['error']){if(_0x1168a0[_0xa5af('0x22')]['code']===0x1f4){logger[_0xa5af('0x22')]('SmsAccount,\x20%s,\x20%s',_0x3a473b,_0x1168a0[_0xa5af('0x22')][_0xa5af('0x23')]);return _0x2ae739(_0x1168a0[_0xa5af('0x22')][_0xa5af('0x23')]);}logger[_0xa5af('0x22')](_0xa5af('0x24'),_0x3a473b,_0x1168a0[_0xa5af('0x22')]['message']);return _0x254b64(_0x1168a0[_0xa5af('0x22')]['message']);}else{logger['info'](_0xa5af('0x24'),_0x3a473b,_0xa5af('0x1e'));_0x254b64(_0x1168a0[_0xa5af('0x25')][_0xa5af('0x23')]);}})[_0xa5af('0x26')](function(_0x43ff3d){logger[_0xa5af('0x22')]('SmsAccount,\x20%s,\x20%s',_0x3a473b,_0x43ff3d);_0x2ae739(_0x43ff3d);});});}function respondWithStatusCode(_0xb18df0,_0x5cbf7f){_0x5cbf7f=_0x5cbf7f||0xcc;return function(_0x2f55cf){if(_0x2f55cf){return _0xb18df0[_0xa5af('0x27')](_0x5cbf7f);}return _0xb18df0['status'](_0x5cbf7f)[_0xa5af('0x28')]();};}function respondWithResult(_0xd0dd27,_0x2a7e4d){_0x2a7e4d=_0x2a7e4d||0xc8;return function(_0xbb7412){if(_0xbb7412){return _0xd0dd27[_0xa5af('0x29')](_0x2a7e4d)[_0xa5af('0x2a')](_0xbb7412);}};}function respondWithFilteredResult(_0x5e61ed,_0x48f939){return function(_0x485e74){if(_0x485e74){var _0x27e2d2=typeof _0x48f939['offset']==='undefined'&&typeof _0x48f939['limit']===_0xa5af('0x2b');var _0x4842c0=_0x485e74['count'];var _0x3bc209=_0x27e2d2?0x0:_0x48f939[_0xa5af('0x2c')];var _0x18e25a=_0x27e2d2?_0x485e74[_0xa5af('0x2d')]:_0x48f939[_0xa5af('0x2c')]+_0x48f939[_0xa5af('0x2e')];var _0x2fb1a2;if(_0x18e25a>=_0x4842c0){_0x18e25a=_0x4842c0;_0x2fb1a2=0xc8;}else{_0x2fb1a2=0xce;}_0x5e61ed[_0xa5af('0x29')](_0x2fb1a2);return _0x5e61ed[_0xa5af('0x2f')]('Content-Range',_0x3bc209+'-'+_0x18e25a+'/'+_0x4842c0)[_0xa5af('0x2a')](_0x485e74);}return null;};}function patchUpdates(_0x576718){return function(_0x3b30a6){try{jsonpatch['apply'](_0x3b30a6,_0x576718,!![]);}catch(_0x2ace2e){return BPromise[_0xa5af('0x30')](_0x2ace2e);}return _0x3b30a6[_0xa5af('0x31')]();};}function saveUpdates(_0xd8f17a,_0x34fc5f){return function(_0x19ab54){if(_0x19ab54){return _0x19ab54['update'](_0xd8f17a)[_0xa5af('0x32')](function(_0x2da9ba){return _0x2da9ba;});}return null;};}function removeEntity(_0x1a679b,_0x3ce97d){return function(_0x292bd8){if(_0x292bd8){return _0x292bd8['destroy']()[_0xa5af('0x32')](function(){var _0xa4e047=_0x292bd8[_0xa5af('0x33')]({'plain':!![]});var _0x4953dd='SmsAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x4953dd,'resourceId':_0xa4e047['id']}})['then'](function(){return _0x292bd8;});})['then'](function(){_0x1a679b['status'](0xcc)[_0xa5af('0x28')]();});}};}function handleEntityNotFound(_0x1b5625,_0x3ac258){return function(_0x29864e){if(!_0x29864e){_0x1b5625[_0xa5af('0x27')](0x194);}return _0x29864e;};}function handleError(_0x1254bf,_0xde9a6d){_0xde9a6d=_0xde9a6d||0x1f4;return function(_0x73f6fa){logger[_0xa5af('0x22')](_0x73f6fa['stack']);if(_0x73f6fa[_0xa5af('0x34')]){delete _0x73f6fa[_0xa5af('0x34')];}_0x1254bf[_0xa5af('0x29')](_0xde9a6d)[_0xa5af('0x35')](_0x73f6fa);};}exports['index']=function(_0x246c2e,_0x5f3546){var _0x5d6a33={'include':[{'model':db[_0xa5af('0x36')],'as':'mandatoryDispositionPause'}]},_0x1b65c7={},_0x3d5cf5={'count':0x0,'rows':[]};var _0x4ae372=_[_0xa5af('0x37')](db['SmsAccount']['rawAttributes'],function(_0xe9f9e0){return{'name':_0xe9f9e0['fieldName'],'type':_0xe9f9e0[_0xa5af('0x38')][_0xa5af('0x39')]};});_0x1b65c7['model']=_['map'](_0x4ae372,'name');_0x1b65c7[_0xa5af('0x3a')]=_['keys'](_0x246c2e['query']);_0x1b65c7[_0xa5af('0x3b')]=_[_0xa5af('0x3c')](_0x1b65c7[_0xa5af('0x3d')],_0x1b65c7['query']);_0x5d6a33[_0xa5af('0x3e')]=_['intersection'](_0x1b65c7[_0xa5af('0x3d')],qs[_0xa5af('0x3f')](_0x246c2e['query']['fields']));_0x5d6a33[_0xa5af('0x3e')]=_0x5d6a33[_0xa5af('0x3e')][_0xa5af('0x40')]?_0x5d6a33['attributes']:_0x1b65c7[_0xa5af('0x3d')];if(!_0x246c2e[_0xa5af('0x3a')][_0xa5af('0x41')](_0xa5af('0x42'))){_0x5d6a33[_0xa5af('0x2e')]=qs[_0xa5af('0x2e')](_0x246c2e[_0xa5af('0x3a')]['limit']);_0x5d6a33['offset']=qs['offset'](_0x246c2e[_0xa5af('0x3a')][_0xa5af('0x2c')]);}_0x5d6a33[_0xa5af('0x43')]=qs[_0xa5af('0x44')](_0x246c2e[_0xa5af('0x3a')][_0xa5af('0x44')]);_0x5d6a33[_0xa5af('0x45')]=qs[_0xa5af('0x3b')](_[_0xa5af('0x46')](_0x246c2e['query'],_0x1b65c7[_0xa5af('0x3b')]),_0x4ae372);if(_0x246c2e[_0xa5af('0x3a')]['filter']){_0x5d6a33[_0xa5af('0x45')]=_[_0xa5af('0x47')](_0x5d6a33[_0xa5af('0x45')],{'$or':_[_0xa5af('0x37')](_0x4ae372,function(_0x4abf72){if(_0x4abf72['type']!==_0xa5af('0x48')){var _0x52332a={};_0x52332a[_0x4abf72[_0xa5af('0x34')]]={'$like':'%'+_0x246c2e['query'][_0xa5af('0x49')]+'%'};return _0x52332a;}})});}_0x5d6a33=_[_0xa5af('0x47')]({},_0x5d6a33,_0x246c2e[_0xa5af('0x4a')]);var _0x8e65f7={'where':_0x5d6a33[_0xa5af('0x45')]};return db[_0xa5af('0x4b')][_0xa5af('0x2d')](_0x8e65f7)['then'](function(_0x3c58ae){_0x3d5cf5['count']=_0x3c58ae;if(_0x246c2e[_0xa5af('0x3a')][_0xa5af('0x4c')]){_0x5d6a33[_0xa5af('0x4d')]=[{'all':!![]}];}return db[_0xa5af('0x4b')][_0xa5af('0x4e')](_0x5d6a33);})[_0xa5af('0x32')](function(_0x4ebd0b){_0x3d5cf5[_0xa5af('0x4f')]=_0x4ebd0b;return _0x3d5cf5;})['then'](respondWithFilteredResult(_0x5f3546,_0x5d6a33))['catch'](handleError(_0x5f3546,null));};exports[_0xa5af('0x50')]=function(_0x7f4f42,_0x435bf4){var _0x51e5e5={'raw':![],'where':{'id':_0x7f4f42[_0xa5af('0x51')]['id']},'include':[{'model':db[_0xa5af('0x36')],'as':_0xa5af('0x52')}]},_0x2fb2bc={};_0x2fb2bc[_0xa5af('0x3d')]=_[_0xa5af('0x53')](db['SmsAccount'][_0xa5af('0x54')]);_0x2fb2bc['query']=_['keys'](_0x7f4f42[_0xa5af('0x3a')]);_0x2fb2bc[_0xa5af('0x3b')]=_['intersection'](_0x2fb2bc[_0xa5af('0x3d')],_0x2fb2bc[_0xa5af('0x3a')]);_0x51e5e5[_0xa5af('0x3e')]=_[_0xa5af('0x3c')](_0x2fb2bc[_0xa5af('0x3d')],qs['fields'](_0x7f4f42[_0xa5af('0x3a')]['fields']));_0x51e5e5['attributes']=_0x51e5e5[_0xa5af('0x3e')][_0xa5af('0x40')]?_0x51e5e5[_0xa5af('0x3e')]:_0x2fb2bc[_0xa5af('0x3d')];if(_0x7f4f42[_0xa5af('0x3a')][_0xa5af('0x4c')]){_0x51e5e5[_0xa5af('0x4d')]=[{'all':!![]}];}_0x51e5e5=_[_0xa5af('0x47')]({},_0x51e5e5,_0x7f4f42[_0xa5af('0x4a')]);return db[_0xa5af('0x4b')][_0xa5af('0x55')](_0x51e5e5)[_0xa5af('0x32')](handleEntityNotFound(_0x435bf4,null))['then'](respondWithResult(_0x435bf4,null))[_0xa5af('0x26')](handleError(_0x435bf4,null));};exports[_0xa5af('0x56')]=function(_0x10a9b,_0x6fd0){return db[_0xa5af('0x4b')][_0xa5af('0x56')](_0x10a9b[_0xa5af('0x57')],{})['then'](function(_0x36bcb6){var _0x4ae592=_0x10a9b[_0xa5af('0x58')][_0xa5af('0x33')]({'plain':!![]});if(!_0x4ae592)throw new Error(_0xa5af('0x59'));if(_0x4ae592[_0xa5af('0x5a')]===_0xa5af('0x58')){var _0x4157c7=_0x36bcb6[_0xa5af('0x33')]({'plain':!![]});var _0x25bd59=_0xa5af('0x5b');return db[_0xa5af('0x5c')][_0xa5af('0x55')]({'where':{'name':_0x25bd59,'userProfileId':_0x4ae592[_0xa5af('0x5d')]},'raw':!![]})[_0xa5af('0x32')](function(_0x590a30){if(_0x590a30&&_0x590a30['autoAssociation']===0x0){return db[_0xa5af('0x5e')][_0xa5af('0x56')]({'name':_0x4157c7[_0xa5af('0x34')],'resourceId':_0x4157c7['id'],'type':_0x590a30['name'],'sectionId':_0x590a30['id']},{})[_0xa5af('0x32')](function(){return _0x36bcb6;});}else{return _0x36bcb6;}})[_0xa5af('0x26')](function(_0x5d33b7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d33b7);throw _0x5d33b7;});}return _0x36bcb6;})[_0xa5af('0x32')](respondWithResult(_0x6fd0,0xc9))['catch'](handleError(_0x6fd0,null));};exports['update']=function(_0x2b967d,_0x440ca0){if(_0x2b967d[_0xa5af('0x57')]['id']){delete _0x2b967d[_0xa5af('0x57')]['id'];}return db['SmsAccount'][_0xa5af('0x55')]({'where':{'id':_0x2b967d['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xa5af('0x32')](handleEntityNotFound(_0x440ca0,null))[_0xa5af('0x32')](saveUpdates(_0x2b967d['body'],null))[_0xa5af('0x32')](respondWithResult(_0x440ca0,null))[_0xa5af('0x26')](handleError(_0x440ca0,null));};exports[_0xa5af('0x5f')]=function(_0x2ecdf5,_0x4db7df){return db[_0xa5af('0x4b')][_0xa5af('0x55')]({'where':{'id':_0x2ecdf5[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x4db7df,null))[_0xa5af('0x32')](removeEntity(_0x4db7df,null))[_0xa5af('0x26')](handleError(_0x4db7df,null));};exports[_0xa5af('0x60')]=function(_0x2f3c1e,_0x4a1c96){return db[_0xa5af('0x4b')][_0xa5af('0x60')]()['then'](respondWithResult(_0x4a1c96,null))[_0xa5af('0x26')](handleError(_0x4a1c96,null));};exports['addDisposition']=function(_0x4d4c02,_0x5617d8,_0x1c76a9){if(_0x4d4c02[_0xa5af('0x57')]['id']){delete _0x4d4c02['body']['id'];}return db['SmsAccount'][_0xa5af('0x55')]({'where':{'id':_0x4d4c02[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x5617d8,null))[_0xa5af('0x32')](function(_0x1ae98d){if(_0x1ae98d){_0x4d4c02[_0xa5af('0x57')][_0xa5af('0x61')]=_0x1ae98d['id'];return db['Disposition'][_0xa5af('0x56')](_0x4d4c02['body']);}})['then'](respondWithResult(_0x5617d8,null))['catch'](handleError(_0x5617d8,null));};exports[_0xa5af('0x62')]=function(_0x1ba2c3,_0x2bc460,_0xc5b492){var _0x294fdf={'raw':![],'where':{}};var _0x5e30d3={};var _0x26dcae={'count':0x0,'rows':[]};return db[_0xa5af('0x4b')][_0xa5af('0x63')]({'where':{'id':_0x1ba2c3[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x2bc460,null))[_0xa5af('0x32')](function(_0x155be8){if(_0x155be8){_0x5e30d3[_0xa5af('0x3d')]=_[_0xa5af('0x53')](db[_0xa5af('0x64')]['rawAttributes']);_0x5e30d3[_0xa5af('0x3a')]=_[_0xa5af('0x53')](_0x1ba2c3['query']);_0x5e30d3[_0xa5af('0x3b')]=_[_0xa5af('0x3c')](_0x5e30d3[_0xa5af('0x3d')],_0x5e30d3[_0xa5af('0x3a')]);_0x294fdf[_0xa5af('0x3e')]=_[_0xa5af('0x3c')](_0x5e30d3['model'],qs['fields'](_0x1ba2c3[_0xa5af('0x3a')][_0xa5af('0x3f')]));_0x294fdf[_0xa5af('0x3e')]=_0x294fdf[_0xa5af('0x3e')][_0xa5af('0x40')]?_0x294fdf['attributes']:_0x5e30d3[_0xa5af('0x3d')];if(!_0x1ba2c3[_0xa5af('0x3a')][_0xa5af('0x41')](_0xa5af('0x42'))){_0x294fdf[_0xa5af('0x2e')]=qs[_0xa5af('0x2e')](_0x1ba2c3['query']['limit']);_0x294fdf[_0xa5af('0x2c')]=qs[_0xa5af('0x2c')](_0x1ba2c3[_0xa5af('0x3a')]['offset']);}_0x294fdf[_0xa5af('0x43')]=qs[_0xa5af('0x44')](_0x1ba2c3[_0xa5af('0x3a')]['sort']);_0x294fdf['where']=qs['filters'](_[_0xa5af('0x46')](_0x1ba2c3[_0xa5af('0x3a')],_0x5e30d3['filters']));_0x294fdf[_0xa5af('0x45')]['SmsAccountId']=_0x155be8['id'];if(_0x1ba2c3[_0xa5af('0x3a')]['filter']){_0x294fdf[_0xa5af('0x45')]=_[_0xa5af('0x47')](_0x294fdf['where'],{'$or':_[_0xa5af('0x37')](_0x294fdf[_0xa5af('0x3e')],function(_0x4a3617){var _0x48f871={};_0x48f871[_0x4a3617]={'$like':'%'+_0x1ba2c3[_0xa5af('0x3a')][_0xa5af('0x49')]+'%'};return _0x48f871;})});}_0x294fdf=_['merge']({},_0x294fdf,_0x1ba2c3['options']);return db[_0xa5af('0x64')][_0xa5af('0x2d')]({'where':_0x294fdf[_0xa5af('0x45')]})[_0xa5af('0x32')](function(_0x174706){_0x26dcae[_0xa5af('0x2d')]=_0x174706;if(_0x1ba2c3['query'][_0xa5af('0x4c')]){_0x294fdf[_0xa5af('0x4d')]=[{'all':!![]}];}return db[_0xa5af('0x64')][_0xa5af('0x4e')](_0x294fdf);})['then'](function(_0x4c69f2){_0x26dcae[_0xa5af('0x4f')]=_0x4c69f2;return _0x26dcae;});}})['then'](respondWithFilteredResult(_0x2bc460,_0x294fdf))[_0xa5af('0x26')](handleError(_0x2bc460,null));};exports['removeDispositions']=function(_0x6af168,_0x22b151,_0x205ac3){return db[_0xa5af('0x4b')][_0xa5af('0x55')]({'where':{'id':_0x6af168[_0xa5af('0x51')]['id']}})['then'](handleEntityNotFound(_0x22b151,null))[_0xa5af('0x32')](function(_0x4afd76){if(_0x4afd76){return _0x4afd76[_0xa5af('0x65')](_0x6af168[_0xa5af('0x3a')][_0xa5af('0x66')]);}})[_0xa5af('0x32')](respondWithStatusCode(_0x22b151,null))[_0xa5af('0x26')](handleError(_0x22b151,null));};exports['addAnswer']=function(_0x386aac,_0x114017,_0x3564ed){if(_0x386aac[_0xa5af('0x57')]['id']){delete _0x386aac[_0xa5af('0x57')]['id'];}return db['SmsAccount'][_0xa5af('0x55')]({'where':{'id':_0x386aac[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x114017,null))['then'](function(_0x184a44){if(_0x184a44){_0x386aac['body']['SmsAccountId']=_0x184a44['id'];return db['CannedAnswer']['create'](_0x386aac[_0xa5af('0x57')]);}})['then'](respondWithResult(_0x114017,null))[_0xa5af('0x26')](handleError(_0x114017,null));};exports[_0xa5af('0x67')]=function(_0x3f1c28,_0x54c30a,_0x50a22a){var _0x28ea4={'raw':![],'where':{}};var _0x5afb2e={};var _0x3ec23b={'count':0x0,'rows':[]};return db[_0xa5af('0x4b')][_0xa5af('0x63')]({'where':{'id':_0x3f1c28[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x54c30a,null))[_0xa5af('0x32')](function(_0x3dc93a){if(_0x3dc93a){_0x5afb2e[_0xa5af('0x3d')]=_[_0xa5af('0x53')](db[_0xa5af('0x68')][_0xa5af('0x54')]);_0x5afb2e[_0xa5af('0x3a')]=_[_0xa5af('0x53')](_0x3f1c28[_0xa5af('0x3a')]);_0x5afb2e['filters']=_[_0xa5af('0x3c')](_0x5afb2e[_0xa5af('0x3d')],_0x5afb2e[_0xa5af('0x3a')]);_0x28ea4[_0xa5af('0x3e')]=_['intersection'](_0x5afb2e['model'],qs['fields'](_0x3f1c28['query'][_0xa5af('0x3f')]));_0x28ea4[_0xa5af('0x3e')]=_0x28ea4['attributes'][_0xa5af('0x40')]?_0x28ea4[_0xa5af('0x3e')]:_0x5afb2e['model'];if(!_0x3f1c28[_0xa5af('0x3a')]['hasOwnProperty'](_0xa5af('0x42'))){_0x28ea4[_0xa5af('0x2e')]=qs[_0xa5af('0x2e')](_0x3f1c28[_0xa5af('0x3a')][_0xa5af('0x2e')]);_0x28ea4[_0xa5af('0x2c')]=qs[_0xa5af('0x2c')](_0x3f1c28['query'][_0xa5af('0x2c')]);}_0x28ea4['order']=qs[_0xa5af('0x44')](_0x3f1c28['query'][_0xa5af('0x44')]);_0x28ea4['where']=qs[_0xa5af('0x3b')](_[_0xa5af('0x46')](_0x3f1c28['query'],_0x5afb2e[_0xa5af('0x3b')]));_0x28ea4[_0xa5af('0x45')][_0xa5af('0x61')]=_0x3dc93a['id'];if(_0x3f1c28['query'][_0xa5af('0x49')]){_0x28ea4['where']=_[_0xa5af('0x47')](_0x28ea4[_0xa5af('0x45')],{'$or':_['map'](_0x28ea4[_0xa5af('0x3e')],function(_0x2942eb){var _0x3cabaa={};_0x3cabaa[_0x2942eb]={'$like':'%'+_0x3f1c28['query'][_0xa5af('0x49')]+'%'};return _0x3cabaa;})});}_0x28ea4=_[_0xa5af('0x47')]({},_0x28ea4,_0x3f1c28[_0xa5af('0x4a')]);return db['CannedAnswer'][_0xa5af('0x2d')]({'where':_0x28ea4[_0xa5af('0x45')]})[_0xa5af('0x32')](function(_0x4e1b10){_0x3ec23b['count']=_0x4e1b10;if(_0x3f1c28['query'][_0xa5af('0x4c')]){_0x28ea4[_0xa5af('0x4d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa5af('0x4e')](_0x28ea4);})[_0xa5af('0x32')](function(_0x2a84e3){_0x3ec23b['rows']=_0x2a84e3;return _0x3ec23b;});}})[_0xa5af('0x32')](respondWithFilteredResult(_0x54c30a,_0x28ea4))[_0xa5af('0x26')](handleError(_0x54c30a,null));};exports['removeAnswers']=function(_0xf7ce57,_0x5df896,_0x30a5d5){return db[_0xa5af('0x4b')][_0xa5af('0x55')]({'where':{'id':_0xf7ce57['params']['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x5df896,null))['then'](function(_0x54e7c3){if(_0x54e7c3){return _0x54e7c3[_0xa5af('0x69')](_0xf7ce57[_0xa5af('0x3a')][_0xa5af('0x66')]);}})['then'](respondWithStatusCode(_0x5df896,null))['catch'](handleError(_0x5df896,null));};exports[_0xa5af('0x6a')]=function(_0x16330a,_0xfbf9b4,_0x120105){var _0x1bbe00={'channel':_0xa5af('0x6b')};var _0x2609cd=[];var _0x50f073=[];var _0x44c463={};return db[_0xa5af('0x4b')][_0xa5af('0x55')]({'where':{'id':_0x16330a['params']['id']},'include':[{'model':db[_0xa5af('0x6c')],'as':_0xa5af('0x6d')}]})[_0xa5af('0x32')](handleEntityNotFound(_0xfbf9b4,null))[_0xa5af('0x32')](function(_0x5b0d96){_0x1bbe00[_0xa5af('0x6e')]=_0x5b0d96;_0x1bbe00[_0xa5af('0x6f')]=_[_0xa5af('0x70')](_0x5b0d96[_0xa5af('0x6d')],[_0xa5af('0x71')],['asc']);if(_0x1bbe00[_0xa5af('0x6e')][_0xa5af('0x6d')]){delete _0x1bbe00[_0xa5af('0x6e')][_0xa5af('0x6d')];}return db[_0xa5af('0x72')][_0xa5af('0x60')]();})[_0xa5af('0x32')](function(_0x294a1e){if(!_0x294a1e){throw new db['Sequelize']['ValidationError'](_0xa5af('0x73'));}_0x2609cd=_[_0xa5af('0x74')](_[_0xa5af('0x53')](_0x294a1e),[_0xa5af('0x75'),'updatedAt']);_0x50f073=_[_0xa5af('0x74')](_[_0xa5af('0x53')](_0x294a1e),[_0xa5af('0x75'),_0xa5af('0x76'),_0xa5af('0x77'),_0xa5af('0x78')]);_0x1bbe00['body']={'mapKey':_0xa5af('0x79')};if(_0x1bbe00[_0xa5af('0x6e')][_0xa5af('0x38')]){switch(_0x1bbe00[_0xa5af('0x6e')]['type']){case'twilio':_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x7b')];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x57')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x7c')];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7d')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x7e')];break;case'skebby':_0x1bbe00[_0xa5af('0x57')]['from']='+'+_0x16330a[_0xa5af('0x57')]['sender'];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x57')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x7f')];break;case _0xa5af('0x80'):_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')]=_0x16330a['body'][_0xa5af('0x7a')];_0x1bbe00['body'][_0xa5af('0x57')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x23')];break;case'clicksend':_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')]=_0x16330a[_0xa5af('0x57')]['from'];_0x1bbe00[_0xa5af('0x57')]['body']=_0x16330a['body'][_0xa5af('0x57')];_0x1bbe00['body'][_0xa5af('0x7d')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x81')];break;case'plivo':_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x7b')];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x57')]=_0x16330a['body'][_0xa5af('0x82')];_0x1bbe00['body']['messageId']=_0x16330a[_0xa5af('0x57')][_0xa5af('0x83')];break;case _0xa5af('0x84'):_0x1bbe00[_0xa5af('0x57')]['from']='+'+_0x16330a[_0xa5af('0x57')][_0xa5af('0x85')][0x0][_0xa5af('0x7a')];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x57')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x85')][0x0]['text'];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7d')]=_0x16330a['body'][_0xa5af('0x85')][0x0][_0xa5af('0x7d')];break;case _0xa5af('0x86'):_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x87')];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x57')]=_0x16330a['body'][_0xa5af('0x88')]['message'];break;case _0xa5af('0x89'):_0x1bbe00[_0xa5af('0x57')]['from']=_0x16330a['body'][_0xa5af('0x8a')];_0x1bbe00['body'][_0xa5af('0x57')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x7f')];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7d')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x8b')];break;case _0xa5af('0x8c'):_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7d')]=_0x16330a[_0xa5af('0x57')][0x0]['message']['id'];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')]=_0x16330a['body'][0x0][_0xa5af('0x23')][_0xa5af('0x7a')];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x57')]=_0x16330a['body'][0x0]['message']['text'];break;case _0xa5af('0x8d'):_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')]=_0x16330a[_0xa5af('0x57')]['from'];_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x57')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x23')];_0x1bbe00['body'][_0xa5af('0x7d')]=_0x16330a[_0xa5af('0x57')][_0xa5af('0x8e')];break;}}if(_0x1bbe00[_0xa5af('0x57')]['id']){delete _0x1bbe00[_0xa5af('0x57')]['id'];}if(_[_0xa5af('0x8f')](_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xa5af('0x8f')](_0x1bbe00['body']['body'])||_0x1bbe00['body'][_0xa5af('0x57')]===''){throw new db[(_0xa5af('0x90'))][(_0xa5af('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x92')])){throw new db['Sequelize'][(_0xa5af('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50f073);}if(!_[_0xa5af('0x93')](_0x50f073,_0x1bbe00[_0xa5af('0x57')]['mapKey'])){throw new db['Sequelize'][(_0xa5af('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50f073);}_0x44c463[_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x92')]]=_0x1bbe00['body'][_0xa5af('0x7a')];return db[_0xa5af('0x94')][_0xa5af('0x55')]({'where':{'id':_0x1bbe00[_0xa5af('0x6e')][_0xa5af('0x78')]},'include':[{'model':db[_0xa5af('0x72')],'as':_0xa5af('0x95'),'where':_0x44c463,'limit':0x1,'order':[[_0xa5af('0x76'),_0xa5af('0x96')]]}]});})['then'](handleEntityNotFound(_0xfbf9b4,null))[_0xa5af('0x32')](function(_0x40f3b0){if(_0x40f3b0){_0x1bbe00[_0xa5af('0x97')]=_[_0xa5af('0x98')](_0x40f3b0,[_0xa5af('0x95')]);if(_0x40f3b0[_0xa5af('0x95')]['length']){return _0x40f3b0[_0xa5af('0x95')][0x0];}var _0x35f7a7=_[_0xa5af('0x99')](_0x1bbe00['body'],{'firstName':_0x1bbe00['body'][_0xa5af('0x7a')],'ListId':_0x40f3b0['id']});_0x35f7a7[_0x1bbe00[_0xa5af('0x57')]['mapKey']]=_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7a')];return db['CmContact'][_0xa5af('0x56')](_0x35f7a7,{'fields':_0x2609cd,'raw':!![]});}})[_0xa5af('0x32')](handleEntityNotFound(_0xfbf9b4,null))['then'](function(_0x13bd87){if(_0x13bd87){_0x1bbe00[_0xa5af('0x9a')]=_0x13bd87;var _0x3170d8={'ContactId':_0x13bd87['id'],'phone':_0x1bbe00[_0xa5af('0x57')]['from'],'SmsAccountId':_0x16330a[_0xa5af('0x51')]['id']};var _0x1ad2b1={'ContactId':_0x13bd87['id'],'SmsAccountId':_0x16330a[_0xa5af('0x51')]['id'],'closed':![]};return db[_0xa5af('0x9b')]['find']({'where':_0x1ad2b1})[_0xa5af('0x32')](function(_0x16fddc){if(_0x16fddc){return[_0x16fddc,![]];}return db[_0xa5af('0x9b')][_0xa5af('0x56')](_0x3170d8)[_0xa5af('0x32')](function(_0x14b16b){return[_0x14b16b,!![]];});});}})[_0xa5af('0x9c')](function(_0x457a4d,_0x3ac13f){_0x1bbe00['interaction']=_0x457a4d[_0xa5af('0x33')]({'plain':!![]});_0x1bbe00[_0xa5af('0x9d')][_0xa5af('0x9e')]=![];if(_0x3ac13f){if(_0x1bbe00['account'][_0xa5af('0x9f')]){_0x1bbe00[_0xa5af('0x6f')][_0xa5af('0xa0')]({'id':0x0,'priority':_0x1bbe00[_0xa5af('0x6f')]['length']+0x1,'app':_0xa5af('0xa1'),'appdata':'unmanaged','interval':_0xa5af('0xa2')});}_0x1bbe00['interaction'][_0xa5af('0x9e')]=!![];}return db[_0xa5af('0xa3')][_0xa5af('0x56')]({'phone':_0x1bbe00['body'][_0xa5af('0x7a')],'messageId':_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x7d')],'body':_0x1bbe00[_0xa5af('0x57')][_0xa5af('0x57')],'SmsAccountId':_0x16330a[_0xa5af('0x51')]['id'],'SmsInteractionId':_0x457a4d['id'],'direction':'in','ContactId':_0x457a4d['ContactId'],'AttachmentId':_0x1bbe00[_0xa5af('0x57')][_0xa5af('0xa4')]});})['then'](function(_0xdc7454){_0x1bbe00['message']=_0xdc7454;if(_0x1bbe00[_0xa5af('0x9d')][_0xa5af('0xa5')]){return db[_0xa5af('0xa6')][_0xa5af('0x55')]({'attributes':['id','name'],'where':{'id':_0x1bbe00[_0xa5af('0x9d')][_0xa5af('0xa5')]}})['then'](function(_0x452ab2){if(_0x452ab2){_0x1bbe00[_0xa5af('0x6f')][_0xa5af('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x452ab2[_0xa5af('0x34')]+','+(_0x1bbe00[_0xa5af('0x6e')][_0xa5af('0xa8')]||0xa),'interval':_0xa5af('0xa2')});}return respondWithRpcPromise(_0xa5af('0xa9'),'startRouting',_0x1bbe00);});}return respondWithRpcPromise(_0xa5af('0xa9'),_0xa5af('0xaa'),_0x1bbe00);})[_0xa5af('0x32')](function(_0x31bf65){if(_0x31bf65){var _0x1dc042=0xc8;var _0x57ec09=_0xa5af('0xab');logger[_0xa5af('0xac')](_0xa5af('0x20'),_0x57ec09,_0x1dc042,'entity\x20found');logger['debug'](_0xa5af('0xad'),_0x57ec09,_0x1dc042,'entity\x20found',JSON[_0xa5af('0x21')](_0x31bf65));if(_0x1bbe00['account'][_0xa5af('0x38')]===_0xa5af('0xae')){return _0xfbf9b4['status'](_0x1dc042)['set']('Content-Type',_0xa5af('0xaf'))[_0xa5af('0x35')](_0xa5af('0xb0'));}else{return _0xfbf9b4[_0xa5af('0x29')](_0x1dc042)['json'](_0x31bf65);}}})[_0xa5af('0x26')](handleError(_0xfbf9b4,null));};exports[_0xa5af('0xb1')]=function(_0x5bafa1,_0x2e7fce,_0x587da4){return db[_0xa5af('0x4b')][_0xa5af('0x63')]({'where':{'id':_0x5bafa1[_0xa5af('0x51')]['id']}})['then'](handleEntityNotFound(_0x2e7fce,null))[_0xa5af('0x32')](function(_0x2d1933){if(_0x2d1933){return db['sequelize'][_0xa5af('0xb2')](function(_0x5ef0b9){return db['SmsApplication'][_0xa5af('0x5f')]({'where':{'SmsAccountId':_0x5bafa1[_0xa5af('0x51')]['id']},'transaction':_0x5ef0b9})[_0xa5af('0x32')](function(_0x2594b8){var _0x14bf19=_[_0xa5af('0x37')](_0x5bafa1[_0xa5af('0x57')],function(_0x595db6){_0x595db6[_0xa5af('0x61')]=_0x5bafa1[_0xa5af('0x51')]['id'];return _0x595db6;});return db[_0xa5af('0x6c')]['bulkCreate'](_0x14bf19,{'transaction':_0x5ef0b9});});})[_0xa5af('0x32')](function(){return db[_0xa5af('0x6c')][_0xa5af('0xb3')]({'where':{'SmsAccountId':_0x5bafa1['params']['id']},'order':_0xa5af('0x71')});});}})[_0xa5af('0x32')](respondWithResult(_0x2e7fce,null))['catch'](handleError(_0x2e7fce,null));};exports[_0xa5af('0xb4')]=function(_0x4cb660,_0x216bf7,_0x2f1986){var _0x1e3fa0={};var _0x3a1811={};var _0x14d237;var _0x4b4227;return db[_0xa5af('0x4b')][_0xa5af('0x63')]({'where':{'id':_0x4cb660[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x216bf7,null))[_0xa5af('0x32')](function(_0x370c97){if(_0x370c97){_0x14d237=_0x370c97;_0x3a1811[_0xa5af('0x3d')]=_[_0xa5af('0x53')](db['SmsApplication'][_0xa5af('0x54')]);_0x3a1811['query']=_[_0xa5af('0x53')](_0x4cb660[_0xa5af('0x3a')]);_0x3a1811[_0xa5af('0x3b')]=_['intersection'](_0x3a1811[_0xa5af('0x3d')],_0x3a1811[_0xa5af('0x3a')]);_0x1e3fa0['attributes']=_[_0xa5af('0x3c')](_0x3a1811[_0xa5af('0x3d')],qs[_0xa5af('0x3f')](_0x4cb660[_0xa5af('0x3a')][_0xa5af('0x3f')]));_0x1e3fa0[_0xa5af('0x3e')]=_0x1e3fa0[_0xa5af('0x3e')][_0xa5af('0x40')]?_0x1e3fa0[_0xa5af('0x3e')]:_0x3a1811['model'];_0x1e3fa0[_0xa5af('0x43')]=qs[_0xa5af('0x44')](_0x4cb660[_0xa5af('0x3a')][_0xa5af('0x44')]);_0x1e3fa0[_0xa5af('0x45')]=qs[_0xa5af('0x3b')](_[_0xa5af('0x46')](_0x4cb660[_0xa5af('0x3a')],_0x3a1811[_0xa5af('0x3b')]));if(_0x4cb660[_0xa5af('0x3a')][_0xa5af('0x49')]){_0x1e3fa0[_0xa5af('0x45')]=_[_0xa5af('0x47')](_0x1e3fa0[_0xa5af('0x45')],{'$or':_[_0xa5af('0x37')](_0x1e3fa0[_0xa5af('0x3e')],function(_0x305909){var _0x4bc0d7={};_0x4bc0d7[_0x305909]={'$like':'%'+_0x4cb660['query'][_0xa5af('0x49')]+'%'};return _0x4bc0d7;})});}_0x1e3fa0=_[_0xa5af('0x47')]({},_0x1e3fa0,_0x4cb660['options']);return _0x14d237[_0xa5af('0xb4')](_0x1e3fa0);}})[_0xa5af('0x32')](function(_0x2e5a05){if(_0x2e5a05){_0x4b4227=_0x2e5a05[_0xa5af('0x40')];if(!_0x4cb660['query']['hasOwnProperty'](_0xa5af('0x42'))){_0x1e3fa0['limit']=qs[_0xa5af('0x2e')](_0x4cb660['query']['limit']);_0x1e3fa0['offset']=qs[_0xa5af('0x2c')](_0x4cb660['query']['offset']);}return _0x14d237[_0xa5af('0xb4')](_0x1e3fa0);}})[_0xa5af('0x32')](function(_0x16a5ef){if(_0x16a5ef){return _0x16a5ef?{'count':_0x4b4227,'rows':_0x16a5ef}:null;}})[_0xa5af('0x32')](respondWithResult(_0x216bf7,null))['catch'](handleError(_0x216bf7,null));};exports['getInteractions']=function(_0x351387,_0x29208c,_0x5f0320){var _0xd1bc35={'raw':![],'where':{}};var _0x5a99b1={};var _0x1d0016={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa5af('0x63')]({'where':{'id':_0x351387[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x29208c,null))[_0xa5af('0x32')](function(_0x3fccad){if(_0x3fccad){_0x5a99b1[_0xa5af('0x3d')]=_[_0xa5af('0x53')](db[_0xa5af('0x9b')]['rawAttributes']);_0x5a99b1[_0xa5af('0x3a')]=_[_0xa5af('0x53')](_0x351387[_0xa5af('0x3a')]);_0x5a99b1[_0xa5af('0x3b')]=_[_0xa5af('0x3c')](_0x5a99b1[_0xa5af('0x3d')],_0x5a99b1[_0xa5af('0x3a')]);_0xd1bc35[_0xa5af('0x3e')]=_[_0xa5af('0x3c')](_0x5a99b1[_0xa5af('0x3d')],qs[_0xa5af('0x3f')](_0x351387[_0xa5af('0x3a')][_0xa5af('0x3f')]));_0xd1bc35[_0xa5af('0x3e')]=_0xd1bc35[_0xa5af('0x3e')][_0xa5af('0x40')]?_0xd1bc35[_0xa5af('0x3e')]:_0x5a99b1[_0xa5af('0x3d')];if(!_0x351387[_0xa5af('0x3a')][_0xa5af('0x41')]('nolimit')){_0xd1bc35['limit']=qs[_0xa5af('0x2e')](_0x351387[_0xa5af('0x3a')][_0xa5af('0x2e')]);_0xd1bc35[_0xa5af('0x2c')]=qs[_0xa5af('0x2c')](_0x351387['query'][_0xa5af('0x2c')]);}_0xd1bc35[_0xa5af('0x43')]=qs[_0xa5af('0x44')](_0x351387[_0xa5af('0x3a')][_0xa5af('0x44')]);_0xd1bc35[_0xa5af('0x45')]=qs['filters'](_[_0xa5af('0x46')](_0x351387[_0xa5af('0x3a')],_0x5a99b1[_0xa5af('0x3b')]));_0xd1bc35[_0xa5af('0x45')][_0xa5af('0x61')]=_0x3fccad['id'];if(_0x351387['query'][_0xa5af('0x49')]){_0xd1bc35['where']=_[_0xa5af('0x47')](_0xd1bc35[_0xa5af('0x45')],{'$or':_['map'](_0xd1bc35[_0xa5af('0x3e')],function(_0x15b87f){var _0x3baf4c={};_0x3baf4c[_0x15b87f]={'$like':'%'+_0x351387['query'][_0xa5af('0x49')]+'%'};return _0x3baf4c;})});}_0xd1bc35=_[_0xa5af('0x47')]({},_0xd1bc35,_0x351387[_0xa5af('0x4a')]);return db[_0xa5af('0x9b')][_0xa5af('0x2d')]({'where':_0xd1bc35[_0xa5af('0x45')]})['then'](function(_0xa0ca8){_0x1d0016[_0xa5af('0x2d')]=_0xa0ca8;if(_0x351387[_0xa5af('0x3a')][_0xa5af('0x4c')]){_0xd1bc35[_0xa5af('0x4d')]=[{'model':db['CmContact'],'as':_0xa5af('0xb5'),'required':![]},{'model':db[_0xa5af('0xa6')],'as':_0xa5af('0xb6'),'attributes':[_0xa5af('0x34'),'fullname',_0xa5af('0xb7')],'required':![]},{'model':db[_0xa5af('0xb8')],'as':_0xa5af('0xb9'),'attributes':['id','name',_0xa5af('0xba')],'where':_0x351387['query'][_0xa5af('0xbb')]?{'id':_0x351387[_0xa5af('0x3a')]['tag']}:undefined,'required':_0x351387[_0xa5af('0x3a')][_0xa5af('0xbb')]?!![]:![]}];}return db[_0xa5af('0x9b')][_0xa5af('0x4e')](_0xd1bc35);})[_0xa5af('0x32')](function(_0x3b8630){_0x1d0016['rows']=_0x3b8630;return _0x1d0016;});}})[_0xa5af('0x32')](respondWithFilteredResult(_0x29208c,_0xd1bc35))['catch'](handleError(_0x29208c,null));};exports[_0xa5af('0x35')]=function(_0x3b2f33,_0x2ea3f5,_0x4086ed){var _0x5c7f89,_0x13de04,_0x4fde7d;if(_['isNil'](_0x3b2f33[_0xa5af('0x57')]['body'])||_0x3b2f33[_0xa5af('0x57')][_0xa5af('0x57')]===''){throw new db[(_0xa5af('0x90'))][(_0xa5af('0x91'))](_0xa5af('0xbc'));}if(_[_0xa5af('0x8f')](_0x3b2f33[_0xa5af('0x57')]['to'])){throw new db[(_0xa5af('0x90'))][(_0xa5af('0x91'))](_0xa5af('0xbd'));}_0x5c7f89=_0x3b2f33['body']['to'];return db[_0xa5af('0x4b')][_0xa5af('0x55')]({'where':{'id':_0x3b2f33[_0xa5af('0x51')]['id']},'include':[{'model':db[_0xa5af('0x94')],'as':_0xa5af('0xbe'),'include':[{'model':db['CmContact'],'as':_0xa5af('0x95'),'where':{'mobile':_0x5c7f89},'limit':0x1,'order':[[_0xa5af('0x76'),_0xa5af('0x96')]]}]}]})[_0xa5af('0x32')](handleEntityNotFound(_0x2ea3f5,null))['then'](function(_0x40c2f6){if(_0x40c2f6&&_0x40c2f6[_0xa5af('0xbe')]){_0x13de04=_0x40c2f6[_0xa5af('0x33')]({'plain':!![]});if(_0x13de04[_0xa5af('0xbe')]&&_0x13de04[_0xa5af('0xbe')][_0xa5af('0x95')][_0xa5af('0x40')]){return _0x13de04['List'][_0xa5af('0x95')][0x0];}return db[_0xa5af('0x72')]['create'](_['defaults'](_0x3b2f33[_0xa5af('0x57')],{'firstName':_0x5c7f89,'mobile':_0x5c7f89,'phone':_0x5c7f89,'ListId':_0x13de04[_0xa5af('0x78')]}));}})[_0xa5af('0x32')](handleEntityNotFound(_0x2ea3f5,null))[_0xa5af('0x32')](function(_0x1ed4ea){if(_0x1ed4ea){_0x4fde7d=_0x1ed4ea;return db[_0xa5af('0x9b')]['find']({'where':{'ContactId':_0x4fde7d['id'],'closed':![],'SmsAccountId':_0x13de04['id']}})[_0xa5af('0x32')](function(_0x12bece){if(_0x12bece){return[_0x12bece,![]];}return db[_0xa5af('0x9b')][_0xa5af('0x56')]({'UserId':_0x3b2f33['user']['id'],'ContactId':_0x4fde7d['id'],'SmsAccountId':_0x13de04['id'],'phone':_0x5c7f89,'firstMsgDirection':_0xa5af('0xbf'),'Messages':[_[_0xa5af('0x47')](_0x3b2f33['body'],{'read':![],'body':_0x3b2f33[_0xa5af('0x57')][_0xa5af('0x57')],'phone':_0x5c7f89,'SmsAccountId':_0x13de04['id'],'UserId':_0x3b2f33[_0xa5af('0x58')]['id'],'ContactId':_0x4fde7d['id']})]},{'include':[{'model':db[_0xa5af('0xa3')],'as':_0xa5af('0xc0')}]})['then'](function(_0x2faf6d){return[_0x2faf6d,!![]];});});}})[_0xa5af('0x9c')](function(_0x4b40e1,_0x23ee5d){if(_0x23ee5d){return _0x4b40e1;}return db[_0xa5af('0xa3')]['create'](_['merge'](_0x3b2f33[_0xa5af('0x57')],{'read':![],'body':_0x3b2f33['body'][_0xa5af('0x57')],'phone':_0x5c7f89,'SmsAccountId':_0x13de04['id'],'SmsInteractionId':_0x4b40e1['id'],'UserId':_0x3b2f33['user']['id'],'ContactId':_0x4fde7d['id']}))[_0xa5af('0x32')](function(_0x472caa){_0x4b40e1[_0xa5af('0xc1')]['Messages']=[];_0x4b40e1['dataValues']['Messages']['push'](_0x472caa[_0xa5af('0xc1')]);return _0x4b40e1;});})[_0xa5af('0x32')](respondWithResult(_0x2ea3f5,null))[_0xa5af('0x26')](handleError(_0x2ea3f5,null));};exports['status']=function(_0x316010,_0x1ac1e9,_0x42b1cd){if(_0x316010[_0xa5af('0x57')]['id']){delete _0x316010[_0xa5af('0x57')]['id'];}var _0xe8eae0,_0x4dcdde,_0x5f2220;return db[_0xa5af('0x4b')]['find']({'where':{'id':_0x316010[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x1ac1e9,null))[_0xa5af('0x32')](function(_0x3e732d){if(_0x3e732d){_0x5f2220=_0x3e732d;logger[_0xa5af('0x1f')](_0xa5af('0x20'),_0xa5af('0x29'),_0xa5af('0xc2'),_0x3e732d[_0xa5af('0x38')],util[_0xa5af('0xc3')](_0x316010[_0xa5af('0x57')],{'showHidden':![],'depth':null}));switch(_0x3e732d[_0xa5af('0x38')]){case _0xa5af('0xc4'):if(_0x316010[_0xa5af('0x57')][_0xa5af('0xc5')]&&_0x316010[_0xa5af('0x57')][_0xa5af('0x29')]){_0x4dcdde=_0x316010[_0xa5af('0x57')][_0xa5af('0x29')];return db[_0xa5af('0xa3')][_0xa5af('0x55')]({'where':{'messageId':_0x316010[_0xa5af('0x57')]['skebby_dispatch_id']}});}break;case _0xa5af('0x80'):if(_0x316010[_0xa5af('0x57')][_0xa5af('0xc6')]&&_0x316010[_0xa5af('0x57')][_0xa5af('0xc7')]){_0x4dcdde=_0x316010[_0xa5af('0x57')][_0xa5af('0xc7')];return db['SmsMessage']['find']({'where':{'messageId':_0x316010['body'][_0xa5af('0xc6')]}});}break;case _0xa5af('0xc8'):if(_0x316010[_0xa5af('0x57')]['message_id']&&_0x316010[_0xa5af('0x57')][_0xa5af('0xc9')]){_0x4dcdde=_0x316010[_0xa5af('0x57')][_0xa5af('0xc9')];return db[_0xa5af('0xa3')][_0xa5af('0x55')]({'where':{'messageId':_0x316010[_0xa5af('0x57')][_0xa5af('0x81')]}});}break;case _0xa5af('0x84'):var _0x3bf32a=_0x316010[_0xa5af('0x57')]['results'][0x0];if(_0x3bf32a[_0xa5af('0x7d')]&&_0x3bf32a[_0xa5af('0x29')][_0xa5af('0xca')]==='DELIVERED'){_0x4dcdde=_0x3bf32a['status'][_0xa5af('0xca')];return db[_0xa5af('0xa3')][_0xa5af('0x55')]({'where':{'messageId':_0x3bf32a[_0xa5af('0x7d')]}});}break;case'clickatell':if(_0x316010[_0xa5af('0x57')]['messageId']&&_0x316010['body']['status']){_0x4dcdde=_0x316010['body'][_0xa5af('0x29')];return db['SmsMessage'][_0xa5af('0x55')]({'where':{'messageId':_0x316010[_0xa5af('0x57')][_0xa5af('0x7d')]}});}break;case'bandwidth':if(_0x316010[_0xa5af('0x57')][0x0][_0xa5af('0x23')]['id']){_0x4dcdde=_0x316010[_0xa5af('0x57')][0x0][_0xa5af('0x38')];return db['SmsMessage'][_0xa5af('0x55')]({'where':{'messageId':_0x316010[_0xa5af('0x57')][0x0][_0xa5af('0x23')]['id']}});}break;case'intelepeer':if(_0x316010[_0xa5af('0x57')]['redif']&&_0x316010['body']['status']){_0x4dcdde=_0x316010['body']['status'];return db[_0xa5af('0xa3')][_0xa5af('0x55')]({'where':{'messageId':_0x316010[_0xa5af('0x57')][_0xa5af('0xcb')]}});}break;}}})[_0xa5af('0x32')](handleEntityNotFound(_0x1ac1e9,null))['then'](function(_0x3383d0){if(_0x3383d0){_0xe8eae0=_0x3383d0;switch(_0x5f2220[_0xa5af('0x38')]){case _0xa5af('0xc4'):if(_0x4dcdde===_0xa5af('0xcc')){return _0xe8eae0[_0xa5af('0xcd')]({'read':!![]});}else{logger[_0xa5af('0x22')](_0xa5af('0x20'),_0xa5af('0x29'),_0xa5af('0xc4'),util[_0xa5af('0xc3')](_0x316010['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x4dcdde==='1'){return _0xe8eae0[_0xa5af('0xcd')]({'read':!![]});}else{logger[_0xa5af('0x22')](_0xa5af('0x20'),_0xa5af('0x29'),_0xa5af('0xc4'),util[_0xa5af('0xc3')](_0x316010[_0xa5af('0x57')],{'showHidden':![],'depth':null}));}break;case _0xa5af('0xc8'):if(!_0x316010['body'][_0xa5af('0xce')]&&_0x4dcdde>=0xc8&&_0x4dcdde<=0xce){return _0xe8eae0[_0xa5af('0xcd')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','clicksend',util['inspect'](_0x316010[_0xa5af('0x57')],{'showHidden':![],'depth':null}));}break;case _0xa5af('0x84'):var _0x21ed03=_0x316010[_0xa5af('0x57')][_0xa5af('0x85')][0x0];if(_0x21ed03[_0xa5af('0x29')]['groupName']===_0xa5af('0xcc')){return _0xe8eae0[_0xa5af('0xcd')]({'read':!![]});}else{logger[_0xa5af('0x22')](_0xa5af('0x20'),_0xa5af('0x29'),'infobip',util[_0xa5af('0xc3')](_0x316010[_0xa5af('0x57')],{'showHidden':![],'depth':null}));}break;case _0xa5af('0x89'):if(_0x4dcdde==_0xa5af('0xcf')||_0x4dcdde==_0xa5af('0xd0')){return _0xe8eae0[_0xa5af('0xcd')]({'read':!![]});}else{logger[_0xa5af('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa5af('0x29'),'clickatell',util[_0xa5af('0xc3')](_0x316010['body'],{'showHidden':![],'depth':null}));}break;case _0xa5af('0x8c'):if(_0x4dcdde=='message-delivered'){return _0xe8eae0[_0xa5af('0xcd')]({'read':!![]});}else{logger[_0xa5af('0x22')](_0xa5af('0x20'),'status',_0xa5af('0x8c'),util['inspect'](_0x316010[_0xa5af('0x57')],{'showHidden':![],'depth':null}));}break;case _0xa5af('0x8d'):if(_0x4dcdde==='DELIVRD'||_0x4dcdde===_0xa5af('0xd1')){return _0xe8eae0['update']({'read':!![]});}else{logger[_0xa5af('0x22')](_0xa5af('0x20'),_0xa5af('0x29'),_0xa5af('0x8d'),util[_0xa5af('0xc3')](_0x316010[_0xa5af('0x57')],{'showHidden':![],'depth':null}));}break;}return _0xe8eae0;}})['then'](respondWithResult(_0x1ac1e9,null))[_0xa5af('0x26')](handleError(_0x1ac1e9,null));};exports[_0xa5af('0xd2')]=function(_0x43f7ef,_0x17d3cb,_0xa26c67){var _0x3dd355,_0x2e605c,_0x163c66;return db[_0xa5af('0x4b')][_0xa5af('0x55')]({'where':{'id':_0x43f7ef[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x17d3cb,null))[_0xa5af('0x32')](function(_0x50ec88){if(_0x50ec88){_0x163c66=_0x50ec88;logger[_0xa5af('0x1f')](_0xa5af('0x20'),_0xa5af('0x29'),_0xa5af('0xc2'),_0x50ec88['type'],util['inspect'](_0x43f7ef['query'],{'showHidden':![],'depth':null}));switch(_0x50ec88[_0xa5af('0x38')]){case _0xa5af('0x86'):if(_0x43f7ef['query'][_0xa5af('0xd3')]&&_0x43f7ef[_0xa5af('0x3a')]['state']){_0x2e605c=_0x43f7ef[_0xa5af('0x3a')][_0xa5af('0xd4')];return db['SmsMessage'][_0xa5af('0x55')]({'where':{'messageId':_0x43f7ef['query'][_0xa5af('0xd3')]}});}break;}}})[_0xa5af('0x32')](handleEntityNotFound(_0x17d3cb,null))[_0xa5af('0x32')](function(_0x29429f){if(_0x29429f){_0x3dd355=_0x29429f;switch(_0x163c66['type']){case _0xa5af('0x86'):if(_0x2e605c==='2'||_0x2e605c==='6'){return _0x3dd355[_0xa5af('0xcd')]({'read':!![]});}else{logger['error'](_0xa5af('0x20'),_0xa5af('0x29'),_0xa5af('0x86'),util[_0xa5af('0xc3')](_0x43f7ef[_0xa5af('0x3a')],{'showHidden':![],'depth':null}));};break;}return _0x3dd355;}})['then'](respondWithResult(_0x17d3cb,null))[_0xa5af('0x26')](handleError(_0x17d3cb,null));};exports[_0xa5af('0xd5')]=function(_0x26a5d3,_0x3005cd,_0x508a2e){return db[_0xa5af('0x4b')][_0xa5af('0x55')]({'where':{'id':_0x26a5d3[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x3005cd,null))['then'](function(_0x424fb1){if(_0x424fb1){return _0x424fb1['addAgents'](_0x26a5d3[_0xa5af('0x57')][_0xa5af('0x66')],_['omit'](_0x26a5d3[_0xa5af('0x57')],[_0xa5af('0x66'),'id'])||{})[_0xa5af('0x9c')](function(_0x1efe8a){for(var _0x59d2a5=0x0;_0x59d2a5<_0x26a5d3[_0xa5af('0x57')]['ids'][_0xa5af('0x40')];_0x59d2a5+=0x1){socket[_0xa5af('0xd6')]('userSmsAccount:save',{'UserId':Number(_0x26a5d3[_0xa5af('0x57')][_0xa5af('0x66')][_0x59d2a5]),'SmsAccountId':Number(_0x26a5d3[_0xa5af('0x51')]['id'])});}return _0x1efe8a;});}})[_0xa5af('0x32')](respondWithResult(_0x3005cd,null))[_0xa5af('0x26')](handleError(_0x3005cd,null));};exports[_0xa5af('0xd7')]=function(_0x51cd1d,_0x3291c0,_0xc7ba4b){return db[_0xa5af('0x4b')][_0xa5af('0x55')]({'where':{'id':_0x51cd1d['params']['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x3291c0,null))[_0xa5af('0x32')](function(_0x4b0e6c){if(_0x4b0e6c){return _0x4b0e6c[_0xa5af('0xd7')](_0x51cd1d[_0xa5af('0x3a')]['ids'])[_0xa5af('0x32')](function(){if(_[_0xa5af('0xd8')](_0x51cd1d[_0xa5af('0x3a')][_0xa5af('0x66')])){for(var _0x861ba8=0x0;_0x861ba8<_0x51cd1d[_0xa5af('0x3a')][_0xa5af('0x66')]['length'];_0x861ba8+=0x1){socket[_0xa5af('0xd6')](_0xa5af('0xd9'),{'UserId':Number(_0x51cd1d['query'][_0xa5af('0x66')][_0x861ba8]),'SmsAccountId':Number(_0x51cd1d['params']['id'])});}}else{socket['emit'](_0xa5af('0xd9'),{'UserId':Number(_0x51cd1d[_0xa5af('0x3a')]['ids']),'SmsAccountId':Number(_0x51cd1d['params']['id'])});}});}})[_0xa5af('0x32')](respondWithStatusCode(_0x3291c0,null))[_0xa5af('0x26')](handleError(_0x3291c0,null));};exports['getAgents']=function(_0x55930c,_0x2398b4,_0x2a9aca){var _0x2f7e88={};var _0x4cbb25={};var _0x5b0cac;var _0x3abd32;return db['SmsAccount'][_0xa5af('0x63')]({'where':{'id':_0x55930c[_0xa5af('0x51')]['id']}})[_0xa5af('0x32')](handleEntityNotFound(_0x2398b4,null))[_0xa5af('0x32')](function(_0x58816b){if(_0x58816b){_0x5b0cac=_0x58816b;_0x4cbb25['model']=_[_0xa5af('0x53')](db[_0xa5af('0xa6')][_0xa5af('0x54')]);_0x4cbb25[_0xa5af('0x3a')]=_['keys'](_0x55930c[_0xa5af('0x3a')]);_0x4cbb25['filters']=_['intersection'](_0x4cbb25[_0xa5af('0x3d')],_0x4cbb25[_0xa5af('0x3a')]);_0x2f7e88[_0xa5af('0x3e')]=_[_0xa5af('0x3c')](_0x4cbb25['model'],qs[_0xa5af('0x3f')](_0x55930c[_0xa5af('0x3a')]['fields']));_0x2f7e88[_0xa5af('0x3e')]=_0x2f7e88[_0xa5af('0x3e')][_0xa5af('0x40')]?_0x2f7e88[_0xa5af('0x3e')]:_0x4cbb25['model'];_0x2f7e88[_0xa5af('0x43')]=qs[_0xa5af('0x44')](_0x55930c[_0xa5af('0x3a')][_0xa5af('0x44')]);_0x2f7e88[_0xa5af('0x45')]=qs[_0xa5af('0x3b')](_[_0xa5af('0x46')](_0x55930c[_0xa5af('0x3a')],_0x4cbb25[_0xa5af('0x3b')]));if(_0x55930c['query'][_0xa5af('0x49')]){_0x2f7e88[_0xa5af('0x45')]=_[_0xa5af('0x47')](_0x2f7e88[_0xa5af('0x45')],{'$or':_[_0xa5af('0x37')](_0x2f7e88[_0xa5af('0x3e')],function(_0x369a30){var _0x365ed2={};_0x365ed2[_0x369a30]={'$like':'%'+_0x55930c[_0xa5af('0x3a')][_0xa5af('0x49')]+'%'};return _0x365ed2;})});}_0x2f7e88=_[_0xa5af('0x47')]({},_0x2f7e88,_0x55930c[_0xa5af('0x4a')]);return _0x5b0cac[_0xa5af('0xda')](_0x2f7e88);}})[_0xa5af('0x32')](function(_0x4df1df){if(_0x4df1df){_0x3abd32=_0x4df1df[_0xa5af('0x40')];if(!_0x55930c[_0xa5af('0x3a')][_0xa5af('0x41')]('nolimit')){_0x2f7e88['limit']=qs['limit'](_0x55930c[_0xa5af('0x3a')][_0xa5af('0x2e')]);_0x2f7e88[_0xa5af('0x2c')]=qs[_0xa5af('0x2c')](_0x55930c['query'][_0xa5af('0x2c')]);}return _0x5b0cac[_0xa5af('0xda')](_0x2f7e88);}})[_0xa5af('0x32')](function(_0x4aa0a2){if(_0x4aa0a2){return _0x4aa0a2?{'count':_0x3abd32,'rows':_0x4aa0a2}:null;}})[_0xa5af('0x32')](respondWithResult(_0x2398b4,null))[_0xa5af('0x26')](handleError(_0x2398b4,null));}; \ No newline at end of file +var _0xe0bb=['tag','List','out','SmsMessage','dataValues','Messages','skebby','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','infobip','DELIVERED','groupName','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','ids','emit','userSmsAccount:save','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','http','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','map','SmsAccount','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','rows','show','keys','rawAttributes','include','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','getDispositions','Disposition','nolimit','SmsAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','findOne','pick','removeAnswers','sms','SmsApplication','orderBy','asc','account','Applications','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','connectel','message_id','plivo','Text','MessageUUID','results','csc','segmentedMessage','clickatell','fromNumber','text','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','autoclose','applications','push','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','send','\x0a','addApplications','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0bb,0x1db));var _0xbe0b=function(_0x5a5aca,_0x368fbb){_0x5a5aca=_0x5a5aca-0x0;var _0x1cb523=_0xe0bb[_0x5a5aca];return _0x1cb523;};'use strict';var emlformat=require(_0xbe0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe0b('0x1'));var jsonpatch=require(_0xbe0b('0x2'));var rp=require(_0xbe0b('0x3'));var moment=require(_0xbe0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbe0b('0x5'));var util=require('util');var path=require(_0xbe0b('0x6'));var sox=require(_0xbe0b('0x7'));var csv=require(_0xbe0b('0x8'));var ejs=require(_0xbe0b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbe0b('0xa'));var squel=require(_0xbe0b('0xb'));var crypto=require(_0xbe0b('0xc'));var jsforce=require(_0xbe0b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbe0b('0xe'));var Redis=require(_0xbe0b('0xf'));var authService=require(_0xbe0b('0x10'));var qs=require(_0xbe0b('0x11'));var as=require(_0xbe0b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe0b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbe0b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe0b('0x15'))['db'];config['redis']=_[_0xbe0b('0x16')](config[_0xbe0b('0x17')],{'host':_0xbe0b('0x18'),'port':0x18eb});var socket=require(_0xbe0b('0x19'))(new Redis(config[_0xbe0b('0x17')]));require(_0xbe0b('0x1a'))[_0xbe0b('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xbe0b('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x3a212c,_0x24f363,_0x4fea67,_0x509e63){return new BPromise(function(_0x10ec05,_0x186dd2){var _0x1c92fc=_0x509e63||client;return _0x1c92fc['request'](_0x3a212c,_0x4fea67)[_0xbe0b('0x1d')](function(_0x58fa2a){logger[_0xbe0b('0x1e')](_0xbe0b('0x1f'),_0x24f363,'request\x20sent');logger[_0xbe0b('0x20')](_0xbe0b('0x21'),_0x24f363,'request\x20sent',JSON[_0xbe0b('0x22')](_0x58fa2a));if(_0x58fa2a[_0xbe0b('0x23')]){if(_0x58fa2a[_0xbe0b('0x23')][_0xbe0b('0x24')]===0x1f4){logger[_0xbe0b('0x23')](_0xbe0b('0x1f'),_0x24f363,_0x58fa2a['error'][_0xbe0b('0x25')]);return _0x186dd2(_0x58fa2a[_0xbe0b('0x23')][_0xbe0b('0x25')]);}logger['error'](_0xbe0b('0x1f'),_0x24f363,_0x58fa2a[_0xbe0b('0x23')][_0xbe0b('0x25')]);return _0x10ec05(_0x58fa2a[_0xbe0b('0x23')][_0xbe0b('0x25')]);}else{logger['info'](_0xbe0b('0x1f'),_0x24f363,'request\x20sent');_0x10ec05(_0x58fa2a[_0xbe0b('0x26')][_0xbe0b('0x25')]);}})[_0xbe0b('0x27')](function(_0x14ca0a){logger[_0xbe0b('0x23')](_0xbe0b('0x1f'),_0x24f363,_0x14ca0a);_0x186dd2(_0x14ca0a);});});}function respondWithStatusCode(_0x316710,_0x51c594){_0x51c594=_0x51c594||0xcc;return function(_0x1f9a93){if(_0x1f9a93){return _0x316710[_0xbe0b('0x28')](_0x51c594);}return _0x316710[_0xbe0b('0x29')](_0x51c594)[_0xbe0b('0x2a')]();};}function respondWithResult(_0x3ea7f0,_0xa3f3da){_0xa3f3da=_0xa3f3da||0xc8;return function(_0x1443d1){if(_0x1443d1){return _0x3ea7f0['status'](_0xa3f3da)[_0xbe0b('0x2b')](_0x1443d1);}};}function respondWithFilteredResult(_0x23245f,_0x1675f4){return function(_0x3b436e){if(_0x3b436e){var _0x9ba154=typeof _0x1675f4[_0xbe0b('0x2c')]==='undefined'&&typeof _0x1675f4[_0xbe0b('0x2d')]===_0xbe0b('0x2e');var _0x18ab93=_0x3b436e['count'];var _0x392f10=_0x9ba154?0x0:_0x1675f4['offset'];var _0x2cb4d5=_0x9ba154?_0x3b436e['count']:_0x1675f4[_0xbe0b('0x2c')]+_0x1675f4['limit'];var _0x51cde4;if(_0x2cb4d5>=_0x18ab93){_0x2cb4d5=_0x18ab93;_0x51cde4=0xc8;}else{_0x51cde4=0xce;}_0x23245f[_0xbe0b('0x29')](_0x51cde4);return _0x23245f['set']('Content-Range',_0x392f10+'-'+_0x2cb4d5+'/'+_0x18ab93)[_0xbe0b('0x2b')](_0x3b436e);}return null;};}function patchUpdates(_0x11a03a){return function(_0x54730d){try{jsonpatch['apply'](_0x54730d,_0x11a03a,!![]);}catch(_0x245431){return BPromise[_0xbe0b('0x2f')](_0x245431);}return _0x54730d[_0xbe0b('0x30')]();};}function saveUpdates(_0x664f02,_0xb13b34){return function(_0x4b4f51){if(_0x4b4f51){return _0x4b4f51[_0xbe0b('0x31')](_0x664f02)[_0xbe0b('0x1d')](function(_0x3b6f58){return _0x3b6f58;});}return null;};}function removeEntity(_0x466978,_0x204674){return function(_0x85c92f){if(_0x85c92f){return _0x85c92f[_0xbe0b('0x32')]()['then'](function(){var _0x2333b0=_0x85c92f[_0xbe0b('0x33')]({'plain':!![]});var _0x37b3de=_0xbe0b('0x34');return db[_0xbe0b('0x35')][_0xbe0b('0x32')]({'where':{'type':_0x37b3de,'resourceId':_0x2333b0['id']}})[_0xbe0b('0x1d')](function(){return _0x85c92f;});})['then'](function(){_0x466978[_0xbe0b('0x29')](0xcc)[_0xbe0b('0x2a')]();});}};}function handleEntityNotFound(_0x51f37,_0x3d6e75){return function(_0x44b71c){if(!_0x44b71c){_0x51f37[_0xbe0b('0x28')](0x194);}return _0x44b71c;};}function handleError(_0x5a80ae,_0x33de72){_0x33de72=_0x33de72||0x1f4;return function(_0x42a5f4){logger[_0xbe0b('0x23')](_0x42a5f4[_0xbe0b('0x36')]);if(_0x42a5f4[_0xbe0b('0x37')]){delete _0x42a5f4[_0xbe0b('0x37')];}_0x5a80ae[_0xbe0b('0x29')](_0x33de72)['send'](_0x42a5f4);};}exports[_0xbe0b('0x38')]=function(_0x55d13a,_0x3577ea){var _0x1c6f99={'include':[{'model':db[_0xbe0b('0x39')],'as':'mandatoryDispositionPause'}]},_0x500141={},_0x59bee4={'count':0x0,'rows':[]};var _0x260e92=_[_0xbe0b('0x3a')](db[_0xbe0b('0x3b')]['rawAttributes'],function(_0x444cab){return{'name':_0x444cab['fieldName'],'type':_0x444cab[_0xbe0b('0x3c')][_0xbe0b('0x3d')]};});_0x500141[_0xbe0b('0x3e')]=_[_0xbe0b('0x3a')](_0x260e92,'name');_0x500141[_0xbe0b('0x3f')]=_['keys'](_0x55d13a[_0xbe0b('0x3f')]);_0x500141[_0xbe0b('0x40')]=_[_0xbe0b('0x41')](_0x500141[_0xbe0b('0x3e')],_0x500141[_0xbe0b('0x3f')]);_0x1c6f99['attributes']=_['intersection'](_0x500141['model'],qs[_0xbe0b('0x42')](_0x55d13a[_0xbe0b('0x3f')]['fields']));_0x1c6f99[_0xbe0b('0x43')]=_0x1c6f99['attributes'][_0xbe0b('0x44')]?_0x1c6f99[_0xbe0b('0x43')]:_0x500141[_0xbe0b('0x3e')];if(!_0x55d13a[_0xbe0b('0x3f')][_0xbe0b('0x45')]('nolimit')){_0x1c6f99[_0xbe0b('0x2d')]=qs[_0xbe0b('0x2d')](_0x55d13a[_0xbe0b('0x3f')]['limit']);_0x1c6f99[_0xbe0b('0x2c')]=qs[_0xbe0b('0x2c')](_0x55d13a['query']['offset']);}_0x1c6f99[_0xbe0b('0x46')]=qs['sort'](_0x55d13a[_0xbe0b('0x3f')][_0xbe0b('0x47')]);_0x1c6f99[_0xbe0b('0x48')]=qs[_0xbe0b('0x40')](_['pick'](_0x55d13a[_0xbe0b('0x3f')],_0x500141[_0xbe0b('0x40')]),_0x260e92);if(_0x55d13a[_0xbe0b('0x3f')][_0xbe0b('0x49')]){_0x1c6f99[_0xbe0b('0x48')]=_['merge'](_0x1c6f99[_0xbe0b('0x48')],{'$or':_[_0xbe0b('0x3a')](_0x260e92,function(_0x35c356){if(_0x35c356[_0xbe0b('0x3c')]!==_0xbe0b('0x4a')){var _0x4d63c8={};_0x4d63c8[_0x35c356['name']]={'$like':'%'+_0x55d13a[_0xbe0b('0x3f')][_0xbe0b('0x49')]+'%'};return _0x4d63c8;}})});}_0x1c6f99=_[_0xbe0b('0x4b')]({},_0x1c6f99,_0x55d13a[_0xbe0b('0x4c')]);var _0x12fa47={'where':_0x1c6f99['where']};return db['SmsAccount']['count'](_0x12fa47)[_0xbe0b('0x1d')](function(_0x14196e){_0x59bee4[_0xbe0b('0x4d')]=_0x14196e;if(_0x55d13a[_0xbe0b('0x3f')][_0xbe0b('0x4e')]){_0x1c6f99['include']=[{'all':!![]}];}return db[_0xbe0b('0x3b')]['findAll'](_0x1c6f99);})[_0xbe0b('0x1d')](function(_0x562c1b){_0x59bee4[_0xbe0b('0x4f')]=_0x562c1b;return _0x59bee4;})[_0xbe0b('0x1d')](respondWithFilteredResult(_0x3577ea,_0x1c6f99))[_0xbe0b('0x27')](handleError(_0x3577ea,null));};exports[_0xbe0b('0x50')]=function(_0x3f1490,_0xee7096){var _0x273783={'raw':![],'where':{'id':_0x3f1490['params']['id']},'include':[{'model':db[_0xbe0b('0x39')],'as':'mandatoryDispositionPause'}]},_0x94df4b={};_0x94df4b[_0xbe0b('0x3e')]=_[_0xbe0b('0x51')](db[_0xbe0b('0x3b')][_0xbe0b('0x52')]);_0x94df4b[_0xbe0b('0x3f')]=_['keys'](_0x3f1490[_0xbe0b('0x3f')]);_0x94df4b['filters']=_['intersection'](_0x94df4b['model'],_0x94df4b[_0xbe0b('0x3f')]);_0x273783['attributes']=_[_0xbe0b('0x41')](_0x94df4b[_0xbe0b('0x3e')],qs[_0xbe0b('0x42')](_0x3f1490[_0xbe0b('0x3f')][_0xbe0b('0x42')]));_0x273783[_0xbe0b('0x43')]=_0x273783[_0xbe0b('0x43')][_0xbe0b('0x44')]?_0x273783['attributes']:_0x94df4b[_0xbe0b('0x3e')];if(_0x3f1490[_0xbe0b('0x3f')]['includeAll']){_0x273783[_0xbe0b('0x53')]=[{'all':!![]}];}_0x273783=_['merge']({},_0x273783,_0x3f1490['options']);return db[_0xbe0b('0x3b')]['find'](_0x273783)[_0xbe0b('0x1d')](handleEntityNotFound(_0xee7096,null))[_0xbe0b('0x1d')](respondWithResult(_0xee7096,null))['catch'](handleError(_0xee7096,null));};exports[_0xbe0b('0x54')]=function(_0x41f004,_0x388643){return db[_0xbe0b('0x3b')][_0xbe0b('0x54')](_0x41f004[_0xbe0b('0x55')],{})[_0xbe0b('0x1d')](function(_0x3c0332){var _0x1dbb90=_0x41f004[_0xbe0b('0x56')]['get']({'plain':!![]});if(!_0x1dbb90)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1dbb90[_0xbe0b('0x57')]===_0xbe0b('0x56')){var _0x4a59b2=_0x3c0332[_0xbe0b('0x33')]({'plain':!![]});var _0x28ffa6='SmsAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x28ffa6,'userProfileId':_0x1dbb90[_0xbe0b('0x58')]},'raw':!![]})[_0xbe0b('0x1d')](function(_0x5483de){if(_0x5483de&&_0x5483de[_0xbe0b('0x59')]===0x0){return db['UserProfileResource'][_0xbe0b('0x54')]({'name':_0x4a59b2['name'],'resourceId':_0x4a59b2['id'],'type':_0x5483de[_0xbe0b('0x37')],'sectionId':_0x5483de['id']},{})[_0xbe0b('0x1d')](function(){return _0x3c0332;});}else{return _0x3c0332;}})[_0xbe0b('0x27')](function(_0x5f04fb){logger[_0xbe0b('0x23')](_0xbe0b('0x5a'),_0x5f04fb);throw _0x5f04fb;});}return _0x3c0332;})['then'](respondWithResult(_0x388643,0xc9))[_0xbe0b('0x27')](handleError(_0x388643,null));};exports['update']=function(_0x502ca4,_0x130565){if(_0x502ca4[_0xbe0b('0x55')]['id']){delete _0x502ca4['body']['id'];}return db['SmsAccount'][_0xbe0b('0x5b')]({'where':{'id':_0x502ca4[_0xbe0b('0x5c')]['id']},'include':[{'model':db[_0xbe0b('0x39')],'as':'mandatoryDispositionPause'}]})[_0xbe0b('0x1d')](handleEntityNotFound(_0x130565,null))[_0xbe0b('0x1d')](saveUpdates(_0x502ca4['body'],null))[_0xbe0b('0x1d')](respondWithResult(_0x130565,null))[_0xbe0b('0x27')](handleError(_0x130565,null));};exports[_0xbe0b('0x32')]=function(_0x4484a4,_0x3ebf0d){return db[_0xbe0b('0x3b')][_0xbe0b('0x5b')]({'where':{'id':_0x4484a4[_0xbe0b('0x5c')]['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x3ebf0d,null))['then'](removeEntity(_0x3ebf0d,null))[_0xbe0b('0x27')](handleError(_0x3ebf0d,null));};exports[_0xbe0b('0x5d')]=function(_0x40e55d,_0x559f17){return db[_0xbe0b('0x3b')][_0xbe0b('0x5d')]()[_0xbe0b('0x1d')](respondWithResult(_0x559f17,null))[_0xbe0b('0x27')](handleError(_0x559f17,null));};exports[_0xbe0b('0x5e')]=function(_0x1abff5,_0x5375df,_0x3deebe){if(_0x1abff5['body']['id']){delete _0x1abff5[_0xbe0b('0x55')]['id'];}return db[_0xbe0b('0x3b')]['find']({'where':{'id':_0x1abff5[_0xbe0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5375df,null))[_0xbe0b('0x1d')](function(_0x27faa6){if(_0x27faa6){_0x1abff5[_0xbe0b('0x55')]['SmsAccountId']=_0x27faa6['id'];return db['Disposition']['create'](_0x1abff5[_0xbe0b('0x55')]);}})[_0xbe0b('0x1d')](respondWithResult(_0x5375df,null))[_0xbe0b('0x27')](handleError(_0x5375df,null));};exports[_0xbe0b('0x5f')]=function(_0x5bfca5,_0x83abf0,_0x37979c){var _0x36e26b={'raw':![],'where':{}};var _0xd77a9c={};var _0x2c70ec={'count':0x0,'rows':[]};return db[_0xbe0b('0x3b')]['findOne']({'where':{'id':_0x5bfca5[_0xbe0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x83abf0,null))[_0xbe0b('0x1d')](function(_0x37cf18){if(_0x37cf18){_0xd77a9c[_0xbe0b('0x3e')]=_[_0xbe0b('0x51')](db[_0xbe0b('0x60')][_0xbe0b('0x52')]);_0xd77a9c[_0xbe0b('0x3f')]=_[_0xbe0b('0x51')](_0x5bfca5[_0xbe0b('0x3f')]);_0xd77a9c[_0xbe0b('0x40')]=_['intersection'](_0xd77a9c[_0xbe0b('0x3e')],_0xd77a9c['query']);_0x36e26b[_0xbe0b('0x43')]=_[_0xbe0b('0x41')](_0xd77a9c[_0xbe0b('0x3e')],qs['fields'](_0x5bfca5[_0xbe0b('0x3f')][_0xbe0b('0x42')]));_0x36e26b['attributes']=_0x36e26b[_0xbe0b('0x43')][_0xbe0b('0x44')]?_0x36e26b[_0xbe0b('0x43')]:_0xd77a9c[_0xbe0b('0x3e')];if(!_0x5bfca5['query'][_0xbe0b('0x45')](_0xbe0b('0x61'))){_0x36e26b[_0xbe0b('0x2d')]=qs[_0xbe0b('0x2d')](_0x5bfca5['query'][_0xbe0b('0x2d')]);_0x36e26b[_0xbe0b('0x2c')]=qs['offset'](_0x5bfca5[_0xbe0b('0x3f')][_0xbe0b('0x2c')]);}_0x36e26b[_0xbe0b('0x46')]=qs[_0xbe0b('0x47')](_0x5bfca5[_0xbe0b('0x3f')][_0xbe0b('0x47')]);_0x36e26b['where']=qs[_0xbe0b('0x40')](_['pick'](_0x5bfca5[_0xbe0b('0x3f')],_0xd77a9c[_0xbe0b('0x40')]));_0x36e26b['where'][_0xbe0b('0x62')]=_0x37cf18['id'];if(_0x5bfca5[_0xbe0b('0x3f')][_0xbe0b('0x49')]){_0x36e26b[_0xbe0b('0x48')]=_[_0xbe0b('0x4b')](_0x36e26b[_0xbe0b('0x48')],{'$or':_['map'](_0x36e26b[_0xbe0b('0x43')],function(_0x403033){var _0x244ed3={};_0x244ed3[_0x403033]={'$like':'%'+_0x5bfca5[_0xbe0b('0x3f')][_0xbe0b('0x49')]+'%'};return _0x244ed3;})});}_0x36e26b=_[_0xbe0b('0x4b')]({},_0x36e26b,_0x5bfca5[_0xbe0b('0x4c')]);return db[_0xbe0b('0x60')]['count']({'where':_0x36e26b[_0xbe0b('0x48')]})[_0xbe0b('0x1d')](function(_0x3829af){_0x2c70ec[_0xbe0b('0x4d')]=_0x3829af;if(_0x5bfca5[_0xbe0b('0x3f')]['includeAll']){_0x36e26b[_0xbe0b('0x53')]=[{'all':!![]}];}return db[_0xbe0b('0x60')][_0xbe0b('0x63')](_0x36e26b);})[_0xbe0b('0x1d')](function(_0x39ab5e){_0x2c70ec['rows']=_0x39ab5e;return _0x2c70ec;});}})['then'](respondWithFilteredResult(_0x83abf0,_0x36e26b))[_0xbe0b('0x27')](handleError(_0x83abf0,null));};exports[_0xbe0b('0x64')]=function(_0x47ffdc,_0x4a1e49,_0x1e4c43){return db[_0xbe0b('0x3b')]['find']({'where':{'id':_0x47ffdc[_0xbe0b('0x5c')]['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x4a1e49,null))[_0xbe0b('0x1d')](function(_0x26ec93){if(_0x26ec93){return _0x26ec93[_0xbe0b('0x64')](_0x47ffdc[_0xbe0b('0x3f')]['ids']);}})[_0xbe0b('0x1d')](respondWithStatusCode(_0x4a1e49,null))[_0xbe0b('0x27')](handleError(_0x4a1e49,null));};exports[_0xbe0b('0x65')]=function(_0x2d0ebc,_0xc1f031,_0x2f9e6f){if(_0x2d0ebc['body']['id']){delete _0x2d0ebc[_0xbe0b('0x55')]['id'];}return db[_0xbe0b('0x3b')][_0xbe0b('0x5b')]({'where':{'id':_0x2d0ebc[_0xbe0b('0x5c')]['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0xc1f031,null))[_0xbe0b('0x1d')](function(_0xde943b){if(_0xde943b){_0x2d0ebc[_0xbe0b('0x55')][_0xbe0b('0x62')]=_0xde943b['id'];return db[_0xbe0b('0x66')][_0xbe0b('0x54')](_0x2d0ebc[_0xbe0b('0x55')]);}})[_0xbe0b('0x1d')](respondWithResult(_0xc1f031,null))[_0xbe0b('0x27')](handleError(_0xc1f031,null));};exports['getAnswers']=function(_0x496f11,_0x1b4b77,_0x5aeddd){var _0x453b3d={'raw':![],'where':{}};var _0x3c891b={};var _0x24ef50={'count':0x0,'rows':[]};return db[_0xbe0b('0x3b')][_0xbe0b('0x67')]({'where':{'id':_0x496f11['params']['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x1b4b77,null))['then'](function(_0x25e729){if(_0x25e729){_0x3c891b[_0xbe0b('0x3e')]=_[_0xbe0b('0x51')](db[_0xbe0b('0x66')][_0xbe0b('0x52')]);_0x3c891b[_0xbe0b('0x3f')]=_[_0xbe0b('0x51')](_0x496f11[_0xbe0b('0x3f')]);_0x3c891b[_0xbe0b('0x40')]=_['intersection'](_0x3c891b[_0xbe0b('0x3e')],_0x3c891b['query']);_0x453b3d[_0xbe0b('0x43')]=_['intersection'](_0x3c891b[_0xbe0b('0x3e')],qs[_0xbe0b('0x42')](_0x496f11[_0xbe0b('0x3f')][_0xbe0b('0x42')]));_0x453b3d['attributes']=_0x453b3d[_0xbe0b('0x43')]['length']?_0x453b3d[_0xbe0b('0x43')]:_0x3c891b[_0xbe0b('0x3e')];if(!_0x496f11[_0xbe0b('0x3f')][_0xbe0b('0x45')](_0xbe0b('0x61'))){_0x453b3d['limit']=qs[_0xbe0b('0x2d')](_0x496f11[_0xbe0b('0x3f')][_0xbe0b('0x2d')]);_0x453b3d[_0xbe0b('0x2c')]=qs[_0xbe0b('0x2c')](_0x496f11['query'][_0xbe0b('0x2c')]);}_0x453b3d['order']=qs[_0xbe0b('0x47')](_0x496f11['query']['sort']);_0x453b3d['where']=qs[_0xbe0b('0x40')](_[_0xbe0b('0x68')](_0x496f11[_0xbe0b('0x3f')],_0x3c891b[_0xbe0b('0x40')]));_0x453b3d[_0xbe0b('0x48')][_0xbe0b('0x62')]=_0x25e729['id'];if(_0x496f11['query'][_0xbe0b('0x49')]){_0x453b3d[_0xbe0b('0x48')]=_[_0xbe0b('0x4b')](_0x453b3d[_0xbe0b('0x48')],{'$or':_[_0xbe0b('0x3a')](_0x453b3d['attributes'],function(_0xaaa5c1){var _0x5ce47b={};_0x5ce47b[_0xaaa5c1]={'$like':'%'+_0x496f11[_0xbe0b('0x3f')][_0xbe0b('0x49')]+'%'};return _0x5ce47b;})});}_0x453b3d=_[_0xbe0b('0x4b')]({},_0x453b3d,_0x496f11[_0xbe0b('0x4c')]);return db[_0xbe0b('0x66')][_0xbe0b('0x4d')]({'where':_0x453b3d[_0xbe0b('0x48')]})[_0xbe0b('0x1d')](function(_0xdc5e33){_0x24ef50[_0xbe0b('0x4d')]=_0xdc5e33;if(_0x496f11['query']['includeAll']){_0x453b3d[_0xbe0b('0x53')]=[{'all':!![]}];}return db[_0xbe0b('0x66')][_0xbe0b('0x63')](_0x453b3d);})['then'](function(_0x2f9d79){_0x24ef50['rows']=_0x2f9d79;return _0x24ef50;});}})['then'](respondWithFilteredResult(_0x1b4b77,_0x453b3d))[_0xbe0b('0x27')](handleError(_0x1b4b77,null));};exports[_0xbe0b('0x69')]=function(_0x2ba459,_0x1277ea,_0x2f84fa){return db['SmsAccount'][_0xbe0b('0x5b')]({'where':{'id':_0x2ba459[_0xbe0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1277ea,null))[_0xbe0b('0x1d')](function(_0x5627e2){if(_0x5627e2){return _0x5627e2[_0xbe0b('0x69')](_0x2ba459[_0xbe0b('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0x1277ea,null))[_0xbe0b('0x27')](handleError(_0x1277ea,null));};exports['notify']=function(_0x2e4882,_0x1cebae,_0xa73788){var _0x135d97={'channel':_0xbe0b('0x6a')};var _0x25a0ad=[];var _0x2ff53b=[];var _0x2457d8={};return db[_0xbe0b('0x3b')][_0xbe0b('0x5b')]({'where':{'id':_0x2e4882['params']['id']},'include':[{'model':db[_0xbe0b('0x6b')],'as':'Applications'}]})[_0xbe0b('0x1d')](handleEntityNotFound(_0x1cebae,null))[_0xbe0b('0x1d')](function(_0x20e7a7){_0x135d97['account']=_0x20e7a7;_0x135d97['applications']=_[_0xbe0b('0x6c')](_0x20e7a7['Applications'],['priority'],[_0xbe0b('0x6d')]);if(_0x135d97[_0xbe0b('0x6e')][_0xbe0b('0x6f')]){delete _0x135d97['account'][_0xbe0b('0x6f')];}return db['CmContact'][_0xbe0b('0x5d')]();})['then'](function(_0x168894){if(!_0x168894){throw new db[(_0xbe0b('0x70'))][(_0xbe0b('0x71'))](_0xbe0b('0x72'));}_0x25a0ad=_[_0xbe0b('0x73')](_[_0xbe0b('0x51')](_0x168894),['createdAt',_0xbe0b('0x74')]);_0x2ff53b=_[_0xbe0b('0x73')](_[_0xbe0b('0x51')](_0x168894),[_0xbe0b('0x75'),_0xbe0b('0x74'),_0xbe0b('0x76'),_0xbe0b('0x77')]);_0x135d97[_0xbe0b('0x55')]={'mapKey':_0xbe0b('0x78')};if(_0x135d97[_0xbe0b('0x6e')][_0xbe0b('0x3c')]){switch(_0x135d97[_0xbe0b('0x6e')][_0xbe0b('0x3c')]){case _0xbe0b('0x79'):_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x7b')];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')]=_0x2e4882[_0xbe0b('0x55')]['Body'];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7c')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x7d')];break;case'skebby':_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')]='+'+_0x2e4882[_0xbe0b('0x55')]['sender'];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')]=_0x2e4882[_0xbe0b('0x55')]['text'];break;case _0xbe0b('0x7e'):_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x7a')];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x25')];break;case'clicksend':_0x135d97['body'][_0xbe0b('0x7a')]=_0x2e4882[_0xbe0b('0x55')]['from'];_0x135d97[_0xbe0b('0x55')]['body']=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x55')];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7c')]=_0x2e4882['body'][_0xbe0b('0x7f')];break;case _0xbe0b('0x80'):_0x135d97[_0xbe0b('0x55')]['from']=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x7b')];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')]=_0x2e4882['body'][_0xbe0b('0x81')];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7c')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x82')];break;case'infobip':_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')]='+'+_0x2e4882[_0xbe0b('0x55')]['results'][0x0][_0xbe0b('0x7a')];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x83')][0x0]['text'];_0x135d97['body'][_0xbe0b('0x7c')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x83')][0x0][_0xbe0b('0x7c')];break;case _0xbe0b('0x84'):_0x135d97['body']['from']=_0x2e4882[_0xbe0b('0x55')]['originatingAddress'];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')]=_0x2e4882['body'][_0xbe0b('0x85')]['message'];break;case _0xbe0b('0x86'):_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x87')];_0x135d97[_0xbe0b('0x55')]['body']=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x88')];_0x135d97['body'][_0xbe0b('0x7c')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x89')];break;case _0xbe0b('0x8a'):_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7c')]=_0x2e4882[_0xbe0b('0x55')][0x0]['message']['id'];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')]=_0x2e4882[_0xbe0b('0x55')][0x0][_0xbe0b('0x25')][_0xbe0b('0x7a')];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')]=_0x2e4882[_0xbe0b('0x55')][0x0][_0xbe0b('0x25')][_0xbe0b('0x88')];break;case _0xbe0b('0x8b'):_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')]=_0x2e4882['body']['from'];_0x135d97[_0xbe0b('0x55')]['body']=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x25')];_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7c')]=_0x2e4882[_0xbe0b('0x55')][_0xbe0b('0x8c')];break;}}if(_0x135d97[_0xbe0b('0x55')]['id']){delete _0x135d97['body']['id'];}if(_['isNil'](_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')])){throw new db['Sequelize'][(_0xbe0b('0x71'))](_0xbe0b('0x8d'));}if(_[_0xbe0b('0x8e')](_0x135d97['body'][_0xbe0b('0x55')])||_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')]===''){throw new db[(_0xbe0b('0x70'))][(_0xbe0b('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbe0b('0x8e')](_0x135d97[_0xbe0b('0x55')]['mapKey'])){throw new db[(_0xbe0b('0x70'))][(_0xbe0b('0x71'))](_0xbe0b('0x8f')+_0x2ff53b);}if(!_[_0xbe0b('0x90')](_0x2ff53b,_0x135d97['body']['mapKey'])){throw new db[(_0xbe0b('0x70'))]['ValidationError'](_0xbe0b('0x91')+_0x2ff53b);}_0x2457d8[_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x92')]]=_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')];return db[_0xbe0b('0x93')][_0xbe0b('0x5b')]({'where':{'id':_0x135d97[_0xbe0b('0x6e')][_0xbe0b('0x77')]},'include':[{'model':db[_0xbe0b('0x94')],'as':_0xbe0b('0x95'),'where':_0x2457d8,'limit':0x1,'order':[['updatedAt',_0xbe0b('0x96')]]}]});})['then'](handleEntityNotFound(_0x1cebae,null))[_0xbe0b('0x1d')](function(_0x41c53b){if(_0x41c53b){_0x135d97[_0xbe0b('0x97')]=_[_0xbe0b('0x98')](_0x41c53b,[_0xbe0b('0x95')]);if(_0x41c53b[_0xbe0b('0x95')][_0xbe0b('0x44')]){return _0x41c53b[_0xbe0b('0x95')][0x0];}var _0x1983e1=_[_0xbe0b('0x16')](_0x135d97[_0xbe0b('0x55')],{'firstName':_0x135d97['body'][_0xbe0b('0x7a')],'ListId':_0x41c53b['id']});_0x1983e1[_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x92')]]=_0x135d97['body'][_0xbe0b('0x7a')];return db[_0xbe0b('0x94')][_0xbe0b('0x54')](_0x1983e1,{'fields':_0x25a0ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x1cebae,null))[_0xbe0b('0x1d')](function(_0x2f1ab4){if(_0x2f1ab4){_0x135d97['contact']=_0x2f1ab4;var _0x8beceb={'ContactId':_0x2f1ab4['id'],'phone':_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7a')],'SmsAccountId':_0x2e4882[_0xbe0b('0x5c')]['id']};var _0x35ca48={'ContactId':_0x2f1ab4['id'],'SmsAccountId':_0x2e4882[_0xbe0b('0x5c')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x35ca48})['then'](function(_0xfbaabd){if(_0xfbaabd){return[_0xfbaabd,![]];}return db[_0xbe0b('0x99')][_0xbe0b('0x54')](_0x8beceb)[_0xbe0b('0x1d')](function(_0x5c4fbf){return[_0x5c4fbf,!![]];});});}})[_0xbe0b('0x9a')](function(_0x49e4bf,_0x12dd12){_0x135d97[_0xbe0b('0x9b')]=_0x49e4bf[_0xbe0b('0x33')]({'plain':!![]});_0x135d97[_0xbe0b('0x9b')]['created']=![];if(_0x12dd12){if(_0x135d97[_0xbe0b('0x6e')][_0xbe0b('0x9c')]){_0x135d97[_0xbe0b('0x9d')][_0xbe0b('0x9e')]({'id':0x0,'priority':_0x135d97[_0xbe0b('0x9d')][_0xbe0b('0x44')]+0x1,'app':'close','appdata':_0xbe0b('0x9f'),'interval':_0xbe0b('0xa0')});}_0x135d97[_0xbe0b('0x9b')][_0xbe0b('0xa1')]=!![];}return db['SmsMessage'][_0xbe0b('0x54')]({'phone':_0x135d97[_0xbe0b('0x55')]['from'],'messageId':_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x7c')],'body':_0x135d97[_0xbe0b('0x55')][_0xbe0b('0x55')],'SmsAccountId':_0x2e4882[_0xbe0b('0x5c')]['id'],'SmsInteractionId':_0x49e4bf['id'],'direction':'in','ContactId':_0x49e4bf[_0xbe0b('0xa2')],'AttachmentId':_0x135d97[_0xbe0b('0x55')][_0xbe0b('0xa3')]});})[_0xbe0b('0x1d')](function(_0x5c1d4e){_0x135d97[_0xbe0b('0x25')]=_0x5c1d4e;if(_0x135d97[_0xbe0b('0x9b')][_0xbe0b('0xa4')]){return db[_0xbe0b('0xa5')]['find']({'attributes':['id','name'],'where':{'id':_0x135d97[_0xbe0b('0x9b')][_0xbe0b('0xa4')]}})[_0xbe0b('0x1d')](function(_0x37c444){if(_0x37c444){_0x135d97[_0xbe0b('0x9d')][_0xbe0b('0xa6')]({'id':0x0,'priority':0x0,'app':_0xbe0b('0xa7'),'appdata':_0x37c444[_0xbe0b('0x37')]+','+(_0x135d97[_0xbe0b('0x6e')][_0xbe0b('0xa8')]||0xa),'interval':_0xbe0b('0xa0')});}return respondWithRpcPromise(_0xbe0b('0xa9'),_0xbe0b('0xaa'),_0x135d97);});}return respondWithRpcPromise('Start','startRouting',_0x135d97);})[_0xbe0b('0x1d')](function(_0x42b867){if(_0x42b867){var _0x562e31=0xc8;var _0x5e1383=_0xbe0b('0xab');logger[_0xbe0b('0x1e')](_0xbe0b('0x21'),_0x5e1383,_0x562e31,_0xbe0b('0xac'));logger['debug'](_0xbe0b('0xad'),_0x5e1383,_0x562e31,_0xbe0b('0xac'),JSON['stringify'](_0x42b867));if(_0x135d97[_0xbe0b('0x6e')][_0xbe0b('0x3c')]===_0xbe0b('0x79')){return _0x1cebae[_0xbe0b('0x29')](_0x562e31)[_0xbe0b('0xae')]('Content-Type',_0xbe0b('0xaf'))[_0xbe0b('0xb0')](_0xbe0b('0xb1'));}else{return _0x1cebae[_0xbe0b('0x29')](_0x562e31)[_0xbe0b('0x2b')](_0x42b867);}}})[_0xbe0b('0x27')](handleError(_0x1cebae,null));};exports[_0xbe0b('0xb2')]=function(_0x484b9c,_0x1575e6,_0x2d5252){return db[_0xbe0b('0x3b')][_0xbe0b('0x67')]({'where':{'id':_0x484b9c[_0xbe0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1575e6,null))[_0xbe0b('0x1d')](function(_0x1b5efd){if(_0x1b5efd){return db[_0xbe0b('0xb3')][_0xbe0b('0xb4')](function(_0x4278fb){return db[_0xbe0b('0x6b')]['destroy']({'where':{'SmsAccountId':_0x484b9c[_0xbe0b('0x5c')]['id']},'transaction':_0x4278fb})['then'](function(_0x12609e){var _0x36b3c9=_[_0xbe0b('0x3a')](_0x484b9c[_0xbe0b('0x55')],function(_0x5ea96f){_0x5ea96f[_0xbe0b('0x62')]=_0x484b9c[_0xbe0b('0x5c')]['id'];return _0x5ea96f;});return db[_0xbe0b('0x6b')][_0xbe0b('0xb5')](_0x36b3c9,{'transaction':_0x4278fb});});})[_0xbe0b('0x1d')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x484b9c[_0xbe0b('0x5c')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x1575e6,null))['catch'](handleError(_0x1575e6,null));};exports[_0xbe0b('0xb6')]=function(_0x57795b,_0xd50b6f,_0x163f7b){var _0x3ed210={};var _0x219648={};var _0x19694d;var _0x206e29;return db[_0xbe0b('0x3b')]['findOne']({'where':{'id':_0x57795b[_0xbe0b('0x5c')]['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0xd50b6f,null))[_0xbe0b('0x1d')](function(_0x5b9a29){if(_0x5b9a29){_0x19694d=_0x5b9a29;_0x219648[_0xbe0b('0x3e')]=_[_0xbe0b('0x51')](db[_0xbe0b('0x6b')]['rawAttributes']);_0x219648[_0xbe0b('0x3f')]=_['keys'](_0x57795b[_0xbe0b('0x3f')]);_0x219648[_0xbe0b('0x40')]=_[_0xbe0b('0x41')](_0x219648[_0xbe0b('0x3e')],_0x219648[_0xbe0b('0x3f')]);_0x3ed210[_0xbe0b('0x43')]=_[_0xbe0b('0x41')](_0x219648['model'],qs['fields'](_0x57795b['query'][_0xbe0b('0x42')]));_0x3ed210[_0xbe0b('0x43')]=_0x3ed210[_0xbe0b('0x43')][_0xbe0b('0x44')]?_0x3ed210[_0xbe0b('0x43')]:_0x219648['model'];_0x3ed210[_0xbe0b('0x46')]=qs[_0xbe0b('0x47')](_0x57795b[_0xbe0b('0x3f')]['sort']);_0x3ed210[_0xbe0b('0x48')]=qs[_0xbe0b('0x40')](_[_0xbe0b('0x68')](_0x57795b['query'],_0x219648[_0xbe0b('0x40')]));if(_0x57795b[_0xbe0b('0x3f')]['filter']){_0x3ed210['where']=_[_0xbe0b('0x4b')](_0x3ed210[_0xbe0b('0x48')],{'$or':_['map'](_0x3ed210[_0xbe0b('0x43')],function(_0x587610){var _0xcd2f02={};_0xcd2f02[_0x587610]={'$like':'%'+_0x57795b[_0xbe0b('0x3f')][_0xbe0b('0x49')]+'%'};return _0xcd2f02;})});}_0x3ed210=_[_0xbe0b('0x4b')]({},_0x3ed210,_0x57795b[_0xbe0b('0x4c')]);return _0x19694d[_0xbe0b('0xb6')](_0x3ed210);}})[_0xbe0b('0x1d')](function(_0x2d8503){if(_0x2d8503){_0x206e29=_0x2d8503[_0xbe0b('0x44')];if(!_0x57795b[_0xbe0b('0x3f')][_0xbe0b('0x45')](_0xbe0b('0x61'))){_0x3ed210[_0xbe0b('0x2d')]=qs[_0xbe0b('0x2d')](_0x57795b[_0xbe0b('0x3f')]['limit']);_0x3ed210['offset']=qs[_0xbe0b('0x2c')](_0x57795b['query'][_0xbe0b('0x2c')]);}return _0x19694d[_0xbe0b('0xb6')](_0x3ed210);}})[_0xbe0b('0x1d')](function(_0x37ed3f){if(_0x37ed3f){return _0x37ed3f?{'count':_0x206e29,'rows':_0x37ed3f}:null;}})[_0xbe0b('0x1d')](respondWithResult(_0xd50b6f,null))[_0xbe0b('0x27')](handleError(_0xd50b6f,null));};exports[_0xbe0b('0xb7')]=function(_0x5b98d1,_0x1ec89e,_0x316914){var _0x227ad7={'raw':![],'where':{}};var _0x1de491={};var _0x207617={'count':0x0,'rows':[]};return db[_0xbe0b('0x3b')][_0xbe0b('0x67')]({'where':{'id':_0x5b98d1['params']['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x1ec89e,null))['then'](function(_0xf5c49f){if(_0xf5c49f){_0x1de491[_0xbe0b('0x3e')]=_[_0xbe0b('0x51')](db[_0xbe0b('0x99')][_0xbe0b('0x52')]);_0x1de491[_0xbe0b('0x3f')]=_['keys'](_0x5b98d1[_0xbe0b('0x3f')]);_0x1de491['filters']=_[_0xbe0b('0x41')](_0x1de491[_0xbe0b('0x3e')],_0x1de491[_0xbe0b('0x3f')]);_0x227ad7[_0xbe0b('0x43')]=_[_0xbe0b('0x41')](_0x1de491[_0xbe0b('0x3e')],qs['fields'](_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0x42')]));_0x227ad7['attributes']=_0x227ad7[_0xbe0b('0x43')]['length']?_0x227ad7['attributes']:_0x1de491[_0xbe0b('0x3e')];if(!_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0x45')]('nolimit')){_0x227ad7[_0xbe0b('0x2d')]=qs[_0xbe0b('0x2d')](_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0x2d')]);_0x227ad7[_0xbe0b('0x2c')]=qs[_0xbe0b('0x2c')](_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0x2c')]);}_0x227ad7[_0xbe0b('0x46')]=qs[_0xbe0b('0x47')](_0x5b98d1['query']['sort']);_0x227ad7[_0xbe0b('0x48')]=qs[_0xbe0b('0x40')](_[_0xbe0b('0x68')](_0x5b98d1[_0xbe0b('0x3f')],_0x1de491[_0xbe0b('0x40')]));_0x227ad7[_0xbe0b('0x48')][_0xbe0b('0x62')]=_0xf5c49f['id'];if(_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0x49')]){_0x227ad7[_0xbe0b('0x48')]=_[_0xbe0b('0x4b')](_0x227ad7[_0xbe0b('0x48')],{'$or':_['map'](_0x227ad7[_0xbe0b('0x43')],function(_0xe09b22){var _0xc7955d={};_0xc7955d[_0xe09b22]={'$like':'%'+_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0x49')]+'%'};return _0xc7955d;})});}_0x227ad7=_[_0xbe0b('0x4b')]({},_0x227ad7,_0x5b98d1[_0xbe0b('0x4c')]);return db['SmsInteraction'][_0xbe0b('0x4d')]({'where':_0x227ad7[_0xbe0b('0x48')]})['then'](function(_0x1ab0da){_0x207617['count']=_0x1ab0da;if(_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0x4e')]){_0x227ad7[_0xbe0b('0x53')]=[{'model':db[_0xbe0b('0x94')],'as':_0xbe0b('0xb8'),'required':![]},{'model':db[_0xbe0b('0xa5')],'as':_0xbe0b('0xb9'),'attributes':[_0xbe0b('0x37'),_0xbe0b('0xba'),_0xbe0b('0xbb')],'required':![]},{'model':db[_0xbe0b('0xbc')],'as':_0xbe0b('0xbd'),'attributes':['id','name',_0xbe0b('0xbe')],'where':_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0xbf')]?{'id':_0x5b98d1[_0xbe0b('0x3f')][_0xbe0b('0xbf')]}:undefined,'required':_0x5b98d1['query'][_0xbe0b('0xbf')]?!![]:![]}];}return db[_0xbe0b('0x99')][_0xbe0b('0x63')](_0x227ad7);})[_0xbe0b('0x1d')](function(_0xee072c){_0x207617['rows']=_0xee072c;return _0x207617;});}})['then'](respondWithFilteredResult(_0x1ec89e,_0x227ad7))[_0xbe0b('0x27')](handleError(_0x1ec89e,null));};exports[_0xbe0b('0xb0')]=function(_0x40a1de,_0x4b6fb8,_0x3e79bf){var _0x36e221,_0x141091,_0x340cc8;if(_['isNil'](_0x40a1de['body'][_0xbe0b('0x55')])||_0x40a1de[_0xbe0b('0x55')][_0xbe0b('0x55')]===''){throw new db[(_0xbe0b('0x70'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbe0b('0x8e')](_0x40a1de[_0xbe0b('0x55')]['to'])){throw new db['Sequelize'][(_0xbe0b('0x71'))]('to\x20is\x20mandatory');}_0x36e221=_0x40a1de[_0xbe0b('0x55')]['to'];return db[_0xbe0b('0x3b')][_0xbe0b('0x5b')]({'where':{'id':_0x40a1de[_0xbe0b('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xbe0b('0xc0'),'include':[{'model':db[_0xbe0b('0x94')],'as':_0xbe0b('0x95'),'where':{'mobile':_0x36e221},'limit':0x1,'order':[[_0xbe0b('0x74'),_0xbe0b('0x96')]]}]}]})[_0xbe0b('0x1d')](handleEntityNotFound(_0x4b6fb8,null))[_0xbe0b('0x1d')](function(_0x1aa417){if(_0x1aa417&&_0x1aa417[_0xbe0b('0xc0')]){_0x141091=_0x1aa417[_0xbe0b('0x33')]({'plain':!![]});if(_0x141091[_0xbe0b('0xc0')]&&_0x141091[_0xbe0b('0xc0')][_0xbe0b('0x95')][_0xbe0b('0x44')]){return _0x141091[_0xbe0b('0xc0')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0xbe0b('0x16')](_0x40a1de[_0xbe0b('0x55')],{'firstName':_0x36e221,'mobile':_0x36e221,'phone':_0x36e221,'ListId':_0x141091['ListId']}));}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x4b6fb8,null))[_0xbe0b('0x1d')](function(_0x2d79f4){if(_0x2d79f4){_0x340cc8=_0x2d79f4;return db[_0xbe0b('0x99')]['find']({'where':{'ContactId':_0x340cc8['id'],'closed':![],'SmsAccountId':_0x141091['id']}})['then'](function(_0x2712a1){if(_0x2712a1){return[_0x2712a1,![]];}return db['SmsInteraction'][_0xbe0b('0x54')]({'UserId':_0x40a1de[_0xbe0b('0x56')]['id'],'ContactId':_0x340cc8['id'],'SmsAccountId':_0x141091['id'],'phone':_0x36e221,'firstMsgDirection':_0xbe0b('0xc1'),'Messages':[_[_0xbe0b('0x4b')](_0x40a1de[_0xbe0b('0x55')],{'read':![],'body':_0x40a1de[_0xbe0b('0x55')]['body'],'phone':_0x36e221,'SmsAccountId':_0x141091['id'],'UserId':_0x40a1de[_0xbe0b('0x56')]['id'],'ContactId':_0x340cc8['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})['then'](function(_0x371810){return[_0x371810,!![]];});});}})[_0xbe0b('0x9a')](function(_0x421cd7,_0x38f1d1){if(_0x38f1d1){return _0x421cd7;}return db[_0xbe0b('0xc2')][_0xbe0b('0x54')](_[_0xbe0b('0x4b')](_0x40a1de['body'],{'read':![],'body':_0x40a1de[_0xbe0b('0x55')][_0xbe0b('0x55')],'phone':_0x36e221,'SmsAccountId':_0x141091['id'],'SmsInteractionId':_0x421cd7['id'],'UserId':_0x40a1de[_0xbe0b('0x56')]['id'],'ContactId':_0x340cc8['id']}))[_0xbe0b('0x1d')](function(_0x80bbe2){_0x421cd7[_0xbe0b('0xc3')][_0xbe0b('0xc4')]=[];_0x421cd7[_0xbe0b('0xc3')][_0xbe0b('0xc4')][_0xbe0b('0x9e')](_0x80bbe2['dataValues']);return _0x421cd7;});})[_0xbe0b('0x1d')](respondWithResult(_0x4b6fb8,null))[_0xbe0b('0x27')](handleError(_0x4b6fb8,null));};exports[_0xbe0b('0x29')]=function(_0x2fbf06,_0x5d82ef,_0x3b2269){if(_0x2fbf06[_0xbe0b('0x55')]['id']){delete _0x2fbf06[_0xbe0b('0x55')]['id'];}var _0x1efb60,_0x3f0da4,_0x474ac1;return db[_0xbe0b('0x3b')][_0xbe0b('0x5b')]({'where':{'id':_0x2fbf06[_0xbe0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5d82ef,null))[_0xbe0b('0x1d')](function(_0xf64a2c){if(_0xf64a2c){_0x474ac1=_0xf64a2c;logger['debug'](_0xbe0b('0x21'),_0xbe0b('0x29'),'received\x20delivery\x20report\x20from',_0xf64a2c[_0xbe0b('0x3c')],util['inspect'](_0x2fbf06['body'],{'showHidden':![],'depth':null}));switch(_0xf64a2c['type']){case _0xbe0b('0xc5'):if(_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0xc6')]&&_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0x29')]){_0x3f0da4=_0x2fbf06['body'][_0xbe0b('0x29')];return db[_0xbe0b('0xc2')][_0xbe0b('0x5b')]({'where':{'messageId':_0x2fbf06['body'][_0xbe0b('0xc6')]}});}break;case _0xbe0b('0x7e'):if(_0x2fbf06['body'][_0xbe0b('0xc7')]&&_0x2fbf06['body'][_0xbe0b('0xc8')]){_0x3f0da4=_0x2fbf06['body'][_0xbe0b('0xc8')];return db['SmsMessage'][_0xbe0b('0x5b')]({'where':{'messageId':_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0xc7')]}});}break;case _0xbe0b('0xc9'):if(_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0x7f')]&&_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0xca')]){_0x3f0da4=_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0xca')];return db['SmsMessage'][_0xbe0b('0x5b')]({'where':{'messageId':_0x2fbf06['body']['message_id']}});}break;case _0xbe0b('0xcb'):var _0x15d943=_0x2fbf06['body'][_0xbe0b('0x83')][0x0];if(_0x15d943['messageId']&&_0x15d943[_0xbe0b('0x29')]['groupName']===_0xbe0b('0xcc')){_0x3f0da4=_0x15d943[_0xbe0b('0x29')][_0xbe0b('0xcd')];return db[_0xbe0b('0xc2')][_0xbe0b('0x5b')]({'where':{'messageId':_0x15d943['messageId']}});}break;case'clickatell':if(_0x2fbf06['body'][_0xbe0b('0x7c')]&&_0x2fbf06['body'][_0xbe0b('0x29')]){_0x3f0da4=_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0x29')];return db['SmsMessage']['find']({'where':{'messageId':_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0x7c')]}});}break;case _0xbe0b('0x8a'):if(_0x2fbf06[_0xbe0b('0x55')][0x0]['message']['id']){_0x3f0da4=_0x2fbf06['body'][0x0]['type'];return db[_0xbe0b('0xc2')][_0xbe0b('0x5b')]({'where':{'messageId':_0x2fbf06[_0xbe0b('0x55')][0x0][_0xbe0b('0x25')]['id']}});}break;case _0xbe0b('0x8b'):if(_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0xce')]&&_0x2fbf06['body'][_0xbe0b('0x29')]){_0x3f0da4=_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0x29')];return db[_0xbe0b('0xc2')][_0xbe0b('0x5b')]({'where':{'messageId':_0x2fbf06['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x5d82ef,null))[_0xbe0b('0x1d')](function(_0x2cc93c){if(_0x2cc93c){_0x1efb60=_0x2cc93c;switch(_0x474ac1[_0xbe0b('0x3c')]){case'skebby':if(_0x3f0da4===_0xbe0b('0xcc')){return _0x1efb60['update']({'read':!![]});}else{logger[_0xbe0b('0x23')](_0xbe0b('0x21'),_0xbe0b('0x29'),_0xbe0b('0xc5'),util[_0xbe0b('0xcf')](_0x2fbf06['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3f0da4==='1'){return _0x1efb60[_0xbe0b('0x31')]({'read':!![]});}else{logger[_0xbe0b('0x23')](_0xbe0b('0x21'),'status','skebby',util[_0xbe0b('0xcf')](_0x2fbf06['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0xd0')]&&_0x3f0da4>=0xc8&&_0x3f0da4<=0xce){return _0x1efb60['update']({'read':!![]});}else{logger[_0xbe0b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbe0b('0x29'),_0xbe0b('0xc9'),util[_0xbe0b('0xcf')](_0x2fbf06[_0xbe0b('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x347654=_0x2fbf06[_0xbe0b('0x55')][_0xbe0b('0x83')][0x0];if(_0x347654['status'][_0xbe0b('0xcd')]==='DELIVERED'){return _0x1efb60[_0xbe0b('0x31')]({'read':!![]});}else{logger[_0xbe0b('0x23')](_0xbe0b('0x21'),_0xbe0b('0x29'),_0xbe0b('0xcb'),util[_0xbe0b('0xcf')](_0x2fbf06[_0xbe0b('0x55')],{'showHidden':![],'depth':null}));}break;case _0xbe0b('0x86'):if(_0x3f0da4=='DELIVERED_TO_GATEWAY'||_0x3f0da4==_0xbe0b('0xd1')){return _0x1efb60[_0xbe0b('0x31')]({'read':!![]});}else{logger[_0xbe0b('0x23')](_0xbe0b('0x21'),_0xbe0b('0x29'),'clickatell',util[_0xbe0b('0xcf')](_0x2fbf06[_0xbe0b('0x55')],{'showHidden':![],'depth':null}));}break;case _0xbe0b('0x8a'):if(_0x3f0da4==_0xbe0b('0xd2')){return _0x1efb60[_0xbe0b('0x31')]({'read':!![]});}else{logger[_0xbe0b('0x23')](_0xbe0b('0x21'),_0xbe0b('0x29'),_0xbe0b('0x8a'),util[_0xbe0b('0xcf')](_0x2fbf06[_0xbe0b('0x55')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3f0da4==='DELIVRD'||_0x3f0da4===_0xbe0b('0xd3')){return _0x1efb60[_0xbe0b('0x31')]({'read':!![]});}else{logger[_0xbe0b('0x23')](_0xbe0b('0x21'),_0xbe0b('0x29'),_0xbe0b('0x8b'),util[_0xbe0b('0xcf')](_0x2fbf06[_0xbe0b('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x1efb60;}})['then'](respondWithResult(_0x5d82ef,null))['catch'](handleError(_0x5d82ef,null));};exports[_0xbe0b('0xd4')]=function(_0x234c21,_0x18d166,_0xe3208){var _0x1319e2,_0x548ddc,_0x1c6fe4;return db[_0xbe0b('0x3b')][_0xbe0b('0x5b')]({'where':{'id':_0x234c21[_0xbe0b('0x5c')]['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x18d166,null))[_0xbe0b('0x1d')](function(_0x16a381){if(_0x16a381){_0x1c6fe4=_0x16a381;logger[_0xbe0b('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbe0b('0x29'),_0xbe0b('0xd5'),_0x16a381[_0xbe0b('0x3c')],util['inspect'](_0x234c21[_0xbe0b('0x3f')],{'showHidden':![],'depth':null}));switch(_0x16a381[_0xbe0b('0x3c')]){case _0xbe0b('0x84'):if(_0x234c21['query'][_0xbe0b('0xd6')]&&_0x234c21['query']['state']){_0x548ddc=_0x234c21[_0xbe0b('0x3f')][_0xbe0b('0xd7')];return db['SmsMessage']['find']({'where':{'messageId':_0x234c21[_0xbe0b('0x3f')][_0xbe0b('0xd6')]}});}break;}}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x18d166,null))[_0xbe0b('0x1d')](function(_0x2ecf97){if(_0x2ecf97){_0x1319e2=_0x2ecf97;switch(_0x1c6fe4[_0xbe0b('0x3c')]){case'csc':if(_0x548ddc==='2'||_0x548ddc==='6'){return _0x1319e2['update']({'read':!![]});}else{logger[_0xbe0b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbe0b('0x29'),_0xbe0b('0x84'),util[_0xbe0b('0xcf')](_0x234c21['query'],{'showHidden':![],'depth':null}));};break;}return _0x1319e2;}})[_0xbe0b('0x1d')](respondWithResult(_0x18d166,null))['catch'](handleError(_0x18d166,null));};exports[_0xbe0b('0xd8')]=function(_0xf11b7b,_0x3ec05b,_0x4db7ce){return db[_0xbe0b('0x3b')]['find']({'where':{'id':_0xf11b7b['params']['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x3ec05b,null))[_0xbe0b('0x1d')](function(_0x499cc9){if(_0x499cc9){return _0x499cc9[_0xbe0b('0xd8')](_0xf11b7b['body'][_0xbe0b('0xd9')],_[_0xbe0b('0x98')](_0xf11b7b[_0xbe0b('0x55')],[_0xbe0b('0xd9'),'id'])||{})[_0xbe0b('0x9a')](function(_0x1490ab){for(var _0x18a1fc=0x0;_0x18a1fc<_0xf11b7b['body'][_0xbe0b('0xd9')]['length'];_0x18a1fc+=0x1){socket[_0xbe0b('0xda')](_0xbe0b('0xdb'),{'UserId':Number(_0xf11b7b['body'][_0xbe0b('0xd9')][_0x18a1fc]),'SmsAccountId':Number(_0xf11b7b[_0xbe0b('0x5c')]['id'])});}return _0x1490ab;});}})['then'](respondWithResult(_0x3ec05b,null))['catch'](handleError(_0x3ec05b,null));};exports['removeAgents']=function(_0x5b0371,_0x5693be,_0x3e496f){return db[_0xbe0b('0x3b')][_0xbe0b('0x5b')]({'where':{'id':_0x5b0371[_0xbe0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5693be,null))[_0xbe0b('0x1d')](function(_0x842023){if(_0x842023){return _0x842023['removeAgents'](_0x5b0371[_0xbe0b('0x3f')][_0xbe0b('0xd9')])[_0xbe0b('0x1d')](function(){if(_['isArray'](_0x5b0371[_0xbe0b('0x3f')][_0xbe0b('0xd9')])){for(var _0x351100=0x0;_0x351100<_0x5b0371[_0xbe0b('0x3f')]['ids']['length'];_0x351100+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x5b0371[_0xbe0b('0x3f')]['ids'][_0x351100]),'SmsAccountId':Number(_0x5b0371[_0xbe0b('0x5c')]['id'])});}}else{socket['emit'](_0xbe0b('0xdc'),{'UserId':Number(_0x5b0371[_0xbe0b('0x3f')]['ids']),'SmsAccountId':Number(_0x5b0371['params']['id'])});}});}})[_0xbe0b('0x1d')](respondWithStatusCode(_0x5693be,null))[_0xbe0b('0x27')](handleError(_0x5693be,null));};exports[_0xbe0b('0xdd')]=function(_0x45ffd4,_0x55681d,_0x1f8c1e){var _0x4f01d6={};var _0x18405e={};var _0x42fd47;var _0x4a72c4;return db[_0xbe0b('0x3b')]['findOne']({'where':{'id':_0x45ffd4[_0xbe0b('0x5c')]['id']}})[_0xbe0b('0x1d')](handleEntityNotFound(_0x55681d,null))[_0xbe0b('0x1d')](function(_0x2c0755){if(_0x2c0755){_0x42fd47=_0x2c0755;_0x18405e[_0xbe0b('0x3e')]=_['keys'](db[_0xbe0b('0xa5')][_0xbe0b('0x52')]);_0x18405e[_0xbe0b('0x3f')]=_[_0xbe0b('0x51')](_0x45ffd4[_0xbe0b('0x3f')]);_0x18405e[_0xbe0b('0x40')]=_['intersection'](_0x18405e[_0xbe0b('0x3e')],_0x18405e[_0xbe0b('0x3f')]);_0x4f01d6[_0xbe0b('0x43')]=_[_0xbe0b('0x41')](_0x18405e[_0xbe0b('0x3e')],qs[_0xbe0b('0x42')](_0x45ffd4['query'][_0xbe0b('0x42')]));_0x4f01d6[_0xbe0b('0x43')]=_0x4f01d6['attributes']['length']?_0x4f01d6[_0xbe0b('0x43')]:_0x18405e[_0xbe0b('0x3e')];_0x4f01d6[_0xbe0b('0x46')]=qs[_0xbe0b('0x47')](_0x45ffd4[_0xbe0b('0x3f')][_0xbe0b('0x47')]);_0x4f01d6[_0xbe0b('0x48')]=qs[_0xbe0b('0x40')](_[_0xbe0b('0x68')](_0x45ffd4[_0xbe0b('0x3f')],_0x18405e[_0xbe0b('0x40')]));if(_0x45ffd4[_0xbe0b('0x3f')][_0xbe0b('0x49')]){_0x4f01d6[_0xbe0b('0x48')]=_['merge'](_0x4f01d6[_0xbe0b('0x48')],{'$or':_[_0xbe0b('0x3a')](_0x4f01d6[_0xbe0b('0x43')],function(_0x2102c4){var _0x758903={};_0x758903[_0x2102c4]={'$like':'%'+_0x45ffd4[_0xbe0b('0x3f')]['filter']+'%'};return _0x758903;})});}_0x4f01d6=_[_0xbe0b('0x4b')]({},_0x4f01d6,_0x45ffd4[_0xbe0b('0x4c')]);return _0x42fd47[_0xbe0b('0xdd')](_0x4f01d6);}})['then'](function(_0x23aaff){if(_0x23aaff){_0x4a72c4=_0x23aaff['length'];if(!_0x45ffd4[_0xbe0b('0x3f')][_0xbe0b('0x45')](_0xbe0b('0x61'))){_0x4f01d6['limit']=qs[_0xbe0b('0x2d')](_0x45ffd4[_0xbe0b('0x3f')][_0xbe0b('0x2d')]);_0x4f01d6[_0xbe0b('0x2c')]=qs[_0xbe0b('0x2c')](_0x45ffd4['query'][_0xbe0b('0x2c')]);}return _0x42fd47[_0xbe0b('0xdd')](_0x4f01d6);}})[_0xbe0b('0x1d')](function(_0x5e0c25){if(_0x5e0c25){return _0x5e0c25?{'count':_0x4a72c4,'rows':_0x5e0c25}:null;}})[_0xbe0b('0x1d')](respondWithResult(_0x55681d,null))['catch'](handleError(_0x55681d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index bf53032..16b4df2 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 _0x6815=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x32bb1b,_0x45a802){var _0x55c1b2=function(_0x2e1641){while(--_0x2e1641){_0x32bb1b['push'](_0x32bb1b['shift']());}};_0x55c1b2(++_0x45a802);}(_0x6815,0xa4));var _0x5681=function(_0x387624,_0x457548){_0x387624=_0x387624-0x0;var _0x5ac7ff=_0x6815[_0x387624];return _0x5ac7ff;};'use strict';var EventEmitter=require(_0x5681('0x0'));var SmsAccount=require(_0x5681('0x1'))['db'][_0x5681('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5681('0x3')](0x0);var events={'afterCreate':_0x5681('0x4'),'afterUpdate':_0x5681('0x5'),'afterDestroy':_0x5681('0x6')};function emitEvent(_0x25fa10){return function(_0x36d837,_0x21017d,_0x4de309){SmsAccountEvents[_0x5681('0x7')](_0x25fa10+':'+_0x36d837['id'],_0x36d837);SmsAccountEvents['emit'](_0x25fa10,_0x36d837);_0x4de309(null);};}for(var e in events){if(events[_0x5681('0x8')](e)){var event=events[e];SmsAccount[_0x5681('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x8536=['SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8536,0x81));var _0x6853=function(_0x2e2dbc,_0xefd3f3){_0x2e2dbc=_0x2e2dbc-0x0;var _0x3d325e=_0x8536[_0x2e2dbc];return _0x3d325e;};'use strict';var EventEmitter=require(_0x6853('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x6853('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6853('0x2')](0x0);var events={'afterCreate':_0x6853('0x3'),'afterUpdate':_0x6853('0x4'),'afterDestroy':_0x6853('0x5')};function emitEvent(_0x272d43){return function(_0x28895c,_0x3f1a2d,_0x470c9d){SmsAccountEvents['emit'](_0x272d43+':'+_0x28895c['id'],_0x28895c);SmsAccountEvents[_0x6853('0x6')](_0x272d43,_0x28895c);_0x470c9d(null);};}for(var e in events){if(events[_0x6853('0x7')](e)){var event=events[e];SmsAccount[_0x6853('0x8')](e,emitEvent(event));}}module[_0x6853('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 13ede0e..4abedd1 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 _0x8925=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','SmsAccount','sms_accounts','lodash'];(function(_0x33ecb2,_0x132238){var _0x1d19fe=function(_0x3152c6){while(--_0x3152c6){_0x33ecb2['push'](_0x33ecb2['shift']());}};_0x1d19fe(++_0x132238);}(_0x8925,0x154));var _0x5892=function(_0x2e1058,_0x535e8c){_0x2e1058=_0x2e1058-0x0;var _0x3b9d5b=_0x8925[_0x2e1058];return _0x3b9d5b;};'use strict';var _=require(_0x5892('0x0'));var util=require(_0x5892('0x1'));var logger=require(_0x5892('0x2'))('api');var moment=require(_0x5892('0x3'));var BPromise=require(_0x5892('0x4'));var rp=require(_0x5892('0x5'));var fs=require('fs');var path=require(_0x5892('0x6'));var rimraf=require(_0x5892('0x7'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x5892('0x8')]=function(_0x2d2578,_0x1b0636){return _0x2d2578['define'](_0x5892('0x9'),attributes,{'tableName':_0x5892('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25a1=['SmsAccount','sms_accounts','util','../../config/logger','api','moment','bluebird','../../config/environment','./smsAccount.attributes','exports'];(function(_0x258926,_0x5c185a){var _0x21d5dd=function(_0x1fa92d){while(--_0x1fa92d){_0x258926['push'](_0x258926['shift']());}};_0x21d5dd(++_0x5c185a);}(_0x25a1,0x160));var _0x125a=function(_0x158a04,_0x5767bf){_0x158a04=_0x158a04-0x0;var _0x4d2653=_0x25a1[_0x158a04];return _0x4d2653;};'use strict';var _=require('lodash');var util=require(_0x125a('0x0'));var logger=require(_0x125a('0x1'))(_0x125a('0x2'));var moment=require(_0x125a('0x3'));var BPromise=require(_0x125a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x125a('0x5'));var attributes=require(_0x125a('0x6'));module[_0x125a('0x7')]=function(_0x59707b,_0x290820){return _0x59707b['define'](_0x125a('0x8'),attributes,{'tableName':_0x125a('0x9'),'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 7e42378..99c0fdd 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 _0x4c62=['socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsAccount','find','options','raw','where','attributes','include','model','map','ShowSmsAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','defaults','redis','localhost'];(function(_0x223bdb,_0x5882e6){var _0xef8e68=function(_0x55ab83){while(--_0x55ab83){_0x223bdb['push'](_0x223bdb['shift']());}};_0xef8e68(++_0x5882e6);}(_0x4c62,0xdd));var _0x24c6=function(_0x33619e,_0x1e9993){_0x33619e=_0x33619e-0x0;var _0x123625=_0x4c62[_0x33619e];return _0x123625;};'use strict';var _=require('lodash');var util=require(_0x24c6('0x0'));var moment=require(_0x24c6('0x1'));var BPromise=require(_0x24c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24c6('0x3'));var db=require(_0x24c6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x24c6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x24c6('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x24c6('0x7')](config[_0x24c6('0x8')],{'host':_0x24c6('0x9'),'port':0x18eb});var socket=require(_0x24c6('0xa'))(new Redis(config[_0x24c6('0x8')]));require(_0x24c6('0xb'))[_0x24c6('0xc')](socket);function respondWithRpcPromise(_0x59f530,_0xf95c7a,_0x5b11c4){return new BPromise(function(_0x4b40d2,_0xd144da){return client['request'](_0x59f530,_0x5b11c4)[_0x24c6('0xd')](function(_0x2eb442){logger[_0x24c6('0xe')](_0x24c6('0xf'),_0xf95c7a,_0x24c6('0x10'));logger[_0x24c6('0x11')](_0x24c6('0x12'),_0xf95c7a,_0x24c6('0x10'),JSON[_0x24c6('0x13')](_0x2eb442));if(_0x2eb442['error']){if(_0x2eb442['error']['code']===0x1f4){logger[_0x24c6('0x14')](_0x24c6('0xf'),_0xf95c7a,_0x2eb442['error'][_0x24c6('0x15')]);return _0xd144da(_0x2eb442[_0x24c6('0x14')]['message']);}logger[_0x24c6('0x14')](_0x24c6('0xf'),_0xf95c7a,_0x2eb442[_0x24c6('0x14')][_0x24c6('0x15')]);return _0x4b40d2(_0x2eb442[_0x24c6('0x14')][_0x24c6('0x15')]);}else{logger[_0x24c6('0xe')](_0x24c6('0xf'),_0xf95c7a,_0x24c6('0x10'));_0x4b40d2(_0x2eb442[_0x24c6('0x16')][_0x24c6('0x15')]);}})['catch'](function(_0x4ba846){logger[_0x24c6('0x14')](_0x24c6('0xf'),_0xf95c7a,_0x4ba846);_0xd144da(_0x4ba846);});});}exports['ShowSmsAccount']=function(_0xe410dc){var _0x45effe=this;return new Promise(function(_0x970c7b,_0x4795d5){return db[_0x24c6('0x17')][_0x24c6('0x18')]({'raw':_0xe410dc[_0x24c6('0x19')]?_0xe410dc['options'][_0x24c6('0x1a')]===undefined?!![]:![]:!![],'where':_0xe410dc[_0x24c6('0x19')]?_0xe410dc[_0x24c6('0x19')][_0x24c6('0x1b')]||null:null,'attributes':_0xe410dc[_0x24c6('0x19')]?_0xe410dc[_0x24c6('0x19')][_0x24c6('0x1c')]||null:null,'include':_0xe410dc[_0x24c6('0x19')]?_0xe410dc[_0x24c6('0x19')]['include']?_['map'](_0xe410dc['options'][_0x24c6('0x1d')],function(_0x128895){return{'model':db[_0x128895[_0x24c6('0x1e')]],'as':_0x128895['as'],'attributes':_0x128895[_0x24c6('0x1c')],'include':_0x128895[_0x24c6('0x1d')]?_[_0x24c6('0x1f')](_0x128895[_0x24c6('0x1d')],function(_0x4c7949){return{'model':db[_0x4c7949[_0x24c6('0x1e')]],'as':_0x4c7949['as'],'attributes':_0x4c7949[_0x24c6('0x1c')],'include':_0x4c7949[_0x24c6('0x1d')]?_[_0x24c6('0x1f')](_0x4c7949['include'],function(_0x3855b2){return{'model':db[_0x3855b2[_0x24c6('0x1e')]],'as':_0x3855b2['as'],'attributes':_0x3855b2[_0x24c6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x24c6('0xd')](function(_0x14cc1b){logger[_0x24c6('0xe')](_0x24c6('0x20'),_0xe410dc);logger[_0x24c6('0x11')](_0x24c6('0x20'),_0xe410dc,JSON[_0x24c6('0x13')](_0x14cc1b));_0x970c7b(_0x14cc1b);})['catch'](function(_0x2daeb4){logger[_0x24c6('0x14')]('ShowSmsAccount',_0x2daeb4['message'],_0xe410dc);_0x4795d5(_0x45effe['error'](0x1f4,_0x2daeb4['message']));});});}; \ No newline at end of file +var _0xfba8=['request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','map','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0xfba8,0xcc));var _0x8fba=function(_0x2be4d5,_0x191f8a){_0x2be4d5=_0x2be4d5-0x0;var _0xe6dab8=_0xfba8[_0x2be4d5];return _0xe6dab8;};'use strict';var _=require('lodash');var util=require(_0x8fba('0x0'));var moment=require(_0x8fba('0x1'));var BPromise=require(_0x8fba('0x2'));var rs=require(_0x8fba('0x3'));var fs=require('fs');var Redis=require(_0x8fba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fba('0x5'));var logger=require(_0x8fba('0x6'))('rpc');var config=require(_0x8fba('0x7'));var jayson=require(_0x8fba('0x8'));var client=jayson[_0x8fba('0x9')][_0x8fba('0xa')]({'port':0x232a});config[_0x8fba('0xb')]=_['defaults'](config[_0x8fba('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8fba('0xc'))[_0x8fba('0xd')](socket);function respondWithRpcPromise(_0x53edf3,_0x2677c3,_0x1ac178){return new BPromise(function(_0x42c68b,_0x1905b7){return client[_0x8fba('0xe')](_0x53edf3,_0x1ac178)[_0x8fba('0xf')](function(_0x140f50){logger[_0x8fba('0x10')](_0x8fba('0x11'),_0x2677c3,_0x8fba('0x12'));logger[_0x8fba('0x13')](_0x8fba('0x14'),_0x2677c3,_0x8fba('0x12'),JSON[_0x8fba('0x15')](_0x140f50));if(_0x140f50[_0x8fba('0x16')]){if(_0x140f50['error'][_0x8fba('0x17')]===0x1f4){logger[_0x8fba('0x16')](_0x8fba('0x11'),_0x2677c3,_0x140f50[_0x8fba('0x16')]['message']);return _0x1905b7(_0x140f50['error'][_0x8fba('0x18')]);}logger[_0x8fba('0x16')]('SmsAccount,\x20%s,\x20%s',_0x2677c3,_0x140f50['error'][_0x8fba('0x18')]);return _0x42c68b(_0x140f50[_0x8fba('0x16')][_0x8fba('0x18')]);}else{logger[_0x8fba('0x10')](_0x8fba('0x11'),_0x2677c3,'request\x20sent');_0x42c68b(_0x140f50[_0x8fba('0x19')][_0x8fba('0x18')]);}})[_0x8fba('0x1a')](function(_0x3bdfaf){logger[_0x8fba('0x16')](_0x8fba('0x11'),_0x2677c3,_0x3bdfaf);_0x1905b7(_0x3bdfaf);});});}exports[_0x8fba('0x1b')]=function(_0x149355){var _0x36e87d=this;return new Promise(function(_0x1fe4d9,_0x3c06f6){return db[_0x8fba('0x1c')][_0x8fba('0x1d')]({'raw':_0x149355[_0x8fba('0x1e')]?_0x149355['options'][_0x8fba('0x1f')]===undefined?!![]:![]:!![],'where':_0x149355['options']?_0x149355[_0x8fba('0x1e')][_0x8fba('0x20')]||null:null,'attributes':_0x149355[_0x8fba('0x1e')]?_0x149355[_0x8fba('0x1e')][_0x8fba('0x21')]||null:null,'include':_0x149355[_0x8fba('0x1e')]?_0x149355[_0x8fba('0x1e')][_0x8fba('0x22')]?_['map'](_0x149355[_0x8fba('0x1e')][_0x8fba('0x22')],function(_0x1045a2){return{'model':db[_0x1045a2[_0x8fba('0x23')]],'as':_0x1045a2['as'],'attributes':_0x1045a2['attributes'],'include':_0x1045a2[_0x8fba('0x22')]?_['map'](_0x1045a2[_0x8fba('0x22')],function(_0x562a4b){return{'model':db[_0x562a4b[_0x8fba('0x23')]],'as':_0x562a4b['as'],'attributes':_0x562a4b[_0x8fba('0x21')],'include':_0x562a4b[_0x8fba('0x22')]?_[_0x8fba('0x24')](_0x562a4b['include'],function(_0x311de5){return{'model':db[_0x311de5[_0x8fba('0x23')]],'as':_0x311de5['as'],'attributes':_0x311de5[_0x8fba('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8fba('0xf')](function(_0x5ab3b3){logger[_0x8fba('0x10')](_0x8fba('0x1b'),_0x149355);logger[_0x8fba('0x13')](_0x8fba('0x1b'),_0x149355,JSON[_0x8fba('0x15')](_0x5ab3b3));_0x1fe4d9(_0x5ab3b3);})[_0x8fba('0x1a')](function(_0x1c7fa5){logger[_0x8fba('0x16')]('ShowSmsAccount',_0x1c7fa5[_0x8fba('0x18')],_0x149355);_0x3c06f6(_0x36e87d[_0x8fba('0x16')](0x1f4,_0x1c7fa5['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 34cbf20..bc4258e 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_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 +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 b891025..c0c7c48 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x3022dd,_0x470d35){var _0x28647a=function(_0xff47be){while(--_0xff47be){_0x3022dd['push'](_0x3022dd['shift']());}};_0x28647a(++_0x470d35);}(_0x3e74,0x175));var _0x43e7=function(_0x56809f,_0x40a233){_0x56809f=_0x56809f-0x0;var _0x4f2f53=_0x3e74[_0x56809f];return _0x4f2f53;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5d6bef,_0xd146bc){var _0x55d676=function(_0x49e7d6){while(--_0x49e7d6){_0x5d6bef['push'](_0x5d6bef['shift']());}};_0x55d676(++_0xd146bc);}(_0xedd9,0xfc));var _0x9edd=function(_0x90139a,_0x3dd1f3){_0x90139a=_0x90139a-0x0;var _0x3bcb25=_0xedd9[_0x90139a];return _0x3bcb25;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 531ebdc..f523aae 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 _0x9036=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x2a28d7,_0x1d3b2b){var _0x18c81b=function(_0x4ab4ee){while(--_0x4ab4ee){_0x2a28d7['push'](_0x2a28d7['shift']());}};_0x18c81b(++_0x1d3b2b);}(_0x9036,0x1ea));var _0x6903=function(_0x47f122,_0x215017){_0x47f122=_0x47f122-0x0;var _0x2a0054=_0x9036[_0x47f122];return _0x2a0054;};'use strict';var Sequelize=require('sequelize');module[_0x6903('0x0')]={'priority':{'type':Sequelize[_0x6903('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6903('0x2')],'allowNull':![],'defaultValue':_0x6903('0x3')},'appdata':{'type':Sequelize[_0x6903('0x4')]()},'description':{'type':Sequelize[_0x6903('0x2')]},'interval':{'type':Sequelize[_0x6903('0x2')],'defaultValue':_0x6903('0x5')}}; \ No newline at end of file +var _0x24b9=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x1d2632,_0x4c90f8){var _0x144c48=function(_0x45f90a){while(--_0x45f90a){_0x1d2632['push'](_0x1d2632['shift']());}};_0x144c48(++_0x4c90f8);}(_0x24b9,0xa8));var _0x924b=function(_0x5840cb,_0x29a105){_0x5840cb=_0x5840cb-0x0;var _0x450ef9=_0x24b9[_0x5840cb];return _0x450ef9;};'use strict';var Sequelize=require(_0x924b('0x0'));module[_0x924b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x924b('0x2')],'allowNull':![],'defaultValue':_0x924b('0x3')},'appdata':{'type':Sequelize[_0x924b('0x4')]()},'description':{'type':Sequelize[_0x924b('0x2')]},'interval':{'type':Sequelize[_0x924b('0x2')],'defaultValue':_0x924b('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 09ca954..3143663 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 _0xa089=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','rimraf','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model'];(function(_0x41487e,_0x17b795){var _0x396d53=function(_0x3f7a72){while(--_0x3f7a72){_0x41487e['push'](_0x41487e['shift']());}};_0x396d53(++_0x17b795);}(_0xa089,0x12c));var _0x9a08=function(_0x57ca97,_0xd0f6f8){_0x57ca97=_0x57ca97-0x0;var _0x4d38f8=_0xa089[_0x57ca97];return _0x4d38f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a08('0x0'));var zipdir=require(_0x9a08('0x1'));var jsonpatch=require(_0x9a08('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9a08('0x3'));var path=require(_0x9a08('0x4'));var sox=require('sox');var csv=require(_0x9a08('0x5'));var ejs=require(_0x9a08('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a08('0x7'));var squel=require(_0x9a08('0x8'));var crypto=require(_0x9a08('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9a08('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9a08('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9a08('0xc'));var qs=require(_0x9a08('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a08('0xe'));var logger=require(_0x9a08('0xf'))('api');var utils=require(_0x9a08('0x10'));var config=require(_0x9a08('0x11'));var licenseUtil=require(_0x9a08('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbf7b53,_0x5ef341){_0x5ef341=_0x5ef341||0xcc;return function(_0x4793b6){if(_0x4793b6){return _0xbf7b53[_0x9a08('0x13')](_0x5ef341);}return _0xbf7b53[_0x9a08('0x14')](_0x5ef341)['end']();};}function respondWithResult(_0x3f06de,_0x26c108){_0x26c108=_0x26c108||0xc8;return function(_0x134e80){if(_0x134e80){return _0x3f06de[_0x9a08('0x14')](_0x26c108)['json'](_0x134e80);}};}function respondWithFilteredResult(_0x301e93,_0x183475){return function(_0x388b90){if(_0x388b90){var _0x41f8d6=typeof _0x183475[_0x9a08('0x15')]==='undefined'&&typeof _0x183475[_0x9a08('0x16')]===_0x9a08('0x17');var _0x122702=_0x388b90[_0x9a08('0x18')];var _0x170c84=_0x41f8d6?0x0:_0x183475[_0x9a08('0x15')];var _0x31cc30=_0x41f8d6?_0x388b90['count']:_0x183475[_0x9a08('0x15')]+_0x183475['limit'];var _0x41a803;if(_0x31cc30>=_0x122702){_0x31cc30=_0x122702;_0x41a803=0xc8;}else{_0x41a803=0xce;}_0x301e93['status'](_0x41a803);return _0x301e93[_0x9a08('0x19')](_0x9a08('0x1a'),_0x170c84+'-'+_0x31cc30+'/'+_0x122702)[_0x9a08('0x1b')](_0x388b90);}return null;};}function patchUpdates(_0x30675c){return function(_0x4fabc5){try{jsonpatch[_0x9a08('0x1c')](_0x4fabc5,_0x30675c,!![]);}catch(_0x3ee5a6){return BPromise[_0x9a08('0x1d')](_0x3ee5a6);}return _0x4fabc5['save']();};}function saveUpdates(_0x5ad999,_0x2aab56){return function(_0x5a1941){if(_0x5a1941){return _0x5a1941['update'](_0x5ad999)[_0x9a08('0x1e')](function(_0x5c76cd){return _0x5c76cd;});}return null;};}function removeEntity(_0x46f032,_0x18673f){return function(_0x4e13b4){if(_0x4e13b4){return _0x4e13b4[_0x9a08('0x1f')]()['then'](function(){_0x46f032[_0x9a08('0x14')](0xcc)[_0x9a08('0x20')]();});}};}function handleEntityNotFound(_0x2b86ee,_0x4dbd8a){return function(_0x29ad70){if(!_0x29ad70){_0x2b86ee[_0x9a08('0x13')](0x194);}return _0x29ad70;};}function handleError(_0x366967,_0x243521){_0x243521=_0x243521||0x1f4;return function(_0x543c0b){logger[_0x9a08('0x21')](_0x543c0b[_0x9a08('0x22')]);if(_0x543c0b['name']){delete _0x543c0b[_0x9a08('0x23')];}_0x366967[_0x9a08('0x14')](_0x243521)[_0x9a08('0x24')](_0x543c0b);};}exports[_0x9a08('0x25')]=function(_0x549bb6,_0x5c84c4){var _0xbfa962={},_0x283501={},_0x1a9479={'count':0x0,'rows':[]};var _0x156d43=_[_0x9a08('0x26')](db[_0x9a08('0x27')][_0x9a08('0x28')],function(_0x3df24e){return{'name':_0x3df24e[_0x9a08('0x29')],'type':_0x3df24e[_0x9a08('0x2a')][_0x9a08('0x2b')]};});_0x283501[_0x9a08('0x2c')]=_[_0x9a08('0x26')](_0x156d43,'name');_0x283501[_0x9a08('0x2d')]=_[_0x9a08('0x2e')](_0x549bb6['query']);_0x283501[_0x9a08('0x2f')]=_[_0x9a08('0x30')](_0x283501[_0x9a08('0x2c')],_0x283501[_0x9a08('0x2d')]);_0xbfa962[_0x9a08('0x31')]=_['intersection'](_0x283501['model'],qs[_0x9a08('0x32')](_0x549bb6[_0x9a08('0x2d')][_0x9a08('0x32')]));_0xbfa962[_0x9a08('0x31')]=_0xbfa962[_0x9a08('0x31')]['length']?_0xbfa962[_0x9a08('0x31')]:_0x283501[_0x9a08('0x2c')];if(!_0x549bb6[_0x9a08('0x2d')][_0x9a08('0x33')]('nolimit')){_0xbfa962[_0x9a08('0x16')]=qs[_0x9a08('0x16')](_0x549bb6['query'][_0x9a08('0x16')]);_0xbfa962[_0x9a08('0x15')]=qs[_0x9a08('0x15')](_0x549bb6[_0x9a08('0x2d')][_0x9a08('0x15')]);}_0xbfa962[_0x9a08('0x34')]=qs[_0x9a08('0x35')](_0x549bb6[_0x9a08('0x2d')][_0x9a08('0x35')]);_0xbfa962[_0x9a08('0x36')]=qs['filters'](_[_0x9a08('0x37')](_0x549bb6['query'],_0x283501[_0x9a08('0x2f')]),_0x156d43);if(_0x549bb6[_0x9a08('0x2d')][_0x9a08('0x38')]){_0xbfa962[_0x9a08('0x36')]=_[_0x9a08('0x39')](_0xbfa962[_0x9a08('0x36')],{'$or':_[_0x9a08('0x26')](_0x156d43,function(_0x56ff44){if(_0x56ff44['type']!==_0x9a08('0x3a')){var _0x4a8d21={};_0x4a8d21[_0x56ff44[_0x9a08('0x23')]]={'$like':'%'+_0x549bb6[_0x9a08('0x2d')][_0x9a08('0x38')]+'%'};return _0x4a8d21;}})});}_0xbfa962=_['merge']({},_0xbfa962,_0x549bb6[_0x9a08('0x3b')]);var _0x5b6bc0={'where':_0xbfa962[_0x9a08('0x36')]};return db[_0x9a08('0x27')][_0x9a08('0x18')](_0x5b6bc0)[_0x9a08('0x1e')](function(_0x22ed2f){_0x1a9479[_0x9a08('0x18')]=_0x22ed2f;if(_0x549bb6[_0x9a08('0x2d')][_0x9a08('0x3c')]){_0xbfa962['include']=[{'all':!![]}];}return db['SmsApplication'][_0x9a08('0x3d')](_0xbfa962);})[_0x9a08('0x1e')](function(_0x3ccc1b){_0x1a9479[_0x9a08('0x3e')]=_0x3ccc1b;return _0x1a9479;})[_0x9a08('0x1e')](respondWithFilteredResult(_0x5c84c4,_0xbfa962))[_0x9a08('0x3f')](handleError(_0x5c84c4,null));};exports['show']=function(_0x1f9578,_0x59d226){var _0x33aa22={'raw':!![],'where':{'id':_0x1f9578[_0x9a08('0x40')]['id']}},_0x4d5e6a={};_0x4d5e6a[_0x9a08('0x2c')]=_[_0x9a08('0x2e')](db['SmsApplication'][_0x9a08('0x28')]);_0x4d5e6a['query']=_['keys'](_0x1f9578[_0x9a08('0x2d')]);_0x4d5e6a[_0x9a08('0x2f')]=_[_0x9a08('0x30')](_0x4d5e6a[_0x9a08('0x2c')],_0x4d5e6a[_0x9a08('0x2d')]);_0x33aa22[_0x9a08('0x31')]=_[_0x9a08('0x30')](_0x4d5e6a[_0x9a08('0x2c')],qs['fields'](_0x1f9578[_0x9a08('0x2d')][_0x9a08('0x32')]));_0x33aa22[_0x9a08('0x31')]=_0x33aa22[_0x9a08('0x31')]['length']?_0x33aa22['attributes']:_0x4d5e6a['model'];if(_0x1f9578[_0x9a08('0x2d')][_0x9a08('0x3c')]){_0x33aa22[_0x9a08('0x41')]=[{'all':!![]}];}_0x33aa22=_['merge']({},_0x33aa22,_0x1f9578['options']);return db[_0x9a08('0x27')][_0x9a08('0x42')](_0x33aa22)['then'](handleEntityNotFound(_0x59d226,null))[_0x9a08('0x1e')](respondWithResult(_0x59d226,null))[_0x9a08('0x3f')](handleError(_0x59d226,null));};exports[_0x9a08('0x43')]=function(_0x11acf3,_0x3ddbad){return db[_0x9a08('0x27')][_0x9a08('0x43')](_0x11acf3[_0x9a08('0x44')],{})[_0x9a08('0x1e')](respondWithResult(_0x3ddbad,0xc9))['catch'](handleError(_0x3ddbad,null));};exports['update']=function(_0x2ec137,_0xd7acbb){if(_0x2ec137[_0x9a08('0x44')]['id']){delete _0x2ec137[_0x9a08('0x44')]['id'];}return db[_0x9a08('0x27')][_0x9a08('0x42')]({'where':{'id':_0x2ec137['params']['id']}})[_0x9a08('0x1e')](handleEntityNotFound(_0xd7acbb,null))['then'](saveUpdates(_0x2ec137[_0x9a08('0x44')],null))['then'](respondWithResult(_0xd7acbb,null))[_0x9a08('0x3f')](handleError(_0xd7acbb,null));};exports[_0x9a08('0x1f')]=function(_0x3e5b0c,_0x40418b){return db[_0x9a08('0x27')][_0x9a08('0x42')]({'where':{'id':_0x3e5b0c['params']['id']}})[_0x9a08('0x1e')](handleEntityNotFound(_0x40418b,null))[_0x9a08('0x1e')](removeEntity(_0x40418b,null))[_0x9a08('0x3f')](handleError(_0x40418b,null));}; \ No newline at end of file +var _0x807f=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','send','map','SmsApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','name','includeAll','include','findAll','rows','catch','show','params','fields','create','update','body','find'];(function(_0x3f75e3,_0x57014d){var _0x4b6cfc=function(_0x1a81a0){while(--_0x1a81a0){_0x3f75e3['push'](_0x3f75e3['shift']());}};_0x4b6cfc(++_0x57014d);}(_0x807f,0x19e));var _0xf807=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x807f[_0x5d7227];return _0x15ac55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf807('0x0'));var zipdir=require(_0xf807('0x1'));var jsonpatch=require(_0xf807('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf807('0x3'));var Mustache=require(_0xf807('0x4'));var util=require(_0xf807('0x5'));var path=require(_0xf807('0x6'));var sox=require(_0xf807('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf807('0x8'));var _=require(_0xf807('0x9'));var squel=require(_0xf807('0xa'));var crypto=require('crypto');var jsforce=require(_0xf807('0xb'));var deskjs=require(_0xf807('0xc'));var toCsv=require(_0xf807('0xd'));var querystring=require(_0xf807('0xe'));var Papa=require(_0xf807('0xf'));var Redis=require(_0xf807('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf807('0x11'))(_0xf807('0x12'));var utils=require(_0xf807('0x13'));var config=require(_0xf807('0x14'));var licenseUtil=require(_0xf807('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2005ee,_0x292b5f){_0x292b5f=_0x292b5f||0xcc;return function(_0x1079d8){if(_0x1079d8){return _0x2005ee[_0xf807('0x16')](_0x292b5f);}return _0x2005ee[_0xf807('0x17')](_0x292b5f)[_0xf807('0x18')]();};}function respondWithResult(_0x2b4cad,_0x103dc){_0x103dc=_0x103dc||0xc8;return function(_0x2800b8){if(_0x2800b8){return _0x2b4cad['status'](_0x103dc)[_0xf807('0x19')](_0x2800b8);}};}function respondWithFilteredResult(_0x5a1c15,_0x4dd614){return function(_0x3de012){if(_0x3de012){var _0x59bb78=typeof _0x4dd614[_0xf807('0x1a')]===_0xf807('0x1b')&&typeof _0x4dd614[_0xf807('0x1c')]===_0xf807('0x1b');var _0x84d3d=_0x3de012[_0xf807('0x1d')];var _0x3ba846=_0x59bb78?0x0:_0x4dd614[_0xf807('0x1a')];var _0x355185=_0x59bb78?_0x3de012[_0xf807('0x1d')]:_0x4dd614['offset']+_0x4dd614[_0xf807('0x1c')];var _0x2b84f9;if(_0x355185>=_0x84d3d){_0x355185=_0x84d3d;_0x2b84f9=0xc8;}else{_0x2b84f9=0xce;}_0x5a1c15[_0xf807('0x17')](_0x2b84f9);return _0x5a1c15[_0xf807('0x1e')](_0xf807('0x1f'),_0x3ba846+'-'+_0x355185+'/'+_0x84d3d)[_0xf807('0x19')](_0x3de012);}return null;};}function patchUpdates(_0x3a938e){return function(_0x91f1f9){try{jsonpatch[_0xf807('0x20')](_0x91f1f9,_0x3a938e,!![]);}catch(_0x472629){return BPromise['reject'](_0x472629);}return _0x91f1f9[_0xf807('0x21')]();};}function saveUpdates(_0x21a2e2,_0x4fc74c){return function(_0x1e4414){if(_0x1e4414){return _0x1e4414['update'](_0x21a2e2)[_0xf807('0x22')](function(_0x4ff54c){return _0x4ff54c;});}return null;};}function removeEntity(_0x5624be,_0x525c5d){return function(_0x5461f4){if(_0x5461f4){return _0x5461f4['destroy']()['then'](function(){_0x5624be[_0xf807('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x533ac0,_0x38dbf0){return function(_0x14e169){if(!_0x14e169){_0x533ac0[_0xf807('0x16')](0x194);}return _0x14e169;};}function handleError(_0xd52cd7,_0x5d10be){_0x5d10be=_0x5d10be||0x1f4;return function(_0x55c3f8){logger['error'](_0x55c3f8['stack']);if(_0x55c3f8['name']){delete _0x55c3f8['name'];}_0xd52cd7[_0xf807('0x17')](_0x5d10be)[_0xf807('0x23')](_0x55c3f8);};}exports['index']=function(_0x408617,_0xc38395){var _0x5e2a92={},_0x3fc06b={},_0x419c53={'count':0x0,'rows':[]};var _0x2a972d=_[_0xf807('0x24')](db[_0xf807('0x25')][_0xf807('0x26')],function(_0x19f1ac){return{'name':_0x19f1ac[_0xf807('0x27')],'type':_0x19f1ac[_0xf807('0x28')][_0xf807('0x29')]};});_0x3fc06b[_0xf807('0x2a')]=_[_0xf807('0x24')](_0x2a972d,'name');_0x3fc06b['query']=_[_0xf807('0x2b')](_0x408617[_0xf807('0x2c')]);_0x3fc06b[_0xf807('0x2d')]=_[_0xf807('0x2e')](_0x3fc06b[_0xf807('0x2a')],_0x3fc06b['query']);_0x5e2a92['attributes']=_[_0xf807('0x2e')](_0x3fc06b[_0xf807('0x2a')],qs['fields'](_0x408617[_0xf807('0x2c')]['fields']));_0x5e2a92[_0xf807('0x2f')]=_0x5e2a92['attributes'][_0xf807('0x30')]?_0x5e2a92[_0xf807('0x2f')]:_0x3fc06b[_0xf807('0x2a')];if(!_0x408617[_0xf807('0x2c')]['hasOwnProperty'](_0xf807('0x31'))){_0x5e2a92[_0xf807('0x1c')]=qs['limit'](_0x408617[_0xf807('0x2c')][_0xf807('0x1c')]);_0x5e2a92['offset']=qs[_0xf807('0x1a')](_0x408617[_0xf807('0x2c')]['offset']);}_0x5e2a92[_0xf807('0x32')]=qs[_0xf807('0x33')](_0x408617[_0xf807('0x2c')][_0xf807('0x33')]);_0x5e2a92[_0xf807('0x34')]=qs[_0xf807('0x2d')](_[_0xf807('0x35')](_0x408617['query'],_0x3fc06b[_0xf807('0x2d')]),_0x2a972d);if(_0x408617[_0xf807('0x2c')]['filter']){_0x5e2a92[_0xf807('0x34')]=_[_0xf807('0x36')](_0x5e2a92[_0xf807('0x34')],{'$or':_['map'](_0x2a972d,function(_0xad144a){if(_0xad144a[_0xf807('0x28')]!==_0xf807('0x37')){var _0xcfbf39={};_0xcfbf39[_0xad144a[_0xf807('0x38')]]={'$like':'%'+_0x408617[_0xf807('0x2c')]['filter']+'%'};return _0xcfbf39;}})});}_0x5e2a92=_[_0xf807('0x36')]({},_0x5e2a92,_0x408617['options']);var _0x4c1478={'where':_0x5e2a92[_0xf807('0x34')]};return db[_0xf807('0x25')][_0xf807('0x1d')](_0x4c1478)['then'](function(_0xf6b320){_0x419c53[_0xf807('0x1d')]=_0xf6b320;if(_0x408617[_0xf807('0x2c')][_0xf807('0x39')]){_0x5e2a92[_0xf807('0x3a')]=[{'all':!![]}];}return db[_0xf807('0x25')][_0xf807('0x3b')](_0x5e2a92);})['then'](function(_0xfaea15){_0x419c53[_0xf807('0x3c')]=_0xfaea15;return _0x419c53;})[_0xf807('0x22')](respondWithFilteredResult(_0xc38395,_0x5e2a92))[_0xf807('0x3d')](handleError(_0xc38395,null));};exports[_0xf807('0x3e')]=function(_0x503ff8,_0x17f18a){var _0x30efba={'raw':!![],'where':{'id':_0x503ff8[_0xf807('0x3f')]['id']}},_0x3bba17={};_0x3bba17['model']=_[_0xf807('0x2b')](db['SmsApplication'][_0xf807('0x26')]);_0x3bba17[_0xf807('0x2c')]=_['keys'](_0x503ff8[_0xf807('0x2c')]);_0x3bba17['filters']=_[_0xf807('0x2e')](_0x3bba17['model'],_0x3bba17['query']);_0x30efba[_0xf807('0x2f')]=_[_0xf807('0x2e')](_0x3bba17[_0xf807('0x2a')],qs['fields'](_0x503ff8[_0xf807('0x2c')][_0xf807('0x40')]));_0x30efba[_0xf807('0x2f')]=_0x30efba[_0xf807('0x2f')][_0xf807('0x30')]?_0x30efba[_0xf807('0x2f')]:_0x3bba17[_0xf807('0x2a')];if(_0x503ff8['query']['includeAll']){_0x30efba[_0xf807('0x3a')]=[{'all':!![]}];}_0x30efba=_[_0xf807('0x36')]({},_0x30efba,_0x503ff8['options']);return db[_0xf807('0x25')]['find'](_0x30efba)[_0xf807('0x22')](handleEntityNotFound(_0x17f18a,null))[_0xf807('0x22')](respondWithResult(_0x17f18a,null))[_0xf807('0x3d')](handleError(_0x17f18a,null));};exports['create']=function(_0x392172,_0x406f81){return db[_0xf807('0x25')][_0xf807('0x41')](_0x392172['body'],{})[_0xf807('0x22')](respondWithResult(_0x406f81,0xc9))[_0xf807('0x3d')](handleError(_0x406f81,null));};exports[_0xf807('0x42')]=function(_0x307550,_0x56e33a){if(_0x307550[_0xf807('0x43')]['id']){delete _0x307550[_0xf807('0x43')]['id'];}return db[_0xf807('0x25')][_0xf807('0x44')]({'where':{'id':_0x307550[_0xf807('0x3f')]['id']}})['then'](handleEntityNotFound(_0x56e33a,null))['then'](saveUpdates(_0x307550[_0xf807('0x43')],null))[_0xf807('0x22')](respondWithResult(_0x56e33a,null))[_0xf807('0x3d')](handleError(_0x56e33a,null));};exports['destroy']=function(_0x809ab3,_0x43550d){return db[_0xf807('0x25')][_0xf807('0x44')]({'where':{'id':_0x809ab3[_0xf807('0x3f')]['id']}})[_0xf807('0x22')](handleEntityNotFound(_0x43550d,null))['then'](removeEntity(_0x43550d,null))[_0xf807('0x3d')](handleError(_0x43550d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 578a79b..aacc7c3 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 _0x46c3=['api','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x46c3,0x13e));var _0x346c=function(_0x2dee85,_0x3c99bb){_0x2dee85=_0x2dee85-0x0;var _0x56d8aa=_0x46c3[_0x2dee85];return _0x56d8aa;};'use strict';var _=require(_0x346c('0x0'));var util=require(_0x346c('0x1'));var logger=require('../../config/logger')(_0x346c('0x2'));var moment=require('moment');var BPromise=require(_0x346c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x346c('0x4'));var rimraf=require(_0x346c('0x5'));var config=require(_0x346c('0x6'));var attributes=require(_0x346c('0x7'));module['exports']=function(_0x4ac6b4,_0x7d2f94){return _0x4ac6b4['define']('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x346c('0x8'),'collate':_0x346c('0x9')});}; \ No newline at end of file +var _0x0f61=['bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x4624dc,_0x2d47e2){var _0x230719=function(_0x32cbba){while(--_0x32cbba){_0x4624dc['push'](_0x4624dc['shift']());}};_0x230719(++_0x2d47e2);}(_0x0f61,0x1eb));var _0x10f6=function(_0x160993,_0x2e11ea){_0x160993=_0x160993-0x0;var _0x4b267e=_0x0f61[_0x160993];return _0x4b267e;};'use strict';var _=require(_0x10f6('0x0'));var util=require(_0x10f6('0x1'));var logger=require(_0x10f6('0x2'))('api');var moment=require(_0x10f6('0x3'));var BPromise=require(_0x10f6('0x4'));var rp=require(_0x10f6('0x5'));var fs=require('fs');var path=require(_0x10f6('0x6'));var rimraf=require(_0x10f6('0x7'));var config=require('../../config/environment');var attributes=require(_0x10f6('0x8'));module[_0x10f6('0x9')]=function(_0x3283f6,_0x1f6535){return _0x3283f6[_0x10f6('0xa')](_0x10f6('0xb'),attributes,{'tableName':_0x10f6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x10f6('0xd'),'collate':_0x10f6('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index acb8e3f..d4b3841 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 _0x3c85=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','debug','stringify','error','code','message','SmsApplication,\x20%s,\x20%s','info','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x37862a,_0x2bc98e){var _0x5b0104=function(_0x391413){while(--_0x391413){_0x37862a['push'](_0x37862a['shift']());}};_0x5b0104(++_0x2bc98e);}(_0x3c85,0x1a0));var _0x53c8=function(_0x20bf3f,_0xd4dd7e){_0x20bf3f=_0x20bf3f-0x0;var _0x4d51d4=_0x3c85[_0x20bf3f];return _0x4d51d4;};'use strict';var _=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var moment=require(_0x53c8('0x2'));var BPromise=require(_0x53c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53c8('0x4'))['db'];var utils=require(_0x53c8('0x5'));var logger=require(_0x53c8('0x6'))('rpc');var config=require(_0x53c8('0x7'));var jayson=require(_0x53c8('0x8'));var client=jayson[_0x53c8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5271ad,_0x4bc6ae,_0x4bb757){return new BPromise(function(_0x7d5c2a,_0x4de781){return client['request'](_0x5271ad,_0x4bb757)[_0x53c8('0xa')](function(_0x19504c){logger['info']('SmsApplication,\x20%s,\x20%s',_0x4bc6ae,'request\x20sent');logger[_0x53c8('0xb')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x4bc6ae,'request\x20sent',JSON[_0x53c8('0xc')](_0x19504c));if(_0x19504c[_0x53c8('0xd')]){if(_0x19504c[_0x53c8('0xd')][_0x53c8('0xe')]===0x1f4){logger[_0x53c8('0xd')]('SmsApplication,\x20%s,\x20%s',_0x4bc6ae,_0x19504c[_0x53c8('0xd')][_0x53c8('0xf')]);return _0x4de781(_0x19504c[_0x53c8('0xd')]['message']);}logger[_0x53c8('0xd')](_0x53c8('0x10'),_0x4bc6ae,_0x19504c['error'][_0x53c8('0xf')]);return _0x7d5c2a(_0x19504c[_0x53c8('0xd')][_0x53c8('0xf')]);}else{logger[_0x53c8('0x11')](_0x53c8('0x10'),_0x4bc6ae,_0x53c8('0x12'));_0x7d5c2a(_0x19504c[_0x53c8('0x13')][_0x53c8('0xf')]);}})[_0x53c8('0x14')](function(_0x8a7c46){logger[_0x53c8('0xd')](_0x53c8('0x10'),_0x4bc6ae,_0x8a7c46);_0x4de781(_0x8a7c46);});});} \ No newline at end of file +var _0xaec5=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aec('0x0'));var util=require(_0x5aec('0x1'));var moment=require(_0x5aec('0x2'));var BPromise=require(_0x5aec('0x3'));var rs=require(_0x5aec('0x4'));var fs=require('fs');var Redis=require(_0x5aec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5aec('0x6'));var logger=require(_0x5aec('0x7'))(_0x5aec('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x476951,_0x3dae8d,_0x215103){return new BPromise(function(_0x28c362,_0x55c01e){return client[_0x5aec('0x9')](_0x476951,_0x215103)[_0x5aec('0xa')](function(_0x5b5bb3){logger[_0x5aec('0xb')](_0x5aec('0xc'),_0x3dae8d,_0x5aec('0xd'));logger[_0x5aec('0xe')](_0x5aec('0xf'),_0x3dae8d,_0x5aec('0xd'),JSON[_0x5aec('0x10')](_0x5b5bb3));if(_0x5b5bb3['error']){if(_0x5b5bb3['error'][_0x5aec('0x11')]===0x1f4){logger[_0x5aec('0x12')](_0x5aec('0xc'),_0x3dae8d,_0x5b5bb3[_0x5aec('0x12')][_0x5aec('0x13')]);return _0x55c01e(_0x5b5bb3[_0x5aec('0x12')][_0x5aec('0x13')]);}logger[_0x5aec('0x12')](_0x5aec('0xc'),_0x3dae8d,_0x5b5bb3[_0x5aec('0x12')][_0x5aec('0x13')]);return _0x28c362(_0x5b5bb3['error'][_0x5aec('0x13')]);}else{logger[_0x5aec('0xb')]('SmsApplication,\x20%s,\x20%s',_0x3dae8d,_0x5aec('0xd'));_0x28c362(_0x5b5bb3['result'][_0x5aec('0x13')]);}})[_0x5aec('0x14')](function(_0x28f415){logger[_0x5aec('0x12')]('SmsApplication,\x20%s,\x20%s',_0x3dae8d,_0x28f415);_0x55c01e(_0x28f415);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f508a26..037b85c 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 _0xda3f=['/:id/tags','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','sms','smsinteraction:addtags','tracked','smsinteraction:update','update','delete','destroy'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xda3f,0xec));var _0xfda3=function(_0x4d6a52,_0x581398){_0x4d6a52=_0x4d6a52-0x0;var _0x9fb2d9=_0xda3f[_0x4d6a52];return _0x9fb2d9;};'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('./smsInteraction.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/download',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0xe')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xf')]);router['post'](_0xfda3('0xb'),auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xe')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xfda3('0x11'),_0xfda3('0x12')),controller['addTags']);router['put']('/:id',auth[_0xfda3('0x6')](),interaction[_0xfda3('0x13')](_0xfda3('0x11'),_0xfda3('0x14')),controller[_0xfda3('0x15')]);router[_0xfda3('0x16')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),interaction[_0xfda3('0x13')](_0xfda3('0x11'),'smsinteraction:destroy'),controller[_0xfda3('0x17')]);router[_0xfda3('0x16')](_0xfda3('0x18'),auth[_0xfda3('0x6')](),controller['removeTags']);module[_0xfda3('0x19')]=router; \ No newline at end of file +var _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x5914a2,_0x413b0b){var _0x18397f=function(_0xf5f8bc){while(--_0xf5f8bc){_0x5914a2['push'](_0x5914a2['shift']());}};_0x18397f(++_0x413b0b);}(_0x955f,0x1eb));var _0xf955=function(_0x3e6c4e,_0x140b7c){_0x3e6c4e=_0x3e6c4e-0x0;var _0x11607f=_0x955f[_0x3e6c4e];return _0x11607f;};'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('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 21f000e..db4623c 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 _0x2675=['ENUM','out','sequelize','DATE','STRING'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0x2675,0x75));var _0x5267=function(_0x222288,_0x47f419){_0x222288=_0x222288-0x0;var _0x3113c6=_0x2675[_0x222288];return _0x3113c6;};'use strict';var Sequelize=require(_0x5267('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5267('0x1')]},'disposition':{'type':Sequelize[_0x5267('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5267('0x2')]},'note':{'type':Sequelize[_0x5267('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5267('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x5267('0x3')]('in',_0x5267('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5267('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x5267('0x3')]('in',_0x5267('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x49fe=['STRING','DATE','out','ENUM','sequelize','moment','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x49fe,0x100));var _0xe49f=function(_0x44b78f,_0x499180){_0x44b78f=_0x44b78f-0x0;var _0x4bbf37=_0x49fe[_0x44b78f];return _0x4bbf37;};'use strict';var Sequelize=require(_0xe49f('0x0'));var moment=require(_0xe49f('0x1'));module[_0xe49f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe49f('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe49f('0x3')]},'note':{'type':Sequelize[_0xe49f('0x3')]},'phone':{'type':Sequelize[_0xe49f('0x3')]},'read1stAt':{'type':Sequelize[_0xe49f('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe49f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe49f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe49f('0x6')]('in',_0xe49f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index da7473c..449873c 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 _0x32ac=['parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','fields','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','pick','filter','$gte','spread','findAll','color','smsInteractionTags:save','removeTags','download','join','server','files','attachments','format','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','out','System','renderFile','root','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','then','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search'];(function(_0x2bdf4a,_0x39a357){var _0x15dc76=function(_0x8e948){while(--_0x8e948){_0x2bdf4a['push'](_0x2bdf4a['shift']());}};_0x15dc76(++_0x39a357);}(_0x32ac,0x16e));var _0xc32a=function(_0xbdf519,_0x455616){_0xbdf519=_0xbdf519-0x0;var _0x52ac7c=_0x32ac[_0xbdf519];return _0x52ac7c;};'use strict';var emlformat=require(_0xc32a('0x0'));var rimraf=require(_0xc32a('0x1'));var zipdir=require(_0xc32a('0x2'));var jsonpatch=require(_0xc32a('0x3'));var rp=require(_0xc32a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc32a('0x5'));var util=require(_0xc32a('0x6'));var path=require('path');var sox=require(_0xc32a('0x7'));var csv=require(_0xc32a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc32a('0x9'));var squel=require(_0xc32a('0xa'));var crypto=require(_0xc32a('0xb'));var jsforce=require(_0xc32a('0xc'));var deskjs=require(_0xc32a('0xd'));var toCsv=require(_0xc32a('0x8'));var querystring=require(_0xc32a('0xe'));var Papa=require(_0xc32a('0xf'));var Redis=require('ioredis');var authService=require(_0xc32a('0x10'));var qs=require(_0xc32a('0x11'));var as=require(_0xc32a('0x12'));var pdf=require(_0xc32a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc32a('0x14'))(_0xc32a('0x15'));var utils=require(_0xc32a('0x16'));var config=require(_0xc32a('0x17'));var licenseUtil=require(_0xc32a('0x18'));var db=require(_0xc32a('0x19'))['db'];config[_0xc32a('0x1a')]=_[_0xc32a('0x1b')](config[_0xc32a('0x1a')],{'host':_0xc32a('0x1c'),'port':0x18eb});var socket=require(_0xc32a('0x1d'))(new Redis(config['redis']));require(_0xc32a('0x1e'))[_0xc32a('0x1f')](socket);function respondWithStatusCode(_0x39eacc,_0x1310cf){_0x1310cf=_0x1310cf||0xcc;return function(_0x289c62){if(_0x289c62){return _0x39eacc['sendStatus'](_0x1310cf);}return _0x39eacc['status'](_0x1310cf)[_0xc32a('0x20')]();};}function respondWithResult(_0x2e5ba4,_0x2010e5){_0x2010e5=_0x2010e5||0xc8;return function(_0x510d7b){if(_0x510d7b){return _0x2e5ba4['status'](_0x2010e5)[_0xc32a('0x21')](_0x510d7b);}};}function respondWithFilteredResult(_0x2a27b6,_0x59e72b){return function(_0x3912c3){if(_0x3912c3){var _0x25becf=typeof _0x59e72b['offset']===_0xc32a('0x22')&&typeof _0x59e72b[_0xc32a('0x23')]==='undefined';var _0x48867f=_0x3912c3[_0xc32a('0x24')];var _0x39c876=_0x25becf?0x0:_0x59e72b[_0xc32a('0x25')];var _0x5d2d0e=_0x25becf?_0x3912c3[_0xc32a('0x24')]:_0x59e72b['offset']+_0x59e72b[_0xc32a('0x23')];var _0x27db08;if(_0x5d2d0e>=_0x48867f){_0x5d2d0e=_0x48867f;_0x27db08=0xc8;}else{_0x27db08=0xce;}_0x2a27b6[_0xc32a('0x26')](_0x27db08);return _0x2a27b6[_0xc32a('0x27')](_0xc32a('0x28'),_0x39c876+'-'+_0x5d2d0e+'/'+_0x48867f)[_0xc32a('0x21')](_0x3912c3);}return null;};}function patchUpdates(_0x1e6bea){return function(_0x51333d){try{jsonpatch['apply'](_0x51333d,_0x1e6bea,!![]);}catch(_0x410337){return BPromise[_0xc32a('0x29')](_0x410337);}return _0x51333d[_0xc32a('0x2a')]();};}function saveUpdates(_0x5de435,_0xe965c9){return function(_0x5ecfca){if(_0x5ecfca){return _0x5ecfca[_0xc32a('0x2b')](_0x5de435)['then'](function(_0x2d3093){return _0x2d3093;});}return null;};}function removeEntity(_0x14154f,_0x309160){return function(_0x5299b8){if(_0x5299b8){return _0x5299b8[_0xc32a('0x2c')]()['then'](function(){_0x14154f[_0xc32a('0x26')](0xcc)[_0xc32a('0x20')]();});}};}function handleEntityNotFound(_0x345b43,_0x2a40e6){return function(_0x33b7a2){if(!_0x33b7a2){_0x345b43['sendStatus'](0x194);}return _0x33b7a2;};}function handleError(_0x469788,_0x4a19c6){_0x4a19c6=_0x4a19c6||0x1f4;return function(_0x1703ca){logger[_0xc32a('0x2d')](_0x1703ca[_0xc32a('0x2e')]);if(_0x1703ca[_0xc32a('0x2f')]){delete _0x1703ca['name'];}_0x469788[_0xc32a('0x26')](_0x4a19c6)[_0xc32a('0x30')](_0x1703ca);};}function getInteractionUsers(_0x2d1f87,_0x15d43c){return new BPromise(function(_0x42cf11,_0x4bbd94){try{if(_0x15d43c[_0x2d1f87['id']]){_0x2d1f87[_0xc32a('0x31')]=_[_0xc32a('0x32')](_0x15d43c[_0x2d1f87['id']],function(_0xbffb72){return{'id':_0xbffb72['id'],'fullname':_0xbffb72[_0xc32a('0x33')]};});}}catch(_0x164ceb){_0x4bbd94(_0x164ceb);}_0x42cf11(_0x2d1f87);});}function getInteractionTags(_0x202feb,_0x4ea85e){return new BPromise(function(_0x345ebb,_0x35af96){try{if(_0x202feb['TagIds']){_0x202feb['Tags']=[];_0x202feb[_0xc32a('0x34')][_0xc32a('0x35')](',')[_0xc32a('0x36')](function(_0x473326){_0x202feb['Tags'][_0xc32a('0x37')](_0x4ea85e[_0x473326]);});}delete _0x202feb['TagIds'];}catch(_0xedcae){_0x35af96(_0xedcae);}_0x345ebb(_0x202feb);});}function updateSmsInteraction(_0x5e31e1,_0x1b4651,_0x4ed71f){return new BPromise(function(_0x25d41e,_0x18eee1){return getInteractionUsers(_0x5e31e1,_0x4ed71f)[_0xc32a('0x38')](function(_0x266827){return getInteractionTags(_0x266827,_0x1b4651);})[_0xc32a('0x38')](function(_0x104eb6){_0x25d41e(_0x104eb6);})[_0xc32a('0x39')](function(_0x338fdb){_0x18eee1(_0x338fdb);});});}exports[_0xc32a('0x3a')]=function(_0x260477,_0x15a0fb){var _0x252469={},_0xe985da={},_0x246462={'count':0x0,'rows':[]};var _0x1b117d=_['map'](db[_0xc32a('0x3b')][_0xc32a('0x3c')],function(_0x56635f){return{'name':_0x56635f[_0xc32a('0x3d')],'type':_0x56635f[_0xc32a('0x3e')][_0xc32a('0x3f')]};});_0xe985da[_0xc32a('0x40')]=_['map'](_0x1b117d,_0xc32a('0x2f'));_0xe985da[_0xc32a('0x41')]=_[_0xc32a('0x42')](_0x260477[_0xc32a('0x41')]);_0xe985da[_0xc32a('0x43')]=_[_0xc32a('0x44')](_0xe985da[_0xc32a('0x40')],_0xe985da['query']);_0x252469['attributes']=_[_0xc32a('0x44')](_0xe985da[_0xc32a('0x40')],qs['fields'](_0x260477[_0xc32a('0x41')]['fields']));_0x252469['attributes']=_0x252469[_0xc32a('0x45')][_0xc32a('0x46')]?_0x252469[_0xc32a('0x45')]:_0xe985da[_0xc32a('0x40')];if(!_0x260477[_0xc32a('0x41')][_0xc32a('0x47')](_0xc32a('0x48'))){_0x252469[_0xc32a('0x23')]=qs[_0xc32a('0x23')](_0x260477[_0xc32a('0x41')][_0xc32a('0x23')]);_0x252469['offset']=qs[_0xc32a('0x25')](_0x260477[_0xc32a('0x41')][_0xc32a('0x25')]);}_0x252469[_0xc32a('0x49')]=qs[_0xc32a('0x4a')](_0x260477[_0xc32a('0x41')]['sort']);_0x252469['where']=qs[_0xc32a('0x43')](_['pick'](_0x260477[_0xc32a('0x41')],_0xe985da[_0xc32a('0x43')]),_0x1b117d);var _0x4e6994=[];var _0xb66d97=squel[_0xc32a('0x4b')]()[_0xc32a('0x4c')]('id')[_0xc32a('0x4c')](_0xc32a('0x2f'))['field']('color')[_0xc32a('0x4d')](_0xc32a('0x4e'));var _0x7c1ce8=squel[_0xc32a('0x4b')]()[_0xc32a('0x4c')](_0xc32a('0x4f'))[_0xc32a('0x4c')](_0xc32a('0x50'))[_0xc32a('0x4c')]('ui.SmsInteractionId')['from'](_0xc32a('0x51'),'ui')[_0xc32a('0x52')](_0xc32a('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x3fd047=squel[_0xc32a('0x4b')]()[_0xc32a('0x4d')]('sms_interactions','i')[_0xc32a('0x52')]('cm_contacts','c',_0xc32a('0x54'))[_0xc32a('0x52')](_0xc32a('0x53'),'o',_0xc32a('0x55'))[_0xc32a('0x52')](_0xc32a('0x56'),'a',_0xc32a('0x57'))[_0xc32a('0x52')](_0xc32a('0x58'),'me',_0xc32a('0x59'))[_0xc32a('0x52')](_0xc32a('0x5a'),'it',_0xc32a('0x5b'))[_0xc32a('0x52')](_0xc32a('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x215160=squel['expr']();var _0x2051ea=[];var _0x23d03d=squel[_0xc32a('0x5c')]();var _0x5d6901;if(_0x260477[_0xc32a('0x41')][_0xc32a('0x5d')]){_0x5d6901=as[_0xc32a('0x5e')](_0x260477[_0xc32a('0x41')][_0xc32a('0x5d')]);var _0x31924a=_0x5d6901[_0xc32a('0x5f')];for(var _0x278121=0x0;_0x278121<_0x5d6901[_0xc32a('0x60')][_0xc32a('0x46')];_0x278121++){var _0x22a774=_0x5d6901[_0xc32a('0x60')][_0x278121];var _0x3bde3c='i';var _0x16983a=_[_0xc32a('0x61')](_0x1b117d,[_0xc32a('0x2f'),_0x22a774[_0xc32a('0x4c')]]);if(!_0x16983a){switch(_0x22a774[_0xc32a('0x4c')]){case _0xc32a('0x62'):if(_0x22a774['value']==0x1){_0x3fd047[_0xc32a('0x63')]('`'+_0x22a774[_0xc32a('0x4c')]+_0xc32a('0x64'));}else{_0x3fd047[_0xc32a('0x63')]('`'+_0x22a774[_0xc32a('0x4c')]+'`\x20>\x200');}break;case'Contact':if(_0x22a774[_0xc32a('0x65')]===_0xc32a('0x66')){if(_0x22a774[_0xc32a('0x67')][_0xc32a('0x35')]('\x20')[_0xc32a('0x46')]>0x1){_0x215160[_0x31924a](_0xc32a('0x68'),qs['getFullTextValue'](_0x22a774[_0xc32a('0x67')]),null);}else{var _0x837f9f='%'+_0x22a774[_0xc32a('0x67')]+'%';_0x215160[_0x31924a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x837f9f,_0x837f9f,_0x837f9f);}}else{_0x16983a=_[_0xc32a('0x61')](_0x1b117d,[_0xc32a('0x2f'),_0xc32a('0x69')]);_0x22a774[_0xc32a('0x4c')]=_0xc32a('0x69');_0x29401a=as[_0xc32a('0x6a')](_0x3bde3c,_0x16983a[_0xc32a('0x3e')],_0x22a774);_0x215160[_0x31924a](_0x29401a[_0xc32a('0x6b')],_0x29401a[_0xc32a('0x67')]['start'],_0x29401a[_0xc32a('0x67')][_0xc32a('0x20')]);}break;case _0xc32a('0x6c'):var _0x38d73b=_0x22a774[_0xc32a('0x67')][_0xc32a('0x35')](',')['map'](function(_0x1b53ed){return Number(_0x1b53ed);});_0x38d73b[_0xc32a('0x36')](function(_0x5ad3c5){_0x23d03d['or'](_0xc32a('0x6d'),'%,'+_0x5ad3c5+',%');});_0x2051ea=_[_0xc32a('0x6e')](_0x2051ea,_0x38d73b);break;case _0xc32a('0x6f'):if(_0x22a774[_0xc32a('0x65')]===_0xc32a('0x66')){_0x215160[_0x31924a](_0xc32a('0x70'),'%'+_0x22a774[_0xc32a('0x67')]+'%',null);}else{_0x16983a=_[_0xc32a('0x61')](_0x1b117d,[_0xc32a('0x2f'),_0xc32a('0x71')]);_0x22a774[_0xc32a('0x4c')]=_0xc32a('0x71');_0x29401a=as[_0xc32a('0x6a')](_0x3bde3c,_0x16983a[_0xc32a('0x3e')],_0x22a774);_0x215160[_0x31924a](_0x29401a[_0xc32a('0x6b')],_0x29401a[_0xc32a('0x67')][_0xc32a('0x72')],_0x29401a[_0xc32a('0x67')]['end']);}break;case'body':_0x29401a=as[_0xc32a('0x6a')]('me',null,_0x22a774);_0x215160[_0x31924a](_0x29401a[_0xc32a('0x6b')],_0x29401a[_0xc32a('0x67')]['start'],_0x29401a[_0xc32a('0x67')][_0xc32a('0x20')]);break;}}else{var _0x29401a=as[_0xc32a('0x6a')](_0x3bde3c,_0x16983a[_0xc32a('0x3e')],_0x22a774);_0x215160[_0x31924a](_0x29401a[_0xc32a('0x6b')],_0x29401a[_0xc32a('0x67')][_0xc32a('0x72')],_0x29401a[_0xc32a('0x67')][_0xc32a('0x20')]);}}}else{var _0x248bb4=_(_0x260477[_0xc32a('0x41')])[_0xc32a('0x42')]()[_0xc32a('0x32')](function(_0x56e8e9){return _[_0xc32a('0x73')](_0x1b117d,[_0xc32a('0x2f'),_0x56e8e9])?_0x56e8e9:undefined;})[_0xc32a('0x74')]()[_0xc32a('0x67')]();if(!_[_0xc32a('0x75')](_0x248bb4)){_0x248bb4[_0xc32a('0x36')](function(_0x5084dc){if(_0x5084dc===_0xc32a('0x76')){_0x3fd047[_0xc32a('0x77')](_0xc32a('0x78'),[][_0xc32a('0x79')](_0x260477[_0xc32a('0x41')][_0x5084dc]));}else if(_0x5084dc==='createdAt'){var _0x5b03c4=JSON[_0xc32a('0x7a')](_0x260477[_0xc32a('0x41')][_0x5084dc])['$gte'];var _0x5bd197=JSON['parse'](_0x260477[_0xc32a('0x41')][_0x5084dc])[_0xc32a('0x7b')];_0x3fd047['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b03c4,_0x5bd197);}else{if(_0x260477[_0xc32a('0x41')][_0x5084dc]===_0xc32a('0x7c')){_0x3fd047['where']('i.'+_0x5084dc+_0xc32a('0x7d'));}else{_0x3fd047[_0xc32a('0x77')]('i.'+_0x5084dc+'\x20=\x20?',_0x260477[_0xc32a('0x41')][_0x5084dc]);}}});}if(_0x260477[_0xc32a('0x41')]['read']){if(_0x260477[_0xc32a('0x41')][_0xc32a('0x7e')]==0x1){_0x3fd047['having'](_0xc32a('0x7f'));}else{_0x3fd047[_0xc32a('0x63')](_0xc32a('0x80'));}}if(_0x260477[_0xc32a('0x41')][_0xc32a('0x81')]){_0x2051ea=_[_0xc32a('0x82')](_0x260477[_0xc32a('0x41')][_0xc32a('0x81')])?_0x260477[_0xc32a('0x41')][_0xc32a('0x81')]:new Array(_0x260477[_0xc32a('0x41')][_0xc32a('0x81')]);_0x2051ea[_0xc32a('0x36')](function(_0x5dbfe7){_0x23d03d['or'](_0xc32a('0x6d'),'%,'+_0x5dbfe7+',%');});}if(_0x260477[_0xc32a('0x41')]['filter']){var _0x142cb8=_0x260477[_0xc32a('0x41')]['filter']['replace']('\x5c','\x5c\x5c')[_0xc32a('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x142cb8)){_0x215160['or'](_0xc32a('0x84'),_0x142cb8+'%')['or'](_0xc32a('0x85'),_0x142cb8+'%');}else{_0x215160['or'](_0xc32a('0x86'),qs[_0xc32a('0x87')](_0x142cb8))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x142cb8+'%');}}}_0x3fd047[_0xc32a('0x77')](_0x215160);_0x3fd047[_0xc32a('0x88')]('i.id');var _0x403768={'type':db[_0xc32a('0x89')][_0xc32a('0x8a')][_0xc32a('0x8b')],'raw':!![]};var _0x28fb9f=_0x3fd047[_0xc32a('0x8c')]();_0x28fb9f['field'](_0xc32a('0x8d'));_0x28fb9f['field'](_0xc32a('0x8e'),'unreadMessages');if(_0x252469[_0xc32a('0x49')]){_0x252469[_0xc32a('0x49')]['forEach'](function(_0x2633ab){var _0xd6da3e=_0x2633ab[0x0]===_0xc32a('0x8f')?_0x2633ab[0x0]:'i.'+_0x2633ab[0x0];_0x3fd047[_0xc32a('0x49')](_0xd6da3e,_0x2633ab[0x1]===_0xc32a('0x90')?![]:!![]);});}if(!_[_0xc32a('0x75')](_0x2051ea)){_0x3fd047[_0xc32a('0x63')](_0x23d03d);_0x28fb9f[_0xc32a('0x77')]('t.id\x20IN\x20?',_0x2051ea);}BPromise['resolve']()[_0xc32a('0x38')](function(){if(!_0x5d6901){if(_0x260477[_0xc32a('0x41')][_0xc32a('0x76')])return;_0x28fb9f[_0xc32a('0x77')](_0xc32a('0x91'));_0x3fd047[_0xc32a('0x77')](_0xc32a('0x91'));return;}if(_0x260477[_0xc32a('0x92')][_0xc32a('0x93')]!==_0xc32a('0x94'))return;return _0x260477[_0xc32a('0x92')][_0xc32a('0x95')]({'attributes':['id'],'raw':!![]})[_0xc32a('0x38')](function(_0x125220){if(_[_0xc32a('0x75')](_0x125220)){_0x28fb9f[_0xc32a('0x77')](_0xc32a('0x96'));_0x3fd047[_0xc32a('0x77')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x28fb9f[_0xc32a('0x77')](_0xc32a('0x78'),_[_0xc32a('0x32')](_0x125220,'id'));_0x3fd047[_0xc32a('0x77')](_0xc32a('0x78'),_[_0xc32a('0x32')](_0x125220,'id'));}});})['then'](function(){if(_0x260477[_0xc32a('0x92')][_0xc32a('0x93')]==='agent'&&!_0x5d6901&&!_0x260477[_0xc32a('0x41')][_0xc32a('0x76')])return[];return db[_0xc32a('0x97')][_0xc32a('0x41')](_0x28fb9f[_0xc32a('0x98')](),_0x403768);})['then'](function(_0x4be789){_0x246462[_0xc32a('0x24')]=_0x4be789[_0xc32a('0x46')];if(_0x246462[_0xc32a('0x24')]===0x0)return[];return db[_0xc32a('0x97')]['query'](_0xb66d97[_0xc32a('0x98')](),_0x403768)[_0xc32a('0x38')](function(_0x71560d){_0x4e6994=_[_0xc32a('0x99')](_0x71560d,'id');_0x403768=_[_0xc32a('0x9a')](_0x403768,{'model':db[_0xc32a('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x260477[_0xc32a('0x41')][_0xc32a('0x9b')]){_0x252469[_0xc32a('0x45')][_0xc32a('0x36')](function(_0x396cbd){_0x3fd047[_0xc32a('0x4c')]('i.'+_0x396cbd);});}else{_0x3fd047[_0xc32a('0x4c')](_0xc32a('0x8e'),_0xc32a('0x62'));_0x3fd047[_0xc32a('0x4c')]('a.key','Account.key');_0x3fd047[_0xc32a('0x4c')](_0xc32a('0x9c'),'Account.mandatoryDisposition');_0x3fd047['field'](_0xc32a('0x9d'),_0xc32a('0x8f'));_0x3fd047['field']('i.*');_0x3fd047[_0xc32a('0x4c')](_0xc32a('0x9e'),_0xc32a('0x9f'));_0x3fd047['field'](_0xc32a('0xa0'),_0xc32a('0xa1'));_0x3fd047[_0xc32a('0x4c')](_0xc32a('0xa2'),_0xc32a('0xa3'));_0x3fd047[_0xc32a('0x4c')](_0xc32a('0xa4'),_0xc32a('0xa5'));_0x3fd047[_0xc32a('0x4c')](_0xc32a('0xa6'),_0xc32a('0xa7'));_0x3fd047[_0xc32a('0x4c')]('c.fax','Contact.fax');_0x3fd047['field'](_0xc32a('0xa8'),_0xc32a('0xa9'));_0x3fd047[_0xc32a('0x4c')]('o.internal','Owner.internal');_0x3fd047[_0xc32a('0x4c')](_0xc32a('0xaa'),'TagIds');}if(_0x252469['limit'])_0x3fd047[_0xc32a('0x23')](_0x252469[_0xc32a('0x23')]);if(_0x252469[_0xc32a('0x25')])_0x3fd047[_0xc32a('0x25')](_0x252469[_0xc32a('0x25')]);return db[_0xc32a('0x97')][_0xc32a('0x41')](_0x3fd047[_0xc32a('0x98')](),_0x403768);})[_0xc32a('0x38')](function(_0x206577){if(_0x206577[_0xc32a('0x46')]>0x0)_0x7c1ce8[_0xc32a('0x77')](_0xc32a('0xab'),_[_0xc32a('0x32')](_0x206577,'id'));return db[_0xc32a('0x97')][_0xc32a('0x41')](_0x7c1ce8[_0xc32a('0x98')](),_0x403768)[_0xc32a('0x38')](function(_0x2f14e5){var _0x1fc3ea=_[_0xc32a('0xac')](_0x2f14e5,_0xc32a('0xad'));var _0x498ea1=[];_0x206577['forEach'](function(_0x4b37ef){_0x498ea1[_0xc32a('0x37')](updateSmsInteraction(_0x4b37ef,_0x4e6994,_0x1fc3ea));});return BPromise[_0xc32a('0xae')](_0x498ea1);});});})[_0xc32a('0x38')](function(_0x6fd15c){_0x246462[_0xc32a('0xaf')]=_0x6fd15c;return _0x246462;})['then'](respondWithFilteredResult(_0x15a0fb,_0x252469))[_0xc32a('0x39')](handleError(_0x15a0fb,null));};exports[_0xc32a('0xb0')]=function(_0x298c50,_0x3d1495){var _0x541170={'raw':![],'where':{'id':_0x298c50[_0xc32a('0xb1')]['id']}},_0x290e82={};_0x290e82[_0xc32a('0x40')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x290e82['query']=_['keys'](_0x298c50[_0xc32a('0x41')]);_0x290e82[_0xc32a('0x43')]=_[_0xc32a('0x44')](_0x290e82[_0xc32a('0x40')],_0x290e82['query']);_0x541170[_0xc32a('0x45')]=_[_0xc32a('0x44')](_0x290e82[_0xc32a('0x40')],qs[_0xc32a('0x9b')](_0x298c50[_0xc32a('0x41')]['fields']));_0x541170[_0xc32a('0x45')]=_0x541170[_0xc32a('0x45')]['length']?_0x541170['attributes']:_0x290e82[_0xc32a('0x40')];if(_0x298c50[_0xc32a('0x41')][_0xc32a('0xb2')]){_0x541170[_0xc32a('0xb3')]=[{'all':!![]}];}_0x541170=_['merge']({},_0x541170,_0x298c50[_0xc32a('0xb4')]);return db['SmsInteraction'][_0xc32a('0x61')](_0x541170)[_0xc32a('0x38')](handleEntityNotFound(_0x3d1495,null))[_0xc32a('0x38')](respondWithResult(_0x3d1495,null))['catch'](handleError(_0x3d1495,null));};exports[_0xc32a('0xb5')]=function(_0x4410e9,_0x34145b){return db[_0xc32a('0x3b')][_0xc32a('0xb5')](_0x4410e9[_0xc32a('0xb6')],{})[_0xc32a('0x38')](respondWithResult(_0x34145b,0xc9))[_0xc32a('0x39')](handleError(_0x34145b,null));};exports[_0xc32a('0x2b')]=function(_0xb1d9b7,_0x227e84){if(_0xb1d9b7['body']['id']){delete _0xb1d9b7[_0xc32a('0xb6')]['id'];}return db[_0xc32a('0x3b')][_0xc32a('0x61')]({'where':{'id':_0xb1d9b7[_0xc32a('0xb1')]['id']}})[_0xc32a('0x38')](handleEntityNotFound(_0x227e84,null))[_0xc32a('0x38')](saveUpdates(_0xb1d9b7[_0xc32a('0xb6')],null))['then'](respondWithResult(_0x227e84,null))[_0xc32a('0x39')](handleError(_0x227e84,null));};exports['destroy']=function(_0x1fe53b,_0x3ca5b5){return db[_0xc32a('0x3b')][_0xc32a('0x61')]({'where':{'id':_0x1fe53b[_0xc32a('0xb1')]['id']}})[_0xc32a('0x38')](handleEntityNotFound(_0x3ca5b5,null))[_0xc32a('0x38')](removeEntity(_0x3ca5b5,null))[_0xc32a('0x39')](handleError(_0x3ca5b5,null));};exports[_0xc32a('0xb7')]=function(_0x56516e,_0x519381){return db[_0xc32a('0x3b')][_0xc32a('0xb7')]()[_0xc32a('0x38')](respondWithResult(_0x519381,null))[_0xc32a('0x39')](handleError(_0x519381,null));};exports[_0xc32a('0xb8')]=function(_0x25387a,_0x2c8c5a,_0x2bac6c){return db[_0xc32a('0xb9')][_0xc32a('0x61')]({'where':{'id':_0x25387a[_0xc32a('0xb1')]['id']}})[_0xc32a('0x38')](handleEntityNotFound(_0x2c8c5a,null))[_0xc32a('0x38')](function(_0x2e10ea){if(_0x2e10ea){return _0x2e10ea['addMessage'](_0x25387a['body']['ids'],_[_0xc32a('0xba')](_0x25387a[_0xc32a('0xb6')],[_0xc32a('0xbb'),'id'])||{});}})[_0xc32a('0x38')](respondWithResult(_0x2c8c5a,null))[_0xc32a('0x39')](handleError(_0x2c8c5a,null));};exports[_0xc32a('0xbc')]=function(_0x39fd5e,_0x1e4886,_0x3ab5dd){var _0x3665d3={'raw':![],'where':{}};var _0x12ebf0={};var _0x1f7b97={'count':0x0,'rows':[]};return db[_0xc32a('0x3b')][_0xc32a('0xbd')]({'where':{'id':_0x39fd5e['params']['id']}})[_0xc32a('0x38')](handleEntityNotFound(_0x1e4886,null))[_0xc32a('0x38')](function(_0x57eb24){if(_0x57eb24){_0x12ebf0[_0xc32a('0x40')]=_[_0xc32a('0x42')](db['SmsMessage'][_0xc32a('0x3c')]);_0x12ebf0[_0xc32a('0x41')]=_[_0xc32a('0x42')](_0x39fd5e[_0xc32a('0x41')]);_0x12ebf0[_0xc32a('0x43')]=_[_0xc32a('0x44')](_0x12ebf0[_0xc32a('0x40')],_0x12ebf0[_0xc32a('0x41')]);_0x3665d3['attributes']=_[_0xc32a('0x44')](_0x12ebf0[_0xc32a('0x40')],qs[_0xc32a('0x9b')](_0x39fd5e['query'][_0xc32a('0x9b')]));_0x3665d3[_0xc32a('0x45')]=_0x3665d3[_0xc32a('0x45')][_0xc32a('0x46')]?_0x3665d3[_0xc32a('0x45')]:_0x12ebf0[_0xc32a('0x40')];if(!_0x39fd5e['query'][_0xc32a('0x47')](_0xc32a('0x48'))){_0x3665d3[_0xc32a('0x23')]=qs[_0xc32a('0x23')](_0x39fd5e[_0xc32a('0x41')][_0xc32a('0x23')]);_0x3665d3[_0xc32a('0x25')]=qs['offset'](_0x39fd5e['query'][_0xc32a('0x25')]);}_0x3665d3[_0xc32a('0x49')]=qs[_0xc32a('0x4a')](_0x39fd5e[_0xc32a('0x41')][_0xc32a('0x4a')]);_0x3665d3[_0xc32a('0x77')]=qs[_0xc32a('0x43')](_[_0xc32a('0xbe')](_0x39fd5e[_0xc32a('0x41')],_0x12ebf0[_0xc32a('0x43')]));_0x3665d3['where'][_0xc32a('0xad')]=_0x57eb24['id'];if(_0x39fd5e[_0xc32a('0x41')][_0xc32a('0xbf')]){_0x3665d3[_0xc32a('0x77')]=_['merge'](_0x3665d3[_0xc32a('0x77')],{'$or':_[_0xc32a('0x32')](_0x3665d3[_0xc32a('0x45')],function(_0x3e2fa7){var _0x2d1e5a={};_0x2d1e5a[_0x3e2fa7]={'$like':'%'+_0x39fd5e['query'][_0xc32a('0xbf')]+'%'};return _0x2d1e5a;})});}if(_0x39fd5e[_0xc32a('0x41')][_0xc32a('0xc0')]){var _0x5d9952=_0x39fd5e[_0xc32a('0x41')][_0xc32a('0xc0')][_0xc32a('0x35')](',');var _0x23bc5b={};_0x23bc5b[_0x5d9952[0x0]]={'$gte':moment(_0x5d9952[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3665d3[_0xc32a('0x77')]=_[_0xc32a('0x9a')](_0x3665d3[_0xc32a('0x77')],_0x23bc5b);}_0x3665d3=_[_0xc32a('0x9a')]({},_0x3665d3,_0x39fd5e[_0xc32a('0xb4')]);return db[_0xc32a('0xb9')][_0xc32a('0x24')]({'where':_0x3665d3[_0xc32a('0x77')]})['then'](function(_0x29daf7){_0x1f7b97[_0xc32a('0x24')]=_0x29daf7;if(_0x39fd5e[_0xc32a('0x41')]['includeAll']){_0x3665d3['include']=[{'all':!![]}];}return db[_0xc32a('0xb9')]['findAll'](_0x3665d3);})[_0xc32a('0x38')](function(_0x38f7ef){_0x1f7b97[_0xc32a('0xaf')]=_0x38f7ef;return _0x1f7b97;});}})['then'](respondWithFilteredResult(_0x1e4886,_0x3665d3))[_0xc32a('0x39')](handleError(_0x1e4886,null));};exports['addTags']=function(_0x8819e,_0x827e19,_0x87b85e){return db[_0xc32a('0x3b')][_0xc32a('0x61')]({'where':{'id':_0x8819e[_0xc32a('0xb1')]['id']}})[_0xc32a('0x38')](handleEntityNotFound(_0x827e19,null))[_0xc32a('0x38')](function(_0x241f68){if(_0x241f68){return _0x241f68['setTags'](_0x8819e[_0xc32a('0xb6')][_0xc32a('0xbb')],_['omit'](_0x8819e[_0xc32a('0xb6')],['ids','id'])||{})[_0xc32a('0xc1')](function(){return db[_0xc32a('0x6c')][_0xc32a('0xc2')]({'attributes':['id','name',_0xc32a('0xc3')],'where':{'id':_0x8819e[_0xc32a('0xb6')][_0xc32a('0xbb')]}});})['then'](function(_0x41ba90){socket['emit'](_0xc32a('0xc4'),{'id':Number(_0x8819e[_0xc32a('0xb1')]['id']),'tags':_0x41ba90||[]});return{'id':Number(_0x8819e['params']['id']),'tags':_0x41ba90||[]};});}})['then'](respondWithResult(_0x827e19,null))[_0xc32a('0x39')](handleError(_0x827e19,null));};exports[_0xc32a('0xc5')]=function(_0x2d4a87,_0x391479,_0x19f8f1){return db[_0xc32a('0x3b')][_0xc32a('0x61')]({'where':{'id':_0x2d4a87[_0xc32a('0xb1')]['id']}})[_0xc32a('0x38')](handleEntityNotFound(_0x391479,null))[_0xc32a('0x38')](function(_0x42738f){if(_0x42738f){return _0x42738f[_0xc32a('0xc5')](_0x2d4a87[_0xc32a('0x41')][_0xc32a('0xbb')]);}})[_0xc32a('0x38')](respondWithStatusCode(_0x391479,null))[_0xc32a('0x39')](handleError(_0x391479,null));};exports[_0xc32a('0xc6')]=function(_0x39e36e,_0xf8641d){var _0xc645b=moment()['unix']()[_0xc32a('0x98')]();var _0x13331c=path[_0xc32a('0xc7')](config['root'],_0xc32a('0xc8'),_0xc32a('0xc9'),'tmp');var _0x2a33d1=path[_0xc32a('0xc7')](config['root'],_0xc32a('0xc8'),_0xc32a('0xc9'),_0xc32a('0xca'));var _0x309d64=path[_0xc32a('0xc7')](_0x13331c,_0xc645b);var _0x4ad236=util[_0xc32a('0xcb')]('transcript-%d-%s.zip',_0x39e36e['params']['id'],_0xc645b);var _0x4c3f35=path[_0xc32a('0xc7')](_0x13331c,_0x4ad236);var _0x2aa4d2=[];_0x2aa4d2[_0xc32a('0x37')]({'model':db[_0xc32a('0x6f')],'as':_0xc32a('0x6f'),'attributes':['id',_0xc32a('0x33')],'raw':!![]});_0x2aa4d2[_0xc32a('0x37')]({'model':db[_0xc32a('0xcc')],'as':_0xc32a('0xcd'),'attributes':['id',_0xc32a('0xce'),_0xc32a('0xcf')],'raw':!![]});var _0x31059=[{'model':db['SmsMessage'],'as':_0xc32a('0xd0'),'attributes':['id',_0xc32a('0xb6'),_0xc32a('0xd1'),_0xc32a('0xd2'),_0xc32a('0xd3'),_0xc32a('0x7e')],'include':_0x2aa4d2}];_0x31059['push']({'model':db[_0xc32a('0xd4')],'as':_0xc32a('0xd5'),'attributes':['id',_0xc32a('0x2f')]});_0x31059[_0xc32a('0x37')]({'model':db['User'],'as':_0xc32a('0xd6'),'attributes':['id',_0xc32a('0x33')]});return db[_0xc32a('0x3b')][_0xc32a('0x61')]({'where':{'id':_0x39e36e[_0xc32a('0xb1')]['id']},'include':_0x31059})[_0xc32a('0x38')](handleEntityNotFound(_0xf8641d,null))[_0xc32a('0x38')](function(_0x28a8df){if(_0x28a8df){var _0xf7e05a=_0x28a8df['get']({'plain':!![]});fs[_0xc32a('0xd7')](_0x309d64);var _0x38f680={'channel':_0xc32a('0xd8'),'account':_0xf7e05a['Account']['name'],'agent':_0xf7e05a[_0xc32a('0xd6')]?_0xf7e05a['Owner'][_0xc32a('0x33')]:_0xc32a('0xd9'),'createdAt':moment(_0xf7e05a[_0xc32a('0xd1')])[_0xc32a('0xcb')](_0xc32a('0xda'))[_0xc32a('0x98')](),'closedAt':_0xf7e05a['closed']?moment(_0xf7e05a[_0xc32a('0xdb')])[_0xc32a('0xcb')](_0xc32a('0xda'))['toString']():'','disposition':_0xf7e05a[_0xc32a('0xdc')],'messages':_(_0xf7e05a[_0xc32a('0xd0')])[_0xc32a('0xbf')]({'secret':![]})[_0xc32a('0x32')](function(_0x133053){return{'date':moment(_0x133053['createdAt'])[_0xc32a('0xcb')](_0xc32a('0xda'))['toString'](),'sender':_0x133053['direction']===_0xc32a('0xdd')?_0x133053[_0xc32a('0x6f')]?_0x133053[_0xc32a('0x6f')]['fullname']:_0xc32a('0xde'):_0x133053[_0xc32a('0xcd')][_0xc32a('0xce')]+(_0x133053[_0xc32a('0xcd')][_0xc32a('0xcf')]?'\x20'+_0x133053[_0xc32a('0xcd')]['lastName']:''),'body':_0x133053['body'],'direction':_0x133053[_0xc32a('0xd2')]===_0xc32a('0xdd')?'A':'C','secret':_0x133053[_0xc32a('0xd3')],'read':_0x133053[_0xc32a('0x7e')]};})['value']()};return ejs[_0xc32a('0xdf')](path[_0xc32a('0xc7')](config[_0xc32a('0xe0')],'server',_0xc32a('0xe1'),_0xc32a('0xe2')),{'interaction':_0x38f680})[_0xc32a('0x38')](function(_0x3ec3c2){var _0x486c7b=path[_0xc32a('0xc7')](_0x309d64,'transcript-'+_0xf7e05a['id']+'-'+_0xc645b+_0xc32a('0xe3'));var _0x5c7dcd={'path':_0x486c7b,'channel':_0xc32a('0xd8'),'interactionId':_0xf7e05a['id']};return pdf[_0xc32a('0xe4')](_0x3ec3c2,_0x5c7dcd);})[_0xc32a('0x38')](function(){return new BPromise(function(_0x4cc59f,_0x4d5a85){zipdir(_0x309d64,{'saveTo':_0x4c3f35},function(_0x516a12,_0x2edef6){if(_0x516a12)return _0x4d5a85(_0x516a12);return _0x4cc59f(_0x2edef6);});})[_0xc32a('0x38')](function(){return new BPromise(function(_0x2458eb,_0x458581){rimraf(_0x309d64,function(_0x39047b){if(_0x39047b)_0x458581(_0x39047b);return _0x2458eb();});});})['then'](function(){return _0xf8641d['download'](_0x4c3f35,_0x4ad236,function(_0x3a776e){if(_0x3a776e){console['log']('err',_0x3a776e);}else{fs['unlinkSync'](_0x4c3f35);}});});});}else{return _0xf8641d[_0xc32a('0xe5')](0xc8);}})[_0xc32a('0x39')](handleError(_0xf8641d,null));}; \ No newline at end of file +var _0xb989=['from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','forEach','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','toString','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','sequelize','groupBy','SmsInteractionId','all','rows','catch','show','rawAttributes','includeAll','include','options','body','params','describe','addMessage','SmsMessage','ids','omit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','CmContact','firstName','Messages','direction','secret','Account','Owner','mkdirSync','Sms','N.A.','createdAt','closed','closedAt','disposition','out','System','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','fast-json-patch','request-promise','mustache','path','fs-extra','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','error','name','send','map','fullname','TagIds','Tags','split','push','then','SmsInteraction','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','select','field','tools_tags','u.id','u.fullname','ui.SmsInteractionId'];(function(_0x57cefb,_0x41c3a5){var _0x147fcb=function(_0x4eb775){while(--_0x4eb775){_0x57cefb['push'](_0x57cefb['shift']());}};_0x147fcb(++_0x41c3a5);}(_0xb989,0x180));var _0x9b98=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0xb989[_0x512c83];return _0x1f7f25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b98('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b98('0x1'));var rp=require(_0x9b98('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9b98('0x3'));var util=require('util');var path=require(_0x9b98('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b98('0x5'));var _=require(_0x9b98('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9b98('0x7'));var toCsv=require(_0x9b98('0x8'));var querystring=require('querystring');var Papa=require(_0x9b98('0x9'));var Redis=require(_0x9b98('0xa'));var authService=require(_0x9b98('0xb'));var qs=require(_0x9b98('0xc'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x9b98('0xd'));var hardwareService=require(_0x9b98('0xe'));var logger=require(_0x9b98('0xf'))(_0x9b98('0x10'));var utils=require(_0x9b98('0x11'));var config=require(_0x9b98('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b98('0x13'))['db'];config[_0x9b98('0x14')]=_['defaults'](config[_0x9b98('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b98('0x15'))(new Redis(config['redis']));require(_0x9b98('0x16'))[_0x9b98('0x17')](socket);function respondWithStatusCode(_0x240119,_0x34e3a1){_0x34e3a1=_0x34e3a1||0xcc;return function(_0x1d5053){if(_0x1d5053){return _0x240119[_0x9b98('0x18')](_0x34e3a1);}return _0x240119['status'](_0x34e3a1)[_0x9b98('0x19')]();};}function respondWithResult(_0x1b38e2,_0xf917cb){_0xf917cb=_0xf917cb||0xc8;return function(_0x1974c5){if(_0x1974c5){return _0x1b38e2[_0x9b98('0x1a')](_0xf917cb)[_0x9b98('0x1b')](_0x1974c5);}};}function respondWithFilteredResult(_0x38c009,_0x54a167){return function(_0x4d3014){if(_0x4d3014){var _0x296c94=typeof _0x54a167[_0x9b98('0x1c')]===_0x9b98('0x1d')&&typeof _0x54a167[_0x9b98('0x1e')]===_0x9b98('0x1d');var _0x300f19=_0x4d3014[_0x9b98('0x1f')];var _0x3e018d=_0x296c94?0x0:_0x54a167[_0x9b98('0x1c')];var _0x8b5562=_0x296c94?_0x4d3014[_0x9b98('0x1f')]:_0x54a167[_0x9b98('0x1c')]+_0x54a167[_0x9b98('0x1e')];var _0x5682b3;if(_0x8b5562>=_0x300f19){_0x8b5562=_0x300f19;_0x5682b3=0xc8;}else{_0x5682b3=0xce;}_0x38c009[_0x9b98('0x1a')](_0x5682b3);return _0x38c009['set'](_0x9b98('0x20'),_0x3e018d+'-'+_0x8b5562+'/'+_0x300f19)['json'](_0x4d3014);}return null;};}function patchUpdates(_0x21c52e){return function(_0x32ea14){try{jsonpatch[_0x9b98('0x21')](_0x32ea14,_0x21c52e,!![]);}catch(_0x4e62df){return BPromise['reject'](_0x4e62df);}return _0x32ea14[_0x9b98('0x22')]();};}function saveUpdates(_0x31c27e,_0x435e39){return function(_0x3a99ba){if(_0x3a99ba){return _0x3a99ba[_0x9b98('0x23')](_0x31c27e)['then'](function(_0x632338){return _0x632338;});}return null;};}function removeEntity(_0x541d12,_0x151182){return function(_0x7e328d){if(_0x7e328d){return _0x7e328d[_0x9b98('0x24')]()['then'](function(){_0x541d12[_0x9b98('0x1a')](0xcc)[_0x9b98('0x19')]();});}};}function handleEntityNotFound(_0x2d6c88,_0x164276){return function(_0x589e1f){if(!_0x589e1f){_0x2d6c88[_0x9b98('0x18')](0x194);}return _0x589e1f;};}function handleError(_0x2b5a24,_0x1ab889){_0x1ab889=_0x1ab889||0x1f4;return function(_0x268d06){logger[_0x9b98('0x25')](_0x268d06['stack']);if(_0x268d06['name']){delete _0x268d06[_0x9b98('0x26')];}_0x2b5a24[_0x9b98('0x1a')](_0x1ab889)[_0x9b98('0x27')](_0x268d06);};}function getInteractionUsers(_0x47f234,_0xf7eaa5){return new BPromise(function(_0x3d96ad,_0x527a3d){try{if(_0xf7eaa5[_0x47f234['id']]){_0x47f234['Users']=_[_0x9b98('0x28')](_0xf7eaa5[_0x47f234['id']],function(_0x32c589){return{'id':_0x32c589['id'],'fullname':_0x32c589[_0x9b98('0x29')]};});}}catch(_0x360d03){_0x527a3d(_0x360d03);}_0x3d96ad(_0x47f234);});}function getInteractionTags(_0x5d9e5e,_0x2cad16){return new BPromise(function(_0x4420af,_0x3939c6){try{if(_0x5d9e5e[_0x9b98('0x2a')]){_0x5d9e5e[_0x9b98('0x2b')]=[];_0x5d9e5e[_0x9b98('0x2a')][_0x9b98('0x2c')](',')['forEach'](function(_0x4f8e73){_0x5d9e5e[_0x9b98('0x2b')][_0x9b98('0x2d')](_0x2cad16[_0x4f8e73]);});}delete _0x5d9e5e[_0x9b98('0x2a')];}catch(_0x4607ae){_0x3939c6(_0x4607ae);}_0x4420af(_0x5d9e5e);});}function updateSmsInteraction(_0x47b220,_0x10e833,_0x450f2f){return new BPromise(function(_0x52ac8f,_0x299e20){return getInteractionUsers(_0x47b220,_0x450f2f)[_0x9b98('0x2e')](function(_0x541d48){return getInteractionTags(_0x541d48,_0x10e833);})['then'](function(_0x516749){_0x52ac8f(_0x516749);})['catch'](function(_0xc8fb48){_0x299e20(_0xc8fb48);});});}exports['index']=function(_0x2264a3,_0x3687b8){var _0x232309={},_0x3a9ed9={},_0x425711={'count':0x0,'rows':[]};var _0x183430=_[_0x9b98('0x28')](db[_0x9b98('0x2f')]['rawAttributes'],function(_0x3b0b8a){return{'name':_0x3b0b8a[_0x9b98('0x30')],'type':_0x3b0b8a[_0x9b98('0x31')][_0x9b98('0x32')]};});_0x3a9ed9[_0x9b98('0x33')]=_[_0x9b98('0x28')](_0x183430,_0x9b98('0x26'));_0x3a9ed9['query']=_[_0x9b98('0x34')](_0x2264a3[_0x9b98('0x35')]);_0x3a9ed9['filters']=_['intersection'](_0x3a9ed9[_0x9b98('0x33')],_0x3a9ed9[_0x9b98('0x35')]);_0x232309[_0x9b98('0x36')]=_[_0x9b98('0x37')](_0x3a9ed9[_0x9b98('0x33')],qs[_0x9b98('0x38')](_0x2264a3[_0x9b98('0x35')][_0x9b98('0x38')]));_0x232309['attributes']=_0x232309[_0x9b98('0x36')][_0x9b98('0x39')]?_0x232309[_0x9b98('0x36')]:_0x3a9ed9[_0x9b98('0x33')];if(!_0x2264a3[_0x9b98('0x35')][_0x9b98('0x3a')](_0x9b98('0x3b'))){_0x232309[_0x9b98('0x1e')]=qs[_0x9b98('0x1e')](_0x2264a3[_0x9b98('0x35')][_0x9b98('0x1e')]);_0x232309['offset']=qs[_0x9b98('0x1c')](_0x2264a3[_0x9b98('0x35')][_0x9b98('0x1c')]);}_0x232309['order']=qs[_0x9b98('0x3c')](_0x2264a3[_0x9b98('0x35')][_0x9b98('0x3c')]);_0x232309['where']=qs[_0x9b98('0x3d')](_['pick'](_0x2264a3[_0x9b98('0x35')],_0x3a9ed9[_0x9b98('0x3d')]),_0x183430);var _0x3ac90c=[];var _0x2ee958=squel[_0x9b98('0x3e')]()[_0x9b98('0x3f')]('id')[_0x9b98('0x3f')](_0x9b98('0x26'))['field']('color')['from'](_0x9b98('0x40'));var _0x616f18=squel[_0x9b98('0x3e')]()['field'](_0x9b98('0x41'))[_0x9b98('0x3f')](_0x9b98('0x42'))['field'](_0x9b98('0x43'))[_0x9b98('0x44')](_0x9b98('0x45'),'ui')[_0x9b98('0x46')](_0x9b98('0x47'),'u',_0x9b98('0x48'));var _0x1407f7=squel[_0x9b98('0x3e')]()[_0x9b98('0x44')](_0x9b98('0x49'),'i')[_0x9b98('0x46')](_0x9b98('0x4a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9b98('0x46')](_0x9b98('0x47'),'o',_0x9b98('0x4b'))[_0x9b98('0x46')](_0x9b98('0x4c'),'a','a.id\x20=\x20i.SmsAccountId')[_0x9b98('0x46')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x9b98('0x46')]('sms_interaction_has_tags','it',_0x9b98('0x4d'))[_0x9b98('0x46')](_0x9b98('0x40'),'t','t.id\x20=\x20it.TagId');var _0x43b124=squel[_0x9b98('0x4e')]();var _0x2055d7=[];var _0xedcd41=squel[_0x9b98('0x4e')]();var _0x4c5e14;if(_0x2264a3[_0x9b98('0x35')][_0x9b98('0x4f')]){_0x4c5e14=as[_0x9b98('0x50')](_0x2264a3['query']['search']);var _0x2dae0c=_0x4c5e14[_0x9b98('0x51')];for(var _0x405053=0x0;_0x405053<_0x4c5e14[_0x9b98('0x52')]['length'];_0x405053++){var _0x26ec54=_0x4c5e14[_0x9b98('0x52')][_0x405053];var _0x323511='i';var _0x122f7c=_['find'](_0x183430,['name',_0x26ec54['field']]);if(!_0x122f7c){switch(_0x26ec54[_0x9b98('0x3f')]){case _0x9b98('0x53'):if(_0x26ec54[_0x9b98('0x54')]==0x1){_0x1407f7['having']('`'+_0x26ec54[_0x9b98('0x3f')]+_0x9b98('0x55'));}else{_0x1407f7[_0x9b98('0x56')]('`'+_0x26ec54[_0x9b98('0x3f')]+_0x9b98('0x57'));}break;case _0x9b98('0x58'):if(_0x26ec54['operator']===_0x9b98('0x59')){if(_0x26ec54[_0x9b98('0x54')][_0x9b98('0x2c')]('\x20')['length']>0x1){_0x43b124[_0x2dae0c](_0x9b98('0x5a'),qs[_0x9b98('0x5b')](_0x26ec54['value']),null);}else{var _0x19da0b='%'+_0x26ec54[_0x9b98('0x54')]+'%';_0x43b124[_0x2dae0c](_0x9b98('0x5c'),_0x19da0b,_0x19da0b,_0x19da0b);}}else{_0x122f7c=_[_0x9b98('0x5d')](_0x183430,[_0x9b98('0x26'),_0x9b98('0x5e')]);_0x26ec54[_0x9b98('0x3f')]='ContactId';_0x4ba93a=as[_0x9b98('0x5f')](_0x323511,_0x122f7c['type'],_0x26ec54);_0x43b124[_0x2dae0c](_0x4ba93a[_0x9b98('0x60')],_0x4ba93a['value'][_0x9b98('0x61')],_0x4ba93a['value'][_0x9b98('0x19')]);}break;case _0x9b98('0x62'):var _0x1c2c43=_0x26ec54['value'][_0x9b98('0x2c')](',')[_0x9b98('0x28')](function(_0x3e5eda){return Number(_0x3e5eda);});_0x1c2c43[_0x9b98('0x63')](function(_0x314e7f){_0xedcd41['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x314e7f+',%');});_0x2055d7=_['union'](_0x2055d7,_0x1c2c43);break;case _0x9b98('0x64'):if(_0x26ec54[_0x9b98('0x65')]===_0x9b98('0x59')){_0x43b124[_0x2dae0c](_0x9b98('0x66'),'%'+_0x26ec54['value']+'%',null);}else{_0x122f7c=_[_0x9b98('0x5d')](_0x183430,[_0x9b98('0x26'),_0x9b98('0x67')]);_0x26ec54[_0x9b98('0x3f')]='UserId';_0x4ba93a=as['buildExpression'](_0x323511,_0x122f7c[_0x9b98('0x31')],_0x26ec54);_0x43b124[_0x2dae0c](_0x4ba93a['text'],_0x4ba93a['value'][_0x9b98('0x61')],_0x4ba93a[_0x9b98('0x54')]['end']);}break;case'body':_0x4ba93a=as['buildExpression']('me',null,_0x26ec54);_0x43b124[_0x2dae0c](_0x4ba93a['text'],_0x4ba93a[_0x9b98('0x54')][_0x9b98('0x61')],_0x4ba93a[_0x9b98('0x54')][_0x9b98('0x19')]);break;}}else{var _0x4ba93a=as['buildExpression'](_0x323511,_0x122f7c[_0x9b98('0x31')],_0x26ec54);_0x43b124[_0x2dae0c](_0x4ba93a[_0x9b98('0x60')],_0x4ba93a[_0x9b98('0x54')]['start'],_0x4ba93a['value'][_0x9b98('0x19')]);}}}else{var _0x20c13e=_(_0x2264a3['query'])[_0x9b98('0x34')]()['map'](function(_0x40e551){return _[_0x9b98('0x68')](_0x183430,[_0x9b98('0x26'),_0x40e551])?_0x40e551:undefined;})['compact']()[_0x9b98('0x54')]();if(!_[_0x9b98('0x69')](_0x20c13e)){_0x20c13e[_0x9b98('0x63')](function(_0x3a985d){if(_0x3a985d===_0x9b98('0x6a')){_0x1407f7[_0x9b98('0x6b')](_0x9b98('0x6c'),[][_0x9b98('0x6d')](_0x2264a3['query'][_0x3a985d]));}else if(_0x3a985d==='createdAt'){var _0x8a705b=JSON['parse'](_0x2264a3['query'][_0x3a985d])['$gte'];var _0x5dffe7=JSON[_0x9b98('0x6e')](_0x2264a3['query'][_0x3a985d])[_0x9b98('0x6f')];_0x1407f7[_0x9b98('0x6b')](_0x9b98('0x70'),_0x8a705b,_0x5dffe7);}else{if(_0x2264a3[_0x9b98('0x35')][_0x3a985d]===_0x9b98('0x71')){_0x1407f7['where']('i.'+_0x3a985d+_0x9b98('0x72'));}else{_0x1407f7[_0x9b98('0x6b')]('i.'+_0x3a985d+_0x9b98('0x73'),_0x2264a3[_0x9b98('0x35')][_0x3a985d]);}}});}if(_0x2264a3[_0x9b98('0x35')]['read']){if(_0x2264a3[_0x9b98('0x35')][_0x9b98('0x74')]==0x1){_0x1407f7[_0x9b98('0x56')]('`unreadMessages`\x20=\x200');}else{_0x1407f7[_0x9b98('0x56')]('`unreadMessages`\x20>\x200');}}if(_0x2264a3[_0x9b98('0x35')][_0x9b98('0x75')]){_0x2055d7=_[_0x9b98('0x76')](_0x2264a3[_0x9b98('0x35')]['tag'])?_0x2264a3[_0x9b98('0x35')][_0x9b98('0x75')]:new Array(_0x2264a3[_0x9b98('0x35')][_0x9b98('0x75')]);_0x2055d7[_0x9b98('0x63')](function(_0x3c7502){_0xedcd41['or'](_0x9b98('0x77'),'%,'+_0x3c7502+',%');});}if(_0x2264a3[_0x9b98('0x35')][_0x9b98('0x78')]){var _0x1d1eaf=_0x2264a3['query'][_0x9b98('0x78')][_0x9b98('0x79')]('\x5c','\x5c\x5c')[_0x9b98('0x79')](/'/g,'\x27\x27');if(qs[_0x9b98('0x7a')](_0x1d1eaf)){_0x43b124['or']('i.id\x20LIKE\x20?',_0x1d1eaf+'%')['or']('i.phone\x20LIKE\x20?',_0x1d1eaf+'%');}else{_0x43b124['or'](_0x9b98('0x7b'),qs[_0x9b98('0x5b')](_0x1d1eaf))['or'](_0x9b98('0x7c'),_0x1d1eaf+'%');}}}_0x1407f7['where'](_0x43b124);_0x1407f7[_0x9b98('0x7d')](_0x9b98('0x7e'));var _0x278107={'type':db[_0x9b98('0x7f')][_0x9b98('0x80')][_0x9b98('0x81')],'raw':!![]};var _0x37723c=_0x1407f7[_0x9b98('0x82')]();_0x37723c[_0x9b98('0x3f')]('i.id');_0x37723c['field'](_0x9b98('0x83'),_0x9b98('0x53'));if(_0x232309['order']){_0x232309[_0x9b98('0x84')][_0x9b98('0x63')](function(_0x3b1902){var _0x5f5a6a=_0x3b1902[0x0]===_0x9b98('0x85')?_0x3b1902[0x0]:'i.'+_0x3b1902[0x0];_0x1407f7[_0x9b98('0x84')](_0x5f5a6a,_0x3b1902[0x1]===_0x9b98('0x86')?![]:!![]);});}if(!_['isEmpty'](_0x2055d7)){_0x1407f7[_0x9b98('0x56')](_0xedcd41);_0x37723c[_0x9b98('0x6b')](_0x9b98('0x87'),_0x2055d7);}BPromise[_0x9b98('0x88')]()['then'](function(){if(!_0x4c5e14){if(_0x2264a3['query'][_0x9b98('0x6a')])return;_0x37723c['where'](_0x9b98('0x89'));_0x1407f7['where'](_0x9b98('0x89'));return;}if(_0x2264a3[_0x9b98('0x8a')][_0x9b98('0x8b')]!=='agent')return;return _0x2264a3[_0x9b98('0x8a')][_0x9b98('0x8c')]({'attributes':['id'],'raw':!![]})[_0x9b98('0x2e')](function(_0x5cc005){if(_['isEmpty'](_0x5cc005)){_0x37723c[_0x9b98('0x6b')](_0x9b98('0x8d'));_0x1407f7['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x37723c['where']('i.SmsAccountId\x20IN\x20?',_[_0x9b98('0x28')](_0x5cc005,'id'));_0x1407f7[_0x9b98('0x6b')](_0x9b98('0x6c'),_['map'](_0x5cc005,'id'));}});})['then'](function(){if(_0x2264a3[_0x9b98('0x8a')][_0x9b98('0x8b')]===_0x9b98('0x8e')&&!_0x4c5e14&&!_0x2264a3[_0x9b98('0x35')]['SmsAccountId'])return[];return db['sequelize']['query'](_0x37723c[_0x9b98('0x8f')](),_0x278107);})[_0x9b98('0x2e')](function(_0x342442){_0x425711[_0x9b98('0x1f')]=_0x342442[_0x9b98('0x39')];if(_0x425711['count']===0x0)return[];return db['sequelize'][_0x9b98('0x35')](_0x2ee958[_0x9b98('0x8f')](),_0x278107)[_0x9b98('0x2e')](function(_0x459e15){_0x3ac90c=_['keyBy'](_0x459e15,'id');_0x278107=_[_0x9b98('0x90')](_0x278107,{'model':db[_0x9b98('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2264a3[_0x9b98('0x35')]['fields']){_0x232309[_0x9b98('0x36')][_0x9b98('0x63')](function(_0x266079){_0x1407f7[_0x9b98('0x3f')]('i.'+_0x266079);});}else{_0x1407f7[_0x9b98('0x3f')](_0x9b98('0x83'),_0x9b98('0x53'));_0x1407f7['field']('a.key','Account.key');_0x1407f7[_0x9b98('0x3f')](_0x9b98('0x91'),_0x9b98('0x92'));_0x1407f7['field'](_0x9b98('0x93'),_0x9b98('0x85'));_0x1407f7[_0x9b98('0x3f')](_0x9b98('0x94'));_0x1407f7[_0x9b98('0x3f')](_0x9b98('0x95'),_0x9b98('0x96'));_0x1407f7['field'](_0x9b98('0x97'),'Contact.lastName');_0x1407f7[_0x9b98('0x3f')](_0x9b98('0x98'),_0x9b98('0x99'));_0x1407f7['field'](_0x9b98('0x9a'),'Contact.phone');_0x1407f7['field'](_0x9b98('0x9b'),_0x9b98('0x9c'));_0x1407f7[_0x9b98('0x3f')]('c.fax','Contact.fax');_0x1407f7[_0x9b98('0x3f')](_0x9b98('0x9d'),_0x9b98('0x9e'));_0x1407f7['field'](_0x9b98('0x9f'),_0x9b98('0xa0'));_0x1407f7[_0x9b98('0x3f')](_0x9b98('0xa1'),'TagIds');}if(_0x232309[_0x9b98('0x1e')])_0x1407f7['limit'](_0x232309[_0x9b98('0x1e')]);if(_0x232309['offset'])_0x1407f7[_0x9b98('0x1c')](_0x232309[_0x9b98('0x1c')]);return db['sequelize'][_0x9b98('0x35')](_0x1407f7[_0x9b98('0x8f')](),_0x278107);})[_0x9b98('0x2e')](function(_0x3de868){if(_0x3de868[_0x9b98('0x39')]>0x0)_0x616f18[_0x9b98('0x6b')](_0x9b98('0xa2'),_['map'](_0x3de868,'id'));return db[_0x9b98('0xa3')][_0x9b98('0x35')](_0x616f18[_0x9b98('0x8f')](),_0x278107)[_0x9b98('0x2e')](function(_0x4c70fd){var _0x52d467=_[_0x9b98('0xa4')](_0x4c70fd,_0x9b98('0xa5'));var _0x14b4f2=[];_0x3de868[_0x9b98('0x63')](function(_0x25f5f3){_0x14b4f2[_0x9b98('0x2d')](updateSmsInteraction(_0x25f5f3,_0x3ac90c,_0x52d467));});return BPromise[_0x9b98('0xa6')](_0x14b4f2);});});})['then'](function(_0x37767b){_0x425711[_0x9b98('0xa7')]=_0x37767b;return _0x425711;})[_0x9b98('0x2e')](respondWithFilteredResult(_0x3687b8,_0x232309))[_0x9b98('0xa8')](handleError(_0x3687b8,null));};exports[_0x9b98('0xa9')]=function(_0x22309e,_0x5a9398){var _0x4cdc2e={'raw':![],'where':{'id':_0x22309e['params']['id']}},_0x1e910f={};_0x1e910f[_0x9b98('0x33')]=_[_0x9b98('0x34')](db[_0x9b98('0x2f')][_0x9b98('0xaa')]);_0x1e910f[_0x9b98('0x35')]=_[_0x9b98('0x34')](_0x22309e['query']);_0x1e910f['filters']=_[_0x9b98('0x37')](_0x1e910f['model'],_0x1e910f[_0x9b98('0x35')]);_0x4cdc2e[_0x9b98('0x36')]=_[_0x9b98('0x37')](_0x1e910f[_0x9b98('0x33')],qs['fields'](_0x22309e[_0x9b98('0x35')][_0x9b98('0x38')]));_0x4cdc2e[_0x9b98('0x36')]=_0x4cdc2e[_0x9b98('0x36')][_0x9b98('0x39')]?_0x4cdc2e['attributes']:_0x1e910f['model'];if(_0x22309e[_0x9b98('0x35')][_0x9b98('0xab')]){_0x4cdc2e[_0x9b98('0xac')]=[{'all':!![]}];}_0x4cdc2e=_[_0x9b98('0x90')]({},_0x4cdc2e,_0x22309e[_0x9b98('0xad')]);return db['SmsInteraction']['find'](_0x4cdc2e)[_0x9b98('0x2e')](handleEntityNotFound(_0x5a9398,null))[_0x9b98('0x2e')](respondWithResult(_0x5a9398,null))[_0x9b98('0xa8')](handleError(_0x5a9398,null));};exports['create']=function(_0x1e83c1,_0x3b1f63){return db[_0x9b98('0x2f')]['create'](_0x1e83c1['body'],{})[_0x9b98('0x2e')](respondWithResult(_0x3b1f63,0xc9))[_0x9b98('0xa8')](handleError(_0x3b1f63,null));};exports[_0x9b98('0x23')]=function(_0x2c8c8e,_0x28acb5){if(_0x2c8c8e[_0x9b98('0xae')]['id']){delete _0x2c8c8e['body']['id'];}return db[_0x9b98('0x2f')][_0x9b98('0x5d')]({'where':{'id':_0x2c8c8e[_0x9b98('0xaf')]['id']}})[_0x9b98('0x2e')](handleEntityNotFound(_0x28acb5,null))[_0x9b98('0x2e')](saveUpdates(_0x2c8c8e[_0x9b98('0xae')],null))[_0x9b98('0x2e')](respondWithResult(_0x28acb5,null))[_0x9b98('0xa8')](handleError(_0x28acb5,null));};exports['destroy']=function(_0x14e4f3,_0x326a84){return db['SmsInteraction'][_0x9b98('0x5d')]({'where':{'id':_0x14e4f3[_0x9b98('0xaf')]['id']}})[_0x9b98('0x2e')](handleEntityNotFound(_0x326a84,null))['then'](removeEntity(_0x326a84,null))['catch'](handleError(_0x326a84,null));};exports[_0x9b98('0xb0')]=function(_0x12c7e6,_0xaa1519){return db[_0x9b98('0x2f')][_0x9b98('0xb0')]()[_0x9b98('0x2e')](respondWithResult(_0xaa1519,null))[_0x9b98('0xa8')](handleError(_0xaa1519,null));};exports[_0x9b98('0xb1')]=function(_0xb9b0a9,_0x86ef4e,_0x157a0f){return db[_0x9b98('0xb2')][_0x9b98('0x5d')]({'where':{'id':_0xb9b0a9[_0x9b98('0xaf')]['id']}})[_0x9b98('0x2e')](handleEntityNotFound(_0x86ef4e,null))[_0x9b98('0x2e')](function(_0x4d9101){if(_0x4d9101){return _0x4d9101[_0x9b98('0xb1')](_0xb9b0a9[_0x9b98('0xae')][_0x9b98('0xb3')],_[_0x9b98('0xb4')](_0xb9b0a9['body'],[_0x9b98('0xb3'),'id'])||{});}})['then'](respondWithResult(_0x86ef4e,null))[_0x9b98('0xa8')](handleError(_0x86ef4e,null));};exports['getMessages']=function(_0x151cb6,_0x50d860,_0xb3a714){var _0xc24440={'raw':![],'where':{}};var _0x1be074={};var _0x319292={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x151cb6[_0x9b98('0xaf')]['id']}})[_0x9b98('0x2e')](handleEntityNotFound(_0x50d860,null))[_0x9b98('0x2e')](function(_0x321e9c){if(_0x321e9c){_0x1be074['model']=_['keys'](db['SmsMessage']['rawAttributes']);_0x1be074['query']=_['keys'](_0x151cb6['query']);_0x1be074[_0x9b98('0x3d')]=_[_0x9b98('0x37')](_0x1be074[_0x9b98('0x33')],_0x1be074[_0x9b98('0x35')]);_0xc24440['attributes']=_['intersection'](_0x1be074[_0x9b98('0x33')],qs[_0x9b98('0x38')](_0x151cb6[_0x9b98('0x35')]['fields']));_0xc24440[_0x9b98('0x36')]=_0xc24440['attributes']['length']?_0xc24440[_0x9b98('0x36')]:_0x1be074[_0x9b98('0x33')];if(!_0x151cb6[_0x9b98('0x35')][_0x9b98('0x3a')](_0x9b98('0x3b'))){_0xc24440['limit']=qs[_0x9b98('0x1e')](_0x151cb6[_0x9b98('0x35')]['limit']);_0xc24440[_0x9b98('0x1c')]=qs[_0x9b98('0x1c')](_0x151cb6['query'][_0x9b98('0x1c')]);}_0xc24440['order']=qs[_0x9b98('0x3c')](_0x151cb6[_0x9b98('0x35')][_0x9b98('0x3c')]);_0xc24440['where']=qs['filters'](_[_0x9b98('0xb5')](_0x151cb6[_0x9b98('0x35')],_0x1be074[_0x9b98('0x3d')]));_0xc24440[_0x9b98('0x6b')]['SmsInteractionId']=_0x321e9c['id'];if(_0x151cb6[_0x9b98('0x35')][_0x9b98('0x78')]){_0xc24440[_0x9b98('0x6b')]=_[_0x9b98('0x90')](_0xc24440[_0x9b98('0x6b')],{'$or':_[_0x9b98('0x28')](_0xc24440[_0x9b98('0x36')],function(_0x167370){var _0x320d70={};_0x320d70[_0x167370]={'$like':'%'+_0x151cb6['query'][_0x9b98('0x78')]+'%'};return _0x320d70;})});}if(_0x151cb6[_0x9b98('0x35')][_0x9b98('0xb6')]){var _0x766a17=_0x151cb6[_0x9b98('0x35')][_0x9b98('0xb6')][_0x9b98('0x2c')](',');var _0x479911={};_0x479911[_0x766a17[0x0]]={'$gte':moment(_0x766a17[0x1])[_0x9b98('0xb7')](_0x9b98('0xb8'))};_0xc24440[_0x9b98('0x6b')]=_['merge'](_0xc24440[_0x9b98('0x6b')],_0x479911);}_0xc24440=_['merge']({},_0xc24440,_0x151cb6['options']);return db[_0x9b98('0xb2')]['count']({'where':_0xc24440['where']})['then'](function(_0x3dffc4){_0x319292[_0x9b98('0x1f')]=_0x3dffc4;if(_0x151cb6[_0x9b98('0x35')][_0x9b98('0xab')]){_0xc24440[_0x9b98('0xac')]=[{'all':!![]}];}return db[_0x9b98('0xb2')][_0x9b98('0xb9')](_0xc24440);})[_0x9b98('0x2e')](function(_0x1af532){_0x319292['rows']=_0x1af532;return _0x319292;});}})['then'](respondWithFilteredResult(_0x50d860,_0xc24440))[_0x9b98('0xa8')](handleError(_0x50d860,null));};exports[_0x9b98('0xba')]=function(_0x678df5,_0x3d2b5a,_0xd85b02){return db[_0x9b98('0x2f')]['find']({'where':{'id':_0x678df5[_0x9b98('0xaf')]['id']}})[_0x9b98('0x2e')](handleEntityNotFound(_0x3d2b5a,null))[_0x9b98('0x2e')](function(_0x5787e5){if(_0x5787e5){return _0x5787e5[_0x9b98('0xbb')](_0x678df5[_0x9b98('0xae')][_0x9b98('0xb3')],_['omit'](_0x678df5[_0x9b98('0xae')],['ids','id'])||{})[_0x9b98('0xbc')](function(){return db[_0x9b98('0x62')][_0x9b98('0xb9')]({'attributes':['id','name',_0x9b98('0xbd')],'where':{'id':_0x678df5['body']['ids']}});})[_0x9b98('0x2e')](function(_0x58a254){socket[_0x9b98('0xbe')](_0x9b98('0xbf'),{'id':Number(_0x678df5[_0x9b98('0xaf')]['id']),'tags':_0x58a254||[]});return{'id':Number(_0x678df5['params']['id']),'tags':_0x58a254||[]};});}})[_0x9b98('0x2e')](respondWithResult(_0x3d2b5a,null))[_0x9b98('0xa8')](handleError(_0x3d2b5a,null));};exports[_0x9b98('0xc0')]=function(_0x20f4ee,_0x27e428,_0x3c8728){return db[_0x9b98('0x2f')][_0x9b98('0x5d')]({'where':{'id':_0x20f4ee[_0x9b98('0xaf')]['id']}})[_0x9b98('0x2e')](handleEntityNotFound(_0x27e428,null))[_0x9b98('0x2e')](function(_0x42397a){if(_0x42397a){return _0x42397a[_0x9b98('0xc0')](_0x20f4ee[_0x9b98('0x35')][_0x9b98('0xb3')]);}})['then'](respondWithStatusCode(_0x27e428,null))['catch'](handleError(_0x27e428,null));};exports[_0x9b98('0xc1')]=function(_0x590a5f,_0x396f11){var _0x11bd8c=moment()[_0x9b98('0xc2')]()[_0x9b98('0x8f')]();var _0x282756=path[_0x9b98('0xc3')](config[_0x9b98('0xc4')],'server','files',_0x9b98('0xc5'));var _0x24fa4d=path[_0x9b98('0xc3')](config[_0x9b98('0xc4')],_0x9b98('0xc6'),_0x9b98('0xc7'),_0x9b98('0xc8'));var _0x417ca7=path[_0x9b98('0xc3')](_0x282756,_0x11bd8c);var _0x1c1420=util['format'](_0x9b98('0xc9'),_0x590a5f[_0x9b98('0xaf')]['id'],_0x11bd8c);var _0x4d8bca=path[_0x9b98('0xc3')](_0x282756,_0x1c1420);var _0x7748d9=[];_0x7748d9['push']({'model':db[_0x9b98('0x64')],'as':_0x9b98('0x64'),'attributes':['id',_0x9b98('0x29')],'raw':!![]});_0x7748d9[_0x9b98('0x2d')]({'model':db[_0x9b98('0xca')],'as':_0x9b98('0x58'),'attributes':['id',_0x9b98('0xcb'),'lastName'],'raw':!![]});var _0xccfea5=[{'model':db[_0x9b98('0xb2')],'as':_0x9b98('0xcc'),'attributes':['id','body','createdAt',_0x9b98('0xcd'),_0x9b98('0xce'),_0x9b98('0x74')],'include':_0x7748d9}];_0xccfea5['push']({'model':db['SmsAccount'],'as':_0x9b98('0xcf'),'attributes':['id',_0x9b98('0x26')]});_0xccfea5['push']({'model':db[_0x9b98('0x64')],'as':_0x9b98('0xd0'),'attributes':['id',_0x9b98('0x29')]});return db[_0x9b98('0x2f')]['find']({'where':{'id':_0x590a5f[_0x9b98('0xaf')]['id']},'include':_0xccfea5})[_0x9b98('0x2e')](handleEntityNotFound(_0x396f11,null))[_0x9b98('0x2e')](function(_0x306ba1){if(_0x306ba1){var _0x10456d=_0x306ba1['get']({'plain':!![]});fs[_0x9b98('0xd1')](_0x417ca7);var _0x2fd08f={'channel':_0x9b98('0xd2'),'account':_0x10456d[_0x9b98('0xcf')][_0x9b98('0x26')],'agent':_0x10456d[_0x9b98('0xd0')]?_0x10456d[_0x9b98('0xd0')]['fullname']:_0x9b98('0xd3'),'createdAt':moment(_0x10456d[_0x9b98('0xd4')])[_0x9b98('0xb7')](_0x9b98('0xb8'))[_0x9b98('0x8f')](),'closedAt':_0x10456d[_0x9b98('0xd5')]?moment(_0x10456d[_0x9b98('0xd6')])[_0x9b98('0xb7')](_0x9b98('0xb8'))[_0x9b98('0x8f')]():'','disposition':_0x10456d[_0x9b98('0xd7')],'messages':_(_0x10456d[_0x9b98('0xcc')])[_0x9b98('0x78')]({'secret':![]})['map'](function(_0x53be35){return{'date':moment(_0x53be35[_0x9b98('0xd4')])[_0x9b98('0xb7')](_0x9b98('0xb8'))[_0x9b98('0x8f')](),'sender':_0x53be35['direction']===_0x9b98('0xd8')?_0x53be35[_0x9b98('0x64')]?_0x53be35[_0x9b98('0x64')][_0x9b98('0x29')]:_0x9b98('0xd9'):_0x53be35[_0x9b98('0x58')][_0x9b98('0xcb')]+(_0x53be35['Contact'][_0x9b98('0xda')]?'\x20'+_0x53be35[_0x9b98('0x58')][_0x9b98('0xda')]:''),'body':_0x53be35[_0x9b98('0xae')],'direction':_0x53be35[_0x9b98('0xcd')]==='out'?'A':'C','secret':_0x53be35[_0x9b98('0xce')],'read':_0x53be35['read']};})['value']()};return ejs[_0x9b98('0xdb')](path['join'](config[_0x9b98('0xc4')],_0x9b98('0xc6'),_0x9b98('0xdc'),'downloadInteraction.ejs'),{'interaction':_0x2fd08f})[_0x9b98('0x2e')](function(_0x2558d2){var _0xbeb4bb=path[_0x9b98('0xc3')](_0x417ca7,_0x9b98('0xdd')+_0x10456d['id']+'-'+_0x11bd8c+_0x9b98('0xde'));var _0x5e981a={'path':_0xbeb4bb,'channel':_0x9b98('0xd2'),'interactionId':_0x10456d['id']};return pdf[_0x9b98('0xdf')](_0x2558d2,_0x5e981a);})[_0x9b98('0x2e')](function(){return new BPromise(function(_0x596269,_0xa8a095){zipdir(_0x417ca7,{'saveTo':_0x4d8bca},function(_0x3f887a,_0x218599){if(_0x3f887a)return _0xa8a095(_0x3f887a);return _0x596269(_0x218599);});})['then'](function(){return new BPromise(function(_0x32d19e,_0x3e3bf7){rimraf(_0x417ca7,function(_0x5dc0f8){if(_0x5dc0f8)_0x3e3bf7(_0x5dc0f8);return _0x32d19e();});});})['then'](function(){return _0x396f11['download'](_0x4d8bca,_0x1c1420,function(_0x13b56a){if(_0x13b56a){console['log'](_0x9b98('0xe0'),_0x13b56a);}else{fs[_0x9b98('0xe1')](_0x4d8bca);}});});});}else{return _0x396f11[_0x9b98('0x18')](0xc8);}})[_0x9b98('0xa8')](handleError(_0x396f11,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index e5aab84..dee7f08 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 _0x1c7c=['../../mysqldb','SmsInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x2eccb2,_0x5d279b){var _0x3b658d=function(_0x45a97c){while(--_0x45a97c){_0x2eccb2['push'](_0x2eccb2['shift']());}};_0x3b658d(++_0x5d279b);}(_0x1c7c,0x164));var _0xc1c7=function(_0x34aad7,_0x554089){_0x34aad7=_0x34aad7-0x0;var _0x22560d=_0x1c7c[_0x34aad7];return _0x22560d;};'use strict';var EventEmitter=require(_0xc1c7('0x0'));var SmsInteraction=require(_0xc1c7('0x1'))['db'][_0xc1c7('0x2')];var SmsMessage=require(_0xc1c7('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc1c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc1c7('0x4'),'afterDestroy':_0xc1c7('0x5')};function emitEvent(_0xbb9da0){return function(_0x2a0383,_0x42e930,_0x364dde){_0x2a0383[_0xc1c7('0x6')]({'attributes':['id'],'raw':!![]})[_0xc1c7('0x7')](function(_0xce5bcd){_0x2a0383[_0xc1c7('0x8')](_0xc1c7('0x9'),_0xce5bcd[_0xc1c7('0xa')](function(_0x92e892){return{'id':_0x92e892['id']};}));return SmsMessage[_0xc1c7('0xb')]({'where':{'SmsInteractionId':_0x2a0383['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc1c7('0x7')](function(_0x301abf){_0x2a0383[_0xc1c7('0x8')]('unreadMessages',_0x301abf[_0xc1c7('0xc')]);SmsInteractionEvents[_0xc1c7('0xd')](_0xbb9da0+':'+_0x2a0383['id'],_0x2a0383);SmsInteractionEvents['emit'](_0xbb9da0,_0x2a0383);_0x364dde(null);})[_0xc1c7('0xe')](_0x364dde(null));};}for(var e in events){if(events[_0xc1c7('0xf')](e)){var event=events[e];SmsInteraction[_0xc1c7('0x10')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xb03e=['SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction'];(function(_0x1b0c7c,_0x468383){var _0x44f649=function(_0x56fbc6){while(--_0x56fbc6){_0x1b0c7c['push'](_0x1b0c7c['shift']());}};_0x44f649(++_0x468383);}(_0xb03e,0x1eb));var _0xeb03=function(_0x5da997,_0x243992){_0x5da997=_0x5da997-0x0;var _0x232b51=_0xb03e[_0x5da997];return _0x232b51;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xeb03('0x0'))['db'][_0xeb03('0x1')];var SmsMessage=require(_0xeb03('0x0'))['db'][_0xeb03('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xeb03('0x3')](0x0);var events={'afterCreate':_0xeb03('0x4'),'afterUpdate':_0xeb03('0x5'),'afterDestroy':_0xeb03('0x6')};function emitEvent(_0x474450){return function(_0x3ba4b0,_0x88925b,_0xee2291){_0x3ba4b0['getUsers']({'attributes':['id'],'raw':!![]})[_0xeb03('0x7')](function(_0x3d3322){_0x3ba4b0[_0xeb03('0x8')](_0xeb03('0x9'),_0x3d3322[_0xeb03('0xa')](function(_0x28c772){return{'id':_0x28c772['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3ba4b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb03('0x7')](function(_0x99f4e2){_0x3ba4b0[_0xeb03('0x8')]('unreadMessages',_0x99f4e2[_0xeb03('0xb')]);SmsInteractionEvents['emit'](_0x474450+':'+_0x3ba4b0['id'],_0x3ba4b0);SmsInteractionEvents[_0xeb03('0xc')](_0x474450,_0x3ba4b0);_0xee2291(null);})[_0xeb03('0xd')](_0xee2291(null));};}for(var e in events){if(events[_0xeb03('0xe')](e)){var event=events[e];SmsInteraction[_0xeb03('0xf')](e,emitEvent(event));}}module[_0xeb03('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 cb29852..841c9ab 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 _0xfcb6=['request-promise','path','rimraf','./smsInteraction.attributes','exports','define','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xfcb6,0x13e));var _0x6fcb=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xfcb6[_0x80f51a];return _0x327148;};'use strict';var _=require(_0x6fcb('0x0'));var util=require(_0x6fcb('0x1'));var logger=require('../../config/logger')(_0x6fcb('0x2'));var moment=require('moment');var BPromise=require(_0x6fcb('0x3'));var rp=require(_0x6fcb('0x4'));var fs=require('fs');var path=require(_0x6fcb('0x5'));var rimraf=require(_0x6fcb('0x6'));var config=require('../../config/environment');var attributes=require(_0x6fcb('0x7'));module[_0x6fcb('0x8')]=function(_0x33a71f,_0x58d5f7){return _0x33a71f[_0x6fcb('0x9')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fd3a2,_0x31089f,_0x10ca78){if(_0x2fd3a2[_0x6fcb('0xa')](_0x6fcb('0xb'))){_0x2fd3a2[_0x6fcb('0xc')]=moment()['format'](_0x6fcb('0xd'));}_0x10ca78(null,_0x2fd3a2);}}});}; \ No newline at end of file +var _0xe326=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x5e8ad7,_0x22be89){var _0x591cb4=function(_0x5969a5){while(--_0x5969a5){_0x5e8ad7['push'](_0x5e8ad7['shift']());}};_0x591cb4(++_0x22be89);}(_0xe326,0x11e));var _0x6e32=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0xe326[_0x2e41e2];return _0x2844d6;};'use strict';var _=require(_0x6e32('0x0'));var util=require(_0x6e32('0x1'));var logger=require('../../config/logger')(_0x6e32('0x2'));var moment=require(_0x6e32('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6e32('0x5'));var attributes=require(_0x6e32('0x6'));module['exports']=function(_0x1997c6,_0x314e5c){return _0x1997c6[_0x6e32('0x7')](_0x6e32('0x8'),attributes,{'tableName':_0x6e32('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xfffb99,_0x16422d,_0x9bda88){if(_0xfffb99[_0x6e32('0xa')](_0x6e32('0xb'))){_0xfffb99[_0x6e32('0xc')]=moment()[_0x6e32('0xd')](_0x6e32('0xe'));}_0x9bda88(null,_0xfffb99);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2e82cf3..316fa36 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 _0xd05f=['defaults','redis','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x370c97,_0x3868a6){var _0x7b6b1e=function(_0x79d9bb){while(--_0x79d9bb){_0x370c97['push'](_0x370c97['shift']());}};_0x7b6b1e(++_0x3868a6);}(_0xd05f,0x10f));var _0xfd05=function(_0x4b5ab4,_0x43cd7d){_0x4b5ab4=_0x4b5ab4-0x0;var _0x2aad8a=_0xd05f[_0x4b5ab4];return _0x2aad8a;};'use strict';var _=require('lodash');var util=require(_0xfd05('0x0'));var moment=require(_0xfd05('0x1'));var BPromise=require(_0xfd05('0x2'));var rs=require(_0xfd05('0x3'));var fs=require('fs');var Redis=require(_0xfd05('0x4'));var db=require(_0xfd05('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd05('0x6'));var config=require(_0xfd05('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfd05('0x8')]['http']({'port':0x232a});config['redis']=_[_0xfd05('0x9')](config[_0xfd05('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfd05('0xb'))[_0xfd05('0xc')](socket);function respondWithRpcPromise(_0x40228a,_0x3e1a67,_0x4487be){return new BPromise(function(_0x176d2f,_0x527616){return client[_0xfd05('0xd')](_0x40228a,_0x4487be)[_0xfd05('0xe')](function(_0x384036){logger[_0xfd05('0xf')](_0xfd05('0x10'),_0x3e1a67,'request\x20sent');logger[_0xfd05('0x11')](_0xfd05('0x12'),_0x3e1a67,_0xfd05('0x13'),JSON[_0xfd05('0x14')](_0x384036));if(_0x384036[_0xfd05('0x15')]){if(_0x384036[_0xfd05('0x15')][_0xfd05('0x16')]===0x1f4){logger[_0xfd05('0x15')](_0xfd05('0x10'),_0x3e1a67,_0x384036[_0xfd05('0x15')][_0xfd05('0x17')]);return _0x527616(_0x384036[_0xfd05('0x15')][_0xfd05('0x17')]);}logger['error'](_0xfd05('0x10'),_0x3e1a67,_0x384036['error']['message']);return _0x176d2f(_0x384036[_0xfd05('0x15')][_0xfd05('0x17')]);}else{logger[_0xfd05('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x3e1a67,_0xfd05('0x13'));_0x176d2f(_0x384036[_0xfd05('0x18')][_0xfd05('0x17')]);}})['catch'](function(_0xa6e3de){logger[_0xfd05('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x3e1a67,_0xa6e3de);_0x527616(_0xa6e3de);});});}exports[_0xfd05('0x19')]=function(_0x458cc2){var _0x362e5e=this;return new Promise(function(_0x4f4218,_0x477949){return db[_0xfd05('0x1a')][_0xfd05('0x1b')](_0x458cc2[_0xfd05('0x1c')],{'raw':_0x458cc2[_0xfd05('0x1d')]?_0x458cc2[_0xfd05('0x1d')][_0xfd05('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x458cc2[_0xfd05('0x1d')]?_0x458cc2[_0xfd05('0x1d')][_0xfd05('0x1f')]||null:null,'attributes':_0x458cc2[_0xfd05('0x1d')]?_0x458cc2['options'][_0xfd05('0x20')]||null:null,'limit':_0x458cc2[_0xfd05('0x1d')]?_0x458cc2[_0xfd05('0x1d')][_0xfd05('0x21')]||null:null})[_0xfd05('0xe')](function(_0x3a5160){logger[_0xfd05('0xf')](_0xfd05('0x19'),_0x458cc2);logger[_0xfd05('0x11')]('UpdateSmsInteraction',_0x458cc2,JSON[_0xfd05('0x14')](_0x3a5160));_0x4f4218(_0x3a5160);})['catch'](function(_0x399b75){logger[_0xfd05('0x15')](_0xfd05('0x19'),_0x399b75[_0xfd05('0x17')],_0x458cc2);_0x477949(_0x362e5e[_0xfd05('0x15')](0x1f4,_0x399b75[_0xfd05('0x17')]));});});};exports[_0xfd05('0x22')]=function(_0xa7d8b8){return new Promise(function(_0x3a3bf5,_0x2c13de){return db[_0xfd05('0x1a')][_0xfd05('0x23')]({'where':_0xa7d8b8[_0xfd05('0x1d')]?_0xa7d8b8[_0xfd05('0x1d')]['where']||null:null})[_0xfd05('0xe')](function(_0x5ae85d){if(_0x5ae85d){return _0x5ae85d[_0xfd05('0x24')](_0xa7d8b8[_0xfd05('0x1c')]['ids'],_[_0xfd05('0x25')](_0xa7d8b8[_0xfd05('0x1c')],['ids','id'])||{});}})[_0xfd05('0x26')](function(_0x32fe91){logger[_0xfd05('0xf')]('AddTags',_0xa7d8b8);logger[_0xfd05('0x11')](_0xfd05('0x27'),_0xa7d8b8,JSON[_0xfd05('0x14')](_0x32fe91));_0x3a3bf5(_0x32fe91);})['catch'](function(_0x3517a2){logger[_0xfd05('0x15')]('AddTags',_0x3517a2['message'],_0xa7d8b8);_0x2c13de(_this[_0xfd05('0x15')](0x1f4,_0x3517a2['message']));});});}; \ No newline at end of file +var _0x18f6=['where','addTags','body','ids','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','update','options','attributes','limit','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','find'];(function(_0x1f5e3b,_0x4617f8){var _0x3a35e7=function(_0x75471f){while(--_0x75471f){_0x1f5e3b['push'](_0x1f5e3b['shift']());}};_0x3a35e7(++_0x4617f8);}(_0x18f6,0x1ce));var _0x618f=function(_0x4f0437,_0x2e16f2){_0x4f0437=_0x4f0437-0x0;var _0x4e3929=_0x18f6[_0x4f0437];return _0x4e3929;};'use strict';var _=require(_0x618f('0x0'));var util=require(_0x618f('0x1'));var moment=require('moment');var BPromise=require(_0x618f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x618f('0x3'));var db=require(_0x618f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x618f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x618f('0x6'));var client=jayson['client'][_0x618f('0x7')]({'port':0x232a});config[_0x618f('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x618f('0x9'))(new Redis(config[_0x618f('0x8')]));require(_0x618f('0xa'))[_0x618f('0xb')](socket);function respondWithRpcPromise(_0x1295f7,_0x289e82,_0x17aa9e){return new BPromise(function(_0x16faa0,_0xbe999b){return client[_0x618f('0xc')](_0x1295f7,_0x17aa9e)[_0x618f('0xd')](function(_0x5871e0){logger['info'](_0x618f('0xe'),_0x289e82,'request\x20sent');logger[_0x618f('0xf')](_0x618f('0x10'),_0x289e82,_0x618f('0x11'),JSON[_0x618f('0x12')](_0x5871e0));if(_0x5871e0[_0x618f('0x13')]){if(_0x5871e0[_0x618f('0x13')][_0x618f('0x14')]===0x1f4){logger[_0x618f('0x13')](_0x618f('0xe'),_0x289e82,_0x5871e0['error'][_0x618f('0x15')]);return _0xbe999b(_0x5871e0[_0x618f('0x13')][_0x618f('0x15')]);}logger[_0x618f('0x13')](_0x618f('0xe'),_0x289e82,_0x5871e0[_0x618f('0x13')][_0x618f('0x15')]);return _0x16faa0(_0x5871e0[_0x618f('0x13')][_0x618f('0x15')]);}else{logger[_0x618f('0x16')](_0x618f('0xe'),_0x289e82,_0x618f('0x11'));_0x16faa0(_0x5871e0[_0x618f('0x17')][_0x618f('0x15')]);}})['catch'](function(_0x3df1ef){logger[_0x618f('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x289e82,_0x3df1ef);_0xbe999b(_0x3df1ef);});});}exports['UpdateSmsInteraction']=function(_0x235298){var _0x4b64f7=this;return new Promise(function(_0xc206b8,_0x158c8a){return db['SmsInteraction'][_0x618f('0x18')](_0x235298['body'],{'raw':_0x235298[_0x618f('0x19')]?_0x235298[_0x618f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235298[_0x618f('0x19')]?_0x235298['options']['where']||null:null,'attributes':_0x235298['options']?_0x235298[_0x618f('0x19')][_0x618f('0x1a')]||null:null,'limit':_0x235298['options']?_0x235298[_0x618f('0x19')][_0x618f('0x1b')]||null:null})[_0x618f('0xd')](function(_0x2325aa){logger[_0x618f('0x16')](_0x618f('0x1c'),_0x235298);logger[_0x618f('0xf')](_0x618f('0x1c'),_0x235298,JSON[_0x618f('0x12')](_0x2325aa));_0xc206b8(_0x2325aa);})[_0x618f('0x1d')](function(_0x2a28e1){logger['error']('UpdateSmsInteraction',_0x2a28e1['message'],_0x235298);_0x158c8a(_0x4b64f7[_0x618f('0x13')](0x1f4,_0x2a28e1[_0x618f('0x15')]));});});};exports[_0x618f('0x1e')]=function(_0x51f558){return new Promise(function(_0x4f002c,_0x4eefeb){return db['SmsInteraction'][_0x618f('0x1f')]({'where':_0x51f558[_0x618f('0x19')]?_0x51f558[_0x618f('0x19')][_0x618f('0x20')]||null:null})[_0x618f('0xd')](function(_0x3da5ed){if(_0x3da5ed){return _0x3da5ed[_0x618f('0x21')](_0x51f558[_0x618f('0x22')][_0x618f('0x23')],_['omit'](_0x51f558[_0x618f('0x22')],['ids','id'])||{});}})[_0x618f('0x24')](function(_0x55e6ba){logger['info'](_0x618f('0x25'),_0x51f558);logger[_0x618f('0xf')]('AddTags',_0x51f558,JSON[_0x618f('0x12')](_0x55e6ba));_0x4f002c(_0x55e6ba);})[_0x618f('0x1d')](function(_0x766dc){logger[_0x618f('0x13')](_0x618f('0x25'),_0x766dc[_0x618f('0x15')],_0x51f558);_0x4eefeb(_this['error'](0x1f4,_0x766dc[_0x618f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 5da1206..6a44464 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 _0xcd26=['remove','removeListener','register','smsInteraction:','./smsInteraction.events','save'];(function(_0xc6ea98,_0x1f0fe7){var _0x154999=function(_0x5c0555){while(--_0x5c0555){_0xc6ea98['push'](_0xc6ea98['shift']());}};_0x154999(++_0x1f0fe7);}(_0xcd26,0x1a8));var _0x6cd2=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0xcd26[_0x83af7f];return _0x32d85c;};'use strict';var SmsInteractionEvents=require(_0x6cd2('0x0'));var events=[_0x6cd2('0x1'),_0x6cd2('0x2'),'update'];function createListener(_0x38e725,_0x57a4b2){return function(_0x50832f){_0x57a4b2['emit'](_0x38e725,_0x50832f);};}function removeListener(_0x52943f,_0xb93790){return function(){SmsInteractionEvents[_0x6cd2('0x3')](_0x52943f,_0xb93790);};}exports[_0x6cd2('0x4')]=function(_0x1454a5){for(var _0x3b5e3f=0x0,_0x2c3fc6=events['length'];_0x3b5e3f<_0x2c3fc6;_0x3b5e3f++){var _0x42045d=events[_0x3b5e3f];var _0x27bbd4=createListener(_0x6cd2('0x5')+_0x42045d,_0x1454a5);SmsInteractionEvents['on'](_0x42045d,_0x27bbd4);}}; \ No newline at end of file +var _0xdc77=['./smsInteraction.events','save','emit','removeListener','register','smsInteraction:'];(function(_0x4d2677,_0x5eba6e){var _0x4453e0=function(_0x20f42b){while(--_0x20f42b){_0x4d2677['push'](_0x4d2677['shift']());}};_0x4453e0(++_0x5eba6e);}(_0xdc77,0x14a));var _0x7dc7=function(_0x176e73,_0x18c287){_0x176e73=_0x176e73-0x0;var _0x130c18=_0xdc77[_0x176e73];return _0x130c18;};'use strict';var SmsInteractionEvents=require(_0x7dc7('0x0'));var events=[_0x7dc7('0x1'),'remove','update'];function createListener(_0x300bf6,_0x5b07cb){return function(_0x1e5715){_0x5b07cb[_0x7dc7('0x2')](_0x300bf6,_0x1e5715);};}function removeListener(_0x1ca8a4,_0x3985be){return function(){SmsInteractionEvents[_0x7dc7('0x3')](_0x1ca8a4,_0x3985be);};}exports[_0x7dc7('0x4')]=function(_0x8aeb77){for(var _0x13090f=0x0,_0x35113d=events['length'];_0x13090f<_0x35113d;_0x13090f++){var _0x34838c=events[_0x13090f];var _0x1625d5=createListener(_0x7dc7('0x5')+_0x34838c,_0x8aeb77);SmsInteractionEvents['on'](_0x34838c,_0x1625d5);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 9176010..fa956fb 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 _0x4373=['tracked','smsmessage:create','status','put','/:id/accept','/:id/reject','reject','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x4373,0xfe));var _0x3437=function(_0x48b672,_0xfb2729){_0x48b672=_0x48b672-0x0;var _0x597922=_0x4373[_0x48b672];return _0x597922;};'use strict';var multer=require(_0x3437('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3437('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3437('0x2'));var auth=require(_0x3437('0x3'));var interaction=require(_0x3437('0x4'));var config=require(_0x3437('0x5'));var controller=require('./smsMessage.controller');router[_0x3437('0x6')]('/',auth[_0x3437('0x7')](),controller[_0x3437('0x8')]);router[_0x3437('0x6')](_0x3437('0x9'),auth[_0x3437('0x7')](),controller['describe']);router['get'](_0x3437('0xa'),auth[_0x3437('0x7')](),controller['show']);router[_0x3437('0xb')]('/',auth[_0x3437('0x7')](),interaction[_0x3437('0xc')]('sms',_0x3437('0xd')),controller['create']);router[_0x3437('0xb')]('/:id/status',controller[_0x3437('0xe')]);router[_0x3437('0xf')](_0x3437('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3437('0xf')](_0x3437('0x10'),auth['isAuthenticated'](),controller['accept']);router[_0x3437('0xf')](_0x3437('0x11'),auth['isAuthenticated'](),controller[_0x3437('0x12')]);router['delete'](_0x3437('0xa'),auth[_0x3437('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9f7c=['describe','/:id','post','tracked','sms','/:id/status','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe'];(function(_0xf91888,_0x48f3a5){var _0xae9d94=function(_0xf55322){while(--_0xf55322){_0xf91888['push'](_0xf91888['shift']());}};_0xae9d94(++_0x48f3a5);}(_0x9f7c,0x113));var _0xc9f7=function(_0xe2314d,_0x447697){_0xe2314d=_0xe2314d-0x0;var _0x8d00ee=_0x9f7c[_0xe2314d];return _0x8d00ee;};'use strict';var multer=require(_0xc9f7('0x0'));var util=require(_0xc9f7('0x1'));var path=require(_0xc9f7('0x2'));var timeout=require(_0xc9f7('0x3'));var express=require(_0xc9f7('0x4'));var router=express[_0xc9f7('0x5')]();var fs_extra=require(_0xc9f7('0x6'));var auth=require(_0xc9f7('0x7'));var interaction=require(_0xc9f7('0x8'));var config=require(_0xc9f7('0x9'));var controller=require(_0xc9f7('0xa'));router[_0xc9f7('0xb')]('/',auth[_0xc9f7('0xc')](),controller[_0xc9f7('0xd')]);router[_0xc9f7('0xb')](_0xc9f7('0xe'),auth[_0xc9f7('0xc')](),controller[_0xc9f7('0xf')]);router[_0xc9f7('0xb')](_0xc9f7('0x10'),auth[_0xc9f7('0xc')](),controller['show']);router[_0xc9f7('0x11')]('/',auth['isAuthenticated'](),interaction[_0xc9f7('0x12')](_0xc9f7('0x13'),'smsmessage:create'),controller['create']);router[_0xc9f7('0x11')](_0xc9f7('0x14'),controller['status']);router[_0xc9f7('0x15')](_0xc9f7('0x10'),auth[_0xc9f7('0xc')](),controller[_0xc9f7('0x16')]);router[_0xc9f7('0x15')]('/:id/accept',auth[_0xc9f7('0xc')](),controller[_0xc9f7('0x17')]);router['put'](_0xc9f7('0x18'),auth[_0xc9f7('0xc')](),controller[_0xc9f7('0x19')]);router[_0xc9f7('0x1a')]('/:id',auth[_0xc9f7('0xc')](),controller[_0xc9f7('0x1b')]);module[_0xc9f7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index c359946..4bd175a 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 _0x7ec7=['TEXT','BOOLEAN','out','STRING','DATE','sequelize','exports'];(function(_0x1b7126,_0x3d1721){var _0x51de9d=function(_0x5253de){while(--_0x5253de){_0x1b7126['push'](_0x1b7126['shift']());}};_0x51de9d(++_0x3d1721);}(_0x7ec7,0x19b));var _0x77ec=function(_0x4f9eb5,_0x36a766){_0x4f9eb5=_0x4f9eb5-0x0;var _0x11fdcf=_0x7ec7[_0x4f9eb5];return _0x11fdcf;};'use strict';var Sequelize=require(_0x77ec('0x0'));module[_0x77ec('0x1')]={'body':{'type':Sequelize[_0x77ec('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x77ec('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x77ec('0x4')),'defaultValue':_0x77ec('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x77ec('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x77ec('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x77ec('0x2')]}}; \ No newline at end of file +var _0x38db=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x4f682c,_0x4ad919){var _0x250ab1=function(_0x2b9116){while(--_0x2b9116){_0x4f682c['push'](_0x4f682c['shift']());}};_0x250ab1(++_0x4ad919);}(_0x38db,0x18a));var _0xb38d=function(_0x3d45c3,_0x365299){_0x3d45c3=_0x3d45c3-0x0;var _0x18e7a4=_0x38db[_0x3d45c3];return _0x18e7a4;};'use strict';var Sequelize=require(_0xb38d('0x0'));module[_0xb38d('0x1')]={'body':{'type':Sequelize[_0xb38d('0x2')](_0xb38d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb38d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb38d('0x5')]('in','out'),'defaultValue':_0xb38d('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb38d('0x7')](0xbe)},'phone':{'type':Sequelize[_0xb38d('0x7')]},'readAt':{'type':Sequelize[_0xb38d('0x8')]},'secret':{'type':Sequelize[_0xb38d('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb38d('0x7')]},'providerResponse':{'type':Sequelize[_0xb38d('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 62b24fb..3a416ff 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 _0xd5c8=['options','SmsMessage','includeAll','include','findAll','rows','show','params','keys','merge','find','create','update','body','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','internal','event','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','VIRTUAL'];(function(_0x1a324d,_0x168aa4){var _0x2a2e44=function(_0x15087a){while(--_0x15087a){_0x1a324d['push'](_0x1a324d['shift']());}};_0x2a2e44(++_0x168aa4);}(_0xd5c8,0x166));var _0x8d5c=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xd5c8[_0x3bd52b];return _0x1e5b89;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8d5c('0x0'));var jsonpatch=require(_0x8d5c('0x1'));var rp=require(_0x8d5c('0x2'));var moment=require(_0x8d5c('0x3'));var BPromise=require(_0x8d5c('0x4'));var Mustache=require(_0x8d5c('0x5'));var util=require(_0x8d5c('0x6'));var path=require(_0x8d5c('0x7'));var sox=require(_0x8d5c('0x8'));var csv=require('to-csv');var ejs=require(_0x8d5c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d5c('0xa'));var crypto=require(_0x8d5c('0xb'));var jsforce=require(_0x8d5c('0xc'));var deskjs=require(_0x8d5c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8d5c('0xe'));var Redis=require('ioredis');var authService=require(_0x8d5c('0xf'));var qs=require(_0x8d5c('0x10'));var as=require(_0x8d5c('0x11'));var hardwareService=require(_0x8d5c('0x12'));var logger=require(_0x8d5c('0x13'))(_0x8d5c('0x14'));var utils=require(_0x8d5c('0x15'));var config=require(_0x8d5c('0x16'));var licenseUtil=require(_0x8d5c('0x17'));var db=require(_0x8d5c('0x18'))['db'];config[_0x8d5c('0x19')]=_[_0x8d5c('0x1a')](config['redis'],{'host':_0x8d5c('0x1b'),'port':0x18eb});var socket=require(_0x8d5c('0x1c'))(new Redis(config[_0x8d5c('0x19')]));require(_0x8d5c('0x1d'))[_0x8d5c('0x1e')](socket);var jayson=require(_0x8d5c('0x1f'));var client=jayson[_0x8d5c('0x20')][_0x8d5c('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x8d5c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x144717,_0x4ee2af,_0x56878f,_0x645f26){return new BPromise(function(_0x4a1dab,_0x47b146){var _0x4f552a=_0x645f26||client;return _0x4f552a[_0x8d5c('0x22')](_0x144717,_0x56878f)[_0x8d5c('0x23')](function(_0x200846){logger[_0x8d5c('0x24')](_0x8d5c('0x25'),_0x4ee2af,_0x8d5c('0x26'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ee2af,'request\x20sent',JSON['stringify'](_0x200846));if(_0x200846[_0x8d5c('0x27')]){if(_0x200846[_0x8d5c('0x27')][_0x8d5c('0x28')]===0x1f4){logger[_0x8d5c('0x27')](_0x8d5c('0x25'),_0x4ee2af,_0x200846[_0x8d5c('0x27')][_0x8d5c('0x29')]);return _0x47b146(_0x200846[_0x8d5c('0x27')][_0x8d5c('0x29')]);}logger[_0x8d5c('0x27')](_0x8d5c('0x25'),_0x4ee2af,_0x200846['error'][_0x8d5c('0x29')]);return _0x4a1dab(_0x200846[_0x8d5c('0x27')]['message']);}else{logger[_0x8d5c('0x24')](_0x8d5c('0x25'),_0x4ee2af,_0x8d5c('0x26'));_0x4a1dab(_0x200846[_0x8d5c('0x2a')]['message']);}})[_0x8d5c('0x2b')](function(_0x22457f){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4ee2af,_0x22457f);_0x47b146(_0x22457f);});});}function respondWithStatusCode(_0x1e36d8,_0xa8aeac){_0xa8aeac=_0xa8aeac||0xcc;return function(_0x53e5e0){if(_0x53e5e0){return _0x1e36d8['sendStatus'](_0xa8aeac);}return _0x1e36d8[_0x8d5c('0x2c')](_0xa8aeac)['end']();};}function respondWithResult(_0x5d40ba,_0x20c2f3){_0x20c2f3=_0x20c2f3||0xc8;return function(_0x2be887){if(_0x2be887){return _0x5d40ba[_0x8d5c('0x2c')](_0x20c2f3)[_0x8d5c('0x2d')](_0x2be887);}};}function respondWithFilteredResult(_0xd060b1,_0x2302a8){return function(_0x3cfb68){if(_0x3cfb68){var _0x2c940f=typeof _0x2302a8['offset']===_0x8d5c('0x2e')&&typeof _0x2302a8[_0x8d5c('0x2f')]===_0x8d5c('0x2e');var _0x58feb4=_0x3cfb68[_0x8d5c('0x30')];var _0x3116c5=_0x2c940f?0x0:_0x2302a8[_0x8d5c('0x31')];var _0x12377a=_0x2c940f?_0x3cfb68[_0x8d5c('0x30')]:_0x2302a8[_0x8d5c('0x31')]+_0x2302a8[_0x8d5c('0x2f')];var _0x3519da;if(_0x12377a>=_0x58feb4){_0x12377a=_0x58feb4;_0x3519da=0xc8;}else{_0x3519da=0xce;}_0xd060b1[_0x8d5c('0x2c')](_0x3519da);return _0xd060b1[_0x8d5c('0x32')](_0x8d5c('0x33'),_0x3116c5+'-'+_0x12377a+'/'+_0x58feb4)[_0x8d5c('0x2d')](_0x3cfb68);}return null;};}function patchUpdates(_0x383f8c){return function(_0x23a326){try{jsonpatch[_0x8d5c('0x34')](_0x23a326,_0x383f8c,!![]);}catch(_0x19f78a){return BPromise[_0x8d5c('0x35')](_0x19f78a);}return _0x23a326[_0x8d5c('0x36')]();};}function saveUpdates(_0x5e02da,_0x5e2299){return function(_0x4c0570){if(_0x4c0570){return _0x4c0570['update'](_0x5e02da)[_0x8d5c('0x23')](function(_0x216900){return _0x216900;});}return null;};}function removeEntity(_0x348a43,_0x4bb598){return function(_0x2248dd){if(_0x2248dd){return _0x2248dd[_0x8d5c('0x37')]()[_0x8d5c('0x23')](function(){_0x348a43[_0x8d5c('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f1cfd,_0x54a5d6){return function(_0x4550d7){if(!_0x4550d7){_0x4f1cfd[_0x8d5c('0x38')](0x194);}return _0x4550d7;};}function handleError(_0x51f6bc,_0x21e114){_0x21e114=_0x21e114||0x1f4;return function(_0xe65d09){logger[_0x8d5c('0x27')](_0xe65d09[_0x8d5c('0x39')]);if(_0xe65d09[_0x8d5c('0x3a')]){delete _0xe65d09[_0x8d5c('0x3a')];}_0x51f6bc[_0x8d5c('0x2c')](_0x21e114)[_0x8d5c('0x3b')](_0xe65d09);};}exports[_0x8d5c('0x3c')]=function(_0x3af3a4,_0x293540){var _0x348efe={},_0x4b614b={},_0x5c0e1a={'count':0x0,'rows':[]};var _0x5b0089=_['map'](db['SmsMessage'][_0x8d5c('0x3d')],function(_0x1879ee){return{'name':_0x1879ee['fieldName'],'type':_0x1879ee[_0x8d5c('0x3e')][_0x8d5c('0x3f')]};});_0x4b614b[_0x8d5c('0x40')]=_[_0x8d5c('0x41')](_0x5b0089,_0x8d5c('0x3a'));_0x4b614b[_0x8d5c('0x42')]=_['keys'](_0x3af3a4['query']);_0x4b614b[_0x8d5c('0x43')]=_[_0x8d5c('0x44')](_0x4b614b[_0x8d5c('0x40')],_0x4b614b[_0x8d5c('0x42')]);_0x348efe[_0x8d5c('0x45')]=_['intersection'](_0x4b614b[_0x8d5c('0x40')],qs[_0x8d5c('0x46')](_0x3af3a4[_0x8d5c('0x42')]['fields']));_0x348efe['attributes']=_0x348efe[_0x8d5c('0x45')][_0x8d5c('0x47')]?_0x348efe[_0x8d5c('0x45')]:_0x4b614b[_0x8d5c('0x40')];if(!_0x3af3a4['query']['hasOwnProperty']('nolimit')){_0x348efe['limit']=qs[_0x8d5c('0x2f')](_0x3af3a4[_0x8d5c('0x42')][_0x8d5c('0x2f')]);_0x348efe[_0x8d5c('0x31')]=qs[_0x8d5c('0x31')](_0x3af3a4[_0x8d5c('0x42')]['offset']);}_0x348efe[_0x8d5c('0x48')]=qs[_0x8d5c('0x49')](_0x3af3a4[_0x8d5c('0x42')][_0x8d5c('0x49')]);_0x348efe[_0x8d5c('0x4a')]=qs[_0x8d5c('0x43')](_[_0x8d5c('0x4b')](_0x3af3a4['query'],_0x4b614b[_0x8d5c('0x43')]),_0x5b0089);if(_0x3af3a4[_0x8d5c('0x42')]['filter']){_0x348efe[_0x8d5c('0x4a')]=_['merge'](_0x348efe[_0x8d5c('0x4a')],{'$or':_[_0x8d5c('0x41')](_0x5b0089,function(_0x2e6700){if(_0x2e6700['type']!==_0x8d5c('0x4c')){var _0x45f377={};_0x45f377[_0x2e6700[_0x8d5c('0x3a')]]={'$like':'%'+_0x3af3a4[_0x8d5c('0x42')]['filter']+'%'};return _0x45f377;}})});}_0x348efe=_['merge']({},_0x348efe,_0x3af3a4[_0x8d5c('0x4d')]);var _0x3b8ec4={'where':_0x348efe['where']};return db[_0x8d5c('0x4e')][_0x8d5c('0x30')](_0x3b8ec4)[_0x8d5c('0x23')](function(_0x31cdbb){_0x5c0e1a[_0x8d5c('0x30')]=_0x31cdbb;if(_0x3af3a4['query'][_0x8d5c('0x4f')]){_0x348efe[_0x8d5c('0x50')]=[{'all':!![]}];}return db[_0x8d5c('0x4e')][_0x8d5c('0x51')](_0x348efe);})[_0x8d5c('0x23')](function(_0x3e4945){_0x5c0e1a[_0x8d5c('0x52')]=_0x3e4945;return _0x5c0e1a;})['then'](respondWithFilteredResult(_0x293540,_0x348efe))[_0x8d5c('0x2b')](handleError(_0x293540,null));};exports[_0x8d5c('0x53')]=function(_0x28a472,_0x428bcb){var _0x29bfd2={'raw':!![],'where':{'id':_0x28a472[_0x8d5c('0x54')]['id']}},_0x11fd1a={};_0x11fd1a[_0x8d5c('0x40')]=_[_0x8d5c('0x55')](db[_0x8d5c('0x4e')][_0x8d5c('0x3d')]);_0x11fd1a[_0x8d5c('0x42')]=_[_0x8d5c('0x55')](_0x28a472['query']);_0x11fd1a[_0x8d5c('0x43')]=_[_0x8d5c('0x44')](_0x11fd1a[_0x8d5c('0x40')],_0x11fd1a[_0x8d5c('0x42')]);_0x29bfd2['attributes']=_['intersection'](_0x11fd1a[_0x8d5c('0x40')],qs[_0x8d5c('0x46')](_0x28a472[_0x8d5c('0x42')][_0x8d5c('0x46')]));_0x29bfd2['attributes']=_0x29bfd2[_0x8d5c('0x45')][_0x8d5c('0x47')]?_0x29bfd2[_0x8d5c('0x45')]:_0x11fd1a[_0x8d5c('0x40')];if(_0x28a472[_0x8d5c('0x42')][_0x8d5c('0x4f')]){_0x29bfd2[_0x8d5c('0x50')]=[{'all':!![]}];}_0x29bfd2=_[_0x8d5c('0x56')]({},_0x29bfd2,_0x28a472[_0x8d5c('0x4d')]);return db[_0x8d5c('0x4e')][_0x8d5c('0x57')](_0x29bfd2)[_0x8d5c('0x23')](handleEntityNotFound(_0x428bcb,null))[_0x8d5c('0x23')](respondWithResult(_0x428bcb,null))[_0x8d5c('0x2b')](handleError(_0x428bcb,null));};exports[_0x8d5c('0x58')]=function(_0x1dfc79,_0x28c7e2){return db[_0x8d5c('0x4e')][_0x8d5c('0x58')](_0x1dfc79['body'],{})['then'](respondWithResult(_0x28c7e2,0xc9))[_0x8d5c('0x2b')](handleError(_0x28c7e2,null));};exports[_0x8d5c('0x59')]=function(_0x2a280a,_0xea4028){if(_0x2a280a[_0x8d5c('0x5a')]['id']){delete _0x2a280a[_0x8d5c('0x5a')]['id'];}return db[_0x8d5c('0x4e')][_0x8d5c('0x57')]({'where':{'id':_0x2a280a[_0x8d5c('0x54')]['id']}})[_0x8d5c('0x23')](handleEntityNotFound(_0xea4028,null))[_0x8d5c('0x23')](saveUpdates(_0x2a280a[_0x8d5c('0x5a')],null))[_0x8d5c('0x23')](respondWithResult(_0xea4028,null))[_0x8d5c('0x2b')](handleError(_0xea4028,null));};exports[_0x8d5c('0x37')]=function(_0x49d5c8,_0x4125e0){return db[_0x8d5c('0x4e')][_0x8d5c('0x57')]({'where':{'id':_0x49d5c8[_0x8d5c('0x54')]['id']}})[_0x8d5c('0x23')](handleEntityNotFound(_0x4125e0,null))['then'](removeEntity(_0x4125e0,null))[_0x8d5c('0x2b')](handleError(_0x4125e0,null));};exports['describe']=function(_0x3500f0,_0x2cb3c2){return db[_0x8d5c('0x4e')][_0x8d5c('0x5b')]()[_0x8d5c('0x23')](respondWithResult(_0x2cb3c2,null))['catch'](handleError(_0x2cb3c2,null));};var interaction_log=require('../../config/logger')(_0x8d5c('0x5c'));exports[_0x8d5c('0x5d')]=function(_0x32d22a,_0x31531f,_0x4f60ea){var _0x57e9f5={'agent':{},'channel':_0x8d5c('0x5e')};if(_0x32d22a[_0x8d5c('0x5a')]['id']){delete _0x32d22a[_0x8d5c('0x5a')]['id'];}_0x32d22a[_0x8d5c('0x5a')][_0x8d5c('0x5f')]=!![];_0x32d22a[_0x8d5c('0x5a')]['readAt']=moment()[_0x8d5c('0x60')](_0x8d5c('0x61'));_0x32d22a['body'][_0x8d5c('0x62')]=_0x32d22a['body'][_0x8d5c('0x62')]||_0x32d22a[_0x8d5c('0x63')]['id'];_0x57e9f5[_0x8d5c('0x64')]['id']=_0x32d22a['body']['UserId'];return db['SmsMessage']['find']({'where':{'id':_0x32d22a[_0x8d5c('0x54')]['id'],'UserId':null}})[_0x8d5c('0x23')](handleEntityNotFound(_0x31531f,null))[_0x8d5c('0x23')](saveUpdates(_0x32d22a[_0x8d5c('0x5a')],null))[_0x8d5c('0x23')](function(_0xe85a39){if(_0xe85a39){_0x57e9f5['message']=_0xe85a39[_0x8d5c('0x65')]({'plain':!![]});return db['SmsInteraction'][_0x8d5c('0x57')]({'where':{'id':_0xe85a39[_0x8d5c('0x66')]}});}return null;})[_0x8d5c('0x23')](handleEntityNotFound(_0x31531f,null))[_0x8d5c('0x23')](function(_0x1d5627){if(_0x1d5627){return _0x1d5627[_0x8d5c('0x59')]({'UserId':_0x32d22a[_0x8d5c('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x1d5627[_0x8d5c('0x67')])?moment()[_0x8d5c('0x60')](_0x8d5c('0x61')):undefined});}return null;})[_0x8d5c('0x23')](function(_0x19f139){if(_0x19f139){_0x57e9f5[_0x8d5c('0x68')]=_0x19f139[_0x8d5c('0x65')]({'plain':!![]});interaction_log['info'](_0x8d5c('0x69'),_0x32d22a[_0x8d5c('0x63')]['id'],_0x32d22a[_0x8d5c('0x63')][_0x8d5c('0x3a')],_0x32d22a[_0x8d5c('0x63')]['role'],_0x57e9f5[_0x8d5c('0x68')]['id'],_0x32d22a['body']?JSON[_0x8d5c('0x6a')](_0x32d22a[_0x8d5c('0x5a')]):_0x8d5c('0x6b'));return respondWithRpcPromise(_0x8d5c('0x6c'),_0x8d5c('0x6d'),_0x57e9f5);}return null;})[_0x8d5c('0x23')](function(_0x3d3217){var _0x32e285=_0x8d5c('0x6e')+_0x3d3217[_0x8d5c('0x29')][_0x8d5c('0x6f')];return db[_0x8d5c('0x70')][_0x8d5c('0x42')](_0x32e285,{'type':db[_0x8d5c('0x71')][_0x8d5c('0x72')][_0x8d5c('0x73')],'raw':!![]})['then'](function(_0x29463a){return _0x29463a;});})[_0x8d5c('0x23')](function(_0x526994){if(_0x526994){_0x57e9f5[_0x8d5c('0x29')]['contact']=_0x526994[0x0];if(!_0x32d22a['body'][_0x8d5c('0x62')])return;return db[_0x8d5c('0x74')][_0x8d5c('0x57')]({'where':{'id':_0x32d22a[_0x8d5c('0x5a')][_0x8d5c('0x62')],'role':'agent'},'attributes':['id',_0x8d5c('0x3a'),_0x8d5c('0x75'),_0x8d5c('0x76'),'internal'],'raw':!![]});}return null;})[_0x8d5c('0x23')](function(_0x470592){if(!_0x470592)return null;_0x57e9f5[_0x8d5c('0x29')][_0x8d5c('0x64')]=_0x470592;return _0x57e9f5;})['then'](function(_0xe9c7ce){if(_0xe9c7ce){if(_0x32d22a[_0x8d5c('0x5a')][_0x8d5c('0x77')]){_0x57e9f5[_0x8d5c('0x29')][_0x8d5c('0x78')]=util[_0x8d5c('0x60')](_0x8d5c('0x79'),_0x32d22a['user'][_0x8d5c('0x3a')]);_0x57e9f5[_0x8d5c('0x29')][_0x8d5c('0x7a')]=_0x57e9f5[_0x8d5c('0x7a')];_0x57e9f5[_0x8d5c('0x29')][_0x8d5c('0x7b')]=_0x57e9f5[_0x8d5c('0x7a')];_0x57e9f5[_0x8d5c('0x29')]['event']=_0x8d5c('0x5d');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x57e9f5[_0x8d5c('0x29')]},client9002)[_0x8d5c('0x23')](function(){return _0x57e9f5;});}return _0x57e9f5;}return null;})[_0x8d5c('0x23')](respondWithResult(_0x31531f,null))['catch'](handleError(_0x31531f,null));};var interaction_log=require(_0x8d5c('0x13'))('sms-interactions');exports[_0x8d5c('0x35')]=function(_0x50241a,_0x82c07b,_0x42cc7a){var _0x5ac048={'agent':{},'channel':_0x8d5c('0x5e')};if(_0x50241a[_0x8d5c('0x5a')]['id']){delete _0x50241a[_0x8d5c('0x5a')]['id'];}_0x50241a[_0x8d5c('0x5a')][_0x8d5c('0x62')]=_0x50241a['body'][_0x8d5c('0x62')]||_0x50241a[_0x8d5c('0x63')]['id'];_0x5ac048[_0x8d5c('0x64')]['id']=_0x50241a[_0x8d5c('0x5a')][_0x8d5c('0x62')];return db[_0x8d5c('0x4e')][_0x8d5c('0x57')]({'where':{'id':_0x50241a[_0x8d5c('0x54')]['id'],'UserId':null}})[_0x8d5c('0x23')](handleEntityNotFound(_0x82c07b,null))[_0x8d5c('0x23')](function(_0x3e6cd2){if(_0x3e6cd2){_0x5ac048[_0x8d5c('0x29')]=_0x3e6cd2[_0x8d5c('0x65')]({'plain':!![]});return db['SmsInteraction'][_0x8d5c('0x57')]({'where':{'id':_0x3e6cd2['SmsInteractionId']}});}return null;})[_0x8d5c('0x23')](handleEntityNotFound(_0x82c07b,null))[_0x8d5c('0x23')](function(_0x9d16a2){if(_0x9d16a2){_0x5ac048[_0x8d5c('0x68')]=_0x9d16a2[_0x8d5c('0x65')]({'plain':!![]});interaction_log['info'](_0x8d5c('0x7c'),_0x50241a[_0x8d5c('0x63')]['id'],_0x50241a[_0x8d5c('0x63')]['name'],_0x50241a[_0x8d5c('0x63')]['role'],_0x5ac048['interaction']['id'],_0x50241a[_0x8d5c('0x5a')]?JSON['stringify'](_0x50241a[_0x8d5c('0x5a')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5ac048);}return null;})[_0x8d5c('0x23')](function(_0xabadb2){var _0x29910b=_0x8d5c('0x6e')+_0xabadb2[_0x8d5c('0x29')]['ContactId'];return db[_0x8d5c('0x70')][_0x8d5c('0x42')](_0x29910b,{'type':db[_0x8d5c('0x71')][_0x8d5c('0x72')][_0x8d5c('0x73')],'raw':!![]})[_0x8d5c('0x23')](function(_0x4228d5){return _0x4228d5;});})[_0x8d5c('0x23')](function(_0x203c0a){if(_0x203c0a){_0x5ac048['message']['contact']=_0x203c0a[0x0];if(!_0x50241a['body'][_0x8d5c('0x62')])return;return db['User']['find']({'where':{'id':_0x50241a[_0x8d5c('0x5a')][_0x8d5c('0x62')],'role':'agent'},'attributes':['id',_0x8d5c('0x3a'),_0x8d5c('0x75'),_0x8d5c('0x76'),_0x8d5c('0x7d')],'raw':!![]});}return null;})[_0x8d5c('0x23')](function(_0x43a689){if(!_0x43a689)return null;_0x5ac048[_0x8d5c('0x29')][_0x8d5c('0x64')]=_0x43a689;return _0x5ac048;})[_0x8d5c('0x23')](function(_0x7e2f8a){if(_0x7e2f8a){_0x7e2f8a[_0x8d5c('0x29')]['interface']=util[_0x8d5c('0x60')](_0x8d5c('0x79'),_0x50241a[_0x8d5c('0x63')][_0x8d5c('0x3a')]);_0x7e2f8a[_0x8d5c('0x29')][_0x8d5c('0x7a')]=_0x5ac048[_0x8d5c('0x7a')];_0x7e2f8a[_0x8d5c('0x29')]['motionChannel']=_0x5ac048[_0x8d5c('0x7a')];_0x7e2f8a[_0x8d5c('0x29')][_0x8d5c('0x7e')]=_0x8d5c('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0x8d5c('0x7f'),'message':_0x7e2f8a[_0x8d5c('0x29')]},client9002);return _0x5ac048;}return null;})[_0x8d5c('0x23')](respondWithResult(_0x82c07b,null))[_0x8d5c('0x2b')](handleError(_0x82c07b,null));};exports[_0x8d5c('0x2c')]=function(_0x5444aa,_0x14dc2e,_0x235ab6){if(_0x5444aa['body']['id']){delete _0x5444aa[_0x8d5c('0x5a')]['id'];}var _0x5aaf83;return db[_0x8d5c('0x4e')][_0x8d5c('0x57')]({'where':{'id':_0x5444aa[_0x8d5c('0x54')]['id']}})[_0x8d5c('0x23')](handleEntityNotFound(_0x14dc2e,null))[_0x8d5c('0x23')](function(_0x953cd6){if(_0x953cd6){_0x5aaf83=_0x953cd6;return db['SmsAccount'][_0x8d5c('0x57')]({'where':{'id':_0x953cd6[_0x8d5c('0x80')]}});}})[_0x8d5c('0x23')](handleEntityNotFound(_0x14dc2e,null))[_0x8d5c('0x23')](function(_0x8cad94){if(_0x8cad94){logger['debug'](_0x8d5c('0x81'),_0x8d5c('0x2c'),_0x8d5c('0x82'),_0x8cad94[_0x8d5c('0x3e')],util[_0x8d5c('0x83')](_0x5444aa[_0x8d5c('0x5a')],{'showHidden':![],'depth':null}));switch(_0x8cad94['type']){case _0x8d5c('0x84'):if(_0x5444aa['body']['MessageSid']&&_0x5444aa[_0x8d5c('0x5a')][_0x8d5c('0x85')]===_0x5aaf83[_0x8d5c('0x86')]){return _0x5aaf83[_0x8d5c('0x59')]({'read':!![]});}else{logger[_0x8d5c('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8d5c('0x2c'),_0x8d5c('0x84'),util[_0x8d5c('0x83')](_0x5444aa['body'],{'showHidden':![],'depth':null}));}break;case _0x8d5c('0x87'):if(_0x5444aa[_0x8d5c('0x5a')][_0x8d5c('0x88')]&&_0x5444aa[_0x8d5c('0x5a')][_0x8d5c('0x88')]===_0x5aaf83[_0x8d5c('0x86')]&&_[_0x8d5c('0x89')]([_0x8d5c('0x8a'),_0x8d5c('0x8b')],_0x5444aa[_0x8d5c('0x5a')][_0x8d5c('0x8c')])>=0x0){return _0x5aaf83[_0x8d5c('0x59')]({'read':!![]});}else{logger[_0x8d5c('0x27')](_0x8d5c('0x8d'),_0x8d5c('0x2c'),_0x8d5c('0x8e'),util[_0x8d5c('0x83')](_0x5444aa['body'],{'showHidden':![],'depth':null}));}break;case _0x8d5c('0x8f'):var _0x2a6110=_0x5444aa['body']['results'][0x0];if(_0x2a6110[_0x8d5c('0x2c')][_0x8d5c('0x90')]==='DELIVERED'){return _0x5aaf83[_0x8d5c('0x59')]({'read':!![]});}else{logger[_0x8d5c('0x27')](_0x8d5c('0x8d'),'status',_0x8d5c('0x8f'),util[_0x8d5c('0x83')](_0x5444aa['body'],{'showHidden':![],'depth':null}));}break;}return _0x5aaf83;}})['then'](respondWithResult(_0x14dc2e,null))[_0x8d5c('0x2b')](handleError(_0x14dc2e,null));}; \ No newline at end of file +var _0x81b7=['intersection','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','SmsMessage','includeAll','include','rows','catch','params','length','find','create','body','describe','../../config/logger','sms-interactions','accept','read','readAt','format','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','user','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','reject','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','contact','email','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','sendStatus','name','index','map','rawAttributes','fieldName','type','key','keys','filters','model','query','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81b7,0x1f2));var _0x781b=function(_0x456554,_0x1359e9){_0x456554=_0x456554-0x0;var _0x16a049=_0x81b7[_0x456554];return _0x16a049;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x781b('0x0'));var zipdir=require(_0x781b('0x1'));var jsonpatch=require(_0x781b('0x2'));var rp=require(_0x781b('0x3'));var moment=require('moment');var BPromise=require(_0x781b('0x4'));var Mustache=require('mustache');var util=require(_0x781b('0x5'));var path=require(_0x781b('0x6'));var sox=require(_0x781b('0x7'));var csv=require(_0x781b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x781b('0x9'));var _=require(_0x781b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x781b('0xb'));var deskjs=require(_0x781b('0xc'));var toCsv=require(_0x781b('0x8'));var querystring=require(_0x781b('0xd'));var Papa=require('papaparse');var Redis=require(_0x781b('0xe'));var authService=require(_0x781b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x781b('0x10'));var logger=require('../../config/logger')(_0x781b('0x11'));var utils=require('../../config/utils');var config=require(_0x781b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x781b('0x13'))['db'];config['redis']=_[_0x781b('0x14')](config[_0x781b('0x15')],{'host':_0x781b('0x16'),'port':0x18eb});var socket=require(_0x781b('0x17'))(new Redis(config[_0x781b('0x15')]));require('./smsMessage.socket')[_0x781b('0x18')](socket);var jayson=require(_0x781b('0x19'));var client=jayson[_0x781b('0x1a')][_0x781b('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x781b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x533377,_0x176e91,_0x40a6ea,_0x1d0282){return new BPromise(function(_0x4ac48a,_0x22cff6){var _0x554ff5=_0x1d0282||client;return _0x554ff5['request'](_0x533377,_0x40a6ea)[_0x781b('0x1c')](function(_0x177e18){logger[_0x781b('0x1d')](_0x781b('0x1e'),_0x176e91,_0x781b('0x1f'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x176e91,'request\x20sent',JSON[_0x781b('0x20')](_0x177e18));if(_0x177e18[_0x781b('0x21')]){if(_0x177e18[_0x781b('0x21')][_0x781b('0x22')]===0x1f4){logger[_0x781b('0x21')](_0x781b('0x1e'),_0x176e91,_0x177e18['error'][_0x781b('0x23')]);return _0x22cff6(_0x177e18[_0x781b('0x21')][_0x781b('0x23')]);}logger['error'](_0x781b('0x1e'),_0x176e91,_0x177e18[_0x781b('0x21')][_0x781b('0x23')]);return _0x4ac48a(_0x177e18[_0x781b('0x21')]['message']);}else{logger[_0x781b('0x1d')](_0x781b('0x1e'),_0x176e91,_0x781b('0x1f'));_0x4ac48a(_0x177e18[_0x781b('0x24')][_0x781b('0x23')]);}})['catch'](function(_0x226d68){logger[_0x781b('0x21')](_0x781b('0x1e'),_0x176e91,_0x226d68);_0x22cff6(_0x226d68);});});}function respondWithStatusCode(_0x22cdc0,_0x38ba8f){_0x38ba8f=_0x38ba8f||0xcc;return function(_0x398bfa){if(_0x398bfa){return _0x22cdc0['sendStatus'](_0x38ba8f);}return _0x22cdc0['status'](_0x38ba8f)[_0x781b('0x25')]();};}function respondWithResult(_0x2f27a9,_0x560449){_0x560449=_0x560449||0xc8;return function(_0x124339){if(_0x124339){return _0x2f27a9[_0x781b('0x26')](_0x560449)[_0x781b('0x27')](_0x124339);}};}function respondWithFilteredResult(_0x33561e,_0xbde04f){return function(_0x3d3d4c){if(_0x3d3d4c){var _0x1957c4=typeof _0xbde04f[_0x781b('0x28')]===_0x781b('0x29')&&typeof _0xbde04f[_0x781b('0x2a')]===_0x781b('0x29');var _0x5c81fa=_0x3d3d4c[_0x781b('0x2b')];var _0x286a73=_0x1957c4?0x0:_0xbde04f['offset'];var _0x536be8=_0x1957c4?_0x3d3d4c[_0x781b('0x2b')]:_0xbde04f[_0x781b('0x28')]+_0xbde04f[_0x781b('0x2a')];var _0x32f325;if(_0x536be8>=_0x5c81fa){_0x536be8=_0x5c81fa;_0x32f325=0xc8;}else{_0x32f325=0xce;}_0x33561e[_0x781b('0x26')](_0x32f325);return _0x33561e[_0x781b('0x2c')](_0x781b('0x2d'),_0x286a73+'-'+_0x536be8+'/'+_0x5c81fa)[_0x781b('0x27')](_0x3d3d4c);}return null;};}function patchUpdates(_0x5a7c47){return function(_0x10ff42){try{jsonpatch['apply'](_0x10ff42,_0x5a7c47,!![]);}catch(_0x2e043b){return BPromise['reject'](_0x2e043b);}return _0x10ff42[_0x781b('0x2e')]();};}function saveUpdates(_0x468b8c,_0x4be2af){return function(_0x134761){if(_0x134761){return _0x134761[_0x781b('0x2f')](_0x468b8c)[_0x781b('0x1c')](function(_0x2cae64){return _0x2cae64;});}return null;};}function removeEntity(_0x1ff492,_0xb48785){return function(_0x5b3ba0){if(_0x5b3ba0){return _0x5b3ba0[_0x781b('0x30')]()[_0x781b('0x1c')](function(){_0x1ff492[_0x781b('0x26')](0xcc)[_0x781b('0x25')]();});}};}function handleEntityNotFound(_0x39b178,_0xea2d47){return function(_0x379d69){if(!_0x379d69){_0x39b178[_0x781b('0x31')](0x194);}return _0x379d69;};}function handleError(_0x3794c7,_0x249368){_0x249368=_0x249368||0x1f4;return function(_0x3a25a4){logger[_0x781b('0x21')](_0x3a25a4['stack']);if(_0x3a25a4[_0x781b('0x32')]){delete _0x3a25a4[_0x781b('0x32')];}_0x3794c7[_0x781b('0x26')](_0x249368)['send'](_0x3a25a4);};}exports[_0x781b('0x33')]=function(_0x521dc2,_0x58455d){var _0x137589={},_0x32bcbc={},_0x19f55f={'count':0x0,'rows':[]};var _0x4e8069=_[_0x781b('0x34')](db['SmsMessage'][_0x781b('0x35')],function(_0x130b21){return{'name':_0x130b21[_0x781b('0x36')],'type':_0x130b21[_0x781b('0x37')][_0x781b('0x38')]};});_0x32bcbc['model']=_['map'](_0x4e8069,_0x781b('0x32'));_0x32bcbc['query']=_[_0x781b('0x39')](_0x521dc2['query']);_0x32bcbc[_0x781b('0x3a')]=_['intersection'](_0x32bcbc[_0x781b('0x3b')],_0x32bcbc[_0x781b('0x3c')]);_0x137589[_0x781b('0x3d')]=_[_0x781b('0x3e')](_0x32bcbc[_0x781b('0x3b')],qs[_0x781b('0x3f')](_0x521dc2['query'][_0x781b('0x3f')]));_0x137589[_0x781b('0x3d')]=_0x137589[_0x781b('0x3d')]['length']?_0x137589[_0x781b('0x3d')]:_0x32bcbc[_0x781b('0x3b')];if(!_0x521dc2['query']['hasOwnProperty'](_0x781b('0x40'))){_0x137589['limit']=qs[_0x781b('0x2a')](_0x521dc2['query'][_0x781b('0x2a')]);_0x137589[_0x781b('0x28')]=qs[_0x781b('0x28')](_0x521dc2[_0x781b('0x3c')][_0x781b('0x28')]);}_0x137589[_0x781b('0x41')]=qs[_0x781b('0x42')](_0x521dc2['query'][_0x781b('0x42')]);_0x137589['where']=qs[_0x781b('0x3a')](_['pick'](_0x521dc2[_0x781b('0x3c')],_0x32bcbc['filters']),_0x4e8069);if(_0x521dc2[_0x781b('0x3c')][_0x781b('0x43')]){_0x137589[_0x781b('0x44')]=_[_0x781b('0x45')](_0x137589[_0x781b('0x44')],{'$or':_[_0x781b('0x34')](_0x4e8069,function(_0x1105ef){if(_0x1105ef[_0x781b('0x37')]!==_0x781b('0x46')){var _0x2ebbc9={};_0x2ebbc9[_0x1105ef[_0x781b('0x32')]]={'$like':'%'+_0x521dc2['query'][_0x781b('0x43')]+'%'};return _0x2ebbc9;}})});}_0x137589=_[_0x781b('0x45')]({},_0x137589,_0x521dc2[_0x781b('0x47')]);var _0x640362={'where':_0x137589[_0x781b('0x44')]};return db[_0x781b('0x48')]['count'](_0x640362)['then'](function(_0x5ddb43){_0x19f55f['count']=_0x5ddb43;if(_0x521dc2[_0x781b('0x3c')][_0x781b('0x49')]){_0x137589[_0x781b('0x4a')]=[{'all':!![]}];}return db[_0x781b('0x48')]['findAll'](_0x137589);})[_0x781b('0x1c')](function(_0x369939){_0x19f55f[_0x781b('0x4b')]=_0x369939;return _0x19f55f;})['then'](respondWithFilteredResult(_0x58455d,_0x137589))[_0x781b('0x4c')](handleError(_0x58455d,null));};exports['show']=function(_0x15f104,_0x459038){var _0x1eb1b3={'raw':!![],'where':{'id':_0x15f104[_0x781b('0x4d')]['id']}},_0x428dca={};_0x428dca[_0x781b('0x3b')]=_[_0x781b('0x39')](db[_0x781b('0x48')][_0x781b('0x35')]);_0x428dca[_0x781b('0x3c')]=_[_0x781b('0x39')](_0x15f104['query']);_0x428dca['filters']=_['intersection'](_0x428dca[_0x781b('0x3b')],_0x428dca['query']);_0x1eb1b3[_0x781b('0x3d')]=_[_0x781b('0x3e')](_0x428dca[_0x781b('0x3b')],qs['fields'](_0x15f104['query'][_0x781b('0x3f')]));_0x1eb1b3[_0x781b('0x3d')]=_0x1eb1b3[_0x781b('0x3d')][_0x781b('0x4e')]?_0x1eb1b3[_0x781b('0x3d')]:_0x428dca['model'];if(_0x15f104[_0x781b('0x3c')][_0x781b('0x49')]){_0x1eb1b3[_0x781b('0x4a')]=[{'all':!![]}];}_0x1eb1b3=_['merge']({},_0x1eb1b3,_0x15f104[_0x781b('0x47')]);return db[_0x781b('0x48')][_0x781b('0x4f')](_0x1eb1b3)[_0x781b('0x1c')](handleEntityNotFound(_0x459038,null))['then'](respondWithResult(_0x459038,null))['catch'](handleError(_0x459038,null));};exports[_0x781b('0x50')]=function(_0x417a40,_0x4d1824){return db[_0x781b('0x48')][_0x781b('0x50')](_0x417a40[_0x781b('0x51')],{})[_0x781b('0x1c')](respondWithResult(_0x4d1824,0xc9))[_0x781b('0x4c')](handleError(_0x4d1824,null));};exports[_0x781b('0x2f')]=function(_0x4b701e,_0x215bc4){if(_0x4b701e[_0x781b('0x51')]['id']){delete _0x4b701e[_0x781b('0x51')]['id'];}return db['SmsMessage'][_0x781b('0x4f')]({'where':{'id':_0x4b701e[_0x781b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x215bc4,null))[_0x781b('0x1c')](saveUpdates(_0x4b701e['body'],null))[_0x781b('0x1c')](respondWithResult(_0x215bc4,null))[_0x781b('0x4c')](handleError(_0x215bc4,null));};exports['destroy']=function(_0x4ab5b9,_0x42198b){return db[_0x781b('0x48')][_0x781b('0x4f')]({'where':{'id':_0x4ab5b9[_0x781b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42198b,null))['then'](removeEntity(_0x42198b,null))['catch'](handleError(_0x42198b,null));};exports['describe']=function(_0xb822e6,_0x3e092f){return db['SmsMessage'][_0x781b('0x52')]()[_0x781b('0x1c')](respondWithResult(_0x3e092f,null))['catch'](handleError(_0x3e092f,null));};var interaction_log=require(_0x781b('0x53'))(_0x781b('0x54'));exports[_0x781b('0x55')]=function(_0x2c4ae7,_0x5d2ade,_0x18d6f7){var _0x48f4c2={'agent':{},'channel':'sms'};if(_0x2c4ae7[_0x781b('0x51')]['id']){delete _0x2c4ae7[_0x781b('0x51')]['id'];}_0x2c4ae7['body'][_0x781b('0x56')]=!![];_0x2c4ae7['body'][_0x781b('0x57')]=moment()[_0x781b('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c4ae7[_0x781b('0x51')][_0x781b('0x59')]=_0x2c4ae7[_0x781b('0x51')][_0x781b('0x59')]||_0x2c4ae7['user']['id'];_0x48f4c2[_0x781b('0x5a')]['id']=_0x2c4ae7['body'][_0x781b('0x59')];return db[_0x781b('0x48')][_0x781b('0x4f')]({'where':{'id':_0x2c4ae7[_0x781b('0x4d')]['id'],'UserId':null}})[_0x781b('0x1c')](handleEntityNotFound(_0x5d2ade,null))['then'](saveUpdates(_0x2c4ae7[_0x781b('0x51')],null))[_0x781b('0x1c')](function(_0x3aa2a9){if(_0x3aa2a9){_0x48f4c2[_0x781b('0x23')]=_0x3aa2a9[_0x781b('0x5b')]({'plain':!![]});return db[_0x781b('0x5c')]['find']({'where':{'id':_0x3aa2a9[_0x781b('0x5d')]}});}return null;})[_0x781b('0x1c')](handleEntityNotFound(_0x5d2ade,null))[_0x781b('0x1c')](function(_0x165de0){if(_0x165de0){return _0x165de0[_0x781b('0x2f')]({'UserId':_0x2c4ae7[_0x781b('0x51')][_0x781b('0x59')],'read1stAt':_[_0x781b('0x5e')](_0x165de0[_0x781b('0x5f')])?moment()[_0x781b('0x58')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x781b('0x1c')](function(_0x34cd35){if(_0x34cd35){_0x48f4c2[_0x781b('0x60')]=_0x34cd35[_0x781b('0x5b')]({'plain':!![]});interaction_log[_0x781b('0x1d')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c4ae7[_0x781b('0x61')]['id'],_0x2c4ae7[_0x781b('0x61')]['name'],_0x2c4ae7['user'][_0x781b('0x62')],_0x48f4c2[_0x781b('0x60')]['id'],_0x2c4ae7[_0x781b('0x51')]?JSON['stringify'](_0x2c4ae7[_0x781b('0x51')]):'null');return respondWithRpcPromise('AcceptMessage',_0x781b('0x63'),_0x48f4c2);}return null;})[_0x781b('0x1c')](function(_0x47b85d){var _0x24444d=_0x781b('0x64')+_0x47b85d[_0x781b('0x23')]['ContactId'];return db[_0x781b('0x65')][_0x781b('0x3c')](_0x24444d,{'type':db['Sequelize'][_0x781b('0x66')][_0x781b('0x67')],'raw':!![]})[_0x781b('0x1c')](function(_0x39a7a7){return _0x39a7a7;});})[_0x781b('0x1c')](function(_0x7a7914){if(_0x7a7914){_0x48f4c2[_0x781b('0x23')]['contact']=_0x7a7914[0x0];if(!_0x2c4ae7['body'][_0x781b('0x59')])return;return db[_0x781b('0x68')]['find']({'where':{'id':_0x2c4ae7[_0x781b('0x51')][_0x781b('0x59')],'role':_0x781b('0x5a')},'attributes':['id','name',_0x781b('0x69'),'email',_0x781b('0x6a')],'raw':!![]});}return null;})[_0x781b('0x1c')](function(_0x55c80a){if(!_0x55c80a)return null;_0x48f4c2[_0x781b('0x23')][_0x781b('0x5a')]=_0x55c80a;return _0x48f4c2;})[_0x781b('0x1c')](function(_0x838e3d){if(_0x838e3d){if(_0x2c4ae7[_0x781b('0x51')]['manual']){_0x48f4c2['message'][_0x781b('0x6b')]=util[_0x781b('0x58')](_0x781b('0x6c'),_0x2c4ae7[_0x781b('0x61')][_0x781b('0x32')]);_0x48f4c2[_0x781b('0x23')][_0x781b('0x6d')]=_0x48f4c2[_0x781b('0x6d')];_0x48f4c2[_0x781b('0x23')][_0x781b('0x6e')]=_0x48f4c2[_0x781b('0x6d')];_0x48f4c2[_0x781b('0x23')][_0x781b('0x6f')]=_0x781b('0x55');return respondWithRpcPromise('EventManager',_0x781b('0x70'),{'event':'acceptmessage','message':_0x48f4c2[_0x781b('0x23')]},client9002)['then'](function(){return _0x48f4c2;});}return _0x48f4c2;}return null;})[_0x781b('0x1c')](respondWithResult(_0x5d2ade,null))[_0x781b('0x4c')](handleError(_0x5d2ade,null));};var interaction_log=require(_0x781b('0x53'))(_0x781b('0x54'));exports[_0x781b('0x71')]=function(_0x258aa5,_0x2acc44,_0x4910e4){var _0xbac058={'agent':{},'channel':_0x781b('0x72')};if(_0x258aa5[_0x781b('0x51')]['id']){delete _0x258aa5[_0x781b('0x51')]['id'];}_0x258aa5['body'][_0x781b('0x59')]=_0x258aa5[_0x781b('0x51')]['UserId']||_0x258aa5[_0x781b('0x61')]['id'];_0xbac058[_0x781b('0x5a')]['id']=_0x258aa5[_0x781b('0x51')][_0x781b('0x59')];return db[_0x781b('0x48')][_0x781b('0x4f')]({'where':{'id':_0x258aa5[_0x781b('0x4d')]['id'],'UserId':null}})[_0x781b('0x1c')](handleEntityNotFound(_0x2acc44,null))[_0x781b('0x1c')](function(_0x7734eb){if(_0x7734eb){_0xbac058[_0x781b('0x23')]=_0x7734eb[_0x781b('0x5b')]({'plain':!![]});return db[_0x781b('0x5c')][_0x781b('0x4f')]({'where':{'id':_0x7734eb[_0x781b('0x5d')]}});}return null;})[_0x781b('0x1c')](handleEntityNotFound(_0x2acc44,null))['then'](function(_0x599b5a){if(_0x599b5a){_0xbac058[_0x781b('0x60')]=_0x599b5a[_0x781b('0x5b')]({'plain':!![]});interaction_log[_0x781b('0x1d')](_0x781b('0x73'),_0x258aa5['user']['id'],_0x258aa5[_0x781b('0x61')][_0x781b('0x32')],_0x258aa5[_0x781b('0x61')][_0x781b('0x62')],_0xbac058[_0x781b('0x60')]['id'],_0x258aa5[_0x781b('0x51')]?JSON[_0x781b('0x20')](_0x258aa5[_0x781b('0x51')]):_0x781b('0x74'));return respondWithRpcPromise(_0x781b('0x75'),_0x781b('0x76'),_0xbac058);}return null;})[_0x781b('0x1c')](function(_0x12fc3c){var _0x53d555='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12fc3c[_0x781b('0x23')]['ContactId'];return db[_0x781b('0x65')]['query'](_0x53d555,{'type':db[_0x781b('0x77')]['QueryTypes'][_0x781b('0x67')],'raw':!![]})[_0x781b('0x1c')](function(_0x3f5b2d){return _0x3f5b2d;});})[_0x781b('0x1c')](function(_0x3760c8){if(_0x3760c8){_0xbac058['message'][_0x781b('0x78')]=_0x3760c8[0x0];if(!_0x258aa5[_0x781b('0x51')][_0x781b('0x59')])return;return db['User']['find']({'where':{'id':_0x258aa5[_0x781b('0x51')][_0x781b('0x59')],'role':_0x781b('0x5a')},'attributes':['id','name',_0x781b('0x69'),_0x781b('0x79'),_0x781b('0x6a')],'raw':!![]});}return null;})['then'](function(_0x287247){if(!_0x287247)return null;_0xbac058[_0x781b('0x23')][_0x781b('0x5a')]=_0x287247;return _0xbac058;})[_0x781b('0x1c')](function(_0x998fc3){if(_0x998fc3){_0x998fc3[_0x781b('0x23')][_0x781b('0x6b')]=util[_0x781b('0x58')]('SIP/%s',_0x258aa5[_0x781b('0x61')]['name']);_0x998fc3[_0x781b('0x23')][_0x781b('0x6d')]=_0xbac058['channel'];_0x998fc3[_0x781b('0x23')][_0x781b('0x6e')]=_0xbac058[_0x781b('0x6d')];_0x998fc3[_0x781b('0x23')][_0x781b('0x6f')]='reject';respondWithRpcPromise(_0x781b('0x70'),'EventManager',{'event':_0x781b('0x7a'),'message':_0x998fc3[_0x781b('0x23')]},client9002);return _0xbac058;}return null;})[_0x781b('0x1c')](respondWithResult(_0x2acc44,null))[_0x781b('0x4c')](handleError(_0x2acc44,null));};exports['status']=function(_0x560ab9,_0x588b10,_0x527b99){if(_0x560ab9[_0x781b('0x51')]['id']){delete _0x560ab9[_0x781b('0x51')]['id'];}var _0xa2549c;return db[_0x781b('0x48')][_0x781b('0x4f')]({'where':{'id':_0x560ab9[_0x781b('0x4d')]['id']}})[_0x781b('0x1c')](handleEntityNotFound(_0x588b10,null))[_0x781b('0x1c')](function(_0x1c1922){if(_0x1c1922){_0xa2549c=_0x1c1922;return db[_0x781b('0x7b')][_0x781b('0x4f')]({'where':{'id':_0x1c1922[_0x781b('0x7c')]}});}})[_0x781b('0x1c')](handleEntityNotFound(_0x588b10,null))['then'](function(_0x1845d0){if(_0x1845d0){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0x781b('0x7d'),_0x1845d0[_0x781b('0x37')],util[_0x781b('0x7e')](_0x560ab9['body'],{'showHidden':![],'depth':null}));switch(_0x1845d0[_0x781b('0x37')]){case _0x781b('0x7f'):if(_0x560ab9[_0x781b('0x51')]['MessageSid']&&_0x560ab9['body'][_0x781b('0x80')]===_0xa2549c[_0x781b('0x81')]){return _0xa2549c[_0x781b('0x2f')]({'read':!![]});}else{logger[_0x781b('0x21')](_0x781b('0x82'),_0x781b('0x26'),_0x781b('0x7f'),util[_0x781b('0x7e')](_0x560ab9[_0x781b('0x51')],{'showHidden':![],'depth':null}));}break;case _0x781b('0x83'):if(_0x560ab9[_0x781b('0x51')][_0x781b('0x84')]&&_0x560ab9[_0x781b('0x51')][_0x781b('0x84')]===_0xa2549c[_0x781b('0x81')]&&_[_0x781b('0x85')](['sent',_0x781b('0x86')],_0x560ab9[_0x781b('0x51')]['Status'])>=0x0){return _0xa2549c[_0x781b('0x2f')]({'read':!![]});}else{logger['error'](_0x781b('0x82'),_0x781b('0x26'),_0x781b('0x87'),util[_0x781b('0x7e')](_0x560ab9[_0x781b('0x51')],{'showHidden':![],'depth':null}));}break;case _0x781b('0x88'):var _0x4cb2d4=_0x560ab9[_0x781b('0x51')][_0x781b('0x89')][0x0];if(_0x4cb2d4[_0x781b('0x26')][_0x781b('0x8a')]===_0x781b('0x8b')){return _0xa2549c[_0x781b('0x2f')]({'read':!![]});}else{logger[_0x781b('0x21')](_0x781b('0x82'),_0x781b('0x26'),_0x781b('0x88'),util['inspect'](_0x560ab9[_0x781b('0x51')],{'showHidden':![],'depth':null}));}break;}return _0xa2549c;}})[_0x781b('0x1c')](respondWithResult(_0x588b10,null))['catch'](handleError(_0x588b10,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 6b03ff8..7839e3b 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 _0x46fb=['update','emit','hasOwnProperty','events','SmsMessage','setMaxListeners','save'];(function(_0x711c24,_0x33474f){var _0x1ba86e=function(_0x4efb7c){while(--_0x4efb7c){_0x711c24['push'](_0x711c24['shift']());}};_0x1ba86e(++_0x33474f);}(_0x46fb,0x1a7));var _0xb46f=function(_0x58ca6e,_0x4dda33){_0x58ca6e=_0x58ca6e-0x0;var _0x2177fd=_0x46fb[_0x58ca6e];return _0x2177fd;};'use strict';var EventEmitter=require(_0xb46f('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xb46f('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb46f('0x2')](0x0);var events={'afterCreate':_0xb46f('0x3'),'afterUpdate':_0xb46f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x22f52a){return function(_0x4757f5,_0x32c2c7,_0x1b6755){SmsMessageEvents[_0xb46f('0x5')](_0x22f52a+':'+_0x4757f5['id'],_0x4757f5);SmsMessageEvents[_0xb46f('0x5')](_0x22f52a,_0x4757f5);_0x1b6755(null);};}for(var e in events){if(events[_0xb46f('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xc388=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0xe69ea,_0x63b100){var _0x311700=function(_0xc26f29){while(--_0xc26f29){_0xe69ea['push'](_0xe69ea['shift']());}};_0x311700(++_0x63b100);}(_0xc388,0xa6));var _0x8c38=function(_0x487986,_0x3a85e3){_0x487986=_0x487986-0x0;var _0x4cb974=_0xc388[_0x487986];return _0x4cb974;};'use strict';var EventEmitter=require(_0x8c38('0x0'));var SmsMessage=require(_0x8c38('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8c38('0x2')](0x0);var events={'afterCreate':_0x8c38('0x3'),'afterUpdate':'update','afterDestroy':_0x8c38('0x4')};function emitEvent(_0x1808cc){return function(_0x57e2a8,_0x51787e,_0x5d1b5d){SmsMessageEvents[_0x8c38('0x5')](_0x1808cc+':'+_0x57e2a8['id'],_0x57e2a8);SmsMessageEvents[_0x8c38('0x5')](_0x1808cc,_0x57e2a8);_0x5d1b5d(null);};}for(var e in events){if(events[_0x8c38('0x6')](e)){var event=events[e];SmsMessage[_0x8c38('0x7')](e,emitEvent(event));}}module[_0x8c38('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 073c216..28ef5e5 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 _0x7ee1=['read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','token','application/json','IBSSO\x20','csc','crypto','apiKey','login','timestamp','keys','sort','length','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','bandwidth','accountId','/messages','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','SmsMessage','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','findOne','then','update','createdAt','catch','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','sid','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport'];(function(_0x34d993,_0x3c7017){var _0x4728c7=function(_0x12f5ca){while(--_0x12f5ca){_0x34d993['push'](_0x34d993['shift']());}};_0x4728c7(++_0x3c7017);}(_0x7ee1,0xab));var _0x17ee=function(_0x366f55,_0x1624e3){_0x366f55=_0x366f55-0x0;var _0x42ab3a=_0x7ee1[_0x366f55];return _0x42ab3a;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require(_0x17ee('0x1'))(_0x17ee('0x2'));var moment=require(_0x17ee('0x3'));var BPromise=require(_0x17ee('0x4'));var rp=require(_0x17ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x6'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x17ee('0x7')]=function(_0x2e4db0,_0x2efefb){return _0x2e4db0[_0x17ee('0x8')](_0x17ee('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x17ee('0xa'),'fields':['messageId']},{'name':_0x17ee('0xb'),'fields':[_0x17ee('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb3aa42,_0x36d73a,_0xa9902e){var _0x3c879d=_0x2e4db0[_0x17ee('0xd')];var _0x352d60=_0xb3aa42[_0x17ee('0xe')]({'plain':!![]});if(_0x352d60[_0x17ee('0xf')][_0x17ee('0x10')]()==='in'||_0x352d60[_0x17ee('0xf')][_0x17ee('0x10')]()===_0x17ee('0x11')&&!_0x352d60['secret']&&!_[_0x17ee('0x12')](_0x352d60[_0x17ee('0x13')])){_0x3c879d['SmsInteraction'][_0x17ee('0x14')]({'where':{'id':_0x352d60['SmsInteractionId']}})[_0x17ee('0x15')](function(_0x27447d){if(_0x27447d){_0x27447d[_0x17ee('0x16')]({'lastMsgAt':_0x352d60[_0x17ee('0x17')],'lastMsgDirection':_0x352d60['direction'][_0x17ee('0x10')]()});}})[_0x17ee('0x18')](function(_0x1b09a3){console['error'](_0x1b09a3);});}if(_0x352d60[_0x17ee('0xf')]===_0x17ee('0x11')&&!_0x352d60[_0x17ee('0x19')]){var _0x384eaa;_0x3c879d[_0x17ee('0x1a')][_0x17ee('0x1b')]({'where':{'id':_0x352d60[_0x17ee('0x1c')]},'raw':!![]})['then'](function(_0x536c75){_0x384eaa=_0x536c75;if(_0x384eaa&&_0x384eaa[_0x17ee('0x1d')]){switch(_0x384eaa[_0x17ee('0x1d')]){case _0x17ee('0x1e'):var _0x2f908f=require('twilio');if(_0x384eaa[_0x17ee('0x1f')]&&_0x384eaa[_0x17ee('0x20')]&&_0x384eaa[_0x17ee('0x21')]){var _0x3ace7f=new _0x2f908f(_0x384eaa['accountSid'],_0x384eaa[_0x17ee('0x20')]);_0x3ace7f[_0x17ee('0x22')][_0x17ee('0x23')]({'body':_0x352d60['body'],'to':_0x352d60[_0x17ee('0x21')],'from':_0x384eaa[_0x17ee('0x21')],'statusCallback':_0x384eaa[_0x17ee('0x24')]+_0x17ee('0x25')+_0x352d60['id']+_0x17ee('0x26')+_0x384eaa['token']})[_0x17ee('0x15')](function(_0xc01da5){if(_0xc01da5[_0x17ee('0x27')]){return _0xb3aa42[_0x17ee('0x16')]({'messageId':_0xc01da5[_0x17ee('0x27')]});}})[_0x17ee('0x18')](function(_0x13e8ff){logger[_0x17ee('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),_0x17ee('0x1e'),util[_0x17ee('0x2a')](_0x13e8ff,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x17ee('0x2c'):var _0x400306=_0x17ee('0x2d');if(_0x384eaa['username']&&_0x384eaa[_0x17ee('0x2e')]){var _0x34b003={'recipient':[_0x352d60[_0x17ee('0x21')]],'message':_0x352d60['body'],'message_type':_0x384eaa[_0x17ee('0x2f')]};if(_0x384eaa[_0x17ee('0x2f')]&&_0x384eaa[_0x17ee('0x2f')]!=='SI'){_0x34b003[_0x17ee('0x30')]=_0x384eaa['phone'];}var _0x49e8b7={'url':_0x400306+_0x17ee('0x31')+_0x384eaa[_0x17ee('0x32')]+'&password='+_0x384eaa[_0x17ee('0x2e')],'method':'GET'};rp(_0x49e8b7)[_0x17ee('0x15')](function(_0x1cf8b9){var _0x126f3a=_0x1cf8b9['split'](';');var _0x2356fd={'user_key':_0x126f3a[0x0],'session_key':_0x126f3a[0x1]};_0x49e8b7={'url':_0x400306+'sms','method':_0x17ee('0x33'),'headers':{'user_key':_0x2356fd[_0x17ee('0x34')],'Session_key':_0x2356fd[_0x17ee('0x35')]},'json':!![],'body':_0x34b003};return rp(_0x49e8b7);})[_0x17ee('0x15')](function(_0x514114){if(_0x514114[_0x17ee('0x36')]>=0x1){var _0x27e103={'messageId':_0x514114[_0x17ee('0x37')]};if(_0x384eaa['smsMethod']!=='GP'||!_0x384eaa[_0x17ee('0x38')]){_0x27e103[_0x17ee('0x39')]=!![];}return _0xb3aa42[_0x17ee('0x16')](_0x27e103);}else{return logger['error'](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x2c'),util[_0x17ee('0x2a')](_0x514114,{'showHidden':![],'depth':null}));}})[_0x17ee('0x18')](function(_0x423079){return logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x2c'),util['inspect'](_0x423079,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x2c'),_0x17ee('0x3a'));}break;case _0x17ee('0x3b'):if(_0x384eaa[_0x17ee('0x20')]){var _0x1c6924={'recipient':_0x352d60[_0x17ee('0x21')],'message':_0x352d60[_0x17ee('0xc')],'sender':_0x384eaa[_0x17ee('0x3c')]||_0x384eaa['phone'],'authorization':_0x384eaa[_0x17ee('0x20')]};var _0x36d73a={'method':'POST','uri':_0x17ee('0x3d'),'body':_0x1c6924,'json':!![]};rp(_0x36d73a)[_0x17ee('0x15')](function(_0x21cdf6){var _0x29e163={'messageId':_0x21cdf6[_0x17ee('0x3e')]};if(!_0x384eaa[_0x17ee('0x38')]){_0x29e163['read']=!![];}return _0xb3aa42['update'](_0x29e163);})[_0x17ee('0x18')](function(_0x20c6e9){logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x3b'),util['inspect'](_0x20c6e9,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x3b'),'Missing\x20parameters:\x20authToken');}break;case _0x17ee('0x3f'):if(_0x384eaa['username']&&_0x384eaa[_0x17ee('0x2e')]){var _0x1c6924={'messages':[{'source':_0x17ee('0x40'),'to':_0x352d60[_0x17ee('0x21')],'body':_0x352d60['body'],'from':_0x384eaa['senderString']||_0x384eaa['phone']}]};var _0x58106c=util[_0x17ee('0x41')](_0x17ee('0x42'),_0x384eaa['username'],_0x384eaa[_0x17ee('0x2e')]);var _0x36d73a={'method':_0x17ee('0x33'),'uri':_0x17ee('0x43'),'body':_0x1c6924,'headers':{'Authorization':util[_0x17ee('0x41')](_0x17ee('0x44'),new Buffer(_0x58106c)[_0x17ee('0x45')](_0x17ee('0x46')))},'json':!![]};rp(_0x36d73a)['then'](function(_0x4664f7){if(_0x4664f7[_0x17ee('0x47')]>=0xc8&&_0x4664f7['http_code']<=0xce){if(_0x4664f7[_0x17ee('0x48')]&&_0x4664f7[_0x17ee('0x48')][_0x17ee('0x49')]>0x0){var _0x55f597=_['head'](_0x4664f7['data'][_0x17ee('0x22')]);var _0x2a8a48={'messageId':_0x55f597[_0x17ee('0x4a')]};if(!_0x384eaa[_0x17ee('0x38')]){_0x2a8a48[_0x17ee('0x39')]=!![];}return _0xb3aa42[_0x17ee('0x16')](_0x2a8a48);}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x4b'),util[_0x17ee('0x2a')](_0x4664f7,{'showHidden':![],'depth':null}));}}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x4b'),util[_0x17ee('0x2a')](_0x4664f7,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3d7ba1){logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),'clickSend',util[_0x17ee('0x2a')](_0x3d7ba1,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),'clickSend',_0x17ee('0x3a'));}break;case _0x17ee('0x4c'):if(_0x384eaa[_0x17ee('0x4d')]&&_0x384eaa[_0x17ee('0x20')]){var _0x1c6924={'dst':_0x352d60[_0x17ee('0x21')],'text':_0x352d60[_0x17ee('0xc')],'src':_0x384eaa[_0x17ee('0x3c')]||_0x384eaa['phone'],'url':_0x384eaa['remote']+_0x17ee('0x25')+_0x352d60['id']+_0x17ee('0x26')+_0x384eaa['token']};var _0x58106c=util[_0x17ee('0x41')](_0x17ee('0x42'),_0x384eaa[_0x17ee('0x4d')],_0x384eaa['authToken']);var _0x36d73a={'method':_0x17ee('0x33'),'uri':util[_0x17ee('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x384eaa['authId']),'body':_0x1c6924,'headers':{'Authorization':util[_0x17ee('0x41')]('Basic\x20%s',new Buffer(_0x58106c)[_0x17ee('0x45')]('base64'))},'json':!![]};rp(_0x36d73a)[_0x17ee('0x15')](function(_0x537958){var _0x329c99={'messageId':_0x537958[_0x17ee('0x4e')][0x0]};return _0xb3aa42[_0x17ee('0x16')](_0x329c99);})['catch'](function(_0x151b4d){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x17ee('0x4c'),util[_0x17ee('0x2a')](_0x151b4d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x4c'),_0x17ee('0x4f'));}break;case _0x17ee('0x50'):if(_0x384eaa['username']&&_0x384eaa[_0x17ee('0x2e')]){if(_0x384eaa[_0x17ee('0x51')]){var _0x54527d={'method':_0x17ee('0x33'),'uri':_0x384eaa['baseUrl']+_0x17ee('0x52'),'body':{'username':_0x384eaa[_0x17ee('0x32')],'password':_0x384eaa['password']},'json':!![]};return rp(_0x54527d)[_0x17ee('0x15')](function(_0x8e7e69){var _0x201c57={'method':_0x17ee('0x33'),'uri':_0x384eaa['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x384eaa['phone'],'destinations':[{'to':_0x352d60[_0x17ee('0x21')]}],'text':_0x352d60['body'],'notifyUrl':_0x384eaa[_0x17ee('0x24')]+_0x17ee('0x25')+_0x352d60['id']+'/status?token='+_0x384eaa[_0x17ee('0x53')],'notifyContentType':_0x17ee('0x54'),'callbackData':_0x384eaa[_0x17ee('0x21')]+';'+_0x352d60['body']}]},'headers':{'Authorization':_0x17ee('0x55')+_0x8e7e69[_0x17ee('0x53')]},'json':!![]};return rp(_0x201c57)['then'](function(_0x1254df){if(_0x1254df[_0x17ee('0x22')]){var _0x155ede={'messageId':_0x1254df[_0x17ee('0x22')][0x0][_0x17ee('0xa')]};if(!_0x384eaa[_0x17ee('0x38')]){_0x155ede['read']=!![];}return _0xb3aa42['update'](_0x155ede);}else{return logger[_0x17ee('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x17ee('0x50'),util[_0x17ee('0x2a')](_0x1254df,{'showHidden':![],'depth':null}));}});})[_0x17ee('0x18')](function(_0x5615e3){return logger['error'](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x50'),util[_0x17ee('0x2a')](_0x5615e3,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x17ee('0x56'):var _0x26717c=require(_0x17ee('0x57'));if(_0x384eaa[_0x17ee('0x58')]){var _0x5b9a57={};_0x5b9a57[_0x17ee('0x59')]=_0x384eaa[_0x17ee('0x32')];_0x5b9a57[_0x17ee('0x21')]=_0x352d60[_0x17ee('0x21')];_0x5b9a57[_0x17ee('0x30')]=_0x384eaa['phone'];_0x5b9a57['text']=_0x352d60[_0x17ee('0xc')];_0x5b9a57[_0x17ee('0x5a')]=+new Date();var _0xa02147='';var _0x235b4f='';var _0x38f3ec=Object[_0x17ee('0x5b')](_0x5b9a57);_0x38f3ec[_0x17ee('0x5c')]();for(var _0x22002a=0x0;_0x22002a<_0x38f3ec[_0x17ee('0x5d')];_0x22002a++){if(_0xa02147!=''){_0xa02147+='&';}_0xa02147+=_0x38f3ec[_0x22002a]+'='+encodeURIComponent(_0x5b9a57[_0x38f3ec[_0x22002a]]);_0x235b4f+=_0x5b9a57[_0x38f3ec[_0x22002a]];}_0x235b4f+=_0x384eaa[_0x17ee('0x58')];_0x235b4f=_0x26717c[_0x17ee('0x5e')](_0x17ee('0x5f'))[_0x17ee('0x16')](_0x235b4f)['digest'](_0x17ee('0x60'));if(_0xa02147!==''){_0xa02147+='&';}_0xa02147+=_0x17ee('0x61')+_0x235b4f;var _0x49e8b7={'method':'GET','uri':_0x384eaa['baseUrl']+_0x17ee('0x62')+_0xa02147,'json':!![]};return rp(_0x49e8b7)['then'](function(_0x44966b){var _0x1d043e=Object[_0x17ee('0x5b')](_0x44966b);if(_0x44966b[_0x1d043e[0x0]][_0x17ee('0x28')]&&parseInt(_0x44966b[_0x1d043e[0x0]]['error'])===0x0){var _0x56087d={'messageId':_0x44966b[_0x1d043e[0x0]][_0x17ee('0x63')]};if(!_0x384eaa[_0x17ee('0x38')]){_0x56087d['read']=!![];}return _0xb3aa42[_0x17ee('0x16')](_0x56087d);}else{return logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x56'),util['inspect'](_0x44966b[_0x17ee('0x28')],{'showHidden':![],'depth':null}));}})[_0x17ee('0x18')](function(_0x522e8e){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),_0x17ee('0x56'),util[_0x17ee('0x2a')](_0x522e8e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),_0x17ee('0x56'),_0x17ee('0x64'));}break;case _0x17ee('0x65'):if(_0x384eaa['apiKey']){var _0x22d5f2={'method':_0x17ee('0x33'),'uri':_0x17ee('0x66'),'headers':{'Authorization':_0x384eaa[_0x17ee('0x58')]},'body':{'content':_0x352d60[_0x17ee('0xc')],'to':[_0x352d60[_0x17ee('0x21')]],'from':_0x384eaa[_0x17ee('0x21')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x22d5f2)[_0x17ee('0x15')](function(_0x555302){if(!_0x555302['error']){var _0x497dc7={'messageId':_0x555302['messages'][0x0]['apiMessageId']};if(!_0x384eaa[_0x17ee('0x38')]){_0x497dc7[_0x17ee('0x39')]=!![];}return _0xb3aa42[_0x17ee('0x16')](_0x497dc7);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x17ee('0x29'),'clickatell',util[_0x17ee('0x2a')](_0x555302['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x65e755){return logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x65'),util[_0x17ee('0x2a')](_0x65e755,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x65'),_0x17ee('0x64'));}break;case _0x17ee('0x67'):if(_0x384eaa[_0x17ee('0x32')]&&_0x384eaa[_0x17ee('0x2e')]){var _0x58106c=util[_0x17ee('0x41')]('%s:%s',_0x384eaa['username'],_0x384eaa[_0x17ee('0x2e')]);var _0x36d73a={'method':_0x17ee('0x33'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x384eaa[_0x17ee('0x68')]+_0x17ee('0x69'),'body':{'to':[_0x352d60[_0x17ee('0x21')]],'text':_0x352d60[_0x17ee('0xc')],'from':_0x384eaa[_0x17ee('0x21')],'applicationId':_0x384eaa['applicationId']},'headers':{'Authorization':util[_0x17ee('0x41')]('Basic\x20%s',new Buffer(_0x58106c)[_0x17ee('0x45')](_0x17ee('0x46')))},'json':!![]};rp(_0x36d73a)[_0x17ee('0x15')](function(_0x16c6df){if(_0x16c6df['id']){var _0x176f19={'messageId':_0x16c6df['id']};return _0xb3aa42[_0x17ee('0x16')](_0x176f19);}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x67'),util['inspect'](_0x16c6df,{'showHidden':![],'depth':null}));}})[_0x17ee('0x18')](function(_0x1857fa){logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate',_0x17ee('0x67'),util[_0x17ee('0x2a')](_0x1857fa,{'showHidden':![],'depth':null}));});}else{logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x67'),_0x17ee('0x3a'));}break;case'intelepeer':if(_0x384eaa[_0x17ee('0x58')]){var _0x36884e={};var _0x49e8b7={'method':_0x17ee('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x17ee('0x6a')+_0x384eaa['apiKey'],'Content-Type':_0x17ee('0x54')},'body':{'from':_0x384eaa['phone'],'to':_0x352d60[_0x17ee('0x21')],'text':_0x352d60[_0x17ee('0xc')]},'json':!![]};return rp(_0x49e8b7)[_0x17ee('0x15')](function(_0x296303){if(_0x296303[_0x17ee('0x6b')]==0xca){_0x36884e[_0x17ee('0x6c')]=_0x296303;var _0x19b456={'method':_0x17ee('0x33'),'uri':_0x17ee('0x6d'),'headers':{'Authorization':_0x17ee('0x6a')+_0x384eaa[_0x17ee('0x58')],'Content-Type':_0x17ee('0x54')},'body':{'refid':_0x36884e[_0x17ee('0x6c')][_0x17ee('0x6e')]},'json':!![]};return rp(_0x19b456)[_0x17ee('0x15')](function(_0x48ea15){_0x36884e['status']=_0x48ea15;var _0x4a6af4={'messageId':_0x36884e[_0x17ee('0x6c')][_0x17ee('0x6e')],'read':!![]};return _0xb3aa42[_0x17ee('0x16')](_0x4a6af4);});}else{return logger[_0x17ee('0x28')](_0x17ee('0x2b'),'afterCreate','intelepeer',util['inspect'](_0x296303,{'showHidden':![],'depth':null}));}})['catch'](function(_0x20e9c4){return logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x6f'),util['inspect'](_0x20e9c4,{'showHidden':![],'depth':null}));});}else{return logger[_0x17ee('0x28')](_0x17ee('0x2b'),_0x17ee('0x29'),_0x17ee('0x6f'),'Token\x20not\x20received');}break;}}})[_0x17ee('0x70')](function(){_0xa9902e();});}else{_0xa9902e();}}},'charset':'utf8mb4','collate':_0x17ee('0x71')});}; \ No newline at end of file +var _0x8c99=['read','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','/status?token=','%s:%s','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','timestamp','keys','length','createHash','md5','signature=','GET','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','bandwidth','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','secret','SmsAccount','find','then','type','twilio','accountSid','authToken','messages','phone','remote','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','&password=','split','sms','POST','user_key','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid'];(function(_0x1b2667,_0x279eb1){var _0x179ae8=function(_0x119262){while(--_0x119262){_0x1b2667['push'](_0x1b2667['shift']());}};_0x179ae8(++_0x279eb1);}(_0x8c99,0x1a8));var _0x98c9=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0x8c99[_0x47e7dd];return _0x38501f;};'use strict';var _=require(_0x98c9('0x0'));var util=require(_0x98c9('0x1'));var logger=require(_0x98c9('0x2'))(_0x98c9('0x3'));var moment=require(_0x98c9('0x4'));var BPromise=require(_0x98c9('0x5'));var rp=require(_0x98c9('0x6'));var fs=require('fs');var path=require(_0x98c9('0x7'));var rimraf=require(_0x98c9('0x8'));var config=require(_0x98c9('0x9'));var attributes=require(_0x98c9('0xa'));module[_0x98c9('0xb')]=function(_0x4fb819,_0x7f0fec){return _0x4fb819[_0x98c9('0xc')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x98c9('0xd')]},{'name':_0x98c9('0xe'),'fields':[_0x98c9('0xf')],'type':_0x98c9('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x454c51,_0x598a27,_0x2e5914){var _0xa4762=_0x4fb819[_0x98c9('0x11')];var _0x14a6e6=_0x454c51[_0x98c9('0x12')]({'plain':!![]});if(_0x14a6e6['direction'][_0x98c9('0x13')]()==='in'||_0x14a6e6[_0x98c9('0x14')][_0x98c9('0x13')]()===_0x98c9('0x15')&&!_0x14a6e6['secret']&&!_[_0x98c9('0x16')](_0x14a6e6[_0x98c9('0x17')])){_0xa4762[_0x98c9('0x18')][_0x98c9('0x19')]({'where':{'id':_0x14a6e6[_0x98c9('0x1a')]}})['then'](function(_0x2b0819){if(_0x2b0819){_0x2b0819[_0x98c9('0x1b')]({'lastMsgAt':_0x14a6e6[_0x98c9('0x1c')],'lastMsgDirection':_0x14a6e6[_0x98c9('0x14')][_0x98c9('0x13')]()});}})[_0x98c9('0x1d')](function(_0x30e81b){console[_0x98c9('0x1e')](_0x30e81b);});}if(_0x14a6e6[_0x98c9('0x14')]===_0x98c9('0x15')&&!_0x14a6e6[_0x98c9('0x1f')]){var _0x2b90b9;_0xa4762[_0x98c9('0x20')][_0x98c9('0x21')]({'where':{'id':_0x14a6e6['SmsAccountId']},'raw':!![]})[_0x98c9('0x22')](function(_0x22fe71){_0x2b90b9=_0x22fe71;if(_0x2b90b9&&_0x2b90b9['type']){switch(_0x2b90b9[_0x98c9('0x23')]){case'twilio':var _0x405d22=require(_0x98c9('0x24'));if(_0x2b90b9[_0x98c9('0x25')]&&_0x2b90b9[_0x98c9('0x26')]&&_0x2b90b9['phone']){var _0x3e6845=new _0x405d22(_0x2b90b9[_0x98c9('0x25')],_0x2b90b9[_0x98c9('0x26')]);_0x3e6845[_0x98c9('0x27')]['create']({'body':_0x14a6e6[_0x98c9('0xf')],'to':_0x14a6e6[_0x98c9('0x28')],'from':_0x2b90b9[_0x98c9('0x28')],'statusCallback':_0x2b90b9[_0x98c9('0x29')]+'/api/sms/messages/'+_0x14a6e6['id']+'/status?token='+_0x2b90b9[_0x98c9('0x2a')]})[_0x98c9('0x22')](function(_0xca3425){if(_0xca3425['sid']){return _0x454c51['update']({'messageId':_0xca3425['sid']});}})[_0x98c9('0x1d')](function(_0x1653e0){logger['error'](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x24'),util[_0x98c9('0x2d')](_0x1653e0,{'showHidden':![],'depth':null}));});}else{logger[_0x98c9('0x1e')](_0x98c9('0x2b'),'afterCreate',_0x98c9('0x24'),_0x98c9('0x2e'));}break;case _0x98c9('0x2f'):var _0x2d3ca8=_0x98c9('0x30');if(_0x2b90b9['username']&&_0x2b90b9[_0x98c9('0x31')]){var _0x33c270={'recipient':[_0x14a6e6['phone']],'message':_0x14a6e6[_0x98c9('0xf')],'message_type':_0x2b90b9['smsMethod']};if(_0x2b90b9['smsMethod']&&_0x2b90b9[_0x98c9('0x32')]!=='SI'){_0x33c270['sender']=_0x2b90b9[_0x98c9('0x28')];}var _0x459719={'url':_0x2d3ca8+_0x98c9('0x33')+_0x2b90b9[_0x98c9('0x34')]+_0x98c9('0x35')+_0x2b90b9['password'],'method':'GET'};rp(_0x459719)[_0x98c9('0x22')](function(_0x595794){var _0x478ae3=_0x595794[_0x98c9('0x36')](';');var _0x267d25={'user_key':_0x478ae3[0x0],'session_key':_0x478ae3[0x1]};_0x459719={'url':_0x2d3ca8+_0x98c9('0x37'),'method':_0x98c9('0x38'),'headers':{'user_key':_0x267d25[_0x98c9('0x39')],'Session_key':_0x267d25['session_key']},'json':!![],'body':_0x33c270};return rp(_0x459719);})[_0x98c9('0x22')](function(_0x2bbb27){if(_0x2bbb27['total_sent']>=0x1){var _0x5a2727={'messageId':_0x2bbb27[_0x98c9('0x3a')]};if(_0x2b90b9[_0x98c9('0x32')]!=='GP'||!_0x2b90b9[_0x98c9('0x3b')]){_0x5a2727['read']=!![];}return _0x454c51[_0x98c9('0x1b')](_0x5a2727);}else{return logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x2f'),util['inspect'](_0x2bbb27,{'showHidden':![],'depth':null}));}})[_0x98c9('0x1d')](function(_0x5d14d8){return logger[_0x98c9('0x1e')](_0x98c9('0x2b'),'afterCreate',_0x98c9('0x2f'),util[_0x98c9('0x2d')](_0x5d14d8,{'showHidden':![],'depth':null}));});}else{logger[_0x98c9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98c9('0x2c'),_0x98c9('0x2f'),_0x98c9('0x3c'));}break;case'connectel':if(_0x2b90b9[_0x98c9('0x26')]){var _0xe726ed={'recipient':_0x14a6e6['phone'],'message':_0x14a6e6[_0x98c9('0xf')],'sender':_0x2b90b9[_0x98c9('0x3d')]||_0x2b90b9[_0x98c9('0x28')],'authorization':_0x2b90b9['authToken']};var _0x598a27={'method':_0x98c9('0x38'),'uri':_0x98c9('0x3e'),'body':_0xe726ed,'json':!![]};rp(_0x598a27)[_0x98c9('0x22')](function(_0x413116){var _0x421aa4={'messageId':_0x413116[_0x98c9('0x3f')]};if(!_0x2b90b9[_0x98c9('0x3b')]){_0x421aa4[_0x98c9('0x40')]=!![];}return _0x454c51[_0x98c9('0x1b')](_0x421aa4);})[_0x98c9('0x1d')](function(_0x107687){logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x41'),util['inspect'](_0x107687,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x98c9('0x2b'),'afterCreate',_0x98c9('0x41'),_0x98c9('0x42'));}break;case _0x98c9('0x43'):if(_0x2b90b9[_0x98c9('0x34')]&&_0x2b90b9['password']){var _0xe726ed={'messages':[{'source':_0x98c9('0x44'),'to':_0x14a6e6['phone'],'body':_0x14a6e6[_0x98c9('0xf')],'from':_0x2b90b9[_0x98c9('0x3d')]||_0x2b90b9[_0x98c9('0x28')]}]};var _0x38736f=util[_0x98c9('0x45')]('%s:%s',_0x2b90b9['username'],_0x2b90b9[_0x98c9('0x31')]);var _0x598a27={'method':_0x98c9('0x38'),'uri':_0x98c9('0x46'),'body':_0xe726ed,'headers':{'Authorization':util[_0x98c9('0x45')](_0x98c9('0x47'),new Buffer(_0x38736f)['toString'](_0x98c9('0x48')))},'json':!![]};rp(_0x598a27)[_0x98c9('0x22')](function(_0x435a85){if(_0x435a85[_0x98c9('0x49')]>=0xc8&&_0x435a85[_0x98c9('0x49')]<=0xce){if(_0x435a85[_0x98c9('0x4a')]&&_0x435a85['data'][_0x98c9('0x4b')]>0x0){var _0x13d41c=_['head'](_0x435a85[_0x98c9('0x4a')][_0x98c9('0x27')]);var _0x1c3975={'messageId':_0x13d41c[_0x98c9('0x4c')]};if(!_0x2b90b9[_0x98c9('0x3b')]){_0x1c3975[_0x98c9('0x40')]=!![];}return _0x454c51[_0x98c9('0x1b')](_0x1c3975);}else{logger[_0x98c9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x98c9('0x4d'),util[_0x98c9('0x2d')](_0x435a85,{'showHidden':![],'depth':null}));}}else{logger[_0x98c9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98c9('0x2c'),'clickSend',util['inspect'](_0x435a85,{'showHidden':![],'depth':null}));}})['catch'](function(_0x16f58e){logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x4d'),util[_0x98c9('0x2d')](_0x16f58e,{'showHidden':![],'depth':null}));});}else{logger[_0x98c9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98c9('0x2c'),_0x98c9('0x4d'),_0x98c9('0x3c'));}break;case _0x98c9('0x4e'):if(_0x2b90b9[_0x98c9('0x4f')]&&_0x2b90b9[_0x98c9('0x26')]){var _0xe726ed={'dst':_0x14a6e6[_0x98c9('0x28')],'text':_0x14a6e6[_0x98c9('0xf')],'src':_0x2b90b9[_0x98c9('0x3d')]||_0x2b90b9[_0x98c9('0x28')],'url':_0x2b90b9[_0x98c9('0x29')]+'/api/sms/messages/'+_0x14a6e6['id']+_0x98c9('0x50')+_0x2b90b9[_0x98c9('0x2a')]};var _0x38736f=util[_0x98c9('0x45')](_0x98c9('0x51'),_0x2b90b9[_0x98c9('0x4f')],_0x2b90b9[_0x98c9('0x26')]);var _0x598a27={'method':_0x98c9('0x38'),'uri':util[_0x98c9('0x45')]('https://api.plivo.com/v1/Account/%s/Message/',_0x2b90b9[_0x98c9('0x4f')]),'body':_0xe726ed,'headers':{'Authorization':util['format'](_0x98c9('0x47'),new Buffer(_0x38736f)[_0x98c9('0x52')](_0x98c9('0x48')))},'json':!![]};rp(_0x598a27)[_0x98c9('0x22')](function(_0x213140){var _0x4c26b2={'messageId':_0x213140[_0x98c9('0x53')][0x0]};return _0x454c51[_0x98c9('0x1b')](_0x4c26b2);})['catch'](function(_0x4da48b){logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x4e'),util['inspect'](_0x4da48b,{'showHidden':![],'depth':null}));});}else{logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x4e'),_0x98c9('0x54'));}break;case _0x98c9('0x55'):if(_0x2b90b9['username']&&_0x2b90b9[_0x98c9('0x31')]){if(_0x2b90b9[_0x98c9('0x56')]){var _0x1ff170={'method':'POST','uri':_0x2b90b9[_0x98c9('0x56')]+_0x98c9('0x57'),'body':{'username':_0x2b90b9[_0x98c9('0x34')],'password':_0x2b90b9[_0x98c9('0x31')]},'json':!![]};return rp(_0x1ff170)['then'](function(_0x430a3a){var _0xdfaab1={'method':_0x98c9('0x38'),'uri':_0x2b90b9[_0x98c9('0x56')]+_0x98c9('0x58'),'body':{'messages':[{'from':_0x2b90b9[_0x98c9('0x28')],'destinations':[{'to':_0x14a6e6[_0x98c9('0x28')]}],'text':_0x14a6e6[_0x98c9('0xf')],'notifyUrl':_0x2b90b9[_0x98c9('0x29')]+_0x98c9('0x59')+_0x14a6e6['id']+_0x98c9('0x50')+_0x2b90b9['token'],'notifyContentType':_0x98c9('0x5a'),'callbackData':_0x2b90b9[_0x98c9('0x28')]+';'+_0x14a6e6[_0x98c9('0xf')]}]},'headers':{'Authorization':_0x98c9('0x5b')+_0x430a3a['token']},'json':!![]};return rp(_0xdfaab1)['then'](function(_0x49d8c1){if(_0x49d8c1[_0x98c9('0x27')]){var _0x552402={'messageId':_0x49d8c1[_0x98c9('0x27')][0x0][_0x98c9('0xd')]};if(!_0x2b90b9[_0x98c9('0x3b')]){_0x552402[_0x98c9('0x40')]=!![];}return _0x454c51[_0x98c9('0x1b')](_0x552402);}else{return logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x55'),util[_0x98c9('0x2d')](_0x49d8c1,{'showHidden':![],'depth':null}));}});})[_0x98c9('0x1d')](function(_0x19d073){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98c9('0x2c'),'infobip',util[_0x98c9('0x2d')](_0x19d073,{'showHidden':![],'depth':null}));});}else{logger[_0x98c9('0x1e')](_0x98c9('0x2b'),'afterCreate','infobip',_0x98c9('0x5c'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98c9('0x2c'),_0x98c9('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x53a9ed=require(_0x98c9('0x5d'));if(_0x2b90b9[_0x98c9('0x5e')]){var _0x1a7f0d={};_0x1a7f0d[_0x98c9('0x5f')]=_0x2b90b9[_0x98c9('0x34')];_0x1a7f0d[_0x98c9('0x28')]=_0x14a6e6['phone'];_0x1a7f0d['sender']=_0x2b90b9[_0x98c9('0x28')];_0x1a7f0d['text']=_0x14a6e6[_0x98c9('0xf')];_0x1a7f0d[_0x98c9('0x60')]=+new Date();var _0x356d8f='';var _0x31ac4e='';var _0x395381=Object[_0x98c9('0x61')](_0x1a7f0d);_0x395381['sort']();for(var _0x3ebc62=0x0;_0x3ebc62<_0x395381[_0x98c9('0x62')];_0x3ebc62++){if(_0x356d8f!=''){_0x356d8f+='&';}_0x356d8f+=_0x395381[_0x3ebc62]+'='+encodeURIComponent(_0x1a7f0d[_0x395381[_0x3ebc62]]);_0x31ac4e+=_0x1a7f0d[_0x395381[_0x3ebc62]];}_0x31ac4e+=_0x2b90b9['apiKey'];_0x31ac4e=_0x53a9ed[_0x98c9('0x63')](_0x98c9('0x64'))['update'](_0x31ac4e)['digest']('hex');if(_0x356d8f!==''){_0x356d8f+='&';}_0x356d8f+=_0x98c9('0x65')+_0x31ac4e;var _0x459719={'method':_0x98c9('0x66'),'uri':_0x2b90b9[_0x98c9('0x56')]+'/external/get/send.php?'+_0x356d8f,'json':!![]};return rp(_0x459719)[_0x98c9('0x22')](function(_0x1ab2cf){var _0xb83594=Object[_0x98c9('0x61')](_0x1ab2cf);if(_0x1ab2cf[_0xb83594[0x0]][_0x98c9('0x1e')]&&parseInt(_0x1ab2cf[_0xb83594[0x0]][_0x98c9('0x1e')])===0x0){var _0x3e7c72={'messageId':_0x1ab2cf[_0xb83594[0x0]][_0x98c9('0x67')]};if(!_0x2b90b9[_0x98c9('0x3b')]){_0x3e7c72[_0x98c9('0x40')]=!![];}return _0x454c51['update'](_0x3e7c72);}else{return logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),'csc',util['inspect'](_0x1ab2cf['error'],{'showHidden':![],'depth':null}));}})[_0x98c9('0x1d')](function(_0x6f0da9){return logger['error'](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x68'),util[_0x98c9('0x2d')](_0x6f0da9,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98c9('0x2c'),_0x98c9('0x68'),_0x98c9('0x69'));}break;case _0x98c9('0x6a'):if(_0x2b90b9['apiKey']){var _0x15d6a6={'method':_0x98c9('0x38'),'uri':_0x98c9('0x6b'),'headers':{'Authorization':_0x2b90b9['apiKey']},'body':{'content':_0x14a6e6['body'],'to':[_0x14a6e6[_0x98c9('0x28')]],'from':_0x2b90b9[_0x98c9('0x28')],'binary':![],'clientMessageId':_0x98c9('0x6c'),'charset':_0x98c9('0x6d')},'json':!![]};rp(_0x15d6a6)[_0x98c9('0x22')](function(_0x1996e6){if(!_0x1996e6[_0x98c9('0x1e')]){var _0x3c29a8={'messageId':_0x1996e6['messages'][0x0][_0x98c9('0x6e')]};if(!_0x2b90b9[_0x98c9('0x3b')]){_0x3c29a8[_0x98c9('0x40')]=!![];}return _0x454c51['update'](_0x3c29a8);}else{return logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x6a'),util[_0x98c9('0x2d')](_0x1996e6['error'],{'showHidden':![],'depth':null}));}})[_0x98c9('0x1d')](function(_0x14a414){return logger[_0x98c9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98c9('0x2c'),'clickatell',util[_0x98c9('0x2d')](_0x14a414,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x2b90b9['username']&&_0x2b90b9[_0x98c9('0x31')]){var _0x38736f=util[_0x98c9('0x45')](_0x98c9('0x51'),_0x2b90b9[_0x98c9('0x34')],_0x2b90b9[_0x98c9('0x31')]);var _0x598a27={'method':'POST','uri':_0x98c9('0x6f')+_0x2b90b9[_0x98c9('0x70')]+'/messages','body':{'to':[_0x14a6e6[_0x98c9('0x28')]],'text':_0x14a6e6['body'],'from':_0x2b90b9[_0x98c9('0x28')],'applicationId':_0x2b90b9['applicationId']},'headers':{'Authorization':util[_0x98c9('0x45')](_0x98c9('0x47'),new Buffer(_0x38736f)[_0x98c9('0x52')](_0x98c9('0x48')))},'json':!![]};rp(_0x598a27)[_0x98c9('0x22')](function(_0x550604){if(_0x550604['id']){var _0x3f113b={'messageId':_0x550604['id']};return _0x454c51[_0x98c9('0x1b')](_0x3f113b);}else{logger[_0x98c9('0x1e')](_0x98c9('0x2b'),'afterCreate',_0x98c9('0x71'),util['inspect'](_0x550604,{'showHidden':![],'depth':null}));}})[_0x98c9('0x1d')](function(_0x1edbef){logger[_0x98c9('0x1e')](_0x98c9('0x2b'),_0x98c9('0x2c'),_0x98c9('0x71'),util[_0x98c9('0x2d')](_0x1edbef,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x98c9('0x2b'),'afterCreate','bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x2b90b9[_0x98c9('0x5e')]){var _0x3a92e9={};var _0x459719={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x98c9('0x72')+_0x2b90b9['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x2b90b9[_0x98c9('0x28')],'to':_0x14a6e6['phone'],'text':_0x14a6e6[_0x98c9('0xf')]},'json':!![]};return rp(_0x459719)[_0x98c9('0x22')](function(_0x21057c){if(_0x21057c['code']==0xca){_0x3a92e9[_0x98c9('0x73')]=_0x21057c;var _0xceaac9={'method':'POST','uri':_0x98c9('0x74'),'headers':{'Authorization':_0x98c9('0x72')+_0x2b90b9[_0x98c9('0x5e')],'Content-Type':_0x98c9('0x5a')},'body':{'refid':_0x3a92e9['message']['refid']},'json':!![]};return rp(_0xceaac9)[_0x98c9('0x22')](function(_0x5d442b){_0x3a92e9[_0x98c9('0x75')]=_0x5d442b;var _0x1372ba={'messageId':_0x3a92e9[_0x98c9('0x73')]['refid'],'read':!![]};return _0x454c51[_0x98c9('0x1b')](_0x1372ba);});}else{return logger[_0x98c9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98c9('0x2c'),_0x98c9('0x76'),util['inspect'](_0x21057c,{'showHidden':![],'depth':null}));}})[_0x98c9('0x1d')](function(_0x3a2c9c){return logger['error'](_0x98c9('0x2b'),'afterCreate',_0x98c9('0x76'),util[_0x98c9('0x2d')](_0x3a2c9c,{'showHidden':![],'depth':null}));});}else{return logger[_0x98c9('0x1e')](_0x98c9('0x2b'),'afterCreate',_0x98c9('0x76'),_0x98c9('0x77'));}break;}}})[_0x98c9('0x78')](function(){_0x2e5914();});}else{_0x2e5914();}}},'charset':'utf8mb4','collate':_0x98c9('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a460229..fa1140c 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 _0x9a96=['info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','SmsMessage','create','body','options','raw','CreateSmsMessage','debug','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsMessage.socket','then'];(function(_0x2bcb24,_0xde2af){var _0x438763=function(_0x2970f2){while(--_0x2970f2){_0x2bcb24['push'](_0x2bcb24['shift']());}};_0x438763(++_0xde2af);}(_0x9a96,0xc4));var _0x69a9=function(_0xdc807e,_0x278a06){_0xdc807e=_0xdc807e-0x0;var _0x1e3fbd=_0x9a96[_0xdc807e];return _0x1e3fbd;};'use strict';var _=require(_0x69a9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x69a9('0x1'));var fs=require('fs');var Redis=require(_0x69a9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x69a9('0x3'));var logger=require(_0x69a9('0x4'))(_0x69a9('0x5'));var config=require(_0x69a9('0x6'));var jayson=require(_0x69a9('0x7'));var client=jayson[_0x69a9('0x8')][_0x69a9('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x69a9('0xa')],{'host':_0x69a9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x69a9('0xa')]));require(_0x69a9('0xc'))['register'](socket);function respondWithRpcPromise(_0x4d22fa,_0x21afc1,_0x1fb204){return new BPromise(function(_0x3f64d2,_0x2d591a){return client['request'](_0x4d22fa,_0x1fb204)[_0x69a9('0xd')](function(_0x41c3c5){logger[_0x69a9('0xe')]('SmsMessage,\x20%s,\x20%s',_0x21afc1,_0x69a9('0xf'));logger['debug'](_0x69a9('0x10'),_0x21afc1,_0x69a9('0xf'),JSON[_0x69a9('0x11')](_0x41c3c5));if(_0x41c3c5[_0x69a9('0x12')]){if(_0x41c3c5[_0x69a9('0x12')][_0x69a9('0x13')]===0x1f4){logger[_0x69a9('0x12')](_0x69a9('0x14'),_0x21afc1,_0x41c3c5[_0x69a9('0x12')][_0x69a9('0x15')]);return _0x2d591a(_0x41c3c5[_0x69a9('0x12')][_0x69a9('0x15')]);}logger[_0x69a9('0x12')](_0x69a9('0x14'),_0x21afc1,_0x41c3c5[_0x69a9('0x12')]['message']);return _0x3f64d2(_0x41c3c5['error'][_0x69a9('0x15')]);}else{logger[_0x69a9('0xe')](_0x69a9('0x14'),_0x21afc1,_0x69a9('0xf'));_0x3f64d2(_0x41c3c5[_0x69a9('0x16')][_0x69a9('0x15')]);}})['catch'](function(_0x591bcd){logger[_0x69a9('0x12')](_0x69a9('0x14'),_0x21afc1,_0x591bcd);_0x2d591a(_0x591bcd);});});}exports['CreateSmsMessage']=function(_0x3e326b){var _0x5825c0=this;return new Promise(function(_0x2446e2,_0xb8d35d){return db[_0x69a9('0x17')][_0x69a9('0x18')](_0x3e326b[_0x69a9('0x19')],{'raw':_0x3e326b[_0x69a9('0x1a')]?_0x3e326b[_0x69a9('0x1a')][_0x69a9('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4b9ae8){logger[_0x69a9('0xe')](_0x69a9('0x1c'),_0x3e326b);logger[_0x69a9('0x1d')](_0x69a9('0x1c'),_0x3e326b,JSON[_0x69a9('0x11')](_0x4b9ae8));_0x2446e2(_0x4b9ae8);})['catch'](function(_0x1e6117){logger[_0x69a9('0x12')](_0x69a9('0x1c'),_0x1e6117[_0x69a9('0x15')],_0x3e326b);_0xb8d35d(_0x5825c0[_0x69a9('0x12')](0x1f4,_0x1e6117['message']));});});}; \ No newline at end of file +var _0x1953=['randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','CreateSmsMessage','SmsMessage','create','body','options','raw','catch','util','moment','bluebird'];(function(_0x1fe1e9,_0x3328cd){var _0x22cbee=function(_0x5d40de){while(--_0x5d40de){_0x1fe1e9['push'](_0x1fe1e9['shift']());}};_0x22cbee(++_0x3328cd);}(_0x1953,0xb1));var _0x3195=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1953[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x3195('0x0'));var moment=require(_0x3195('0x1'));var BPromise=require(_0x3195('0x2'));var rs=require(_0x3195('0x3'));var fs=require('fs');var Redis=require(_0x3195('0x4'));var db=require(_0x3195('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3195('0x6'));var jayson=require(_0x3195('0x7'));var client=jayson[_0x3195('0x8')]['http']({'port':0x232a});config[_0x3195('0x9')]=_[_0x3195('0xa')](config[_0x3195('0x9')],{'host':_0x3195('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3195('0x9')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x588ed6,_0x3444a4,_0x3a7809){return new BPromise(function(_0x2fc29d,_0x24104e){return client[_0x3195('0xc')](_0x588ed6,_0x3a7809)[_0x3195('0xd')](function(_0x3460b4){logger[_0x3195('0xe')](_0x3195('0xf'),_0x3444a4,_0x3195('0x10'));logger[_0x3195('0x11')](_0x3195('0x12'),_0x3444a4,'request\x20sent',JSON[_0x3195('0x13')](_0x3460b4));if(_0x3460b4['error']){if(_0x3460b4['error'][_0x3195('0x14')]===0x1f4){logger[_0x3195('0x15')](_0x3195('0xf'),_0x3444a4,_0x3460b4[_0x3195('0x15')][_0x3195('0x16')]);return _0x24104e(_0x3460b4[_0x3195('0x15')][_0x3195('0x16')]);}logger[_0x3195('0x15')]('SmsMessage,\x20%s,\x20%s',_0x3444a4,_0x3460b4[_0x3195('0x15')][_0x3195('0x16')]);return _0x2fc29d(_0x3460b4[_0x3195('0x15')][_0x3195('0x16')]);}else{logger[_0x3195('0xe')]('SmsMessage,\x20%s,\x20%s',_0x3444a4,'request\x20sent');_0x2fc29d(_0x3460b4['result'][_0x3195('0x16')]);}})['catch'](function(_0x44bccd){logger['error']('SmsMessage,\x20%s,\x20%s',_0x3444a4,_0x44bccd);_0x24104e(_0x44bccd);});});}exports[_0x3195('0x17')]=function(_0x16556e){var _0x29b8ef=this;return new Promise(function(_0x5be8c3,_0x422356){return db[_0x3195('0x18')][_0x3195('0x19')](_0x16556e[_0x3195('0x1a')],{'raw':_0x16556e[_0x3195('0x1b')]?_0x16556e[_0x3195('0x1b')][_0x3195('0x1c')]===undefined?!![]:![]:!![]})[_0x3195('0xd')](function(_0x30e71e){logger[_0x3195('0xe')](_0x3195('0x17'),_0x16556e);logger[_0x3195('0x11')]('CreateSmsMessage',_0x16556e,JSON[_0x3195('0x13')](_0x30e71e));_0x5be8c3(_0x30e71e);})[_0x3195('0x1d')](function(_0x563940){logger[_0x3195('0x15')](_0x3195('0x17'),_0x563940[_0x3195('0x16')],_0x16556e);_0x422356(_0x29b8ef[_0x3195('0x15')](0x1f4,_0x563940[_0x3195('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 891b7be..81df11e 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 _0x54fc=['register','save','remove','update','emit','removeListener'];(function(_0x521378,_0x2f8004){var _0x4b2fc4=function(_0x25511e){while(--_0x25511e){_0x521378['push'](_0x521378['shift']());}};_0x4b2fc4(++_0x2f8004);}(_0x54fc,0x157));var _0xc54f=function(_0x1f9bb2,_0x4c43a7){_0x1f9bb2=_0x1f9bb2-0x0;var _0x416a86=_0x54fc[_0x1f9bb2];return _0x416a86;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xc54f('0x0'),_0xc54f('0x1'),_0xc54f('0x2')];function createListener(_0x430098,_0x17e5a9){return function(_0x3ebc4b){_0x17e5a9[_0xc54f('0x3')](_0x430098,_0x3ebc4b);};}function removeListener(_0x2966aa,_0x194b6f){return function(){SmsMessageEvents[_0xc54f('0x4')](_0x2966aa,_0x194b6f);};}exports[_0xc54f('0x5')]=function(_0x1f4e70){for(var _0x1a5b87=0x0,_0x4331c3=events['length'];_0x1a5b87<_0x4331c3;_0x1a5b87++){var _0x4e4319=events[_0x1a5b87];var _0x10190a=createListener('smsMessage:'+_0x4e4319,_0x1f4e70);SmsMessageEvents['on'](_0x4e4319,_0x10190a);}}; \ No newline at end of file +var _0xee80=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x370cfe,_0x11d288){var _0x43bfda=function(_0x3b65b4){while(--_0x3b65b4){_0x370cfe['push'](_0x370cfe['shift']());}};_0x43bfda(++_0x11d288);}(_0xee80,0x1ec));var _0x0ee8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xee80[_0x49b207];return _0x2dc8fa;};'use strict';var SmsMessageEvents=require(_0x0ee8('0x0'));var events=[_0x0ee8('0x1'),_0x0ee8('0x2'),_0x0ee8('0x3')];function createListener(_0x15b491,_0x3571a5){return function(_0x34d600){_0x3571a5[_0x0ee8('0x4')](_0x15b491,_0x34d600);};}function removeListener(_0x4358f6,_0x5c195c){return function(){SmsMessageEvents[_0x0ee8('0x5')](_0x4358f6,_0x5c195c);};}exports[_0x0ee8('0x6')]=function(_0x968ac3){for(var _0x3b6839=0x0,_0x4a9aa2=events[_0x0ee8('0x7')];_0x3b6839<_0x4a9aa2;_0x3b6839++){var _0x5dac21=events[_0x3b6839];var _0x45e2f4=createListener(_0x0ee8('0x8')+_0x5dac21,_0x968ac3);SmsMessageEvents['on'](_0x5dac21,_0x45e2f4);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index dc12ab6..305ff44 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 _0x4291=['../../components/auth/service','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','create','addTeams','post','/:id/users','put','update','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x4291,0x132));var _0x1429=function(_0x5d88be,_0x5a9a0d){_0x5d88be=_0x5d88be-0x0;var _0x27b2e7=_0x4291[_0x5d88be];return _0x27b2e7;};'use strict';var multer=require(_0x1429('0x0'));var util=require('util');var path=require(_0x1429('0x1'));var timeout=require(_0x1429('0x2'));var express=require(_0x1429('0x3'));var router=express[_0x1429('0x4')]();var fs_extra=require(_0x1429('0x5'));var auth=require(_0x1429('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x1429('0x7')]('/',auth['isAuthenticated'](),controller[_0x1429('0x8')]);router['get']('/describe',auth[_0x1429('0x9')](),controller[_0x1429('0xa')]);router[_0x1429('0x7')](_0x1429('0xb'),auth['isAuthenticated'](),controller[_0x1429('0xc')]);router[_0x1429('0x7')](_0x1429('0xd'),auth['isAuthenticated'](),controller[_0x1429('0xe')]);router[_0x1429('0x7')](_0x1429('0xf'),auth['isAuthenticated'](),controller[_0x1429('0x10')]);router[_0x1429('0x7')]('/:id/users',auth[_0x1429('0x9')](),controller['getAgents']);router['post']('/',auth[_0x1429('0x9')](),controller[_0x1429('0x11')]);router['post'](_0x1429('0xf'),auth['isAuthenticated'](),controller[_0x1429('0x12')]);router[_0x1429('0x13')](_0x1429('0x14'),auth[_0x1429('0x9')](),controller['addAgents']);router[_0x1429('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1429('0x16')]);router['delete'](_0x1429('0xb'),auth[_0x1429('0x9')](),controller['destroy']);router[_0x1429('0x17')](_0x1429('0xf'),auth[_0x1429('0x9')](),controller[_0x1429('0x18')]);router[_0x1429('0x17')](_0x1429('0x14'),auth[_0x1429('0x9')](),controller[_0x1429('0x19')]);module['exports']=router; \ No newline at end of file +var _0x3955=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x12efde,_0x426c91){var _0x4b8ece=function(_0x6c11d4){while(--_0x6c11d4){_0x12efde['push'](_0x12efde['shift']());}};_0x4b8ece(++_0x426c91);}(_0x3955,0x12c));var _0x5395=function(_0x3b0ab0,_0x3d4076){_0x3b0ab0=_0x3b0ab0-0x0;var _0x1e85c9=_0x3955[_0x3b0ab0];return _0x1e85c9;};'use strict';var multer=require(_0x5395('0x0'));var util=require(_0x5395('0x1'));var path=require(_0x5395('0x2'));var timeout=require('connect-timeout');var express=require(_0x5395('0x3'));var router=express[_0x5395('0x4')]();var fs_extra=require(_0x5395('0x5'));var auth=require(_0x5395('0x6'));var interaction=require(_0x5395('0x7'));var config=require(_0x5395('0x8'));var controller=require('./smsQueue.controller');router[_0x5395('0x9')]('/',auth[_0x5395('0xa')](),controller[_0x5395('0xb')]);router['get']('/describe',auth[_0x5395('0xa')](),controller[_0x5395('0xc')]);router['get'](_0x5395('0xd'),auth[_0x5395('0xa')](),controller[_0x5395('0xe')]);router[_0x5395('0x9')](_0x5395('0xf'),auth[_0x5395('0xa')](),controller['getMembers']);router[_0x5395('0x9')](_0x5395('0x10'),auth[_0x5395('0xa')](),controller['getTeams']);router[_0x5395('0x9')](_0x5395('0x11'),auth[_0x5395('0xa')](),controller[_0x5395('0x12')]);router[_0x5395('0x13')]('/',auth[_0x5395('0xa')](),controller[_0x5395('0x14')]);router[_0x5395('0x13')](_0x5395('0x10'),auth[_0x5395('0xa')](),controller[_0x5395('0x15')]);router[_0x5395('0x13')]('/:id/users',auth[_0x5395('0xa')](),controller[_0x5395('0x16')]);router[_0x5395('0x17')]('/:id',auth[_0x5395('0xa')](),controller[_0x5395('0x18')]);router[_0x5395('0x19')](_0x5395('0xd'),auth['isAuthenticated'](),controller[_0x5395('0x1a')]);router['delete']('/:id/teams',auth[_0x5395('0xa')](),controller['removeTeams']);router[_0x5395('0x19')](_0x5395('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5395('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 4f9a1aa..3e2de64 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 _0x5690=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x46d68b,_0x154971){var _0x3a7893=function(_0x17e56a){while(--_0x17e56a){_0x46d68b['push'](_0x46d68b['shift']());}};_0x3a7893(++_0x154971);}(_0x5690,0x18c));var _0x0569=function(_0x44b585,_0x120e48){_0x44b585=_0x44b585-0x0;var _0x38dd43=_0x5690[_0x44b585];return _0x38dd43;};'use strict';var Sequelize=require(_0x0569('0x0'));module[_0x0569('0x1')]={'name':{'type':Sequelize[_0x0569('0x2')],'unique':_0x0569('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0569('0x2')]},'timeout':{'type':Sequelize[_0x0569('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0569('0x5')](_0x0569('0x6'),_0x0569('0x7'),_0x0569('0x8'))}}; \ No newline at end of file +var _0xee56=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x5af36,_0x453bc1){var _0x5fa816=function(_0x51a920){while(--_0x51a920){_0x5af36['push'](_0x5af36['shift']());}};_0x5fa816(++_0x453bc1);}(_0xee56,0x70));var _0x6ee5=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0xee56[_0x187718];return _0x29ddf4;};'use strict';var Sequelize=require(_0x6ee5('0x0'));module[_0x6ee5('0x1')]={'name':{'type':Sequelize[_0x6ee5('0x2')],'unique':_0x6ee5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6ee5('0x2')]},'timeout':{'type':Sequelize[_0x6ee5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6ee5('0x5')](_0x6ee5('0x6'),_0x6ee5('0x7'),_0x6ee5('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 3fb3a18..df6cd5a 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 _0x3b6a=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserSmsQueue','nolimit','SmsQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','findOne','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','Team','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','userSmsQueue:save','getAgents','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x5bec43,_0xb7db80){var _0x52205f=function(_0x1e5a24){while(--_0x1e5a24){_0x5bec43['push'](_0x5bec43['shift']());}};_0x52205f(++_0xb7db80);}(_0x3b6a,0x19f));var _0xa3b6=function(_0x510347,_0xdf770a){_0x510347=_0x510347-0x0;var _0x5cb84f=_0x3b6a[_0x510347];return _0x5cb84f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa3b6('0x0'));var rp=require(_0xa3b6('0x1'));var moment=require(_0xa3b6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa3b6('0x3'));var util=require(_0xa3b6('0x4'));var path=require(_0xa3b6('0x5'));var sox=require(_0xa3b6('0x6'));var csv=require(_0xa3b6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3b6('0x8'));var _=require(_0xa3b6('0x9'));var squel=require(_0xa3b6('0xa'));var crypto=require(_0xa3b6('0xb'));var jsforce=require(_0xa3b6('0xc'));var deskjs=require(_0xa3b6('0xd'));var toCsv=require(_0xa3b6('0x7'));var querystring=require('querystring');var Papa=require(_0xa3b6('0xe'));var Redis=require('ioredis');var authService=require(_0xa3b6('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa3b6('0x10'));var utils=require(_0xa3b6('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa3b6('0x12'))['db'];config[_0xa3b6('0x13')]=_[_0xa3b6('0x14')](config[_0xa3b6('0x13')],{'host':_0xa3b6('0x15'),'port':0x18eb});var socket=require(_0xa3b6('0x16'))(new Redis(config[_0xa3b6('0x13')]));require(_0xa3b6('0x17'))[_0xa3b6('0x18')](socket);function respondWithStatusCode(_0x4a6fea,_0x1cce87){_0x1cce87=_0x1cce87||0xcc;return function(_0x1048f3){if(_0x1048f3){return _0x4a6fea[_0xa3b6('0x19')](_0x1cce87);}return _0x4a6fea[_0xa3b6('0x1a')](_0x1cce87)[_0xa3b6('0x1b')]();};}function respondWithResult(_0x212012,_0x160c7c){_0x160c7c=_0x160c7c||0xc8;return function(_0x5a8343){if(_0x5a8343){return _0x212012['status'](_0x160c7c)[_0xa3b6('0x1c')](_0x5a8343);}};}function respondWithFilteredResult(_0x146d81,_0x264328){return function(_0x172734){if(_0x172734){var _0x36838e=typeof _0x264328[_0xa3b6('0x1d')]==='undefined'&&typeof _0x264328['limit']==='undefined';var _0x409e3a=_0x172734[_0xa3b6('0x1e')];var _0x50db10=_0x36838e?0x0:_0x264328['offset'];var _0x3e572b=_0x36838e?_0x172734['count']:_0x264328['offset']+_0x264328['limit'];var _0x470fa2;if(_0x3e572b>=_0x409e3a){_0x3e572b=_0x409e3a;_0x470fa2=0xc8;}else{_0x470fa2=0xce;}_0x146d81['status'](_0x470fa2);return _0x146d81[_0xa3b6('0x1f')](_0xa3b6('0x20'),_0x50db10+'-'+_0x3e572b+'/'+_0x409e3a)[_0xa3b6('0x1c')](_0x172734);}return null;};}function patchUpdates(_0x6e054){return function(_0x49aea5){try{jsonpatch[_0xa3b6('0x21')](_0x49aea5,_0x6e054,!![]);}catch(_0x1ec347){return BPromise[_0xa3b6('0x22')](_0x1ec347);}return _0x49aea5['save']();};}function saveUpdates(_0x5660d7,_0x286e3c){return function(_0x1adf62){if(_0x1adf62){return _0x1adf62[_0xa3b6('0x23')](_0x5660d7)[_0xa3b6('0x24')](function(_0x2c0c84){return _0x2c0c84;});}return null;};}function removeEntity(_0x486e41,_0x268e4f){return function(_0x45933a){if(_0x45933a){return _0x45933a[_0xa3b6('0x25')]()['then'](function(){var _0x1cb480=_0x45933a['get']({'plain':!![]});var _0x406402=_0xa3b6('0x26');return db[_0xa3b6('0x27')][_0xa3b6('0x25')]({'where':{'type':_0x406402,'resourceId':_0x1cb480['id']}})[_0xa3b6('0x24')](function(){return _0x45933a;});})['then'](function(){_0x486e41[_0xa3b6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56c6fc,_0x5a9488){return function(_0x19b7cc){if(!_0x19b7cc){_0x56c6fc['sendStatus'](0x194);}return _0x19b7cc;};}function handleError(_0x896cca,_0x109255){_0x109255=_0x109255||0x1f4;return function(_0x2add0a){logger[_0xa3b6('0x28')](_0x2add0a[_0xa3b6('0x29')]);if(_0x2add0a['name']){delete _0x2add0a[_0xa3b6('0x2a')];}_0x896cca[_0xa3b6('0x1a')](_0x109255)[_0xa3b6('0x2b')](_0x2add0a);};}exports[_0xa3b6('0x2c')]=function(_0x12e363,_0x4128cc){var _0x3bd4fb={},_0x1b445d={},_0x41a15f={'count':0x0,'rows':[]};var _0x11dc33=_[_0xa3b6('0x2d')](db[_0xa3b6('0x2e')][_0xa3b6('0x2f')],function(_0x2a0d6a){return{'name':_0x2a0d6a[_0xa3b6('0x30')],'type':_0x2a0d6a[_0xa3b6('0x31')][_0xa3b6('0x32')]};});_0x1b445d[_0xa3b6('0x33')]=_[_0xa3b6('0x2d')](_0x11dc33,_0xa3b6('0x2a'));_0x1b445d['query']=_[_0xa3b6('0x34')](_0x12e363['query']);_0x1b445d[_0xa3b6('0x35')]=_['intersection'](_0x1b445d[_0xa3b6('0x33')],_0x1b445d[_0xa3b6('0x36')]);_0x3bd4fb[_0xa3b6('0x37')]=_[_0xa3b6('0x38')](_0x1b445d[_0xa3b6('0x33')],qs[_0xa3b6('0x39')](_0x12e363[_0xa3b6('0x36')][_0xa3b6('0x39')]));_0x3bd4fb[_0xa3b6('0x37')]=_0x3bd4fb[_0xa3b6('0x37')][_0xa3b6('0x3a')]?_0x3bd4fb[_0xa3b6('0x37')]:_0x1b445d[_0xa3b6('0x33')];if(!_0x12e363[_0xa3b6('0x36')][_0xa3b6('0x3b')]('nolimit')){_0x3bd4fb[_0xa3b6('0x3c')]=qs[_0xa3b6('0x3c')](_0x12e363['query'][_0xa3b6('0x3c')]);_0x3bd4fb['offset']=qs[_0xa3b6('0x1d')](_0x12e363[_0xa3b6('0x36')][_0xa3b6('0x1d')]);}_0x3bd4fb[_0xa3b6('0x3d')]=qs[_0xa3b6('0x3e')](_0x12e363[_0xa3b6('0x36')]['sort']);_0x3bd4fb[_0xa3b6('0x3f')]=qs[_0xa3b6('0x35')](_[_0xa3b6('0x40')](_0x12e363[_0xa3b6('0x36')],_0x1b445d[_0xa3b6('0x35')]),_0x11dc33);if(_0x12e363[_0xa3b6('0x36')][_0xa3b6('0x41')]){_0x3bd4fb[_0xa3b6('0x3f')]=_[_0xa3b6('0x42')](_0x3bd4fb[_0xa3b6('0x3f')],{'$or':_[_0xa3b6('0x2d')](_0x11dc33,function(_0x598b25){if(_0x598b25[_0xa3b6('0x31')]!==_0xa3b6('0x43')){var _0x1e9824={};_0x1e9824[_0x598b25['name']]={'$like':'%'+_0x12e363['query']['filter']+'%'};return _0x1e9824;}})});}_0x3bd4fb=_['merge']({},_0x3bd4fb,_0x12e363[_0xa3b6('0x44')]);var _0x72f53d={'where':_0x3bd4fb['where']};return db['SmsQueue'][_0xa3b6('0x1e')](_0x72f53d)['then'](function(_0x20ccf8){_0x41a15f[_0xa3b6('0x1e')]=_0x20ccf8;if(_0x12e363[_0xa3b6('0x36')][_0xa3b6('0x45')]){_0x3bd4fb[_0xa3b6('0x46')]=[{'all':!![]}];}return db['SmsQueue'][_0xa3b6('0x47')](_0x3bd4fb);})[_0xa3b6('0x24')](function(_0x1e9c0b){_0x41a15f[_0xa3b6('0x48')]=_0x1e9c0b;return _0x41a15f;})['then'](respondWithFilteredResult(_0x4128cc,_0x3bd4fb))[_0xa3b6('0x49')](handleError(_0x4128cc,null));};exports[_0xa3b6('0x4a')]=function(_0x3f4476,_0x4429fc){var _0x5ea5ad={'raw':!![],'where':{'id':_0x3f4476['params']['id']}},_0x39c05c={};_0x39c05c[_0xa3b6('0x33')]=_[_0xa3b6('0x34')](db[_0xa3b6('0x2e')][_0xa3b6('0x2f')]);_0x39c05c[_0xa3b6('0x36')]=_[_0xa3b6('0x34')](_0x3f4476[_0xa3b6('0x36')]);_0x39c05c[_0xa3b6('0x35')]=_[_0xa3b6('0x38')](_0x39c05c[_0xa3b6('0x33')],_0x39c05c[_0xa3b6('0x36')]);_0x5ea5ad[_0xa3b6('0x37')]=_[_0xa3b6('0x38')](_0x39c05c[_0xa3b6('0x33')],qs[_0xa3b6('0x39')](_0x3f4476[_0xa3b6('0x36')][_0xa3b6('0x39')]));_0x5ea5ad[_0xa3b6('0x37')]=_0x5ea5ad[_0xa3b6('0x37')]['length']?_0x5ea5ad[_0xa3b6('0x37')]:_0x39c05c[_0xa3b6('0x33')];if(_0x3f4476[_0xa3b6('0x36')][_0xa3b6('0x45')]){_0x5ea5ad[_0xa3b6('0x46')]=[{'all':!![]}];}_0x5ea5ad=_['merge']({},_0x5ea5ad,_0x3f4476[_0xa3b6('0x44')]);return db[_0xa3b6('0x2e')][_0xa3b6('0x4b')](_0x5ea5ad)[_0xa3b6('0x24')](handleEntityNotFound(_0x4429fc,null))['then'](respondWithResult(_0x4429fc,null))[_0xa3b6('0x49')](handleError(_0x4429fc,null));};exports[_0xa3b6('0x4c')]=function(_0x48ed08,_0xd7e4){return db[_0xa3b6('0x2e')]['create'](_0x48ed08['body'],{})[_0xa3b6('0x24')](function(_0x4fdead){var _0x50b1dc=_0x48ed08[_0xa3b6('0x4d')][_0xa3b6('0x4e')]({'plain':!![]});if(!_0x50b1dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50b1dc['role']==='user'){var _0x169570=_0x4fdead[_0xa3b6('0x4e')]({'plain':!![]});var _0x36c819='SmsQueues';return db[_0xa3b6('0x4f')][_0xa3b6('0x4b')]({'where':{'name':_0x36c819,'userProfileId':_0x50b1dc[_0xa3b6('0x50')]},'raw':!![]})[_0xa3b6('0x24')](function(_0x19fb17){if(_0x19fb17&&_0x19fb17[_0xa3b6('0x51')]===0x0){return db[_0xa3b6('0x27')]['create']({'name':_0x169570['name'],'resourceId':_0x169570['id'],'type':_0x19fb17['name'],'sectionId':_0x19fb17['id']},{})[_0xa3b6('0x24')](function(){return _0x4fdead;});}else{return _0x4fdead;}})[_0xa3b6('0x49')](function(_0x32b082){logger[_0xa3b6('0x28')](_0xa3b6('0x52'),_0x32b082);throw _0x32b082;});}return _0x4fdead;})[_0xa3b6('0x24')](respondWithResult(_0xd7e4,0xc9))[_0xa3b6('0x49')](handleError(_0xd7e4,null));};exports[_0xa3b6('0x23')]=function(_0x1b2e3b,_0x1e1c2d){if(_0x1b2e3b[_0xa3b6('0x53')]['id']){delete _0x1b2e3b[_0xa3b6('0x53')]['id'];}return db[_0xa3b6('0x2e')]['find']({'where':{'id':_0x1b2e3b[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x24')](handleEntityNotFound(_0x1e1c2d,null))[_0xa3b6('0x24')](saveUpdates(_0x1b2e3b[_0xa3b6('0x53')],null))[_0xa3b6('0x24')](respondWithResult(_0x1e1c2d,null))[_0xa3b6('0x49')](handleError(_0x1e1c2d,null));};exports['destroy']=function(_0x323204,_0x454a16){return db[_0xa3b6('0x2e')][_0xa3b6('0x4b')]({'where':{'id':_0x323204['params']['id']}})[_0xa3b6('0x24')](handleEntityNotFound(_0x454a16,null))[_0xa3b6('0x24')](removeEntity(_0x454a16,null))[_0xa3b6('0x49')](handleError(_0x454a16,null));};exports[_0xa3b6('0x55')]=function(_0x14345c,_0x232382){return db[_0xa3b6('0x2e')][_0xa3b6('0x55')]()[_0xa3b6('0x24')](respondWithResult(_0x232382,null))[_0xa3b6('0x49')](handleError(_0x232382,null));};exports[_0xa3b6('0x56')]=function(_0x20af66,_0x460977,_0x17dcb2){var _0x16c2a2={'raw':!![],'where':{}},_0x403ffc={},_0x55241a;return db[_0xa3b6('0x2e')]['findOne']({'where':{'id':_0x20af66[_0xa3b6('0x54')]['id']}})['then'](handleEntityNotFound(_0x460977,null))[_0xa3b6('0x24')](function(_0x14ba21){if(_0x14ba21){_0x55241a=_0x14ba21['get']({'plain':!![]});_0x403ffc[_0xa3b6('0x33')]=_['keys'](db[_0xa3b6('0x57')][_0xa3b6('0x2f')]);_0x403ffc[_0xa3b6('0x36')]=_[_0xa3b6('0x34')](_0x20af66['query']);_0x403ffc[_0xa3b6('0x35')]=_[_0xa3b6('0x38')](_0x403ffc['model'],_0x403ffc[_0xa3b6('0x36')]);_0x16c2a2[_0xa3b6('0x37')]=_[_0xa3b6('0x38')](_0x403ffc[_0xa3b6('0x33')],qs[_0xa3b6('0x39')](_0x20af66[_0xa3b6('0x36')][_0xa3b6('0x39')]));_0x16c2a2[_0xa3b6('0x37')]=_0x16c2a2[_0xa3b6('0x37')][_0xa3b6('0x3a')]?_0x16c2a2[_0xa3b6('0x37')]:_0x403ffc[_0xa3b6('0x33')];if(!_0x20af66['query'][_0xa3b6('0x3b')](_0xa3b6('0x58'))){_0x16c2a2[_0xa3b6('0x3c')]=qs[_0xa3b6('0x3c')](_0x20af66[_0xa3b6('0x36')]['limit']);_0x16c2a2['offset']=qs[_0xa3b6('0x1d')](_0x20af66[_0xa3b6('0x36')][_0xa3b6('0x1d')]);}_0x16c2a2[_0xa3b6('0x3d')]=qs[_0xa3b6('0x3e')](_0x20af66[_0xa3b6('0x36')]['sort']);_0x16c2a2['where']=qs['filters'](_[_0xa3b6('0x40')](_0x20af66[_0xa3b6('0x36')],_0x403ffc[_0xa3b6('0x35')]));_0x16c2a2[_0xa3b6('0x3f')][_0xa3b6('0x59')]=_0x14ba21['id'];if(_0x20af66[_0xa3b6('0x36')][_0xa3b6('0x41')]){_0x16c2a2[_0xa3b6('0x3f')]=_['merge'](_0x16c2a2['where'],{'$or':_[_0xa3b6('0x2d')](_0x16c2a2[_0xa3b6('0x37')],function(_0x5d73c1){var _0x11a7ac={};_0x11a7ac[_0x5d73c1]={'$like':'%'+_0x20af66[_0xa3b6('0x36')][_0xa3b6('0x41')]+'%'};return _0x11a7ac;})});}_0x16c2a2=_['merge']({},_0x16c2a2,_0x20af66[_0xa3b6('0x44')]);return db['UserSmsQueue'][_0xa3b6('0x47')](_0x16c2a2);}})[_0xa3b6('0x24')](function(_0x4c1732){if(_0x4c1732){return db[_0xa3b6('0x5a')][_0xa3b6('0x5b')]({'where':{'id':_[_0xa3b6('0x2d')](_0x4c1732,_0xa3b6('0x5c')),'role':_0xa3b6('0x5d')},'attributes':['id',_0xa3b6('0x2a'),'smsPause',_0xa3b6('0x5e'),_0xa3b6('0x5f')]});}})[_0xa3b6('0x24')](function(_0x36740b){if(_0x36740b){return{'count':_0x36740b[_0xa3b6('0x1e')],'rows':_[_0xa3b6('0x2d')](_0x36740b[_0xa3b6('0x48')],function(_0x70c1c8){return{'membername':_0x70c1c8[_0xa3b6('0x2a')],'UserId':_0x70c1c8['id'],'queue_name':_0x55241a[_0xa3b6('0x2a')],'SmsQueueId':_0x55241a['id'],'interface':util[_0xa3b6('0x60')](_0xa3b6('0x61'),_0xa3b6('0x62'),_0x70c1c8['name']),'penalty':0x0,'paused':_0x70c1c8['smsPause'],'createdAt':_0x70c1c8[_0xa3b6('0x5f')],'updatedAt':_0x70c1c8[_0xa3b6('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa3b6('0x24')](respondWithFilteredResult(_0x460977,_0x16c2a2))[_0xa3b6('0x49')](handleError(_0x460977,null));};exports['getTeams']=function(_0x2901ee,_0x48e7dc,_0x4d71b9){var _0x352bff={};var _0x4886a6={};var _0x1297b4;var _0x249042;return db['SmsQueue'][_0xa3b6('0x63')]({'where':{'id':_0x2901ee[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x24')](handleEntityNotFound(_0x48e7dc,null))[_0xa3b6('0x24')](function(_0x4c7e49){if(_0x4c7e49){_0x1297b4=_0x4c7e49;_0x4886a6['model']=_[_0xa3b6('0x34')](db['Team'][_0xa3b6('0x2f')]);_0x4886a6[_0xa3b6('0x36')]=_[_0xa3b6('0x34')](_0x2901ee[_0xa3b6('0x36')]);_0x4886a6[_0xa3b6('0x35')]=_[_0xa3b6('0x38')](_0x4886a6[_0xa3b6('0x33')],_0x4886a6[_0xa3b6('0x36')]);_0x352bff['attributes']=_[_0xa3b6('0x38')](_0x4886a6[_0xa3b6('0x33')],qs[_0xa3b6('0x39')](_0x2901ee[_0xa3b6('0x36')][_0xa3b6('0x39')]));_0x352bff[_0xa3b6('0x37')]=_0x352bff[_0xa3b6('0x37')][_0xa3b6('0x3a')]?_0x352bff['attributes']:_0x4886a6[_0xa3b6('0x33')];_0x352bff['order']=qs[_0xa3b6('0x3e')](_0x2901ee[_0xa3b6('0x36')][_0xa3b6('0x3e')]);_0x352bff[_0xa3b6('0x3f')]=qs[_0xa3b6('0x35')](_[_0xa3b6('0x40')](_0x2901ee['query'],_0x4886a6['filters']));if(_0x2901ee[_0xa3b6('0x36')][_0xa3b6('0x41')]){_0x352bff['where']=_[_0xa3b6('0x42')](_0x352bff[_0xa3b6('0x3f')],{'$or':_['map'](_0x352bff[_0xa3b6('0x37')],function(_0x1408ef){var _0xd346c1={};_0xd346c1[_0x1408ef]={'$like':'%'+_0x2901ee[_0xa3b6('0x36')]['filter']+'%'};return _0xd346c1;})});}_0x352bff=_[_0xa3b6('0x42')]({},_0x352bff,_0x2901ee[_0xa3b6('0x44')]);return _0x1297b4[_0xa3b6('0x64')](_0x352bff);}})['then'](function(_0x255f60){if(_0x255f60){_0x249042=_0x255f60[_0xa3b6('0x3a')];if(!_0x2901ee[_0xa3b6('0x36')][_0xa3b6('0x3b')](_0xa3b6('0x58'))){_0x352bff[_0xa3b6('0x3c')]=qs['limit'](_0x2901ee[_0xa3b6('0x36')][_0xa3b6('0x3c')]);_0x352bff['offset']=qs[_0xa3b6('0x1d')](_0x2901ee[_0xa3b6('0x36')][_0xa3b6('0x1d')]);}return _0x1297b4['getTeams'](_0x352bff);}})['then'](function(_0x248ab0){if(_0x248ab0){return _0x248ab0?{'count':_0x249042,'rows':_0x248ab0}:null;}})[_0xa3b6('0x24')](respondWithResult(_0x48e7dc,null))[_0xa3b6('0x49')](handleError(_0x48e7dc,null));};exports[_0xa3b6('0x65')]=function(_0x25d214,_0x40c242,_0x52b28f){var _0x14c021=_0x25d214[_0xa3b6('0x53')][_0xa3b6('0x66')];return db['Team'][_0xa3b6('0x47')]({'where':{'id':_0x14c021},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa3b6('0x67'),'attributes':['id',_0xa3b6('0x2a'),_0xa3b6('0x68'),_0xa3b6('0x69'),_0xa3b6('0x6a')],'raw':!![]}]})[_0xa3b6('0x24')](function(_0x146b5e){if(_0x146b5e){var _0x1ed453=_[_0xa3b6('0x6b')](_0x146b5e,function(_0x3631af){var _0x28a198=_0x3631af[_0xa3b6('0x4e')]({'plain':!![]});return _0x28a198[_0xa3b6('0x67')];});return db[_0xa3b6('0x2e')][_0xa3b6('0x4b')]({'where':{'id':_0x25d214[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x24')](function(_0x4d9697){return db['sequelize'][_0xa3b6('0x6c')](function(_0x6aa3e9){return _0x4d9697[_0xa3b6('0x65')](_0x14c021,{'transaction':_0x6aa3e9})[_0xa3b6('0x24')](function(){return BPromise[_0xa3b6('0x6d')](_0x1ed453,function(_0x26f2e4){return db[_0xa3b6('0x57')]['findOrCreate']({'where':{'UserId':_0x26f2e4['id'],'SmsQueueId':_0x25d214[_0xa3b6('0x54')]['id']},'transaction':_0x6aa3e9});});})[_0xa3b6('0x24')](function(){_0x1ed453[_0xa3b6('0x6e')](function(_0x43775d){socket['emit']('userSmsQueue:save',{'UserId':_0x43775d['id'],'SmsQueueId':_0x4d9697['id']});});});});});}})[_0xa3b6('0x24')](respondWithStatusCode(_0x40c242,null))[_0xa3b6('0x49')](handleError(_0x40c242,null));};exports['removeTeams']=function(_0x3070ac,_0x30bc46,_0x20e9b0){return db[_0xa3b6('0x6f')][_0xa3b6('0x47')]({'where':{'id':_0x3070ac[_0xa3b6('0x36')][_0xa3b6('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa3b6('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x30bc46,null))[_0xa3b6('0x24')](function(_0x541883){var _0x16af1b=_['map'](_0x541883,'id');var _0x18604b=[];var _0x5b417d=[];var _0xb55be4=squel[_0xa3b6('0x70')]();_0xb55be4[_0xa3b6('0x71')](_0xa3b6('0x72'))[_0xa3b6('0x73')](_0xa3b6('0x74'),'tq')['join'](_0xa3b6('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa3b6('0x3f')](_0xa3b6('0x76'),_0x3070ac['params']['id']);for(var _0x34f6b8=0x0;_0x34f6b8<_0x541883[_0xa3b6('0x3a')];_0x34f6b8+=0x1){let _0x260af8=_0x541883[_0x34f6b8];for(var _0x5bb875=0x0;_0x5bb875<_0x260af8['Agents'][_0xa3b6('0x3a')];_0x5bb875+=0x1){let _0x4f82cf=_0x260af8[_0xa3b6('0x67')][_0x5bb875];var _0x3f8b2c=_0xb55be4[_0xa3b6('0x77')]();_0x3f8b2c[_0xa3b6('0x3f')]('ut.UserId\x20=\x20?',_0x4f82cf['id']);_0x5b417d[_0xa3b6('0x78')](db[_0xa3b6('0x79')][_0xa3b6('0x36')](_0x3f8b2c[_0xa3b6('0x7a')](),{'type':db['sequelize'][_0xa3b6('0x7b')][_0xa3b6('0x7c')]})[_0xa3b6('0x24')](function(_0x317d56){if(_0x317d56[_0xa3b6('0x3a')]===0x1){return _0x4f82cf['id'];}else{var _0x269a7a=_[_0xa3b6('0x7d')](_[_0xa3b6('0x2d')](_0x317d56,_0xa3b6('0x7e')),function(_0x5f5413){return _[_0xa3b6('0x7f')](_0x16af1b,_0x5f5413);});if(_0x269a7a){return _0x4f82cf['id'];}}}));}}return BPromise[_0xa3b6('0x80')](_0x5b417d)['then'](function(_0x3d3283){_0x18604b=_(_0x18604b)[_0xa3b6('0x81')](_0x3d3283)[_0xa3b6('0x82')]()[_0xa3b6('0x83')]();return db['SmsQueue'][_0xa3b6('0x4b')]({'where':{'id':_0x3070ac[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x24')](function(_0x1408d8){return db[_0xa3b6('0x79')]['transaction'](function(_0xd971f2){return _0x1408d8[_0xa3b6('0x84')](_0x3070ac[_0xa3b6('0x36')][_0xa3b6('0x66')],{'transaction':_0xd971f2})['then'](function(){if(!_[_0xa3b6('0x85')](_0x18604b)){return _0x1408d8[_0xa3b6('0x86')](_0x18604b,{'transaction':_0xd971f2});}})['then'](function(){_0x18604b[_0xa3b6('0x6e')](function(_0x2aabf5){socket[_0xa3b6('0x87')](_0xa3b6('0x88'),{'UserId':_0x2aabf5,'SmsQueueId':_0x1408d8['id']});});});});});});})['then'](respondWithStatusCode(_0x30bc46,null))['catch'](handleError(_0x30bc46,null));};exports['addAgents']=function(_0x1ac260,_0x4bb945,_0x3a0ab6){return db[_0xa3b6('0x2e')][_0xa3b6('0x4b')]({'where':{'id':_0x1ac260[_0xa3b6('0x54')]['id']}})['then'](handleEntityNotFound(_0x4bb945,null))['then'](function(_0x514d74){if(_0x514d74){return _0x514d74[_0xa3b6('0x89')](_0x1ac260[_0xa3b6('0x53')]['ids'],_['omit'](_0x1ac260[_0xa3b6('0x53')],[_0xa3b6('0x66'),'id'])||{})['spread'](function(_0x561728){for(var _0x4c1e89=0x0;_0x4c1e89<_0x1ac260['body']['ids']['length'];_0x4c1e89+=0x1){socket[_0xa3b6('0x87')](_0xa3b6('0x8a'),{'UserId':Number(_0x1ac260['body']['ids'][_0x4c1e89]),'SmsQueueId':Number(_0x1ac260[_0xa3b6('0x54')]['id'])});}return _0x561728;});}})[_0xa3b6('0x24')](respondWithResult(_0x4bb945,null))['catch'](handleError(_0x4bb945,null));};exports[_0xa3b6('0x86')]=function(_0x257a87,_0x592683,_0x4676b3){return db[_0xa3b6('0x2e')][_0xa3b6('0x4b')]({'where':{'id':_0x257a87[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x24')](handleEntityNotFound(_0x592683,null))[_0xa3b6('0x24')](function(_0xcce20a){if(_0xcce20a){return _0xcce20a[_0xa3b6('0x86')](_0x257a87[_0xa3b6('0x36')][_0xa3b6('0x66')])[_0xa3b6('0x24')](function(){if(_['isArray'](_0x257a87[_0xa3b6('0x36')]['ids'])){for(var _0x1d947c=0x0;_0x1d947c<_0x257a87[_0xa3b6('0x36')][_0xa3b6('0x66')]['length'];_0x1d947c+=0x1){socket[_0xa3b6('0x87')](_0xa3b6('0x88'),{'UserId':Number(_0x257a87[_0xa3b6('0x36')][_0xa3b6('0x66')][_0x1d947c]),'SmsQueueId':Number(_0x257a87[_0xa3b6('0x54')]['id'])});}}else{socket[_0xa3b6('0x87')](_0xa3b6('0x88'),{'UserId':Number(_0x257a87[_0xa3b6('0x36')]['ids']),'SmsQueueId':Number(_0x257a87[_0xa3b6('0x54')]['id'])});}});}})[_0xa3b6('0x24')](respondWithStatusCode(_0x592683,null))[_0xa3b6('0x49')](handleError(_0x592683,null));};exports[_0xa3b6('0x8b')]=function(_0x6ece6a,_0x217420,_0x23773c){var _0x1d2b89={};var _0x5bcfc6={};var _0x415a19;var _0x11a160;return db[_0xa3b6('0x2e')][_0xa3b6('0x63')]({'where':{'id':_0x6ece6a[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x24')](handleEntityNotFound(_0x217420,null))[_0xa3b6('0x24')](function(_0x5ec316){if(_0x5ec316){_0x415a19=_0x5ec316;_0x5bcfc6[_0xa3b6('0x33')]=_[_0xa3b6('0x34')](db[_0xa3b6('0x5a')][_0xa3b6('0x2f')]);_0x5bcfc6[_0xa3b6('0x36')]=_[_0xa3b6('0x34')](_0x6ece6a[_0xa3b6('0x36')]);_0x5bcfc6[_0xa3b6('0x35')]=_['intersection'](_0x5bcfc6['model'],_0x5bcfc6[_0xa3b6('0x36')]);_0x1d2b89['attributes']=_[_0xa3b6('0x38')](_0x5bcfc6[_0xa3b6('0x33')],qs[_0xa3b6('0x39')](_0x6ece6a[_0xa3b6('0x36')][_0xa3b6('0x39')]));_0x1d2b89[_0xa3b6('0x37')]=_0x1d2b89[_0xa3b6('0x37')][_0xa3b6('0x3a')]?_0x1d2b89[_0xa3b6('0x37')]:_0x5bcfc6['model'];_0x1d2b89[_0xa3b6('0x3d')]=qs[_0xa3b6('0x3e')](_0x6ece6a[_0xa3b6('0x36')]['sort']);_0x1d2b89[_0xa3b6('0x3f')]=qs[_0xa3b6('0x35')](_[_0xa3b6('0x40')](_0x6ece6a[_0xa3b6('0x36')],_0x5bcfc6[_0xa3b6('0x35')]));if(_0x6ece6a['query']['filter']){_0x1d2b89[_0xa3b6('0x3f')]=_[_0xa3b6('0x42')](_0x1d2b89[_0xa3b6('0x3f')],{'$or':_[_0xa3b6('0x2d')](_0x1d2b89[_0xa3b6('0x37')],function(_0x528a01){var _0x2bd635={};_0x2bd635[_0x528a01]={'$like':'%'+_0x6ece6a[_0xa3b6('0x36')][_0xa3b6('0x41')]+'%'};return _0x2bd635;})});}_0x1d2b89=_[_0xa3b6('0x42')]({},_0x1d2b89,_0x6ece6a['options']);return _0x415a19[_0xa3b6('0x8b')](_0x1d2b89);}})[_0xa3b6('0x24')](function(_0x5ba739){if(_0x5ba739){_0x11a160=_0x5ba739[_0xa3b6('0x3a')];if(!_0x6ece6a[_0xa3b6('0x36')][_0xa3b6('0x3b')](_0xa3b6('0x58'))){_0x1d2b89[_0xa3b6('0x3c')]=qs[_0xa3b6('0x3c')](_0x6ece6a['query'][_0xa3b6('0x3c')]);_0x1d2b89[_0xa3b6('0x1d')]=qs[_0xa3b6('0x1d')](_0x6ece6a[_0xa3b6('0x36')][_0xa3b6('0x1d')]);}return _0x415a19[_0xa3b6('0x8b')](_0x1d2b89);}})['then'](function(_0x47f6a9){if(_0x47f6a9){return _0x47f6a9?{'count':_0x11a160,'rows':_0x47f6a9}:null;}})[_0xa3b6('0x24')](respondWithResult(_0x217420,null))[_0xa3b6('0x49')](handleError(_0x217420,null));}; \ No newline at end of file +var _0xafce=['ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','value','removeTeams','removeAgents','userSmsQueue:remove','addAgents','getAgents','User','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','SmsQueues','UserProfileResource','destroy','error','stack','name','index','SmsQueue','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','nolimit','sort','pick','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','hasOwnProperty','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','Team','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','clone'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xafce,0x9e));var _0xeafc=function(_0x58d085,_0x103939){_0x58d085=_0x58d085-0x0;var _0x55a8a4=_0xafce[_0x58d085];return _0x55a8a4;};'use strict';var emlformat=require(_0xeafc('0x0'));var rimraf=require(_0xeafc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeafc('0x2'));var rp=require(_0xeafc('0x3'));var moment=require(_0xeafc('0x4'));var BPromise=require(_0xeafc('0x5'));var Mustache=require(_0xeafc('0x6'));var util=require(_0xeafc('0x7'));var path=require('path');var sox=require(_0xeafc('0x8'));var csv=require(_0xeafc('0x9'));var ejs=require(_0xeafc('0xa'));var fs=require('fs');var fs_extra=require(_0xeafc('0xb'));var _=require(_0xeafc('0xc'));var squel=require(_0xeafc('0xd'));var crypto=require(_0xeafc('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeafc('0x9'));var querystring=require(_0xeafc('0xf'));var Papa=require(_0xeafc('0x10'));var Redis=require(_0xeafc('0x11'));var authService=require(_0xeafc('0x12'));var qs=require(_0xeafc('0x13'));var as=require(_0xeafc('0x14'));var hardwareService=require(_0xeafc('0x15'));var logger=require(_0xeafc('0x16'))(_0xeafc('0x17'));var utils=require(_0xeafc('0x18'));var config=require(_0xeafc('0x19'));var licenseUtil=require(_0xeafc('0x1a'));var db=require(_0xeafc('0x1b'))['db'];config['redis']=_[_0xeafc('0x1c')](config[_0xeafc('0x1d')],{'host':_0xeafc('0x1e'),'port':0x18eb});var socket=require(_0xeafc('0x1f'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x5445b7,_0x1454bf){_0x1454bf=_0x1454bf||0xcc;return function(_0x368c40){if(_0x368c40){return _0x5445b7[_0xeafc('0x20')](_0x1454bf);}return _0x5445b7[_0xeafc('0x21')](_0x1454bf)[_0xeafc('0x22')]();};}function respondWithResult(_0x512811,_0x129ef1){_0x129ef1=_0x129ef1||0xc8;return function(_0x525fb1){if(_0x525fb1){return _0x512811[_0xeafc('0x21')](_0x129ef1)[_0xeafc('0x23')](_0x525fb1);}};}function respondWithFilteredResult(_0x4d8d14,_0xcd77ef){return function(_0x386185){if(_0x386185){var _0x16fc9e=typeof _0xcd77ef['offset']==='undefined'&&typeof _0xcd77ef[_0xeafc('0x24')]===_0xeafc('0x25');var _0x4094c2=_0x386185[_0xeafc('0x26')];var _0x28687f=_0x16fc9e?0x0:_0xcd77ef[_0xeafc('0x27')];var _0x57c53c=_0x16fc9e?_0x386185[_0xeafc('0x26')]:_0xcd77ef['offset']+_0xcd77ef[_0xeafc('0x24')];var _0x900d6b;if(_0x57c53c>=_0x4094c2){_0x57c53c=_0x4094c2;_0x900d6b=0xc8;}else{_0x900d6b=0xce;}_0x4d8d14[_0xeafc('0x21')](_0x900d6b);return _0x4d8d14['set'](_0xeafc('0x28'),_0x28687f+'-'+_0x57c53c+'/'+_0x4094c2)['json'](_0x386185);}return null;};}function patchUpdates(_0x5a8a76){return function(_0x7ae680){try{jsonpatch[_0xeafc('0x29')](_0x7ae680,_0x5a8a76,!![]);}catch(_0x4b6bb8){return BPromise['reject'](_0x4b6bb8);}return _0x7ae680[_0xeafc('0x2a')]();};}function saveUpdates(_0x534796,_0x1857fb){return function(_0x1a4909){if(_0x1a4909){return _0x1a4909[_0xeafc('0x2b')](_0x534796)[_0xeafc('0x2c')](function(_0x4f0445){return _0x4f0445;});}return null;};}function removeEntity(_0xe276f6,_0x1581a3){return function(_0x12c81c){if(_0x12c81c){return _0x12c81c['destroy']()[_0xeafc('0x2c')](function(){var _0x34b539=_0x12c81c['get']({'plain':!![]});var _0x4e9ee5=_0xeafc('0x2d');return db[_0xeafc('0x2e')][_0xeafc('0x2f')]({'where':{'type':_0x4e9ee5,'resourceId':_0x34b539['id']}})['then'](function(){return _0x12c81c;});})[_0xeafc('0x2c')](function(){_0xe276f6[_0xeafc('0x21')](0xcc)[_0xeafc('0x22')]();});}};}function handleEntityNotFound(_0x27eee4,_0xdae449){return function(_0x5a0418){if(!_0x5a0418){_0x27eee4['sendStatus'](0x194);}return _0x5a0418;};}function handleError(_0x496136,_0x554f57){_0x554f57=_0x554f57||0x1f4;return function(_0x2398df){logger[_0xeafc('0x30')](_0x2398df[_0xeafc('0x31')]);if(_0x2398df['name']){delete _0x2398df[_0xeafc('0x32')];}_0x496136['status'](_0x554f57)['send'](_0x2398df);};}exports[_0xeafc('0x33')]=function(_0xf76a4,_0x1300cf){var _0x480aaf={},_0xa92694={},_0x5bef3f={'count':0x0,'rows':[]};var _0x20c5d9=_['map'](db[_0xeafc('0x34')][_0xeafc('0x35')],function(_0x15dd95){return{'name':_0x15dd95[_0xeafc('0x36')],'type':_0x15dd95['type'][_0xeafc('0x37')]};});_0xa92694[_0xeafc('0x38')]=_[_0xeafc('0x39')](_0x20c5d9,_0xeafc('0x32'));_0xa92694[_0xeafc('0x3a')]=_[_0xeafc('0x3b')](_0xf76a4[_0xeafc('0x3a')]);_0xa92694[_0xeafc('0x3c')]=_[_0xeafc('0x3d')](_0xa92694['model'],_0xa92694[_0xeafc('0x3a')]);_0x480aaf[_0xeafc('0x3e')]=_[_0xeafc('0x3d')](_0xa92694[_0xeafc('0x38')],qs[_0xeafc('0x3f')](_0xf76a4['query'][_0xeafc('0x3f')]));_0x480aaf[_0xeafc('0x3e')]=_0x480aaf[_0xeafc('0x3e')][_0xeafc('0x40')]?_0x480aaf[_0xeafc('0x3e')]:_0xa92694[_0xeafc('0x38')];if(!_0xf76a4[_0xeafc('0x3a')]['hasOwnProperty']('nolimit')){_0x480aaf['limit']=qs[_0xeafc('0x24')](_0xf76a4[_0xeafc('0x3a')][_0xeafc('0x24')]);_0x480aaf[_0xeafc('0x27')]=qs[_0xeafc('0x27')](_0xf76a4[_0xeafc('0x3a')][_0xeafc('0x27')]);}_0x480aaf[_0xeafc('0x41')]=qs['sort'](_0xf76a4[_0xeafc('0x3a')]['sort']);_0x480aaf[_0xeafc('0x42')]=qs[_0xeafc('0x3c')](_['pick'](_0xf76a4[_0xeafc('0x3a')],_0xa92694[_0xeafc('0x3c')]),_0x20c5d9);if(_0xf76a4[_0xeafc('0x3a')][_0xeafc('0x43')]){_0x480aaf[_0xeafc('0x42')]=_[_0xeafc('0x44')](_0x480aaf['where'],{'$or':_['map'](_0x20c5d9,function(_0x43350b){if(_0x43350b[_0xeafc('0x45')]!==_0xeafc('0x46')){var _0x2eca48={};_0x2eca48[_0x43350b['name']]={'$like':'%'+_0xf76a4[_0xeafc('0x3a')][_0xeafc('0x43')]+'%'};return _0x2eca48;}})});}_0x480aaf=_['merge']({},_0x480aaf,_0xf76a4[_0xeafc('0x47')]);var _0x3573b2={'where':_0x480aaf[_0xeafc('0x42')]};return db[_0xeafc('0x34')][_0xeafc('0x26')](_0x3573b2)['then'](function(_0x56a57d){_0x5bef3f[_0xeafc('0x26')]=_0x56a57d;if(_0xf76a4[_0xeafc('0x3a')][_0xeafc('0x48')]){_0x480aaf[_0xeafc('0x49')]=[{'all':!![]}];}return db[_0xeafc('0x34')][_0xeafc('0x4a')](_0x480aaf);})[_0xeafc('0x2c')](function(_0x414068){_0x5bef3f[_0xeafc('0x4b')]=_0x414068;return _0x5bef3f;})[_0xeafc('0x2c')](respondWithFilteredResult(_0x1300cf,_0x480aaf))[_0xeafc('0x4c')](handleError(_0x1300cf,null));};exports[_0xeafc('0x4d')]=function(_0x47640c,_0xd9cacd){var _0x369086={'raw':!![],'where':{'id':_0x47640c['params']['id']}},_0x248d27={};_0x248d27[_0xeafc('0x38')]=_[_0xeafc('0x3b')](db[_0xeafc('0x34')]['rawAttributes']);_0x248d27['query']=_[_0xeafc('0x3b')](_0x47640c[_0xeafc('0x3a')]);_0x248d27[_0xeafc('0x3c')]=_[_0xeafc('0x3d')](_0x248d27[_0xeafc('0x38')],_0x248d27[_0xeafc('0x3a')]);_0x369086[_0xeafc('0x3e')]=_['intersection'](_0x248d27['model'],qs[_0xeafc('0x3f')](_0x47640c[_0xeafc('0x3a')][_0xeafc('0x3f')]));_0x369086[_0xeafc('0x3e')]=_0x369086[_0xeafc('0x3e')][_0xeafc('0x40')]?_0x369086[_0xeafc('0x3e')]:_0x248d27[_0xeafc('0x38')];if(_0x47640c[_0xeafc('0x3a')][_0xeafc('0x48')]){_0x369086[_0xeafc('0x49')]=[{'all':!![]}];}_0x369086=_['merge']({},_0x369086,_0x47640c[_0xeafc('0x47')]);return db[_0xeafc('0x34')]['find'](_0x369086)[_0xeafc('0x2c')](handleEntityNotFound(_0xd9cacd,null))[_0xeafc('0x2c')](respondWithResult(_0xd9cacd,null))['catch'](handleError(_0xd9cacd,null));};exports[_0xeafc('0x4e')]=function(_0x51008d,_0x5749ef){return db[_0xeafc('0x34')][_0xeafc('0x4e')](_0x51008d[_0xeafc('0x4f')],{})[_0xeafc('0x2c')](function(_0x18b6ec){var _0x1754b5=_0x51008d[_0xeafc('0x50')]['get']({'plain':!![]});if(!_0x1754b5)throw new Error(_0xeafc('0x51'));if(_0x1754b5[_0xeafc('0x52')]===_0xeafc('0x50')){var _0x555d20=_0x18b6ec[_0xeafc('0x53')]({'plain':!![]});var _0x11fb44=_0xeafc('0x2d');return db[_0xeafc('0x54')][_0xeafc('0x55')]({'where':{'name':_0x11fb44,'userProfileId':_0x1754b5[_0xeafc('0x56')]},'raw':!![]})['then'](function(_0x2ac244){if(_0x2ac244&&_0x2ac244[_0xeafc('0x57')]===0x0){return db['UserProfileResource'][_0xeafc('0x4e')]({'name':_0x555d20[_0xeafc('0x32')],'resourceId':_0x555d20['id'],'type':_0x2ac244['name'],'sectionId':_0x2ac244['id']},{})[_0xeafc('0x2c')](function(){return _0x18b6ec;});}else{return _0x18b6ec;}})[_0xeafc('0x4c')](function(_0x257bcb){logger[_0xeafc('0x30')](_0xeafc('0x58'),_0x257bcb);throw _0x257bcb;});}return _0x18b6ec;})['then'](respondWithResult(_0x5749ef,0xc9))[_0xeafc('0x4c')](handleError(_0x5749ef,null));};exports[_0xeafc('0x2b')]=function(_0x33d2b,_0x570ae2){if(_0x33d2b['body']['id']){delete _0x33d2b[_0xeafc('0x4f')]['id'];}return db[_0xeafc('0x34')][_0xeafc('0x55')]({'where':{'id':_0x33d2b[_0xeafc('0x59')]['id']}})[_0xeafc('0x2c')](handleEntityNotFound(_0x570ae2,null))[_0xeafc('0x2c')](saveUpdates(_0x33d2b[_0xeafc('0x4f')],null))[_0xeafc('0x2c')](respondWithResult(_0x570ae2,null))['catch'](handleError(_0x570ae2,null));};exports[_0xeafc('0x2f')]=function(_0x199b8e,_0x24c5c0){return db[_0xeafc('0x34')][_0xeafc('0x55')]({'where':{'id':_0x199b8e[_0xeafc('0x59')]['id']}})[_0xeafc('0x2c')](handleEntityNotFound(_0x24c5c0,null))['then'](removeEntity(_0x24c5c0,null))['catch'](handleError(_0x24c5c0,null));};exports['describe']=function(_0x1376a9,_0x4e68dd){return db[_0xeafc('0x34')][_0xeafc('0x5a')]()[_0xeafc('0x2c')](respondWithResult(_0x4e68dd,null))[_0xeafc('0x4c')](handleError(_0x4e68dd,null));};exports[_0xeafc('0x5b')]=function(_0x555dee,_0x5bd9aa,_0x6856c3){var _0x1f3c8b={'raw':!![],'where':{}},_0x419bfd={},_0x3e9979;return db['SmsQueue'][_0xeafc('0x5c')]({'where':{'id':_0x555dee['params']['id']}})[_0xeafc('0x2c')](handleEntityNotFound(_0x5bd9aa,null))['then'](function(_0x2a424d){if(_0x2a424d){_0x3e9979=_0x2a424d[_0xeafc('0x53')]({'plain':!![]});_0x419bfd[_0xeafc('0x38')]=_[_0xeafc('0x3b')](db[_0xeafc('0x5d')]['rawAttributes']);_0x419bfd[_0xeafc('0x3a')]=_[_0xeafc('0x3b')](_0x555dee[_0xeafc('0x3a')]);_0x419bfd[_0xeafc('0x3c')]=_['intersection'](_0x419bfd['model'],_0x419bfd[_0xeafc('0x3a')]);_0x1f3c8b[_0xeafc('0x3e')]=_[_0xeafc('0x3d')](_0x419bfd[_0xeafc('0x38')],qs[_0xeafc('0x3f')](_0x555dee[_0xeafc('0x3a')][_0xeafc('0x3f')]));_0x1f3c8b[_0xeafc('0x3e')]=_0x1f3c8b[_0xeafc('0x3e')][_0xeafc('0x40')]?_0x1f3c8b[_0xeafc('0x3e')]:_0x419bfd[_0xeafc('0x38')];if(!_0x555dee[_0xeafc('0x3a')]['hasOwnProperty'](_0xeafc('0x5e'))){_0x1f3c8b['limit']=qs[_0xeafc('0x24')](_0x555dee['query'][_0xeafc('0x24')]);_0x1f3c8b['offset']=qs[_0xeafc('0x27')](_0x555dee[_0xeafc('0x3a')][_0xeafc('0x27')]);}_0x1f3c8b['order']=qs[_0xeafc('0x5f')](_0x555dee[_0xeafc('0x3a')][_0xeafc('0x5f')]);_0x1f3c8b[_0xeafc('0x42')]=qs[_0xeafc('0x3c')](_[_0xeafc('0x60')](_0x555dee['query'],_0x419bfd[_0xeafc('0x3c')]));_0x1f3c8b[_0xeafc('0x42')][_0xeafc('0x61')]=_0x2a424d['id'];if(_0x555dee['query'][_0xeafc('0x43')]){_0x1f3c8b[_0xeafc('0x42')]=_[_0xeafc('0x44')](_0x1f3c8b[_0xeafc('0x42')],{'$or':_['map'](_0x1f3c8b['attributes'],function(_0x141ec6){var _0x35c088={};_0x35c088[_0x141ec6]={'$like':'%'+_0x555dee[_0xeafc('0x3a')][_0xeafc('0x43')]+'%'};return _0x35c088;})});}_0x1f3c8b=_[_0xeafc('0x44')]({},_0x1f3c8b,_0x555dee[_0xeafc('0x47')]);return db['UserSmsQueue']['findAll'](_0x1f3c8b);}})[_0xeafc('0x2c')](function(_0x283107){if(_0x283107){return db['User'][_0xeafc('0x62')]({'where':{'id':_[_0xeafc('0x39')](_0x283107,_0xeafc('0x63')),'role':_0xeafc('0x64')},'attributes':['id',_0xeafc('0x32'),_0xeafc('0x65'),_0xeafc('0x66'),_0xeafc('0x67')]});}})['then'](function(_0x4c0e19){if(_0x4c0e19){return{'count':_0x4c0e19[_0xeafc('0x26')],'rows':_[_0xeafc('0x39')](_0x4c0e19[_0xeafc('0x4b')],function(_0x3072a1){return{'membername':_0x3072a1[_0xeafc('0x32')],'UserId':_0x3072a1['id'],'queue_name':_0x3e9979['name'],'SmsQueueId':_0x3e9979['id'],'interface':util['format'](_0xeafc('0x68'),_0xeafc('0x69'),_0x3072a1[_0xeafc('0x32')]),'penalty':0x0,'paused':_0x3072a1[_0xeafc('0x65')],'createdAt':_0x3072a1[_0xeafc('0x67')],'updatedAt':_0x3072a1[_0xeafc('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeafc('0x2c')](respondWithFilteredResult(_0x5bd9aa,_0x1f3c8b))[_0xeafc('0x4c')](handleError(_0x5bd9aa,null));};exports[_0xeafc('0x6a')]=function(_0x37dddc,_0x15d9d1,_0x2e8cef){var _0x16e20f={};var _0x5b095f={};var _0x461879;var _0x3539ab;return db['SmsQueue'][_0xeafc('0x5c')]({'where':{'id':_0x37dddc[_0xeafc('0x59')]['id']}})['then'](handleEntityNotFound(_0x15d9d1,null))[_0xeafc('0x2c')](function(_0x351f6f){if(_0x351f6f){_0x461879=_0x351f6f;_0x5b095f[_0xeafc('0x38')]=_['keys'](db['Team']['rawAttributes']);_0x5b095f[_0xeafc('0x3a')]=_[_0xeafc('0x3b')](_0x37dddc[_0xeafc('0x3a')]);_0x5b095f['filters']=_[_0xeafc('0x3d')](_0x5b095f[_0xeafc('0x38')],_0x5b095f[_0xeafc('0x3a')]);_0x16e20f[_0xeafc('0x3e')]=_[_0xeafc('0x3d')](_0x5b095f['model'],qs[_0xeafc('0x3f')](_0x37dddc['query'][_0xeafc('0x3f')]));_0x16e20f[_0xeafc('0x3e')]=_0x16e20f[_0xeafc('0x3e')][_0xeafc('0x40')]?_0x16e20f[_0xeafc('0x3e')]:_0x5b095f[_0xeafc('0x38')];_0x16e20f[_0xeafc('0x41')]=qs['sort'](_0x37dddc[_0xeafc('0x3a')]['sort']);_0x16e20f['where']=qs['filters'](_[_0xeafc('0x60')](_0x37dddc[_0xeafc('0x3a')],_0x5b095f[_0xeafc('0x3c')]));if(_0x37dddc[_0xeafc('0x3a')][_0xeafc('0x43')]){_0x16e20f[_0xeafc('0x42')]=_[_0xeafc('0x44')](_0x16e20f[_0xeafc('0x42')],{'$or':_[_0xeafc('0x39')](_0x16e20f['attributes'],function(_0x49c481){var _0x1d81c5={};_0x1d81c5[_0x49c481]={'$like':'%'+_0x37dddc['query'][_0xeafc('0x43')]+'%'};return _0x1d81c5;})});}_0x16e20f=_[_0xeafc('0x44')]({},_0x16e20f,_0x37dddc[_0xeafc('0x47')]);return _0x461879[_0xeafc('0x6a')](_0x16e20f);}})[_0xeafc('0x2c')](function(_0x3ef177){if(_0x3ef177){_0x3539ab=_0x3ef177['length'];if(!_0x37dddc['query'][_0xeafc('0x6b')]('nolimit')){_0x16e20f['limit']=qs[_0xeafc('0x24')](_0x37dddc[_0xeafc('0x3a')][_0xeafc('0x24')]);_0x16e20f[_0xeafc('0x27')]=qs[_0xeafc('0x27')](_0x37dddc[_0xeafc('0x3a')]['offset']);}return _0x461879[_0xeafc('0x6a')](_0x16e20f);}})[_0xeafc('0x2c')](function(_0xc4ed37){if(_0xc4ed37){return _0xc4ed37?{'count':_0x3539ab,'rows':_0xc4ed37}:null;}})[_0xeafc('0x2c')](respondWithResult(_0x15d9d1,null))[_0xeafc('0x4c')](handleError(_0x15d9d1,null));};exports[_0xeafc('0x6c')]=function(_0x2a3485,_0x1b6f02,_0x3c35ce){var _0x20e720=_0x2a3485[_0xeafc('0x4f')][_0xeafc('0x6d')];return db['Team']['findAll']({'where':{'id':_0x20e720},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeafc('0x6e'),'attributes':['id',_0xeafc('0x32'),_0xeafc('0x6f'),_0xeafc('0x70'),'interface'],'raw':!![]}]})[_0xeafc('0x2c')](function(_0x347d2c){if(_0x347d2c){var _0x201cd7=_[_0xeafc('0x71')](_0x347d2c,function(_0x3b88f4){var _0x1a9859=_0x3b88f4[_0xeafc('0x53')]({'plain':!![]});return _0x1a9859[_0xeafc('0x6e')];});return db[_0xeafc('0x34')][_0xeafc('0x55')]({'where':{'id':_0x2a3485[_0xeafc('0x59')]['id']}})[_0xeafc('0x2c')](function(_0x5e2505){return db[_0xeafc('0x72')][_0xeafc('0x73')](function(_0x430c14){return _0x5e2505['addTeams'](_0x20e720,{'transaction':_0x430c14})[_0xeafc('0x2c')](function(){return BPromise[_0xeafc('0x74')](_0x201cd7,function(_0x5e3128){return db['UserSmsQueue'][_0xeafc('0x75')]({'where':{'UserId':_0x5e3128['id'],'SmsQueueId':_0x2a3485[_0xeafc('0x59')]['id']},'transaction':_0x430c14});});})['then'](function(){_0x201cd7['forEach'](function(_0x17ca04){socket[_0xeafc('0x76')](_0xeafc('0x77'),{'UserId':_0x17ca04['id'],'SmsQueueId':_0x5e2505['id']});});});});});}})['then'](respondWithStatusCode(_0x1b6f02,null))[_0xeafc('0x4c')](handleError(_0x1b6f02,null));};exports['removeTeams']=function(_0x32e0d8,_0x4565e1,_0x244ae1){return db[_0xeafc('0x78')][_0xeafc('0x4a')]({'where':{'id':_0x32e0d8[_0xeafc('0x3a')][_0xeafc('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeafc('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xeafc('0x2c')](handleEntityNotFound(_0x4565e1,null))[_0xeafc('0x2c')](function(_0x3d78b5){var _0x142788=_['map'](_0x3d78b5,'id');var _0x4c044c=[];var _0x41f600=[];var _0x26a99e=squel[_0xeafc('0x79')]();_0x26a99e[_0xeafc('0x7a')](_0xeafc('0x7b'))[_0xeafc('0x7c')](_0xeafc('0x7d'),'tq')['join'](_0xeafc('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xeafc('0x42')]('SmsQueueId\x20=\x20?',_0x32e0d8[_0xeafc('0x59')]['id']);for(var _0x306cd2=0x0;_0x306cd2<_0x3d78b5[_0xeafc('0x40')];_0x306cd2+=0x1){let _0x335b4c=_0x3d78b5[_0x306cd2];for(var _0x513282=0x0;_0x513282<_0x335b4c['Agents'][_0xeafc('0x40')];_0x513282+=0x1){let _0x39a3e7=_0x335b4c[_0xeafc('0x6e')][_0x513282];var _0x1c8a05=_0x26a99e[_0xeafc('0x7f')]();_0x1c8a05[_0xeafc('0x42')](_0xeafc('0x80'),_0x39a3e7['id']);_0x41f600[_0xeafc('0x81')](db[_0xeafc('0x72')]['query'](_0x1c8a05[_0xeafc('0x82')](),{'type':db[_0xeafc('0x72')]['QueryTypes'][_0xeafc('0x83')]})['then'](function(_0x2b78c1){if(_0x2b78c1['length']===0x1){return _0x39a3e7['id'];}else{var _0x172cd6=_['every'](_[_0xeafc('0x39')](_0x2b78c1,_0xeafc('0x84')),function(_0x4036a4){return _[_0xeafc('0x85')](_0x142788,_0x4036a4);});if(_0x172cd6){return _0x39a3e7['id'];}}}));}}return BPromise[_0xeafc('0x86')](_0x41f600)[_0xeafc('0x2c')](function(_0x2fb113){_0x4c044c=_(_0x4c044c)[_0xeafc('0x87')](_0x2fb113)['compact']()[_0xeafc('0x88')]();return db[_0xeafc('0x34')][_0xeafc('0x55')]({'where':{'id':_0x32e0d8['params']['id']}})['then'](function(_0x44d7bd){return db['sequelize']['transaction'](function(_0x1491c0){return _0x44d7bd[_0xeafc('0x89')](_0x32e0d8['query'][_0xeafc('0x6d')],{'transaction':_0x1491c0})[_0xeafc('0x2c')](function(){if(!_['isEmpty'](_0x4c044c)){return _0x44d7bd[_0xeafc('0x8a')](_0x4c044c,{'transaction':_0x1491c0});}})['then'](function(){_0x4c044c['forEach'](function(_0x499fa6){socket[_0xeafc('0x76')](_0xeafc('0x8b'),{'UserId':_0x499fa6,'SmsQueueId':_0x44d7bd['id']});});});});});});})[_0xeafc('0x2c')](respondWithStatusCode(_0x4565e1,null))[_0xeafc('0x4c')](handleError(_0x4565e1,null));};exports[_0xeafc('0x8c')]=function(_0x254c01,_0x468f0a,_0x155341){return db[_0xeafc('0x34')][_0xeafc('0x55')]({'where':{'id':_0x254c01[_0xeafc('0x59')]['id']}})['then'](handleEntityNotFound(_0x468f0a,null))[_0xeafc('0x2c')](function(_0x3ba8be){if(_0x3ba8be){return _0x3ba8be[_0xeafc('0x8c')](_0x254c01[_0xeafc('0x4f')][_0xeafc('0x6d')],_['omit'](_0x254c01[_0xeafc('0x4f')],[_0xeafc('0x6d'),'id'])||{})['spread'](function(_0x2fb6f7){for(var _0x2d1ee4=0x0;_0x2d1ee4<_0x254c01[_0xeafc('0x4f')][_0xeafc('0x6d')][_0xeafc('0x40')];_0x2d1ee4+=0x1){socket[_0xeafc('0x76')]('userSmsQueue:save',{'UserId':Number(_0x254c01[_0xeafc('0x4f')]['ids'][_0x2d1ee4]),'SmsQueueId':Number(_0x254c01[_0xeafc('0x59')]['id'])});}return _0x2fb6f7;});}})[_0xeafc('0x2c')](respondWithResult(_0x468f0a,null))[_0xeafc('0x4c')](handleError(_0x468f0a,null));};exports['removeAgents']=function(_0x41c405,_0x496e27,_0x481d7d){return db['SmsQueue']['find']({'where':{'id':_0x41c405[_0xeafc('0x59')]['id']}})[_0xeafc('0x2c')](handleEntityNotFound(_0x496e27,null))[_0xeafc('0x2c')](function(_0x4b6bc2){if(_0x4b6bc2){return _0x4b6bc2[_0xeafc('0x8a')](_0x41c405[_0xeafc('0x3a')][_0xeafc('0x6d')])[_0xeafc('0x2c')](function(){if(_['isArray'](_0x41c405[_0xeafc('0x3a')][_0xeafc('0x6d')])){for(var _0x47fd9a=0x0;_0x47fd9a<_0x41c405['query'][_0xeafc('0x6d')][_0xeafc('0x40')];_0x47fd9a+=0x1){socket[_0xeafc('0x76')](_0xeafc('0x8b'),{'UserId':Number(_0x41c405[_0xeafc('0x3a')][_0xeafc('0x6d')][_0x47fd9a]),'SmsQueueId':Number(_0x41c405[_0xeafc('0x59')]['id'])});}}else{socket[_0xeafc('0x76')](_0xeafc('0x8b'),{'UserId':Number(_0x41c405[_0xeafc('0x3a')][_0xeafc('0x6d')]),'SmsQueueId':Number(_0x41c405[_0xeafc('0x59')]['id'])});}});}})[_0xeafc('0x2c')](respondWithStatusCode(_0x496e27,null))['catch'](handleError(_0x496e27,null));};exports[_0xeafc('0x8d')]=function(_0x6fe00c,_0x17786e,_0x5c4b5a){var _0x4e0bcb={};var _0x156d3c={};var _0x25f52d;var _0x4216a8;return db[_0xeafc('0x34')]['findOne']({'where':{'id':_0x6fe00c[_0xeafc('0x59')]['id']}})[_0xeafc('0x2c')](handleEntityNotFound(_0x17786e,null))[_0xeafc('0x2c')](function(_0x5b9f43){if(_0x5b9f43){_0x25f52d=_0x5b9f43;_0x156d3c['model']=_[_0xeafc('0x3b')](db[_0xeafc('0x8e')][_0xeafc('0x35')]);_0x156d3c[_0xeafc('0x3a')]=_[_0xeafc('0x3b')](_0x6fe00c[_0xeafc('0x3a')]);_0x156d3c[_0xeafc('0x3c')]=_['intersection'](_0x156d3c[_0xeafc('0x38')],_0x156d3c[_0xeafc('0x3a')]);_0x4e0bcb['attributes']=_['intersection'](_0x156d3c[_0xeafc('0x38')],qs[_0xeafc('0x3f')](_0x6fe00c[_0xeafc('0x3a')]['fields']));_0x4e0bcb[_0xeafc('0x3e')]=_0x4e0bcb[_0xeafc('0x3e')][_0xeafc('0x40')]?_0x4e0bcb[_0xeafc('0x3e')]:_0x156d3c[_0xeafc('0x38')];_0x4e0bcb[_0xeafc('0x41')]=qs['sort'](_0x6fe00c['query']['sort']);_0x4e0bcb['where']=qs[_0xeafc('0x3c')](_['pick'](_0x6fe00c[_0xeafc('0x3a')],_0x156d3c[_0xeafc('0x3c')]));if(_0x6fe00c[_0xeafc('0x3a')][_0xeafc('0x43')]){_0x4e0bcb[_0xeafc('0x42')]=_[_0xeafc('0x44')](_0x4e0bcb['where'],{'$or':_[_0xeafc('0x39')](_0x4e0bcb[_0xeafc('0x3e')],function(_0x415789){var _0x1193b5={};_0x1193b5[_0x415789]={'$like':'%'+_0x6fe00c[_0xeafc('0x3a')][_0xeafc('0x43')]+'%'};return _0x1193b5;})});}_0x4e0bcb=_[_0xeafc('0x44')]({},_0x4e0bcb,_0x6fe00c[_0xeafc('0x47')]);return _0x25f52d['getAgents'](_0x4e0bcb);}})[_0xeafc('0x2c')](function(_0x133f9f){if(_0x133f9f){_0x4216a8=_0x133f9f[_0xeafc('0x40')];if(!_0x6fe00c[_0xeafc('0x3a')]['hasOwnProperty'](_0xeafc('0x5e'))){_0x4e0bcb[_0xeafc('0x24')]=qs[_0xeafc('0x24')](_0x6fe00c['query'][_0xeafc('0x24')]);_0x4e0bcb[_0xeafc('0x27')]=qs[_0xeafc('0x27')](_0x6fe00c[_0xeafc('0x3a')][_0xeafc('0x27')]);}return _0x25f52d['getAgents'](_0x4e0bcb);}})[_0xeafc('0x2c')](function(_0x1a4c56){if(_0x1a4c56){return _0x1a4c56?{'count':_0x4216a8,'rows':_0x1a4c56}:null;}})['then'](respondWithResult(_0x17786e,null))[_0xeafc('0x4c')](handleError(_0x17786e,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index cf9d9f4..142a36f 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 _0x8d2b=['SmsQueue','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x250ed4,_0x3ff892){var _0x49a259=function(_0xd8e64e){while(--_0xd8e64e){_0x250ed4['push'](_0x250ed4['shift']());}};_0x49a259(++_0x3ff892);}(_0x8d2b,0x193));var _0xb8d2=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x8d2b[_0x1da04e];return _0xdd8c41;};'use strict';var EventEmitter=require(_0xb8d2('0x0'));var SmsQueue=require(_0xb8d2('0x1'))['db'][_0xb8d2('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8d2('0x3'),'afterUpdate':_0xb8d2('0x4'),'afterDestroy':_0xb8d2('0x5')};function emitEvent(_0xac7339){return function(_0xaaa92e,_0x4c0763,_0x1031a9){SmsQueueEvents[_0xb8d2('0x6')](_0xac7339+':'+_0xaaa92e['id'],_0xaaa92e);SmsQueueEvents['emit'](_0xac7339,_0xaaa92e);_0x1031a9(null);};}for(var e in events){if(events[_0xb8d2('0x7')](e)){var event=events[e];SmsQueue[_0xb8d2('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xc7eb=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x49f2bf,_0x461315){var _0x1897ac=function(_0x1d1591){while(--_0x1d1591){_0x49f2bf['push'](_0x49f2bf['shift']());}};_0x1897ac(++_0x461315);}(_0xc7eb,0x135));var _0xbc7e=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xc7eb[_0x2b0bc2];return _0x56e5b9;};'use strict';var EventEmitter=require(_0xbc7e('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbc7e('0x1')](0x0);var events={'afterCreate':_0xbc7e('0x2'),'afterUpdate':_0xbc7e('0x3'),'afterDestroy':_0xbc7e('0x4')};function emitEvent(_0x5d74b8){return function(_0x5f056d,_0x272c6a,_0x56575d){SmsQueueEvents[_0xbc7e('0x5')](_0x5d74b8+':'+_0x5f056d['id'],_0x5f056d);SmsQueueEvents[_0xbc7e('0x5')](_0x5d74b8,_0x5f056d);_0x56575d(null);};}for(var e in events){if(events[_0xbc7e('0x6')](e)){var event=events[e];SmsQueue[_0xbc7e('0x7')](e,emitEvent(event));}}module[_0xbc7e('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 206fef6..c903bf8 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 _0x463f=['moment','bluebird','request-promise','rimraf','./smsQueue.attributes','exports','define','SmsQueue','lodash','util','../../config/logger','api'];(function(_0x3e74d6,_0xe1ce2c){var _0x55c422=function(_0x66e378){while(--_0x66e378){_0x3e74d6['push'](_0x3e74d6['shift']());}};_0x55c422(++_0xe1ce2c);}(_0x463f,0x164));var _0xf463=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x463f[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xf463('0x0'));var util=require(_0xf463('0x1'));var logger=require(_0xf463('0x2'))(_0xf463('0x3'));var moment=require(_0xf463('0x4'));var BPromise=require(_0xf463('0x5'));var rp=require(_0xf463('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf463('0x7'));var config=require('../../config/environment');var attributes=require(_0xf463('0x8'));module[_0xf463('0x9')]=function(_0x57485a,_0x4eda09){return _0x57485a[_0xf463('0xa')](_0xf463('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb470=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0xb470,0x75));var _0x0b47=function(_0x3ab57f,_0x5251fe){_0x3ab57f=_0x3ab57f-0x0;var _0x5781e4=_0xb470[_0x3ab57f];return _0x5781e4;};'use strict';var _=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var logger=require(_0x0b47('0x2'))(_0x0b47('0x3'));var moment=require('moment');var BPromise=require(_0x0b47('0x4'));var rp=require(_0x0b47('0x5'));var fs=require('fs');var path=require(_0x0b47('0x6'));var rimraf=require('rimraf');var config=require(_0x0b47('0x7'));var attributes=require(_0x0b47('0x8'));module[_0x0b47('0x9')]=function(_0x7cb3c9,_0xc1211c){return _0x7cb3c9[_0x0b47('0xa')](_0x0b47('0xb'),attributes,{'tableName':_0x0b47('0xc'),'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 d5a75af..3fa98a6 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 _0x9820=['defaults','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowSmsQueue','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis'];(function(_0x5cce12,_0x50b5c7){var _0x481200=function(_0x5cdafc){while(--_0x5cdafc){_0x5cce12['push'](_0x5cce12['shift']());}};_0x481200(++_0x50b5c7);}(_0x9820,0x1b3));var _0x0982=function(_0x528529,_0x3b0cf6){_0x528529=_0x528529-0x0;var _0x9c825=_0x9820[_0x528529];return _0x9c825;};'use strict';var _=require(_0x0982('0x0'));var util=require('util');var moment=require(_0x0982('0x1'));var BPromise=require('bluebird');var rs=require(_0x0982('0x2'));var fs=require('fs');var Redis=require(_0x0982('0x3'));var db=require(_0x0982('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0982('0x5'));var config=require(_0x0982('0x6'));var jayson=require(_0x0982('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x0982('0x8')]=_[_0x0982('0x9')](config[_0x0982('0x8')],{'host':_0x0982('0xa'),'port':0x18eb});var socket=require(_0x0982('0xb'))(new Redis(config[_0x0982('0x8')]));require('./smsQueue.socket')[_0x0982('0xc')](socket);function respondWithRpcPromise(_0x48f770,_0x3d5df2,_0x28b64f){return new BPromise(function(_0x3d8bc0,_0xa83bdc){return client[_0x0982('0xd')](_0x48f770,_0x28b64f)[_0x0982('0xe')](function(_0x5dd5cf){logger[_0x0982('0xf')](_0x0982('0x10'),_0x3d5df2,_0x0982('0x11'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3d5df2,'request\x20sent',JSON[_0x0982('0x12')](_0x5dd5cf));if(_0x5dd5cf['error']){if(_0x5dd5cf['error'][_0x0982('0x13')]===0x1f4){logger[_0x0982('0x14')](_0x0982('0x10'),_0x3d5df2,_0x5dd5cf[_0x0982('0x14')][_0x0982('0x15')]);return _0xa83bdc(_0x5dd5cf['error'][_0x0982('0x15')]);}logger['error'](_0x0982('0x10'),_0x3d5df2,_0x5dd5cf[_0x0982('0x14')]['message']);return _0x3d8bc0(_0x5dd5cf['error'][_0x0982('0x15')]);}else{logger['info'](_0x0982('0x10'),_0x3d5df2,_0x0982('0x11'));_0x3d8bc0(_0x5dd5cf[_0x0982('0x16')][_0x0982('0x15')]);}})[_0x0982('0x17')](function(_0x36d8b4){logger[_0x0982('0x14')](_0x0982('0x10'),_0x3d5df2,_0x36d8b4);_0xa83bdc(_0x36d8b4);});});}exports[_0x0982('0x18')]=function(_0x1e7071){var _0x2bdeab=this;return new Promise(function(_0x451d30,_0x1a2fcd){return db[_0x0982('0x19')][_0x0982('0x1a')]({'raw':_0x1e7071['options']?_0x1e7071[_0x0982('0x1b')][_0x0982('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e7071[_0x0982('0x1b')]?_0x1e7071[_0x0982('0x1b')][_0x0982('0x1d')]||null:null,'attributes':_0x1e7071[_0x0982('0x1b')]?_0x1e7071[_0x0982('0x1b')]['attributes']||null:null,'limit':_0x1e7071[_0x0982('0x1b')]?_0x1e7071[_0x0982('0x1b')][_0x0982('0x1e')]||null:null,'include':_0x1e7071[_0x0982('0x1b')]?_0x1e7071[_0x0982('0x1b')][_0x0982('0x1f')]?_[_0x0982('0x20')](_0x1e7071[_0x0982('0x1b')][_0x0982('0x1f')],function(_0x20e54b){return{'model':db[_0x20e54b[_0x0982('0x21')]],'as':_0x20e54b['as'],'attributes':_0x20e54b['attributes'],'include':_0x20e54b[_0x0982('0x1f')]?_[_0x0982('0x20')](_0x20e54b['include'],function(_0x57bdef){return{'model':db[_0x57bdef[_0x0982('0x21')]],'as':_0x57bdef['as'],'attributes':_0x57bdef['attributes'],'include':_0x57bdef[_0x0982('0x1f')]?_[_0x0982('0x20')](_0x57bdef[_0x0982('0x1f')],function(_0x1e9d2f){return{'model':db[_0x1e9d2f[_0x0982('0x21')]],'as':_0x1e9d2f['as'],'attributes':_0x1e9d2f[_0x0982('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0982('0xe')](function(_0x33e543){logger[_0x0982('0xf')]('GetSmsQueue',_0x1e7071);logger[_0x0982('0x23')](_0x0982('0x18'),_0x1e7071,JSON[_0x0982('0x12')](_0x33e543));_0x451d30(_0x33e543);})[_0x0982('0x17')](function(_0x2d90ff){logger[_0x0982('0x14')](_0x0982('0x18'),_0x2d90ff['message'],_0x1e7071);_0x1a2fcd(_0x2bdeab[_0x0982('0x14')](0x1f4,_0x2d90ff[_0x0982('0x15')]));});});};exports['ShowSmsQueue']=function(_0x33f12e){var _0x28fd52=this;return new Promise(function(_0x32fe3d,_0x2ae113){return db[_0x0982('0x19')]['find']({'raw':_0x33f12e['options']?_0x33f12e[_0x0982('0x1b')][_0x0982('0x1c')]===undefined?!![]:![]:!![],'where':_0x33f12e[_0x0982('0x1b')]?_0x33f12e[_0x0982('0x1b')][_0x0982('0x1d')]||null:null,'attributes':_0x33f12e['options']?_0x33f12e[_0x0982('0x1b')][_0x0982('0x22')]||null:null,'include':_0x33f12e[_0x0982('0x1b')]?_0x33f12e[_0x0982('0x1b')]['include']?_['map'](_0x33f12e[_0x0982('0x1b')][_0x0982('0x1f')],function(_0x3e8416){return{'model':db[_0x3e8416[_0x0982('0x21')]],'as':_0x3e8416['as'],'attributes':_0x3e8416['attributes'],'include':_0x3e8416[_0x0982('0x1f')]?_[_0x0982('0x20')](_0x3e8416[_0x0982('0x1f')],function(_0x49a421){return{'model':db[_0x49a421[_0x0982('0x21')]],'as':_0x49a421['as'],'attributes':_0x49a421['attributes'],'include':_0x49a421[_0x0982('0x1f')]?_[_0x0982('0x20')](_0x49a421[_0x0982('0x1f')],function(_0x5472e2){return{'model':db[_0x5472e2[_0x0982('0x21')]],'as':_0x5472e2['as'],'attributes':_0x5472e2[_0x0982('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56dfd0){logger['info'](_0x0982('0x24'),_0x33f12e);logger[_0x0982('0x23')](_0x0982('0x24'),_0x33f12e,JSON['stringify'](_0x56dfd0));_0x32fe3d(_0x56dfd0);})[_0x0982('0x17')](function(_0x1ed2d8){logger[_0x0982('0x14')](_0x0982('0x24'),_0x1ed2d8['message'],_0x33f12e);_0x2ae113(_0x28fd52[_0x0982('0x14')](0x1f4,_0x1ed2d8[_0x0982('0x15')]));});});}; \ No newline at end of file +var _0xe5e3=['http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowSmsQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xd49176,_0x50d337){var _0xf5367f=function(_0x2e7293){while(--_0x2e7293){_0xd49176['push'](_0xd49176['shift']());}};_0xf5367f(++_0x50d337);}(_0xe5e3,0x155));var _0x3e5e=function(_0x224a94,_0x58c8bc){_0x224a94=_0x224a94-0x0;var _0x1fb3ec=_0xe5e3[_0x224a94];return _0x1fb3ec;};'use strict';var _=require(_0x3e5e('0x0'));var util=require(_0x3e5e('0x1'));var moment=require(_0x3e5e('0x2'));var BPromise=require(_0x3e5e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e5e('0x4'));var db=require(_0x3e5e('0x5'))['db'];var utils=require(_0x3e5e('0x6'));var logger=require(_0x3e5e('0x7'))('rpc');var config=require(_0x3e5e('0x8'));var jayson=require(_0x3e5e('0x9'));var client=jayson['client'][_0x3e5e('0xa')]({'port':0x232a});config[_0x3e5e('0xb')]=_[_0x3e5e('0xc')](config[_0x3e5e('0xb')],{'host':_0x3e5e('0xd'),'port':0x18eb});var socket=require(_0x3e5e('0xe'))(new Redis(config[_0x3e5e('0xb')]));require(_0x3e5e('0xf'))['register'](socket);function respondWithRpcPromise(_0x1e8b7d,_0x3e2d54,_0x23f487){return new BPromise(function(_0x1f1807,_0x2980c9){return client[_0x3e5e('0x10')](_0x1e8b7d,_0x23f487)['then'](function(_0x440105){logger[_0x3e5e('0x11')]('SmsQueue,\x20%s,\x20%s',_0x3e2d54,_0x3e5e('0x12'));logger[_0x3e5e('0x13')](_0x3e5e('0x14'),_0x3e2d54,_0x3e5e('0x12'),JSON[_0x3e5e('0x15')](_0x440105));if(_0x440105[_0x3e5e('0x16')]){if(_0x440105[_0x3e5e('0x16')][_0x3e5e('0x17')]===0x1f4){logger[_0x3e5e('0x16')]('SmsQueue,\x20%s,\x20%s',_0x3e2d54,_0x440105[_0x3e5e('0x16')][_0x3e5e('0x18')]);return _0x2980c9(_0x440105['error'][_0x3e5e('0x18')]);}logger[_0x3e5e('0x16')](_0x3e5e('0x19'),_0x3e2d54,_0x440105['error']['message']);return _0x1f1807(_0x440105['error']['message']);}else{logger[_0x3e5e('0x11')](_0x3e5e('0x19'),_0x3e2d54,_0x3e5e('0x12'));_0x1f1807(_0x440105['result']['message']);}})[_0x3e5e('0x1a')](function(_0x5cfc6a){logger[_0x3e5e('0x16')]('SmsQueue,\x20%s,\x20%s',_0x3e2d54,_0x5cfc6a);_0x2980c9(_0x5cfc6a);});});}exports['GetSmsQueue']=function(_0x41fa7d){var _0x447ef3=this;return new Promise(function(_0x44093c,_0x2615ed){return db[_0x3e5e('0x1b')][_0x3e5e('0x1c')]({'raw':_0x41fa7d['options']?_0x41fa7d[_0x3e5e('0x1d')][_0x3e5e('0x1e')]===undefined?!![]:![]:!![],'where':_0x41fa7d[_0x3e5e('0x1d')]?_0x41fa7d['options'][_0x3e5e('0x1f')]||null:null,'attributes':_0x41fa7d[_0x3e5e('0x1d')]?_0x41fa7d[_0x3e5e('0x1d')][_0x3e5e('0x20')]||null:null,'limit':_0x41fa7d[_0x3e5e('0x1d')]?_0x41fa7d[_0x3e5e('0x1d')][_0x3e5e('0x21')]||null:null,'include':_0x41fa7d[_0x3e5e('0x1d')]?_0x41fa7d['options'][_0x3e5e('0x22')]?_['map'](_0x41fa7d[_0x3e5e('0x1d')][_0x3e5e('0x22')],function(_0x431de5){return{'model':db[_0x431de5['model']],'as':_0x431de5['as'],'attributes':_0x431de5[_0x3e5e('0x20')],'include':_0x431de5[_0x3e5e('0x22')]?_[_0x3e5e('0x23')](_0x431de5[_0x3e5e('0x22')],function(_0x244756){return{'model':db[_0x244756[_0x3e5e('0x24')]],'as':_0x244756['as'],'attributes':_0x244756[_0x3e5e('0x20')],'include':_0x244756['include']?_[_0x3e5e('0x23')](_0x244756['include'],function(_0x274ad1){return{'model':db[_0x274ad1[_0x3e5e('0x24')]],'as':_0x274ad1['as'],'attributes':_0x274ad1[_0x3e5e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3e5e('0x25')](function(_0x124a74){logger[_0x3e5e('0x11')]('GetSmsQueue',_0x41fa7d);logger['debug']('GetSmsQueue',_0x41fa7d,JSON[_0x3e5e('0x15')](_0x124a74));_0x44093c(_0x124a74);})[_0x3e5e('0x1a')](function(_0x14b26e){logger[_0x3e5e('0x16')]('GetSmsQueue',_0x14b26e['message'],_0x41fa7d);_0x2615ed(_0x447ef3[_0x3e5e('0x16')](0x1f4,_0x14b26e[_0x3e5e('0x18')]));});});};exports[_0x3e5e('0x26')]=function(_0x5af5b0){var _0x5dcb55=this;return new Promise(function(_0x515b3b,_0x34838d){return db[_0x3e5e('0x1b')]['find']({'raw':_0x5af5b0[_0x3e5e('0x1d')]?_0x5af5b0[_0x3e5e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5af5b0[_0x3e5e('0x1d')]?_0x5af5b0[_0x3e5e('0x1d')][_0x3e5e('0x1f')]||null:null,'attributes':_0x5af5b0[_0x3e5e('0x1d')]?_0x5af5b0[_0x3e5e('0x1d')][_0x3e5e('0x20')]||null:null,'include':_0x5af5b0[_0x3e5e('0x1d')]?_0x5af5b0[_0x3e5e('0x1d')][_0x3e5e('0x22')]?_[_0x3e5e('0x23')](_0x5af5b0['options'][_0x3e5e('0x22')],function(_0x4ba8ec){return{'model':db[_0x4ba8ec['model']],'as':_0x4ba8ec['as'],'attributes':_0x4ba8ec['attributes'],'include':_0x4ba8ec[_0x3e5e('0x22')]?_[_0x3e5e('0x23')](_0x4ba8ec[_0x3e5e('0x22')],function(_0xa49bbb){return{'model':db[_0xa49bbb[_0x3e5e('0x24')]],'as':_0xa49bbb['as'],'attributes':_0xa49bbb[_0x3e5e('0x20')],'include':_0xa49bbb[_0x3e5e('0x22')]?_[_0x3e5e('0x23')](_0xa49bbb[_0x3e5e('0x22')],function(_0x297084){return{'model':db[_0x297084['model']],'as':_0x297084['as'],'attributes':_0x297084[_0x3e5e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb2f4e4){logger[_0x3e5e('0x11')](_0x3e5e('0x26'),_0x5af5b0);logger[_0x3e5e('0x13')](_0x3e5e('0x26'),_0x5af5b0,JSON[_0x3e5e('0x15')](_0xb2f4e4));_0x515b3b(_0xb2f4e4);})[_0x3e5e('0x1a')](function(_0x50e9d3){logger['error'](_0x3e5e('0x26'),_0x50e9d3[_0x3e5e('0x18')],_0x5af5b0);_0x34838d(_0x5dcb55['error'](0x1f4,_0x50e9d3[_0x3e5e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 9ad9d15..d905054 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 _0xdcff=['./smsQueue.events','remove','update','emit','removeListener','register'];(function(_0x1b5da8,_0x444cc1){var _0x98289c=function(_0x22f2e7){while(--_0x22f2e7){_0x1b5da8['push'](_0x1b5da8['shift']());}};_0x98289c(++_0x444cc1);}(_0xdcff,0xf0));var _0xfdcf=function(_0x15b928,_0x180655){_0x15b928=_0x15b928-0x0;var _0x5b7345=_0xdcff[_0x15b928];return _0x5b7345;};'use strict';var SmsQueueEvents=require(_0xfdcf('0x0'));var events=['save',_0xfdcf('0x1'),_0xfdcf('0x2')];function createListener(_0x2f9931,_0x3ceec8){return function(_0x33a757){_0x3ceec8[_0xfdcf('0x3')](_0x2f9931,_0x33a757);};}function removeListener(_0x502a81,_0x161c08){return function(){SmsQueueEvents[_0xfdcf('0x4')](_0x502a81,_0x161c08);};}exports[_0xfdcf('0x5')]=function(_0x57872e){for(var _0xe814d2=0x0,_0xd45b95=events['length'];_0xe814d2<_0xd45b95;_0xe814d2++){var _0x565e6c=events[_0xe814d2];var _0x555ceb=createListener('smsQueue:'+_0x565e6c,_0x57872e);SmsQueueEvents['on'](_0x565e6c,_0x555ceb);}}; \ No newline at end of file +var _0x5886=['save','remove','update','emit','length','smsQueue:','./smsQueue.events'];(function(_0x29e7fa,_0x231b9c){var _0x93b500=function(_0x23d559){while(--_0x23d559){_0x29e7fa['push'](_0x29e7fa['shift']());}};_0x93b500(++_0x231b9c);}(_0x5886,0x84));var _0x6588=function(_0x1509d8,_0x198d74){_0x1509d8=_0x1509d8-0x0;var _0x43e2d9=_0x5886[_0x1509d8];return _0x43e2d9;};'use strict';var SmsQueueEvents=require(_0x6588('0x0'));var events=[_0x6588('0x1'),_0x6588('0x2'),_0x6588('0x3')];function createListener(_0x134e90,_0xedf057){return function(_0x506476){_0xedf057[_0x6588('0x4')](_0x134e90,_0x506476);};}function removeListener(_0x3a6f06,_0x39c59f){return function(){SmsQueueEvents['removeListener'](_0x3a6f06,_0x39c59f);};}exports['register']=function(_0x5a7cac){for(var _0xfc61c5=0x0,_0x509438=events[_0x6588('0x5')];_0xfc61c5<_0x509438;_0xfc61c5++){var _0x4409a6=events[_0xfc61c5];var _0x2cdf2e=createListener(_0x6588('0x6')+_0x4409a6,_0x5a7cac);SmsQueueEvents['on'](_0x4409a6,_0x2cdf2e);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 198f1a9..95c8a2b 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 _0xcff4=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x514209,_0xddad6b){var _0xd8bb10=function(_0x2bc3a0){while(--_0x2bc3a0){_0x514209['push'](_0x514209['shift']());}};_0xd8bb10(++_0xddad6b);}(_0xcff4,0x6d));var _0x4cff=function(_0x5baa35,_0x6c437e){_0x5baa35=_0x5baa35-0x0;var _0x1cdbc6=_0xcff4[_0x5baa35];return _0x1cdbc6;};'use strict';var multer=require(_0x4cff('0x0'));var util=require(_0x4cff('0x1'));var path=require(_0x4cff('0x2'));var timeout=require(_0x4cff('0x3'));var express=require(_0x4cff('0x4'));var router=express[_0x4cff('0x5')]();var fs_extra=require(_0x4cff('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4cff('0x7'));var controller=require(_0x4cff('0x8'));router[_0x4cff('0x9')]('/',auth[_0x4cff('0xa')](),controller[_0x4cff('0xb')]);router[_0x4cff('0x9')]('/describe',auth[_0x4cff('0xa')](),controller[_0x4cff('0xc')]);router[_0x4cff('0x9')](_0x4cff('0xd'),auth[_0x4cff('0xa')](),controller[_0x4cff('0xe')]);router[_0x4cff('0xf')]('/',auth[_0x4cff('0xa')](),controller[_0x4cff('0x10')]);router[_0x4cff('0x11')]('/:id',auth[_0x4cff('0xa')](),controller[_0x4cff('0x12')]);router[_0x4cff('0x13')](_0x4cff('0xd'),auth['isAuthenticated'](),controller[_0x4cff('0x14')]);module['exports']=router; \ No newline at end of file +var _0x210d=['/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','./smsQueueReport.controller','index','get'];(function(_0x103080,_0x40ac65){var _0x2d05a0=function(_0x3f844d){while(--_0x3f844d){_0x103080['push'](_0x103080['shift']());}};_0x2d05a0(++_0x40ac65);}(_0x210d,0x1e6));var _0xd210=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x210d[_0x31b9cf];return _0x357b8a;};'use strict';var multer=require('multer');var util=require(_0xd210('0x0'));var path=require(_0xd210('0x1'));var timeout=require(_0xd210('0x2'));var express=require(_0xd210('0x3'));var router=express['Router']();var fs_extra=require(_0xd210('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd210('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd210('0x6')]);router[_0xd210('0x7')](_0xd210('0x8'),auth['isAuthenticated'](),controller[_0xd210('0x9')]);router[_0xd210('0x7')](_0xd210('0xa'),auth[_0xd210('0xb')](),controller[_0xd210('0xc')]);router[_0xd210('0xd')]('/',auth[_0xd210('0xb')](),controller[_0xd210('0xe')]);router[_0xd210('0xf')](_0xd210('0xa'),auth['isAuthenticated'](),controller[_0xd210('0x10')]);router[_0xd210('0x11')](_0xd210('0xa'),auth[_0xd210('0xb')](),controller[_0xd210('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index c707e7d..c4f8428 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 _0x8539=['DATE','moment','sequelize','STRING'];(function(_0x5c3199,_0x34a02d){var _0x5926f2=function(_0x4278d4){while(--_0x4278d4){_0x5c3199['push'](_0x5c3199['shift']());}};_0x5926f2(++_0x34a02d);}(_0x8539,0xfd));var _0x9853=function(_0x596eee,_0x1187e3){_0x596eee=_0x596eee-0x0;var _0x58f6d1=_0x8539[_0x596eee];return _0x58f6d1;};'use strict';var moment=require(_0x9853('0x0'));var Sequelize=require(_0x9853('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9853('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9853('0x3')]},'leaveAt':{'type':Sequelize[_0x9853('0x3')]},'acceptAt':{'type':Sequelize[_0x9853('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9853('0x2')]}}; \ No newline at end of file +var _0x8994=['STRING','DATE','moment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8994,0xe6));var _0x4899=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x8994[_0x2e4aa2];return _0x5e6092;};'use strict';var moment=require(_0x4899('0x0'));var Sequelize=require('sequelize');module[_0x4899('0x1')]={'uniqueid':{'type':Sequelize[_0x4899('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4899('0x2')]},'joinAt':{'type':Sequelize[_0x4899('0x3')]},'leaveAt':{'type':Sequelize[_0x4899('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4899('0x3')]},'reason':{'type':Sequelize[_0x4899('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index fed37ac..a6ba228 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 _0x5a96=['apply','reject','save','update','stack','name','send','index','map','SmsQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','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','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json'];(function(_0x451e8d,_0x5c3f00){var _0x5c3b0b=function(_0x532193){while(--_0x532193){_0x451e8d['push'](_0x451e8d['shift']());}};_0x5c3b0b(++_0x5c3f00);}(_0x5a96,0x1b2));var _0x65a9=function(_0x403b65,_0x25a1b1){_0x403b65=_0x403b65-0x0;var _0x2ad3cb=_0x5a96[_0x403b65];return _0x2ad3cb;};'use strict';var emlformat=require(_0x65a9('0x0'));var rimraf=require(_0x65a9('0x1'));var zipdir=require(_0x65a9('0x2'));var jsonpatch=require(_0x65a9('0x3'));var rp=require(_0x65a9('0x4'));var moment=require(_0x65a9('0x5'));var BPromise=require(_0x65a9('0x6'));var Mustache=require(_0x65a9('0x7'));var util=require(_0x65a9('0x8'));var path=require(_0x65a9('0x9'));var sox=require(_0x65a9('0xa'));var csv=require(_0x65a9('0xb'));var ejs=require(_0x65a9('0xc'));var fs=require('fs');var fs_extra=require(_0x65a9('0xd'));var _=require(_0x65a9('0xe'));var squel=require(_0x65a9('0xf'));var crypto=require('crypto');var jsforce=require(_0x65a9('0x10'));var deskjs=require(_0x65a9('0x11'));var toCsv=require(_0x65a9('0xb'));var querystring=require(_0x65a9('0x12'));var Papa=require(_0x65a9('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x65a9('0x14'));var as=require(_0x65a9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65a9('0x16'));var utils=require('../../config/utils');var config=require(_0x65a9('0x17'));var licenseUtil=require(_0x65a9('0x18'));var db=require(_0x65a9('0x19'))['db'];function respondWithStatusCode(_0x1a0a85,_0x5723cf){_0x5723cf=_0x5723cf||0xcc;return function(_0x11d14a){if(_0x11d14a){return _0x1a0a85[_0x65a9('0x1a')](_0x5723cf);}return _0x1a0a85[_0x65a9('0x1b')](_0x5723cf)['end']();};}function respondWithResult(_0x2d3115,_0x5c38e6){_0x5c38e6=_0x5c38e6||0xc8;return function(_0x42c65c){if(_0x42c65c){return _0x2d3115['status'](_0x5c38e6)['json'](_0x42c65c);}};}function respondWithFilteredResult(_0x43f2fe,_0x21e60a){return function(_0x515420){if(_0x515420){var _0x28c475=typeof _0x21e60a[_0x65a9('0x1c')]===_0x65a9('0x1d')&&typeof _0x21e60a[_0x65a9('0x1e')]===_0x65a9('0x1d');var _0x3c291e=_0x515420[_0x65a9('0x1f')];var _0x475d4a=_0x28c475?0x0:_0x21e60a['offset'];var _0x3a0d42=_0x28c475?_0x515420[_0x65a9('0x1f')]:_0x21e60a[_0x65a9('0x1c')]+_0x21e60a[_0x65a9('0x1e')];var _0x4a9c42;if(_0x3a0d42>=_0x3c291e){_0x3a0d42=_0x3c291e;_0x4a9c42=0xc8;}else{_0x4a9c42=0xce;}_0x43f2fe[_0x65a9('0x1b')](_0x4a9c42);return _0x43f2fe['set'](_0x65a9('0x20'),_0x475d4a+'-'+_0x3a0d42+'/'+_0x3c291e)[_0x65a9('0x21')](_0x515420);}return null;};}function patchUpdates(_0x298105){return function(_0x3294d7){try{jsonpatch[_0x65a9('0x22')](_0x3294d7,_0x298105,!![]);}catch(_0xb78ff8){return BPromise[_0x65a9('0x23')](_0xb78ff8);}return _0x3294d7[_0x65a9('0x24')]();};}function saveUpdates(_0x11e128,_0xb1ccf7){return function(_0x505809){if(_0x505809){return _0x505809[_0x65a9('0x25')](_0x11e128)['then'](function(_0x8f6fd3){return _0x8f6fd3;});}return null;};}function removeEntity(_0x587fb5,_0xedbe03){return function(_0x1fa3af){if(_0x1fa3af){return _0x1fa3af['destroy']()['then'](function(){_0x587fb5[_0x65a9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25f23b,_0x13a91b){return function(_0x19d36f){if(!_0x19d36f){_0x25f23b[_0x65a9('0x1a')](0x194);}return _0x19d36f;};}function handleError(_0x2e87e4,_0x5edf8d){_0x5edf8d=_0x5edf8d||0x1f4;return function(_0x488689){logger['error'](_0x488689[_0x65a9('0x26')]);if(_0x488689[_0x65a9('0x27')]){delete _0x488689[_0x65a9('0x27')];}_0x2e87e4[_0x65a9('0x1b')](_0x5edf8d)[_0x65a9('0x28')](_0x488689);};}exports[_0x65a9('0x29')]=function(_0x527c5a,_0x53031){var _0x108978={},_0x4817bd={},_0x2f726f={'count':0x0,'rows':[]};var _0xf8944d=_[_0x65a9('0x2a')](db[_0x65a9('0x2b')]['rawAttributes'],function(_0x55d9a0){return{'name':_0x55d9a0[_0x65a9('0x2c')],'type':_0x55d9a0['type'][_0x65a9('0x2d')]};});_0x4817bd[_0x65a9('0x2e')]=_['map'](_0xf8944d,_0x65a9('0x27'));_0x4817bd[_0x65a9('0x2f')]=_[_0x65a9('0x30')](_0x527c5a[_0x65a9('0x2f')]);_0x4817bd[_0x65a9('0x31')]=_[_0x65a9('0x32')](_0x4817bd[_0x65a9('0x2e')],_0x4817bd[_0x65a9('0x2f')]);_0x108978[_0x65a9('0x33')]=_[_0x65a9('0x32')](_0x4817bd['model'],qs[_0x65a9('0x34')](_0x527c5a[_0x65a9('0x2f')]['fields']));_0x108978[_0x65a9('0x33')]=_0x108978[_0x65a9('0x33')][_0x65a9('0x35')]?_0x108978[_0x65a9('0x33')]:_0x4817bd[_0x65a9('0x2e')];if(!_0x527c5a['query'][_0x65a9('0x36')](_0x65a9('0x37'))){_0x108978[_0x65a9('0x1e')]=qs['limit'](_0x527c5a[_0x65a9('0x2f')][_0x65a9('0x1e')]);_0x108978[_0x65a9('0x1c')]=qs[_0x65a9('0x1c')](_0x527c5a[_0x65a9('0x2f')][_0x65a9('0x1c')]);}_0x108978[_0x65a9('0x38')]=qs[_0x65a9('0x39')](_0x527c5a['query'][_0x65a9('0x39')]);_0x108978[_0x65a9('0x3a')]=qs[_0x65a9('0x31')](_[_0x65a9('0x3b')](_0x527c5a[_0x65a9('0x2f')],_0x4817bd[_0x65a9('0x31')]),_0xf8944d);if(_0x527c5a[_0x65a9('0x2f')][_0x65a9('0x3c')]){_0x108978['where']=_['merge'](_0x108978['where'],{'$or':_[_0x65a9('0x2a')](_0xf8944d,function(_0x1f3404){if(_0x1f3404['type']!==_0x65a9('0x3d')){var _0x44bc90={};_0x44bc90[_0x1f3404[_0x65a9('0x27')]]={'$like':'%'+_0x527c5a[_0x65a9('0x2f')][_0x65a9('0x3c')]+'%'};return _0x44bc90;}})});}_0x108978=_[_0x65a9('0x3e')]({},_0x108978,_0x527c5a['options']);var _0x433aa1={'where':_0x108978[_0x65a9('0x3a')]};return db[_0x65a9('0x2b')][_0x65a9('0x1f')](_0x433aa1)[_0x65a9('0x3f')](function(_0xbc37ea){_0x2f726f[_0x65a9('0x1f')]=_0xbc37ea;if(_0x527c5a[_0x65a9('0x2f')][_0x65a9('0x40')]){_0x108978[_0x65a9('0x41')]=[{'all':!![]}];}return db[_0x65a9('0x2b')][_0x65a9('0x42')](_0x108978);})[_0x65a9('0x3f')](function(_0x1a6a41){_0x2f726f[_0x65a9('0x43')]=_0x1a6a41;return _0x2f726f;})[_0x65a9('0x3f')](respondWithFilteredResult(_0x53031,_0x108978))[_0x65a9('0x44')](handleError(_0x53031,null));};exports[_0x65a9('0x45')]=function(_0x2b0617,_0x422ddb){var _0x46d069={'raw':!![],'where':{'id':_0x2b0617[_0x65a9('0x46')]['id']}},_0x2171ad={};_0x2171ad['model']=_[_0x65a9('0x30')](db[_0x65a9('0x2b')][_0x65a9('0x47')]);_0x2171ad['query']=_['keys'](_0x2b0617['query']);_0x2171ad[_0x65a9('0x31')]=_[_0x65a9('0x32')](_0x2171ad['model'],_0x2171ad[_0x65a9('0x2f')]);_0x46d069[_0x65a9('0x33')]=_['intersection'](_0x2171ad[_0x65a9('0x2e')],qs['fields'](_0x2b0617[_0x65a9('0x2f')][_0x65a9('0x34')]));_0x46d069[_0x65a9('0x33')]=_0x46d069[_0x65a9('0x33')][_0x65a9('0x35')]?_0x46d069[_0x65a9('0x33')]:_0x2171ad[_0x65a9('0x2e')];if(_0x2b0617[_0x65a9('0x2f')][_0x65a9('0x40')]){_0x46d069['include']=[{'all':!![]}];}_0x46d069=_['merge']({},_0x46d069,_0x2b0617[_0x65a9('0x48')]);return db[_0x65a9('0x2b')][_0x65a9('0x49')](_0x46d069)['then'](handleEntityNotFound(_0x422ddb,null))[_0x65a9('0x3f')](respondWithResult(_0x422ddb,null))[_0x65a9('0x44')](handleError(_0x422ddb,null));};exports[_0x65a9('0x4a')]=function(_0x3e8497,_0x4366b2){return db[_0x65a9('0x2b')][_0x65a9('0x4a')](_0x3e8497['body'],{})[_0x65a9('0x3f')](respondWithResult(_0x4366b2,0xc9))[_0x65a9('0x44')](handleError(_0x4366b2,null));};exports[_0x65a9('0x25')]=function(_0x333323,_0x226fda){if(_0x333323[_0x65a9('0x4b')]['id']){delete _0x333323[_0x65a9('0x4b')]['id'];}return db[_0x65a9('0x2b')]['find']({'where':{'id':_0x333323[_0x65a9('0x46')]['id']}})[_0x65a9('0x3f')](handleEntityNotFound(_0x226fda,null))[_0x65a9('0x3f')](saveUpdates(_0x333323['body'],null))[_0x65a9('0x3f')](respondWithResult(_0x226fda,null))['catch'](handleError(_0x226fda,null));};exports[_0x65a9('0x4c')]=function(_0x383188,_0x549650){return db[_0x65a9('0x2b')]['find']({'where':{'id':_0x383188['params']['id']}})[_0x65a9('0x3f')](handleEntityNotFound(_0x549650,null))[_0x65a9('0x3f')](removeEntity(_0x549650,null))[_0x65a9('0x44')](handleError(_0x549650,null));};exports['describe']=function(_0x59521c,_0x5dc869){return db['SmsQueueReport'][_0x65a9('0x4d')]()['then'](respondWithResult(_0x5dc869,null))[_0x65a9('0x44')](handleError(_0x5dc869,null));}; \ No newline at end of file +var _0x474e=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','SmsQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','keys','fields','create','body','catch','destroy','find','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x474e,0xdb));var _0xe474=function(_0x990144,_0x10be7d){_0x990144=_0x990144-0x0;var _0x4d2c15=_0x474e[_0x990144];return _0x4d2c15;};'use strict';var emlformat=require(_0xe474('0x0'));var rimraf=require(_0xe474('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe474('0x2'));var moment=require('moment');var BPromise=require(_0xe474('0x3'));var Mustache=require(_0xe474('0x4'));var util=require(_0xe474('0x5'));var path=require(_0xe474('0x6'));var sox=require(_0xe474('0x7'));var csv=require('to-csv');var ejs=require(_0xe474('0x8'));var fs=require('fs');var fs_extra=require(_0xe474('0x9'));var _=require(_0xe474('0xa'));var squel=require(_0xe474('0xb'));var crypto=require(_0xe474('0xc'));var jsforce=require(_0xe474('0xd'));var deskjs=require(_0xe474('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe474('0xf'));var Papa=require('papaparse');var Redis=require(_0xe474('0x10'));var authService=require(_0xe474('0x11'));var qs=require(_0xe474('0x12'));var as=require(_0xe474('0x13'));var hardwareService=require(_0xe474('0x14'));var logger=require(_0xe474('0x15'))(_0xe474('0x16'));var utils=require(_0xe474('0x17'));var config=require(_0xe474('0x18'));var licenseUtil=require(_0xe474('0x19'));var db=require(_0xe474('0x1a'))['db'];function respondWithStatusCode(_0x464893,_0x39622e){_0x39622e=_0x39622e||0xcc;return function(_0x1f3620){if(_0x1f3620){return _0x464893[_0xe474('0x1b')](_0x39622e);}return _0x464893['status'](_0x39622e)[_0xe474('0x1c')]();};}function respondWithResult(_0x19a26c,_0x11ba80){_0x11ba80=_0x11ba80||0xc8;return function(_0x33a9bc){if(_0x33a9bc){return _0x19a26c[_0xe474('0x1d')](_0x11ba80)[_0xe474('0x1e')](_0x33a9bc);}};}function respondWithFilteredResult(_0x5bd2ae,_0xd9441f){return function(_0x3dac67){if(_0x3dac67){var _0x17c8c4=typeof _0xd9441f[_0xe474('0x1f')]===_0xe474('0x20')&&typeof _0xd9441f[_0xe474('0x21')]===_0xe474('0x20');var _0x25eeb5=_0x3dac67[_0xe474('0x22')];var _0x25988a=_0x17c8c4?0x0:_0xd9441f[_0xe474('0x1f')];var _0x242bcf=_0x17c8c4?_0x3dac67[_0xe474('0x22')]:_0xd9441f[_0xe474('0x1f')]+_0xd9441f[_0xe474('0x21')];var _0x4fe408;if(_0x242bcf>=_0x25eeb5){_0x242bcf=_0x25eeb5;_0x4fe408=0xc8;}else{_0x4fe408=0xce;}_0x5bd2ae[_0xe474('0x1d')](_0x4fe408);return _0x5bd2ae[_0xe474('0x23')](_0xe474('0x24'),_0x25988a+'-'+_0x242bcf+'/'+_0x25eeb5)[_0xe474('0x1e')](_0x3dac67);}return null;};}function patchUpdates(_0xb394b4){return function(_0x23d347){try{jsonpatch[_0xe474('0x25')](_0x23d347,_0xb394b4,!![]);}catch(_0x542355){return BPromise[_0xe474('0x26')](_0x542355);}return _0x23d347[_0xe474('0x27')]();};}function saveUpdates(_0x549754,_0x345773){return function(_0x30cf5d){if(_0x30cf5d){return _0x30cf5d[_0xe474('0x28')](_0x549754)[_0xe474('0x29')](function(_0x80ece3){return _0x80ece3;});}return null;};}function removeEntity(_0x2fe8a3,_0x31b2f5){return function(_0x4dc53d){if(_0x4dc53d){return _0x4dc53d['destroy']()[_0xe474('0x29')](function(){_0x2fe8a3[_0xe474('0x1d')](0xcc)[_0xe474('0x1c')]();});}};}function handleEntityNotFound(_0x48ad6d,_0x2413dd){return function(_0x1aa13c){if(!_0x1aa13c){_0x48ad6d[_0xe474('0x1b')](0x194);}return _0x1aa13c;};}function handleError(_0xba0404,_0x1971a6){_0x1971a6=_0x1971a6||0x1f4;return function(_0x5d8d03){logger[_0xe474('0x2a')](_0x5d8d03[_0xe474('0x2b')]);if(_0x5d8d03['name']){delete _0x5d8d03[_0xe474('0x2c')];}_0xba0404[_0xe474('0x1d')](_0x1971a6)[_0xe474('0x2d')](_0x5d8d03);};}exports['index']=function(_0x53d80a,_0x40e75e){var _0x1ecd28={},_0x491ab6={},_0x4a53c0={'count':0x0,'rows':[]};var _0x4c25de=_[_0xe474('0x2e')](db[_0xe474('0x2f')][_0xe474('0x30')],function(_0x20130c){return{'name':_0x20130c['fieldName'],'type':_0x20130c[_0xe474('0x31')][_0xe474('0x32')]};});_0x491ab6[_0xe474('0x33')]=_[_0xe474('0x2e')](_0x4c25de,_0xe474('0x2c'));_0x491ab6[_0xe474('0x34')]=_['keys'](_0x53d80a[_0xe474('0x34')]);_0x491ab6[_0xe474('0x35')]=_[_0xe474('0x36')](_0x491ab6[_0xe474('0x33')],_0x491ab6[_0xe474('0x34')]);_0x1ecd28[_0xe474('0x37')]=_['intersection'](_0x491ab6['model'],qs['fields'](_0x53d80a[_0xe474('0x34')]['fields']));_0x1ecd28[_0xe474('0x37')]=_0x1ecd28[_0xe474('0x37')][_0xe474('0x38')]?_0x1ecd28['attributes']:_0x491ab6['model'];if(!_0x53d80a[_0xe474('0x34')][_0xe474('0x39')]('nolimit')){_0x1ecd28[_0xe474('0x21')]=qs[_0xe474('0x21')](_0x53d80a[_0xe474('0x34')][_0xe474('0x21')]);_0x1ecd28['offset']=qs[_0xe474('0x1f')](_0x53d80a['query'][_0xe474('0x1f')]);}_0x1ecd28[_0xe474('0x3a')]=qs[_0xe474('0x3b')](_0x53d80a[_0xe474('0x34')]['sort']);_0x1ecd28[_0xe474('0x3c')]=qs[_0xe474('0x35')](_[_0xe474('0x3d')](_0x53d80a[_0xe474('0x34')],_0x491ab6[_0xe474('0x35')]),_0x4c25de);if(_0x53d80a[_0xe474('0x34')][_0xe474('0x3e')]){_0x1ecd28['where']=_['merge'](_0x1ecd28['where'],{'$or':_[_0xe474('0x2e')](_0x4c25de,function(_0x141e32){if(_0x141e32[_0xe474('0x31')]!=='VIRTUAL'){var _0x235ae8={};_0x235ae8[_0x141e32[_0xe474('0x2c')]]={'$like':'%'+_0x53d80a[_0xe474('0x34')]['filter']+'%'};return _0x235ae8;}})});}_0x1ecd28=_[_0xe474('0x3f')]({},_0x1ecd28,_0x53d80a[_0xe474('0x40')]);var _0x831155={'where':_0x1ecd28[_0xe474('0x3c')]};return db['SmsQueueReport']['count'](_0x831155)['then'](function(_0x1c1667){_0x4a53c0['count']=_0x1c1667;if(_0x53d80a[_0xe474('0x34')][_0xe474('0x41')]){_0x1ecd28[_0xe474('0x42')]=[{'all':!![]}];}return db[_0xe474('0x2f')]['findAll'](_0x1ecd28);})[_0xe474('0x29')](function(_0x3682b7){_0x4a53c0[_0xe474('0x43')]=_0x3682b7;return _0x4a53c0;})[_0xe474('0x29')](respondWithFilteredResult(_0x40e75e,_0x1ecd28))['catch'](handleError(_0x40e75e,null));};exports[_0xe474('0x44')]=function(_0x596934,_0x1573b0){var _0x368459={'raw':!![],'where':{'id':_0x596934[_0xe474('0x45')]['id']}},_0x3da2df={};_0x3da2df[_0xe474('0x33')]=_['keys'](db[_0xe474('0x2f')][_0xe474('0x30')]);_0x3da2df['query']=_[_0xe474('0x46')](_0x596934[_0xe474('0x34')]);_0x3da2df[_0xe474('0x35')]=_[_0xe474('0x36')](_0x3da2df[_0xe474('0x33')],_0x3da2df[_0xe474('0x34')]);_0x368459[_0xe474('0x37')]=_['intersection'](_0x3da2df[_0xe474('0x33')],qs[_0xe474('0x47')](_0x596934['query'][_0xe474('0x47')]));_0x368459[_0xe474('0x37')]=_0x368459[_0xe474('0x37')][_0xe474('0x38')]?_0x368459[_0xe474('0x37')]:_0x3da2df['model'];if(_0x596934[_0xe474('0x34')][_0xe474('0x41')]){_0x368459['include']=[{'all':!![]}];}_0x368459=_[_0xe474('0x3f')]({},_0x368459,_0x596934['options']);return db['SmsQueueReport']['find'](_0x368459)[_0xe474('0x29')](handleEntityNotFound(_0x1573b0,null))[_0xe474('0x29')](respondWithResult(_0x1573b0,null))['catch'](handleError(_0x1573b0,null));};exports[_0xe474('0x48')]=function(_0x16e5e8,_0x5d3ff3){return db[_0xe474('0x2f')][_0xe474('0x48')](_0x16e5e8[_0xe474('0x49')],{})[_0xe474('0x29')](respondWithResult(_0x5d3ff3,0xc9))[_0xe474('0x4a')](handleError(_0x5d3ff3,null));};exports[_0xe474('0x28')]=function(_0x22294a,_0x838a20){if(_0x22294a[_0xe474('0x49')]['id']){delete _0x22294a[_0xe474('0x49')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x22294a[_0xe474('0x45')]['id']}})[_0xe474('0x29')](handleEntityNotFound(_0x838a20,null))[_0xe474('0x29')](saveUpdates(_0x22294a['body'],null))['then'](respondWithResult(_0x838a20,null))[_0xe474('0x4a')](handleError(_0x838a20,null));};exports[_0xe474('0x4b')]=function(_0x2c38f0,_0x22caa7){return db[_0xe474('0x2f')][_0xe474('0x4c')]({'where':{'id':_0x2c38f0['params']['id']}})[_0xe474('0x29')](handleEntityNotFound(_0x22caa7,null))[_0xe474('0x29')](removeEntity(_0x22caa7,null))[_0xe474('0x4a')](handleError(_0x22caa7,null));};exports['describe']=function(_0x163a52,_0xb1afc3){return db['SmsQueueReport'][_0xe474('0x4d')]()['then'](respondWithResult(_0xb1afc3,null))[_0xe474('0x4a')](handleError(_0xb1afc3,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index c40abdd..277c5ab 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x6c0833,_0x59e073){var _0x25d75b=function(_0x40833a){while(--_0x40833a){_0x6c0833['push'](_0x6c0833['shift']());}};_0x25d75b(++_0x59e073);}(_0xe706,0xa3));var _0x6e70=function(_0x385e37,_0x12ed73){_0x385e37=_0x385e37-0x0;var _0x1e1425=_0xe706[_0x385e37];return _0x1e1425;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x28f4c1,_0x35a46b){var _0x40cb28=function(_0x1bbe76){while(--_0x1bbe76){_0x28f4c1['push'](_0x28f4c1['shift']());}};_0x40cb28(++_0x35a46b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xb7e7[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 3e11bdb..793556c 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 _0x57b3=['SmsQueueReport,\x20%s,\x20%s','message','result','catch','body','options','raw','debug','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x563c7d,_0x52a887){var _0x1a8bb3=function(_0x1acc16){while(--_0x1acc16){_0x563c7d['push'](_0x563c7d['shift']());}};_0x1a8bb3(++_0x52a887);}(_0x57b3,0x144));var _0x357b=function(_0x2d8ffd,_0x45601a){_0x2d8ffd=_0x2d8ffd-0x0;var _0x3b7817=_0x57b3[_0x2d8ffd];return _0x3b7817;};'use strict';var _=require(_0x357b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x357b('0x1'));var rs=require(_0x357b('0x2'));var fs=require('fs');var Redis=require(_0x357b('0x3'));var db=require(_0x357b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x357b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x357b('0x6'));var client=jayson[_0x357b('0x7')][_0x357b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25a3bf,_0x1efa4d,_0x235be8){return new BPromise(function(_0x32e3c3,_0x525e5b){return client[_0x357b('0x9')](_0x25a3bf,_0x235be8)[_0x357b('0xa')](function(_0x2734a3){logger[_0x357b('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x1efa4d,'request\x20sent');logger['debug'](_0x357b('0xc'),_0x1efa4d,_0x357b('0xd'),JSON[_0x357b('0xe')](_0x2734a3));if(_0x2734a3[_0x357b('0xf')]){if(_0x2734a3['error'][_0x357b('0x10')]===0x1f4){logger[_0x357b('0xf')](_0x357b('0x11'),_0x1efa4d,_0x2734a3[_0x357b('0xf')][_0x357b('0x12')]);return _0x525e5b(_0x2734a3[_0x357b('0xf')][_0x357b('0x12')]);}logger[_0x357b('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x1efa4d,_0x2734a3[_0x357b('0xf')]['message']);return _0x32e3c3(_0x2734a3[_0x357b('0xf')][_0x357b('0x12')]);}else{logger[_0x357b('0xb')](_0x357b('0x11'),_0x1efa4d,_0x357b('0xd'));_0x32e3c3(_0x2734a3[_0x357b('0x13')][_0x357b('0x12')]);}})[_0x357b('0x14')](function(_0x2edfed){logger[_0x357b('0xf')](_0x357b('0x11'),_0x1efa4d,_0x2edfed);_0x525e5b(_0x2edfed);});});}exports['CreateSmsQueueReport']=function(_0x449a3c){var _0x4c762e=this;return new Promise(function(_0x1c4c9e,_0xc7f29f){return db['SmsQueueReport']['create'](_0x449a3c[_0x357b('0x15')],{'raw':_0x449a3c[_0x357b('0x16')]?_0x449a3c[_0x357b('0x16')][_0x357b('0x17')]===undefined?!![]:![]:!![]})[_0x357b('0xa')](function(_0xa2c373){logger[_0x357b('0xb')]('CreateSmsQueueReport',_0x449a3c);logger[_0x357b('0x18')](_0x357b('0x19'),_0x449a3c,JSON[_0x357b('0xe')](_0xa2c373));_0x1c4c9e(_0xa2c373);})[_0x357b('0x14')](function(_0x57524f){logger[_0x357b('0xf')](_0x357b('0x19'),_0x57524f[_0x357b('0x12')],_0x449a3c);_0xc7f29f(_0x4c762e['error'](0x1f4,_0x57524f['message']));});});};exports[_0x357b('0x1a')]=function(_0x2d4136){var _0x361d7e=this;return new Promise(function(_0x1c57de,_0x596439){return db['SmsQueueReport'][_0x357b('0x1b')](_0x2d4136['body'],{'raw':_0x2d4136[_0x357b('0x16')]?_0x2d4136[_0x357b('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d4136[_0x357b('0x16')]?_0x2d4136[_0x357b('0x16')][_0x357b('0x1c')]||null:null,'attributes':_0x2d4136[_0x357b('0x16')]?_0x2d4136[_0x357b('0x16')][_0x357b('0x1d')]||null:null,'limit':_0x2d4136[_0x357b('0x16')]?_0x2d4136[_0x357b('0x16')][_0x357b('0x1e')]||null:null})['then'](function(_0x1e79b0){logger['info'](_0x357b('0x1a'),_0x2d4136);logger[_0x357b('0x18')](_0x357b('0x1a'),_0x2d4136,JSON[_0x357b('0xe')](_0x1e79b0));_0x1c57de(_0x1e79b0);})[_0x357b('0x14')](function(_0xcb05fc){logger[_0x357b('0xf')](_0x357b('0x1a'),_0xcb05fc[_0x357b('0x12')],_0x2d4136);_0x596439(_0x361d7e[_0x357b('0xf')](0x1f4,_0xcb05fc['message']));});});}; \ No newline at end of file +var _0x57f0=['SmsQueueReport','update','options','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','create','body','raw','then','catch','UpdateSmsQueueReport'];(function(_0x228a32,_0x5cbca9){var _0x1c04fd=function(_0x520e61){while(--_0x520e61){_0x228a32['push'](_0x228a32['shift']());}};_0x1c04fd(++_0x5cbca9);}(_0x57f0,0x1b3));var _0x057f=function(_0x55b460,_0x497077){_0x55b460=_0x55b460-0x0;var _0x3ac537=_0x57f0[_0x55b460];return _0x3ac537;};'use strict';var _=require(_0x057f('0x0'));var util=require('util');var moment=require(_0x057f('0x1'));var BPromise=require('bluebird');var rs=require(_0x057f('0x2'));var fs=require('fs');var Redis=require(_0x057f('0x3'));var db=require(_0x057f('0x4'))['db'];var utils=require(_0x057f('0x5'));var logger=require('../../config/logger')(_0x057f('0x6'));var config=require(_0x057f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x057f('0x8')][_0x057f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f056f,_0x1fd19b,_0x1555a9){return new BPromise(function(_0x18e6f7,_0x4ae088){return client['request'](_0x2f056f,_0x1555a9)['then'](function(_0x58c1f8){logger[_0x057f('0xa')](_0x057f('0xb'),_0x1fd19b,'request\x20sent');logger[_0x057f('0xc')](_0x057f('0xd'),_0x1fd19b,_0x057f('0xe'),JSON[_0x057f('0xf')](_0x58c1f8));if(_0x58c1f8[_0x057f('0x10')]){if(_0x58c1f8[_0x057f('0x10')][_0x057f('0x11')]===0x1f4){logger['error'](_0x057f('0xb'),_0x1fd19b,_0x58c1f8[_0x057f('0x10')][_0x057f('0x12')]);return _0x4ae088(_0x58c1f8['error'][_0x057f('0x12')]);}logger[_0x057f('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x1fd19b,_0x58c1f8[_0x057f('0x10')][_0x057f('0x12')]);return _0x18e6f7(_0x58c1f8[_0x057f('0x10')][_0x057f('0x12')]);}else{logger[_0x057f('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x1fd19b,_0x057f('0xe'));_0x18e6f7(_0x58c1f8[_0x057f('0x13')][_0x057f('0x12')]);}})['catch'](function(_0x2fd533){logger[_0x057f('0x10')](_0x057f('0xb'),_0x1fd19b,_0x2fd533);_0x4ae088(_0x2fd533);});});}exports[_0x057f('0x14')]=function(_0x40ba41){var _0x45da35=this;return new Promise(function(_0x449757,_0x263ff7){return db['SmsQueueReport'][_0x057f('0x15')](_0x40ba41[_0x057f('0x16')],{'raw':_0x40ba41['options']?_0x40ba41['options'][_0x057f('0x17')]===undefined?!![]:![]:!![]})[_0x057f('0x18')](function(_0xb3679c){logger['info'](_0x057f('0x14'),_0x40ba41);logger[_0x057f('0xc')]('CreateSmsQueueReport',_0x40ba41,JSON[_0x057f('0xf')](_0xb3679c));_0x449757(_0xb3679c);})[_0x057f('0x19')](function(_0x496803){logger[_0x057f('0x10')](_0x057f('0x14'),_0x496803[_0x057f('0x12')],_0x40ba41);_0x263ff7(_0x45da35[_0x057f('0x10')](0x1f4,_0x496803[_0x057f('0x12')]));});});};exports[_0x057f('0x1a')]=function(_0x5cf4d3){var _0xe1ff5d=this;return new Promise(function(_0x42d21f,_0x4050cd){return db[_0x057f('0x1b')][_0x057f('0x1c')](_0x5cf4d3[_0x057f('0x16')],{'raw':_0x5cf4d3[_0x057f('0x1d')]?_0x5cf4d3[_0x057f('0x1d')][_0x057f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cf4d3['options']?_0x5cf4d3['options'][_0x057f('0x1e')]||null:null,'attributes':_0x5cf4d3[_0x057f('0x1d')]?_0x5cf4d3[_0x057f('0x1d')][_0x057f('0x1f')]||null:null,'limit':_0x5cf4d3[_0x057f('0x1d')]?_0x5cf4d3[_0x057f('0x1d')][_0x057f('0x20')]||null:null})[_0x057f('0x18')](function(_0x25da6f){logger['info'](_0x057f('0x1a'),_0x5cf4d3);logger[_0x057f('0xc')]('UpdateSmsQueueReport',_0x5cf4d3,JSON[_0x057f('0xf')](_0x25da6f));_0x42d21f(_0x25da6f);})[_0x057f('0x19')](function(_0x439a38){logger[_0x057f('0x10')](_0x057f('0x1a'),_0x439a38['message'],_0x5cf4d3);_0x4050cd(_0xe1ff5d[_0x057f('0x10')](0x1f4,_0x439a38[_0x057f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 400657e..62604cf 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 _0x2eb2=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete'];(function(_0xc7039,_0x163338){var _0x2c4d60=function(_0x3fcde3){while(--_0x3fcde3){_0xc7039['push'](_0xc7039['shift']());}};_0x2c4d60(++_0x163338);}(_0x2eb2,0x19f));var _0x22eb=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x2eb2[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x22eb('0x7')]('/',auth[_0x22eb('0x8')](),controller[_0x22eb('0x9')]);router[_0x22eb('0x7')](_0x22eb('0xa'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xb')]);router[_0x22eb('0x7')](_0x22eb('0xc'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')]('/',auth['isAuthenticated'](),controller[_0x22eb('0xf')]);router['put']('/:id',auth[_0x22eb('0x8')](),controller['update']);router[_0x22eb('0x10')](_0x22eb('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x22eb('0x11')]=router; \ No newline at end of file +var _0x3e74=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x54ee9d,_0x197d02){var _0xe91261=function(_0x3033ea){while(--_0x3033ea){_0x54ee9d['push'](_0x54ee9d['shift']());}};_0xe91261(++_0x197d02);}(_0x3e74,0x175));var _0x43e7=function(_0x5a6aff,_0x4623d5){_0x5a6aff=_0x5a6aff-0x0;var _0x47efd4=_0x3e74[_0x5a6aff];return _0x47efd4;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 8ccd8d7..e476b58 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x410832,_0x34e4df){var _0x107cf8=function(_0x5b77e2){while(--_0x5b77e2){_0x410832['push'](_0x410832['shift']());}};_0x107cf8(++_0x34e4df);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x00bb[_0xbca1b1];return _0x4e1686;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 4d78ec8..ad8dcf0 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 _0xaa85=['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/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','name','index','map','SmsTransferReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','catch','params','include','options','find','create','body','destroy','describe','eml-format','rimraf'];(function(_0x37671c,_0x17fcb3){var _0x8d1935=function(_0x39347b){while(--_0x39347b){_0x37671c['push'](_0x37671c['shift']());}};_0x8d1935(++_0x17fcb3);}(_0xaa85,0x122));var _0x5aa8=function(_0x50e7b5,_0x1e362d){_0x50e7b5=_0x50e7b5-0x0;var _0x4b3152=_0xaa85[_0x50e7b5];return _0x4b3152;};'use strict';var emlformat=require(_0x5aa8('0x0'));var rimraf=require(_0x5aa8('0x1'));var zipdir=require(_0x5aa8('0x2'));var jsonpatch=require(_0x5aa8('0x3'));var rp=require(_0x5aa8('0x4'));var moment=require(_0x5aa8('0x5'));var BPromise=require(_0x5aa8('0x6'));var Mustache=require(_0x5aa8('0x7'));var util=require(_0x5aa8('0x8'));var path=require(_0x5aa8('0x9'));var sox=require(_0x5aa8('0xa'));var csv=require(_0x5aa8('0xb'));var ejs=require(_0x5aa8('0xc'));var fs=require('fs');var fs_extra=require(_0x5aa8('0xd'));var _=require(_0x5aa8('0xe'));var squel=require(_0x5aa8('0xf'));var crypto=require(_0x5aa8('0x10'));var jsforce=require(_0x5aa8('0x11'));var deskjs=require(_0x5aa8('0x12'));var toCsv=require(_0x5aa8('0xb'));var querystring=require(_0x5aa8('0x13'));var Papa=require(_0x5aa8('0x14'));var Redis=require(_0x5aa8('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5aa8('0x16'));var hardwareService=require(_0x5aa8('0x17'));var logger=require('../../config/logger')(_0x5aa8('0x18'));var utils=require(_0x5aa8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5aa8('0x1a'));var db=require(_0x5aa8('0x1b'))['db'];function respondWithStatusCode(_0x55a3ee,_0x2770ec){_0x2770ec=_0x2770ec||0xcc;return function(_0x1fa4cd){if(_0x1fa4cd){return _0x55a3ee[_0x5aa8('0x1c')](_0x2770ec);}return _0x55a3ee[_0x5aa8('0x1d')](_0x2770ec)[_0x5aa8('0x1e')]();};}function respondWithResult(_0x6b1d9b,_0x117e8b){_0x117e8b=_0x117e8b||0xc8;return function(_0x36f9b9){if(_0x36f9b9){return _0x6b1d9b[_0x5aa8('0x1d')](_0x117e8b)[_0x5aa8('0x1f')](_0x36f9b9);}};}function respondWithFilteredResult(_0x3b8fe3,_0x5cfb43){return function(_0xdf43ac){if(_0xdf43ac){var _0x31ea82=typeof _0x5cfb43['offset']===_0x5aa8('0x20')&&typeof _0x5cfb43[_0x5aa8('0x21')]===_0x5aa8('0x20');var _0x379463=_0xdf43ac[_0x5aa8('0x22')];var _0x52ff44=_0x31ea82?0x0:_0x5cfb43['offset'];var _0x21d4c1=_0x31ea82?_0xdf43ac[_0x5aa8('0x22')]:_0x5cfb43[_0x5aa8('0x23')]+_0x5cfb43[_0x5aa8('0x21')];var _0x1c2f98;if(_0x21d4c1>=_0x379463){_0x21d4c1=_0x379463;_0x1c2f98=0xc8;}else{_0x1c2f98=0xce;}_0x3b8fe3[_0x5aa8('0x1d')](_0x1c2f98);return _0x3b8fe3[_0x5aa8('0x24')]('Content-Range',_0x52ff44+'-'+_0x21d4c1+'/'+_0x379463)[_0x5aa8('0x1f')](_0xdf43ac);}return null;};}function patchUpdates(_0x349e13){return function(_0x37eb18){try{jsonpatch[_0x5aa8('0x25')](_0x37eb18,_0x349e13,!![]);}catch(_0x291d94){return BPromise['reject'](_0x291d94);}return _0x37eb18[_0x5aa8('0x26')]();};}function saveUpdates(_0x265caf,_0x56642d){return function(_0x3ddfe7){if(_0x3ddfe7){return _0x3ddfe7[_0x5aa8('0x27')](_0x265caf)['then'](function(_0x27f168){return _0x27f168;});}return null;};}function removeEntity(_0x36ba87,_0x260a6a){return function(_0x1623a4){if(_0x1623a4){return _0x1623a4['destroy']()[_0x5aa8('0x28')](function(){_0x36ba87[_0x5aa8('0x1d')](0xcc)[_0x5aa8('0x1e')]();});}};}function handleEntityNotFound(_0x10787d,_0xd4e5ff){return function(_0x2392db){if(!_0x2392db){_0x10787d[_0x5aa8('0x1c')](0x194);}return _0x2392db;};}function handleError(_0x12617f,_0x1b9227){_0x1b9227=_0x1b9227||0x1f4;return function(_0x2d78a2){logger['error'](_0x2d78a2['stack']);if(_0x2d78a2[_0x5aa8('0x29')]){delete _0x2d78a2[_0x5aa8('0x29')];}_0x12617f[_0x5aa8('0x1d')](_0x1b9227)['send'](_0x2d78a2);};}exports[_0x5aa8('0x2a')]=function(_0xd58b64,_0x4bb061){var _0x441ae5={},_0x4e55ea={},_0x3770cd={'count':0x0,'rows':[]};var _0x37ba07=_[_0x5aa8('0x2b')](db[_0x5aa8('0x2c')][_0x5aa8('0x2d')],function(_0x390053){return{'name':_0x390053['fieldName'],'type':_0x390053[_0x5aa8('0x2e')][_0x5aa8('0x2f')]};});_0x4e55ea['model']=_[_0x5aa8('0x2b')](_0x37ba07,'name');_0x4e55ea[_0x5aa8('0x30')]=_[_0x5aa8('0x31')](_0xd58b64[_0x5aa8('0x30')]);_0x4e55ea[_0x5aa8('0x32')]=_['intersection'](_0x4e55ea[_0x5aa8('0x33')],_0x4e55ea[_0x5aa8('0x30')]);_0x441ae5[_0x5aa8('0x34')]=_[_0x5aa8('0x35')](_0x4e55ea[_0x5aa8('0x33')],qs[_0x5aa8('0x36')](_0xd58b64[_0x5aa8('0x30')][_0x5aa8('0x36')]));_0x441ae5['attributes']=_0x441ae5[_0x5aa8('0x34')][_0x5aa8('0x37')]?_0x441ae5[_0x5aa8('0x34')]:_0x4e55ea[_0x5aa8('0x33')];if(!_0xd58b64[_0x5aa8('0x30')][_0x5aa8('0x38')](_0x5aa8('0x39'))){_0x441ae5[_0x5aa8('0x21')]=qs[_0x5aa8('0x21')](_0xd58b64[_0x5aa8('0x30')][_0x5aa8('0x21')]);_0x441ae5[_0x5aa8('0x23')]=qs[_0x5aa8('0x23')](_0xd58b64[_0x5aa8('0x30')]['offset']);}_0x441ae5[_0x5aa8('0x3a')]=qs[_0x5aa8('0x3b')](_0xd58b64[_0x5aa8('0x30')]['sort']);_0x441ae5[_0x5aa8('0x3c')]=qs[_0x5aa8('0x32')](_['pick'](_0xd58b64[_0x5aa8('0x30')],_0x4e55ea[_0x5aa8('0x32')]),_0x37ba07);if(_0xd58b64['query'][_0x5aa8('0x3d')]){_0x441ae5[_0x5aa8('0x3c')]=_[_0x5aa8('0x3e')](_0x441ae5[_0x5aa8('0x3c')],{'$or':_[_0x5aa8('0x2b')](_0x37ba07,function(_0x341023){if(_0x341023[_0x5aa8('0x2e')]!=='VIRTUAL'){var _0x1f6f27={};_0x1f6f27[_0x341023[_0x5aa8('0x29')]]={'$like':'%'+_0xd58b64[_0x5aa8('0x30')][_0x5aa8('0x3d')]+'%'};return _0x1f6f27;}})});}_0x441ae5=_[_0x5aa8('0x3e')]({},_0x441ae5,_0xd58b64['options']);var _0x49b988={'where':_0x441ae5[_0x5aa8('0x3c')]};return db[_0x5aa8('0x2c')][_0x5aa8('0x22')](_0x49b988)[_0x5aa8('0x28')](function(_0x24a610){_0x3770cd[_0x5aa8('0x22')]=_0x24a610;if(_0xd58b64[_0x5aa8('0x30')][_0x5aa8('0x3f')]){_0x441ae5['include']=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x441ae5);})[_0x5aa8('0x28')](function(_0x10bd97){_0x3770cd['rows']=_0x10bd97;return _0x3770cd;})[_0x5aa8('0x28')](respondWithFilteredResult(_0x4bb061,_0x441ae5))[_0x5aa8('0x40')](handleError(_0x4bb061,null));};exports['show']=function(_0x127173,_0x2383d6){var _0x44d84c={'raw':!![],'where':{'id':_0x127173[_0x5aa8('0x41')]['id']}},_0x543655={};_0x543655[_0x5aa8('0x33')]=_[_0x5aa8('0x31')](db[_0x5aa8('0x2c')]['rawAttributes']);_0x543655['query']=_['keys'](_0x127173['query']);_0x543655[_0x5aa8('0x32')]=_['intersection'](_0x543655[_0x5aa8('0x33')],_0x543655[_0x5aa8('0x30')]);_0x44d84c[_0x5aa8('0x34')]=_['intersection'](_0x543655[_0x5aa8('0x33')],qs[_0x5aa8('0x36')](_0x127173[_0x5aa8('0x30')][_0x5aa8('0x36')]));_0x44d84c[_0x5aa8('0x34')]=_0x44d84c[_0x5aa8('0x34')][_0x5aa8('0x37')]?_0x44d84c[_0x5aa8('0x34')]:_0x543655['model'];if(_0x127173[_0x5aa8('0x30')]['includeAll']){_0x44d84c[_0x5aa8('0x42')]=[{'all':!![]}];}_0x44d84c=_[_0x5aa8('0x3e')]({},_0x44d84c,_0x127173[_0x5aa8('0x43')]);return db[_0x5aa8('0x2c')][_0x5aa8('0x44')](_0x44d84c)[_0x5aa8('0x28')](handleEntityNotFound(_0x2383d6,null))['then'](respondWithResult(_0x2383d6,null))[_0x5aa8('0x40')](handleError(_0x2383d6,null));};exports[_0x5aa8('0x45')]=function(_0xc6de51,_0x2fede9){return db[_0x5aa8('0x2c')][_0x5aa8('0x45')](_0xc6de51[_0x5aa8('0x46')],{})['then'](respondWithResult(_0x2fede9,0xc9))['catch'](handleError(_0x2fede9,null));};exports[_0x5aa8('0x27')]=function(_0x4ee23c,_0x3c8ebd){if(_0x4ee23c['body']['id']){delete _0x4ee23c[_0x5aa8('0x46')]['id'];}return db[_0x5aa8('0x2c')][_0x5aa8('0x44')]({'where':{'id':_0x4ee23c['params']['id']}})[_0x5aa8('0x28')](handleEntityNotFound(_0x3c8ebd,null))[_0x5aa8('0x28')](saveUpdates(_0x4ee23c['body'],null))['then'](respondWithResult(_0x3c8ebd,null))[_0x5aa8('0x40')](handleError(_0x3c8ebd,null));};exports[_0x5aa8('0x47')]=function(_0x55b1fb,_0xae3b3){return db[_0x5aa8('0x2c')][_0x5aa8('0x44')]({'where':{'id':_0x55b1fb[_0x5aa8('0x41')]['id']}})[_0x5aa8('0x28')](handleEntityNotFound(_0xae3b3,null))[_0x5aa8('0x28')](removeEntity(_0xae3b3,null))[_0x5aa8('0x40')](handleError(_0xae3b3,null));};exports[_0x5aa8('0x48')]=function(_0x167d55,_0x1be5c1){return db['SmsTransferReport'][_0x5aa8('0x48')]()['then'](respondWithResult(_0x1be5c1,null))[_0x5aa8('0x40')](handleError(_0x1be5c1,null));}; \ No newline at end of file +var _0x6a68=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','SmsTransferReport','findAll','rows','catch','show','rawAttributes','intersection','length','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','name','index','map','fieldName','key','model','keys','filters','query','attributes'];(function(_0x111cfe,_0x486cdf){var _0x336fc9=function(_0x5741a3){while(--_0x5741a3){_0x111cfe['push'](_0x111cfe['shift']());}};_0x336fc9(++_0x486cdf);}(_0x6a68,0x138));var _0x86a6=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x6a68[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0x86a6('0x0'));var rimraf=require(_0x86a6('0x1'));var zipdir=require(_0x86a6('0x2'));var jsonpatch=require(_0x86a6('0x3'));var rp=require(_0x86a6('0x4'));var moment=require(_0x86a6('0x5'));var BPromise=require(_0x86a6('0x6'));var Mustache=require(_0x86a6('0x7'));var util=require('util');var path=require(_0x86a6('0x8'));var sox=require(_0x86a6('0x9'));var csv=require(_0x86a6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86a6('0xb'));var _=require('lodash');var squel=require(_0x86a6('0xc'));var crypto=require('crypto');var jsforce=require(_0x86a6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x86a6('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86a6('0xe'));var as=require(_0x86a6('0xf'));var hardwareService=require(_0x86a6('0x10'));var logger=require(_0x86a6('0x11'))(_0x86a6('0x12'));var utils=require(_0x86a6('0x13'));var config=require(_0x86a6('0x14'));var licenseUtil=require(_0x86a6('0x15'));var db=require(_0x86a6('0x16'))['db'];function respondWithStatusCode(_0x4257a6,_0x4b5a23){_0x4b5a23=_0x4b5a23||0xcc;return function(_0x33c863){if(_0x33c863){return _0x4257a6[_0x86a6('0x17')](_0x4b5a23);}return _0x4257a6['status'](_0x4b5a23)[_0x86a6('0x18')]();};}function respondWithResult(_0x465af6,_0x1d81d2){_0x1d81d2=_0x1d81d2||0xc8;return function(_0x21c5e5){if(_0x21c5e5){return _0x465af6[_0x86a6('0x19')](_0x1d81d2)[_0x86a6('0x1a')](_0x21c5e5);}};}function respondWithFilteredResult(_0x49b570,_0x23a8b9){return function(_0x1e5846){if(_0x1e5846){var _0x1c9786=typeof _0x23a8b9[_0x86a6('0x1b')]===_0x86a6('0x1c')&&typeof _0x23a8b9[_0x86a6('0x1d')]==='undefined';var _0x5aa42e=_0x1e5846[_0x86a6('0x1e')];var _0x30288a=_0x1c9786?0x0:_0x23a8b9[_0x86a6('0x1b')];var _0x20ff9f=_0x1c9786?_0x1e5846[_0x86a6('0x1e')]:_0x23a8b9[_0x86a6('0x1b')]+_0x23a8b9['limit'];var _0x3d0555;if(_0x20ff9f>=_0x5aa42e){_0x20ff9f=_0x5aa42e;_0x3d0555=0xc8;}else{_0x3d0555=0xce;}_0x49b570[_0x86a6('0x19')](_0x3d0555);return _0x49b570['set']('Content-Range',_0x30288a+'-'+_0x20ff9f+'/'+_0x5aa42e)[_0x86a6('0x1a')](_0x1e5846);}return null;};}function patchUpdates(_0x150c04){return function(_0x271cf1){try{jsonpatch[_0x86a6('0x1f')](_0x271cf1,_0x150c04,!![]);}catch(_0x414c9f){return BPromise[_0x86a6('0x20')](_0x414c9f);}return _0x271cf1[_0x86a6('0x21')]();};}function saveUpdates(_0x2f577f,_0x4e29e5){return function(_0x165d1c){if(_0x165d1c){return _0x165d1c[_0x86a6('0x22')](_0x2f577f)[_0x86a6('0x23')](function(_0x5d203e){return _0x5d203e;});}return null;};}function removeEntity(_0x37f98a,_0x19cd4e){return function(_0x33cac9){if(_0x33cac9){return _0x33cac9[_0x86a6('0x24')]()['then'](function(){_0x37f98a['status'](0xcc)[_0x86a6('0x18')]();});}};}function handleEntityNotFound(_0xd8235a,_0x1c5698){return function(_0xa7013a){if(!_0xa7013a){_0xd8235a['sendStatus'](0x194);}return _0xa7013a;};}function handleError(_0x5c695d,_0xeaf4c9){_0xeaf4c9=_0xeaf4c9||0x1f4;return function(_0x773b5b){logger[_0x86a6('0x25')](_0x773b5b['stack']);if(_0x773b5b[_0x86a6('0x26')]){delete _0x773b5b[_0x86a6('0x26')];}_0x5c695d[_0x86a6('0x19')](_0xeaf4c9)['send'](_0x773b5b);};}exports[_0x86a6('0x27')]=function(_0x23378f,_0x324204){var _0x5439e8={},_0x523a12={},_0x3bce4d={'count':0x0,'rows':[]};var _0x3bbaae=_[_0x86a6('0x28')](db['SmsTransferReport']['rawAttributes'],function(_0x135cc2){return{'name':_0x135cc2[_0x86a6('0x29')],'type':_0x135cc2['type'][_0x86a6('0x2a')]};});_0x523a12[_0x86a6('0x2b')]=_[_0x86a6('0x28')](_0x3bbaae,_0x86a6('0x26'));_0x523a12['query']=_[_0x86a6('0x2c')](_0x23378f['query']);_0x523a12[_0x86a6('0x2d')]=_['intersection'](_0x523a12[_0x86a6('0x2b')],_0x523a12[_0x86a6('0x2e')]);_0x5439e8[_0x86a6('0x2f')]=_['intersection'](_0x523a12[_0x86a6('0x2b')],qs[_0x86a6('0x30')](_0x23378f['query'][_0x86a6('0x30')]));_0x5439e8[_0x86a6('0x2f')]=_0x5439e8[_0x86a6('0x2f')]['length']?_0x5439e8[_0x86a6('0x2f')]:_0x523a12[_0x86a6('0x2b')];if(!_0x23378f[_0x86a6('0x2e')][_0x86a6('0x31')]('nolimit')){_0x5439e8[_0x86a6('0x1d')]=qs[_0x86a6('0x1d')](_0x23378f[_0x86a6('0x2e')]['limit']);_0x5439e8['offset']=qs[_0x86a6('0x1b')](_0x23378f[_0x86a6('0x2e')]['offset']);}_0x5439e8[_0x86a6('0x32')]=qs['sort'](_0x23378f[_0x86a6('0x2e')][_0x86a6('0x33')]);_0x5439e8['where']=qs['filters'](_[_0x86a6('0x34')](_0x23378f['query'],_0x523a12[_0x86a6('0x2d')]),_0x3bbaae);if(_0x23378f[_0x86a6('0x2e')][_0x86a6('0x35')]){_0x5439e8[_0x86a6('0x36')]=_['merge'](_0x5439e8[_0x86a6('0x36')],{'$or':_[_0x86a6('0x28')](_0x3bbaae,function(_0x30539e){if(_0x30539e['type']!==_0x86a6('0x37')){var _0xe97964={};_0xe97964[_0x30539e[_0x86a6('0x26')]]={'$like':'%'+_0x23378f[_0x86a6('0x2e')][_0x86a6('0x35')]+'%'};return _0xe97964;}})});}_0x5439e8=_[_0x86a6('0x38')]({},_0x5439e8,_0x23378f[_0x86a6('0x39')]);var _0x12cf7b={'where':_0x5439e8['where']};return db[_0x86a6('0x3a')][_0x86a6('0x1e')](_0x12cf7b)[_0x86a6('0x23')](function(_0x2327c9){_0x3bce4d['count']=_0x2327c9;if(_0x23378f[_0x86a6('0x2e')]['includeAll']){_0x5439e8['include']=[{'all':!![]}];}return db[_0x86a6('0x3a')][_0x86a6('0x3b')](_0x5439e8);})[_0x86a6('0x23')](function(_0x57379c){_0x3bce4d[_0x86a6('0x3c')]=_0x57379c;return _0x3bce4d;})['then'](respondWithFilteredResult(_0x324204,_0x5439e8))[_0x86a6('0x3d')](handleError(_0x324204,null));};exports[_0x86a6('0x3e')]=function(_0x1506f9,_0x26117d){var _0x1c01dd={'raw':!![],'where':{'id':_0x1506f9['params']['id']}},_0x267bf7={};_0x267bf7[_0x86a6('0x2b')]=_[_0x86a6('0x2c')](db[_0x86a6('0x3a')][_0x86a6('0x3f')]);_0x267bf7[_0x86a6('0x2e')]=_[_0x86a6('0x2c')](_0x1506f9[_0x86a6('0x2e')]);_0x267bf7[_0x86a6('0x2d')]=_[_0x86a6('0x40')](_0x267bf7[_0x86a6('0x2b')],_0x267bf7[_0x86a6('0x2e')]);_0x1c01dd[_0x86a6('0x2f')]=_[_0x86a6('0x40')](_0x267bf7['model'],qs[_0x86a6('0x30')](_0x1506f9[_0x86a6('0x2e')][_0x86a6('0x30')]));_0x1c01dd[_0x86a6('0x2f')]=_0x1c01dd['attributes'][_0x86a6('0x41')]?_0x1c01dd[_0x86a6('0x2f')]:_0x267bf7[_0x86a6('0x2b')];if(_0x1506f9[_0x86a6('0x2e')]['includeAll']){_0x1c01dd[_0x86a6('0x42')]=[{'all':!![]}];}_0x1c01dd=_['merge']({},_0x1c01dd,_0x1506f9[_0x86a6('0x39')]);return db[_0x86a6('0x3a')][_0x86a6('0x43')](_0x1c01dd)[_0x86a6('0x23')](handleEntityNotFound(_0x26117d,null))[_0x86a6('0x23')](respondWithResult(_0x26117d,null))[_0x86a6('0x3d')](handleError(_0x26117d,null));};exports[_0x86a6('0x44')]=function(_0x1353e7,_0x349429){return db[_0x86a6('0x3a')][_0x86a6('0x44')](_0x1353e7['body'],{})[_0x86a6('0x23')](respondWithResult(_0x349429,0xc9))[_0x86a6('0x3d')](handleError(_0x349429,null));};exports[_0x86a6('0x22')]=function(_0x341665,_0x334a6d){if(_0x341665[_0x86a6('0x45')]['id']){delete _0x341665['body']['id'];}return db[_0x86a6('0x3a')]['find']({'where':{'id':_0x341665[_0x86a6('0x46')]['id']}})['then'](handleEntityNotFound(_0x334a6d,null))['then'](saveUpdates(_0x341665['body'],null))[_0x86a6('0x23')](respondWithResult(_0x334a6d,null))[_0x86a6('0x3d')](handleError(_0x334a6d,null));};exports['destroy']=function(_0x339037,_0x315d85){return db['SmsTransferReport'][_0x86a6('0x43')]({'where':{'id':_0x339037['params']['id']}})[_0x86a6('0x23')](handleEntityNotFound(_0x315d85,null))[_0x86a6('0x23')](removeEntity(_0x315d85,null))[_0x86a6('0x3d')](handleError(_0x315d85,null));};exports['describe']=function(_0x28c29d,_0x2c2078){return db[_0x86a6('0x3a')][_0x86a6('0x47')]()[_0x86a6('0x23')](respondWithResult(_0x2c2078,null))[_0x86a6('0x3d')](handleError(_0x2c2078,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a119595..09c945b 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 _0x95ca=['../../config/logger','bluebird','request-promise','rimraf','./smsTransferReport.attributes','define','SmsTransferReport','uniqueid','lodash','util'];(function(_0x4a25e3,_0xffc2aa){var _0xc2ac02=function(_0x1f0eba){while(--_0x1f0eba){_0x4a25e3['push'](_0x4a25e3['shift']());}};_0xc2ac02(++_0xffc2aa);}(_0x95ca,0x1ac));var _0xa95c=function(_0x35fe7c,_0x1f5b23){_0x35fe7c=_0x35fe7c-0x0;var _0xfdfa3c=_0x95ca[_0x35fe7c];return _0xfdfa3c;};'use strict';var _=require(_0xa95c('0x0'));var util=require(_0xa95c('0x1'));var logger=require(_0xa95c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa95c('0x3'));var rp=require(_0xa95c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa95c('0x5'));var config=require('../../config/environment');var attributes=require(_0xa95c('0x6'));module['exports']=function(_0x57ab33,_0x35ed52){return _0x57ab33[_0xa95c('0x7')](_0xa95c('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xa95c('0x9'),'fields':[_0xa95c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x75cf=['api','moment','request-promise','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util'];(function(_0x53ee58,_0x8df2fc){var _0x422c1=function(_0x4db06f){while(--_0x4db06f){_0x53ee58['push'](_0x53ee58['shift']());}};_0x422c1(++_0x8df2fc);}(_0x75cf,0x18a));var _0xf75c=function(_0xac9ded,_0x112cc4){_0xac9ded=_0xac9ded-0x0;var _0x53e77a=_0x75cf[_0xac9ded];return _0x53e77a;};'use strict';var _=require(_0xf75c('0x0'));var util=require(_0xf75c('0x1'));var logger=require('../../config/logger')(_0xf75c('0x2'));var moment=require(_0xf75c('0x3'));var BPromise=require('bluebird');var rp=require(_0xf75c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf75c('0x5'));var attributes=require(_0xf75c('0x6'));module[_0xf75c('0x7')]=function(_0x5abcc2,_0x221f5c){return _0x5abcc2[_0xf75c('0x8')](_0xf75c('0x9'),attributes,{'tableName':_0xf75c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf75c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 1e503fe..423682b 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 _0x16d8=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','SmsTransferReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x16d8,0xa3));var _0x816d=function(_0x5e70ca,_0x122bbb){_0x5e70ca=_0x5e70ca-0x0;var _0x2955ef=_0x16d8[_0x5e70ca];return _0x2955ef;};'use strict';var _=require('lodash');var util=require(_0x816d('0x0'));var moment=require(_0x816d('0x1'));var BPromise=require(_0x816d('0x2'));var rs=require(_0x816d('0x3'));var fs=require('fs');var Redis=require(_0x816d('0x4'));var db=require(_0x816d('0x5'))['db'];var utils=require(_0x816d('0x6'));var logger=require(_0x816d('0x7'))(_0x816d('0x8'));var config=require('../../config/environment');var jayson=require(_0x816d('0x9'));var client=jayson['client'][_0x816d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cde29,_0x2516ea,_0x2d51f2){return new BPromise(function(_0x44b1ba,_0x5cfc9d){return client[_0x816d('0xb')](_0x5cde29,_0x2d51f2)[_0x816d('0xc')](function(_0xda441e){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x2516ea,'request\x20sent');logger[_0x816d('0xd')](_0x816d('0xe'),_0x2516ea,_0x816d('0xf'),JSON[_0x816d('0x10')](_0xda441e));if(_0xda441e['error']){if(_0xda441e[_0x816d('0x11')][_0x816d('0x12')]===0x1f4){logger[_0x816d('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x2516ea,_0xda441e[_0x816d('0x11')][_0x816d('0x13')]);return _0x5cfc9d(_0xda441e['error'][_0x816d('0x13')]);}logger[_0x816d('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x2516ea,_0xda441e[_0x816d('0x11')][_0x816d('0x13')]);return _0x44b1ba(_0xda441e['error'][_0x816d('0x13')]);}else{logger[_0x816d('0x14')](_0x816d('0x15'),_0x2516ea,_0x816d('0xf'));_0x44b1ba(_0xda441e[_0x816d('0x16')][_0x816d('0x13')]);}})[_0x816d('0x17')](function(_0x2a1be1){logger[_0x816d('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x2516ea,_0x2a1be1);_0x5cfc9d(_0x2a1be1);});});} \ No newline at end of file +var _0x3c6c=['jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x113c3b,_0x39535f){var _0x3471c0=function(_0x370d87){while(--_0x370d87){_0x113c3b['push'](_0x113c3b['shift']());}};_0x3471c0(++_0x39535f);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x3e5604,_0xc5bb0e){_0x3e5604=_0x3e5604-0x0;var _0x4fcb94=_0x3c6c[_0x3e5604];return _0x4fcb94;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var moment=require(_0xc3c6('0x1'));var BPromise=require(_0xc3c6('0x2'));var rs=require(_0xc3c6('0x3'));var fs=require('fs');var Redis=require(_0xc3c6('0x4'));var db=require(_0xc3c6('0x5'))['db'];var utils=require(_0xc3c6('0x6'));var logger=require(_0xc3c6('0x7'))(_0xc3c6('0x8'));var config=require('../../config/environment');var jayson=require(_0xc3c6('0x9'));var client=jayson['client'][_0xc3c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d7ae6,_0x50cd05,_0x4aed87){return new BPromise(function(_0x5185c3,_0x4f39dd){return client[_0xc3c6('0xb')](_0x4d7ae6,_0x4aed87)[_0xc3c6('0xc')](function(_0x5bc1c1){logger[_0xc3c6('0xd')](_0xc3c6('0xe'),_0x50cd05,_0xc3c6('0xf'));logger[_0xc3c6('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x50cd05,_0xc3c6('0xf'),JSON[_0xc3c6('0x11')](_0x5bc1c1));if(_0x5bc1c1[_0xc3c6('0x12')]){if(_0x5bc1c1['error']['code']===0x1f4){logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);return _0x4f39dd(_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);}logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);return _0x5185c3(_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);}else{logger[_0xc3c6('0xd')](_0xc3c6('0xe'),_0x50cd05,_0xc3c6('0xf'));_0x5185c3(_0x5bc1c1[_0xc3c6('0x14')][_0xc3c6('0x13')]);}})[_0xc3c6('0x15')](function(_0x33920c){logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x33920c);_0x4f39dd(_0x33920c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index e9885a5..16eccd5 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 _0x27c1=['file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','post','single'];(function(_0xd48210,_0x36c1cb){var _0x51e93d=function(_0x245289){while(--_0x245289){_0xd48210['push'](_0xd48210['shift']());}};_0x51e93d(++_0x36c1cb);}(_0x27c1,0x171));var _0x127c=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x27c1[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x127c('0x0'));var util=require(_0x127c('0x1'));var path=require(_0x127c('0x2'));var timeout=require(_0x127c('0x3'));var express=require(_0x127c('0x4'));var router=express[_0x127c('0x5')]();var fs_extra=require(_0x127c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x127c('0x7'));var config=require(_0x127c('0x8'));var controller=require(_0x127c('0x9'));router[_0x127c('0xa')]('/',auth['isAuthenticated'](),controller[_0x127c('0xb')]);router[_0x127c('0xa')](_0x127c('0xc'),auth[_0x127c('0xd')](),controller[_0x127c('0xe')]);router[_0x127c('0xa')](_0x127c('0xf'),auth[_0x127c('0xd')](),controller['download']);var upload=multer({'storage':multer[_0x127c('0x10')]({'destination':function(_0x39f1c8,_0x3b0df1,_0x4176d8){_0x4176d8(null,path[_0x127c('0x11')](config[_0x127c('0x12')],_0x127c('0x13')));},'filename':function(_0x412fc5,_0x5be0af,_0x29ed9f){_0x5be0af[_0x127c('0x14')]=_0x5be0af[_0x127c('0x14')][_0x127c('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29ed9f(null,util[_0x127c('0x16')](_0x127c('0x17'),path[_0x127c('0x18')](_0x5be0af[_0x127c('0x14')],path['extname'](_0x5be0af[_0x127c('0x14')])),Date['now'](),path['extname'](_0x5be0af[_0x127c('0x14')])));}})});router[_0x127c('0x19')]('/',upload[_0x127c('0x1a')](_0x127c('0x1b')),controller[_0x127c('0x1c')]);router[_0x127c('0x1d')](_0x127c('0xc'),auth[_0x127c('0xd')](),controller[_0x127c('0x1e')]);router[_0x127c('0x1f')](_0x127c('0xc'),auth[_0x127c('0xd')](),controller['delete']);module[_0x127c('0x20')]=router; \ No newline at end of file +var _0xc1d7=['replace','format','%s-%s%s','extname','now','post','single','file','create','put','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','diskStorage','root','server/files/sounds/original/','originalname'];(function(_0xde9484,_0x5ba41d){var _0x3a20a9=function(_0x139bca){while(--_0x139bca){_0xde9484['push'](_0xde9484['shift']());}};_0x3a20a9(++_0x5ba41d);}(_0xc1d7,0x84));var _0x7c1d=function(_0x38d832,_0xf2104d){_0x38d832=_0x38d832-0x0;var _0x2e166e=_0xc1d7[_0x38d832];return _0x2e166e;};'use strict';var multer=require('multer');var util=require(_0x7c1d('0x0'));var path=require(_0x7c1d('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c1d('0x2'));var router=express[_0x7c1d('0x3')]();var fs_extra=require(_0x7c1d('0x4'));var auth=require(_0x7c1d('0x5'));var interaction=require(_0x7c1d('0x6'));var config=require(_0x7c1d('0x7'));var controller=require(_0x7c1d('0x8'));router[_0x7c1d('0x9')]('/',auth[_0x7c1d('0xa')](),controller['index']);router[_0x7c1d('0x9')](_0x7c1d('0xb'),auth[_0x7c1d('0xa')](),controller[_0x7c1d('0xc')]);router[_0x7c1d('0x9')](_0x7c1d('0xd'),auth[_0x7c1d('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x7c1d('0xe')]({'destination':function(_0x30331d,_0x278739,_0x1e15b2){_0x1e15b2(null,path['join'](config[_0x7c1d('0xf')],_0x7c1d('0x10')));},'filename':function(_0x942cb2,_0x2b2d19,_0x46174b){_0x2b2d19['originalname']=_0x2b2d19[_0x7c1d('0x11')][_0x7c1d('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x46174b(null,util[_0x7c1d('0x13')](_0x7c1d('0x14'),path['basename'](_0x2b2d19[_0x7c1d('0x11')],path[_0x7c1d('0x15')](_0x2b2d19[_0x7c1d('0x11')])),Date[_0x7c1d('0x16')](),path[_0x7c1d('0x15')](_0x2b2d19['originalname'])));}})});router[_0x7c1d('0x17')]('/',upload[_0x7c1d('0x18')](_0x7c1d('0x19')),controller[_0x7c1d('0x1a')]);router[_0x7c1d('0x1b')]('/:id',auth[_0x7c1d('0xa')](),controller['update']);router[_0x7c1d('0x1c')](_0x7c1d('0xb'),auth[_0x7c1d('0xa')](),controller['delete']);module[_0x7c1d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index ecc0bd0..46124f2 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 _0xfe58=['exports','STRING','name','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe58,0x187));var _0x8fe5=function(_0x254a4f,_0x4fd328){_0x254a4f=_0x254a4f-0x0;var _0x23982a=_0xfe58[_0x254a4f];return _0x23982a;};'use strict';var Sequelize=require(_0x8fe5('0x0'));module[_0x8fe5('0x1')]={'name':{'type':Sequelize[_0x8fe5('0x2')],'unique':_0x8fe5('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8fe5('0x2')]},'display_name':{'type':Sequelize[_0x8fe5('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x8fe5('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x8fe5('0x5')]},'original_bitRate':{'type':Sequelize[_0x8fe5('0x6')]},'original_sampleRate':{'type':Sequelize[_0x8fe5('0x5')]},'converted_format':{'type':Sequelize[_0x8fe5('0x2')]},'converted_duration':{'type':Sequelize[_0x8fe5('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x8fe5('0x6')]},'converted_channelCount':{'type':Sequelize[_0x8fe5('0x5')]},'converted_bitRate':{'type':Sequelize[_0x8fe5('0x6')]},'converted_sampleRate':{'type':Sequelize[_0x8fe5('0x5')]}}; \ No newline at end of file +var _0x11aa=['name','STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x11aa,0x1e8));var _0xa11a=function(_0xe02ce5,_0x4c98a7){_0xe02ce5=_0xe02ce5-0x0;var _0x37a6c0=_0x11aa[_0xe02ce5];return _0x37a6c0;};'use strict';var Sequelize=require(_0xa11a('0x0'));module[_0xa11a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa11a('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xa11a('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xa11a('0x3')]},'original_duration':{'type':Sequelize[_0xa11a('0x4')]},'original_sampleCount':{'type':Sequelize[_0xa11a('0x5')]},'original_channelCount':{'type':Sequelize[_0xa11a('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xa11a('0x6')]},'converted_format':{'type':Sequelize[_0xa11a('0x3')]},'converted_duration':{'type':Sequelize[_0xa11a('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xa11a('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xa11a('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 4245f57..3ca6951 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 _0x9ed0=['nolimit','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','download','find','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create','file','originalname','extname','basename','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','send','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','update','description','delete','original_format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','get','Sounds','UserProfileResource','destroy','error','stack','name','index','Sound','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1b059d,_0x7ad66d){var _0x432eaa=function(_0x308e0b){while(--_0x308e0b){_0x1b059d['push'](_0x1b059d['shift']());}};_0x432eaa(++_0x7ad66d);}(_0x9ed0,0x1ac));var _0x09ed=function(_0x5c0974,_0x133f4a){_0x5c0974=_0x5c0974-0x0;var _0x45877a=_0x9ed0[_0x5c0974];return _0x45877a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09ed('0x0'));var zipdir=require(_0x09ed('0x1'));var jsonpatch=require(_0x09ed('0x2'));var rp=require('request-promise');var moment=require(_0x09ed('0x3'));var BPromise=require(_0x09ed('0x4'));var Mustache=require(_0x09ed('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x09ed('0x6'));var ejs=require(_0x09ed('0x7'));var fs=require('fs');var fs_extra=require(_0x09ed('0x8'));var _=require(_0x09ed('0x9'));var squel=require(_0x09ed('0xa'));var crypto=require(_0x09ed('0xb'));var jsforce=require(_0x09ed('0xc'));var deskjs=require(_0x09ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09ed('0xe'));var Papa=require(_0x09ed('0xf'));var Redis=require(_0x09ed('0x10'));var authService=require(_0x09ed('0x11'));var qs=require(_0x09ed('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x09ed('0x13'));var utils=require(_0x09ed('0x14'));var config=require(_0x09ed('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x09ed('0x16'))['db'];function respondWithStatusCode(_0x4a27f4,_0x39730c){_0x39730c=_0x39730c||0xcc;return function(_0x2a6b3f){if(_0x2a6b3f){return _0x4a27f4[_0x09ed('0x17')](_0x39730c);}return _0x4a27f4[_0x09ed('0x18')](_0x39730c)[_0x09ed('0x19')]();};}function respondWithResult(_0x25b8dd,_0x5e8f14){_0x5e8f14=_0x5e8f14||0xc8;return function(_0x414ab1){if(_0x414ab1){return _0x25b8dd[_0x09ed('0x18')](_0x5e8f14)[_0x09ed('0x1a')](_0x414ab1);}};}function respondWithFilteredResult(_0x38848f,_0x133bf8){return function(_0x4a1930){if(_0x4a1930){var _0x30dfb3=typeof _0x133bf8[_0x09ed('0x1b')]===_0x09ed('0x1c')&&typeof _0x133bf8[_0x09ed('0x1d')]==='undefined';var _0x55faa3=_0x4a1930[_0x09ed('0x1e')];var _0x408cb7=_0x30dfb3?0x0:_0x133bf8['offset'];var _0x1f8840=_0x30dfb3?_0x4a1930['count']:_0x133bf8[_0x09ed('0x1b')]+_0x133bf8[_0x09ed('0x1d')];var _0x5ac3d9;if(_0x1f8840>=_0x55faa3){_0x1f8840=_0x55faa3;_0x5ac3d9=0xc8;}else{_0x5ac3d9=0xce;}_0x38848f[_0x09ed('0x18')](_0x5ac3d9);return _0x38848f[_0x09ed('0x1f')](_0x09ed('0x20'),_0x408cb7+'-'+_0x1f8840+'/'+_0x55faa3)['json'](_0x4a1930);}return null;};}function patchUpdates(_0x42a216){return function(_0x695db3){try{jsonpatch['apply'](_0x695db3,_0x42a216,!![]);}catch(_0x50700f){return BPromise['reject'](_0x50700f);}return _0x695db3['save']();};}function saveUpdates(_0x4c037c,_0xcc061a){return function(_0x2c483e){if(_0x2c483e){return _0x2c483e['update'](_0x4c037c)[_0x09ed('0x21')](function(_0x46d597){return _0x46d597;});}return null;};}function removeEntity(_0x24f75d,_0x213260){return function(_0x7ab68f){if(_0x7ab68f){return _0x7ab68f['destroy']()['then'](function(){var _0x1c631a=_0x7ab68f[_0x09ed('0x22')]({'plain':!![]});var _0x2e31c1=_0x09ed('0x23');return db[_0x09ed('0x24')][_0x09ed('0x25')]({'where':{'type':_0x2e31c1,'resourceId':_0x1c631a['id']}})[_0x09ed('0x21')](function(){return _0x7ab68f;});})[_0x09ed('0x21')](function(){_0x24f75d[_0x09ed('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e0952,_0x5ead7d){return function(_0x3b16d4){if(!_0x3b16d4){_0x5e0952[_0x09ed('0x17')](0x194);}return _0x3b16d4;};}function handleError(_0xb3830,_0x239009){_0x239009=_0x239009||0x1f4;return function(_0x5a00c2){logger[_0x09ed('0x26')](_0x5a00c2[_0x09ed('0x27')]);if(_0x5a00c2[_0x09ed('0x28')]){delete _0x5a00c2[_0x09ed('0x28')];}_0xb3830[_0x09ed('0x18')](_0x239009)['send'](_0x5a00c2);};}exports[_0x09ed('0x29')]=function(_0x252747,_0x18af73){var _0x1ba6a2={},_0x5e9378={},_0x3ff07a={'count':0x0,'rows':[]};var _0x118c89=_['map'](db[_0x09ed('0x2a')][_0x09ed('0x2b')],function(_0x16715e){return{'name':_0x16715e['fieldName'],'type':_0x16715e[_0x09ed('0x2c')][_0x09ed('0x2d')]};});_0x5e9378[_0x09ed('0x2e')]=_[_0x09ed('0x2f')](_0x118c89,_0x09ed('0x28'));_0x5e9378[_0x09ed('0x30')]=_[_0x09ed('0x31')](_0x252747[_0x09ed('0x30')]);_0x5e9378[_0x09ed('0x32')]=_[_0x09ed('0x33')](_0x5e9378[_0x09ed('0x2e')],_0x5e9378[_0x09ed('0x30')]);_0x1ba6a2[_0x09ed('0x34')]=_[_0x09ed('0x33')](_0x5e9378[_0x09ed('0x2e')],qs[_0x09ed('0x35')](_0x252747[_0x09ed('0x30')][_0x09ed('0x35')]));_0x1ba6a2[_0x09ed('0x34')]=_0x1ba6a2[_0x09ed('0x34')][_0x09ed('0x36')]?_0x1ba6a2[_0x09ed('0x34')]:_0x5e9378[_0x09ed('0x2e')];if(!_0x252747[_0x09ed('0x30')][_0x09ed('0x37')](_0x09ed('0x38'))){_0x1ba6a2[_0x09ed('0x1d')]=qs[_0x09ed('0x1d')](_0x252747['query'][_0x09ed('0x1d')]);_0x1ba6a2[_0x09ed('0x1b')]=qs['offset'](_0x252747['query']['offset']);}_0x1ba6a2['order']=qs['sort'](_0x252747[_0x09ed('0x30')]['sort']);_0x1ba6a2[_0x09ed('0x39')]=qs[_0x09ed('0x32')](_['pick'](_0x252747['query'],_0x5e9378[_0x09ed('0x32')]),_0x118c89);if(_0x252747['query'][_0x09ed('0x3a')]){_0x1ba6a2[_0x09ed('0x39')]=_[_0x09ed('0x3b')](_0x1ba6a2['where'],{'$or':_[_0x09ed('0x2f')](_0x118c89,function(_0x3dfcf5){if(_0x3dfcf5[_0x09ed('0x2c')]!==_0x09ed('0x3c')){var _0x17ca58={};_0x17ca58[_0x3dfcf5[_0x09ed('0x28')]]={'$like':'%'+_0x252747[_0x09ed('0x30')]['filter']+'%'};return _0x17ca58;}})});}_0x1ba6a2=_[_0x09ed('0x3b')]({},_0x1ba6a2,_0x252747['options']);var _0x3611f4={'where':_0x1ba6a2['where']};return db['Sound'][_0x09ed('0x1e')](_0x3611f4)['then'](function(_0x34a40b){_0x3ff07a[_0x09ed('0x1e')]=_0x34a40b;if(_0x252747[_0x09ed('0x30')][_0x09ed('0x3d')]){_0x1ba6a2[_0x09ed('0x3e')]=[{'all':!![]}];}return db['Sound'][_0x09ed('0x3f')](_0x1ba6a2);})[_0x09ed('0x21')](function(_0x187515){_0x3ff07a[_0x09ed('0x40')]=_0x187515;return _0x3ff07a;})[_0x09ed('0x21')](respondWithFilteredResult(_0x18af73,_0x1ba6a2))[_0x09ed('0x41')](handleError(_0x18af73,null));};exports[_0x09ed('0x42')]=function(_0x49d74a,_0x26ebab){var _0x24b9c5={'raw':!![],'where':{'id':_0x49d74a[_0x09ed('0x43')]['id']}},_0x5892c0={};_0x5892c0[_0x09ed('0x2e')]=_['keys'](db[_0x09ed('0x2a')][_0x09ed('0x2b')]);_0x5892c0[_0x09ed('0x30')]=_[_0x09ed('0x31')](_0x49d74a[_0x09ed('0x30')]);_0x5892c0['filters']=_['intersection'](_0x5892c0[_0x09ed('0x2e')],_0x5892c0[_0x09ed('0x30')]);_0x24b9c5[_0x09ed('0x34')]=_[_0x09ed('0x33')](_0x5892c0[_0x09ed('0x2e')],qs['fields'](_0x49d74a['query']['fields']));_0x24b9c5['attributes']=_0x24b9c5[_0x09ed('0x34')][_0x09ed('0x36')]?_0x24b9c5['attributes']:_0x5892c0[_0x09ed('0x2e')];if(_0x49d74a['query'][_0x09ed('0x3d')]){_0x24b9c5[_0x09ed('0x3e')]=[{'all':!![]}];}_0x24b9c5=_[_0x09ed('0x3b')]({},_0x24b9c5,_0x49d74a[_0x09ed('0x44')]);return db[_0x09ed('0x2a')]['find'](_0x24b9c5)[_0x09ed('0x21')](handleEntityNotFound(_0x26ebab,null))[_0x09ed('0x21')](respondWithResult(_0x26ebab,null))[_0x09ed('0x41')](handleError(_0x26ebab,null));};exports[_0x09ed('0x45')]=function(_0x204c75,_0xece21f,_0xcf9b63){return db[_0x09ed('0x2a')][_0x09ed('0x46')]({'where':{'id':_0x204c75[_0x09ed('0x43')]['id']},'attributes':['name','save_name',_0x09ed('0x47')],'raw':!![]})[_0x09ed('0x21')](handleEntityNotFound(_0xece21f,null))[_0x09ed('0x21')](function(_0x410387){if(_0x410387){if(!fs[_0x09ed('0x48')](path[_0x09ed('0x49')](config[_0x09ed('0x4a')],_0x09ed('0x4b'),_0x410387[_0x09ed('0x4c')]+'.'+_0x410387['converted_format']))){throw new db[(_0x09ed('0x4d'))][(_0x09ed('0x4e'))](_0x09ed('0x4f'));}return _0xece21f['download'](path['join'](config[_0x09ed('0x4a')],'server/files/sounds/converted',util['format'](_0x09ed('0x50'),_0x410387['save_name'],_0x410387[_0x09ed('0x47')])),util[_0x09ed('0x51')](_0x09ed('0x50'),_0x410387['name'],_0x410387['converted_format']));}return null;})[_0x09ed('0x41')](handleError(_0xece21f,null));};exports[_0x09ed('0x52')]=function(_0x40a4b4,_0xe3c1e0,_0x4f7918){var _0x1e8c4e={'name':path['basename'](_0x40a4b4[_0x09ed('0x53')][_0x09ed('0x54')],path[_0x09ed('0x55')](_0x40a4b4[_0x09ed('0x53')]['originalname'])),'save_name':path[_0x09ed('0x56')](_0x40a4b4[_0x09ed('0x53')][_0x09ed('0x57')],path[_0x09ed('0x55')](_0x40a4b4[_0x09ed('0x53')][_0x09ed('0x57')])),'original_format':path[_0x09ed('0x55')](_0x40a4b4[_0x09ed('0x53')][_0x09ed('0x54')])['substring'](0x1),'converted_format':_0x09ed('0x58')};var _0xf88c72=path[_0x09ed('0x49')](config['root'],_0x09ed('0x59'),_0x40a4b4[_0x09ed('0x53')][_0x09ed('0x57')]);var _0x2d3c97=path['join'](config[_0x09ed('0x4a')],'server/files/sounds/converted',util[_0x09ed('0x51')]('%s.%s',path[_0x09ed('0x56')](_0x40a4b4[_0x09ed('0x53')][_0x09ed('0x57')],path[_0x09ed('0x55')](_0x40a4b4['file'][_0x09ed('0x57')])),_0x1e8c4e[_0x09ed('0x47')]));logger[_0x09ed('0x5a')](_0x09ed('0x5b'),_0xf88c72);logger[_0x09ed('0x5a')](_0x09ed('0x5c'),_0x2d3c97);try{fs[_0x09ed('0x5d')](_0xf88c72,parseInt('0777',0x8));var _0x2cde10=sox[_0x09ed('0x5e')](_0xf88c72,_0x2d3c97,{'sampleRate':0x1f40,'format':_0x09ed('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2cde10['on'](_0x09ed('0x26'),function(_0x41ea85){fs[_0x09ed('0x5f')](_0xf88c72);_0xe3c1e0[_0x09ed('0x18')](0x1f4)[_0x09ed('0x60')](_0x41ea85);});_0x2cde10['on']('src',function(_0x418cd2){_0x1e8c4e['original_duration']=isNaN(_0x418cd2[_0x09ed('0x61')])?null:_0x418cd2[_0x09ed('0x61')]*0x3e8;_0x1e8c4e[_0x09ed('0x62')]=isNaN(_0x418cd2['sampleCount'])?null:_0x418cd2[_0x09ed('0x63')];_0x1e8c4e[_0x09ed('0x64')]=isNaN(_0x418cd2[_0x09ed('0x65')])?null:_0x418cd2[_0x09ed('0x65')];_0x1e8c4e[_0x09ed('0x66')]=isNaN(_0x418cd2[_0x09ed('0x67')])?null:_0x418cd2['bitRate'];_0x1e8c4e[_0x09ed('0x68')]=isNaN(_0x418cd2[_0x09ed('0x69')])?null:_0x418cd2[_0x09ed('0x69')];});_0x2cde10['on']('dest',function(_0x55ddf7){_0x1e8c4e[_0x09ed('0x6a')]=isNaN(_0x55ddf7[_0x09ed('0x61')])?null:_0x55ddf7['duration']*0x3e8;_0x1e8c4e[_0x09ed('0x6b')]=isNaN(_0x55ddf7[_0x09ed('0x63')])?null:_0x55ddf7[_0x09ed('0x63')];_0x1e8c4e[_0x09ed('0x6c')]=isNaN(_0x55ddf7[_0x09ed('0x65')])?null:_0x55ddf7[_0x09ed('0x65')];_0x1e8c4e[_0x09ed('0x6d')]=isNaN(_0x55ddf7[_0x09ed('0x67')])?null:_0x55ddf7['bitRate'];_0x1e8c4e[_0x09ed('0x6e')]=isNaN(_0x55ddf7[_0x09ed('0x69')])?null:_0x55ddf7[_0x09ed('0x69')];});_0x2cde10['on'](_0x09ed('0x19'),function(){fs[_0x09ed('0x5d')](_0x2d3c97,parseInt(_0x09ed('0x6f'),0x8));return db[_0x09ed('0x2a')][_0x09ed('0x52')](_0x1e8c4e)[_0x09ed('0x21')](function(_0xc50808){var _0x245227={'role':_0x40a4b4[_0x09ed('0x70')][_0x09ed('0x71')],'userProfileId':_0x40a4b4['body']['userProfileId']};if(!_0x245227)throw new Error(_0x09ed('0x72'));if(_0x245227['role']===_0x09ed('0x73')){var _0x258077=_0xc50808[_0x09ed('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x09ed('0x23'),'userProfileId':_0x245227[_0x09ed('0x74')]},'raw':!![]})[_0x09ed('0x21')](function(_0x9805a1){if(_0x9805a1&&_0x9805a1['autoAssociation']===0x0){return db[_0x09ed('0x24')][_0x09ed('0x52')]({'name':_0x258077[_0x09ed('0x28')],'resourceId':_0x258077['id'],'type':_0x9805a1['name'],'sectionId':_0x9805a1['id']},{})[_0x09ed('0x21')](function(){return _0xc50808;});}else{return _0xc50808;}})[_0x09ed('0x41')](function(_0x29b078){logger[_0x09ed('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29b078);throw _0x29b078;});}return _0xc50808;})['then'](respondWithResult(_0xe3c1e0,null))[_0x09ed('0x41')](handleError(_0xe3c1e0,null));});_0x2cde10['start']();}catch(_0x19a746){_0xe3c1e0['status'](0x1f4)[_0x09ed('0x60')](_0x19a746);}};exports[_0x09ed('0x75')]=function(_0x3676f2,_0x5173ff,_0x3ef080){return db['Sound'][_0x09ed('0x46')]({'where':{'id':_0x3676f2['params']['id']}})['then'](handleEntityNotFound(_0x5173ff,null))[_0x09ed('0x21')](saveUpdates(_['pick'](_0x3676f2[_0x09ed('0x70')],['name',_0x09ed('0x76')]),null))[_0x09ed('0x21')](respondWithResult(_0x5173ff,null))[_0x09ed('0x41')](handleError(_0x5173ff,null));};exports[_0x09ed('0x77')]=function(_0x155e46,_0x3a8e67,_0x2fabc8){return db[_0x09ed('0x2a')][_0x09ed('0x46')]({'where':{'id':_0x155e46[_0x09ed('0x43')]['id']}})[_0x09ed('0x21')](function(_0x3cde3f){if(_0x3cde3f){return _0x3cde3f[_0x09ed('0x25')]();}})[_0x09ed('0x21')](function(_0x200ac1){var _0x33b316=path['join'](config[_0x09ed('0x4a')],_0x09ed('0x59'),util[_0x09ed('0x51')](_0x09ed('0x50'),_0x200ac1[_0x09ed('0x4c')],_0x200ac1[_0x09ed('0x78')]));var _0x4f4ee3=path[_0x09ed('0x49')](config[_0x09ed('0x4a')],'server/files/sounds/converted',util[_0x09ed('0x51')](_0x09ed('0x50'),_0x200ac1['save_name'],_0x200ac1[_0x09ed('0x47')]));fs[_0x09ed('0x5f')](_0x33b316);fs[_0x09ed('0x5f')](_0x4f4ee3);return _0x200ac1;})[_0x09ed('0x21')](function(_0x3092e9){if(_0x3092e9){return _0x3a8e67['status'](0xcc)[_0x09ed('0x19')]();}})[_0x09ed('0x21')](handleEntityNotFound(_0x3a8e67,null))[_0x09ed('0x41')](handleError(_0x3a8e67,null));}; \ No newline at end of file +var _0xf41e=['show','params','rawAttributes','include','options','find','download','save_name','converted_format','root','server/files/sounds/converted','Sound\x20not\x20found','join','format','%s.%s','create','basename','file','originalname','extname','substring','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Sound','model','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','count','includeAll','findAll','rows','catch'];(function(_0x41a29e,_0x6f3085){var _0x205b20=function(_0x24cddd){while(--_0x24cddd){_0x41a29e['push'](_0x41a29e['shift']());}};_0x205b20(++_0x6f3085);}(_0xf41e,0x1ab));var _0xef41=function(_0x695289,_0x5e1f1a){_0x695289=_0x695289-0x0;var _0x11a97b=_0xf41e[_0x695289];return _0x11a97b;};'use strict';var emlformat=require(_0xef41('0x0'));var rimraf=require(_0xef41('0x1'));var zipdir=require(_0xef41('0x2'));var jsonpatch=require(_0xef41('0x3'));var rp=require(_0xef41('0x4'));var moment=require('moment');var BPromise=require(_0xef41('0x5'));var Mustache=require(_0xef41('0x6'));var util=require(_0xef41('0x7'));var path=require(_0xef41('0x8'));var sox=require(_0xef41('0x9'));var csv=require('to-csv');var ejs=require(_0xef41('0xa'));var fs=require('fs');var fs_extra=require(_0xef41('0xb'));var _=require(_0xef41('0xc'));var squel=require(_0xef41('0xd'));var crypto=require('crypto');var jsforce=require(_0xef41('0xe'));var deskjs=require(_0xef41('0xf'));var toCsv=require('to-csv');var querystring=require(_0xef41('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xef41('0x11'));var qs=require(_0xef41('0x12'));var as=require(_0xef41('0x13'));var hardwareService=require(_0xef41('0x14'));var logger=require(_0xef41('0x15'))(_0xef41('0x16'));var utils=require(_0xef41('0x17'));var config=require(_0xef41('0x18'));var licenseUtil=require(_0xef41('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45a90a,_0x459e82){_0x459e82=_0x459e82||0xcc;return function(_0x4630c7){if(_0x4630c7){return _0x45a90a[_0xef41('0x1a')](_0x459e82);}return _0x45a90a['status'](_0x459e82)[_0xef41('0x1b')]();};}function respondWithResult(_0x1b5f94,_0x44ac5b){_0x44ac5b=_0x44ac5b||0xc8;return function(_0x5310b4){if(_0x5310b4){return _0x1b5f94[_0xef41('0x1c')](_0x44ac5b)[_0xef41('0x1d')](_0x5310b4);}};}function respondWithFilteredResult(_0x5f5303,_0x90a71a){return function(_0x575ec4){if(_0x575ec4){var _0x341dd0=typeof _0x90a71a['offset']===_0xef41('0x1e')&&typeof _0x90a71a[_0xef41('0x1f')]==='undefined';var _0x4d2227=_0x575ec4['count'];var _0x231c95=_0x341dd0?0x0:_0x90a71a[_0xef41('0x20')];var _0x4b4dbb=_0x341dd0?_0x575ec4['count']:_0x90a71a[_0xef41('0x20')]+_0x90a71a[_0xef41('0x1f')];var _0x12a67f;if(_0x4b4dbb>=_0x4d2227){_0x4b4dbb=_0x4d2227;_0x12a67f=0xc8;}else{_0x12a67f=0xce;}_0x5f5303['status'](_0x12a67f);return _0x5f5303[_0xef41('0x21')]('Content-Range',_0x231c95+'-'+_0x4b4dbb+'/'+_0x4d2227)[_0xef41('0x1d')](_0x575ec4);}return null;};}function patchUpdates(_0x30eb6b){return function(_0x1a0c53){try{jsonpatch[_0xef41('0x22')](_0x1a0c53,_0x30eb6b,!![]);}catch(_0x180aa0){return BPromise[_0xef41('0x23')](_0x180aa0);}return _0x1a0c53[_0xef41('0x24')]();};}function saveUpdates(_0x589931,_0x1d4135){return function(_0x577f29){if(_0x577f29){return _0x577f29[_0xef41('0x25')](_0x589931)[_0xef41('0x26')](function(_0xfc1393){return _0xfc1393;});}return null;};}function removeEntity(_0x4aa008,_0x435d62){return function(_0x567c7a){if(_0x567c7a){return _0x567c7a[_0xef41('0x27')]()[_0xef41('0x26')](function(){var _0x6e3a9e=_0x567c7a[_0xef41('0x28')]({'plain':!![]});var _0x21efda='Sounds';return db[_0xef41('0x29')][_0xef41('0x27')]({'where':{'type':_0x21efda,'resourceId':_0x6e3a9e['id']}})['then'](function(){return _0x567c7a;});})[_0xef41('0x26')](function(){_0x4aa008[_0xef41('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5787d6,_0x46619d){return function(_0x31d934){if(!_0x31d934){_0x5787d6[_0xef41('0x1a')](0x194);}return _0x31d934;};}function handleError(_0x5ab5a9,_0x86556a){_0x86556a=_0x86556a||0x1f4;return function(_0x7cb600){logger[_0xef41('0x2a')](_0x7cb600[_0xef41('0x2b')]);if(_0x7cb600[_0xef41('0x2c')]){delete _0x7cb600[_0xef41('0x2c')];}_0x5ab5a9[_0xef41('0x1c')](_0x86556a)[_0xef41('0x2d')](_0x7cb600);};}exports[_0xef41('0x2e')]=function(_0x80cb66,_0x2967f1){var _0x14a734={},_0xfe696e={},_0x33ec54={'count':0x0,'rows':[]};var _0x263a47=_[_0xef41('0x2f')](db[_0xef41('0x30')]['rawAttributes'],function(_0x2f0ef9){return{'name':_0x2f0ef9['fieldName'],'type':_0x2f0ef9['type']['key']};});_0xfe696e[_0xef41('0x31')]=_['map'](_0x263a47,'name');_0xfe696e['query']=_[_0xef41('0x32')](_0x80cb66['query']);_0xfe696e['filters']=_[_0xef41('0x33')](_0xfe696e[_0xef41('0x31')],_0xfe696e['query']);_0x14a734[_0xef41('0x34')]=_[_0xef41('0x33')](_0xfe696e[_0xef41('0x31')],qs[_0xef41('0x35')](_0x80cb66[_0xef41('0x36')][_0xef41('0x35')]));_0x14a734[_0xef41('0x34')]=_0x14a734[_0xef41('0x34')][_0xef41('0x37')]?_0x14a734[_0xef41('0x34')]:_0xfe696e[_0xef41('0x31')];if(!_0x80cb66['query'][_0xef41('0x38')](_0xef41('0x39'))){_0x14a734[_0xef41('0x1f')]=qs[_0xef41('0x1f')](_0x80cb66[_0xef41('0x36')][_0xef41('0x1f')]);_0x14a734['offset']=qs[_0xef41('0x20')](_0x80cb66['query'][_0xef41('0x20')]);}_0x14a734[_0xef41('0x3a')]=qs[_0xef41('0x3b')](_0x80cb66['query'][_0xef41('0x3b')]);_0x14a734[_0xef41('0x3c')]=qs['filters'](_['pick'](_0x80cb66[_0xef41('0x36')],_0xfe696e[_0xef41('0x3d')]),_0x263a47);if(_0x80cb66[_0xef41('0x36')][_0xef41('0x3e')]){_0x14a734[_0xef41('0x3c')]=_[_0xef41('0x3f')](_0x14a734['where'],{'$or':_['map'](_0x263a47,function(_0x5b7415){if(_0x5b7415['type']!=='VIRTUAL'){var _0x33380a={};_0x33380a[_0x5b7415[_0xef41('0x2c')]]={'$like':'%'+_0x80cb66[_0xef41('0x36')][_0xef41('0x3e')]+'%'};return _0x33380a;}})});}_0x14a734=_[_0xef41('0x3f')]({},_0x14a734,_0x80cb66['options']);var _0x337e05={'where':_0x14a734['where']};return db['Sound'][_0xef41('0x40')](_0x337e05)[_0xef41('0x26')](function(_0x104d33){_0x33ec54[_0xef41('0x40')]=_0x104d33;if(_0x80cb66[_0xef41('0x36')][_0xef41('0x41')]){_0x14a734['include']=[{'all':!![]}];}return db[_0xef41('0x30')][_0xef41('0x42')](_0x14a734);})[_0xef41('0x26')](function(_0x14146d){_0x33ec54[_0xef41('0x43')]=_0x14146d;return _0x33ec54;})[_0xef41('0x26')](respondWithFilteredResult(_0x2967f1,_0x14a734))[_0xef41('0x44')](handleError(_0x2967f1,null));};exports[_0xef41('0x45')]=function(_0x38fd5c,_0x1d439d){var _0x4e34a0={'raw':!![],'where':{'id':_0x38fd5c[_0xef41('0x46')]['id']}},_0x5eec99={};_0x5eec99[_0xef41('0x31')]=_[_0xef41('0x32')](db[_0xef41('0x30')][_0xef41('0x47')]);_0x5eec99[_0xef41('0x36')]=_[_0xef41('0x32')](_0x38fd5c['query']);_0x5eec99[_0xef41('0x3d')]=_[_0xef41('0x33')](_0x5eec99[_0xef41('0x31')],_0x5eec99['query']);_0x4e34a0[_0xef41('0x34')]=_[_0xef41('0x33')](_0x5eec99['model'],qs[_0xef41('0x35')](_0x38fd5c[_0xef41('0x36')][_0xef41('0x35')]));_0x4e34a0[_0xef41('0x34')]=_0x4e34a0[_0xef41('0x34')][_0xef41('0x37')]?_0x4e34a0['attributes']:_0x5eec99[_0xef41('0x31')];if(_0x38fd5c[_0xef41('0x36')][_0xef41('0x41')]){_0x4e34a0[_0xef41('0x48')]=[{'all':!![]}];}_0x4e34a0=_[_0xef41('0x3f')]({},_0x4e34a0,_0x38fd5c[_0xef41('0x49')]);return db[_0xef41('0x30')][_0xef41('0x4a')](_0x4e34a0)[_0xef41('0x26')](handleEntityNotFound(_0x1d439d,null))[_0xef41('0x26')](respondWithResult(_0x1d439d,null))[_0xef41('0x44')](handleError(_0x1d439d,null));};exports[_0xef41('0x4b')]=function(_0x27ce9b,_0x478b85,_0x3bf63d){return db[_0xef41('0x30')][_0xef41('0x4a')]({'where':{'id':_0x27ce9b[_0xef41('0x46')]['id']},'attributes':[_0xef41('0x2c'),_0xef41('0x4c'),_0xef41('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x478b85,null))[_0xef41('0x26')](function(_0x56622d){if(_0x56622d){if(!fs['existsSync'](path['join'](config[_0xef41('0x4e')],_0xef41('0x4f'),_0x56622d['save_name']+'.'+_0x56622d[_0xef41('0x4d')]))){throw new db['Sequelize']['ValidationError'](_0xef41('0x50'));}return _0x478b85[_0xef41('0x4b')](path[_0xef41('0x51')](config[_0xef41('0x4e')],_0xef41('0x4f'),util[_0xef41('0x52')]('%s.%s',_0x56622d[_0xef41('0x4c')],_0x56622d['converted_format'])),util[_0xef41('0x52')](_0xef41('0x53'),_0x56622d['name'],_0x56622d[_0xef41('0x4d')]));}return null;})[_0xef41('0x44')](handleError(_0x478b85,null));};exports[_0xef41('0x54')]=function(_0x39d904,_0x4b466e,_0x428078){var _0x413536={'name':path[_0xef41('0x55')](_0x39d904[_0xef41('0x56')][_0xef41('0x57')],path['extname'](_0x39d904[_0xef41('0x56')][_0xef41('0x57')])),'save_name':path[_0xef41('0x55')](_0x39d904['file']['filename'],path['extname'](_0x39d904[_0xef41('0x56')]['filename'])),'original_format':path[_0xef41('0x58')](_0x39d904[_0xef41('0x56')][_0xef41('0x57')])[_0xef41('0x59')](0x1),'converted_format':_0xef41('0x5a')};var _0x24774e=path[_0xef41('0x51')](config[_0xef41('0x4e')],_0xef41('0x5b'),_0x39d904[_0xef41('0x56')][_0xef41('0x5c')]);var _0x3d6dcd=path[_0xef41('0x51')](config['root'],'server/files/sounds/converted',util['format'](_0xef41('0x53'),path['basename'](_0x39d904['file'][_0xef41('0x5c')],path[_0xef41('0x58')](_0x39d904[_0xef41('0x56')][_0xef41('0x5c')])),_0x413536[_0xef41('0x4d')]));logger[_0xef41('0x5d')](_0xef41('0x5e'),_0x24774e);logger[_0xef41('0x5d')]('Sound\x20upload\x20destination:\x20%s',_0x3d6dcd);try{fs[_0xef41('0x5f')](_0x24774e,parseInt(_0xef41('0x60'),0x8));var _0x1421ab=sox[_0xef41('0x61')](_0x24774e,_0x3d6dcd,{'sampleRate':0x1f40,'format':_0xef41('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1421ab['on'](_0xef41('0x2a'),function(_0x483c18){fs[_0xef41('0x62')](_0x24774e);_0x4b466e[_0xef41('0x1c')](0x1f4)[_0xef41('0x2d')](_0x483c18);});_0x1421ab['on'](_0xef41('0x63'),function(_0x52184b){_0x413536['original_duration']=isNaN(_0x52184b[_0xef41('0x64')])?null:_0x52184b[_0xef41('0x64')]*0x3e8;_0x413536['original_sampleCount']=isNaN(_0x52184b[_0xef41('0x65')])?null:_0x52184b[_0xef41('0x65')];_0x413536[_0xef41('0x66')]=isNaN(_0x52184b[_0xef41('0x67')])?null:_0x52184b['channelCount'];_0x413536[_0xef41('0x68')]=isNaN(_0x52184b['bitRate'])?null:_0x52184b[_0xef41('0x69')];_0x413536[_0xef41('0x6a')]=isNaN(_0x52184b[_0xef41('0x6b')])?null:_0x52184b[_0xef41('0x6b')];});_0x1421ab['on'](_0xef41('0x6c'),function(_0x5c3ed9){_0x413536['converted_duration']=isNaN(_0x5c3ed9[_0xef41('0x64')])?null:_0x5c3ed9[_0xef41('0x64')]*0x3e8;_0x413536[_0xef41('0x6d')]=isNaN(_0x5c3ed9[_0xef41('0x65')])?null:_0x5c3ed9[_0xef41('0x65')];_0x413536[_0xef41('0x6e')]=isNaN(_0x5c3ed9[_0xef41('0x67')])?null:_0x5c3ed9[_0xef41('0x67')];_0x413536[_0xef41('0x6f')]=isNaN(_0x5c3ed9[_0xef41('0x69')])?null:_0x5c3ed9[_0xef41('0x69')];_0x413536['converted_sampleRate']=isNaN(_0x5c3ed9[_0xef41('0x6b')])?null:_0x5c3ed9['sampleRate'];});_0x1421ab['on'](_0xef41('0x1b'),function(){fs['chmodSync'](_0x3d6dcd,parseInt('0777',0x8));return db[_0xef41('0x30')][_0xef41('0x54')](_0x413536)[_0xef41('0x26')](function(_0x2a1f0f){var _0x4a196d={'role':_0x39d904[_0xef41('0x70')][_0xef41('0x71')],'userProfileId':_0x39d904[_0xef41('0x70')]['userProfileId']};if(!_0x4a196d)throw new Error(_0xef41('0x72'));if(_0x4a196d[_0xef41('0x71')]===_0xef41('0x73')){var _0x45142e=_0x2a1f0f[_0xef41('0x28')]({'plain':!![]});return db[_0xef41('0x74')][_0xef41('0x4a')]({'where':{'name':_0xef41('0x75'),'userProfileId':_0x4a196d[_0xef41('0x76')]},'raw':!![]})[_0xef41('0x26')](function(_0x1c8ccf){if(_0x1c8ccf&&_0x1c8ccf[_0xef41('0x77')]===0x0){return db[_0xef41('0x29')][_0xef41('0x54')]({'name':_0x45142e['name'],'resourceId':_0x45142e['id'],'type':_0x1c8ccf[_0xef41('0x2c')],'sectionId':_0x1c8ccf['id']},{})[_0xef41('0x26')](function(){return _0x2a1f0f;});}else{return _0x2a1f0f;}})['catch'](function(_0x4b8078){logger['error'](_0xef41('0x78'),_0x4b8078);throw _0x4b8078;});}return _0x2a1f0f;})['then'](respondWithResult(_0x4b466e,null))['catch'](handleError(_0x4b466e,null));});_0x1421ab['start']();}catch(_0x19589b){_0x4b466e[_0xef41('0x1c')](0x1f4)[_0xef41('0x2d')](_0x19589b);}};exports['update']=function(_0x51715b,_0x436223,_0x596247){return db[_0xef41('0x30')][_0xef41('0x4a')]({'where':{'id':_0x51715b[_0xef41('0x46')]['id']}})[_0xef41('0x26')](handleEntityNotFound(_0x436223,null))[_0xef41('0x26')](saveUpdates(_[_0xef41('0x79')](_0x51715b[_0xef41('0x70')],[_0xef41('0x2c'),_0xef41('0x7a')]),null))[_0xef41('0x26')](respondWithResult(_0x436223,null))[_0xef41('0x44')](handleError(_0x436223,null));};exports['delete']=function(_0x191401,_0x218e18,_0x5dbbaf){return db[_0xef41('0x30')][_0xef41('0x4a')]({'where':{'id':_0x191401[_0xef41('0x46')]['id']}})[_0xef41('0x26')](function(_0x5c52ae){if(_0x5c52ae){return _0x5c52ae['destroy']();}})['then'](function(_0x194e77){var _0x17e79=path[_0xef41('0x51')](config[_0xef41('0x4e')],'server/files/sounds/original',util['format']('%s.%s',_0x194e77[_0xef41('0x4c')],_0x194e77[_0xef41('0x7b')]));var _0x1c0995=path[_0xef41('0x51')](config[_0xef41('0x4e')],_0xef41('0x4f'),util['format'](_0xef41('0x53'),_0x194e77[_0xef41('0x4c')],_0x194e77[_0xef41('0x4d')]));fs[_0xef41('0x62')](_0x17e79);fs[_0xef41('0x62')](_0x1c0995);return _0x194e77;})[_0xef41('0x26')](function(_0x49c617){if(_0x49c617){return _0x218e18['status'](0xcc)['end']();}})['then'](handleEntityNotFound(_0x218e18,null))[_0xef41('0x44')](handleError(_0x218e18,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 0b561f3..dcb88cf 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 _0xeb2c=['Sound','tools_sounds','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x25523e,_0x12c13d){var _0x3556ce=function(_0x41d4ce){while(--_0x41d4ce){_0x25523e['push'](_0x25523e['shift']());}};_0x3556ce(++_0x12c13d);}(_0xeb2c,0x1ee));var _0xceb2=function(_0x52ec66,_0x5af299){_0x52ec66=_0x52ec66-0x0;var _0x40f4b7=_0xeb2c[_0x52ec66];return _0x40f4b7;};'use strict';var _=require(_0xceb2('0x0'));var util=require(_0xceb2('0x1'));var logger=require(_0xceb2('0x2'))('api');var moment=require(_0xceb2('0x3'));var BPromise=require(_0xceb2('0x4'));var rp=require(_0xceb2('0x5'));var fs=require('fs');var path=require(_0xceb2('0x6'));var rimraf=require(_0xceb2('0x7'));var config=require(_0xceb2('0x8'));var attributes=require('./sound.attributes');module[_0xceb2('0x9')]=function(_0x26d45e,_0x17a714){return _0x26d45e['define'](_0xceb2('0xa'),attributes,{'tableName':_0xceb2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc864=['request-promise','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','moment','bluebird'];(function(_0x9e315e,_0x4a101f){var _0x20a599=function(_0x42d9d8){while(--_0x42d9d8){_0x9e315e['push'](_0x9e315e['shift']());}};_0x20a599(++_0x4a101f);}(_0xc864,0x140));var _0x4c86=function(_0x49c8a0,_0x4e4495){_0x49c8a0=_0x49c8a0-0x0;var _0x33eb68=_0xc864[_0x49c8a0];return _0x33eb68;};'use strict';var _=require(_0x4c86('0x0'));var util=require('util');var logger=require(_0x4c86('0x1'))(_0x4c86('0x2'));var moment=require(_0x4c86('0x3'));var BPromise=require(_0x4c86('0x4'));var rp=require(_0x4c86('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c86('0x6'));var config=require(_0x4c86('0x7'));var attributes=require(_0x4c86('0x8'));module[_0x4c86('0x9')]=function(_0x4d4957,_0x4b0e75){return _0x4d4957[_0x4c86('0xa')](_0x4c86('0xb'),attributes,{'tableName':_0x4c86('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 26ab7b2..02f3418 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 _0xce33=['message','catch','ShowSound','Sound','raw','options','where','map','model','attributes','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s'];(function(_0x35992a,_0x98beea){var _0x1f21c4=function(_0xaba04b){while(--_0xaba04b){_0x35992a['push'](_0x35992a['shift']());}};_0x1f21c4(++_0x98beea);}(_0xce33,0x12b));var _0x3ce3=function(_0xe5d54f,_0x143d93){_0xe5d54f=_0xe5d54f-0x0;var _0x2a74bf=_0xce33[_0xe5d54f];return _0x2a74bf;};'use strict';var _=require(_0x3ce3('0x0'));var util=require(_0x3ce3('0x1'));var moment=require(_0x3ce3('0x2'));var BPromise=require(_0x3ce3('0x3'));var rs=require(_0x3ce3('0x4'));var fs=require('fs');var Redis=require(_0x3ce3('0x5'));var db=require(_0x3ce3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ce3('0x7'))(_0x3ce3('0x8'));var config=require(_0x3ce3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3ce3('0xa')][_0x3ce3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x336fe6,_0x3dd028,_0x5cb43e){return new BPromise(function(_0x3bcdfa,_0x2a0808){return client['request'](_0x336fe6,_0x5cb43e)[_0x3ce3('0xc')](function(_0x1159c1){logger[_0x3ce3('0xd')]('Sound,\x20%s,\x20%s',_0x3dd028,_0x3ce3('0xe'));logger[_0x3ce3('0xf')](_0x3ce3('0x10'),_0x3dd028,_0x3ce3('0xe'),JSON[_0x3ce3('0x11')](_0x1159c1));if(_0x1159c1['error']){if(_0x1159c1[_0x3ce3('0x12')][_0x3ce3('0x13')]===0x1f4){logger['error'](_0x3ce3('0x14'),_0x3dd028,_0x1159c1[_0x3ce3('0x12')][_0x3ce3('0x15')]);return _0x2a0808(_0x1159c1[_0x3ce3('0x12')][_0x3ce3('0x15')]);}logger['error']('Sound,\x20%s,\x20%s',_0x3dd028,_0x1159c1['error'][_0x3ce3('0x15')]);return _0x3bcdfa(_0x1159c1[_0x3ce3('0x12')][_0x3ce3('0x15')]);}else{logger[_0x3ce3('0xd')]('Sound,\x20%s,\x20%s',_0x3dd028,_0x3ce3('0xe'));_0x3bcdfa(_0x1159c1['result']['message']);}})[_0x3ce3('0x16')](function(_0x2a0c05){logger[_0x3ce3('0x12')](_0x3ce3('0x14'),_0x3dd028,_0x2a0c05);_0x2a0808(_0x2a0c05);});});}exports[_0x3ce3('0x17')]=function(_0x28f108){var _0x362226=this;return new Promise(function(_0x4f41a8,_0x94de2a){return db[_0x3ce3('0x18')]['find']({'raw':_0x28f108['options']?_0x28f108['options'][_0x3ce3('0x19')]===undefined?!![]:![]:!![],'where':_0x28f108[_0x3ce3('0x1a')]?_0x28f108[_0x3ce3('0x1a')][_0x3ce3('0x1b')]||null:null,'attributes':_0x28f108[_0x3ce3('0x1a')]?_0x28f108[_0x3ce3('0x1a')]['attributes']||null:null,'include':_0x28f108['options']?_0x28f108[_0x3ce3('0x1a')]['include']?_[_0x3ce3('0x1c')](_0x28f108[_0x3ce3('0x1a')]['include'],function(_0x2f27e3){return{'model':db[_0x2f27e3[_0x3ce3('0x1d')]],'as':_0x2f27e3['as'],'attributes':_0x2f27e3[_0x3ce3('0x1e')],'include':_0x2f27e3[_0x3ce3('0x1f')]?_[_0x3ce3('0x1c')](_0x2f27e3['include'],function(_0x1e61d9){return{'model':db[_0x1e61d9['model']],'as':_0x1e61d9['as'],'attributes':_0x1e61d9[_0x3ce3('0x1e')],'include':_0x1e61d9[_0x3ce3('0x1f')]?_[_0x3ce3('0x1c')](_0x1e61d9[_0x3ce3('0x1f')],function(_0x505b4f){return{'model':db[_0x505b4f[_0x3ce3('0x1d')]],'as':_0x505b4f['as'],'attributes':_0x505b4f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ce3('0xc')](function(_0x47042c){logger['info']('ShowSound',_0x28f108);logger[_0x3ce3('0xf')](_0x3ce3('0x17'),_0x28f108,JSON['stringify'](_0x47042c));_0x4f41a8(_0x47042c);})[_0x3ce3('0x16')](function(_0x2c3454){logger[_0x3ce3('0x12')](_0x3ce3('0x17'),_0x2c3454[_0x3ce3('0x15')],_0x28f108);_0x94de2a(_0x362226[_0x3ce3('0x12')](0x1f4,_0x2c3454['message']));});});}; \ No newline at end of file +var _0x4a62=['then','info','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowSound','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x44add6,_0x4a1390){var _0x5c8236=function(_0x25b6b3){while(--_0x25b6b3){_0x44add6['push'](_0x44add6['shift']());}};_0x5c8236(++_0x4a1390);}(_0x4a62,0x1e2));var _0x24a6=function(_0x537078,_0x1d674d){_0x537078=_0x537078-0x0;var _0x45f82a=_0x4a62[_0x537078];return _0x45f82a;};'use strict';var _=require(_0x24a6('0x0'));var util=require(_0x24a6('0x1'));var moment=require(_0x24a6('0x2'));var BPromise=require(_0x24a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24a6('0x4'));var db=require(_0x24a6('0x5'))['db'];var utils=require(_0x24a6('0x6'));var logger=require(_0x24a6('0x7'))(_0x24a6('0x8'));var config=require(_0x24a6('0x9'));var jayson=require(_0x24a6('0xa'));var client=jayson['client'][_0x24a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e1920,_0x277e95,_0x952025){return new BPromise(function(_0x58b6d8,_0xc14523){return client[_0x24a6('0xc')](_0x3e1920,_0x952025)[_0x24a6('0xd')](function(_0x3f4952){logger[_0x24a6('0xe')]('Sound,\x20%s,\x20%s',_0x277e95,'request\x20sent');logger[_0x24a6('0xf')](_0x24a6('0x10'),_0x277e95,'request\x20sent',JSON[_0x24a6('0x11')](_0x3f4952));if(_0x3f4952['error']){if(_0x3f4952[_0x24a6('0x12')][_0x24a6('0x13')]===0x1f4){logger[_0x24a6('0x12')](_0x24a6('0x14'),_0x277e95,_0x3f4952['error'][_0x24a6('0x15')]);return _0xc14523(_0x3f4952[_0x24a6('0x12')][_0x24a6('0x15')]);}logger[_0x24a6('0x12')](_0x24a6('0x14'),_0x277e95,_0x3f4952[_0x24a6('0x12')][_0x24a6('0x15')]);return _0x58b6d8(_0x3f4952['error'][_0x24a6('0x15')]);}else{logger['info'](_0x24a6('0x14'),_0x277e95,_0x24a6('0x16'));_0x58b6d8(_0x3f4952[_0x24a6('0x17')][_0x24a6('0x15')]);}})[_0x24a6('0x18')](function(_0x2b34f0){logger['error']('Sound,\x20%s,\x20%s',_0x277e95,_0x2b34f0);_0xc14523(_0x2b34f0);});});}exports[_0x24a6('0x19')]=function(_0xf74288){var _0x2bbd7d=this;return new Promise(function(_0x3434c0,_0x10111a){return db['Sound']['find']({'raw':_0xf74288[_0x24a6('0x1a')]?_0xf74288[_0x24a6('0x1a')][_0x24a6('0x1b')]===undefined?!![]:![]:!![],'where':_0xf74288[_0x24a6('0x1a')]?_0xf74288[_0x24a6('0x1a')][_0x24a6('0x1c')]||null:null,'attributes':_0xf74288[_0x24a6('0x1a')]?_0xf74288[_0x24a6('0x1a')]['attributes']||null:null,'include':_0xf74288[_0x24a6('0x1a')]?_0xf74288[_0x24a6('0x1a')][_0x24a6('0x1d')]?_[_0x24a6('0x1e')](_0xf74288[_0x24a6('0x1a')][_0x24a6('0x1d')],function(_0x256ddb){return{'model':db[_0x256ddb[_0x24a6('0x1f')]],'as':_0x256ddb['as'],'attributes':_0x256ddb[_0x24a6('0x20')],'include':_0x256ddb[_0x24a6('0x1d')]?_[_0x24a6('0x1e')](_0x256ddb[_0x24a6('0x1d')],function(_0xde6e52){return{'model':db[_0xde6e52['model']],'as':_0xde6e52['as'],'attributes':_0xde6e52[_0x24a6('0x20')],'include':_0xde6e52[_0x24a6('0x1d')]?_[_0x24a6('0x1e')](_0xde6e52[_0x24a6('0x1d')],function(_0x29b20d){return{'model':db[_0x29b20d[_0x24a6('0x1f')]],'as':_0x29b20d['as'],'attributes':_0x29b20d[_0x24a6('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x235fec){logger[_0x24a6('0xe')](_0x24a6('0x19'),_0xf74288);logger[_0x24a6('0xf')]('ShowSound',_0xf74288,JSON['stringify'](_0x235fec));_0x3434c0(_0x235fec);})[_0x24a6('0x18')](function(_0x465459){logger[_0x24a6('0x12')]('ShowSound',_0x465459[_0x24a6('0x15')],_0xf74288);_0x10111a(_0x2bbd7d[_0x24a6('0x12')](0x1f4,_0x465459[_0x24a6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 218f8a2..cf42b22 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 _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x19e6f7,_0x57e32d){var _0x3f28ba=function(_0x1196ab){while(--_0x1196ab){_0x19e6f7['push'](_0x19e6f7['shift']());}};_0x3f28ba(++_0x57e32d);}(_0x757a,0xde));var _0xa757=function(_0x3f21c7,_0x457b2a){_0x3f21c7=_0x3f21c7-0x0;var _0x406a73=_0x757a[_0x3f21c7];return _0x406a73;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x50d471,_0x2d9086){var _0x214900=function(_0x413fa1){while(--_0x413fa1){_0x50d471['push'](_0x50d471['shift']());}};_0x214900(++_0x2d9086);}(_0x2032,0xd9));var _0x2203=function(_0x4c655f,_0x1b8ccf){_0x4c655f=_0x4c655f-0x0;var _0x15e321=_0x2032[_0x4c655f];return _0x15e321;};'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('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 2868960..f47aa48 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 _0xa26e=['sequelize','STRING','TEXT','medium','ENUM','out'];(function(_0x291d3f,_0x3ef99f){var _0x242080=function(_0x257705){while(--_0x257705){_0x291d3f['push'](_0x291d3f['shift']());}};_0x242080(++_0x3ef99f);}(_0xa26e,0x102));var _0xea26=function(_0x2f1293,_0x1043ae){_0x2f1293=_0x2f1293-0x0;var _0x38a62a=_0xa26e[_0x2f1293];return _0x38a62a;};'use strict';var Sequelize=require(_0xea26('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xea26('0x1')]},'body':{'type':Sequelize[_0xea26('0x2')](_0xea26('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xea26('0x4')]('in',_0xea26('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xea26('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xad30=['exports','STRING','TEXT','out','sequelize'];(function(_0x306c5f,_0x4659f0){var _0xbb27ee=function(_0x2e4a6b){while(--_0x2e4a6b){_0x306c5f['push'](_0x306c5f['shift']());}};_0xbb27ee(++_0x4659f0);}(_0xad30,0xea));var _0x0ad3=function(_0x1490b7,_0x37fcb7){_0x1490b7=_0x1490b7-0x0;var _0x1eb12c=_0xad30[_0x1490b7];return _0x1eb12c;};'use strict';var Sequelize=require(_0x0ad3('0x0'));module[_0x0ad3('0x1')]={'uniqueid':{'type':Sequelize[_0x0ad3('0x2')]},'body':{'type':Sequelize[_0x0ad3('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0ad3('0x4')),'defaultValue':_0x0ad3('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x0ad3('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 64c1864..6661313 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 _0x74e6=['where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','find','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','end','error','stack','name','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x2deef9,_0x1b931e){var _0x257144=function(_0xae18d6){while(--_0xae18d6){_0x2deef9['push'](_0x2deef9['shift']());}};_0x257144(++_0x1b931e);}(_0x74e6,0xed));var _0x674e=function(_0x521e9a,_0x5d532a){_0x521e9a=_0x521e9a-0x0;var _0x4b4f96=_0x74e6[_0x521e9a];return _0x4b4f96;};'use strict';var emlformat=require(_0x674e('0x0'));var rimraf=require(_0x674e('0x1'));var zipdir=require(_0x674e('0x2'));var jsonpatch=require(_0x674e('0x3'));var rp=require('request-promise');var moment=require(_0x674e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x674e('0x5'));var util=require(_0x674e('0x6'));var path=require(_0x674e('0x7'));var sox=require(_0x674e('0x8'));var csv=require('to-csv');var ejs=require(_0x674e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x674e('0xa'));var squel=require(_0x674e('0xb'));var crypto=require(_0x674e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x674e('0xd'));var querystring=require('querystring');var Papa=require(_0x674e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x674e('0xf'));var as=require(_0x674e('0x10'));var hardwareService=require(_0x674e('0x11'));var logger=require(_0x674e('0x12'))(_0x674e('0x13'));var utils=require(_0x674e('0x14'));var config=require(_0x674e('0x15'));var licenseUtil=require(_0x674e('0x16'));var db=require(_0x674e('0x17'))['db'];function respondWithStatusCode(_0x5458dd,_0x259ae3){_0x259ae3=_0x259ae3||0xcc;return function(_0x24a8c0){if(_0x24a8c0){return _0x5458dd[_0x674e('0x18')](_0x259ae3);}return _0x5458dd['status'](_0x259ae3)['end']();};}function respondWithResult(_0xc863b3,_0x10037d){_0x10037d=_0x10037d||0xc8;return function(_0x4c559e){if(_0x4c559e){return _0xc863b3['status'](_0x10037d)[_0x674e('0x19')](_0x4c559e);}};}function respondWithFilteredResult(_0xb063c,_0x649460){return function(_0x50beb4){if(_0x50beb4){var _0x4c00d0=typeof _0x649460[_0x674e('0x1a')]===_0x674e('0x1b')&&typeof _0x649460[_0x674e('0x1c')]==='undefined';var _0x52eaa8=_0x50beb4['count'];var _0x397cb0=_0x4c00d0?0x0:_0x649460[_0x674e('0x1a')];var _0x32b08=_0x4c00d0?_0x50beb4[_0x674e('0x1d')]:_0x649460[_0x674e('0x1a')]+_0x649460[_0x674e('0x1c')];var _0x13fe1b;if(_0x32b08>=_0x52eaa8){_0x32b08=_0x52eaa8;_0x13fe1b=0xc8;}else{_0x13fe1b=0xce;}_0xb063c[_0x674e('0x1e')](_0x13fe1b);return _0xb063c[_0x674e('0x1f')]('Content-Range',_0x397cb0+'-'+_0x32b08+'/'+_0x52eaa8)['json'](_0x50beb4);}return null;};}function patchUpdates(_0x59c426){return function(_0x36f49b){try{jsonpatch[_0x674e('0x20')](_0x36f49b,_0x59c426,!![]);}catch(_0x1fc50f){return BPromise[_0x674e('0x21')](_0x1fc50f);}return _0x36f49b[_0x674e('0x22')]();};}function saveUpdates(_0x473309,_0x513662){return function(_0x588929){if(_0x588929){return _0x588929[_0x674e('0x23')](_0x473309)[_0x674e('0x24')](function(_0x2c596a){return _0x2c596a;});}return null;};}function removeEntity(_0x3e816e,_0x5dfbf7){return function(_0x496edd){if(_0x496edd){return _0x496edd['destroy']()['then'](function(){_0x3e816e[_0x674e('0x1e')](0xcc)[_0x674e('0x25')]();});}};}function handleEntityNotFound(_0x4674d2,_0x2f37a0){return function(_0x55aaf1){if(!_0x55aaf1){_0x4674d2[_0x674e('0x18')](0x194);}return _0x55aaf1;};}function handleError(_0x4d7fde,_0x243b2f){_0x243b2f=_0x243b2f||0x1f4;return function(_0x8de59e){logger[_0x674e('0x26')](_0x8de59e[_0x674e('0x27')]);if(_0x8de59e['name']){delete _0x8de59e[_0x674e('0x28')];}_0x4d7fde[_0x674e('0x1e')](_0x243b2f)['send'](_0x8de59e);};}exports[_0x674e('0x29')]=function(_0x5d1f5b,_0x27ee32){var _0x483d13={},_0x45f960={},_0x349d91={'count':0x0,'rows':[]};var _0x54ccaa=_['map'](db[_0x674e('0x2a')][_0x674e('0x2b')],function(_0x57031d){return{'name':_0x57031d[_0x674e('0x2c')],'type':_0x57031d[_0x674e('0x2d')][_0x674e('0x2e')]};});_0x45f960[_0x674e('0x2f')]=_[_0x674e('0x30')](_0x54ccaa,_0x674e('0x28'));_0x45f960[_0x674e('0x31')]=_[_0x674e('0x32')](_0x5d1f5b[_0x674e('0x31')]);_0x45f960[_0x674e('0x33')]=_[_0x674e('0x34')](_0x45f960['model'],_0x45f960[_0x674e('0x31')]);_0x483d13[_0x674e('0x35')]=_[_0x674e('0x34')](_0x45f960[_0x674e('0x2f')],qs['fields'](_0x5d1f5b[_0x674e('0x31')][_0x674e('0x36')]));_0x483d13[_0x674e('0x35')]=_0x483d13[_0x674e('0x35')][_0x674e('0x37')]?_0x483d13[_0x674e('0x35')]:_0x45f960[_0x674e('0x2f')];if(!_0x5d1f5b[_0x674e('0x31')][_0x674e('0x38')]('nolimit')){_0x483d13['limit']=qs[_0x674e('0x1c')](_0x5d1f5b['query'][_0x674e('0x1c')]);_0x483d13[_0x674e('0x1a')]=qs[_0x674e('0x1a')](_0x5d1f5b[_0x674e('0x31')][_0x674e('0x1a')]);}_0x483d13[_0x674e('0x39')]=qs[_0x674e('0x3a')](_0x5d1f5b[_0x674e('0x31')]['sort']);_0x483d13[_0x674e('0x3b')]=qs['filters'](_[_0x674e('0x3c')](_0x5d1f5b[_0x674e('0x31')],_0x45f960[_0x674e('0x33')]),_0x54ccaa);if(_0x5d1f5b[_0x674e('0x31')][_0x674e('0x3d')]){_0x483d13[_0x674e('0x3b')]=_[_0x674e('0x3e')](_0x483d13['where'],{'$or':_[_0x674e('0x30')](_0x54ccaa,function(_0x4fd117){if(_0x4fd117['type']!==_0x674e('0x3f')){var _0x564a0e={};_0x564a0e[_0x4fd117[_0x674e('0x28')]]={'$like':'%'+_0x5d1f5b[_0x674e('0x31')][_0x674e('0x3d')]+'%'};return _0x564a0e;}})});}_0x483d13=_['merge']({},_0x483d13,_0x5d1f5b[_0x674e('0x40')]);var _0x5385e6={'where':_0x483d13[_0x674e('0x3b')]};return db['SquareMessage'][_0x674e('0x1d')](_0x5385e6)[_0x674e('0x24')](function(_0x5e5d2b){_0x349d91[_0x674e('0x1d')]=_0x5e5d2b;if(_0x5d1f5b[_0x674e('0x31')][_0x674e('0x41')]){_0x483d13['include']=[{'all':!![]}];}return db[_0x674e('0x2a')]['findAll'](_0x483d13);})[_0x674e('0x24')](function(_0x57fe71){_0x349d91[_0x674e('0x42')]=_0x57fe71;return _0x349d91;})[_0x674e('0x24')](respondWithFilteredResult(_0x27ee32,_0x483d13))[_0x674e('0x43')](handleError(_0x27ee32,null));};exports[_0x674e('0x44')]=function(_0x4ae225,_0x3b8282){var _0x598a82={'raw':!![],'where':{'id':_0x4ae225['params']['id']}},_0x2a3d36={};_0x2a3d36['model']=_['keys'](db[_0x674e('0x2a')]['rawAttributes']);_0x2a3d36[_0x674e('0x31')]=_[_0x674e('0x32')](_0x4ae225['query']);_0x2a3d36[_0x674e('0x33')]=_[_0x674e('0x34')](_0x2a3d36[_0x674e('0x2f')],_0x2a3d36[_0x674e('0x31')]);_0x598a82['attributes']=_[_0x674e('0x34')](_0x2a3d36[_0x674e('0x2f')],qs[_0x674e('0x36')](_0x4ae225['query']['fields']));_0x598a82[_0x674e('0x35')]=_0x598a82[_0x674e('0x35')]['length']?_0x598a82[_0x674e('0x35')]:_0x2a3d36[_0x674e('0x2f')];if(_0x4ae225[_0x674e('0x31')][_0x674e('0x41')]){_0x598a82['include']=[{'all':!![]}];}_0x598a82=_[_0x674e('0x3e')]({},_0x598a82,_0x4ae225[_0x674e('0x40')]);return db['SquareMessage'][_0x674e('0x45')](_0x598a82)[_0x674e('0x24')](handleEntityNotFound(_0x3b8282,null))[_0x674e('0x24')](respondWithResult(_0x3b8282,null))['catch'](handleError(_0x3b8282,null));};exports[_0x674e('0x46')]=function(_0x2f1f71,_0x121657){return db['SquareMessage']['create'](_0x2f1f71[_0x674e('0x47')],{})[_0x674e('0x24')](respondWithResult(_0x121657,0xc9))[_0x674e('0x43')](handleError(_0x121657,null));};exports[_0x674e('0x23')]=function(_0x1c359d,_0xf832ed){if(_0x1c359d[_0x674e('0x47')]['id']){delete _0x1c359d['body']['id'];}return db[_0x674e('0x2a')][_0x674e('0x45')]({'where':{'id':_0x1c359d['params']['id']}})['then'](handleEntityNotFound(_0xf832ed,null))[_0x674e('0x24')](saveUpdates(_0x1c359d['body'],null))[_0x674e('0x24')](respondWithResult(_0xf832ed,null))[_0x674e('0x43')](handleError(_0xf832ed,null));};exports[_0x674e('0x48')]=function(_0x47f786,_0x19e956){return db[_0x674e('0x2a')][_0x674e('0x45')]({'where':{'id':_0x47f786[_0x674e('0x49')]['id']}})[_0x674e('0x24')](handleEntityNotFound(_0x19e956,null))[_0x674e('0x24')](removeEntity(_0x19e956,null))[_0x674e('0x43')](handleError(_0x19e956,null));}; \ No newline at end of file +var _0x79a3=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','SquareMessage','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','eml-format','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring'];(function(_0x592409,_0x283aa4){var _0x3848df=function(_0x259814){while(--_0x259814){_0x592409['push'](_0x592409['shift']());}};_0x3848df(++_0x283aa4);}(_0x79a3,0x80));var _0x379a=function(_0x4639fc,_0xcfb3e6){_0x4639fc=_0x4639fc-0x0;var _0xe953f9=_0x79a3[_0x4639fc];return _0xe953f9;};'use strict';var emlformat=require(_0x379a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x379a('0x1'));var jsonpatch=require(_0x379a('0x2'));var rp=require('request-promise');var moment=require(_0x379a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x379a('0x4'));var sox=require(_0x379a('0x5'));var csv=require(_0x379a('0x6'));var ejs=require(_0x379a('0x7'));var fs=require('fs');var fs_extra=require(_0x379a('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x379a('0x9'));var deskjs=require(_0x379a('0xa'));var toCsv=require(_0x379a('0x6'));var querystring=require(_0x379a('0xb'));var Papa=require(_0x379a('0xc'));var Redis=require(_0x379a('0xd'));var authService=require(_0x379a('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x379a('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x379a('0x10'));var config=require(_0x379a('0x11'));var licenseUtil=require(_0x379a('0x12'));var db=require(_0x379a('0x13'))['db'];function respondWithStatusCode(_0x4fa4c8,_0x51d2f4){_0x51d2f4=_0x51d2f4||0xcc;return function(_0x4c69a6){if(_0x4c69a6){return _0x4fa4c8[_0x379a('0x14')](_0x51d2f4);}return _0x4fa4c8[_0x379a('0x15')](_0x51d2f4)[_0x379a('0x16')]();};}function respondWithResult(_0x17adab,_0x561cbf){_0x561cbf=_0x561cbf||0xc8;return function(_0x55a38d){if(_0x55a38d){return _0x17adab[_0x379a('0x15')](_0x561cbf)[_0x379a('0x17')](_0x55a38d);}};}function respondWithFilteredResult(_0x3626b0,_0x3651b2){return function(_0x59f698){if(_0x59f698){var _0x56bbd5=typeof _0x3651b2[_0x379a('0x18')]==='undefined'&&typeof _0x3651b2[_0x379a('0x19')]===_0x379a('0x1a');var _0x1c217d=_0x59f698['count'];var _0x48f0a9=_0x56bbd5?0x0:_0x3651b2[_0x379a('0x18')];var _0xd6cc17=_0x56bbd5?_0x59f698['count']:_0x3651b2[_0x379a('0x18')]+_0x3651b2[_0x379a('0x19')];var _0x51d67c;if(_0xd6cc17>=_0x1c217d){_0xd6cc17=_0x1c217d;_0x51d67c=0xc8;}else{_0x51d67c=0xce;}_0x3626b0['status'](_0x51d67c);return _0x3626b0['set'](_0x379a('0x1b'),_0x48f0a9+'-'+_0xd6cc17+'/'+_0x1c217d)['json'](_0x59f698);}return null;};}function patchUpdates(_0x263df8){return function(_0x1cdebe){try{jsonpatch[_0x379a('0x1c')](_0x1cdebe,_0x263df8,!![]);}catch(_0x120997){return BPromise[_0x379a('0x1d')](_0x120997);}return _0x1cdebe[_0x379a('0x1e')]();};}function saveUpdates(_0x1d3f0f,_0x1b1b98){return function(_0x4c0dda){if(_0x4c0dda){return _0x4c0dda[_0x379a('0x1f')](_0x1d3f0f)[_0x379a('0x20')](function(_0x28aedc){return _0x28aedc;});}return null;};}function removeEntity(_0x22737a,_0x31752c){return function(_0x2bf6d8){if(_0x2bf6d8){return _0x2bf6d8[_0x379a('0x21')]()['then'](function(){_0x22737a[_0x379a('0x15')](0xcc)[_0x379a('0x16')]();});}};}function handleEntityNotFound(_0x18bb37,_0x516ddf){return function(_0x483ddd){if(!_0x483ddd){_0x18bb37[_0x379a('0x14')](0x194);}return _0x483ddd;};}function handleError(_0x599efb,_0x13e665){_0x13e665=_0x13e665||0x1f4;return function(_0xc1fc5a){logger['error'](_0xc1fc5a[_0x379a('0x22')]);if(_0xc1fc5a[_0x379a('0x23')]){delete _0xc1fc5a[_0x379a('0x23')];}_0x599efb['status'](_0x13e665)[_0x379a('0x24')](_0xc1fc5a);};}exports['index']=function(_0x2a1765,_0x33d5f7){var _0xa803f7={},_0x3f92b1={},_0x4eed7e={'count':0x0,'rows':[]};var _0x1153e9=_[_0x379a('0x25')](db[_0x379a('0x26')][_0x379a('0x27')],function(_0x30c9ab){return{'name':_0x30c9ab['fieldName'],'type':_0x30c9ab[_0x379a('0x28')][_0x379a('0x29')]};});_0x3f92b1[_0x379a('0x2a')]=_[_0x379a('0x25')](_0x1153e9,_0x379a('0x23'));_0x3f92b1['query']=_[_0x379a('0x2b')](_0x2a1765[_0x379a('0x2c')]);_0x3f92b1[_0x379a('0x2d')]=_[_0x379a('0x2e')](_0x3f92b1[_0x379a('0x2a')],_0x3f92b1[_0x379a('0x2c')]);_0xa803f7['attributes']=_['intersection'](_0x3f92b1[_0x379a('0x2a')],qs['fields'](_0x2a1765[_0x379a('0x2c')][_0x379a('0x2f')]));_0xa803f7[_0x379a('0x30')]=_0xa803f7['attributes']['length']?_0xa803f7[_0x379a('0x30')]:_0x3f92b1[_0x379a('0x2a')];if(!_0x2a1765[_0x379a('0x2c')][_0x379a('0x31')]('nolimit')){_0xa803f7[_0x379a('0x19')]=qs[_0x379a('0x19')](_0x2a1765[_0x379a('0x2c')][_0x379a('0x19')]);_0xa803f7['offset']=qs[_0x379a('0x18')](_0x2a1765[_0x379a('0x2c')][_0x379a('0x18')]);}_0xa803f7[_0x379a('0x32')]=qs[_0x379a('0x33')](_0x2a1765[_0x379a('0x2c')][_0x379a('0x33')]);_0xa803f7[_0x379a('0x34')]=qs[_0x379a('0x2d')](_[_0x379a('0x35')](_0x2a1765['query'],_0x3f92b1[_0x379a('0x2d')]),_0x1153e9);if(_0x2a1765[_0x379a('0x2c')][_0x379a('0x36')]){_0xa803f7['where']=_[_0x379a('0x37')](_0xa803f7[_0x379a('0x34')],{'$or':_['map'](_0x1153e9,function(_0x4c031c){if(_0x4c031c['type']!==_0x379a('0x38')){var _0x1fc9dd={};_0x1fc9dd[_0x4c031c[_0x379a('0x23')]]={'$like':'%'+_0x2a1765['query']['filter']+'%'};return _0x1fc9dd;}})});}_0xa803f7=_['merge']({},_0xa803f7,_0x2a1765[_0x379a('0x39')]);var _0x88df47={'where':_0xa803f7[_0x379a('0x34')]};return db[_0x379a('0x26')][_0x379a('0x3a')](_0x88df47)[_0x379a('0x20')](function(_0x140f5e){_0x4eed7e[_0x379a('0x3a')]=_0x140f5e;if(_0x2a1765[_0x379a('0x2c')][_0x379a('0x3b')]){_0xa803f7['include']=[{'all':!![]}];}return db[_0x379a('0x26')][_0x379a('0x3c')](_0xa803f7);})[_0x379a('0x20')](function(_0x476d7b){_0x4eed7e[_0x379a('0x3d')]=_0x476d7b;return _0x4eed7e;})[_0x379a('0x20')](respondWithFilteredResult(_0x33d5f7,_0xa803f7))[_0x379a('0x3e')](handleError(_0x33d5f7,null));};exports[_0x379a('0x3f')]=function(_0x17b5f3,_0x1d3c66){var _0x2d0e3f={'raw':!![],'where':{'id':_0x17b5f3[_0x379a('0x40')]['id']}},_0x5ada4c={};_0x5ada4c[_0x379a('0x2a')]=_['keys'](db[_0x379a('0x26')][_0x379a('0x27')]);_0x5ada4c[_0x379a('0x2c')]=_['keys'](_0x17b5f3[_0x379a('0x2c')]);_0x5ada4c[_0x379a('0x2d')]=_['intersection'](_0x5ada4c[_0x379a('0x2a')],_0x5ada4c[_0x379a('0x2c')]);_0x2d0e3f[_0x379a('0x30')]=_['intersection'](_0x5ada4c[_0x379a('0x2a')],qs[_0x379a('0x2f')](_0x17b5f3[_0x379a('0x2c')]['fields']));_0x2d0e3f['attributes']=_0x2d0e3f[_0x379a('0x30')][_0x379a('0x41')]?_0x2d0e3f[_0x379a('0x30')]:_0x5ada4c[_0x379a('0x2a')];if(_0x17b5f3['query'][_0x379a('0x3b')]){_0x2d0e3f[_0x379a('0x42')]=[{'all':!![]}];}_0x2d0e3f=_['merge']({},_0x2d0e3f,_0x17b5f3['options']);return db[_0x379a('0x26')][_0x379a('0x43')](_0x2d0e3f)['then'](handleEntityNotFound(_0x1d3c66,null))[_0x379a('0x20')](respondWithResult(_0x1d3c66,null))[_0x379a('0x3e')](handleError(_0x1d3c66,null));};exports[_0x379a('0x44')]=function(_0x1d113c,_0x7abb23){return db[_0x379a('0x26')][_0x379a('0x44')](_0x1d113c[_0x379a('0x45')],{})[_0x379a('0x20')](respondWithResult(_0x7abb23,0xc9))[_0x379a('0x3e')](handleError(_0x7abb23,null));};exports['update']=function(_0x1f75e7,_0xb85859){if(_0x1f75e7[_0x379a('0x45')]['id']){delete _0x1f75e7[_0x379a('0x45')]['id'];}return db[_0x379a('0x26')]['find']({'where':{'id':_0x1f75e7[_0x379a('0x40')]['id']}})[_0x379a('0x20')](handleEntityNotFound(_0xb85859,null))[_0x379a('0x20')](saveUpdates(_0x1f75e7[_0x379a('0x45')],null))[_0x379a('0x20')](respondWithResult(_0xb85859,null))['catch'](handleError(_0xb85859,null));};exports[_0x379a('0x21')]=function(_0x41581a,_0x35cefe){return db[_0x379a('0x26')][_0x379a('0x43')]({'where':{'id':_0x41581a[_0x379a('0x40')]['id']}})[_0x379a('0x20')](handleEntityNotFound(_0x35cefe,null))[_0x379a('0x20')](removeEntity(_0x35cefe,null))[_0x379a('0x3e')](handleError(_0x35cefe,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 0e8fc65..ef844a6 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 _0xb08b=['rimraf','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x27a090,_0x34c104){var _0x1fb165=function(_0x52ceca){while(--_0x52ceca){_0x27a090['push'](_0x27a090['shift']());}};_0x1fb165(++_0x34c104);}(_0xb08b,0x19f));var _0xbb08=function(_0x22927e,_0x277191){_0x22927e=_0x22927e-0x0;var _0x38706b=_0xb08b[_0x22927e];return _0x38706b;};'use strict';var _=require(_0xbb08('0x0'));var util=require('util');var logger=require(_0xbb08('0x1'))(_0xbb08('0x2'));var moment=require('moment');var BPromise=require(_0xbb08('0x3'));var rp=require(_0xbb08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb08('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb08('0x6'));module['exports']=function(_0x59d9d6,_0x36e80e){return _0x59d9d6[_0xbb08('0x7')](_0xbb08('0x8'),attributes,{'tableName':_0xbb08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x188b=['moment','request-promise','path','rimraf','./squareMessage.attributes','define','square_messages','api'];(function(_0xa15cf6,_0x289290){var _0x413b4b=function(_0x5b7204){while(--_0x5b7204){_0xa15cf6['push'](_0xa15cf6['shift']());}};_0x413b4b(++_0x289290);}(_0x188b,0x137));var _0xb188=function(_0x3f8aad,_0x450238){_0x3f8aad=_0x3f8aad-0x0;var _0x47ac79=_0x188b[_0x3f8aad];return _0x47ac79;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb188('0x0'));var moment=require(_0xb188('0x1'));var BPromise=require('bluebird');var rp=require(_0xb188('0x2'));var fs=require('fs');var path=require(_0xb188('0x3'));var rimraf=require(_0xb188('0x4'));var config=require('../../config/environment');var attributes=require(_0xb188('0x5'));module['exports']=function(_0x23deae,_0x2fd1bc){return _0x23deae[_0xb188('0x6')]('SquareMessage',attributes,{'tableName':_0xb188('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index ab670aa..888d453 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 _0x7c99=['body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareMessage','SquareMessage'];(function(_0x428f05,_0x5d3721){var _0x44c0a2=function(_0x1f09dd){while(--_0x1f09dd){_0x428f05['push'](_0x428f05['shift']());}};_0x44c0a2(++_0x5d3721);}(_0x7c99,0x78));var _0x97c9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7c99[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x97c9('0x0'));var util=require(_0x97c9('0x1'));var moment=require(_0x97c9('0x2'));var BPromise=require(_0x97c9('0x3'));var rs=require(_0x97c9('0x4'));var fs=require('fs');var Redis=require(_0x97c9('0x5'));var db=require(_0x97c9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x97c9('0x7'))(_0x97c9('0x8'));var config=require('../../config/environment');var jayson=require(_0x97c9('0x9'));var client=jayson['client'][_0x97c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cd928,_0x11794b,_0x22964e){return new BPromise(function(_0x170f35,_0x265af4){return client[_0x97c9('0xb')](_0x2cd928,_0x22964e)[_0x97c9('0xc')](function(_0x5785b6){logger[_0x97c9('0xd')](_0x97c9('0xe'),_0x11794b,'request\x20sent');logger[_0x97c9('0xf')](_0x97c9('0x10'),_0x11794b,_0x97c9('0x11'),JSON['stringify'](_0x5785b6));if(_0x5785b6[_0x97c9('0x12')]){if(_0x5785b6[_0x97c9('0x12')][_0x97c9('0x13')]===0x1f4){logger[_0x97c9('0x12')](_0x97c9('0xe'),_0x11794b,_0x5785b6[_0x97c9('0x12')]['message']);return _0x265af4(_0x5785b6['error'][_0x97c9('0x14')]);}logger[_0x97c9('0x12')](_0x97c9('0xe'),_0x11794b,_0x5785b6[_0x97c9('0x12')][_0x97c9('0x14')]);return _0x170f35(_0x5785b6['error'][_0x97c9('0x14')]);}else{logger['info'](_0x97c9('0xe'),_0x11794b,_0x97c9('0x11'));_0x170f35(_0x5785b6[_0x97c9('0x15')][_0x97c9('0x14')]);}})[_0x97c9('0x16')](function(_0x3fb903){logger['error'](_0x97c9('0xe'),_0x11794b,_0x3fb903);_0x265af4(_0x3fb903);});});}exports[_0x97c9('0x17')]=function(_0x2ea310){var _0x537b86=this;return new Promise(function(_0x359495,_0x4a8183){return db[_0x97c9('0x18')]['create'](_0x2ea310[_0x97c9('0x19')],{'raw':_0x2ea310[_0x97c9('0x1a')]?_0x2ea310[_0x97c9('0x1a')][_0x97c9('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5ec072){logger[_0x97c9('0xd')](_0x97c9('0x17'),_0x2ea310);logger[_0x97c9('0xf')](_0x97c9('0x17'),_0x2ea310,JSON[_0x97c9('0x1c')](_0x5ec072));_0x359495(_0x5ec072);})[_0x97c9('0x16')](function(_0x4016ca){logger[_0x97c9('0x12')](_0x97c9('0x17'),_0x4016ca[_0x97c9('0x14')],_0x2ea310);_0x4a8183(_0x537b86[_0x97c9('0x12')](0x1f4,_0x4016ca[_0x97c9('0x14')]));});});}; \ No newline at end of file +var _0x0b23=['create','body','options','raw','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateSquareMessage','SquareMessage'];(function(_0x2b68c7,_0x5a08fc){var _0x5bb60e=function(_0x181a1e){while(--_0x181a1e){_0x2b68c7['push'](_0x2b68c7['shift']());}};_0x5bb60e(++_0x5a08fc);}(_0x0b23,0xe4));var _0x30b2=function(_0xc98d01,_0x6b7afa){_0xc98d01=_0xc98d01-0x0;var _0x39160d=_0x0b23[_0xc98d01];return _0x39160d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x30b2('0x0'));var BPromise=require(_0x30b2('0x1'));var rs=require(_0x30b2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30b2('0x3'))['db'];var utils=require(_0x30b2('0x4'));var logger=require(_0x30b2('0x5'))(_0x30b2('0x6'));var config=require(_0x30b2('0x7'));var jayson=require(_0x30b2('0x8'));var client=jayson[_0x30b2('0x9')][_0x30b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x534cbe,_0x3e00fa,_0x441954){return new BPromise(function(_0x4b5f7e,_0x3a9c5f){return client['request'](_0x534cbe,_0x441954)[_0x30b2('0xb')](function(_0x48dc91){logger['info'](_0x30b2('0xc'),_0x3e00fa,'request\x20sent');logger[_0x30b2('0xd')](_0x30b2('0xe'),_0x3e00fa,_0x30b2('0xf'),JSON['stringify'](_0x48dc91));if(_0x48dc91[_0x30b2('0x10')]){if(_0x48dc91['error'][_0x30b2('0x11')]===0x1f4){logger[_0x30b2('0x10')](_0x30b2('0xc'),_0x3e00fa,_0x48dc91['error'][_0x30b2('0x12')]);return _0x3a9c5f(_0x48dc91['error'][_0x30b2('0x12')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x3e00fa,_0x48dc91[_0x30b2('0x10')][_0x30b2('0x12')]);return _0x4b5f7e(_0x48dc91['error'][_0x30b2('0x12')]);}else{logger[_0x30b2('0x13')](_0x30b2('0xc'),_0x3e00fa,'request\x20sent');_0x4b5f7e(_0x48dc91[_0x30b2('0x14')][_0x30b2('0x12')]);}})[_0x30b2('0x15')](function(_0x3f2910){logger[_0x30b2('0x10')](_0x30b2('0xc'),_0x3e00fa,_0x3f2910);_0x3a9c5f(_0x3f2910);});});}exports[_0x30b2('0x16')]=function(_0x52f024){var _0x217586=this;return new Promise(function(_0x53648a,_0xc7955){return db[_0x30b2('0x17')][_0x30b2('0x18')](_0x52f024[_0x30b2('0x19')],{'raw':_0x52f024[_0x30b2('0x1a')]?_0x52f024[_0x30b2('0x1a')][_0x30b2('0x1b')]===undefined?!![]:![]:!![]})[_0x30b2('0xb')](function(_0x2a6bda){logger[_0x30b2('0x13')](_0x30b2('0x16'),_0x52f024);logger[_0x30b2('0xd')](_0x30b2('0x16'),_0x52f024,JSON['stringify'](_0x2a6bda));_0x53648a(_0x2a6bda);})['catch'](function(_0x5be822){logger[_0x30b2('0x10')](_0x30b2('0x16'),_0x5be822[_0x30b2('0x12')],_0x52f024);_0xc7955(_0x217586['error'](0x1f4,_0x5be822['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index c77f4f0..365453e 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 _0x39eb=['fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5e5839,_0x33b061){var _0x267507=function(_0x19e8d6){while(--_0x19e8d6){_0x5e5839['push'](_0x5e5839['shift']());}};_0x267507(++_0x33b061);}(_0x39eb,0x118));var _0xb39e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x39eb[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb39e('0x0'));var util=require(_0xb39e('0x1'));var path=require(_0xb39e('0x2'));var timeout=require(_0xb39e('0x3'));var express=require(_0xb39e('0x4'));var router=express[_0xb39e('0x5')]();var fs_extra=require(_0xb39e('0x6'));var auth=require(_0xb39e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb39e('0x8'));var controller=require(_0xb39e('0x9'));router[_0xb39e('0xa')]('/',auth[_0xb39e('0xb')](),controller[_0xb39e('0xc')]);router[_0xb39e('0xa')](_0xb39e('0xd'),auth[_0xb39e('0xb')](),controller['show']);router[_0xb39e('0xa')](_0xb39e('0xe'),auth['isAuthenticated'](),timeout(_0xb39e('0xf')),controller[_0xb39e('0x10')]);router[_0xb39e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb39e('0x12')](_0xb39e('0xd'),auth[_0xb39e('0xb')](),controller['update']);router[_0xb39e('0x13')](_0xb39e('0xd'),auth[_0xb39e('0xb')](),controller[_0xb39e('0x14')]);module[_0xb39e('0x15')]=router; \ No newline at end of file +var _0x4c10=['fs-extra','../../components/auth/service','./squareOdbc.controller','get','isAuthenticated','/:id','show','15s','test','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x55c78f,_0x36ae8b){var _0x51bb34=function(_0xb83284){while(--_0xb83284){_0x55c78f['push'](_0x55c78f['shift']());}};_0x51bb34(++_0x36ae8b);}(_0x4c10,0x176));var _0x04c1=function(_0x104952,_0x6f19c1){_0x104952=_0x104952-0x0;var _0x169ae0=_0x4c10[_0x104952];return _0x169ae0;};'use strict';var multer=require(_0x04c1('0x0'));var util=require(_0x04c1('0x1'));var path=require(_0x04c1('0x2'));var timeout=require(_0x04c1('0x3'));var express=require(_0x04c1('0x4'));var router=express[_0x04c1('0x5')]();var fs_extra=require(_0x04c1('0x6'));var auth=require(_0x04c1('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c1('0x8'));router[_0x04c1('0x9')]('/',auth[_0x04c1('0xa')](),controller['index']);router[_0x04c1('0x9')](_0x04c1('0xb'),auth['isAuthenticated'](),controller[_0x04c1('0xc')]);router[_0x04c1('0x9')]('/:id/test',auth[_0x04c1('0xa')](),timeout(_0x04c1('0xd')),controller[_0x04c1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x04c1('0xb'),auth[_0x04c1('0xa')](),controller[_0x04c1('0xf')]);router[_0x04c1('0x10')](_0x04c1('0xb'),auth['isAuthenticated'](),controller[_0x04c1('0x11')]);module[_0x04c1('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 85675e0..6e359ef 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 _0xa247=['sequelize','STRING','name'];(function(_0x2c2f35,_0x20cda1){var _0x543b7e=function(_0x3d66b9){while(--_0x3d66b9){_0x2c2f35['push'](_0x2c2f35['shift']());}};_0x543b7e(++_0x20cda1);}(_0xa247,0x99));var _0x7a24=function(_0x182ba2,_0x25dc39){_0x182ba2=_0x182ba2-0x0;var _0x1f8aa8=_0xa247[_0x182ba2];return _0x1f8aa8;};'use strict';var Sequelize=require(_0x7a24('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a24('0x1')],'unique':_0x7a24('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7a24('0x1')]},'description':{'type':Sequelize[_0x7a24('0x1')]}}; \ No newline at end of file +var _0x45c0=['name','sequelize','exports','STRING'];(function(_0xd3c95d,_0x1c9987){var _0x5aa181=function(_0x398032){while(--_0x398032){_0xd3c95d['push'](_0xd3c95d['shift']());}};_0x5aa181(++_0x1c9987);}(_0x45c0,0x121));var _0x045c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x45c0[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x045c('0x0'));module[_0x045c('0x1')]={'name':{'type':Sequelize[_0x045c('0x2')],'unique':_0x045c('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x045c('0x2')]},'description':{'type':Sequelize[_0x045c('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 97b8243..8dee9b7 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 _0x759a=['where','pick','VIRTUAL','filter','include','catch','show','params','rawAttributes','includeAll','merge','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','get','ODBC','UserProfileResource','destroy','end','error','name','map','SquareOdbc','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x15eb76,_0x1946fb){var _0x104569=function(_0x43d6a4){while(--_0x43d6a4){_0x15eb76['push'](_0x15eb76['shift']());}};_0x104569(++_0x1946fb);}(_0x759a,0x175));var _0xa759=function(_0x34ef87,_0x4844d1){_0x34ef87=_0x34ef87-0x0;var _0x26b6f9=_0x759a[_0x34ef87];return _0x26b6f9;};'use strict';var emlformat=require(_0xa759('0x0'));var rimraf=require(_0xa759('0x1'));var zipdir=require(_0xa759('0x2'));var jsonpatch=require(_0xa759('0x3'));var rp=require(_0xa759('0x4'));var moment=require(_0xa759('0x5'));var BPromise=require(_0xa759('0x6'));var Mustache=require(_0xa759('0x7'));var util=require(_0xa759('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa759('0x9'));var ejs=require(_0xa759('0xa'));var fs=require('fs');var fs_extra=require(_0xa759('0xb'));var _=require(_0xa759('0xc'));var squel=require(_0xa759('0xd'));var crypto=require('crypto');var jsforce=require(_0xa759('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa759('0x9'));var querystring=require('querystring');var Papa=require(_0xa759('0xf'));var Redis=require(_0xa759('0x10'));var authService=require(_0xa759('0x11'));var qs=require(_0xa759('0x12'));var as=require(_0xa759('0x13'));var hardwareService=require(_0xa759('0x14'));var logger=require(_0xa759('0x15'))('api');var utils=require(_0xa759('0x16'));var config=require(_0xa759('0x17'));var licenseUtil=require(_0xa759('0x18'));var db=require(_0xa759('0x19'))['db'];function respondWithStatusCode(_0x59b877,_0x1ffd8b){_0x1ffd8b=_0x1ffd8b||0xcc;return function(_0x14ab93){if(_0x14ab93){return _0x59b877[_0xa759('0x1a')](_0x1ffd8b);}return _0x59b877[_0xa759('0x1b')](_0x1ffd8b)['end']();};}function respondWithResult(_0x6b5960,_0x23f30f){_0x23f30f=_0x23f30f||0xc8;return function(_0x518755){if(_0x518755){return _0x6b5960['status'](_0x23f30f)[_0xa759('0x1c')](_0x518755);}};}function respondWithFilteredResult(_0x50bfcd,_0x286906){return function(_0xbae2d4){if(_0xbae2d4){var _0x5abe12=typeof _0x286906[_0xa759('0x1d')]===_0xa759('0x1e')&&typeof _0x286906['limit']===_0xa759('0x1e');var _0xff820=_0xbae2d4[_0xa759('0x1f')];var _0x37a9f9=_0x5abe12?0x0:_0x286906[_0xa759('0x1d')];var _0x526d89=_0x5abe12?_0xbae2d4[_0xa759('0x1f')]:_0x286906[_0xa759('0x1d')]+_0x286906['limit'];var _0xc00539;if(_0x526d89>=_0xff820){_0x526d89=_0xff820;_0xc00539=0xc8;}else{_0xc00539=0xce;}_0x50bfcd['status'](_0xc00539);return _0x50bfcd[_0xa759('0x20')](_0xa759('0x21'),_0x37a9f9+'-'+_0x526d89+'/'+_0xff820)[_0xa759('0x1c')](_0xbae2d4);}return null;};}function patchUpdates(_0x7f3cd5){return function(_0x8e60a4){try{jsonpatch['apply'](_0x8e60a4,_0x7f3cd5,!![]);}catch(_0x4e39f6){return BPromise[_0xa759('0x22')](_0x4e39f6);}return _0x8e60a4[_0xa759('0x23')]();};}function saveUpdates(_0x3cecc4,_0x2088bc){return function(_0x1755cc){if(_0x1755cc){return _0x1755cc[_0xa759('0x24')](_0x3cecc4)['then'](function(_0x376e34){return _0x376e34;});}return null;};}function removeEntity(_0x428456,_0x2ac858){return function(_0x53993c){if(_0x53993c){return _0x53993c['destroy']()[_0xa759('0x25')](function(){var _0x5bc876=_0x53993c[_0xa759('0x26')]({'plain':!![]});var _0x47d113=_0xa759('0x27');return db[_0xa759('0x28')][_0xa759('0x29')]({'where':{'type':_0x47d113,'resourceId':_0x5bc876['id']}})[_0xa759('0x25')](function(){return _0x53993c;});})['then'](function(){_0x428456['status'](0xcc)[_0xa759('0x2a')]();});}};}function handleEntityNotFound(_0x5684e4,_0x30e500){return function(_0x1dd332){if(!_0x1dd332){_0x5684e4['sendStatus'](0x194);}return _0x1dd332;};}function handleError(_0x316664,_0x13e93f){_0x13e93f=_0x13e93f||0x1f4;return function(_0x1bc2a4){logger[_0xa759('0x2b')](_0x1bc2a4['stack']);if(_0x1bc2a4[_0xa759('0x2c')]){delete _0x1bc2a4['name'];}_0x316664['status'](_0x13e93f)['send'](_0x1bc2a4);};}exports['index']=function(_0x24e09c,_0x14adf5){var _0x26b682={},_0x39c4ff={},_0x214651={'count':0x0,'rows':[]};var _0x224538=_[_0xa759('0x2d')](db[_0xa759('0x2e')]['rawAttributes'],function(_0x418ca0){return{'name':_0x418ca0['fieldName'],'type':_0x418ca0[_0xa759('0x2f')][_0xa759('0x30')]};});_0x39c4ff[_0xa759('0x31')]=_[_0xa759('0x2d')](_0x224538,_0xa759('0x2c'));_0x39c4ff['query']=_[_0xa759('0x32')](_0x24e09c[_0xa759('0x33')]);_0x39c4ff[_0xa759('0x34')]=_[_0xa759('0x35')](_0x39c4ff[_0xa759('0x31')],_0x39c4ff[_0xa759('0x33')]);_0x26b682['attributes']=_[_0xa759('0x35')](_0x39c4ff['model'],qs[_0xa759('0x36')](_0x24e09c[_0xa759('0x33')][_0xa759('0x36')]));_0x26b682[_0xa759('0x37')]=_0x26b682[_0xa759('0x37')][_0xa759('0x38')]?_0x26b682[_0xa759('0x37')]:_0x39c4ff['model'];if(!_0x24e09c[_0xa759('0x33')][_0xa759('0x39')](_0xa759('0x3a'))){_0x26b682[_0xa759('0x3b')]=qs['limit'](_0x24e09c[_0xa759('0x33')][_0xa759('0x3b')]);_0x26b682[_0xa759('0x1d')]=qs[_0xa759('0x1d')](_0x24e09c[_0xa759('0x33')][_0xa759('0x1d')]);}_0x26b682[_0xa759('0x3c')]=qs[_0xa759('0x3d')](_0x24e09c['query']['sort']);_0x26b682[_0xa759('0x3e')]=qs['filters'](_[_0xa759('0x3f')](_0x24e09c[_0xa759('0x33')],_0x39c4ff[_0xa759('0x34')]),_0x224538);if(_0x24e09c[_0xa759('0x33')]['filter']){_0x26b682[_0xa759('0x3e')]=_['merge'](_0x26b682[_0xa759('0x3e')],{'$or':_[_0xa759('0x2d')](_0x224538,function(_0x10722b){if(_0x10722b[_0xa759('0x2f')]!==_0xa759('0x40')){var _0x5cb534={};_0x5cb534[_0x10722b['name']]={'$like':'%'+_0x24e09c['query'][_0xa759('0x41')]+'%'};return _0x5cb534;}})});}_0x26b682=_['merge']({},_0x26b682,_0x24e09c['options']);var _0xcde5d3={'where':_0x26b682[_0xa759('0x3e')]};return db[_0xa759('0x2e')][_0xa759('0x1f')](_0xcde5d3)[_0xa759('0x25')](function(_0x2e20d2){_0x214651[_0xa759('0x1f')]=_0x2e20d2;if(_0x24e09c['query']['includeAll']){_0x26b682[_0xa759('0x42')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x26b682);})[_0xa759('0x25')](function(_0x357d4e){_0x214651['rows']=_0x357d4e;return _0x214651;})['then'](respondWithFilteredResult(_0x14adf5,_0x26b682))[_0xa759('0x43')](handleError(_0x14adf5,null));};exports[_0xa759('0x44')]=function(_0x3bcf7e,_0x2bb4a8){var _0x41d7e7={'raw':!![],'where':{'id':_0x3bcf7e[_0xa759('0x45')]['id']}},_0x585d60={};_0x585d60['model']=_[_0xa759('0x32')](db['SquareOdbc'][_0xa759('0x46')]);_0x585d60[_0xa759('0x33')]=_['keys'](_0x3bcf7e[_0xa759('0x33')]);_0x585d60[_0xa759('0x34')]=_[_0xa759('0x35')](_0x585d60[_0xa759('0x31')],_0x585d60[_0xa759('0x33')]);_0x41d7e7['attributes']=_['intersection'](_0x585d60[_0xa759('0x31')],qs[_0xa759('0x36')](_0x3bcf7e[_0xa759('0x33')][_0xa759('0x36')]));_0x41d7e7[_0xa759('0x37')]=_0x41d7e7['attributes'][_0xa759('0x38')]?_0x41d7e7[_0xa759('0x37')]:_0x585d60[_0xa759('0x31')];if(_0x3bcf7e['query'][_0xa759('0x47')]){_0x41d7e7['include']=[{'all':!![]}];}_0x41d7e7=_[_0xa759('0x48')]({},_0x41d7e7,_0x3bcf7e[_0xa759('0x49')]);return db[_0xa759('0x2e')]['find'](_0x41d7e7)[_0xa759('0x25')](handleEntityNotFound(_0x2bb4a8,null))[_0xa759('0x25')](respondWithResult(_0x2bb4a8,null))[_0xa759('0x43')](handleError(_0x2bb4a8,null));};exports[_0xa759('0x4a')]=function(_0x19cbac,_0x48471a){return db[_0xa759('0x2e')][_0xa759('0x4a')](_0x19cbac['body'],{})[_0xa759('0x25')](function(_0xa2ee29){var _0x2ec9fe=_0x19cbac[_0xa759('0x4b')][_0xa759('0x26')]({'plain':!![]});if(!_0x2ec9fe)throw new Error(_0xa759('0x4c'));if(_0x2ec9fe[_0xa759('0x4d')]==='user'){var _0x4bf593=_0xa2ee29['get']({'plain':!![]});var _0x114edd=_0xa759('0x27');return db[_0xa759('0x4e')][_0xa759('0x4f')]({'where':{'name':_0x114edd,'userProfileId':_0x2ec9fe[_0xa759('0x50')]},'raw':!![]})[_0xa759('0x25')](function(_0x59b8f1){if(_0x59b8f1&&_0x59b8f1['autoAssociation']===0x0){return db[_0xa759('0x28')][_0xa759('0x4a')]({'name':_0x4bf593[_0xa759('0x2c')],'resourceId':_0x4bf593['id'],'type':_0x59b8f1[_0xa759('0x2c')],'sectionId':_0x59b8f1['id']},{})[_0xa759('0x25')](function(){return _0xa2ee29;});}else{return _0xa2ee29;}})[_0xa759('0x43')](function(_0x2f4269){logger[_0xa759('0x2b')](_0xa759('0x51'),_0x2f4269);throw _0x2f4269;});}return _0xa2ee29;})[_0xa759('0x25')](respondWithResult(_0x48471a,0xc9))[_0xa759('0x43')](handleError(_0x48471a,null));};exports[_0xa759('0x24')]=function(_0x6221f8,_0x1d4aff){if(_0x6221f8[_0xa759('0x52')]['id']){delete _0x6221f8[_0xa759('0x52')]['id'];}return db[_0xa759('0x2e')][_0xa759('0x4f')]({'where':{'id':_0x6221f8['params']['id']}})[_0xa759('0x25')](handleEntityNotFound(_0x1d4aff,null))[_0xa759('0x25')](saveUpdates(_0x6221f8[_0xa759('0x52')],null))[_0xa759('0x25')](respondWithResult(_0x1d4aff,null))['catch'](handleError(_0x1d4aff,null));};exports['destroy']=function(_0x16ba98,_0x58c323){return db[_0xa759('0x2e')][_0xa759('0x4f')]({'where':{'id':_0x16ba98[_0xa759('0x45')]['id']}})[_0xa759('0x25')](handleEntityNotFound(_0x58c323,null))[_0xa759('0x25')](removeEntity(_0x58c323,null))[_0xa759('0x43')](handleError(_0x58c323,null));};exports[_0xa759('0x53')]=function(_0x8488a6,_0x1be4d5,_0x2f135b){var _0x41cc07;return db[_0xa759('0x2e')][_0xa759('0x4f')]({'where':{'id':_0x8488a6[_0xa759('0x45')]['id']},'attributes':['id',_0xa759('0x54')]})[_0xa759('0x25')](handleEntityNotFound(_0x1be4d5,null))['then'](function(_0x5614a5){if(_0x5614a5){var _0x3bebda=require(_0xa759('0x55'))();_0x3bebda[_0xa759('0x56')](_0x5614a5[_0xa759('0x54')]);_0x3bebda['closeSync']();return _0x5614a5;}})[_0xa759('0x25')](respondWithResult(_0x1be4d5,null))[_0xa759('0x43')](handleError(_0x1be4d5,null));}; \ No newline at end of file +var _0x7901=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','create','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','test','dsn','odbc','openSync','closeSync','rimraf','fast-json-patch','moment','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ODBC','UserProfileResource','end','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x7901,0x122));var _0x1790=function(_0x522b99,_0x565913){_0x522b99=_0x522b99-0x0;var _0x3de0ca=_0x7901[_0x522b99];return _0x3de0ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1790('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1790('0x1'));var rp=require('request-promise');var moment=require(_0x1790('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1790('0x3'));var util=require(_0x1790('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1790('0x5'));var fs=require('fs');var fs_extra=require(_0x1790('0x6'));var _=require(_0x1790('0x7'));var squel=require(_0x1790('0x8'));var crypto=require('crypto');var jsforce=require(_0x1790('0x9'));var deskjs=require(_0x1790('0xa'));var toCsv=require(_0x1790('0xb'));var querystring=require('querystring');var Papa=require(_0x1790('0xc'));var Redis=require(_0x1790('0xd'));var authService=require(_0x1790('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1790('0xf'));var logger=require(_0x1790('0x10'))(_0x1790('0x11'));var utils=require(_0x1790('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1790('0x13'));var db=require(_0x1790('0x14'))['db'];function respondWithStatusCode(_0x3b7756,_0x2e0360){_0x2e0360=_0x2e0360||0xcc;return function(_0x125d4f){if(_0x125d4f){return _0x3b7756[_0x1790('0x15')](_0x2e0360);}return _0x3b7756[_0x1790('0x16')](_0x2e0360)['end']();};}function respondWithResult(_0x5b2ad1,_0x4b3da6){_0x4b3da6=_0x4b3da6||0xc8;return function(_0x526cc0){if(_0x526cc0){return _0x5b2ad1['status'](_0x4b3da6)['json'](_0x526cc0);}};}function respondWithFilteredResult(_0x6bbc7,_0x33fd38){return function(_0x3c4457){if(_0x3c4457){var _0x356520=typeof _0x33fd38[_0x1790('0x17')]===_0x1790('0x18')&&typeof _0x33fd38[_0x1790('0x19')]==='undefined';var _0x2b8c82=_0x3c4457[_0x1790('0x1a')];var _0x29588d=_0x356520?0x0:_0x33fd38[_0x1790('0x17')];var _0x1ee48c=_0x356520?_0x3c4457['count']:_0x33fd38[_0x1790('0x17')]+_0x33fd38[_0x1790('0x19')];var _0x5ded0f;if(_0x1ee48c>=_0x2b8c82){_0x1ee48c=_0x2b8c82;_0x5ded0f=0xc8;}else{_0x5ded0f=0xce;}_0x6bbc7['status'](_0x5ded0f);return _0x6bbc7[_0x1790('0x1b')](_0x1790('0x1c'),_0x29588d+'-'+_0x1ee48c+'/'+_0x2b8c82)['json'](_0x3c4457);}return null;};}function patchUpdates(_0x175c01){return function(_0x505d7f){try{jsonpatch['apply'](_0x505d7f,_0x175c01,!![]);}catch(_0xe35ce6){return BPromise[_0x1790('0x1d')](_0xe35ce6);}return _0x505d7f[_0x1790('0x1e')]();};}function saveUpdates(_0x371651,_0x141fa7){return function(_0x5ca9ed){if(_0x5ca9ed){return _0x5ca9ed[_0x1790('0x1f')](_0x371651)[_0x1790('0x20')](function(_0x34b93c){return _0x34b93c;});}return null;};}function removeEntity(_0xf3805b,_0x2b0769){return function(_0x3e830d){if(_0x3e830d){return _0x3e830d[_0x1790('0x21')]()['then'](function(){var _0x39cd73=_0x3e830d[_0x1790('0x22')]({'plain':!![]});var _0x42ac97=_0x1790('0x23');return db[_0x1790('0x24')]['destroy']({'where':{'type':_0x42ac97,'resourceId':_0x39cd73['id']}})[_0x1790('0x20')](function(){return _0x3e830d;});})[_0x1790('0x20')](function(){_0xf3805b['status'](0xcc)[_0x1790('0x25')]();});}};}function handleEntityNotFound(_0x4841c7,_0x4cd2ba){return function(_0x5ed333){if(!_0x5ed333){_0x4841c7[_0x1790('0x15')](0x194);}return _0x5ed333;};}function handleError(_0x3d126a,_0xf9ee20){_0xf9ee20=_0xf9ee20||0x1f4;return function(_0x14799a){logger['error'](_0x14799a[_0x1790('0x26')]);if(_0x14799a['name']){delete _0x14799a[_0x1790('0x27')];}_0x3d126a['status'](_0xf9ee20)[_0x1790('0x28')](_0x14799a);};}exports[_0x1790('0x29')]=function(_0x3f5aff,_0x586508){var _0x14af96={},_0x531b5d={},_0x1a59bb={'count':0x0,'rows':[]};var _0x186412=_[_0x1790('0x2a')](db[_0x1790('0x2b')][_0x1790('0x2c')],function(_0x376999){return{'name':_0x376999[_0x1790('0x2d')],'type':_0x376999[_0x1790('0x2e')][_0x1790('0x2f')]};});_0x531b5d[_0x1790('0x30')]=_[_0x1790('0x2a')](_0x186412,_0x1790('0x27'));_0x531b5d[_0x1790('0x31')]=_[_0x1790('0x32')](_0x3f5aff[_0x1790('0x31')]);_0x531b5d[_0x1790('0x33')]=_[_0x1790('0x34')](_0x531b5d[_0x1790('0x30')],_0x531b5d[_0x1790('0x31')]);_0x14af96[_0x1790('0x35')]=_[_0x1790('0x34')](_0x531b5d['model'],qs[_0x1790('0x36')](_0x3f5aff[_0x1790('0x31')][_0x1790('0x36')]));_0x14af96[_0x1790('0x35')]=_0x14af96[_0x1790('0x35')][_0x1790('0x37')]?_0x14af96['attributes']:_0x531b5d['model'];if(!_0x3f5aff[_0x1790('0x31')][_0x1790('0x38')](_0x1790('0x39'))){_0x14af96[_0x1790('0x19')]=qs[_0x1790('0x19')](_0x3f5aff[_0x1790('0x31')]['limit']);_0x14af96[_0x1790('0x17')]=qs[_0x1790('0x17')](_0x3f5aff[_0x1790('0x31')]['offset']);}_0x14af96['order']=qs[_0x1790('0x3a')](_0x3f5aff[_0x1790('0x31')][_0x1790('0x3a')]);_0x14af96[_0x1790('0x3b')]=qs[_0x1790('0x33')](_[_0x1790('0x3c')](_0x3f5aff['query'],_0x531b5d[_0x1790('0x33')]),_0x186412);if(_0x3f5aff[_0x1790('0x31')][_0x1790('0x3d')]){_0x14af96['where']=_[_0x1790('0x3e')](_0x14af96[_0x1790('0x3b')],{'$or':_['map'](_0x186412,function(_0x43a583){if(_0x43a583[_0x1790('0x2e')]!=='VIRTUAL'){var _0xd9cf55={};_0xd9cf55[_0x43a583[_0x1790('0x27')]]={'$like':'%'+_0x3f5aff[_0x1790('0x31')][_0x1790('0x3d')]+'%'};return _0xd9cf55;}})});}_0x14af96=_[_0x1790('0x3e')]({},_0x14af96,_0x3f5aff[_0x1790('0x3f')]);var _0xbaf335={'where':_0x14af96[_0x1790('0x3b')]};return db[_0x1790('0x2b')][_0x1790('0x1a')](_0xbaf335)[_0x1790('0x20')](function(_0x38506a){_0x1a59bb['count']=_0x38506a;if(_0x3f5aff[_0x1790('0x31')]['includeAll']){_0x14af96[_0x1790('0x40')]=[{'all':!![]}];}return db['SquareOdbc'][_0x1790('0x41')](_0x14af96);})['then'](function(_0x5aede9){_0x1a59bb[_0x1790('0x42')]=_0x5aede9;return _0x1a59bb;})['then'](respondWithFilteredResult(_0x586508,_0x14af96))[_0x1790('0x43')](handleError(_0x586508,null));};exports[_0x1790('0x44')]=function(_0x3e8fbb,_0x28013f){var _0x222f2c={'raw':!![],'where':{'id':_0x3e8fbb[_0x1790('0x45')]['id']}},_0x540058={};_0x540058['model']=_[_0x1790('0x32')](db['SquareOdbc'][_0x1790('0x2c')]);_0x540058[_0x1790('0x31')]=_['keys'](_0x3e8fbb['query']);_0x540058['filters']=_[_0x1790('0x34')](_0x540058[_0x1790('0x30')],_0x540058[_0x1790('0x31')]);_0x222f2c['attributes']=_[_0x1790('0x34')](_0x540058[_0x1790('0x30')],qs[_0x1790('0x36')](_0x3e8fbb[_0x1790('0x31')][_0x1790('0x36')]));_0x222f2c[_0x1790('0x35')]=_0x222f2c['attributes'][_0x1790('0x37')]?_0x222f2c[_0x1790('0x35')]:_0x540058[_0x1790('0x30')];if(_0x3e8fbb[_0x1790('0x31')][_0x1790('0x46')]){_0x222f2c[_0x1790('0x40')]=[{'all':!![]}];}_0x222f2c=_[_0x1790('0x3e')]({},_0x222f2c,_0x3e8fbb[_0x1790('0x3f')]);return db['SquareOdbc']['find'](_0x222f2c)['then'](handleEntityNotFound(_0x28013f,null))[_0x1790('0x20')](respondWithResult(_0x28013f,null))[_0x1790('0x43')](handleError(_0x28013f,null));};exports[_0x1790('0x47')]=function(_0x3448f,_0x27e09){return db[_0x1790('0x2b')][_0x1790('0x47')](_0x3448f['body'],{})[_0x1790('0x20')](function(_0x44bb5b){var _0x535911=_0x3448f[_0x1790('0x48')]['get']({'plain':!![]});if(!_0x535911)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x535911[_0x1790('0x49')]===_0x1790('0x48')){var _0x7615bf=_0x44bb5b[_0x1790('0x22')]({'plain':!![]});var _0x1b4bbb='ODBC';return db['UserProfileSection']['find']({'where':{'name':_0x1b4bbb,'userProfileId':_0x535911[_0x1790('0x4a')]},'raw':!![]})['then'](function(_0xad71f){if(_0xad71f&&_0xad71f[_0x1790('0x4b')]===0x0){return db[_0x1790('0x24')][_0x1790('0x47')]({'name':_0x7615bf['name'],'resourceId':_0x7615bf['id'],'type':_0xad71f['name'],'sectionId':_0xad71f['id']},{})[_0x1790('0x20')](function(){return _0x44bb5b;});}else{return _0x44bb5b;}})[_0x1790('0x43')](function(_0x5b1192){logger[_0x1790('0x4c')](_0x1790('0x4d'),_0x5b1192);throw _0x5b1192;});}return _0x44bb5b;})[_0x1790('0x20')](respondWithResult(_0x27e09,0xc9))[_0x1790('0x43')](handleError(_0x27e09,null));};exports['update']=function(_0x591ffa,_0x2f7e7a){if(_0x591ffa['body']['id']){delete _0x591ffa[_0x1790('0x4e')]['id'];}return db[_0x1790('0x2b')][_0x1790('0x4f')]({'where':{'id':_0x591ffa[_0x1790('0x45')]['id']}})[_0x1790('0x20')](handleEntityNotFound(_0x2f7e7a,null))['then'](saveUpdates(_0x591ffa[_0x1790('0x4e')],null))[_0x1790('0x20')](respondWithResult(_0x2f7e7a,null))[_0x1790('0x43')](handleError(_0x2f7e7a,null));};exports[_0x1790('0x21')]=function(_0x43a88c,_0x4ed286){return db[_0x1790('0x2b')][_0x1790('0x4f')]({'where':{'id':_0x43a88c['params']['id']}})[_0x1790('0x20')](handleEntityNotFound(_0x4ed286,null))[_0x1790('0x20')](removeEntity(_0x4ed286,null))[_0x1790('0x43')](handleError(_0x4ed286,null));};exports[_0x1790('0x50')]=function(_0x580af7,_0x50e512,_0xdf183c){var _0x1eb011;return db['SquareOdbc'][_0x1790('0x4f')]({'where':{'id':_0x580af7[_0x1790('0x45')]['id']},'attributes':['id',_0x1790('0x51')]})[_0x1790('0x20')](handleEntityNotFound(_0x50e512,null))[_0x1790('0x20')](function(_0x3b0bf9){if(_0x3b0bf9){var _0x155bac=require(_0x1790('0x52'))();_0x155bac[_0x1790('0x53')](_0x3b0bf9[_0x1790('0x51')]);_0x155bac[_0x1790('0x54')]();return _0x3b0bf9;}})[_0x1790('0x20')](respondWithResult(_0x50e512,null))[_0x1790('0x43')](handleError(_0x50e512,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index d9a4042..b774440 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 _0x2178=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc'];(function(_0x10b84d,_0x398623){var _0x209149=function(_0x9f1a02){while(--_0x9f1a02){_0x10b84d['push'](_0x10b84d['shift']());}};_0x209149(++_0x398623);}(_0x2178,0x1b0));var _0x8217=function(_0x417aa6,_0x401f42){_0x417aa6=_0x417aa6-0x0;var _0x46e3bc=_0x2178[_0x417aa6];return _0x46e3bc;};'use strict';var _=require(_0x8217('0x0'));var util=require('util');var logger=require(_0x8217('0x1'))(_0x8217('0x2'));var moment=require(_0x8217('0x3'));var BPromise=require('bluebird');var rp=require(_0x8217('0x4'));var fs=require('fs');var path=require(_0x8217('0x5'));var rimraf=require('rimraf');var config=require(_0x8217('0x6'));var attributes=require(_0x8217('0x7'));module[_0x8217('0x8')]=function(_0x16da6e,_0x18f4bd){return _0x16da6e[_0x8217('0x9')](_0x8217('0xa'),attributes,{'tableName':_0x8217('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67df=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x28a3d4,_0x1a88cc){var _0x42859a=function(_0xeaa223){while(--_0xeaa223){_0x28a3d4['push'](_0x28a3d4['shift']());}};_0x42859a(++_0x1a88cc);}(_0x67df,0x1ce));var _0xf67d=function(_0x5bc84f,_0x405edd){_0x5bc84f=_0x5bc84f-0x0;var _0x28e709=_0x67df[_0x5bc84f];return _0x28e709;};'use strict';var _=require(_0xf67d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf67d('0x1'));var moment=require(_0xf67d('0x2'));var BPromise=require(_0xf67d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf67d('0x4'));var rimraf=require(_0xf67d('0x5'));var config=require(_0xf67d('0x6'));var attributes=require(_0xf67d('0x7'));module[_0xf67d('0x8')]=function(_0x2d3deb,_0x21e049){return _0x2d3deb[_0xf67d('0x9')](_0xf67d('0xa'),attributes,{'tableName':'square_odbc','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 feb5ce8..24bd60f 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 _0x4e31=['ShowSquareOdbc','find','options','where','attributes','map','include','model','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c0519,_0x53e39e){var _0x4f7a88=function(_0x13ddf7){while(--_0x13ddf7){_0x1c0519['push'](_0x1c0519['shift']());}};_0x4f7a88(++_0x53e39e);}(_0x4e31,0x10e));var _0x14e3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4e31[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x14e3('0x0'));var BPromise=require(_0x14e3('0x1'));var rs=require(_0x14e3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e3('0x3'))['db'];var utils=require(_0x14e3('0x4'));var logger=require(_0x14e3('0x5'))(_0x14e3('0x6'));var config=require(_0x14e3('0x7'));var jayson=require(_0x14e3('0x8'));var client=jayson['client'][_0x14e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e99c4,_0x588aa2,_0x555586){return new BPromise(function(_0x3baca9,_0x585f05){return client[_0x14e3('0xa')](_0x3e99c4,_0x555586)['then'](function(_0x5b9792){logger[_0x14e3('0xb')](_0x14e3('0xc'),_0x588aa2,_0x14e3('0xd'));logger[_0x14e3('0xe')](_0x14e3('0xf'),_0x588aa2,_0x14e3('0xd'),JSON[_0x14e3('0x10')](_0x5b9792));if(_0x5b9792[_0x14e3('0x11')]){if(_0x5b9792[_0x14e3('0x11')][_0x14e3('0x12')]===0x1f4){logger['error'](_0x14e3('0xc'),_0x588aa2,_0x5b9792[_0x14e3('0x11')][_0x14e3('0x13')]);return _0x585f05(_0x5b9792[_0x14e3('0x11')][_0x14e3('0x13')]);}logger[_0x14e3('0x11')](_0x14e3('0xc'),_0x588aa2,_0x5b9792[_0x14e3('0x11')][_0x14e3('0x13')]);return _0x3baca9(_0x5b9792[_0x14e3('0x11')]['message']);}else{logger['info'](_0x14e3('0xc'),_0x588aa2,_0x14e3('0xd'));_0x3baca9(_0x5b9792['result'][_0x14e3('0x13')]);}})['catch'](function(_0x4570a4){logger[_0x14e3('0x11')](_0x14e3('0xc'),_0x588aa2,_0x4570a4);_0x585f05(_0x4570a4);});});}exports[_0x14e3('0x14')]=function(_0x1432c1){var _0x3fcf92=this;return new Promise(function(_0x2d8f29,_0x55333a){return db['SquareOdbc'][_0x14e3('0x15')]({'raw':_0x1432c1[_0x14e3('0x16')]?_0x1432c1[_0x14e3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1432c1[_0x14e3('0x16')]?_0x1432c1['options'][_0x14e3('0x17')]||null:null,'attributes':_0x1432c1[_0x14e3('0x16')]?_0x1432c1[_0x14e3('0x16')][_0x14e3('0x18')]||null:null,'include':_0x1432c1[_0x14e3('0x16')]?_0x1432c1[_0x14e3('0x16')]['include']?_[_0x14e3('0x19')](_0x1432c1[_0x14e3('0x16')][_0x14e3('0x1a')],function(_0x4588b0){return{'model':db[_0x4588b0[_0x14e3('0x1b')]],'as':_0x4588b0['as'],'attributes':_0x4588b0[_0x14e3('0x18')],'include':_0x4588b0[_0x14e3('0x1a')]?_[_0x14e3('0x19')](_0x4588b0[_0x14e3('0x1a')],function(_0x1fcfea){return{'model':db[_0x1fcfea[_0x14e3('0x1b')]],'as':_0x1fcfea['as'],'attributes':_0x1fcfea[_0x14e3('0x18')],'include':_0x1fcfea[_0x14e3('0x1a')]?_[_0x14e3('0x19')](_0x1fcfea[_0x14e3('0x1a')],function(_0x8eb7c3){return{'model':db[_0x8eb7c3[_0x14e3('0x1b')]],'as':_0x8eb7c3['as'],'attributes':_0x8eb7c3[_0x14e3('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x532baf){logger[_0x14e3('0xb')](_0x14e3('0x14'),_0x1432c1);logger[_0x14e3('0xe')](_0x14e3('0x14'),_0x1432c1,JSON[_0x14e3('0x10')](_0x532baf));_0x2d8f29(_0x532baf);})[_0x14e3('0x1c')](function(_0xf84e07){logger[_0x14e3('0x11')](_0x14e3('0x14'),_0xf84e07[_0x14e3('0x13')],_0x1432c1);_0x55333a(_0x3fcf92['error'](0x1f4,_0xf84e07[_0x14e3('0x13')]));});});}; \ No newline at end of file +var _0x879b=['attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model'];(function(_0x2bb35f,_0x5ce094){var _0x18cc84=function(_0x25619d){while(--_0x25619d){_0x2bb35f['push'](_0x2bb35f['shift']());}};_0x18cc84(++_0x5ce094);}(_0x879b,0x1f0));var _0xb879=function(_0x14a1b4,_0x2c72b0){_0x14a1b4=_0x14a1b4-0x0;var _0x3cb209=_0x879b[_0x14a1b4];return _0x3cb209;};'use strict';var _=require(_0xb879('0x0'));var util=require('util');var moment=require(_0xb879('0x1'));var BPromise=require(_0xb879('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb879('0x3'));var db=require(_0xb879('0x4'))['db'];var utils=require(_0xb879('0x5'));var logger=require(_0xb879('0x6'))(_0xb879('0x7'));var config=require(_0xb879('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb879('0x9')][_0xb879('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c8087,_0x2a81dd,_0x2dac3e){return new BPromise(function(_0x648672,_0x42f735){return client[_0xb879('0xb')](_0x2c8087,_0x2dac3e)[_0xb879('0xc')](function(_0x368f4d){logger[_0xb879('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x2a81dd,_0xb879('0xe'));logger[_0xb879('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x2a81dd,_0xb879('0xe'),JSON[_0xb879('0x10')](_0x368f4d));if(_0x368f4d['error']){if(_0x368f4d[_0xb879('0x11')][_0xb879('0x12')]===0x1f4){logger[_0xb879('0x11')](_0xb879('0x13'),_0x2a81dd,_0x368f4d['error']['message']);return _0x42f735(_0x368f4d['error'][_0xb879('0x14')]);}logger[_0xb879('0x11')](_0xb879('0x13'),_0x2a81dd,_0x368f4d[_0xb879('0x11')][_0xb879('0x14')]);return _0x648672(_0x368f4d[_0xb879('0x11')][_0xb879('0x14')]);}else{logger['info'](_0xb879('0x13'),_0x2a81dd,_0xb879('0xe'));_0x648672(_0x368f4d[_0xb879('0x15')][_0xb879('0x14')]);}})[_0xb879('0x16')](function(_0x428bf4){logger[_0xb879('0x11')](_0xb879('0x13'),_0x2a81dd,_0x428bf4);_0x42f735(_0x428bf4);});});}exports[_0xb879('0x17')]=function(_0xd0bec0){var _0x2eb188=this;return new Promise(function(_0x9162d0,_0x13e8d7){return db[_0xb879('0x18')][_0xb879('0x19')]({'raw':_0xd0bec0[_0xb879('0x1a')]?_0xd0bec0[_0xb879('0x1a')][_0xb879('0x1b')]===undefined?!![]:![]:!![],'where':_0xd0bec0[_0xb879('0x1a')]?_0xd0bec0[_0xb879('0x1a')][_0xb879('0x1c')]||null:null,'attributes':_0xd0bec0[_0xb879('0x1a')]?_0xd0bec0[_0xb879('0x1a')]['attributes']||null:null,'include':_0xd0bec0['options']?_0xd0bec0['options'][_0xb879('0x1d')]?_[_0xb879('0x1e')](_0xd0bec0[_0xb879('0x1a')][_0xb879('0x1d')],function(_0xbc0ecd){return{'model':db[_0xbc0ecd[_0xb879('0x1f')]],'as':_0xbc0ecd['as'],'attributes':_0xbc0ecd[_0xb879('0x20')],'include':_0xbc0ecd[_0xb879('0x1d')]?_[_0xb879('0x1e')](_0xbc0ecd[_0xb879('0x1d')],function(_0x2241af){return{'model':db[_0x2241af[_0xb879('0x1f')]],'as':_0x2241af['as'],'attributes':_0x2241af[_0xb879('0x20')],'include':_0x2241af[_0xb879('0x1d')]?_['map'](_0x2241af[_0xb879('0x1d')],function(_0x30e183){return{'model':db[_0x30e183['model']],'as':_0x30e183['as'],'attributes':_0x30e183[_0xb879('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb879('0xc')](function(_0xef3b80){logger[_0xb879('0xd')](_0xb879('0x17'),_0xd0bec0);logger[_0xb879('0xf')]('ShowSquareOdbc',_0xd0bec0,JSON[_0xb879('0x10')](_0xef3b80));_0x9162d0(_0xef3b80);})[_0xb879('0x16')](function(_0x278ca9){logger[_0xb879('0x11')](_0xb879('0x17'),_0x278ca9[_0xb879('0x14')],_0xd0bec0);_0x13e8d7(_0x2eb188[_0xb879('0x11')](0x1f4,_0x278ca9[_0xb879('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index e3409a9..b642f49 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 _0x4fad=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','/:id/users','getUsers','post','addUsers','update','destroy','delete','exports','multer','util','path','express'];(function(_0x1b862a,_0x3e03af){var _0x1725fb=function(_0x599ab6){while(--_0x599ab6){_0x1b862a['push'](_0x1b862a['shift']());}};_0x1725fb(++_0x3e03af);}(_0x4fad,0xcb));var _0xd4fa=function(_0x225ea0,_0x5d612e){_0x225ea0=_0x225ea0-0x0;var _0x315901=_0x4fad[_0x225ea0];return _0x315901;};'use strict';var multer=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var path=require(_0xd4fa('0x2'));var timeout=require('connect-timeout');var express=require(_0xd4fa('0x3'));var router=express[_0xd4fa('0x4')]();var fs_extra=require(_0xd4fa('0x5'));var auth=require(_0xd4fa('0x6'));var interaction=require(_0xd4fa('0x7'));var config=require(_0xd4fa('0x8'));var controller=require(_0xd4fa('0x9'));router[_0xd4fa('0xa')]('/',auth['isAuthenticated'](),controller[_0xd4fa('0xb')]);router['get'](_0xd4fa('0xc'),auth[_0xd4fa('0xd')](),controller[_0xd4fa('0xe')]);router[_0xd4fa('0xa')](_0xd4fa('0xf'),auth['isAuthenticated'](),controller[_0xd4fa('0x10')]);router[_0xd4fa('0x11')]('/',auth[_0xd4fa('0xd')](),controller['create']);router[_0xd4fa('0x11')](_0xd4fa('0xf'),auth[_0xd4fa('0xd')](),controller[_0xd4fa('0x12')]);router['put'](_0xd4fa('0xc'),auth[_0xd4fa('0xd')](),controller[_0xd4fa('0x13')]);router['delete'](_0xd4fa('0xc'),auth[_0xd4fa('0xd')](),controller[_0xd4fa('0x14')]);router[_0xd4fa('0x15')](_0xd4fa('0xf'),auth[_0xd4fa('0xd')](),controller['removeUsers']);module[_0xd4fa('0x16')]=router; \ No newline at end of file +var _0x7497=['path','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','create','post','addUsers','put','delete','removeUsers','exports','multer','util'];(function(_0x545312,_0x563053){var _0x52bc56=function(_0x14a75d){while(--_0x14a75d){_0x545312['push'](_0x545312['shift']());}};_0x52bc56(++_0x563053);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var path=require(_0x7749('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7749('0x3'));var auth=require(_0x7749('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7749('0x5'));var controller=require(_0x7749('0x6'));router[_0x7749('0x7')]('/',auth[_0x7749('0x8')](),controller[_0x7749('0x9')]);router[_0x7749('0x7')](_0x7749('0xa'),auth[_0x7749('0x8')](),controller[_0x7749('0xb')]);router[_0x7749('0x7')](_0x7749('0xc'),auth['isAuthenticated'](),controller[_0x7749('0xd')]);router['post']('/',auth[_0x7749('0x8')](),controller[_0x7749('0xe')]);router[_0x7749('0xf')](_0x7749('0xc'),auth[_0x7749('0x8')](),controller[_0x7749('0x10')]);router[_0x7749('0x11')](_0x7749('0xa'),auth[_0x7749('0x8')](),controller['update']);router['delete'](_0x7749('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x7749('0x12')](_0x7749('0xc'),auth[_0x7749('0x8')](),controller[_0x7749('0x13')]);module[_0x7749('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 cbf020d..0fd6999 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 _0x0a2e=['toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a2e,0xe1));var _0xe0a2=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x0a2e[_0x15d18f];return _0xd12bf7;};'use strict';var Sequelize=require(_0xe0a2('0x0'));module[_0xe0a2('0x1')]={'name':{'type':Sequelize[_0xe0a2('0x2')],'unique':_0xe0a2('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xe0a2('0x4')]},'preproduction':{'type':Sequelize[_0xe0a2('0x5')](_0xe0a2('0x6')),'get':function(){if(this[_0xe0a2('0x7')]('preproduction')){return this['getDataValue'](_0xe0a2('0x8'))[_0xe0a2('0x9')](_0xe0a2('0xa'));}}},'production':{'type':Sequelize[_0xe0a2('0x5')](_0xe0a2('0x6')),'get':function(){if(this[_0xe0a2('0x7')](_0xe0a2('0xb'))){return this[_0xe0a2('0x7')](_0xe0a2('0xb'))[_0xe0a2('0x9')](_0xe0a2('0xa'));}}},'savedAt':{'type':Sequelize[_0xe0a2('0xc')]},'publishedAt':{'type':Sequelize[_0xe0a2('0xc')]}}; \ No newline at end of file +var _0xdd1b=['long','getDataValue','preproduction','toString','production','utf8','DATE','exports','STRING','BLOB'];(function(_0x22c06f,_0x2dad34){var _0x210b2d=function(_0x175a98){while(--_0x175a98){_0x22c06f['push'](_0x22c06f['shift']());}};_0x210b2d(++_0x2dad34);}(_0xdd1b,0x1e7));var _0xbdd1=function(_0x2f8a22,_0x143d0e){_0x2f8a22=_0x2f8a22-0x0;var _0x7d7ae5=_0xdd1b[_0x2f8a22];return _0x7d7ae5;};'use strict';var Sequelize=require('sequelize');module[_0xbdd1('0x0')]={'name':{'type':Sequelize[_0xbdd1('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xbdd1('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xbdd1('0x2')](_0xbdd1('0x3')),'get':function(){if(this[_0xbdd1('0x4')](_0xbdd1('0x5'))){return this[_0xbdd1('0x4')](_0xbdd1('0x5'))[_0xbdd1('0x6')]('utf8');}}},'production':{'type':Sequelize[_0xbdd1('0x2')]('long'),'get':function(){if(this['getDataValue'](_0xbdd1('0x7'))){return this['getDataValue']('production')[_0xbdd1('0x6')](_0xbdd1('0x8'));}}},'savedAt':{'type':Sequelize[_0xbdd1('0x9')]},'publishedAt':{'type':Sequelize[_0xbdd1('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 1778941..2cda9a8 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 _0x5e6b=['key','keys','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','SquareProject','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','get','sendStatus','error','stack','name','send','index','map','fieldName'];(function(_0x512661,_0x4b4012){var _0x1debde=function(_0x1ed401){while(--_0x1ed401){_0x512661['push'](_0x512661['shift']());}};_0x1debde(++_0x4b4012);}(_0x5e6b,0x103));var _0xb5e6=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x5e6b[_0xfbdff6];return _0x4cb9be;};'use strict';var emlformat=require(_0xb5e6('0x0'));var rimraf=require(_0xb5e6('0x1'));var zipdir=require(_0xb5e6('0x2'));var jsonpatch=require(_0xb5e6('0x3'));var rp=require('request-promise');var moment=require(_0xb5e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb5e6('0x5'));var util=require(_0xb5e6('0x6'));var path=require(_0xb5e6('0x7'));var sox=require(_0xb5e6('0x8'));var csv=require(_0xb5e6('0x9'));var ejs=require(_0xb5e6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5e6('0xb'));var squel=require(_0xb5e6('0xc'));var crypto=require(_0xb5e6('0xd'));var jsforce=require(_0xb5e6('0xe'));var deskjs=require(_0xb5e6('0xf'));var toCsv=require(_0xb5e6('0x9'));var querystring=require('querystring');var Papa=require(_0xb5e6('0x10'));var Redis=require(_0xb5e6('0x11'));var authService=require(_0xb5e6('0x12'));var qs=require(_0xb5e6('0x13'));var as=require(_0xb5e6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5e6('0x15'))(_0xb5e6('0x16'));var utils=require(_0xb5e6('0x17'));var config=require(_0xb5e6('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xb5e6('0x19')](config[_0xb5e6('0x1a')],{'host':_0xb5e6('0x1b'),'port':0x18eb});var socket=require(_0xb5e6('0x1c'))(new Redis(config[_0xb5e6('0x1a')]));require(_0xb5e6('0x1d'))[_0xb5e6('0x1e')](socket);function respondWithStatusCode(_0x4eb96d,_0x36ffcc){_0x36ffcc=_0x36ffcc||0xcc;return function(_0x276f90){if(_0x276f90){return _0x4eb96d['sendStatus'](_0x36ffcc);}return _0x4eb96d[_0xb5e6('0x1f')](_0x36ffcc)[_0xb5e6('0x20')]();};}function respondWithResult(_0x52fe61,_0x5ac629){_0x5ac629=_0x5ac629||0xc8;return function(_0x53046f){if(_0x53046f){return _0x52fe61[_0xb5e6('0x1f')](_0x5ac629)[_0xb5e6('0x21')](_0x53046f);}};}function respondWithFilteredResult(_0x29abf6,_0x56819c){return function(_0x228626){if(_0x228626){var _0x1a1663=typeof _0x56819c[_0xb5e6('0x22')]==='undefined'&&typeof _0x56819c[_0xb5e6('0x23')]===_0xb5e6('0x24');var _0x44040a=_0x228626['count'];var _0x408c1d=_0x1a1663?0x0:_0x56819c[_0xb5e6('0x22')];var _0x4787f5=_0x1a1663?_0x228626['count']:_0x56819c['offset']+_0x56819c[_0xb5e6('0x23')];var _0x2adf28;if(_0x4787f5>=_0x44040a){_0x4787f5=_0x44040a;_0x2adf28=0xc8;}else{_0x2adf28=0xce;}_0x29abf6[_0xb5e6('0x1f')](_0x2adf28);return _0x29abf6[_0xb5e6('0x25')](_0xb5e6('0x26'),_0x408c1d+'-'+_0x4787f5+'/'+_0x44040a)[_0xb5e6('0x21')](_0x228626);}return null;};}function patchUpdates(_0x4898fb){return function(_0x335e7d){try{jsonpatch[_0xb5e6('0x27')](_0x335e7d,_0x4898fb,!![]);}catch(_0x18d38e){return BPromise[_0xb5e6('0x28')](_0x18d38e);}return _0x335e7d[_0xb5e6('0x29')]();};}function saveUpdates(_0xaac489,_0x47e908){return function(_0x53cf0f){if(_0x53cf0f){return _0x53cf0f[_0xb5e6('0x2a')](_0xaac489)[_0xb5e6('0x2b')](function(_0x76f916){return _0x76f916;});}return null;};}function removeEntity(_0x36d4a2,_0x30fcd7){return function(_0x204bcf){if(_0x204bcf){return _0x204bcf['destroy']()[_0xb5e6('0x2b')](function(){var _0x4bc715=_0x204bcf[_0xb5e6('0x2c')]({'plain':!![]});var _0xf9d68f='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0xf9d68f,'resourceId':_0x4bc715['id']}})[_0xb5e6('0x2b')](function(){return _0x204bcf;});})[_0xb5e6('0x2b')](function(){_0x36d4a2[_0xb5e6('0x1f')](0xcc)[_0xb5e6('0x20')]();});}};}function handleEntityNotFound(_0xd6eaab,_0x2af3a2){return function(_0x117265){if(!_0x117265){_0xd6eaab[_0xb5e6('0x2d')](0x194);}return _0x117265;};}function handleError(_0x3b3737,_0x451f42){_0x451f42=_0x451f42||0x1f4;return function(_0x319a21){logger[_0xb5e6('0x2e')](_0x319a21[_0xb5e6('0x2f')]);if(_0x319a21[_0xb5e6('0x30')]){delete _0x319a21['name'];}_0x3b3737[_0xb5e6('0x1f')](_0x451f42)[_0xb5e6('0x31')](_0x319a21);};}exports[_0xb5e6('0x32')]=function(_0x271da9,_0x5f30ec){var _0x27a53d={},_0x28180e={},_0x41c8f6={'count':0x0,'rows':[]};var _0x5dd6b6=_[_0xb5e6('0x33')](db['SquareProject']['rawAttributes'],function(_0xdf1d3a){return{'name':_0xdf1d3a[_0xb5e6('0x34')],'type':_0xdf1d3a['type'][_0xb5e6('0x35')]};});_0x28180e['model']=_['map'](_0x5dd6b6,'name');_0x28180e['query']=_[_0xb5e6('0x36')](_0x271da9[_0xb5e6('0x37')]);_0x28180e['filters']=_[_0xb5e6('0x38')](_0x28180e[_0xb5e6('0x39')],_0x28180e['query']);_0x27a53d[_0xb5e6('0x3a')]=_['intersection'](_0x28180e[_0xb5e6('0x39')],qs[_0xb5e6('0x3b')](_0x271da9[_0xb5e6('0x37')]['fields']));_0x27a53d[_0xb5e6('0x3a')]=_0x27a53d[_0xb5e6('0x3a')]['length']?_0x27a53d['attributes']:_0x28180e['model'];if(!_0x271da9[_0xb5e6('0x37')][_0xb5e6('0x3c')]('nolimit')){_0x27a53d[_0xb5e6('0x23')]=qs['limit'](_0x271da9[_0xb5e6('0x37')]['limit']);_0x27a53d[_0xb5e6('0x22')]=qs['offset'](_0x271da9[_0xb5e6('0x37')][_0xb5e6('0x22')]);}_0x27a53d[_0xb5e6('0x3d')]=qs['sort'](_0x271da9[_0xb5e6('0x37')][_0xb5e6('0x3e')]);_0x27a53d[_0xb5e6('0x3f')]=qs[_0xb5e6('0x40')](_[_0xb5e6('0x41')](_0x271da9['query'],_0x28180e[_0xb5e6('0x40')]),_0x5dd6b6);if(_0x271da9['query'][_0xb5e6('0x42')]){_0x27a53d[_0xb5e6('0x3f')]=_[_0xb5e6('0x43')](_0x27a53d[_0xb5e6('0x3f')],{'$or':_[_0xb5e6('0x33')](_0x5dd6b6,function(_0x1ad644){if(_0x1ad644[_0xb5e6('0x44')]!==_0xb5e6('0x45')){var _0x11a8b4={};_0x11a8b4[_0x1ad644[_0xb5e6('0x30')]]={'$like':'%'+_0x271da9[_0xb5e6('0x37')][_0xb5e6('0x42')]+'%'};return _0x11a8b4;}})});}_0x27a53d=_['merge']({},_0x27a53d,_0x271da9['options']);var _0x252e96={'where':_0x27a53d[_0xb5e6('0x3f')]};return db[_0xb5e6('0x46')][_0xb5e6('0x47')](_0x252e96)[_0xb5e6('0x2b')](function(_0x38e6dc){_0x41c8f6[_0xb5e6('0x47')]=_0x38e6dc;if(_0x271da9[_0xb5e6('0x37')][_0xb5e6('0x48')]){_0x27a53d[_0xb5e6('0x49')]=[{'all':!![]}];}return db[_0xb5e6('0x46')][_0xb5e6('0x4a')](_0x27a53d);})[_0xb5e6('0x2b')](function(_0x3ccb19){_0x41c8f6[_0xb5e6('0x4b')]=_0x3ccb19;return _0x41c8f6;})[_0xb5e6('0x2b')](respondWithFilteredResult(_0x5f30ec,_0x27a53d))[_0xb5e6('0x4c')](handleError(_0x5f30ec,null));};exports[_0xb5e6('0x4d')]=function(_0x18d212,_0x308686){var _0xc3914e={'raw':![],'where':{'id':_0x18d212[_0xb5e6('0x4e')]['id']}},_0x442ba1={};_0x442ba1[_0xb5e6('0x39')]=_[_0xb5e6('0x36')](db[_0xb5e6('0x46')][_0xb5e6('0x4f')]);_0x442ba1[_0xb5e6('0x37')]=_[_0xb5e6('0x36')](_0x18d212['query']);_0x442ba1[_0xb5e6('0x40')]=_['intersection'](_0x442ba1['model'],_0x442ba1[_0xb5e6('0x37')]);_0xc3914e[_0xb5e6('0x3a')]=_[_0xb5e6('0x38')](_0x442ba1[_0xb5e6('0x39')],qs[_0xb5e6('0x3b')](_0x18d212[_0xb5e6('0x37')][_0xb5e6('0x3b')]));_0xc3914e[_0xb5e6('0x3a')]=_0xc3914e[_0xb5e6('0x3a')][_0xb5e6('0x50')]?_0xc3914e[_0xb5e6('0x3a')]:_0x442ba1['model'];if(_0x18d212[_0xb5e6('0x37')][_0xb5e6('0x48')]){_0xc3914e[_0xb5e6('0x49')]=[{'all':!![]}];}_0xc3914e=_[_0xb5e6('0x43')]({},_0xc3914e,_0x18d212[_0xb5e6('0x51')]);return db[_0xb5e6('0x46')][_0xb5e6('0x52')](_0xc3914e)['then'](handleEntityNotFound(_0x308686,null))['then'](respondWithResult(_0x308686,null))[_0xb5e6('0x4c')](handleError(_0x308686,null));};exports[_0xb5e6('0x53')]=function(_0x2038f3,_0x39ef9e){return db['SquareProject'][_0xb5e6('0x53')](_0x2038f3[_0xb5e6('0x54')],{})[_0xb5e6('0x2b')](function(_0x179cf8){var _0x2f3bed=_0x2038f3['user']['get']({'plain':!![]});if(!_0x2f3bed)throw new Error(_0xb5e6('0x55'));if(_0x2f3bed[_0xb5e6('0x56')]===_0xb5e6('0x57')){var _0x18f319=_0x179cf8[_0xb5e6('0x2c')]({'plain':!![]});var _0x10c509=_0xb5e6('0x58');return db[_0xb5e6('0x59')][_0xb5e6('0x52')]({'where':{'name':_0x10c509,'userProfileId':_0x2f3bed['userProfileId']},'raw':!![]})[_0xb5e6('0x2b')](function(_0x3beafa){if(_0x3beafa&&_0x3beafa[_0xb5e6('0x5a')]===0x0){return db[_0xb5e6('0x5b')][_0xb5e6('0x53')]({'name':_0x18f319[_0xb5e6('0x30')],'resourceId':_0x18f319['id'],'type':_0x3beafa[_0xb5e6('0x30')],'sectionId':_0x3beafa['id']},{})[_0xb5e6('0x2b')](function(){return _0x179cf8;});}else{return _0x179cf8;}})[_0xb5e6('0x4c')](function(_0x35a2b9){logger[_0xb5e6('0x2e')](_0xb5e6('0x5c'),_0x35a2b9);throw _0x35a2b9;});}return _0x179cf8;})[_0xb5e6('0x2b')](respondWithResult(_0x39ef9e,0xc9))[_0xb5e6('0x4c')](handleError(_0x39ef9e,null));};exports[_0xb5e6('0x2a')]=function(_0x4b087b,_0x2f480f){if(_0x4b087b['body']['id']){delete _0x4b087b['body']['id'];}return db[_0xb5e6('0x46')][_0xb5e6('0x52')]({'where':{'id':_0x4b087b[_0xb5e6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2f480f,null))[_0xb5e6('0x2b')](saveUpdates(_0x4b087b[_0xb5e6('0x54')],null))[_0xb5e6('0x2b')](respondWithResult(_0x2f480f,null))['catch'](handleError(_0x2f480f,null));};exports[_0xb5e6('0x5d')]=function(_0x3a285d,_0x5e0f46){return db[_0xb5e6('0x46')]['find']({'where':{'id':_0x3a285d[_0xb5e6('0x4e')]['id']}})[_0xb5e6('0x2b')](handleEntityNotFound(_0x5e0f46,null))['then'](removeEntity(_0x5e0f46,null))[_0xb5e6('0x4c')](handleError(_0x5e0f46,null));};exports[_0xb5e6('0x5e')]=function(_0x1b1fd5,_0x1f3351,_0x56eedf){return db[_0xb5e6('0x46')][_0xb5e6('0x52')]({'where':{'id':_0x1b1fd5[_0xb5e6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1f3351,null))[_0xb5e6('0x2b')](function(_0x5260b1){if(_0x5260b1){return _0x5260b1[_0xb5e6('0x5e')](_0x1b1fd5['body'][_0xb5e6('0x5f')],_[_0xb5e6('0x60')](_0x1b1fd5['body'],[_0xb5e6('0x5f'),'id'])||{});}})[_0xb5e6('0x2b')](respondWithResult(_0x1f3351,null))[_0xb5e6('0x4c')](handleError(_0x1f3351,null));};exports[_0xb5e6('0x61')]=function(_0x29fa9e,_0x1e8ace,_0xb83837){return db[_0xb5e6('0x46')]['find']({'where':{'id':_0x29fa9e[_0xb5e6('0x4e')]['id']}})[_0xb5e6('0x2b')](handleEntityNotFound(_0x1e8ace,null))[_0xb5e6('0x2b')](function(_0x4ab301){if(_0x4ab301){return _0x4ab301['removeUsers'](_0x29fa9e['query']['ids'])['then'](function(){if(_[_0xb5e6('0x62')](_0x29fa9e[_0xb5e6('0x37')][_0xb5e6('0x5f')])){for(var _0x296440=0x0;_0x296440<_0x29fa9e['query'][_0xb5e6('0x5f')]['length'];_0x296440+=0x1){socket[_0xb5e6('0x63')](_0xb5e6('0x64'),{'UserId':Number(_0x29fa9e[_0xb5e6('0x37')]['ids'][_0x296440]),'SquareProjectId':Number(_0x29fa9e[_0xb5e6('0x4e')]['id'])});}}else{socket['emit'](_0xb5e6('0x64'),{'UserId':Number(_0x29fa9e[_0xb5e6('0x37')][_0xb5e6('0x5f')]),'SquareProjectId':Number(_0x29fa9e[_0xb5e6('0x4e')]['id'])});}});}})[_0xb5e6('0x2b')](respondWithStatusCode(_0x1e8ace,null))['catch'](handleError(_0x1e8ace,null));};exports[_0xb5e6('0x65')]=function(_0x5a177f,_0x243375,_0x2e1ff9){var _0x27c989={};var _0x25e7cf={};var _0x1e2df4;var _0x36cff5;return db['SquareProject']['findOne']({'where':{'id':_0x5a177f[_0xb5e6('0x4e')]['id']}})[_0xb5e6('0x2b')](handleEntityNotFound(_0x243375,null))['then'](function(_0xef5ad0){if(_0xef5ad0){_0x1e2df4=_0xef5ad0;_0x25e7cf[_0xb5e6('0x39')]=_[_0xb5e6('0x36')](db[_0xb5e6('0x66')][_0xb5e6('0x4f')]);_0x25e7cf[_0xb5e6('0x37')]=_[_0xb5e6('0x36')](_0x5a177f[_0xb5e6('0x37')]);_0x25e7cf['filters']=_[_0xb5e6('0x38')](_0x25e7cf[_0xb5e6('0x39')],_0x25e7cf['query']);_0x27c989[_0xb5e6('0x3a')]=_['intersection'](_0x25e7cf[_0xb5e6('0x39')],qs[_0xb5e6('0x3b')](_0x5a177f['query'][_0xb5e6('0x3b')]));_0x27c989['attributes']=_0x27c989[_0xb5e6('0x3a')][_0xb5e6('0x50')]?_0x27c989[_0xb5e6('0x3a')]:_0x25e7cf[_0xb5e6('0x39')];_0x27c989['order']=qs[_0xb5e6('0x3e')](_0x5a177f['query'][_0xb5e6('0x3e')]);_0x27c989[_0xb5e6('0x3f')]=qs[_0xb5e6('0x40')](_[_0xb5e6('0x41')](_0x5a177f['query'],_0x25e7cf[_0xb5e6('0x40')]));if(_0x5a177f[_0xb5e6('0x37')][_0xb5e6('0x42')]){_0x27c989[_0xb5e6('0x3f')]=_[_0xb5e6('0x43')](_0x27c989[_0xb5e6('0x3f')],{'$or':_[_0xb5e6('0x33')](_0x27c989[_0xb5e6('0x3a')],function(_0x28e7c9){var _0x49d4ad={};_0x49d4ad[_0x28e7c9]={'$like':'%'+_0x5a177f[_0xb5e6('0x37')][_0xb5e6('0x42')]+'%'};return _0x49d4ad;})});}_0x27c989=_[_0xb5e6('0x43')]({},_0x27c989,_0x5a177f[_0xb5e6('0x51')]);return _0x1e2df4[_0xb5e6('0x65')](_0x27c989);}})[_0xb5e6('0x2b')](function(_0x5ca7c2){if(_0x5ca7c2){_0x36cff5=_0x5ca7c2[_0xb5e6('0x50')];if(!_0x5a177f[_0xb5e6('0x37')][_0xb5e6('0x3c')](_0xb5e6('0x67'))){_0x27c989[_0xb5e6('0x23')]=qs[_0xb5e6('0x23')](_0x5a177f[_0xb5e6('0x37')][_0xb5e6('0x23')]);_0x27c989[_0xb5e6('0x22')]=qs[_0xb5e6('0x22')](_0x5a177f[_0xb5e6('0x37')][_0xb5e6('0x22')]);}return _0x1e2df4[_0xb5e6('0x65')](_0x27c989);}})[_0xb5e6('0x2b')](function(_0x520340){if(_0x520340){return _0x520340?{'count':_0x36cff5,'rows':_0x520340}:null;}})[_0xb5e6('0x2b')](respondWithResult(_0x243375,null))[_0xb5e6('0x4c')](handleError(_0x243375,null));}; \ No newline at end of file +var _0x6dc1=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','findAll','rows','params','catch','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','addUsers','ids','removeUsers','isArray','userSquareProject:remove','emit','findOne','User','getUsers','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','undefined','limit','count','offset','set','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','end','sendStatus','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0x6dc1,0x142));var _0x16dc=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6dc1[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16dc('0x0'));var zipdir=require(_0x16dc('0x1'));var jsonpatch=require(_0x16dc('0x2'));var rp=require('request-promise');var moment=require(_0x16dc('0x3'));var BPromise=require(_0x16dc('0x4'));var Mustache=require(_0x16dc('0x5'));var util=require(_0x16dc('0x6'));var path=require(_0x16dc('0x7'));var sox=require(_0x16dc('0x8'));var csv=require(_0x16dc('0x9'));var ejs=require(_0x16dc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16dc('0xb'));var squel=require(_0x16dc('0xc'));var crypto=require(_0x16dc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x16dc('0xe'));var toCsv=require(_0x16dc('0x9'));var querystring=require(_0x16dc('0xf'));var Papa=require(_0x16dc('0x10'));var Redis=require(_0x16dc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x16dc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16dc('0x13'));var logger=require('../../config/logger')(_0x16dc('0x14'));var utils=require(_0x16dc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x16dc('0x16'));var db=require(_0x16dc('0x17'))['db'];config[_0x16dc('0x18')]=_[_0x16dc('0x19')](config[_0x16dc('0x18')],{'host':_0x16dc('0x1a'),'port':0x18eb});var socket=require(_0x16dc('0x1b'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x445e42,_0x4ec531){_0x4ec531=_0x4ec531||0xcc;return function(_0x4a5b78){if(_0x4a5b78){return _0x445e42['sendStatus'](_0x4ec531);}return _0x445e42[_0x16dc('0x1c')](_0x4ec531)['end']();};}function respondWithResult(_0x587ef9,_0x5000ab){_0x5000ab=_0x5000ab||0xc8;return function(_0x552ed6){if(_0x552ed6){return _0x587ef9[_0x16dc('0x1c')](_0x5000ab)['json'](_0x552ed6);}};}function respondWithFilteredResult(_0x43bfc9,_0x100da1){return function(_0x4b2f3d){if(_0x4b2f3d){var _0x1a843a=typeof _0x100da1['offset']===_0x16dc('0x1d')&&typeof _0x100da1[_0x16dc('0x1e')]===_0x16dc('0x1d');var _0xb7174=_0x4b2f3d[_0x16dc('0x1f')];var _0x38d293=_0x1a843a?0x0:_0x100da1[_0x16dc('0x20')];var _0x2252c9=_0x1a843a?_0x4b2f3d[_0x16dc('0x1f')]:_0x100da1['offset']+_0x100da1[_0x16dc('0x1e')];var _0x4bbd3a;if(_0x2252c9>=_0xb7174){_0x2252c9=_0xb7174;_0x4bbd3a=0xc8;}else{_0x4bbd3a=0xce;}_0x43bfc9[_0x16dc('0x1c')](_0x4bbd3a);return _0x43bfc9[_0x16dc('0x21')]('Content-Range',_0x38d293+'-'+_0x2252c9+'/'+_0xb7174)['json'](_0x4b2f3d);}return null;};}function patchUpdates(_0x42dc7d){return function(_0x21d6c2){try{jsonpatch['apply'](_0x21d6c2,_0x42dc7d,!![]);}catch(_0x214c81){return BPromise[_0x16dc('0x22')](_0x214c81);}return _0x21d6c2[_0x16dc('0x23')]();};}function saveUpdates(_0x47fd33,_0x39f0b5){return function(_0x30931b){if(_0x30931b){return _0x30931b[_0x16dc('0x24')](_0x47fd33)[_0x16dc('0x25')](function(_0x39e67d){return _0x39e67d;});}return null;};}function removeEntity(_0x296c16,_0x5503cb){return function(_0x232f72){if(_0x232f72){return _0x232f72[_0x16dc('0x26')]()['then'](function(){var _0x54ea73=_0x232f72[_0x16dc('0x27')]({'plain':!![]});var _0x2d9056=_0x16dc('0x28');return db[_0x16dc('0x29')][_0x16dc('0x26')]({'where':{'type':_0x2d9056,'resourceId':_0x54ea73['id']}})['then'](function(){return _0x232f72;});})[_0x16dc('0x25')](function(){_0x296c16[_0x16dc('0x1c')](0xcc)[_0x16dc('0x2a')]();});}};}function handleEntityNotFound(_0x14e9ee,_0xebf82b){return function(_0x3ae3b3){if(!_0x3ae3b3){_0x14e9ee[_0x16dc('0x2b')](0x194);}return _0x3ae3b3;};}function handleError(_0x3fdb9c,_0x3029e0){_0x3029e0=_0x3029e0||0x1f4;return function(_0x76d3f8){logger['error'](_0x76d3f8['stack']);if(_0x76d3f8[_0x16dc('0x2c')]){delete _0x76d3f8[_0x16dc('0x2c')];}_0x3fdb9c[_0x16dc('0x1c')](_0x3029e0)[_0x16dc('0x2d')](_0x76d3f8);};}exports['index']=function(_0x5cdd0e,_0x5265a7){var _0xe79bbd={},_0x197e33={},_0x49e7b4={'count':0x0,'rows':[]};var _0x56f9d7=_[_0x16dc('0x2e')](db['SquareProject'][_0x16dc('0x2f')],function(_0x3f1b9e){return{'name':_0x3f1b9e[_0x16dc('0x30')],'type':_0x3f1b9e[_0x16dc('0x31')][_0x16dc('0x32')]};});_0x197e33['model']=_[_0x16dc('0x2e')](_0x56f9d7,_0x16dc('0x2c'));_0x197e33['query']=_[_0x16dc('0x33')](_0x5cdd0e[_0x16dc('0x34')]);_0x197e33[_0x16dc('0x35')]=_[_0x16dc('0x36')](_0x197e33[_0x16dc('0x37')],_0x197e33[_0x16dc('0x34')]);_0xe79bbd['attributes']=_[_0x16dc('0x36')](_0x197e33[_0x16dc('0x37')],qs[_0x16dc('0x38')](_0x5cdd0e[_0x16dc('0x34')][_0x16dc('0x38')]));_0xe79bbd[_0x16dc('0x39')]=_0xe79bbd['attributes'][_0x16dc('0x3a')]?_0xe79bbd[_0x16dc('0x39')]:_0x197e33['model'];if(!_0x5cdd0e['query'][_0x16dc('0x3b')](_0x16dc('0x3c'))){_0xe79bbd[_0x16dc('0x1e')]=qs[_0x16dc('0x1e')](_0x5cdd0e[_0x16dc('0x34')][_0x16dc('0x1e')]);_0xe79bbd['offset']=qs[_0x16dc('0x20')](_0x5cdd0e[_0x16dc('0x34')][_0x16dc('0x20')]);}_0xe79bbd[_0x16dc('0x3d')]=qs[_0x16dc('0x3e')](_0x5cdd0e['query'][_0x16dc('0x3e')]);_0xe79bbd[_0x16dc('0x3f')]=qs['filters'](_[_0x16dc('0x40')](_0x5cdd0e[_0x16dc('0x34')],_0x197e33[_0x16dc('0x35')]),_0x56f9d7);if(_0x5cdd0e['query'][_0x16dc('0x41')]){_0xe79bbd[_0x16dc('0x3f')]=_[_0x16dc('0x42')](_0xe79bbd[_0x16dc('0x3f')],{'$or':_[_0x16dc('0x2e')](_0x56f9d7,function(_0x4eb50e){if(_0x4eb50e[_0x16dc('0x31')]!==_0x16dc('0x43')){var _0x17fbbc={};_0x17fbbc[_0x4eb50e['name']]={'$like':'%'+_0x5cdd0e[_0x16dc('0x34')][_0x16dc('0x41')]+'%'};return _0x17fbbc;}})});}_0xe79bbd=_[_0x16dc('0x42')]({},_0xe79bbd,_0x5cdd0e[_0x16dc('0x44')]);var _0x2e00e3={'where':_0xe79bbd['where']};return db[_0x16dc('0x45')][_0x16dc('0x1f')](_0x2e00e3)['then'](function(_0x20e81e){_0x49e7b4[_0x16dc('0x1f')]=_0x20e81e;if(_0x5cdd0e[_0x16dc('0x34')][_0x16dc('0x46')]){_0xe79bbd['include']=[{'all':!![]}];}return db[_0x16dc('0x45')][_0x16dc('0x47')](_0xe79bbd);})[_0x16dc('0x25')](function(_0x56af10){_0x49e7b4[_0x16dc('0x48')]=_0x56af10;return _0x49e7b4;})[_0x16dc('0x25')](respondWithFilteredResult(_0x5265a7,_0xe79bbd))['catch'](handleError(_0x5265a7,null));};exports['show']=function(_0x4df203,_0xd19a0f){var _0xbaddeb={'raw':![],'where':{'id':_0x4df203[_0x16dc('0x49')]['id']}},_0x15a9b9={};_0x15a9b9[_0x16dc('0x37')]=_[_0x16dc('0x33')](db[_0x16dc('0x45')][_0x16dc('0x2f')]);_0x15a9b9[_0x16dc('0x34')]=_['keys'](_0x4df203[_0x16dc('0x34')]);_0x15a9b9[_0x16dc('0x35')]=_['intersection'](_0x15a9b9[_0x16dc('0x37')],_0x15a9b9[_0x16dc('0x34')]);_0xbaddeb[_0x16dc('0x39')]=_['intersection'](_0x15a9b9[_0x16dc('0x37')],qs[_0x16dc('0x38')](_0x4df203[_0x16dc('0x34')][_0x16dc('0x38')]));_0xbaddeb[_0x16dc('0x39')]=_0xbaddeb[_0x16dc('0x39')][_0x16dc('0x3a')]?_0xbaddeb['attributes']:_0x15a9b9[_0x16dc('0x37')];if(_0x4df203[_0x16dc('0x34')][_0x16dc('0x46')]){_0xbaddeb['include']=[{'all':!![]}];}_0xbaddeb=_[_0x16dc('0x42')]({},_0xbaddeb,_0x4df203[_0x16dc('0x44')]);return db['SquareProject']['find'](_0xbaddeb)[_0x16dc('0x25')](handleEntityNotFound(_0xd19a0f,null))[_0x16dc('0x25')](respondWithResult(_0xd19a0f,null))[_0x16dc('0x4a')](handleError(_0xd19a0f,null));};exports['create']=function(_0x1f13f8,_0x69fc39){return db[_0x16dc('0x45')][_0x16dc('0x4b')](_0x1f13f8[_0x16dc('0x4c')],{})['then'](function(_0x4227b4){var _0x126b11=_0x1f13f8[_0x16dc('0x4d')]['get']({'plain':!![]});if(!_0x126b11)throw new Error(_0x16dc('0x4e'));if(_0x126b11[_0x16dc('0x4f')]===_0x16dc('0x4d')){var _0x5b77b7=_0x4227b4[_0x16dc('0x27')]({'plain':!![]});var _0x3efe7f='SquareProjects';return db[_0x16dc('0x50')][_0x16dc('0x51')]({'where':{'name':_0x3efe7f,'userProfileId':_0x126b11[_0x16dc('0x52')]},'raw':!![]})[_0x16dc('0x25')](function(_0x477a84){if(_0x477a84&&_0x477a84[_0x16dc('0x53')]===0x0){return db[_0x16dc('0x29')][_0x16dc('0x4b')]({'name':_0x5b77b7['name'],'resourceId':_0x5b77b7['id'],'type':_0x477a84[_0x16dc('0x2c')],'sectionId':_0x477a84['id']},{})[_0x16dc('0x25')](function(){return _0x4227b4;});}else{return _0x4227b4;}})[_0x16dc('0x4a')](function(_0x2b7f2b){logger[_0x16dc('0x54')](_0x16dc('0x55'),_0x2b7f2b);throw _0x2b7f2b;});}return _0x4227b4;})[_0x16dc('0x25')](respondWithResult(_0x69fc39,0xc9))[_0x16dc('0x4a')](handleError(_0x69fc39,null));};exports[_0x16dc('0x24')]=function(_0x2e6bc1,_0x4ca274){if(_0x2e6bc1[_0x16dc('0x4c')]['id']){delete _0x2e6bc1[_0x16dc('0x4c')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x2e6bc1[_0x16dc('0x49')]['id']}})[_0x16dc('0x25')](handleEntityNotFound(_0x4ca274,null))['then'](saveUpdates(_0x2e6bc1[_0x16dc('0x4c')],null))[_0x16dc('0x25')](respondWithResult(_0x4ca274,null))[_0x16dc('0x4a')](handleError(_0x4ca274,null));};exports[_0x16dc('0x26')]=function(_0x592856,_0x489063){return db[_0x16dc('0x45')][_0x16dc('0x51')]({'where':{'id':_0x592856['params']['id']}})[_0x16dc('0x25')](handleEntityNotFound(_0x489063,null))[_0x16dc('0x25')](removeEntity(_0x489063,null))[_0x16dc('0x4a')](handleError(_0x489063,null));};exports[_0x16dc('0x56')]=function(_0x5a79cb,_0x5d39fb,_0x4a663f){return db['SquareProject']['find']({'where':{'id':_0x5a79cb[_0x16dc('0x49')]['id']}})[_0x16dc('0x25')](handleEntityNotFound(_0x5d39fb,null))[_0x16dc('0x25')](function(_0x7402dc){if(_0x7402dc){return _0x7402dc[_0x16dc('0x56')](_0x5a79cb[_0x16dc('0x4c')]['ids'],_['omit'](_0x5a79cb[_0x16dc('0x4c')],[_0x16dc('0x57'),'id'])||{});}})['then'](respondWithResult(_0x5d39fb,null))[_0x16dc('0x4a')](handleError(_0x5d39fb,null));};exports['removeUsers']=function(_0x49d04e,_0x72a7fb,_0x3079a7){return db[_0x16dc('0x45')][_0x16dc('0x51')]({'where':{'id':_0x49d04e[_0x16dc('0x49')]['id']}})[_0x16dc('0x25')](handleEntityNotFound(_0x72a7fb,null))[_0x16dc('0x25')](function(_0x55e783){if(_0x55e783){return _0x55e783[_0x16dc('0x58')](_0x49d04e['query'][_0x16dc('0x57')])[_0x16dc('0x25')](function(){if(_[_0x16dc('0x59')](_0x49d04e[_0x16dc('0x34')][_0x16dc('0x57')])){for(var _0x2dd94e=0x0;_0x2dd94e<_0x49d04e['query'][_0x16dc('0x57')][_0x16dc('0x3a')];_0x2dd94e+=0x1){socket['emit'](_0x16dc('0x5a'),{'UserId':Number(_0x49d04e[_0x16dc('0x34')]['ids'][_0x2dd94e]),'SquareProjectId':Number(_0x49d04e[_0x16dc('0x49')]['id'])});}}else{socket[_0x16dc('0x5b')](_0x16dc('0x5a'),{'UserId':Number(_0x49d04e[_0x16dc('0x34')][_0x16dc('0x57')]),'SquareProjectId':Number(_0x49d04e[_0x16dc('0x49')]['id'])});}});}})[_0x16dc('0x25')](respondWithStatusCode(_0x72a7fb,null))['catch'](handleError(_0x72a7fb,null));};exports['getUsers']=function(_0x45ab7b,_0x4a6ecc,_0x3d6229){var _0x1b6774={};var _0x4962b3={};var _0x1a35ea;var _0x51f606;return db['SquareProject'][_0x16dc('0x5c')]({'where':{'id':_0x45ab7b['params']['id']}})[_0x16dc('0x25')](handleEntityNotFound(_0x4a6ecc,null))[_0x16dc('0x25')](function(_0x9c4bb3){if(_0x9c4bb3){_0x1a35ea=_0x9c4bb3;_0x4962b3[_0x16dc('0x37')]=_[_0x16dc('0x33')](db[_0x16dc('0x5d')]['rawAttributes']);_0x4962b3[_0x16dc('0x34')]=_[_0x16dc('0x33')](_0x45ab7b[_0x16dc('0x34')]);_0x4962b3[_0x16dc('0x35')]=_[_0x16dc('0x36')](_0x4962b3['model'],_0x4962b3[_0x16dc('0x34')]);_0x1b6774[_0x16dc('0x39')]=_[_0x16dc('0x36')](_0x4962b3[_0x16dc('0x37')],qs[_0x16dc('0x38')](_0x45ab7b['query']['fields']));_0x1b6774[_0x16dc('0x39')]=_0x1b6774[_0x16dc('0x39')]['length']?_0x1b6774[_0x16dc('0x39')]:_0x4962b3[_0x16dc('0x37')];_0x1b6774['order']=qs[_0x16dc('0x3e')](_0x45ab7b[_0x16dc('0x34')]['sort']);_0x1b6774[_0x16dc('0x3f')]=qs[_0x16dc('0x35')](_[_0x16dc('0x40')](_0x45ab7b[_0x16dc('0x34')],_0x4962b3[_0x16dc('0x35')]));if(_0x45ab7b[_0x16dc('0x34')][_0x16dc('0x41')]){_0x1b6774[_0x16dc('0x3f')]=_['merge'](_0x1b6774[_0x16dc('0x3f')],{'$or':_[_0x16dc('0x2e')](_0x1b6774['attributes'],function(_0x52b20e){var _0x573d62={};_0x573d62[_0x52b20e]={'$like':'%'+_0x45ab7b[_0x16dc('0x34')][_0x16dc('0x41')]+'%'};return _0x573d62;})});}_0x1b6774=_[_0x16dc('0x42')]({},_0x1b6774,_0x45ab7b[_0x16dc('0x44')]);return _0x1a35ea[_0x16dc('0x5e')](_0x1b6774);}})[_0x16dc('0x25')](function(_0x2cc70d){if(_0x2cc70d){_0x51f606=_0x2cc70d[_0x16dc('0x3a')];if(!_0x45ab7b[_0x16dc('0x34')][_0x16dc('0x3b')](_0x16dc('0x3c'))){_0x1b6774[_0x16dc('0x1e')]=qs[_0x16dc('0x1e')](_0x45ab7b['query'][_0x16dc('0x1e')]);_0x1b6774[_0x16dc('0x20')]=qs['offset'](_0x45ab7b[_0x16dc('0x34')][_0x16dc('0x20')]);}return _0x1a35ea[_0x16dc('0x5e')](_0x1b6774);}})[_0x16dc('0x25')](function(_0x42968c){if(_0x42968c){return _0x42968c?{'count':_0x51f606,'rows':_0x42968c}:null;}})[_0x16dc('0x25')](respondWithResult(_0x4a6ecc,null))['catch'](handleError(_0x4a6ecc,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 3d75042..323b98e 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 _0x8f20=['emit','hasOwnProperty','hook','events','SquareProject','save','update','remove'];(function(_0x4de364,_0x6b4ba){var _0x385173=function(_0x2c5655){while(--_0x2c5655){_0x4de364['push'](_0x4de364['shift']());}};_0x385173(++_0x6b4ba);}(_0x8f20,0x133));var _0x08f2=function(_0x515e72,_0x224638){_0x515e72=_0x515e72-0x0;var _0x21d3bf=_0x8f20[_0x515e72];return _0x21d3bf;};'use strict';var EventEmitter=require(_0x08f2('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x08f2('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x08f2('0x2'),'afterUpdate':_0x08f2('0x3'),'afterDestroy':_0x08f2('0x4')};function emitEvent(_0x24bb89){return function(_0xf35039,_0x13491b,_0x1799bf){SquareProjectEvents[_0x08f2('0x5')](_0x24bb89+':'+_0xf35039['id'],_0xf35039);SquareProjectEvents[_0x08f2('0x5')](_0x24bb89,_0xf35039);_0x1799bf(null);};}for(var e in events){if(events[_0x08f2('0x6')](e)){var event=events[e];SquareProject[_0x08f2('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xd149=['../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x28851d,_0x224684){var _0x21e568=function(_0x3b1243){while(--_0x3b1243){_0x28851d['push'](_0x28851d['shift']());}};_0x21e568(++_0x224684);}(_0xd149,0x1df));var _0x9d14=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xd149[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0x9d14('0x0'));var SquareProject=require(_0x9d14('0x1'))['db'][_0x9d14('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x9d14('0x3')](0x0);var events={'afterCreate':_0x9d14('0x4'),'afterUpdate':_0x9d14('0x5'),'afterDestroy':_0x9d14('0x6')};function emitEvent(_0x5dacab){return function(_0x4a840c,_0x2c23d9,_0x2bbbac){SquareProjectEvents[_0x9d14('0x7')](_0x5dacab+':'+_0x4a840c['id'],_0x4a840c);SquareProjectEvents[_0x9d14('0x7')](_0x5dacab,_0x4a840c);_0x2bbbac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x9d14('0x8')](e,emitEvent(event));}}module[_0x9d14('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 0c8823c..adf0a7f 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 _0xfc66=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0xfc66,0x176));var _0x6fc6=function(_0x141278,_0x58a4aa){_0x141278=_0x141278-0x0;var _0x305236=_0xfc66[_0x141278];return _0x305236;};'use strict';var _=require(_0x6fc6('0x0'));var util=require(_0x6fc6('0x1'));var logger=require(_0x6fc6('0x2'))(_0x6fc6('0x3'));var moment=require(_0x6fc6('0x4'));var BPromise=require(_0x6fc6('0x5'));var rp=require(_0x6fc6('0x6'));var fs=require('fs');var path=require(_0x6fc6('0x7'));var rimraf=require(_0x6fc6('0x8'));var config=require(_0x6fc6('0x9'));var attributes=require(_0x6fc6('0xa'));module[_0x6fc6('0xb')]=function(_0x2b7415,_0xf8641c){return _0x2b7415[_0x6fc6('0xc')](_0x6fc6('0xd'),attributes,{'tableName':_0x6fc6('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x189134,_0x4bcda2,_0x47dcea){if(_0x189134['changed']('preproduction')){_0x189134[_0x6fc6('0xf')]=moment()[_0x6fc6('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x189134['changed'](_0x6fc6('0x11'))){_0x189134[_0x6fc6('0x12')]=moment()[_0x6fc6('0x10')](_0x6fc6('0x13'));}_0x47dcea(null,_0x189134);}}});}; \ No newline at end of file +var _0xba2c=['rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','api','moment','request-promise'];(function(_0x321575,_0x2feea4){var _0x48e024=function(_0x436af6){while(--_0x436af6){_0x321575['push'](_0x321575['shift']());}};_0x48e024(++_0x2feea4);}(_0xba2c,0x14c));var _0xcba2=function(_0x38f74d,_0x480f03){_0x38f74d=_0x38f74d-0x0;var _0x41ad8a=_0xba2c[_0x38f74d];return _0x41ad8a;};'use strict';var _=require('lodash');var util=require(_0xcba2('0x0'));var logger=require('../../config/logger')(_0xcba2('0x1'));var moment=require(_0xcba2('0x2'));var BPromise=require('bluebird');var rp=require(_0xcba2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcba2('0x4'));var config=require(_0xcba2('0x5'));var attributes=require(_0xcba2('0x6'));module[_0xcba2('0x7')]=function(_0x2032bd,_0x510c7f){return _0x2032bd['define'](_0xcba2('0x8'),attributes,{'tableName':_0xcba2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1689a7,_0x2a3184,_0x40bc12){if(_0x1689a7[_0xcba2('0xa')]('preproduction')){_0x1689a7[_0xcba2('0xb')]=moment()[_0xcba2('0xc')](_0xcba2('0xd'));}if(_0x1689a7[_0xcba2('0xa')](_0xcba2('0xe'))){_0x1689a7[_0xcba2('0xf')]=moment()['format'](_0xcba2('0xd'));}_0x40bc12(null,_0x1689a7);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 062cefa..69af363 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 _0x961e=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','then','info','SquareProject,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','ShowSquareProject','SquareProject','options','where','attributes','include','map','model','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x961e,0x1a8));var _0xe961=function(_0x239df4,_0x52ed5b){_0x239df4=_0x239df4-0x0;var _0x55f3da=_0x961e[_0x239df4];return _0x55f3da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe961('0x0'));var BPromise=require(_0xe961('0x1'));var rs=require(_0xe961('0x2'));var fs=require('fs');var Redis=require(_0xe961('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe961('0x4'))(_0xe961('0x5'));var config=require(_0xe961('0x6'));var jayson=require(_0xe961('0x7'));var client=jayson[_0xe961('0x8')]['http']({'port':0x232a});config[_0xe961('0x9')]=_[_0xe961('0xa')](config['redis'],{'host':_0xe961('0xb'),'port':0x18eb});var socket=require(_0xe961('0xc'))(new Redis(config[_0xe961('0x9')]));require(_0xe961('0xd'))['register'](socket);function respondWithRpcPromise(_0x19d559,_0x27f893,_0x545d9b){return new BPromise(function(_0xb706ff,_0xe78f10){return client['request'](_0x19d559,_0x545d9b)[_0xe961('0xe')](function(_0x4a1787){logger[_0xe961('0xf')](_0xe961('0x10'),_0x27f893,'request\x20sent');logger[_0xe961('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x27f893,_0xe961('0x12'),JSON[_0xe961('0x13')](_0x4a1787));if(_0x4a1787['error']){if(_0x4a1787['error'][_0xe961('0x14')]===0x1f4){logger[_0xe961('0x15')](_0xe961('0x10'),_0x27f893,_0x4a1787[_0xe961('0x15')]['message']);return _0xe78f10(_0x4a1787['error']['message']);}logger['error']('SquareProject,\x20%s,\x20%s',_0x27f893,_0x4a1787['error'][_0xe961('0x16')]);return _0xb706ff(_0x4a1787['error'][_0xe961('0x16')]);}else{logger[_0xe961('0xf')]('SquareProject,\x20%s,\x20%s',_0x27f893,'request\x20sent');_0xb706ff(_0x4a1787[_0xe961('0x17')][_0xe961('0x16')]);}})[_0xe961('0x18')](function(_0x513a18){logger[_0xe961('0x15')](_0xe961('0x10'),_0x27f893,_0x513a18);_0xe78f10(_0x513a18);});});}exports[_0xe961('0x19')]=function(_0x5114ae){var _0x5871e2=this;return new Promise(function(_0x537537,_0x275258){return db[_0xe961('0x1a')]['find']({'raw':_0x5114ae[_0xe961('0x1b')]?_0x5114ae[_0xe961('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5114ae[_0xe961('0x1b')]?_0x5114ae[_0xe961('0x1b')][_0xe961('0x1c')]||null:null,'attributes':_0x5114ae[_0xe961('0x1b')]?_0x5114ae[_0xe961('0x1b')][_0xe961('0x1d')]||null:null,'include':_0x5114ae[_0xe961('0x1b')]?_0x5114ae[_0xe961('0x1b')][_0xe961('0x1e')]?_[_0xe961('0x1f')](_0x5114ae[_0xe961('0x1b')][_0xe961('0x1e')],function(_0xa005a5){return{'model':db[_0xa005a5[_0xe961('0x20')]],'as':_0xa005a5['as'],'attributes':_0xa005a5['attributes'],'include':_0xa005a5[_0xe961('0x1e')]?_['map'](_0xa005a5[_0xe961('0x1e')],function(_0x31ef7e){return{'model':db[_0x31ef7e[_0xe961('0x20')]],'as':_0x31ef7e['as'],'attributes':_0x31ef7e['attributes'],'include':_0x31ef7e[_0xe961('0x1e')]?_[_0xe961('0x1f')](_0x31ef7e[_0xe961('0x1e')],function(_0x3f1e4d){return{'model':db[_0x3f1e4d[_0xe961('0x20')]],'as':_0x3f1e4d['as'],'attributes':_0x3f1e4d['attributes']};}):[]};}):[]};}):[]:[]})[_0xe961('0xe')](function(_0x21353f){logger['info'](_0xe961('0x19'),_0x5114ae);logger[_0xe961('0x11')](_0xe961('0x19'),_0x5114ae,JSON[_0xe961('0x13')](_0x21353f));_0x537537(_0x21353f);})[_0xe961('0x18')](function(_0x538f70){logger[_0xe961('0x15')](_0xe961('0x19'),_0x538f70['message'],_0x5114ae);_0x275258(_0x5871e2[_0xe961('0x15')](0x1f4,_0x538f70[_0xe961('0x16')]));});});}; \ No newline at end of file +var _0xe18a=['find','options','raw','where','attributes','include','map','model','ShowSquareProject','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','./squareProject.socket','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x4b54fb,_0x2150e4){var _0x375eb4=function(_0x461679){while(--_0x461679){_0x4b54fb['push'](_0x4b54fb['shift']());}};_0x375eb4(++_0x2150e4);}(_0xe18a,0x15d));var _0xae18=function(_0x3379ec,_0x64dc6d){_0x3379ec=_0x3379ec-0x0;var _0x440566=_0xe18a[_0x3379ec];return _0x440566;};'use strict';var _=require('lodash');var util=require(_0xae18('0x0'));var moment=require(_0xae18('0x1'));var BPromise=require(_0xae18('0x2'));var rs=require(_0xae18('0x3'));var fs=require('fs');var Redis=require(_0xae18('0x4'));var db=require(_0xae18('0x5'))['db'];var utils=require(_0xae18('0x6'));var logger=require(_0xae18('0x7'))(_0xae18('0x8'));var config=require(_0xae18('0x9'));var jayson=require(_0xae18('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xae18('0xb')]=_[_0xae18('0xc')](config[_0xae18('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae18('0xb')]));require(_0xae18('0xd'))['register'](socket);function respondWithRpcPromise(_0x418863,_0xc796e3,_0x4978b){return new BPromise(function(_0x411773,_0x154dde){return client['request'](_0x418863,_0x4978b)[_0xae18('0xe')](function(_0x5b50c3){logger[_0xae18('0xf')](_0xae18('0x10'),_0xc796e3,_0xae18('0x11'));logger[_0xae18('0x12')](_0xae18('0x13'),_0xc796e3,_0xae18('0x11'),JSON[_0xae18('0x14')](_0x5b50c3));if(_0x5b50c3[_0xae18('0x15')]){if(_0x5b50c3[_0xae18('0x15')]['code']===0x1f4){logger[_0xae18('0x15')]('SquareProject,\x20%s,\x20%s',_0xc796e3,_0x5b50c3[_0xae18('0x15')][_0xae18('0x16')]);return _0x154dde(_0x5b50c3[_0xae18('0x15')][_0xae18('0x16')]);}logger[_0xae18('0x15')](_0xae18('0x10'),_0xc796e3,_0x5b50c3[_0xae18('0x15')]['message']);return _0x411773(_0x5b50c3[_0xae18('0x15')][_0xae18('0x16')]);}else{logger[_0xae18('0xf')]('SquareProject,\x20%s,\x20%s',_0xc796e3,'request\x20sent');_0x411773(_0x5b50c3[_0xae18('0x17')][_0xae18('0x16')]);}})[_0xae18('0x18')](function(_0x284c86){logger['error'](_0xae18('0x10'),_0xc796e3,_0x284c86);_0x154dde(_0x284c86);});});}exports['ShowSquareProject']=function(_0x1ad07c){var _0x58f9d1=this;return new Promise(function(_0x478e13,_0x3676eb){return db['SquareProject'][_0xae18('0x19')]({'raw':_0x1ad07c[_0xae18('0x1a')]?_0x1ad07c[_0xae18('0x1a')][_0xae18('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ad07c[_0xae18('0x1a')]?_0x1ad07c['options'][_0xae18('0x1c')]||null:null,'attributes':_0x1ad07c[_0xae18('0x1a')]?_0x1ad07c[_0xae18('0x1a')][_0xae18('0x1d')]||null:null,'include':_0x1ad07c[_0xae18('0x1a')]?_0x1ad07c[_0xae18('0x1a')][_0xae18('0x1e')]?_[_0xae18('0x1f')](_0x1ad07c[_0xae18('0x1a')][_0xae18('0x1e')],function(_0x3bdd0b){return{'model':db[_0x3bdd0b[_0xae18('0x20')]],'as':_0x3bdd0b['as'],'attributes':_0x3bdd0b['attributes'],'include':_0x3bdd0b[_0xae18('0x1e')]?_['map'](_0x3bdd0b[_0xae18('0x1e')],function(_0x4ae584){return{'model':db[_0x4ae584['model']],'as':_0x4ae584['as'],'attributes':_0x4ae584[_0xae18('0x1d')],'include':_0x4ae584[_0xae18('0x1e')]?_['map'](_0x4ae584[_0xae18('0x1e')],function(_0x6e639b){return{'model':db[_0x6e639b['model']],'as':_0x6e639b['as'],'attributes':_0x6e639b[_0xae18('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x377360){logger['info'](_0xae18('0x21'),_0x1ad07c);logger[_0xae18('0x12')](_0xae18('0x21'),_0x1ad07c,JSON[_0xae18('0x14')](_0x377360));_0x478e13(_0x377360);})[_0xae18('0x18')](function(_0xb079b6){logger[_0xae18('0x15')]('ShowSquareProject',_0xb079b6[_0xae18('0x16')],_0x1ad07c);_0x3676eb(_0x58f9d1[_0xae18('0x15')](0x1f4,_0xb079b6[_0xae18('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 03338cf..63d44a9 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 _0x5df8=['update','emit','register','length','squareProject:','remove'];(function(_0x2e2846,_0x133290){var _0x2cfb53=function(_0x30f1b3){while(--_0x30f1b3){_0x2e2846['push'](_0x2e2846['shift']());}};_0x2cfb53(++_0x133290);}(_0x5df8,0x185));var _0x85df=function(_0x54973f,_0xf5f511){_0x54973f=_0x54973f-0x0;var _0x20ff58=_0x5df8[_0x54973f];return _0x20ff58;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x85df('0x0'),_0x85df('0x1')];function createListener(_0x18039b,_0x3a7859){return function(_0x55a25b){_0x3a7859[_0x85df('0x2')](_0x18039b,_0x55a25b);};}function removeListener(_0xc89ce6,_0x5d0237){return function(){SquareProjectEvents['removeListener'](_0xc89ce6,_0x5d0237);};}exports[_0x85df('0x3')]=function(_0x48142d){for(var _0x5e7b4a=0x0,_0xb48f41=events[_0x85df('0x4')];_0x5e7b4a<_0xb48f41;_0x5e7b4a++){var _0x42c347=events[_0x5e7b4a];var _0x2e33e2=createListener(_0x85df('0x5')+_0x42c347,_0x48142d);SquareProjectEvents['on'](_0x42c347,_0x2e33e2);}}; \ No newline at end of file +var _0x42f0=['register','length','squareProject:','./squareProject.events','save','update','emit','removeListener'];(function(_0x3a4616,_0x5e5690){var _0x1bd114=function(_0x367df4){while(--_0x367df4){_0x3a4616['push'](_0x3a4616['shift']());}};_0x1bd114(++_0x5e5690);}(_0x42f0,0x6b));var _0x042f=function(_0x42cedc,_0x3b34a2){_0x42cedc=_0x42cedc-0x0;var _0xed196e=_0x42f0[_0x42cedc];return _0xed196e;};'use strict';var SquareProjectEvents=require(_0x042f('0x0'));var events=[_0x042f('0x1'),'remove',_0x042f('0x2')];function createListener(_0x23425c,_0x3db98f){return function(_0x36e3cd){_0x3db98f[_0x042f('0x3')](_0x23425c,_0x36e3cd);};}function removeListener(_0x405615,_0x1f0fb3){return function(){SquareProjectEvents[_0x042f('0x4')](_0x405615,_0x1f0fb3);};}exports[_0x042f('0x5')]=function(_0x5bd1ac){for(var _0x5038ba=0x0,_0x309a8b=events[_0x042f('0x6')];_0x5038ba<_0x309a8b;_0x5038ba++){var _0x439595=events[_0x5038ba];var _0x5031b6=createListener(_0x042f('0x7')+_0x439595,_0x5bd1ac);SquareProjectEvents['on'](_0x439595,_0x5031b6);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index c75f431..b943198 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 _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xdd0130,_0x459c3c){var _0x39ea2c=function(_0x1076fd){while(--_0x1076fd){_0xdd0130['push'](_0xdd0130['shift']());}};_0x39ea2c(++_0x459c3c);}(_0xf494,0x1c6));var _0x4f49=function(_0x41f7ee,_0x123f79){_0x41f7ee=_0x41f7ee-0x0;var _0xfad08a=_0xf494[_0x41f7ee];return _0xfad08a;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4fa8b3,_0x59d119){var _0x2b4be1=function(_0x47b8cd){while(--_0x47b8cd){_0x4fa8b3['push'](_0x4fa8b3['shift']());}};_0x2b4be1(++_0x59d119);}(_0x4975,0x86));var _0x5497=function(_0x580b59,_0x23e3f7){_0x580b59=_0x580b59-0x0;var _0x1183b5=_0x4975[_0x580b59];return _0x1183b5;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index c41d111..c2f97d9 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 _0xeff8=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports'];(function(_0x2d31f7,_0x1083de){var _0x51c573=function(_0x38d4f4){while(--_0x38d4f4){_0x2d31f7['push'](_0x2d31f7['shift']());}};_0x51c573(++_0x1083de);}(_0xeff8,0x186));var _0x8eff=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xeff8[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8eff('0x2')]},'calleridname':{'type':Sequelize[_0x8eff('0x2')]},'context':{'type':Sequelize[_0x8eff('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8eff('0x2')]},'accountcode':{'type':Sequelize[_0x8eff('0x2')]},'dnid':{'type':Sequelize[_0x8eff('0x2')]},'projectName':{'type':Sequelize[_0x8eff('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8eff('0x2')]},'savePath':{'type':Sequelize[_0x8eff('0x2')]},'format':{'type':Sequelize[_0x8eff('0x3')],'get':function(){var _0x323b2='';var _0x491f01=this[_0x8eff('0x4')](_0x8eff('0x5'));if(_0x491f01){_0x323b2=_0x491f01[_0x8eff('0x6')](_0x491f01[_0x8eff('0x7')]('.'));}return _0x323b2;}}}; \ No newline at end of file +var _0xf2ca=['getDataValue','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x101995,_0x1d503a){var _0x211f73=function(_0x5951c9){while(--_0x5951c9){_0x101995['push'](_0x101995['shift']());}};_0x211f73(++_0x1d503a);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xbf8ec1,_0x9169c8){_0xbf8ec1=_0xbf8ec1-0x0;var _0xc84567=_0xf2ca[_0xbf8ec1];return _0xc84567;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'uniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'extension':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x2')]},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'dnid':{'type':Sequelize[_0xaf2c('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xaf2c('0x2')]},'filename':{'type':Sequelize[_0xaf2c('0x2')]},'savePath':{'type':Sequelize[_0xaf2c('0x2')]},'format':{'type':Sequelize[_0xaf2c('0x3')],'get':function(){var _0x58351f='';var _0x37fedd=this[_0xaf2c('0x4')]('savePath');if(_0x37fedd){_0x58351f=_0x37fedd[_0xaf2c('0x5')](_0x37fedd['lastIndexOf']('.'));}return _0x58351f;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 0132451..9fae1e1 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 _0x76c8=['create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','index','map','SquareRecording','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','keys','rawAttributes','length','find'];(function(_0x45fe2a,_0x39e9c2){var _0x4dd3fd=function(_0x414078){while(--_0x414078){_0x45fe2a['push'](_0x45fe2a['shift']());}};_0x4dd3fd(++_0x39e9c2);}(_0x76c8,0x7c));var _0x876c=function(_0x5be9a7,_0x327b8c){_0x5be9a7=_0x5be9a7-0x0;var _0x322467=_0x76c8[_0x5be9a7];return _0x322467;};'use strict';var emlformat=require(_0x876c('0x0'));var rimraf=require(_0x876c('0x1'));var zipdir=require(_0x876c('0x2'));var jsonpatch=require(_0x876c('0x3'));var rp=require(_0x876c('0x4'));var moment=require('moment');var BPromise=require(_0x876c('0x5'));var Mustache=require(_0x876c('0x6'));var util=require('util');var path=require(_0x876c('0x7'));var sox=require(_0x876c('0x8'));var csv=require(_0x876c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x876c('0xa'));var _=require(_0x876c('0xb'));var squel=require('squel');var crypto=require(_0x876c('0xc'));var jsforce=require(_0x876c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x876c('0x9'));var querystring=require(_0x876c('0xe'));var Papa=require('papaparse');var Redis=require(_0x876c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x876c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x876c('0x11'));var config=require(_0x876c('0x12'));var licenseUtil=require(_0x876c('0x13'));var db=require(_0x876c('0x14'))['db'];function respondWithStatusCode(_0x2726a1,_0x31f9b0){_0x31f9b0=_0x31f9b0||0xcc;return function(_0x550592){if(_0x550592){return _0x2726a1['sendStatus'](_0x31f9b0);}return _0x2726a1[_0x876c('0x15')](_0x31f9b0)[_0x876c('0x16')]();};}function respondWithResult(_0xa58cb5,_0x41a003){_0x41a003=_0x41a003||0xc8;return function(_0x11cee7){if(_0x11cee7){return _0xa58cb5['status'](_0x41a003)[_0x876c('0x17')](_0x11cee7);}};}function respondWithFilteredResult(_0x1a522b,_0x2600bb){return function(_0x324b5f){if(_0x324b5f){var _0x3c15b3=typeof _0x2600bb['offset']===_0x876c('0x18')&&typeof _0x2600bb['limit']==='undefined';var _0x16a4ee=_0x324b5f[_0x876c('0x19')];var _0x4c8ff4=_0x3c15b3?0x0:_0x2600bb['offset'];var _0xf16003=_0x3c15b3?_0x324b5f[_0x876c('0x19')]:_0x2600bb[_0x876c('0x1a')]+_0x2600bb['limit'];var _0x5058a4;if(_0xf16003>=_0x16a4ee){_0xf16003=_0x16a4ee;_0x5058a4=0xc8;}else{_0x5058a4=0xce;}_0x1a522b[_0x876c('0x15')](_0x5058a4);return _0x1a522b[_0x876c('0x1b')](_0x876c('0x1c'),_0x4c8ff4+'-'+_0xf16003+'/'+_0x16a4ee)[_0x876c('0x17')](_0x324b5f);}return null;};}function patchUpdates(_0x37ffbf){return function(_0x41ce62){try{jsonpatch['apply'](_0x41ce62,_0x37ffbf,!![]);}catch(_0x1d5b0e){return BPromise['reject'](_0x1d5b0e);}return _0x41ce62['save']();};}function saveUpdates(_0xa3fa1,_0x516319){return function(_0x595fb8){if(_0x595fb8){return _0x595fb8[_0x876c('0x1d')](_0xa3fa1)[_0x876c('0x1e')](function(_0x5970fa){return _0x5970fa;});}return null;};}function removeEntity(_0x223d74,_0x357348){return function(_0x2ee7ca){if(_0x2ee7ca){return _0x2ee7ca[_0x876c('0x1f')]()[_0x876c('0x1e')](function(){_0x223d74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22a98f,_0x562d28){return function(_0x316979){if(!_0x316979){_0x22a98f[_0x876c('0x20')](0x194);}return _0x316979;};}function handleError(_0x1c74b5,_0x3f804b){_0x3f804b=_0x3f804b||0x1f4;return function(_0x4edd74){logger[_0x876c('0x21')](_0x4edd74[_0x876c('0x22')]);if(_0x4edd74[_0x876c('0x23')]){delete _0x4edd74[_0x876c('0x23')];}_0x1c74b5[_0x876c('0x15')](_0x3f804b)['send'](_0x4edd74);};}exports[_0x876c('0x24')]=function(_0x54be82,_0x188b51){var _0x2a3105={},_0x2b5293={},_0x38bb5c={'count':0x0,'rows':[]};var _0x539c23=_[_0x876c('0x25')](db[_0x876c('0x26')]['rawAttributes'],function(_0x452133){return{'name':_0x452133[_0x876c('0x27')],'type':_0x452133[_0x876c('0x28')][_0x876c('0x29')]};});_0x2b5293[_0x876c('0x2a')]=_[_0x876c('0x25')](_0x539c23,_0x876c('0x23'));_0x2b5293['query']=_['keys'](_0x54be82[_0x876c('0x2b')]);_0x2b5293[_0x876c('0x2c')]=_['intersection'](_0x2b5293[_0x876c('0x2a')],_0x2b5293[_0x876c('0x2b')]);_0x2a3105[_0x876c('0x2d')]=_[_0x876c('0x2e')](_0x2b5293[_0x876c('0x2a')],qs['fields'](_0x54be82[_0x876c('0x2b')][_0x876c('0x2f')]));_0x2a3105[_0x876c('0x2d')]=_0x2a3105[_0x876c('0x2d')]['length']?_0x2a3105[_0x876c('0x2d')]:_0x2b5293[_0x876c('0x2a')];if(!_0x54be82[_0x876c('0x2b')]['hasOwnProperty'](_0x876c('0x30'))){_0x2a3105[_0x876c('0x31')]=qs[_0x876c('0x31')](_0x54be82[_0x876c('0x2b')]['limit']);_0x2a3105[_0x876c('0x1a')]=qs[_0x876c('0x1a')](_0x54be82['query'][_0x876c('0x1a')]);}_0x2a3105[_0x876c('0x32')]=qs[_0x876c('0x33')](_0x54be82['query'][_0x876c('0x33')]);_0x2a3105[_0x876c('0x34')]=qs[_0x876c('0x2c')](_['pick'](_0x54be82[_0x876c('0x2b')],_0x2b5293[_0x876c('0x2c')]),_0x539c23);if(_0x54be82[_0x876c('0x2b')]['filter']){_0x2a3105['where']=_[_0x876c('0x35')](_0x2a3105[_0x876c('0x34')],{'$or':_['map'](_0x539c23,function(_0x2ca89e){if(_0x2ca89e[_0x876c('0x28')]!==_0x876c('0x36')){var _0x29833b={};_0x29833b[_0x2ca89e[_0x876c('0x23')]]={'$like':'%'+_0x54be82[_0x876c('0x2b')][_0x876c('0x37')]+'%'};return _0x29833b;}})});}_0x2a3105=_[_0x876c('0x35')]({},_0x2a3105,_0x54be82[_0x876c('0x38')]);var _0xcefb55={'where':_0x2a3105[_0x876c('0x34')]};return db[_0x876c('0x26')][_0x876c('0x19')](_0xcefb55)[_0x876c('0x1e')](function(_0x48933f){_0x38bb5c['count']=_0x48933f;if(_0x54be82[_0x876c('0x2b')][_0x876c('0x39')]){_0x2a3105[_0x876c('0x3a')]=[{'all':!![]}];}return db[_0x876c('0x26')][_0x876c('0x3b')](_0x2a3105);})[_0x876c('0x1e')](function(_0x30a4a0){_0x38bb5c['rows']=_0x30a4a0;return _0x38bb5c;})[_0x876c('0x1e')](respondWithFilteredResult(_0x188b51,_0x2a3105))[_0x876c('0x3c')](handleError(_0x188b51,null));};exports[_0x876c('0x3d')]=function(_0x451670,_0x55ed88){var _0x5413bb={'raw':!![],'where':{'id':_0x451670['params']['id']}},_0x44ae77={};_0x44ae77[_0x876c('0x2a')]=_[_0x876c('0x3e')](db[_0x876c('0x26')][_0x876c('0x3f')]);_0x44ae77[_0x876c('0x2b')]=_['keys'](_0x451670[_0x876c('0x2b')]);_0x44ae77[_0x876c('0x2c')]=_['intersection'](_0x44ae77['model'],_0x44ae77[_0x876c('0x2b')]);_0x5413bb[_0x876c('0x2d')]=_[_0x876c('0x2e')](_0x44ae77[_0x876c('0x2a')],qs[_0x876c('0x2f')](_0x451670[_0x876c('0x2b')][_0x876c('0x2f')]));_0x5413bb['attributes']=_0x5413bb[_0x876c('0x2d')][_0x876c('0x40')]?_0x5413bb[_0x876c('0x2d')]:_0x44ae77[_0x876c('0x2a')];if(_0x451670[_0x876c('0x2b')]['includeAll']){_0x5413bb[_0x876c('0x3a')]=[{'all':!![]}];}_0x5413bb=_[_0x876c('0x35')]({},_0x5413bb,_0x451670[_0x876c('0x38')]);return db['SquareRecording'][_0x876c('0x41')](_0x5413bb)['then'](handleEntityNotFound(_0x55ed88,null))[_0x876c('0x1e')](respondWithResult(_0x55ed88,null))[_0x876c('0x3c')](handleError(_0x55ed88,null));};exports[_0x876c('0x42')]=function(_0x220705,_0x5d2822){return db[_0x876c('0x26')][_0x876c('0x42')](_0x220705[_0x876c('0x43')],{})[_0x876c('0x1e')](respondWithResult(_0x5d2822,0xc9))[_0x876c('0x3c')](handleError(_0x5d2822,null));};exports[_0x876c('0x1d')]=function(_0xe8bdcb,_0x10c6e6){if(_0xe8bdcb[_0x876c('0x43')]['id']){delete _0xe8bdcb[_0x876c('0x43')]['id'];}return db[_0x876c('0x26')]['find']({'where':{'id':_0xe8bdcb[_0x876c('0x44')]['id']}})[_0x876c('0x1e')](handleEntityNotFound(_0x10c6e6,null))[_0x876c('0x1e')](saveUpdates(_0xe8bdcb[_0x876c('0x43')],null))[_0x876c('0x1e')](respondWithResult(_0x10c6e6,null))['catch'](handleError(_0x10c6e6,null));};exports[_0x876c('0x45')]=function(_0xe48517,_0x1c0580,_0x2d7b18){var _0x4d03a4=require(_0x876c('0x46'));var _0x4ec0f7=![];var _0x5432f5={};if(_0xe48517[_0x876c('0x2b')][_0x876c('0x28')]&&_0xe48517[_0x876c('0x2b')][_0x876c('0x28')]===_0x876c('0x47')){_0x5432f5['uniqueid']=_0xe48517[_0x876c('0x44')]['id'];}else{_0x5432f5['id']=_0xe48517[_0x876c('0x44')]['id'];}return db[_0x876c('0x26')][_0x876c('0x41')]({'where':_0x5432f5,'attributes':['id',_0x876c('0x48'),_0x876c('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x1c0580,null))[_0x876c('0x1e')](function(_0x22be78){if(_0x22be78){var _0x57e9c9=_0x22be78[_0x876c('0x48')];var _0x47b6b8=util[_0x876c('0x4a')](_0x876c('0x4b'),_0x57e9c9);if(fs['existsSync'](_0x47b6b8)){_0x4ec0f7=!![];return _0x4d03a4[_0x876c('0x4c')](_0x47b6b8,_0x57e9c9,config[_0x876c('0x4d')][_0x876c('0x4e')])[_0x876c('0x1e')](function(){return _0x22be78;});}return _0x22be78;}})[_0x876c('0x1e')](function(_0x17b788){if(_0x17b788){var _0x23f2e2=_0x17b788[_0x876c('0x48')];if(!fs[_0x876c('0x4f')](_0x23f2e2)){throw new db[(_0x876c('0x50'))][(_0x876c('0x51'))](_0x876c('0x52'));}if(_0x17b788[_0x876c('0x49')]){return _0x1c0580['download'](_0x23f2e2,_0x17b788['filename']+path['extname'](_0x23f2e2),function(){if(_0x4ec0f7){fs[_0x876c('0x53')](_0x23f2e2);}});}else{return _0x1c0580[_0x876c('0x45')](_0x23f2e2,function(_0x206ddf){if(_0x4ec0f7){fs['unlink'](_0x23f2e2);}});}}})[_0x876c('0x3c')](function(_0x3fd51b){if(_0x3fd51b[_0x876c('0x54')]===_0x876c('0x52')){_0x1c0580[_0x876c('0x15')](0x194)[_0x876c('0x55')](_0x876c('0x56'));}else{return handleError(_0x1c0580,null);}});};exports[_0x876c('0x1f')]=function(_0x3923c6,_0x491c7a){return db[_0x876c('0x26')][_0x876c('0x41')]({'where':{'id':_0x3923c6[_0x876c('0x44')]['id']}})['then'](function(_0x3a0fc6){if(_[_0x876c('0x57')](_0x3a0fc6)){throw new ReferenceError(_0x876c('0x58'));}return _0x3a0fc6;})[_0x876c('0x1e')](function(_0x1262f3){var _0x3cc1d0=_0x1262f3[_0x876c('0x48')];logger['info'](_0x876c('0x59'),_0x3cc1d0);if(!_[_0x876c('0x57')](_0x1262f3['savePath'])&&fs[_0x876c('0x4f')](_0x3cc1d0)){logger[_0x876c('0x5a')](_0x876c('0x5b')+_0x3cc1d0+_0x876c('0x5c'));fs[_0x876c('0x5d')](_0x3cc1d0);}_0x3cc1d0=_0x3cc1d0+_0x876c('0x5e');if(!_[_0x876c('0x57')](_0x1262f3['savePath'])&&fs['existsSync'](_0x3cc1d0)){logger['info']('File:\x20\x22'+_0x3cc1d0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3cc1d0);}return _0x1262f3;})['then'](function(_0x943478){if(!_0x943478)throw new InternalError();return _0x943478[_0x876c('0x1f')]();})[_0x876c('0x1e')](function(){_0x491c7a[_0x876c('0x15')](0xcc)[_0x876c('0x16')]();})[_0x876c('0x3c')](handleError(_0x491c7a,null));}; \ No newline at end of file +var _0x17c4=['api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','name','index','map','SquareRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','params','rawAttributes','length','includeAll','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','send','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0xf09f46,_0x19c819){var _0x3c09f4=function(_0x3a7258){while(--_0x3a7258){_0xf09f46['push'](_0xf09f46['shift']());}};_0x3c09f4(++_0x19c819);}(_0x17c4,0x163));var _0x417c=function(_0x4808e0,_0x46806c){_0x4808e0=_0x4808e0-0x0;var _0x16d12a=_0x17c4[_0x4808e0];return _0x16d12a;};'use strict';var emlformat=require(_0x417c('0x0'));var rimraf=require(_0x417c('0x1'));var zipdir=require(_0x417c('0x2'));var jsonpatch=require(_0x417c('0x3'));var rp=require(_0x417c('0x4'));var moment=require('moment');var BPromise=require(_0x417c('0x5'));var Mustache=require(_0x417c('0x6'));var util=require(_0x417c('0x7'));var path=require('path');var sox=require(_0x417c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x417c('0x9'));var _=require(_0x417c('0xa'));var squel=require('squel');var crypto=require(_0x417c('0xb'));var jsforce=require(_0x417c('0xc'));var deskjs=require(_0x417c('0xd'));var toCsv=require(_0x417c('0xe'));var querystring=require(_0x417c('0xf'));var Papa=require(_0x417c('0x10'));var Redis=require('ioredis');var authService=require(_0x417c('0x11'));var qs=require(_0x417c('0x12'));var as=require(_0x417c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x417c('0x14'))(_0x417c('0x15'));var utils=require(_0x417c('0x16'));var config=require(_0x417c('0x17'));var licenseUtil=require(_0x417c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x282371,_0x5e2fff){_0x5e2fff=_0x5e2fff||0xcc;return function(_0x4e5ff3){if(_0x4e5ff3){return _0x282371['sendStatus'](_0x5e2fff);}return _0x282371[_0x417c('0x19')](_0x5e2fff)[_0x417c('0x1a')]();};}function respondWithResult(_0x1a4499,_0x1199a9){_0x1199a9=_0x1199a9||0xc8;return function(_0x17548b){if(_0x17548b){return _0x1a4499[_0x417c('0x19')](_0x1199a9)[_0x417c('0x1b')](_0x17548b);}};}function respondWithFilteredResult(_0x57dc6a,_0x60d77f){return function(_0x34377d){if(_0x34377d){var _0xd94e7=typeof _0x60d77f[_0x417c('0x1c')]===_0x417c('0x1d')&&typeof _0x60d77f[_0x417c('0x1e')]===_0x417c('0x1d');var _0x57142d=_0x34377d['count'];var _0x1931db=_0xd94e7?0x0:_0x60d77f[_0x417c('0x1c')];var _0x596480=_0xd94e7?_0x34377d[_0x417c('0x1f')]:_0x60d77f[_0x417c('0x1c')]+_0x60d77f[_0x417c('0x1e')];var _0x23b281;if(_0x596480>=_0x57142d){_0x596480=_0x57142d;_0x23b281=0xc8;}else{_0x23b281=0xce;}_0x57dc6a[_0x417c('0x19')](_0x23b281);return _0x57dc6a[_0x417c('0x20')](_0x417c('0x21'),_0x1931db+'-'+_0x596480+'/'+_0x57142d)['json'](_0x34377d);}return null;};}function patchUpdates(_0x311fac){return function(_0xbd8814){try{jsonpatch[_0x417c('0x22')](_0xbd8814,_0x311fac,!![]);}catch(_0x5838b6){return BPromise['reject'](_0x5838b6);}return _0xbd8814[_0x417c('0x23')]();};}function saveUpdates(_0x29327d,_0x4719cc){return function(_0x2344ea){if(_0x2344ea){return _0x2344ea[_0x417c('0x24')](_0x29327d)['then'](function(_0x193758){return _0x193758;});}return null;};}function removeEntity(_0x546382,_0x1fe47f){return function(_0x4ddcb3){if(_0x4ddcb3){return _0x4ddcb3[_0x417c('0x25')]()[_0x417c('0x26')](function(){_0x546382['status'](0xcc)[_0x417c('0x1a')]();});}};}function handleEntityNotFound(_0x4557d3,_0x11396c){return function(_0x371f2e){if(!_0x371f2e){_0x4557d3[_0x417c('0x27')](0x194);}return _0x371f2e;};}function handleError(_0x3e287f,_0x1e21da){_0x1e21da=_0x1e21da||0x1f4;return function(_0x34c50c){logger[_0x417c('0x28')](_0x34c50c['stack']);if(_0x34c50c[_0x417c('0x29')]){delete _0x34c50c['name'];}_0x3e287f[_0x417c('0x19')](_0x1e21da)['send'](_0x34c50c);};}exports[_0x417c('0x2a')]=function(_0x498e41,_0x767ec9){var _0x2079bf={},_0xa0d808={},_0x5522a3={'count':0x0,'rows':[]};var _0x32759e=_[_0x417c('0x2b')](db[_0x417c('0x2c')]['rawAttributes'],function(_0x9779fa){return{'name':_0x9779fa[_0x417c('0x2d')],'type':_0x9779fa['type'][_0x417c('0x2e')]};});_0xa0d808[_0x417c('0x2f')]=_[_0x417c('0x2b')](_0x32759e,_0x417c('0x29'));_0xa0d808[_0x417c('0x30')]=_[_0x417c('0x31')](_0x498e41[_0x417c('0x30')]);_0xa0d808[_0x417c('0x32')]=_[_0x417c('0x33')](_0xa0d808['model'],_0xa0d808[_0x417c('0x30')]);_0x2079bf[_0x417c('0x34')]=_[_0x417c('0x33')](_0xa0d808[_0x417c('0x2f')],qs[_0x417c('0x35')](_0x498e41[_0x417c('0x30')]['fields']));_0x2079bf[_0x417c('0x34')]=_0x2079bf[_0x417c('0x34')]['length']?_0x2079bf[_0x417c('0x34')]:_0xa0d808['model'];if(!_0x498e41[_0x417c('0x30')][_0x417c('0x36')](_0x417c('0x37'))){_0x2079bf[_0x417c('0x1e')]=qs[_0x417c('0x1e')](_0x498e41[_0x417c('0x30')][_0x417c('0x1e')]);_0x2079bf['offset']=qs[_0x417c('0x1c')](_0x498e41[_0x417c('0x30')]['offset']);}_0x2079bf[_0x417c('0x38')]=qs[_0x417c('0x39')](_0x498e41[_0x417c('0x30')][_0x417c('0x39')]);_0x2079bf[_0x417c('0x3a')]=qs[_0x417c('0x32')](_[_0x417c('0x3b')](_0x498e41[_0x417c('0x30')],_0xa0d808[_0x417c('0x32')]),_0x32759e);if(_0x498e41[_0x417c('0x30')][_0x417c('0x3c')]){_0x2079bf[_0x417c('0x3a')]=_[_0x417c('0x3d')](_0x2079bf[_0x417c('0x3a')],{'$or':_['map'](_0x32759e,function(_0x32c2a8){if(_0x32c2a8[_0x417c('0x3e')]!==_0x417c('0x3f')){var _0x5483a1={};_0x5483a1[_0x32c2a8[_0x417c('0x29')]]={'$like':'%'+_0x498e41[_0x417c('0x30')][_0x417c('0x3c')]+'%'};return _0x5483a1;}})});}_0x2079bf=_[_0x417c('0x3d')]({},_0x2079bf,_0x498e41[_0x417c('0x40')]);var _0x2eac12={'where':_0x2079bf['where']};return db[_0x417c('0x2c')][_0x417c('0x1f')](_0x2eac12)['then'](function(_0x28faad){_0x5522a3['count']=_0x28faad;if(_0x498e41['query']['includeAll']){_0x2079bf['include']=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x2079bf);})[_0x417c('0x26')](function(_0x516699){_0x5522a3['rows']=_0x516699;return _0x5522a3;})[_0x417c('0x26')](respondWithFilteredResult(_0x767ec9,_0x2079bf))['catch'](handleError(_0x767ec9,null));};exports['show']=function(_0x7c46ec,_0x5896e8){var _0x482b57={'raw':!![],'where':{'id':_0x7c46ec[_0x417c('0x41')]['id']}},_0x368d89={};_0x368d89[_0x417c('0x2f')]=_['keys'](db[_0x417c('0x2c')][_0x417c('0x42')]);_0x368d89[_0x417c('0x30')]=_[_0x417c('0x31')](_0x7c46ec['query']);_0x368d89['filters']=_[_0x417c('0x33')](_0x368d89[_0x417c('0x2f')],_0x368d89[_0x417c('0x30')]);_0x482b57[_0x417c('0x34')]=_[_0x417c('0x33')](_0x368d89[_0x417c('0x2f')],qs[_0x417c('0x35')](_0x7c46ec[_0x417c('0x30')][_0x417c('0x35')]));_0x482b57[_0x417c('0x34')]=_0x482b57[_0x417c('0x34')][_0x417c('0x43')]?_0x482b57[_0x417c('0x34')]:_0x368d89[_0x417c('0x2f')];if(_0x7c46ec[_0x417c('0x30')][_0x417c('0x44')]){_0x482b57['include']=[{'all':!![]}];}_0x482b57=_[_0x417c('0x3d')]({},_0x482b57,_0x7c46ec[_0x417c('0x40')]);return db['SquareRecording'][_0x417c('0x45')](_0x482b57)[_0x417c('0x26')](handleEntityNotFound(_0x5896e8,null))[_0x417c('0x26')](respondWithResult(_0x5896e8,null))[_0x417c('0x46')](handleError(_0x5896e8,null));};exports[_0x417c('0x47')]=function(_0x9706c9,_0x4b2f8f){return db[_0x417c('0x2c')][_0x417c('0x47')](_0x9706c9[_0x417c('0x48')],{})[_0x417c('0x26')](respondWithResult(_0x4b2f8f,0xc9))[_0x417c('0x46')](handleError(_0x4b2f8f,null));};exports[_0x417c('0x24')]=function(_0x23a0c0,_0x14e963){if(_0x23a0c0['body']['id']){delete _0x23a0c0[_0x417c('0x48')]['id'];}return db[_0x417c('0x2c')][_0x417c('0x45')]({'where':{'id':_0x23a0c0[_0x417c('0x41')]['id']}})['then'](handleEntityNotFound(_0x14e963,null))[_0x417c('0x26')](saveUpdates(_0x23a0c0[_0x417c('0x48')],null))[_0x417c('0x26')](respondWithResult(_0x14e963,null))[_0x417c('0x46')](handleError(_0x14e963,null));};exports[_0x417c('0x49')]=function(_0x5572f4,_0x175109,_0x495d8f){var _0x4a0c93=require(_0x417c('0x4a'));var _0x3b5079=![];var _0x19c30e={};if(_0x5572f4[_0x417c('0x30')]['type']&&_0x5572f4['query']['type']==='uniqueid'){_0x19c30e[_0x417c('0x4b')]=_0x5572f4[_0x417c('0x41')]['id'];}else{_0x19c30e['id']=_0x5572f4[_0x417c('0x41')]['id'];}return db[_0x417c('0x2c')][_0x417c('0x45')]({'where':_0x19c30e,'attributes':['id',_0x417c('0x4c'),_0x417c('0x4d')],'raw':!![]})[_0x417c('0x26')](handleEntityNotFound(_0x175109,null))['then'](function(_0x234122){if(_0x234122){var _0x1b0cc4=_0x234122[_0x417c('0x4c')];var _0x593aec=util[_0x417c('0x4e')]('%s.cypher',_0x1b0cc4);if(fs[_0x417c('0x4f')](_0x593aec)){_0x3b5079=!![];return _0x4a0c93[_0x417c('0x50')](_0x593aec,_0x1b0cc4,config[_0x417c('0x51')][_0x417c('0x52')])[_0x417c('0x26')](function(){return _0x234122;});}return _0x234122;}})[_0x417c('0x26')](function(_0x55bcc8){if(_0x55bcc8){var _0x1ae2ff=_0x55bcc8['savePath'];if(!fs['existsSync'](_0x1ae2ff)){throw new db[(_0x417c('0x53'))][(_0x417c('0x54'))]('SquareRecording\x20not\x20found');}if(_0x55bcc8[_0x417c('0x4d')]){return _0x175109[_0x417c('0x49')](_0x1ae2ff,_0x55bcc8[_0x417c('0x4d')]+path[_0x417c('0x55')](_0x1ae2ff),function(){if(_0x3b5079){fs['unlink'](_0x1ae2ff);}});}else{return _0x175109[_0x417c('0x49')](_0x1ae2ff,function(_0x5ecde7){if(_0x3b5079){fs['unlink'](_0x1ae2ff);}});}}})[_0x417c('0x46')](function(_0x27d772){if(_0x27d772['message']==='SquareRecording\x20not\x20found'){_0x175109[_0x417c('0x19')](0x194)[_0x417c('0x56')](_0x417c('0x57'));}else{return handleError(_0x175109,null);}});};exports[_0x417c('0x25')]=function(_0x3000ce,_0x450baf){return db[_0x417c('0x2c')]['find']({'where':{'id':_0x3000ce['params']['id']}})[_0x417c('0x26')](function(_0x36d768){if(_[_0x417c('0x58')](_0x36d768)){throw new ReferenceError('Entity\x20not\x20found');}return _0x36d768;})[_0x417c('0x26')](function(_0x22802d){var _0x50ed86=_0x22802d[_0x417c('0x4c')];logger[_0x417c('0x59')]('cancellazione\x20fisica\x20documento\x20%s',_0x50ed86);if(!_[_0x417c('0x58')](_0x22802d[_0x417c('0x4c')])&&fs[_0x417c('0x4f')](_0x50ed86)){logger['info'](_0x417c('0x5a')+_0x50ed86+_0x417c('0x5b'));fs['unlinkSync'](_0x50ed86);}_0x50ed86=_0x50ed86+_0x417c('0x5c');if(!_['isNil'](_0x22802d[_0x417c('0x4c')])&&fs[_0x417c('0x4f')](_0x50ed86)){logger[_0x417c('0x59')](_0x417c('0x5a')+_0x50ed86+_0x417c('0x5b'));fs[_0x417c('0x5d')](_0x50ed86);}return _0x22802d;})[_0x417c('0x26')](function(_0x2d5a37){if(!_0x2d5a37)throw new InternalError();return _0x2d5a37[_0x417c('0x25')]();})[_0x417c('0x26')](function(){_0x450baf[_0x417c('0x19')](0xcc)[_0x417c('0x1a')]();})['catch'](handleError(_0x450baf,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 96698fc..c42ace7 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 _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording'];(function(_0x40d722,_0x5ab18c){var _0x232ffa=function(_0x2a8ade){while(--_0x2a8ade){_0x40d722['push'](_0x40d722['shift']());}};_0x232ffa(++_0x5ab18c);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2d4661,_0x2da65c){_0x2d4661=_0x2d4661-0x0;var _0x42ed1e=_0xfcf0[_0x2d4661];return _0x42ed1e;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe829=['define','SquareRecording','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5bb34e,_0x14cdb1){var _0x250343=function(_0x25c434){while(--_0x25c434){_0x5bb34e['push'](_0x5bb34e['shift']());}};_0x250343(++_0x14cdb1);}(_0xe829,0xde));var _0x9e82=function(_0x44e4a1,_0x3d053a){_0x44e4a1=_0x44e4a1-0x0;var _0x546ad3=_0xe829[_0x44e4a1];return _0x546ad3;};'use strict';var _=require('lodash');var util=require(_0x9e82('0x0'));var logger=require(_0x9e82('0x1'))(_0x9e82('0x2'));var moment=require(_0x9e82('0x3'));var BPromise=require(_0x9e82('0x4'));var rp=require(_0x9e82('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e82('0x6'));var config=require(_0x9e82('0x7'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x4b8d53,_0x46f5db){return _0x4b8d53[_0x9e82('0x8')](_0x9e82('0x9'),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 e12138e..949ff4b 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 _0xbbe1=['jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','CreateSquareRecording','SquareRecording','create','options','raw','debug','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x4596ef,_0x45cee0){var _0x456205=function(_0x528b20){while(--_0x528b20){_0x4596ef['push'](_0x4596ef['shift']());}};_0x456205(++_0x45cee0);}(_0xbbe1,0x11a));var _0x1bbe=function(_0x439662,_0x5defdb){_0x439662=_0x439662-0x0;var _0x251ec4=_0xbbe1[_0x439662];return _0x251ec4;};'use strict';var _=require('lodash');var util=require(_0x1bbe('0x0'));var moment=require('moment');var BPromise=require(_0x1bbe('0x1'));var rs=require(_0x1bbe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1bbe('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1bbe('0x4'))(_0x1bbe('0x5'));var config=require('../../config/environment');var jayson=require(_0x1bbe('0x6'));var client=jayson[_0x1bbe('0x7')][_0x1bbe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x495c58,_0x2a88e9,_0xd70df0){return new BPromise(function(_0x4bb66c,_0x1b5c28){return client[_0x1bbe('0x9')](_0x495c58,_0xd70df0)[_0x1bbe('0xa')](function(_0x1c46b5){logger[_0x1bbe('0xb')]('SquareRecording,\x20%s,\x20%s',_0x2a88e9,'request\x20sent');logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2a88e9,_0x1bbe('0xc'),JSON[_0x1bbe('0xd')](_0x1c46b5));if(_0x1c46b5[_0x1bbe('0xe')]){if(_0x1c46b5[_0x1bbe('0xe')][_0x1bbe('0xf')]===0x1f4){logger['error'](_0x1bbe('0x10'),_0x2a88e9,_0x1c46b5[_0x1bbe('0xe')][_0x1bbe('0x11')]);return _0x1b5c28(_0x1c46b5[_0x1bbe('0xe')]['message']);}logger[_0x1bbe('0xe')]('SquareRecording,\x20%s,\x20%s',_0x2a88e9,_0x1c46b5[_0x1bbe('0xe')][_0x1bbe('0x11')]);return _0x4bb66c(_0x1c46b5[_0x1bbe('0xe')]['message']);}else{logger['info'](_0x1bbe('0x10'),_0x2a88e9,_0x1bbe('0xc'));_0x4bb66c(_0x1c46b5['result'][_0x1bbe('0x11')]);}})['catch'](function(_0x173af9){logger['error']('SquareRecording,\x20%s,\x20%s',_0x2a88e9,_0x173af9);_0x1b5c28(_0x173af9);});});}exports[_0x1bbe('0x12')]=function(_0x119d6d){var _0x2b61a4=this;return new Promise(function(_0x2072eb,_0x11cf21){return db[_0x1bbe('0x13')][_0x1bbe('0x14')](_0x119d6d['body'],{'raw':_0x119d6d[_0x1bbe('0x15')]?_0x119d6d['options'][_0x1bbe('0x16')]===undefined?!![]:![]:!![]})[_0x1bbe('0xa')](function(_0x8cdd3b){logger['info'](_0x1bbe('0x12'),_0x119d6d);logger[_0x1bbe('0x17')](_0x1bbe('0x12'),_0x119d6d,JSON[_0x1bbe('0xd')](_0x8cdd3b));_0x2072eb(_0x8cdd3b);})['catch'](function(_0x1274bd){logger[_0x1bbe('0xe')](_0x1bbe('0x12'),_0x1274bd[_0x1bbe('0x11')],_0x119d6d);_0x11cf21(_0x2b61a4[_0x1bbe('0xe')](0x1f4,_0x1274bd[_0x1bbe('0x11')]));});});}; \ No newline at end of file +var _0x4908=['message','info','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e8679,_0x549b9b){var _0x94a8e4=function(_0x4ef09e){while(--_0x4ef09e){_0x4e8679['push'](_0x4e8679['shift']());}};_0x94a8e4(++_0x549b9b);}(_0x4908,0xea));var _0x8490=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x4908[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x8490('0x0'));var util=require('util');var moment=require(_0x8490('0x1'));var BPromise=require(_0x8490('0x2'));var rs=require(_0x8490('0x3'));var fs=require('fs');var Redis=require(_0x8490('0x4'));var db=require(_0x8490('0x5'))['db'];var utils=require(_0x8490('0x6'));var logger=require(_0x8490('0x7'))(_0x8490('0x8'));var config=require(_0x8490('0x9'));var jayson=require(_0x8490('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50d649,_0x297b66,_0x21e440){return new BPromise(function(_0x41baea,_0x236387){return client['request'](_0x50d649,_0x21e440)['then'](function(_0x5ec638){logger['info'](_0x8490('0xb'),_0x297b66,_0x8490('0xc'));logger[_0x8490('0xd')](_0x8490('0xe'),_0x297b66,_0x8490('0xc'),JSON[_0x8490('0xf')](_0x5ec638));if(_0x5ec638[_0x8490('0x10')]){if(_0x5ec638[_0x8490('0x10')][_0x8490('0x11')]===0x1f4){logger[_0x8490('0x10')](_0x8490('0xb'),_0x297b66,_0x5ec638[_0x8490('0x10')][_0x8490('0x12')]);return _0x236387(_0x5ec638[_0x8490('0x10')][_0x8490('0x12')]);}logger[_0x8490('0x10')]('SquareRecording,\x20%s,\x20%s',_0x297b66,_0x5ec638[_0x8490('0x10')][_0x8490('0x12')]);return _0x41baea(_0x5ec638[_0x8490('0x10')][_0x8490('0x12')]);}else{logger[_0x8490('0x13')](_0x8490('0xb'),_0x297b66,'request\x20sent');_0x41baea(_0x5ec638[_0x8490('0x14')][_0x8490('0x12')]);}})[_0x8490('0x15')](function(_0x1bfd0a){logger['error'](_0x8490('0xb'),_0x297b66,_0x1bfd0a);_0x236387(_0x1bfd0a);});});}exports[_0x8490('0x16')]=function(_0x150a26){var _0x288281=this;return new Promise(function(_0x2840e3,_0x51cf29){return db[_0x8490('0x17')][_0x8490('0x18')](_0x150a26['body'],{'raw':_0x150a26['options']?_0x150a26[_0x8490('0x19')][_0x8490('0x1a')]===undefined?!![]:![]:!![]})[_0x8490('0x1b')](function(_0x159ddd){logger['info']('CreateSquareRecording',_0x150a26);logger[_0x8490('0xd')](_0x8490('0x16'),_0x150a26,JSON['stringify'](_0x159ddd));_0x2840e3(_0x159ddd);})['catch'](function(_0x5c7c48){logger[_0x8490('0x10')](_0x8490('0x16'),_0x5c7c48[_0x8490('0x12')],_0x150a26);_0x51cf29(_0x288281[_0x8490('0x10')](0x1f4,_0x5c7c48[_0x8490('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 4883f83..99120fb 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x16887c,_0x3688bf){var _0x2d21bb=function(_0x4e35ba){while(--_0x4e35ba){_0x16887c['push'](_0x16887c['shift']());}};_0x2d21bb(++_0x3688bf);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _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(_0xac075f,_0x294a2d){var _0x218f51=function(_0x1c1887){while(--_0x1c1887){_0xac075f['push'](_0xac075f['shift']());}};_0x218f51(++_0x294a2d);}(_0xb10b,0x12a));var _0xbb10=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0xb10b[_0x946518];return _0x909b69;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 503d548..428a4ba 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 _0x4741=['exports','STRING','DATE','sequelize'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x4741,0x67));var _0x1474=function(_0x16e2a0,_0x499f26){_0x16e2a0=_0x16e2a0-0x0;var _0x582f15=_0x4741[_0x16e2a0];return _0x582f15;};'use strict';var Sequelize=require(_0x1474('0x0'));module[_0x1474('0x1')]={'network':{'type':Sequelize[_0x1474('0x2')]},'network_script':{'type':Sequelize[_0x1474('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1474('0x2')]},'language':{'type':Sequelize[_0x1474('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1474('0x2')]},'version':{'type':Sequelize[_0x1474('0x2')]},'callerid':{'type':Sequelize[_0x1474('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x1474('0x2')]},'callingtns':{'type':Sequelize[_0x1474('0x2')]},'dnid':{'type':Sequelize[_0x1474('0x2')]},'rdnis':{'type':Sequelize[_0x1474('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x1474('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1474('0x2')]},'accountcode':{'type':Sequelize[_0x1474('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1474('0x3')]},'leaveAt':{'type':Sequelize[_0x1474('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3f2e=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x3f2e,0x143));var _0xe3f2=function(_0x3495e7,_0x2f6a1f){_0x3495e7=_0x3495e7-0x0;var _0x5cbb6f=_0x3f2e[_0x3495e7];return _0x5cbb6f;};'use strict';var Sequelize=require(_0xe3f2('0x0'));module[_0xe3f2('0x1')]={'network':{'type':Sequelize[_0xe3f2('0x2')]},'network_script':{'type':Sequelize[_0xe3f2('0x2')]},'request':{'type':Sequelize[_0xe3f2('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe3f2('0x2')]},'uniqueid':{'type':Sequelize[_0xe3f2('0x2')]},'version':{'type':Sequelize[_0xe3f2('0x2')]},'callerid':{'type':Sequelize[_0xe3f2('0x2')]},'calleridname':{'type':Sequelize[_0xe3f2('0x2')]},'callingpres':{'type':Sequelize[_0xe3f2('0x2')]},'callingani2':{'type':Sequelize[_0xe3f2('0x2')]},'callington':{'type':Sequelize[_0xe3f2('0x2')]},'callingtns':{'type':Sequelize[_0xe3f2('0x2')]},'dnid':{'type':Sequelize[_0xe3f2('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe3f2('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe3f2('0x2')]},'enhanced':{'type':Sequelize[_0xe3f2('0x2')]},'accountcode':{'type':Sequelize[_0xe3f2('0x2')]},'threadid':{'type':Sequelize[_0xe3f2('0x2')]},'project_name':{'type':Sequelize[_0xe3f2('0x2')]},'joinAt':{'type':Sequelize[_0xe3f2('0x3')]},'leaveAt':{'type':Sequelize[_0xe3f2('0x3')]},'bot':{'type':Sequelize[_0xe3f2('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index a62b8c5..10c291b 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 _0x1516=['json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','send','index','map','SquareReport','rawAttributes','fieldName','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','zip-dir','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x20241e,_0x189bc0){var _0x17e8a8=function(_0x58814f){while(--_0x58814f){_0x20241e['push'](_0x20241e['shift']());}};_0x17e8a8(++_0x189bc0);}(_0x1516,0x151));var _0x6151=function(_0x3af697,_0x4adfb8){_0x3af697=_0x3af697-0x0;var _0x46f740=_0x1516[_0x3af697];return _0x46f740;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6151('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6151('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6151('0x2'));var util=require(_0x6151('0x3'));var path=require(_0x6151('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6151('0x5'));var fs=require('fs');var fs_extra=require(_0x6151('0x6'));var _=require(_0x6151('0x7'));var squel=require(_0x6151('0x8'));var crypto=require(_0x6151('0x9'));var jsforce=require(_0x6151('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6151('0xb'));var Papa=require(_0x6151('0xc'));var Redis=require(_0x6151('0xd'));var authService=require(_0x6151('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6151('0xf'));var hardwareService=require(_0x6151('0x10'));var logger=require('../../config/logger')(_0x6151('0x11'));var utils=require(_0x6151('0x12'));var config=require(_0x6151('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6151('0x14'))['db'];function respondWithStatusCode(_0x5adb1a,_0x8d605a){_0x8d605a=_0x8d605a||0xcc;return function(_0x24d343){if(_0x24d343){return _0x5adb1a['sendStatus'](_0x8d605a);}return _0x5adb1a[_0x6151('0x15')](_0x8d605a)[_0x6151('0x16')]();};}function respondWithResult(_0x153e3b,_0x28e587){_0x28e587=_0x28e587||0xc8;return function(_0x4d16e8){if(_0x4d16e8){return _0x153e3b['status'](_0x28e587)[_0x6151('0x17')](_0x4d16e8);}};}function respondWithFilteredResult(_0x596a34,_0x1fa43f){return function(_0x8e4e3e){if(_0x8e4e3e){var _0x3f2719=typeof _0x1fa43f[_0x6151('0x18')]===_0x6151('0x19')&&typeof _0x1fa43f[_0x6151('0x1a')]===_0x6151('0x19');var _0x892804=_0x8e4e3e[_0x6151('0x1b')];var _0x1d6ec7=_0x3f2719?0x0:_0x1fa43f[_0x6151('0x18')];var _0x3ef962=_0x3f2719?_0x8e4e3e[_0x6151('0x1b')]:_0x1fa43f['offset']+_0x1fa43f['limit'];var _0x28598f;if(_0x3ef962>=_0x892804){_0x3ef962=_0x892804;_0x28598f=0xc8;}else{_0x28598f=0xce;}_0x596a34['status'](_0x28598f);return _0x596a34[_0x6151('0x1c')](_0x6151('0x1d'),_0x1d6ec7+'-'+_0x3ef962+'/'+_0x892804)[_0x6151('0x17')](_0x8e4e3e);}return null;};}function patchUpdates(_0x2cecf0){return function(_0x16ba6e){try{jsonpatch['apply'](_0x16ba6e,_0x2cecf0,!![]);}catch(_0xfb5504){return BPromise['reject'](_0xfb5504);}return _0x16ba6e[_0x6151('0x1e')]();};}function saveUpdates(_0x4fad02,_0x2700d8){return function(_0x282e71){if(_0x282e71){return _0x282e71[_0x6151('0x1f')](_0x4fad02)[_0x6151('0x20')](function(_0x3ec4d6){return _0x3ec4d6;});}return null;};}function removeEntity(_0x61de45,_0x1ee89d){return function(_0xfcea22){if(_0xfcea22){return _0xfcea22[_0x6151('0x21')]()[_0x6151('0x20')](function(){_0x61de45[_0x6151('0x15')](0xcc)[_0x6151('0x16')]();});}};}function handleEntityNotFound(_0x434108,_0x405325){return function(_0x3c7197){if(!_0x3c7197){_0x434108[_0x6151('0x22')](0x194);}return _0x3c7197;};}function handleError(_0x5c9ddc,_0x40ae94){_0x40ae94=_0x40ae94||0x1f4;return function(_0x5d1f54){logger[_0x6151('0x23')](_0x5d1f54['stack']);if(_0x5d1f54['name']){delete _0x5d1f54['name'];}_0x5c9ddc[_0x6151('0x15')](_0x40ae94)[_0x6151('0x24')](_0x5d1f54);};}exports[_0x6151('0x25')]=function(_0x387d37,_0x25af78){var _0x4da196={},_0x1ac87d={},_0x2d0153={'count':0x0,'rows':[]};var _0x4ff165=_[_0x6151('0x26')](db[_0x6151('0x27')][_0x6151('0x28')],function(_0x3cc432){return{'name':_0x3cc432[_0x6151('0x29')],'type':_0x3cc432[_0x6151('0x2a')]['key']};});_0x1ac87d[_0x6151('0x2b')]=_[_0x6151('0x26')](_0x4ff165,_0x6151('0x2c'));_0x1ac87d[_0x6151('0x2d')]=_['keys'](_0x387d37[_0x6151('0x2d')]);_0x1ac87d[_0x6151('0x2e')]=_['intersection'](_0x1ac87d[_0x6151('0x2b')],_0x1ac87d['query']);_0x4da196['attributes']=_[_0x6151('0x2f')](_0x1ac87d[_0x6151('0x2b')],qs[_0x6151('0x30')](_0x387d37['query'][_0x6151('0x30')]));_0x4da196[_0x6151('0x31')]=_0x4da196[_0x6151('0x31')][_0x6151('0x32')]?_0x4da196['attributes']:_0x1ac87d[_0x6151('0x2b')];if(!_0x387d37[_0x6151('0x2d')][_0x6151('0x33')](_0x6151('0x34'))){_0x4da196[_0x6151('0x1a')]=qs[_0x6151('0x1a')](_0x387d37[_0x6151('0x2d')][_0x6151('0x1a')]);_0x4da196[_0x6151('0x18')]=qs[_0x6151('0x18')](_0x387d37[_0x6151('0x2d')][_0x6151('0x18')]);}_0x4da196[_0x6151('0x35')]=qs['sort'](_0x387d37[_0x6151('0x2d')][_0x6151('0x36')]);_0x4da196[_0x6151('0x37')]=qs[_0x6151('0x2e')](_[_0x6151('0x38')](_0x387d37[_0x6151('0x2d')],_0x1ac87d[_0x6151('0x2e')]),_0x4ff165);if(_0x387d37[_0x6151('0x2d')][_0x6151('0x39')]){_0x4da196[_0x6151('0x37')]=_[_0x6151('0x3a')](_0x4da196['where'],{'$or':_[_0x6151('0x26')](_0x4ff165,function(_0x12736a){if(_0x12736a['type']!=='VIRTUAL'){var _0x5b8456={};_0x5b8456[_0x12736a[_0x6151('0x2c')]]={'$like':'%'+_0x387d37[_0x6151('0x2d')][_0x6151('0x39')]+'%'};return _0x5b8456;}})});}_0x4da196=_[_0x6151('0x3a')]({},_0x4da196,_0x387d37[_0x6151('0x3b')]);var _0x4223ef={'where':_0x4da196[_0x6151('0x37')]};return db[_0x6151('0x27')][_0x6151('0x1b')](_0x4223ef)[_0x6151('0x20')](function(_0x46e6f6){_0x2d0153[_0x6151('0x1b')]=_0x46e6f6;if(_0x387d37[_0x6151('0x2d')][_0x6151('0x3c')]){_0x4da196[_0x6151('0x3d')]=[{'all':!![]}];}return db[_0x6151('0x27')][_0x6151('0x3e')](_0x4da196);})[_0x6151('0x20')](function(_0x4856f7){_0x2d0153[_0x6151('0x3f')]=_0x4856f7;return _0x2d0153;})[_0x6151('0x20')](respondWithFilteredResult(_0x25af78,_0x4da196))[_0x6151('0x40')](handleError(_0x25af78,null));};exports[_0x6151('0x41')]=function(_0x4c7e08,_0x4a0346){var _0x30e952={'raw':!![],'where':{'id':_0x4c7e08[_0x6151('0x42')]['id']}},_0x45c0be={};_0x45c0be['model']=_[_0x6151('0x43')](db[_0x6151('0x27')][_0x6151('0x28')]);_0x45c0be['query']=_['keys'](_0x4c7e08[_0x6151('0x2d')]);_0x45c0be[_0x6151('0x2e')]=_[_0x6151('0x2f')](_0x45c0be[_0x6151('0x2b')],_0x45c0be[_0x6151('0x2d')]);_0x30e952[_0x6151('0x31')]=_['intersection'](_0x45c0be[_0x6151('0x2b')],qs[_0x6151('0x30')](_0x4c7e08[_0x6151('0x2d')]['fields']));_0x30e952['attributes']=_0x30e952[_0x6151('0x31')][_0x6151('0x32')]?_0x30e952[_0x6151('0x31')]:_0x45c0be[_0x6151('0x2b')];if(_0x4c7e08[_0x6151('0x2d')][_0x6151('0x3c')]){_0x30e952[_0x6151('0x3d')]=[{'all':!![]}];}_0x30e952=_[_0x6151('0x3a')]({},_0x30e952,_0x4c7e08['options']);return db[_0x6151('0x27')][_0x6151('0x44')](_0x30e952)[_0x6151('0x20')](handleEntityNotFound(_0x4a0346,null))[_0x6151('0x20')](respondWithResult(_0x4a0346,null))[_0x6151('0x40')](handleError(_0x4a0346,null));};exports[_0x6151('0x45')]=function(_0x2a04ed,_0xc783de){return db[_0x6151('0x27')][_0x6151('0x45')](_0x2a04ed[_0x6151('0x46')],{})[_0x6151('0x20')](respondWithResult(_0xc783de,0xc9))[_0x6151('0x40')](handleError(_0xc783de,null));};exports[_0x6151('0x1f')]=function(_0x11d70c,_0x2050a7){if(_0x11d70c[_0x6151('0x46')]['id']){delete _0x11d70c[_0x6151('0x46')]['id'];}return db[_0x6151('0x27')][_0x6151('0x44')]({'where':{'id':_0x11d70c['params']['id']}})['then'](handleEntityNotFound(_0x2050a7,null))['then'](saveUpdates(_0x11d70c[_0x6151('0x46')],null))[_0x6151('0x20')](respondWithResult(_0x2050a7,null))[_0x6151('0x40')](handleError(_0x2050a7,null));};exports['destroy']=function(_0x3786e8,_0x176b9b){return db['SquareReport']['find']({'where':{'id':_0x3786e8['params']['id']}})[_0x6151('0x20')](handleEntityNotFound(_0x176b9b,null))[_0x6151('0x20')](removeEntity(_0x176b9b,null))['catch'](handleError(_0x176b9b,null));};exports[_0x6151('0x47')]=function(_0x33ab95,_0x33f990){return db[_0x6151('0x27')]['describe']()['then'](respondWithResult(_0x33f990,null))[_0x6151('0x40')](handleError(_0x33f990,null));}; \ No newline at end of file +var _0x3c33=['apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x2a4345,_0x3791fa){var _0x398cb1=function(_0x3d2084){while(--_0x3d2084){_0x2a4345['push'](_0x2a4345['shift']());}};_0x398cb1(++_0x3791fa);}(_0x3c33,0x10e));var _0x33c3=function(_0x3aa0b1,_0x372e9d){_0x3aa0b1=_0x3aa0b1-0x0;var _0x30ec46=_0x3c33[_0x3aa0b1];return _0x30ec46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33c3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33c3('0x1'));var rp=require(_0x33c3('0x2'));var moment=require(_0x33c3('0x3'));var BPromise=require(_0x33c3('0x4'));var Mustache=require(_0x33c3('0x5'));var util=require(_0x33c3('0x6'));var path=require('path');var sox=require(_0x33c3('0x7'));var csv=require(_0x33c3('0x8'));var ejs=require(_0x33c3('0x9'));var fs=require('fs');var fs_extra=require(_0x33c3('0xa'));var _=require('lodash');var squel=require(_0x33c3('0xb'));var crypto=require(_0x33c3('0xc'));var jsforce=require(_0x33c3('0xd'));var deskjs=require(_0x33c3('0xe'));var toCsv=require(_0x33c3('0x8'));var querystring=require(_0x33c3('0xf'));var Papa=require(_0x33c3('0x10'));var Redis=require('ioredis');var authService=require(_0x33c3('0x11'));var qs=require(_0x33c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33c3('0x13'));var logger=require(_0x33c3('0x14'))(_0x33c3('0x15'));var utils=require('../../config/utils');var config=require(_0x33c3('0x16'));var licenseUtil=require(_0x33c3('0x17'));var db=require(_0x33c3('0x18'))['db'];function respondWithStatusCode(_0x5b3e00,_0x55ff77){_0x55ff77=_0x55ff77||0xcc;return function(_0x3c5bd9){if(_0x3c5bd9){return _0x5b3e00[_0x33c3('0x19')](_0x55ff77);}return _0x5b3e00['status'](_0x55ff77)[_0x33c3('0x1a')]();};}function respondWithResult(_0x48010a,_0x29ca9c){_0x29ca9c=_0x29ca9c||0xc8;return function(_0xe08fa){if(_0xe08fa){return _0x48010a[_0x33c3('0x1b')](_0x29ca9c)[_0x33c3('0x1c')](_0xe08fa);}};}function respondWithFilteredResult(_0x184ebd,_0x4fdde6){return function(_0x4e967c){if(_0x4e967c){var _0x410bd6=typeof _0x4fdde6['offset']==='undefined'&&typeof _0x4fdde6['limit']==='undefined';var _0x122192=_0x4e967c[_0x33c3('0x1d')];var _0x530cbd=_0x410bd6?0x0:_0x4fdde6[_0x33c3('0x1e')];var _0x310bd1=_0x410bd6?_0x4e967c[_0x33c3('0x1d')]:_0x4fdde6['offset']+_0x4fdde6[_0x33c3('0x1f')];var _0x5356f9;if(_0x310bd1>=_0x122192){_0x310bd1=_0x122192;_0x5356f9=0xc8;}else{_0x5356f9=0xce;}_0x184ebd[_0x33c3('0x1b')](_0x5356f9);return _0x184ebd[_0x33c3('0x20')](_0x33c3('0x21'),_0x530cbd+'-'+_0x310bd1+'/'+_0x122192)[_0x33c3('0x1c')](_0x4e967c);}return null;};}function patchUpdates(_0x70d73d){return function(_0x34eb6f){try{jsonpatch[_0x33c3('0x22')](_0x34eb6f,_0x70d73d,!![]);}catch(_0x5db7a9){return BPromise[_0x33c3('0x23')](_0x5db7a9);}return _0x34eb6f[_0x33c3('0x24')]();};}function saveUpdates(_0x4e8486,_0x2f5732){return function(_0x260a47){if(_0x260a47){return _0x260a47['update'](_0x4e8486)[_0x33c3('0x25')](function(_0x5b82f4){return _0x5b82f4;});}return null;};}function removeEntity(_0x2627d3,_0x8d23fc){return function(_0x45d3b4){if(_0x45d3b4){return _0x45d3b4[_0x33c3('0x26')]()[_0x33c3('0x25')](function(){_0x2627d3[_0x33c3('0x1b')](0xcc)[_0x33c3('0x1a')]();});}};}function handleEntityNotFound(_0x864ade,_0x417ca3){return function(_0x1f4cf5){if(!_0x1f4cf5){_0x864ade[_0x33c3('0x19')](0x194);}return _0x1f4cf5;};}function handleError(_0x5a0c10,_0x484be6){_0x484be6=_0x484be6||0x1f4;return function(_0x551831){logger[_0x33c3('0x27')](_0x551831[_0x33c3('0x28')]);if(_0x551831[_0x33c3('0x29')]){delete _0x551831['name'];}_0x5a0c10[_0x33c3('0x1b')](_0x484be6)[_0x33c3('0x2a')](_0x551831);};}exports[_0x33c3('0x2b')]=function(_0x387a72,_0x452b3c){var _0xf4151f={},_0x21fd8e={},_0x3aad36={'count':0x0,'rows':[]};var _0x31aeb8=_[_0x33c3('0x2c')](db[_0x33c3('0x2d')][_0x33c3('0x2e')],function(_0x294a3f){return{'name':_0x294a3f[_0x33c3('0x2f')],'type':_0x294a3f[_0x33c3('0x30')]['key']};});_0x21fd8e[_0x33c3('0x31')]=_[_0x33c3('0x2c')](_0x31aeb8,'name');_0x21fd8e[_0x33c3('0x32')]=_[_0x33c3('0x33')](_0x387a72['query']);_0x21fd8e[_0x33c3('0x34')]=_[_0x33c3('0x35')](_0x21fd8e['model'],_0x21fd8e['query']);_0xf4151f['attributes']=_[_0x33c3('0x35')](_0x21fd8e[_0x33c3('0x31')],qs[_0x33c3('0x36')](_0x387a72['query'][_0x33c3('0x36')]));_0xf4151f['attributes']=_0xf4151f[_0x33c3('0x37')][_0x33c3('0x38')]?_0xf4151f['attributes']:_0x21fd8e['model'];if(!_0x387a72['query'][_0x33c3('0x39')](_0x33c3('0x3a'))){_0xf4151f['limit']=qs[_0x33c3('0x1f')](_0x387a72[_0x33c3('0x32')][_0x33c3('0x1f')]);_0xf4151f[_0x33c3('0x1e')]=qs[_0x33c3('0x1e')](_0x387a72[_0x33c3('0x32')][_0x33c3('0x1e')]);}_0xf4151f['order']=qs[_0x33c3('0x3b')](_0x387a72[_0x33c3('0x32')][_0x33c3('0x3b')]);_0xf4151f['where']=qs[_0x33c3('0x34')](_[_0x33c3('0x3c')](_0x387a72['query'],_0x21fd8e['filters']),_0x31aeb8);if(_0x387a72[_0x33c3('0x32')]['filter']){_0xf4151f[_0x33c3('0x3d')]=_[_0x33c3('0x3e')](_0xf4151f[_0x33c3('0x3d')],{'$or':_[_0x33c3('0x2c')](_0x31aeb8,function(_0xb2c5fc){if(_0xb2c5fc[_0x33c3('0x30')]!==_0x33c3('0x3f')){var _0x2e2b11={};_0x2e2b11[_0xb2c5fc[_0x33c3('0x29')]]={'$like':'%'+_0x387a72[_0x33c3('0x32')]['filter']+'%'};return _0x2e2b11;}})});}_0xf4151f=_[_0x33c3('0x3e')]({},_0xf4151f,_0x387a72['options']);var _0x1ae881={'where':_0xf4151f[_0x33c3('0x3d')]};return db['SquareReport'][_0x33c3('0x1d')](_0x1ae881)[_0x33c3('0x25')](function(_0x5883f9){_0x3aad36['count']=_0x5883f9;if(_0x387a72[_0x33c3('0x32')]['includeAll']){_0xf4151f[_0x33c3('0x40')]=[{'all':!![]}];}return db[_0x33c3('0x2d')][_0x33c3('0x41')](_0xf4151f);})[_0x33c3('0x25')](function(_0x33afeb){_0x3aad36[_0x33c3('0x42')]=_0x33afeb;return _0x3aad36;})[_0x33c3('0x25')](respondWithFilteredResult(_0x452b3c,_0xf4151f))[_0x33c3('0x43')](handleError(_0x452b3c,null));};exports[_0x33c3('0x44')]=function(_0x252ed3,_0x36cf63){var _0x5809d3={'raw':!![],'where':{'id':_0x252ed3[_0x33c3('0x45')]['id']}},_0x43293a={};_0x43293a[_0x33c3('0x31')]=_[_0x33c3('0x33')](db[_0x33c3('0x2d')]['rawAttributes']);_0x43293a[_0x33c3('0x32')]=_[_0x33c3('0x33')](_0x252ed3[_0x33c3('0x32')]);_0x43293a[_0x33c3('0x34')]=_[_0x33c3('0x35')](_0x43293a['model'],_0x43293a[_0x33c3('0x32')]);_0x5809d3[_0x33c3('0x37')]=_[_0x33c3('0x35')](_0x43293a[_0x33c3('0x31')],qs[_0x33c3('0x36')](_0x252ed3[_0x33c3('0x32')][_0x33c3('0x36')]));_0x5809d3['attributes']=_0x5809d3['attributes'][_0x33c3('0x38')]?_0x5809d3[_0x33c3('0x37')]:_0x43293a['model'];if(_0x252ed3['query']['includeAll']){_0x5809d3[_0x33c3('0x40')]=[{'all':!![]}];}_0x5809d3=_[_0x33c3('0x3e')]({},_0x5809d3,_0x252ed3[_0x33c3('0x46')]);return db[_0x33c3('0x2d')][_0x33c3('0x47')](_0x5809d3)[_0x33c3('0x25')](handleEntityNotFound(_0x36cf63,null))[_0x33c3('0x25')](respondWithResult(_0x36cf63,null))['catch'](handleError(_0x36cf63,null));};exports['create']=function(_0x2dcbe0,_0x3a3e46){return db[_0x33c3('0x2d')][_0x33c3('0x48')](_0x2dcbe0[_0x33c3('0x49')],{})[_0x33c3('0x25')](respondWithResult(_0x3a3e46,0xc9))[_0x33c3('0x43')](handleError(_0x3a3e46,null));};exports[_0x33c3('0x4a')]=function(_0x52c85e,_0x1145b3){if(_0x52c85e['body']['id']){delete _0x52c85e[_0x33c3('0x49')]['id'];}return db[_0x33c3('0x2d')][_0x33c3('0x47')]({'where':{'id':_0x52c85e[_0x33c3('0x45')]['id']}})['then'](handleEntityNotFound(_0x1145b3,null))[_0x33c3('0x25')](saveUpdates(_0x52c85e[_0x33c3('0x49')],null))[_0x33c3('0x25')](respondWithResult(_0x1145b3,null))['catch'](handleError(_0x1145b3,null));};exports[_0x33c3('0x26')]=function(_0x5abb9d,_0x9cccf8){return db['SquareReport'][_0x33c3('0x47')]({'where':{'id':_0x5abb9d['params']['id']}})[_0x33c3('0x25')](handleEntityNotFound(_0x9cccf8,null))[_0x33c3('0x25')](removeEntity(_0x9cccf8,null))[_0x33c3('0x43')](handleError(_0x9cccf8,null));};exports[_0x33c3('0x4b')]=function(_0x32efc4,_0x2a28f7){return db[_0x33c3('0x2d')]['describe']()[_0x33c3('0x25')](respondWithResult(_0x2a28f7,null))[_0x33c3('0x43')](handleError(_0x2a28f7,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 26e65f1..7dcd648 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 _0xef1a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','SquareReport','leaveAt','util'];(function(_0x3a94d3,_0x2970b5){var _0x4233f3=function(_0x58ed46){while(--_0x58ed46){_0x3a94d3['push'](_0x3a94d3['shift']());}};_0x4233f3(++_0x2970b5);}(_0xef1a,0xfb));var _0xaef1=function(_0x26f03d,_0x4866c2){_0x26f03d=_0x26f03d-0x0;var _0x42dc9f=_0xef1a[_0x26f03d];return _0x42dc9f;};'use strict';var _=require('lodash');var util=require(_0xaef1('0x0'));var logger=require(_0xaef1('0x1'))(_0xaef1('0x2'));var moment=require(_0xaef1('0x3'));var BPromise=require(_0xaef1('0x4'));var rp=require(_0xaef1('0x5'));var fs=require('fs');var path=require(_0xaef1('0x6'));var rimraf=require(_0xaef1('0x7'));var config=require('../../config/environment');var attributes=require(_0xaef1('0x8'));module[_0xaef1('0x9')]=function(_0x2c5fae,_0x2bfde2){return _0x2c5fae['define'](_0xaef1('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0xaef1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1e5=['request-promise','rimraf','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird'];(function(_0x4dbcc9,_0xfd14e2){var _0x512fc2=function(_0x402ede){while(--_0x402ede){_0x4dbcc9['push'](_0x4dbcc9['shift']());}};_0x512fc2(++_0xfd14e2);}(_0xf1e5,0x1dc));var _0x5f1e=function(_0x5ac3a9,_0x568289){_0x5ac3a9=_0x5ac3a9-0x0;var _0x5d7a78=_0xf1e5[_0x5ac3a9];return _0x5d7a78;};'use strict';var _=require(_0x5f1e('0x0'));var util=require(_0x5f1e('0x1'));var logger=require('../../config/logger')(_0x5f1e('0x2'));var moment=require(_0x5f1e('0x3'));var BPromise=require(_0x5f1e('0x4'));var rp=require(_0x5f1e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f1e('0x6'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module['exports']=function(_0x1690b3,_0x22845e){return _0x1690b3[_0x5f1e('0x7')](_0x5f1e('0x8'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x5f1e('0x9'),'fields':[_0x5f1e('0xa'),_0x5f1e('0xb')]},{'name':_0x5f1e('0xc'),'fields':[_0x5f1e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index dca89c9..640faa6 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 _0x358c=['CreateSquareReport','UpdateSquareReport','where','attributes','limit','debug','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','SquareReport','create','body','options'];(function(_0x495efe,_0x9d2ffc){var _0x5b1196=function(_0x4919c0){while(--_0x4919c0){_0x495efe['push'](_0x495efe['shift']());}};_0x5b1196(++_0x9d2ffc);}(_0x358c,0x145));var _0xc358=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x358c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xc358('0x0'));var moment=require(_0xc358('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc358('0x2'));var db=require(_0xc358('0x3'))['db'];var utils=require(_0xc358('0x4'));var logger=require(_0xc358('0x5'))(_0xc358('0x6'));var config=require(_0xc358('0x7'));var jayson=require(_0xc358('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6a1fe8,_0x489532,_0x4337c2){return new BPromise(function(_0x5814ea,_0x33cb26){return client[_0xc358('0x9')](_0x6a1fe8,_0x4337c2)[_0xc358('0xa')](function(_0x2c764d){logger['info'](_0xc358('0xb'),_0x489532,_0xc358('0xc'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x489532,_0xc358('0xc'),JSON[_0xc358('0xd')](_0x2c764d));if(_0x2c764d[_0xc358('0xe')]){if(_0x2c764d[_0xc358('0xe')]['code']===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x489532,_0x2c764d['error'][_0xc358('0xf')]);return _0x33cb26(_0x2c764d[_0xc358('0xe')][_0xc358('0xf')]);}logger[_0xc358('0xe')](_0xc358('0xb'),_0x489532,_0x2c764d[_0xc358('0xe')][_0xc358('0xf')]);return _0x5814ea(_0x2c764d[_0xc358('0xe')]['message']);}else{logger[_0xc358('0x10')]('SquareReport,\x20%s,\x20%s',_0x489532,_0xc358('0xc'));_0x5814ea(_0x2c764d[_0xc358('0x11')][_0xc358('0xf')]);}})[_0xc358('0x12')](function(_0x3f2f21){logger[_0xc358('0xe')](_0xc358('0xb'),_0x489532,_0x3f2f21);_0x33cb26(_0x3f2f21);});});}exports['CreateSquareReport']=function(_0x261b6c){var _0x5884d5=this;return new Promise(function(_0x2502ad,_0x3fe24c){return db[_0xc358('0x13')][_0xc358('0x14')](_0x261b6c[_0xc358('0x15')],{'raw':_0x261b6c[_0xc358('0x16')]?_0x261b6c['options']['raw']===undefined?!![]:![]:!![]})[_0xc358('0xa')](function(_0x93ae46){logger[_0xc358('0x10')]('CreateSquareReport',_0x261b6c);logger['debug'](_0xc358('0x17'),_0x261b6c,JSON['stringify'](_0x93ae46));_0x2502ad(_0x93ae46);})['catch'](function(_0x1685c9){logger['error'](_0xc358('0x17'),_0x1685c9[_0xc358('0xf')],_0x261b6c);_0x3fe24c(_0x5884d5[_0xc358('0xe')](0x1f4,_0x1685c9[_0xc358('0xf')]));});});};exports[_0xc358('0x18')]=function(_0x4553d7){var _0x29087e=this;return new Promise(function(_0x1c8109,_0x3aa610){return db[_0xc358('0x13')]['update'](_0x4553d7['body'],{'raw':_0x4553d7[_0xc358('0x16')]?_0x4553d7[_0xc358('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4553d7[_0xc358('0x16')]?_0x4553d7[_0xc358('0x16')][_0xc358('0x19')]||null:null,'attributes':_0x4553d7[_0xc358('0x16')]?_0x4553d7[_0xc358('0x16')][_0xc358('0x1a')]||null:null,'limit':_0x4553d7[_0xc358('0x16')]?_0x4553d7[_0xc358('0x16')][_0xc358('0x1b')]||null:null})['then'](function(_0x3c2114){logger[_0xc358('0x10')](_0xc358('0x18'),_0x4553d7);logger[_0xc358('0x1c')](_0xc358('0x18'),_0x4553d7,JSON[_0xc358('0xd')](_0x3c2114));_0x1c8109(_0x3c2114);})[_0xc358('0x12')](function(_0x3e8abb){logger['error']('UpdateSquareReport',_0x3e8abb[_0xc358('0xf')],_0x4553d7);_0x3aa610(_0x29087e[_0xc358('0xe')](0x1f4,_0x3e8abb['message']));});});}; \ No newline at end of file +var _0x0711=['result','catch','SquareReport','create','options','raw','CreateSquareReport','UpdateSquareReport','update','body','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3617dc,_0x2e9cce){var _0x44a25e=function(_0x2e798c){while(--_0x2e798c){_0x3617dc['push'](_0x3617dc['shift']());}};_0x44a25e(++_0x2e9cce);}(_0x0711,0xfa));var _0x1071=function(_0x38611d,_0xf85071){_0x38611d=_0x38611d-0x0;var _0x2c4d3d=_0x0711[_0x38611d];return _0x2c4d3d;};'use strict';var _=require(_0x1071('0x0'));var util=require(_0x1071('0x1'));var moment=require(_0x1071('0x2'));var BPromise=require(_0x1071('0x3'));var rs=require(_0x1071('0x4'));var fs=require('fs');var Redis=require(_0x1071('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1071('0x6'));var logger=require(_0x1071('0x7'))('rpc');var config=require(_0x1071('0x8'));var jayson=require(_0x1071('0x9'));var client=jayson[_0x1071('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc9441f,_0xb6fdb5,_0x349338){return new BPromise(function(_0x239915,_0x152598){return client[_0x1071('0xb')](_0xc9441f,_0x349338)[_0x1071('0xc')](function(_0x4f86a9){logger[_0x1071('0xd')](_0x1071('0xe'),_0xb6fdb5,_0x1071('0xf'));logger[_0x1071('0x10')](_0x1071('0x11'),_0xb6fdb5,_0x1071('0xf'),JSON[_0x1071('0x12')](_0x4f86a9));if(_0x4f86a9[_0x1071('0x13')]){if(_0x4f86a9[_0x1071('0x13')][_0x1071('0x14')]===0x1f4){logger[_0x1071('0x13')](_0x1071('0xe'),_0xb6fdb5,_0x4f86a9[_0x1071('0x13')][_0x1071('0x15')]);return _0x152598(_0x4f86a9['error'][_0x1071('0x15')]);}logger[_0x1071('0x13')](_0x1071('0xe'),_0xb6fdb5,_0x4f86a9[_0x1071('0x13')][_0x1071('0x15')]);return _0x239915(_0x4f86a9[_0x1071('0x13')][_0x1071('0x15')]);}else{logger[_0x1071('0xd')](_0x1071('0xe'),_0xb6fdb5,_0x1071('0xf'));_0x239915(_0x4f86a9[_0x1071('0x16')][_0x1071('0x15')]);}})[_0x1071('0x17')](function(_0x37cc92){logger[_0x1071('0x13')](_0x1071('0xe'),_0xb6fdb5,_0x37cc92);_0x152598(_0x37cc92);});});}exports['CreateSquareReport']=function(_0x177395){var _0x317d81=this;return new Promise(function(_0x565ca3,_0x2ee7a7){return db[_0x1071('0x18')][_0x1071('0x19')](_0x177395['body'],{'raw':_0x177395[_0x1071('0x1a')]?_0x177395[_0x1071('0x1a')][_0x1071('0x1b')]===undefined?!![]:![]:!![]})[_0x1071('0xc')](function(_0x46abd2){logger[_0x1071('0xd')](_0x1071('0x1c'),_0x177395);logger['debug'](_0x1071('0x1c'),_0x177395,JSON[_0x1071('0x12')](_0x46abd2));_0x565ca3(_0x46abd2);})[_0x1071('0x17')](function(_0x553654){logger['error'](_0x1071('0x1c'),_0x553654[_0x1071('0x15')],_0x177395);_0x2ee7a7(_0x317d81['error'](0x1f4,_0x553654[_0x1071('0x15')]));});});};exports[_0x1071('0x1d')]=function(_0x299419){var _0x2a7bf4=this;return new Promise(function(_0x22b11b,_0xa0b60){return db[_0x1071('0x18')][_0x1071('0x1e')](_0x299419[_0x1071('0x1f')],{'raw':_0x299419['options']?_0x299419[_0x1071('0x1a')][_0x1071('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x299419[_0x1071('0x1a')]?_0x299419[_0x1071('0x1a')]['where']||null:null,'attributes':_0x299419[_0x1071('0x1a')]?_0x299419[_0x1071('0x1a')][_0x1071('0x20')]||null:null,'limit':_0x299419[_0x1071('0x1a')]?_0x299419[_0x1071('0x1a')][_0x1071('0x21')]||null:null})[_0x1071('0xc')](function(_0x1d67d9){logger[_0x1071('0xd')](_0x1071('0x1d'),_0x299419);logger[_0x1071('0x10')](_0x1071('0x1d'),_0x299419,JSON['stringify'](_0x1d67d9));_0x22b11b(_0x1d67d9);})[_0x1071('0x17')](function(_0x4f743f){logger[_0x1071('0x13')](_0x1071('0x1d'),_0x4f743f['message'],_0x299419);_0xa0b60(_0x2a7bf4[_0x1071('0x13')](0x1f4,_0x4f743f[_0x1071('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index bb7dff7..425d5fb 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 _0xe956=['describe','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x417f41,_0x56216b){var _0x171982=function(_0x58732b){while(--_0x58732b){_0x417f41['push'](_0x417f41['shift']());}};_0x171982(++_0x56216b);}(_0xe956,0x1ec));var _0x6e95=function(_0x35ef53,_0x126909){_0x35ef53=_0x35ef53-0x0;var _0x4f78c5=_0xe956[_0x35ef53];return _0x4f78c5;};'use strict';var multer=require(_0x6e95('0x0'));var util=require('util');var path=require(_0x6e95('0x1'));var timeout=require(_0x6e95('0x2'));var express=require(_0x6e95('0x3'));var router=express[_0x6e95('0x4')]();var fs_extra=require(_0x6e95('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6e95('0x6'));var config=require(_0x6e95('0x7'));var controller=require('./squareReportDetail.controller');router[_0x6e95('0x8')]('/',auth[_0x6e95('0x9')](),controller[_0x6e95('0xa')]);router[_0x6e95('0x8')](_0x6e95('0xb'),auth[_0x6e95('0x9')](),controller[_0x6e95('0xc')]);router[_0x6e95('0x8')]('/:id',auth[_0x6e95('0x9')](),controller['show']);router[_0x6e95('0xd')]('/',auth['isAuthenticated'](),controller[_0x6e95('0xe')]);router[_0x6e95('0xf')]('/:id',auth[_0x6e95('0x9')](),controller['update']);router[_0x6e95('0x10')]('/:id',auth[_0x6e95('0x9')](),controller[_0x6e95('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc3c9=['../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service'];(function(_0x20c731,_0x13f5ef){var _0x1873af=function(_0x4b3fcd){while(--_0x4b3fcd){_0x20c731['push'](_0x20c731['shift']());}};_0x1873af(++_0x13f5ef);}(_0xc3c9,0xb8));var _0x9c3c=function(_0x124d12,_0x2351a1){_0x124d12=_0x124d12-0x0;var _0x54180f=_0xc3c9[_0x124d12];return _0x54180f;};'use strict';var multer=require(_0x9c3c('0x0'));var util=require(_0x9c3c('0x1'));var path=require(_0x9c3c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c3c('0x3'));var router=express[_0x9c3c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c3c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c3c('0x6'));var controller=require(_0x9c3c('0x7'));router[_0x9c3c('0x8')]('/',auth[_0x9c3c('0x9')](),controller[_0x9c3c('0xa')]);router[_0x9c3c('0x8')](_0x9c3c('0xb'),auth[_0x9c3c('0x9')](),controller[_0x9c3c('0xc')]);router[_0x9c3c('0x8')](_0x9c3c('0xd'),auth[_0x9c3c('0x9')](),controller['show']);router[_0x9c3c('0xe')]('/',auth[_0x9c3c('0x9')](),controller['create']);router[_0x9c3c('0xf')](_0x9c3c('0xd'),auth[_0x9c3c('0x9')](),controller[_0x9c3c('0x10')]);router[_0x9c3c('0x11')](_0x9c3c('0xd'),auth[_0x9c3c('0x9')](),controller[_0x9c3c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 499d9cd..da25d70 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 _0xab94=['STRING','TEXT'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0xab94,0x1bc));var _0x4ab9=function(_0x140261,_0x2b2d9b){_0x140261=_0x140261-0x0;var _0x12e4f0=_0xab94[_0x140261];return _0x12e4f0;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ab9('0x0')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x4ab9('0x0')]},'data':{'type':Sequelize[_0x4ab9('0x1')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4ab9('0x0')]}}; \ No newline at end of file +var _0xdc76=['TEXT','STRING','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdc76,0x72));var _0x6dc7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdc76[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x6dc7('0x0'));module[_0x6dc7('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x6dc7('0x2')]},'project_name':{'type':Sequelize[_0x6dc7('0x3')]},'callerid':{'type':Sequelize[_0x6dc7('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c2e931c..4ecd45b 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 _0x4d50=['update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body'];(function(_0x344f93,_0x30b7e3){var _0x1ffa28=function(_0x3f2ca4){while(--_0x3f2ca4){_0x344f93['push'](_0x344f93['shift']());}};_0x1ffa28(++_0x30b7e3);}(_0x4d50,0x1b8));var _0x04d5=function(_0x35d1cc,_0xb364ec){_0x35d1cc=_0x35d1cc-0x0;var _0x56bcf4=_0x4d50[_0x35d1cc];return _0x56bcf4;};'use strict';var emlformat=require(_0x04d5('0x0'));var rimraf=require(_0x04d5('0x1'));var zipdir=require(_0x04d5('0x2'));var jsonpatch=require(_0x04d5('0x3'));var rp=require(_0x04d5('0x4'));var moment=require(_0x04d5('0x5'));var BPromise=require(_0x04d5('0x6'));var Mustache=require(_0x04d5('0x7'));var util=require('util');var path=require(_0x04d5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04d5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x04d5('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x04d5('0xb'));var Redis=require(_0x04d5('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x04d5('0xd'));var as=require(_0x04d5('0xe'));var hardwareService=require(_0x04d5('0xf'));var logger=require(_0x04d5('0x10'))('api');var utils=require(_0x04d5('0x11'));var config=require(_0x04d5('0x12'));var licenseUtil=require(_0x04d5('0x13'));var db=require(_0x04d5('0x14'))['db'];function respondWithStatusCode(_0x1804fe,_0x5813e3){_0x5813e3=_0x5813e3||0xcc;return function(_0x458ba0){if(_0x458ba0){return _0x1804fe[_0x04d5('0x15')](_0x5813e3);}return _0x1804fe['status'](_0x5813e3)[_0x04d5('0x16')]();};}function respondWithResult(_0x5cb45c,_0xf50925){_0xf50925=_0xf50925||0xc8;return function(_0x28fe52){if(_0x28fe52){return _0x5cb45c[_0x04d5('0x17')](_0xf50925)[_0x04d5('0x18')](_0x28fe52);}};}function respondWithFilteredResult(_0x500b5a,_0x38e5a3){return function(_0x29a1c4){if(_0x29a1c4){var _0x5276ce=typeof _0x38e5a3[_0x04d5('0x19')]===_0x04d5('0x1a')&&typeof _0x38e5a3[_0x04d5('0x1b')]==='undefined';var _0x537928=_0x29a1c4[_0x04d5('0x1c')];var _0x3a41dd=_0x5276ce?0x0:_0x38e5a3[_0x04d5('0x19')];var _0x4abc04=_0x5276ce?_0x29a1c4[_0x04d5('0x1c')]:_0x38e5a3['offset']+_0x38e5a3['limit'];var _0x35567a;if(_0x4abc04>=_0x537928){_0x4abc04=_0x537928;_0x35567a=0xc8;}else{_0x35567a=0xce;}_0x500b5a[_0x04d5('0x17')](_0x35567a);return _0x500b5a['set'](_0x04d5('0x1d'),_0x3a41dd+'-'+_0x4abc04+'/'+_0x537928)['json'](_0x29a1c4);}return null;};}function patchUpdates(_0x3760e4){return function(_0x1efb17){try{jsonpatch['apply'](_0x1efb17,_0x3760e4,!![]);}catch(_0x325288){return BPromise[_0x04d5('0x1e')](_0x325288);}return _0x1efb17[_0x04d5('0x1f')]();};}function saveUpdates(_0x304213,_0x3ebf96){return function(_0x34732f){if(_0x34732f){return _0x34732f['update'](_0x304213)['then'](function(_0xb31c4b){return _0xb31c4b;});}return null;};}function removeEntity(_0x1eaaa9,_0x2d4eda){return function(_0x5a0209){if(_0x5a0209){return _0x5a0209[_0x04d5('0x20')]()[_0x04d5('0x21')](function(){_0x1eaaa9[_0x04d5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b009,_0x527b7e){return function(_0x2436f1){if(!_0x2436f1){_0x25b009[_0x04d5('0x15')](0x194);}return _0x2436f1;};}function handleError(_0x29051b,_0x57c991){_0x57c991=_0x57c991||0x1f4;return function(_0x4173d1){logger['error'](_0x4173d1[_0x04d5('0x22')]);if(_0x4173d1[_0x04d5('0x23')]){delete _0x4173d1['name'];}_0x29051b[_0x04d5('0x17')](_0x57c991)[_0x04d5('0x24')](_0x4173d1);};}exports[_0x04d5('0x25')]=function(_0x516315,_0x470da1){var _0x2d2fae={},_0x556886={},_0x1d785f={'count':0x0,'rows':[]};var _0x531f41=_[_0x04d5('0x26')](db[_0x04d5('0x27')][_0x04d5('0x28')],function(_0x591baa){return{'name':_0x591baa[_0x04d5('0x29')],'type':_0x591baa[_0x04d5('0x2a')][_0x04d5('0x2b')]};});_0x556886[_0x04d5('0x2c')]=_[_0x04d5('0x26')](_0x531f41,_0x04d5('0x23'));_0x556886['query']=_[_0x04d5('0x2d')](_0x516315['query']);_0x556886[_0x04d5('0x2e')]=_[_0x04d5('0x2f')](_0x556886[_0x04d5('0x2c')],_0x556886[_0x04d5('0x30')]);_0x2d2fae[_0x04d5('0x31')]=_['intersection'](_0x556886[_0x04d5('0x2c')],qs['fields'](_0x516315['query'][_0x04d5('0x32')]));_0x2d2fae[_0x04d5('0x31')]=_0x2d2fae[_0x04d5('0x31')][_0x04d5('0x33')]?_0x2d2fae['attributes']:_0x556886[_0x04d5('0x2c')];if(!_0x516315['query'][_0x04d5('0x34')](_0x04d5('0x35'))){_0x2d2fae[_0x04d5('0x1b')]=qs[_0x04d5('0x1b')](_0x516315[_0x04d5('0x30')][_0x04d5('0x1b')]);_0x2d2fae[_0x04d5('0x19')]=qs['offset'](_0x516315[_0x04d5('0x30')][_0x04d5('0x19')]);}_0x2d2fae[_0x04d5('0x36')]=qs[_0x04d5('0x37')](_0x516315['query'][_0x04d5('0x37')]);_0x2d2fae[_0x04d5('0x38')]=qs[_0x04d5('0x2e')](_[_0x04d5('0x39')](_0x516315[_0x04d5('0x30')],_0x556886[_0x04d5('0x2e')]),_0x531f41);if(_0x516315[_0x04d5('0x30')][_0x04d5('0x3a')]){_0x2d2fae[_0x04d5('0x38')]=_[_0x04d5('0x3b')](_0x2d2fae[_0x04d5('0x38')],{'$or':_[_0x04d5('0x26')](_0x531f41,function(_0x38a522){if(_0x38a522['type']!=='VIRTUAL'){var _0x379405={};_0x379405[_0x38a522[_0x04d5('0x23')]]={'$like':'%'+_0x516315[_0x04d5('0x30')][_0x04d5('0x3a')]+'%'};return _0x379405;}})});}_0x2d2fae=_[_0x04d5('0x3b')]({},_0x2d2fae,_0x516315[_0x04d5('0x3c')]);var _0x5de253={'where':_0x2d2fae[_0x04d5('0x38')]};return db['SquareDetailsReport']['count'](_0x5de253)[_0x04d5('0x21')](function(_0x1455e0){_0x1d785f['count']=_0x1455e0;if(_0x516315[_0x04d5('0x30')][_0x04d5('0x3d')]){_0x2d2fae['include']=[{'all':!![]}];}return db[_0x04d5('0x27')][_0x04d5('0x3e')](_0x2d2fae);})[_0x04d5('0x21')](function(_0x5ce883){_0x1d785f[_0x04d5('0x3f')]=_0x5ce883;return _0x1d785f;})[_0x04d5('0x21')](respondWithFilteredResult(_0x470da1,_0x2d2fae))[_0x04d5('0x40')](handleError(_0x470da1,null));};exports[_0x04d5('0x41')]=function(_0x502f91,_0x5a5657){var _0x54c613={'raw':!![],'where':{'id':_0x502f91[_0x04d5('0x42')]['id']}},_0x26ae02={};_0x26ae02['model']=_[_0x04d5('0x2d')](db['SquareDetailsReport']['rawAttributes']);_0x26ae02[_0x04d5('0x30')]=_[_0x04d5('0x2d')](_0x502f91[_0x04d5('0x30')]);_0x26ae02[_0x04d5('0x2e')]=_['intersection'](_0x26ae02[_0x04d5('0x2c')],_0x26ae02[_0x04d5('0x30')]);_0x54c613[_0x04d5('0x31')]=_[_0x04d5('0x2f')](_0x26ae02[_0x04d5('0x2c')],qs[_0x04d5('0x32')](_0x502f91['query']['fields']));_0x54c613['attributes']=_0x54c613[_0x04d5('0x31')][_0x04d5('0x33')]?_0x54c613[_0x04d5('0x31')]:_0x26ae02[_0x04d5('0x2c')];if(_0x502f91[_0x04d5('0x30')]['includeAll']){_0x54c613[_0x04d5('0x43')]=[{'all':!![]}];}_0x54c613=_[_0x04d5('0x3b')]({},_0x54c613,_0x502f91[_0x04d5('0x3c')]);return db[_0x04d5('0x27')][_0x04d5('0x44')](_0x54c613)[_0x04d5('0x21')](handleEntityNotFound(_0x5a5657,null))[_0x04d5('0x21')](respondWithResult(_0x5a5657,null))[_0x04d5('0x40')](handleError(_0x5a5657,null));};exports[_0x04d5('0x45')]=function(_0x28712c,_0x2a01cf){return db[_0x04d5('0x27')][_0x04d5('0x45')](_0x28712c[_0x04d5('0x46')],{})[_0x04d5('0x21')](respondWithResult(_0x2a01cf,0xc9))[_0x04d5('0x40')](handleError(_0x2a01cf,null));};exports[_0x04d5('0x47')]=function(_0x4c1d6d,_0x2c9ed3){if(_0x4c1d6d[_0x04d5('0x46')]['id']){delete _0x4c1d6d[_0x04d5('0x46')]['id'];}return db[_0x04d5('0x27')][_0x04d5('0x44')]({'where':{'id':_0x4c1d6d[_0x04d5('0x42')]['id']}})[_0x04d5('0x21')](handleEntityNotFound(_0x2c9ed3,null))[_0x04d5('0x21')](saveUpdates(_0x4c1d6d[_0x04d5('0x46')],null))[_0x04d5('0x21')](respondWithResult(_0x2c9ed3,null))['catch'](handleError(_0x2c9ed3,null));};exports['destroy']=function(_0x1559a5,_0x5bfae0){return db[_0x04d5('0x27')][_0x04d5('0x44')]({'where':{'id':_0x1559a5[_0x04d5('0x42')]['id']}})[_0x04d5('0x21')](handleEntityNotFound(_0x5bfae0,null))['then'](removeEntity(_0x5bfae0,null))[_0x04d5('0x40')](handleError(_0x5bfae0,null));};exports[_0x04d5('0x48')]=function(_0x312c3d,_0xa6eee8){return db[_0x04d5('0x27')][_0x04d5('0x48')]()[_0x04d5('0x21')](respondWithResult(_0xa6eee8,null))[_0x04d5('0x40')](handleError(_0xa6eee8,null));}; \ No newline at end of file +var _0xb267=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','SquareDetailsReport','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0x3c17fb,_0x5f20ff){var _0x38e1f6=function(_0x1464ca){while(--_0x1464ca){_0x3c17fb['push'](_0x3c17fb['shift']());}};_0x38e1f6(++_0x5f20ff);}(_0xb267,0x118));var _0x7b26=function(_0x2fad60,_0x58c78f){_0x2fad60=_0x2fad60-0x0;var _0x50dc9d=_0xb267[_0x2fad60];return _0x50dc9d;};'use strict';var emlformat=require(_0x7b26('0x0'));var rimraf=require(_0x7b26('0x1'));var zipdir=require(_0x7b26('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b26('0x3'));var moment=require(_0x7b26('0x4'));var BPromise=require(_0x7b26('0x5'));var Mustache=require(_0x7b26('0x6'));var util=require(_0x7b26('0x7'));var path=require(_0x7b26('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b26('0x9'));var fs=require('fs');var fs_extra=require(_0x7b26('0xa'));var _=require('lodash');var squel=require(_0x7b26('0xb'));var crypto=require(_0x7b26('0xc'));var jsforce=require(_0x7b26('0xd'));var deskjs=require(_0x7b26('0xe'));var toCsv=require(_0x7b26('0xf'));var querystring=require(_0x7b26('0x10'));var Papa=require(_0x7b26('0x11'));var Redis=require(_0x7b26('0x12'));var authService=require(_0x7b26('0x13'));var qs=require(_0x7b26('0x14'));var as=require(_0x7b26('0x15'));var hardwareService=require(_0x7b26('0x16'));var logger=require('../../config/logger')(_0x7b26('0x17'));var utils=require(_0x7b26('0x18'));var config=require(_0x7b26('0x19'));var licenseUtil=require(_0x7b26('0x1a'));var db=require(_0x7b26('0x1b'))['db'];function respondWithStatusCode(_0x1a0785,_0x12a61a){_0x12a61a=_0x12a61a||0xcc;return function(_0x351db4){if(_0x351db4){return _0x1a0785['sendStatus'](_0x12a61a);}return _0x1a0785[_0x7b26('0x1c')](_0x12a61a)['end']();};}function respondWithResult(_0x820473,_0x37d751){_0x37d751=_0x37d751||0xc8;return function(_0x3e6abf){if(_0x3e6abf){return _0x820473[_0x7b26('0x1c')](_0x37d751)[_0x7b26('0x1d')](_0x3e6abf);}};}function respondWithFilteredResult(_0x1679b7,_0x40f537){return function(_0x347a29){if(_0x347a29){var _0x31cde6=typeof _0x40f537[_0x7b26('0x1e')]===_0x7b26('0x1f')&&typeof _0x40f537[_0x7b26('0x20')]===_0x7b26('0x1f');var _0x515cca=_0x347a29[_0x7b26('0x21')];var _0x177799=_0x31cde6?0x0:_0x40f537[_0x7b26('0x1e')];var _0x5dee2b=_0x31cde6?_0x347a29['count']:_0x40f537['offset']+_0x40f537[_0x7b26('0x20')];var _0x568b63;if(_0x5dee2b>=_0x515cca){_0x5dee2b=_0x515cca;_0x568b63=0xc8;}else{_0x568b63=0xce;}_0x1679b7[_0x7b26('0x1c')](_0x568b63);return _0x1679b7[_0x7b26('0x22')](_0x7b26('0x23'),_0x177799+'-'+_0x5dee2b+'/'+_0x515cca)[_0x7b26('0x1d')](_0x347a29);}return null;};}function patchUpdates(_0x205662){return function(_0x4d70a3){try{jsonpatch[_0x7b26('0x24')](_0x4d70a3,_0x205662,!![]);}catch(_0x490d2a){return BPromise[_0x7b26('0x25')](_0x490d2a);}return _0x4d70a3[_0x7b26('0x26')]();};}function saveUpdates(_0x565c52,_0x229a94){return function(_0x4fc9d3){if(_0x4fc9d3){return _0x4fc9d3[_0x7b26('0x27')](_0x565c52)[_0x7b26('0x28')](function(_0xd05a0f){return _0xd05a0f;});}return null;};}function removeEntity(_0x435387,_0x41c2ac){return function(_0x5c3230){if(_0x5c3230){return _0x5c3230[_0x7b26('0x29')]()[_0x7b26('0x28')](function(){_0x435387[_0x7b26('0x1c')](0xcc)[_0x7b26('0x2a')]();});}};}function handleEntityNotFound(_0x3a9885,_0x42d9d7){return function(_0x1254cc){if(!_0x1254cc){_0x3a9885[_0x7b26('0x2b')](0x194);}return _0x1254cc;};}function handleError(_0x1e7caf,_0x52d58c){_0x52d58c=_0x52d58c||0x1f4;return function(_0xc2fbd9){logger[_0x7b26('0x2c')](_0xc2fbd9[_0x7b26('0x2d')]);if(_0xc2fbd9[_0x7b26('0x2e')]){delete _0xc2fbd9['name'];}_0x1e7caf[_0x7b26('0x1c')](_0x52d58c)[_0x7b26('0x2f')](_0xc2fbd9);};}exports['index']=function(_0x8e869b,_0x7d1079){var _0x372d62={},_0x38037e={},_0x3e4d8c={'count':0x0,'rows':[]};var _0x2fb764=_[_0x7b26('0x30')](db['SquareDetailsReport'][_0x7b26('0x31')],function(_0x5619d9){return{'name':_0x5619d9[_0x7b26('0x32')],'type':_0x5619d9['type'][_0x7b26('0x33')]};});_0x38037e[_0x7b26('0x34')]=_[_0x7b26('0x30')](_0x2fb764,_0x7b26('0x2e'));_0x38037e[_0x7b26('0x35')]=_[_0x7b26('0x36')](_0x8e869b[_0x7b26('0x35')]);_0x38037e[_0x7b26('0x37')]=_['intersection'](_0x38037e[_0x7b26('0x34')],_0x38037e[_0x7b26('0x35')]);_0x372d62[_0x7b26('0x38')]=_[_0x7b26('0x39')](_0x38037e[_0x7b26('0x34')],qs[_0x7b26('0x3a')](_0x8e869b['query']['fields']));_0x372d62['attributes']=_0x372d62[_0x7b26('0x38')]['length']?_0x372d62[_0x7b26('0x38')]:_0x38037e[_0x7b26('0x34')];if(!_0x8e869b[_0x7b26('0x35')]['hasOwnProperty']('nolimit')){_0x372d62[_0x7b26('0x20')]=qs[_0x7b26('0x20')](_0x8e869b[_0x7b26('0x35')]['limit']);_0x372d62[_0x7b26('0x1e')]=qs[_0x7b26('0x1e')](_0x8e869b['query'][_0x7b26('0x1e')]);}_0x372d62[_0x7b26('0x3b')]=qs[_0x7b26('0x3c')](_0x8e869b[_0x7b26('0x35')][_0x7b26('0x3c')]);_0x372d62[_0x7b26('0x3d')]=qs[_0x7b26('0x37')](_['pick'](_0x8e869b['query'],_0x38037e[_0x7b26('0x37')]),_0x2fb764);if(_0x8e869b[_0x7b26('0x35')][_0x7b26('0x3e')]){_0x372d62[_0x7b26('0x3d')]=_[_0x7b26('0x3f')](_0x372d62[_0x7b26('0x3d')],{'$or':_[_0x7b26('0x30')](_0x2fb764,function(_0x23578b){if(_0x23578b[_0x7b26('0x40')]!==_0x7b26('0x41')){var _0x24f8d2={};_0x24f8d2[_0x23578b[_0x7b26('0x2e')]]={'$like':'%'+_0x8e869b[_0x7b26('0x35')][_0x7b26('0x3e')]+'%'};return _0x24f8d2;}})});}_0x372d62=_[_0x7b26('0x3f')]({},_0x372d62,_0x8e869b[_0x7b26('0x42')]);var _0x34009c={'where':_0x372d62[_0x7b26('0x3d')]};return db['SquareDetailsReport']['count'](_0x34009c)[_0x7b26('0x28')](function(_0x19d903){_0x3e4d8c[_0x7b26('0x21')]=_0x19d903;if(_0x8e869b[_0x7b26('0x35')][_0x7b26('0x43')]){_0x372d62['include']=[{'all':!![]}];}return db[_0x7b26('0x44')]['findAll'](_0x372d62);})['then'](function(_0x2e2ca0){_0x3e4d8c['rows']=_0x2e2ca0;return _0x3e4d8c;})[_0x7b26('0x28')](respondWithFilteredResult(_0x7d1079,_0x372d62))[_0x7b26('0x45')](handleError(_0x7d1079,null));};exports[_0x7b26('0x46')]=function(_0x9a3c42,_0x451c05){var _0x45a0eb={'raw':!![],'where':{'id':_0x9a3c42[_0x7b26('0x47')]['id']}},_0x3423f3={};_0x3423f3[_0x7b26('0x34')]=_['keys'](db[_0x7b26('0x44')][_0x7b26('0x31')]);_0x3423f3[_0x7b26('0x35')]=_[_0x7b26('0x36')](_0x9a3c42['query']);_0x3423f3['filters']=_[_0x7b26('0x39')](_0x3423f3[_0x7b26('0x34')],_0x3423f3['query']);_0x45a0eb[_0x7b26('0x38')]=_[_0x7b26('0x39')](_0x3423f3[_0x7b26('0x34')],qs[_0x7b26('0x3a')](_0x9a3c42['query'][_0x7b26('0x3a')]));_0x45a0eb['attributes']=_0x45a0eb[_0x7b26('0x38')][_0x7b26('0x48')]?_0x45a0eb[_0x7b26('0x38')]:_0x3423f3[_0x7b26('0x34')];if(_0x9a3c42[_0x7b26('0x35')][_0x7b26('0x43')]){_0x45a0eb[_0x7b26('0x49')]=[{'all':!![]}];}_0x45a0eb=_[_0x7b26('0x3f')]({},_0x45a0eb,_0x9a3c42[_0x7b26('0x42')]);return db['SquareDetailsReport'][_0x7b26('0x4a')](_0x45a0eb)[_0x7b26('0x28')](handleEntityNotFound(_0x451c05,null))[_0x7b26('0x28')](respondWithResult(_0x451c05,null))[_0x7b26('0x45')](handleError(_0x451c05,null));};exports[_0x7b26('0x4b')]=function(_0xbf1031,_0x177b6a){return db[_0x7b26('0x44')][_0x7b26('0x4b')](_0xbf1031[_0x7b26('0x4c')],{})['then'](respondWithResult(_0x177b6a,0xc9))['catch'](handleError(_0x177b6a,null));};exports[_0x7b26('0x27')]=function(_0x5152b7,_0x2f874d){if(_0x5152b7['body']['id']){delete _0x5152b7[_0x7b26('0x4c')]['id'];}return db[_0x7b26('0x44')][_0x7b26('0x4a')]({'where':{'id':_0x5152b7['params']['id']}})['then'](handleEntityNotFound(_0x2f874d,null))['then'](saveUpdates(_0x5152b7[_0x7b26('0x4c')],null))[_0x7b26('0x28')](respondWithResult(_0x2f874d,null))['catch'](handleError(_0x2f874d,null));};exports[_0x7b26('0x29')]=function(_0x2b203f,_0x4257b7){return db[_0x7b26('0x44')][_0x7b26('0x4a')]({'where':{'id':_0x2b203f['params']['id']}})[_0x7b26('0x28')](handleEntityNotFound(_0x4257b7,null))['then'](removeEntity(_0x4257b7,null))[_0x7b26('0x45')](handleError(_0x4257b7,null));};exports['describe']=function(_0x3ef0b3,_0x1d250d){return db[_0x7b26('0x44')][_0x7b26('0x4d')]()[_0x7b26('0x28')](respondWithResult(_0x1d250d,null))[_0x7b26('0x45')](handleError(_0x1d250d,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 72248ef..cfe186b 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 _0x2f23=['./squareReportDetail.attributes','report_square_details','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x3f4a04,_0x22ff33){var _0x50a780=function(_0x34aaf4){while(--_0x34aaf4){_0x3f4a04['push'](_0x3f4a04['shift']());}};_0x50a780(++_0x22ff33);}(_0x2f23,0x65));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32f2('0x0'));var util=require(_0x32f2('0x1'));var logger=require(_0x32f2('0x2'))('api');var moment=require(_0x32f2('0x3'));var BPromise=require(_0x32f2('0x4'));var rp=require(_0x32f2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x32f2('0x6'));var attributes=require(_0x32f2('0x7'));module['exports']=function(_0xbe4579,_0x3be8d5){return _0xbe4579['define']('SquareDetailsReport',attributes,{'tableName':_0x32f2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x761a=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','api','moment','bluebird','request-promise','path'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x761a,0x1b2));var _0xa761=function(_0x3791ea,_0x5b466f){_0x3791ea=_0x3791ea-0x0;var _0x4042e0=_0x761a[_0x3791ea];return _0x4042e0;};'use strict';var _=require(_0xa761('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa761('0x1'));var moment=require(_0xa761('0x2'));var BPromise=require(_0xa761('0x3'));var rp=require(_0xa761('0x4'));var fs=require('fs');var path=require(_0xa761('0x5'));var rimraf=require('rimraf');var config=require(_0xa761('0x6'));var attributes=require(_0xa761('0x7'));module[_0xa761('0x8')]=function(_0x50bcc6,_0x1ee5d7){return _0x50bcc6[_0xa761('0x9')](_0xa761('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 531dbfb..141c501 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 _0x5ec6=['randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment'];(function(_0x34552e,_0x461150){var _0xac5486=function(_0x401473){while(--_0x401473){_0x34552e['push'](_0x34552e['shift']());}};_0xac5486(++_0x461150);}(_0x5ec6,0x7f));var _0x65ec=function(_0x75fc51,_0x49a1a2){_0x75fc51=_0x75fc51-0x0;var _0x1b6219=_0x5ec6[_0x75fc51];return _0x1b6219;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});}exports[_0x65ec('0x14')]=function(_0x1254f8){var _0xb4ed90=this;return new Promise(function(_0x29ebc4,_0xd81ed3){return db[_0x65ec('0x15')][_0x65ec('0x16')](_0x1254f8[_0x65ec('0x17')],{'raw':_0x1254f8[_0x65ec('0x18')]?_0x1254f8[_0x65ec('0x18')][_0x65ec('0x19')]===undefined?!![]:![]:!![]})[_0x65ec('0xa')](function(_0x1467ac){logger[_0x65ec('0x12')](_0x65ec('0x14'),_0x1254f8);logger[_0x65ec('0xc')](_0x65ec('0x14'),_0x1254f8,JSON[_0x65ec('0xe')](_0x1467ac));_0x29ebc4(_0x1467ac);})['catch'](function(_0x170703){logger[_0x65ec('0xf')](_0x65ec('0x14'),_0x170703[_0x65ec('0x11')],_0x1254f8);_0xd81ed3(_0xb4ed90[_0x65ec('0xf')](0x1f4,_0x170703[_0x65ec('0x11')]));});});}; \ No newline at end of file +var _0x0647=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x4db1d7,_0x593017){var _0x4f47c6=function(_0x4e762f){while(--_0x4e762f){_0x4db1d7['push'](_0x4db1d7['shift']());}};_0x4f47c6(++_0x593017);}(_0x0647,0xd0));var _0x7064=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x0647[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0x7064('0x0'));var util=require('util');var moment=require(_0x7064('0x1'));var BPromise=require(_0x7064('0x2'));var rs=require(_0x7064('0x3'));var fs=require('fs');var Redis=require(_0x7064('0x4'));var db=require(_0x7064('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7064('0x6'));var config=require(_0x7064('0x7'));var jayson=require(_0x7064('0x8'));var client=jayson[_0x7064('0x9')][_0x7064('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1101e4,_0x58186b,_0x536336){return new BPromise(function(_0x1c85b1,_0x39b7e3){return client[_0x7064('0xb')](_0x1101e4,_0x536336)['then'](function(_0x38c195){logger[_0x7064('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x58186b,_0x7064('0xd'));logger[_0x7064('0xe')](_0x7064('0xf'),_0x58186b,'request\x20sent',JSON[_0x7064('0x10')](_0x38c195));if(_0x38c195[_0x7064('0x11')]){if(_0x38c195[_0x7064('0x11')][_0x7064('0x12')]===0x1f4){logger['error'](_0x7064('0x13'),_0x58186b,_0x38c195[_0x7064('0x11')][_0x7064('0x14')]);return _0x39b7e3(_0x38c195[_0x7064('0x11')][_0x7064('0x14')]);}logger[_0x7064('0x11')](_0x7064('0x13'),_0x58186b,_0x38c195[_0x7064('0x11')]['message']);return _0x1c85b1(_0x38c195['error']['message']);}else{logger[_0x7064('0xc')](_0x7064('0x13'),_0x58186b,_0x7064('0xd'));_0x1c85b1(_0x38c195['result'][_0x7064('0x14')]);}})[_0x7064('0x15')](function(_0x5bb1cc){logger[_0x7064('0x11')](_0x7064('0x13'),_0x58186b,_0x5bb1cc);_0x39b7e3(_0x5bb1cc);});});}exports[_0x7064('0x16')]=function(_0x203633){var _0x181ca0=this;return new Promise(function(_0x17f306,_0x3f3695){return db[_0x7064('0x17')][_0x7064('0x18')](_0x203633[_0x7064('0x19')],{'raw':_0x203633[_0x7064('0x1a')]?_0x203633[_0x7064('0x1a')][_0x7064('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x431fac){logger[_0x7064('0xc')](_0x7064('0x16'),_0x203633);logger[_0x7064('0xe')]('CreateSquareDetailsReport',_0x203633,JSON[_0x7064('0x10')](_0x431fac));_0x17f306(_0x431fac);})['catch'](function(_0x446730){logger[_0x7064('0x11')]('CreateSquareDetailsReport',_0x446730[_0x7064('0x14')],_0x203633);_0x3f3695(_0x181ca0[_0x7064('0x11')](0x1f4,_0x446730[_0x7064('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 423fb51..129b7c3 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 _0x9d02=['exports','express','Router','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0xc046c8,_0x43bb03){var _0x14eabd=function(_0x67439f){while(--_0x67439f){_0xc046c8['push'](_0xc046c8['shift']());}};_0x14eabd(++_0x43bb03);}(_0x9d02,0x131));var _0x29d0=function(_0x51ee99,_0x37d13e){_0x51ee99=_0x51ee99-0x0;var _0x3fe278=_0x9d02[_0x51ee99];return _0x3fe278;};'use strict';var express=require(_0x29d0('0x0'));var router=express[_0x29d0('0x1')]();var auth=require(_0x29d0('0x2'));var controller=require('./system.controller');router[_0x29d0('0x3')]('/',auth[_0x29d0('0x4')](),controller['index']);router[_0x29d0('0x3')](_0x29d0('0x5'),auth[_0x29d0('0x4')](),controller[_0x29d0('0x6')]);module[_0x29d0('0x7')]=router; \ No newline at end of file +var _0x65c9=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','express','Router','../../components/auth/service'];(function(_0x5e10cf,_0x5ce2fb){var _0x3af2f1=function(_0x546e11){while(--_0x546e11){_0x5e10cf['push'](_0x5e10cf['shift']());}};_0x3af2f1(++_0x5ce2fb);}(_0x65c9,0x165));var _0x965c=function(_0x4fa1d5,_0x1b2ef5){_0x4fa1d5=_0x4fa1d5-0x0;var _0x3c4ed0=_0x65c9[_0x4fa1d5];return _0x3c4ed0;};'use strict';var express=require(_0x965c('0x0'));var router=express[_0x965c('0x1')]();var auth=require(_0x965c('0x2'));var controller=require(_0x965c('0x3'));router[_0x965c('0x4')]('/',auth[_0x965c('0x5')](),controller[_0x965c('0x6')]);router[_0x965c('0x4')](_0x965c('0x7'),auth['isAuthenticated'](),controller[_0x965c('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index c6f208f..3571556 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 _0x318b=['util','bluebird','lodash','error','inspect','name','status','then','json','catch','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','exec','../../config/logger','api'];(function(_0x225c83,_0x411d35){var _0x138677=function(_0x5f405b){while(--_0x5f405b){_0x225c83['push'](_0x225c83['shift']());}};_0x138677(++_0x411d35);}(_0x318b,0x134));var _0xb318=function(_0x65d13d,_0x49e929){_0x65d13d=_0x65d13d-0x0;var _0x309bb3=_0x318b[_0x65d13d];return _0x309bb3;};'use strict';var info=require(_0xb318('0x0'));var exec=require('child_process')[_0xb318('0x1')];var logger=require(_0xb318('0x2'))(_0xb318('0x3'));var util=require(_0xb318('0x4'));var BPromise=require(_0xb318('0x5'));var _=require(_0xb318('0x6'));function handleError(_0xeeafa5,_0x455a25,_0x14e652){_0x455a25=_0x455a25||0x1f4;return function(_0x9b189f){logger[_0xb318('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x14e652,_0x455a25,util[_0xb318('0x8')](_0x9b189f,{'showHidden':![],'depth':null}));delete _0x9b189f[_0xb318('0x9')];_0xeeafa5[_0xb318('0xa')](_0x455a25)['send'](_0x9b189f);};}exports['index']=function(_0x5dd840,_0x15528a){return info['getAllData']()[_0xb318('0xb')](function(_0x148ca7){return _0x15528a[_0xb318('0xa')](0xc8)[_0xb318('0xc')](_0x148ca7);})[_0xb318('0xd')](function(_0x1506e7){return _0x15528a[_0xb318('0xa')](0x1f4)[_0xb318('0xc')](_0x1506e7);});};exports['killProcess']=function(_0x97666d,_0x4244eb){var _0x52adc8=['components/import/cm'];return new BPromise(function(_0x5ae41a,_0xb1432e){return exec(util[_0xb318('0xe')](_0xb318('0xf'),_0x97666d[_0xb318('0x10')][_0xb318('0x11')]),function(_0x37cc81,_0x3c19ba,_0x9a4ff9){if(_0x37cc81){return _0xb1432e(_0x37cc81);}return _0x5ae41a(_0x3c19ba);});})['then'](function(_0x288a55){var _0x42e3da=![];var _0xab4a2a=_0x288a55[_0xb318('0x12')](/\n/);for(var _0x199b40=0x0,_0x19bd49=_0x52adc8[_0xb318('0x13')];_0x199b40<_0x19bd49,_0x42e3da===![];_0x199b40+=0x1){if(_0x288a55['indexOf'](_0x52adc8[_0x199b40])>=0x0){_0x42e3da=!![];}}if(!_0x42e3da){throw new Error(util[_0xb318('0xe')](_0xb318('0x14'),_0x97666d[_0xb318('0x10')][_0xb318('0x11')]));}process['kill'](_0x97666d[_0xb318('0x10')][_0xb318('0x11')],_0xb318('0x15'));return _0x4244eb[_0xb318('0xa')](0xc8)[_0xb318('0xc')]({'message':util[_0xb318('0xe')](_0xb318('0x16'),_0x97666d[_0xb318('0x10')][_0xb318('0x11')])});})[_0xb318('0xd')](handleError(_0x4244eb,null,_0xb318('0x17')));}; \ No newline at end of file +var _0x01db=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','index','getAllData','then','json','status','format','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','params','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','systeminformation','child_process'];(function(_0x206f4b,_0x346117){var _0x20599c=function(_0x2f15b3){while(--_0x2f15b3){_0x206f4b['push'](_0x206f4b['shift']());}};_0x20599c(++_0x346117);}(_0x01db,0x7b));var _0xb01d=function(_0x58074f,_0x320b58){_0x58074f=_0x58074f-0x0;var _0x179493=_0x01db[_0x58074f];return _0x179493;};'use strict';var info=require(_0xb01d('0x0'));var exec=require(_0xb01d('0x1'))['exec'];var logger=require('../../config/logger')(_0xb01d('0x2'));var util=require(_0xb01d('0x3'));var BPromise=require(_0xb01d('0x4'));var _=require(_0xb01d('0x5'));function handleError(_0x5844b9,_0x2e5525,_0x48324c){_0x2e5525=_0x2e5525||0x1f4;return function(_0x4b2e4f){logger[_0xb01d('0x6')](_0xb01d('0x7'),_0x48324c,_0x2e5525,util[_0xb01d('0x8')](_0x4b2e4f,{'showHidden':![],'depth':null}));delete _0x4b2e4f[_0xb01d('0x9')];_0x5844b9['status'](_0x2e5525)['send'](_0x4b2e4f);};}exports[_0xb01d('0xa')]=function(_0x592133,_0x3c90a5){return info[_0xb01d('0xb')]()[_0xb01d('0xc')](function(_0x3df556){return _0x3c90a5['status'](0xc8)[_0xb01d('0xd')](_0x3df556);})['catch'](function(_0x2dd124){return _0x3c90a5[_0xb01d('0xe')](0x1f4)[_0xb01d('0xd')](_0x2dd124);});};exports['killProcess']=function(_0x2ff7dc,_0x1733c9){var _0x18e132=['components/import/cm'];return new BPromise(function(_0x5d05ca,_0x3b4d99){return exec(util[_0xb01d('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x2ff7dc['params']['pid']),function(_0x38a33f,_0x6df493,_0x10f1a7){if(_0x38a33f){return _0x3b4d99(_0x38a33f);}return _0x5d05ca(_0x6df493);});})['then'](function(_0x62646e){var _0x12a95e=![];var _0x2cb188=_0x62646e[_0xb01d('0x10')](/\n/);for(var _0xb62bc6=0x0,_0x11ce49=_0x18e132[_0xb01d('0x11')];_0xb62bc6<_0x11ce49,_0x12a95e===![];_0xb62bc6+=0x1){if(_0x62646e['indexOf'](_0x18e132[_0xb62bc6])>=0x0){_0x12a95e=!![];}}if(!_0x12a95e){throw new Error(util[_0xb01d('0xf')](_0xb01d('0x12'),_0x2ff7dc[_0xb01d('0x13')][_0xb01d('0x14')]));}process[_0xb01d('0x15')](_0x2ff7dc['params'][_0xb01d('0x14')],'SIGINT');return _0x1733c9[_0xb01d('0xe')](0xc8)[_0xb01d('0xd')]({'message':util[_0xb01d('0xf')](_0xb01d('0x16'),_0x2ff7dc[_0xb01d('0x13')][_0xb01d('0x14')])});})[_0xb01d('0x17')](handleError(_0x1733c9,null,_0xb01d('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index f0839fe..98b5d9b 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 _0x7a52=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','put','delete','multer','path','connect-timeout','express','Router'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x7a52,0x1bd));var _0x27a5=function(_0x456210,_0x4221a8){_0x456210=_0x456210-0x0;var _0x3eb93e=_0x7a52[_0x456210];return _0x3eb93e;};'use strict';var multer=require(_0x27a5('0x0'));var util=require('util');var path=require(_0x27a5('0x1'));var timeout=require(_0x27a5('0x2'));var express=require(_0x27a5('0x3'));var router=express[_0x27a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x27a5('0x5'));var interaction=require(_0x27a5('0x6'));var config=require(_0x27a5('0x7'));var controller=require(_0x27a5('0x8'));router[_0x27a5('0x9')]('/',auth[_0x27a5('0xa')](),controller[_0x27a5('0xb')]);router['get'](_0x27a5('0xc'),auth[_0x27a5('0xa')](),controller['show']);router['post']('/',auth[_0x27a5('0xa')](),controller['create']);router[_0x27a5('0xd')](_0x27a5('0xc'),auth[_0x27a5('0xa')](),controller['update']);router[_0x27a5('0xe')](_0x27a5('0xc'),auth[_0x27a5('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6c57=['../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xb28c53,_0xa65eb4){var _0x502ab=function(_0x15890c){while(--_0x15890c){_0xb28c53['push'](_0xb28c53['shift']());}};_0x502ab(++_0xa65eb4);}(_0x6c57,0x76));var _0x76c5=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x6c57[_0x25248b];return _0x509939;};'use strict';var multer=require(_0x76c5('0x0'));var util=require(_0x76c5('0x1'));var path=require(_0x76c5('0x2'));var timeout=require(_0x76c5('0x3'));var express=require('express');var router=express[_0x76c5('0x4')]();var fs_extra=require(_0x76c5('0x5'));var auth=require(_0x76c5('0x6'));var interaction=require(_0x76c5('0x7'));var config=require(_0x76c5('0x8'));var controller=require('./tag.controller');router['get']('/',auth[_0x76c5('0x9')](),controller[_0x76c5('0xa')]);router[_0x76c5('0xb')]('/:id',auth[_0x76c5('0x9')](),controller[_0x76c5('0xc')]);router[_0x76c5('0xd')]('/',auth[_0x76c5('0x9')](),controller[_0x76c5('0xe')]);router[_0x76c5('0xf')](_0x76c5('0x10'),auth['isAuthenticated'](),controller[_0x76c5('0x11')]);router[_0x76c5('0x12')](_0x76c5('0x10'),auth[_0x76c5('0x9')](),controller[_0x76c5('0x13')]);module[_0x76c5('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 cbc8555..748ee41 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 _0xfff0=['#0091EA','exports','STRING','name'];(function(_0x2635b7,_0x208827){var _0x46837c=function(_0x308137){while(--_0x308137){_0x2635b7['push'](_0x2635b7['shift']());}};_0x46837c(++_0x208827);}(_0xfff0,0x139));var _0x0fff=function(_0x5411a3,_0x38787f){_0x5411a3=_0x5411a3-0x0;var _0x2ab547=_0xfff0[_0x5411a3];return _0x2ab547;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')],'unique':_0x0fff('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x0fff('0x3')},'description':{'type':Sequelize[_0x0fff('0x1')]}}; \ No newline at end of file +var _0xe605=['#0091EA','sequelize','exports','name','STRING'];(function(_0xef4ef0,_0x3c72f9){var _0x39b60b=function(_0x1d824c){while(--_0x1d824c){_0xef4ef0['push'](_0xef4ef0['shift']());}};_0x39b60b(++_0x3c72f9);}(_0xe605,0x92));var _0x5e60=function(_0x4dbc7d,_0x733095){_0x4dbc7d=_0x4dbc7d-0x0;var _0x35a4b4=_0xe605[_0x4dbc7d];return _0x35a4b4;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5e60('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5e60('0x3')],'defaultValue':_0x5e60('0x4')},'description':{'type':Sequelize[_0x5e60('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 529796a..0398f1b 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 _0x5636=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','params','options','find','create','body','user','get','role','UserProfileSection','autoAssociation','catch','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','stack','name','map','Tag','rawAttributes','type','key','model'];(function(_0xd4560f,_0x1a851e){var _0x404a12=function(_0x2cbc8d){while(--_0x2cbc8d){_0xd4560f['push'](_0xd4560f['shift']());}};_0x404a12(++_0x1a851e);}(_0x5636,0x102));var _0x6563=function(_0x33516b,_0x4dfbe5){_0x33516b=_0x33516b-0x0;var _0x5ee2b5=_0x5636[_0x33516b];return _0x5ee2b5;};'use strict';var emlformat=require(_0x6563('0x0'));var rimraf=require(_0x6563('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6563('0x2'));var BPromise=require(_0x6563('0x3'));var Mustache=require(_0x6563('0x4'));var util=require('util');var path=require(_0x6563('0x5'));var sox=require(_0x6563('0x6'));var csv=require(_0x6563('0x7'));var ejs=require(_0x6563('0x8'));var fs=require('fs');var fs_extra=require(_0x6563('0x9'));var _=require(_0x6563('0xa'));var squel=require(_0x6563('0xb'));var crypto=require(_0x6563('0xc'));var jsforce=require(_0x6563('0xd'));var deskjs=require(_0x6563('0xe'));var toCsv=require(_0x6563('0x7'));var querystring=require(_0x6563('0xf'));var Papa=require(_0x6563('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6563('0x11'));var as=require(_0x6563('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6563('0x13'));var config=require(_0x6563('0x14'));var licenseUtil=require(_0x6563('0x15'));var db=require(_0x6563('0x16'))['db'];function respondWithStatusCode(_0x33816e,_0x2ed676){_0x2ed676=_0x2ed676||0xcc;return function(_0x31d3fa){if(_0x31d3fa){return _0x33816e[_0x6563('0x17')](_0x2ed676);}return _0x33816e[_0x6563('0x18')](_0x2ed676)['end']();};}function respondWithResult(_0xa0a0b6,_0x5e9329){_0x5e9329=_0x5e9329||0xc8;return function(_0x37131e){if(_0x37131e){return _0xa0a0b6[_0x6563('0x18')](_0x5e9329)[_0x6563('0x19')](_0x37131e);}};}function respondWithFilteredResult(_0x10d08c,_0x5af5d0){return function(_0x26f26e){if(_0x26f26e){var _0x11baa2=typeof _0x5af5d0[_0x6563('0x1a')]===_0x6563('0x1b')&&typeof _0x5af5d0['limit']===_0x6563('0x1b');var _0x589632=_0x26f26e['count'];var _0x47972a=_0x11baa2?0x0:_0x5af5d0[_0x6563('0x1a')];var _0x4f5609=_0x11baa2?_0x26f26e['count']:_0x5af5d0[_0x6563('0x1a')]+_0x5af5d0[_0x6563('0x1c')];var _0x17a29f;if(_0x4f5609>=_0x589632){_0x4f5609=_0x589632;_0x17a29f=0xc8;}else{_0x17a29f=0xce;}_0x10d08c[_0x6563('0x18')](_0x17a29f);return _0x10d08c[_0x6563('0x1d')](_0x6563('0x1e'),_0x47972a+'-'+_0x4f5609+'/'+_0x589632)[_0x6563('0x19')](_0x26f26e);}return null;};}function patchUpdates(_0x93a45){return function(_0x2a70f0){try{jsonpatch['apply'](_0x2a70f0,_0x93a45,!![]);}catch(_0x2f2905){return BPromise[_0x6563('0x1f')](_0x2f2905);}return _0x2a70f0[_0x6563('0x20')]();};}function saveUpdates(_0x5a335c,_0x293db2){return function(_0x5c37bb){if(_0x5c37bb){return _0x5c37bb[_0x6563('0x21')](_0x5a335c)[_0x6563('0x22')](function(_0x5610b0){return _0x5610b0;});}return null;};}function removeEntity(_0x5773e2,_0x3ab7f6){return function(_0x492f45){if(_0x492f45){return _0x492f45[_0x6563('0x23')]()[_0x6563('0x22')](function(){var _0x20d152=_0x492f45['get']({'plain':!![]});var _0xd860d5='Tags';return db[_0x6563('0x24')][_0x6563('0x23')]({'where':{'type':_0xd860d5,'resourceId':_0x20d152['id']}})['then'](function(){return _0x492f45;});})[_0x6563('0x22')](function(){_0x5773e2[_0x6563('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ddb2b,_0x5b03a7){return function(_0x1fe1cb){if(!_0x1fe1cb){_0x2ddb2b['sendStatus'](0x194);}return _0x1fe1cb;};}function handleError(_0x480408,_0x30f05a){_0x30f05a=_0x30f05a||0x1f4;return function(_0x118d31){logger[_0x6563('0x25')](_0x118d31[_0x6563('0x26')]);if(_0x118d31[_0x6563('0x27')]){delete _0x118d31['name'];}_0x480408[_0x6563('0x18')](_0x30f05a)['send'](_0x118d31);};}exports['index']=function(_0x3582c9,_0x35af37){var _0x1e2ecb={},_0xdbbdda={},_0x116605={'count':0x0,'rows':[]};var _0x305861=_[_0x6563('0x28')](db[_0x6563('0x29')][_0x6563('0x2a')],function(_0x246d53){return{'name':_0x246d53['fieldName'],'type':_0x246d53[_0x6563('0x2b')][_0x6563('0x2c')]};});_0xdbbdda[_0x6563('0x2d')]=_[_0x6563('0x28')](_0x305861,_0x6563('0x27'));_0xdbbdda[_0x6563('0x2e')]=_[_0x6563('0x2f')](_0x3582c9['query']);_0xdbbdda[_0x6563('0x30')]=_[_0x6563('0x31')](_0xdbbdda[_0x6563('0x2d')],_0xdbbdda[_0x6563('0x2e')]);_0x1e2ecb[_0x6563('0x32')]=_[_0x6563('0x31')](_0xdbbdda['model'],qs[_0x6563('0x33')](_0x3582c9[_0x6563('0x2e')][_0x6563('0x33')]));_0x1e2ecb[_0x6563('0x32')]=_0x1e2ecb[_0x6563('0x32')][_0x6563('0x34')]?_0x1e2ecb[_0x6563('0x32')]:_0xdbbdda['model'];if(!_0x3582c9[_0x6563('0x2e')][_0x6563('0x35')]('nolimit')){_0x1e2ecb[_0x6563('0x1c')]=qs[_0x6563('0x1c')](_0x3582c9['query']['limit']);_0x1e2ecb[_0x6563('0x1a')]=qs[_0x6563('0x1a')](_0x3582c9[_0x6563('0x2e')][_0x6563('0x1a')]);}_0x1e2ecb['order']=qs[_0x6563('0x36')](_0x3582c9[_0x6563('0x2e')]['sort']);_0x1e2ecb[_0x6563('0x37')]=qs[_0x6563('0x30')](_[_0x6563('0x38')](_0x3582c9[_0x6563('0x2e')],_0xdbbdda[_0x6563('0x30')]),_0x305861);if(_0x3582c9[_0x6563('0x2e')][_0x6563('0x39')]){_0x1e2ecb[_0x6563('0x37')]=_[_0x6563('0x3a')](_0x1e2ecb['where'],{'$or':_[_0x6563('0x28')](_0x305861,function(_0x772286){if(_0x772286[_0x6563('0x2b')]!==_0x6563('0x3b')){var _0x5ebe88={};_0x5ebe88[_0x772286['name']]={'$like':'%'+_0x3582c9[_0x6563('0x2e')][_0x6563('0x39')]+'%'};return _0x5ebe88;}})});}_0x1e2ecb=_[_0x6563('0x3a')]({},_0x1e2ecb,_0x3582c9['options']);var _0x3eadab={'where':_0x1e2ecb['where']};return db[_0x6563('0x29')][_0x6563('0x3c')](_0x3eadab)['then'](function(_0x13d9d9){_0x116605[_0x6563('0x3c')]=_0x13d9d9;if(_0x3582c9[_0x6563('0x2e')][_0x6563('0x3d')]){_0x1e2ecb[_0x6563('0x3e')]=[{'all':!![]}];}return db[_0x6563('0x29')][_0x6563('0x3f')](_0x1e2ecb);})[_0x6563('0x22')](function(_0xd30789){_0x116605[_0x6563('0x40')]=_0xd30789;return _0x116605;})[_0x6563('0x22')](respondWithFilteredResult(_0x35af37,_0x1e2ecb))['catch'](handleError(_0x35af37,null));};exports['show']=function(_0x38eab4,_0x3835f6){var _0x43a33e={'raw':!![],'where':{'id':_0x38eab4[_0x6563('0x41')]['id']}},_0x2f2aa6={};_0x2f2aa6[_0x6563('0x2d')]=_[_0x6563('0x2f')](db['Tag'][_0x6563('0x2a')]);_0x2f2aa6[_0x6563('0x2e')]=_[_0x6563('0x2f')](_0x38eab4[_0x6563('0x2e')]);_0x2f2aa6['filters']=_[_0x6563('0x31')](_0x2f2aa6[_0x6563('0x2d')],_0x2f2aa6[_0x6563('0x2e')]);_0x43a33e[_0x6563('0x32')]=_[_0x6563('0x31')](_0x2f2aa6['model'],qs['fields'](_0x38eab4[_0x6563('0x2e')][_0x6563('0x33')]));_0x43a33e[_0x6563('0x32')]=_0x43a33e['attributes'][_0x6563('0x34')]?_0x43a33e[_0x6563('0x32')]:_0x2f2aa6[_0x6563('0x2d')];if(_0x38eab4[_0x6563('0x2e')]['includeAll']){_0x43a33e[_0x6563('0x3e')]=[{'all':!![]}];}_0x43a33e=_[_0x6563('0x3a')]({},_0x43a33e,_0x38eab4[_0x6563('0x42')]);return db['Tag'][_0x6563('0x43')](_0x43a33e)['then'](handleEntityNotFound(_0x3835f6,null))[_0x6563('0x22')](respondWithResult(_0x3835f6,null))['catch'](handleError(_0x3835f6,null));};exports['create']=function(_0x1ef2da,_0x11617b){return db[_0x6563('0x29')][_0x6563('0x44')](_0x1ef2da[_0x6563('0x45')],{})[_0x6563('0x22')](function(_0x2eb8ee){var _0x16da30=_0x1ef2da[_0x6563('0x46')][_0x6563('0x47')]({'plain':!![]});if(!_0x16da30)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16da30[_0x6563('0x48')]==='user'){var _0x22306a=_0x2eb8ee[_0x6563('0x47')]({'plain':!![]});var _0x19062a='Tags';return db[_0x6563('0x49')][_0x6563('0x43')]({'where':{'name':_0x19062a,'userProfileId':_0x16da30['userProfileId']},'raw':!![]})[_0x6563('0x22')](function(_0x391d23){if(_0x391d23&&_0x391d23[_0x6563('0x4a')]===0x0){return db[_0x6563('0x24')][_0x6563('0x44')]({'name':_0x22306a['name'],'resourceId':_0x22306a['id'],'type':_0x391d23[_0x6563('0x27')],'sectionId':_0x391d23['id']},{})['then'](function(){return _0x2eb8ee;});}else{return _0x2eb8ee;}})[_0x6563('0x4b')](function(_0x5dc3a5){logger[_0x6563('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc3a5);throw _0x5dc3a5;});}return _0x2eb8ee;})['then'](respondWithResult(_0x11617b,0xc9))['catch'](handleError(_0x11617b,null));};exports['update']=function(_0x270667,_0x5ade56){if(_0x270667[_0x6563('0x45')]['id']){delete _0x270667['body']['id'];}return db[_0x6563('0x29')][_0x6563('0x43')]({'where':{'id':_0x270667[_0x6563('0x41')]['id']}})[_0x6563('0x22')](handleEntityNotFound(_0x5ade56,null))[_0x6563('0x22')](saveUpdates(_0x270667[_0x6563('0x45')],null))[_0x6563('0x22')](respondWithResult(_0x5ade56,null))[_0x6563('0x4b')](handleError(_0x5ade56,null));};exports[_0x6563('0x23')]=function(_0x5827da,_0x386ae9){return db[_0x6563('0x29')][_0x6563('0x43')]({'where':{'id':_0x5827da[_0x6563('0x41')]['id']}})[_0x6563('0x22')](handleEntityNotFound(_0x386ae9,null))[_0x6563('0x22')](removeEntity(_0x386ae9,null))[_0x6563('0x4b')](handleError(_0x386ae9,null));}; \ No newline at end of file +var _0x3eec=['set','Content-Range','apply','reject','save','update','then','get','Tags','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','Tag','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit'];(function(_0x58d29c,_0x5a9547){var _0x5d60b6=function(_0x1c3cfa){while(--_0x1c3cfa){_0x58d29c['push'](_0x58d29c['shift']());}};_0x5d60b6(++_0x5a9547);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x5125c3,_0x28f6b6){_0x5125c3=_0x5125c3-0x0;var _0x443f78=_0x3eec[_0x5125c3];return _0x443f78;};'use strict';var emlformat=require(_0xc3ee('0x0'));var rimraf=require(_0xc3ee('0x1'));var zipdir=require(_0xc3ee('0x2'));var jsonpatch=require(_0xc3ee('0x3'));var rp=require('request-promise');var moment=require(_0xc3ee('0x4'));var BPromise=require(_0xc3ee('0x5'));var Mustache=require(_0xc3ee('0x6'));var util=require(_0xc3ee('0x7'));var path=require(_0xc3ee('0x8'));var sox=require(_0xc3ee('0x9'));var csv=require('to-csv');var ejs=require(_0xc3ee('0xa'));var fs=require('fs');var fs_extra=require(_0xc3ee('0xb'));var _=require(_0xc3ee('0xc'));var squel=require(_0xc3ee('0xd'));var crypto=require(_0xc3ee('0xe'));var jsforce=require(_0xc3ee('0xf'));var deskjs=require(_0xc3ee('0x10'));var toCsv=require(_0xc3ee('0x11'));var querystring=require(_0xc3ee('0x12'));var Papa=require(_0xc3ee('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc3ee('0x14'));var as=require(_0xc3ee('0x15'));var hardwareService=require(_0xc3ee('0x16'));var logger=require(_0xc3ee('0x17'))('api');var utils=require(_0xc3ee('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc3ee('0x19'));var db=require(_0xc3ee('0x1a'))['db'];function respondWithStatusCode(_0x4beb01,_0x5f2c3a){_0x5f2c3a=_0x5f2c3a||0xcc;return function(_0x2eb82e){if(_0x2eb82e){return _0x4beb01['sendStatus'](_0x5f2c3a);}return _0x4beb01[_0xc3ee('0x1b')](_0x5f2c3a)['end']();};}function respondWithResult(_0x19feb3,_0x58ebe7){_0x58ebe7=_0x58ebe7||0xc8;return function(_0x3d669d){if(_0x3d669d){return _0x19feb3[_0xc3ee('0x1b')](_0x58ebe7)[_0xc3ee('0x1c')](_0x3d669d);}};}function respondWithFilteredResult(_0x664bad,_0x476f8f){return function(_0xf63359){if(_0xf63359){var _0x277e11=typeof _0x476f8f['offset']===_0xc3ee('0x1d')&&typeof _0x476f8f['limit']===_0xc3ee('0x1d');var _0x1bf49a=_0xf63359[_0xc3ee('0x1e')];var _0x219db0=_0x277e11?0x0:_0x476f8f[_0xc3ee('0x1f')];var _0x3acb0c=_0x277e11?_0xf63359[_0xc3ee('0x1e')]:_0x476f8f[_0xc3ee('0x1f')]+_0x476f8f[_0xc3ee('0x20')];var _0x202a9a;if(_0x3acb0c>=_0x1bf49a){_0x3acb0c=_0x1bf49a;_0x202a9a=0xc8;}else{_0x202a9a=0xce;}_0x664bad[_0xc3ee('0x1b')](_0x202a9a);return _0x664bad[_0xc3ee('0x21')](_0xc3ee('0x22'),_0x219db0+'-'+_0x3acb0c+'/'+_0x1bf49a)[_0xc3ee('0x1c')](_0xf63359);}return null;};}function patchUpdates(_0x3e7224){return function(_0x46a8c9){try{jsonpatch[_0xc3ee('0x23')](_0x46a8c9,_0x3e7224,!![]);}catch(_0x30df3a){return BPromise[_0xc3ee('0x24')](_0x30df3a);}return _0x46a8c9[_0xc3ee('0x25')]();};}function saveUpdates(_0x11778f,_0x493fea){return function(_0x4d672e){if(_0x4d672e){return _0x4d672e[_0xc3ee('0x26')](_0x11778f)[_0xc3ee('0x27')](function(_0x3b8f75){return _0x3b8f75;});}return null;};}function removeEntity(_0x464ffc,_0x28bfeb){return function(_0x238df7){if(_0x238df7){return _0x238df7['destroy']()[_0xc3ee('0x27')](function(){var _0x3f8f7b=_0x238df7[_0xc3ee('0x28')]({'plain':!![]});var _0xfd03bd=_0xc3ee('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xfd03bd,'resourceId':_0x3f8f7b['id']}})[_0xc3ee('0x27')](function(){return _0x238df7;});})[_0xc3ee('0x27')](function(){_0x464ffc[_0xc3ee('0x1b')](0xcc)[_0xc3ee('0x2a')]();});}};}function handleEntityNotFound(_0x836fac,_0x4ecfec){return function(_0x56201a){if(!_0x56201a){_0x836fac['sendStatus'](0x194);}return _0x56201a;};}function handleError(_0x1be005,_0x2f2c29){_0x2f2c29=_0x2f2c29||0x1f4;return function(_0x44678b){logger[_0xc3ee('0x2b')](_0x44678b[_0xc3ee('0x2c')]);if(_0x44678b['name']){delete _0x44678b[_0xc3ee('0x2d')];}_0x1be005[_0xc3ee('0x1b')](_0x2f2c29)[_0xc3ee('0x2e')](_0x44678b);};}exports[_0xc3ee('0x2f')]=function(_0x1f7b3a,_0x8bbe1e){var _0x3b17f7={},_0x4da264={},_0x330b71={'count':0x0,'rows':[]};var _0x35c19a=_[_0xc3ee('0x30')](db['Tag'][_0xc3ee('0x31')],function(_0x240a16){return{'name':_0x240a16[_0xc3ee('0x32')],'type':_0x240a16[_0xc3ee('0x33')][_0xc3ee('0x34')]};});_0x4da264[_0xc3ee('0x35')]=_[_0xc3ee('0x30')](_0x35c19a,'name');_0x4da264[_0xc3ee('0x36')]=_['keys'](_0x1f7b3a[_0xc3ee('0x36')]);_0x4da264[_0xc3ee('0x37')]=_[_0xc3ee('0x38')](_0x4da264[_0xc3ee('0x35')],_0x4da264[_0xc3ee('0x36')]);_0x3b17f7[_0xc3ee('0x39')]=_['intersection'](_0x4da264[_0xc3ee('0x35')],qs[_0xc3ee('0x3a')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x3a')]));_0x3b17f7[_0xc3ee('0x39')]=_0x3b17f7[_0xc3ee('0x39')][_0xc3ee('0x3b')]?_0x3b17f7[_0xc3ee('0x39')]:_0x4da264[_0xc3ee('0x35')];if(!_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x3c')](_0xc3ee('0x3d'))){_0x3b17f7[_0xc3ee('0x20')]=qs[_0xc3ee('0x20')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x20')]);_0x3b17f7[_0xc3ee('0x1f')]=qs[_0xc3ee('0x1f')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x1f')]);}_0x3b17f7[_0xc3ee('0x3e')]=qs['sort'](_0x1f7b3a[_0xc3ee('0x36')]['sort']);_0x3b17f7[_0xc3ee('0x3f')]=qs[_0xc3ee('0x37')](_[_0xc3ee('0x40')](_0x1f7b3a[_0xc3ee('0x36')],_0x4da264[_0xc3ee('0x37')]),_0x35c19a);if(_0x1f7b3a[_0xc3ee('0x36')]['filter']){_0x3b17f7[_0xc3ee('0x3f')]=_[_0xc3ee('0x41')](_0x3b17f7[_0xc3ee('0x3f')],{'$or':_['map'](_0x35c19a,function(_0x181179){if(_0x181179[_0xc3ee('0x33')]!==_0xc3ee('0x42')){var _0x1fe17f={};_0x1fe17f[_0x181179[_0xc3ee('0x2d')]]={'$like':'%'+_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x43')]+'%'};return _0x1fe17f;}})});}_0x3b17f7=_[_0xc3ee('0x41')]({},_0x3b17f7,_0x1f7b3a[_0xc3ee('0x44')]);var _0x23d365={'where':_0x3b17f7[_0xc3ee('0x3f')]};return db['Tag'][_0xc3ee('0x1e')](_0x23d365)[_0xc3ee('0x27')](function(_0x4a89b7){_0x330b71['count']=_0x4a89b7;if(_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x45')]){_0x3b17f7[_0xc3ee('0x46')]=[{'all':!![]}];}return db['Tag'][_0xc3ee('0x47')](_0x3b17f7);})[_0xc3ee('0x27')](function(_0x112e77){_0x330b71[_0xc3ee('0x48')]=_0x112e77;return _0x330b71;})[_0xc3ee('0x27')](respondWithFilteredResult(_0x8bbe1e,_0x3b17f7))[_0xc3ee('0x49')](handleError(_0x8bbe1e,null));};exports[_0xc3ee('0x4a')]=function(_0x724c4e,_0x49b424){var _0x602d47={'raw':!![],'where':{'id':_0x724c4e[_0xc3ee('0x4b')]['id']}},_0xf833d9={};_0xf833d9[_0xc3ee('0x35')]=_[_0xc3ee('0x4c')](db['Tag'][_0xc3ee('0x31')]);_0xf833d9['query']=_['keys'](_0x724c4e[_0xc3ee('0x36')]);_0xf833d9[_0xc3ee('0x37')]=_['intersection'](_0xf833d9[_0xc3ee('0x35')],_0xf833d9[_0xc3ee('0x36')]);_0x602d47['attributes']=_[_0xc3ee('0x38')](_0xf833d9['model'],qs[_0xc3ee('0x3a')](_0x724c4e['query'][_0xc3ee('0x3a')]));_0x602d47[_0xc3ee('0x39')]=_0x602d47['attributes']['length']?_0x602d47['attributes']:_0xf833d9[_0xc3ee('0x35')];if(_0x724c4e[_0xc3ee('0x36')][_0xc3ee('0x45')]){_0x602d47[_0xc3ee('0x46')]=[{'all':!![]}];}_0x602d47=_[_0xc3ee('0x41')]({},_0x602d47,_0x724c4e['options']);return db['Tag'][_0xc3ee('0x4d')](_0x602d47)[_0xc3ee('0x27')](handleEntityNotFound(_0x49b424,null))['then'](respondWithResult(_0x49b424,null))[_0xc3ee('0x49')](handleError(_0x49b424,null));};exports['create']=function(_0x60e36a,_0x5d0017){return db[_0xc3ee('0x4e')][_0xc3ee('0x4f')](_0x60e36a[_0xc3ee('0x50')],{})[_0xc3ee('0x27')](function(_0x8c8cc6){var _0x281adc=_0x60e36a[_0xc3ee('0x51')]['get']({'plain':!![]});if(!_0x281adc)throw new Error(_0xc3ee('0x52'));if(_0x281adc[_0xc3ee('0x53')]===_0xc3ee('0x51')){var _0x237aa8=_0x8c8cc6['get']({'plain':!![]});var _0xd246f2=_0xc3ee('0x29');return db[_0xc3ee('0x54')][_0xc3ee('0x4d')]({'where':{'name':_0xd246f2,'userProfileId':_0x281adc[_0xc3ee('0x55')]},'raw':!![]})[_0xc3ee('0x27')](function(_0x14df9d){if(_0x14df9d&&_0x14df9d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x237aa8['name'],'resourceId':_0x237aa8['id'],'type':_0x14df9d[_0xc3ee('0x2d')],'sectionId':_0x14df9d['id']},{})[_0xc3ee('0x27')](function(){return _0x8c8cc6;});}else{return _0x8c8cc6;}})[_0xc3ee('0x49')](function(_0x2b9ea){logger[_0xc3ee('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b9ea);throw _0x2b9ea;});}return _0x8c8cc6;})['then'](respondWithResult(_0x5d0017,0xc9))[_0xc3ee('0x49')](handleError(_0x5d0017,null));};exports['update']=function(_0x1ca127,_0x28eca9){if(_0x1ca127[_0xc3ee('0x50')]['id']){delete _0x1ca127['body']['id'];}return db[_0xc3ee('0x4e')][_0xc3ee('0x4d')]({'where':{'id':_0x1ca127[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x28eca9,null))[_0xc3ee('0x27')](saveUpdates(_0x1ca127[_0xc3ee('0x50')],null))[_0xc3ee('0x27')](respondWithResult(_0x28eca9,null))[_0xc3ee('0x49')](handleError(_0x28eca9,null));};exports[_0xc3ee('0x56')]=function(_0x5d5ca5,_0x3fdc8f){return db[_0xc3ee('0x4e')][_0xc3ee('0x4d')]({'where':{'id':_0x5d5ca5[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x3fdc8f,null))[_0xc3ee('0x27')](removeEntity(_0x3fdc8f,null))[_0xc3ee('0x49')](handleError(_0x3fdc8f,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 7bdb529..bec07e1 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 _0xec60=['../../config/logger','api','moment','bluebird','path','rimraf','./tag.attributes','define','Tag','tools_tags','lodash','util'];(function(_0x53619e,_0x53f9f7){var _0x1e8609=function(_0x12d7af){while(--_0x12d7af){_0x53619e['push'](_0x53619e['shift']());}};_0x1e8609(++_0x53f9f7);}(_0xec60,0x1de));var _0x0ec6=function(_0x1e340a,_0x1df949){_0x1e340a=_0x1e340a-0x0;var _0x164360=_0xec60[_0x1e340a];return _0x164360;};'use strict';var _=require(_0x0ec6('0x0'));var util=require(_0x0ec6('0x1'));var logger=require(_0x0ec6('0x2'))(_0x0ec6('0x3'));var moment=require(_0x0ec6('0x4'));var BPromise=require(_0x0ec6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ec6('0x6'));var rimraf=require(_0x0ec6('0x7'));var config=require('../../config/environment');var attributes=require(_0x0ec6('0x8'));module['exports']=function(_0x57d5d4,_0x539009){return _0x57d5d4[_0x0ec6('0x9')](_0x0ec6('0xa'),attributes,{'tableName':_0x0ec6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfcc=['moment','bluebird','request-promise','rimraf','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x592f83,_0x262762){var _0x9bbfec=function(_0x3b048f){while(--_0x3b048f){_0x592f83['push'](_0x592f83['shift']());}};_0x9bbfec(++_0x262762);}(_0xdfcc,0x8d));var _0xcdfc=function(_0x5a26db,_0x2c5ccd){_0x5a26db=_0x5a26db-0x0;var _0x4619dd=_0xdfcc[_0x5a26db];return _0x4619dd;};'use strict';var _=require(_0xcdfc('0x0'));var util=require(_0xcdfc('0x1'));var logger=require(_0xcdfc('0x2'))('api');var moment=require(_0xcdfc('0x3'));var BPromise=require(_0xcdfc('0x4'));var rp=require(_0xcdfc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdfc('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module['exports']=function(_0xa928f6,_0x155d4c){return _0xa928f6['define'](_0xcdfc('0x7'),attributes,{'tableName':_0xcdfc('0x8'),'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 443535c..1f49d2f 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 _0x0c6d=['code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x1991ae,_0x15df8a){_0x1991ae=_0x1991ae-0x0;var _0x2ad193=_0x0c6d[_0x1991ae];return _0x2ad193;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var moment=require(_0xd0c6('0x1'));var BPromise=require(_0xd0c6('0x2'));var rs=require(_0xd0c6('0x3'));var fs=require('fs');var Redis=require(_0xd0c6('0x4'));var db=require(_0xd0c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0c6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0c6('0x7')][_0xd0c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4a64,_0x5de1cd,_0x16c6da){return new BPromise(function(_0x534412,_0x2a14f1){return client[_0xd0c6('0x9')](_0x2d4a64,_0x16c6da)[_0xd0c6('0xa')](function(_0x184f65){logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));logger[_0xd0c6('0xe')](_0xd0c6('0xf'),_0x5de1cd,'request\x20sent',JSON[_0xd0c6('0x10')](_0x184f65));if(_0x184f65['error']){if(_0x184f65['error'][_0xd0c6('0x11')]===0x1f4){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x2a14f1(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x534412(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}else{logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));_0x534412(_0x184f65[_0xd0c6('0x14')][_0xd0c6('0x13')]);}})[_0xd0c6('0x15')](function(_0x19dd14){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x19dd14);_0x2a14f1(_0x19dd14);});});} \ No newline at end of file +var _0x8664=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x35e7f5,_0x2c52b8){var _0x290a15=function(_0x4df64b){while(--_0x4df64b){_0x35e7f5['push'](_0x35e7f5['shift']());}};_0x290a15(++_0x2c52b8);}(_0x8664,0x11a));var _0x4866=function(_0x51dc7c,_0x5af260){_0x51dc7c=_0x51dc7c-0x0;var _0x77ec21=_0x8664[_0x51dc7c];return _0x77ec21;};'use strict';var _=require(_0x4866('0x0'));var util=require(_0x4866('0x1'));var moment=require(_0x4866('0x2'));var BPromise=require(_0x4866('0x3'));var rs=require(_0x4866('0x4'));var fs=require('fs');var Redis=require(_0x4866('0x5'));var db=require(_0x4866('0x6'))['db'];var utils=require(_0x4866('0x7'));var logger=require(_0x4866('0x8'))('rpc');var config=require(_0x4866('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4866('0xa')][_0x4866('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x439f55,_0x10f7c1,_0x2b4bb0){return new BPromise(function(_0x142f18,_0x4e07e3){return client[_0x4866('0xc')](_0x439f55,_0x2b4bb0)[_0x4866('0xd')](function(_0x10a369){logger[_0x4866('0xe')](_0x4866('0xf'),_0x10f7c1,'request\x20sent');logger[_0x4866('0x10')](_0x4866('0x11'),_0x10f7c1,'request\x20sent',JSON[_0x4866('0x12')](_0x10a369));if(_0x10a369[_0x4866('0x13')]){if(_0x10a369['error']['code']===0x1f4){logger['error'](_0x4866('0xf'),_0x10f7c1,_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);return _0x4e07e3(_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);}logger[_0x4866('0x13')]('Tag,\x20%s,\x20%s',_0x10f7c1,_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);return _0x142f18(_0x10a369['error'][_0x4866('0x14')]);}else{logger[_0x4866('0xe')](_0x4866('0xf'),_0x10f7c1,_0x4866('0x15'));_0x142f18(_0x10a369[_0x4866('0x16')][_0x4866('0x14')]);}})[_0x4866('0x17')](function(_0x653916){logger[_0x4866('0x13')]('Tag,\x20%s,\x20%s',_0x10f7c1,_0x653916);_0x4e07e3(_0x653916);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index dfb07ce..3c3c64d 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 a0a9c75..a9a1dda 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 _0xd8b0=['exports','sequelize'];(function(_0x1e460b,_0x235c14){var _0x5150c3=function(_0x448704){while(--_0x448704){_0x1e460b['push'](_0x1e460b['shift']());}};_0x5150c3(++_0x235c14);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x4ce993,_0x5e47fc){var _0x186eee=function(_0x13d593){while(--_0x13d593){_0x4ce993['push'](_0x4ce993['shift']());}};_0x186eee(++_0x5e47fc);}(_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'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index efe9cad..2e3b099 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 _0xb878=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','filters','order','capitalize','addQueues','Sequelize','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Whatsapp','transaction','through','penalty','Queues','QueueId','User','findOrCreate','Queue:save','online','voicePause','UserVoiceQueueRt','isNil','interface','format','TeamVoiceQueue','all','TeamVoicePrefix','UserVoicePrefix','upsert','removeAgents','Mail','Openchannel','emit','Queue:remove','VoicePrefixId','getAgents','eml-format','zip-dir','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/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./team.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','map','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','options','Team','includeAll','include','rows','show','params','rawAttributes','length','merge','find','catch','create','body','user'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xb878,0xbf));var _0x8b87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb878[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8b87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b87('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8b87('0x2'));var Mustache=require(_0x8b87('0x3'));var util=require('util');var path=require('path');var sox=require(_0x8b87('0x4'));var csv=require(_0x8b87('0x5'));var ejs=require(_0x8b87('0x6'));var fs=require('fs');var fs_extra=require(_0x8b87('0x7'));var _=require(_0x8b87('0x8'));var squel=require(_0x8b87('0x9'));var crypto=require(_0x8b87('0xa'));var jsforce=require(_0x8b87('0xb'));var deskjs=require(_0x8b87('0xc'));var toCsv=require(_0x8b87('0x5'));var querystring=require(_0x8b87('0xd'));var Papa=require(_0x8b87('0xe'));var Redis=require(_0x8b87('0xf'));var authService=require(_0x8b87('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8b87('0x11'));var hardwareService=require(_0x8b87('0x12'));var logger=require(_0x8b87('0x13'))(_0x8b87('0x14'));var utils=require(_0x8b87('0x15'));var config=require(_0x8b87('0x16'));var licenseUtil=require(_0x8b87('0x17'));var db=require(_0x8b87('0x18'))['db'];config['redis']=_[_0x8b87('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8b87('0x1a'))(new Redis(config[_0x8b87('0x1b')]));require(_0x8b87('0x1c'))[_0x8b87('0x1d')](socket);function respondWithStatusCode(_0x2454e1,_0x57eb51){_0x57eb51=_0x57eb51||0xcc;return function(_0x56a296){if(_0x56a296){return _0x2454e1['sendStatus'](_0x57eb51);}return _0x2454e1[_0x8b87('0x1e')](_0x57eb51)[_0x8b87('0x1f')]();};}function respondWithResult(_0x21e74b,_0x1b1ed5){_0x1b1ed5=_0x1b1ed5||0xc8;return function(_0x2b4ff2){if(_0x2b4ff2){return _0x21e74b[_0x8b87('0x1e')](_0x1b1ed5)[_0x8b87('0x20')](_0x2b4ff2);}};}function respondWithFilteredResult(_0x54b675,_0xaefe18){return function(_0x4324bf){if(_0x4324bf){var _0x259844=typeof _0xaefe18['offset']===_0x8b87('0x21')&&typeof _0xaefe18['limit']===_0x8b87('0x21');var _0x3387d7=_0x4324bf[_0x8b87('0x22')];var _0x448115=_0x259844?0x0:_0xaefe18[_0x8b87('0x23')];var _0x107f0a=_0x259844?_0x4324bf[_0x8b87('0x22')]:_0xaefe18[_0x8b87('0x23')]+_0xaefe18[_0x8b87('0x24')];var _0x45b521;if(_0x107f0a>=_0x3387d7){_0x107f0a=_0x3387d7;_0x45b521=0xc8;}else{_0x45b521=0xce;}_0x54b675['status'](_0x45b521);return _0x54b675[_0x8b87('0x25')](_0x8b87('0x26'),_0x448115+'-'+_0x107f0a+'/'+_0x3387d7)[_0x8b87('0x20')](_0x4324bf);}return null;};}function patchUpdates(_0x1dcda7){return function(_0x4d1e93){try{jsonpatch[_0x8b87('0x27')](_0x4d1e93,_0x1dcda7,!![]);}catch(_0x36413e){return BPromise[_0x8b87('0x28')](_0x36413e);}return _0x4d1e93[_0x8b87('0x29')]();};}function saveUpdates(_0x24d33d,_0x5a1e94){return function(_0x31b3ee){if(_0x31b3ee){return _0x31b3ee[_0x8b87('0x2a')](_0x24d33d)[_0x8b87('0x2b')](function(_0x4d68bf){return _0x4d68bf;});}return null;};}function removeEntity(_0x9a33e1,_0x4f233e){return function(_0x93ba79){if(_0x93ba79){return _0x93ba79[_0x8b87('0x2c')]()[_0x8b87('0x2b')](function(){var _0x3c94c9=_0x93ba79[_0x8b87('0x2d')]({'plain':!![]});var _0x37ffda='Teams';return db[_0x8b87('0x2e')][_0x8b87('0x2c')]({'where':{'type':_0x37ffda,'resourceId':_0x3c94c9['id']}})[_0x8b87('0x2b')](function(){return _0x93ba79;});})[_0x8b87('0x2b')](function(){_0x9a33e1[_0x8b87('0x1e')](0xcc)[_0x8b87('0x1f')]();});}};}function handleEntityNotFound(_0xaa9d0f,_0x38197f){return function(_0x207131){if(!_0x207131){_0xaa9d0f['sendStatus'](0x194);}return _0x207131;};}function handleError(_0x29f387,_0x25a9b8){_0x25a9b8=_0x25a9b8||0x1f4;return function(_0x3e60cd){logger['error'](_0x3e60cd['stack']);if(_0x3e60cd[_0x8b87('0x2f')]){delete _0x3e60cd[_0x8b87('0x2f')];}_0x29f387['status'](_0x25a9b8)[_0x8b87('0x30')](_0x3e60cd);};}exports[_0x8b87('0x31')]=function(_0x44ae2f,_0x2dbf12){var _0x107787={},_0x5e19aa={},_0x1f9e01={'count':0x0,'rows':[]};var _0x232ba8=_[_0x8b87('0x32')](db['Team']['rawAttributes'],function(_0x218ffb){return{'name':_0x218ffb['fieldName'],'type':_0x218ffb[_0x8b87('0x33')][_0x8b87('0x34')]};});_0x5e19aa['model']=_[_0x8b87('0x32')](_0x232ba8,_0x8b87('0x2f'));_0x5e19aa[_0x8b87('0x35')]=_[_0x8b87('0x36')](_0x44ae2f[_0x8b87('0x35')]);_0x5e19aa['filters']=_[_0x8b87('0x37')](_0x5e19aa[_0x8b87('0x38')],_0x5e19aa[_0x8b87('0x35')]);_0x107787[_0x8b87('0x39')]=_['intersection'](_0x5e19aa[_0x8b87('0x38')],qs[_0x8b87('0x3a')](_0x44ae2f['query'][_0x8b87('0x3a')]));_0x107787[_0x8b87('0x39')]=_0x107787[_0x8b87('0x39')]['length']?_0x107787[_0x8b87('0x39')]:_0x5e19aa[_0x8b87('0x38')];if(!_0x44ae2f[_0x8b87('0x35')][_0x8b87('0x3b')](_0x8b87('0x3c'))){_0x107787[_0x8b87('0x24')]=qs[_0x8b87('0x24')](_0x44ae2f[_0x8b87('0x35')][_0x8b87('0x24')]);_0x107787[_0x8b87('0x23')]=qs['offset'](_0x44ae2f[_0x8b87('0x35')]['offset']);}_0x107787['order']=qs[_0x8b87('0x3d')](_0x44ae2f[_0x8b87('0x35')][_0x8b87('0x3d')]);_0x107787['where']=qs['filters'](_['pick'](_0x44ae2f[_0x8b87('0x35')],_0x5e19aa['filters']),_0x232ba8);if(_0x44ae2f[_0x8b87('0x35')][_0x8b87('0x3e')]){_0x107787[_0x8b87('0x3f')]=_['merge'](_0x107787[_0x8b87('0x3f')],{'$or':_[_0x8b87('0x32')](_0x232ba8,function(_0x5caff7){if(_0x5caff7['type']!=='VIRTUAL'){var _0x30f948={};_0x30f948[_0x5caff7['name']]={'$like':'%'+_0x44ae2f[_0x8b87('0x35')][_0x8b87('0x3e')]+'%'};return _0x30f948;}})});}_0x107787=_['merge']({},_0x107787,_0x44ae2f[_0x8b87('0x40')]);var _0x6ef0f2={'where':_0x107787[_0x8b87('0x3f')]};return db[_0x8b87('0x41')][_0x8b87('0x22')](_0x6ef0f2)[_0x8b87('0x2b')](function(_0x3a5821){_0x1f9e01[_0x8b87('0x22')]=_0x3a5821;if(_0x44ae2f[_0x8b87('0x35')][_0x8b87('0x42')]){_0x107787[_0x8b87('0x43')]=[{'all':!![]}];}return db[_0x8b87('0x41')]['findAll'](_0x107787);})[_0x8b87('0x2b')](function(_0x4f31b1){_0x1f9e01[_0x8b87('0x44')]=_0x4f31b1;return _0x1f9e01;})[_0x8b87('0x2b')](respondWithFilteredResult(_0x2dbf12,_0x107787))['catch'](handleError(_0x2dbf12,null));};exports[_0x8b87('0x45')]=function(_0x4531da,_0x307e5c){var _0x72fef2={'raw':![],'where':{'id':_0x4531da[_0x8b87('0x46')]['id']}},_0x1ac26d={};_0x1ac26d[_0x8b87('0x38')]=_[_0x8b87('0x36')](db[_0x8b87('0x41')][_0x8b87('0x47')]);_0x1ac26d[_0x8b87('0x35')]=_[_0x8b87('0x36')](_0x4531da[_0x8b87('0x35')]);_0x1ac26d['filters']=_['intersection'](_0x1ac26d['model'],_0x1ac26d['query']);_0x72fef2[_0x8b87('0x39')]=_[_0x8b87('0x37')](_0x1ac26d[_0x8b87('0x38')],qs[_0x8b87('0x3a')](_0x4531da[_0x8b87('0x35')][_0x8b87('0x3a')]));_0x72fef2[_0x8b87('0x39')]=_0x72fef2['attributes'][_0x8b87('0x48')]?_0x72fef2[_0x8b87('0x39')]:_0x1ac26d[_0x8b87('0x38')];if(_0x4531da[_0x8b87('0x35')][_0x8b87('0x42')]){_0x72fef2[_0x8b87('0x43')]=[{'all':!![]}];}_0x72fef2=_[_0x8b87('0x49')]({},_0x72fef2,_0x4531da[_0x8b87('0x40')]);return db[_0x8b87('0x41')][_0x8b87('0x4a')](_0x72fef2)[_0x8b87('0x2b')](handleEntityNotFound(_0x307e5c,null))[_0x8b87('0x2b')](respondWithResult(_0x307e5c,null))[_0x8b87('0x4b')](handleError(_0x307e5c,null));};exports['create']=function(_0x4b3d75,_0x1a8c23){return db[_0x8b87('0x41')][_0x8b87('0x4c')](_0x4b3d75[_0x8b87('0x4d')],{})[_0x8b87('0x2b')](function(_0x183ab9){var _0x7096a=_0x4b3d75[_0x8b87('0x4e')]['get']({'plain':!![]});if(!_0x7096a)throw new Error(_0x8b87('0x4f'));if(_0x7096a[_0x8b87('0x50')]===_0x8b87('0x4e')){var _0x33d5ee=_0x183ab9[_0x8b87('0x2d')]({'plain':!![]});var _0x45f0d6=_0x8b87('0x51');return db['UserProfileSection'][_0x8b87('0x4a')]({'where':{'name':_0x45f0d6,'userProfileId':_0x7096a['userProfileId']},'raw':!![]})['then'](function(_0xaa5631){if(_0xaa5631&&_0xaa5631[_0x8b87('0x52')]===0x0){return db[_0x8b87('0x2e')][_0x8b87('0x4c')]({'name':_0x33d5ee[_0x8b87('0x2f')],'resourceId':_0x33d5ee['id'],'type':_0xaa5631[_0x8b87('0x2f')],'sectionId':_0xaa5631['id']},{})[_0x8b87('0x2b')](function(){return _0x183ab9;});}else{return _0x183ab9;}})[_0x8b87('0x4b')](function(_0x1bf695){logger[_0x8b87('0x53')](_0x8b87('0x54'),_0x1bf695);throw _0x1bf695;});}return _0x183ab9;})[_0x8b87('0x2b')](respondWithResult(_0x1a8c23,0xc9))['catch'](handleError(_0x1a8c23,null));};exports[_0x8b87('0x2a')]=function(_0x402dad,_0x11e617){if(_0x402dad['body']['id']){delete _0x402dad[_0x8b87('0x4d')]['id'];}return db[_0x8b87('0x41')][_0x8b87('0x4a')]({'where':{'id':_0x402dad[_0x8b87('0x46')]['id']}})[_0x8b87('0x2b')](handleEntityNotFound(_0x11e617,null))[_0x8b87('0x2b')](saveUpdates(_0x402dad['body'],null))[_0x8b87('0x2b')](respondWithResult(_0x11e617,null))['catch'](handleError(_0x11e617,null));};exports[_0x8b87('0x2c')]=function(_0x3b0972,_0x162296){return db[_0x8b87('0x41')][_0x8b87('0x4a')]({'where':{'id':_0x3b0972[_0x8b87('0x46')]['id']}})['then'](handleEntityNotFound(_0x162296,null))['then'](removeEntity(_0x162296,null))[_0x8b87('0x4b')](handleError(_0x162296,null));};exports[_0x8b87('0x55')]=function(_0x39e34c,_0x3a42b2,_0x41b166){return db[_0x8b87('0x41')][_0x8b87('0x56')]({'where':{'id':_0x39e34c[_0x8b87('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a42b2,null))[_0x8b87('0x2b')](function(_0x2a4a4a){if(!_0x39e34c[_0x8b87('0x35')]['channel']||!utils[_0x8b87('0x57')](_0x39e34c[_0x8b87('0x35')][_0x8b87('0x58')])){throw new db['Sequelize'][(_0x8b87('0x59'))](_0x8b87('0x5a'));}var _0x5e6e88={};var _0x3b8bee={};_0x3b8bee['model']=_[_0x8b87('0x36')](db[_['capitalize'](_0x39e34c['query'][_0x8b87('0x58')][_0x8b87('0x5b')]())+_0x8b87('0x5c')][_0x8b87('0x47')]);_0x3b8bee['query']=_[_0x8b87('0x36')](_0x39e34c[_0x8b87('0x35')]);_0x3b8bee[_0x8b87('0x5d')]=_[_0x8b87('0x37')](_0x3b8bee[_0x8b87('0x38')],_0x3b8bee[_0x8b87('0x35')]);_0x5e6e88[_0x8b87('0x39')]=_[_0x8b87('0x37')](_0x3b8bee[_0x8b87('0x38')],qs[_0x8b87('0x3a')](_0x39e34c[_0x8b87('0x35')][_0x8b87('0x3a')]));_0x5e6e88[_0x8b87('0x39')]=_0x5e6e88[_0x8b87('0x39')][_0x8b87('0x48')]?_0x5e6e88[_0x8b87('0x39')]:_0x3b8bee[_0x8b87('0x38')];_0x5e6e88[_0x8b87('0x24')]=qs['limit'](_0x39e34c[_0x8b87('0x35')][_0x8b87('0x24')]);_0x5e6e88[_0x8b87('0x23')]=qs[_0x8b87('0x23')](_0x39e34c[_0x8b87('0x35')][_0x8b87('0x23')]);_0x5e6e88[_0x8b87('0x5e')]=qs[_0x8b87('0x3d')](_0x39e34c[_0x8b87('0x35')][_0x8b87('0x3d')]);_0x5e6e88[_0x8b87('0x3f')]=qs[_0x8b87('0x5d')](_['pick'](_0x39e34c[_0x8b87('0x35')],_0x3b8bee[_0x8b87('0x5d')]));_0x5e6e88=_[_0x8b87('0x49')]({},_0x5e6e88,_0x39e34c[_0x8b87('0x40')]);return _0x2a4a4a[_0x8b87('0x2d')+_[_0x8b87('0x5f')](_0x39e34c[_0x8b87('0x35')][_0x8b87('0x58')]['toLowerCase']())+'Queues'](_0x5e6e88);})[_0x8b87('0x2b')](respondWithResult(_0x3a42b2,null))[_0x8b87('0x4b')](handleError(_0x3a42b2,null));};exports[_0x8b87('0x60')]=function(_0x44cb92,_0x55936c,_0x3e6fe0){return db['Team'][_0x8b87('0x56')]({'where':{'id':_0x44cb92['params']['id']}})[_0x8b87('0x2b')](function(_0x56b470){if(_0x56b470){if(!_0x44cb92[_0x8b87('0x4d')][_0x8b87('0x58')]||!utils[_0x8b87('0x57')](_0x44cb92[_0x8b87('0x4d')]['channel'])){throw new db[(_0x8b87('0x61'))][(_0x8b87('0x59'))]('Unknown\x20channel');}return _0x56b470[_0x8b87('0x62')+_[_0x8b87('0x5f')](_0x44cb92[_0x8b87('0x4d')]['channel'][_0x8b87('0x5b')]())+'Queues'](_0x44cb92[_0x8b87('0x4d')][_0x8b87('0x63')]);}return null;})[_0x8b87('0x2b')](handleEntityNotFound(_0x55936c,null))['then'](respondWithStatusCode(_0x55936c,null))[_0x8b87('0x4b')](handleError(_0x55936c,null));};exports[_0x8b87('0x64')]=function(_0x368fa1,_0x1ccb9a,_0x40ba99){return db[_0x8b87('0x41')][_0x8b87('0x56')]({'where':{'id':_0x368fa1[_0x8b87('0x46')]['id']}})['then'](function(_0x2ebaa2){if(_0x2ebaa2){if(!_0x368fa1['query']['channel']||!utils[_0x8b87('0x57')](_0x368fa1[_0x8b87('0x35')]['channel'])){throw new db['Sequelize'][(_0x8b87('0x59'))]('Unknown\x20channel');}return _0x2ebaa2[_0x8b87('0x65')+_['capitalize'](_0x368fa1[_0x8b87('0x35')][_0x8b87('0x58')][_0x8b87('0x5b')]())+'Queues'](_0x368fa1[_0x8b87('0x35')]['ids']);}return null;})[_0x8b87('0x2b')](handleEntityNotFound(_0x1ccb9a,null))[_0x8b87('0x2b')](respondWithStatusCode(_0x1ccb9a,null))[_0x8b87('0x4b')](handleError(_0x1ccb9a,null));};exports[_0x8b87('0x66')]=function(_0x466065,_0x2a40ed){var _0x350174=_[_0x8b87('0x67')](_0x466065[_0x8b87('0x4d')][_0x8b87('0x63')])?_0x466065[_0x8b87('0x4d')]['ids']:[_0x466065[_0x8b87('0x4d')][_0x8b87('0x63')]];var _0x4bf0e6=_0x466065[_0x8b87('0x46')]['id'];return db['Team'][_0x8b87('0x4a')]({'where':{'id':_0x4bf0e6}})[_0x8b87('0x2b')](handleEntityNotFound(_0x2a40ed,null))[_0x8b87('0x2b')](function(_0x2ffc2d){if(_0x2ffc2d){var _0xa1aa53=[_0x8b87('0x68'),_0x8b87('0x69'),'Mail',_0x8b87('0x6a'),_0x8b87('0x6b'),'Openchannel',_0x8b87('0x6c')];return db['sequelize'][_0x8b87('0x6d')](function(_0x156311){var _0xbe6085=_['map'](_0xa1aa53,function(_0x2e0c5e){var _0xb97ab6={'attributes':['id',_0x8b87('0x2f')]};if(_0x2e0c5e===_0x8b87('0x68')){_0xb97ab6[_0x8b87('0x6e')]={'attributes':[_0x8b87('0x6f')]};}return _0x2ffc2d[_0x8b87('0x2d')+_0x2e0c5e+_0x8b87('0x70')](_0xb97ab6)[_0x8b87('0x2b')](function(_0x30f3d0){var _0x4b7f73=_['map'](_0x30f3d0,function(_0x208786){var _0xe6f74c=_[_0x8b87('0x32')](_0x350174,function(_0x1ca6cc){var _0xe0093f={'where':{'UserId':_0x1ca6cc,[_0x2e0c5e+_0x8b87('0x71')]:_0x208786['id']},'transaction':_0x156311};if(_0x2e0c5e===_0x8b87('0x68')){_0xe0093f[_0x8b87('0x19')]={'penalty':_0x208786['TeamVoiceQueue']['penalty']};}return db[_0x8b87('0x72')+_0x2e0c5e+'Queue'][_0x8b87('0x73')](_0xe0093f)[_0x8b87('0x2b')](function(){socket['emit'](_0x8b87('0x4e')+_0x2e0c5e+_0x8b87('0x74'),{'UserId':_0x1ca6cc,[_0x2e0c5e+'QueueId']:_0x208786['id']});if(_0x2e0c5e!==_0x8b87('0x68')){return;}return db[_0x8b87('0x72')]['findAll']({'where':{'id':_0x350174,'online':0x1},'attributes':['id',_0x8b87('0x2f'),_0x8b87('0x75'),_0x8b87('0x76'),'interface'],'raw':!![]})[_0x8b87('0x2b')](function(_0x12d558){var _0x1de99f=_[_0x8b87('0x32')](_0x12d558,function(_0x33f856){return db[_0x8b87('0x77')]['upsert']({'membername':_0x33f856['name'],'UserId':_0x33f856['id'],'queue_name':_0x208786[_0x8b87('0x2f')],'VoiceQueueId':_0x208786['id'],'interface':_[_0x8b87('0x78')](_0x33f856[_0x8b87('0x79')])?util[_0x8b87('0x7a')]('SIP/%s',_0x33f856['name']):_0x33f856['interface'],'paused':_0x33f856[_0x8b87('0x76')]||![],'penalty':_0x208786[_0x8b87('0x7b')]['penalty']},{'transaction':_0x156311});});return Promise[_0x8b87('0x7c')](_0x1de99f);});});});return Promise[_0x8b87('0x7c')](_0xe6f74c);});return Promise[_0x8b87('0x7c')](_0x4b7f73);})[_0x8b87('0x2b')](function(){return db[_0x8b87('0x7d')][_0x8b87('0x56')]({'where':{'teamId':_0x4bf0e6}})['then'](function(_0x4dcaaa){if(_0x4dcaaa){var _0xb2a0a5=_[_0x8b87('0x32')](_0x350174,function(_0x4f37c9){db[_0x8b87('0x7e')][_0x8b87('0x7f')]({'UserId':_0x4f37c9,'VoicePrefixId':_0x4dcaaa['VoicePrefixId']});});return Promise[_0x8b87('0x7c')](_0xb2a0a5);}});});});return Promise[_0x8b87('0x7c')](_0xbe6085)[_0x8b87('0x2b')](function(){return _0x2ffc2d[_0x8b87('0x66')](_0x350174,{'transaction':_0x156311})['spread'](function(_0x39a9e8){return _0x39a9e8;});});});}})[_0x8b87('0x2b')](respondWithResult(_0x2a40ed,null))[_0x8b87('0x4b')](handleError(_0x2a40ed,null));};exports[_0x8b87('0x80')]=function(_0x22e0df,_0x3fa41e){var _0xf1d1a2=_[_0x8b87('0x67')](_0x22e0df[_0x8b87('0x35')][_0x8b87('0x63')])?_0x22e0df[_0x8b87('0x35')]['ids']:[_0x22e0df[_0x8b87('0x35')][_0x8b87('0x63')]];var _0x57b09c=_0x22e0df['params']['id'];return db['Team']['find']({'where':{'id':_0x57b09c}})[_0x8b87('0x2b')](handleEntityNotFound(_0x3fa41e,null))['then'](function(_0x17d6fd){if(_0x17d6fd){var _0x25ea59=['Voice',_0x8b87('0x69'),_0x8b87('0x81'),_0x8b87('0x6a'),_0x8b87('0x6b'),_0x8b87('0x82'),_0x8b87('0x6c')];return db['sequelize'][_0x8b87('0x6d')](function(_0x11e65a){var _0x24467e=_[_0x8b87('0x32')](_0x25ea59,function(_0x375f25){var _0x36395c={'attributes':['id','name']};return _0x17d6fd['get'+_0x375f25+_0x8b87('0x70')](_0x36395c)[_0x8b87('0x2b')](function(_0x468bdb){var _0xdf3f0=_[_0x8b87('0x32')](_0x468bdb,function(_0x2f77f2){return _0x2f77f2[_0x8b87('0x80')](_0xf1d1a2,{'transaction':_0x11e65a})[_0x8b87('0x2b')](function(){var _0x2bd0b9=_[_0x8b87('0x32')](_0xf1d1a2,function(_0x4174dc){socket[_0x8b87('0x83')](_0x8b87('0x4e')+_0x375f25+_0x8b87('0x84'),{'UserId':Number(_0x4174dc),[_0x375f25+_0x8b87('0x71')]:_0x2f77f2['id']});if(_0x375f25!==_0x8b87('0x68')){return;}return db['UserVoiceQueueRt'][_0x8b87('0x2c')]({'where':{'VoiceQueueId':_0x2f77f2['id'],'UserId':_0x4174dc},'transaction':_0x11e65a});});return Promise[_0x8b87('0x7c')](_0x2bd0b9);});});return Promise[_0x8b87('0x7c')](_0xdf3f0);});});return Promise[_0x8b87('0x7c')](_0x24467e)[_0x8b87('0x2b')](function(){return _0x17d6fd['removeAgents'](_0xf1d1a2,{'transaction':_0x11e65a});})['then'](function(){return db[_0x8b87('0x7d')][_0x8b87('0x56')]({'where':{'teamId':_0x57b09c}})[_0x8b87('0x2b')](function(_0x3edcea){if(_0x3edcea){var _0x5e8a04=_[_0x8b87('0x32')](_0xf1d1a2,function(_0x122ce5){db[_0x8b87('0x7e')]['destroy']({'where':{'UserId':_0x122ce5,'VoicePrefixId':_0x3edcea[_0x8b87('0x85')]}});});return Promise[_0x8b87('0x7c')](_0x5e8a04);}});});});}})[_0x8b87('0x2b')](respondWithStatusCode(_0x3fa41e,null))['catch'](handleError(_0x3fa41e,null));};exports['getAgents']=function(_0x519a51,_0x450b6e,_0x27d33f){var _0x292d64={};var _0x77a1a1={};var _0x36e202;var _0x5bccd2;return db[_0x8b87('0x41')][_0x8b87('0x56')]({'where':{'id':_0x519a51[_0x8b87('0x46')]['id']}})['then'](handleEntityNotFound(_0x450b6e,null))['then'](function(_0x293cb8){if(_0x293cb8){_0x36e202=_0x293cb8;_0x77a1a1[_0x8b87('0x38')]=_[_0x8b87('0x36')](db[_0x8b87('0x72')][_0x8b87('0x47')]);_0x77a1a1[_0x8b87('0x35')]=_['keys'](_0x519a51[_0x8b87('0x35')]);_0x77a1a1[_0x8b87('0x5d')]=_['intersection'](_0x77a1a1[_0x8b87('0x38')],_0x77a1a1[_0x8b87('0x35')]);_0x292d64[_0x8b87('0x39')]=_[_0x8b87('0x37')](_0x77a1a1[_0x8b87('0x38')],qs[_0x8b87('0x3a')](_0x519a51[_0x8b87('0x35')][_0x8b87('0x3a')]));_0x292d64['attributes']=_0x292d64[_0x8b87('0x39')][_0x8b87('0x48')]?_0x292d64[_0x8b87('0x39')]:_0x77a1a1[_0x8b87('0x38')];_0x292d64[_0x8b87('0x5e')]=qs['sort'](_0x519a51['query'][_0x8b87('0x3d')]);_0x292d64['where']=qs[_0x8b87('0x5d')](_['pick'](_0x519a51[_0x8b87('0x35')],_0x77a1a1[_0x8b87('0x5d')]));if(_0x519a51['query']['filter']){_0x292d64[_0x8b87('0x3f')]=_[_0x8b87('0x49')](_0x292d64[_0x8b87('0x3f')],{'$or':_[_0x8b87('0x32')](_0x292d64[_0x8b87('0x39')],function(_0x12c616){var _0x3cd359={};_0x3cd359[_0x12c616]={'$like':'%'+_0x519a51[_0x8b87('0x35')][_0x8b87('0x3e')]+'%'};return _0x3cd359;})});}_0x292d64=_[_0x8b87('0x49')]({},_0x292d64,_0x519a51[_0x8b87('0x40')]);return _0x36e202[_0x8b87('0x86')](_0x292d64);}})['then'](function(_0xef1646){if(_0xef1646){_0x5bccd2=_0xef1646['length'];if(!_0x519a51['query']['hasOwnProperty'](_0x8b87('0x3c'))){_0x292d64[_0x8b87('0x24')]=qs[_0x8b87('0x24')](_0x519a51[_0x8b87('0x35')][_0x8b87('0x24')]);_0x292d64[_0x8b87('0x23')]=qs[_0x8b87('0x23')](_0x519a51[_0x8b87('0x35')]['offset']);}return _0x36e202[_0x8b87('0x86')](_0x292d64);}})['then'](function(_0x1ba828){if(_0x1ba828){return _0x1ba828?{'count':_0x5bccd2,'rows':_0x1ba828}:null;}})[_0x8b87('0x2b')](respondWithResult(_0x450b6e,null))['catch'](handleError(_0x450b6e,null));}; \ No newline at end of file +var _0xfe06=['Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','add','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','QueueId','defaults','TeamVoiceQueue','findOrCreate','Queue:save','User','online','voicePause','interface','upsert','isNil','SIP/%s','all','UserVoicePrefix','VoicePrefixId','spread','removeAgents','Sms','emit','UserVoiceQueueRt','TeamVoicePrefix','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./team.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Teams','UserProfileResource','end','sendStatus','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','update','params','getQueues','findOne','channel'];(function(_0xc9b988,_0x429150){var _0x5f14fe=function(_0x5c76a8){while(--_0x5c76a8){_0xc9b988['push'](_0xc9b988['shift']());}};_0x5f14fe(++_0x429150);}(_0xfe06,0x141));var _0x6fe0=function(_0x2cc3b9,_0xb09e6b){_0x2cc3b9=_0x2cc3b9-0x0;var _0x475037=_0xfe06[_0x2cc3b9];return _0x475037;};'use strict';var emlformat=require(_0x6fe0('0x0'));var rimraf=require(_0x6fe0('0x1'));var zipdir=require(_0x6fe0('0x2'));var jsonpatch=require(_0x6fe0('0x3'));var rp=require(_0x6fe0('0x4'));var moment=require(_0x6fe0('0x5'));var BPromise=require(_0x6fe0('0x6'));var Mustache=require(_0x6fe0('0x7'));var util=require(_0x6fe0('0x8'));var path=require(_0x6fe0('0x9'));var sox=require(_0x6fe0('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6fe0('0xb'));var _=require(_0x6fe0('0xc'));var squel=require(_0x6fe0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6fe0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6fe0('0xf'));var Papa=require(_0x6fe0('0x10'));var Redis=require(_0x6fe0('0x11'));var authService=require(_0x6fe0('0x12'));var qs=require(_0x6fe0('0x13'));var as=require(_0x6fe0('0x14'));var hardwareService=require(_0x6fe0('0x15'));var logger=require(_0x6fe0('0x16'))(_0x6fe0('0x17'));var utils=require(_0x6fe0('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6fe0('0x19'))['db'];config['redis']=_['defaults'](config[_0x6fe0('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fe0('0x1b'))(new Redis(config[_0x6fe0('0x1a')]));require(_0x6fe0('0x1c'))[_0x6fe0('0x1d')](socket);function respondWithStatusCode(_0x5f3c7e,_0x3cae8f){_0x3cae8f=_0x3cae8f||0xcc;return function(_0x409da2){if(_0x409da2){return _0x5f3c7e['sendStatus'](_0x3cae8f);}return _0x5f3c7e[_0x6fe0('0x1e')](_0x3cae8f)['end']();};}function respondWithResult(_0x2626f4,_0x2728ed){_0x2728ed=_0x2728ed||0xc8;return function(_0x38e7e0){if(_0x38e7e0){return _0x2626f4[_0x6fe0('0x1e')](_0x2728ed)[_0x6fe0('0x1f')](_0x38e7e0);}};}function respondWithFilteredResult(_0x34298a,_0x1d5505){return function(_0x2e0054){if(_0x2e0054){var _0x3082b3=typeof _0x1d5505[_0x6fe0('0x20')]===_0x6fe0('0x21')&&typeof _0x1d5505[_0x6fe0('0x22')]===_0x6fe0('0x21');var _0x374650=_0x2e0054[_0x6fe0('0x23')];var _0xc093ba=_0x3082b3?0x0:_0x1d5505[_0x6fe0('0x20')];var _0x36a034=_0x3082b3?_0x2e0054[_0x6fe0('0x23')]:_0x1d5505[_0x6fe0('0x20')]+_0x1d5505[_0x6fe0('0x22')];var _0xc69e76;if(_0x36a034>=_0x374650){_0x36a034=_0x374650;_0xc69e76=0xc8;}else{_0xc69e76=0xce;}_0x34298a[_0x6fe0('0x1e')](_0xc69e76);return _0x34298a[_0x6fe0('0x24')](_0x6fe0('0x25'),_0xc093ba+'-'+_0x36a034+'/'+_0x374650)[_0x6fe0('0x1f')](_0x2e0054);}return null;};}function patchUpdates(_0x20a446){return function(_0x45d83f){try{jsonpatch[_0x6fe0('0x26')](_0x45d83f,_0x20a446,!![]);}catch(_0x4b8167){return BPromise[_0x6fe0('0x27')](_0x4b8167);}return _0x45d83f[_0x6fe0('0x28')]();};}function saveUpdates(_0x507106,_0x271408){return function(_0x5731b6){if(_0x5731b6){return _0x5731b6['update'](_0x507106)[_0x6fe0('0x29')](function(_0x3bcccd){return _0x3bcccd;});}return null;};}function removeEntity(_0x5ec648,_0x17d311){return function(_0x4a3797){if(_0x4a3797){return _0x4a3797[_0x6fe0('0x2a')]()['then'](function(){var _0x302532=_0x4a3797[_0x6fe0('0x2b')]({'plain':!![]});var _0x1caad3=_0x6fe0('0x2c');return db[_0x6fe0('0x2d')][_0x6fe0('0x2a')]({'where':{'type':_0x1caad3,'resourceId':_0x302532['id']}})['then'](function(){return _0x4a3797;});})[_0x6fe0('0x29')](function(){_0x5ec648[_0x6fe0('0x1e')](0xcc)[_0x6fe0('0x2e')]();});}};}function handleEntityNotFound(_0x1e5c1b,_0x707f42){return function(_0x40f3c7){if(!_0x40f3c7){_0x1e5c1b[_0x6fe0('0x2f')](0x194);}return _0x40f3c7;};}function handleError(_0x3e441f,_0x3f02b4){_0x3f02b4=_0x3f02b4||0x1f4;return function(_0x1d537c){logger['error'](_0x1d537c[_0x6fe0('0x30')]);if(_0x1d537c[_0x6fe0('0x31')]){delete _0x1d537c['name'];}_0x3e441f[_0x6fe0('0x1e')](_0x3f02b4)[_0x6fe0('0x32')](_0x1d537c);};}exports[_0x6fe0('0x33')]=function(_0x312603,_0x16aa93){var _0xedba6a={},_0x5adb6a={},_0x3b35f5={'count':0x0,'rows':[]};var _0xb77d3e=_[_0x6fe0('0x34')](db[_0x6fe0('0x35')][_0x6fe0('0x36')],function(_0x2e7f80){return{'name':_0x2e7f80[_0x6fe0('0x37')],'type':_0x2e7f80[_0x6fe0('0x38')][_0x6fe0('0x39')]};});_0x5adb6a['model']=_[_0x6fe0('0x34')](_0xb77d3e,_0x6fe0('0x31'));_0x5adb6a[_0x6fe0('0x3a')]=_[_0x6fe0('0x3b')](_0x312603[_0x6fe0('0x3a')]);_0x5adb6a[_0x6fe0('0x3c')]=_[_0x6fe0('0x3d')](_0x5adb6a[_0x6fe0('0x3e')],_0x5adb6a['query']);_0xedba6a[_0x6fe0('0x3f')]=_[_0x6fe0('0x3d')](_0x5adb6a[_0x6fe0('0x3e')],qs[_0x6fe0('0x40')](_0x312603[_0x6fe0('0x3a')]['fields']));_0xedba6a['attributes']=_0xedba6a[_0x6fe0('0x3f')][_0x6fe0('0x41')]?_0xedba6a[_0x6fe0('0x3f')]:_0x5adb6a[_0x6fe0('0x3e')];if(!_0x312603[_0x6fe0('0x3a')][_0x6fe0('0x42')](_0x6fe0('0x43'))){_0xedba6a[_0x6fe0('0x22')]=qs[_0x6fe0('0x22')](_0x312603[_0x6fe0('0x3a')][_0x6fe0('0x22')]);_0xedba6a[_0x6fe0('0x20')]=qs[_0x6fe0('0x20')](_0x312603[_0x6fe0('0x3a')][_0x6fe0('0x20')]);}_0xedba6a[_0x6fe0('0x44')]=qs['sort'](_0x312603['query'][_0x6fe0('0x45')]);_0xedba6a[_0x6fe0('0x46')]=qs[_0x6fe0('0x3c')](_['pick'](_0x312603[_0x6fe0('0x3a')],_0x5adb6a[_0x6fe0('0x3c')]),_0xb77d3e);if(_0x312603[_0x6fe0('0x3a')][_0x6fe0('0x47')]){_0xedba6a[_0x6fe0('0x46')]=_[_0x6fe0('0x48')](_0xedba6a[_0x6fe0('0x46')],{'$or':_[_0x6fe0('0x34')](_0xb77d3e,function(_0x79bdd7){if(_0x79bdd7[_0x6fe0('0x38')]!==_0x6fe0('0x49')){var _0x2f3c44={};_0x2f3c44[_0x79bdd7[_0x6fe0('0x31')]]={'$like':'%'+_0x312603['query'][_0x6fe0('0x47')]+'%'};return _0x2f3c44;}})});}_0xedba6a=_[_0x6fe0('0x48')]({},_0xedba6a,_0x312603[_0x6fe0('0x4a')]);var _0x372bce={'where':_0xedba6a[_0x6fe0('0x46')]};return db[_0x6fe0('0x35')][_0x6fe0('0x23')](_0x372bce)[_0x6fe0('0x29')](function(_0x29ec08){_0x3b35f5[_0x6fe0('0x23')]=_0x29ec08;if(_0x312603[_0x6fe0('0x3a')]['includeAll']){_0xedba6a[_0x6fe0('0x4b')]=[{'all':!![]}];}return db['Team'][_0x6fe0('0x4c')](_0xedba6a);})[_0x6fe0('0x29')](function(_0x128733){_0x3b35f5[_0x6fe0('0x4d')]=_0x128733;return _0x3b35f5;})[_0x6fe0('0x29')](respondWithFilteredResult(_0x16aa93,_0xedba6a))[_0x6fe0('0x4e')](handleError(_0x16aa93,null));};exports[_0x6fe0('0x4f')]=function(_0x584466,_0x62e578){var _0x136075={'raw':![],'where':{'id':_0x584466['params']['id']}},_0x48d4a1={};_0x48d4a1[_0x6fe0('0x3e')]=_[_0x6fe0('0x3b')](db[_0x6fe0('0x35')][_0x6fe0('0x36')]);_0x48d4a1[_0x6fe0('0x3a')]=_[_0x6fe0('0x3b')](_0x584466[_0x6fe0('0x3a')]);_0x48d4a1[_0x6fe0('0x3c')]=_[_0x6fe0('0x3d')](_0x48d4a1['model'],_0x48d4a1[_0x6fe0('0x3a')]);_0x136075['attributes']=_[_0x6fe0('0x3d')](_0x48d4a1[_0x6fe0('0x3e')],qs[_0x6fe0('0x40')](_0x584466['query']['fields']));_0x136075[_0x6fe0('0x3f')]=_0x136075[_0x6fe0('0x3f')][_0x6fe0('0x41')]?_0x136075['attributes']:_0x48d4a1[_0x6fe0('0x3e')];if(_0x584466['query']['includeAll']){_0x136075[_0x6fe0('0x4b')]=[{'all':!![]}];}_0x136075=_[_0x6fe0('0x48')]({},_0x136075,_0x584466[_0x6fe0('0x4a')]);return db[_0x6fe0('0x35')][_0x6fe0('0x50')](_0x136075)[_0x6fe0('0x29')](handleEntityNotFound(_0x62e578,null))[_0x6fe0('0x29')](respondWithResult(_0x62e578,null))[_0x6fe0('0x4e')](handleError(_0x62e578,null));};exports[_0x6fe0('0x51')]=function(_0x31c121,_0x330241){return db[_0x6fe0('0x35')]['create'](_0x31c121[_0x6fe0('0x52')],{})[_0x6fe0('0x29')](function(_0x96bff6){var _0x583b01=_0x31c121[_0x6fe0('0x53')][_0x6fe0('0x2b')]({'plain':!![]});if(!_0x583b01)throw new Error(_0x6fe0('0x54'));if(_0x583b01['role']===_0x6fe0('0x53')){var _0x42f9e5=_0x96bff6[_0x6fe0('0x2b')]({'plain':!![]});var _0x38aa8b=_0x6fe0('0x2c');return db[_0x6fe0('0x55')][_0x6fe0('0x50')]({'where':{'name':_0x38aa8b,'userProfileId':_0x583b01['userProfileId']},'raw':!![]})[_0x6fe0('0x29')](function(_0x5b33e8){if(_0x5b33e8&&_0x5b33e8[_0x6fe0('0x56')]===0x0){return db[_0x6fe0('0x2d')]['create']({'name':_0x42f9e5['name'],'resourceId':_0x42f9e5['id'],'type':_0x5b33e8[_0x6fe0('0x31')],'sectionId':_0x5b33e8['id']},{})[_0x6fe0('0x29')](function(){return _0x96bff6;});}else{return _0x96bff6;}})[_0x6fe0('0x4e')](function(_0x4cc930){logger[_0x6fe0('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cc930);throw _0x4cc930;});}return _0x96bff6;})[_0x6fe0('0x29')](respondWithResult(_0x330241,0xc9))[_0x6fe0('0x4e')](handleError(_0x330241,null));};exports[_0x6fe0('0x58')]=function(_0x5e6fe1,_0x133f01){if(_0x5e6fe1[_0x6fe0('0x52')]['id']){delete _0x5e6fe1[_0x6fe0('0x52')]['id'];}return db[_0x6fe0('0x35')][_0x6fe0('0x50')]({'where':{'id':_0x5e6fe1[_0x6fe0('0x59')]['id']}})[_0x6fe0('0x29')](handleEntityNotFound(_0x133f01,null))[_0x6fe0('0x29')](saveUpdates(_0x5e6fe1[_0x6fe0('0x52')],null))[_0x6fe0('0x29')](respondWithResult(_0x133f01,null))[_0x6fe0('0x4e')](handleError(_0x133f01,null));};exports[_0x6fe0('0x2a')]=function(_0x4f15f6,_0x56f3e9){return db['Team'][_0x6fe0('0x50')]({'where':{'id':_0x4f15f6[_0x6fe0('0x59')]['id']}})[_0x6fe0('0x29')](handleEntityNotFound(_0x56f3e9,null))[_0x6fe0('0x29')](removeEntity(_0x56f3e9,null))[_0x6fe0('0x4e')](handleError(_0x56f3e9,null));};exports[_0x6fe0('0x5a')]=function(_0x33a0a9,_0x142582,_0xe6e3e4){return db[_0x6fe0('0x35')][_0x6fe0('0x5b')]({'where':{'id':_0x33a0a9[_0x6fe0('0x59')]['id']}})[_0x6fe0('0x29')](handleEntityNotFound(_0x142582,null))[_0x6fe0('0x29')](function(_0x4bb24a){if(!_0x33a0a9[_0x6fe0('0x3a')][_0x6fe0('0x5c')]||!utils['isValidChannel'](_0x33a0a9[_0x6fe0('0x3a')]['channel'])){throw new db[(_0x6fe0('0x5d'))][(_0x6fe0('0x5e'))](_0x6fe0('0x5f'));}var _0x332a62={};var _0x15019a={};_0x15019a[_0x6fe0('0x3e')]=_['keys'](db[_[_0x6fe0('0x60')](_0x33a0a9['query'][_0x6fe0('0x5c')][_0x6fe0('0x61')]())+_0x6fe0('0x62')]['rawAttributes']);_0x15019a['query']=_[_0x6fe0('0x3b')](_0x33a0a9[_0x6fe0('0x3a')]);_0x15019a['filters']=_[_0x6fe0('0x3d')](_0x15019a['model'],_0x15019a[_0x6fe0('0x3a')]);_0x332a62[_0x6fe0('0x3f')]=_[_0x6fe0('0x3d')](_0x15019a[_0x6fe0('0x3e')],qs[_0x6fe0('0x40')](_0x33a0a9[_0x6fe0('0x3a')]['fields']));_0x332a62[_0x6fe0('0x3f')]=_0x332a62[_0x6fe0('0x3f')][_0x6fe0('0x41')]?_0x332a62[_0x6fe0('0x3f')]:_0x15019a[_0x6fe0('0x3e')];_0x332a62[_0x6fe0('0x22')]=qs[_0x6fe0('0x22')](_0x33a0a9[_0x6fe0('0x3a')]['limit']);_0x332a62[_0x6fe0('0x20')]=qs['offset'](_0x33a0a9[_0x6fe0('0x3a')][_0x6fe0('0x20')]);_0x332a62[_0x6fe0('0x44')]=qs['sort'](_0x33a0a9['query'][_0x6fe0('0x45')]);_0x332a62['where']=qs[_0x6fe0('0x3c')](_[_0x6fe0('0x63')](_0x33a0a9[_0x6fe0('0x3a')],_0x15019a[_0x6fe0('0x3c')]));_0x332a62=_[_0x6fe0('0x48')]({},_0x332a62,_0x33a0a9[_0x6fe0('0x4a')]);return _0x4bb24a['get'+_[_0x6fe0('0x60')](_0x33a0a9['query']['channel'][_0x6fe0('0x61')]())+_0x6fe0('0x64')](_0x332a62);})[_0x6fe0('0x29')](respondWithResult(_0x142582,null))[_0x6fe0('0x4e')](handleError(_0x142582,null));};exports['addQueues']=function(_0x543606,_0x3f4810,_0x25dacb){return db[_0x6fe0('0x35')][_0x6fe0('0x5b')]({'where':{'id':_0x543606[_0x6fe0('0x59')]['id']}})[_0x6fe0('0x29')](function(_0x271c40){if(_0x271c40){if(!_0x543606[_0x6fe0('0x52')]['channel']||!utils['isValidChannel'](_0x543606[_0x6fe0('0x52')][_0x6fe0('0x5c')])){throw new db[(_0x6fe0('0x5d'))]['ValidationError'](_0x6fe0('0x5f'));}return _0x271c40[_0x6fe0('0x65')+_[_0x6fe0('0x60')](_0x543606[_0x6fe0('0x52')][_0x6fe0('0x5c')][_0x6fe0('0x61')]())+'Queues'](_0x543606[_0x6fe0('0x52')][_0x6fe0('0x66')]);}return null;})[_0x6fe0('0x29')](handleEntityNotFound(_0x3f4810,null))[_0x6fe0('0x29')](respondWithStatusCode(_0x3f4810,null))[_0x6fe0('0x4e')](handleError(_0x3f4810,null));};exports[_0x6fe0('0x67')]=function(_0x34b7b9,_0x30fbd9,_0x3d8cc6){return db[_0x6fe0('0x35')][_0x6fe0('0x5b')]({'where':{'id':_0x34b7b9[_0x6fe0('0x59')]['id']}})[_0x6fe0('0x29')](function(_0x59e939){if(_0x59e939){if(!_0x34b7b9[_0x6fe0('0x3a')][_0x6fe0('0x5c')]||!utils['isValidChannel'](_0x34b7b9[_0x6fe0('0x3a')][_0x6fe0('0x5c')])){throw new db[(_0x6fe0('0x5d'))][(_0x6fe0('0x5e'))]('Unknown\x20channel');}return _0x59e939[_0x6fe0('0x68')+_[_0x6fe0('0x60')](_0x34b7b9[_0x6fe0('0x3a')]['channel']['toLowerCase']())+'Queues'](_0x34b7b9['query'][_0x6fe0('0x66')]);}return null;})[_0x6fe0('0x29')](handleEntityNotFound(_0x30fbd9,null))[_0x6fe0('0x29')](respondWithStatusCode(_0x30fbd9,null))[_0x6fe0('0x4e')](handleError(_0x30fbd9,null));};exports['addAgents']=function(_0x45d1a8,_0x11fbee){var _0x324e3d=_[_0x6fe0('0x69')](_0x45d1a8[_0x6fe0('0x52')][_0x6fe0('0x66')])?_0x45d1a8[_0x6fe0('0x52')][_0x6fe0('0x66')]:[_0x45d1a8[_0x6fe0('0x52')]['ids']];var _0x306f5f=_0x45d1a8[_0x6fe0('0x59')]['id'];return db[_0x6fe0('0x35')][_0x6fe0('0x50')]({'where':{'id':_0x306f5f}})['then'](handleEntityNotFound(_0x11fbee,null))[_0x6fe0('0x29')](function(_0x112ed4){if(_0x112ed4){var _0x5a1368=[_0x6fe0('0x6a'),_0x6fe0('0x6b'),_0x6fe0('0x6c'),'Sms',_0x6fe0('0x6d'),_0x6fe0('0x6e'),_0x6fe0('0x6f')];return db[_0x6fe0('0x70')][_0x6fe0('0x71')](function(_0x4c0ab2){var _0x26c579=_[_0x6fe0('0x34')](_0x5a1368,function(_0x3d06eb){var _0x45e547={'attributes':['id',_0x6fe0('0x31')]};if(_0x3d06eb===_0x6fe0('0x6a')){_0x45e547[_0x6fe0('0x72')]={'attributes':[_0x6fe0('0x73')]};}return _0x112ed4[_0x6fe0('0x2b')+_0x3d06eb+'Queues'](_0x45e547)['then'](function(_0x21fae9){var _0x49d654=_[_0x6fe0('0x34')](_0x21fae9,function(_0x20af73){var _0x16a4de=_[_0x6fe0('0x34')](_0x324e3d,function(_0x5049ec){var _0x2bd37f={'where':{'UserId':_0x5049ec,[_0x3d06eb+_0x6fe0('0x74')]:_0x20af73['id']},'transaction':_0x4c0ab2};if(_0x3d06eb===_0x6fe0('0x6a')){_0x2bd37f[_0x6fe0('0x75')]={'penalty':_0x20af73[_0x6fe0('0x76')][_0x6fe0('0x73')]};}return db['User'+_0x3d06eb+'Queue'][_0x6fe0('0x77')](_0x2bd37f)[_0x6fe0('0x29')](function(){socket['emit']('user'+_0x3d06eb+_0x6fe0('0x78'),{'UserId':_0x5049ec,[_0x3d06eb+_0x6fe0('0x74')]:_0x20af73['id']});if(_0x3d06eb!==_0x6fe0('0x6a')){return;}return db[_0x6fe0('0x79')][_0x6fe0('0x4c')]({'where':{'id':_0x324e3d,'online':0x1},'attributes':['id',_0x6fe0('0x31'),_0x6fe0('0x7a'),_0x6fe0('0x7b'),_0x6fe0('0x7c')],'raw':!![]})[_0x6fe0('0x29')](function(_0x478dbe){var _0x357dc6=_[_0x6fe0('0x34')](_0x478dbe,function(_0x3fa9f4){return db['UserVoiceQueueRt'][_0x6fe0('0x7d')]({'membername':_0x3fa9f4['name'],'UserId':_0x3fa9f4['id'],'queue_name':_0x20af73['name'],'VoiceQueueId':_0x20af73['id'],'interface':_[_0x6fe0('0x7e')](_0x3fa9f4[_0x6fe0('0x7c')])?util['format'](_0x6fe0('0x7f'),_0x3fa9f4[_0x6fe0('0x31')]):_0x3fa9f4['interface'],'paused':_0x3fa9f4[_0x6fe0('0x7b')]||![],'penalty':_0x20af73[_0x6fe0('0x76')][_0x6fe0('0x73')]},{'transaction':_0x4c0ab2});});return Promise[_0x6fe0('0x80')](_0x357dc6);});});});return Promise[_0x6fe0('0x80')](_0x16a4de);});return Promise[_0x6fe0('0x80')](_0x49d654);})[_0x6fe0('0x29')](function(){return db['TeamVoicePrefix'][_0x6fe0('0x5b')]({'where':{'teamId':_0x306f5f}})['then'](function(_0x26642e){if(_0x26642e){var _0x1f4635=_[_0x6fe0('0x34')](_0x324e3d,function(_0x1cf979){db[_0x6fe0('0x81')]['upsert']({'UserId':_0x1cf979,'VoicePrefixId':_0x26642e[_0x6fe0('0x82')]});});return Promise[_0x6fe0('0x80')](_0x1f4635);}});});});return Promise[_0x6fe0('0x80')](_0x26c579)[_0x6fe0('0x29')](function(){return _0x112ed4['addAgents'](_0x324e3d,{'transaction':_0x4c0ab2})[_0x6fe0('0x83')](function(_0x30d1c7){return _0x30d1c7;});});});}})[_0x6fe0('0x29')](respondWithResult(_0x11fbee,null))[_0x6fe0('0x4e')](handleError(_0x11fbee,null));};exports[_0x6fe0('0x84')]=function(_0x11b621,_0x346f39){var _0x34cc96=_[_0x6fe0('0x69')](_0x11b621[_0x6fe0('0x3a')][_0x6fe0('0x66')])?_0x11b621[_0x6fe0('0x3a')][_0x6fe0('0x66')]:[_0x11b621[_0x6fe0('0x3a')][_0x6fe0('0x66')]];var _0x187d22=_0x11b621[_0x6fe0('0x59')]['id'];return db[_0x6fe0('0x35')][_0x6fe0('0x50')]({'where':{'id':_0x187d22}})[_0x6fe0('0x29')](handleEntityNotFound(_0x346f39,null))['then'](function(_0x1e8406){if(_0x1e8406){var _0x193628=[_0x6fe0('0x6a'),_0x6fe0('0x6b'),_0x6fe0('0x6c'),_0x6fe0('0x85'),_0x6fe0('0x6d'),'Openchannel',_0x6fe0('0x6f')];return db[_0x6fe0('0x70')][_0x6fe0('0x71')](function(_0x57b4fa){var _0x5d0e3d=_[_0x6fe0('0x34')](_0x193628,function(_0x38d4a8){var _0x480871={'attributes':['id','name']};return _0x1e8406['get'+_0x38d4a8+_0x6fe0('0x64')](_0x480871)[_0x6fe0('0x29')](function(_0x30ebca){var _0xfe306b=_[_0x6fe0('0x34')](_0x30ebca,function(_0x1167b3){return _0x1167b3[_0x6fe0('0x84')](_0x34cc96,{'transaction':_0x57b4fa})[_0x6fe0('0x29')](function(){var _0x29b903=_[_0x6fe0('0x34')](_0x34cc96,function(_0x3a396a){socket[_0x6fe0('0x86')](_0x6fe0('0x53')+_0x38d4a8+'Queue:remove',{'UserId':Number(_0x3a396a),[_0x38d4a8+'QueueId']:_0x1167b3['id']});if(_0x38d4a8!==_0x6fe0('0x6a')){return;}return db[_0x6fe0('0x87')][_0x6fe0('0x2a')]({'where':{'VoiceQueueId':_0x1167b3['id'],'UserId':_0x3a396a},'transaction':_0x57b4fa});});return Promise[_0x6fe0('0x80')](_0x29b903);});});return Promise[_0x6fe0('0x80')](_0xfe306b);});});return Promise[_0x6fe0('0x80')](_0x5d0e3d)['then'](function(){return _0x1e8406[_0x6fe0('0x84')](_0x34cc96,{'transaction':_0x57b4fa});})[_0x6fe0('0x29')](function(){return db[_0x6fe0('0x88')][_0x6fe0('0x5b')]({'where':{'teamId':_0x187d22}})[_0x6fe0('0x29')](function(_0x3cddbe){if(_0x3cddbe){var _0x9d8a46=_[_0x6fe0('0x34')](_0x34cc96,function(_0x591f82){db[_0x6fe0('0x81')][_0x6fe0('0x2a')]({'where':{'UserId':_0x591f82,'VoicePrefixId':_0x3cddbe[_0x6fe0('0x82')]}});});return Promise[_0x6fe0('0x80')](_0x9d8a46);}});});});}})[_0x6fe0('0x29')](respondWithStatusCode(_0x346f39,null))[_0x6fe0('0x4e')](handleError(_0x346f39,null));};exports['getAgents']=function(_0x2c0b6c,_0x4673e0,_0xf99ce5){var _0x534d46={};var _0xf172ca={};var _0x3b7e50;var _0x365041;return db[_0x6fe0('0x35')][_0x6fe0('0x5b')]({'where':{'id':_0x2c0b6c[_0x6fe0('0x59')]['id']}})['then'](handleEntityNotFound(_0x4673e0,null))['then'](function(_0x3736c0){if(_0x3736c0){_0x3b7e50=_0x3736c0;_0xf172ca['model']=_[_0x6fe0('0x3b')](db[_0x6fe0('0x79')]['rawAttributes']);_0xf172ca[_0x6fe0('0x3a')]=_['keys'](_0x2c0b6c[_0x6fe0('0x3a')]);_0xf172ca[_0x6fe0('0x3c')]=_['intersection'](_0xf172ca[_0x6fe0('0x3e')],_0xf172ca['query']);_0x534d46['attributes']=_[_0x6fe0('0x3d')](_0xf172ca[_0x6fe0('0x3e')],qs[_0x6fe0('0x40')](_0x2c0b6c[_0x6fe0('0x3a')][_0x6fe0('0x40')]));_0x534d46[_0x6fe0('0x3f')]=_0x534d46[_0x6fe0('0x3f')]['length']?_0x534d46[_0x6fe0('0x3f')]:_0xf172ca[_0x6fe0('0x3e')];_0x534d46['order']=qs[_0x6fe0('0x45')](_0x2c0b6c['query'][_0x6fe0('0x45')]);_0x534d46[_0x6fe0('0x46')]=qs[_0x6fe0('0x3c')](_[_0x6fe0('0x63')](_0x2c0b6c[_0x6fe0('0x3a')],_0xf172ca[_0x6fe0('0x3c')]));if(_0x2c0b6c[_0x6fe0('0x3a')][_0x6fe0('0x47')]){_0x534d46[_0x6fe0('0x46')]=_['merge'](_0x534d46[_0x6fe0('0x46')],{'$or':_[_0x6fe0('0x34')](_0x534d46['attributes'],function(_0x3ea5c8){var _0x5de7eb={};_0x5de7eb[_0x3ea5c8]={'$like':'%'+_0x2c0b6c['query'][_0x6fe0('0x47')]+'%'};return _0x5de7eb;})});}_0x534d46=_['merge']({},_0x534d46,_0x2c0b6c['options']);return _0x3b7e50[_0x6fe0('0x89')](_0x534d46);}})[_0x6fe0('0x29')](function(_0x573fa8){if(_0x573fa8){_0x365041=_0x573fa8[_0x6fe0('0x41')];if(!_0x2c0b6c[_0x6fe0('0x3a')][_0x6fe0('0x42')](_0x6fe0('0x43'))){_0x534d46[_0x6fe0('0x22')]=qs[_0x6fe0('0x22')](_0x2c0b6c['query']['limit']);_0x534d46[_0x6fe0('0x20')]=qs[_0x6fe0('0x20')](_0x2c0b6c[_0x6fe0('0x3a')]['offset']);}return _0x3b7e50[_0x6fe0('0x89')](_0x534d46);}})[_0x6fe0('0x29')](function(_0x47096d){if(_0x47096d){return _0x47096d?{'count':_0x365041,'rows':_0x47096d}:null;}})[_0x6fe0('0x29')](respondWithResult(_0x4673e0,null))[_0x6fe0('0x4e')](handleError(_0x4673e0,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 544ccc7..feeb508 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 _0xa175=['save','update','remove','emit','events','../../mysqldb','Team'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa175,0x146));var _0x5a17=function(_0x2cd352,_0x668b00){_0x2cd352=_0x2cd352-0x0;var _0x4f9367=_0xa175[_0x2cd352];return _0x4f9367;};'use strict';var EventEmitter=require(_0x5a17('0x0'));var Team=require(_0x5a17('0x1'))['db'][_0x5a17('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5a17('0x3'),'afterUpdate':_0x5a17('0x4'),'afterDestroy':_0x5a17('0x5')};function emitEvent(_0x282ba3){return function(_0x4533f3,_0x2f036e,_0x2b259f){TeamEvents[_0x5a17('0x6')](_0x282ba3+':'+_0x4533f3['id'],_0x4533f3);TeamEvents[_0x5a17('0x6')](_0x282ba3,_0x4533f3);_0x2b259f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xe495=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xe495,0x166));var _0x5e49=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe495[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require(_0x5e49('0x0'));var Team=require(_0x5e49('0x1'))['db'][_0x5e49('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x5e49('0x3')](0x0);var events={'afterCreate':_0x5e49('0x4'),'afterUpdate':_0x5e49('0x5'),'afterDestroy':_0x5e49('0x6')};function emitEvent(_0x446aa1){return function(_0x3c4624,_0x52563e,_0x3181b9){TeamEvents[_0x5e49('0x7')](_0x446aa1+':'+_0x3c4624['id'],_0x3c4624);TeamEvents[_0x5e49('0x7')](_0x446aa1,_0x3c4624);_0x3181b9(null);};}for(var e in events){if(events[_0x5e49('0x8')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x5e49('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b6d0582..9bd5cc9 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 _0x1eaa=['exports','define','Team','teams','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./team.attributes'];(function(_0x4c7a0b,_0x56a9f1){var _0x51a1ff=function(_0x1a0273){while(--_0x1a0273){_0x4c7a0b['push'](_0x4c7a0b['shift']());}};_0x51a1ff(++_0x56a9f1);}(_0x1eaa,0x1cb));var _0xa1ea=function(_0x376d78,_0x40fe21){_0x376d78=_0x376d78-0x0;var _0x53cfc2=_0x1eaa[_0x376d78];return _0x53cfc2;};'use strict';var _=require('lodash');var util=require(_0xa1ea('0x0'));var logger=require(_0xa1ea('0x1'))(_0xa1ea('0x2'));var moment=require(_0xa1ea('0x3'));var BPromise=require(_0xa1ea('0x4'));var rp=require(_0xa1ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1ea('0x6'));var config=require(_0xa1ea('0x7'));var attributes=require(_0xa1ea('0x8'));module[_0xa1ea('0x9')]=function(_0xcd1b6b,_0x4c803d){return _0xcd1b6b[_0xa1ea('0xa')](_0xa1ea('0xb'),attributes,{'tableName':_0xa1ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedea=['request-promise','path','rimraf','./team.attributes','exports','define','Team','teams','lodash','util','api','bluebird'];(function(_0x1ee192,_0x25fd9b){var _0x408658=function(_0x215508){while(--_0x215508){_0x1ee192['push'](_0x1ee192['shift']());}};_0x408658(++_0x25fd9b);}(_0xedea,0x8c));var _0xaede=function(_0x4afd45,_0xb72e8d){_0x4afd45=_0x4afd45-0x0;var _0xee77c9=_0xedea[_0x4afd45];return _0xee77c9;};'use strict';var _=require(_0xaede('0x0'));var util=require(_0xaede('0x1'));var logger=require('../../config/logger')(_0xaede('0x2'));var moment=require('moment');var BPromise=require(_0xaede('0x3'));var rp=require(_0xaede('0x4'));var fs=require('fs');var path=require(_0xaede('0x5'));var rimraf=require(_0xaede('0x6'));var config=require('../../config/environment');var attributes=require(_0xaede('0x7'));module[_0xaede('0x8')]=function(_0x19f330,_0x28d17b){return _0x19f330[_0xaede('0x9')](_0xaede('0xa'),attributes,{'tableName':_0xaede('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 6adad3f..5dfe1d4 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 _0x9716=['request','then','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','register'];(function(_0x32e888,_0x47fe42){var _0x152a86=function(_0x5c88a7){while(--_0x5c88a7){_0x32e888['push'](_0x32e888['shift']());}};_0x152a86(++_0x47fe42);}(_0x9716,0xba));var _0x6971=function(_0x1daf66,_0x341a75){_0x1daf66=_0x1daf66-0x0;var _0x8a9ca8=_0x9716[_0x1daf66];return _0x8a9ca8;};'use strict';var _=require(_0x6971('0x0'));var util=require(_0x6971('0x1'));var moment=require('moment');var BPromise=require(_0x6971('0x2'));var rs=require(_0x6971('0x3'));var fs=require('fs');var Redis=require(_0x6971('0x4'));var db=require(_0x6971('0x5'))['db'];var utils=require(_0x6971('0x6'));var logger=require(_0x6971('0x7'))(_0x6971('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6971('0x9')][_0x6971('0xa')]({'port':0x232a});config['redis']=_[_0x6971('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6971('0xc')]));require('./team.socket')[_0x6971('0xd')](socket);function respondWithRpcPromise(_0x243f80,_0x38bf22,_0xc3d000){return new BPromise(function(_0x5bb1a8,_0x247f5a){return client[_0x6971('0xe')](_0x243f80,_0xc3d000)[_0x6971('0xf')](function(_0x12121b){logger['info'](_0x6971('0x10'),_0x38bf22,'request\x20sent');logger['debug'](_0x6971('0x11'),_0x38bf22,_0x6971('0x12'),JSON[_0x6971('0x13')](_0x12121b));if(_0x12121b[_0x6971('0x14')]){if(_0x12121b[_0x6971('0x14')][_0x6971('0x15')]===0x1f4){logger['error'](_0x6971('0x10'),_0x38bf22,_0x12121b[_0x6971('0x14')][_0x6971('0x16')]);return _0x247f5a(_0x12121b['error'][_0x6971('0x16')]);}logger['error']('Team,\x20%s,\x20%s',_0x38bf22,_0x12121b[_0x6971('0x14')][_0x6971('0x16')]);return _0x5bb1a8(_0x12121b[_0x6971('0x14')][_0x6971('0x16')]);}else{logger['info'](_0x6971('0x10'),_0x38bf22,_0x6971('0x12'));_0x5bb1a8(_0x12121b[_0x6971('0x17')][_0x6971('0x16')]);}})[_0x6971('0x18')](function(_0x3c8d3a){logger[_0x6971('0x14')]('Team,\x20%s,\x20%s',_0x38bf22,_0x3c8d3a);_0x247f5a(_0x3c8d3a);});});} \ No newline at end of file +var _0x3801=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x189b3f,_0x281b9c){var _0x207ecd=function(_0x44950f){while(--_0x44950f){_0x189b3f['push'](_0x189b3f['shift']());}};_0x207ecd(++_0x281b9c);}(_0x3801,0x1e9));var _0x1380=function(_0x1d00c7,_0x9b96b2){_0x1d00c7=_0x1d00c7-0x0;var _0x5b4f51=_0x3801[_0x1d00c7];return _0x5b4f51;};'use strict';var _=require(_0x1380('0x0'));var util=require(_0x1380('0x1'));var moment=require(_0x1380('0x2'));var BPromise=require(_0x1380('0x3'));var rs=require(_0x1380('0x4'));var fs=require('fs');var Redis=require(_0x1380('0x5'));var db=require(_0x1380('0x6'))['db'];var utils=require(_0x1380('0x7'));var logger=require(_0x1380('0x8'))(_0x1380('0x9'));var config=require(_0x1380('0xa'));var jayson=require(_0x1380('0xb'));var client=jayson[_0x1380('0xc')][_0x1380('0xd')]({'port':0x232a});config[_0x1380('0xe')]=_[_0x1380('0xf')](config[_0x1380('0xe')],{'host':_0x1380('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1380('0xe')]));require(_0x1380('0x11'))[_0x1380('0x12')](socket);function respondWithRpcPromise(_0x955be2,_0x4df1f0,_0x5500e6){return new BPromise(function(_0x49ebf9,_0x5e9cce){return client['request'](_0x955be2,_0x5500e6)[_0x1380('0x13')](function(_0x397686){logger[_0x1380('0x14')](_0x1380('0x15'),_0x4df1f0,_0x1380('0x16'));logger['debug'](_0x1380('0x17'),_0x4df1f0,'request\x20sent',JSON[_0x1380('0x18')](_0x397686));if(_0x397686[_0x1380('0x19')]){if(_0x397686['error'][_0x1380('0x1a')]===0x1f4){logger[_0x1380('0x19')](_0x1380('0x15'),_0x4df1f0,_0x397686['error'][_0x1380('0x1b')]);return _0x5e9cce(_0x397686[_0x1380('0x19')][_0x1380('0x1b')]);}logger[_0x1380('0x19')](_0x1380('0x15'),_0x4df1f0,_0x397686[_0x1380('0x19')][_0x1380('0x1b')]);return _0x49ebf9(_0x397686[_0x1380('0x19')][_0x1380('0x1b')]);}else{logger[_0x1380('0x14')](_0x1380('0x15'),_0x4df1f0,_0x1380('0x16'));_0x49ebf9(_0x397686['result'][_0x1380('0x1b')]);}})[_0x1380('0x1c')](function(_0xf5233f){logger[_0x1380('0x19')](_0x1380('0x15'),_0x4df1f0,_0xf5233f);_0x5e9cce(_0xf5233f);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 6055159..599c0f5 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 _0x9d5b=['emit','removeListener','register','length','team:','save','remove','update'];(function(_0x17b62c,_0xb3aebd){var _0x412f9b=function(_0x59a00e){while(--_0x59a00e){_0x17b62c['push'](_0x17b62c['shift']());}};_0x412f9b(++_0xb3aebd);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x1a29c8,_0x4490b7){_0x1a29c8=_0x1a29c8-0x0;var _0x5e6869=_0x9d5b[_0x1a29c8];return _0x5e6869;};'use strict';var TeamEvents=require('./team.events');var events=[_0xb9d5('0x0'),_0xb9d5('0x1'),_0xb9d5('0x2')];function createListener(_0x444860,_0x30b2ef){return function(_0x53b719){_0x30b2ef[_0xb9d5('0x3')](_0x444860,_0x53b719);};}function removeListener(_0x54423a,_0x36b546){return function(){TeamEvents[_0xb9d5('0x4')](_0x54423a,_0x36b546);};}exports[_0xb9d5('0x5')]=function(_0x39d8fe){for(var _0x422a92=0x0,_0x5144c7=events[_0xb9d5('0x6')];_0x422a92<_0x5144c7;_0x422a92++){var _0x35cf2=events[_0x422a92];var _0x4dc4be=createListener(_0xb9d5('0x7')+_0x35cf2,_0x39d8fe);TeamEvents['on'](_0x35cf2,_0x4dc4be);}}; \ No newline at end of file +var _0x5566=['emit','removeListener','./team.events','remove','update'];(function(_0x1218f9,_0x151595){var _0x792f2b=function(_0x3708a7){while(--_0x3708a7){_0x1218f9['push'](_0x1218f9['shift']());}};_0x792f2b(++_0x151595);}(_0x5566,0x179));var _0x6556=function(_0x4ca0de,_0x77e8e3){_0x4ca0de=_0x4ca0de-0x0;var _0x149378=_0x5566[_0x4ca0de];return _0x149378;};'use strict';var TeamEvents=require(_0x6556('0x0'));var events=['save',_0x6556('0x1'),_0x6556('0x2')];function createListener(_0x435340,_0x5cf550){return function(_0xd6a604){_0x5cf550[_0x6556('0x3')](_0x435340,_0xd6a604);};}function removeListener(_0x5792bd,_0x110857){return function(){TeamEvents[_0x6556('0x4')](_0x5792bd,_0x110857);};}exports['register']=function(_0x379718){for(var _0xc7ab6=0x0,_0xfd376a=events['length'];_0xc7ab6<_0xfd376a;_0xc7ab6++){var _0x2d5063=events[_0xc7ab6];var _0x35d991=createListener('team:'+_0x2d5063,_0x379718);TeamEvents['on'](_0x2d5063,_0x35d991);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index e15b62b..ad989c2 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 _0x450a=['sequelize','exports'];(function(_0xf1b10c,_0x733376){var _0x51acb8=function(_0x405808){while(--_0x405808){_0xf1b10c['push'](_0xf1b10c['shift']());}};_0x51acb8(++_0x733376);}(_0x450a,0x11c));var _0xa450=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x450a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xa450('0x0'));module[_0xa450('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe28e=['INTEGER','sequelize','exports'];(function(_0x188156,_0xee80e9){var _0x42ee0b=function(_0x5165d4){while(--_0x5165d4){_0x188156['push'](_0x188156['shift']());}};_0x42ee0b(++_0xee80e9);}(_0xe28e,0x1ba));var _0xee28=function(_0x152ecc,_0xe84ee6){_0x152ecc=_0x152ecc-0x0;var _0x111c11=_0xe28e[_0x152ecc];return _0x111c11;};'use strict';var Sequelize=require(_0xee28('0x0'));module[_0xee28('0x1')]={'TeamId':{'type':Sequelize[_0xee28('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xee28('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 94693de..fef368b 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 _0xbff2=['api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger'];(function(_0x1ba622,_0xb4ab03){var _0x4362b9=function(_0xd29030){while(--_0xd29030){_0x1ba622['push'](_0x1ba622['shift']());}};_0x4362b9(++_0xb4ab03);}(_0xbff2,0x10e));var _0x2bff=function(_0x45c809,_0x2fcf21){_0x45c809=_0x45c809-0x0;var _0x143e5b=_0xbff2[_0x45c809];return _0x143e5b;};'use strict';var _=require(_0x2bff('0x0'));var util=require(_0x2bff('0x1'));var logger=require(_0x2bff('0x2'))(_0x2bff('0x3'));var moment=require(_0x2bff('0x4'));var BPromise=require(_0x2bff('0x5'));var rp=require(_0x2bff('0x6'));var fs=require('fs');var path=require(_0x2bff('0x7'));var rimraf=require(_0x2bff('0x8'));var config=require('../../config/environment');var attributes=require(_0x2bff('0x9'));module[_0x2bff('0xa')]=function(_0x4e36a2,_0x5df472){return _0x4e36a2['define'](_0x2bff('0xb'),attributes,{'tableName':_0x2bff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcae2=['team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix'];(function(_0x21e6f1,_0x4d5eb5){var _0x44a394=function(_0x2d0e0e){while(--_0x2d0e0e){_0x21e6f1['push'](_0x21e6f1['shift']());}};_0x44a394(++_0x4d5eb5);}(_0xcae2,0x143));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var logger=require(_0x2cae('0x2'))(_0x2cae('0x3'));var moment=require(_0x2cae('0x4'));var BPromise=require(_0x2cae('0x5'));var rp=require(_0x2cae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cae('0x7'));var config=require(_0x2cae('0x8'));var attributes=require(_0x2cae('0x9'));module[_0x2cae('0xa')]=function(_0x57cbf8,_0x3a3e3b){return _0x57cbf8[_0x2cae('0xb')](_0x2cae('0xc'),attributes,{'tableName':_0x2cae('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 14d7fef..b09f2bc 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(_0x4479be,_0x2858ce){var _0x2fa6c1=function(_0x5152c6){while(--_0x5152c6){_0x4479be['push'](_0x4479be['shift']());}};_0x2fa6c1(++_0x2858ce);}(_0xe706,0xa3));var _0x6e70=function(_0x42b3aa,_0x223f53){_0x42b3aa=_0x42b3aa-0x0;var _0x319157=_0xe706[_0x42b3aa];return _0x319157;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xcc4d3a,_0x104f66){var _0x20bae1=function(_0x2403f8){while(--_0x2403f8){_0xcc4d3a['push'](_0xcc4d3a['shift']());}};_0x20bae1(++_0x104f66);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 71d7ab8..3d45826 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 _0xe888=['INTEGER','sequelize'];(function(_0x3de3b5,_0x1306ba){var _0x4a8574=function(_0x4d96b5){while(--_0x4d96b5){_0x3de3b5['push'](_0x3de3b5['shift']());}};_0x4a8574(++_0x1306ba);}(_0xe888,0x97));var _0x8e88=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xe888[_0x43f881];return _0x365c14;};'use strict';var Sequelize=require(_0x8e88('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x8e88('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6e2a=['exports'];(function(_0x4da7e1,_0x5a1dc6){var _0x4f699f=function(_0x31a155){while(--_0x31a155){_0x4da7e1['push'](_0x4da7e1['shift']());}};_0x4f699f(++_0x5a1dc6);}(_0x6e2a,0x11e));var _0xa6e2=function(_0x5e01e6,_0x42e0a8){_0x5e01e6=_0x5e01e6-0x0;var _0x27b1c1=_0x6e2a[_0x5e01e6];return _0x27b1c1;};'use strict';var Sequelize=require('sequelize');module[_0xa6e2('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 399d237..39a4613 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 _0x0f69=['TeamVoiceQueue','team_has_voice_queues','../../config/logger','moment','bluebird','path','rimraf','./teamVoiceQueue.attributes','define'];(function(_0x50b12b,_0x2247c1){var _0x57cca4=function(_0x19b760){while(--_0x19b760){_0x50b12b['push'](_0x50b12b['shift']());}};_0x57cca4(++_0x2247c1);}(_0x0f69,0x173));var _0x90f6=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0f69[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90f6('0x0'))('api');var moment=require(_0x90f6('0x1'));var BPromise=require(_0x90f6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90f6('0x3'));var rimraf=require(_0x90f6('0x4'));var config=require('../../config/environment');var attributes=require(_0x90f6('0x5'));module['exports']=function(_0x1840a5,_0x3dfd95){return _0x1840a5[_0x90f6('0x6')](_0x90f6('0x7'),attributes,{'tableName':_0x90f6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48d0=['define','TeamVoiceQueue','lodash','util','api','moment','bluebird','path','rimraf','./teamVoiceQueue.attributes','exports'];(function(_0x1786fc,_0x53f3b3){var _0x2e0d47=function(_0x33d4c9){while(--_0x33d4c9){_0x1786fc['push'](_0x1786fc['shift']());}};_0x2e0d47(++_0x53f3b3);}(_0x48d0,0xd3));var _0x048d=function(_0x3801c8,_0x1e0ae0){_0x3801c8=_0x3801c8-0x0;var _0x27ce0a=_0x48d0[_0x3801c8];return _0x27ce0a;};'use strict';var _=require(_0x048d('0x0'));var util=require(_0x048d('0x1'));var logger=require('../../config/logger')(_0x048d('0x2'));var moment=require(_0x048d('0x3'));var BPromise=require(_0x048d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x048d('0x5'));var rimraf=require(_0x048d('0x6'));var config=require('../../config/environment');var attributes=require(_0x048d('0x7'));module[_0x048d('0x8')]=function(_0x14b983,_0x49c342){return _0x14b983[_0x048d('0x9')](_0x048d('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 1a2093a..5eb3110 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 _0x5d66=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result'];(function(_0x18f65c,_0x41d9d1){var _0x22e5c3=function(_0x16da50){while(--_0x16da50){_0x18f65c['push'](_0x18f65c['shift']());}};_0x22e5c3(++_0x41d9d1);}(_0x5d66,0x109));var _0x65d6=function(_0x17b291,_0x4d7a76){_0x17b291=_0x17b291-0x0;var _0x2974c4=_0x5d66[_0x17b291];return _0x2974c4;};'use strict';var _=require(_0x65d6('0x0'));var util=require('util');var moment=require(_0x65d6('0x1'));var BPromise=require(_0x65d6('0x2'));var rs=require(_0x65d6('0x3'));var fs=require('fs');var Redis=require(_0x65d6('0x4'));var db=require(_0x65d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x65d6('0x6'))(_0x65d6('0x7'));var config=require(_0x65d6('0x8'));var jayson=require(_0x65d6('0x9'));var client=jayson[_0x65d6('0xa')][_0x65d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x441b2c,_0x1a53a9,_0x454e0d){return new BPromise(function(_0x227de3,_0x31651b){return client[_0x65d6('0xc')](_0x441b2c,_0x454e0d)[_0x65d6('0xd')](function(_0x34cbfa){logger[_0x65d6('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1a53a9,'request\x20sent');logger[_0x65d6('0xf')](_0x65d6('0x10'),_0x1a53a9,_0x65d6('0x11'),JSON['stringify'](_0x34cbfa));if(_0x34cbfa[_0x65d6('0x12')]){if(_0x34cbfa['error'][_0x65d6('0x13')]===0x1f4){logger['error'](_0x65d6('0x14'),_0x1a53a9,_0x34cbfa[_0x65d6('0x12')][_0x65d6('0x15')]);return _0x31651b(_0x34cbfa[_0x65d6('0x12')][_0x65d6('0x15')]);}logger[_0x65d6('0x12')](_0x65d6('0x14'),_0x1a53a9,_0x34cbfa[_0x65d6('0x12')][_0x65d6('0x15')]);return _0x227de3(_0x34cbfa[_0x65d6('0x12')][_0x65d6('0x15')]);}else{logger[_0x65d6('0xe')](_0x65d6('0x14'),_0x1a53a9,_0x65d6('0x11'));_0x227de3(_0x34cbfa[_0x65d6('0x16')][_0x65d6('0x15')]);}})[_0x65d6('0x17')](function(_0x236656){logger[_0x65d6('0x12')](_0x65d6('0x14'),_0x1a53a9,_0x236656);_0x31651b(_0x236656);});});} \ No newline at end of file +var _0x2cc1=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2b73c6,_0x18c3e8){var _0x1bd886=function(_0x2e0265){while(--_0x2e0265){_0x2b73c6['push'](_0x2b73c6['shift']());}};_0x1bd886(++_0x18c3e8);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x3dd92b,_0x4d1139){_0x3dd92b=_0x3dd92b-0x0;var _0x5e1d23=_0x2cc1[_0x3dd92b];return _0x5e1d23;};'use strict';var _=require(_0x12cc('0x0'));var util=require(_0x12cc('0x1'));var moment=require(_0x12cc('0x2'));var BPromise=require(_0x12cc('0x3'));var rs=require(_0x12cc('0x4'));var fs=require('fs');var Redis=require(_0x12cc('0x5'));var db=require(_0x12cc('0x6'))['db'];var utils=require(_0x12cc('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x12cc('0x8'));var jayson=require(_0x12cc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dee73,_0x132370,_0x21d042){return new BPromise(function(_0x286d82,_0x1f9d00){return client[_0x12cc('0xa')](_0x3dee73,_0x21d042)[_0x12cc('0xb')](function(_0x325d01){logger[_0x12cc('0xc')](_0x12cc('0xd'),_0x132370,_0x12cc('0xe'));logger[_0x12cc('0xf')](_0x12cc('0x10'),_0x132370,'request\x20sent',JSON[_0x12cc('0x11')](_0x325d01));if(_0x325d01['error']){if(_0x325d01[_0x12cc('0x12')][_0x12cc('0x13')]===0x1f4){logger[_0x12cc('0x12')](_0x12cc('0xd'),_0x132370,_0x325d01[_0x12cc('0x12')][_0x12cc('0x14')]);return _0x1f9d00(_0x325d01['error']['message']);}logger[_0x12cc('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x132370,_0x325d01[_0x12cc('0x12')]['message']);return _0x286d82(_0x325d01[_0x12cc('0x12')][_0x12cc('0x14')]);}else{logger[_0x12cc('0xc')](_0x12cc('0xd'),_0x132370,_0x12cc('0xe'));_0x286d82(_0x325d01[_0x12cc('0x15')]['message']);}})[_0x12cc('0x16')](function(_0x639eca){logger['error'](_0x12cc('0xd'),_0x132370,_0x639eca);_0x1f9d00(_0x639eca);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 1e82e04..9a5e88d 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 _0x8921=['show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x1df1e3,_0x44f698){var _0x76d0be=function(_0xe88521){while(--_0xe88521){_0x1df1e3['push'](_0x1df1e3['shift']());}};_0x76d0be(++_0x44f698);}(_0x8921,0x9a));var _0x1892=function(_0x6e5aa1,_0x1e2bb1){_0x6e5aa1=_0x6e5aa1-0x0;var _0x3912b3=_0x8921[_0x6e5aa1];return _0x3912b3;};'use strict';var multer=require(_0x1892('0x0'));var util=require('util');var path=require(_0x1892('0x1'));var timeout=require(_0x1892('0x2'));var express=require(_0x1892('0x3'));var router=express[_0x1892('0x4')]();var fs_extra=require(_0x1892('0x5'));var auth=require(_0x1892('0x6'));var interaction=require(_0x1892('0x7'));var config=require(_0x1892('0x8'));var controller=require(_0x1892('0x9'));router[_0x1892('0xa')]('/',auth[_0x1892('0xb')](),controller[_0x1892('0xc')]);router['get'](_0x1892('0xd'),auth[_0x1892('0xb')](),controller[_0x1892('0xe')]);router[_0x1892('0xf')]('/',auth[_0x1892('0xb')](),controller[_0x1892('0x10')]);router['put'](_0x1892('0xd'),auth[_0x1892('0xb')](),controller[_0x1892('0x11')]);router[_0x1892('0x12')](_0x1892('0xd'),auth[_0x1892('0xb')](),controller[_0x1892('0x13')]);module[_0x1892('0x14')]=router; \ No newline at end of file +var _0x80c4=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create','put','update'];(function(_0x82182e,_0x5845d8){var _0x4772a9=function(_0x31d157){while(--_0x31d157){_0x82182e['push'](_0x82182e['shift']());}};_0x4772a9(++_0x5845d8);}(_0x80c4,0xa3));var _0x480c=function(_0x3e2df8,_0x316683){_0x3e2df8=_0x3e2df8-0x0;var _0x1b869=_0x80c4[_0x3e2df8];return _0x1b869;};'use strict';var multer=require(_0x480c('0x0'));var util=require('util');var path=require(_0x480c('0x1'));var timeout=require(_0x480c('0x2'));var express=require(_0x480c('0x3'));var router=express[_0x480c('0x4')]();var fs_extra=require(_0x480c('0x5'));var auth=require(_0x480c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x480c('0x7'));var controller=require(_0x480c('0x8'));router[_0x480c('0x9')]('/',auth[_0x480c('0xa')](),controller[_0x480c('0xb')]);router[_0x480c('0x9')](_0x480c('0xc'),auth[_0x480c('0xa')](),controller[_0x480c('0xd')]);router['post']('/',auth[_0x480c('0xa')](),controller[_0x480c('0xe')]);router[_0x480c('0xf')](_0x480c('0xc'),auth[_0x480c('0xa')](),controller[_0x480c('0x10')]);router[_0x480c('0x11')](_0x480c('0xc'),auth[_0x480c('0xa')](),controller[_0x480c('0x12')]);module[_0x480c('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index d31a36a..847130f 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 _0x73b4=['STRING','TEXT','sequelize'];(function(_0x308bdf,_0x53f42b){var _0x1a01d8=function(_0x30de67){while(--_0x30de67){_0x308bdf['push'](_0x308bdf['shift']());}};_0x1a01d8(++_0x53f42b);}(_0x73b4,0x152));var _0x473b=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0x73b4[_0x26bf51];return _0x503415;};'use strict';var Sequelize=require(_0x473b('0x0'));module['exports']={'name':{'type':Sequelize[_0x473b('0x1')]},'description':{'type':Sequelize[_0x473b('0x1')]},'html':{'type':Sequelize[_0x473b('0x2')]}}; \ No newline at end of file +var _0x86a4=['exports','STRING','TEXT','sequelize'];(function(_0x3dcec5,_0x4a2304){var _0x2d211b=function(_0x27cccb){while(--_0x27cccb){_0x3dcec5['push'](_0x3dcec5['shift']());}};_0x2d211b(++_0x4a2304);}(_0x86a4,0x8f));var _0x486a=function(_0x3f5408,_0x58d1d4){_0x3f5408=_0x3f5408-0x0;var _0x16c9be=_0x86a4[_0x3f5408];return _0x16c9be;};'use strict';var Sequelize=require(_0x486a('0x0'));module[_0x486a('0x1')]={'name':{'type':Sequelize[_0x486a('0x2')]},'description':{'type':Sequelize[_0x486a('0x2')]},'html':{'type':Sequelize[_0x486a('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b9f658d..1d8cd23 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 _0x23ea=['limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Templates','UserProfileResource','stack','name','map','Template','rawAttributes','fieldName','key','model','query','filters','attributes','fields','nolimit','sort','pick','where','merge','type','VIRTUAL','options','include','findAll','rows','show','params','keys','intersection','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x3c8d89,_0x821dd7){var _0x1d082e=function(_0x3247fa){while(--_0x3247fa){_0x3c8d89['push'](_0x3c8d89['shift']());}};_0x1d082e(++_0x821dd7);}(_0x23ea,0x80));var _0xa23e=function(_0x25ad66,_0x46e4dc){_0x25ad66=_0x25ad66-0x0;var _0x141bc4=_0x23ea[_0x25ad66];return _0x141bc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa23e('0x0'));var zipdir=require(_0xa23e('0x1'));var jsonpatch=require(_0xa23e('0x2'));var rp=require(_0xa23e('0x3'));var moment=require(_0xa23e('0x4'));var BPromise=require(_0xa23e('0x5'));var Mustache=require('mustache');var util=require(_0xa23e('0x6'));var path=require(_0xa23e('0x7'));var sox=require('sox');var csv=require(_0xa23e('0x8'));var ejs=require(_0xa23e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa23e('0xa'));var crypto=require(_0xa23e('0xb'));var jsforce=require(_0xa23e('0xc'));var deskjs=require(_0xa23e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa23e('0xe'));var authService=require(_0xa23e('0xf'));var qs=require(_0xa23e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa23e('0x11'));var utils=require(_0xa23e('0x12'));var config=require(_0xa23e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa23e('0x14'))['db'];function respondWithStatusCode(_0xe24f1b,_0x350b78){_0x350b78=_0x350b78||0xcc;return function(_0x4846f7){if(_0x4846f7){return _0xe24f1b[_0xa23e('0x15')](_0x350b78);}return _0xe24f1b[_0xa23e('0x16')](_0x350b78)[_0xa23e('0x17')]();};}function respondWithResult(_0x993926,_0x524796){_0x524796=_0x524796||0xc8;return function(_0x5490d8){if(_0x5490d8){return _0x993926[_0xa23e('0x16')](_0x524796)['json'](_0x5490d8);}};}function respondWithFilteredResult(_0x25a2d3,_0xbe2c38){return function(_0x46da8d){if(_0x46da8d){var _0x31f09f=typeof _0xbe2c38[_0xa23e('0x18')]===_0xa23e('0x19')&&typeof _0xbe2c38[_0xa23e('0x1a')]===_0xa23e('0x19');var _0x53031d=_0x46da8d[_0xa23e('0x1b')];var _0x1e2738=_0x31f09f?0x0:_0xbe2c38[_0xa23e('0x18')];var _0x25b201=_0x31f09f?_0x46da8d['count']:_0xbe2c38[_0xa23e('0x18')]+_0xbe2c38[_0xa23e('0x1a')];var _0x56ce7b;if(_0x25b201>=_0x53031d){_0x25b201=_0x53031d;_0x56ce7b=0xc8;}else{_0x56ce7b=0xce;}_0x25a2d3[_0xa23e('0x16')](_0x56ce7b);return _0x25a2d3[_0xa23e('0x1c')](_0xa23e('0x1d'),_0x1e2738+'-'+_0x25b201+'/'+_0x53031d)[_0xa23e('0x1e')](_0x46da8d);}return null;};}function patchUpdates(_0x4417cf){return function(_0x4bd1fb){try{jsonpatch[_0xa23e('0x1f')](_0x4bd1fb,_0x4417cf,!![]);}catch(_0x130eca){return BPromise['reject'](_0x130eca);}return _0x4bd1fb[_0xa23e('0x20')]();};}function saveUpdates(_0x28e060,_0x2df02b){return function(_0x527465){if(_0x527465){return _0x527465[_0xa23e('0x21')](_0x28e060)[_0xa23e('0x22')](function(_0x563489){return _0x563489;});}return null;};}function removeEntity(_0x3618be,_0x2d63af){return function(_0x326481){if(_0x326481){return _0x326481[_0xa23e('0x23')]()[_0xa23e('0x22')](function(){var _0x53e2e3=_0x326481[_0xa23e('0x24')]({'plain':!![]});var _0x17d279=_0xa23e('0x25');return db[_0xa23e('0x26')][_0xa23e('0x23')]({'where':{'type':_0x17d279,'resourceId':_0x53e2e3['id']}})[_0xa23e('0x22')](function(){return _0x326481;});})['then'](function(){_0x3618be['status'](0xcc)[_0xa23e('0x17')]();});}};}function handleEntityNotFound(_0x2456a9,_0x365b32){return function(_0x5ded74){if(!_0x5ded74){_0x2456a9[_0xa23e('0x15')](0x194);}return _0x5ded74;};}function handleError(_0x27c5ba,_0x54c2c7){_0x54c2c7=_0x54c2c7||0x1f4;return function(_0x383d2d){logger['error'](_0x383d2d[_0xa23e('0x27')]);if(_0x383d2d[_0xa23e('0x28')]){delete _0x383d2d['name'];}_0x27c5ba[_0xa23e('0x16')](_0x54c2c7)['send'](_0x383d2d);};}exports['index']=function(_0x285811,_0x1adaf8){var _0x1b5007={},_0xe86564={},_0x3abd74={'count':0x0,'rows':[]};var _0x145327=_[_0xa23e('0x29')](db[_0xa23e('0x2a')][_0xa23e('0x2b')],function(_0x4333f7){return{'name':_0x4333f7[_0xa23e('0x2c')],'type':_0x4333f7['type'][_0xa23e('0x2d')]};});_0xe86564[_0xa23e('0x2e')]=_[_0xa23e('0x29')](_0x145327,'name');_0xe86564['query']=_['keys'](_0x285811[_0xa23e('0x2f')]);_0xe86564[_0xa23e('0x30')]=_['intersection'](_0xe86564[_0xa23e('0x2e')],_0xe86564[_0xa23e('0x2f')]);_0x1b5007[_0xa23e('0x31')]=_['intersection'](_0xe86564['model'],qs[_0xa23e('0x32')](_0x285811[_0xa23e('0x2f')]['fields']));_0x1b5007[_0xa23e('0x31')]=_0x1b5007[_0xa23e('0x31')]['length']?_0x1b5007[_0xa23e('0x31')]:_0xe86564[_0xa23e('0x2e')];if(!_0x285811['query']['hasOwnProperty'](_0xa23e('0x33'))){_0x1b5007[_0xa23e('0x1a')]=qs[_0xa23e('0x1a')](_0x285811[_0xa23e('0x2f')][_0xa23e('0x1a')]);_0x1b5007[_0xa23e('0x18')]=qs[_0xa23e('0x18')](_0x285811[_0xa23e('0x2f')][_0xa23e('0x18')]);}_0x1b5007['order']=qs[_0xa23e('0x34')](_0x285811[_0xa23e('0x2f')]['sort']);_0x1b5007['where']=qs['filters'](_[_0xa23e('0x35')](_0x285811[_0xa23e('0x2f')],_0xe86564[_0xa23e('0x30')]),_0x145327);if(_0x285811['query']['filter']){_0x1b5007[_0xa23e('0x36')]=_[_0xa23e('0x37')](_0x1b5007[_0xa23e('0x36')],{'$or':_['map'](_0x145327,function(_0x3a45aa){if(_0x3a45aa[_0xa23e('0x38')]!==_0xa23e('0x39')){var _0x5461c6={};_0x5461c6[_0x3a45aa['name']]={'$like':'%'+_0x285811[_0xa23e('0x2f')]['filter']+'%'};return _0x5461c6;}})});}_0x1b5007=_[_0xa23e('0x37')]({},_0x1b5007,_0x285811[_0xa23e('0x3a')]);var _0x4d5d22={'where':_0x1b5007['where']};return db[_0xa23e('0x2a')][_0xa23e('0x1b')](_0x4d5d22)['then'](function(_0x2ceb8b){_0x3abd74[_0xa23e('0x1b')]=_0x2ceb8b;if(_0x285811['query']['includeAll']){_0x1b5007[_0xa23e('0x3b')]=[{'all':!![]}];}return db[_0xa23e('0x2a')][_0xa23e('0x3c')](_0x1b5007);})['then'](function(_0x159858){_0x3abd74[_0xa23e('0x3d')]=_0x159858;return _0x3abd74;})['then'](respondWithFilteredResult(_0x1adaf8,_0x1b5007))['catch'](handleError(_0x1adaf8,null));};exports[_0xa23e('0x3e')]=function(_0x172405,_0x5c23d0){var _0x422472={'raw':!![],'where':{'id':_0x172405[_0xa23e('0x3f')]['id']}},_0x1cab82={};_0x1cab82[_0xa23e('0x2e')]=_[_0xa23e('0x40')](db['Template']['rawAttributes']);_0x1cab82[_0xa23e('0x2f')]=_[_0xa23e('0x40')](_0x172405[_0xa23e('0x2f')]);_0x1cab82[_0xa23e('0x30')]=_[_0xa23e('0x41')](_0x1cab82[_0xa23e('0x2e')],_0x1cab82[_0xa23e('0x2f')]);_0x422472[_0xa23e('0x31')]=_[_0xa23e('0x41')](_0x1cab82[_0xa23e('0x2e')],qs['fields'](_0x172405[_0xa23e('0x2f')][_0xa23e('0x32')]));_0x422472[_0xa23e('0x31')]=_0x422472['attributes']['length']?_0x422472[_0xa23e('0x31')]:_0x1cab82[_0xa23e('0x2e')];if(_0x172405[_0xa23e('0x2f')][_0xa23e('0x42')]){_0x422472[_0xa23e('0x3b')]=[{'all':!![]}];}_0x422472=_[_0xa23e('0x37')]({},_0x422472,_0x172405['options']);return db[_0xa23e('0x2a')][_0xa23e('0x43')](_0x422472)['then'](handleEntityNotFound(_0x5c23d0,null))[_0xa23e('0x22')](respondWithResult(_0x5c23d0,null))['catch'](handleError(_0x5c23d0,null));};exports[_0xa23e('0x44')]=function(_0x3a91d0,_0x123130){return db[_0xa23e('0x2a')][_0xa23e('0x44')](_0x3a91d0[_0xa23e('0x45')],{})[_0xa23e('0x22')](function(_0x5aa65c){var _0x43a818=_0x3a91d0['user'][_0xa23e('0x24')]({'plain':!![]});if(!_0x43a818)throw new Error(_0xa23e('0x46'));if(_0x43a818[_0xa23e('0x47')]===_0xa23e('0x48')){var _0x4b126e=_0x5aa65c[_0xa23e('0x24')]({'plain':!![]});var _0x55ffa7=_0xa23e('0x25');return db['UserProfileSection'][_0xa23e('0x43')]({'where':{'name':_0x55ffa7,'userProfileId':_0x43a818['userProfileId']},'raw':!![]})[_0xa23e('0x22')](function(_0x373b8e){if(_0x373b8e&&_0x373b8e[_0xa23e('0x49')]===0x0){return db['UserProfileResource'][_0xa23e('0x44')]({'name':_0x4b126e['name'],'resourceId':_0x4b126e['id'],'type':_0x373b8e[_0xa23e('0x28')],'sectionId':_0x373b8e['id']},{})[_0xa23e('0x22')](function(){return _0x5aa65c;});}else{return _0x5aa65c;}})[_0xa23e('0x4a')](function(_0x509ac2){logger[_0xa23e('0x4b')](_0xa23e('0x4c'),_0x509ac2);throw _0x509ac2;});}return _0x5aa65c;})[_0xa23e('0x22')](respondWithResult(_0x123130,0xc9))[_0xa23e('0x4a')](handleError(_0x123130,null));};exports[_0xa23e('0x21')]=function(_0x2afbb2,_0x535ce7){if(_0x2afbb2[_0xa23e('0x45')]['id']){delete _0x2afbb2[_0xa23e('0x45')]['id'];}return db[_0xa23e('0x2a')]['find']({'where':{'id':_0x2afbb2[_0xa23e('0x3f')]['id']}})[_0xa23e('0x22')](handleEntityNotFound(_0x535ce7,null))[_0xa23e('0x22')](saveUpdates(_0x2afbb2[_0xa23e('0x45')],null))[_0xa23e('0x22')](respondWithResult(_0x535ce7,null))[_0xa23e('0x4a')](handleError(_0x535ce7,null));};exports[_0xa23e('0x23')]=function(_0x2f12c7,_0x40741a){return db[_0xa23e('0x2a')][_0xa23e('0x43')]({'where':{'id':_0x2f12c7[_0xa23e('0x3f')]['id']}})[_0xa23e('0x22')](handleEntityNotFound(_0x40741a,null))[_0xa23e('0x22')](removeEntity(_0x40741a,null))['catch'](handleError(_0x40741a,null));}; \ No newline at end of file +var _0xdae3=['Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','user','UserProfileSection','autoAssociation','UserProfileResource','update','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../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','destroy','then','get','Templates','error','stack','name','index','map'];(function(_0x5780fa,_0x4c07ff){var _0x5db1a3=function(_0x2a62ef){while(--_0x2a62ef){_0x5780fa['push'](_0x5780fa['shift']());}};_0x5db1a3(++_0x4c07ff);}(_0xdae3,0xc0));var _0x3dae=function(_0x49d7bc,_0x39e3fd){_0x49d7bc=_0x49d7bc-0x0;var _0x262af0=_0xdae3[_0x49d7bc];return _0x262af0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3dae('0x0'));var zipdir=require(_0x3dae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3dae('0x2'));var moment=require(_0x3dae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3dae('0x4'));var util=require('util');var path=require(_0x3dae('0x5'));var sox=require('sox');var csv=require(_0x3dae('0x6'));var ejs=require(_0x3dae('0x7'));var fs=require('fs');var fs_extra=require(_0x3dae('0x8'));var _=require(_0x3dae('0x9'));var squel=require(_0x3dae('0xa'));var crypto=require(_0x3dae('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3dae('0xc'));var toCsv=require(_0x3dae('0x6'));var querystring=require(_0x3dae('0xd'));var Papa=require(_0x3dae('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3dae('0xf'));var hardwareService=require(_0x3dae('0x10'));var logger=require(_0x3dae('0x11'))(_0x3dae('0x12'));var utils=require(_0x3dae('0x13'));var config=require(_0x3dae('0x14'));var licenseUtil=require(_0x3dae('0x15'));var db=require(_0x3dae('0x16'))['db'];function respondWithStatusCode(_0x3fad48,_0xc2ae95){_0xc2ae95=_0xc2ae95||0xcc;return function(_0x1c5ae1){if(_0x1c5ae1){return _0x3fad48[_0x3dae('0x17')](_0xc2ae95);}return _0x3fad48[_0x3dae('0x18')](_0xc2ae95)[_0x3dae('0x19')]();};}function respondWithResult(_0x83901b,_0x42d73a){_0x42d73a=_0x42d73a||0xc8;return function(_0x57f36b){if(_0x57f36b){return _0x83901b['status'](_0x42d73a)[_0x3dae('0x1a')](_0x57f36b);}};}function respondWithFilteredResult(_0x229938,_0x3e7614){return function(_0x50f7b9){if(_0x50f7b9){var _0x424663=typeof _0x3e7614[_0x3dae('0x1b')]===_0x3dae('0x1c')&&typeof _0x3e7614[_0x3dae('0x1d')]==='undefined';var _0x21e4f9=_0x50f7b9[_0x3dae('0x1e')];var _0x11e322=_0x424663?0x0:_0x3e7614[_0x3dae('0x1b')];var _0xc652d9=_0x424663?_0x50f7b9[_0x3dae('0x1e')]:_0x3e7614['offset']+_0x3e7614[_0x3dae('0x1d')];var _0x4a19d1;if(_0xc652d9>=_0x21e4f9){_0xc652d9=_0x21e4f9;_0x4a19d1=0xc8;}else{_0x4a19d1=0xce;}_0x229938[_0x3dae('0x18')](_0x4a19d1);return _0x229938[_0x3dae('0x1f')](_0x3dae('0x20'),_0x11e322+'-'+_0xc652d9+'/'+_0x21e4f9)['json'](_0x50f7b9);}return null;};}function patchUpdates(_0x432fda){return function(_0x445324){try{jsonpatch[_0x3dae('0x21')](_0x445324,_0x432fda,!![]);}catch(_0x373dff){return BPromise[_0x3dae('0x22')](_0x373dff);}return _0x445324[_0x3dae('0x23')]();};}function saveUpdates(_0x22fd2d,_0x3d2a8c){return function(_0x16d532){if(_0x16d532){return _0x16d532['update'](_0x22fd2d)['then'](function(_0x430cbf){return _0x430cbf;});}return null;};}function removeEntity(_0x4bafd7,_0x3bd26b){return function(_0x368f4c){if(_0x368f4c){return _0x368f4c[_0x3dae('0x24')]()[_0x3dae('0x25')](function(){var _0x166016=_0x368f4c[_0x3dae('0x26')]({'plain':!![]});var _0x5227cc=_0x3dae('0x27');return db['UserProfileResource'][_0x3dae('0x24')]({'where':{'type':_0x5227cc,'resourceId':_0x166016['id']}})[_0x3dae('0x25')](function(){return _0x368f4c;});})[_0x3dae('0x25')](function(){_0x4bafd7[_0x3dae('0x18')](0xcc)[_0x3dae('0x19')]();});}};}function handleEntityNotFound(_0x5070a4,_0x19fb45){return function(_0x5f2980){if(!_0x5f2980){_0x5070a4[_0x3dae('0x17')](0x194);}return _0x5f2980;};}function handleError(_0x2b8d2d,_0x1bc641){_0x1bc641=_0x1bc641||0x1f4;return function(_0x22a9bc){logger[_0x3dae('0x28')](_0x22a9bc[_0x3dae('0x29')]);if(_0x22a9bc[_0x3dae('0x2a')]){delete _0x22a9bc[_0x3dae('0x2a')];}_0x2b8d2d[_0x3dae('0x18')](_0x1bc641)['send'](_0x22a9bc);};}exports[_0x3dae('0x2b')]=function(_0x582b04,_0x2820ed){var _0xe102f4={},_0x10f622={},_0x5e822c={'count':0x0,'rows':[]};var _0x1e9a40=_[_0x3dae('0x2c')](db[_0x3dae('0x2d')][_0x3dae('0x2e')],function(_0x33ec45){return{'name':_0x33ec45[_0x3dae('0x2f')],'type':_0x33ec45[_0x3dae('0x30')][_0x3dae('0x31')]};});_0x10f622[_0x3dae('0x32')]=_[_0x3dae('0x2c')](_0x1e9a40,_0x3dae('0x2a'));_0x10f622[_0x3dae('0x33')]=_[_0x3dae('0x34')](_0x582b04['query']);_0x10f622[_0x3dae('0x35')]=_[_0x3dae('0x36')](_0x10f622[_0x3dae('0x32')],_0x10f622['query']);_0xe102f4[_0x3dae('0x37')]=_['intersection'](_0x10f622[_0x3dae('0x32')],qs[_0x3dae('0x38')](_0x582b04['query'][_0x3dae('0x38')]));_0xe102f4[_0x3dae('0x37')]=_0xe102f4[_0x3dae('0x37')][_0x3dae('0x39')]?_0xe102f4[_0x3dae('0x37')]:_0x10f622[_0x3dae('0x32')];if(!_0x582b04[_0x3dae('0x33')]['hasOwnProperty'](_0x3dae('0x3a'))){_0xe102f4['limit']=qs[_0x3dae('0x1d')](_0x582b04['query'][_0x3dae('0x1d')]);_0xe102f4[_0x3dae('0x1b')]=qs[_0x3dae('0x1b')](_0x582b04[_0x3dae('0x33')]['offset']);}_0xe102f4[_0x3dae('0x3b')]=qs['sort'](_0x582b04[_0x3dae('0x33')]['sort']);_0xe102f4[_0x3dae('0x3c')]=qs['filters'](_[_0x3dae('0x3d')](_0x582b04['query'],_0x10f622[_0x3dae('0x35')]),_0x1e9a40);if(_0x582b04[_0x3dae('0x33')][_0x3dae('0x3e')]){_0xe102f4['where']=_[_0x3dae('0x3f')](_0xe102f4['where'],{'$or':_[_0x3dae('0x2c')](_0x1e9a40,function(_0xf97e3a){if(_0xf97e3a[_0x3dae('0x30')]!==_0x3dae('0x40')){var _0x595feb={};_0x595feb[_0xf97e3a['name']]={'$like':'%'+_0x582b04['query']['filter']+'%'};return _0x595feb;}})});}_0xe102f4=_[_0x3dae('0x3f')]({},_0xe102f4,_0x582b04['options']);var _0xd2b347={'where':_0xe102f4[_0x3dae('0x3c')]};return db['Template']['count'](_0xd2b347)[_0x3dae('0x25')](function(_0x21b73d){_0x5e822c[_0x3dae('0x1e')]=_0x21b73d;if(_0x582b04[_0x3dae('0x33')][_0x3dae('0x41')]){_0xe102f4[_0x3dae('0x42')]=[{'all':!![]}];}return db[_0x3dae('0x2d')][_0x3dae('0x43')](_0xe102f4);})[_0x3dae('0x25')](function(_0x59dd80){_0x5e822c[_0x3dae('0x44')]=_0x59dd80;return _0x5e822c;})[_0x3dae('0x25')](respondWithFilteredResult(_0x2820ed,_0xe102f4))[_0x3dae('0x45')](handleError(_0x2820ed,null));};exports['show']=function(_0xab453b,_0x50c0d7){var _0x30c11b={'raw':!![],'where':{'id':_0xab453b[_0x3dae('0x46')]['id']}},_0x11c202={};_0x11c202[_0x3dae('0x32')]=_[_0x3dae('0x34')](db[_0x3dae('0x2d')][_0x3dae('0x2e')]);_0x11c202[_0x3dae('0x33')]=_[_0x3dae('0x34')](_0xab453b[_0x3dae('0x33')]);_0x11c202[_0x3dae('0x35')]=_[_0x3dae('0x36')](_0x11c202[_0x3dae('0x32')],_0x11c202[_0x3dae('0x33')]);_0x30c11b[_0x3dae('0x37')]=_[_0x3dae('0x36')](_0x11c202['model'],qs[_0x3dae('0x38')](_0xab453b[_0x3dae('0x33')][_0x3dae('0x38')]));_0x30c11b[_0x3dae('0x37')]=_0x30c11b[_0x3dae('0x37')][_0x3dae('0x39')]?_0x30c11b[_0x3dae('0x37')]:_0x11c202[_0x3dae('0x32')];if(_0xab453b[_0x3dae('0x33')][_0x3dae('0x41')]){_0x30c11b[_0x3dae('0x42')]=[{'all':!![]}];}_0x30c11b=_[_0x3dae('0x3f')]({},_0x30c11b,_0xab453b['options']);return db[_0x3dae('0x2d')][_0x3dae('0x47')](_0x30c11b)[_0x3dae('0x25')](handleEntityNotFound(_0x50c0d7,null))[_0x3dae('0x25')](respondWithResult(_0x50c0d7,null))[_0x3dae('0x45')](handleError(_0x50c0d7,null));};exports[_0x3dae('0x48')]=function(_0x11c83a,_0x1cb9cf){return db[_0x3dae('0x2d')][_0x3dae('0x48')](_0x11c83a[_0x3dae('0x49')],{})[_0x3dae('0x25')](function(_0x4519cd){var _0x5c0621=_0x11c83a[_0x3dae('0x4a')]['get']({'plain':!![]});if(!_0x5c0621)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c0621['role']==='user'){var _0x47f9ad=_0x4519cd[_0x3dae('0x26')]({'plain':!![]});var _0x29f173=_0x3dae('0x27');return db[_0x3dae('0x4b')]['find']({'where':{'name':_0x29f173,'userProfileId':_0x5c0621['userProfileId']},'raw':!![]})[_0x3dae('0x25')](function(_0x21765b){if(_0x21765b&&_0x21765b[_0x3dae('0x4c')]===0x0){return db[_0x3dae('0x4d')]['create']({'name':_0x47f9ad['name'],'resourceId':_0x47f9ad['id'],'type':_0x21765b[_0x3dae('0x2a')],'sectionId':_0x21765b['id']},{})[_0x3dae('0x25')](function(){return _0x4519cd;});}else{return _0x4519cd;}})[_0x3dae('0x45')](function(_0x41c1b4){logger[_0x3dae('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41c1b4);throw _0x41c1b4;});}return _0x4519cd;})[_0x3dae('0x25')](respondWithResult(_0x1cb9cf,0xc9))[_0x3dae('0x45')](handleError(_0x1cb9cf,null));};exports[_0x3dae('0x4e')]=function(_0x3f5ed3,_0x4796a2){if(_0x3f5ed3[_0x3dae('0x49')]['id']){delete _0x3f5ed3[_0x3dae('0x49')]['id'];}return db[_0x3dae('0x2d')]['find']({'where':{'id':_0x3f5ed3[_0x3dae('0x46')]['id']}})[_0x3dae('0x25')](handleEntityNotFound(_0x4796a2,null))[_0x3dae('0x25')](saveUpdates(_0x3f5ed3['body'],null))['then'](respondWithResult(_0x4796a2,null))['catch'](handleError(_0x4796a2,null));};exports[_0x3dae('0x24')]=function(_0x5ea03f,_0x2de62d){return db['Template'][_0x3dae('0x47')]({'where':{'id':_0x5ea03f[_0x3dae('0x46')]['id']}})[_0x3dae('0x25')](handleEntityNotFound(_0x2de62d,null))[_0x3dae('0x25')](removeEntity(_0x2de62d,null))['catch'](handleError(_0x2de62d,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index a788cf4..99cd158 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 _0x0031=['bluebird','request-promise','path','rimraf','../../config/environment','define','Template','lodash','../../config/logger','api'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x0031,0xa7));var _0x1003=function(_0xccd460,_0x56a038){_0xccd460=_0xccd460-0x0;var _0x5d7c06=_0x0031[_0xccd460];return _0x5d7c06;};'use strict';var _=require(_0x1003('0x0'));var util=require('util');var logger=require(_0x1003('0x1'))(_0x1003('0x2'));var moment=require('moment');var BPromise=require(_0x1003('0x3'));var rp=require(_0x1003('0x4'));var fs=require('fs');var path=require(_0x1003('0x5'));var rimraf=require(_0x1003('0x6'));var config=require(_0x1003('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x118dcb,_0x1e4b52){return _0x118dcb[_0x1003('0x8')](_0x1003('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b5a=['./template.attributes','exports','define','Template','tools_templates','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2f4315,_0x452cd2){var _0x5d9948=function(_0x13c186){while(--_0x13c186){_0x2f4315['push'](_0x2f4315['shift']());}};_0x5d9948(++_0x452cd2);}(_0x3b5a,0xa1));var _0xa3b5=function(_0x5e98c3,_0x328bed){_0x5e98c3=_0x5e98c3-0x0;var _0x1683ed=_0x3b5a[_0x5e98c3];return _0x1683ed;};'use strict';var _=require(_0xa3b5('0x0'));var util=require(_0xa3b5('0x1'));var logger=require('../../config/logger')(_0xa3b5('0x2'));var moment=require(_0xa3b5('0x3'));var BPromise=require(_0xa3b5('0x4'));var rp=require(_0xa3b5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa3b5('0x6'));var config=require(_0xa3b5('0x7'));var attributes=require(_0xa3b5('0x8'));module[_0xa3b5('0x9')]=function(_0x4a26a3,_0x304309){return _0x4a26a3[_0xa3b5('0xa')](_0xa3b5('0xb'),attributes,{'tableName':_0xa3b5('0xc'),'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 644aeb0..2be6ff6 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 _0x98c7=['limit','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTemplate','Template','findAll','options','raw'];(function(_0x33df84,_0x5825d1){var _0x42e95e=function(_0x1858ba){while(--_0x1858ba){_0x33df84['push'](_0x33df84['shift']());}};_0x42e95e(++_0x5825d1);}(_0x98c7,0x137));var _0x798c=function(_0x3c22f7,_0x1fb12a){_0x3c22f7=_0x3c22f7-0x0;var _0x537f59=_0x98c7[_0x3c22f7];return _0x537f59;};'use strict';var _=require(_0x798c('0x0'));var util=require(_0x798c('0x1'));var moment=require(_0x798c('0x2'));var BPromise=require(_0x798c('0x3'));var rs=require(_0x798c('0x4'));var fs=require('fs');var Redis=require(_0x798c('0x5'));var db=require(_0x798c('0x6'))['db'];var utils=require(_0x798c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x798c('0x8'));var jayson=require(_0x798c('0x9'));var client=jayson[_0x798c('0xa')][_0x798c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x470395,_0x127fc2,_0x41850a){return new BPromise(function(_0x4ce651,_0x333eff){return client['request'](_0x470395,_0x41850a)[_0x798c('0xc')](function(_0x40ab65){logger['info'](_0x798c('0xd'),_0x127fc2,_0x798c('0xe'));logger[_0x798c('0xf')](_0x798c('0x10'),_0x127fc2,_0x798c('0xe'),JSON[_0x798c('0x11')](_0x40ab65));if(_0x40ab65[_0x798c('0x12')]){if(_0x40ab65[_0x798c('0x12')][_0x798c('0x13')]===0x1f4){logger['error'](_0x798c('0xd'),_0x127fc2,_0x40ab65[_0x798c('0x12')][_0x798c('0x14')]);return _0x333eff(_0x40ab65[_0x798c('0x12')][_0x798c('0x14')]);}logger['error'](_0x798c('0xd'),_0x127fc2,_0x40ab65[_0x798c('0x12')][_0x798c('0x14')]);return _0x4ce651(_0x40ab65['error'][_0x798c('0x14')]);}else{logger[_0x798c('0x15')]('Template,\x20%s,\x20%s',_0x127fc2,_0x798c('0xe'));_0x4ce651(_0x40ab65[_0x798c('0x16')][_0x798c('0x14')]);}})[_0x798c('0x17')](function(_0x255af4){logger[_0x798c('0x12')]('Template,\x20%s,\x20%s',_0x127fc2,_0x255af4);_0x333eff(_0x255af4);});});}exports[_0x798c('0x18')]=function(_0x5c5fd0){var _0x765448=this;return new Promise(function(_0x2bb26d,_0x26cea4){return db[_0x798c('0x19')][_0x798c('0x1a')]({'raw':_0x5c5fd0['options']?_0x5c5fd0[_0x798c('0x1b')][_0x798c('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c5fd0[_0x798c('0x1b')]?_0x5c5fd0['options']['where']||null:null,'attributes':_0x5c5fd0['options']?_0x5c5fd0['options']['attributes']||null:null,'limit':_0x5c5fd0[_0x798c('0x1b')]?_0x5c5fd0[_0x798c('0x1b')][_0x798c('0x1d')]||null:null,'include':_0x5c5fd0[_0x798c('0x1b')]?_0x5c5fd0[_0x798c('0x1b')]['include']?_[_0x798c('0x1e')](_0x5c5fd0['options'][_0x798c('0x1f')],function(_0x21e6dd){return{'model':db[_0x21e6dd[_0x798c('0x20')]],'as':_0x21e6dd['as'],'attributes':_0x21e6dd[_0x798c('0x21')],'include':_0x21e6dd[_0x798c('0x1f')]?_[_0x798c('0x1e')](_0x21e6dd[_0x798c('0x1f')],function(_0x276b1e){return{'model':db[_0x276b1e['model']],'as':_0x276b1e['as'],'attributes':_0x276b1e['attributes'],'include':_0x276b1e[_0x798c('0x1f')]?_[_0x798c('0x1e')](_0x276b1e[_0x798c('0x1f')],function(_0x37b6a5){return{'model':db[_0x37b6a5['model']],'as':_0x37b6a5['as'],'attributes':_0x37b6a5[_0x798c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x798c('0xc')](function(_0x5867cf){logger[_0x798c('0x15')](_0x798c('0x18'),_0x5c5fd0);logger[_0x798c('0xf')](_0x798c('0x18'),_0x5c5fd0,JSON[_0x798c('0x11')](_0x5867cf));_0x2bb26d(_0x5867cf);})[_0x798c('0x17')](function(_0x214afe){logger[_0x798c('0x12')]('GetTemplate',_0x214afe['message'],_0x5c5fd0);_0x26cea4(_0x765448[_0x798c('0x12')](0x1f4,_0x214afe[_0x798c('0x14')]));});});}; \ No newline at end of file +var _0x24f8=['info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','findAll','raw','options','where','attributes','limit','include','map','model','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x2ebc7e,_0x11d16a){var _0x4d2cc6=function(_0x2c3660){while(--_0x2c3660){_0x2ebc7e['push'](_0x2ebc7e['shift']());}};_0x4d2cc6(++_0x11d16a);}(_0x24f8,0xed));var _0x824f=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0x24f8[_0x513f27];return _0xa316b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x824f('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x824f('0x1'));var db=require(_0x824f('0x2'))['db'];var utils=require(_0x824f('0x3'));var logger=require(_0x824f('0x4'))(_0x824f('0x5'));var config=require(_0x824f('0x6'));var jayson=require(_0x824f('0x7'));var client=jayson[_0x824f('0x8')][_0x824f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x284ea3,_0x4052a7,_0x1e6147){return new BPromise(function(_0x27897d,_0x4d4ab4){return client['request'](_0x284ea3,_0x1e6147)[_0x824f('0xa')](function(_0x42c78f){logger[_0x824f('0xb')](_0x824f('0xc'),_0x4052a7,_0x824f('0xd'));logger[_0x824f('0xe')](_0x824f('0xf'),_0x4052a7,_0x824f('0xd'),JSON[_0x824f('0x10')](_0x42c78f));if(_0x42c78f[_0x824f('0x11')]){if(_0x42c78f[_0x824f('0x11')][_0x824f('0x12')]===0x1f4){logger[_0x824f('0x11')](_0x824f('0xc'),_0x4052a7,_0x42c78f[_0x824f('0x11')]['message']);return _0x4d4ab4(_0x42c78f['error'][_0x824f('0x13')]);}logger[_0x824f('0x11')](_0x824f('0xc'),_0x4052a7,_0x42c78f[_0x824f('0x11')][_0x824f('0x13')]);return _0x27897d(_0x42c78f[_0x824f('0x11')][_0x824f('0x13')]);}else{logger[_0x824f('0xb')]('Template,\x20%s,\x20%s',_0x4052a7,_0x824f('0xd'));_0x27897d(_0x42c78f['result']['message']);}})[_0x824f('0x14')](function(_0x3c6467){logger[_0x824f('0x11')](_0x824f('0xc'),_0x4052a7,_0x3c6467);_0x4d4ab4(_0x3c6467);});});}exports[_0x824f('0x15')]=function(_0x4f87b5){var _0x1132be=this;return new Promise(function(_0x56e600,_0x3aa497){return db['Template'][_0x824f('0x16')]({'raw':_0x4f87b5['options']?_0x4f87b5['options'][_0x824f('0x17')]===undefined?!![]:![]:!![],'where':_0x4f87b5[_0x824f('0x18')]?_0x4f87b5[_0x824f('0x18')][_0x824f('0x19')]||null:null,'attributes':_0x4f87b5[_0x824f('0x18')]?_0x4f87b5[_0x824f('0x18')][_0x824f('0x1a')]||null:null,'limit':_0x4f87b5[_0x824f('0x18')]?_0x4f87b5[_0x824f('0x18')][_0x824f('0x1b')]||null:null,'include':_0x4f87b5[_0x824f('0x18')]?_0x4f87b5[_0x824f('0x18')][_0x824f('0x1c')]?_[_0x824f('0x1d')](_0x4f87b5['options'][_0x824f('0x1c')],function(_0x151072){return{'model':db[_0x151072[_0x824f('0x1e')]],'as':_0x151072['as'],'attributes':_0x151072['attributes'],'include':_0x151072[_0x824f('0x1c')]?_[_0x824f('0x1d')](_0x151072[_0x824f('0x1c')],function(_0x1b6f0b){return{'model':db[_0x1b6f0b[_0x824f('0x1e')]],'as':_0x1b6f0b['as'],'attributes':_0x1b6f0b[_0x824f('0x1a')],'include':_0x1b6f0b[_0x824f('0x1c')]?_['map'](_0x1b6f0b['include'],function(_0x417b80){return{'model':db[_0x417b80[_0x824f('0x1e')]],'as':_0x417b80['as'],'attributes':_0x417b80[_0x824f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x824f('0xa')](function(_0x1031e4){logger[_0x824f('0xb')](_0x824f('0x15'),_0x4f87b5);logger[_0x824f('0xe')](_0x824f('0x15'),_0x4f87b5,JSON[_0x824f('0x10')](_0x1031e4));_0x56e600(_0x1031e4);})[_0x824f('0x14')](function(_0x13145f){logger[_0x824f('0x11')](_0x824f('0x15'),_0x13145f[_0x824f('0x13')],_0x4f87b5);_0x3aa497(_0x1132be[_0x824f('0x11')](0x1f4,_0x13145f['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 0a77b6b..8578f3b 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 _0x43c2=['../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','get','/:id','/:id/all_conditions','getAnyConditions','getActions','post','create','/:id/any_conditions','addAnyCondition','addAction','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2494d8,_0xbba735){var _0xd7a33d=function(_0x3528fb){while(--_0x3528fb){_0x2494d8['push'](_0x2494d8['shift']());}};_0xd7a33d(++_0xbba735);}(_0x43c2,0x1a1));var _0x243c=function(_0x5df469,_0x4c4da6){_0x5df469=_0x5df469-0x0;var _0x314c8c=_0x43c2[_0x5df469];return _0x314c8c;};'use strict';var multer=require(_0x243c('0x0'));var util=require(_0x243c('0x1'));var path=require(_0x243c('0x2'));var timeout=require(_0x243c('0x3'));var express=require(_0x243c('0x4'));var router=express[_0x243c('0x5')]();var fs_extra=require(_0x243c('0x6'));var auth=require(_0x243c('0x7'));var interaction=require(_0x243c('0x8'));var config=require(_0x243c('0x9'));var controller=require(_0x243c('0xa'));router['get']('/',auth[_0x243c('0xb')](),controller['index']);router[_0x243c('0xc')](_0x243c('0xd'),auth[_0x243c('0xb')](),controller['show']);router[_0x243c('0xc')](_0x243c('0xe'),auth[_0x243c('0xb')](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x243c('0xf')]);router[_0x243c('0xc')]('/:id/actions',auth[_0x243c('0xb')](),controller[_0x243c('0x10')]);router[_0x243c('0x11')]('/',auth['isAuthenticated'](),controller[_0x243c('0x12')]);router['post'](_0x243c('0xe'),auth['isAuthenticated'](),controller['addAllCondition']);router['post'](_0x243c('0x13'),auth['isAuthenticated'](),controller[_0x243c('0x14')]);router[_0x243c('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x243c('0x15')]);router[_0x243c('0x16')](_0x243c('0xd'),auth[_0x243c('0xb')](),controller[_0x243c('0x17')]);router['delete'](_0x243c('0xd'),auth['isAuthenticated'](),controller[_0x243c('0x18')]);module['exports']=router; \ No newline at end of file +var _0x235d=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','addAllCondition','post','addAnyCondition','addAction','put','update','/:id'];(function(_0x26394e,_0x27b29d){var _0x22b5b6=function(_0x5a80a5){while(--_0x5a80a5){_0x26394e['push'](_0x26394e['shift']());}};_0x22b5b6(++_0x27b29d);}(_0x235d,0x9d));var _0xd235=function(_0x19fde3,_0x5f7755){_0x19fde3=_0x19fde3-0x0;var _0x5a05b2=_0x235d[_0x19fde3];return _0x5a05b2;};'use strict';var multer=require(_0xd235('0x0'));var util=require('util');var path=require(_0xd235('0x1'));var timeout=require(_0xd235('0x2'));var express=require(_0xd235('0x3'));var router=express[_0xd235('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd235('0x5'));var interaction=require(_0xd235('0x6'));var config=require(_0xd235('0x7'));var controller=require('./trigger.controller');router[_0xd235('0x8')]('/',auth[_0xd235('0x9')](),controller[_0xd235('0xa')]);router[_0xd235('0x8')]('/:id',auth[_0xd235('0x9')](),controller[_0xd235('0xb')]);router[_0xd235('0x8')](_0xd235('0xc'),auth[_0xd235('0x9')](),controller['getAllConditions']);router[_0xd235('0x8')](_0xd235('0xd'),auth[_0xd235('0x9')](),controller[_0xd235('0xe')]);router[_0xd235('0x8')](_0xd235('0xf'),auth[_0xd235('0x9')](),controller[_0xd235('0x10')]);router['post']('/',auth[_0xd235('0x9')](),controller[_0xd235('0x11')]);router['post']('/:id/all_conditions',auth[_0xd235('0x9')](),controller[_0xd235('0x12')]);router[_0xd235('0x13')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xd235('0x14')]);router['post']('/:id/actions',auth[_0xd235('0x9')](),controller[_0xd235('0x15')]);router[_0xd235('0x16')]('/:id',auth[_0xd235('0x9')](),controller[_0xd235('0x17')]);router['delete'](_0xd235('0x18'),auth[_0xd235('0x9')](),controller['destroy']);module[_0xd235('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 37ff46f..41529b0 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 _0x9a3c=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x9a3c,0x12c));var _0xc9a3=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x9a3c[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0xc9a3('0x0'));module[_0xc9a3('0x1')]={'name':{'type':Sequelize[_0xc9a3('0x2')]},'channel':{'type':Sequelize[_0xc9a3('0x2')]},'description':{'type':Sequelize[_0xc9a3('0x2')]},'status':{'type':Sequelize[_0xc9a3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5b06=['BOOLEAN','sequelize','STRING'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x5b06,0xcd));var _0x65b0=function(_0x336c12,_0x41c434){_0x336c12=_0x336c12-0x0;var _0x2aa063=_0x5b06[_0x336c12];return _0x2aa063;};'use strict';var Sequelize=require(_0x65b0('0x0'));module['exports']={'name':{'type':Sequelize[_0x65b0('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x65b0('0x1')]},'status':{'type':Sequelize[_0x65b0('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 103e0d5..472f947 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 _0x4847=['order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','nolimit','getAnyConditions','addAction','Action','getActions','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','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Triggers','UserProfileResource','end','error','name','index','map','Trigger','rawAttributes','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty'];(function(_0x242a41,_0x2dfce1){var _0x39ca37=function(_0x158061){while(--_0x158061){_0x242a41['push'](_0x242a41['shift']());}};_0x39ca37(++_0x2dfce1);}(_0x4847,0x141));var _0x7484=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x4847[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require(_0x7484('0x0'));var rimraf=require(_0x7484('0x1'));var zipdir=require(_0x7484('0x2'));var jsonpatch=require(_0x7484('0x3'));var rp=require(_0x7484('0x4'));var moment=require(_0x7484('0x5'));var BPromise=require(_0x7484('0x6'));var Mustache=require(_0x7484('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7484('0x8'));var csv=require(_0x7484('0x9'));var ejs=require(_0x7484('0xa'));var fs=require('fs');var fs_extra=require(_0x7484('0xb'));var _=require(_0x7484('0xc'));var squel=require(_0x7484('0xd'));var crypto=require(_0x7484('0xe'));var jsforce=require(_0x7484('0xf'));var deskjs=require(_0x7484('0x10'));var toCsv=require(_0x7484('0x9'));var querystring=require(_0x7484('0x11'));var Papa=require(_0x7484('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7484('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7484('0x14'))(_0x7484('0x15'));var utils=require(_0x7484('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7484('0x17'));var db=require(_0x7484('0x18'))['db'];function respondWithStatusCode(_0x1582f1,_0x2d05d8){_0x2d05d8=_0x2d05d8||0xcc;return function(_0x28a2e6){if(_0x28a2e6){return _0x1582f1[_0x7484('0x19')](_0x2d05d8);}return _0x1582f1[_0x7484('0x1a')](_0x2d05d8)['end']();};}function respondWithResult(_0x34031f,_0x5369d8){_0x5369d8=_0x5369d8||0xc8;return function(_0x425dc0){if(_0x425dc0){return _0x34031f['status'](_0x5369d8)[_0x7484('0x1b')](_0x425dc0);}};}function respondWithFilteredResult(_0xa0ff95,_0x16f366){return function(_0x142de7){if(_0x142de7){var _0x4e4216=typeof _0x16f366[_0x7484('0x1c')]===_0x7484('0x1d')&&typeof _0x16f366[_0x7484('0x1e')]===_0x7484('0x1d');var _0x36b5b4=_0x142de7[_0x7484('0x1f')];var _0x7ff2ef=_0x4e4216?0x0:_0x16f366[_0x7484('0x1c')];var _0x560fad=_0x4e4216?_0x142de7['count']:_0x16f366[_0x7484('0x1c')]+_0x16f366[_0x7484('0x1e')];var _0x547445;if(_0x560fad>=_0x36b5b4){_0x560fad=_0x36b5b4;_0x547445=0xc8;}else{_0x547445=0xce;}_0xa0ff95[_0x7484('0x1a')](_0x547445);return _0xa0ff95[_0x7484('0x20')](_0x7484('0x21'),_0x7ff2ef+'-'+_0x560fad+'/'+_0x36b5b4)[_0x7484('0x1b')](_0x142de7);}return null;};}function patchUpdates(_0x53bbba){return function(_0x2a5f2c){try{jsonpatch[_0x7484('0x22')](_0x2a5f2c,_0x53bbba,!![]);}catch(_0xa0fc92){return BPromise[_0x7484('0x23')](_0xa0fc92);}return _0x2a5f2c['save']();};}function saveUpdates(_0x2855a9,_0x1b02ee){return function(_0x53525d){if(_0x53525d){return _0x53525d[_0x7484('0x24')](_0x2855a9)[_0x7484('0x25')](function(_0x21ce18){return _0x21ce18;});}return null;};}function removeEntity(_0x46612a,_0xcb29e3){return function(_0x489d7c){if(_0x489d7c){return _0x489d7c[_0x7484('0x26')]()[_0x7484('0x25')](function(){var _0x5739b4=_0x489d7c[_0x7484('0x27')]({'plain':!![]});var _0x35c3de=_0x7484('0x28');return db[_0x7484('0x29')][_0x7484('0x26')]({'where':{'type':_0x35c3de,'resourceId':_0x5739b4['id']}})['then'](function(){return _0x489d7c;});})[_0x7484('0x25')](function(){_0x46612a[_0x7484('0x1a')](0xcc)[_0x7484('0x2a')]();});}};}function handleEntityNotFound(_0x14ae66,_0x42299f){return function(_0x4ed509){if(!_0x4ed509){_0x14ae66[_0x7484('0x19')](0x194);}return _0x4ed509;};}function handleError(_0x4a8143,_0x1cba72){_0x1cba72=_0x1cba72||0x1f4;return function(_0x484ecf){logger[_0x7484('0x2b')](_0x484ecf['stack']);if(_0x484ecf['name']){delete _0x484ecf[_0x7484('0x2c')];}_0x4a8143['status'](_0x1cba72)['send'](_0x484ecf);};}exports[_0x7484('0x2d')]=function(_0x593526,_0x20100b){var _0x56aae4={},_0x27703b={},_0x3b27b2={'count':0x0,'rows':[]};var _0x448d11=_[_0x7484('0x2e')](db[_0x7484('0x2f')][_0x7484('0x30')],function(_0x245a8f){return{'name':_0x245a8f['fieldName'],'type':_0x245a8f['type'][_0x7484('0x31')]};});_0x27703b['model']=_[_0x7484('0x2e')](_0x448d11,_0x7484('0x2c'));_0x27703b['query']=_[_0x7484('0x32')](_0x593526[_0x7484('0x33')]);_0x27703b[_0x7484('0x34')]=_[_0x7484('0x35')](_0x27703b[_0x7484('0x36')],_0x27703b[_0x7484('0x33')]);_0x56aae4['attributes']=_[_0x7484('0x35')](_0x27703b[_0x7484('0x36')],qs[_0x7484('0x37')](_0x593526['query'][_0x7484('0x37')]));_0x56aae4[_0x7484('0x38')]=_0x56aae4['attributes'][_0x7484('0x39')]?_0x56aae4[_0x7484('0x38')]:_0x27703b[_0x7484('0x36')];if(!_0x593526['query'][_0x7484('0x3a')]('nolimit')){_0x56aae4[_0x7484('0x1e')]=qs['limit'](_0x593526[_0x7484('0x33')]['limit']);_0x56aae4['offset']=qs[_0x7484('0x1c')](_0x593526['query'][_0x7484('0x1c')]);}_0x56aae4[_0x7484('0x3b')]=qs['sort'](_0x593526[_0x7484('0x33')][_0x7484('0x3c')]);_0x56aae4[_0x7484('0x3d')]=qs['filters'](_[_0x7484('0x3e')](_0x593526['query'],_0x27703b['filters']),_0x448d11);if(_0x593526['query'][_0x7484('0x3f')]){_0x56aae4[_0x7484('0x3d')]=_[_0x7484('0x40')](_0x56aae4[_0x7484('0x3d')],{'$or':_[_0x7484('0x2e')](_0x448d11,function(_0x4b4861){if(_0x4b4861[_0x7484('0x41')]!==_0x7484('0x42')){var _0xfd4373={};_0xfd4373[_0x4b4861[_0x7484('0x2c')]]={'$like':'%'+_0x593526['query']['filter']+'%'};return _0xfd4373;}})});}_0x56aae4=_[_0x7484('0x40')]({},_0x56aae4,_0x593526[_0x7484('0x43')]);var _0xffab00={'where':_0x56aae4[_0x7484('0x3d')]};return db[_0x7484('0x2f')][_0x7484('0x1f')](_0xffab00)[_0x7484('0x25')](function(_0x4b95cd){_0x3b27b2[_0x7484('0x1f')]=_0x4b95cd;if(_0x593526[_0x7484('0x33')][_0x7484('0x44')]){_0x56aae4[_0x7484('0x45')]=[{'all':!![]}];}return db[_0x7484('0x2f')]['findAll'](_0x56aae4);})[_0x7484('0x25')](function(_0x49aada){_0x3b27b2[_0x7484('0x46')]=_0x49aada;return _0x3b27b2;})['then'](respondWithFilteredResult(_0x20100b,_0x56aae4))[_0x7484('0x47')](handleError(_0x20100b,null));};exports[_0x7484('0x48')]=function(_0x2a4296,_0x4ccf4a){var _0x22538a={'raw':![],'where':{'id':_0x2a4296[_0x7484('0x49')]['id']}},_0x494e93={};_0x494e93[_0x7484('0x36')]=_[_0x7484('0x32')](db['Trigger'][_0x7484('0x30')]);_0x494e93[_0x7484('0x33')]=_[_0x7484('0x32')](_0x2a4296['query']);_0x494e93['filters']=_[_0x7484('0x35')](_0x494e93['model'],_0x494e93[_0x7484('0x33')]);_0x22538a[_0x7484('0x38')]=_[_0x7484('0x35')](_0x494e93['model'],qs['fields'](_0x2a4296['query'][_0x7484('0x37')]));_0x22538a[_0x7484('0x38')]=_0x22538a[_0x7484('0x38')][_0x7484('0x39')]?_0x22538a['attributes']:_0x494e93[_0x7484('0x36')];if(_0x2a4296['query'][_0x7484('0x44')]){_0x22538a['include']=[{'all':!![]}];}_0x22538a=_[_0x7484('0x40')]({},_0x22538a,_0x2a4296[_0x7484('0x43')]);return db['Trigger'][_0x7484('0x4a')](_0x22538a)[_0x7484('0x25')](handleEntityNotFound(_0x4ccf4a,null))['then'](respondWithResult(_0x4ccf4a,null))[_0x7484('0x47')](handleError(_0x4ccf4a,null));};exports['create']=function(_0x539133,_0x34400f){return db['Trigger'][_0x7484('0x4b')](_0x539133[_0x7484('0x4c')],{})[_0x7484('0x25')](function(_0x13b825){var _0x19cb63=_0x539133[_0x7484('0x4d')]['get']({'plain':!![]});if(!_0x19cb63)throw new Error(_0x7484('0x4e'));if(_0x19cb63[_0x7484('0x4f')]==='user'){var _0x474037=_0x13b825['get']({'plain':!![]});var _0x3db822=_0x7484('0x28');return db[_0x7484('0x50')][_0x7484('0x4a')]({'where':{'name':_0x3db822,'userProfileId':_0x19cb63[_0x7484('0x51')]},'raw':!![]})[_0x7484('0x25')](function(_0x503962){if(_0x503962&&_0x503962[_0x7484('0x52')]===0x0){return db[_0x7484('0x29')][_0x7484('0x4b')]({'name':_0x474037[_0x7484('0x2c')],'resourceId':_0x474037['id'],'type':_0x503962[_0x7484('0x2c')],'sectionId':_0x503962['id']},{})[_0x7484('0x25')](function(){return _0x13b825;});}else{return _0x13b825;}})[_0x7484('0x47')](function(_0x3be1d0){logger['error'](_0x7484('0x53'),_0x3be1d0);throw _0x3be1d0;});}return _0x13b825;})[_0x7484('0x25')](respondWithResult(_0x34400f,0xc9))['catch'](handleError(_0x34400f,null));};exports[_0x7484('0x24')]=function(_0x4bcac9,_0x5bfe5a){if(_0x4bcac9[_0x7484('0x4c')]['id']){delete _0x4bcac9['body']['id'];}return db[_0x7484('0x2f')][_0x7484('0x4a')]({'where':{'id':_0x4bcac9['params']['id']}})[_0x7484('0x25')](handleEntityNotFound(_0x5bfe5a,null))['then'](saveUpdates(_0x4bcac9[_0x7484('0x4c')],null))['then'](respondWithResult(_0x5bfe5a,null))['catch'](handleError(_0x5bfe5a,null));};exports['destroy']=function(_0x5549e7,_0x50d5bd){return db['Trigger'][_0x7484('0x4a')]({'where':{'id':_0x5549e7['params']['id']}})[_0x7484('0x25')](handleEntityNotFound(_0x50d5bd,null))[_0x7484('0x25')](removeEntity(_0x50d5bd,null))[_0x7484('0x47')](handleError(_0x50d5bd,null));};exports['addAllCondition']=function(_0x40c665,_0x2ac281,_0x1ffa75){if(_0x40c665[_0x7484('0x4c')]['id']){delete _0x40c665['body']['id'];}return db[_0x7484('0x2f')][_0x7484('0x4a')]({'where':{'id':_0x40c665['params']['id']}})[_0x7484('0x25')](handleEntityNotFound(_0x2ac281,null))[_0x7484('0x25')](function(_0x318674){if(_0x318674){_0x40c665[_0x7484('0x4c')][_0x7484('0x54')]=_0x318674['id'];return db[_0x7484('0x55')][_0x7484('0x4b')](_0x40c665[_0x7484('0x4c')]);}})[_0x7484('0x25')](respondWithResult(_0x2ac281,null))[_0x7484('0x47')](handleError(_0x2ac281,null));};exports[_0x7484('0x56')]=function(_0x1c971f,_0x1ac5c3,_0x239a19){if(_0x1c971f[_0x7484('0x4c')]['id']){delete _0x1c971f[_0x7484('0x4c')]['id'];}return db[_0x7484('0x2f')][_0x7484('0x4a')]({'where':{'id':_0x1c971f['params']['id']}})[_0x7484('0x25')](handleEntityNotFound(_0x1ac5c3,null))[_0x7484('0x25')](function(_0x5f198d){if(_0x5f198d){_0x1c971f[_0x7484('0x4c')][_0x7484('0x57')]=_0x5f198d['id'];return db[_0x7484('0x55')][_0x7484('0x4b')](_0x1c971f[_0x7484('0x4c')]);}})[_0x7484('0x25')](respondWithResult(_0x1ac5c3,null))[_0x7484('0x47')](handleError(_0x1ac5c3,null));};exports[_0x7484('0x58')]=function(_0x529623,_0x24bb2a,_0x1a4c6a){var _0x54b073={};var _0x132447={};var _0x1bc70b;var _0x4ea14a;return db[_0x7484('0x2f')][_0x7484('0x59')]({'where':{'id':_0x529623[_0x7484('0x49')]['id']}})[_0x7484('0x25')](handleEntityNotFound(_0x24bb2a,null))['then'](function(_0x41c91a){if(_0x41c91a){_0x1bc70b=_0x41c91a;_0x132447[_0x7484('0x36')]=_[_0x7484('0x32')](db['Condition'][_0x7484('0x30')]);_0x132447[_0x7484('0x33')]=_[_0x7484('0x32')](_0x529623[_0x7484('0x33')]);_0x132447['filters']=_[_0x7484('0x35')](_0x132447[_0x7484('0x36')],_0x132447[_0x7484('0x33')]);_0x54b073[_0x7484('0x38')]=_[_0x7484('0x35')](_0x132447['model'],qs[_0x7484('0x37')](_0x529623[_0x7484('0x33')]['fields']));_0x54b073[_0x7484('0x38')]=_0x54b073[_0x7484('0x38')][_0x7484('0x39')]?_0x54b073[_0x7484('0x38')]:_0x132447[_0x7484('0x36')];_0x54b073[_0x7484('0x3b')]=qs[_0x7484('0x3c')](_0x529623[_0x7484('0x33')][_0x7484('0x3c')]);_0x54b073[_0x7484('0x3d')]=qs[_0x7484('0x34')](_['pick'](_0x529623['query'],_0x132447['filters']));if(_0x529623[_0x7484('0x33')][_0x7484('0x3f')]){_0x54b073['where']=_[_0x7484('0x40')](_0x54b073['where'],{'$or':_['map'](_0x54b073[_0x7484('0x38')],function(_0x4c13ac){var _0x1bf2b9={};_0x1bf2b9[_0x4c13ac]={'$like':'%'+_0x529623[_0x7484('0x33')]['filter']+'%'};return _0x1bf2b9;})});}_0x54b073=_[_0x7484('0x40')]({},_0x54b073,_0x529623[_0x7484('0x43')]);return _0x1bc70b['getAllConditions'](_0x54b073);}})[_0x7484('0x25')](function(_0x4f2415){if(_0x4f2415){_0x4ea14a=_0x4f2415[_0x7484('0x39')];if(!_0x529623['query'][_0x7484('0x3a')](_0x7484('0x5a'))){_0x54b073[_0x7484('0x1e')]=qs[_0x7484('0x1e')](_0x529623[_0x7484('0x33')]['limit']);_0x54b073['offset']=qs[_0x7484('0x1c')](_0x529623['query']['offset']);}return _0x1bc70b[_0x7484('0x58')](_0x54b073);}})[_0x7484('0x25')](function(_0xaca79b){if(_0xaca79b){return _0xaca79b?{'count':_0x4ea14a,'rows':_0xaca79b}:null;}})['then'](respondWithResult(_0x24bb2a,null))[_0x7484('0x47')](handleError(_0x24bb2a,null));};exports['getAnyConditions']=function(_0x48a56e,_0x25f073,_0x270f67){var _0x2d0f1f={};var _0x14529b={};var _0xb421cc;var _0x184001;return db[_0x7484('0x2f')][_0x7484('0x59')]({'where':{'id':_0x48a56e['params']['id']}})[_0x7484('0x25')](handleEntityNotFound(_0x25f073,null))[_0x7484('0x25')](function(_0x1b329e){if(_0x1b329e){_0xb421cc=_0x1b329e;_0x14529b[_0x7484('0x36')]=_[_0x7484('0x32')](db['Condition'][_0x7484('0x30')]);_0x14529b[_0x7484('0x33')]=_[_0x7484('0x32')](_0x48a56e[_0x7484('0x33')]);_0x14529b[_0x7484('0x34')]=_[_0x7484('0x35')](_0x14529b[_0x7484('0x36')],_0x14529b['query']);_0x2d0f1f[_0x7484('0x38')]=_['intersection'](_0x14529b[_0x7484('0x36')],qs[_0x7484('0x37')](_0x48a56e['query']['fields']));_0x2d0f1f[_0x7484('0x38')]=_0x2d0f1f[_0x7484('0x38')]['length']?_0x2d0f1f[_0x7484('0x38')]:_0x14529b[_0x7484('0x36')];_0x2d0f1f[_0x7484('0x3b')]=qs[_0x7484('0x3c')](_0x48a56e[_0x7484('0x33')][_0x7484('0x3c')]);_0x2d0f1f[_0x7484('0x3d')]=qs[_0x7484('0x34')](_[_0x7484('0x3e')](_0x48a56e[_0x7484('0x33')],_0x14529b[_0x7484('0x34')]));if(_0x48a56e[_0x7484('0x33')][_0x7484('0x3f')]){_0x2d0f1f[_0x7484('0x3d')]=_['merge'](_0x2d0f1f[_0x7484('0x3d')],{'$or':_[_0x7484('0x2e')](_0x2d0f1f[_0x7484('0x38')],function(_0x5a2d17){var _0x538ef7={};_0x538ef7[_0x5a2d17]={'$like':'%'+_0x48a56e[_0x7484('0x33')]['filter']+'%'};return _0x538ef7;})});}_0x2d0f1f=_[_0x7484('0x40')]({},_0x2d0f1f,_0x48a56e[_0x7484('0x43')]);return _0xb421cc[_0x7484('0x5b')](_0x2d0f1f);}})[_0x7484('0x25')](function(_0x295e88){if(_0x295e88){_0x184001=_0x295e88[_0x7484('0x39')];if(!_0x48a56e[_0x7484('0x33')][_0x7484('0x3a')](_0x7484('0x5a'))){_0x2d0f1f['limit']=qs['limit'](_0x48a56e[_0x7484('0x33')][_0x7484('0x1e')]);_0x2d0f1f['offset']=qs[_0x7484('0x1c')](_0x48a56e[_0x7484('0x33')][_0x7484('0x1c')]);}return _0xb421cc[_0x7484('0x5b')](_0x2d0f1f);}})[_0x7484('0x25')](function(_0x174820){if(_0x174820){return _0x174820?{'count':_0x184001,'rows':_0x174820}:null;}})[_0x7484('0x25')](respondWithResult(_0x25f073,null))[_0x7484('0x47')](handleError(_0x25f073,null));};exports[_0x7484('0x5c')]=function(_0x3f6064,_0x3710ae,_0x577c7d){if(_0x3f6064[_0x7484('0x4c')]['id']){delete _0x3f6064['body']['id'];}return db[_0x7484('0x2f')][_0x7484('0x4a')]({'where':{'id':_0x3f6064['params']['id']}})[_0x7484('0x25')](handleEntityNotFound(_0x3710ae,null))['then'](function(_0x43285f){if(_0x43285f){_0x3f6064[_0x7484('0x4c')]['TriggerId']=_0x43285f['id'];return db[_0x7484('0x5d')][_0x7484('0x4b')](_0x3f6064[_0x7484('0x4c')]);}})[_0x7484('0x25')](respondWithResult(_0x3710ae,null))[_0x7484('0x47')](handleError(_0x3710ae,null));};exports[_0x7484('0x5e')]=function(_0x571b09,_0x32db4f,_0x30006a){var _0x1822d1={};var _0x2bd168={};var _0x5d97de;var _0x53c275;return db[_0x7484('0x2f')][_0x7484('0x59')]({'where':{'id':_0x571b09['params']['id']}})[_0x7484('0x25')](handleEntityNotFound(_0x32db4f,null))[_0x7484('0x25')](function(_0x20d1fd){if(_0x20d1fd){_0x5d97de=_0x20d1fd;_0x2bd168[_0x7484('0x36')]=_['keys'](db[_0x7484('0x5d')][_0x7484('0x30')]);_0x2bd168[_0x7484('0x33')]=_[_0x7484('0x32')](_0x571b09[_0x7484('0x33')]);_0x2bd168[_0x7484('0x34')]=_['intersection'](_0x2bd168[_0x7484('0x36')],_0x2bd168[_0x7484('0x33')]);_0x1822d1[_0x7484('0x38')]=_[_0x7484('0x35')](_0x2bd168[_0x7484('0x36')],qs['fields'](_0x571b09[_0x7484('0x33')][_0x7484('0x37')]));_0x1822d1[_0x7484('0x38')]=_0x1822d1[_0x7484('0x38')]['length']?_0x1822d1['attributes']:_0x2bd168['model'];_0x1822d1[_0x7484('0x3b')]=qs['sort'](_0x571b09[_0x7484('0x33')]['sort']);_0x1822d1[_0x7484('0x3d')]=qs['filters'](_[_0x7484('0x3e')](_0x571b09[_0x7484('0x33')],_0x2bd168['filters']));if(_0x571b09['query'][_0x7484('0x3f')]){_0x1822d1[_0x7484('0x3d')]=_[_0x7484('0x40')](_0x1822d1[_0x7484('0x3d')],{'$or':_[_0x7484('0x2e')](_0x1822d1[_0x7484('0x38')],function(_0x1c22e8){var _0x4f54a6={};_0x4f54a6[_0x1c22e8]={'$like':'%'+_0x571b09['query'][_0x7484('0x3f')]+'%'};return _0x4f54a6;})});}_0x1822d1=_[_0x7484('0x40')]({},_0x1822d1,_0x571b09['options']);return _0x5d97de[_0x7484('0x5e')](_0x1822d1);}})['then'](function(_0x4d10f3){if(_0x4d10f3){_0x53c275=_0x4d10f3[_0x7484('0x39')];if(!_0x571b09['query'][_0x7484('0x3a')](_0x7484('0x5a'))){_0x1822d1['limit']=qs[_0x7484('0x1e')](_0x571b09[_0x7484('0x33')][_0x7484('0x1e')]);_0x1822d1[_0x7484('0x1c')]=qs[_0x7484('0x1c')](_0x571b09[_0x7484('0x33')][_0x7484('0x1c')]);}return _0x5d97de[_0x7484('0x5e')](_0x1822d1);}})[_0x7484('0x25')](function(_0x5062d0){if(_0x5062d0){return _0x5062d0?{'count':_0x53c275,'rows':_0x5062d0}:null;}})[_0x7484('0x25')](respondWithResult(_0x32db4f,null))[_0x7484('0x47')](handleError(_0x32db4f,null));}; \ No newline at end of file +var _0x7c0f=['catch','show','params','includeAll','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','Triggers','UserProfileResource','error','stack','name','index','map','Trigger','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','findAll','rows'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x7c0f,0x193));var _0xf7c0=function(_0x32a2e9,_0x3f9b54){_0x32a2e9=_0x32a2e9-0x0;var _0x4dbacb=_0x7c0f[_0x32a2e9];return _0x4dbacb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7c0('0x0'));var zipdir=require(_0xf7c0('0x1'));var jsonpatch=require(_0xf7c0('0x2'));var rp=require(_0xf7c0('0x3'));var moment=require(_0xf7c0('0x4'));var BPromise=require(_0xf7c0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf7c0('0x6'));var sox=require(_0xf7c0('0x7'));var csv=require(_0xf7c0('0x8'));var ejs=require(_0xf7c0('0x9'));var fs=require('fs');var fs_extra=require(_0xf7c0('0xa'));var _=require(_0xf7c0('0xb'));var squel=require(_0xf7c0('0xc'));var crypto=require(_0xf7c0('0xd'));var jsforce=require(_0xf7c0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf7c0('0xf'));var Papa=require(_0xf7c0('0x10'));var Redis=require('ioredis');var authService=require(_0xf7c0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf7c0('0x12'));var hardwareService=require(_0xf7c0('0x13'));var logger=require('../../config/logger')(_0xf7c0('0x14'));var utils=require(_0xf7c0('0x15'));var config=require(_0xf7c0('0x16'));var licenseUtil=require(_0xf7c0('0x17'));var db=require(_0xf7c0('0x18'))['db'];function respondWithStatusCode(_0x49b04d,_0x19cbd8){_0x19cbd8=_0x19cbd8||0xcc;return function(_0x592233){if(_0x592233){return _0x49b04d[_0xf7c0('0x19')](_0x19cbd8);}return _0x49b04d['status'](_0x19cbd8)['end']();};}function respondWithResult(_0x3b5f5a,_0x313ea4){_0x313ea4=_0x313ea4||0xc8;return function(_0x2cc7f0){if(_0x2cc7f0){return _0x3b5f5a[_0xf7c0('0x1a')](_0x313ea4)['json'](_0x2cc7f0);}};}function respondWithFilteredResult(_0x47fa2d,_0x5058b6){return function(_0x3e9605){if(_0x3e9605){var _0xa5e81c=typeof _0x5058b6[_0xf7c0('0x1b')]===_0xf7c0('0x1c')&&typeof _0x5058b6[_0xf7c0('0x1d')]==='undefined';var _0x530498=_0x3e9605[_0xf7c0('0x1e')];var _0x411d82=_0xa5e81c?0x0:_0x5058b6[_0xf7c0('0x1b')];var _0x3bb29a=_0xa5e81c?_0x3e9605['count']:_0x5058b6[_0xf7c0('0x1b')]+_0x5058b6[_0xf7c0('0x1d')];var _0x4032ab;if(_0x3bb29a>=_0x530498){_0x3bb29a=_0x530498;_0x4032ab=0xc8;}else{_0x4032ab=0xce;}_0x47fa2d[_0xf7c0('0x1a')](_0x4032ab);return _0x47fa2d[_0xf7c0('0x1f')]('Content-Range',_0x411d82+'-'+_0x3bb29a+'/'+_0x530498)[_0xf7c0('0x20')](_0x3e9605);}return null;};}function patchUpdates(_0x6526f2){return function(_0x52fc6f){try{jsonpatch['apply'](_0x52fc6f,_0x6526f2,!![]);}catch(_0x2bf810){return BPromise[_0xf7c0('0x21')](_0x2bf810);}return _0x52fc6f[_0xf7c0('0x22')]();};}function saveUpdates(_0x57b4ce,_0x2481c8){return function(_0x413975){if(_0x413975){return _0x413975['update'](_0x57b4ce)[_0xf7c0('0x23')](function(_0x38aae9){return _0x38aae9;});}return null;};}function removeEntity(_0x927c6b,_0xe0eacf){return function(_0x5a1330){if(_0x5a1330){return _0x5a1330[_0xf7c0('0x24')]()[_0xf7c0('0x23')](function(){var _0x39a9cc=_0x5a1330['get']({'plain':!![]});var _0x27d705=_0xf7c0('0x25');return db[_0xf7c0('0x26')][_0xf7c0('0x24')]({'where':{'type':_0x27d705,'resourceId':_0x39a9cc['id']}})[_0xf7c0('0x23')](function(){return _0x5a1330;});})[_0xf7c0('0x23')](function(){_0x927c6b[_0xf7c0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af9bf,_0x406091){return function(_0x53d448){if(!_0x53d448){_0x4af9bf[_0xf7c0('0x19')](0x194);}return _0x53d448;};}function handleError(_0x4566f7,_0x2b803a){_0x2b803a=_0x2b803a||0x1f4;return function(_0x5a2814){logger[_0xf7c0('0x27')](_0x5a2814[_0xf7c0('0x28')]);if(_0x5a2814['name']){delete _0x5a2814[_0xf7c0('0x29')];}_0x4566f7[_0xf7c0('0x1a')](_0x2b803a)['send'](_0x5a2814);};}exports[_0xf7c0('0x2a')]=function(_0x452645,_0x22826f){var _0x3eb198={},_0x172151={},_0x2ee60d={'count':0x0,'rows':[]};var _0x344005=_[_0xf7c0('0x2b')](db[_0xf7c0('0x2c')][_0xf7c0('0x2d')],function(_0x53e320){return{'name':_0x53e320[_0xf7c0('0x2e')],'type':_0x53e320[_0xf7c0('0x2f')]['key']};});_0x172151['model']=_[_0xf7c0('0x2b')](_0x344005,_0xf7c0('0x29'));_0x172151[_0xf7c0('0x30')]=_[_0xf7c0('0x31')](_0x452645['query']);_0x172151[_0xf7c0('0x32')]=_['intersection'](_0x172151[_0xf7c0('0x33')],_0x172151[_0xf7c0('0x30')]);_0x3eb198[_0xf7c0('0x34')]=_[_0xf7c0('0x35')](_0x172151[_0xf7c0('0x33')],qs['fields'](_0x452645[_0xf7c0('0x30')][_0xf7c0('0x36')]));_0x3eb198[_0xf7c0('0x34')]=_0x3eb198[_0xf7c0('0x34')][_0xf7c0('0x37')]?_0x3eb198[_0xf7c0('0x34')]:_0x172151['model'];if(!_0x452645[_0xf7c0('0x30')][_0xf7c0('0x38')](_0xf7c0('0x39'))){_0x3eb198[_0xf7c0('0x1d')]=qs[_0xf7c0('0x1d')](_0x452645[_0xf7c0('0x30')]['limit']);_0x3eb198['offset']=qs[_0xf7c0('0x1b')](_0x452645[_0xf7c0('0x30')][_0xf7c0('0x1b')]);}_0x3eb198[_0xf7c0('0x3a')]=qs[_0xf7c0('0x3b')](_0x452645[_0xf7c0('0x30')][_0xf7c0('0x3b')]);_0x3eb198['where']=qs['filters'](_['pick'](_0x452645[_0xf7c0('0x30')],_0x172151['filters']),_0x344005);if(_0x452645[_0xf7c0('0x30')]['filter']){_0x3eb198['where']=_[_0xf7c0('0x3c')](_0x3eb198[_0xf7c0('0x3d')],{'$or':_[_0xf7c0('0x2b')](_0x344005,function(_0x528f0a){if(_0x528f0a[_0xf7c0('0x2f')]!==_0xf7c0('0x3e')){var _0x1dcd60={};_0x1dcd60[_0x528f0a[_0xf7c0('0x29')]]={'$like':'%'+_0x452645[_0xf7c0('0x30')][_0xf7c0('0x3f')]+'%'};return _0x1dcd60;}})});}_0x3eb198=_['merge']({},_0x3eb198,_0x452645[_0xf7c0('0x40')]);var _0xaae741={'where':_0x3eb198[_0xf7c0('0x3d')]};return db['Trigger'][_0xf7c0('0x1e')](_0xaae741)[_0xf7c0('0x23')](function(_0xbaec24){_0x2ee60d['count']=_0xbaec24;if(_0x452645[_0xf7c0('0x30')]['includeAll']){_0x3eb198['include']=[{'all':!![]}];}return db[_0xf7c0('0x2c')][_0xf7c0('0x41')](_0x3eb198);})[_0xf7c0('0x23')](function(_0x229391){_0x2ee60d[_0xf7c0('0x42')]=_0x229391;return _0x2ee60d;})[_0xf7c0('0x23')](respondWithFilteredResult(_0x22826f,_0x3eb198))[_0xf7c0('0x43')](handleError(_0x22826f,null));};exports[_0xf7c0('0x44')]=function(_0x438b94,_0x1df8d2){var _0x404598={'raw':![],'where':{'id':_0x438b94[_0xf7c0('0x45')]['id']}},_0x42519f={};_0x42519f[_0xf7c0('0x33')]=_[_0xf7c0('0x31')](db['Trigger'][_0xf7c0('0x2d')]);_0x42519f['query']=_['keys'](_0x438b94['query']);_0x42519f['filters']=_[_0xf7c0('0x35')](_0x42519f[_0xf7c0('0x33')],_0x42519f[_0xf7c0('0x30')]);_0x404598[_0xf7c0('0x34')]=_[_0xf7c0('0x35')](_0x42519f[_0xf7c0('0x33')],qs[_0xf7c0('0x36')](_0x438b94['query']['fields']));_0x404598[_0xf7c0('0x34')]=_0x404598[_0xf7c0('0x34')]['length']?_0x404598[_0xf7c0('0x34')]:_0x42519f[_0xf7c0('0x33')];if(_0x438b94[_0xf7c0('0x30')][_0xf7c0('0x46')]){_0x404598[_0xf7c0('0x47')]=[{'all':!![]}];}_0x404598=_[_0xf7c0('0x3c')]({},_0x404598,_0x438b94[_0xf7c0('0x40')]);return db['Trigger'][_0xf7c0('0x48')](_0x404598)[_0xf7c0('0x23')](handleEntityNotFound(_0x1df8d2,null))[_0xf7c0('0x23')](respondWithResult(_0x1df8d2,null))[_0xf7c0('0x43')](handleError(_0x1df8d2,null));};exports[_0xf7c0('0x49')]=function(_0x34c89f,_0x5ba63a){return db[_0xf7c0('0x2c')]['create'](_0x34c89f[_0xf7c0('0x4a')],{})[_0xf7c0('0x23')](function(_0x31c1e8){var _0x480060=_0x34c89f['user'][_0xf7c0('0x4b')]({'plain':!![]});if(!_0x480060)throw new Error(_0xf7c0('0x4c'));if(_0x480060[_0xf7c0('0x4d')]===_0xf7c0('0x4e')){var _0x55ede0=_0x31c1e8[_0xf7c0('0x4b')]({'plain':!![]});var _0x43c1e8=_0xf7c0('0x25');return db[_0xf7c0('0x4f')][_0xf7c0('0x48')]({'where':{'name':_0x43c1e8,'userProfileId':_0x480060['userProfileId']},'raw':!![]})['then'](function(_0x38e0be){if(_0x38e0be&&_0x38e0be[_0xf7c0('0x50')]===0x0){return db[_0xf7c0('0x26')]['create']({'name':_0x55ede0[_0xf7c0('0x29')],'resourceId':_0x55ede0['id'],'type':_0x38e0be[_0xf7c0('0x29')],'sectionId':_0x38e0be['id']},{})[_0xf7c0('0x23')](function(){return _0x31c1e8;});}else{return _0x31c1e8;}})[_0xf7c0('0x43')](function(_0x1f382a){logger[_0xf7c0('0x27')](_0xf7c0('0x51'),_0x1f382a);throw _0x1f382a;});}return _0x31c1e8;})[_0xf7c0('0x23')](respondWithResult(_0x5ba63a,0xc9))['catch'](handleError(_0x5ba63a,null));};exports[_0xf7c0('0x52')]=function(_0x3069eb,_0x133b49){if(_0x3069eb[_0xf7c0('0x4a')]['id']){delete _0x3069eb[_0xf7c0('0x4a')]['id'];}return db[_0xf7c0('0x2c')][_0xf7c0('0x48')]({'where':{'id':_0x3069eb[_0xf7c0('0x45')]['id']}})['then'](handleEntityNotFound(_0x133b49,null))[_0xf7c0('0x23')](saveUpdates(_0x3069eb[_0xf7c0('0x4a')],null))[_0xf7c0('0x23')](respondWithResult(_0x133b49,null))[_0xf7c0('0x43')](handleError(_0x133b49,null));};exports[_0xf7c0('0x24')]=function(_0x22a45f,_0x1289ac){return db['Trigger'][_0xf7c0('0x48')]({'where':{'id':_0x22a45f[_0xf7c0('0x45')]['id']}})[_0xf7c0('0x23')](handleEntityNotFound(_0x1289ac,null))['then'](removeEntity(_0x1289ac,null))[_0xf7c0('0x43')](handleError(_0x1289ac,null));};exports[_0xf7c0('0x53')]=function(_0x1b9982,_0x1b9e4c,_0x54290d){if(_0x1b9982['body']['id']){delete _0x1b9982['body']['id'];}return db[_0xf7c0('0x2c')][_0xf7c0('0x48')]({'where':{'id':_0x1b9982[_0xf7c0('0x45')]['id']}})[_0xf7c0('0x23')](handleEntityNotFound(_0x1b9e4c,null))[_0xf7c0('0x23')](function(_0x6aa556){if(_0x6aa556){_0x1b9982[_0xf7c0('0x4a')][_0xf7c0('0x54')]=_0x6aa556['id'];return db[_0xf7c0('0x55')][_0xf7c0('0x49')](_0x1b9982[_0xf7c0('0x4a')]);}})[_0xf7c0('0x23')](respondWithResult(_0x1b9e4c,null))['catch'](handleError(_0x1b9e4c,null));};exports[_0xf7c0('0x56')]=function(_0x2e4f05,_0x4c3b53,_0x3ae261){if(_0x2e4f05[_0xf7c0('0x4a')]['id']){delete _0x2e4f05[_0xf7c0('0x4a')]['id'];}return db[_0xf7c0('0x2c')][_0xf7c0('0x48')]({'where':{'id':_0x2e4f05['params']['id']}})['then'](handleEntityNotFound(_0x4c3b53,null))[_0xf7c0('0x23')](function(_0x2797c2){if(_0x2797c2){_0x2e4f05[_0xf7c0('0x4a')][_0xf7c0('0x57')]=_0x2797c2['id'];return db[_0xf7c0('0x55')]['create'](_0x2e4f05[_0xf7c0('0x4a')]);}})['then'](respondWithResult(_0x4c3b53,null))[_0xf7c0('0x43')](handleError(_0x4c3b53,null));};exports[_0xf7c0('0x58')]=function(_0x58b1bc,_0x3c4fba,_0x296593){var _0x42c273={};var _0x1b8eac={};var _0x4231d3;var _0x72e2a7;return db[_0xf7c0('0x2c')][_0xf7c0('0x59')]({'where':{'id':_0x58b1bc[_0xf7c0('0x45')]['id']}})[_0xf7c0('0x23')](handleEntityNotFound(_0x3c4fba,null))['then'](function(_0xfd5b18){if(_0xfd5b18){_0x4231d3=_0xfd5b18;_0x1b8eac[_0xf7c0('0x33')]=_[_0xf7c0('0x31')](db[_0xf7c0('0x55')]['rawAttributes']);_0x1b8eac[_0xf7c0('0x30')]=_[_0xf7c0('0x31')](_0x58b1bc[_0xf7c0('0x30')]);_0x1b8eac[_0xf7c0('0x32')]=_[_0xf7c0('0x35')](_0x1b8eac[_0xf7c0('0x33')],_0x1b8eac[_0xf7c0('0x30')]);_0x42c273['attributes']=_[_0xf7c0('0x35')](_0x1b8eac[_0xf7c0('0x33')],qs[_0xf7c0('0x36')](_0x58b1bc[_0xf7c0('0x30')][_0xf7c0('0x36')]));_0x42c273[_0xf7c0('0x34')]=_0x42c273[_0xf7c0('0x34')][_0xf7c0('0x37')]?_0x42c273[_0xf7c0('0x34')]:_0x1b8eac[_0xf7c0('0x33')];_0x42c273[_0xf7c0('0x3a')]=qs['sort'](_0x58b1bc[_0xf7c0('0x30')][_0xf7c0('0x3b')]);_0x42c273[_0xf7c0('0x3d')]=qs[_0xf7c0('0x32')](_[_0xf7c0('0x5a')](_0x58b1bc[_0xf7c0('0x30')],_0x1b8eac[_0xf7c0('0x32')]));if(_0x58b1bc[_0xf7c0('0x30')][_0xf7c0('0x3f')]){_0x42c273[_0xf7c0('0x3d')]=_['merge'](_0x42c273['where'],{'$or':_['map'](_0x42c273[_0xf7c0('0x34')],function(_0x26277f){var _0x5a28d8={};_0x5a28d8[_0x26277f]={'$like':'%'+_0x58b1bc[_0xf7c0('0x30')][_0xf7c0('0x3f')]+'%'};return _0x5a28d8;})});}_0x42c273=_['merge']({},_0x42c273,_0x58b1bc[_0xf7c0('0x40')]);return _0x4231d3[_0xf7c0('0x58')](_0x42c273);}})[_0xf7c0('0x23')](function(_0x2a9e3e){if(_0x2a9e3e){_0x72e2a7=_0x2a9e3e[_0xf7c0('0x37')];if(!_0x58b1bc[_0xf7c0('0x30')][_0xf7c0('0x38')](_0xf7c0('0x39'))){_0x42c273['limit']=qs['limit'](_0x58b1bc[_0xf7c0('0x30')]['limit']);_0x42c273[_0xf7c0('0x1b')]=qs[_0xf7c0('0x1b')](_0x58b1bc[_0xf7c0('0x30')][_0xf7c0('0x1b')]);}return _0x4231d3['getAllConditions'](_0x42c273);}})[_0xf7c0('0x23')](function(_0x4d8d2d){if(_0x4d8d2d){return _0x4d8d2d?{'count':_0x72e2a7,'rows':_0x4d8d2d}:null;}})['then'](respondWithResult(_0x3c4fba,null))[_0xf7c0('0x43')](handleError(_0x3c4fba,null));};exports['getAnyConditions']=function(_0x5183b0,_0x5796c4,_0x1c237d){var _0x7dee63={};var _0x1461b9={};var _0x4c8aab;var _0x143424;return db['Trigger'][_0xf7c0('0x59')]({'where':{'id':_0x5183b0['params']['id']}})['then'](handleEntityNotFound(_0x5796c4,null))[_0xf7c0('0x23')](function(_0x5c72ec){if(_0x5c72ec){_0x4c8aab=_0x5c72ec;_0x1461b9[_0xf7c0('0x33')]=_[_0xf7c0('0x31')](db[_0xf7c0('0x55')]['rawAttributes']);_0x1461b9[_0xf7c0('0x30')]=_[_0xf7c0('0x31')](_0x5183b0[_0xf7c0('0x30')]);_0x1461b9['filters']=_[_0xf7c0('0x35')](_0x1461b9[_0xf7c0('0x33')],_0x1461b9['query']);_0x7dee63['attributes']=_[_0xf7c0('0x35')](_0x1461b9['model'],qs[_0xf7c0('0x36')](_0x5183b0[_0xf7c0('0x30')]['fields']));_0x7dee63[_0xf7c0('0x34')]=_0x7dee63['attributes'][_0xf7c0('0x37')]?_0x7dee63['attributes']:_0x1461b9[_0xf7c0('0x33')];_0x7dee63[_0xf7c0('0x3a')]=qs[_0xf7c0('0x3b')](_0x5183b0['query']['sort']);_0x7dee63['where']=qs[_0xf7c0('0x32')](_[_0xf7c0('0x5a')](_0x5183b0['query'],_0x1461b9[_0xf7c0('0x32')]));if(_0x5183b0[_0xf7c0('0x30')][_0xf7c0('0x3f')]){_0x7dee63['where']=_[_0xf7c0('0x3c')](_0x7dee63['where'],{'$or':_['map'](_0x7dee63[_0xf7c0('0x34')],function(_0x35609f){var _0x5beaa1={};_0x5beaa1[_0x35609f]={'$like':'%'+_0x5183b0[_0xf7c0('0x30')][_0xf7c0('0x3f')]+'%'};return _0x5beaa1;})});}_0x7dee63=_[_0xf7c0('0x3c')]({},_0x7dee63,_0x5183b0[_0xf7c0('0x40')]);return _0x4c8aab['getAnyConditions'](_0x7dee63);}})[_0xf7c0('0x23')](function(_0x15ec89){if(_0x15ec89){_0x143424=_0x15ec89[_0xf7c0('0x37')];if(!_0x5183b0[_0xf7c0('0x30')][_0xf7c0('0x38')]('nolimit')){_0x7dee63['limit']=qs[_0xf7c0('0x1d')](_0x5183b0[_0xf7c0('0x30')][_0xf7c0('0x1d')]);_0x7dee63[_0xf7c0('0x1b')]=qs[_0xf7c0('0x1b')](_0x5183b0[_0xf7c0('0x30')][_0xf7c0('0x1b')]);}return _0x4c8aab['getAnyConditions'](_0x7dee63);}})[_0xf7c0('0x23')](function(_0x519312){if(_0x519312){return _0x519312?{'count':_0x143424,'rows':_0x519312}:null;}})[_0xf7c0('0x23')](respondWithResult(_0x5796c4,null))[_0xf7c0('0x43')](handleError(_0x5796c4,null));};exports['addAction']=function(_0x6951d4,_0x3ba6d6,_0x2340fa){if(_0x6951d4[_0xf7c0('0x4a')]['id']){delete _0x6951d4[_0xf7c0('0x4a')]['id'];}return db[_0xf7c0('0x2c')][_0xf7c0('0x48')]({'where':{'id':_0x6951d4[_0xf7c0('0x45')]['id']}})[_0xf7c0('0x23')](handleEntityNotFound(_0x3ba6d6,null))[_0xf7c0('0x23')](function(_0x2f69ef){if(_0x2f69ef){_0x6951d4[_0xf7c0('0x4a')][_0xf7c0('0x5b')]=_0x2f69ef['id'];return db[_0xf7c0('0x5c')]['create'](_0x6951d4[_0xf7c0('0x4a')]);}})[_0xf7c0('0x23')](respondWithResult(_0x3ba6d6,null))[_0xf7c0('0x43')](handleError(_0x3ba6d6,null));};exports[_0xf7c0('0x5d')]=function(_0x5bad0e,_0x52c137,_0x88aac8){var _0x5e306e={};var _0x57f2c6={};var _0x590fe4;var _0x5f5263;return db[_0xf7c0('0x2c')][_0xf7c0('0x59')]({'where':{'id':_0x5bad0e['params']['id']}})[_0xf7c0('0x23')](handleEntityNotFound(_0x52c137,null))[_0xf7c0('0x23')](function(_0x381def){if(_0x381def){_0x590fe4=_0x381def;_0x57f2c6['model']=_['keys'](db['Action'][_0xf7c0('0x2d')]);_0x57f2c6[_0xf7c0('0x30')]=_[_0xf7c0('0x31')](_0x5bad0e[_0xf7c0('0x30')]);_0x57f2c6['filters']=_[_0xf7c0('0x35')](_0x57f2c6['model'],_0x57f2c6['query']);_0x5e306e[_0xf7c0('0x34')]=_[_0xf7c0('0x35')](_0x57f2c6[_0xf7c0('0x33')],qs[_0xf7c0('0x36')](_0x5bad0e[_0xf7c0('0x30')][_0xf7c0('0x36')]));_0x5e306e['attributes']=_0x5e306e['attributes']['length']?_0x5e306e[_0xf7c0('0x34')]:_0x57f2c6[_0xf7c0('0x33')];_0x5e306e[_0xf7c0('0x3a')]=qs[_0xf7c0('0x3b')](_0x5bad0e['query'][_0xf7c0('0x3b')]);_0x5e306e[_0xf7c0('0x3d')]=qs['filters'](_[_0xf7c0('0x5a')](_0x5bad0e[_0xf7c0('0x30')],_0x57f2c6[_0xf7c0('0x32')]));if(_0x5bad0e['query'][_0xf7c0('0x3f')]){_0x5e306e[_0xf7c0('0x3d')]=_['merge'](_0x5e306e[_0xf7c0('0x3d')],{'$or':_[_0xf7c0('0x2b')](_0x5e306e['attributes'],function(_0x18ecfa){var _0x179766={};_0x179766[_0x18ecfa]={'$like':'%'+_0x5bad0e[_0xf7c0('0x30')]['filter']+'%'};return _0x179766;})});}_0x5e306e=_['merge']({},_0x5e306e,_0x5bad0e[_0xf7c0('0x40')]);return _0x590fe4[_0xf7c0('0x5d')](_0x5e306e);}})[_0xf7c0('0x23')](function(_0x34180f){if(_0x34180f){_0x5f5263=_0x34180f[_0xf7c0('0x37')];if(!_0x5bad0e['query'][_0xf7c0('0x38')](_0xf7c0('0x39'))){_0x5e306e[_0xf7c0('0x1d')]=qs[_0xf7c0('0x1d')](_0x5bad0e['query'][_0xf7c0('0x1d')]);_0x5e306e[_0xf7c0('0x1b')]=qs[_0xf7c0('0x1b')](_0x5bad0e[_0xf7c0('0x30')]['offset']);}return _0x590fe4[_0xf7c0('0x5d')](_0x5e306e);}})[_0xf7c0('0x23')](function(_0x41a931){if(_0x41a931){return _0x41a931?{'count':_0x5f5263,'rows':_0x41a931}:null;}})[_0xf7c0('0x23')](respondWithResult(_0x52c137,null))[_0xf7c0('0x43')](handleError(_0x52c137,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 976be36..5bd73f1 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 _0x269f=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash','util'];(function(_0x5979a6,_0x564c8d){var _0x2df08c=function(_0x4892ef){while(--_0x4892ef){_0x5979a6['push'](_0x5979a6['shift']());}};_0x2df08c(++_0x564c8d);}(_0x269f,0xee));var _0xf269=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x269f[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xf269('0x0'));var util=require(_0xf269('0x1'));var logger=require(_0xf269('0x2'))('api');var moment=require(_0xf269('0x3'));var BPromise=require('bluebird');var rp=require(_0xf269('0x4'));var fs=require('fs');var path=require(_0xf269('0x5'));var rimraf=require(_0xf269('0x6'));var config=require(_0xf269('0x7'));var attributes=require(_0xf269('0x8'));module['exports']=function(_0x2969ef,_0x32066d){return _0x2969ef[_0xf269('0x9')](_0xf269('0xa'),attributes,{'tableName':_0xf269('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25ad=['Trigger','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x4ae53c,_0x29c143){var _0x3ea1d9=function(_0x5ec2b2){while(--_0x5ec2b2){_0x4ae53c['push'](_0x4ae53c['shift']());}};_0x3ea1d9(++_0x29c143);}(_0x25ad,0x1b1));var _0xd25a=function(_0x3e99cb,_0x1d2fe0){_0x3e99cb=_0x3e99cb-0x0;var _0x1bc729=_0x25ad[_0x3e99cb];return _0x1bc729;};'use strict';var _=require(_0xd25a('0x0'));var util=require('util');var logger=require(_0xd25a('0x1'))(_0xd25a('0x2'));var moment=require(_0xd25a('0x3'));var BPromise=require('bluebird');var rp=require(_0xd25a('0x4'));var fs=require('fs');var path=require(_0xd25a('0x5'));var rimraf=require(_0xd25a('0x6'));var config=require(_0xd25a('0x7'));var attributes=require(_0xd25a('0x8'));module[_0xd25a('0x9')]=function(_0x544053,_0x4ca0db){return _0x544053[_0xd25a('0xa')](_0xd25a('0xb'),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 f13a6e2..bc4dd4d 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 _0xd137=['client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTrigger','Trigger','options','where','attributes','limit','include','map','model','ShowTrigger','find','raw','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xd137,0x132));var _0x7d13=function(_0x3a00e4,_0x464323){_0x3a00e4=_0x3a00e4-0x0;var _0x24afe4=_0xd137[_0x3a00e4];return _0x24afe4;};'use strict';var _=require(_0x7d13('0x0'));var util=require(_0x7d13('0x1'));var moment=require(_0x7d13('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d13('0x3'));var fs=require('fs');var Redis=require(_0x7d13('0x4'));var db=require(_0x7d13('0x5'))['db'];var utils=require(_0x7d13('0x6'));var logger=require(_0x7d13('0x7'))(_0x7d13('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d13('0x9')][_0x7d13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b7259,_0x3cf8a5,_0x418bc4){return new BPromise(function(_0x433ed4,_0x124749){return client[_0x7d13('0xb')](_0x1b7259,_0x418bc4)[_0x7d13('0xc')](function(_0x1f8992){logger['info'](_0x7d13('0xd'),_0x3cf8a5,_0x7d13('0xe'));logger['debug'](_0x7d13('0xf'),_0x3cf8a5,_0x7d13('0xe'),JSON[_0x7d13('0x10')](_0x1f8992));if(_0x1f8992[_0x7d13('0x11')]){if(_0x1f8992['error']['code']===0x1f4){logger[_0x7d13('0x11')](_0x7d13('0xd'),_0x3cf8a5,_0x1f8992[_0x7d13('0x11')][_0x7d13('0x12')]);return _0x124749(_0x1f8992['error'][_0x7d13('0x12')]);}logger['error'](_0x7d13('0xd'),_0x3cf8a5,_0x1f8992[_0x7d13('0x11')][_0x7d13('0x12')]);return _0x433ed4(_0x1f8992[_0x7d13('0x11')]['message']);}else{logger[_0x7d13('0x13')]('Trigger,\x20%s,\x20%s',_0x3cf8a5,'request\x20sent');_0x433ed4(_0x1f8992[_0x7d13('0x14')][_0x7d13('0x12')]);}})[_0x7d13('0x15')](function(_0x4fbd64){logger[_0x7d13('0x11')](_0x7d13('0xd'),_0x3cf8a5,_0x4fbd64);_0x124749(_0x4fbd64);});});}exports[_0x7d13('0x16')]=function(_0x23bfe7){var _0xfdfcab=this;return new Promise(function(_0x1c5632,_0x42c63d){return db[_0x7d13('0x17')]['findAll']({'raw':_0x23bfe7[_0x7d13('0x18')]?_0x23bfe7[_0x7d13('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23bfe7['options']?_0x23bfe7['options'][_0x7d13('0x19')]||null:null,'attributes':_0x23bfe7[_0x7d13('0x18')]?_0x23bfe7['options'][_0x7d13('0x1a')]||null:null,'limit':_0x23bfe7[_0x7d13('0x18')]?_0x23bfe7[_0x7d13('0x18')][_0x7d13('0x1b')]||null:null,'include':_0x23bfe7['options']?_0x23bfe7[_0x7d13('0x18')][_0x7d13('0x1c')]?_['map'](_0x23bfe7[_0x7d13('0x18')][_0x7d13('0x1c')],function(_0x267db4){return{'model':db[_0x267db4['model']],'as':_0x267db4['as'],'attributes':_0x267db4[_0x7d13('0x1a')],'include':_0x267db4[_0x7d13('0x1c')]?_[_0x7d13('0x1d')](_0x267db4[_0x7d13('0x1c')],function(_0x102928){return{'model':db[_0x102928[_0x7d13('0x1e')]],'as':_0x102928['as'],'attributes':_0x102928[_0x7d13('0x1a')],'include':_0x102928[_0x7d13('0x1c')]?_[_0x7d13('0x1d')](_0x102928[_0x7d13('0x1c')],function(_0x5e45f4){return{'model':db[_0x5e45f4[_0x7d13('0x1e')]],'as':_0x5e45f4['as'],'attributes':_0x5e45f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x168b54){logger['info'](_0x7d13('0x16'),_0x23bfe7);logger['debug'](_0x7d13('0x16'),_0x23bfe7,JSON[_0x7d13('0x10')](_0x168b54));_0x1c5632(_0x168b54);})[_0x7d13('0x15')](function(_0x59aa4c){logger[_0x7d13('0x11')](_0x7d13('0x16'),_0x59aa4c['message'],_0x23bfe7);_0x42c63d(_0xfdfcab[_0x7d13('0x11')](0x1f4,_0x59aa4c[_0x7d13('0x12')]));});});};exports[_0x7d13('0x1f')]=function(_0x13bcfa){var _0x493c01=this;return new Promise(function(_0x47c590,_0x150b02){return db[_0x7d13('0x17')][_0x7d13('0x20')]({'raw':_0x13bcfa['options']?_0x13bcfa[_0x7d13('0x18')][_0x7d13('0x21')]===undefined?!![]:![]:!![],'where':_0x13bcfa[_0x7d13('0x18')]?_0x13bcfa[_0x7d13('0x18')][_0x7d13('0x19')]||null:null,'attributes':_0x13bcfa[_0x7d13('0x18')]?_0x13bcfa['options']['attributes']||null:null,'include':_0x13bcfa['options']?_0x13bcfa[_0x7d13('0x18')][_0x7d13('0x1c')]?_[_0x7d13('0x1d')](_0x13bcfa[_0x7d13('0x18')]['include'],function(_0x24d4fa){return{'model':db[_0x24d4fa[_0x7d13('0x1e')]],'as':_0x24d4fa['as'],'attributes':_0x24d4fa['attributes'],'include':_0x24d4fa[_0x7d13('0x1c')]?_['map'](_0x24d4fa[_0x7d13('0x1c')],function(_0x34b8ea){return{'model':db[_0x34b8ea['model']],'as':_0x34b8ea['as'],'attributes':_0x34b8ea[_0x7d13('0x1a')],'include':_0x34b8ea[_0x7d13('0x1c')]?_[_0x7d13('0x1d')](_0x34b8ea[_0x7d13('0x1c')],function(_0x3f5e7d){return{'model':db[_0x3f5e7d['model']],'as':_0x3f5e7d['as'],'attributes':_0x3f5e7d[_0x7d13('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2367b9){logger['info']('ShowTrigger',_0x13bcfa);logger[_0x7d13('0x22')]('ShowTrigger',_0x13bcfa,JSON['stringify'](_0x2367b9));_0x47c590(_0x2367b9);})[_0x7d13('0x15')](function(_0x153e22){logger['error']('ShowTrigger',_0x153e22[_0x7d13('0x12')],_0x13bcfa);_0x150b02(_0x493c01['error'](0x1f4,_0x153e22[_0x7d13('0x12')]));});});}; \ No newline at end of file +var _0xae95=['attributes','stringify','find','raw','model','ShowTrigger','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','where','limit','include','map'];(function(_0x51289e,_0x4f18d7){var _0x4b4241=function(_0x5b841f){while(--_0x5b841f){_0x51289e['push'](_0x51289e['shift']());}};_0x4b4241(++_0x4f18d7);}(_0xae95,0x178));var _0x5ae9=function(_0x533eab,_0xb1dd93){_0x533eab=_0x533eab-0x0;var _0x27eab9=_0xae95[_0x533eab];return _0x27eab9;};'use strict';var _=require('lodash');var util=require(_0x5ae9('0x0'));var moment=require(_0x5ae9('0x1'));var BPromise=require(_0x5ae9('0x2'));var rs=require(_0x5ae9('0x3'));var fs=require('fs');var Redis=require(_0x5ae9('0x4'));var db=require(_0x5ae9('0x5'))['db'];var utils=require(_0x5ae9('0x6'));var logger=require(_0x5ae9('0x7'))(_0x5ae9('0x8'));var config=require(_0x5ae9('0x9'));var jayson=require(_0x5ae9('0xa'));var client=jayson[_0x5ae9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15bbaf,_0x2bb55c,_0x54ddf5){return new BPromise(function(_0x4bb23f,_0xd97e10){return client['request'](_0x15bbaf,_0x54ddf5)[_0x5ae9('0xc')](function(_0x11beef){logger[_0x5ae9('0xd')](_0x5ae9('0xe'),_0x2bb55c,_0x5ae9('0xf'));logger[_0x5ae9('0x10')](_0x5ae9('0x11'),_0x2bb55c,_0x5ae9('0xf'),JSON['stringify'](_0x11beef));if(_0x11beef[_0x5ae9('0x12')]){if(_0x11beef['error'][_0x5ae9('0x13')]===0x1f4){logger[_0x5ae9('0x12')]('Trigger,\x20%s,\x20%s',_0x2bb55c,_0x11beef['error'][_0x5ae9('0x14')]);return _0xd97e10(_0x11beef['error'][_0x5ae9('0x14')]);}logger[_0x5ae9('0x12')](_0x5ae9('0xe'),_0x2bb55c,_0x11beef[_0x5ae9('0x12')]['message']);return _0x4bb23f(_0x11beef[_0x5ae9('0x12')][_0x5ae9('0x14')]);}else{logger[_0x5ae9('0xd')](_0x5ae9('0xe'),_0x2bb55c,_0x5ae9('0xf'));_0x4bb23f(_0x11beef[_0x5ae9('0x15')][_0x5ae9('0x14')]);}})[_0x5ae9('0x16')](function(_0x390849){logger[_0x5ae9('0x12')](_0x5ae9('0xe'),_0x2bb55c,_0x390849);_0xd97e10(_0x390849);});});}exports[_0x5ae9('0x17')]=function(_0x34adfb){var _0x5bdece=this;return new Promise(function(_0x4baf79,_0x295129){return db[_0x5ae9('0x18')][_0x5ae9('0x19')]({'raw':_0x34adfb[_0x5ae9('0x1a')]?_0x34adfb[_0x5ae9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x34adfb['options']?_0x34adfb['options'][_0x5ae9('0x1b')]||null:null,'attributes':_0x34adfb['options']?_0x34adfb[_0x5ae9('0x1a')]['attributes']||null:null,'limit':_0x34adfb[_0x5ae9('0x1a')]?_0x34adfb['options'][_0x5ae9('0x1c')]||null:null,'include':_0x34adfb[_0x5ae9('0x1a')]?_0x34adfb['options'][_0x5ae9('0x1d')]?_[_0x5ae9('0x1e')](_0x34adfb[_0x5ae9('0x1a')][_0x5ae9('0x1d')],function(_0x56eeb8){return{'model':db[_0x56eeb8['model']],'as':_0x56eeb8['as'],'attributes':_0x56eeb8[_0x5ae9('0x1f')],'include':_0x56eeb8['include']?_[_0x5ae9('0x1e')](_0x56eeb8[_0x5ae9('0x1d')],function(_0x8b0950){return{'model':db[_0x8b0950['model']],'as':_0x8b0950['as'],'attributes':_0x8b0950[_0x5ae9('0x1f')],'include':_0x8b0950[_0x5ae9('0x1d')]?_[_0x5ae9('0x1e')](_0x8b0950[_0x5ae9('0x1d')],function(_0x578fb4){return{'model':db[_0x578fb4['model']],'as':_0x578fb4['as'],'attributes':_0x578fb4['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ae9('0xc')](function(_0x3664d9){logger['info'](_0x5ae9('0x17'),_0x34adfb);logger['debug'](_0x5ae9('0x17'),_0x34adfb,JSON[_0x5ae9('0x20')](_0x3664d9));_0x4baf79(_0x3664d9);})[_0x5ae9('0x16')](function(_0x493bd4){logger[_0x5ae9('0x12')](_0x5ae9('0x17'),_0x493bd4[_0x5ae9('0x14')],_0x34adfb);_0x295129(_0x5bdece[_0x5ae9('0x12')](0x1f4,_0x493bd4[_0x5ae9('0x14')]));});});};exports['ShowTrigger']=function(_0x3a3ad5){var _0x4a97db=this;return new Promise(function(_0x472f1c,_0x5b80bd){return db['Trigger'][_0x5ae9('0x21')]({'raw':_0x3a3ad5[_0x5ae9('0x1a')]?_0x3a3ad5[_0x5ae9('0x1a')][_0x5ae9('0x22')]===undefined?!![]:![]:!![],'where':_0x3a3ad5['options']?_0x3a3ad5[_0x5ae9('0x1a')]['where']||null:null,'attributes':_0x3a3ad5['options']?_0x3a3ad5[_0x5ae9('0x1a')][_0x5ae9('0x1f')]||null:null,'include':_0x3a3ad5[_0x5ae9('0x1a')]?_0x3a3ad5[_0x5ae9('0x1a')][_0x5ae9('0x1d')]?_['map'](_0x3a3ad5['options'][_0x5ae9('0x1d')],function(_0x2318e5){return{'model':db[_0x2318e5['model']],'as':_0x2318e5['as'],'attributes':_0x2318e5[_0x5ae9('0x1f')],'include':_0x2318e5[_0x5ae9('0x1d')]?_[_0x5ae9('0x1e')](_0x2318e5[_0x5ae9('0x1d')],function(_0xc287ef){return{'model':db[_0xc287ef[_0x5ae9('0x23')]],'as':_0xc287ef['as'],'attributes':_0xc287ef['attributes'],'include':_0xc287ef[_0x5ae9('0x1d')]?_[_0x5ae9('0x1e')](_0xc287ef['include'],function(_0x1d73b6){return{'model':db[_0x1d73b6['model']],'as':_0x1d73b6['as'],'attributes':_0x1d73b6[_0x5ae9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5ae9('0xc')](function(_0x61a361){logger['info']('ShowTrigger',_0x3a3ad5);logger[_0x5ae9('0x10')](_0x5ae9('0x24'),_0x3a3ad5,JSON['stringify'](_0x61a361));_0x472f1c(_0x61a361);})[_0x5ae9('0x16')](function(_0x5e4dae){logger['error'](_0x5ae9('0x24'),_0x5e4dae[_0x5ae9('0x14')],_0x3a3ad5);_0x5b80bd(_0x4a97db[_0x5ae9('0x12')](0x1f4,_0x5e4dae['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index c7ea5bd..898c852 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 _0x37d5=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./trunk.controller','get','isAuthenticated','/:id','post','/:id/clone','clone','create','update','delete'];(function(_0x5c15d8,_0x6f659){var _0x404ad2=function(_0x263842){while(--_0x263842){_0x5c15d8['push'](_0x5c15d8['shift']());}};_0x404ad2(++_0x6f659);}(_0x37d5,0x16b));var _0x537d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37d5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x537d('0x0'));var path=require(_0x537d('0x1'));var timeout=require(_0x537d('0x2'));var express=require(_0x537d('0x3'));var router=express[_0x537d('0x4')]();var fs_extra=require(_0x537d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x537d('0x6'));var config=require('../../config/environment');var controller=require(_0x537d('0x7'));router[_0x537d('0x8')]('/',auth[_0x537d('0x9')](),controller['index']);router[_0x537d('0x8')](_0x537d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x537d('0xb')](_0x537d('0xc'),auth[_0x537d('0x9')](),controller[_0x537d('0xd')]);router[_0x537d('0xb')]('/',auth['isAuthenticated'](),controller[_0x537d('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x537d('0xf')]);router[_0x537d('0x10')](_0x537d('0xa'),auth[_0x537d('0x9')](),controller[_0x537d('0x11')]);module[_0x537d('0x12')]=router; \ No newline at end of file +var _0x6a2d=['destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','clone','create','put','delete'];(function(_0x193090,_0x356aed){var _0x29ac15=function(_0x3c51a7){while(--_0x3c51a7){_0x193090['push'](_0x193090['shift']());}};_0x29ac15(++_0x356aed);}(_0x6a2d,0x1ce));var _0xd6a2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6a2d[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xd6a2('0x0'));var util=require(_0xd6a2('0x1'));var path=require(_0xd6a2('0x2'));var timeout=require('connect-timeout');var express=require(_0xd6a2('0x3'));var router=express['Router']();var fs_extra=require(_0xd6a2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd6a2('0x5'));var config=require(_0xd6a2('0x6'));var controller=require(_0xd6a2('0x7'));router[_0xd6a2('0x8')]('/',auth[_0xd6a2('0x9')](),controller[_0xd6a2('0xa')]);router[_0xd6a2('0x8')](_0xd6a2('0xb'),auth[_0xd6a2('0x9')](),controller['show']);router[_0xd6a2('0xc')](_0xd6a2('0xd'),auth[_0xd6a2('0x9')](),controller[_0xd6a2('0xe')]);router['post']('/',auth[_0xd6a2('0x9')](),controller[_0xd6a2('0xf')]);router[_0xd6a2('0x10')](_0xd6a2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd6a2('0x11')](_0xd6a2('0xb'),auth[_0xd6a2('0x9')](),controller[_0xd6a2('0x12')]);module[_0xd6a2('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index cfb8228..acfb4d4 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 _0x6cbf=['always','accept','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','update','force_rport,comedia','setDataValue','nat','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER'];(function(_0x1a0fd1,_0x244357){var _0x4ab52e=function(_0x3fc823){while(--_0x3fc823){_0x1a0fd1['push'](_0x1a0fd1['shift']());}};_0x4ab52e(++_0x244357);}(_0x6cbf,0x70));var _0xf6cb=function(_0x1a3feb,_0x26f810){_0x1a3feb=_0x1a3feb-0x0;var _0x4f6ce0=_0x6cbf[_0x1a3feb];return _0x4f6ce0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf6cb('0x0')],'allowNull':![],'unique':_0xf6cb('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x3'),_0xf6cb('0x4'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xf6cb('0x0')],'allowNull':![],'defaultValue':_0xf6cb('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xf6cb('0x6'),_0xf6cb('0x7'),_0xf6cb('0x8'),'ALLOWED',_0xf6cb('0x9'),_0xf6cb('0xa'),'PROHIB_FAILED_SCREEN',_0xf6cb('0xb'))},'deny':{'type':Sequelize[_0xf6cb('0x0')]},'permit':{'type':Sequelize[_0xf6cb('0x0')]},'secret':{'type':Sequelize[_0xf6cb('0x0')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xf6cb('0x0')],'defaultValue':_0xf6cb('0xc'),'set':function(_0x5423ef){this['setDataValue']('transport',_0x5423ef?_0x5423ef['join'](','):null);},'get':function(){return this['getDataValue'](_0xf6cb('0xd'))?this[_0xf6cb('0xe')]('transport')['split'](','):null;},'comment':_0xf6cb('0xf')},'dtmfmode':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x10'),'info',_0xf6cb('0x11'),'inband',_0xf6cb('0x12')),'defaultValue':_0xf6cb('0x10')},'directmedia':{'type':Sequelize['ENUM'](_0xf6cb('0x13'),'no','nonat',_0xf6cb('0x14'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf6cb('0x0')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xf6cb('0x0')],'defaultValue':_0xf6cb('0x15'),'set':function(_0x5e215e){this[_0xf6cb('0x16')](_0xf6cb('0x17'),_0x5e215e?_0x5e215e[_0xf6cb('0x18')](','):null);},'get':function(){return this['getDataValue'](_0xf6cb('0x17'))?this['getDataValue']('nat')[_0xf6cb('0x19')](','):null;},'comment':_0xf6cb('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf6cb('0x0')]},'pickupgroup':{'type':Sequelize[_0xf6cb('0x0')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf6cb('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf6cb('0x0')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf6cb('0x1b'),'set':function(_0x48a5b7){this['setDataValue'](_0xf6cb('0x1c'),_0x48a5b7?_0x48a5b7[_0xf6cb('0x18')](';'):_0xf6cb('0x1b'));},'get':function(){return this['getDataValue'](_0xf6cb('0x1c'))?this[_0xf6cb('0xe')](_0xf6cb('0x1c'))[_0xf6cb('0x19')](';'):null;},'comment':_0xf6cb('0x1d')},'autoframing':{'type':Sequelize[_0xf6cb('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0xf6cb('0x0')],'defaultValue':_0xf6cb('0x1e'),'set':function(_0x560782){this[_0xf6cb('0x16')](_0xf6cb('0x1f'),_0x560782?_0x560782[_0xf6cb('0x18')](','):null);},'get':function(){return this['getDataValue'](_0xf6cb('0x1f'))?this['getDataValue'](_0xf6cb('0x1f'))['split'](','):null;},'comment':_0xf6cb('0x20')},'trustrpid':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf6cb('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf6cb('0x2')]('yes','no',_0xf6cb('0x21'))},'promiscredir':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'setvar':{'type':Sequelize[_0xf6cb('0x0')]},'callerid':{'type':Sequelize[_0xf6cb('0x0')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xf6cb('0x0')]},'callcounter':{'type':Sequelize[_0xf6cb('0x2')]('yes','no'),'defaultValue':_0xf6cb('0x13')},'busylevel':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0xf6cb('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xf6cb('0x2')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0xf6cb('0x0')]},'template':{'type':Sequelize[_0xf6cb('0x0')]},'videosupport':{'type':Sequelize[_0xf6cb('0x2')]('yes','no',_0xf6cb('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0xf6cb('0x24'),'refuse',_0xf6cb('0x25'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x26'),_0xf6cb('0x27')),'defaultValue':_0xf6cb('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0xf6cb('0x0')]},'regexten':{'type':Sequelize[_0xf6cb('0x0')]},'fromdomain':{'type':Sequelize[_0xf6cb('0x0')]},'fromuser':{'type':Sequelize[_0xf6cb('0x0')]},'port':{'type':Sequelize[_0xf6cb('0x22')](0x5)},'qualify':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'defaultip':{'type':Sequelize[_0xf6cb('0x0')]},'defaultuser':{'type':Sequelize[_0xf6cb('0x0')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xf6cb('0x13'),'no',_0xf6cb('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xf6cb('0x0')]},'timert1':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xf6cb('0x0')]},'contactacl':{'type':Sequelize[_0xf6cb('0x0')]},'unsolicited_mailbox':{'type':Sequelize[_0xf6cb('0x0')]},'use_q850_reason':{'type':Sequelize[_0xf6cb('0x0')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'force_avp':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'icesupport':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no',_0xf6cb('0x29'),_0xf6cb('0x2a'))},'dtlsrekey':{'type':Sequelize[_0xf6cb('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0xf6cb('0x0')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xf6cb('0x0')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xf6cb('0x2b'),_0xf6cb('0x2c'),_0xf6cb('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf6cb('0x0')]},'usereqphone':{'type':Sequelize['ENUM'](_0xf6cb('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xf6cb('0x0')]},'call_limit':{'type':Sequelize[_0xf6cb('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'subscribemwi':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no')},'vmexten':{'type':Sequelize[_0xf6cb('0x0')]},'mohinterpret':{'type':Sequelize[_0xf6cb('0x0')]},'mohsuggest':{'type':Sequelize[_0xf6cb('0x0')]},'parkinglot':{'type':Sequelize[_0xf6cb('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xf6cb('0x0')],'defaultValue':_0xf6cb('0x2e')},'canreinvite':{'type':Sequelize[_0xf6cb('0x2')](_0xf6cb('0x13'),'no','nonat','update',_0xf6cb('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xf6cb('0x0')]},'otherFields':{'type':Sequelize[_0xf6cb('0x0')]},'active':{'type':Sequelize[_0xf6cb('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x8f16=['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','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','nonat','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x8f16,0x83));var _0x68f1=function(_0x56ab0c,_0x1b2b1f){_0x56ab0c=_0x56ab0c-0x0;var _0xd5e9cb=_0x8f16[_0x56ab0c];return _0xd5e9cb;};'use strict';var Sequelize=require(_0x68f1('0x0'));module[_0x68f1('0x1')]={'name':{'type':Sequelize[_0x68f1('0x2')],'allowNull':![],'unique':_0x68f1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x5'),_0x68f1('0x6'),_0x68f1('0x7')),'allowNull':![],'defaultValue':_0x68f1('0x5')},'context':{'type':Sequelize[_0x68f1('0x2')],'allowNull':![],'defaultValue':_0x68f1('0x8')},'callingpres':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x9'),'ALLOWED_PASSED_SCREEN',_0x68f1('0xa'),_0x68f1('0xb'),_0x68f1('0xc'),'PROHIB_PASSED_SCREEN',_0x68f1('0xd'),_0x68f1('0xe'))},'deny':{'type':Sequelize[_0x68f1('0x2')]},'permit':{'type':Sequelize[_0x68f1('0x2')]},'secret':{'type':Sequelize[_0x68f1('0x2')]},'md5secret':{'type':Sequelize[_0x68f1('0x2')]},'remotesecret':{'type':Sequelize[_0x68f1('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x68f1('0xf'),'set':function(_0x5209ad){this[_0x68f1('0x10')](_0x68f1('0x11'),_0x5209ad?_0x5209ad[_0x68f1('0x12')](','):null);},'get':function(){return this[_0x68f1('0x13')](_0x68f1('0x11'))?this[_0x68f1('0x13')]('transport')[_0x68f1('0x14')](','):null;},'comment':_0x68f1('0x15')},'dtmfmode':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x16'),'info',_0x68f1('0x17'),'inband','auto'),'defaultValue':_0x68f1('0x16')},'directmedia':{'type':Sequelize[_0x68f1('0x4')]('yes','no',_0x68f1('0x18'),'update',_0x68f1('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x68f1('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x68f1('0x1b'),'set':function(_0x1300ef){this['setDataValue']('nat',_0x1300ef?_0x1300ef[_0x68f1('0x12')](','):null);},'get':function(){return this[_0x68f1('0x13')]('nat')?this[_0x68f1('0x13')](_0x68f1('0x1c'))[_0x68f1('0x14')](','):null;},'comment':_0x68f1('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x68f1('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x68f1('0x2')]},'language':{'type':Sequelize[_0x68f1('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x68f1('0x1e')},'allow':{'type':Sequelize[_0x68f1('0x2')],'allowNull':![],'defaultValue':_0x68f1('0x1f'),'set':function(_0x2e50f5){this['setDataValue']('allow',_0x2e50f5?_0x2e50f5[_0x68f1('0x12')](';'):_0x68f1('0x1f'));},'get':function(){return this[_0x68f1('0x13')](_0x68f1('0x20'))?this[_0x68f1('0x13')](_0x68f1('0x20'))[_0x68f1('0x14')](';'):null;},'comment':_0x68f1('0x21')},'autoframing':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no')},'insecure':{'type':Sequelize[_0x68f1('0x2')],'defaultValue':_0x68f1('0x22'),'set':function(_0x3cfae8){this[_0x68f1('0x10')](_0x68f1('0x23'),_0x3cfae8?_0x3cfae8[_0x68f1('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x68f1('0x23'))?this[_0x68f1('0x13')](_0x68f1('0x23'))[_0x68f1('0x14')](','):null;},'comment':_0x68f1('0x24')},'trustrpid':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x68f1('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x68f1('0x4')]('yes','no',_0x68f1('0x25'))},'promiscredir':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x68f1('0x26')](0xb)},'setvar':{'type':Sequelize[_0x68f1('0x2')]},'callerid':{'type':Sequelize[_0x68f1('0x2')],'defaultValue':_0x68f1('0x27')},'amaflags':{'type':Sequelize[_0x68f1('0x2')]},'callcounter':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no'),'defaultValue':_0x68f1('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x68f1('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x68f1('0x2')]},'template':{'type':Sequelize[_0x68f1('0x2')]},'videosupport':{'type':Sequelize[_0x68f1('0x4')]('yes','no',_0x68f1('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x68f1('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no')},'mailbox':{'type':Sequelize[_0x68f1('0x2')]},'session_timers':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x29'),_0x68f1('0x2a'),_0x68f1('0x2b'))},'session_expires':{'type':Sequelize[_0x68f1('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x68f1('0x26')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x68f1('0x2c')),'defaultValue':_0x68f1('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x68f1('0x2')]},'regexten':{'type':Sequelize[_0x68f1('0x2')]},'fromdomain':{'type':Sequelize[_0x68f1('0x2')]},'fromuser':{'type':Sequelize[_0x68f1('0x2')]},'port':{'type':Sequelize[_0x68f1('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x68f1('0x1a'),'no'),'defaultValue':_0x68f1('0x1a')},'keepalive':{'type':Sequelize[_0x68f1('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x68f1('0x2')]},'defaultuser':{'type':Sequelize[_0x68f1('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x68f1('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x68f1('0x26')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x68f1('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x68f1('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x68f1('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x68f1('0x2')]},'contactdeny':{'type':Sequelize[_0x68f1('0x2')]},'contactacl':{'type':Sequelize[_0x68f1('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x68f1('0x2')]},'use_q850_reason':{'type':Sequelize[_0x68f1('0x2')]},'maxforwards':{'type':Sequelize[_0x68f1('0x26')](0xb)},'encryption':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x68f1('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x68f1('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x68f1('0x2e'),_0x68f1('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x68f1('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x68f1('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x68f1('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x68f1('0x30'),_0x68f1('0x31'),_0x68f1('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x68f1('0x2')]},'usereqphone':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x68f1('0x2')]},'recordofffeature':{'type':Sequelize[_0x68f1('0x2')]},'call_limit':{'type':Sequelize[_0x68f1('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x68f1('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x68f1('0x2')]},'mohinterpret':{'type':Sequelize[_0x68f1('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x68f1('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x68f1('0x33')},'canreinvite':{'type':Sequelize[_0x68f1('0x4')](_0x68f1('0x1a'),'no',_0x68f1('0x18'),_0x68f1('0x34'),_0x68f1('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x68f1('0x2')]},'otherFields':{'type':Sequelize[_0x68f1('0x2')]},'active':{'type':Sequelize[_0x68f1('0x36')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 5ea3cd4..fcff5af 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x81bd,0x7c));var _0xd81b=function(_0x290492,_0x18cfad){_0x290492=_0x290492-0x0;var _0x52b5bf=_0x81bd[_0x290492];return _0x52b5bf;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','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','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x179b05,_0x2d42e1){var _0x37d0f5=function(_0x6f4917){while(--_0x6f4917){_0x179b05['push'](_0x179b05['shift']());}};_0x37d0f5(++_0x2d42e1);}(_0x98a8,0x12c));var _0x898a=function(_0x1c021e,_0x42618c){_0x1c021e=_0x1c021e-0x0;var _0x33e285=_0x98a8[_0x1c021e];return _0x33e285;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9829fc4..d61b058 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 _0xacb5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x39fb09,_0x4f0fc6){var _0x31aa84=function(_0x45312a){while(--_0x45312a){_0x39fb09['push'](_0x39fb09['shift']());}};_0x31aa84(++_0x4f0fc6);}(_0xacb5,0x196));var _0x5acb=function(_0x1dcbc6,_0x219d61){_0x1dcbc6=_0x1dcbc6-0x0;var _0x1a0893=_0xacb5[_0x1dcbc6];return _0x1a0893;};'use strict';var _=require(_0x5acb('0x0'));var util=require(_0x5acb('0x1'));var logger=require(_0x5acb('0x2'))(_0x5acb('0x3'));var moment=require(_0x5acb('0x4'));var BPromise=require(_0x5acb('0x5'));var rp=require(_0x5acb('0x6'));var fs=require('fs');var path=require(_0x5acb('0x7'));var rimraf=require(_0x5acb('0x8'));var config=require(_0x5acb('0x9'));var attributes=require('./trunk.attributes');module[_0x5acb('0xa')]=function(_0x27e22f,_0x5d45a8){return _0x27e22f[_0x5acb('0xb')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x433a=['exports','define','Trunk','tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b90ef,_0x180832){var _0x2c7893=function(_0x243a45){while(--_0x243a45){_0x2b90ef['push'](_0x2b90ef['shift']());}};_0x2c7893(++_0x180832);}(_0x433a,0x12f));var _0xa433=function(_0xbbf47b,_0x4589bb){_0xbbf47b=_0xbbf47b-0x0;var _0xc1d7bb=_0x433a[_0xbbf47b];return _0xc1d7bb;};'use strict';var _=require('lodash');var util=require(_0xa433('0x0'));var logger=require(_0xa433('0x1'))(_0xa433('0x2'));var moment=require(_0xa433('0x3'));var BPromise=require(_0xa433('0x4'));var rp=require(_0xa433('0x5'));var fs=require('fs');var path=require(_0xa433('0x6'));var rimraf=require(_0xa433('0x7'));var config=require(_0xa433('0x8'));var attributes=require('./trunk.attributes');module[_0xa433('0x9')]=function(_0x37ca01,_0x4a6e94){return _0x37ca01[_0xa433('0xa')](_0xa433('0xb'),attributes,{'tableName':_0xa433('0xc'),'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 fdaad72..6c4575b 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 _0x88f4=['rpc','../../config/environment','jayson/promise','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetTrunk','Trunk','findAll','options','where','attributes','limit','map','include','model','ShowTrunk','raw','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1b9c27,_0x126fd0){var _0x34d9c3=function(_0x4c1697){while(--_0x4c1697){_0x1b9c27['push'](_0x1b9c27['shift']());}};_0x34d9c3(++_0x126fd0);}(_0x88f4,0xfb));var _0x488f=function(_0x23671a,_0x56e4ff){_0x23671a=_0x23671a-0x0;var _0x127319=_0x88f4[_0x23671a];return _0x127319;};'use strict';var _=require('lodash');var util=require(_0x488f('0x0'));var moment=require('moment');var BPromise=require(_0x488f('0x1'));var rs=require(_0x488f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x488f('0x3'))['db'];var utils=require(_0x488f('0x4'));var logger=require('../../config/logger')(_0x488f('0x5'));var config=require(_0x488f('0x6'));var jayson=require(_0x488f('0x7'));var client=jayson['client'][_0x488f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9b7ae1,_0x4bff05,_0x573396){return new BPromise(function(_0x3d813f,_0x4fb091){return client['request'](_0x9b7ae1,_0x573396)[_0x488f('0x9')](function(_0x216324){logger[_0x488f('0xa')](_0x488f('0xb'),_0x4bff05,'request\x20sent');logger[_0x488f('0xc')](_0x488f('0xd'),_0x4bff05,_0x488f('0xe'),JSON[_0x488f('0xf')](_0x216324));if(_0x216324[_0x488f('0x10')]){if(_0x216324[_0x488f('0x10')][_0x488f('0x11')]===0x1f4){logger[_0x488f('0x10')](_0x488f('0xb'),_0x4bff05,_0x216324['error'][_0x488f('0x12')]);return _0x4fb091(_0x216324['error'][_0x488f('0x12')]);}logger[_0x488f('0x10')]('Trunk,\x20%s,\x20%s',_0x4bff05,_0x216324[_0x488f('0x10')][_0x488f('0x12')]);return _0x3d813f(_0x216324[_0x488f('0x10')][_0x488f('0x12')]);}else{logger['info'](_0x488f('0xb'),_0x4bff05,_0x488f('0xe'));_0x3d813f(_0x216324[_0x488f('0x13')][_0x488f('0x12')]);}})['catch'](function(_0x1374b5){logger[_0x488f('0x10')](_0x488f('0xb'),_0x4bff05,_0x1374b5);_0x4fb091(_0x1374b5);});});}exports[_0x488f('0x14')]=function(_0x5980c3){var _0x398d0c=this;return new Promise(function(_0x5ec846,_0x47b6ce){return db[_0x488f('0x15')][_0x488f('0x16')]({'raw':_0x5980c3[_0x488f('0x17')]?_0x5980c3[_0x488f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5980c3[_0x488f('0x17')]?_0x5980c3[_0x488f('0x17')][_0x488f('0x18')]||null:null,'attributes':_0x5980c3[_0x488f('0x17')]?_0x5980c3[_0x488f('0x17')][_0x488f('0x19')]||null:null,'limit':_0x5980c3[_0x488f('0x17')]?_0x5980c3[_0x488f('0x17')][_0x488f('0x1a')]||null:null,'include':_0x5980c3[_0x488f('0x17')]?_0x5980c3['options']['include']?_[_0x488f('0x1b')](_0x5980c3[_0x488f('0x17')][_0x488f('0x1c')],function(_0x15789c){return{'model':db[_0x15789c['model']],'as':_0x15789c['as'],'attributes':_0x15789c[_0x488f('0x19')],'include':_0x15789c[_0x488f('0x1c')]?_['map'](_0x15789c['include'],function(_0x462bd5){return{'model':db[_0x462bd5[_0x488f('0x1d')]],'as':_0x462bd5['as'],'attributes':_0x462bd5['attributes'],'include':_0x462bd5['include']?_[_0x488f('0x1b')](_0x462bd5[_0x488f('0x1c')],function(_0x41b715){return{'model':db[_0x41b715[_0x488f('0x1d')]],'as':_0x41b715['as'],'attributes':_0x41b715['attributes']};}):[]};}):[]};}):[]:[]})[_0x488f('0x9')](function(_0x53c7bf){logger[_0x488f('0xa')](_0x488f('0x14'),_0x5980c3);logger[_0x488f('0xc')](_0x488f('0x14'),_0x5980c3,JSON[_0x488f('0xf')](_0x53c7bf));_0x5ec846(_0x53c7bf);})['catch'](function(_0x3f187a){logger[_0x488f('0x10')](_0x488f('0x14'),_0x3f187a[_0x488f('0x12')],_0x5980c3);_0x47b6ce(_0x398d0c['error'](0x1f4,_0x3f187a['message']));});});};exports[_0x488f('0x1e')]=function(_0x2e9d34){var _0x14e9f9=this;return new Promise(function(_0x22213c,_0x4ff1db){return db[_0x488f('0x15')]['find']({'raw':_0x2e9d34[_0x488f('0x17')]?_0x2e9d34[_0x488f('0x17')][_0x488f('0x1f')]===undefined?!![]:![]:!![],'where':_0x2e9d34[_0x488f('0x17')]?_0x2e9d34[_0x488f('0x17')][_0x488f('0x18')]||null:null,'attributes':_0x2e9d34[_0x488f('0x17')]?_0x2e9d34[_0x488f('0x17')][_0x488f('0x19')]||null:null,'include':_0x2e9d34[_0x488f('0x17')]?_0x2e9d34[_0x488f('0x17')]['include']?_[_0x488f('0x1b')](_0x2e9d34[_0x488f('0x17')][_0x488f('0x1c')],function(_0x1a3f61){return{'model':db[_0x1a3f61[_0x488f('0x1d')]],'as':_0x1a3f61['as'],'attributes':_0x1a3f61[_0x488f('0x19')],'include':_0x1a3f61[_0x488f('0x1c')]?_[_0x488f('0x1b')](_0x1a3f61['include'],function(_0x101b53){return{'model':db[_0x101b53['model']],'as':_0x101b53['as'],'attributes':_0x101b53['attributes'],'include':_0x101b53[_0x488f('0x1c')]?_[_0x488f('0x1b')](_0x101b53[_0x488f('0x1c')],function(_0x739bd7){return{'model':db[_0x739bd7[_0x488f('0x1d')]],'as':_0x739bd7['as'],'attributes':_0x739bd7['attributes']};}):[]};}):[]};}):[]:[]})[_0x488f('0x9')](function(_0x547eac){logger[_0x488f('0xa')](_0x488f('0x1e'),_0x2e9d34);logger[_0x488f('0xc')](_0x488f('0x1e'),_0x2e9d34,JSON['stringify'](_0x547eac));_0x22213c(_0x547eac);})['catch'](function(_0x5a832f){logger[_0x488f('0x10')](_0x488f('0x1e'),_0x5a832f[_0x488f('0x12')],_0x2e9d34);_0x4ff1db(_0x14e9f9[_0x488f('0x10')](0x1f4,_0x5a832f[_0x488f('0x12')]));});});}; \ No newline at end of file +var _0xe6d2=['request\x20sent','debug','stringify','error','code','message','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','catch','ShowTrunk','find','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s'];(function(_0x16f4cf,_0x209e58){var _0x3d1165=function(_0x45a80f){while(--_0x45a80f){_0x16f4cf['push'](_0x16f4cf['shift']());}};_0x3d1165(++_0x209e58);}(_0xe6d2,0x193));var _0x2e6d=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xe6d2[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require(_0x2e6d('0x0'));var moment=require(_0x2e6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x2e6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e6d('0x4'))(_0x2e6d('0x5'));var config=require(_0x2e6d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e6d('0x7')][_0x2e6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9e1ff1,_0x460978,_0x11d061){return new BPromise(function(_0x4fafa6,_0x56053f){return client[_0x2e6d('0x9')](_0x9e1ff1,_0x11d061)[_0x2e6d('0xa')](function(_0x432f97){logger[_0x2e6d('0xb')](_0x2e6d('0xc'),_0x460978,_0x2e6d('0xd'));logger[_0x2e6d('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x460978,_0x2e6d('0xd'),JSON[_0x2e6d('0xf')](_0x432f97));if(_0x432f97[_0x2e6d('0x10')]){if(_0x432f97['error'][_0x2e6d('0x11')]===0x1f4){logger['error'](_0x2e6d('0xc'),_0x460978,_0x432f97['error']['message']);return _0x56053f(_0x432f97[_0x2e6d('0x10')][_0x2e6d('0x12')]);}logger[_0x2e6d('0x10')](_0x2e6d('0xc'),_0x460978,_0x432f97[_0x2e6d('0x10')]['message']);return _0x4fafa6(_0x432f97[_0x2e6d('0x10')][_0x2e6d('0x12')]);}else{logger[_0x2e6d('0xb')]('Trunk,\x20%s,\x20%s',_0x460978,_0x2e6d('0xd'));_0x4fafa6(_0x432f97['result'][_0x2e6d('0x12')]);}})['catch'](function(_0x43e586){logger[_0x2e6d('0x10')](_0x2e6d('0xc'),_0x460978,_0x43e586);_0x56053f(_0x43e586);});});}exports[_0x2e6d('0x13')]=function(_0x394ba3){var _0x3a615c=this;return new Promise(function(_0x638d4a,_0x29b05c){return db[_0x2e6d('0x14')][_0x2e6d('0x15')]({'raw':_0x394ba3[_0x2e6d('0x16')]?_0x394ba3[_0x2e6d('0x16')][_0x2e6d('0x17')]===undefined?!![]:![]:!![],'where':_0x394ba3[_0x2e6d('0x16')]?_0x394ba3[_0x2e6d('0x16')][_0x2e6d('0x18')]||null:null,'attributes':_0x394ba3[_0x2e6d('0x16')]?_0x394ba3[_0x2e6d('0x16')][_0x2e6d('0x19')]||null:null,'limit':_0x394ba3[_0x2e6d('0x16')]?_0x394ba3[_0x2e6d('0x16')]['limit']||null:null,'include':_0x394ba3['options']?_0x394ba3[_0x2e6d('0x16')][_0x2e6d('0x1a')]?_[_0x2e6d('0x1b')](_0x394ba3['options'][_0x2e6d('0x1a')],function(_0x347254){return{'model':db[_0x347254[_0x2e6d('0x1c')]],'as':_0x347254['as'],'attributes':_0x347254[_0x2e6d('0x19')],'include':_0x347254['include']?_['map'](_0x347254[_0x2e6d('0x1a')],function(_0x6ae604){return{'model':db[_0x6ae604[_0x2e6d('0x1c')]],'as':_0x6ae604['as'],'attributes':_0x6ae604[_0x2e6d('0x19')],'include':_0x6ae604[_0x2e6d('0x1a')]?_[_0x2e6d('0x1b')](_0x6ae604[_0x2e6d('0x1a')],function(_0x232486){return{'model':db[_0x232486[_0x2e6d('0x1c')]],'as':_0x232486['as'],'attributes':_0x232486[_0x2e6d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2e6d('0xa')](function(_0x2a4632){logger['info'](_0x2e6d('0x13'),_0x394ba3);logger[_0x2e6d('0xe')](_0x2e6d('0x13'),_0x394ba3,JSON['stringify'](_0x2a4632));_0x638d4a(_0x2a4632);})[_0x2e6d('0x1d')](function(_0x369781){logger[_0x2e6d('0x10')]('GetTrunk',_0x369781[_0x2e6d('0x12')],_0x394ba3);_0x29b05c(_0x3a615c['error'](0x1f4,_0x369781[_0x2e6d('0x12')]));});});};exports[_0x2e6d('0x1e')]=function(_0x11bcc1){var _0x27b75c=this;return new Promise(function(_0x55d3cc,_0x4a5e1e){return db['Trunk'][_0x2e6d('0x1f')]({'raw':_0x11bcc1[_0x2e6d('0x16')]?_0x11bcc1[_0x2e6d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x11bcc1['options']?_0x11bcc1[_0x2e6d('0x16')]['where']||null:null,'attributes':_0x11bcc1[_0x2e6d('0x16')]?_0x11bcc1[_0x2e6d('0x16')][_0x2e6d('0x19')]||null:null,'include':_0x11bcc1[_0x2e6d('0x16')]?_0x11bcc1[_0x2e6d('0x16')][_0x2e6d('0x1a')]?_[_0x2e6d('0x1b')](_0x11bcc1[_0x2e6d('0x16')][_0x2e6d('0x1a')],function(_0x7637c5){return{'model':db[_0x7637c5[_0x2e6d('0x1c')]],'as':_0x7637c5['as'],'attributes':_0x7637c5['attributes'],'include':_0x7637c5[_0x2e6d('0x1a')]?_[_0x2e6d('0x1b')](_0x7637c5['include'],function(_0x525941){return{'model':db[_0x525941[_0x2e6d('0x1c')]],'as':_0x525941['as'],'attributes':_0x525941['attributes'],'include':_0x525941[_0x2e6d('0x1a')]?_[_0x2e6d('0x1b')](_0x525941['include'],function(_0x425581){return{'model':db[_0x425581['model']],'as':_0x425581['as'],'attributes':_0x425581[_0x2e6d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2e6d('0xa')](function(_0x3b7089){logger[_0x2e6d('0xb')](_0x2e6d('0x1e'),_0x11bcc1);logger['debug'](_0x2e6d('0x1e'),_0x11bcc1,JSON[_0x2e6d('0xf')](_0x3b7089));_0x55d3cc(_0x3b7089);})['catch'](function(_0x44d851){logger[_0x2e6d('0x10')](_0x2e6d('0x1e'),_0x44d851['message'],_0x11bcc1);_0x4a5e1e(_0x27b75c[_0x2e6d('0x10')](0x1f4,_0x44d851[_0x2e6d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 716f619..0c3f147 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 _0xc3c5=['addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','addAvatar','/:id/logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','createApiKey','put','/:id/password','delete','removeQueues','removeTeams','/:id/chat_interactions','removeChatInteractions','/:id/fax_interactions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','/:id/square_projects','removeSquareProjects','removeApiKey','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/whoami','/presence','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getChatWebsites','getWhatsappAccounts','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post'];(function(_0x599ad4,_0x4b2612){var _0x3a634c=function(_0x44b62d){while(--_0x44b62d){_0x599ad4['push'](_0x599ad4['shift']());}};_0x3a634c(++_0x4b2612);}(_0xc3c5,0x192));var _0x5c3c=function(_0xc3394,_0x3f3aae){_0xc3394=_0xc3394-0x0;var _0x4bd9ce=_0xc3c5[_0xc3394];return _0x4bd9ce;};'use strict';var multer=require('multer');var util=require(_0x5c3c('0x0'));var path=require('path');var timeout=require(_0x5c3c('0x1'));var express=require(_0x5c3c('0x2'));var router=express[_0x5c3c('0x3')]();var fs_extra=require(_0x5c3c('0x4'));var auth=require(_0x5c3c('0x5'));var interaction=require(_0x5c3c('0x6'));var config=require(_0x5c3c('0x7'));var controller=require('./user.controller');router['get']('/',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x9')]);router[_0x5c3c('0xa')](_0x5c3c('0xb'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0xc')]);router[_0x5c3c('0xa')](_0x5c3c('0xd'),auth[_0x5c3c('0x8')](),controller['whoami']);router['get'](_0x5c3c('0xe'),auth['isAuthenticated'](),controller['getPresence']);router[_0x5c3c('0xa')](_0x5c3c('0xf'),auth['isAuthenticated'](),controller[_0x5c3c('0x10')]);router[_0x5c3c('0xa')](_0x5c3c('0x11'),controller['getAvatar']);router[_0x5c3c('0xa')](_0x5c3c('0x12'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x13')]);router['get'](_0x5c3c('0x14'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x15')]);router[_0x5c3c('0xa')](_0x5c3c('0x16'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x17')]);router[_0x5c3c('0xa')](_0x5c3c('0x18'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x19')]);router[_0x5c3c('0xa')](_0x5c3c('0x1a'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x1b')]);router['get']('/:id/recordings',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x1c')]);router[_0x5c3c('0xa')](_0x5c3c('0x1d'),auth['isAuthenticated'](),controller[_0x5c3c('0x1e')]);router[_0x5c3c('0xa')]('/:id/chat/interactions',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x1f')]);router[_0x5c3c('0xa')](_0x5c3c('0x20'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x21')]);router[_0x5c3c('0xa')](_0x5c3c('0x22'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x23')]);router['get']('/:id/sms/interactions',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x24')]);router[_0x5c3c('0xa')](_0x5c3c('0x25'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x26')]);router[_0x5c3c('0xa')]('/:id/whatsapp/interactions',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x27')]);router['get'](_0x5c3c('0x28'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x29')]);router[_0x5c3c('0xa')](_0x5c3c('0x2a'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x2b')]);router[_0x5c3c('0xa')](_0x5c3c('0x2c'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x5c3c('0x2d'),auth[_0x5c3c('0x8')](),controller['getVoicePrefixes']);router[_0x5c3c('0xa')](_0x5c3c('0x2e'),auth['isAuthenticated'](),controller[_0x5c3c('0x2f')]);router[_0x5c3c('0xa')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x5c3c('0x30')]);router[_0x5c3c('0xa')](_0x5c3c('0x31'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x32')]);router['get']('/:id/sms_accounts',auth[_0x5c3c('0x8')](),controller['getSmsAccounts']);router[_0x5c3c('0xa')]('/:id/chat_websites',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x33')]);router[_0x5c3c('0xa')]('/:id/whatsapp_accounts',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x34')]);router[_0x5c3c('0xa')]('/:id/square_projects',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x35')]);router[_0x5c3c('0xa')]('/:id/scheduled_calls',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x36')]);router[_0x5c3c('0xa')](_0x5c3c('0x37'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x38')]);router[_0x5c3c('0x39')](_0x5c3c('0x14'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x3a')]);router[_0x5c3c('0x39')]('/',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x3b')]);router[_0x5c3c('0x39')](_0x5c3c('0x3c'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x3d')]);router[_0x5c3c('0x39')](_0x5c3c('0x16'),auth['isAuthenticated'](),controller[_0x5c3c('0x3e')]);var upload=multer({'storage':multer[_0x5c3c('0x3f')]({'destination':function(_0x3057c4,_0x47fbd7,_0xe66cd4){_0xe66cd4(null,path[_0x5c3c('0x40')](config[_0x5c3c('0x41')],_0x5c3c('0x42')));},'filename':function(_0x41d246,_0x22144d,_0x5762e8){_0x5762e8(null,util['format'](_0x5c3c('0x43'),Date[_0x5c3c('0x44')](),_0x22144d[_0x5c3c('0x45')]));}})});router['post']('/:id/avatar',upload[_0x5c3c('0x46')]('file'),controller[_0x5c3c('0x47')]);router[_0x5c3c('0x39')]('/:id/login',auth[_0x5c3c('0x8')](),controller['login']);router[_0x5c3c('0x39')](_0x5c3c('0x48'),auth[_0x5c3c('0x8')](),controller['logout']);router[_0x5c3c('0x39')](_0x5c3c('0x49'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x4a')]);router[_0x5c3c('0x39')]('/:id/unpause',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x4b')]);router[_0x5c3c('0x39')](_0x5c3c('0x28'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x4c')]);router[_0x5c3c('0x39')]('/:id/chat_interactions',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x4d')]);router[_0x5c3c('0x39')](_0x5c3c('0x4e'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x4f')]);router[_0x5c3c('0x39')]('/:id/fax_interactions',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x50')]);router['post']('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x5c3c('0x51')]);router[_0x5c3c('0x39')](_0x5c3c('0x52'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x53')]);router[_0x5c3c('0x39')](_0x5c3c('0x54'),auth['isAuthenticated'](),controller[_0x5c3c('0x55')]);router[_0x5c3c('0x39')](_0x5c3c('0x2e'),auth['isAuthenticated'](),controller[_0x5c3c('0x56')]);router[_0x5c3c('0x39')](_0x5c3c('0x57'),auth['isAuthenticated'](),controller[_0x5c3c('0x58')]);router['post']('/:id/openchannel_accounts',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x59')]);router[_0x5c3c('0x39')](_0x5c3c('0x5a'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x5b')]);router[_0x5c3c('0x39')](_0x5c3c('0x5c'),auth[_0x5c3c('0x8')](),controller['addChatWebsites']);router[_0x5c3c('0x39')](_0x5c3c('0x5d'),auth[_0x5c3c('0x8')](),controller['addWhatsappAccounts']);router['post']('/:id/square_projects',auth['isAuthenticated'](),controller['addSquareProjects']);router[_0x5c3c('0x39')](_0x5c3c('0x37'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x5e')]);router[_0x5c3c('0x5f')](_0x5c3c('0xf'),auth[_0x5c3c('0x8')](),controller['update']);router[_0x5c3c('0x5f')](_0x5c3c('0x60'),auth[_0x5c3c('0x8')](),controller['changePassword']);router[_0x5c3c('0x61')]('/:id/queues',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x62')]);router['delete'](_0x5c3c('0x28'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x63')]);router['delete'](_0x5c3c('0xf'),auth[_0x5c3c('0x8')](),controller['destroy']);router['delete'](_0x5c3c('0x64'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x65')]);router[_0x5c3c('0x61')](_0x5c3c('0x4e'),auth[_0x5c3c('0x8')](),controller['removeMailInteractions']);router[_0x5c3c('0x61')](_0x5c3c('0x66'),auth[_0x5c3c('0x8')](),controller['removeFaxInteractions']);router[_0x5c3c('0x61')](_0x5c3c('0x67'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x68')]);router[_0x5c3c('0x61')](_0x5c3c('0x52'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x69')]);router[_0x5c3c('0x61')](_0x5c3c('0x54'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x6a')]);router['delete'](_0x5c3c('0x2e'),auth['isAuthenticated'](),controller[_0x5c3c('0x6b')]);router['delete']('/:id/mail_accounts',auth[_0x5c3c('0x8')](),controller['removeMailAccounts']);router[_0x5c3c('0x61')](_0x5c3c('0x31'),auth['isAuthenticated'](),controller[_0x5c3c('0x6c')]);router[_0x5c3c('0x61')]('/:id/sms_accounts',auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x6d')]);router['delete'](_0x5c3c('0x5c'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x5c3c('0x61')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x5c3c('0x6e')]);router[_0x5c3c('0x61')](_0x5c3c('0x6f'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x70')]);router[_0x5c3c('0x61')](_0x5c3c('0x37'),auth[_0x5c3c('0x8')](),controller[_0x5c3c('0x71')]);module[_0x5c3c('0x72')]=router; \ No newline at end of file +var _0x0d04=['server/files/images/','format','%s-%s','now','originalname','file','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/teams','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','changePassword','delete','/:id/queues','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','/:id/api_key','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/presence','getPresence','/:id','show','/:id/avatar','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','getApiKey','post','create','/create_many','bulkCreate','addQueues','diskStorage','root'];(function(_0x2398bf,_0x45694a){var _0x36961a=function(_0x25eff4){while(--_0x25eff4){_0x2398bf['push'](_0x2398bf['shift']());}};_0x36961a(++_0x45694a);}(_0x0d04,0x12a));var _0x40d0=function(_0x4fd71e,_0x3ec6d5){_0x4fd71e=_0x4fd71e-0x0;var _0x7cf1dc=_0x0d04[_0x4fd71e];return _0x7cf1dc;};'use strict';var multer=require(_0x40d0('0x0'));var util=require(_0x40d0('0x1'));var path=require(_0x40d0('0x2'));var timeout=require(_0x40d0('0x3'));var express=require(_0x40d0('0x4'));var router=express[_0x40d0('0x5')]();var fs_extra=require(_0x40d0('0x6'));var auth=require(_0x40d0('0x7'));var interaction=require(_0x40d0('0x8'));var config=require(_0x40d0('0x9'));var controller=require(_0x40d0('0xa'));router[_0x40d0('0xb')]('/',auth[_0x40d0('0xc')](),controller[_0x40d0('0xd')]);router[_0x40d0('0xb')](_0x40d0('0xe'),auth[_0x40d0('0xc')](),controller[_0x40d0('0xf')]);router[_0x40d0('0xb')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router['get'](_0x40d0('0x10'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x11')]);router['get'](_0x40d0('0x12'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x13')]);router[_0x40d0('0xb')](_0x40d0('0x14'),controller['getAvatar']);router[_0x40d0('0xb')]('/:id/open_tabs',auth[_0x40d0('0xc')](),controller['getOpenTabs']);router[_0x40d0('0xb')]('/:id/contacts',auth[_0x40d0('0xc')](),controller['getContacts']);router['get']('/:id/queues',auth[_0x40d0('0xc')](),controller[_0x40d0('0x15')]);router[_0x40d0('0xb')](_0x40d0('0x16'),auth['isAuthenticated'](),controller[_0x40d0('0x17')]);router[_0x40d0('0xb')](_0x40d0('0x18'),auth['isAuthenticated'](),controller['getGroups']);router[_0x40d0('0xb')](_0x40d0('0x19'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x1a')]);router[_0x40d0('0xb')](_0x40d0('0x1b'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x1c')]);router[_0x40d0('0xb')](_0x40d0('0x1d'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x1e')]);router[_0x40d0('0xb')](_0x40d0('0x1f'),auth[_0x40d0('0xc')](),controller['getOpenchannelInteractions']);router[_0x40d0('0xb')]('/:id/mail/interactions',auth[_0x40d0('0xc')](),controller[_0x40d0('0x20')]);router[_0x40d0('0xb')](_0x40d0('0x21'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x22')]);router[_0x40d0('0xb')](_0x40d0('0x23'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x24')]);router['get'](_0x40d0('0x25'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x26')]);router['get']('/:id/teams',auth[_0x40d0('0xc')](),controller[_0x40d0('0x27')]);router['get'](_0x40d0('0x28'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x29')]);router[_0x40d0('0xb')](_0x40d0('0x2a'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x2b')]);router[_0x40d0('0xb')](_0x40d0('0x2c'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x2d')]);router[_0x40d0('0xb')](_0x40d0('0x2e'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x2f')]);router[_0x40d0('0xb')](_0x40d0('0x30'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x31')]);router['get']('/:id/openchannel_accounts',auth[_0x40d0('0xc')](),controller[_0x40d0('0x32')]);router['get'](_0x40d0('0x33'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x34')]);router['get'](_0x40d0('0x35'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x36')]);router[_0x40d0('0xb')](_0x40d0('0x37'),auth['isAuthenticated'](),controller[_0x40d0('0x38')]);router['get'](_0x40d0('0x39'),auth['isAuthenticated'](),controller[_0x40d0('0x3a')]);router['get']('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x40d0('0x3b')]);router[_0x40d0('0xb')]('/:id/api_key',auth[_0x40d0('0xc')](),controller[_0x40d0('0x3c')]);router[_0x40d0('0x3d')]('/:id/contacts',auth[_0x40d0('0xc')](),controller['addContacts']);router[_0x40d0('0x3d')]('/',auth[_0x40d0('0xc')](),controller[_0x40d0('0x3e')]);router[_0x40d0('0x3d')](_0x40d0('0x3f'),auth['isAuthenticated'](),controller[_0x40d0('0x40')]);router[_0x40d0('0x3d')]('/:id/queues',auth[_0x40d0('0xc')](),controller[_0x40d0('0x41')]);var upload=multer({'storage':multer[_0x40d0('0x42')]({'destination':function(_0x517425,_0x399d5f,_0x41ad20){_0x41ad20(null,path['join'](config[_0x40d0('0x43')],_0x40d0('0x44')));},'filename':function(_0x1e510f,_0x5c2c67,_0x1c68cd){_0x1c68cd(null,util[_0x40d0('0x45')](_0x40d0('0x46'),Date[_0x40d0('0x47')](),_0x5c2c67[_0x40d0('0x48')]));}})});router[_0x40d0('0x3d')](_0x40d0('0x14'),upload['single'](_0x40d0('0x49')),controller['addAvatar']);router[_0x40d0('0x3d')](_0x40d0('0x4a'),auth[_0x40d0('0xc')](),controller['login']);router[_0x40d0('0x3d')](_0x40d0('0x4b'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x4c')]);router[_0x40d0('0x3d')](_0x40d0('0x4d'),auth['isAuthenticated'](),controller[_0x40d0('0x4e')]);router[_0x40d0('0x3d')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router[_0x40d0('0x3d')](_0x40d0('0x4f'),auth['isAuthenticated'](),controller[_0x40d0('0x50')]);router[_0x40d0('0x3d')]('/:id/chat_interactions',auth[_0x40d0('0xc')](),controller[_0x40d0('0x51')]);router[_0x40d0('0x3d')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x40d0('0x52')]);router[_0x40d0('0x3d')](_0x40d0('0x53'),auth['isAuthenticated'](),controller[_0x40d0('0x54')]);router[_0x40d0('0x3d')](_0x40d0('0x55'),auth['isAuthenticated'](),controller[_0x40d0('0x56')]);router['post']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x40d0('0x57')]);router[_0x40d0('0x3d')](_0x40d0('0x58'),auth['isAuthenticated'](),controller[_0x40d0('0x59')]);router[_0x40d0('0x3d')](_0x40d0('0x2e'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x5a')]);router['post'](_0x40d0('0x30'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x5b')]);router['post'](_0x40d0('0x5c'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x5d')]);router[_0x40d0('0x3d')](_0x40d0('0x33'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x5e')]);router['post'](_0x40d0('0x35'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x5f')]);router[_0x40d0('0x3d')]('/:id/whatsapp_accounts',auth[_0x40d0('0xc')](),controller[_0x40d0('0x60')]);router[_0x40d0('0x3d')](_0x40d0('0x39'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x61')]);router[_0x40d0('0x3d')]('/:id/api_key',auth[_0x40d0('0xc')](),controller[_0x40d0('0x62')]);router[_0x40d0('0x63')]('/:id',auth[_0x40d0('0xc')](),controller['update']);router[_0x40d0('0x63')](_0x40d0('0x64'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x65')]);router[_0x40d0('0x66')](_0x40d0('0x67'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x68')]);router[_0x40d0('0x66')]('/:id/teams',auth['isAuthenticated'](),controller[_0x40d0('0x69')]);router['delete'](_0x40d0('0x12'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x6a')]);router['delete'](_0x40d0('0x6b'),auth['isAuthenticated'](),controller[_0x40d0('0x6c')]);router[_0x40d0('0x66')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x40d0('0x66')](_0x40d0('0x53'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x6d')]);router[_0x40d0('0x66')](_0x40d0('0x55'),auth['isAuthenticated'](),controller[_0x40d0('0x6e')]);router[_0x40d0('0x66')](_0x40d0('0x6f'),auth['isAuthenticated'](),controller[_0x40d0('0x70')]);router[_0x40d0('0x66')](_0x40d0('0x58'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x71')]);router[_0x40d0('0x66')](_0x40d0('0x2e'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x72')]);router[_0x40d0('0x66')]('/:id/mail_accounts',auth[_0x40d0('0xc')](),controller['removeMailAccounts']);router[_0x40d0('0x66')](_0x40d0('0x5c'),auth[_0x40d0('0xc')](),controller['removeOpenchannelAccounts']);router[_0x40d0('0x66')](_0x40d0('0x33'),auth['isAuthenticated'](),controller[_0x40d0('0x73')]);router[_0x40d0('0x66')](_0x40d0('0x35'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x74')]);router['delete'](_0x40d0('0x37'),auth['isAuthenticated'](),controller[_0x40d0('0x75')]);router[_0x40d0('0x66')](_0x40d0('0x39'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x76')]);router[_0x40d0('0x66')](_0x40d0('0x77'),auth[_0x40d0('0xc')](),controller[_0x40d0('0x78')]);module[_0x40d0('0x79')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index ee0122f..1d7e8a3 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 _0x6808=['always','refuse','uas','fingerprint','certificate','active','passive','actpass','nonat','update','showWebBar','get','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','dtlscertfile','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','local','accountcode','getDataValue','BOOLEAN','DATE','INTEGER','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','yes','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>'];(function(_0x3cf18f,_0x196740){var _0x120721=function(_0x35a90c){while(--_0x35a90c){_0x3cf18f['push'](_0x3cf18f['shift']());}};_0x120721(++_0x196740);}(_0x6808,0xd1));var _0x8680=function(_0x4e1bd1,_0x13cb50){_0x4e1bd1=_0x4e1bd1-0x0;var _0x4bd326=_0x6808[_0x4e1bd1];return _0x4bd326;};'use strict';var Sequelize=require(_0x8680('0x0'));var moment=require(_0x8680('0x1'));var util=require(_0x8680('0x2'));var _=require(_0x8680('0x3'));module[_0x8680('0x4')]={'name':{'type':Sequelize[_0x8680('0x5')],'allowNull':![],'unique':_0x8680('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x37c702){this['setDataValue'](_0x8680('0x6'),_0x37c702);this[_0x8680('0x7')](_0x8680('0x8'),_0x37c702);},'comment':_0x8680('0x9')},'fullname':{'type':Sequelize[_0x8680('0x5')],'allowNull':![],'set':function(_0x5ea2c7){this[_0x8680('0x7')](_0x8680('0xa'),_0x5ea2c7);this['setDataValue']('callerid',util[_0x8680('0xb')](_0x8680('0xc'),_0x5ea2c7,this['getDataValue'](_0x8680('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3c1b07){if(_0x3c1b07){this[_0x8680('0x7')](_0x8680('0xe'),_0x3c1b07[_0x8680('0xf')]());}}},'role':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x11'),_0x8680('0x12'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x8680('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x8680('0x5')],'defaultValue':_0x8680('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x8680('0xd'),'set':function(_0x392b6b){this[_0x8680('0x7')](_0x8680('0xd'),_0x392b6b);this[_0x8680('0x7')](_0x8680('0x14'),_0x392b6b);this[_0x8680('0x7')]('callerid',util[_0x8680('0xb')]('\x22%s\x22\x20<%s>',this[_0x8680('0x15')]('fullname'),_0x392b6b));}},'salt':{'type':Sequelize[_0x8680('0x5')]},'phone':{'type':Sequelize[_0x8680('0x5')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x8680('0x5')]},'zipcode':{'type':Sequelize[_0x8680('0x5')]},'userpic':{'type':Sequelize[_0x8680('0x5')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x8680('0x17')]},'voicePause':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8680('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x8680('0x17')]},'chatCapacity':{'type':Sequelize[_0x8680('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x8680('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8680('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x8680('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x8680('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8680('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8680('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x8680('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x8680('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x8680('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x8680('0x19'),'user',_0x8680('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![],'defaultValue':_0x8680('0x1b')},'callingpres':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x1c'),_0x8680('0x1d'),_0x8680('0x1e'),_0x8680('0x1f'),_0x8680('0x20'),_0x8680('0x21'),_0x8680('0x22'),_0x8680('0x23')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![],'defaultValue':_0x8680('0x24'),'set':function(_0x3bd116){this['setDataValue']('transport',_0x3bd116?_0x3bd116[_0x8680('0x25')](','):null);},'get':function(){return this[_0x8680('0x15')](_0x8680('0x26'))?this[_0x8680('0x15')](_0x8680('0x26'))[_0x8680('0x27')](','):null;},'comment':_0x8680('0x28')},'dtmfmode':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x29'),_0x8680('0x2a'),'shortinfo',_0x8680('0x2b'),'auto'),'allowNull':!![],'defaultValue':_0x8680('0x29')},'directmedia':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no','nonat','update',_0x8680('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![],'defaultValue':_0x8680('0x2e'),'set':function(_0x5930b1){this[_0x8680('0x7')](_0x8680('0x2f'),_0x5930b1?_0x5930b1['join'](','):null);},'get':function(){return this['getDataValue'](_0x8680('0x2f'))?this[_0x8680('0x15')](_0x8680('0x2f'))[_0x8680('0x27')](','):null;},'comment':_0x8680('0x30')},'callgroup':{'type':Sequelize[_0x8680('0x5')]},'namedcallgroup':{'type':Sequelize[_0x8680('0x5')]},'pickupgroup':{'type':Sequelize[_0x8680('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x8680('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8680('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8680('0x32'),'set':function(_0x549cb1){this[_0x8680('0x7')]('allow',_0x549cb1?_0x549cb1[_0x8680('0x25')](';'):_0x8680('0x32'));},'get':function(){return this['getDataValue']('allow')?this[_0x8680('0x15')]('allow')[_0x8680('0x27')](';'):null;},'comment':_0x8680('0x33')},'autoframing':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![],'set':function(_0x5328a){this[_0x8680('0x7')](_0x8680('0x34'),_0x5328a?_0x5328a[_0x8680('0x25')](','):null);},'get':function(){return this[_0x8680('0x15')](_0x8680('0x34'))?this[_0x8680('0x15')](_0x8680('0x34'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8680('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no',_0x8680('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x8680('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![],'defaultValue':_0x8680('0x36')},'amaflags':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x8680('0x2c')},'busylevel':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no',_0x8680('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x8680('0x10')]('accept',_0x8680('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x8680('0x10')]('uac',_0x8680('0x39')),'allowNull':!![],'defaultValue':_0x8680('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x8680('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x8680('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x8680('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x8680('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x8680('0x10')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x8680('0x10')]('yes','no',_0x8680('0x3a'),_0x8680('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x8680('0x3c'),_0x8680('0x3d'),_0x8680('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x8680('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x8680('0x10')](_0x8680('0x2c'),'no',_0x8680('0x3f'),_0x8680('0x40'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8680('0x5')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x8680('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x8680('0x18')],'defaultValue':0x0,'set':function(_0x85cd8d){this[_0x8680('0x7')](_0x8680('0x41'),_0x85cd8d);var _0x3beabd=this[_0x8680('0x42')]({'plain':!![]});switch(_0x85cd8d){case 0x0:case 0x1:var _0x12197c=_0x3beabd[_0x8680('0x26')]?_['isArray'](_0x3beabd[_0x8680('0x26')])?_0x3beabd[_0x8680('0x26')][_0x8680('0x25')]():_0x3beabd[_0x8680('0x26')]:_0x8680('0x24');if(_0x12197c===_0x8680('0x43')){_0x12197c=_0x8680('0x24');}this['setDataValue']('transport',_0x12197c);this['setDataValue'](_0x8680('0x44'),'no');this[_0x8680('0x7')](_0x8680('0x45'),null);this[_0x8680('0x7')](_0x8680('0x46'),null);this[_0x8680('0x7')]('icesupport',null);this[_0x8680('0x7')](_0x8680('0x47'),null);this[_0x8680('0x7')](_0x8680('0x48'),null);this[_0x8680('0x7')](_0x8680('0x49'),null);this[_0x8680('0x7')]('dtlscertfile',null);this[_0x8680('0x7')](_0x8680('0x4a'),null);this[_0x8680('0x7')](_0x8680('0x4b'),'no');break;case 0x2:this['setDataValue'](_0x8680('0x26'),_0x8680('0x43'));this[_0x8680('0x7')](_0x8680('0x44'),_0x8680('0x2c'));this[_0x8680('0x7')](_0x8680('0x45'),_0x8680('0x2c'));this[_0x8680('0x7')](_0x8680('0x46'),_0x8680('0x2c'));this[_0x8680('0x7')]('icesupport',_0x8680('0x2c'));this[_0x8680('0x7')](_0x8680('0x47'),_0x8680('0x2c'));this['setDataValue']('dtlsverify','no');this[_0x8680('0x7')](_0x8680('0x49'),_0x8680('0x3e'));this[_0x8680('0x7')](_0x8680('0x4c'),_0x3beabd['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x8680('0x7')]('dtlsprivatekey',_0x3beabd['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this['setDataValue']('rtcp_mux',_0x8680('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x4d07bb){this[_0x8680('0x7')](_0x8680('0x4d'),_0x4d07bb?_0x4d07bb[_0x8680('0x25')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x8680('0x4e')](this['getDataValue'](_0x8680('0x4d'))[_0x8680('0x27')](','),function(_0x1d1d85){return parseInt(_0x1d1d85,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x8680('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8680('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x8680('0x5')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8680('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x8680('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8680('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x8680('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8680('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8680('0x15')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x8680('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x8680('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8680('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![],'set':function(_0x27cf09){if(typeof _0x27cf09===_0x8680('0x50')){var _0x4a5030=_0x27cf09==='1'?!![]:_0x27cf09==='0'?![]:_0x27cf09===_0x8680('0x51')?!![]:_0x27cf09===_0x8680('0x52')?![]:![];this[_0x8680('0x7')](_0x8680('0x53'),_0x4a5030);}else{this['setDataValue'](_0x8680('0x53'),_0x27cf09);}}},'blocked':{'type':Sequelize[_0x8680('0x16')],'defaultValue':![],'set':function(_0x582e3d){this['setDataValue'](_0x8680('0x54'),_0x582e3d);if(_0x582e3d===!![]){this[_0x8680('0x7')](_0x8680('0x55'),moment());this[_0x8680('0x7')](_0x8680('0x56'),0x0);}else{this['setDataValue'](_0x8680('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x8680('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x8680('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x8680('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8680('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe700=['accept','originate','uac','uas','certificate','passive','TEXT','showWebBar','isArray','wss','encryption','avpf','force_avp','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','INTEGER','DATE','BOOLEAN','DEFAULT\x20PAUSE','friend','user','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','join','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xe700,0x75));var _0x0e70=function(_0x1a207c,_0x4dd6b2){_0x1a207c=_0x1a207c-0x0;var _0x103630=_0xe700[_0x1a207c];return _0x103630;};'use strict';var Sequelize=require(_0x0e70('0x0'));var moment=require(_0x0e70('0x1'));var util=require(_0x0e70('0x2'));var _=require(_0x0e70('0x3'));module[_0x0e70('0x4')]={'name':{'type':Sequelize[_0x0e70('0x5')],'allowNull':![],'unique':_0x0e70('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x34f087){this[_0x0e70('0x7')](_0x0e70('0x6'),_0x34f087);this['setDataValue'](_0x0e70('0x8'),_0x34f087);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0e70('0x5')],'allowNull':![],'set':function(_0x30303a){this[_0x0e70('0x7')](_0x0e70('0x9'),_0x30303a);this[_0x0e70('0x7')](_0x0e70('0xa'),util[_0x0e70('0xb')](_0x0e70('0xc'),_0x30303a,this[_0x0e70('0xd')](_0x0e70('0xe'))));}},'alias':{'type':Sequelize[_0x0e70('0x5')]},'email':{'type':Sequelize[_0x0e70('0x5')],'allowNull':![],'unique':_0x0e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x1accbb){if(_0x1accbb){this[_0x0e70('0x7')]('email',_0x1accbb[_0x0e70('0x10')]());}}},'role':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x12'),'user',_0x0e70('0x13'),_0x0e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x0e70('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0e70('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':![],'unique':_0x0e70('0xe'),'set':function(_0x30660e){this['setDataValue']('internal',_0x30660e);this[_0x0e70('0x7')]('accountcode',_0x30660e);this[_0x0e70('0x7')](_0x0e70('0xa'),util[_0x0e70('0xb')](_0x0e70('0xc'),this['getDataValue'](_0x0e70('0x9')),_0x30660e));}},'salt':{'type':Sequelize[_0x0e70('0x5')]},'phone':{'type':Sequelize[_0x0e70('0x5')]},'mobile':{'type':Sequelize[_0x0e70('0x5')]},'address':{'type':Sequelize[_0x0e70('0x5')]},'zipcode':{'type':Sequelize[_0x0e70('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x0e70('0x5')]},'country':{'type':Sequelize[_0x0e70('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0e70('0x16')]},'voicePause':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x0e70('0x18')},'lastPauseAt':{'type':Sequelize[_0x0e70('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0e70('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0e70('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0e70('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0e70('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0e70('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0e70('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0e70('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0e70('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x0e70('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x19'),_0x0e70('0x1a'),_0x0e70('0x1b')),'allowNull':!![],'defaultValue':_0x0e70('0x19')},'context':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![],'defaultValue':_0x0e70('0x1c')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x0e70('0x1d'),_0x0e70('0x1e'),'ALLOWED','PROHIB_NOT_SCREENED',_0x0e70('0x1f'),_0x0e70('0x20'),_0x0e70('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![],'defaultValue':_0x0e70('0x22'),'set':function(_0x25a33c){this[_0x0e70('0x7')]('transport',_0x25a33c?_0x25a33c['join'](','):null);},'get':function(){return this[_0x0e70('0xd')](_0x0e70('0x23'))?this[_0x0e70('0xd')](_0x0e70('0x23'))['split'](','):null;},'comment':_0x0e70('0x24')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0e70('0x25'),_0x0e70('0x26'),'shortinfo',_0x0e70('0x27'),_0x0e70('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no',_0x0e70('0x2a'),_0x0e70('0x2b'),_0x0e70('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![],'defaultValue':_0x0e70('0x2d'),'set':function(_0x5cb77d){this[_0x0e70('0x7')](_0x0e70('0x2e'),_0x5cb77d?_0x5cb77d['join'](','):null);},'get':function(){return this[_0x0e70('0xd')]('nat')?this['getDataValue'](_0x0e70('0x2e'))['split'](','):null;},'comment':_0x0e70('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0e70('0x5')]},'pickupgroup':{'type':Sequelize[_0x0e70('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x0e70('0x5')]},'language':{'type':Sequelize[_0x0e70('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0e70('0x5')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0e70('0x30')},'allow':{'type':Sequelize[_0x0e70('0x5')],'allowNull':![],'defaultValue':_0x0e70('0x31'),'set':function(_0x4823b3){this['setDataValue']('allow',_0x4823b3?_0x4823b3['join'](';'):_0x0e70('0x31'));},'get':function(){return this[_0x0e70('0xd')](_0x0e70('0x32'))?this[_0x0e70('0xd')](_0x0e70('0x32'))[_0x0e70('0x33')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x0e70('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![],'set':function(_0x13f774){this[_0x0e70('0x7')]('insecure',_0x13f774?_0x13f774[_0x0e70('0x34')](','):null);},'get':function(){return this[_0x0e70('0xd')](_0x0e70('0x35'))?this[_0x0e70('0xd')](_0x0e70('0x35'))[_0x0e70('0x33')](','):null;},'comment':_0x0e70('0x36')},'trustrpid':{'type':Sequelize['ENUM'](_0x0e70('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0e70('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no',_0x0e70('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0e70('0x11')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0e70('0x11')]('yes','no'),'allowNull':!![],'defaultValue':_0x0e70('0x29')},'busylevel':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no',_0x0e70('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x39'),'refuse',_0x0e70('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x3b'),_0x0e70('0x3c')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0e70('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0e70('0x11')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no','fingerprint',_0x0e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0e70('0x11')]('active',_0x0e70('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0e70('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0e70('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x0e70('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no','nonat',_0x0e70('0x2b'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0e70('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x0e70('0x16')]},'passwordResetAt':{'type':Sequelize[_0x0e70('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0e70('0x3f')]},'showWebBar':{'type':Sequelize[_0x0e70('0x15')],'defaultValue':0x0,'set':function(_0x546ada){this[_0x0e70('0x7')](_0x0e70('0x40'),_0x546ada);var _0x45f3c9=this['get']({'plain':!![]});switch(_0x546ada){case 0x0:case 0x1:var _0x4f17d2=_0x45f3c9[_0x0e70('0x23')]?_[_0x0e70('0x41')](_0x45f3c9['transport'])?_0x45f3c9[_0x0e70('0x23')][_0x0e70('0x34')]():_0x45f3c9[_0x0e70('0x23')]:_0x0e70('0x22');if(_0x4f17d2===_0x0e70('0x42')){_0x4f17d2=_0x0e70('0x22');}this['setDataValue'](_0x0e70('0x23'),_0x4f17d2);this[_0x0e70('0x7')](_0x0e70('0x43'),'no');this[_0x0e70('0x7')](_0x0e70('0x44'),null);this[_0x0e70('0x7')](_0x0e70('0x45'),null);this[_0x0e70('0x7')]('icesupport',null);this[_0x0e70('0x7')]('dtlsenable',null);this[_0x0e70('0x7')](_0x0e70('0x46'),null);this[_0x0e70('0x7')]('dtlssetup',null);this['setDataValue'](_0x0e70('0x47'),null);this[_0x0e70('0x7')](_0x0e70('0x48'),null);this[_0x0e70('0x7')](_0x0e70('0x49'),'no');break;case 0x2:this[_0x0e70('0x7')](_0x0e70('0x23'),_0x0e70('0x42'));this['setDataValue'](_0x0e70('0x43'),_0x0e70('0x29'));this[_0x0e70('0x7')](_0x0e70('0x44'),_0x0e70('0x29'));this[_0x0e70('0x7')](_0x0e70('0x45'),_0x0e70('0x29'));this[_0x0e70('0x7')]('icesupport','yes');this[_0x0e70('0x7')](_0x0e70('0x4a'),'yes');this[_0x0e70('0x7')]('dtlsverify','no');this[_0x0e70('0x7')](_0x0e70('0x4b'),_0x0e70('0x4c'));this['setDataValue']('dtlscertfile',_0x45f3c9[_0x0e70('0x47')]||_0x0e70('0x4d'));this[_0x0e70('0x7')]('dtlsprivatekey',_0x45f3c9[_0x0e70('0x48')]||_0x0e70('0x4e'));this[_0x0e70('0x7')](_0x0e70('0x49'),_0x0e70('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0x0e70('0x3f')],'set':function(_0x36443d){this['setDataValue'](_0x0e70('0x4f'),_0x36443d?_0x36443d[_0x0e70('0x34')](','):[]);},'get':function(){return this[_0x0e70('0xd')](_0x0e70('0x4f'))?_['map'](this[_0x0e70('0xd')]('permissions')[_0x0e70('0x33')](','),function(_0x316438){return parseInt(_0x316438,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0e70('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0e70('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0e70('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0e70('0x11')](_0x0e70('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0e70('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0e70('0xd')](_0x0e70('0x50'))?this[_0x0e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0e70('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0e70('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![],'set':function(_0x14856d){if(typeof _0x14856d===_0x0e70('0x51')){var _0x354a36=_0x14856d==='1'?!![]:_0x14856d==='0'?![]:_0x14856d==='true'?!![]:_0x14856d===_0x0e70('0x52')?![]:![];this[_0x0e70('0x7')](_0x0e70('0x53'),_0x354a36);}else{this[_0x0e70('0x7')](_0x0e70('0x53'),_0x14856d);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4ce267){this['setDataValue'](_0x0e70('0x54'),_0x4ce267);if(_0x4ce267===!![]){this['setDataValue'](_0x0e70('0x55'),moment());this[_0x0e70('0x7')](_0x0e70('0x56'),0x0);}else{this[_0x0e70('0x7')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x0e70('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0e70('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0e70('0x17')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 304dda2..7721305 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 _0x5f2f=['Sms','Openchannel','removeAgent','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','spread','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$like','$notLike','$iLike','$contained','$any','firstName','lastName','CmContact','Contact','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyIat','whoami','resolve','teams','queues','inbound','lower','col','desc','asc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','ringing','voiceStatus','slice','ui.','ui.createdAt','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./user.socket','register','defaults','localhost','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','user','agent','Telephones','telephone','filter','ignore','map','value','includes','role','find','name','stack','index','User','rawAttributes','type','key','password','salt','getOptions','where','query','includeAll','attributes','openTabs','true','rows','length','push','chat','dataValues','sms','mail','openchannel','whatsapp','all','model','differenceBy','filters','intersection','fields','include','merge','body','params','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','permissions','102','103','113','110','104','107','108','109','100','115','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','create','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','checkUserLimits','each','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','emit','Queue:save','voice','VoiceQueue','findAll','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','QueueId','Queue:remove','addAvatar','userpic','filename','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','fax','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','getContacts','keys','order','sort','pick','options','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Unknown\x20channel','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','FaxInteraction','getWhatsappInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','getChannels','YYYY-MM-DD\x20HH:mm:ss','forEach','device','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','getTeams','Team','addTeams','setDataValue','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams'];(function(_0x3bab93,_0x2e127e){var _0x236edf=function(_0x241f0b){while(--_0x241f0b){_0x3bab93['push'](_0x3bab93['shift']());}};_0x236edf(++_0x2e127e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32eb3d,_0x1b22aa){_0x32eb3d=_0x32eb3d-0x0;var _0x2ca79b=_0x5f2f[_0x32eb3d];return _0x2ca79b;};'use strict';var moment=require(_0xf5f2('0x0'));var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var fs=require('fs');var _=require(_0xf5f2('0x4'));var squel=require(_0xf5f2('0x5'));var jayson=require(_0xf5f2('0x6'));var Redis=require(_0xf5f2('0x7'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require(_0xf5f2('0x8'))(_0xf5f2('0x9'));var utils=require(_0xf5f2('0xa'));var config=require(_0xf5f2('0xb'));var licenseUtil=require(_0xf5f2('0xc'));var db=require(_0xf5f2('0xd'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0xe')]));require(_0xf5f2('0xf'))[_0xf5f2('0x10')](socket);config['redis']=_[_0xf5f2('0x11')](config[_0xf5f2('0xe')],{'host':_0xf5f2('0x12'),'port':0x18eb});var client=jayson['client'][_0xf5f2('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4ebbbe,_0x53fb33,_0xa7e1a6,_0x151aba){return new BPromise(function(_0x4b78cd,_0x336f6b){var _0x14b51f=_0x151aba||client;return _0x14b51f[_0xf5f2('0x14')](_0x4ebbbe,_0xa7e1a6)[_0xf5f2('0x15')](function(_0x59bb6c){logger[_0xf5f2('0x16')]('User,\x20%s,\x20%s',_0x53fb33,_0xf5f2('0x17'));logger[_0xf5f2('0x18')](_0xf5f2('0x19'),_0x53fb33,_0xf5f2('0x17'),JSON[_0xf5f2('0x1a')](_0x59bb6c));if(_0x59bb6c['error']){if(_0x59bb6c[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===0x1f4){logger[_0xf5f2('0x1b')](_0xf5f2('0x1d'),_0x53fb33,_0x59bb6c[_0xf5f2('0x1b')][_0xf5f2('0x1e')]);return _0x336f6b(_0x59bb6c[_0xf5f2('0x1b')][_0xf5f2('0x1e')]);}logger[_0xf5f2('0x1b')](_0xf5f2('0x1d'),_0x53fb33,_0x59bb6c[_0xf5f2('0x1b')][_0xf5f2('0x1e')]);return _0x4b78cd(_0x59bb6c[_0xf5f2('0x1b')][_0xf5f2('0x1e')]);}else{logger[_0xf5f2('0x16')](_0xf5f2('0x1d'),_0x53fb33,_0xf5f2('0x17'));_0x4b78cd(_0x59bb6c['result'][_0xf5f2('0x1e')]);}})[_0xf5f2('0x1f')](function(_0x49dac2){logger['error'](_0xf5f2('0x1d'),_0x53fb33,_0x49dac2);_0x336f6b(_0x49dac2);});});}function respondWithStatusCode(_0x388e6c,_0x4ae323){_0x4ae323=_0x4ae323||0xcc;return function(_0x45b74f){if(_0x45b74f){return _0x388e6c[_0xf5f2('0x20')](_0x4ae323);}return _0x388e6c[_0xf5f2('0x21')](_0x4ae323)[_0xf5f2('0x22')]();};}function respondWithResult(_0x36f1cb,_0x4c691a){_0x4c691a=_0x4c691a||0xc8;return function(_0x21cd91){if(_0x21cd91){return _0x36f1cb[_0xf5f2('0x21')](_0x4c691a)[_0xf5f2('0x23')](_0x21cd91);}};}function respondWithFilteredResult(_0x2833fe,_0x287ad5){return function(_0x5bdf4a){if(_0x5bdf4a){var _0x529f07=typeof _0x287ad5[_0xf5f2('0x24')]===_0xf5f2('0x25')&&typeof _0x287ad5[_0xf5f2('0x26')]===_0xf5f2('0x25');var _0xf6c58d=_0x5bdf4a[_0xf5f2('0x27')];var _0x13a3be=_0x529f07?0x0:_0x287ad5[_0xf5f2('0x24')];var _0x294414=_0x529f07?_0x5bdf4a['count']:_0x287ad5[_0xf5f2('0x24')]+_0x287ad5[_0xf5f2('0x26')];var _0x375ca8;if(_0x294414>=_0xf6c58d){_0x294414=_0xf6c58d;_0x375ca8=0xc8;}else{_0x375ca8=0xce;}_0x2833fe[_0xf5f2('0x21')](_0x375ca8);return _0x2833fe[_0xf5f2('0x28')](_0xf5f2('0x29'),_0x13a3be+'-'+_0x294414+'/'+_0xf6c58d)['json'](_0x5bdf4a);}return null;};}function saveUpdates(_0x53cb96){return function(_0x22c826){if(_0x22c826){return _0x22c826[_0xf5f2('0x2a')](_0x53cb96)[_0xf5f2('0x15')](function(_0x5027ab){return _0x5027ab;});}return null;};}function removeEntity(_0x5a2c7e){return function(_0x29571b){if(_0x29571b){return _0x29571b[_0xf5f2('0x2b')]()[_0xf5f2('0x15')](function(){var _0x153924=_0x29571b[_0xf5f2('0x2c')]({'plain':!![]});if(_0x153924['role']==='admin')return;var _0x2f4778=[{'name':'Users','value':_0xf5f2('0x2d'),'ignore':!![]},{'name':'Agents','value':_0xf5f2('0x2e'),'ignore':![]},{'name':_0xf5f2('0x2f'),'value':_0xf5f2('0x30'),'ignore':![]}];var _0x428770=_(_0x2f4778)[_0xf5f2('0x31')](_0xf5f2('0x32'))[_0xf5f2('0x33')](_0xf5f2('0x34'))['value']();if(_[_0xf5f2('0x35')](_0x428770,_0x153924[_0xf5f2('0x36')])){return;}var _0x4590ec=_[_0xf5f2('0x37')](_0x2f4778,[_0xf5f2('0x34'),_0x153924[_0xf5f2('0x36')]])[_0xf5f2('0x38')];return db['UserProfileResource'][_0xf5f2('0x2b')]({'where':{'type':_0x4590ec,'resourceId':_0x153924['id']}})[_0xf5f2('0x15')](function(){return _0x29571b;});})['then'](function(){_0x5a2c7e[_0xf5f2('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18ae07){return function(_0x3930fb){if(!_0x3930fb){_0x18ae07[_0xf5f2('0x20')](0x194);}return _0x3930fb;};}function handleError(_0x2e3cca,_0x59a6dd){_0x59a6dd=_0x59a6dd||0x1f4;return function(_0x5a98d7){logger[_0xf5f2('0x1b')](_0x5a98d7[_0xf5f2('0x39')]);if(_0x5a98d7[_0xf5f2('0x38')]){delete _0x5a98d7['name'];}_0x2e3cca[_0xf5f2('0x21')](_0x59a6dd)['send'](_0x5a98d7);};}exports[_0xf5f2('0x3a')]=function(_0x566c47,_0x46f464){var _0x456764={},_0x5337a6={'count':0x0,'rows':[]};var _0x29694f=_(db[_0xf5f2('0x3b')][_0xf5f2('0x3c')])[_0xf5f2('0x33')](function(_0x542cd6){return{'name':_0x542cd6['fieldName'],'type':_0x542cd6[_0xf5f2('0x3d')][_0xf5f2('0x3e')]};})[_0xf5f2('0x31')](function(_0x2d4400){return!_[_0xf5f2('0x35')]([_0xf5f2('0x3f'),_0xf5f2('0x40')],_0x2d4400['name']);})[_0xf5f2('0x34')]();_0x456764=qs[_0xf5f2('0x41')](_0x29694f,_0x566c47);var _0x536501={'where':_0x456764[_0xf5f2('0x42')]};return db[_0xf5f2('0x3b')][_0xf5f2('0x27')](_0x536501)[_0xf5f2('0x15')](function(_0xd10701){_0x5337a6[_0xf5f2('0x27')]=_0xd10701;if(_0x566c47[_0xf5f2('0x43')][_0xf5f2('0x44')]){_0x456764['include']=[{'all':!![]}];}if(!_[_0xf5f2('0x35')](_0x456764[_0xf5f2('0x45')],'id')){_0x456764[_0xf5f2('0x45')]['push']('id');}return db['User']['findAll'](_0x456764);})[_0xf5f2('0x15')](function(_0x2ad13c){_0x5337a6['rows']=_0x2ad13c;if(_0x566c47[_0xf5f2('0x43')][_0xf5f2('0x46')]===_0xf5f2('0x47')){var _0x31f86c=[];for(var _0x354c34=0x0;_0x354c34<_0x5337a6[_0xf5f2('0x48')][_0xf5f2('0x49')];_0x354c34++){_0x31f86c[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x4b'),_0x5337a6[_0xf5f2('0x48')][_0x354c34][_0xf5f2('0x4c')]));_0x31f86c[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x4d'),_0x5337a6[_0xf5f2('0x48')][_0x354c34]['dataValues']));_0x31f86c[_0xf5f2('0x4a')](get_open_tabs('fax',_0x5337a6[_0xf5f2('0x48')][_0x354c34][_0xf5f2('0x4c')]));_0x31f86c[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x4e'),_0x5337a6[_0xf5f2('0x48')][_0x354c34][_0xf5f2('0x4c')]));_0x31f86c['push'](get_open_tabs(_0xf5f2('0x4f'),_0x5337a6[_0xf5f2('0x48')][_0x354c34][_0xf5f2('0x4c')]));_0x31f86c[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x50'),_0x5337a6[_0xf5f2('0x48')][_0x354c34][_0xf5f2('0x4c')]));}return BPromise[_0xf5f2('0x51')](_0x31f86c)['then'](function(_0x35dece){return _0x5337a6;});}else{return _0x5337a6;}})[_0xf5f2('0x15')](respondWithFilteredResult(_0x46f464,_0x456764))[_0xf5f2('0x1f')](handleError(_0x46f464,null));};exports['show']=function(_0x1177ba,_0xc91b64){var _0x3179a9={'raw':![],'where':{'id':_0x1177ba['params']['id']}},_0x5e761c={};_0x5e761c[_0xf5f2('0x52')]=_[_0xf5f2('0x53')](_['keys'](db[_0xf5f2('0x3b')]['rawAttributes']),[_0xf5f2('0x3f'),'salt']);_0x5e761c[_0xf5f2('0x43')]=_['keys'](_0x1177ba[_0xf5f2('0x43')]);_0x5e761c[_0xf5f2('0x54')]=_[_0xf5f2('0x55')](_0x5e761c[_0xf5f2('0x52')],_0x5e761c['query']);_0x3179a9[_0xf5f2('0x45')]=_[_0xf5f2('0x55')](_0x5e761c['model'],qs['fields'](_0x1177ba[_0xf5f2('0x43')][_0xf5f2('0x56')]));_0x3179a9['attributes']=_0x3179a9[_0xf5f2('0x45')][_0xf5f2('0x49')]?_0x3179a9[_0xf5f2('0x45')]:_0x5e761c[_0xf5f2('0x52')];if(_0x1177ba['query']['includeAll']){_0x3179a9[_0xf5f2('0x57')]=[{'all':!![]}];}_0x3179a9=_[_0xf5f2('0x58')]({},_0x3179a9,_0x1177ba['options']);if(!_[_0xf5f2('0x35')](_0x3179a9[_0xf5f2('0x45')],'id')){_0x3179a9[_0xf5f2('0x45')][_0xf5f2('0x4a')]('id');}return db[_0xf5f2('0x3b')][_0xf5f2('0x37')](_0x3179a9)[_0xf5f2('0x15')](handleEntityNotFound(_0xc91b64,null))['then'](function(_0x59e8ef){var _0x330730=[];values=_0x59e8ef;if(_0x1177ba[_0xf5f2('0x43')][_0xf5f2('0x46')]===_0xf5f2('0x47')){_0x330730[_0xf5f2('0x4a')](get_open_tabs('chat',_0x59e8ef[_0xf5f2('0x4c')]));_0x330730[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x4d'),_0x59e8ef['dataValues']));_0x330730[_0xf5f2('0x4a')](get_open_tabs('openchannel',_0x59e8ef[_0xf5f2('0x4c')]));_0x330730[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x50'),_0x59e8ef[_0xf5f2('0x4c')]));_0x330730['push'](get_open_tabs('fax',_0x59e8ef[_0xf5f2('0x4c')]));_0x330730['push'](get_open_tabs(_0xf5f2('0x4e'),_0x59e8ef[_0xf5f2('0x4c')]));return BPromise['all'](_0x330730);}else{return values;}})[_0xf5f2('0x15')](function(_0xa4c0be){return values;})[_0xf5f2('0x15')](respondWithResult(_0xc91b64,null))['catch'](handleError(_0xc91b64,null));};exports[_0xf5f2('0x2a')]=function(_0xcf7a50,_0x42cc27){if(_0xcf7a50[_0xf5f2('0x59')]['id']){delete _0xcf7a50['body']['id'];}delete _0xcf7a50[_0xf5f2('0x59')]['role'];return db[_0xf5f2('0x3b')][_0xf5f2('0x37')]({'where':{'id':_0xcf7a50[_0xf5f2('0x5a')]['id']}})[_0xf5f2('0x15')](handleEntityNotFound(_0x42cc27,null))[_0xf5f2('0x15')](saveUpdates(_0xcf7a50['body'],null))[_0xf5f2('0x15')](respondWithResult(_0x42cc27,null))[_0xf5f2('0x1f')](handleError(_0x42cc27,null));};exports[_0xf5f2('0x5b')]=function(_0x212639,_0x2c5733){return db['User'][_0xf5f2('0x5b')]()['then'](respondWithResult(_0x2c5733,null))['catch'](handleError(_0x2c5733,null));};exports[_0xf5f2('0x5c')]=function(_0x4802c5,_0x10f2b8){return db[_0xf5f2('0x3b')][_0xf5f2('0x37')]({'where':{'id':_0x4802c5[_0xf5f2('0x5a')]['id']}})['then'](handleEntityNotFound(_0x10f2b8,null))[_0xf5f2('0x15')](function(_0x3a53f2){if(_0x3a53f2){return _0x3a53f2[_0xf5f2('0x5c')](_0x4802c5[_0xf5f2('0x59')][_0xf5f2('0x5d')],_[_0xf5f2('0x5e')](_0x4802c5[_0xf5f2('0x59')],['ids','id'])||{});}})[_0xf5f2('0x15')](respondWithResult(_0x10f2b8,null))[_0xf5f2('0x1f')](handleError(_0x10f2b8,null));};function validateUser(_0xb39a6e){return new BPromise(function(_0x45c7c1,_0x5a5b2b){if(_0xb39a6e[_0xf5f2('0x5f')])return _0x45c7c1(_0xb39a6e);return db['Setting'][_0xf5f2('0x60')](0x1)[_0xf5f2('0x15')](function(_0x5588cf){if(_0x5588cf[_0xf5f2('0x61')])authService[_0xf5f2('0x62')](_0xb39a6e[_0xf5f2('0x3f')]);db[_0xf5f2('0x3b')][_0xf5f2('0x63')]('internal')[_0xf5f2('0x15')](function(_0x21c107){if(_[_0xf5f2('0x64')](_0x21c107)){_0xb39a6e[_0xf5f2('0x5f')]=_0x5588cf[_0xf5f2('0x65')]||0x1;return;}if(_[_0xf5f2('0x64')](_0x5588cf['min_internal'])||_0x5588cf[_0xf5f2('0x65')]===_0x21c107){_0xb39a6e[_0xf5f2('0x5f')]=_0x21c107+0x1;return;}if(_0x5588cf['min_internal']>_0x21c107){_0xb39a6e[_0xf5f2('0x5f')]=_0x5588cf[_0xf5f2('0x65')];return;}return db[_0xf5f2('0x66')]['query']('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['sequelize'][_0xf5f2('0x67')][_0xf5f2('0x68')]})[_0xf5f2('0x15')](function(_0x450691){if(_0x450691&&_0x450691[_0xf5f2('0x49')]){for(var _0x4d878e=0x0,_0x278b76=_0x450691[_0xf5f2('0x49')];_0x4d878e<_0x278b76&&_[_0xf5f2('0x64')](_0xb39a6e[_0xf5f2('0x5f')]);_0x4d878e++){if(_0x5588cf[_0xf5f2('0x65')]<=_0x450691[_0x4d878e][_0xf5f2('0x69')]){_0xb39a6e[_0xf5f2('0x5f')]=_0x450691[_0x4d878e][_0xf5f2('0x69')];}else if(_0x5588cf[_0xf5f2('0x65')]>_0x450691[_0x4d878e][_0xf5f2('0x69')]&&_0x5588cf[_0xf5f2('0x65')]<=_0x450691[_0x4d878e]['to']){_0xb39a6e['internal']=_0x5588cf['min_internal'];}}}if(_['isNil'](_0xb39a6e[_0xf5f2('0x5f')])){_0xb39a6e[_0xf5f2('0x5f')]=_0x21c107+0x1;}return _0x45c7c1(_0xb39a6e);});});})[_0xf5f2('0x1f')](function(_0x878e8b){_0x5a5b2b(_0x878e8b);});});}function updateUser(_0x1bb752){return new BPromise(function(_0x5c6959,_0x9d943f){try{if(_0x1bb752[_0xf5f2('0x6a')]){_0x1bb752[_0xf5f2('0x6b')]=_0x1bb752[_0xf5f2('0x5f')];_0x1bb752[_0xf5f2('0x6c')]={'mailbox':_0x1bb752['internal'],'password':_0x1bb752[_0xf5f2('0x3f')],'fullname':_0x1bb752[_0xf5f2('0x6d')],'email':_0x1bb752['email']};}if(_0x1bb752[_0xf5f2('0x36')]===_0xf5f2('0x2e')){if(!_0x1bb752[_0xf5f2('0x6e')])_0x1bb752[_0xf5f2('0x6e')]=['101',_0xf5f2('0x6f'),_0xf5f2('0x70'),_0xf5f2('0x71'),_0xf5f2('0x72'),_0xf5f2('0x73'),'105','106',_0xf5f2('0x74'),_0xf5f2('0x75'),_0xf5f2('0x76'),_0xf5f2('0x77'),'111','114',_0xf5f2('0x78')];}_0x5c6959(_0x1bb752);}catch(_0x4f2fcc){_0x9d943f(_0x4f2fcc);}});}exports['create']=function(_0x4c899a,_0x57cb18){if(_0x4c899a[_0xf5f2('0x2d')][_0xf5f2('0x36')]===_0xf5f2('0x2e'))throw new Error(_0xf5f2('0x79'));if(_0x4c899a[_0xf5f2('0x59')][_0xf5f2('0x36')]===_0xf5f2('0x2d')&&_0x4c899a[_0xf5f2('0x2d')][_0xf5f2('0x36')]!==_0xf5f2('0x7a')){throw new Error(_0xf5f2('0x7b'));}if(_0x4c899a[_0xf5f2('0x59')][_0xf5f2('0x36')]===_0xf5f2('0x7a')&&_0x4c899a[_0xf5f2('0x2d')][_0xf5f2('0x36')]!==_0xf5f2('0x7a')){throw new Error(_0xf5f2('0x7c'));}return licenseUtil['checkUserLimits']([_0x4c899a[_0xf5f2('0x59')]])[_0xf5f2('0x15')](function(){return validateUser(_0x4c899a[_0xf5f2('0x59')]);})[_0xf5f2('0x15')](function(_0x18c353){return updateUser(_0x18c353)[_0xf5f2('0x15')](function(_0x16491c){if(_0x16491c[_0xf5f2('0x36')]==='admin'){_0x16491c[_0xf5f2('0x7d')]=_0x4c899a['user']['settingsEnabled'];delete _0x16491c['userProfileId'];}return _0x16491c;});})['then'](function(_0x50befc){return db['User'][_0xf5f2('0x7e')](_0x50befc,{'include':[{'model':db[_0xf5f2('0x6c')],'as':_0xf5f2('0x6c')}]});})[_0xf5f2('0x15')](function(_0x145d4d){if(_0x4c899a[_0xf5f2('0x59')]['role']==='user')return _0x145d4d;if(_0x4c899a[_0xf5f2('0x2d')]['role']!==_0xf5f2('0x2d'))return _0x145d4d;return db[_0xf5f2('0x7f')]['find']({'where':{'name':_0x145d4d['role']===_0xf5f2('0x2e')?_0xf5f2('0x80'):'Telephones','userProfileId':_0x4c899a[_0xf5f2('0x2d')][_0xf5f2('0x81')]},'raw':!![]})['then'](function(_0x1774ab){if(!_0x1774ab||_0x1774ab[_0xf5f2('0x82')]!=0x0)return _0x145d4d;return db[_0xf5f2('0x83')]['create']({'name':_0x145d4d[_0xf5f2('0x38')],'resourceId':_0x145d4d['id'],'type':_0x1774ab[_0xf5f2('0x38')],'sectionId':_0x1774ab['id']},{})[_0xf5f2('0x15')](function(){return _0x145d4d;});})[_0xf5f2('0x1f')](function(_0x3e188e){logger[_0xf5f2('0x1b')](_0xf5f2('0x84'),_0x3e188e);throw _0x3e188e;});})[_0xf5f2('0x15')](respondWithResult(_0x57cb18,0xc9))[_0xf5f2('0x1f')](handleError(_0x57cb18,null));};exports[_0xf5f2('0x85')]=function(_0x191af3,_0x2601aa){var _0x6f9240=_0x191af3[_0xf5f2('0x59')];var _0xe900ea=[];if(_0x191af3[_0xf5f2('0x2d')][_0xf5f2('0x36')]===_0xf5f2('0x2e'))throw new Error(_0xf5f2('0x79'));if(_[_0xf5f2('0x86')](_0x6f9240,[_0xf5f2('0x36'),'user'])&&_0x191af3[_0xf5f2('0x2d')][_0xf5f2('0x36')]!=='admin'){throw new Error(_0xf5f2('0x7b'));}if(_[_0xf5f2('0x86')](_0x6f9240,['role',_0xf5f2('0x7a')])&&_0x191af3[_0xf5f2('0x2d')][_0xf5f2('0x36')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xf5f2('0x87')](_0x6f9240)[_0xf5f2('0x15')](function(){return validateUser(_0x6f9240[0x0]);})[_0xf5f2('0x15')](function(){for(var _0x5ba275=0x1;_0x5ba275<_0x6f9240['length'];_0x5ba275++){var _0x2572c0=_0x6f9240[_0x5ba275-0x1][_0xf5f2('0x5f')];if(!_0x6f9240[_0x5ba275][_0xf5f2('0x5f')])_0x6f9240[_0x5ba275]['internal']=_0x2572c0+0x1;_0xe900ea['push'](validateUser(_0x6f9240[_0x5ba275]));}return BPromise['all'](_0xe900ea);})['then'](function(){_0xe900ea=[];for(var _0x560b39=0x0;_0x560b39<_0x6f9240[_0xf5f2('0x49')];_0x560b39++){_0xe900ea['push'](updateUser(_0x6f9240[_0x560b39]));}return BPromise[_0xf5f2('0x51')](_0xe900ea);})[_0xf5f2('0x15')](function(){return BPromise[_0xf5f2('0x88')](_0x6f9240,function(_0x43a167){return db[_0xf5f2('0x3b')][_0xf5f2('0x7e')](_0x43a167,{'include':[{'model':db[_0xf5f2('0x6c')],'as':_0xf5f2('0x6c')}]})[_0xf5f2('0x15')](function(_0x27ca4a){_0x43a167['id']=_0x27ca4a['id'];return _0x43a167;});});})[_0xf5f2('0x15')](function(_0x36c3c8){if(_0x191af3[_0xf5f2('0x59')]['role']===_0xf5f2('0x2d'))return _0x36c3c8;if(_0x191af3[_0xf5f2('0x2d')]['role']!==_0xf5f2('0x2d'))return _0x36c3c8;var _0x3395d3=_['some'](_0x36c3c8,function(_0x433ba0){return _0x433ba0[_0xf5f2('0x36')]===_0xf5f2('0x2e')||_0x433ba0['role']===_0xf5f2('0x30');});if(!_0x3395d3)return _0x36c3c8;return db[_0xf5f2('0x7f')]['findAll']({'where':{'name':{'$or':[_0xf5f2('0x80'),_0xf5f2('0x2f')]},'userProfileId':_0x191af3[_0xf5f2('0x2d')]['userProfileId']},'raw':!![]})[_0xf5f2('0x15')](function(_0x5573c4){if(_[_0xf5f2('0x89')](_0x5573c4)||!_['some'](_0x5573c4,[_0xf5f2('0x82'),0x0]))return _0x36c3c8;_0xe900ea=[];var _0x3cbc58=_(_0x5573c4)[_0xf5f2('0x33')](function(_0x42c915){if(_0x42c915['autoAssociation']===0x1)return;return _0x42c915[_0xf5f2('0x38')]==='Agents'?'agent':'telephone';})[_0xf5f2('0x8a')]()[_0xf5f2('0x34')]();for(var _0x5ece9e=0x0;_0x5ece9e<_0x36c3c8[_0xf5f2('0x49')];_0x5ece9e++){if(!_[_0xf5f2('0x35')](_0x3cbc58,_0x36c3c8[_0x5ece9e][_0xf5f2('0x36')]))return;var _0x3962b2=_0x36c3c8[_0x5ece9e][_0xf5f2('0x36')]===_0xf5f2('0x2e')?'Agents':_0xf5f2('0x2f');_0xe900ea[_0xf5f2('0x4a')](db['UserProfileResource'][_0xf5f2('0x7e')]({'name':_0x36c3c8[_0x5ece9e][_0xf5f2('0x38')],'resourceId':_0x36c3c8[_0x5ece9e]['id'],'type':_0x3962b2,'sectionId':_['find'](_0x5573c4,[_0xf5f2('0x38'),_0x3962b2])['id']},{}));}return BPromise[_0xf5f2('0x51')](_0xe900ea);});})[_0xf5f2('0x15')](respondWithResult(_0x2601aa,0xc9))[_0xf5f2('0x1f')](handleError(_0x2601aa,null));};exports[_0xf5f2('0x8b')]=function(_0x28dd0c,_0x4df05c){if(_0x28dd0c[_0xf5f2('0x59')]['id']){delete _0x28dd0c[_0xf5f2('0x59')]['id'];}return db[_0xf5f2('0x3b')][_0xf5f2('0x37')]({'where':{'id':_0x28dd0c[_0xf5f2('0x5a')]['id']}})[_0xf5f2('0x15')](function(_0x162c13){if(!_0x162c13)return null;if(_0x162c13['id']===_0x28dd0c[_0xf5f2('0x2d')]['id']){if(!_0x28dd0c[_0xf5f2('0x59')]['oldPassword']||!_0x28dd0c[_0xf5f2('0x59')][_0xf5f2('0x8c')]){throw new db[(_0xf5f2('0x8d'))][(_0xf5f2('0x8e'))](_0xf5f2('0x8f'));}if(!_0x162c13[_0xf5f2('0x90')](_0x28dd0c[_0xf5f2('0x59')][_0xf5f2('0x91')])){throw new db[(_0xf5f2('0x8d'))][(_0xf5f2('0x8e'))]('Wrong\x20credentials');}if(_0x28dd0c['body'][_0xf5f2('0x91')]===_0x28dd0c[_0xf5f2('0x59')][_0xf5f2('0x8c')]){throw new db[(_0xf5f2('0x8d'))]['ValidationError'](_0xf5f2('0x92'));}}else if(_0x28dd0c[_0xf5f2('0x2d')][_0xf5f2('0x36')]===_0xf5f2('0x7a')){if(!_0x28dd0c[_0xf5f2('0x59')]['newPassword']){throw new db[(_0xf5f2('0x8d'))][(_0xf5f2('0x8e'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x28dd0c[_0xf5f2('0x2d')][_0xf5f2('0x36')]===_0xf5f2('0x2d')){if(!_0x28dd0c[_0xf5f2('0x59')]['newPassword']){throw new db[(_0xf5f2('0x8d'))][(_0xf5f2('0x8e'))](_0xf5f2('0x93'));}if(_0x162c13['role']!=='agent'){throw new db[(_0xf5f2('0x8d'))][(_0xf5f2('0x8e'))](_0xf5f2('0x79'));}}else{throw new db[(_0xf5f2('0x8d'))][(_0xf5f2('0x8e'))](_0xf5f2('0x79'));}return _0x162c13;})['then'](handleEntityNotFound(_0x4df05c,null))[_0xf5f2('0x15')](function(_0x51e84c){return db[_0xf5f2('0x94')][_0xf5f2('0x95')]({'attributes':['id',_0xf5f2('0x61'),_0xf5f2('0x96'),_0xf5f2('0x97')]})[_0xf5f2('0x15')](function(_0x4a586c){if(_0x4a586c[_0xf5f2('0x61')])authService[_0xf5f2('0x62')](_0x28dd0c[_0xf5f2('0x59')][_0xf5f2('0x8c')]);if(!_0x4a586c[_0xf5f2('0x96')]||!_0x51e84c[_0xf5f2('0x98')])return _0x51e84c;authService[_0xf5f2('0x99')](_0x28dd0c['body'][_0xf5f2('0x8c')],_0x51e84c['previousPasswords'],_0x4a586c['passwordHistoryLimit']);return _0x51e84c;})['then'](saveUpdates({'password':_0x28dd0c[_0xf5f2('0x59')][_0xf5f2('0x8c')],'passwordResetAt':_0x28dd0c['user']['id']==_0x28dd0c[_0xf5f2('0x5a')]['id']?moment():null,'previousPasswords':authService[_0xf5f2('0x9a')](_0x28dd0c[_0xf5f2('0x59')][_0xf5f2('0x8c')],_0x51e84c['previousPasswords'])},null));})[_0xf5f2('0x15')](respondWithResult(_0x4df05c,null))[_0xf5f2('0x1f')](handleError(_0x4df05c,null));};exports[_0xf5f2('0x9b')]=function(_0x5d3ca7,_0x29f7bd){var _0x1efd91=_0x5d3ca7['body'][_0xf5f2('0x9c')];return db[_0xf5f2('0x3b')][_0xf5f2('0x37')]({'where':{'id':_0x5d3ca7[_0xf5f2('0x5a')]['id']},'attributes':['id',_0xf5f2('0x38'),_0xf5f2('0x36'),_0xf5f2('0x9d'),_0xf5f2('0x9e'),_0xf5f2('0x9f'),_0xf5f2('0xa0')]})[_0xf5f2('0x15')](handleEntityNotFound(_0x29f7bd,null))['then'](function(_0x299c53){if(_0x299c53){if(!utils[_0xf5f2('0xa1')](_0x1efd91)){throw new db['Sequelize'][(_0xf5f2('0x8e'))]('Unknown\x20channel');}return _0x299c53[_0xf5f2('0xa2')+_[_0xf5f2('0xa3')](_0x1efd91[_0xf5f2('0xa4')]())+_0xf5f2('0xa5')](_0x5d3ca7['body'][_0xf5f2('0x5d')],{'penalty':_0x5d3ca7['body'][_0xf5f2('0xa6')]||0x0})['spread'](function(_0x3310cb){for(var _0xde71c=0x0;_0xde71c<_0x5d3ca7['body'][_0xf5f2('0x5d')][_0xf5f2('0x49')];_0xde71c+=0x1){var _0x16619b={'UserId':Number(_0x5d3ca7[_0xf5f2('0x5a')]['id'])};_0x16619b[_[_0xf5f2('0xa3')](_0x1efd91[_0xf5f2('0xa4')]())+'QueueId']=Number(_0x5d3ca7['body'][_0xf5f2('0x5d')][_0xde71c]);socket[_0xf5f2('0xa7')]('user'+_[_0xf5f2('0xa3')](_0x1efd91[_0xf5f2('0xa4')]())+_0xf5f2('0xa8'),_0x16619b);}return _0x3310cb;})[_0xf5f2('0x15')](function(){if(_0x1efd91===_0xf5f2('0xa9')){return db[_0xf5f2('0xaa')][_0xf5f2('0xab')]({'where':{'id':_0x5d3ca7['body'][_0xf5f2('0x5d')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xf5f2('0x15')](function(_0x5ec0f3){var _0x3ff273=_0x299c53['get']({'plain':!![]});var _0xc51962=[];if(_0x1efd91==='voice'&&_0x3ff273['role']===_0xf5f2('0x2e')&&_0x3ff273[_0xf5f2('0x9d')]){for(var _0x57708f=0x0;_0x57708f<_0x5ec0f3[_0xf5f2('0x49')];_0x57708f+=0x1){_0xc51962[_0xf5f2('0x4a')]({'membername':_0x3ff273[_0xf5f2('0x38')],'UserId':_0x3ff273['id'],'queue_name':_0x5ec0f3[_0x57708f][_0xf5f2('0x38')],'VoiceQueueId':_0x5ec0f3[_0x57708f]['id'],'interface':_[_0xf5f2('0x64')](_0x3ff273[_0xf5f2('0xa0')])?util[_0xf5f2('0xac')](_0xf5f2('0xad'),_0x3ff273['name']):_0x3ff273['interface'],'paused':_0x3ff273[_0xf5f2('0x9f')]||![],'penalty':_0x5d3ca7['body'][_0xf5f2('0xa6')]||0x0});}return BPromise[_0xf5f2('0x88')](_0xc51962,function(_0x3a0e5c){return db[_0xf5f2('0xae')][_0xf5f2('0xaf')](_0x3a0e5c);});}return _0x299c53;});}})[_0xf5f2('0x15')](respondWithStatusCode(_0x29f7bd,null))[_0xf5f2('0x1f')](handleError(_0x29f7bd,null));};exports[_0xf5f2('0xb0')]=function(_0x28f65b,_0x16cbd3){var _0x275fb7;return db[_0xf5f2('0x3b')]['find']({'where':{'id':_0x28f65b[_0xf5f2('0x5a')]['id']},'attributes':['id','name',_0xf5f2('0x36')]})[_0xf5f2('0x15')](handleEntityNotFound(_0x16cbd3,null))[_0xf5f2('0x15')](function(_0x36afea){if(_0x36afea){_0x275fb7=_0x36afea;if(!_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x9c')]||!utils[_0xf5f2('0xa1')](_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x9c')])){throw new db[(_0xf5f2('0x8d'))][(_0xf5f2('0x8e'))]('Unknown\x20channel');}return _0x36afea[_0xf5f2('0xb1')+_[_0xf5f2('0xa3')](_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x9c')][_0xf5f2('0xa4')]())+_0xf5f2('0xa5')](_0x28f65b[_0xf5f2('0x43')]['ids']);}})[_0xf5f2('0x15')](function(_0x37d8b5){if(_[_0xf5f2('0xb2')](_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x5d')])){for(var _0x36ea7f=0x0;_0x36ea7f<_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x5d')][_0xf5f2('0x49')];_0x36ea7f+=0x1){var _0x529d6f={'UserId':Number(_0x28f65b[_0xf5f2('0x5a')]['id'])};_0x529d6f[_[_0xf5f2('0xa3')](_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x9c')][_0xf5f2('0xa4')]())+_0xf5f2('0xb3')]=Number(_0x28f65b['query'][_0xf5f2('0x5d')][_0x36ea7f]);socket[_0xf5f2('0xa7')]('user'+_['capitalize'](_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x9c')][_0xf5f2('0xa4')]())+_0xf5f2('0xb4'),_0x529d6f);}}else{var _0x529d6f={'UserId':Number(_0x28f65b[_0xf5f2('0x5a')]['id'])};_0x529d6f[_[_0xf5f2('0xa3')](_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x9c')][_0xf5f2('0xa4')]())+_0xf5f2('0xb3')]=Number(_0x28f65b['query'][_0xf5f2('0x5d')]);socket['emit']('user'+_[_0xf5f2('0xa3')](_0x28f65b[_0xf5f2('0x43')][_0xf5f2('0x9c')][_0xf5f2('0xa4')]())+_0xf5f2('0xb4'),_0x529d6f);}return _0x37d8b5;})[_0xf5f2('0x15')](function(){if(_0x28f65b[_0xf5f2('0x43')]['channel']===_0xf5f2('0xa9')){return db[_0xf5f2('0xae')][_0xf5f2('0x2b')]({'where':{'UserId':_0x28f65b['params']['id'],'VoiceQueueId':_0x28f65b[_0xf5f2('0x43')]['ids']},'individualHooks':!![]})['then'](function(){return _0x275fb7;});}return _0x275fb7;})[_0xf5f2('0x15')](respondWithStatusCode(_0x16cbd3,null))['catch'](handleError(_0x16cbd3,null));};exports[_0xf5f2('0xb5')]=function(_0x10215d,_0x5c7afd){_0x10215d[_0xf5f2('0x59')][_0xf5f2('0xb6')]=_0x10215d['file'][_0xf5f2('0xb7')];return db[_0xf5f2('0x3b')][_0xf5f2('0x37')]({'where':{'id':_0x10215d[_0xf5f2('0x5a')]['id']}})[_0xf5f2('0x15')](handleEntityNotFound(_0x5c7afd,null))['then'](saveUpdates(_0x10215d[_0xf5f2('0x59')],null))[_0xf5f2('0x15')](respondWithResult(_0x5c7afd,null))['catch'](handleError(_0x5c7afd,null));};exports['getAvatar']=function(_0x3dd6e8,_0x37f2f1){var _0x2d3ed2=path[_0xf5f2('0xb8')](config[_0xf5f2('0xb9')],_0xf5f2('0xba'));return db[_0xf5f2('0x3b')][_0xf5f2('0x37')]({'where':{'id':_0x3dd6e8['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xf5f2('0x15')](handleEntityNotFound(_0x37f2f1,null))['then'](function(_0x34abb6){if(_0x34abb6){if(_[_0xf5f2('0x64')](_0x34abb6[_0xf5f2('0xb6')])){return _0x37f2f1[_0xf5f2('0xbb')](_0x2d3ed2);}else{if(!fs['existsSync'](path[_0xf5f2('0xb8')](config[_0xf5f2('0xb9')],_0xf5f2('0xbc'),_0x34abb6[_0xf5f2('0xb6')]))){return _0x37f2f1[_0xf5f2('0xbb')](_0x2d3ed2);}return _0x37f2f1['download'](path[_0xf5f2('0xb8')](config[_0xf5f2('0xb9')],_0xf5f2('0xbc'),_0x34abb6[_0xf5f2('0xb6')]));}}})[_0xf5f2('0x1f')](handleError(_0x37f2f1,null));};exports[_0xf5f2('0xbd')]=function(_0x137bce,_0x3f7f3b){return db[_0xf5f2('0x3b')][_0xf5f2('0x37')]({'where':{'id':_0x137bce[_0xf5f2('0x5a')]['id']},'attributes':['id']})[_0xf5f2('0x15')](handleEntityNotFound(_0x3f7f3b,null))['then'](function(_0xd05e21){var _0x492175=[];values=_0xd05e21[_0xf5f2('0x4c')];_0x492175[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x4b'),_0xd05e21[_0xf5f2('0x4c')]));_0x492175[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x4d'),_0xd05e21[_0xf5f2('0x4c')]));_0x492175[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x4f'),_0xd05e21[_0xf5f2('0x4c')]));_0x492175[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x50'),_0xd05e21[_0xf5f2('0x4c')]));_0x492175[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0xbe'),_0xd05e21[_0xf5f2('0x4c')]));_0x492175[_0xf5f2('0x4a')](get_open_tabs(_0xf5f2('0x4e'),_0xd05e21['dataValues']));return BPromise[_0xf5f2('0x51')](_0x492175);})['then'](function(_0x5b96ef){var _0x10dbac=[];if(_0x5b96ef){for(var _0x4fc28b=0x0;_0x4fc28b=_0x4c66b9){_0x2c725d=_0x4c66b9;_0x3ea493=0xc8;}else{_0x3ea493=0xce;}_0x470694['status'](_0x3ea493);return _0x470694[_0x547c('0x26')](_0x547c('0x27'),_0x4855fd+'-'+_0x2c725d+'/'+_0x4c66b9)[_0x547c('0x23')](_0x1f3581);}return null;};}function saveUpdates(_0x30a96c){return function(_0x198afb){if(_0x198afb){return _0x198afb['update'](_0x30a96c)['then'](function(_0x28c282){return _0x28c282;});}return null;};}function removeEntity(_0x54de6f){return function(_0x303b57){if(_0x303b57){return _0x303b57[_0x547c('0x28')]()[_0x547c('0x15')](function(){var _0x1695be=_0x303b57[_0x547c('0x29')]({'plain':!![]});if(_0x1695be[_0x547c('0x2a')]===_0x547c('0x2b'))return;var _0x4d4dbd=[{'name':'Users','value':_0x547c('0x2c'),'ignore':!![]},{'name':_0x547c('0x2d'),'value':_0x547c('0x2e'),'ignore':![]},{'name':_0x547c('0x2f'),'value':_0x547c('0x30'),'ignore':![]}];var _0x18d7c1=_(_0x4d4dbd)[_0x547c('0x31')](_0x547c('0x32'))[_0x547c('0x33')](_0x547c('0x34'))[_0x547c('0x34')]();if(_[_0x547c('0x35')](_0x18d7c1,_0x1695be[_0x547c('0x2a')])){return;}var _0x385275=_['find'](_0x4d4dbd,[_0x547c('0x34'),_0x1695be['role']])['name'];return db['UserProfileResource'][_0x547c('0x28')]({'where':{'type':_0x385275,'resourceId':_0x1695be['id']}})[_0x547c('0x15')](function(){return _0x303b57;});})[_0x547c('0x15')](function(){_0x54de6f[_0x547c('0x22')](0xcc)[_0x547c('0x21')]();});}};}function handleEntityNotFound(_0x45f724){return function(_0x5c920e){if(!_0x5c920e){_0x45f724['sendStatus'](0x194);}return _0x5c920e;};}function handleError(_0x5ea2c7,_0xb51625){_0xb51625=_0xb51625||0x1f4;return function(_0x338b6b){logger[_0x547c('0x1c')](_0x338b6b[_0x547c('0x36')]);if(_0x338b6b[_0x547c('0x37')]){delete _0x338b6b[_0x547c('0x37')];}_0x5ea2c7['status'](_0xb51625)[_0x547c('0x38')](_0x338b6b);};}exports['index']=function(_0x32308f,_0x18fcc5){var _0x5b80f4={},_0x380705={'count':0x0,'rows':[]};var _0x5c57ae=_(db['User'][_0x547c('0x39')])[_0x547c('0x33')](function(_0x36bffe){return{'name':_0x36bffe[_0x547c('0x3a')],'type':_0x36bffe['type']['key']};})[_0x547c('0x31')](function(_0x1e8dd0){return!_[_0x547c('0x35')](['password',_0x547c('0x3b')],_0x1e8dd0[_0x547c('0x37')]);})[_0x547c('0x34')]();_0x5b80f4=qs['getOptions'](_0x5c57ae,_0x32308f);var _0x40184f={'where':_0x5b80f4[_0x547c('0x3c')]};return db[_0x547c('0x3d')]['count'](_0x40184f)[_0x547c('0x15')](function(_0xc28dc0){_0x380705['count']=_0xc28dc0;if(_0x32308f[_0x547c('0x3e')][_0x547c('0x3f')]){_0x5b80f4[_0x547c('0x40')]=[{'all':!![]}];}if(!_['includes'](_0x5b80f4[_0x547c('0x41')],'id')){_0x5b80f4['attributes'][_0x547c('0x42')]('id');}return db['User'][_0x547c('0x43')](_0x5b80f4);})[_0x547c('0x15')](function(_0x3d37d7){_0x380705[_0x547c('0x44')]=_0x3d37d7;if(_0x32308f[_0x547c('0x3e')][_0x547c('0x45')]==='true'){var _0x4ccbcf=[];for(var _0x1457ab=0x0;_0x1457ab<_0x380705[_0x547c('0x44')][_0x547c('0x46')];_0x1457ab++){_0x4ccbcf['push'](get_open_tabs(_0x547c('0x47'),_0x380705[_0x547c('0x44')][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x49'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x4a'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x4b'),_0x380705[_0x547c('0x44')][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf['push'](get_open_tabs(_0x547c('0x4c'),_0x380705['rows'][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf['push'](get_open_tabs(_0x547c('0x4d'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));}return BPromise[_0x547c('0x4e')](_0x4ccbcf)[_0x547c('0x15')](function(_0xa005cc){return _0x380705;});}else{return _0x380705;}})[_0x547c('0x15')](respondWithFilteredResult(_0x18fcc5,_0x5b80f4))['catch'](handleError(_0x18fcc5,null));};exports[_0x547c('0x4f')]=function(_0x484ede,_0x5649b6){var _0x4d4a92={'raw':![],'where':{'id':_0x484ede[_0x547c('0x50')]['id']}},_0x91fa04={};_0x91fa04[_0x547c('0x51')]=_[_0x547c('0x52')](_[_0x547c('0x53')](db[_0x547c('0x3d')][_0x547c('0x39')]),[_0x547c('0x54'),_0x547c('0x3b')]);_0x91fa04[_0x547c('0x3e')]=_[_0x547c('0x53')](_0x484ede['query']);_0x91fa04['filters']=_[_0x547c('0x55')](_0x91fa04[_0x547c('0x51')],_0x91fa04['query']);_0x4d4a92[_0x547c('0x41')]=_[_0x547c('0x55')](_0x91fa04[_0x547c('0x51')],qs[_0x547c('0x56')](_0x484ede[_0x547c('0x3e')][_0x547c('0x56')]));_0x4d4a92['attributes']=_0x4d4a92[_0x547c('0x41')]['length']?_0x4d4a92[_0x547c('0x41')]:_0x91fa04[_0x547c('0x51')];if(_0x484ede[_0x547c('0x3e')]['includeAll']){_0x4d4a92[_0x547c('0x40')]=[{'all':!![]}];}_0x4d4a92=_['merge']({},_0x4d4a92,_0x484ede[_0x547c('0x57')]);if(!_[_0x547c('0x35')](_0x4d4a92['attributes'],'id')){_0x4d4a92[_0x547c('0x41')][_0x547c('0x42')]('id');}return db[_0x547c('0x3d')][_0x547c('0x58')](_0x4d4a92)[_0x547c('0x15')](handleEntityNotFound(_0x5649b6,null))[_0x547c('0x15')](function(_0x224040){var _0x4a42d1=[];values=_0x224040;if(_0x484ede[_0x547c('0x3e')]['openTabs']===_0x547c('0x59')){_0x4a42d1[_0x547c('0x42')](get_open_tabs(_0x547c('0x47'),_0x224040[_0x547c('0x48')]));_0x4a42d1[_0x547c('0x42')](get_open_tabs('sms',_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4c'),_0x224040[_0x547c('0x48')]));_0x4a42d1[_0x547c('0x42')](get_open_tabs(_0x547c('0x4d'),_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4a'),_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4b'),_0x224040[_0x547c('0x48')]));return BPromise[_0x547c('0x4e')](_0x4a42d1);}else{return values;}})[_0x547c('0x15')](function(_0x53fed6){return values;})['then'](respondWithResult(_0x5649b6,null))['catch'](handleError(_0x5649b6,null));};exports[_0x547c('0x5a')]=function(_0x455467,_0x5e0e21){if(_0x455467[_0x547c('0x5b')]['id']){delete _0x455467['body']['id'];}delete _0x455467[_0x547c('0x5b')][_0x547c('0x2a')];return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x455467[_0x547c('0x50')]['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x5e0e21,null))[_0x547c('0x15')](saveUpdates(_0x455467['body'],null))['then'](respondWithResult(_0x5e0e21,null))[_0x547c('0x1f')](handleError(_0x5e0e21,null));};exports[_0x547c('0x5c')]=function(_0x3105cb,_0x64bf1e){return db[_0x547c('0x3d')]['describe']()['then'](respondWithResult(_0x64bf1e,null))['catch'](handleError(_0x64bf1e,null));};exports['addContacts']=function(_0x5d6c7f,_0x16ebb7){return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x5d6c7f['params']['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x16ebb7,null))[_0x547c('0x15')](function(_0x1d9666){if(_0x1d9666){return _0x1d9666[_0x547c('0x5d')](_0x5d6c7f['body']['ids'],_['omit'](_0x5d6c7f[_0x547c('0x5b')],[_0x547c('0x5e'),'id'])||{});}})[_0x547c('0x15')](respondWithResult(_0x16ebb7,null))[_0x547c('0x1f')](handleError(_0x16ebb7,null));};function validateUser(_0x345192){return new BPromise(function(_0x4dd4dc,_0x4e0da1){if(_0x345192[_0x547c('0x5f')])return _0x4dd4dc(_0x345192);return db[_0x547c('0x60')][_0x547c('0x61')](0x1)[_0x547c('0x15')](function(_0xa0fd35){if(_0xa0fd35['securePassword'])authService['validatePasswordPattern'](_0x345192['password']);db[_0x547c('0x3d')]['max'](_0x547c('0x5f'))[_0x547c('0x15')](function(_0x3d9ff6){if(_['isNil'](_0x3d9ff6)){_0x345192['internal']=_0xa0fd35[_0x547c('0x62')]||0x1;return;}if(_[_0x547c('0x63')](_0xa0fd35[_0x547c('0x62')])||_0xa0fd35[_0x547c('0x62')]===_0x3d9ff6){_0x345192[_0x547c('0x5f')]=_0x3d9ff6+0x1;return;}if(_0xa0fd35[_0x547c('0x62')]>_0x3d9ff6){_0x345192[_0x547c('0x5f')]=_0xa0fd35['min_internal'];return;}return db[_0x547c('0x64')][_0x547c('0x3e')](_0x547c('0x65'),{'type':db[_0x547c('0x64')][_0x547c('0x66')][_0x547c('0x67')]})[_0x547c('0x15')](function(_0x4066ce){if(_0x4066ce&&_0x4066ce['length']){for(var _0x1fa11a=0x0,_0x284fb7=_0x4066ce[_0x547c('0x46')];_0x1fa11a<_0x284fb7&&_[_0x547c('0x63')](_0x345192['internal']);_0x1fa11a++){if(_0xa0fd35[_0x547c('0x62')]<=_0x4066ce[_0x1fa11a][_0x547c('0x68')]){_0x345192[_0x547c('0x5f')]=_0x4066ce[_0x1fa11a]['from'];}else if(_0xa0fd35['min_internal']>_0x4066ce[_0x1fa11a]['from']&&_0xa0fd35[_0x547c('0x62')]<=_0x4066ce[_0x1fa11a]['to']){_0x345192[_0x547c('0x5f')]=_0xa0fd35[_0x547c('0x62')];}}}if(_['isNil'](_0x345192[_0x547c('0x5f')])){_0x345192[_0x547c('0x5f')]=_0x3d9ff6+0x1;}return _0x4dd4dc(_0x345192);});});})[_0x547c('0x1f')](function(_0x24a8f7){_0x4e0da1(_0x24a8f7);});});}function updateUser(_0x590e5f){return new BPromise(function(_0x482afb,_0x6b4445){try{if(_0x590e5f['voicemail']){_0x590e5f[_0x547c('0x69')]=_0x590e5f[_0x547c('0x5f')];_0x590e5f['VoiceMail']={'mailbox':_0x590e5f[_0x547c('0x5f')],'password':_0x590e5f['password'],'fullname':_0x590e5f[_0x547c('0x6a')],'email':_0x590e5f[_0x547c('0x6b')]};}if(_0x590e5f['role']===_0x547c('0x2e')){if(!_0x590e5f[_0x547c('0x6c')])_0x590e5f[_0x547c('0x6c')]=[_0x547c('0x6d'),'102','103',_0x547c('0x6e'),_0x547c('0x6f'),_0x547c('0x70'),_0x547c('0x71'),'106','107',_0x547c('0x72'),_0x547c('0x73'),_0x547c('0x74'),_0x547c('0x75'),_0x547c('0x76'),_0x547c('0x77')];}_0x482afb(_0x590e5f);}catch(_0x1e9026){_0x6b4445(_0x1e9026);}});}exports[_0x547c('0x78')]=function(_0x42ef60,_0x91bbf){if(_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]===_0x547c('0x2e'))throw new Error('Unauthorized');if(_0x42ef60['body']['role']===_0x547c('0x2c')&&_0x42ef60['user']['role']!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x42ef60['body'][_0x547c('0x2a')]===_0x547c('0x2b')&&_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]!=='admin'){throw new Error(_0x547c('0x79'));}return licenseUtil[_0x547c('0x7a')]([_0x42ef60['body']])['then'](function(){return validateUser(_0x42ef60[_0x547c('0x5b')]);})[_0x547c('0x15')](function(_0x2fecce){return updateUser(_0x2fecce)[_0x547c('0x15')](function(_0x204aad){if(_0x204aad[_0x547c('0x2a')]===_0x547c('0x2b')){_0x204aad[_0x547c('0x7b')]=_0x42ef60['user'][_0x547c('0x7b')];delete _0x204aad[_0x547c('0x7c')];}return _0x204aad;});})[_0x547c('0x15')](function(_0x5c2e3c){return db[_0x547c('0x3d')][_0x547c('0x78')](_0x5c2e3c,{'include':[{'model':db[_0x547c('0x7d')],'as':_0x547c('0x7d')}]});})[_0x547c('0x15')](function(_0x10c1a7){if(_0x42ef60[_0x547c('0x5b')][_0x547c('0x2a')]===_0x547c('0x2c'))return _0x10c1a7;if(_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]!==_0x547c('0x2c'))return _0x10c1a7;return db[_0x547c('0x7e')][_0x547c('0x58')]({'where':{'name':_0x10c1a7['role']===_0x547c('0x2e')?_0x547c('0x2d'):_0x547c('0x2f'),'userProfileId':_0x42ef60['user'][_0x547c('0x7c')]},'raw':!![]})[_0x547c('0x15')](function(_0x185176){if(!_0x185176||_0x185176[_0x547c('0x7f')]!=0x0)return _0x10c1a7;return db[_0x547c('0x80')][_0x547c('0x78')]({'name':_0x10c1a7[_0x547c('0x37')],'resourceId':_0x10c1a7['id'],'type':_0x185176[_0x547c('0x37')],'sectionId':_0x185176['id']},{})[_0x547c('0x15')](function(){return _0x10c1a7;});})[_0x547c('0x1f')](function(_0x224f62){logger[_0x547c('0x1c')](_0x547c('0x81'),_0x224f62);throw _0x224f62;});})['then'](respondWithResult(_0x91bbf,0xc9))['catch'](handleError(_0x91bbf,null));};exports['bulkCreate']=function(_0x588e2b,_0x5bafab){var _0x4b09fb=_0x588e2b[_0x547c('0x5b')];var _0x3bf455=[];if(_0x588e2b[_0x547c('0x2c')][_0x547c('0x2a')]==='agent')throw new Error(_0x547c('0x82'));if(_[_0x547c('0x83')](_0x4b09fb,[_0x547c('0x2a'),'user'])&&_0x588e2b[_0x547c('0x2c')][_0x547c('0x2a')]!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x4b09fb,['role',_0x547c('0x2b')])&&_0x588e2b['user'][_0x547c('0x2a')]!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x547c('0x7a')](_0x4b09fb)[_0x547c('0x15')](function(){return validateUser(_0x4b09fb[0x0]);})[_0x547c('0x15')](function(){for(var _0x3f54cf=0x1;_0x3f54cf<_0x4b09fb[_0x547c('0x46')];_0x3f54cf++){var _0x5a067c=_0x4b09fb[_0x3f54cf-0x1][_0x547c('0x5f')];if(!_0x4b09fb[_0x3f54cf]['internal'])_0x4b09fb[_0x3f54cf][_0x547c('0x5f')]=_0x5a067c+0x1;_0x3bf455[_0x547c('0x42')](validateUser(_0x4b09fb[_0x3f54cf]));}return BPromise[_0x547c('0x4e')](_0x3bf455);})[_0x547c('0x15')](function(){_0x3bf455=[];for(var _0x4e8596=0x0;_0x4e8596<_0x4b09fb[_0x547c('0x46')];_0x4e8596++){_0x3bf455['push'](updateUser(_0x4b09fb[_0x4e8596]));}return BPromise[_0x547c('0x4e')](_0x3bf455);})[_0x547c('0x15')](function(){return BPromise['each'](_0x4b09fb,function(_0x348ef8){return db['User'][_0x547c('0x78')](_0x348ef8,{'include':[{'model':db[_0x547c('0x7d')],'as':_0x547c('0x7d')}]})[_0x547c('0x15')](function(_0x55411b){_0x348ef8['id']=_0x55411b['id'];return _0x348ef8;});});})[_0x547c('0x15')](function(_0x311cb8){if(_0x588e2b[_0x547c('0x5b')][_0x547c('0x2a')]===_0x547c('0x2c'))return _0x311cb8;if(_0x588e2b['user'][_0x547c('0x2a')]!==_0x547c('0x2c'))return _0x311cb8;var _0x28cbee=_['some'](_0x311cb8,function(_0xcf70f8){return _0xcf70f8[_0x547c('0x2a')]===_0x547c('0x2e')||_0xcf70f8[_0x547c('0x2a')]==='telephone';});if(!_0x28cbee)return _0x311cb8;return db[_0x547c('0x7e')]['findAll']({'where':{'name':{'$or':[_0x547c('0x2d'),'Telephones']},'userProfileId':_0x588e2b[_0x547c('0x2c')][_0x547c('0x7c')]},'raw':!![]})[_0x547c('0x15')](function(_0x27b3ff){if(_[_0x547c('0x84')](_0x27b3ff)||!_[_0x547c('0x83')](_0x27b3ff,['autoAssociation',0x0]))return _0x311cb8;_0x3bf455=[];var _0x481894=_(_0x27b3ff)['map'](function(_0x449255){if(_0x449255[_0x547c('0x7f')]===0x1)return;return _0x449255[_0x547c('0x37')]===_0x547c('0x2d')?'agent':_0x547c('0x30');})['compact']()[_0x547c('0x34')]();for(var _0xad8038=0x0;_0xad8038<_0x311cb8[_0x547c('0x46')];_0xad8038++){if(!_[_0x547c('0x35')](_0x481894,_0x311cb8[_0xad8038][_0x547c('0x2a')]))return;var _0x15778c=_0x311cb8[_0xad8038]['role']===_0x547c('0x2e')?'Agents':_0x547c('0x2f');_0x3bf455[_0x547c('0x42')](db['UserProfileResource'][_0x547c('0x78')]({'name':_0x311cb8[_0xad8038][_0x547c('0x37')],'resourceId':_0x311cb8[_0xad8038]['id'],'type':_0x15778c,'sectionId':_[_0x547c('0x58')](_0x27b3ff,[_0x547c('0x37'),_0x15778c])['id']},{}));}return BPromise[_0x547c('0x4e')](_0x3bf455);});})[_0x547c('0x15')](respondWithResult(_0x5bafab,0xc9))[_0x547c('0x1f')](handleError(_0x5bafab,null));};exports['changePassword']=function(_0xcdd93f,_0x1e242f){if(_0xcdd93f[_0x547c('0x5b')]['id']){delete _0xcdd93f['body']['id'];}return db[_0x547c('0x3d')]['find']({'where':{'id':_0xcdd93f[_0x547c('0x50')]['id']}})['then'](function(_0x44b5e9){if(!_0x44b5e9)return null;if(_0x44b5e9['id']===_0xcdd93f[_0x547c('0x2c')]['id']){if(!_0xcdd93f[_0x547c('0x5b')][_0x547c('0x85')]||!_0xcdd93f['body'][_0x547c('0x86')]){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x89'));}if(!_0x44b5e9['authenticate'](_0xcdd93f['body'][_0x547c('0x85')])){throw new db[(_0x547c('0x87'))]['ValidationError'](_0x547c('0x8a'));}if(_0xcdd93f['body']['oldPassword']===_0xcdd93f['body'][_0x547c('0x86')]){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x8b'));}}else if(_0xcdd93f['user'][_0x547c('0x2a')]===_0x547c('0x2b')){if(!_0xcdd93f[_0x547c('0x5b')]['newPassword']){throw new db[(_0x547c('0x87'))]['ValidationError'](_0x547c('0x8c'));}}else if(_0xcdd93f[_0x547c('0x2c')][_0x547c('0x2a')]==='user'){if(!_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')]){throw new db['Sequelize'][(_0x547c('0x88'))](_0x547c('0x8c'));}if(_0x44b5e9[_0x547c('0x2a')]!==_0x547c('0x2e')){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x82'));}}else{throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x82'));}return _0x44b5e9;})['then'](handleEntityNotFound(_0x1e242f,null))['then'](function(_0x4267e3){return db['Setting'][_0x547c('0x8d')]({'attributes':['id','securePassword',_0x547c('0x8e'),_0x547c('0x8f')]})[_0x547c('0x15')](function(_0x39cb92){if(_0x39cb92[_0x547c('0x90')])authService[_0x547c('0x91')](_0xcdd93f[_0x547c('0x5b')]['newPassword']);if(!_0x39cb92[_0x547c('0x8e')]||!_0x4267e3[_0x547c('0x92')])return _0x4267e3;authService[_0x547c('0x93')](_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')],_0x4267e3[_0x547c('0x92')],_0x39cb92[_0x547c('0x8f')]);return _0x4267e3;})[_0x547c('0x15')](saveUpdates({'password':_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')],'passwordResetAt':_0xcdd93f[_0x547c('0x2c')]['id']==_0xcdd93f[_0x547c('0x50')]['id']?moment():null,'previousPasswords':authService[_0x547c('0x94')](_0xcdd93f['body'][_0x547c('0x86')],_0x4267e3[_0x547c('0x92')])},null));})[_0x547c('0x15')](respondWithResult(_0x1e242f,null))[_0x547c('0x1f')](handleError(_0x1e242f,null));};exports[_0x547c('0x95')]=function(_0x11e9fd,_0x35b426){var _0x3fae07=_0x11e9fd['body'][_0x547c('0x96')];return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x11e9fd['params']['id']},'attributes':['id','name',_0x547c('0x2a'),_0x547c('0x97'),_0x547c('0x98'),_0x547c('0x99'),_0x547c('0x9a')]})[_0x547c('0x15')](handleEntityNotFound(_0x35b426,null))[_0x547c('0x15')](function(_0xb541a7){if(_0xb541a7){if(!utils['isValidChannel'](_0x3fae07)){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))]('Unknown\x20channel');}return _0xb541a7[_0x547c('0x9b')+_[_0x547c('0x9c')](_0x3fae07[_0x547c('0x9d')]())+_0x547c('0x9e')](_0x11e9fd['body'][_0x547c('0x5e')],{'penalty':_0x11e9fd[_0x547c('0x5b')][_0x547c('0x9f')]||0x0})[_0x547c('0xa0')](function(_0x21938c){for(var _0x2c0a98=0x0;_0x2c0a98<_0x11e9fd[_0x547c('0x5b')]['ids'][_0x547c('0x46')];_0x2c0a98+=0x1){var _0x1564b8={'UserId':Number(_0x11e9fd[_0x547c('0x50')]['id'])};_0x1564b8[_[_0x547c('0x9c')](_0x3fae07['toLowerCase']())+_0x547c('0xa1')]=Number(_0x11e9fd['body']['ids'][_0x2c0a98]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_['capitalize'](_0x3fae07[_0x547c('0x9d')]())+_0x547c('0xa3'),_0x1564b8);}return _0x21938c;})[_0x547c('0x15')](function(){if(_0x3fae07==='voice'){return db['VoiceQueue'][_0x547c('0x43')]({'where':{'id':_0x11e9fd['body'][_0x547c('0x5e')]||[]},'raw':!![],'attributes':['id',_0x547c('0x37')]});}})[_0x547c('0x15')](function(_0x4cb529){var _0x4a2612=_0xb541a7[_0x547c('0x29')]({'plain':!![]});var _0xea7f3f=[];if(_0x3fae07==='voice'&&_0x4a2612[_0x547c('0x2a')]===_0x547c('0x2e')&&_0x4a2612['online']){for(var _0x1764f2=0x0;_0x1764f2<_0x4cb529[_0x547c('0x46')];_0x1764f2+=0x1){_0xea7f3f[_0x547c('0x42')]({'membername':_0x4a2612['name'],'UserId':_0x4a2612['id'],'queue_name':_0x4cb529[_0x1764f2][_0x547c('0x37')],'VoiceQueueId':_0x4cb529[_0x1764f2]['id'],'interface':_['isNil'](_0x4a2612['interface'])?util[_0x547c('0xa4')]('SIP/%s',_0x4a2612[_0x547c('0x37')]):_0x4a2612['interface'],'paused':_0x4a2612[_0x547c('0x99')]||![],'penalty':_0x11e9fd['body'][_0x547c('0x9f')]||0x0});}return BPromise[_0x547c('0xa5')](_0xea7f3f,function(_0x2a1bbf){return db[_0x547c('0xa6')][_0x547c('0xa7')](_0x2a1bbf);});}return _0xb541a7;});}})[_0x547c('0x15')](respondWithStatusCode(_0x35b426,null))[_0x547c('0x1f')](handleError(_0x35b426,null));};exports[_0x547c('0xa8')]=function(_0x54fb86,_0x2a560a){var _0x3131af;return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x54fb86[_0x547c('0x50')]['id']},'attributes':['id',_0x547c('0x37'),_0x547c('0x2a')]})[_0x547c('0x15')](handleEntityNotFound(_0x2a560a,null))[_0x547c('0x15')](function(_0x9e9307){if(_0x9e9307){_0x3131af=_0x9e9307;if(!_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')]||!utils[_0x547c('0xa9')](_0x54fb86[_0x547c('0x3e')]['channel'])){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0xaa'));}return _0x9e9307[_0x547c('0xab')+_['capitalize'](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+_0x547c('0x9e')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')]);}})[_0x547c('0x15')](function(_0xecf19c){if(_['isArray'](_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')])){for(var _0x17520a=0x0;_0x17520a<_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')][_0x547c('0x46')];_0x17520a+=0x1){var _0x3b20e9={'UserId':Number(_0x54fb86[_0x547c('0x50')]['id'])};_0x3b20e9[_[_0x547c('0x9c')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+'QueueId']=Number(_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')][_0x17520a]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_[_0x547c('0x9c')](_0x54fb86['query']['channel'][_0x547c('0x9d')]())+_0x547c('0xac'),_0x3b20e9);}}else{var _0x3b20e9={'UserId':Number(_0x54fb86['params']['id'])};_0x3b20e9[_[_0x547c('0x9c')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+_0x547c('0xa1')]=Number(_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_['capitalize'](_0x54fb86['query'][_0x547c('0x96')][_0x547c('0x9d')]())+'Queue:remove',_0x3b20e9);}return _0xecf19c;})[_0x547c('0x15')](function(){if(_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')]===_0x547c('0xad')){return db[_0x547c('0xa6')][_0x547c('0x28')]({'where':{'UserId':_0x54fb86[_0x547c('0x50')]['id'],'VoiceQueueId':_0x54fb86[_0x547c('0x3e')]['ids']},'individualHooks':!![]})['then'](function(){return _0x3131af;});}return _0x3131af;})[_0x547c('0x15')](respondWithStatusCode(_0x2a560a,null))['catch'](handleError(_0x2a560a,null));};exports[_0x547c('0xae')]=function(_0x3d9a66,_0x592246){_0x3d9a66[_0x547c('0x5b')]['userpic']=_0x3d9a66[_0x547c('0xaf')][_0x547c('0xb0')];return db['User'][_0x547c('0x58')]({'where':{'id':_0x3d9a66[_0x547c('0x50')]['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x592246,null))[_0x547c('0x15')](saveUpdates(_0x3d9a66[_0x547c('0x5b')],null))[_0x547c('0x15')](respondWithResult(_0x592246,null))[_0x547c('0x1f')](handleError(_0x592246,null));};exports['getAvatar']=function(_0x4c7336,_0x21c274){var _0x2a0b2b=path['join'](config[_0x547c('0xb1')],'server/files/images/logos/default_profile.png');return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x4c7336[_0x547c('0x50')]['id']},'attributes':['id',_0x547c('0xb2')],'raw':!![]})['then'](handleEntityNotFound(_0x21c274,null))[_0x547c('0x15')](function(_0x434d03){if(_0x434d03){if(_[_0x547c('0x63')](_0x434d03['userpic'])){return _0x21c274[_0x547c('0xb3')](_0x2a0b2b);}else{if(!fs['existsSync'](path[_0x547c('0xb4')](config[_0x547c('0xb1')],_0x547c('0xb5'),_0x434d03[_0x547c('0xb2')]))){return _0x21c274[_0x547c('0xb3')](_0x2a0b2b);}return _0x21c274[_0x547c('0xb3')](path[_0x547c('0xb4')](config[_0x547c('0xb1')],'server/files/images/',_0x434d03['userpic']));}}})[_0x547c('0x1f')](handleError(_0x21c274,null));};exports[_0x547c('0xb6')]=function(_0x5e70bc,_0x352781){return db[_0x547c('0x3d')]['find']({'where':{'id':_0x5e70bc['params']['id']},'attributes':['id']})[_0x547c('0x15')](handleEntityNotFound(_0x352781,null))[_0x547c('0x15')](function(_0x3cdca2){var _0xf2d9a7=[];values=_0x3cdca2['dataValues'];_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x47'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs('sms',_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4c'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4d'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4a'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4b'),_0x3cdca2[_0x547c('0x48')]));return BPromise[_0x547c('0x4e')](_0xf2d9a7);})['then'](function(_0x5b28f7){var _0x307b25=[];if(_0x5b28f7){for(var _0x4e4a63=0x0;_0x4e4a63=_0x1836d9[_0x3362('0x4c')]){throw new Error(_0x3362('0x4d'));}})[_0x3362('0x10')](function(){if(_0x191047){return db[_0x3362('0x3c')]['destroy']({'where':{'membername':_0x191047[_0x3362('0x28')]},'individualHooks':!![]});}})[_0x3362('0x10')](function(){if(_0x191047){return _0x191047[_0x3362('0x4e')]({'raw':!![]});}})[_0x3362('0x10')](function(_0x445b30){if(_0x191047){if(_0x445b30){var _0x2e7ed1=[];_0x2feb84=_0x445b30;if(_0x2feb84[_0x3362('0x4f')]){for(var _0x48cd70=0x0;_0x48cd70<_0x2feb84[_0x3362('0x4f')];_0x48cd70++){_0x2e7ed1['push'](db[_0x3362('0x3c')][_0x3362('0x50')]({'membername':_0x191047['name'],'UserId':_0x191047['id'],'queue_name':_0x2feb84[_0x48cd70][_0x3362('0x28')],'VoiceQueueId':_0x2feb84[_0x48cd70]['id'],'interface':_0x27d238,'paused':_0x191047[_0x3362('0x48')]||![],'penalty':_0x2feb84[_0x48cd70][_0x3362('0x51')]||0x0}));}return BPromise[_0x3362('0x52')](_0x2e7ed1);}}}})['then'](function(){if(_0x191047){return db[_0x3362('0x2b')][_0x3362('0x2c')]({'where':{'membername':_0x191047['name'],'exitAt':null}});}})['then'](function(_0x1309f9){if(_0x191047){if(_0x1309f9&&_0x1309f9[_0x3362('0x4f')]){var _0x28e3ff=[];_0x1309f9[_0x3362('0x31')](function(_0x2fcba8){_0x28e3ff[_0x3362('0x45')](_0x2fcba8[_0x3362('0x3d')]({'exitAt':moment()[_0x3362('0x2d')](_0x3362('0x2e'))}));});return BPromise[_0x3362('0x52')](_0x28e3ff);}}})['then'](function(_0x492df6){if(_0x191047){var _0x4b2ed5=[];var _0x2a6e5e=[];var _0x3a4d0c=utils['getChannels']();var _0x3ba4b8={'membername':_0x191047[_0x3362('0x28')],'interface':_0x27d238,'enterAt':moment()[_0x3362('0x2d')](_0x3362('0x2e')),'role':_0x191047[_0x3362('0x29')],'internal':_0x191047[_0x3362('0x53')]};_0x3a4d0c[_0x3362('0x31')](function(_0x356cb2){_0x4b2ed5['push'](_[_0x3362('0x54')]({'channel':_0x356cb2,'type':_0x3362('0x55'),'data1':_0x3362('0x56'),'data2':_0x27d238},_0x3ba4b8));if(_0x191047['loginInPause']){_0x2a6e5e['push'](_[_0x3362('0x54')]({'channel':_0x356cb2,'type':_0x3362('0x33'),'data1':_0x3362('0x57')},_0x3ba4b8));}});return db[_0x3362('0x2b')]['bulkCreate'](_0x4b2ed5[_0x3362('0x58')](_0x2a6e5e),{'individualHooks':!![]});}})[_0x3362('0x10')](function(){if(_0x191047){return _0x191047[_0x3362('0x3d')]({'online':!![],'lastLoginAt':moment()[_0x3362('0x2d')](_0x3362('0x2e')),'voicePause':_0x191047[_0x3362('0x48')]||![],'mailPause':_0x191047[_0x3362('0x48')]||![],'chatPause':_0x191047[_0x3362('0x48')]||![],'faxPause':_0x191047[_0x3362('0x48')]||![],'smsPause':_0x191047[_0x3362('0x48')]||![],'openchannelPause':_0x191047[_0x3362('0x48')]||![],'pauseType':_0x191047['loginInPause']?_0x3362('0x57'):null,'lastPauseAt':moment()[_0x3362('0x2d')](_0x3362('0x2e')),'interface':_0x27d238});}})[_0x3362('0x10')](function(_0x2d88b0){_0x1a58d9(_0x2d88b0);})[_0x3362('0x1a')](function(_0x139c2c){_0x1d8b45(_0x31b8d1[_0x3362('0x16')](0x1f4,_0x139c2c[_0x3362('0x17')]));});});}; \ No newline at end of file +var _0x8bc1=['body','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','whatsapp','set','%s%s','Pause','LogoutUser','all','LoginUser','findOne','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','User','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','ShowUser','find','PauseUser','role','internal','update','name','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','interface','type','uniqueid','MemberReport','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser'];(function(_0x27b3df,_0x34a01a){var _0x275390=function(_0x46e282){while(--_0x46e282){_0x27b3df['push'](_0x27b3df['shift']());}};_0x275390(++_0x34a01a);}(_0x8bc1,0x19e));var _0x18bc=function(_0x2ebdd9,_0x1fdb4f){_0x2ebdd9=_0x2ebdd9-0x0;var _0x117a90=_0x8bc1[_0x2ebdd9];return _0x117a90;};'use strict';var _=require(_0x18bc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x18bc('0x1'));var rs=require(_0x18bc('0x2'));var fs=require('fs');var Redis=require(_0x18bc('0x3'));var db=require(_0x18bc('0x4'))['db'];var utils=require(_0x18bc('0x5'));var logger=require('../../config/logger')(_0x18bc('0x6'));var config=require('../../config/environment');var jayson=require(_0x18bc('0x7'));var client=jayson['client'][_0x18bc('0x8')]({'port':0x232a});config[_0x18bc('0x9')]=_[_0x18bc('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x18bc('0xb'))(new Redis(config['redis']));require(_0x18bc('0xc'))[_0x18bc('0xd')](socket);function respondWithRpcPromise(_0x103761,_0x32edab,_0x416acd){return new BPromise(function(_0x5d96a9,_0x226f4c){return client[_0x18bc('0xe')](_0x103761,_0x416acd)[_0x18bc('0xf')](function(_0x1f2711){logger[_0x18bc('0x10')](_0x18bc('0x11'),_0x32edab,_0x18bc('0x12'));logger[_0x18bc('0x13')](_0x18bc('0x14'),_0x32edab,_0x18bc('0x12'),JSON[_0x18bc('0x15')](_0x1f2711));if(_0x1f2711[_0x18bc('0x16')]){if(_0x1f2711[_0x18bc('0x16')]['code']===0x1f4){logger['error'](_0x18bc('0x11'),_0x32edab,_0x1f2711[_0x18bc('0x16')][_0x18bc('0x17')]);return _0x226f4c(_0x1f2711[_0x18bc('0x16')][_0x18bc('0x17')]);}logger[_0x18bc('0x16')]('User,\x20%s,\x20%s',_0x32edab,_0x1f2711[_0x18bc('0x16')][_0x18bc('0x17')]);return _0x5d96a9(_0x1f2711[_0x18bc('0x16')][_0x18bc('0x17')]);}else{logger[_0x18bc('0x10')](_0x18bc('0x11'),_0x32edab,_0x18bc('0x12'));_0x5d96a9(_0x1f2711[_0x18bc('0x18')][_0x18bc('0x17')]);}})[_0x18bc('0x19')](function(_0x4bbf77){logger[_0x18bc('0x16')]('User,\x20%s,\x20%s',_0x32edab,_0x4bbf77);_0x226f4c(_0x4bbf77);});});}exports['GetUser']=function(_0x9c3c3){var _0x3289b=this;return new Promise(function(_0x448f94,_0x47899f){return db[_0x18bc('0x1a')][_0x18bc('0x1b')]({'raw':_0x9c3c3[_0x18bc('0x1c')]?_0x9c3c3['options'][_0x18bc('0x1d')]===undefined?!![]:![]:!![],'where':_0x9c3c3[_0x18bc('0x1c')]?_0x9c3c3[_0x18bc('0x1c')][_0x18bc('0x1e')]||null:null,'attributes':_0x9c3c3[_0x18bc('0x1c')]?_0x9c3c3['options'][_0x18bc('0x1f')]||null:null,'limit':_0x9c3c3[_0x18bc('0x1c')]?_0x9c3c3[_0x18bc('0x1c')][_0x18bc('0x20')]||null:null,'include':_0x9c3c3[_0x18bc('0x1c')]?_0x9c3c3[_0x18bc('0x1c')][_0x18bc('0x21')]?_[_0x18bc('0x22')](_0x9c3c3[_0x18bc('0x1c')]['include'],function(_0x1c1802){return{'model':db[_0x1c1802[_0x18bc('0x23')]],'as':_0x1c1802['as'],'attributes':_0x1c1802[_0x18bc('0x1f')],'include':_0x1c1802[_0x18bc('0x21')]?_[_0x18bc('0x22')](_0x1c1802[_0x18bc('0x21')],function(_0x2a8506){return{'model':db[_0x2a8506[_0x18bc('0x23')]],'as':_0x2a8506['as'],'attributes':_0x2a8506[_0x18bc('0x1f')],'include':_0x2a8506[_0x18bc('0x21')]?_[_0x18bc('0x22')](_0x2a8506[_0x18bc('0x21')],function(_0x106415){return{'model':db[_0x106415[_0x18bc('0x23')]],'as':_0x106415['as'],'attributes':_0x106415[_0x18bc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x18bc('0xf')](function(_0x5ea93e){logger['info'](_0x18bc('0x24'),_0x9c3c3);logger[_0x18bc('0x13')](_0x18bc('0x24'),_0x9c3c3,JSON[_0x18bc('0x15')](_0x5ea93e));_0x448f94(_0x5ea93e);})['catch'](function(_0x495b58){logger[_0x18bc('0x16')](_0x18bc('0x24'),_0x495b58['message'],_0x9c3c3);_0x47899f(_0x3289b['error'](0x1f4,_0x495b58[_0x18bc('0x17')]));});});};exports[_0x18bc('0x25')]=function(_0x1ee7e5){var _0x238917=this;return new Promise(function(_0x463b74,_0x1dd1cd){return db[_0x18bc('0x1a')][_0x18bc('0x26')]({'raw':_0x1ee7e5['options']?_0x1ee7e5[_0x18bc('0x1c')][_0x18bc('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ee7e5['options']?_0x1ee7e5['options'][_0x18bc('0x1e')]||null:null,'attributes':_0x1ee7e5['options']?_0x1ee7e5[_0x18bc('0x1c')][_0x18bc('0x1f')]||null:null,'include':_0x1ee7e5[_0x18bc('0x1c')]?_0x1ee7e5[_0x18bc('0x1c')]['include']?_[_0x18bc('0x22')](_0x1ee7e5[_0x18bc('0x1c')][_0x18bc('0x21')],function(_0x1150e8){return{'model':db[_0x1150e8[_0x18bc('0x23')]],'as':_0x1150e8['as'],'attributes':_0x1150e8[_0x18bc('0x1f')],'include':_0x1150e8[_0x18bc('0x21')]?_[_0x18bc('0x22')](_0x1150e8[_0x18bc('0x21')],function(_0x36cafc){return{'model':db[_0x36cafc['model']],'as':_0x36cafc['as'],'attributes':_0x36cafc[_0x18bc('0x1f')],'include':_0x36cafc['include']?_['map'](_0x36cafc[_0x18bc('0x21')],function(_0x5bd0d9){return{'model':db[_0x5bd0d9['model']],'as':_0x5bd0d9['as'],'attributes':_0x5bd0d9['attributes']};}):[]};}):[]};}):[]:[]})[_0x18bc('0xf')](function(_0x4f1bfb){logger[_0x18bc('0x10')]('ShowUser',_0x1ee7e5);logger['debug'](_0x18bc('0x25'),_0x1ee7e5,JSON[_0x18bc('0x15')](_0x4f1bfb));_0x463b74(_0x4f1bfb);})[_0x18bc('0x19')](function(_0xbd1035){logger[_0x18bc('0x16')](_0x18bc('0x25'),_0xbd1035[_0x18bc('0x17')],_0x1ee7e5);_0x1dd1cd(_0x238917[_0x18bc('0x16')](0x1f4,_0xbd1035[_0x18bc('0x17')]));});});};exports[_0x18bc('0x27')]=function(_0x330512){var _0x83db13=this;return new Promise(function(_0xcbc020,_0x56b913){var _0x69721f;return db[_0x18bc('0x1a')][_0x18bc('0x26')]({'where':_0x330512[_0x18bc('0x1c')][_0x18bc('0x1e')]||{},'attributes':['id','name',_0x18bc('0x28'),_0x18bc('0x29'),'interface']})[_0x18bc('0xf')](function(_0x472188){if(_0x472188){_0x69721f=_0x472188;return db['UserVoiceQueueRt'][_0x18bc('0x2a')]({'paused':0x1},{'where':{'UserId':_0x69721f['id']},'individualHooks':!![]});}})[_0x18bc('0xf')](function(){if(_0x69721f){return db['MemberReport'][_0x18bc('0x1b')]({'where':{'membername':_0x69721f[_0x18bc('0x2b')],'type':_0x18bc('0x2c'),'exitAt':null}});}})[_0x18bc('0xf')](function(_0x398817){if(_0x69721f){if(_0x398817&&_0x398817['length']){var _0x2a46d4=moment()[_0x18bc('0x2d')](_0x18bc('0x2e'));for(var _0x5ef0d6=0x0,_0x47cd64=_0x398817[_0x18bc('0x2f')];_0x5ef0d6<_0x47cd64;_0x5ef0d6++){_0x398817[_0x5ef0d6][_0x18bc('0x30')]({'exitAt':_0x2a46d4});}}}})[_0x18bc('0xf')](function(){if(_0x69721f){var _0x83fe0b=[];var _0x9e436e=utils[_0x18bc('0x31')]();_0x9e436e[_0x18bc('0x32')](function(_0x959c10){_0x83fe0b[_0x18bc('0x33')]({'channel':_0x959c10,'membername':_0x69721f[_0x18bc('0x2b')],'interface':_[_0x18bc('0x34')](_0x69721f['interface'])?util['format'](_0x18bc('0x35'),_0x69721f[_0x18bc('0x2b')]):_0x69721f[_0x18bc('0x36')],'type':'PAUSE','enterAt':moment()[_0x18bc('0x2d')](_0x18bc('0x2e')),'data1':_0x330512['body'][_0x18bc('0x37')]||'DEFAULT\x20PAUSE','role':_0x69721f[_0x18bc('0x28')],'internal':_0x69721f['internal'],'uniqueid':_0x330512['body'][_0x18bc('0x38')]||null});});return db[_0x18bc('0x39')][_0x18bc('0x3a')](_0x83fe0b,{'individualHooks':!![]});}})[_0x18bc('0xf')](function(){if(_0x69721f){return _0x69721f[_0x18bc('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x330512['body'][_0x18bc('0x37')]||_0x18bc('0x3b'),'lastPauseAt':moment()['format'](_0x18bc('0x2e'))});}})[_0x18bc('0xf')](function(_0xb70454){_0xcbc020(_0xb70454);})[_0x18bc('0x19')](function(_0x1cf373){_0x56b913(_0x83db13[_0x18bc('0x16')](0x1f4,_0x1cf373[_0x18bc('0x17')]));});});};exports[_0x18bc('0x3c')]=function(_0x187510){var _0xb6128b=this;return new Promise(function(_0x1ca49a,_0x48b192){var _0xfa99d7;return db[_0x18bc('0x1a')]['findOne']({'where':_0x187510[_0x18bc('0x1c')]['where']||{},'attributes':['id',_0x18bc('0x2b')]})[_0x18bc('0xf')](function(_0x42b048){if(_0x42b048){_0xfa99d7=_0x42b048;if(_0x187510[_0x18bc('0x3d')][_0x18bc('0x3e')]&&!utils[_0x18bc('0x3f')](_0x187510['body']['channel'])){throw new Error(_0x18bc('0x40'));}switch(_0x187510[_0x18bc('0x3d')]['channel']){case _0x18bc('0x41'):return db[_0x18bc('0x42')][_0x18bc('0x2a')]({'paused':0x0},{'where':{'UserId':_0xfa99d7['id']}})[_0x18bc('0xf')](function(){return db[_0x18bc('0x39')][_0x18bc('0x26')]({'where':{'channel':_0x187510[_0x18bc('0x3d')]['channel'],'membername':_0xfa99d7[_0x18bc('0x2b')],'type':_0x18bc('0x2c'),'exitAt':null}});})[_0x18bc('0xf')](function(_0x2111cc){if(_0x2111cc){return _0x2111cc['update']({'exitAt':moment()[_0x18bc('0x2d')](_0x18bc('0x2e')),'data2':_0x18bc('0x43')},{'individualHooks':!![]});}return null;})[_0x18bc('0xf')](function(){return _0xfa99d7['update']({'voicePause':![]});});case _0x18bc('0x44'):case _0x18bc('0x45'):case _0x18bc('0x46'):case'sms':case'openchannel':case _0x18bc('0x47'):return db[_0x18bc('0x39')]['find']({'where':{'channel':_0x187510[_0x18bc('0x3d')][_0x18bc('0x3e')],'membername':_0xfa99d7[_0x18bc('0x2b')],'type':_0x18bc('0x2c'),'exitAt':null}})[_0x18bc('0xf')](function(_0x5bc8fa){return _0x5bc8fa[_0x18bc('0x2a')]({'exitAt':moment()[_0x18bc('0x2d')](_0x18bc('0x2e')),'data2':_0x18bc('0x43')},{'individualHooks':!![]});})[_0x18bc('0xf')](function(){var _0x1577a0={};_[_0x18bc('0x48')](_0x1577a0,util['format'](_0x18bc('0x49'),_0x187510[_0x18bc('0x3d')]['channel'],_0x18bc('0x4a')),![]);return _0xfa99d7[_0x18bc('0x2a')](_0x1577a0);});default:return db[_0x18bc('0x42')][_0x18bc('0x2a')]({'paused':0x0},{'where':{'UserId':_0xfa99d7['id']}})[_0x18bc('0xf')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0xfa99d7[_0x18bc('0x2b')],'type':_0x18bc('0x2c'),'exitAt':null}});})['then'](function(_0x31a3cc){var _0x20ca73=[];_0x31a3cc[_0x18bc('0x32')](function(_0x2f8549){_0x20ca73[_0x18bc('0x33')](_0x2f8549['update']({'exitAt':moment()['format'](_0x18bc('0x2e')),'data2':_0x18bc('0x43')}));});return BPromise['all'](_0x20ca73);})['then'](function(){return _0xfa99d7[_0x18bc('0x2a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x18bc('0xf')](function(_0x54572c){_0x1ca49a(_0x54572c);})[_0x18bc('0x19')](function(_0x3b1189){_0x48b192(_0xb6128b[_0x18bc('0x16')](0x1f4,_0x3b1189['message']));});});};exports[_0x18bc('0x4b')]=function(_0x15bc8e){var _0x8d2596=this;return new Promise(function(_0x38c49d,_0x1b16ae){var _0x186f27;return db[_0x18bc('0x1a')]['findOne']({'where':_0x15bc8e[_0x18bc('0x1c')][_0x18bc('0x1e')]||{},'attributes':['id',_0x18bc('0x2b')]})[_0x18bc('0xf')](function(_0x2ed877){if(_0x2ed877){_0x186f27=_0x2ed877;return db[_0x18bc('0x42')]['destroy']({'where':{'membername':_0x186f27[_0x18bc('0x2b')]},'individualHooks':!![]});}})[_0x18bc('0xf')](function(){if(_0x186f27){return db[_0x18bc('0x39')][_0x18bc('0x1b')]({'where':{'membername':_0x186f27['name'],'exitAt':null}});}})[_0x18bc('0xf')](function(_0x4653d2){if(_0x186f27){if(_0x4653d2&&_0x4653d2[_0x18bc('0x2f')]){var _0x1e3364=[];_0x4653d2[_0x18bc('0x32')](function(_0x691062){_0x1e3364[_0x18bc('0x33')](_0x691062[_0x18bc('0x2a')]({'exitAt':moment()[_0x18bc('0x2d')](_0x18bc('0x2e'))}));});return BPromise[_0x18bc('0x4c')](_0x1e3364);}}})[_0x18bc('0xf')](function(){if(_0x186f27){return _0x186f27['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x18bc('0xf')](function(_0x1dcdc6){_0x38c49d(_0x1dcdc6);})[_0x18bc('0x19')](function(_0x238fd7){_0x1b16ae(_0x8d2596[_0x18bc('0x16')](0x1f4,_0x238fd7['message']));});});};exports[_0x18bc('0x4d')]=function(_0x2a9446){var _0x1f190c=this;return new Promise(function(_0x42e5a8,_0x3f2755){var _0x2c9e48;var _0x2429a8;var _0x3244b7;var _0x15eb11;return db[_0x18bc('0x1a')][_0x18bc('0x4e')]({'where':_0x2a9446['options'][_0x18bc('0x1e')]||{},'attributes':['id',_0x18bc('0x2b'),'role','mobile',_0x18bc('0x4f'),_0x18bc('0x29'),_0x18bc('0x50'),_0x18bc('0x36')]})[_0x18bc('0xf')](function(_0x149aed){if(_0x149aed){_0x2c9e48=_0x149aed;_0x15eb11=_0x2a9446[_0x18bc('0x3d')][_0x18bc('0x36')]?_0x2a9446[_0x18bc('0x3d')][_0x18bc('0x36')]:util[_0x18bc('0x2d')](_0x18bc('0x35'),_0x2c9e48['name']);return db[_0x18bc('0x1a')][_0x18bc('0x51')]({'where':{'role':_0x18bc('0x52'),'online':!![],'id':{'$ne':_0x2c9e48['id']}}});}})['then'](function(_0x1efbc8){if(_0x1efbc8){_0x3244b7=_0x1efbc8;return require(_0x18bc('0x53'))[_0x18bc('0x54')]();}})[_0x18bc('0xf')](function(_0x19d5ba){if(_0x19d5ba&&_0x19d5ba[_0x18bc('0x55')]&&_0x3244b7>=_0x19d5ba[_0x18bc('0x55')]){throw new Error(_0x18bc('0x56'));}})['then'](function(){if(_0x2c9e48){return db[_0x18bc('0x42')]['destroy']({'where':{'membername':_0x2c9e48[_0x18bc('0x2b')]},'individualHooks':!![]});}})[_0x18bc('0xf')](function(){if(_0x2c9e48){return _0x2c9e48[_0x18bc('0x57')]({'raw':!![]});}})[_0x18bc('0xf')](function(_0x55b8b3){if(_0x2c9e48){if(_0x55b8b3){var _0x162c09=[];_0x2429a8=_0x55b8b3;if(_0x2429a8['length']){for(var _0x38d6c6=0x0;_0x38d6c6<_0x2429a8[_0x18bc('0x2f')];_0x38d6c6++){_0x162c09[_0x18bc('0x33')](db[_0x18bc('0x42')][_0x18bc('0x58')]({'membername':_0x2c9e48[_0x18bc('0x2b')],'UserId':_0x2c9e48['id'],'queue_name':_0x2429a8[_0x38d6c6][_0x18bc('0x2b')],'VoiceQueueId':_0x2429a8[_0x38d6c6]['id'],'interface':_0x15eb11,'paused':_0x2c9e48['loginInPause']||![],'penalty':_0x2429a8[_0x38d6c6][_0x18bc('0x59')]||0x0}));}return BPromise['all'](_0x162c09);}}}})[_0x18bc('0xf')](function(){if(_0x2c9e48){return db[_0x18bc('0x39')][_0x18bc('0x1b')]({'where':{'membername':_0x2c9e48[_0x18bc('0x2b')],'exitAt':null}});}})[_0x18bc('0xf')](function(_0x3bbfee){if(_0x2c9e48){if(_0x3bbfee&&_0x3bbfee[_0x18bc('0x2f')]){var _0x4fb386=[];_0x3bbfee['forEach'](function(_0x1565a2){_0x4fb386[_0x18bc('0x33')](_0x1565a2[_0x18bc('0x2a')]({'exitAt':moment()[_0x18bc('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x18bc('0x4c')](_0x4fb386);}}})[_0x18bc('0xf')](function(_0x50b0ef){if(_0x2c9e48){var _0x543282=[];var _0x954180=[];var _0x241b1c=utils[_0x18bc('0x31')]();var _0x5c4456={'membername':_0x2c9e48['name'],'interface':_0x15eb11,'enterAt':moment()[_0x18bc('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2c9e48[_0x18bc('0x28')],'internal':_0x2c9e48['internal']};_0x241b1c[_0x18bc('0x32')](function(_0x55194f){_0x543282[_0x18bc('0x33')](_[_0x18bc('0x5a')]({'channel':_0x55194f,'type':_0x18bc('0x5b'),'data1':_0x18bc('0x5c'),'data2':_0x15eb11},_0x5c4456));if(_0x2c9e48[_0x18bc('0x50')]){_0x954180['push'](_[_0x18bc('0x5a')]({'channel':_0x55194f,'type':_0x18bc('0x2c'),'data1':_0x18bc('0x5d')},_0x5c4456));}});return db[_0x18bc('0x39')][_0x18bc('0x3a')](_0x543282[_0x18bc('0x5e')](_0x954180),{'individualHooks':!![]});}})[_0x18bc('0xf')](function(){if(_0x2c9e48){return _0x2c9e48[_0x18bc('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x18bc('0x2d')](_0x18bc('0x2e')),'voicePause':_0x2c9e48[_0x18bc('0x50')]||![],'mailPause':_0x2c9e48['loginInPause']||![],'chatPause':_0x2c9e48[_0x18bc('0x50')]||![],'faxPause':_0x2c9e48[_0x18bc('0x50')]||![],'smsPause':_0x2c9e48[_0x18bc('0x50')]||![],'openchannelPause':_0x2c9e48[_0x18bc('0x50')]||![],'pauseType':_0x2c9e48[_0x18bc('0x50')]?_0x18bc('0x5d'):null,'lastPauseAt':moment()[_0x18bc('0x2d')](_0x18bc('0x2e')),'interface':_0x15eb11});}})[_0x18bc('0xf')](function(_0x541c5c){_0x42e5a8(_0x541c5c);})[_0x18bc('0x19')](function(_0x2ef199){_0x3f2755(_0x1f190c['error'](0x1f4,_0x2ef199[_0x18bc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 9a00d5c..e6aabbc 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 _0xe577=['save','emit','length','./user.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe577,0x8f));var _0x7e57=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xe577[_0x279d37];return _0x530173;};'use strict';var UserEvents=require(_0x7e57('0x0'));var events=[_0x7e57('0x1'),'remove','update'];function createListener(_0x17e6d8,_0x4cf865){return function(_0x1eb460){_0x4cf865[_0x7e57('0x2')](_0x17e6d8,_0x1eb460);};}function removeListener(_0x3e49ad,_0x48dca9){return function(){UserEvents['removeListener'](_0x3e49ad,_0x48dca9);};}exports['register']=function(_0x384574){for(var _0x5a7a0d=0x0,_0x2b8c99=events[_0x7e57('0x3')];_0x5a7a0d<_0x2b8c99;_0x5a7a0d++){var _0x5a9b31=events[_0x5a7a0d];var _0x5867bc=createListener('user:'+_0x5a9b31,_0x384574);UserEvents['on'](_0x5a9b31,_0x5867bc);}}; \ No newline at end of file +var _0x0299=['remove','update','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x31ec29,_0x58915c){var _0x3275fc=function(_0x435075){while(--_0x435075){_0x31ec29['push'](_0x31ec29['shift']());}};_0x3275fc(++_0x58915c);}(_0x0299,0x1d2));var _0x9029=function(_0x12d199,_0x550dde){_0x12d199=_0x12d199-0x0;var _0x3e3ca3=_0x0299[_0x12d199];return _0x3e3ca3;};'use strict';var UserEvents=require(_0x9029('0x0'));var events=[_0x9029('0x1'),_0x9029('0x2'),_0x9029('0x3')];function createListener(_0x4d15cf,_0x2d3399){return function(_0x133495){_0x2d3399[_0x9029('0x4')](_0x4d15cf,_0x133495);};}function removeListener(_0x105e84,_0x173444){return function(){UserEvents[_0x9029('0x5')](_0x105e84,_0x173444);};}exports[_0x9029('0x6')]=function(_0x10c4f5){for(var _0x4afa46=0x0,_0x2e75d5=events[_0x9029('0x7')];_0x4afa46<_0x2e75d5;_0x4afa46++){var _0x5d5368=events[_0x4afa46];var _0x38e8aa=createListener(_0x9029('0x8')+_0x5d5368,_0x10c4f5);UserEvents['on'](_0x5d5368,_0x38e8aa);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 62e5915..e143494 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x498bc1,_0xaec27b){var _0x1414e9=function(_0x4098a3){while(--_0x4098a3){_0x498bc1['push'](_0x498bc1['shift']());}};_0x1414e9(++_0xaec27b);}(_0xe706,0xa3));var _0x6e70=function(_0x1876b2,_0x5d0225){_0x1876b2=_0x1876b2-0x0;var _0x9fb1e0=_0xe706[_0x1876b2];return _0x9fb1e0;};'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(_0xab0646,_0x1627f2){var _0x15929e=function(_0x496509){while(--_0x496509){_0xab0646['push'](_0xab0646['shift']());}};_0x15929e(++_0x1627f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index fa039a0..0eaeaa0 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 _0xf2d7=['INTEGER','sequelize'];(function(_0x114fa5,_0x3fb859){var _0x537d8e=function(_0x3c1502){while(--_0x3c1502){_0x114fa5['push'](_0x114fa5['shift']());}};_0x537d8e(++_0x3fb859);}(_0xf2d7,0x121));var _0x7f2d=function(_0x5b2a6b,_0x900e86){_0x5b2a6b=_0x5b2a6b-0x0;var _0xd0f50b=_0xf2d7[_0x5b2a6b];return _0xd0f50b;};'use strict';var Sequelize=require(_0x7f2d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7f2d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe0ff=['exports','INTEGER','sequelize'];(function(_0x32033a,_0x2208e5){var _0x25336d=function(_0x39fa83){while(--_0x39fa83){_0x32033a['push'](_0x32033a['shift']());}};_0x25336d(++_0x2208e5);}(_0xe0ff,0x116));var _0xfe0f=function(_0x553658,_0x188884){_0x553658=_0x553658-0x0;var _0x417659=_0xe0ff[_0x553658];return _0x417659;};'use strict';var Sequelize=require(_0xfe0f('0x0'));module[_0xfe0f('0x1')]={'penalty':{'type':Sequelize[_0xfe0f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 037cc01..44c153d 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 _0x63a4=['UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x63a4,0x120));var _0x463a=function(_0x34b0d3,_0x55b139){_0x34b0d3=_0x34b0d3-0x0;var _0x37c298=_0x63a4[_0x34b0d3];return _0x37c298;};'use strict';var _=require(_0x463a('0x0'));var util=require('util');var logger=require(_0x463a('0x1'))(_0x463a('0x2'));var moment=require('moment');var BPromise=require(_0x463a('0x3'));var rp=require(_0x463a('0x4'));var fs=require('fs');var path=require(_0x463a('0x5'));var rimraf=require('rimraf');var config=require(_0x463a('0x6'));var attributes=require(_0x463a('0x7'));module[_0x463a('0x8')]=function(_0x1aa989,_0x26c783){return _0x1aa989['define'](_0x463a('0x9'),attributes,{'tableName':_0x463a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0939=['api','request-promise','path','rimraf','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger'];(function(_0x65532a,_0x2f75d8){var _0x5a92d7=function(_0x153031){while(--_0x153031){_0x65532a['push'](_0x65532a['shift']());}};_0x5a92d7(++_0x2f75d8);}(_0x0939,0x15d));var _0x9093=function(_0x1ffea3,_0x46afdc){_0x1ffea3=_0x1ffea3-0x0;var _0x55ef91=_0x0939[_0x1ffea3];return _0x55ef91;};'use strict';var _=require(_0x9093('0x0'));var util=require(_0x9093('0x1'));var logger=require(_0x9093('0x2'))(_0x9093('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9093('0x4'));var fs=require('fs');var path=require(_0x9093('0x5'));var rimraf=require(_0x9093('0x6'));var config=require('../../config/environment');var attributes=require(_0x9093('0x7'));module['exports']=function(_0x6eb7b0,_0x9e6d51){return _0x6eb7b0[_0x9093('0x8')](_0x9093('0x9'),attributes,{'tableName':_0x9093('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 7450f37..6a764f1 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 _0xf4ef=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0xf4ef,0x65));var _0xff4e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xf4ef[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xff4e('0x0'));var util=require('util');var moment=require(_0xff4e('0x1'));var BPromise=require('bluebird');var rs=require(_0xff4e('0x2'));var fs=require('fs');var Redis=require(_0xff4e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xff4e('0x4'));var logger=require(_0xff4e('0x5'))(_0xff4e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff4e('0x7')][_0xff4e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x76e5df,_0x34ce52,_0x46a742){return new BPromise(function(_0x2e4e59,_0x69c22e){return client['request'](_0x76e5df,_0x46a742)[_0xff4e('0x9')](function(_0xa5dd56){logger[_0xff4e('0xa')](_0xff4e('0xb'),_0x34ce52,_0xff4e('0xc'));logger['debug'](_0xff4e('0xd'),_0x34ce52,_0xff4e('0xc'),JSON[_0xff4e('0xe')](_0xa5dd56));if(_0xa5dd56[_0xff4e('0xf')]){if(_0xa5dd56[_0xff4e('0xf')][_0xff4e('0x10')]===0x1f4){logger[_0xff4e('0xf')](_0xff4e('0xb'),_0x34ce52,_0xa5dd56[_0xff4e('0xf')][_0xff4e('0x11')]);return _0x69c22e(_0xa5dd56[_0xff4e('0xf')][_0xff4e('0x11')]);}logger[_0xff4e('0xf')](_0xff4e('0xb'),_0x34ce52,_0xa5dd56[_0xff4e('0xf')]['message']);return _0x2e4e59(_0xa5dd56[_0xff4e('0xf')][_0xff4e('0x11')]);}else{logger[_0xff4e('0xa')](_0xff4e('0xb'),_0x34ce52,'request\x20sent');_0x2e4e59(_0xa5dd56[_0xff4e('0x12')]['message']);}})['catch'](function(_0x3bf875){logger[_0xff4e('0xf')](_0xff4e('0xb'),_0x34ce52,_0x3bf875);_0x69c22e(_0x3bf875);});});} \ No newline at end of file +var _0xd6eb=['info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x9785a2,_0x1270be){var _0x2d7f04=function(_0x3abaca){while(--_0x3abaca){_0x9785a2['push'](_0x9785a2['shift']());}};_0x2d7f04(++_0x1270be);}(_0xd6eb,0x83));var _0xbd6e=function(_0x5e808a,_0x1cbd40){_0x5e808a=_0x5e808a-0x0;var _0x4df9cd=_0xd6eb[_0x5e808a];return _0x4df9cd;};'use strict';var _=require('lodash');var util=require(_0xbd6e('0x0'));var moment=require(_0xbd6e('0x1'));var BPromise=require(_0xbd6e('0x2'));var rs=require(_0xbd6e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd6e('0x4'))['db'];var utils=require(_0xbd6e('0x5'));var logger=require(_0xbd6e('0x6'))('rpc');var config=require(_0xbd6e('0x7'));var jayson=require(_0xbd6e('0x8'));var client=jayson[_0xbd6e('0x9')][_0xbd6e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ef30b,_0x4681f8,_0x5356ec){return new BPromise(function(_0x1d02c5,_0x24a0ad){return client[_0xbd6e('0xb')](_0x5ef30b,_0x5356ec)[_0xbd6e('0xc')](function(_0x465f6d){logger[_0xbd6e('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x4681f8,_0xbd6e('0xe'));logger[_0xbd6e('0xf')](_0xbd6e('0x10'),_0x4681f8,'request\x20sent',JSON[_0xbd6e('0x11')](_0x465f6d));if(_0x465f6d[_0xbd6e('0x12')]){if(_0x465f6d[_0xbd6e('0x12')][_0xbd6e('0x13')]===0x1f4){logger[_0xbd6e('0x12')](_0xbd6e('0x14'),_0x4681f8,_0x465f6d['error']['message']);return _0x24a0ad(_0x465f6d['error']['message']);}logger[_0xbd6e('0x12')](_0xbd6e('0x14'),_0x4681f8,_0x465f6d['error'][_0xbd6e('0x15')]);return _0x1d02c5(_0x465f6d[_0xbd6e('0x12')][_0xbd6e('0x15')]);}else{logger[_0xbd6e('0xd')](_0xbd6e('0x14'),_0x4681f8,_0xbd6e('0xe'));_0x1d02c5(_0x465f6d[_0xbd6e('0x16')]['message']);}})[_0xbd6e('0x17')](function(_0x1986d6){logger[_0xbd6e('0x12')](_0xbd6e('0x14'),_0x4681f8,_0x1986d6);_0x24a0ad(_0x1986d6);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 449d1e8..cd4ed5d 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x594e71,_0x369022){var _0x343e65=function(_0x1cc87a){while(--_0x1cc87a){_0x594e71['push'](_0x594e71['shift']());}};_0x343e65(++_0x369022);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xcb91[_0x67f95e];return _0x538f5a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x348021,_0x24fc80){var _0x426682=function(_0x573730){while(--_0x573730){_0x348021['push'](_0x348021['shift']());}};_0x426682(++_0x24fc80);}(_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 diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 3812d75..bd2d5ee 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 _0x5e3c=['INTEGER','STRING','sequelize','exports'];(function(_0x5f1b87,_0xd76e68){var _0x1d8152=function(_0x807869){while(--_0x807869){_0x5f1b87['push'](_0x5f1b87['shift']());}};_0x1d8152(++_0xd76e68);}(_0x5e3c,0x106));var _0xc5e3=function(_0x3a2bc1,_0x4fdffa){_0x3a2bc1=_0x3a2bc1-0x0;var _0x22e9c1=_0x5e3c[_0x3a2bc1];return _0x22e9c1;};'use strict';var Sequelize=require(_0xc5e3('0x0'));module[_0xc5e3('0x1')]={'penalty':{'type':Sequelize[_0xc5e3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc5e3('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc5e3('0x3')]}}; \ No newline at end of file +var _0xf392=['exports','INTEGER'];(function(_0x12cf72,_0x4804ab){var _0x3d2b88=function(_0x197526){while(--_0x197526){_0x12cf72['push'](_0x12cf72['shift']());}};_0x3d2b88(++_0x4804ab);}(_0xf392,0x90));var _0x2f39=function(_0x4560a7,_0x19bd67){_0x4560a7=_0x4560a7-0x0;var _0x2f41be=_0xf392[_0x4560a7];return _0x2f41be;};'use strict';var Sequelize=require('sequelize');module[_0x2f39('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2f39('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 19bd815..8dabcb9 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 _0x70ef=['./userFaxQueue.attributes','exports','define','UserFaxQueue','util','../../config/logger','api','moment','bluebird','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x70ef,0x1b2));var _0xf70e=function(_0x2a1304,_0x2fb7e0){_0x2a1304=_0x2a1304-0x0;var _0x3352d3=_0x70ef[_0x2a1304];return _0x3352d3;};'use strict';var _=require('lodash');var util=require(_0xf70e('0x0'));var logger=require(_0xf70e('0x1'))(_0xf70e('0x2'));var moment=require(_0xf70e('0x3'));var BPromise=require(_0xf70e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf70e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf70e('0x6'));module[_0xf70e('0x7')]=function(_0x450cf6,_0x47af31){return _0x450cf6[_0xf70e('0x8')](_0xf70e('0x9'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8252=['UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','define'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x8252,0x145));var _0x2825=function(_0x927ad6,_0x1d88b8){_0x927ad6=_0x927ad6-0x0;var _0x1943d5=_0x8252[_0x927ad6];return _0x1943d5;};'use strict';var _=require(_0x2825('0x0'));var util=require(_0x2825('0x1'));var logger=require(_0x2825('0x2'))(_0x2825('0x3'));var moment=require(_0x2825('0x4'));var BPromise=require(_0x2825('0x5'));var rp=require(_0x2825('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2825('0x7'));var config=require(_0x2825('0x8'));var attributes=require(_0x2825('0x9'));module['exports']=function(_0x3d1ce2,_0x306ba3){return _0x3d1ce2[_0x2825('0xa')](_0x2825('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 0533a79..9a864a4 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 _0x7680=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x12ef9a,_0x5dfbf7){var _0x3a6833=function(_0x38e1bd){while(--_0x38e1bd){_0x12ef9a['push'](_0x12ef9a['shift']());}};_0x3a6833(++_0x5dfbf7);}(_0x7680,0x110));var _0x0768=function(_0x81e59e,_0x5f082d){_0x81e59e=_0x81e59e-0x0;var _0x221350=_0x7680[_0x81e59e];return _0x221350;};'use strict';var _=require(_0x0768('0x0'));var util=require(_0x0768('0x1'));var moment=require('moment');var BPromise=require(_0x0768('0x2'));var rs=require(_0x0768('0x3'));var fs=require('fs');var Redis=require(_0x0768('0x4'));var db=require(_0x0768('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0768('0x6'));var config=require(_0x0768('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0768('0x8')][_0x0768('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42364d,_0x484270,_0x2ee6b0){return new BPromise(function(_0x34c095,_0x4078be){return client['request'](_0x42364d,_0x2ee6b0)[_0x0768('0xa')](function(_0x1a475e){logger[_0x0768('0xb')](_0x0768('0xc'),_0x484270,_0x0768('0xd'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x484270,_0x0768('0xd'),JSON[_0x0768('0xe')](_0x1a475e));if(_0x1a475e['error']){if(_0x1a475e[_0x0768('0xf')]['code']===0x1f4){logger[_0x0768('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x484270,_0x1a475e[_0x0768('0xf')][_0x0768('0x10')]);return _0x4078be(_0x1a475e[_0x0768('0xf')][_0x0768('0x10')]);}logger[_0x0768('0xf')](_0x0768('0xc'),_0x484270,_0x1a475e[_0x0768('0xf')]['message']);return _0x34c095(_0x1a475e['error']['message']);}else{logger[_0x0768('0xb')](_0x0768('0xc'),_0x484270,_0x0768('0xd'));_0x34c095(_0x1a475e[_0x0768('0x11')][_0x0768('0x10')]);}})['catch'](function(_0x1eb644){logger[_0x0768('0xf')](_0x0768('0xc'),_0x484270,_0x1eb644);_0x4078be(_0x1eb644);});});} \ No newline at end of file +var _0xe0ab=['request\x20sent','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5712bd,_0x53b0ef){var _0x5a0bab=function(_0x573e30){while(--_0x573e30){_0x5712bd['push'](_0x5712bd['shift']());}};_0x5a0bab(++_0x53b0ef);}(_0xe0ab,0x11f));var _0xbe0a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe0ab[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xbe0a('0x0'));var moment=require(_0xbe0a('0x1'));var BPromise=require('bluebird');var rs=require(_0xbe0a('0x2'));var fs=require('fs');var Redis=require(_0xbe0a('0x3'));var db=require(_0xbe0a('0x4'))['db'];var utils=require(_0xbe0a('0x5'));var logger=require(_0xbe0a('0x6'))(_0xbe0a('0x7'));var config=require(_0xbe0a('0x8'));var jayson=require(_0xbe0a('0x9'));var client=jayson[_0xbe0a('0xa')][_0xbe0a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc6ca2f,_0x364fbb,_0x332fcc){return new BPromise(function(_0x928919,_0x2bea77){return client['request'](_0xc6ca2f,_0x332fcc)[_0xbe0a('0xc')](function(_0x2bd11f){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x364fbb,'request\x20sent');logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x364fbb,_0xbe0a('0xd'),JSON['stringify'](_0x2bd11f));if(_0x2bd11f[_0xbe0a('0xe')]){if(_0x2bd11f[_0xbe0a('0xe')][_0xbe0a('0xf')]===0x1f4){logger['error'](_0xbe0a('0x10'),_0x364fbb,_0x2bd11f[_0xbe0a('0xe')][_0xbe0a('0x11')]);return _0x2bea77(_0x2bd11f['error'][_0xbe0a('0x11')]);}logger[_0xbe0a('0xe')](_0xbe0a('0x10'),_0x364fbb,_0x2bd11f['error'][_0xbe0a('0x11')]);return _0x928919(_0x2bd11f[_0xbe0a('0xe')][_0xbe0a('0x11')]);}else{logger['info'](_0xbe0a('0x10'),_0x364fbb,_0xbe0a('0xd'));_0x928919(_0x2bd11f[_0xbe0a('0x12')][_0xbe0a('0x11')]);}})[_0xbe0a('0x13')](function(_0x1fc0b7){logger['error'](_0xbe0a('0x10'),_0x364fbb,_0x1fc0b7);_0x2bea77(_0x1fc0b7);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8aefd2c..35b8414 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x42a7b9,_0x2677cb){var _0x3b8570=function(_0x587986){while(--_0x587986){_0x42a7b9['push'](_0x42a7b9['shift']());}};_0x3b8570(++_0x2677cb);}(_0x70e0,0x17b));var _0x070e=function(_0x4e7821,_0x11292d){_0x4e7821=_0x4e7821-0x0;var _0x5027a9=_0x70e0[_0x4e7821];return _0x5027a9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x37edc4,_0x59433a){var _0x215669=function(_0xba2b1b){while(--_0xba2b1b){_0x37edc4['push'](_0x37edc4['shift']());}};_0x215669(++_0x59433a);}(_0xe706,0xa3));var _0x6e70=function(_0x136cbb,_0x2a97f9){_0x136cbb=_0x136cbb-0x0;var _0x333a69=_0xe706[_0x136cbb];return _0x333a69;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 0a1556d..f7f7487 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 _0x62e6=['INTEGER','sequelize','exports'];(function(_0x2bd4e3,_0x4d9b53){var _0x259f7c=function(_0x419754){while(--_0x419754){_0x2bd4e3['push'](_0x2bd4e3['shift']());}};_0x259f7c(++_0x4d9b53);}(_0x62e6,0x151));var _0x662e=function(_0x1b5d5f,_0x5ed766){_0x1b5d5f=_0x1b5d5f-0x0;var _0x3c9347=_0x62e6[_0x1b5d5f];return _0x3c9347;};'use strict';var Sequelize=require(_0x662e('0x0'));module[_0x662e('0x1')]={'penalty':{'type':Sequelize[_0x662e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb338=['exports','INTEGER'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb338,0x130));var _0x8b33=function(_0x32a254,_0x14e1d0){_0x32a254=_0x32a254-0x0;var _0x799afb=_0xb338[_0x32a254];return _0x799afb;};'use strict';var Sequelize=require('sequelize');module[_0x8b33('0x0')]={'penalty':{'type':Sequelize[_0x8b33('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 a8d50be..d7b2032 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 _0x25a5=['exports','user_has_mail_queues','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x25a5,0x1ce));var _0x525a=function(_0x54418f,_0x49e7e5){_0x54418f=_0x54418f-0x0;var _0x49a760=_0x25a5[_0x54418f];return _0x49a760;};'use strict';var _=require(_0x525a('0x0'));var util=require(_0x525a('0x1'));var logger=require(_0x525a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x525a('0x3'));var rp=require(_0x525a('0x4'));var fs=require('fs');var path=require(_0x525a('0x5'));var rimraf=require('rimraf');var config=require(_0x525a('0x6'));var attributes=require(_0x525a('0x7'));module[_0x525a('0x8')]=function(_0x1c347c,_0x5cb341){return _0x1c347c['define']('UserMailQueue',attributes,{'tableName':_0x525a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x610e=['path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa349cf,_0x387d9f){var _0x3e4c36=function(_0x505cd2){while(--_0x505cd2){_0xa349cf['push'](_0xa349cf['shift']());}};_0x3e4c36(++_0x387d9f);}(_0x610e,0x10b));var _0xe610=function(_0x349d29,_0x1595b5){_0x349d29=_0x349d29-0x0;var _0x1e6236=_0x610e[_0x349d29];return _0x1e6236;};'use strict';var _=require(_0xe610('0x0'));var util=require('util');var logger=require(_0xe610('0x1'))(_0xe610('0x2'));var moment=require(_0xe610('0x3'));var BPromise=require(_0xe610('0x4'));var rp=require(_0xe610('0x5'));var fs=require('fs');var path=require(_0xe610('0x6'));var rimraf=require(_0xe610('0x7'));var config=require(_0xe610('0x8'));var attributes=require(_0xe610('0x9'));module[_0xe610('0xa')]=function(_0xdfe2bf,_0x1e96e7){return _0xdfe2bf[_0xe610('0xb')](_0xe610('0xc'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 799e028..3e0ac49 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(_0x1bd747,_0x2bafbd){var _0x335194=function(_0x470d3e){while(--_0x470d3e){_0x1bd747['push'](_0x1bd747['shift']());}};_0x335194(++_0x2bafbd);}(_0xa41a,0x6b));var _0xaa41=function(_0x210c60,_0x16d7f6){_0x210c60=_0x210c60-0x0;var _0x51deb4=_0xa41a[_0x210c60];return _0x51deb4;};'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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x3b604a,_0x150540){var _0x3f53d1=function(_0x20e581){while(--_0x20e581){_0x3b604a['push'](_0x3b604a['shift']());}};_0x3f53d1(++_0x150540);}(_0x3e74,0x175));var _0x43e7=function(_0x1f2819,_0x2ba6ef){_0x1f2819=_0x1f2819-0x0;var _0x16b03e=_0x3e74[_0x1f2819];return _0x16b03e;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 6618b0f..8bde54a 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 _0x9307=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x4ca44b,_0x561784){var _0x52bceb=function(_0x4ffd45){while(--_0x4ffd45){_0x4ca44b['push'](_0x4ca44b['shift']());}};_0x52bceb(++_0x561784);}(_0x9307,0x18c));var _0x7930=function(_0x540605,_0x1b0d26){_0x540605=_0x540605-0x0;var _0x3420dc=_0x9307[_0x540605];return _0x3420dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7930('0x0'));var timeout=require(_0x7930('0x1'));var express=require(_0x7930('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7930('0x3'));var interaction=require(_0x7930('0x4'));var config=require(_0x7930('0x5'));var controller=require(_0x7930('0x6'));router[_0x7930('0x7')]('/',auth[_0x7930('0x8')](),controller['sendUserNotification']);module[_0x7930('0x9')]=router; \ No newline at end of file +var _0x2379=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x3cc34a,_0x13e2db){var _0x5ca5a1=function(_0x4f672d){while(--_0x4f672d){_0x3cc34a['push'](_0x3cc34a['shift']());}};_0x5ca5a1(++_0x13e2db);}(_0x2379,0xed));var _0x9237=function(_0x32bcbf,_0x381231){_0x32bcbf=_0x32bcbf-0x0;var _0x3d0093=_0x2379[_0x32bcbf];return _0x3d0093;};'use strict';var multer=require(_0x9237('0x0'));var util=require(_0x9237('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9237('0x2'));var router=express['Router']();var fs_extra=require(_0x9237('0x3'));var auth=require(_0x9237('0x4'));var interaction=require(_0x9237('0x5'));var config=require(_0x9237('0x6'));var controller=require(_0x9237('0x7'));router[_0x9237('0x8')]('/',auth['isAuthenticated'](),controller[_0x9237('0x9')]);module[_0x9237('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index dfdb7b1..5eb6579 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 _0xa5e4=['TEXT','STRING','sequelize','exports'];(function(_0x3240ff,_0x3b9c3d){var _0x514858=function(_0x22023a){while(--_0x22023a){_0x3240ff['push'](_0x3240ff['shift']());}};_0x514858(++_0x3b9c3d);}(_0xa5e4,0x186));var _0x4a5e=function(_0x18701b,_0x721883){_0x18701b=_0x18701b-0x0;var _0x5d0568=_0xa5e4[_0x18701b];return _0x5d0568;};'use strict';var Sequelize=require(_0x4a5e('0x0'));module[_0x4a5e('0x1')]={'body':{'type':Sequelize[_0x4a5e('0x2')]},'senderName':{'type':Sequelize[_0x4a5e('0x3')]},'recipientsId':{'type':Sequelize[_0x4a5e('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x91cb=['BOOLEAN','TEXT','STRING'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x91cb,0x13c));var _0xb91c=function(_0x30fa66,_0x48e393){_0x30fa66=_0x30fa66-0x0;var _0x345a96=_0x91cb[_0x30fa66];return _0x345a96;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xb91c('0x0')]},'senderName':{'type':Sequelize[_0xb91c('0x1')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xb91c('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index d7b0b83..7ccc793 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 _0xfd4d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','end','stack','name','sendUserNotification','body','text','hasOwnProperty','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','then','sequelize','UserNotification','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','union','ids','queue','replace','Queue','all','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x9ff06c,_0x41daed){var _0x591fcc=function(_0x172f42){while(--_0x172f42){_0x9ff06c['push'](_0x9ff06c['shift']());}};_0x591fcc(++_0x41daed);}(_0xfd4d,0x106));var _0xdfd4=function(_0x15ef8d,_0x5e9405){_0x15ef8d=_0x15ef8d-0x0;var _0x387ba0=_0xfd4d[_0x15ef8d];return _0x387ba0;};'use strict';var emlformat=require(_0xdfd4('0x0'));var rimraf=require(_0xdfd4('0x1'));var zipdir=require(_0xdfd4('0x2'));var jsonpatch=require(_0xdfd4('0x3'));var rp=require('request-promise');var moment=require(_0xdfd4('0x4'));var BPromise=require(_0xdfd4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdfd4('0x6'));var sox=require(_0xdfd4('0x7'));var csv=require(_0xdfd4('0x8'));var ejs=require(_0xdfd4('0x9'));var fs=require('fs');var fs_extra=require(_0xdfd4('0xa'));var _=require(_0xdfd4('0xb'));var squel=require(_0xdfd4('0xc'));var crypto=require('crypto');var jsforce=require(_0xdfd4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdfd4('0x8'));var querystring=require(_0xdfd4('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdfd4('0xf'));var qs=require(_0xdfd4('0x10'));var as=require(_0xdfd4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfd4('0x12'))(_0xdfd4('0x13'));var utils=require(_0xdfd4('0x14'));var config=require(_0xdfd4('0x15'));var licenseUtil=require(_0xdfd4('0x16'));var db=require(_0xdfd4('0x17'))['db'];config[_0xdfd4('0x18')]=_[_0xdfd4('0x19')](config[_0xdfd4('0x18')],{'host':_0xdfd4('0x1a'),'port':0x18eb});var socket=require(_0xdfd4('0x1b'))(new Redis(config[_0xdfd4('0x18')]));require('./userNotification.socket')[_0xdfd4('0x1c')](socket);function respondWithStatusCode(_0xa59978,_0x2aff8f){_0x2aff8f=_0x2aff8f||0xcc;return function(_0x37c452){if(_0x37c452){return _0xa59978[_0xdfd4('0x1d')](_0x2aff8f);}return _0xa59978[_0xdfd4('0x1e')](_0x2aff8f)['end']();};}function respondWithResult(_0x314ed2,_0x3717ce){_0x3717ce=_0x3717ce||0xc8;return function(_0x17ed69){if(_0x17ed69){return _0x314ed2[_0xdfd4('0x1e')](_0x3717ce)[_0xdfd4('0x1f')](_0x17ed69);}};}function respondWithFilteredResult(_0x32e921,_0x70bdcf){return function(_0x1e7a3e){if(_0x1e7a3e){var _0x126bbe=typeof _0x70bdcf[_0xdfd4('0x20')]===_0xdfd4('0x21')&&typeof _0x70bdcf[_0xdfd4('0x22')]===_0xdfd4('0x21');var _0x329011=_0x1e7a3e[_0xdfd4('0x23')];var _0x13c767=_0x126bbe?0x0:_0x70bdcf[_0xdfd4('0x20')];var _0x274aa3=_0x126bbe?_0x1e7a3e[_0xdfd4('0x23')]:_0x70bdcf['offset']+_0x70bdcf[_0xdfd4('0x22')];var _0x3a35b3;if(_0x274aa3>=_0x329011){_0x274aa3=_0x329011;_0x3a35b3=0xc8;}else{_0x3a35b3=0xce;}_0x32e921[_0xdfd4('0x1e')](_0x3a35b3);return _0x32e921['set'](_0xdfd4('0x24'),_0x13c767+'-'+_0x274aa3+'/'+_0x329011)[_0xdfd4('0x1f')](_0x1e7a3e);}return null;};}function patchUpdates(_0x47a8e2){return function(_0x36e7d8){try{jsonpatch['apply'](_0x36e7d8,_0x47a8e2,!![]);}catch(_0x1764a1){return BPromise[_0xdfd4('0x25')](_0x1764a1);}return _0x36e7d8[_0xdfd4('0x26')]();};}function saveUpdates(_0x46d7de,_0x1a8a71){return function(_0x2fc9d9){if(_0x2fc9d9){return _0x2fc9d9[_0xdfd4('0x27')](_0x46d7de)['then'](function(_0x1c9117){return _0x1c9117;});}return null;};}function removeEntity(_0x422a24,_0x3cef48){return function(_0x5c419c){if(_0x5c419c){return _0x5c419c['destroy']()['then'](function(){_0x422a24[_0xdfd4('0x1e')](0xcc)[_0xdfd4('0x28')]();});}};}function handleEntityNotFound(_0x5f4606,_0x349127){return function(_0x273720){if(!_0x273720){_0x5f4606[_0xdfd4('0x1d')](0x194);}return _0x273720;};}function handleError(_0x514c09,_0xae1c95){_0xae1c95=_0xae1c95||0x1f4;return function(_0x3da473){logger['error'](_0x3da473[_0xdfd4('0x29')]);if(_0x3da473[_0xdfd4('0x2a')]){delete _0x3da473[_0xdfd4('0x2a')];}_0x514c09[_0xdfd4('0x1e')](_0xae1c95)['send'](_0x3da473);};}exports[_0xdfd4('0x2b')]=function(_0x2ecd52,_0x2b8d81,_0x2495cf){if(!_0x2ecd52[_0xdfd4('0x2c')]['hasOwnProperty'](_0xdfd4('0x2d'))&&!_0x2ecd52[_0xdfd4('0x2c')][_0xdfd4('0x2e')]('TemplateId')){throw new db['Sequelize'][(_0xdfd4('0x2f'))](_0xdfd4('0x30'));}else{if(_0x2ecd52[_0xdfd4('0x2c')]['hasOwnProperty'](_0xdfd4('0x31'))&&!_0x2ecd52[_0xdfd4('0x2c')][_0xdfd4('0x2e')](_0xdfd4('0x32'))){throw new db['Sequelize'][(_0xdfd4('0x2f'))](_0xdfd4('0x33'));}if(!_0x2ecd52[_0xdfd4('0x2c')][_0xdfd4('0x2e')](_0xdfd4('0x34'))){throw new db[(_0xdfd4('0x35'))][(_0xdfd4('0x2f'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x25100d=JSON[_0xdfd4('0x36')](_0x2ecd52[_0xdfd4('0x2c')]['recipients']);}catch(_0x4ec8f0){logger['error'](_0x4ec8f0);throw new db[(_0xdfd4('0x35'))][(_0xdfd4('0x2f'))](_0xdfd4('0x37'));}var _0x1fc70c=[_0xdfd4('0x38'),'faxqueue',_0xdfd4('0x39'),_0xdfd4('0x3a'),_0xdfd4('0x3b'),'voicequeue',_0xdfd4('0x3c'),'team',_0xdfd4('0x3d')];if(_['some'](_0x25100d,function(_0x177afe){return!_[_0xdfd4('0x3e')](_0x1fc70c,_0x177afe[_0xdfd4('0x3f')][_0xdfd4('0x40')]());})){throw new db[(_0xdfd4('0x35'))]['ValidationError'](_0xdfd4('0x41'));}}}var _0xe09c5b={};_0xe09c5b[_0xdfd4('0x42')]=_0x2ecd52[_0xdfd4('0x2c')][_0xdfd4('0x2e')](_0xdfd4('0x42'))?_0x2ecd52['body'][_0xdfd4('0x42')]:_0x2ecd52[_0xdfd4('0x3d')][_0xdfd4('0x43')];_0xe09c5b[_0xdfd4('0x44')]=_[_0xdfd4('0x45')](_0x2ecd52[_0xdfd4('0x2c')][_0xdfd4('0x44')])?null:_0x2ecd52[_0xdfd4('0x2c')][_0xdfd4('0x44')];_0xe09c5b[_0xdfd4('0x46')]=_0x2ecd52['body'][_0xdfd4('0x46')]||![];_0xe09c5b[_0xdfd4('0x47')]=_0x2ecd52['user']['id'];return getContent(_0x2ecd52['body'])['then'](function(_0x18831d){_0xe09c5b[_0xdfd4('0x2c')]=_0x18831d;return getRecipients(_0x25100d);})[_0xdfd4('0x48')](function(_0x438850){_0xe09c5b['recipientsId']=_['sortBy'](_0x438850)['join'](',');return db[_0xdfd4('0x49')]['transaction'](function(_0x4b8c7b){return db[_0xdfd4('0x4a')]['create'](_0xe09c5b,{'raw':!![],'transaction':_0x4b8c7b})[_0xdfd4('0x48')](function(_0x55f8e9){var _0x25a755={'sender':_0xe09c5b[_0xdfd4('0x42')],'description':_0xe09c5b['recipientsDescription'],'content':_0xe09c5b['body'],'beep':_0xe09c5b[_0xdfd4('0x46')]};_0x438850['forEach'](function(_0x2f9b28){_0x25a755[_0xdfd4('0x4b')]=_0x2f9b28;socket[_0xdfd4('0x4c')](_0xdfd4('0x4d'),_0x25a755);});return _0x55f8e9;});});})[_0xdfd4('0x48')](respondWithResult(_0x2b8d81,0xc9))[_0xdfd4('0x4e')](handleError(_0x2b8d81,null));};function getContent(_0x29e6d4){return new BPromise(function(_0x58cb06,_0x48448d){if(_0x29e6d4[_0xdfd4('0x2d')]){_0x58cb06(_0x29e6d4['text']);return;}return db[_0xdfd4('0x4f')][_0xdfd4('0x50')]({'attributes':[_0xdfd4('0x51')],'where':{'id':_0x29e6d4[_0xdfd4('0x31')]},'raw':!![]})['then'](function(_0x863a92){if(!_0x863a92)throw new db[(_0xdfd4('0x35'))][(_0xdfd4('0x2f'))](_0xdfd4('0x52'));var _0xa7d4f0=Mustache[_0xdfd4('0x53')](_0x863a92[_0xdfd4('0x51')],_0x29e6d4[_0xdfd4('0x32')]);_0x58cb06(_0xa7d4f0);})[_0xdfd4('0x4e')](function(_0x42181e){_0x48448d(_0x42181e);});});}function getRecipients(_0x9e48a7){return new BPromise(function(_0x17b3cc,_0xa07d3){var _0x20cff6=[];var _0x2f5f33=[];_0x9e48a7[_0xdfd4('0x54')](function(_0x4f56d1){var _0x13cc53=_[_0xdfd4('0x55')](_0x4f56d1[_0xdfd4('0x3f')][_0xdfd4('0x40')]());if(_0x13cc53==='User'){_0x20cff6=_[_0xdfd4('0x56')](_0x20cff6,_0x4f56d1[_0xdfd4('0x57')]);}else{if(_[_0xdfd4('0x3e')](_0x13cc53,_0xdfd4('0x58')))_0x13cc53=_0x13cc53[_0xdfd4('0x59')](_0xdfd4('0x58'),_0xdfd4('0x5a'));_0x4f56d1[_0xdfd4('0x57')]['forEach'](function(_0x2f6da1){_0x2f5f33['push'](getAgents(_0x13cc53,_0x2f6da1));});}});return BPromise[_0xdfd4('0x5b')](_0x2f5f33)[_0xdfd4('0x48')](function(_0x3a0710){_0x20cff6=_['union'](_0x20cff6,_[_0xdfd4('0x5c')](_0x3a0710));_0x17b3cc(_0x20cff6);})[_0xdfd4('0x4e')](function(_0x1fcfff){_0xa07d3(_0x1fcfff);});});}function getAgents(_0x6dd19b,_0x2274d3){return new BPromise(function(_0x10acbb,_0x197824){return db[_0x6dd19b][_0xdfd4('0x50')]({'where':{'id':_0x2274d3}})[_0xdfd4('0x48')](function(_0x4630af){return _0x4630af['getAgents']({'attributes':['id'],'raw':!![]})[_0xdfd4('0x48')](function(_0x552ab4){var _0x48a24=_[_0xdfd4('0x5d')](_0x552ab4,'id');_0x10acbb(_0x48a24);});})[_0xdfd4('0x4e')](function(_0x45bafb){_0x197824(_0x45bafb);});});} \ No newline at end of file +var _0xe4c3=['stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','userNotification:send','catch','text','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','Queue','all','flatten','findOne','getAgents','map','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update','destroy','then','error'];(function(_0x184a1d,_0x2ec1fa){var _0x212b0c=function(_0x1daaad){while(--_0x1daaad){_0x184a1d['push'](_0x184a1d['shift']());}};_0x212b0c(++_0x2ec1fa);}(_0xe4c3,0x9d));var _0x3e4c=function(_0x350c5b,_0x49745d){_0x350c5b=_0x350c5b-0x0;var _0x1a87ab=_0xe4c3[_0x350c5b];return _0x1a87ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e4c('0x0'));var zipdir=require(_0x3e4c('0x1'));var jsonpatch=require(_0x3e4c('0x2'));var rp=require('request-promise');var moment=require(_0x3e4c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e4c('0x4'));var util=require(_0x3e4c('0x5'));var path=require(_0x3e4c('0x6'));var sox=require(_0x3e4c('0x7'));var csv=require(_0x3e4c('0x8'));var ejs=require(_0x3e4c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e4c('0xa'));var squel=require(_0x3e4c('0xb'));var crypto=require(_0x3e4c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3e4c('0x8'));var querystring=require(_0x3e4c('0xd'));var Papa=require('papaparse');var Redis=require(_0x3e4c('0xe'));var authService=require(_0x3e4c('0xf'));var qs=require(_0x3e4c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e4c('0x11'));var logger=require(_0x3e4c('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3e4c('0x13'));var db=require(_0x3e4c('0x14'))['db'];config[_0x3e4c('0x15')]=_['defaults'](config[_0x3e4c('0x15')],{'host':_0x3e4c('0x16'),'port':0x18eb});var socket=require(_0x3e4c('0x17'))(new Redis(config[_0x3e4c('0x15')]));require(_0x3e4c('0x18'))['register'](socket);function respondWithStatusCode(_0x418cc8,_0x42e8dc){_0x42e8dc=_0x42e8dc||0xcc;return function(_0x47f09a){if(_0x47f09a){return _0x418cc8[_0x3e4c('0x19')](_0x42e8dc);}return _0x418cc8['status'](_0x42e8dc)[_0x3e4c('0x1a')]();};}function respondWithResult(_0x287f46,_0x2c2cdf){_0x2c2cdf=_0x2c2cdf||0xc8;return function(_0x122380){if(_0x122380){return _0x287f46['status'](_0x2c2cdf)[_0x3e4c('0x1b')](_0x122380);}};}function respondWithFilteredResult(_0x42d146,_0x31ec7e){return function(_0x2ead01){if(_0x2ead01){var _0x5d8d0d=typeof _0x31ec7e[_0x3e4c('0x1c')]==='undefined'&&typeof _0x31ec7e[_0x3e4c('0x1d')]===_0x3e4c('0x1e');var _0x3d091e=_0x2ead01[_0x3e4c('0x1f')];var _0x56f7e9=_0x5d8d0d?0x0:_0x31ec7e[_0x3e4c('0x1c')];var _0x20c16d=_0x5d8d0d?_0x2ead01[_0x3e4c('0x1f')]:_0x31ec7e[_0x3e4c('0x1c')]+_0x31ec7e['limit'];var _0x3bea4f;if(_0x20c16d>=_0x3d091e){_0x20c16d=_0x3d091e;_0x3bea4f=0xc8;}else{_0x3bea4f=0xce;}_0x42d146[_0x3e4c('0x20')](_0x3bea4f);return _0x42d146[_0x3e4c('0x21')](_0x3e4c('0x22'),_0x56f7e9+'-'+_0x20c16d+'/'+_0x3d091e)[_0x3e4c('0x1b')](_0x2ead01);}return null;};}function patchUpdates(_0x5ac810){return function(_0x5f0d46){try{jsonpatch[_0x3e4c('0x23')](_0x5f0d46,_0x5ac810,!![]);}catch(_0x4e122e){return BPromise[_0x3e4c('0x24')](_0x4e122e);}return _0x5f0d46['save']();};}function saveUpdates(_0x462ce6,_0x5394f5){return function(_0x45beb){if(_0x45beb){return _0x45beb[_0x3e4c('0x25')](_0x462ce6)['then'](function(_0x411757){return _0x411757;});}return null;};}function removeEntity(_0x471d8f,_0x707a9b){return function(_0xe80225){if(_0xe80225){return _0xe80225[_0x3e4c('0x26')]()[_0x3e4c('0x27')](function(){_0x471d8f[_0x3e4c('0x20')](0xcc)[_0x3e4c('0x1a')]();});}};}function handleEntityNotFound(_0x12e864,_0x2cb901){return function(_0x39a401){if(!_0x39a401){_0x12e864[_0x3e4c('0x19')](0x194);}return _0x39a401;};}function handleError(_0x4cd5bf,_0x345159){_0x345159=_0x345159||0x1f4;return function(_0x308829){logger[_0x3e4c('0x28')](_0x308829[_0x3e4c('0x29')]);if(_0x308829[_0x3e4c('0x2a')]){delete _0x308829[_0x3e4c('0x2a')];}_0x4cd5bf['status'](_0x345159)[_0x3e4c('0x2b')](_0x308829);};}exports[_0x3e4c('0x2c')]=function(_0x5d2728,_0x4501b4,_0x150d33){if(!_0x5d2728[_0x3e4c('0x2d')][_0x3e4c('0x2e')]('text')&&!_0x5d2728[_0x3e4c('0x2d')][_0x3e4c('0x2e')](_0x3e4c('0x2f'))){throw new db[(_0x3e4c('0x30'))][(_0x3e4c('0x31'))](_0x3e4c('0x32'));}else{if(_0x5d2728[_0x3e4c('0x2d')][_0x3e4c('0x2e')](_0x3e4c('0x2f'))&&!_0x5d2728[_0x3e4c('0x2d')][_0x3e4c('0x2e')]('view')){throw new db[(_0x3e4c('0x30'))]['ValidationError'](_0x3e4c('0x33'));}if(!_0x5d2728['body']['hasOwnProperty'](_0x3e4c('0x34'))){throw new db[(_0x3e4c('0x30'))][(_0x3e4c('0x31'))](_0x3e4c('0x35'));}else{try{var _0x3731e1=JSON['parse'](_0x5d2728[_0x3e4c('0x2d')][_0x3e4c('0x34')]);}catch(_0x1dbfc0){logger['error'](_0x1dbfc0);throw new db[(_0x3e4c('0x30'))][(_0x3e4c('0x31'))](_0x3e4c('0x36'));}var _0x31d572=[_0x3e4c('0x37'),_0x3e4c('0x38'),'mailqueue',_0x3e4c('0x39'),_0x3e4c('0x3a'),_0x3e4c('0x3b'),_0x3e4c('0x3c'),_0x3e4c('0x3d'),_0x3e4c('0x3e')];if(_[_0x3e4c('0x3f')](_0x3731e1,function(_0x553c98){return!_[_0x3e4c('0x40')](_0x31d572,_0x553c98[_0x3e4c('0x41')][_0x3e4c('0x42')]());})){throw new db['Sequelize']['ValidationError'](_0x3e4c('0x43'));}}}var _0x34fccb={};_0x34fccb[_0x3e4c('0x44')]=_0x5d2728['body']['hasOwnProperty'](_0x3e4c('0x44'))?_0x5d2728[_0x3e4c('0x2d')][_0x3e4c('0x44')]:_0x5d2728['user'][_0x3e4c('0x45')];_0x34fccb[_0x3e4c('0x46')]=_[_0x3e4c('0x47')](_0x5d2728[_0x3e4c('0x2d')]['recipientsDescription'])?null:_0x5d2728[_0x3e4c('0x2d')][_0x3e4c('0x46')];_0x34fccb[_0x3e4c('0x48')]=_0x5d2728['body'][_0x3e4c('0x48')]||![];_0x34fccb[_0x3e4c('0x49')]=_0x5d2728['user']['id'];return getContent(_0x5d2728['body'])['then'](function(_0x2a6ec9){_0x34fccb[_0x3e4c('0x2d')]=_0x2a6ec9;return getRecipients(_0x3731e1);})[_0x3e4c('0x27')](function(_0x1362af){_0x34fccb[_0x3e4c('0x4a')]=_[_0x3e4c('0x4b')](_0x1362af)[_0x3e4c('0x4c')](',');return db[_0x3e4c('0x4d')]['transaction'](function(_0x450782){return db[_0x3e4c('0x4e')][_0x3e4c('0x4f')](_0x34fccb,{'raw':!![],'transaction':_0x450782})[_0x3e4c('0x27')](function(_0x595e7a){var _0x7e07ef={'sender':_0x34fccb[_0x3e4c('0x44')],'description':_0x34fccb[_0x3e4c('0x46')],'content':_0x34fccb[_0x3e4c('0x2d')],'beep':_0x34fccb[_0x3e4c('0x48')]};_0x1362af[_0x3e4c('0x50')](function(_0x2c3b15){_0x7e07ef[_0x3e4c('0x51')]=_0x2c3b15;socket['emit'](_0x3e4c('0x52'),_0x7e07ef);});return _0x595e7a;});});})[_0x3e4c('0x27')](respondWithResult(_0x4501b4,0xc9))[_0x3e4c('0x53')](handleError(_0x4501b4,null));};function getContent(_0x205f8f){return new BPromise(function(_0x363d20,_0x1e3a6d){if(_0x205f8f[_0x3e4c('0x54')]){_0x363d20(_0x205f8f['text']);return;}return db['Template']['findOne']({'attributes':[_0x3e4c('0x55')],'where':{'id':_0x205f8f[_0x3e4c('0x2f')]},'raw':!![]})[_0x3e4c('0x27')](function(_0x6a05bf){if(!_0x6a05bf)throw new db[(_0x3e4c('0x30'))][(_0x3e4c('0x31'))](_0x3e4c('0x56'));var _0x5a8766=Mustache[_0x3e4c('0x57')](_0x6a05bf[_0x3e4c('0x55')],_0x205f8f['view']);_0x363d20(_0x5a8766);})[_0x3e4c('0x53')](function(_0x4ed430){_0x1e3a6d(_0x4ed430);});});}function getRecipients(_0x465f48){return new BPromise(function(_0x25c12b,_0x171661){var _0x5cd234=[];var _0x3c86e8=[];_0x465f48[_0x3e4c('0x50')](function(_0x1c953f){var _0x21abd1=_[_0x3e4c('0x58')](_0x1c953f[_0x3e4c('0x41')]['toLowerCase']());if(_0x21abd1===_0x3e4c('0x59')){_0x5cd234=_[_0x3e4c('0x5a')](_0x5cd234,_0x1c953f[_0x3e4c('0x5b')]);}else{if(_['includes'](_0x21abd1,_0x3e4c('0x5c')))_0x21abd1=_0x21abd1['replace'](_0x3e4c('0x5c'),_0x3e4c('0x5d'));_0x1c953f[_0x3e4c('0x5b')][_0x3e4c('0x50')](function(_0x2155d2){_0x3c86e8['push'](getAgents(_0x21abd1,_0x2155d2));});}});return BPromise[_0x3e4c('0x5e')](_0x3c86e8)[_0x3e4c('0x27')](function(_0x12a5c6){_0x5cd234=_[_0x3e4c('0x5a')](_0x5cd234,_[_0x3e4c('0x5f')](_0x12a5c6));_0x25c12b(_0x5cd234);})[_0x3e4c('0x53')](function(_0x1e1f94){_0x171661(_0x1e1f94);});});}function getAgents(_0x487bf9,_0x5bf2fc){return new BPromise(function(_0x330900,_0x503d48){return db[_0x487bf9][_0x3e4c('0x60')]({'where':{'id':_0x5bf2fc}})[_0x3e4c('0x27')](function(_0x56578d){return _0x56578d[_0x3e4c('0x61')]({'attributes':['id'],'raw':!![]})[_0x3e4c('0x27')](function(_0x4aed2b){var _0x284a86=_[_0x3e4c('0x62')](_0x4aed2b,'id');_0x330900(_0x284a86);});})['catch'](function(_0x39361c){_0x503d48(_0x39361c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index ab1f169..2ba0fcf 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 _0x247f=['remove','emit','hasOwnProperty','hook','exports','events','UserNotification','save'];(function(_0x5b46be,_0x1b24f1){var _0xb01664=function(_0x6a4b70){while(--_0x6a4b70){_0x5b46be['push'](_0x5b46be['shift']());}};_0xb01664(++_0x1b24f1);}(_0x247f,0x15d));var _0xf247=function(_0x52cab4,_0x473e1b){_0x52cab4=_0x52cab4-0x0;var _0x49d485=_0x247f[_0x52cab4];return _0x49d485;};'use strict';var EventEmitter=require(_0xf247('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xf247('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf247('0x2'),'afterUpdate':'update','afterDestroy':_0xf247('0x3')};function emitEvent(_0x5bdcbc){return function(_0x30a822,_0x4b8297,_0x1e7bef){UserNotificationEvents[_0xf247('0x4')](_0x5bdcbc+':'+_0x30a822['id'],_0x30a822);UserNotificationEvents['emit'](_0x5bdcbc,_0x30a822);_0x1e7bef(null);};}for(var e in events){if(events[_0xf247('0x5')](e)){var event=events[e];UserNotification[_0xf247('0x6')](e,emitEvent(event));}}module[_0xf247('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xfa09=['UserNotification','save','remove','emit','exports','events','../../mysqldb'];(function(_0x2a0dc9,_0x3802f4){var _0x198be1=function(_0x154add){while(--_0x154add){_0x2a0dc9['push'](_0x2a0dc9['shift']());}};_0x198be1(++_0x3802f4);}(_0xfa09,0x18d));var _0x9fa0=function(_0x127bcf,_0x464660){_0x127bcf=_0x127bcf-0x0;var _0x1dd8d8=_0xfa09[_0x127bcf];return _0x1dd8d8;};'use strict';var EventEmitter=require(_0x9fa0('0x0'));var UserNotification=require(_0x9fa0('0x1'))['db'][_0x9fa0('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9fa0('0x3'),'afterUpdate':'update','afterDestroy':_0x9fa0('0x4')};function emitEvent(_0x245b65){return function(_0x5ba2f3,_0x152a9f,_0x20ea7a){UserNotificationEvents[_0x9fa0('0x5')](_0x245b65+':'+_0x5ba2f3['id'],_0x5ba2f3);UserNotificationEvents[_0x9fa0('0x5')](_0x245b65,_0x5ba2f3);_0x20ea7a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x9fa0('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 95d3b70..f7827af 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 _0x4a39=['./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4114dd,_0x2ad862){var _0x26f44c=function(_0xad2246){while(--_0xad2246){_0x4114dd['push'](_0x4114dd['shift']());}};_0x26f44c(++_0x2ad862);}(_0x4a39,0x65));var _0x94a3=function(_0x491eb3,_0x5b2726){_0x491eb3=_0x491eb3-0x0;var _0x18a4a5=_0x4a39[_0x491eb3];return _0x18a4a5;};'use strict';var _=require(_0x94a3('0x0'));var util=require('util');var logger=require(_0x94a3('0x1'))('api');var moment=require(_0x94a3('0x2'));var BPromise=require(_0x94a3('0x3'));var rp=require(_0x94a3('0x4'));var fs=require('fs');var path=require(_0x94a3('0x5'));var rimraf=require(_0x94a3('0x6'));var config=require('../../config/environment');var attributes=require(_0x94a3('0x7'));module['exports']=function(_0x415e52,_0x5d6887){return _0x415e52[_0x94a3('0x8')](_0x94a3('0x9'),attributes,{'tableName':_0x94a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x94a3('0xb')});}; \ No newline at end of file +var _0xc681=['bluebird','request-promise','path','rimraf','./userNotification.attributes','define','UserNotification','userNotifications','../../config/logger','api','moment'];(function(_0x49a4b5,_0x420d0c){var _0x343547=function(_0xdd6b78){while(--_0xdd6b78){_0x49a4b5['push'](_0x49a4b5['shift']());}};_0x343547(++_0x420d0c);}(_0xc681,0x1cb));var _0x1c68=function(_0xf02da3,_0xd8078d){_0xf02da3=_0xf02da3-0x0;var _0x5eadbd=_0xc681[_0xf02da3];return _0x5eadbd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c68('0x0'))(_0x1c68('0x1'));var moment=require(_0x1c68('0x2'));var BPromise=require(_0x1c68('0x3'));var rp=require(_0x1c68('0x4'));var fs=require('fs');var path=require(_0x1c68('0x5'));var rimraf=require(_0x1c68('0x6'));var config=require('../../config/environment');var attributes=require(_0x1c68('0x7'));module['exports']=function(_0x2de777,_0x2cf9fc){return _0x2de777[_0x1c68('0x8')](_0x1c68('0x9'),attributes,{'tableName':_0x1c68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 679c26c..cae9b27 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 _0x9ace=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4921d5,_0x2e52c5){var _0x25a0fe=function(_0x31acfd){while(--_0x31acfd){_0x4921d5['push'](_0x4921d5['shift']());}};_0x25a0fe(++_0x2e52c5);}(_0x9ace,0x12a));var _0xe9ac=function(_0x473db8,_0x19a2eb){_0x473db8=_0x473db8-0x0;var _0x27334e=_0x9ace[_0x473db8];return _0x27334e;};'use strict';var _=require(_0xe9ac('0x0'));var util=require(_0xe9ac('0x1'));var moment=require(_0xe9ac('0x2'));var BPromise=require(_0xe9ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9ac('0x5'))(_0xe9ac('0x6'));var config=require(_0xe9ac('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe9ac('0x8')][_0xe9ac('0x9')]({'port':0x232a});config[_0xe9ac('0xa')]=_[_0xe9ac('0xb')](config[_0xe9ac('0xa')],{'host':_0xe9ac('0xc'),'port':0x18eb});var socket=require(_0xe9ac('0xd'))(new Redis(config[_0xe9ac('0xa')]));require('./userNotification.socket')[_0xe9ac('0xe')](socket);function respondWithRpcPromise(_0x45b4ea,_0x423ee5,_0x38cd54){return new BPromise(function(_0x541d86,_0x2e0b1e){return client[_0xe9ac('0xf')](_0x45b4ea,_0x38cd54)[_0xe9ac('0x10')](function(_0xafc3ef){logger[_0xe9ac('0x11')](_0xe9ac('0x12'),_0x423ee5,_0xe9ac('0x13'));logger['debug'](_0xe9ac('0x14'),_0x423ee5,_0xe9ac('0x13'),JSON[_0xe9ac('0x15')](_0xafc3ef));if(_0xafc3ef['error']){if(_0xafc3ef[_0xe9ac('0x16')][_0xe9ac('0x17')]===0x1f4){logger[_0xe9ac('0x16')](_0xe9ac('0x12'),_0x423ee5,_0xafc3ef[_0xe9ac('0x16')][_0xe9ac('0x18')]);return _0x2e0b1e(_0xafc3ef[_0xe9ac('0x16')]['message']);}logger[_0xe9ac('0x16')]('UserNotification,\x20%s,\x20%s',_0x423ee5,_0xafc3ef[_0xe9ac('0x16')]['message']);return _0x541d86(_0xafc3ef[_0xe9ac('0x16')][_0xe9ac('0x18')]);}else{logger[_0xe9ac('0x11')]('UserNotification,\x20%s,\x20%s',_0x423ee5,_0xe9ac('0x13'));_0x541d86(_0xafc3ef[_0xe9ac('0x19')][_0xe9ac('0x18')]);}})[_0xe9ac('0x1a')](function(_0x2f83fa){logger['error'](_0xe9ac('0x12'),_0x423ee5,_0x2f83fa);_0x2e0b1e(_0x2f83fa);});});} \ No newline at end of file +var _0x68eb=['error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./userNotification.socket','then','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x68eb,0x1be));var _0xb68e=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x68eb[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xb68e('0x0'));var util=require(_0xb68e('0x1'));var moment=require(_0xb68e('0x2'));var BPromise=require('bluebird');var rs=require(_0xb68e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb68e('0x4'))('rpc');var config=require(_0xb68e('0x5'));var jayson=require(_0xb68e('0x6'));var client=jayson[_0xb68e('0x7')][_0xb68e('0x8')]({'port':0x232a});config['redis']=_[_0xb68e('0x9')](config[_0xb68e('0xa')],{'host':_0xb68e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb68e('0xa')]));require(_0xb68e('0xc'))['register'](socket);function respondWithRpcPromise(_0x317a5c,_0x66b0ad,_0x51b50b){return new BPromise(function(_0x2d6cd7,_0x56dc0e){return client['request'](_0x317a5c,_0x51b50b)[_0xb68e('0xd')](function(_0x57cb5b){logger['info'](_0xb68e('0xe'),_0x66b0ad,'request\x20sent');logger['debug'](_0xb68e('0xf'),_0x66b0ad,'request\x20sent',JSON['stringify'](_0x57cb5b));if(_0x57cb5b[_0xb68e('0x10')]){if(_0x57cb5b[_0xb68e('0x10')][_0xb68e('0x11')]===0x1f4){logger[_0xb68e('0x10')](_0xb68e('0xe'),_0x66b0ad,_0x57cb5b[_0xb68e('0x10')][_0xb68e('0x12')]);return _0x56dc0e(_0x57cb5b[_0xb68e('0x10')][_0xb68e('0x12')]);}logger[_0xb68e('0x10')](_0xb68e('0xe'),_0x66b0ad,_0x57cb5b[_0xb68e('0x10')]['message']);return _0x2d6cd7(_0x57cb5b['error'][_0xb68e('0x12')]);}else{logger['info'](_0xb68e('0xe'),_0x66b0ad,_0xb68e('0x13'));_0x2d6cd7(_0x57cb5b[_0xb68e('0x14')][_0xb68e('0x12')]);}})[_0xb68e('0x15')](function(_0x5c2835){logger[_0xb68e('0x10')](_0xb68e('0xe'),_0x66b0ad,_0x5c2835);_0x56dc0e(_0x5c2835);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index c4bb269..1fa1f70 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 _0x26e5=['remove','update','emit','removeListener','register','length','userNotification:','save'];(function(_0x128641,_0x1ec4c1){var _0x228d4c=function(_0x13604e){while(--_0x13604e){_0x128641['push'](_0x128641['shift']());}};_0x228d4c(++_0x1ec4c1);}(_0x26e5,0x16f));var _0x526e=function(_0x37b0da,_0x42982f){_0x37b0da=_0x37b0da-0x0;var _0x18c5b6=_0x26e5[_0x37b0da];return _0x18c5b6;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x526e('0x0'),_0x526e('0x1'),_0x526e('0x2')];function createListener(_0x12a16e,_0x1808f8){return function(_0xea8e8b){_0x1808f8[_0x526e('0x3')](_0x12a16e,_0xea8e8b);};}function removeListener(_0x389032,_0xa07b0f){return function(){UserNotificationEvents[_0x526e('0x4')](_0x389032,_0xa07b0f);};}exports[_0x526e('0x5')]=function(_0x22e0c6){for(var _0x1cb2e2=0x0,_0x1fcb05=events[_0x526e('0x6')];_0x1cb2e2<_0x1fcb05;_0x1cb2e2++){var _0x1448c4=events[_0x1cb2e2];var _0xdf75ca=createListener(_0x526e('0x7')+_0x1448c4,_0x22e0c6);UserNotificationEvents['on'](_0x1448c4,_0xdf75ca);}}; \ No newline at end of file +var _0x15d5=['update','emit','removeListener','register','save','remove'];(function(_0x3dda0f,_0x5b9902){var _0x1b0488=function(_0x267031){while(--_0x267031){_0x3dda0f['push'](_0x3dda0f['shift']());}};_0x1b0488(++_0x5b9902);}(_0x15d5,0x1ea));var _0x515d=function(_0x5e4329,_0x5aa0b7){_0x5e4329=_0x5e4329-0x0;var _0x178707=_0x15d5[_0x5e4329];return _0x178707;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x515d('0x0'),_0x515d('0x1'),_0x515d('0x2')];function createListener(_0x1d1f2f,_0x16e452){return function(_0x277368){_0x16e452[_0x515d('0x3')](_0x1d1f2f,_0x277368);};}function removeListener(_0x52f80b,_0x200f92){return function(){UserNotificationEvents[_0x515d('0x4')](_0x52f80b,_0x200f92);};}exports[_0x515d('0x5')]=function(_0x21127b){for(var _0x36d1be=0x0,_0x3b03c9=events['length'];_0x36d1be<_0x3b03c9;_0x36d1be++){var _0x42ad2d=events[_0x36d1be];var _0x37103c=createListener('userNotification:'+_0x42ad2d,_0x21127b);UserNotificationEvents['on'](_0x42ad2d,_0x37103c);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 74809d3..30aa0bf 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4ed9af,_0x54ae7b){var _0xd57256=function(_0x344558){while(--_0x344558){_0x4ed9af['push'](_0x4ed9af['shift']());}};_0xd57256(++_0x54ae7b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x855676,_0x130028){var _0xcbcac0=function(_0x5206a6){while(--_0x5206a6){_0x855676['push'](_0x855676['shift']());}};_0xcbcac0(++_0x130028);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 0d212a9..10fb286 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 _0x9d26=['exports','sequelize'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x9d26,0xf7));var _0x69d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9d26[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x69d2('0x0'));module[_0x69d2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x067b=['exports'];(function(_0x47ef60,_0x422b2c){var _0x40f95a=function(_0x605bac){while(--_0x605bac){_0x47ef60['push'](_0x47ef60['shift']());}};_0x40f95a(++_0x422b2c);}(_0x067b,0x1c5));var _0xb067=function(_0x5588eb,_0x5a00f2){_0x5588eb=_0x5588eb-0x0;var _0x235185=_0x067b[_0x5588eb];return _0x235185;};'use strict';var Sequelize=require('sequelize');module[_0xb067('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 78e943b..49d5033 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 _0xd696=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x604784,_0x355c8f){var _0x5cdb0f=function(_0x50e8cc){while(--_0x50e8cc){_0x604784['push'](_0x604784['shift']());}};_0x5cdb0f(++_0x355c8f);}(_0xd696,0x18e));var _0x6d69=function(_0x2967b4,_0x9b5a9b){_0x2967b4=_0x2967b4-0x0;var _0x483322=_0xd696[_0x2967b4];return _0x483322;};'use strict';var _=require(_0x6d69('0x0'));var util=require(_0x6d69('0x1'));var logger=require(_0x6d69('0x2'))(_0x6d69('0x3'));var moment=require('moment');var BPromise=require(_0x6d69('0x4'));var rp=require(_0x6d69('0x5'));var fs=require('fs');var path=require(_0x6d69('0x6'));var rimraf=require(_0x6d69('0x7'));var config=require(_0x6d69('0x8'));var attributes=require(_0x6d69('0x9'));module[_0x6d69('0xa')]=function(_0x215067,_0x2bba69){return _0x215067[_0x6d69('0xb')](_0x6d69('0xc'),attributes,{'tableName':_0x6d69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d60=['UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0x395a3b,_0x11d627){var _0x4968d7=function(_0x5aa8e){while(--_0x5aa8e){_0x395a3b['push'](_0x395a3b['shift']());}};_0x4968d7(++_0x11d627);}(_0x4d60,0x80));var _0x04d6=function(_0x272552,_0x2aae7c){_0x272552=_0x272552-0x0;var _0x3bb392=_0x4d60[_0x272552];return _0x3bb392;};'use strict';var _=require('lodash');var util=require(_0x04d6('0x0'));var logger=require(_0x04d6('0x1'))(_0x04d6('0x2'));var moment=require(_0x04d6('0x3'));var BPromise=require(_0x04d6('0x4'));var rp=require(_0x04d6('0x5'));var fs=require('fs');var path=require(_0x04d6('0x6'));var rimraf=require(_0x04d6('0x7'));var config=require(_0x04d6('0x8'));var attributes=require(_0x04d6('0x9'));module[_0x04d6('0xa')]=function(_0x1be972,_0x247042){return _0x1be972[_0x04d6('0xb')](_0x04d6('0xc'),attributes,{'tableName':_0x04d6('0xd'),'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 09405a4..414b2a1 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 _0xb658=['jayson/promise','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x307910,_0x2a6435){var _0x50c336=function(_0x25f652){while(--_0x25f652){_0x307910['push'](_0x307910['shift']());}};_0x50c336(++_0x2a6435);}(_0xb658,0xac));var _0x8b65=function(_0x12b60f,_0xc7958d){_0x12b60f=_0x12b60f-0x0;var _0x19235d=_0xb658[_0x12b60f];return _0x19235d;};'use strict';var _=require(_0x8b65('0x0'));var util=require(_0x8b65('0x1'));var moment=require(_0x8b65('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b65('0x3'));var fs=require('fs');var Redis=require(_0x8b65('0x4'));var db=require(_0x8b65('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b65('0x6'))('rpc');var config=require(_0x8b65('0x7'));var jayson=require(_0x8b65('0x8'));var client=jayson[_0x8b65('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f2d87,_0x515c0c,_0xd3035f){return new BPromise(function(_0xa41c70,_0x39e9bc){return client['request'](_0x5f2d87,_0xd3035f)[_0x8b65('0xa')](function(_0xa3454f){logger[_0x8b65('0xb')](_0x8b65('0xc'),_0x515c0c,_0x8b65('0xd'));logger['debug'](_0x8b65('0xe'),_0x515c0c,'request\x20sent',JSON[_0x8b65('0xf')](_0xa3454f));if(_0xa3454f['error']){if(_0xa3454f['error'][_0x8b65('0x10')]===0x1f4){logger[_0x8b65('0x11')](_0x8b65('0xc'),_0x515c0c,_0xa3454f[_0x8b65('0x11')][_0x8b65('0x12')]);return _0x39e9bc(_0xa3454f[_0x8b65('0x11')]['message']);}logger[_0x8b65('0x11')](_0x8b65('0xc'),_0x515c0c,_0xa3454f[_0x8b65('0x11')][_0x8b65('0x12')]);return _0xa41c70(_0xa3454f[_0x8b65('0x11')][_0x8b65('0x12')]);}else{logger[_0x8b65('0xb')](_0x8b65('0xc'),_0x515c0c,_0x8b65('0xd'));_0xa41c70(_0xa3454f['result'][_0x8b65('0x12')]);}})[_0x8b65('0x13')](function(_0x4731a2){logger[_0x8b65('0x11')](_0x8b65('0xc'),_0x515c0c,_0x4731a2);_0x39e9bc(_0x4731a2);});});} \ No newline at end of file +var _0xafbf=['code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0xc6a78,_0x4c31ee){var _0x1eaf5b=function(_0x599e36){while(--_0x599e36){_0xc6a78['push'](_0xc6a78['shift']());}};_0x1eaf5b(++_0x4c31ee);}(_0xafbf,0x97));var _0xfafb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xafbf[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xfafb('0x0'));var util=require(_0xfafb('0x1'));var moment=require('moment');var BPromise=require(_0xfafb('0x2'));var rs=require(_0xfafb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfafb('0x4'))['db'];var utils=require(_0xfafb('0x5'));var logger=require(_0xfafb('0x6'))('rpc');var config=require(_0xfafb('0x7'));var jayson=require(_0xfafb('0x8'));var client=jayson[_0xfafb('0x9')][_0xfafb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19d6a2,_0x3216a9,_0x5182f8){return new BPromise(function(_0x4847e6,_0x3f667e){return client['request'](_0x19d6a2,_0x5182f8)['then'](function(_0x402024){logger[_0xfafb('0xb')](_0xfafb('0xc'),_0x3216a9,'request\x20sent');logger[_0xfafb('0xd')](_0xfafb('0xe'),_0x3216a9,_0xfafb('0xf'),JSON['stringify'](_0x402024));if(_0x402024[_0xfafb('0x10')]){if(_0x402024[_0xfafb('0x10')][_0xfafb('0x11')]===0x1f4){logger[_0xfafb('0x10')](_0xfafb('0xc'),_0x3216a9,_0x402024[_0xfafb('0x10')][_0xfafb('0x12')]);return _0x3f667e(_0x402024[_0xfafb('0x10')][_0xfafb('0x12')]);}logger['error'](_0xfafb('0xc'),_0x3216a9,_0x402024[_0xfafb('0x10')][_0xfafb('0x12')]);return _0x4847e6(_0x402024[_0xfafb('0x10')][_0xfafb('0x12')]);}else{logger[_0xfafb('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3216a9,_0xfafb('0xf'));_0x4847e6(_0x402024[_0xfafb('0x13')][_0xfafb('0x12')]);}})[_0xfafb('0x14')](function(_0x4a7ab8){logger[_0xfafb('0x10')](_0xfafb('0xc'),_0x3216a9,_0x4a7ab8);_0x3f667e(_0x4a7ab8);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 0e0c1f6..0e367ca 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 _0x8cb4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','addSections','addResources','update','delete','destroy','removeSections','removeResources','multer','path'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8cb4,0x6e));var _0x48cb=function(_0x591575,_0x7c4dc0){_0x591575=_0x591575-0x0;var _0x23e3bb=_0x8cb4[_0x591575];return _0x23e3bb;};'use strict';var multer=require(_0x48cb('0x0'));var util=require('util');var path=require(_0x48cb('0x1'));var timeout=require('connect-timeout');var express=require(_0x48cb('0x2'));var router=express[_0x48cb('0x3')]();var fs_extra=require(_0x48cb('0x4'));var auth=require(_0x48cb('0x5'));var interaction=require(_0x48cb('0x6'));var config=require(_0x48cb('0x7'));var controller=require(_0x48cb('0x8'));router[_0x48cb('0x9')]('/',auth[_0x48cb('0xa')](),controller[_0x48cb('0xb')]);router['get'](_0x48cb('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x48cb('0x9')](_0x48cb('0xd'),auth[_0x48cb('0xa')](),controller[_0x48cb('0xe')]);router['get'](_0x48cb('0xf'),auth[_0x48cb('0xa')](),controller[_0x48cb('0x10')]);router[_0x48cb('0x9')](_0x48cb('0x11'),auth['isAuthenticated'](),controller['getResources']);router[_0x48cb('0x12')]('/',auth[_0x48cb('0xa')](),controller[_0x48cb('0x13')]);router[_0x48cb('0x12')](_0x48cb('0x14'),auth['isAuthenticated'](),controller['clone']);router[_0x48cb('0x12')](_0x48cb('0xf'),auth[_0x48cb('0xa')](),controller[_0x48cb('0x15')]);router[_0x48cb('0x12')]('/:id/resources',auth[_0x48cb('0xa')](),controller[_0x48cb('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x48cb('0x17')]);router[_0x48cb('0x18')](_0x48cb('0xd'),auth[_0x48cb('0xa')](),controller[_0x48cb('0x19')]);router[_0x48cb('0x18')](_0x48cb('0xf'),auth['isAuthenticated'](),controller[_0x48cb('0x1a')]);router[_0x48cb('0x18')](_0x48cb('0x11'),auth[_0x48cb('0xa')](),controller[_0x48cb('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x2e4b=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','getSections','/:id/resources','create','post','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources'];(function(_0x23ef1f,_0x127dd2){var _0x234192=function(_0x2d83da){while(--_0x2d83da){_0x23ef1f['push'](_0x23ef1f['shift']());}};_0x234192(++_0x127dd2);}(_0x2e4b,0x187));var _0xb2e4=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x2e4b[_0x2a5099];return _0x2802f1;};'use strict';var multer=require(_0xb2e4('0x0'));var util=require(_0xb2e4('0x1'));var path=require('path');var timeout=require(_0xb2e4('0x2'));var express=require(_0xb2e4('0x3'));var router=express[_0xb2e4('0x4')]();var fs_extra=require(_0xb2e4('0x5'));var auth=require(_0xb2e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb2e4('0x7'));var controller=require(_0xb2e4('0x8'));router[_0xb2e4('0x9')]('/',auth[_0xb2e4('0xa')](),controller['index']);router[_0xb2e4('0x9')](_0xb2e4('0xb'),auth[_0xb2e4('0xa')](),controller[_0xb2e4('0xc')]);router[_0xb2e4('0x9')](_0xb2e4('0xd'),auth[_0xb2e4('0xa')](),controller[_0xb2e4('0xe')]);router[_0xb2e4('0x9')]('/:id/sections',auth['isAuthenticated'](),controller[_0xb2e4('0xf')]);router[_0xb2e4('0x9')](_0xb2e4('0x10'),auth[_0xb2e4('0xa')](),controller['getResources']);router['post']('/',auth[_0xb2e4('0xa')](),controller[_0xb2e4('0x11')]);router[_0xb2e4('0x12')](_0xb2e4('0x13'),auth[_0xb2e4('0xa')](),controller[_0xb2e4('0x14')]);router['post']('/:id/sections',auth['isAuthenticated'](),controller[_0xb2e4('0x15')]);router[_0xb2e4('0x12')]('/:id/resources',auth[_0xb2e4('0xa')](),controller[_0xb2e4('0x16')]);router[_0xb2e4('0x17')]('/:id',auth[_0xb2e4('0xa')](),controller[_0xb2e4('0x18')]);router[_0xb2e4('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xb2e4('0x1a')]);router[_0xb2e4('0x19')]('/:id/sections',auth[_0xb2e4('0xa')](),controller[_0xb2e4('0x1b')]);router[_0xb2e4('0x19')](_0xb2e4('0x10'),auth['isAuthenticated'](),controller[_0xb2e4('0x1c')]);module[_0xb2e4('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index bafa343..105f105 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 _0x2a84=['name','setDataValue','crudPermissions','join','getDataValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x27285c,_0x110615){var _0x1bc9c2=function(_0x4fa3dd){while(--_0x4fa3dd){_0x27285c['push'](_0x27285c['shift']());}};_0x1bc9c2(++_0x110615);}(_0x2a84,0x97));var _0x42a8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2a84[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x42a8('0x0'));module[_0x42a8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x42a8('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4e4943){this[_0x42a8('0x3')](_0x42a8('0x4'),_0x4e4943?_0x4e4943[_0x42a8('0x5')](''):[]);},'get':function(){return this[_0x42a8('0x6')](_0x42a8('0x4'))?this[_0x42a8('0x6')](_0x42a8('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x42a8('0x7')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x42a8('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x42a8('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x42a8('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x42a8('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x42a8('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x42a8('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x42a8('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x42a8('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x007a=['STRING','name','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x2243cc,_0x1dbc6f){var _0x175f0b=function(_0x1a3512){while(--_0x1a3512){_0x2243cc['push'](_0x2243cc['shift']());}};_0x175f0b(++_0x1dbc6f);}(_0x007a,0x7c));var _0xa007=function(_0x181d2d,_0x480cc8){_0x181d2d=_0x181d2d-0x0;var _0x4a0cfc=_0x007a[_0x181d2d];return _0x4a0cfc;};'use strict';var Sequelize=require(_0xa007('0x0'));module[_0xa007('0x1')]={'name':{'type':Sequelize[_0xa007('0x2')],'allowNull':![],'unique':_0xa007('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xb3a527){this['setDataValue'](_0xa007('0x4'),_0xb3a527?_0xb3a527[_0xa007('0x5')](''):[]);},'get':function(){return this[_0xa007('0x6')](_0xa007('0x4'))?this['getDataValue'](_0xa007('0x4'))[_0xa007('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa007('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa007('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa007('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa007('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xa007('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa007('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa007('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa007('0x8')],'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 6090999..192f209 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 _0x18f3=['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','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','status','end','error','name','send','index','map','UserProfile','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','UserProfileSection','each','autoAssociation','sectionId','userProfileId','UserProfileResource','Resources','describe','addSections','push','ids','getSections','enabled','includes','isEmpty','subsections','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x4dfe8f,_0x15d58a){var _0x525088=function(_0x44c9a3){while(--_0x44c9a3){_0x4dfe8f['push'](_0x4dfe8f['shift']());}};_0x525088(++_0x15d58a);}(_0x18f3,0x19f));var _0x318f=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x18f3[_0x173441];return _0x2423a8;};'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'];config[_0x318f('0x18')]=_['defaults'](config['redis'],{'host':_0x318f('0x19'),'port':0x18eb});var socket=require(_0x318f('0x1a'))(new Redis(config[_0x318f('0x18')]));require(_0x318f('0x1b'))[_0x318f('0x1c')](socket);function respondWithStatusCode(_0x3dc225,_0x26bbab){_0x26bbab=_0x26bbab||0xcc;return function(_0x4e6b05){if(_0x4e6b05){return _0x3dc225[_0x318f('0x1d')](_0x26bbab);}return _0x3dc225['status'](_0x26bbab)['end']();};}function respondWithResult(_0x2651ec,_0x334d7d){_0x334d7d=_0x334d7d||0xc8;return function(_0x52706c){if(_0x52706c){return _0x2651ec['status'](_0x334d7d)[_0x318f('0x1e')](_0x52706c);}};}function respondWithFilteredResult(_0x56b0ed,_0x3b0932){return function(_0x1b67e4){if(_0x1b67e4){var _0x2ff62b=typeof _0x3b0932[_0x318f('0x1f')]===_0x318f('0x20')&&typeof _0x3b0932['limit']===_0x318f('0x20');var _0x1e4ca5=_0x1b67e4[_0x318f('0x21')];var _0x7085b5=_0x2ff62b?0x0:_0x3b0932[_0x318f('0x1f')];var _0x36aa6e=_0x2ff62b?_0x1b67e4[_0x318f('0x21')]:_0x3b0932[_0x318f('0x1f')]+_0x3b0932[_0x318f('0x22')];var _0x5b09a5;if(_0x36aa6e>=_0x1e4ca5){_0x36aa6e=_0x1e4ca5;_0x5b09a5=0xc8;}else{_0x5b09a5=0xce;}_0x56b0ed['status'](_0x5b09a5);return _0x56b0ed[_0x318f('0x23')](_0x318f('0x24'),_0x7085b5+'-'+_0x36aa6e+'/'+_0x1e4ca5)[_0x318f('0x1e')](_0x1b67e4);}return null;};}function patchUpdates(_0x5617f4){return function(_0x1762af){try{jsonpatch['apply'](_0x1762af,_0x5617f4,!![]);}catch(_0x414236){return BPromise['reject'](_0x414236);}return _0x1762af[_0x318f('0x25')]();};}function saveUpdates(_0x3c9aaa,_0x14e9ab){return function(_0x157b4a){if(_0x157b4a){return _0x157b4a[_0x318f('0x26')](_0x3c9aaa)[_0x318f('0x27')](function(_0x1a86fb){return _0x1a86fb;});}return null;};}function removeEntity(_0xfc6e23,_0x293b88){return function(_0x3fb022){if(_0x3fb022){return _0x3fb022[_0x318f('0x28')]()[_0x318f('0x27')](function(){_0xfc6e23[_0x318f('0x29')](0xcc)[_0x318f('0x2a')]();});}};}function handleEntityNotFound(_0xf2374f,_0x236766){return function(_0x2cab68){if(!_0x2cab68){_0xf2374f[_0x318f('0x1d')](0x194);}return _0x2cab68;};}function handleError(_0x2f326b,_0x3e82aa){_0x3e82aa=_0x3e82aa||0x1f4;return function(_0x1628de){logger[_0x318f('0x2b')](_0x1628de['stack']);if(_0x1628de[_0x318f('0x2c')]){delete _0x1628de['name'];}_0x2f326b[_0x318f('0x29')](_0x3e82aa)[_0x318f('0x2d')](_0x1628de);};}exports[_0x318f('0x2e')]=function(_0x3fe614,_0x17fcf1){var _0x1547f4={},_0x44cb65={},_0x253e2e={'count':0x0,'rows':[]};var _0x3a2103=_[_0x318f('0x2f')](db[_0x318f('0x30')][_0x318f('0x31')],function(_0x396a00){return{'name':_0x396a00['fieldName'],'type':_0x396a00[_0x318f('0x32')]['key']};});_0x44cb65[_0x318f('0x33')]=_['map'](_0x3a2103,_0x318f('0x2c'));_0x44cb65[_0x318f('0x34')]=_[_0x318f('0x35')](_0x3fe614['query']);_0x44cb65[_0x318f('0x36')]=_[_0x318f('0x37')](_0x44cb65[_0x318f('0x33')],_0x44cb65['query']);_0x1547f4[_0x318f('0x38')]=_['intersection'](_0x44cb65[_0x318f('0x33')],qs[_0x318f('0x39')](_0x3fe614['query']['fields']));_0x1547f4[_0x318f('0x38')]=_0x1547f4['attributes'][_0x318f('0x3a')]?_0x1547f4[_0x318f('0x38')]:_0x44cb65[_0x318f('0x33')];if(!_0x3fe614[_0x318f('0x34')][_0x318f('0x3b')](_0x318f('0x3c'))){_0x1547f4[_0x318f('0x22')]=qs[_0x318f('0x22')](_0x3fe614[_0x318f('0x34')][_0x318f('0x22')]);_0x1547f4[_0x318f('0x1f')]=qs[_0x318f('0x1f')](_0x3fe614[_0x318f('0x34')]['offset']);}_0x1547f4['order']=qs['sort'](_0x3fe614[_0x318f('0x34')]['sort']);_0x1547f4[_0x318f('0x3d')]=qs['filters'](_[_0x318f('0x3e')](_0x3fe614['query'],_0x44cb65[_0x318f('0x36')]),_0x3a2103);if(_0x3fe614['query']['filter']){_0x1547f4[_0x318f('0x3d')]=_['merge'](_0x1547f4[_0x318f('0x3d')],{'$or':_['map'](_0x3a2103,function(_0x6e4d61){if(_0x6e4d61[_0x318f('0x32')]!==_0x318f('0x3f')){var _0x42987d={};_0x42987d[_0x6e4d61['name']]={'$like':'%'+_0x3fe614[_0x318f('0x34')][_0x318f('0x40')]+'%'};return _0x42987d;}})});}_0x1547f4=_[_0x318f('0x41')]({},_0x1547f4,_0x3fe614[_0x318f('0x42')]);var _0x99fdfe={'where':_0x1547f4[_0x318f('0x3d')]};return db[_0x318f('0x30')][_0x318f('0x21')](_0x99fdfe)[_0x318f('0x27')](function(_0x370929){_0x253e2e[_0x318f('0x21')]=_0x370929;if(_0x3fe614[_0x318f('0x34')]['includeAll']){_0x1547f4[_0x318f('0x43')]=[{'all':!![]}];}return db[_0x318f('0x30')][_0x318f('0x44')](_0x1547f4);})[_0x318f('0x27')](function(_0x6a4876){_0x253e2e['rows']=_0x6a4876;return _0x253e2e;})['then'](respondWithFilteredResult(_0x17fcf1,_0x1547f4))[_0x318f('0x45')](handleError(_0x17fcf1,null));};exports[_0x318f('0x46')]=function(_0xc17409,_0x47fcbc){var _0x221d80={'raw':![],'where':{'id':_0xc17409[_0x318f('0x47')]['id']}},_0x41c1fe={};_0x41c1fe['model']=_['keys'](db[_0x318f('0x30')][_0x318f('0x31')]);_0x41c1fe[_0x318f('0x34')]=_[_0x318f('0x35')](_0xc17409[_0x318f('0x34')]);_0x41c1fe[_0x318f('0x36')]=_[_0x318f('0x37')](_0x41c1fe[_0x318f('0x33')],_0x41c1fe[_0x318f('0x34')]);_0x221d80[_0x318f('0x38')]=_['intersection'](_0x41c1fe[_0x318f('0x33')],qs[_0x318f('0x39')](_0xc17409[_0x318f('0x34')][_0x318f('0x39')]));_0x221d80[_0x318f('0x38')]=_0x221d80[_0x318f('0x38')]['length']?_0x221d80[_0x318f('0x38')]:_0x41c1fe[_0x318f('0x33')];if(_0xc17409[_0x318f('0x34')][_0x318f('0x48')]){_0x221d80[_0x318f('0x43')]=[{'all':!![]}];}_0x221d80=_['merge']({},_0x221d80,_0xc17409[_0x318f('0x42')]);return db[_0x318f('0x30')][_0x318f('0x49')](_0x221d80)['then'](handleEntityNotFound(_0x47fcbc,null))['then'](respondWithResult(_0x47fcbc,null))['catch'](handleError(_0x47fcbc,null));};exports[_0x318f('0x4a')]=function(_0x5c4d3e,_0x572fb1){return db[_0x318f('0x30')][_0x318f('0x4a')](_0x5c4d3e['body'],{})[_0x318f('0x27')](respondWithResult(_0x572fb1,0xc9))[_0x318f('0x45')](handleError(_0x572fb1,null));};exports['clone']=function(_0x212c3a,_0x33c948){var _0x30e8bd={'where':{'id':_0x212c3a[_0x318f('0x47')]['id']}},_0x39b194={};_0x39b194[_0x318f('0x33')]=_['keys'](db['UserProfile']['rawAttributes']);_0x30e8bd[_0x318f('0x38')]=_[_0x318f('0x37')](_0x39b194[_0x318f('0x33')],qs['fields'](_0x212c3a[_0x318f('0x34')][_0x318f('0x39')]));_0x30e8bd[_0x318f('0x38')]=_0x30e8bd['attributes']['length']?_0x30e8bd[_0x318f('0x38')]:_0x39b194[_0x318f('0x33')];if(_0x212c3a[_0x318f('0x34')][_0x318f('0x48')]){_0x30e8bd[_0x318f('0x43')]=[{'all':!![]}];}_0x30e8bd=_['merge']({},_0x30e8bd,_0x212c3a[_0x318f('0x42')]);return db[_0x318f('0x30')][_0x318f('0x49')](_0x30e8bd)[_0x318f('0x27')](handleEntityNotFound(_0x33c948,null))[_0x318f('0x27')](function(_0x571cc6){if(_0x571cc6){var _0x5a59de=_0x571cc6[_0x318f('0x4b')]({'plain':!![]});_0x5a59de=qs[_0x318f('0x4c')](_0x5a59de,['id',_0x318f('0x4d'),_0x318f('0x4e'),_0x318f('0x4f')]);_0x212c3a[_0x318f('0x50')]=_[_0x318f('0x4c')](_0x212c3a[_0x318f('0x50')],['id',_0x318f('0x4d'),_0x318f('0x4e')]);return db[_0x318f('0x51')]['transaction'](function(_0x5178c8){return db['UserProfile'][_0x318f('0x4a')](_[_0x318f('0x41')](_0x5a59de,_0x212c3a[_0x318f('0x50')]),{'include':_0x212c3a[_0x318f('0x34')][_0x318f('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x5178c8})['then'](function(_0x206860){var _0x48598c=_0x206860[_0x318f('0x4b')]({'plain':!![]});return db[_0x318f('0x52')][_0x318f('0x44')]({'where':{'userProfileId':_0x212c3a[_0x318f('0x47')]['id']},'raw':!![]})[_0x318f('0x27')](function(_0x1a6591){if(_0x1a6591){return BPromise[_0x318f('0x53')](_0x1a6591,function(_0xd38600){return new BPromise(function(_0x5db015,_0x3af030){if(_0xd38600[_0x318f('0x54')]===null||_0xd38600['autoAssociation']===0x1)_0x5db015(null);return db['UserProfileResource'][_0x318f('0x44')]({'where':{'sectionId':_0xd38600['id']},'raw':!![]})['then'](function(_0x2b988d){var _0x146751=_[_0x318f('0x2f')](_0x2b988d,function(_0x2bd263){return qs[_0x318f('0x4c')](_0x2bd263,['id',_0x318f('0x4d'),_0x318f('0x4e'),_0x318f('0x55')]);});_0x5db015(_0x146751);})['catch'](function(_0x42c62f){_0x3af030(_0x42c62f);});})[_0x318f('0x27')](function(_0x459814){var _0x3c0e24=qs['omit'](_0xd38600,['id',_0x318f('0x4d'),_0x318f('0x4e')]);_0x3c0e24[_0x318f('0x56')]=_0x48598c['id'];if(_0x459814)_0x3c0e24['Resources']=_0x459814;return _0x3c0e24;})[_0x318f('0x27')](function(_0x109a2e){return db[_0x318f('0x52')][_0x318f('0x4a')](_0x109a2e,{'include':[{'model':db[_0x318f('0x57')],'as':_0x318f('0x58')}],'raw':!![],'transaction':_0x5178c8});});})[_0x318f('0x27')](function(){return _0x48598c;});}});});});}})[_0x318f('0x27')](respondWithResult(_0x33c948,0xc9))[_0x318f('0x45')](handleError(_0x33c948,null));};exports[_0x318f('0x26')]=function(_0x1a5c35,_0x57ecab){if(_0x1a5c35[_0x318f('0x50')]['id']){delete _0x1a5c35[_0x318f('0x50')]['id'];}return db[_0x318f('0x30')]['find']({'where':{'id':_0x1a5c35[_0x318f('0x47')]['id']}})[_0x318f('0x27')](handleEntityNotFound(_0x57ecab,null))[_0x318f('0x27')](saveUpdates(_0x1a5c35[_0x318f('0x50')],null))[_0x318f('0x27')](respondWithResult(_0x57ecab,null))[_0x318f('0x45')](handleError(_0x57ecab,null));};exports[_0x318f('0x28')]=function(_0x4a5417,_0x2841bf){return db[_0x318f('0x30')]['find']({'where':{'id':_0x4a5417[_0x318f('0x47')]['id']}})[_0x318f('0x27')](handleEntityNotFound(_0x2841bf,null))[_0x318f('0x27')](removeEntity(_0x2841bf,null))['catch'](handleError(_0x2841bf,null));};exports[_0x318f('0x59')]=function(_0x1c235f,_0x496195){return db['UserProfile'][_0x318f('0x59')]()[_0x318f('0x27')](respondWithResult(_0x496195,null))[_0x318f('0x45')](handleError(_0x496195,null));};exports[_0x318f('0x5a')]=function(_0x52d322,_0x2ab13a){var _0x51e547=_0x52d322[_0x318f('0x50')];return db[_0x318f('0x30')][_0x318f('0x49')]({'where':{'id':_0x52d322[_0x318f('0x47')]['id']}})[_0x318f('0x27')](handleEntityNotFound(_0x2ab13a,null))[_0x318f('0x27')](function(_0xb00b0c){if(_0xb00b0c){return db['sequelize']['transaction'](function(_0x45cb93){return db[_0x318f('0x52')][_0x318f('0x28')]({'where':{'userProfileId':_0x52d322[_0x318f('0x47')]['id'],'sectionId':_[_0x318f('0x2f')](_0x51e547,function(_0x100303){return _0x100303[_0x318f('0x55')];})},'transaction':_0x45cb93})['then'](function(){var _0x3d635f=_['map'](_0x51e547,function(_0x37be3f){_0x37be3f[_0x318f('0x56')]=_0x52d322[_0x318f('0x47')]['id'];return _0x37be3f;});var _0x14fed6=[];return BPromise[_0x318f('0x53')](_0x3d635f,function(_0x44659e){return db[_0x318f('0x52')][_0x318f('0x4a')](_0x44659e,{'include':[{'model':db[_0x318f('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x45cb93})[_0x318f('0x27')](function(_0x13a95f){_0x14fed6[_0x318f('0x5b')](_0x13a95f[_0x318f('0x4b')]({'plain':!![]}));});})[_0x318f('0x27')](function(){return _0x14fed6;});});});}})[_0x318f('0x27')](function(_0x3a43af){return _0x3a43af;})[_0x318f('0x27')](respondWithResult(_0x2ab13a,null))[_0x318f('0x45')](handleError(_0x2ab13a,null));};exports['removeSections']=function(_0xf8e7fe,_0x1fdeeb){var _0x1cf56f;return db[_0x318f('0x30')]['find']({'where':{'id':_0xf8e7fe[_0x318f('0x47')]['id']},'attributes':['id',_0x318f('0x2c')]})[_0x318f('0x27')](handleEntityNotFound(_0x1fdeeb,null))[_0x318f('0x27')](function(_0x526a7d){if(_0x526a7d){_0x1cf56f=_0x526a7d;return db[_0x318f('0x52')][_0x318f('0x28')]({'where':{'userProfileId':_0xf8e7fe[_0x318f('0x47')]['id'],'sectionId':_0xf8e7fe[_0x318f('0x34')][_0x318f('0x5c')]}});}})[_0x318f('0x27')](function(){return _0x1cf56f;})['then'](respondWithStatusCode(_0x1fdeeb,null))[_0x318f('0x45')](handleError(_0x1fdeeb,null));};exports[_0x318f('0x5d')]=function(_0x3ccc6f,_0x3f8939){var _0xf35b84=[];var _0x2d012a=[];return db[_0x318f('0x52')][_0x318f('0x44')]({'where':{'userProfileId':_0x3ccc6f[_0x318f('0x47')]['id']},'raw':!![]})[_0x318f('0x27')](function(_0x164241){_0xf35b84=_['filter'](_0x164241,function(_0x4cd3b5){return _0x4cd3b5[_0x318f('0x5e')]===0x1||_[_0x318f('0x5f')]([0x3eb,0x709],_0x4cd3b5[_0x318f('0x55')]);});if(!_[_0x318f('0x60')](_0xf35b84)){return _['map'](_0xf35b84,function(_0x49931c){return _0x49931c[_0x318f('0x55')];});}else{return;}})[_0x318f('0x27')](function(_0x2eeca3){if(_0x2eeca3)_0x2d012a=_0x2eeca3;if(_[_0x318f('0x5f')](_0x2d012a,0x64)){var _0x375072=_[_0x318f('0x49')](_0xf35b84,{'sectionId':0x64});return hasDefaultDashboard(_0x375072)[_0x318f('0x27')](function(_0x294f6a){return _[_0x318f('0x2f')](_0xf35b84,function(_0x2e9826){if(_0x2e9826[_0x318f('0x55')]===0x64){_0x2e9826[_0x318f('0x61')]=_0x294f6a;}return _0x2e9826;});});}else{return;}})[_0x318f('0x27')](function(_0x46f36f){if(_0x46f36f)_0xf35b84=_0x46f36f;if(_['includes'](_0x2d012a,0x3eb)){var _0x18acc6=_[_0x318f('0x49')](_0xf35b84,{'sectionId':0x3eb});return getCustomDashboards(_0x18acc6)[_0x318f('0x27')](function(_0x376585){return _[_0x318f('0x2f')](_0xf35b84,function(_0x254ce1){if(_0x18acc6['enabled']){if(_0x254ce1['sectionId']===0x3eb){_0x254ce1[_0x318f('0x61')]=_0x376585;}}else{if(_0x254ce1[_0x318f('0x55')]===0x64){_0x254ce1['subsections']=_0x376585;}}return _0x254ce1;});});}else{return;}})[_0x318f('0x27')](function(_0x540856){if(_0x540856)_0xf35b84=_0x540856;if(_['includes'](_0x2d012a,0x709)){var _0x36b516=_[_0x318f('0x49')](_0xf35b84,{'sectionId':0x709});return getPlugins(_0x36b516)['then'](function(_0x42c0c5){if(_0x36b516[_0x318f('0x5e')]){return _['map'](_0xf35b84,function(_0x25a292){if(_0x25a292['sectionId']===0x709){_0x25a292[_0x318f('0x61')]=_0x42c0c5;}return _0x25a292;});}else{var _0x599014={'sectionId':0x76c,'enabled':0x1,'subsections':_0x42c0c5};var _0x1c7980=_[_0x318f('0x2f')](_0xf35b84);_0x1c7980[_0x318f('0x5b')](_0x599014);return _0x1c7980;}});}else{return;}})[_0x318f('0x27')](function(_0x2f97c1){if(_0x2f97c1)_0xf35b84=_0x2f97c1;return _[_0x318f('0x40')](_0xf35b84,[_0x318f('0x5e'),0x1]);})[_0x318f('0x27')](respondWithResult(_0x3f8939,null))['catch'](handleError(_0x3f8939,null));};function hasDefaultDashboard(_0x36440c){var _0x53b3d4=[0x65];return new BPromise(function(_0x4f2c99,_0x42e9ba){try{if(_0x36440c['autoAssociation']){_0x4f2c99(_0x53b3d4);}else{return db[_0x318f('0x57')]['findOne']({'where':{'sectionId':_0x36440c['id']},'raw':!![]})[_0x318f('0x27')](function(_0x5c3488){_0x5c3488?_0x4f2c99(_0x53b3d4):_0x4f2c99();});}}catch(_0x3a2aea){_0x42e9ba(_0x3a2aea);}});}function getCustomDashboards(_0x1c95e9){var _0x409a1e=[];return new BPromise(function(_0x22a644,_0x375b2d){try{if(_0x1c95e9[_0x318f('0x54')]){return db['Dashboard'][_0x318f('0x44')]({'raw':!![]})[_0x318f('0x27')](function(_0x4aafe3){_0x4aafe3['forEach'](function(_0x1bf694){_0x409a1e[_0x318f('0x5b')](_0x1bf694['id']+0x1869f);});_0x22a644(_0x409a1e);});}else{return db['UserProfileResource'][_0x318f('0x44')]({'where':{'sectionId':_0x1c95e9['id']},'raw':!![]})[_0x318f('0x27')](function(_0x1e7044){_0x1e7044[_0x318f('0x62')](function(_0xcf8ad2){_0x409a1e[_0x318f('0x5b')](_0xcf8ad2['resourceId']+0x1869f);});_0x22a644(_0x409a1e);});}}catch(_0x549df5){_0x375b2d(_0x549df5);}});}function getPlugins(_0x20e734){var _0x21ef40=[];return new BPromise(function(_0x370e27,_0x2aca8d){try{if(_0x20e734[_0x318f('0x54')]){return db[_0x318f('0x63')][_0x318f('0x44')]({'raw':!![]})[_0x318f('0x27')](function(_0x454745){_0x454745['forEach'](function(_0x4851c2){_0x21ef40[_0x318f('0x5b')](_0x4851c2['id']+0x15b38);});_0x370e27(_0x21ef40);});}else{return db[_0x318f('0x57')]['findAll']({'where':{'sectionId':_0x20e734['id']},'raw':!![]})[_0x318f('0x27')](function(_0x27b57b){_0x27b57b[_0x318f('0x62')](function(_0x571410){_0x21ef40[_0x318f('0x5b')](_0x571410[_0x318f('0x64')]+0x15b38);});_0x370e27(_0x21ef40);});}}catch(_0x513482){_0x2aca8d(_0x513482);}});}exports['addResources']=function(_0x89a58,_0xaf20e5){return db[_0x318f('0x30')][_0x318f('0x49')]({'where':{'id':_0x89a58[_0x318f('0x47')]['id']}})[_0x318f('0x27')](handleEntityNotFound(_0xaf20e5,null))[_0x318f('0x27')](function(_0x3f4df9){if(_0x3f4df9){return db['sequelize']['transaction'](function(_0x5f2c9b){return db[_0x318f('0x52')]['findAll']({'where':{'userProfileId':_0x89a58[_0x318f('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x318f('0x27')](function(_0x10b0f8){if(_0x10b0f8){return db[_0x318f('0x52')]['destroy']({'where':{'userProfileId':_0x89a58[_0x318f('0x47')]['id'],'id':_[_0x318f('0x2f')](_0x10b0f8,function(_0x253288){return _0x253288['id'];})},'transaction':_0x5f2c9b});}})[_0x318f('0x27')](function(_0x5b1e4f){var _0x8759c0=_[_0x318f('0x2f')](_0x89a58['body'],function(_0x492bcc){_0x492bcc['userProfileId']=_0x89a58[_0x318f('0x47')]['id'];return _0x492bcc;});return db[_0x318f('0x52')][_0x318f('0x65')](_0x8759c0,{'raw':!![],'transaction':_0x5f2c9b});})[_0x318f('0x27')](function(_0x217760){var _0xcfcfa8=_[_0x318f('0x40')](_[_0x318f('0x2f')](_0x217760,function(_0x63458e){return _0x63458e['get']({'plain':!![]});}),{'includeAll':![]});if(_0xcfcfa8){return db[_0x318f('0x52')][_0x318f('0x44')]({'where':{'userProfileId':_0x89a58[_0x318f('0x47')]['id'],'sectionId':_[_0x318f('0x2f')](_0xcfcfa8,function(_0x3c5caf){return _0x3c5caf[_0x318f('0x55')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x22b936){var _0xb9fe47=_[_0x318f('0x2f')](_0x89a58[_0x318f('0x50')],function(_0xa31af){_0xa31af[_0x318f('0x56')]=_0x89a58[_0x318f('0x47')]['id'];return _0xa31af;});return db[_0x318f('0x57')]['bulkCreate'](_0xb9fe47,{'raw':!![],'transaction':_0x5f2c9b});});}})[_0x318f('0x45')](handleError(_0xaf20e5,null));});}})[_0x318f('0x27')](function(_0x319efa){var _0x1b212b=_['map'](_0x319efa,function(_0x37be22){return _0x37be22[_0x318f('0x4b')]({'plain':!![]});});})[_0x318f('0x27')](respondWithResult(_0xaf20e5,null))['catch'](handleError(_0xaf20e5,null));};exports[_0x318f('0x66')]=function(_0x389747,_0x3894dc,_0x163895){return db[_0x318f('0x30')][_0x318f('0x49')]({'where':{'id':_0x389747['params']['id']}})[_0x318f('0x27')](handleEntityNotFound(_0x3894dc,null))[_0x318f('0x27')](function(_0x1534f0){if(_0x1534f0){return _0x1534f0[_0x318f('0x66')](_0x389747[_0x318f('0x34')][_0x318f('0x5c')]);}})[_0x318f('0x27')](respondWithStatusCode(_0x3894dc,null))[_0x318f('0x45')](handleError(_0x3894dc,null));};exports[_0x318f('0x67')]=function(_0x3f4968,_0x479f4a){var _0x2f94ae={};if(!_0x3f4968[_0x318f('0x34')][_0x318f('0x68')])throw new Error('Missing\x20section\x20parameter');if(!_0x3f4968[_0x318f('0x34')][_0x318f('0x3b')]('nolimit')){_0x2f94ae['limit']=qs[_0x318f('0x22')](_0x3f4968[_0x318f('0x34')][_0x318f('0x22')]);_0x2f94ae['offset']=qs[_0x318f('0x1f')](_0x3f4968['query']['offset']);}return db['UserProfile'][_0x318f('0x49')]({'where':{'id':_0x3f4968['params']['id']}})[_0x318f('0x27')](function(_0x4bd2a3){if(!_0x4bd2a3)throw new Error(_0x318f('0x69')+_0x3f4968[_0x318f('0x47')]['id']);return db[_0x318f('0x30')]['getResources'](_0x3f4968);})[_0x318f('0x27')](respondWithFilteredResult(_0x479f4a,_0x2f94ae))['catch'](handleError(_0x479f4a,null));}; \ No newline at end of file +var _0x5386=['omit','createdAt','updatedAt','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','push','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','getResources','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','UserProfile','findAll','catch','length','includeAll','find','create','clone','params','get'];(function(_0x32d330,_0xe907c8){var _0xe81a43=function(_0x322e56){while(--_0x322e56){_0x32d330['push'](_0x32d330['shift']());}};_0xe81a43(++_0xe907c8);}(_0x5386,0x1e1));var _0x6538=function(_0x920ae3,_0x4652ef){_0x920ae3=_0x920ae3-0x0;var _0x19ea79=_0x5386[_0x920ae3];return _0x19ea79;};'use strict';var emlformat=require(_0x6538('0x0'));var rimraf=require(_0x6538('0x1'));var zipdir=require(_0x6538('0x2'));var jsonpatch=require(_0x6538('0x3'));var rp=require('request-promise');var moment=require(_0x6538('0x4'));var BPromise=require(_0x6538('0x5'));var Mustache=require(_0x6538('0x6'));var util=require(_0x6538('0x7'));var path=require(_0x6538('0x8'));var sox=require(_0x6538('0x9'));var csv=require(_0x6538('0xa'));var ejs=require(_0x6538('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6538('0xc'));var squel=require('squel');var crypto=require(_0x6538('0xd'));var jsforce=require(_0x6538('0xe'));var deskjs=require(_0x6538('0xf'));var toCsv=require(_0x6538('0xa'));var querystring=require(_0x6538('0x10'));var Papa=require(_0x6538('0x11'));var Redis=require(_0x6538('0x12'));var authService=require(_0x6538('0x13'));var qs=require(_0x6538('0x14'));var as=require(_0x6538('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6538('0x16'))(_0x6538('0x17'));var utils=require(_0x6538('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6538('0x19'));var db=require('../../mysqldb')['db'];config[_0x6538('0x1a')]=_[_0x6538('0x1b')](config['redis'],{'host':_0x6538('0x1c'),'port':0x18eb});var socket=require(_0x6538('0x1d'))(new Redis(config['redis']));require(_0x6538('0x1e'))[_0x6538('0x1f')](socket);function respondWithStatusCode(_0x266934,_0x54da50){_0x54da50=_0x54da50||0xcc;return function(_0x406b0c){if(_0x406b0c){return _0x266934['sendStatus'](_0x54da50);}return _0x266934[_0x6538('0x20')](_0x54da50)[_0x6538('0x21')]();};}function respondWithResult(_0x2407c0,_0x380edb){_0x380edb=_0x380edb||0xc8;return function(_0x57071e){if(_0x57071e){return _0x2407c0[_0x6538('0x20')](_0x380edb)[_0x6538('0x22')](_0x57071e);}};}function respondWithFilteredResult(_0x58fd79,_0x4f2a1c){return function(_0x7c32d0){if(_0x7c32d0){var _0x5c2f2c=typeof _0x4f2a1c[_0x6538('0x23')]===_0x6538('0x24')&&typeof _0x4f2a1c[_0x6538('0x25')]==='undefined';var _0x261428=_0x7c32d0[_0x6538('0x26')];var _0x31fd9a=_0x5c2f2c?0x0:_0x4f2a1c[_0x6538('0x23')];var _0x41f553=_0x5c2f2c?_0x7c32d0[_0x6538('0x26')]:_0x4f2a1c[_0x6538('0x23')]+_0x4f2a1c[_0x6538('0x25')];var _0x116c16;if(_0x41f553>=_0x261428){_0x41f553=_0x261428;_0x116c16=0xc8;}else{_0x116c16=0xce;}_0x58fd79[_0x6538('0x20')](_0x116c16);return _0x58fd79['set']('Content-Range',_0x31fd9a+'-'+_0x41f553+'/'+_0x261428)[_0x6538('0x22')](_0x7c32d0);}return null;};}function patchUpdates(_0x5b6361){return function(_0x404aca){try{jsonpatch[_0x6538('0x27')](_0x404aca,_0x5b6361,!![]);}catch(_0x421cb8){return BPromise[_0x6538('0x28')](_0x421cb8);}return _0x404aca['save']();};}function saveUpdates(_0x5a5846,_0x341b78){return function(_0x5c6806){if(_0x5c6806){return _0x5c6806[_0x6538('0x29')](_0x5a5846)['then'](function(_0x4a28a0){return _0x4a28a0;});}return null;};}function removeEntity(_0x4c39f3,_0x1cd5d2){return function(_0x1f6037){if(_0x1f6037){return _0x1f6037['destroy']()[_0x6538('0x2a')](function(){_0x4c39f3['status'](0xcc)[_0x6538('0x21')]();});}};}function handleEntityNotFound(_0x249dcb,_0xea5295){return function(_0x4fb3d6){if(!_0x4fb3d6){_0x249dcb['sendStatus'](0x194);}return _0x4fb3d6;};}function handleError(_0x24f752,_0x155581){_0x155581=_0x155581||0x1f4;return function(_0x197048){logger[_0x6538('0x2b')](_0x197048['stack']);if(_0x197048[_0x6538('0x2c')]){delete _0x197048['name'];}_0x24f752[_0x6538('0x20')](_0x155581)[_0x6538('0x2d')](_0x197048);};}exports[_0x6538('0x2e')]=function(_0x28e32f,_0x42c69e){var _0x12df00={},_0x325354={},_0x3513ec={'count':0x0,'rows':[]};var _0x2faa43=_[_0x6538('0x2f')](db['UserProfile'][_0x6538('0x30')],function(_0x42c067){return{'name':_0x42c067[_0x6538('0x31')],'type':_0x42c067['type'][_0x6538('0x32')]};});_0x325354[_0x6538('0x33')]=_[_0x6538('0x2f')](_0x2faa43,'name');_0x325354['query']=_[_0x6538('0x34')](_0x28e32f[_0x6538('0x35')]);_0x325354['filters']=_[_0x6538('0x36')](_0x325354[_0x6538('0x33')],_0x325354['query']);_0x12df00[_0x6538('0x37')]=_[_0x6538('0x36')](_0x325354['model'],qs[_0x6538('0x38')](_0x28e32f[_0x6538('0x35')][_0x6538('0x38')]));_0x12df00[_0x6538('0x37')]=_0x12df00[_0x6538('0x37')]['length']?_0x12df00[_0x6538('0x37')]:_0x325354[_0x6538('0x33')];if(!_0x28e32f[_0x6538('0x35')]['hasOwnProperty'](_0x6538('0x39'))){_0x12df00['limit']=qs['limit'](_0x28e32f['query']['limit']);_0x12df00[_0x6538('0x23')]=qs[_0x6538('0x23')](_0x28e32f[_0x6538('0x35')][_0x6538('0x23')]);}_0x12df00[_0x6538('0x3a')]=qs[_0x6538('0x3b')](_0x28e32f[_0x6538('0x35')][_0x6538('0x3b')]);_0x12df00[_0x6538('0x3c')]=qs[_0x6538('0x3d')](_[_0x6538('0x3e')](_0x28e32f[_0x6538('0x35')],_0x325354[_0x6538('0x3d')]),_0x2faa43);if(_0x28e32f['query'][_0x6538('0x3f')]){_0x12df00[_0x6538('0x3c')]=_[_0x6538('0x40')](_0x12df00['where'],{'$or':_[_0x6538('0x2f')](_0x2faa43,function(_0x53fec8){if(_0x53fec8[_0x6538('0x41')]!==_0x6538('0x42')){var _0x1f219d={};_0x1f219d[_0x53fec8[_0x6538('0x2c')]]={'$like':'%'+_0x28e32f[_0x6538('0x35')][_0x6538('0x3f')]+'%'};return _0x1f219d;}})});}_0x12df00=_[_0x6538('0x40')]({},_0x12df00,_0x28e32f[_0x6538('0x43')]);var _0x3b0755={'where':_0x12df00[_0x6538('0x3c')]};return db['UserProfile']['count'](_0x3b0755)['then'](function(_0xfc51f){_0x3513ec[_0x6538('0x26')]=_0xfc51f;if(_0x28e32f['query']['includeAll']){_0x12df00[_0x6538('0x44')]=[{'all':!![]}];}return db[_0x6538('0x45')][_0x6538('0x46')](_0x12df00);})[_0x6538('0x2a')](function(_0x273317){_0x3513ec['rows']=_0x273317;return _0x3513ec;})[_0x6538('0x2a')](respondWithFilteredResult(_0x42c69e,_0x12df00))[_0x6538('0x47')](handleError(_0x42c69e,null));};exports['show']=function(_0x34f8a9,_0x454bfa){var _0x3f61c6={'raw':![],'where':{'id':_0x34f8a9['params']['id']}},_0x3c2f2d={};_0x3c2f2d[_0x6538('0x33')]=_[_0x6538('0x34')](db[_0x6538('0x45')][_0x6538('0x30')]);_0x3c2f2d['query']=_[_0x6538('0x34')](_0x34f8a9[_0x6538('0x35')]);_0x3c2f2d[_0x6538('0x3d')]=_[_0x6538('0x36')](_0x3c2f2d[_0x6538('0x33')],_0x3c2f2d['query']);_0x3f61c6[_0x6538('0x37')]=_[_0x6538('0x36')](_0x3c2f2d[_0x6538('0x33')],qs['fields'](_0x34f8a9[_0x6538('0x35')][_0x6538('0x38')]));_0x3f61c6[_0x6538('0x37')]=_0x3f61c6['attributes'][_0x6538('0x48')]?_0x3f61c6['attributes']:_0x3c2f2d[_0x6538('0x33')];if(_0x34f8a9['query'][_0x6538('0x49')]){_0x3f61c6[_0x6538('0x44')]=[{'all':!![]}];}_0x3f61c6=_[_0x6538('0x40')]({},_0x3f61c6,_0x34f8a9[_0x6538('0x43')]);return db['UserProfile'][_0x6538('0x4a')](_0x3f61c6)[_0x6538('0x2a')](handleEntityNotFound(_0x454bfa,null))[_0x6538('0x2a')](respondWithResult(_0x454bfa,null))['catch'](handleError(_0x454bfa,null));};exports[_0x6538('0x4b')]=function(_0x86ac3e,_0x2046a8){return db['UserProfile'][_0x6538('0x4b')](_0x86ac3e['body'],{})[_0x6538('0x2a')](respondWithResult(_0x2046a8,0xc9))[_0x6538('0x47')](handleError(_0x2046a8,null));};exports[_0x6538('0x4c')]=function(_0x2e7b0f,_0x402ff6){var _0x14649a={'where':{'id':_0x2e7b0f[_0x6538('0x4d')]['id']}},_0x3adb3a={};_0x3adb3a['model']=_['keys'](db[_0x6538('0x45')][_0x6538('0x30')]);_0x14649a[_0x6538('0x37')]=_['intersection'](_0x3adb3a['model'],qs['fields'](_0x2e7b0f['query'][_0x6538('0x38')]));_0x14649a[_0x6538('0x37')]=_0x14649a[_0x6538('0x37')][_0x6538('0x48')]?_0x14649a['attributes']:_0x3adb3a[_0x6538('0x33')];if(_0x2e7b0f[_0x6538('0x35')][_0x6538('0x49')]){_0x14649a[_0x6538('0x44')]=[{'all':!![]}];}_0x14649a=_[_0x6538('0x40')]({},_0x14649a,_0x2e7b0f[_0x6538('0x43')]);return db[_0x6538('0x45')][_0x6538('0x4a')](_0x14649a)[_0x6538('0x2a')](handleEntityNotFound(_0x402ff6,null))['then'](function(_0x242ab3){if(_0x242ab3){var _0x3c95e7=_0x242ab3[_0x6538('0x4e')]({'plain':!![]});_0x3c95e7=qs[_0x6538('0x4f')](_0x3c95e7,['id',_0x6538('0x50'),_0x6538('0x51'),'crudPermissions']);_0x2e7b0f[_0x6538('0x52')]=_[_0x6538('0x4f')](_0x2e7b0f[_0x6538('0x52')],['id',_0x6538('0x50'),'updatedAt']);return db[_0x6538('0x53')][_0x6538('0x54')](function(_0x97559c){return db[_0x6538('0x45')]['create'](_[_0x6538('0x40')](_0x3c95e7,_0x2e7b0f[_0x6538('0x52')]),{'include':_0x2e7b0f[_0x6538('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x97559c})['then'](function(_0x4f1167){var _0x5879f8=_0x4f1167[_0x6538('0x4e')]({'plain':!![]});return db[_0x6538('0x55')][_0x6538('0x46')]({'where':{'userProfileId':_0x2e7b0f[_0x6538('0x4d')]['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x41346d){if(_0x41346d){return BPromise[_0x6538('0x56')](_0x41346d,function(_0x35281b){return new BPromise(function(_0x41d1aa,_0x37a6c5){if(_0x35281b[_0x6538('0x57')]===null||_0x35281b[_0x6538('0x57')]===0x1)_0x41d1aa(null);return db[_0x6538('0x58')][_0x6538('0x46')]({'where':{'sectionId':_0x35281b['id']},'raw':!![]})['then'](function(_0x1f12d9){var _0x9c0249=_['map'](_0x1f12d9,function(_0x18f9c8){return qs['omit'](_0x18f9c8,['id',_0x6538('0x50'),_0x6538('0x51'),_0x6538('0x59')]);});_0x41d1aa(_0x9c0249);})[_0x6538('0x47')](function(_0x284f85){_0x37a6c5(_0x284f85);});})[_0x6538('0x2a')](function(_0x508c01){var _0x3eea15=qs[_0x6538('0x4f')](_0x35281b,['id',_0x6538('0x50'),_0x6538('0x51')]);_0x3eea15[_0x6538('0x5a')]=_0x5879f8['id'];if(_0x508c01)_0x3eea15['Resources']=_0x508c01;return _0x3eea15;})[_0x6538('0x2a')](function(_0x226d72){return db['UserProfileSection'][_0x6538('0x4b')](_0x226d72,{'include':[{'model':db[_0x6538('0x58')],'as':_0x6538('0x5b')}],'raw':!![],'transaction':_0x97559c});});})['then'](function(){return _0x5879f8;});}});});});}})[_0x6538('0x2a')](respondWithResult(_0x402ff6,0xc9))[_0x6538('0x47')](handleError(_0x402ff6,null));};exports[_0x6538('0x29')]=function(_0x5286c0,_0x2193c6){if(_0x5286c0[_0x6538('0x52')]['id']){delete _0x5286c0[_0x6538('0x52')]['id'];}return db[_0x6538('0x45')][_0x6538('0x4a')]({'where':{'id':_0x5286c0[_0x6538('0x4d')]['id']}})[_0x6538('0x2a')](handleEntityNotFound(_0x2193c6,null))['then'](saveUpdates(_0x5286c0['body'],null))[_0x6538('0x2a')](respondWithResult(_0x2193c6,null))[_0x6538('0x47')](handleError(_0x2193c6,null));};exports[_0x6538('0x5c')]=function(_0x121a8a,_0xb61e23){return db[_0x6538('0x45')][_0x6538('0x4a')]({'where':{'id':_0x121a8a['params']['id']}})[_0x6538('0x2a')](handleEntityNotFound(_0xb61e23,null))[_0x6538('0x2a')](removeEntity(_0xb61e23,null))['catch'](handleError(_0xb61e23,null));};exports[_0x6538('0x5d')]=function(_0x50dacc,_0x394d7e){return db[_0x6538('0x45')][_0x6538('0x5d')]()[_0x6538('0x2a')](respondWithResult(_0x394d7e,null))[_0x6538('0x47')](handleError(_0x394d7e,null));};exports[_0x6538('0x5e')]=function(_0x5a6f99,_0x29bca0){var _0x4a7348=_0x5a6f99['body'];return db[_0x6538('0x45')][_0x6538('0x4a')]({'where':{'id':_0x5a6f99[_0x6538('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29bca0,null))[_0x6538('0x2a')](function(_0x2992ee){if(_0x2992ee){return db[_0x6538('0x53')]['transaction'](function(_0x224339){return db[_0x6538('0x55')][_0x6538('0x5c')]({'where':{'userProfileId':_0x5a6f99[_0x6538('0x4d')]['id'],'sectionId':_['map'](_0x4a7348,function(_0x4c4100){return _0x4c4100[_0x6538('0x59')];})},'transaction':_0x224339})[_0x6538('0x2a')](function(){var _0xca25ef=_['map'](_0x4a7348,function(_0x553d28){_0x553d28[_0x6538('0x5a')]=_0x5a6f99[_0x6538('0x4d')]['id'];return _0x553d28;});var _0x171346=[];return BPromise[_0x6538('0x56')](_0xca25ef,function(_0x255905){return db['UserProfileSection'][_0x6538('0x4b')](_0x255905,{'include':[{'model':db[_0x6538('0x58')],'as':_0x6538('0x5b')}],'raw':!![],'transaction':_0x224339})[_0x6538('0x2a')](function(_0x22cabe){_0x171346[_0x6538('0x5f')](_0x22cabe['get']({'plain':!![]}));});})[_0x6538('0x2a')](function(){return _0x171346;});});});}})[_0x6538('0x2a')](function(_0x42afbe){return _0x42afbe;})[_0x6538('0x2a')](respondWithResult(_0x29bca0,null))[_0x6538('0x47')](handleError(_0x29bca0,null));};exports['removeSections']=function(_0x40703d,_0x223022){var _0x441b1e;return db[_0x6538('0x45')][_0x6538('0x4a')]({'where':{'id':_0x40703d['params']['id']},'attributes':['id',_0x6538('0x2c')]})[_0x6538('0x2a')](handleEntityNotFound(_0x223022,null))[_0x6538('0x2a')](function(_0x92063e){if(_0x92063e){_0x441b1e=_0x92063e;return db[_0x6538('0x55')][_0x6538('0x5c')]({'where':{'userProfileId':_0x40703d[_0x6538('0x4d')]['id'],'sectionId':_0x40703d[_0x6538('0x35')][_0x6538('0x60')]}});}})['then'](function(){return _0x441b1e;})[_0x6538('0x2a')](respondWithStatusCode(_0x223022,null))[_0x6538('0x47')](handleError(_0x223022,null));};exports[_0x6538('0x61')]=function(_0x1bef35,_0x201332){var _0x5bcd5c=[];var _0x1203e6=[];return db[_0x6538('0x55')]['findAll']({'where':{'userProfileId':_0x1bef35['params']['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x82a046){_0x5bcd5c=_[_0x6538('0x3f')](_0x82a046,function(_0x3f441f){return _0x3f441f[_0x6538('0x62')]===0x1||_[_0x6538('0x63')]([0x3eb,0x709],_0x3f441f[_0x6538('0x59')]);});if(!_[_0x6538('0x64')](_0x5bcd5c)){return _[_0x6538('0x2f')](_0x5bcd5c,function(_0x50a02c){return _0x50a02c[_0x6538('0x59')];});}else{return;}})[_0x6538('0x2a')](function(_0x2a2ce2){if(_0x2a2ce2)_0x1203e6=_0x2a2ce2;if(_['includes'](_0x1203e6,0x64)){var _0x13e977=_[_0x6538('0x4a')](_0x5bcd5c,{'sectionId':0x64});return hasDefaultDashboard(_0x13e977)[_0x6538('0x2a')](function(_0x41aa4d){return _[_0x6538('0x2f')](_0x5bcd5c,function(_0x8518e0){if(_0x8518e0[_0x6538('0x59')]===0x64){_0x8518e0[_0x6538('0x65')]=_0x41aa4d;}return _0x8518e0;});});}else{return;}})[_0x6538('0x2a')](function(_0x50e097){if(_0x50e097)_0x5bcd5c=_0x50e097;if(_[_0x6538('0x63')](_0x1203e6,0x3eb)){var _0x293df7=_[_0x6538('0x4a')](_0x5bcd5c,{'sectionId':0x3eb});return getCustomDashboards(_0x293df7)['then'](function(_0x575a71){return _['map'](_0x5bcd5c,function(_0x7195c4){if(_0x293df7[_0x6538('0x62')]){if(_0x7195c4[_0x6538('0x59')]===0x3eb){_0x7195c4['subsections']=_0x575a71;}}else{if(_0x7195c4['sectionId']===0x64){_0x7195c4[_0x6538('0x65')]=_0x575a71;}}return _0x7195c4;});});}else{return;}})[_0x6538('0x2a')](function(_0x559faa){if(_0x559faa)_0x5bcd5c=_0x559faa;if(_[_0x6538('0x63')](_0x1203e6,0x709)){var _0x514b57=_[_0x6538('0x4a')](_0x5bcd5c,{'sectionId':0x709});return getPlugins(_0x514b57)[_0x6538('0x2a')](function(_0x44701e){if(_0x514b57[_0x6538('0x62')]){return _[_0x6538('0x2f')](_0x5bcd5c,function(_0x528977){if(_0x528977['sectionId']===0x709){_0x528977[_0x6538('0x65')]=_0x44701e;}return _0x528977;});}else{var _0x54f6b3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x44701e};var _0x36945c=_[_0x6538('0x2f')](_0x5bcd5c);_0x36945c['push'](_0x54f6b3);return _0x36945c;}});}else{return;}})[_0x6538('0x2a')](function(_0x42942c){if(_0x42942c)_0x5bcd5c=_0x42942c;return _[_0x6538('0x3f')](_0x5bcd5c,[_0x6538('0x62'),0x1]);})[_0x6538('0x2a')](respondWithResult(_0x201332,null))['catch'](handleError(_0x201332,null));};function hasDefaultDashboard(_0x54f1c1){var _0xe557e1=[0x65];return new BPromise(function(_0xff6d23,_0x1ad805){try{if(_0x54f1c1['autoAssociation']){_0xff6d23(_0xe557e1);}else{return db['UserProfileResource'][_0x6538('0x66')]({'where':{'sectionId':_0x54f1c1['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x185896){_0x185896?_0xff6d23(_0xe557e1):_0xff6d23();});}}catch(_0x3c2926){_0x1ad805(_0x3c2926);}});}function getCustomDashboards(_0xf56d10){var _0x17aa1a=[];return new BPromise(function(_0x15e0fc,_0x599b63){try{if(_0xf56d10[_0x6538('0x57')]){return db[_0x6538('0x67')][_0x6538('0x46')]({'raw':!![]})[_0x6538('0x2a')](function(_0x276ab8){_0x276ab8[_0x6538('0x68')](function(_0xb2dfb){_0x17aa1a[_0x6538('0x5f')](_0xb2dfb['id']+0x1869f);});_0x15e0fc(_0x17aa1a);});}else{return db[_0x6538('0x58')][_0x6538('0x46')]({'where':{'sectionId':_0xf56d10['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x38bba0){_0x38bba0[_0x6538('0x68')](function(_0x3a2e2e){_0x17aa1a[_0x6538('0x5f')](_0x3a2e2e[_0x6538('0x69')]+0x1869f);});_0x15e0fc(_0x17aa1a);});}}catch(_0x286b53){_0x599b63(_0x286b53);}});}function getPlugins(_0x40aef8){var _0x3e1067=[];return new BPromise(function(_0x5f9350,_0x2e20af){try{if(_0x40aef8[_0x6538('0x57')]){return db['Plugin'][_0x6538('0x46')]({'raw':!![]})[_0x6538('0x2a')](function(_0x4b7410){_0x4b7410[_0x6538('0x68')](function(_0x104f37){_0x3e1067[_0x6538('0x5f')](_0x104f37['id']+0x15b38);});_0x5f9350(_0x3e1067);});}else{return db[_0x6538('0x58')][_0x6538('0x46')]({'where':{'sectionId':_0x40aef8['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x4b1561){_0x4b1561[_0x6538('0x68')](function(_0x3dc80a){_0x3e1067['push'](_0x3dc80a[_0x6538('0x69')]+0x15b38);});_0x5f9350(_0x3e1067);});}}catch(_0x5bb7a5){_0x2e20af(_0x5bb7a5);}});}exports[_0x6538('0x6a')]=function(_0x1c692c,_0x2064e7){return db['UserProfile'][_0x6538('0x4a')]({'where':{'id':_0x1c692c['params']['id']}})[_0x6538('0x2a')](handleEntityNotFound(_0x2064e7,null))[_0x6538('0x2a')](function(_0x414850){if(_0x414850){return db['sequelize'][_0x6538('0x54')](function(_0x5e9087){return db['UserProfileSection'][_0x6538('0x46')]({'where':{'userProfileId':_0x1c692c[_0x6538('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x6538('0x2a')](function(_0x1e9499){if(_0x1e9499){return db[_0x6538('0x55')]['destroy']({'where':{'userProfileId':_0x1c692c[_0x6538('0x4d')]['id'],'id':_['map'](_0x1e9499,function(_0x21c1b0){return _0x21c1b0['id'];})},'transaction':_0x5e9087});}})[_0x6538('0x2a')](function(_0x317f53){var _0xec2fcf=_[_0x6538('0x2f')](_0x1c692c[_0x6538('0x52')],function(_0x47124d){_0x47124d[_0x6538('0x5a')]=_0x1c692c[_0x6538('0x4d')]['id'];return _0x47124d;});return db[_0x6538('0x55')][_0x6538('0x6b')](_0xec2fcf,{'raw':!![],'transaction':_0x5e9087});})[_0x6538('0x2a')](function(_0x9953a0){var _0x6e8cd1=_[_0x6538('0x3f')](_[_0x6538('0x2f')](_0x9953a0,function(_0x238590){return _0x238590[_0x6538('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x6e8cd1){return db['UserProfileSection'][_0x6538('0x46')]({'where':{'userProfileId':_0x1c692c[_0x6538('0x4d')]['id'],'sectionId':_[_0x6538('0x2f')](_0x6e8cd1,function(_0xe8d8c8){return _0xe8d8c8['sectionId'];})},'attributes':['id',_0x6538('0x59')],'raw':!![]})[_0x6538('0x2a')](function(_0x307ad0){var _0x3074d7=_[_0x6538('0x2f')](_0x1c692c[_0x6538('0x52')],function(_0x3eceda){_0x3eceda[_0x6538('0x5a')]=_0x1c692c[_0x6538('0x4d')]['id'];return _0x3eceda;});return db['UserProfileResource'][_0x6538('0x6b')](_0x3074d7,{'raw':!![],'transaction':_0x5e9087});});}})['catch'](handleError(_0x2064e7,null));});}})[_0x6538('0x2a')](function(_0x52cdfe){var _0x55cc8a=_[_0x6538('0x2f')](_0x52cdfe,function(_0x14642a){return _0x14642a[_0x6538('0x4e')]({'plain':!![]});});})[_0x6538('0x2a')](respondWithResult(_0x2064e7,null))['catch'](handleError(_0x2064e7,null));};exports[_0x6538('0x6c')]=function(_0x3d7f25,_0x17b44d,_0x24dc28){return db[_0x6538('0x45')]['find']({'where':{'id':_0x3d7f25[_0x6538('0x4d')]['id']}})['then'](handleEntityNotFound(_0x17b44d,null))['then'](function(_0x5de2eb){if(_0x5de2eb){return _0x5de2eb[_0x6538('0x6c')](_0x3d7f25[_0x6538('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x17b44d,null))[_0x6538('0x47')](handleError(_0x17b44d,null));};exports['getResources']=function(_0x27995b,_0x64e400){var _0x1ca01f={};if(!_0x27995b[_0x6538('0x35')][_0x6538('0x6d')])throw new Error(_0x6538('0x6e'));if(!_0x27995b[_0x6538('0x35')]['hasOwnProperty'](_0x6538('0x39'))){_0x1ca01f[_0x6538('0x25')]=qs['limit'](_0x27995b[_0x6538('0x35')][_0x6538('0x25')]);_0x1ca01f['offset']=qs['offset'](_0x27995b[_0x6538('0x35')][_0x6538('0x23')]);}return db[_0x6538('0x45')]['find']({'where':{'id':_0x27995b[_0x6538('0x4d')]['id']}})[_0x6538('0x2a')](function(_0x3a20d5){if(!_0x3a20d5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x27995b[_0x6538('0x4d')]['id']);return db[_0x6538('0x45')][_0x6538('0x6f')](_0x27995b);})['then'](respondWithFilteredResult(_0x64e400,_0x1ca01f))['catch'](handleError(_0x64e400,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index e91cf94..43140cb 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 _0x15ef=['../../mysqldb','UserProfile','save','update','remove','emit','hook','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x15ef,0x80));var _0xf15e=function(_0x474477,_0x58a14d){_0x474477=_0x474477-0x0;var _0x47ac2c=_0x15ef[_0x474477];return _0x47ac2c;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xf15e('0x0'))['db'][_0xf15e('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf15e('0x2'),'afterUpdate':_0xf15e('0x3'),'afterDestroy':_0xf15e('0x4')};function emitEvent(_0x347c12){return function(_0x4e7241,_0x5d456b,_0x1b9a24){UserProfileEvents[_0xf15e('0x5')](_0x347c12+':'+_0x4e7241['id'],_0x4e7241);UserProfileEvents['emit'](_0x347c12,_0x4e7241);_0x1b9a24(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xf15e('0x6')](e,emitEvent(event));}}module[_0xf15e('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xbb67=['hook','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xbb67,0x161));var _0x7bb6=function(_0x47b228,_0x4eaec1){_0x47b228=_0x47b228-0x0;var _0x28e119=_0xbb67[_0x47b228];return _0x28e119;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x7bb6('0x0'))['db'][_0x7bb6('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7bb6('0x2')](0x0);var events={'afterCreate':_0x7bb6('0x3'),'afterUpdate':_0x7bb6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33a5c4){return function(_0x2c1ddb,_0x1f527c,_0x7fb7c9){UserProfileEvents[_0x7bb6('0x5')](_0x33a5c4+':'+_0x2c1ddb['id'],_0x2c1ddb);UserProfileEvents[_0x7bb6('0x5')](_0x33a5c4,_0x2c1ddb);_0x7fb7c9(null);};}for(var e in events){if(events[_0x7bb6('0x6')](e)){var event=events[e];UserProfile[_0x7bb6('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 73d1744..581f9c4 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 _0x687b=['chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceContext','VoiceMail','Agents','membername','User','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','type','chanspies','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','Users','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','Plugin','Reports','AnalyticMetric','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','nolimit','offset','order','sort','pick','merge','key','foreignKey','options','includeAll','include','findAll','forEach','reportType','reportId','custom','CustomReports','count','rows','color','tag','ThroughTags','openTabs','true','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','then','associatedResources','map','catch','model','name','UserProfileResource','field','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField'];(function(_0x47fad6,_0x3c0ea7){var _0x5ba37f=function(_0x14cab2){while(--_0x14cab2){_0x47fad6['push'](_0x47fad6['shift']());}};_0x5ba37f(++_0x3c0ea7);}(_0x687b,0x14a));var _0xb687=function(_0x547587,_0x48cbd9){_0x547587=_0x547587-0x0;var _0x3d7777=_0x687b[_0x547587];return _0x3d7777;};'use strict';var _=require(_0xb687('0x0'));var attributes=require(_0xb687('0x1'));var qs=require(_0xb687('0x2'));var squel=require(_0xb687('0x3'));module['exports']=function(_0x5e5f06){var _0x35069a=_0x5e5f06[_0xb687('0x4')];function _0x36c468(_0x31bd0d,_0x46e5b3){return new Promise(function(_0x194c55,_0x16ccf3){if(!_0x46e5b3)return _0x194c55(null);var _0xf43a1f=_0x46e5b3[_0xb687('0x5')]?{[_0x46e5b3[_0xb687('0x5')]['field']]:_0x46e5b3[_0xb687('0x5')][_0xb687('0x6')]}:undefined;return _0x35069a[_0x31bd0d]['findAll']({'where':_0xf43a1f,'raw':!![]})[_0xb687('0x7')](function(_0x21e3ab){_0x46e5b3[_0xb687('0x8')]=_[_0xb687('0x9')](_0x21e3ab,'id');_0x194c55(_0x46e5b3);})[_0xb687('0xa')](function(_0x309d84){_0x16ccf3(_0x309d84);});});}function _0x3e6271(_0xaf4727,_0x5e61e){return new Promise(function(_0x5103b9,_0x226e56){var _0xbeb5cc=_0xaf4727[_0xb687('0x5')]?{[_0xaf4727[_0xb687('0x5')]['field']]:_0xaf4727['filter'][_0xb687('0x6')]}:undefined;return _0x35069a[_0xaf4727[_0xb687('0xb')]]['findAll']({'where':_0xbeb5cc,'raw':!![]})[_0xb687('0x7')](function(_0x2f1ac0){_0x5e61e[_0xb687('0x8')]=_[_0xb687('0x9')](_0x2f1ac0,function(_0x838dd4){return _0x838dd4[_0xb687('0xc')];});_0x5103b9(_0x5e61e);})[_0xb687('0xa')](function(_0x141375){_0x226e56(_0x141375);});});}function _0x263085(_0x2c7a18,_0x25124a,_0x19bb29){if(!_0x25124a)return Promise['resolve'](null);return new Promise(function(_0x214b06,_0x328301){return _0x35069a[_0xb687('0xd')]['findAll']({'where':{'sectionId':_0x25124a['id']},'raw':!![]})['then'](function(_0x12eff1){if(_0x2c7a18[_0xb687('0xe')]&&_0x2c7a18[_0xb687('0xe')]!=='id'){_0x25124a['associatedResources']=_[_0xb687('0x9')](_0x12eff1,function(_0x481f1d){return _0x481f1d[_0x2c7a18[_0xb687('0xe')]];});}else{if(_0x19bb29===_0xb687('0xf')){_0x25124a[_0xb687('0x8')]=_[_0xb687('0x9')](_0x12eff1,function(_0x49d5a1){return{'id':_0x49d5a1[_0xb687('0x10')],'type':_0x49d5a1['type']};});}else{_0x25124a[_0xb687('0x8')]=_[_0xb687('0x9')](_0x12eff1,function(_0x274241){return _0x274241['resourceId'];});}}_0x214b06(_0x25124a);})[_0xb687('0xa')](function(_0x491623){_0x328301(_0x491623);});});}function _0xa95e91(_0x16cdcb,_0xbf6c58){var _0x38866c={'parentSections':[]};switch(_0x16cdcb[_0xb687('0x11')]()){case _0xb687('0x12'):_0x38866c['childModel']=_0xb687('0x13');break;case _0xb687('0x14'):_0x38866c[_0xb687('0x15')]=_0xb687('0x16');break;case _0xb687('0x17'):_0x38866c[_0xb687('0x15')]=_0xb687('0x18');_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x1a'),'field':_0xb687('0xc'),'foreignKey':'projectName'}];break;case _0xb687('0x1b'):_0x38866c[_0xb687('0x15')]=_0xb687('0x1c');break;case _0xb687('0x1d'):_0x38866c[_0xb687('0x15')]=_0xb687('0x1e');_0x38866c['parentSections']=[{'name':_0xb687('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0xb687('0x20'):_0x38866c[_0xb687('0x15')]=_0xb687('0x21');break;case _0xb687('0x22'):_0x38866c[_0xb687('0x15')]=_0xb687('0x23');break;case _0xb687('0x24'):_0x38866c['childModel']=_0xb687('0x25');break;case _0xb687('0x26'):_0x38866c[_0xb687('0x15')]=_0xb687('0x27');break;case _0xb687('0x28'):_0x38866c[_0xb687('0x15')]=_0xb687('0x29');break;case _0xb687('0x2a'):_0x38866c[_0xb687('0x15')]=_0xb687('0x2b');break;case _0xb687('0x2c'):_0x38866c['childModel']='FaxAccount';break;case _0xb687('0x2d'):case _0xb687('0x2e'):case _0xb687('0x2f'):_0x38866c[_0xb687('0x15')]='VoiceExtension';break;case'contexts':_0x38866c[_0xb687('0x15')]=_0xb687('0x30');break;case'voicemails':_0x38866c[_0xb687('0x15')]=_0xb687('0x31');break;case'voicerecordings':_0x38866c[_0xb687('0x15')]='VoiceRecording';_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x32'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x33'),'model':_0xb687('0x34'),'filter':{'field':_0xb687('0x35'),'value':['agent']}},{'name':_0xb687('0x36'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x33'),'model':_0xb687('0x34'),'filter':{'field':'role','value':[_0xb687('0x37')]}},{'name':_0xb687('0x38'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x39'),'model':_0xb687('0x3a'),'filter':{'field':'type','value':[_0xb687('0x3b')]}},{'name':_0xb687('0x3c'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x39'),'model':_0xb687('0x3a'),'filter':{'field':_0xb687('0x3d'),'value':['outbound']}}];break;case'musiconholds':_0x38866c[_0xb687('0x15')]='VoiceMusicOnHold';break;case _0xb687('0x3e'):_0x38866c[_0xb687('0x15')]='VoiceChanSpy';break;case _0xb687('0x3f'):_0x38866c[_0xb687('0x15')]='VoicePrefix';break;case _0xb687('0x40'):_0x38866c[_0xb687('0x15')]=_0xb687('0x41');break;case'mailqueues':_0x38866c[_0xb687('0x15')]=_0xb687('0x42');break;case _0xb687('0x43'):_0x38866c[_0xb687('0x15')]=_0xb687('0x44');break;case _0xb687('0x45'):_0x38866c[_0xb687('0x15')]='MailSubstatus';break;case _0xb687('0x46'):_0x38866c['childModel']='OpenchannelQueue';break;case _0xb687('0x47'):_0x38866c[_0xb687('0x15')]='OpenchannelAccount';break;case _0xb687('0x48'):_0x38866c['childModel']=_0xb687('0x49');break;case _0xb687('0x4a'):_0x38866c['childModel']=_0xb687('0x4b');break;case _0xb687('0x4c'):_0x38866c['childModel']=_0xb687('0x4d');break;case _0xb687('0x4e'):_0x38866c[_0xb687('0x15')]=_0xb687('0x4f');break;case _0xb687('0x50'):_0x38866c[_0xb687('0x15')]=_0xb687('0x51');break;case _0xb687('0x52'):case _0xb687('0x53'):_0x38866c[_0xb687('0x15')]=_0xb687('0x3a');if(_0xbf6c58){_0x38866c[_0xb687('0x19')]=[{'name':'VoiceQueues'},{'name':_0xb687('0x3c')}];}break;case'users':case _0xb687('0x54'):case _0xb687('0x55'):_0x38866c[_0xb687('0x15')]=_0xb687('0x34');if(_0xbf6c58){_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x56'),'filter':{'field':'role','value':['admin',_0xb687('0x57')]},'ignore':!![]},{'name':_0xb687('0x32')},{'name':_0xb687('0x36')}];}break;case _0xb687('0x58'):_0x38866c['childModel']=_0xb687('0x59');break;case _0xb687('0x5a'):_0x38866c[_0xb687('0x15')]=_0xb687('0x5b');break;case'freshdeskaccounts':_0x38866c[_0xb687('0x15')]=_0xb687('0x5c');break;case _0xb687('0x5d'):_0x38866c[_0xb687('0x15')]='SugarcrmAccount';break;case'deskaccounts':_0x38866c[_0xb687('0x15')]=_0xb687('0x5e');break;case _0xb687('0x5f'):_0x38866c['childModel']='ZohoAccount';break;case _0xb687('0x60'):_0x38866c[_0xb687('0x15')]=_0xb687('0x34');break;case _0xb687('0x61'):_0x38866c[_0xb687('0x15')]=_0xb687('0x62');break;case _0xb687('0x63'):_0x38866c[_0xb687('0x15')]='Disposition';break;case _0xb687('0x64'):_0x38866c[_0xb687('0x15')]=_0xb687('0x65');break;case'intervals':_0x38866c['childModel']='Interval';break;case'pauses':_0x38866c[_0xb687('0x15')]=_0xb687('0x66');break;case _0xb687('0x67'):_0x38866c[_0xb687('0x15')]=_0xb687('0x68');break;case _0xb687('0x69'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6a');break;case _0xb687('0x6b'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6c');break;case _0xb687('0x6d'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6e');break;case _0xb687('0x6f'):_0x38866c[_0xb687('0x15')]=_0xb687('0x70');break;case'trunks':_0x38866c['childModel']=_0xb687('0x71');break;case _0xb687('0x72'):_0x38866c[_0xb687('0x15')]=_0xb687('0x73');break;case'plugins':_0x38866c[_0xb687('0x15')]=_0xb687('0x74');break;case'extractedreports':_0x38866c[_0xb687('0x15')]='AnalyticExtractedReport';_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x75'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x38866c[_0xb687('0x15')]=_0xb687('0x76');break;}return _0x38866c;}function _0x5ea8fd(_0x1da4d1,_0x318be6){var _0x3cd364=_0x1da4d1['charAt'](0x0)[_0xb687('0x77')]()+_0x1da4d1['slice'](0x1);var _0xb20c08={'type':_0x35069a[_0xb687('0x78')][_0xb687('0x79')][_0xb687('0x7a')],'raw':!![]};return new Promise(function(_0x819b63,_0x49b403){var _0x4e163c=squel[_0xb687('0x7b')]()['field']('ui.'+_0x3cd364+'InteractionId','id')['field'](_0xb687('0x7c'))[_0xb687('0x7d')](_0xb687('0x7e')+_0x1da4d1+_0xb687('0x7f'),'ui')[_0xb687('0x80')](_0xb687('0x81'),_0x318be6['id']);return _0x35069a[_0xb687('0x82')][_0xb687('0x83')](_0x4e163c[_0xb687('0x84')](),_0xb20c08)[_0xb687('0x7')](function(_0x132e3a){_0x318be6[_0x3cd364+'OpenTabs']=_0x132e3a;_0x819b63(_0x132e3a);})['catch'](function(_0x2714c6){_0x49b403(_0x2714c6);});});}return _0x5e5f06['define'](_0xb687('0x85'),attributes,{'tableName':_0xb687('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1c031f){var _0x3ebaa2={'raw':![],'where':{}};var _0x3475cc={};var _0x4b5f75={'count':0x0,'rows':[]};var _0x22da49=_0x1c031f['query'][_0xb687('0x87')];var _0x293281=_0x1c031f[_0xb687('0x83')][_0xb687('0x88')]||![];var _0x3fe455=_0xa95e91(_0x22da49,_0x293281);if(!_0x3fe455[_0xb687('0x15')])throw new Error(_0xb687('0x89')+_0x22da49+'\x27');var _0x5deb7a=[{'name':_0x22da49}];if(!_[_0xb687('0x8a')](_0x3fe455[_0xb687('0x19')]))_0x5deb7a=_0x3fe455[_0xb687('0x19')];var _0x36bb4b=[];for(var _0x258caf=0x0;_0x258caf<_0x5deb7a['length'];_0x258caf++){_0x36bb4b[_0xb687('0x8b')](_0x35069a[_0xb687('0x8c')][_0xb687('0x8d')]({'where':{'userProfileId':_0x1c031f[_0xb687('0x8e')]['id'],'name':_0x5deb7a[_0x258caf][_0xb687('0xc')]},'raw':!![]}));}return Promise[_0xb687('0x8f')](_0x36bb4b)[_0xb687('0x7')](function(_0x377456){var _0x177ea4=_[_0xb687('0x5')](_0x377456,function(_0x1c167c){return _0x1c167c?_0x1c167c:undefined;});var _0x48838a=_[_0xb687('0x5')](_0x5deb7a,[_0xb687('0x90'),!![]]);var _0x1915da=_[_0xb687('0x8a')](_0x177ea4)&&_['isEmpty'](_0x48838a)?null:_[_0xb687('0x91')](_0x48838a,_0x177ea4);if(!_0x1915da)return null;var _0x1a6075=[];for(var _0x53b00a=0x0;_0x53b00a<_0x1915da[_0xb687('0x92')];_0x53b00a++){var _0x1acfed=_[_0xb687('0x8d')](_0x5deb7a,function(_0x5eeb75){return _0x1915da[_0x53b00a]?_0x5eeb75[_0xb687('0xc')]===_0x1915da[_0x53b00a][_0xb687('0xc')]:null;});if(_0x1acfed){if(_0x1915da[_0x53b00a]['ignore']){_0x1a6075[_0xb687('0x8b')](_0x36c468(_0x3fe455[_0xb687('0x15')],_0x1915da[_0x53b00a]));}else{if(!_0x1915da[_0x53b00a][_0xb687('0x93')]){_0x1a6075[_0xb687('0x8b')](_0x263085(_0x1acfed,_0x1915da[_0x53b00a],_0x3fe455['childModel']));}else{if(_0x1acfed[_0xb687('0xb')]){_0x1a6075[_0xb687('0x8b')](_0x3e6271(_0x1acfed,_0x1915da[_0x53b00a]));}}}}}return Promise['all'](_0x1a6075);})[_0xb687('0x7')](function(_0x1736ef){var _0x52285e=_0x1736ef;var _0x533837=null;if(_0x52285e){_0x533837=_0x52285e[_0xb687('0x92')]===0x1?_0x52285e[0x0]:null;}if(!_0x533837&&!_0x52285e)return _0x4b5f75;var _0x5370bc=_0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0x94')];_0x3475cc[_0xb687('0xb')]=_[_0xb687('0x95')](_0x5370bc);_0x3475cc[_0xb687('0x83')]=_[_0xb687('0x95')](_0x1c031f[_0xb687('0x83')]);_0x3475cc[_0xb687('0x96')]=_['intersection'](_0x3475cc[_0xb687('0xb')],_0x3475cc[_0xb687('0x83')]);_0x3ebaa2[_0xb687('0x97')]=_[_0xb687('0x98')](_0x3475cc[_0xb687('0xb')],qs[_0xb687('0x99')](_0x1c031f['query'][_0xb687('0x99')]));_0x3ebaa2[_0xb687('0x97')]=_0x3ebaa2['attributes'][_0xb687('0x92')]?_0x3ebaa2[_0xb687('0x97')]:_0x3475cc[_0xb687('0xb')];if(!_0x1c031f[_0xb687('0x83')]['hasOwnProperty'](_0xb687('0x9a'))){_0x3ebaa2['limit']=qs['limit'](_0x1c031f[_0xb687('0x83')]['limit']);_0x3ebaa2['offset']=qs[_0xb687('0x9b')](_0x1c031f['query'][_0xb687('0x9b')]);}_0x3ebaa2[_0xb687('0x9c')]=qs['sort'](_0x1c031f[_0xb687('0x83')][_0xb687('0x9d')]);_0x3ebaa2['where']=qs[_0xb687('0x96')](_[_0xb687('0x9e')](_0x1c031f[_0xb687('0x83')],_0x3475cc[_0xb687('0x96')]));if(_0x1c031f[_0xb687('0x83')][_0xb687('0x5')]){_0x3ebaa2[_0xb687('0x80')]=_[_0xb687('0x9f')](_0x3ebaa2[_0xb687('0x80')],{'$or':_[_0xb687('0x9')](_0x5370bc,function(_0x3a7a4a){if(_0x3a7a4a['type'][_0xb687('0xa0')]!=='VIRTUAL'){var _0x5a00c7={};_0x5a00c7[_0x3a7a4a[_0xb687('0xe')]]={'$like':'%'+_0x1c031f[_0xb687('0x83')][_0xb687('0x5')]+'%'};return _0x5a00c7;}})});}var _0xfecb8d=[];var _0x3a7339=null;var _0x594254={};if(_0x533837){_0x3a7339=_['find'](_0x5deb7a,[_0xb687('0xc'),_0x533837[_0xb687('0xc')]]);if(_0x3a7339[_0xb687('0xe')]){_0x594254={};if(_0x3fe455[_0xb687('0x15')]==='AnalyticExtractedReport'){_0x594254[_0x3a7339[_0xb687('0xa1')]]=_[_0xb687('0x9')](_0x533837[_0xb687('0x8')],'id');}else{_0x594254[_0x3a7339[_0xb687('0xa1')]]=_0x533837[_0xb687('0x8')];}_0xfecb8d[_0xb687('0x8b')](_0x594254);}else{_0x3ebaa2[_0xb687('0x80')]['id']=_0x533837[_0xb687('0x8')];}}else{for(var _0xfc0eee=0x0;_0xfc0eee<_0x52285e['length'];_0xfc0eee++){_0x3a7339=_[_0xb687('0x8d')](_0x5deb7a,[_0xb687('0xc'),_0x52285e[_0xfc0eee][_0xb687('0xc')]]);if(_0x3a7339[_0xb687('0xe')]){_0x594254={};_0x594254[_0x3a7339[_0xb687('0xa1')]]=_0x52285e[_0xfc0eee]['associatedResources'];_0xfecb8d[_0xb687('0x8b')](_0x594254);}else{if(!_0x3ebaa2[_0xb687('0x80')]['id'])_0x3ebaa2['where']['id']=[];_0x52285e[_0xfc0eee][_0xb687('0x8')]['forEach'](function(_0x32760c){_0x3ebaa2[_0xb687('0x80')]['id']['push'](_0x32760c);});}}}if(!_[_0xb687('0x8a')](_0xfecb8d)){_0x3ebaa2[_0xb687('0x80')]=_['merge'](_0x3ebaa2[_0xb687('0x80')],{'$and':{'$or':_0xfecb8d}});}_0x3ebaa2=_[_0xb687('0x9f')]({},_0x3ebaa2,_0x1c031f[_0xb687('0xa2')]);if(_0x533837&&!_0x533837[_0xb687('0x93')]&&_0x3fe455[_0xb687('0x15')]===_0xb687('0xf')){if(_0x1c031f['query'][_0xb687('0xa3')]){_0x3ebaa2[_0xb687('0xa4')]=[{'all':!![]}];}return _0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0xa5')](_0x3ebaa2)[_0xb687('0x7')](function(_0x465b81){var _0x233230=[];_0x465b81[_0xb687('0xa6')](function(_0x801bf9){var _0x361222;switch(_0x801bf9[_0xb687('0xa7')]){case'default':_0x361222=_[_0xb687('0x8d')](_0x533837['associatedResources'],function(_0x3d98e2){return _0x3d98e2['id']===_0x801bf9[_0xb687('0xa8')]&&_0x3d98e2['type']==='DefaultReports';});break;case _0xb687('0xa9'):_0x361222=_[_0xb687('0x8d')](_0x533837[_0xb687('0x8')],function(_0x33c3f4){return _0x33c3f4['id']===_0x801bf9[_0xb687('0xa8')]&&_0x33c3f4[_0xb687('0x3d')]===_0xb687('0xaa');});break;}if(_0x361222)_0x233230[_0xb687('0x8b')](_0x801bf9);});_0x4b5f75[_0xb687('0xab')]=_0x233230[_0xb687('0x92')];_0x4b5f75[_0xb687('0xac')]=_0x233230;return _0x4b5f75;});}else{return _0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0xab')]({'where':_0x3ebaa2[_0xb687('0x80')]})[_0xb687('0x7')](function(_0x3f45b7){_0x4b5f75['count']=_0x3f45b7;if(_0x1c031f['query'][_0xb687('0xa3')]){if(_0x3fe455['childModel']==='CmContact'){_0x3ebaa2[_0xb687('0xa4')]=[{'model':_0x35069a[_0xb687('0x6c')],'as':'Tags','attributes':['id',_0xb687('0xc'),_0xb687('0xad')],'required':_0x1c031f['query'][_0xb687('0xae')]?!![]:![]},{'model':_0x35069a[_0xb687('0x6c')],'as':_0xb687('0xaf'),'attributes':['id',_0xb687('0xc'),_0xb687('0xad')],'through':_0x1c031f[_0xb687('0x83')][_0xb687('0xae')]?{'attributes':[],'where':{'TagId':_0x1c031f[_0xb687('0x83')][_0xb687('0xae')]||undefined}}:{},'required':_0x1c031f['query'][_0xb687('0xae')]?!![]:![]}];}else{_0x3ebaa2[_0xb687('0xa4')]=[{'all':!![]}];}}return _0x35069a[_0x3fe455['childModel']][_0xb687('0xa5')](_0x3ebaa2);})['then'](function(_0x37af7e){_0x4b5f75[_0xb687('0xac')]=_0x37af7e;if(_0x22da49==='Agents'&&_0x1c031f[_0xb687('0x83')][_0xb687('0xb0')]===_0xb687('0xb1')){var _0x45d0ab=[];for(var _0x446b2b=0x0;_0x446b2b<_0x4b5f75[_0xb687('0xac')][_0xb687('0x92')];_0x446b2b++){_0x45d0ab['push'](_0x5ea8fd('chat',_0x4b5f75[_0xb687('0xac')][_0x446b2b]['dataValues']));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb2'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab['push'](_0x5ea8fd(_0xb687('0xb4'),_0x4b5f75[_0xb687('0xac')][_0x446b2b]['dataValues']));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb5'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb6'),_0x4b5f75['rows'][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb7'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));}return Promise[_0xb687('0x8f')](_0x45d0ab)[_0xb687('0x7')](function(){return _0x4b5f75;});}return _0x4b5f75;});}});}}});}; \ No newline at end of file +var _0x7096=['sounds','Sound','tags','Tag','templates','Template','triggers','trunks','Trunk','variables','Variable','Plugin','extractedreports','AnalyticExtractedReport','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','SELECT','select','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','union','push','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','custom','CustomReports','count','rows','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','whatsapp','./userProfile.attributes','squel','models','filter','field','then','associatedResources','map','catch','model','findAll','name','UserProfileResource','resourceId','type','toLowerCase','childModel','SquareProject','odbc','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','lists','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','voicemails','voicerecordings','Agents','membername','User','role','agent','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','voicequeues','QueueCampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','Interval','Pause','scheduler','Schedule'];(function(_0x599af7,_0x11140f){var _0x38a51d=function(_0x3618c0){while(--_0x3618c0){_0x599af7['push'](_0x599af7['shift']());}};_0x38a51d(++_0x11140f);}(_0x7096,0x10c));var _0x6709=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7096[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var attributes=require(_0x6709('0x0'));var qs=require('../../components/parsers/qs');var squel=require(_0x6709('0x1'));module['exports']=function(_0x233cbf){var _0x9544e0=_0x233cbf[_0x6709('0x2')];function _0xccdcb5(_0x3cd087,_0x3c8599){return new Promise(function(_0xb8fe6d,_0x9d630f){if(!_0x3c8599)return _0xb8fe6d(null);var _0xa35832=_0x3c8599[_0x6709('0x3')]?{[_0x3c8599[_0x6709('0x3')][_0x6709('0x4')]]:_0x3c8599[_0x6709('0x3')]['value']}:undefined;return _0x9544e0[_0x3cd087]['findAll']({'where':_0xa35832,'raw':!![]})[_0x6709('0x5')](function(_0x2d8c0b){_0x3c8599[_0x6709('0x6')]=_[_0x6709('0x7')](_0x2d8c0b,'id');_0xb8fe6d(_0x3c8599);})[_0x6709('0x8')](function(_0x426ea1){_0x9d630f(_0x426ea1);});});}function _0x5de1fa(_0x5b9f26,_0x329aa9){return new Promise(function(_0x262261,_0x275dd3){var _0x84e9e6=_0x5b9f26[_0x6709('0x3')]?{[_0x5b9f26[_0x6709('0x3')][_0x6709('0x4')]]:_0x5b9f26[_0x6709('0x3')]['value']}:undefined;return _0x9544e0[_0x5b9f26[_0x6709('0x9')]][_0x6709('0xa')]({'where':_0x84e9e6,'raw':!![]})[_0x6709('0x5')](function(_0x3706e1){_0x329aa9['associatedResources']=_[_0x6709('0x7')](_0x3706e1,function(_0x5c667c){return _0x5c667c[_0x6709('0xb')];});_0x262261(_0x329aa9);})['catch'](function(_0x149233){_0x275dd3(_0x149233);});});}function _0x28866a(_0x95c0c2,_0x3d5c28,_0x4cab30){if(!_0x3d5c28)return Promise['resolve'](null);return new Promise(function(_0x5c4f94,_0x3fa5b1){return _0x9544e0[_0x6709('0xc')]['findAll']({'where':{'sectionId':_0x3d5c28['id']},'raw':!![]})[_0x6709('0x5')](function(_0x166c97){if(_0x95c0c2[_0x6709('0x4')]&&_0x95c0c2['field']!=='id'){_0x3d5c28[_0x6709('0x6')]=_[_0x6709('0x7')](_0x166c97,function(_0x28df7a){return _0x28df7a[_0x95c0c2[_0x6709('0x4')]];});}else{if(_0x4cab30==='AnalyticExtractedReport'){_0x3d5c28[_0x6709('0x6')]=_[_0x6709('0x7')](_0x166c97,function(_0x373047){return{'id':_0x373047[_0x6709('0xd')],'type':_0x373047[_0x6709('0xe')]};});}else{_0x3d5c28[_0x6709('0x6')]=_[_0x6709('0x7')](_0x166c97,function(_0x17763d){return _0x17763d[_0x6709('0xd')];});}}_0x5c4f94(_0x3d5c28);})[_0x6709('0x8')](function(_0x2f3415){_0x3fa5b1(_0x2f3415);});});}function _0xa36371(_0x5cf48b,_0x29f25f){var _0x81138e={'parentSections':[]};switch(_0x5cf48b[_0x6709('0xf')]()){case'squareprojects':_0x81138e[_0x6709('0x10')]=_0x6709('0x11');break;case _0x6709('0x12'):_0x81138e[_0x6709('0x10')]='SquareOdbc';break;case _0x6709('0x13'):_0x81138e[_0x6709('0x10')]='SquareRecording';_0x81138e[_0x6709('0x14')]=[{'name':_0x6709('0x15'),'field':'name','foreignKey':_0x6709('0x16')}];break;case _0x6709('0x17'):_0x81138e['childModel']=_0x6709('0x18');break;case'contacts':_0x81138e[_0x6709('0x10')]=_0x6709('0x19');_0x81138e['parentSections']=[{'name':_0x6709('0x1a'),'field':'id','foreignKey':'ListId'}];break;case _0x6709('0x1b'):_0x81138e[_0x6709('0x10')]='CmList';break;case _0x6709('0x1c'):_0x81138e['childModel']=_0x6709('0x1d');break;case _0x6709('0x1e'):_0x81138e['childModel']='CmCustomField';break;case _0x6709('0x1f'):_0x81138e[_0x6709('0x10')]=_0x6709('0x20');break;case _0x6709('0x21'):_0x81138e[_0x6709('0x10')]=_0x6709('0x22');break;case _0x6709('0x23'):_0x81138e[_0x6709('0x10')]=_0x6709('0x24');break;case'faxaccounts':_0x81138e[_0x6709('0x10')]=_0x6709('0x25');break;case _0x6709('0x26'):case _0x6709('0x27'):case'outboundroutes':_0x81138e[_0x6709('0x10')]=_0x6709('0x28');break;case _0x6709('0x29'):_0x81138e[_0x6709('0x10')]='VoiceContext';break;case _0x6709('0x2a'):_0x81138e[_0x6709('0x10')]='VoiceMail';break;case _0x6709('0x2b'):_0x81138e[_0x6709('0x10')]='VoiceRecording';_0x81138e[_0x6709('0x14')]=[{'name':_0x6709('0x2c'),'field':_0x6709('0xb'),'foreignKey':_0x6709('0x2d'),'model':_0x6709('0x2e'),'filter':{'field':_0x6709('0x2f'),'value':[_0x6709('0x30')]}},{'name':'Telephones','field':_0x6709('0xb'),'foreignKey':_0x6709('0x2d'),'model':'User','filter':{'field':_0x6709('0x2f'),'value':[_0x6709('0x31')]}},{'name':_0x6709('0x32'),'field':_0x6709('0xb'),'foreignKey':_0x6709('0x33'),'model':_0x6709('0x34'),'filter':{'field':'type','value':[_0x6709('0x35')]}},{'name':'QueueCampaigns','field':_0x6709('0xb'),'foreignKey':_0x6709('0x33'),'model':_0x6709('0x34'),'filter':{'field':'type','value':[_0x6709('0x36')]}}];break;case _0x6709('0x37'):_0x81138e[_0x6709('0x10')]=_0x6709('0x38');break;case _0x6709('0x39'):_0x81138e[_0x6709('0x10')]=_0x6709('0x3a');break;case'voiceprefixes':_0x81138e[_0x6709('0x10')]=_0x6709('0x3b');break;case _0x6709('0x3c'):_0x81138e[_0x6709('0x10')]=_0x6709('0x3d');break;case _0x6709('0x3e'):_0x81138e[_0x6709('0x10')]='MailQueue';break;case'mailaccounts':_0x81138e[_0x6709('0x10')]=_0x6709('0x3f');break;case _0x6709('0x40'):_0x81138e[_0x6709('0x10')]='MailSubstatus';break;case'openchannelqueues':_0x81138e['childModel']=_0x6709('0x41');break;case _0x6709('0x42'):_0x81138e['childModel']=_0x6709('0x43');break;case _0x6709('0x44'):_0x81138e['childModel']='SmsQueue';break;case _0x6709('0x45'):_0x81138e[_0x6709('0x10')]=_0x6709('0x46');break;case _0x6709('0x47'):_0x81138e[_0x6709('0x10')]='WhatsappQueue';break;case _0x6709('0x48'):_0x81138e['childModel']=_0x6709('0x49');break;case _0x6709('0x4a'):_0x81138e[_0x6709('0x10')]='Team';break;case _0x6709('0x4b'):case'queuecampaigns':_0x81138e['childModel']=_0x6709('0x34');if(_0x29f25f){_0x81138e[_0x6709('0x14')]=[{'name':_0x6709('0x32')},{'name':_0x6709('0x4c')}];}break;case _0x6709('0x4d'):case _0x6709('0x4e'):case _0x6709('0x4f'):_0x81138e[_0x6709('0x10')]=_0x6709('0x2e');if(_0x29f25f){_0x81138e[_0x6709('0x14')]=[{'name':_0x6709('0x50'),'filter':{'field':_0x6709('0x2f'),'value':[_0x6709('0x51'),_0x6709('0x52')]},'ignore':!![]},{'name':_0x6709('0x2c')},{'name':'Telephones'}];}break;case _0x6709('0x53'):_0x81138e['childModel']='ZendeskAccount';break;case _0x6709('0x54'):_0x81138e[_0x6709('0x10')]=_0x6709('0x55');break;case _0x6709('0x56'):_0x81138e[_0x6709('0x10')]=_0x6709('0x57');break;case _0x6709('0x58'):_0x81138e[_0x6709('0x10')]='SugarcrmAccount';break;case _0x6709('0x59'):_0x81138e[_0x6709('0x10')]=_0x6709('0x5a');break;case _0x6709('0x5b'):_0x81138e['childModel']=_0x6709('0x5c');break;case'vtigeraccounts':_0x81138e[_0x6709('0x10')]=_0x6709('0x2e');break;case _0x6709('0x5d'):_0x81138e[_0x6709('0x10')]=_0x6709('0x5e');break;case'dispositions':_0x81138e[_0x6709('0x10')]=_0x6709('0x5f');break;case _0x6709('0x60'):_0x81138e[_0x6709('0x10')]=_0x6709('0x61');break;case'intervals':_0x81138e['childModel']=_0x6709('0x62');break;case'pauses':_0x81138e['childModel']=_0x6709('0x63');break;case _0x6709('0x64'):_0x81138e[_0x6709('0x10')]=_0x6709('0x65');break;case _0x6709('0x66'):_0x81138e[_0x6709('0x10')]=_0x6709('0x67');break;case _0x6709('0x68'):_0x81138e[_0x6709('0x10')]=_0x6709('0x69');break;case _0x6709('0x6a'):_0x81138e['childModel']=_0x6709('0x6b');break;case _0x6709('0x6c'):_0x81138e['childModel']='Trigger';break;case _0x6709('0x6d'):_0x81138e[_0x6709('0x10')]=_0x6709('0x6e');break;case _0x6709('0x6f'):_0x81138e['childModel']=_0x6709('0x70');break;case'plugins':_0x81138e[_0x6709('0x10')]=_0x6709('0x71');break;case _0x6709('0x72'):_0x81138e[_0x6709('0x10')]=_0x6709('0x73');_0x81138e['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x6709('0x74')}];break;case _0x6709('0x75'):_0x81138e['childModel']=_0x6709('0x76');break;}return _0x81138e;}function _0x341ed7(_0x4f18c6,_0xbb78ba){var _0x183fae=_0x4f18c6[_0x6709('0x77')](0x0)[_0x6709('0x78')]()+_0x4f18c6['slice'](0x1);var _0x4dca92={'type':_0x9544e0[_0x6709('0x79')]['QueryTypes'][_0x6709('0x7a')],'raw':!![]};return new Promise(function(_0x32da54,_0x3c3df7){var _0x595329=squel[_0x6709('0x7b')]()['field']('ui.'+_0x183fae+_0x6709('0x7c'),'id')['field'](_0x6709('0x7d'))['from'](_0x6709('0x7e')+_0x4f18c6+_0x6709('0x7f'),'ui')[_0x6709('0x80')](_0x6709('0x81'),_0xbb78ba['id']);return _0x9544e0['sequelize'][_0x6709('0x82')](_0x595329[_0x6709('0x83')](),_0x4dca92)[_0x6709('0x5')](function(_0x11c435){_0xbb78ba[_0x183fae+_0x6709('0x84')]=_0x11c435;_0x32da54(_0x11c435);})[_0x6709('0x8')](function(_0xecec7f){_0x3c3df7(_0xecec7f);});});}return _0x233cbf['define'](_0x6709('0x85'),attributes,{'tableName':_0x6709('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1cd2cf){var _0x145508={'raw':![],'where':{}};var _0x3f4dae={};var _0x304268={'count':0x0,'rows':[]};var _0xea95f6=_0x1cd2cf[_0x6709('0x82')][_0x6709('0x87')];var _0x5514cc=_0x1cd2cf[_0x6709('0x82')][_0x6709('0x88')]||![];var _0x50f992=_0xa36371(_0xea95f6,_0x5514cc);if(!_0x50f992[_0x6709('0x10')])throw new Error(_0x6709('0x89')+_0xea95f6+'\x27');var _0x317956=[{'name':_0xea95f6}];if(!_[_0x6709('0x8a')](_0x50f992[_0x6709('0x14')]))_0x317956=_0x50f992[_0x6709('0x14')];var _0x32db99=[];for(var _0x475449=0x0;_0x475449<_0x317956[_0x6709('0x8b')];_0x475449++){_0x32db99['push'](_0x9544e0[_0x6709('0x8c')][_0x6709('0x8d')]({'where':{'userProfileId':_0x1cd2cf[_0x6709('0x8e')]['id'],'name':_0x317956[_0x475449][_0x6709('0xb')]},'raw':!![]}));}return Promise[_0x6709('0x8f')](_0x32db99)[_0x6709('0x5')](function(_0x64d345){var _0x40083c=_[_0x6709('0x3')](_0x64d345,function(_0x1355fd){return _0x1355fd?_0x1355fd:undefined;});var _0x458bab=_['filter'](_0x317956,[_0x6709('0x90'),!![]]);var _0x47f73e=_['isEmpty'](_0x40083c)&&_[_0x6709('0x8a')](_0x458bab)?null:_[_0x6709('0x91')](_0x458bab,_0x40083c);if(!_0x47f73e)return null;var _0xeeee92=[];for(var _0x426875=0x0;_0x426875<_0x47f73e[_0x6709('0x8b')];_0x426875++){var _0x3c27bb=_[_0x6709('0x8d')](_0x317956,function(_0x5c1132){return _0x47f73e[_0x426875]?_0x5c1132['name']===_0x47f73e[_0x426875][_0x6709('0xb')]:null;});if(_0x3c27bb){if(_0x47f73e[_0x426875]['ignore']){_0xeeee92[_0x6709('0x92')](_0xccdcb5(_0x50f992['childModel'],_0x47f73e[_0x426875]));}else{if(!_0x47f73e[_0x426875][_0x6709('0x93')]){_0xeeee92[_0x6709('0x92')](_0x28866a(_0x3c27bb,_0x47f73e[_0x426875],_0x50f992['childModel']));}else{if(_0x3c27bb['model']){_0xeeee92['push'](_0x5de1fa(_0x3c27bb,_0x47f73e[_0x426875]));}}}}}return Promise[_0x6709('0x8f')](_0xeeee92);})[_0x6709('0x5')](function(_0x24c584){var _0xbbfc50=_0x24c584;var _0x297f13=null;if(_0xbbfc50){_0x297f13=_0xbbfc50[_0x6709('0x8b')]===0x1?_0xbbfc50[0x0]:null;}if(!_0x297f13&&!_0xbbfc50)return _0x304268;var _0x1cac96=_0x9544e0[_0x50f992[_0x6709('0x10')]][_0x6709('0x94')];_0x3f4dae[_0x6709('0x9')]=_[_0x6709('0x95')](_0x1cac96);_0x3f4dae[_0x6709('0x82')]=_[_0x6709('0x95')](_0x1cd2cf['query']);_0x3f4dae[_0x6709('0x96')]=_[_0x6709('0x97')](_0x3f4dae[_0x6709('0x9')],_0x3f4dae[_0x6709('0x82')]);_0x145508['attributes']=_['intersection'](_0x3f4dae[_0x6709('0x9')],qs['fields'](_0x1cd2cf['query'][_0x6709('0x98')]));_0x145508[_0x6709('0x99')]=_0x145508['attributes'][_0x6709('0x8b')]?_0x145508[_0x6709('0x99')]:_0x3f4dae[_0x6709('0x9')];if(!_0x1cd2cf[_0x6709('0x82')][_0x6709('0x9a')]('nolimit')){_0x145508['limit']=qs[_0x6709('0x9b')](_0x1cd2cf[_0x6709('0x82')]['limit']);_0x145508[_0x6709('0x9c')]=qs[_0x6709('0x9c')](_0x1cd2cf[_0x6709('0x82')]['offset']);}_0x145508[_0x6709('0x9d')]=qs[_0x6709('0x9e')](_0x1cd2cf[_0x6709('0x82')][_0x6709('0x9e')]);_0x145508['where']=qs['filters'](_[_0x6709('0x9f')](_0x1cd2cf[_0x6709('0x82')],_0x3f4dae[_0x6709('0x96')]));if(_0x1cd2cf[_0x6709('0x82')][_0x6709('0x3')]){_0x145508['where']=_[_0x6709('0xa0')](_0x145508[_0x6709('0x80')],{'$or':_['map'](_0x1cac96,function(_0xea6d7){if(_0xea6d7[_0x6709('0xe')][_0x6709('0xa1')]!==_0x6709('0xa2')){var _0x1e8269={};_0x1e8269[_0xea6d7['field']]={'$like':'%'+_0x1cd2cf[_0x6709('0x82')]['filter']+'%'};return _0x1e8269;}})});}var _0x31cc76=[];var _0x5ae7e5=null;var _0x1a16c4={};if(_0x297f13){_0x5ae7e5=_[_0x6709('0x8d')](_0x317956,[_0x6709('0xb'),_0x297f13[_0x6709('0xb')]]);if(_0x5ae7e5['field']){_0x1a16c4={};if(_0x50f992[_0x6709('0x10')]===_0x6709('0x73')){_0x1a16c4[_0x5ae7e5[_0x6709('0xa3')]]=_[_0x6709('0x7')](_0x297f13[_0x6709('0x6')],'id');}else{_0x1a16c4[_0x5ae7e5[_0x6709('0xa3')]]=_0x297f13['associatedResources'];}_0x31cc76[_0x6709('0x92')](_0x1a16c4);}else{_0x145508[_0x6709('0x80')]['id']=_0x297f13[_0x6709('0x6')];}}else{for(var _0x55675d=0x0;_0x55675d<_0xbbfc50[_0x6709('0x8b')];_0x55675d++){_0x5ae7e5=_[_0x6709('0x8d')](_0x317956,['name',_0xbbfc50[_0x55675d][_0x6709('0xb')]]);if(_0x5ae7e5[_0x6709('0x4')]){_0x1a16c4={};_0x1a16c4[_0x5ae7e5[_0x6709('0xa3')]]=_0xbbfc50[_0x55675d]['associatedResources'];_0x31cc76[_0x6709('0x92')](_0x1a16c4);}else{if(!_0x145508[_0x6709('0x80')]['id'])_0x145508[_0x6709('0x80')]['id']=[];_0xbbfc50[_0x55675d]['associatedResources'][_0x6709('0xa4')](function(_0x3f9a3f){_0x145508[_0x6709('0x80')]['id'][_0x6709('0x92')](_0x3f9a3f);});}}}if(!_[_0x6709('0x8a')](_0x31cc76)){_0x145508[_0x6709('0x80')]=_['merge'](_0x145508[_0x6709('0x80')],{'$and':{'$or':_0x31cc76}});}_0x145508=_[_0x6709('0xa0')]({},_0x145508,_0x1cd2cf['options']);if(_0x297f13&&!_0x297f13[_0x6709('0x93')]&&_0x50f992[_0x6709('0x10')]===_0x6709('0x73')){if(_0x1cd2cf['query'][_0x6709('0xa5')]){_0x145508[_0x6709('0xa6')]=[{'all':!![]}];}return _0x9544e0[_0x50f992[_0x6709('0x10')]][_0x6709('0xa')](_0x145508)[_0x6709('0x5')](function(_0x22a4e6){var _0x477a1d=[];_0x22a4e6['forEach'](function(_0x374666){var _0x4161d5;switch(_0x374666[_0x6709('0xa7')]){case _0x6709('0xa8'):_0x4161d5=_[_0x6709('0x8d')](_0x297f13[_0x6709('0x6')],function(_0x13ca9e){return _0x13ca9e['id']===_0x374666['reportId']&&_0x13ca9e[_0x6709('0xe')]==='DefaultReports';});break;case _0x6709('0xa9'):_0x4161d5=_[_0x6709('0x8d')](_0x297f13[_0x6709('0x6')],function(_0x3f1dcf){return _0x3f1dcf['id']===_0x374666[_0x6709('0x74')]&&_0x3f1dcf[_0x6709('0xe')]===_0x6709('0xaa');});break;}if(_0x4161d5)_0x477a1d[_0x6709('0x92')](_0x374666);});_0x304268[_0x6709('0xab')]=_0x477a1d[_0x6709('0x8b')];_0x304268[_0x6709('0xac')]=_0x477a1d;return _0x304268;});}else{return _0x9544e0[_0x50f992[_0x6709('0x10')]][_0x6709('0xab')]({'where':_0x145508[_0x6709('0x80')]})['then'](function(_0x5be0df){_0x304268[_0x6709('0xab')]=_0x5be0df;if(_0x1cd2cf[_0x6709('0x82')]['includeAll']){if(_0x50f992[_0x6709('0x10')]===_0x6709('0x19')){_0x145508[_0x6709('0xa6')]=[{'model':_0x9544e0[_0x6709('0x69')],'as':_0x6709('0xad'),'attributes':['id',_0x6709('0xb'),_0x6709('0xae')],'required':_0x1cd2cf['query'][_0x6709('0xaf')]?!![]:![]},{'model':_0x9544e0[_0x6709('0x69')],'as':_0x6709('0xb0'),'attributes':['id',_0x6709('0xb'),'color'],'through':_0x1cd2cf['query'][_0x6709('0xaf')]?{'attributes':[],'where':{'TagId':_0x1cd2cf[_0x6709('0x82')][_0x6709('0xaf')]||undefined}}:{},'required':_0x1cd2cf[_0x6709('0x82')][_0x6709('0xaf')]?!![]:![]}];}else{_0x145508[_0x6709('0xa6')]=[{'all':!![]}];}}return _0x9544e0[_0x50f992[_0x6709('0x10')]][_0x6709('0xa')](_0x145508);})[_0x6709('0x5')](function(_0x247f25){_0x304268[_0x6709('0xac')]=_0x247f25;if(_0xea95f6===_0x6709('0x2c')&&_0x1cd2cf['query'][_0x6709('0xb1')]===_0x6709('0xb2')){var _0x393934=[];for(var _0x4ec43e=0x0;_0x4ec43e<_0x304268[_0x6709('0xac')][_0x6709('0x8b')];_0x4ec43e++){_0x393934['push'](_0x341ed7(_0x6709('0xb3'),_0x304268['rows'][_0x4ec43e][_0x6709('0xb4')]));_0x393934[_0x6709('0x92')](_0x341ed7(_0x6709('0xb5'),_0x304268[_0x6709('0xac')][_0x4ec43e][_0x6709('0xb4')]));_0x393934[_0x6709('0x92')](_0x341ed7(_0x6709('0xb6'),_0x304268[_0x6709('0xac')][_0x4ec43e]['dataValues']));_0x393934[_0x6709('0x92')](_0x341ed7(_0x6709('0xb7'),_0x304268[_0x6709('0xac')][_0x4ec43e]['dataValues']));_0x393934['push'](_0x341ed7('openchannel',_0x304268[_0x6709('0xac')][_0x4ec43e][_0x6709('0xb4')]));_0x393934[_0x6709('0x92')](_0x341ed7(_0x6709('0xb8'),_0x304268[_0x6709('0xac')][_0x4ec43e]['dataValues']));}return Promise[_0x6709('0x8f')](_0x393934)['then'](function(){return _0x304268;});}return _0x304268;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 5cc31d5..7e48a00 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 _0x4351=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./userProfile.socket','register','UserProfile,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4351,0x1b5));var _0x1435=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x4351[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var moment=require(_0x1435('0x2'));var BPromise=require(_0x1435('0x3'));var rs=require(_0x1435('0x4'));var fs=require('fs');var Redis=require(_0x1435('0x5'));var db=require(_0x1435('0x6'))['db'];var utils=require(_0x1435('0x7'));var logger=require(_0x1435('0x8'))(_0x1435('0x9'));var config=require(_0x1435('0xa'));var jayson=require(_0x1435('0xb'));var client=jayson[_0x1435('0xc')][_0x1435('0xd')]({'port':0x232a});config[_0x1435('0xe')]=_['defaults'](config[_0x1435('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1435('0xe')]));require(_0x1435('0xf'))[_0x1435('0x10')](socket);function respondWithRpcPromise(_0x35a509,_0xade491,_0x55cd88){return new BPromise(function(_0x1628ca,_0x3aafce){return client['request'](_0x35a509,_0x55cd88)['then'](function(_0x33887d){logger['info'](_0x1435('0x11'),_0xade491,'request\x20sent');logger[_0x1435('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xade491,'request\x20sent',JSON['stringify'](_0x33887d));if(_0x33887d[_0x1435('0x13')]){if(_0x33887d[_0x1435('0x13')][_0x1435('0x14')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0xade491,_0x33887d[_0x1435('0x13')]['message']);return _0x3aafce(_0x33887d[_0x1435('0x13')][_0x1435('0x15')]);}logger[_0x1435('0x13')](_0x1435('0x11'),_0xade491,_0x33887d[_0x1435('0x13')][_0x1435('0x15')]);return _0x1628ca(_0x33887d[_0x1435('0x13')][_0x1435('0x15')]);}else{logger[_0x1435('0x16')](_0x1435('0x11'),_0xade491,_0x1435('0x17'));_0x1628ca(_0x33887d[_0x1435('0x18')][_0x1435('0x15')]);}})[_0x1435('0x19')](function(_0x2081e6){logger['error'](_0x1435('0x11'),_0xade491,_0x2081e6);_0x3aafce(_0x2081e6);});});} \ No newline at end of file +var _0x9bd9=['defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x307049,_0x1e9968){var _0x2d3015=function(_0x285429){while(--_0x285429){_0x307049['push'](_0x307049['shift']());}};_0x2d3015(++_0x1e9968);}(_0x9bd9,0x1a4));var _0x99bd=function(_0xa132f9,_0x32f20d){_0xa132f9=_0xa132f9-0x0;var _0x342190=_0x9bd9[_0xa132f9];return _0x342190;};'use strict';var _=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var moment=require(_0x99bd('0x2'));var BPromise=require(_0x99bd('0x3'));var rs=require(_0x99bd('0x4'));var fs=require('fs');var Redis=require(_0x99bd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x99bd('0x6'));var logger=require('../../config/logger')(_0x99bd('0x7'));var config=require(_0x99bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x99bd('0x9')][_0x99bd('0xa')]({'port':0x232a});config[_0x99bd('0xb')]=_[_0x99bd('0xc')](config[_0x99bd('0xb')],{'host':_0x99bd('0xd'),'port':0x18eb});var socket=require(_0x99bd('0xe'))(new Redis(config[_0x99bd('0xb')]));require(_0x99bd('0xf'))[_0x99bd('0x10')](socket);function respondWithRpcPromise(_0x14aa5d,_0x468b6e,_0x2ded61){return new BPromise(function(_0x2c479b,_0x521f4c){return client[_0x99bd('0x11')](_0x14aa5d,_0x2ded61)['then'](function(_0x183e85){logger['info'](_0x99bd('0x12'),_0x468b6e,_0x99bd('0x13'));logger['debug'](_0x99bd('0x14'),_0x468b6e,'request\x20sent',JSON[_0x99bd('0x15')](_0x183e85));if(_0x183e85['error']){if(_0x183e85[_0x99bd('0x16')][_0x99bd('0x17')]===0x1f4){logger[_0x99bd('0x16')]('UserProfile,\x20%s,\x20%s',_0x468b6e,_0x183e85[_0x99bd('0x16')][_0x99bd('0x18')]);return _0x521f4c(_0x183e85[_0x99bd('0x16')][_0x99bd('0x18')]);}logger[_0x99bd('0x16')](_0x99bd('0x12'),_0x468b6e,_0x183e85[_0x99bd('0x16')][_0x99bd('0x18')]);return _0x2c479b(_0x183e85[_0x99bd('0x16')]['message']);}else{logger[_0x99bd('0x19')](_0x99bd('0x12'),_0x468b6e,_0x99bd('0x13'));_0x2c479b(_0x183e85['result']['message']);}})[_0x99bd('0x1a')](function(_0x136d51){logger[_0x99bd('0x16')](_0x99bd('0x12'),_0x468b6e,_0x136d51);_0x521f4c(_0x136d51);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 4a02be5..35c9082 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 _0x5f36=['remove','update','emit','removeListener','register','length','./userProfile.events'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x5f36,0xe6));var _0x65f3=function(_0x40d7cd,_0x49865d){_0x40d7cd=_0x40d7cd-0x0;var _0x2e0e8c=_0x5f36[_0x40d7cd];return _0x2e0e8c;};'use strict';var UserProfileEvents=require(_0x65f3('0x0'));var events=['save',_0x65f3('0x1'),_0x65f3('0x2')];function createListener(_0x561fed,_0xe5d909){return function(_0x14543a){_0xe5d909[_0x65f3('0x3')](_0x561fed,_0x14543a);};}function removeListener(_0x3f33eb,_0x3a7b69){return function(){UserProfileEvents[_0x65f3('0x4')](_0x3f33eb,_0x3a7b69);};}exports[_0x65f3('0x5')]=function(_0x241919){for(var _0x3889be=0x0,_0x4b9e49=events[_0x65f3('0x6')];_0x3889be<_0x4b9e49;_0x3889be++){var _0x4ac530=events[_0x3889be];var _0x260fd0=createListener('userProfile:'+_0x4ac530,_0x241919);UserProfileEvents['on'](_0x4ac530,_0x260fd0);}}; \ No newline at end of file +var _0xc03b=['removeListener','register','length','./userProfile.events','save','remove','update','emit'];(function(_0x258ca1,_0x25d637){var _0x1ef219=function(_0x1fc0f2){while(--_0x1fc0f2){_0x258ca1['push'](_0x258ca1['shift']());}};_0x1ef219(++_0x25d637);}(_0xc03b,0x83));var _0xbc03=function(_0x23785c,_0x1c6e72){_0x23785c=_0x23785c-0x0;var _0x2dc080=_0xc03b[_0x23785c];return _0x2dc080;};'use strict';var UserProfileEvents=require(_0xbc03('0x0'));var events=[_0xbc03('0x1'),_0xbc03('0x2'),_0xbc03('0x3')];function createListener(_0x2dcc64,_0x3f5d3c){return function(_0x1a2cb4){_0x3f5d3c[_0xbc03('0x4')](_0x2dcc64,_0x1a2cb4);};}function removeListener(_0x3c73d5,_0x245bdf){return function(){UserProfileEvents[_0xbc03('0x5')](_0x3c73d5,_0x245bdf);};}exports[_0xbc03('0x6')]=function(_0x184bbf){for(var _0x504aaa=0x0,_0x4156a0=events[_0xbc03('0x7')];_0x504aaa<_0x4156a0;_0x504aaa++){var _0x4aa40d=events[_0x504aaa];var _0x2fe125=createListener('userProfile:'+_0x4aa40d,_0x184bbf);UserProfileEvents['on'](_0x4aa40d,_0x2fe125);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 24ccf91..653ef90 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 _0x8556=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1eddaf,_0x248ccc){var _0xaa100f=function(_0x4764b5){while(--_0x4764b5){_0x1eddaf['push'](_0x1eddaf['shift']());}};_0xaa100f(++_0x248ccc);}(_0x8556,0x11d));var _0x6855=function(_0x3f0b15,_0xb88473){_0x3f0b15=_0x3f0b15-0x0;var _0x38f95f=_0x8556[_0x3f0b15];return _0x38f95f;};'use strict';var multer=require(_0x6855('0x0'));var util=require('util');var path=require(_0x6855('0x1'));var timeout=require(_0x6855('0x2'));var express=require(_0x6855('0x3'));var router=express[_0x6855('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6855('0x5'));var interaction=require(_0x6855('0x6'));var config=require(_0x6855('0x7'));var controller=require(_0x6855('0x8'));router[_0x6855('0x9')]('/',auth['isAuthenticated'](),controller[_0x6855('0xa')]);router[_0x6855('0x9')](_0x6855('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6855('0x9')](_0x6855('0xc'),auth[_0x6855('0xd')](),controller[_0x6855('0xe')]);router[_0x6855('0xf')]('/',auth['isAuthenticated'](),controller[_0x6855('0x10')]);router[_0x6855('0x11')](_0x6855('0xc'),auth[_0x6855('0xd')](),controller[_0x6855('0x12')]);router[_0x6855('0x13')]('/:id',auth[_0x6855('0xd')](),controller[_0x6855('0x14')]);module[_0x6855('0x15')]=router; \ No newline at end of file +var _0x5c3d=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c3d,0x122));var _0xd5c3=function(_0x3f24d7,_0x11d80e){_0x3f24d7=_0x3f24d7-0x0;var _0x3e0a22=_0x5c3d[_0x3f24d7];return _0x3e0a22;};'use strict';var multer=require(_0xd5c3('0x0'));var util=require(_0xd5c3('0x1'));var path=require('path');var timeout=require(_0xd5c3('0x2'));var express=require(_0xd5c3('0x3'));var router=express[_0xd5c3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd5c3('0x5'));var interaction=require(_0xd5c3('0x6'));var config=require(_0xd5c3('0x7'));var controller=require(_0xd5c3('0x8'));router['get']('/',auth[_0xd5c3('0x9')](),controller[_0xd5c3('0xa')]);router[_0xd5c3('0xb')](_0xd5c3('0xc'),auth['isAuthenticated'](),controller[_0xd5c3('0xd')]);router[_0xd5c3('0xb')](_0xd5c3('0xe'),auth[_0xd5c3('0x9')](),controller[_0xd5c3('0xf')]);router[_0xd5c3('0x10')]('/',auth[_0xd5c3('0x9')](),controller[_0xd5c3('0x11')]);router[_0xd5c3('0x12')](_0xd5c3('0xe'),auth['isAuthenticated'](),controller[_0xd5c3('0x13')]);router[_0xd5c3('0x14')]('/:id',auth[_0xd5c3('0x9')](),controller[_0xd5c3('0x15')]);module[_0xd5c3('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index c912b70..5f615a6 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 _0x8e39=['exports','sequelize'];(function(_0x579e75,_0x40fe61){var _0x53a03f=function(_0x10d79e){while(--_0x10d79e){_0x579e75['push'](_0x579e75['shift']());}};_0x53a03f(++_0x40fe61);}(_0x8e39,0xe7));var _0x98e3=function(_0x5b7a4a,_0x54c362){_0x5b7a4a=_0x5b7a4a-0x0;var _0x5feaf9=_0x8e39[_0x5b7a4a];return _0x5feaf9;};'use strict';var Sequelize=require(_0x98e3('0x0'));module[_0x98e3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xcb3c=['exports','INTEGER','STRING','sequelize'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0xcb3c,0x6b));var _0xccb3=function(_0x136492,_0x701cf4){_0x136492=_0x136492-0x0;var _0x1f0083=_0xcb3c[_0x136492];return _0x1f0083;};'use strict';var Sequelize=require(_0xccb3('0x0'));module[_0xccb3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xccb3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xccb3('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 719edbe..7ab68c3 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','UserProfileResource','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9536,0x179));var _0x6953=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x9536[_0x21aec3];return _0x288bbc;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['UserProfileResource']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));}; \ No newline at end of file +var _0x7880=['destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x2c7377,_0x32ade5){var _0x35e181=function(_0x1be1e6){while(--_0x1be1e6){_0x2c7377['push'](_0x2c7377['shift']());}};_0x35e181(++_0x32ade5);}(_0x7880,0x1f4));var _0x0788=function(_0x5c85c8,_0x16110b){_0x5c85c8=_0x5c85c8-0x0;var _0x42d66f=_0x7880[_0x5c85c8];return _0x42d66f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['UserProfileResource'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};exports['describe']=function(_0x1693d0,_0x5d32ae){return db['UserProfileResource'][_0x0788('0x4c')]()[_0x0788('0x26')](respondWithResult(_0x5d32ae,null))[_0x0788('0x44')](handleError(_0x5d32ae,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index eb1c5d3..6c712df 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 _0x9c4c=['compositeIndex','resourceId','sectionId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','user_profile_has_resources'];(function(_0x79afaa,_0x1f0dc5){var _0x32bf74=function(_0x1717c4){while(--_0x1717c4){_0x79afaa['push'](_0x79afaa['shift']());}};_0x32bf74(++_0x1f0dc5);}(_0x9c4c,0x1a3));var _0xc9c4=function(_0x405688,_0x1d3a8a){_0x405688=_0x405688-0x0;var _0x43c8bc=_0x9c4c[_0x405688];return _0x43c8bc;};'use strict';var _=require(_0xc9c4('0x0'));var util=require(_0xc9c4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc9c4('0x2'));var BPromise=require(_0xc9c4('0x3'));var rp=require(_0xc9c4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9c4('0x5'));var config=require(_0xc9c4('0x6'));var attributes=require('./userProfileResource.attributes');module[_0xc9c4('0x7')]=function(_0x1720a,_0x3381f0){return _0x1720a[_0xc9c4('0x8')]('UserProfileResource',attributes,{'tableName':_0xc9c4('0x9'),'paranoid':![],'indexes':[{'name':_0xc9c4('0xa'),'fields':[_0xc9c4('0xb'),_0xc9c4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5697=['api','moment','path','rimraf','define','user_profile_has_resources','compositeIndex','lodash','util','../../config/logger'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0x5697,0x179));var _0x7569=function(_0x23b1d5,_0x3043fa){_0x23b1d5=_0x23b1d5-0x0;var _0x3f5702=_0x5697[_0x23b1d5];return _0x3f5702;};'use strict';var _=require(_0x7569('0x0'));var util=require(_0x7569('0x1'));var logger=require(_0x7569('0x2'))(_0x7569('0x3'));var moment=require(_0x7569('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7569('0x5'));var rimraf=require(_0x7569('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x3a63b1,_0x231bcc){return _0x3a63b1[_0x7569('0x7')]('UserProfileResource',attributes,{'tableName':_0x7569('0x8'),'paranoid':![],'indexes':[{'name':_0x7569('0x9'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 9f6ab3f..0fa96ea 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 _0x1f5e=['error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21e488,_0x3aa391){var _0x48dc0f=function(_0x2a3126){while(--_0x2a3126){_0x21e488['push'](_0x21e488['shift']());}};_0x48dc0f(++_0x3aa391);}(_0x1f5e,0x99));var _0xe1f5=function(_0x6c067c,_0x2cbda9){_0x6c067c=_0x6c067c-0x0;var _0x5dc7fc=_0x1f5e[_0x6c067c];return _0x5dc7fc;};'use strict';var _=require('lodash');var util=require(_0xe1f5('0x0'));var moment=require(_0xe1f5('0x1'));var BPromise=require(_0xe1f5('0x2'));var rs=require(_0xe1f5('0x3'));var fs=require('fs');var Redis=require(_0xe1f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1f5('0x5'));var logger=require('../../config/logger')(_0xe1f5('0x6'));var config=require(_0xe1f5('0x7'));var jayson=require(_0xe1f5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba50f,_0x19de1a,_0x2b75a0){return new BPromise(function(_0x212cb5,_0x441dc8){return client['request'](_0x4ba50f,_0x2b75a0)[_0xe1f5('0x9')](function(_0x23ceed){logger[_0xe1f5('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x19de1a,_0xe1f5('0xb'));logger[_0xe1f5('0xc')](_0xe1f5('0xd'),_0x19de1a,_0xe1f5('0xb'),JSON[_0xe1f5('0xe')](_0x23ceed));if(_0x23ceed[_0xe1f5('0xf')]){if(_0x23ceed['error'][_0xe1f5('0x10')]===0x1f4){logger[_0xe1f5('0xf')](_0xe1f5('0x11'),_0x19de1a,_0x23ceed[_0xe1f5('0xf')][_0xe1f5('0x12')]);return _0x441dc8(_0x23ceed[_0xe1f5('0xf')]['message']);}logger[_0xe1f5('0xf')](_0xe1f5('0x11'),_0x19de1a,_0x23ceed[_0xe1f5('0xf')][_0xe1f5('0x12')]);return _0x212cb5(_0x23ceed[_0xe1f5('0xf')]['message']);}else{logger[_0xe1f5('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x19de1a,_0xe1f5('0xb'));_0x212cb5(_0x23ceed[_0xe1f5('0x13')][_0xe1f5('0x12')]);}})[_0xe1f5('0x14')](function(_0x991585){logger[_0xe1f5('0xf')](_0xe1f5('0x11'),_0x19de1a,_0x991585);_0x441dc8(_0x991585);});});} \ No newline at end of file +var _0x5c32=['code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3e549e,_0x5983c5){var _0x4d1602=function(_0x3e6d2a){while(--_0x3e6d2a){_0x3e549e['push'](_0x3e549e['shift']());}};_0x4d1602(++_0x5983c5);}(_0x5c32,0x1b4));var _0x25c3=function(_0x4cad25,_0x5870d8){_0x4cad25=_0x4cad25-0x0;var _0x1cf4d7=_0x5c32[_0x4cad25];return _0x1cf4d7;};'use strict';var _=require(_0x25c3('0x0'));var util=require(_0x25c3('0x1'));var moment=require(_0x25c3('0x2'));var BPromise=require(_0x25c3('0x3'));var rs=require(_0x25c3('0x4'));var fs=require('fs');var Redis=require(_0x25c3('0x5'));var db=require(_0x25c3('0x6'))['db'];var utils=require(_0x25c3('0x7'));var logger=require(_0x25c3('0x8'))(_0x25c3('0x9'));var config=require(_0x25c3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x25c3('0xb')][_0x25c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2cc56d,_0xa36819,_0x25a4b2){return new BPromise(function(_0x49d294,_0x4fd06a){return client[_0x25c3('0xd')](_0x2cc56d,_0x25a4b2)['then'](function(_0x3b6d18){logger[_0x25c3('0xe')](_0x25c3('0xf'),_0xa36819,_0x25c3('0x10'));logger[_0x25c3('0x11')](_0x25c3('0x12'),_0xa36819,'request\x20sent',JSON[_0x25c3('0x13')](_0x3b6d18));if(_0x3b6d18['error']){if(_0x3b6d18['error'][_0x25c3('0x14')]===0x1f4){logger[_0x25c3('0x15')](_0x25c3('0xf'),_0xa36819,_0x3b6d18[_0x25c3('0x15')]['message']);return _0x4fd06a(_0x3b6d18[_0x25c3('0x15')][_0x25c3('0x16')]);}logger[_0x25c3('0x15')](_0x25c3('0xf'),_0xa36819,_0x3b6d18[_0x25c3('0x15')][_0x25c3('0x16')]);return _0x49d294(_0x3b6d18[_0x25c3('0x15')]['message']);}else{logger[_0x25c3('0xe')]('UserProfileResource,\x20%s,\x20%s',_0xa36819,_0x25c3('0x10'));_0x49d294(_0x3b6d18[_0x25c3('0x17')][_0x25c3('0x16')]);}})['catch'](function(_0x46d33b){logger[_0x25c3('0x15')]('UserProfileResource,\x20%s,\x20%s',_0xa36819,_0x46d33b);_0x4fd06a(_0x46d33b);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 8e161cf..c5b8b50 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 _0x7e65=['Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','index','/describe','describe','isAuthenticated','show','post','create','put','/:id','update','delete','exports','util','path','express'];(function(_0x2f78bd,_0x3c4b24){var _0x48383e=function(_0x293c8d){while(--_0x293c8d){_0x2f78bd['push'](_0x2f78bd['shift']());}};_0x48383e(++_0x3c4b24);}(_0x7e65,0x1cb));var _0x57e6=function(_0xfd7b8,_0x4b30c4){_0xfd7b8=_0xfd7b8-0x0;var _0x494707=_0x7e65[_0xfd7b8];return _0x494707;};'use strict';var multer=require('multer');var util=require(_0x57e6('0x0'));var path=require(_0x57e6('0x1'));var timeout=require('connect-timeout');var express=require(_0x57e6('0x2'));var router=express[_0x57e6('0x3')]();var fs_extra=require(_0x57e6('0x4'));var auth=require(_0x57e6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x57e6('0x6'));var controller=require(_0x57e6('0x7'));router[_0x57e6('0x8')]('/',auth['isAuthenticated'](),controller[_0x57e6('0x9')]);router['get'](_0x57e6('0xa'),auth['isAuthenticated'](),controller[_0x57e6('0xb')]);router[_0x57e6('0x8')]('/:id',auth[_0x57e6('0xc')](),controller[_0x57e6('0xd')]);router[_0x57e6('0xe')]('/',auth[_0x57e6('0xc')](),controller[_0x57e6('0xf')]);router[_0x57e6('0x10')](_0x57e6('0x11'),auth[_0x57e6('0xc')](),controller[_0x57e6('0x12')]);router[_0x57e6('0x13')](_0x57e6('0x11'),auth[_0x57e6('0xc')](),controller['destroy']);module[_0x57e6('0x14')]=router; \ No newline at end of file +var _0xab1e=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x352f24,_0x347898){var _0x51dc78=function(_0xa42058){while(--_0xa42058){_0x352f24['push'](_0x352f24['shift']());}};_0x51dc78(++_0x347898);}(_0xab1e,0x10d));var _0xeab1=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xab1e[_0x39096d];return _0x13da4f;};'use strict';var multer=require(_0xeab1('0x0'));var util=require(_0xeab1('0x1'));var path=require(_0xeab1('0x2'));var timeout=require(_0xeab1('0x3'));var express=require('express');var router=express[_0xeab1('0x4')]();var fs_extra=require(_0xeab1('0x5'));var auth=require(_0xeab1('0x6'));var interaction=require(_0xeab1('0x7'));var config=require(_0xeab1('0x8'));var controller=require('./userProfileSection.controller');router[_0xeab1('0x9')]('/',auth['isAuthenticated'](),controller[_0xeab1('0xa')]);router['get'](_0xeab1('0xb'),auth[_0xeab1('0xc')](),controller[_0xeab1('0xd')]);router[_0xeab1('0x9')](_0xeab1('0xe'),auth[_0xeab1('0xc')](),controller[_0xeab1('0xf')]);router[_0xeab1('0x10')]('/',auth[_0xeab1('0xc')](),controller[_0xeab1('0x11')]);router[_0xeab1('0x12')](_0xeab1('0xe'),auth[_0xeab1('0xc')](),controller[_0xeab1('0x13')]);router[_0xeab1('0x14')](_0xeab1('0xe'),auth[_0xeab1('0xc')](),controller[_0xeab1('0x15')]);module[_0xeab1('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index a2039b1..327e886 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 _0x5ec6=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x58736a,_0x5d0121){var _0x4518e2=function(_0x2d9433){while(--_0x2d9433){_0x58736a['push'](_0x58736a['shift']());}};_0x4518e2(++_0x5d0121);}(_0x5ec6,0x7f));var _0x65ec=function(_0x4bab27,_0x126bf9){_0x4bab27=_0x4bab27-0x0;var _0x167e90=_0x5ec6[_0x4bab27];return _0x167e90;};'use strict';var Sequelize=require(_0x65ec('0x0'));module[_0x65ec('0x1')]={'name':{'type':Sequelize[_0x65ec('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x65ec('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x65ec('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x33751d){this['setDataValue'](_0x65ec('0x5'),_0x33751d?_0x33751d['join'](''):[]);},'get':function(){return this[_0x65ec('0x6')](_0x65ec('0x5'))?this['getDataValue'](_0x65ec('0x5'))[_0x65ec('0x7')](''):[];}}}; \ No newline at end of file +var _0x0fd9=['join','getDataValue','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0xd92811,_0x1f559f){var _0x29a5ea=function(_0x17b538){while(--_0x17b538){_0xd92811['push'](_0xd92811['shift']());}};_0x29a5ea(++_0x1f559f);}(_0x0fd9,0xa3));var _0x90fd=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x0fd9[_0x1304c6];return _0x2e6654;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'name':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x90fd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x90fd('0x1')],'set':function(_0x2a5f76){this[_0x90fd('0x3')](_0x90fd('0x4'),_0x2a5f76?_0x2a5f76[_0x90fd('0x5')](''):[]);},'get':function(){return this[_0x90fd('0x6')]('crudPermissions')?this['getDataValue'](_0x90fd('0x4'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d628029..c8cf650 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 _0x0049=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','name','send','index','map','UserProfileSection','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','includeAll','include','rows','catch','params','keys','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x4e5f22,_0x2241db){var _0x558b7b=function(_0x3656b9){while(--_0x3656b9){_0x4e5f22['push'](_0x4e5f22['shift']());}};_0x558b7b(++_0x2241db);}(_0x0049,0x1ea));var _0x9004=function(_0x24e8ef,_0x5bf1e8){_0x24e8ef=_0x24e8ef-0x0;var _0x509638=_0x0049[_0x24e8ef];return _0x509638;};'use strict';var emlformat=require(_0x9004('0x0'));var rimraf=require(_0x9004('0x1'));var zipdir=require(_0x9004('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9004('0x3'));var moment=require('moment');var BPromise=require(_0x9004('0x4'));var Mustache=require(_0x9004('0x5'));var util=require('util');var path=require(_0x9004('0x6'));var sox=require(_0x9004('0x7'));var csv=require(_0x9004('0x8'));var ejs=require(_0x9004('0x9'));var fs=require('fs');var fs_extra=require(_0x9004('0xa'));var _=require(_0x9004('0xb'));var squel=require(_0x9004('0xc'));var crypto=require(_0x9004('0xd'));var jsforce=require(_0x9004('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9004('0x8'));var querystring=require(_0x9004('0xf'));var Papa=require(_0x9004('0x10'));var Redis=require(_0x9004('0x11'));var authService=require(_0x9004('0x12'));var qs=require(_0x9004('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9004('0x14'));var logger=require('../../config/logger')(_0x9004('0x15'));var utils=require(_0x9004('0x16'));var config=require(_0x9004('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9004('0x18'))['db'];function respondWithStatusCode(_0x40da82,_0x2e0cba){_0x2e0cba=_0x2e0cba||0xcc;return function(_0x5102ef){if(_0x5102ef){return _0x40da82[_0x9004('0x19')](_0x2e0cba);}return _0x40da82[_0x9004('0x1a')](_0x2e0cba)[_0x9004('0x1b')]();};}function respondWithResult(_0x174519,_0xf7971f){_0xf7971f=_0xf7971f||0xc8;return function(_0x269070){if(_0x269070){return _0x174519[_0x9004('0x1a')](_0xf7971f)[_0x9004('0x1c')](_0x269070);}};}function respondWithFilteredResult(_0x14a70a,_0x1f49ec){return function(_0x52e35a){if(_0x52e35a){var _0x3ab558=typeof _0x1f49ec[_0x9004('0x1d')]===_0x9004('0x1e')&&typeof _0x1f49ec['limit']===_0x9004('0x1e');var _0x2a7bf8=_0x52e35a[_0x9004('0x1f')];var _0x1a9ba1=_0x3ab558?0x0:_0x1f49ec[_0x9004('0x1d')];var _0x374dea=_0x3ab558?_0x52e35a[_0x9004('0x1f')]:_0x1f49ec[_0x9004('0x1d')]+_0x1f49ec['limit'];var _0x39965c;if(_0x374dea>=_0x2a7bf8){_0x374dea=_0x2a7bf8;_0x39965c=0xc8;}else{_0x39965c=0xce;}_0x14a70a[_0x9004('0x1a')](_0x39965c);return _0x14a70a['set'](_0x9004('0x20'),_0x1a9ba1+'-'+_0x374dea+'/'+_0x2a7bf8)[_0x9004('0x1c')](_0x52e35a);}return null;};}function patchUpdates(_0x4b934e){return function(_0x298673){try{jsonpatch[_0x9004('0x21')](_0x298673,_0x4b934e,!![]);}catch(_0x177466){return BPromise[_0x9004('0x22')](_0x177466);}return _0x298673[_0x9004('0x23')]();};}function saveUpdates(_0x52f7d1,_0x51b379){return function(_0x2730f4){if(_0x2730f4){return _0x2730f4[_0x9004('0x24')](_0x52f7d1)[_0x9004('0x25')](function(_0x5d11a8){return _0x5d11a8;});}return null;};}function removeEntity(_0x29dc43,_0x91cfa7){return function(_0x55f016){if(_0x55f016){return _0x55f016['destroy']()[_0x9004('0x25')](function(){_0x29dc43['status'](0xcc)[_0x9004('0x1b')]();});}};}function handleEntityNotFound(_0x31e283,_0x9b67af){return function(_0x2233ee){if(!_0x2233ee){_0x31e283['sendStatus'](0x194);}return _0x2233ee;};}function handleError(_0x19dca7,_0x1ad74e){_0x1ad74e=_0x1ad74e||0x1f4;return function(_0x217202){logger['error'](_0x217202['stack']);if(_0x217202[_0x9004('0x26')]){delete _0x217202['name'];}_0x19dca7[_0x9004('0x1a')](_0x1ad74e)[_0x9004('0x27')](_0x217202);};}exports[_0x9004('0x28')]=function(_0x3e1c17,_0x5d5035){var _0x447780={},_0xda353f={},_0x427bec={'count':0x0,'rows':[]};var _0x571f81=_[_0x9004('0x29')](db[_0x9004('0x2a')]['rawAttributes'],function(_0x1a94f8){return{'name':_0x1a94f8[_0x9004('0x2b')],'type':_0x1a94f8['type'][_0x9004('0x2c')]};});_0xda353f[_0x9004('0x2d')]=_[_0x9004('0x29')](_0x571f81,_0x9004('0x26'));_0xda353f[_0x9004('0x2e')]=_['keys'](_0x3e1c17['query']);_0xda353f['filters']=_[_0x9004('0x2f')](_0xda353f[_0x9004('0x2d')],_0xda353f[_0x9004('0x2e')]);_0x447780[_0x9004('0x30')]=_[_0x9004('0x2f')](_0xda353f[_0x9004('0x2d')],qs['fields'](_0x3e1c17[_0x9004('0x2e')][_0x9004('0x31')]));_0x447780[_0x9004('0x30')]=_0x447780['attributes'][_0x9004('0x32')]?_0x447780[_0x9004('0x30')]:_0xda353f[_0x9004('0x2d')];if(!_0x3e1c17[_0x9004('0x2e')][_0x9004('0x33')](_0x9004('0x34'))){_0x447780['limit']=qs[_0x9004('0x35')](_0x3e1c17[_0x9004('0x2e')][_0x9004('0x35')]);_0x447780[_0x9004('0x1d')]=qs['offset'](_0x3e1c17[_0x9004('0x2e')]['offset']);}_0x447780[_0x9004('0x36')]=qs[_0x9004('0x37')](_0x3e1c17[_0x9004('0x2e')][_0x9004('0x37')]);_0x447780[_0x9004('0x38')]=qs[_0x9004('0x39')](_['pick'](_0x3e1c17[_0x9004('0x2e')],_0xda353f[_0x9004('0x39')]),_0x571f81);if(_0x3e1c17['query'][_0x9004('0x3a')]){_0x447780[_0x9004('0x38')]=_[_0x9004('0x3b')](_0x447780[_0x9004('0x38')],{'$or':_[_0x9004('0x29')](_0x571f81,function(_0x2325de){if(_0x2325de[_0x9004('0x3c')]!=='VIRTUAL'){var _0x55d4a1={};_0x55d4a1[_0x2325de[_0x9004('0x26')]]={'$like':'%'+_0x3e1c17[_0x9004('0x2e')][_0x9004('0x3a')]+'%'};return _0x55d4a1;}})});}_0x447780=_[_0x9004('0x3b')]({},_0x447780,_0x3e1c17['options']);var _0x1a0866={'where':_0x447780[_0x9004('0x38')]};return db['UserProfileSection'][_0x9004('0x1f')](_0x1a0866)[_0x9004('0x25')](function(_0x3b9d63){_0x427bec[_0x9004('0x1f')]=_0x3b9d63;if(_0x3e1c17[_0x9004('0x2e')][_0x9004('0x3d')]){_0x447780[_0x9004('0x3e')]=[{'all':!![]}];}return db[_0x9004('0x2a')]['findAll'](_0x447780);})[_0x9004('0x25')](function(_0x2cb949){_0x427bec[_0x9004('0x3f')]=_0x2cb949;return _0x427bec;})[_0x9004('0x25')](respondWithFilteredResult(_0x5d5035,_0x447780))[_0x9004('0x40')](handleError(_0x5d5035,null));};exports['show']=function(_0x37e3b8,_0x1c891f){var _0x4c0985={'raw':![],'where':{'id':_0x37e3b8[_0x9004('0x41')]['id']}},_0x38fab2={};_0x38fab2[_0x9004('0x2d')]=_[_0x9004('0x42')](db[_0x9004('0x2a')]['rawAttributes']);_0x38fab2[_0x9004('0x2e')]=_['keys'](_0x37e3b8[_0x9004('0x2e')]);_0x38fab2[_0x9004('0x39')]=_[_0x9004('0x2f')](_0x38fab2['model'],_0x38fab2[_0x9004('0x2e')]);_0x4c0985[_0x9004('0x30')]=_['intersection'](_0x38fab2['model'],qs[_0x9004('0x31')](_0x37e3b8['query'][_0x9004('0x31')]));_0x4c0985[_0x9004('0x30')]=_0x4c0985['attributes'][_0x9004('0x32')]?_0x4c0985[_0x9004('0x30')]:_0x38fab2['model'];if(_0x37e3b8[_0x9004('0x2e')][_0x9004('0x3d')]){_0x4c0985[_0x9004('0x3e')]=[{'all':!![]}];}_0x4c0985=_[_0x9004('0x3b')]({},_0x4c0985,_0x37e3b8[_0x9004('0x43')]);return db['UserProfileSection'][_0x9004('0x44')](_0x4c0985)['then'](handleEntityNotFound(_0x1c891f,null))[_0x9004('0x25')](respondWithResult(_0x1c891f,null))[_0x9004('0x40')](handleError(_0x1c891f,null));};exports[_0x9004('0x45')]=function(_0x5c22a5,_0xad93cd){return db[_0x9004('0x2a')][_0x9004('0x45')](_0x5c22a5['body'],{})[_0x9004('0x25')](respondWithResult(_0xad93cd,0xc9))[_0x9004('0x40')](handleError(_0xad93cd,null));};exports[_0x9004('0x24')]=function(_0x39fc4d,_0x5595dd){if(_0x39fc4d['body']['id']){delete _0x39fc4d[_0x9004('0x46')]['id'];}return db[_0x9004('0x2a')][_0x9004('0x44')]({'where':{'id':_0x39fc4d[_0x9004('0x41')]['id']}})[_0x9004('0x25')](handleEntityNotFound(_0x5595dd,null))[_0x9004('0x25')](saveUpdates(_0x39fc4d[_0x9004('0x46')],null))[_0x9004('0x25')](respondWithResult(_0x5595dd,null))['catch'](handleError(_0x5595dd,null));};exports[_0x9004('0x47')]=function(_0x1558dc,_0x298ea6){return db[_0x9004('0x2a')][_0x9004('0x44')]({'where':{'id':_0x1558dc[_0x9004('0x41')]['id']}})[_0x9004('0x25')](handleEntityNotFound(_0x298ea6,null))[_0x9004('0x25')](removeEntity(_0x298ea6,null))['catch'](handleError(_0x298ea6,null));};exports[_0x9004('0x48')]=function(_0x1a9231,_0x1907d7){return db[_0x9004('0x2a')][_0x9004('0x48')]()['then'](respondWithResult(_0x1907d7,null))[_0x9004('0x40')](handleError(_0x1907d7,null));}; \ No newline at end of file +var _0xcd6a=['rows','includeAll','find','catch','create','body','params','describe','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','save','update','then','destroy','stack','name','send','index','UserProfileSection','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','include'];(function(_0x53c9dc,_0x450453){var _0x1c147b=function(_0x3e185f){while(--_0x3e185f){_0x53c9dc['push'](_0x53c9dc['shift']());}};_0x1c147b(++_0x450453);}(_0xcd6a,0x1be));var _0xacd6=function(_0x55b823,_0x1eb4fd){_0x55b823=_0x55b823-0x0;var _0x3131e5=_0xcd6a[_0x55b823];return _0x3131e5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xacd6('0x0'));var rp=require(_0xacd6('0x1'));var moment=require(_0xacd6('0x2'));var BPromise=require(_0xacd6('0x3'));var Mustache=require(_0xacd6('0x4'));var util=require('util');var path=require(_0xacd6('0x5'));var sox=require(_0xacd6('0x6'));var csv=require(_0xacd6('0x7'));var ejs=require(_0xacd6('0x8'));var fs=require('fs');var fs_extra=require(_0xacd6('0x9'));var _=require(_0xacd6('0xa'));var squel=require(_0xacd6('0xb'));var crypto=require(_0xacd6('0xc'));var jsforce=require(_0xacd6('0xd'));var deskjs=require(_0xacd6('0xe'));var toCsv=require(_0xacd6('0x7'));var querystring=require(_0xacd6('0xf'));var Papa=require(_0xacd6('0x10'));var Redis=require(_0xacd6('0x11'));var authService=require(_0xacd6('0x12'));var qs=require(_0xacd6('0x13'));var as=require(_0xacd6('0x14'));var hardwareService=require(_0xacd6('0x15'));var logger=require('../../config/logger')(_0xacd6('0x16'));var utils=require(_0xacd6('0x17'));var config=require(_0xacd6('0x18'));var licenseUtil=require(_0xacd6('0x19'));var db=require(_0xacd6('0x1a'))['db'];function respondWithStatusCode(_0x3d4a2d,_0x258926){_0x258926=_0x258926||0xcc;return function(_0x112e3f){if(_0x112e3f){return _0x3d4a2d[_0xacd6('0x1b')](_0x258926);}return _0x3d4a2d['status'](_0x258926)['end']();};}function respondWithResult(_0xfcaf6,_0x2da768){_0x2da768=_0x2da768||0xc8;return function(_0x3fc82b){if(_0x3fc82b){return _0xfcaf6[_0xacd6('0x1c')](_0x2da768)['json'](_0x3fc82b);}};}function respondWithFilteredResult(_0x4e6e63,_0x1fa2e2){return function(_0x520f62){if(_0x520f62){var _0x3ebf28=typeof _0x1fa2e2['offset']===_0xacd6('0x1d')&&typeof _0x1fa2e2[_0xacd6('0x1e')]===_0xacd6('0x1d');var _0x124f30=_0x520f62[_0xacd6('0x1f')];var _0x3f6b4e=_0x3ebf28?0x0:_0x1fa2e2['offset'];var _0x2b3ca2=_0x3ebf28?_0x520f62[_0xacd6('0x1f')]:_0x1fa2e2[_0xacd6('0x20')]+_0x1fa2e2[_0xacd6('0x1e')];var _0x50c009;if(_0x2b3ca2>=_0x124f30){_0x2b3ca2=_0x124f30;_0x50c009=0xc8;}else{_0x50c009=0xce;}_0x4e6e63[_0xacd6('0x1c')](_0x50c009);return _0x4e6e63[_0xacd6('0x21')](_0xacd6('0x22'),_0x3f6b4e+'-'+_0x2b3ca2+'/'+_0x124f30)[_0xacd6('0x23')](_0x520f62);}return null;};}function patchUpdates(_0x16f95f){return function(_0x43eb12){try{jsonpatch['apply'](_0x43eb12,_0x16f95f,!![]);}catch(_0x2a4065){return BPromise['reject'](_0x2a4065);}return _0x43eb12[_0xacd6('0x24')]();};}function saveUpdates(_0x4b6f96,_0x21f31a){return function(_0x29d263){if(_0x29d263){return _0x29d263[_0xacd6('0x25')](_0x4b6f96)[_0xacd6('0x26')](function(_0x3835bd){return _0x3835bd;});}return null;};}function removeEntity(_0x38967b,_0x5a9d51){return function(_0x41fc09){if(_0x41fc09){return _0x41fc09[_0xacd6('0x27')]()[_0xacd6('0x26')](function(){_0x38967b[_0xacd6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x114b1a,_0x17dafa){return function(_0xfc826a){if(!_0xfc826a){_0x114b1a[_0xacd6('0x1b')](0x194);}return _0xfc826a;};}function handleError(_0x1d7899,_0x35b29b){_0x35b29b=_0x35b29b||0x1f4;return function(_0xa693a0){logger['error'](_0xa693a0[_0xacd6('0x28')]);if(_0xa693a0[_0xacd6('0x29')]){delete _0xa693a0['name'];}_0x1d7899['status'](_0x35b29b)[_0xacd6('0x2a')](_0xa693a0);};}exports[_0xacd6('0x2b')]=function(_0x38c027,_0x5d194f){var _0x50515e={},_0x110b88={},_0x674a38={'count':0x0,'rows':[]};var _0x9c6c02=_['map'](db[_0xacd6('0x2c')][_0xacd6('0x2d')],function(_0x58ead6){return{'name':_0x58ead6['fieldName'],'type':_0x58ead6['type'][_0xacd6('0x2e')]};});_0x110b88[_0xacd6('0x2f')]=_[_0xacd6('0x30')](_0x9c6c02,_0xacd6('0x29'));_0x110b88[_0xacd6('0x31')]=_[_0xacd6('0x32')](_0x38c027['query']);_0x110b88[_0xacd6('0x33')]=_['intersection'](_0x110b88['model'],_0x110b88[_0xacd6('0x31')]);_0x50515e[_0xacd6('0x34')]=_[_0xacd6('0x35')](_0x110b88['model'],qs[_0xacd6('0x36')](_0x38c027['query'][_0xacd6('0x36')]));_0x50515e[_0xacd6('0x34')]=_0x50515e[_0xacd6('0x34')][_0xacd6('0x37')]?_0x50515e['attributes']:_0x110b88[_0xacd6('0x2f')];if(!_0x38c027[_0xacd6('0x31')][_0xacd6('0x38')](_0xacd6('0x39'))){_0x50515e[_0xacd6('0x1e')]=qs['limit'](_0x38c027[_0xacd6('0x31')]['limit']);_0x50515e[_0xacd6('0x20')]=qs['offset'](_0x38c027[_0xacd6('0x31')][_0xacd6('0x20')]);}_0x50515e['order']=qs[_0xacd6('0x3a')](_0x38c027['query']['sort']);_0x50515e[_0xacd6('0x3b')]=qs[_0xacd6('0x33')](_[_0xacd6('0x3c')](_0x38c027[_0xacd6('0x31')],_0x110b88[_0xacd6('0x33')]),_0x9c6c02);if(_0x38c027['query'][_0xacd6('0x3d')]){_0x50515e[_0xacd6('0x3b')]=_['merge'](_0x50515e['where'],{'$or':_[_0xacd6('0x30')](_0x9c6c02,function(_0x4771bf){if(_0x4771bf[_0xacd6('0x3e')]!=='VIRTUAL'){var _0x2cf3b7={};_0x2cf3b7[_0x4771bf[_0xacd6('0x29')]]={'$like':'%'+_0x38c027[_0xacd6('0x31')][_0xacd6('0x3d')]+'%'};return _0x2cf3b7;}})});}_0x50515e=_[_0xacd6('0x3f')]({},_0x50515e,_0x38c027['options']);var _0x9abf0e={'where':_0x50515e[_0xacd6('0x3b')]};return db[_0xacd6('0x2c')][_0xacd6('0x1f')](_0x9abf0e)[_0xacd6('0x26')](function(_0x55bfca){_0x674a38['count']=_0x55bfca;if(_0x38c027['query']['includeAll']){_0x50515e[_0xacd6('0x40')]=[{'all':!![]}];}return db[_0xacd6('0x2c')]['findAll'](_0x50515e);})[_0xacd6('0x26')](function(_0xb87e3c){_0x674a38[_0xacd6('0x41')]=_0xb87e3c;return _0x674a38;})[_0xacd6('0x26')](respondWithFilteredResult(_0x5d194f,_0x50515e))['catch'](handleError(_0x5d194f,null));};exports['show']=function(_0x364ca1,_0x2aa087){var _0x15ae95={'raw':![],'where':{'id':_0x364ca1['params']['id']}},_0x1049e9={};_0x1049e9['model']=_[_0xacd6('0x32')](db[_0xacd6('0x2c')][_0xacd6('0x2d')]);_0x1049e9[_0xacd6('0x31')]=_[_0xacd6('0x32')](_0x364ca1[_0xacd6('0x31')]);_0x1049e9[_0xacd6('0x33')]=_[_0xacd6('0x35')](_0x1049e9[_0xacd6('0x2f')],_0x1049e9[_0xacd6('0x31')]);_0x15ae95['attributes']=_[_0xacd6('0x35')](_0x1049e9[_0xacd6('0x2f')],qs['fields'](_0x364ca1[_0xacd6('0x31')][_0xacd6('0x36')]));_0x15ae95[_0xacd6('0x34')]=_0x15ae95[_0xacd6('0x34')][_0xacd6('0x37')]?_0x15ae95[_0xacd6('0x34')]:_0x1049e9[_0xacd6('0x2f')];if(_0x364ca1[_0xacd6('0x31')][_0xacd6('0x42')]){_0x15ae95['include']=[{'all':!![]}];}_0x15ae95=_['merge']({},_0x15ae95,_0x364ca1['options']);return db[_0xacd6('0x2c')][_0xacd6('0x43')](_0x15ae95)['then'](handleEntityNotFound(_0x2aa087,null))[_0xacd6('0x26')](respondWithResult(_0x2aa087,null))[_0xacd6('0x44')](handleError(_0x2aa087,null));};exports[_0xacd6('0x45')]=function(_0x31d19c,_0xc6a14f){return db[_0xacd6('0x2c')][_0xacd6('0x45')](_0x31d19c[_0xacd6('0x46')],{})[_0xacd6('0x26')](respondWithResult(_0xc6a14f,0xc9))[_0xacd6('0x44')](handleError(_0xc6a14f,null));};exports[_0xacd6('0x25')]=function(_0x51d2a5,_0x218a99){if(_0x51d2a5[_0xacd6('0x46')]['id']){delete _0x51d2a5[_0xacd6('0x46')]['id'];}return db[_0xacd6('0x2c')][_0xacd6('0x43')]({'where':{'id':_0x51d2a5[_0xacd6('0x47')]['id']}})[_0xacd6('0x26')](handleEntityNotFound(_0x218a99,null))[_0xacd6('0x26')](saveUpdates(_0x51d2a5[_0xacd6('0x46')],null))[_0xacd6('0x26')](respondWithResult(_0x218a99,null))[_0xacd6('0x44')](handleError(_0x218a99,null));};exports[_0xacd6('0x27')]=function(_0x455ba8,_0x3cfbf6){return db[_0xacd6('0x2c')]['find']({'where':{'id':_0x455ba8[_0xacd6('0x47')]['id']}})[_0xacd6('0x26')](handleEntityNotFound(_0x3cfbf6,null))[_0xacd6('0x26')](removeEntity(_0x3cfbf6,null))[_0xacd6('0x44')](handleError(_0x3cfbf6,null));};exports[_0xacd6('0x48')]=function(_0x52c11b,_0x49ae4d){return db[_0xacd6('0x2c')][_0xacd6('0x48')]()['then'](respondWithResult(_0x49ae4d,null))[_0xacd6('0x44')](handleError(_0x49ae4d,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 74fd79e..4f1389a 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 _0x06f6=['util','../../config/logger','moment','request-promise','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash'];(function(_0x29ec9a,_0x23a12b){var _0x3518a5=function(_0x582430){while(--_0x582430){_0x29ec9a['push'](_0x29ec9a['shift']());}};_0x3518a5(++_0x23a12b);}(_0x06f6,0x67));var _0x606f=function(_0x2dbee0,_0xb6833e){_0x2dbee0=_0x2dbee0-0x0;var _0x376cdb=_0x06f6[_0x2dbee0];return _0x376cdb;};'use strict';var _=require(_0x606f('0x0'));var util=require(_0x606f('0x1'));var logger=require(_0x606f('0x2'))('api');var moment=require(_0x606f('0x3'));var BPromise=require('bluebird');var rp=require(_0x606f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x606f('0x5'));var attributes=require(_0x606f('0x6'));module[_0x606f('0x7')]=function(_0x574e79,_0x766999){return _0x574e79[_0x606f('0x8')](_0x606f('0x9'),attributes,{'tableName':_0x606f('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x606f('0xb'),_0x606f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae7c=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','util','../../config/logger','api','moment','path'];(function(_0x3e65c2,_0x3f6ff9){var _0x3e5a4f=function(_0x267e36){while(--_0x267e36){_0x3e65c2['push'](_0x3e65c2['shift']());}};_0x3e5a4f(++_0x3f6ff9);}(_0xae7c,0x167));var _0xcae7=function(_0x83c1ce,_0x18f393){_0x83c1ce=_0x83c1ce-0x0;var _0x3368ff=_0xae7c[_0x83c1ce];return _0x3368ff;};'use strict';var _=require('lodash');var util=require(_0xcae7('0x0'));var logger=require(_0xcae7('0x1'))(_0xcae7('0x2'));var moment=require(_0xcae7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcae7('0x4'));var rimraf=require(_0xcae7('0x5'));var config=require(_0xcae7('0x6'));var attributes=require(_0xcae7('0x7'));module[_0xcae7('0x8')]=function(_0x2b1370,_0x4cad1c){return _0x2b1370[_0xcae7('0x9')](_0xcae7('0xa'),attributes,{'tableName':_0xcae7('0xb'),'paranoid':![],'indexes':[{'name':_0xcae7('0xc'),'fields':[_0xcae7('0xd'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index f6171f4..85bed84 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 _0xf40b=['client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2d13b1,_0x2678d5){var _0x18c844=function(_0x4b0e6c){while(--_0x4b0e6c){_0x2d13b1['push'](_0x2d13b1['shift']());}};_0x18c844(++_0x2678d5);}(_0xf40b,0xfb));var _0xbf40=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xf40b[_0x49ca18];return _0x145d54;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var moment=require(_0xbf40('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf40('0x2'));var fs=require('fs');var Redis=require(_0xbf40('0x3'));var db=require(_0xbf40('0x4'))['db'];var utils=require(_0xbf40('0x5'));var logger=require(_0xbf40('0x6'))('rpc');var config=require(_0xbf40('0x7'));var jayson=require(_0xbf40('0x8'));var client=jayson[_0xbf40('0x9')][_0xbf40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf5944d,_0x5db112,_0x6026a0){return new BPromise(function(_0x31384b,_0x2b872b){return client['request'](_0xf5944d,_0x6026a0)[_0xbf40('0xb')](function(_0x266634){logger[_0xbf40('0xc')](_0xbf40('0xd'),_0x5db112,_0xbf40('0xe'));logger[_0xbf40('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5db112,_0xbf40('0xe'),JSON['stringify'](_0x266634));if(_0x266634[_0xbf40('0x10')]){if(_0x266634[_0xbf40('0x10')][_0xbf40('0x11')]===0x1f4){logger[_0xbf40('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x5db112,_0x266634[_0xbf40('0x10')][_0xbf40('0x12')]);return _0x2b872b(_0x266634['error'][_0xbf40('0x12')]);}logger[_0xbf40('0x10')](_0xbf40('0xd'),_0x5db112,_0x266634[_0xbf40('0x10')][_0xbf40('0x12')]);return _0x31384b(_0x266634[_0xbf40('0x10')][_0xbf40('0x12')]);}else{logger['info'](_0xbf40('0xd'),_0x5db112,_0xbf40('0xe'));_0x31384b(_0x266634['result'][_0xbf40('0x12')]);}})[_0xbf40('0x13')](function(_0x6375a4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5db112,_0x6375a4);_0x2b872b(_0x6375a4);});});} \ No newline at end of file +var _0x9f04=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','info','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f04,0x12a));var _0x49f0=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x9f04[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x49f0('0x0'));var util=require(_0x49f0('0x1'));var moment=require('moment');var BPromise=require(_0x49f0('0x2'));var rs=require(_0x49f0('0x3'));var fs=require('fs');var Redis=require(_0x49f0('0x4'));var db=require(_0x49f0('0x5'))['db'];var utils=require(_0x49f0('0x6'));var logger=require(_0x49f0('0x7'))(_0x49f0('0x8'));var config=require('../../config/environment');var jayson=require(_0x49f0('0x9'));var client=jayson[_0x49f0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e0e9,_0x4c72aa,_0x59b005){return new BPromise(function(_0x12120e,_0xbf3580){return client[_0x49f0('0xb')](_0x39e0e9,_0x59b005)[_0x49f0('0xc')](function(_0x48486b){logger['info'](_0x49f0('0xd'),_0x4c72aa,_0x49f0('0xe'));logger['debug'](_0x49f0('0xf'),_0x4c72aa,'request\x20sent',JSON['stringify'](_0x48486b));if(_0x48486b[_0x49f0('0x10')]){if(_0x48486b[_0x49f0('0x10')]['code']===0x1f4){logger[_0x49f0('0x10')](_0x49f0('0xd'),_0x4c72aa,_0x48486b[_0x49f0('0x10')]['message']);return _0xbf3580(_0x48486b[_0x49f0('0x10')]['message']);}logger[_0x49f0('0x10')](_0x49f0('0xd'),_0x4c72aa,_0x48486b['error']['message']);return _0x12120e(_0x48486b[_0x49f0('0x10')]['message']);}else{logger[_0x49f0('0x11')](_0x49f0('0xd'),_0x4c72aa,_0x49f0('0xe'));_0x12120e(_0x48486b[_0x49f0('0x12')]['message']);}})[_0x49f0('0x13')](function(_0x2b6ca6){logger[_0x49f0('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x4c72aa,_0x2b6ca6);_0xbf3580(_0x2b6ca6);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index fe5a67b..38c0040 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x39c4d9,_0x196c1a){var _0x3091a2=function(_0x32ea57){while(--_0x32ea57){_0x39c4d9['push'](_0x39c4d9['shift']());}};_0x3091a2(++_0x196c1a);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x526d6c,_0x1cc58a){var _0x43b854=function(_0x2768d5){while(--_0x2768d5){_0x526d6c['push'](_0x526d6c['shift']());}};_0x43b854(++_0x1cc58a);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index caaade9..195615e 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 _0x2d0f=['exports'];(function(_0x3e5113,_0x5e5e39){var _0x15a981=function(_0x454747){while(--_0x454747){_0x3e5113['push'](_0x3e5113['shift']());}};_0x15a981(++_0x5e5e39);}(_0x2d0f,0x17f));var _0xf2d0=function(_0x49ff25,_0x1e0f82){_0x49ff25=_0x49ff25-0x0;var _0x302a99=_0x2d0f[_0x49ff25];return _0x302a99;};'use strict';var Sequelize=require('sequelize');module[_0xf2d0('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x556a=['INTEGER'];(function(_0x4508a5,_0x165134){var _0xeba54a=function(_0x501c39){while(--_0x501c39){_0x4508a5['push'](_0x4508a5['shift']());}};_0xeba54a(++_0x165134);}(_0x556a,0x14e));var _0xa556=function(_0x194576,_0x543558){_0x194576=_0x194576-0x0;var _0x67603e=_0x556a[_0x194576];return _0x67603e;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xa556('0x0')],'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 9fc1397..92b1089 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 _0xd481=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0xd481,0x1e4));var _0x1d48=function(_0x203e92,_0x5052f2){_0x203e92=_0x203e92-0x0;var _0x458d46=_0xd481[_0x203e92];return _0x458d46;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var logger=require(_0x1d48('0x1'))(_0x1d48('0x2'));var moment=require('moment');var BPromise=require(_0x1d48('0x3'));var rp=require(_0x1d48('0x4'));var fs=require('fs');var path=require(_0x1d48('0x5'));var rimraf=require('rimraf');var config=require(_0x1d48('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x1d48('0x7')]=function(_0x2a4830,_0x5a0c28){return _0x2a4830[_0x1d48('0x8')](_0x1d48('0x9'),attributes,{'tableName':_0x1d48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11e5=['path','../../config/environment','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x35b2e8,_0x394230){var _0x4b4b3e=function(_0x41d387){while(--_0x41d387){_0x35b2e8['push'](_0x35b2e8['shift']());}};_0x4b4b3e(++_0x394230);}(_0x11e5,0x8b));var _0x511e=function(_0xf7f60a,_0x15f736){_0xf7f60a=_0xf7f60a-0x0;var _0x2567ad=_0x11e5[_0xf7f60a];return _0x2567ad;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','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 0a1fe16..aefbe2d 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 _0x2d1f=['../../config/utils','../../config/logger','rpc','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x2d1f,0x19e));var _0xf2d1=function(_0x27f1b8,_0x490d6e){_0x27f1b8=_0x27f1b8-0x0;var _0x3e56bd=_0x2d1f[_0x27f1b8];return _0x3e56bd;};'use strict';var _=require(_0xf2d1('0x0'));var util=require(_0xf2d1('0x1'));var moment=require(_0xf2d1('0x2'));var BPromise=require('bluebird');var rs=require(_0xf2d1('0x3'));var fs=require('fs');var Redis=require(_0xf2d1('0x4'));var db=require(_0xf2d1('0x5'))['db'];var utils=require(_0xf2d1('0x6'));var logger=require(_0xf2d1('0x7'))(_0xf2d1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1127f4,_0x3632ed,_0x507b2f){return new BPromise(function(_0x482932,_0x408c8a){return client[_0xf2d1('0x9')](_0x1127f4,_0x507b2f)[_0xf2d1('0xa')](function(_0x7d4983){logger[_0xf2d1('0xb')](_0xf2d1('0xc'),_0x3632ed,_0xf2d1('0xd'));logger['debug'](_0xf2d1('0xe'),_0x3632ed,'request\x20sent',JSON['stringify'](_0x7d4983));if(_0x7d4983[_0xf2d1('0xf')]){if(_0x7d4983[_0xf2d1('0xf')][_0xf2d1('0x10')]===0x1f4){logger['error'](_0xf2d1('0xc'),_0x3632ed,_0x7d4983['error'][_0xf2d1('0x11')]);return _0x408c8a(_0x7d4983[_0xf2d1('0xf')][_0xf2d1('0x11')]);}logger[_0xf2d1('0xf')](_0xf2d1('0xc'),_0x3632ed,_0x7d4983[_0xf2d1('0xf')]['message']);return _0x482932(_0x7d4983['error'][_0xf2d1('0x11')]);}else{logger[_0xf2d1('0xb')](_0xf2d1('0xc'),_0x3632ed,_0xf2d1('0xd'));_0x482932(_0x7d4983[_0xf2d1('0x12')][_0xf2d1('0x11')]);}})[_0xf2d1('0x13')](function(_0x1773eb){logger[_0xf2d1('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x3632ed,_0x1773eb);_0x408c8a(_0x1773eb);});});} \ No newline at end of file +var _0x1a28=['code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x6129aa,_0x229ae4){var _0x12602e=function(_0x5b96c6){while(--_0x5b96c6){_0x6129aa['push'](_0x6129aa['shift']());}};_0x12602e(++_0x229ae4);}(_0x1a28,0x145));var _0x81a2=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x1a28[_0x4f4d19];return _0x27a258;};'use strict';var _=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81a2('0x2'));var fs=require('fs');var Redis=require(_0x81a2('0x3'));var db=require(_0x81a2('0x4'))['db'];var utils=require(_0x81a2('0x5'));var logger=require(_0x81a2('0x6'))(_0x81a2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x81a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47f75f,_0x4bfa72,_0x2afb94){return new BPromise(function(_0x1802a0,_0x24356a){return client['request'](_0x47f75f,_0x2afb94)[_0x81a2('0x9')](function(_0x566d49){logger['info'](_0x81a2('0xa'),_0x4bfa72,_0x81a2('0xb'));logger[_0x81a2('0xc')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4bfa72,_0x81a2('0xb'),JSON[_0x81a2('0xd')](_0x566d49));if(_0x566d49[_0x81a2('0xe')]){if(_0x566d49[_0x81a2('0xe')][_0x81a2('0xf')]===0x1f4){logger['error'](_0x81a2('0xa'),_0x4bfa72,_0x566d49['error']['message']);return _0x24356a(_0x566d49['error'][_0x81a2('0x10')]);}logger[_0x81a2('0xe')](_0x81a2('0xa'),_0x4bfa72,_0x566d49[_0x81a2('0xe')][_0x81a2('0x10')]);return _0x1802a0(_0x566d49['error'][_0x81a2('0x10')]);}else{logger[_0x81a2('0x11')](_0x81a2('0xa'),_0x4bfa72,_0x81a2('0xb'));_0x1802a0(_0x566d49[_0x81a2('0x12')][_0x81a2('0x10')]);}})[_0x81a2('0x13')](function(_0x5b8cae){logger['error'](_0x81a2('0xa'),_0x4bfa72,_0x5b8cae);_0x24356a(_0x5b8cae);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 446d613..f37079e 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 _0x9ef2=['sequelize','exports','INTEGER'];(function(_0x15e0d2,_0x8333c){var _0x45bb73=function(_0x52cb41){while(--_0x52cb41){_0x15e0d2['push'](_0x15e0d2['shift']());}};_0x45bb73(++_0x8333c);}(_0x9ef2,0xdb));var _0x29ef=function(_0x4b981d,_0x31194a){_0x4b981d=_0x4b981d-0x0;var _0x46a6bb=_0x9ef2[_0x4b981d];return _0x46a6bb;};'use strict';var Sequelize=require(_0x29ef('0x0'));module[_0x29ef('0x1')]={'UserId':{'type':Sequelize[_0x29ef('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8837=['sequelize','INTEGER'];(function(_0x27440e,_0x2b5ddd){var _0x395886=function(_0x5bf1fc){while(--_0x5bf1fc){_0x27440e['push'](_0x27440e['shift']());}};_0x395886(++_0x2b5ddd);}(_0x8837,0x184));var _0x7883=function(_0x118432,_0x40a2ed){_0x118432=_0x118432-0x0;var _0x50f0e4=_0x8837[_0x118432];return _0x50f0e4;};'use strict';var Sequelize=require(_0x7883('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x7883('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x7883('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index b2d54a7..b8dfd0d 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(_0x42ef18,_0x10b91f){var _0x22d124=function(_0x36d481){while(--_0x36d481){_0x42ef18['push'](_0x42ef18['shift']());}};_0x22d124(++_0x10b91f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x280cd6,_0xbefce4){var _0x1e60dd=function(_0x888f14){while(--_0x888f14){_0x280cd6['push'](_0x280cd6['shift']());}};_0x1e60dd(++_0xbefce4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 4a61b11..d61695c 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4a5f95,_0x1553d3){var _0x4dcfa5=function(_0x1afbcf){while(--_0x1afbcf){_0x4a5f95['push'](_0x4a5f95['shift']());}};_0x4dcfa5(++_0x1553d3);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xdabc57,_0x2e0c80){var _0x230b8a=function(_0x2e5e58){while(--_0x2e5e58){_0xdabc57['push'](_0xdabc57['shift']());}};_0x230b8a(++_0x2e0c80);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xcb91[_0x599e60];return _0x468e19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 723b858..0b6236c 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 _0x897b=['sequelize','exports','INTEGER'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x897b,0x90));var _0xb897=function(_0x4bfe9b,_0x415e1d){_0x4bfe9b=_0x4bfe9b-0x0;var _0x4a13a7=_0x897b[_0x4bfe9b];return _0x4a13a7;};'use strict';var Sequelize=require(_0xb897('0x0'));module[_0xb897('0x1')]={'penalty':{'type':Sequelize[_0xb897('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7166=['exports','sequelize'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0x7166,0x127));var _0x6716=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x7166[_0x17406e];return _0x2bfc5a;};'use strict';var Sequelize=require(_0x6716('0x0'));module[_0x6716('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 9bee531..8d4a5dc 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 _0x4ce8=['define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x410c0d,_0x5079cb){var _0x552ae2=function(_0x377d51){while(--_0x377d51){_0x410c0d['push'](_0x410c0d['shift']());}};_0x552ae2(++_0x5079cb);}(_0x4ce8,0x1a7));var _0x84ce=function(_0x4f45f9,_0x3f7dc9){_0x4f45f9=_0x4f45f9-0x0;var _0x4f885d=_0x4ce8[_0x4f45f9];return _0x4f885d;};'use strict';var _=require(_0x84ce('0x0'));var util=require(_0x84ce('0x1'));var logger=require(_0x84ce('0x2'))(_0x84ce('0x3'));var moment=require(_0x84ce('0x4'));var BPromise=require(_0x84ce('0x5'));var rp=require(_0x84ce('0x6'));var fs=require('fs');var path=require(_0x84ce('0x7'));var rimraf=require(_0x84ce('0x8'));var config=require(_0x84ce('0x9'));var attributes=require(_0x84ce('0xa'));module['exports']=function(_0x360da2,_0x25fe40){return _0x360da2[_0x84ce('0xb')](_0x84ce('0xc'),attributes,{'tableName':_0x84ce('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1764=['lodash','util','api','moment','bluebird','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x1764,0xc8));var _0x4176=function(_0x50cf37,_0x130d77){_0x50cf37=_0x50cf37-0x0;var _0x3fc376=_0x1764[_0x50cf37];return _0x3fc376;};'use strict';var _=require(_0x4176('0x0'));var util=require(_0x4176('0x1'));var logger=require('../../config/logger')(_0x4176('0x2'));var moment=require(_0x4176('0x3'));var BPromise=require(_0x4176('0x4'));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('./userVoiceQueue.attributes');module['exports']=function(_0x2ed099,_0x47d4a9){return _0x2ed099[_0x4176('0x5')](_0x4176('0x6'),attributes,{'tableName':_0x4176('0x7'),'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 612441a..f338902 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 _0x4d4e=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1f3ac9,_0x16f339){var _0x3fe605=function(_0x59591e){while(--_0x59591e){_0x1f3ac9['push'](_0x1f3ac9['shift']());}};_0x3fe605(++_0x16f339);}(_0x4d4e,0x99));var _0xe4d4=function(_0x69d88,_0x290f5c){_0x69d88=_0x69d88-0x0;var _0x321cc4=_0x4d4e[_0x69d88];return _0x321cc4;};'use strict';var _=require(_0xe4d4('0x0'));var util=require(_0xe4d4('0x1'));var moment=require(_0xe4d4('0x2'));var BPromise=require(_0xe4d4('0x3'));var rs=require(_0xe4d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe4d4('0x5'));var config=require(_0xe4d4('0x6'));var jayson=require(_0xe4d4('0x7'));var client=jayson[_0xe4d4('0x8')][_0xe4d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x595011,_0x1caba2,_0x23a964){return new BPromise(function(_0x3b624e,_0x437485){return client[_0xe4d4('0xa')](_0x595011,_0x23a964)['then'](function(_0x510e76){logger[_0xe4d4('0xb')](_0xe4d4('0xc'),_0x1caba2,_0xe4d4('0xd'));logger[_0xe4d4('0xe')](_0xe4d4('0xf'),_0x1caba2,'request\x20sent',JSON[_0xe4d4('0x10')](_0x510e76));if(_0x510e76['error']){if(_0x510e76[_0xe4d4('0x11')]['code']===0x1f4){logger[_0xe4d4('0x11')](_0xe4d4('0xc'),_0x1caba2,_0x510e76[_0xe4d4('0x11')][_0xe4d4('0x12')]);return _0x437485(_0x510e76[_0xe4d4('0x11')][_0xe4d4('0x12')]);}logger[_0xe4d4('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x1caba2,_0x510e76[_0xe4d4('0x11')][_0xe4d4('0x12')]);return _0x3b624e(_0x510e76[_0xe4d4('0x11')][_0xe4d4('0x12')]);}else{logger[_0xe4d4('0xb')](_0xe4d4('0xc'),_0x1caba2,_0xe4d4('0xd'));_0x3b624e(_0x510e76[_0xe4d4('0x13')][_0xe4d4('0x12')]);}})[_0xe4d4('0x14')](function(_0x36eed0){logger['error'](_0xe4d4('0xc'),_0x1caba2,_0x36eed0);_0x437485(_0x36eed0);});});} \ No newline at end of file +var _0xb426=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserVoiceQueue,\x20%s,\x20%s','result','catch','util'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xb426,0xfc));var _0x6b42=function(_0x2bbf3d,_0x2a14de){_0x2bbf3d=_0x2bbf3d-0x0;var _0x1e4d8d=_0xb426[_0x2bbf3d];return _0x1e4d8d;};'use strict';var _=require('lodash');var util=require(_0x6b42('0x0'));var moment=require(_0x6b42('0x1'));var BPromise=require(_0x6b42('0x2'));var rs=require(_0x6b42('0x3'));var fs=require('fs');var Redis=require(_0x6b42('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b42('0x5'));var logger=require(_0x6b42('0x6'))('rpc');var config=require(_0x6b42('0x7'));var jayson=require(_0x6b42('0x8'));var client=jayson[_0x6b42('0x9')][_0x6b42('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c80ba,_0x39f783,_0x4530de){return new BPromise(function(_0x54dc17,_0x5c7a0b){return client[_0x6b42('0xb')](_0x4c80ba,_0x4530de)[_0x6b42('0xc')](function(_0x38a7b7){logger[_0x6b42('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x39f783,'request\x20sent');logger['debug'](_0x6b42('0xe'),_0x39f783,_0x6b42('0xf'),JSON[_0x6b42('0x10')](_0x38a7b7));if(_0x38a7b7[_0x6b42('0x11')]){if(_0x38a7b7[_0x6b42('0x11')][_0x6b42('0x12')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x39f783,_0x38a7b7[_0x6b42('0x11')]['message']);return _0x5c7a0b(_0x38a7b7[_0x6b42('0x11')][_0x6b42('0x13')]);}logger[_0x6b42('0x11')](_0x6b42('0x14'),_0x39f783,_0x38a7b7[_0x6b42('0x11')][_0x6b42('0x13')]);return _0x54dc17(_0x38a7b7[_0x6b42('0x11')][_0x6b42('0x13')]);}else{logger['info'](_0x6b42('0x14'),_0x39f783,_0x6b42('0xf'));_0x54dc17(_0x38a7b7[_0x6b42('0x15')][_0x6b42('0x13')]);}})[_0x6b42('0x16')](function(_0xf88920){logger['error'](_0x6b42('0x14'),_0x39f783,_0xf88920);_0x5c7a0b(_0xf88920);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index d59fa3f..9a0df3c 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(_0x64b31d,_0x393b36){var _0x42c45b=function(_0x2d2323){while(--_0x2d2323){_0x64b31d['push'](_0x64b31d['shift']());}};_0x42c45b(++_0x393b36);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x5209ef,_0x3a4592){var _0x63f75f=function(_0x2591e1){while(--_0x2591e1){_0x5209ef['push'](_0x5209ef['shift']());}};_0x63f75f(++_0x3a4592);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 02e7e64..b787d73 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 _0xb7e6=['queue_interface','exports','INTEGER','STRING','Required\x20by\x20Asterisk'];(function(_0x1e057d,_0x163afe){var _0x14b432=function(_0xc14232){while(--_0xc14232){_0x1e057d['push'](_0x1e057d['shift']());}};_0x14b432(++_0x163afe);}(_0xb7e6,0x1dc));var _0x6b7e=function(_0x30d93c,_0x396c2f){_0x30d93c=_0x30d93c-0x0;var _0x5b1210=_0xb7e6[_0x30d93c];return _0x5b1210;};'use strict';var Sequelize=require('sequelize');module[_0x6b7e('0x0')]={'uniqueid':{'type':Sequelize[_0x6b7e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x6b7e('0x2')],'allowNull':![],'comment':_0x6b7e('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6b7e('0x4'),'comment':_0x6b7e('0x3')},'VoiceQueueId':{'type':Sequelize[_0x6b7e('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x6b7e('0x2')],'allowNull':![],'unique':_0x6b7e('0x4'),'comment':_0x6b7e('0x3')},'penalty':{'type':Sequelize[_0x6b7e('0x1')](0xb),'defaultValue':0x0,'comment':_0x6b7e('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x6b7e('0x3')}}; \ No newline at end of file +var _0x6e5b=['sequelize','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface'];(function(_0x514917,_0x5ec781){var _0xb1e78b=function(_0x31c915){while(--_0x31c915){_0x514917['push'](_0x514917['shift']());}};_0xb1e78b(++_0x5ec781);}(_0x6e5b,0x1ae));var _0xb6e5=function(_0x8477bf,_0x3a7ef9){_0x8477bf=_0x8477bf-0x0;var _0x378a55=_0x6e5b[_0x8477bf];return _0x378a55;};'use strict';var Sequelize=require(_0xb6e5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb6e5('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xb6e5('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xb6e5('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb6e5('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0xb6e5('0x3')},'VoiceQueueId':{'type':Sequelize[_0xb6e5('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xb6e5('0x2')],'allowNull':![],'unique':_0xb6e5('0x4'),'comment':_0xb6e5('0x3')},'penalty':{'type':Sequelize[_0xb6e5('0x1')](0xb),'defaultValue':0x0,'comment':_0xb6e5('0x3')},'paused':{'type':Sequelize[_0xb6e5('0x1')](0xb),'defaultValue':0x0,'comment':_0xb6e5('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 530f934..3929065 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 _0x92bd=['../../mysqldb','UserVoiceQueueRt','save','update','emit','hasOwnProperty','hook','events'];(function(_0x1ac595,_0x457bb3){var _0x264c34=function(_0x3b9bae){while(--_0x3b9bae){_0x1ac595['push'](_0x1ac595['shift']());}};_0x264c34(++_0x457bb3);}(_0x92bd,0x77));var _0xd92b=function(_0x189281,_0x38402c){_0x189281=_0x189281-0x0;var _0x49bbb0=_0x92bd[_0x189281];return _0x49bbb0;};'use strict';var EventEmitter=require(_0xd92b('0x0'));var UserVoiceQueueRt=require(_0xd92b('0x1'))['db'][_0xd92b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd92b('0x3'),'afterUpdate':_0xd92b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x485ae4){return function(_0x363d9a,_0x47989f,_0x3df0a2){UserVoiceQueueRtEvents[_0xd92b('0x5')](_0x485ae4+':'+_0x363d9a['id'],_0x363d9a);UserVoiceQueueRtEvents[_0xd92b('0x5')](_0x485ae4,_0x363d9a);_0x3df0a2(null);};}for(var e in events){if(events[_0xd92b('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xd92b('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x8532=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x8532,0x122));var _0x2853=function(_0x5e3359,_0x1d2355){_0x5e3359=_0x5e3359-0x0;var _0x4860bc=_0x8532[_0x5e3359];return _0x4860bc;};'use strict';var EventEmitter=require(_0x2853('0x0'));var UserVoiceQueueRt=require(_0x2853('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2853('0x2')](0x0);var events={'afterCreate':_0x2853('0x3'),'afterUpdate':_0x2853('0x4'),'afterDestroy':'remove'};function emitEvent(_0x219618){return function(_0x15201f,_0x3f8167,_0x20b8f5){UserVoiceQueueRtEvents[_0x2853('0x5')](_0x219618+':'+_0x15201f['id'],_0x15201f);UserVoiceQueueRtEvents[_0x2853('0x5')](_0x219618,_0x15201f);_0x20b8f5(null);};}for(var e in events){if(events[_0x2853('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x2853('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 88fa9f4..e534a6c 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 _0x5a92=['moment','bluebird','request-promise','rimraf','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x19bfc5,_0x54a988){var _0x38ebd2=function(_0x226dfd){while(--_0x226dfd){_0x19bfc5['push'](_0x19bfc5['shift']());}};_0x38ebd2(++_0x54a988);}(_0x5a92,0x1ca));var _0x25a9=function(_0x37d805,_0x904084){_0x37d805=_0x37d805-0x0;var _0x584478=_0x5a92[_0x37d805];return _0x584478;};'use strict';var _=require(_0x25a9('0x0'));var util=require(_0x25a9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x25a9('0x2'));var BPromise=require(_0x25a9('0x3'));var rp=require(_0x25a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25a9('0x5'));var config=require('../../config/environment');var attributes=require(_0x25a9('0x6'));module['exports']=function(_0x25e0bf,_0x37255a){return _0x25e0bf[_0x25a9('0x7')](_0x25a9('0x8'),attributes,{'tableName':_0x25a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b94=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','bluebird','request-promise'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x6b94,0xb1));var _0x46b9=function(_0x31b6e0,_0x785a43){_0x31b6e0=_0x31b6e0-0x0;var _0x288808=_0x6b94[_0x31b6e0];return _0x288808;};'use strict';var _=require(_0x46b9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x46b9('0x1'));var moment=require(_0x46b9('0x2'));var BPromise=require(_0x46b9('0x3'));var rp=require(_0x46b9('0x4'));var fs=require('fs');var path=require(_0x46b9('0x5'));var rimraf=require(_0x46b9('0x6'));var config=require(_0x46b9('0x7'));var attributes=require(_0x46b9('0x8'));module[_0x46b9('0x9')]=function(_0x3bc7fd,_0x47d90){return _0x3bc7fd[_0x46b9('0xa')](_0x46b9('0xb'),attributes,{'tableName':_0x46b9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 801c363..2b5d88f 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 _0x1627=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','findAll','options','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','stringify','lodash','util','bluebird','ioredis','../../config/utils'];(function(_0x836947,_0x3fe0a4){var _0x288667=function(_0xd70b9a){while(--_0xd70b9a){_0x836947['push'](_0x836947['shift']());}};_0x288667(++_0x3fe0a4);}(_0x1627,0xa5));var _0x7162=function(_0x1d7061,_0x2d2388){_0x1d7061=_0x1d7061-0x0;var _0x5ed6ce=_0x1627[_0x1d7061];return _0x5ed6ce;};'use strict';var _=require(_0x7162('0x0'));var util=require(_0x7162('0x1'));var moment=require('moment');var BPromise=require(_0x7162('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7162('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7162('0x4'));var logger=require(_0x7162('0x5'))('rpc');var config=require(_0x7162('0x6'));var jayson=require(_0x7162('0x7'));var client=jayson[_0x7162('0x8')][_0x7162('0x9')]({'port':0x232a});config[_0x7162('0xa')]=_[_0x7162('0xb')](config[_0x7162('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7162('0xc'))(new Redis(config[_0x7162('0xa')]));require('./userVoiceQueueRt.socket')[_0x7162('0xd')](socket);function respondWithRpcPromise(_0x295c0f,_0x14a351,_0x454269){return new BPromise(function(_0x39b599,_0x34d47a){return client[_0x7162('0xe')](_0x295c0f,_0x454269)[_0x7162('0xf')](function(_0x38bd06){logger[_0x7162('0x10')](_0x7162('0x11'),_0x14a351,'request\x20sent');logger[_0x7162('0x12')](_0x7162('0x13'),_0x14a351,_0x7162('0x14'),JSON['stringify'](_0x38bd06));if(_0x38bd06[_0x7162('0x15')]){if(_0x38bd06[_0x7162('0x15')][_0x7162('0x16')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x14a351,_0x38bd06[_0x7162('0x15')]['message']);return _0x34d47a(_0x38bd06[_0x7162('0x15')][_0x7162('0x17')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x14a351,_0x38bd06[_0x7162('0x15')][_0x7162('0x17')]);return _0x39b599(_0x38bd06['error']['message']);}else{logger[_0x7162('0x10')](_0x7162('0x11'),_0x14a351,_0x7162('0x14'));_0x39b599(_0x38bd06[_0x7162('0x18')][_0x7162('0x17')]);}})[_0x7162('0x19')](function(_0x272cd0){logger[_0x7162('0x15')](_0x7162('0x11'),_0x14a351,_0x272cd0);_0x34d47a(_0x272cd0);});});}exports['GetVoiceQueueRtPauses']=function(_0x4589b6){var _0xcf5a3=this;return new Promise(function(_0x24efb9,_0x5840ec){return db['UserVoiceQueueRt'][_0x7162('0x1a')]({'raw':_0x4589b6['options']?_0x4589b6[_0x7162('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4589b6[_0x7162('0x1b')]?_0x4589b6[_0x7162('0x1b')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x7162('0x1c')]['fn']('IF',db['sequelize'][_0x7162('0x1d')](_0x7162('0x1e')))),_0x7162('0x1f')]]})[_0x7162('0xf')](function(_0x49511c){logger['info'](_0x7162('0x20'),_0x4589b6);logger[_0x7162('0x12')](_0x7162('0x20'),_0x4589b6,JSON[_0x7162('0x21')](_0x49511c));_0x24efb9(_0x49511c);})[_0x7162('0x19')](function(_0x3b90ed){logger['error'](_0x7162('0x20'),_0x3b90ed[_0x7162('0x17')],_0x4589b6);_0x5840ec(_0xcf5a3['error'](0x1f4,_0x3b90ed[_0x7162('0x17')]));});});}; \ No newline at end of file +var _0xa5ca=['error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1bceb2,_0x2baafd){var _0x3852ff=function(_0x5c83d9){while(--_0x5c83d9){_0x1bceb2['push'](_0x1bceb2['shift']());}};_0x3852ff(++_0x2baafd);}(_0xa5ca,0x1a7));var _0xaa5c=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0xa5ca[_0x4fdcc0];return _0xc0ce94;};'use strict';var _=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var moment=require('moment');var BPromise=require(_0xaa5c('0x2'));var rs=require(_0xaa5c('0x3'));var fs=require('fs');var Redis=require(_0xaa5c('0x4'));var db=require(_0xaa5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa5c('0x6'))(_0xaa5c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xaa5c('0x8')]({'port':0x232a});config[_0xaa5c('0x9')]=_[_0xaa5c('0xa')](config[_0xaa5c('0x9')],{'host':_0xaa5c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa5c('0x9')]));require('./userVoiceQueueRt.socket')[_0xaa5c('0xc')](socket);function respondWithRpcPromise(_0xea30e,_0x3ab934,_0x14f334){return new BPromise(function(_0x5dbf2b,_0x4ed6af){return client[_0xaa5c('0xd')](_0xea30e,_0x14f334)['then'](function(_0x56fea7){logger['info'](_0xaa5c('0xe'),_0x3ab934,_0xaa5c('0xf'));logger[_0xaa5c('0x10')](_0xaa5c('0x11'),_0x3ab934,_0xaa5c('0xf'),JSON[_0xaa5c('0x12')](_0x56fea7));if(_0x56fea7[_0xaa5c('0x13')]){if(_0x56fea7['error'][_0xaa5c('0x14')]===0x1f4){logger[_0xaa5c('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ab934,_0x56fea7[_0xaa5c('0x13')][_0xaa5c('0x15')]);return _0x4ed6af(_0x56fea7[_0xaa5c('0x13')][_0xaa5c('0x15')]);}logger[_0xaa5c('0x13')](_0xaa5c('0xe'),_0x3ab934,_0x56fea7[_0xaa5c('0x13')][_0xaa5c('0x15')]);return _0x5dbf2b(_0x56fea7[_0xaa5c('0x13')][_0xaa5c('0x15')]);}else{logger[_0xaa5c('0x16')](_0xaa5c('0xe'),_0x3ab934,_0xaa5c('0xf'));_0x5dbf2b(_0x56fea7[_0xaa5c('0x17')][_0xaa5c('0x15')]);}})[_0xaa5c('0x18')](function(_0x580d3a){logger[_0xaa5c('0x13')](_0xaa5c('0xe'),_0x3ab934,_0x580d3a);_0x4ed6af(_0x580d3a);});});}exports[_0xaa5c('0x19')]=function(_0x429d4b){var _0x429787=this;return new Promise(function(_0x3b4236,_0x15e182){return db[_0xaa5c('0x1a')][_0xaa5c('0x1b')]({'raw':_0x429d4b[_0xaa5c('0x1c')]?_0x429d4b[_0xaa5c('0x1c')][_0xaa5c('0x1d')]===undefined?!![]:![]:!![],'where':_0x429d4b[_0xaa5c('0x1c')]?_0x429d4b[_0xaa5c('0x1c')][_0xaa5c('0x1e')]||null:null,'attributes':[[db[_0xaa5c('0x1f')]['fn'](_0xaa5c('0x20'),db[_0xaa5c('0x1f')]['fn']('IF',db[_0xaa5c('0x1f')][_0xaa5c('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})['then'](function(_0x5e138e){logger[_0xaa5c('0x16')](_0xaa5c('0x19'),_0x429d4b);logger['debug']('GetVoiceQueueRtPauses',_0x429d4b,JSON[_0xaa5c('0x12')](_0x5e138e));_0x3b4236(_0x5e138e);})[_0xaa5c('0x18')](function(_0xb76922){logger[_0xaa5c('0x13')]('GetVoiceQueueRtPauses',_0xb76922['message'],_0x429d4b);_0x15e182(_0x429787[_0xaa5c('0x13')](0x1f4,_0xb76922['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b4d9697..5757f46 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 _0xed20=['register','length','./userVoiceQueueRt.events','save','remove','emit'];(function(_0x43c948,_0x4b4f0b){var _0x5e50a0=function(_0x465519){while(--_0x465519){_0x43c948['push'](_0x43c948['shift']());}};_0x5e50a0(++_0x4b4f0b);}(_0xed20,0xce));var _0x0ed2=function(_0x2da3e9,_0x13b2d3){_0x2da3e9=_0x2da3e9-0x0;var _0x4f880f=_0xed20[_0x2da3e9];return _0x4f880f;};'use strict';var UserVoiceQueueRtEvents=require(_0x0ed2('0x0'));var events=[_0x0ed2('0x1'),_0x0ed2('0x2'),'update'];function createListener(_0x2a9ed0,_0x380277){return function(_0x1d5c58){_0x380277[_0x0ed2('0x3')](_0x2a9ed0,_0x1d5c58);};}function removeListener(_0x395e2d,_0x20cac9){return function(){UserVoiceQueueRtEvents['removeListener'](_0x395e2d,_0x20cac9);};}exports[_0x0ed2('0x4')]=function(_0x88640a){for(var _0x5c686a=0x0,_0x114121=events[_0x0ed2('0x5')];_0x5c686a<_0x114121;_0x5c686a++){var _0x65848d=events[_0x5c686a];var _0x39498b=createListener('userVoiceQueueRt:'+_0x65848d,_0x88640a);UserVoiceQueueRtEvents['on'](_0x65848d,_0x39498b);}}; \ No newline at end of file +var _0x0c42=['emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x3e5595,_0xbe4275){var _0x3fd3a6=function(_0x43874c){while(--_0x43874c){_0x3e5595['push'](_0x3e5595['shift']());}};_0x3fd3a6(++_0xbe4275);}(_0x0c42,0x191));var _0x20c4=function(_0x3352b2,_0x4df45a){_0x3352b2=_0x3352b2-0x0;var _0x1d58aa=_0x0c42[_0x3352b2];return _0x1d58aa;};'use strict';var UserVoiceQueueRtEvents=require(_0x20c4('0x0'));var events=[_0x20c4('0x1'),_0x20c4('0x2'),_0x20c4('0x3')];function createListener(_0xe6959,_0x5810aa){return function(_0x5d686d){_0x5810aa[_0x20c4('0x4')](_0xe6959,_0x5d686d);};}function removeListener(_0x1296a8,_0x24bfc1){return function(){UserVoiceQueueRtEvents[_0x20c4('0x5')](_0x1296a8,_0x24bfc1);};}exports[_0x20c4('0x6')]=function(_0x58e1ed){for(var _0x339b15=0x0,_0x4c4f94=events[_0x20c4('0x7')];_0x339b15<_0x4c4f94;_0x339b15++){var _0x5d2014=events[_0x339b15];var _0xc29a61=createListener(_0x20c4('0x8')+_0x5d2014,_0x58e1ed);UserVoiceQueueRtEvents['on'](_0x5d2014,_0xc29a61);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 4d3c733..4def440 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(_0x5d2cdd,_0x25fcb5){var _0x46fff4=function(_0x3fb634){while(--_0x3fb634){_0x5d2cdd['push'](_0x5d2cdd['shift']());}};_0x46fff4(++_0x25fcb5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x123035,_0x122952){var _0x516c5f=function(_0x29116c){while(--_0x29116c){_0x123035['push'](_0x123035['shift']());}};_0x516c5f(++_0x122952);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index db6ec67..b603031 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 _0x7dee=['sequelize','INTEGER'];(function(_0x5cc67a,_0x1c6ffb){var _0x2a4875=function(_0x29d2bb){while(--_0x29d2bb){_0x5cc67a['push'](_0x5cc67a['shift']());}};_0x2a4875(++_0x1c6ffb);}(_0x7dee,0xb0));var _0xe7de=function(_0x2a871e,_0x4c7108){_0x2a871e=_0x2a871e-0x0;var _0x132da=_0x7dee[_0x2a871e];return _0x132da;};'use strict';var Sequelize=require(_0xe7de('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe7de('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaa30=['sequelize','exports'];(function(_0xd63e67,_0x967cd5){var _0xe8c440=function(_0x1e1beb){while(--_0x1e1beb){_0xd63e67['push'](_0xd63e67['shift']());}};_0xe8c440(++_0x967cd5);}(_0xaa30,0x94));var _0x0aa3=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xaa30[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0x0aa3('0x0'));module[_0x0aa3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 49d5a98..b24366e 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 _0x18c0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue','user_has_whatsapp_queues','util'];(function(_0xfe4e7c,_0x963a46){var _0x480732=function(_0x194686){while(--_0x194686){_0xfe4e7c['push'](_0xfe4e7c['shift']());}};_0x480732(++_0x963a46);}(_0x18c0,0x6d));var _0x018c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x18c0[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x018c('0x0'));var logger=require('../../config/logger')(_0x018c('0x1'));var moment=require(_0x018c('0x2'));var BPromise=require(_0x018c('0x3'));var rp=require(_0x018c('0x4'));var fs=require('fs');var path=require(_0x018c('0x5'));var rimraf=require(_0x018c('0x6'));var config=require(_0x018c('0x7'));var attributes=require(_0x018c('0x8'));module['exports']=function(_0x20cc50,_0x2c5e9d){return _0x20cc50['define'](_0x018c('0x9'),attributes,{'tableName':_0x018c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9a8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x3efaed,_0x3d43a9){var _0x10cf83=function(_0x58c3e5){while(--_0x58c3e5){_0x3efaed['push'](_0x3efaed['shift']());}};_0x10cf83(++_0x3d43a9);}(_0xb9a8,0x1c7));var _0x8b9a=function(_0x1ac84b,_0x280a26){_0x1ac84b=_0x1ac84b-0x0;var _0x1d087a=_0xb9a8[_0x1ac84b];return _0x1d087a;};'use strict';var _=require(_0x8b9a('0x0'));var util=require(_0x8b9a('0x1'));var logger=require(_0x8b9a('0x2'))(_0x8b9a('0x3'));var moment=require(_0x8b9a('0x4'));var BPromise=require(_0x8b9a('0x5'));var rp=require(_0x8b9a('0x6'));var fs=require('fs');var path=require(_0x8b9a('0x7'));var rimraf=require(_0x8b9a('0x8'));var config=require('../../config/environment');var attributes=require(_0x8b9a('0x9'));module['exports']=function(_0x234854,_0x121299){return _0x234854[_0x8b9a('0xa')](_0x8b9a('0xb'),attributes,{'tableName':_0x8b9a('0xc'),'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 14c2281..da40787 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 _0xc500=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xc500,0x142));var _0x0c50=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc500[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0c50('0x0'));var util=require(_0x0c50('0x1'));var moment=require(_0x0c50('0x2'));var BPromise=require(_0x0c50('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c50('0x4'));var db=require(_0x0c50('0x5'))['db'];var utils=require(_0x0c50('0x6'));var logger=require(_0x0c50('0x7'))(_0x0c50('0x8'));var config=require(_0x0c50('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0c50('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x319c88,_0x2b7a88,_0x3814ee){return new BPromise(function(_0xad9c39,_0x5e52de){return client[_0x0c50('0xb')](_0x319c88,_0x3814ee)[_0x0c50('0xc')](function(_0x182d11){logger[_0x0c50('0xd')](_0x0c50('0xe'),_0x2b7a88,'request\x20sent');logger[_0x0c50('0xf')](_0x0c50('0x10'),_0x2b7a88,_0x0c50('0x11'),JSON[_0x0c50('0x12')](_0x182d11));if(_0x182d11[_0x0c50('0x13')]){if(_0x182d11[_0x0c50('0x13')][_0x0c50('0x14')]===0x1f4){logger[_0x0c50('0x13')](_0x0c50('0xe'),_0x2b7a88,_0x182d11[_0x0c50('0x13')]['message']);return _0x5e52de(_0x182d11[_0x0c50('0x13')][_0x0c50('0x15')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2b7a88,_0x182d11[_0x0c50('0x13')][_0x0c50('0x15')]);return _0xad9c39(_0x182d11[_0x0c50('0x13')][_0x0c50('0x15')]);}else{logger[_0x0c50('0xd')](_0x0c50('0xe'),_0x2b7a88,'request\x20sent');_0xad9c39(_0x182d11['result']['message']);}})[_0x0c50('0x16')](function(_0x148abe){logger[_0x0c50('0x13')](_0x0c50('0xe'),_0x2b7a88,_0x148abe);_0x5e52de(_0x148abe);});});} \ No newline at end of file +var _0x25c7=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x2c259b,_0x10d872){var _0x340ca3=function(_0x15ebc6){while(--_0x15ebc6){_0x2c259b['push'](_0x2c259b['shift']());}};_0x340ca3(++_0x10d872);}(_0x25c7,0x128));var _0x725c=function(_0x4d69ed,_0x2ee525){_0x4d69ed=_0x4d69ed-0x0;var _0x446033=_0x25c7[_0x4d69ed];return _0x446033;};'use strict';var _=require(_0x725c('0x0'));var util=require('util');var moment=require(_0x725c('0x1'));var BPromise=require(_0x725c('0x2'));var rs=require(_0x725c('0x3'));var fs=require('fs');var Redis=require(_0x725c('0x4'));var db=require(_0x725c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x725c('0x6'))(_0x725c('0x7'));var config=require(_0x725c('0x8'));var jayson=require(_0x725c('0x9'));var client=jayson[_0x725c('0xa')][_0x725c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34cd75,_0x1da506,_0x259e2b){return new BPromise(function(_0x1257ab,_0x5db5ad){return client[_0x725c('0xc')](_0x34cd75,_0x259e2b)[_0x725c('0xd')](function(_0x3ac749){logger['info'](_0x725c('0xe'),_0x1da506,_0x725c('0xf'));logger[_0x725c('0x10')](_0x725c('0x11'),_0x1da506,_0x725c('0xf'),JSON[_0x725c('0x12')](_0x3ac749));if(_0x3ac749[_0x725c('0x13')]){if(_0x3ac749['error'][_0x725c('0x14')]===0x1f4){logger['error'](_0x725c('0xe'),_0x1da506,_0x3ac749[_0x725c('0x13')][_0x725c('0x15')]);return _0x5db5ad(_0x3ac749[_0x725c('0x13')][_0x725c('0x15')]);}logger[_0x725c('0x13')](_0x725c('0xe'),_0x1da506,_0x3ac749['error']['message']);return _0x1257ab(_0x3ac749['error'][_0x725c('0x15')]);}else{logger['info'](_0x725c('0xe'),_0x1da506,_0x725c('0xf'));_0x1257ab(_0x3ac749[_0x725c('0x16')][_0x725c('0x15')]);}})['catch'](function(_0x59acc0){logger[_0x725c('0x13')](_0x725c('0xe'),_0x1da506,_0x59acc0);_0x5db5ad(_0x59acc0);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 08af783..ab91a24 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 _0x956a=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','util','path','connect-timeout','express','Router'];(function(_0x5b7b81,_0x4f97ca){var _0x92c277=function(_0x514624){while(--_0x514624){_0x5b7b81['push'](_0x5b7b81['shift']());}};_0x92c277(++_0x4f97ca);}(_0x956a,0xb6));var _0xa956=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x956a[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xa956('0x0'));var path=require(_0xa956('0x1'));var timeout=require(_0xa956('0x2'));var express=require(_0xa956('0x3'));var router=express[_0xa956('0x4')]();var fs_extra=require(_0xa956('0x5'));var auth=require(_0xa956('0x6'));var interaction=require(_0xa956('0x7'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xa956('0x8')]('/',auth[_0xa956('0x9')](),controller[_0xa956('0xa')]);router['get'](_0xa956('0xb'),auth[_0xa956('0x9')](),controller[_0xa956('0xc')]);router[_0xa956('0xd')]('/',auth[_0xa956('0x9')](),controller[_0xa956('0xe')]);router[_0xa956('0xf')]('/:id',auth[_0xa956('0x9')](),controller[_0xa956('0x10')]);router['delete'](_0xa956('0xb'),auth[_0xa956('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x946e=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','show','isAuthenticated','create','update','destroy','multer'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0x946e,0x1d0));var _0xe946=function(_0x10909c,_0x5ef458){_0x10909c=_0x10909c-0x0;var _0x265452=_0x946e[_0x10909c];return _0x265452;};'use strict';var multer=require(_0xe946('0x0'));var util=require('util');var path=require(_0xe946('0x1'));var timeout=require('connect-timeout');var express=require(_0xe946('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe946('0x3'));var interaction=require(_0xe946('0x4'));var config=require(_0xe946('0x5'));var controller=require(_0xe946('0x6'));router[_0xe946('0x7')]('/',auth['isAuthenticated'](),controller[_0xe946('0x8')]);router[_0xe946('0x7')](_0xe946('0x9'),auth['isAuthenticated'](),controller[_0xe946('0xa')]);router['post']('/',auth[_0xe946('0xb')](),controller[_0xe946('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe946('0xd')]);router['delete']('/:id',auth[_0xe946('0xb')](),controller[_0xe946('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index f28d40a..2b6dbdc 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 _0xf301=['STRING','name','sequelize','exports'];(function(_0x2d32e5,_0x72818a){var _0x1c25a8=function(_0x152a1b){while(--_0x152a1b){_0x2d32e5['push'](_0x2d32e5['shift']());}};_0x1c25a8(++_0x72818a);}(_0xf301,0xe6));var _0x1f30=function(_0x24a442,_0xe7e8f9){_0x24a442=_0x24a442-0x0;var _0x3a03f1=_0xf301[_0x24a442];return _0x3a03f1;};'use strict';var Sequelize=require(_0x1f30('0x0'));module[_0x1f30('0x1')]={'name':{'type':Sequelize[_0x1f30('0x2')],'unique':_0x1f30('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1f30('0x2')]}}; \ No newline at end of file +var _0x5bc3=['name','sequelize','STRING'];(function(_0x282a93,_0x189a48){var _0x35b1b5=function(_0x1989e9){while(--_0x1989e9){_0x282a93['push'](_0x282a93['shift']());}};_0x35b1b5(++_0x189a48);}(_0x5bc3,0x157));var _0x35bc=function(_0x516631,_0x47aae2){_0x516631=_0x516631-0x0;var _0x48817e=_0x5bc3[_0x516631];return _0x48817e;};'use strict';var Sequelize=require(_0x35bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x35bc('0x1')],'unique':_0x35bc('0x2'),'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 ffd13fd..2cae49e 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 _0xe930=['filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','rawAttributes','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','save','get','UserProfileResource','destroy','then','end','error','name','index','Variable','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xe930,0x1b5));var _0x0e93=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0xe930[_0x1e1965];return _0x1a2e96;};'use strict';var emlformat=require(_0x0e93('0x0'));var rimraf=require(_0x0e93('0x1'));var zipdir=require(_0x0e93('0x2'));var jsonpatch=require(_0x0e93('0x3'));var rp=require(_0x0e93('0x4'));var moment=require(_0x0e93('0x5'));var BPromise=require(_0x0e93('0x6'));var Mustache=require(_0x0e93('0x7'));var util=require(_0x0e93('0x8'));var path=require(_0x0e93('0x9'));var sox=require(_0x0e93('0xa'));var csv=require(_0x0e93('0xb'));var ejs=require(_0x0e93('0xc'));var fs=require('fs');var fs_extra=require(_0x0e93('0xd'));var _=require(_0x0e93('0xe'));var squel=require(_0x0e93('0xf'));var crypto=require('crypto');var jsforce=require(_0x0e93('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x0e93('0xb'));var querystring=require(_0x0e93('0x11'));var Papa=require('papaparse');var Redis=require(_0x0e93('0x12'));var authService=require(_0x0e93('0x13'));var qs=require(_0x0e93('0x14'));var as=require(_0x0e93('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e93('0x16'))(_0x0e93('0x17'));var utils=require('../../config/utils');var config=require(_0x0e93('0x18'));var licenseUtil=require(_0x0e93('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfec6d9,_0x2fb855){_0x2fb855=_0x2fb855||0xcc;return function(_0x292233){if(_0x292233){return _0xfec6d9[_0x0e93('0x1a')](_0x2fb855);}return _0xfec6d9[_0x0e93('0x1b')](_0x2fb855)['end']();};}function respondWithResult(_0x2b2bb7,_0x251b47){_0x251b47=_0x251b47||0xc8;return function(_0x3772d3){if(_0x3772d3){return _0x2b2bb7[_0x0e93('0x1b')](_0x251b47)['json'](_0x3772d3);}};}function respondWithFilteredResult(_0x4a1079,_0x894077){return function(_0x47d7bf){if(_0x47d7bf){var _0xbebcb7=typeof _0x894077[_0x0e93('0x1c')]===_0x0e93('0x1d')&&typeof _0x894077[_0x0e93('0x1e')]==='undefined';var _0x24034c=_0x47d7bf['count'];var _0x5257af=_0xbebcb7?0x0:_0x894077[_0x0e93('0x1c')];var _0x3a0e13=_0xbebcb7?_0x47d7bf['count']:_0x894077[_0x0e93('0x1c')]+_0x894077['limit'];var _0x21502f;if(_0x3a0e13>=_0x24034c){_0x3a0e13=_0x24034c;_0x21502f=0xc8;}else{_0x21502f=0xce;}_0x4a1079[_0x0e93('0x1b')](_0x21502f);return _0x4a1079[_0x0e93('0x1f')](_0x0e93('0x20'),_0x5257af+'-'+_0x3a0e13+'/'+_0x24034c)[_0x0e93('0x21')](_0x47d7bf);}return null;};}function patchUpdates(_0xc4ef74){return function(_0x4a6838){try{jsonpatch[_0x0e93('0x22')](_0x4a6838,_0xc4ef74,!![]);}catch(_0x717bad){return BPromise['reject'](_0x717bad);}return _0x4a6838[_0x0e93('0x23')]();};}function saveUpdates(_0x353b35,_0x22859e){return function(_0x4af442){if(_0x4af442){return _0x4af442['update'](_0x353b35)['then'](function(_0x2b53a2){return _0x2b53a2;});}return null;};}function removeEntity(_0x2680a9,_0x14d90d){return function(_0xda3e53){if(_0xda3e53){return _0xda3e53['destroy']()['then'](function(){var _0x354eb1=_0xda3e53[_0x0e93('0x24')]({'plain':!![]});var _0x54c42f='Variables';return db[_0x0e93('0x25')][_0x0e93('0x26')]({'where':{'type':_0x54c42f,'resourceId':_0x354eb1['id']}})[_0x0e93('0x27')](function(){return _0xda3e53;});})[_0x0e93('0x27')](function(){_0x2680a9[_0x0e93('0x1b')](0xcc)[_0x0e93('0x28')]();});}};}function handleEntityNotFound(_0x5a41ea,_0x4cf197){return function(_0x4b25a2){if(!_0x4b25a2){_0x5a41ea[_0x0e93('0x1a')](0x194);}return _0x4b25a2;};}function handleError(_0x4e0924,_0x576b85){_0x576b85=_0x576b85||0x1f4;return function(_0x546bd5){logger[_0x0e93('0x29')](_0x546bd5['stack']);if(_0x546bd5[_0x0e93('0x2a')]){delete _0x546bd5['name'];}_0x4e0924[_0x0e93('0x1b')](_0x576b85)['send'](_0x546bd5);};}exports[_0x0e93('0x2b')]=function(_0x4b68e5,_0x481003){var _0x18f969={},_0x55d359={},_0x5cfb9c={'count':0x0,'rows':[]};var _0x5bbce6=_['map'](db[_0x0e93('0x2c')]['rawAttributes'],function(_0x1fb2c5){return{'name':_0x1fb2c5[_0x0e93('0x2d')],'type':_0x1fb2c5[_0x0e93('0x2e')][_0x0e93('0x2f')]};});_0x55d359[_0x0e93('0x30')]=_[_0x0e93('0x31')](_0x5bbce6,_0x0e93('0x2a'));_0x55d359[_0x0e93('0x32')]=_[_0x0e93('0x33')](_0x4b68e5[_0x0e93('0x32')]);_0x55d359['filters']=_['intersection'](_0x55d359['model'],_0x55d359[_0x0e93('0x32')]);_0x18f969[_0x0e93('0x34')]=_['intersection'](_0x55d359[_0x0e93('0x30')],qs['fields'](_0x4b68e5['query'][_0x0e93('0x35')]));_0x18f969['attributes']=_0x18f969[_0x0e93('0x34')][_0x0e93('0x36')]?_0x18f969[_0x0e93('0x34')]:_0x55d359[_0x0e93('0x30')];if(!_0x4b68e5[_0x0e93('0x32')]['hasOwnProperty'](_0x0e93('0x37'))){_0x18f969[_0x0e93('0x1e')]=qs[_0x0e93('0x1e')](_0x4b68e5[_0x0e93('0x32')][_0x0e93('0x1e')]);_0x18f969[_0x0e93('0x1c')]=qs['offset'](_0x4b68e5[_0x0e93('0x32')]['offset']);}_0x18f969[_0x0e93('0x38')]=qs[_0x0e93('0x39')](_0x4b68e5[_0x0e93('0x32')][_0x0e93('0x39')]);_0x18f969[_0x0e93('0x3a')]=qs[_0x0e93('0x3b')](_[_0x0e93('0x3c')](_0x4b68e5[_0x0e93('0x32')],_0x55d359[_0x0e93('0x3b')]),_0x5bbce6);if(_0x4b68e5[_0x0e93('0x32')][_0x0e93('0x3d')]){_0x18f969['where']=_[_0x0e93('0x3e')](_0x18f969['where'],{'$or':_[_0x0e93('0x31')](_0x5bbce6,function(_0x5b9248){if(_0x5b9248['type']!==_0x0e93('0x3f')){var _0xe7da4={};_0xe7da4[_0x5b9248[_0x0e93('0x2a')]]={'$like':'%'+_0x4b68e5['query']['filter']+'%'};return _0xe7da4;}})});}_0x18f969=_[_0x0e93('0x3e')]({},_0x18f969,_0x4b68e5[_0x0e93('0x40')]);var _0x2a5154={'where':_0x18f969[_0x0e93('0x3a')]};return db[_0x0e93('0x2c')]['count'](_0x2a5154)[_0x0e93('0x27')](function(_0x211489){_0x5cfb9c[_0x0e93('0x41')]=_0x211489;if(_0x4b68e5[_0x0e93('0x32')][_0x0e93('0x42')]){_0x18f969[_0x0e93('0x43')]=[{'all':!![]}];}return db[_0x0e93('0x2c')][_0x0e93('0x44')](_0x18f969);})[_0x0e93('0x27')](function(_0x1d5935){_0x5cfb9c['rows']=_0x1d5935;return _0x5cfb9c;})['then'](respondWithFilteredResult(_0x481003,_0x18f969))[_0x0e93('0x45')](handleError(_0x481003,null));};exports[_0x0e93('0x46')]=function(_0x42f094,_0x2ec195){var _0x1a95ce={'raw':!![],'where':{'id':_0x42f094['params']['id']}},_0xa5ff0a={};_0xa5ff0a['model']=_[_0x0e93('0x33')](db[_0x0e93('0x2c')][_0x0e93('0x47')]);_0xa5ff0a[_0x0e93('0x32')]=_[_0x0e93('0x33')](_0x42f094[_0x0e93('0x32')]);_0xa5ff0a[_0x0e93('0x3b')]=_[_0x0e93('0x48')](_0xa5ff0a['model'],_0xa5ff0a[_0x0e93('0x32')]);_0x1a95ce[_0x0e93('0x34')]=_[_0x0e93('0x48')](_0xa5ff0a['model'],qs[_0x0e93('0x35')](_0x42f094['query'][_0x0e93('0x35')]));_0x1a95ce[_0x0e93('0x34')]=_0x1a95ce[_0x0e93('0x34')][_0x0e93('0x36')]?_0x1a95ce[_0x0e93('0x34')]:_0xa5ff0a['model'];if(_0x42f094['query'][_0x0e93('0x42')]){_0x1a95ce['include']=[{'all':!![]}];}_0x1a95ce=_[_0x0e93('0x3e')]({},_0x1a95ce,_0x42f094[_0x0e93('0x40')]);return db[_0x0e93('0x2c')]['find'](_0x1a95ce)[_0x0e93('0x27')](handleEntityNotFound(_0x2ec195,null))[_0x0e93('0x27')](respondWithResult(_0x2ec195,null))[_0x0e93('0x45')](handleError(_0x2ec195,null));};exports[_0x0e93('0x49')]=function(_0x7a5664,_0x56b2cf){return db[_0x0e93('0x2c')]['create'](_0x7a5664[_0x0e93('0x4a')],{})[_0x0e93('0x27')](function(_0x231e84){var _0x4177e9=_0x7a5664['user'][_0x0e93('0x24')]({'plain':!![]});if(!_0x4177e9)throw new Error(_0x0e93('0x4b'));if(_0x4177e9['role']===_0x0e93('0x4c')){var _0x1a7987=_0x231e84[_0x0e93('0x24')]({'plain':!![]});var _0x41c419='Variables';return db['UserProfileSection'][_0x0e93('0x4d')]({'where':{'name':_0x41c419,'userProfileId':_0x4177e9[_0x0e93('0x4e')]},'raw':!![]})[_0x0e93('0x27')](function(_0x2192b7){if(_0x2192b7&&_0x2192b7[_0x0e93('0x4f')]===0x0){return db[_0x0e93('0x25')][_0x0e93('0x49')]({'name':_0x1a7987[_0x0e93('0x2a')],'resourceId':_0x1a7987['id'],'type':_0x2192b7['name'],'sectionId':_0x2192b7['id']},{})['then'](function(){return _0x231e84;});}else{return _0x231e84;}})['catch'](function(_0x5e5f85){logger[_0x0e93('0x29')](_0x0e93('0x50'),_0x5e5f85);throw _0x5e5f85;});}return _0x231e84;})[_0x0e93('0x27')](respondWithResult(_0x56b2cf,0xc9))[_0x0e93('0x45')](handleError(_0x56b2cf,null));};exports[_0x0e93('0x51')]=function(_0x195518,_0x5d0dd2){if(_0x195518[_0x0e93('0x4a')]['id']){delete _0x195518[_0x0e93('0x4a')]['id'];}return db[_0x0e93('0x2c')][_0x0e93('0x4d')]({'where':{'id':_0x195518[_0x0e93('0x52')]['id']}})[_0x0e93('0x27')](handleEntityNotFound(_0x5d0dd2,null))[_0x0e93('0x27')](saveUpdates(_0x195518[_0x0e93('0x4a')],null))['then'](respondWithResult(_0x5d0dd2,null))[_0x0e93('0x45')](handleError(_0x5d0dd2,null));};exports[_0x0e93('0x26')]=function(_0x5c3f73,_0x11161b){return db[_0x0e93('0x2c')]['find']({'where':{'id':_0x5c3f73[_0x0e93('0x52')]['id']}})[_0x0e93('0x27')](handleEntityNotFound(_0x11161b,null))[_0x0e93('0x27')](removeEntity(_0x11161b,null))[_0x0e93('0x45')](handleError(_0x11161b,null));}; \ No newline at end of file +var _0x09db=['catch','show','params','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','request-promise','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x09db,0xae));var _0xb09d=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x09db[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb09d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb09d('0x1'));var moment=require('moment');var BPromise=require(_0xb09d('0x2'));var Mustache=require('mustache');var util=require(_0xb09d('0x3'));var path=require(_0xb09d('0x4'));var sox=require(_0xb09d('0x5'));var csv=require('to-csv');var ejs=require(_0xb09d('0x6'));var fs=require('fs');var fs_extra=require(_0xb09d('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb09d('0x8'));var jsforce=require(_0xb09d('0x9'));var deskjs=require(_0xb09d('0xa'));var toCsv=require(_0xb09d('0xb'));var querystring=require(_0xb09d('0xc'));var Papa=require(_0xb09d('0xd'));var Redis=require('ioredis');var authService=require(_0xb09d('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb09d('0xf'));var licenseUtil=require(_0xb09d('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x171d3c,_0x5a6d2a){_0x5a6d2a=_0x5a6d2a||0xcc;return function(_0x2c99da){if(_0x2c99da){return _0x171d3c[_0xb09d('0x11')](_0x5a6d2a);}return _0x171d3c['status'](_0x5a6d2a)[_0xb09d('0x12')]();};}function respondWithResult(_0x4d85fa,_0x10d1f1){_0x10d1f1=_0x10d1f1||0xc8;return function(_0x585c3b){if(_0x585c3b){return _0x4d85fa[_0xb09d('0x13')](_0x10d1f1)[_0xb09d('0x14')](_0x585c3b);}};}function respondWithFilteredResult(_0x452114,_0xb9102d){return function(_0x354829){if(_0x354829){var _0x2b2f95=typeof _0xb9102d[_0xb09d('0x15')]===_0xb09d('0x16')&&typeof _0xb9102d[_0xb09d('0x17')]===_0xb09d('0x16');var _0x30cf03=_0x354829[_0xb09d('0x18')];var _0x4b36cc=_0x2b2f95?0x0:_0xb9102d['offset'];var _0x315e80=_0x2b2f95?_0x354829[_0xb09d('0x18')]:_0xb9102d[_0xb09d('0x15')]+_0xb9102d[_0xb09d('0x17')];var _0x1f775b;if(_0x315e80>=_0x30cf03){_0x315e80=_0x30cf03;_0x1f775b=0xc8;}else{_0x1f775b=0xce;}_0x452114[_0xb09d('0x13')](_0x1f775b);return _0x452114[_0xb09d('0x19')](_0xb09d('0x1a'),_0x4b36cc+'-'+_0x315e80+'/'+_0x30cf03)[_0xb09d('0x14')](_0x354829);}return null;};}function patchUpdates(_0x4715dd){return function(_0x447f31){try{jsonpatch[_0xb09d('0x1b')](_0x447f31,_0x4715dd,!![]);}catch(_0x2132c4){return BPromise[_0xb09d('0x1c')](_0x2132c4);}return _0x447f31[_0xb09d('0x1d')]();};}function saveUpdates(_0x40a0d5,_0x289618){return function(_0xabd73d){if(_0xabd73d){return _0xabd73d['update'](_0x40a0d5)['then'](function(_0x214b1c){return _0x214b1c;});}return null;};}function removeEntity(_0x594d43,_0xd9a0d){return function(_0x37dca6){if(_0x37dca6){return _0x37dca6[_0xb09d('0x1e')]()[_0xb09d('0x1f')](function(){var _0x5870fc=_0x37dca6['get']({'plain':!![]});var _0x550639=_0xb09d('0x20');return db[_0xb09d('0x21')][_0xb09d('0x1e')]({'where':{'type':_0x550639,'resourceId':_0x5870fc['id']}})[_0xb09d('0x1f')](function(){return _0x37dca6;});})['then'](function(){_0x594d43['status'](0xcc)[_0xb09d('0x12')]();});}};}function handleEntityNotFound(_0x5c95f5,_0xb13256){return function(_0x5ddfab){if(!_0x5ddfab){_0x5c95f5['sendStatus'](0x194);}return _0x5ddfab;};}function handleError(_0x2b7535,_0x245f2b){_0x245f2b=_0x245f2b||0x1f4;return function(_0x40ea0e){logger[_0xb09d('0x22')](_0x40ea0e[_0xb09d('0x23')]);if(_0x40ea0e[_0xb09d('0x24')]){delete _0x40ea0e[_0xb09d('0x24')];}_0x2b7535[_0xb09d('0x13')](_0x245f2b)[_0xb09d('0x25')](_0x40ea0e);};}exports[_0xb09d('0x26')]=function(_0x831f3d,_0x3c0db1){var _0x36d3aa={},_0x24b941={},_0x237fc3={'count':0x0,'rows':[]};var _0x35ee24=_[_0xb09d('0x27')](db[_0xb09d('0x28')]['rawAttributes'],function(_0x4aaef4){return{'name':_0x4aaef4[_0xb09d('0x29')],'type':_0x4aaef4['type']['key']};});_0x24b941[_0xb09d('0x2a')]=_[_0xb09d('0x27')](_0x35ee24,_0xb09d('0x24'));_0x24b941[_0xb09d('0x2b')]=_[_0xb09d('0x2c')](_0x831f3d[_0xb09d('0x2b')]);_0x24b941[_0xb09d('0x2d')]=_['intersection'](_0x24b941[_0xb09d('0x2a')],_0x24b941[_0xb09d('0x2b')]);_0x36d3aa['attributes']=_[_0xb09d('0x2e')](_0x24b941[_0xb09d('0x2a')],qs[_0xb09d('0x2f')](_0x831f3d[_0xb09d('0x2b')][_0xb09d('0x2f')]));_0x36d3aa['attributes']=_0x36d3aa[_0xb09d('0x30')][_0xb09d('0x31')]?_0x36d3aa[_0xb09d('0x30')]:_0x24b941[_0xb09d('0x2a')];if(!_0x831f3d[_0xb09d('0x2b')][_0xb09d('0x32')](_0xb09d('0x33'))){_0x36d3aa[_0xb09d('0x17')]=qs['limit'](_0x831f3d[_0xb09d('0x2b')][_0xb09d('0x17')]);_0x36d3aa[_0xb09d('0x15')]=qs['offset'](_0x831f3d[_0xb09d('0x2b')]['offset']);}_0x36d3aa[_0xb09d('0x34')]=qs[_0xb09d('0x35')](_0x831f3d[_0xb09d('0x2b')][_0xb09d('0x35')]);_0x36d3aa[_0xb09d('0x36')]=qs['filters'](_[_0xb09d('0x37')](_0x831f3d[_0xb09d('0x2b')],_0x24b941[_0xb09d('0x2d')]),_0x35ee24);if(_0x831f3d[_0xb09d('0x2b')][_0xb09d('0x38')]){_0x36d3aa[_0xb09d('0x36')]=_[_0xb09d('0x39')](_0x36d3aa['where'],{'$or':_[_0xb09d('0x27')](_0x35ee24,function(_0x332066){if(_0x332066[_0xb09d('0x3a')]!==_0xb09d('0x3b')){var _0x49c4dd={};_0x49c4dd[_0x332066[_0xb09d('0x24')]]={'$like':'%'+_0x831f3d[_0xb09d('0x2b')][_0xb09d('0x38')]+'%'};return _0x49c4dd;}})});}_0x36d3aa=_[_0xb09d('0x39')]({},_0x36d3aa,_0x831f3d['options']);var _0x25d6b1={'where':_0x36d3aa[_0xb09d('0x36')]};return db[_0xb09d('0x28')]['count'](_0x25d6b1)[_0xb09d('0x1f')](function(_0x7a0024){_0x237fc3[_0xb09d('0x18')]=_0x7a0024;if(_0x831f3d[_0xb09d('0x2b')][_0xb09d('0x3c')]){_0x36d3aa[_0xb09d('0x3d')]=[{'all':!![]}];}return db[_0xb09d('0x28')]['findAll'](_0x36d3aa);})[_0xb09d('0x1f')](function(_0x4eda6b){_0x237fc3[_0xb09d('0x3e')]=_0x4eda6b;return _0x237fc3;})[_0xb09d('0x1f')](respondWithFilteredResult(_0x3c0db1,_0x36d3aa))[_0xb09d('0x3f')](handleError(_0x3c0db1,null));};exports[_0xb09d('0x40')]=function(_0x42f851,_0x10d775){var _0x19bd00={'raw':!![],'where':{'id':_0x42f851[_0xb09d('0x41')]['id']}},_0x42552e={};_0x42552e['model']=_[_0xb09d('0x2c')](db[_0xb09d('0x28')][_0xb09d('0x42')]);_0x42552e[_0xb09d('0x2b')]=_['keys'](_0x42f851[_0xb09d('0x2b')]);_0x42552e[_0xb09d('0x2d')]=_['intersection'](_0x42552e['model'],_0x42552e[_0xb09d('0x2b')]);_0x19bd00[_0xb09d('0x30')]=_['intersection'](_0x42552e[_0xb09d('0x2a')],qs[_0xb09d('0x2f')](_0x42f851['query'][_0xb09d('0x2f')]));_0x19bd00[_0xb09d('0x30')]=_0x19bd00[_0xb09d('0x30')]['length']?_0x19bd00[_0xb09d('0x30')]:_0x42552e[_0xb09d('0x2a')];if(_0x42f851[_0xb09d('0x2b')]['includeAll']){_0x19bd00[_0xb09d('0x3d')]=[{'all':!![]}];}_0x19bd00=_[_0xb09d('0x39')]({},_0x19bd00,_0x42f851[_0xb09d('0x43')]);return db[_0xb09d('0x28')][_0xb09d('0x44')](_0x19bd00)[_0xb09d('0x1f')](handleEntityNotFound(_0x10d775,null))['then'](respondWithResult(_0x10d775,null))[_0xb09d('0x3f')](handleError(_0x10d775,null));};exports['create']=function(_0x6f4e7c,_0x4a7c43){return db[_0xb09d('0x28')][_0xb09d('0x45')](_0x6f4e7c[_0xb09d('0x46')],{})[_0xb09d('0x1f')](function(_0x383a66){var _0x2e0263=_0x6f4e7c[_0xb09d('0x47')][_0xb09d('0x48')]({'plain':!![]});if(!_0x2e0263)throw new Error(_0xb09d('0x49'));if(_0x2e0263[_0xb09d('0x4a')]===_0xb09d('0x47')){var _0x5b674d=_0x383a66['get']({'plain':!![]});var _0x48171d=_0xb09d('0x20');return db['UserProfileSection']['find']({'where':{'name':_0x48171d,'userProfileId':_0x2e0263[_0xb09d('0x4b')]},'raw':!![]})[_0xb09d('0x1f')](function(_0x3c6d28){if(_0x3c6d28&&_0x3c6d28[_0xb09d('0x4c')]===0x0){return db[_0xb09d('0x21')][_0xb09d('0x45')]({'name':_0x5b674d['name'],'resourceId':_0x5b674d['id'],'type':_0x3c6d28[_0xb09d('0x24')],'sectionId':_0x3c6d28['id']},{})[_0xb09d('0x1f')](function(){return _0x383a66;});}else{return _0x383a66;}})[_0xb09d('0x3f')](function(_0x2ea050){logger[_0xb09d('0x22')](_0xb09d('0x4d'),_0x2ea050);throw _0x2ea050;});}return _0x383a66;})[_0xb09d('0x1f')](respondWithResult(_0x4a7c43,0xc9))[_0xb09d('0x3f')](handleError(_0x4a7c43,null));};exports[_0xb09d('0x4e')]=function(_0x1634d1,_0x28d771){if(_0x1634d1[_0xb09d('0x46')]['id']){delete _0x1634d1[_0xb09d('0x46')]['id'];}return db[_0xb09d('0x28')]['find']({'where':{'id':_0x1634d1['params']['id']}})[_0xb09d('0x1f')](handleEntityNotFound(_0x28d771,null))[_0xb09d('0x1f')](saveUpdates(_0x1634d1['body'],null))['then'](respondWithResult(_0x28d771,null))[_0xb09d('0x3f')](handleError(_0x28d771,null));};exports[_0xb09d('0x1e')]=function(_0x1e7150,_0x27ef79){return db[_0xb09d('0x28')]['find']({'where':{'id':_0x1e7150[_0xb09d('0x41')]['id']}})[_0xb09d('0x1f')](handleEntityNotFound(_0x27ef79,null))[_0xb09d('0x1f')](removeEntity(_0x27ef79,null))[_0xb09d('0x3f')](handleError(_0x27ef79,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index d69734e..6fe3f96 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 _0x08b1=['../../config/environment','./variable.attributes','exports','Variable','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4051be,_0x4e30dc){var _0x10d8e5=function(_0x1ae1c2){while(--_0x1ae1c2){_0x4051be['push'](_0x4051be['shift']());}};_0x10d8e5(++_0x4e30dc);}(_0x08b1,0x185));var _0x108b=function(_0x572de9,_0x398f69){_0x572de9=_0x572de9-0x0;var _0x1e3381=_0x08b1[_0x572de9];return _0x1e3381;};'use strict';var _=require(_0x108b('0x0'));var util=require('util');var logger=require(_0x108b('0x1'))(_0x108b('0x2'));var moment=require(_0x108b('0x3'));var BPromise=require(_0x108b('0x4'));var rp=require(_0x108b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x108b('0x6'));var config=require(_0x108b('0x7'));var attributes=require(_0x108b('0x8'));module[_0x108b('0x9')]=function(_0x501d37,_0x36d5f4){return _0x501d37['define'](_0x108b('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ef0=['rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x0ef0,0x95));var _0x00ef=function(_0x14153a,_0x127448){_0x14153a=_0x14153a-0x0;var _0x3ad489=_0x0ef0[_0x14153a];return _0x3ad489;};'use strict';var _=require(_0x00ef('0x0'));var util=require('util');var logger=require(_0x00ef('0x1'))(_0x00ef('0x2'));var moment=require(_0x00ef('0x3'));var BPromise=require(_0x00ef('0x4'));var rp=require(_0x00ef('0x5'));var fs=require('fs');var path=require(_0x00ef('0x6'));var rimraf=require(_0x00ef('0x7'));var config=require(_0x00ef('0x8'));var attributes=require(_0x00ef('0x9'));module[_0x00ef('0xa')]=function(_0x1406cf,_0x3f1671){return _0x1406cf[_0x00ef('0xb')]('Variable',attributes,{'tableName':_0x00ef('0xc'),'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 ca9c392..c0e6e0d 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 _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x326f,0xd1));var _0xf326=function(_0x3cec37,_0x524f00){_0x3cec37=_0x3cec37-0x0;var _0x49ce9f=_0x326f[_0x3cec37];return _0x49ce9f;};'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')]('Variable,\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')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x2abeda,_0x3b0012){var _0x572bfc=function(_0x15bea1){while(--_0x15bea1){_0x2abeda['push'](_0x2abeda['shift']());}};_0x572bfc(++_0x3b0012);}(_0x814b,0x1a2));var _0xb814=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0x814b[_0x4d3187];return _0x107906;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index e1b21ac..e1f4452 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 _0x9a5b=['get','index','/fetch','canUpdate','/reset','isAuthenticated','reset','pull','restart','/migrations','migrations','exports','express','Router','./version.controller'];(function(_0x2cc534,_0x22fd01){var _0x4568c6=function(_0x4df2c1){while(--_0x4df2c1){_0x2cc534['push'](_0x2cc534['shift']());}};_0x4568c6(++_0x22fd01);}(_0x9a5b,0x11a));var _0xb9a5=function(_0x4d9de6,_0x51be8d){_0x4d9de6=_0x4d9de6-0x0;var _0x22afcc=_0x9a5b[_0x4d9de6];return _0x22afcc;};'use strict';var express=require(_0xb9a5('0x0'));var router=express[_0xb9a5('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xb9a5('0x2'));router[_0xb9a5('0x3')]('/',controller[_0xb9a5('0x4')]);router[_0xb9a5('0x3')](_0xb9a5('0x5'),auth['isAuthenticated'](),auth[_0xb9a5('0x6')](),controller['fetch']);router[_0xb9a5('0x3')](_0xb9a5('0x7'),auth[_0xb9a5('0x8')](),auth[_0xb9a5('0x6')](),controller[_0xb9a5('0x9')]);router[_0xb9a5('0x3')]('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xb9a5('0xa')]);router[_0xb9a5('0x3')]('/restart',auth['isAuthenticated'](),controller[_0xb9a5('0xb')]);router[_0xb9a5('0x3')](_0xb9a5('0xc'),controller[_0xb9a5('0xd')]);module[_0xb9a5('0xe')]=router; \ No newline at end of file +var _0x50b8=['/restart','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull'];(function(_0x3abcaf,_0x489b04){var _0x2f1b51=function(_0x557bb7){while(--_0x557bb7){_0x3abcaf['push'](_0x3abcaf['shift']());}};_0x2f1b51(++_0x489b04);}(_0x50b8,0x104));var _0x850b=function(_0x186999,_0x5a484d){_0x186999=_0x186999-0x0;var _0x3c3657=_0x50b8[_0x186999];return _0x3c3657;};'use strict';var express=require(_0x850b('0x0'));var router=express[_0x850b('0x1')]();var auth=require(_0x850b('0x2'));var controller=require(_0x850b('0x3'));router[_0x850b('0x4')]('/',controller['index']);router[_0x850b('0x4')](_0x850b('0x5'),auth[_0x850b('0x6')](),auth[_0x850b('0x7')](),controller[_0x850b('0x8')]);router[_0x850b('0x4')]('/reset',auth[_0x850b('0x6')](),auth[_0x850b('0x7')](),controller[_0x850b('0x9')]);router['get'](_0x850b('0xa'),auth[_0x850b('0x6')](),auth[_0x850b('0x7')](),controller[_0x850b('0xb')]);router[_0x850b('0x4')](_0x850b('0xc'),auth[_0x850b('0x6')](),controller[_0x850b('0xd')]);router[_0x850b('0x4')](_0x850b('0xe'),controller['migrations']);module[_0x850b('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 9f28fe3..1888fa7 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 _0x11bf=['\x20to\x20','last','umzug','lodash','version','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','latest','fetch','tags','2.0.0','json','status','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','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','Database\x20migrated\x20successfully\x20from\x20version\x20'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x11bf,0x68));var _0xf11b=function(_0x1d1636,_0x3aa077){_0x1d1636=_0x1d1636-0x0;var _0x5405c5=_0x11bf[_0x1d1636];return _0x5405c5;};'use strict';var Umzug=require(_0xf11b('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xf11b('0x1'));var pkginfo=require('pkginfo')(module,_0xf11b('0x2'));var compareVersions=require(_0xf11b('0x3'));var exec=require('child_process')['exec'];var db=require(_0xf11b('0x4'))['db'];var config=require(_0xf11b('0x5'));var pm2=require(_0xf11b('0x6'));var logger=require(_0xf11b('0x7'))(_0xf11b('0x8'));var git=require(_0xf11b('0x9'))(config[_0xf11b('0xa')]);exports['index']=function(_0x3f4b6b,_0x5a83dd){var _0x306a12={'current':module[_0xf11b('0xb')][_0xf11b('0x2')],'phonebar':0x2};if(_0x3f4b6b['query']&&_0x3f4b6b['query'][_0xf11b('0xc')]){return git[_0xf11b('0xd')]()[_0xf11b('0xe')](function(_0x55023a,_0x2b2f2b){_0x306a12[_0xf11b('0xc')]=(_0x55023a?module[_0xf11b('0xb')][_0xf11b('0x2')]:_0x2b2f2b[_0xf11b('0xc')])||_0xf11b('0xf');return _0x5a83dd['status'](0xc8)[_0xf11b('0x10')](_0x306a12);});}else{return _0x5a83dd[_0xf11b('0x11')](0xc8)['json'](_0x306a12);}};exports[_0xf11b('0xd')]=function(_0x36c297,_0xf59bfa){return git[_0xf11b('0xd')]([_0xf11b('0x12'),'master'],function(_0x2e330e){if(_0x2e330e){logger[_0xf11b('0x13')](_0x2e330e);return _0xf59bfa['status'](0x1f4)[_0xf11b('0x10')](_0x2e330e);}logger[_0xf11b('0x14')](_0xf11b('0x15'));return _0xf59bfa[_0xf11b('0x11')](0xc8)[_0xf11b('0x10')]({'output':_0xf11b('0x16')});});};exports[_0xf11b('0x17')]=function(_0x1447e8,_0x4a2bc1){return git[_0xf11b('0x17')]([_0xf11b('0x18'),_0xf11b('0x19')],function(_0x4809d2){if(_0x4809d2){logger[_0xf11b('0x13')](_0x4809d2);return _0x4a2bc1[_0xf11b('0x11')](0x1f4)[_0xf11b('0x10')](_0x4809d2);}logger[_0xf11b('0x14')](_0xf11b('0x1a'));return _0x4a2bc1[_0xf11b('0x11')](0xc8)['json']({'output':_0xf11b('0x1b')});});};exports[_0xf11b('0x1c')]=function(_0x311042,_0x1b5cfb){exec(_0xf11b('0x1d'),function(_0x55061e,_0x2787f4,_0x266c07){logger[_0xf11b('0x14')](_0x2787f4);logger[_0xf11b('0x14')](_0x266c07);if(_0x55061e){logger['error'](_0x55061e);return _0x1b5cfb[_0xf11b('0x11')](0x1f4)['json'](_0x55061e);}return _0x1b5cfb['status'](0xc8)['json']({'output':_0x2787f4});});};exports['restart']=function(_0x45a625,_0x44cc23){return pm2['restart'](_0xf11b('0x1e'))[_0xf11b('0x1f')](function(_0x4f40a5){logger[_0xf11b('0x14')](_0xf11b('0x20'),_0x4f40a5);return _0x44cc23['status'](0xc8)[_0xf11b('0x10')]({'output':_0xf11b('0x21')});})[_0xf11b('0x22')](function(_0x2270bc){logger[_0xf11b('0x13')](_0x2270bc);return _0x44cc23[_0xf11b('0x11')](0x1f4)['json'](_0x2270bc);});};exports[_0xf11b('0x23')]=function(_0x22dda7,_0x106a27){var _0x5c4c6e=fs['readdirSync'](path[_0xf11b('0x24')](config['root'],'server',_0xf11b('0x23')));var _0x35fc53=[];for(var _0x58089f=0x0;_0x58089f<_0x5c4c6e[_0xf11b('0x25')];_0x58089f++){var _0x153bfa=_0x5c4c6e[_0x58089f][_0xf11b('0x26')](_0xf11b('0x27'),'');if(compareVersions(module['exports']['version'],_0x153bfa)===-0x1){_0x35fc53[_0xf11b('0x28')](_0x153bfa);}}if(_0x35fc53[_0xf11b('0x25')]){var _0x57f467=_0x35fc53[_0xf11b('0x29')](compareVersions);var _0x135a5d=new Umzug({'storage':_0xf11b('0x2a'),'storageOptions':{'model':db[_0xf11b('0x2b')],'modelName':'Migration','columnName':_0xf11b('0x2')},'migrations':{'params':[db['sequelize'][_0xf11b('0x2c')](),db[_0xf11b('0x2a')][_0xf11b('0x2d')],function(){throw new Error(_0xf11b('0x2e'));}],'path':path['join'](config['root'],'server',_0xf11b('0x23')),'pattern':/\.js$/}});_0x135a5d['up']({'migrations':_[_0xf11b('0x2f')](_0x57f467,function(_0x58d583){return _0x58d583+_0xf11b('0x27');})})[_0xf11b('0x1f')](function(){return _0x106a27[_0xf11b('0x11')](0xc8)[_0xf11b('0x10')]({'output':_0xf11b('0x30')+module['exports'][_0xf11b('0x2')]+_0xf11b('0x31')+_[_0xf11b('0x32')](_0x57f467),'migrations':_[_0xf11b('0x24')](_0x57f467)});})[_0xf11b('0x22')](function(_0x4d51ae){if(_0x4d51ae instanceof db[_0xf11b('0x2a')]['UniqueConstraintError']){return _0x106a27[_0xf11b('0x11')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x106a27[_0xf11b('0x11')](0x1f4)[_0xf11b('0x10')](_0x4d51ae);}});}else{return _0x106a27['status'](0xc8)[_0xf11b('0x10')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x0f0d=['json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','readdirSync','join','server','migrations','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','map','.js','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','version','query','fetch','tags','latest','status'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x0f0d,0xf0));var _0xd0f0=function(_0x54f10e,_0x328584){_0x54f10e=_0x54f10e-0x0;var _0x1cc01d=_0x0f0d[_0x54f10e];return _0x1cc01d;};'use strict';var Umzug=require(_0xd0f0('0x0'));var path=require(_0xd0f0('0x1'));var fs=require('fs');var _=require(_0xd0f0('0x2'));var pkginfo=require(_0xd0f0('0x3'))(module,'version');var compareVersions=require(_0xd0f0('0x4'));var exec=require(_0xd0f0('0x5'))['exec'];var db=require(_0xd0f0('0x6'))['db'];var config=require(_0xd0f0('0x7'));var pm2=require(_0xd0f0('0x8'));var logger=require(_0xd0f0('0x9'))(_0xd0f0('0xa'));var git=require(_0xd0f0('0xb'))(config[_0xd0f0('0xc')]);exports['index']=function(_0x461422,_0x5d3e6d){var _0x352d07={'current':module[_0xd0f0('0xd')][_0xd0f0('0xe')],'phonebar':0x2};if(_0x461422[_0xd0f0('0xf')]&&_0x461422['query']['latest']){return git[_0xd0f0('0x10')]()[_0xd0f0('0x11')](function(_0x307937,_0x1b18ea){_0x352d07[_0xd0f0('0x12')]=(_0x307937?module[_0xd0f0('0xd')]['version']:_0x1b18ea[_0xd0f0('0x12')])||'2.0.0';return _0x5d3e6d[_0xd0f0('0x13')](0xc8)[_0xd0f0('0x14')](_0x352d07);});}else{return _0x5d3e6d[_0xd0f0('0x13')](0xc8)[_0xd0f0('0x14')](_0x352d07);}};exports['fetch']=function(_0x1ee1dd,_0x113f5e){return git['fetch']([_0xd0f0('0x15'),'master'],function(_0x126652){if(_0x126652){logger[_0xd0f0('0x16')](_0x126652);return _0x113f5e[_0xd0f0('0x13')](0x1f4)['json'](_0x126652);}logger[_0xd0f0('0x17')](_0xd0f0('0x18'));return _0x113f5e['status'](0xc8)[_0xd0f0('0x14')]({'output':_0xd0f0('0x19')});});};exports[_0xd0f0('0x1a')]=function(_0x3f601f,_0x34b001){return git[_0xd0f0('0x1a')]([_0xd0f0('0x1b'),'FETCH_HEAD'],function(_0x15488a){if(_0x15488a){logger['error'](_0x15488a);return _0x34b001[_0xd0f0('0x13')](0x1f4)['json'](_0x15488a);}logger[_0xd0f0('0x17')](_0xd0f0('0x1c'));return _0x34b001[_0xd0f0('0x13')](0xc8)[_0xd0f0('0x14')]({'output':_0xd0f0('0x1d')});});};exports['pull']=function(_0x3b74fe,_0x4780de){exec(_0xd0f0('0x1e'),function(_0x594b24,_0x2f47e2,_0x17bfaf){logger['info'](_0x2f47e2);logger[_0xd0f0('0x17')](_0x17bfaf);if(_0x594b24){logger['error'](_0x594b24);return _0x4780de[_0xd0f0('0x13')](0x1f4)[_0xd0f0('0x14')](_0x594b24);}return _0x4780de['status'](0xc8)[_0xd0f0('0x14')]({'output':_0x2f47e2});});};exports['restart']=function(_0xe4d42e,_0x45a9b5){return pm2[_0xd0f0('0x1f')]('motion2')[_0xd0f0('0x20')](function(_0x1018a3){logger[_0xd0f0('0x17')](_0xd0f0('0x21'),_0x1018a3);return _0x45a9b5['status'](0xc8)[_0xd0f0('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xd0f0('0x22')](function(_0x58dbba){logger['error'](_0x58dbba);return _0x45a9b5[_0xd0f0('0x13')](0x1f4)['json'](_0x58dbba);});};exports['migrations']=function(_0x4d6bf0,_0x88689d){var _0x4ba27a=fs[_0xd0f0('0x23')](path[_0xd0f0('0x24')](config[_0xd0f0('0xc')],_0xd0f0('0x25'),_0xd0f0('0x26')));var _0x594e8e=[];for(var _0x1eb09d=0x0;_0x1eb09d<_0x4ba27a[_0xd0f0('0x27')];_0x1eb09d++){var _0x1342d6=_0x4ba27a[_0x1eb09d][_0xd0f0('0x28')]('.js','');if(compareVersions(module[_0xd0f0('0xd')]['version'],_0x1342d6)===-0x1){_0x594e8e[_0xd0f0('0x29')](_0x1342d6);}}if(_0x594e8e[_0xd0f0('0x27')]){var _0x23cb03=_0x594e8e[_0xd0f0('0x2a')](compareVersions);var _0x198901=new Umzug({'storage':_0xd0f0('0x2b'),'storageOptions':{'model':db[_0xd0f0('0x2c')],'modelName':_0xd0f0('0x2c'),'columnName':_0xd0f0('0xe')},'migrations':{'params':[db[_0xd0f0('0x2b')][_0xd0f0('0x2d')](),db[_0xd0f0('0x2b')][_0xd0f0('0x2e')],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[_0xd0f0('0x24')](config[_0xd0f0('0xc')],_0xd0f0('0x25'),_0xd0f0('0x26')),'pattern':/\.js$/}});_0x198901['up']({'migrations':_[_0xd0f0('0x2f')](_0x23cb03,function(_0x336716){return _0x336716+_0xd0f0('0x30');})})[_0xd0f0('0x20')](function(){return _0x88689d[_0xd0f0('0x13')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xd0f0('0xd')][_0xd0f0('0xe')]+_0xd0f0('0x31')+_['last'](_0x23cb03),'migrations':_[_0xd0f0('0x24')](_0x23cb03)});})[_0xd0f0('0x22')](function(_0x4cf7f6){if(_0x4cf7f6 instanceof db[_0xd0f0('0x2b')][_0xd0f0('0x32')]){return _0x88689d[_0xd0f0('0x13')](0xc8)[_0xd0f0('0x14')]({'output':_0xd0f0('0x33')});}else{return _0x88689d['status'](0x1f4)[_0xd0f0('0x14')](_0x4cf7f6);}});}else{return _0x88689d[_0xd0f0('0x13')](0xc8)[_0xd0f0('0x14')]({'output':_0xd0f0('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 32063f9..d20a6ce 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 _0xee08=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1c2f29,_0xd124c4){var _0x6d56aa=function(_0x444b72){while(--_0x444b72){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x6d56aa(++_0xd124c4);}(_0xee08,0x8a));var _0x8ee0=function(_0x3e68ed,_0x3cffe4){_0x3e68ed=_0x3e68ed-0x0;var _0x3901c5=_0xee08[_0x3e68ed];return _0x3901c5;};'use strict';var multer=require(_0x8ee0('0x0'));var util=require(_0x8ee0('0x1'));var path=require(_0x8ee0('0x2'));var timeout=require(_0x8ee0('0x3'));var express=require(_0x8ee0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8ee0('0x5'));var config=require('../../config/environment');var controller=require(_0x8ee0('0x6'));router[_0x8ee0('0x7')]('/',auth[_0x8ee0('0x8')](),controller[_0x8ee0('0x9')]);router[_0x8ee0('0x7')](_0x8ee0('0xa'),auth[_0x8ee0('0x8')](),controller[_0x8ee0('0xb')]);router[_0x8ee0('0x7')](_0x8ee0('0xc'),auth[_0x8ee0('0x8')](),controller[_0x8ee0('0xd')]);router['post']('/',auth[_0x8ee0('0x8')](),controller['create']);router[_0x8ee0('0xe')](_0x8ee0('0xc'),auth[_0x8ee0('0x8')](),controller[_0x8ee0('0xf')]);router[_0x8ee0('0x10')]('/:id',auth[_0x8ee0('0x8')](),controller[_0x8ee0('0x11')]);module[_0x8ee0('0x12')]=router; \ No newline at end of file +var _0xe260=['Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0xe260,0x6e));var _0x0e26=function(_0x460485,_0x22682e){_0x460485=_0x460485-0x0;var _0x32c673=_0xe260[_0x460485];return _0x32c673;};'use strict';var multer=require('multer');var util=require(_0x0e26('0x0'));var path=require(_0x0e26('0x1'));var timeout=require(_0x0e26('0x2'));var express=require(_0x0e26('0x3'));var router=express[_0x0e26('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e26('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0e26('0x6'));var controller=require(_0x0e26('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0e26('0x8')](_0x0e26('0x9'),auth[_0x0e26('0xa')](),controller[_0x0e26('0xb')]);router[_0x0e26('0x8')](_0x0e26('0xc'),auth[_0x0e26('0xa')](),controller[_0x0e26('0xd')]);router[_0x0e26('0xe')]('/',auth[_0x0e26('0xa')](),controller[_0x0e26('0xf')]);router['put'](_0x0e26('0xc'),auth[_0x0e26('0xa')](),controller[_0x0e26('0x10')]);router['delete'](_0x0e26('0xc'),auth[_0x0e26('0xa')](),controller[_0x0e26('0x11')]);module[_0x0e26('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 2426691..faf251f 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 _0x7e27=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x31311d,_0xdbe2d){var _0x11ac8c=function(_0x1c6c94){while(--_0x1c6c94){_0x31311d['push'](_0x31311d['shift']());}};_0x11ac8c(++_0xdbe2d);}(_0x7e27,0xdd));var _0x77e2=function(_0x1ae553,_0x18d468){_0x1ae553=_0x1ae553-0x0;var _0x43d641=_0x7e27[_0x1ae553];return _0x43d641;};'use strict';var Sequelize=require(_0x77e2('0x0'));module[_0x77e2('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x77e2('0x2')]},'calleridnum':{'type':Sequelize[_0x77e2('0x2')]},'calleridname':{'type':Sequelize[_0x77e2('0x2')]},'queue':{'type':Sequelize[_0x77e2('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x77e2('0x2')]},'agentcalledAt':{'type':Sequelize[_0x77e2('0x3')]},'agentconnectAt':{'type':Sequelize[_0x77e2('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x77e2('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x77e2('0x4')]},'agentcomplete':{'type':Sequelize[_0x77e2('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x77e2('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x77e2('0x4')]},'agentacw':{'type':Sequelize[_0x77e2('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x77e2('0x4')]},'reason':{'type':Sequelize[_0x77e2('0x2')]},'lastevent':{'type':Sequelize[_0x77e2('0x2')]},'channel':{'type':Sequelize[_0x77e2('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x77e2('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x77e2('0x2')]},'accountcode':{'type':Sequelize[_0x77e2('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x77e2('0x2')]},'destchannel':{'type':Sequelize[_0x77e2('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x77e2('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x77e2('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x77e2('0x2')]},'destlanguage':{'type':Sequelize[_0x77e2('0x2')]},'destaccountcode':{'type':Sequelize[_0x77e2('0x2')]},'destcontext':{'type':Sequelize[_0x77e2('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x77e2('0x2')]},'destuniqueid':{'type':Sequelize[_0x77e2('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x77e2('0x2')]},'transfer':{'type':Sequelize[_0x77e2('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x77e2('0x2')],'comment':_0x77e2('0x6')},'transferexten':{'type':Sequelize[_0x77e2('0x2')]},'transferuniqueid':{'type':Sequelize[_0x77e2('0x2')]},'agententerreason':{'type':Sequelize[_0x77e2('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbe9d=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x4f93ea,_0x5f2e1d){var _0x2a542c=function(_0x53ff37){while(--_0x53ff37){_0x4f93ea['push'](_0x4f93ea['shift']());}};_0x2a542c(++_0x5f2e1d);}(_0xbe9d,0x99));var _0xdbe9=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xbe9d[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0xdbe9('0x0'));module[_0xdbe9('0x1')]={'type':{'type':Sequelize[_0xdbe9('0x2')]},'uniqueid':{'type':Sequelize[_0xdbe9('0x2')]},'calleridnum':{'type':Sequelize[_0xdbe9('0x2')]},'calleridname':{'type':Sequelize[_0xdbe9('0x2')]},'queue':{'type':Sequelize[_0xdbe9('0x2')]},'interface':{'type':Sequelize[_0xdbe9('0x2')]},'membername':{'type':Sequelize[_0xdbe9('0x2')]},'agentcalledAt':{'type':Sequelize[_0xdbe9('0x3')]},'agentconnectAt':{'type':Sequelize[_0xdbe9('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xdbe9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xdbe9('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xdbe9('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xdbe9('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xdbe9('0x5')]},'agentacw':{'type':Sequelize[_0xdbe9('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdbe9('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdbe9('0x2')]},'channelstate':{'type':Sequelize[_0xdbe9('0x5')]},'channelstatedesc':{'type':Sequelize[_0xdbe9('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdbe9('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdbe9('0x2')]},'accountcode':{'type':Sequelize[_0xdbe9('0x2')]},'context':{'type':Sequelize[_0xdbe9('0x2')]},'exten':{'type':Sequelize[_0xdbe9('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xdbe9('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xdbe9('0x2')]},'destcalleridnum':{'type':Sequelize[_0xdbe9('0x2')]},'destcalleridname':{'type':Sequelize[_0xdbe9('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xdbe9('0x2')]},'destlanguage':{'type':Sequelize[_0xdbe9('0x2')]},'destaccountcode':{'type':Sequelize[_0xdbe9('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xdbe9('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xdbe9('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xdbe9('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xdbe9('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdbe9('0x2')],'comment':_0xdbe9('0x6')},'transferexten':{'type':Sequelize[_0xdbe9('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xdbe9('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 6313110..5daece6 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(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 849878d..87b9ec9 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 _0xfd20=['uniqueid','destuniqueid','util','moment','bluebird','path','../../config/environment','./voiceAgentReport.attributes','exports','report_agent'];(function(_0x969273,_0x82763b){var _0x16db32=function(_0x22f1b0){while(--_0x22f1b0){_0x969273['push'](_0x969273['shift']());}};_0x16db32(++_0x82763b);}(_0xfd20,0x66));var _0x0fd2=function(_0x184dae,_0x5e7a29){_0x184dae=_0x184dae-0x0;var _0x3e53fe=_0xfd20[_0x184dae];return _0x3e53fe;};'use strict';var _=require('lodash');var util=require(_0x0fd2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0fd2('0x1'));var BPromise=require(_0x0fd2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fd2('0x3'));var rimraf=require('rimraf');var config=require(_0x0fd2('0x4'));var attributes=require(_0x0fd2('0x5'));module[_0x0fd2('0x6')]=function(_0xf25991,_0x247d6e){return _0xf25991['define']('VoiceAgentReport',attributes,{'tableName':_0x0fd2('0x7'),'paranoid':![],'indexes':[{'fields':[_0x0fd2('0x8'),_0x0fd2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid'];(function(_0x4723aa,_0x30c098){var _0x26a684=function(_0x1f9f52){while(--_0x1f9f52){_0x4723aa['push'](_0x4723aa['shift']());}};_0x26a684(++_0x30c098);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x5fc3[_0x1b5aea];return _0x51cae9;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'fields':[_0x35fc('0xc'),_0x35fc('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 6cbbfdc..f0fcfdf 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 _0x981d=['UpdateVoiceAgentReport','update','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','debug'];(function(_0x31e1e5,_0x1677a4){var _0x153909=function(_0x1a75df){while(--_0x1a75df){_0x31e1e5['push'](_0x31e1e5['shift']());}};_0x153909(++_0x1677a4);}(_0x981d,0xeb));var _0xd981=function(_0x52ae41,_0x94a9dc){_0x52ae41=_0x52ae41-0x0;var _0x42a6ee=_0x981d[_0x52ae41];return _0x42a6ee;};'use strict';var _=require(_0xd981('0x0'));var util=require(_0xd981('0x1'));var moment=require(_0xd981('0x2'));var BPromise=require(_0xd981('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd981('0x4'));var db=require(_0xd981('0x5'))['db'];var utils=require(_0xd981('0x6'));var logger=require(_0xd981('0x7'))(_0xd981('0x8'));var config=require(_0xd981('0x9'));var jayson=require(_0xd981('0xa'));var client=jayson[_0xd981('0xb')][_0xd981('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ba2cb,_0x368828,_0x5823ea){return new BPromise(function(_0x2d80ca,_0x3bc91e){return client[_0xd981('0xd')](_0x2ba2cb,_0x5823ea)[_0xd981('0xe')](function(_0x2aaa0a){logger[_0xd981('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x368828,'request\x20sent');logger['debug'](_0xd981('0x10'),_0x368828,'request\x20sent',JSON[_0xd981('0x11')](_0x2aaa0a));if(_0x2aaa0a['error']){if(_0x2aaa0a['error']['code']===0x1f4){logger[_0xd981('0x12')](_0xd981('0x13'),_0x368828,_0x2aaa0a[_0xd981('0x12')][_0xd981('0x14')]);return _0x3bc91e(_0x2aaa0a[_0xd981('0x12')][_0xd981('0x14')]);}logger['error'](_0xd981('0x13'),_0x368828,_0x2aaa0a[_0xd981('0x12')][_0xd981('0x14')]);return _0x2d80ca(_0x2aaa0a[_0xd981('0x12')]['message']);}else{logger[_0xd981('0xf')](_0xd981('0x13'),_0x368828,'request\x20sent');_0x2d80ca(_0x2aaa0a[_0xd981('0x15')][_0xd981('0x14')]);}})[_0xd981('0x16')](function(_0x6dd777){logger[_0xd981('0x12')](_0xd981('0x13'),_0x368828,_0x6dd777);_0x3bc91e(_0x6dd777);});});}exports[_0xd981('0x17')]=function(_0x501af1){var _0x37f062=this;return new Promise(function(_0x4e7811,_0x396052){return db[_0xd981('0x18')]['create'](_0x501af1[_0xd981('0x19')],{'raw':_0x501af1[_0xd981('0x1a')]?_0x501af1[_0xd981('0x1a')][_0xd981('0x1b')]===undefined?!![]:![]:!![]})[_0xd981('0xe')](function(_0x373091){logger[_0xd981('0xf')](_0xd981('0x17'),_0x501af1);logger[_0xd981('0x1c')](_0xd981('0x17'),_0x501af1,JSON[_0xd981('0x11')](_0x373091));_0x4e7811(_0x373091);})['catch'](function(_0x5bfdd7){logger['error'](_0xd981('0x17'),_0x5bfdd7[_0xd981('0x14')],_0x501af1);_0x396052(_0x37f062[_0xd981('0x12')](0x1f4,_0x5bfdd7[_0xd981('0x14')]));});});};exports[_0xd981('0x1d')]=function(_0x20c307){var _0x1a70f4=this;return new Promise(function(_0x4074b6,_0x16d3ed){return db[_0xd981('0x18')][_0xd981('0x1e')](_0x20c307[_0xd981('0x19')],{'raw':_0x20c307[_0xd981('0x1a')]?_0x20c307[_0xd981('0x1a')][_0xd981('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20c307[_0xd981('0x1a')]?_0x20c307[_0xd981('0x1a')][_0xd981('0x1f')]||null:null,'attributes':_0x20c307[_0xd981('0x1a')]?_0x20c307[_0xd981('0x1a')][_0xd981('0x20')]||null:null,'limit':_0x20c307[_0xd981('0x1a')]?_0x20c307[_0xd981('0x1a')]['limit']||null:null})['then'](function(_0x4852a2){logger['info'](_0xd981('0x1d'),_0x20c307);logger[_0xd981('0x1c')](_0xd981('0x1d'),_0x20c307,JSON[_0xd981('0x11')](_0x4852a2));_0x4074b6(_0x4852a2);})[_0xd981('0x16')](function(_0xebf16e){logger[_0xd981('0x12')](_0xd981('0x1d'),_0xebf16e['message'],_0x20c307);_0x16d3ed(_0x1a70f4[_0xd981('0x12')](0x1f4,_0xebf16e['message']));});});}; \ No newline at end of file +var _0x12e5=['stringify','catch','UpdateVoiceAgentReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw'];(function(_0x33171b,_0x4006c8){var _0x43f126=function(_0x4fb034){while(--_0x4fb034){_0x33171b['push'](_0x33171b['shift']());}};_0x43f126(++_0x4006c8);}(_0x12e5,0xa2));var _0x512e=function(_0x53e103,_0x91c857){_0x53e103=_0x53e103-0x0;var _0x5c134f=_0x12e5[_0x53e103];return _0x5c134f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x512e('0x0'));var BPromise=require(_0x512e('0x1'));var rs=require(_0x512e('0x2'));var fs=require('fs');var Redis=require(_0x512e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x512e('0x4'));var logger=require('../../config/logger')(_0x512e('0x5'));var config=require(_0x512e('0x6'));var jayson=require(_0x512e('0x7'));var client=jayson[_0x512e('0x8')][_0x512e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22b58e,_0x1d748d,_0x71e506){return new BPromise(function(_0x57f270,_0x13510c){return client[_0x512e('0xa')](_0x22b58e,_0x71e506)[_0x512e('0xb')](function(_0x2516f4){logger['info'](_0x512e('0xc'),_0x1d748d,'request\x20sent');logger[_0x512e('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1d748d,_0x512e('0xe'),JSON['stringify'](_0x2516f4));if(_0x2516f4['error']){if(_0x2516f4[_0x512e('0xf')][_0x512e('0x10')]===0x1f4){logger[_0x512e('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x1d748d,_0x2516f4[_0x512e('0xf')][_0x512e('0x11')]);return _0x13510c(_0x2516f4[_0x512e('0xf')][_0x512e('0x11')]);}logger[_0x512e('0xf')](_0x512e('0xc'),_0x1d748d,_0x2516f4[_0x512e('0xf')][_0x512e('0x11')]);return _0x57f270(_0x2516f4[_0x512e('0xf')]['message']);}else{logger[_0x512e('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x1d748d,_0x512e('0xe'));_0x57f270(_0x2516f4['result'][_0x512e('0x11')]);}})['catch'](function(_0x11fb07){logger[_0x512e('0xf')](_0x512e('0xc'),_0x1d748d,_0x11fb07);_0x13510c(_0x11fb07);});});}exports[_0x512e('0x13')]=function(_0x50a7e3){var _0x2cb599=this;return new Promise(function(_0x1d45f6,_0x2f6633){return db[_0x512e('0x14')]['create'](_0x50a7e3[_0x512e('0x15')],{'raw':_0x50a7e3['options']?_0x50a7e3[_0x512e('0x16')][_0x512e('0x17')]===undefined?!![]:![]:!![]})[_0x512e('0xb')](function(_0x1e3317){logger[_0x512e('0x12')](_0x512e('0x13'),_0x50a7e3);logger[_0x512e('0xd')](_0x512e('0x13'),_0x50a7e3,JSON[_0x512e('0x18')](_0x1e3317));_0x1d45f6(_0x1e3317);})[_0x512e('0x19')](function(_0x5965fe){logger[_0x512e('0xf')](_0x512e('0x13'),_0x5965fe['message'],_0x50a7e3);_0x2f6633(_0x2cb599['error'](0x1f4,_0x5965fe['message']));});});};exports[_0x512e('0x1a')]=function(_0x4d42d8){var _0x1e6d8a=this;return new Promise(function(_0x1c5691,_0x5aaa4b){return db[_0x512e('0x14')][_0x512e('0x1b')](_0x4d42d8[_0x512e('0x15')],{'raw':_0x4d42d8[_0x512e('0x16')]?_0x4d42d8[_0x512e('0x16')][_0x512e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d42d8['options']?_0x4d42d8[_0x512e('0x16')][_0x512e('0x1c')]||null:null,'attributes':_0x4d42d8['options']?_0x4d42d8[_0x512e('0x16')][_0x512e('0x1d')]||null:null,'limit':_0x4d42d8[_0x512e('0x16')]?_0x4d42d8[_0x512e('0x16')][_0x512e('0x1e')]||null:null})[_0x512e('0xb')](function(_0x5c2893){logger['info'](_0x512e('0x1a'),_0x4d42d8);logger['debug'](_0x512e('0x1a'),_0x4d42d8,JSON[_0x512e('0x18')](_0x5c2893));_0x1c5691(_0x5c2893);})[_0x512e('0x19')](function(_0x53593c){logger[_0x512e('0xf')]('UpdateVoiceAgentReport',_0x53593c['message'],_0x4d42d8);_0x5aaa4b(_0x1e6d8a['error'](0x1f4,_0x53593c[_0x512e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index bd5a2ad..44420aa 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 _0xb66c=['./voiceCallReport.controller','get','/describe','isAuthenticated','describe','show','post','create','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0xb66c,0x175));var _0xcb66=function(_0x43f68b,_0x5dc9ac){_0x43f68b=_0x43f68b-0x0;var _0x49af95=_0xb66c[_0x43f68b];return _0x49af95;};'use strict';var multer=require(_0xcb66('0x0'));var util=require('util');var path=require(_0xcb66('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb66('0x2'));var router=express[_0xcb66('0x3')]();var fs_extra=require(_0xcb66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var controller=require(_0xcb66('0x7'));router[_0xcb66('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb66('0x8')](_0xcb66('0x9'),auth[_0xcb66('0xa')](),controller[_0xcb66('0xb')]);router[_0xcb66('0x8')]('/:id',auth[_0xcb66('0xa')](),controller[_0xcb66('0xc')]);router[_0xcb66('0xd')]('/',auth[_0xcb66('0xa')](),controller[_0xcb66('0xe')]);router['put'](_0xcb66('0xf'),auth[_0xcb66('0xa')](),controller[_0xcb66('0x10')]);router[_0xcb66('0x11')]('/:id',auth[_0xcb66('0xa')](),controller[_0xcb66('0x12')]);module[_0xcb66('0x13')]=router; \ No newline at end of file +var _0x277c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x277c,0x153));var _0xc277=function(_0x35d032,_0x175693){_0x35d032=_0x35d032-0x0;var _0x555874=_0x277c[_0x35d032];return _0x555874;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xe')]('/',auth[_0xc277('0x9')](),controller[_0xc277('0xf')]);router['put']('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')](_0xc277('0xc'),auth['isAuthenticated'](),controller[_0xc277('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 03cfe99..ef77dc3 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 _0x18df=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','inbound','internal','outbound','outbound-fax'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x18df,0x1b2));var _0xf18d=function(_0x36eec7,_0x51bb20){_0x36eec7=_0x36eec7-0x0;var _0x120202=_0x18df[_0x36eec7];return _0x120202;};'use strict';var Sequelize=require(_0xf18d('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf18d('0x1')](_0xf18d('0x2'),_0xf18d('0x3'),_0xf18d('0x4'),'inbound-fax',_0xf18d('0x5'),_0xf18d('0x6'))},'tag':{'type':Sequelize[_0xf18d('0x7')]},'accountcode':{'type':Sequelize[_0xf18d('0x7')]},'source':{'type':Sequelize[_0xf18d('0x7')]},'destination':{'type':Sequelize[_0xf18d('0x7')]},'destinationcontext':{'type':Sequelize[_0xf18d('0x7')]},'callerid':{'type':Sequelize[_0xf18d('0x7')]},'channel':{'type':Sequelize[_0xf18d('0x7')]},'destinationchannel':{'type':Sequelize[_0xf18d('0x7')]},'lastapplication':{'type':Sequelize[_0xf18d('0x7')]},'lastdata':{'type':Sequelize[_0xf18d('0x8')]},'starttime':{'type':Sequelize[_0xf18d('0x9')]},'systemanswertime':{'type':Sequelize[_0xf18d('0x9')]},'answertime':{'type':Sequelize[_0xf18d('0x9')]},'endtime':{'type':Sequelize[_0xf18d('0x9')]},'duration':{'type':Sequelize[_0xf18d('0xa')]},'billableseconds':{'type':Sequelize[_0xf18d('0xa')]},'mohtime':{'type':Sequelize[_0xf18d('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf18d('0x7')]},'userfield':{'type':Sequelize[_0xf18d('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xf18d('0x7')]},'note':{'type':Sequelize[_0xf18d('0x7')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xf18d('0xa')]},'sipcallid':{'type':Sequelize[_0xf18d('0x7')]}}; \ No newline at end of file +var _0x0f42=['ENUM','internal','inbound-fax','dialer','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x1f4c4a,_0x3e4dc7){var _0x1c4c17=function(_0x394f0d){while(--_0x394f0d){_0x1f4c4a['push'](_0x1f4c4a['shift']());}};_0x1c4c17(++_0x3e4dc7);}(_0x0f42,0x126));var _0x20f4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0f42[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x20f4('0x0'));module[_0x20f4('0x1')]={'uniqueid':{'type':Sequelize[_0x20f4('0x2')]},'type':{'type':Sequelize[_0x20f4('0x3')]('inbound',_0x20f4('0x4'),'outbound',_0x20f4('0x5'),'outbound-fax',_0x20f4('0x6'))},'tag':{'type':Sequelize[_0x20f4('0x2')]},'accountcode':{'type':Sequelize[_0x20f4('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x20f4('0x2')]},'destinationcontext':{'type':Sequelize[_0x20f4('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x20f4('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x20f4('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x20f4('0x7')]},'endtime':{'type':Sequelize[_0x20f4('0x7')]},'duration':{'type':Sequelize[_0x20f4('0x8')]},'billableseconds':{'type':Sequelize[_0x20f4('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x20f4('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x20f4('0x2')]},'userDisposition':{'type':Sequelize[_0x20f4('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x20f4('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x20f4('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x20f4('0x2')]},'routeid':{'type':Sequelize[_0x20f4('0x8')]},'sipcallid':{'type':Sequelize[_0x20f4('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index d3b91e6..321f3f0 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x19e5b0,_0x148762){var _0x29b4b7=function(_0x466dfe){while(--_0x466dfe){_0x19e5b0['push'](_0x19e5b0['shift']());}};_0x29b4b7(++_0x148762);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0xb10b[_0x2ca2d0];return _0x521c23;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0xea9915,_0x4ee514){var _0x40c036=function(_0x159ced){while(--_0x159ced){_0xea9915['push'](_0xea9915['shift']());}};_0x40c036(++_0x4ee514);}(_0xb10b,0x12a));var _0xbb10=function(_0xf3120,_0x80a54c){_0xf3120=_0xf3120-0x0;var _0x5aa549=_0xb10b[_0xf3120];return _0x5aa549;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 06e9e11..5e2e766 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 _0x7f84=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','uniqueid','lodash'];(function(_0x158d4d,_0x1b164f){var _0x1b07fa=function(_0x4e879f){while(--_0x4e879f){_0x158d4d['push'](_0x158d4d['shift']());}};_0x1b07fa(++_0x1b164f);}(_0x7f84,0xf1));var _0x47f8=function(_0x23b387,_0x16f0cc){_0x23b387=_0x23b387-0x0;var _0xa6df56=_0x7f84[_0x23b387];return _0xa6df56;};'use strict';var _=require(_0x47f8('0x0'));var util=require(_0x47f8('0x1'));var logger=require(_0x47f8('0x2'))('api');var moment=require(_0x47f8('0x3'));var BPromise=require(_0x47f8('0x4'));var rp=require(_0x47f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47f8('0x6'));var config=require(_0x47f8('0x7'));var attributes=require(_0x47f8('0x8'));module[_0x47f8('0x9')]=function(_0xf402a4,_0x36395e){return _0xf402a4['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x47f8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2da5=['rimraf','../../config/environment','./voiceCallReport.attributes','report_call','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2da5,0x123));var _0x52da=function(_0x5a477a,_0x14cd68){_0x5a477a=_0x5a477a-0x0;var _0x28aab4=_0x2da5[_0x5a477a];return _0x28aab4;};'use strict';var _=require(_0x52da('0x0'));var util=require(_0x52da('0x1'));var logger=require(_0x52da('0x2'))('api');var moment=require(_0x52da('0x3'));var BPromise=require(_0x52da('0x4'));var rp=require(_0x52da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52da('0x6'));var config=require(_0x52da('0x7'));var attributes=require(_0x52da('0x8'));module['exports']=function(_0x1d9188,_0x5ab74e){return _0x1d9188['define']('VoiceCallReport',attributes,{'tableName':_0x52da('0x9'),'paranoid':![],'indexes':[{'fields':[_0x52da('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index a1a833f..8bdb776 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 _0xa6d8=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include','map','attributes','model','CreateVoiceCallReport','body','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring'];(function(_0x475e3a,_0x5b7ca9){var _0x1249d8=function(_0x3b05ba){while(--_0x3b05ba){_0x475e3a['push'](_0x475e3a['shift']());}};_0x1249d8(++_0x5b7ca9);}(_0xa6d8,0x6a));var _0x8a6d=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xa6d8[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require(_0x8a6d('0x0'));var util=require(_0x8a6d('0x1'));var moment=require(_0x8a6d('0x2'));var BPromise=require(_0x8a6d('0x3'));var rs=require(_0x8a6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8a6d('0x5'))('rpc');var config=require(_0x8a6d('0x6'));var jayson=require(_0x8a6d('0x7'));var client=jayson[_0x8a6d('0x8')][_0x8a6d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b40da,_0x319af9,_0x3a6223){return new BPromise(function(_0x2c9366,_0x1141a9){return client[_0x8a6d('0xa')](_0x2b40da,_0x3a6223)[_0x8a6d('0xb')](function(_0x4480f2){logger[_0x8a6d('0xc')](_0x8a6d('0xd'),_0x319af9,'request\x20sent');logger[_0x8a6d('0xe')](_0x8a6d('0xf'),_0x319af9,_0x8a6d('0x10'),JSON[_0x8a6d('0x11')](_0x4480f2));if(_0x4480f2['error']){if(_0x4480f2[_0x8a6d('0x12')][_0x8a6d('0x13')]===0x1f4){logger[_0x8a6d('0x12')](_0x8a6d('0xd'),_0x319af9,_0x4480f2[_0x8a6d('0x12')][_0x8a6d('0x14')]);return _0x1141a9(_0x4480f2[_0x8a6d('0x12')][_0x8a6d('0x14')]);}logger['error'](_0x8a6d('0xd'),_0x319af9,_0x4480f2[_0x8a6d('0x12')][_0x8a6d('0x14')]);return _0x2c9366(_0x4480f2[_0x8a6d('0x12')]['message']);}else{logger['info'](_0x8a6d('0xd'),_0x319af9,'request\x20sent');_0x2c9366(_0x4480f2[_0x8a6d('0x15')][_0x8a6d('0x14')]);}})[_0x8a6d('0x16')](function(_0x536ab9){logger[_0x8a6d('0x12')](_0x8a6d('0xd'),_0x319af9,_0x536ab9);_0x1141a9(_0x536ab9);});});}exports[_0x8a6d('0x17')]=function(_0x3aac2e){var _0x5f3c16=this;return new Promise(function(_0x3a9831,_0x33dbde){return db[_0x8a6d('0x18')]['findAll']({'raw':_0x3aac2e[_0x8a6d('0x19')]?_0x3aac2e[_0x8a6d('0x19')][_0x8a6d('0x1a')]===undefined?!![]:![]:!![],'where':_0x3aac2e[_0x8a6d('0x19')]?_0x3aac2e[_0x8a6d('0x19')][_0x8a6d('0x1b')]||null:null,'attributes':_0x3aac2e[_0x8a6d('0x19')]?_0x3aac2e[_0x8a6d('0x19')]['attributes']||null:null,'limit':_0x3aac2e[_0x8a6d('0x19')]?_0x3aac2e[_0x8a6d('0x19')][_0x8a6d('0x1c')]||null:null,'include':_0x3aac2e[_0x8a6d('0x19')]?_0x3aac2e[_0x8a6d('0x19')][_0x8a6d('0x1d')]?_[_0x8a6d('0x1e')](_0x3aac2e['options'][_0x8a6d('0x1d')],function(_0x176ab8){return{'model':db[_0x176ab8['model']],'as':_0x176ab8['as'],'attributes':_0x176ab8[_0x8a6d('0x1f')],'include':_0x176ab8[_0x8a6d('0x1d')]?_['map'](_0x176ab8[_0x8a6d('0x1d')],function(_0x3900f5){return{'model':db[_0x3900f5['model']],'as':_0x3900f5['as'],'attributes':_0x3900f5[_0x8a6d('0x1f')],'include':_0x3900f5[_0x8a6d('0x1d')]?_[_0x8a6d('0x1e')](_0x3900f5[_0x8a6d('0x1d')],function(_0x126762){return{'model':db[_0x126762[_0x8a6d('0x20')]],'as':_0x126762['as'],'attributes':_0x126762[_0x8a6d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8a6d('0xb')](function(_0x12aa33){logger['info'](_0x8a6d('0x17'),_0x3aac2e);logger[_0x8a6d('0xe')]('GetVoiceCallReport',_0x3aac2e,JSON['stringify'](_0x12aa33));_0x3a9831(_0x12aa33);})[_0x8a6d('0x16')](function(_0x286d18){logger[_0x8a6d('0x12')]('GetVoiceCallReport',_0x286d18[_0x8a6d('0x14')],_0x3aac2e);_0x33dbde(_0x5f3c16[_0x8a6d('0x12')](0x1f4,_0x286d18[_0x8a6d('0x14')]));});});};exports[_0x8a6d('0x21')]=function(_0x4ccf3c){var _0x494623=this;return new Promise(function(_0x3b94be,_0x5e7a5a){return db[_0x8a6d('0x18')]['create'](_0x4ccf3c[_0x8a6d('0x22')],{'raw':_0x4ccf3c[_0x8a6d('0x19')]?_0x4ccf3c[_0x8a6d('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8a6d('0xb')](function(_0x1f7890){logger[_0x8a6d('0xc')](_0x8a6d('0x21'),_0x4ccf3c);logger[_0x8a6d('0xe')](_0x8a6d('0x21'),_0x4ccf3c,JSON[_0x8a6d('0x11')](_0x1f7890));_0x3b94be(_0x1f7890);})[_0x8a6d('0x16')](function(_0x4c6808){logger['error']('CreateVoiceCallReport',_0x4c6808[_0x8a6d('0x14')],_0x4ccf3c);_0x5e7a5a(_0x494623[_0x8a6d('0x12')](0x1f4,_0x4c6808['message']));});});};exports['UpdateVoiceCallReport']=function(_0x22e816){var _0x1b8ba4=this;return new Promise(function(_0x40ba1a,_0x5383bf){return db[_0x8a6d('0x18')][_0x8a6d('0x23')](_0x22e816[_0x8a6d('0x22')],{'raw':_0x22e816['options']?_0x22e816[_0x8a6d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22e816['options']?_0x22e816[_0x8a6d('0x19')]['where']||null:null,'attributes':_0x22e816[_0x8a6d('0x19')]?_0x22e816[_0x8a6d('0x19')][_0x8a6d('0x1f')]||null:null,'limit':_0x22e816[_0x8a6d('0x19')]?_0x22e816[_0x8a6d('0x19')][_0x8a6d('0x1c')]||null:null})[_0x8a6d('0xb')](function(_0x4358c8){logger[_0x8a6d('0xc')](_0x8a6d('0x24'),_0x22e816);logger[_0x8a6d('0xe')](_0x8a6d('0x24'),_0x22e816,JSON[_0x8a6d('0x11')](_0x4358c8));_0x40ba1a(_0x4358c8);})['catch'](function(_0x27aa9b){logger[_0x8a6d('0x12')](_0x8a6d('0x24'),_0x27aa9b[_0x8a6d('0x14')],_0x22e816);_0x5383bf(_0x1b8ba4[_0x8a6d('0x12')](0x1f4,_0x27aa9b[_0x8a6d('0x14')]));});});}; \ No newline at end of file +var _0xd09d=['limit','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','include','map','model','attributes','info','CreateVoiceCallReport','create','update','body'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xd09d,0x1e2));var _0xdd09=function(_0x4b08b7,_0x3e055f){_0x4b08b7=_0x4b08b7-0x0;var _0x5e94b0=_0xd09d[_0x4b08b7];return _0x5e94b0;};'use strict';var _=require(_0xdd09('0x0'));var util=require(_0xdd09('0x1'));var moment=require(_0xdd09('0x2'));var BPromise=require(_0xdd09('0x3'));var rs=require(_0xdd09('0x4'));var fs=require('fs');var Redis=require(_0xdd09('0x5'));var db=require(_0xdd09('0x6'))['db'];var utils=require(_0xdd09('0x7'));var logger=require(_0xdd09('0x8'))(_0xdd09('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdd09('0xa')][_0xdd09('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x226b64,_0x4ce22b,_0x278eaa){return new BPromise(function(_0x2c3916,_0x4d00da){return client[_0xdd09('0xc')](_0x226b64,_0x278eaa)[_0xdd09('0xd')](function(_0x16ee83){logger['info'](_0xdd09('0xe'),_0x4ce22b,_0xdd09('0xf'));logger[_0xdd09('0x10')](_0xdd09('0x11'),_0x4ce22b,'request\x20sent',JSON[_0xdd09('0x12')](_0x16ee83));if(_0x16ee83[_0xdd09('0x13')]){if(_0x16ee83[_0xdd09('0x13')][_0xdd09('0x14')]===0x1f4){logger['error'](_0xdd09('0xe'),_0x4ce22b,_0x16ee83['error'][_0xdd09('0x15')]);return _0x4d00da(_0x16ee83[_0xdd09('0x13')][_0xdd09('0x15')]);}logger[_0xdd09('0x13')](_0xdd09('0xe'),_0x4ce22b,_0x16ee83[_0xdd09('0x13')][_0xdd09('0x15')]);return _0x2c3916(_0x16ee83[_0xdd09('0x13')][_0xdd09('0x15')]);}else{logger['info'](_0xdd09('0xe'),_0x4ce22b,_0xdd09('0xf'));_0x2c3916(_0x16ee83[_0xdd09('0x16')]['message']);}})[_0xdd09('0x17')](function(_0x5bf586){logger['error'](_0xdd09('0xe'),_0x4ce22b,_0x5bf586);_0x4d00da(_0x5bf586);});});}exports[_0xdd09('0x18')]=function(_0x37251f){var _0x21350b=this;return new Promise(function(_0x42c4c3,_0x3cccfc){return db[_0xdd09('0x19')]['findAll']({'raw':_0x37251f['options']?_0x37251f[_0xdd09('0x1a')][_0xdd09('0x1b')]===undefined?!![]:![]:!![],'where':_0x37251f[_0xdd09('0x1a')]?_0x37251f[_0xdd09('0x1a')][_0xdd09('0x1c')]||null:null,'attributes':_0x37251f['options']?_0x37251f[_0xdd09('0x1a')]['attributes']||null:null,'limit':_0x37251f[_0xdd09('0x1a')]?_0x37251f[_0xdd09('0x1a')]['limit']||null:null,'include':_0x37251f[_0xdd09('0x1a')]?_0x37251f[_0xdd09('0x1a')][_0xdd09('0x1d')]?_[_0xdd09('0x1e')](_0x37251f[_0xdd09('0x1a')][_0xdd09('0x1d')],function(_0x9968c7){return{'model':db[_0x9968c7[_0xdd09('0x1f')]],'as':_0x9968c7['as'],'attributes':_0x9968c7['attributes'],'include':_0x9968c7[_0xdd09('0x1d')]?_[_0xdd09('0x1e')](_0x9968c7[_0xdd09('0x1d')],function(_0x4dc533){return{'model':db[_0x4dc533[_0xdd09('0x1f')]],'as':_0x4dc533['as'],'attributes':_0x4dc533['attributes'],'include':_0x4dc533[_0xdd09('0x1d')]?_[_0xdd09('0x1e')](_0x4dc533[_0xdd09('0x1d')],function(_0x5f24ca){return{'model':db[_0x5f24ca[_0xdd09('0x1f')]],'as':_0x5f24ca['as'],'attributes':_0x5f24ca[_0xdd09('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdd09('0xd')](function(_0x1bf4d5){logger[_0xdd09('0x21')](_0xdd09('0x18'),_0x37251f);logger[_0xdd09('0x10')](_0xdd09('0x18'),_0x37251f,JSON[_0xdd09('0x12')](_0x1bf4d5));_0x42c4c3(_0x1bf4d5);})[_0xdd09('0x17')](function(_0x5df7db){logger['error'](_0xdd09('0x18'),_0x5df7db[_0xdd09('0x15')],_0x37251f);_0x3cccfc(_0x21350b[_0xdd09('0x13')](0x1f4,_0x5df7db[_0xdd09('0x15')]));});});};exports[_0xdd09('0x22')]=function(_0x2180a8){var _0x5298ed=this;return new Promise(function(_0x292e2e,_0x4d9c20){return db['VoiceCallReport'][_0xdd09('0x23')](_0x2180a8['body'],{'raw':_0x2180a8[_0xdd09('0x1a')]?_0x2180a8[_0xdd09('0x1a')][_0xdd09('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x450957){logger[_0xdd09('0x21')]('CreateVoiceCallReport',_0x2180a8);logger['debug'](_0xdd09('0x22'),_0x2180a8,JSON[_0xdd09('0x12')](_0x450957));_0x292e2e(_0x450957);})[_0xdd09('0x17')](function(_0x6bac44){logger[_0xdd09('0x13')](_0xdd09('0x22'),_0x6bac44[_0xdd09('0x15')],_0x2180a8);_0x4d9c20(_0x5298ed[_0xdd09('0x13')](0x1f4,_0x6bac44[_0xdd09('0x15')]));});});};exports['UpdateVoiceCallReport']=function(_0x42e768){var _0x23a20b=this;return new Promise(function(_0x232765,_0x315faa){return db[_0xdd09('0x19')][_0xdd09('0x24')](_0x42e768[_0xdd09('0x25')],{'raw':_0x42e768['options']?_0x42e768['options'][_0xdd09('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42e768['options']?_0x42e768['options']['where']||null:null,'attributes':_0x42e768[_0xdd09('0x1a')]?_0x42e768[_0xdd09('0x1a')][_0xdd09('0x20')]||null:null,'limit':_0x42e768['options']?_0x42e768[_0xdd09('0x1a')][_0xdd09('0x26')]||null:null})[_0xdd09('0xd')](function(_0x28e442){logger[_0xdd09('0x21')](_0xdd09('0x27'),_0x42e768);logger[_0xdd09('0x10')](_0xdd09('0x27'),_0x42e768,JSON[_0xdd09('0x12')](_0x28e442));_0x232765(_0x28e442);})[_0xdd09('0x17')](function(_0x4e222c){logger[_0xdd09('0x13')](_0xdd09('0x27'),_0x4e222c['message'],_0x42e768);_0x315faa(_0x23a20b[_0xdd09('0x13')](0x1f4,_0x4e222c[_0xdd09('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index e834aa6..c15057b 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 _0xd6b5=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','update','multer','util','path'];(function(_0x4f4c72,_0x305e51){var _0x189057=function(_0x4c3ca3){while(--_0x4c3ca3){_0x4f4c72['push'](_0x4f4c72['shift']());}};_0x189057(++_0x305e51);}(_0xd6b5,0xde));var _0x5d6b=function(_0x389779,_0x514c0f){_0x389779=_0x389779-0x0;var _0x4d2c84=_0xd6b5[_0x389779];return _0x4d2c84;};'use strict';var multer=require(_0x5d6b('0x0'));var util=require(_0x5d6b('0x1'));var path=require(_0x5d6b('0x2'));var timeout=require(_0x5d6b('0x3'));var express=require(_0x5d6b('0x4'));var router=express['Router']();var fs_extra=require(_0x5d6b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5d6b('0x6'));var config=require(_0x5d6b('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x5d6b('0x8')]('/',auth[_0x5d6b('0x9')](),controller[_0x5d6b('0xa')]);router[_0x5d6b('0x8')]('/:id',auth[_0x5d6b('0x9')](),controller[_0x5d6b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5d6b('0xc')]);router[_0x5d6b('0xd')]('/:id',auth[_0x5d6b('0x9')](),controller[_0x5d6b('0xe')]);router['delete']('/:id',auth[_0x5d6b('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4c4b=['Router','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x113b76,_0x48e48c){var _0x2f811e=function(_0x129a63){while(--_0x129a63){_0x113b76['push'](_0x113b76['shift']());}};_0x2f811e(++_0x48e48c);}(_0x4c4b,0x163));var _0xb4c4=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x4c4b[_0x44c768];return _0x55daf5;};'use strict';var multer=require(_0xb4c4('0x0'));var util=require(_0xb4c4('0x1'));var path=require(_0xb4c4('0x2'));var timeout=require(_0xb4c4('0x3'));var express=require(_0xb4c4('0x4'));var router=express[_0xb4c4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb4c4('0x6'));var config=require(_0xb4c4('0x7'));var controller=require(_0xb4c4('0x8'));router[_0xb4c4('0x9')]('/',auth[_0xb4c4('0xa')](),controller[_0xb4c4('0xb')]);router['get']('/:id',auth[_0xb4c4('0xa')](),controller[_0xb4c4('0xc')]);router[_0xb4c4('0xd')]('/',auth[_0xb4c4('0xa')](),controller[_0xb4c4('0xe')]);router[_0xb4c4('0xf')](_0xb4c4('0x10'),auth['isAuthenticated'](),controller[_0xb4c4('0x11')]);router['delete'](_0xb4c4('0x10'),auth[_0xb4c4('0xa')](),controller[_0xb4c4('0x12')]);module[_0xb4c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 6be8a4f..1ce206f 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 _0xa5a6=['BOOLEAN','sequelize','STRING','name','setDataValue','options','getDataValue','split'];(function(_0x43cf6c,_0x41371a){var _0xf887df=function(_0x2f3eb4){while(--_0x2f3eb4){_0x43cf6c['push'](_0x43cf6c['shift']());}};_0xf887df(++_0x41371a);}(_0xa5a6,0x1e9));var _0x6a5a=function(_0x281305,_0x2998d6){_0x281305=_0x281305-0x0;var _0x56ffbe=_0xa5a6[_0x281305];return _0x56ffbe;};'use strict';var Sequelize=require(_0x6a5a('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a5a('0x1')]},'prefix':{'type':Sequelize[_0x6a5a('0x1')],'unique':_0x6a5a('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x6a5a('0x1')],'set':function(_0xf64503){this[_0x6a5a('0x3')](_0x6a5a('0x4'),_0xf64503?_0xf64503['join'](''):[]);},'get':function(){return this[_0x6a5a('0x5')](_0x6a5a('0x4'))?this[_0x6a5a('0x5')](_0x6a5a('0x4'))[_0x6a5a('0x6')](''):[];}},'auth':{'type':Sequelize[_0x6a5a('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x6a5a('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6a5a('0x1')]},'description':{'type':Sequelize[_0x6a5a('0x1')]}}; \ No newline at end of file +var _0x71ce=['name','options','join','getDataValue','split','STRING'];(function(_0x57fa1a,_0x12814c){var _0x1a1a84=function(_0x5d74c6){while(--_0x5d74c6){_0x57fa1a['push'](_0x57fa1a['shift']());}};_0x1a1a84(++_0x12814c);}(_0x71ce,0xf5));var _0xe71c=function(_0x4bc726,_0x70788){_0x4bc726=_0x4bc726-0x0;var _0x43f891=_0x71ce[_0x4bc726];return _0x43f891;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe71c('0x0')]},'prefix':{'type':Sequelize[_0xe71c('0x0')],'unique':_0xe71c('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xe71c('0x0')],'set':function(_0x2ee643){this['setDataValue'](_0xe71c('0x2'),_0x2ee643?_0x2ee643[_0xe71c('0x3')](''):[]);},'get':function(){return this[_0xe71c('0x4')](_0xe71c('0x2'))?this['getDataValue'](_0xe71c('0x2'))[_0xe71c('0x5')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xe71c('0x0')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe71c('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index dc82d12..d84ffc6 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 _0x24a6=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include','rows','catch','show','params','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','find','userProfileId','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','sox','to-csv','ejs','fs-extra'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x24a6,0x14f));var _0x624a=function(_0x18a43d,_0x21aec5){_0x18a43d=_0x18a43d-0x0;var _0x5a7d58=_0x24a6[_0x18a43d];return _0x5a7d58;};'use strict';var emlformat=require(_0x624a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x624a('0x1'));var jsonpatch=require(_0x624a('0x2'));var rp=require(_0x624a('0x3'));var moment=require(_0x624a('0x4'));var BPromise=require(_0x624a('0x5'));var Mustache=require(_0x624a('0x6'));var util=require(_0x624a('0x7'));var path=require(_0x624a('0x8'));var sox=require(_0x624a('0x9'));var csv=require(_0x624a('0xa'));var ejs=require(_0x624a('0xb'));var fs=require('fs');var fs_extra=require(_0x624a('0xc'));var _=require(_0x624a('0xd'));var squel=require(_0x624a('0xe'));var crypto=require(_0x624a('0xf'));var jsforce=require(_0x624a('0x10'));var deskjs=require(_0x624a('0x11'));var toCsv=require(_0x624a('0xa'));var querystring=require(_0x624a('0x12'));var Papa=require(_0x624a('0x13'));var Redis=require(_0x624a('0x14'));var authService=require(_0x624a('0x15'));var qs=require(_0x624a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x624a('0x17'))(_0x624a('0x18'));var utils=require(_0x624a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x624a('0x1a'));var db=require(_0x624a('0x1b'))['db'];function respondWithStatusCode(_0x5f0954,_0x50d1aa){_0x50d1aa=_0x50d1aa||0xcc;return function(_0x5406ce){if(_0x5406ce){return _0x5f0954[_0x624a('0x1c')](_0x50d1aa);}return _0x5f0954['status'](_0x50d1aa)[_0x624a('0x1d')]();};}function respondWithResult(_0x89e2fd,_0xe310b4){_0xe310b4=_0xe310b4||0xc8;return function(_0x1e6ffd){if(_0x1e6ffd){return _0x89e2fd['status'](_0xe310b4)[_0x624a('0x1e')](_0x1e6ffd);}};}function respondWithFilteredResult(_0x4935f4,_0x424200){return function(_0x195bfc){if(_0x195bfc){var _0x53005e=typeof _0x424200[_0x624a('0x1f')]===_0x624a('0x20')&&typeof _0x424200[_0x624a('0x21')]===_0x624a('0x20');var _0xce9cd5=_0x195bfc[_0x624a('0x22')];var _0x364867=_0x53005e?0x0:_0x424200[_0x624a('0x1f')];var _0x35342c=_0x53005e?_0x195bfc[_0x624a('0x22')]:_0x424200['offset']+_0x424200[_0x624a('0x21')];var _0x5c6901;if(_0x35342c>=_0xce9cd5){_0x35342c=_0xce9cd5;_0x5c6901=0xc8;}else{_0x5c6901=0xce;}_0x4935f4[_0x624a('0x23')](_0x5c6901);return _0x4935f4['set'](_0x624a('0x24'),_0x364867+'-'+_0x35342c+'/'+_0xce9cd5)[_0x624a('0x1e')](_0x195bfc);}return null;};}function patchUpdates(_0x415af0){return function(_0x200fdc){try{jsonpatch[_0x624a('0x25')](_0x200fdc,_0x415af0,!![]);}catch(_0x54e669){return BPromise[_0x624a('0x26')](_0x54e669);}return _0x200fdc[_0x624a('0x27')]();};}function saveUpdates(_0x156d32,_0x22beca){return function(_0x5dfeec){if(_0x5dfeec){return _0x5dfeec[_0x624a('0x28')](_0x156d32)[_0x624a('0x29')](function(_0x264349){return _0x264349;});}return null;};}function removeEntity(_0x4ba881,_0x4aee03){return function(_0x56834b){if(_0x56834b){return _0x56834b[_0x624a('0x2a')]()[_0x624a('0x29')](function(){var _0x31279d=_0x56834b[_0x624a('0x2b')]({'plain':!![]});var _0x51a817='ChanSpies';return db[_0x624a('0x2c')][_0x624a('0x2a')]({'where':{'type':_0x51a817,'resourceId':_0x31279d['id']}})['then'](function(){return _0x56834b;});})[_0x624a('0x29')](function(){_0x4ba881[_0x624a('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5366c4,_0x585126){return function(_0x41993c){if(!_0x41993c){_0x5366c4[_0x624a('0x1c')](0x194);}return _0x41993c;};}function handleError(_0x49ae13,_0x57d2d5){_0x57d2d5=_0x57d2d5||0x1f4;return function(_0x59917f){logger[_0x624a('0x2d')](_0x59917f[_0x624a('0x2e')]);if(_0x59917f[_0x624a('0x2f')]){delete _0x59917f['name'];}_0x49ae13[_0x624a('0x23')](_0x57d2d5)[_0x624a('0x30')](_0x59917f);};}exports['index']=function(_0x466af4,_0x59df8f){var _0x209ca5={},_0x1e775b={},_0x22140a={'count':0x0,'rows':[]};var _0x4619a8=_['map'](db[_0x624a('0x31')][_0x624a('0x32')],function(_0x5e8983){return{'name':_0x5e8983[_0x624a('0x33')],'type':_0x5e8983[_0x624a('0x34')][_0x624a('0x35')]};});_0x1e775b[_0x624a('0x36')]=_[_0x624a('0x37')](_0x4619a8,_0x624a('0x2f'));_0x1e775b['query']=_['keys'](_0x466af4[_0x624a('0x38')]);_0x1e775b[_0x624a('0x39')]=_[_0x624a('0x3a')](_0x1e775b['model'],_0x1e775b[_0x624a('0x38')]);_0x209ca5['attributes']=_['intersection'](_0x1e775b['model'],qs[_0x624a('0x3b')](_0x466af4['query'][_0x624a('0x3b')]));_0x209ca5['attributes']=_0x209ca5[_0x624a('0x3c')]['length']?_0x209ca5['attributes']:_0x1e775b[_0x624a('0x36')];if(!_0x466af4[_0x624a('0x38')][_0x624a('0x3d')](_0x624a('0x3e'))){_0x209ca5[_0x624a('0x21')]=qs[_0x624a('0x21')](_0x466af4[_0x624a('0x38')][_0x624a('0x21')]);_0x209ca5[_0x624a('0x1f')]=qs[_0x624a('0x1f')](_0x466af4['query'][_0x624a('0x1f')]);}_0x209ca5[_0x624a('0x3f')]=qs[_0x624a('0x40')](_0x466af4[_0x624a('0x38')][_0x624a('0x40')]);_0x209ca5['where']=qs[_0x624a('0x39')](_[_0x624a('0x41')](_0x466af4[_0x624a('0x38')],_0x1e775b[_0x624a('0x39')]),_0x4619a8);if(_0x466af4[_0x624a('0x38')][_0x624a('0x42')]){_0x209ca5['where']=_[_0x624a('0x43')](_0x209ca5[_0x624a('0x44')],{'$or':_[_0x624a('0x37')](_0x4619a8,function(_0x51d189){if(_0x51d189[_0x624a('0x34')]!=='VIRTUAL'){var _0x49db9c={};_0x49db9c[_0x51d189[_0x624a('0x2f')]]={'$like':'%'+_0x466af4[_0x624a('0x38')][_0x624a('0x42')]+'%'};return _0x49db9c;}})});}_0x209ca5=_['merge']({},_0x209ca5,_0x466af4['options']);var _0x142eb3={'where':_0x209ca5[_0x624a('0x44')]};return db['VoiceChanSpy'][_0x624a('0x22')](_0x142eb3)[_0x624a('0x29')](function(_0x574651){_0x22140a[_0x624a('0x22')]=_0x574651;if(_0x466af4[_0x624a('0x38')][_0x624a('0x45')]){_0x209ca5[_0x624a('0x46')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x209ca5);})['then'](function(_0x23168b){_0x22140a[_0x624a('0x47')]=_0x23168b;return _0x22140a;})[_0x624a('0x29')](respondWithFilteredResult(_0x59df8f,_0x209ca5))[_0x624a('0x48')](handleError(_0x59df8f,null));};exports[_0x624a('0x49')]=function(_0x241883,_0x28a512){var _0x5f28aa={'raw':![],'where':{'id':_0x241883[_0x624a('0x4a')]['id']}},_0x2193fb={};_0x2193fb['model']=_['keys'](db[_0x624a('0x31')]['rawAttributes']);_0x2193fb[_0x624a('0x38')]=_[_0x624a('0x4b')](_0x241883[_0x624a('0x38')]);_0x2193fb['filters']=_[_0x624a('0x3a')](_0x2193fb[_0x624a('0x36')],_0x2193fb[_0x624a('0x38')]);_0x5f28aa[_0x624a('0x3c')]=_[_0x624a('0x3a')](_0x2193fb['model'],qs[_0x624a('0x3b')](_0x241883[_0x624a('0x38')][_0x624a('0x3b')]));_0x5f28aa['attributes']=_0x5f28aa[_0x624a('0x3c')][_0x624a('0x4c')]?_0x5f28aa[_0x624a('0x3c')]:_0x2193fb[_0x624a('0x36')];if(_0x241883[_0x624a('0x38')][_0x624a('0x45')]){_0x5f28aa['include']=[{'all':!![]}];}_0x5f28aa=_[_0x624a('0x43')]({},_0x5f28aa,_0x241883['options']);return db['VoiceChanSpy']['find'](_0x5f28aa)[_0x624a('0x29')](handleEntityNotFound(_0x28a512,null))[_0x624a('0x29')](respondWithResult(_0x28a512,null))[_0x624a('0x48')](handleError(_0x28a512,null));};exports[_0x624a('0x4d')]=function(_0x5312ec,_0x18c318){return db[_0x624a('0x31')][_0x624a('0x4d')](_0x5312ec['body'],{})['then'](function(_0x12d767){var _0x22a46d=_0x5312ec[_0x624a('0x4e')][_0x624a('0x2b')]({'plain':!![]});if(!_0x22a46d)throw new Error(_0x624a('0x4f'));if(_0x22a46d[_0x624a('0x50')]==='user'){var _0x351dc9=_0x12d767[_0x624a('0x2b')]({'plain':!![]});var _0x4ca80b=_0x624a('0x51');return db[_0x624a('0x52')][_0x624a('0x53')]({'where':{'name':_0x4ca80b,'userProfileId':_0x22a46d[_0x624a('0x54')]},'raw':!![]})[_0x624a('0x29')](function(_0x12bc21){if(_0x12bc21&&_0x12bc21['autoAssociation']===0x0){return db[_0x624a('0x2c')][_0x624a('0x4d')]({'name':_0x351dc9['name'],'resourceId':_0x351dc9['id'],'type':_0x12bc21[_0x624a('0x2f')],'sectionId':_0x12bc21['id']},{})[_0x624a('0x29')](function(){return _0x12d767;});}else{return _0x12d767;}})[_0x624a('0x48')](function(_0x52fc4e){logger[_0x624a('0x2d')](_0x624a('0x55'),_0x52fc4e);throw _0x52fc4e;});}return _0x12d767;})[_0x624a('0x29')](respondWithResult(_0x18c318,0xc9))['catch'](handleError(_0x18c318,null));};exports['update']=function(_0x590c83,_0x38429f){if(_0x590c83[_0x624a('0x56')]['id']){delete _0x590c83[_0x624a('0x56')]['id'];}return db[_0x624a('0x31')][_0x624a('0x53')]({'where':{'id':_0x590c83['params']['id']}})[_0x624a('0x29')](handleEntityNotFound(_0x38429f,null))[_0x624a('0x29')](saveUpdates(_0x590c83[_0x624a('0x56')],null))[_0x624a('0x29')](respondWithResult(_0x38429f,null))['catch'](handleError(_0x38429f,null));};exports['destroy']=function(_0x4e610,_0x33ccf1){return db['VoiceChanSpy']['find']({'where':{'id':_0x4e610[_0x624a('0x4a')]['id']}})[_0x624a('0x29')](handleEntityNotFound(_0x33ccf1,null))[_0x624a('0x29')](removeEntity(_0x33ccf1,null))['catch'](handleError(_0x33ccf1,null));}; \ No newline at end of file +var _0x6324=['path','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','map','VoiceChanSpy','fieldName','type','keys','query','filters','intersection','model','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','fields','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x6324,0x142));var _0x4632=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x6324[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){var _0x3b0823=_0x1e1b86[_0x4632('0x28')]({'plain':!![]});var _0xb074d=_0x4632('0x29');return db[_0x4632('0x2a')][_0x4632('0x27')]({'where':{'type':_0xb074d,'resourceId':_0x3b0823['id']}})[_0x4632('0x26')](function(){return _0x1e1b86;});})[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0x438354,_0x4d9098){return function(_0x57798a){if(!_0x57798a){_0x438354[_0x4632('0x18')](0x194);}return _0x57798a;};}function handleError(_0x244743,_0x2f6656){_0x2f6656=_0x2f6656||0x1f4;return function(_0x35a533){logger[_0x4632('0x2b')](_0x35a533[_0x4632('0x2c')]);if(_0x35a533[_0x4632('0x2d')]){delete _0x35a533['name'];}_0x244743[_0x4632('0x19')](_0x2f6656)[_0x4632('0x2e')](_0x35a533);};}exports['index']=function(_0x216119,_0x5316f7){var _0x6599ad={},_0x4cb661={},_0x4fda35={'count':0x0,'rows':[]};var _0x1973eb=_[_0x4632('0x2f')](db[_0x4632('0x30')]['rawAttributes'],function(_0x5ed4d6){return{'name':_0x5ed4d6[_0x4632('0x31')],'type':_0x5ed4d6[_0x4632('0x32')]['key']};});_0x4cb661['model']=_[_0x4632('0x2f')](_0x1973eb,_0x4632('0x2d'));_0x4cb661['query']=_[_0x4632('0x33')](_0x216119[_0x4632('0x34')]);_0x4cb661[_0x4632('0x35')]=_[_0x4632('0x36')](_0x4cb661[_0x4632('0x37')],_0x4cb661['query']);_0x6599ad[_0x4632('0x38')]=_[_0x4632('0x36')](_0x4cb661['model'],qs['fields'](_0x216119[_0x4632('0x34')]['fields']));_0x6599ad['attributes']=_0x6599ad[_0x4632('0x38')]['length']?_0x6599ad[_0x4632('0x38')]:_0x4cb661[_0x4632('0x37')];if(!_0x216119[_0x4632('0x34')]['hasOwnProperty'](_0x4632('0x39'))){_0x6599ad[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x216119[_0x4632('0x34')][_0x4632('0x1e')]);_0x6599ad['offset']=qs['offset'](_0x216119[_0x4632('0x34')][_0x4632('0x1c')]);}_0x6599ad[_0x4632('0x3a')]=qs['sort'](_0x216119['query']['sort']);_0x6599ad[_0x4632('0x3b')]=qs[_0x4632('0x35')](_['pick'](_0x216119[_0x4632('0x34')],_0x4cb661[_0x4632('0x35')]),_0x1973eb);if(_0x216119[_0x4632('0x34')][_0x4632('0x3c')]){_0x6599ad[_0x4632('0x3b')]=_[_0x4632('0x3d')](_0x6599ad[_0x4632('0x3b')],{'$or':_[_0x4632('0x2f')](_0x1973eb,function(_0x21c6a5){if(_0x21c6a5[_0x4632('0x32')]!==_0x4632('0x3e')){var _0x3b6258={};_0x3b6258[_0x21c6a5['name']]={'$like':'%'+_0x216119[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x3b6258;}})});}_0x6599ad=_['merge']({},_0x6599ad,_0x216119[_0x4632('0x3f')]);var _0x1c39bc={'where':_0x6599ad['where']};return db[_0x4632('0x30')]['count'](_0x1c39bc)[_0x4632('0x26')](function(_0x28df3b){_0x4fda35[_0x4632('0x1f')]=_0x28df3b;if(_0x216119[_0x4632('0x34')]['includeAll']){_0x6599ad[_0x4632('0x40')]=[{'all':!![]}];}return db[_0x4632('0x30')][_0x4632('0x41')](_0x6599ad);})[_0x4632('0x26')](function(_0x5cc716){_0x4fda35['rows']=_0x5cc716;return _0x4fda35;})[_0x4632('0x26')](respondWithFilteredResult(_0x5316f7,_0x6599ad))[_0x4632('0x42')](handleError(_0x5316f7,null));};exports[_0x4632('0x43')]=function(_0x512db1,_0x330f21){var _0x1467c8={'raw':![],'where':{'id':_0x512db1[_0x4632('0x44')]['id']}},_0x66598d={};_0x66598d[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x30')]['rawAttributes']);_0x66598d[_0x4632('0x34')]=_[_0x4632('0x33')](_0x512db1[_0x4632('0x34')]);_0x66598d[_0x4632('0x35')]=_[_0x4632('0x36')](_0x66598d['model'],_0x66598d['query']);_0x1467c8[_0x4632('0x38')]=_[_0x4632('0x36')](_0x66598d[_0x4632('0x37')],qs[_0x4632('0x45')](_0x512db1['query'][_0x4632('0x45')]));_0x1467c8[_0x4632('0x38')]=_0x1467c8[_0x4632('0x38')][_0x4632('0x46')]?_0x1467c8[_0x4632('0x38')]:_0x66598d['model'];if(_0x512db1[_0x4632('0x34')][_0x4632('0x47')]){_0x1467c8[_0x4632('0x40')]=[{'all':!![]}];}_0x1467c8=_[_0x4632('0x3d')]({},_0x1467c8,_0x512db1[_0x4632('0x3f')]);return db[_0x4632('0x30')][_0x4632('0x48')](_0x1467c8)[_0x4632('0x26')](handleEntityNotFound(_0x330f21,null))[_0x4632('0x26')](respondWithResult(_0x330f21,null))[_0x4632('0x42')](handleError(_0x330f21,null));};exports[_0x4632('0x49')]=function(_0x517584,_0xc3ffd0){return db[_0x4632('0x30')][_0x4632('0x49')](_0x517584['body'],{})[_0x4632('0x26')](function(_0x5f4fb5){var _0x1309aa=_0x517584[_0x4632('0x4a')][_0x4632('0x28')]({'plain':!![]});if(!_0x1309aa)throw new Error(_0x4632('0x4b'));if(_0x1309aa[_0x4632('0x4c')]===_0x4632('0x4a')){var _0x1f43b6=_0x5f4fb5[_0x4632('0x28')]({'plain':!![]});var _0x4e89e3=_0x4632('0x29');return db[_0x4632('0x4d')]['find']({'where':{'name':_0x4e89e3,'userProfileId':_0x1309aa[_0x4632('0x4e')]},'raw':!![]})[_0x4632('0x26')](function(_0x18cc47){if(_0x18cc47&&_0x18cc47[_0x4632('0x4f')]===0x0){return db[_0x4632('0x2a')][_0x4632('0x49')]({'name':_0x1f43b6[_0x4632('0x2d')],'resourceId':_0x1f43b6['id'],'type':_0x18cc47[_0x4632('0x2d')],'sectionId':_0x18cc47['id']},{})[_0x4632('0x26')](function(){return _0x5f4fb5;});}else{return _0x5f4fb5;}})[_0x4632('0x42')](function(_0x3e66d8){logger[_0x4632('0x2b')](_0x4632('0x50'),_0x3e66d8);throw _0x3e66d8;});}return _0x5f4fb5;})[_0x4632('0x26')](respondWithResult(_0xc3ffd0,0xc9))[_0x4632('0x42')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x25')]=function(_0x32cd35,_0x6c2864){if(_0x32cd35[_0x4632('0x51')]['id']){delete _0x32cd35[_0x4632('0x51')]['id'];}return db['VoiceChanSpy'][_0x4632('0x48')]({'where':{'id':_0x32cd35[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x6c2864,null))[_0x4632('0x26')](saveUpdates(_0x32cd35[_0x4632('0x51')],null))[_0x4632('0x26')](respondWithResult(_0x6c2864,null))['catch'](handleError(_0x6c2864,null));};exports[_0x4632('0x27')]=function(_0x433fea,_0x41409d){return db['VoiceChanSpy'][_0x4632('0x48')]({'where':{'id':_0x433fea[_0x4632('0x44')]['id']}})['then'](handleEntityNotFound(_0x41409d,null))[_0x4632('0x26')](removeEntity(_0x41409d,null))[_0x4632('0x42')](handleError(_0x41409d,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 988fe4c..8efd953 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 _0x2486=['push','Set','CDR(type)=%s','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','concat','User','findAll','internal','agent','then','catch','exports','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system'];(function(_0x39d038,_0x356122){var _0x11c3db=function(_0x468ea5){while(--_0x468ea5){_0x39d038['push'](_0x39d038['shift']());}};_0x11c3db(++_0x356122);}(_0x2486,0x16a));var _0x6248=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2486[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6248('0x0'));var BPromise=require(_0x6248('0x1'));var attributes=require(_0x6248('0x2'));var getUserApplications=function(_0x9307b1,_0x194105,_0x4f4f68){var _0x4c096e=0x1;var _0x567912=[];var _0x577e43={'context':_0x194105[_0x6248('0x3')]||'from-sip','exten':util[_0x6248('0x4')](_0x6248('0x5'),_0x9307b1[_0x6248('0x6')],_0x4f4f68),'type':_0x6248('0x7'),'isApp':![],'ChanSpyId':_0x9307b1['id'],'UserId':_0x194105['id']};_0x567912[_0x6248('0x8')](_['merge']({'app':_0x6248('0x9'),'appdata':util[_0x6248('0x4')](_0x6248('0xa'),'chanspy'),'priority':_0x4c096e++},_0x577e43));if(_0x9307b1[_0x6248('0xb')]){_0x567912[_0x6248('0x8')](_[_0x6248('0xc')]({'app':_0x6248('0xd'),'appdata':util['format'](_0x6248('0xe'),_0x9307b1[_0x6248('0xf')]),'priority':_0x4c096e++},_0x577e43));}if(_0x9307b1[_0x6248('0x10')]){_0x567912['push'](_['merge']({'app':_0x6248('0x11'),'appdata':_0x9307b1['password'],'priority':_0x4c096e++},_0x577e43));}_0x567912[_0x6248('0x8')](_[_0x6248('0xc')]({'app':_0x6248('0x12'),'appdata':util[_0x6248('0x4')](_0x6248('0x13'),_0x194105[_0x6248('0x14')],_0x9307b1[_0x6248('0x15')]?_0x9307b1[_0x6248('0x15')][_0x6248('0x16')](''):''),'priority':_0x4c096e++},_0x577e43));if(_0x9307b1[_0x6248('0xb')]){_0x567912[_0x6248('0x8')](_[_0x6248('0xc')]({'app':'StopMixMonitor','priority':_0x4c096e++},_0x577e43));}return _0x567912;};var getChanSpyApplications=function(_0x5a405d,_0x478f2e){var _0x5d91ea=[];for(var _0x5923c0=0x0,_0x496871=0x1;_0x5923c0<_0x478f2e['length'];_0x5923c0++,_0x496871=0x1){_0x5d91ea=_0x5d91ea[_0x6248('0x17')](getUserApplications(_0x5a405d,_0x478f2e[_0x5923c0],_0x478f2e[_0x5923c0]['internal']));if(_0x478f2e[_0x5923c0]['internal']!=_0x478f2e[_0x5923c0][_0x6248('0x14')]){_0x5d91ea=_0x5d91ea[_0x6248('0x17')](getUserApplications(_0x5a405d,_0x478f2e[_0x5923c0],_0x478f2e[_0x5923c0][_0x6248('0x14')]));}}return _0x5d91ea;};var getChanSpyPromise=function(_0x2eb868,_0x583add){return new BPromise(function(_0x5b527d,_0x7115cd){return _0x2eb868[_0x6248('0x18')][_0x6248('0x19')]({'attributes':['id',_0x6248('0x14'),_0x6248('0x1a')],'where':{'role':_0x6248('0x1b'),'chanspy':!![]},'raw':!![]})[_0x6248('0x1c')](function(_0x3b750e){if(_0x3b750e){return _0x5b527d(getChanSpyApplications(_0x583add,_0x3b750e));}return _0x5b527d([]);})[_0x6248('0x1d')](function(_0x45ef47){_0x7115cd(_0x45ef47);});});};module[_0x6248('0x1e')]=function(_0x46ad47,_0x375424){var _0x537e36=_0x46ad47['models'];return _0x46ad47['define'](_0x6248('0x1f'),attributes,{'tableName':_0x6248('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1dcb77,_0x4eda63,_0x1f9401){return getChanSpyPromise(_0x537e36,_0x1dcb77)[_0x6248('0x1c')](function(_0x10a05a){if(_0x10a05a&&_0x10a05a[_0x6248('0x21')]){return _0x537e36[_0x6248('0x22')][_0x6248('0x23')](_0x10a05a);}})['then'](function(){_0x1f9401();})[_0x6248('0x1d')](function(_0x1bafa7){_0x1f9401(_0x1bafa7);});},'afterUpdate':function(_0x1aac4f,_0x2efbc9,_0x510675){return _0x537e36[_0x6248('0x22')][_0x6248('0x24')]({'where':{'ChanSpyId':_0x1aac4f['id']}})['then'](function(){return getChanSpyPromise(_0x537e36,_0x1aac4f);})['then'](function(_0x2f70b7){if(_0x2f70b7&&_0x2f70b7['length']){return _0x537e36[_0x6248('0x22')][_0x6248('0x23')](_0x2f70b7);}})[_0x6248('0x1c')](function(){_0x510675();})['catch'](function(_0x29644b){_0x510675(_0x29644b);});},'afterDestroy':function(_0x1a0b08,_0x2def5a,_0x4d4d15){return _0x537e36[_0x6248('0x22')]['destroy']({'where':{'ChanSpyId':_0x1a0b08['id']}})[_0x6248('0x1c')](function(){_0x4d4d15();})[_0x6248('0x1d')](function(_0x31c0f4){_0x4d4d15(_0x31c0f4);});}}});}; \ No newline at end of file +var _0xf334=['VoiceExtension','bulkCreate','catch','destroy','lodash','util','context','from-sip','format','prefix','merge','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','push','ChanSpy','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','exports','models','define','VoiceChanSpy','voice_chanspy','then'];(function(_0x333710,_0x289c72){var _0x343588=function(_0x18cbf8){while(--_0x18cbf8){_0x333710['push'](_0x333710['shift']());}};_0x343588(++_0x289c72);}(_0xf334,0xd0));var _0x4f33=function(_0x4c5140,_0x35270d){_0x4c5140=_0x4c5140-0x0;var _0x5707bb=_0xf334[_0x4c5140];return _0x5707bb;};'use strict';var _=require(_0x4f33('0x0'));var util=require(_0x4f33('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x4692a7,_0x3d022d,_0x4483fe){var _0x4c97a0=0x1;var _0x26b467=[];var _0x10231a={'context':_0x3d022d[_0x4f33('0x2')]||_0x4f33('0x3'),'exten':util[_0x4f33('0x4')]('%s%s',_0x4692a7[_0x4f33('0x5')],_0x4483fe),'type':'system','isApp':![],'ChanSpyId':_0x4692a7['id'],'UserId':_0x3d022d['id']};_0x26b467['push'](_[_0x4f33('0x6')]({'app':'Set','appdata':util[_0x4f33('0x4')]('CDR(type)=%s','chanspy'),'priority':_0x4c97a0++},_0x10231a));if(_0x4692a7[_0x4f33('0x7')]){_0x26b467['push'](_[_0x4f33('0x6')]({'app':_0x4f33('0x8'),'appdata':util['format'](_0x4f33('0x9'),_0x4692a7[_0x4f33('0xa')]),'priority':_0x4c97a0++},_0x10231a));}if(_0x4692a7[_0x4f33('0xb')]){_0x26b467[_0x4f33('0xc')](_[_0x4f33('0x6')]({'app':'Authenticate','appdata':_0x4692a7['password'],'priority':_0x4c97a0++},_0x10231a));}_0x26b467[_0x4f33('0xc')](_['merge']({'app':_0x4f33('0xd'),'appdata':util[_0x4f33('0x4')]('SIP/%s,%s',_0x3d022d[_0x4f33('0xe')],_0x4692a7[_0x4f33('0xf')]?_0x4692a7[_0x4f33('0xf')][_0x4f33('0x10')](''):''),'priority':_0x4c97a0++},_0x10231a));if(_0x4692a7[_0x4f33('0x7')]){_0x26b467['push'](_[_0x4f33('0x6')]({'app':_0x4f33('0x11'),'priority':_0x4c97a0++},_0x10231a));}return _0x26b467;};var getChanSpyApplications=function(_0x3cfbf4,_0x566ef5){var _0x149936=[];for(var _0x573b69=0x0,_0x1ec8d4=0x1;_0x573b69<_0x566ef5[_0x4f33('0x12')];_0x573b69++,_0x1ec8d4=0x1){_0x149936=_0x149936[_0x4f33('0x13')](getUserApplications(_0x3cfbf4,_0x566ef5[_0x573b69],_0x566ef5[_0x573b69]['internal']));if(_0x566ef5[_0x573b69][_0x4f33('0x14')]!=_0x566ef5[_0x573b69][_0x4f33('0xe')]){_0x149936=_0x149936['concat'](getUserApplications(_0x3cfbf4,_0x566ef5[_0x573b69],_0x566ef5[_0x573b69][_0x4f33('0xe')]));}}return _0x149936;};var getChanSpyPromise=function(_0x5ecadf,_0x482022){return new BPromise(function(_0x447231,_0xc48599){return _0x5ecadf[_0x4f33('0x15')][_0x4f33('0x16')]({'attributes':['id',_0x4f33('0xe'),'internal'],'where':{'role':_0x4f33('0x17'),'chanspy':!![]},'raw':!![]})['then'](function(_0x49e2b0){if(_0x49e2b0){return _0x447231(getChanSpyApplications(_0x482022,_0x49e2b0));}return _0x447231([]);})['catch'](function(_0x609d64){_0xc48599(_0x609d64);});});};module[_0x4f33('0x18')]=function(_0x25d7f3,_0x3dfeab){var _0x26ca72=_0x25d7f3[_0x4f33('0x19')];return _0x25d7f3[_0x4f33('0x1a')](_0x4f33('0x1b'),attributes,{'tableName':_0x4f33('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x59a792,_0x18c0cc,_0x2eff48){return getChanSpyPromise(_0x26ca72,_0x59a792)[_0x4f33('0x1d')](function(_0x408474){if(_0x408474&&_0x408474['length']){return _0x26ca72[_0x4f33('0x1e')][_0x4f33('0x1f')](_0x408474);}})[_0x4f33('0x1d')](function(){_0x2eff48();})[_0x4f33('0x20')](function(_0x397a2a){_0x2eff48(_0x397a2a);});},'afterUpdate':function(_0x43bf08,_0x481394,_0x4379ae){return _0x26ca72['VoiceExtension'][_0x4f33('0x21')]({'where':{'ChanSpyId':_0x43bf08['id']}})[_0x4f33('0x1d')](function(){return getChanSpyPromise(_0x26ca72,_0x43bf08);})[_0x4f33('0x1d')](function(_0x525335){if(_0x525335&&_0x525335[_0x4f33('0x12')]){return _0x26ca72[_0x4f33('0x1e')][_0x4f33('0x1f')](_0x525335);}})[_0x4f33('0x1d')](function(){_0x4379ae();})['catch'](function(_0x1e8ee8){_0x4379ae(_0x1e8ee8);});},'afterDestroy':function(_0x1baeab,_0x5704f8,_0x5d0ddd){return _0x26ca72[_0x4f33('0x1e')][_0x4f33('0x21')]({'where':{'ChanSpyId':_0x1baeab['id']}})['then'](function(){_0x5d0ddd();})[_0x4f33('0x20')](function(_0x49f0ee){_0x5d0ddd(_0x49f0ee);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 67ed50b..93f9c98 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 _0xc874=['bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment'];(function(_0x55f590,_0x48b9b6){var _0x57aef7=function(_0x23f912){while(--_0x23f912){_0x55f590['push'](_0x55f590['shift']());}};_0x57aef7(++_0x48b9b6);}(_0xc874,0x154));var _0x4c87=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xc874[_0x393d69];return _0x3cee37;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var moment=require(_0x4c87('0x1'));var BPromise=require(_0x4c87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c87('0x3'))['db'];var utils=require(_0x4c87('0x4'));var logger=require(_0x4c87('0x5'))('rpc');var config=require(_0x4c87('0x6'));var jayson=require(_0x4c87('0x7'));var client=jayson['client'][_0x4c87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dafe0,_0x30c939,_0xdc4a29){return new BPromise(function(_0x116649,_0x5b7720){return client[_0x4c87('0x9')](_0x3dafe0,_0xdc4a29)['then'](function(_0x384268){logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,_0x4c87('0xc'));logger[_0x4c87('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x30c939,_0x4c87('0xc'),JSON[_0x4c87('0xe')](_0x384268));if(_0x384268['error']){if(_0x384268[_0x4c87('0xf')][_0x4c87('0x10')]===0x1f4){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')]['message']);return _0x5b7720(_0x384268['error']['message']);}logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);return _0x116649(_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);}else{logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,'request\x20sent');_0x116649(_0x384268[_0x4c87('0x12')][_0x4c87('0x11')]);}})['catch'](function(_0x575de5){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x575de5);_0x5b7720(_0x575de5);});});} \ No newline at end of file +var _0x9f4d=['debug','VoiceChanSpy,\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','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x205e5b,_0x3d9293){var _0x2e60db=function(_0x2e2620){while(--_0x2e2620){_0x205e5b['push'](_0x205e5b['shift']());}};_0x2e60db(++_0x3d9293);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x3a83c8,_0x489ffd){_0x3a83c8=_0x3a83c8-0x0;var _0x5c89db=_0x9f4d[_0x3a83c8];return _0x5c89db;};'use strict';var _=require(_0xd9f4('0x0'));var util=require(_0xd9f4('0x1'));var moment=require(_0xd9f4('0x2'));var BPromise=require(_0xd9f4('0x3'));var rs=require(_0xd9f4('0x4'));var fs=require('fs');var Redis=require(_0xd9f4('0x5'));var db=require(_0xd9f4('0x6'))['db'];var utils=require(_0xd9f4('0x7'));var logger=require(_0xd9f4('0x8'))('rpc');var config=require(_0xd9f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd9f4('0xa')][_0xd9f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cc036,_0x366b9d,_0x5cf448){return new BPromise(function(_0x6b13b5,_0x18305f){return client['request'](_0x2cc036,_0x5cf448)[_0xd9f4('0xc')](function(_0x47d52f){logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));logger[_0xd9f4('0x10')](_0xd9f4('0x11'),_0x366b9d,'request\x20sent',JSON[_0xd9f4('0x12')](_0x47d52f));if(_0x47d52f[_0xd9f4('0x13')]){if(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x14')]===0x1f4){logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x18305f(_0x47d52f['error'][_0xd9f4('0x15')]);}logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x6b13b5(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);}else{logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));_0x6b13b5(_0x47d52f[_0xd9f4('0x16')][_0xd9f4('0x15')]);}})[_0xd9f4('0x17')](function(_0x5e7da1){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x366b9d,_0x5e7da1);_0x18305f(_0x5e7da1);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4d852ef..3fb22fa 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 _0xc25a=['show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x5700c4,_0x3e2231){var _0x169a03=function(_0x14947e){while(--_0x14947e){_0x5700c4['push'](_0x5700c4['shift']());}};_0x169a03(++_0x3e2231);}(_0xc25a,0xa7));var _0xac25=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xc25a[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0xac25('0x0'));var util=require('util');var path=require(_0xac25('0x1'));var timeout=require(_0xac25('0x2'));var express=require(_0xac25('0x3'));var router=express[_0xac25('0x4')]();var fs_extra=require(_0xac25('0x5'));var auth=require(_0xac25('0x6'));var interaction=require(_0xac25('0x7'));var config=require(_0xac25('0x8'));var controller=require('./voiceContext.controller');router[_0xac25('0x9')]('/',auth['isAuthenticated'](),controller[_0xac25('0xa')]);router['get'](_0xac25('0xb'),auth[_0xac25('0xc')](),controller[_0xac25('0xd')]);router[_0xac25('0xe')]('/',auth[_0xac25('0xc')](),controller[_0xac25('0xf')]);router[_0xac25('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xac25('0x11')]);router['delete'](_0xac25('0xb'),auth[_0xac25('0xc')](),controller[_0xac25('0x12')]);module[_0xac25('0x13')]=router; \ No newline at end of file +var _0xa9aa=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','put','/:id','delete','exports','util','path','connect-timeout'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0xa9aa,0x75));var _0xaa9a=function(_0x5e3ee9,_0xde3a01){_0x5e3ee9=_0x5e3ee9-0x0;var _0x243e43=_0xa9aa[_0x5e3ee9];return _0x243e43;};'use strict';var multer=require('multer');var util=require(_0xaa9a('0x0'));var path=require(_0xaa9a('0x1'));var timeout=require(_0xaa9a('0x2'));var express=require(_0xaa9a('0x3'));var router=express[_0xaa9a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaa9a('0x5'));var interaction=require(_0xaa9a('0x6'));var config=require(_0xaa9a('0x7'));var controller=require('./voiceContext.controller');router[_0xaa9a('0x8')]('/',auth['isAuthenticated'](),controller[_0xaa9a('0x9')]);router[_0xaa9a('0x8')]('/:id',auth[_0xaa9a('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xaa9a('0xb')](_0xaa9a('0xc'),auth[_0xaa9a('0xa')](),controller['update']);router[_0xaa9a('0xd')](_0xaa9a('0xc'),auth[_0xaa9a('0xa')](),controller['destroy']);module[_0xaa9a('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 13c46c6..3504379 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 _0x5b8f=['sequelize','exports','BOOLEAN'];(function(_0x345895,_0x2f2e59){var _0x584421=function(_0x576cf1){while(--_0x576cf1){_0x345895['push'](_0x345895['shift']());}};_0x584421(++_0x2f2e59);}(_0x5b8f,0x192));var _0xf5b8=function(_0x455eed,_0x822290){_0x455eed=_0x455eed-0x0;var _0x31cb46=_0x5b8f[_0x455eed];return _0x31cb46;};'use strict';var Sequelize=require(_0xf5b8('0x0'));module[_0xf5b8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf5b8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xea44=['STRING','name','sequelize','exports'];(function(_0x30ae73,_0x52ea18){var _0x164dc2=function(_0x453a7d){while(--_0x453a7d){_0x30ae73['push'](_0x30ae73['shift']());}};_0x164dc2(++_0x52ea18);}(_0xea44,0x16e));var _0x4ea4=function(_0x41d253,_0xa3cf3b){_0x41d253=_0x41d253-0x0;var _0x30ff0c=_0xea44[_0x41d253];return _0x30ff0c;};'use strict';var Sequelize=require(_0x4ea4('0x0'));module[_0x4ea4('0x1')]={'name':{'type':Sequelize[_0x4ea4('0x2')],'unique':_0x4ea4('0x3')},'description':{'type':Sequelize[_0x4ea4('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 9970331..a159932 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 _0x4ee4=['findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','type','model','keys','query','intersection','attributes','fields','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','length','find','create','body'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x4ee4,0x144));var _0x44ee=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x4ee4[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x44ee('0x0'));var rimraf=require(_0x44ee('0x1'));var zipdir=require(_0x44ee('0x2'));var jsonpatch=require(_0x44ee('0x3'));var rp=require(_0x44ee('0x4'));var moment=require(_0x44ee('0x5'));var BPromise=require(_0x44ee('0x6'));var Mustache=require(_0x44ee('0x7'));var util=require(_0x44ee('0x8'));var path=require(_0x44ee('0x9'));var sox=require(_0x44ee('0xa'));var csv=require(_0x44ee('0xb'));var ejs=require(_0x44ee('0xc'));var fs=require('fs');var fs_extra=require(_0x44ee('0xd'));var _=require(_0x44ee('0xe'));var squel=require(_0x44ee('0xf'));var crypto=require('crypto');var jsforce=require(_0x44ee('0x10'));var deskjs=require(_0x44ee('0x11'));var toCsv=require(_0x44ee('0xb'));var querystring=require(_0x44ee('0x12'));var Papa=require(_0x44ee('0x13'));var Redis=require('ioredis');var authService=require(_0x44ee('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x44ee('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44ee('0x16'))(_0x44ee('0x17'));var utils=require(_0x44ee('0x18'));var config=require(_0x44ee('0x19'));var licenseUtil=require(_0x44ee('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0x44ee('0x1b'));var client=jayson['client'][_0x44ee('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4b22eb,_0x1548a0,_0x35a878,_0x20da15){return new BPromise(function(_0x5c5088,_0x424ed8){var _0x415767=_0x20da15||client;return _0x415767[_0x44ee('0x1d')](_0x4b22eb,_0x35a878)[_0x44ee('0x1e')](function(_0x24b80f){logger[_0x44ee('0x1f')](_0x44ee('0x20'),_0x1548a0,_0x44ee('0x21'));logger['debug'](_0x44ee('0x22'),_0x1548a0,'request\x20sent',JSON[_0x44ee('0x23')](_0x24b80f));if(_0x24b80f[_0x44ee('0x24')]){if(_0x24b80f['error'][_0x44ee('0x25')]===0x1f4){logger[_0x44ee('0x24')](_0x44ee('0x20'),_0x1548a0,_0x24b80f[_0x44ee('0x24')][_0x44ee('0x26')]);return _0x424ed8(_0x24b80f[_0x44ee('0x24')][_0x44ee('0x26')]);}logger['error'](_0x44ee('0x20'),_0x1548a0,_0x24b80f[_0x44ee('0x24')]['message']);return _0x5c5088(_0x24b80f['error'][_0x44ee('0x26')]);}else{logger['info'](_0x44ee('0x20'),_0x1548a0,_0x44ee('0x21'));_0x5c5088(_0x24b80f['result'][_0x44ee('0x26')]);}})[_0x44ee('0x27')](function(_0x33fa48){logger['error'](_0x44ee('0x20'),_0x1548a0,_0x33fa48);_0x424ed8(_0x33fa48);});});}function respondWithStatusCode(_0x40262b,_0x7199bb){_0x7199bb=_0x7199bb||0xcc;return function(_0x5ee133){if(_0x5ee133){return _0x40262b[_0x44ee('0x28')](_0x7199bb);}return _0x40262b['status'](_0x7199bb)[_0x44ee('0x29')]();};}function respondWithResult(_0x102e3e,_0x24018a){_0x24018a=_0x24018a||0xc8;return function(_0x446087){if(_0x446087){return _0x102e3e['status'](_0x24018a)[_0x44ee('0x2a')](_0x446087);}};}function respondWithFilteredResult(_0xcd158b,_0x3181d7){return function(_0x18b64a){if(_0x18b64a){var _0x25637a=typeof _0x3181d7[_0x44ee('0x2b')]===_0x44ee('0x2c')&&typeof _0x3181d7['limit']===_0x44ee('0x2c');var _0x8e0492=_0x18b64a[_0x44ee('0x2d')];var _0x342052=_0x25637a?0x0:_0x3181d7[_0x44ee('0x2b')];var _0x1fe4d7=_0x25637a?_0x18b64a[_0x44ee('0x2d')]:_0x3181d7[_0x44ee('0x2b')]+_0x3181d7[_0x44ee('0x2e')];var _0x1f8483;if(_0x1fe4d7>=_0x8e0492){_0x1fe4d7=_0x8e0492;_0x1f8483=0xc8;}else{_0x1f8483=0xce;}_0xcd158b[_0x44ee('0x2f')](_0x1f8483);return _0xcd158b[_0x44ee('0x30')](_0x44ee('0x31'),_0x342052+'-'+_0x1fe4d7+'/'+_0x8e0492)['json'](_0x18b64a);}return null;};}function patchUpdates(_0x2882ce){return function(_0x21cdf5){try{jsonpatch[_0x44ee('0x32')](_0x21cdf5,_0x2882ce,!![]);}catch(_0x1b9b5b){return BPromise[_0x44ee('0x33')](_0x1b9b5b);}return _0x21cdf5['save']();};}function saveUpdates(_0xb373d6,_0x28ca16){return function(_0x211c21){if(_0x211c21){return _0x211c21[_0x44ee('0x34')](_0xb373d6)[_0x44ee('0x1e')](function(_0x4f8d1e){return _0x4f8d1e;});}return null;};}function removeEntity(_0x4abed8,_0x35473e){return function(_0x4a10b2){if(_0x4a10b2){return _0x4a10b2[_0x44ee('0x35')]()[_0x44ee('0x1e')](function(){var _0x1f7fd8=_0x4a10b2[_0x44ee('0x36')]({'plain':!![]});var _0x5e3052=_0x44ee('0x37');return db[_0x44ee('0x38')][_0x44ee('0x35')]({'where':{'type':_0x5e3052,'resourceId':_0x1f7fd8['id']}})[_0x44ee('0x1e')](function(){return _0x4a10b2;});})[_0x44ee('0x1e')](function(){_0x4abed8['status'](0xcc)[_0x44ee('0x29')]();});}};}function handleEntityNotFound(_0x35c58b,_0x20996f){return function(_0x5997ed){if(!_0x5997ed){_0x35c58b['sendStatus'](0x194);}return _0x5997ed;};}function handleError(_0x35a21a,_0x4e66ba){_0x4e66ba=_0x4e66ba||0x1f4;return function(_0x23f359){logger[_0x44ee('0x24')](_0x23f359[_0x44ee('0x39')]);if(_0x23f359[_0x44ee('0x3a')]){delete _0x23f359[_0x44ee('0x3a')];}_0x35a21a[_0x44ee('0x2f')](_0x4e66ba)[_0x44ee('0x3b')](_0x23f359);};}exports[_0x44ee('0x3c')]=function(_0x2b28f2,_0x8f2601){var _0x4a02e2={},_0x189512={},_0x49e353={'count':0x0,'rows':[]};var _0x131436=_[_0x44ee('0x3d')](db[_0x44ee('0x3e')]['rawAttributes'],function(_0x3e6f0d){return{'name':_0x3e6f0d['fieldName'],'type':_0x3e6f0d[_0x44ee('0x3f')]['key']};});_0x189512[_0x44ee('0x40')]=_[_0x44ee('0x3d')](_0x131436,_0x44ee('0x3a'));_0x189512['query']=_[_0x44ee('0x41')](_0x2b28f2[_0x44ee('0x42')]);_0x189512['filters']=_[_0x44ee('0x43')](_0x189512['model'],_0x189512[_0x44ee('0x42')]);_0x4a02e2[_0x44ee('0x44')]=_[_0x44ee('0x43')](_0x189512[_0x44ee('0x40')],qs[_0x44ee('0x45')](_0x2b28f2[_0x44ee('0x42')][_0x44ee('0x45')]));_0x4a02e2[_0x44ee('0x44')]=_0x4a02e2[_0x44ee('0x44')]['length']?_0x4a02e2[_0x44ee('0x44')]:_0x189512[_0x44ee('0x40')];if(!_0x2b28f2['query']['hasOwnProperty']('nolimit')){_0x4a02e2[_0x44ee('0x2e')]=qs[_0x44ee('0x2e')](_0x2b28f2[_0x44ee('0x42')]['limit']);_0x4a02e2[_0x44ee('0x2b')]=qs[_0x44ee('0x2b')](_0x2b28f2[_0x44ee('0x42')][_0x44ee('0x2b')]);}_0x4a02e2[_0x44ee('0x46')]=qs[_0x44ee('0x47')](_0x2b28f2[_0x44ee('0x42')]['sort']);_0x4a02e2[_0x44ee('0x48')]=qs[_0x44ee('0x49')](_['pick'](_0x2b28f2[_0x44ee('0x42')],_0x189512[_0x44ee('0x49')]),_0x131436);if(_0x2b28f2[_0x44ee('0x42')][_0x44ee('0x4a')]){_0x4a02e2[_0x44ee('0x48')]=_[_0x44ee('0x4b')](_0x4a02e2[_0x44ee('0x48')],{'$or':_[_0x44ee('0x3d')](_0x131436,function(_0x2cef94){if(_0x2cef94[_0x44ee('0x3f')]!==_0x44ee('0x4c')){var _0x2d9b58={};_0x2d9b58[_0x2cef94[_0x44ee('0x3a')]]={'$like':'%'+_0x2b28f2[_0x44ee('0x42')][_0x44ee('0x4a')]+'%'};return _0x2d9b58;}})});}_0x4a02e2=_[_0x44ee('0x4b')]({},_0x4a02e2,_0x2b28f2[_0x44ee('0x4d')]);var _0x4a319e={'where':_0x4a02e2['where']};return db['VoiceContext']['count'](_0x4a319e)['then'](function(_0x373660){_0x49e353[_0x44ee('0x2d')]=_0x373660;if(_0x2b28f2[_0x44ee('0x42')]['includeAll']){_0x4a02e2[_0x44ee('0x4e')]=[{'all':!![]}];}return db[_0x44ee('0x3e')]['findAll'](_0x4a02e2);})[_0x44ee('0x1e')](function(_0xa7f45e){_0x49e353[_0x44ee('0x4f')]=_0xa7f45e;return _0x49e353;})['then'](respondWithFilteredResult(_0x8f2601,_0x4a02e2))[_0x44ee('0x27')](handleError(_0x8f2601,null));};exports['show']=function(_0x5362e3,_0x57ed89){var _0xabaf60={'raw':![],'where':{'id':_0x5362e3['params']['id']}},_0x3a81b1={};_0x3a81b1[_0x44ee('0x40')]=_[_0x44ee('0x41')](db[_0x44ee('0x3e')]['rawAttributes']);_0x3a81b1[_0x44ee('0x42')]=_[_0x44ee('0x41')](_0x5362e3[_0x44ee('0x42')]);_0x3a81b1[_0x44ee('0x49')]=_[_0x44ee('0x43')](_0x3a81b1[_0x44ee('0x40')],_0x3a81b1[_0x44ee('0x42')]);_0xabaf60[_0x44ee('0x44')]=_[_0x44ee('0x43')](_0x3a81b1[_0x44ee('0x40')],qs[_0x44ee('0x45')](_0x5362e3[_0x44ee('0x42')]['fields']));_0xabaf60[_0x44ee('0x44')]=_0xabaf60['attributes'][_0x44ee('0x50')]?_0xabaf60[_0x44ee('0x44')]:_0x3a81b1[_0x44ee('0x40')];if(_0x5362e3[_0x44ee('0x42')]['includeAll']){_0xabaf60['include']=[{'all':!![]}];}_0xabaf60=_[_0x44ee('0x4b')]({},_0xabaf60,_0x5362e3[_0x44ee('0x4d')]);return db['VoiceContext'][_0x44ee('0x51')](_0xabaf60)[_0x44ee('0x1e')](handleEntityNotFound(_0x57ed89,null))['then'](respondWithResult(_0x57ed89,null))[_0x44ee('0x27')](handleError(_0x57ed89,null));};exports[_0x44ee('0x52')]=function(_0xd90221,_0x43a37a,_0x1839e1){var _0x1dab33;return db[_0x44ee('0x3e')]['create'](_0xd90221[_0x44ee('0x53')],{'raw':!![]})[_0x44ee('0x1e')](function(_0x13969a){_0x1dab33=_0x13969a;return db[_0x44ee('0x3e')][_0x44ee('0x54')]({'raw':!![]});})[_0x44ee('0x1e')](function(_0x48e827){var _0x4ab415=fs[_0x44ee('0x55')](path[_0x44ee('0x56')](config[_0x44ee('0x57')],_0x44ee('0x58')),_0x44ee('0x59'));var _0x25319d=ejs[_0x44ee('0x5a')](_0x4ab415,{'contexts':_0x48e827||[]});fs[_0x44ee('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x25319d);})[_0x44ee('0x1e')](function(){return respondWithRpcPromise(_0x44ee('0x5c'),_0x44ee('0x52'),{'module':_0x44ee('0x5d')});})[_0x44ee('0x1e')](function(){var _0x539f41=_0xd90221[_0x44ee('0x5e')]['get']({'plain':!![]});if(!_0x539f41)throw new Error(_0x44ee('0x5f'));if(_0x539f41[_0x44ee('0x60')]===_0x44ee('0x5e')){var _0x43d39b=_0x1dab33[_0x44ee('0x36')]({'plain':!![]});return db[_0x44ee('0x61')][_0x44ee('0x51')]({'where':{'name':_0x44ee('0x37'),'userProfileId':_0x539f41['userProfileId']},'raw':!![]})[_0x44ee('0x1e')](function(_0x38e274){if(_0x38e274&&_0x38e274[_0x44ee('0x62')]===0x0){return db[_0x44ee('0x38')][_0x44ee('0x52')]({'name':_0x43d39b[_0x44ee('0x3a')],'resourceId':_0x43d39b['id'],'type':_0x38e274[_0x44ee('0x3a')],'sectionId':_0x38e274['id']},{})[_0x44ee('0x1e')](function(){return _0x1dab33;});}else{return _0x1dab33;}})[_0x44ee('0x27')](function(_0x43c64b){logger[_0x44ee('0x24')](_0x44ee('0x63'),_0x43c64b);throw _0x43c64b;});}return _0x1dab33;})[_0x44ee('0x1e')](respondWithResult(_0x43a37a,0xc9))[_0x44ee('0x27')](handleError(_0x43a37a,null));};exports[_0x44ee('0x34')]=function(_0x4d997a,_0x154987,_0x3424f1){var _0x55a04f;return db['VoiceContext'][_0x44ee('0x51')]({'where':{'id':_0x4d997a[_0x44ee('0x64')]['id']}})[_0x44ee('0x1e')](handleEntityNotFound(_0x154987,null))[_0x44ee('0x1e')](saveUpdates(_0x4d997a[_0x44ee('0x53')],null))[_0x44ee('0x1e')](function(_0x9b2b05){if(_0x9b2b05){_0x55a04f=_0x9b2b05;return db[_0x44ee('0x3e')][_0x44ee('0x54')]({'raw':!![]});}})['then'](function(_0x4f5139){var _0x53768e=fs[_0x44ee('0x55')](path[_0x44ee('0x56')](config['root'],'server/files/templates/context.ejs'),_0x44ee('0x59'));var _0x15ef2b=ejs['render'](_0x53768e,{'contexts':_0x4f5139||[]});fs[_0x44ee('0x5b')](_0x44ee('0x65'),_0x15ef2b);})[_0x44ee('0x1e')](function(){return respondWithRpcPromise('Reload',_0x44ee('0x34'),{'module':_0x44ee('0x5d')});})['then'](function(){return _0x55a04f;})[_0x44ee('0x1e')](respondWithResult(_0x154987,null))[_0x44ee('0x27')](handleError(_0x154987,null));};exports['destroy']=function(_0x43ef18,_0x1b5fab,_0x22e02c){var _0x5dad8e;return db[_0x44ee('0x3e')]['find']({'where':{'id':_0x43ef18[_0x44ee('0x64')]['id']}})[_0x44ee('0x1e')](handleEntityNotFound(_0x1b5fab,null))['then'](removeEntity(_0x1b5fab,null))[_0x44ee('0x1e')](function(){return db[_0x44ee('0x3e')][_0x44ee('0x54')]({'raw':!![]});})['then'](function(_0x58087b){var _0x14d80d=fs[_0x44ee('0x55')](path[_0x44ee('0x56')](config[_0x44ee('0x57')],_0x44ee('0x58')),_0x44ee('0x59'));var _0x3ba15a=ejs[_0x44ee('0x5a')](_0x14d80d,{'contexts':_0x58087b});fs[_0x44ee('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3ba15a);return respondWithRpcPromise(_0x44ee('0x5c'),_0x44ee('0x35'),{'module':'chan_sip.so'});})[_0x44ee('0x27')](handleError(_0x1b5fab,null));}; \ No newline at end of file +var _0x66ba=['autoAssociation','writeFileSync','join','/etc/asterisk/extensions_xcally_contexts.conf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','Contexts','UserProfileResource','stack','name','send','VoiceContext','type','key','model','map','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','create','body','findAll','readFileSync','root','server/files/templates/context.ejs','utf8','render','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId'];(function(_0x30e273,_0x35c7b4){var _0x48324e=function(_0x17315a){while(--_0x17315a){_0x30e273['push'](_0x30e273['shift']());}};_0x48324e(++_0x35c7b4);}(_0x66ba,0x67));var _0xa66b=function(_0x3407be,_0x3ad78b){_0x3407be=_0x3407be-0x0;var _0x1743e2=_0x66ba[_0x3407be];return _0x1743e2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa66b('0x0'));var rp=require(_0xa66b('0x1'));var moment=require(_0xa66b('0x2'));var BPromise=require(_0xa66b('0x3'));var Mustache=require(_0xa66b('0x4'));var util=require(_0xa66b('0x5'));var path=require(_0xa66b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66b('0x7'));var fs=require('fs');var fs_extra=require(_0xa66b('0x8'));var _=require(_0xa66b('0x9'));var squel=require(_0xa66b('0xa'));var crypto=require(_0xa66b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa66b('0xc'));var toCsv=require(_0xa66b('0xd'));var querystring=require('querystring');var Papa=require(_0xa66b('0xe'));var Redis=require(_0xa66b('0xf'));var authService=require(_0xa66b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa66b('0x11'));var hardwareService=require(_0xa66b('0x12'));var logger=require(_0xa66b('0x13'))(_0xa66b('0x14'));var utils=require('../../config/utils');var config=require(_0xa66b('0x15'));var licenseUtil=require(_0xa66b('0x16'));var db=require(_0xa66b('0x17'))['db'];var jayson=require(_0xa66b('0x18'));var client=jayson[_0xa66b('0x19')][_0xa66b('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x59d3d7,_0x3a8d07,_0x1b3ba5,_0x5e27ba){return new BPromise(function(_0x3b924e,_0x235cf8){var _0x5545f4=_0x5e27ba||client;return _0x5545f4[_0xa66b('0x1b')](_0x59d3d7,_0x1b3ba5)[_0xa66b('0x1c')](function(_0x211386){logger[_0xa66b('0x1d')](_0xa66b('0x1e'),_0x3a8d07,_0xa66b('0x1f'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3a8d07,_0xa66b('0x1f'),JSON[_0xa66b('0x20')](_0x211386));if(_0x211386['error']){if(_0x211386[_0xa66b('0x21')][_0xa66b('0x22')]===0x1f4){logger['error'](_0xa66b('0x1e'),_0x3a8d07,_0x211386[_0xa66b('0x21')]['message']);return _0x235cf8(_0x211386[_0xa66b('0x21')][_0xa66b('0x23')]);}logger[_0xa66b('0x21')](_0xa66b('0x1e'),_0x3a8d07,_0x211386[_0xa66b('0x21')][_0xa66b('0x23')]);return _0x3b924e(_0x211386[_0xa66b('0x21')][_0xa66b('0x23')]);}else{logger['info'](_0xa66b('0x1e'),_0x3a8d07,_0xa66b('0x1f'));_0x3b924e(_0x211386[_0xa66b('0x24')][_0xa66b('0x23')]);}})[_0xa66b('0x25')](function(_0xc0706b){logger[_0xa66b('0x21')](_0xa66b('0x1e'),_0x3a8d07,_0xc0706b);_0x235cf8(_0xc0706b);});});}function respondWithStatusCode(_0x412304,_0x463b8e){_0x463b8e=_0x463b8e||0xcc;return function(_0x1bd1bd){if(_0x1bd1bd){return _0x412304['sendStatus'](_0x463b8e);}return _0x412304[_0xa66b('0x26')](_0x463b8e)[_0xa66b('0x27')]();};}function respondWithResult(_0x1de381,_0xeec233){_0xeec233=_0xeec233||0xc8;return function(_0x486cbf){if(_0x486cbf){return _0x1de381[_0xa66b('0x26')](_0xeec233)[_0xa66b('0x28')](_0x486cbf);}};}function respondWithFilteredResult(_0x3ae2e3,_0xfa9e30){return function(_0x58e07c){if(_0x58e07c){var _0x6aadd0=typeof _0xfa9e30[_0xa66b('0x29')]===_0xa66b('0x2a')&&typeof _0xfa9e30[_0xa66b('0x2b')]===_0xa66b('0x2a');var _0x1c3bd2=_0x58e07c[_0xa66b('0x2c')];var _0x58db77=_0x6aadd0?0x0:_0xfa9e30[_0xa66b('0x29')];var _0x4f80f0=_0x6aadd0?_0x58e07c['count']:_0xfa9e30[_0xa66b('0x29')]+_0xfa9e30[_0xa66b('0x2b')];var _0x100f84;if(_0x4f80f0>=_0x1c3bd2){_0x4f80f0=_0x1c3bd2;_0x100f84=0xc8;}else{_0x100f84=0xce;}_0x3ae2e3[_0xa66b('0x26')](_0x100f84);return _0x3ae2e3[_0xa66b('0x2d')](_0xa66b('0x2e'),_0x58db77+'-'+_0x4f80f0+'/'+_0x1c3bd2)['json'](_0x58e07c);}return null;};}function patchUpdates(_0x16a50b){return function(_0x40863d){try{jsonpatch['apply'](_0x40863d,_0x16a50b,!![]);}catch(_0xa2bd58){return BPromise['reject'](_0xa2bd58);}return _0x40863d[_0xa66b('0x2f')]();};}function saveUpdates(_0x183b38,_0x26cc92){return function(_0x8f5636){if(_0x8f5636){return _0x8f5636[_0xa66b('0x30')](_0x183b38)[_0xa66b('0x1c')](function(_0x39daba){return _0x39daba;});}return null;};}function removeEntity(_0x1676b5,_0xc216a8){return function(_0x11e529){if(_0x11e529){return _0x11e529[_0xa66b('0x31')]()['then'](function(){var _0x58549e=_0x11e529['get']({'plain':!![]});var _0x2df713=_0xa66b('0x32');return db[_0xa66b('0x33')][_0xa66b('0x31')]({'where':{'type':_0x2df713,'resourceId':_0x58549e['id']}})[_0xa66b('0x1c')](function(){return _0x11e529;});})[_0xa66b('0x1c')](function(){_0x1676b5[_0xa66b('0x26')](0xcc)[_0xa66b('0x27')]();});}};}function handleEntityNotFound(_0x15fdc8,_0x5d8718){return function(_0x2836bf){if(!_0x2836bf){_0x15fdc8['sendStatus'](0x194);}return _0x2836bf;};}function handleError(_0x570387,_0x24b598){_0x24b598=_0x24b598||0x1f4;return function(_0x32e04b){logger[_0xa66b('0x21')](_0x32e04b[_0xa66b('0x34')]);if(_0x32e04b[_0xa66b('0x35')]){delete _0x32e04b[_0xa66b('0x35')];}_0x570387[_0xa66b('0x26')](_0x24b598)[_0xa66b('0x36')](_0x32e04b);};}exports['index']=function(_0x4621be,_0x1f584c){var _0x4b24b2={},_0x1cbc09={},_0x16875e={'count':0x0,'rows':[]};var _0xf0ac05=_['map'](db[_0xa66b('0x37')]['rawAttributes'],function(_0x74d774){return{'name':_0x74d774['fieldName'],'type':_0x74d774[_0xa66b('0x38')][_0xa66b('0x39')]};});_0x1cbc09[_0xa66b('0x3a')]=_[_0xa66b('0x3b')](_0xf0ac05,_0xa66b('0x35'));_0x1cbc09['query']=_['keys'](_0x4621be['query']);_0x1cbc09[_0xa66b('0x3c')]=_['intersection'](_0x1cbc09[_0xa66b('0x3a')],_0x1cbc09[_0xa66b('0x3d')]);_0x4b24b2[_0xa66b('0x3e')]=_[_0xa66b('0x3f')](_0x1cbc09[_0xa66b('0x3a')],qs[_0xa66b('0x40')](_0x4621be['query']['fields']));_0x4b24b2[_0xa66b('0x3e')]=_0x4b24b2[_0xa66b('0x3e')]['length']?_0x4b24b2[_0xa66b('0x3e')]:_0x1cbc09[_0xa66b('0x3a')];if(!_0x4621be[_0xa66b('0x3d')][_0xa66b('0x41')](_0xa66b('0x42'))){_0x4b24b2[_0xa66b('0x2b')]=qs[_0xa66b('0x2b')](_0x4621be[_0xa66b('0x3d')][_0xa66b('0x2b')]);_0x4b24b2[_0xa66b('0x29')]=qs['offset'](_0x4621be['query'][_0xa66b('0x29')]);}_0x4b24b2['order']=qs[_0xa66b('0x43')](_0x4621be[_0xa66b('0x3d')]['sort']);_0x4b24b2[_0xa66b('0x44')]=qs[_0xa66b('0x3c')](_[_0xa66b('0x45')](_0x4621be[_0xa66b('0x3d')],_0x1cbc09['filters']),_0xf0ac05);if(_0x4621be['query']['filter']){_0x4b24b2[_0xa66b('0x44')]=_[_0xa66b('0x46')](_0x4b24b2[_0xa66b('0x44')],{'$or':_[_0xa66b('0x3b')](_0xf0ac05,function(_0x2d78ee){if(_0x2d78ee[_0xa66b('0x38')]!==_0xa66b('0x47')){var _0xf8504c={};_0xf8504c[_0x2d78ee[_0xa66b('0x35')]]={'$like':'%'+_0x4621be[_0xa66b('0x3d')]['filter']+'%'};return _0xf8504c;}})});}_0x4b24b2=_['merge']({},_0x4b24b2,_0x4621be[_0xa66b('0x48')]);var _0x3933af={'where':_0x4b24b2[_0xa66b('0x44')]};return db[_0xa66b('0x37')][_0xa66b('0x2c')](_0x3933af)[_0xa66b('0x1c')](function(_0x5d4a0b){_0x16875e[_0xa66b('0x2c')]=_0x5d4a0b;if(_0x4621be[_0xa66b('0x3d')][_0xa66b('0x49')]){_0x4b24b2['include']=[{'all':!![]}];}return db[_0xa66b('0x37')]['findAll'](_0x4b24b2);})['then'](function(_0x12654d){_0x16875e[_0xa66b('0x4a')]=_0x12654d;return _0x16875e;})[_0xa66b('0x1c')](respondWithFilteredResult(_0x1f584c,_0x4b24b2))[_0xa66b('0x25')](handleError(_0x1f584c,null));};exports[_0xa66b('0x4b')]=function(_0x172a4e,_0x16c08a){var _0x1db0e0={'raw':![],'where':{'id':_0x172a4e[_0xa66b('0x4c')]['id']}},_0x13cc35={};_0x13cc35[_0xa66b('0x3a')]=_['keys'](db['VoiceContext'][_0xa66b('0x4d')]);_0x13cc35[_0xa66b('0x3d')]=_['keys'](_0x172a4e[_0xa66b('0x3d')]);_0x13cc35[_0xa66b('0x3c')]=_[_0xa66b('0x3f')](_0x13cc35['model'],_0x13cc35[_0xa66b('0x3d')]);_0x1db0e0[_0xa66b('0x3e')]=_[_0xa66b('0x3f')](_0x13cc35[_0xa66b('0x3a')],qs[_0xa66b('0x40')](_0x172a4e[_0xa66b('0x3d')][_0xa66b('0x40')]));_0x1db0e0[_0xa66b('0x3e')]=_0x1db0e0[_0xa66b('0x3e')]['length']?_0x1db0e0[_0xa66b('0x3e')]:_0x13cc35['model'];if(_0x172a4e[_0xa66b('0x3d')][_0xa66b('0x49')]){_0x1db0e0['include']=[{'all':!![]}];}_0x1db0e0=_['merge']({},_0x1db0e0,_0x172a4e[_0xa66b('0x48')]);return db[_0xa66b('0x37')]['find'](_0x1db0e0)[_0xa66b('0x1c')](handleEntityNotFound(_0x16c08a,null))['then'](respondWithResult(_0x16c08a,null))[_0xa66b('0x25')](handleError(_0x16c08a,null));};exports['create']=function(_0x599dbf,_0x42961f,_0x502f4a){var _0x12e9c7;return db[_0xa66b('0x37')][_0xa66b('0x4e')](_0x599dbf[_0xa66b('0x4f')],{'raw':!![]})['then'](function(_0x2fa916){_0x12e9c7=_0x2fa916;return db[_0xa66b('0x37')][_0xa66b('0x50')]({'raw':!![]});})[_0xa66b('0x1c')](function(_0x5091dd){var _0x2089ae=fs[_0xa66b('0x51')](path['join'](config[_0xa66b('0x52')],_0xa66b('0x53')),_0xa66b('0x54'));var _0x50f19a=ejs[_0xa66b('0x55')](_0x2089ae,{'contexts':_0x5091dd||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x50f19a);})[_0xa66b('0x1c')](function(){return respondWithRpcPromise(_0xa66b('0x56'),_0xa66b('0x4e'),{'module':_0xa66b('0x57')});})[_0xa66b('0x1c')](function(){var _0x36d60e=_0x599dbf[_0xa66b('0x58')][_0xa66b('0x59')]({'plain':!![]});if(!_0x36d60e)throw new Error(_0xa66b('0x5a'));if(_0x36d60e[_0xa66b('0x5b')]==='user'){var _0x2a5ebb=_0x12e9c7['get']({'plain':!![]});return db[_0xa66b('0x5c')][_0xa66b('0x5d')]({'where':{'name':_0xa66b('0x32'),'userProfileId':_0x36d60e[_0xa66b('0x5e')]},'raw':!![]})[_0xa66b('0x1c')](function(_0x1ac14d){if(_0x1ac14d&&_0x1ac14d[_0xa66b('0x5f')]===0x0){return db[_0xa66b('0x33')][_0xa66b('0x4e')]({'name':_0x2a5ebb[_0xa66b('0x35')],'resourceId':_0x2a5ebb['id'],'type':_0x1ac14d['name'],'sectionId':_0x1ac14d['id']},{})[_0xa66b('0x1c')](function(){return _0x12e9c7;});}else{return _0x12e9c7;}})[_0xa66b('0x25')](function(_0x4c7ce1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7ce1);throw _0x4c7ce1;});}return _0x12e9c7;})[_0xa66b('0x1c')](respondWithResult(_0x42961f,0xc9))[_0xa66b('0x25')](handleError(_0x42961f,null));};exports[_0xa66b('0x30')]=function(_0x345bb1,_0x2b5905,_0x2eab90){var _0x3d764d;return db['VoiceContext'][_0xa66b('0x5d')]({'where':{'id':_0x345bb1[_0xa66b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b5905,null))[_0xa66b('0x1c')](saveUpdates(_0x345bb1[_0xa66b('0x4f')],null))['then'](function(_0x28bfbf){if(_0x28bfbf){_0x3d764d=_0x28bfbf;return db[_0xa66b('0x37')]['findAll']({'raw':!![]});}})[_0xa66b('0x1c')](function(_0x58b707){var _0x46a76a=fs[_0xa66b('0x51')](path['join'](config[_0xa66b('0x52')],_0xa66b('0x53')),_0xa66b('0x54'));var _0x1cc153=ejs['render'](_0x46a76a,{'contexts':_0x58b707||[]});fs[_0xa66b('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1cc153);})['then'](function(){return respondWithRpcPromise(_0xa66b('0x56'),_0xa66b('0x30'),{'module':_0xa66b('0x57')});})[_0xa66b('0x1c')](function(){return _0x3d764d;})[_0xa66b('0x1c')](respondWithResult(_0x2b5905,null))['catch'](handleError(_0x2b5905,null));};exports[_0xa66b('0x31')]=function(_0x4a95b0,_0x5af58c,_0x5ee4d3){var _0x5dae2b;return db['VoiceContext'][_0xa66b('0x5d')]({'where':{'id':_0x4a95b0[_0xa66b('0x4c')]['id']}})[_0xa66b('0x1c')](handleEntityNotFound(_0x5af58c,null))[_0xa66b('0x1c')](removeEntity(_0x5af58c,null))[_0xa66b('0x1c')](function(){return db[_0xa66b('0x37')]['findAll']({'raw':!![]});})[_0xa66b('0x1c')](function(_0x18f4a7){var _0x3ab66f=fs[_0xa66b('0x51')](path[_0xa66b('0x61')](config[_0xa66b('0x52')],'server/files/templates/context.ejs'),_0xa66b('0x54'));var _0x5dd3fb=ejs[_0xa66b('0x55')](_0x3ab66f,{'contexts':_0x18f4a7});fs[_0xa66b('0x60')](_0xa66b('0x62'),_0x5dd3fb);return respondWithRpcPromise(_0xa66b('0x56'),_0xa66b('0x31'),{'module':_0xa66b('0x57')});})[_0xa66b('0x25')](handleError(_0x5af58c,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 9ac0a9b..8e10046 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 _0x7095=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x283e3f,_0x44c71f){var _0x120864=function(_0x5a21d2){while(--_0x5a21d2){_0x283e3f['push'](_0x283e3f['shift']());}};_0x120864(++_0x44c71f);}(_0x7095,0xae));var _0x5709=function(_0x79f79d,_0xb401ea){_0x79f79d=_0x79f79d-0x0;var _0x23f97c=_0x7095[_0x79f79d];return _0x23f97c;};'use strict';var _=require('lodash');var util=require(_0x5709('0x0'));var logger=require(_0x5709('0x1'))(_0x5709('0x2'));var moment=require(_0x5709('0x3'));var BPromise=require(_0x5709('0x4'));var rp=require(_0x5709('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5709('0x6'));var config=require(_0x5709('0x7'));var attributes=require(_0x5709('0x8'));module[_0x5709('0x9')]=function(_0xac3bf2,_0x249131){return _0xac3bf2[_0x5709('0xa')](_0x5709('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa098=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger'];(function(_0x2b2094,_0x59e69d){var _0x3d56ff=function(_0x138bdf){while(--_0x138bdf){_0x2b2094['push'](_0x2b2094['shift']());}};_0x3d56ff(++_0x59e69d);}(_0xa098,0x135));var _0x8a09=function(_0x18b65c,_0x6c1a7f){_0x18b65c=_0x18b65c-0x0;var _0xe81320=_0xa098[_0x18b65c];return _0xe81320;};'use strict';var _=require(_0x8a09('0x0'));var util=require(_0x8a09('0x1'));var logger=require(_0x8a09('0x2'))(_0x8a09('0x3'));var moment=require(_0x8a09('0x4'));var BPromise=require(_0x8a09('0x5'));var rp=require(_0x8a09('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a09('0x7'));var config=require(_0x8a09('0x8'));var attributes=require(_0x8a09('0x9'));module[_0x8a09('0xa')]=function(_0x318c33,_0x5de56c){return _0x318c33[_0x8a09('0xb')](_0x8a09('0xc'),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 baea74e..df1ad0d 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 _0xde44=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xde44,0x160));var _0x4de4=function(_0x4bf14d,_0x2fbc1c){_0x4bf14d=_0x4bf14d-0x0;var _0x5e5e24=_0xde44[_0x4bf14d];return _0x5e5e24;};'use strict';var _=require(_0x4de4('0x0'));var util=require(_0x4de4('0x1'));var moment=require(_0x4de4('0x2'));var BPromise=require(_0x4de4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4de4('0x4'));var db=require(_0x4de4('0x5'))['db'];var utils=require(_0x4de4('0x6'));var logger=require(_0x4de4('0x7'))(_0x4de4('0x8'));var config=require('../../config/environment');var jayson=require(_0x4de4('0x9'));var client=jayson['client'][_0x4de4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x406f08,_0x4f0c11,_0x4f13e7){return new BPromise(function(_0x18b3f6,_0x2d43e5){return client[_0x4de4('0xb')](_0x406f08,_0x4f13e7)['then'](function(_0xcd37c7){logger['info'](_0x4de4('0xc'),_0x4f0c11,'request\x20sent');logger[_0x4de4('0xd')](_0x4de4('0xe'),_0x4f0c11,'request\x20sent',JSON[_0x4de4('0xf')](_0xcd37c7));if(_0xcd37c7[_0x4de4('0x10')]){if(_0xcd37c7['error']['code']===0x1f4){logger[_0x4de4('0x10')](_0x4de4('0xc'),_0x4f0c11,_0xcd37c7[_0x4de4('0x10')]['message']);return _0x2d43e5(_0xcd37c7[_0x4de4('0x10')][_0x4de4('0x11')]);}logger[_0x4de4('0x10')]('VoiceContext,\x20%s,\x20%s',_0x4f0c11,_0xcd37c7[_0x4de4('0x10')]['message']);return _0x18b3f6(_0xcd37c7[_0x4de4('0x10')][_0x4de4('0x11')]);}else{logger[_0x4de4('0x12')](_0x4de4('0xc'),_0x4f0c11,_0x4de4('0x13'));_0x18b3f6(_0xcd37c7[_0x4de4('0x14')][_0x4de4('0x11')]);}})[_0x4de4('0x15')](function(_0x5c2ef2){logger[_0x4de4('0x10')](_0x4de4('0xc'),_0x4f0c11,_0x5c2ef2);_0x2d43e5(_0x5c2ef2);});});} \ No newline at end of file +var _0x2deb=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2deb,0xdb));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var moment=require(_0xb2de('0x2'));var BPromise=require(_0xb2de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2de('0x4'))['db'];var utils=require(_0xb2de('0x5'));var logger=require(_0xb2de('0x6'))(_0xb2de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2de('0x8')][_0xb2de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191004,_0x49307b,_0x253d0b){return new BPromise(function(_0x1a4c44,_0x53ab0e){return client[_0xb2de('0xa')](_0x191004,_0x253d0b)[_0xb2de('0xb')](function(_0x1d40ec){logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));logger[_0xb2de('0xe')](_0xb2de('0xf'),_0x49307b,'request\x20sent',JSON['stringify'](_0x1d40ec));if(_0x1d40ec[_0xb2de('0x10')]){if(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x11')]===0x1f4){logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);return _0x53ab0e(_0x1d40ec['error'][_0xb2de('0x12')]);}logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec['error'][_0xb2de('0x12')]);return _0x1a4c44(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);}else{logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));_0x1a4c44(_0x1d40ec[_0xb2de('0x13')][_0xb2de('0x12')]);}})[_0xb2de('0x14')](function(_0x2dc15c){logger[_0xb2de('0x10')](_0xb2de('0xc'),_0x49307b,_0x2dc15c);_0x53ab0e(_0x2dc15c);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 8e872fb..791eb15 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 _0xaace=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xaace,0x78));var _0xeaac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaace[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xeaac('0x0'));var util=require(_0xeaac('0x1'));var path=require('path');var timeout=require(_0xeaac('0x2'));var express=require(_0xeaac('0x3'));var router=express[_0xeaac('0x4')]();var fs_extra=require(_0xeaac('0x5'));var auth=require(_0xeaac('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeaac('0x7'));var controller=require('./voiceDialReport.controller');router[_0xeaac('0x8')]('/',auth[_0xeaac('0x9')](),controller[_0xeaac('0xa')]);router[_0xeaac('0x8')](_0xeaac('0xb'),auth[_0xeaac('0x9')](),controller[_0xeaac('0xc')]);router[_0xeaac('0x8')](_0xeaac('0xd'),auth[_0xeaac('0x9')](),controller[_0xeaac('0xe')]);router[_0xeaac('0xf')]('/',auth[_0xeaac('0x9')](),controller[_0xeaac('0x10')]);router['put'](_0xeaac('0xd'),auth[_0xeaac('0x9')](),controller[_0xeaac('0x11')]);router[_0xeaac('0x12')]('/:id',auth[_0xeaac('0x9')](),controller[_0xeaac('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1a66=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','/describe','isAuthenticated','get','show','/:id'];(function(_0x23a248,_0x1a1ea5){var _0x208e9e=function(_0x1132da){while(--_0x1132da){_0x23a248['push'](_0x23a248['shift']());}};_0x208e9e(++_0x1a1ea5);}(_0x1a66,0x102));var _0x61a6=function(_0x550e7b,_0x5a4c8){_0x550e7b=_0x550e7b-0x0;var _0x47c59b=_0x1a66[_0x550e7b];return _0x47c59b;};'use strict';var multer=require(_0x61a6('0x0'));var util=require(_0x61a6('0x1'));var path=require(_0x61a6('0x2'));var timeout=require(_0x61a6('0x3'));var express=require(_0x61a6('0x4'));var router=express[_0x61a6('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x61a6('0x6'));var config=require(_0x61a6('0x7'));var controller=require(_0x61a6('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x61a6('0x9'),auth[_0x61a6('0xa')](),controller['describe']);router[_0x61a6('0xb')]('/:id',auth[_0x61a6('0xa')](),controller[_0x61a6('0xc')]);router['post']('/',auth[_0x61a6('0xa')](),controller['create']);router['put'](_0x61a6('0xd'),auth[_0x61a6('0xa')](),controller[_0x61a6('0xe')]);router[_0x61a6('0xf')]('/:id',auth[_0x61a6('0xa')](),controller[_0x61a6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index f3244dd..0c84f47 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 _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x26d4b4,_0x15726){var _0x573a69=function(_0x409479){while(--_0x409479){_0x26d4b4['push'](_0x26d4b4['shift']());}};_0x573a69(++_0x15726);}(_0xedd9,0xfc));var _0x9edd=function(_0x5d3d39,_0x5ed8a1){_0x5d3d39=_0x5d3d39-0x0;var _0x2de363=_0xedd9[_0x5d3d39];return _0x2de363;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file +var _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x4a820a,_0x2c84aa){var _0x3a97ae=function(_0x120eae){while(--_0x120eae){_0x4a820a['push'](_0x4a820a['shift']());}};_0x3a97ae(++_0x2c84aa);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x00bb[_0x3054be];return _0x3df150;};'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 efc148e..2843350 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 _0xdf0a=['status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','VoiceDialReport','findAll','rows','catch','show','params','intersection','find','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x5e1008,_0x2491e5){var _0x26f98f=function(_0x5c4eec){while(--_0x5c4eec){_0x5e1008['push'](_0x5e1008['shift']());}};_0x26f98f(++_0x2491e5);}(_0xdf0a,0x155));var _0xadf0=function(_0x39da10,_0x27166b){_0x39da10=_0x39da10-0x0;var _0x5a34a4=_0xdf0a[_0x39da10];return _0x5a34a4;};'use strict';var emlformat=require(_0xadf0('0x0'));var rimraf=require(_0xadf0('0x1'));var zipdir=require(_0xadf0('0x2'));var jsonpatch=require(_0xadf0('0x3'));var rp=require(_0xadf0('0x4'));var moment=require(_0xadf0('0x5'));var BPromise=require(_0xadf0('0x6'));var Mustache=require(_0xadf0('0x7'));var util=require('util');var path=require('path');var sox=require(_0xadf0('0x8'));var csv=require('to-csv');var ejs=require(_0xadf0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadf0('0xa'));var squel=require(_0xadf0('0xb'));var crypto=require(_0xadf0('0xc'));var jsforce=require(_0xadf0('0xd'));var deskjs=require(_0xadf0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xadf0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xadf0('0x10'));var as=require(_0xadf0('0x11'));var hardwareService=require(_0xadf0('0x12'));var logger=require(_0xadf0('0x13'))(_0xadf0('0x14'));var utils=require(_0xadf0('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xadf0('0x16'))['db'];function respondWithStatusCode(_0x563bf6,_0x1359df){_0x1359df=_0x1359df||0xcc;return function(_0x418eb0){if(_0x418eb0){return _0x563bf6[_0xadf0('0x17')](_0x1359df);}return _0x563bf6[_0xadf0('0x18')](_0x1359df)[_0xadf0('0x19')]();};}function respondWithResult(_0x373b91,_0xa0800a){_0xa0800a=_0xa0800a||0xc8;return function(_0x4360bc){if(_0x4360bc){return _0x373b91['status'](_0xa0800a)[_0xadf0('0x1a')](_0x4360bc);}};}function respondWithFilteredResult(_0x63329f,_0x2e9475){return function(_0x225567){if(_0x225567){var _0x10961c=typeof _0x2e9475[_0xadf0('0x1b')]===_0xadf0('0x1c')&&typeof _0x2e9475[_0xadf0('0x1d')]===_0xadf0('0x1c');var _0x3d8b43=_0x225567[_0xadf0('0x1e')];var _0x452867=_0x10961c?0x0:_0x2e9475[_0xadf0('0x1b')];var _0xc7bb87=_0x10961c?_0x225567['count']:_0x2e9475[_0xadf0('0x1b')]+_0x2e9475['limit'];var _0x3ff79b;if(_0xc7bb87>=_0x3d8b43){_0xc7bb87=_0x3d8b43;_0x3ff79b=0xc8;}else{_0x3ff79b=0xce;}_0x63329f[_0xadf0('0x18')](_0x3ff79b);return _0x63329f[_0xadf0('0x1f')]('Content-Range',_0x452867+'-'+_0xc7bb87+'/'+_0x3d8b43)[_0xadf0('0x1a')](_0x225567);}return null;};}function patchUpdates(_0x4f4505){return function(_0x11b950){try{jsonpatch['apply'](_0x11b950,_0x4f4505,!![]);}catch(_0x443f2e){return BPromise[_0xadf0('0x20')](_0x443f2e);}return _0x11b950[_0xadf0('0x21')]();};}function saveUpdates(_0x412798,_0x39de60){return function(_0x8fb624){if(_0x8fb624){return _0x8fb624['update'](_0x412798)[_0xadf0('0x22')](function(_0x39e7a7){return _0x39e7a7;});}return null;};}function removeEntity(_0x2f14c9,_0x413887){return function(_0x47157a){if(_0x47157a){return _0x47157a[_0xadf0('0x23')]()[_0xadf0('0x22')](function(){_0x2f14c9['status'](0xcc)[_0xadf0('0x19')]();});}};}function handleEntityNotFound(_0x426db4,_0x44dd47){return function(_0x135da7){if(!_0x135da7){_0x426db4[_0xadf0('0x17')](0x194);}return _0x135da7;};}function handleError(_0x214da3,_0x28eb11){_0x28eb11=_0x28eb11||0x1f4;return function(_0x3d6134){logger[_0xadf0('0x24')](_0x3d6134['stack']);if(_0x3d6134[_0xadf0('0x25')]){delete _0x3d6134[_0xadf0('0x25')];}_0x214da3[_0xadf0('0x18')](_0x28eb11)[_0xadf0('0x26')](_0x3d6134);};}exports['index']=function(_0x308f20,_0x58dbe1){var _0x56876b={},_0x47c11e={},_0x9a0571={'count':0x0,'rows':[]};var _0x967c23=_['map'](db['VoiceDialReport'][_0xadf0('0x27')],function(_0x476bb6){return{'name':_0x476bb6[_0xadf0('0x28')],'type':_0x476bb6['type'][_0xadf0('0x29')]};});_0x47c11e[_0xadf0('0x2a')]=_[_0xadf0('0x2b')](_0x967c23,_0xadf0('0x25'));_0x47c11e[_0xadf0('0x2c')]=_[_0xadf0('0x2d')](_0x308f20['query']);_0x47c11e[_0xadf0('0x2e')]=_['intersection'](_0x47c11e[_0xadf0('0x2a')],_0x47c11e[_0xadf0('0x2c')]);_0x56876b[_0xadf0('0x2f')]=_['intersection'](_0x47c11e[_0xadf0('0x2a')],qs['fields'](_0x308f20[_0xadf0('0x2c')][_0xadf0('0x30')]));_0x56876b[_0xadf0('0x2f')]=_0x56876b[_0xadf0('0x2f')][_0xadf0('0x31')]?_0x56876b[_0xadf0('0x2f')]:_0x47c11e[_0xadf0('0x2a')];if(!_0x308f20['query']['hasOwnProperty'](_0xadf0('0x32'))){_0x56876b['limit']=qs[_0xadf0('0x1d')](_0x308f20[_0xadf0('0x2c')][_0xadf0('0x1d')]);_0x56876b['offset']=qs[_0xadf0('0x1b')](_0x308f20[_0xadf0('0x2c')][_0xadf0('0x1b')]);}_0x56876b[_0xadf0('0x33')]=qs[_0xadf0('0x34')](_0x308f20['query'][_0xadf0('0x34')]);_0x56876b[_0xadf0('0x35')]=qs[_0xadf0('0x2e')](_[_0xadf0('0x36')](_0x308f20[_0xadf0('0x2c')],_0x47c11e[_0xadf0('0x2e')]),_0x967c23);if(_0x308f20[_0xadf0('0x2c')][_0xadf0('0x37')]){_0x56876b[_0xadf0('0x35')]=_[_0xadf0('0x38')](_0x56876b[_0xadf0('0x35')],{'$or':_[_0xadf0('0x2b')](_0x967c23,function(_0x3514aa){if(_0x3514aa[_0xadf0('0x39')]!==_0xadf0('0x3a')){var _0x4a64c6={};_0x4a64c6[_0x3514aa[_0xadf0('0x25')]]={'$like':'%'+_0x308f20[_0xadf0('0x2c')]['filter']+'%'};return _0x4a64c6;}})});}_0x56876b=_[_0xadf0('0x38')]({},_0x56876b,_0x308f20[_0xadf0('0x3b')]);var _0x17c5fd={'where':_0x56876b[_0xadf0('0x35')]};return db['VoiceDialReport'][_0xadf0('0x1e')](_0x17c5fd)['then'](function(_0x4ec57f){_0x9a0571['count']=_0x4ec57f;if(_0x308f20['query'][_0xadf0('0x3c')]){_0x56876b[_0xadf0('0x3d')]=[{'all':!![]}];}return db[_0xadf0('0x3e')][_0xadf0('0x3f')](_0x56876b);})[_0xadf0('0x22')](function(_0xf51414){_0x9a0571[_0xadf0('0x40')]=_0xf51414;return _0x9a0571;})[_0xadf0('0x22')](respondWithFilteredResult(_0x58dbe1,_0x56876b))[_0xadf0('0x41')](handleError(_0x58dbe1,null));};exports[_0xadf0('0x42')]=function(_0x4ac8f7,_0x2ae83f){var _0x41af8e={'raw':!![],'where':{'id':_0x4ac8f7[_0xadf0('0x43')]['id']}},_0x47ad2c={};_0x47ad2c[_0xadf0('0x2a')]=_[_0xadf0('0x2d')](db[_0xadf0('0x3e')]['rawAttributes']);_0x47ad2c[_0xadf0('0x2c')]=_[_0xadf0('0x2d')](_0x4ac8f7['query']);_0x47ad2c[_0xadf0('0x2e')]=_[_0xadf0('0x44')](_0x47ad2c[_0xadf0('0x2a')],_0x47ad2c[_0xadf0('0x2c')]);_0x41af8e['attributes']=_[_0xadf0('0x44')](_0x47ad2c[_0xadf0('0x2a')],qs[_0xadf0('0x30')](_0x4ac8f7[_0xadf0('0x2c')][_0xadf0('0x30')]));_0x41af8e[_0xadf0('0x2f')]=_0x41af8e[_0xadf0('0x2f')][_0xadf0('0x31')]?_0x41af8e[_0xadf0('0x2f')]:_0x47ad2c[_0xadf0('0x2a')];if(_0x4ac8f7[_0xadf0('0x2c')]['includeAll']){_0x41af8e[_0xadf0('0x3d')]=[{'all':!![]}];}_0x41af8e=_[_0xadf0('0x38')]({},_0x41af8e,_0x4ac8f7[_0xadf0('0x3b')]);return db[_0xadf0('0x3e')][_0xadf0('0x45')](_0x41af8e)[_0xadf0('0x22')](handleEntityNotFound(_0x2ae83f,null))[_0xadf0('0x22')](respondWithResult(_0x2ae83f,null))[_0xadf0('0x41')](handleError(_0x2ae83f,null));};exports['create']=function(_0x3c83fd,_0x186d4f){return db[_0xadf0('0x3e')]['create'](_0x3c83fd[_0xadf0('0x46')],{})[_0xadf0('0x22')](respondWithResult(_0x186d4f,0xc9))['catch'](handleError(_0x186d4f,null));};exports[_0xadf0('0x47')]=function(_0x364af4,_0x1db360){if(_0x364af4[_0xadf0('0x46')]['id']){delete _0x364af4[_0xadf0('0x46')]['id'];}return db['VoiceDialReport'][_0xadf0('0x45')]({'where':{'id':_0x364af4[_0xadf0('0x43')]['id']}})[_0xadf0('0x22')](handleEntityNotFound(_0x1db360,null))[_0xadf0('0x22')](saveUpdates(_0x364af4[_0xadf0('0x46')],null))[_0xadf0('0x22')](respondWithResult(_0x1db360,null))['catch'](handleError(_0x1db360,null));};exports[_0xadf0('0x23')]=function(_0x22c42a,_0x180793){return db['VoiceDialReport']['find']({'where':{'id':_0x22c42a[_0xadf0('0x43')]['id']}})[_0xadf0('0x22')](handleEntityNotFound(_0x180793,null))[_0xadf0('0x22')](removeEntity(_0x180793,null))[_0xadf0('0x41')](handleError(_0x180793,null));};exports[_0xadf0('0x48')]=function(_0x48a6be,_0x5d9c93){return db[_0xadf0('0x3e')][_0xadf0('0x48')]()[_0xadf0('0x22')](respondWithResult(_0x5d9c93,null))[_0xadf0('0x41')](handleError(_0x5d9c93,null));}; \ No newline at end of file +var _0x2ee2=['status','json','offset','undefined','count','limit','set','reject','update','then','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4b44c7,_0x4083f5){var _0x178a85=function(_0x48f366){while(--_0x48f366){_0x4b44c7['push'](_0x4b44c7['shift']());}};_0x178a85(++_0x4083f5);}(_0x2ee2,0x149));var _0x22ee=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x2ee2[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x22ee('0x0'));var rimraf=require(_0x22ee('0x1'));var zipdir=require(_0x22ee('0x2'));var jsonpatch=require(_0x22ee('0x3'));var rp=require('request-promise');var moment=require(_0x22ee('0x4'));var BPromise=require(_0x22ee('0x5'));var Mustache=require('mustache');var util=require(_0x22ee('0x6'));var path=require(_0x22ee('0x7'));var sox=require(_0x22ee('0x8'));var csv=require(_0x22ee('0x9'));var ejs=require(_0x22ee('0xa'));var fs=require('fs');var fs_extra=require(_0x22ee('0xb'));var _=require(_0x22ee('0xc'));var squel=require('squel');var crypto=require(_0x22ee('0xd'));var jsforce=require(_0x22ee('0xe'));var deskjs=require(_0x22ee('0xf'));var toCsv=require(_0x22ee('0x9'));var querystring=require(_0x22ee('0x10'));var Papa=require(_0x22ee('0x11'));var Redis=require(_0x22ee('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x22ee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x22ee('0x14'));var utils=require(_0x22ee('0x15'));var config=require(_0x22ee('0x16'));var licenseUtil=require(_0x22ee('0x17'));var db=require(_0x22ee('0x18'))['db'];function respondWithStatusCode(_0x5ec200,_0x49cf1a){_0x49cf1a=_0x49cf1a||0xcc;return function(_0x37be22){if(_0x37be22){return _0x5ec200[_0x22ee('0x19')](_0x49cf1a);}return _0x5ec200[_0x22ee('0x1a')](_0x49cf1a)['end']();};}function respondWithResult(_0x13e6c0,_0x36e0d2){_0x36e0d2=_0x36e0d2||0xc8;return function(_0x551581){if(_0x551581){return _0x13e6c0['status'](_0x36e0d2)[_0x22ee('0x1b')](_0x551581);}};}function respondWithFilteredResult(_0x1f1d45,_0xb8704d){return function(_0xe54d0b){if(_0xe54d0b){var _0x19d1b3=typeof _0xb8704d[_0x22ee('0x1c')]===_0x22ee('0x1d')&&typeof _0xb8704d['limit']===_0x22ee('0x1d');var _0x4d6f27=_0xe54d0b[_0x22ee('0x1e')];var _0x34b587=_0x19d1b3?0x0:_0xb8704d[_0x22ee('0x1c')];var _0x5006eb=_0x19d1b3?_0xe54d0b['count']:_0xb8704d[_0x22ee('0x1c')]+_0xb8704d[_0x22ee('0x1f')];var _0x40c20d;if(_0x5006eb>=_0x4d6f27){_0x5006eb=_0x4d6f27;_0x40c20d=0xc8;}else{_0x40c20d=0xce;}_0x1f1d45[_0x22ee('0x1a')](_0x40c20d);return _0x1f1d45[_0x22ee('0x20')]('Content-Range',_0x34b587+'-'+_0x5006eb+'/'+_0x4d6f27)[_0x22ee('0x1b')](_0xe54d0b);}return null;};}function patchUpdates(_0x362355){return function(_0x44616e){try{jsonpatch['apply'](_0x44616e,_0x362355,!![]);}catch(_0x3c02e5){return BPromise[_0x22ee('0x21')](_0x3c02e5);}return _0x44616e['save']();};}function saveUpdates(_0x13976c,_0x2a174e){return function(_0x8c19a9){if(_0x8c19a9){return _0x8c19a9[_0x22ee('0x22')](_0x13976c)[_0x22ee('0x23')](function(_0x4753eb){return _0x4753eb;});}return null;};}function removeEntity(_0x36a746,_0x590a49){return function(_0x41e373){if(_0x41e373){return _0x41e373['destroy']()[_0x22ee('0x23')](function(){_0x36a746['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30712c,_0x35b0bc){return function(_0x1fb2d0){if(!_0x1fb2d0){_0x30712c[_0x22ee('0x19')](0x194);}return _0x1fb2d0;};}function handleError(_0x564948,_0x213b67){_0x213b67=_0x213b67||0x1f4;return function(_0x257403){logger[_0x22ee('0x24')](_0x257403['stack']);if(_0x257403['name']){delete _0x257403[_0x22ee('0x25')];}_0x564948[_0x22ee('0x1a')](_0x213b67)[_0x22ee('0x26')](_0x257403);};}exports[_0x22ee('0x27')]=function(_0x2e7c72,_0xbae3cd){var _0x180185={},_0x4bb1c6={},_0x30090a={'count':0x0,'rows':[]};var _0x2dfb96=_['map'](db['VoiceDialReport'][_0x22ee('0x28')],function(_0x3baa11){return{'name':_0x3baa11[_0x22ee('0x29')],'type':_0x3baa11[_0x22ee('0x2a')]['key']};});_0x4bb1c6['model']=_[_0x22ee('0x2b')](_0x2dfb96,_0x22ee('0x25'));_0x4bb1c6[_0x22ee('0x2c')]=_[_0x22ee('0x2d')](_0x2e7c72[_0x22ee('0x2c')]);_0x4bb1c6['filters']=_['intersection'](_0x4bb1c6[_0x22ee('0x2e')],_0x4bb1c6[_0x22ee('0x2c')]);_0x180185[_0x22ee('0x2f')]=_[_0x22ee('0x30')](_0x4bb1c6[_0x22ee('0x2e')],qs[_0x22ee('0x31')](_0x2e7c72[_0x22ee('0x2c')]['fields']));_0x180185[_0x22ee('0x2f')]=_0x180185['attributes'][_0x22ee('0x32')]?_0x180185['attributes']:_0x4bb1c6[_0x22ee('0x2e')];if(!_0x2e7c72[_0x22ee('0x2c')][_0x22ee('0x33')]('nolimit')){_0x180185[_0x22ee('0x1f')]=qs[_0x22ee('0x1f')](_0x2e7c72[_0x22ee('0x2c')][_0x22ee('0x1f')]);_0x180185['offset']=qs[_0x22ee('0x1c')](_0x2e7c72[_0x22ee('0x2c')][_0x22ee('0x1c')]);}_0x180185['order']=qs[_0x22ee('0x34')](_0x2e7c72[_0x22ee('0x2c')][_0x22ee('0x34')]);_0x180185[_0x22ee('0x35')]=qs['filters'](_['pick'](_0x2e7c72[_0x22ee('0x2c')],_0x4bb1c6[_0x22ee('0x36')]),_0x2dfb96);if(_0x2e7c72[_0x22ee('0x2c')][_0x22ee('0x37')]){_0x180185['where']=_[_0x22ee('0x38')](_0x180185['where'],{'$or':_[_0x22ee('0x2b')](_0x2dfb96,function(_0x4b4ba8){if(_0x4b4ba8[_0x22ee('0x2a')]!==_0x22ee('0x39')){var _0x392292={};_0x392292[_0x4b4ba8[_0x22ee('0x25')]]={'$like':'%'+_0x2e7c72[_0x22ee('0x2c')][_0x22ee('0x37')]+'%'};return _0x392292;}})});}_0x180185=_[_0x22ee('0x38')]({},_0x180185,_0x2e7c72[_0x22ee('0x3a')]);var _0x432042={'where':_0x180185[_0x22ee('0x35')]};return db[_0x22ee('0x3b')][_0x22ee('0x1e')](_0x432042)[_0x22ee('0x23')](function(_0x2d73f5){_0x30090a[_0x22ee('0x1e')]=_0x2d73f5;if(_0x2e7c72[_0x22ee('0x2c')][_0x22ee('0x3c')]){_0x180185[_0x22ee('0x3d')]=[{'all':!![]}];}return db[_0x22ee('0x3b')][_0x22ee('0x3e')](_0x180185);})[_0x22ee('0x23')](function(_0x11d651){_0x30090a['rows']=_0x11d651;return _0x30090a;})['then'](respondWithFilteredResult(_0xbae3cd,_0x180185))['catch'](handleError(_0xbae3cd,null));};exports[_0x22ee('0x3f')]=function(_0x49bdbd,_0x249fa1){var _0x107d6b={'raw':!![],'where':{'id':_0x49bdbd[_0x22ee('0x40')]['id']}},_0x4c69b3={};_0x4c69b3[_0x22ee('0x2e')]=_[_0x22ee('0x2d')](db['VoiceDialReport'][_0x22ee('0x28')]);_0x4c69b3[_0x22ee('0x2c')]=_[_0x22ee('0x2d')](_0x49bdbd[_0x22ee('0x2c')]);_0x4c69b3[_0x22ee('0x36')]=_['intersection'](_0x4c69b3['model'],_0x4c69b3[_0x22ee('0x2c')]);_0x107d6b['attributes']=_[_0x22ee('0x30')](_0x4c69b3[_0x22ee('0x2e')],qs[_0x22ee('0x31')](_0x49bdbd[_0x22ee('0x2c')]['fields']));_0x107d6b[_0x22ee('0x2f')]=_0x107d6b['attributes'][_0x22ee('0x32')]?_0x107d6b[_0x22ee('0x2f')]:_0x4c69b3[_0x22ee('0x2e')];if(_0x49bdbd[_0x22ee('0x2c')][_0x22ee('0x3c')]){_0x107d6b[_0x22ee('0x3d')]=[{'all':!![]}];}_0x107d6b=_['merge']({},_0x107d6b,_0x49bdbd[_0x22ee('0x3a')]);return db[_0x22ee('0x3b')][_0x22ee('0x41')](_0x107d6b)[_0x22ee('0x23')](handleEntityNotFound(_0x249fa1,null))[_0x22ee('0x23')](respondWithResult(_0x249fa1,null))[_0x22ee('0x42')](handleError(_0x249fa1,null));};exports[_0x22ee('0x43')]=function(_0x205142,_0x4ca624){return db[_0x22ee('0x3b')][_0x22ee('0x43')](_0x205142[_0x22ee('0x44')],{})[_0x22ee('0x23')](respondWithResult(_0x4ca624,0xc9))['catch'](handleError(_0x4ca624,null));};exports[_0x22ee('0x22')]=function(_0x44e605,_0x1c47ab){if(_0x44e605[_0x22ee('0x44')]['id']){delete _0x44e605[_0x22ee('0x44')]['id'];}return db[_0x22ee('0x3b')][_0x22ee('0x41')]({'where':{'id':_0x44e605[_0x22ee('0x40')]['id']}})[_0x22ee('0x23')](handleEntityNotFound(_0x1c47ab,null))[_0x22ee('0x23')](saveUpdates(_0x44e605[_0x22ee('0x44')],null))[_0x22ee('0x23')](respondWithResult(_0x1c47ab,null))[_0x22ee('0x42')](handleError(_0x1c47ab,null));};exports[_0x22ee('0x45')]=function(_0x1a166c,_0x507e27){return db[_0x22ee('0x3b')][_0x22ee('0x41')]({'where':{'id':_0x1a166c[_0x22ee('0x40')]['id']}})[_0x22ee('0x23')](handleEntityNotFound(_0x507e27,null))[_0x22ee('0x23')](removeEntity(_0x507e27,null))['catch'](handleError(_0x507e27,null));};exports[_0x22ee('0x46')]=function(_0x61f693,_0xec7d6d){return db[_0x22ee('0x3b')][_0x22ee('0x46')]()['then'](respondWithResult(_0xec7d6d,null))[_0x22ee('0x42')](handleError(_0xec7d6d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 691de93..2cc2803 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 _0x5251=['report_dial','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','VoiceDialReport'];(function(_0x4670cb,_0x3ed3b8){var _0x2af1e6=function(_0x5376f6){while(--_0x5376f6){_0x4670cb['push'](_0x4670cb['shift']());}};_0x2af1e6(++_0x3ed3b8);}(_0x5251,0x1c9));var _0x1525=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5251[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1525('0x0'));var util=require(_0x1525('0x1'));var logger=require(_0x1525('0x2'))(_0x1525('0x3'));var moment=require(_0x1525('0x4'));var BPromise=require(_0x1525('0x5'));var rp=require(_0x1525('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1525('0x7'));var config=require(_0x1525('0x8'));var attributes=require(_0x1525('0x9'));module['exports']=function(_0x354664,_0x386b9f){return _0x354664['define'](_0x1525('0xa'),attributes,{'tableName':_0x1525('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb10=['path','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a1844,_0xf6c4ef){var _0x1a11c4=function(_0x55c2c6){while(--_0x55c2c6){_0x4a1844['push'](_0x4a1844['shift']());}};_0x1a11c4(++_0xf6c4ef);}(_0xdb10,0xd2));var _0x0db1=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xdb10[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x0db1('0x0'));var util=require('util');var logger=require(_0x0db1('0x1'))(_0x0db1('0x2'));var moment=require(_0x0db1('0x3'));var BPromise=require(_0x0db1('0x4'));var rp=require(_0x0db1('0x5'));var fs=require('fs');var path=require(_0x0db1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0db1('0x7'));module[_0x0db1('0x8')]=function(_0x14facd,_0x5a06fe){return _0x14facd[_0x0db1('0x9')](_0x0db1('0xa'),attributes,{'tableName':_0x0db1('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 aa127ad..509bf58 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 _0x3863=['VoiceDialReport','body','options','raw','then','CreateVoiceDialReport','UpdateVoiceDialReport','update','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','debug','request\x20sent','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch'];(function(_0x398f8b,_0x4e70bf){var _0x18ca6c=function(_0x374682){while(--_0x374682){_0x398f8b['push'](_0x398f8b['shift']());}};_0x18ca6c(++_0x4e70bf);}(_0x3863,0x18f));var _0x3386=function(_0x5d1762,_0x52265f){_0x5d1762=_0x5d1762-0x0;var _0x181a4d=_0x3863[_0x5d1762];return _0x181a4d;};'use strict';var _=require('lodash');var util=require(_0x3386('0x0'));var moment=require(_0x3386('0x1'));var BPromise=require(_0x3386('0x2'));var rs=require(_0x3386('0x3'));var fs=require('fs');var Redis=require(_0x3386('0x4'));var db=require(_0x3386('0x5'))['db'];var utils=require(_0x3386('0x6'));var logger=require('../../config/logger')(_0x3386('0x7'));var config=require(_0x3386('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3386('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4eac89,_0xb0055f,_0x5688aa){return new BPromise(function(_0x1184f7,_0xae412){return client[_0x3386('0xa')](_0x4eac89,_0x5688aa)['then'](function(_0x519abe){logger[_0x3386('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0xb0055f,'request\x20sent');logger[_0x3386('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0xb0055f,_0x3386('0xd'),JSON[_0x3386('0xe')](_0x519abe));if(_0x519abe['error']){if(_0x519abe[_0x3386('0xf')][_0x3386('0x10')]===0x1f4){logger['error'](_0x3386('0x11'),_0xb0055f,_0x519abe[_0x3386('0xf')][_0x3386('0x12')]);return _0xae412(_0x519abe[_0x3386('0xf')][_0x3386('0x12')]);}logger[_0x3386('0xf')](_0x3386('0x11'),_0xb0055f,_0x519abe[_0x3386('0xf')][_0x3386('0x12')]);return _0x1184f7(_0x519abe[_0x3386('0xf')][_0x3386('0x12')]);}else{logger[_0x3386('0xb')](_0x3386('0x11'),_0xb0055f,_0x3386('0xd'));_0x1184f7(_0x519abe[_0x3386('0x13')][_0x3386('0x12')]);}})[_0x3386('0x14')](function(_0x515418){logger[_0x3386('0xf')](_0x3386('0x11'),_0xb0055f,_0x515418);_0xae412(_0x515418);});});}exports['CreateVoiceDialReport']=function(_0x355761){var _0x475034=this;return new Promise(function(_0x596e68,_0x599b1c){return db[_0x3386('0x15')]['create'](_0x355761[_0x3386('0x16')],{'raw':_0x355761[_0x3386('0x17')]?_0x355761[_0x3386('0x17')][_0x3386('0x18')]===undefined?!![]:![]:!![]})[_0x3386('0x19')](function(_0xb8272c){logger[_0x3386('0xb')](_0x3386('0x1a'),_0x355761);logger[_0x3386('0xc')]('CreateVoiceDialReport',_0x355761,JSON[_0x3386('0xe')](_0xb8272c));_0x596e68(_0xb8272c);})[_0x3386('0x14')](function(_0x715296){logger['error']('CreateVoiceDialReport',_0x715296[_0x3386('0x12')],_0x355761);_0x599b1c(_0x475034[_0x3386('0xf')](0x1f4,_0x715296[_0x3386('0x12')]));});});};exports[_0x3386('0x1b')]=function(_0x2d7c2d){var _0x89d451=this;return new Promise(function(_0x17dfb2,_0x39d87c){return db[_0x3386('0x15')][_0x3386('0x1c')](_0x2d7c2d[_0x3386('0x16')],{'raw':_0x2d7c2d[_0x3386('0x17')]?_0x2d7c2d[_0x3386('0x17')][_0x3386('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d7c2d[_0x3386('0x17')]?_0x2d7c2d['options']['where']||null:null,'attributes':_0x2d7c2d[_0x3386('0x17')]?_0x2d7c2d[_0x3386('0x17')][_0x3386('0x1d')]||null:null,'limit':_0x2d7c2d['options']?_0x2d7c2d[_0x3386('0x17')]['limit']||null:null})['then'](function(_0x53e864){logger[_0x3386('0xb')]('UpdateVoiceDialReport',_0x2d7c2d);logger['debug']('UpdateVoiceDialReport',_0x2d7c2d,JSON[_0x3386('0xe')](_0x53e864));_0x17dfb2(_0x53e864);})[_0x3386('0x14')](function(_0x50f867){logger[_0x3386('0xf')](_0x3386('0x1b'),_0x50f867[_0x3386('0x12')],_0x2d7c2d);_0x39d87c(_0x89d451['error'](0x1f4,_0x50f867[_0x3386('0x12')]));});});}; \ No newline at end of file +var _0x0da6=['error','code','message','request\x20sent','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','UpdateVoiceDialReport','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x0da6,0x72));var _0x60da=function(_0x175756,_0x4450bc){_0x175756=_0x175756-0x0;var _0x3be0a6=_0x0da6[_0x175756];return _0x3be0a6;};'use strict';var _=require(_0x60da('0x0'));var util=require('util');var moment=require(_0x60da('0x1'));var BPromise=require(_0x60da('0x2'));var rs=require(_0x60da('0x3'));var fs=require('fs');var Redis=require(_0x60da('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x60da('0x5'));var logger=require('../../config/logger')(_0x60da('0x6'));var config=require(_0x60da('0x7'));var jayson=require(_0x60da('0x8'));var client=jayson[_0x60da('0x9')][_0x60da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22c35e,_0x5aebc5,_0x42f871){return new BPromise(function(_0xc4d4d2,_0x53b6f0){return client[_0x60da('0xb')](_0x22c35e,_0x42f871)[_0x60da('0xc')](function(_0x419e72){logger[_0x60da('0xd')](_0x60da('0xe'),_0x5aebc5,'request\x20sent');logger[_0x60da('0xf')](_0x60da('0x10'),_0x5aebc5,'request\x20sent',JSON[_0x60da('0x11')](_0x419e72));if(_0x419e72[_0x60da('0x12')]){if(_0x419e72[_0x60da('0x12')][_0x60da('0x13')]===0x1f4){logger[_0x60da('0x12')](_0x60da('0xe'),_0x5aebc5,_0x419e72[_0x60da('0x12')][_0x60da('0x14')]);return _0x53b6f0(_0x419e72[_0x60da('0x12')][_0x60da('0x14')]);}logger[_0x60da('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x5aebc5,_0x419e72[_0x60da('0x12')][_0x60da('0x14')]);return _0xc4d4d2(_0x419e72[_0x60da('0x12')]['message']);}else{logger[_0x60da('0xd')](_0x60da('0xe'),_0x5aebc5,_0x60da('0x15'));_0xc4d4d2(_0x419e72[_0x60da('0x16')][_0x60da('0x14')]);}})['catch'](function(_0x5f373b){logger['error'](_0x60da('0xe'),_0x5aebc5,_0x5f373b);_0x53b6f0(_0x5f373b);});});}exports[_0x60da('0x17')]=function(_0x204f72){var _0x1cc389=this;return new Promise(function(_0x39c5cd,_0x4589cf){return db[_0x60da('0x18')][_0x60da('0x19')](_0x204f72[_0x60da('0x1a')],{'raw':_0x204f72[_0x60da('0x1b')]?_0x204f72[_0x60da('0x1b')][_0x60da('0x1c')]===undefined?!![]:![]:!![]})[_0x60da('0xc')](function(_0xdce375){logger[_0x60da('0xd')](_0x60da('0x17'),_0x204f72);logger[_0x60da('0xf')](_0x60da('0x17'),_0x204f72,JSON['stringify'](_0xdce375));_0x39c5cd(_0xdce375);})[_0x60da('0x1d')](function(_0x5ace91){logger[_0x60da('0x12')](_0x60da('0x17'),_0x5ace91[_0x60da('0x14')],_0x204f72);_0x4589cf(_0x1cc389[_0x60da('0x12')](0x1f4,_0x5ace91[_0x60da('0x14')]));});});};exports[_0x60da('0x1e')]=function(_0x16b276){var _0x2023ea=this;return new Promise(function(_0x50f044,_0x4c7177){return db[_0x60da('0x18')]['update'](_0x16b276['body'],{'raw':_0x16b276[_0x60da('0x1b')]?_0x16b276[_0x60da('0x1b')][_0x60da('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16b276['options']?_0x16b276[_0x60da('0x1b')][_0x60da('0x1f')]||null:null,'attributes':_0x16b276[_0x60da('0x1b')]?_0x16b276['options'][_0x60da('0x20')]||null:null,'limit':_0x16b276['options']?_0x16b276[_0x60da('0x1b')]['limit']||null:null})[_0x60da('0xc')](function(_0x4d473c){logger[_0x60da('0xd')]('UpdateVoiceDialReport',_0x16b276);logger['debug'](_0x60da('0x1e'),_0x16b276,JSON[_0x60da('0x11')](_0x4d473c));_0x50f044(_0x4d473c);})[_0x60da('0x1d')](function(_0x221080){logger[_0x60da('0x12')]('UpdateVoiceDialReport',_0x221080[_0x60da('0x14')],_0x16b276);_0x4c7177(_0x2023ea[_0x60da('0x12')](0x1f4,_0x221080[_0x60da('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 7a8cb5e..1d3fa38 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 _0xaa3f=['/:id','post','create','/:id/applications','addApplications','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get'];(function(_0x548503,_0x1aa00c){var _0xf8f05f=function(_0x2014c2){while(--_0x2014c2){_0x548503['push'](_0x548503['shift']());}};_0xf8f05f(++_0x1aa00c);}(_0xaa3f,0x86));var _0xfaa3=function(_0x1d1d57,_0x52cd46){_0x1d1d57=_0x1d1d57-0x0;var _0x73a2eb=_0xaa3f[_0x1d1d57];return _0x73a2eb;};'use strict';var multer=require('multer');var util=require(_0xfaa3('0x0'));var path=require(_0xfaa3('0x1'));var timeout=require(_0xfaa3('0x2'));var express=require(_0xfaa3('0x3'));var router=express[_0xfaa3('0x4')]();var fs_extra=require(_0xfaa3('0x5'));var auth=require(_0xfaa3('0x6'));var interaction=require(_0xfaa3('0x7'));var config=require(_0xfaa3('0x8'));var controller=require(_0xfaa3('0x9'));router['get']('/',auth[_0xfaa3('0xa')](),controller[_0xfaa3('0xb')]);router[_0xfaa3('0xc')](_0xfaa3('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xfaa3('0xe')]('/',auth[_0xfaa3('0xa')](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0xe')](_0xfaa3('0x10'),auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x11')]);router[_0xfaa3('0x12')](_0xfaa3('0xd'),auth['isAuthenticated'](),controller[_0xfaa3('0x13')]);router[_0xfaa3('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xebc5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','addApplications','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x12dd11,_0x52b882){var _0x3a502b=function(_0x1a660d){while(--_0x1a660d){_0x12dd11['push'](_0x12dd11['shift']());}};_0x3a502b(++_0x52b882);}(_0xebc5,0x1ef));var _0x5ebc=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xebc5[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require(_0x5ebc('0x0'));var util=require(_0x5ebc('0x1'));var path=require(_0x5ebc('0x2'));var timeout=require(_0x5ebc('0x3'));var express=require(_0x5ebc('0x4'));var router=express[_0x5ebc('0x5')]();var fs_extra=require(_0x5ebc('0x6'));var auth=require(_0x5ebc('0x7'));var interaction=require(_0x5ebc('0x8'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x5ebc('0x9')]('/',auth[_0x5ebc('0xa')](),controller[_0x5ebc('0xb')]);router[_0x5ebc('0x9')](_0x5ebc('0xc'),auth['isAuthenticated'](),controller[_0x5ebc('0xd')]);router[_0x5ebc('0xe')]('/',auth[_0x5ebc('0xa')](),controller[_0x5ebc('0xf')]);router[_0x5ebc('0xe')]('/:id/applications',auth[_0x5ebc('0xa')](),controller[_0x5ebc('0x10')]);router[_0x5ebc('0x11')](_0x5ebc('0xc'),auth['isAuthenticated'](),controller[_0x5ebc('0x12')]);router[_0x5ebc('0x13')]('/:id',auth[_0x5ebc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 781a520..ac735b1 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 _0x2886=['compositeIndex','STRING','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2886,0x8e));var _0x6288=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2886[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6288('0x0'));module[_0x6288('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6288('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6288('0x3')],'allowNull':![],'unique':_0x6288('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x6288('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6288('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x6288('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x6288('0x4'),_0x6288('0x5'),_0x6288('0x6'),_0x6288('0x7'),_0x6288('0x8'),_0x6288('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6288('0x3')],'allowNull':![],'defaultValue':_0x6288('0xa')},'IntervalId':{'type':Sequelize[_0x6288('0xb')]},'isApp':{'type':Sequelize[_0x6288('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6288('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6288('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x6288('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x6288('0x3')],'defaultValue':_0x6288('0xd')},'answer':{'type':Sequelize[_0x6288('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6288('0xe')],'get':function(_0xb5e711){return this['getDataValue'](_0x6288('0xf'));}},'alias':{'type':Sequelize[_0x6288('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x41d7=['outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','STRING','compositeIndex','NoOp','inbound','internal','inbound-fax'];(function(_0x2fc7eb,_0x2e6e71){var _0x3ff326=function(_0xf2f614){while(--_0xf2f614){_0x2fc7eb['push'](_0x2fc7eb['shift']());}};_0x3ff326(++_0x2e6e71);}(_0x41d7,0xbd));var _0x741d=function(_0x98d8c2,_0x30476a){_0x98d8c2=_0x98d8c2-0x0;var _0x203dc7=_0x41d7[_0x98d8c2];return _0x203dc7;};'use strict';var Sequelize=require(_0x741d('0x0'));module['exports']={'context':{'type':Sequelize[_0x741d('0x1')],'allowNull':![],'unique':_0x741d('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x741d('0x2')},'priority':{'type':Sequelize[_0x741d('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x741d('0x2')},'tag':{'type':Sequelize[_0x741d('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x741d('0x1')],'allowNull':![],'defaultValue':_0x741d('0x3')},'appdata':{'type':Sequelize[_0x741d('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x741d('0x4'),'outbound',_0x741d('0x5'),_0x741d('0x6'),_0x741d('0x7'),_0x741d('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x741d('0x1')]},'interval':{'type':Sequelize[_0x741d('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x741d('0x9')]},'isApp':{'type':Sequelize[_0x741d('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x741d('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x741d('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x741d('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x741d('0x1')],'defaultValue':_0x741d('0xb')},'answer':{'type':Sequelize[_0x741d('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x741d('0xc')],'get':function(_0x51763c){return this[_0x741d('0xd')]('exten');}},'alias':{'type':Sequelize[_0x741d('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 0096f75..1f85af8 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 _0xaa27=['intersection','fields','attributes','length','model','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','create','body','startsWith','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','recordingFormat','mandatoryDisposition','alias','context','addApplications','findOne','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','key','query','keys','filters'];(function(_0x3f6cdf,_0x38e613){var _0x181f5c=function(_0xef2782){while(--_0xef2782){_0x3f6cdf['push'](_0x3f6cdf['shift']());}};_0x181f5c(++_0x38e613);}(_0xaa27,0x96));var _0x7aa2=function(_0x597cc0,_0x13cb73){_0x597cc0=_0x597cc0-0x0;var _0xd18345=_0xaa27[_0x597cc0];return _0xd18345;};'use strict';var emlformat=require(_0x7aa2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7aa2('0x1'));var jsonpatch=require(_0x7aa2('0x2'));var rp=require('request-promise');var moment=require(_0x7aa2('0x3'));var BPromise=require(_0x7aa2('0x4'));var Mustache=require('mustache');var util=require(_0x7aa2('0x5'));var path=require(_0x7aa2('0x6'));var sox=require('sox');var csv=require(_0x7aa2('0x7'));var ejs=require(_0x7aa2('0x8'));var fs=require('fs');var fs_extra=require(_0x7aa2('0x9'));var _=require(_0x7aa2('0xa'));var squel=require(_0x7aa2('0xb'));var crypto=require(_0x7aa2('0xc'));var jsforce=require(_0x7aa2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7aa2('0xe'));var Papa=require(_0x7aa2('0xf'));var Redis=require('ioredis');var authService=require(_0x7aa2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7aa2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7aa2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7aa2('0x13'));var db=require(_0x7aa2('0x14'))['db'];config[_0x7aa2('0x15')]=_[_0x7aa2('0x16')](config[_0x7aa2('0x15')],{'host':_0x7aa2('0x17'),'port':0x18eb});var socket=require(_0x7aa2('0x18'))(new Redis(config[_0x7aa2('0x15')]));require(_0x7aa2('0x19'))[_0x7aa2('0x1a')](socket);function respondWithStatusCode(_0x2f1f69,_0x2560b6){_0x2560b6=_0x2560b6||0xcc;return function(_0x2988ce){if(_0x2988ce){return _0x2f1f69[_0x7aa2('0x1b')](_0x2560b6);}return _0x2f1f69[_0x7aa2('0x1c')](_0x2560b6)[_0x7aa2('0x1d')]();};}function respondWithResult(_0x237168,_0x35556e){_0x35556e=_0x35556e||0xc8;return function(_0x33f04b){if(_0x33f04b){return _0x237168['status'](_0x35556e)['json'](_0x33f04b);}};}function respondWithFilteredResult(_0xafd643,_0xa38396){return function(_0x27d135){if(_0x27d135){var _0x23f3b3=typeof _0xa38396[_0x7aa2('0x1e')]==='undefined'&&typeof _0xa38396[_0x7aa2('0x1f')]==='undefined';var _0x46c8a6=_0x27d135[_0x7aa2('0x20')];var _0x418f4f=_0x23f3b3?0x0:_0xa38396[_0x7aa2('0x1e')];var _0x232d16=_0x23f3b3?_0x27d135[_0x7aa2('0x20')]:_0xa38396[_0x7aa2('0x1e')]+_0xa38396[_0x7aa2('0x1f')];var _0x3554ce;if(_0x232d16>=_0x46c8a6){_0x232d16=_0x46c8a6;_0x3554ce=0xc8;}else{_0x3554ce=0xce;}_0xafd643[_0x7aa2('0x1c')](_0x3554ce);return _0xafd643[_0x7aa2('0x21')](_0x7aa2('0x22'),_0x418f4f+'-'+_0x232d16+'/'+_0x46c8a6)[_0x7aa2('0x23')](_0x27d135);}return null;};}function patchUpdates(_0xf35ba1){return function(_0x260205){try{jsonpatch[_0x7aa2('0x24')](_0x260205,_0xf35ba1,!![]);}catch(_0x567243){return BPromise[_0x7aa2('0x25')](_0x567243);}return _0x260205[_0x7aa2('0x26')]();};}function saveUpdates(_0x19b777,_0x54e938){return function(_0x58ce62){if(_0x58ce62){return _0x58ce62['update'](_0x19b777)[_0x7aa2('0x27')](function(_0x10e07e){return _0x10e07e;});}return null;};}function removeEntity(_0xe026c1,_0x9e00b1){return function(_0x4c2ac4){if(_0x4c2ac4){return _0x4c2ac4[_0x7aa2('0x28')]()[_0x7aa2('0x27')](function(){var _0x62d1f7=_0x4c2ac4['get']({'plain':!![]});var _0x6b9f70=[{'name':_0x7aa2('0x29'),'value':_0x7aa2('0x2a'),'ignore':![]},{'name':_0x7aa2('0x2b'),'value':_0x7aa2('0x2c'),'ignore':![]},{'name':_0x7aa2('0x2d'),'value':_0x7aa2('0x2e'),'ignore':![]}];var _0x1e690e=_(_0x6b9f70)['filter']('ignore')[_0x7aa2('0x2f')](_0x7aa2('0x30'))[_0x7aa2('0x30')]();if(_[_0x7aa2('0x31')](_0x1e690e,_0x62d1f7[_0x7aa2('0x32')])){return;}var _0x1191b5=_[_0x7aa2('0x33')](_0x6b9f70,['value',_0x62d1f7['type']])[_0x7aa2('0x34')];return db[_0x7aa2('0x35')][_0x7aa2('0x28')]({'where':{'type':_0x1191b5,'resourceId':_0x62d1f7['id']}})[_0x7aa2('0x27')](function(){return _0x4c2ac4;});})[_0x7aa2('0x27')](function(){_0xe026c1[_0x7aa2('0x1c')](0xcc)[_0x7aa2('0x1d')]();});}};}function handleEntityNotFound(_0x4a67b0,_0x5ae029){return function(_0x4b073d){if(!_0x4b073d){_0x4a67b0['sendStatus'](0x194);}return _0x4b073d;};}function handleError(_0x5e2524,_0x38181d){_0x38181d=_0x38181d||0x1f4;return function(_0x8c3138){logger[_0x7aa2('0x36')](_0x8c3138[_0x7aa2('0x37')]);if(_0x8c3138[_0x7aa2('0x34')]){delete _0x8c3138[_0x7aa2('0x34')];}_0x5e2524['status'](_0x38181d)[_0x7aa2('0x38')](_0x8c3138);};}exports[_0x7aa2('0x39')]=function(_0x305aae,_0x27626d){var _0x5f051c={},_0x3164b3={},_0x8f4770={'count':0x0,'rows':[]};var _0x2bddca=_[_0x7aa2('0x2f')](db[_0x7aa2('0x3a')][_0x7aa2('0x3b')],function(_0x39cbc6){return{'name':_0x39cbc6['fieldName'],'type':_0x39cbc6[_0x7aa2('0x32')][_0x7aa2('0x3c')]};});_0x3164b3['model']=_['map'](_0x2bddca,_0x7aa2('0x34'));_0x3164b3[_0x7aa2('0x3d')]=_[_0x7aa2('0x3e')](_0x305aae[_0x7aa2('0x3d')]);_0x3164b3[_0x7aa2('0x3f')]=_[_0x7aa2('0x40')](_0x3164b3['model'],_0x3164b3[_0x7aa2('0x3d')]);_0x5f051c['attributes']=_[_0x7aa2('0x40')](_0x3164b3['model'],qs[_0x7aa2('0x41')](_0x305aae[_0x7aa2('0x3d')][_0x7aa2('0x41')]));_0x5f051c[_0x7aa2('0x42')]=_0x5f051c[_0x7aa2('0x42')][_0x7aa2('0x43')]?_0x5f051c[_0x7aa2('0x42')]:_0x3164b3[_0x7aa2('0x44')];if(!_0x305aae[_0x7aa2('0x3d')]['hasOwnProperty']('nolimit')){_0x5f051c[_0x7aa2('0x1f')]=qs[_0x7aa2('0x1f')](_0x305aae[_0x7aa2('0x3d')][_0x7aa2('0x1f')]);_0x5f051c[_0x7aa2('0x1e')]=qs['offset'](_0x305aae[_0x7aa2('0x3d')][_0x7aa2('0x1e')]);}_0x5f051c[_0x7aa2('0x45')]=qs[_0x7aa2('0x46')](_0x305aae['query'][_0x7aa2('0x46')]);_0x5f051c[_0x7aa2('0x47')]=qs[_0x7aa2('0x3f')](_[_0x7aa2('0x48')](_0x305aae[_0x7aa2('0x3d')],_0x3164b3[_0x7aa2('0x3f')]),_0x2bddca);if(_0x305aae[_0x7aa2('0x3d')][_0x7aa2('0x49')]){_0x5f051c[_0x7aa2('0x47')]=_[_0x7aa2('0x4a')](_0x5f051c[_0x7aa2('0x47')],{'$or':_[_0x7aa2('0x2f')](_0x2bddca,function(_0x33851b){if(_0x33851b[_0x7aa2('0x32')]!==_0x7aa2('0x4b')){var _0x1daa6e={};_0x1daa6e[_0x33851b['name']]={'$like':'%'+_0x305aae[_0x7aa2('0x3d')][_0x7aa2('0x49')]+'%'};return _0x1daa6e;}})});}_0x5f051c=_[_0x7aa2('0x4a')]({},_0x5f051c,_0x305aae['options']);var _0x4bb00e={'where':_0x5f051c[_0x7aa2('0x47')]};return db['VoiceExtension']['count'](_0x4bb00e)[_0x7aa2('0x27')](function(_0x3d2bcc){_0x8f4770[_0x7aa2('0x20')]=_0x3d2bcc;if(_0x305aae[_0x7aa2('0x3d')][_0x7aa2('0x4c')]){_0x5f051c['include']=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x5f051c);})[_0x7aa2('0x27')](function(_0x949d1d){_0x8f4770[_0x7aa2('0x4d')]=_0x949d1d;return _0x8f4770;})[_0x7aa2('0x27')](respondWithFilteredResult(_0x27626d,_0x5f051c))[_0x7aa2('0x4e')](handleError(_0x27626d,null));};exports[_0x7aa2('0x4f')]=function(_0xceffca,_0x402953){var _0x188bb7={'raw':![],'where':{'id':_0xceffca[_0x7aa2('0x50')]['id']}},_0x24a6d1={};_0x24a6d1[_0x7aa2('0x44')]=_['keys'](db['VoiceExtension'][_0x7aa2('0x3b')]);_0x24a6d1[_0x7aa2('0x3d')]=_[_0x7aa2('0x3e')](_0xceffca[_0x7aa2('0x3d')]);_0x24a6d1[_0x7aa2('0x3f')]=_['intersection'](_0x24a6d1[_0x7aa2('0x44')],_0x24a6d1['query']);_0x188bb7[_0x7aa2('0x42')]=_[_0x7aa2('0x40')](_0x24a6d1[_0x7aa2('0x44')],qs[_0x7aa2('0x41')](_0xceffca[_0x7aa2('0x3d')]['fields']));_0x188bb7[_0x7aa2('0x42')]=_0x188bb7[_0x7aa2('0x42')]['length']?_0x188bb7[_0x7aa2('0x42')]:_0x24a6d1[_0x7aa2('0x44')];if(_0xceffca[_0x7aa2('0x3d')][_0x7aa2('0x4c')]){_0x188bb7[_0x7aa2('0x51')]=[{'all':!![]}];}_0x188bb7=_[_0x7aa2('0x4a')]({},_0x188bb7,_0xceffca[_0x7aa2('0x52')]);return db[_0x7aa2('0x3a')][_0x7aa2('0x33')](_0x188bb7)[_0x7aa2('0x27')](handleEntityNotFound(_0x402953,null))[_0x7aa2('0x27')](respondWithResult(_0x402953,null))['catch'](handleError(_0x402953,null));};exports['destroy']=function(_0x4ae17d,_0x48f3f0){return db[_0x7aa2('0x3a')]['find']({'where':{'id':_0x4ae17d[_0x7aa2('0x50')]['id']}})[_0x7aa2('0x27')](handleEntityNotFound(_0x48f3f0,null))[_0x7aa2('0x27')](removeEntity(_0x48f3f0,null))[_0x7aa2('0x4e')](handleError(_0x48f3f0,null));};exports[_0x7aa2('0x53')]=function(_0x42954d,_0x1dee8){if(_0x42954d[_0x7aa2('0x54')][_0x7aa2('0x32')]===_0x7aa2('0x2c')&&!_[_0x7aa2('0x55')](_0x42954d['body']['exten'],'_')){_0x42954d['body'][_0x7aa2('0x56')]='_'['concat'](_0x42954d[_0x7aa2('0x54')][_0x7aa2('0x56')]);}return db[_0x7aa2('0x3a')][_0x7aa2('0x53')](_0x42954d[_0x7aa2('0x54')],{'raw':![]})[_0x7aa2('0x27')](function(_0xbbafaa){var _0x5c397d=_0x42954d[_0x7aa2('0x57')][_0x7aa2('0x58')]({'plain':!![]});if(!_0x5c397d)throw new Error(_0x7aa2('0x59'));if(_0x5c397d['role']===_0x7aa2('0x57')){var _0x38cc0c=_0xbbafaa[_0x7aa2('0x58')]({'plain':!![]});var _0x575d9f=[{'name':_0x7aa2('0x29'),'value':_0x7aa2('0x2a')},{'name':'OutboundRoutes','value':_0x7aa2('0x2c')},{'name':_0x7aa2('0x2d'),'value':'internal'}];var _0x459b65=_[_0x7aa2('0x33')](_0x575d9f,['value',_0x38cc0c[_0x7aa2('0x32')]])[_0x7aa2('0x34')];return db[_0x7aa2('0x5a')]['find']({'where':{'name':_0x459b65,'userProfileId':_0x5c397d[_0x7aa2('0x5b')]},'raw':!![]})[_0x7aa2('0x27')](function(_0x1b88b9){if(_0x1b88b9&&_0x1b88b9[_0x7aa2('0x5c')]===0x0){return db[_0x7aa2('0x35')][_0x7aa2('0x53')]({'name':_0x38cc0c[_0x7aa2('0x34')],'resourceId':_0x38cc0c['id'],'type':_0x1b88b9[_0x7aa2('0x34')],'sectionId':_0x1b88b9['id']},{})['then'](function(){return _0xbbafaa;});}else{return _0xbbafaa;}})[_0x7aa2('0x4e')](function(_0x591fcf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x591fcf);throw _0x591fcf;});}return _0xbbafaa;})[_0x7aa2('0x27')](respondWithResult(_0x1dee8,0xc9))[_0x7aa2('0x4e')](handleError(_0x1dee8,null));};exports[_0x7aa2('0x5d')]=function(_0x5df452,_0xe36483){if(_0x5df452[_0x7aa2('0x54')]['id']){delete _0x5df452[_0x7aa2('0x54')]['id'];}return db[_0x7aa2('0x3a')][_0x7aa2('0x33')]({'where':{'id':_0x5df452[_0x7aa2('0x50')]['id']}})['then'](handleEntityNotFound(_0xe36483,null))[_0x7aa2('0x27')](function(_0x2e8858){if(_0x2e8858){return db[_0x7aa2('0x3a')][_0x7aa2('0x5d')](_[_0x7aa2('0x48')](_0x5df452['body'],[_0x7aa2('0x56'),'context','description',_0x7aa2('0x5e'),'cutdigits',_0x7aa2('0x5f'),_0x7aa2('0x60')]),{'where':{'context':_0x2e8858[_0x7aa2('0x61')],'exten':_0x2e8858[_0x7aa2('0x56')]},'individualHooks':!![]})[_0x7aa2('0x27')](function(_0x9b5226){return _0x9b5226;});}return null;})[_0x7aa2('0x27')](respondWithStatusCode(_0xe36483,null))[_0x7aa2('0x4e')](handleError(_0xe36483,null));};exports[_0x7aa2('0x62')]=function(_0x4c8f75,_0x167d7a){return db[_0x7aa2('0x3a')][_0x7aa2('0x63')]({'where':{'id':_0x4c8f75[_0x7aa2('0x50')]['id']}})['then'](function(_0x136e5b){if(_0x136e5b){return db['sequelize']['transaction'](function(_0x43236d){return db[_0x7aa2('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x4c8f75[_0x7aa2('0x50')]['id']},'transaction':_0x43236d})[_0x7aa2('0x27')](function(){var _0x5a8b81=_[_0x7aa2('0x2f')](_0x4c8f75[_0x7aa2('0x54')],function(_0x23ba6f){_0x23ba6f[_0x7aa2('0x64')]=_0x4c8f75[_0x7aa2('0x50')]['id'];_0x23ba6f[_0x7aa2('0x65')]=!![];return _0x23ba6f;});var _0x69dd39=_0x4c8f75['query']['rewriteDial']&&_0x4c8f75[_0x7aa2('0x3d')][_0x7aa2('0x66')][_0x7aa2('0x67')]()===_0x7aa2('0x68')?!![]:![];return _0x136e5b[_0x7aa2('0x69')](_0x5a8b81,_0x69dd39);})[_0x7aa2('0x27')](function(_0x238f23){return db['VoiceExtension'][_0x7aa2('0x6a')](_0x238f23,{'transaction':_0x43236d});});})[_0x7aa2('0x27')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4c8f75['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x167d7a,null))[_0x7aa2('0x4e')](handleError(_0x167d7a,null));}; \ No newline at end of file +var _0x26fd=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','show','params','keys','length','catch','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','findAndCountAll','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x26fd,0x1a1));var _0xd26f=function(_0x10b2d5,_0x5a7743){_0x10b2d5=_0x10b2d5-0x0;var _0x14b8d1=_0x26fd[_0x10b2d5];return _0x14b8d1;};'use strict';var emlformat=require(_0xd26f('0x0'));var rimraf=require(_0xd26f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd26f('0x2'));var moment=require(_0xd26f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd26f('0x4'));var util=require(_0xd26f('0x5'));var path=require(_0xd26f('0x6'));var sox=require(_0xd26f('0x7'));var csv=require(_0xd26f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd26f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd26f('0xa'));var toCsv=require(_0xd26f('0x8'));var querystring=require(_0xd26f('0xb'));var Papa=require('papaparse');var Redis=require(_0xd26f('0xc'));var authService=require(_0xd26f('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd26f('0xe'));var logger=require('../../config/logger')(_0xd26f('0xf'));var utils=require('../../config/utils');var config=require(_0xd26f('0x10'));var licenseUtil=require(_0xd26f('0x11'));var db=require(_0xd26f('0x12'))['db'];config[_0xd26f('0x13')]=_[_0xd26f('0x14')](config[_0xd26f('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xd26f('0x15'))(new Redis(config[_0xd26f('0x13')]));require('./voiceExtension.socket')[_0xd26f('0x16')](socket);function respondWithStatusCode(_0x3c85d7,_0x1fa960){_0x1fa960=_0x1fa960||0xcc;return function(_0x3675d5){if(_0x3675d5){return _0x3c85d7[_0xd26f('0x17')](_0x1fa960);}return _0x3c85d7[_0xd26f('0x18')](_0x1fa960)[_0xd26f('0x19')]();};}function respondWithResult(_0x45a762,_0x3bc120){_0x3bc120=_0x3bc120||0xc8;return function(_0x21f9a8){if(_0x21f9a8){return _0x45a762[_0xd26f('0x18')](_0x3bc120)[_0xd26f('0x1a')](_0x21f9a8);}};}function respondWithFilteredResult(_0x258363,_0x26830c){return function(_0xdaed9){if(_0xdaed9){var _0x40c17e=typeof _0x26830c[_0xd26f('0x1b')]==='undefined'&&typeof _0x26830c['limit']===_0xd26f('0x1c');var _0x930355=_0xdaed9[_0xd26f('0x1d')];var _0xb6501c=_0x40c17e?0x0:_0x26830c['offset'];var _0x4260ed=_0x40c17e?_0xdaed9[_0xd26f('0x1d')]:_0x26830c[_0xd26f('0x1b')]+_0x26830c[_0xd26f('0x1e')];var _0x3bee4c;if(_0x4260ed>=_0x930355){_0x4260ed=_0x930355;_0x3bee4c=0xc8;}else{_0x3bee4c=0xce;}_0x258363[_0xd26f('0x18')](_0x3bee4c);return _0x258363[_0xd26f('0x1f')](_0xd26f('0x20'),_0xb6501c+'-'+_0x4260ed+'/'+_0x930355)['json'](_0xdaed9);}return null;};}function patchUpdates(_0x2ae68f){return function(_0x4a4d39){try{jsonpatch[_0xd26f('0x21')](_0x4a4d39,_0x2ae68f,!![]);}catch(_0x3dfd28){return BPromise[_0xd26f('0x22')](_0x3dfd28);}return _0x4a4d39['save']();};}function saveUpdates(_0x475762,_0x317030){return function(_0xd9dfaa){if(_0xd9dfaa){return _0xd9dfaa['update'](_0x475762)[_0xd26f('0x23')](function(_0x5286a7){return _0x5286a7;});}return null;};}function removeEntity(_0x35f195,_0x1a8ce6){return function(_0x3fa3ba){if(_0x3fa3ba){return _0x3fa3ba[_0xd26f('0x24')]()[_0xd26f('0x23')](function(){var _0xd2fcf8=_0x3fa3ba[_0xd26f('0x25')]({'plain':!![]});var _0x3c1277=[{'name':_0xd26f('0x26'),'value':_0xd26f('0x27'),'ignore':![]},{'name':'OutboundRoutes','value':_0xd26f('0x28'),'ignore':![]},{'name':_0xd26f('0x29'),'value':_0xd26f('0x2a'),'ignore':![]}];var _0x4bcbaf=_(_0x3c1277)[_0xd26f('0x2b')](_0xd26f('0x2c'))[_0xd26f('0x2d')]('value')[_0xd26f('0x2e')]();if(_[_0xd26f('0x2f')](_0x4bcbaf,_0xd2fcf8['type'])){return;}var _0x278a9f=_[_0xd26f('0x30')](_0x3c1277,[_0xd26f('0x2e'),_0xd2fcf8[_0xd26f('0x31')]])[_0xd26f('0x32')];return db[_0xd26f('0x33')][_0xd26f('0x24')]({'where':{'type':_0x278a9f,'resourceId':_0xd2fcf8['id']}})['then'](function(){return _0x3fa3ba;});})[_0xd26f('0x23')](function(){_0x35f195['status'](0xcc)[_0xd26f('0x19')]();});}};}function handleEntityNotFound(_0x19cc2f,_0x2a859b){return function(_0x4061e1){if(!_0x4061e1){_0x19cc2f[_0xd26f('0x17')](0x194);}return _0x4061e1;};}function handleError(_0x8b0bb6,_0x5e7d41){_0x5e7d41=_0x5e7d41||0x1f4;return function(_0x1a06ab){logger[_0xd26f('0x34')](_0x1a06ab[_0xd26f('0x35')]);if(_0x1a06ab[_0xd26f('0x32')]){delete _0x1a06ab[_0xd26f('0x32')];}_0x8b0bb6['status'](_0x5e7d41)[_0xd26f('0x36')](_0x1a06ab);};}exports[_0xd26f('0x37')]=function(_0x386ef6,_0x54c0aa){var _0x590a54={},_0xd881ab={},_0x296339={'count':0x0,'rows':[]};var _0x4acdc5=_[_0xd26f('0x2d')](db[_0xd26f('0x38')][_0xd26f('0x39')],function(_0x2a0359){return{'name':_0x2a0359[_0xd26f('0x3a')],'type':_0x2a0359[_0xd26f('0x31')][_0xd26f('0x3b')]};});_0xd881ab[_0xd26f('0x3c')]=_[_0xd26f('0x2d')](_0x4acdc5,_0xd26f('0x32'));_0xd881ab[_0xd26f('0x3d')]=_['keys'](_0x386ef6['query']);_0xd881ab[_0xd26f('0x3e')]=_[_0xd26f('0x3f')](_0xd881ab[_0xd26f('0x3c')],_0xd881ab[_0xd26f('0x3d')]);_0x590a54[_0xd26f('0x40')]=_[_0xd26f('0x3f')](_0xd881ab[_0xd26f('0x3c')],qs[_0xd26f('0x41')](_0x386ef6[_0xd26f('0x3d')][_0xd26f('0x41')]));_0x590a54[_0xd26f('0x40')]=_0x590a54[_0xd26f('0x40')]['length']?_0x590a54[_0xd26f('0x40')]:_0xd881ab[_0xd26f('0x3c')];if(!_0x386ef6[_0xd26f('0x3d')][_0xd26f('0x42')](_0xd26f('0x43'))){_0x590a54[_0xd26f('0x1e')]=qs[_0xd26f('0x1e')](_0x386ef6[_0xd26f('0x3d')][_0xd26f('0x1e')]);_0x590a54[_0xd26f('0x1b')]=qs[_0xd26f('0x1b')](_0x386ef6[_0xd26f('0x3d')]['offset']);}_0x590a54[_0xd26f('0x44')]=qs[_0xd26f('0x45')](_0x386ef6['query'][_0xd26f('0x45')]);_0x590a54[_0xd26f('0x46')]=qs[_0xd26f('0x3e')](_[_0xd26f('0x47')](_0x386ef6[_0xd26f('0x3d')],_0xd881ab['filters']),_0x4acdc5);if(_0x386ef6['query']['filter']){_0x590a54[_0xd26f('0x46')]=_[_0xd26f('0x48')](_0x590a54[_0xd26f('0x46')],{'$or':_['map'](_0x4acdc5,function(_0x53eaa3){if(_0x53eaa3['type']!=='VIRTUAL'){var _0xef7a92={};_0xef7a92[_0x53eaa3['name']]={'$like':'%'+_0x386ef6[_0xd26f('0x3d')]['filter']+'%'};return _0xef7a92;}})});}_0x590a54=_[_0xd26f('0x48')]({},_0x590a54,_0x386ef6[_0xd26f('0x49')]);var _0x557f72={'where':_0x590a54[_0xd26f('0x46')]};return db[_0xd26f('0x38')]['count'](_0x557f72)[_0xd26f('0x23')](function(_0x2f3da8){_0x296339[_0xd26f('0x1d')]=_0x2f3da8;if(_0x386ef6[_0xd26f('0x3d')][_0xd26f('0x4a')]){_0x590a54[_0xd26f('0x4b')]=[{'all':!![]}];}return db['VoiceExtension'][_0xd26f('0x4c')](_0x590a54);})[_0xd26f('0x23')](function(_0x2fed30){_0x296339[_0xd26f('0x4d')]=_0x2fed30;return _0x296339;})['then'](respondWithFilteredResult(_0x54c0aa,_0x590a54))['catch'](handleError(_0x54c0aa,null));};exports[_0xd26f('0x4e')]=function(_0x1db3f6,_0x3b8bde){var _0x251f18={'raw':![],'where':{'id':_0x1db3f6[_0xd26f('0x4f')]['id']}},_0x94abef={};_0x94abef['model']=_['keys'](db[_0xd26f('0x38')][_0xd26f('0x39')]);_0x94abef['query']=_[_0xd26f('0x50')](_0x1db3f6[_0xd26f('0x3d')]);_0x94abef[_0xd26f('0x3e')]=_[_0xd26f('0x3f')](_0x94abef[_0xd26f('0x3c')],_0x94abef[_0xd26f('0x3d')]);_0x251f18['attributes']=_[_0xd26f('0x3f')](_0x94abef[_0xd26f('0x3c')],qs[_0xd26f('0x41')](_0x1db3f6[_0xd26f('0x3d')][_0xd26f('0x41')]));_0x251f18[_0xd26f('0x40')]=_0x251f18[_0xd26f('0x40')][_0xd26f('0x51')]?_0x251f18[_0xd26f('0x40')]:_0x94abef[_0xd26f('0x3c')];if(_0x1db3f6['query']['includeAll']){_0x251f18[_0xd26f('0x4b')]=[{'all':!![]}];}_0x251f18=_[_0xd26f('0x48')]({},_0x251f18,_0x1db3f6[_0xd26f('0x49')]);return db[_0xd26f('0x38')][_0xd26f('0x30')](_0x251f18)[_0xd26f('0x23')](handleEntityNotFound(_0x3b8bde,null))['then'](respondWithResult(_0x3b8bde,null))[_0xd26f('0x52')](handleError(_0x3b8bde,null));};exports['destroy']=function(_0x3be248,_0x39c856){return db[_0xd26f('0x38')][_0xd26f('0x30')]({'where':{'id':_0x3be248[_0xd26f('0x4f')]['id']}})[_0xd26f('0x23')](handleEntityNotFound(_0x39c856,null))[_0xd26f('0x23')](removeEntity(_0x39c856,null))[_0xd26f('0x52')](handleError(_0x39c856,null));};exports[_0xd26f('0x53')]=function(_0x345439,_0x3e8684){if(_0x345439[_0xd26f('0x54')][_0xd26f('0x31')]===_0xd26f('0x28')&&!_[_0xd26f('0x55')](_0x345439[_0xd26f('0x54')][_0xd26f('0x56')],'_')){_0x345439[_0xd26f('0x54')][_0xd26f('0x56')]='_'[_0xd26f('0x57')](_0x345439[_0xd26f('0x54')][_0xd26f('0x56')]);}return db['VoiceExtension'][_0xd26f('0x53')](_0x345439[_0xd26f('0x54')],{'raw':![]})['then'](function(_0xfd1384){var _0x304c42=_0x345439[_0xd26f('0x58')]['get']({'plain':!![]});if(!_0x304c42)throw new Error(_0xd26f('0x59'));if(_0x304c42[_0xd26f('0x5a')]===_0xd26f('0x58')){var _0x4b7f88=_0xfd1384[_0xd26f('0x25')]({'plain':!![]});var _0x53f46b=[{'name':_0xd26f('0x26'),'value':_0xd26f('0x27')},{'name':'OutboundRoutes','value':_0xd26f('0x28')},{'name':_0xd26f('0x29'),'value':'internal'}];var _0x2627b5=_[_0xd26f('0x30')](_0x53f46b,[_0xd26f('0x2e'),_0x4b7f88[_0xd26f('0x31')]])['name'];return db[_0xd26f('0x5b')][_0xd26f('0x30')]({'where':{'name':_0x2627b5,'userProfileId':_0x304c42['userProfileId']},'raw':!![]})[_0xd26f('0x23')](function(_0x5d6896){if(_0x5d6896&&_0x5d6896['autoAssociation']===0x0){return db['UserProfileResource'][_0xd26f('0x53')]({'name':_0x4b7f88[_0xd26f('0x32')],'resourceId':_0x4b7f88['id'],'type':_0x5d6896[_0xd26f('0x32')],'sectionId':_0x5d6896['id']},{})[_0xd26f('0x23')](function(){return _0xfd1384;});}else{return _0xfd1384;}})[_0xd26f('0x52')](function(_0x5d8ce8){logger[_0xd26f('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d8ce8);throw _0x5d8ce8;});}return _0xfd1384;})['then'](respondWithResult(_0x3e8684,0xc9))[_0xd26f('0x52')](handleError(_0x3e8684,null));};exports[_0xd26f('0x5c')]=function(_0x1ca5cc,_0x55a9e3){if(_0x1ca5cc[_0xd26f('0x54')]['id']){delete _0x1ca5cc['body']['id'];}return db[_0xd26f('0x38')][_0xd26f('0x30')]({'where':{'id':_0x1ca5cc[_0xd26f('0x4f')]['id']}})[_0xd26f('0x23')](handleEntityNotFound(_0x55a9e3,null))['then'](function(_0x52b3b3){if(_0x52b3b3){return db['VoiceExtension']['update'](_['pick'](_0x1ca5cc[_0xd26f('0x54')],[_0xd26f('0x56'),_0xd26f('0x5d'),_0xd26f('0x5e'),_0xd26f('0x5f'),_0xd26f('0x60'),_0xd26f('0x61'),_0xd26f('0x62')]),{'where':{'context':_0x52b3b3['context'],'exten':_0x52b3b3[_0xd26f('0x56')]},'individualHooks':!![]})[_0xd26f('0x23')](function(_0x2caf3c){return _0x2caf3c;});}return null;})['then'](respondWithStatusCode(_0x55a9e3,null))[_0xd26f('0x52')](handleError(_0x55a9e3,null));};exports[_0xd26f('0x63')]=function(_0x9304cf,_0x3e88d5){return db[_0xd26f('0x38')][_0xd26f('0x64')]({'where':{'id':_0x9304cf[_0xd26f('0x4f')]['id']}})['then'](function(_0x2314d1){if(_0x2314d1){return db[_0xd26f('0x65')]['transaction'](function(_0x42404c){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x9304cf[_0xd26f('0x4f')]['id']},'transaction':_0x42404c})[_0xd26f('0x23')](function(){var _0x1c8f05=_['map'](_0x9304cf[_0xd26f('0x54')],function(_0x1b8811){_0x1b8811[_0xd26f('0x66')]=_0x9304cf['params']['id'];_0x1b8811[_0xd26f('0x67')]=!![];return _0x1b8811;});var _0x398880=_0x9304cf['query'][_0xd26f('0x68')]&&_0x9304cf['query'][_0xd26f('0x68')][_0xd26f('0x69')]()===_0xd26f('0x6a')?!![]:![];return _0x2314d1[_0xd26f('0x6b')](_0x1c8f05,_0x398880);})[_0xd26f('0x23')](function(_0x271163){return db[_0xd26f('0x38')][_0xd26f('0x6c')](_0x271163,{'transaction':_0x42404c});});})[_0xd26f('0x23')](function(){return db['VoiceExtension'][_0xd26f('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x9304cf[_0xd26f('0x4f')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x3e88d5,null))['catch'](handleError(_0x3e88d5,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 7aaa92e..b111d22 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 _0xfb2e=['remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x35e6ca,_0x54939f){var _0x239e43=function(_0x3ea90d){while(--_0x3ea90d){_0x35e6ca['push'](_0x35e6ca['shift']());}};_0x239e43(++_0x54939f);}(_0xfb2e,0x15b));var _0xefb2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfb2e[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xefb2('0x0'));var VoiceExtension=require(_0xefb2('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xefb2('0x2'),'afterUpdate':'update','afterDestroy':_0xefb2('0x3')};function emitEvent(_0x47d083){return function(_0x306ab8,_0x2c8c2f,_0x3e89f9){VoiceExtensionEvents[_0xefb2('0x4')](_0x47d083+':'+_0x306ab8['id'],_0x306ab8);VoiceExtensionEvents['emit'](_0x47d083,_0x306ab8);_0x3e89f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xefb2('0x5')](e,emitEvent(event));}}module[_0xefb2('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0xff67=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x1583e6,_0x4d2409){var _0x1489e7=function(_0xa4b524){while(--_0xa4b524){_0x1583e6['push'](_0x1583e6['shift']());}};_0x1489e7(++_0x4d2409);}(_0xff67,0x17e));var _0x7ff6=function(_0x1f1156,_0x48bd8c){_0x1f1156=_0x1f1156-0x0;var _0x58db65=_0xff67[_0x1f1156];return _0x58db65;};'use strict';var EventEmitter=require(_0x7ff6('0x0'));var VoiceExtension=require(_0x7ff6('0x1'))['db'][_0x7ff6('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7ff6('0x3')](0x0);var events={'afterCreate':_0x7ff6('0x4'),'afterUpdate':'update','afterDestroy':_0x7ff6('0x5')};function emitEvent(_0x2f423){return function(_0x3a680e,_0x565e06,_0x33f709){VoiceExtensionEvents[_0x7ff6('0x6')](_0x2f423+':'+_0x3a680e['id'],_0x3a680e);VoiceExtensionEvents[_0x7ff6('0x6')](_0x2f423,_0x3a680e);_0x33f709(null);};}for(var e in events){if(events[_0x7ff6('0x7')](e)){var event=events[e];VoiceExtension[_0x7ff6('0x8')](e,emitEvent(event));}}module[_0x7ff6('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 5b9b443..b02deae 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 _0xc304=['param','phone','prefix','${EXTEN:','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','catch','define','voice_extensions','then','Hangup','last','util','exports','models','type','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','Set','MONITOR_OPTIONS=ab','outbound','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','timeout','url','split','length','name','trunk'];(function(_0x5db421,_0x183291){var _0x2ac601=function(_0x169b14){while(--_0x169b14){_0x5db421['push'](_0x5db421['shift']());}};_0x2ac601(++_0x183291);}(_0xc304,0x157));var _0x4c30=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0xc304[_0x3a607e];return _0x37b106;};'use strict';var util=require(_0x4c30('0x0'));var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x4c30('0x1')]=function(_0x2543b1){var _0x57d1c1=_0x2543b1[_0x4c30('0x2')];function _0x35e5a1(_0x368355){var _0x5a1927=0x2;var _0x1f86ad=[{'type':_0x368355[_0x4c30('0x3')],'app':'Set','appdata':'CDR(type)='+_0x368355[_0x4c30('0x3')],'context':_0x368355[_0x4c30('0x4')],'exten':_0x368355[_0x4c30('0x5')],'priority':_0x5a1927++,'VoiceExtensionId':_0x368355['id']},{'type':_0x368355[_0x4c30('0x3')],'app':_0x368355[_0x4c30('0x6')]?'Set':'NoOp','appdata':_0x368355['alias']?_0x4c30('0x7')+_0x368355[_0x4c30('0x6')]:_0x4c30('0x8'),'context':_0x368355[_0x4c30('0x4')],'exten':_0x368355['exten'],'priority':_0x5a1927++,'VoiceExtensionId':_0x368355['id']}];if(_0x368355[_0x4c30('0x3')]==='inbound'){_0x1f86ad[_0x4c30('0x9')]({'type':_0x4c30('0xa'),'app':'Set','appdata':'CDR(routeid)='+_0x368355['id'],'context':_0x368355['context'],'exten':_0x368355[_0x4c30('0x5')],'priority':_0x5a1927++,'VoiceExtensionId':_0x368355['id']});}_0x1f86ad[_0x4c30('0x9')]({'type':_0x368355[_0x4c30('0x3')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x368355[_0x4c30('0x4')],'exten':_0x368355[_0x4c30('0x5')],'priority':_0x5a1927++,'VoiceExtensionId':_0x368355['id']},{'type':_0x368355[_0x4c30('0x3')],'app':_0x4c30('0xb'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x368355[_0x4c30('0x4')],'exten':_0x368355[_0x4c30('0x5')],'priority':_0x5a1927++,'VoiceExtensionId':_0x368355['id']},{'type':_0x368355[_0x4c30('0x3')],'app':_0x4c30('0xb'),'appdata':_0x4c30('0xc'),'context':_0x368355[_0x4c30('0x4')],'exten':_0x368355['exten'],'priority':_0x5a1927++,'VoiceExtensionId':_0x368355['id']});return _0x1f86ad;}function _0x5505fb(_0x181e2d){var _0x52c3d2=0x2;var _0x10d37b=[{'type':_0x4c30('0xd'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':_0x4c30('0xd'),'app':_0x181e2d['alias']?_0x4c30('0xb'):'NoOp','appdata':_0x181e2d[_0x4c30('0x6')]?_0x4c30('0x7')+_0x181e2d[_0x4c30('0x6')]:_0x4c30('0x8'),'context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d['exten'],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x181e2d[_0x4c30('0xe')]?'${EXTEN:'+_0x181e2d[_0x4c30('0xe')]+'}':'${EXTEN}'),'context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d['exten'],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':'outbound','app':_0x4c30('0xb'),'appdata':'CDR(routeid)='+_0x181e2d['id'],'context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':_0x4c30('0xd'),'app':_0x4c30('0xf'),'appdata':_0x4c30('0x10')+(_0x52c3d2+0x2)+_0x4c30('0x11')+(_0x52c3d2+0x1)+')','context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':_0x4c30('0xd'),'app':_0x4c30('0xb'),'appdata':_0x181e2d[_0x4c30('0xe')]?_0x4c30('0x12')+_0x181e2d['cutdigits']+'}':_0x4c30('0x13'),'context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':_0x4c30('0xd'),'app':_0x4c30('0xb'),'appdata':_0x4c30('0x14'),'context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d['exten'],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':_0x4c30('0xd'),'app':_0x4c30('0xb'),'appdata':_0x4c30('0x15'),'context':_0x181e2d['context'],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':_0x4c30('0xd'),'app':_0x4c30('0xb'),'appdata':_0x4c30('0xc'),'context':_0x181e2d['context'],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':_0x4c30('0xd'),'app':_0x4c30('0xb'),'appdata':_0x4c30('0x16')+_0x181e2d['id'],'context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']}];if(_0x181e2d[_0x4c30('0x17')](_0x4c30('0x18'))&&_0x181e2d[_0x4c30('0x18')]!==_0x4c30('0x19')){_0x10d37b[_0x4c30('0x9')]({'type':'outbound','app':_0x4c30('0xb'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']},{'type':_0x4c30('0xd'),'app':_0x4c30('0xb'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x181e2d[_0x4c30('0x18')]||'wav','context':_0x181e2d[_0x4c30('0x4')],'exten':_0x181e2d[_0x4c30('0x5')],'priority':_0x52c3d2++,'VoiceExtensionId':_0x181e2d['id']});}return _0x10d37b;}function _0x4f13ec(_0x1043eb){var _0xfaa442=[{'name':'trunk','param':0x0},{'name':_0x4c30('0x1a'),'param':0x1},{'name':'options','param':0x2},{'name':_0x4c30('0x1b'),'param':0x3}];var _0x1a58d6={};var _0x4810ad=_0x1043eb[_0x4c30('0x1c')](',');var _0x2cb249=[];for(var _0x11bcbc=0x0;_0x11bcbc<_0xfaa442[_0x4c30('0x1d')];_0x11bcbc++){switch(_0xfaa442[_0x11bcbc][_0x4c30('0x1e')]){case _0x4c30('0x1f'):_0x1a58d6[_0x4c30('0x1f')]=_0x4810ad[_0xfaa442[_0x11bcbc][_0x4c30('0x20')]][_0x4c30('0x1c')]('/')[0x1];_0x1a58d6[_0x4c30('0x21')]=_0x4810ad[_0xfaa442[_0x11bcbc][_0x4c30('0x20')]][_0x4c30('0x1c')]('/')[0x2];_0x1a58d6[_0x4c30('0x22')]=_0x1a58d6[_0x4c30('0x21')]?_0x1a58d6['phone']['split']('$')[0x0]:undefined;_0x1a58d6[_0x4c30('0x21')]=route[_0x4c30('0xe')]?(_0x1a58d6[_0x4c30('0x22')]||'')+_0x4c30('0x23')+route[_0x4c30('0xe')]+'}':(_0x1a58d6['prefix']||'')+'${EXTEN}';_0x2cb249[_0xfaa442[_0x11bcbc][_0x4c30('0x20')]]=[_0x4c30('0x24'),_0x1a58d6[_0x4c30('0x1f')],_0x1a58d6[_0x4c30('0x21')]][_0x4c30('0x25')]('/');break;case _0x4c30('0x26'):_0x1a58d6[_0x4c30('0x26')]=_0x4810ad[_0xfaa442[_0x11bcbc]['param']];if(route[_0x4c30('0x18')]!==_0x4c30('0x19')){if(_0x1a58d6[_0x4c30('0x26')][_0x4c30('0x27')](_0x4c30('0x28'))<0x0){_0x1a58d6[_0x4c30('0x26')]+=_0x4c30('0x28');}}else{_0x1a58d6[_0x4c30('0x26')]=_0x1a58d6[_0x4c30('0x26')][_0x4c30('0x29')](_0x4c30('0x28'),'');}_0x2cb249[_0xfaa442[_0x11bcbc][_0x4c30('0x20')]]=_0x1a58d6[_0x4c30('0x26')];break;default:_0x2cb249[_0xfaa442[_0x11bcbc]['param']]=_0x4810ad[_0xfaa442[_0x11bcbc]['param']];}}return _0x2cb249[_0x4c30('0x25')](',');}function _0x115a6a(_0x3e4806,_0x5ef1bd,_0x384630,_0x5f0bbb){return new Promise(function(_0x27218d,_0x19f608){var _0x58ed72=[];if(_[_0x4c30('0x2a')](_0x5ef1bd))return _0x27218d(_0x58ed72);_0x57d1c1[_0x4c30('0x2b')]['findAll']({'attributes':['id','interval','IntervalId'],'raw':!![]})['then'](function(_0x4c97ee){for(var _0x84ed08=0x0,_0x36e498=0x0;_0x84ed08<_0x5ef1bd[_0x4c30('0x1d')];_0x84ed08++,_0x36e498=0x0){var _0x99728=_0x5ef1bd[_0x84ed08];var _0x57780d=[];var _0x82c716=[];if(_0x99728[_0x4c30('0x2c')]!=='*,*,*,*'){_0x99728[_0x4c30('0x2d')]=[_0x99728[_0x4c30('0x2c')]];}else{_0x99728[_0x4c30('0x2d')]=_0x99728[_0x4c30('0x2e')]?_[_0x4c30('0x2f')](_[_0x4c30('0x30')](_0x4c97ee,{'IntervalId':_0x99728[_0x4c30('0x2e')]}),_0x4c30('0x2c')):[];}_0x99728[_0x4c30('0x4')]=_0x3e4806['context'];_0x99728[_0x4c30('0x5')]=_0x3e4806[_0x4c30('0x5')];if(_0x99728[_0x4c30('0x3')])_0x99728[_0x4c30('0x3')]=_0x99728['type'][_0x4c30('0x31')]();if(_0x3e4806[_0x4c30('0x3')]==='outbound'){if(_0x99728[_0x4c30('0x17')](_0x4c30('0x32'))&&_0x99728['tag']&&_0x99728[_0x4c30('0x32')]!=='--'){_0x57780d[_0x4c30('0x9')]({'type':_0x99728[_0x4c30('0x3')][_0x4c30('0x31')](),'app':_0x4c30('0xb'),'appdata':_0x4c30('0x33')+_0x99728['tag'],'context':_0x3e4806[_0x4c30('0x4')],'exten':_0x3e4806['exten'],'priority':_0x99728[_0x4c30('0x2d')]['length']+_0x384630+_0x36e498++,'VoiceExtensionId':_0x3e4806['id']});}_0x57780d['push']({'type':_0x99728[_0x4c30('0x3')][_0x4c30('0x31')](),'app':_0x4c30('0xf'),'appdata':_0x4c30('0x34')+(_0x99728['callerID']?_0x4c30('0x35')+_0x99728['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x3e4806['context'],'exten':_0x3e4806[_0x4c30('0x5')],'priority':_0x99728[_0x4c30('0x2d')][_0x4c30('0x1d')]+_0x384630+_0x36e498++,'VoiceExtensionId':_0x3e4806['id']});}else{if(_0x99728['hasOwnProperty']('answer')){if([_0x4c30('0x36'),_0x4c30('0x37')][_0x4c30('0x38')](_0x99728[_0x4c30('0x39')][_0x4c30('0x31')]())&&_0x99728[_0x4c30('0x3a')]!==_0x4c30('0x3b')){if(_0x99728['answer']){_0x57780d[_0x4c30('0x9')]({'type':_0x99728[_0x4c30('0x3')][_0x4c30('0x31')](),'app':_0x4c30('0xf'),'appdata':_0x4c30('0x3c'),'context':_0x3e4806[_0x4c30('0x4')],'exten':_0x3e4806[_0x4c30('0x5')],'priority':_0x99728[_0x4c30('0x2d')]['length']+_0x384630+_0x36e498++,'VoiceExtensionId':_0x3e4806['id']});_0x57780d[_0x4c30('0x9')]({'type':_0x99728[_0x4c30('0x3')][_0x4c30('0x31')](),'app':_0x4c30('0xb'),'appdata':_0x4c30('0x3d'),'context':_0x3e4806[_0x4c30('0x4')],'exten':_0x3e4806[_0x4c30('0x5')],'priority':_0x99728[_0x4c30('0x2d')]['length']+_0x384630+_0x36e498++,'VoiceExtensionId':_0x3e4806['id']});}else{_0x57780d['push']({'type':_0x99728[_0x4c30('0x3')][_0x4c30('0x31')](),'app':_0x4c30('0xf'),'appdata':_0x4c30('0x3e'),'context':_0x3e4806[_0x4c30('0x4')],'exten':_0x3e4806[_0x4c30('0x5')],'priority':_0x99728[_0x4c30('0x2d')][_0x4c30('0x1d')]+_0x384630+_0x36e498++,'VoiceExtensionId':_0x3e4806['id']});_0x57780d['push']({'type':_0x99728['type'][_0x4c30('0x31')](),'app':_0x4c30('0xb'),'appdata':_0x4c30('0x3f'),'context':_0x3e4806['context'],'exten':_0x3e4806[_0x4c30('0x5')],'priority':_0x99728[_0x4c30('0x2d')][_0x4c30('0x1d')]+_0x384630+_0x36e498++,'VoiceExtensionId':_0x3e4806['id']});}}}}for(var _0x31d526=0x0;_0x31d526<_0x99728[_0x4c30('0x2d')]['length'];_0x31d526++){var _0x354a57=_0x384630+_0x99728['intervals'][_0x4c30('0x1d')];var _0x2650da=_0x31d526===_0x99728[_0x4c30('0x2d')]['length']-0x1?_0x384630+_0x57780d[_0x4c30('0x1d')]+_0x82c716[_0x4c30('0x1d')]+0x2:_0x384630+_0x31d526+0x1;_0x57780d['splice'](_0x31d526,0x0,{'type':_0x3e4806[_0x4c30('0x3')],'app':_0x4c30('0x40'),'appdata':_0x99728[_0x4c30('0x2d')][_0x31d526]+'?'+_0x3e4806[_0x4c30('0x4')]+_0x4c30('0x41')+_0x354a57+':'+_0x3e4806[_0x4c30('0x4')]+_0x4c30('0x41')+_0x2650da,'exten':_0x3e4806[_0x4c30('0x5')],'context':_0x3e4806[_0x4c30('0x4')],'priority':_0x384630+_0x31d526,'VoiceExtensionId':_0x3e4806['id']});}if(_0x5f0bbb&&_0x99728[_0x4c30('0x3a')]===_0x4c30('0x42'))_0x99728[_0x4c30('0x43')]=_0x4f13ec(_0x99728[_0x4c30('0x43')]);_0x99728[_0x4c30('0x44')]=_0x57780d[_0x4c30('0x1d')]?_['last'](_0x57780d)['priority']+0x1:_0x384630;_0x58ed72=_['concat'](_0x58ed72,_0x57780d,[_0x99728],_0x82c716);_0x384630=_['last'](_0x58ed72)[_0x4c30('0x44')]+0x1;}return _0x27218d(_0x58ed72);})[_0x4c30('0x45')](function(_0x361448){_0x19f608(_0x361448);});});}return _0x2543b1[_0x4c30('0x46')]('VoiceExtension',attributes,{'tableName':_0x4c30('0x47'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1370ad,_0x5a2ddf){var _0x39e9df=this;var _0x55ecd0=_0x39e9df[_0x4c30('0x3')]===_0x4c30('0xd')?_0x5505fb(_0x39e9df):_0x35e5a1(_0x39e9df);return _0x115a6a(_0x39e9df,_0x1370ad,_['last'](_0x55ecd0)[_0x4c30('0x44')]+0x1,_0x5a2ddf)[_0x4c30('0x48')](function(_0x160328){var _0x5794a9=_['concat'](_0x55ecd0,_0x160328);_0x5794a9[_0x4c30('0x9')]({'type':_0x39e9df[_0x4c30('0x3')],'app':_0x4c30('0x49'),'exten':_0x39e9df[_0x4c30('0x5')],'context':_0x39e9df[_0x4c30('0x4')],'priority':_[_0x4c30('0x4a')](_0x5794a9)['priority']+0x1,'VoiceExtensionId':_0x39e9df['id']});return _0x5794a9;});}}});}; \ No newline at end of file +var _0x21fb=['outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','${EXTEN}','join','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','then','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','queue','playback','includes','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','last','concat','priority','catch','define','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0'];(function(_0x66ad59,_0x36069b){var _0x270b03=function(_0x330a36){while(--_0x330a36){_0x66ad59['push'](_0x66ad59['shift']());}};_0x270b03(++_0x36069b);}(_0x21fb,0x180));var _0xb21f=function(_0x53d744,_0xfefe4e){_0x53d744=_0x53d744-0x0;var _0x89ebf6=_0x21fb[_0x53d744];return _0x89ebf6;};'use strict';var util=require(_0xb21f('0x0'));var _=require(_0xb21f('0x1'));var attributes=require(_0xb21f('0x2'));module['exports']=function(_0x3139f5){var _0x34b4e2=_0x3139f5[_0xb21f('0x3')];function _0x351c09(_0x14cd2b){var _0x51dec2=0x2;var _0x125e25=[{'type':_0x14cd2b[_0xb21f('0x4')],'app':_0xb21f('0x5'),'appdata':_0xb21f('0x6')+_0x14cd2b['type'],'context':_0x14cd2b['context'],'exten':_0x14cd2b[_0xb21f('0x7')],'priority':_0x51dec2++,'VoiceExtensionId':_0x14cd2b['id']},{'type':_0x14cd2b[_0xb21f('0x4')],'app':_0x14cd2b[_0xb21f('0x8')]?_0xb21f('0x5'):_0xb21f('0x9'),'appdata':_0x14cd2b[_0xb21f('0x8')]?_0xb21f('0xa')+_0x14cd2b[_0xb21f('0x8')]:_0xb21f('0xb'),'context':_0x14cd2b[_0xb21f('0xc')],'exten':_0x14cd2b[_0xb21f('0x7')],'priority':_0x51dec2++,'VoiceExtensionId':_0x14cd2b['id']}];if(_0x14cd2b[_0xb21f('0x4')]===_0xb21f('0xd')){_0x125e25[_0xb21f('0xe')]({'type':_0xb21f('0xd'),'app':_0xb21f('0x5'),'appdata':_0xb21f('0xf')+_0x14cd2b['id'],'context':_0x14cd2b[_0xb21f('0xc')],'exten':_0x14cd2b[_0xb21f('0x7')],'priority':_0x51dec2++,'VoiceExtensionId':_0x14cd2b['id']});}_0x125e25[_0xb21f('0xe')]({'type':_0x14cd2b[_0xb21f('0x4')],'app':_0xb21f('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x14cd2b[_0xb21f('0xc')],'exten':_0x14cd2b[_0xb21f('0x7')],'priority':_0x51dec2++,'VoiceExtensionId':_0x14cd2b['id']},{'type':_0x14cd2b[_0xb21f('0x4')],'app':_0xb21f('0x5'),'appdata':_0xb21f('0x10'),'context':_0x14cd2b['context'],'exten':_0x14cd2b[_0xb21f('0x7')],'priority':_0x51dec2++,'VoiceExtensionId':_0x14cd2b['id']},{'type':_0x14cd2b[_0xb21f('0x4')],'app':_0xb21f('0x5'),'appdata':_0xb21f('0x11'),'context':_0x14cd2b[_0xb21f('0xc')],'exten':_0x14cd2b[_0xb21f('0x7')],'priority':_0x51dec2++,'VoiceExtensionId':_0x14cd2b['id']});return _0x125e25;}function _0x2bfa1e(_0x46a360){var _0x24f649=0x2;var _0x428b96=[{'type':_0xb21f('0x12'),'app':'Set','appdata':_0xb21f('0x13'),'context':_0x46a360[_0xb21f('0xc')],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':_0xb21f('0x12'),'app':_0x46a360['alias']?_0xb21f('0x5'):_0xb21f('0x9'),'appdata':_0x46a360['alias']?_0xb21f('0xa')+_0x46a360[_0xb21f('0x8')]:'No\x20alias\x20set','context':_0x46a360['context'],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':_0xb21f('0x12'),'app':_0xb21f('0x5'),'appdata':'CDR(destination)='+(_0x46a360[_0xb21f('0x14')]?'${EXTEN:'+_0x46a360['cutdigits']+'}':'${EXTEN}'),'context':_0x46a360['context'],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':'outbound','app':_0xb21f('0x5'),'appdata':'CDR(routeid)='+_0x46a360['id'],'context':_0x46a360[_0xb21f('0xc')],'exten':_0x46a360['exten'],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':_0xb21f('0x12'),'app':_0xb21f('0x15'),'appdata':_0xb21f('0x16')+(_0x24f649+0x2)+'):Goto('+(_0x24f649+0x1)+')','context':_0x46a360[_0xb21f('0xc')],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':_0xb21f('0x12'),'app':_0xb21f('0x5'),'appdata':_0x46a360[_0xb21f('0x14')]?_0xb21f('0x17')+_0x46a360['cutdigits']+'}':_0xb21f('0x18'),'context':_0x46a360[_0xb21f('0xc')],'exten':_0x46a360['exten'],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':_0xb21f('0x12'),'app':_0xb21f('0x5'),'appdata':_0xb21f('0x19'),'context':_0x46a360['context'],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':_0xb21f('0x12'),'app':'Set','appdata':_0xb21f('0x10'),'context':_0x46a360[_0xb21f('0xc')],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':_0xb21f('0x12'),'app':_0xb21f('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x46a360['context'],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':_0xb21f('0x12'),'app':_0xb21f('0x5'),'appdata':_0xb21f('0x1a')+_0x46a360['id'],'context':_0x46a360['context'],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']}];if(_0x46a360[_0xb21f('0x1b')](_0xb21f('0x1c'))&&_0x46a360[_0xb21f('0x1c')]!==_0xb21f('0x1d')){_0x428b96[_0xb21f('0xe')]({'type':_0xb21f('0x12'),'app':'Set','appdata':_0xb21f('0x1e'),'context':_0x46a360[_0xb21f('0xc')],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']},{'type':'outbound','app':_0xb21f('0x5'),'appdata':_0xb21f('0x1f')+_0x46a360[_0xb21f('0x1c')]||_0xb21f('0x20'),'context':_0x46a360['context'],'exten':_0x46a360[_0xb21f('0x7')],'priority':_0x24f649++,'VoiceExtensionId':_0x46a360['id']});}return _0x428b96;}function _0xeb3b36(_0x3c7583){var _0x50571c=[{'name':_0xb21f('0x21'),'param':0x0},{'name':_0xb21f('0x22'),'param':0x1},{'name':_0xb21f('0x23'),'param':0x2},{'name':_0xb21f('0x24'),'param':0x3}];var _0x1b7e30={};var _0xfd7021=_0x3c7583[_0xb21f('0x25')](',');var _0x2d4774=[];for(var _0x5d1585=0x0;_0x5d1585<_0x50571c[_0xb21f('0x26')];_0x5d1585++){switch(_0x50571c[_0x5d1585][_0xb21f('0x27')]){case _0xb21f('0x21'):_0x1b7e30[_0xb21f('0x21')]=_0xfd7021[_0x50571c[_0x5d1585][_0xb21f('0x28')]]['split']('/')[0x1];_0x1b7e30[_0xb21f('0x29')]=_0xfd7021[_0x50571c[_0x5d1585]['param']]['split']('/')[0x2];_0x1b7e30[_0xb21f('0x2a')]=_0x1b7e30['phone']?_0x1b7e30[_0xb21f('0x29')]['split']('$')[0x0]:undefined;_0x1b7e30[_0xb21f('0x29')]=route[_0xb21f('0x14')]?(_0x1b7e30[_0xb21f('0x2a')]||'')+'${EXTEN:'+route['cutdigits']+'}':(_0x1b7e30[_0xb21f('0x2a')]||'')+_0xb21f('0x2b');_0x2d4774[_0x50571c[_0x5d1585][_0xb21f('0x28')]]=['SIP',_0x1b7e30[_0xb21f('0x21')],_0x1b7e30[_0xb21f('0x29')]][_0xb21f('0x2c')]('/');break;case _0xb21f('0x23'):_0x1b7e30[_0xb21f('0x23')]=_0xfd7021[_0x50571c[_0x5d1585][_0xb21f('0x28')]];if(route['recordingFormat']!=='none'){if(_0x1b7e30[_0xb21f('0x23')][_0xb21f('0x2d')](_0xb21f('0x2e'))<0x0){_0x1b7e30[_0xb21f('0x23')]+=_0xb21f('0x2e');}}else{_0x1b7e30[_0xb21f('0x23')]=_0x1b7e30['options']['replace']('U(xcally-mixmonitor-context)','');}_0x2d4774[_0x50571c[_0x5d1585][_0xb21f('0x28')]]=_0x1b7e30['options'];break;default:_0x2d4774[_0x50571c[_0x5d1585][_0xb21f('0x28')]]=_0xfd7021[_0x50571c[_0x5d1585]['param']];}}return _0x2d4774[_0xb21f('0x2c')](',');}function _0x4e0881(_0x5e456f,_0xc1c615,_0x3e6091,_0x326e21){return new Promise(function(_0x4fd882,_0xb2d233){var _0x1d8911=[];if(_['isEmpty'](_0xc1c615))return _0x4fd882(_0x1d8911);_0x34b4e2[_0xb21f('0x2f')][_0xb21f('0x30')]({'attributes':['id',_0xb21f('0x31'),_0xb21f('0x32')],'raw':!![]})[_0xb21f('0x33')](function(_0x245d6b){for(var _0x3896ec=0x0,_0x2b0ef9=0x0;_0x3896ec<_0xc1c615[_0xb21f('0x26')];_0x3896ec++,_0x2b0ef9=0x0){var _0x1b8286=_0xc1c615[_0x3896ec];var _0xf1d80=[];var _0x5ec0be=[];if(_0x1b8286[_0xb21f('0x31')]!=='*,*,*,*'){_0x1b8286[_0xb21f('0x34')]=[_0x1b8286[_0xb21f('0x31')]];}else{_0x1b8286['intervals']=_0x1b8286[_0xb21f('0x32')]?_[_0xb21f('0x35')](_[_0xb21f('0x36')](_0x245d6b,{'IntervalId':_0x1b8286[_0xb21f('0x32')]}),_0xb21f('0x31')):[];}_0x1b8286[_0xb21f('0xc')]=_0x5e456f[_0xb21f('0xc')];_0x1b8286[_0xb21f('0x7')]=_0x5e456f[_0xb21f('0x7')];if(_0x1b8286['type'])_0x1b8286[_0xb21f('0x4')]=_0x1b8286['type'][_0xb21f('0x37')]();if(_0x5e456f[_0xb21f('0x4')]===_0xb21f('0x12')){if(_0x1b8286[_0xb21f('0x1b')]('tag')&&_0x1b8286[_0xb21f('0x38')]&&_0x1b8286['tag']!=='--'){_0xf1d80[_0xb21f('0xe')]({'type':_0x1b8286[_0xb21f('0x4')][_0xb21f('0x37')](),'app':_0xb21f('0x5'),'appdata':'CDR(tag)='+_0x1b8286[_0xb21f('0x38')],'context':_0x5e456f[_0xb21f('0xc')],'exten':_0x5e456f[_0xb21f('0x7')],'priority':_0x1b8286['intervals'][_0xb21f('0x26')]+_0x3e6091+_0x2b0ef9++,'VoiceExtensionId':_0x5e456f['id']});}_0xf1d80[_0xb21f('0xe')]({'type':_0x1b8286['type'][_0xb21f('0x37')](),'app':_0xb21f('0x15'),'appdata':_0xb21f('0x39')+(_0x1b8286[_0xb21f('0x3a')]?'Set(CALLERID(all)='+_0x1b8286[_0xb21f('0x3a')]+')':_0xb21f('0x3b')),'context':_0x5e456f[_0xb21f('0xc')],'exten':_0x5e456f[_0xb21f('0x7')],'priority':_0x1b8286[_0xb21f('0x34')][_0xb21f('0x26')]+_0x3e6091+_0x2b0ef9++,'VoiceExtensionId':_0x5e456f['id']});}else{if(_0x1b8286[_0xb21f('0x1b')]('answer')){if([_0xb21f('0x3c'),_0xb21f('0x3d')][_0xb21f('0x3e')](_0x1b8286['app'][_0xb21f('0x37')]())&&_0x1b8286[_0xb21f('0x3f')]!==_0xb21f('0x40')){if(_0x1b8286[_0xb21f('0x41')]){_0xf1d80['push']({'type':_0x1b8286[_0xb21f('0x4')][_0xb21f('0x37')](),'app':_0xb21f('0x15'),'appdata':_0xb21f('0x42'),'context':_0x5e456f[_0xb21f('0xc')],'exten':_0x5e456f['exten'],'priority':_0x1b8286['intervals']['length']+_0x3e6091+_0x2b0ef9++,'VoiceExtensionId':_0x5e456f['id']});_0xf1d80[_0xb21f('0xe')]({'type':_0x1b8286[_0xb21f('0x4')][_0xb21f('0x37')](),'app':_0xb21f('0x5'),'appdata':_0xb21f('0x43'),'context':_0x5e456f[_0xb21f('0xc')],'exten':_0x5e456f[_0xb21f('0x7')],'priority':_0x1b8286[_0xb21f('0x34')][_0xb21f('0x26')]+_0x3e6091+_0x2b0ef9++,'VoiceExtensionId':_0x5e456f['id']});}else{_0xf1d80['push']({'type':_0x1b8286['type'][_0xb21f('0x37')](),'app':_0xb21f('0x15'),'appdata':_0xb21f('0x44'),'context':_0x5e456f[_0xb21f('0xc')],'exten':_0x5e456f[_0xb21f('0x7')],'priority':_0x1b8286[_0xb21f('0x34')]['length']+_0x3e6091+_0x2b0ef9++,'VoiceExtensionId':_0x5e456f['id']});_0xf1d80[_0xb21f('0xe')]({'type':_0x1b8286[_0xb21f('0x4')]['toLowerCase'](),'app':_0xb21f('0x5'),'appdata':_0xb21f('0x45'),'context':_0x5e456f['context'],'exten':_0x5e456f[_0xb21f('0x7')],'priority':_0x1b8286['intervals']['length']+_0x3e6091+_0x2b0ef9++,'VoiceExtensionId':_0x5e456f['id']});}}}}for(var _0x86cb47=0x0;_0x86cb47<_0x1b8286['intervals'][_0xb21f('0x26')];_0x86cb47++){var _0x52b1bc=_0x3e6091+_0x1b8286['intervals'][_0xb21f('0x26')];var _0x50b05d=_0x86cb47===_0x1b8286['intervals'][_0xb21f('0x26')]-0x1?_0x3e6091+_0xf1d80[_0xb21f('0x26')]+_0x5ec0be[_0xb21f('0x26')]+0x2:_0x3e6091+_0x86cb47+0x1;_0xf1d80[_0xb21f('0x46')](_0x86cb47,0x0,{'type':_0x5e456f[_0xb21f('0x4')],'app':_0xb21f('0x47'),'appdata':_0x1b8286['intervals'][_0x86cb47]+'?'+_0x5e456f[_0xb21f('0xc')]+_0xb21f('0x48')+_0x52b1bc+':'+_0x5e456f['context']+',${EXTEN},'+_0x50b05d,'exten':_0x5e456f[_0xb21f('0x7')],'context':_0x5e456f[_0xb21f('0xc')],'priority':_0x3e6091+_0x86cb47,'VoiceExtensionId':_0x5e456f['id']});}if(_0x326e21&&_0x1b8286[_0xb21f('0x3f')]==='outboundDial')_0x1b8286[_0xb21f('0x49')]=_0xeb3b36(_0x1b8286[_0xb21f('0x49')]);_0x1b8286['priority']=_0xf1d80['length']?_[_0xb21f('0x4a')](_0xf1d80)['priority']+0x1:_0x3e6091;_0x1d8911=_[_0xb21f('0x4b')](_0x1d8911,_0xf1d80,[_0x1b8286],_0x5ec0be);_0x3e6091=_[_0xb21f('0x4a')](_0x1d8911)[_0xb21f('0x4c')]+0x1;}return _0x4fd882(_0x1d8911);})[_0xb21f('0x4d')](function(_0x14ab0a){_0xb2d233(_0x14ab0a);});});}return _0x3139f5[_0xb21f('0x4e')](_0xb21f('0x4f'),attributes,{'tableName':_0xb21f('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1066a6,_0x26ef55){var _0x52b67e=this;var _0x6222ac=_0x52b67e[_0xb21f('0x4')]==='outbound'?_0x2bfa1e(_0x52b67e):_0x351c09(_0x52b67e);return _0x4e0881(_0x52b67e,_0x1066a6,_[_0xb21f('0x4a')](_0x6222ac)[_0xb21f('0x4c')]+0x1,_0x26ef55)['then'](function(_0x33c0a8){var _0x37d39c=_[_0xb21f('0x4b')](_0x6222ac,_0x33c0a8);_0x37d39c[_0xb21f('0xe')]({'type':_0x52b67e['type'],'app':_0xb21f('0x51'),'exten':_0x52b67e[_0xb21f('0x7')],'context':_0x52b67e[_0xb21f('0xc')],'priority':_[_0xb21f('0x4a')](_0x37d39c)[_0xb21f('0x4c')]+0x1,'VoiceExtensionId':_0x52b67e['id']});return _0x37d39c;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 288d063..59be6c8 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 _0x1db9=['catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','attributes','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x1f7201,_0x141b79){var _0x289fd2=function(_0x20ce23){while(--_0x20ce23){_0x1f7201['push'](_0x1f7201['shift']());}};_0x289fd2(++_0x141b79);}(_0x1db9,0x176));var _0x91db=function(_0x23a96f,_0x435edc){_0x23a96f=_0x23a96f-0x0;var _0x43b3e0=_0x1db9[_0x23a96f];return _0x43b3e0;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var moment=require(_0x91db('0x2'));var BPromise=require(_0x91db('0x3'));var rs=require(_0x91db('0x4'));var fs=require('fs');var Redis=require(_0x91db('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x91db('0x6'));var logger=require(_0x91db('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x91db('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x91db('0x9')]=_[_0x91db('0xa')](config[_0x91db('0x9')],{'host':_0x91db('0xb'),'port':0x18eb});var socket=require(_0x91db('0xc'))(new Redis(config['redis']));require(_0x91db('0xd'))['register'](socket);function respondWithRpcPromise(_0x39e939,_0xad8dd7,_0x177e5c){return new BPromise(function(_0x5102ab,_0x26c5ec){return client['request'](_0x39e939,_0x177e5c)['then'](function(_0x55fcef){logger[_0x91db('0xe')](_0x91db('0xf'),_0xad8dd7,'request\x20sent');logger['debug'](_0x91db('0x10'),_0xad8dd7,_0x91db('0x11'),JSON[_0x91db('0x12')](_0x55fcef));if(_0x55fcef[_0x91db('0x13')]){if(_0x55fcef[_0x91db('0x13')]['code']===0x1f4){logger[_0x91db('0x13')](_0x91db('0xf'),_0xad8dd7,_0x55fcef[_0x91db('0x13')][_0x91db('0x14')]);return _0x26c5ec(_0x55fcef[_0x91db('0x13')][_0x91db('0x14')]);}logger[_0x91db('0x13')](_0x91db('0xf'),_0xad8dd7,_0x55fcef[_0x91db('0x13')][_0x91db('0x14')]);return _0x5102ab(_0x55fcef[_0x91db('0x13')][_0x91db('0x14')]);}else{logger['info'](_0x91db('0xf'),_0xad8dd7,_0x91db('0x11'));_0x5102ab(_0x55fcef[_0x91db('0x15')][_0x91db('0x14')]);}})[_0x91db('0x16')](function(_0x306e92){logger['error']('VoiceExtension,\x20%s,\x20%s',_0xad8dd7,_0x306e92);_0x26c5ec(_0x306e92);});});}exports[_0x91db('0x17')]=function(_0x137edf){var _0x2c3915=this;return new Promise(function(_0xa6413b,_0x50cf9c){return db[_0x91db('0x18')][_0x91db('0x19')]({'raw':_0x137edf[_0x91db('0x1a')]?_0x137edf[_0x91db('0x1a')][_0x91db('0x1b')]===undefined?!![]:![]:!![],'where':_0x137edf[_0x91db('0x1a')]?_0x137edf[_0x91db('0x1a')][_0x91db('0x1c')]||null:null,'attributes':_0x137edf[_0x91db('0x1a')]?_0x137edf[_0x91db('0x1a')]['attributes']||null:null,'limit':_0x137edf['options']?_0x137edf[_0x91db('0x1a')][_0x91db('0x1d')]||null:null,'include':_0x137edf['options']?_0x137edf[_0x91db('0x1a')][_0x91db('0x1e')]?_[_0x91db('0x1f')](_0x137edf[_0x91db('0x1a')][_0x91db('0x1e')],function(_0x4e2a8f){return{'model':db[_0x4e2a8f['model']],'as':_0x4e2a8f['as'],'attributes':_0x4e2a8f[_0x91db('0x20')],'include':_0x4e2a8f[_0x91db('0x1e')]?_[_0x91db('0x1f')](_0x4e2a8f['include'],function(_0x3b38f2){return{'model':db[_0x3b38f2[_0x91db('0x21')]],'as':_0x3b38f2['as'],'attributes':_0x3b38f2[_0x91db('0x20')],'include':_0x3b38f2[_0x91db('0x1e')]?_['map'](_0x3b38f2[_0x91db('0x1e')],function(_0x2a00d1){return{'model':db[_0x2a00d1[_0x91db('0x21')]],'as':_0x2a00d1['as'],'attributes':_0x2a00d1['attributes']};}):[]};}):[]};}):[]:[]})[_0x91db('0x22')](function(_0x69fdc2){logger[_0x91db('0xe')](_0x91db('0x17'),_0x137edf);logger[_0x91db('0x23')](_0x91db('0x17'),_0x137edf,JSON[_0x91db('0x12')](_0x69fdc2));_0xa6413b(_0x69fdc2);})[_0x91db('0x16')](function(_0x330a9a){logger[_0x91db('0x13')](_0x91db('0x17'),_0x330a9a[_0x91db('0x14')],_0x137edf);_0x50cf9c(_0x2c3915[_0x91db('0x13')](0x1f4,_0x330a9a[_0x91db('0x14')]));});});}; \ No newline at end of file +var _0x746f=['client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','attributes','limit','include','map','model','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x13b9d1,_0xded707){var _0x15cdaa=function(_0x45ce30){while(--_0x45ce30){_0x13b9d1['push'](_0x13b9d1['shift']());}};_0x15cdaa(++_0xded707);}(_0x746f,0x9c));var _0xf746=function(_0x514b93,_0x279803){_0x514b93=_0x514b93-0x0;var _0x1b8e2d=_0x746f[_0x514b93];return _0x1b8e2d;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var moment=require(_0xf746('0x2'));var BPromise=require(_0xf746('0x3'));var rs=require(_0xf746('0x4'));var fs=require('fs');var Redis=require(_0xf746('0x5'));var db=require(_0xf746('0x6'))['db'];var utils=require(_0xf746('0x7'));var logger=require(_0xf746('0x8'))(_0xf746('0x9'));var config=require(_0xf746('0xa'));var jayson=require(_0xf746('0xb'));var client=jayson[_0xf746('0xc')][_0xf746('0xd')]({'port':0x232a});config[_0xf746('0xe')]=_[_0xf746('0xf')](config[_0xf746('0xe')],{'host':_0xf746('0x10'),'port':0x18eb});var socket=require(_0xf746('0x11'))(new Redis(config[_0xf746('0xe')]));require(_0xf746('0x12'))[_0xf746('0x13')](socket);function respondWithRpcPromise(_0xfe206a,_0xb5d59f,_0xf72dfd){return new BPromise(function(_0x5dc740,_0x3a0fa8){return client[_0xf746('0x14')](_0xfe206a,_0xf72dfd)[_0xf746('0x15')](function(_0x47ce05){logger[_0xf746('0x16')]('VoiceExtension,\x20%s,\x20%s',_0xb5d59f,_0xf746('0x17'));logger[_0xf746('0x18')](_0xf746('0x19'),_0xb5d59f,_0xf746('0x17'),JSON[_0xf746('0x1a')](_0x47ce05));if(_0x47ce05[_0xf746('0x1b')]){if(_0x47ce05['error'][_0xf746('0x1c')]===0x1f4){logger[_0xf746('0x1b')](_0xf746('0x1d'),_0xb5d59f,_0x47ce05['error'][_0xf746('0x1e')]);return _0x3a0fa8(_0x47ce05[_0xf746('0x1b')][_0xf746('0x1e')]);}logger[_0xf746('0x1b')](_0xf746('0x1d'),_0xb5d59f,_0x47ce05[_0xf746('0x1b')]['message']);return _0x5dc740(_0x47ce05[_0xf746('0x1b')]['message']);}else{logger[_0xf746('0x16')](_0xf746('0x1d'),_0xb5d59f,'request\x20sent');_0x5dc740(_0x47ce05[_0xf746('0x1f')][_0xf746('0x1e')]);}})[_0xf746('0x20')](function(_0x11d8db){logger[_0xf746('0x1b')](_0xf746('0x1d'),_0xb5d59f,_0x11d8db);_0x3a0fa8(_0x11d8db);});});}exports['GetVoiceExtension']=function(_0x37b1c9){var _0x486c27=this;return new Promise(function(_0x15465c,_0x386445){return db[_0xf746('0x21')][_0xf746('0x22')]({'raw':_0x37b1c9[_0xf746('0x23')]?_0x37b1c9[_0xf746('0x23')]['raw']===undefined?!![]:![]:!![],'where':_0x37b1c9[_0xf746('0x23')]?_0x37b1c9['options']['where']||null:null,'attributes':_0x37b1c9[_0xf746('0x23')]?_0x37b1c9[_0xf746('0x23')][_0xf746('0x24')]||null:null,'limit':_0x37b1c9[_0xf746('0x23')]?_0x37b1c9[_0xf746('0x23')][_0xf746('0x25')]||null:null,'include':_0x37b1c9['options']?_0x37b1c9[_0xf746('0x23')][_0xf746('0x26')]?_[_0xf746('0x27')](_0x37b1c9[_0xf746('0x23')]['include'],function(_0x4be1c1){return{'model':db[_0x4be1c1[_0xf746('0x28')]],'as':_0x4be1c1['as'],'attributes':_0x4be1c1['attributes'],'include':_0x4be1c1[_0xf746('0x26')]?_[_0xf746('0x27')](_0x4be1c1[_0xf746('0x26')],function(_0x24fe20){return{'model':db[_0x24fe20[_0xf746('0x28')]],'as':_0x24fe20['as'],'attributes':_0x24fe20['attributes'],'include':_0x24fe20['include']?_[_0xf746('0x27')](_0x24fe20[_0xf746('0x26')],function(_0x2c76a2){return{'model':db[_0x2c76a2[_0xf746('0x28')]],'as':_0x2c76a2['as'],'attributes':_0x2c76a2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf746('0x15')](function(_0x596b9f){logger[_0xf746('0x16')]('GetVoiceExtension',_0x37b1c9);logger[_0xf746('0x18')](_0xf746('0x29'),_0x37b1c9,JSON[_0xf746('0x1a')](_0x596b9f));_0x15465c(_0x596b9f);})[_0xf746('0x20')](function(_0x3eb10c){logger[_0xf746('0x1b')]('GetVoiceExtension',_0x3eb10c[_0xf746('0x1e')],_0x37b1c9);_0x386445(_0x486c27[_0xf746('0x1b')](0x1f4,_0x3eb10c[_0xf746('0x1e')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index ed3514d..77a6aa2 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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3aa2d1,_0x308cc6){_0x3aa2d1=_0x3aa2d1-0x0;var _0x25fbff=_0x1cb9[_0x3aa2d1];return _0x25fbff;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x539160,_0x49ca9e){var _0x52d863=function(_0x43721f){while(--_0x43721f){_0x539160['push'](_0x539160['shift']());}};_0x52d863(++_0x49ca9e);}(_0x326f,0xd1));var _0xf326=function(_0x2cc8f4,_0x3a75e3){_0x2cc8f4=_0x2cc8f4-0x0;var _0x494a04=_0x326f[_0x2cc8f4];return _0x494a04;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f0eda70..5cf2c0c 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','create','put','delete'];(function(_0x67bdf7,_0x1454d6){var _0x4bf147=function(_0x3a9c90){while(--_0x3a9c90){_0x67bdf7['push'](_0x67bdf7['shift']());}};_0x4bf147(++_0x1454d6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc4aa[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0x71ab=['getMessages','post','create','update','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x248bf0,_0x29a685){var _0x455c00=function(_0x44da4d){while(--_0x44da4d){_0x248bf0['push'](_0x248bf0['shift']());}};_0x455c00(++_0x29a685);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')]('/',auth[_0xb71a('0x9')](),controller[_0xb71a('0xa')]);router[_0xb71a('0x8')](_0xb71a('0xb'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xc')]);router[_0xb71a('0x8')](_0xb71a('0xd'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xe')]);router[_0xb71a('0xf')]('/',auth['isAuthenticated'](),controller[_0xb71a('0x10')]);router['put'](_0xb71a('0xb'),auth[_0xb71a('0x9')](),controller[_0xb71a('0x11')]);router['delete'](_0xb71a('0xb'),auth['isAuthenticated'](),controller[_0xb71a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index bfd1759..fe0f1c2 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 _0x2807=['STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports'];(function(_0x184304,_0x4e7d40){var _0x3fef86=function(_0x21a245){while(--_0x21a245){_0x184304['push'](_0x184304['shift']());}};_0x3fef86(++_0x4e7d40);}(_0x2807,0x1c0));var _0x7280=function(_0x2b400c,_0x3eb1b0){_0x2b400c=_0x2b400c-0x0;var _0x3ec13b=_0x2807[_0x2b400c];return _0x3ec13b;};'use strict';var Sequelize=require(_0x7280('0x0'));module[_0x7280('0x1')]={'customer_id':{'type':Sequelize[_0x7280('0x2')]},'context':{'type':Sequelize[_0x7280('0x2')],'defaultValue':_0x7280('0x3'),'unique':_0x7280('0x4')},'mailbox':{'type':Sequelize[_0x7280('0x2')],'defaultValue':'','allowNull':![],'unique':_0x7280('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x7280('0x2')]},'email':{'type':Sequelize[_0x7280('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5daeb1){this[_0x7280('0x5')]('email',typeof _0x5daeb1===_0x7280('0x6')&&_0x5daeb1[_0x7280('0x7')]()?_0x5daeb1[_0x7280('0x7')]():null);}},'pager':{'type':Sequelize[_0x7280('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x7280('0x8')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x7280('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7280('0xa')](_0x7280('0x9'),'no'),'defaultValue':_0x7280('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7280('0x2')]},'callback':{'type':Sequelize[_0x7280('0x2')]},'review':{'type':Sequelize['ENUM'](_0x7280('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7280('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7280('0xa')](_0x7280('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7280('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7280('0xa')](_0x7280('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7280('0xa')](_0x7280('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7280('0xa')](_0x7280('0x9'),'no'),'defaultValue':_0x7280('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7280('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7280('0xa')](_0x7280('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7280('0xa')](_0x7280('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x7280('0xc')},'emailsubject':{'type':Sequelize[_0x7280('0x2')]},'emailbody':{'type':Sequelize[_0x7280('0x2')]},'maxsecs':{'type':Sequelize[_0x7280('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7280('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7280('0xe')],'get':function(){return this[_0x7280('0xf')](_0x7280('0x10'))+'\x20-\x20'+this[_0x7280('0xf')](_0x7280('0x11'));}}}; \ No newline at end of file +var _0x2085=['ENUM','yes','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x2085,0x18f));var _0x5208=function(_0x28b3d7,_0x17b41d){_0x28b3d7=_0x28b3d7-0x0;var _0x49619d=_0x2085[_0x28b3d7];return _0x49619d;};'use strict';var Sequelize=require(_0x5208('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5208('0x1')],'defaultValue':_0x5208('0x2'),'unique':_0x5208('0x3')},'mailbox':{'type':Sequelize[_0x5208('0x1')],'defaultValue':'','allowNull':![],'unique':_0x5208('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x5208('0x1')]},'email':{'type':Sequelize[_0x5208('0x1')],'validate':{'isEmail':!![]},'set':function(_0x591041){this[_0x5208('0x4')](_0x5208('0x5'),typeof _0x591041===_0x5208('0x6')&&_0x591041[_0x5208('0x7')]()?_0x591041['trim']():null);}},'pager':{'type':Sequelize[_0x5208('0x1')]},'tz':{'type':Sequelize[_0x5208('0x1')],'defaultValue':_0x5208('0x8')},'attach':{'type':Sequelize[_0x5208('0x9')](_0x5208('0xa'),'no'),'defaultValue':_0x5208('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x5208('0xa'),'no'),'defaultValue':_0x5208('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x5208('0x1')]},'callback':{'type':Sequelize[_0x5208('0x1')]},'review':{'type':Sequelize['ENUM'](_0x5208('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5208('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5208('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5208('0x9')](_0x5208('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5208('0x9')](_0x5208('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5208('0x9')](_0x5208('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x5208('0x9')](_0x5208('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5208('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x5208('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x5208('0xb')},'emailsubject':{'type':Sequelize[_0x5208('0x1')]},'emailbody':{'type':Sequelize[_0x5208('0x1')]},'maxsecs':{'type':Sequelize[_0x5208('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5208('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x5208('0xd')](_0x5208('0xe'))+_0x5208('0xf')+this[_0x5208('0xd')](_0x5208('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index b416f59..e1f46cb 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 _0xdb94=['squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','send','index','map','VoiceMail','rawAttributes','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0xdb94,0xab));var _0x4db9=function(_0x21574c,_0x4f3c1a){_0x21574c=_0x21574c-0x0;var _0x4d8ade=_0xdb94[_0x21574c];return _0x4d8ade;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31222b,_0x5e644c){_0x5e644c=_0x5e644c||0xcc;return function(_0x571685){if(_0x571685){return _0x31222b[_0x4db9('0x17')](_0x5e644c);}return _0x31222b[_0x4db9('0x18')](_0x5e644c)['end']();};}function respondWithResult(_0xd37d63,_0x1f9638){_0x1f9638=_0x1f9638||0xc8;return function(_0x452896){if(_0x452896){return _0xd37d63[_0x4db9('0x18')](_0x1f9638)['json'](_0x452896);}};}function respondWithFilteredResult(_0x5e04ab,_0x102274){return function(_0x34de1a){if(_0x34de1a){var _0x4a037f=typeof _0x102274[_0x4db9('0x19')]===_0x4db9('0x1a')&&typeof _0x102274['limit']==='undefined';var _0x250a80=_0x34de1a[_0x4db9('0x1b')];var _0x462af3=_0x4a037f?0x0:_0x102274[_0x4db9('0x19')];var _0x1d3c33=_0x4a037f?_0x34de1a['count']:_0x102274[_0x4db9('0x19')]+_0x102274[_0x4db9('0x1c')];var _0x11012e;if(_0x1d3c33>=_0x250a80){_0x1d3c33=_0x250a80;_0x11012e=0xc8;}else{_0x11012e=0xce;}_0x5e04ab['status'](_0x11012e);return _0x5e04ab[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x462af3+'-'+_0x1d3c33+'/'+_0x250a80)[_0x4db9('0x1f')](_0x34de1a);}return null;};}function patchUpdates(_0x4c92e8){return function(_0x46b522){try{jsonpatch[_0x4db9('0x20')](_0x46b522,_0x4c92e8,!![]);}catch(_0x4553c2){return BPromise[_0x4db9('0x21')](_0x4553c2);}return _0x46b522[_0x4db9('0x22')]();};}function saveUpdates(_0x159d9b,_0x3585d5){return function(_0x5aef3b){if(_0x5aef3b){return _0x5aef3b[_0x4db9('0x23')](_0x159d9b)[_0x4db9('0x24')](function(_0xcde40c){return _0xcde40c;});}return null;};}function removeEntity(_0x319475,_0x4aaa84){return function(_0x213daa){if(_0x213daa){return _0x213daa[_0x4db9('0x25')]()['then'](function(){var _0x2e97ab=_0x213daa[_0x4db9('0x26')]({'plain':!![]});var _0x2987c6='Voicemails';return db[_0x4db9('0x27')][_0x4db9('0x25')]({'where':{'type':_0x2987c6,'resourceId':_0x2e97ab['id']}})[_0x4db9('0x24')](function(){return _0x213daa;});})[_0x4db9('0x24')](function(){_0x319475[_0x4db9('0x18')](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x385400,_0x2a56b8){return function(_0x3d0f12){if(!_0x3d0f12){_0x385400[_0x4db9('0x17')](0x194);}return _0x3d0f12;};}function handleError(_0x2fae0a,_0x355284){_0x355284=_0x355284||0x1f4;return function(_0x2d646d){logger[_0x4db9('0x29')](_0x2d646d['stack']);if(_0x2d646d['name']){delete _0x2d646d[_0x4db9('0x2a')];}_0x2fae0a[_0x4db9('0x18')](_0x355284)[_0x4db9('0x2b')](_0x2d646d);};}exports[_0x4db9('0x2c')]=function(_0x2af884,_0x459131){var _0x4dc946={},_0x375834={},_0x554eef={'count':0x0,'rows':[]};var _0x3b6a64=_[_0x4db9('0x2d')](db[_0x4db9('0x2e')][_0x4db9('0x2f')],function(_0x27d48c){return{'name':_0x27d48c['fieldName'],'type':_0x27d48c['type'][_0x4db9('0x30')]};});_0x375834['model']=_[_0x4db9('0x2d')](_0x3b6a64,_0x4db9('0x2a'));_0x375834['query']=_[_0x4db9('0x31')](_0x2af884[_0x4db9('0x32')]);_0x375834[_0x4db9('0x33')]=_['intersection'](_0x375834[_0x4db9('0x34')],_0x375834['query']);_0x4dc946[_0x4db9('0x35')]=_[_0x4db9('0x36')](_0x375834[_0x4db9('0x34')],qs['fields'](_0x2af884['query'][_0x4db9('0x37')]));_0x4dc946[_0x4db9('0x35')]=_0x4dc946[_0x4db9('0x35')][_0x4db9('0x38')]?_0x4dc946[_0x4db9('0x35')]:_0x375834[_0x4db9('0x34')];if(!_0x2af884[_0x4db9('0x32')][_0x4db9('0x39')](_0x4db9('0x3a'))){_0x4dc946['limit']=qs[_0x4db9('0x1c')](_0x2af884[_0x4db9('0x32')][_0x4db9('0x1c')]);_0x4dc946[_0x4db9('0x19')]=qs['offset'](_0x2af884[_0x4db9('0x32')][_0x4db9('0x19')]);}_0x4dc946[_0x4db9('0x3b')]=qs['sort'](_0x2af884[_0x4db9('0x32')][_0x4db9('0x3c')]);_0x4dc946[_0x4db9('0x3d')]=qs[_0x4db9('0x33')](_['pick'](_0x2af884['query'],_0x375834[_0x4db9('0x33')]),_0x3b6a64);if(_0x2af884[_0x4db9('0x32')][_0x4db9('0x3e')]){_0x4dc946[_0x4db9('0x3d')]=_[_0x4db9('0x3f')](_0x4dc946['where'],{'$or':_[_0x4db9('0x2d')](_0x3b6a64,function(_0x43b0d9){if(_0x43b0d9[_0x4db9('0x40')]!==_0x4db9('0x41')){var _0x2b2555={};_0x2b2555[_0x43b0d9['name']]={'$like':'%'+_0x2af884[_0x4db9('0x32')][_0x4db9('0x3e')]+'%'};return _0x2b2555;}})});}_0x4dc946=_[_0x4db9('0x3f')]({},_0x4dc946,_0x2af884['options']);var _0x37358f={'where':_0x4dc946[_0x4db9('0x3d')]};return db[_0x4db9('0x2e')][_0x4db9('0x1b')](_0x37358f)[_0x4db9('0x24')](function(_0x24aa2a){_0x554eef[_0x4db9('0x1b')]=_0x24aa2a;if(_0x2af884[_0x4db9('0x32')][_0x4db9('0x42')]){_0x4dc946[_0x4db9('0x43')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x4dc946);})['then'](function(_0x22a021){_0x554eef[_0x4db9('0x44')]=_0x22a021;return _0x554eef;})['then'](respondWithFilteredResult(_0x459131,_0x4dc946))[_0x4db9('0x45')](handleError(_0x459131,null));};exports[_0x4db9('0x46')]=function(_0x563416,_0x57a519){var _0x2eee28={'raw':!![],'where':{'id':_0x563416[_0x4db9('0x47')]['id']}},_0x4f6c51={};_0x4f6c51[_0x4db9('0x34')]=_['keys'](db[_0x4db9('0x2e')][_0x4db9('0x2f')]);_0x4f6c51['query']=_[_0x4db9('0x31')](_0x563416[_0x4db9('0x32')]);_0x4f6c51[_0x4db9('0x33')]=_['intersection'](_0x4f6c51['model'],_0x4f6c51[_0x4db9('0x32')]);_0x2eee28[_0x4db9('0x35')]=_[_0x4db9('0x36')](_0x4f6c51[_0x4db9('0x34')],qs[_0x4db9('0x37')](_0x563416[_0x4db9('0x32')][_0x4db9('0x37')]));_0x2eee28[_0x4db9('0x35')]=_0x2eee28[_0x4db9('0x35')][_0x4db9('0x38')]?_0x2eee28[_0x4db9('0x35')]:_0x4f6c51[_0x4db9('0x34')];if(_0x563416[_0x4db9('0x32')]['includeAll']){_0x2eee28[_0x4db9('0x43')]=[{'all':!![]}];}_0x2eee28=_[_0x4db9('0x3f')]({},_0x2eee28,_0x563416[_0x4db9('0x48')]);return db[_0x4db9('0x2e')][_0x4db9('0x49')](_0x2eee28)[_0x4db9('0x24')](handleEntityNotFound(_0x57a519,null))[_0x4db9('0x24')](respondWithResult(_0x57a519,null))[_0x4db9('0x45')](handleError(_0x57a519,null));};exports[_0x4db9('0x4a')]=function(_0x2d6094,_0x10dccb){return db['VoiceMail']['create'](_0x2d6094[_0x4db9('0x4b')],{})[_0x4db9('0x24')](function(_0x34b366){var _0x3e5131=_0x2d6094[_0x4db9('0x4c')][_0x4db9('0x26')]({'plain':!![]});if(!_0x3e5131)throw new Error(_0x4db9('0x4d'));if(_0x3e5131[_0x4db9('0x4e')]==='user'){var _0xd8eae3=_0x34b366[_0x4db9('0x26')]({'plain':!![]});var _0x121225=_0x4db9('0x4f');return db[_0x4db9('0x50')][_0x4db9('0x49')]({'where':{'name':_0x121225,'userProfileId':_0x3e5131[_0x4db9('0x51')]},'raw':!![]})[_0x4db9('0x24')](function(_0x479808){if(_0x479808&&_0x479808[_0x4db9('0x52')]===0x0){return db[_0x4db9('0x27')][_0x4db9('0x4a')]({'name':_0xd8eae3[_0x4db9('0x2a')],'resourceId':_0xd8eae3['id'],'type':_0x479808[_0x4db9('0x2a')],'sectionId':_0x479808['id']},{})[_0x4db9('0x24')](function(){return _0x34b366;});}else{return _0x34b366;}})['catch'](function(_0x188663){logger['error'](_0x4db9('0x53'),_0x188663);throw _0x188663;});}return _0x34b366;})['then'](respondWithResult(_0x10dccb,0xc9))['catch'](handleError(_0x10dccb,null));};exports[_0x4db9('0x23')]=function(_0x5996f2,_0x4643a1){if(_0x5996f2[_0x4db9('0x4b')]['id']){delete _0x5996f2[_0x4db9('0x4b')]['id'];}return db[_0x4db9('0x2e')]['find']({'where':{'id':_0x5996f2[_0x4db9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4643a1,null))[_0x4db9('0x24')](saveUpdates(_0x5996f2[_0x4db9('0x4b')],null))['then'](respondWithResult(_0x4643a1,null))[_0x4db9('0x45')](handleError(_0x4643a1,null));};exports['destroy']=function(_0x2e0a6f,_0x5731a0){return db[_0x4db9('0x2e')][_0x4db9('0x49')]({'where':{'id':_0x2e0a6f[_0x4db9('0x47')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0x5731a0,null))[_0x4db9('0x24')](removeEntity(_0x5731a0,null))[_0x4db9('0x45')](handleError(_0x5731a0,null));};exports[_0x4db9('0x54')]=function(_0x14251f,_0x19649c,_0x178ca5){return db[_0x4db9('0x2e')][_0x4db9('0x55')]({'where':{'id':_0x14251f[_0x4db9('0x47')]['id']}})['then'](handleEntityNotFound(_0x19649c,null))[_0x4db9('0x24')](function(_0x3ad16f){var _0x4c89c7;var _0x1bd7d4={},_0x3de5ef={};_0x3de5ef[_0x4db9('0x34')]=_[_0x4db9('0x31')](db[_0x4db9('0x56')][_0x4db9('0x2f')]);_0x3de5ef[_0x4db9('0x32')]=_[_0x4db9('0x31')](_0x14251f[_0x4db9('0x32')]);_0x3de5ef['filters']=_['intersection'](_0x3de5ef[_0x4db9('0x34')],_0x3de5ef[_0x4db9('0x32')]);_0x1bd7d4[_0x4db9('0x35')]=_[_0x4db9('0x36')](_0x3de5ef[_0x4db9('0x34')],qs[_0x4db9('0x37')](_0x14251f[_0x4db9('0x32')][_0x4db9('0x37')]));_0x1bd7d4[_0x4db9('0x35')]=_0x1bd7d4[_0x4db9('0x35')]['length']?_0x1bd7d4[_0x4db9('0x35')]:_0x3de5ef['model'];if(!_0x14251f['query']['hasOwnProperty']('nolimit')){_0x1bd7d4[_0x4db9('0x1c')]=qs['limit'](_0x14251f['query'][_0x4db9('0x1c')]);_0x1bd7d4[_0x4db9('0x19')]=qs[_0x4db9('0x19')](_0x14251f[_0x4db9('0x32')][_0x4db9('0x19')]);}_0x1bd7d4[_0x4db9('0x3b')]=qs[_0x4db9('0x3c')](_0x14251f[_0x4db9('0x32')][_0x4db9('0x3c')]);_0x1bd7d4[_0x4db9('0x3d')]=qs[_0x4db9('0x33')](_[_0x4db9('0x57')](_0x14251f[_0x4db9('0x32')],_0x3de5ef[_0x4db9('0x33')]));if(_0x14251f[_0x4db9('0x32')][_0x4db9('0x3e')]){_0x1bd7d4['where']=_['merge'](_0x1bd7d4['where'],{'$or':_[_0x4db9('0x2d')](_0x1bd7d4['attributes'],function(_0x12f062){var _0x747299={};_0x747299[_0x12f062]={'$like':'%'+_0x14251f[_0x4db9('0x32')]['filter']+'%'};return _0x747299;})});}_0x1bd7d4['where']=_[_0x4db9('0x3f')](_0x1bd7d4['where'],{'mailboxuser':_0x3ad16f[_0x4db9('0x58')]});_0x1bd7d4=_[_0x4db9('0x3f')]({},_0x1bd7d4,_0x14251f[_0x4db9('0x48')]);return db[_0x4db9('0x56')][_0x4db9('0x59')](_0x1bd7d4)['then'](respondWithFilteredResult(_0x19649c,_0x1bd7d4));})[_0x4db9('0x45')](handleError(_0x19649c,null));}; \ No newline at end of file +var _0x1339=['../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','get','Voicemails','UserProfileResource','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VoiceMail','count','includeAll','include','findAll','catch','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','VoiceMailMessage','pick','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1339,0x1ed));var _0x9133=function(_0x154335,_0x55ab67){_0x154335=_0x154335-0x0;var _0x296e83=_0x1339[_0x154335];return _0x296e83;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){var _0x187e32=_0x4f26e8[_0x9133('0x22')]({'plain':!![]});var _0x3f278d=_0x9133('0x23');return db[_0x9133('0x24')][_0x9133('0x21')]({'where':{'type':_0x3f278d,'resourceId':_0x187e32['id']}})[_0x9133('0x20')](function(){return _0x4f26e8;});})[_0x9133('0x20')](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x25')]();});}};}function handleEntityNotFound(_0x51de62,_0x517e7b){return function(_0x477bf1){if(!_0x477bf1){_0x51de62[_0x9133('0x26')](0x194);}return _0x477bf1;};}function handleError(_0x428e18,_0x348486){_0x348486=_0x348486||0x1f4;return function(_0x4de894){logger['error'](_0x4de894[_0x9133('0x27')]);if(_0x4de894[_0x9133('0x28')]){delete _0x4de894[_0x9133('0x28')];}_0x428e18[_0x9133('0x1a')](_0x348486)[_0x9133('0x29')](_0x4de894);};}exports[_0x9133('0x2a')]=function(_0x48c713,_0x58afe0){var _0x5a27c1={},_0x1ad222={},_0x4a4a8e={'count':0x0,'rows':[]};var _0x43b5f3=_[_0x9133('0x2b')](db['VoiceMail'][_0x9133('0x2c')],function(_0x5dd90b){return{'name':_0x5dd90b[_0x9133('0x2d')],'type':_0x5dd90b[_0x9133('0x2e')][_0x9133('0x2f')]};});_0x1ad222['model']=_[_0x9133('0x2b')](_0x43b5f3,_0x9133('0x28'));_0x1ad222[_0x9133('0x30')]=_['keys'](_0x48c713[_0x9133('0x30')]);_0x1ad222[_0x9133('0x31')]=_[_0x9133('0x32')](_0x1ad222['model'],_0x1ad222[_0x9133('0x30')]);_0x5a27c1[_0x9133('0x33')]=_[_0x9133('0x32')](_0x1ad222[_0x9133('0x34')],qs['fields'](_0x48c713[_0x9133('0x30')][_0x9133('0x35')]));_0x5a27c1['attributes']=_0x5a27c1[_0x9133('0x33')][_0x9133('0x36')]?_0x5a27c1[_0x9133('0x33')]:_0x1ad222[_0x9133('0x34')];if(!_0x48c713[_0x9133('0x30')][_0x9133('0x37')](_0x9133('0x38'))){_0x5a27c1[_0x9133('0x1d')]=qs[_0x9133('0x1d')](_0x48c713[_0x9133('0x30')][_0x9133('0x1d')]);_0x5a27c1['offset']=qs[_0x9133('0x1e')](_0x48c713[_0x9133('0x30')]['offset']);}_0x5a27c1[_0x9133('0x39')]=qs[_0x9133('0x3a')](_0x48c713[_0x9133('0x30')][_0x9133('0x3a')]);_0x5a27c1[_0x9133('0x3b')]=qs[_0x9133('0x31')](_['pick'](_0x48c713['query'],_0x1ad222[_0x9133('0x31')]),_0x43b5f3);if(_0x48c713[_0x9133('0x30')][_0x9133('0x3c')]){_0x5a27c1[_0x9133('0x3b')]=_[_0x9133('0x3d')](_0x5a27c1[_0x9133('0x3b')],{'$or':_[_0x9133('0x2b')](_0x43b5f3,function(_0x2ee83e){if(_0x2ee83e[_0x9133('0x2e')]!=='VIRTUAL'){var _0xafd8f9={};_0xafd8f9[_0x2ee83e[_0x9133('0x28')]]={'$like':'%'+_0x48c713[_0x9133('0x30')][_0x9133('0x3c')]+'%'};return _0xafd8f9;}})});}_0x5a27c1=_[_0x9133('0x3d')]({},_0x5a27c1,_0x48c713['options']);var _0x3c691e={'where':_0x5a27c1[_0x9133('0x3b')]};return db[_0x9133('0x3e')][_0x9133('0x3f')](_0x3c691e)['then'](function(_0x146734){_0x4a4a8e[_0x9133('0x3f')]=_0x146734;if(_0x48c713[_0x9133('0x30')][_0x9133('0x40')]){_0x5a27c1[_0x9133('0x41')]=[{'all':!![]}];}return db[_0x9133('0x3e')][_0x9133('0x42')](_0x5a27c1);})['then'](function(_0x7f6cd9){_0x4a4a8e['rows']=_0x7f6cd9;return _0x4a4a8e;})['then'](respondWithFilteredResult(_0x58afe0,_0x5a27c1))[_0x9133('0x43')](handleError(_0x58afe0,null));};exports[_0x9133('0x44')]=function(_0x46156d,_0x264df4){var _0xdd485f={'raw':!![],'where':{'id':_0x46156d[_0x9133('0x45')]['id']}},_0x2d2bf7={};_0x2d2bf7[_0x9133('0x34')]=_[_0x9133('0x46')](db['VoiceMail'][_0x9133('0x2c')]);_0x2d2bf7[_0x9133('0x30')]=_[_0x9133('0x46')](_0x46156d['query']);_0x2d2bf7['filters']=_[_0x9133('0x32')](_0x2d2bf7[_0x9133('0x34')],_0x2d2bf7['query']);_0xdd485f[_0x9133('0x33')]=_[_0x9133('0x32')](_0x2d2bf7[_0x9133('0x34')],qs[_0x9133('0x35')](_0x46156d[_0x9133('0x30')]['fields']));_0xdd485f[_0x9133('0x33')]=_0xdd485f[_0x9133('0x33')][_0x9133('0x36')]?_0xdd485f['attributes']:_0x2d2bf7[_0x9133('0x34')];if(_0x46156d[_0x9133('0x30')]['includeAll']){_0xdd485f['include']=[{'all':!![]}];}_0xdd485f=_[_0x9133('0x3d')]({},_0xdd485f,_0x46156d[_0x9133('0x47')]);return db[_0x9133('0x3e')][_0x9133('0x48')](_0xdd485f)[_0x9133('0x20')](handleEntityNotFound(_0x264df4,null))[_0x9133('0x20')](respondWithResult(_0x264df4,null))[_0x9133('0x43')](handleError(_0x264df4,null));};exports[_0x9133('0x49')]=function(_0x23f134,_0xf07fbb){return db[_0x9133('0x3e')][_0x9133('0x49')](_0x23f134['body'],{})['then'](function(_0xf2e098){var _0x4dc2f3=_0x23f134[_0x9133('0x4a')][_0x9133('0x22')]({'plain':!![]});if(!_0x4dc2f3)throw new Error(_0x9133('0x4b'));if(_0x4dc2f3[_0x9133('0x4c')]==='user'){var _0x2a3848=_0xf2e098[_0x9133('0x22')]({'plain':!![]});var _0x799772='Voicemails';return db[_0x9133('0x4d')][_0x9133('0x48')]({'where':{'name':_0x799772,'userProfileId':_0x4dc2f3[_0x9133('0x4e')]},'raw':!![]})['then'](function(_0x14c825){if(_0x14c825&&_0x14c825['autoAssociation']===0x0){return db[_0x9133('0x24')][_0x9133('0x49')]({'name':_0x2a3848[_0x9133('0x28')],'resourceId':_0x2a3848['id'],'type':_0x14c825[_0x9133('0x28')],'sectionId':_0x14c825['id']},{})['then'](function(){return _0xf2e098;});}else{return _0xf2e098;}})['catch'](function(_0x2f09f6){logger[_0x9133('0x4f')](_0x9133('0x50'),_0x2f09f6);throw _0x2f09f6;});}return _0xf2e098;})[_0x9133('0x20')](respondWithResult(_0xf07fbb,0xc9))[_0x9133('0x43')](handleError(_0xf07fbb,null));};exports['update']=function(_0x554bb9,_0x33599b){if(_0x554bb9[_0x9133('0x51')]['id']){delete _0x554bb9['body']['id'];}return db[_0x9133('0x3e')][_0x9133('0x48')]({'where':{'id':_0x554bb9['params']['id']}})['then'](handleEntityNotFound(_0x33599b,null))['then'](saveUpdates(_0x554bb9[_0x9133('0x51')],null))['then'](respondWithResult(_0x33599b,null))[_0x9133('0x43')](handleError(_0x33599b,null));};exports[_0x9133('0x21')]=function(_0x439258,_0x3d6daa){return db['VoiceMail'][_0x9133('0x48')]({'where':{'id':_0x439258['params']['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x3d6daa,null))[_0x9133('0x20')](removeEntity(_0x3d6daa,null))[_0x9133('0x43')](handleError(_0x3d6daa,null));};exports[_0x9133('0x52')]=function(_0x3b9927,_0x3534bf,_0x56861c){return db['VoiceMail']['findOne']({'where':{'id':_0x3b9927[_0x9133('0x45')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x3534bf,null))[_0x9133('0x20')](function(_0x54a330){var _0x3f4cd7;var _0x1f6684={},_0x415d55={};_0x415d55[_0x9133('0x34')]=_[_0x9133('0x46')](db[_0x9133('0x53')][_0x9133('0x2c')]);_0x415d55[_0x9133('0x30')]=_['keys'](_0x3b9927[_0x9133('0x30')]);_0x415d55['filters']=_[_0x9133('0x32')](_0x415d55['model'],_0x415d55[_0x9133('0x30')]);_0x1f6684[_0x9133('0x33')]=_['intersection'](_0x415d55['model'],qs[_0x9133('0x35')](_0x3b9927[_0x9133('0x30')][_0x9133('0x35')]));_0x1f6684[_0x9133('0x33')]=_0x1f6684[_0x9133('0x33')][_0x9133('0x36')]?_0x1f6684[_0x9133('0x33')]:_0x415d55[_0x9133('0x34')];if(!_0x3b9927[_0x9133('0x30')][_0x9133('0x37')](_0x9133('0x38'))){_0x1f6684['limit']=qs[_0x9133('0x1d')](_0x3b9927['query'][_0x9133('0x1d')]);_0x1f6684[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x3b9927[_0x9133('0x30')][_0x9133('0x1e')]);}_0x1f6684['order']=qs[_0x9133('0x3a')](_0x3b9927[_0x9133('0x30')][_0x9133('0x3a')]);_0x1f6684[_0x9133('0x3b')]=qs['filters'](_[_0x9133('0x54')](_0x3b9927[_0x9133('0x30')],_0x415d55[_0x9133('0x31')]));if(_0x3b9927[_0x9133('0x30')]['filter']){_0x1f6684['where']=_[_0x9133('0x3d')](_0x1f6684[_0x9133('0x3b')],{'$or':_[_0x9133('0x2b')](_0x1f6684[_0x9133('0x33')],function(_0x28cc46){var _0x2cfaf8={};_0x2cfaf8[_0x28cc46]={'$like':'%'+_0x3b9927['query'][_0x9133('0x3c')]+'%'};return _0x2cfaf8;})});}_0x1f6684[_0x9133('0x3b')]=_[_0x9133('0x3d')](_0x1f6684[_0x9133('0x3b')],{'mailboxuser':_0x54a330['mailbox']});_0x1f6684=_[_0x9133('0x3d')]({},_0x1f6684,_0x3b9927['options']);return db[_0x9133('0x53')][_0x9133('0x55')](_0x1f6684)[_0x9133('0x20')](respondWithFilteredResult(_0x3534bf,_0x1f6684));})[_0x9133('0x43')](handleError(_0x3534bf,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 43c5dfc..47750b6 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 _0xcb66=['mailbox','context','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail'];(function(_0xb92ae2,_0x438cf4){var _0xd2a98f=function(_0x2bd17b){while(--_0x2bd17b){_0xb92ae2['push'](_0xb92ae2['shift']());}};_0xd2a98f(++_0x438cf4);}(_0xcb66,0x11a));var _0x6cb6=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0xcb66[_0x1f3aec];return _0x409f0d;};'use strict';var _=require(_0x6cb6('0x0'));var util=require(_0x6cb6('0x1'));var logger=require(_0x6cb6('0x2'))(_0x6cb6('0x3'));var moment=require('moment');var BPromise=require(_0x6cb6('0x4'));var rp=require(_0x6cb6('0x5'));var fs=require('fs');var path=require(_0x6cb6('0x6'));var rimraf=require('rimraf');var config=require(_0x6cb6('0x7'));var attributes=require(_0x6cb6('0x8'));module[_0x6cb6('0x9')]=function(_0x533e5b,_0x338693){return _0x533e5b['define'](_0x6cb6('0xa'),attributes,{'tableName':_0x6cb6('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x6cb6('0xc'),_0x6cb6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd464=['mailbox_context','mailbox','context','lodash','../../config/logger','api','moment','request-promise','path','./voiceMail.attributes','define'];(function(_0x1ca44a,_0xf20d70){var _0x3e9ee6=function(_0xa8e7b0){while(--_0xa8e7b0){_0x1ca44a['push'](_0x1ca44a['shift']());}};_0x3e9ee6(++_0xf20d70);}(_0xd464,0x1b0));var _0x4d46=function(_0x48ee7f,_0x438877){_0x48ee7f=_0x48ee7f-0x0;var _0x265aac=_0xd464[_0x48ee7f];return _0x265aac;};'use strict';var _=require(_0x4d46('0x0'));var util=require('util');var logger=require(_0x4d46('0x1'))(_0x4d46('0x2'));var moment=require(_0x4d46('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d46('0x4'));var fs=require('fs');var path=require(_0x4d46('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4d46('0x6'));module['exports']=function(_0x154bbc,_0x182fa6){return _0x154bbc[_0x4d46('0x7')]('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x4d46('0x8'),'fields':[_0x4d46('0x9'),_0x4d46('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index a52aa89..c49677f 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 _0x36b1=['request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x1d600c,_0x22746b){var _0x404f2b=function(_0x3fc712){while(--_0x3fc712){_0x1d600c['push'](_0x1d600c['shift']());}};_0x404f2b(++_0x22746b);}(_0x36b1,0xd4));var _0x136b=function(_0x578dd7,_0x2be42a){_0x578dd7=_0x578dd7-0x0;var _0x149b1d=_0x36b1[_0x578dd7];return _0x149b1d;};'use strict';var _=require(_0x136b('0x0'));var util=require(_0x136b('0x1'));var moment=require(_0x136b('0x2'));var BPromise=require(_0x136b('0x3'));var rs=require(_0x136b('0x4'));var fs=require('fs');var Redis=require(_0x136b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x136b('0x6'));var logger=require(_0x136b('0x7'))(_0x136b('0x8'));var config=require('../../config/environment');var jayson=require(_0x136b('0x9'));var client=jayson[_0x136b('0xa')][_0x136b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbaffa9,_0x5942bf,_0x223ba1){return new BPromise(function(_0x658f1c,_0x329cec){return client[_0x136b('0xc')](_0xbaffa9,_0x223ba1)[_0x136b('0xd')](function(_0x66692f){logger[_0x136b('0xe')](_0x136b('0xf'),_0x5942bf,'request\x20sent');logger[_0x136b('0x10')](_0x136b('0x11'),_0x5942bf,_0x136b('0x12'),JSON['stringify'](_0x66692f));if(_0x66692f[_0x136b('0x13')]){if(_0x66692f[_0x136b('0x13')]['code']===0x1f4){logger[_0x136b('0x13')](_0x136b('0xf'),_0x5942bf,_0x66692f['error'][_0x136b('0x14')]);return _0x329cec(_0x66692f['error'][_0x136b('0x14')]);}logger[_0x136b('0x13')]('VoiceMail,\x20%s,\x20%s',_0x5942bf,_0x66692f[_0x136b('0x13')][_0x136b('0x14')]);return _0x658f1c(_0x66692f[_0x136b('0x13')][_0x136b('0x14')]);}else{logger[_0x136b('0xe')](_0x136b('0xf'),_0x5942bf,'request\x20sent');_0x658f1c(_0x66692f[_0x136b('0x15')]['message']);}})[_0x136b('0x16')](function(_0x4e4a59){logger[_0x136b('0x13')](_0x136b('0xf'),_0x5942bf,_0x4e4a59);_0x329cec(_0x4e4a59);});});} \ No newline at end of file +var _0x594e=['result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x38c9b0,_0x11b555){var _0x306434=function(_0x1e17b0){while(--_0x1e17b0){_0x38c9b0['push'](_0x38c9b0['shift']());}};_0x306434(++_0x11b555);}(_0x594e,0xc8));var _0xe594=function(_0x24376f,_0x3985d9){_0x24376f=_0x24376f-0x0;var _0x53d899=_0x594e[_0x24376f];return _0x53d899;};'use strict';var _=require(_0xe594('0x0'));var util=require(_0xe594('0x1'));var moment=require(_0xe594('0x2'));var BPromise=require('bluebird');var rs=require(_0xe594('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe594('0x4'));var logger=require(_0xe594('0x5'))(_0xe594('0x6'));var config=require('../../config/environment');var jayson=require(_0xe594('0x7'));var client=jayson[_0xe594('0x8')][_0xe594('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ce439,_0x2c061d,_0x5c5cdd){return new BPromise(function(_0x52ecf7,_0x7b5475){return client[_0xe594('0xa')](_0x2ce439,_0x5c5cdd)['then'](function(_0x29722f){logger[_0xe594('0xb')](_0xe594('0xc'),_0x2c061d,_0xe594('0xd'));logger[_0xe594('0xe')](_0xe594('0xf'),_0x2c061d,_0xe594('0xd'),JSON[_0xe594('0x10')](_0x29722f));if(_0x29722f['error']){if(_0x29722f[_0xe594('0x11')][_0xe594('0x12')]===0x1f4){logger[_0xe594('0x11')](_0xe594('0xc'),_0x2c061d,_0x29722f[_0xe594('0x11')][_0xe594('0x13')]);return _0x7b5475(_0x29722f[_0xe594('0x11')][_0xe594('0x13')]);}logger[_0xe594('0x11')](_0xe594('0xc'),_0x2c061d,_0x29722f['error'][_0xe594('0x13')]);return _0x52ecf7(_0x29722f[_0xe594('0x11')][_0xe594('0x13')]);}else{logger[_0xe594('0xb')](_0xe594('0xc'),_0x2c061d,_0xe594('0xd'));_0x52ecf7(_0x29722f[_0xe594('0x14')]['message']);}})[_0xe594('0x15')](function(_0x225913){logger[_0xe594('0x11')](_0xe594('0xc'),_0x2c061d,_0x225913);_0x7b5475(_0x225913);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 301c321..ca28f2a 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 _0xfc50=['update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put'];(function(_0x891c55,_0x233fe8){var _0x260823=function(_0x1e3f67){while(--_0x1e3f67){_0x891c55['push'](_0x891c55['shift']());}};_0x260823(++_0x233fe8);}(_0xfc50,0x11b));var _0x0fc5=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xfc50[_0x47b58b];return _0x46bebe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0fc5('0x0'));var timeout=require(_0x0fc5('0x1'));var express=require(_0x0fc5('0x2'));var router=express[_0x0fc5('0x3')]();var fs_extra=require(_0x0fc5('0x4'));var auth=require(_0x0fc5('0x5'));var interaction=require(_0x0fc5('0x6'));var config=require(_0x0fc5('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x0fc5('0x8')]('/',auth[_0x0fc5('0x9')](),controller[_0x0fc5('0xa')]);router['get'](_0x0fc5('0xb'),auth[_0x0fc5('0x9')](),controller['show']);router[_0x0fc5('0x8')](_0x0fc5('0xc'),auth['isAuthenticated'](),controller[_0x0fc5('0xd')]);router[_0x0fc5('0xe')]('/',auth[_0x0fc5('0x9')](),controller[_0x0fc5('0xf')]);router[_0x0fc5('0x10')](_0x0fc5('0xb'),auth[_0x0fc5('0x9')](),controller[_0x0fc5('0x11')]);router['delete'](_0x0fc5('0xb'),auth[_0x0fc5('0x9')](),controller[_0x0fc5('0x12')]);module[_0x0fc5('0x13')]=router; \ No newline at end of file +var _0xd081=['index','show','/:id/download','download','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x2ac174,_0x315920){var _0x553047=function(_0x305b3e){while(--_0x305b3e){_0x2ac174['push'](_0x2ac174['shift']());}};_0x553047(++_0x315920);}(_0xd081,0x82));var _0x1d08=function(_0x451a8b,_0x4ab2b9){_0x451a8b=_0x451a8b-0x0;var _0x444ba8=_0xd081[_0x451a8b];return _0x444ba8;};'use strict';var multer=require(_0x1d08('0x0'));var util=require(_0x1d08('0x1'));var path=require('path');var timeout=require(_0x1d08('0x2'));var express=require(_0x1d08('0x3'));var router=express[_0x1d08('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1d08('0x5'));var config=require(_0x1d08('0x6'));var controller=require(_0x1d08('0x7'));router[_0x1d08('0x8')]('/',auth[_0x1d08('0x9')](),controller[_0x1d08('0xa')]);router['get']('/:id',auth[_0x1d08('0x9')](),controller[_0x1d08('0xb')]);router[_0x1d08('0x8')](_0x1d08('0xc'),auth[_0x1d08('0x9')](),controller[_0x1d08('0xd')]);router[_0x1d08('0xe')]('/',auth[_0x1d08('0x9')](),controller[_0x1d08('0xf')]);router['put'](_0x1d08('0x10'),auth[_0x1d08('0x9')](),controller[_0x1d08('0x11')]);router['delete'](_0x1d08('0x10'),auth[_0x1d08('0x9')](),controller[_0x1d08('0x12')]);module[_0x1d08('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 94dafbb..52fa842 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 _0x82c8=['sequelize','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x4ca6bd,_0x3c1812){var _0x11d260=function(_0x384eb7){while(--_0x384eb7){_0x4ca6bd['push'](_0x4ca6bd['shift']());}};_0x11d260(++_0x3c1812);}(_0x82c8,0x183));var _0x882c=function(_0x1b9e74,_0x27c73e){_0x1b9e74=_0x1b9e74-0x0;var _0x289553=_0x82c8[_0x1b9e74];return _0x289553;};'use strict';var Sequelize=require(_0x882c('0x0'));module['exports']={'name':{'type':Sequelize[_0x882c('0x1')],'get':function(_0xb9a2b8){return this[_0x882c('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x882c('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x882c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x882c('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x882c('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x882c('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x882c('0x4')](_0x882c('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x882c('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x882c('0x3')],'defaultValue':''},'stamp':{'type':_0x882c('0x6'),'defaultValue':Sequelize[_0x882c('0x7')](_0x882c('0x8'))}}; \ No newline at end of file +var _0xc12c=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','INTEGER','STRING','BLOB','TIMESTAMP','literal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc12c,0x81));var _0xcc12=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc12c[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xcc12('0x0'));module['exports']={'name':{'type':Sequelize[_0xcc12('0x1')],'get':function(_0x315ede){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xcc12('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xcc12('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xcc12('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xcc12('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xcc12('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xcc12('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xcc12('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xcc12('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xcc12('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xcc12('0x3')],'defaultValue':''},'stamp':{'type':_0xcc12('0x5'),'defaultValue':Sequelize[_0xcc12('0x6')](_0xcc12('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 35c9e03..c8ff7de 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 _0x3aab=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','destroy','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','then','include','findAll','catch','includeAll','options','create','body','find','params','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0xddccb1,_0x468b7a){var _0x44ad80=function(_0x38ac38){while(--_0x38ac38){_0xddccb1['push'](_0xddccb1['shift']());}};_0x44ad80(++_0x468b7a);}(_0x3aab,0x1f0));var _0xb3aa=function(_0x235c6d,_0x40280b){_0x235c6d=_0x235c6d-0x0;var _0x328f85=_0x3aab[_0x235c6d];return _0x328f85;};'use strict';var emlformat=require(_0xb3aa('0x0'));var rimraf=require(_0xb3aa('0x1'));var zipdir=require(_0xb3aa('0x2'));var jsonpatch=require(_0xb3aa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb3aa('0x4'));var Mustache=require(_0xb3aa('0x5'));var util=require('util');var path=require(_0xb3aa('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb3aa('0x7'));var fs=require('fs');var fs_extra=require(_0xb3aa('0x8'));var _=require(_0xb3aa('0x9'));var squel=require(_0xb3aa('0xa'));var crypto=require(_0xb3aa('0xb'));var jsforce=require(_0xb3aa('0xc'));var deskjs=require(_0xb3aa('0xd'));var toCsv=require(_0xb3aa('0xe'));var querystring=require(_0xb3aa('0xf'));var Papa=require(_0xb3aa('0x10'));var Redis=require('ioredis');var authService=require(_0xb3aa('0x11'));var qs=require(_0xb3aa('0x12'));var as=require(_0xb3aa('0x13'));var hardwareService=require(_0xb3aa('0x14'));var logger=require(_0xb3aa('0x15'))(_0xb3aa('0x16'));var utils=require(_0xb3aa('0x17'));var config=require(_0xb3aa('0x18'));var licenseUtil=require(_0xb3aa('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b599c,_0x6e2a72){_0x6e2a72=_0x6e2a72||0xcc;return function(_0x1d1d01){if(_0x1d1d01){return _0x4b599c[_0xb3aa('0x1a')](_0x6e2a72);}return _0x4b599c[_0xb3aa('0x1b')](_0x6e2a72)[_0xb3aa('0x1c')]();};}function respondWithResult(_0x2f3685,_0x212abc){_0x212abc=_0x212abc||0xc8;return function(_0x27b82e){if(_0x27b82e){return _0x2f3685[_0xb3aa('0x1b')](_0x212abc)['json'](_0x27b82e);}};}function respondWithFilteredResult(_0xb36c65,_0x2bb04e){return function(_0x34fcf1){if(_0x34fcf1){var _0x537cb9=typeof _0x2bb04e[_0xb3aa('0x1d')]==='undefined'&&typeof _0x2bb04e['limit']===_0xb3aa('0x1e');var _0x5a38f1=_0x34fcf1[_0xb3aa('0x1f')];var _0x4ed5e9=_0x537cb9?0x0:_0x2bb04e[_0xb3aa('0x1d')];var _0x14d6f8=_0x537cb9?_0x34fcf1['count']:_0x2bb04e['offset']+_0x2bb04e[_0xb3aa('0x20')];var _0x4be09c;if(_0x14d6f8>=_0x5a38f1){_0x14d6f8=_0x5a38f1;_0x4be09c=0xc8;}else{_0x4be09c=0xce;}_0xb36c65[_0xb3aa('0x1b')](_0x4be09c);return _0xb36c65['set'](_0xb3aa('0x21'),_0x4ed5e9+'-'+_0x14d6f8+'/'+_0x5a38f1)[_0xb3aa('0x22')](_0x34fcf1);}return null;};}function patchUpdates(_0x55b61a){return function(_0x531b9c){try{jsonpatch['apply'](_0x531b9c,_0x55b61a,!![]);}catch(_0x27e4fc){return BPromise[_0xb3aa('0x23')](_0x27e4fc);}return _0x531b9c[_0xb3aa('0x24')]();};}function saveUpdates(_0x357171,_0x57409d){return function(_0x406b06){if(_0x406b06){return _0x406b06[_0xb3aa('0x25')](_0x357171)['then'](function(_0xbb7785){return _0xbb7785;});}return null;};}function removeEntity(_0x571954,_0x1263d2){return function(_0x2a0763){if(_0x2a0763){return _0x2a0763[_0xb3aa('0x26')]()['then'](function(){_0x571954[_0xb3aa('0x1b')](0xcc)[_0xb3aa('0x1c')]();});}};}function handleEntityNotFound(_0x4a16a1,_0x440bfb){return function(_0x3c6820){if(!_0x3c6820){_0x4a16a1[_0xb3aa('0x1a')](0x194);}return _0x3c6820;};}function handleError(_0x11c58d,_0x5f3e5b){_0x5f3e5b=_0x5f3e5b||0x1f4;return function(_0x5eaf61){logger['error'](_0x5eaf61[_0xb3aa('0x27')]);if(_0x5eaf61['name']){delete _0x5eaf61[_0xb3aa('0x28')];}_0x11c58d['status'](_0x5f3e5b)[_0xb3aa('0x29')](_0x5eaf61);};}exports[_0xb3aa('0x2a')]=function(_0xcca7a,_0x3c95d5){var _0x23e07a={},_0x3cd7d0={},_0x15289b={'count':0x0,'rows':[]};var _0x29b9d7=_[_0xb3aa('0x2b')](db[_0xb3aa('0x2c')][_0xb3aa('0x2d')],function(_0x34c8c1){return{'name':_0x34c8c1[_0xb3aa('0x2e')],'type':_0x34c8c1['type'][_0xb3aa('0x2f')]};});_0x3cd7d0[_0xb3aa('0x30')]=_[_0xb3aa('0x31')](_[_0xb3aa('0x2b')](_0x29b9d7,_0xb3aa('0x28')),[_0xb3aa('0x28')]);_0x3cd7d0['query']=_[_0xb3aa('0x32')](_0xcca7a['query']);_0x3cd7d0[_0xb3aa('0x33')]=_[_0xb3aa('0x34')](_0x3cd7d0[_0xb3aa('0x30')],_0x3cd7d0['query']);_0x23e07a[_0xb3aa('0x35')]=_[_0xb3aa('0x34')](_0x3cd7d0['model'],qs[_0xb3aa('0x36')](_0xcca7a[_0xb3aa('0x37')][_0xb3aa('0x36')]));_0x23e07a[_0xb3aa('0x35')]=_0x23e07a['attributes']['length']?_0x23e07a[_0xb3aa('0x35')]:_0x3cd7d0['model'];if(!_0xcca7a['query'][_0xb3aa('0x38')](_0xb3aa('0x39'))){_0x23e07a['limit']=qs['limit'](_0xcca7a[_0xb3aa('0x37')]['limit']);_0x23e07a[_0xb3aa('0x1d')]=qs[_0xb3aa('0x1d')](_0xcca7a[_0xb3aa('0x37')][_0xb3aa('0x1d')]);}_0x23e07a[_0xb3aa('0x3a')]=qs['sort'](_0xcca7a['query'][_0xb3aa('0x3b')]);_0x23e07a[_0xb3aa('0x3c')]=qs[_0xb3aa('0x33')](_[_0xb3aa('0x3d')](_0xcca7a[_0xb3aa('0x37')],_0x3cd7d0[_0xb3aa('0x33')]),_0x29b9d7);if(_0xcca7a[_0xb3aa('0x37')][_0xb3aa('0x3e')]){_0x23e07a['where']=_[_0xb3aa('0x3f')](_0x23e07a[_0xb3aa('0x3c')],{'$or':_['map'](_0x29b9d7,function(_0xa552cb){if(_0xa552cb[_0xb3aa('0x40')]!==_0xb3aa('0x41')){var _0x349313={};_0x349313[_0xa552cb[_0xb3aa('0x28')]]={'$like':'%'+_0xcca7a[_0xb3aa('0x37')]['filter']+'%'};return _0x349313;}})});}_0x23e07a=_[_0xb3aa('0x3f')]({},_0x23e07a,_0xcca7a['options']);var _0x135d43={'where':_0x23e07a[_0xb3aa('0x3c')]};return db['VoiceMailMessage'][_0xb3aa('0x1f')](_0x135d43)[_0xb3aa('0x42')](function(_0x33f3ed){_0x15289b[_0xb3aa('0x1f')]=_0x33f3ed;if(_0xcca7a['query']['includeAll']){_0x23e07a[_0xb3aa('0x43')]=[{'all':!![]}];}return db[_0xb3aa('0x2c')][_0xb3aa('0x44')](_0x23e07a);})[_0xb3aa('0x42')](function(_0x538cc3){_0x15289b['rows']=_0x538cc3;return _0x15289b;})[_0xb3aa('0x42')](respondWithFilteredResult(_0x3c95d5,_0x23e07a))[_0xb3aa('0x45')](handleError(_0x3c95d5,null));};exports['show']=function(_0xc80c75,_0x2ea6ca){var _0x135c7a={'raw':!![],'where':{'id':_0xc80c75['params']['id']}},_0x3c392c={};_0x3c392c['model']=_[_0xb3aa('0x32')](db['VoiceMailMessage'][_0xb3aa('0x2d')]);_0x3c392c[_0xb3aa('0x37')]=_['keys'](_0xc80c75[_0xb3aa('0x37')]);_0x3c392c[_0xb3aa('0x33')]=_[_0xb3aa('0x34')](_0x3c392c[_0xb3aa('0x30')],_0x3c392c[_0xb3aa('0x37')]);_0x135c7a['attributes']=_[_0xb3aa('0x34')](_0x3c392c[_0xb3aa('0x30')],qs[_0xb3aa('0x36')](_0xc80c75[_0xb3aa('0x37')]['fields']));_0x135c7a['attributes']=_0x135c7a[_0xb3aa('0x35')]['length']?_0x135c7a[_0xb3aa('0x35')]:_0x3c392c['model'];if(_0xc80c75['query'][_0xb3aa('0x46')]){_0x135c7a[_0xb3aa('0x43')]=[{'all':!![]}];}_0x135c7a=_[_0xb3aa('0x3f')]({},_0x135c7a,_0xc80c75[_0xb3aa('0x47')]);return db[_0xb3aa('0x2c')]['find'](_0x135c7a)[_0xb3aa('0x42')](handleEntityNotFound(_0x2ea6ca,null))[_0xb3aa('0x42')](respondWithResult(_0x2ea6ca,null))['catch'](handleError(_0x2ea6ca,null));};exports[_0xb3aa('0x48')]=function(_0x20b71b,_0x5c5e0f){return db[_0xb3aa('0x2c')][_0xb3aa('0x48')](_0x20b71b[_0xb3aa('0x49')],{})[_0xb3aa('0x42')](respondWithResult(_0x5c5e0f,0xc9))[_0xb3aa('0x45')](handleError(_0x5c5e0f,null));};exports[_0xb3aa('0x25')]=function(_0x3e45cc,_0x3ce1b4){if(_0x3e45cc[_0xb3aa('0x49')]['id']){delete _0x3e45cc[_0xb3aa('0x49')]['id'];}return db[_0xb3aa('0x2c')][_0xb3aa('0x4a')]({'where':{'id':_0x3e45cc[_0xb3aa('0x4b')]['id']}})[_0xb3aa('0x42')](handleEntityNotFound(_0x3ce1b4,null))[_0xb3aa('0x42')](saveUpdates(_0x3e45cc[_0xb3aa('0x49')],null))[_0xb3aa('0x42')](respondWithResult(_0x3ce1b4,null))['catch'](handleError(_0x3ce1b4,null));};exports[_0xb3aa('0x26')]=function(_0x14b59b,_0x4e1260){return db[_0xb3aa('0x2c')]['find']({'where':{'id':_0x14b59b['params']['id']}})[_0xb3aa('0x42')](handleEntityNotFound(_0x4e1260,null))[_0xb3aa('0x42')](removeEntity(_0x4e1260,null))[_0xb3aa('0x45')](handleError(_0x4e1260,null));};exports['download']=function(_0x1e2437,_0x224265,_0x4b0acd){return db['VoiceMailMessage'][_0xb3aa('0x4a')]({'where':{'id':_0x1e2437['params']['id']},'attributes':['id',_0xb3aa('0x4c'),_0xb3aa('0x4d')]})[_0xb3aa('0x42')](handleEntityNotFound(_0x224265,null))['then'](function(_0x332f2c){if(_0x332f2c){if(!_0x332f2c[_0xb3aa('0x4c')]){throw new db[(_0xb3aa('0x4e'))][(_0xb3aa('0x4f'))](_0xb3aa('0x50'));}var _0x12ab28={'Content-Type':_0xb3aa('0x51'),'Content-Disposition':'attachment'};if(_0x332f2c['msg_id']){_0x12ab28['Content-Disposition']=_0xb3aa('0x52')+_0x332f2c[_0xb3aa('0x4d')]+_0xb3aa('0x53');}_0x224265[_0xb3aa('0x54')](_0x12ab28);return _0x224265[_0xb3aa('0x29')](new Buffer(_0x332f2c[_0xb3aa('0x4c')]));}})[_0xb3aa('0x45')](handleError(_0x224265,null));}; \ No newline at end of file +var _0xa4ae=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','params','keys','length','find','create','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query'];(function(_0x5eed46,_0x3ed432){var _0x1955d3=function(_0x220494){while(--_0x220494){_0x5eed46['push'](_0x5eed46['shift']());}};_0x1955d3(++_0x3ed432);}(_0xa4ae,0x11c));var _0xea4a=function(_0x4d82e1,_0x5ac72b){_0x4d82e1=_0x4d82e1-0x0;var _0x5f3bd9=_0xa4ae[_0x4d82e1];return _0x5f3bd9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea4a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea4a('0x1'));var rp=require(_0xea4a('0x2'));var moment=require('moment');var BPromise=require(_0xea4a('0x3'));var Mustache=require(_0xea4a('0x4'));var util=require(_0xea4a('0x5'));var path=require('path');var sox=require(_0xea4a('0x6'));var csv=require(_0xea4a('0x7'));var ejs=require(_0xea4a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea4a('0x9'));var squel=require(_0xea4a('0xa'));var crypto=require(_0xea4a('0xb'));var jsforce=require(_0xea4a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xea4a('0x7'));var querystring=require('querystring');var Papa=require(_0xea4a('0xd'));var Redis=require(_0xea4a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xea4a('0xf'));var as=require(_0xea4a('0x10'));var hardwareService=require(_0xea4a('0x11'));var logger=require('../../config/logger')(_0xea4a('0x12'));var utils=require(_0xea4a('0x13'));var config=require(_0xea4a('0x14'));var licenseUtil=require(_0xea4a('0x15'));var db=require(_0xea4a('0x16'))['db'];function respondWithStatusCode(_0x1c07bb,_0xa191ce){_0xa191ce=_0xa191ce||0xcc;return function(_0x311f3b){if(_0x311f3b){return _0x1c07bb[_0xea4a('0x17')](_0xa191ce);}return _0x1c07bb[_0xea4a('0x18')](_0xa191ce)[_0xea4a('0x19')]();};}function respondWithResult(_0x13acf5,_0x393557){_0x393557=_0x393557||0xc8;return function(_0x1be9f5){if(_0x1be9f5){return _0x13acf5[_0xea4a('0x18')](_0x393557)[_0xea4a('0x1a')](_0x1be9f5);}};}function respondWithFilteredResult(_0x35d414,_0x5de6b8){return function(_0x12d7fe){if(_0x12d7fe){var _0x3b5f24=typeof _0x5de6b8[_0xea4a('0x1b')]===_0xea4a('0x1c')&&typeof _0x5de6b8[_0xea4a('0x1d')]==='undefined';var _0x4c902e=_0x12d7fe[_0xea4a('0x1e')];var _0x5f309b=_0x3b5f24?0x0:_0x5de6b8[_0xea4a('0x1b')];var _0x48c675=_0x3b5f24?_0x12d7fe[_0xea4a('0x1e')]:_0x5de6b8[_0xea4a('0x1b')]+_0x5de6b8[_0xea4a('0x1d')];var _0x10d7b0;if(_0x48c675>=_0x4c902e){_0x48c675=_0x4c902e;_0x10d7b0=0xc8;}else{_0x10d7b0=0xce;}_0x35d414[_0xea4a('0x18')](_0x10d7b0);return _0x35d414[_0xea4a('0x1f')](_0xea4a('0x20'),_0x5f309b+'-'+_0x48c675+'/'+_0x4c902e)[_0xea4a('0x1a')](_0x12d7fe);}return null;};}function patchUpdates(_0x55ebb6){return function(_0x27fac3){try{jsonpatch[_0xea4a('0x21')](_0x27fac3,_0x55ebb6,!![]);}catch(_0x101243){return BPromise[_0xea4a('0x22')](_0x101243);}return _0x27fac3['save']();};}function saveUpdates(_0x4eaa04,_0xcc4e67){return function(_0x4ebbee){if(_0x4ebbee){return _0x4ebbee[_0xea4a('0x23')](_0x4eaa04)[_0xea4a('0x24')](function(_0xbba47d){return _0xbba47d;});}return null;};}function removeEntity(_0x28ad66,_0xa3bd1b){return function(_0x19547d){if(_0x19547d){return _0x19547d[_0xea4a('0x25')]()['then'](function(){_0x28ad66['status'](0xcc)[_0xea4a('0x19')]();});}};}function handleEntityNotFound(_0xd7bc1d,_0x555a3b){return function(_0x41f8b7){if(!_0x41f8b7){_0xd7bc1d[_0xea4a('0x17')](0x194);}return _0x41f8b7;};}function handleError(_0x197edb,_0x5ebb00){_0x5ebb00=_0x5ebb00||0x1f4;return function(_0x5cf0f4){logger[_0xea4a('0x26')](_0x5cf0f4[_0xea4a('0x27')]);if(_0x5cf0f4[_0xea4a('0x28')]){delete _0x5cf0f4['name'];}_0x197edb[_0xea4a('0x18')](_0x5ebb00)[_0xea4a('0x29')](_0x5cf0f4);};}exports[_0xea4a('0x2a')]=function(_0x357d5a,_0x53e51){var _0x14d2d8={},_0x550d8a={},_0x297cee={'count':0x0,'rows':[]};var _0x533cc0=_[_0xea4a('0x2b')](db['VoiceMailMessage'][_0xea4a('0x2c')],function(_0x292676){return{'name':_0x292676[_0xea4a('0x2d')],'type':_0x292676['type']['key']};});_0x550d8a[_0xea4a('0x2e')]=_['differenceBy'](_['map'](_0x533cc0,_0xea4a('0x28')),[_0xea4a('0x28')]);_0x550d8a[_0xea4a('0x2f')]=_['keys'](_0x357d5a['query']);_0x550d8a[_0xea4a('0x30')]=_['intersection'](_0x550d8a['model'],_0x550d8a[_0xea4a('0x2f')]);_0x14d2d8[_0xea4a('0x31')]=_[_0xea4a('0x32')](_0x550d8a[_0xea4a('0x2e')],qs[_0xea4a('0x33')](_0x357d5a[_0xea4a('0x2f')][_0xea4a('0x33')]));_0x14d2d8['attributes']=_0x14d2d8[_0xea4a('0x31')]['length']?_0x14d2d8[_0xea4a('0x31')]:_0x550d8a[_0xea4a('0x2e')];if(!_0x357d5a['query'][_0xea4a('0x34')](_0xea4a('0x35'))){_0x14d2d8['limit']=qs['limit'](_0x357d5a[_0xea4a('0x2f')][_0xea4a('0x1d')]);_0x14d2d8[_0xea4a('0x1b')]=qs[_0xea4a('0x1b')](_0x357d5a[_0xea4a('0x2f')][_0xea4a('0x1b')]);}_0x14d2d8[_0xea4a('0x36')]=qs[_0xea4a('0x37')](_0x357d5a['query']['sort']);_0x14d2d8[_0xea4a('0x38')]=qs[_0xea4a('0x30')](_[_0xea4a('0x39')](_0x357d5a[_0xea4a('0x2f')],_0x550d8a['filters']),_0x533cc0);if(_0x357d5a['query']['filter']){_0x14d2d8[_0xea4a('0x38')]=_[_0xea4a('0x3a')](_0x14d2d8[_0xea4a('0x38')],{'$or':_[_0xea4a('0x2b')](_0x533cc0,function(_0x44eccd){if(_0x44eccd[_0xea4a('0x3b')]!=='VIRTUAL'){var _0x203361={};_0x203361[_0x44eccd[_0xea4a('0x28')]]={'$like':'%'+_0x357d5a[_0xea4a('0x2f')][_0xea4a('0x3c')]+'%'};return _0x203361;}})});}_0x14d2d8=_[_0xea4a('0x3a')]({},_0x14d2d8,_0x357d5a[_0xea4a('0x3d')]);var _0x42a542={'where':_0x14d2d8['where']};return db[_0xea4a('0x3e')][_0xea4a('0x1e')](_0x42a542)[_0xea4a('0x24')](function(_0x4ec560){_0x297cee[_0xea4a('0x1e')]=_0x4ec560;if(_0x357d5a['query'][_0xea4a('0x3f')]){_0x14d2d8[_0xea4a('0x40')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xea4a('0x41')](_0x14d2d8);})[_0xea4a('0x24')](function(_0x988106){_0x297cee[_0xea4a('0x42')]=_0x988106;return _0x297cee;})[_0xea4a('0x24')](respondWithFilteredResult(_0x53e51,_0x14d2d8))[_0xea4a('0x43')](handleError(_0x53e51,null));};exports['show']=function(_0x5b010b,_0x459ae5){var _0x5198ee={'raw':!![],'where':{'id':_0x5b010b[_0xea4a('0x44')]['id']}},_0x4ebb52={};_0x4ebb52['model']=_[_0xea4a('0x45')](db['VoiceMailMessage']['rawAttributes']);_0x4ebb52[_0xea4a('0x2f')]=_['keys'](_0x5b010b[_0xea4a('0x2f')]);_0x4ebb52['filters']=_['intersection'](_0x4ebb52[_0xea4a('0x2e')],_0x4ebb52[_0xea4a('0x2f')]);_0x5198ee[_0xea4a('0x31')]=_[_0xea4a('0x32')](_0x4ebb52[_0xea4a('0x2e')],qs[_0xea4a('0x33')](_0x5b010b[_0xea4a('0x2f')][_0xea4a('0x33')]));_0x5198ee[_0xea4a('0x31')]=_0x5198ee[_0xea4a('0x31')][_0xea4a('0x46')]?_0x5198ee[_0xea4a('0x31')]:_0x4ebb52['model'];if(_0x5b010b[_0xea4a('0x2f')][_0xea4a('0x3f')]){_0x5198ee[_0xea4a('0x40')]=[{'all':!![]}];}_0x5198ee=_[_0xea4a('0x3a')]({},_0x5198ee,_0x5b010b[_0xea4a('0x3d')]);return db[_0xea4a('0x3e')][_0xea4a('0x47')](_0x5198ee)[_0xea4a('0x24')](handleEntityNotFound(_0x459ae5,null))['then'](respondWithResult(_0x459ae5,null))[_0xea4a('0x43')](handleError(_0x459ae5,null));};exports['create']=function(_0x17a38a,_0x12282b){return db['VoiceMailMessage'][_0xea4a('0x48')](_0x17a38a['body'],{})[_0xea4a('0x24')](respondWithResult(_0x12282b,0xc9))[_0xea4a('0x43')](handleError(_0x12282b,null));};exports['update']=function(_0x465606,_0x3e1d78){if(_0x465606['body']['id']){delete _0x465606['body']['id'];}return db['VoiceMailMessage'][_0xea4a('0x47')]({'where':{'id':_0x465606[_0xea4a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e1d78,null))[_0xea4a('0x24')](saveUpdates(_0x465606['body'],null))['then'](respondWithResult(_0x3e1d78,null))[_0xea4a('0x43')](handleError(_0x3e1d78,null));};exports[_0xea4a('0x25')]=function(_0x2160e6,_0x378d06){return db['VoiceMailMessage']['find']({'where':{'id':_0x2160e6['params']['id']}})['then'](handleEntityNotFound(_0x378d06,null))['then'](removeEntity(_0x378d06,null))[_0xea4a('0x43')](handleError(_0x378d06,null));};exports['download']=function(_0x2033b8,_0x4f07b7,_0x48ccd4){return db[_0xea4a('0x3e')][_0xea4a('0x47')]({'where':{'id':_0x2033b8[_0xea4a('0x44')]['id']},'attributes':['id',_0xea4a('0x49'),_0xea4a('0x4a')]})['then'](handleEntityNotFound(_0x4f07b7,null))[_0xea4a('0x24')](function(_0x1fc3f1){if(_0x1fc3f1){if(!_0x1fc3f1[_0xea4a('0x49')]){throw new db[(_0xea4a('0x4b'))][(_0xea4a('0x4c'))](_0xea4a('0x4d'));}var _0x1e6274={'Content-Type':_0xea4a('0x4e'),'Content-Disposition':_0xea4a('0x4f')};if(_0x1fc3f1[_0xea4a('0x4a')]){_0x1e6274[_0xea4a('0x50')]=_0xea4a('0x51')+_0x1fc3f1['msg_id']+_0xea4a('0x52');}_0x4f07b7['set'](_0x1e6274);return _0x4f07b7['send'](new Buffer(_0x1fc3f1[_0xea4a('0x49')]));}})['catch'](handleError(_0x4f07b7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index cc09d0a..d35a239 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 _0xb1c3=['VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define'];(function(_0x1f144c,_0x368815){var _0x8aef0d=function(_0x341794){while(--_0x341794){_0x1f144c['push'](_0x1f144c['shift']());}};_0x8aef0d(++_0x368815);}(_0xb1c3,0x86));var _0x3b1c=function(_0xf9a04c,_0x536d31){_0xf9a04c=_0xf9a04c-0x0;var _0x1f4db5=_0xb1c3[_0xf9a04c];return _0x1f4db5;};'use strict';var _=require(_0x3b1c('0x0'));var util=require(_0x3b1c('0x1'));var logger=require(_0x3b1c('0x2'))(_0x3b1c('0x3'));var moment=require(_0x3b1c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3b1c('0x5'));var config=require(_0x3b1c('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x3b1c('0x7')]=function(_0x5f56d3,_0x56b9ea){return _0x5f56d3[_0x3b1c('0x8')](_0x3b1c('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x3b1c('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd685=['../../config/logger','api','request-promise','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','lodash','util'];(function(_0x6dac1b,_0xc1e294){var _0x309138=function(_0xf97eb5){while(--_0xf97eb5){_0x6dac1b['push'](_0x6dac1b['shift']());}};_0x309138(++_0xc1e294);}(_0xd685,0x18a));var _0x5d68=function(_0x2aacad,_0x4e4140){_0x2aacad=_0x2aacad-0x0;var _0x185bca=_0xd685[_0x2aacad];return _0x185bca;};'use strict';var _=require(_0x5d68('0x0'));var util=require(_0x5d68('0x1'));var logger=require(_0x5d68('0x2'))(_0x5d68('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5d68('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5d68('0x5'));module[_0x5d68('0x6')]=function(_0x456236,_0x391ff9){return _0x456236['define']('VoiceMailMessage',attributes,{'tableName':_0x5d68('0x7'),'paranoid':![],'indexes':[{'name':_0x5d68('0x8'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index bacba5c..392e57e 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 _0x935c=['stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x28877d,_0x2e207c){var _0x25d2de=function(_0xe02c27){while(--_0xe02c27){_0x28877d['push'](_0x28877d['shift']());}};_0x25d2de(++_0x2e207c);}(_0x935c,0x10c));var _0xc935=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x935c[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xc935('0x0'));var util=require(_0xc935('0x1'));var moment=require(_0xc935('0x2'));var BPromise=require(_0xc935('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc935('0x4'));var db=require(_0xc935('0x5'))['db'];var utils=require(_0xc935('0x6'));var logger=require(_0xc935('0x7'))(_0xc935('0x8'));var config=require('../../config/environment');var jayson=require(_0xc935('0x9'));var client=jayson['client'][_0xc935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x241303,_0x4c4aba,_0x3c6157){return new BPromise(function(_0xf5d337,_0x397755){return client[_0xc935('0xb')](_0x241303,_0x3c6157)[_0xc935('0xc')](function(_0x3c307b){logger[_0xc935('0xd')](_0xc935('0xe'),_0x4c4aba,_0xc935('0xf'));logger[_0xc935('0x10')](_0xc935('0x11'),_0x4c4aba,'request\x20sent',JSON[_0xc935('0x12')](_0x3c307b));if(_0x3c307b[_0xc935('0x13')]){if(_0x3c307b[_0xc935('0x13')]['code']===0x1f4){logger[_0xc935('0x13')](_0xc935('0xe'),_0x4c4aba,_0x3c307b[_0xc935('0x13')]['message']);return _0x397755(_0x3c307b['error']['message']);}logger[_0xc935('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x4c4aba,_0x3c307b['error'][_0xc935('0x14')]);return _0xf5d337(_0x3c307b[_0xc935('0x13')]['message']);}else{logger['info'](_0xc935('0xe'),_0x4c4aba,_0xc935('0xf'));_0xf5d337(_0x3c307b['result'][_0xc935('0x14')]);}})[_0xc935('0x15')](function(_0x4dd354){logger[_0xc935('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x4c4aba,_0x4dd354);_0x397755(_0x4dd354);});});} \ No newline at end of file +var _0xdb35=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x131028,_0x3ff0d2){var _0x2da22a=function(_0xdda5ce){while(--_0xdda5ce){_0x131028['push'](_0x131028['shift']());}};_0x2da22a(++_0x3ff0d2);}(_0xdb35,0x165));var _0x5db3=function(_0x4430a9,_0x5f0b8d){_0x4430a9=_0x4430a9-0x0;var _0x2432da=_0xdb35[_0x4430a9];return _0x2432da;};'use strict';var _=require(_0x5db3('0x0'));var util=require(_0x5db3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5db3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5db3('0x3'));var logger=require('../../config/logger')(_0x5db3('0x4'));var config=require(_0x5db3('0x5'));var jayson=require(_0x5db3('0x6'));var client=jayson[_0x5db3('0x7')][_0x5db3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d423c,_0x50c540,_0x30ee4a){return new BPromise(function(_0x218443,_0x113479){return client[_0x5db3('0x9')](_0x2d423c,_0x30ee4a)['then'](function(_0x54d96f){logger[_0x5db3('0xa')](_0x5db3('0xb'),_0x50c540,_0x5db3('0xc'));logger[_0x5db3('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x50c540,_0x5db3('0xc'),JSON[_0x5db3('0xe')](_0x54d96f));if(_0x54d96f[_0x5db3('0xf')]){if(_0x54d96f[_0x5db3('0xf')][_0x5db3('0x10')]===0x1f4){logger[_0x5db3('0xf')](_0x5db3('0xb'),_0x50c540,_0x54d96f[_0x5db3('0xf')]['message']);return _0x113479(_0x54d96f['error']['message']);}logger['error'](_0x5db3('0xb'),_0x50c540,_0x54d96f[_0x5db3('0xf')]['message']);return _0x218443(_0x54d96f['error'][_0x5db3('0x11')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x50c540,_0x5db3('0xc'));_0x218443(_0x54d96f[_0x5db3('0x12')][_0x5db3('0x11')]);}})[_0x5db3('0x13')](function(_0x35fa0e){logger['error'](_0x5db3('0xb'),_0x50c540,_0x35fa0e);_0x113479(_0x35fa0e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 7c20ecc..155cd35 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 _0xbb33=['destroy','removeSound','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds','post','create','put','update','delete'];(function(_0x200964,_0x5e0e46){var _0x42a062=function(_0x449c65){while(--_0x449c65){_0x200964['push'](_0x200964['shift']());}};_0x42a062(++_0x5e0e46);}(_0xbb33,0x70));var _0x3bb3=function(_0x652c36,_0xbd54a1){_0x652c36=_0x652c36-0x0;var _0x30c32f=_0xbb33[_0x652c36];return _0x30c32f;};'use strict';var multer=require(_0x3bb3('0x0'));var util=require(_0x3bb3('0x1'));var path=require(_0x3bb3('0x2'));var timeout=require(_0x3bb3('0x3'));var express=require(_0x3bb3('0x4'));var router=express[_0x3bb3('0x5')]();var fs_extra=require(_0x3bb3('0x6'));var auth=require(_0x3bb3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3bb3('0x8'));var controller=require(_0x3bb3('0x9'));router[_0x3bb3('0xa')]('/',auth[_0x3bb3('0xb')](),controller['index']);router['get'](_0x3bb3('0xc'),auth[_0x3bb3('0xb')](),controller[_0x3bb3('0xd')]);router['get']('/:id/sounds',auth[_0x3bb3('0xb')](),controller[_0x3bb3('0xe')]);router[_0x3bb3('0xf')]('/',auth[_0x3bb3('0xb')](),controller[_0x3bb3('0x10')]);router[_0x3bb3('0xf')]('/:id/sounds',auth[_0x3bb3('0xb')](),controller['addSound']);router[_0x3bb3('0x11')]('/:id',auth[_0x3bb3('0xb')](),controller[_0x3bb3('0x12')]);router[_0x3bb3('0x13')](_0x3bb3('0xc'),auth['isAuthenticated'](),controller[_0x3bb3('0x14')]);router[_0x3bb3('0x13')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x3bb3('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1276=['create','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','getSounds','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1276,0x1eb));var _0x6127=function(_0x2d6852,_0x43f3c0){_0x2d6852=_0x2d6852-0x0;var _0x2f7a8c=_0x1276[_0x2d6852];return _0x2f7a8c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6127('0x0'));var timeout=require(_0x6127('0x1'));var express=require('express');var router=express[_0x6127('0x2')]();var fs_extra=require(_0x6127('0x3'));var auth=require(_0x6127('0x4'));var interaction=require(_0x6127('0x5'));var config=require('../../config/environment');var controller=require(_0x6127('0x6'));router['get']('/',auth[_0x6127('0x7')](),controller[_0x6127('0x8')]);router[_0x6127('0x9')](_0x6127('0xa'),auth[_0x6127('0x7')](),controller[_0x6127('0xb')]);router[_0x6127('0x9')](_0x6127('0xc'),auth['isAuthenticated'](),controller[_0x6127('0xd')]);router[_0x6127('0xe')]('/',auth[_0x6127('0x7')](),controller[_0x6127('0xf')]);router[_0x6127('0xe')](_0x6127('0xc'),auth[_0x6127('0x7')](),controller[_0x6127('0x10')]);router['put'](_0x6127('0xa'),auth[_0x6127('0x7')](),controller[_0x6127('0x11')]);router[_0x6127('0x12')](_0x6127('0xa'),auth[_0x6127('0x7')](),controller[_0x6127('0x13')]);router[_0x6127('0x12')](_0x6127('0x14'),auth[_0x6127('0x7')](),controller[_0x6127('0x15')]);module[_0x6127('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 819a912..c2cabf6 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 _0xa294=['exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xa294,0x186));var _0x4a29=function(_0x4dcf0e,_0x11eee1){_0x4dcf0e=_0x4dcf0e-0x0;var _0x310fa6=_0xa294[_0x4dcf0e];return _0x310fa6;};'use strict';var Sequelize=require('sequelize');module[_0x4a29('0x0')]={'name':{'type':Sequelize[_0x4a29('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x4a29('0x2')](_0x4a29('0x3'),_0x4a29('0x4'),_0x4a29('0x5'),_0x4a29('0x6'),_0x4a29('0x7'),_0x4a29('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x4a29('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4a29('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4a29('0x1')],'allowNull':!![],'defaultValue':_0x4a29('0x9')},'format':{'type':Sequelize[_0x4a29('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa460=['custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','exports','STRING','ENUM'];(function(_0x1010f5,_0x4ff2d9){var _0x5659bb=function(_0x1b92cd){while(--_0x1b92cd){_0x1010f5['push'](_0x1010f5['shift']());}};_0x5659bb(++_0x4ff2d9);}(_0xa460,0xd9));var _0x0a46=function(_0x22d655,_0x3941dd){_0x22d655=_0x22d655-0x0;var _0x257739=_0xa460[_0x22d655];return _0x257739;};'use strict';var Sequelize=require('sequelize');module[_0x0a46('0x0')]={'name':{'type':Sequelize[_0x0a46('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x0a46('0x2')](_0x0a46('0x3'),_0x0a46('0x4'),_0x0a46('0x5'),_0x0a46('0x6'),_0x0a46('0x7'),_0x0a46('0x8')),'allowNull':!![],'defaultValue':_0x0a46('0x4')},'directory':{'type':Sequelize[_0x0a46('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x0a46('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x0a46('0x1')],'allowNull':!![],'defaultValue':_0x0a46('0x9')},'format':{'type':Sequelize[_0x0a46('0x1')],'allowNull':!![]},'stamp':{'type':_0x0a46('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 73723d6..cda4b51 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 _0x97cb=['ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','server/files/moh','symlinkSync','removeSound','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','MusicOnHolds','UserProfileResource','error','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','filters','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','intersection','fields','find','catch','body','create','sequelize','transaction','mode','files','directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','readdirSync','unlinkSync','join','rmdirSync','Sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97cb,0x80));var _0xb97c=function(_0x2a3636,_0x462638){_0x2a3636=_0x2a3636-0x0;var _0x314be5=_0x97cb[_0x2a3636];return _0x314be5;};'use strict';var emlformat=require(_0xb97c('0x0'));var rimraf=require(_0xb97c('0x1'));var zipdir=require(_0xb97c('0x2'));var jsonpatch=require(_0xb97c('0x3'));var rp=require(_0xb97c('0x4'));var moment=require('moment');var BPromise=require(_0xb97c('0x5'));var Mustache=require(_0xb97c('0x6'));var util=require(_0xb97c('0x7'));var path=require(_0xb97c('0x8'));var sox=require(_0xb97c('0x9'));var csv=require(_0xb97c('0xa'));var ejs=require(_0xb97c('0xb'));var fs=require('fs');var fs_extra=require(_0xb97c('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb97c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb97c('0xe'));var toCsv=require(_0xb97c('0xa'));var querystring=require(_0xb97c('0xf'));var Papa=require(_0xb97c('0x10'));var Redis=require(_0xb97c('0x11'));var authService=require(_0xb97c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb97c('0x13'));var hardwareService=require(_0xb97c('0x14'));var logger=require(_0xb97c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb97c('0x16'));var licenseUtil=require(_0xb97c('0x17'));var db=require(_0xb97c('0x18'))['db'];function respondWithStatusCode(_0x33c87f,_0x4f9d1c){_0x4f9d1c=_0x4f9d1c||0xcc;return function(_0x42ec16){if(_0x42ec16){return _0x33c87f[_0xb97c('0x19')](_0x4f9d1c);}return _0x33c87f[_0xb97c('0x1a')](_0x4f9d1c)[_0xb97c('0x1b')]();};}function respondWithResult(_0x29767a,_0xf5d994){_0xf5d994=_0xf5d994||0xc8;return function(_0x3ef7dd){if(_0x3ef7dd){return _0x29767a['status'](_0xf5d994)[_0xb97c('0x1c')](_0x3ef7dd);}};}function respondWithFilteredResult(_0xabab71,_0x52acef){return function(_0x1832c1){if(_0x1832c1){var _0x45baf7=typeof _0x52acef[_0xb97c('0x1d')]===_0xb97c('0x1e')&&typeof _0x52acef['limit']==='undefined';var _0x1cb1c3=_0x1832c1['count'];var _0x63e7b4=_0x45baf7?0x0:_0x52acef[_0xb97c('0x1d')];var _0x4888a1=_0x45baf7?_0x1832c1[_0xb97c('0x1f')]:_0x52acef[_0xb97c('0x1d')]+_0x52acef['limit'];var _0x44611f;if(_0x4888a1>=_0x1cb1c3){_0x4888a1=_0x1cb1c3;_0x44611f=0xc8;}else{_0x44611f=0xce;}_0xabab71[_0xb97c('0x1a')](_0x44611f);return _0xabab71[_0xb97c('0x20')](_0xb97c('0x21'),_0x63e7b4+'-'+_0x4888a1+'/'+_0x1cb1c3)['json'](_0x1832c1);}return null;};}function patchUpdates(_0x7311bc){return function(_0x42b5a4){try{jsonpatch[_0xb97c('0x22')](_0x42b5a4,_0x7311bc,!![]);}catch(_0x2d8932){return BPromise[_0xb97c('0x23')](_0x2d8932);}return _0x42b5a4['save']();};}function saveUpdates(_0x3e4d14,_0x53d972){return function(_0x5b6848){if(_0x5b6848){return _0x5b6848[_0xb97c('0x24')](_0x3e4d14)[_0xb97c('0x25')](function(_0x453bf5){return _0x453bf5;});}return null;};}function removeEntity(_0x4d7551,_0xea5b0a){return function(_0x30287c){if(_0x30287c){return _0x30287c[_0xb97c('0x26')]()[_0xb97c('0x25')](function(){var _0x15dc4b=_0x30287c['get']({'plain':!![]});var _0x47a8da=_0xb97c('0x27');return db[_0xb97c('0x28')]['destroy']({'where':{'type':_0x47a8da,'resourceId':_0x15dc4b['id']}})[_0xb97c('0x25')](function(){return _0x30287c;});})[_0xb97c('0x25')](function(){_0x4d7551[_0xb97c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b62cd,_0x44418e){return function(_0x3482d9){if(!_0x3482d9){_0x2b62cd[_0xb97c('0x19')](0x194);}return _0x3482d9;};}function handleError(_0x5a12f5,_0x4ca512){_0x4ca512=_0x4ca512||0x1f4;return function(_0x2a3fef){logger[_0xb97c('0x29')](_0x2a3fef['stack']);if(_0x2a3fef[_0xb97c('0x2a')]){delete _0x2a3fef[_0xb97c('0x2a')];}_0x5a12f5['status'](_0x4ca512)['send'](_0x2a3fef);};}exports[_0xb97c('0x2b')]=function(_0x181aa3,_0x27b845){var _0x19572b={},_0x1c3622={},_0x289f61={'count':0x0,'rows':[]};var _0x1f4627=_[_0xb97c('0x2c')](db[_0xb97c('0x2d')][_0xb97c('0x2e')],function(_0x464de3){return{'name':_0x464de3[_0xb97c('0x2f')],'type':_0x464de3[_0xb97c('0x30')]['key']};});_0x1c3622[_0xb97c('0x31')]=_[_0xb97c('0x2c')](_0x1f4627,_0xb97c('0x2a'));_0x1c3622[_0xb97c('0x32')]=_['keys'](_0x181aa3['query']);_0x1c3622[_0xb97c('0x33')]=_['intersection'](_0x1c3622['model'],_0x1c3622[_0xb97c('0x32')]);_0x19572b['attributes']=_['intersection'](_0x1c3622['model'],qs['fields'](_0x181aa3[_0xb97c('0x32')]['fields']));_0x19572b[_0xb97c('0x34')]=_0x19572b[_0xb97c('0x34')][_0xb97c('0x35')]?_0x19572b[_0xb97c('0x34')]:_0x1c3622[_0xb97c('0x31')];if(!_0x181aa3[_0xb97c('0x32')][_0xb97c('0x36')](_0xb97c('0x37'))){_0x19572b[_0xb97c('0x38')]=qs[_0xb97c('0x38')](_0x181aa3[_0xb97c('0x32')]['limit']);_0x19572b[_0xb97c('0x1d')]=qs[_0xb97c('0x1d')](_0x181aa3[_0xb97c('0x32')]['offset']);}_0x19572b[_0xb97c('0x39')]=qs[_0xb97c('0x3a')](_0x181aa3[_0xb97c('0x32')][_0xb97c('0x3a')]);delete _0x181aa3['query'][_0xb97c('0x3a')];_0x19572b[_0xb97c('0x3b')]=qs['filters'](_[_0xb97c('0x3c')](_0x181aa3[_0xb97c('0x32')],_0x1c3622['filters']),_0x1f4627);if(_0x181aa3[_0xb97c('0x32')][_0xb97c('0x3d')]){_0x19572b[_0xb97c('0x3b')]=_[_0xb97c('0x3e')](_0x19572b[_0xb97c('0x3b')],{'$or':_['map'](_0x1f4627,function(_0x51ef77){if(_0x51ef77['type']!==_0xb97c('0x3f')){var _0x4cdd5f={};_0x4cdd5f[_0x51ef77['name']]={'$like':'%'+_0x181aa3[_0xb97c('0x32')][_0xb97c('0x3d')]+'%'};return _0x4cdd5f;}})});}_0x19572b=_['merge']({},_0x19572b,_0x181aa3[_0xb97c('0x40')]);var _0x4bd9f8={'where':_0x19572b[_0xb97c('0x3b')]};return db['VoiceMusicOnHold'][_0xb97c('0x1f')](_0x4bd9f8)[_0xb97c('0x25')](function(_0x25dc64){_0x289f61[_0xb97c('0x1f')]=_0x25dc64;if(_0x181aa3[_0xb97c('0x32')][_0xb97c('0x41')]){_0x19572b[_0xb97c('0x42')]=[{'all':!![]}];}return db[_0xb97c('0x2d')][_0xb97c('0x43')](_0x19572b);})['then'](function(_0x10712c){_0x289f61[_0xb97c('0x44')]=_0x10712c;return _0x289f61;})['then'](respondWithFilteredResult(_0x27b845,_0x19572b))['catch'](handleError(_0x27b845,null));};exports[_0xb97c('0x45')]=function(_0x281b7d,_0x4d7d26){var _0x9376d3={'raw':![],'where':{'id':_0x281b7d[_0xb97c('0x46')]['id']}},_0xcf01a3={};_0xcf01a3[_0xb97c('0x31')]=_[_0xb97c('0x47')](db['VoiceMusicOnHold']['rawAttributes']);_0xcf01a3['query']=_[_0xb97c('0x47')](_0x281b7d[_0xb97c('0x32')]);_0xcf01a3['filters']=_[_0xb97c('0x48')](_0xcf01a3[_0xb97c('0x31')],_0xcf01a3[_0xb97c('0x32')]);_0x9376d3['attributes']=_[_0xb97c('0x48')](_0xcf01a3['model'],qs[_0xb97c('0x49')](_0x281b7d[_0xb97c('0x32')]['fields']));_0x9376d3[_0xb97c('0x34')]=_0x9376d3[_0xb97c('0x34')][_0xb97c('0x35')]?_0x9376d3[_0xb97c('0x34')]:_0xcf01a3[_0xb97c('0x31')];if(_0x281b7d['query'][_0xb97c('0x41')]){_0x9376d3['include']=[{'all':!![]}];}_0x9376d3=_[_0xb97c('0x3e')]({},_0x9376d3,_0x281b7d[_0xb97c('0x40')]);return db[_0xb97c('0x2d')][_0xb97c('0x4a')](_0x9376d3)[_0xb97c('0x25')](handleEntityNotFound(_0x4d7d26,null))[_0xb97c('0x25')](respondWithResult(_0x4d7d26,null))[_0xb97c('0x4b')](handleError(_0x4d7d26,null));};exports[_0xb97c('0x24')]=function(_0x20fad4,_0x73b3ea){if(_0x20fad4[_0xb97c('0x4c')]['id']){delete _0x20fad4[_0xb97c('0x4c')]['id'];}return db[_0xb97c('0x2d')][_0xb97c('0x4a')]({'where':{'id':_0x20fad4[_0xb97c('0x46')]['id']}})[_0xb97c('0x25')](handleEntityNotFound(_0x73b3ea,null))[_0xb97c('0x25')](saveUpdates(_0x20fad4[_0xb97c('0x4c')],null))['then'](respondWithResult(_0x73b3ea,null))[_0xb97c('0x4b')](handleError(_0x73b3ea,null));};exports[_0xb97c('0x4d')]=function(_0x4e7079,_0x7a2484,_0x550571){return db[_0xb97c('0x4e')][_0xb97c('0x4f')](function(_0x36c402){if(_0x4e7079[_0xb97c('0x4c')][_0xb97c('0x50')]===_0xb97c('0x51')){_0x4e7079[_0xb97c('0x4c')][_0xb97c('0x52')]=path['join'](config['root'],'server/files/moh',_0x4e7079[_0xb97c('0x4c')]['name']);}return db[_0xb97c('0x2d')][_0xb97c('0x4d')](_0x4e7079[_0xb97c('0x4c')],{'transaction':_0x36c402})['then'](function(_0x59f76d){if(_0x4e7079[_0xb97c('0x4c')][_0xb97c('0x50')]===_0xb97c('0x51')){fs['mkdirSync'](_0x59f76d[_0xb97c('0x52')],parseInt(_0xb97c('0x53'),0x8));}var _0x4f1f09=_0x4e7079[_0xb97c('0x54')][_0xb97c('0x55')]({'plain':!![]});if(!_0x4f1f09)throw new Error(_0xb97c('0x56'));if(_0x4f1f09['role']==='user'){var _0x5f495b=_0x59f76d[_0xb97c('0x55')]({'plain':!![]});return db[_0xb97c('0x57')][_0xb97c('0x4a')]({'where':{'name':_0xb97c('0x27'),'userProfileId':_0x4f1f09['userProfileId']},'raw':!![]})[_0xb97c('0x25')](function(_0x24feed){if(_0x24feed&&_0x24feed[_0xb97c('0x58')]===0x0){return db[_0xb97c('0x28')][_0xb97c('0x4d')]({'name':_0x5f495b[_0xb97c('0x2a')],'resourceId':_0x5f495b['id'],'type':_0x24feed[_0xb97c('0x2a')],'sectionId':_0x24feed['id']},{})[_0xb97c('0x25')](function(){return _0x59f76d;});}else{return _0x59f76d;}})[_0xb97c('0x4b')](function(_0x1732ff){logger[_0xb97c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1732ff);});}return _0x59f76d;});})[_0xb97c('0x25')](respondWithResult(_0x7a2484,0xc9))[_0xb97c('0x4b')](handleError(_0x7a2484,null));};exports[_0xb97c('0x26')]=function(_0x8617c2,_0x19755b,_0x52e973){var _0x596c9d;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x8617c2[_0xb97c('0x46')]['id']}})[_0xb97c('0x25')](function(_0x33c0f8){if(_0x33c0f8){return db[_0xb97c('0x4e')][_0xb97c('0x4f')](function(_0x8c110a){return _0x33c0f8['destroy']({'transaction':_0x8c110a,'raw':!![]})[_0xb97c('0x25')](function(_0x20e52f){if(_0x20e52f[_0xb97c('0x52')]){fs[_0xb97c('0x59')](_0x20e52f[_0xb97c('0x52')])['forEach'](function(_0x35b1a5){fs[_0xb97c('0x5a')](path[_0xb97c('0x5b')](_0x20e52f[_0xb97c('0x52')],_0x35b1a5));});fs[_0xb97c('0x5c')](_0x20e52f[_0xb97c('0x52')]);}return _0x20e52f;});})['catch'](function(_0x377ea5){throw new db[(_0xb97c('0x5d'))][(_0xb97c('0x5e'))](_0x377ea5[_0xb97c('0x5f')]);});}})[_0xb97c('0x25')](handleEntityNotFound(_0x19755b,null))[_0xb97c('0x25')](removeEntity(_0x19755b,null))[_0xb97c('0x4b')](handleError(_0x19755b,null));};exports[_0xb97c('0x60')]=function(_0x4a4287,_0x1fdee3,_0x135d51){return db['sequelize'][_0xb97c('0x4f')](function(_0xfc26f1){var _0x6f2c67;return db[_0xb97c('0x2d')][_0xb97c('0x4a')]({'where':{'id':_0x4a4287[_0xb97c('0x46')]['id']}})[_0xb97c('0x25')](function(_0x32f425){if(_0x32f425){_0x6f2c67=_0x32f425;return _0x32f425[_0xb97c('0x60')](_0x4a4287[_0xb97c('0x4c')]['id'],{'transaction':_0xfc26f1});}})['then'](function(_0x285031){if(_0x285031){return db[_0xb97c('0x61')][_0xb97c('0x62')]({'where':{'id':_0x4a4287['body']['id']},'attributes':['id','name',_0xb97c('0x63'),_0xb97c('0x64'),_0xb97c('0x65')],'raw':!![]});}})[_0xb97c('0x25')](function(_0xaddefc){if(_0xaddefc){var _0x5d2d65=path[_0xb97c('0x5b')](config[_0xb97c('0x66')],_0xb97c('0x67'),util[_0xb97c('0x68')](_0xb97c('0x69'),path[_0xb97c('0x6a')](_0xaddefc[_0xb97c('0x63')],path['extname'](_0xaddefc[_0xb97c('0x63')])),_0xaddefc[_0xb97c('0x64')]));var _0x48b01f=path[_0xb97c('0x5b')](config[_0xb97c('0x66')],_0xb97c('0x6b'),_0x6f2c67['name'],util[_0xb97c('0x68')]('%s.%s',_0xaddefc[_0xb97c('0x2a')],_0xaddefc[_0xb97c('0x64')]));fs[_0xb97c('0x6c')](_0x5d2d65,_0x48b01f);return _0xaddefc;}})[_0xb97c('0x4b')](function(_0x4b75d3){throw new db[(_0xb97c('0x5d'))]['ValidationError'](_0x4b75d3[_0xb97c('0x5f')]);});})[_0xb97c('0x25')](handleEntityNotFound(_0x1fdee3,null))['then'](respondWithResult(_0x1fdee3,0xc9))[_0xb97c('0x4b')](handleError(_0x1fdee3,null));};exports[_0xb97c('0x6d')]=function(_0x428509,_0x5920e1,_0x40c080){return db[_0xb97c('0x4e')][_0xb97c('0x4f')](function(_0x4b87a3){var _0x5782ad;return db[_0xb97c('0x2d')]['findOne']({'where':{'id':_0x428509['params']['id']}})[_0xb97c('0x25')](handleEntityNotFound(_0x5920e1,null))[_0xb97c('0x25')](function(_0x5ecd63){if(_0x5ecd63){_0x5782ad=_0x5ecd63;return _0x5ecd63[_0xb97c('0x6d')](_0x428509[_0xb97c('0x46')]['id2']);}})['then'](function(_0x226c22){if(_0x226c22){return db[_0xb97c('0x61')][_0xb97c('0x62')]({'where':{'id':_0x428509[_0xb97c('0x46')]['id2']},'attributes':['id','name',_0xb97c('0x63'),_0xb97c('0x64'),_0xb97c('0x65')],'raw':!![]});}})[_0xb97c('0x25')](function(_0x3fcc2b){if(_0x3fcc2b){fs['unlinkSync'](path['join'](_0x5782ad[_0xb97c('0x52')],util[_0xb97c('0x68')](_0xb97c('0x69'),_0x3fcc2b[_0xb97c('0x2a')],_0x3fcc2b[_0xb97c('0x64')])));return _0x3fcc2b;}})[_0xb97c('0x4b')](function(_0x4ce82a){throw new db[(_0xb97c('0x5d'))][(_0xb97c('0x5e'))](_0x4ce82a[_0xb97c('0x5f')]);});})[_0xb97c('0x25')](handleEntityNotFound(_0x5920e1,null))[_0xb97c('0x25')](respondWithStatusCode(_0x5920e1,0xcc))[_0xb97c('0x4b')](handleError(_0x5920e1,null));};exports[_0xb97c('0x6e')]=function(_0x4d84cd,_0x4a268e,_0x33e3f1){var _0x6cd0ae={};var _0x175c4c={};var _0x2cb73f;var _0x559d74;return db[_0xb97c('0x2d')]['findOne']({'where':{'id':_0x4d84cd[_0xb97c('0x46')]['id']}})[_0xb97c('0x25')](handleEntityNotFound(_0x4a268e,null))[_0xb97c('0x25')](function(_0x5c6409){if(_0x5c6409){_0x2cb73f=_0x5c6409;_0x175c4c[_0xb97c('0x31')]=_[_0xb97c('0x47')](db[_0xb97c('0x61')][_0xb97c('0x2e')]);_0x175c4c['query']=_[_0xb97c('0x47')](_0x4d84cd[_0xb97c('0x32')]);_0x175c4c[_0xb97c('0x33')]=_[_0xb97c('0x48')](_0x175c4c[_0xb97c('0x31')],_0x175c4c[_0xb97c('0x32')]);_0x6cd0ae['attributes']=_[_0xb97c('0x48')](_0x175c4c[_0xb97c('0x31')],qs[_0xb97c('0x49')](_0x4d84cd[_0xb97c('0x32')][_0xb97c('0x49')]));_0x6cd0ae[_0xb97c('0x34')]=_0x6cd0ae[_0xb97c('0x34')][_0xb97c('0x35')]?_0x6cd0ae[_0xb97c('0x34')]:_0x175c4c[_0xb97c('0x31')];_0x6cd0ae['order']=qs[_0xb97c('0x3a')](_0x4d84cd[_0xb97c('0x32')][_0xb97c('0x3a')]);_0x6cd0ae[_0xb97c('0x3b')]=qs[_0xb97c('0x33')](_[_0xb97c('0x3c')](_0x4d84cd['query'],_0x175c4c[_0xb97c('0x33')]));if(_0x4d84cd[_0xb97c('0x32')]['filter']){_0x6cd0ae[_0xb97c('0x3b')]=_[_0xb97c('0x3e')](_0x6cd0ae[_0xb97c('0x3b')],{'$or':_[_0xb97c('0x2c')](_0x6cd0ae[_0xb97c('0x34')],function(_0x7da9bf){var _0x14f103={};_0x14f103[_0x7da9bf]={'$like':'%'+_0x4d84cd[_0xb97c('0x32')][_0xb97c('0x3d')]+'%'};return _0x14f103;})});}_0x6cd0ae=_[_0xb97c('0x3e')]({},_0x6cd0ae,_0x4d84cd[_0xb97c('0x40')]);return _0x2cb73f[_0xb97c('0x6e')](_0x6cd0ae);}})['then'](function(_0x6a295c){if(_0x6a295c){_0x559d74=_0x6a295c['length'];if(!_0x4d84cd[_0xb97c('0x32')][_0xb97c('0x36')](_0xb97c('0x37'))){_0x6cd0ae[_0xb97c('0x38')]=qs[_0xb97c('0x38')](_0x4d84cd[_0xb97c('0x32')][_0xb97c('0x38')]);_0x6cd0ae['offset']=qs['offset'](_0x4d84cd[_0xb97c('0x32')][_0xb97c('0x1d')]);}return _0x2cb73f[_0xb97c('0x6e')](_0x6cd0ae);}})[_0xb97c('0x25')](function(_0x468d65){if(_0x468d65){return _0x468d65?{'count':_0x559d74,'rows':_0x468d65}:null;}})[_0xb97c('0x25')](respondWithResult(_0x4a268e,null))['catch'](handleError(_0x4a268e,null));}; \ No newline at end of file +var _0x2156=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','index','VoiceMusicOnHold','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','include','catch','params','rawAttributes','includeAll','find','body','create','sequelize','transaction','directory','join','root','server/files/moh','files','mkdirSync','0777','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','converted_format','server/files/sounds/converted','%s.%s','basename','save_name','extname','format','id2','Sound','findOne','createdAt','message','getSounds','order','nolimit','eml-format','rimraf','zip-dir'];(function(_0x569590,_0x52ecab){var _0x3c56d9=function(_0x5e29b5){while(--_0x5e29b5){_0x569590['push'](_0x569590['shift']());}};_0x3c56d9(++_0x52ecab);}(_0x2156,0x141));var _0x6215=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2156[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x6215('0x0'));var rimraf=require(_0x6215('0x1'));var zipdir=require(_0x6215('0x2'));var jsonpatch=require(_0x6215('0x3'));var rp=require(_0x6215('0x4'));var moment=require('moment');var BPromise=require(_0x6215('0x5'));var Mustache=require(_0x6215('0x6'));var util=require(_0x6215('0x7'));var path=require(_0x6215('0x8'));var sox=require(_0x6215('0x9'));var csv=require(_0x6215('0xa'));var ejs=require(_0x6215('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6215('0xc'));var jsforce=require(_0x6215('0xd'));var deskjs=require(_0x6215('0xe'));var toCsv=require(_0x6215('0xa'));var querystring=require(_0x6215('0xf'));var Papa=require('papaparse');var Redis=require(_0x6215('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6215('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6215('0x12'));var utils=require(_0x6215('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6215('0x14'))['db'];function respondWithStatusCode(_0x183ab6,_0xb6e324){_0xb6e324=_0xb6e324||0xcc;return function(_0x1f6ec7){if(_0x1f6ec7){return _0x183ab6['sendStatus'](_0xb6e324);}return _0x183ab6['status'](_0xb6e324)[_0x6215('0x15')]();};}function respondWithResult(_0x798024,_0x45e81f){_0x45e81f=_0x45e81f||0xc8;return function(_0x2a1289){if(_0x2a1289){return _0x798024[_0x6215('0x16')](_0x45e81f)[_0x6215('0x17')](_0x2a1289);}};}function respondWithFilteredResult(_0x5bfd62,_0x12ba2c){return function(_0x40bc7b){if(_0x40bc7b){var _0x6061=typeof _0x12ba2c[_0x6215('0x18')]===_0x6215('0x19')&&typeof _0x12ba2c[_0x6215('0x1a')]==='undefined';var _0x34cfc3=_0x40bc7b[_0x6215('0x1b')];var _0x270998=_0x6061?0x0:_0x12ba2c[_0x6215('0x18')];var _0x172c15=_0x6061?_0x40bc7b[_0x6215('0x1b')]:_0x12ba2c[_0x6215('0x18')]+_0x12ba2c[_0x6215('0x1a')];var _0x112ab4;if(_0x172c15>=_0x34cfc3){_0x172c15=_0x34cfc3;_0x112ab4=0xc8;}else{_0x112ab4=0xce;}_0x5bfd62['status'](_0x112ab4);return _0x5bfd62[_0x6215('0x1c')](_0x6215('0x1d'),_0x270998+'-'+_0x172c15+'/'+_0x34cfc3)[_0x6215('0x17')](_0x40bc7b);}return null;};}function patchUpdates(_0x51c871){return function(_0x5cd0f1){try{jsonpatch[_0x6215('0x1e')](_0x5cd0f1,_0x51c871,!![]);}catch(_0x2deb79){return BPromise[_0x6215('0x1f')](_0x2deb79);}return _0x5cd0f1['save']();};}function saveUpdates(_0x3462b6,_0x12b560){return function(_0x588831){if(_0x588831){return _0x588831[_0x6215('0x20')](_0x3462b6)[_0x6215('0x21')](function(_0x55c72e){return _0x55c72e;});}return null;};}function removeEntity(_0x4ac0d0,_0x48e96a){return function(_0x200bf7){if(_0x200bf7){return _0x200bf7[_0x6215('0x22')]()['then'](function(){var _0x119d2d=_0x200bf7[_0x6215('0x23')]({'plain':!![]});var _0x461db7=_0x6215('0x24');return db[_0x6215('0x25')][_0x6215('0x22')]({'where':{'type':_0x461db7,'resourceId':_0x119d2d['id']}})[_0x6215('0x21')](function(){return _0x200bf7;});})[_0x6215('0x21')](function(){_0x4ac0d0[_0x6215('0x16')](0xcc)[_0x6215('0x15')]();});}};}function handleEntityNotFound(_0x1fe558,_0x1e111e){return function(_0x3f418a){if(!_0x3f418a){_0x1fe558['sendStatus'](0x194);}return _0x3f418a;};}function handleError(_0x2873a1,_0x175eba){_0x175eba=_0x175eba||0x1f4;return function(_0x61770e){logger['error'](_0x61770e[_0x6215('0x26')]);if(_0x61770e[_0x6215('0x27')]){delete _0x61770e[_0x6215('0x27')];}_0x2873a1['status'](_0x175eba)['send'](_0x61770e);};}exports[_0x6215('0x28')]=function(_0x376f9b,_0x46128b){var _0x53f1a3={},_0x52ea91={},_0x315f1c={'count':0x0,'rows':[]};var _0x3c13ce=_['map'](db[_0x6215('0x29')]['rawAttributes'],function(_0x2c9a31){return{'name':_0x2c9a31[_0x6215('0x2a')],'type':_0x2c9a31['type'][_0x6215('0x2b')]};});_0x52ea91[_0x6215('0x2c')]=_[_0x6215('0x2d')](_0x3c13ce,_0x6215('0x27'));_0x52ea91[_0x6215('0x2e')]=_[_0x6215('0x2f')](_0x376f9b['query']);_0x52ea91[_0x6215('0x30')]=_['intersection'](_0x52ea91['model'],_0x52ea91[_0x6215('0x2e')]);_0x53f1a3[_0x6215('0x31')]=_[_0x6215('0x32')](_0x52ea91[_0x6215('0x2c')],qs[_0x6215('0x33')](_0x376f9b['query'][_0x6215('0x33')]));_0x53f1a3[_0x6215('0x31')]=_0x53f1a3['attributes'][_0x6215('0x34')]?_0x53f1a3[_0x6215('0x31')]:_0x52ea91['model'];if(!_0x376f9b[_0x6215('0x2e')][_0x6215('0x35')]('nolimit')){_0x53f1a3['limit']=qs[_0x6215('0x1a')](_0x376f9b[_0x6215('0x2e')]['limit']);_0x53f1a3[_0x6215('0x18')]=qs['offset'](_0x376f9b[_0x6215('0x2e')]['offset']);}_0x53f1a3['order']=qs['sort'](_0x376f9b[_0x6215('0x2e')][_0x6215('0x36')]);delete _0x376f9b['query'][_0x6215('0x36')];_0x53f1a3[_0x6215('0x37')]=qs[_0x6215('0x30')](_[_0x6215('0x38')](_0x376f9b[_0x6215('0x2e')],_0x52ea91[_0x6215('0x30')]),_0x3c13ce);if(_0x376f9b[_0x6215('0x2e')][_0x6215('0x39')]){_0x53f1a3['where']=_[_0x6215('0x3a')](_0x53f1a3[_0x6215('0x37')],{'$or':_[_0x6215('0x2d')](_0x3c13ce,function(_0x411d82){if(_0x411d82[_0x6215('0x3b')]!==_0x6215('0x3c')){var _0xa853d5={};_0xa853d5[_0x411d82[_0x6215('0x27')]]={'$like':'%'+_0x376f9b[_0x6215('0x2e')][_0x6215('0x39')]+'%'};return _0xa853d5;}})});}_0x53f1a3=_[_0x6215('0x3a')]({},_0x53f1a3,_0x376f9b[_0x6215('0x3d')]);var _0x32d591={'where':_0x53f1a3[_0x6215('0x37')]};return db['VoiceMusicOnHold'][_0x6215('0x1b')](_0x32d591)['then'](function(_0x45e591){_0x315f1c[_0x6215('0x1b')]=_0x45e591;if(_0x376f9b[_0x6215('0x2e')]['includeAll']){_0x53f1a3[_0x6215('0x3e')]=[{'all':!![]}];}return db[_0x6215('0x29')]['findAll'](_0x53f1a3);})[_0x6215('0x21')](function(_0x3f523d){_0x315f1c['rows']=_0x3f523d;return _0x315f1c;})[_0x6215('0x21')](respondWithFilteredResult(_0x46128b,_0x53f1a3))[_0x6215('0x3f')](handleError(_0x46128b,null));};exports['show']=function(_0x40f0fa,_0x958cf2){var _0x90a7bb={'raw':![],'where':{'id':_0x40f0fa[_0x6215('0x40')]['id']}},_0x263030={};_0x263030[_0x6215('0x2c')]=_[_0x6215('0x2f')](db[_0x6215('0x29')][_0x6215('0x41')]);_0x263030[_0x6215('0x2e')]=_[_0x6215('0x2f')](_0x40f0fa[_0x6215('0x2e')]);_0x263030[_0x6215('0x30')]=_[_0x6215('0x32')](_0x263030[_0x6215('0x2c')],_0x263030[_0x6215('0x2e')]);_0x90a7bb[_0x6215('0x31')]=_[_0x6215('0x32')](_0x263030[_0x6215('0x2c')],qs[_0x6215('0x33')](_0x40f0fa[_0x6215('0x2e')][_0x6215('0x33')]));_0x90a7bb[_0x6215('0x31')]=_0x90a7bb[_0x6215('0x31')][_0x6215('0x34')]?_0x90a7bb[_0x6215('0x31')]:_0x263030[_0x6215('0x2c')];if(_0x40f0fa['query'][_0x6215('0x42')]){_0x90a7bb[_0x6215('0x3e')]=[{'all':!![]}];}_0x90a7bb=_[_0x6215('0x3a')]({},_0x90a7bb,_0x40f0fa[_0x6215('0x3d')]);return db['VoiceMusicOnHold'][_0x6215('0x43')](_0x90a7bb)['then'](handleEntityNotFound(_0x958cf2,null))[_0x6215('0x21')](respondWithResult(_0x958cf2,null))[_0x6215('0x3f')](handleError(_0x958cf2,null));};exports[_0x6215('0x20')]=function(_0x2e4970,_0x5f285b){if(_0x2e4970[_0x6215('0x44')]['id']){delete _0x2e4970[_0x6215('0x44')]['id'];}return db[_0x6215('0x29')][_0x6215('0x43')]({'where':{'id':_0x2e4970[_0x6215('0x40')]['id']}})[_0x6215('0x21')](handleEntityNotFound(_0x5f285b,null))['then'](saveUpdates(_0x2e4970[_0x6215('0x44')],null))['then'](respondWithResult(_0x5f285b,null))[_0x6215('0x3f')](handleError(_0x5f285b,null));};exports[_0x6215('0x45')]=function(_0x203c66,_0x43c935,_0xd772f){return db[_0x6215('0x46')][_0x6215('0x47')](function(_0xb4793c){if(_0x203c66[_0x6215('0x44')]['mode']==='files'){_0x203c66[_0x6215('0x44')][_0x6215('0x48')]=path[_0x6215('0x49')](config[_0x6215('0x4a')],_0x6215('0x4b'),_0x203c66['body']['name']);}return db[_0x6215('0x29')]['create'](_0x203c66[_0x6215('0x44')],{'transaction':_0xb4793c})[_0x6215('0x21')](function(_0x1fc676){if(_0x203c66[_0x6215('0x44')]['mode']===_0x6215('0x4c')){fs[_0x6215('0x4d')](_0x1fc676[_0x6215('0x48')],parseInt(_0x6215('0x4e'),0x8));}var _0x30821f=_0x203c66[_0x6215('0x4f')][_0x6215('0x23')]({'plain':!![]});if(!_0x30821f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30821f[_0x6215('0x50')]===_0x6215('0x4f')){var _0x42d087=_0x1fc676[_0x6215('0x23')]({'plain':!![]});return db[_0x6215('0x51')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x30821f[_0x6215('0x52')]},'raw':!![]})[_0x6215('0x21')](function(_0x15608c){if(_0x15608c&&_0x15608c[_0x6215('0x53')]===0x0){return db[_0x6215('0x25')][_0x6215('0x45')]({'name':_0x42d087[_0x6215('0x27')],'resourceId':_0x42d087['id'],'type':_0x15608c['name'],'sectionId':_0x15608c['id']},{})[_0x6215('0x21')](function(){return _0x1fc676;});}else{return _0x1fc676;}})[_0x6215('0x3f')](function(_0x30fb75){logger[_0x6215('0x54')](_0x6215('0x55'),_0x30fb75);});}return _0x1fc676;});})[_0x6215('0x21')](respondWithResult(_0x43c935,0xc9))['catch'](handleError(_0x43c935,null));};exports[_0x6215('0x22')]=function(_0x3afab0,_0x2b07b8,_0xef8232){var _0x58b144;return db[_0x6215('0x29')][_0x6215('0x43')]({'where':{'id':_0x3afab0[_0x6215('0x40')]['id']}})['then'](function(_0xefb3f2){if(_0xefb3f2){return db[_0x6215('0x46')][_0x6215('0x47')](function(_0x10351a){return _0xefb3f2[_0x6215('0x22')]({'transaction':_0x10351a,'raw':!![]})[_0x6215('0x21')](function(_0x359d64){if(_0x359d64[_0x6215('0x48')]){fs[_0x6215('0x56')](_0x359d64[_0x6215('0x48')])[_0x6215('0x57')](function(_0x18a580){fs[_0x6215('0x58')](path[_0x6215('0x49')](_0x359d64[_0x6215('0x48')],_0x18a580));});fs[_0x6215('0x59')](_0x359d64[_0x6215('0x48')]);}return _0x359d64;});})[_0x6215('0x3f')](function(_0x59d99a){throw new db[(_0x6215('0x5a'))][(_0x6215('0x5b'))](_0x59d99a['message']);});}})[_0x6215('0x21')](handleEntityNotFound(_0x2b07b8,null))['then'](removeEntity(_0x2b07b8,null))[_0x6215('0x3f')](handleError(_0x2b07b8,null));};exports[_0x6215('0x5c')]=function(_0x420392,_0x2fbcad,_0x3602de){return db[_0x6215('0x46')][_0x6215('0x47')](function(_0x5da820){var _0x1f9f8f;return db['VoiceMusicOnHold'][_0x6215('0x43')]({'where':{'id':_0x420392['params']['id']}})[_0x6215('0x21')](function(_0x3ed79d){if(_0x3ed79d){_0x1f9f8f=_0x3ed79d;return _0x3ed79d[_0x6215('0x5c')](_0x420392['body']['id'],{'transaction':_0x5da820});}})[_0x6215('0x21')](function(_0x307e55){if(_0x307e55){return db['Sound']['findOne']({'where':{'id':_0x420392[_0x6215('0x44')]['id']},'attributes':['id',_0x6215('0x27'),'save_name',_0x6215('0x5d'),'createdAt'],'raw':!![]});}})[_0x6215('0x21')](function(_0x2f0dcc){if(_0x2f0dcc){var _0x85e662=path[_0x6215('0x49')](config[_0x6215('0x4a')],_0x6215('0x5e'),util['format'](_0x6215('0x5f'),path[_0x6215('0x60')](_0x2f0dcc[_0x6215('0x61')],path[_0x6215('0x62')](_0x2f0dcc[_0x6215('0x61')])),_0x2f0dcc['converted_format']));var _0x52088d=path['join'](config[_0x6215('0x4a')],_0x6215('0x4b'),_0x1f9f8f[_0x6215('0x27')],util[_0x6215('0x63')]('%s.%s',_0x2f0dcc[_0x6215('0x27')],_0x2f0dcc['converted_format']));fs['symlinkSync'](_0x85e662,_0x52088d);return _0x2f0dcc;}})[_0x6215('0x3f')](function(_0x4cf13e){throw new db[(_0x6215('0x5a'))][(_0x6215('0x5b'))](_0x4cf13e['message']);});})[_0x6215('0x21')](handleEntityNotFound(_0x2fbcad,null))['then'](respondWithResult(_0x2fbcad,0xc9))['catch'](handleError(_0x2fbcad,null));};exports['removeSound']=function(_0x4e8a2a,_0x91a9f,_0x3852d7){return db[_0x6215('0x46')]['transaction'](function(_0x4bee04){var _0x3a0a99;return db[_0x6215('0x29')]['findOne']({'where':{'id':_0x4e8a2a[_0x6215('0x40')]['id']}})['then'](handleEntityNotFound(_0x91a9f,null))['then'](function(_0x2da2fd){if(_0x2da2fd){_0x3a0a99=_0x2da2fd;return _0x2da2fd['removeSound'](_0x4e8a2a[_0x6215('0x40')][_0x6215('0x64')]);}})[_0x6215('0x21')](function(_0x10f16c){if(_0x10f16c){return db[_0x6215('0x65')][_0x6215('0x66')]({'where':{'id':_0x4e8a2a['params'][_0x6215('0x64')]},'attributes':['id',_0x6215('0x27'),'save_name','converted_format',_0x6215('0x67')],'raw':!![]});}})[_0x6215('0x21')](function(_0x4d6417){if(_0x4d6417){fs['unlinkSync'](path['join'](_0x3a0a99[_0x6215('0x48')],util['format']('%s.%s',_0x4d6417['name'],_0x4d6417[_0x6215('0x5d')])));return _0x4d6417;}})['catch'](function(_0x2732a4){throw new db[(_0x6215('0x5a'))][(_0x6215('0x5b'))](_0x2732a4[_0x6215('0x68')]);});})[_0x6215('0x21')](handleEntityNotFound(_0x91a9f,null))[_0x6215('0x21')](respondWithStatusCode(_0x91a9f,0xcc))[_0x6215('0x3f')](handleError(_0x91a9f,null));};exports[_0x6215('0x69')]=function(_0x48937b,_0x1c5e60,_0x4317db){var _0xac4641={};var _0x15662a={};var _0x2613cf;var _0x184ead;return db[_0x6215('0x29')][_0x6215('0x66')]({'where':{'id':_0x48937b[_0x6215('0x40')]['id']}})[_0x6215('0x21')](handleEntityNotFound(_0x1c5e60,null))[_0x6215('0x21')](function(_0x5856ef){if(_0x5856ef){_0x2613cf=_0x5856ef;_0x15662a[_0x6215('0x2c')]=_[_0x6215('0x2f')](db['Sound'][_0x6215('0x41')]);_0x15662a['query']=_[_0x6215('0x2f')](_0x48937b[_0x6215('0x2e')]);_0x15662a[_0x6215('0x30')]=_[_0x6215('0x32')](_0x15662a['model'],_0x15662a['query']);_0xac4641[_0x6215('0x31')]=_[_0x6215('0x32')](_0x15662a[_0x6215('0x2c')],qs[_0x6215('0x33')](_0x48937b[_0x6215('0x2e')]['fields']));_0xac4641[_0x6215('0x31')]=_0xac4641[_0x6215('0x31')][_0x6215('0x34')]?_0xac4641[_0x6215('0x31')]:_0x15662a[_0x6215('0x2c')];_0xac4641[_0x6215('0x6a')]=qs['sort'](_0x48937b[_0x6215('0x2e')][_0x6215('0x36')]);_0xac4641['where']=qs[_0x6215('0x30')](_[_0x6215('0x38')](_0x48937b[_0x6215('0x2e')],_0x15662a[_0x6215('0x30')]));if(_0x48937b[_0x6215('0x2e')][_0x6215('0x39')]){_0xac4641[_0x6215('0x37')]=_[_0x6215('0x3a')](_0xac4641[_0x6215('0x37')],{'$or':_['map'](_0xac4641[_0x6215('0x31')],function(_0x4ad852){var _0x18c349={};_0x18c349[_0x4ad852]={'$like':'%'+_0x48937b['query'][_0x6215('0x39')]+'%'};return _0x18c349;})});}_0xac4641=_[_0x6215('0x3a')]({},_0xac4641,_0x48937b[_0x6215('0x3d')]);return _0x2613cf[_0x6215('0x69')](_0xac4641);}})[_0x6215('0x21')](function(_0x3c1783){if(_0x3c1783){_0x184ead=_0x3c1783[_0x6215('0x34')];if(!_0x48937b['query'][_0x6215('0x35')](_0x6215('0x6b'))){_0xac4641[_0x6215('0x1a')]=qs['limit'](_0x48937b[_0x6215('0x2e')]['limit']);_0xac4641['offset']=qs[_0x6215('0x18')](_0x48937b[_0x6215('0x2e')][_0x6215('0x18')]);}return _0x2613cf[_0x6215('0x69')](_0xac4641);}})[_0x6215('0x21')](function(_0x54f4a5){if(_0x54f4a5){return _0x54f4a5?{'count':_0x184ead,'rows':_0x54f4a5}:null;}})[_0x6215('0x21')](respondWithResult(_0x1c5e60,null))[_0x6215('0x3f')](handleError(_0x1c5e60,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e35bd90..00fd461 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 _0xbfb3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','voice_musiconhold','lodash','util','../../config/logger','api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbfb3,0xa5));var _0x3bfb=function(_0x53b372,_0x4423ac){_0x53b372=_0x53b372-0x0;var _0x38c774=_0xbfb3[_0x53b372];return _0x38c774;};'use strict';var _=require(_0x3bfb('0x0'));var util=require(_0x3bfb('0x1'));var logger=require(_0x3bfb('0x2'))(_0x3bfb('0x3'));var moment=require(_0x3bfb('0x4'));var BPromise=require(_0x3bfb('0x5'));var rp=require(_0x3bfb('0x6'));var fs=require('fs');var path=require(_0x3bfb('0x7'));var rimraf=require(_0x3bfb('0x8'));var config=require(_0x3bfb('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x3bfb('0xa')]=function(_0x1c86a6,_0x2d23d2){return _0x1c86a6[_0x3bfb('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0x3bfb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd96f=['api','bluebird','request-promise','path','../../config/environment','voice_musiconhold','util'];(function(_0x46ff6d,_0x3bdd9a){var _0x3a47a1=function(_0x518e63){while(--_0x518e63){_0x46ff6d['push'](_0x46ff6d['shift']());}};_0x3a47a1(++_0x3bdd9a);}(_0xd96f,0x99));var _0xfd96=function(_0x41783c,_0x186476){_0x41783c=_0x41783c-0x0;var _0x45869c=_0xd96f[_0x41783c];return _0x45869c;};'use strict';var _=require('lodash');var util=require(_0xfd96('0x0'));var logger=require('../../config/logger')(_0xfd96('0x1'));var moment=require('moment');var BPromise=require(_0xfd96('0x2'));var rp=require(_0xfd96('0x3'));var fs=require('fs');var path=require(_0xfd96('0x4'));var rimraf=require('rimraf');var config=require(_0xfd96('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x21b4fa,_0xa8433f){return _0x21b4fa['define']('VoiceMusicOnHold',attributes,{'tableName':_0xfd96('0x6'),'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 c3d2949..5f2aeaf 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(_0x2e84b5,_0x3bfe37){var _0x4a9e16=function(_0x4dd46c){while(--_0x4dd46c){_0x2e84b5['push'](_0x2e84b5['shift']());}};_0x4a9e16(++_0x3bfe37);}(_0x70e0,0x17b));var _0x070e=function(_0x22c7f7,_0x3b1fe6){_0x22c7f7=_0x22c7f7-0x0;var _0x4dc1f3=_0x70e0[_0x22c7f7];return _0x4dc1f3;};'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(_0x115219,_0x2aa566){var _0x6b147e=function(_0x529c27){while(--_0x529c27){_0x115219['push'](_0x115219['shift']());}};_0x6b147e(++_0x2aa566);}(_0xe706,0xa3));var _0x6e70=function(_0x2e067a,_0xab528c){_0x2e067a=_0x2e067a-0x0;var _0xc64976=_0xe706[_0x2e067a];return _0xc64976;};'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 635fe99..22ce7cd 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 _0xcc34=['create','post','addAgents','addTeams','put','update','delete','destroy','removeTeams','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams'];(function(_0x3b044f,_0x58d3d3){var _0x38b9f6=function(_0x51c657){while(--_0x51c657){_0x3b044f['push'](_0x3b044f['shift']());}};_0x38b9f6(++_0x58d3d3);}(_0xcc34,0x7e));var _0x4cc3=function(_0x211d44,_0xb45656){_0x211d44=_0x211d44-0x0;var _0x38df13=_0xcc34[_0x211d44];return _0x38df13;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4cc3('0x0'));var timeout=require('connect-timeout');var express=require(_0x4cc3('0x1'));var router=express[_0x4cc3('0x2')]();var fs_extra=require(_0x4cc3('0x3'));var auth=require(_0x4cc3('0x4'));var interaction=require(_0x4cc3('0x5'));var config=require(_0x4cc3('0x6'));var controller=require(_0x4cc3('0x7'));router[_0x4cc3('0x8')]('/',auth[_0x4cc3('0x9')](),controller[_0x4cc3('0xa')]);router['get'](_0x4cc3('0xb'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0xc')]);router['get'](_0x4cc3('0xd'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0xe')]);router['get'](_0x4cc3('0xf'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x10')]);router[_0x4cc3('0x8')](_0x4cc3('0x11'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x12')]);router['post']('/',auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x13')]);router[_0x4cc3('0x14')](_0x4cc3('0xf'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x15')]);router[_0x4cc3('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4cc3('0x16')]);router[_0x4cc3('0x17')](_0x4cc3('0xd'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x18')]);router[_0x4cc3('0x19')](_0x4cc3('0xd'),auth['isAuthenticated'](),controller[_0x4cc3('0x1a')]);router[_0x4cc3('0x19')]('/:id/users',auth[_0x4cc3('0x9')](),controller['removeAgents']);router[_0x4cc3('0x19')](_0x4cc3('0x11'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x1b')]);module[_0x4cc3('0x1c')]=router; \ No newline at end of file +var _0x9658=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','create','post','addAgents','addTeams','put','update','destroy','delete','removeAgents','removeTeams','multer'];(function(_0xcdc172,_0x544f94){var _0x587c9f=function(_0x403dc6){while(--_0x403dc6){_0xcdc172['push'](_0xcdc172['shift']());}};_0x587c9f(++_0x544f94);}(_0x9658,0x6f));var _0x8965=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x9658[_0x2bc1fe];return _0x1a47a5;};'use strict';var multer=require(_0x8965('0x0'));var util=require('util');var path=require(_0x8965('0x1'));var timeout=require(_0x8965('0x2'));var express=require('express');var router=express[_0x8965('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8965('0x4'));var interaction=require(_0x8965('0x5'));var config=require(_0x8965('0x6'));var controller=require('./voicePrefix.controller');router[_0x8965('0x7')]('/',auth[_0x8965('0x8')](),controller[_0x8965('0x9')]);router[_0x8965('0x7')](_0x8965('0xa'),auth[_0x8965('0x8')](),controller[_0x8965('0xb')]);router[_0x8965('0x7')](_0x8965('0xc'),auth[_0x8965('0x8')](),controller[_0x8965('0xd')]);router[_0x8965('0x7')](_0x8965('0xe'),auth[_0x8965('0x8')](),controller[_0x8965('0xf')]);router[_0x8965('0x7')](_0x8965('0x10'),auth[_0x8965('0x8')](),controller[_0x8965('0x11')]);router['post']('/',auth[_0x8965('0x8')](),controller[_0x8965('0x12')]);router[_0x8965('0x13')](_0x8965('0xe'),auth[_0x8965('0x8')](),controller[_0x8965('0x14')]);router[_0x8965('0x13')](_0x8965('0x10'),auth['isAuthenticated'](),controller[_0x8965('0x15')]);router[_0x8965('0x16')](_0x8965('0xc'),auth[_0x8965('0x8')](),controller[_0x8965('0x17')]);router['delete'](_0x8965('0xc'),auth[_0x8965('0x8')](),controller[_0x8965('0x18')]);router[_0x8965('0x19')]('/:id/users',auth[_0x8965('0x8')](),controller[_0x8965('0x1a')]);router[_0x8965('0x19')](_0x8965('0x10'),auth[_0x8965('0x8')](),controller[_0x8965('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index e5656c4..2051ca1 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 _0xf0bc=['name','INTEGER','sequelize','exports','VIRTUAL','system-','getDataValue'];(function(_0x4b2c96,_0x3ce6cd){var _0x31549b=function(_0x539272){while(--_0x539272){_0x4b2c96['push'](_0x4b2c96['shift']());}};_0x31549b(++_0x3ce6cd);}(_0xf0bc,0x87));var _0xcf0b=function(_0x21c0ca,_0x3d4ebd){_0x21c0ca=_0x21c0ca-0x0;var _0x24f3c3=_0xf0bc[_0x21c0ca];return _0x24f3c3;};'use strict';var Sequelize=require(_0xcf0b('0x0'));module[_0xcf0b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xcf0b('0x2')],'get':function(_0xe03948){return _0xcf0b('0x3')+this[_0xcf0b('0x4')](_0xcf0b('0x5'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xcf0b('0x6')]}}; \ No newline at end of file +var _0xb686=['STRING','name','VIRTUAL','system-','INTEGER','sequelize','exports'];(function(_0x340585,_0x1aae37){var _0x2583c0=function(_0x1580a4){while(--_0x1580a4){_0x340585['push'](_0x340585['shift']());}};_0x2583c0(++_0x1aae37);}(_0xb686,0xec));var _0x6b68=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb686[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x6b68('0x0'));module[_0x6b68('0x1')]={'name':{'type':Sequelize[_0x6b68('0x2')],'allowNull':![],'unique':_0x6b68('0x3')},'prefix':{'type':Sequelize[_0x6b68('0x4')],'get':function(_0x2486ef){return _0x6b68('0x5')+this['getDataValue'](_0x6b68('0x3'))+'-';}},'description':{'type':Sequelize[_0x6b68('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x6b68('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index b74bd14..1b32a60 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 _0x3266=['index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','emit','userVoicePrefix:save','ids','removeAgents','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','getTeams','Team','interface','Agents','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x3266,0x6a));var _0x6326=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x3266[_0x5a9c0c];return _0x53c77d;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];config[_0x6326('0x1c')]=_['defaults'](config['redis'],{'host':_0x6326('0x1d'),'port':0x18eb});var socket=require(_0x6326('0x1e'))(new Redis(config['redis']));require(_0x6326('0x1f'))['register'](socket);function respondWithStatusCode(_0x2d2d9b,_0x20dcc6){_0x20dcc6=_0x20dcc6||0xcc;return function(_0x3d6ac0){if(_0x3d6ac0){return _0x2d2d9b[_0x6326('0x20')](_0x20dcc6);}return _0x2d2d9b[_0x6326('0x21')](_0x20dcc6)[_0x6326('0x22')]();};}function respondWithResult(_0x55923a,_0x1104c5){_0x1104c5=_0x1104c5||0xc8;return function(_0x518e6f){if(_0x518e6f){return _0x55923a['status'](_0x1104c5)['json'](_0x518e6f);}};}function respondWithFilteredResult(_0x51e7b9,_0x5d402d){return function(_0x58e960){if(_0x58e960){var _0xdf5ced=typeof _0x5d402d[_0x6326('0x23')]===_0x6326('0x24')&&typeof _0x5d402d['limit']==='undefined';var _0x954ed5=_0x58e960[_0x6326('0x25')];var _0x272b5c=_0xdf5ced?0x0:_0x5d402d[_0x6326('0x23')];var _0x3c08db=_0xdf5ced?_0x58e960[_0x6326('0x25')]:_0x5d402d[_0x6326('0x23')]+_0x5d402d['limit'];var _0x22307f;if(_0x3c08db>=_0x954ed5){_0x3c08db=_0x954ed5;_0x22307f=0xc8;}else{_0x22307f=0xce;}_0x51e7b9['status'](_0x22307f);return _0x51e7b9[_0x6326('0x26')](_0x6326('0x27'),_0x272b5c+'-'+_0x3c08db+'/'+_0x954ed5)[_0x6326('0x28')](_0x58e960);}return null;};}function patchUpdates(_0x24fb78){return function(_0x43cdfc){try{jsonpatch[_0x6326('0x29')](_0x43cdfc,_0x24fb78,!![]);}catch(_0x225555){return BPromise[_0x6326('0x2a')](_0x225555);}return _0x43cdfc[_0x6326('0x2b')]();};}function saveUpdates(_0x2d0d00,_0x34954b){return function(_0x4933e1){if(_0x4933e1){return _0x4933e1[_0x6326('0x2c')](_0x2d0d00)[_0x6326('0x2d')](function(_0x575701){return _0x575701;});}return null;};}function removeEntity(_0x4e272b,_0x4d28fd){return function(_0x405474){if(_0x405474){return _0x405474['destroy']()[_0x6326('0x2d')](function(){var _0x1a48da=_0x405474['get']({'plain':!![]});var _0x15e33d=_0x6326('0x2e');return db[_0x6326('0x2f')][_0x6326('0x30')]({'where':{'type':_0x15e33d,'resourceId':_0x1a48da['id']}})[_0x6326('0x2d')](function(){return _0x405474;});})[_0x6326('0x2d')](function(){_0x4e272b[_0x6326('0x21')](0xcc)[_0x6326('0x22')]();});}};}function handleEntityNotFound(_0x461e0f,_0x127744){return function(_0x4980f6){if(!_0x4980f6){_0x461e0f[_0x6326('0x20')](0x194);}return _0x4980f6;};}function handleError(_0x331772,_0x134524){_0x134524=_0x134524||0x1f4;return function(_0x2e0445){logger[_0x6326('0x31')](_0x2e0445['stack']);if(_0x2e0445[_0x6326('0x32')]){delete _0x2e0445[_0x6326('0x32')];}_0x331772[_0x6326('0x21')](_0x134524)['send'](_0x2e0445);};}exports[_0x6326('0x33')]=function(_0x4d7807,_0x4e703a){var _0xfb6b62={},_0x7ac8d9={},_0x160a12={'count':0x0,'rows':[]};var _0x103b1c=_[_0x6326('0x34')](db[_0x6326('0x35')][_0x6326('0x36')],function(_0x46c803){return{'name':_0x46c803[_0x6326('0x37')],'type':_0x46c803[_0x6326('0x38')][_0x6326('0x39')]};});_0x7ac8d9[_0x6326('0x3a')]=_['map'](_0x103b1c,_0x6326('0x32'));_0x7ac8d9[_0x6326('0x3b')]=_['keys'](_0x4d7807[_0x6326('0x3b')]);_0x7ac8d9[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x7ac8d9['model'],_0x7ac8d9[_0x6326('0x3b')]);_0xfb6b62['attributes']=_['intersection'](_0x7ac8d9[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x4d7807[_0x6326('0x3b')]['fields']));_0xfb6b62[_0x6326('0x3f')]=_0xfb6b62['attributes'][_0x6326('0x40')]?_0xfb6b62['attributes']:_0x7ac8d9[_0x6326('0x3a')];if(!_0x4d7807[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0xfb6b62[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x4d7807['query'][_0x6326('0x43')]);_0xfb6b62[_0x6326('0x23')]=qs['offset'](_0x4d7807[_0x6326('0x3b')]['offset']);}_0xfb6b62['order']=qs[_0x6326('0x44')](_0x4d7807[_0x6326('0x3b')][_0x6326('0x44')]);_0xfb6b62[_0x6326('0x45')]=qs[_0x6326('0x3c')](_[_0x6326('0x46')](_0x4d7807['query'],_0x7ac8d9['filters']),_0x103b1c);if(_0x4d7807[_0x6326('0x3b')]['filter']){_0xfb6b62[_0x6326('0x45')]=_['merge'](_0xfb6b62[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x103b1c,function(_0x335feb){if(_0x335feb[_0x6326('0x38')]!==_0x6326('0x47')){var _0x1b754d={};_0x1b754d[_0x335feb[_0x6326('0x32')]]={'$like':'%'+_0x4d7807[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x1b754d;}})});}_0xfb6b62=_[_0x6326('0x49')]({},_0xfb6b62,_0x4d7807[_0x6326('0x4a')]);var _0x5d36b1={'where':_0xfb6b62[_0x6326('0x45')]};return db['VoicePrefix'][_0x6326('0x25')](_0x5d36b1)[_0x6326('0x2d')](function(_0x16fc33){_0x160a12[_0x6326('0x25')]=_0x16fc33;if(_0x4d7807['query'][_0x6326('0x4b')]){_0xfb6b62[_0x6326('0x4c')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6326('0x4d')](_0xfb6b62);})[_0x6326('0x2d')](function(_0x7a5057){_0x160a12[_0x6326('0x4e')]=_0x7a5057;return _0x160a12;})['then'](respondWithFilteredResult(_0x4e703a,_0xfb6b62))[_0x6326('0x4f')](handleError(_0x4e703a,null));};exports[_0x6326('0x50')]=function(_0x231e15,_0x28504f){var _0x44d852={'raw':![],'where':{'id':_0x231e15[_0x6326('0x51')]['id']}},_0x165953={};_0x165953['model']=_[_0x6326('0x52')](db[_0x6326('0x35')][_0x6326('0x36')]);_0x165953[_0x6326('0x3b')]=_['keys'](_0x231e15[_0x6326('0x3b')]);_0x165953['filters']=_[_0x6326('0x3d')](_0x165953[_0x6326('0x3a')],_0x165953[_0x6326('0x3b')]);_0x44d852[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x165953['model'],qs[_0x6326('0x3e')](_0x231e15['query']['fields']));_0x44d852[_0x6326('0x3f')]=_0x44d852[_0x6326('0x3f')]['length']?_0x44d852[_0x6326('0x3f')]:_0x165953[_0x6326('0x3a')];if(_0x231e15[_0x6326('0x3b')][_0x6326('0x4b')]){_0x44d852[_0x6326('0x4c')]=[{'all':!![]}];}_0x44d852=_['merge']({},_0x44d852,_0x231e15['options']);return db[_0x6326('0x35')][_0x6326('0x53')](_0x44d852)[_0x6326('0x2d')](handleEntityNotFound(_0x28504f,null))[_0x6326('0x2d')](respondWithResult(_0x28504f,null))[_0x6326('0x4f')](handleError(_0x28504f,null));};exports[_0x6326('0x30')]=function(_0xdc4522,_0x55bcd6){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0xdc4522[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x55bcd6,null))[_0x6326('0x2d')](removeEntity(_0x55bcd6,null))['catch'](handleError(_0x55bcd6,null));};exports[_0x6326('0x54')]=function(_0x55537a,_0x216972){return db[_0x6326('0x35')]['describe']()[_0x6326('0x2d')](respondWithResult(_0x216972,null))['catch'](handleError(_0x216972,null));};exports[_0x6326('0x55')]=function(_0x202fd3,_0x2ee8df){var _0x35400e;return db['sequelize'][_0x6326('0x56')](function(_0xbe6b3e){return db['VoicePrefix'][_0x6326('0x55')](_0x202fd3[_0x6326('0x57')],{'transaction':_0xbe6b3e})[_0x6326('0x2d')](function(_0x4a42ae){_0x35400e=_0x4a42ae[_0x6326('0x58')]({'plain':!![]});return db[_0x6326('0x59')]['find']({'where':{'id':_0x35400e[_0x6326('0x5a')]},'raw':!![]})['then'](function(_0x1f1463){return createVoicePrefixExtensions(_0x35400e,_0x1f1463,_0xbe6b3e);});});})[_0x6326('0x2d')](function(){var _0x3e9825=_0x202fd3[_0x6326('0x5b')][_0x6326('0x58')]({'plain':!![]});if(!_0x3e9825)throw new Error(_0x6326('0x5c'));if(_0x3e9825[_0x6326('0x5d')]==='user'){var _0x51adce=_0x35400e;return db['UserProfileSection'][_0x6326('0x53')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9825[_0x6326('0x5e')]},'raw':!![]})[_0x6326('0x2d')](function(_0xcae454){if(_0xcae454&&_0xcae454[_0x6326('0x5f')]===0x0){return db[_0x6326('0x2f')]['create']({'name':_0x51adce[_0x6326('0x32')],'resourceId':_0x51adce['id'],'type':_0xcae454[_0x6326('0x32')],'sectionId':_0xcae454['id']},{})['then'](function(){return _0x35400e;});}else{return _0x35400e;}})[_0x6326('0x4f')](function(_0xdeba28){logger[_0x6326('0x31')](_0x6326('0x60'),_0xdeba28);throw _0xdeba28;});}return _0x35400e;})[_0x6326('0x2d')](respondWithResult(_0x2ee8df,null))[_0x6326('0x4f')](handleError(_0x2ee8df,null));};function Extension(_0x320d43,_0x2f624f,_0x2c7a8d,_0x37506f){this['context']=_0x6326('0x61');this[_0x6326('0x62')]=_0x320d43;this[_0x6326('0x63')]=_0x2c7a8d;this[_0x6326('0x38')]='system';this['description']=_0x6326('0x64');this[_0x6326('0x65')]=_0x2f624f;this[_0x6326('0x66')]=_0x37506f;}function createVoicePrefixExtensions(_0x10f54b,_0x3ac39d,_0x54a9eb){return new BPromise(function(_0x4cec50,_0x13fc10){var _0x447b34=new Extension(formatPrefixName(_0x10f54b[_0x6326('0x67')]),0x1,_0x6326('0x68'),'Voice\x20Prefix');_0x447b34[_0x6326('0x69')]=_0x10f54b['id'];return db[_0x6326('0x59')][_0x6326('0x55')](_0x447b34,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x4197d6){var _0xc8f404=_0x4197d6['get']({'plain':!![]});var _0x2bc08a=_['map'](addVoicePrefixExtensions(_0x10f54b,_0x3ac39d),function(_0x4877c8){_0x4877c8[_0x6326('0x5a')]=_0xc8f404['id'];_0x4877c8['VoicePrefixId']=_0x10f54b['id'];return _0x4877c8;});return db[_0x6326('0x59')][_0x6326('0x6a')](_0x2bc08a,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x3b6de7){if(!_0x3b6de7){return _0x13fc10(_0x6326('0x6b'));}else{return _0x4cec50(_0x3b6de7);}})[_0x6326('0x4f')](function(_0x1e8d86){return _0x13fc10(_0x1e8d86);});});;});};function addVoicePrefixExtensions(_0x75e3a7,_0xa2928e){var _0x3f5e2e=[];var _0x53ff60=formatPrefixName(_0x75e3a7[_0x6326('0x67')]);_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x2,_0x6326('0x6d'),_0x6326('0x6e')+_0x75e3a7[_0x6326('0x32')]));if(_0x75e3a7['callerIdAll']){_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,_0x6326('0x6d'),_0x6326('0x6f')+_0x75e3a7[_0x6326('0x70')]));}else{_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,'NoOp',_0x6326('0x71')));}_0x3f5e2e['push'](new Extension(_0x53ff60,0x4,'goto',_0xa2928e[_0x6326('0x72')]+','+_0x6326('0x73')+(0x8+_0x75e3a7[_0x6326('0x32')][_0x6326('0x40')])+'}'+','+0x1));return _0x3f5e2e;}function formatPrefixName(_0x4fd921){var _0x4fbede='_';for(var _0x5cadb2=0x0;_0x5cadb2<_0x4fd921['length'];_0x5cadb2++){if(_0x4fd921[_0x6326('0x74')](_0x5cadb2)=='-'){_0x4fbede+=_0x4fd921['charAt'](_0x5cadb2);}else{_0x4fbede+='['+_0x4fd921[_0x6326('0x74')](_0x5cadb2)+']';}}_0x4fbede+='.';return _0x4fbede;}exports[_0x6326('0x2c')]=function(_0x54730e,_0x4c1d7e,_0x5401cf){var _0x5e86bc=_0x54730e['body'];_0x5e86bc[_0x6326('0x67')]='system-'+_0x5e86bc['name']+'-';return db['sequelize']['transaction'](function(_0x19916e){return db['VoicePrefix'][_0x6326('0x2c')](_0x5e86bc,{'where':{'id':_0x5e86bc['id']},'transaction':_0x19916e})[_0x6326('0x2d')](function(){return db['VoiceExtension'][_0x6326('0x30')]({'where':{'VoicePrefixId':_0x5e86bc['id']},'transaction':_0x19916e})['then'](function(){return db[_0x6326('0x59')][_0x6326('0x53')]({'where':{'id':_0x5e86bc[_0x6326('0x5a')]},'raw':!![]})[_0x6326('0x2d')](function(_0x339838){return createVoicePrefixExtensions(_0x5e86bc,_0x339838,_0x19916e);});});});})[_0x6326('0x2d')](function(){return db[_0x6326('0x35')][_0x6326('0x75')](_0x5e86bc['id']);})[_0x6326('0x2d')](respondWithResult(_0x4c1d7e,null))[_0x6326('0x4f')](handleError(_0x4c1d7e,null));};exports[_0x6326('0x76')]=function(_0x19cc2b,_0x3bc5f3,_0x27a505){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0x19cc2b[_0x6326('0x51')]['id']}})['then'](handleEntityNotFound(_0x3bc5f3,null))['then'](function(_0x543792){if(_0x543792){return _0x543792['addAgents'](_0x19cc2b[_0x6326('0x57')]['ids'],_['omit'](_0x19cc2b['body'],['ids','id'])||{})['spread'](function(_0x5a1a9f){for(var _0xe845d6=0x0;_0xe845d6<_0x19cc2b[_0x6326('0x57')]['ids'][_0x6326('0x40')];_0xe845d6+=0x1){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':Number(_0x19cc2b['body'][_0x6326('0x79')][_0xe845d6]),'VoicePrefixId':Number(_0x19cc2b[_0x6326('0x51')]['id'])});}return _0x5a1a9f;});}})[_0x6326('0x2d')](respondWithResult(_0x3bc5f3,null))[_0x6326('0x4f')](handleError(_0x3bc5f3,null));};exports[_0x6326('0x7a')]=function(_0x483813,_0x3bff09,_0x4aec22){return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x483813['params']['id']}})['then'](handleEntityNotFound(_0x3bff09,null))['then'](function(_0x491f2e){if(_0x491f2e){return _0x491f2e['removeAgents'](_0x483813['query']['ids'])[_0x6326('0x2d')](function(){if(_[_0x6326('0x7b')](_0x483813[_0x6326('0x3b')][_0x6326('0x79')])){for(var _0x590e06=0x0;_0x590e06<_0x483813['query']['ids'][_0x6326('0x40')];_0x590e06+=0x1){socket[_0x6326('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x483813[_0x6326('0x3b')]['ids'][_0x590e06]),'VoicePrefixId':Number(_0x483813['params']['id'])});}}else{socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':Number(_0x483813[_0x6326('0x3b')][_0x6326('0x79')]),'VoicePrefixId':Number(_0x483813[_0x6326('0x51')]['id'])});}});}})[_0x6326('0x2d')](respondWithStatusCode(_0x3bff09,null))[_0x6326('0x4f')](handleError(_0x3bff09,null));};exports['getAgents']=function(_0x5afd24,_0x4c8bde,_0x1ec0ef){var _0x5223f4={};var _0x48631a={};var _0xaea64f;var _0x429c41;return db['VoicePrefix'][_0x6326('0x7d')]({'where':{'id':_0x5afd24['params']['id']}})['then'](handleEntityNotFound(_0x4c8bde,null))[_0x6326('0x2d')](function(_0xbca686){if(_0xbca686){_0xaea64f=_0xbca686;_0x48631a['model']=_['keys'](db[_0x6326('0x7e')][_0x6326('0x36')]);_0x48631a[_0x6326('0x3b')]=_[_0x6326('0x52')](_0x5afd24['query']);_0x48631a['filters']=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],_0x48631a[_0x6326('0x3b')]);_0x5223f4[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x5afd24[_0x6326('0x3b')]['fields']));_0x5223f4[_0x6326('0x3f')]=_0x5223f4['attributes'][_0x6326('0x40')]?_0x5223f4[_0x6326('0x3f')]:_0x48631a[_0x6326('0x3a')];_0x5223f4[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x5afd24[_0x6326('0x3b')]['sort']);_0x5223f4[_0x6326('0x45')]=qs[_0x6326('0x3c')](_['pick'](_0x5afd24[_0x6326('0x3b')],_0x48631a[_0x6326('0x3c')]));if(_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]){_0x5223f4[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5223f4[_0x6326('0x45')],{'$or':_['map'](_0x5223f4[_0x6326('0x3f')],function(_0x21ccbf){var _0x458a7e={};_0x458a7e[_0x21ccbf]={'$like':'%'+_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x458a7e;})});}_0x5223f4=_['merge']({},_0x5223f4,_0x5afd24[_0x6326('0x4a')]);return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})['then'](function(_0x411fe5){if(_0x411fe5){_0x429c41=_0x411fe5[_0x6326('0x40')];if(!_0x5afd24[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5223f4[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x5afd24[_0x6326('0x3b')]['limit']);_0x5223f4[_0x6326('0x23')]=qs[_0x6326('0x23')](_0x5afd24[_0x6326('0x3b')][_0x6326('0x23')]);}return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})[_0x6326('0x2d')](function(_0xcb5683){if(_0xcb5683){return _0xcb5683?{'count':_0x429c41,'rows':_0xcb5683}:null;}})['then'](respondWithResult(_0x4c8bde,null))[_0x6326('0x4f')](handleError(_0x4c8bde,null));};exports['getTeams']=function(_0x44cea5,_0x57e6ad,_0x3a9312){var _0x5b251f={};var _0x2b885b={};var _0xda3005;var _0x29682b;return db[_0x6326('0x35')][_0x6326('0x7d')]({'where':{'id':_0x44cea5[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x57e6ad,null))['then'](function(_0x1da431){if(_0x1da431){_0xda3005=_0x1da431;_0x2b885b[_0x6326('0x3a')]=_[_0x6326('0x52')](db['Team'][_0x6326('0x36')]);_0x2b885b['query']=_[_0x6326('0x52')](_0x44cea5[_0x6326('0x3b')]);_0x2b885b[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x2b885b[_0x6326('0x3a')],_0x2b885b[_0x6326('0x3b')]);_0x5b251f[_0x6326('0x3f')]=_['intersection'](_0x2b885b[_0x6326('0x3a')],qs['fields'](_0x44cea5[_0x6326('0x3b')][_0x6326('0x3e')]));_0x5b251f[_0x6326('0x3f')]=_0x5b251f[_0x6326('0x3f')]['length']?_0x5b251f['attributes']:_0x2b885b[_0x6326('0x3a')];_0x5b251f[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x44cea5[_0x6326('0x3b')]['sort']);_0x5b251f[_0x6326('0x45')]=qs['filters'](_['pick'](_0x44cea5[_0x6326('0x3b')],_0x2b885b[_0x6326('0x3c')]));if(_0x44cea5[_0x6326('0x3b')][_0x6326('0x48')]){_0x5b251f[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5b251f[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x5b251f[_0x6326('0x3f')],function(_0x3884db){var _0x5ccb35={};_0x5ccb35[_0x3884db]={'$like':'%'+_0x44cea5['query'][_0x6326('0x48')]+'%'};return _0x5ccb35;})});}_0x5b251f=_['merge']({},_0x5b251f,_0x44cea5[_0x6326('0x4a')]);return _0xda3005['getTeams'](_0x5b251f);}})['then'](function(_0x10d3c6){if(_0x10d3c6){_0x29682b=_0x10d3c6[_0x6326('0x40')];if(!_0x44cea5[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5b251f[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x44cea5[_0x6326('0x3b')]['limit']);_0x5b251f['offset']=qs[_0x6326('0x23')](_0x44cea5['query'][_0x6326('0x23')]);}return _0xda3005[_0x6326('0x81')](_0x5b251f);}})['then'](function(_0x5c57e5){if(_0x5c57e5){return _0x5c57e5?{'count':_0x29682b,'rows':_0x5c57e5}:null;}})[_0x6326('0x2d')](respondWithResult(_0x57e6ad,null))['catch'](handleError(_0x57e6ad,null));};exports['addTeams']=function(_0x50d766,_0x4f45a6,_0x3a9a9e){var _0x22c60d=_0x50d766[_0x6326('0x57')][_0x6326('0x79')];var _0x26f784;return db[_0x6326('0x82')]['findAll']({'where':{'id':_0x22c60d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause',_0x6326('0x83')],'raw':!![]}]})[_0x6326('0x2d')](function(_0x215db1){if(_0x215db1){_0x26f784=_0x215db1;var _0x2a9f5c=_['flatMap'](_0x215db1,function(_0x20f5ea){var _0x293f72=_0x20f5ea['get']({'plain':!![]});return _0x293f72[_0x6326('0x84')];});return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x50d766[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](function(_0x5d4b0a){return db['sequelize'][_0x6326('0x56')](function(_0xf912fe){return _0x5d4b0a[_0x6326('0x85')](_0x22c60d,{'transaction':_0xf912fe})['then'](function(){return BPromise[_0x6326('0x86')](_0x26f784,function(_0x464914){return db[_0x6326('0x87')]['upsert']({'TeamId':_0x464914['id'],'VoicePrefixId':_0x50d766[_0x6326('0x51')]['id']},{'transaction':_0xf912fe});});})['then'](function(){return BPromise[_0x6326('0x86')](_0x2a9f5c,function(_0x5a7b49){return db[_0x6326('0x88')][_0x6326('0x89')]({'where':{'UserId':_0x5a7b49['id'],'VoicePrefixId':_0x50d766['params']['id']},'transaction':_0xf912fe});});})[_0x6326('0x2d')](function(){_0x2a9f5c[_0x6326('0x8a')](function(_0x38d8c8){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':_0x38d8c8['id'],'VoicePrefixId':_0x5d4b0a['id']});});});});});}})[_0x6326('0x2d')](respondWithStatusCode(_0x4f45a6,null))[_0x6326('0x4f')](handleError(_0x4f45a6,null));};exports[_0x6326('0x8b')]=function(_0x43dc1e,_0x26ea69,_0x1a4b94){return db[_0x6326('0x82')][_0x6326('0x4d')]({'where':{'id':_0x43dc1e['query'][_0x6326('0x79')]},'attributes':['id'],'include':[{'model':db[_0x6326('0x7e')],'as':_0x6326('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x26ea69,null))['then'](function(_0x489226){var _0x5db6b3=_[_0x6326('0x34')](_0x489226,'id');var _0x5135df=[];var _0x4c15d2=[];var _0xd9c385=squel['select']();_0xd9c385['field'](_0x6326('0x8c'))['from'](_0x6326('0x8d'),'tq')[_0x6326('0x8e')](_0x6326('0x8f'),'ut',_0x6326('0x90'))[_0x6326('0x45')](_0x6326('0x91'),_0x43dc1e[_0x6326('0x51')]['id']);for(var _0x26391c=0x0;_0x26391c<_0x489226[_0x6326('0x40')];_0x26391c+=0x1){let _0x1adcbc=_0x489226[_0x26391c];for(var _0x46bece=0x0;_0x46bece<_0x1adcbc[_0x6326('0x84')][_0x6326('0x40')];_0x46bece+=0x1){let _0x30d31a=_0x1adcbc[_0x6326('0x84')][_0x46bece];var _0x3ec241=_0xd9c385[_0x6326('0x92')]();_0x3ec241[_0x6326('0x45')](_0x6326('0x93'),_0x30d31a['id']);_0x4c15d2[_0x6326('0x6c')](db['sequelize'][_0x6326('0x3b')](_0x3ec241[_0x6326('0x94')](),{'type':db[_0x6326('0x95')][_0x6326('0x96')][_0x6326('0x97')]})[_0x6326('0x2d')](function(_0x292657){if(_0x292657[_0x6326('0x40')]===0x1){return _0x30d31a['id'];}else{var _0x909cce=_[_0x6326('0x98')](_['map'](_0x292657,_0x6326('0x99')),function(_0x4b493a){return _[_0x6326('0x9a')](_0x5db6b3,_0x4b493a);});if(_0x909cce){return _0x30d31a['id'];}}}));}}return BPromise[_0x6326('0x9b')](_0x4c15d2)['then'](function(_0x2b98a4){_0x5135df=_(_0x5135df)[_0x6326('0x9c')](_0x2b98a4)['compact']()['value']();return db[_0x6326('0x35')]['find']({'where':{'id':_0x43dc1e[_0x6326('0x51')]['id']}})['then'](function(_0x4a470e){return db[_0x6326('0x95')][_0x6326('0x56')](function(_0x298a11){return _0x4a470e[_0x6326('0x8b')](_0x43dc1e[_0x6326('0x3b')][_0x6326('0x79')],{'transaction':_0x298a11})[_0x6326('0x2d')](function(){if(!_['isEmpty'](_0x5135df)){return _0x4a470e['removeAgents'](_0x5135df,{'transaction':_0x298a11});}})[_0x6326('0x2d')](function(){_0x5135df[_0x6326('0x8a')](function(_0x42d1db){socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':_0x42d1db,'VoicePrefixId':_0x4a470e['id']});});});});});});})['then'](respondWithStatusCode(_0x26ea69,null))[_0x6326('0x4f')](handleError(_0x26ea69,null));}; \ No newline at end of file +var _0xd4a2=['appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','goto','charAt','system-','sequelize','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','nolimit','getTeams','Team','Agents','voicePause','interface','flatMap','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','isEmpty','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','show','include','options','find','catch','params','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4a2,0x173));var _0x2d4a=function(_0x449ac2,_0x27492f){_0x449ac2=_0x449ac2-0x0;var _0x491d5d=_0xd4a2[_0x449ac2];return _0x491d5d;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d4a('0x1'));var rp=require('request-promise');var moment=require(_0x2d4a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d4a('0x3'));var util=require('util');var path=require(_0x2d4a('0x4'));var sox=require(_0x2d4a('0x5'));var csv=require(_0x2d4a('0x6'));var ejs=require(_0x2d4a('0x7'));var fs=require('fs');var fs_extra=require(_0x2d4a('0x8'));var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x6'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var Redis=require(_0x2d4a('0xf'));var authService=require(_0x2d4a('0x10'));var qs=require(_0x2d4a('0x11'));var as=require(_0x2d4a('0x12'));var hardwareService=require(_0x2d4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2d4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4a('0x15'));var db=require(_0x2d4a('0x16'))['db'];config[_0x2d4a('0x17')]=_[_0x2d4a('0x18')](config[_0x2d4a('0x17')],{'host':_0x2d4a('0x19'),'port':0x18eb});var socket=require(_0x2d4a('0x1a'))(new Redis(config[_0x2d4a('0x17')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x2a1d0f,_0x5b6c4f){_0x5b6c4f=_0x5b6c4f||0xcc;return function(_0x11c64a){if(_0x11c64a){return _0x2a1d0f[_0x2d4a('0x1b')](_0x5b6c4f);}return _0x2a1d0f[_0x2d4a('0x1c')](_0x5b6c4f)[_0x2d4a('0x1d')]();};}function respondWithResult(_0x4c5287,_0x5f825d){_0x5f825d=_0x5f825d||0xc8;return function(_0x5a6378){if(_0x5a6378){return _0x4c5287[_0x2d4a('0x1c')](_0x5f825d)['json'](_0x5a6378);}};}function respondWithFilteredResult(_0x435687,_0xd1dd52){return function(_0x2188b2){if(_0x2188b2){var _0x388371=typeof _0xd1dd52['offset']==='undefined'&&typeof _0xd1dd52['limit']===_0x2d4a('0x1e');var _0x1966d1=_0x2188b2[_0x2d4a('0x1f')];var _0x419df5=_0x388371?0x0:_0xd1dd52[_0x2d4a('0x20')];var _0x2e4069=_0x388371?_0x2188b2['count']:_0xd1dd52['offset']+_0xd1dd52[_0x2d4a('0x21')];var _0x1f3e17;if(_0x2e4069>=_0x1966d1){_0x2e4069=_0x1966d1;_0x1f3e17=0xc8;}else{_0x1f3e17=0xce;}_0x435687[_0x2d4a('0x1c')](_0x1f3e17);return _0x435687[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x419df5+'-'+_0x2e4069+'/'+_0x1966d1)[_0x2d4a('0x24')](_0x2188b2);}return null;};}function patchUpdates(_0x22dd0b){return function(_0xa43fb1){try{jsonpatch['apply'](_0xa43fb1,_0x22dd0b,!![]);}catch(_0x26e7b8){return BPromise[_0x2d4a('0x25')](_0x26e7b8);}return _0xa43fb1[_0x2d4a('0x26')]();};}function saveUpdates(_0x42d813,_0x2c845c){return function(_0xed2822){if(_0xed2822){return _0xed2822[_0x2d4a('0x27')](_0x42d813)[_0x2d4a('0x28')](function(_0x54c910){return _0x54c910;});}return null;};}function removeEntity(_0x544b9b,_0x5cc7d8){return function(_0x2bb9f0){if(_0x2bb9f0){return _0x2bb9f0['destroy']()[_0x2d4a('0x28')](function(){var _0x3a2fd3=_0x2bb9f0[_0x2d4a('0x29')]({'plain':!![]});var _0x1d2fa6=_0x2d4a('0x2a');return db[_0x2d4a('0x2b')][_0x2d4a('0x2c')]({'where':{'type':_0x1d2fa6,'resourceId':_0x3a2fd3['id']}})[_0x2d4a('0x28')](function(){return _0x2bb9f0;});})['then'](function(){_0x544b9b[_0x2d4a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221602,_0x9bac28){return function(_0xc497ce){if(!_0xc497ce){_0x221602[_0x2d4a('0x1b')](0x194);}return _0xc497ce;};}function handleError(_0x101382,_0x1dfc5d){_0x1dfc5d=_0x1dfc5d||0x1f4;return function(_0x25ac5c){logger[_0x2d4a('0x2d')](_0x25ac5c['stack']);if(_0x25ac5c[_0x2d4a('0x2e')]){delete _0x25ac5c[_0x2d4a('0x2e')];}_0x101382[_0x2d4a('0x1c')](_0x1dfc5d)[_0x2d4a('0x2f')](_0x25ac5c);};}exports[_0x2d4a('0x30')]=function(_0x57bf71,_0x217653){var _0x31d8ae={},_0x27015d={},_0x24bcc2={'count':0x0,'rows':[]};var _0x2bb93d=_['map'](db[_0x2d4a('0x31')][_0x2d4a('0x32')],function(_0x46b623){return{'name':_0x46b623[_0x2d4a('0x33')],'type':_0x46b623[_0x2d4a('0x34')][_0x2d4a('0x35')]};});_0x27015d['model']=_[_0x2d4a('0x36')](_0x2bb93d,_0x2d4a('0x2e'));_0x27015d[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x57bf71[_0x2d4a('0x37')]);_0x27015d['filters']=_[_0x2d4a('0x39')](_0x27015d[_0x2d4a('0x3a')],_0x27015d['query']);_0x31d8ae[_0x2d4a('0x3b')]=_[_0x2d4a('0x39')](_0x27015d[_0x2d4a('0x3a')],qs[_0x2d4a('0x3c')](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x3c')]));_0x31d8ae['attributes']=_0x31d8ae[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x31d8ae[_0x2d4a('0x3b')]:_0x27015d[_0x2d4a('0x3a')];if(!_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x3e')]('nolimit')){_0x31d8ae['limit']=qs[_0x2d4a('0x21')](_0x57bf71['query'][_0x2d4a('0x21')]);_0x31d8ae[_0x2d4a('0x20')]=qs['offset'](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x20')]);}_0x31d8ae[_0x2d4a('0x3f')]=qs[_0x2d4a('0x40')](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x40')]);_0x31d8ae[_0x2d4a('0x41')]=qs[_0x2d4a('0x42')](_[_0x2d4a('0x43')](_0x57bf71[_0x2d4a('0x37')],_0x27015d[_0x2d4a('0x42')]),_0x2bb93d);if(_0x57bf71['query'][_0x2d4a('0x44')]){_0x31d8ae[_0x2d4a('0x41')]=_[_0x2d4a('0x45')](_0x31d8ae[_0x2d4a('0x41')],{'$or':_[_0x2d4a('0x36')](_0x2bb93d,function(_0x483a40){if(_0x483a40['type']!=='VIRTUAL'){var _0x5af510={};_0x5af510[_0x483a40[_0x2d4a('0x2e')]]={'$like':'%'+_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x44')]+'%'};return _0x5af510;}})});}_0x31d8ae=_[_0x2d4a('0x45')]({},_0x31d8ae,_0x57bf71['options']);var _0x155f2d={'where':_0x31d8ae[_0x2d4a('0x41')]};return db['VoicePrefix'][_0x2d4a('0x1f')](_0x155f2d)[_0x2d4a('0x28')](function(_0x8a9375){_0x24bcc2[_0x2d4a('0x1f')]=_0x8a9375;if(_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x46')]){_0x31d8ae['include']=[{'all':!![]}];}return db[_0x2d4a('0x31')][_0x2d4a('0x47')](_0x31d8ae);})[_0x2d4a('0x28')](function(_0x365399){_0x24bcc2[_0x2d4a('0x48')]=_0x365399;return _0x24bcc2;})[_0x2d4a('0x28')](respondWithFilteredResult(_0x217653,_0x31d8ae))['catch'](handleError(_0x217653,null));};exports[_0x2d4a('0x49')]=function(_0x1f08a3,_0x10b723){var _0x4e1901={'raw':![],'where':{'id':_0x1f08a3['params']['id']}},_0x2585db={};_0x2585db[_0x2d4a('0x3a')]=_[_0x2d4a('0x38')](db[_0x2d4a('0x31')][_0x2d4a('0x32')]);_0x2585db[_0x2d4a('0x37')]=_['keys'](_0x1f08a3['query']);_0x2585db[_0x2d4a('0x42')]=_[_0x2d4a('0x39')](_0x2585db['model'],_0x2585db[_0x2d4a('0x37')]);_0x4e1901['attributes']=_[_0x2d4a('0x39')](_0x2585db[_0x2d4a('0x3a')],qs[_0x2d4a('0x3c')](_0x1f08a3['query'][_0x2d4a('0x3c')]));_0x4e1901['attributes']=_0x4e1901[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x4e1901[_0x2d4a('0x3b')]:_0x2585db[_0x2d4a('0x3a')];if(_0x1f08a3[_0x2d4a('0x37')][_0x2d4a('0x46')]){_0x4e1901[_0x2d4a('0x4a')]=[{'all':!![]}];}_0x4e1901=_[_0x2d4a('0x45')]({},_0x4e1901,_0x1f08a3[_0x2d4a('0x4b')]);return db[_0x2d4a('0x31')][_0x2d4a('0x4c')](_0x4e1901)['then'](handleEntityNotFound(_0x10b723,null))[_0x2d4a('0x28')](respondWithResult(_0x10b723,null))[_0x2d4a('0x4d')](handleError(_0x10b723,null));};exports[_0x2d4a('0x2c')]=function(_0x1467ab,_0x2d2e24){return db['VoicePrefix'][_0x2d4a('0x4c')]({'where':{'id':_0x1467ab[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x2d2e24,null))[_0x2d4a('0x28')](removeEntity(_0x2d2e24,null))[_0x2d4a('0x4d')](handleError(_0x2d2e24,null));};exports['describe']=function(_0x4b9a52,_0x43e74a){return db[_0x2d4a('0x31')]['describe']()[_0x2d4a('0x28')](respondWithResult(_0x43e74a,null))[_0x2d4a('0x4d')](handleError(_0x43e74a,null));};exports[_0x2d4a('0x4f')]=function(_0x19109b,_0x52a468){var _0x31576d;return db['sequelize'][_0x2d4a('0x50')](function(_0x3fe91b){return db[_0x2d4a('0x31')][_0x2d4a('0x4f')](_0x19109b[_0x2d4a('0x51')],{'transaction':_0x3fe91b})[_0x2d4a('0x28')](function(_0x25fb59){_0x31576d=_0x25fb59[_0x2d4a('0x29')]({'plain':!![]});return db['VoiceExtension'][_0x2d4a('0x4c')]({'where':{'id':_0x31576d[_0x2d4a('0x52')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x67ddff){return createVoicePrefixExtensions(_0x31576d,_0x67ddff,_0x3fe91b);});});})[_0x2d4a('0x28')](function(){var _0x334d6a=_0x19109b[_0x2d4a('0x53')][_0x2d4a('0x29')]({'plain':!![]});if(!_0x334d6a)throw new Error(_0x2d4a('0x54'));if(_0x334d6a[_0x2d4a('0x55')]===_0x2d4a('0x53')){var _0x113bc4=_0x31576d;return db[_0x2d4a('0x56')][_0x2d4a('0x4c')]({'where':{'name':_0x2d4a('0x2a'),'userProfileId':_0x334d6a[_0x2d4a('0x57')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x4cce5e){if(_0x4cce5e&&_0x4cce5e[_0x2d4a('0x58')]===0x0){return db[_0x2d4a('0x2b')]['create']({'name':_0x113bc4[_0x2d4a('0x2e')],'resourceId':_0x113bc4['id'],'type':_0x4cce5e[_0x2d4a('0x2e')],'sectionId':_0x4cce5e['id']},{})[_0x2d4a('0x28')](function(){return _0x31576d;});}else{return _0x31576d;}})[_0x2d4a('0x4d')](function(_0x165c00){logger[_0x2d4a('0x2d')](_0x2d4a('0x59'),_0x165c00);throw _0x165c00;});}return _0x31576d;})[_0x2d4a('0x28')](respondWithResult(_0x52a468,null))[_0x2d4a('0x4d')](handleError(_0x52a468,null));};function Extension(_0x352b50,_0x346f2b,_0x302323,_0x5c7cf9){this[_0x2d4a('0x5a')]=_0x2d4a('0x5b');this['exten']=_0x352b50;this[_0x2d4a('0x5c')]=_0x302323;this[_0x2d4a('0x34')]=_0x2d4a('0x5d');this[_0x2d4a('0x5e')]=_0x2d4a('0x5f');this[_0x2d4a('0x60')]=_0x346f2b;this[_0x2d4a('0x61')]=_0x5c7cf9;}function createVoicePrefixExtensions(_0x43e6a6,_0x1034d2,_0x282df8){return new BPromise(function(_0x5bbc96,_0x2bd137){var _0x8ae6bd=new Extension(formatPrefixName(_0x43e6a6[_0x2d4a('0x62')]),0x1,'NoOp',_0x2d4a('0x63'));_0x8ae6bd[_0x2d4a('0x64')]=_0x43e6a6['id'];return db[_0x2d4a('0x65')][_0x2d4a('0x4f')](_0x8ae6bd,{'transaction':_0x282df8})[_0x2d4a('0x28')](function(_0x278bbc){var _0x7e2699=_0x278bbc[_0x2d4a('0x29')]({'plain':!![]});var _0x1ed616=_['map'](addVoicePrefixExtensions(_0x43e6a6,_0x1034d2),function(_0x21b8e9){_0x21b8e9[_0x2d4a('0x52')]=_0x7e2699['id'];_0x21b8e9[_0x2d4a('0x64')]=_0x43e6a6['id'];return _0x21b8e9;});return db[_0x2d4a('0x65')][_0x2d4a('0x66')](_0x1ed616,{'transaction':_0x282df8})[_0x2d4a('0x28')](function(_0x53f52b){if(!_0x53f52b){return _0x2bd137(_0x2d4a('0x67'));}else{return _0x5bbc96(_0x53f52b);}})[_0x2d4a('0x4d')](function(_0x22707f){return _0x2bd137(_0x22707f);});});;});};function addVoicePrefixExtensions(_0x4809af,_0x465c89){var _0x442691=[];var _0x4f4a09=formatPrefixName(_0x4809af[_0x2d4a('0x62')]);_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x2,'Set',_0x2d4a('0x69')+_0x4809af['name']));if(_0x4809af['callerIdAll']){_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x3,_0x2d4a('0x6a'),_0x2d4a('0x6b')+_0x4809af[_0x2d4a('0x6c')]));}else{_0x442691['push'](new Extension(_0x4f4a09,0x3,_0x2d4a('0x6d'),_0x2d4a('0x6e')));}_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x4,_0x2d4a('0x6f'),_0x465c89['context']+','+'${EXTEN:'+(0x8+_0x4809af[_0x2d4a('0x2e')][_0x2d4a('0x3d')])+'}'+','+0x1));return _0x442691;}function formatPrefixName(_0x2a2441){var _0x2aa9e8='_';for(var _0x9e6321=0x0;_0x9e6321<_0x2a2441[_0x2d4a('0x3d')];_0x9e6321++){if(_0x2a2441[_0x2d4a('0x70')](_0x9e6321)=='-'){_0x2aa9e8+=_0x2a2441['charAt'](_0x9e6321);}else{_0x2aa9e8+='['+_0x2a2441[_0x2d4a('0x70')](_0x9e6321)+']';}}_0x2aa9e8+='.';return _0x2aa9e8;}exports[_0x2d4a('0x27')]=function(_0xf3d514,_0x398439,_0x59810d){var _0x299bdf=_0xf3d514[_0x2d4a('0x51')];_0x299bdf[_0x2d4a('0x62')]=_0x2d4a('0x71')+_0x299bdf['name']+'-';return db[_0x2d4a('0x72')][_0x2d4a('0x50')](function(_0x55d565){return db[_0x2d4a('0x31')][_0x2d4a('0x27')](_0x299bdf,{'where':{'id':_0x299bdf['id']},'transaction':_0x55d565})[_0x2d4a('0x28')](function(){return db['VoiceExtension'][_0x2d4a('0x2c')]({'where':{'VoicePrefixId':_0x299bdf['id']},'transaction':_0x55d565})[_0x2d4a('0x28')](function(){return db[_0x2d4a('0x65')][_0x2d4a('0x4c')]({'where':{'id':_0x299bdf[_0x2d4a('0x52')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x3bc965){return createVoicePrefixExtensions(_0x299bdf,_0x3bc965,_0x55d565);});});});})['then'](function(){return db[_0x2d4a('0x31')][_0x2d4a('0x73')](_0x299bdf['id']);})[_0x2d4a('0x28')](respondWithResult(_0x398439,null))[_0x2d4a('0x4d')](handleError(_0x398439,null));};exports[_0x2d4a('0x74')]=function(_0x55ebbb,_0x38e623,_0x5aead3){return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x55ebbb[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x38e623,null))[_0x2d4a('0x28')](function(_0x2ba9c2){if(_0x2ba9c2){return _0x2ba9c2[_0x2d4a('0x74')](_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')],_[_0x2d4a('0x76')](_0x55ebbb['body'],[_0x2d4a('0x75'),'id'])||{})['spread'](function(_0x3d7d7d){for(var _0x3c284d=0x0;_0x3c284d<_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')][_0x2d4a('0x3d')];_0x3c284d+=0x1){socket[_0x2d4a('0x77')](_0x2d4a('0x78'),{'UserId':Number(_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')][_0x3c284d]),'VoicePrefixId':Number(_0x55ebbb['params']['id'])});}return _0x3d7d7d;});}})[_0x2d4a('0x28')](respondWithResult(_0x38e623,null))[_0x2d4a('0x4d')](handleError(_0x38e623,null));};exports[_0x2d4a('0x79')]=function(_0xcdf787,_0x574285,_0x36d253){return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0xcdf787[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x574285,null))[_0x2d4a('0x28')](function(_0x5769be){if(_0x5769be){return _0x5769be[_0x2d4a('0x79')](_0xcdf787[_0x2d4a('0x37')]['ids'])[_0x2d4a('0x28')](function(){if(_[_0x2d4a('0x7a')](_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')])){for(var _0x429579=0x0;_0x429579<_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')][_0x2d4a('0x3d')];_0x429579+=0x1){socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':Number(_0xcdf787['query'][_0x2d4a('0x75')][_0x429579]),'VoicePrefixId':Number(_0xcdf787['params']['id'])});}}else{socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':Number(_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')]),'VoicePrefixId':Number(_0xcdf787[_0x2d4a('0x4e')]['id'])});}});}})[_0x2d4a('0x28')](respondWithStatusCode(_0x574285,null))[_0x2d4a('0x4d')](handleError(_0x574285,null));};exports['getAgents']=function(_0x119c59,_0x2ebb9e,_0xc11b2e){var _0xfc7b53={};var _0x47377e={};var _0x5e7f23;var _0x4ebda1;return db['VoicePrefix'][_0x2d4a('0x7c')]({'where':{'id':_0x119c59[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x2ebb9e,null))['then'](function(_0x135f58){if(_0x135f58){_0x5e7f23=_0x135f58;_0x47377e[_0x2d4a('0x3a')]=_[_0x2d4a('0x38')](db[_0x2d4a('0x7d')][_0x2d4a('0x32')]);_0x47377e[_0x2d4a('0x37')]=_['keys'](_0x119c59[_0x2d4a('0x37')]);_0x47377e['filters']=_[_0x2d4a('0x39')](_0x47377e[_0x2d4a('0x3a')],_0x47377e['query']);_0xfc7b53[_0x2d4a('0x3b')]=_['intersection'](_0x47377e['model'],qs['fields'](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x3c')]));_0xfc7b53[_0x2d4a('0x3b')]=_0xfc7b53['attributes'][_0x2d4a('0x3d')]?_0xfc7b53[_0x2d4a('0x3b')]:_0x47377e[_0x2d4a('0x3a')];_0xfc7b53[_0x2d4a('0x3f')]=qs['sort'](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x40')]);_0xfc7b53['where']=qs[_0x2d4a('0x42')](_[_0x2d4a('0x43')](_0x119c59['query'],_0x47377e[_0x2d4a('0x42')]));if(_0x119c59['query']['filter']){_0xfc7b53[_0x2d4a('0x41')]=_['merge'](_0xfc7b53[_0x2d4a('0x41')],{'$or':_[_0x2d4a('0x36')](_0xfc7b53[_0x2d4a('0x3b')],function(_0x44d3b3){var _0x5e939f={};_0x5e939f[_0x44d3b3]={'$like':'%'+_0x119c59[_0x2d4a('0x37')]['filter']+'%'};return _0x5e939f;})});}_0xfc7b53=_[_0x2d4a('0x45')]({},_0xfc7b53,_0x119c59[_0x2d4a('0x4b')]);return _0x5e7f23[_0x2d4a('0x7e')](_0xfc7b53);}})[_0x2d4a('0x28')](function(_0x45f6b7){if(_0x45f6b7){_0x4ebda1=_0x45f6b7['length'];if(!_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x3e')](_0x2d4a('0x7f'))){_0xfc7b53['limit']=qs[_0x2d4a('0x21')](_0x119c59['query']['limit']);_0xfc7b53[_0x2d4a('0x20')]=qs[_0x2d4a('0x20')](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x20')]);}return _0x5e7f23[_0x2d4a('0x7e')](_0xfc7b53);}})[_0x2d4a('0x28')](function(_0x2bffb4){if(_0x2bffb4){return _0x2bffb4?{'count':_0x4ebda1,'rows':_0x2bffb4}:null;}})[_0x2d4a('0x28')](respondWithResult(_0x2ebb9e,null))[_0x2d4a('0x4d')](handleError(_0x2ebb9e,null));};exports[_0x2d4a('0x80')]=function(_0x5ecf3e,_0x16c4fd,_0x2b29b1){var _0x4647cb={};var _0x10d86c={};var _0x36b067;var _0x1cb5b3;return db[_0x2d4a('0x31')][_0x2d4a('0x7c')]({'where':{'id':_0x5ecf3e['params']['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x16c4fd,null))[_0x2d4a('0x28')](function(_0xa4c947){if(_0xa4c947){_0x36b067=_0xa4c947;_0x10d86c['model']=_[_0x2d4a('0x38')](db['Team'][_0x2d4a('0x32')]);_0x10d86c[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x5ecf3e[_0x2d4a('0x37')]);_0x10d86c['filters']=_[_0x2d4a('0x39')](_0x10d86c['model'],_0x10d86c[_0x2d4a('0x37')]);_0x4647cb[_0x2d4a('0x3b')]=_[_0x2d4a('0x39')](_0x10d86c['model'],qs[_0x2d4a('0x3c')](_0x5ecf3e['query'][_0x2d4a('0x3c')]));_0x4647cb[_0x2d4a('0x3b')]=_0x4647cb[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x4647cb[_0x2d4a('0x3b')]:_0x10d86c[_0x2d4a('0x3a')];_0x4647cb[_0x2d4a('0x3f')]=qs[_0x2d4a('0x40')](_0x5ecf3e[_0x2d4a('0x37')]['sort']);_0x4647cb['where']=qs['filters'](_[_0x2d4a('0x43')](_0x5ecf3e['query'],_0x10d86c[_0x2d4a('0x42')]));if(_0x5ecf3e['query'][_0x2d4a('0x44')]){_0x4647cb[_0x2d4a('0x41')]=_['merge'](_0x4647cb['where'],{'$or':_[_0x2d4a('0x36')](_0x4647cb['attributes'],function(_0x279c26){var _0x643012={};_0x643012[_0x279c26]={'$like':'%'+_0x5ecf3e[_0x2d4a('0x37')]['filter']+'%'};return _0x643012;})});}_0x4647cb=_[_0x2d4a('0x45')]({},_0x4647cb,_0x5ecf3e[_0x2d4a('0x4b')]);return _0x36b067[_0x2d4a('0x80')](_0x4647cb);}})[_0x2d4a('0x28')](function(_0x1c3c0f){if(_0x1c3c0f){_0x1cb5b3=_0x1c3c0f[_0x2d4a('0x3d')];if(!_0x5ecf3e[_0x2d4a('0x37')][_0x2d4a('0x3e')](_0x2d4a('0x7f'))){_0x4647cb[_0x2d4a('0x21')]=qs[_0x2d4a('0x21')](_0x5ecf3e[_0x2d4a('0x37')]['limit']);_0x4647cb[_0x2d4a('0x20')]=qs[_0x2d4a('0x20')](_0x5ecf3e[_0x2d4a('0x37')]['offset']);}return _0x36b067[_0x2d4a('0x80')](_0x4647cb);}})[_0x2d4a('0x28')](function(_0x250a9c){if(_0x250a9c){return _0x250a9c?{'count':_0x1cb5b3,'rows':_0x250a9c}:null;}})[_0x2d4a('0x28')](respondWithResult(_0x16c4fd,null))[_0x2d4a('0x4d')](handleError(_0x16c4fd,null));};exports['addTeams']=function(_0x438769,_0x1483af,_0x5413c1){var _0x2d5122=_0x438769['body'][_0x2d4a('0x75')];var _0x1cd7fd;return db[_0x2d4a('0x81')][_0x2d4a('0x47')]({'where':{'id':_0x2d5122},'attributes':['id'],'include':[{'model':db[_0x2d4a('0x7d')],'as':_0x2d4a('0x82'),'attributes':['id',_0x2d4a('0x2e'),'online',_0x2d4a('0x83'),_0x2d4a('0x84')],'raw':!![]}]})[_0x2d4a('0x28')](function(_0x1e5be2){if(_0x1e5be2){_0x1cd7fd=_0x1e5be2;var _0x139e4e=_[_0x2d4a('0x85')](_0x1e5be2,function(_0x58b196){var _0x23577f=_0x58b196[_0x2d4a('0x29')]({'plain':!![]});return _0x23577f[_0x2d4a('0x82')];});return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x438769['params']['id']}})['then'](function(_0x3e276d){return db[_0x2d4a('0x72')][_0x2d4a('0x50')](function(_0x2fee11){return _0x3e276d[_0x2d4a('0x86')](_0x2d5122,{'transaction':_0x2fee11})[_0x2d4a('0x28')](function(){return BPromise[_0x2d4a('0x87')](_0x1cd7fd,function(_0x1adcbc){return db[_0x2d4a('0x88')]['upsert']({'TeamId':_0x1adcbc['id'],'VoicePrefixId':_0x438769['params']['id']},{'transaction':_0x2fee11});});})[_0x2d4a('0x28')](function(){return BPromise[_0x2d4a('0x87')](_0x139e4e,function(_0x3b4585){return db[_0x2d4a('0x89')][_0x2d4a('0x8a')]({'where':{'UserId':_0x3b4585['id'],'VoicePrefixId':_0x438769[_0x2d4a('0x4e')]['id']},'transaction':_0x2fee11});});})[_0x2d4a('0x28')](function(){_0x139e4e[_0x2d4a('0x8b')](function(_0x12914d){socket[_0x2d4a('0x77')](_0x2d4a('0x78'),{'UserId':_0x12914d['id'],'VoicePrefixId':_0x3e276d['id']});});});});});}})[_0x2d4a('0x28')](respondWithStatusCode(_0x1483af,null))['catch'](handleError(_0x1483af,null));};exports['removeTeams']=function(_0x51cba2,_0x448b4d,_0x4cefec){return db['Team'][_0x2d4a('0x47')]({'where':{'id':_0x51cba2[_0x2d4a('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2d4a('0x28')](handleEntityNotFound(_0x448b4d,null))[_0x2d4a('0x28')](function(_0x1e05c5){var _0x3e199a=_[_0x2d4a('0x36')](_0x1e05c5,'id');var _0x357dfc=[];var _0xd80165=[];var _0x448664=squel[_0x2d4a('0x8c')]();_0x448664[_0x2d4a('0x8d')]('tq.TeamId')[_0x2d4a('0x8e')](_0x2d4a('0x8f'),'tq')[_0x2d4a('0x90')](_0x2d4a('0x91'),'ut',_0x2d4a('0x92'))[_0x2d4a('0x41')]('VoicePrefixId\x20=\x20?',_0x51cba2[_0x2d4a('0x4e')]['id']);for(var _0x3030e1=0x0;_0x3030e1<_0x1e05c5['length'];_0x3030e1+=0x1){let _0xc5500=_0x1e05c5[_0x3030e1];for(var _0xe198b=0x0;_0xe198b<_0xc5500['Agents']['length'];_0xe198b+=0x1){let _0x497b03=_0xc5500['Agents'][_0xe198b];var _0xb81202=_0x448664['clone']();_0xb81202[_0x2d4a('0x41')](_0x2d4a('0x93'),_0x497b03['id']);_0xd80165[_0x2d4a('0x68')](db[_0x2d4a('0x72')][_0x2d4a('0x37')](_0xb81202[_0x2d4a('0x94')](),{'type':db[_0x2d4a('0x72')]['QueryTypes'][_0x2d4a('0x95')]})['then'](function(_0x2b6040){if(_0x2b6040[_0x2d4a('0x3d')]===0x1){return _0x497b03['id'];}else{var _0x137c57=_[_0x2d4a('0x96')](_[_0x2d4a('0x36')](_0x2b6040,_0x2d4a('0x97')),function(_0x29108f){return _['includes'](_0x3e199a,_0x29108f);});if(_0x137c57){return _0x497b03['id'];}}}));}}return BPromise[_0x2d4a('0x98')](_0xd80165)['then'](function(_0x1d4cc3){_0x357dfc=_(_0x357dfc)[_0x2d4a('0x99')](_0x1d4cc3)[_0x2d4a('0x9a')]()['value']();return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x51cba2[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](function(_0x108cd1){return db[_0x2d4a('0x72')]['transaction'](function(_0x29a294){return _0x108cd1['removeTeams'](_0x51cba2[_0x2d4a('0x37')]['ids'],{'transaction':_0x29a294})['then'](function(){if(!_[_0x2d4a('0x9b')](_0x357dfc)){return _0x108cd1['removeAgents'](_0x357dfc,{'transaction':_0x29a294});}})['then'](function(){_0x357dfc[_0x2d4a('0x8b')](function(_0x206717){socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':_0x206717,'VoicePrefixId':_0x108cd1['id']});});});});});});})[_0x2d4a('0x28')](respondWithStatusCode(_0x448b4d,null))[_0x2d4a('0x4d')](handleError(_0x448b4d,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 5cb962e..67868c7 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 _0xb201=['VoicePrefix','setMaxListeners','remove','emit','exports','events','../../mysqldb'];(function(_0xf4b82a,_0x11eac1){var _0x20b505=function(_0x26ca8d){while(--_0x26ca8d){_0xf4b82a['push'](_0xf4b82a['shift']());}};_0x20b505(++_0x11eac1);}(_0xb201,0x1be));var _0x1b20=function(_0x42788e,_0x5482e6){_0x42788e=_0x42788e-0x0;var _0x3b9d1b=_0xb201[_0x42788e];return _0x3b9d1b;};'use strict';var EventEmitter=require(_0x1b20('0x0'));var VoicePrefix=require(_0x1b20('0x1'))['db'][_0x1b20('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1b20('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1b20('0x4')};function emitEvent(_0x40c606){return function(_0x2fb74a,_0x459741,_0x2a7f58){VoicePrefixEvents[_0x1b20('0x5')](_0x40c606+':'+_0x2fb74a['id'],_0x2fb74a);VoicePrefixEvents[_0x1b20('0x5')](_0x40c606,_0x2fb74a);_0x2a7f58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x1b20('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x9a45=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x33dbcb,_0x5a9cc1){var _0x3b9fdd=function(_0x56609d){while(--_0x56609d){_0x33dbcb['push'](_0x33dbcb['shift']());}};_0x3b9fdd(++_0x5a9cc1);}(_0x9a45,0x8d));var _0x59a4=function(_0x313e64,_0x1e2019){_0x313e64=_0x313e64-0x0;var _0x9d4f24=_0x9a45[_0x313e64];return _0x9d4f24;};'use strict';var EventEmitter=require(_0x59a4('0x0'));var VoicePrefix=require(_0x59a4('0x1'))['db'][_0x59a4('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x59a4('0x3')](0x0);var events={'afterCreate':_0x59a4('0x4'),'afterUpdate':'update','afterDestroy':_0x59a4('0x5')};function emitEvent(_0x8faff9){return function(_0x2aa2be,_0x51792b,_0x1a25c5){VoicePrefixEvents[_0x59a4('0x6')](_0x8faff9+':'+_0x2aa2be['id'],_0x2aa2be);VoicePrefixEvents['emit'](_0x8faff9,_0x2aa2be);_0x1a25c5(null);};}for(var e in events){if(events[_0x59a4('0x7')](e)){var event=events[e];VoicePrefix[_0x59a4('0x8')](e,emitEvent(event));}}module[_0x59a4('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 4968122..05d0f0d 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 _0x829e=['./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','api','path','rimraf','../../config/environment'];(function(_0x4c8e4c,_0x1b48e8){var _0x3117bf=function(_0xb45f11){while(--_0xb45f11){_0x4c8e4c['push'](_0x4c8e4c['shift']());}};_0x3117bf(++_0x1b48e8);}(_0x829e,0x11c));var _0xe829=function(_0x3589e2,_0x29f815){_0x3589e2=_0x3589e2-0x0;var _0x2e77ef=_0x829e[_0x3589e2];return _0x2e77ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe829('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe829('0x1'));var rimraf=require(_0xe829('0x2'));var config=require(_0xe829('0x3'));var attributes=require(_0xe829('0x4'));module['exports']=function(_0x1c9024,_0x1829b2){return _0x1c9024[_0xe829('0x5')](_0xe829('0x6'),attributes,{'tableName':_0xe829('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcae6=['request-promise','../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3987a1,_0x447793){var _0xe2596e=function(_0x546925){while(--_0x546925){_0x3987a1['push'](_0x3987a1['shift']());}};_0xe2596e(++_0x447793);}(_0xcae6,0x13a));var _0x6cae=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0xcae6[_0xe1b5f6];return _0x44636e;};'use strict';var _=require(_0x6cae('0x0'));var util=require(_0x6cae('0x1'));var logger=require(_0x6cae('0x2'))('api');var moment=require(_0x6cae('0x3'));var BPromise=require(_0x6cae('0x4'));var rp=require(_0x6cae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6cae('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x6cae('0x7')]=function(_0x4a5ade,_0x25d6de){return _0x4a5ade[_0x6cae('0x8')](_0x6cae('0x9'),attributes,{'tableName':_0x6cae('0xa'),'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 57607ea..11a97ec 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 _0x47a1=['localhost','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x47a1,0xbd));var _0x147a=function(_0x1b03b6,_0x3930dc){_0x1b03b6=_0x1b03b6-0x0;var _0x14b8e1=_0x47a1[_0x1b03b6];return _0x14b8e1;};'use strict';var _=require(_0x147a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x147a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x147a('0x2'));var db=require(_0x147a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x147a('0x4'))(_0x147a('0x5'));var config=require(_0x147a('0x6'));var jayson=require(_0x147a('0x7'));var client=jayson[_0x147a('0x8')]['http']({'port':0x232a});config[_0x147a('0x9')]=_[_0x147a('0xa')](config[_0x147a('0x9')],{'host':_0x147a('0xb'),'port':0x18eb});var socket=require(_0x147a('0xc'))(new Redis(config[_0x147a('0x9')]));require(_0x147a('0xd'))['register'](socket);function respondWithRpcPromise(_0x30e455,_0x3e59e2,_0x5a39d1){return new BPromise(function(_0x2a2a75,_0x5a4ffb){return client[_0x147a('0xe')](_0x30e455,_0x5a39d1)[_0x147a('0xf')](function(_0x337f06){logger['info'](_0x147a('0x10'),_0x3e59e2,_0x147a('0x11'));logger[_0x147a('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3e59e2,_0x147a('0x11'),JSON[_0x147a('0x13')](_0x337f06));if(_0x337f06[_0x147a('0x14')]){if(_0x337f06[_0x147a('0x14')][_0x147a('0x15')]===0x1f4){logger[_0x147a('0x14')](_0x147a('0x10'),_0x3e59e2,_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);return _0x5a4ffb(_0x337f06['error'][_0x147a('0x16')]);}logger['error'](_0x147a('0x10'),_0x3e59e2,_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);return _0x2a2a75(_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);}else{logger[_0x147a('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x3e59e2,'request\x20sent');_0x2a2a75(_0x337f06['result'][_0x147a('0x16')]);}})[_0x147a('0x18')](function(_0x59d61d){logger[_0x147a('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x3e59e2,_0x59d61d);_0x5a4ffb(_0x59d61d);});});} \ No newline at end of file +var _0x0967=['code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x51f9a1,_0x181d54){var _0x14b1d3=function(_0x6a995c){while(--_0x6a995c){_0x51f9a1['push'](_0x51f9a1['shift']());}};_0x14b1d3(++_0x181d54);}(_0x0967,0x100));var _0x7096=function(_0x78a010,_0xd6f3a1){_0x78a010=_0x78a010-0x0;var _0xeacb08=_0x0967[_0x78a010];return _0xeacb08;};'use strict';var _=require(_0x7096('0x0'));var util=require('util');var moment=require(_0x7096('0x1'));var BPromise=require(_0x7096('0x2'));var rs=require(_0x7096('0x3'));var fs=require('fs');var Redis=require(_0x7096('0x4'));var db=require(_0x7096('0x5'))['db'];var utils=require(_0x7096('0x6'));var logger=require(_0x7096('0x7'))(_0x7096('0x8'));var config=require('../../config/environment');var jayson=require(_0x7096('0x9'));var client=jayson[_0x7096('0xa')][_0x7096('0xb')]({'port':0x232a});config[_0x7096('0xc')]=_[_0x7096('0xd')](config[_0x7096('0xc')],{'host':_0x7096('0xe'),'port':0x18eb});var socket=require(_0x7096('0xf'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x7096('0x10')](socket);function respondWithRpcPromise(_0x162c0a,_0x1e7792,_0x5781b5){return new BPromise(function(_0x4b8f7a,_0x2cd64a){return client[_0x7096('0x11')](_0x162c0a,_0x5781b5)[_0x7096('0x12')](function(_0x5703c2){logger['info'](_0x7096('0x13'),_0x1e7792,_0x7096('0x14'));logger['debug'](_0x7096('0x15'),_0x1e7792,'request\x20sent',JSON[_0x7096('0x16')](_0x5703c2));if(_0x5703c2[_0x7096('0x17')]){if(_0x5703c2['error'][_0x7096('0x18')]===0x1f4){logger[_0x7096('0x17')](_0x7096('0x13'),_0x1e7792,_0x5703c2[_0x7096('0x17')][_0x7096('0x19')]);return _0x2cd64a(_0x5703c2[_0x7096('0x17')]['message']);}logger[_0x7096('0x17')](_0x7096('0x13'),_0x1e7792,_0x5703c2[_0x7096('0x17')][_0x7096('0x19')]);return _0x4b8f7a(_0x5703c2[_0x7096('0x17')]['message']);}else{logger[_0x7096('0x1a')](_0x7096('0x13'),_0x1e7792,_0x7096('0x14'));_0x4b8f7a(_0x5703c2['result']['message']);}})[_0x7096('0x1b')](function(_0x4a4cf8){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x1e7792,_0x4a4cf8);_0x2cd64a(_0x4a4cf8);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 1464588..7f19859 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 _0x65f4=['length','voicePrefix:','remove','update','emit','register'];(function(_0x191994,_0x4cad04){var _0x55fc43=function(_0x31d69a){while(--_0x31d69a){_0x191994['push'](_0x191994['shift']());}};_0x55fc43(++_0x4cad04);}(_0x65f4,0x19a));var _0x465f=function(_0x1409b0,_0x5e1954){_0x1409b0=_0x1409b0-0x0;var _0x184f66=_0x65f4[_0x1409b0];return _0x184f66;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x465f('0x0'),_0x465f('0x1')];function createListener(_0x34f1ce,_0x59c7cb){return function(_0x584451){_0x59c7cb[_0x465f('0x2')](_0x34f1ce,_0x584451);};}function removeListener(_0x3bf967,_0x307a2b){return function(){VoicePrefixEvents['removeListener'](_0x3bf967,_0x307a2b);};}exports[_0x465f('0x3')]=function(_0xe5a9bd){for(var _0x44d697=0x0,_0x553ce9=events[_0x465f('0x4')];_0x44d697<_0x553ce9;_0x44d697++){var _0x5e26ea=events[_0x44d697];var _0x523ca1=createListener(_0x465f('0x5')+_0x5e26ea,_0xe5a9bd);VoicePrefixEvents['on'](_0x5e26ea,_0x523ca1);}}; \ No newline at end of file +var _0xee11=['length','./voicePrefix.events','update','emit','removeListener'];(function(_0x41d59c,_0x1f0075){var _0x114b34=function(_0x39adad){while(--_0x39adad){_0x41d59c['push'](_0x41d59c['shift']());}};_0x114b34(++_0x1f0075);}(_0xee11,0x146));var _0x1ee1=function(_0x4a1ec0,_0x26287b){_0x4a1ec0=_0x4a1ec0-0x0;var _0x49ab91=_0xee11[_0x4a1ec0];return _0x49ab91;};'use strict';var VoicePrefixEvents=require(_0x1ee1('0x0'));var events=['save','remove',_0x1ee1('0x1')];function createListener(_0x1a6844,_0x3a1711){return function(_0x1eb386){_0x3a1711[_0x1ee1('0x2')](_0x1a6844,_0x1eb386);};}function removeListener(_0x14d420,_0x3eb96f){return function(){VoicePrefixEvents[_0x1ee1('0x3')](_0x14d420,_0x3eb96f);};}exports['register']=function(_0x1322a7){for(var _0x6be72f=0x0,_0x3fdb3b=events[_0x1ee1('0x4')];_0x6be72f<_0x3fdb3b;_0x6be72f++){var _0x356919=events[_0x6be72f];var _0x47f984=createListener('voicePrefix:'+_0x356919,_0x1322a7);VoicePrefixEvents['on'](_0x356919,_0x47f984);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 5228e68..014b0a4 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 _0x1fc3=['getBlackLists','create','post','/:id/clone','/:id/teams','addTeams','addAgents','/:id/blacklists','addBlackLists','delete','destroy','removeAgents','removeLists','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists'];(function(_0x5df6a5,_0x3b610e){var _0x13c870=function(_0x2741c4){while(--_0x2741c4){_0x5df6a5['push'](_0x5df6a5['shift']());}};_0x13c870(++_0x3b610e);}(_0x1fc3,0xcb));var _0x31fc=function(_0x3a79bc,_0x5a887b){_0x3a79bc=_0x3a79bc-0x0;var _0x2b409b=_0x1fc3[_0x3a79bc];return _0x2b409b;};'use strict';var multer=require(_0x31fc('0x0'));var util=require('util');var path=require(_0x31fc('0x1'));var timeout=require(_0x31fc('0x2'));var express=require(_0x31fc('0x3'));var router=express[_0x31fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x31fc('0x5'));var interaction=require(_0x31fc('0x6'));var config=require('../../config/environment');var controller=require(_0x31fc('0x7'));router[_0x31fc('0x8')]('/',auth[_0x31fc('0x9')](),controller['index']);router[_0x31fc('0x8')](_0x31fc('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x31fc('0x8')](_0x31fc('0xb'),auth[_0x31fc('0x9')](),controller[_0x31fc('0xc')]);router[_0x31fc('0x8')](_0x31fc('0xd'),auth[_0x31fc('0x9')](),controller[_0x31fc('0xe')]);router[_0x31fc('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x31fc('0xf')]);router['get'](_0x31fc('0x10'),auth['isAuthenticated'](),controller[_0x31fc('0x11')]);router[_0x31fc('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x31fc('0x12')]);router['get'](_0x31fc('0x13'),auth[_0x31fc('0x9')](),controller[_0x31fc('0x14')]);router['get'](_0x31fc('0x15'),auth[_0x31fc('0x9')](),controller[_0x31fc('0x16')]);router['get'](_0x31fc('0x17'),auth[_0x31fc('0x9')](),controller[_0x31fc('0x18')]);router[_0x31fc('0x8')]('/:id/blacklists',auth[_0x31fc('0x9')](),controller[_0x31fc('0x19')]);router['post']('/',auth['isAuthenticated'](),controller[_0x31fc('0x1a')]);router[_0x31fc('0x1b')](_0x31fc('0x1c'),auth[_0x31fc('0x9')](),controller['clone']);router[_0x31fc('0x1b')](_0x31fc('0x1d'),auth[_0x31fc('0x9')](),controller[_0x31fc('0x1e')]);router[_0x31fc('0x1b')](_0x31fc('0x13'),auth['isAuthenticated'](),controller[_0x31fc('0x1f')]);router[_0x31fc('0x1b')](_0x31fc('0x17'),auth[_0x31fc('0x9')](),controller['addLists']);router[_0x31fc('0x1b')](_0x31fc('0x20'),auth[_0x31fc('0x9')](),controller[_0x31fc('0x21')]);router['put']('/:id',auth[_0x31fc('0x9')](),controller['update']);router[_0x31fc('0x22')](_0x31fc('0xa'),auth[_0x31fc('0x9')](),controller[_0x31fc('0x23')]);router['delete']('/:id/teams',auth[_0x31fc('0x9')](),controller['removeTeams']);router[_0x31fc('0x22')](_0x31fc('0x13'),auth[_0x31fc('0x9')](),controller[_0x31fc('0x24')]);router[_0x31fc('0x22')]('/:id/lists',auth[_0x31fc('0x9')](),controller[_0x31fc('0x25')]);router['delete'](_0x31fc('0x20'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x4476=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','/:id/lists','addLists','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers'];(function(_0x441eab,_0x583ba5){var _0xe6ff41=function(_0x98c274){while(--_0x98c274){_0x441eab['push'](_0x441eab['shift']());}};_0xe6ff41(++_0x583ba5);}(_0x4476,0x103));var _0x6447=function(_0x5b35ba,_0x2afe21){_0x5b35ba=_0x5b35ba-0x0;var _0xb571a4=_0x4476[_0x5b35ba];return _0xb571a4;};'use strict';var multer=require('multer');var util=require(_0x6447('0x0'));var path=require('path');var timeout=require(_0x6447('0x1'));var express=require(_0x6447('0x2'));var router=express[_0x6447('0x3')]();var fs_extra=require(_0x6447('0x4'));var auth=require(_0x6447('0x5'));var interaction=require(_0x6447('0x6'));var config=require(_0x6447('0x7'));var controller=require('./voiceQueue.controller');router[_0x6447('0x8')]('/',auth[_0x6447('0x9')](),controller[_0x6447('0xa')]);router[_0x6447('0x8')](_0x6447('0xb'),auth[_0x6447('0x9')](),controller[_0x6447('0xc')]);router[_0x6447('0x8')](_0x6447('0xd'),auth[_0x6447('0x9')](),controller[_0x6447('0xe')]);router[_0x6447('0x8')](_0x6447('0xf'),auth['isAuthenticated'](),controller[_0x6447('0x10')]);router['get'](_0x6447('0x11'),auth[_0x6447('0x9')](),controller['getHopperFinals']);router[_0x6447('0x8')]('/:id/hopper_black',auth[_0x6447('0x9')](),controller[_0x6447('0x12')]);router[_0x6447('0x8')](_0x6447('0x13'),auth[_0x6447('0x9')](),controller[_0x6447('0x14')]);router[_0x6447('0x8')](_0x6447('0x15'),auth[_0x6447('0x9')](),controller['getAgents']);router[_0x6447('0x8')](_0x6447('0x16'),auth[_0x6447('0x9')](),controller['getMembers']);router[_0x6447('0x8')]('/:id/lists',auth[_0x6447('0x9')](),controller['getLists']);router[_0x6447('0x8')](_0x6447('0x17'),auth[_0x6447('0x9')](),controller[_0x6447('0x18')]);router[_0x6447('0x19')]('/',auth['isAuthenticated'](),controller[_0x6447('0x1a')]);router[_0x6447('0x19')](_0x6447('0x1b'),auth[_0x6447('0x9')](),controller[_0x6447('0x1c')]);router[_0x6447('0x19')]('/:id/teams',auth[_0x6447('0x9')](),controller[_0x6447('0x1d')]);router['post'](_0x6447('0x15'),auth[_0x6447('0x9')](),controller['addAgents']);router[_0x6447('0x19')](_0x6447('0x1e'),auth[_0x6447('0x9')](),controller[_0x6447('0x1f')]);router[_0x6447('0x19')](_0x6447('0x17'),auth[_0x6447('0x9')](),controller['addBlackLists']);router['put'](_0x6447('0xb'),auth[_0x6447('0x9')](),controller[_0x6447('0x20')]);router[_0x6447('0x21')]('/:id',auth[_0x6447('0x9')](),controller['destroy']);router[_0x6447('0x21')](_0x6447('0x13'),auth[_0x6447('0x9')](),controller[_0x6447('0x22')]);router[_0x6447('0x21')](_0x6447('0x15'),auth[_0x6447('0x9')](),controller[_0x6447('0x23')]);router['delete'](_0x6447('0x1e'),auth['isAuthenticated'](),controller[_0x6447('0x24')]);router[_0x6447('0x21')](_0x6447('0x17'),auth[_0x6447('0x9')](),controller[_0x6447('0x25')]);module[_0x6447('0x26')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index aa95f2e..617df51 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 _0x6596=['yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','name','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','random','wrandom','rrordered','setDataValue','strategy','dialMethod','getDataValue','booked','rrmemory','roundrobin','progressive','predictive','power','INTEGER','all'];(function(_0x484f06,_0x36e4ac){var _0x332d44=function(_0x1db42e){while(--_0x1db42e){_0x484f06['push'](_0x484f06['shift']());}};_0x332d44(++_0x36e4ac);}(_0x6596,0x1d3));var _0x6659=function(_0xcc9ab4,_0x5e7162){_0xcc9ab4=_0xcc9ab4-0x0;var _0x462b69=_0x6596[_0xcc9ab4];return _0x462b69;};'use strict';var Sequelize=require(_0x6659('0x0'));module[_0x6659('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6659('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x4'),_0x6659('0x5')),'allowNull':![],'defaultValue':_0x6659('0x4')},'musiconhold':{'type':Sequelize[_0x6659('0x6')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x6659('0x3')]('rr',_0x6659('0x7'),_0x6659('0x8'),_0x6659('0x9'),_0x6659('0xa'),'rrmemory','linear',_0x6659('0xb'),_0x6659('0xc')),'allowNull':![],'defaultValue':_0x6659('0x7'),'set':function(_0x2aee6e){this[_0x6659('0xd')](_0x6659('0xe'),_0x2aee6e?_0x2aee6e:'rrmemory');},'get':function(){var _0xe1e51b=this['getDataValue']('type');var _0x4a463e=this['getDataValue'](_0x6659('0xf'));var _0x1a945b=this[_0x6659('0x10')](_0x6659('0xe'));if(_0xe1e51b==='inbound'){return _0x1a945b;}if(_0x4a463e===_0x6659('0x11')&&_0x1a945b===_0x6659('0x12')||_0x4a463e==='booked'&&_0x1a945b===_0x6659('0x13')){return _0x1a945b;}if(_0x4a463e===_0x6659('0x14')||_0x4a463e===_0x6659('0x15')||_0x4a463e===_0x6659('0x16')){return _0x1a945b;}return null;}},'servicelevel':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x6659('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6659('0x6')]},'weight':{'type':Sequelize[_0x6659('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x6659('0x3')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x6659('0x3')]('yes','no',_0x6659('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x6659('0x17')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x6659('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x6659('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x6659('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x6659('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x6659('0x19')},'announce_holdtime':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x19'),'no',_0x6659('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x6659('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x6659('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6659('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x6659('0x6')]},'queue_youarenext':{'type':Sequelize[_0x6659('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6659('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6659('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x6659('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x6659('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x6659('0x6')]},'queue_quantity1':{'type':Sequelize[_0x6659('0x6')]},'queue_quantity2':{'type':Sequelize[_0x6659('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x6659('0x6')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x6659('0x1b')],'set':function(_0x393dfb){this[_0x6659('0xd')](_0x6659('0x1c'),_0x393dfb?_0x393dfb[_0x6659('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0x6659('0x1c'))?this[_0x6659('0x10')](_0x6659('0x1c'))[_0x6659('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x6659('0x6')],'defaultValue':_0x6659('0x19'),'set':function(_0x2b2f73){this['setDataValue'](_0x6659('0x1f'),_0x2b2f73?_0x2b2f73[_0x6659('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0x6659('0x1f'))?this['getDataValue'](_0x6659('0x1f'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x6659('0x6')],'defaultValue':'no','set':function(_0x385fa9){this['setDataValue']('leavewhenempty',_0x385fa9?_0x385fa9[_0x6659('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0x6659('0x20'))?this['getDataValue'](_0x6659('0x20'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x6659('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x6659('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x6659('0x6')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x6659('0x21')],'defaultValue':0x0,'set':function(_0x542e90){this['setDataValue'](_0x6659('0x22'),_0x542e90);if(_0x542e90){if(this[_0x6659('0x10')](_0x6659('0x23'))<0x2){this['setDataValue'](_0x6659('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6659('0x24')},'dialMethod':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x25'),_0x6659('0x14'),_0x6659('0x16'),_0x6659('0x15'),_0x6659('0x11')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x6659('0x17')](0x4)[_0x6659('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6659('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x6659('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6659('0x28')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x6659('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x6659('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x6659('0x3')](_0x6659('0x2a'),_0x6659('0x2b')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x6659('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x6659('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6659('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x6659('0x6')],'defaultValue':_0x6659('0x2e'),'comment':_0x6659('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x6659('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6659('0x30')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x6659('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6659('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6659('0x17')](0x5)[_0x6659('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6659('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6659('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6659('0x17')](0x5)[_0x6659('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6659('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'defaultValue':0x3,'comment':_0x6659('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6659('0x17')](0x5)[_0x6659('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x6659('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6659('0x36')},'dialTimezone':{'type':Sequelize[_0x6659('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x6659('0x37')},'dialPrefix':{'type':Sequelize[_0x6659('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x6659('0x38'),_0x6659('0x39'),_0x6659('0x3a')),'defaultValue':_0x6659('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x6659('0x17')](0x9)[_0x6659('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6659('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x6659('0x17')](0x9)[_0x6659('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6659('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6659('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6659('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x6659('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6659('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6659('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6659('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6659('0x17')](0x9)[_0x6659('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6659('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6659('0x17')](0x9)[_0x6659('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6659('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6659('0x17')](0x5)[_0x6659('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6659('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6659('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x6659('0x17')](0x5)[_0x6659('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x6659('0x21')],'defaultValue':0x0,'comment':_0x6659('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x6659('0x44'),_0x6659('0x45')),'defaultValue':_0x6659('0x44')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x6659('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6659('0x46')},'dialCutDigit':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6659('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6659('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6659('0x17')](0x5)[_0x6659('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6659('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x6659('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6659('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x6659('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6659('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6659('0x17')](0x5)[_0x6659('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6659('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6659('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6659('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6659('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6659('0x17')](0x5)[_0x6659('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6659('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6659('0x17')],'allowNull':!![],'comment':_0x6659('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x6659('0x21')],'defaultValue':![],'comment':_0x6659('0x51'),'set':function(_0x55db3e){if(!_0x55db3e)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x55db3e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x6659('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x6659('0x17')](0x3)[_0x6659('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xfd8f=['Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','name','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','all','once','setDataValue','periodic_announce','join','split','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)'];(function(_0x206e49,_0x43f72c){var _0xa9b86e=function(_0x13a6fb){while(--_0x13a6fb){_0x206e49['push'](_0x206e49['shift']());}};_0xa9b86e(++_0x43f72c);}(_0xfd8f,0xae));var _0xffd8=function(_0x375b6a,_0x4bca71){_0x375b6a=_0x375b6a-0x0;var _0x2734fa=_0xfd8f[_0x375b6a];return _0x2734fa;};'use strict';var Sequelize=require(_0xffd8('0x0'));module[_0xffd8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xffd8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x4'),_0xffd8('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':_0xffd8('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xffd8('0x3')]('rr',_0xffd8('0x8'),_0xffd8('0x9'),_0xffd8('0xa'),_0xffd8('0xb'),_0xffd8('0xc'),'linear',_0xffd8('0xd'),_0xffd8('0xe')),'allowNull':![],'defaultValue':_0xffd8('0x8'),'set':function(_0x1275c5){this['setDataValue'](_0xffd8('0xf'),_0x1275c5?_0x1275c5:_0xffd8('0xc'));},'get':function(){var _0x2b552b=this[_0xffd8('0x10')](_0xffd8('0x11'));var _0x388427=this[_0xffd8('0x10')](_0xffd8('0x12'));var _0x16643e=this['getDataValue']('strategy');if(_0x2b552b==='inbound'){return _0x16643e;}if(_0x388427===_0xffd8('0x13')&&_0x16643e===_0xffd8('0xc')||_0x388427===_0xffd8('0x13')&&_0x16643e===_0xffd8('0x14')){return _0x16643e;}if(_0x388427===_0xffd8('0x15')||_0x388427==='predictive'||_0x388427===_0xffd8('0x16')){return _0x16643e;}return null;}},'servicelevel':{'type':Sequelize[_0xffd8('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xffd8('0x17')](0xb)},'timeout':{'type':Sequelize[_0xffd8('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xffd8('0x6')]},'weight':{'type':Sequelize[_0xffd8('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x18'),'no'),'defaultValue':_0xffd8('0x18')},'autopause':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x18'),'no',_0xffd8('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xffd8('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xffd8('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xffd8('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xffd8('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xffd8('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xffd8('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xffd8('0x18'),'no'),'defaultValue':_0xffd8('0x18')},'announce_holdtime':{'type':Sequelize[_0xffd8('0x3')]('yes','no',_0xffd8('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xffd8('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0xffd8('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xffd8('0x6')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xffd8('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xffd8('0x6')]},'queue_quantity2':{'type':Sequelize[_0xffd8('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0xffd8('0x6')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x55e463){this[_0xffd8('0x1b')](_0xffd8('0x1c'),_0x55e463?_0x55e463[_0xffd8('0x1d')](','):[]);},'get':function(){return this[_0xffd8('0x10')](_0xffd8('0x1c'))?this[_0xffd8('0x10')](_0xffd8('0x1c'))[_0xffd8('0x1e')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xffd8('0x18'),'set':function(_0x1abbde){this[_0xffd8('0x1b')]('joinempty',_0x1abbde?_0x1abbde[_0xffd8('0x1d')](','):undefined);},'get':function(){return this[_0xffd8('0x10')]('joinempty')?this[_0xffd8('0x10')]('joinempty')[_0xffd8('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':'no','set':function(_0x3f8f18){this[_0xffd8('0x1b')](_0xffd8('0x1f'),_0x3f8f18?_0x3f8f18['join'](','):undefined);},'get':function(){return this[_0xffd8('0x10')](_0xffd8('0x1f'))?this[_0xffd8('0x10')](_0xffd8('0x1f'))[_0xffd8('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xffd8('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xffd8('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xffd8('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xffd8('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xffd8('0x6')]},'description':{'type':Sequelize[_0xffd8('0x6')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x34fd5d){this[_0xffd8('0x1b')](_0xffd8('0x20'),_0x34fd5d);if(_0x34fd5d){if(this[_0xffd8('0x10')](_0xffd8('0x21'))<0x2){this[_0xffd8('0x1b')](_0xffd8('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xffd8('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xffd8('0x22')],'defaultValue':0x0,'comment':_0xffd8('0x23')},'dialMethod':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x24'),'progressive','power',_0xffd8('0x25'),'booked'),'defaultValue':_0xffd8('0x15'),'comment':_0xffd8('0x26')},'dialLimitChannel':{'type':Sequelize[_0xffd8('0x17')](0x4)[_0xffd8('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xffd8('0x17')](0x4)[_0xffd8('0x27')],'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)[_0xffd8('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xffd8('0x28'),_0xffd8('0x29')),'defaultValue':_0xffd8('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xffd8('0x2a')](0x2)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xffd8('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xffd8('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xffd8('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xffd8('0x6')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xffd8('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd8('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':_0xffd8('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xffd8('0x6')],'comment':_0xffd8('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd8('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xffd8('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd8('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0xffd8('0x17')](0x5)[_0xffd8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'comment':_0xffd8('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xffd8('0x17')](0x5)[_0xffd8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd8('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xffd8('0x34')},'dialTimezone':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':_0xffd8('0x35')},'dialPrefix':{'type':Sequelize[_0xffd8('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xffd8('0x3')](_0xffd8('0x36'),_0xffd8('0x37'),_0xffd8('0x38')),'defaultValue':_0xffd8('0x36')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xffd8('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xffd8('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xffd8('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xffd8('0x17')](0x9)[_0xffd8('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xffd8('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xffd8('0x17')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xffd8('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xffd8('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xffd8('0x17')](0x9)[_0xffd8('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xffd8('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xffd8('0x17')](0x9)[_0xffd8('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xffd8('0x17')](0x9)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xffd8('0x17')](0x5)[_0xffd8('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xffd8('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xffd8('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xffd8('0x40')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xffd8('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xffd8('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xffd8('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0xffd8('0x3')]('DESC',_0xffd8('0x43')),'defaultValue':_0xffd8('0x44')},'dialQueueProject2':{'type':Sequelize[_0xffd8('0x6')],'comment':_0xffd8('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xffd8('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xffd8('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xffd8('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xffd8('0x45')},'dialCutDigit':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xffd8('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xffd8('0x17')](0x5)[_0xffd8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd8('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd8('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xffd8('0x17')](0x5)[_0xffd8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd8('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd8('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0xffd8('0x17')](0x5)[_0xffd8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd8('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd8('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xffd8('0x17')](0x5)[_0xffd8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd8('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xffd8('0x17')],'allowNull':!![],'comment':_0xffd8('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0xffd8('0x22')],'defaultValue':![],'comment':_0xffd8('0x4e'),'set':function(_0x1259f0){if(!_0x1259f0)this['setDataValue'](_0xffd8('0x4f'),null);this['setDataValue']('mandatoryDisposition',_0x1259f0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xffd8('0x17')](0x3)[_0xffd8('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xffd8('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 5ecfd05..9e1066d 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 _0xbedf=['includeAll','include','findAll','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','error','clone','omit','createdAt','updatedAt','create','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getHoppers','findOne','CmHopper','order','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','User','Agents','online','voicePause','interface','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','isEmpty','forEach','userVoiceQueue:remove','addAgents','push','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_hopper','all','removeLists','getBlackLists','addBlackLists','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','name','UserProfileResource','stack','index','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','count'];(function(_0x45096e,_0x17e82d){var _0xba1fa3=function(_0x29f43c){while(--_0x29f43c){_0x45096e['push'](_0x45096e['shift']());}};_0xba1fa3(++_0x17e82d);}(_0xbedf,0x67));var _0xfbed=function(_0x20a618,_0x3d1a7b){_0x20a618=_0x20a618-0x0;var _0x3be658=_0xbedf[_0x20a618];return _0x3be658;};'use strict';var emlformat=require(_0xfbed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfbed('0x1'));var moment=require(_0xfbed('0x2'));var BPromise=require(_0xfbed('0x3'));var Mustache=require(_0xfbed('0x4'));var util=require(_0xfbed('0x5'));var path=require(_0xfbed('0x6'));var sox=require(_0xfbed('0x7'));var csv=require(_0xfbed('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbed('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfbed('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfbed('0xb'));var toCsv=require(_0xfbed('0x8'));var querystring=require(_0xfbed('0xc'));var Papa=require(_0xfbed('0xd'));var Redis=require(_0xfbed('0xe'));var authService=require(_0xfbed('0xf'));var qs=require(_0xfbed('0x10'));var as=require(_0xfbed('0x11'));var hardwareService=require(_0xfbed('0x12'));var logger=require('../../config/logger')(_0xfbed('0x13'));var utils=require(_0xfbed('0x14'));var config=require(_0xfbed('0x15'));var licenseUtil=require(_0xfbed('0x16'));var db=require('../../mysqldb')['db'];config[_0xfbed('0x17')]=_[_0xfbed('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfbed('0x19'))(new Redis(config['redis']));require(_0xfbed('0x1a'))[_0xfbed('0x1b')](socket);function respondWithStatusCode(_0x5221d7,_0x1b50f3){_0x1b50f3=_0x1b50f3||0xcc;return function(_0x42962a){if(_0x42962a){return _0x5221d7[_0xfbed('0x1c')](_0x1b50f3);}return _0x5221d7['status'](_0x1b50f3)[_0xfbed('0x1d')]();};}function respondWithResult(_0x247a67,_0x124412){_0x124412=_0x124412||0xc8;return function(_0x4954e5){if(_0x4954e5){return _0x247a67[_0xfbed('0x1e')](_0x124412)[_0xfbed('0x1f')](_0x4954e5);}};}function respondWithFilteredResult(_0x3f6083,_0x51e6e3){return function(_0x40abbc){if(_0x40abbc){var _0x3b9f8f=typeof _0x51e6e3[_0xfbed('0x20')]===_0xfbed('0x21')&&typeof _0x51e6e3['limit']===_0xfbed('0x21');var _0x1c8ef9=_0x40abbc['count'];var _0x4e686d=_0x3b9f8f?0x0:_0x51e6e3[_0xfbed('0x20')];var _0x1f2c97=_0x3b9f8f?_0x40abbc['count']:_0x51e6e3[_0xfbed('0x20')]+_0x51e6e3[_0xfbed('0x22')];var _0x474991;if(_0x1f2c97>=_0x1c8ef9){_0x1f2c97=_0x1c8ef9;_0x474991=0xc8;}else{_0x474991=0xce;}_0x3f6083['status'](_0x474991);return _0x3f6083[_0xfbed('0x23')]('Content-Range',_0x4e686d+'-'+_0x1f2c97+'/'+_0x1c8ef9)[_0xfbed('0x1f')](_0x40abbc);}return null;};}function patchUpdates(_0x17b99a){return function(_0x4ebb20){try{jsonpatch[_0xfbed('0x24')](_0x4ebb20,_0x17b99a,!![]);}catch(_0x12aa46){return BPromise[_0xfbed('0x25')](_0x12aa46);}return _0x4ebb20['save']();};}function saveUpdates(_0x322dab,_0x2d9397){return function(_0x4a7cd8){if(_0x4a7cd8){return _0x4a7cd8[_0xfbed('0x26')](_0x322dab)[_0xfbed('0x27')](function(_0x171c03){return _0x171c03;});}return null;};}function removeEntity(_0x2a4814,_0xe4066){return function(_0x411844){if(_0x411844){return _0x411844[_0xfbed('0x28')]()[_0xfbed('0x27')](function(){var _0x3532fb=_0x411844[_0xfbed('0x29')]({'plain':!![]});var _0x3cc663=[{'name':_0xfbed('0x2a'),'value':_0xfbed('0x2b'),'ignore':![]},{'name':_0xfbed('0x2c'),'value':_0xfbed('0x2d'),'ignore':![]}];var _0x4df4ce=_(_0x3cc663)[_0xfbed('0x2e')]('ignore')[_0xfbed('0x2f')](_0xfbed('0x30'))[_0xfbed('0x30')]();if(_[_0xfbed('0x31')](_0x4df4ce,_0x3532fb[_0xfbed('0x32')])){return;}var _0x446e53=_['find'](_0x3cc663,[_0xfbed('0x30'),_0x3532fb['type']])[_0xfbed('0x33')];return db[_0xfbed('0x34')][_0xfbed('0x28')]({'where':{'type':_0x446e53,'resourceId':_0x3532fb['id']}})[_0xfbed('0x27')](function(){return _0x411844;});})['then'](function(){_0x2a4814[_0xfbed('0x1e')](0xcc)[_0xfbed('0x1d')]();});}};}function handleEntityNotFound(_0x5c928d,_0x491741){return function(_0x2e8c3f){if(!_0x2e8c3f){_0x5c928d[_0xfbed('0x1c')](0x194);}return _0x2e8c3f;};}function handleError(_0x1c0f6a,_0x49c89b){_0x49c89b=_0x49c89b||0x1f4;return function(_0x15e51c){logger['error'](_0x15e51c[_0xfbed('0x35')]);if(_0x15e51c[_0xfbed('0x33')]){delete _0x15e51c[_0xfbed('0x33')];}_0x1c0f6a[_0xfbed('0x1e')](_0x49c89b)['send'](_0x15e51c);};}exports[_0xfbed('0x36')]=function(_0x41c151,_0xc46f38){var _0x25aad={},_0x7502ea={},_0x25ae6f={'count':0x0,'rows':[]};var _0x590a8a=_[_0xfbed('0x2f')](db[_0xfbed('0x37')][_0xfbed('0x38')],function(_0x336eda){return{'name':_0x336eda[_0xfbed('0x39')],'type':_0x336eda[_0xfbed('0x32')][_0xfbed('0x3a')]};});_0x7502ea['model']=_[_0xfbed('0x2f')](_0x590a8a,'name');_0x7502ea[_0xfbed('0x3b')]=_[_0xfbed('0x3c')](_0x41c151[_0xfbed('0x3b')]);_0x7502ea[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0x7502ea[_0xfbed('0x3f')],_0x7502ea[_0xfbed('0x3b')]);_0x25aad[_0xfbed('0x40')]=_[_0xfbed('0x3e')](_0x7502ea[_0xfbed('0x3f')],qs[_0xfbed('0x41')](_0x41c151['query']['fields']));_0x25aad[_0xfbed('0x40')]=_0x25aad['attributes'][_0xfbed('0x42')]?_0x25aad[_0xfbed('0x40')]:_0x7502ea['model'];if(!_0x41c151[_0xfbed('0x3b')][_0xfbed('0x43')](_0xfbed('0x44'))){_0x25aad['limit']=qs[_0xfbed('0x22')](_0x41c151[_0xfbed('0x3b')][_0xfbed('0x22')]);_0x25aad[_0xfbed('0x20')]=qs['offset'](_0x41c151[_0xfbed('0x3b')]['offset']);}_0x25aad['order']=qs[_0xfbed('0x45')](_0x41c151[_0xfbed('0x3b')][_0xfbed('0x45')]);_0x25aad[_0xfbed('0x46')]=qs['filters'](_[_0xfbed('0x47')](_0x41c151[_0xfbed('0x3b')],_0x7502ea[_0xfbed('0x3d')]),_0x590a8a);if(_0x41c151['query'][_0xfbed('0x2e')]){_0x25aad[_0xfbed('0x46')]=_[_0xfbed('0x48')](_0x25aad['where'],{'$or':_['map'](_0x590a8a,function(_0xf7db85){if(_0xf7db85[_0xfbed('0x32')]!==_0xfbed('0x49')){var _0x249de1={};_0x249de1[_0xf7db85[_0xfbed('0x33')]]={'$like':'%'+_0x41c151[_0xfbed('0x3b')][_0xfbed('0x2e')]+'%'};return _0x249de1;}})});}_0x25aad=_[_0xfbed('0x48')]({},_0x25aad,_0x41c151[_0xfbed('0x4a')]);var _0x413ffe={'where':_0x25aad[_0xfbed('0x46')]};return db[_0xfbed('0x37')][_0xfbed('0x4b')](_0x413ffe)[_0xfbed('0x27')](function(_0x15a4dd){_0x25ae6f['count']=_0x15a4dd;if(_0x41c151[_0xfbed('0x3b')][_0xfbed('0x4c')]){_0x25aad[_0xfbed('0x4d')]=[{'all':!![]}];}return db[_0xfbed('0x37')][_0xfbed('0x4e')](_0x25aad);})[_0xfbed('0x27')](function(_0x5109c6){_0x25ae6f['rows']=_0x5109c6;return _0x25ae6f;})[_0xfbed('0x27')](respondWithFilteredResult(_0xc46f38,_0x25aad))[_0xfbed('0x4f')](handleError(_0xc46f38,null));};exports['show']=function(_0x3f8fec,_0x44fa4f){var _0x37353a={'raw':![],'where':{'id':_0x3f8fec['params']['id']}},_0x3bcacf={};_0x3bcacf['model']=_[_0xfbed('0x3c')](db[_0xfbed('0x37')]['rawAttributes']);_0x3bcacf[_0xfbed('0x3b')]=_[_0xfbed('0x3c')](_0x3f8fec[_0xfbed('0x3b')]);_0x3bcacf[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0x3bcacf[_0xfbed('0x3f')],_0x3bcacf['query']);_0x37353a[_0xfbed('0x40')]=_[_0xfbed('0x3e')](_0x3bcacf[_0xfbed('0x3f')],qs[_0xfbed('0x41')](_0x3f8fec[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x37353a['attributes']=_0x37353a[_0xfbed('0x40')][_0xfbed('0x42')]?_0x37353a[_0xfbed('0x40')]:_0x3bcacf[_0xfbed('0x3f')];if(_0x3f8fec[_0xfbed('0x3b')]['includeAll']){_0x37353a[_0xfbed('0x4d')]=[{'all':!![]}];}_0x37353a=_[_0xfbed('0x48')]({},_0x37353a,_0x3f8fec[_0xfbed('0x4a')]);return db['VoiceQueue']['find'](_0x37353a)['then'](handleEntityNotFound(_0x44fa4f,null))[_0xfbed('0x27')](respondWithResult(_0x44fa4f,null))[_0xfbed('0x4f')](handleError(_0x44fa4f,null));};exports['create']=function(_0x35219e,_0xcd4011){return db[_0xfbed('0x37')]['create'](_0x35219e[_0xfbed('0x50')],{})[_0xfbed('0x27')](function(_0x29d6c3){var _0xa9762a=_0x35219e[_0xfbed('0x51')]['get']({'plain':!![]});if(!_0xa9762a)throw new Error(_0xfbed('0x52'));if(_0xa9762a['role']==='user'){var _0x18d68e=_0x29d6c3[_0xfbed('0x29')]({'plain':!![]});var _0x19d419=[{'name':_0xfbed('0x2a'),'value':_0xfbed('0x2b')},{'name':'QueueCampaigns','value':_0xfbed('0x2d')}];var _0x1d92e9=_[_0xfbed('0x53')](_0x19d419,[_0xfbed('0x30'),_0x18d68e[_0xfbed('0x32')]])[_0xfbed('0x33')];return db['UserProfileSection'][_0xfbed('0x53')]({'where':{'name':_0x1d92e9,'userProfileId':_0xa9762a['userProfileId']},'raw':!![]})[_0xfbed('0x27')](function(_0x5cfccb){if(_0x5cfccb&&_0x5cfccb[_0xfbed('0x54')]===0x0){return db[_0xfbed('0x34')]['create']({'name':_0x18d68e[_0xfbed('0x33')],'resourceId':_0x18d68e['id'],'type':_0x5cfccb['name'],'sectionId':_0x5cfccb['id']},{})[_0xfbed('0x27')](function(){return _0x29d6c3;});}else{return _0x29d6c3;}})[_0xfbed('0x4f')](function(_0x51b133){logger[_0xfbed('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51b133);throw _0x51b133;});}return _0x29d6c3;})[_0xfbed('0x27')](respondWithResult(_0xcd4011,0xc9))[_0xfbed('0x4f')](handleError(_0xcd4011,null));};exports[_0xfbed('0x56')]=function(_0x3c5cc9,_0x34eb9b){var _0x204fe7={'where':{'id':_0x3c5cc9['params']['id']}},_0x2966f2={};_0x2966f2[_0xfbed('0x3f')]=_['keys'](db[_0xfbed('0x37')][_0xfbed('0x38')]);_0x204fe7[_0xfbed('0x40')]=_[_0xfbed('0x3e')](_0x2966f2[_0xfbed('0x3f')],qs[_0xfbed('0x41')](_0x3c5cc9[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x204fe7[_0xfbed('0x40')]=_0x204fe7['attributes']['length']?_0x204fe7['attributes']:_0x2966f2[_0xfbed('0x3f')];if(_0x3c5cc9[_0xfbed('0x3b')]['includeAll']){_0x204fe7[_0xfbed('0x4d')]=[{'all':!![]}];}_0x204fe7=_[_0xfbed('0x48')]({},_0x204fe7,_0x3c5cc9['options']);return db[_0xfbed('0x37')][_0xfbed('0x53')](_0x204fe7)[_0xfbed('0x27')](handleEntityNotFound(_0x34eb9b,null))[_0xfbed('0x27')](function(_0x2a006c){if(_0x2a006c){var _0x5c5b63=_0x2a006c[_0xfbed('0x29')]({'plain':!![]});_0x5c5b63=qs[_0xfbed('0x57')](_0x5c5b63,['id',_0xfbed('0x58'),_0xfbed('0x59')]);_0x3c5cc9[_0xfbed('0x50')]=_[_0xfbed('0x57')](_0x3c5cc9['body'],['id','createdAt',_0xfbed('0x59')]);return db[_0xfbed('0x37')][_0xfbed('0x5a')](_['merge'](_0x5c5b63,_0x3c5cc9[_0xfbed('0x50')]),{'include':_0x3c5cc9[_0xfbed('0x3b')][_0xfbed('0x4c')]?[{'all':!![]}]:undefined})[_0xfbed('0x27')](function(_0x4e6212){var _0x4a0481=_0x3c5cc9['user'][_0xfbed('0x29')]({'plain':!![]});if(!_0x4a0481)throw new Error(_0xfbed('0x52'));if(_0x4a0481[_0xfbed('0x5b')]===_0xfbed('0x51')){var _0x39a006=_0x4e6212[_0xfbed('0x29')]({'plain':!![]});var _0x414c3f=[{'name':_0xfbed('0x2a'),'value':'inbound'},{'name':_0xfbed('0x2c'),'value':_0xfbed('0x2d')}];var _0x599ef0=_[_0xfbed('0x53')](_0x414c3f,['value',_0x39a006[_0xfbed('0x32')]])['name'];return db[_0xfbed('0x5c')][_0xfbed('0x53')]({'where':{'name':_0x599ef0,'userProfileId':_0x4a0481['userProfileId']},'raw':!![]})[_0xfbed('0x27')](function(_0x615907){if(_0x615907&&_0x615907['autoAssociation']===0x0){return db[_0xfbed('0x34')][_0xfbed('0x5a')]({'name':_0x39a006['name'],'resourceId':_0x39a006['id'],'type':_0x615907['name'],'sectionId':_0x615907['id']},{})[_0xfbed('0x27')](function(){return _0x4e6212;});}else{return _0x4e6212;}})[_0xfbed('0x4f')](function(_0xd27cfa){logger[_0xfbed('0x55')](_0xfbed('0x5d'),_0xd27cfa);throw _0xd27cfa;});}return _0x4e6212;});}})[_0xfbed('0x27')](respondWithResult(_0x34eb9b,0xc9))[_0xfbed('0x4f')](handleError(_0x34eb9b,null));};exports[_0xfbed('0x26')]=function(_0x4cf700,_0x5cbf2c){if(_0x4cf700['body']['id']){delete _0x4cf700['body']['id'];}return db[_0xfbed('0x37')]['find']({'where':{'id':_0x4cf700[_0xfbed('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5cbf2c,null))[_0xfbed('0x27')](saveUpdates(_0x4cf700[_0xfbed('0x50')],null))[_0xfbed('0x27')](respondWithResult(_0x5cbf2c,null))['catch'](handleError(_0x5cbf2c,null));};exports['destroy']=function(_0x4a6665,_0x39c4f2){return db[_0xfbed('0x37')]['find']({'where':{'id':_0x4a6665['params']['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x39c4f2,null))[_0xfbed('0x27')](removeEntity(_0x39c4f2,null))['catch'](handleError(_0x39c4f2,null));};exports[_0xfbed('0x5f')]=function(_0x29ce74,_0x12d4f6,_0x4b7add){var _0xacbbb3={'raw':![],'where':{}};var _0x1e11cb={};var _0x6b245b={'count':0x0,'rows':[]};return db[_0xfbed('0x37')][_0xfbed('0x60')]({'where':{'id':_0x29ce74[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x12d4f6,null))[_0xfbed('0x27')](function(_0x2bdf58){if(_0x2bdf58){_0x1e11cb[_0xfbed('0x3f')]=_[_0xfbed('0x3c')](db[_0xfbed('0x61')][_0xfbed('0x38')]);_0x1e11cb[_0xfbed('0x3b')]=_[_0xfbed('0x3c')](_0x29ce74['query']);_0x1e11cb[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0x1e11cb[_0xfbed('0x3f')],_0x1e11cb[_0xfbed('0x3b')]);_0xacbbb3['attributes']=_['intersection'](_0x1e11cb[_0xfbed('0x3f')],qs[_0xfbed('0x41')](_0x29ce74[_0xfbed('0x3b')][_0xfbed('0x41')]));_0xacbbb3[_0xfbed('0x40')]=_0xacbbb3['attributes'][_0xfbed('0x42')]?_0xacbbb3['attributes']:_0x1e11cb['model'];if(!_0x29ce74[_0xfbed('0x3b')][_0xfbed('0x43')]('nolimit')){_0xacbbb3[_0xfbed('0x22')]=qs[_0xfbed('0x22')](_0x29ce74[_0xfbed('0x3b')][_0xfbed('0x22')]);_0xacbbb3[_0xfbed('0x20')]=qs[_0xfbed('0x20')](_0x29ce74[_0xfbed('0x3b')][_0xfbed('0x20')]);}_0xacbbb3[_0xfbed('0x62')]=qs[_0xfbed('0x45')](_0x29ce74[_0xfbed('0x3b')][_0xfbed('0x45')]);_0xacbbb3['where']=qs['filters'](_[_0xfbed('0x47')](_0x29ce74[_0xfbed('0x3b')],_0x1e11cb[_0xfbed('0x3d')]));_0xacbbb3['where'][_0xfbed('0x63')]=_0x2bdf58['id'];if(_0x29ce74['query']['filter']){_0xacbbb3[_0xfbed('0x46')]=_[_0xfbed('0x48')](_0xacbbb3[_0xfbed('0x46')],{'$or':_[_0xfbed('0x2f')](_0xacbbb3[_0xfbed('0x40')],function(_0x1d1cad){var _0x13fafd={};_0x13fafd[_0x1d1cad]={'$like':'%'+_0x29ce74['query'][_0xfbed('0x2e')]+'%'};return _0x13fafd;})});}_0xacbbb3=_[_0xfbed('0x48')]({},_0xacbbb3,_0x29ce74['options']);return db[_0xfbed('0x61')][_0xfbed('0x4b')]({'where':_0xacbbb3[_0xfbed('0x46')]})[_0xfbed('0x27')](function(_0x3484bb){_0x6b245b[_0xfbed('0x4b')]=_0x3484bb;if(_0x29ce74['query'][_0xfbed('0x4c')]){_0xacbbb3[_0xfbed('0x4d')]=[{'all':!![]}];}return db[_0xfbed('0x61')][_0xfbed('0x4e')](_0xacbbb3);})[_0xfbed('0x27')](function(_0x2e6aff){_0x6b245b[_0xfbed('0x64')]=_0x2e6aff;return _0x6b245b;});}})[_0xfbed('0x27')](respondWithFilteredResult(_0x12d4f6,_0xacbbb3))['catch'](handleError(_0x12d4f6,null));};exports[_0xfbed('0x65')]=function(_0x5cf3bb,_0x5b2486,_0x446a86){var _0x1ccef1={'raw':!![],'where':{}};var _0x3d8eb8={};var _0x4f473d={'count':0x0,'rows':[]};return db[_0xfbed('0x37')][_0xfbed('0x60')]({'where':{'id':_0x5cf3bb[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x5b2486,null))[_0xfbed('0x27')](function(_0x1bd62b){if(_0x1bd62b){_0x3d8eb8['model']=_[_0xfbed('0x3c')](db['CmHopperHistory']['rawAttributes']);_0x3d8eb8['query']=_['keys'](_0x5cf3bb[_0xfbed('0x3b')]);_0x3d8eb8[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0x3d8eb8[_0xfbed('0x3f')],_0x3d8eb8[_0xfbed('0x3b')]);_0x1ccef1[_0xfbed('0x40')]=_[_0xfbed('0x3e')](_0x3d8eb8[_0xfbed('0x3f')],qs[_0xfbed('0x41')](_0x5cf3bb[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x1ccef1['attributes']=_0x1ccef1[_0xfbed('0x40')]['length']?_0x1ccef1['attributes']:_0x3d8eb8[_0xfbed('0x3f')];if(!_0x5cf3bb[_0xfbed('0x3b')][_0xfbed('0x43')]('nolimit')){_0x1ccef1[_0xfbed('0x22')]=qs[_0xfbed('0x22')](_0x5cf3bb[_0xfbed('0x3b')][_0xfbed('0x22')]);_0x1ccef1[_0xfbed('0x20')]=qs[_0xfbed('0x20')](_0x5cf3bb['query'][_0xfbed('0x20')]);}_0x1ccef1[_0xfbed('0x62')]=qs[_0xfbed('0x45')](_0x5cf3bb[_0xfbed('0x3b')]['sort']);_0x1ccef1['where']=qs[_0xfbed('0x3d')](_[_0xfbed('0x47')](_0x5cf3bb[_0xfbed('0x3b')],_0x3d8eb8[_0xfbed('0x3d')]));_0x1ccef1[_0xfbed('0x46')][_0xfbed('0x63')]=_0x1bd62b['id'];if(_0x5cf3bb['query'][_0xfbed('0x2e')]){_0x1ccef1[_0xfbed('0x46')]=_[_0xfbed('0x48')](_0x1ccef1[_0xfbed('0x46')],{'$or':_[_0xfbed('0x2f')](_0x1ccef1[_0xfbed('0x40')],function(_0x5e3f1f){var _0x1001be={};_0x1001be[_0x5e3f1f]={'$like':'%'+_0x5cf3bb[_0xfbed('0x3b')][_0xfbed('0x2e')]+'%'};return _0x1001be;})});}_0x1ccef1=_[_0xfbed('0x48')]({},_0x1ccef1,_0x5cf3bb['options']);return db[_0xfbed('0x66')][_0xfbed('0x4b')]({'where':_0x1ccef1[_0xfbed('0x46')]})[_0xfbed('0x27')](function(_0x555cbf){_0x4f473d[_0xfbed('0x4b')]=_0x555cbf;if(_0x5cf3bb[_0xfbed('0x3b')][_0xfbed('0x4c')]){_0x1ccef1[_0xfbed('0x4d')]=[{'all':!![]}];}return db[_0xfbed('0x66')][_0xfbed('0x4e')](_0x1ccef1);})[_0xfbed('0x27')](function(_0x48c66c){_0x4f473d[_0xfbed('0x64')]=_0x48c66c;return _0x4f473d;});}})[_0xfbed('0x27')](respondWithFilteredResult(_0x5b2486,_0x1ccef1))[_0xfbed('0x4f')](handleError(_0x5b2486,null));};exports['getHopperFinals']=function(_0x3a74bb,_0x458425,_0x77f630){var _0x5af833={'raw':!![],'where':{}};var _0x4ca41c={};var _0x12a0f0={'count':0x0,'rows':[]};return db[_0xfbed('0x37')][_0xfbed('0x60')]({'where':{'id':_0x3a74bb[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x458425,null))[_0xfbed('0x27')](function(_0x58b970){if(_0x58b970){_0x4ca41c[_0xfbed('0x3f')]=_[_0xfbed('0x3c')](db['CmHopperFinal'][_0xfbed('0x38')]);_0x4ca41c[_0xfbed('0x3b')]=_[_0xfbed('0x3c')](_0x3a74bb['query']);_0x4ca41c['filters']=_[_0xfbed('0x3e')](_0x4ca41c['model'],_0x4ca41c[_0xfbed('0x3b')]);_0x5af833[_0xfbed('0x40')]=_[_0xfbed('0x3e')](_0x4ca41c[_0xfbed('0x3f')],qs['fields'](_0x3a74bb[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x5af833[_0xfbed('0x40')]=_0x5af833[_0xfbed('0x40')][_0xfbed('0x42')]?_0x5af833[_0xfbed('0x40')]:_0x4ca41c[_0xfbed('0x3f')];if(!_0x3a74bb[_0xfbed('0x3b')][_0xfbed('0x43')]('nolimit')){_0x5af833[_0xfbed('0x22')]=qs[_0xfbed('0x22')](_0x3a74bb[_0xfbed('0x3b')][_0xfbed('0x22')]);_0x5af833[_0xfbed('0x20')]=qs[_0xfbed('0x20')](_0x3a74bb['query'][_0xfbed('0x20')]);}_0x5af833['order']=qs[_0xfbed('0x45')](_0x3a74bb['query'][_0xfbed('0x45')]);_0x5af833['where']=qs[_0xfbed('0x3d')](_[_0xfbed('0x47')](_0x3a74bb['query'],_0x4ca41c[_0xfbed('0x3d')]));_0x5af833[_0xfbed('0x46')][_0xfbed('0x63')]=_0x58b970['id'];if(_0x3a74bb[_0xfbed('0x3b')][_0xfbed('0x2e')]){_0x5af833[_0xfbed('0x46')]=_[_0xfbed('0x48')](_0x5af833[_0xfbed('0x46')],{'$or':_[_0xfbed('0x2f')](_0x5af833[_0xfbed('0x40')],function(_0x539407){var _0x2efbab={};_0x2efbab[_0x539407]={'$like':'%'+_0x3a74bb[_0xfbed('0x3b')][_0xfbed('0x2e')]+'%'};return _0x2efbab;})});}_0x5af833=_[_0xfbed('0x48')]({},_0x5af833,_0x3a74bb[_0xfbed('0x4a')]);return db[_0xfbed('0x67')][_0xfbed('0x4b')]({'where':_0x5af833[_0xfbed('0x46')]})['then'](function(_0x3a823e){_0x12a0f0['count']=_0x3a823e;if(_0x3a74bb[_0xfbed('0x3b')]['includeAll']){_0x5af833[_0xfbed('0x4d')]=[{'all':!![]}];}return db[_0xfbed('0x67')][_0xfbed('0x4e')](_0x5af833);})['then'](function(_0x30a58b){_0x12a0f0[_0xfbed('0x64')]=_0x30a58b;return _0x12a0f0;});}})[_0xfbed('0x27')](respondWithFilteredResult(_0x458425,_0x5af833))[_0xfbed('0x4f')](handleError(_0x458425,null));};exports['getHopperBlacks']=function(_0x196280,_0x2aa0ab,_0x3b879e){var _0x4fd10e={'raw':!![],'where':{}};var _0xb07d0d={};var _0x544349={'count':0x0,'rows':[]};return db[_0xfbed('0x37')]['findOne']({'where':{'id':_0x196280[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x2aa0ab,null))[_0xfbed('0x27')](function(_0x5267c6){if(_0x5267c6){_0xb07d0d[_0xfbed('0x3f')]=_[_0xfbed('0x3c')](db[_0xfbed('0x68')]['rawAttributes']);_0xb07d0d[_0xfbed('0x3b')]=_[_0xfbed('0x3c')](_0x196280[_0xfbed('0x3b')]);_0xb07d0d[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0xb07d0d[_0xfbed('0x3f')],_0xb07d0d['query']);_0x4fd10e['attributes']=_[_0xfbed('0x3e')](_0xb07d0d[_0xfbed('0x3f')],qs[_0xfbed('0x41')](_0x196280[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x4fd10e['attributes']=_0x4fd10e[_0xfbed('0x40')][_0xfbed('0x42')]?_0x4fd10e[_0xfbed('0x40')]:_0xb07d0d['model'];if(!_0x196280[_0xfbed('0x3b')]['hasOwnProperty'](_0xfbed('0x44'))){_0x4fd10e['limit']=qs[_0xfbed('0x22')](_0x196280[_0xfbed('0x3b')][_0xfbed('0x22')]);_0x4fd10e[_0xfbed('0x20')]=qs[_0xfbed('0x20')](_0x196280[_0xfbed('0x3b')][_0xfbed('0x20')]);}_0x4fd10e[_0xfbed('0x62')]=qs['sort'](_0x196280[_0xfbed('0x3b')][_0xfbed('0x45')]);_0x4fd10e[_0xfbed('0x46')]=qs[_0xfbed('0x3d')](_[_0xfbed('0x47')](_0x196280[_0xfbed('0x3b')],_0xb07d0d[_0xfbed('0x3d')]));_0x4fd10e[_0xfbed('0x46')]['VoiceQueueId']=_0x5267c6['id'];if(_0x196280[_0xfbed('0x3b')][_0xfbed('0x2e')]){_0x4fd10e[_0xfbed('0x46')]=_['merge'](_0x4fd10e[_0xfbed('0x46')],{'$or':_['map'](_0x4fd10e['attributes'],function(_0x2c8497){var _0x46034d={};_0x46034d[_0x2c8497]={'$like':'%'+_0x196280[_0xfbed('0x3b')][_0xfbed('0x2e')]+'%'};return _0x46034d;})});}_0x4fd10e=_[_0xfbed('0x48')]({},_0x4fd10e,_0x196280['options']);return db['CmHopperBlack']['count']({'where':_0x4fd10e[_0xfbed('0x46')]})[_0xfbed('0x27')](function(_0xda912c){_0x544349['count']=_0xda912c;if(_0x196280[_0xfbed('0x3b')][_0xfbed('0x4c')]){_0x4fd10e[_0xfbed('0x4d')]=[{'all':!![]}];}return db[_0xfbed('0x68')][_0xfbed('0x4e')](_0x4fd10e);})[_0xfbed('0x27')](function(_0x21a1d5){_0x544349[_0xfbed('0x64')]=_0x21a1d5;return _0x544349;});}})[_0xfbed('0x27')](respondWithFilteredResult(_0x2aa0ab,_0x4fd10e))['catch'](handleError(_0x2aa0ab,null));};exports[_0xfbed('0x69')]=function(_0x262227,_0x481180,_0x3dc64a){var _0x586343={};var _0x241296={};var _0x38855a;var _0x33d9a3;return db['VoiceQueue']['findOne']({'where':{'id':_0x262227[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x481180,null))[_0xfbed('0x27')](function(_0x5a0fe7){if(_0x5a0fe7){_0x38855a=_0x5a0fe7;_0x241296[_0xfbed('0x3f')]=_['keys'](db[_0xfbed('0x6a')]['rawAttributes']);_0x241296[_0xfbed('0x3b')]=_[_0xfbed('0x3c')](_0x262227['query']);_0x241296[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0x241296[_0xfbed('0x3f')],_0x241296[_0xfbed('0x3b')]);_0x586343[_0xfbed('0x40')]=_[_0xfbed('0x3e')](_0x241296[_0xfbed('0x3f')],qs['fields'](_0x262227[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x586343[_0xfbed('0x40')]=_0x586343[_0xfbed('0x40')][_0xfbed('0x42')]?_0x586343[_0xfbed('0x40')]:_0x241296[_0xfbed('0x3f')];_0x586343[_0xfbed('0x62')]=qs['sort'](_0x262227[_0xfbed('0x3b')][_0xfbed('0x45')]);_0x586343[_0xfbed('0x46')]=qs[_0xfbed('0x3d')](_[_0xfbed('0x47')](_0x262227['query'],_0x241296['filters']));if(_0x262227[_0xfbed('0x3b')]['filter']){_0x586343['where']=_['merge'](_0x586343[_0xfbed('0x46')],{'$or':_[_0xfbed('0x2f')](_0x586343['attributes'],function(_0x258f83){var _0x2b11d9={};_0x2b11d9[_0x258f83]={'$like':'%'+_0x262227[_0xfbed('0x3b')]['filter']+'%'};return _0x2b11d9;})});}_0x586343=_[_0xfbed('0x48')]({},_0x586343,_0x262227[_0xfbed('0x4a')]);return _0x38855a['getTeams'](_0x586343);}})[_0xfbed('0x27')](function(_0x283201){if(_0x283201){_0x33d9a3=_0x283201['length'];if(!_0x262227['query'][_0xfbed('0x43')](_0xfbed('0x44'))){_0x586343[_0xfbed('0x22')]=qs['limit'](_0x262227[_0xfbed('0x3b')]['limit']);_0x586343['offset']=qs['offset'](_0x262227['query'][_0xfbed('0x20')]);}return _0x38855a['getTeams'](_0x586343);}})[_0xfbed('0x27')](function(_0x599be4){if(_0x599be4){return _0x599be4?{'count':_0x33d9a3,'rows':_0x599be4}:null;}})['then'](respondWithResult(_0x481180,null))[_0xfbed('0x4f')](handleError(_0x481180,null));};exports['addTeams']=function(_0x257ede,_0x32b9bc,_0xee4cd5){var _0x451954=_0x257ede[_0xfbed('0x50')]['teams'];var _0x4b5a35=_['map'](_0x451954,'id');return db[_0xfbed('0x6a')][_0xfbed('0x4e')]({'where':{'id':_0x4b5a35},'attributes':['id'],'include':[{'model':db[_0xfbed('0x6b')],'as':_0xfbed('0x6c'),'attributes':['id',_0xfbed('0x33'),_0xfbed('0x6d'),_0xfbed('0x6e'),_0xfbed('0x6f')],'raw':!![]}]})[_0xfbed('0x27')](function(_0x1893e6){if(_0x1893e6){var _0x291a54=_['flatMap'](_0x1893e6,function(_0x1ef11a){var _0x1b23df=_0x1ef11a[_0xfbed('0x29')]({'plain':!![]});_0x1b23df[_0xfbed('0x6c')]['forEach'](function(_0x22f92a){_0x22f92a[_0xfbed('0x70')]=_[_0xfbed('0x53')](_0x451954,{'id':_0x1b23df['id']})['penalty'];});return _0x1b23df['Agents'];});return db[_0xfbed('0x37')][_0xfbed('0x53')]({'where':{'id':_0x257ede[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](function(_0xc7fa78){return db[_0xfbed('0x71')][_0xfbed('0x72')](function(_0x415044){return _0xc7fa78['addTeams'](_0x4b5a35,{'transaction':_0x415044})[_0xfbed('0x27')](function(){return BPromise[_0xfbed('0x73')](_0x451954,function(_0x244e2d){return db[_0xfbed('0x74')][_0xfbed('0x75')]({'TeamId':_0x244e2d['id'],'VoiceQueueId':_0x257ede[_0xfbed('0x5e')]['id'],'penalty':_0x244e2d['penalty']},{'transaction':_0x415044});});})[_0xfbed('0x27')](function(){return BPromise[_0xfbed('0x73')](_0x291a54,function(_0x4252b1){return db[_0xfbed('0x76')][_0xfbed('0x77')]({'where':{'UserId':_0x4252b1['id'],'VoiceQueueId':_0x257ede[_0xfbed('0x5e')]['id']},'defaults':{'penalty':_0x4252b1[_0xfbed('0x70')]},'transaction':_0x415044});});})[_0xfbed('0x27')](function(){return BPromise[_0xfbed('0x73')](_[_0xfbed('0x2e')](_0x291a54,{'online':!![]}),function(_0x20899f){return db[_0xfbed('0x78')][_0xfbed('0x75')]({'membername':_0x20899f[_0xfbed('0x33')],'UserId':_0x20899f['id'],'queue_name':_0xc7fa78['name'],'VoiceQueueId':_0xc7fa78['id'],'interface':_[_0xfbed('0x79')](_0x20899f[_0xfbed('0x6f')])?util[_0xfbed('0x7a')](_0xfbed('0x7b'),_0x20899f['name']):_0x20899f[_0xfbed('0x6f')],'paused':_0x20899f[_0xfbed('0x6e')]||![],'penalty':_0x20899f[_0xfbed('0x70')]},{'transaction':_0x415044});});})['then'](function(){_0x291a54['forEach'](function(_0x58423b){socket[_0xfbed('0x7c')](_0xfbed('0x7d'),{'UserId':_0x58423b['id'],'VoiceQueueId':_0xc7fa78['id']});});});});});}})[_0xfbed('0x27')](respondWithStatusCode(_0x32b9bc,null))[_0xfbed('0x4f')](handleError(_0x32b9bc,null));};exports['removeTeams']=function(_0x3d6724,_0x27128f,_0x4bb443){return db[_0xfbed('0x6a')]['findAll']({'where':{'id':_0x3d6724[_0xfbed('0x3b')][_0xfbed('0x7e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfbed('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xfbed('0x27')](handleEntityNotFound(_0x27128f,null))[_0xfbed('0x27')](function(_0x16e302){var _0x326dde=_['map'](_0x16e302,'id');var _0x432184=[];var _0x4bc8ca=[];var _0x1a1585=squel[_0xfbed('0x7f')]();_0x1a1585['field'](_0xfbed('0x80'))[_0xfbed('0x81')](_0xfbed('0x82'),'tq')[_0xfbed('0x83')](_0xfbed('0x84'),'ut',_0xfbed('0x85'))[_0xfbed('0x46')](_0xfbed('0x86'),_0x3d6724['params']['id']);for(var _0x234d69=0x0;_0x234d69<_0x16e302[_0xfbed('0x42')];_0x234d69+=0x1){let _0x1a007d=_0x16e302[_0x234d69];for(var _0x5d08a0=0x0;_0x5d08a0<_0x1a007d[_0xfbed('0x6c')][_0xfbed('0x42')];_0x5d08a0+=0x1){let _0x436b2c=_0x1a007d[_0xfbed('0x6c')][_0x5d08a0];var _0x45b9ee=_0x1a1585['clone']();_0x45b9ee['where'](_0xfbed('0x87'),_0x436b2c['id']);_0x4bc8ca['push'](db[_0xfbed('0x71')][_0xfbed('0x3b')](_0x45b9ee['toString'](),{'type':db['sequelize'][_0xfbed('0x88')][_0xfbed('0x89')]})[_0xfbed('0x27')](function(_0x51d424){if(_0x51d424['length']===0x1){return _0x436b2c['id'];}else{var _0x1070c8=_[_0xfbed('0x8a')](_['map'](_0x51d424,_0xfbed('0x8b')),function(_0x1bba03){return _[_0xfbed('0x31')](_0x326dde,_0x1bba03);});if(_0x1070c8){return _0x436b2c['id'];}}}));}}return BPromise['all'](_0x4bc8ca)[_0xfbed('0x27')](function(_0x36b388){_0x432184=_(_0x432184)['union'](_0x36b388)['compact']()['value']();return db[_0xfbed('0x37')][_0xfbed('0x53')]({'where':{'id':_0x3d6724['params']['id']}})[_0xfbed('0x27')](function(_0xb2328c){return db['sequelize'][_0xfbed('0x72')](function(_0x545d62){return _0xb2328c['removeTeams'](_0x3d6724['query'][_0xfbed('0x7e')],{'transaction':_0x545d62})['then'](function(){if(!_[_0xfbed('0x8c')](_0x432184)){return _0xb2328c['removeAgents'](_0x432184,{'transaction':_0x545d62})['then'](function(){return db[_0xfbed('0x78')]['destroy']({'where':{'VoiceQueueId':_0x3d6724[_0xfbed('0x5e')]['id'],'UserId':_0x432184},'transaction':_0x545d62});});}})['then'](function(){_0x432184[_0xfbed('0x8d')](function(_0x235f26){socket[_0xfbed('0x7c')](_0xfbed('0x8e'),{'UserId':_0x235f26,'VoiceQueueId':_0xb2328c['id']});});});});});});})[_0xfbed('0x27')](respondWithStatusCode(_0x27128f,null))[_0xfbed('0x4f')](handleError(_0x27128f,null));};exports[_0xfbed('0x8f')]=function(_0x63a655,_0x31d372,_0x271ce2){var _0x313bed,_0x55a11c;return db['VoiceQueue'][_0xfbed('0x53')]({'where':{'id':_0x63a655[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x31d372,null))[_0xfbed('0x27')](function(_0xad3eaf){if(_0xad3eaf){_0x55a11c=_0xad3eaf;return _0xad3eaf[_0xfbed('0x8f')](_0x63a655[_0xfbed('0x50')][_0xfbed('0x7e')],_[_0xfbed('0x57')](_0x63a655[_0xfbed('0x50')],[_0xfbed('0x7e'),'id'])||{})['spread'](function(_0x484dbf){for(var _0x5f1f55=0x0;_0x5f1f55<_0x63a655[_0xfbed('0x50')][_0xfbed('0x7e')][_0xfbed('0x42')];_0x5f1f55+=0x1){socket[_0xfbed('0x7c')](_0xfbed('0x7d'),{'UserId':Number(_0x63a655[_0xfbed('0x50')][_0xfbed('0x7e')][_0x5f1f55]),'VoiceQueueId':Number(_0x63a655[_0xfbed('0x5e')]['id'])});}return _0x484dbf;});}})[_0xfbed('0x27')](function(_0x2afd6c){_0x313bed=_0x2afd6c||[];if(_0x55a11c){return db['User'][_0xfbed('0x4e')]({'where':{'id':_0x63a655[_0xfbed('0x50')][_0xfbed('0x7e')]},'attributes':['id',_0xfbed('0x33'),'online','voicePause',_0xfbed('0x6f')],'raw':!![]});}})[_0xfbed('0x27')](function(_0xedb268){if(!_['isEmpty'](_0xedb268)){var _0x5c9421=[];for(var _0x1eb84e=0x0;_0x1eb84e<_0xedb268['length'];_0x1eb84e++){if(_0xedb268[_0x1eb84e][_0xfbed('0x6d')]){_0x5c9421[_0xfbed('0x90')](db[_0xfbed('0x78')]['upsert']({'membername':_0xedb268[_0x1eb84e][_0xfbed('0x33')],'UserId':_0xedb268[_0x1eb84e]['id'],'queue_name':_0x55a11c['name'],'VoiceQueueId':_0x55a11c['id'],'interface':_[_0xfbed('0x79')](_0xedb268[_0x1eb84e][_0xfbed('0x6f')])?util[_0xfbed('0x7a')]('SIP/%s',_0xedb268[_0x1eb84e][_0xfbed('0x33')]):_0xedb268[_0x1eb84e]['interface'],'paused':_0xedb268[_0x1eb84e][_0xfbed('0x6e')]||![],'penalty':_0x63a655['body'][_0xfbed('0x70')]||0x0}));}}return BPromise['all'](_0x5c9421);}})[_0xfbed('0x27')](function(){return _0x313bed;})[_0xfbed('0x27')](respondWithResult(_0x31d372,null))[_0xfbed('0x4f')](handleError(_0x31d372,null));};exports[_0xfbed('0x91')]=function(_0x4c4c67,_0x1dbb7c,_0x4c33e9){return db[_0xfbed('0x37')]['find']({'where':{'id':_0x4c4c67[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x1dbb7c,null))[_0xfbed('0x27')](function(_0x57480e){if(_0x57480e){return _0x57480e['removeAgents'](_0x4c4c67['query']['ids'])[_0xfbed('0x27')](function(){if(_[_0xfbed('0x92')](_0x4c4c67[_0xfbed('0x3b')][_0xfbed('0x7e')])){for(var _0x510646=0x0;_0x510646<_0x4c4c67[_0xfbed('0x3b')][_0xfbed('0x7e')][_0xfbed('0x42')];_0x510646+=0x1){socket[_0xfbed('0x7c')](_0xfbed('0x8e'),{'UserId':Number(_0x4c4c67[_0xfbed('0x3b')][_0xfbed('0x7e')][_0x510646]),'VoiceQueueId':Number(_0x4c4c67[_0xfbed('0x5e')]['id'])});}}else{socket[_0xfbed('0x7c')](_0xfbed('0x8e'),{'UserId':Number(_0x4c4c67[_0xfbed('0x3b')][_0xfbed('0x7e')]),'VoiceQueueId':Number(_0x4c4c67[_0xfbed('0x5e')]['id'])});}});}})[_0xfbed('0x27')](function(_0x28a503){return db[_0xfbed('0x78')][_0xfbed('0x28')]({'where':{'VoiceQueueId':_0x4c4c67[_0xfbed('0x5e')]['id'],'UserId':_0x4c4c67[_0xfbed('0x3b')]['ids']}})['then'](function(){return _0x28a503;});})[_0xfbed('0x27')](respondWithStatusCode(_0x1dbb7c,null))[_0xfbed('0x4f')](handleError(_0x1dbb7c,null));};exports['getAgents']=function(_0x45aa3b,_0x437b3f,_0x50acfa){var _0x2557cd={};var _0x5c5bc6={};var _0x478f66;var _0x6c8d19;return db[_0xfbed('0x37')][_0xfbed('0x60')]({'where':{'id':_0x45aa3b[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x437b3f,null))['then'](function(_0x3e737a){if(_0x3e737a){_0x478f66=_0x3e737a;_0x5c5bc6[_0xfbed('0x3f')]=_[_0xfbed('0x3c')](db[_0xfbed('0x6b')][_0xfbed('0x38')]);_0x5c5bc6[_0xfbed('0x3b')]=_['keys'](_0x45aa3b['query']);_0x5c5bc6[_0xfbed('0x3d')]=_['intersection'](_0x5c5bc6[_0xfbed('0x3f')],_0x5c5bc6[_0xfbed('0x3b')]);_0x2557cd['attributes']=_[_0xfbed('0x3e')](_0x5c5bc6['model'],qs[_0xfbed('0x41')](_0x45aa3b[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x2557cd[_0xfbed('0x40')]=_0x2557cd[_0xfbed('0x40')][_0xfbed('0x42')]?_0x2557cd['attributes']:_0x5c5bc6[_0xfbed('0x3f')];_0x2557cd[_0xfbed('0x62')]=qs[_0xfbed('0x45')](_0x45aa3b['query'][_0xfbed('0x45')]);_0x2557cd[_0xfbed('0x46')]=qs[_0xfbed('0x3d')](_['pick'](_0x45aa3b[_0xfbed('0x3b')],_0x5c5bc6[_0xfbed('0x3d')]));if(_0x45aa3b[_0xfbed('0x3b')][_0xfbed('0x2e')]){_0x2557cd[_0xfbed('0x46')]=_['merge'](_0x2557cd['where'],{'$or':_['map'](_0x2557cd[_0xfbed('0x40')],function(_0x495ff2){var _0x276056={};_0x276056[_0x495ff2]={'$like':'%'+_0x45aa3b['query'][_0xfbed('0x2e')]+'%'};return _0x276056;})});}_0x2557cd=_[_0xfbed('0x48')]({},_0x2557cd,_0x45aa3b[_0xfbed('0x4a')]);return _0x478f66[_0xfbed('0x93')](_0x2557cd);}})[_0xfbed('0x27')](function(_0x5bb852){if(_0x5bb852){_0x6c8d19=_0x5bb852[_0xfbed('0x42')];if(!_0x45aa3b[_0xfbed('0x3b')][_0xfbed('0x43')](_0xfbed('0x44'))){_0x2557cd['limit']=qs[_0xfbed('0x22')](_0x45aa3b[_0xfbed('0x3b')][_0xfbed('0x22')]);_0x2557cd[_0xfbed('0x20')]=qs[_0xfbed('0x20')](_0x45aa3b[_0xfbed('0x3b')][_0xfbed('0x20')]);}return _0x478f66[_0xfbed('0x93')](_0x2557cd);}})[_0xfbed('0x27')](function(_0x2feed8){if(_0x2feed8){return _0x2feed8?{'count':_0x6c8d19,'rows':_0x2feed8}:null;}})[_0xfbed('0x27')](respondWithResult(_0x437b3f,null))[_0xfbed('0x4f')](handleError(_0x437b3f,null));};exports[_0xfbed('0x94')]=function(_0x31464f,_0x14f2cb,_0x2de292){var _0x38df32={};var _0x1595c4={};var _0x495c2d;var _0x1861d8;return db[_0xfbed('0x37')][_0xfbed('0x60')]({'where':{'id':_0x31464f['params']['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x14f2cb,null))[_0xfbed('0x27')](function(_0x2a7e7d){if(_0x2a7e7d){_0x495c2d=_0x2a7e7d;_0x1595c4[_0xfbed('0x3f')]=_[_0xfbed('0x3c')](db[_0xfbed('0x78')][_0xfbed('0x38')]);_0x1595c4['query']=_[_0xfbed('0x3c')](_0x31464f[_0xfbed('0x3b')]);_0x1595c4[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0x1595c4['model'],_0x1595c4[_0xfbed('0x3b')]);_0x38df32[_0xfbed('0x40')]=_['intersection'](_0x1595c4[_0xfbed('0x3f')],qs[_0xfbed('0x41')](_0x31464f[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x38df32[_0xfbed('0x40')]=_0x38df32[_0xfbed('0x40')][_0xfbed('0x42')]?_0x38df32[_0xfbed('0x40')]:_0x1595c4[_0xfbed('0x3f')];_0x38df32[_0xfbed('0x62')]=qs[_0xfbed('0x45')](_0x31464f['query'][_0xfbed('0x45')]);_0x38df32['where']=qs['filters'](_['pick'](_0x31464f[_0xfbed('0x3b')],_0x1595c4[_0xfbed('0x3d')]));if(_0x31464f['query'][_0xfbed('0x2e')]){_0x38df32[_0xfbed('0x46')]=_[_0xfbed('0x48')](_0x38df32[_0xfbed('0x46')],{'$or':_[_0xfbed('0x2f')](_0x38df32['attributes'],function(_0x439153){var _0x37755b={};_0x37755b[_0x439153]={'$like':'%'+_0x31464f[_0xfbed('0x3b')]['filter']+'%'};return _0x37755b;})});}_0x38df32=_[_0xfbed('0x48')]({},_0x38df32,_0x31464f[_0xfbed('0x4a')]);return _0x495c2d['getMembers'](_0x38df32);}})[_0xfbed('0x27')](function(_0x459a42){if(_0x459a42){_0x1861d8=_0x459a42[_0xfbed('0x42')];if(!_0x31464f[_0xfbed('0x3b')][_0xfbed('0x43')](_0xfbed('0x44'))){_0x38df32[_0xfbed('0x22')]=qs[_0xfbed('0x22')](_0x31464f['query']['limit']);_0x38df32[_0xfbed('0x20')]=qs[_0xfbed('0x20')](_0x31464f['query'][_0xfbed('0x20')]);}return _0x495c2d[_0xfbed('0x94')](_0x38df32);}})[_0xfbed('0x27')](function(_0x303acd){return _0x303acd?{'count':_0x1861d8,'rows':_0x303acd}:null;})[_0xfbed('0x27')](respondWithResult(_0x14f2cb,null))[_0xfbed('0x4f')](handleError(_0x14f2cb,null));};exports[_0xfbed('0x95')]=function(_0x1df1c8,_0x8245da,_0x102be4){var _0x4ac3f9={};var _0x312b5e={};var _0x191df4;var _0x2ffbfe;return db[_0xfbed('0x37')][_0xfbed('0x60')]({'where':{'id':_0x1df1c8['params']['id']}})['then'](handleEntityNotFound(_0x8245da,null))['then'](function(_0x2fdb86){if(_0x2fdb86){_0x191df4=_0x2fdb86;_0x312b5e['model']=_['keys'](db[_0xfbed('0x96')][_0xfbed('0x38')]);_0x312b5e['query']=_[_0xfbed('0x3c')](_0x1df1c8[_0xfbed('0x3b')]);_0x312b5e[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0x312b5e['model'],_0x312b5e[_0xfbed('0x3b')]);_0x4ac3f9[_0xfbed('0x40')]=_[_0xfbed('0x3e')](_0x312b5e['model'],qs[_0xfbed('0x41')](_0x1df1c8[_0xfbed('0x3b')][_0xfbed('0x41')]));_0x4ac3f9['attributes']=_0x4ac3f9[_0xfbed('0x40')][_0xfbed('0x42')]?_0x4ac3f9[_0xfbed('0x40')]:_0x312b5e['model'];_0x4ac3f9[_0xfbed('0x62')]=qs[_0xfbed('0x45')](_0x1df1c8[_0xfbed('0x3b')][_0xfbed('0x45')]);_0x4ac3f9[_0xfbed('0x46')]=qs[_0xfbed('0x3d')](_['pick'](_0x1df1c8['query'],_0x312b5e[_0xfbed('0x3d')]));if(_0x1df1c8[_0xfbed('0x3b')][_0xfbed('0x2e')]){_0x4ac3f9[_0xfbed('0x46')]=_['merge'](_0x4ac3f9[_0xfbed('0x46')],{'$or':_[_0xfbed('0x2f')](_0x4ac3f9[_0xfbed('0x40')],function(_0x3ab9a5){var _0x46809e={};_0x46809e[_0x3ab9a5]={'$like':'%'+_0x1df1c8[_0xfbed('0x3b')][_0xfbed('0x2e')]+'%'};return _0x46809e;})});}_0x4ac3f9=_[_0xfbed('0x48')]({},_0x4ac3f9,_0x1df1c8['options']);return _0x191df4[_0xfbed('0x95')](_0x4ac3f9);}})[_0xfbed('0x27')](function(_0x15258b){if(_0x15258b){_0x2ffbfe=_0x15258b[_0xfbed('0x42')];if(!_0x1df1c8[_0xfbed('0x3b')][_0xfbed('0x43')]('nolimit')){_0x4ac3f9[_0xfbed('0x22')]=qs[_0xfbed('0x22')](_0x1df1c8[_0xfbed('0x3b')][_0xfbed('0x22')]);_0x4ac3f9[_0xfbed('0x20')]=qs[_0xfbed('0x20')](_0x1df1c8['query'][_0xfbed('0x20')]);}return _0x191df4[_0xfbed('0x95')](_0x4ac3f9);}})[_0xfbed('0x27')](function(_0x354691){if(_0x354691){return _0x354691?{'count':_0x2ffbfe,'rows':_0x354691}:null;}})['then'](respondWithResult(_0x8245da,null))[_0xfbed('0x4f')](handleError(_0x8245da,null));};exports[_0xfbed('0x97')]=function(_0x4af7c4,_0x20ba45,_0x34f0d9){var _0x282ac7,_0x432be4;return db['VoiceQueue'][_0xfbed('0x53')]({'where':{'id':_0x4af7c4[_0xfbed('0x5e')]['id']}})['then'](handleEntityNotFound(_0x20ba45,null))['then'](function(_0x2ff41a){if(_0x2ff41a){_0x432be4=_0x2ff41a;return _0x2ff41a[_0xfbed('0x97')](_0x4af7c4[_0xfbed('0x50')]['ids'],_[_0xfbed('0x57')](_0x4af7c4['body'],[_0xfbed('0x7e'),'id'])||{});}return null;})[_0xfbed('0x98')](function(_0x23368b){var _0x2ca9fe;_0x282ac7=_0x23368b||[];var _0x46fbb3=[];if(_0x23368b){for(var _0x34845e=0x0;_0x34845e<_0x23368b['length'];_0x34845e+=0x1){var _0xd2adb9=_0x23368b[_0x34845e][_0xfbed('0x29')]({'plain':!![]});_0x432be4['dialCheckDuplicateType']=_0x4af7c4[_0xfbed('0x50')][_0xfbed('0x99')]?_0x4af7c4['body'][_0xfbed('0x99')]:_0x432be4[_0xfbed('0x99')];switch(_0x432be4['dialCheckDuplicateType']){case _0xfbed('0x9a'):_0x2ca9fe=squel[_0xfbed('0x9b')]()['into']('cm_hopper')[_0xfbed('0x9c')]([_0xfbed('0x9d'),_0xfbed('0x9e'),_0xfbed('0x9f'),_0xfbed('0xa0'),_0xfbed('0x63'),_0xfbed('0x58'),'updatedAt'],squel[_0xfbed('0x7f')]()[_0xfbed('0xa1')](_0xfbed('0x9d'),_0xfbed('0x9d'))[_0xfbed('0xa1')](_0xfbed('0xa2'),_0xfbed('0x9e'))['field']('id',_0xfbed('0x9f'))['field'](_0xd2adb9[_0xfbed('0xa3')]['toString'](),_0xfbed('0xa0'))[_0xfbed('0xa1')](_0x4af7c4[_0xfbed('0x5e')]['id'][_0xfbed('0xa4')](),_0xfbed('0x63'))[_0xfbed('0xa1')](_0xfbed('0xa2'),_0xfbed('0x58'))['field'](_0xfbed('0xa2'),'updatedAt')['from'](_0xfbed('0xa5'))[_0xfbed('0x46')](_0xfbed('0xa6'))[_0xfbed('0x46')](_0xfbed('0xa7'),_0xd2adb9[_0xfbed('0xa3')][_0xfbed('0xa4')]())[_0xfbed('0x46')](_0xfbed('0xa8'))[_0xfbed('0x46')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xfbed('0xa1')](_0xfbed('0xa9'))[_0xfbed('0x81')](_0xfbed('0xaa'))[_0xfbed('0x46')]('VoiceQueueId\x20=\x20?',_0x4af7c4[_0xfbed('0x5e')]['id'][_0xfbed('0xa4')]()))[_0xfbed('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfbed('0x7f')]()[_0xfbed('0xa1')](_0xfbed('0xab'))['from']('cm_hopper')[_0xfbed('0x46')](_0xfbed('0x86'),_0x4af7c4[_0xfbed('0x5e')]['id']['toString']())))['toString']();break;case _0xfbed('0xac'):_0x2ca9fe=squel[_0xfbed('0x9b')]()[_0xfbed('0xad')]('cm_hopper')[_0xfbed('0x9c')]([_0xfbed('0x9d'),_0xfbed('0x9e'),_0xfbed('0x9f'),_0xfbed('0xa0'),_0xfbed('0x63'),_0xfbed('0x58'),_0xfbed('0x59')],squel['select']()['field'](_0xfbed('0x9d'),_0xfbed('0x9d'))['field']('NOW()',_0xfbed('0x9e'))[_0xfbed('0xa1')]('id',_0xfbed('0x9f'))[_0xfbed('0xa1')](_0xd2adb9[_0xfbed('0xa3')][_0xfbed('0xa4')](),_0xfbed('0xa0'))[_0xfbed('0xa1')](_0x4af7c4[_0xfbed('0x5e')]['id'][_0xfbed('0xa4')](),'VoiceQueueId')[_0xfbed('0xa1')](_0xfbed('0xa2'),'createdAt')['field'](_0xfbed('0xa2'),_0xfbed('0x59'))[_0xfbed('0x81')](_0xfbed('0xa5'))[_0xfbed('0x46')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0xd2adb9['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0xfbed('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfbed('0x7f')]()[_0xfbed('0xa1')]('COALESCE(phone,\x27\x27)')[_0xfbed('0x81')]('cm_hopper')['where'](_0xfbed('0x86'),_0x4af7c4['params']['id'][_0xfbed('0xa4')]())))['toString']();break;default:_0x2ca9fe=squel['insert']()[_0xfbed('0xad')](_0xfbed('0xae'))['fromQuery']([_0xfbed('0x9d'),_0xfbed('0x9e'),_0xfbed('0x9f'),_0xfbed('0xa0'),_0xfbed('0x63'),_0xfbed('0x58'),_0xfbed('0x59')],squel[_0xfbed('0x7f')]()[_0xfbed('0xa1')](_0xfbed('0x9d'),_0xfbed('0x9d'))[_0xfbed('0xa1')]('NOW()',_0xfbed('0x9e'))[_0xfbed('0xa1')]('id',_0xfbed('0x9f'))[_0xfbed('0xa1')](_0xd2adb9['CmListId'][_0xfbed('0xa4')](),_0xfbed('0xa0'))[_0xfbed('0xa1')](_0x4af7c4['params']['id'][_0xfbed('0xa4')](),_0xfbed('0x63'))['field'](_0xfbed('0xa2'),'createdAt')['field']('NOW()',_0xfbed('0x59'))[_0xfbed('0x81')](_0xfbed('0xa5'))[_0xfbed('0x46')](_0xfbed('0xa6'))['where'](_0xfbed('0xa7'),_0xd2adb9[_0xfbed('0xa3')][_0xfbed('0xa4')]())[_0xfbed('0x46')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x46fbb3[_0xfbed('0x90')](db['sequelize']['query'](_0x2ca9fe));}return BPromise[_0xfbed('0xaf')](_0x46fbb3);}})[_0xfbed('0x27')](function(){return _0x282ac7;})[_0xfbed('0x27')](respondWithResult(_0x20ba45,null))[_0xfbed('0x4f')](handleError(_0x20ba45,null));};exports[_0xfbed('0xb0')]=function(_0x13d4f4,_0x55465d,_0x51fee1){return db[_0xfbed('0x37')][_0xfbed('0x53')]({'where':{'id':_0x13d4f4[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x55465d,null))[_0xfbed('0x27')](function(_0x5016d6){if(_0x5016d6){return _0x5016d6[_0xfbed('0xb0')](_0x13d4f4[_0xfbed('0x3b')][_0xfbed('0x7e')]);}})[_0xfbed('0x27')](function(_0x3ec5c4){if(_0x3ec5c4){return db[_0xfbed('0x61')][_0xfbed('0x28')]({'where':{'ListId':_0x13d4f4['query'][_0xfbed('0x7e')],'VoiceQueueId':_0x13d4f4[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](function(){return _0x3ec5c4;});}})['then'](respondWithStatusCode(_0x55465d,null))['catch'](handleError(_0x55465d,null));};exports['getBlackLists']=function(_0x1f5bd5,_0x2fca39,_0x5bc4a1){var _0x1f4d4b={};var _0x57ffb5={};var _0x37a5d7;var _0x1204ee;return db[_0xfbed('0x37')][_0xfbed('0x60')]({'where':{'id':_0x1f5bd5['params']['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x2fca39,null))[_0xfbed('0x27')](function(_0x42edfb){if(_0x42edfb){_0x37a5d7=_0x42edfb;_0x57ffb5[_0xfbed('0x3f')]=_[_0xfbed('0x3c')](db[_0xfbed('0x96')][_0xfbed('0x38')]);_0x57ffb5[_0xfbed('0x3b')]=_['keys'](_0x1f5bd5['query']);_0x57ffb5[_0xfbed('0x3d')]=_[_0xfbed('0x3e')](_0x57ffb5[_0xfbed('0x3f')],_0x57ffb5[_0xfbed('0x3b')]);_0x1f4d4b['attributes']=_[_0xfbed('0x3e')](_0x57ffb5['model'],qs['fields'](_0x1f5bd5['query']['fields']));_0x1f4d4b[_0xfbed('0x40')]=_0x1f4d4b[_0xfbed('0x40')]['length']?_0x1f4d4b['attributes']:_0x57ffb5['model'];_0x1f4d4b['order']=qs['sort'](_0x1f5bd5[_0xfbed('0x3b')]['sort']);_0x1f4d4b[_0xfbed('0x46')]=qs[_0xfbed('0x3d')](_[_0xfbed('0x47')](_0x1f5bd5[_0xfbed('0x3b')],_0x57ffb5[_0xfbed('0x3d')]));if(_0x1f5bd5[_0xfbed('0x3b')][_0xfbed('0x2e')]){_0x1f4d4b[_0xfbed('0x46')]=_[_0xfbed('0x48')](_0x1f4d4b[_0xfbed('0x46')],{'$or':_[_0xfbed('0x2f')](_0x1f4d4b[_0xfbed('0x40')],function(_0x519bf2){var _0x48f186={};_0x48f186[_0x519bf2]={'$like':'%'+_0x1f5bd5['query'][_0xfbed('0x2e')]+'%'};return _0x48f186;})});}_0x1f4d4b=_[_0xfbed('0x48')]({},_0x1f4d4b,_0x1f5bd5['options']);return _0x37a5d7['getBlackLists'](_0x1f4d4b);}})['then'](function(_0x267dff){if(_0x267dff){_0x1204ee=_0x267dff[_0xfbed('0x42')];if(!_0x1f5bd5[_0xfbed('0x3b')][_0xfbed('0x43')](_0xfbed('0x44'))){_0x1f4d4b[_0xfbed('0x22')]=qs[_0xfbed('0x22')](_0x1f5bd5[_0xfbed('0x3b')]['limit']);_0x1f4d4b[_0xfbed('0x20')]=qs[_0xfbed('0x20')](_0x1f5bd5[_0xfbed('0x3b')]['offset']);}return _0x37a5d7[_0xfbed('0xb1')](_0x1f4d4b);}})['then'](function(_0xd0d676){if(_0xd0d676){return _0xd0d676?{'count':_0x1204ee,'rows':_0xd0d676}:null;}})['then'](respondWithResult(_0x2fca39,null))['catch'](handleError(_0x2fca39,null));};exports[_0xfbed('0xb2')]=function(_0x736a81,_0x40f56b,_0x27b03f){var _0x3ef0d7,_0x24b682;return db[_0xfbed('0x37')]['find']({'where':{'id':_0x736a81[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x40f56b,null))['then'](function(_0x28cccf){if(_0x28cccf){_0x24b682=_0x28cccf;return _0x28cccf[_0xfbed('0xb2')](_0x736a81[_0xfbed('0x50')][_0xfbed('0x7e')],_[_0xfbed('0x57')](_0x736a81[_0xfbed('0x50')],['ids','id'])||{});}return null;})[_0xfbed('0x98')](function(_0x1651ca){var _0x58a6be;_0x3ef0d7=_0x1651ca||[];var _0x4e277c=[];if(_0x1651ca){for(var _0x3bbb45=0x0;_0x3bbb45<_0x1651ca['length'];_0x3bbb45+=0x1){var _0x44bf0b=_0x1651ca[_0x3bbb45][_0xfbed('0x29')]({'plain':!![]});_0x58a6be=squel[_0xfbed('0x9b')]()[_0xfbed('0xad')]('cm_hopper_black')['fromQuery']([_0xfbed('0x9d'),_0xfbed('0x9f'),_0xfbed('0xa0'),_0xfbed('0x63'),_0xfbed('0x58'),_0xfbed('0x59')],squel['select']()[_0xfbed('0xa1')]('phone',_0xfbed('0x9d'))[_0xfbed('0xa1')]('id',_0xfbed('0x9f'))[_0xfbed('0xa1')](_0x44bf0b[_0xfbed('0xa3')][_0xfbed('0xa4')](),'ListId')[_0xfbed('0xa1')](_0x736a81['params']['id'][_0xfbed('0xa4')](),'VoiceQueueId')['field'](_0xfbed('0xa2'),'createdAt')[_0xfbed('0xa1')](_0xfbed('0xa2'),_0xfbed('0x59'))[_0xfbed('0x81')](_0xfbed('0xa5'))[_0xfbed('0x46')](_0xfbed('0xa6'))[_0xfbed('0x46')](_0xfbed('0xa7'),_0x44bf0b[_0xfbed('0xa3')]['toString']())[_0xfbed('0x46')](_0xfbed('0xa8')))[_0xfbed('0xa4')]();_0x4e277c[_0xfbed('0x90')](db[_0xfbed('0x71')]['query'](_0x58a6be));}return BPromise[_0xfbed('0xaf')](_0x4e277c);}})[_0xfbed('0x27')](function(){return _0x3ef0d7;})[_0xfbed('0x27')](respondWithResult(_0x40f56b,null))[_0xfbed('0x4f')](handleError(_0x40f56b,null));};exports['removeBlackLists']=function(_0x68980e,_0x23ecdf,_0x1d7edc){return db[_0xfbed('0x37')][_0xfbed('0x53')]({'where':{'id':_0x68980e[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](handleEntityNotFound(_0x23ecdf,null))[_0xfbed('0x27')](function(_0x82a31a){if(_0x82a31a){return _0x82a31a['removeBlackLists'](_0x68980e[_0xfbed('0x3b')]['ids']);}})[_0xfbed('0x27')](function(_0xfaf1da){if(_0xfaf1da){return db[_0xfbed('0x68')][_0xfbed('0x28')]({'where':{'ListId':_0x68980e[_0xfbed('0x3b')][_0xfbed('0x7e')],'VoiceQueueId':_0x68980e[_0xfbed('0x5e')]['id']}})[_0xfbed('0x27')](function(){return _0xfaf1da;});}})[_0xfbed('0x27')](respondWithStatusCode(_0x23ecdf,null))[_0xfbed('0x4f')](handleError(_0x23ecdf,null));}; \ No newline at end of file +var _0x63d0=['where','pick','filter','merge','VIRTUAL','options','VoiceQueue','count','findAll','rows','catch','show','params','includeAll','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','findOrCreate','isNil','format','SIP/%s','voicePause','emit','removeTeams','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','union','ids','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','all','removeAgents','getAgents','getMembers','CmList','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','ContactId','CmListId','NOW()','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','sendStatus','status','end','offset','undefined','limit','set','apply','update','then','destroy','get','inbound','QueueCampaigns','outbound','map','value','includes','type','find','name','error','send','index','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63d0,0x1db));var _0x063d=function(_0x44ee95,_0x134327){_0x44ee95=_0x44ee95-0x0;var _0x461314=_0x63d0[_0x44ee95];return _0x461314;};'use strict';var emlformat=require(_0x063d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x063d('0x1'));var jsonpatch=require(_0x063d('0x2'));var rp=require(_0x063d('0x3'));var moment=require(_0x063d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x063d('0x5'));var util=require('util');var path=require(_0x063d('0x6'));var sox=require(_0x063d('0x7'));var csv=require(_0x063d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x063d('0x9'));var _=require('lodash');var squel=require(_0x063d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x063d('0xb'));var toCsv=require(_0x063d('0x8'));var querystring=require(_0x063d('0xc'));var Papa=require(_0x063d('0xd'));var Redis=require(_0x063d('0xe'));var authService=require(_0x063d('0xf'));var qs=require(_0x063d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x063d('0x11'));var logger=require(_0x063d('0x12'))(_0x063d('0x13'));var utils=require(_0x063d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x063d('0x15')](config['redis'],{'host':_0x063d('0x16'),'port':0x18eb});var socket=require(_0x063d('0x17'))(new Redis(config[_0x063d('0x18')]));require(_0x063d('0x19'))[_0x063d('0x1a')](socket);function respondWithStatusCode(_0xb13b9,_0x52e714){_0x52e714=_0x52e714||0xcc;return function(_0x30850e){if(_0x30850e){return _0xb13b9[_0x063d('0x1b')](_0x52e714);}return _0xb13b9[_0x063d('0x1c')](_0x52e714)[_0x063d('0x1d')]();};}function respondWithResult(_0x42b346,_0x3e61a7){_0x3e61a7=_0x3e61a7||0xc8;return function(_0xe9543e){if(_0xe9543e){return _0x42b346['status'](_0x3e61a7)['json'](_0xe9543e);}};}function respondWithFilteredResult(_0x940815,_0x400568){return function(_0xf610e8){if(_0xf610e8){var _0x17b8c0=typeof _0x400568[_0x063d('0x1e')]===_0x063d('0x1f')&&typeof _0x400568[_0x063d('0x20')]===_0x063d('0x1f');var _0x46e07a=_0xf610e8['count'];var _0x241c96=_0x17b8c0?0x0:_0x400568[_0x063d('0x1e')];var _0x222066=_0x17b8c0?_0xf610e8['count']:_0x400568['offset']+_0x400568['limit'];var _0x14623c;if(_0x222066>=_0x46e07a){_0x222066=_0x46e07a;_0x14623c=0xc8;}else{_0x14623c=0xce;}_0x940815[_0x063d('0x1c')](_0x14623c);return _0x940815[_0x063d('0x21')]('Content-Range',_0x241c96+'-'+_0x222066+'/'+_0x46e07a)['json'](_0xf610e8);}return null;};}function patchUpdates(_0x3485ba){return function(_0x282b56){try{jsonpatch[_0x063d('0x22')](_0x282b56,_0x3485ba,!![]);}catch(_0x24d877){return BPromise['reject'](_0x24d877);}return _0x282b56['save']();};}function saveUpdates(_0x2af128,_0x4e4581){return function(_0x3e1a9b){if(_0x3e1a9b){return _0x3e1a9b[_0x063d('0x23')](_0x2af128)[_0x063d('0x24')](function(_0x4e4ff9){return _0x4e4ff9;});}return null;};}function removeEntity(_0x367a76,_0x54037d){return function(_0x58c28f){if(_0x58c28f){return _0x58c28f[_0x063d('0x25')]()[_0x063d('0x24')](function(){var _0xf04db9=_0x58c28f[_0x063d('0x26')]({'plain':!![]});var _0x3acf06=[{'name':'VoiceQueues','value':_0x063d('0x27'),'ignore':![]},{'name':_0x063d('0x28'),'value':_0x063d('0x29'),'ignore':![]}];var _0x59d7f0=_(_0x3acf06)['filter']('ignore')[_0x063d('0x2a')](_0x063d('0x2b'))[_0x063d('0x2b')]();if(_[_0x063d('0x2c')](_0x59d7f0,_0xf04db9[_0x063d('0x2d')])){return;}var _0x5c122c=_[_0x063d('0x2e')](_0x3acf06,['value',_0xf04db9[_0x063d('0x2d')]])[_0x063d('0x2f')];return db['UserProfileResource'][_0x063d('0x25')]({'where':{'type':_0x5c122c,'resourceId':_0xf04db9['id']}})[_0x063d('0x24')](function(){return _0x58c28f;});})[_0x063d('0x24')](function(){_0x367a76[_0x063d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x580321,_0x59ca57){return function(_0x3d5bdb){if(!_0x3d5bdb){_0x580321[_0x063d('0x1b')](0x194);}return _0x3d5bdb;};}function handleError(_0x5a7312,_0x19c87b){_0x19c87b=_0x19c87b||0x1f4;return function(_0x9e98be){logger[_0x063d('0x30')](_0x9e98be['stack']);if(_0x9e98be[_0x063d('0x2f')]){delete _0x9e98be[_0x063d('0x2f')];}_0x5a7312['status'](_0x19c87b)[_0x063d('0x31')](_0x9e98be);};}exports[_0x063d('0x32')]=function(_0x5de4be,_0x550b40){var _0x23e6ab={},_0x492f20={},_0x54b606={'count':0x0,'rows':[]};var _0x21e15d=_[_0x063d('0x2a')](db['VoiceQueue'][_0x063d('0x33')],function(_0x26ff12){return{'name':_0x26ff12['fieldName'],'type':_0x26ff12[_0x063d('0x2d')][_0x063d('0x34')]};});_0x492f20['model']=_[_0x063d('0x2a')](_0x21e15d,'name');_0x492f20['query']=_[_0x063d('0x35')](_0x5de4be[_0x063d('0x36')]);_0x492f20[_0x063d('0x37')]=_[_0x063d('0x38')](_0x492f20[_0x063d('0x39')],_0x492f20[_0x063d('0x36')]);_0x23e6ab[_0x063d('0x3a')]=_[_0x063d('0x38')](_0x492f20[_0x063d('0x39')],qs['fields'](_0x5de4be[_0x063d('0x36')][_0x063d('0x3b')]));_0x23e6ab[_0x063d('0x3a')]=_0x23e6ab[_0x063d('0x3a')][_0x063d('0x3c')]?_0x23e6ab[_0x063d('0x3a')]:_0x492f20[_0x063d('0x39')];if(!_0x5de4be[_0x063d('0x36')][_0x063d('0x3d')](_0x063d('0x3e'))){_0x23e6ab[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x5de4be[_0x063d('0x36')]['limit']);_0x23e6ab[_0x063d('0x1e')]=qs[_0x063d('0x1e')](_0x5de4be[_0x063d('0x36')]['offset']);}_0x23e6ab[_0x063d('0x3f')]=qs[_0x063d('0x40')](_0x5de4be[_0x063d('0x36')][_0x063d('0x40')]);_0x23e6ab[_0x063d('0x41')]=qs[_0x063d('0x37')](_[_0x063d('0x42')](_0x5de4be['query'],_0x492f20[_0x063d('0x37')]),_0x21e15d);if(_0x5de4be[_0x063d('0x36')][_0x063d('0x43')]){_0x23e6ab[_0x063d('0x41')]=_[_0x063d('0x44')](_0x23e6ab[_0x063d('0x41')],{'$or':_[_0x063d('0x2a')](_0x21e15d,function(_0x5257d2){if(_0x5257d2[_0x063d('0x2d')]!==_0x063d('0x45')){var _0xe90163={};_0xe90163[_0x5257d2[_0x063d('0x2f')]]={'$like':'%'+_0x5de4be[_0x063d('0x36')][_0x063d('0x43')]+'%'};return _0xe90163;}})});}_0x23e6ab=_[_0x063d('0x44')]({},_0x23e6ab,_0x5de4be[_0x063d('0x46')]);var _0x54cb28={'where':_0x23e6ab[_0x063d('0x41')]};return db[_0x063d('0x47')]['count'](_0x54cb28)[_0x063d('0x24')](function(_0x5c76b7){_0x54b606[_0x063d('0x48')]=_0x5c76b7;if(_0x5de4be[_0x063d('0x36')]['includeAll']){_0x23e6ab['include']=[{'all':!![]}];}return db[_0x063d('0x47')][_0x063d('0x49')](_0x23e6ab);})['then'](function(_0x11edf7){_0x54b606[_0x063d('0x4a')]=_0x11edf7;return _0x54b606;})[_0x063d('0x24')](respondWithFilteredResult(_0x550b40,_0x23e6ab))[_0x063d('0x4b')](handleError(_0x550b40,null));};exports[_0x063d('0x4c')]=function(_0x15193b,_0x17f899){var _0x463316={'raw':![],'where':{'id':_0x15193b[_0x063d('0x4d')]['id']}},_0x11a7d5={};_0x11a7d5[_0x063d('0x39')]=_[_0x063d('0x35')](db[_0x063d('0x47')]['rawAttributes']);_0x11a7d5[_0x063d('0x36')]=_[_0x063d('0x35')](_0x15193b[_0x063d('0x36')]);_0x11a7d5[_0x063d('0x37')]=_[_0x063d('0x38')](_0x11a7d5[_0x063d('0x39')],_0x11a7d5['query']);_0x463316[_0x063d('0x3a')]=_[_0x063d('0x38')](_0x11a7d5[_0x063d('0x39')],qs['fields'](_0x15193b[_0x063d('0x36')][_0x063d('0x3b')]));_0x463316['attributes']=_0x463316['attributes'][_0x063d('0x3c')]?_0x463316['attributes']:_0x11a7d5[_0x063d('0x39')];if(_0x15193b[_0x063d('0x36')][_0x063d('0x4e')]){_0x463316[_0x063d('0x4f')]=[{'all':!![]}];}_0x463316=_[_0x063d('0x44')]({},_0x463316,_0x15193b[_0x063d('0x46')]);return db[_0x063d('0x47')]['find'](_0x463316)[_0x063d('0x24')](handleEntityNotFound(_0x17f899,null))[_0x063d('0x24')](respondWithResult(_0x17f899,null))[_0x063d('0x4b')](handleError(_0x17f899,null));};exports[_0x063d('0x50')]=function(_0x1b4130,_0x511bf4){return db[_0x063d('0x47')][_0x063d('0x50')](_0x1b4130['body'],{})[_0x063d('0x24')](function(_0x7b76c6){var _0x338dcf=_0x1b4130['user'][_0x063d('0x26')]({'plain':!![]});if(!_0x338dcf)throw new Error(_0x063d('0x51'));if(_0x338dcf[_0x063d('0x52')]===_0x063d('0x53')){var _0x511d08=_0x7b76c6[_0x063d('0x26')]({'plain':!![]});var _0x3848ae=[{'name':_0x063d('0x54'),'value':_0x063d('0x27')},{'name':_0x063d('0x28'),'value':_0x063d('0x29')}];var _0x4061ed=_['find'](_0x3848ae,[_0x063d('0x2b'),_0x511d08[_0x063d('0x2d')]])[_0x063d('0x2f')];return db[_0x063d('0x55')][_0x063d('0x2e')]({'where':{'name':_0x4061ed,'userProfileId':_0x338dcf[_0x063d('0x56')]},'raw':!![]})[_0x063d('0x24')](function(_0x524827){if(_0x524827&&_0x524827[_0x063d('0x57')]===0x0){return db[_0x063d('0x58')][_0x063d('0x50')]({'name':_0x511d08[_0x063d('0x2f')],'resourceId':_0x511d08['id'],'type':_0x524827['name'],'sectionId':_0x524827['id']},{})[_0x063d('0x24')](function(){return _0x7b76c6;});}else{return _0x7b76c6;}})[_0x063d('0x4b')](function(_0x4c5ab0){logger[_0x063d('0x30')](_0x063d('0x59'),_0x4c5ab0);throw _0x4c5ab0;});}return _0x7b76c6;})[_0x063d('0x24')](respondWithResult(_0x511bf4,0xc9))[_0x063d('0x4b')](handleError(_0x511bf4,null));};exports[_0x063d('0x5a')]=function(_0x154fa3,_0x3d7a8e){var _0x45febc={'where':{'id':_0x154fa3[_0x063d('0x4d')]['id']}},_0x2f32bc={};_0x2f32bc[_0x063d('0x39')]=_[_0x063d('0x35')](db[_0x063d('0x47')][_0x063d('0x33')]);_0x45febc[_0x063d('0x3a')]=_[_0x063d('0x38')](_0x2f32bc[_0x063d('0x39')],qs[_0x063d('0x3b')](_0x154fa3['query'][_0x063d('0x3b')]));_0x45febc['attributes']=_0x45febc[_0x063d('0x3a')]['length']?_0x45febc[_0x063d('0x3a')]:_0x2f32bc[_0x063d('0x39')];if(_0x154fa3[_0x063d('0x36')]['includeAll']){_0x45febc[_0x063d('0x4f')]=[{'all':!![]}];}_0x45febc=_[_0x063d('0x44')]({},_0x45febc,_0x154fa3[_0x063d('0x46')]);return db['VoiceQueue'][_0x063d('0x2e')](_0x45febc)[_0x063d('0x24')](handleEntityNotFound(_0x3d7a8e,null))[_0x063d('0x24')](function(_0x512e0a){if(_0x512e0a){var _0x1c6722=_0x512e0a['get']({'plain':!![]});_0x1c6722=qs['omit'](_0x1c6722,['id',_0x063d('0x5b'),_0x063d('0x5c')]);_0x154fa3[_0x063d('0x5d')]=_[_0x063d('0x5e')](_0x154fa3[_0x063d('0x5d')],['id',_0x063d('0x5b'),'updatedAt']);return db[_0x063d('0x47')]['create'](_[_0x063d('0x44')](_0x1c6722,_0x154fa3['body']),{'include':_0x154fa3[_0x063d('0x36')][_0x063d('0x4e')]?[{'all':!![]}]:undefined})[_0x063d('0x24')](function(_0x462e55){var _0x235677=_0x154fa3['user'][_0x063d('0x26')]({'plain':!![]});if(!_0x235677)throw new Error(_0x063d('0x51'));if(_0x235677[_0x063d('0x52')]===_0x063d('0x53')){var _0x4e8f=_0x462e55[_0x063d('0x26')]({'plain':!![]});var _0x4d9e16=[{'name':_0x063d('0x54'),'value':_0x063d('0x27')},{'name':_0x063d('0x28'),'value':_0x063d('0x29')}];var _0x141117=_[_0x063d('0x2e')](_0x4d9e16,[_0x063d('0x2b'),_0x4e8f[_0x063d('0x2d')]])[_0x063d('0x2f')];return db['UserProfileSection'][_0x063d('0x2e')]({'where':{'name':_0x141117,'userProfileId':_0x235677[_0x063d('0x56')]},'raw':!![]})[_0x063d('0x24')](function(_0x8e1126){if(_0x8e1126&&_0x8e1126[_0x063d('0x57')]===0x0){return db[_0x063d('0x58')]['create']({'name':_0x4e8f['name'],'resourceId':_0x4e8f['id'],'type':_0x8e1126[_0x063d('0x2f')],'sectionId':_0x8e1126['id']},{})[_0x063d('0x24')](function(){return _0x462e55;});}else{return _0x462e55;}})[_0x063d('0x4b')](function(_0x5e79db){logger[_0x063d('0x30')](_0x063d('0x59'),_0x5e79db);throw _0x5e79db;});}return _0x462e55;});}})['then'](respondWithResult(_0x3d7a8e,0xc9))['catch'](handleError(_0x3d7a8e,null));};exports[_0x063d('0x23')]=function(_0x3876bc,_0x2634a3){if(_0x3876bc[_0x063d('0x5d')]['id']){delete _0x3876bc[_0x063d('0x5d')]['id'];}return db[_0x063d('0x47')][_0x063d('0x2e')]({'where':{'id':_0x3876bc[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x2634a3,null))[_0x063d('0x24')](saveUpdates(_0x3876bc[_0x063d('0x5d')],null))[_0x063d('0x24')](respondWithResult(_0x2634a3,null))[_0x063d('0x4b')](handleError(_0x2634a3,null));};exports[_0x063d('0x25')]=function(_0x105aea,_0x6d7503){return db[_0x063d('0x47')][_0x063d('0x2e')]({'where':{'id':_0x105aea[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x6d7503,null))[_0x063d('0x24')](removeEntity(_0x6d7503,null))[_0x063d('0x4b')](handleError(_0x6d7503,null));};exports[_0x063d('0x5f')]=function(_0x5dd5cc,_0x1ffdcb,_0x5b913b){var _0x2abc58={'raw':![],'where':{}};var _0x3faa00={};var _0x1cc0ed={'count':0x0,'rows':[]};return db[_0x063d('0x47')][_0x063d('0x60')]({'where':{'id':_0x5dd5cc['params']['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x1ffdcb,null))[_0x063d('0x24')](function(_0x22f7f0){if(_0x22f7f0){_0x3faa00[_0x063d('0x39')]=_['keys'](db[_0x063d('0x61')][_0x063d('0x33')]);_0x3faa00[_0x063d('0x36')]=_['keys'](_0x5dd5cc['query']);_0x3faa00[_0x063d('0x37')]=_[_0x063d('0x38')](_0x3faa00['model'],_0x3faa00[_0x063d('0x36')]);_0x2abc58[_0x063d('0x3a')]=_[_0x063d('0x38')](_0x3faa00[_0x063d('0x39')],qs[_0x063d('0x3b')](_0x5dd5cc['query']['fields']));_0x2abc58[_0x063d('0x3a')]=_0x2abc58[_0x063d('0x3a')][_0x063d('0x3c')]?_0x2abc58[_0x063d('0x3a')]:_0x3faa00[_0x063d('0x39')];if(!_0x5dd5cc[_0x063d('0x36')][_0x063d('0x3d')](_0x063d('0x3e'))){_0x2abc58[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x5dd5cc[_0x063d('0x36')]['limit']);_0x2abc58[_0x063d('0x1e')]=qs['offset'](_0x5dd5cc[_0x063d('0x36')][_0x063d('0x1e')]);}_0x2abc58['order']=qs[_0x063d('0x40')](_0x5dd5cc[_0x063d('0x36')][_0x063d('0x40')]);_0x2abc58[_0x063d('0x41')]=qs[_0x063d('0x37')](_[_0x063d('0x42')](_0x5dd5cc[_0x063d('0x36')],_0x3faa00['filters']));_0x2abc58[_0x063d('0x41')][_0x063d('0x62')]=_0x22f7f0['id'];if(_0x5dd5cc[_0x063d('0x36')]['filter']){_0x2abc58[_0x063d('0x41')]=_[_0x063d('0x44')](_0x2abc58[_0x063d('0x41')],{'$or':_['map'](_0x2abc58[_0x063d('0x3a')],function(_0x2b257f){var _0x1a5a59={};_0x1a5a59[_0x2b257f]={'$like':'%'+_0x5dd5cc['query'][_0x063d('0x43')]+'%'};return _0x1a5a59;})});}_0x2abc58=_[_0x063d('0x44')]({},_0x2abc58,_0x5dd5cc[_0x063d('0x46')]);return db['CmHopper']['count']({'where':_0x2abc58[_0x063d('0x41')]})['then'](function(_0x363212){_0x1cc0ed['count']=_0x363212;if(_0x5dd5cc[_0x063d('0x36')][_0x063d('0x4e')]){_0x2abc58[_0x063d('0x4f')]=[{'all':!![]}];}return db[_0x063d('0x61')][_0x063d('0x49')](_0x2abc58);})[_0x063d('0x24')](function(_0x1c34b1){_0x1cc0ed['rows']=_0x1c34b1;return _0x1cc0ed;});}})[_0x063d('0x24')](respondWithFilteredResult(_0x1ffdcb,_0x2abc58))[_0x063d('0x4b')](handleError(_0x1ffdcb,null));};exports[_0x063d('0x63')]=function(_0x26053b,_0x133a48,_0x46857d){var _0x1b1968={'raw':!![],'where':{}};var _0x1ca269={};var _0x13a768={'count':0x0,'rows':[]};return db[_0x063d('0x47')]['findOne']({'where':{'id':_0x26053b[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x133a48,null))['then'](function(_0x4bb461){if(_0x4bb461){_0x1ca269[_0x063d('0x39')]=_[_0x063d('0x35')](db[_0x063d('0x64')][_0x063d('0x33')]);_0x1ca269[_0x063d('0x36')]=_[_0x063d('0x35')](_0x26053b[_0x063d('0x36')]);_0x1ca269['filters']=_['intersection'](_0x1ca269['model'],_0x1ca269['query']);_0x1b1968[_0x063d('0x3a')]=_[_0x063d('0x38')](_0x1ca269[_0x063d('0x39')],qs['fields'](_0x26053b[_0x063d('0x36')][_0x063d('0x3b')]));_0x1b1968['attributes']=_0x1b1968['attributes'][_0x063d('0x3c')]?_0x1b1968[_0x063d('0x3a')]:_0x1ca269[_0x063d('0x39')];if(!_0x26053b[_0x063d('0x36')][_0x063d('0x3d')](_0x063d('0x3e'))){_0x1b1968[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x26053b[_0x063d('0x36')][_0x063d('0x20')]);_0x1b1968[_0x063d('0x1e')]=qs[_0x063d('0x1e')](_0x26053b['query'][_0x063d('0x1e')]);}_0x1b1968['order']=qs['sort'](_0x26053b[_0x063d('0x36')][_0x063d('0x40')]);_0x1b1968[_0x063d('0x41')]=qs[_0x063d('0x37')](_['pick'](_0x26053b[_0x063d('0x36')],_0x1ca269[_0x063d('0x37')]));_0x1b1968[_0x063d('0x41')]['VoiceQueueId']=_0x4bb461['id'];if(_0x26053b['query']['filter']){_0x1b1968[_0x063d('0x41')]=_[_0x063d('0x44')](_0x1b1968[_0x063d('0x41')],{'$or':_[_0x063d('0x2a')](_0x1b1968[_0x063d('0x3a')],function(_0x56ce01){var _0x3976e9={};_0x3976e9[_0x56ce01]={'$like':'%'+_0x26053b['query'][_0x063d('0x43')]+'%'};return _0x3976e9;})});}_0x1b1968=_[_0x063d('0x44')]({},_0x1b1968,_0x26053b[_0x063d('0x46')]);return db[_0x063d('0x64')]['count']({'where':_0x1b1968[_0x063d('0x41')]})[_0x063d('0x24')](function(_0x2a2d12){_0x13a768['count']=_0x2a2d12;if(_0x26053b['query'][_0x063d('0x4e')]){_0x1b1968[_0x063d('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x063d('0x49')](_0x1b1968);})[_0x063d('0x24')](function(_0x20599a){_0x13a768[_0x063d('0x4a')]=_0x20599a;return _0x13a768;});}})[_0x063d('0x24')](respondWithFilteredResult(_0x133a48,_0x1b1968))[_0x063d('0x4b')](handleError(_0x133a48,null));};exports['getHopperFinals']=function(_0x551ec1,_0x3e9f2b,_0x13a6e5){var _0x44f300={'raw':!![],'where':{}};var _0x38f90e={};var _0x30d49c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x063d('0x60')]({'where':{'id':_0x551ec1[_0x063d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e9f2b,null))[_0x063d('0x24')](function(_0x3776f9){if(_0x3776f9){_0x38f90e[_0x063d('0x39')]=_['keys'](db['CmHopperFinal'][_0x063d('0x33')]);_0x38f90e[_0x063d('0x36')]=_[_0x063d('0x35')](_0x551ec1[_0x063d('0x36')]);_0x38f90e[_0x063d('0x37')]=_['intersection'](_0x38f90e['model'],_0x38f90e[_0x063d('0x36')]);_0x44f300[_0x063d('0x3a')]=_['intersection'](_0x38f90e[_0x063d('0x39')],qs[_0x063d('0x3b')](_0x551ec1['query']['fields']));_0x44f300[_0x063d('0x3a')]=_0x44f300[_0x063d('0x3a')][_0x063d('0x3c')]?_0x44f300[_0x063d('0x3a')]:_0x38f90e['model'];if(!_0x551ec1[_0x063d('0x36')][_0x063d('0x3d')]('nolimit')){_0x44f300[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x551ec1['query'][_0x063d('0x20')]);_0x44f300['offset']=qs['offset'](_0x551ec1[_0x063d('0x36')][_0x063d('0x1e')]);}_0x44f300[_0x063d('0x3f')]=qs[_0x063d('0x40')](_0x551ec1[_0x063d('0x36')][_0x063d('0x40')]);_0x44f300['where']=qs['filters'](_[_0x063d('0x42')](_0x551ec1['query'],_0x38f90e[_0x063d('0x37')]));_0x44f300[_0x063d('0x41')][_0x063d('0x62')]=_0x3776f9['id'];if(_0x551ec1[_0x063d('0x36')][_0x063d('0x43')]){_0x44f300['where']=_[_0x063d('0x44')](_0x44f300[_0x063d('0x41')],{'$or':_[_0x063d('0x2a')](_0x44f300[_0x063d('0x3a')],function(_0x50c08d){var _0xeaada7={};_0xeaada7[_0x50c08d]={'$like':'%'+_0x551ec1['query']['filter']+'%'};return _0xeaada7;})});}_0x44f300=_[_0x063d('0x44')]({},_0x44f300,_0x551ec1[_0x063d('0x46')]);return db[_0x063d('0x65')][_0x063d('0x48')]({'where':_0x44f300[_0x063d('0x41')]})[_0x063d('0x24')](function(_0x167bf5){_0x30d49c[_0x063d('0x48')]=_0x167bf5;if(_0x551ec1[_0x063d('0x36')][_0x063d('0x4e')]){_0x44f300['include']=[{'all':!![]}];}return db[_0x063d('0x65')][_0x063d('0x49')](_0x44f300);})[_0x063d('0x24')](function(_0x52cc35){_0x30d49c['rows']=_0x52cc35;return _0x30d49c;});}})[_0x063d('0x24')](respondWithFilteredResult(_0x3e9f2b,_0x44f300))[_0x063d('0x4b')](handleError(_0x3e9f2b,null));};exports[_0x063d('0x66')]=function(_0x5c3a5d,_0x290cb3,_0x10b949){var _0x10cd7a={'raw':!![],'where':{}};var _0x5262ef={};var _0xa29ed8={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x063d('0x60')]({'where':{'id':_0x5c3a5d[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x290cb3,null))[_0x063d('0x24')](function(_0x5934fd){if(_0x5934fd){_0x5262ef[_0x063d('0x39')]=_[_0x063d('0x35')](db[_0x063d('0x67')][_0x063d('0x33')]);_0x5262ef['query']=_[_0x063d('0x35')](_0x5c3a5d['query']);_0x5262ef[_0x063d('0x37')]=_[_0x063d('0x38')](_0x5262ef[_0x063d('0x39')],_0x5262ef[_0x063d('0x36')]);_0x10cd7a[_0x063d('0x3a')]=_[_0x063d('0x38')](_0x5262ef[_0x063d('0x39')],qs[_0x063d('0x3b')](_0x5c3a5d[_0x063d('0x36')][_0x063d('0x3b')]));_0x10cd7a['attributes']=_0x10cd7a[_0x063d('0x3a')]['length']?_0x10cd7a[_0x063d('0x3a')]:_0x5262ef[_0x063d('0x39')];if(!_0x5c3a5d[_0x063d('0x36')][_0x063d('0x3d')](_0x063d('0x3e'))){_0x10cd7a[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x5c3a5d['query']['limit']);_0x10cd7a[_0x063d('0x1e')]=qs[_0x063d('0x1e')](_0x5c3a5d[_0x063d('0x36')]['offset']);}_0x10cd7a['order']=qs[_0x063d('0x40')](_0x5c3a5d[_0x063d('0x36')][_0x063d('0x40')]);_0x10cd7a[_0x063d('0x41')]=qs[_0x063d('0x37')](_[_0x063d('0x42')](_0x5c3a5d[_0x063d('0x36')],_0x5262ef[_0x063d('0x37')]));_0x10cd7a['where']['VoiceQueueId']=_0x5934fd['id'];if(_0x5c3a5d[_0x063d('0x36')][_0x063d('0x43')]){_0x10cd7a[_0x063d('0x41')]=_[_0x063d('0x44')](_0x10cd7a[_0x063d('0x41')],{'$or':_[_0x063d('0x2a')](_0x10cd7a[_0x063d('0x3a')],function(_0x3a901b){var _0x5bd082={};_0x5bd082[_0x3a901b]={'$like':'%'+_0x5c3a5d[_0x063d('0x36')][_0x063d('0x43')]+'%'};return _0x5bd082;})});}_0x10cd7a=_[_0x063d('0x44')]({},_0x10cd7a,_0x5c3a5d['options']);return db[_0x063d('0x67')][_0x063d('0x48')]({'where':_0x10cd7a['where']})['then'](function(_0xaf74e5){_0xa29ed8[_0x063d('0x48')]=_0xaf74e5;if(_0x5c3a5d[_0x063d('0x36')][_0x063d('0x4e')]){_0x10cd7a[_0x063d('0x4f')]=[{'all':!![]}];}return db[_0x063d('0x67')][_0x063d('0x49')](_0x10cd7a);})[_0x063d('0x24')](function(_0x14f5d1){_0xa29ed8[_0x063d('0x4a')]=_0x14f5d1;return _0xa29ed8;});}})[_0x063d('0x24')](respondWithFilteredResult(_0x290cb3,_0x10cd7a))['catch'](handleError(_0x290cb3,null));};exports[_0x063d('0x68')]=function(_0x1e9ae8,_0x3b5979,_0x1f8d0c){var _0x4d266f={};var _0x49f817={};var _0x5dd80f;var _0x4b9d64;return db[_0x063d('0x47')][_0x063d('0x60')]({'where':{'id':_0x1e9ae8[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x3b5979,null))[_0x063d('0x24')](function(_0x493df3){if(_0x493df3){_0x5dd80f=_0x493df3;_0x49f817['model']=_[_0x063d('0x35')](db[_0x063d('0x69')]['rawAttributes']);_0x49f817[_0x063d('0x36')]=_[_0x063d('0x35')](_0x1e9ae8[_0x063d('0x36')]);_0x49f817[_0x063d('0x37')]=_[_0x063d('0x38')](_0x49f817[_0x063d('0x39')],_0x49f817[_0x063d('0x36')]);_0x4d266f['attributes']=_[_0x063d('0x38')](_0x49f817[_0x063d('0x39')],qs[_0x063d('0x3b')](_0x1e9ae8[_0x063d('0x36')][_0x063d('0x3b')]));_0x4d266f[_0x063d('0x3a')]=_0x4d266f['attributes']['length']?_0x4d266f[_0x063d('0x3a')]:_0x49f817[_0x063d('0x39')];_0x4d266f['order']=qs['sort'](_0x1e9ae8[_0x063d('0x36')][_0x063d('0x40')]);_0x4d266f[_0x063d('0x41')]=qs[_0x063d('0x37')](_[_0x063d('0x42')](_0x1e9ae8[_0x063d('0x36')],_0x49f817['filters']));if(_0x1e9ae8[_0x063d('0x36')][_0x063d('0x43')]){_0x4d266f['where']=_['merge'](_0x4d266f[_0x063d('0x41')],{'$or':_[_0x063d('0x2a')](_0x4d266f[_0x063d('0x3a')],function(_0x5ba48f){var _0x19eaa8={};_0x19eaa8[_0x5ba48f]={'$like':'%'+_0x1e9ae8['query'][_0x063d('0x43')]+'%'};return _0x19eaa8;})});}_0x4d266f=_[_0x063d('0x44')]({},_0x4d266f,_0x1e9ae8[_0x063d('0x46')]);return _0x5dd80f[_0x063d('0x68')](_0x4d266f);}})[_0x063d('0x24')](function(_0x199c91){if(_0x199c91){_0x4b9d64=_0x199c91[_0x063d('0x3c')];if(!_0x1e9ae8[_0x063d('0x36')][_0x063d('0x3d')](_0x063d('0x3e'))){_0x4d266f[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x1e9ae8[_0x063d('0x36')][_0x063d('0x20')]);_0x4d266f['offset']=qs[_0x063d('0x1e')](_0x1e9ae8[_0x063d('0x36')]['offset']);}return _0x5dd80f['getTeams'](_0x4d266f);}})[_0x063d('0x24')](function(_0x1e5b30){if(_0x1e5b30){return _0x1e5b30?{'count':_0x4b9d64,'rows':_0x1e5b30}:null;}})[_0x063d('0x24')](respondWithResult(_0x3b5979,null))[_0x063d('0x4b')](handleError(_0x3b5979,null));};exports[_0x063d('0x6a')]=function(_0x5f5205,_0x1665d7,_0x1b6724){var _0x244123=_0x5f5205[_0x063d('0x5d')][_0x063d('0x6b')];var _0x743641=_['map'](_0x244123,'id');return db[_0x063d('0x69')][_0x063d('0x49')]({'where':{'id':_0x743641},'attributes':['id'],'include':[{'model':db[_0x063d('0x6c')],'as':_0x063d('0x6d'),'attributes':['id',_0x063d('0x2f'),_0x063d('0x6e'),'voicePause',_0x063d('0x6f')],'raw':!![]}]})[_0x063d('0x24')](function(_0x4e6bdb){if(_0x4e6bdb){var _0x3b7b03=_[_0x063d('0x70')](_0x4e6bdb,function(_0xa3cdc9){var _0x46b5a2=_0xa3cdc9[_0x063d('0x26')]({'plain':!![]});_0x46b5a2[_0x063d('0x6d')][_0x063d('0x71')](function(_0x202138){_0x202138[_0x063d('0x72')]=_[_0x063d('0x2e')](_0x244123,{'id':_0x46b5a2['id']})['penalty'];});return _0x46b5a2[_0x063d('0x6d')];});return db[_0x063d('0x47')]['find']({'where':{'id':_0x5f5205[_0x063d('0x4d')]['id']}})['then'](function(_0x5db56a){return db['sequelize'][_0x063d('0x73')](function(_0x44c9dc){return _0x5db56a[_0x063d('0x6a')](_0x743641,{'transaction':_0x44c9dc})[_0x063d('0x24')](function(){return BPromise[_0x063d('0x74')](_0x244123,function(_0x54c751){return db[_0x063d('0x75')]['upsert']({'TeamId':_0x54c751['id'],'VoiceQueueId':_0x5f5205[_0x063d('0x4d')]['id'],'penalty':_0x54c751[_0x063d('0x72')]},{'transaction':_0x44c9dc});});})[_0x063d('0x24')](function(){return BPromise[_0x063d('0x74')](_0x3b7b03,function(_0x5d0b55){return db['UserVoiceQueue'][_0x063d('0x76')]({'where':{'UserId':_0x5d0b55['id'],'VoiceQueueId':_0x5f5205[_0x063d('0x4d')]['id']},'defaults':{'penalty':_0x5d0b55[_0x063d('0x72')]},'transaction':_0x44c9dc});});})[_0x063d('0x24')](function(){return BPromise[_0x063d('0x74')](_[_0x063d('0x43')](_0x3b7b03,{'online':!![]}),function(_0x442bb1){return db['UserVoiceQueueRt']['upsert']({'membername':_0x442bb1[_0x063d('0x2f')],'UserId':_0x442bb1['id'],'queue_name':_0x5db56a['name'],'VoiceQueueId':_0x5db56a['id'],'interface':_[_0x063d('0x77')](_0x442bb1[_0x063d('0x6f')])?util[_0x063d('0x78')](_0x063d('0x79'),_0x442bb1[_0x063d('0x2f')]):_0x442bb1[_0x063d('0x6f')],'paused':_0x442bb1[_0x063d('0x7a')]||![],'penalty':_0x442bb1[_0x063d('0x72')]},{'transaction':_0x44c9dc});});})[_0x063d('0x24')](function(){_0x3b7b03[_0x063d('0x71')](function(_0x1e70b3){socket[_0x063d('0x7b')]('userVoiceQueue:save',{'UserId':_0x1e70b3['id'],'VoiceQueueId':_0x5db56a['id']});});});});});}})[_0x063d('0x24')](respondWithStatusCode(_0x1665d7,null))[_0x063d('0x4b')](handleError(_0x1665d7,null));};exports[_0x063d('0x7c')]=function(_0xdaed2a,_0x331b2a,_0x41b844){return db[_0x063d('0x69')][_0x063d('0x49')]({'where':{'id':_0xdaed2a['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x063d('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x063d('0x24')](handleEntityNotFound(_0x331b2a,null))[_0x063d('0x24')](function(_0x1d6dbb){var _0x31e74d=_[_0x063d('0x2a')](_0x1d6dbb,'id');var _0x458748=[];var _0x278f0a=[];var _0x3c0af=squel[_0x063d('0x7d')]();_0x3c0af[_0x063d('0x7e')](_0x063d('0x7f'))[_0x063d('0x80')](_0x063d('0x81'),'tq')[_0x063d('0x82')](_0x063d('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x063d('0x84'),_0xdaed2a['params']['id']);for(var _0xe4f1cd=0x0;_0xe4f1cd<_0x1d6dbb[_0x063d('0x3c')];_0xe4f1cd+=0x1){let _0x3b6303=_0x1d6dbb[_0xe4f1cd];for(var _0x3085e0=0x0;_0x3085e0<_0x3b6303['Agents'][_0x063d('0x3c')];_0x3085e0+=0x1){let _0x4e5a2f=_0x3b6303[_0x063d('0x6d')][_0x3085e0];var _0x1bd4e3=_0x3c0af[_0x063d('0x5a')]();_0x1bd4e3['where'](_0x063d('0x85'),_0x4e5a2f['id']);_0x278f0a[_0x063d('0x86')](db[_0x063d('0x87')][_0x063d('0x36')](_0x1bd4e3[_0x063d('0x88')](),{'type':db['sequelize'][_0x063d('0x89')][_0x063d('0x8a')]})[_0x063d('0x24')](function(_0x37f3f0){if(_0x37f3f0[_0x063d('0x3c')]===0x1){return _0x4e5a2f['id'];}else{var _0x1d6ec6=_[_0x063d('0x8b')](_['map'](_0x37f3f0,'TeamId'),function(_0x902dc1){return _[_0x063d('0x2c')](_0x31e74d,_0x902dc1);});if(_0x1d6ec6){return _0x4e5a2f['id'];}}}));}}return BPromise['all'](_0x278f0a)[_0x063d('0x24')](function(_0x520892){_0x458748=_(_0x458748)[_0x063d('0x8c')](_0x520892)['compact']()[_0x063d('0x2b')]();return db[_0x063d('0x47')][_0x063d('0x2e')]({'where':{'id':_0xdaed2a[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](function(_0x386f57){return db[_0x063d('0x87')][_0x063d('0x73')](function(_0x54db06){return _0x386f57[_0x063d('0x7c')](_0xdaed2a['query'][_0x063d('0x8d')],{'transaction':_0x54db06})[_0x063d('0x24')](function(){if(!_[_0x063d('0x8e')](_0x458748)){return _0x386f57['removeAgents'](_0x458748,{'transaction':_0x54db06})[_0x063d('0x24')](function(){return db[_0x063d('0x8f')]['destroy']({'where':{'VoiceQueueId':_0xdaed2a[_0x063d('0x4d')]['id'],'UserId':_0x458748},'transaction':_0x54db06});});}})[_0x063d('0x24')](function(){_0x458748[_0x063d('0x71')](function(_0x176aba){socket[_0x063d('0x7b')](_0x063d('0x90'),{'UserId':_0x176aba,'VoiceQueueId':_0x386f57['id']});});});});});});})[_0x063d('0x24')](respondWithStatusCode(_0x331b2a,null))[_0x063d('0x4b')](handleError(_0x331b2a,null));};exports['addAgents']=function(_0x4311b6,_0x4feda7,_0x13d63c){var _0x1a3e12,_0x1416d2;return db[_0x063d('0x47')][_0x063d('0x2e')]({'where':{'id':_0x4311b6[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x4feda7,null))[_0x063d('0x24')](function(_0x2f6fd7){if(_0x2f6fd7){_0x1416d2=_0x2f6fd7;return _0x2f6fd7[_0x063d('0x91')](_0x4311b6[_0x063d('0x5d')][_0x063d('0x8d')],_[_0x063d('0x5e')](_0x4311b6[_0x063d('0x5d')],['ids','id'])||{})[_0x063d('0x92')](function(_0x1bfe06){for(var _0x6096b7=0x0;_0x6096b7<_0x4311b6[_0x063d('0x5d')]['ids'][_0x063d('0x3c')];_0x6096b7+=0x1){socket[_0x063d('0x7b')](_0x063d('0x93'),{'UserId':Number(_0x4311b6['body'][_0x063d('0x8d')][_0x6096b7]),'VoiceQueueId':Number(_0x4311b6[_0x063d('0x4d')]['id'])});}return _0x1bfe06;});}})[_0x063d('0x24')](function(_0x34c11d){_0x1a3e12=_0x34c11d||[];if(_0x1416d2){return db['User']['findAll']({'where':{'id':_0x4311b6[_0x063d('0x5d')][_0x063d('0x8d')]},'attributes':['id',_0x063d('0x2f'),_0x063d('0x6e'),_0x063d('0x7a'),_0x063d('0x6f')],'raw':!![]});}})[_0x063d('0x24')](function(_0x522575){if(!_['isEmpty'](_0x522575)){var _0x9362c8=[];for(var _0x2ccdb3=0x0;_0x2ccdb3<_0x522575[_0x063d('0x3c')];_0x2ccdb3++){if(_0x522575[_0x2ccdb3][_0x063d('0x6e')]){_0x9362c8[_0x063d('0x86')](db[_0x063d('0x8f')]['upsert']({'membername':_0x522575[_0x2ccdb3][_0x063d('0x2f')],'UserId':_0x522575[_0x2ccdb3]['id'],'queue_name':_0x1416d2[_0x063d('0x2f')],'VoiceQueueId':_0x1416d2['id'],'interface':_[_0x063d('0x77')](_0x522575[_0x2ccdb3][_0x063d('0x6f')])?util[_0x063d('0x78')]('SIP/%s',_0x522575[_0x2ccdb3][_0x063d('0x2f')]):_0x522575[_0x2ccdb3][_0x063d('0x6f')],'paused':_0x522575[_0x2ccdb3][_0x063d('0x7a')]||![],'penalty':_0x4311b6[_0x063d('0x5d')][_0x063d('0x72')]||0x0}));}}return BPromise[_0x063d('0x94')](_0x9362c8);}})['then'](function(){return _0x1a3e12;})['then'](respondWithResult(_0x4feda7,null))[_0x063d('0x4b')](handleError(_0x4feda7,null));};exports[_0x063d('0x95')]=function(_0x43e9f9,_0x336c1c,_0x5f1b63){return db[_0x063d('0x47')][_0x063d('0x2e')]({'where':{'id':_0x43e9f9[_0x063d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x336c1c,null))[_0x063d('0x24')](function(_0x1d7e76){if(_0x1d7e76){return _0x1d7e76[_0x063d('0x95')](_0x43e9f9[_0x063d('0x36')][_0x063d('0x8d')])[_0x063d('0x24')](function(){if(_['isArray'](_0x43e9f9['query'][_0x063d('0x8d')])){for(var _0x35540d=0x0;_0x35540d<_0x43e9f9[_0x063d('0x36')][_0x063d('0x8d')]['length'];_0x35540d+=0x1){socket[_0x063d('0x7b')](_0x063d('0x90'),{'UserId':Number(_0x43e9f9['query'][_0x063d('0x8d')][_0x35540d]),'VoiceQueueId':Number(_0x43e9f9['params']['id'])});}}else{socket[_0x063d('0x7b')](_0x063d('0x90'),{'UserId':Number(_0x43e9f9[_0x063d('0x36')][_0x063d('0x8d')]),'VoiceQueueId':Number(_0x43e9f9[_0x063d('0x4d')]['id'])});}});}})[_0x063d('0x24')](function(_0x4160b6){return db[_0x063d('0x8f')]['destroy']({'where':{'VoiceQueueId':_0x43e9f9[_0x063d('0x4d')]['id'],'UserId':_0x43e9f9[_0x063d('0x36')]['ids']}})[_0x063d('0x24')](function(){return _0x4160b6;});})['then'](respondWithStatusCode(_0x336c1c,null))[_0x063d('0x4b')](handleError(_0x336c1c,null));};exports[_0x063d('0x96')]=function(_0x294df6,_0x342a0b,_0x5cfa4d){var _0xcba12e={};var _0x3fec41={};var _0x239623;var _0x17e8d4;return db[_0x063d('0x47')][_0x063d('0x60')]({'where':{'id':_0x294df6[_0x063d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x342a0b,null))['then'](function(_0x7df12b){if(_0x7df12b){_0x239623=_0x7df12b;_0x3fec41[_0x063d('0x39')]=_['keys'](db[_0x063d('0x6c')]['rawAttributes']);_0x3fec41[_0x063d('0x36')]=_[_0x063d('0x35')](_0x294df6[_0x063d('0x36')]);_0x3fec41[_0x063d('0x37')]=_[_0x063d('0x38')](_0x3fec41[_0x063d('0x39')],_0x3fec41[_0x063d('0x36')]);_0xcba12e[_0x063d('0x3a')]=_['intersection'](_0x3fec41[_0x063d('0x39')],qs[_0x063d('0x3b')](_0x294df6[_0x063d('0x36')][_0x063d('0x3b')]));_0xcba12e[_0x063d('0x3a')]=_0xcba12e[_0x063d('0x3a')][_0x063d('0x3c')]?_0xcba12e[_0x063d('0x3a')]:_0x3fec41['model'];_0xcba12e['order']=qs['sort'](_0x294df6[_0x063d('0x36')][_0x063d('0x40')]);_0xcba12e[_0x063d('0x41')]=qs[_0x063d('0x37')](_[_0x063d('0x42')](_0x294df6[_0x063d('0x36')],_0x3fec41['filters']));if(_0x294df6[_0x063d('0x36')]['filter']){_0xcba12e[_0x063d('0x41')]=_['merge'](_0xcba12e[_0x063d('0x41')],{'$or':_[_0x063d('0x2a')](_0xcba12e[_0x063d('0x3a')],function(_0x1ee20d){var _0x57551b={};_0x57551b[_0x1ee20d]={'$like':'%'+_0x294df6[_0x063d('0x36')]['filter']+'%'};return _0x57551b;})});}_0xcba12e=_['merge']({},_0xcba12e,_0x294df6[_0x063d('0x46')]);return _0x239623['getAgents'](_0xcba12e);}})['then'](function(_0x476179){if(_0x476179){_0x17e8d4=_0x476179[_0x063d('0x3c')];if(!_0x294df6['query']['hasOwnProperty'](_0x063d('0x3e'))){_0xcba12e['limit']=qs[_0x063d('0x20')](_0x294df6[_0x063d('0x36')][_0x063d('0x20')]);_0xcba12e[_0x063d('0x1e')]=qs[_0x063d('0x1e')](_0x294df6[_0x063d('0x36')][_0x063d('0x1e')]);}return _0x239623['getAgents'](_0xcba12e);}})['then'](function(_0x241d0e){if(_0x241d0e){return _0x241d0e?{'count':_0x17e8d4,'rows':_0x241d0e}:null;}})[_0x063d('0x24')](respondWithResult(_0x342a0b,null))['catch'](handleError(_0x342a0b,null));};exports[_0x063d('0x97')]=function(_0x263fa0,_0x3b9bea,_0x29eb7a){var _0x2cad06={};var _0x243c04={};var _0xbd6a4f;var _0xdb3af1;return db['VoiceQueue'][_0x063d('0x60')]({'where':{'id':_0x263fa0[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x3b9bea,null))['then'](function(_0x4380f2){if(_0x4380f2){_0xbd6a4f=_0x4380f2;_0x243c04['model']=_[_0x063d('0x35')](db[_0x063d('0x8f')][_0x063d('0x33')]);_0x243c04[_0x063d('0x36')]=_[_0x063d('0x35')](_0x263fa0[_0x063d('0x36')]);_0x243c04['filters']=_[_0x063d('0x38')](_0x243c04[_0x063d('0x39')],_0x243c04[_0x063d('0x36')]);_0x2cad06['attributes']=_[_0x063d('0x38')](_0x243c04[_0x063d('0x39')],qs['fields'](_0x263fa0[_0x063d('0x36')][_0x063d('0x3b')]));_0x2cad06[_0x063d('0x3a')]=_0x2cad06['attributes'][_0x063d('0x3c')]?_0x2cad06[_0x063d('0x3a')]:_0x243c04['model'];_0x2cad06[_0x063d('0x3f')]=qs[_0x063d('0x40')](_0x263fa0[_0x063d('0x36')][_0x063d('0x40')]);_0x2cad06[_0x063d('0x41')]=qs['filters'](_[_0x063d('0x42')](_0x263fa0[_0x063d('0x36')],_0x243c04['filters']));if(_0x263fa0['query']['filter']){_0x2cad06[_0x063d('0x41')]=_['merge'](_0x2cad06[_0x063d('0x41')],{'$or':_['map'](_0x2cad06[_0x063d('0x3a')],function(_0x439894){var _0x19186c={};_0x19186c[_0x439894]={'$like':'%'+_0x263fa0[_0x063d('0x36')][_0x063d('0x43')]+'%'};return _0x19186c;})});}_0x2cad06=_[_0x063d('0x44')]({},_0x2cad06,_0x263fa0[_0x063d('0x46')]);return _0xbd6a4f[_0x063d('0x97')](_0x2cad06);}})[_0x063d('0x24')](function(_0x29566b){if(_0x29566b){_0xdb3af1=_0x29566b[_0x063d('0x3c')];if(!_0x263fa0[_0x063d('0x36')][_0x063d('0x3d')](_0x063d('0x3e'))){_0x2cad06[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x263fa0[_0x063d('0x36')][_0x063d('0x20')]);_0x2cad06[_0x063d('0x1e')]=qs[_0x063d('0x1e')](_0x263fa0[_0x063d('0x36')]['offset']);}return _0xbd6a4f[_0x063d('0x97')](_0x2cad06);}})[_0x063d('0x24')](function(_0x3f6177){return _0x3f6177?{'count':_0xdb3af1,'rows':_0x3f6177}:null;})[_0x063d('0x24')](respondWithResult(_0x3b9bea,null))[_0x063d('0x4b')](handleError(_0x3b9bea,null));};exports['getLists']=function(_0x4c0ee8,_0xac571,_0x199d8b){var _0x4e5ee8={};var _0x17dbae={};var _0x3e9c4a;var _0x231915;return db['VoiceQueue'][_0x063d('0x60')]({'where':{'id':_0x4c0ee8[_0x063d('0x4d')]['id']}})['then'](handleEntityNotFound(_0xac571,null))[_0x063d('0x24')](function(_0xcd4988){if(_0xcd4988){_0x3e9c4a=_0xcd4988;_0x17dbae[_0x063d('0x39')]=_['keys'](db[_0x063d('0x98')]['rawAttributes']);_0x17dbae[_0x063d('0x36')]=_[_0x063d('0x35')](_0x4c0ee8['query']);_0x17dbae[_0x063d('0x37')]=_[_0x063d('0x38')](_0x17dbae[_0x063d('0x39')],_0x17dbae[_0x063d('0x36')]);_0x4e5ee8[_0x063d('0x3a')]=_[_0x063d('0x38')](_0x17dbae['model'],qs[_0x063d('0x3b')](_0x4c0ee8[_0x063d('0x36')][_0x063d('0x3b')]));_0x4e5ee8[_0x063d('0x3a')]=_0x4e5ee8[_0x063d('0x3a')][_0x063d('0x3c')]?_0x4e5ee8[_0x063d('0x3a')]:_0x17dbae[_0x063d('0x39')];_0x4e5ee8[_0x063d('0x3f')]=qs[_0x063d('0x40')](_0x4c0ee8[_0x063d('0x36')][_0x063d('0x40')]);_0x4e5ee8['where']=qs['filters'](_[_0x063d('0x42')](_0x4c0ee8[_0x063d('0x36')],_0x17dbae['filters']));if(_0x4c0ee8['query'][_0x063d('0x43')]){_0x4e5ee8['where']=_[_0x063d('0x44')](_0x4e5ee8[_0x063d('0x41')],{'$or':_['map'](_0x4e5ee8[_0x063d('0x3a')],function(_0x4f8281){var _0x5daca9={};_0x5daca9[_0x4f8281]={'$like':'%'+_0x4c0ee8['query']['filter']+'%'};return _0x5daca9;})});}_0x4e5ee8=_[_0x063d('0x44')]({},_0x4e5ee8,_0x4c0ee8[_0x063d('0x46')]);return _0x3e9c4a['getLists'](_0x4e5ee8);}})[_0x063d('0x24')](function(_0x3b8141){if(_0x3b8141){_0x231915=_0x3b8141[_0x063d('0x3c')];if(!_0x4c0ee8[_0x063d('0x36')][_0x063d('0x3d')]('nolimit')){_0x4e5ee8[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x4c0ee8['query'][_0x063d('0x20')]);_0x4e5ee8[_0x063d('0x1e')]=qs[_0x063d('0x1e')](_0x4c0ee8[_0x063d('0x36')][_0x063d('0x1e')]);}return _0x3e9c4a['getLists'](_0x4e5ee8);}})[_0x063d('0x24')](function(_0x140496){if(_0x140496){return _0x140496?{'count':_0x231915,'rows':_0x140496}:null;}})[_0x063d('0x24')](respondWithResult(_0xac571,null))[_0x063d('0x4b')](handleError(_0xac571,null));};exports[_0x063d('0x99')]=function(_0x337926,_0x542932,_0x4ade69){var _0x5a5547,_0x3eb584;return db['VoiceQueue'][_0x063d('0x2e')]({'where':{'id':_0x337926[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x542932,null))[_0x063d('0x24')](function(_0x2ac094){if(_0x2ac094){_0x3eb584=_0x2ac094;return _0x2ac094[_0x063d('0x99')](_0x337926['body'][_0x063d('0x8d')],_['omit'](_0x337926[_0x063d('0x5d')],['ids','id'])||{});}return null;})[_0x063d('0x92')](function(_0x553fe1){var _0x146141;_0x5a5547=_0x553fe1||[];var _0x2e9160=[];if(_0x553fe1){for(var _0x49bd33=0x0;_0x49bd33<_0x553fe1['length'];_0x49bd33+=0x1){var _0x2d316e=_0x553fe1[_0x49bd33]['get']({'plain':!![]});_0x3eb584[_0x063d('0x9a')]=_0x337926['body']['dialCheckDuplicateType']?_0x337926['body']['dialCheckDuplicateType']:_0x3eb584['dialCheckDuplicateType'];switch(_0x3eb584['dialCheckDuplicateType']){case _0x063d('0x9b'):_0x146141=squel[_0x063d('0x9c')]()['into'](_0x063d('0x9d'))[_0x063d('0x9e')]([_0x063d('0x9f'),_0x063d('0xa0'),'ContactId',_0x063d('0xa1'),_0x063d('0x62'),'createdAt',_0x063d('0x5c')],squel[_0x063d('0x7d')]()['field'](_0x063d('0x9f'),_0x063d('0x9f'))['field']('NOW()',_0x063d('0xa0'))[_0x063d('0x7e')]('id',_0x063d('0xa2'))[_0x063d('0x7e')](_0x2d316e[_0x063d('0xa3')][_0x063d('0x88')](),_0x063d('0xa1'))[_0x063d('0x7e')](_0x337926['params']['id']['toString'](),_0x063d('0x62'))[_0x063d('0x7e')](_0x063d('0xa4'),'createdAt')[_0x063d('0x7e')](_0x063d('0xa4'),_0x063d('0x5c'))[_0x063d('0x80')](_0x063d('0xa5'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x2d316e[_0x063d('0xa3')][_0x063d('0x88')]())[_0x063d('0x41')](_0x063d('0xa6'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x063d('0x7d')]()[_0x063d('0x7e')](_0x063d('0xa7'))[_0x063d('0x80')](_0x063d('0xa8'))[_0x063d('0x41')]('VoiceQueueId\x20=\x20?',_0x337926[_0x063d('0x4d')]['id'][_0x063d('0x88')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x063d('0x7d')]()[_0x063d('0x7e')](_0x063d('0xa9'))['from'](_0x063d('0x9d'))['where'](_0x063d('0x84'),_0x337926[_0x063d('0x4d')]['id'][_0x063d('0x88')]())))['toString']();break;case _0x063d('0xaa'):_0x146141=squel[_0x063d('0x9c')]()[_0x063d('0xab')]('cm_hopper')[_0x063d('0x9e')]([_0x063d('0x9f'),_0x063d('0xa0'),'ContactId',_0x063d('0xa1'),_0x063d('0x62'),'createdAt',_0x063d('0x5c')],squel[_0x063d('0x7d')]()[_0x063d('0x7e')](_0x063d('0x9f'),_0x063d('0x9f'))[_0x063d('0x7e')](_0x063d('0xa4'),_0x063d('0xa0'))[_0x063d('0x7e')]('id',_0x063d('0xa2'))['field'](_0x2d316e[_0x063d('0xa3')][_0x063d('0x88')](),'ListId')[_0x063d('0x7e')](_0x337926[_0x063d('0x4d')]['id'][_0x063d('0x88')](),_0x063d('0x62'))[_0x063d('0x7e')](_0x063d('0xa4'),_0x063d('0x5b'))[_0x063d('0x7e')]('NOW()',_0x063d('0x5c'))['from']('cm_contacts')[_0x063d('0x41')](_0x063d('0xac'))[_0x063d('0x41')](_0x063d('0xad'),_0x2d316e['CmListId'][_0x063d('0x88')]())[_0x063d('0x41')](_0x063d('0xa6'))['where'](_0x063d('0xae'),squel[_0x063d('0x7d')]()[_0x063d('0x7e')]('COALESCE(phone,\x27\x27)')[_0x063d('0x80')](_0x063d('0x9d'))[_0x063d('0x41')](_0x063d('0x84'),_0x337926[_0x063d('0x4d')]['id'][_0x063d('0x88')]())))[_0x063d('0x88')]();break;default:_0x146141=squel[_0x063d('0x9c')]()[_0x063d('0xab')](_0x063d('0x9d'))[_0x063d('0x9e')]([_0x063d('0x9f'),_0x063d('0xa0'),_0x063d('0xa2'),_0x063d('0xa1'),_0x063d('0x62'),_0x063d('0x5b'),'updatedAt'],squel['select']()[_0x063d('0x7e')](_0x063d('0x9f'),_0x063d('0x9f'))[_0x063d('0x7e')]('NOW()',_0x063d('0xa0'))[_0x063d('0x7e')]('id',_0x063d('0xa2'))[_0x063d('0x7e')](_0x2d316e['CmListId']['toString'](),_0x063d('0xa1'))[_0x063d('0x7e')](_0x337926[_0x063d('0x4d')]['id'][_0x063d('0x88')](),_0x063d('0x62'))[_0x063d('0x7e')](_0x063d('0xa4'),'createdAt')[_0x063d('0x7e')]('NOW()',_0x063d('0x5c'))[_0x063d('0x80')]('cm_contacts')[_0x063d('0x41')](_0x063d('0xac'))[_0x063d('0x41')](_0x063d('0xad'),_0x2d316e['CmListId'][_0x063d('0x88')]())[_0x063d('0x41')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x2e9160['push'](db['sequelize'][_0x063d('0x36')](_0x146141));}return BPromise[_0x063d('0x94')](_0x2e9160);}})[_0x063d('0x24')](function(){return _0x5a5547;})['then'](respondWithResult(_0x542932,null))[_0x063d('0x4b')](handleError(_0x542932,null));};exports[_0x063d('0xaf')]=function(_0x15fdac,_0x444bc6,_0x5efc60){return db['VoiceQueue'][_0x063d('0x2e')]({'where':{'id':_0x15fdac['params']['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x444bc6,null))[_0x063d('0x24')](function(_0x2f9c17){if(_0x2f9c17){return _0x2f9c17[_0x063d('0xaf')](_0x15fdac['query']['ids']);}})[_0x063d('0x24')](function(_0x574264){if(_0x574264){return db[_0x063d('0x61')]['destroy']({'where':{'ListId':_0x15fdac[_0x063d('0x36')][_0x063d('0x8d')],'VoiceQueueId':_0x15fdac['params']['id']}})[_0x063d('0x24')](function(){return _0x574264;});}})['then'](respondWithStatusCode(_0x444bc6,null))['catch'](handleError(_0x444bc6,null));};exports[_0x063d('0xb0')]=function(_0x402192,_0x255401,_0x23373){var _0x2ef6ba={};var _0x13dcfb={};var _0x3fc443;var _0x50a7ea;return db[_0x063d('0x47')][_0x063d('0x60')]({'where':{'id':_0x402192[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x255401,null))[_0x063d('0x24')](function(_0x28c9d6){if(_0x28c9d6){_0x3fc443=_0x28c9d6;_0x13dcfb[_0x063d('0x39')]=_[_0x063d('0x35')](db['CmList'][_0x063d('0x33')]);_0x13dcfb[_0x063d('0x36')]=_[_0x063d('0x35')](_0x402192[_0x063d('0x36')]);_0x13dcfb[_0x063d('0x37')]=_['intersection'](_0x13dcfb[_0x063d('0x39')],_0x13dcfb[_0x063d('0x36')]);_0x2ef6ba[_0x063d('0x3a')]=_['intersection'](_0x13dcfb[_0x063d('0x39')],qs[_0x063d('0x3b')](_0x402192['query'][_0x063d('0x3b')]));_0x2ef6ba[_0x063d('0x3a')]=_0x2ef6ba[_0x063d('0x3a')]['length']?_0x2ef6ba['attributes']:_0x13dcfb[_0x063d('0x39')];_0x2ef6ba['order']=qs[_0x063d('0x40')](_0x402192[_0x063d('0x36')]['sort']);_0x2ef6ba[_0x063d('0x41')]=qs[_0x063d('0x37')](_[_0x063d('0x42')](_0x402192[_0x063d('0x36')],_0x13dcfb['filters']));if(_0x402192[_0x063d('0x36')][_0x063d('0x43')]){_0x2ef6ba[_0x063d('0x41')]=_[_0x063d('0x44')](_0x2ef6ba['where'],{'$or':_[_0x063d('0x2a')](_0x2ef6ba[_0x063d('0x3a')],function(_0x4b4a8c){var _0x2d42fe={};_0x2d42fe[_0x4b4a8c]={'$like':'%'+_0x402192['query'][_0x063d('0x43')]+'%'};return _0x2d42fe;})});}_0x2ef6ba=_[_0x063d('0x44')]({},_0x2ef6ba,_0x402192['options']);return _0x3fc443[_0x063d('0xb0')](_0x2ef6ba);}})[_0x063d('0x24')](function(_0x50eed3){if(_0x50eed3){_0x50a7ea=_0x50eed3[_0x063d('0x3c')];if(!_0x402192[_0x063d('0x36')][_0x063d('0x3d')](_0x063d('0x3e'))){_0x2ef6ba[_0x063d('0x20')]=qs[_0x063d('0x20')](_0x402192['query']['limit']);_0x2ef6ba[_0x063d('0x1e')]=qs[_0x063d('0x1e')](_0x402192[_0x063d('0x36')][_0x063d('0x1e')]);}return _0x3fc443[_0x063d('0xb0')](_0x2ef6ba);}})['then'](function(_0x408c37){if(_0x408c37){return _0x408c37?{'count':_0x50a7ea,'rows':_0x408c37}:null;}})[_0x063d('0x24')](respondWithResult(_0x255401,null))[_0x063d('0x4b')](handleError(_0x255401,null));};exports[_0x063d('0xb1')]=function(_0x483b08,_0x494ac4,_0x1ff6a0){var _0x36d5f4,_0x597a5c;return db[_0x063d('0x47')][_0x063d('0x2e')]({'where':{'id':_0x483b08[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x494ac4,null))[_0x063d('0x24')](function(_0x2beee6){if(_0x2beee6){_0x597a5c=_0x2beee6;return _0x2beee6['addBlackLists'](_0x483b08[_0x063d('0x5d')][_0x063d('0x8d')],_['omit'](_0x483b08['body'],[_0x063d('0x8d'),'id'])||{});}return null;})['spread'](function(_0x1ea21a){var _0x1c3d4e;_0x36d5f4=_0x1ea21a||[];var _0x43daff=[];if(_0x1ea21a){for(var _0x1f9244=0x0;_0x1f9244<_0x1ea21a['length'];_0x1f9244+=0x1){var _0x3a7b1e=_0x1ea21a[_0x1f9244]['get']({'plain':!![]});_0x1c3d4e=squel[_0x063d('0x9c')]()[_0x063d('0xab')](_0x063d('0xb2'))[_0x063d('0x9e')]([_0x063d('0x9f'),_0x063d('0xa2'),'ListId',_0x063d('0x62'),_0x063d('0x5b'),'updatedAt'],squel[_0x063d('0x7d')]()['field'](_0x063d('0x9f'),_0x063d('0x9f'))[_0x063d('0x7e')]('id','ContactId')[_0x063d('0x7e')](_0x3a7b1e[_0x063d('0xa3')]['toString'](),_0x063d('0xa1'))[_0x063d('0x7e')](_0x483b08[_0x063d('0x4d')]['id'][_0x063d('0x88')](),_0x063d('0x62'))[_0x063d('0x7e')](_0x063d('0xa4'),'createdAt')[_0x063d('0x7e')]('NOW()','updatedAt')[_0x063d('0x80')](_0x063d('0xa5'))[_0x063d('0x41')](_0x063d('0xac'))[_0x063d('0x41')](_0x063d('0xad'),_0x3a7b1e[_0x063d('0xa3')][_0x063d('0x88')]())[_0x063d('0x41')](_0x063d('0xa6')))['toString']();_0x43daff[_0x063d('0x86')](db[_0x063d('0x87')]['query'](_0x1c3d4e));}return BPromise[_0x063d('0x94')](_0x43daff);}})[_0x063d('0x24')](function(){return _0x36d5f4;})[_0x063d('0x24')](respondWithResult(_0x494ac4,null))[_0x063d('0x4b')](handleError(_0x494ac4,null));};exports[_0x063d('0xb3')]=function(_0x4522e0,_0x2ef089,_0x2ddccd){return db[_0x063d('0x47')][_0x063d('0x2e')]({'where':{'id':_0x4522e0[_0x063d('0x4d')]['id']}})[_0x063d('0x24')](handleEntityNotFound(_0x2ef089,null))[_0x063d('0x24')](function(_0x10b28e){if(_0x10b28e){return _0x10b28e[_0x063d('0xb3')](_0x4522e0[_0x063d('0x36')][_0x063d('0x8d')]);}})[_0x063d('0x24')](function(_0x172634){if(_0x172634){return db[_0x063d('0x67')][_0x063d('0x25')]({'where':{'ListId':_0x4522e0[_0x063d('0x36')]['ids'],'VoiceQueueId':_0x4522e0[_0x063d('0x4d')]['id']}})['then'](function(){return _0x172634;});}})[_0x063d('0x24')](respondWithStatusCode(_0x2ef089,null))[_0x063d('0x4b')](handleError(_0x2ef089,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 7e81c4b..925140d 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 _0x98bb=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x185133,_0x29a472){var _0x862f7f=function(_0x25ea87){while(--_0x25ea87){_0x185133['push'](_0x185133['shift']());}};_0x862f7f(++_0x29a472);}(_0x98bb,0x1f0));var _0xb98b=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x98bb[_0x5c3c0b];return _0x52ecd2;};'use strict';var EventEmitter=require(_0xb98b('0x0'));var VoiceQueue=require(_0xb98b('0x1'))['db'][_0xb98b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb98b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb98b('0x4'),'afterDestroy':_0xb98b('0x5')};function emitEvent(_0x557aa6){return function(_0x48586,_0x273e41,_0x5859dc){VoiceQueueEvents[_0xb98b('0x6')](_0x557aa6+':'+_0x48586['id'],_0x48586);VoiceQueueEvents[_0xb98b('0x6')](_0x557aa6,_0x48586);_0x5859dc(null);};}for(var e in events){if(events[_0xb98b('0x7')](e)){var event=events[e];VoiceQueue[_0xb98b('0x8')](e,emitEvent(event));}}module[_0xb98b('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x15a1=['setMaxListeners','save','update','hook','exports'];(function(_0x1fa381,_0x758c2a){var _0x47eefe=function(_0x127f8c){while(--_0x127f8c){_0x1fa381['push'](_0x1fa381['shift']());}};_0x47eefe(++_0x758c2a);}(_0x15a1,0x186));var _0x115a=function(_0x6cf3d9,_0x6c18b0){_0x6cf3d9=_0x6cf3d9-0x0;var _0x248438=_0x15a1[_0x6cf3d9];return _0x248438;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x115a('0x0')](0x0);var events={'afterCreate':_0x115a('0x1'),'afterUpdate':_0x115a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5e889e){return function(_0x379e28,_0x9602c1,_0x3ab638){VoiceQueueEvents['emit'](_0x5e889e+':'+_0x379e28['id'],_0x379e28);VoiceQueueEvents['emit'](_0x5e889e,_0x379e28);_0x3ab638(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x115a('0x3')](e,emitEvent(event));}}module[_0x115a('0x4')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 04fb41f..706d1e5 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x55ca,0x126));var _0xa55c=function(_0xbb7389,_0x12b29d){_0xbb7389=_0xbb7389-0x0;var _0x12537b=_0x55ca[_0xbb7389];return _0x12537b;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x27cd7f,_0x504e29){var _0x3107ad=function(_0x538d1a){while(--_0x538d1a){_0x27cd7f['push'](_0x27cd7f['shift']());}};_0x3107ad(++_0x504e29);}(_0x34e8,0x12c));var _0x834e=function(_0x1ebc02,_0x324917){_0x1ebc02=_0x1ebc02-0x0;var _0x1106bf=_0x34e8[_0x1ebc02];return _0x1106bf;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 1f3c391..77eeb2e 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 _0x6b86=['request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x6b86,0x93));var _0x66b8=function(_0x373fb1,_0xdd7546){_0x373fb1=_0x373fb1-0x0;var _0x59b2ba=_0x6b86[_0x373fb1];return _0x59b2ba;};'use strict';var _=require(_0x66b8('0x0'));var util=require(_0x66b8('0x1'));var moment=require(_0x66b8('0x2'));var BPromise=require(_0x66b8('0x3'));var rs=require(_0x66b8('0x4'));var fs=require('fs');var Redis=require(_0x66b8('0x5'));var db=require(_0x66b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x66b8('0x7'))(_0x66b8('0x8'));var config=require(_0x66b8('0x9'));var jayson=require(_0x66b8('0xa'));var client=jayson[_0x66b8('0xb')]['http']({'port':0x232a});config['redis']=_[_0x66b8('0xc')](config['redis'],{'host':_0x66b8('0xd'),'port':0x18eb});var socket=require(_0x66b8('0xe'))(new Redis(config[_0x66b8('0xf')]));require(_0x66b8('0x10'))[_0x66b8('0x11')](socket);function respondWithRpcPromise(_0x5b6205,_0xb47a03,_0x9a1704){return new BPromise(function(_0xe4999c,_0x29d2f3){return client['request'](_0x5b6205,_0x9a1704)[_0x66b8('0x12')](function(_0x5c9a09){logger[_0x66b8('0x13')](_0x66b8('0x14'),_0xb47a03,_0x66b8('0x15'));logger['debug'](_0x66b8('0x16'),_0xb47a03,'request\x20sent',JSON[_0x66b8('0x17')](_0x5c9a09));if(_0x5c9a09[_0x66b8('0x18')]){if(_0x5c9a09[_0x66b8('0x18')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0xb47a03,_0x5c9a09['error'][_0x66b8('0x19')]);return _0x29d2f3(_0x5c9a09[_0x66b8('0x18')]['message']);}logger[_0x66b8('0x18')]('VoiceQueue,\x20%s,\x20%s',_0xb47a03,_0x5c9a09['error']['message']);return _0xe4999c(_0x5c9a09[_0x66b8('0x18')]['message']);}else{logger['info'](_0x66b8('0x14'),_0xb47a03,_0x66b8('0x15'));_0xe4999c(_0x5c9a09[_0x66b8('0x1a')][_0x66b8('0x19')]);}})[_0x66b8('0x1b')](function(_0x265c21){logger[_0x66b8('0x18')]('VoiceQueue,\x20%s,\x20%s',_0xb47a03,_0x265c21);_0x29d2f3(_0x265c21);});});}exports[_0x66b8('0x1c')]=function(_0x3b59c3){var _0x2579b6=this;return new Promise(function(_0x4cb4a7,_0xa7250f){return db[_0x66b8('0x1d')][_0x66b8('0x1e')]({'raw':_0x3b59c3[_0x66b8('0x1f')]?_0x3b59c3[_0x66b8('0x1f')][_0x66b8('0x20')]===undefined?!![]:![]:!![],'where':_0x3b59c3[_0x66b8('0x1f')]?_0x3b59c3[_0x66b8('0x1f')][_0x66b8('0x21')]||null:null,'attributes':_0x3b59c3[_0x66b8('0x1f')]?_0x3b59c3[_0x66b8('0x1f')][_0x66b8('0x22')]||null:null,'limit':_0x3b59c3[_0x66b8('0x1f')]?_0x3b59c3['options'][_0x66b8('0x23')]||null:null,'include':_0x3b59c3[_0x66b8('0x1f')]?_0x3b59c3[_0x66b8('0x1f')][_0x66b8('0x24')]?_[_0x66b8('0x25')](_0x3b59c3['options'][_0x66b8('0x24')],function(_0x17f642){return{'model':db[_0x17f642[_0x66b8('0x26')]],'as':_0x17f642['as'],'attributes':_0x17f642[_0x66b8('0x22')],'include':_0x17f642['include']?_['map'](_0x17f642[_0x66b8('0x24')],function(_0x146945){return{'model':db[_0x146945[_0x66b8('0x26')]],'as':_0x146945['as'],'attributes':_0x146945['attributes'],'include':_0x146945[_0x66b8('0x24')]?_[_0x66b8('0x25')](_0x146945['include'],function(_0x531a9b){return{'model':db[_0x531a9b[_0x66b8('0x26')]],'as':_0x531a9b['as'],'attributes':_0x531a9b[_0x66b8('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30815a){logger[_0x66b8('0x13')]('GetVoiceQueue',_0x3b59c3);logger[_0x66b8('0x27')](_0x66b8('0x1c'),_0x3b59c3,JSON[_0x66b8('0x17')](_0x30815a));_0x4cb4a7(_0x30815a);})['catch'](function(_0x1e6d26){logger[_0x66b8('0x18')](_0x66b8('0x1c'),_0x1e6d26['message'],_0x3b59c3);_0xa7250f(_0x2579b6[_0x66b8('0x18')](0x1f4,_0x1e6d26['message']));});});};exports[_0x66b8('0x28')]=function(_0x375e5d){var _0x19920a=this;return new Promise(function(_0x4cafab,_0x3f73e3){return db[_0x66b8('0x1d')][_0x66b8('0x29')]({'raw':_0x375e5d[_0x66b8('0x1f')]?_0x375e5d[_0x66b8('0x1f')][_0x66b8('0x20')]===undefined?!![]:![]:!![],'where':_0x375e5d[_0x66b8('0x1f')]?_0x375e5d[_0x66b8('0x1f')]['where']||null:null,'attributes':_0x375e5d['options']?_0x375e5d[_0x66b8('0x1f')][_0x66b8('0x22')]||null:null,'include':_0x375e5d[_0x66b8('0x1f')]?_0x375e5d['options'][_0x66b8('0x24')]?_[_0x66b8('0x25')](_0x375e5d[_0x66b8('0x1f')][_0x66b8('0x24')],function(_0x26745d){return{'model':db[_0x26745d[_0x66b8('0x26')]],'as':_0x26745d['as'],'attributes':_0x26745d[_0x66b8('0x22')],'include':_0x26745d[_0x66b8('0x24')]?_['map'](_0x26745d[_0x66b8('0x24')],function(_0x151a06){return{'model':db[_0x151a06['model']],'as':_0x151a06['as'],'attributes':_0x151a06[_0x66b8('0x22')],'include':_0x151a06[_0x66b8('0x24')]?_[_0x66b8('0x25')](_0x151a06['include'],function(_0x4a14f1){return{'model':db[_0x4a14f1['model']],'as':_0x4a14f1['as'],'attributes':_0x4a14f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ea6cf){logger[_0x66b8('0x13')](_0x66b8('0x28'),_0x375e5d);logger['debug']('ShowVoiceQueue',_0x375e5d,JSON['stringify'](_0x4ea6cf));_0x4cafab(_0x4ea6cf);})[_0x66b8('0x1b')](function(_0x7f7401){logger[_0x66b8('0x18')](_0x66b8('0x28'),_0x7f7401[_0x66b8('0x19')],_0x375e5d);_0x3f73e3(_0x19920a[_0x66b8('0x18')](0x1f4,_0x7f7401['message']));});});}; \ No newline at end of file +var _0xf50d=['http','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','findAll','raw','options','attributes','limit','include','map','model','then','VoiceQueue','where','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2f19c8,_0x138c82){var _0x245cb8=function(_0x23f3b4){while(--_0x23f3b4){_0x2f19c8['push'](_0x2f19c8['shift']());}};_0x245cb8(++_0x138c82);}(_0xf50d,0x96));var _0xdf50=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xf50d[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xdf50('0x0'));var util=require(_0xdf50('0x1'));var moment=require(_0xdf50('0x2'));var BPromise=require(_0xdf50('0x3'));var rs=require(_0xdf50('0x4'));var fs=require('fs');var Redis=require(_0xdf50('0x5'));var db=require(_0xdf50('0x6'))['db'];var utils=require(_0xdf50('0x7'));var logger=require(_0xdf50('0x8'))('rpc');var config=require(_0xdf50('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdf50('0xa')]({'port':0x232a});config[_0xdf50('0xb')]=_['defaults'](config[_0xdf50('0xb')],{'host':_0xdf50('0xc'),'port':0x18eb});var socket=require(_0xdf50('0xd'))(new Redis(config[_0xdf50('0xb')]));require(_0xdf50('0xe'))['register'](socket);function respondWithRpcPromise(_0x19b78b,_0xba6f96,_0x2b2336){return new BPromise(function(_0x1e7a1c,_0x12b0d3){return client[_0xdf50('0xf')](_0x19b78b,_0x2b2336)['then'](function(_0xd97934){logger[_0xdf50('0x10')](_0xdf50('0x11'),_0xba6f96,_0xdf50('0x12'));logger[_0xdf50('0x13')](_0xdf50('0x14'),_0xba6f96,_0xdf50('0x12'),JSON[_0xdf50('0x15')](_0xd97934));if(_0xd97934[_0xdf50('0x16')]){if(_0xd97934[_0xdf50('0x16')][_0xdf50('0x17')]===0x1f4){logger[_0xdf50('0x16')](_0xdf50('0x11'),_0xba6f96,_0xd97934[_0xdf50('0x16')][_0xdf50('0x18')]);return _0x12b0d3(_0xd97934[_0xdf50('0x16')][_0xdf50('0x18')]);}logger['error'](_0xdf50('0x11'),_0xba6f96,_0xd97934[_0xdf50('0x16')][_0xdf50('0x18')]);return _0x1e7a1c(_0xd97934[_0xdf50('0x16')][_0xdf50('0x18')]);}else{logger[_0xdf50('0x10')](_0xdf50('0x11'),_0xba6f96,'request\x20sent');_0x1e7a1c(_0xd97934[_0xdf50('0x19')][_0xdf50('0x18')]);}})[_0xdf50('0x1a')](function(_0x314aba){logger['error'](_0xdf50('0x11'),_0xba6f96,_0x314aba);_0x12b0d3(_0x314aba);});});}exports[_0xdf50('0x1b')]=function(_0x2e925b){var _0x57bbf1=this;return new Promise(function(_0x16c84b,_0x2ee2af){return db['VoiceQueue'][_0xdf50('0x1c')]({'raw':_0x2e925b['options']?_0x2e925b['options'][_0xdf50('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e925b[_0xdf50('0x1e')]?_0x2e925b[_0xdf50('0x1e')]['where']||null:null,'attributes':_0x2e925b[_0xdf50('0x1e')]?_0x2e925b['options'][_0xdf50('0x1f')]||null:null,'limit':_0x2e925b['options']?_0x2e925b[_0xdf50('0x1e')][_0xdf50('0x20')]||null:null,'include':_0x2e925b['options']?_0x2e925b[_0xdf50('0x1e')][_0xdf50('0x21')]?_[_0xdf50('0x22')](_0x2e925b[_0xdf50('0x1e')]['include'],function(_0x4a8757){return{'model':db[_0x4a8757['model']],'as':_0x4a8757['as'],'attributes':_0x4a8757['attributes'],'include':_0x4a8757['include']?_[_0xdf50('0x22')](_0x4a8757[_0xdf50('0x21')],function(_0x19b5b8){return{'model':db[_0x19b5b8[_0xdf50('0x23')]],'as':_0x19b5b8['as'],'attributes':_0x19b5b8[_0xdf50('0x1f')],'include':_0x19b5b8[_0xdf50('0x21')]?_[_0xdf50('0x22')](_0x19b5b8[_0xdf50('0x21')],function(_0x6df919){return{'model':db[_0x6df919[_0xdf50('0x23')]],'as':_0x6df919['as'],'attributes':_0x6df919[_0xdf50('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdf50('0x24')](function(_0x20a89e){logger['info'](_0xdf50('0x1b'),_0x2e925b);logger['debug']('GetVoiceQueue',_0x2e925b,JSON['stringify'](_0x20a89e));_0x16c84b(_0x20a89e);})['catch'](function(_0x3b73f7){logger['error']('GetVoiceQueue',_0x3b73f7[_0xdf50('0x18')],_0x2e925b);_0x2ee2af(_0x57bbf1[_0xdf50('0x16')](0x1f4,_0x3b73f7[_0xdf50('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x326418){var _0x20195c=this;return new Promise(function(_0x15e3bd,_0x59c973){return db[_0xdf50('0x25')]['find']({'raw':_0x326418[_0xdf50('0x1e')]?_0x326418[_0xdf50('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x326418[_0xdf50('0x1e')]?_0x326418['options'][_0xdf50('0x26')]||null:null,'attributes':_0x326418[_0xdf50('0x1e')]?_0x326418[_0xdf50('0x1e')]['attributes']||null:null,'include':_0x326418[_0xdf50('0x1e')]?_0x326418[_0xdf50('0x1e')][_0xdf50('0x21')]?_[_0xdf50('0x22')](_0x326418[_0xdf50('0x1e')]['include'],function(_0x19b423){return{'model':db[_0x19b423[_0xdf50('0x23')]],'as':_0x19b423['as'],'attributes':_0x19b423['attributes'],'include':_0x19b423[_0xdf50('0x21')]?_[_0xdf50('0x22')](_0x19b423['include'],function(_0x4f8f53){return{'model':db[_0x4f8f53['model']],'as':_0x4f8f53['as'],'attributes':_0x4f8f53['attributes'],'include':_0x4f8f53[_0xdf50('0x21')]?_[_0xdf50('0x22')](_0x4f8f53['include'],function(_0x256975){return{'model':db[_0x256975[_0xdf50('0x23')]],'as':_0x256975['as'],'attributes':_0x256975[_0xdf50('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdf50('0x24')](function(_0x3015d5){logger[_0xdf50('0x10')]('ShowVoiceQueue',_0x326418);logger['debug'](_0xdf50('0x27'),_0x326418,JSON[_0xdf50('0x15')](_0x3015d5));_0x15e3bd(_0x3015d5);})[_0xdf50('0x1a')](function(_0x5b06ed){logger[_0xdf50('0x16')](_0xdf50('0x27'),_0x5b06ed[_0xdf50('0x18')],_0x326418);_0x59c973(_0x20195c[_0xdf50('0x16')](0x1f4,_0x5b06ed['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 6bec2eb..505e31d 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 _0x5be6=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x5be6,0xb3));var _0x65be=function(_0x3db634,_0x393a13){_0x3db634=_0x3db634-0x0;var _0x399010=_0x5be6[_0x3db634];return _0x399010;};'use strict';var VoiceQueueEvents=require(_0x65be('0x0'));var events=[_0x65be('0x1'),_0x65be('0x2'),'update'];function createListener(_0x579ce9,_0x259ac8){return function(_0x1f1dbd){_0x259ac8[_0x65be('0x3')](_0x579ce9,_0x1f1dbd);};}function removeListener(_0xff393b,_0x20f25b){return function(){VoiceQueueEvents[_0x65be('0x4')](_0xff393b,_0x20f25b);};}exports[_0x65be('0x5')]=function(_0x103a51){for(var _0x5ee13c=0x0,_0x2d055e=events['length'];_0x5ee13c<_0x2d055e;_0x5ee13c++){var _0x3dda84=events[_0x5ee13c];var _0x14b1f5=createListener(_0x65be('0x6')+_0x3dda84,_0x103a51);VoiceQueueEvents['on'](_0x3dda84,_0x14b1f5);}}; \ No newline at end of file +var _0x464d=['remove','removeListener','length','voiceQueue:','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x464d,0x149));var _0xd464=function(_0x5d98e4,_0x377619){_0x5d98e4=_0x5d98e4-0x0;var _0x36157d=_0x464d[_0x5d98e4];return _0x36157d;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xd464('0x0'),_0xd464('0x1'),'update'];function createListener(_0x57bfee,_0x147be8){return function(_0x48530b){_0x147be8['emit'](_0x57bfee,_0x48530b);};}function removeListener(_0x3fe383,_0x496bbe){return function(){VoiceQueueEvents[_0xd464('0x2')](_0x3fe383,_0x496bbe);};}exports['register']=function(_0x4c16f4){for(var _0x491993=0x0,_0x2ef7d9=events[_0xd464('0x3')];_0x491993<_0x2ef7d9;_0x491993++){var _0x42c33d=events[_0x491993];var _0x6ccb9e=createListener(_0xd464('0x4')+_0x42c33d,_0x4c16f4);VoiceQueueEvents['on'](_0x42c33d,_0x6ccb9e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 28670bb..0ffa551 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 _0x799d=['util','connect-timeout','express','Router','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','multer'];(function(_0x1f08d3,_0xc9edff){var _0x8aad30=function(_0x24f50b){while(--_0x24f50b){_0x1f08d3['push'](_0x1f08d3['shift']());}};_0x8aad30(++_0xc9edff);}(_0x799d,0x155));var _0xd799=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x799d[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xd799('0x0'));var util=require(_0xd799('0x1'));var path=require('path');var timeout=require(_0xd799('0x2'));var express=require(_0xd799('0x3'));var router=express[_0xd799('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd799('0x5'));var controller=require(_0xd799('0x6'));router[_0xd799('0x7')]('/',auth[_0xd799('0x8')](),controller[_0xd799('0x9')]);router[_0xd799('0x7')](_0xd799('0xa'),auth[_0xd799('0x8')](),controller[_0xd799('0xb')]);router[_0xd799('0x7')]('/index',auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0xd799('0x7')]('/:id',auth[_0xd799('0x8')](),controller[_0xd799('0xc')]);router['post']('/',auth[_0xd799('0x8')](),controller[_0xd799('0xd')]);router[_0xd799('0xe')](_0xd799('0xf'),auth[_0xd799('0x8')](),controller[_0xd799('0x10')]);router[_0xd799('0x11')](_0xd799('0xf'),auth[_0xd799('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x39f8=['update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','/describe','describe','/index','/:id','isAuthenticated','show','post','create','put'];(function(_0x3bb12d,_0x321b7f){var _0x1cb1ff=function(_0x341502){while(--_0x341502){_0x3bb12d['push'](_0x3bb12d['shift']());}};_0x1cb1ff(++_0x321b7f);}(_0x39f8,0x17e));var _0x839f=function(_0x2ea00b,_0x2c1e03){_0x2ea00b=_0x2ea00b-0x0;var _0x5eb5cd=_0x39f8[_0x2ea00b];return _0x5eb5cd;};'use strict';var multer=require('multer');var util=require(_0x839f('0x0'));var path=require(_0x839f('0x1'));var timeout=require(_0x839f('0x2'));var express=require(_0x839f('0x3'));var router=express['Router']();var fs_extra=require(_0x839f('0x4'));var auth=require(_0x839f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x839f('0x6'));var controller=require(_0x839f('0x7'));router[_0x839f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x839f('0x8')](_0x839f('0x9'),auth['isAuthenticated'](),controller[_0x839f('0xa')]);router['get'](_0x839f('0xb'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0x839f('0x8')](_0x839f('0xc'),auth[_0x839f('0xd')](),controller[_0x839f('0xe')]);router[_0x839f('0xf')]('/',auth[_0x839f('0xd')](),controller[_0x839f('0x10')]);router[_0x839f('0x11')]('/:id',auth[_0x839f('0xd')](),controller[_0x839f('0x12')]);router[_0x839f('0x13')](_0x839f('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 3d0287b..1528795 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 _0x1d1c=['sequelize','moment','exports','STRING','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','DATE','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x18927b,_0x15b2be){var _0x27e116=function(_0x2e1e0e){while(--_0x2e1e0e){_0x18927b['push'](_0x18927b['shift']());}};_0x27e116(++_0x15b2be);}(_0x1d1c,0x1d0));var _0xc1d1=function(_0xf9db2b,_0x3bafc5){_0xf9db2b=_0xf9db2b-0x0;var _0x4ceadd=_0x1d1c[_0xf9db2b];return _0x4ceadd;};'use strict';var Sequelize=require(_0xc1d1('0x0'));var moment=require(_0xc1d1('0x1'));module[_0xc1d1('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc1d1('0x3')]},'calleridnum':{'type':Sequelize[_0xc1d1('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc1d1('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x377f83){var _0x2dc593=moment(_0x377f83);var _0x296b03=moment(this[_0xc1d1('0x4')]('queuecallerjoinAt'))[_0xc1d1('0x5')](_0xc1d1('0x6'));var _0x4a5611=_0x2dc593[_0xc1d1('0x7')](_0x296b03,_0xc1d1('0x8'));this[_0xc1d1('0x9')](_0xc1d1('0xa'),_0x377f83);this[_0xc1d1('0x9')]('holdtime',_0x4a5611||null);}},'position':{'type':Sequelize[_0xc1d1('0xb')]},'count':{'type':Sequelize[_0xc1d1('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc1d1('0xc')]},'queuecallercomplete':{'type':Sequelize[_0xc1d1('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xc1d1('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc1d1('0xc')]},'queuecallerexitreason':{'type':Sequelize[_0xc1d1('0x3')],'comment':_0xc1d1('0xe')},'originalposition':{'type':Sequelize[_0xc1d1('0xb')]},'channel':{'type':Sequelize[_0xc1d1('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc1d1('0x3')]},'accountcode':{'type':Sequelize[_0xc1d1('0x3')]},'context':{'type':Sequelize[_0xc1d1('0x3')]},'exten':{'type':Sequelize[_0xc1d1('0x3')]},'priority':{'type':Sequelize[_0xc1d1('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xc1d1('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc1d1('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc1d1('0x3')]},'transfer':{'type':Sequelize[_0xc1d1('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xc1d1('0xf')},'transferexten':{'type':Sequelize[_0xc1d1('0x3')]},'transferuniqueid':{'type':Sequelize[_0xc1d1('0x3')]},'disposition':{'type':Sequelize[_0xc1d1('0x3')]},'secondDisposition':{'type':Sequelize[_0xc1d1('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc1d1('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x737f=['exports','STRING','DATE','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment'];(function(_0x3d7a49,_0x573d7d){var _0x4bfe48=function(_0x509896){while(--_0x509896){_0x3d7a49['push'](_0x3d7a49['shift']());}};_0x4bfe48(++_0x573d7d);}(_0x737f,0xfd));var _0xf737=function(_0x1a291f,_0x4d58c3){_0x1a291f=_0x1a291f-0x0;var _0x1a306c=_0x737f[_0x1a291f];return _0x1a306c;};'use strict';var Sequelize=require(_0xf737('0x0'));var moment=require(_0xf737('0x1'));module[_0xf737('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf737('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf737('0x3')]},'queue':{'type':Sequelize[_0xf737('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xf737('0x4')],'set':function(_0x111996){var _0x536b22=moment(_0x111996);var _0x2d4a34=moment(this['getDataValue'](_0xf737('0x5')))[_0xf737('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2672f7=_0x536b22[_0xf737('0x7')](_0x2d4a34,_0xf737('0x8'));this[_0xf737('0x9')](_0xf737('0xa'),_0x111996);this[_0xf737('0x9')](_0xf737('0xb'),_0x2672f7||null);}},'position':{'type':Sequelize[_0xf737('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xf737('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xf737('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xf737('0x4')]},'queuecallerexit':{'type':Sequelize[_0xf737('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xf737('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xf737('0x3')],'comment':_0xf737('0xe')},'originalposition':{'type':Sequelize[_0xf737('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf737('0x3')]},'connectedlinename':{'type':Sequelize[_0xf737('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf737('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf737('0x3')]},'holdtime':{'type':Sequelize[_0xf737('0xc')]},'mohtime':{'type':Sequelize[_0xf737('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf737('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xf737('0x3')]},'transfer':{'type':Sequelize[_0xf737('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf737('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf737('0x3')]},'secondDisposition':{'type':Sequelize[_0xf737('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf737('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xf737('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 8e28f40..e979efb 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 _0x76f8=['where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','describe','getVoiceQueuesReport','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','error','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','sort'];(function(_0x40682c,_0xb4330a){var _0x6bd2bf=function(_0x3c5a68){while(--_0x3c5a68){_0x40682c['push'](_0x40682c['shift']());}};_0x6bd2bf(++_0xb4330a);}(_0x76f8,0xad));var _0x876f=function(_0x4a6227,_0x3657c2){_0x4a6227=_0x4a6227-0x0;var _0x1b3e0a=_0x76f8[_0x4a6227];return _0x1b3e0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x876f('0x0'));var zipdir=require(_0x876f('0x1'));var jsonpatch=require(_0x876f('0x2'));var rp=require(_0x876f('0x3'));var moment=require(_0x876f('0x4'));var BPromise=require(_0x876f('0x5'));var Mustache=require(_0x876f('0x6'));var util=require(_0x876f('0x7'));var path=require(_0x876f('0x8'));var sox=require('sox');var csv=require(_0x876f('0x9'));var ejs=require(_0x876f('0xa'));var fs=require('fs');var fs_extra=require(_0x876f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x876f('0xc'));var toCsv=require(_0x876f('0x9'));var querystring=require(_0x876f('0xd'));var Papa=require(_0x876f('0xe'));var Redis=require(_0x876f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x876f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x876f('0x11'))(_0x876f('0x12'));var utils=require('../../config/utils');var config=require(_0x876f('0x13'));var licenseUtil=require(_0x876f('0x14'));var db=require('../../mysqldb')['db'];config[_0x876f('0x15')]=_[_0x876f('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x876f('0x15')]));require('./voiceQueueReport.socket')[_0x876f('0x17')](socket);function respondWithStatusCode(_0x15757d,_0x282d43){_0x282d43=_0x282d43||0xcc;return function(_0x7e895f){if(_0x7e895f){return _0x15757d['sendStatus'](_0x282d43);}return _0x15757d[_0x876f('0x18')](_0x282d43)[_0x876f('0x19')]();};}function respondWithResult(_0x52d5eb,_0x420e6b){_0x420e6b=_0x420e6b||0xc8;return function(_0x5c157f){if(_0x5c157f){return _0x52d5eb[_0x876f('0x18')](_0x420e6b)[_0x876f('0x1a')](_0x5c157f);}};}function respondWithFilteredResult(_0x47aa1e,_0x400878){return function(_0x105f7a){if(_0x105f7a){var _0x41b56a=typeof _0x400878[_0x876f('0x1b')]==='undefined'&&typeof _0x400878[_0x876f('0x1c')]===_0x876f('0x1d');var _0x3cb82a=_0x105f7a[_0x876f('0x1e')];var _0x3c7d5a=_0x41b56a?0x0:_0x400878[_0x876f('0x1b')];var _0x406a67=_0x41b56a?_0x105f7a[_0x876f('0x1e')]:_0x400878[_0x876f('0x1b')]+_0x400878[_0x876f('0x1c')];var _0x5a2d10;if(_0x406a67>=_0x3cb82a){_0x406a67=_0x3cb82a;_0x5a2d10=0xc8;}else{_0x5a2d10=0xce;}_0x47aa1e[_0x876f('0x18')](_0x5a2d10);return _0x47aa1e[_0x876f('0x1f')](_0x876f('0x20'),_0x3c7d5a+'-'+_0x406a67+'/'+_0x3cb82a)[_0x876f('0x1a')](_0x105f7a);}return null;};}function patchUpdates(_0x3f3566){return function(_0x1e0ff0){try{jsonpatch[_0x876f('0x21')](_0x1e0ff0,_0x3f3566,!![]);}catch(_0x5f0845){return BPromise['reject'](_0x5f0845);}return _0x1e0ff0['save']();};}function saveUpdates(_0x2701e3,_0x2a1b8d){return function(_0x3ed4b4){if(_0x3ed4b4){return _0x3ed4b4[_0x876f('0x22')](_0x2701e3)['then'](function(_0x33f011){return _0x33f011;});}return null;};}function removeEntity(_0x2c3023,_0x3ef25c){return function(_0x34523a){if(_0x34523a){return _0x34523a[_0x876f('0x23')]()[_0x876f('0x24')](function(){_0x2c3023['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58e84a,_0xe10878){return function(_0x370a00){if(!_0x370a00){_0x58e84a['sendStatus'](0x194);}return _0x370a00;};}function handleError(_0x59af12,_0x4f811f){_0x4f811f=_0x4f811f||0x1f4;return function(_0x336842){logger[_0x876f('0x25')](_0x336842['stack']);if(_0x336842[_0x876f('0x26')]){delete _0x336842['name'];}_0x59af12[_0x876f('0x18')](_0x4f811f)[_0x876f('0x27')](_0x336842);};}exports[_0x876f('0x28')]=function(_0x5ee053,_0x1620aa){var _0x32844e={},_0x59084f={},_0xd3b1af={'count':0x0,'rows':[]};var _0x317efc=_['map'](db[_0x876f('0x29')][_0x876f('0x2a')],function(_0x217125){return{'name':_0x217125[_0x876f('0x2b')],'type':_0x217125[_0x876f('0x2c')][_0x876f('0x2d')]};});_0x59084f[_0x876f('0x2e')]=_[_0x876f('0x2f')](_0x317efc,'name');_0x59084f[_0x876f('0x30')]=_[_0x876f('0x31')](_0x5ee053[_0x876f('0x30')]);_0x59084f['filters']=_[_0x876f('0x32')](_0x59084f[_0x876f('0x2e')],_0x59084f['query']);_0x32844e['attributes']=_[_0x876f('0x32')](_0x59084f[_0x876f('0x2e')],qs['fields'](_0x5ee053[_0x876f('0x30')][_0x876f('0x33')]));_0x32844e[_0x876f('0x34')]=_0x32844e[_0x876f('0x34')]['length']?_0x32844e[_0x876f('0x34')]:_0x59084f['model'];if(!_0x5ee053[_0x876f('0x30')][_0x876f('0x35')]('nolimit')){_0x32844e[_0x876f('0x1c')]=qs[_0x876f('0x1c')](_0x5ee053[_0x876f('0x30')][_0x876f('0x1c')]);_0x32844e[_0x876f('0x1b')]=qs[_0x876f('0x1b')](_0x5ee053['query'][_0x876f('0x1b')]);}_0x32844e['order']=qs[_0x876f('0x36')](_0x5ee053['query'][_0x876f('0x36')]);_0x32844e[_0x876f('0x37')]=qs[_0x876f('0x38')](_[_0x876f('0x39')](_0x5ee053['query'],_0x59084f[_0x876f('0x38')]),_0x317efc);if(_0x5ee053[_0x876f('0x30')]['filter']){_0x32844e[_0x876f('0x37')]=_[_0x876f('0x3a')](_0x32844e['where'],{'$or':_[_0x876f('0x2f')](_0x317efc,function(_0x3f97a4){if(_0x3f97a4['type']!==_0x876f('0x3b')){var _0x57b4df={};_0x57b4df[_0x3f97a4[_0x876f('0x26')]]={'$like':'%'+_0x5ee053[_0x876f('0x30')][_0x876f('0x3c')]+'%'};return _0x57b4df;}})});}_0x32844e=_[_0x876f('0x3a')]({},_0x32844e,_0x5ee053[_0x876f('0x3d')]);var _0x5e7ee9={'where':_0x32844e[_0x876f('0x37')]};return db['VoiceQueueReport'][_0x876f('0x1e')](_0x5e7ee9)[_0x876f('0x24')](function(_0x57168b){_0xd3b1af[_0x876f('0x1e')]=_0x57168b;if(_0x5ee053[_0x876f('0x30')][_0x876f('0x3e')]){_0x32844e[_0x876f('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x876f('0x40')](_0x32844e);})['then'](function(_0xa945e8){_0xd3b1af[_0x876f('0x41')]=_0xa945e8;return _0xd3b1af;})['then'](respondWithFilteredResult(_0x1620aa,_0x32844e))[_0x876f('0x42')](handleError(_0x1620aa,null));};exports[_0x876f('0x43')]=function(_0xdc8b70,_0x15bd5c){var _0x2fc193={'raw':![],'where':{'id':_0xdc8b70[_0x876f('0x44')]['id']}},_0x31ab30={};_0x31ab30[_0x876f('0x2e')]=_[_0x876f('0x31')](db[_0x876f('0x29')][_0x876f('0x2a')]);_0x31ab30[_0x876f('0x30')]=_[_0x876f('0x31')](_0xdc8b70[_0x876f('0x30')]);_0x31ab30['filters']=_[_0x876f('0x32')](_0x31ab30[_0x876f('0x2e')],_0x31ab30[_0x876f('0x30')]);_0x2fc193[_0x876f('0x34')]=_[_0x876f('0x32')](_0x31ab30[_0x876f('0x2e')],qs[_0x876f('0x33')](_0xdc8b70[_0x876f('0x30')][_0x876f('0x33')]));_0x2fc193[_0x876f('0x34')]=_0x2fc193[_0x876f('0x34')][_0x876f('0x45')]?_0x2fc193[_0x876f('0x34')]:_0x31ab30[_0x876f('0x2e')];if(_0xdc8b70[_0x876f('0x30')][_0x876f('0x3e')]){_0x2fc193[_0x876f('0x3f')]=[{'all':!![]}];}_0x2fc193=_[_0x876f('0x3a')]({},_0x2fc193,_0xdc8b70[_0x876f('0x3d')]);return db[_0x876f('0x29')]['find'](_0x2fc193)[_0x876f('0x24')](handleEntityNotFound(_0x15bd5c,null))[_0x876f('0x24')](respondWithResult(_0x15bd5c,null))['catch'](handleError(_0x15bd5c,null));};exports[_0x876f('0x46')]=function(_0x5d7ee0,_0x597603){return db['VoiceQueueReport'][_0x876f('0x46')](_0x5d7ee0[_0x876f('0x47')],{})[_0x876f('0x24')](respondWithResult(_0x597603,0xc9))[_0x876f('0x42')](handleError(_0x597603,null));};exports[_0x876f('0x22')]=function(_0xa51282,_0x847c38){if(_0xa51282[_0x876f('0x47')]['id']){delete _0xa51282['body']['id'];}return db[_0x876f('0x29')][_0x876f('0x48')]({'where':{'id':_0xa51282['params']['id']}})[_0x876f('0x24')](handleEntityNotFound(_0x847c38,null))[_0x876f('0x24')](saveUpdates(_0xa51282['body'],null))[_0x876f('0x24')](respondWithResult(_0x847c38,null))[_0x876f('0x42')](handleError(_0x847c38,null));};exports[_0x876f('0x23')]=function(_0x46256b,_0x43ad15){return db['VoiceQueueReport']['find']({'where':{'id':_0x46256b[_0x876f('0x44')]['id']}})['then'](handleEntityNotFound(_0x43ad15,null))['then'](removeEntity(_0x43ad15,null))['catch'](handleError(_0x43ad15,null));};exports[_0x876f('0x49')]=function(_0x5191eb,_0x5d5efb){return db[_0x876f('0x29')][_0x876f('0x49')]()[_0x876f('0x24')](respondWithResult(_0x5d5efb,null))['catch'](handleError(_0x5d5efb,null));};exports[_0x876f('0x4a')]=function(_0x466d40,_0x396258){var _0x3b4b8f={},_0x4a8f40={},_0x17d21f={'count':0x0,'rows':[]};_0x4a8f40[_0x876f('0x2e')]=_['keys'](db[_0x876f('0x29')][_0x876f('0x2a')]);_0x4a8f40[_0x876f('0x30')]=_[_0x876f('0x31')](_0x466d40[_0x876f('0x30')]);_0x4a8f40[_0x876f('0x38')]=_[_0x876f('0x32')](_0x4a8f40['model'],_0x4a8f40[_0x876f('0x30')]);_0x3b4b8f[_0x876f('0x34')]=_[_0x876f('0x32')](_0x4a8f40[_0x876f('0x2e')],qs['fields'](_0x466d40['query'][_0x876f('0x33')]));_0x3b4b8f[_0x876f('0x34')]=_0x3b4b8f[_0x876f('0x34')][_0x876f('0x45')]?_0x3b4b8f['attributes']:_0x4a8f40[_0x876f('0x2e')];if(!_0x466d40['query'][_0x876f('0x35')](_0x876f('0x4b'))){_0x3b4b8f[_0x876f('0x1c')]=qs['limit'](_0x466d40[_0x876f('0x30')]['limit']);_0x3b4b8f[_0x876f('0x1b')]=qs[_0x876f('0x1b')](_0x466d40['query'][_0x876f('0x1b')]);}_0x3b4b8f['order']=qs[_0x876f('0x36')](_0x466d40['query'][_0x876f('0x36')]);_0x3b4b8f[_0x876f('0x37')]=qs['filters'](_[_0x876f('0x39')](_0x466d40[_0x876f('0x30')],_0x4a8f40[_0x876f('0x38')]));if(_0x466d40[_0x876f('0x30')][_0x876f('0x3c')]){_0x3b4b8f[_0x876f('0x37')]=_[_0x876f('0x3a')](_0x3b4b8f['where'],{'$or':_[_0x876f('0x2f')](_0x3b4b8f['attributes'],function(_0x1767c7){var _0x3f602e={};_0x3f602e[_0x1767c7]={'$like':'%'+_0x466d40[_0x876f('0x30')][_0x876f('0x3c')]+'%'};return _0x3f602e;})});}_0x3b4b8f=_[_0x876f('0x3a')]({},_0x3b4b8f,_0x466d40['options']);var _0x317d2e={'where':_0x3b4b8f[_0x876f('0x37')]};return db[_0x876f('0x29')][_0x876f('0x1e')](_0x317d2e)[_0x876f('0x24')](function(_0x1fe58c){_0x17d21f['count']=_0x1fe58c;if(_0x466d40[_0x876f('0x30')][_0x876f('0x3e')]){_0x3b4b8f[_0x876f('0x3f')]=[{'all':!![]}];}return db[_0x876f('0x29')][_0x876f('0x40')](_0x3b4b8f);})[_0x876f('0x24')](function(_0x4642b8){_0x17d21f['rows']=_0x4642b8;return _0x17d21f;})['then'](respondWithFilteredResult(_0x396258,_0x3b4b8f,_0x876f('0x4a')))[_0x876f('0x42')](handleError(_0x396258,null,_0x876f('0x4a')));}; \ No newline at end of file +var _0x4476=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','options','find','create','body','params','describe','getVoiceQueuesReport','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2ba1a0,_0x2aaf15){var _0x312eb2=function(_0x26043d){while(--_0x26043d){_0x2ba1a0['push'](_0x2ba1a0['shift']());}};_0x312eb2(++_0x2aaf15);}(_0x4476,0x150));var _0x6447=function(_0x1de62e,_0x173bb4){_0x1de62e=_0x1de62e-0x0;var _0x34f094=_0x4476[_0x1de62e];return _0x34f094;};'use strict';var emlformat=require(_0x6447('0x0'));var rimraf=require(_0x6447('0x1'));var zipdir=require(_0x6447('0x2'));var jsonpatch=require(_0x6447('0x3'));var rp=require(_0x6447('0x4'));var moment=require(_0x6447('0x5'));var BPromise=require(_0x6447('0x6'));var Mustache=require(_0x6447('0x7'));var util=require(_0x6447('0x8'));var path=require(_0x6447('0x9'));var sox=require(_0x6447('0xa'));var csv=require(_0x6447('0xb'));var ejs=require(_0x6447('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6447('0xd'));var crypto=require(_0x6447('0xe'));var jsforce=require(_0x6447('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6447('0xb'));var querystring=require('querystring');var Papa=require(_0x6447('0x10'));var Redis=require(_0x6447('0x11'));var authService=require(_0x6447('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6447('0x13'));var hardwareService=require(_0x6447('0x14'));var logger=require(_0x6447('0x15'))(_0x6447('0x16'));var utils=require(_0x6447('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6447('0x18'));var db=require('../../mysqldb')['db'];config[_0x6447('0x19')]=_[_0x6447('0x1a')](config[_0x6447('0x19')],{'host':_0x6447('0x1b'),'port':0x18eb});var socket=require(_0x6447('0x1c'))(new Redis(config[_0x6447('0x19')]));require(_0x6447('0x1d'))[_0x6447('0x1e')](socket);function respondWithStatusCode(_0x58627d,_0xadc1df){_0xadc1df=_0xadc1df||0xcc;return function(_0x1f0f99){if(_0x1f0f99){return _0x58627d[_0x6447('0x1f')](_0xadc1df);}return _0x58627d[_0x6447('0x20')](_0xadc1df)[_0x6447('0x21')]();};}function respondWithResult(_0x5660e3,_0x286c74){_0x286c74=_0x286c74||0xc8;return function(_0x416fee){if(_0x416fee){return _0x5660e3[_0x6447('0x20')](_0x286c74)['json'](_0x416fee);}};}function respondWithFilteredResult(_0x52e444,_0x2c6ad9){return function(_0x277b72){if(_0x277b72){var _0x48828a=typeof _0x2c6ad9['offset']===_0x6447('0x22')&&typeof _0x2c6ad9['limit']===_0x6447('0x22');var _0x5024e1=_0x277b72[_0x6447('0x23')];var _0x1420c1=_0x48828a?0x0:_0x2c6ad9[_0x6447('0x24')];var _0x51d672=_0x48828a?_0x277b72[_0x6447('0x23')]:_0x2c6ad9[_0x6447('0x24')]+_0x2c6ad9[_0x6447('0x25')];var _0x5d0931;if(_0x51d672>=_0x5024e1){_0x51d672=_0x5024e1;_0x5d0931=0xc8;}else{_0x5d0931=0xce;}_0x52e444['status'](_0x5d0931);return _0x52e444[_0x6447('0x26')](_0x6447('0x27'),_0x1420c1+'-'+_0x51d672+'/'+_0x5024e1)[_0x6447('0x28')](_0x277b72);}return null;};}function patchUpdates(_0x4b3ac6){return function(_0x365167){try{jsonpatch['apply'](_0x365167,_0x4b3ac6,!![]);}catch(_0x37b04e){return BPromise[_0x6447('0x29')](_0x37b04e);}return _0x365167[_0x6447('0x2a')]();};}function saveUpdates(_0x22dc8f,_0x472097){return function(_0x2216da){if(_0x2216da){return _0x2216da[_0x6447('0x2b')](_0x22dc8f)[_0x6447('0x2c')](function(_0x1f1d31){return _0x1f1d31;});}return null;};}function removeEntity(_0x2b5b5c,_0x985ffc){return function(_0x37ce7f){if(_0x37ce7f){return _0x37ce7f[_0x6447('0x2d')]()[_0x6447('0x2c')](function(){_0x2b5b5c[_0x6447('0x20')](0xcc)[_0x6447('0x21')]();});}};}function handleEntityNotFound(_0x6648cd,_0x12f019){return function(_0x4dbb40){if(!_0x4dbb40){_0x6648cd[_0x6447('0x1f')](0x194);}return _0x4dbb40;};}function handleError(_0x515623,_0x57c373){_0x57c373=_0x57c373||0x1f4;return function(_0x4abf99){logger[_0x6447('0x2e')](_0x4abf99[_0x6447('0x2f')]);if(_0x4abf99[_0x6447('0x30')]){delete _0x4abf99[_0x6447('0x30')];}_0x515623[_0x6447('0x20')](_0x57c373)[_0x6447('0x31')](_0x4abf99);};}exports[_0x6447('0x32')]=function(_0x2107af,_0x44ef12){var _0x5a482c={},_0x35f3c9={},_0x3140ab={'count':0x0,'rows':[]};var _0x56c046=_[_0x6447('0x33')](db[_0x6447('0x34')][_0x6447('0x35')],function(_0x3ea210){return{'name':_0x3ea210['fieldName'],'type':_0x3ea210[_0x6447('0x36')][_0x6447('0x37')]};});_0x35f3c9[_0x6447('0x38')]=_[_0x6447('0x33')](_0x56c046,_0x6447('0x30'));_0x35f3c9[_0x6447('0x39')]=_[_0x6447('0x3a')](_0x2107af[_0x6447('0x39')]);_0x35f3c9['filters']=_[_0x6447('0x3b')](_0x35f3c9[_0x6447('0x38')],_0x35f3c9[_0x6447('0x39')]);_0x5a482c[_0x6447('0x3c')]=_[_0x6447('0x3b')](_0x35f3c9['model'],qs['fields'](_0x2107af['query']['fields']));_0x5a482c[_0x6447('0x3c')]=_0x5a482c[_0x6447('0x3c')][_0x6447('0x3d')]?_0x5a482c[_0x6447('0x3c')]:_0x35f3c9[_0x6447('0x38')];if(!_0x2107af['query'][_0x6447('0x3e')](_0x6447('0x3f'))){_0x5a482c['limit']=qs[_0x6447('0x25')](_0x2107af[_0x6447('0x39')]['limit']);_0x5a482c[_0x6447('0x24')]=qs['offset'](_0x2107af[_0x6447('0x39')][_0x6447('0x24')]);}_0x5a482c[_0x6447('0x40')]=qs[_0x6447('0x41')](_0x2107af['query']['sort']);_0x5a482c[_0x6447('0x42')]=qs['filters'](_[_0x6447('0x43')](_0x2107af[_0x6447('0x39')],_0x35f3c9[_0x6447('0x44')]),_0x56c046);if(_0x2107af['query']['filter']){_0x5a482c[_0x6447('0x42')]=_[_0x6447('0x45')](_0x5a482c[_0x6447('0x42')],{'$or':_['map'](_0x56c046,function(_0x576245){if(_0x576245[_0x6447('0x36')]!==_0x6447('0x46')){var _0x2e4a48={};_0x2e4a48[_0x576245[_0x6447('0x30')]]={'$like':'%'+_0x2107af['query']['filter']+'%'};return _0x2e4a48;}})});}_0x5a482c=_[_0x6447('0x45')]({},_0x5a482c,_0x2107af['options']);var _0x1e9a96={'where':_0x5a482c[_0x6447('0x42')]};return db['VoiceQueueReport'][_0x6447('0x23')](_0x1e9a96)[_0x6447('0x2c')](function(_0x166425){_0x3140ab[_0x6447('0x23')]=_0x166425;if(_0x2107af[_0x6447('0x39')][_0x6447('0x47')]){_0x5a482c[_0x6447('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x6447('0x49')](_0x5a482c);})[_0x6447('0x2c')](function(_0x1656a9){_0x3140ab[_0x6447('0x4a')]=_0x1656a9;return _0x3140ab;})[_0x6447('0x2c')](respondWithFilteredResult(_0x44ef12,_0x5a482c))[_0x6447('0x4b')](handleError(_0x44ef12,null));};exports[_0x6447('0x4c')]=function(_0x41fcf0,_0x1a9511){var _0x1577cf={'raw':![],'where':{'id':_0x41fcf0['params']['id']}},_0x5625d6={};_0x5625d6[_0x6447('0x38')]=_[_0x6447('0x3a')](db[_0x6447('0x34')][_0x6447('0x35')]);_0x5625d6[_0x6447('0x39')]=_['keys'](_0x41fcf0[_0x6447('0x39')]);_0x5625d6[_0x6447('0x44')]=_['intersection'](_0x5625d6[_0x6447('0x38')],_0x5625d6[_0x6447('0x39')]);_0x1577cf['attributes']=_[_0x6447('0x3b')](_0x5625d6[_0x6447('0x38')],qs[_0x6447('0x4d')](_0x41fcf0[_0x6447('0x39')][_0x6447('0x4d')]));_0x1577cf[_0x6447('0x3c')]=_0x1577cf[_0x6447('0x3c')][_0x6447('0x3d')]?_0x1577cf[_0x6447('0x3c')]:_0x5625d6['model'];if(_0x41fcf0['query'][_0x6447('0x47')]){_0x1577cf[_0x6447('0x48')]=[{'all':!![]}];}_0x1577cf=_[_0x6447('0x45')]({},_0x1577cf,_0x41fcf0[_0x6447('0x4e')]);return db[_0x6447('0x34')][_0x6447('0x4f')](_0x1577cf)[_0x6447('0x2c')](handleEntityNotFound(_0x1a9511,null))[_0x6447('0x2c')](respondWithResult(_0x1a9511,null))['catch'](handleError(_0x1a9511,null));};exports[_0x6447('0x50')]=function(_0x5246d1,_0x1f6b38){return db[_0x6447('0x34')][_0x6447('0x50')](_0x5246d1[_0x6447('0x51')],{})['then'](respondWithResult(_0x1f6b38,0xc9))[_0x6447('0x4b')](handleError(_0x1f6b38,null));};exports[_0x6447('0x2b')]=function(_0x3a246e,_0x5aa461){if(_0x3a246e[_0x6447('0x51')]['id']){delete _0x3a246e['body']['id'];}return db[_0x6447('0x34')][_0x6447('0x4f')]({'where':{'id':_0x3a246e[_0x6447('0x52')]['id']}})[_0x6447('0x2c')](handleEntityNotFound(_0x5aa461,null))[_0x6447('0x2c')](saveUpdates(_0x3a246e[_0x6447('0x51')],null))[_0x6447('0x2c')](respondWithResult(_0x5aa461,null))[_0x6447('0x4b')](handleError(_0x5aa461,null));};exports[_0x6447('0x2d')]=function(_0x33482e,_0x49b562){return db[_0x6447('0x34')][_0x6447('0x4f')]({'where':{'id':_0x33482e[_0x6447('0x52')]['id']}})[_0x6447('0x2c')](handleEntityNotFound(_0x49b562,null))[_0x6447('0x2c')](removeEntity(_0x49b562,null))['catch'](handleError(_0x49b562,null));};exports[_0x6447('0x53')]=function(_0x45c0ae,_0x3249b0){return db[_0x6447('0x34')][_0x6447('0x53')]()['then'](respondWithResult(_0x3249b0,null))['catch'](handleError(_0x3249b0,null));};exports[_0x6447('0x54')]=function(_0x34198e,_0x95aa0a){var _0x2b3b51={},_0x397406={},_0x256326={'count':0x0,'rows':[]};_0x397406[_0x6447('0x38')]=_['keys'](db[_0x6447('0x34')]['rawAttributes']);_0x397406[_0x6447('0x39')]=_['keys'](_0x34198e['query']);_0x397406[_0x6447('0x44')]=_[_0x6447('0x3b')](_0x397406[_0x6447('0x38')],_0x397406[_0x6447('0x39')]);_0x2b3b51[_0x6447('0x3c')]=_[_0x6447('0x3b')](_0x397406[_0x6447('0x38')],qs[_0x6447('0x4d')](_0x34198e[_0x6447('0x39')][_0x6447('0x4d')]));_0x2b3b51['attributes']=_0x2b3b51[_0x6447('0x3c')]['length']?_0x2b3b51[_0x6447('0x3c')]:_0x397406[_0x6447('0x38')];if(!_0x34198e['query'][_0x6447('0x3e')](_0x6447('0x3f'))){_0x2b3b51[_0x6447('0x25')]=qs[_0x6447('0x25')](_0x34198e['query'][_0x6447('0x25')]);_0x2b3b51['offset']=qs[_0x6447('0x24')](_0x34198e[_0x6447('0x39')][_0x6447('0x24')]);}_0x2b3b51['order']=qs[_0x6447('0x41')](_0x34198e['query'][_0x6447('0x41')]);_0x2b3b51[_0x6447('0x42')]=qs['filters'](_[_0x6447('0x43')](_0x34198e[_0x6447('0x39')],_0x397406[_0x6447('0x44')]));if(_0x34198e[_0x6447('0x39')][_0x6447('0x55')]){_0x2b3b51['where']=_[_0x6447('0x45')](_0x2b3b51[_0x6447('0x42')],{'$or':_['map'](_0x2b3b51[_0x6447('0x3c')],function(_0xa80154){var _0xafff8f={};_0xafff8f[_0xa80154]={'$like':'%'+_0x34198e[_0x6447('0x39')][_0x6447('0x55')]+'%'};return _0xafff8f;})});}_0x2b3b51=_[_0x6447('0x45')]({},_0x2b3b51,_0x34198e['options']);var _0x1e328c={'where':_0x2b3b51[_0x6447('0x42')]};return db[_0x6447('0x34')]['count'](_0x1e328c)['then'](function(_0x5aa336){_0x256326[_0x6447('0x23')]=_0x5aa336;if(_0x34198e[_0x6447('0x39')][_0x6447('0x47')]){_0x2b3b51[_0x6447('0x48')]=[{'all':!![]}];}return db[_0x6447('0x34')]['findAll'](_0x2b3b51);})[_0x6447('0x2c')](function(_0x488b99){_0x256326[_0x6447('0x4a')]=_0x488b99;return _0x256326;})['then'](respondWithFilteredResult(_0x95aa0a,_0x2b3b51,_0x6447('0x54')))[_0x6447('0x4b')](handleError(_0x95aa0a,null,_0x6447('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 72ae703..a1f3b25 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 _0x4542=['../../mysqldb','VoiceQueueReport','update','emit','hasOwnProperty','exports','events'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4542,0xbc));var _0x2454=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4542[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require(_0x2454('0x0'));var VoiceQueueReport=require(_0x2454('0x1'))['db'][_0x2454('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2454('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3200bd){return function(_0x5bf363,_0x45fe98,_0x57c616){VoiceQueueReportEvents[_0x2454('0x4')](_0x3200bd+':'+_0x5bf363['id'],_0x5bf363);VoiceQueueReportEvents[_0x2454('0x4')](_0x3200bd,_0x5bf363);_0x57c616(null);};}for(var e in events){if(events[_0x2454('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x2454('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x0155=['exports','../../mysqldb','VoiceQueueReport','save','update','emit'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x0155,0x175));var _0x5015=function(_0xd382e8,_0x4b9e41){_0xd382e8=_0xd382e8-0x0;var _0x5806ad=_0x0155[_0xd382e8];return _0x5806ad;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x5015('0x0'))['db'][_0x5015('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5015('0x2'),'afterUpdate':_0x5015('0x3'),'afterDestroy':'remove'};function emitEvent(_0x36c862){return function(_0x584f68,_0x1f4959,_0x543014){VoiceQueueReportEvents['emit'](_0x36c862+':'+_0x584f68['id'],_0x584f68);VoiceQueueReportEvents[_0x5015('0x4')](_0x36c862,_0x584f68);_0x543014(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x5015('0x5')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 539fd59..5fa1306 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 _0xe8d1=['report_queue','calleridnum','lodash','util','api','bluebird','rimraf','./voiceQueueReport.attributes','exports','VoiceQueueReport'];(function(_0x1afa64,_0x5f2bc1){var _0x2e41a2=function(_0x373430){while(--_0x373430){_0x1afa64['push'](_0x1afa64['shift']());}};_0x2e41a2(++_0x5f2bc1);}(_0xe8d1,0x66));var _0x1e8d=function(_0x47794f,_0x12c9b3){_0x47794f=_0x47794f-0x0;var _0x2ca51d=_0xe8d1[_0x47794f];return _0x2ca51d;};'use strict';var _=require(_0x1e8d('0x0'));var util=require(_0x1e8d('0x1'));var logger=require('../../config/logger')(_0x1e8d('0x2'));var moment=require('moment');var BPromise=require(_0x1e8d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1e8d('0x4'));var config=require('../../config/environment');var attributes=require(_0x1e8d('0x5'));module[_0x1e8d('0x6')]=function(_0x3d0d89,_0xf70f8b){return _0x3d0d89['define'](_0x1e8d('0x7'),attributes,{'tableName':_0x1e8d('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x1e8d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b87=['calleridnum','lodash','moment','../../config/environment','define','VoiceQueueReport','report_queue','uniqueid'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x0b87,0xd9));var _0x70b8=function(_0x4fe7e4,_0x19aec7){_0x4fe7e4=_0x4fe7e4-0x0;var _0x228d46=_0x0b87[_0x4fe7e4];return _0x228d46;};'use strict';var _=require(_0x70b8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x70b8('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x70b8('0x2'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x548a63,_0x1d5682){return _0x548a63[_0x70b8('0x3')](_0x70b8('0x4'),attributes,{'tableName':_0x70b8('0x5'),'paranoid':![],'indexes':[{'fields':[_0x70b8('0x6')]},{'fields':[_0x70b8('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 6cd7d51..39fac55 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 _0x0e00=['model','CreateVoiceQueueReport','create','body','update','where','UpdateVoiceQueueReport','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map'];(function(_0x2cf603,_0x169a49){var _0x5a2fd4=function(_0x21face){while(--_0x21face){_0x2cf603['push'](_0x2cf603['shift']());}};_0x5a2fd4(++_0x169a49);}(_0x0e00,0x109));var _0x00e0=function(_0x3170cf,_0x55b4b9){_0x3170cf=_0x3170cf-0x0;var _0x31108e=_0x0e00[_0x3170cf];return _0x31108e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x00e0('0x0'));var BPromise=require('bluebird');var rs=require(_0x00e0('0x1'));var fs=require('fs');var Redis=require(_0x00e0('0x2'));var db=require(_0x00e0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x00e0('0x4'))(_0x00e0('0x5'));var config=require(_0x00e0('0x6'));var jayson=require(_0x00e0('0x7'));var client=jayson['client'][_0x00e0('0x8')]({'port':0x232a});config[_0x00e0('0x9')]=_[_0x00e0('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x00e0('0xb'))(new Redis(config[_0x00e0('0x9')]));require(_0x00e0('0xc'))[_0x00e0('0xd')](socket);function respondWithRpcPromise(_0x5a8034,_0x216662,_0x1f1fea){return new BPromise(function(_0x5e4e55,_0x548c56){return client[_0x00e0('0xe')](_0x5a8034,_0x1f1fea)[_0x00e0('0xf')](function(_0x1ed23d){logger[_0x00e0('0x10')](_0x00e0('0x11'),_0x216662,_0x00e0('0x12'));logger[_0x00e0('0x13')](_0x00e0('0x14'),_0x216662,'request\x20sent',JSON[_0x00e0('0x15')](_0x1ed23d));if(_0x1ed23d['error']){if(_0x1ed23d['error'][_0x00e0('0x16')]===0x1f4){logger[_0x00e0('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x216662,_0x1ed23d[_0x00e0('0x17')]['message']);return _0x548c56(_0x1ed23d['error'][_0x00e0('0x18')]);}logger[_0x00e0('0x17')](_0x00e0('0x11'),_0x216662,_0x1ed23d['error'][_0x00e0('0x18')]);return _0x5e4e55(_0x1ed23d[_0x00e0('0x17')]['message']);}else{logger[_0x00e0('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x216662,'request\x20sent');_0x5e4e55(_0x1ed23d[_0x00e0('0x19')][_0x00e0('0x18')]);}})[_0x00e0('0x1a')](function(_0x298cec){logger['error'](_0x00e0('0x11'),_0x216662,_0x298cec);_0x548c56(_0x298cec);});});}exports[_0x00e0('0x1b')]=function(_0x5351fc){var _0x197a5c=this;return new Promise(function(_0x18c7b2,_0x134e93){return db[_0x00e0('0x1c')][_0x00e0('0x1d')]({'raw':_0x5351fc['options']?_0x5351fc[_0x00e0('0x1e')][_0x00e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x5351fc['options']?_0x5351fc[_0x00e0('0x1e')]['where']||null:null,'attributes':_0x5351fc[_0x00e0('0x1e')]?_0x5351fc[_0x00e0('0x1e')][_0x00e0('0x20')]||null:null,'limit':_0x5351fc['options']?_0x5351fc[_0x00e0('0x1e')][_0x00e0('0x21')]||null:null,'include':_0x5351fc['options']?_0x5351fc[_0x00e0('0x1e')][_0x00e0('0x22')]?_[_0x00e0('0x23')](_0x5351fc[_0x00e0('0x1e')][_0x00e0('0x22')],function(_0x4eaa4b){return{'model':db[_0x4eaa4b[_0x00e0('0x24')]],'as':_0x4eaa4b['as'],'attributes':_0x4eaa4b[_0x00e0('0x20')],'include':_0x4eaa4b[_0x00e0('0x22')]?_[_0x00e0('0x23')](_0x4eaa4b['include'],function(_0x3a9e47){return{'model':db[_0x3a9e47[_0x00e0('0x24')]],'as':_0x3a9e47['as'],'attributes':_0x3a9e47[_0x00e0('0x20')],'include':_0x3a9e47[_0x00e0('0x22')]?_[_0x00e0('0x23')](_0x3a9e47[_0x00e0('0x22')],function(_0xcb9bf7){return{'model':db[_0xcb9bf7[_0x00e0('0x24')]],'as':_0xcb9bf7['as'],'attributes':_0xcb9bf7[_0x00e0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x00e0('0xf')](function(_0x22e0d7){logger['info'](_0x00e0('0x1b'),_0x5351fc);logger[_0x00e0('0x13')](_0x00e0('0x1b'),_0x5351fc,JSON[_0x00e0('0x15')](_0x22e0d7));_0x18c7b2(_0x22e0d7);})['catch'](function(_0x4bf39e){logger['error'](_0x00e0('0x1b'),_0x4bf39e[_0x00e0('0x18')],_0x5351fc);_0x134e93(_0x197a5c['error'](0x1f4,_0x4bf39e['message']));});});};exports[_0x00e0('0x25')]=function(_0x3402de){var _0x53d8be=this;return new Promise(function(_0x4f9aae,_0x30c7e4){return db[_0x00e0('0x1c')][_0x00e0('0x26')](_0x3402de[_0x00e0('0x27')],{'raw':_0x3402de[_0x00e0('0x1e')]?_0x3402de['options'][_0x00e0('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x45d3e0){logger['info'](_0x00e0('0x25'),_0x3402de);logger[_0x00e0('0x13')](_0x00e0('0x25'),_0x3402de,JSON[_0x00e0('0x15')](_0x45d3e0));_0x4f9aae(_0x45d3e0);})[_0x00e0('0x1a')](function(_0x364f50){logger[_0x00e0('0x17')](_0x00e0('0x25'),_0x364f50[_0x00e0('0x18')],_0x3402de);_0x30c7e4(_0x53d8be[_0x00e0('0x17')](0x1f4,_0x364f50[_0x00e0('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0xf69b33){var _0x2bd3f7=this;return new Promise(function(_0x492dd3,_0x47ff89){return db[_0x00e0('0x1c')][_0x00e0('0x28')](_0xf69b33[_0x00e0('0x27')],{'raw':_0xf69b33[_0x00e0('0x1e')]?_0xf69b33['options'][_0x00e0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf69b33[_0x00e0('0x1e')]?_0xf69b33['options'][_0x00e0('0x29')]||null:null,'attributes':_0xf69b33[_0x00e0('0x1e')]?_0xf69b33['options'][_0x00e0('0x20')]||null:null,'limit':_0xf69b33[_0x00e0('0x1e')]?_0xf69b33[_0x00e0('0x1e')][_0x00e0('0x21')]||null:null})[_0x00e0('0xf')](function(_0x49c82e){logger[_0x00e0('0x10')](_0x00e0('0x2a'),_0xf69b33);logger[_0x00e0('0x13')](_0x00e0('0x2a'),_0xf69b33,JSON[_0x00e0('0x15')](_0x49c82e));_0x492dd3(_0x49c82e);})['catch'](function(_0x532ef5){logger[_0x00e0('0x17')](_0x00e0('0x2a'),_0x532ef5[_0x00e0('0x18')],_0xf69b33);_0x47ff89(_0x2bd3f7[_0x00e0('0x17')](0x1f4,_0x532ef5[_0x00e0('0x18')]));});});}; \ No newline at end of file +var _0x7c03=['./voiceQueueReport.socket','request','then','info','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','options','raw','where','limit','include','map','model','attributes','debug','CreateVoiceQueueReport','VoiceQueueReport','create','update','body','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x824733,_0x24e272){var _0x50d7ed=function(_0x20ca8f){while(--_0x20ca8f){_0x824733['push'](_0x824733['shift']());}};_0x50d7ed(++_0x24e272);}(_0x7c03,0xa0));var _0x37c0=function(_0x1b4c24,_0x4f56e5){_0x1b4c24=_0x1b4c24-0x0;var _0x254112=_0x7c03[_0x1b4c24];return _0x254112;};'use strict';var _=require(_0x37c0('0x0'));var util=require(_0x37c0('0x1'));var moment=require('moment');var BPromise=require(_0x37c0('0x2'));var rs=require(_0x37c0('0x3'));var fs=require('fs');var Redis=require(_0x37c0('0x4'));var db=require(_0x37c0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x37c0('0x6'))(_0x37c0('0x7'));var config=require(_0x37c0('0x8'));var jayson=require(_0x37c0('0x9'));var client=jayson[_0x37c0('0xa')][_0x37c0('0xb')]({'port':0x232a});config[_0x37c0('0xc')]=_[_0x37c0('0xd')](config[_0x37c0('0xc')],{'host':_0x37c0('0xe'),'port':0x18eb});var socket=require(_0x37c0('0xf'))(new Redis(config[_0x37c0('0xc')]));require(_0x37c0('0x10'))['register'](socket);function respondWithRpcPromise(_0x2dcbf0,_0xb16e2,_0x3a62fe){return new BPromise(function(_0x8b42ba,_0x37673b){return client[_0x37c0('0x11')](_0x2dcbf0,_0x3a62fe)[_0x37c0('0x12')](function(_0x3aeed0){logger[_0x37c0('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0xb16e2,_0x37c0('0x14'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0xb16e2,_0x37c0('0x14'),JSON[_0x37c0('0x15')](_0x3aeed0));if(_0x3aeed0[_0x37c0('0x16')]){if(_0x3aeed0[_0x37c0('0x16')][_0x37c0('0x17')]===0x1f4){logger['error'](_0x37c0('0x18'),_0xb16e2,_0x3aeed0[_0x37c0('0x16')][_0x37c0('0x19')]);return _0x37673b(_0x3aeed0['error'][_0x37c0('0x19')]);}logger['error'](_0x37c0('0x18'),_0xb16e2,_0x3aeed0[_0x37c0('0x16')][_0x37c0('0x19')]);return _0x8b42ba(_0x3aeed0['error'][_0x37c0('0x19')]);}else{logger['info'](_0x37c0('0x18'),_0xb16e2,'request\x20sent');_0x8b42ba(_0x3aeed0[_0x37c0('0x1a')][_0x37c0('0x19')]);}})[_0x37c0('0x1b')](function(_0x2599f7){logger[_0x37c0('0x16')](_0x37c0('0x18'),_0xb16e2,_0x2599f7);_0x37673b(_0x2599f7);});});}exports[_0x37c0('0x1c')]=function(_0x20341c){var _0x567e5b=this;return new Promise(function(_0x28aa83,_0x252ed7){return db['VoiceQueueReport']['findAll']({'raw':_0x20341c['options']?_0x20341c[_0x37c0('0x1d')][_0x37c0('0x1e')]===undefined?!![]:![]:!![],'where':_0x20341c[_0x37c0('0x1d')]?_0x20341c[_0x37c0('0x1d')][_0x37c0('0x1f')]||null:null,'attributes':_0x20341c[_0x37c0('0x1d')]?_0x20341c[_0x37c0('0x1d')]['attributes']||null:null,'limit':_0x20341c[_0x37c0('0x1d')]?_0x20341c[_0x37c0('0x1d')][_0x37c0('0x20')]||null:null,'include':_0x20341c[_0x37c0('0x1d')]?_0x20341c[_0x37c0('0x1d')][_0x37c0('0x21')]?_[_0x37c0('0x22')](_0x20341c[_0x37c0('0x1d')]['include'],function(_0x52b95b){return{'model':db[_0x52b95b['model']],'as':_0x52b95b['as'],'attributes':_0x52b95b['attributes'],'include':_0x52b95b[_0x37c0('0x21')]?_[_0x37c0('0x22')](_0x52b95b[_0x37c0('0x21')],function(_0x573188){return{'model':db[_0x573188[_0x37c0('0x23')]],'as':_0x573188['as'],'attributes':_0x573188[_0x37c0('0x24')],'include':_0x573188[_0x37c0('0x21')]?_[_0x37c0('0x22')](_0x573188['include'],function(_0x3f4a8d){return{'model':db[_0x3f4a8d[_0x37c0('0x23')]],'as':_0x3f4a8d['as'],'attributes':_0x3f4a8d[_0x37c0('0x24')]};}):[]};}):[]};}):[]:[]})[_0x37c0('0x12')](function(_0x4356b3){logger[_0x37c0('0x13')](_0x37c0('0x1c'),_0x20341c);logger[_0x37c0('0x25')](_0x37c0('0x1c'),_0x20341c,JSON[_0x37c0('0x15')](_0x4356b3));_0x28aa83(_0x4356b3);})['catch'](function(_0x4399e2){logger[_0x37c0('0x16')]('GetVoiceQueueReport',_0x4399e2['message'],_0x20341c);_0x252ed7(_0x567e5b[_0x37c0('0x16')](0x1f4,_0x4399e2[_0x37c0('0x19')]));});});};exports[_0x37c0('0x26')]=function(_0x41c433){var _0x1bcabb=this;return new Promise(function(_0x43726b,_0x1ae451){return db[_0x37c0('0x27')][_0x37c0('0x28')](_0x41c433['body'],{'raw':_0x41c433[_0x37c0('0x1d')]?_0x41c433[_0x37c0('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x37c0('0x12')](function(_0x3bcf06){logger['info'](_0x37c0('0x26'),_0x41c433);logger[_0x37c0('0x25')](_0x37c0('0x26'),_0x41c433,JSON[_0x37c0('0x15')](_0x3bcf06));_0x43726b(_0x3bcf06);})[_0x37c0('0x1b')](function(_0x52afea){logger[_0x37c0('0x16')](_0x37c0('0x26'),_0x52afea[_0x37c0('0x19')],_0x41c433);_0x1ae451(_0x1bcabb[_0x37c0('0x16')](0x1f4,_0x52afea[_0x37c0('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4dc02a){var _0x578b99=this;return new Promise(function(_0x9dbb86,_0x56d50e){return db['VoiceQueueReport'][_0x37c0('0x29')](_0x4dc02a[_0x37c0('0x2a')],{'raw':_0x4dc02a['options']?_0x4dc02a[_0x37c0('0x1d')][_0x37c0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dc02a[_0x37c0('0x1d')]?_0x4dc02a['options'][_0x37c0('0x1f')]||null:null,'attributes':_0x4dc02a[_0x37c0('0x1d')]?_0x4dc02a[_0x37c0('0x1d')][_0x37c0('0x24')]||null:null,'limit':_0x4dc02a[_0x37c0('0x1d')]?_0x4dc02a[_0x37c0('0x1d')][_0x37c0('0x20')]||null:null})['then'](function(_0xfff24d){logger[_0x37c0('0x13')](_0x37c0('0x2b'),_0x4dc02a);logger['debug'](_0x37c0('0x2b'),_0x4dc02a,JSON[_0x37c0('0x15')](_0xfff24d));_0x9dbb86(_0xfff24d);})[_0x37c0('0x1b')](function(_0x453360){logger['error'](_0x37c0('0x2b'),_0x453360[_0x37c0('0x19')],_0x4dc02a);_0x56d50e(_0x578b99[_0x37c0('0x16')](0x1f4,_0x453360[_0x37c0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 083f589..b580fdc 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 _0x53ab=['./voiceQueueReport.events','save','remove','update','emit','register','length','voiceQueueReport:'];(function(_0x52eb99,_0xa84755){var _0x60011a=function(_0x36ec3b){while(--_0x36ec3b){_0x52eb99['push'](_0x52eb99['shift']());}};_0x60011a(++_0xa84755);}(_0x53ab,0x130));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueReportEvents=require(_0xb53a('0x0'));var events=[_0xb53a('0x1'),_0xb53a('0x2'),_0xb53a('0x3')];function createListener(_0x19fe58,_0x3e967a){return function(_0x380f5a){_0x3e967a[_0xb53a('0x4')](_0x19fe58,_0x380f5a);};}function removeListener(_0x2f4faf,_0x197c4d){return function(){VoiceQueueReportEvents['removeListener'](_0x2f4faf,_0x197c4d);};}exports[_0xb53a('0x5')]=function(_0x1bac1b){for(var _0x57ab89=0x0,_0x300015=events[_0xb53a('0x6')];_0x57ab89<_0x300015;_0x57ab89++){var _0x57810b=events[_0x57ab89];var _0x2c3b3f=createListener(_0xb53a('0x7')+_0x57810b,_0x1bac1b);VoiceQueueReportEvents['on'](_0x57810b,_0x2c3b3f);}}; \ No newline at end of file +var _0x5df9=['length','voiceQueueReport:','save','remove','update','emit','removeListener','register'];(function(_0xd8fa0f,_0x47724b){var _0x3e95a9=function(_0x40eaaa){while(--_0x40eaaa){_0xd8fa0f['push'](_0xd8fa0f['shift']());}};_0x3e95a9(++_0x47724b);}(_0x5df9,0xea));var _0x95df=function(_0x2eb457,_0x4f137e){_0x2eb457=_0x2eb457-0x0;var _0x56d427=_0x5df9[_0x2eb457];return _0x56d427;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x95df('0x0'),_0x95df('0x1'),_0x95df('0x2')];function createListener(_0x4a0b9b,_0x4fe3a9){return function(_0x188ca5){_0x4fe3a9[_0x95df('0x3')](_0x4a0b9b,_0x188ca5);};}function removeListener(_0x51bd06,_0x46e3fe){return function(){VoiceQueueReportEvents[_0x95df('0x4')](_0x51bd06,_0x46e3fe);};}exports[_0x95df('0x5')]=function(_0x2658ce){for(var _0x49414f=0x0,_0x2ac55a=events[_0x95df('0x6')];_0x49414f<_0x2ac55a;_0x49414f++){var _0x3b2441=events[_0x49414f];var _0x2f6c0a=createListener(_0x95df('0x7')+_0x3b2441,_0x2658ce);VoiceQueueReportEvents['on'](_0x3b2441,_0x2f6c0a);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index b904fcb..18429c5 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 _0x4a52=['get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x250ce7,_0x502ad3){var _0x416428=function(_0x46564d){while(--_0x46564d){_0x250ce7['push'](_0x250ce7['shift']());}};_0x416428(++_0x502ad3);}(_0x4a52,0x15e));var _0x24a5=function(_0x332bec,_0x26ac41){_0x332bec=_0x332bec-0x0;var _0x157a8b=_0x4a52[_0x332bec];return _0x157a8b;};'use strict';var multer=require(_0x24a5('0x0'));var util=require(_0x24a5('0x1'));var path=require(_0x24a5('0x2'));var timeout=require(_0x24a5('0x3'));var express=require(_0x24a5('0x4'));var router=express['Router']();var fs_extra=require(_0x24a5('0x5'));var auth=require(_0x24a5('0x6'));var interaction=require(_0x24a5('0x7'));var config=require(_0x24a5('0x8'));var controller=require(_0x24a5('0x9'));router[_0x24a5('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x24a5('0xa')](_0x24a5('0xb'),auth[_0x24a5('0xc')](),controller[_0x24a5('0xd')]);router['post']('/',auth[_0x24a5('0xc')](),controller[_0x24a5('0xe')]);router[_0x24a5('0xf')](_0x24a5('0xb'),auth['isAuthenticated'](),controller[_0x24a5('0x10')]);router[_0x24a5('0x11')](_0x24a5('0xb'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x12')]);module[_0x24a5('0x13')]=router; \ No newline at end of file +var _0x78ee=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util'];(function(_0x466cb2,_0x329c25){var _0x1efc25=function(_0x2d916e){while(--_0x2d916e){_0x466cb2['push'](_0x466cb2['shift']());}};_0x1efc25(++_0x329c25);}(_0x78ee,0x1d2));var _0xe78e=function(_0x381de4,_0x1d55a4){_0x381de4=_0x381de4-0x0;var _0x3f2c41=_0x78ee[_0x381de4];return _0x3f2c41;};'use strict';var multer=require(_0xe78e('0x0'));var util=require(_0xe78e('0x1'));var path=require(_0xe78e('0x2'));var timeout=require(_0xe78e('0x3'));var express=require('express');var router=express[_0xe78e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe78e('0x5'));var interaction=require(_0xe78e('0x6'));var config=require(_0xe78e('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0xe78e('0x8')]('/',auth[_0xe78e('0x9')](),controller[_0xe78e('0xa')]);router['get'](_0xe78e('0xb'),auth[_0xe78e('0x9')](),controller[_0xe78e('0xc')]);router[_0xe78e('0xd')]('/',auth['isAuthenticated'](),controller[_0xe78e('0xe')]);router['put'](_0xe78e('0xb'),auth[_0xe78e('0x9')](),controller[_0xe78e('0xf')]);router[_0xe78e('0x10')](_0xe78e('0xb'),auth[_0xe78e('0x9')](),controller[_0xe78e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 1b11b3e..5c3b7bb 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 _0x4e68=['format','moment','exports','STRING'];(function(_0x194632,_0x50cb69){var _0x4ccbf=function(_0x203561){while(--_0x203561){_0x194632['push'](_0x194632['shift']());}};_0x4ccbf(++_0x50cb69);}(_0x4e68,0x191));var _0x84e6=function(_0x393a0b,_0x2bfdee){_0x393a0b=_0x393a0b-0x0;var _0xae9ec8=_0x4e68[_0x393a0b];return _0xae9ec8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x84e6('0x0'));module[_0x84e6('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x84e6('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x84e6('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x84e6('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x84e6('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x84e6('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x84e6('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x84e6('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x84e6('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x84e6('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x4209=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING','DATE'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x4209,0x11c));var _0x9420=function(_0x13ae3b,_0x4ddd7c){_0x13ae3b=_0x13ae3b-0x0;var _0x145764=_0x4209[_0x13ae3b];return _0x145764;};'use strict';var Sequelize=require(_0x9420('0x0'));var moment=require(_0x9420('0x1'));module['exports']={'time':{'type':Sequelize[_0x9420('0x2')]},'callid':{'type':Sequelize[_0x9420('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x9420('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9420('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9420('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9420('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9420('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9420('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9420('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9420('0x3')],'allowNull':![],'defaultValue':moment()[_0x9420('0x4')](_0x9420('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8262527..b78d362 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 _0x2a5a=['fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','rows','catch','params','include','find','create','body','rimraf','zip-dir'];(function(_0x9b980,_0x4fa83c){var _0x2c123d=function(_0x48c094){while(--_0x48c094){_0x9b980['push'](_0x9b980['shift']());}};_0x2c123d(++_0x4fa83c);}(_0x2a5a,0xdf));var _0xa2a5=function(_0x37d165,_0x3a2cfe){_0x37d165=_0x37d165-0x0;var _0x2f1729=_0x2a5a[_0x37d165];return _0x2f1729;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2a5('0x0'));var zipdir=require(_0xa2a5('0x1'));var jsonpatch=require(_0xa2a5('0x2'));var rp=require(_0xa2a5('0x3'));var moment=require(_0xa2a5('0x4'));var BPromise=require(_0xa2a5('0x5'));var Mustache=require('mustache');var util=require(_0xa2a5('0x6'));var path=require('path');var sox=require(_0xa2a5('0x7'));var csv=require(_0xa2a5('0x8'));var ejs=require(_0xa2a5('0x9'));var fs=require('fs');var fs_extra=require(_0xa2a5('0xa'));var _=require('lodash');var squel=require(_0xa2a5('0xb'));var crypto=require(_0xa2a5('0xc'));var jsforce=require(_0xa2a5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa2a5('0x8'));var querystring=require('querystring');var Papa=require(_0xa2a5('0xe'));var Redis=require(_0xa2a5('0xf'));var authService=require(_0xa2a5('0x10'));var qs=require(_0xa2a5('0x11'));var as=require(_0xa2a5('0x12'));var hardwareService=require(_0xa2a5('0x13'));var logger=require(_0xa2a5('0x14'))('api');var utils=require(_0xa2a5('0x15'));var config=require(_0xa2a5('0x16'));var licenseUtil=require(_0xa2a5('0x17'));var db=require(_0xa2a5('0x18'))['db'];function respondWithStatusCode(_0x327e81,_0x100469){_0x100469=_0x100469||0xcc;return function(_0x2020e4){if(_0x2020e4){return _0x327e81['sendStatus'](_0x100469);}return _0x327e81['status'](_0x100469)[_0xa2a5('0x19')]();};}function respondWithResult(_0xfa5e67,_0x4c6731){_0x4c6731=_0x4c6731||0xc8;return function(_0x30a191){if(_0x30a191){return _0xfa5e67['status'](_0x4c6731)['json'](_0x30a191);}};}function respondWithFilteredResult(_0x1fb08d,_0x37ba17){return function(_0x24a166){if(_0x24a166){var _0x496f80=typeof _0x37ba17[_0xa2a5('0x1a')]===_0xa2a5('0x1b')&&typeof _0x37ba17[_0xa2a5('0x1c')]===_0xa2a5('0x1b');var _0x3a221e=_0x24a166['count'];var _0x21ec99=_0x496f80?0x0:_0x37ba17['offset'];var _0x1dea5b=_0x496f80?_0x24a166['count']:_0x37ba17[_0xa2a5('0x1a')]+_0x37ba17['limit'];var _0x7c1b67;if(_0x1dea5b>=_0x3a221e){_0x1dea5b=_0x3a221e;_0x7c1b67=0xc8;}else{_0x7c1b67=0xce;}_0x1fb08d[_0xa2a5('0x1d')](_0x7c1b67);return _0x1fb08d[_0xa2a5('0x1e')](_0xa2a5('0x1f'),_0x21ec99+'-'+_0x1dea5b+'/'+_0x3a221e)[_0xa2a5('0x20')](_0x24a166);}return null;};}function patchUpdates(_0x7646b6){return function(_0x1a78f5){try{jsonpatch[_0xa2a5('0x21')](_0x1a78f5,_0x7646b6,!![]);}catch(_0x343442){return BPromise[_0xa2a5('0x22')](_0x343442);}return _0x1a78f5[_0xa2a5('0x23')]();};}function saveUpdates(_0x4a2d51,_0x314de2){return function(_0x484487){if(_0x484487){return _0x484487[_0xa2a5('0x24')](_0x4a2d51)[_0xa2a5('0x25')](function(_0x1a3b28){return _0x1a3b28;});}return null;};}function removeEntity(_0x18bf2b,_0xf3601b){return function(_0x3170f9){if(_0x3170f9){return _0x3170f9[_0xa2a5('0x26')]()[_0xa2a5('0x25')](function(){_0x18bf2b[_0xa2a5('0x1d')](0xcc)[_0xa2a5('0x19')]();});}};}function handleEntityNotFound(_0x47c879,_0x5c6a29){return function(_0x12eefe){if(!_0x12eefe){_0x47c879[_0xa2a5('0x27')](0x194);}return _0x12eefe;};}function handleError(_0x3c467f,_0x39cf20){_0x39cf20=_0x39cf20||0x1f4;return function(_0x4232c1){logger[_0xa2a5('0x28')](_0x4232c1[_0xa2a5('0x29')]);if(_0x4232c1[_0xa2a5('0x2a')]){delete _0x4232c1['name'];}_0x3c467f[_0xa2a5('0x1d')](_0x39cf20)[_0xa2a5('0x2b')](_0x4232c1);};}exports['index']=function(_0x811508,_0x5758b0){var _0x583115={},_0x2763cc={},_0xcabd39={'count':0x0,'rows':[]};var _0x5d9ef3=_[_0xa2a5('0x2c')](db[_0xa2a5('0x2d')][_0xa2a5('0x2e')],function(_0x36aeb4){return{'name':_0x36aeb4[_0xa2a5('0x2f')],'type':_0x36aeb4[_0xa2a5('0x30')][_0xa2a5('0x31')]};});_0x2763cc[_0xa2a5('0x32')]=_[_0xa2a5('0x2c')](_0x5d9ef3,_0xa2a5('0x2a'));_0x2763cc['query']=_[_0xa2a5('0x33')](_0x811508[_0xa2a5('0x34')]);_0x2763cc[_0xa2a5('0x35')]=_[_0xa2a5('0x36')](_0x2763cc['model'],_0x2763cc['query']);_0x583115[_0xa2a5('0x37')]=_[_0xa2a5('0x36')](_0x2763cc['model'],qs['fields'](_0x811508['query'][_0xa2a5('0x38')]));_0x583115[_0xa2a5('0x37')]=_0x583115[_0xa2a5('0x37')][_0xa2a5('0x39')]?_0x583115['attributes']:_0x2763cc[_0xa2a5('0x32')];if(!_0x811508['query']['hasOwnProperty']('nolimit')){_0x583115['limit']=qs['limit'](_0x811508['query'][_0xa2a5('0x1c')]);_0x583115[_0xa2a5('0x1a')]=qs[_0xa2a5('0x1a')](_0x811508[_0xa2a5('0x34')]['offset']);}_0x583115[_0xa2a5('0x3a')]=qs[_0xa2a5('0x3b')](_0x811508[_0xa2a5('0x34')][_0xa2a5('0x3b')]);_0x583115[_0xa2a5('0x3c')]=qs[_0xa2a5('0x35')](_[_0xa2a5('0x3d')](_0x811508[_0xa2a5('0x34')],_0x2763cc[_0xa2a5('0x35')]),_0x5d9ef3);if(_0x811508[_0xa2a5('0x34')]['filter']){_0x583115['where']=_[_0xa2a5('0x3e')](_0x583115[_0xa2a5('0x3c')],{'$or':_[_0xa2a5('0x2c')](_0x5d9ef3,function(_0x15a970){if(_0x15a970['type']!==_0xa2a5('0x3f')){var _0x5a4701={};_0x5a4701[_0x15a970[_0xa2a5('0x2a')]]={'$like':'%'+_0x811508['query'][_0xa2a5('0x40')]+'%'};return _0x5a4701;}})});}_0x583115=_[_0xa2a5('0x3e')]({},_0x583115,_0x811508[_0xa2a5('0x41')]);var _0x46186b={'where':_0x583115[_0xa2a5('0x3c')]};return db['VoiceQueuesLog']['count'](_0x46186b)[_0xa2a5('0x25')](function(_0xfe1461){_0xcabd39[_0xa2a5('0x42')]=_0xfe1461;if(_0x811508['query'][_0xa2a5('0x43')]){_0x583115['include']=[{'all':!![]}];}return db[_0xa2a5('0x2d')]['findAll'](_0x583115);})['then'](function(_0x311e05){_0xcabd39[_0xa2a5('0x44')]=_0x311e05;return _0xcabd39;})[_0xa2a5('0x25')](respondWithFilteredResult(_0x5758b0,_0x583115))[_0xa2a5('0x45')](handleError(_0x5758b0,null));};exports['show']=function(_0xa48031,_0x3bad7f){var _0x4d1b6a={'raw':!![],'where':{'id':_0xa48031[_0xa2a5('0x46')]['id']}},_0xc47b6={};_0xc47b6['model']=_[_0xa2a5('0x33')](db[_0xa2a5('0x2d')]['rawAttributes']);_0xc47b6[_0xa2a5('0x34')]=_[_0xa2a5('0x33')](_0xa48031[_0xa2a5('0x34')]);_0xc47b6[_0xa2a5('0x35')]=_[_0xa2a5('0x36')](_0xc47b6[_0xa2a5('0x32')],_0xc47b6['query']);_0x4d1b6a['attributes']=_['intersection'](_0xc47b6[_0xa2a5('0x32')],qs[_0xa2a5('0x38')](_0xa48031[_0xa2a5('0x34')][_0xa2a5('0x38')]));_0x4d1b6a[_0xa2a5('0x37')]=_0x4d1b6a[_0xa2a5('0x37')][_0xa2a5('0x39')]?_0x4d1b6a[_0xa2a5('0x37')]:_0xc47b6[_0xa2a5('0x32')];if(_0xa48031['query'][_0xa2a5('0x43')]){_0x4d1b6a[_0xa2a5('0x47')]=[{'all':!![]}];}_0x4d1b6a=_[_0xa2a5('0x3e')]({},_0x4d1b6a,_0xa48031['options']);return db['VoiceQueuesLog'][_0xa2a5('0x48')](_0x4d1b6a)['then'](handleEntityNotFound(_0x3bad7f,null))[_0xa2a5('0x25')](respondWithResult(_0x3bad7f,null))[_0xa2a5('0x45')](handleError(_0x3bad7f,null));};exports['create']=function(_0x4becb2,_0x433ca2){return db[_0xa2a5('0x2d')][_0xa2a5('0x49')](_0x4becb2[_0xa2a5('0x4a')],{})['then'](respondWithResult(_0x433ca2,0xc9))[_0xa2a5('0x45')](handleError(_0x433ca2,null));};exports[_0xa2a5('0x24')]=function(_0x349cdb,_0x4c1cbd){if(_0x349cdb[_0xa2a5('0x4a')]['id']){delete _0x349cdb[_0xa2a5('0x4a')]['id'];}return db[_0xa2a5('0x2d')]['find']({'where':{'id':_0x349cdb[_0xa2a5('0x46')]['id']}})[_0xa2a5('0x25')](handleEntityNotFound(_0x4c1cbd,null))[_0xa2a5('0x25')](saveUpdates(_0x349cdb[_0xa2a5('0x4a')],null))[_0xa2a5('0x25')](respondWithResult(_0x4c1cbd,null))[_0xa2a5('0x45')](handleError(_0x4c1cbd,null));};exports['destroy']=function(_0x4218d0,_0x1ac0b3){return db[_0xa2a5('0x2d')][_0xa2a5('0x48')]({'where':{'id':_0x4218d0[_0xa2a5('0x46')]['id']}})[_0xa2a5('0x25')](handleEntityNotFound(_0x1ac0b3,null))[_0xa2a5('0x25')](removeEntity(_0x1ac0b3,null))[_0xa2a5('0x45')](handleError(_0x1ac0b3,null));}; \ No newline at end of file +var _0xc4ed=['findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','VoiceQueuesLog','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','VIRTUAL','filter','merge','options','where','then','includeAll','include'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc4ed,0xe6));var _0xdc4e=function(_0x2bf5bd,_0x120787){_0x2bf5bd=_0x2bf5bd-0x0;var _0xc810c0=_0xc4ed[_0x2bf5bd];return _0xc810c0;};'use strict';var emlformat=require(_0xdc4e('0x0'));var rimraf=require(_0xdc4e('0x1'));var zipdir=require(_0xdc4e('0x2'));var jsonpatch=require(_0xdc4e('0x3'));var rp=require(_0xdc4e('0x4'));var moment=require(_0xdc4e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc4e('0x6'));var util=require('util');var path=require(_0xdc4e('0x7'));var sox=require(_0xdc4e('0x8'));var csv=require(_0xdc4e('0x9'));var ejs=require(_0xdc4e('0xa'));var fs=require('fs');var fs_extra=require(_0xdc4e('0xb'));var _=require(_0xdc4e('0xc'));var squel=require(_0xdc4e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdc4e('0xe'));var Papa=require('papaparse');var Redis=require(_0xdc4e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdc4e('0x10'));var hardwareService=require(_0xdc4e('0x11'));var logger=require(_0xdc4e('0x12'))(_0xdc4e('0x13'));var utils=require(_0xdc4e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdc4e('0x15'));var db=require(_0xdc4e('0x16'))['db'];function respondWithStatusCode(_0x19d885,_0x2e5332){_0x2e5332=_0x2e5332||0xcc;return function(_0x1a6f93){if(_0x1a6f93){return _0x19d885[_0xdc4e('0x17')](_0x2e5332);}return _0x19d885[_0xdc4e('0x18')](_0x2e5332)[_0xdc4e('0x19')]();};}function respondWithResult(_0x1f14cb,_0x386d5e){_0x386d5e=_0x386d5e||0xc8;return function(_0x3a5675){if(_0x3a5675){return _0x1f14cb['status'](_0x386d5e)[_0xdc4e('0x1a')](_0x3a5675);}};}function respondWithFilteredResult(_0xa71126,_0x1f043d){return function(_0x3c006e){if(_0x3c006e){var _0x36d464=typeof _0x1f043d['offset']==='undefined'&&typeof _0x1f043d['limit']===_0xdc4e('0x1b');var _0x16ef32=_0x3c006e[_0xdc4e('0x1c')];var _0x4ec2e6=_0x36d464?0x0:_0x1f043d[_0xdc4e('0x1d')];var _0x3d7127=_0x36d464?_0x3c006e[_0xdc4e('0x1c')]:_0x1f043d[_0xdc4e('0x1d')]+_0x1f043d[_0xdc4e('0x1e')];var _0x44d39e;if(_0x3d7127>=_0x16ef32){_0x3d7127=_0x16ef32;_0x44d39e=0xc8;}else{_0x44d39e=0xce;}_0xa71126[_0xdc4e('0x18')](_0x44d39e);return _0xa71126[_0xdc4e('0x1f')](_0xdc4e('0x20'),_0x4ec2e6+'-'+_0x3d7127+'/'+_0x16ef32)[_0xdc4e('0x1a')](_0x3c006e);}return null;};}function patchUpdates(_0x1ecd93){return function(_0x565ab3){try{jsonpatch[_0xdc4e('0x21')](_0x565ab3,_0x1ecd93,!![]);}catch(_0x2ca375){return BPromise[_0xdc4e('0x22')](_0x2ca375);}return _0x565ab3[_0xdc4e('0x23')]();};}function saveUpdates(_0x406aed,_0x14f198){return function(_0x295c99){if(_0x295c99){return _0x295c99[_0xdc4e('0x24')](_0x406aed)['then'](function(_0x4a0489){return _0x4a0489;});}return null;};}function removeEntity(_0xfe10d5,_0x19a25a){return function(_0xb0799){if(_0xb0799){return _0xb0799[_0xdc4e('0x25')]()['then'](function(){_0xfe10d5[_0xdc4e('0x18')](0xcc)[_0xdc4e('0x19')]();});}};}function handleEntityNotFound(_0x22f077,_0x43873f){return function(_0x47825f){if(!_0x47825f){_0x22f077[_0xdc4e('0x17')](0x194);}return _0x47825f;};}function handleError(_0x27f20b,_0x28370){_0x28370=_0x28370||0x1f4;return function(_0x4eb3aa){logger['error'](_0x4eb3aa[_0xdc4e('0x26')]);if(_0x4eb3aa[_0xdc4e('0x27')]){delete _0x4eb3aa[_0xdc4e('0x27')];}_0x27f20b[_0xdc4e('0x18')](_0x28370)[_0xdc4e('0x28')](_0x4eb3aa);};}exports['index']=function(_0x3004b4,_0x251fce){var _0x129e44={},_0x10affc={},_0x5d2fe7={'count':0x0,'rows':[]};var _0x2fac13=_[_0xdc4e('0x29')](db[_0xdc4e('0x2a')][_0xdc4e('0x2b')],function(_0x5efb60){return{'name':_0x5efb60['fieldName'],'type':_0x5efb60[_0xdc4e('0x2c')][_0xdc4e('0x2d')]};});_0x10affc[_0xdc4e('0x2e')]=_['map'](_0x2fac13,'name');_0x10affc[_0xdc4e('0x2f')]=_[_0xdc4e('0x30')](_0x3004b4[_0xdc4e('0x2f')]);_0x10affc[_0xdc4e('0x31')]=_[_0xdc4e('0x32')](_0x10affc[_0xdc4e('0x2e')],_0x10affc['query']);_0x129e44[_0xdc4e('0x33')]=_['intersection'](_0x10affc[_0xdc4e('0x2e')],qs[_0xdc4e('0x34')](_0x3004b4[_0xdc4e('0x2f')][_0xdc4e('0x34')]));_0x129e44[_0xdc4e('0x33')]=_0x129e44[_0xdc4e('0x33')][_0xdc4e('0x35')]?_0x129e44[_0xdc4e('0x33')]:_0x10affc[_0xdc4e('0x2e')];if(!_0x3004b4[_0xdc4e('0x2f')][_0xdc4e('0x36')]('nolimit')){_0x129e44[_0xdc4e('0x1e')]=qs[_0xdc4e('0x1e')](_0x3004b4[_0xdc4e('0x2f')]['limit']);_0x129e44['offset']=qs['offset'](_0x3004b4[_0xdc4e('0x2f')][_0xdc4e('0x1d')]);}_0x129e44[_0xdc4e('0x37')]=qs['sort'](_0x3004b4[_0xdc4e('0x2f')][_0xdc4e('0x38')]);_0x129e44['where']=qs[_0xdc4e('0x31')](_[_0xdc4e('0x39')](_0x3004b4['query'],_0x10affc['filters']),_0x2fac13);if(_0x3004b4[_0xdc4e('0x2f')]['filter']){_0x129e44['where']=_['merge'](_0x129e44['where'],{'$or':_['map'](_0x2fac13,function(_0x4b3cbc){if(_0x4b3cbc[_0xdc4e('0x2c')]!==_0xdc4e('0x3a')){var _0x344c22={};_0x344c22[_0x4b3cbc[_0xdc4e('0x27')]]={'$like':'%'+_0x3004b4['query'][_0xdc4e('0x3b')]+'%'};return _0x344c22;}})});}_0x129e44=_[_0xdc4e('0x3c')]({},_0x129e44,_0x3004b4[_0xdc4e('0x3d')]);var _0x36410a={'where':_0x129e44[_0xdc4e('0x3e')]};return db[_0xdc4e('0x2a')]['count'](_0x36410a)[_0xdc4e('0x3f')](function(_0x15d3f2){_0x5d2fe7[_0xdc4e('0x1c')]=_0x15d3f2;if(_0x3004b4['query'][_0xdc4e('0x40')]){_0x129e44[_0xdc4e('0x41')]=[{'all':!![]}];}return db[_0xdc4e('0x2a')][_0xdc4e('0x42')](_0x129e44);})[_0xdc4e('0x3f')](function(_0x1ebfb3){_0x5d2fe7[_0xdc4e('0x43')]=_0x1ebfb3;return _0x5d2fe7;})[_0xdc4e('0x3f')](respondWithFilteredResult(_0x251fce,_0x129e44))[_0xdc4e('0x44')](handleError(_0x251fce,null));};exports[_0xdc4e('0x45')]=function(_0x5f5864,_0x4181bf){var _0x4ae139={'raw':!![],'where':{'id':_0x5f5864[_0xdc4e('0x46')]['id']}},_0x16251a={};_0x16251a[_0xdc4e('0x2e')]=_['keys'](db[_0xdc4e('0x2a')]['rawAttributes']);_0x16251a[_0xdc4e('0x2f')]=_[_0xdc4e('0x30')](_0x5f5864[_0xdc4e('0x2f')]);_0x16251a[_0xdc4e('0x31')]=_[_0xdc4e('0x32')](_0x16251a['model'],_0x16251a[_0xdc4e('0x2f')]);_0x4ae139[_0xdc4e('0x33')]=_[_0xdc4e('0x32')](_0x16251a[_0xdc4e('0x2e')],qs[_0xdc4e('0x34')](_0x5f5864[_0xdc4e('0x2f')][_0xdc4e('0x34')]));_0x4ae139[_0xdc4e('0x33')]=_0x4ae139[_0xdc4e('0x33')][_0xdc4e('0x35')]?_0x4ae139[_0xdc4e('0x33')]:_0x16251a[_0xdc4e('0x2e')];if(_0x5f5864[_0xdc4e('0x2f')]['includeAll']){_0x4ae139['include']=[{'all':!![]}];}_0x4ae139=_[_0xdc4e('0x3c')]({},_0x4ae139,_0x5f5864[_0xdc4e('0x3d')]);return db['VoiceQueuesLog'][_0xdc4e('0x47')](_0x4ae139)['then'](handleEntityNotFound(_0x4181bf,null))['then'](respondWithResult(_0x4181bf,null))[_0xdc4e('0x44')](handleError(_0x4181bf,null));};exports[_0xdc4e('0x48')]=function(_0x4c2890,_0x4fab9a){return db[_0xdc4e('0x2a')][_0xdc4e('0x48')](_0x4c2890['body'],{})[_0xdc4e('0x3f')](respondWithResult(_0x4fab9a,0xc9))['catch'](handleError(_0x4fab9a,null));};exports['update']=function(_0x164855,_0x2b4889){if(_0x164855[_0xdc4e('0x49')]['id']){delete _0x164855[_0xdc4e('0x49')]['id'];}return db[_0xdc4e('0x2a')][_0xdc4e('0x47')]({'where':{'id':_0x164855[_0xdc4e('0x46')]['id']}})[_0xdc4e('0x3f')](handleEntityNotFound(_0x2b4889,null))[_0xdc4e('0x3f')](saveUpdates(_0x164855[_0xdc4e('0x49')],null))[_0xdc4e('0x3f')](respondWithResult(_0x2b4889,null))[_0xdc4e('0x44')](handleError(_0x2b4889,null));};exports[_0xdc4e('0x25')]=function(_0xdd8a94,_0x1091d1){return db['VoiceQueuesLog'][_0xdc4e('0x47')]({'where':{'id':_0xdd8a94[_0xdc4e('0x46')]['id']}})[_0xdc4e('0x3f')](handleEntityNotFound(_0x1091d1,null))[_0xdc4e('0x3f')](removeEntity(_0x1091d1,null))[_0xdc4e('0x44')](handleError(_0x1091d1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 45584ab..d4d977b 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 _0x2bbb=['voice_queues_log','event_dtm','event','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog'];(function(_0x20a477,_0x53bfe5){var _0x10c9b9=function(_0x40ed2b){while(--_0x40ed2b){_0x20a477['push'](_0x20a477['shift']());}};_0x10c9b9(++_0x53bfe5);}(_0x2bbb,0x85));var _0xb2bb=function(_0x196a3f,_0x3d9060){_0x196a3f=_0x196a3f-0x0;var _0x285d8e=_0x2bbb[_0x196a3f];return _0x285d8e;};'use strict';var _=require('lodash');var util=require(_0xb2bb('0x0'));var logger=require(_0xb2bb('0x1'))(_0xb2bb('0x2'));var moment=require('moment');var BPromise=require(_0xb2bb('0x3'));var rp=require(_0xb2bb('0x4'));var fs=require('fs');var path=require(_0xb2bb('0x5'));var rimraf=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var attributes=require(_0xb2bb('0x8'));module['exports']=function(_0x3581e2,_0x5bee47){return _0x3581e2['define'](_0xb2bb('0x9'),attributes,{'tableName':_0xb2bb('0xa'),'paranoid':![],'indexes':[{'name':_0xb2bb('0xb'),'fields':[_0xb2bb('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x2ed4=['request-promise','path','rimraf','../../config/environment','define','VoiceQueuesLog','lodash','../../config/logger','api','moment','bluebird'];(function(_0x40f67e,_0x51a3e1){var _0x5db1bd=function(_0x5149cf){while(--_0x5149cf){_0x40f67e['push'](_0x40f67e['shift']());}};_0x5db1bd(++_0x51a3e1);}(_0x2ed4,0x1b3));var _0x42ed=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x2ed4[_0x352e09];return _0x1b7094;};'use strict';var _=require(_0x42ed('0x0'));var util=require('util');var logger=require(_0x42ed('0x1'))(_0x42ed('0x2'));var moment=require(_0x42ed('0x3'));var BPromise=require(_0x42ed('0x4'));var rp=require(_0x42ed('0x5'));var fs=require('fs');var path=require(_0x42ed('0x6'));var rimraf=require(_0x42ed('0x7'));var config=require(_0x42ed('0x8'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x453279,_0xfc6e2){return _0x453279[_0x42ed('0x9')](_0x42ed('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','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 a18f0dd..846537f 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 _0xac3d=['rpc','../../config/environment','client','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x234cdb,_0x28750b){var _0x1d18bb=function(_0x42c67e){while(--_0x42c67e){_0x234cdb['push'](_0x234cdb['shift']());}};_0x1d18bb(++_0x28750b);}(_0xac3d,0x92));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdac3('0x0'));var util=require(_0xdac3('0x1'));var moment=require('moment');var BPromise=require(_0xdac3('0x2'));var rs=require(_0xdac3('0x3'));var fs=require('fs');var Redis=require(_0xdac3('0x4'));var db=require(_0xdac3('0x5'))['db'];var utils=require(_0xdac3('0x6'));var logger=require(_0xdac3('0x7'))(_0xdac3('0x8'));var config=require(_0xdac3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdac3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1731f3,_0x4dbb07,_0x1218be){return new BPromise(function(_0xafc0f8,_0x114eba){return client['request'](_0x1731f3,_0x1218be)[_0xdac3('0xb')](function(_0x40a7ba){logger[_0xdac3('0xc')](_0xdac3('0xd'),_0x4dbb07,_0xdac3('0xe'));logger[_0xdac3('0xf')](_0xdac3('0x10'),_0x4dbb07,_0xdac3('0xe'),JSON[_0xdac3('0x11')](_0x40a7ba));if(_0x40a7ba[_0xdac3('0x12')]){if(_0x40a7ba['error'][_0xdac3('0x13')]===0x1f4){logger[_0xdac3('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4dbb07,_0x40a7ba[_0xdac3('0x12')]['message']);return _0x114eba(_0x40a7ba[_0xdac3('0x12')]['message']);}logger['error'](_0xdac3('0xd'),_0x4dbb07,_0x40a7ba[_0xdac3('0x12')][_0xdac3('0x14')]);return _0xafc0f8(_0x40a7ba[_0xdac3('0x12')][_0xdac3('0x14')]);}else{logger['info'](_0xdac3('0xd'),_0x4dbb07,_0xdac3('0xe'));_0xafc0f8(_0x40a7ba[_0xdac3('0x15')][_0xdac3('0x14')]);}})['catch'](function(_0x221014){logger[_0xdac3('0x12')](_0xdac3('0xd'),_0x4dbb07,_0x221014);_0x114eba(_0x221014);});});} \ No newline at end of file +var _0x04f1=['request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x04f1,0xc1));var _0x104f=function(_0x1be289,_0x5dc88c){_0x1be289=_0x1be289-0x0;var _0x49296c=_0x04f1[_0x1be289];return _0x49296c;};'use strict';var _=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var moment=require(_0x104f('0x2'));var BPromise=require(_0x104f('0x3'));var rs=require(_0x104f('0x4'));var fs=require('fs');var Redis=require(_0x104f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x104f('0x6'));var logger=require(_0x104f('0x7'))(_0x104f('0x8'));var config=require(_0x104f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x104f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10a9ed,_0xa6dd14,_0x235367){return new BPromise(function(_0x117bd1,_0x2097da){return client[_0x104f('0xb')](_0x10a9ed,_0x235367)[_0x104f('0xc')](function(_0x5e8f1c){logger['info'](_0x104f('0xd'),_0xa6dd14,_0x104f('0xe'));logger['debug'](_0x104f('0xf'),_0xa6dd14,_0x104f('0xe'),JSON[_0x104f('0x10')](_0x5e8f1c));if(_0x5e8f1c['error']){if(_0x5e8f1c[_0x104f('0x11')][_0x104f('0x12')]===0x1f4){logger[_0x104f('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0xa6dd14,_0x5e8f1c['error'][_0x104f('0x13')]);return _0x2097da(_0x5e8f1c['error']['message']);}logger[_0x104f('0x11')](_0x104f('0xd'),_0xa6dd14,_0x5e8f1c[_0x104f('0x11')]['message']);return _0x117bd1(_0x5e8f1c[_0x104f('0x11')][_0x104f('0x13')]);}else{logger[_0x104f('0x14')](_0x104f('0xd'),_0xa6dd14,'request\x20sent');_0x117bd1(_0x5e8f1c[_0x104f('0x15')][_0x104f('0x13')]);}})[_0x104f('0x16')](function(_0x226544){logger[_0x104f('0x11')](_0x104f('0xd'),_0xa6dd14,_0x226544);_0x2097da(_0x226544);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d31b610..bcec0bb 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 _0xa004=['/:id','show','/:id/download','isAuthenticated','download','/:id/downloads','downloadTranscribe','post','/:id/transcribe','runTranscribe','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./voiceRecording.controller','index','get','/describe','describe'];(function(_0x5758c9,_0x3e7929){var _0x46892f=function(_0x314d05){while(--_0x314d05){_0x5758c9['push'](_0x5758c9['shift']());}};_0x46892f(++_0x3e7929);}(_0xa004,0x107));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4a00('0x0'));var util=require(_0x4a00('0x1'));var path=require(_0x4a00('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a00('0x3'));var router=express[_0x4a00('0x4')]();var fs_extra=require(_0x4a00('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4a00('0x6'));var config=require('../../config/environment');var controller=require(_0x4a00('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4a00('0x8')]);router[_0x4a00('0x9')](_0x4a00('0xa'),auth['isAuthenticated'](),controller[_0x4a00('0xb')]);router[_0x4a00('0x9')](_0x4a00('0xc'),auth['isAuthenticated'](),controller[_0x4a00('0xd')]);router[_0x4a00('0x9')](_0x4a00('0xe'),auth[_0x4a00('0xf')](),controller[_0x4a00('0x10')]);router[_0x4a00('0x9')](_0x4a00('0x11'),controller['downloads']);router[_0x4a00('0x9')]('/:id/transcribe',auth[_0x4a00('0xf')](),controller[_0x4a00('0x12')]);router[_0x4a00('0x13')]('/',auth[_0x4a00('0xf')](),controller['create']);router[_0x4a00('0x13')](_0x4a00('0x14'),auth[_0x4a00('0xf')](),controller[_0x4a00('0x15')]);router['put'](_0x4a00('0xc'),auth[_0x4a00('0xf')](),controller[_0x4a00('0x16')]);router[_0x4a00('0x17')](_0x4a00('0xc'),auth[_0x4a00('0xf')](),controller['destroy']);module[_0x4a00('0x18')]=router; \ No newline at end of file +var _0x1489=['runTranscribe','put','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1489,0x116));var _0x9148=function(_0xca1585,_0x219dfb){_0xca1585=_0xca1585-0x0;var _0x117736=_0x1489[_0xca1585];return _0x117736;};'use strict';var multer=require(_0x9148('0x0'));var util=require(_0x9148('0x1'));var path=require(_0x9148('0x2'));var timeout=require(_0x9148('0x3'));var express=require(_0x9148('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9148('0x5'));var interaction=require(_0x9148('0x6'));var config=require(_0x9148('0x7'));var controller=require(_0x9148('0x8'));router['get']('/',auth[_0x9148('0x9')](),controller[_0x9148('0xa')]);router[_0x9148('0xb')](_0x9148('0xc'),auth['isAuthenticated'](),controller[_0x9148('0xd')]);router[_0x9148('0xb')](_0x9148('0xe'),auth['isAuthenticated'](),controller[_0x9148('0xf')]);router[_0x9148('0xb')](_0x9148('0x10'),auth[_0x9148('0x9')](),controller['download']);router[_0x9148('0xb')](_0x9148('0x11'),controller['downloads']);router[_0x9148('0xb')]('/:id/transcribe',auth[_0x9148('0x9')](),controller[_0x9148('0x12')]);router[_0x9148('0x13')]('/',auth['isAuthenticated'](),controller[_0x9148('0x14')]);router[_0x9148('0x13')](_0x9148('0x15'),auth[_0x9148('0x9')](),controller[_0x9148('0x16')]);router[_0x9148('0x17')]('/:id',auth[_0x9148('0x9')](),controller['update']);router['delete'](_0x9148('0xe'),auth[_0x9148('0x9')](),controller['destroy']);module[_0x9148('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 664b5ea..bb722b9 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(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 4ded5a7..4305720 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 _0x8c98=['fieldName','differenceBy','format','query','keys','filters','intersection','model','attributes','length','nolimit','sort','pick','where','type','merge','VoiceRecording','includeAll','include','catch','rawAttributes','fields','options','find','create','body','update','params','describe','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','../../components/encryptor','MD5','sequelize','col','token','$and','push','%s.cypher','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeStatus','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data2','data1','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','count','limit','json','apply','save','then','destroy','end','sendStatus','error','name','send','index','map'];(function(_0x30060b,_0x5383d6){var _0xa48ef7=function(_0x44aefd){while(--_0x44aefd){_0x30060b['push'](_0x30060b['shift']());}};_0xa48ef7(++_0x5383d6);}(_0x8c98,0x6a));var _0x88c9=function(_0xdbf94b,_0x4938fa){_0xdbf94b=_0xdbf94b-0x0;var _0x105f78=_0x8c98[_0xdbf94b];return _0x105f78;};'use strict';var emlformat=require(_0x88c9('0x0'));var rimraf=require(_0x88c9('0x1'));var zipdir=require(_0x88c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x88c9('0x3'));var moment=require(_0x88c9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x88c9('0x5'));var util=require('util');var path=require(_0x88c9('0x6'));var sox=require('sox');var csv=require(_0x88c9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x88c9('0x8'));var _=require(_0x88c9('0x9'));var squel=require(_0x88c9('0xa'));var crypto=require(_0x88c9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x88c9('0x7'));var querystring=require('querystring');var Papa=require(_0x88c9('0xc'));var AWS=require(_0x88c9('0xd'));var uuidv4=require(_0x88c9('0xe'));var Redis=require(_0x88c9('0xf'));var authService=require(_0x88c9('0x10'));var qs=require(_0x88c9('0x11'));var as=require(_0x88c9('0x12'));var hardwareService=require(_0x88c9('0x13'));var logger=require(_0x88c9('0x14'))(_0x88c9('0x15'));var utils=require(_0x88c9('0x16'));var config=require(_0x88c9('0x17'));var licenseUtil=require(_0x88c9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a3032,_0x103cbf){_0x103cbf=_0x103cbf||0xcc;return function(_0x5983bb){if(_0x5983bb){return _0x2a3032['sendStatus'](_0x103cbf);}return _0x2a3032[_0x88c9('0x19')](_0x103cbf)['end']();};}function respondWithResult(_0x1f31bf,_0x1153ab){_0x1153ab=_0x1153ab||0xc8;return function(_0x1f3abd){if(_0x1f3abd){return _0x1f31bf[_0x88c9('0x19')](_0x1153ab)['json'](_0x1f3abd);}};}function respondWithFilteredResult(_0x1c5a21,_0x3540c2){return function(_0xf9ded9){if(_0xf9ded9){var _0x67d12=typeof _0x3540c2[_0x88c9('0x1a')]===_0x88c9('0x1b')&&typeof _0x3540c2['limit']===_0x88c9('0x1b');var _0x51a8c6=_0xf9ded9[_0x88c9('0x1c')];var _0x4cce89=_0x67d12?0x0:_0x3540c2[_0x88c9('0x1a')];var _0x466d2a=_0x67d12?_0xf9ded9[_0x88c9('0x1c')]:_0x3540c2[_0x88c9('0x1a')]+_0x3540c2[_0x88c9('0x1d')];var _0x523925;if(_0x466d2a>=_0x51a8c6){_0x466d2a=_0x51a8c6;_0x523925=0xc8;}else{_0x523925=0xce;}_0x1c5a21['status'](_0x523925);return _0x1c5a21['set']('Content-Range',_0x4cce89+'-'+_0x466d2a+'/'+_0x51a8c6)[_0x88c9('0x1e')](_0xf9ded9);}return null;};}function patchUpdates(_0x3c5405){return function(_0x399f8f){try{jsonpatch[_0x88c9('0x1f')](_0x399f8f,_0x3c5405,!![]);}catch(_0x26b21f){return BPromise['reject'](_0x26b21f);}return _0x399f8f[_0x88c9('0x20')]();};}function saveUpdates(_0x585633,_0x1292da){return function(_0x3e354e){if(_0x3e354e){return _0x3e354e['update'](_0x585633)[_0x88c9('0x21')](function(_0x452143){return _0x452143;});}return null;};}function removeEntity(_0x266d2d,_0x4d47bd){return function(_0x5310b4){if(_0x5310b4){return _0x5310b4[_0x88c9('0x22')]()['then'](function(){_0x266d2d[_0x88c9('0x19')](0xcc)[_0x88c9('0x23')]();});}};}function handleEntityNotFound(_0x59dce6,_0x35598b){return function(_0x5508a3){if(!_0x5508a3){_0x59dce6[_0x88c9('0x24')](0x194);}return _0x5508a3;};}function handleError(_0x2eac1d,_0x317a45){_0x317a45=_0x317a45||0x1f4;return function(_0x2066cf){logger[_0x88c9('0x25')](_0x2066cf['stack']);if(_0x2066cf['name']){delete _0x2066cf[_0x88c9('0x26')];}_0x2eac1d[_0x88c9('0x19')](_0x317a45)[_0x88c9('0x27')](_0x2066cf);};}exports[_0x88c9('0x28')]=function(_0x1abdc3,_0xbeddd3){var _0x3c39f5={},_0x33e2e1={},_0x329b00={'count':0x0,'rows':[]};var _0x1206f1=_[_0x88c9('0x29')](db['VoiceRecording']['rawAttributes'],function(_0x1425a5){return{'name':_0x1425a5[_0x88c9('0x2a')],'type':_0x1425a5['type']['key']};});_0x33e2e1['model']=_[_0x88c9('0x2b')](_[_0x88c9('0x29')](_0x1206f1,_0x88c9('0x26')),[_0x88c9('0x2c')]);_0x33e2e1[_0x88c9('0x2d')]=_[_0x88c9('0x2e')](_0x1abdc3['query']);_0x33e2e1[_0x88c9('0x2f')]=_[_0x88c9('0x30')](_0x33e2e1[_0x88c9('0x31')],_0x33e2e1[_0x88c9('0x2d')]);_0x3c39f5[_0x88c9('0x32')]=_[_0x88c9('0x30')](_0x33e2e1[_0x88c9('0x31')],qs['fields'](_0x1abdc3[_0x88c9('0x2d')]['fields']));_0x3c39f5[_0x88c9('0x32')]=_0x3c39f5['attributes'][_0x88c9('0x33')]?_0x3c39f5['attributes']:_0x33e2e1[_0x88c9('0x31')];if(!_0x1abdc3[_0x88c9('0x2d')]['hasOwnProperty'](_0x88c9('0x34'))){_0x3c39f5['limit']=qs[_0x88c9('0x1d')](_0x1abdc3[_0x88c9('0x2d')][_0x88c9('0x1d')]);_0x3c39f5['offset']=qs['offset'](_0x1abdc3[_0x88c9('0x2d')][_0x88c9('0x1a')]);}_0x3c39f5['order']=qs[_0x88c9('0x35')](_0x1abdc3[_0x88c9('0x2d')][_0x88c9('0x35')]);_0x3c39f5['where']=qs[_0x88c9('0x2f')](_[_0x88c9('0x36')](_0x1abdc3['query'],_0x33e2e1[_0x88c9('0x2f')]),_0x1206f1);if(_0x1abdc3[_0x88c9('0x2d')]['filter']){_0x3c39f5[_0x88c9('0x37')]=_['merge'](_0x3c39f5['where'],{'$or':_[_0x88c9('0x29')](_0x1206f1,function(_0x295bef){if(_0x295bef[_0x88c9('0x38')]!=='VIRTUAL'){var _0x279ebe={};_0x279ebe[_0x295bef[_0x88c9('0x26')]]={'$like':'%'+_0x1abdc3['query']['filter']+'%'};return _0x279ebe;}})});}_0x3c39f5=_[_0x88c9('0x39')]({},_0x3c39f5,_0x1abdc3['options']);var _0x4f4bef={'where':_0x3c39f5[_0x88c9('0x37')]};return db[_0x88c9('0x3a')][_0x88c9('0x1c')](_0x4f4bef)[_0x88c9('0x21')](function(_0x39dc21){_0x329b00['count']=_0x39dc21;if(_0x1abdc3['query'][_0x88c9('0x3b')]){_0x3c39f5[_0x88c9('0x3c')]=[{'all':!![]}];}return db[_0x88c9('0x3a')]['findAll'](_0x3c39f5);})['then'](function(_0x27dce8){_0x329b00['rows']=_0x27dce8;return _0x329b00;})['then'](respondWithFilteredResult(_0xbeddd3,_0x3c39f5))[_0x88c9('0x3d')](handleError(_0xbeddd3,null));};exports['show']=function(_0x5ea5eb,_0x39c8b2){var _0x187d03={'raw':![],'where':{'id':_0x5ea5eb['params']['id']}},_0x490f61={};_0x490f61[_0x88c9('0x31')]=_[_0x88c9('0x2e')](db[_0x88c9('0x3a')][_0x88c9('0x3e')]);_0x490f61[_0x88c9('0x2d')]=_['keys'](_0x5ea5eb[_0x88c9('0x2d')]);_0x490f61[_0x88c9('0x2f')]=_['intersection'](_0x490f61[_0x88c9('0x31')],_0x490f61['query']);_0x187d03['attributes']=_[_0x88c9('0x30')](_0x490f61['model'],qs[_0x88c9('0x3f')](_0x5ea5eb['query'][_0x88c9('0x3f')]));_0x187d03[_0x88c9('0x32')]=_0x187d03['attributes'][_0x88c9('0x33')]?_0x187d03[_0x88c9('0x32')]:_0x490f61['model'];if(_0x5ea5eb['query'][_0x88c9('0x3b')]){_0x187d03[_0x88c9('0x3c')]=[{'all':!![]}];}_0x187d03=_[_0x88c9('0x39')]({},_0x187d03,_0x5ea5eb[_0x88c9('0x40')]);return db[_0x88c9('0x3a')][_0x88c9('0x41')](_0x187d03)[_0x88c9('0x21')](handleEntityNotFound(_0x39c8b2,null))[_0x88c9('0x21')](respondWithResult(_0x39c8b2,null))[_0x88c9('0x3d')](handleError(_0x39c8b2,null));};exports[_0x88c9('0x42')]=function(_0x30c0ba,_0x58c61f){return db[_0x88c9('0x3a')][_0x88c9('0x42')](_0x30c0ba[_0x88c9('0x43')],{})[_0x88c9('0x21')](respondWithResult(_0x58c61f,0xc9))[_0x88c9('0x3d')](handleError(_0x58c61f,null));};exports[_0x88c9('0x44')]=function(_0x5ccc49,_0x1c314f){if(_0x5ccc49['body']['id']){delete _0x5ccc49[_0x88c9('0x43')]['id'];}return db['VoiceRecording'][_0x88c9('0x41')]({'where':{'id':_0x5ccc49[_0x88c9('0x45')]['id']}})[_0x88c9('0x21')](handleEntityNotFound(_0x1c314f,null))[_0x88c9('0x21')](saveUpdates(_0x5ccc49[_0x88c9('0x43')],null))[_0x88c9('0x21')](respondWithResult(_0x1c314f,null))['catch'](handleError(_0x1c314f,null));};exports[_0x88c9('0x46')]=function(_0x127b93,_0x56fe14){return db[_0x88c9('0x3a')][_0x88c9('0x46')]()['then'](respondWithResult(_0x56fe14,null))[_0x88c9('0x3d')](handleError(_0x56fe14,null));};exports['download']=function(_0x27206e,_0x541944,_0x52f7bb){var _0x1451c8=require('../../components/encryptor');var _0x2b462d=![];var _0x3c9755={};if(_0x27206e[_0x88c9('0x2d')][_0x88c9('0x38')]&&_0x27206e['query'][_0x88c9('0x38')]===_0x88c9('0x47')){_0x3c9755[_0x88c9('0x47')]=_0x27206e[_0x88c9('0x45')]['id'];}else{_0x3c9755['id']=_0x27206e[_0x88c9('0x45')]['id'];}return db[_0x88c9('0x3a')]['find']({'where':_0x3c9755,'attributes':['id',_0x88c9('0x48')],'raw':!![]})[_0x88c9('0x21')](handleEntityNotFound(_0x541944,null))[_0x88c9('0x21')](function(_0x4b0537){if(_0x4b0537){var _0x269c5c=_0x4b0537[_0x88c9('0x48')];var _0x35d401=util[_0x88c9('0x2c')]('%s.cypher',_0x269c5c);if(fs[_0x88c9('0x49')](_0x35d401)){_0x2b462d=!![];return _0x1451c8[_0x88c9('0x4a')](_0x35d401,_0x269c5c,config[_0x88c9('0x4b')][_0x88c9('0x4c')])[_0x88c9('0x21')](function(){return _0x4b0537;});}return _0x4b0537;}})['then'](function(_0x39b767){if(_0x39b767){var _0x35f064=_0x39b767[_0x88c9('0x48')];if(!fs[_0x88c9('0x49')](_0x35f064)){throw new db[(_0x88c9('0x4d'))][(_0x88c9('0x4e'))](_0x88c9('0x4f'));}if(_0x39b767[_0x88c9('0x50')]){return _0x541944[_0x88c9('0x51')](_0x35f064,_0x39b767[_0x88c9('0x50')]+path[_0x88c9('0x52')](_0x35f064),function(){if(_0x2b462d){fs[_0x88c9('0x53')](_0x35f064);}});}else{return _0x541944['download'](_0x35f064,function(_0x18be8e){if(_0x2b462d){fs[_0x88c9('0x53')](_0x35f064);}});}}})[_0x88c9('0x3d')](function(_0x1f0ba2){if(_0x1f0ba2[_0x88c9('0x54')]===_0x88c9('0x4f')){_0x541944[_0x88c9('0x19')](0x194)[_0x88c9('0x27')](_0x88c9('0x55'));}else{return handleError(_0x541944,null);}});};exports[_0x88c9('0x56')]=function(_0x5e57ec,_0x591afc,_0xccec3f){var _0x3017a2=require(_0x88c9('0x57'));var _0xd33867=![];var _0x25fedc={'$and':[db['sequelize'][_0x88c9('0x37')](db['sequelize']['fn'](_0x88c9('0x58'),db[_0x88c9('0x59')][_0x88c9('0x5a')](_0x88c9('0x47'))),_0x5e57ec['query'][_0x88c9('0x5b')])]};if(_0x5e57ec[_0x88c9('0x2d')]['type']&&_0x5e57ec[_0x88c9('0x2d')][_0x88c9('0x38')]===_0x88c9('0x47')){_0x25fedc[_0x88c9('0x5c')][_0x88c9('0x5d')]({'uniqueid':_0x5e57ec[_0x88c9('0x45')]['id']});}else{_0x25fedc['$and'][_0x88c9('0x5d')]({'id':_0x5e57ec['params']['id']});}return db[_0x88c9('0x3a')][_0x88c9('0x41')]({'where':_0x25fedc,'attributes':['id','value'],'raw':!![]})[_0x88c9('0x21')](handleEntityNotFound(_0x591afc,null))[_0x88c9('0x21')](function(_0x32880c){if(_0x32880c){var _0x3fa377=util['format'](_0x88c9('0x5e'),_0x32880c[_0x88c9('0x48')]);if(fs[_0x88c9('0x49')](_0x3fa377)){_0xd33867=!![];return _0x3017a2[_0x88c9('0x4a')](_0x3fa377,_0x32880c[_0x88c9('0x48')],config['secrets'][_0x88c9('0x4c')])['then'](function(){return _0x32880c;});}return _0x32880c;}})[_0x88c9('0x21')](function(_0x2f2ece){if(_0x2f2ece){if(!fs[_0x88c9('0x49')](_0x2f2ece['value'])){throw new db[(_0x88c9('0x4d'))][(_0x88c9('0x4e'))](_0x88c9('0x4f'));}if(_0x2f2ece[_0x88c9('0x50')]){return _0x591afc[_0x88c9('0x51')](_0x2f2ece[_0x88c9('0x48')],_0x2f2ece['filename']+path['extname'](_0x2f2ece['value']),function(){if(_0xd33867){fs[_0x88c9('0x53')](_0x2f2ece[_0x88c9('0x48')]);}});}else{return _0x591afc[_0x88c9('0x51')](_0x2f2ece[_0x88c9('0x48')],function(_0x44c6cc){if(_0xd33867){fs[_0x88c9('0x53')](_0x2f2ece[_0x88c9('0x48')]);}});}}})['catch'](handleError(_0x591afc,null));};exports[_0x88c9('0x22')]=function(_0x1ad7c1,_0x50aa70){return db[_0x88c9('0x3a')][_0x88c9('0x41')]({'where':{'id':_0x1ad7c1[_0x88c9('0x45')]['id']}})['then'](function(_0x51021f){if(_[_0x88c9('0x5f')](_0x51021f)){throw new ReferenceError(_0x88c9('0x60'));}return _0x51021f;})[_0x88c9('0x21')](function(_0x4b6e73){var _0x3eb9b1=_0x4b6e73['value'];logger[_0x88c9('0x61')](_0x88c9('0x62'),_0x3eb9b1);if(!_['isNil'](_0x4b6e73[_0x88c9('0x48')])&&fs[_0x88c9('0x49')](_0x3eb9b1)){logger[_0x88c9('0x61')]('File:\x20\x22'+_0x3eb9b1+_0x88c9('0x63'));fs['unlinkSync'](_0x3eb9b1);}_0x3eb9b1=_0x3eb9b1+'.cypher';if(!_['isNil'](_0x4b6e73[_0x88c9('0x48')])&&fs['existsSync'](_0x3eb9b1)){logger[_0x88c9('0x61')]('File:\x20\x22'+_0x3eb9b1+_0x88c9('0x63'));fs[_0x88c9('0x64')](_0x3eb9b1);}return _0x4b6e73;})['then'](function(_0x1b23bf){if(!_0x1b23bf)throw new InternalError();return _0x1b23bf[_0x88c9('0x22')]();})[_0x88c9('0x21')](function(){_0x50aa70[_0x88c9('0x19')](0xcc)[_0x88c9('0x23')]();})[_0x88c9('0x3d')](handleError(_0x50aa70,null));};function getBucketslist(_0x28be91,_0x10f216,_0x39f43a){return new Promise(function(_0x572143,_0xd32ce8){var _0x24db8b=new AWS['S3']({'accessKeyId':_0x10f216,'secretAccessKey':_0x28be91,'region':_0x39f43a});_0x24db8b[_0x88c9('0x65')]({},function(_0x54179f,_0x2536da){if(_0x54179f){return _0xd32ce8(_0x54179f);}else{return _0x572143(_0x2536da);}});});}function createBucket(_0x43ce27,_0x31ac4a,_0x3107a4,_0x24a064){return new Promise(function(_0x646bb0,_0x2a2661){var _0x4c76ea=new AWS['S3']({'accessKeyId':_0x31ac4a,'secretAccessKey':_0x43ce27,'region':_0x3107a4});_0x4c76ea[_0x88c9('0x66')]({'Bucket':_0x24a064},function(_0x592024,_0x162818){if(_0x592024){return _0x2a2661(_0x592024);}else{return _0x646bb0(_0x162818);}});});}function uploadFile(_0x2b903b,_0x3101a2,_0x5e1383,_0x2a91fa,_0x2aeef4,_0xaa243){return new Promise(function(_0xdc5969,_0x3d500e){var _0x1688cc=new AWS['S3']({'accessKeyId':_0x3101a2,'secretAccessKey':_0x2b903b,'region':_0x5e1383});_0x1688cc[_0x88c9('0x67')]({'Bucket':_0x2a91fa,'Key':_0x2aeef4,'Body':_0xaa243},function(_0x5f5207,_0xd84e2c){if(_0x5f5207){return _0x3d500e(_0x5f5207);}else{return _0xdc5969(_0xd84e2c);}});});}function startTranscribe(_0x358cef,_0x40a1ec,_0x8d485d,_0x19b14a,_0xba998f,_0x9d4465){return new Promise(function(_0x55825a,_0x563145){var _0x4c2521=new AWS['TranscribeService']({'accessKeyId':_0x40a1ec,'secretAccessKey':_0x358cef,'region':_0x8d485d});_0x4c2521[_0x88c9('0x68')]({'TranscriptionJobName':_0x19b14a,'LanguageCode':_0xba998f,'Media':{'MediaFileUri':_0x9d4465}},function(_0x2dee68,_0x17e33a){if(_0x2dee68){return _0x563145(_0x2dee68);}else{return _0x55825a(_0x17e33a);}});});}function transcribe(_0x1c137b,_0x585132,_0xac1382,_0x4ec70e,_0xd409df,_0x199814,_0x3a46b5){return new Promise(function(_0x5e626b,_0x2d5e7c){var _0x5f542c={};logger[_0x88c9('0x61')](util[_0x88c9('0x2c')](_0x88c9('0x69'),_0x1c137b,_0xd409df));return uploadFile(_0x585132,_0xac1382,_0x4ec70e,_0xd409df,path[_0x88c9('0x6a')](_0x199814),fs[_0x88c9('0x6b')](_0x199814))[_0x88c9('0x21')](function(_0x5b64f4){logger[_0x88c9('0x61')](util['format'](_0x88c9('0x6c'),_0x1c137b,_0xd409df,_0x5b64f4[_0x88c9('0x6d')]));_0x5f542c['bucket']=_0x5b64f4[_0x88c9('0x6e')];_0x5f542c['location']=_0x5b64f4[_0x88c9('0x6d')];logger[_0x88c9('0x61')](util[_0x88c9('0x2c')](_0x88c9('0x6f'),_0x1c137b));return startTranscribe(_0x585132,_0xac1382,_0x4ec70e,uuidv4(),_0x3a46b5,_0x5b64f4[_0x88c9('0x6d')]);})[_0x88c9('0x21')](function(_0x3f6481){logger['info'](util[_0x88c9('0x2c')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x1c137b,_0x3f6481['TranscriptionJob']['TranscriptionJobName']));_0x5f542c['transcribeName']=_0x3f6481['TranscriptionJob'][_0x88c9('0x70')];_0x5f542c[_0x88c9('0x71')]=_0x3f6481[_0x88c9('0x72')][_0x88c9('0x73')];return _0x5e626b(_0x5f542c);})[_0x88c9('0x3d')](function(_0x52385f){return _0x2d5e7c(_0x52385f);});});}exports[_0x88c9('0x74')]=function(_0x4176e6,_0x516308,_0x4a4c40){var _0xd75580;var _0x4e5f34;var _0x1b16d8;var _0x5fc441=require('../../components/encryptor');return db['VoiceRecording'][_0x88c9('0x75')]({'where':{'id':_0x4176e6['params']['id']}})[_0x88c9('0x21')](function(_0x45aac4){if(_0x45aac4){var _0x51a289=util[_0x88c9('0x2c')](_0x88c9('0x5e'),_0x45aac4[_0x88c9('0x48')]);if(fs['existsSync'](_0x51a289)){cypher=!![];return _0x5fc441[_0x88c9('0x4a')](_0x51a289,_0x45aac4[_0x88c9('0x48')],config[_0x88c9('0x4b')][_0x88c9('0x4c')])[_0x88c9('0x21')](function(){return _0x45aac4;});}return _0x45aac4;}})['then'](function(_0x1f7a3c){if(!_0x1f7a3c){throw new db[(_0x88c9('0x4d'))][(_0x88c9('0x4e'))](_0x88c9('0x76'));}_0x4e5f34=_0x1f7a3c;return db[_0x88c9('0x77')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x516308,null))[_0x88c9('0x21')](function(_0xcedead){if(_0xcedead){_0xd75580=_0xcedead;if(!_0xd75580[_0x88c9('0x78')]||!_0xd75580['transcribeAccountId']||!_0xd75580['transcribeRegion']||!_0xd75580['language']||!_0xd75580[_0x88c9('0x79')]){throw new db[(_0x88c9('0x4d'))][(_0x88c9('0x4e'))](_0x88c9('0x7a'));}if(_0x4176e6[_0x88c9('0x43')][_0x88c9('0x7b')]&&(!_0xd75580[_0x88c9('0x7c')]||!_0xd75580[_0x88c9('0x7d')]||!_0xd75580[_0x88c9('0x7e')]||!_0xd75580['language']||!_0xd75580['bucket'])){throw new db[(_0x88c9('0x4d'))][(_0x88c9('0x4e'))](_0x88c9('0x7f'));}return db[_0x88c9('0x80')]['findOne']({'where':{'id':_0xd75580[_0x88c9('0x81')]}});}})[_0x88c9('0x21')](function(_0x4ce232){if(!_0x4ce232){throw new db[(_0x88c9('0x4d'))]['ValidationError'](_0x88c9('0x82'));}if(!_0x4ce232['data1']||!_0x4ce232[_0x88c9('0x83')]){throw new db[(_0x88c9('0x4d'))][(_0x88c9('0x4e'))]('Cloud\x20Provider\x20not\x20configured');}_0x1b16d8=_0x4ce232;return getBucketslist(_0x1b16d8[_0x88c9('0x84')],_0x1b16d8[_0x88c9('0x83')],_0xd75580[_0x88c9('0x85')]);})[_0x88c9('0x21')](function(_0x10843f){if(_0x10843f&&_0x10843f[_0x88c9('0x86')]){var _0x5c3a47=_[_0x88c9('0x41')](_0x10843f[_0x88c9('0x86')],function(_0x44f9a0){return _0x44f9a0[_0x88c9('0x87')]===_0xd75580[_0x88c9('0x79')];});if(!_0x5c3a47){logger['info'](util[_0x88c9('0x2c')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x4176e6[_0x88c9('0x45')]['id'],_0xd75580[_0x88c9('0x79')]));return createBucket(_0x1b16d8[_0x88c9('0x84')],_0x1b16d8[_0x88c9('0x83')],_0xd75580[_0x88c9('0x85')],_0xd75580[_0x88c9('0x79')]);}logger[_0x88c9('0x61')](util[_0x88c9('0x2c')](_0x88c9('0x88'),_0x4176e6['params']['id'],_0xd75580[_0x88c9('0x79')]));return;}})['then'](function(_0x224fef){if(_0x4e5f34[_0x88c9('0x71')]===_0x88c9('0x89')){return transcribe(_0x4176e6[_0x88c9('0x45')]['id'],_0x1b16d8['data1'],_0x1b16d8[_0x88c9('0x83')],_0xd75580[_0x88c9('0x85')],_0xd75580['bucket'],_0x4e5f34[_0x88c9('0x48')],_0xd75580[_0x88c9('0x8a')]);}else{logger[_0x88c9('0x61')](util[_0x88c9('0x2c')](_0x88c9('0x8b'),_0x4176e6['params']['id']));return{'transcribeStatus':_0x88c9('0x8c')};}})['then'](function(_0x324085){if(_0x324085){_0x324085[_0x88c9('0x8d')]=_0x4176e6['body']['runSentiment'];return _0x4e5f34[_0x88c9('0x8e')](_0x324085);}})[_0x88c9('0x21')](respondWithResult(_0x516308,null))[_0x88c9('0x3d')](handleError(_0x516308,null));};function writeFile(_0x5c650,_0x40d902){return new Promise(function(_0x4940e5,_0x319d26){fs[_0x88c9('0x8f')](_0x40d902,_0x5c650,function(_0x770d40,_0x4855c7){if(_0x770d40){return _0x319d26(_0x770d40);}else{return _0x4940e5(_0x4855c7);}});});}exports[_0x88c9('0x90')]=function(_0x285926,_0xe4209f,_0x39ce03){return db[_0x88c9('0x3a')]['findOne']({'where':{'id':_0x285926['params']['id']}})[_0x88c9('0x21')](handleEntityNotFound(_0xe4209f))[_0x88c9('0x21')](function(_0x455af2){if(_0x455af2&&_0x455af2[_0x88c9('0x91')]){var _0x57eea7=_0x455af2[_0x88c9('0x91')];var _0x18e06f=config['root']+_0x88c9('0x92')+_0x455af2['id']+_0x88c9('0x93');if(fs[_0x88c9('0x49')](_0x18e06f)){return _0x18e06f;}return writeFile(_0x57eea7,_0x18e06f)['then'](function(){return _0x18e06f;});}else{throw new db[(_0x88c9('0x4d'))][(_0x88c9('0x4e'))]('Transcript\x20not\x20available');}})['then'](function(_0x22cbc8){return _0xe4209f[_0x88c9('0x51')](_0x22cbc8);})[_0x88c9('0x3d')](handleError(_0xe4209f));}; \ No newline at end of file +var _0x2c4c=['map','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceRecording','includeAll','findAll','rows','catch','fields','include','find','create','body','describe','download','../../components/encryptor','uniqueid','params','value','%s.cypher','decryptFile','recording','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','sequelize','MD5','col','$and','push','secrets','ValidationError','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','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','updateAttributes','writeFile','downloadTranscribe','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','error','stack','name','send'];(function(_0x13db68,_0x138780){var _0x3d41ac=function(_0x39c451){while(--_0x39c451){_0x13db68['push'](_0x13db68['shift']());}};_0x3d41ac(++_0x138780);}(_0x2c4c,0x70));var _0xc2c4=function(_0x1aaf71,_0x495878){_0x1aaf71=_0x1aaf71-0x0;var _0x1a3993=_0x2c4c[_0x1aaf71];return _0x1a3993;};'use strict';var emlformat=require(_0xc2c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2c4('0x1'));var jsonpatch=require(_0xc2c4('0x2'));var rp=require(_0xc2c4('0x3'));var moment=require('moment');var BPromise=require(_0xc2c4('0x4'));var Mustache=require(_0xc2c4('0x5'));var util=require(_0xc2c4('0x6'));var path=require('path');var sox=require(_0xc2c4('0x7'));var csv=require(_0xc2c4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc2c4('0x9'));var crypto=require(_0xc2c4('0xa'));var jsforce=require(_0xc2c4('0xb'));var deskjs=require(_0xc2c4('0xc'));var toCsv=require(_0xc2c4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xc2c4('0xd'));var qs=require(_0xc2c4('0xe'));var as=require(_0xc2c4('0xf'));var hardwareService=require(_0xc2c4('0x10'));var logger=require(_0xc2c4('0x11'))(_0xc2c4('0x12'));var utils=require(_0xc2c4('0x13'));var config=require(_0xc2c4('0x14'));var licenseUtil=require(_0xc2c4('0x15'));var db=require(_0xc2c4('0x16'))['db'];function respondWithStatusCode(_0x33e6ee,_0x2a8b66){_0x2a8b66=_0x2a8b66||0xcc;return function(_0x49a5eb){if(_0x49a5eb){return _0x33e6ee[_0xc2c4('0x17')](_0x2a8b66);}return _0x33e6ee['status'](_0x2a8b66)[_0xc2c4('0x18')]();};}function respondWithResult(_0x5ac195,_0x5d1cb1){_0x5d1cb1=_0x5d1cb1||0xc8;return function(_0x14c8e9){if(_0x14c8e9){return _0x5ac195[_0xc2c4('0x19')](_0x5d1cb1)['json'](_0x14c8e9);}};}function respondWithFilteredResult(_0x1df316,_0x610017){return function(_0x165bc1){if(_0x165bc1){var _0x59587f=typeof _0x610017[_0xc2c4('0x1a')]===_0xc2c4('0x1b')&&typeof _0x610017[_0xc2c4('0x1c')]===_0xc2c4('0x1b');var _0x6c1c66=_0x165bc1[_0xc2c4('0x1d')];var _0xa35179=_0x59587f?0x0:_0x610017[_0xc2c4('0x1a')];var _0x1dbb52=_0x59587f?_0x165bc1[_0xc2c4('0x1d')]:_0x610017['offset']+_0x610017[_0xc2c4('0x1c')];var _0x2f3462;if(_0x1dbb52>=_0x6c1c66){_0x1dbb52=_0x6c1c66;_0x2f3462=0xc8;}else{_0x2f3462=0xce;}_0x1df316[_0xc2c4('0x19')](_0x2f3462);return _0x1df316['set'](_0xc2c4('0x1e'),_0xa35179+'-'+_0x1dbb52+'/'+_0x6c1c66)[_0xc2c4('0x1f')](_0x165bc1);}return null;};}function patchUpdates(_0x228f00){return function(_0x5b9636){try{jsonpatch[_0xc2c4('0x20')](_0x5b9636,_0x228f00,!![]);}catch(_0x4b48e8){return BPromise[_0xc2c4('0x21')](_0x4b48e8);}return _0x5b9636['save']();};}function saveUpdates(_0x1dcfb0,_0x3fb87a){return function(_0x2c25c9){if(_0x2c25c9){return _0x2c25c9[_0xc2c4('0x22')](_0x1dcfb0)['then'](function(_0xc20ec2){return _0xc20ec2;});}return null;};}function removeEntity(_0x92c7bd,_0x562603){return function(_0x546df7){if(_0x546df7){return _0x546df7['destroy']()[_0xc2c4('0x23')](function(){_0x92c7bd[_0xc2c4('0x19')](0xcc)[_0xc2c4('0x18')]();});}};}function handleEntityNotFound(_0x58225a,_0x5d2e7e){return function(_0x5873f2){if(!_0x5873f2){_0x58225a['sendStatus'](0x194);}return _0x5873f2;};}function handleError(_0x5597fe,_0x5e3c06){_0x5e3c06=_0x5e3c06||0x1f4;return function(_0x37d655){logger[_0xc2c4('0x24')](_0x37d655[_0xc2c4('0x25')]);if(_0x37d655['name']){delete _0x37d655[_0xc2c4('0x26')];}_0x5597fe[_0xc2c4('0x19')](_0x5e3c06)[_0xc2c4('0x27')](_0x37d655);};}exports['index']=function(_0x538481,_0xf0a169){var _0x366352={},_0x5d8411={},_0x2054e0={'count':0x0,'rows':[]};var _0x54fc36=_[_0xc2c4('0x28')](db['VoiceRecording'][_0xc2c4('0x29')],function(_0x3e2258){return{'name':_0x3e2258[_0xc2c4('0x2a')],'type':_0x3e2258[_0xc2c4('0x2b')][_0xc2c4('0x2c')]};});_0x5d8411['model']=_[_0xc2c4('0x2d')](_['map'](_0x54fc36,_0xc2c4('0x26')),[_0xc2c4('0x2e')]);_0x5d8411[_0xc2c4('0x2f')]=_[_0xc2c4('0x30')](_0x538481[_0xc2c4('0x2f')]);_0x5d8411[_0xc2c4('0x31')]=_[_0xc2c4('0x32')](_0x5d8411[_0xc2c4('0x33')],_0x5d8411[_0xc2c4('0x2f')]);_0x366352[_0xc2c4('0x34')]=_[_0xc2c4('0x32')](_0x5d8411[_0xc2c4('0x33')],qs['fields'](_0x538481[_0xc2c4('0x2f')]['fields']));_0x366352[_0xc2c4('0x34')]=_0x366352[_0xc2c4('0x34')][_0xc2c4('0x35')]?_0x366352[_0xc2c4('0x34')]:_0x5d8411[_0xc2c4('0x33')];if(!_0x538481['query'][_0xc2c4('0x36')](_0xc2c4('0x37'))){_0x366352[_0xc2c4('0x1c')]=qs[_0xc2c4('0x1c')](_0x538481[_0xc2c4('0x2f')]['limit']);_0x366352[_0xc2c4('0x1a')]=qs[_0xc2c4('0x1a')](_0x538481[_0xc2c4('0x2f')][_0xc2c4('0x1a')]);}_0x366352[_0xc2c4('0x38')]=qs[_0xc2c4('0x39')](_0x538481[_0xc2c4('0x2f')][_0xc2c4('0x39')]);_0x366352[_0xc2c4('0x3a')]=qs['filters'](_[_0xc2c4('0x3b')](_0x538481[_0xc2c4('0x2f')],_0x5d8411['filters']),_0x54fc36);if(_0x538481['query']['filter']){_0x366352[_0xc2c4('0x3a')]=_[_0xc2c4('0x3c')](_0x366352['where'],{'$or':_[_0xc2c4('0x28')](_0x54fc36,function(_0xa0082){if(_0xa0082['type']!==_0xc2c4('0x3d')){var _0x343e58={};_0x343e58[_0xa0082[_0xc2c4('0x26')]]={'$like':'%'+_0x538481['query'][_0xc2c4('0x3e')]+'%'};return _0x343e58;}})});}_0x366352=_[_0xc2c4('0x3c')]({},_0x366352,_0x538481[_0xc2c4('0x3f')]);var _0x2a9026={'where':_0x366352[_0xc2c4('0x3a')]};return db[_0xc2c4('0x40')][_0xc2c4('0x1d')](_0x2a9026)[_0xc2c4('0x23')](function(_0x55bb1b){_0x2054e0['count']=_0x55bb1b;if(_0x538481[_0xc2c4('0x2f')][_0xc2c4('0x41')]){_0x366352['include']=[{'all':!![]}];}return db[_0xc2c4('0x40')][_0xc2c4('0x42')](_0x366352);})[_0xc2c4('0x23')](function(_0x1a7364){_0x2054e0[_0xc2c4('0x43')]=_0x1a7364;return _0x2054e0;})['then'](respondWithFilteredResult(_0xf0a169,_0x366352))[_0xc2c4('0x44')](handleError(_0xf0a169,null));};exports['show']=function(_0xc65e1b,_0x27af09){var _0x28452c={'raw':![],'where':{'id':_0xc65e1b['params']['id']}},_0x5e18c9={};_0x5e18c9[_0xc2c4('0x33')]=_['keys'](db[_0xc2c4('0x40')][_0xc2c4('0x29')]);_0x5e18c9[_0xc2c4('0x2f')]=_[_0xc2c4('0x30')](_0xc65e1b[_0xc2c4('0x2f')]);_0x5e18c9[_0xc2c4('0x31')]=_[_0xc2c4('0x32')](_0x5e18c9[_0xc2c4('0x33')],_0x5e18c9[_0xc2c4('0x2f')]);_0x28452c['attributes']=_[_0xc2c4('0x32')](_0x5e18c9[_0xc2c4('0x33')],qs[_0xc2c4('0x45')](_0xc65e1b[_0xc2c4('0x2f')][_0xc2c4('0x45')]));_0x28452c[_0xc2c4('0x34')]=_0x28452c['attributes']['length']?_0x28452c['attributes']:_0x5e18c9[_0xc2c4('0x33')];if(_0xc65e1b[_0xc2c4('0x2f')]['includeAll']){_0x28452c[_0xc2c4('0x46')]=[{'all':!![]}];}_0x28452c=_[_0xc2c4('0x3c')]({},_0x28452c,_0xc65e1b[_0xc2c4('0x3f')]);return db[_0xc2c4('0x40')][_0xc2c4('0x47')](_0x28452c)[_0xc2c4('0x23')](handleEntityNotFound(_0x27af09,null))[_0xc2c4('0x23')](respondWithResult(_0x27af09,null))[_0xc2c4('0x44')](handleError(_0x27af09,null));};exports[_0xc2c4('0x48')]=function(_0x4e7207,_0x4c707d){return db[_0xc2c4('0x40')][_0xc2c4('0x48')](_0x4e7207[_0xc2c4('0x49')],{})[_0xc2c4('0x23')](respondWithResult(_0x4c707d,0xc9))[_0xc2c4('0x44')](handleError(_0x4c707d,null));};exports['update']=function(_0x8efc81,_0x27bfa4){if(_0x8efc81['body']['id']){delete _0x8efc81[_0xc2c4('0x49')]['id'];}return db[_0xc2c4('0x40')][_0xc2c4('0x47')]({'where':{'id':_0x8efc81['params']['id']}})[_0xc2c4('0x23')](handleEntityNotFound(_0x27bfa4,null))['then'](saveUpdates(_0x8efc81[_0xc2c4('0x49')],null))[_0xc2c4('0x23')](respondWithResult(_0x27bfa4,null))['catch'](handleError(_0x27bfa4,null));};exports[_0xc2c4('0x4a')]=function(_0x220077,_0x4b2257){return db[_0xc2c4('0x40')][_0xc2c4('0x4a')]()[_0xc2c4('0x23')](respondWithResult(_0x4b2257,null))[_0xc2c4('0x44')](handleError(_0x4b2257,null));};exports[_0xc2c4('0x4b')]=function(_0x4be03d,_0x36a4ea,_0x57c807){var _0x3c54f5=require(_0xc2c4('0x4c'));var _0x3d1d62=![];var _0x34af48={};if(_0x4be03d[_0xc2c4('0x2f')][_0xc2c4('0x2b')]&&_0x4be03d[_0xc2c4('0x2f')]['type']===_0xc2c4('0x4d')){_0x34af48[_0xc2c4('0x4d')]=_0x4be03d[_0xc2c4('0x4e')]['id'];}else{_0x34af48['id']=_0x4be03d[_0xc2c4('0x4e')]['id'];}return db[_0xc2c4('0x40')][_0xc2c4('0x47')]({'where':_0x34af48,'attributes':['id',_0xc2c4('0x4f')],'raw':!![]})[_0xc2c4('0x23')](handleEntityNotFound(_0x36a4ea,null))['then'](function(_0x36920a){if(_0x36920a){var _0x355924=_0x36920a[_0xc2c4('0x4f')];var _0x1cc3ba=util[_0xc2c4('0x2e')](_0xc2c4('0x50'),_0x355924);if(fs['existsSync'](_0x1cc3ba)){_0x3d1d62=!![];return _0x3c54f5[_0xc2c4('0x51')](_0x1cc3ba,_0x355924,config['secrets'][_0xc2c4('0x52')])[_0xc2c4('0x23')](function(){return _0x36920a;});}return _0x36920a;}})['then'](function(_0x169d8e){if(_0x169d8e){var _0x194240=_0x169d8e[_0xc2c4('0x4f')];if(!fs[_0xc2c4('0x53')](_0x194240)){throw new db[(_0xc2c4('0x54'))]['ValidationError'](_0xc2c4('0x55'));}if(_0x169d8e[_0xc2c4('0x56')]){return _0x36a4ea[_0xc2c4('0x4b')](_0x194240,_0x169d8e[_0xc2c4('0x56')]+path[_0xc2c4('0x57')](_0x194240),function(){if(_0x3d1d62){fs[_0xc2c4('0x58')](_0x194240);}});}else{return _0x36a4ea['download'](_0x194240,function(_0x5ed74e){if(_0x3d1d62){fs[_0xc2c4('0x58')](_0x194240);}});}}})[_0xc2c4('0x44')](function(_0x2b819c){if(_0x2b819c['message']===_0xc2c4('0x55')){_0x36a4ea[_0xc2c4('0x19')](0x194)['send'](_0xc2c4('0x59'));}else{return handleError(_0x36a4ea,null);}});};exports['downloads']=function(_0x934c1f,_0x1dfba4,_0x324019){var _0x4b9230=require(_0xc2c4('0x4c'));var _0x397bb5=![];var _0x28820a={'$and':[db[_0xc2c4('0x5a')][_0xc2c4('0x3a')](db[_0xc2c4('0x5a')]['fn'](_0xc2c4('0x5b'),db[_0xc2c4('0x5a')][_0xc2c4('0x5c')](_0xc2c4('0x4d'))),_0x934c1f[_0xc2c4('0x2f')]['token'])]};if(_0x934c1f[_0xc2c4('0x2f')][_0xc2c4('0x2b')]&&_0x934c1f[_0xc2c4('0x2f')]['type']===_0xc2c4('0x4d')){_0x28820a[_0xc2c4('0x5d')][_0xc2c4('0x5e')]({'uniqueid':_0x934c1f[_0xc2c4('0x4e')]['id']});}else{_0x28820a['$and'][_0xc2c4('0x5e')]({'id':_0x934c1f[_0xc2c4('0x4e')]['id']});}return db[_0xc2c4('0x40')][_0xc2c4('0x47')]({'where':_0x28820a,'attributes':['id','value'],'raw':!![]})[_0xc2c4('0x23')](handleEntityNotFound(_0x1dfba4,null))[_0xc2c4('0x23')](function(_0x4a187d){if(_0x4a187d){var _0x348b58=util[_0xc2c4('0x2e')](_0xc2c4('0x50'),_0x4a187d['value']);if(fs['existsSync'](_0x348b58)){_0x397bb5=!![];return _0x4b9230[_0xc2c4('0x51')](_0x348b58,_0x4a187d['value'],config[_0xc2c4('0x5f')][_0xc2c4('0x52')])[_0xc2c4('0x23')](function(){return _0x4a187d;});}return _0x4a187d;}})['then'](function(_0x1244f1){if(_0x1244f1){if(!fs['existsSync'](_0x1244f1['value'])){throw new db[(_0xc2c4('0x54'))][(_0xc2c4('0x60'))](_0xc2c4('0x55'));}if(_0x1244f1[_0xc2c4('0x56')]){return _0x1dfba4[_0xc2c4('0x4b')](_0x1244f1[_0xc2c4('0x4f')],_0x1244f1[_0xc2c4('0x56')]+path[_0xc2c4('0x57')](_0x1244f1[_0xc2c4('0x4f')]),function(){if(_0x397bb5){fs[_0xc2c4('0x58')](_0x1244f1['value']);}});}else{return _0x1dfba4[_0xc2c4('0x4b')](_0x1244f1[_0xc2c4('0x4f')],function(_0x33d4e3){if(_0x397bb5){fs[_0xc2c4('0x58')](_0x1244f1[_0xc2c4('0x4f')]);}});}}})[_0xc2c4('0x44')](handleError(_0x1dfba4,null));};exports[_0xc2c4('0x61')]=function(_0x260145,_0x408bd7){return db[_0xc2c4('0x40')]['find']({'where':{'id':_0x260145[_0xc2c4('0x4e')]['id']}})['then'](function(_0x4e6861){if(_[_0xc2c4('0x62')](_0x4e6861)){throw new ReferenceError(_0xc2c4('0x63'));}return _0x4e6861;})[_0xc2c4('0x23')](function(_0x1b3663){var _0x2f8cfa=_0x1b3663[_0xc2c4('0x4f')];logger[_0xc2c4('0x64')](_0xc2c4('0x65'),_0x2f8cfa);if(!_[_0xc2c4('0x62')](_0x1b3663[_0xc2c4('0x4f')])&&fs[_0xc2c4('0x53')](_0x2f8cfa)){logger[_0xc2c4('0x64')]('File:\x20\x22'+_0x2f8cfa+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2f8cfa);}_0x2f8cfa=_0x2f8cfa+_0xc2c4('0x66');if(!_[_0xc2c4('0x62')](_0x1b3663[_0xc2c4('0x4f')])&&fs[_0xc2c4('0x53')](_0x2f8cfa)){logger[_0xc2c4('0x64')](_0xc2c4('0x67')+_0x2f8cfa+_0xc2c4('0x68'));fs['unlinkSync'](_0x2f8cfa);}return _0x1b3663;})[_0xc2c4('0x23')](function(_0x36afb5){if(!_0x36afb5)throw new InternalError();return _0x36afb5[_0xc2c4('0x61')]();})[_0xc2c4('0x23')](function(){_0x408bd7['status'](0xcc)['end']();})[_0xc2c4('0x44')](handleError(_0x408bd7,null));};function getBucketslist(_0x182a1e,_0x2b6004,_0x2d87cf){return new Promise(function(_0x38d9a2,_0x19f263){var _0x15400f=new AWS['S3']({'accessKeyId':_0x2b6004,'secretAccessKey':_0x182a1e,'region':_0x2d87cf});_0x15400f['listBuckets']({},function(_0x44b471,_0x5bd108){if(_0x44b471){return _0x19f263(_0x44b471);}else{return _0x38d9a2(_0x5bd108);}});});}function createBucket(_0x201361,_0x535f67,_0x431e85,_0x331926){return new Promise(function(_0x345201,_0x3c2c7a){var _0x41c861=new AWS['S3']({'accessKeyId':_0x535f67,'secretAccessKey':_0x201361,'region':_0x431e85});_0x41c861[_0xc2c4('0x69')]({'Bucket':_0x331926},function(_0x2d6303,_0x5d7996){if(_0x2d6303){return _0x3c2c7a(_0x2d6303);}else{return _0x345201(_0x5d7996);}});});}function uploadFile(_0x37f3dc,_0x5beb8a,_0x45ae03,_0x425ff2,_0x14c407,_0x250af7){return new Promise(function(_0x30f161,_0x2f62ef){var _0x3e7432=new AWS['S3']({'accessKeyId':_0x5beb8a,'secretAccessKey':_0x37f3dc,'region':_0x45ae03});_0x3e7432[_0xc2c4('0x6a')]({'Bucket':_0x425ff2,'Key':_0x14c407,'Body':_0x250af7},function(_0x552016,_0xc133c9){if(_0x552016){return _0x2f62ef(_0x552016);}else{return _0x30f161(_0xc133c9);}});});}function startTranscribe(_0x36597f,_0x15335a,_0xbd6f91,_0x1db3ad,_0x4c8216,_0x4c4e61){return new Promise(function(_0x22d52e,_0xefd2a6){var _0x12ebd5=new AWS[(_0xc2c4('0x6b'))]({'accessKeyId':_0x15335a,'secretAccessKey':_0x36597f,'region':_0xbd6f91});_0x12ebd5[_0xc2c4('0x6c')]({'TranscriptionJobName':_0x1db3ad,'LanguageCode':_0x4c8216,'Media':{'MediaFileUri':_0x4c4e61}},function(_0x4ce30c,_0x3297c0){if(_0x4ce30c){return _0xefd2a6(_0x4ce30c);}else{return _0x22d52e(_0x3297c0);}});});}function transcribe(_0x59bddc,_0x2c6d37,_0x1582ca,_0x218a14,_0x372f6a,_0x1211f1,_0x2ebb54){return new Promise(function(_0x354d62,_0x871a95){var _0x465874={};logger['info'](util[_0xc2c4('0x2e')](_0xc2c4('0x6d'),_0x59bddc,_0x372f6a));return uploadFile(_0x2c6d37,_0x1582ca,_0x218a14,_0x372f6a,path[_0xc2c4('0x6e')](_0x1211f1),fs[_0xc2c4('0x6f')](_0x1211f1))['then'](function(_0x2643c7){logger[_0xc2c4('0x64')](util[_0xc2c4('0x2e')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x59bddc,_0x372f6a,_0x2643c7[_0xc2c4('0x70')]));_0x465874[_0xc2c4('0x71')]=_0x2643c7[_0xc2c4('0x72')];_0x465874[_0xc2c4('0x73')]=_0x2643c7[_0xc2c4('0x70')];logger['info'](util['format'](_0xc2c4('0x74'),_0x59bddc));return startTranscribe(_0x2c6d37,_0x1582ca,_0x218a14,uuidv4(),_0x2ebb54,_0x2643c7['Location']);})[_0xc2c4('0x23')](function(_0x29d428){logger[_0xc2c4('0x64')](util[_0xc2c4('0x2e')](_0xc2c4('0x75'),_0x59bddc,_0x29d428[_0xc2c4('0x76')][_0xc2c4('0x77')]));_0x465874[_0xc2c4('0x78')]=_0x29d428[_0xc2c4('0x76')][_0xc2c4('0x77')];_0x465874[_0xc2c4('0x79')]=_0x29d428['TranscriptionJob'][_0xc2c4('0x7a')];return _0x354d62(_0x465874);})[_0xc2c4('0x44')](function(_0x148da2){return _0x871a95(_0x148da2);});});}exports['runTranscribe']=function(_0x2a4d39,_0x467b31,_0x535545){var _0x1e2cd7;var _0x339235;var _0x4c8178;var _0x9110ed=require(_0xc2c4('0x4c'));return db[_0xc2c4('0x40')][_0xc2c4('0x7b')]({'where':{'id':_0x2a4d39[_0xc2c4('0x4e')]['id']}})['then'](function(_0x30ec13){if(_0x30ec13){var _0x435dfa=util['format'](_0xc2c4('0x50'),_0x30ec13['value']);if(fs['existsSync'](_0x435dfa)){cypher=!![];return _0x9110ed[_0xc2c4('0x51')](_0x435dfa,_0x30ec13[_0xc2c4('0x4f')],config['secrets'][_0xc2c4('0x52')])[_0xc2c4('0x23')](function(){return _0x30ec13;});}return _0x30ec13;}})[_0xc2c4('0x23')](function(_0x1e77f9){if(!_0x1e77f9){throw new db[(_0xc2c4('0x54'))][(_0xc2c4('0x60'))](_0xc2c4('0x7c'));}_0x339235=_0x1e77f9;return db[_0xc2c4('0x7d')][_0xc2c4('0x7b')]({'where':{'id':0x1}});})[_0xc2c4('0x23')](handleEntityNotFound(_0x467b31,null))[_0xc2c4('0x23')](function(_0x281f0a){if(_0x281f0a){_0x1e2cd7=_0x281f0a;if(!_0x1e2cd7['transcribe']||!_0x1e2cd7['transcribeAccountId']||!_0x1e2cd7[_0xc2c4('0x7e')]||!_0x1e2cd7[_0xc2c4('0x7f')]||!_0x1e2cd7[_0xc2c4('0x71')]){throw new db[(_0xc2c4('0x54'))][(_0xc2c4('0x60'))]('Transcribe\x20not\x20configured');}if(_0x2a4d39['body'][_0xc2c4('0x80')]&&(!_0x1e2cd7[_0xc2c4('0x81')]||!_0x1e2cd7[_0xc2c4('0x82')]||!_0x1e2cd7['sentimentRegion']||!_0x1e2cd7[_0xc2c4('0x7f')]||!_0x1e2cd7['bucket'])){throw new db['Sequelize'][(_0xc2c4('0x60'))](_0xc2c4('0x83'));}return db[_0xc2c4('0x84')]['findOne']({'where':{'id':_0x1e2cd7[_0xc2c4('0x85')]}});}})[_0xc2c4('0x23')](function(_0x3ff6ec){if(!_0x3ff6ec){throw new db[(_0xc2c4('0x54'))]['ValidationError'](_0xc2c4('0x86'));}if(!_0x3ff6ec[_0xc2c4('0x87')]||!_0x3ff6ec[_0xc2c4('0x88')]){throw new db[(_0xc2c4('0x54'))]['ValidationError'](_0xc2c4('0x89'));}_0x4c8178=_0x3ff6ec;return getBucketslist(_0x4c8178[_0xc2c4('0x87')],_0x4c8178[_0xc2c4('0x88')],_0x1e2cd7['transcribeRegion']);})[_0xc2c4('0x23')](function(_0x2d71f2){if(_0x2d71f2&&_0x2d71f2[_0xc2c4('0x8a')]){var _0x434a6c=_[_0xc2c4('0x47')](_0x2d71f2[_0xc2c4('0x8a')],function(_0xaeef8e){return _0xaeef8e[_0xc2c4('0x8b')]===_0x1e2cd7['bucket'];});if(!_0x434a6c){logger[_0xc2c4('0x64')](util[_0xc2c4('0x2e')](_0xc2c4('0x8c'),_0x2a4d39[_0xc2c4('0x4e')]['id'],_0x1e2cd7[_0xc2c4('0x71')]));return createBucket(_0x4c8178[_0xc2c4('0x87')],_0x4c8178[_0xc2c4('0x88')],_0x1e2cd7[_0xc2c4('0x7e')],_0x1e2cd7[_0xc2c4('0x71')]);}logger[_0xc2c4('0x64')](util[_0xc2c4('0x2e')](_0xc2c4('0x8d'),_0x2a4d39['params']['id'],_0x1e2cd7[_0xc2c4('0x71')]));return;}})[_0xc2c4('0x23')](function(_0x30e8d5){if(_0x339235[_0xc2c4('0x79')]===_0xc2c4('0x8e')){return transcribe(_0x2a4d39['params']['id'],_0x4c8178['data1'],_0x4c8178[_0xc2c4('0x88')],_0x1e2cd7[_0xc2c4('0x7e')],_0x1e2cd7['bucket'],_0x339235[_0xc2c4('0x4f')],_0x1e2cd7[_0xc2c4('0x7f')]);}else{logger[_0xc2c4('0x64')](util[_0xc2c4('0x2e')](_0xc2c4('0x8f'),_0x2a4d39[_0xc2c4('0x4e')]['id']));return{'transcribeStatus':_0xc2c4('0x90')};}})['then'](function(_0x3690f4){if(_0x3690f4){_0x3690f4[_0xc2c4('0x91')]=_0x2a4d39[_0xc2c4('0x49')]['runSentiment'];return _0x339235[_0xc2c4('0x92')](_0x3690f4);}})[_0xc2c4('0x23')](respondWithResult(_0x467b31,null))[_0xc2c4('0x44')](handleError(_0x467b31,null));};function writeFile(_0x2284d2,_0x4be154){return new Promise(function(_0x55ec2a,_0x5b8d67){fs[_0xc2c4('0x93')](_0x4be154,_0x2284d2,function(_0x353696,_0x90cfac){if(_0x353696){return _0x5b8d67(_0x353696);}else{return _0x55ec2a(_0x90cfac);}});});}exports[_0xc2c4('0x94')]=function(_0x12d6fe,_0x38ba24,_0x58979b){return db[_0xc2c4('0x40')][_0xc2c4('0x7b')]({'where':{'id':_0x12d6fe[_0xc2c4('0x4e')]['id']}})[_0xc2c4('0x23')](handleEntityNotFound(_0x38ba24))[_0xc2c4('0x23')](function(_0x3a0fa2){if(_0x3a0fa2&&_0x3a0fa2['fileText']){var _0x6a9bdf=_0x3a0fa2['fileText'];var _0x4edc41=config['root']+_0xc2c4('0x95')+_0x3a0fa2['id']+_0xc2c4('0x96');if(fs[_0xc2c4('0x53')](_0x4edc41)){return _0x4edc41;}return writeFile(_0x6a9bdf,_0x4edc41)['then'](function(){return _0x4edc41;});}else{throw new db['Sequelize'][(_0xc2c4('0x60'))](_0xc2c4('0x97'));}})[_0xc2c4('0x23')](function(_0x3b3428){return _0x38ba24[_0xc2c4('0x4b')](_0x3b3428);})[_0xc2c4('0x44')](handleError(_0x38ba24));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index fcd66ed..d0cca81 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 _0x657e=['request-promise','path','rimraf','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x7dcfd0,_0x54d6a8){var _0x5c0c9e=function(_0x259180){while(--_0x259180){_0x7dcfd0['push'](_0x7dcfd0['shift']());}};_0x5c0c9e(++_0x54d6a8);}(_0x657e,0x1c2));var _0xe657=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x657e[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0xe657('0x0'));var util=require(_0xe657('0x1'));var logger=require(_0xe657('0x2'))(_0xe657('0x3'));var moment=require('moment');var BPromise=require(_0xe657('0x4'));var rp=require(_0xe657('0x5'));var fs=require('fs');var path=require(_0xe657('0x6'));var rimraf=require(_0xe657('0x7'));var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0xe657('0x8')]=function(_0x44054a,_0x50ae3b){return _0x44054a[_0xe657('0x9')](_0xe657('0xa'),attributes,{'tableName':_0xe657('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe657('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x929b=['define','VoiceRecording','voice_recordings','uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports'];(function(_0xbee69a,_0x27bf4b){var _0x52c17d=function(_0x5a9f0d){while(--_0x5a9f0d){_0xbee69a['push'](_0xbee69a['shift']());}};_0x52c17d(++_0x27bf4b);}(_0x929b,0x1f2));var _0xb929=function(_0xdbf8f2,_0x409a32){_0xdbf8f2=_0xdbf8f2-0x0;var _0x4ed5d2=_0x929b[_0xdbf8f2];return _0x4ed5d2;};'use strict';var _=require('lodash');var util=require(_0xb929('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb929('0x1'));var BPromise=require(_0xb929('0x2'));var rp=require(_0xb929('0x3'));var fs=require('fs');var path=require(_0xb929('0x4'));var rimraf=require(_0xb929('0x5'));var config=require(_0xb929('0x6'));var attributes=require(_0xb929('0x7'));module[_0xb929('0x8')]=function(_0x28d21f,_0x1b2c99){return _0x28d21f[_0xb929('0x9')](_0xb929('0xa'),attributes,{'tableName':_0xb929('0xb'),'paranoid':![],'indexes':[{'name':_0xb929('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 16bf1ed..94ae905 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 _0xf61e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','update','body','options','raw','where','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird'];(function(_0x2a82de,_0x528603){var _0x2b28fb=function(_0x252198){while(--_0x252198){_0x2a82de['push'](_0x2a82de['shift']());}};_0x2b28fb(++_0x528603);}(_0xf61e,0x191));var _0xef61=function(_0x41b454,_0xff636){_0x41b454=_0x41b454-0x0;var _0x281853=_0xf61e[_0x41b454];return _0x281853;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}exports[_0xef61('0x17')]=function(_0x22dc1b){var _0xfc36d6=this;return new Promise(function(_0x28315a,_0xdd5e38){return db['VoiceRecording'][_0xef61('0x18')](_0x22dc1b[_0xef61('0x19')],{'raw':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x1a')][_0xef61('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22dc1b[_0xef61('0x1a')]?_0x22dc1b[_0xef61('0x1a')][_0xef61('0x1c')]||null:null,'attributes':_0x22dc1b[_0xef61('0x1a')]?_0x22dc1b[_0xef61('0x1a')]['attributes']||null:null,'limit':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x1a')]['limit']||null:null})[_0xef61('0x1d')](function(_0x5ae7a2){logger['info'](_0xef61('0x17'),_0x22dc1b);logger['debug']('UpdateVoiceRecording',_0x22dc1b,JSON[_0xef61('0x12')](_0x5ae7a2));_0x28315a(_0x5ae7a2);})[_0xef61('0x16')](function(_0x3ceb14){logger[_0xef61('0x13')]('UpdateVoiceRecording',_0x3ceb14[_0xef61('0x15')],_0x22dc1b);_0xdd5e38(_0xfc36d6['error'](0x1f4,_0x3ceb14[_0xef61('0x15')]));});});};exports[_0xef61('0x1e')]=function(_0x2419a9){var _0xf4c7c9=this;return new Promise(function(_0x2155f1,_0x45ece2){var _0x258b5a=require(_0xef61('0x1f'));var _0x297df7;return db[_0xef61('0x20')][_0xef61('0x21')]({'attributes':['id',_0xef61('0x22')],'where':{'id':0x1},'raw':!![]})[_0xef61('0x1d')](function(_0x63edd4){_0x297df7=_0x63edd4;return db[_0xef61('0x23')][_0xef61('0x24')](_0x2419a9[_0xef61('0x19')]);})[_0xef61('0x1d')](function(_0x587e26){if(_0x297df7[_0xef61('0x22')]&&fs[_0xef61('0x25')](_0x587e26[_0xef61('0x26')])){var _0x4f35ad=util['format'](_0xef61('0x27'),_0x587e26[_0xef61('0x26')]);return _0x258b5a[_0xef61('0x28')](_0x587e26['value'],_0x4f35ad,config[_0xef61('0x29')][_0xef61('0x2a')])['then'](function(){fs[_0xef61('0x2b')](_0x587e26['value']);logger['info'](_0xef61('0x2c'));return _0x587e26;});}return _0x587e26;})['then'](function(_0x8ed629){logger['info'](_0xef61('0x1e'),_0x2419a9);logger[_0xef61('0x10')](_0xef61('0x1e'),_0x2419a9,JSON[_0xef61('0x12')](_0x8ed629));_0x2155f1(_0x8ed629);})[_0xef61('0x16')](function(_0x1bdcb9){logger[_0xef61('0x13')](_0xef61('0x1e'),_0x1bdcb9[_0xef61('0x15')],_0x2419a9);_0x45ece2(_0xf4c7c9[_0xef61('0x13')](0x1f4,_0x1bdcb9['message']));});});}; \ No newline at end of file +var _0x5464=['UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','unlink','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x1406c8,_0x40a801){var _0x3ec6f8=function(_0xc1183a){while(--_0xc1183a){_0x1406c8['push'](_0x1406c8['shift']());}};_0x3ec6f8(++_0x40a801);}(_0x5464,0x15d));var _0x4546=function(_0x443b9b,_0x1ebeaf){_0x443b9b=_0x443b9b-0x0;var _0x1cd8ac=_0x5464[_0x443b9b];return _0x1cd8ac;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}exports[_0x4546('0x14')]=function(_0x57d8de){var _0x4ffd6b=this;return new Promise(function(_0x5780a7,_0x330235){return db[_0x4546('0x15')][_0x4546('0x16')](_0x57d8de[_0x4546('0x17')],{'raw':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x1a')]||null:null,'attributes':_0x57d8de['options']?_0x57d8de[_0x4546('0x18')][_0x4546('0x1b')]||null:null,'limit':_0x57d8de['options']?_0x57d8de[_0x4546('0x18')][_0x4546('0x1c')]||null:null})[_0x4546('0xa')](function(_0x2f065d){logger[_0x4546('0xb')](_0x4546('0x14'),_0x57d8de);logger['debug'](_0x4546('0x14'),_0x57d8de,JSON[_0x4546('0x1d')](_0x2f065d));_0x5780a7(_0x2f065d);})['catch'](function(_0x824698){logger[_0x4546('0x10')](_0x4546('0x14'),_0x824698[_0x4546('0x12')],_0x57d8de);_0x330235(_0x4ffd6b[_0x4546('0x10')](0x1f4,_0x824698['message']));});});};exports[_0x4546('0x1e')]=function(_0x3796fe){var _0x831fa5=this;return new Promise(function(_0x48fc36,_0x4c1dad){var _0x43740e=require(_0x4546('0x1f'));var _0x15611c;return db[_0x4546('0x20')][_0x4546('0x21')]({'attributes':['id',_0x4546('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4546('0xa')](function(_0x586ff1){_0x15611c=_0x586ff1;return db[_0x4546('0x15')]['create'](_0x3796fe[_0x4546('0x17')]);})[_0x4546('0xa')](function(_0x5396c5){if(_0x15611c['callRecordingEncryption']&&fs[_0x4546('0x23')](_0x5396c5['value'])){var _0x3c7c7d=util[_0x4546('0x24')]('%s.cypher',_0x5396c5['value']);return _0x43740e[_0x4546('0x25')](_0x5396c5[_0x4546('0x26')],_0x3c7c7d,config[_0x4546('0x27')]['recording'])[_0x4546('0xa')](function(){fs[_0x4546('0x28')](_0x5396c5['value']);logger[_0x4546('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x5396c5;});}return _0x5396c5;})[_0x4546('0xa')](function(_0x44f604){logger[_0x4546('0xb')](_0x4546('0x1e'),_0x3796fe);logger['debug'](_0x4546('0x1e'),_0x3796fe,JSON[_0x4546('0x1d')](_0x44f604));_0x48fc36(_0x44f604);})[_0x4546('0x13')](function(_0x298bef){logger[_0x4546('0x10')](_0x4546('0x1e'),_0x298bef['message'],_0x3796fe);_0x4c1dad(_0x831fa5[_0x4546('0x10')](0x1f4,_0x298bef[_0x4546('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 69ae7fa..5350b87 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 _0xf30a=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4ac92e,_0x3400e6){var _0x54d8e8=function(_0x18c8da){while(--_0x18c8da){_0x4ac92e['push'](_0x4ac92e['shift']());}};_0x54d8e8(++_0x3400e6);}(_0xf30a,0x66));var _0xaf30=function(_0x4a4199,_0x538cac){_0x4a4199=_0x4a4199-0x0;var _0x42d802=_0xf30a[_0x4a4199];return _0x42d802;};'use strict';var multer=require(_0xaf30('0x0'));var util=require(_0xaf30('0x1'));var path=require(_0xaf30('0x2'));var timeout=require(_0xaf30('0x3'));var express=require(_0xaf30('0x4'));var router=express[_0xaf30('0x5')]();var fs_extra=require(_0xaf30('0x6'));var auth=require(_0xaf30('0x7'));var interaction=require(_0xaf30('0x8'));var config=require(_0xaf30('0x9'));var controller=require('./voiceTransferReport.controller');router[_0xaf30('0xa')]('/',auth[_0xaf30('0xb')](),controller[_0xaf30('0xc')]);router[_0xaf30('0xa')]('/describe',auth[_0xaf30('0xb')](),controller[_0xaf30('0xd')]);router['get'](_0xaf30('0xe'),auth[_0xaf30('0xb')](),controller[_0xaf30('0xf')]);router[_0xaf30('0x10')]('/',auth[_0xaf30('0xb')](),controller[_0xaf30('0x11')]);router['put'](_0xaf30('0xe'),auth[_0xaf30('0xb')](),controller[_0xaf30('0x12')]);router[_0xaf30('0x13')]('/:id',auth[_0xaf30('0xb')](),controller[_0xaf30('0x14')]);module[_0xaf30('0x15')]=router; \ No newline at end of file +var _0xd970=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xd970,0x13d));var _0x0d97=function(_0x2709f3,_0x4f23dd){_0x2709f3=_0x2709f3-0x0;var _0x171a44=_0xd970[_0x2709f3];return _0x171a44;};'use strict';var multer=require(_0x0d97('0x0'));var util=require(_0x0d97('0x1'));var path=require(_0x0d97('0x2'));var timeout=require(_0x0d97('0x3'));var express=require(_0x0d97('0x4'));var router=express[_0x0d97('0x5')]();var fs_extra=require(_0x0d97('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0d97('0x7'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x0d97('0x8')]('/',auth[_0x0d97('0x9')](),controller[_0x0d97('0xa')]);router['get'](_0x0d97('0xb'),auth[_0x0d97('0x9')](),controller[_0x0d97('0xc')]);router[_0x0d97('0x8')]('/:id',auth[_0x0d97('0x9')](),controller[_0x0d97('0xd')]);router['post']('/',auth[_0x0d97('0x9')](),controller['create']);router[_0x0d97('0xe')]('/:id',auth[_0x0d97('0x9')](),controller[_0x0d97('0xf')]);router['delete']('/:id',auth[_0x0d97('0x9')](),controller[_0x0d97('0x10')]);module[_0x0d97('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 5b63bfc..0de47b8 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 _0x8f76=['STRING','moment','ENUM','blind','attended'];(function(_0x8dc0d2,_0x57d9bb){var _0x12438c=function(_0x56fad2){while(--_0x56fad2){_0x8dc0d2['push'](_0x8dc0d2['shift']());}};_0x12438c(++_0x57d9bb);}(_0x8f76,0xa6));var _0x68f7=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x8f76[_0x3c4f1f];return _0x19cb69;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x68f7('0x0'));module['exports']={'type':{'type':Sequelize[_0x68f7('0x1')](_0x68f7('0x2'),_0x68f7('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x68f7('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x68f7('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x68f7('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x68f7('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x68f7('0x4')]},'transferercontext':{'type':Sequelize[_0x68f7('0x4')]},'transfererexten':{'type':Sequelize[_0x68f7('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x68f7('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x68f7('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x68f7('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x68f7('0x4')]},'transfereecontext':{'type':Sequelize[_0x68f7('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x68f7('0x4')]},'isexternal':{'type':Sequelize[_0x68f7('0x1')]('Yes','No')},'context':{'type':Sequelize[_0x68f7('0x4')]},'extension':{'type':Sequelize[_0x68f7('0x4')]}}; \ No newline at end of file +var _0xfd9f=['Yes','sequelize','moment','exports','ENUM','blind','STRING'];(function(_0x560796,_0x374571){var _0x2c6691=function(_0x173866){while(--_0x173866){_0x560796['push'](_0x560796['shift']());}};_0x2c6691(++_0x374571);}(_0xfd9f,0x1c8));var _0xffd9=function(_0x46e36d,_0x37b78b){_0x46e36d=_0x46e36d-0x0;var _0x2c65d6=_0xfd9f[_0x46e36d];return _0x2c65d6;};'use strict';var Sequelize=require(_0xffd9('0x0'));var moment=require(_0xffd9('0x1'));module[_0xffd9('0x2')]={'type':{'type':Sequelize[_0xffd9('0x3')](_0xffd9('0x4'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xffd9('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xffd9('0x5')]},'transferercalleridname':{'type':Sequelize[_0xffd9('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xffd9('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xffd9('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xffd9('0x5')]},'transferercontext':{'type':Sequelize[_0xffd9('0x5')]},'transfererexten':{'type':Sequelize[_0xffd9('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xffd9('0x5')]},'transfereechannel':{'type':Sequelize[_0xffd9('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xffd9('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xffd9('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xffd9('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xffd9('0x5')]},'transfereecontext':{'type':Sequelize[_0xffd9('0x5')]},'transfereeexten':{'type':Sequelize[_0xffd9('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xffd9('0x5')]},'isexternal':{'type':Sequelize[_0xffd9('0x3')](_0xffd9('0x6'),'No')},'context':{'type':Sequelize[_0xffd9('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 452f787..51af6fb 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 _0x4ef9=['filter','options','includeAll','include','rows','catch','show','find','create','body','params','describe','zip-dir','moment','bluebird','util','path','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','../../config/environment','../../config/license/util','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','send','index','VoiceTransferReport','rawAttributes','type','key','model','map','name','keys','filters','attributes','intersection','fields','length','query','hasOwnProperty','nolimit','sort','where','pick','merge'];(function(_0x4cbcc5,_0x341bba){var _0x2ceb42=function(_0xd3e784){while(--_0xd3e784){_0x4cbcc5['push'](_0x4cbcc5['shift']());}};_0x2ceb42(++_0x341bba);}(_0x4ef9,0xea));var _0x94ef=function(_0x6f2ce5,_0x4231eb){_0x6f2ce5=_0x6f2ce5-0x0;var _0x28a54a=_0x4ef9[_0x6f2ce5];return _0x28a54a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x94ef('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x94ef('0x1'));var BPromise=require(_0x94ef('0x2'));var Mustache=require('mustache');var util=require(_0x94ef('0x3'));var path=require(_0x94ef('0x4'));var sox=require('sox');var csv=require(_0x94ef('0x5'));var ejs=require(_0x94ef('0x6'));var fs=require('fs');var fs_extra=require(_0x94ef('0x7'));var _=require('lodash');var squel=require(_0x94ef('0x8'));var crypto=require(_0x94ef('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x94ef('0xa'));var toCsv=require(_0x94ef('0x5'));var querystring=require(_0x94ef('0xb'));var Papa=require(_0x94ef('0xc'));var Redis=require(_0x94ef('0xd'));var authService=require(_0x94ef('0xe'));var qs=require(_0x94ef('0xf'));var as=require(_0x94ef('0x10'));var hardwareService=require(_0x94ef('0x11'));var logger=require(_0x94ef('0x12'))(_0x94ef('0x13'));var utils=require(_0x94ef('0x14'));var config=require(_0x94ef('0x15'));var licenseUtil=require(_0x94ef('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fa1d7,_0x264668){_0x264668=_0x264668||0xcc;return function(_0x1e11e1){if(_0x1e11e1){return _0x2fa1d7['sendStatus'](_0x264668);}return _0x2fa1d7['status'](_0x264668)['end']();};}function respondWithResult(_0x3b2398,_0x7f410a){_0x7f410a=_0x7f410a||0xc8;return function(_0x42a1ca){if(_0x42a1ca){return _0x3b2398[_0x94ef('0x17')](_0x7f410a)[_0x94ef('0x18')](_0x42a1ca);}};}function respondWithFilteredResult(_0x5e8a4b,_0x23c199){return function(_0x258a23){if(_0x258a23){var _0x16f5ad=typeof _0x23c199['offset']==='undefined'&&typeof _0x23c199[_0x94ef('0x19')]===_0x94ef('0x1a');var _0x4cb966=_0x258a23[_0x94ef('0x1b')];var _0x22b8bc=_0x16f5ad?0x0:_0x23c199[_0x94ef('0x1c')];var _0x2fd7ce=_0x16f5ad?_0x258a23[_0x94ef('0x1b')]:_0x23c199['offset']+_0x23c199[_0x94ef('0x19')];var _0x2d8a6f;if(_0x2fd7ce>=_0x4cb966){_0x2fd7ce=_0x4cb966;_0x2d8a6f=0xc8;}else{_0x2d8a6f=0xce;}_0x5e8a4b[_0x94ef('0x17')](_0x2d8a6f);return _0x5e8a4b[_0x94ef('0x1d')](_0x94ef('0x1e'),_0x22b8bc+'-'+_0x2fd7ce+'/'+_0x4cb966)['json'](_0x258a23);}return null;};}function patchUpdates(_0x255158){return function(_0x2c8868){try{jsonpatch[_0x94ef('0x1f')](_0x2c8868,_0x255158,!![]);}catch(_0x1538c6){return BPromise[_0x94ef('0x20')](_0x1538c6);}return _0x2c8868[_0x94ef('0x21')]();};}function saveUpdates(_0x5cf450,_0xd59790){return function(_0xdd1de3){if(_0xdd1de3){return _0xdd1de3[_0x94ef('0x22')](_0x5cf450)['then'](function(_0x532f14){return _0x532f14;});}return null;};}function removeEntity(_0x46020d,_0x565978){return function(_0x5c21b3){if(_0x5c21b3){return _0x5c21b3[_0x94ef('0x23')]()[_0x94ef('0x24')](function(){_0x46020d['status'](0xcc)[_0x94ef('0x25')]();});}};}function handleEntityNotFound(_0x1a91a9,_0x275c85){return function(_0x21158f){if(!_0x21158f){_0x1a91a9[_0x94ef('0x26')](0x194);}return _0x21158f;};}function handleError(_0xd4d6d6,_0x1414b0){_0x1414b0=_0x1414b0||0x1f4;return function(_0x5dd1f4){logger[_0x94ef('0x27')](_0x5dd1f4['stack']);if(_0x5dd1f4['name']){delete _0x5dd1f4['name'];}_0xd4d6d6[_0x94ef('0x17')](_0x1414b0)[_0x94ef('0x28')](_0x5dd1f4);};}exports[_0x94ef('0x29')]=function(_0x4fff7a,_0x191dcb){var _0x2d1aa6={},_0x7a15f9={},_0x430980={'count':0x0,'rows':[]};var _0x5a01cc=_['map'](db[_0x94ef('0x2a')][_0x94ef('0x2b')],function(_0x3f7716){return{'name':_0x3f7716['fieldName'],'type':_0x3f7716[_0x94ef('0x2c')][_0x94ef('0x2d')]};});_0x7a15f9[_0x94ef('0x2e')]=_[_0x94ef('0x2f')](_0x5a01cc,_0x94ef('0x30'));_0x7a15f9['query']=_[_0x94ef('0x31')](_0x4fff7a['query']);_0x7a15f9[_0x94ef('0x32')]=_['intersection'](_0x7a15f9[_0x94ef('0x2e')],_0x7a15f9['query']);_0x2d1aa6[_0x94ef('0x33')]=_[_0x94ef('0x34')](_0x7a15f9[_0x94ef('0x2e')],qs[_0x94ef('0x35')](_0x4fff7a['query'][_0x94ef('0x35')]));_0x2d1aa6['attributes']=_0x2d1aa6[_0x94ef('0x33')][_0x94ef('0x36')]?_0x2d1aa6[_0x94ef('0x33')]:_0x7a15f9[_0x94ef('0x2e')];if(!_0x4fff7a[_0x94ef('0x37')][_0x94ef('0x38')](_0x94ef('0x39'))){_0x2d1aa6[_0x94ef('0x19')]=qs[_0x94ef('0x19')](_0x4fff7a[_0x94ef('0x37')][_0x94ef('0x19')]);_0x2d1aa6[_0x94ef('0x1c')]=qs[_0x94ef('0x1c')](_0x4fff7a[_0x94ef('0x37')]['offset']);}_0x2d1aa6['order']=qs[_0x94ef('0x3a')](_0x4fff7a[_0x94ef('0x37')][_0x94ef('0x3a')]);_0x2d1aa6[_0x94ef('0x3b')]=qs[_0x94ef('0x32')](_[_0x94ef('0x3c')](_0x4fff7a[_0x94ef('0x37')],_0x7a15f9[_0x94ef('0x32')]),_0x5a01cc);if(_0x4fff7a[_0x94ef('0x37')]['filter']){_0x2d1aa6[_0x94ef('0x3b')]=_[_0x94ef('0x3d')](_0x2d1aa6['where'],{'$or':_[_0x94ef('0x2f')](_0x5a01cc,function(_0x3f43c5){if(_0x3f43c5['type']!=='VIRTUAL'){var _0x3075e8={};_0x3075e8[_0x3f43c5[_0x94ef('0x30')]]={'$like':'%'+_0x4fff7a[_0x94ef('0x37')][_0x94ef('0x3e')]+'%'};return _0x3075e8;}})});}_0x2d1aa6=_['merge']({},_0x2d1aa6,_0x4fff7a[_0x94ef('0x3f')]);var _0x2ab1c1={'where':_0x2d1aa6['where']};return db[_0x94ef('0x2a')][_0x94ef('0x1b')](_0x2ab1c1)['then'](function(_0x25551d){_0x430980[_0x94ef('0x1b')]=_0x25551d;if(_0x4fff7a[_0x94ef('0x37')][_0x94ef('0x40')]){_0x2d1aa6[_0x94ef('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x2d1aa6);})[_0x94ef('0x24')](function(_0x2da5e0){_0x430980[_0x94ef('0x42')]=_0x2da5e0;return _0x430980;})[_0x94ef('0x24')](respondWithFilteredResult(_0x191dcb,_0x2d1aa6))[_0x94ef('0x43')](handleError(_0x191dcb,null));};exports[_0x94ef('0x44')]=function(_0x2ad397,_0x100758){var _0x7a863d={'raw':!![],'where':{'id':_0x2ad397['params']['id']}},_0x4efff7={};_0x4efff7[_0x94ef('0x2e')]=_[_0x94ef('0x31')](db[_0x94ef('0x2a')][_0x94ef('0x2b')]);_0x4efff7[_0x94ef('0x37')]=_[_0x94ef('0x31')](_0x2ad397[_0x94ef('0x37')]);_0x4efff7[_0x94ef('0x32')]=_[_0x94ef('0x34')](_0x4efff7[_0x94ef('0x2e')],_0x4efff7[_0x94ef('0x37')]);_0x7a863d[_0x94ef('0x33')]=_[_0x94ef('0x34')](_0x4efff7[_0x94ef('0x2e')],qs['fields'](_0x2ad397['query']['fields']));_0x7a863d[_0x94ef('0x33')]=_0x7a863d[_0x94ef('0x33')][_0x94ef('0x36')]?_0x7a863d['attributes']:_0x4efff7['model'];if(_0x2ad397[_0x94ef('0x37')][_0x94ef('0x40')]){_0x7a863d[_0x94ef('0x41')]=[{'all':!![]}];}_0x7a863d=_[_0x94ef('0x3d')]({},_0x7a863d,_0x2ad397[_0x94ef('0x3f')]);return db[_0x94ef('0x2a')][_0x94ef('0x45')](_0x7a863d)[_0x94ef('0x24')](handleEntityNotFound(_0x100758,null))[_0x94ef('0x24')](respondWithResult(_0x100758,null))[_0x94ef('0x43')](handleError(_0x100758,null));};exports['create']=function(_0x1cbc78,_0x49e8c6){return db['VoiceTransferReport'][_0x94ef('0x46')](_0x1cbc78['body'],{})[_0x94ef('0x24')](respondWithResult(_0x49e8c6,0xc9))[_0x94ef('0x43')](handleError(_0x49e8c6,null));};exports[_0x94ef('0x22')]=function(_0x13c1b1,_0x40b1fd){if(_0x13c1b1['body']['id']){delete _0x13c1b1[_0x94ef('0x47')]['id'];}return db[_0x94ef('0x2a')][_0x94ef('0x45')]({'where':{'id':_0x13c1b1['params']['id']}})[_0x94ef('0x24')](handleEntityNotFound(_0x40b1fd,null))[_0x94ef('0x24')](saveUpdates(_0x13c1b1[_0x94ef('0x47')],null))['then'](respondWithResult(_0x40b1fd,null))['catch'](handleError(_0x40b1fd,null));};exports[_0x94ef('0x23')]=function(_0x366417,_0x54c9fa){return db['VoiceTransferReport']['find']({'where':{'id':_0x366417[_0x94ef('0x48')]['id']}})[_0x94ef('0x24')](handleEntityNotFound(_0x54c9fa,null))[_0x94ef('0x24')](removeEntity(_0x54c9fa,null))[_0x94ef('0x43')](handleError(_0x54c9fa,null));};exports[_0x94ef('0x49')]=function(_0x2539ca,_0x3c4bf6){return db['VoiceTransferReport']['describe']()[_0x94ef('0x24')](respondWithResult(_0x3c4bf6,null))[_0x94ef('0x43')](handleError(_0x3c4bf6,null));}; \ No newline at end of file +var _0x2e56=['status','end','offset','undefined','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3ab72f,_0x1cb67d){var _0x36b6a6=function(_0x53f672){while(--_0x53f672){_0x3ab72f['push'](_0x3ab72f['shift']());}};_0x36b6a6(++_0x1cb67d);}(_0x2e56,0x7d));var _0x62e5=function(_0x4880fd,_0x2cc70d){_0x4880fd=_0x4880fd-0x0;var _0x4a4b50=_0x2e56[_0x4880fd];return _0x4a4b50;};'use strict';var emlformat=require(_0x62e5('0x0'));var rimraf=require(_0x62e5('0x1'));var zipdir=require(_0x62e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x62e5('0x3'));var BPromise=require(_0x62e5('0x4'));var Mustache=require(_0x62e5('0x5'));var util=require(_0x62e5('0x6'));var path=require(_0x62e5('0x7'));var sox=require(_0x62e5('0x8'));var csv=require(_0x62e5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62e5('0xa'));var _=require(_0x62e5('0xb'));var squel=require('squel');var crypto=require(_0x62e5('0xc'));var jsforce=require(_0x62e5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x62e5('0xe'));var Papa=require(_0x62e5('0xf'));var Redis=require('ioredis');var authService=require(_0x62e5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62e5('0x11'));var logger=require(_0x62e5('0x12'))(_0x62e5('0x13'));var utils=require(_0x62e5('0x14'));var config=require(_0x62e5('0x15'));var licenseUtil=require(_0x62e5('0x16'));var db=require(_0x62e5('0x17'))['db'];function respondWithStatusCode(_0x5132da,_0xb8e446){_0xb8e446=_0xb8e446||0xcc;return function(_0x31ecfa){if(_0x31ecfa){return _0x5132da[_0x62e5('0x18')](_0xb8e446);}return _0x5132da[_0x62e5('0x19')](_0xb8e446)[_0x62e5('0x1a')]();};}function respondWithResult(_0x48264a,_0x45dd99){_0x45dd99=_0x45dd99||0xc8;return function(_0x50e467){if(_0x50e467){return _0x48264a[_0x62e5('0x19')](_0x45dd99)['json'](_0x50e467);}};}function respondWithFilteredResult(_0x1b94ba,_0x5e379a){return function(_0x317d3d){if(_0x317d3d){var _0x344689=typeof _0x5e379a[_0x62e5('0x1b')]===_0x62e5('0x1c')&&typeof _0x5e379a[_0x62e5('0x1d')]===_0x62e5('0x1c');var _0x5dbf54=_0x317d3d['count'];var _0x1048a4=_0x344689?0x0:_0x5e379a['offset'];var _0x1ba415=_0x344689?_0x317d3d['count']:_0x5e379a[_0x62e5('0x1b')]+_0x5e379a[_0x62e5('0x1d')];var _0x2926b7;if(_0x1ba415>=_0x5dbf54){_0x1ba415=_0x5dbf54;_0x2926b7=0xc8;}else{_0x2926b7=0xce;}_0x1b94ba[_0x62e5('0x19')](_0x2926b7);return _0x1b94ba[_0x62e5('0x1e')](_0x62e5('0x1f'),_0x1048a4+'-'+_0x1ba415+'/'+_0x5dbf54)['json'](_0x317d3d);}return null;};}function patchUpdates(_0x2b2fa8){return function(_0x1c01aa){try{jsonpatch['apply'](_0x1c01aa,_0x2b2fa8,!![]);}catch(_0xcbe4cd){return BPromise[_0x62e5('0x20')](_0xcbe4cd);}return _0x1c01aa[_0x62e5('0x21')]();};}function saveUpdates(_0x2eb692,_0x13f72d){return function(_0x5124cc){if(_0x5124cc){return _0x5124cc['update'](_0x2eb692)[_0x62e5('0x22')](function(_0xd60552){return _0xd60552;});}return null;};}function removeEntity(_0x5bdd5a,_0x3f5f44){return function(_0x2c632a){if(_0x2c632a){return _0x2c632a['destroy']()['then'](function(){_0x5bdd5a['status'](0xcc)[_0x62e5('0x1a')]();});}};}function handleEntityNotFound(_0x5c94bb,_0x50e0bd){return function(_0x595023){if(!_0x595023){_0x5c94bb['sendStatus'](0x194);}return _0x595023;};}function handleError(_0x2c5b8e,_0x4e5775){_0x4e5775=_0x4e5775||0x1f4;return function(_0x3af39b){logger[_0x62e5('0x23')](_0x3af39b[_0x62e5('0x24')]);if(_0x3af39b[_0x62e5('0x25')]){delete _0x3af39b['name'];}_0x2c5b8e[_0x62e5('0x19')](_0x4e5775)[_0x62e5('0x26')](_0x3af39b);};}exports[_0x62e5('0x27')]=function(_0x2ec402,_0x2d4988){var _0x4bde3f={},_0x55b1e3={},_0x50b6de={'count':0x0,'rows':[]};var _0x1243e2=_[_0x62e5('0x28')](db[_0x62e5('0x29')][_0x62e5('0x2a')],function(_0x2e388f){return{'name':_0x2e388f[_0x62e5('0x2b')],'type':_0x2e388f[_0x62e5('0x2c')][_0x62e5('0x2d')]};});_0x55b1e3[_0x62e5('0x2e')]=_[_0x62e5('0x28')](_0x1243e2,'name');_0x55b1e3['query']=_[_0x62e5('0x2f')](_0x2ec402[_0x62e5('0x30')]);_0x55b1e3[_0x62e5('0x31')]=_[_0x62e5('0x32')](_0x55b1e3['model'],_0x55b1e3['query']);_0x4bde3f[_0x62e5('0x33')]=_[_0x62e5('0x32')](_0x55b1e3['model'],qs[_0x62e5('0x34')](_0x2ec402[_0x62e5('0x30')][_0x62e5('0x34')]));_0x4bde3f['attributes']=_0x4bde3f['attributes'][_0x62e5('0x35')]?_0x4bde3f[_0x62e5('0x33')]:_0x55b1e3[_0x62e5('0x2e')];if(!_0x2ec402[_0x62e5('0x30')][_0x62e5('0x36')](_0x62e5('0x37'))){_0x4bde3f['limit']=qs[_0x62e5('0x1d')](_0x2ec402[_0x62e5('0x30')]['limit']);_0x4bde3f[_0x62e5('0x1b')]=qs[_0x62e5('0x1b')](_0x2ec402[_0x62e5('0x30')][_0x62e5('0x1b')]);}_0x4bde3f[_0x62e5('0x38')]=qs['sort'](_0x2ec402[_0x62e5('0x30')][_0x62e5('0x39')]);_0x4bde3f[_0x62e5('0x3a')]=qs[_0x62e5('0x31')](_['pick'](_0x2ec402[_0x62e5('0x30')],_0x55b1e3[_0x62e5('0x31')]),_0x1243e2);if(_0x2ec402[_0x62e5('0x30')][_0x62e5('0x3b')]){_0x4bde3f['where']=_[_0x62e5('0x3c')](_0x4bde3f[_0x62e5('0x3a')],{'$or':_['map'](_0x1243e2,function(_0x45ab83){if(_0x45ab83[_0x62e5('0x2c')]!==_0x62e5('0x3d')){var _0x5161e5={};_0x5161e5[_0x45ab83['name']]={'$like':'%'+_0x2ec402['query'][_0x62e5('0x3b')]+'%'};return _0x5161e5;}})});}_0x4bde3f=_[_0x62e5('0x3c')]({},_0x4bde3f,_0x2ec402[_0x62e5('0x3e')]);var _0x94a8cc={'where':_0x4bde3f[_0x62e5('0x3a')]};return db[_0x62e5('0x29')]['count'](_0x94a8cc)['then'](function(_0x526561){_0x50b6de['count']=_0x526561;if(_0x2ec402[_0x62e5('0x30')][_0x62e5('0x3f')]){_0x4bde3f[_0x62e5('0x40')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x62e5('0x41')](_0x4bde3f);})[_0x62e5('0x22')](function(_0x4afb75){_0x50b6de[_0x62e5('0x42')]=_0x4afb75;return _0x50b6de;})[_0x62e5('0x22')](respondWithFilteredResult(_0x2d4988,_0x4bde3f))[_0x62e5('0x43')](handleError(_0x2d4988,null));};exports[_0x62e5('0x44')]=function(_0x219799,_0x528ea4){var _0x4eb0ca={'raw':!![],'where':{'id':_0x219799[_0x62e5('0x45')]['id']}},_0x3ee2a1={};_0x3ee2a1[_0x62e5('0x2e')]=_[_0x62e5('0x2f')](db[_0x62e5('0x29')][_0x62e5('0x2a')]);_0x3ee2a1[_0x62e5('0x30')]=_[_0x62e5('0x2f')](_0x219799['query']);_0x3ee2a1[_0x62e5('0x31')]=_[_0x62e5('0x32')](_0x3ee2a1[_0x62e5('0x2e')],_0x3ee2a1[_0x62e5('0x30')]);_0x4eb0ca[_0x62e5('0x33')]=_[_0x62e5('0x32')](_0x3ee2a1['model'],qs[_0x62e5('0x34')](_0x219799['query'][_0x62e5('0x34')]));_0x4eb0ca[_0x62e5('0x33')]=_0x4eb0ca[_0x62e5('0x33')][_0x62e5('0x35')]?_0x4eb0ca[_0x62e5('0x33')]:_0x3ee2a1[_0x62e5('0x2e')];if(_0x219799[_0x62e5('0x30')]['includeAll']){_0x4eb0ca[_0x62e5('0x40')]=[{'all':!![]}];}_0x4eb0ca=_['merge']({},_0x4eb0ca,_0x219799[_0x62e5('0x3e')]);return db['VoiceTransferReport'][_0x62e5('0x46')](_0x4eb0ca)[_0x62e5('0x22')](handleEntityNotFound(_0x528ea4,null))[_0x62e5('0x22')](respondWithResult(_0x528ea4,null))[_0x62e5('0x43')](handleError(_0x528ea4,null));};exports['create']=function(_0x310b35,_0x264672){return db[_0x62e5('0x29')][_0x62e5('0x47')](_0x310b35['body'],{})[_0x62e5('0x22')](respondWithResult(_0x264672,0xc9))[_0x62e5('0x43')](handleError(_0x264672,null));};exports[_0x62e5('0x48')]=function(_0x3d65f7,_0x126dad){if(_0x3d65f7[_0x62e5('0x49')]['id']){delete _0x3d65f7['body']['id'];}return db[_0x62e5('0x29')][_0x62e5('0x46')]({'where':{'id':_0x3d65f7[_0x62e5('0x45')]['id']}})['then'](handleEntityNotFound(_0x126dad,null))[_0x62e5('0x22')](saveUpdates(_0x3d65f7[_0x62e5('0x49')],null))[_0x62e5('0x22')](respondWithResult(_0x126dad,null))[_0x62e5('0x43')](handleError(_0x126dad,null));};exports['destroy']=function(_0x2fe0e3,_0x429b78){return db['VoiceTransferReport'][_0x62e5('0x46')]({'where':{'id':_0x2fe0e3[_0x62e5('0x45')]['id']}})[_0x62e5('0x22')](handleEntityNotFound(_0x429b78,null))[_0x62e5('0x22')](removeEntity(_0x429b78,null))[_0x62e5('0x43')](handleError(_0x429b78,null));};exports[_0x62e5('0x4a')]=function(_0x385114,_0x2612df){return db[_0x62e5('0x29')][_0x62e5('0x4a')]()['then'](respondWithResult(_0x2612df,null))[_0x62e5('0x43')](handleError(_0x2612df,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 61a359a..843e977 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 _0x46cb=['util','../../config/logger','api','moment','bluebird','path','./voiceTransferReport.attributes','define','report_call_transfer','lodash'];(function(_0x3d4076,_0x3ddb1b){var _0x481f5d=function(_0x4016a9){while(--_0x4016a9){_0x3d4076['push'](_0x3d4076['shift']());}};_0x481f5d(++_0x3ddb1b);}(_0x46cb,0x1a3));var _0xb46c=function(_0x2d5f67,_0x125f70){_0x2d5f67=_0x2d5f67-0x0;var _0x4c0890=_0x46cb[_0x2d5f67];return _0x4c0890;};'use strict';var _=require(_0xb46c('0x0'));var util=require(_0xb46c('0x1'));var logger=require(_0xb46c('0x2'))(_0xb46c('0x3'));var moment=require(_0xb46c('0x4'));var BPromise=require(_0xb46c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb46c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb46c('0x7'));module['exports']=function(_0x4144b7,_0x4fb03b){return _0x4144b7[_0xb46c('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xb46c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbb5=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util'];(function(_0x5bc7a8,_0x480615){var _0x1c565f=function(_0x3d169d){while(--_0x3d169d){_0x5bc7a8['push'](_0x5bc7a8['shift']());}};_0x1c565f(++_0x480615);}(_0xdbb5,0x8d));var _0x5dbb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbb5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5dbb('0x0'));var util=require(_0x5dbb('0x1'));var logger=require(_0x5dbb('0x2'))(_0x5dbb('0x3'));var moment=require(_0x5dbb('0x4'));var BPromise=require('bluebird');var rp=require(_0x5dbb('0x5'));var fs=require('fs');var path=require(_0x5dbb('0x6'));var rimraf=require(_0x5dbb('0x7'));var config=require(_0x5dbb('0x8'));var attributes=require(_0x5dbb('0x9'));module[_0x5dbb('0xa')]=function(_0x47cf6a,_0x9ab4d8){return _0x47cf6a[_0x5dbb('0xb')]('VoiceTransferReport',attributes,{'tableName':_0x5dbb('0xc'),'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 dbdcbb2..fa36bc9 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 _0x6c79=['CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5cad4e,_0x230ef8){var _0xb2637a=function(_0x43dc52){while(--_0x43dc52){_0x5cad4e['push'](_0x5cad4e['shift']());}};_0xb2637a(++_0x230ef8);}(_0x6c79,0x110));var _0x96c7=function(_0x1626df,_0x138073){_0x1626df=_0x1626df-0x0;var _0x3afb4a=_0x6c79[_0x1626df];return _0x3afb4a;};'use strict';var _=require(_0x96c7('0x0'));var util=require(_0x96c7('0x1'));var moment=require(_0x96c7('0x2'));var BPromise=require(_0x96c7('0x3'));var rs=require(_0x96c7('0x4'));var fs=require('fs');var Redis=require(_0x96c7('0x5'));var db=require(_0x96c7('0x6'))['db'];var utils=require(_0x96c7('0x7'));var logger=require(_0x96c7('0x8'))(_0x96c7('0x9'));var config=require(_0x96c7('0xa'));var jayson=require(_0x96c7('0xb'));var client=jayson[_0x96c7('0xc')][_0x96c7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4be9a1,_0x557ddc,_0x21878e){return new BPromise(function(_0x42a0c2,_0x3b9770){return client[_0x96c7('0xe')](_0x4be9a1,_0x21878e)['then'](function(_0x44d773){logger['info'](_0x96c7('0xf'),_0x557ddc,_0x96c7('0x10'));logger[_0x96c7('0x11')](_0x96c7('0x12'),_0x557ddc,'request\x20sent',JSON[_0x96c7('0x13')](_0x44d773));if(_0x44d773[_0x96c7('0x14')]){if(_0x44d773[_0x96c7('0x14')][_0x96c7('0x15')]===0x1f4){logger[_0x96c7('0x14')](_0x96c7('0xf'),_0x557ddc,_0x44d773[_0x96c7('0x14')][_0x96c7('0x16')]);return _0x3b9770(_0x44d773['error']['message']);}logger[_0x96c7('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x557ddc,_0x44d773[_0x96c7('0x14')][_0x96c7('0x16')]);return _0x42a0c2(_0x44d773[_0x96c7('0x14')][_0x96c7('0x16')]);}else{logger[_0x96c7('0x17')](_0x96c7('0xf'),_0x557ddc,_0x96c7('0x10'));_0x42a0c2(_0x44d773[_0x96c7('0x18')][_0x96c7('0x16')]);}})['catch'](function(_0x3350ae){logger[_0x96c7('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x557ddc,_0x3350ae);_0x3b9770(_0x3350ae);});});}exports[_0x96c7('0x19')]=function(_0x13c025){var _0x13e996=this;return new Promise(function(_0x14df8f,_0xdb9ab2){return db[_0x96c7('0x1a')][_0x96c7('0x1b')](_0x13c025[_0x96c7('0x1c')],{'raw':_0x13c025[_0x96c7('0x1d')]?_0x13c025[_0x96c7('0x1d')][_0x96c7('0x1e')]===undefined?!![]:![]:!![]})[_0x96c7('0x1f')](function(_0x39cf76){logger[_0x96c7('0x17')](_0x96c7('0x19'),_0x13c025);logger[_0x96c7('0x11')](_0x96c7('0x19'),_0x13c025,JSON[_0x96c7('0x13')](_0x39cf76));_0x14df8f(_0x39cf76);})[_0x96c7('0x20')](function(_0x3f8a21){logger[_0x96c7('0x14')](_0x96c7('0x19'),_0x3f8a21[_0x96c7('0x16')],_0x13c025);_0xdb9ab2(_0x13e996['error'](0x1f4,_0x3f8a21[_0x96c7('0x16')]));});});}; \ No newline at end of file +var _0xb70d=['result','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xb70d,0xbb));var _0xdb70=function(_0x2628ff,_0x4912ed){_0x2628ff=_0x2628ff-0x0;var _0x4f42bf=_0xb70d[_0x2628ff];return _0x4f42bf;};'use strict';var _=require(_0xdb70('0x0'));var util=require(_0xdb70('0x1'));var moment=require(_0xdb70('0x2'));var BPromise=require(_0xdb70('0x3'));var rs=require(_0xdb70('0x4'));var fs=require('fs');var Redis=require(_0xdb70('0x5'));var db=require(_0xdb70('0x6'))['db'];var utils=require(_0xdb70('0x7'));var logger=require(_0xdb70('0x8'))(_0xdb70('0x9'));var config=require(_0xdb70('0xa'));var jayson=require(_0xdb70('0xb'));var client=jayson[_0xdb70('0xc')][_0xdb70('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x35ba46,_0x5de55e,_0x20ff38){return new BPromise(function(_0x3a27ba,_0x14a3a6){return client[_0xdb70('0xe')](_0x35ba46,_0x20ff38)[_0xdb70('0xf')](function(_0x16c9f5){logger[_0xdb70('0x10')](_0xdb70('0x11'),_0x5de55e,_0xdb70('0x12'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x5de55e,'request\x20sent',JSON[_0xdb70('0x13')](_0x16c9f5));if(_0x16c9f5[_0xdb70('0x14')]){if(_0x16c9f5['error'][_0xdb70('0x15')]===0x1f4){logger[_0xdb70('0x14')](_0xdb70('0x11'),_0x5de55e,_0x16c9f5[_0xdb70('0x14')][_0xdb70('0x16')]);return _0x14a3a6(_0x16c9f5[_0xdb70('0x14')][_0xdb70('0x16')]);}logger[_0xdb70('0x14')](_0xdb70('0x11'),_0x5de55e,_0x16c9f5[_0xdb70('0x14')][_0xdb70('0x16')]);return _0x3a27ba(_0x16c9f5[_0xdb70('0x14')][_0xdb70('0x16')]);}else{logger[_0xdb70('0x10')](_0xdb70('0x11'),_0x5de55e,_0xdb70('0x12'));_0x3a27ba(_0x16c9f5[_0xdb70('0x17')]['message']);}})[_0xdb70('0x18')](function(_0x34bf7b){logger[_0xdb70('0x14')](_0xdb70('0x11'),_0x5de55e,_0x34bf7b);_0x14a3a6(_0x34bf7b);});});}exports[_0xdb70('0x19')]=function(_0x4d2599){var _0x32d877=this;return new Promise(function(_0x3e88d4,_0x4285ff){return db['VoiceTransferReport'][_0xdb70('0x1a')](_0x4d2599[_0xdb70('0x1b')],{'raw':_0x4d2599[_0xdb70('0x1c')]?_0x4d2599['options'][_0xdb70('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5e9fdb){logger['info'](_0xdb70('0x19'),_0x4d2599);logger['debug'](_0xdb70('0x19'),_0x4d2599,JSON[_0xdb70('0x13')](_0x5e9fdb));_0x3e88d4(_0x5e9fdb);})[_0xdb70('0x18')](function(_0x1682cf){logger[_0xdb70('0x14')](_0xdb70('0x19'),_0x1682cf[_0xdb70('0x16')],_0x4d2599);_0x4285ff(_0x32d877[_0xdb70('0x14')](0x1f4,_0x1682cf[_0xdb70('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 523c187..6d29513 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 _0x1820=['/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','canUpdate','post','answer','/hold','hold','/unhold'];(function(_0x1a4e6c,_0x5aac91){var _0x5084d4=function(_0x3d0489){while(--_0x3d0489){_0x1a4e6c['push'](_0x1a4e6c['shift']());}};_0x5084d4(++_0x5aac91);}(_0x1820,0x154));var _0x0182=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x1820[_0x202c61];return _0x540691;};'use strict';var express=require(_0x0182('0x0'));var router=express[_0x0182('0x1')]();var auth=require(_0x0182('0x2'));var controller=require(_0x0182('0x3'));router['post'](_0x0182('0x4'),auth[_0x0182('0x5')](),auth[_0x0182('0x6')](),controller['originate']);router[_0x0182('0x7')]('/hangup',auth['isAuthenticated'](),auth['canUpdate'](),controller['hangup']);router[_0x0182('0x7')]('/answer',auth['isAuthenticated'](),auth[_0x0182('0x6')](),controller[_0x0182('0x8')]);router[_0x0182('0x7')](_0x0182('0x9'),auth[_0x0182('0x5')](),auth[_0x0182('0x6')](),controller[_0x0182('0xa')]);router[_0x0182('0x7')](_0x0182('0xb'),auth['isAuthenticated'](),auth[_0x0182('0x6')](),controller['unhold']);router['post'](_0x0182('0xc'),auth[_0x0182('0x5')](),auth[_0x0182('0x6')](),controller[_0x0182('0xd')]);router[_0x0182('0x7')](_0x0182('0xe'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x0182('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf29e=['exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','canUpdate','originate','/hangup','isAuthenticated','hangup','answer','/hold','/unhold','/calls','/transfer','transfer'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0xf29e,0x18d));var _0xef29=function(_0xd3a904,_0xd04e9b){_0xd3a904=_0xd3a904-0x0;var _0x44391f=_0xf29e[_0xd3a904];return _0x44391f;};'use strict';var express=require(_0xef29('0x0'));var router=express[_0xef29('0x1')]();var auth=require(_0xef29('0x2'));var controller=require(_0xef29('0x3'));router[_0xef29('0x4')](_0xef29('0x5'),auth['isAuthenticated'](),auth[_0xef29('0x6')](),controller[_0xef29('0x7')]);router[_0xef29('0x4')](_0xef29('0x8'),auth[_0xef29('0x9')](),auth[_0xef29('0x6')](),controller[_0xef29('0xa')]);router['post']('/answer',auth[_0xef29('0x9')](),auth[_0xef29('0x6')](),controller[_0xef29('0xb')]);router[_0xef29('0x4')](_0xef29('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller['hold']);router[_0xef29('0x4')](_0xef29('0xd'),auth[_0xef29('0x9')](),auth['canUpdate'](),controller['unhold']);router['post'](_0xef29('0xe'),auth[_0xef29('0x9')](),auth[_0xef29('0x6')](),controller['calls']);router['post'](_0xef29('0xf'),auth[_0xef29('0x9')](),auth[_0xef29('0x6')](),controller[_0xef29('0x10')]);module[_0xef29('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index a45e90d..c195b9a 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 _0x9f62=['user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','hold','entityFound:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','callNumber\x20is\x20required','string','userId\x20is\x20required','transferNumber\x20is\x20required','number','info','stringify','log','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','length','originate','originate\x20fired:','body','json','userId','callNumber','callerId','format'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x9f62,0x154));var _0x29f6=function(_0x3eee94,_0x505f04){_0x3eee94=_0x3eee94-0x0;var _0xbd25a6=_0x9f62[_0x3eee94];return _0xbd25a6;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x29f6('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x29f6('0x1'));var util=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x29f6('0x4')]({'port':0x232a});var logger=require(_0x29f6('0x5'))(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));config['redis']=_[_0x29f6('0x8')](config[_0x29f6('0x9')],{'host':_0x29f6('0xa'),'port':0x18eb});var io=require(_0x29f6('0xb'))(new Redis(config[_0x29f6('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x29f6('0xc')]},'callerId':{'type':_0x29f6('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x29f6('0xd'),'required':[!![],_0x29f6('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]}});function emit(_0x1dde97,_0x3a75d0,_0x25e5a2){logger[_0x29f6('0x11')](_0x1dde97,_0x3a75d0,JSON[_0x29f6('0x12')](_0x25e5a2));io['to'](_0x1dde97)['emit'](_0x3a75d0,_0x25e5a2);}function handleError(_0x51c92f){return function(_0x2e66d3){console[_0x29f6('0x13')](_0x29f6('0x14'),_0x2e66d3,_0x2e66d3 instanceof RangeError);logger['error'](_0x2e66d3[_0x29f6('0x15')]);if(_0x2e66d3 instanceof RangeError){if(_0x2e66d3[_0x29f6('0x16')]){delete _0x2e66d3['name'];}_0x51c92f[_0x29f6('0x17')](0x194)[_0x29f6('0x18')](_0x2e66d3);}else{if(_0x2e66d3[_0x29f6('0x16')]){delete _0x2e66d3[_0x29f6('0x16')];}_0x51c92f[_0x29f6('0x17')](0x1f4)[_0x29f6('0x18')](_0x2e66d3);}};}function checkError(){return function(_0x5673c8){if(!_0x5673c8){throw new RangeError(_0x29f6('0x19'));}return _0x5673c8;};}function respondWithRpcPromise(_0x59def4,_0x4acb15){return new BPromise(function(_0x470019,_0x1fa159){var _0x39c6b3=amiClient;return _0x39c6b3[_0x29f6('0x1a')](_0x59def4,_0x4acb15)['then'](function(_0x2c672e){if(_0x2c672e['error']){if(_0x2c672e[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){return _0x1fa159(_0x2c672e[_0x29f6('0x1b')][_0x29f6('0x1d')]);}return _0x470019(_0x2c672e['error'][_0x29f6('0x1d')]);}else{_0x470019(_0x2c672e[_0x29f6('0x1e')]);}})['catch'](function(_0x1401fb){_0x1fa159(_0x1401fb);});});}function getAgent(_0x45f792){return db[_0x29f6('0x1f')][_0x29f6('0x20')]({'where':{'id':_0x45f792,'role':_0x29f6('0x21')}})[_0x29f6('0x22')](checkError());}function getAgentCheckSession(_0x23c630,_0x50cdd2){return new BPromise(function(_0x2183b7,_0x454a4a){var _0x1ab8d8=respondWithRpcPromise(_0x29f6('0x23'));var _0xda0a63=getAgent(_0x23c630);Promise[_0x29f6('0x24')]([_0x1ab8d8,_0xda0a63])[_0x29f6('0x22')](function(_0x17b2f2){var _0x3d88db=_0x17b2f2[0x0];var _0x13a3a2=_0x17b2f2[0x1];var _0x2915bc=_[_0x29f6('0x25')](_0x3d88db[_0x29f6('0x26')],function(_0x304c28){return _0x304c28[_0x29f6('0x27')]==_0x13a3a2['id']&&_0x304c28[_0x29f6('0x28')]==_0x50cdd2;});if(_0x2915bc[_0x29f6('0x29')]==0x1){_0x2183b7(_0x13a3a2);}else{_0x454a4a(new RangeError('sessionId\x20'+_0x50cdd2+'\x20not\x20found!'));}});});}exports[_0x29f6('0x2a')]=function(_0x489897,_0x341071){logger[_0x29f6('0x11')](_0x29f6('0x2b'),_0x489897[_0x29f6('0x2c')]);var _0x5e5d89=originateValidation['validate'](_0x489897[_0x29f6('0x2c')]);if(_0x5e5d89[_0x29f6('0x29')]>0x0){return _0x341071[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x5e5d89);}var _0x3a223b=_0x489897[_0x29f6('0x2c')][_0x29f6('0x2e')];var _0x1c3f0f=_0x489897[_0x29f6('0x2c')][_0x29f6('0x2f')];var _0x46d0d0=_0x489897[_0x29f6('0x2c')][_0x29f6('0x30')];var _0x23ad1a=_0x489897['body']['callbackUrl'];return getAgent(_0x3a223b)[_0x29f6('0x22')](function(_0x44cf19){logger[_0x29f6('0x11')]('entityFound:',_0x44cf19[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x44cf19[_0x29f6('0x16')]),_0x29f6('0x33'),{'callNumber':_0x1c3f0f,'callerId':_0x46d0d0,'callbackUrl':_0x23ad1a});return _0x341071['status'](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x34')});})[_0x29f6('0x35')](handleError(_0x341071));};exports[_0x29f6('0x36')]=function(_0x4f5fe1,_0x30d747){logger[_0x29f6('0x11')](_0x29f6('0x37'),_0x4f5fe1[_0x29f6('0x2c')]);var _0x5ddc09=hangupValidation['validate'](_0x4f5fe1[_0x29f6('0x2c')]);if(_0x5ddc09['length']>0x0){return _0x30d747[_0x29f6('0x17')](0x190)['json'](_0x5ddc09);}var _0x3a1a75=_0x4f5fe1['body'][_0x29f6('0x2e')];var _0x11fb2d=_0x4f5fe1['body'][_0x29f6('0x28')];return getAgent(_0x3a1a75)['then'](function(_0x3f3475){logger[_0x29f6('0x11')]('entityFound:',_0x3f3475[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x3f3475[_0x29f6('0x16')]),'webbar:hangup',{'sessionId':_0x11fb2d});return _0x30d747[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x38')});})[_0x29f6('0x35')](handleError(_0x30d747));};exports[_0x29f6('0x39')]=function(_0x4d4189,_0xb5f2b1){logger['info'](_0x29f6('0x3a'),_0x4d4189['body']);var _0xbfe671=answerValidation[_0x29f6('0x3b')](_0x4d4189['body']);if(_0xbfe671[_0x29f6('0x29')]>0x0){return _0xb5f2b1[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0xbfe671);}var _0x27d655=_0x4d4189['body'][_0x29f6('0x2e')];var _0x2a83b7=_0x4d4189[_0x29f6('0x2c')]['sessionId'];return getAgent(_0x27d655)[_0x29f6('0x22')](function(_0x4a5f35){logger[_0x29f6('0x11')]('entityFound:',_0x4a5f35['name']);emit(util['format'](_0x29f6('0x32'),_0x4a5f35[_0x29f6('0x16')]),_0x29f6('0x3c'),{'sessionId':_0x2a83b7});return _0xb5f2b1[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x3d')});})[_0x29f6('0x35')](handleError(_0xb5f2b1));};exports[_0x29f6('0x3e')]=function(_0x352119,_0x1bde93){logger['info']('hold\x20fired:',_0x352119[_0x29f6('0x2c')]);var _0x450e76=holdValidation[_0x29f6('0x3b')](_0x352119[_0x29f6('0x2c')]);if(_0x450e76['length']>0x0){return _0x1bde93[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x450e76);}var _0x532df5=_0x352119[_0x29f6('0x2c')][_0x29f6('0x2e')];var _0x123e2f=_0x352119[_0x29f6('0x2c')][_0x29f6('0x28')];return getAgent(_0x532df5)[_0x29f6('0x22')](function(_0x320b5e){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x320b5e[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x320b5e['name']),_0x29f6('0x40'),{'sessionId':_0x123e2f});return _0x1bde93[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x41')});})[_0x29f6('0x35')](handleError(_0x1bde93));};exports['unhold']=function(_0x2e29e3,_0x52be22){logger['info'](_0x29f6('0x42'),_0x2e29e3[_0x29f6('0x2c')]);var _0x3194fa=unholdValidation[_0x29f6('0x3b')](_0x2e29e3[_0x29f6('0x2c')]);if(_0x3194fa['length']>0x0){return _0x52be22[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x3194fa);}var _0x5f42f3=_0x2e29e3[_0x29f6('0x2c')]['userId'];var _0x288cf2=_0x2e29e3[_0x29f6('0x2c')][_0x29f6('0x28')];return getAgent(_0x5f42f3)[_0x29f6('0x22')](function(_0x5c9113){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x5c9113[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x5c9113[_0x29f6('0x16')]),_0x29f6('0x43'),{'sessionId':_0x288cf2});return _0x52be22['status'](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x44')});})[_0x29f6('0x35')](handleError(_0x52be22));};exports[_0x29f6('0x45')]=function(_0x36e52c,_0x1ac20d){logger[_0x29f6('0x11')](_0x29f6('0x46'),_0x1ac20d[_0x29f6('0x2c')]);var _0x3dbd19=callsValidation['validate'](_0x36e52c['body']);if(_0x3dbd19[_0x29f6('0x29')]>0x0){return _0x1ac20d[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x3dbd19);}var _0x5ab84e=_0x36e52c[_0x29f6('0x2c')]['userId'];var _0x550190=respondWithRpcPromise(_0x29f6('0x23'));var _0x234d30=getAgent(_0x5ab84e);return Promise['all']([_0x550190,_0x234d30])['then'](function(_0x3e22f8){var _0x46998c=_0x3e22f8[0x0];var _0x439c0b=_0x3e22f8[0x1];var _0x58694e=_[_0x29f6('0x25')](_0x46998c[_0x29f6('0x26')],function(_0x4284fd){return _0x4284fd[_0x29f6('0x27')]==_0x439c0b['id'];});return _0x1ac20d[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'count':_0x58694e[_0x29f6('0x29')],'rows':_0x58694e});})[_0x29f6('0x35')](handleError(_0x1ac20d));};exports[_0x29f6('0x47')]=function(_0x192525,_0x2d4c8d){logger[_0x29f6('0x11')](_0x29f6('0x48'),_0x192525['body']);var _0x5e25c0=conferenceValidation[_0x29f6('0x3b')](_0x192525['body']);if(_0x5e25c0[_0x29f6('0x29')]>0x0){return _0x2d4c8d[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x5e25c0);}var _0x40b4d7=_0x192525[_0x29f6('0x2c')]['userId'];return getAgent(_0x40b4d7)[_0x29f6('0x22')](function(_0x38d684){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x38d684[_0x29f6('0x16')]);emit(util['format'](_0x29f6('0x32'),_0x38d684['name']),'webbar:conference');return _0x2d4c8d[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0x29f6('0x35')](handleError(_0x2d4c8d));};exports[_0x29f6('0x49')]=function(_0x58bdf4,_0x44b3ee){logger[_0x29f6('0x11')](_0x29f6('0x4a'),_0x58bdf4[_0x29f6('0x2c')]);var _0xf3c5f1=transferValidation[_0x29f6('0x3b')](_0x58bdf4[_0x29f6('0x2c')]);if(_0xf3c5f1['length']>0x0){return _0x44b3ee[_0x29f6('0x17')](0x190)['json'](_0xf3c5f1);}var _0x37162d=_0x58bdf4['body']['userId'];var _0x1a3357=_0x58bdf4[_0x29f6('0x2c')][_0x29f6('0x28')];var _0x536b0c=_0x58bdf4[_0x29f6('0x2c')][_0x29f6('0x4b')];return getAgent(_0x37162d)[_0x29f6('0x22')](function(_0x5625b1){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x5625b1[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x5625b1[_0x29f6('0x16')]),_0x29f6('0x4c'),{'sessionId':_0x1a3357,'transferNumber':_0x536b0c});return _0x44b3ee[_0x29f6('0x17')](0xc8)['json']({'error':![],'message':_0x29f6('0x4d')});})[_0x29f6('0x35')](handleError(_0x44b3ee));}; \ No newline at end of file +var _0x76dc=['agent','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','originate','info','body','length','json','userId','callerId','format','user:%s','webbar:originate','originate\x20executed!','hangup','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','filter','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','http','ioredis','redis','defaults','socket.io-emitter','validate','string','callNumber\x20is\x20required','userId\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','catch','User','findOne'];(function(_0x4d01c4,_0x4a9db1){var _0x57219d=function(_0x2d9dcb){while(--_0x2d9dcb){_0x4d01c4['push'](_0x4d01c4['shift']());}};_0x57219d(++_0x4a9db1);}(_0x76dc,0x1f2));var _0xc76d=function(_0x456f70,_0x66f4e5){_0x456f70=_0x456f70-0x0;var _0x12c9e8=_0x76dc[_0x456f70];return _0x12c9e8;};'use strict';var path=require(_0xc76d('0x0'));var fs=require('fs');var _=require(_0xc76d('0x1'));var db=require(_0xc76d('0x2'))['db'];var config=require(_0xc76d('0x3'));var util=require('util');var BPromise=require(_0xc76d('0x4'));var jayson=require(_0xc76d('0x5'));var amiClient=jayson['client'][_0xc76d('0x6')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xc76d('0x7'));config[_0xc76d('0x8')]=_[_0xc76d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc76d('0xa'))(new Redis(config[_0xc76d('0x8')]));var Schema=require(_0xc76d('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xc76d('0xc')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0x10')]},'transferNumber':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]}});function emit(_0x6f94e,_0x5c680c,_0x32e0a8){logger['info'](_0x6f94e,_0x5c680c,JSON['stringify'](_0x32e0a8));io['to'](_0x6f94e)[_0xc76d('0x12')](_0x5c680c,_0x32e0a8);}function handleError(_0x31b032){return function(_0x339623){console[_0xc76d('0x13')](_0xc76d('0x14'),_0x339623,_0x339623 instanceof RangeError);logger['error'](_0x339623[_0xc76d('0x15')]);if(_0x339623 instanceof RangeError){if(_0x339623[_0xc76d('0x16')]){delete _0x339623[_0xc76d('0x16')];}_0x31b032[_0xc76d('0x17')](0x194)[_0xc76d('0x18')](_0x339623);}else{if(_0x339623['name']){delete _0x339623[_0xc76d('0x16')];}_0x31b032[_0xc76d('0x17')](0x1f4)['send'](_0x339623);}};}function checkError(){return function(_0x455371){if(!_0x455371){throw new RangeError(_0xc76d('0x19'));}return _0x455371;};}function respondWithRpcPromise(_0x191e97,_0xb89876){return new BPromise(function(_0x18f546,_0x3d357b){var _0x42b89c=amiClient;return _0x42b89c[_0xc76d('0x1a')](_0x191e97,_0xb89876)[_0xc76d('0x1b')](function(_0x20e09c){if(_0x20e09c[_0xc76d('0x1c')]){if(_0x20e09c['error'][_0xc76d('0x1d')]===0x1f4){return _0x3d357b(_0x20e09c[_0xc76d('0x1c')]['message']);}return _0x18f546(_0x20e09c[_0xc76d('0x1c')][_0xc76d('0x1e')]);}else{_0x18f546(_0x20e09c['result']);}})[_0xc76d('0x1f')](function(_0x476aee){_0x3d357b(_0x476aee);});});}function getAgent(_0x2cd06e){return db[_0xc76d('0x20')][_0xc76d('0x21')]({'where':{'id':_0x2cd06e,'role':_0xc76d('0x22')}})[_0xc76d('0x1b')](checkError());}function getAgentCheckSession(_0x59ebd1,_0x59dabf){return new BPromise(function(_0x285430,_0x287ae4){var _0x5069ea=respondWithRpcPromise(_0xc76d('0x23'));var _0x52a79a=getAgent(_0x59ebd1);Promise[_0xc76d('0x24')]([_0x5069ea,_0x52a79a])['then'](function(_0x2039f4){var _0x5cf2e4=_0x2039f4[0x0];var _0x13b468=_0x2039f4[0x1];var _0x18a7fa=_['filter'](_0x5cf2e4[_0xc76d('0x25')],function(_0x1c68f3){return _0x1c68f3[_0xc76d('0x26')]==_0x13b468['id']&&_0x1c68f3[_0xc76d('0x27')]==_0x59dabf;});if(_0x18a7fa['length']==0x1){_0x285430(_0x13b468);}else{_0x287ae4(new RangeError(_0xc76d('0x28')+_0x59dabf+'\x20not\x20found!'));}});});}exports[_0xc76d('0x29')]=function(_0x5e9233,_0x30769f){logger[_0xc76d('0x2a')]('originate\x20fired:',_0x5e9233['body']);var _0x5eca19=originateValidation['validate'](_0x5e9233[_0xc76d('0x2b')]);if(_0x5eca19[_0xc76d('0x2c')]>0x0){return _0x30769f[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x5eca19);}var _0x1b2ed1=_0x5e9233['body'][_0xc76d('0x2e')];var _0x55e825=_0x5e9233[_0xc76d('0x2b')]['callNumber'];var _0x1bef44=_0x5e9233[_0xc76d('0x2b')][_0xc76d('0x2f')];var _0x20fe33=_0x5e9233[_0xc76d('0x2b')]['callbackUrl'];return getAgent(_0x1b2ed1)[_0xc76d('0x1b')](function(_0x371306){logger[_0xc76d('0x2a')]('entityFound:',_0x371306[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x371306['name']),_0xc76d('0x32'),{'callNumber':_0x55e825,'callerId':_0x1bef44,'callbackUrl':_0x20fe33});return _0x30769f[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x33')});})[_0xc76d('0x1f')](handleError(_0x30769f));};exports[_0xc76d('0x34')]=function(_0x579d93,_0x518945){logger[_0xc76d('0x2a')]('hangup\x20fired:',_0x579d93[_0xc76d('0x2b')]);var _0x359f38=hangupValidation[_0xc76d('0xb')](_0x579d93[_0xc76d('0x2b')]);if(_0x359f38['length']>0x0){return _0x518945['status'](0x190)[_0xc76d('0x2d')](_0x359f38);}var _0x20a456=_0x579d93[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x410029=_0x579d93['body'][_0xc76d('0x27')];return getAgent(_0x20a456)[_0xc76d('0x1b')](function(_0x321989){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x321989[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x321989[_0xc76d('0x16')]),_0xc76d('0x36'),{'sessionId':_0x410029});return _0x518945['status'](0xc8)['json']({'error':![],'message':_0xc76d('0x37')});})[_0xc76d('0x1f')](handleError(_0x518945));};exports[_0xc76d('0x38')]=function(_0x27bdff,_0x4ae994){logger['info'](_0xc76d('0x39'),_0x27bdff[_0xc76d('0x2b')]);var _0x3e471e=answerValidation[_0xc76d('0xb')](_0x27bdff[_0xc76d('0x2b')]);if(_0x3e471e[_0xc76d('0x2c')]>0x0){return _0x4ae994[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x3e471e);}var _0x50e922=_0x27bdff[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x1bf8a0=_0x27bdff[_0xc76d('0x2b')]['sessionId'];return getAgent(_0x50e922)['then'](function(_0x4bf591){logger['info']('entityFound:',_0x4bf591['name']);emit(util['format'](_0xc76d('0x31'),_0x4bf591[_0xc76d('0x16')]),_0xc76d('0x3a'),{'sessionId':_0x1bf8a0});return _0x4ae994[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x3b')});})[_0xc76d('0x1f')](handleError(_0x4ae994));};exports[_0xc76d('0x3c')]=function(_0x555f14,_0x462214){logger[_0xc76d('0x2a')](_0xc76d('0x3d'),_0x555f14[_0xc76d('0x2b')]);var _0xb9cca2=holdValidation[_0xc76d('0xb')](_0x555f14[_0xc76d('0x2b')]);if(_0xb9cca2[_0xc76d('0x2c')]>0x0){return _0x462214[_0xc76d('0x17')](0x190)['json'](_0xb9cca2);}var _0x5b41d3=_0x555f14[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x2fa905=_0x555f14[_0xc76d('0x2b')][_0xc76d('0x27')];return getAgent(_0x5b41d3)['then'](function(_0x25fc9d){logger[_0xc76d('0x2a')]('entityFound:',_0x25fc9d['name']);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x25fc9d['name']),_0xc76d('0x3e'),{'sessionId':_0x2fa905});return _0x462214[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x3f')});})[_0xc76d('0x1f')](handleError(_0x462214));};exports[_0xc76d('0x40')]=function(_0x25a549,_0x10b1b0){logger[_0xc76d('0x2a')](_0xc76d('0x41'),_0x25a549['body']);var _0x4efd83=unholdValidation[_0xc76d('0xb')](_0x25a549[_0xc76d('0x2b')]);if(_0x4efd83['length']>0x0){return _0x10b1b0[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x4efd83);}var _0x506b03=_0x25a549[_0xc76d('0x2b')]['userId'];var _0xe90d83=_0x25a549[_0xc76d('0x2b')][_0xc76d('0x27')];return getAgent(_0x506b03)[_0xc76d('0x1b')](function(_0x14ef42){logger['info']('entityFound:',_0x14ef42['name']);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x14ef42[_0xc76d('0x16')]),_0xc76d('0x42'),{'sessionId':_0xe90d83});return _0x10b1b0[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':'unhold\x20executed!'});})[_0xc76d('0x1f')](handleError(_0x10b1b0));};exports[_0xc76d('0x43')]=function(_0x5e66d9,_0x1a49d5){logger[_0xc76d('0x2a')]('calls\x20fired:',_0x1a49d5[_0xc76d('0x2b')]);var _0x463cbe=callsValidation[_0xc76d('0xb')](_0x5e66d9[_0xc76d('0x2b')]);if(_0x463cbe[_0xc76d('0x2c')]>0x0){return _0x1a49d5[_0xc76d('0x17')](0x190)['json'](_0x463cbe);}var _0x91b25b=_0x5e66d9[_0xc76d('0x2b')]['userId'];var _0x5f3973=respondWithRpcPromise(_0xc76d('0x23'));var _0x5ddcc6=getAgent(_0x91b25b);return Promise[_0xc76d('0x24')]([_0x5f3973,_0x5ddcc6])[_0xc76d('0x1b')](function(_0x12b287){var _0xfe2be1=_0x12b287[0x0];var _0x254128=_0x12b287[0x1];var _0x4746a5=_[_0xc76d('0x44')](_0xfe2be1[_0xc76d('0x25')],function(_0x3ada89){return _0x3ada89[_0xc76d('0x26')]==_0x254128['id'];});return _0x1a49d5[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'count':_0x4746a5[_0xc76d('0x2c')],'rows':_0x4746a5});})[_0xc76d('0x1f')](handleError(_0x1a49d5));};exports['conference']=function(_0x3054e0,_0xa0aa45){logger[_0xc76d('0x2a')](_0xc76d('0x45'),_0x3054e0[_0xc76d('0x2b')]);var _0x5ce99d=conferenceValidation[_0xc76d('0xb')](_0x3054e0[_0xc76d('0x2b')]);if(_0x5ce99d['length']>0x0){return _0xa0aa45['status'](0x190)['json'](_0x5ce99d);}var _0x382db6=_0x3054e0[_0xc76d('0x2b')][_0xc76d('0x2e')];return getAgent(_0x382db6)[_0xc76d('0x1b')](function(_0x2ba812){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x2ba812[_0xc76d('0x16')]);emit(util['format'](_0xc76d('0x31'),_0x2ba812['name']),'webbar:conference');return _0xa0aa45[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x46')});})['catch'](handleError(_0xa0aa45));};exports[_0xc76d('0x47')]=function(_0x57068d,_0x48ccf7){logger['info'](_0xc76d('0x48'),_0x57068d[_0xc76d('0x2b')]);var _0x513623=transferValidation[_0xc76d('0xb')](_0x57068d[_0xc76d('0x2b')]);if(_0x513623[_0xc76d('0x2c')]>0x0){return _0x48ccf7[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x513623);}var _0xa81af6=_0x57068d[_0xc76d('0x2b')]['userId'];var _0x5035fd=_0x57068d['body'][_0xc76d('0x27')];var _0x2e742f=_0x57068d[_0xc76d('0x2b')][_0xc76d('0x49')];return getAgent(_0xa81af6)[_0xc76d('0x1b')](function(_0x49f876){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x49f876[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x49f876[_0xc76d('0x16')]),_0xc76d('0x4a'),{'sessionId':_0x5035fd,'transferNumber':_0x2e742f});return _0x48ccf7[_0xc76d('0x17')](0xc8)['json']({'error':![],'message':_0xc76d('0x4b')});})['catch'](handleError(_0x48ccf7));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index abdbcf9..c6d3f4d 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 _0x7708=['../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','../../components/interaction/service'];(function(_0x3196bf,_0x432e0c){var _0x5b4184=function(_0x68ea66){while(--_0x68ea66){_0x3196bf['push'](_0x3196bf['shift']());}};_0x5b4184(++_0x432e0c);}(_0x7708,0x188));var _0x8770=function(_0x130d82,_0x25f49b){_0x130d82=_0x130d82-0x0;var _0x112070=_0x7708[_0x130d82];return _0x112070;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./whatsappAccount.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['getAnswers']);router[_0x8770('0x5')](_0x8770('0xf'),auth[_0x8770('0x8')](),controller['getAgents']);router[_0x8770('0x5')](_0x8770('0x10'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0x12')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x13')]);router[_0x8770('0x12')]('/:id/dispositions',auth[_0x8770('0x8')](),controller[_0x8770('0x14')]);router['post'](_0x8770('0xe'),auth['isAuthenticated'](),controller[_0x8770('0x15')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x8770('0x16')]);router[_0x8770('0x12')](_0x8770('0x10'),auth[_0x8770('0x8')](),controller['addApplications']);router['post'](_0x8770('0x17'),controller[_0x8770('0x18')]);router[_0x8770('0x12')](_0x8770('0x19'),auth[_0x8770('0x8')](),controller['send']);router[_0x8770('0x1a')](_0x8770('0xa'),auth[_0x8770('0x8')](),controller[_0x8770('0x1b')]);router['delete']('/:id',auth[_0x8770('0x8')](),controller[_0x8770('0x1c')]);router[_0x8770('0x1d')](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x1e')]);router['delete'](_0x8770('0xe'),auth[_0x8770('0x8')](),controller[_0x8770('0x1f')]);router[_0x8770('0x1d')]('/:id/users',auth[_0x8770('0x8')](),controller['removeAgents']);module[_0x8770('0x20')]=router; \ No newline at end of file +var _0xb016=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getApplications','addAnswer','post','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x1741e0,_0xd33eba){var _0x1c4768=function(_0x3ffd55){while(--_0x3ffd55){_0x1741e0['push'](_0x1741e0['shift']());}};_0x1c4768(++_0xd33eba);}(_0xb016,0x159));var _0x6b01=function(_0x288734,_0xf035f7){_0x288734=_0x288734-0x0;var _0x1f33af=_0xb016[_0x288734];return _0x1f33af;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./whatsappAccount.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0x7')](_0x6b01('0xc'),auth[_0x6b01('0x8')](),controller['getDispositions']);router['get'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router['get'](_0x6b01('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6b01('0x7')]('/:id/applications',auth[_0x6b01('0x8')](),controller[_0x6b01('0x10')]);router['post']('/',auth[_0x6b01('0x8')](),controller['create']);router['post']('/:id/dispositions',auth[_0x6b01('0x8')](),controller['addDisposition']);router['post'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x11')]);router[_0x6b01('0x12')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x13')]);router[_0x6b01('0x12')](_0x6b01('0x14'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x15')]);router['post'](_0x6b01('0x16'),controller[_0x6b01('0x17')]);router[_0x6b01('0x12')](_0x6b01('0x18'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x19')]);router[_0x6b01('0x1a')](_0x6b01('0x1b'),auth['isAuthenticated'](),controller[_0x6b01('0x1c')]);router[_0x6b01('0x1d')](_0x6b01('0x1b'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x1e')]);router[_0x6b01('0x1d')](_0x6b01('0xc'),auth['isAuthenticated'](),controller[_0x6b01('0x1f')]);router[_0x6b01('0x1d')](_0x6b01('0xd'),auth['isAuthenticated'](),controller[_0x6b01('0x20')]);router[_0x6b01('0x1d')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x21')]);module[_0x6b01('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index dd55c3e..9829ee3 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 _0xf9ff=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name','STRING','generate','ENUM','twilio','TEXT'];(function(_0x543db9,_0x2dcf3d){var _0x1d8f02=function(_0x3e37f0){while(--_0x3e37f0){_0x543db9['push'](_0x543db9['shift']());}};_0x1d8f02(++_0x2dcf3d);}(_0xf9ff,0x149));var _0xff9f=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0xf9ff[_0x56138f];return _0x1acaf7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xff9f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xff9f('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xff9f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xff9f('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xff9f('0x2')],'defaultValue':function(){return rs[_0xff9f('0x3')]();}},'phone':{'type':Sequelize[_0xff9f('0x2')]},'type':{'type':Sequelize[_0xff9f('0x4')](_0xff9f('0x5'))},'accountSid':{'type':Sequelize[_0xff9f('0x2')]},'authToken':{'type':Sequelize[_0xff9f('0x2')]},'notificationTemplate':{'type':Sequelize[_0xff9f('0x6')],'defaultValue':function(){return _0xff9f('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xff9f('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xff9f('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xff9f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xff9f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff9f('0x9')],'comment':_0xff9f('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xff9f('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x256767){if(!_0x256767){this[_0xff9f('0xb')](_0xff9f('0xc'),null);}this['setDataValue'](_0xff9f('0xd'),_0x256767);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x743f=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x3b572d,_0x114d38){var _0x53526b=function(_0x45dadb){while(--_0x45dadb){_0x3b572d['push'](_0x3b572d['shift']());}};_0x53526b(++_0x114d38);}(_0x743f,0x11e));var _0xf743=function(_0x294e9e,_0x37afa4){_0x294e9e=_0x294e9e-0x0;var _0x2fe1e4=_0x743f[_0x294e9e];return _0x2fe1e4;};'use strict';var Sequelize=require(_0xf743('0x0'));var rs=require(_0xf743('0x1'));module[_0xf743('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xf743('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xf743('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xf743('0x4')]},'type':{'type':Sequelize[_0xf743('0x5')]('twilio')},'accountSid':{'type':Sequelize[_0xf743('0x4')]},'authToken':{'type':Sequelize[_0xf743('0x4')]},'notificationTemplate':{'type':Sequelize[_0xf743('0x6')],'defaultValue':function(){return _0xf743('0x7');}},'notificationSound':{'type':Sequelize[_0xf743('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xf743('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf743('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf743('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf743('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf743('0x8')],'defaultValue':![],'comment':_0xf743('0xa'),'set':function(_0x2acd21){if(!_0x2acd21){this[_0xf743('0xb')](_0xf743('0xc'),null);}this[_0xf743('0xb')](_0xf743('0xd'),_0x2acd21);}},'description':{'type':Sequelize[_0xf743('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 541e965..e80fd6f 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 _0x186d=['autoAssociation','params','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','WhatsappApplication','priority','getApplications','notify','Applications','applications','orderBy','asc','account','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','replace','whatsapp:','messageId','MessageSid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','created','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','to\x20is\x20mandatory','CmList','List','defaults','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','fieldName','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','include','findAll','rows','Pause','rawAttributes','intersection','length','includeAll','WhatsappAccount','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x186d,0x1ca));var _0xd186=function(_0x38d92b,_0x1be181){_0x38d92b=_0x38d92b-0x0;var _0x56c746=_0x186d[_0x38d92b];return _0x56c746;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd186('0x0'));var zipdir=require(_0xd186('0x1'));var jsonpatch=require(_0xd186('0x2'));var rp=require(_0xd186('0x3'));var moment=require(_0xd186('0x4'));var BPromise=require(_0xd186('0x5'));var Mustache=require('mustache');var util=require(_0xd186('0x6'));var path=require(_0xd186('0x7'));var sox=require(_0xd186('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd186('0x9'));var _=require(_0xd186('0xa'));var squel=require(_0xd186('0xb'));var crypto=require('crypto');var jsforce=require(_0xd186('0xc'));var deskjs=require(_0xd186('0xd'));var toCsv=require(_0xd186('0xe'));var querystring=require('querystring');var Papa=require(_0xd186('0xf'));var Redis=require(_0xd186('0x10'));var authService=require(_0xd186('0x11'));var qs=require(_0xd186('0x12'));var as=require(_0xd186('0x13'));var hardwareService=require(_0xd186('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd186('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd186('0x16'));var db=require(_0xd186('0x17'))['db'];config[_0xd186('0x18')]=_['defaults'](config[_0xd186('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd186('0x19'))(new Redis(config[_0xd186('0x18')]));require(_0xd186('0x1a'))[_0xd186('0x1b')](socket);var jayson=require(_0xd186('0x1c'));var client=jayson[_0xd186('0x1d')][_0xd186('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x152ede,_0xc23af7,_0xfb67a0,_0x207d6a){return new BPromise(function(_0x4ad92c,_0x3b4656){var _0x94b224=_0x207d6a||client;return _0x94b224[_0xd186('0x1f')](_0x152ede,_0xfb67a0)[_0xd186('0x20')](function(_0x25e2e0){logger[_0xd186('0x21')](_0xd186('0x22'),_0xc23af7,'request\x20sent');logger[_0xd186('0x23')](_0xd186('0x24'),_0xc23af7,'request\x20sent',JSON[_0xd186('0x25')](_0x25e2e0));if(_0x25e2e0[_0xd186('0x26')]){if(_0x25e2e0['error']['code']===0x1f4){logger[_0xd186('0x26')](_0xd186('0x22'),_0xc23af7,_0x25e2e0[_0xd186('0x26')][_0xd186('0x27')]);return _0x3b4656(_0x25e2e0[_0xd186('0x26')]['message']);}logger[_0xd186('0x26')](_0xd186('0x22'),_0xc23af7,_0x25e2e0[_0xd186('0x26')]['message']);return _0x4ad92c(_0x25e2e0['error'][_0xd186('0x27')]);}else{logger[_0xd186('0x21')](_0xd186('0x22'),_0xc23af7,'request\x20sent');_0x4ad92c(_0x25e2e0['result'][_0xd186('0x27')]);}})[_0xd186('0x28')](function(_0x529496){logger['error'](_0xd186('0x22'),_0xc23af7,_0x529496);_0x3b4656(_0x529496);});});}function respondWithStatusCode(_0x379db6,_0x3c0a37){_0x3c0a37=_0x3c0a37||0xcc;return function(_0x2bbf4e){if(_0x2bbf4e){return _0x379db6[_0xd186('0x29')](_0x3c0a37);}return _0x379db6[_0xd186('0x2a')](_0x3c0a37)[_0xd186('0x2b')]();};}function respondWithResult(_0x5f47ed,_0x5a40b8){_0x5a40b8=_0x5a40b8||0xc8;return function(_0x110509){if(_0x110509){return _0x5f47ed[_0xd186('0x2a')](_0x5a40b8)[_0xd186('0x2c')](_0x110509);}};}function respondWithFilteredResult(_0x24cf30,_0x17cce9){return function(_0x5962c9){if(_0x5962c9){var _0x2ac1e2=typeof _0x17cce9[_0xd186('0x2d')]===_0xd186('0x2e')&&typeof _0x17cce9[_0xd186('0x2f')]===_0xd186('0x2e');var _0x40ff67=_0x5962c9[_0xd186('0x30')];var _0x1e9c47=_0x2ac1e2?0x0:_0x17cce9[_0xd186('0x2d')];var _0x2dbedd=_0x2ac1e2?_0x5962c9[_0xd186('0x30')]:_0x17cce9[_0xd186('0x2d')]+_0x17cce9[_0xd186('0x2f')];var _0x3e39a1;if(_0x2dbedd>=_0x40ff67){_0x2dbedd=_0x40ff67;_0x3e39a1=0xc8;}else{_0x3e39a1=0xce;}_0x24cf30[_0xd186('0x2a')](_0x3e39a1);return _0x24cf30[_0xd186('0x31')](_0xd186('0x32'),_0x1e9c47+'-'+_0x2dbedd+'/'+_0x40ff67)[_0xd186('0x2c')](_0x5962c9);}return null;};}function patchUpdates(_0xd5b3e){return function(_0x280bbb){try{jsonpatch[_0xd186('0x33')](_0x280bbb,_0xd5b3e,!![]);}catch(_0x10a699){return BPromise[_0xd186('0x34')](_0x10a699);}return _0x280bbb[_0xd186('0x35')]();};}function saveUpdates(_0x41f277,_0x6bd471){return function(_0x11bb9a){if(_0x11bb9a){return _0x11bb9a[_0xd186('0x36')](_0x41f277)[_0xd186('0x20')](function(_0x30438b){return _0x30438b;});}return null;};}function removeEntity(_0x24629e,_0x40ca64){return function(_0x4c1945){if(_0x4c1945){return _0x4c1945[_0xd186('0x37')]()[_0xd186('0x20')](function(){var _0x1fe639=_0x4c1945[_0xd186('0x38')]({'plain':!![]});var _0x3d38b2=_0xd186('0x39');return db[_0xd186('0x3a')][_0xd186('0x37')]({'where':{'type':_0x3d38b2,'resourceId':_0x1fe639['id']}})['then'](function(){return _0x4c1945;});})[_0xd186('0x20')](function(){_0x24629e[_0xd186('0x2a')](0xcc)[_0xd186('0x2b')]();});}};}function handleEntityNotFound(_0x348f83,_0x473a4b){return function(_0x6b4fa0){if(!_0x6b4fa0){_0x348f83[_0xd186('0x29')](0x194);}return _0x6b4fa0;};}function handleError(_0x14eb81,_0x3f09fc){_0x3f09fc=_0x3f09fc||0x1f4;return function(_0x2a4f8c){logger[_0xd186('0x26')](_0x2a4f8c[_0xd186('0x3b')]);if(_0x2a4f8c['name']){delete _0x2a4f8c[_0xd186('0x3c')];}_0x14eb81[_0xd186('0x2a')](_0x3f09fc)['send'](_0x2a4f8c);};}exports[_0xd186('0x3d')]=function(_0x3b6874,_0x47616c){var _0x319bd5={'include':[{'model':db['Pause'],'as':_0xd186('0x3e')}]},_0x53bcad={},_0x1908a1={'count':0x0,'rows':[]};var _0x2a1544=_[_0xd186('0x3f')](db['WhatsappAccount']['rawAttributes'],function(_0x38d001){return{'name':_0x38d001[_0xd186('0x40')],'type':_0x38d001['type']['key']};});_0x53bcad[_0xd186('0x41')]=_[_0xd186('0x3f')](_0x2a1544,'name');_0x53bcad[_0xd186('0x42')]=_[_0xd186('0x43')](_0x3b6874[_0xd186('0x42')]);_0x53bcad[_0xd186('0x44')]=_['intersection'](_0x53bcad[_0xd186('0x41')],_0x53bcad['query']);_0x319bd5[_0xd186('0x45')]=_['intersection'](_0x53bcad[_0xd186('0x41')],qs[_0xd186('0x46')](_0x3b6874[_0xd186('0x42')]['fields']));_0x319bd5[_0xd186('0x45')]=_0x319bd5[_0xd186('0x45')]['length']?_0x319bd5[_0xd186('0x45')]:_0x53bcad[_0xd186('0x41')];if(!_0x3b6874['query']['hasOwnProperty'](_0xd186('0x47'))){_0x319bd5['limit']=qs[_0xd186('0x2f')](_0x3b6874['query']['limit']);_0x319bd5[_0xd186('0x2d')]=qs[_0xd186('0x2d')](_0x3b6874['query'][_0xd186('0x2d')]);}_0x319bd5[_0xd186('0x48')]=qs['sort'](_0x3b6874['query'][_0xd186('0x49')]);_0x319bd5[_0xd186('0x4a')]=qs[_0xd186('0x44')](_[_0xd186('0x4b')](_0x3b6874[_0xd186('0x42')],_0x53bcad[_0xd186('0x44')]),_0x2a1544);if(_0x3b6874[_0xd186('0x42')]['filter']){_0x319bd5[_0xd186('0x4a')]=_['merge'](_0x319bd5[_0xd186('0x4a')],{'$or':_[_0xd186('0x3f')](_0x2a1544,function(_0x3cb411){if(_0x3cb411[_0xd186('0x4c')]!==_0xd186('0x4d')){var _0x117d58={};_0x117d58[_0x3cb411['name']]={'$like':'%'+_0x3b6874[_0xd186('0x42')][_0xd186('0x4e')]+'%'};return _0x117d58;}})});}_0x319bd5=_[_0xd186('0x4f')]({},_0x319bd5,_0x3b6874[_0xd186('0x50')]);var _0x1ef2ad={'where':_0x319bd5['where']};return db['WhatsappAccount'][_0xd186('0x30')](_0x1ef2ad)[_0xd186('0x20')](function(_0x48ad62){_0x1908a1[_0xd186('0x30')]=_0x48ad62;if(_0x3b6874[_0xd186('0x42')]['includeAll']){_0x319bd5[_0xd186('0x51')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xd186('0x52')](_0x319bd5);})['then'](function(_0x3c41e1){_0x1908a1[_0xd186('0x53')]=_0x3c41e1;return _0x1908a1;})[_0xd186('0x20')](respondWithFilteredResult(_0x47616c,_0x319bd5))[_0xd186('0x28')](handleError(_0x47616c,null));};exports['show']=function(_0x2f608e,_0x407dc2){var _0x16a43a={'raw':![],'where':{'id':_0x2f608e['params']['id']},'include':[{'model':db[_0xd186('0x54')],'as':_0xd186('0x3e')}]},_0x50f2bd={};_0x50f2bd[_0xd186('0x41')]=_[_0xd186('0x43')](db['WhatsappAccount'][_0xd186('0x55')]);_0x50f2bd[_0xd186('0x42')]=_[_0xd186('0x43')](_0x2f608e[_0xd186('0x42')]);_0x50f2bd['filters']=_[_0xd186('0x56')](_0x50f2bd[_0xd186('0x41')],_0x50f2bd[_0xd186('0x42')]);_0x16a43a[_0xd186('0x45')]=_['intersection'](_0x50f2bd[_0xd186('0x41')],qs[_0xd186('0x46')](_0x2f608e['query'][_0xd186('0x46')]));_0x16a43a[_0xd186('0x45')]=_0x16a43a[_0xd186('0x45')][_0xd186('0x57')]?_0x16a43a['attributes']:_0x50f2bd[_0xd186('0x41')];if(_0x2f608e[_0xd186('0x42')][_0xd186('0x58')]){_0x16a43a[_0xd186('0x51')]=[{'all':!![]}];}_0x16a43a=_['merge']({},_0x16a43a,_0x2f608e[_0xd186('0x50')]);return db[_0xd186('0x59')]['find'](_0x16a43a)[_0xd186('0x20')](handleEntityNotFound(_0x407dc2,null))[_0xd186('0x20')](respondWithResult(_0x407dc2,null))['catch'](handleError(_0x407dc2,null));};exports[_0xd186('0x5a')]=function(_0x34e3c3,_0x58aa91){return db[_0xd186('0x59')][_0xd186('0x5a')](_0x34e3c3[_0xd186('0x5b')],{})[_0xd186('0x20')](function(_0x53d508){var _0x71211=_0x34e3c3[_0xd186('0x5c')][_0xd186('0x38')]({'plain':!![]});if(!_0x71211)throw new Error(_0xd186('0x5d'));if(_0x71211[_0xd186('0x5e')]===_0xd186('0x5c')){var _0x16171a=_0x53d508[_0xd186('0x38')]({'plain':!![]});var _0x504464=_0xd186('0x39');return db['UserProfileSection'][_0xd186('0x5f')]({'where':{'name':_0x504464,'userProfileId':_0x71211[_0xd186('0x60')]},'raw':!![]})[_0xd186('0x20')](function(_0x1413d8){if(_0x1413d8&&_0x1413d8[_0xd186('0x61')]===0x0){return db[_0xd186('0x3a')][_0xd186('0x5a')]({'name':_0x16171a['name'],'resourceId':_0x16171a['id'],'type':_0x1413d8[_0xd186('0x3c')],'sectionId':_0x1413d8['id']},{})['then'](function(){return _0x53d508;});}else{return _0x53d508;}})[_0xd186('0x28')](function(_0x1aabe){logger[_0xd186('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1aabe);throw _0x1aabe;});}return _0x53d508;})[_0xd186('0x20')](respondWithResult(_0x58aa91,0xc9))[_0xd186('0x28')](handleError(_0x58aa91,null));};exports['update']=function(_0xf77182,_0x44b864){if(_0xf77182[_0xd186('0x5b')]['id']){delete _0xf77182[_0xd186('0x5b')]['id'];}return db[_0xd186('0x59')][_0xd186('0x5f')]({'where':{'id':_0xf77182[_0xd186('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0xd186('0x3e')}]})[_0xd186('0x20')](handleEntityNotFound(_0x44b864,null))[_0xd186('0x20')](saveUpdates(_0xf77182[_0xd186('0x5b')],null))['then'](respondWithResult(_0x44b864,null))[_0xd186('0x28')](handleError(_0x44b864,null));};exports[_0xd186('0x37')]=function(_0x431fe1,_0x43948b){return db[_0xd186('0x59')]['find']({'where':{'id':_0x431fe1['params']['id']}})[_0xd186('0x20')](handleEntityNotFound(_0x43948b,null))[_0xd186('0x20')](removeEntity(_0x43948b,null))[_0xd186('0x28')](handleError(_0x43948b,null));};exports[_0xd186('0x63')]=function(_0x4a1c20,_0x411154){return db[_0xd186('0x59')][_0xd186('0x63')]()[_0xd186('0x20')](respondWithResult(_0x411154,null))[_0xd186('0x28')](handleError(_0x411154,null));};exports[_0xd186('0x64')]=function(_0x20c7c8,_0x3d4077,_0x1c221d){if(_0x20c7c8[_0xd186('0x5b')]['id']){delete _0x20c7c8[_0xd186('0x5b')]['id'];}return db[_0xd186('0x59')][_0xd186('0x5f')]({'where':{'id':_0x20c7c8[_0xd186('0x62')]['id']}})[_0xd186('0x20')](handleEntityNotFound(_0x3d4077,null))[_0xd186('0x20')](function(_0x45fe78){if(_0x45fe78){_0x20c7c8['body'][_0xd186('0x65')]=_0x45fe78['id'];return db['Disposition'][_0xd186('0x5a')](_0x20c7c8[_0xd186('0x5b')]);}})[_0xd186('0x20')](respondWithResult(_0x3d4077,null))[_0xd186('0x28')](handleError(_0x3d4077,null));};exports[_0xd186('0x66')]=function(_0x444fcf,_0x2cf1de,_0x51ec43){var _0x2cdeb3={'raw':![],'where':{}};var _0x443654={};var _0x2f8794={'count':0x0,'rows':[]};return db[_0xd186('0x59')][_0xd186('0x67')]({'where':{'id':_0x444fcf[_0xd186('0x62')]['id']}})['then'](handleEntityNotFound(_0x2cf1de,null))[_0xd186('0x20')](function(_0x45b811){if(_0x45b811){_0x443654[_0xd186('0x41')]=_['keys'](db[_0xd186('0x68')]['rawAttributes']);_0x443654[_0xd186('0x42')]=_['keys'](_0x444fcf[_0xd186('0x42')]);_0x443654['filters']=_[_0xd186('0x56')](_0x443654[_0xd186('0x41')],_0x443654[_0xd186('0x42')]);_0x2cdeb3[_0xd186('0x45')]=_[_0xd186('0x56')](_0x443654[_0xd186('0x41')],qs[_0xd186('0x46')](_0x444fcf[_0xd186('0x42')][_0xd186('0x46')]));_0x2cdeb3[_0xd186('0x45')]=_0x2cdeb3[_0xd186('0x45')][_0xd186('0x57')]?_0x2cdeb3[_0xd186('0x45')]:_0x443654[_0xd186('0x41')];if(!_0x444fcf['query'][_0xd186('0x69')]('nolimit')){_0x2cdeb3['limit']=qs['limit'](_0x444fcf['query']['limit']);_0x2cdeb3[_0xd186('0x2d')]=qs[_0xd186('0x2d')](_0x444fcf[_0xd186('0x42')][_0xd186('0x2d')]);}_0x2cdeb3[_0xd186('0x48')]=qs[_0xd186('0x49')](_0x444fcf[_0xd186('0x42')][_0xd186('0x49')]);_0x2cdeb3[_0xd186('0x4a')]=qs['filters'](_['pick'](_0x444fcf[_0xd186('0x42')],_0x443654[_0xd186('0x44')]));_0x2cdeb3['where'][_0xd186('0x65')]=_0x45b811['id'];if(_0x444fcf[_0xd186('0x42')][_0xd186('0x4e')]){_0x2cdeb3[_0xd186('0x4a')]=_[_0xd186('0x4f')](_0x2cdeb3[_0xd186('0x4a')],{'$or':_[_0xd186('0x3f')](_0x2cdeb3['attributes'],function(_0xc6ca76){var _0x50a881={};_0x50a881[_0xc6ca76]={'$like':'%'+_0x444fcf['query'][_0xd186('0x4e')]+'%'};return _0x50a881;})});}_0x2cdeb3=_[_0xd186('0x4f')]({},_0x2cdeb3,_0x444fcf[_0xd186('0x50')]);return db[_0xd186('0x68')][_0xd186('0x30')]({'where':_0x2cdeb3[_0xd186('0x4a')]})[_0xd186('0x20')](function(_0x85f32f){_0x2f8794[_0xd186('0x30')]=_0x85f32f;if(_0x444fcf[_0xd186('0x42')][_0xd186('0x58')]){_0x2cdeb3[_0xd186('0x51')]=[{'all':!![]}];}return db[_0xd186('0x68')]['findAll'](_0x2cdeb3);})[_0xd186('0x20')](function(_0x37f962){_0x2f8794[_0xd186('0x53')]=_0x37f962;return _0x2f8794;});}})['then'](respondWithFilteredResult(_0x2cf1de,_0x2cdeb3))[_0xd186('0x28')](handleError(_0x2cf1de,null));};exports['removeDispositions']=function(_0x543e75,_0x55e30d,_0x161fb4){return db[_0xd186('0x59')]['find']({'where':{'id':_0x543e75[_0xd186('0x62')]['id']}})['then'](handleEntityNotFound(_0x55e30d,null))[_0xd186('0x20')](function(_0x2b9cbd){if(_0x2b9cbd){return _0x2b9cbd[_0xd186('0x6a')](_0x543e75[_0xd186('0x42')][_0xd186('0x6b')]);}})[_0xd186('0x20')](respondWithStatusCode(_0x55e30d,null))['catch'](handleError(_0x55e30d,null));};exports[_0xd186('0x6c')]=function(_0x1ba50e,_0x66d476,_0x34c587){if(_0x1ba50e[_0xd186('0x5b')]['id']){delete _0x1ba50e[_0xd186('0x5b')]['id'];}return db[_0xd186('0x59')][_0xd186('0x5f')]({'where':{'id':_0x1ba50e[_0xd186('0x62')]['id']}})['then'](handleEntityNotFound(_0x66d476,null))[_0xd186('0x20')](function(_0x33c80f){if(_0x33c80f){_0x1ba50e[_0xd186('0x5b')][_0xd186('0x65')]=_0x33c80f['id'];return db[_0xd186('0x6d')][_0xd186('0x5a')](_0x1ba50e[_0xd186('0x5b')]);}})['then'](respondWithResult(_0x66d476,null))['catch'](handleError(_0x66d476,null));};exports[_0xd186('0x6e')]=function(_0x5abd1b,_0x531878,_0x5b188b){var _0x2b5f3d={'raw':![],'where':{}};var _0x1a6980={};var _0x446b4e={'count':0x0,'rows':[]};return db[_0xd186('0x59')][_0xd186('0x67')]({'where':{'id':_0x5abd1b[_0xd186('0x62')]['id']}})['then'](handleEntityNotFound(_0x531878,null))[_0xd186('0x20')](function(_0x745254){if(_0x745254){_0x1a6980[_0xd186('0x41')]=_[_0xd186('0x43')](db[_0xd186('0x6d')][_0xd186('0x55')]);_0x1a6980[_0xd186('0x42')]=_['keys'](_0x5abd1b[_0xd186('0x42')]);_0x1a6980[_0xd186('0x44')]=_[_0xd186('0x56')](_0x1a6980[_0xd186('0x41')],_0x1a6980[_0xd186('0x42')]);_0x2b5f3d['attributes']=_[_0xd186('0x56')](_0x1a6980['model'],qs['fields'](_0x5abd1b[_0xd186('0x42')]['fields']));_0x2b5f3d[_0xd186('0x45')]=_0x2b5f3d[_0xd186('0x45')][_0xd186('0x57')]?_0x2b5f3d[_0xd186('0x45')]:_0x1a6980['model'];if(!_0x5abd1b[_0xd186('0x42')][_0xd186('0x69')](_0xd186('0x47'))){_0x2b5f3d[_0xd186('0x2f')]=qs[_0xd186('0x2f')](_0x5abd1b[_0xd186('0x42')][_0xd186('0x2f')]);_0x2b5f3d[_0xd186('0x2d')]=qs[_0xd186('0x2d')](_0x5abd1b[_0xd186('0x42')][_0xd186('0x2d')]);}_0x2b5f3d[_0xd186('0x48')]=qs[_0xd186('0x49')](_0x5abd1b['query']['sort']);_0x2b5f3d[_0xd186('0x4a')]=qs[_0xd186('0x44')](_[_0xd186('0x4b')](_0x5abd1b[_0xd186('0x42')],_0x1a6980[_0xd186('0x44')]));_0x2b5f3d[_0xd186('0x4a')][_0xd186('0x65')]=_0x745254['id'];if(_0x5abd1b['query'][_0xd186('0x4e')]){_0x2b5f3d['where']=_[_0xd186('0x4f')](_0x2b5f3d['where'],{'$or':_[_0xd186('0x3f')](_0x2b5f3d[_0xd186('0x45')],function(_0x36d3c6){var _0x1c34d8={};_0x1c34d8[_0x36d3c6]={'$like':'%'+_0x5abd1b['query'][_0xd186('0x4e')]+'%'};return _0x1c34d8;})});}_0x2b5f3d=_[_0xd186('0x4f')]({},_0x2b5f3d,_0x5abd1b[_0xd186('0x50')]);return db[_0xd186('0x6d')]['count']({'where':_0x2b5f3d[_0xd186('0x4a')]})['then'](function(_0x2356eb){_0x446b4e['count']=_0x2356eb;if(_0x5abd1b['query'][_0xd186('0x58')]){_0x2b5f3d['include']=[{'all':!![]}];}return db[_0xd186('0x6d')][_0xd186('0x52')](_0x2b5f3d);})[_0xd186('0x20')](function(_0x4dd0cd){_0x446b4e[_0xd186('0x53')]=_0x4dd0cd;return _0x446b4e;});}})[_0xd186('0x20')](respondWithFilteredResult(_0x531878,_0x2b5f3d))['catch'](handleError(_0x531878,null));};exports[_0xd186('0x6f')]=function(_0x11a185,_0x111e0b,_0x27b3a2){return db[_0xd186('0x59')][_0xd186('0x5f')]({'where':{'id':_0x11a185[_0xd186('0x62')]['id']}})[_0xd186('0x20')](handleEntityNotFound(_0x111e0b,null))[_0xd186('0x20')](function(_0x2732c6){if(_0x2732c6){return _0x2732c6['removeAnswers'](_0x11a185[_0xd186('0x42')][_0xd186('0x6b')]);}})[_0xd186('0x20')](respondWithStatusCode(_0x111e0b,null))['catch'](handleError(_0x111e0b,null));};exports[_0xd186('0x70')]=function(_0x273be1,_0x406356,_0x5b76f3){return db[_0xd186('0x59')][_0xd186('0x5f')]({'where':{'id':_0x273be1['params']['id']}})[_0xd186('0x20')](handleEntityNotFound(_0x406356,null))[_0xd186('0x20')](function(_0x5c873a){if(_0x5c873a){return _0x5c873a[_0xd186('0x70')](_0x273be1['body']['ids'],_[_0xd186('0x71')](_0x273be1[_0xd186('0x5b')],[_0xd186('0x6b'),'id'])||{})[_0xd186('0x72')](function(_0x5e8a8d){for(var _0xb2c0d7=0x0;_0xb2c0d7<_0x273be1['body'][_0xd186('0x6b')][_0xd186('0x57')];_0xb2c0d7+=0x1){socket[_0xd186('0x73')](_0xd186('0x74'),{'UserId':Number(_0x273be1['body'][_0xd186('0x6b')][_0xb2c0d7]),'WhatsappAccountId':Number(_0x273be1[_0xd186('0x62')]['id'])});}return _0x5e8a8d;});}})['then'](respondWithResult(_0x406356,null))[_0xd186('0x28')](handleError(_0x406356,null));};exports[_0xd186('0x75')]=function(_0x184703,_0x17dd84,_0x2c0a7b){return db[_0xd186('0x59')][_0xd186('0x5f')]({'where':{'id':_0x184703['params']['id']}})[_0xd186('0x20')](handleEntityNotFound(_0x17dd84,null))[_0xd186('0x20')](function(_0x9c9f0c){if(_0x9c9f0c){return _0x9c9f0c[_0xd186('0x75')](_0x184703[_0xd186('0x42')][_0xd186('0x6b')])[_0xd186('0x20')](function(){if(_['isArray'](_0x184703[_0xd186('0x42')][_0xd186('0x6b')])){for(var _0x88784b=0x0;_0x88784b<_0x184703[_0xd186('0x42')][_0xd186('0x6b')][_0xd186('0x57')];_0x88784b+=0x1){socket[_0xd186('0x73')](_0xd186('0x76'),{'UserId':Number(_0x184703[_0xd186('0x42')]['ids'][_0x88784b]),'WhatsappAccountId':Number(_0x184703[_0xd186('0x62')]['id'])});}}else{socket['emit'](_0xd186('0x76'),{'UserId':Number(_0x184703['query']['ids']),'WhatsappAccountId':Number(_0x184703[_0xd186('0x62')]['id'])});}});}})[_0xd186('0x20')](respondWithStatusCode(_0x17dd84,null))[_0xd186('0x28')](handleError(_0x17dd84,null));};exports['getAgents']=function(_0x4d3f77,_0x129f81,_0x20d66b){var _0x48b5ed={};var _0x2cea74={};var _0x21f422;var _0x4feff2;return db['WhatsappAccount'][_0xd186('0x67')]({'where':{'id':_0x4d3f77['params']['id']}})['then'](handleEntityNotFound(_0x129f81,null))['then'](function(_0x15115f){if(_0x15115f){_0x21f422=_0x15115f;_0x2cea74[_0xd186('0x41')]=_['keys'](db[_0xd186('0x77')][_0xd186('0x55')]);_0x2cea74[_0xd186('0x42')]=_[_0xd186('0x43')](_0x4d3f77['query']);_0x2cea74[_0xd186('0x44')]=_[_0xd186('0x56')](_0x2cea74['model'],_0x2cea74['query']);_0x48b5ed[_0xd186('0x45')]=_[_0xd186('0x56')](_0x2cea74[_0xd186('0x41')],qs[_0xd186('0x46')](_0x4d3f77[_0xd186('0x42')]['fields']));_0x48b5ed[_0xd186('0x45')]=_0x48b5ed[_0xd186('0x45')]['length']?_0x48b5ed[_0xd186('0x45')]:_0x2cea74['model'];_0x48b5ed['order']=qs[_0xd186('0x49')](_0x4d3f77[_0xd186('0x42')]['sort']);_0x48b5ed[_0xd186('0x4a')]=qs['filters'](_[_0xd186('0x4b')](_0x4d3f77['query'],_0x2cea74[_0xd186('0x44')]));if(_0x4d3f77[_0xd186('0x42')][_0xd186('0x4e')]){_0x48b5ed[_0xd186('0x4a')]=_['merge'](_0x48b5ed[_0xd186('0x4a')],{'$or':_[_0xd186('0x3f')](_0x48b5ed[_0xd186('0x45')],function(_0x23f910){var _0x1ccbff={};_0x1ccbff[_0x23f910]={'$like':'%'+_0x4d3f77['query'][_0xd186('0x4e')]+'%'};return _0x1ccbff;})});}_0x48b5ed=_[_0xd186('0x4f')]({},_0x48b5ed,_0x4d3f77[_0xd186('0x50')]);return _0x21f422[_0xd186('0x78')](_0x48b5ed);}})['then'](function(_0x5e79eb){if(_0x5e79eb){_0x4feff2=_0x5e79eb[_0xd186('0x57')];if(!_0x4d3f77[_0xd186('0x42')][_0xd186('0x69')]('nolimit')){_0x48b5ed[_0xd186('0x2f')]=qs[_0xd186('0x2f')](_0x4d3f77[_0xd186('0x42')][_0xd186('0x2f')]);_0x48b5ed[_0xd186('0x2d')]=qs[_0xd186('0x2d')](_0x4d3f77[_0xd186('0x42')]['offset']);}return _0x21f422[_0xd186('0x78')](_0x48b5ed);}})[_0xd186('0x20')](function(_0x3b4b7e){if(_0x3b4b7e){return _0x3b4b7e?{'count':_0x4feff2,'rows':_0x3b4b7e}:null;}})[_0xd186('0x20')](respondWithResult(_0x129f81,null))[_0xd186('0x28')](handleError(_0x129f81,null));};exports[_0xd186('0x79')]=function(_0x444661,_0x3f7b6b,_0x5c9329){return db['WhatsappAccount'][_0xd186('0x67')]({'where':{'id':_0x444661['params']['id']}})[_0xd186('0x20')](handleEntityNotFound(_0x3f7b6b,null))[_0xd186('0x20')](function(_0x33c593){if(_0x33c593){return db['sequelize'][_0xd186('0x7a')](function(_0x4a2d05){return db['WhatsappApplication'][_0xd186('0x37')]({'where':{'WhatsappAccountId':_0x444661[_0xd186('0x62')]['id']},'transaction':_0x4a2d05})[_0xd186('0x20')](function(_0x4d00e9){var _0x2a8c26=_[_0xd186('0x3f')](_0x444661[_0xd186('0x5b')],function(_0x130262){_0x130262[_0xd186('0x65')]=_0x444661['params']['id'];return _0x130262;});return db[_0xd186('0x7b')]['bulkCreate'](_0x2a8c26,{'transaction':_0x4a2d05});});})[_0xd186('0x20')](function(){return db[_0xd186('0x7b')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x444661[_0xd186('0x62')]['id']},'order':_0xd186('0x7c')});});}})['then'](respondWithResult(_0x3f7b6b,null))[_0xd186('0x28')](handleError(_0x3f7b6b,null));};exports['getApplications']=function(_0x52d6f4,_0x1dbc79,_0x23811d){var _0x59eb85={};var _0x682ab2={};var _0xefe51f;var _0x599f65;return db[_0xd186('0x59')][_0xd186('0x67')]({'where':{'id':_0x52d6f4[_0xd186('0x62')]['id']}})[_0xd186('0x20')](handleEntityNotFound(_0x1dbc79,null))[_0xd186('0x20')](function(_0x3b5604){if(_0x3b5604){_0xefe51f=_0x3b5604;_0x682ab2['model']=_['keys'](db[_0xd186('0x7b')][_0xd186('0x55')]);_0x682ab2[_0xd186('0x42')]=_[_0xd186('0x43')](_0x52d6f4[_0xd186('0x42')]);_0x682ab2[_0xd186('0x44')]=_[_0xd186('0x56')](_0x682ab2[_0xd186('0x41')],_0x682ab2[_0xd186('0x42')]);_0x59eb85[_0xd186('0x45')]=_[_0xd186('0x56')](_0x682ab2[_0xd186('0x41')],qs['fields'](_0x52d6f4[_0xd186('0x42')][_0xd186('0x46')]));_0x59eb85[_0xd186('0x45')]=_0x59eb85[_0xd186('0x45')][_0xd186('0x57')]?_0x59eb85[_0xd186('0x45')]:_0x682ab2['model'];_0x59eb85[_0xd186('0x48')]=qs[_0xd186('0x49')](_0x52d6f4[_0xd186('0x42')]['sort']);_0x59eb85[_0xd186('0x4a')]=qs[_0xd186('0x44')](_[_0xd186('0x4b')](_0x52d6f4[_0xd186('0x42')],_0x682ab2['filters']));if(_0x52d6f4[_0xd186('0x42')][_0xd186('0x4e')]){_0x59eb85[_0xd186('0x4a')]=_[_0xd186('0x4f')](_0x59eb85[_0xd186('0x4a')],{'$or':_[_0xd186('0x3f')](_0x59eb85[_0xd186('0x45')],function(_0x2f3333){var _0x4ff234={};_0x4ff234[_0x2f3333]={'$like':'%'+_0x52d6f4[_0xd186('0x42')][_0xd186('0x4e')]+'%'};return _0x4ff234;})});}_0x59eb85=_[_0xd186('0x4f')]({},_0x59eb85,_0x52d6f4[_0xd186('0x50')]);return _0xefe51f[_0xd186('0x7d')](_0x59eb85);}})[_0xd186('0x20')](function(_0x406ba5){if(_0x406ba5){_0x599f65=_0x406ba5[_0xd186('0x57')];if(!_0x52d6f4[_0xd186('0x42')][_0xd186('0x69')](_0xd186('0x47'))){_0x59eb85[_0xd186('0x2f')]=qs['limit'](_0x52d6f4[_0xd186('0x42')][_0xd186('0x2f')]);_0x59eb85[_0xd186('0x2d')]=qs[_0xd186('0x2d')](_0x52d6f4[_0xd186('0x42')][_0xd186('0x2d')]);}return _0xefe51f[_0xd186('0x7d')](_0x59eb85);}})[_0xd186('0x20')](function(_0x5821ff){if(_0x5821ff){return _0x5821ff?{'count':_0x599f65,'rows':_0x5821ff}:null;}})[_0xd186('0x20')](respondWithResult(_0x1dbc79,null))[_0xd186('0x28')](handleError(_0x1dbc79,null));};exports[_0xd186('0x7e')]=function(_0x132e39,_0x2d0d0c,_0xb3fb3b){var _0x2cdbe1={'channel':'whatsapp'};var _0x585f36=[];var _0x2b25b6=[];var _0x2881b1={};return db[_0xd186('0x59')][_0xd186('0x5f')]({'where':{'id':_0x132e39[_0xd186('0x62')]['id']},'include':[{'model':db[_0xd186('0x7b')],'as':_0xd186('0x7f')}]})[_0xd186('0x20')](handleEntityNotFound(_0x2d0d0c,null))['then'](function(_0x5da1bd){_0x2cdbe1['account']=_0x5da1bd;_0x2cdbe1[_0xd186('0x80')]=_[_0xd186('0x81')](_0x5da1bd[_0xd186('0x7f')],['priority'],[_0xd186('0x82')]);if(_0x2cdbe1[_0xd186('0x83')][_0xd186('0x7f')]){delete _0x2cdbe1[_0xd186('0x83')][_0xd186('0x7f')];}return db['CmContact'][_0xd186('0x63')]();})[_0xd186('0x20')](function(_0x494b8d){if(!_0x494b8d){throw new db['Sequelize'][(_0xd186('0x84'))](_0xd186('0x85'));}_0x585f36=_[_0xd186('0x86')](_[_0xd186('0x43')](_0x494b8d),[_0xd186('0x87'),_0xd186('0x88')]);_0x2b25b6=_[_0xd186('0x86')](_[_0xd186('0x43')](_0x494b8d),[_0xd186('0x87'),_0xd186('0x88'),_0xd186('0x89'),_0xd186('0x8a')]);_0x2cdbe1['body']={'mapKey':_0xd186('0x8b')};if(_0x2cdbe1[_0xd186('0x83')]['type']&&_0x2cdbe1['account'][_0xd186('0x4c')]==='twilio'){_0x2cdbe1[_0xd186('0x5b')][_0xd186('0x8c')]=_0x132e39[_0xd186('0x5b')]['From'][_0xd186('0x8d')](_0xd186('0x8e'),'');_0x2cdbe1[_0xd186('0x5b')][_0xd186('0x5b')]=_0x132e39[_0xd186('0x5b')]['Body'];_0x2cdbe1[_0xd186('0x5b')][_0xd186('0x8f')]=_0x132e39[_0xd186('0x5b')][_0xd186('0x90')];}if(_0x2cdbe1[_0xd186('0x5b')]['id']){delete _0x2cdbe1[_0xd186('0x5b')]['id'];}if(_[_0xd186('0x91')](_0x2cdbe1['body'][_0xd186('0x8c')])){throw new db[(_0xd186('0x92'))]['ValidationError'](_0xd186('0x93'));}if(_['isNil'](_0x2cdbe1[_0xd186('0x5b')]['body'])||_0x2cdbe1['body'][_0xd186('0x5b')]===''){throw new db[(_0xd186('0x92'))]['ValidationError'](_0xd186('0x94'));}if(_[_0xd186('0x91')](_0x2cdbe1['body'][_0xd186('0x95')])){throw new db['Sequelize'][(_0xd186('0x84'))](_0xd186('0x96')+_0x2b25b6);}if(!_[_0xd186('0x97')](_0x2b25b6,_0x2cdbe1[_0xd186('0x5b')][_0xd186('0x95')])){throw new db['Sequelize'][(_0xd186('0x84'))](_0xd186('0x98')+_0x2b25b6);}_0x2881b1[_0x2cdbe1[_0xd186('0x5b')][_0xd186('0x95')]]=_0x2cdbe1[_0xd186('0x5b')]['from'];return db['CmList'][_0xd186('0x5f')]({'where':{'id':_0x2cdbe1['account'][_0xd186('0x8a')]},'include':[{'model':db[_0xd186('0x99')],'as':_0xd186('0x9a'),'where':_0x2881b1,'limit':0x1,'order':[[_0xd186('0x88'),_0xd186('0x9b')]]}]});})[_0xd186('0x20')](handleEntityNotFound(_0x2d0d0c,null))['then'](function(_0x116594){if(_0x116594){_0x2cdbe1['list']=_[_0xd186('0x71')](_0x116594,['Contacts']);if(_0x116594[_0xd186('0x9a')][_0xd186('0x57')]){return _0x116594['Contacts'][0x0];}var _0xb5bcf3=_['defaults'](_0x2cdbe1[_0xd186('0x5b')],{'firstName':_0x2cdbe1[_0xd186('0x5b')]['from'],'ListId':_0x116594['id']});_0xb5bcf3[_0x2cdbe1['body'][_0xd186('0x95')]]=_0x2cdbe1[_0xd186('0x5b')]['from'];return db[_0xd186('0x99')][_0xd186('0x5a')](_0xb5bcf3,{'fields':_0x585f36,'raw':!![]});}})[_0xd186('0x20')](handleEntityNotFound(_0x2d0d0c,null))['then'](function(_0x292898){if(_0x292898){_0x2cdbe1[_0xd186('0x9c')]=_0x292898;var _0x11c2f1={'ContactId':_0x292898['id'],'phone':_0x2cdbe1[_0xd186('0x5b')]['from'],'WhatsappAccountId':_0x132e39['params']['id']};var _0x21d75a={'ContactId':_0x292898['id'],'WhatsappAccountId':_0x132e39[_0xd186('0x62')]['id'],'closed':![]};return db[_0xd186('0x9d')][_0xd186('0x5f')]({'where':_0x21d75a})['then'](function(_0x2c1811){if(_0x2c1811){return[_0x2c1811,![]];}return db[_0xd186('0x9d')][_0xd186('0x5a')](_0x11c2f1)['then'](function(_0x29b076){return[_0x29b076,!![]];});});}})[_0xd186('0x72')](function(_0x2753a9,_0x129b67){_0x2cdbe1[_0xd186('0x9e')]=_0x2753a9['get']({'plain':!![]});_0x2cdbe1[_0xd186('0x9e')]['created']=![];if(_0x129b67){if(_0x2cdbe1['account'][_0xd186('0x9f')]){_0x2cdbe1[_0xd186('0x80')][_0xd186('0xa0')]({'id':0x0,'priority':_0x2cdbe1[_0xd186('0x80')][_0xd186('0x57')]+0x1,'app':_0xd186('0xa1'),'appdata':_0xd186('0xa2'),'interval':'*,*,*,*'});}_0x2cdbe1[_0xd186('0x9e')][_0xd186('0xa3')]=!![];}return db[_0xd186('0xa4')][_0xd186('0x5a')]({'phone':_0x2cdbe1[_0xd186('0x5b')]['from'],'messageId':_0x2cdbe1['body']['messageId'],'body':_0x2cdbe1[_0xd186('0x5b')]['body'],'WhatsappAccountId':_0x132e39[_0xd186('0x62')]['id'],'WhatsappInteractionId':_0x2753a9['id'],'direction':'in','ContactId':_0x2753a9[_0xd186('0xa5')],'AttachmentId':_0x2cdbe1[_0xd186('0x5b')][_0xd186('0xa6')]});})['then'](function(_0x569f6){_0x2cdbe1[_0xd186('0x27')]=_0x569f6;if(_0x2cdbe1[_0xd186('0x9e')]['UserId']){return db[_0xd186('0x77')][_0xd186('0x5f')]({'attributes':['id',_0xd186('0x3c')],'where':{'id':_0x2cdbe1[_0xd186('0x9e')][_0xd186('0xa7')]}})[_0xd186('0x20')](function(_0x5e1f6e){if(_0x5e1f6e){_0x2cdbe1[_0xd186('0x80')][_0xd186('0xa8')]({'id':0x0,'priority':0x0,'app':_0xd186('0xa9'),'appdata':_0x5e1f6e[_0xd186('0x3c')]+','+(_0x2cdbe1[_0xd186('0x83')][_0xd186('0xaa')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd186('0xab'),'startRouting',_0x2cdbe1);});}return respondWithRpcPromise(_0xd186('0xab'),_0xd186('0xac'),_0x2cdbe1);})[_0xd186('0x20')](function(_0x18eddc){if(_0x18eddc){var _0x374deb=0xc8;var _0x5d57c0=_0xd186('0xad');logger['info'](_0xd186('0x24'),_0x5d57c0,_0x374deb,_0xd186('0xae'));logger['debug'](_0xd186('0xaf'),_0x5d57c0,_0x374deb,_0xd186('0xae'),JSON['stringify'](_0x18eddc));if(_0x2cdbe1[_0xd186('0x83')][_0xd186('0x4c')]==='twilio'){return _0x2d0d0c['status'](_0x374deb)['set']('Content-Type',_0xd186('0xb0'))['send']('\x0a');}else{return _0x2d0d0c['status'](_0x374deb)[_0xd186('0x2c')](_0x18eddc);}}})[_0xd186('0x28')](handleError(_0x2d0d0c,null));};exports[_0xd186('0xb1')]=function(_0x482353,_0x5263b7,_0x118afd){var _0x49a93f,_0x4cbd67,_0xede14f;if(_[_0xd186('0x91')](_0x482353[_0xd186('0x5b')]['body'])||_0x482353[_0xd186('0x5b')][_0xd186('0x5b')]===''){throw new db[(_0xd186('0x92'))][(_0xd186('0x84'))](_0xd186('0x94'));}if(_['isNil'](_0x482353[_0xd186('0x5b')]['to'])){throw new db[(_0xd186('0x92'))][(_0xd186('0x84'))](_0xd186('0xb2'));}_0x49a93f=_0x482353[_0xd186('0x5b')]['to'];return db[_0xd186('0x59')][_0xd186('0x5f')]({'where':{'id':_0x482353[_0xd186('0x62')]['id']},'include':[{'model':db[_0xd186('0xb3')],'as':'List','include':[{'model':db[_0xd186('0x99')],'as':_0xd186('0x9a'),'where':{'mobile':_0x49a93f},'limit':0x1,'order':[[_0xd186('0x88'),_0xd186('0x9b')]]}]}]})[_0xd186('0x20')](handleEntityNotFound(_0x5263b7,null))[_0xd186('0x20')](function(_0x20309a){if(_0x20309a&&_0x20309a[_0xd186('0xb4')]){_0x4cbd67=_0x20309a[_0xd186('0x38')]({'plain':!![]});if(_0x4cbd67[_0xd186('0xb4')]&&_0x4cbd67['List']['Contacts'][_0xd186('0x57')]){return _0x4cbd67[_0xd186('0xb4')]['Contacts'][0x0];}return db[_0xd186('0x99')][_0xd186('0x5a')](_[_0xd186('0xb5')](_0x482353[_0xd186('0x5b')],{'firstName':_0x49a93f,'mobile':_0x49a93f,'phone':_0x49a93f,'ListId':_0x4cbd67[_0xd186('0x8a')]}));}})[_0xd186('0x20')](handleEntityNotFound(_0x5263b7,null))[_0xd186('0x20')](function(_0x395d1e){if(_0x395d1e){_0xede14f=_0x395d1e;return db[_0xd186('0x9d')]['find']({'where':{'ContactId':_0xede14f['id'],'closed':![],'WhatsappAccountId':_0x4cbd67['id']}})[_0xd186('0x20')](function(_0x74880c){if(_0x74880c){return[_0x74880c,![]];}return db[_0xd186('0x9d')][_0xd186('0x5a')]({'UserId':_0x482353[_0xd186('0x5c')]['id'],'ContactId':_0xede14f['id'],'WhatsappAccountId':_0x4cbd67['id'],'phone':_0x49a93f,'firstMsgDirection':_0xd186('0xb6'),'Messages':[_[_0xd186('0x4f')](_0x482353[_0xd186('0x5b')],{'read':![],'body':_0x482353[_0xd186('0x5b')][_0xd186('0x5b')],'phone':_0x49a93f,'WhatsappAccountId':_0x4cbd67['id'],'UserId':_0x482353[_0xd186('0x5c')]['id'],'ContactId':_0xede14f['id']})]},{'include':[{'model':db[_0xd186('0xa4')],'as':_0xd186('0xb7')}]})[_0xd186('0x20')](function(_0x437ca9){return[_0x437ca9,!![]];});});}})[_0xd186('0x72')](function(_0x1027c5,_0x46f8f2){if(_0x46f8f2){return _0x1027c5;}return db[_0xd186('0xa4')][_0xd186('0x5a')](_['merge'](_0x482353[_0xd186('0x5b')],{'read':![],'body':_0x482353[_0xd186('0x5b')][_0xd186('0x5b')],'phone':_0x49a93f,'WhatsappAccountId':_0x4cbd67['id'],'WhatsappInteractionId':_0x1027c5['id'],'UserId':_0x482353[_0xd186('0x5c')]['id'],'ContactId':_0xede14f['id']}))[_0xd186('0x20')](function(_0x3ec537){_0x1027c5['dataValues'][_0xd186('0xb7')]=[];_0x1027c5['dataValues']['Messages']['push'](_0x3ec537[_0xd186('0xb8')]);return _0x1027c5;});})['then'](respondWithResult(_0x5263b7,null))[_0xd186('0x28')](handleError(_0x5263b7,null));}; \ No newline at end of file +var _0xda8b=['entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','ListId','out','WhatsappMessage','Messages','dataValues','eml-format','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','params','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','WhatsappAccountId','rows','removeDispositions','addAnswer','CannedAnswer','findAll','removeAnswers','ids','addAgents','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','WhatsappApplication','priority','getApplications','notify','whatsapp','applications','orderBy','Applications','account','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','mobile','twilio','from','From','replace','whatsapp:','messageId','MessageSid','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','omit','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage'];(function(_0x408dbb,_0x583003){var _0x35b2db=function(_0x569694){while(--_0x569694){_0x408dbb['push'](_0x408dbb['shift']());}};_0x35b2db(++_0x583003);}(_0xda8b,0x178));var _0xbda8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xda8b[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xbda8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbda8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbda8('0x2'));var moment=require(_0xbda8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbda8('0x4'));var util=require(_0xbda8('0x5'));var path=require(_0xbda8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbda8('0x7'));var fs=require('fs');var fs_extra=require(_0xbda8('0x8'));var _=require('lodash');var squel=require(_0xbda8('0x9'));var crypto=require(_0xbda8('0xa'));var jsforce=require(_0xbda8('0xb'));var deskjs=require(_0xbda8('0xc'));var toCsv=require(_0xbda8('0xd'));var querystring=require(_0xbda8('0xe'));var Papa=require('papaparse');var Redis=require(_0xbda8('0xf'));var authService=require(_0xbda8('0x10'));var qs=require(_0xbda8('0x11'));var as=require(_0xbda8('0x12'));var hardwareService=require(_0xbda8('0x13'));var logger=require(_0xbda8('0x14'))(_0xbda8('0x15'));var utils=require(_0xbda8('0x16'));var config=require(_0xbda8('0x17'));var licenseUtil=require(_0xbda8('0x18'));var db=require(_0xbda8('0x19'))['db'];config[_0xbda8('0x1a')]=_[_0xbda8('0x1b')](config[_0xbda8('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xbda8('0x1c'))(new Redis(config[_0xbda8('0x1a')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xbda8('0x1d'));var client=jayson[_0xbda8('0x1e')][_0xbda8('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x10ed48,_0x2179d4,_0x4da438,_0x3d90d1){return new BPromise(function(_0xefe0a5,_0x2672dc){var _0x45680b=_0x3d90d1||client;return _0x45680b[_0xbda8('0x20')](_0x10ed48,_0x4da438)['then'](function(_0x2405ff){logger[_0xbda8('0x21')](_0xbda8('0x22'),_0x2179d4,_0xbda8('0x23'));logger[_0xbda8('0x24')](_0xbda8('0x25'),_0x2179d4,_0xbda8('0x23'),JSON[_0xbda8('0x26')](_0x2405ff));if(_0x2405ff[_0xbda8('0x27')]){if(_0x2405ff['error'][_0xbda8('0x28')]===0x1f4){logger[_0xbda8('0x27')](_0xbda8('0x22'),_0x2179d4,_0x2405ff[_0xbda8('0x27')][_0xbda8('0x29')]);return _0x2672dc(_0x2405ff[_0xbda8('0x27')][_0xbda8('0x29')]);}logger['error'](_0xbda8('0x22'),_0x2179d4,_0x2405ff[_0xbda8('0x27')][_0xbda8('0x29')]);return _0xefe0a5(_0x2405ff[_0xbda8('0x27')][_0xbda8('0x29')]);}else{logger[_0xbda8('0x21')](_0xbda8('0x22'),_0x2179d4,'request\x20sent');_0xefe0a5(_0x2405ff['result']['message']);}})[_0xbda8('0x2a')](function(_0x22254b){logger[_0xbda8('0x27')](_0xbda8('0x22'),_0x2179d4,_0x22254b);_0x2672dc(_0x22254b);});});}function respondWithStatusCode(_0x58ee02,_0x3b4701){_0x3b4701=_0x3b4701||0xcc;return function(_0x422a63){if(_0x422a63){return _0x58ee02[_0xbda8('0x2b')](_0x3b4701);}return _0x58ee02[_0xbda8('0x2c')](_0x3b4701)[_0xbda8('0x2d')]();};}function respondWithResult(_0x5e805b,_0x4b23f0){_0x4b23f0=_0x4b23f0||0xc8;return function(_0x5b518a){if(_0x5b518a){return _0x5e805b[_0xbda8('0x2c')](_0x4b23f0)[_0xbda8('0x2e')](_0x5b518a);}};}function respondWithFilteredResult(_0x532698,_0x266f3d){return function(_0x167c4b){if(_0x167c4b){var _0x4ceb3d=typeof _0x266f3d[_0xbda8('0x2f')]===_0xbda8('0x30')&&typeof _0x266f3d[_0xbda8('0x31')]==='undefined';var _0x56f115=_0x167c4b[_0xbda8('0x32')];var _0x12de31=_0x4ceb3d?0x0:_0x266f3d['offset'];var _0x5b149b=_0x4ceb3d?_0x167c4b[_0xbda8('0x32')]:_0x266f3d[_0xbda8('0x2f')]+_0x266f3d[_0xbda8('0x31')];var _0x526858;if(_0x5b149b>=_0x56f115){_0x5b149b=_0x56f115;_0x526858=0xc8;}else{_0x526858=0xce;}_0x532698[_0xbda8('0x2c')](_0x526858);return _0x532698[_0xbda8('0x33')](_0xbda8('0x34'),_0x12de31+'-'+_0x5b149b+'/'+_0x56f115)[_0xbda8('0x2e')](_0x167c4b);}return null;};}function patchUpdates(_0x1c2046){return function(_0xe824c6){try{jsonpatch[_0xbda8('0x35')](_0xe824c6,_0x1c2046,!![]);}catch(_0x410f54){return BPromise[_0xbda8('0x36')](_0x410f54);}return _0xe824c6[_0xbda8('0x37')]();};}function saveUpdates(_0x4938f9,_0x4ceff0){return function(_0x5ed818){if(_0x5ed818){return _0x5ed818[_0xbda8('0x38')](_0x4938f9)[_0xbda8('0x39')](function(_0x1a22f1){return _0x1a22f1;});}return null;};}function removeEntity(_0x2bf46d,_0x3123e0){return function(_0x3f5a40){if(_0x3f5a40){return _0x3f5a40[_0xbda8('0x3a')]()[_0xbda8('0x39')](function(){var _0x5b8728=_0x3f5a40[_0xbda8('0x3b')]({'plain':!![]});var _0x17156f=_0xbda8('0x3c');return db[_0xbda8('0x3d')][_0xbda8('0x3a')]({'where':{'type':_0x17156f,'resourceId':_0x5b8728['id']}})[_0xbda8('0x39')](function(){return _0x3f5a40;});})['then'](function(){_0x2bf46d[_0xbda8('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x444c67,_0x194dd4){return function(_0x3219d4){if(!_0x3219d4){_0x444c67[_0xbda8('0x2b')](0x194);}return _0x3219d4;};}function handleError(_0x545a02,_0x40b66e){_0x40b66e=_0x40b66e||0x1f4;return function(_0x332fc9){logger[_0xbda8('0x27')](_0x332fc9[_0xbda8('0x3e')]);if(_0x332fc9[_0xbda8('0x3f')]){delete _0x332fc9[_0xbda8('0x3f')];}_0x545a02[_0xbda8('0x2c')](_0x40b66e)[_0xbda8('0x40')](_0x332fc9);};}exports[_0xbda8('0x41')]=function(_0xd9d9fd,_0x541af7){var _0x10596e={'include':[{'model':db[_0xbda8('0x42')],'as':_0xbda8('0x43')}]},_0x1ea0f7={},_0x5201df={'count':0x0,'rows':[]};var _0x4db0db=_['map'](db[_0xbda8('0x44')][_0xbda8('0x45')],function(_0x2a0b02){return{'name':_0x2a0b02[_0xbda8('0x46')],'type':_0x2a0b02[_0xbda8('0x47')][_0xbda8('0x48')]};});_0x1ea0f7['model']=_[_0xbda8('0x49')](_0x4db0db,_0xbda8('0x3f'));_0x1ea0f7['query']=_[_0xbda8('0x4a')](_0xd9d9fd[_0xbda8('0x4b')]);_0x1ea0f7[_0xbda8('0x4c')]=_['intersection'](_0x1ea0f7[_0xbda8('0x4d')],_0x1ea0f7['query']);_0x10596e[_0xbda8('0x4e')]=_[_0xbda8('0x4f')](_0x1ea0f7[_0xbda8('0x4d')],qs[_0xbda8('0x50')](_0xd9d9fd['query']['fields']));_0x10596e[_0xbda8('0x4e')]=_0x10596e['attributes'][_0xbda8('0x51')]?_0x10596e[_0xbda8('0x4e')]:_0x1ea0f7[_0xbda8('0x4d')];if(!_0xd9d9fd['query']['hasOwnProperty'](_0xbda8('0x52'))){_0x10596e[_0xbda8('0x31')]=qs[_0xbda8('0x31')](_0xd9d9fd[_0xbda8('0x4b')][_0xbda8('0x31')]);_0x10596e[_0xbda8('0x2f')]=qs[_0xbda8('0x2f')](_0xd9d9fd[_0xbda8('0x4b')]['offset']);}_0x10596e[_0xbda8('0x53')]=qs[_0xbda8('0x54')](_0xd9d9fd[_0xbda8('0x4b')][_0xbda8('0x54')]);_0x10596e[_0xbda8('0x55')]=qs[_0xbda8('0x4c')](_[_0xbda8('0x56')](_0xd9d9fd[_0xbda8('0x4b')],_0x1ea0f7['filters']),_0x4db0db);if(_0xd9d9fd[_0xbda8('0x4b')][_0xbda8('0x57')]){_0x10596e[_0xbda8('0x55')]=_['merge'](_0x10596e[_0xbda8('0x55')],{'$or':_[_0xbda8('0x49')](_0x4db0db,function(_0x20e076){if(_0x20e076[_0xbda8('0x47')]!==_0xbda8('0x58')){var _0xbabd3b={};_0xbabd3b[_0x20e076[_0xbda8('0x3f')]]={'$like':'%'+_0xd9d9fd[_0xbda8('0x4b')][_0xbda8('0x57')]+'%'};return _0xbabd3b;}})});}_0x10596e=_[_0xbda8('0x59')]({},_0x10596e,_0xd9d9fd['options']);var _0x2abdb4={'where':_0x10596e[_0xbda8('0x55')]};return db[_0xbda8('0x44')][_0xbda8('0x32')](_0x2abdb4)['then'](function(_0x1d047b){_0x5201df[_0xbda8('0x32')]=_0x1d047b;if(_0xd9d9fd[_0xbda8('0x4b')]['includeAll']){_0x10596e['include']=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x10596e);})[_0xbda8('0x39')](function(_0x2d3ab8){_0x5201df['rows']=_0x2d3ab8;return _0x5201df;})[_0xbda8('0x39')](respondWithFilteredResult(_0x541af7,_0x10596e))[_0xbda8('0x2a')](handleError(_0x541af7,null));};exports['show']=function(_0x21df50,_0x1eb553){var _0x40cc96={'raw':![],'where':{'id':_0x21df50[_0xbda8('0x5a')]['id']},'include':[{'model':db[_0xbda8('0x42')],'as':'mandatoryDispositionPause'}]},_0x329a7b={};_0x329a7b[_0xbda8('0x4d')]=_[_0xbda8('0x4a')](db[_0xbda8('0x44')][_0xbda8('0x45')]);_0x329a7b[_0xbda8('0x4b')]=_[_0xbda8('0x4a')](_0x21df50['query']);_0x329a7b[_0xbda8('0x4c')]=_[_0xbda8('0x4f')](_0x329a7b[_0xbda8('0x4d')],_0x329a7b['query']);_0x40cc96[_0xbda8('0x4e')]=_[_0xbda8('0x4f')](_0x329a7b[_0xbda8('0x4d')],qs['fields'](_0x21df50[_0xbda8('0x4b')][_0xbda8('0x50')]));_0x40cc96[_0xbda8('0x4e')]=_0x40cc96[_0xbda8('0x4e')]['length']?_0x40cc96[_0xbda8('0x4e')]:_0x329a7b[_0xbda8('0x4d')];if(_0x21df50[_0xbda8('0x4b')][_0xbda8('0x5b')]){_0x40cc96[_0xbda8('0x5c')]=[{'all':!![]}];}_0x40cc96=_[_0xbda8('0x59')]({},_0x40cc96,_0x21df50[_0xbda8('0x5d')]);return db[_0xbda8('0x44')][_0xbda8('0x5e')](_0x40cc96)['then'](handleEntityNotFound(_0x1eb553,null))[_0xbda8('0x39')](respondWithResult(_0x1eb553,null))[_0xbda8('0x2a')](handleError(_0x1eb553,null));};exports[_0xbda8('0x5f')]=function(_0x4fdd37,_0x36944c){return db[_0xbda8('0x44')][_0xbda8('0x5f')](_0x4fdd37[_0xbda8('0x60')],{})['then'](function(_0x68f0ce){var _0x9630e2=_0x4fdd37[_0xbda8('0x61')][_0xbda8('0x3b')]({'plain':!![]});if(!_0x9630e2)throw new Error(_0xbda8('0x62'));if(_0x9630e2[_0xbda8('0x63')]==='user'){var _0x57f7ab=_0x68f0ce[_0xbda8('0x3b')]({'plain':!![]});var _0x128552=_0xbda8('0x3c');return db[_0xbda8('0x64')]['find']({'where':{'name':_0x128552,'userProfileId':_0x9630e2['userProfileId']},'raw':!![]})[_0xbda8('0x39')](function(_0x4789f8){if(_0x4789f8&&_0x4789f8['autoAssociation']===0x0){return db[_0xbda8('0x3d')][_0xbda8('0x5f')]({'name':_0x57f7ab[_0xbda8('0x3f')],'resourceId':_0x57f7ab['id'],'type':_0x4789f8['name'],'sectionId':_0x4789f8['id']},{})['then'](function(){return _0x68f0ce;});}else{return _0x68f0ce;}})[_0xbda8('0x2a')](function(_0x161ade){logger['error'](_0xbda8('0x65'),_0x161ade);throw _0x161ade;});}return _0x68f0ce;})[_0xbda8('0x39')](respondWithResult(_0x36944c,0xc9))[_0xbda8('0x2a')](handleError(_0x36944c,null));};exports[_0xbda8('0x38')]=function(_0x2ffb99,_0x423f21){if(_0x2ffb99['body']['id']){delete _0x2ffb99[_0xbda8('0x60')]['id'];}return db[_0xbda8('0x44')][_0xbda8('0x5e')]({'where':{'id':_0x2ffb99['params']['id']},'include':[{'model':db[_0xbda8('0x42')],'as':_0xbda8('0x43')}]})[_0xbda8('0x39')](handleEntityNotFound(_0x423f21,null))[_0xbda8('0x39')](saveUpdates(_0x2ffb99['body'],null))['then'](respondWithResult(_0x423f21,null))['catch'](handleError(_0x423f21,null));};exports[_0xbda8('0x3a')]=function(_0x1f3785,_0x3fdd91){return db[_0xbda8('0x44')]['find']({'where':{'id':_0x1f3785[_0xbda8('0x5a')]['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x3fdd91,null))['then'](removeEntity(_0x3fdd91,null))[_0xbda8('0x2a')](handleError(_0x3fdd91,null));};exports[_0xbda8('0x66')]=function(_0x324bea,_0x4e9f10){return db[_0xbda8('0x44')][_0xbda8('0x66')]()['then'](respondWithResult(_0x4e9f10,null))[_0xbda8('0x2a')](handleError(_0x4e9f10,null));};exports[_0xbda8('0x67')]=function(_0x5381bf,_0x140675,_0x40be1e){if(_0x5381bf[_0xbda8('0x60')]['id']){delete _0x5381bf[_0xbda8('0x60')]['id'];}return db[_0xbda8('0x44')]['find']({'where':{'id':_0x5381bf['params']['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x140675,null))['then'](function(_0x581b80){if(_0x581b80){_0x5381bf['body']['WhatsappAccountId']=_0x581b80['id'];return db[_0xbda8('0x68')][_0xbda8('0x5f')](_0x5381bf[_0xbda8('0x60')]);}})[_0xbda8('0x39')](respondWithResult(_0x140675,null))['catch'](handleError(_0x140675,null));};exports[_0xbda8('0x69')]=function(_0x1f9302,_0x47c982,_0x1af9ca){var _0x27c98b={'raw':![],'where':{}};var _0x3908a5={};var _0x1ad46e={'count':0x0,'rows':[]};return db[_0xbda8('0x44')][_0xbda8('0x6a')]({'where':{'id':_0x1f9302[_0xbda8('0x5a')]['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x47c982,null))['then'](function(_0x55880d){if(_0x55880d){_0x3908a5[_0xbda8('0x4d')]=_[_0xbda8('0x4a')](db[_0xbda8('0x68')][_0xbda8('0x45')]);_0x3908a5[_0xbda8('0x4b')]=_['keys'](_0x1f9302[_0xbda8('0x4b')]);_0x3908a5['filters']=_[_0xbda8('0x4f')](_0x3908a5[_0xbda8('0x4d')],_0x3908a5[_0xbda8('0x4b')]);_0x27c98b['attributes']=_['intersection'](_0x3908a5[_0xbda8('0x4d')],qs[_0xbda8('0x50')](_0x1f9302['query'][_0xbda8('0x50')]));_0x27c98b[_0xbda8('0x4e')]=_0x27c98b[_0xbda8('0x4e')][_0xbda8('0x51')]?_0x27c98b[_0xbda8('0x4e')]:_0x3908a5[_0xbda8('0x4d')];if(!_0x1f9302[_0xbda8('0x4b')][_0xbda8('0x6b')](_0xbda8('0x52'))){_0x27c98b['limit']=qs[_0xbda8('0x31')](_0x1f9302[_0xbda8('0x4b')]['limit']);_0x27c98b[_0xbda8('0x2f')]=qs['offset'](_0x1f9302[_0xbda8('0x4b')][_0xbda8('0x2f')]);}_0x27c98b[_0xbda8('0x53')]=qs[_0xbda8('0x54')](_0x1f9302[_0xbda8('0x4b')]['sort']);_0x27c98b['where']=qs[_0xbda8('0x4c')](_[_0xbda8('0x56')](_0x1f9302[_0xbda8('0x4b')],_0x3908a5[_0xbda8('0x4c')]));_0x27c98b['where'][_0xbda8('0x6c')]=_0x55880d['id'];if(_0x1f9302[_0xbda8('0x4b')]['filter']){_0x27c98b[_0xbda8('0x55')]=_[_0xbda8('0x59')](_0x27c98b[_0xbda8('0x55')],{'$or':_['map'](_0x27c98b[_0xbda8('0x4e')],function(_0x57f179){var _0x41a43d={};_0x41a43d[_0x57f179]={'$like':'%'+_0x1f9302[_0xbda8('0x4b')][_0xbda8('0x57')]+'%'};return _0x41a43d;})});}_0x27c98b=_['merge']({},_0x27c98b,_0x1f9302['options']);return db['Disposition']['count']({'where':_0x27c98b['where']})[_0xbda8('0x39')](function(_0x42bd2a){_0x1ad46e[_0xbda8('0x32')]=_0x42bd2a;if(_0x1f9302['query'][_0xbda8('0x5b')]){_0x27c98b[_0xbda8('0x5c')]=[{'all':!![]}];}return db[_0xbda8('0x68')]['findAll'](_0x27c98b);})['then'](function(_0x426e20){_0x1ad46e[_0xbda8('0x6d')]=_0x426e20;return _0x1ad46e;});}})[_0xbda8('0x39')](respondWithFilteredResult(_0x47c982,_0x27c98b))[_0xbda8('0x2a')](handleError(_0x47c982,null));};exports[_0xbda8('0x6e')]=function(_0x27b33d,_0x39091c,_0xaa5f7a){return db[_0xbda8('0x44')]['find']({'where':{'id':_0x27b33d[_0xbda8('0x5a')]['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x39091c,null))[_0xbda8('0x39')](function(_0x1088f2){if(_0x1088f2){return _0x1088f2[_0xbda8('0x6e')](_0x27b33d[_0xbda8('0x4b')]['ids']);}})[_0xbda8('0x39')](respondWithStatusCode(_0x39091c,null))[_0xbda8('0x2a')](handleError(_0x39091c,null));};exports[_0xbda8('0x6f')]=function(_0x2d8851,_0x3048ec,_0x3e2272){if(_0x2d8851['body']['id']){delete _0x2d8851[_0xbda8('0x60')]['id'];}return db[_0xbda8('0x44')]['find']({'where':{'id':_0x2d8851['params']['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x3048ec,null))[_0xbda8('0x39')](function(_0x2c632d){if(_0x2c632d){_0x2d8851[_0xbda8('0x60')][_0xbda8('0x6c')]=_0x2c632d['id'];return db[_0xbda8('0x70')]['create'](_0x2d8851[_0xbda8('0x60')]);}})[_0xbda8('0x39')](respondWithResult(_0x3048ec,null))[_0xbda8('0x2a')](handleError(_0x3048ec,null));};exports['getAnswers']=function(_0x545378,_0x39a64f,_0x39ddb8){var _0x1fa657={'raw':![],'where':{}};var _0x55c6dd={};var _0x31b984={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xbda8('0x6a')]({'where':{'id':_0x545378[_0xbda8('0x5a')]['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x39a64f,null))[_0xbda8('0x39')](function(_0x5199ff){if(_0x5199ff){_0x55c6dd['model']=_[_0xbda8('0x4a')](db[_0xbda8('0x70')]['rawAttributes']);_0x55c6dd[_0xbda8('0x4b')]=_[_0xbda8('0x4a')](_0x545378[_0xbda8('0x4b')]);_0x55c6dd[_0xbda8('0x4c')]=_[_0xbda8('0x4f')](_0x55c6dd[_0xbda8('0x4d')],_0x55c6dd[_0xbda8('0x4b')]);_0x1fa657[_0xbda8('0x4e')]=_[_0xbda8('0x4f')](_0x55c6dd[_0xbda8('0x4d')],qs[_0xbda8('0x50')](_0x545378['query'][_0xbda8('0x50')]));_0x1fa657[_0xbda8('0x4e')]=_0x1fa657[_0xbda8('0x4e')]['length']?_0x1fa657['attributes']:_0x55c6dd[_0xbda8('0x4d')];if(!_0x545378[_0xbda8('0x4b')]['hasOwnProperty']('nolimit')){_0x1fa657[_0xbda8('0x31')]=qs[_0xbda8('0x31')](_0x545378['query'][_0xbda8('0x31')]);_0x1fa657['offset']=qs[_0xbda8('0x2f')](_0x545378[_0xbda8('0x4b')]['offset']);}_0x1fa657['order']=qs[_0xbda8('0x54')](_0x545378[_0xbda8('0x4b')]['sort']);_0x1fa657[_0xbda8('0x55')]=qs[_0xbda8('0x4c')](_['pick'](_0x545378[_0xbda8('0x4b')],_0x55c6dd[_0xbda8('0x4c')]));_0x1fa657[_0xbda8('0x55')][_0xbda8('0x6c')]=_0x5199ff['id'];if(_0x545378[_0xbda8('0x4b')]['filter']){_0x1fa657[_0xbda8('0x55')]=_['merge'](_0x1fa657[_0xbda8('0x55')],{'$or':_[_0xbda8('0x49')](_0x1fa657[_0xbda8('0x4e')],function(_0x4b7107){var _0x33474f={};_0x33474f[_0x4b7107]={'$like':'%'+_0x545378[_0xbda8('0x4b')][_0xbda8('0x57')]+'%'};return _0x33474f;})});}_0x1fa657=_[_0xbda8('0x59')]({},_0x1fa657,_0x545378[_0xbda8('0x5d')]);return db[_0xbda8('0x70')][_0xbda8('0x32')]({'where':_0x1fa657[_0xbda8('0x55')]})['then'](function(_0x1302da){_0x31b984['count']=_0x1302da;if(_0x545378[_0xbda8('0x4b')][_0xbda8('0x5b')]){_0x1fa657[_0xbda8('0x5c')]=[{'all':!![]}];}return db[_0xbda8('0x70')][_0xbda8('0x71')](_0x1fa657);})[_0xbda8('0x39')](function(_0x51716a){_0x31b984[_0xbda8('0x6d')]=_0x51716a;return _0x31b984;});}})[_0xbda8('0x39')](respondWithFilteredResult(_0x39a64f,_0x1fa657))[_0xbda8('0x2a')](handleError(_0x39a64f,null));};exports[_0xbda8('0x72')]=function(_0xfc4a0b,_0x16a29d,_0x296d69){return db[_0xbda8('0x44')][_0xbda8('0x5e')]({'where':{'id':_0xfc4a0b[_0xbda8('0x5a')]['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x16a29d,null))[_0xbda8('0x39')](function(_0x10dc0b){if(_0x10dc0b){return _0x10dc0b[_0xbda8('0x72')](_0xfc4a0b[_0xbda8('0x4b')][_0xbda8('0x73')]);}})[_0xbda8('0x39')](respondWithStatusCode(_0x16a29d,null))[_0xbda8('0x2a')](handleError(_0x16a29d,null));};exports[_0xbda8('0x74')]=function(_0x396492,_0x500d6e,_0x128572){return db[_0xbda8('0x44')]['find']({'where':{'id':_0x396492[_0xbda8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x500d6e,null))[_0xbda8('0x39')](function(_0x57bd3e){if(_0x57bd3e){return _0x57bd3e[_0xbda8('0x74')](_0x396492[_0xbda8('0x60')][_0xbda8('0x73')],_['omit'](_0x396492[_0xbda8('0x60')],['ids','id'])||{})['spread'](function(_0x4f4a6a){for(var _0x5d0297=0x0;_0x5d0297<_0x396492[_0xbda8('0x60')][_0xbda8('0x73')][_0xbda8('0x51')];_0x5d0297+=0x1){socket['emit'](_0xbda8('0x75'),{'UserId':Number(_0x396492[_0xbda8('0x60')][_0xbda8('0x73')][_0x5d0297]),'WhatsappAccountId':Number(_0x396492[_0xbda8('0x5a')]['id'])});}return _0x4f4a6a;});}})[_0xbda8('0x39')](respondWithResult(_0x500d6e,null))['catch'](handleError(_0x500d6e,null));};exports[_0xbda8('0x76')]=function(_0x5aca66,_0x27c3b1,_0x2caa1b){return db[_0xbda8('0x44')]['find']({'where':{'id':_0x5aca66[_0xbda8('0x5a')]['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x27c3b1,null))[_0xbda8('0x39')](function(_0x321edd){if(_0x321edd){return _0x321edd[_0xbda8('0x76')](_0x5aca66[_0xbda8('0x4b')][_0xbda8('0x73')])[_0xbda8('0x39')](function(){if(_['isArray'](_0x5aca66[_0xbda8('0x4b')][_0xbda8('0x73')])){for(var _0x47e0d2=0x0;_0x47e0d2<_0x5aca66[_0xbda8('0x4b')][_0xbda8('0x73')]['length'];_0x47e0d2+=0x1){socket['emit'](_0xbda8('0x77'),{'UserId':Number(_0x5aca66[_0xbda8('0x4b')][_0xbda8('0x73')][_0x47e0d2]),'WhatsappAccountId':Number(_0x5aca66[_0xbda8('0x5a')]['id'])});}}else{socket['emit'](_0xbda8('0x77'),{'UserId':Number(_0x5aca66[_0xbda8('0x4b')][_0xbda8('0x73')]),'WhatsappAccountId':Number(_0x5aca66['params']['id'])});}});}})[_0xbda8('0x39')](respondWithStatusCode(_0x27c3b1,null))[_0xbda8('0x2a')](handleError(_0x27c3b1,null));};exports[_0xbda8('0x78')]=function(_0x4db9f9,_0x4cfb2c,_0x6523f7){var _0x5ce17b={};var _0x4b55df={};var _0x24e51e;var _0x517e98;return db[_0xbda8('0x44')][_0xbda8('0x6a')]({'where':{'id':_0x4db9f9['params']['id']}})['then'](handleEntityNotFound(_0x4cfb2c,null))[_0xbda8('0x39')](function(_0x4c3c91){if(_0x4c3c91){_0x24e51e=_0x4c3c91;_0x4b55df[_0xbda8('0x4d')]=_[_0xbda8('0x4a')](db[_0xbda8('0x79')][_0xbda8('0x45')]);_0x4b55df[_0xbda8('0x4b')]=_[_0xbda8('0x4a')](_0x4db9f9['query']);_0x4b55df[_0xbda8('0x4c')]=_[_0xbda8('0x4f')](_0x4b55df['model'],_0x4b55df['query']);_0x5ce17b[_0xbda8('0x4e')]=_['intersection'](_0x4b55df[_0xbda8('0x4d')],qs[_0xbda8('0x50')](_0x4db9f9[_0xbda8('0x4b')][_0xbda8('0x50')]));_0x5ce17b[_0xbda8('0x4e')]=_0x5ce17b[_0xbda8('0x4e')][_0xbda8('0x51')]?_0x5ce17b[_0xbda8('0x4e')]:_0x4b55df[_0xbda8('0x4d')];_0x5ce17b[_0xbda8('0x53')]=qs[_0xbda8('0x54')](_0x4db9f9[_0xbda8('0x4b')][_0xbda8('0x54')]);_0x5ce17b[_0xbda8('0x55')]=qs[_0xbda8('0x4c')](_['pick'](_0x4db9f9[_0xbda8('0x4b')],_0x4b55df['filters']));if(_0x4db9f9[_0xbda8('0x4b')]['filter']){_0x5ce17b['where']=_['merge'](_0x5ce17b[_0xbda8('0x55')],{'$or':_[_0xbda8('0x49')](_0x5ce17b[_0xbda8('0x4e')],function(_0x5071ac){var _0x500528={};_0x500528[_0x5071ac]={'$like':'%'+_0x4db9f9[_0xbda8('0x4b')][_0xbda8('0x57')]+'%'};return _0x500528;})});}_0x5ce17b=_['merge']({},_0x5ce17b,_0x4db9f9[_0xbda8('0x5d')]);return _0x24e51e[_0xbda8('0x78')](_0x5ce17b);}})['then'](function(_0x162c21){if(_0x162c21){_0x517e98=_0x162c21[_0xbda8('0x51')];if(!_0x4db9f9[_0xbda8('0x4b')][_0xbda8('0x6b')](_0xbda8('0x52'))){_0x5ce17b[_0xbda8('0x31')]=qs[_0xbda8('0x31')](_0x4db9f9['query'][_0xbda8('0x31')]);_0x5ce17b[_0xbda8('0x2f')]=qs[_0xbda8('0x2f')](_0x4db9f9['query'][_0xbda8('0x2f')]);}return _0x24e51e[_0xbda8('0x78')](_0x5ce17b);}})['then'](function(_0x4733e9){if(_0x4733e9){return _0x4733e9?{'count':_0x517e98,'rows':_0x4733e9}:null;}})[_0xbda8('0x39')](respondWithResult(_0x4cfb2c,null))[_0xbda8('0x2a')](handleError(_0x4cfb2c,null));};exports[_0xbda8('0x7a')]=function(_0x1b2d3f,_0x13577c,_0x552ad4){return db[_0xbda8('0x44')]['findOne']({'where':{'id':_0x1b2d3f[_0xbda8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x13577c,null))[_0xbda8('0x39')](function(_0x194698){if(_0x194698){return db['sequelize'][_0xbda8('0x7b')](function(_0xfdf652){return db[_0xbda8('0x7c')][_0xbda8('0x3a')]({'where':{'WhatsappAccountId':_0x1b2d3f['params']['id']},'transaction':_0xfdf652})[_0xbda8('0x39')](function(_0x4e6b72){var _0x43ebea=_[_0xbda8('0x49')](_0x1b2d3f[_0xbda8('0x60')],function(_0x347708){_0x347708[_0xbda8('0x6c')]=_0x1b2d3f[_0xbda8('0x5a')]['id'];return _0x347708;});return db[_0xbda8('0x7c')]['bulkCreate'](_0x43ebea,{'transaction':_0xfdf652});});})[_0xbda8('0x39')](function(){return db[_0xbda8('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x1b2d3f['params']['id']},'order':_0xbda8('0x7d')});});}})[_0xbda8('0x39')](respondWithResult(_0x13577c,null))[_0xbda8('0x2a')](handleError(_0x13577c,null));};exports[_0xbda8('0x7e')]=function(_0x1e3663,_0x450a3a,_0x41aadc){var _0x5681b1={};var _0x582187={};var _0xcd8421;var _0x7eb2ae;return db[_0xbda8('0x44')][_0xbda8('0x6a')]({'where':{'id':_0x1e3663[_0xbda8('0x5a')]['id']}})[_0xbda8('0x39')](handleEntityNotFound(_0x450a3a,null))[_0xbda8('0x39')](function(_0x4c0ac6){if(_0x4c0ac6){_0xcd8421=_0x4c0ac6;_0x582187[_0xbda8('0x4d')]=_[_0xbda8('0x4a')](db[_0xbda8('0x7c')][_0xbda8('0x45')]);_0x582187[_0xbda8('0x4b')]=_[_0xbda8('0x4a')](_0x1e3663['query']);_0x582187[_0xbda8('0x4c')]=_['intersection'](_0x582187[_0xbda8('0x4d')],_0x582187['query']);_0x5681b1[_0xbda8('0x4e')]=_[_0xbda8('0x4f')](_0x582187[_0xbda8('0x4d')],qs[_0xbda8('0x50')](_0x1e3663[_0xbda8('0x4b')][_0xbda8('0x50')]));_0x5681b1[_0xbda8('0x4e')]=_0x5681b1['attributes'][_0xbda8('0x51')]?_0x5681b1[_0xbda8('0x4e')]:_0x582187[_0xbda8('0x4d')];_0x5681b1[_0xbda8('0x53')]=qs[_0xbda8('0x54')](_0x1e3663[_0xbda8('0x4b')][_0xbda8('0x54')]);_0x5681b1[_0xbda8('0x55')]=qs[_0xbda8('0x4c')](_[_0xbda8('0x56')](_0x1e3663[_0xbda8('0x4b')],_0x582187['filters']));if(_0x1e3663[_0xbda8('0x4b')][_0xbda8('0x57')]){_0x5681b1[_0xbda8('0x55')]=_[_0xbda8('0x59')](_0x5681b1[_0xbda8('0x55')],{'$or':_['map'](_0x5681b1[_0xbda8('0x4e')],function(_0x27984b){var _0x319311={};_0x319311[_0x27984b]={'$like':'%'+_0x1e3663[_0xbda8('0x4b')][_0xbda8('0x57')]+'%'};return _0x319311;})});}_0x5681b1=_['merge']({},_0x5681b1,_0x1e3663[_0xbda8('0x5d')]);return _0xcd8421['getApplications'](_0x5681b1);}})[_0xbda8('0x39')](function(_0x45ccab){if(_0x45ccab){_0x7eb2ae=_0x45ccab[_0xbda8('0x51')];if(!_0x1e3663[_0xbda8('0x4b')]['hasOwnProperty'](_0xbda8('0x52'))){_0x5681b1[_0xbda8('0x31')]=qs[_0xbda8('0x31')](_0x1e3663['query'][_0xbda8('0x31')]);_0x5681b1[_0xbda8('0x2f')]=qs[_0xbda8('0x2f')](_0x1e3663[_0xbda8('0x4b')][_0xbda8('0x2f')]);}return _0xcd8421[_0xbda8('0x7e')](_0x5681b1);}})['then'](function(_0x12e3c8){if(_0x12e3c8){return _0x12e3c8?{'count':_0x7eb2ae,'rows':_0x12e3c8}:null;}})[_0xbda8('0x39')](respondWithResult(_0x450a3a,null))[_0xbda8('0x2a')](handleError(_0x450a3a,null));};exports[_0xbda8('0x7f')]=function(_0x4af01e,_0x1e05a4,_0xcb9b72){var _0x11adfe={'channel':_0xbda8('0x80')};var _0x17b924=[];var _0x58ff49=[];var _0x4b3c3b={};return db['WhatsappAccount']['find']({'where':{'id':_0x4af01e[_0xbda8('0x5a')]['id']},'include':[{'model':db[_0xbda8('0x7c')],'as':'Applications'}]})[_0xbda8('0x39')](handleEntityNotFound(_0x1e05a4,null))[_0xbda8('0x39')](function(_0xc68caa){_0x11adfe['account']=_0xc68caa;_0x11adfe[_0xbda8('0x81')]=_[_0xbda8('0x82')](_0xc68caa[_0xbda8('0x83')],[_0xbda8('0x7d')],['asc']);if(_0x11adfe[_0xbda8('0x84')][_0xbda8('0x83')]){delete _0x11adfe['account']['Applications'];}return db[_0xbda8('0x85')]['describe']();})[_0xbda8('0x39')](function(_0x5b59ad){if(!_0x5b59ad){throw new db[(_0xbda8('0x86'))]['ValidationError'](_0xbda8('0x87'));}_0x17b924=_[_0xbda8('0x88')](_[_0xbda8('0x4a')](_0x5b59ad),['createdAt',_0xbda8('0x89')]);_0x58ff49=_[_0xbda8('0x88')](_[_0xbda8('0x4a')](_0x5b59ad),['createdAt',_0xbda8('0x89'),'CompanyId','ListId']);_0x11adfe['body']={'mapKey':_0xbda8('0x8a')};if(_0x11adfe['account'][_0xbda8('0x47')]&&_0x11adfe[_0xbda8('0x84')][_0xbda8('0x47')]===_0xbda8('0x8b')){_0x11adfe[_0xbda8('0x60')][_0xbda8('0x8c')]=_0x4af01e['body'][_0xbda8('0x8d')][_0xbda8('0x8e')](_0xbda8('0x8f'),'');_0x11adfe[_0xbda8('0x60')]['body']=_0x4af01e[_0xbda8('0x60')]['Body'];_0x11adfe[_0xbda8('0x60')][_0xbda8('0x90')]=_0x4af01e[_0xbda8('0x60')][_0xbda8('0x91')];}if(_0x11adfe['body']['id']){delete _0x11adfe[_0xbda8('0x60')]['id'];}if(_[_0xbda8('0x92')](_0x11adfe[_0xbda8('0x60')][_0xbda8('0x8c')])){throw new db[(_0xbda8('0x86'))][(_0xbda8('0x93'))]('from\x20is\x20mandatory');}if(_[_0xbda8('0x92')](_0x11adfe['body'][_0xbda8('0x60')])||_0x11adfe['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0xbda8('0x94'));}if(_[_0xbda8('0x92')](_0x11adfe['body'][_0xbda8('0x95')])){throw new db['Sequelize'][(_0xbda8('0x93'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x58ff49);}if(!_[_0xbda8('0x96')](_0x58ff49,_0x11adfe[_0xbda8('0x60')][_0xbda8('0x95')])){throw new db[(_0xbda8('0x86'))][(_0xbda8('0x93'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x58ff49);}_0x4b3c3b[_0x11adfe['body'][_0xbda8('0x95')]]=_0x11adfe[_0xbda8('0x60')]['from'];return db[_0xbda8('0x97')][_0xbda8('0x5e')]({'where':{'id':_0x11adfe[_0xbda8('0x84')]['ListId']},'include':[{'model':db[_0xbda8('0x85')],'as':'Contacts','where':_0x4b3c3b,'limit':0x1,'order':[[_0xbda8('0x89'),'DESC']]}]});})[_0xbda8('0x39')](handleEntityNotFound(_0x1e05a4,null))[_0xbda8('0x39')](function(_0x53019c){if(_0x53019c){_0x11adfe['list']=_[_0xbda8('0x98')](_0x53019c,[_0xbda8('0x99')]);if(_0x53019c['Contacts'][_0xbda8('0x51')]){return _0x53019c[_0xbda8('0x99')][0x0];}var _0x514a86=_[_0xbda8('0x1b')](_0x11adfe['body'],{'firstName':_0x11adfe[_0xbda8('0x60')]['from'],'ListId':_0x53019c['id']});_0x514a86[_0x11adfe['body']['mapKey']]=_0x11adfe['body'][_0xbda8('0x8c')];return db[_0xbda8('0x85')][_0xbda8('0x5f')](_0x514a86,{'fields':_0x17b924,'raw':!![]});}})['then'](handleEntityNotFound(_0x1e05a4,null))[_0xbda8('0x39')](function(_0x4b063a){if(_0x4b063a){_0x11adfe[_0xbda8('0x9a')]=_0x4b063a;var _0x70c848={'ContactId':_0x4b063a['id'],'phone':_0x11adfe[_0xbda8('0x60')][_0xbda8('0x8c')],'WhatsappAccountId':_0x4af01e[_0xbda8('0x5a')]['id']};var _0x565784={'ContactId':_0x4b063a['id'],'WhatsappAccountId':_0x4af01e['params']['id'],'closed':![]};return db[_0xbda8('0x9b')][_0xbda8('0x5e')]({'where':_0x565784})[_0xbda8('0x39')](function(_0x4415f1){if(_0x4415f1){return[_0x4415f1,![]];}return db[_0xbda8('0x9b')][_0xbda8('0x5f')](_0x70c848)['then'](function(_0x2a7152){return[_0x2a7152,!![]];});});}})[_0xbda8('0x9c')](function(_0x524095,_0x4fefde){_0x11adfe[_0xbda8('0x9d')]=_0x524095[_0xbda8('0x3b')]({'plain':!![]});_0x11adfe['interaction'][_0xbda8('0x9e')]=![];if(_0x4fefde){if(_0x11adfe[_0xbda8('0x84')][_0xbda8('0x9f')]){_0x11adfe[_0xbda8('0x81')][_0xbda8('0xa0')]({'id':0x0,'priority':_0x11adfe[_0xbda8('0x81')]['length']+0x1,'app':_0xbda8('0xa1'),'appdata':'unmanaged','interval':_0xbda8('0xa2')});}_0x11adfe[_0xbda8('0x9d')][_0xbda8('0x9e')]=!![];}return db['WhatsappMessage'][_0xbda8('0x5f')]({'phone':_0x11adfe[_0xbda8('0x60')][_0xbda8('0x8c')],'messageId':_0x11adfe[_0xbda8('0x60')]['messageId'],'body':_0x11adfe[_0xbda8('0x60')]['body'],'WhatsappAccountId':_0x4af01e[_0xbda8('0x5a')]['id'],'WhatsappInteractionId':_0x524095['id'],'direction':'in','ContactId':_0x524095['ContactId'],'AttachmentId':_0x11adfe[_0xbda8('0x60')][_0xbda8('0xa3')]});})[_0xbda8('0x39')](function(_0x465d85){_0x11adfe[_0xbda8('0x29')]=_0x465d85;if(_0x11adfe[_0xbda8('0x9d')][_0xbda8('0xa4')]){return db[_0xbda8('0x79')][_0xbda8('0x5e')]({'attributes':['id',_0xbda8('0x3f')],'where':{'id':_0x11adfe['interaction']['UserId']}})[_0xbda8('0x39')](function(_0x1dcac3){if(_0x1dcac3){_0x11adfe[_0xbda8('0x81')][_0xbda8('0xa5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1dcac3[_0xbda8('0x3f')]+','+(_0x11adfe[_0xbda8('0x84')][_0xbda8('0xa6')]||0xa),'interval':_0xbda8('0xa2')});}return respondWithRpcPromise(_0xbda8('0xa7'),_0xbda8('0xa8'),_0x11adfe);});}return respondWithRpcPromise(_0xbda8('0xa7'),_0xbda8('0xa8'),_0x11adfe);})[_0xbda8('0x39')](function(_0x1a408e){if(_0x1a408e){var _0x1718f4=0xc8;var _0x5eca53=_0xbda8('0xa9');logger[_0xbda8('0x21')](_0xbda8('0x25'),_0x5eca53,_0x1718f4,_0xbda8('0xaa'));logger['debug'](_0xbda8('0xab'),_0x5eca53,_0x1718f4,_0xbda8('0xaa'),JSON[_0xbda8('0x26')](_0x1a408e));if(_0x11adfe[_0xbda8('0x84')][_0xbda8('0x47')]===_0xbda8('0x8b')){return _0x1e05a4[_0xbda8('0x2c')](_0x1718f4)['set'](_0xbda8('0xac'),_0xbda8('0xad'))[_0xbda8('0x40')](_0xbda8('0xae'));}else{return _0x1e05a4['status'](_0x1718f4)[_0xbda8('0x2e')](_0x1a408e);}}})[_0xbda8('0x2a')](handleError(_0x1e05a4,null));};exports[_0xbda8('0x40')]=function(_0x431a25,_0x31dc68,_0x5706ae){var _0x27a9b0,_0x31f126,_0x1f3079;if(_[_0xbda8('0x92')](_0x431a25['body'][_0xbda8('0x60')])||_0x431a25[_0xbda8('0x60')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xbda8('0x94'));}if(_['isNil'](_0x431a25['body']['to'])){throw new db[(_0xbda8('0x86'))][(_0xbda8('0x93'))](_0xbda8('0xaf'));}_0x27a9b0=_0x431a25[_0xbda8('0x60')]['to'];return db[_0xbda8('0x44')]['find']({'where':{'id':_0x431a25['params']['id']},'include':[{'model':db['CmList'],'as':_0xbda8('0xb0'),'include':[{'model':db['CmContact'],'as':_0xbda8('0x99'),'where':{'mobile':_0x27a9b0},'limit':0x1,'order':[[_0xbda8('0x89'),'DESC']]}]}]})[_0xbda8('0x39')](handleEntityNotFound(_0x31dc68,null))['then'](function(_0x316dbc){if(_0x316dbc&&_0x316dbc[_0xbda8('0xb0')]){_0x31f126=_0x316dbc[_0xbda8('0x3b')]({'plain':!![]});if(_0x31f126['List']&&_0x31f126[_0xbda8('0xb0')][_0xbda8('0x99')][_0xbda8('0x51')]){return _0x31f126['List'][_0xbda8('0x99')][0x0];}return db[_0xbda8('0x85')][_0xbda8('0x5f')](_[_0xbda8('0x1b')](_0x431a25['body'],{'firstName':_0x27a9b0,'mobile':_0x27a9b0,'phone':_0x27a9b0,'ListId':_0x31f126[_0xbda8('0xb1')]}));}})[_0xbda8('0x39')](handleEntityNotFound(_0x31dc68,null))['then'](function(_0x797244){if(_0x797244){_0x1f3079=_0x797244;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x1f3079['id'],'closed':![],'WhatsappAccountId':_0x31f126['id']}})[_0xbda8('0x39')](function(_0x448ec7){if(_0x448ec7){return[_0x448ec7,![]];}return db['WhatsappInteraction'][_0xbda8('0x5f')]({'UserId':_0x431a25[_0xbda8('0x61')]['id'],'ContactId':_0x1f3079['id'],'WhatsappAccountId':_0x31f126['id'],'phone':_0x27a9b0,'firstMsgDirection':_0xbda8('0xb2'),'Messages':[_['merge'](_0x431a25['body'],{'read':![],'body':_0x431a25['body'][_0xbda8('0x60')],'phone':_0x27a9b0,'WhatsappAccountId':_0x31f126['id'],'UserId':_0x431a25[_0xbda8('0x61')]['id'],'ContactId':_0x1f3079['id']})]},{'include':[{'model':db[_0xbda8('0xb3')],'as':_0xbda8('0xb4')}]})['then'](function(_0x139f10){return[_0x139f10,!![]];});});}})[_0xbda8('0x9c')](function(_0x5e1396,_0x40d795){if(_0x40d795){return _0x5e1396;}return db['WhatsappMessage']['create'](_[_0xbda8('0x59')](_0x431a25['body'],{'read':![],'body':_0x431a25[_0xbda8('0x60')][_0xbda8('0x60')],'phone':_0x27a9b0,'WhatsappAccountId':_0x31f126['id'],'WhatsappInteractionId':_0x5e1396['id'],'UserId':_0x431a25['user']['id'],'ContactId':_0x1f3079['id']}))['then'](function(_0x4b0787){_0x5e1396[_0xbda8('0xb5')][_0xbda8('0xb4')]=[];_0x5e1396['dataValues'][_0xbda8('0xb4')][_0xbda8('0xa0')](_0x4b0787[_0xbda8('0xb5')]);return _0x5e1396;});})[_0xbda8('0x39')](respondWithResult(_0x31dc68,null))['catch'](handleError(_0x31dc68,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 45b1386..5949ec9 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 _0xeadb=['update','emit','hasOwnProperty','hook','exports','WhatsappAccount','setMaxListeners','save'];(function(_0x5b086e,_0x5eb6c0){var _0x3e2c2c=function(_0x1c5de7){while(--_0x1c5de7){_0x5b086e['push'](_0x5b086e['shift']());}};_0x3e2c2c(++_0x5eb6c0);}(_0xeadb,0x75));var _0xbead=function(_0x4d3b70,_0x2f405e){_0x4d3b70=_0x4d3b70-0x0;var _0x13b3f6=_0xeadb[_0x4d3b70];return _0x13b3f6;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0xbead('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbead('0x1')](0x0);var events={'afterCreate':_0xbead('0x2'),'afterUpdate':_0xbead('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3bc2c0){return function(_0x423eff,_0x58a6a4,_0x3c7c46){WhatsappAccountEvents[_0xbead('0x4')](_0x3bc2c0+':'+_0x423eff['id'],_0x423eff);WhatsappAccountEvents[_0xbead('0x4')](_0x3bc2c0,_0x423eff);_0x3c7c46(null);};}for(var e in events){if(events[_0xbead('0x5')](e)){var event=events[e];WhatsappAccount[_0xbead('0x6')](e,emitEvent(event));}}module[_0xbead('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0xe137=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x951004,_0x541faf){var _0x15bfcf=function(_0x2f8f71){while(--_0x2f8f71){_0x951004['push'](_0x951004['shift']());}};_0x15bfcf(++_0x541faf);}(_0xe137,0x13a));var _0x7e13=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xe137[_0x3afe18];return _0x19ed1f;};'use strict';var EventEmitter=require(_0x7e13('0x0'));var WhatsappAccount=require(_0x7e13('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7e13('0x2')](0x0);var events={'afterCreate':_0x7e13('0x3'),'afterUpdate':_0x7e13('0x4'),'afterDestroy':_0x7e13('0x5')};function emitEvent(_0x229930){return function(_0x1741cf,_0x51002b,_0x186afa){WhatsappAccountEvents[_0x7e13('0x6')](_0x229930+':'+_0x1741cf['id'],_0x1741cf);WhatsappAccountEvents[_0x7e13('0x6')](_0x229930,_0x1741cf);_0x186afa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x7e13('0x7')](e,emitEvent(event));}}module[_0x7e13('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index bd2fc58..1bc3952 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 _0x2786=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','util'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2786,0xbf));var _0x6278=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2786[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x6278('0x0'));var logger=require(_0x6278('0x1'))(_0x6278('0x2'));var moment=require(_0x6278('0x3'));var BPromise=require('bluebird');var rp=require(_0x6278('0x4'));var fs=require('fs');var path=require(_0x6278('0x5'));var rimraf=require(_0x6278('0x6'));var config=require(_0x6278('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x6278('0x8')]=function(_0x11e1ed,_0x443083){return _0x11e1ed[_0x6278('0x9')](_0x6278('0xa'),attributes,{'tableName':_0x6278('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedfd=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount','util'];(function(_0x115b84,_0x1d2479){var _0x2b7f4a=function(_0x4d7566){while(--_0x4d7566){_0x115b84['push'](_0x115b84['shift']());}};_0x2b7f4a(++_0x1d2479);}(_0xedfd,0x15b));var _0xdedf=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xedfd[_0x494d1f];return _0x457b6e;};'use strict';var _=require('lodash');var util=require(_0xdedf('0x0'));var logger=require(_0xdedf('0x1'))(_0xdedf('0x2'));var moment=require(_0xdedf('0x3'));var BPromise=require(_0xdedf('0x4'));var rp=require(_0xdedf('0x5'));var fs=require('fs');var path=require(_0xdedf('0x6'));var rimraf=require(_0xdedf('0x7'));var config=require('../../config/environment');var attributes=require(_0xdedf('0x8'));module[_0xdedf('0x9')]=function(_0xf5d304,_0x30a7e4){return _0xf5d304[_0xdedf('0xa')](_0xdedf('0xb'),attributes,{'tableName':'whatsapp_accounts','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 0147bd0..eb04b56 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 _0xf6f8=['include','model','then','ShowWhatsappAccount','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount','find','options','raw','where','attributes','map'];(function(_0x2e56d0,_0x1219c8){var _0x55533a=function(_0x29427b){while(--_0x29427b){_0x2e56d0['push'](_0x2e56d0['shift']());}};_0x55533a(++_0x1219c8);}(_0xf6f8,0xbe));var _0x8f6f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf6f8[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8f6f('0x0'));var util=require(_0x8f6f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f6f('0x2'));var db=require(_0x8f6f('0x3'))['db'];var utils=require(_0x8f6f('0x4'));var logger=require('../../config/logger')(_0x8f6f('0x5'));var config=require(_0x8f6f('0x6'));var jayson=require(_0x8f6f('0x7'));var client=jayson['client'][_0x8f6f('0x8')]({'port':0x232a});config[_0x8f6f('0x9')]=_[_0x8f6f('0xa')](config[_0x8f6f('0x9')],{'host':_0x8f6f('0xb'),'port':0x18eb});var socket=require(_0x8f6f('0xc'))(new Redis(config[_0x8f6f('0x9')]));require(_0x8f6f('0xd'))[_0x8f6f('0xe')](socket);function respondWithRpcPromise(_0x204725,_0x2ae2aa,_0x340f59){return new BPromise(function(_0x26b9e9,_0x146660){return client[_0x8f6f('0xf')](_0x204725,_0x340f59)['then'](function(_0x484260){logger[_0x8f6f('0x10')](_0x8f6f('0x11'),_0x2ae2aa,_0x8f6f('0x12'));logger[_0x8f6f('0x13')](_0x8f6f('0x14'),_0x2ae2aa,_0x8f6f('0x12'),JSON[_0x8f6f('0x15')](_0x484260));if(_0x484260[_0x8f6f('0x16')]){if(_0x484260[_0x8f6f('0x16')][_0x8f6f('0x17')]===0x1f4){logger[_0x8f6f('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x2ae2aa,_0x484260[_0x8f6f('0x16')]['message']);return _0x146660(_0x484260[_0x8f6f('0x16')][_0x8f6f('0x18')]);}logger[_0x8f6f('0x16')](_0x8f6f('0x11'),_0x2ae2aa,_0x484260[_0x8f6f('0x16')]['message']);return _0x26b9e9(_0x484260[_0x8f6f('0x16')][_0x8f6f('0x18')]);}else{logger[_0x8f6f('0x10')](_0x8f6f('0x11'),_0x2ae2aa,_0x8f6f('0x12'));_0x26b9e9(_0x484260['result'][_0x8f6f('0x18')]);}})['catch'](function(_0x3cf68a){logger[_0x8f6f('0x16')](_0x8f6f('0x11'),_0x2ae2aa,_0x3cf68a);_0x146660(_0x3cf68a);});});}exports['ShowWhatsappAccount']=function(_0x5b7712){var _0x42ce17=this;return new Promise(function(_0x203b66,_0x26095c){return db[_0x8f6f('0x19')][_0x8f6f('0x1a')]({'raw':_0x5b7712[_0x8f6f('0x1b')]?_0x5b7712['options'][_0x8f6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b7712[_0x8f6f('0x1b')]?_0x5b7712[_0x8f6f('0x1b')][_0x8f6f('0x1d')]||null:null,'attributes':_0x5b7712['options']?_0x5b7712['options'][_0x8f6f('0x1e')]||null:null,'include':_0x5b7712[_0x8f6f('0x1b')]?_0x5b7712[_0x8f6f('0x1b')]['include']?_[_0x8f6f('0x1f')](_0x5b7712['options'][_0x8f6f('0x20')],function(_0x4f40ea){return{'model':db[_0x4f40ea[_0x8f6f('0x21')]],'as':_0x4f40ea['as'],'attributes':_0x4f40ea[_0x8f6f('0x1e')],'include':_0x4f40ea[_0x8f6f('0x20')]?_[_0x8f6f('0x1f')](_0x4f40ea[_0x8f6f('0x20')],function(_0x820bc1){return{'model':db[_0x820bc1[_0x8f6f('0x21')]],'as':_0x820bc1['as'],'attributes':_0x820bc1[_0x8f6f('0x1e')],'include':_0x820bc1['include']?_[_0x8f6f('0x1f')](_0x820bc1[_0x8f6f('0x20')],function(_0x254005){return{'model':db[_0x254005[_0x8f6f('0x21')]],'as':_0x254005['as'],'attributes':_0x254005[_0x8f6f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8f6f('0x22')](function(_0x49b72a){logger[_0x8f6f('0x10')](_0x8f6f('0x23'),_0x5b7712);logger[_0x8f6f('0x13')](_0x8f6f('0x23'),_0x5b7712,JSON['stringify'](_0x49b72a));_0x203b66(_0x49b72a);})[_0x8f6f('0x24')](function(_0x392200){logger[_0x8f6f('0x16')](_0x8f6f('0x23'),_0x392200[_0x8f6f('0x18')],_0x5b7712);_0x26095c(_0x42ce17[_0x8f6f('0x16')](0x1f4,_0x392200[_0x8f6f('0x18')]));});});}; \ No newline at end of file +var _0xa934=['stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','include','model','attributes','map','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./whatsappAccount.socket','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa934,0x128));var _0x4a93=function(_0x5919bc,_0x56710b){_0x5919bc=_0x5919bc-0x0;var _0x2a4340=_0xa934[_0x5919bc];return _0x2a4340;};'use strict';var _=require(_0x4a93('0x0'));var util=require('util');var moment=require(_0x4a93('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a93('0x2'));var fs=require('fs');var Redis=require(_0x4a93('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4a93('0x4'))(_0x4a93('0x5'));var config=require(_0x4a93('0x6'));var jayson=require(_0x4a93('0x7'));var client=jayson['client'][_0x4a93('0x8')]({'port':0x232a});config['redis']=_[_0x4a93('0x9')](config[_0x4a93('0xa')],{'host':_0x4a93('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a93('0xa')]));require(_0x4a93('0xc'))['register'](socket);function respondWithRpcPromise(_0x28f7da,_0x1fc4d0,_0x4a177a){return new BPromise(function(_0x2280e5,_0x340236){return client[_0x4a93('0xd')](_0x28f7da,_0x4a177a)[_0x4a93('0xe')](function(_0x1634bc){logger[_0x4a93('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x1fc4d0,'request\x20sent');logger[_0x4a93('0x10')](_0x4a93('0x11'),_0x1fc4d0,_0x4a93('0x12'),JSON[_0x4a93('0x13')](_0x1634bc));if(_0x1634bc['error']){if(_0x1634bc[_0x4a93('0x14')][_0x4a93('0x15')]===0x1f4){logger[_0x4a93('0x14')](_0x4a93('0x16'),_0x1fc4d0,_0x1634bc[_0x4a93('0x14')]['message']);return _0x340236(_0x1634bc[_0x4a93('0x14')][_0x4a93('0x17')]);}logger[_0x4a93('0x14')](_0x4a93('0x16'),_0x1fc4d0,_0x1634bc[_0x4a93('0x14')][_0x4a93('0x17')]);return _0x2280e5(_0x1634bc['error']['message']);}else{logger[_0x4a93('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x1fc4d0,'request\x20sent');_0x2280e5(_0x1634bc[_0x4a93('0x18')][_0x4a93('0x17')]);}})[_0x4a93('0x19')](function(_0x486797){logger['error'](_0x4a93('0x16'),_0x1fc4d0,_0x486797);_0x340236(_0x486797);});});}exports[_0x4a93('0x1a')]=function(_0x545eff){var _0x1e2805=this;return new Promise(function(_0x5639b7,_0x258b1a){return db[_0x4a93('0x1b')]['find']({'raw':_0x545eff[_0x4a93('0x1c')]?_0x545eff[_0x4a93('0x1c')][_0x4a93('0x1d')]===undefined?!![]:![]:!![],'where':_0x545eff['options']?_0x545eff['options'][_0x4a93('0x1e')]||null:null,'attributes':_0x545eff[_0x4a93('0x1c')]?_0x545eff[_0x4a93('0x1c')]['attributes']||null:null,'include':_0x545eff['options']?_0x545eff['options']['include']?_['map'](_0x545eff[_0x4a93('0x1c')][_0x4a93('0x1f')],function(_0x1ce2ed){return{'model':db[_0x1ce2ed[_0x4a93('0x20')]],'as':_0x1ce2ed['as'],'attributes':_0x1ce2ed[_0x4a93('0x21')],'include':_0x1ce2ed[_0x4a93('0x1f')]?_[_0x4a93('0x22')](_0x1ce2ed[_0x4a93('0x1f')],function(_0x1bcbdb){return{'model':db[_0x1bcbdb['model']],'as':_0x1bcbdb['as'],'attributes':_0x1bcbdb[_0x4a93('0x21')],'include':_0x1bcbdb[_0x4a93('0x1f')]?_['map'](_0x1bcbdb['include'],function(_0x25152d){return{'model':db[_0x25152d[_0x4a93('0x20')]],'as':_0x25152d['as'],'attributes':_0x25152d[_0x4a93('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4a93('0xe')](function(_0x156aa3){logger[_0x4a93('0xf')](_0x4a93('0x1a'),_0x545eff);logger['debug'](_0x4a93('0x1a'),_0x545eff,JSON[_0x4a93('0x13')](_0x156aa3));_0x5639b7(_0x156aa3);})[_0x4a93('0x19')](function(_0x3eb6de){logger[_0x4a93('0x14')](_0x4a93('0x1a'),_0x3eb6de[_0x4a93('0x17')],_0x545eff);_0x258b1a(_0x1e2805[_0x4a93('0x14')](0x1f4,_0x3eb6de[_0x4a93('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 02b4882..131808b 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 _0xeca3=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit'];(function(_0x231bc5,_0x182c85){var _0x5aa049=function(_0x40125d){while(--_0x40125d){_0x231bc5['push'](_0x231bc5['shift']());}};_0x5aa049(++_0x182c85);}(_0xeca3,0x199));var _0x3eca=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xeca3[_0x346737];return _0x1ade2e;};'use strict';var WhatsappAccountEvents=require(_0x3eca('0x0'));var events=[_0x3eca('0x1'),_0x3eca('0x2'),_0x3eca('0x3')];function createListener(_0x1f5d1c,_0x5766fb){return function(_0x1c0b24){_0x5766fb[_0x3eca('0x4')](_0x1f5d1c,_0x1c0b24);};}function removeListener(_0x584403,_0x4b4c41){return function(){WhatsappAccountEvents[_0x3eca('0x5')](_0x584403,_0x4b4c41);};}exports[_0x3eca('0x6')]=function(_0x5b4cb1){for(var _0x19c1ed=0x0,_0x3a9a3e=events[_0x3eca('0x7')];_0x19c1ed<_0x3a9a3e;_0x19c1ed++){var _0x5afa24=events[_0x19c1ed];var _0x133d8d=createListener(_0x3eca('0x8')+_0x5afa24,_0x5b4cb1);WhatsappAccountEvents['on'](_0x5afa24,_0x133d8d);}}; \ No newline at end of file +var _0x63bd=['remove','update','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x22f48d,_0x51b8e1){var _0x26ba9a=function(_0x5ee718){while(--_0x5ee718){_0x22f48d['push'](_0x22f48d['shift']());}};_0x26ba9a(++_0x51b8e1);}(_0x63bd,0x116));var _0xd63b=function(_0x2c9866,_0x36470d){_0x2c9866=_0x2c9866-0x0;var _0x3b9eff=_0x63bd[_0x2c9866];return _0x3b9eff;};'use strict';var WhatsappAccountEvents=require(_0xd63b('0x0'));var events=[_0xd63b('0x1'),_0xd63b('0x2'),_0xd63b('0x3')];function createListener(_0x40cfd8,_0x128cbf){return function(_0x580bf7){_0x128cbf[_0xd63b('0x4')](_0x40cfd8,_0x580bf7);};}function removeListener(_0x3be4e5,_0x18295c){return function(){WhatsappAccountEvents[_0xd63b('0x5')](_0x3be4e5,_0x18295c);};}exports['register']=function(_0x132cf4){for(var _0x55a908=0x0,_0xd32427=events[_0xd63b('0x6')];_0x55a908<_0xd32427;_0x55a908++){var _0x539a60=events[_0x55a908];var _0x13d3db=createListener(_0xd63b('0x7')+_0x539a60,_0x132cf4);WhatsappAccountEvents['on'](_0x539a60,_0x13d3db);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 60efd11..2ac4424 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 _0x402a=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','show','post','isAuthenticated','update','delete','/:id','exports'];(function(_0x5679e5,_0x4e45c9){var _0x34a94=function(_0xda168c){while(--_0xda168c){_0x5679e5['push'](_0x5679e5['shift']());}};_0x34a94(++_0x4e45c9);}(_0x402a,0x154));var _0xa402=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x402a[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xa402('0x0'));var util=require('util');var path=require(_0xa402('0x1'));var timeout=require(_0xa402('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa402('0x3'));var auth=require(_0xa402('0x4'));var interaction=require(_0xa402('0x5'));var config=require(_0xa402('0x6'));var controller=require(_0xa402('0x7'));router[_0xa402('0x8')]('/',auth['isAuthenticated'](),controller[_0xa402('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa402('0xa')]);router[_0xa402('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xa402('0xc')](),controller[_0xa402('0xd')]);router[_0xa402('0xe')](_0xa402('0xf'),auth[_0xa402('0xc')](),controller['destroy']);module[_0xa402('0x10')]=router; \ No newline at end of file +var _0x008e=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x3e9b56,_0x4371da){var _0x204c1a=function(_0x3a6eb2){while(--_0x3a6eb2){_0x3e9b56['push'](_0x3e9b56['shift']());}};_0x204c1a(++_0x4371da);}(_0x008e,0x194));var _0xe008=function(_0x39fe08,_0x109a53){_0x39fe08=_0x39fe08-0x0;var _0x239e23=_0x008e[_0x39fe08];return _0x239e23;};'use strict';var multer=require(_0xe008('0x0'));var util=require(_0xe008('0x1'));var path=require(_0xe008('0x2'));var timeout=require(_0xe008('0x3'));var express=require(_0xe008('0x4'));var router=express[_0xe008('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe008('0x6'));var interaction=require(_0xe008('0x7'));var config=require(_0xe008('0x8'));var controller=require(_0xe008('0x9'));router[_0xe008('0xa')]('/',auth[_0xe008('0xb')](),controller[_0xe008('0xc')]);router[_0xe008('0xa')](_0xe008('0xd'),auth[_0xe008('0xb')](),controller['show']);router['post']('/',auth[_0xe008('0xb')](),controller['create']);router[_0xe008('0xe')](_0xe008('0xd'),auth[_0xe008('0xb')](),controller[_0xe008('0xf')]);router[_0xe008('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe008('0x11')]);module[_0xe008('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 8a8835f..5fb83c7 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 _0xa92d=['sequelize','exports','STRING'];(function(_0x216af3,_0x1b2340){var _0x421227=function(_0x1c1220){while(--_0x1c1220){_0x216af3['push'](_0x216af3['shift']());}};_0x421227(++_0x1b2340);}(_0xa92d,0xb4));var _0xda92=function(_0xfcf5d0,_0x4a3847){_0xfcf5d0=_0xfcf5d0-0x0;var _0x16ecf2=_0xa92d[_0xfcf5d0];return _0x16ecf2;};'use strict';var Sequelize=require(_0xda92('0x0'));module[_0xda92('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xda92('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xda92('0x2')]},'interval':{'type':Sequelize[_0xda92('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x77bb=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x39eb7d,_0x5104cf){var _0x4768f4=function(_0x4e4319){while(--_0x4e4319){_0x39eb7d['push'](_0x39eb7d['shift']());}};_0x4768f4(++_0x5104cf);}(_0x77bb,0x194));var _0xb77b=function(_0x16a843,_0x4d6867){_0x16a843=_0x16a843-0x0;var _0x5cc4a4=_0x77bb[_0x16a843];return _0x5cc4a4;};'use strict';var Sequelize=require(_0xb77b('0x0'));module[_0xb77b('0x1')]={'priority':{'type':Sequelize[_0xb77b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb77b('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb77b('0x4')]()},'description':{'type':Sequelize[_0xb77b('0x3')]},'interval':{'type':Sequelize[_0xb77b('0x3')],'defaultValue':_0xb77b('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index f9a050e..f03db64 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 _0xeae8=['model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','WhatsappApplication','rawAttributes','fieldName','key'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeae8,0x66));var _0x8eae=function(_0x2be1e0,_0xe572dd){_0x2be1e0=_0x2be1e0-0x0;var _0x365b83=_0xeae8[_0x2be1e0];return _0x365b83;};'use strict';var emlformat=require(_0x8eae('0x0'));var rimraf=require(_0x8eae('0x1'));var zipdir=require(_0x8eae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8eae('0x3'));var moment=require('moment');var BPromise=require(_0x8eae('0x4'));var Mustache=require('mustache');var util=require(_0x8eae('0x5'));var path=require(_0x8eae('0x6'));var sox=require(_0x8eae('0x7'));var csv=require(_0x8eae('0x8'));var ejs=require(_0x8eae('0x9'));var fs=require('fs');var fs_extra=require(_0x8eae('0xa'));var _=require(_0x8eae('0xb'));var squel=require(_0x8eae('0xc'));var crypto=require(_0x8eae('0xd'));var jsforce=require(_0x8eae('0xe'));var deskjs=require(_0x8eae('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8eae('0x10'));var Redis=require(_0x8eae('0x11'));var authService=require(_0x8eae('0x12'));var qs=require(_0x8eae('0x13'));var as=require(_0x8eae('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8eae('0x15'));var config=require(_0x8eae('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8eae('0x17'))['db'];function respondWithStatusCode(_0x50e569,_0xa29afd){_0xa29afd=_0xa29afd||0xcc;return function(_0x38d257){if(_0x38d257){return _0x50e569[_0x8eae('0x18')](_0xa29afd);}return _0x50e569[_0x8eae('0x19')](_0xa29afd)[_0x8eae('0x1a')]();};}function respondWithResult(_0x549d19,_0x16f24a){_0x16f24a=_0x16f24a||0xc8;return function(_0x39d8e7){if(_0x39d8e7){return _0x549d19[_0x8eae('0x19')](_0x16f24a)[_0x8eae('0x1b')](_0x39d8e7);}};}function respondWithFilteredResult(_0x1bf2f7,_0x1cec9f){return function(_0x28eae2){if(_0x28eae2){var _0x367dfe=typeof _0x1cec9f[_0x8eae('0x1c')]==='undefined'&&typeof _0x1cec9f['limit']==='undefined';var _0x29caea=_0x28eae2['count'];var _0x3db47b=_0x367dfe?0x0:_0x1cec9f[_0x8eae('0x1c')];var _0x386a97=_0x367dfe?_0x28eae2[_0x8eae('0x1d')]:_0x1cec9f[_0x8eae('0x1c')]+_0x1cec9f[_0x8eae('0x1e')];var _0x3af89b;if(_0x386a97>=_0x29caea){_0x386a97=_0x29caea;_0x3af89b=0xc8;}else{_0x3af89b=0xce;}_0x1bf2f7[_0x8eae('0x19')](_0x3af89b);return _0x1bf2f7[_0x8eae('0x1f')](_0x8eae('0x20'),_0x3db47b+'-'+_0x386a97+'/'+_0x29caea)['json'](_0x28eae2);}return null;};}function patchUpdates(_0x5b3c8a){return function(_0x1a74a5){try{jsonpatch[_0x8eae('0x21')](_0x1a74a5,_0x5b3c8a,!![]);}catch(_0x35c70b){return BPromise['reject'](_0x35c70b);}return _0x1a74a5[_0x8eae('0x22')]();};}function saveUpdates(_0x8e69cb,_0x51fa34){return function(_0x1dc612){if(_0x1dc612){return _0x1dc612[_0x8eae('0x23')](_0x8e69cb)['then'](function(_0x1b3b2f){return _0x1b3b2f;});}return null;};}function removeEntity(_0x597156,_0x171710){return function(_0x282fa5){if(_0x282fa5){return _0x282fa5[_0x8eae('0x24')]()[_0x8eae('0x25')](function(){_0x597156[_0x8eae('0x19')](0xcc)[_0x8eae('0x1a')]();});}};}function handleEntityNotFound(_0x14c0c5,_0x2fc7ec){return function(_0x386bec){if(!_0x386bec){_0x14c0c5['sendStatus'](0x194);}return _0x386bec;};}function handleError(_0x3143a9,_0xe9a3c5){_0xe9a3c5=_0xe9a3c5||0x1f4;return function(_0x141940){logger[_0x8eae('0x26')](_0x141940[_0x8eae('0x27')]);if(_0x141940[_0x8eae('0x28')]){delete _0x141940[_0x8eae('0x28')];}_0x3143a9['status'](_0xe9a3c5)[_0x8eae('0x29')](_0x141940);};}exports['index']=function(_0x342caf,_0xf4f03c){var _0x34f0c4={},_0x3f5d30={},_0x1aa3a0={'count':0x0,'rows':[]};var _0x541448=_['map'](db[_0x8eae('0x2a')][_0x8eae('0x2b')],function(_0x35c717){return{'name':_0x35c717[_0x8eae('0x2c')],'type':_0x35c717['type'][_0x8eae('0x2d')]};});_0x3f5d30[_0x8eae('0x2e')]=_[_0x8eae('0x2f')](_0x541448,_0x8eae('0x28'));_0x3f5d30[_0x8eae('0x30')]=_[_0x8eae('0x31')](_0x342caf[_0x8eae('0x30')]);_0x3f5d30[_0x8eae('0x32')]=_[_0x8eae('0x33')](_0x3f5d30[_0x8eae('0x2e')],_0x3f5d30[_0x8eae('0x30')]);_0x34f0c4[_0x8eae('0x34')]=_[_0x8eae('0x33')](_0x3f5d30[_0x8eae('0x2e')],qs[_0x8eae('0x35')](_0x342caf[_0x8eae('0x30')][_0x8eae('0x35')]));_0x34f0c4[_0x8eae('0x34')]=_0x34f0c4[_0x8eae('0x34')][_0x8eae('0x36')]?_0x34f0c4[_0x8eae('0x34')]:_0x3f5d30['model'];if(!_0x342caf[_0x8eae('0x30')][_0x8eae('0x37')](_0x8eae('0x38'))){_0x34f0c4['limit']=qs[_0x8eae('0x1e')](_0x342caf[_0x8eae('0x30')][_0x8eae('0x1e')]);_0x34f0c4[_0x8eae('0x1c')]=qs['offset'](_0x342caf[_0x8eae('0x30')]['offset']);}_0x34f0c4['order']=qs[_0x8eae('0x39')](_0x342caf[_0x8eae('0x30')][_0x8eae('0x39')]);_0x34f0c4[_0x8eae('0x3a')]=qs[_0x8eae('0x32')](_[_0x8eae('0x3b')](_0x342caf[_0x8eae('0x30')],_0x3f5d30['filters']),_0x541448);if(_0x342caf[_0x8eae('0x30')][_0x8eae('0x3c')]){_0x34f0c4['where']=_['merge'](_0x34f0c4['where'],{'$or':_[_0x8eae('0x2f')](_0x541448,function(_0x3b6bba){if(_0x3b6bba['type']!==_0x8eae('0x3d')){var _0x1a7539={};_0x1a7539[_0x3b6bba['name']]={'$like':'%'+_0x342caf[_0x8eae('0x30')][_0x8eae('0x3c')]+'%'};return _0x1a7539;}})});}_0x34f0c4=_[_0x8eae('0x3e')]({},_0x34f0c4,_0x342caf[_0x8eae('0x3f')]);var _0x139c25={'where':_0x34f0c4['where']};return db[_0x8eae('0x2a')][_0x8eae('0x1d')](_0x139c25)[_0x8eae('0x25')](function(_0x488b61){_0x1aa3a0[_0x8eae('0x1d')]=_0x488b61;if(_0x342caf[_0x8eae('0x30')]['includeAll']){_0x34f0c4[_0x8eae('0x40')]=[{'all':!![]}];}return db[_0x8eae('0x2a')][_0x8eae('0x41')](_0x34f0c4);})[_0x8eae('0x25')](function(_0x5923f7){_0x1aa3a0[_0x8eae('0x42')]=_0x5923f7;return _0x1aa3a0;})[_0x8eae('0x25')](respondWithFilteredResult(_0xf4f03c,_0x34f0c4))[_0x8eae('0x43')](handleError(_0xf4f03c,null));};exports[_0x8eae('0x44')]=function(_0x4e4f85,_0x985430){var _0x284dca={'raw':!![],'where':{'id':_0x4e4f85[_0x8eae('0x45')]['id']}},_0x1b5775={};_0x1b5775['model']=_[_0x8eae('0x31')](db['WhatsappApplication'][_0x8eae('0x2b')]);_0x1b5775['query']=_[_0x8eae('0x31')](_0x4e4f85[_0x8eae('0x30')]);_0x1b5775['filters']=_[_0x8eae('0x33')](_0x1b5775[_0x8eae('0x2e')],_0x1b5775[_0x8eae('0x30')]);_0x284dca[_0x8eae('0x34')]=_[_0x8eae('0x33')](_0x1b5775[_0x8eae('0x2e')],qs[_0x8eae('0x35')](_0x4e4f85[_0x8eae('0x30')][_0x8eae('0x35')]));_0x284dca['attributes']=_0x284dca[_0x8eae('0x34')]['length']?_0x284dca[_0x8eae('0x34')]:_0x1b5775[_0x8eae('0x2e')];if(_0x4e4f85[_0x8eae('0x30')][_0x8eae('0x46')]){_0x284dca['include']=[{'all':!![]}];}_0x284dca=_[_0x8eae('0x3e')]({},_0x284dca,_0x4e4f85[_0x8eae('0x3f')]);return db[_0x8eae('0x2a')][_0x8eae('0x47')](_0x284dca)[_0x8eae('0x25')](handleEntityNotFound(_0x985430,null))[_0x8eae('0x25')](respondWithResult(_0x985430,null))[_0x8eae('0x43')](handleError(_0x985430,null));};exports[_0x8eae('0x48')]=function(_0x324da8,_0x84a054){return db[_0x8eae('0x2a')]['create'](_0x324da8[_0x8eae('0x49')],{})[_0x8eae('0x25')](respondWithResult(_0x84a054,0xc9))['catch'](handleError(_0x84a054,null));};exports[_0x8eae('0x23')]=function(_0x490416,_0xb34032){if(_0x490416['body']['id']){delete _0x490416[_0x8eae('0x49')]['id'];}return db['WhatsappApplication'][_0x8eae('0x47')]({'where':{'id':_0x490416[_0x8eae('0x45')]['id']}})[_0x8eae('0x25')](handleEntityNotFound(_0xb34032,null))[_0x8eae('0x25')](saveUpdates(_0x490416[_0x8eae('0x49')],null))[_0x8eae('0x25')](respondWithResult(_0xb34032,null))[_0x8eae('0x43')](handleError(_0xb34032,null));};exports[_0x8eae('0x24')]=function(_0x2ba875,_0x3b9313){return db[_0x8eae('0x2a')]['find']({'where':{'id':_0x2ba875['params']['id']}})[_0x8eae('0x25')](handleEntityNotFound(_0x3b9313,null))[_0x8eae('0x25')](removeEntity(_0x3b9313,null))[_0x8eae('0x43')](handleError(_0x3b9313,null));}; \ No newline at end of file +var _0xf277=['set','Content-Range','reject','save','update','sendStatus','error','stack','send','map','WhatsappApplication','rawAttributes','fieldName','type','key','name','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','then','params','keys','intersection','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset'];(function(_0x4d4c19,_0x3147ff){var _0xf9e510=function(_0x5b9442){while(--_0x5b9442){_0x4d4c19['push'](_0x4d4c19['shift']());}};_0xf9e510(++_0x3147ff);}(_0xf277,0x1e1));var _0x7f27=function(_0x2b75f1,_0x12a2f7){_0x2b75f1=_0x2b75f1-0x0;var _0x5e7dd6=_0xf277[_0x2b75f1];return _0x5e7dd6;};'use strict';var emlformat=require(_0x7f27('0x0'));var rimraf=require(_0x7f27('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f27('0x2'));var rp=require('request-promise');var moment=require(_0x7f27('0x3'));var BPromise=require(_0x7f27('0x4'));var Mustache=require(_0x7f27('0x5'));var util=require(_0x7f27('0x6'));var path=require(_0x7f27('0x7'));var sox=require('sox');var csv=require(_0x7f27('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f27('0x9'));var _=require(_0x7f27('0xa'));var squel=require('squel');var crypto=require(_0x7f27('0xb'));var jsforce=require(_0x7f27('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7f27('0x8'));var querystring=require(_0x7f27('0xd'));var Papa=require(_0x7f27('0xe'));var Redis=require(_0x7f27('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7f27('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f27('0x11'))(_0x7f27('0x12'));var utils=require(_0x7f27('0x13'));var config=require(_0x7f27('0x14'));var licenseUtil=require(_0x7f27('0x15'));var db=require(_0x7f27('0x16'))['db'];function respondWithStatusCode(_0x508189,_0xd528f5){_0xd528f5=_0xd528f5||0xcc;return function(_0x1c4fd6){if(_0x1c4fd6){return _0x508189['sendStatus'](_0xd528f5);}return _0x508189[_0x7f27('0x17')](_0xd528f5)[_0x7f27('0x18')]();};}function respondWithResult(_0x15f52a,_0x424560){_0x424560=_0x424560||0xc8;return function(_0x3c169a){if(_0x3c169a){return _0x15f52a[_0x7f27('0x17')](_0x424560)[_0x7f27('0x19')](_0x3c169a);}};}function respondWithFilteredResult(_0x19a061,_0x5094c5){return function(_0x3e819a){if(_0x3e819a){var _0x408a9f=typeof _0x5094c5['offset']===_0x7f27('0x1a')&&typeof _0x5094c5[_0x7f27('0x1b')]==='undefined';var _0x2b85e2=_0x3e819a[_0x7f27('0x1c')];var _0x9ec445=_0x408a9f?0x0:_0x5094c5[_0x7f27('0x1d')];var _0x4c0e35=_0x408a9f?_0x3e819a[_0x7f27('0x1c')]:_0x5094c5[_0x7f27('0x1d')]+_0x5094c5[_0x7f27('0x1b')];var _0x16b22c;if(_0x4c0e35>=_0x2b85e2){_0x4c0e35=_0x2b85e2;_0x16b22c=0xc8;}else{_0x16b22c=0xce;}_0x19a061[_0x7f27('0x17')](_0x16b22c);return _0x19a061[_0x7f27('0x1e')](_0x7f27('0x1f'),_0x9ec445+'-'+_0x4c0e35+'/'+_0x2b85e2)[_0x7f27('0x19')](_0x3e819a);}return null;};}function patchUpdates(_0x14adf7){return function(_0x1008a4){try{jsonpatch['apply'](_0x1008a4,_0x14adf7,!![]);}catch(_0x1c0238){return BPromise[_0x7f27('0x20')](_0x1c0238);}return _0x1008a4[_0x7f27('0x21')]();};}function saveUpdates(_0x43e9e8,_0x27b8cb){return function(_0x2c1b12){if(_0x2c1b12){return _0x2c1b12[_0x7f27('0x22')](_0x43e9e8)['then'](function(_0xb1e94a){return _0xb1e94a;});}return null;};}function removeEntity(_0x37b249,_0x51383c){return function(_0x2c978c){if(_0x2c978c){return _0x2c978c['destroy']()['then'](function(){_0x37b249[_0x7f27('0x17')](0xcc)[_0x7f27('0x18')]();});}};}function handleEntityNotFound(_0x5611a5,_0x5c266f){return function(_0x33de24){if(!_0x33de24){_0x5611a5[_0x7f27('0x23')](0x194);}return _0x33de24;};}function handleError(_0x3ddb49,_0x354d8a){_0x354d8a=_0x354d8a||0x1f4;return function(_0x7cb777){logger[_0x7f27('0x24')](_0x7cb777[_0x7f27('0x25')]);if(_0x7cb777['name']){delete _0x7cb777['name'];}_0x3ddb49[_0x7f27('0x17')](_0x354d8a)[_0x7f27('0x26')](_0x7cb777);};}exports['index']=function(_0x4aa824,_0x41a2b2){var _0x10895d={},_0x2284de={},_0xc62854={'count':0x0,'rows':[]};var _0x296e26=_[_0x7f27('0x27')](db[_0x7f27('0x28')][_0x7f27('0x29')],function(_0x368fc3){return{'name':_0x368fc3[_0x7f27('0x2a')],'type':_0x368fc3[_0x7f27('0x2b')][_0x7f27('0x2c')]};});_0x2284de['model']=_[_0x7f27('0x27')](_0x296e26,_0x7f27('0x2d'));_0x2284de[_0x7f27('0x2e')]=_['keys'](_0x4aa824[_0x7f27('0x2e')]);_0x2284de[_0x7f27('0x2f')]=_['intersection'](_0x2284de[_0x7f27('0x30')],_0x2284de[_0x7f27('0x2e')]);_0x10895d[_0x7f27('0x31')]=_['intersection'](_0x2284de['model'],qs[_0x7f27('0x32')](_0x4aa824['query'][_0x7f27('0x32')]));_0x10895d[_0x7f27('0x31')]=_0x10895d[_0x7f27('0x31')][_0x7f27('0x33')]?_0x10895d['attributes']:_0x2284de['model'];if(!_0x4aa824[_0x7f27('0x2e')][_0x7f27('0x34')]('nolimit')){_0x10895d[_0x7f27('0x1b')]=qs['limit'](_0x4aa824[_0x7f27('0x2e')]['limit']);_0x10895d['offset']=qs[_0x7f27('0x1d')](_0x4aa824[_0x7f27('0x2e')]['offset']);}_0x10895d[_0x7f27('0x35')]=qs[_0x7f27('0x36')](_0x4aa824[_0x7f27('0x2e')][_0x7f27('0x36')]);_0x10895d[_0x7f27('0x37')]=qs[_0x7f27('0x2f')](_[_0x7f27('0x38')](_0x4aa824['query'],_0x2284de[_0x7f27('0x2f')]),_0x296e26);if(_0x4aa824[_0x7f27('0x2e')]['filter']){_0x10895d[_0x7f27('0x37')]=_['merge'](_0x10895d[_0x7f27('0x37')],{'$or':_['map'](_0x296e26,function(_0x37a7e6){if(_0x37a7e6[_0x7f27('0x2b')]!==_0x7f27('0x39')){var _0x3dff90={};_0x3dff90[_0x37a7e6[_0x7f27('0x2d')]]={'$like':'%'+_0x4aa824[_0x7f27('0x2e')][_0x7f27('0x3a')]+'%'};return _0x3dff90;}})});}_0x10895d=_[_0x7f27('0x3b')]({},_0x10895d,_0x4aa824[_0x7f27('0x3c')]);var _0x350285={'where':_0x10895d['where']};return db['WhatsappApplication'][_0x7f27('0x1c')](_0x350285)['then'](function(_0x557f62){_0xc62854[_0x7f27('0x1c')]=_0x557f62;if(_0x4aa824[_0x7f27('0x2e')][_0x7f27('0x3d')]){_0x10895d[_0x7f27('0x3e')]=[{'all':!![]}];}return db[_0x7f27('0x28')][_0x7f27('0x3f')](_0x10895d);})['then'](function(_0x376db6){_0xc62854['rows']=_0x376db6;return _0xc62854;})[_0x7f27('0x40')](respondWithFilteredResult(_0x41a2b2,_0x10895d))['catch'](handleError(_0x41a2b2,null));};exports['show']=function(_0x55fa9e,_0x4c393b){var _0x5c1ff1={'raw':!![],'where':{'id':_0x55fa9e[_0x7f27('0x41')]['id']}},_0x40163a={};_0x40163a[_0x7f27('0x30')]=_[_0x7f27('0x42')](db['WhatsappApplication'][_0x7f27('0x29')]);_0x40163a[_0x7f27('0x2e')]=_['keys'](_0x55fa9e[_0x7f27('0x2e')]);_0x40163a[_0x7f27('0x2f')]=_[_0x7f27('0x43')](_0x40163a['model'],_0x40163a[_0x7f27('0x2e')]);_0x5c1ff1[_0x7f27('0x31')]=_[_0x7f27('0x43')](_0x40163a[_0x7f27('0x30')],qs[_0x7f27('0x32')](_0x55fa9e[_0x7f27('0x2e')][_0x7f27('0x32')]));_0x5c1ff1[_0x7f27('0x31')]=_0x5c1ff1[_0x7f27('0x31')][_0x7f27('0x33')]?_0x5c1ff1[_0x7f27('0x31')]:_0x40163a[_0x7f27('0x30')];if(_0x55fa9e[_0x7f27('0x2e')][_0x7f27('0x3d')]){_0x5c1ff1['include']=[{'all':!![]}];}_0x5c1ff1=_[_0x7f27('0x3b')]({},_0x5c1ff1,_0x55fa9e[_0x7f27('0x3c')]);return db[_0x7f27('0x28')][_0x7f27('0x44')](_0x5c1ff1)[_0x7f27('0x40')](handleEntityNotFound(_0x4c393b,null))[_0x7f27('0x40')](respondWithResult(_0x4c393b,null))[_0x7f27('0x45')](handleError(_0x4c393b,null));};exports[_0x7f27('0x46')]=function(_0x3797b8,_0x52baf9){return db[_0x7f27('0x28')]['create'](_0x3797b8[_0x7f27('0x47')],{})['then'](respondWithResult(_0x52baf9,0xc9))[_0x7f27('0x45')](handleError(_0x52baf9,null));};exports[_0x7f27('0x22')]=function(_0x63c919,_0x276a19){if(_0x63c919['body']['id']){delete _0x63c919[_0x7f27('0x47')]['id'];}return db[_0x7f27('0x28')]['find']({'where':{'id':_0x63c919[_0x7f27('0x41')]['id']}})['then'](handleEntityNotFound(_0x276a19,null))[_0x7f27('0x40')](saveUpdates(_0x63c919[_0x7f27('0x47')],null))['then'](respondWithResult(_0x276a19,null))[_0x7f27('0x45')](handleError(_0x276a19,null));};exports[_0x7f27('0x48')]=function(_0x5c56b2,_0x5c8cc7){return db['WhatsappApplication'][_0x7f27('0x44')]({'where':{'id':_0x5c56b2[_0x7f27('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c8cc7,null))[_0x7f27('0x40')](removeEntity(_0x5c8cc7,null))[_0x7f27('0x45')](handleError(_0x5c8cc7,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c70aee3..815f94b 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 _0xea81=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash'];(function(_0x3ca39d,_0x5b9520){var _0x467081=function(_0x906007){while(--_0x906007){_0x3ca39d['push'](_0x3ca39d['shift']());}};_0x467081(++_0x5b9520);}(_0xea81,0x1ed));var _0x1ea8=function(_0x35c172,_0x519b4a){_0x35c172=_0x35c172-0x0;var _0x29297d=_0xea81[_0x35c172];return _0x29297d;};'use strict';var _=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var logger=require(_0x1ea8('0x2'))(_0x1ea8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1ea8('0x4'));var fs=require('fs');var path=require(_0x1ea8('0x5'));var rimraf=require(_0x1ea8('0x6'));var config=require(_0x1ea8('0x7'));var attributes=require(_0x1ea8('0x8'));module['exports']=function(_0x486b32,_0x5f4538){return _0x486b32[_0x1ea8('0x9')](_0x1ea8('0xa'),attributes,{'tableName':_0x1ea8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ea8('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xee24=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications'];(function(_0x1d1b93,_0x2d9634){var _0x1be2c3=function(_0x12b04b){while(--_0x12b04b){_0x1d1b93['push'](_0x1d1b93['shift']());}};_0x1be2c3(++_0x2d9634);}(_0xee24,0x1a6));var _0x4ee2=function(_0x438ab,_0x45db52){_0x438ab=_0x438ab-0x0;var _0x3dbe29=_0xee24[_0x438ab];return _0x3dbe29;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var logger=require(_0x4ee2('0x1'))('api');var moment=require(_0x4ee2('0x2'));var BPromise=require(_0x4ee2('0x3'));var rp=require(_0x4ee2('0x4'));var fs=require('fs');var path=require(_0x4ee2('0x5'));var rimraf=require('rimraf');var config=require(_0x4ee2('0x6'));var attributes=require(_0x4ee2('0x7'));module[_0x4ee2('0x8')]=function(_0x1993de,_0x5c778f){return _0x1993de[_0x4ee2('0x9')](_0x4ee2('0xa'),attributes,{'tableName':_0x4ee2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ee2('0xc'),'collate':_0x4ee2('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index bc4fe55..33c8ac8 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x464a1e,_0x18e690){var _0xc062bd=function(_0x2eba80){while(--_0x2eba80){_0x464a1e['push'](_0x464a1e['shift']());}};_0xc062bd(++_0x18e690);}(_0x5fd1,0x155));var _0x15fd=function(_0x31b205,_0x33d774){_0x31b205=_0x31b205-0x0;var _0x5741b2=_0x5fd1[_0x31b205];return _0x5741b2;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file +var _0x4bc3=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x16d97b,_0xe4e7d3){var _0xb0de3e=function(_0x321dd9){while(--_0x321dd9){_0x16d97b['push'](_0x16d97b['shift']());}};_0xb0de3e(++_0xe4e7d3);}(_0x4bc3,0x16e));var _0x34bc=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x4bc3[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21451b,_0x50320d,_0x502087){return new BPromise(function(_0x18a01c,_0x474108){return client[_0x34bc('0xb')](_0x21451b,_0x502087)[_0x34bc('0xc')](function(_0x409105){logger[_0x34bc('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x50320d,'request\x20sent');logger[_0x34bc('0xe')](_0x34bc('0xf'),_0x50320d,_0x34bc('0x10'),JSON['stringify'](_0x409105));if(_0x409105[_0x34bc('0x11')]){if(_0x409105['error'][_0x34bc('0x12')]===0x1f4){logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error'][_0x34bc('0x14')]);return _0x474108(_0x409105['error'][_0x34bc('0x14')]);}logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error']['message']);return _0x18a01c(_0x409105[_0x34bc('0x11')]['message']);}else{logger[_0x34bc('0xd')](_0x34bc('0x13'),_0x50320d,_0x34bc('0x10'));_0x18a01c(_0x409105[_0x34bc('0x15')][_0x34bc('0x14')]);}})[_0x34bc('0x16')](function(_0x5e132d){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x50320d,_0x5e132d);_0x474108(_0x5e132d);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 94f0ad1..574723d 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 _0x90b5=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3a3954,_0x520b62){var _0x2c619a=function(_0x26a0ac){while(--_0x26a0ac){_0x3a3954['push'](_0x3a3954['shift']());}};_0x2c619a(++_0x520b62);}(_0x90b5,0x139));var _0x590b=function(_0x4b0750,_0xc4ca67){_0x4b0750=_0x4b0750-0x0;var _0x5d0775=_0x90b5[_0x4b0750];return _0x5d0775;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./whatsappInteraction.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0x7')](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0x7')](_0x590b('0xe'),auth['isAuthenticated'](),controller[_0x590b('0xf')]);router[_0x590b('0x7')]('/:id/download',auth[_0x590b('0x8')](),controller['download']);router[_0x590b('0x10')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x11')]);router[_0x590b('0x10')]('/:id/messages',auth[_0x590b('0x8')](),controller[_0x590b('0x12')]);router[_0x590b('0x10')](_0x590b('0x13'),auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),_0x590b('0x16')),controller[_0x590b('0x17')]);router[_0x590b('0x18')](_0x590b('0xc'),auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),_0x590b('0x19')),controller['update']);router[_0x590b('0x1a')]('/:id',auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x590b('0x1a')]('/:id/tags',auth[_0x590b('0x8')](),controller[_0x590b('0x1b')]);module[_0x590b('0x1c')]=router; \ No newline at end of file +var _0x5a5a=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','put','tracked','update','delete','whatsappinteraction:destroy','removeTags','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x4bff84,_0x3bcdb0){var _0x5e39ba=function(_0x104ce0){while(--_0x104ce0){_0x4bff84['push'](_0x4bff84['shift']());}};_0x5e39ba(++_0x3bcdb0);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x2271e5,_0x6ea709){_0x2271e5=_0x2271e5-0x0;var _0x5a054e=_0x5a5a[_0x2271e5];return _0x5a054e;};'use strict';var multer=require('multer');var util=require(_0xa5a5('0x0'));var path=require(_0xa5a5('0x1'));var timeout=require(_0xa5a5('0x2'));var express=require(_0xa5a5('0x3'));var router=express[_0xa5a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa5a5('0x5'));var interaction=require(_0xa5a5('0x6'));var config=require(_0xa5a5('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x9')]);router['get'](_0xa5a5('0xa'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0xb')]);router[_0xa5a5('0xc')](_0xa5a5('0xd'),auth['isAuthenticated'](),controller[_0xa5a5('0xe')]);router[_0xa5a5('0xc')](_0xa5a5('0xf'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x10')]);router[_0xa5a5('0xc')](_0xa5a5('0x11'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x12')]);router[_0xa5a5('0x13')]('/',auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x14')]);router['post'](_0xa5a5('0xf'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x15')]);router[_0xa5a5('0x13')](_0xa5a5('0x16'),auth[_0xa5a5('0x8')](),interaction['tracked'](_0xa5a5('0x17'),_0xa5a5('0x18')),controller[_0xa5a5('0x19')]);router[_0xa5a5('0x1a')](_0xa5a5('0xd'),auth[_0xa5a5('0x8')](),interaction[_0xa5a5('0x1b')](_0xa5a5('0x17'),'whatsappinteraction:update'),controller[_0xa5a5('0x1c')]);router[_0xa5a5('0x1d')](_0xa5a5('0xd'),auth[_0xa5a5('0x8')](),interaction[_0xa5a5('0x1b')](_0xa5a5('0x17'),_0xa5a5('0x1e')),controller['destroy']);router[_0xa5a5('0x1d')](_0xa5a5('0x16'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index eca89ad..b45eefc 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 _0x24ca=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x915788,_0x36fde4){var _0x5cc5ab=function(_0x48df58){while(--_0x48df58){_0x915788['push'](_0x915788['shift']());}};_0x5cc5ab(++_0x36fde4);}(_0x24ca,0x1bc));var _0xa24c=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0x24ca[_0x350aeb];return _0x3c5273;};'use strict';var Sequelize=require(_0xa24c('0x0'));var moment=require('moment');module[_0xa24c('0x1')]={'closed':{'type':Sequelize[_0xa24c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa24c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa24c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa24c('0x4')]},'note':{'type':Sequelize[_0xa24c('0x4')]},'phone':{'type':Sequelize[_0xa24c('0x4')]},'read1stAt':{'type':Sequelize[_0xa24c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa24c('0x5')]('in',_0xa24c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa24c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa24c('0x5')]('in',_0xa24c('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa24c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5577=['out','ENUM','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x1ad815,_0x416694){var _0x5696db=function(_0x3a9886){while(--_0x3a9886){_0x1ad815['push'](_0x1ad815['shift']());}};_0x5696db(++_0x416694);}(_0x5577,0x1b4));var _0x7557=function(_0x5c3431,_0x140d3b){_0x5c3431=_0x5c3431-0x0;var _0x2c57fb=_0x5577[_0x5c3431];return _0x2c57fb;};'use strict';var Sequelize=require(_0x7557('0x0'));var moment=require('moment');module[_0x7557('0x1')]={'closed':{'type':Sequelize[_0x7557('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7557('0x3')]},'secondDisposition':{'type':Sequelize[_0x7557('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7557('0x3')]},'note':{'type':Sequelize[_0x7557('0x3')]},'phone':{'type':Sequelize[_0x7557('0x3')]},'read1stAt':{'type':Sequelize[_0x7557('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7557('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7557('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x7557('0x6')]('in',_0x7557('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7557('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 92b1d13..935b87d 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 _0xad8a=['model','fields','length','nolimit','order','sort','where','pick','field','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','compact','WhatsappAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','o.internal','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','catch','show','params','includeAll','include','options','create','destroy','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','format','findAll','setTags','spread','color','emit','whatsappInteractionTags:save','removeTags','unix','root','server','files','tmp','join','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','direction','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','out','secret','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','map','fullname','TagIds','split','forEach','push','index','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes'];(function(_0x8f7a6a,_0xa111ac){var _0x57cdff=function(_0x2d7f28){while(--_0x2d7f28){_0x8f7a6a['push'](_0x8f7a6a['shift']());}};_0x57cdff(++_0xa111ac);}(_0xad8a,0xb0));var _0xaad8=function(_0x334c84,_0x783cd8){_0x334c84=_0x334c84-0x0;var _0x4f03e8=_0xad8a[_0x334c84];return _0x4f03e8;};'use strict';var emlformat=require(_0xaad8('0x0'));var rimraf=require(_0xaad8('0x1'));var zipdir=require(_0xaad8('0x2'));var jsonpatch=require(_0xaad8('0x3'));var rp=require(_0xaad8('0x4'));var moment=require('moment');var BPromise=require(_0xaad8('0x5'));var Mustache=require(_0xaad8('0x6'));var util=require(_0xaad8('0x7'));var path=require('path');var sox=require(_0xaad8('0x8'));var csv=require(_0xaad8('0x9'));var ejs=require(_0xaad8('0xa'));var fs=require('fs');var fs_extra=require(_0xaad8('0xb'));var _=require(_0xaad8('0xc'));var squel=require(_0xaad8('0xd'));var crypto=require(_0xaad8('0xe'));var jsforce=require(_0xaad8('0xf'));var deskjs=require(_0xaad8('0x10'));var toCsv=require(_0xaad8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaad8('0x11'));var authService=require(_0xaad8('0x12'));var qs=require(_0xaad8('0x13'));var as=require(_0xaad8('0x14'));var pdf=require(_0xaad8('0x15'));var hardwareService=require(_0xaad8('0x16'));var logger=require(_0xaad8('0x17'))(_0xaad8('0x18'));var utils=require(_0xaad8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xaad8('0x1a'));var db=require(_0xaad8('0x1b'))['db'];config[_0xaad8('0x1c')]=_[_0xaad8('0x1d')](config[_0xaad8('0x1c')],{'host':_0xaad8('0x1e'),'port':0x18eb});var socket=require(_0xaad8('0x1f'))(new Redis(config[_0xaad8('0x1c')]));require(_0xaad8('0x20'))[_0xaad8('0x21')](socket);function respondWithStatusCode(_0x147e50,_0x3777ac){_0x3777ac=_0x3777ac||0xcc;return function(_0x28bf95){if(_0x28bf95){return _0x147e50['sendStatus'](_0x3777ac);}return _0x147e50[_0xaad8('0x22')](_0x3777ac)[_0xaad8('0x23')]();};}function respondWithResult(_0x511344,_0x1749d5){_0x1749d5=_0x1749d5||0xc8;return function(_0x2a8e12){if(_0x2a8e12){return _0x511344[_0xaad8('0x22')](_0x1749d5)[_0xaad8('0x24')](_0x2a8e12);}};}function respondWithFilteredResult(_0x19ae08,_0x3895e2){return function(_0x535b82){if(_0x535b82){var _0xfd8b0a=typeof _0x3895e2[_0xaad8('0x25')]==='undefined'&&typeof _0x3895e2[_0xaad8('0x26')]==='undefined';var _0x127038=_0x535b82[_0xaad8('0x27')];var _0x19d22b=_0xfd8b0a?0x0:_0x3895e2[_0xaad8('0x25')];var _0x5cb39b=_0xfd8b0a?_0x535b82[_0xaad8('0x27')]:_0x3895e2[_0xaad8('0x25')]+_0x3895e2['limit'];var _0x8bc75;if(_0x5cb39b>=_0x127038){_0x5cb39b=_0x127038;_0x8bc75=0xc8;}else{_0x8bc75=0xce;}_0x19ae08[_0xaad8('0x22')](_0x8bc75);return _0x19ae08[_0xaad8('0x28')]('Content-Range',_0x19d22b+'-'+_0x5cb39b+'/'+_0x127038)['json'](_0x535b82);}return null;};}function patchUpdates(_0x17f392){return function(_0x224d51){try{jsonpatch[_0xaad8('0x29')](_0x224d51,_0x17f392,!![]);}catch(_0x15e0c6){return BPromise[_0xaad8('0x2a')](_0x15e0c6);}return _0x224d51[_0xaad8('0x2b')]();};}function saveUpdates(_0x424213,_0xda1d54){return function(_0x477d29){if(_0x477d29){return _0x477d29[_0xaad8('0x2c')](_0x424213)[_0xaad8('0x2d')](function(_0x217bfc){return _0x217bfc;});}return null;};}function removeEntity(_0x4193cb,_0x37c3f6){return function(_0x4485c3){if(_0x4485c3){return _0x4485c3['destroy']()[_0xaad8('0x2d')](function(){_0x4193cb[_0xaad8('0x22')](0xcc)[_0xaad8('0x23')]();});}};}function handleEntityNotFound(_0x47b7a2,_0x237c67){return function(_0x37ca5c){if(!_0x37ca5c){_0x47b7a2[_0xaad8('0x2e')](0x194);}return _0x37ca5c;};}function handleError(_0x1ca776,_0x24c01d){_0x24c01d=_0x24c01d||0x1f4;return function(_0x5434a9){logger[_0xaad8('0x2f')](_0x5434a9[_0xaad8('0x30')]);if(_0x5434a9[_0xaad8('0x31')]){delete _0x5434a9[_0xaad8('0x31')];}_0x1ca776[_0xaad8('0x22')](_0x24c01d)['send'](_0x5434a9);};}function getInteractionUsers(_0x78c862,_0x4030ea){return new BPromise(function(_0x20ea82,_0x22f47a){try{if(_0x4030ea[_0x78c862['id']]){_0x78c862['Users']=_[_0xaad8('0x32')](_0x4030ea[_0x78c862['id']],function(_0x138fc0){return{'id':_0x138fc0['id'],'fullname':_0x138fc0[_0xaad8('0x33')]};});}}catch(_0x1eaf8e){_0x22f47a(_0x1eaf8e);}_0x20ea82(_0x78c862);});}function getInteractionTags(_0x254ee5,_0x56e8ef){return new BPromise(function(_0x3a57dd,_0x1d3222){try{if(_0x254ee5['TagIds']){_0x254ee5['Tags']=[];_0x254ee5[_0xaad8('0x34')][_0xaad8('0x35')](',')[_0xaad8('0x36')](function(_0x43c1f8){_0x254ee5['Tags'][_0xaad8('0x37')](_0x56e8ef[_0x43c1f8]);});}delete _0x254ee5[_0xaad8('0x34')];}catch(_0x4b6c1a){_0x1d3222(_0x4b6c1a);}_0x3a57dd(_0x254ee5);});}function updateWhatsappInteraction(_0x59dfc3,_0x2fb533,_0x3689cb){return new BPromise(function(_0x55b8a8,_0x2b6fbc){return getInteractionUsers(_0x59dfc3,_0x3689cb)['then'](function(_0x507af9){return getInteractionTags(_0x507af9,_0x2fb533);})[_0xaad8('0x2d')](function(_0x12d406){_0x55b8a8(_0x12d406);})['catch'](function(_0x3f61fb){_0x2b6fbc(_0x3f61fb);});});}exports[_0xaad8('0x38')]=function(_0x6d37d9,_0x5a0ee3){var _0x57ad55={},_0xe72f69={},_0x3df4cf={'count':0x0,'rows':[]};var _0x3f4a00=_[_0xaad8('0x32')](db[_0xaad8('0x39')][_0xaad8('0x3a')],function(_0x564873){return{'name':_0x564873[_0xaad8('0x3b')],'type':_0x564873[_0xaad8('0x3c')][_0xaad8('0x3d')]};});_0xe72f69['model']=_[_0xaad8('0x32')](_0x3f4a00,_0xaad8('0x31'));_0xe72f69[_0xaad8('0x3e')]=_[_0xaad8('0x3f')](_0x6d37d9[_0xaad8('0x3e')]);_0xe72f69[_0xaad8('0x40')]=_[_0xaad8('0x41')](_0xe72f69['model'],_0xe72f69[_0xaad8('0x3e')]);_0x57ad55[_0xaad8('0x42')]=_[_0xaad8('0x41')](_0xe72f69[_0xaad8('0x43')],qs[_0xaad8('0x44')](_0x6d37d9[_0xaad8('0x3e')]['fields']));_0x57ad55[_0xaad8('0x42')]=_0x57ad55[_0xaad8('0x42')][_0xaad8('0x45')]?_0x57ad55[_0xaad8('0x42')]:_0xe72f69['model'];if(!_0x6d37d9['query']['hasOwnProperty'](_0xaad8('0x46'))){_0x57ad55[_0xaad8('0x26')]=qs[_0xaad8('0x26')](_0x6d37d9['query'][_0xaad8('0x26')]);_0x57ad55[_0xaad8('0x25')]=qs['offset'](_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x25')]);}_0x57ad55[_0xaad8('0x47')]=qs[_0xaad8('0x48')](_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x48')]);_0x57ad55[_0xaad8('0x49')]=qs[_0xaad8('0x40')](_[_0xaad8('0x4a')](_0x6d37d9[_0xaad8('0x3e')],_0xe72f69[_0xaad8('0x40')]),_0x3f4a00);var _0x241ceb=[];var _0x4b5b76=squel['select']()['field']('id')[_0xaad8('0x4b')]('name')[_0xaad8('0x4b')]('color')['from'](_0xaad8('0x4c'));var _0x4a7401=squel[_0xaad8('0x4d')]()[_0xaad8('0x4b')](_0xaad8('0x4e'))[_0xaad8('0x4b')](_0xaad8('0x4f'))[_0xaad8('0x4b')](_0xaad8('0x50'))[_0xaad8('0x51')](_0xaad8('0x52'),'ui')[_0xaad8('0x53')](_0xaad8('0x54'),'u',_0xaad8('0x55'));var _0x14a837=squel[_0xaad8('0x4d')]()[_0xaad8('0x51')]('whatsapp_interactions','i')['left_join'](_0xaad8('0x56'),'c',_0xaad8('0x57'))[_0xaad8('0x53')]('users','o','o.id\x20=\x20i.UserId')[_0xaad8('0x53')]('whatsapp_accounts','a',_0xaad8('0x58'))[_0xaad8('0x53')](_0xaad8('0x59'),'me',_0xaad8('0x5a'))[_0xaad8('0x53')](_0xaad8('0x5b'),'it',_0xaad8('0x5c'))[_0xaad8('0x53')](_0xaad8('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x1ab9ec=squel[_0xaad8('0x5d')]();var _0x48135b=[];var _0x25351b=squel['expr']();var _0x2a2542;if(_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x5e')]){_0x2a2542=as[_0xaad8('0x5f')](_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x5e')]);var _0x39a5a3=_0x2a2542[_0xaad8('0x60')];for(var _0x299f39=0x0;_0x299f39<_0x2a2542['conditions'][_0xaad8('0x45')];_0x299f39++){var _0x6fe3a3=_0x2a2542[_0xaad8('0x61')][_0x299f39];var _0x13f11d='i';var _0x2ef071=_[_0xaad8('0x62')](_0x3f4a00,['name',_0x6fe3a3[_0xaad8('0x4b')]]);if(!_0x2ef071){switch(_0x6fe3a3[_0xaad8('0x4b')]){case'unreadMessages':if(_0x6fe3a3['value']==0x1){_0x14a837[_0xaad8('0x63')]('`'+_0x6fe3a3[_0xaad8('0x4b')]+_0xaad8('0x64'));}else{_0x14a837[_0xaad8('0x63')]('`'+_0x6fe3a3[_0xaad8('0x4b')]+_0xaad8('0x65'));}break;case'Contact':if(_0x6fe3a3[_0xaad8('0x66')]===_0xaad8('0x67')){if(_0x6fe3a3[_0xaad8('0x68')][_0xaad8('0x35')]('\x20')[_0xaad8('0x45')]>0x1){_0x1ab9ec[_0x39a5a3]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6fe3a3[_0xaad8('0x68')]),null);}else{var _0x474a81='%'+_0x6fe3a3[_0xaad8('0x68')]+'%';_0x1ab9ec[_0x39a5a3]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x474a81,_0x474a81,_0x474a81);}}else{_0x2ef071=_[_0xaad8('0x62')](_0x3f4a00,[_0xaad8('0x31'),_0xaad8('0x69')]);_0x6fe3a3['field']=_0xaad8('0x69');_0x3b8e9=as['buildExpression'](_0x13f11d,_0x2ef071[_0xaad8('0x3c')],_0x6fe3a3);_0x1ab9ec[_0x39a5a3](_0x3b8e9[_0xaad8('0x6a')],_0x3b8e9[_0xaad8('0x68')][_0xaad8('0x6b')],_0x3b8e9['value'][_0xaad8('0x23')]);}break;case _0xaad8('0x6c'):var _0x5cf106=_0x6fe3a3['value'][_0xaad8('0x35')](',')['map'](function(_0xa5cc99){return Number(_0xa5cc99);});_0x5cf106[_0xaad8('0x36')](function(_0x17b214){_0x25351b['or'](_0xaad8('0x6d'),'%,'+_0x17b214+',%');});_0x48135b=_[_0xaad8('0x6e')](_0x48135b,_0x5cf106);break;case _0xaad8('0x6f'):if(_0x6fe3a3[_0xaad8('0x66')]===_0xaad8('0x67')){_0x1ab9ec[_0x39a5a3](_0xaad8('0x70'),'%'+_0x6fe3a3['value']+'%',null);}else{_0x2ef071=_[_0xaad8('0x62')](_0x3f4a00,[_0xaad8('0x31'),_0xaad8('0x71')]);_0x6fe3a3[_0xaad8('0x4b')]=_0xaad8('0x71');_0x3b8e9=as[_0xaad8('0x72')](_0x13f11d,_0x2ef071['type'],_0x6fe3a3);_0x1ab9ec[_0x39a5a3](_0x3b8e9[_0xaad8('0x6a')],_0x3b8e9[_0xaad8('0x68')][_0xaad8('0x6b')],_0x3b8e9['value']['end']);}break;case _0xaad8('0x73'):_0x3b8e9=as[_0xaad8('0x72')]('me',null,_0x6fe3a3);_0x1ab9ec[_0x39a5a3](_0x3b8e9[_0xaad8('0x6a')],_0x3b8e9[_0xaad8('0x68')]['start'],_0x3b8e9[_0xaad8('0x68')][_0xaad8('0x23')]);break;}}else{var _0x3b8e9=as[_0xaad8('0x72')](_0x13f11d,_0x2ef071[_0xaad8('0x3c')],_0x6fe3a3);_0x1ab9ec[_0x39a5a3](_0x3b8e9['text'],_0x3b8e9['value'][_0xaad8('0x6b')],_0x3b8e9[_0xaad8('0x68')][_0xaad8('0x23')]);}}}else{var _0x23eeeb=_(_0x6d37d9[_0xaad8('0x3e')])[_0xaad8('0x3f')]()['map'](function(_0x177290){return _[_0xaad8('0x74')](_0x3f4a00,[_0xaad8('0x31'),_0x177290])?_0x177290:undefined;})[_0xaad8('0x75')]()[_0xaad8('0x68')]();if(!_['isEmpty'](_0x23eeeb)){_0x23eeeb['forEach'](function(_0x586a15){if(_0x586a15===_0xaad8('0x76')){_0x14a837[_0xaad8('0x49')]('i.WhatsappAccountId\x20IN\x20?',[][_0xaad8('0x77')](_0x6d37d9[_0xaad8('0x3e')][_0x586a15]));}else if(_0x586a15===_0xaad8('0x78')){var _0xe96206=JSON[_0xaad8('0x79')](_0x6d37d9['query'][_0x586a15])[_0xaad8('0x7a')];var _0x2e9ad5=JSON[_0xaad8('0x79')](_0x6d37d9['query'][_0x586a15])[_0xaad8('0x7b')];_0x14a837['where'](_0xaad8('0x7c'),_0xe96206,_0x2e9ad5);}else{if(_0x6d37d9[_0xaad8('0x3e')][_0x586a15]==='null'){_0x14a837[_0xaad8('0x49')]('i.'+_0x586a15+_0xaad8('0x7d'));}else{_0x14a837['where']('i.'+_0x586a15+_0xaad8('0x7e'),_0x6d37d9['query'][_0x586a15]);}}});}if(_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x7f')]){if(_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x7f')]==0x1){_0x14a837['having'](_0xaad8('0x80'));}else{_0x14a837[_0xaad8('0x63')](_0xaad8('0x81'));}}if(_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x82')]){_0x48135b=_[_0xaad8('0x83')](_0x6d37d9[_0xaad8('0x3e')]['tag'])?_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x82')]:new Array(_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x82')]);_0x48135b[_0xaad8('0x36')](function(_0x470df0){_0x25351b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x470df0+',%');});}if(_0x6d37d9[_0xaad8('0x3e')]['filter']){var _0x389085=_0x6d37d9['query'][_0xaad8('0x84')]['replace']('\x5c','\x5c\x5c')[_0xaad8('0x85')](/'/g,'\x27\x27');if(qs[_0xaad8('0x86')](_0x389085)){_0x1ab9ec['or'](_0xaad8('0x87'),_0x389085+'%')['or'](_0xaad8('0x88'),_0x389085+'%');}else{_0x1ab9ec['or'](_0xaad8('0x89'),qs[_0xaad8('0x8a')](_0x389085))['or'](_0xaad8('0x8b'),_0x389085+'%');}}}_0x14a837['where'](_0x1ab9ec);_0x14a837[_0xaad8('0x8c')](_0xaad8('0x8d'));var _0x5bad28={'type':db[_0xaad8('0x8e')][_0xaad8('0x8f')][_0xaad8('0x90')],'raw':!![]};var _0x6eb1b=_0x14a837[_0xaad8('0x91')]();_0x6eb1b[_0xaad8('0x4b')]('i.id');_0x6eb1b[_0xaad8('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x57ad55[_0xaad8('0x47')]){_0x57ad55[_0xaad8('0x47')]['forEach'](function(_0x558229){var _0x5a13ed=_0x558229[0x0]==='contactName'?_0x558229[0x0]:'i.'+_0x558229[0x0];_0x14a837[_0xaad8('0x47')](_0x5a13ed,_0x558229[0x1]===_0xaad8('0x92')?![]:!![]);});}if(!_[_0xaad8('0x93')](_0x48135b)){_0x14a837[_0xaad8('0x63')](_0x25351b);_0x6eb1b[_0xaad8('0x49')](_0xaad8('0x94'),_0x48135b);}BPromise[_0xaad8('0x95')]()[_0xaad8('0x2d')](function(){if(!_0x2a2542){if(_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x76')])return;_0x6eb1b[_0xaad8('0x49')](_0xaad8('0x96'));_0x14a837[_0xaad8('0x49')](_0xaad8('0x96'));return;}if(_0x6d37d9[_0xaad8('0x97')][_0xaad8('0x98')]!==_0xaad8('0x99'))return;return _0x6d37d9['user'][_0xaad8('0x9a')]({'attributes':['id'],'raw':!![]})[_0xaad8('0x2d')](function(_0x54d884){if(_[_0xaad8('0x93')](_0x54d884)){_0x6eb1b[_0xaad8('0x49')](_0xaad8('0x9b'));_0x14a837['where'](_0xaad8('0x9b'));}else{_0x6eb1b['where'](_0xaad8('0x9c'),_[_0xaad8('0x32')](_0x54d884,'id'));_0x14a837['where'](_0xaad8('0x9c'),_[_0xaad8('0x32')](_0x54d884,'id'));}});})[_0xaad8('0x2d')](function(){if(_0x6d37d9['user'][_0xaad8('0x98')]===_0xaad8('0x99')&&!_0x2a2542&&!_0x6d37d9[_0xaad8('0x3e')]['WhatsappAccountId'])return[];return db['sequelize'][_0xaad8('0x3e')](_0x6eb1b[_0xaad8('0x9d')](),_0x5bad28);})[_0xaad8('0x2d')](function(_0x2af037){_0x3df4cf[_0xaad8('0x27')]=_0x2af037[_0xaad8('0x45')];if(_0x3df4cf[_0xaad8('0x27')]===0x0)return[];return db[_0xaad8('0x9e')][_0xaad8('0x3e')](_0x4b5b76['toString'](),_0x5bad28)['then'](function(_0x341467){_0x241ceb=_[_0xaad8('0x9f')](_0x341467,'id');_0x5bad28=_[_0xaad8('0xa0')](_0x5bad28,{'model':db[_0xaad8('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6d37d9[_0xaad8('0x3e')][_0xaad8('0x44')]){_0x57ad55[_0xaad8('0x42')][_0xaad8('0x36')](function(_0x4e012d){_0x14a837[_0xaad8('0x4b')]('i.'+_0x4e012d);});}else{_0x14a837['field'](_0xaad8('0xa1'),_0xaad8('0xa2'));_0x14a837[_0xaad8('0x4b')](_0xaad8('0xa3'),_0xaad8('0xa4'));_0x14a837[_0xaad8('0x4b')]('a.mandatoryDisposition',_0xaad8('0xa5'));_0x14a837[_0xaad8('0x4b')](_0xaad8('0xa6'),'contactName');_0x14a837[_0xaad8('0x4b')](_0xaad8('0xa7'));_0x14a837[_0xaad8('0x4b')]('c.firstName',_0xaad8('0xa8'));_0x14a837[_0xaad8('0x4b')]('c.lastName',_0xaad8('0xa9'));_0x14a837[_0xaad8('0x4b')](_0xaad8('0xaa'),_0xaad8('0xab'));_0x14a837['field']('c.phone',_0xaad8('0xac'));_0x14a837[_0xaad8('0x4b')](_0xaad8('0xad'),_0xaad8('0xae'));_0x14a837[_0xaad8('0x4b')]('c.fax','Contact.fax');_0x14a837['field'](_0xaad8('0xaf'),'Owner.fullname');_0x14a837['field'](_0xaad8('0xb0'),'Owner.internal');_0x14a837[_0xaad8('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xaad8('0x34'));}if(_0x57ad55[_0xaad8('0x26')])_0x14a837['limit'](_0x57ad55[_0xaad8('0x26')]);if(_0x57ad55[_0xaad8('0x25')])_0x14a837[_0xaad8('0x25')](_0x57ad55[_0xaad8('0x25')]);return db[_0xaad8('0x9e')]['query'](_0x14a837[_0xaad8('0x9d')](),_0x5bad28);})['then'](function(_0x196ca2){if(_0x196ca2[_0xaad8('0x45')]>0x0)_0x4a7401[_0xaad8('0x49')](_0xaad8('0xb1'),_[_0xaad8('0x32')](_0x196ca2,'id'));return db[_0xaad8('0x9e')][_0xaad8('0x3e')](_0x4a7401[_0xaad8('0x9d')](),_0x5bad28)[_0xaad8('0x2d')](function(_0xda1b30){var _0x5ed968=_['groupBy'](_0xda1b30,_0xaad8('0xb2'));var _0x1af1bb=[];_0x196ca2[_0xaad8('0x36')](function(_0x345ba9){_0x1af1bb['push'](updateWhatsappInteraction(_0x345ba9,_0x241ceb,_0x5ed968));});return BPromise[_0xaad8('0xb3')](_0x1af1bb);});});})[_0xaad8('0x2d')](function(_0x8f8c9c){_0x3df4cf[_0xaad8('0xb4')]=_0x8f8c9c;return _0x3df4cf;})[_0xaad8('0x2d')](respondWithFilteredResult(_0x5a0ee3,_0x57ad55))[_0xaad8('0xb5')](handleError(_0x5a0ee3,null));};exports[_0xaad8('0xb6')]=function(_0x13eb0a,_0x2e74ce){var _0x5e5dc5={'raw':![],'where':{'id':_0x13eb0a[_0xaad8('0xb7')]['id']}},_0xcbd888={};_0xcbd888[_0xaad8('0x43')]=_[_0xaad8('0x3f')](db[_0xaad8('0x39')][_0xaad8('0x3a')]);_0xcbd888['query']=_[_0xaad8('0x3f')](_0x13eb0a[_0xaad8('0x3e')]);_0xcbd888[_0xaad8('0x40')]=_[_0xaad8('0x41')](_0xcbd888[_0xaad8('0x43')],_0xcbd888[_0xaad8('0x3e')]);_0x5e5dc5[_0xaad8('0x42')]=_['intersection'](_0xcbd888[_0xaad8('0x43')],qs[_0xaad8('0x44')](_0x13eb0a['query'][_0xaad8('0x44')]));_0x5e5dc5[_0xaad8('0x42')]=_0x5e5dc5['attributes']['length']?_0x5e5dc5[_0xaad8('0x42')]:_0xcbd888[_0xaad8('0x43')];if(_0x13eb0a[_0xaad8('0x3e')][_0xaad8('0xb8')]){_0x5e5dc5[_0xaad8('0xb9')]=[{'all':!![]}];}_0x5e5dc5=_[_0xaad8('0xa0')]({},_0x5e5dc5,_0x13eb0a[_0xaad8('0xba')]);return db['WhatsappInteraction']['find'](_0x5e5dc5)[_0xaad8('0x2d')](handleEntityNotFound(_0x2e74ce,null))[_0xaad8('0x2d')](respondWithResult(_0x2e74ce,null))[_0xaad8('0xb5')](handleError(_0x2e74ce,null));};exports[_0xaad8('0xbb')]=function(_0x143a36,_0xa8ee4c){return db[_0xaad8('0x39')][_0xaad8('0xbb')](_0x143a36[_0xaad8('0x73')],{})['then'](respondWithResult(_0xa8ee4c,0xc9))[_0xaad8('0xb5')](handleError(_0xa8ee4c,null));};exports['update']=function(_0x42be6f,_0x1bec15){if(_0x42be6f[_0xaad8('0x73')]['id']){delete _0x42be6f[_0xaad8('0x73')]['id'];}return db['WhatsappInteraction'][_0xaad8('0x62')]({'where':{'id':_0x42be6f['params']['id']}})[_0xaad8('0x2d')](handleEntityNotFound(_0x1bec15,null))[_0xaad8('0x2d')](saveUpdates(_0x42be6f[_0xaad8('0x73')],null))['then'](respondWithResult(_0x1bec15,null))[_0xaad8('0xb5')](handleError(_0x1bec15,null));};exports[_0xaad8('0xbc')]=function(_0x687e30,_0x254186){return db[_0xaad8('0x39')][_0xaad8('0x62')]({'where':{'id':_0x687e30['params']['id']}})[_0xaad8('0x2d')](handleEntityNotFound(_0x254186,null))['then'](removeEntity(_0x254186,null))[_0xaad8('0xb5')](handleError(_0x254186,null));};exports[_0xaad8('0xbd')]=function(_0x177e1e,_0x5b4ae3){return db[_0xaad8('0x39')][_0xaad8('0xbd')]()['then'](respondWithResult(_0x5b4ae3,null))[_0xaad8('0xb5')](handleError(_0x5b4ae3,null));};exports['addMessage']=function(_0x74e336,_0x5a4a3f,_0x21affa){return db[_0xaad8('0xbe')][_0xaad8('0x62')]({'where':{'id':_0x74e336[_0xaad8('0xb7')]['id']}})['then'](handleEntityNotFound(_0x5a4a3f,null))[_0xaad8('0x2d')](function(_0x38a036){if(_0x38a036){return _0x38a036[_0xaad8('0xbf')](_0x74e336[_0xaad8('0x73')][_0xaad8('0xc0')],_[_0xaad8('0xc1')](_0x74e336['body'],[_0xaad8('0xc0'),'id'])||{});}})[_0xaad8('0x2d')](respondWithResult(_0x5a4a3f,null))['catch'](handleError(_0x5a4a3f,null));};exports[_0xaad8('0xc2')]=function(_0x2e6ea2,_0x177791,_0x54eee0){var _0x5b883f={'raw':![],'where':{}};var _0x47e5dc={};var _0x22acc9={'count':0x0,'rows':[]};return db[_0xaad8('0x39')][_0xaad8('0xc3')]({'where':{'id':_0x2e6ea2[_0xaad8('0xb7')]['id']}})[_0xaad8('0x2d')](handleEntityNotFound(_0x177791,null))[_0xaad8('0x2d')](function(_0xd68b67){if(_0xd68b67){_0x47e5dc['model']=_[_0xaad8('0x3f')](db[_0xaad8('0xbe')]['rawAttributes']);_0x47e5dc[_0xaad8('0x3e')]=_[_0xaad8('0x3f')](_0x2e6ea2[_0xaad8('0x3e')]);_0x47e5dc['filters']=_[_0xaad8('0x41')](_0x47e5dc['model'],_0x47e5dc[_0xaad8('0x3e')]);_0x5b883f[_0xaad8('0x42')]=_[_0xaad8('0x41')](_0x47e5dc[_0xaad8('0x43')],qs[_0xaad8('0x44')](_0x2e6ea2[_0xaad8('0x3e')][_0xaad8('0x44')]));_0x5b883f[_0xaad8('0x42')]=_0x5b883f[_0xaad8('0x42')][_0xaad8('0x45')]?_0x5b883f[_0xaad8('0x42')]:_0x47e5dc[_0xaad8('0x43')];if(!_0x2e6ea2['query'][_0xaad8('0xc4')](_0xaad8('0x46'))){_0x5b883f[_0xaad8('0x26')]=qs[_0xaad8('0x26')](_0x2e6ea2[_0xaad8('0x3e')][_0xaad8('0x26')]);_0x5b883f[_0xaad8('0x25')]=qs[_0xaad8('0x25')](_0x2e6ea2[_0xaad8('0x3e')][_0xaad8('0x25')]);}_0x5b883f[_0xaad8('0x47')]=qs[_0xaad8('0x48')](_0x2e6ea2[_0xaad8('0x3e')][_0xaad8('0x48')]);_0x5b883f['where']=qs[_0xaad8('0x40')](_[_0xaad8('0x4a')](_0x2e6ea2['query'],_0x47e5dc[_0xaad8('0x40')]));_0x5b883f[_0xaad8('0x49')]['WhatsappInteractionId']=_0xd68b67['id'];if(_0x2e6ea2['query']['filter']){_0x5b883f[_0xaad8('0x49')]=_[_0xaad8('0xa0')](_0x5b883f[_0xaad8('0x49')],{'$or':_['map'](_0x5b883f[_0xaad8('0x42')],function(_0x370a67){var _0x1f06a8={};_0x1f06a8[_0x370a67]={'$like':'%'+_0x2e6ea2[_0xaad8('0x3e')]['filter']+'%'};return _0x1f06a8;})});}if(_0x2e6ea2[_0xaad8('0x3e')][_0xaad8('0x7a')]){var _0x1cbae2=_0x2e6ea2[_0xaad8('0x3e')][_0xaad8('0x7a')][_0xaad8('0x35')](',');var _0x48e580={};_0x48e580[_0x1cbae2[0x0]]={'$gte':moment(_0x1cbae2[0x1])[_0xaad8('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b883f['where']=_[_0xaad8('0xa0')](_0x5b883f[_0xaad8('0x49')],_0x48e580);}_0x5b883f=_[_0xaad8('0xa0')]({},_0x5b883f,_0x2e6ea2[_0xaad8('0xba')]);return db['WhatsappMessage'][_0xaad8('0x27')]({'where':_0x5b883f[_0xaad8('0x49')]})['then'](function(_0x1720d3){_0x22acc9[_0xaad8('0x27')]=_0x1720d3;if(_0x2e6ea2[_0xaad8('0x3e')]['includeAll']){_0x5b883f[_0xaad8('0xb9')]=[{'all':!![]}];}return db[_0xaad8('0xbe')][_0xaad8('0xc6')](_0x5b883f);})['then'](function(_0x33cd21){_0x22acc9[_0xaad8('0xb4')]=_0x33cd21;return _0x22acc9;});}})[_0xaad8('0x2d')](respondWithFilteredResult(_0x177791,_0x5b883f))[_0xaad8('0xb5')](handleError(_0x177791,null));};exports['addTags']=function(_0x553078,_0x73cf21,_0x36bc7b){return db[_0xaad8('0x39')][_0xaad8('0x62')]({'where':{'id':_0x553078[_0xaad8('0xb7')]['id']}})['then'](handleEntityNotFound(_0x73cf21,null))['then'](function(_0x1c7b3f){if(_0x1c7b3f){return _0x1c7b3f[_0xaad8('0xc7')](_0x553078['body'][_0xaad8('0xc0')],_[_0xaad8('0xc1')](_0x553078['body'],[_0xaad8('0xc0'),'id'])||{})[_0xaad8('0xc8')](function(){return db[_0xaad8('0x6c')][_0xaad8('0xc6')]({'attributes':['id','name',_0xaad8('0xc9')],'where':{'id':_0x553078[_0xaad8('0x73')][_0xaad8('0xc0')]}});})[_0xaad8('0x2d')](function(_0x5a0847){socket[_0xaad8('0xca')](_0xaad8('0xcb'),{'id':Number(_0x553078[_0xaad8('0xb7')]['id']),'tags':_0x5a0847||[]});return{'id':Number(_0x553078[_0xaad8('0xb7')]['id']),'tags':_0x5a0847||[]};});}})[_0xaad8('0x2d')](respondWithResult(_0x73cf21,null))['catch'](handleError(_0x73cf21,null));};exports[_0xaad8('0xcc')]=function(_0x20db2e,_0x6ba820,_0x2680da){return db['WhatsappInteraction'][_0xaad8('0x62')]({'where':{'id':_0x20db2e[_0xaad8('0xb7')]['id']}})[_0xaad8('0x2d')](handleEntityNotFound(_0x6ba820,null))[_0xaad8('0x2d')](function(_0x2449d0){if(_0x2449d0){return _0x2449d0[_0xaad8('0xcc')](_0x20db2e[_0xaad8('0x3e')][_0xaad8('0xc0')]);}})['then'](respondWithStatusCode(_0x6ba820,null))[_0xaad8('0xb5')](handleError(_0x6ba820,null));};exports['download']=function(_0x19f770,_0x40aae1){var _0x376176=moment()[_0xaad8('0xcd')]()[_0xaad8('0x9d')]();var _0x47e241=path['join'](config[_0xaad8('0xce')],_0xaad8('0xcf'),_0xaad8('0xd0'),_0xaad8('0xd1'));var _0x5f296a=path[_0xaad8('0xd2')](config[_0xaad8('0xce')],_0xaad8('0xcf'),_0xaad8('0xd0'),'attachments');var _0x923bc1=path[_0xaad8('0xd2')](_0x47e241,_0x376176);var _0x5e4a8a=util[_0xaad8('0xc5')](_0xaad8('0xd3'),_0x19f770[_0xaad8('0xb7')]['id'],_0x376176);var _0x163a93=path[_0xaad8('0xd2')](_0x47e241,_0x5e4a8a);var _0x4c6cc4=[];_0x4c6cc4[_0xaad8('0x37')]({'model':db[_0xaad8('0x6f')],'as':_0xaad8('0x6f'),'attributes':['id','fullname'],'raw':!![]});_0x4c6cc4['push']({'model':db[_0xaad8('0xd4')],'as':_0xaad8('0xd5'),'attributes':['id',_0xaad8('0xd6'),_0xaad8('0xd7')],'raw':!![]});if(_0x19f770['query'][_0xaad8('0xd8')]){_0x4c6cc4['push']({'model':db[_0xaad8('0xd9')],'as':_0xaad8('0xd9'),'raw':!![]});}var _0x26bdd0=[{'model':db['WhatsappMessage'],'as':_0xaad8('0xda'),'attributes':['id',_0xaad8('0x73'),_0xaad8('0x78'),_0xaad8('0xdb'),'secret',_0xaad8('0x7f')],'include':_0x4c6cc4}];_0x26bdd0[_0xaad8('0x37')]({'model':db[_0xaad8('0xdc')],'as':_0xaad8('0xdd'),'attributes':['id',_0xaad8('0x31')]});_0x26bdd0[_0xaad8('0x37')]({'model':db[_0xaad8('0x6f')],'as':_0xaad8('0xde'),'attributes':['id',_0xaad8('0x33')]});return db[_0xaad8('0x39')][_0xaad8('0x62')]({'where':{'id':_0x19f770['params']['id']},'include':_0x26bdd0})[_0xaad8('0x2d')](handleEntityNotFound(_0x40aae1,null))[_0xaad8('0x2d')](function(_0x24c2f6){if(_0x24c2f6){var _0x124afc=_0x24c2f6[_0xaad8('0xdf')]({'plain':!![]});fs[_0xaad8('0xe0')](_0x923bc1);var _0x520347={'channel':_0xaad8('0xe1'),'account':_0x124afc['Account'][_0xaad8('0x31')],'agent':_0x124afc[_0xaad8('0xde')]?_0x124afc['Owner']['fullname']:_0xaad8('0xe2'),'createdAt':moment(_0x124afc[_0xaad8('0x78')])[_0xaad8('0xc5')](_0xaad8('0xe3'))[_0xaad8('0x9d')](),'closedAt':_0x124afc[_0xaad8('0xe4')]?moment(_0x124afc[_0xaad8('0xe5')])[_0xaad8('0xc5')](_0xaad8('0xe3'))[_0xaad8('0x9d')]():'','disposition':_0x124afc[_0xaad8('0xe6')],'messages':_(_0x124afc[_0xaad8('0xda')])['filter']({'secret':![]})[_0xaad8('0x32')](function(_0x4d32b1){if(_0x4d32b1[_0xaad8('0xd9')]){var _0x578078=path[_0xaad8('0xd2')](_0x5f296a,_0x4d32b1[_0xaad8('0xd9')][_0xaad8('0xe7')]);if(fs[_0xaad8('0xe8')](_0x578078)){fs[_0xaad8('0xe9')](_0x578078)[_0xaad8('0xea')](fs['createWriteStream'](path[_0xaad8('0xd2')](_0x923bc1,_0x4d32b1[_0xaad8('0xd9')][_0xaad8('0xe7')])));}}return{'date':moment(_0x4d32b1[_0xaad8('0x78')])[_0xaad8('0xc5')](_0xaad8('0xe3'))['toString'](),'sender':_0x4d32b1[_0xaad8('0xdb')]===_0xaad8('0xeb')?_0x4d32b1[_0xaad8('0x6f')]?_0x4d32b1['User'][_0xaad8('0x33')]:'System':_0x4d32b1['Contact'][_0xaad8('0xd6')]+(_0x4d32b1[_0xaad8('0xd5')][_0xaad8('0xd7')]?'\x20'+_0x4d32b1['Contact'][_0xaad8('0xd7')]:''),'body':_0x4d32b1[_0xaad8('0xd9')]?_0x4d32b1[_0xaad8('0xd9')]['basename']:_0x4d32b1['body'],'direction':_0x4d32b1[_0xaad8('0xdb')]===_0xaad8('0xeb')?'A':'C','secret':_0x4d32b1[_0xaad8('0xec')],'read':_0x4d32b1[_0xaad8('0x7f')],'attachment':_0x4d32b1[_0xaad8('0xd9')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xaad8('0xce')],_0xaad8('0xcf'),'views',_0xaad8('0xed')),{'interaction':_0x520347})[_0xaad8('0x2d')](function(_0x53a2bb){var _0x563451=path[_0xaad8('0xd2')](_0x923bc1,_0xaad8('0xee')+_0x124afc['id']+'-'+_0x376176+_0xaad8('0xef'));var _0x1e69b7={'path':_0x563451,'channel':_0xaad8('0xe1'),'interactionId':_0x124afc['id']};return pdf[_0xaad8('0xf0')](_0x53a2bb,_0x1e69b7);})[_0xaad8('0x2d')](function(){return new BPromise(function(_0x452b3c,_0x1acb10){zipdir(_0x923bc1,{'saveTo':_0x163a93},function(_0x3b9a6c,_0x5a7c5b){if(_0x3b9a6c)return _0x1acb10(_0x3b9a6c);return _0x452b3c(_0x5a7c5b);});})[_0xaad8('0x2d')](function(){return new BPromise(function(_0x475e3d,_0x1cc5d4){rimraf(_0x923bc1,function(_0x104136){if(_0x104136)_0x1cc5d4(_0x104136);return _0x475e3d();});});})[_0xaad8('0x2d')](function(){return _0x40aae1['download'](_0x163a93,_0x5e4a8a,function(_0x33e7d6){if(_0x33e7d6){console[_0xaad8('0xf1')]('err',_0x33e7d6);}else{fs[_0xaad8('0xf2')](_0x163a93);}});});});}else{return _0x40aae1[_0xaad8('0x2e')](0xc8);}})[_0xaad8('0xb5')](handleError(_0x40aae1,null));}; \ No newline at end of file +var _0xb6b1=['color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','having','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','show','params','includeAll','include','options','create','body','update','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','WhatsappInteractionId','findAll','addTags','setTags','omit','spread','emit','whatsappInteractionTags:save','removeTags','unix','join','server','tmp','root','files','format','CmContact','firstName','lastName','Attachment','secret','Account','Owner','get','mkdirSync','Whatsapp','YYYY-MM-DD\x20HH:mm:ss','disposition','Messages','basename','existsSync','createReadStream','pipe','direction','System','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','download','err','unlinkSync','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./whatsappInteraction.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','stack','name','map','fullname','TagIds','Tags','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','keys','filters','intersection','model','attributes','query','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field'];(function(_0x17989c,_0x561c08){var _0x178308=function(_0x2a2bca){while(--_0x2a2bca){_0x17989c['push'](_0x17989c['shift']());}};_0x178308(++_0x561c08);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0xb6b1[_0x40927b];return _0x2635e8;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var pdf=require(_0x1b6b('0x10'));var hardwareService=require(_0x1b6b('0x11'));var logger=require(_0x1b6b('0x12'))(_0x1b6b('0x13'));var utils=require(_0x1b6b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1b6b('0x15'));var db=require(_0x1b6b('0x16'))['db'];config[_0x1b6b('0x17')]=_['defaults'](config[_0x1b6b('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b6b('0x17')]));require(_0x1b6b('0x18'))[_0x1b6b('0x19')](socket);function respondWithStatusCode(_0x10eea4,_0x1b9cc4){_0x1b9cc4=_0x1b9cc4||0xcc;return function(_0x268fe9){if(_0x268fe9){return _0x10eea4[_0x1b6b('0x1a')](_0x1b9cc4);}return _0x10eea4['status'](_0x1b9cc4)[_0x1b6b('0x1b')]();};}function respondWithResult(_0x251821,_0x10af08){_0x10af08=_0x10af08||0xc8;return function(_0x33dc7e){if(_0x33dc7e){return _0x251821['status'](_0x10af08)[_0x1b6b('0x1c')](_0x33dc7e);}};}function respondWithFilteredResult(_0x3dd677,_0x2e608b){return function(_0x59e671){if(_0x59e671){var _0x923711=typeof _0x2e608b[_0x1b6b('0x1d')]===_0x1b6b('0x1e')&&typeof _0x2e608b[_0x1b6b('0x1f')]===_0x1b6b('0x1e');var _0xe720e7=_0x59e671[_0x1b6b('0x20')];var _0x1622b3=_0x923711?0x0:_0x2e608b[_0x1b6b('0x1d')];var _0x20a5a3=_0x923711?_0x59e671['count']:_0x2e608b[_0x1b6b('0x1d')]+_0x2e608b[_0x1b6b('0x1f')];var _0x3b427d;if(_0x20a5a3>=_0xe720e7){_0x20a5a3=_0xe720e7;_0x3b427d=0xc8;}else{_0x3b427d=0xce;}_0x3dd677[_0x1b6b('0x21')](_0x3b427d);return _0x3dd677[_0x1b6b('0x22')](_0x1b6b('0x23'),_0x1622b3+'-'+_0x20a5a3+'/'+_0xe720e7)[_0x1b6b('0x1c')](_0x59e671);}return null;};}function patchUpdates(_0xa12ff8){return function(_0x22f0b7){try{jsonpatch['apply'](_0x22f0b7,_0xa12ff8,!![]);}catch(_0x1b2cdf){return BPromise['reject'](_0x1b2cdf);}return _0x22f0b7['save']();};}function saveUpdates(_0x4cb089,_0x11449b){return function(_0xc9554d){if(_0xc9554d){return _0xc9554d['update'](_0x4cb089)[_0x1b6b('0x24')](function(_0x47c318){return _0x47c318;});}return null;};}function removeEntity(_0x15dfc7,_0x440658){return function(_0x466c0c){if(_0x466c0c){return _0x466c0c[_0x1b6b('0x25')]()[_0x1b6b('0x24')](function(){_0x15dfc7[_0x1b6b('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8b7b5,_0x1bb7f3){return function(_0x173961){if(!_0x173961){_0xe8b7b5[_0x1b6b('0x1a')](0x194);}return _0x173961;};}function handleError(_0x4bd5b8,_0x23dac4){_0x23dac4=_0x23dac4||0x1f4;return function(_0x5a46bd){logger['error'](_0x5a46bd[_0x1b6b('0x26')]);if(_0x5a46bd['name']){delete _0x5a46bd[_0x1b6b('0x27')];}_0x4bd5b8[_0x1b6b('0x21')](_0x23dac4)['send'](_0x5a46bd);};}function getInteractionUsers(_0x4c42a9,_0x36878c){return new BPromise(function(_0x1f8925,_0x53d5ec){try{if(_0x36878c[_0x4c42a9['id']]){_0x4c42a9['Users']=_[_0x1b6b('0x28')](_0x36878c[_0x4c42a9['id']],function(_0x1b407f){return{'id':_0x1b407f['id'],'fullname':_0x1b407f[_0x1b6b('0x29')]};});}}catch(_0x1bf52c){_0x53d5ec(_0x1bf52c);}_0x1f8925(_0x4c42a9);});}function getInteractionTags(_0x56f31b,_0x20bbd7){return new BPromise(function(_0x1f4c1f,_0x340249){try{if(_0x56f31b[_0x1b6b('0x2a')]){_0x56f31b[_0x1b6b('0x2b')]=[];_0x56f31b[_0x1b6b('0x2a')][_0x1b6b('0x2c')](',')[_0x1b6b('0x2d')](function(_0x2e991b){_0x56f31b['Tags'][_0x1b6b('0x2e')](_0x20bbd7[_0x2e991b]);});}delete _0x56f31b[_0x1b6b('0x2a')];}catch(_0x3d6e4d){_0x340249(_0x3d6e4d);}_0x1f4c1f(_0x56f31b);});}function updateWhatsappInteraction(_0x1ab173,_0x4d51d0,_0x281350){return new BPromise(function(_0x487ce5,_0x261b22){return getInteractionUsers(_0x1ab173,_0x281350)['then'](function(_0x5dbf02){return getInteractionTags(_0x5dbf02,_0x4d51d0);})[_0x1b6b('0x24')](function(_0x3a3f35){_0x487ce5(_0x3a3f35);})[_0x1b6b('0x2f')](function(_0x4c7d74){_0x261b22(_0x4c7d74);});});}exports[_0x1b6b('0x30')]=function(_0x17e0e1,_0x3c7e65){var _0x276bf9={},_0x26b864={},_0x204e0d={'count':0x0,'rows':[]};var _0x100f66=_[_0x1b6b('0x28')](db[_0x1b6b('0x31')][_0x1b6b('0x32')],function(_0x120e13){return{'name':_0x120e13[_0x1b6b('0x33')],'type':_0x120e13[_0x1b6b('0x34')][_0x1b6b('0x35')]};});_0x26b864['model']=_[_0x1b6b('0x28')](_0x100f66,_0x1b6b('0x27'));_0x26b864['query']=_[_0x1b6b('0x36')](_0x17e0e1['query']);_0x26b864[_0x1b6b('0x37')]=_[_0x1b6b('0x38')](_0x26b864[_0x1b6b('0x39')],_0x26b864['query']);_0x276bf9[_0x1b6b('0x3a')]=_[_0x1b6b('0x38')](_0x26b864[_0x1b6b('0x39')],qs['fields'](_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x3c')]));_0x276bf9[_0x1b6b('0x3a')]=_0x276bf9['attributes']['length']?_0x276bf9['attributes']:_0x26b864[_0x1b6b('0x39')];if(!_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x3d')](_0x1b6b('0x3e'))){_0x276bf9[_0x1b6b('0x1f')]=qs[_0x1b6b('0x1f')](_0x17e0e1[_0x1b6b('0x3b')]['limit']);_0x276bf9[_0x1b6b('0x1d')]=qs[_0x1b6b('0x1d')](_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x1d')]);}_0x276bf9[_0x1b6b('0x3f')]=qs[_0x1b6b('0x40')](_0x17e0e1['query'][_0x1b6b('0x40')]);_0x276bf9[_0x1b6b('0x41')]=qs[_0x1b6b('0x37')](_[_0x1b6b('0x42')](_0x17e0e1[_0x1b6b('0x3b')],_0x26b864[_0x1b6b('0x37')]),_0x100f66);var _0x1c86ce=[];var _0x393a56=squel[_0x1b6b('0x43')]()[_0x1b6b('0x44')]('id')[_0x1b6b('0x44')](_0x1b6b('0x27'))['field'](_0x1b6b('0x45'))[_0x1b6b('0x46')](_0x1b6b('0x47'));var _0xf901db=squel[_0x1b6b('0x43')]()[_0x1b6b('0x44')]('u.id')['field'](_0x1b6b('0x48'))['field'](_0x1b6b('0x49'))['from'](_0x1b6b('0x4a'),'ui')[_0x1b6b('0x4b')](_0x1b6b('0x4c'),'u',_0x1b6b('0x4d'));var _0x53cb3d=squel[_0x1b6b('0x43')]()['from']('whatsapp_interactions','i')[_0x1b6b('0x4b')](_0x1b6b('0x4e'),'c',_0x1b6b('0x4f'))[_0x1b6b('0x4b')]('users','o',_0x1b6b('0x50'))['left_join'](_0x1b6b('0x51'),'a',_0x1b6b('0x52'))[_0x1b6b('0x4b')]('whatsapp_messages','me',_0x1b6b('0x53'))['left_join'](_0x1b6b('0x54'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x1b6b('0x4b')](_0x1b6b('0x47'),'t',_0x1b6b('0x55'));var _0x21e798=squel[_0x1b6b('0x56')]();var _0x2b46a4=[];var _0x5d55a5=squel['expr']();var _0x2be336;if(_0x17e0e1[_0x1b6b('0x3b')]['search']){_0x2be336=as[_0x1b6b('0x57')](_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x58')]);var _0x6cab33=_0x2be336[_0x1b6b('0x59')];for(var _0x587c88=0x0;_0x587c88<_0x2be336[_0x1b6b('0x5a')]['length'];_0x587c88++){var _0x2cb484=_0x2be336[_0x1b6b('0x5a')][_0x587c88];var _0x295002='i';var _0x23475a=_[_0x1b6b('0x5b')](_0x100f66,[_0x1b6b('0x27'),_0x2cb484[_0x1b6b('0x44')]]);if(!_0x23475a){switch(_0x2cb484[_0x1b6b('0x44')]){case _0x1b6b('0x5c'):if(_0x2cb484['value']==0x1){_0x53cb3d['having']('`'+_0x2cb484['field']+_0x1b6b('0x5d'));}else{_0x53cb3d['having']('`'+_0x2cb484['field']+_0x1b6b('0x5e'));}break;case _0x1b6b('0x5f'):if(_0x2cb484[_0x1b6b('0x60')]===_0x1b6b('0x61')){if(_0x2cb484['value'][_0x1b6b('0x2c')]('\x20')[_0x1b6b('0x62')]>0x1){_0x21e798[_0x6cab33](_0x1b6b('0x63'),qs['getFullTextValue'](_0x2cb484['value']),null);}else{var _0xfc3746='%'+_0x2cb484[_0x1b6b('0x64')]+'%';_0x21e798[_0x6cab33](_0x1b6b('0x65'),_0xfc3746,_0xfc3746,_0xfc3746);}}else{_0x23475a=_['find'](_0x100f66,['name','ContactId']);_0x2cb484['field']=_0x1b6b('0x66');_0x1b6eb7=as[_0x1b6b('0x67')](_0x295002,_0x23475a[_0x1b6b('0x34')],_0x2cb484);_0x21e798[_0x6cab33](_0x1b6eb7[_0x1b6b('0x68')],_0x1b6eb7[_0x1b6b('0x64')][_0x1b6b('0x69')],_0x1b6eb7['value'][_0x1b6b('0x1b')]);}break;case _0x1b6b('0x6a'):var _0x1d87d6=_0x2cb484[_0x1b6b('0x64')][_0x1b6b('0x2c')](',')[_0x1b6b('0x28')](function(_0x57c2c6){return Number(_0x57c2c6);});_0x1d87d6[_0x1b6b('0x2d')](function(_0x4e0cb9){_0x5d55a5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4e0cb9+',%');});_0x2b46a4=_['union'](_0x2b46a4,_0x1d87d6);break;case _0x1b6b('0x6b'):if(_0x2cb484['operator']==='$substring'){_0x21e798[_0x6cab33](_0x1b6b('0x6c'),'%'+_0x2cb484[_0x1b6b('0x64')]+'%',null);}else{_0x23475a=_[_0x1b6b('0x5b')](_0x100f66,[_0x1b6b('0x27'),_0x1b6b('0x6d')]);_0x2cb484[_0x1b6b('0x44')]=_0x1b6b('0x6d');_0x1b6eb7=as['buildExpression'](_0x295002,_0x23475a[_0x1b6b('0x34')],_0x2cb484);_0x21e798[_0x6cab33](_0x1b6eb7['text'],_0x1b6eb7[_0x1b6b('0x64')][_0x1b6b('0x69')],_0x1b6eb7[_0x1b6b('0x64')]['end']);}break;case'body':_0x1b6eb7=as[_0x1b6b('0x67')]('me',null,_0x2cb484);_0x21e798[_0x6cab33](_0x1b6eb7[_0x1b6b('0x68')],_0x1b6eb7[_0x1b6b('0x64')][_0x1b6b('0x69')],_0x1b6eb7[_0x1b6b('0x64')][_0x1b6b('0x1b')]);break;}}else{var _0x1b6eb7=as[_0x1b6b('0x67')](_0x295002,_0x23475a['type'],_0x2cb484);_0x21e798[_0x6cab33](_0x1b6eb7['text'],_0x1b6eb7[_0x1b6b('0x64')][_0x1b6b('0x69')],_0x1b6eb7[_0x1b6b('0x64')][_0x1b6b('0x1b')]);}}}else{var _0x507775=_(_0x17e0e1[_0x1b6b('0x3b')])['keys']()[_0x1b6b('0x28')](function(_0x25a0c4){return _['some'](_0x100f66,[_0x1b6b('0x27'),_0x25a0c4])?_0x25a0c4:undefined;})[_0x1b6b('0x6e')]()[_0x1b6b('0x64')]();if(!_[_0x1b6b('0x6f')](_0x507775)){_0x507775[_0x1b6b('0x2d')](function(_0x10bd40){if(_0x10bd40==='WhatsappAccountId'){_0x53cb3d[_0x1b6b('0x41')](_0x1b6b('0x70'),[]['concat'](_0x17e0e1[_0x1b6b('0x3b')][_0x10bd40]));}else if(_0x10bd40===_0x1b6b('0x71')){var _0x2a816b=JSON[_0x1b6b('0x72')](_0x17e0e1[_0x1b6b('0x3b')][_0x10bd40])[_0x1b6b('0x73')];var _0x388b26=JSON[_0x1b6b('0x72')](_0x17e0e1['query'][_0x10bd40])['$lte'];_0x53cb3d['where'](_0x1b6b('0x74'),_0x2a816b,_0x388b26);}else{if(_0x17e0e1[_0x1b6b('0x3b')][_0x10bd40]===_0x1b6b('0x75')){_0x53cb3d[_0x1b6b('0x41')]('i.'+_0x10bd40+_0x1b6b('0x76'));}else{_0x53cb3d[_0x1b6b('0x41')]('i.'+_0x10bd40+'\x20=\x20?',_0x17e0e1['query'][_0x10bd40]);}}});}if(_0x17e0e1[_0x1b6b('0x3b')]['read']){if(_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x77')]==0x1){_0x53cb3d[_0x1b6b('0x78')]('`unreadMessages`\x20=\x200');}else{_0x53cb3d[_0x1b6b('0x78')]('`unreadMessages`\x20>\x200');}}if(_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x79')]){_0x2b46a4=_['isArray'](_0x17e0e1[_0x1b6b('0x3b')]['tag'])?_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x79')]:new Array(_0x17e0e1['query'][_0x1b6b('0x79')]);_0x2b46a4[_0x1b6b('0x2d')](function(_0x295fa6){_0x5d55a5['or'](_0x1b6b('0x7a'),'%,'+_0x295fa6+',%');});}if(_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x7b')]){var _0x58bc30=_0x17e0e1['query'][_0x1b6b('0x7b')]['replace']('\x5c','\x5c\x5c')[_0x1b6b('0x7c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x58bc30)){_0x21e798['or'](_0x1b6b('0x7d'),_0x58bc30+'%')['or'](_0x1b6b('0x7e'),_0x58bc30+'%');}else{_0x21e798['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1b6b('0x7f')](_0x58bc30))['or'](_0x1b6b('0x80'),_0x58bc30+'%');}}}_0x53cb3d[_0x1b6b('0x41')](_0x21e798);_0x53cb3d['group']('i.id');var _0x69072d={'type':db[_0x1b6b('0x81')][_0x1b6b('0x82')]['SELECT'],'raw':!![]};var _0x26caa6=_0x53cb3d[_0x1b6b('0x83')]();_0x26caa6[_0x1b6b('0x44')](_0x1b6b('0x84'));_0x26caa6[_0x1b6b('0x44')](_0x1b6b('0x85'),_0x1b6b('0x5c'));if(_0x276bf9[_0x1b6b('0x3f')]){_0x276bf9[_0x1b6b('0x3f')][_0x1b6b('0x2d')](function(_0x41e282){var _0x393137=_0x41e282[0x0]===_0x1b6b('0x86')?_0x41e282[0x0]:'i.'+_0x41e282[0x0];_0x53cb3d[_0x1b6b('0x3f')](_0x393137,_0x41e282[0x1]===_0x1b6b('0x87')?![]:!![]);});}if(!_['isEmpty'](_0x2b46a4)){_0x53cb3d['having'](_0x5d55a5);_0x26caa6[_0x1b6b('0x41')]('t.id\x20IN\x20?',_0x2b46a4);}BPromise[_0x1b6b('0x88')]()[_0x1b6b('0x24')](function(){if(!_0x2be336){if(_0x17e0e1[_0x1b6b('0x3b')][_0x1b6b('0x89')])return;_0x26caa6[_0x1b6b('0x41')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x53cb3d[_0x1b6b('0x41')](_0x1b6b('0x8a'));return;}if(_0x17e0e1[_0x1b6b('0x8b')][_0x1b6b('0x8c')]!=='agent')return;return _0x17e0e1[_0x1b6b('0x8b')][_0x1b6b('0x8d')]({'attributes':['id'],'raw':!![]})[_0x1b6b('0x24')](function(_0x106239){if(_[_0x1b6b('0x6f')](_0x106239)){_0x26caa6[_0x1b6b('0x41')](_0x1b6b('0x8e'));_0x53cb3d[_0x1b6b('0x41')](_0x1b6b('0x8e'));}else{_0x26caa6['where'](_0x1b6b('0x70'),_[_0x1b6b('0x28')](_0x106239,'id'));_0x53cb3d[_0x1b6b('0x41')](_0x1b6b('0x70'),_[_0x1b6b('0x28')](_0x106239,'id'));}});})[_0x1b6b('0x24')](function(){if(_0x17e0e1[_0x1b6b('0x8b')][_0x1b6b('0x8c')]===_0x1b6b('0x8f')&&!_0x2be336&&!_0x17e0e1[_0x1b6b('0x3b')]['WhatsappAccountId'])return[];return db[_0x1b6b('0x90')][_0x1b6b('0x3b')](_0x26caa6[_0x1b6b('0x91')](),_0x69072d);})['then'](function(_0x4c343e){_0x204e0d[_0x1b6b('0x20')]=_0x4c343e[_0x1b6b('0x62')];if(_0x204e0d['count']===0x0)return[];return db[_0x1b6b('0x90')][_0x1b6b('0x3b')](_0x393a56[_0x1b6b('0x91')](),_0x69072d)[_0x1b6b('0x24')](function(_0x2066ec){_0x1c86ce=_[_0x1b6b('0x92')](_0x2066ec,'id');_0x69072d=_[_0x1b6b('0x93')](_0x69072d,{'model':db[_0x1b6b('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17e0e1['query'][_0x1b6b('0x3c')]){_0x276bf9[_0x1b6b('0x3a')][_0x1b6b('0x2d')](function(_0x59be1c){_0x53cb3d[_0x1b6b('0x44')]('i.'+_0x59be1c);});}else{_0x53cb3d[_0x1b6b('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1b6b('0x5c'));_0x53cb3d[_0x1b6b('0x44')](_0x1b6b('0x94'),'Account.key');_0x53cb3d[_0x1b6b('0x44')](_0x1b6b('0x95'),_0x1b6b('0x96'));_0x53cb3d['field'](_0x1b6b('0x97'),'contactName');_0x53cb3d['field'](_0x1b6b('0x98'));_0x53cb3d[_0x1b6b('0x44')]('c.firstName','Contact.firstName');_0x53cb3d[_0x1b6b('0x44')](_0x1b6b('0x99'),'Contact.lastName');_0x53cb3d['field'](_0x1b6b('0x9a'),'Contact.email');_0x53cb3d[_0x1b6b('0x44')](_0x1b6b('0x9b'),_0x1b6b('0x9c'));_0x53cb3d[_0x1b6b('0x44')](_0x1b6b('0x9d'),_0x1b6b('0x9e'));_0x53cb3d[_0x1b6b('0x44')](_0x1b6b('0x9f'),'Contact.fax');_0x53cb3d[_0x1b6b('0x44')](_0x1b6b('0xa0'),_0x1b6b('0xa1'));_0x53cb3d['field'](_0x1b6b('0xa2'),_0x1b6b('0xa3'));_0x53cb3d['field'](_0x1b6b('0xa4'),_0x1b6b('0x2a'));}if(_0x276bf9[_0x1b6b('0x1f')])_0x53cb3d[_0x1b6b('0x1f')](_0x276bf9[_0x1b6b('0x1f')]);if(_0x276bf9['offset'])_0x53cb3d['offset'](_0x276bf9[_0x1b6b('0x1d')]);return db['sequelize']['query'](_0x53cb3d[_0x1b6b('0x91')](),_0x69072d);})[_0x1b6b('0x24')](function(_0x4ec999){if(_0x4ec999['length']>0x0)_0xf901db[_0x1b6b('0x41')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x1b6b('0x28')](_0x4ec999,'id'));return db['sequelize']['query'](_0xf901db[_0x1b6b('0x91')](),_0x69072d)['then'](function(_0x426426){var _0x5e5196=_[_0x1b6b('0xa5')](_0x426426,'WhatsappInteractionId');var _0x523254=[];_0x4ec999['forEach'](function(_0x7323aa){_0x523254['push'](updateWhatsappInteraction(_0x7323aa,_0x1c86ce,_0x5e5196));});return BPromise[_0x1b6b('0xa6')](_0x523254);});});})['then'](function(_0x3fa66a){_0x204e0d[_0x1b6b('0xa7')]=_0x3fa66a;return _0x204e0d;})[_0x1b6b('0x24')](respondWithFilteredResult(_0x3c7e65,_0x276bf9))['catch'](handleError(_0x3c7e65,null));};exports[_0x1b6b('0xa8')]=function(_0x29459a,_0x5a12a6){var _0x478dc4={'raw':![],'where':{'id':_0x29459a[_0x1b6b('0xa9')]['id']}},_0x1c4952={};_0x1c4952[_0x1b6b('0x39')]=_[_0x1b6b('0x36')](db[_0x1b6b('0x31')][_0x1b6b('0x32')]);_0x1c4952['query']=_[_0x1b6b('0x36')](_0x29459a['query']);_0x1c4952[_0x1b6b('0x37')]=_[_0x1b6b('0x38')](_0x1c4952[_0x1b6b('0x39')],_0x1c4952['query']);_0x478dc4['attributes']=_['intersection'](_0x1c4952[_0x1b6b('0x39')],qs['fields'](_0x29459a[_0x1b6b('0x3b')][_0x1b6b('0x3c')]));_0x478dc4[_0x1b6b('0x3a')]=_0x478dc4[_0x1b6b('0x3a')]['length']?_0x478dc4[_0x1b6b('0x3a')]:_0x1c4952[_0x1b6b('0x39')];if(_0x29459a['query'][_0x1b6b('0xaa')]){_0x478dc4[_0x1b6b('0xab')]=[{'all':!![]}];}_0x478dc4=_[_0x1b6b('0x93')]({},_0x478dc4,_0x29459a[_0x1b6b('0xac')]);return db[_0x1b6b('0x31')][_0x1b6b('0x5b')](_0x478dc4)[_0x1b6b('0x24')](handleEntityNotFound(_0x5a12a6,null))[_0x1b6b('0x24')](respondWithResult(_0x5a12a6,null))[_0x1b6b('0x2f')](handleError(_0x5a12a6,null));};exports[_0x1b6b('0xad')]=function(_0x1ab239,_0x1a5b25){return db[_0x1b6b('0x31')]['create'](_0x1ab239[_0x1b6b('0xae')],{})[_0x1b6b('0x24')](respondWithResult(_0x1a5b25,0xc9))[_0x1b6b('0x2f')](handleError(_0x1a5b25,null));};exports[_0x1b6b('0xaf')]=function(_0x3d90f2,_0x57ab5a){if(_0x3d90f2[_0x1b6b('0xae')]['id']){delete _0x3d90f2['body']['id'];}return db[_0x1b6b('0x31')]['find']({'where':{'id':_0x3d90f2[_0x1b6b('0xa9')]['id']}})[_0x1b6b('0x24')](handleEntityNotFound(_0x57ab5a,null))[_0x1b6b('0x24')](saveUpdates(_0x3d90f2[_0x1b6b('0xae')],null))[_0x1b6b('0x24')](respondWithResult(_0x57ab5a,null))[_0x1b6b('0x2f')](handleError(_0x57ab5a,null));};exports[_0x1b6b('0x25')]=function(_0x4b3e4a,_0x10e742){return db['WhatsappInteraction'][_0x1b6b('0x5b')]({'where':{'id':_0x4b3e4a[_0x1b6b('0xa9')]['id']}})[_0x1b6b('0x24')](handleEntityNotFound(_0x10e742,null))[_0x1b6b('0x24')](removeEntity(_0x10e742,null))[_0x1b6b('0x2f')](handleError(_0x10e742,null));};exports[_0x1b6b('0xb0')]=function(_0x222644,_0x4c897a){return db[_0x1b6b('0x31')][_0x1b6b('0xb0')]()[_0x1b6b('0x24')](respondWithResult(_0x4c897a,null))[_0x1b6b('0x2f')](handleError(_0x4c897a,null));};exports[_0x1b6b('0xb1')]=function(_0x4679c5,_0x10cbfa,_0x35420a){return db['WhatsappMessage'][_0x1b6b('0x5b')]({'where':{'id':_0x4679c5[_0x1b6b('0xa9')]['id']}})[_0x1b6b('0x24')](handleEntityNotFound(_0x10cbfa,null))['then'](function(_0x593451){if(_0x593451){return _0x593451[_0x1b6b('0xb1')](_0x4679c5[_0x1b6b('0xae')][_0x1b6b('0xb2')],_['omit'](_0x4679c5[_0x1b6b('0xae')],[_0x1b6b('0xb2'),'id'])||{});}})[_0x1b6b('0x24')](respondWithResult(_0x10cbfa,null))['catch'](handleError(_0x10cbfa,null));};exports[_0x1b6b('0xb3')]=function(_0x54b1bd,_0x290b44,_0xb991bb){var _0x55ac90={'raw':![],'where':{}};var _0x2e14b8={};var _0x2928b4={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x1b6b('0xb4')]({'where':{'id':_0x54b1bd['params']['id']}})[_0x1b6b('0x24')](handleEntityNotFound(_0x290b44,null))[_0x1b6b('0x24')](function(_0xa6393e){if(_0xa6393e){_0x2e14b8[_0x1b6b('0x39')]=_[_0x1b6b('0x36')](db[_0x1b6b('0xb5')][_0x1b6b('0x32')]);_0x2e14b8[_0x1b6b('0x3b')]=_['keys'](_0x54b1bd[_0x1b6b('0x3b')]);_0x2e14b8[_0x1b6b('0x37')]=_[_0x1b6b('0x38')](_0x2e14b8[_0x1b6b('0x39')],_0x2e14b8[_0x1b6b('0x3b')]);_0x55ac90['attributes']=_[_0x1b6b('0x38')](_0x2e14b8[_0x1b6b('0x39')],qs['fields'](_0x54b1bd[_0x1b6b('0x3b')][_0x1b6b('0x3c')]));_0x55ac90[_0x1b6b('0x3a')]=_0x55ac90[_0x1b6b('0x3a')][_0x1b6b('0x62')]?_0x55ac90[_0x1b6b('0x3a')]:_0x2e14b8['model'];if(!_0x54b1bd['query']['hasOwnProperty'](_0x1b6b('0x3e'))){_0x55ac90[_0x1b6b('0x1f')]=qs[_0x1b6b('0x1f')](_0x54b1bd[_0x1b6b('0x3b')][_0x1b6b('0x1f')]);_0x55ac90[_0x1b6b('0x1d')]=qs['offset'](_0x54b1bd[_0x1b6b('0x3b')][_0x1b6b('0x1d')]);}_0x55ac90[_0x1b6b('0x3f')]=qs[_0x1b6b('0x40')](_0x54b1bd[_0x1b6b('0x3b')]['sort']);_0x55ac90[_0x1b6b('0x41')]=qs['filters'](_[_0x1b6b('0x42')](_0x54b1bd['query'],_0x2e14b8[_0x1b6b('0x37')]));_0x55ac90['where'][_0x1b6b('0xb6')]=_0xa6393e['id'];if(_0x54b1bd[_0x1b6b('0x3b')][_0x1b6b('0x7b')]){_0x55ac90[_0x1b6b('0x41')]=_[_0x1b6b('0x93')](_0x55ac90['where'],{'$or':_[_0x1b6b('0x28')](_0x55ac90[_0x1b6b('0x3a')],function(_0x11c4de){var _0x28546d={};_0x28546d[_0x11c4de]={'$like':'%'+_0x54b1bd[_0x1b6b('0x3b')][_0x1b6b('0x7b')]+'%'};return _0x28546d;})});}if(_0x54b1bd[_0x1b6b('0x3b')][_0x1b6b('0x73')]){var _0x2fd25a=_0x54b1bd[_0x1b6b('0x3b')][_0x1b6b('0x73')][_0x1b6b('0x2c')](',');var _0x1312c8={};_0x1312c8[_0x2fd25a[0x0]]={'$gte':moment(_0x2fd25a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x55ac90['where']=_[_0x1b6b('0x93')](_0x55ac90['where'],_0x1312c8);}_0x55ac90=_[_0x1b6b('0x93')]({},_0x55ac90,_0x54b1bd['options']);return db[_0x1b6b('0xb5')][_0x1b6b('0x20')]({'where':_0x55ac90[_0x1b6b('0x41')]})[_0x1b6b('0x24')](function(_0x18fd86){_0x2928b4[_0x1b6b('0x20')]=_0x18fd86;if(_0x54b1bd[_0x1b6b('0x3b')][_0x1b6b('0xaa')]){_0x55ac90[_0x1b6b('0xab')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x1b6b('0xb7')](_0x55ac90);})[_0x1b6b('0x24')](function(_0x4eb0a7){_0x2928b4[_0x1b6b('0xa7')]=_0x4eb0a7;return _0x2928b4;});}})['then'](respondWithFilteredResult(_0x290b44,_0x55ac90))[_0x1b6b('0x2f')](handleError(_0x290b44,null));};exports[_0x1b6b('0xb8')]=function(_0x4d224e,_0x2f1ebf,_0x48178d){return db[_0x1b6b('0x31')]['find']({'where':{'id':_0x4d224e[_0x1b6b('0xa9')]['id']}})[_0x1b6b('0x24')](handleEntityNotFound(_0x2f1ebf,null))[_0x1b6b('0x24')](function(_0x4e6930){if(_0x4e6930){return _0x4e6930[_0x1b6b('0xb9')](_0x4d224e[_0x1b6b('0xae')][_0x1b6b('0xb2')],_[_0x1b6b('0xba')](_0x4d224e[_0x1b6b('0xae')],[_0x1b6b('0xb2'),'id'])||{})[_0x1b6b('0xbb')](function(){return db[_0x1b6b('0x6a')][_0x1b6b('0xb7')]({'attributes':['id',_0x1b6b('0x27'),_0x1b6b('0x45')],'where':{'id':_0x4d224e['body']['ids']}});})[_0x1b6b('0x24')](function(_0x10dacb){socket[_0x1b6b('0xbc')](_0x1b6b('0xbd'),{'id':Number(_0x4d224e[_0x1b6b('0xa9')]['id']),'tags':_0x10dacb||[]});return{'id':Number(_0x4d224e[_0x1b6b('0xa9')]['id']),'tags':_0x10dacb||[]};});}})[_0x1b6b('0x24')](respondWithResult(_0x2f1ebf,null))[_0x1b6b('0x2f')](handleError(_0x2f1ebf,null));};exports[_0x1b6b('0xbe')]=function(_0x4313fd,_0x3dd5e3,_0xa59021){return db[_0x1b6b('0x31')][_0x1b6b('0x5b')]({'where':{'id':_0x4313fd['params']['id']}})[_0x1b6b('0x24')](handleEntityNotFound(_0x3dd5e3,null))[_0x1b6b('0x24')](function(_0x5d60e4){if(_0x5d60e4){return _0x5d60e4[_0x1b6b('0xbe')](_0x4313fd[_0x1b6b('0x3b')][_0x1b6b('0xb2')]);}})[_0x1b6b('0x24')](respondWithStatusCode(_0x3dd5e3,null))['catch'](handleError(_0x3dd5e3,null));};exports['download']=function(_0x507b30,_0xd73e9e){var _0x31ca18=moment()[_0x1b6b('0xbf')]()['toString']();var _0x5e738c=path[_0x1b6b('0xc0')](config['root'],_0x1b6b('0xc1'),'files',_0x1b6b('0xc2'));var _0x1345e0=path[_0x1b6b('0xc0')](config[_0x1b6b('0xc3')],_0x1b6b('0xc1'),_0x1b6b('0xc4'),'attachments');var _0x288477=path['join'](_0x5e738c,_0x31ca18);var _0x4acf55=util[_0x1b6b('0xc5')]('transcript-%d-%s.zip',_0x507b30[_0x1b6b('0xa9')]['id'],_0x31ca18);var _0x307c3d=path[_0x1b6b('0xc0')](_0x5e738c,_0x4acf55);var _0x18e5ff=[];_0x18e5ff[_0x1b6b('0x2e')]({'model':db[_0x1b6b('0x6b')],'as':_0x1b6b('0x6b'),'attributes':['id','fullname'],'raw':!![]});_0x18e5ff['push']({'model':db[_0x1b6b('0xc6')],'as':'Contact','attributes':['id',_0x1b6b('0xc7'),_0x1b6b('0xc8')],'raw':!![]});if(_0x507b30['query']['attachments']){_0x18e5ff['push']({'model':db[_0x1b6b('0xc9')],'as':_0x1b6b('0xc9'),'raw':!![]});}var _0x4d56ed=[{'model':db[_0x1b6b('0xb5')],'as':'Messages','attributes':['id','body','createdAt','direction',_0x1b6b('0xca'),'read'],'include':_0x18e5ff}];_0x4d56ed[_0x1b6b('0x2e')]({'model':db['WhatsappAccount'],'as':_0x1b6b('0xcb'),'attributes':['id','name']});_0x4d56ed[_0x1b6b('0x2e')]({'model':db[_0x1b6b('0x6b')],'as':_0x1b6b('0xcc'),'attributes':['id',_0x1b6b('0x29')]});return db[_0x1b6b('0x31')]['find']({'where':{'id':_0x507b30[_0x1b6b('0xa9')]['id']},'include':_0x4d56ed})[_0x1b6b('0x24')](handleEntityNotFound(_0xd73e9e,null))['then'](function(_0x3eacf1){if(_0x3eacf1){var _0x3a0391=_0x3eacf1[_0x1b6b('0xcd')]({'plain':!![]});fs[_0x1b6b('0xce')](_0x288477);var _0x3965db={'channel':_0x1b6b('0xcf'),'account':_0x3a0391['Account'][_0x1b6b('0x27')],'agent':_0x3a0391[_0x1b6b('0xcc')]?_0x3a0391[_0x1b6b('0xcc')][_0x1b6b('0x29')]:'N.A.','createdAt':moment(_0x3a0391[_0x1b6b('0x71')])[_0x1b6b('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1b6b('0x91')](),'closedAt':_0x3a0391['closed']?moment(_0x3a0391['closedAt'])[_0x1b6b('0xc5')](_0x1b6b('0xd0'))['toString']():'','disposition':_0x3a0391[_0x1b6b('0xd1')],'messages':_(_0x3a0391[_0x1b6b('0xd2')])[_0x1b6b('0x7b')]({'secret':![]})[_0x1b6b('0x28')](function(_0x456969){if(_0x456969[_0x1b6b('0xc9')]){var _0x25e0de=path[_0x1b6b('0xc0')](_0x1345e0,_0x456969[_0x1b6b('0xc9')][_0x1b6b('0xd3')]);if(fs[_0x1b6b('0xd4')](_0x25e0de)){fs[_0x1b6b('0xd5')](_0x25e0de)[_0x1b6b('0xd6')](fs['createWriteStream'](path[_0x1b6b('0xc0')](_0x288477,_0x456969['Attachment']['basename'])));}}return{'date':moment(_0x456969['createdAt'])['format'](_0x1b6b('0xd0'))[_0x1b6b('0x91')](),'sender':_0x456969[_0x1b6b('0xd7')]==='out'?_0x456969['User']?_0x456969[_0x1b6b('0x6b')]['fullname']:_0x1b6b('0xd8'):_0x456969[_0x1b6b('0x5f')]['firstName']+(_0x456969['Contact'][_0x1b6b('0xc8')]?'\x20'+_0x456969[_0x1b6b('0x5f')][_0x1b6b('0xc8')]:''),'body':_0x456969['Attachment']?_0x456969[_0x1b6b('0xc9')][_0x1b6b('0xd3')]:_0x456969[_0x1b6b('0xae')],'direction':_0x456969[_0x1b6b('0xd7')]==='out'?'A':'C','secret':_0x456969['secret'],'read':_0x456969[_0x1b6b('0x77')],'attachment':_0x456969[_0x1b6b('0xc9')]};})[_0x1b6b('0x64')]()};return ejs[_0x1b6b('0xd9')](path['join'](config[_0x1b6b('0xc3')],_0x1b6b('0xc1'),_0x1b6b('0xda'),_0x1b6b('0xdb')),{'interaction':_0x3965db})[_0x1b6b('0x24')](function(_0x2a5d37){var _0xb28c10=path[_0x1b6b('0xc0')](_0x288477,'transcript-'+_0x3a0391['id']+'-'+_0x31ca18+'.pdf');var _0x560e00={'path':_0xb28c10,'channel':_0x1b6b('0xcf'),'interactionId':_0x3a0391['id']};return pdf[_0x1b6b('0xdc')](_0x2a5d37,_0x560e00);})[_0x1b6b('0x24')](function(){return new BPromise(function(_0x55f980,_0x1ae4ec){zipdir(_0x288477,{'saveTo':_0x307c3d},function(_0x2d0e84,_0x161fb5){if(_0x2d0e84)return _0x1ae4ec(_0x2d0e84);return _0x55f980(_0x161fb5);});})[_0x1b6b('0x24')](function(){return new BPromise(function(_0x254fb1,_0x46b5ce){rimraf(_0x288477,function(_0x56ee43){if(_0x56ee43)_0x46b5ce(_0x56ee43);return _0x254fb1();});});})['then'](function(){return _0xd73e9e[_0x1b6b('0xdd')](_0x307c3d,_0x4acf55,function(_0x4ec7bf){if(_0x4ec7bf){console['log'](_0x1b6b('0xde'),_0x4ec7bf);}else{fs[_0x1b6b('0xdf')](_0x307c3d);}});});});}else{return _0xd73e9e[_0x1b6b('0x1a')](0xc8);}})['catch'](handleError(_0xd73e9e,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 2bcadbe..c341094 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 _0x4746=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0x4746,0xc6));var _0x6474=function(_0x417d0d,_0xa4b3c7){_0x417d0d=_0x417d0d-0x0;var _0x6c32c=_0x4746[_0x417d0d];return _0x6c32c;};'use strict';var EventEmitter=require(_0x6474('0x0'));var WhatsappInteraction=require(_0x6474('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x6474('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x6474('0x2')](0x0);var events={'afterCreate':_0x6474('0x3'),'afterUpdate':_0x6474('0x4'),'afterDestroy':_0x6474('0x5')};function emitEvent(_0x1314f4){return function(_0x4dfa1e,_0x317100,_0x2bcf7c){_0x4dfa1e['getUsers']({'attributes':['id'],'raw':!![]})[_0x6474('0x6')](function(_0x427f79){_0x4dfa1e[_0x6474('0x7')](_0x6474('0x8'),_0x427f79[_0x6474('0x9')](function(_0x2d8a2b){return{'id':_0x2d8a2b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4dfa1e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6474('0x6')](function(_0x5bbee1){_0x4dfa1e['setDataValue'](_0x6474('0xa'),_0x5bbee1[_0x6474('0xb')]);WhatsappInteractionEvents['emit'](_0x1314f4+':'+_0x4dfa1e['id'],_0x4dfa1e);WhatsappInteractionEvents[_0x6474('0xc')](_0x1314f4,_0x4dfa1e);_0x2bcf7c(null);})['catch'](_0x2bcf7c(null));};}for(var e in events){if(events[_0x6474('0xd')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x6474('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xf151=['exports','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x2d16c0,_0x3ccf41){var _0x19ea8a=function(_0x4684f1){while(--_0x4684f1){_0x2d16c0['push'](_0x2d16c0['shift']());}};_0x19ea8a(++_0x3ccf41);}(_0xf151,0xab));var _0x1f15=function(_0x4d0b47,_0x52ff0e){_0x4d0b47=_0x4d0b47-0x0;var _0x2fd803=_0xf151[_0x4d0b47];return _0x2fd803;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x1f15('0x0')];var WhatsappMessage=require(_0x1f15('0x1'))['db'][_0x1f15('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1f15('0x3')](0x0);var events={'afterCreate':_0x1f15('0x4'),'afterUpdate':_0x1f15('0x5'),'afterDestroy':_0x1f15('0x6')};function emitEvent(_0x2fbef0){return function(_0x500179,_0x45df42,_0x5548bb){_0x500179['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1a1c65){_0x500179[_0x1f15('0x7')](_0x1f15('0x8'),_0x1a1c65['map'](function(_0x39fe86){return{'id':_0x39fe86['id']};}));return WhatsappMessage[_0x1f15('0x9')]({'where':{'WhatsappInteractionId':_0x500179['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4e6f42){_0x500179[_0x1f15('0x7')](_0x1f15('0xa'),_0x4e6f42[_0x1f15('0xb')]);WhatsappInteractionEvents[_0x1f15('0xc')](_0x2fbef0+':'+_0x500179['id'],_0x500179);WhatsappInteractionEvents['emit'](_0x2fbef0,_0x500179);_0x5548bb(null);})[_0x1f15('0xd')](_0x5548bb(null));};}for(var e in events){if(events[_0x1f15('0xe')](e)){var event=events[e];WhatsappInteraction[_0x1f15('0xf')](e,emitEvent(event));}}module[_0x1f15('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 880e147..22f1776 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 _0x84c2=['closedAt','format','api','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x1f43d5,_0x3dee5f){var _0x1fa317=function(_0x3c75cc){while(--_0x3c75cc){_0x1f43d5['push'](_0x1f43d5['shift']());}};_0x1fa317(++_0x3dee5f);}(_0x84c2,0x1d6));var _0x284c=function(_0x4f7e3b,_0x46207f){_0x4f7e3b=_0x4f7e3b-0x0;var _0x4b4bc6=_0x84c2[_0x4f7e3b];return _0x4b4bc6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x284c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x284c('0x1'));var fs=require('fs');var path=require(_0x284c('0x2'));var rimraf=require('rimraf');var config=require(_0x284c('0x3'));var attributes=require(_0x284c('0x4'));module[_0x284c('0x5')]=function(_0x240434,_0x28db08){return _0x240434['define'](_0x284c('0x6'),attributes,{'tableName':_0x284c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ec93e,_0x312884,_0x175d6f){if(_0x4ec93e[_0x284c('0x8')](_0x284c('0x9'))){_0x4ec93e[_0x284c('0xa')]=moment()[_0x284c('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x175d6f(null,_0x4ec93e);}}});}; \ No newline at end of file +var _0xfc6b=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction'];(function(_0x42249b,_0x5b22c4){var _0x352ab3=function(_0x2f48fb){while(--_0x2f48fb){_0x42249b['push'](_0x42249b['shift']());}};_0x352ab3(++_0x5b22c4);}(_0xfc6b,0x194));var _0xbfc6=function(_0x2a1b61,_0x584230){_0x2a1b61=_0x2a1b61-0x0;var _0x5d57d7=_0xfc6b[_0x2a1b61];return _0x5d57d7;};'use strict';var _=require(_0xbfc6('0x0'));var util=require(_0xbfc6('0x1'));var logger=require(_0xbfc6('0x2'))(_0xbfc6('0x3'));var moment=require(_0xbfc6('0x4'));var BPromise=require(_0xbfc6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfc6('0x6'));var rimraf=require('rimraf');var config=require(_0xbfc6('0x7'));var attributes=require(_0xbfc6('0x8'));module[_0xbfc6('0x9')]=function(_0x141759,_0x311365){return _0x141759[_0xbfc6('0xa')](_0xbfc6('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31b91b,_0x111031,_0x173457){if(_0x31b91b['changed'](_0xbfc6('0xc'))){_0x31b91b[_0xbfc6('0xd')]=moment()[_0xbfc6('0xe')](_0xbfc6('0xf'));}_0x173457(null,_0x31b91b);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 18c1686..71a9faa 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 _0x1952=['WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','omit','ids','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','request\x20sent','debug'];(function(_0x396fd8,_0xee40c){var _0x427d5c=function(_0x347ea3){while(--_0x347ea3){_0x396fd8['push'](_0x396fd8['shift']());}};_0x427d5c(++_0xee40c);}(_0x1952,0xdc));var _0x2195=function(_0x1dabd8,_0x3d30b0){_0x1dabd8=_0x1dabd8-0x0;var _0x39ca96=_0x1952[_0x1dabd8];return _0x39ca96;};'use strict';var _=require('lodash');var util=require(_0x2195('0x0'));var moment=require(_0x2195('0x1'));var BPromise=require(_0x2195('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2195('0x3'));var db=require(_0x2195('0x4'))['db'];var utils=require(_0x2195('0x5'));var logger=require(_0x2195('0x6'))(_0x2195('0x7'));var config=require('../../config/environment');var jayson=require(_0x2195('0x8'));var client=jayson[_0x2195('0x9')]['http']({'port':0x232a});config[_0x2195('0xa')]=_[_0x2195('0xb')](config[_0x2195('0xa')],{'host':_0x2195('0xc'),'port':0x18eb});var socket=require(_0x2195('0xd'))(new Redis(config[_0x2195('0xa')]));require(_0x2195('0xe'))['register'](socket);function respondWithRpcPromise(_0x55f251,_0x1766aa,_0x2e1d8d){return new BPromise(function(_0x53e1bd,_0x538253){return client[_0x2195('0xf')](_0x55f251,_0x2e1d8d)[_0x2195('0x10')](function(_0x3527ca){logger[_0x2195('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x1766aa,_0x2195('0x12'));logger[_0x2195('0x13')](_0x2195('0x14'),_0x1766aa,_0x2195('0x12'),JSON['stringify'](_0x3527ca));if(_0x3527ca['error']){if(_0x3527ca[_0x2195('0x15')]['code']===0x1f4){logger[_0x2195('0x15')](_0x2195('0x16'),_0x1766aa,_0x3527ca[_0x2195('0x15')]['message']);return _0x538253(_0x3527ca['error'][_0x2195('0x17')]);}logger[_0x2195('0x15')](_0x2195('0x16'),_0x1766aa,_0x3527ca[_0x2195('0x15')]['message']);return _0x53e1bd(_0x3527ca['error'][_0x2195('0x17')]);}else{logger['info'](_0x2195('0x16'),_0x1766aa,_0x2195('0x12'));_0x53e1bd(_0x3527ca['result']['message']);}})[_0x2195('0x18')](function(_0x20370){logger['error'](_0x2195('0x16'),_0x1766aa,_0x20370);_0x538253(_0x20370);});});}exports[_0x2195('0x19')]=function(_0x6bb456){var _0x1ff8fc=this;return new Promise(function(_0x10314c,_0x3348d7){return db[_0x2195('0x1a')][_0x2195('0x1b')](_0x6bb456[_0x2195('0x1c')],{'raw':_0x6bb456[_0x2195('0x1d')]?_0x6bb456[_0x2195('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6bb456[_0x2195('0x1d')]?_0x6bb456[_0x2195('0x1d')][_0x2195('0x1e')]||null:null,'attributes':_0x6bb456[_0x2195('0x1d')]?_0x6bb456[_0x2195('0x1d')][_0x2195('0x1f')]||null:null,'limit':_0x6bb456[_0x2195('0x1d')]?_0x6bb456['options'][_0x2195('0x20')]||null:null})[_0x2195('0x10')](function(_0x11d30c){logger['info']('UpdateWhatsappInteraction',_0x6bb456);logger[_0x2195('0x13')](_0x2195('0x19'),_0x6bb456,JSON[_0x2195('0x21')](_0x11d30c));_0x10314c(_0x11d30c);})[_0x2195('0x18')](function(_0x53b152){logger[_0x2195('0x15')]('UpdateWhatsappInteraction',_0x53b152[_0x2195('0x17')],_0x6bb456);_0x3348d7(_0x1ff8fc[_0x2195('0x15')](0x1f4,_0x53b152[_0x2195('0x17')]));});});};exports[_0x2195('0x22')]=function(_0x3dfdc4){return new Promise(function(_0x4f8d1a,_0x694dd5){return db[_0x2195('0x1a')][_0x2195('0x23')]({'where':_0x3dfdc4['options']?_0x3dfdc4[_0x2195('0x1d')][_0x2195('0x1e')]||null:null})['then'](function(_0x12efd9){if(_0x12efd9){return _0x12efd9[_0x2195('0x24')](_0x3dfdc4[_0x2195('0x1c')]['ids'],_[_0x2195('0x25')](_0x3dfdc4['body'],[_0x2195('0x26'),'id'])||{});}})['spread'](function(_0x494f68){logger[_0x2195('0x11')](_0x2195('0x27'),_0x3dfdc4);logger['debug'](_0x2195('0x27'),_0x3dfdc4,JSON[_0x2195('0x21')](_0x494f68));_0x4f8d1a(_0x494f68);})[_0x2195('0x18')](function(_0xc64c59){logger[_0x2195('0x15')](_0x2195('0x27'),_0xc64c59[_0x2195('0x17')],_0x3dfdc4);_0x694dd5(_this[_0x2195('0x15')](0x1f4,_0xc64c59['message']));});});}; \ No newline at end of file +var _0xcd81=['attributes','limit','debug','catch','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','UpdateWhatsappInteraction','WhatsappInteraction','body','options','where'];(function(_0x2b6482,_0x95e8a8){var _0x53e68f=function(_0x544be1){while(--_0x544be1){_0x2b6482['push'](_0x2b6482['shift']());}};_0x53e68f(++_0x95e8a8);}(_0xcd81,0x14b));var _0x1cd8=function(_0x449491,_0x37a2e0){_0x449491=_0x449491-0x0;var _0x32028d=_0xcd81[_0x449491];return _0x32028d;};'use strict';var _=require(_0x1cd8('0x0'));var util=require(_0x1cd8('0x1'));var moment=require(_0x1cd8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1cd8('0x3'));var fs=require('fs');var Redis=require(_0x1cd8('0x4'));var db=require(_0x1cd8('0x5'))['db'];var utils=require(_0x1cd8('0x6'));var logger=require(_0x1cd8('0x7'))(_0x1cd8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1cd8('0x9')][_0x1cd8('0xa')]({'port':0x232a});config[_0x1cd8('0xb')]=_[_0x1cd8('0xc')](config[_0x1cd8('0xb')],{'host':_0x1cd8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cd8('0xb')]));require(_0x1cd8('0xe'))['register'](socket);function respondWithRpcPromise(_0x4f2fec,_0x57105c,_0xad5f0a){return new BPromise(function(_0x39e902,_0x1e1a55){return client[_0x1cd8('0xf')](_0x4f2fec,_0xad5f0a)[_0x1cd8('0x10')](function(_0x58fff6){logger[_0x1cd8('0x11')](_0x1cd8('0x12'),_0x57105c,'request\x20sent');logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x57105c,'request\x20sent',JSON[_0x1cd8('0x13')](_0x58fff6));if(_0x58fff6['error']){if(_0x58fff6[_0x1cd8('0x14')]['code']===0x1f4){logger[_0x1cd8('0x14')](_0x1cd8('0x12'),_0x57105c,_0x58fff6[_0x1cd8('0x14')]['message']);return _0x1e1a55(_0x58fff6[_0x1cd8('0x14')]['message']);}logger[_0x1cd8('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x57105c,_0x58fff6[_0x1cd8('0x14')][_0x1cd8('0x15')]);return _0x39e902(_0x58fff6[_0x1cd8('0x14')][_0x1cd8('0x15')]);}else{logger[_0x1cd8('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x57105c,_0x1cd8('0x16'));_0x39e902(_0x58fff6[_0x1cd8('0x17')][_0x1cd8('0x15')]);}})['catch'](function(_0x14f673){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x57105c,_0x14f673);_0x1e1a55(_0x14f673);});});}exports[_0x1cd8('0x18')]=function(_0x37f22f){var _0xba9b08=this;return new Promise(function(_0x30bbbc,_0x4b5bb4){return db[_0x1cd8('0x19')]['update'](_0x37f22f[_0x1cd8('0x1a')],{'raw':_0x37f22f[_0x1cd8('0x1b')]?_0x37f22f[_0x1cd8('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37f22f[_0x1cd8('0x1b')]?_0x37f22f[_0x1cd8('0x1b')][_0x1cd8('0x1c')]||null:null,'attributes':_0x37f22f[_0x1cd8('0x1b')]?_0x37f22f[_0x1cd8('0x1b')][_0x1cd8('0x1d')]||null:null,'limit':_0x37f22f[_0x1cd8('0x1b')]?_0x37f22f[_0x1cd8('0x1b')][_0x1cd8('0x1e')]||null:null})['then'](function(_0x1097d9){logger['info'](_0x1cd8('0x18'),_0x37f22f);logger[_0x1cd8('0x1f')](_0x1cd8('0x18'),_0x37f22f,JSON['stringify'](_0x1097d9));_0x30bbbc(_0x1097d9);})[_0x1cd8('0x20')](function(_0x167e01){logger[_0x1cd8('0x14')](_0x1cd8('0x18'),_0x167e01[_0x1cd8('0x15')],_0x37f22f);_0x4b5bb4(_0xba9b08[_0x1cd8('0x14')](0x1f4,_0x167e01[_0x1cd8('0x15')]));});});};exports[_0x1cd8('0x21')]=function(_0x530e7d){return new Promise(function(_0x848de,_0x5009f8){return db['WhatsappInteraction'][_0x1cd8('0x22')]({'where':_0x530e7d[_0x1cd8('0x1b')]?_0x530e7d[_0x1cd8('0x1b')][_0x1cd8('0x1c')]||null:null})['then'](function(_0x129c67){if(_0x129c67){return _0x129c67[_0x1cd8('0x23')](_0x530e7d[_0x1cd8('0x1a')][_0x1cd8('0x24')],_[_0x1cd8('0x25')](_0x530e7d[_0x1cd8('0x1a')],[_0x1cd8('0x24'),'id'])||{});}})[_0x1cd8('0x26')](function(_0x50e41d){logger[_0x1cd8('0x11')](_0x1cd8('0x27'),_0x530e7d);logger[_0x1cd8('0x1f')]('AddTags',_0x530e7d,JSON['stringify'](_0x50e41d));_0x848de(_0x50e41d);})[_0x1cd8('0x20')](function(_0x37b18a){logger['error'](_0x1cd8('0x27'),_0x37b18a['message'],_0x530e7d);_0x5009f8(_this[_0x1cd8('0x14')](0x1f4,_0x37b18a[_0x1cd8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 0493da3..a8d0e01 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 _0xfd43=['remove','update','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x485907,_0x47224d){var _0x3ed143=function(_0x12e968){while(--_0x12e968){_0x485907['push'](_0x485907['shift']());}};_0x3ed143(++_0x47224d);}(_0xfd43,0x1ce));var _0x3fd4=function(_0x19f5b2,_0x4a0e98){_0x19f5b2=_0x19f5b2-0x0;var _0xf42aa1=_0xfd43[_0x19f5b2];return _0xf42aa1;};'use strict';var WhatsappInteractionEvents=require(_0x3fd4('0x0'));var events=[_0x3fd4('0x1'),_0x3fd4('0x2'),_0x3fd4('0x3')];function createListener(_0x17b2a6,_0x8df49f){return function(_0x348b84){_0x8df49f['emit'](_0x17b2a6,_0x348b84);};}function removeListener(_0x159481,_0x2615ff){return function(){WhatsappInteractionEvents[_0x3fd4('0x4')](_0x159481,_0x2615ff);};}exports[_0x3fd4('0x5')]=function(_0xbfa54b){for(var _0x243b52=0x0,_0x5e93c1=events[_0x3fd4('0x6')];_0x243b52<_0x5e93c1;_0x243b52++){var _0x3ca2f2=events[_0x243b52];var _0x14a457=createListener(_0x3fd4('0x7')+_0x3ca2f2,_0xbfa54b);WhatsappInteractionEvents['on'](_0x3ca2f2,_0x14a457);}}; \ No newline at end of file +var _0x76ca=['register','length','save','remove','update','emit'];(function(_0x412ae1,_0x20a4c4){var _0x50bea0=function(_0x2e0f62){while(--_0x2e0f62){_0x412ae1['push'](_0x412ae1['shift']());}};_0x50bea0(++_0x20a4c4);}(_0x76ca,0x182));var _0xa76c=function(_0x22a092,_0x631dad){_0x22a092=_0x22a092-0x0;var _0x2ab45c=_0x76ca[_0x22a092];return _0x2ab45c;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xa76c('0x0'),_0xa76c('0x1'),_0xa76c('0x2')];function createListener(_0x2ad9c1,_0xeee703){return function(_0x29fff7){_0xeee703[_0xa76c('0x3')](_0x2ad9c1,_0x29fff7);};}function removeListener(_0x91ca8,_0x5ac989){return function(){WhatsappInteractionEvents['removeListener'](_0x91ca8,_0x5ac989);};}exports[_0xa76c('0x4')]=function(_0x1cda65){for(var _0x10c950=0x0,_0x5c7cda=events[_0xa76c('0x5')];_0x10c950<_0x5c7cda;_0x10c950++){var _0x40448f=events[_0x10c950];var _0x712d88=createListener('whatsappInteraction:'+_0x40448f,_0x1cda65);WhatsappInteractionEvents['on'](_0x40448f,_0x712d88);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 525b0cc..64850e5 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 _0xa0bc=['delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','post','tracked','whatsappmessage:create','/:id/status','status','put','/:id/accept','/:id/reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0bc,0x143));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xca0b('0x0'));var util=require(_0xca0b('0x1'));var path=require(_0xca0b('0x2'));var timeout=require(_0xca0b('0x3'));var express=require(_0xca0b('0x4'));var router=express[_0xca0b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xca0b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca0b('0x7'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xca0b('0x8')](),controller['index']);router['get'](_0xca0b('0x9'),auth['isAuthenticated'](),controller[_0xca0b('0xa')]);router[_0xca0b('0xb')](_0xca0b('0xc'),auth['isAuthenticated'](),controller[_0xca0b('0xd')]);router[_0xca0b('0xe')]('/',auth['isAuthenticated'](),interaction[_0xca0b('0xf')]('whatsapp',_0xca0b('0x10')),controller['create']);router[_0xca0b('0xe')](_0xca0b('0x11'),controller[_0xca0b('0x12')]);router[_0xca0b('0x13')](_0xca0b('0xc'),auth[_0xca0b('0x8')](),controller['update']);router[_0xca0b('0x13')](_0xca0b('0x14'),auth[_0xca0b('0x8')](),controller['accept']);router['put'](_0xca0b('0x15'),auth['isAuthenticated'](),controller['reject']);router[_0xca0b('0x16')]('/:id',auth[_0xca0b('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc6cb=['index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','create','/:id/status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get'];(function(_0x4cae5b,_0x106d4b){var _0x306473=function(_0x1fe4cd){while(--_0x1fe4cd){_0x4cae5b['push'](_0x4cae5b['shift']());}};_0x306473(++_0x106d4b);}(_0xc6cb,0x1b7));var _0xbc6c=function(_0x3eb9fb,_0x5b8af6){_0x3eb9fb=_0x3eb9fb-0x0;var _0x4c9d13=_0xc6cb[_0x3eb9fb];return _0x4c9d13;};'use strict';var multer=require(_0xbc6c('0x0'));var util=require(_0xbc6c('0x1'));var path=require(_0xbc6c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbc6c('0x3'));var auth=require(_0xbc6c('0x4'));var interaction=require(_0xbc6c('0x5'));var config=require(_0xbc6c('0x6'));var controller=require(_0xbc6c('0x7'));router[_0xbc6c('0x8')]('/',auth['isAuthenticated'](),controller[_0xbc6c('0x9')]);router[_0xbc6c('0x8')](_0xbc6c('0xa'),auth[_0xbc6c('0xb')](),controller[_0xbc6c('0xc')]);router[_0xbc6c('0x8')](_0xbc6c('0xd'),auth[_0xbc6c('0xb')](),controller[_0xbc6c('0xe')]);router[_0xbc6c('0xf')]('/',auth[_0xbc6c('0xb')](),interaction[_0xbc6c('0x10')](_0xbc6c('0x11'),'whatsappmessage:create'),controller[_0xbc6c('0x12')]);router[_0xbc6c('0xf')](_0xbc6c('0x13'),controller['status']);router[_0xbc6c('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xbc6c('0x15')]);router[_0xbc6c('0x14')](_0xbc6c('0x16'),auth[_0xbc6c('0xb')](),controller[_0xbc6c('0x17')]);router['put'](_0xbc6c('0x18'),auth['isAuthenticated'](),controller['reject']);router[_0xbc6c('0x19')](_0xbc6c('0xd'),auth[_0xbc6c('0xb')](),controller[_0xbc6c('0x1a')]);module[_0xbc6c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index f3f9065..0b31447 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 _0xacba=['BOOLEAN','sequelize','exports','out','STRING','DATE'];(function(_0x360043,_0x5372fb){var _0x2b0c6c=function(_0x52445f){while(--_0x52445f){_0x360043['push'](_0x360043['shift']());}};_0x2b0c6c(++_0x5372fb);}(_0xacba,0x151));var _0xaacb=function(_0x148678,_0x11de4b){_0x148678=_0x148678-0x0;var _0x2fb7e7=_0xacba[_0x148678];return _0x2fb7e7;};'use strict';var Sequelize=require(_0xaacb('0x0'));module[_0xaacb('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xaacb('0x2')),'defaultValue':_0xaacb('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaacb('0x3')](0xbe)},'phone':{'type':Sequelize[_0xaacb('0x3')]},'readAt':{'type':Sequelize[_0xaacb('0x4')]},'secret':{'type':Sequelize[_0xaacb('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xaacb('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x427f=['STRING','TEXT','sequelize','exports','medium','ENUM','out','DATE'];(function(_0xc70f18,_0x249c70){var _0x1cf4e2=function(_0x1c5318){while(--_0x1c5318){_0xc70f18['push'](_0xc70f18['shift']());}};_0x1cf4e2(++_0x249c70);}(_0x427f,0x1ba));var _0xf427=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x427f[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xf427('0x0'));module[_0xf427('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf427('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf427('0x3')]('in',_0xf427('0x4')),'defaultValue':_0xf427('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xf427('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf427('0x6')]},'providerResponse':{'type':Sequelize[_0xf427('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 98e220d..ad67bcb 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 _0x8d48=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','name','WhatsappMessage','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','params','keys','find','body','destroy','describe','whatsapp','read','readAt','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','motionChannel','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0xdb3d79,_0x5073ad){var _0x348a10=function(_0x3368cd){while(--_0x3368cd){_0xdb3d79['push'](_0xdb3d79['shift']());}};_0x348a10(++_0x5073ad);}(_0x8d48,0x18b));var _0x88d4=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0x8d48[_0x380af2];return _0x1789dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88d4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88d4('0x1'));var rp=require(_0x88d4('0x2'));var moment=require('moment');var BPromise=require(_0x88d4('0x3'));var Mustache=require(_0x88d4('0x4'));var util=require(_0x88d4('0x5'));var path=require(_0x88d4('0x6'));var sox=require(_0x88d4('0x7'));var csv=require(_0x88d4('0x8'));var ejs=require(_0x88d4('0x9'));var fs=require('fs');var fs_extra=require(_0x88d4('0xa'));var _=require('lodash');var squel=require(_0x88d4('0xb'));var crypto=require(_0x88d4('0xc'));var jsforce=require(_0x88d4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x88d4('0x8'));var querystring=require(_0x88d4('0xe'));var Papa=require('papaparse');var Redis=require(_0x88d4('0xf'));var authService=require(_0x88d4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x88d4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88d4('0x12'))('api');var utils=require(_0x88d4('0x13'));var config=require(_0x88d4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x88d4('0x15'))['db'];config[_0x88d4('0x16')]=_[_0x88d4('0x17')](config[_0x88d4('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x88d4('0x18'))(new Redis(config['redis']));require(_0x88d4('0x19'))[_0x88d4('0x1a')](socket);var jayson=require(_0x88d4('0x1b'));var client=jayson[_0x88d4('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x88d4('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3076e0,_0x1f86b3,_0x453e39,_0x594a24){return new BPromise(function(_0x4d06c7,_0x268284){var _0x5998be=_0x594a24||client;return _0x5998be[_0x88d4('0x1d')](_0x3076e0,_0x453e39)[_0x88d4('0x1e')](function(_0x5a59bd){logger[_0x88d4('0x1f')](_0x88d4('0x20'),_0x1f86b3,_0x88d4('0x21'));logger['debug'](_0x88d4('0x22'),_0x1f86b3,_0x88d4('0x21'),JSON[_0x88d4('0x23')](_0x5a59bd));if(_0x5a59bd[_0x88d4('0x24')]){if(_0x5a59bd[_0x88d4('0x24')][_0x88d4('0x25')]===0x1f4){logger[_0x88d4('0x24')](_0x88d4('0x20'),_0x1f86b3,_0x5a59bd[_0x88d4('0x24')][_0x88d4('0x26')]);return _0x268284(_0x5a59bd['error']['message']);}logger[_0x88d4('0x24')](_0x88d4('0x20'),_0x1f86b3,_0x5a59bd['error'][_0x88d4('0x26')]);return _0x4d06c7(_0x5a59bd[_0x88d4('0x24')][_0x88d4('0x26')]);}else{logger[_0x88d4('0x1f')](_0x88d4('0x20'),_0x1f86b3,_0x88d4('0x21'));_0x4d06c7(_0x5a59bd[_0x88d4('0x27')][_0x88d4('0x26')]);}})[_0x88d4('0x28')](function(_0x1d2d44){logger[_0x88d4('0x24')](_0x88d4('0x20'),_0x1f86b3,_0x1d2d44);_0x268284(_0x1d2d44);});});}function respondWithStatusCode(_0x37abab,_0x551a9f){_0x551a9f=_0x551a9f||0xcc;return function(_0x4d45ce){if(_0x4d45ce){return _0x37abab[_0x88d4('0x29')](_0x551a9f);}return _0x37abab['status'](_0x551a9f)[_0x88d4('0x2a')]();};}function respondWithResult(_0xdf35d7,_0x3e0b12){_0x3e0b12=_0x3e0b12||0xc8;return function(_0x5eddc6){if(_0x5eddc6){return _0xdf35d7[_0x88d4('0x2b')](_0x3e0b12)[_0x88d4('0x2c')](_0x5eddc6);}};}function respondWithFilteredResult(_0x245014,_0x43edcc){return function(_0x33e55b){if(_0x33e55b){var _0x150c41=typeof _0x43edcc['offset']===_0x88d4('0x2d')&&typeof _0x43edcc[_0x88d4('0x2e')]===_0x88d4('0x2d');var _0x24e6c5=_0x33e55b[_0x88d4('0x2f')];var _0x2f0cd2=_0x150c41?0x0:_0x43edcc[_0x88d4('0x30')];var _0x230e91=_0x150c41?_0x33e55b[_0x88d4('0x2f')]:_0x43edcc[_0x88d4('0x30')]+_0x43edcc[_0x88d4('0x2e')];var _0x2174af;if(_0x230e91>=_0x24e6c5){_0x230e91=_0x24e6c5;_0x2174af=0xc8;}else{_0x2174af=0xce;}_0x245014[_0x88d4('0x2b')](_0x2174af);return _0x245014[_0x88d4('0x31')](_0x88d4('0x32'),_0x2f0cd2+'-'+_0x230e91+'/'+_0x24e6c5)[_0x88d4('0x2c')](_0x33e55b);}return null;};}function patchUpdates(_0x5cb3c0){return function(_0x505435){try{jsonpatch[_0x88d4('0x33')](_0x505435,_0x5cb3c0,!![]);}catch(_0x58512b){return BPromise[_0x88d4('0x34')](_0x58512b);}return _0x505435[_0x88d4('0x35')]();};}function saveUpdates(_0x29bc21,_0x5aaff8){return function(_0x233e67){if(_0x233e67){return _0x233e67[_0x88d4('0x36')](_0x29bc21)['then'](function(_0x184470){return _0x184470;});}return null;};}function removeEntity(_0x4c09a9,_0x39a4f1){return function(_0x1c3c71){if(_0x1c3c71){return _0x1c3c71['destroy']()[_0x88d4('0x1e')](function(){_0x4c09a9[_0x88d4('0x2b')](0xcc)[_0x88d4('0x2a')]();});}};}function handleEntityNotFound(_0x1a719f,_0x15dd0b){return function(_0xf10fa6){if(!_0xf10fa6){_0x1a719f['sendStatus'](0x194);}return _0xf10fa6;};}function handleError(_0x317208,_0x1e34e4){_0x1e34e4=_0x1e34e4||0x1f4;return function(_0x2ad9e0){logger[_0x88d4('0x24')](_0x2ad9e0['stack']);if(_0x2ad9e0[_0x88d4('0x37')]){delete _0x2ad9e0['name'];}_0x317208[_0x88d4('0x2b')](_0x1e34e4)['send'](_0x2ad9e0);};}exports['index']=function(_0x4fe76e,_0x2028a5){var _0x2542a3={},_0x5392e7={},_0x14da1f={'count':0x0,'rows':[]};var _0x6cf66d=_['map'](db[_0x88d4('0x38')][_0x88d4('0x39')],function(_0x31c2eb){return{'name':_0x31c2eb[_0x88d4('0x3a')],'type':_0x31c2eb[_0x88d4('0x3b')][_0x88d4('0x3c')]};});_0x5392e7[_0x88d4('0x3d')]=_[_0x88d4('0x3e')](_0x6cf66d,_0x88d4('0x37'));_0x5392e7[_0x88d4('0x3f')]=_['keys'](_0x4fe76e[_0x88d4('0x3f')]);_0x5392e7['filters']=_['intersection'](_0x5392e7['model'],_0x5392e7[_0x88d4('0x3f')]);_0x2542a3[_0x88d4('0x40')]=_[_0x88d4('0x41')](_0x5392e7['model'],qs[_0x88d4('0x42')](_0x4fe76e['query'][_0x88d4('0x42')]));_0x2542a3['attributes']=_0x2542a3[_0x88d4('0x40')][_0x88d4('0x43')]?_0x2542a3[_0x88d4('0x40')]:_0x5392e7['model'];if(!_0x4fe76e['query']['hasOwnProperty']('nolimit')){_0x2542a3['limit']=qs[_0x88d4('0x2e')](_0x4fe76e[_0x88d4('0x3f')][_0x88d4('0x2e')]);_0x2542a3[_0x88d4('0x30')]=qs[_0x88d4('0x30')](_0x4fe76e['query'][_0x88d4('0x30')]);}_0x2542a3[_0x88d4('0x44')]=qs[_0x88d4('0x45')](_0x4fe76e['query'][_0x88d4('0x45')]);_0x2542a3[_0x88d4('0x46')]=qs[_0x88d4('0x47')](_[_0x88d4('0x48')](_0x4fe76e[_0x88d4('0x3f')],_0x5392e7[_0x88d4('0x47')]),_0x6cf66d);if(_0x4fe76e[_0x88d4('0x3f')][_0x88d4('0x49')]){_0x2542a3['where']=_[_0x88d4('0x4a')](_0x2542a3[_0x88d4('0x46')],{'$or':_[_0x88d4('0x3e')](_0x6cf66d,function(_0x3cb04e){if(_0x3cb04e[_0x88d4('0x3b')]!=='VIRTUAL'){var _0x18dc48={};_0x18dc48[_0x3cb04e[_0x88d4('0x37')]]={'$like':'%'+_0x4fe76e[_0x88d4('0x3f')][_0x88d4('0x49')]+'%'};return _0x18dc48;}})});}_0x2542a3=_[_0x88d4('0x4a')]({},_0x2542a3,_0x4fe76e[_0x88d4('0x4b')]);var _0x336eb4={'where':_0x2542a3[_0x88d4('0x46')]};return db[_0x88d4('0x38')][_0x88d4('0x2f')](_0x336eb4)[_0x88d4('0x1e')](function(_0x1464f6){_0x14da1f['count']=_0x1464f6;if(_0x4fe76e[_0x88d4('0x3f')][_0x88d4('0x4c')]){_0x2542a3[_0x88d4('0x4d')]=[{'all':!![]}];}return db[_0x88d4('0x38')][_0x88d4('0x4e')](_0x2542a3);})[_0x88d4('0x1e')](function(_0x545edd){_0x14da1f['rows']=_0x545edd;return _0x14da1f;})['then'](respondWithFilteredResult(_0x2028a5,_0x2542a3))[_0x88d4('0x28')](handleError(_0x2028a5,null));};exports['show']=function(_0xd2360a,_0x2097e9){var _0x6b2533={'raw':!![],'where':{'id':_0xd2360a[_0x88d4('0x4f')]['id']}},_0x139718={};_0x139718['model']=_[_0x88d4('0x50')](db[_0x88d4('0x38')][_0x88d4('0x39')]);_0x139718[_0x88d4('0x3f')]=_[_0x88d4('0x50')](_0xd2360a[_0x88d4('0x3f')]);_0x139718[_0x88d4('0x47')]=_[_0x88d4('0x41')](_0x139718[_0x88d4('0x3d')],_0x139718[_0x88d4('0x3f')]);_0x6b2533[_0x88d4('0x40')]=_[_0x88d4('0x41')](_0x139718['model'],qs[_0x88d4('0x42')](_0xd2360a[_0x88d4('0x3f')][_0x88d4('0x42')]));_0x6b2533[_0x88d4('0x40')]=_0x6b2533[_0x88d4('0x40')]['length']?_0x6b2533['attributes']:_0x139718[_0x88d4('0x3d')];if(_0xd2360a[_0x88d4('0x3f')][_0x88d4('0x4c')]){_0x6b2533['include']=[{'all':!![]}];}_0x6b2533=_['merge']({},_0x6b2533,_0xd2360a[_0x88d4('0x4b')]);return db[_0x88d4('0x38')][_0x88d4('0x51')](_0x6b2533)[_0x88d4('0x1e')](handleEntityNotFound(_0x2097e9,null))[_0x88d4('0x1e')](respondWithResult(_0x2097e9,null))[_0x88d4('0x28')](handleError(_0x2097e9,null));};exports['create']=function(_0x71b970,_0x40fc5d){return db[_0x88d4('0x38')]['create'](_0x71b970[_0x88d4('0x52')],{})[_0x88d4('0x1e')](respondWithResult(_0x40fc5d,0xc9))[_0x88d4('0x28')](handleError(_0x40fc5d,null));};exports['update']=function(_0x5260af,_0xc0dba3){if(_0x5260af[_0x88d4('0x52')]['id']){delete _0x5260af[_0x88d4('0x52')]['id'];}return db[_0x88d4('0x38')][_0x88d4('0x51')]({'where':{'id':_0x5260af[_0x88d4('0x4f')]['id']}})['then'](handleEntityNotFound(_0xc0dba3,null))[_0x88d4('0x1e')](saveUpdates(_0x5260af['body'],null))[_0x88d4('0x1e')](respondWithResult(_0xc0dba3,null))[_0x88d4('0x28')](handleError(_0xc0dba3,null));};exports[_0x88d4('0x53')]=function(_0x582936,_0x1f954e){return db[_0x88d4('0x38')][_0x88d4('0x51')]({'where':{'id':_0x582936[_0x88d4('0x4f')]['id']}})[_0x88d4('0x1e')](handleEntityNotFound(_0x1f954e,null))[_0x88d4('0x1e')](removeEntity(_0x1f954e,null))['catch'](handleError(_0x1f954e,null));};exports['describe']=function(_0x54509c,_0x2979f8){return db[_0x88d4('0x38')][_0x88d4('0x54')]()[_0x88d4('0x1e')](respondWithResult(_0x2979f8,null))['catch'](handleError(_0x2979f8,null));};var interaction_log=require(_0x88d4('0x12'))('whatsapp-interactions');exports['accept']=function(_0x571af4,_0x49fb9e,_0x760b95){var _0x54df3f={'agent':{},'channel':_0x88d4('0x55')};if(_0x571af4[_0x88d4('0x52')]['id']){delete _0x571af4[_0x88d4('0x52')]['id'];}_0x571af4['body'][_0x88d4('0x56')]=!![];_0x571af4[_0x88d4('0x52')][_0x88d4('0x57')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x571af4[_0x88d4('0x52')][_0x88d4('0x58')]=_0x571af4['body'][_0x88d4('0x58')]||_0x571af4[_0x88d4('0x59')]['id'];_0x54df3f[_0x88d4('0x5a')]['id']=_0x571af4[_0x88d4('0x52')][_0x88d4('0x58')];return db['WhatsappMessage']['find']({'where':{'id':_0x571af4[_0x88d4('0x4f')]['id'],'UserId':null}})[_0x88d4('0x1e')](handleEntityNotFound(_0x49fb9e,null))['then'](saveUpdates(_0x571af4[_0x88d4('0x52')],null))[_0x88d4('0x1e')](function(_0x595026){if(_0x595026){_0x54df3f['message']=_0x595026[_0x88d4('0x5b')]({'plain':!![]});return db[_0x88d4('0x5c')]['find']({'where':{'id':_0x595026[_0x88d4('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x49fb9e,null))[_0x88d4('0x1e')](function(_0x252f2e){if(_0x252f2e){return _0x252f2e[_0x88d4('0x36')]({'UserId':_0x571af4[_0x88d4('0x52')]['UserId'],'read1stAt':_[_0x88d4('0x5e')](_0x252f2e[_0x88d4('0x5f')])?moment()[_0x88d4('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x88d4('0x1e')](function(_0x91bbdb){if(_0x91bbdb){_0x54df3f[_0x88d4('0x61')]=_0x91bbdb[_0x88d4('0x5b')]({'plain':!![]});interaction_log['info'](_0x88d4('0x62'),_0x571af4[_0x88d4('0x59')]['id'],_0x571af4[_0x88d4('0x59')][_0x88d4('0x37')],_0x571af4[_0x88d4('0x59')][_0x88d4('0x63')],_0x54df3f[_0x88d4('0x61')]['id'],_0x571af4[_0x88d4('0x52')]?JSON['stringify'](_0x571af4[_0x88d4('0x52')]):_0x88d4('0x64'));return respondWithRpcPromise(_0x88d4('0x65'),_0x88d4('0x66'),_0x54df3f);}return null;})[_0x88d4('0x1e')](function(_0x15dc11){var _0x464dd4=_0x88d4('0x67')+_0x15dc11[_0x88d4('0x26')][_0x88d4('0x68')];return db[_0x88d4('0x69')][_0x88d4('0x3f')](_0x464dd4,{'type':db['Sequelize'][_0x88d4('0x6a')][_0x88d4('0x6b')],'raw':!![]})['then'](function(_0xa1c4c1){return _0xa1c4c1;});})[_0x88d4('0x1e')](function(_0x517806){if(_0x517806){_0x54df3f[_0x88d4('0x26')][_0x88d4('0x6c')]=_0x517806[0x0];if(!_0x571af4[_0x88d4('0x52')][_0x88d4('0x58')])return;return db[_0x88d4('0x6d')]['find']({'where':{'id':_0x571af4[_0x88d4('0x52')][_0x88d4('0x58')],'role':_0x88d4('0x5a')},'attributes':['id',_0x88d4('0x37'),_0x88d4('0x6e'),_0x88d4('0x6f'),'internal'],'raw':!![]});}return null;})[_0x88d4('0x1e')](function(_0x3e5eeb){if(!_0x3e5eeb)return null;_0x54df3f[_0x88d4('0x26')][_0x88d4('0x5a')]=_0x3e5eeb;return _0x54df3f;})['then'](function(_0x15556b){if(_0x15556b){if(_0x571af4[_0x88d4('0x52')][_0x88d4('0x70')]){_0x54df3f['message'][_0x88d4('0x71')]=util[_0x88d4('0x60')](_0x88d4('0x72'),_0x571af4['user']['name']);_0x54df3f[_0x88d4('0x26')]['channel']=_0x54df3f[_0x88d4('0x73')];_0x54df3f['message']['motionChannel']=_0x54df3f[_0x88d4('0x73')];_0x54df3f['message'][_0x88d4('0x74')]='accept';return respondWithRpcPromise(_0x88d4('0x75'),_0x88d4('0x75'),{'event':_0x88d4('0x76'),'message':_0x54df3f[_0x88d4('0x26')]},client9002)[_0x88d4('0x1e')](function(){return _0x54df3f;});}return _0x54df3f;}return null;})['then'](respondWithResult(_0x49fb9e,null))[_0x88d4('0x28')](handleError(_0x49fb9e,null));};var interaction_log=require(_0x88d4('0x12'))(_0x88d4('0x77'));exports[_0x88d4('0x34')]=function(_0x1fc3ca,_0x1b35a9,_0x54a7dc){var _0x1253ef={'agent':{},'channel':_0x88d4('0x55')};if(_0x1fc3ca[_0x88d4('0x52')]['id']){delete _0x1fc3ca[_0x88d4('0x52')]['id'];}_0x1fc3ca[_0x88d4('0x52')][_0x88d4('0x58')]=_0x1fc3ca[_0x88d4('0x52')][_0x88d4('0x58')]||_0x1fc3ca['user']['id'];_0x1253ef['agent']['id']=_0x1fc3ca[_0x88d4('0x52')][_0x88d4('0x58')];return db[_0x88d4('0x38')][_0x88d4('0x51')]({'where':{'id':_0x1fc3ca['params']['id'],'UserId':null}})[_0x88d4('0x1e')](handleEntityNotFound(_0x1b35a9,null))['then'](function(_0x4cc102){if(_0x4cc102){_0x1253ef[_0x88d4('0x26')]=_0x4cc102['get']({'plain':!![]});return db['WhatsappInteraction'][_0x88d4('0x51')]({'where':{'id':_0x4cc102[_0x88d4('0x5d')]}});}return null;})[_0x88d4('0x1e')](handleEntityNotFound(_0x1b35a9,null))[_0x88d4('0x1e')](function(_0x255092){if(_0x255092){_0x1253ef['interaction']=_0x255092[_0x88d4('0x5b')]({'plain':!![]});interaction_log['info'](_0x88d4('0x78'),_0x1fc3ca[_0x88d4('0x59')]['id'],_0x1fc3ca[_0x88d4('0x59')][_0x88d4('0x37')],_0x1fc3ca[_0x88d4('0x59')][_0x88d4('0x63')],_0x1253ef['interaction']['id'],_0x1fc3ca[_0x88d4('0x52')]?JSON[_0x88d4('0x23')](_0x1fc3ca[_0x88d4('0x52')]):_0x88d4('0x64'));return respondWithRpcPromise(_0x88d4('0x79'),_0x88d4('0x7a'),_0x1253ef);}return null;})[_0x88d4('0x1e')](function(_0x597621){var _0x5f30b9=_0x88d4('0x67')+_0x597621[_0x88d4('0x26')][_0x88d4('0x68')];return db[_0x88d4('0x69')][_0x88d4('0x3f')](_0x5f30b9,{'type':db[_0x88d4('0x7b')][_0x88d4('0x6a')][_0x88d4('0x6b')],'raw':!![]})['then'](function(_0x2f48d8){return _0x2f48d8;});})['then'](function(_0x4a848e){if(_0x4a848e){_0x1253ef[_0x88d4('0x26')][_0x88d4('0x6c')]=_0x4a848e[0x0];if(!_0x1fc3ca['body'][_0x88d4('0x58')])return;return db[_0x88d4('0x6d')][_0x88d4('0x51')]({'where':{'id':_0x1fc3ca['body'][_0x88d4('0x58')],'role':_0x88d4('0x5a')},'attributes':['id',_0x88d4('0x37'),_0x88d4('0x6e'),_0x88d4('0x6f'),'internal'],'raw':!![]});}return null;})[_0x88d4('0x1e')](function(_0x2fb852){if(!_0x2fb852)return null;_0x1253ef['message'][_0x88d4('0x5a')]=_0x2fb852;return _0x1253ef;})[_0x88d4('0x1e')](function(_0x537e4c){if(_0x537e4c){_0x537e4c[_0x88d4('0x26')][_0x88d4('0x71')]=util[_0x88d4('0x60')](_0x88d4('0x72'),_0x1fc3ca[_0x88d4('0x59')][_0x88d4('0x37')]);_0x537e4c['message'][_0x88d4('0x73')]=_0x1253ef['channel'];_0x537e4c[_0x88d4('0x26')][_0x88d4('0x7c')]=_0x1253ef[_0x88d4('0x73')];_0x537e4c[_0x88d4('0x26')][_0x88d4('0x74')]=_0x88d4('0x34');respondWithRpcPromise(_0x88d4('0x75'),_0x88d4('0x75'),{'event':'rejectmessage','message':_0x537e4c['message']},client9002);return _0x1253ef;}return null;})['then'](respondWithResult(_0x1b35a9,null))[_0x88d4('0x28')](handleError(_0x1b35a9,null));};exports['status']=function(_0x37f6ce,_0x3aca99,_0x4e9e98){if(_0x37f6ce[_0x88d4('0x52')]['id']){delete _0x37f6ce[_0x88d4('0x52')]['id'];}var _0xbee408;return db['WhatsappMessage'][_0x88d4('0x51')]({'where':{'id':_0x37f6ce[_0x88d4('0x4f')]['id']}})[_0x88d4('0x1e')](handleEntityNotFound(_0x3aca99,null))[_0x88d4('0x1e')](function(_0x37f997){if(_0x37f997){_0xbee408=_0x37f997;return db[_0x88d4('0x7d')][_0x88d4('0x51')]({'where':{'id':_0x37f997[_0x88d4('0x7e')]}});}})[_0x88d4('0x1e')](handleEntityNotFound(_0x3aca99,null))['then'](function(_0x4a8089){if(_0x4a8089){logger[_0x88d4('0x7f')](_0x88d4('0x80'),_0x88d4('0x2b'),_0x88d4('0x81'),_0x4a8089[_0x88d4('0x3b')],util['inspect'](_0x37f6ce['body'],{'showHidden':![],'depth':null}));switch(_0x4a8089[_0x88d4('0x3b')]){case _0x88d4('0x82'):if(_0x37f6ce[_0x88d4('0x52')][_0x88d4('0x83')]&&_0x37f6ce[_0x88d4('0x52')][_0x88d4('0x83')]===_0xbee408[_0x88d4('0x84')]&&_0x37f6ce[_0x88d4('0x52')][_0x88d4('0x85')]&&_0x37f6ce['body'][_0x88d4('0x85')]===_0x88d4('0x56')){return _0xbee408['update']({'read':!![]});}else{logger['error'](_0x88d4('0x86'),'status',_0x88d4('0x82'),util[_0x88d4('0x87')](_0x37f6ce['body'],{'showHidden':![],'depth':null}));}break;}return _0xbee408;}})[_0x88d4('0x1e')](respondWithResult(_0x3aca99,null))['catch'](handleError(_0x3aca99,null));}; \ No newline at end of file +var _0x4f41=['request\x20sent','debug','WhatsappMessage,\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','update','destroy','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','WhatsappMessage','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','describe','whatsapp-interactions','whatsapp','read','readAt','format','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','User','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','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','defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s'];(function(_0x5b8972,_0x24f4c6){var _0x381ce1=function(_0x1a7702){while(--_0x1a7702){_0x5b8972['push'](_0x5b8972['shift']());}};_0x381ce1(++_0x24f4c6);}(_0x4f41,0x6d));var _0x14f4=function(_0x13b53d,_0x2d40c6){_0x13b53d=_0x13b53d-0x0;var _0x45c927=_0x4f41[_0x13b53d];return _0x45c927;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14f4('0x0'));var zipdir=require(_0x14f4('0x1'));var jsonpatch=require(_0x14f4('0x2'));var rp=require('request-promise');var moment=require(_0x14f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x14f4('0x4'));var util=require('util');var path=require(_0x14f4('0x5'));var sox=require(_0x14f4('0x6'));var csv=require(_0x14f4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x14f4('0x8'));var jsforce=require(_0x14f4('0x9'));var deskjs=require(_0x14f4('0xa'));var toCsv=require(_0x14f4('0x7'));var querystring=require(_0x14f4('0xb'));var Papa=require(_0x14f4('0xc'));var Redis=require(_0x14f4('0xd'));var authService=require(_0x14f4('0xe'));var qs=require(_0x14f4('0xf'));var as=require(_0x14f4('0x10'));var hardwareService=require(_0x14f4('0x11'));var logger=require(_0x14f4('0x12'))('api');var utils=require(_0x14f4('0x13'));var config=require(_0x14f4('0x14'));var licenseUtil=require(_0x14f4('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x14f4('0x16')](config[_0x14f4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x14f4('0x18'))(new Redis(config[_0x14f4('0x17')]));require(_0x14f4('0x19'))[_0x14f4('0x1a')](socket);var jayson=require(_0x14f4('0x1b'));var client=jayson['client'][_0x14f4('0x1c')]({'port':0x232c});var client9002=jayson[_0x14f4('0x1d')][_0x14f4('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2f52ca,_0x16c534,_0x544d13,_0x5d5230){return new BPromise(function(_0x1dbf08,_0x226cae){var _0xb3a52c=_0x5d5230||client;return _0xb3a52c[_0x14f4('0x1e')](_0x2f52ca,_0x544d13)[_0x14f4('0x1f')](function(_0x3c6482){logger[_0x14f4('0x20')](_0x14f4('0x21'),_0x16c534,_0x14f4('0x22'));logger[_0x14f4('0x23')](_0x14f4('0x24'),_0x16c534,_0x14f4('0x22'),JSON[_0x14f4('0x25')](_0x3c6482));if(_0x3c6482[_0x14f4('0x26')]){if(_0x3c6482['error'][_0x14f4('0x27')]===0x1f4){logger[_0x14f4('0x26')](_0x14f4('0x21'),_0x16c534,_0x3c6482[_0x14f4('0x26')][_0x14f4('0x28')]);return _0x226cae(_0x3c6482[_0x14f4('0x26')][_0x14f4('0x28')]);}logger[_0x14f4('0x26')](_0x14f4('0x21'),_0x16c534,_0x3c6482[_0x14f4('0x26')][_0x14f4('0x28')]);return _0x1dbf08(_0x3c6482[_0x14f4('0x26')][_0x14f4('0x28')]);}else{logger[_0x14f4('0x20')](_0x14f4('0x21'),_0x16c534,_0x14f4('0x22'));_0x1dbf08(_0x3c6482[_0x14f4('0x29')][_0x14f4('0x28')]);}})['catch'](function(_0x47f5ee){logger['error'](_0x14f4('0x21'),_0x16c534,_0x47f5ee);_0x226cae(_0x47f5ee);});});}function respondWithStatusCode(_0x2ec36e,_0x1818a3){_0x1818a3=_0x1818a3||0xcc;return function(_0x420b4f){if(_0x420b4f){return _0x2ec36e[_0x14f4('0x2a')](_0x1818a3);}return _0x2ec36e[_0x14f4('0x2b')](_0x1818a3)[_0x14f4('0x2c')]();};}function respondWithResult(_0x37301f,_0x3cfc84){_0x3cfc84=_0x3cfc84||0xc8;return function(_0x4a1c8e){if(_0x4a1c8e){return _0x37301f[_0x14f4('0x2b')](_0x3cfc84)[_0x14f4('0x2d')](_0x4a1c8e);}};}function respondWithFilteredResult(_0x23930f,_0x5c7c10){return function(_0x2d5ba0){if(_0x2d5ba0){var _0xf9574a=typeof _0x5c7c10[_0x14f4('0x2e')]===_0x14f4('0x2f')&&typeof _0x5c7c10[_0x14f4('0x30')]==='undefined';var _0xdcbaf1=_0x2d5ba0[_0x14f4('0x31')];var _0x28be71=_0xf9574a?0x0:_0x5c7c10['offset'];var _0x1f1899=_0xf9574a?_0x2d5ba0['count']:_0x5c7c10[_0x14f4('0x2e')]+_0x5c7c10[_0x14f4('0x30')];var _0x2e2cd4;if(_0x1f1899>=_0xdcbaf1){_0x1f1899=_0xdcbaf1;_0x2e2cd4=0xc8;}else{_0x2e2cd4=0xce;}_0x23930f[_0x14f4('0x2b')](_0x2e2cd4);return _0x23930f[_0x14f4('0x32')](_0x14f4('0x33'),_0x28be71+'-'+_0x1f1899+'/'+_0xdcbaf1)['json'](_0x2d5ba0);}return null;};}function patchUpdates(_0x232221){return function(_0x4c2840){try{jsonpatch[_0x14f4('0x34')](_0x4c2840,_0x232221,!![]);}catch(_0xfa192f){return BPromise[_0x14f4('0x35')](_0xfa192f);}return _0x4c2840[_0x14f4('0x36')]();};}function saveUpdates(_0x92c557,_0x315fa0){return function(_0x2d9fae){if(_0x2d9fae){return _0x2d9fae[_0x14f4('0x37')](_0x92c557)[_0x14f4('0x1f')](function(_0x17a9b9){return _0x17a9b9;});}return null;};}function removeEntity(_0x441132,_0x21e8a6){return function(_0x5ccf97){if(_0x5ccf97){return _0x5ccf97[_0x14f4('0x38')]()[_0x14f4('0x1f')](function(){_0x441132[_0x14f4('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x153e88,_0x2b1721){return function(_0xd1a9b8){if(!_0xd1a9b8){_0x153e88['sendStatus'](0x194);}return _0xd1a9b8;};}function handleError(_0x1d3353,_0x5a022a){_0x5a022a=_0x5a022a||0x1f4;return function(_0x4699b2){logger[_0x14f4('0x26')](_0x4699b2[_0x14f4('0x39')]);if(_0x4699b2[_0x14f4('0x3a')]){delete _0x4699b2[_0x14f4('0x3a')];}_0x1d3353[_0x14f4('0x2b')](_0x5a022a)[_0x14f4('0x3b')](_0x4699b2);};}exports[_0x14f4('0x3c')]=function(_0x1a1323,_0x30c05c){var _0xf1b60c={},_0x3abb47={},_0x351865={'count':0x0,'rows':[]};var _0x14739b=_[_0x14f4('0x3d')](db['WhatsappMessage']['rawAttributes'],function(_0x4a0fbc){return{'name':_0x4a0fbc[_0x14f4('0x3e')],'type':_0x4a0fbc[_0x14f4('0x3f')]['key']};});_0x3abb47[_0x14f4('0x40')]=_[_0x14f4('0x3d')](_0x14739b,_0x14f4('0x3a'));_0x3abb47[_0x14f4('0x41')]=_[_0x14f4('0x42')](_0x1a1323[_0x14f4('0x41')]);_0x3abb47[_0x14f4('0x43')]=_[_0x14f4('0x44')](_0x3abb47['model'],_0x3abb47['query']);_0xf1b60c[_0x14f4('0x45')]=_[_0x14f4('0x44')](_0x3abb47['model'],qs[_0x14f4('0x46')](_0x1a1323['query'][_0x14f4('0x46')]));_0xf1b60c['attributes']=_0xf1b60c[_0x14f4('0x45')][_0x14f4('0x47')]?_0xf1b60c[_0x14f4('0x45')]:_0x3abb47[_0x14f4('0x40')];if(!_0x1a1323['query'][_0x14f4('0x48')](_0x14f4('0x49'))){_0xf1b60c[_0x14f4('0x30')]=qs[_0x14f4('0x30')](_0x1a1323[_0x14f4('0x41')]['limit']);_0xf1b60c[_0x14f4('0x2e')]=qs[_0x14f4('0x2e')](_0x1a1323[_0x14f4('0x41')][_0x14f4('0x2e')]);}_0xf1b60c[_0x14f4('0x4a')]=qs[_0x14f4('0x4b')](_0x1a1323[_0x14f4('0x41')][_0x14f4('0x4b')]);_0xf1b60c[_0x14f4('0x4c')]=qs['filters'](_[_0x14f4('0x4d')](_0x1a1323[_0x14f4('0x41')],_0x3abb47[_0x14f4('0x43')]),_0x14739b);if(_0x1a1323[_0x14f4('0x41')][_0x14f4('0x4e')]){_0xf1b60c[_0x14f4('0x4c')]=_[_0x14f4('0x4f')](_0xf1b60c[_0x14f4('0x4c')],{'$or':_[_0x14f4('0x3d')](_0x14739b,function(_0x3e0df4){if(_0x3e0df4[_0x14f4('0x3f')]!==_0x14f4('0x50')){var _0x4b89bf={};_0x4b89bf[_0x3e0df4[_0x14f4('0x3a')]]={'$like':'%'+_0x1a1323[_0x14f4('0x41')][_0x14f4('0x4e')]+'%'};return _0x4b89bf;}})});}_0xf1b60c=_[_0x14f4('0x4f')]({},_0xf1b60c,_0x1a1323['options']);var _0x4b3eda={'where':_0xf1b60c[_0x14f4('0x4c')]};return db[_0x14f4('0x51')][_0x14f4('0x31')](_0x4b3eda)[_0x14f4('0x1f')](function(_0x5f5cdc){_0x351865[_0x14f4('0x31')]=_0x5f5cdc;if(_0x1a1323[_0x14f4('0x41')][_0x14f4('0x52')]){_0xf1b60c[_0x14f4('0x53')]=[{'all':!![]}];}return db[_0x14f4('0x51')]['findAll'](_0xf1b60c);})[_0x14f4('0x1f')](function(_0x58fdc8){_0x351865[_0x14f4('0x54')]=_0x58fdc8;return _0x351865;})[_0x14f4('0x1f')](respondWithFilteredResult(_0x30c05c,_0xf1b60c))[_0x14f4('0x55')](handleError(_0x30c05c,null));};exports[_0x14f4('0x56')]=function(_0x598b07,_0xc7611c){var _0x5d7971={'raw':!![],'where':{'id':_0x598b07[_0x14f4('0x57')]['id']}},_0x2715f8={};_0x2715f8[_0x14f4('0x40')]=_[_0x14f4('0x42')](db['WhatsappMessage'][_0x14f4('0x58')]);_0x2715f8[_0x14f4('0x41')]=_[_0x14f4('0x42')](_0x598b07[_0x14f4('0x41')]);_0x2715f8[_0x14f4('0x43')]=_[_0x14f4('0x44')](_0x2715f8[_0x14f4('0x40')],_0x2715f8['query']);_0x5d7971[_0x14f4('0x45')]=_[_0x14f4('0x44')](_0x2715f8[_0x14f4('0x40')],qs[_0x14f4('0x46')](_0x598b07['query'][_0x14f4('0x46')]));_0x5d7971[_0x14f4('0x45')]=_0x5d7971[_0x14f4('0x45')][_0x14f4('0x47')]?_0x5d7971['attributes']:_0x2715f8['model'];if(_0x598b07[_0x14f4('0x41')]['includeAll']){_0x5d7971['include']=[{'all':!![]}];}_0x5d7971=_[_0x14f4('0x4f')]({},_0x5d7971,_0x598b07[_0x14f4('0x59')]);return db[_0x14f4('0x51')][_0x14f4('0x5a')](_0x5d7971)['then'](handleEntityNotFound(_0xc7611c,null))[_0x14f4('0x1f')](respondWithResult(_0xc7611c,null))['catch'](handleError(_0xc7611c,null));};exports[_0x14f4('0x5b')]=function(_0x49fb12,_0x538d14){return db[_0x14f4('0x51')][_0x14f4('0x5b')](_0x49fb12['body'],{})[_0x14f4('0x1f')](respondWithResult(_0x538d14,0xc9))[_0x14f4('0x55')](handleError(_0x538d14,null));};exports[_0x14f4('0x37')]=function(_0x1eccd9,_0x20538b){if(_0x1eccd9[_0x14f4('0x5c')]['id']){delete _0x1eccd9['body']['id'];}return db[_0x14f4('0x51')][_0x14f4('0x5a')]({'where':{'id':_0x1eccd9[_0x14f4('0x57')]['id']}})[_0x14f4('0x1f')](handleEntityNotFound(_0x20538b,null))['then'](saveUpdates(_0x1eccd9['body'],null))[_0x14f4('0x1f')](respondWithResult(_0x20538b,null))[_0x14f4('0x55')](handleError(_0x20538b,null));};exports[_0x14f4('0x38')]=function(_0x3f7059,_0x3d705a){return db[_0x14f4('0x51')][_0x14f4('0x5a')]({'where':{'id':_0x3f7059[_0x14f4('0x57')]['id']}})[_0x14f4('0x1f')](handleEntityNotFound(_0x3d705a,null))[_0x14f4('0x1f')](removeEntity(_0x3d705a,null))['catch'](handleError(_0x3d705a,null));};exports[_0x14f4('0x5d')]=function(_0x1e4903,_0x12a1de){return db[_0x14f4('0x51')][_0x14f4('0x5d')]()['then'](respondWithResult(_0x12a1de,null))[_0x14f4('0x55')](handleError(_0x12a1de,null));};var interaction_log=require(_0x14f4('0x12'))(_0x14f4('0x5e'));exports['accept']=function(_0x182a8b,_0x947c5,_0x22de07){var _0x142a1f={'agent':{},'channel':_0x14f4('0x5f')};if(_0x182a8b[_0x14f4('0x5c')]['id']){delete _0x182a8b[_0x14f4('0x5c')]['id'];}_0x182a8b['body'][_0x14f4('0x60')]=!![];_0x182a8b['body'][_0x14f4('0x61')]=moment()[_0x14f4('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x182a8b['body'][_0x14f4('0x63')]=_0x182a8b['body']['UserId']||_0x182a8b[_0x14f4('0x64')]['id'];_0x142a1f[_0x14f4('0x65')]['id']=_0x182a8b['body'][_0x14f4('0x63')];return db[_0x14f4('0x51')]['find']({'where':{'id':_0x182a8b[_0x14f4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x947c5,null))[_0x14f4('0x1f')](saveUpdates(_0x182a8b[_0x14f4('0x5c')],null))[_0x14f4('0x1f')](function(_0x371f21){if(_0x371f21){_0x142a1f[_0x14f4('0x28')]=_0x371f21['get']({'plain':!![]});return db[_0x14f4('0x66')][_0x14f4('0x5a')]({'where':{'id':_0x371f21[_0x14f4('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x947c5,null))[_0x14f4('0x1f')](function(_0x52d520){if(_0x52d520){return _0x52d520['update']({'UserId':_0x182a8b[_0x14f4('0x5c')]['UserId'],'read1stAt':_[_0x14f4('0x68')](_0x52d520[_0x14f4('0x69')])?moment()[_0x14f4('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x14f4('0x1f')](function(_0x6c4855){if(_0x6c4855){_0x142a1f[_0x14f4('0x6a')]=_0x6c4855[_0x14f4('0x6b')]({'plain':!![]});interaction_log['info'](_0x14f4('0x6c'),_0x182a8b[_0x14f4('0x64')]['id'],_0x182a8b['user'][_0x14f4('0x3a')],_0x182a8b[_0x14f4('0x64')]['role'],_0x142a1f[_0x14f4('0x6a')]['id'],_0x182a8b[_0x14f4('0x5c')]?JSON[_0x14f4('0x25')](_0x182a8b['body']):'null');return respondWithRpcPromise(_0x14f4('0x6d'),_0x14f4('0x6e'),_0x142a1f);}return null;})['then'](function(_0x561390){var _0x1b7c01=_0x14f4('0x6f')+_0x561390['message'][_0x14f4('0x70')];return db['sequelize'][_0x14f4('0x41')](_0x1b7c01,{'type':db[_0x14f4('0x71')][_0x14f4('0x72')][_0x14f4('0x73')],'raw':!![]})[_0x14f4('0x1f')](function(_0x45e76c){return _0x45e76c;});})[_0x14f4('0x1f')](function(_0xcc5541){if(_0xcc5541){_0x142a1f[_0x14f4('0x28')]['contact']=_0xcc5541[0x0];if(!_0x182a8b[_0x14f4('0x5c')][_0x14f4('0x63')])return;return db['User'][_0x14f4('0x5a')]({'where':{'id':_0x182a8b[_0x14f4('0x5c')]['UserId'],'role':_0x14f4('0x65')},'attributes':['id','name',_0x14f4('0x74'),_0x14f4('0x75'),_0x14f4('0x76')],'raw':!![]});}return null;})['then'](function(_0x14444d){if(!_0x14444d)return null;_0x142a1f[_0x14f4('0x28')]['agent']=_0x14444d;return _0x142a1f;})[_0x14f4('0x1f')](function(_0x5ec225){if(_0x5ec225){if(_0x182a8b[_0x14f4('0x5c')]['manual']){_0x142a1f['message'][_0x14f4('0x77')]=util[_0x14f4('0x62')](_0x14f4('0x78'),_0x182a8b[_0x14f4('0x64')][_0x14f4('0x3a')]);_0x142a1f[_0x14f4('0x28')][_0x14f4('0x79')]=_0x142a1f[_0x14f4('0x79')];_0x142a1f[_0x14f4('0x28')][_0x14f4('0x7a')]=_0x142a1f['channel'];_0x142a1f[_0x14f4('0x28')][_0x14f4('0x7b')]='accept';return respondWithRpcPromise('EventManager',_0x14f4('0x7c'),{'event':_0x14f4('0x7d'),'message':_0x142a1f[_0x14f4('0x28')]},client9002)[_0x14f4('0x1f')](function(){return _0x142a1f;});}return _0x142a1f;}return null;})[_0x14f4('0x1f')](respondWithResult(_0x947c5,null))[_0x14f4('0x55')](handleError(_0x947c5,null));};var interaction_log=require(_0x14f4('0x12'))(_0x14f4('0x5e'));exports[_0x14f4('0x35')]=function(_0x70f9db,_0x351e71,_0x59656){var _0x344ee5={'agent':{},'channel':_0x14f4('0x5f')};if(_0x70f9db[_0x14f4('0x5c')]['id']){delete _0x70f9db[_0x14f4('0x5c')]['id'];}_0x70f9db[_0x14f4('0x5c')][_0x14f4('0x63')]=_0x70f9db[_0x14f4('0x5c')]['UserId']||_0x70f9db['user']['id'];_0x344ee5[_0x14f4('0x65')]['id']=_0x70f9db[_0x14f4('0x5c')][_0x14f4('0x63')];return db[_0x14f4('0x51')][_0x14f4('0x5a')]({'where':{'id':_0x70f9db['params']['id'],'UserId':null}})[_0x14f4('0x1f')](handleEntityNotFound(_0x351e71,null))[_0x14f4('0x1f')](function(_0x16b5dd){if(_0x16b5dd){_0x344ee5[_0x14f4('0x28')]=_0x16b5dd[_0x14f4('0x6b')]({'plain':!![]});return db['WhatsappInteraction'][_0x14f4('0x5a')]({'where':{'id':_0x16b5dd[_0x14f4('0x67')]}});}return null;})[_0x14f4('0x1f')](handleEntityNotFound(_0x351e71,null))[_0x14f4('0x1f')](function(_0x2ef5b3){if(_0x2ef5b3){_0x344ee5['interaction']=_0x2ef5b3[_0x14f4('0x6b')]({'plain':!![]});interaction_log[_0x14f4('0x20')](_0x14f4('0x7e'),_0x70f9db[_0x14f4('0x64')]['id'],_0x70f9db['user'][_0x14f4('0x3a')],_0x70f9db[_0x14f4('0x64')][_0x14f4('0x7f')],_0x344ee5[_0x14f4('0x6a')]['id'],_0x70f9db[_0x14f4('0x5c')]?JSON[_0x14f4('0x25')](_0x70f9db[_0x14f4('0x5c')]):_0x14f4('0x80'));return respondWithRpcPromise(_0x14f4('0x81'),_0x14f4('0x82'),_0x344ee5);}return null;})['then'](function(_0x3eecf9){var _0x20c14e=_0x14f4('0x6f')+_0x3eecf9['message'][_0x14f4('0x70')];return db['sequelize']['query'](_0x20c14e,{'type':db[_0x14f4('0x71')]['QueryTypes'][_0x14f4('0x73')],'raw':!![]})[_0x14f4('0x1f')](function(_0x7220fd){return _0x7220fd;});})[_0x14f4('0x1f')](function(_0x8dc7b9){if(_0x8dc7b9){_0x344ee5[_0x14f4('0x28')]['contact']=_0x8dc7b9[0x0];if(!_0x70f9db[_0x14f4('0x5c')]['UserId'])return;return db[_0x14f4('0x83')][_0x14f4('0x5a')]({'where':{'id':_0x70f9db[_0x14f4('0x5c')][_0x14f4('0x63')],'role':_0x14f4('0x65')},'attributes':['id',_0x14f4('0x3a'),'fullname','email',_0x14f4('0x76')],'raw':!![]});}return null;})[_0x14f4('0x1f')](function(_0x24b9f2){if(!_0x24b9f2)return null;_0x344ee5[_0x14f4('0x28')][_0x14f4('0x65')]=_0x24b9f2;return _0x344ee5;})[_0x14f4('0x1f')](function(_0x4e88fb){if(_0x4e88fb){_0x4e88fb[_0x14f4('0x28')][_0x14f4('0x77')]=util[_0x14f4('0x62')](_0x14f4('0x78'),_0x70f9db[_0x14f4('0x64')]['name']);_0x4e88fb[_0x14f4('0x28')][_0x14f4('0x79')]=_0x344ee5[_0x14f4('0x79')];_0x4e88fb['message']['motionChannel']=_0x344ee5[_0x14f4('0x79')];_0x4e88fb['message'][_0x14f4('0x7b')]=_0x14f4('0x35');respondWithRpcPromise(_0x14f4('0x7c'),_0x14f4('0x7c'),{'event':_0x14f4('0x84'),'message':_0x4e88fb[_0x14f4('0x28')]},client9002);return _0x344ee5;}return null;})[_0x14f4('0x1f')](respondWithResult(_0x351e71,null))[_0x14f4('0x55')](handleError(_0x351e71,null));};exports['status']=function(_0x29e48d,_0x49ff2c,_0x23cfd9){if(_0x29e48d[_0x14f4('0x5c')]['id']){delete _0x29e48d[_0x14f4('0x5c')]['id'];}var _0x25999b;return db['WhatsappMessage'][_0x14f4('0x5a')]({'where':{'id':_0x29e48d[_0x14f4('0x57')]['id']}})['then'](handleEntityNotFound(_0x49ff2c,null))[_0x14f4('0x1f')](function(_0x3408cc){if(_0x3408cc){_0x25999b=_0x3408cc;return db[_0x14f4('0x85')][_0x14f4('0x5a')]({'where':{'id':_0x3408cc[_0x14f4('0x86')]}});}})['then'](handleEntityNotFound(_0x49ff2c,null))['then'](function(_0x233cfb){if(_0x233cfb){logger[_0x14f4('0x23')](_0x14f4('0x87'),_0x14f4('0x2b'),_0x14f4('0x88'),_0x233cfb[_0x14f4('0x3f')],util[_0x14f4('0x89')](_0x29e48d['body'],{'showHidden':![],'depth':null}));switch(_0x233cfb[_0x14f4('0x3f')]){case _0x14f4('0x8a'):if(_0x29e48d['body'][_0x14f4('0x8b')]&&_0x29e48d[_0x14f4('0x5c')][_0x14f4('0x8b')]===_0x25999b[_0x14f4('0x8c')]&&_0x29e48d[_0x14f4('0x5c')][_0x14f4('0x8d')]&&_0x29e48d[_0x14f4('0x5c')]['MessageStatus']===_0x14f4('0x60')){return _0x25999b[_0x14f4('0x37')]({'read':!![]});}else{logger['error'](_0x14f4('0x8e'),_0x14f4('0x2b'),_0x14f4('0x8a'),util[_0x14f4('0x89')](_0x29e48d['body'],{'showHidden':![],'depth':null}));}break;}return _0x25999b;}})[_0x14f4('0x1f')](respondWithResult(_0x49ff2c,null))[_0x14f4('0x55')](handleError(_0x49ff2c,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 2348698..d3aa475 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 _0xf4eb=['hook','events','update','emit','hasOwnProperty'];(function(_0x4ff51e,_0x29a36f){var _0x444ba6=function(_0x25de53){while(--_0x25de53){_0x4ff51e['push'](_0x4ff51e['shift']());}};_0x444ba6(++_0x29a36f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4f8f79,_0x677d96){_0x4f8f79=_0x4f8f79-0x0;var _0x578726=_0xf4eb[_0x4f8f79];return _0x578726;};'use strict';var EventEmitter=require(_0xbf4e('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf4e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4e7fa7){return function(_0x2e3070,_0x1c7606,_0x32d1d7){WhatsappMessageEvents[_0xbf4e('0x2')](_0x4e7fa7+':'+_0x2e3070['id'],_0x2e3070);WhatsappMessageEvents[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070);_0x32d1d7(null);};}for(var e in events){if(events[_0xbf4e('0x3')](e)){var event=events[e];WhatsappMessage[_0xbf4e('0x4')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xd547=['hook','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x500812,_0x296a3c){var _0x4add02=function(_0x33c252){while(--_0x33c252){_0x500812['push'](_0x500812['shift']());}};_0x4add02(++_0x296a3c);}(_0xd547,0x1c1));var _0x7d54=function(_0x77fd25,_0x226ea2){_0x77fd25=_0x77fd25-0x0;var _0xe14528=_0xd547[_0x77fd25];return _0xe14528;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x7d54('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7d54('0x1')](0x0);var events={'afterCreate':_0x7d54('0x2'),'afterUpdate':_0x7d54('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4ab00b){return function(_0x21c23f,_0x5d21c1,_0x22ea09){WhatsappMessageEvents['emit'](_0x4ab00b+':'+_0x21c23f['id'],_0x21c23f);WhatsappMessageEvents[_0x7d54('0x4')](_0x4ab00b,_0x21c23f);_0x22ea09(null);};}for(var e in events){if(events[_0x7d54('0x5')](e)){var event=events[e];WhatsappMessage[_0x7d54('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index aa9e71a..4899e74 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 _0x8058=['findOne','then','update','createdAt','catch','error','out','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId'];(function(_0x45d59b,_0x454156){var _0x966451=function(_0x4d761b){while(--_0x4d761b){_0x45d59b['push'](_0x45d59b['shift']());}};_0x966451(++_0x454156);}(_0x8058,0x101));var _0x8805=function(_0x4828b1,_0x5c8cf3){_0x4828b1=_0x4828b1-0x0;var _0x1fec1b=_0x8058[_0x4828b1];return _0x1fec1b;};'use strict';var _=require(_0x8805('0x0'));var util=require(_0x8805('0x1'));var logger=require('../../config/logger')(_0x8805('0x2'));var moment=require('moment');var BPromise=require(_0x8805('0x3'));var rp=require(_0x8805('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8805('0x5'));var attributes=require(_0x8805('0x6'));module['exports']=function(_0x438a1c,_0x7a9c5c){return _0x438a1c['define'](_0x8805('0x7'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x8805('0x8'),'fields':[_0x8805('0x8')]},{'name':_0x8805('0x9'),'fields':[_0x8805('0xa')],'type':_0x8805('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2392b0,_0x68075e,_0x1cffc8){var _0x1e3c69=_0x438a1c[_0x8805('0xc')];var _0xf718cc=_0x2392b0[_0x8805('0xd')]({'plain':!![]});if(_0xf718cc[_0x8805('0xe')][_0x8805('0xf')]()==='in'||_0xf718cc[_0x8805('0xe')]['toLowerCase']()==='out'&&!_0xf718cc[_0x8805('0x10')]&&!_[_0x8805('0x11')](_0xf718cc[_0x8805('0x12')])){_0x1e3c69['WhatsappInteraction'][_0x8805('0x13')]({'where':{'id':_0xf718cc['WhatsappInteractionId']}})[_0x8805('0x14')](function(_0x1434e3){if(_0x1434e3){_0x1434e3[_0x8805('0x15')]({'lastMsgAt':_0xf718cc[_0x8805('0x16')],'lastMsgDirection':_0xf718cc[_0x8805('0xe')][_0x8805('0xf')]()});}})[_0x8805('0x17')](function(_0x2fb553){console[_0x8805('0x18')](_0x2fb553);});}if(_0xf718cc['direction']===_0x8805('0x19')&&!_0xf718cc[_0x8805('0x10')]){var _0x4c359e;_0x1e3c69[_0x8805('0x1a')][_0x8805('0x1b')]({'where':{'id':_0xf718cc['WhatsappAccountId']},'raw':!![]})[_0x8805('0x14')](function(_0x2e2ee6){_0x4c359e=_0x2e2ee6;if(_0x4c359e&&_0x4c359e[_0x8805('0x1c')]){switch(_0x4c359e[_0x8805('0x1c')]){case _0x8805('0x1d'):var _0x5d1666=require('twilio');if(_0x4c359e[_0x8805('0x1e')]&&_0x4c359e[_0x8805('0x1f')]&&_0x4c359e[_0x8805('0x20')]){var _0x3781a4=new _0x5d1666(_0x4c359e['accountSid'],_0x4c359e[_0x8805('0x1f')]);_0x3781a4[_0x8805('0x21')][_0x8805('0x22')]({'body':_0xf718cc[_0x8805('0xa')],'to':_0x8805('0x23')+_0xf718cc[_0x8805('0x20')],'from':_0x8805('0x23')+_0x4c359e[_0x8805('0x20')],'statusCallback':_0x4c359e['remote']+'/api/whatsapp/messages/'+_0xf718cc['id']+_0x8805('0x24')+_0x4c359e[_0x8805('0x25')]})['then'](function(_0x183add){if(_0x183add[_0x8805('0x26')]){return _0x2392b0[_0x8805('0x15')]({'messageId':_0x183add[_0x8805('0x26')]});}})[_0x8805('0x17')](function(_0x173a6a){logger[_0x8805('0x18')](_0x8805('0x27'),_0x8805('0x28'),_0x8805('0x1d'),util[_0x8805('0x29')](_0x173a6a,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x8805('0x28'),_0x8805('0x1d'),_0x8805('0x2a'));}break;}}})[_0x8805('0x2b')](function(){_0x1cffc8();});}else{_0x1cffc8();}}},'charset':_0x8805('0x2c'),'collate':_0x8805('0x2d')});}; \ No newline at end of file +var _0xea77=['/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote'];(function(_0x45bc5e,_0xd4ef31){var _0x62305b=function(_0x31036f){while(--_0x31036f){_0x45bc5e['push'](_0x45bc5e['shift']());}};_0x62305b(++_0xd4ef31);}(_0xea77,0xd1));var _0x7ea7=function(_0x42387e,_0x59f43c){_0x42387e=_0x42387e-0x0;var _0x2292e2=_0xea77[_0x42387e];return _0x2292e2;};'use strict';var _=require(_0x7ea7('0x0'));var util=require(_0x7ea7('0x1'));var logger=require(_0x7ea7('0x2'))(_0x7ea7('0x3'));var moment=require(_0x7ea7('0x4'));var BPromise=require(_0x7ea7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ea7('0x6'));var rimraf=require(_0x7ea7('0x7'));var config=require(_0x7ea7('0x8'));var attributes=require(_0x7ea7('0x9'));module['exports']=function(_0x54e587,_0x54c26a){return _0x54e587[_0x7ea7('0xa')](_0x7ea7('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x7ea7('0xc'),'fields':[_0x7ea7('0xc')]},{'name':_0x7ea7('0xd'),'fields':[_0x7ea7('0xe')],'type':_0x7ea7('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x323177,_0x1e1ba0,_0x19c4e0){var _0x466f71=_0x54e587[_0x7ea7('0x10')];var _0x17cb42=_0x323177[_0x7ea7('0x11')]({'plain':!![]});if(_0x17cb42[_0x7ea7('0x12')][_0x7ea7('0x13')]()==='in'||_0x17cb42['direction'][_0x7ea7('0x13')]()===_0x7ea7('0x14')&&!_0x17cb42[_0x7ea7('0x15')]&&!_[_0x7ea7('0x16')](_0x17cb42[_0x7ea7('0x17')])){_0x466f71[_0x7ea7('0x18')][_0x7ea7('0x19')]({'where':{'id':_0x17cb42[_0x7ea7('0x1a')]}})[_0x7ea7('0x1b')](function(_0x4e59d1){if(_0x4e59d1){_0x4e59d1[_0x7ea7('0x1c')]({'lastMsgAt':_0x17cb42[_0x7ea7('0x1d')],'lastMsgDirection':_0x17cb42['direction'][_0x7ea7('0x13')]()});}})[_0x7ea7('0x1e')](function(_0x96e8fa){console[_0x7ea7('0x1f')](_0x96e8fa);});}if(_0x17cb42[_0x7ea7('0x12')]==='out'&&!_0x17cb42[_0x7ea7('0x15')]){var _0x1d4525;_0x466f71['WhatsappAccount']['find']({'where':{'id':_0x17cb42['WhatsappAccountId']},'raw':!![]})[_0x7ea7('0x1b')](function(_0x4ad014){_0x1d4525=_0x4ad014;if(_0x1d4525&&_0x1d4525[_0x7ea7('0x20')]){switch(_0x1d4525[_0x7ea7('0x20')]){case _0x7ea7('0x21'):var _0x3fc0e0=require(_0x7ea7('0x21'));if(_0x1d4525[_0x7ea7('0x22')]&&_0x1d4525[_0x7ea7('0x23')]&&_0x1d4525[_0x7ea7('0x24')]){var _0x549559=new _0x3fc0e0(_0x1d4525[_0x7ea7('0x22')],_0x1d4525['authToken']);_0x549559[_0x7ea7('0x25')][_0x7ea7('0x26')]({'body':_0x17cb42[_0x7ea7('0xe')],'to':_0x7ea7('0x27')+_0x17cb42[_0x7ea7('0x24')],'from':_0x7ea7('0x27')+_0x1d4525[_0x7ea7('0x24')],'statusCallback':_0x1d4525[_0x7ea7('0x28')]+_0x7ea7('0x29')+_0x17cb42['id']+_0x7ea7('0x2a')+_0x1d4525['token']})['then'](function(_0x118f4a){if(_0x118f4a[_0x7ea7('0x2b')]){return _0x323177[_0x7ea7('0x1c')]({'messageId':_0x118f4a[_0x7ea7('0x2b')]});}})[_0x7ea7('0x1e')](function(_0x5e3f32){logger['error'](_0x7ea7('0x2c'),_0x7ea7('0x2d'),_0x7ea7('0x21'),util['inspect'](_0x5e3f32,{'showHidden':![],'depth':null}));});}else{logger[_0x7ea7('0x1f')](_0x7ea7('0x2c'),_0x7ea7('0x2d'),_0x7ea7('0x21'),_0x7ea7('0x2e'));}break;}}})[_0x7ea7('0x2f')](function(){_0x19c4e0();});}else{_0x19c4e0();}}},'charset':_0x7ea7('0x30'),'collate':_0x7ea7('0x31')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index d2fb74f..2341a6e 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 _0xdab1=['localhost','socket.io-emitter','./whatsappMessage.socket','register','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateWhatsappMessage','create','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x4b74d5,_0x488eec){var _0x11ae38=function(_0x4aee2e){while(--_0x4aee2e){_0x4b74d5['push'](_0x4b74d5['shift']());}};_0x11ae38(++_0x488eec);}(_0xdab1,0x133));var _0x1dab=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xdab1[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x1dab('0x0'));var util=require(_0x1dab('0x1'));var moment=require('moment');var BPromise=require(_0x1dab('0x2'));var rs=require(_0x1dab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dab('0x4'))['db'];var utils=require(_0x1dab('0x5'));var logger=require(_0x1dab('0x6'))(_0x1dab('0x7'));var config=require('../../config/environment');var jayson=require(_0x1dab('0x8'));var client=jayson[_0x1dab('0x9')][_0x1dab('0xa')]({'port':0x232a});config[_0x1dab('0xb')]=_[_0x1dab('0xc')](config['redis'],{'host':_0x1dab('0xd'),'port':0x18eb});var socket=require(_0x1dab('0xe'))(new Redis(config['redis']));require(_0x1dab('0xf'))[_0x1dab('0x10')](socket);function respondWithRpcPromise(_0x49591e,_0x23180f,_0x578435){return new BPromise(function(_0x91bc97,_0x21941b){return client['request'](_0x49591e,_0x578435)['then'](function(_0x55fca7){logger[_0x1dab('0x11')](_0x1dab('0x12'),_0x23180f,'request\x20sent');logger[_0x1dab('0x13')](_0x1dab('0x14'),_0x23180f,'request\x20sent',JSON[_0x1dab('0x15')](_0x55fca7));if(_0x55fca7[_0x1dab('0x16')]){if(_0x55fca7['error'][_0x1dab('0x17')]===0x1f4){logger[_0x1dab('0x16')](_0x1dab('0x12'),_0x23180f,_0x55fca7[_0x1dab('0x16')][_0x1dab('0x18')]);return _0x21941b(_0x55fca7[_0x1dab('0x16')][_0x1dab('0x18')]);}logger[_0x1dab('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x23180f,_0x55fca7[_0x1dab('0x16')][_0x1dab('0x18')]);return _0x91bc97(_0x55fca7['error'][_0x1dab('0x18')]);}else{logger[_0x1dab('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x23180f,_0x1dab('0x19'));_0x91bc97(_0x55fca7['result']['message']);}})[_0x1dab('0x1a')](function(_0x4b2c6d){logger[_0x1dab('0x16')](_0x1dab('0x12'),_0x23180f,_0x4b2c6d);_0x21941b(_0x4b2c6d);});});}exports[_0x1dab('0x1b')]=function(_0x3fa6ce){var _0xa69182=this;return new Promise(function(_0x42fabc,_0x1d0dc2){return db['WhatsappMessage'][_0x1dab('0x1c')](_0x3fa6ce[_0x1dab('0x1d')],{'raw':_0x3fa6ce[_0x1dab('0x1e')]?_0x3fa6ce[_0x1dab('0x1e')][_0x1dab('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x15cbf8){logger[_0x1dab('0x11')](_0x1dab('0x1b'),_0x3fa6ce);logger[_0x1dab('0x13')](_0x1dab('0x1b'),_0x3fa6ce,JSON[_0x1dab('0x15')](_0x15cbf8));_0x42fabc(_0x15cbf8);})[_0x1dab('0x1a')](function(_0x4d9742){logger[_0x1dab('0x16')](_0x1dab('0x1b'),_0x4d9742[_0x1dab('0x18')],_0x3fa6ce);_0x1d0dc2(_0xa69182[_0x1dab('0x16')](0x1f4,_0x4d9742[_0x1dab('0x18')]));});});}; \ No newline at end of file +var _0xbb75=['../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./whatsappMessage.socket','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xbb75,0x84));var _0x5bb7=function(_0x5519c2,_0x1542f4){_0x5519c2=_0x5519c2-0x0;var _0x152e7f=_0xbb75[_0x5519c2];return _0x152e7f;};'use strict';var _=require(_0x5bb7('0x0'));var util=require(_0x5bb7('0x1'));var moment=require('moment');var BPromise=require(_0x5bb7('0x2'));var rs=require(_0x5bb7('0x3'));var fs=require('fs');var Redis=require(_0x5bb7('0x4'));var db=require(_0x5bb7('0x5'))['db'];var utils=require(_0x5bb7('0x6'));var logger=require(_0x5bb7('0x7'))('rpc');var config=require(_0x5bb7('0x8'));var jayson=require(_0x5bb7('0x9'));var client=jayson[_0x5bb7('0xa')][_0x5bb7('0xb')]({'port':0x232a});config['redis']=_[_0x5bb7('0xc')](config['redis'],{'host':_0x5bb7('0xd'),'port':0x18eb});var socket=require(_0x5bb7('0xe'))(new Redis(config[_0x5bb7('0xf')]));require(_0x5bb7('0x10'))['register'](socket);function respondWithRpcPromise(_0x3731dd,_0x2b4dfa,_0x4ece21){return new BPromise(function(_0x4afc92,_0xb1eaca){return client[_0x5bb7('0x11')](_0x3731dd,_0x4ece21)[_0x5bb7('0x12')](function(_0x3194b6){logger[_0x5bb7('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x2b4dfa,_0x5bb7('0x14'));logger[_0x5bb7('0x15')](_0x5bb7('0x16'),_0x2b4dfa,_0x5bb7('0x14'),JSON[_0x5bb7('0x17')](_0x3194b6));if(_0x3194b6[_0x5bb7('0x18')]){if(_0x3194b6[_0x5bb7('0x18')][_0x5bb7('0x19')]===0x1f4){logger[_0x5bb7('0x18')](_0x5bb7('0x1a'),_0x2b4dfa,_0x3194b6[_0x5bb7('0x18')]['message']);return _0xb1eaca(_0x3194b6[_0x5bb7('0x18')]['message']);}logger['error'](_0x5bb7('0x1a'),_0x2b4dfa,_0x3194b6['error']['message']);return _0x4afc92(_0x3194b6[_0x5bb7('0x18')][_0x5bb7('0x1b')]);}else{logger[_0x5bb7('0x13')](_0x5bb7('0x1a'),_0x2b4dfa,_0x5bb7('0x14'));_0x4afc92(_0x3194b6['result']['message']);}})[_0x5bb7('0x1c')](function(_0x301aab){logger['error'](_0x5bb7('0x1a'),_0x2b4dfa,_0x301aab);_0xb1eaca(_0x301aab);});});}exports[_0x5bb7('0x1d')]=function(_0x5bcebf){var _0x31b2e2=this;return new Promise(function(_0x4d7442,_0x12e285){return db[_0x5bb7('0x1e')][_0x5bb7('0x1f')](_0x5bcebf[_0x5bb7('0x20')],{'raw':_0x5bcebf[_0x5bb7('0x21')]?_0x5bcebf[_0x5bb7('0x21')][_0x5bb7('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x336e4b){logger[_0x5bb7('0x13')](_0x5bb7('0x1d'),_0x5bcebf);logger[_0x5bb7('0x15')]('CreateWhatsappMessage',_0x5bcebf,JSON['stringify'](_0x336e4b));_0x4d7442(_0x336e4b);})[_0x5bb7('0x1c')](function(_0xcb5fa4){logger[_0x5bb7('0x18')](_0x5bb7('0x1d'),_0xcb5fa4['message'],_0x5bcebf);_0x12e285(_0x31b2e2[_0x5bb7('0x18')](0x1f4,_0xcb5fa4[_0x5bb7('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index cc0c11b..3fe1b57 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 _0x4f93=['update','removeListener','register','length','./whatsappMessage.events','save'];(function(_0x8663a7,_0x2e8fd3){var _0x456f4e=function(_0x468966){while(--_0x468966){_0x8663a7['push'](_0x8663a7['shift']());}};_0x456f4e(++_0x2e8fd3);}(_0x4f93,0x160));var _0x34f9=function(_0x4e05d8,_0xab2ee9){_0x4e05d8=_0x4e05d8-0x0;var _0x356a48=_0x4f93[_0x4e05d8];return _0x356a48;};'use strict';var WhatsappMessageEvents=require(_0x34f9('0x0'));var events=[_0x34f9('0x1'),'remove',_0x34f9('0x2')];function createListener(_0x2a79d4,_0x317193){return function(_0x34c32c){_0x317193['emit'](_0x2a79d4,_0x34c32c);};}function removeListener(_0x58bf64,_0x31224d){return function(){WhatsappMessageEvents[_0x34f9('0x3')](_0x58bf64,_0x31224d);};}exports[_0x34f9('0x4')]=function(_0x5888e5){for(var _0x17cdd2=0x0,_0x5d2085=events[_0x34f9('0x5')];_0x17cdd2<_0x5d2085;_0x17cdd2++){var _0x2bf8b6=events[_0x17cdd2];var _0x15363d=createListener('whatsappMessage:'+_0x2bf8b6,_0x5888e5);WhatsappMessageEvents['on'](_0x2bf8b6,_0x15363d);}}; \ No newline at end of file +var _0xb3c3=['emit','register','length','whatsappMessage:','save','update'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0xb3c3,0x8e));var _0x3b3c=function(_0x376df1,_0x472a11){_0x376df1=_0x376df1-0x0;var _0x383673=_0xb3c3[_0x376df1];return _0x383673;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x3b3c('0x0'),'remove',_0x3b3c('0x1')];function createListener(_0x237d83,_0x599304){return function(_0x1a3e7f){_0x599304[_0x3b3c('0x2')](_0x237d83,_0x1a3e7f);};}function removeListener(_0x621cef,_0x1c05b8){return function(){WhatsappMessageEvents['removeListener'](_0x621cef,_0x1c05b8);};}exports[_0x3b3c('0x3')]=function(_0x4da37f){for(var _0x2031c2=0x0,_0x2bc0ec=events[_0x3b3c('0x4')];_0x2031c2<_0x2bc0ec;_0x2031c2++){var _0x278fa4=events[_0x2031c2];var _0x497669=createListener(_0x3b3c('0x5')+_0x278fa4,_0x4da37f);WhatsappMessageEvents['on'](_0x278fa4,_0x497669);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 41a3839..76d76d6 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 _0x4a41=['/:id/members','/:id/teams','/:id/users','getAgents','post','addTeams','put','/:id','update','destroy','delete','removeTeams','removeAgents','multer','util','path','Router','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x46aaf6,_0x5df493){var _0x59de52=function(_0x373a47){while(--_0x373a47){_0x46aaf6['push'](_0x46aaf6['shift']());}};_0x59de52(++_0x5df493);}(_0x4a41,0x17d));var _0x14a4=function(_0x3386fd,_0x8596f4){_0x3386fd=_0x3386fd-0x0;var _0x19e6f6=_0x4a41[_0x3386fd];return _0x19e6f6;};'use strict';var multer=require(_0x14a4('0x0'));var util=require(_0x14a4('0x1'));var path=require(_0x14a4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x14a4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x14a4('0x4'));var controller=require(_0x14a4('0x5'));router[_0x14a4('0x6')]('/',auth[_0x14a4('0x7')](),controller[_0x14a4('0x8')]);router[_0x14a4('0x6')](_0x14a4('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x14a4('0x6')]('/:id',auth[_0x14a4('0x7')](),controller['show']);router[_0x14a4('0x6')](_0x14a4('0xa'),auth[_0x14a4('0x7')](),controller['getMembers']);router['get'](_0x14a4('0xb'),auth[_0x14a4('0x7')](),controller['getTeams']);router[_0x14a4('0x6')](_0x14a4('0xc'),auth[_0x14a4('0x7')](),controller[_0x14a4('0xd')]);router['post']('/',auth[_0x14a4('0x7')](),controller['create']);router[_0x14a4('0xe')]('/:id/teams',auth[_0x14a4('0x7')](),controller[_0x14a4('0xf')]);router[_0x14a4('0xe')](_0x14a4('0xc'),auth[_0x14a4('0x7')](),controller['addAgents']);router[_0x14a4('0x10')](_0x14a4('0x11'),auth[_0x14a4('0x7')](),controller[_0x14a4('0x12')]);router['delete']('/:id',auth[_0x14a4('0x7')](),controller[_0x14a4('0x13')]);router[_0x14a4('0x14')](_0x14a4('0xb'),auth[_0x14a4('0x7')](),controller[_0x14a4('0x15')]);router[_0x14a4('0x14')]('/:id/users',auth[_0x14a4('0x7')](),controller[_0x14a4('0x16')]);module['exports']=router; \ No newline at end of file +var _0x36fb=['index','/describe','isAuthenticated','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x36fb,0xc8));var _0xb36f=function(_0x23d4a5,_0x348e65){_0x23d4a5=_0x23d4a5-0x0;var _0xd90fa3=_0x36fb[_0x23d4a5];return _0xd90fa3;};'use strict';var multer=require(_0xb36f('0x0'));var util=require(_0xb36f('0x1'));var path=require(_0xb36f('0x2'));var timeout=require('connect-timeout');var express=require(_0xb36f('0x3'));var router=express[_0xb36f('0x4')]();var fs_extra=require(_0xb36f('0x5'));var auth=require(_0xb36f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb36f('0x7'));var controller=require(_0xb36f('0x8'));router[_0xb36f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb36f('0xa')]);router[_0xb36f('0x9')](_0xb36f('0xb'),auth[_0xb36f('0xc')](),controller[_0xb36f('0xd')]);router[_0xb36f('0x9')]('/:id',auth[_0xb36f('0xc')](),controller[_0xb36f('0xe')]);router[_0xb36f('0x9')](_0xb36f('0xf'),auth[_0xb36f('0xc')](),controller['getMembers']);router[_0xb36f('0x9')](_0xb36f('0x10'),auth[_0xb36f('0xc')](),controller[_0xb36f('0x11')]);router['get'](_0xb36f('0x12'),auth[_0xb36f('0xc')](),controller[_0xb36f('0x13')]);router[_0xb36f('0x14')]('/',auth[_0xb36f('0xc')](),controller[_0xb36f('0x15')]);router[_0xb36f('0x14')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xb36f('0x14')]('/:id/users',auth[_0xb36f('0xc')](),controller[_0xb36f('0x16')]);router[_0xb36f('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xb36f('0x18')]);router['delete'](_0xb36f('0x19'),auth[_0xb36f('0xc')](),controller[_0xb36f('0x1a')]);router['delete'](_0xb36f('0x10'),auth[_0xb36f('0xc')](),controller[_0xb36f('0x1b')]);router['delete'](_0xb36f('0x12'),auth['isAuthenticated'](),controller[_0xb36f('0x1c')]);module[_0xb36f('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 7395629..9c6fbb1 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 _0xbe31=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x4cf83e,_0x298626){var _0x3007d6=function(_0x3be6ac){while(--_0x3be6ac){_0x4cf83e['push'](_0x4cf83e['shift']());}};_0x3007d6(++_0x298626);}(_0xbe31,0x83));var _0x1be3=function(_0x112f55,_0x1ea99b){_0x112f55=_0x112f55-0x0;var _0x1f9bee=_0xbe31[_0x112f55];return _0x1f9bee;};'use strict';var Sequelize=require('sequelize');module[_0x1be3('0x0')]={'name':{'type':Sequelize[_0x1be3('0x1')],'unique':_0x1be3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1be3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1be3('0x4')](_0x1be3('0x5'),_0x1be3('0x6'),_0x1be3('0x7'))},'description':{'type':Sequelize[_0x1be3('0x1')]}}; \ No newline at end of file +var _0x430e=['ENUM','rrmemory','beepall','exports','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x430e,0x105));var _0xe430=function(_0x10fd98,_0x5209db){_0x10fd98=_0x10fd98-0x0;var _0x5347d5=_0x430e[_0x10fd98];return _0x5347d5;};'use strict';var Sequelize=require('sequelize');module[_0xe430('0x0')]={'name':{'type':Sequelize[_0xe430('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xe430('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe430('0x3')](_0xe430('0x4'),_0xe430('0x5'),'roundrobin')},'description':{'type':Sequelize[_0xe430('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index dbda8a0..0396cdb 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 _0x348c=['ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','removeAgents','getAgents','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','WhatsappQueues','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','WhatsappQueue','findAll','rows','catch','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserWhatsappQueue','length','WhatsappQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','SIP','whatsappPause','getTeams','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','findOrCreate','emit','userWhatsappQueue:save','removeTeams','Team','from','team_has_whatsapp_queues','join','user_has_teams'];(function(_0x4e7fc1,_0x100df3){var _0x5db4a4=function(_0x229dde){while(--_0x229dde){_0x4e7fc1['push'](_0x4e7fc1['shift']());}};_0x5db4a4(++_0x100df3);}(_0x348c,0xa2));var _0xc348=function(_0x321e7a,_0x37f6cb){_0x321e7a=_0x321e7a-0x0;var _0x54fef3=_0x348c[_0x321e7a];return _0x54fef3;};'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(_0xc348('0x0'));var moment=require(_0xc348('0x1'));var BPromise=require(_0xc348('0x2'));var Mustache=require(_0xc348('0x3'));var util=require(_0xc348('0x4'));var path=require(_0xc348('0x5'));var sox=require(_0xc348('0x6'));var csv=require(_0xc348('0x7'));var ejs=require(_0xc348('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc348('0x9'));var squel=require(_0xc348('0xa'));var crypto=require(_0xc348('0xb'));var jsforce=require(_0xc348('0xc'));var deskjs=require(_0xc348('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc348('0xe'));var Papa=require(_0xc348('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc348('0x10'));var as=require(_0xc348('0x11'));var hardwareService=require(_0xc348('0x12'));var logger=require('../../config/logger')(_0xc348('0x13'));var utils=require(_0xc348('0x14'));var config=require(_0xc348('0x15'));var licenseUtil=require(_0xc348('0x16'));var db=require(_0xc348('0x17'))['db'];config[_0xc348('0x18')]=_[_0xc348('0x19')](config[_0xc348('0x18')],{'host':_0xc348('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc348('0x1b'))[_0xc348('0x1c')](socket);function respondWithStatusCode(_0x3e4d2b,_0x31e51b){_0x31e51b=_0x31e51b||0xcc;return function(_0x1b76c1){if(_0x1b76c1){return _0x3e4d2b['sendStatus'](_0x31e51b);}return _0x3e4d2b[_0xc348('0x1d')](_0x31e51b)[_0xc348('0x1e')]();};}function respondWithResult(_0x96134d,_0xab2e96){_0xab2e96=_0xab2e96||0xc8;return function(_0x2452af){if(_0x2452af){return _0x96134d[_0xc348('0x1d')](_0xab2e96)[_0xc348('0x1f')](_0x2452af);}};}function respondWithFilteredResult(_0x4e93cb,_0x4d1466){return function(_0x282fcc){if(_0x282fcc){var _0x449117=typeof _0x4d1466[_0xc348('0x20')]===_0xc348('0x21')&&typeof _0x4d1466[_0xc348('0x22')]===_0xc348('0x21');var _0xe1516e=_0x282fcc[_0xc348('0x23')];var _0x3471ad=_0x449117?0x0:_0x4d1466[_0xc348('0x20')];var _0x938365=_0x449117?_0x282fcc[_0xc348('0x23')]:_0x4d1466[_0xc348('0x20')]+_0x4d1466[_0xc348('0x22')];var _0x2710fe;if(_0x938365>=_0xe1516e){_0x938365=_0xe1516e;_0x2710fe=0xc8;}else{_0x2710fe=0xce;}_0x4e93cb[_0xc348('0x1d')](_0x2710fe);return _0x4e93cb['set'](_0xc348('0x24'),_0x3471ad+'-'+_0x938365+'/'+_0xe1516e)[_0xc348('0x1f')](_0x282fcc);}return null;};}function patchUpdates(_0x27681c){return function(_0x13180f){try{jsonpatch[_0xc348('0x25')](_0x13180f,_0x27681c,!![]);}catch(_0x4e220c){return BPromise[_0xc348('0x26')](_0x4e220c);}return _0x13180f[_0xc348('0x27')]();};}function saveUpdates(_0x30feb,_0x21d8db){return function(_0x377fa7){if(_0x377fa7){return _0x377fa7['update'](_0x30feb)[_0xc348('0x28')](function(_0x433c7a){return _0x433c7a;});}return null;};}function removeEntity(_0x3b976e,_0x5ae72c){return function(_0xebca76){if(_0xebca76){return _0xebca76[_0xc348('0x29')]()[_0xc348('0x28')](function(){var _0x3a78a2=_0xebca76[_0xc348('0x2a')]({'plain':!![]});var _0x22fd1b=_0xc348('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x22fd1b,'resourceId':_0x3a78a2['id']}})[_0xc348('0x28')](function(){return _0xebca76;});})[_0xc348('0x28')](function(){_0x3b976e['status'](0xcc)[_0xc348('0x1e')]();});}};}function handleEntityNotFound(_0x139e25,_0x532a7d){return function(_0x30dc6b){if(!_0x30dc6b){_0x139e25[_0xc348('0x2c')](0x194);}return _0x30dc6b;};}function handleError(_0x498422,_0x5ac9a5){_0x5ac9a5=_0x5ac9a5||0x1f4;return function(_0x1e5c5e){logger[_0xc348('0x2d')](_0x1e5c5e[_0xc348('0x2e')]);if(_0x1e5c5e[_0xc348('0x2f')]){delete _0x1e5c5e[_0xc348('0x2f')];}_0x498422[_0xc348('0x1d')](_0x5ac9a5)[_0xc348('0x30')](_0x1e5c5e);};}exports[_0xc348('0x31')]=function(_0x44be34,_0x2eb1a6){var _0x538ca7={},_0x4c03c3={},_0x63710b={'count':0x0,'rows':[]};var _0x3d43d4=_['map'](db['WhatsappQueue'][_0xc348('0x32')],function(_0x5cc149){return{'name':_0x5cc149[_0xc348('0x33')],'type':_0x5cc149[_0xc348('0x34')][_0xc348('0x35')]};});_0x4c03c3[_0xc348('0x36')]=_[_0xc348('0x37')](_0x3d43d4,'name');_0x4c03c3[_0xc348('0x38')]=_[_0xc348('0x39')](_0x44be34[_0xc348('0x38')]);_0x4c03c3[_0xc348('0x3a')]=_[_0xc348('0x3b')](_0x4c03c3[_0xc348('0x36')],_0x4c03c3[_0xc348('0x38')]);_0x538ca7[_0xc348('0x3c')]=_['intersection'](_0x4c03c3[_0xc348('0x36')],qs[_0xc348('0x3d')](_0x44be34[_0xc348('0x38')][_0xc348('0x3d')]));_0x538ca7[_0xc348('0x3c')]=_0x538ca7[_0xc348('0x3c')]['length']?_0x538ca7[_0xc348('0x3c')]:_0x4c03c3[_0xc348('0x36')];if(!_0x44be34[_0xc348('0x38')][_0xc348('0x3e')](_0xc348('0x3f'))){_0x538ca7[_0xc348('0x22')]=qs[_0xc348('0x22')](_0x44be34[_0xc348('0x38')][_0xc348('0x22')]);_0x538ca7[_0xc348('0x20')]=qs[_0xc348('0x20')](_0x44be34[_0xc348('0x38')][_0xc348('0x20')]);}_0x538ca7[_0xc348('0x40')]=qs[_0xc348('0x41')](_0x44be34['query'][_0xc348('0x41')]);_0x538ca7[_0xc348('0x42')]=qs[_0xc348('0x3a')](_[_0xc348('0x43')](_0x44be34['query'],_0x4c03c3['filters']),_0x3d43d4);if(_0x44be34[_0xc348('0x38')][_0xc348('0x44')]){_0x538ca7[_0xc348('0x42')]=_['merge'](_0x538ca7['where'],{'$or':_[_0xc348('0x37')](_0x3d43d4,function(_0xae2606){if(_0xae2606[_0xc348('0x34')]!=='VIRTUAL'){var _0x2b0ca7={};_0x2b0ca7[_0xae2606[_0xc348('0x2f')]]={'$like':'%'+_0x44be34[_0xc348('0x38')][_0xc348('0x44')]+'%'};return _0x2b0ca7;}})});}_0x538ca7=_[_0xc348('0x45')]({},_0x538ca7,_0x44be34[_0xc348('0x46')]);var _0xda4856={'where':_0x538ca7[_0xc348('0x42')]};return db['WhatsappQueue'][_0xc348('0x23')](_0xda4856)[_0xc348('0x28')](function(_0x3eb07c){_0x63710b[_0xc348('0x23')]=_0x3eb07c;if(_0x44be34['query']['includeAll']){_0x538ca7[_0xc348('0x47')]=[{'all':!![]}];}return db[_0xc348('0x48')][_0xc348('0x49')](_0x538ca7);})[_0xc348('0x28')](function(_0x2388c1){_0x63710b[_0xc348('0x4a')]=_0x2388c1;return _0x63710b;})[_0xc348('0x28')](respondWithFilteredResult(_0x2eb1a6,_0x538ca7))[_0xc348('0x4b')](handleError(_0x2eb1a6,null));};exports[_0xc348('0x4c')]=function(_0x78a959,_0x55048c){var _0x327efa={'raw':!![],'where':{'id':_0x78a959['params']['id']}},_0x5693d9={};_0x5693d9[_0xc348('0x36')]=_[_0xc348('0x39')](db[_0xc348('0x48')][_0xc348('0x32')]);_0x5693d9[_0xc348('0x38')]=_[_0xc348('0x39')](_0x78a959[_0xc348('0x38')]);_0x5693d9['filters']=_[_0xc348('0x3b')](_0x5693d9[_0xc348('0x36')],_0x5693d9[_0xc348('0x38')]);_0x327efa['attributes']=_[_0xc348('0x3b')](_0x5693d9[_0xc348('0x36')],qs[_0xc348('0x3d')](_0x78a959[_0xc348('0x38')][_0xc348('0x3d')]));_0x327efa['attributes']=_0x327efa[_0xc348('0x3c')]['length']?_0x327efa[_0xc348('0x3c')]:_0x5693d9['model'];if(_0x78a959[_0xc348('0x38')][_0xc348('0x4d')]){_0x327efa[_0xc348('0x47')]=[{'all':!![]}];}_0x327efa=_['merge']({},_0x327efa,_0x78a959[_0xc348('0x46')]);return db['WhatsappQueue'][_0xc348('0x4e')](_0x327efa)[_0xc348('0x28')](handleEntityNotFound(_0x55048c,null))[_0xc348('0x28')](respondWithResult(_0x55048c,null))[_0xc348('0x4b')](handleError(_0x55048c,null));};exports[_0xc348('0x4f')]=function(_0x1c406a,_0x5d20d9){return db['WhatsappQueue'][_0xc348('0x4f')](_0x1c406a[_0xc348('0x50')],{})[_0xc348('0x28')](function(_0x4788c1){var _0x405b86=_0x1c406a['user'][_0xc348('0x2a')]({'plain':!![]});if(!_0x405b86)throw new Error(_0xc348('0x51'));if(_0x405b86[_0xc348('0x52')]==='user'){var _0x2be530=_0x4788c1[_0xc348('0x2a')]({'plain':!![]});var _0x19be4b=_0xc348('0x2b');return db[_0xc348('0x53')][_0xc348('0x4e')]({'where':{'name':_0x19be4b,'userProfileId':_0x405b86[_0xc348('0x54')]},'raw':!![]})[_0xc348('0x28')](function(_0xf2c31b){if(_0xf2c31b&&_0xf2c31b[_0xc348('0x55')]===0x0){return db[_0xc348('0x56')][_0xc348('0x4f')]({'name':_0x2be530[_0xc348('0x2f')],'resourceId':_0x2be530['id'],'type':_0xf2c31b[_0xc348('0x2f')],'sectionId':_0xf2c31b['id']},{})[_0xc348('0x28')](function(){return _0x4788c1;});}else{return _0x4788c1;}})[_0xc348('0x4b')](function(_0x1f4d49){logger['error'](_0xc348('0x57'),_0x1f4d49);throw _0x1f4d49;});}return _0x4788c1;})['then'](respondWithResult(_0x5d20d9,0xc9))['catch'](handleError(_0x5d20d9,null));};exports[_0xc348('0x58')]=function(_0x4a7f74,_0x40c859){if(_0x4a7f74[_0xc348('0x50')]['id']){delete _0x4a7f74[_0xc348('0x50')]['id'];}return db[_0xc348('0x48')]['find']({'where':{'id':_0x4a7f74['params']['id']}})[_0xc348('0x28')](handleEntityNotFound(_0x40c859,null))['then'](saveUpdates(_0x4a7f74['body'],null))[_0xc348('0x28')](respondWithResult(_0x40c859,null))[_0xc348('0x4b')](handleError(_0x40c859,null));};exports['destroy']=function(_0x3f0ddd,_0x37cad5){return db['WhatsappQueue'][_0xc348('0x4e')]({'where':{'id':_0x3f0ddd[_0xc348('0x59')]['id']}})[_0xc348('0x28')](handleEntityNotFound(_0x37cad5,null))[_0xc348('0x28')](removeEntity(_0x37cad5,null))['catch'](handleError(_0x37cad5,null));};exports[_0xc348('0x5a')]=function(_0x58ce66,_0x59f10d){return db[_0xc348('0x48')][_0xc348('0x5a')]()[_0xc348('0x28')](respondWithResult(_0x59f10d,null))[_0xc348('0x4b')](handleError(_0x59f10d,null));};exports['getMembers']=function(_0x346a4b,_0x4aa484,_0x20cf03){var _0x3e638d={'raw':!![],'where':{}},_0x47e6d6={},_0x521ab1;return db[_0xc348('0x48')][_0xc348('0x5b')]({'where':{'id':_0x346a4b[_0xc348('0x59')]['id']}})['then'](handleEntityNotFound(_0x4aa484,null))[_0xc348('0x28')](function(_0x158bd4){if(_0x158bd4){_0x521ab1=_0x158bd4[_0xc348('0x2a')]({'plain':!![]});_0x47e6d6[_0xc348('0x36')]=_[_0xc348('0x39')](db[_0xc348('0x5c')][_0xc348('0x32')]);_0x47e6d6[_0xc348('0x38')]=_[_0xc348('0x39')](_0x346a4b['query']);_0x47e6d6[_0xc348('0x3a')]=_[_0xc348('0x3b')](_0x47e6d6['model'],_0x47e6d6[_0xc348('0x38')]);_0x3e638d[_0xc348('0x3c')]=_[_0xc348('0x3b')](_0x47e6d6['model'],qs['fields'](_0x346a4b[_0xc348('0x38')][_0xc348('0x3d')]));_0x3e638d['attributes']=_0x3e638d[_0xc348('0x3c')][_0xc348('0x5d')]?_0x3e638d[_0xc348('0x3c')]:_0x47e6d6[_0xc348('0x36')];if(!_0x346a4b[_0xc348('0x38')][_0xc348('0x3e')](_0xc348('0x3f'))){_0x3e638d[_0xc348('0x22')]=qs['limit'](_0x346a4b[_0xc348('0x38')][_0xc348('0x22')]);_0x3e638d[_0xc348('0x20')]=qs[_0xc348('0x20')](_0x346a4b['query'][_0xc348('0x20')]);}_0x3e638d[_0xc348('0x40')]=qs['sort'](_0x346a4b[_0xc348('0x38')][_0xc348('0x41')]);_0x3e638d[_0xc348('0x42')]=qs['filters'](_[_0xc348('0x43')](_0x346a4b['query'],_0x47e6d6[_0xc348('0x3a')]));_0x3e638d[_0xc348('0x42')][_0xc348('0x5e')]=_0x158bd4['id'];if(_0x346a4b[_0xc348('0x38')][_0xc348('0x44')]){_0x3e638d[_0xc348('0x42')]=_[_0xc348('0x45')](_0x3e638d[_0xc348('0x42')],{'$or':_['map'](_0x3e638d[_0xc348('0x3c')],function(_0x16e899){var _0xdcfc83={};_0xdcfc83[_0x16e899]={'$like':'%'+_0x346a4b['query'][_0xc348('0x44')]+'%'};return _0xdcfc83;})});}_0x3e638d=_[_0xc348('0x45')]({},_0x3e638d,_0x346a4b['options']);return db[_0xc348('0x5c')][_0xc348('0x49')](_0x3e638d);}})[_0xc348('0x28')](function(_0x18a417){if(_0x18a417){return db[_0xc348('0x5f')][_0xc348('0x60')]({'where':{'id':_[_0xc348('0x37')](_0x18a417,_0xc348('0x61')),'role':'agent'},'attributes':['id',_0xc348('0x2f'),'whatsappPause',_0xc348('0x62'),_0xc348('0x63')]});}})['then'](function(_0x4bc380){if(_0x4bc380){return{'count':_0x4bc380[_0xc348('0x23')],'rows':_[_0xc348('0x37')](_0x4bc380[_0xc348('0x4a')],function(_0x5717e2){return{'membername':_0x5717e2[_0xc348('0x2f')],'UserId':_0x5717e2['id'],'queue_name':_0x521ab1[_0xc348('0x2f')],'WhatsappQueueId':_0x521ab1['id'],'interface':util[_0xc348('0x64')]('%s/%s',_0xc348('0x65'),_0x5717e2['name']),'penalty':0x0,'paused':_0x5717e2[_0xc348('0x66')],'createdAt':_0x5717e2['createdAt'],'updatedAt':_0x5717e2[_0xc348('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc348('0x28')](respondWithFilteredResult(_0x4aa484,_0x3e638d))[_0xc348('0x4b')](handleError(_0x4aa484,null));};exports['getTeams']=function(_0x36242b,_0x32531d,_0x4b6aa3){var _0x1abdb6={};var _0x24a746={};var _0x13146f;var _0x1a78d5;return db[_0xc348('0x48')][_0xc348('0x5b')]({'where':{'id':_0x36242b['params']['id']}})[_0xc348('0x28')](handleEntityNotFound(_0x32531d,null))[_0xc348('0x28')](function(_0x40cf96){if(_0x40cf96){_0x13146f=_0x40cf96;_0x24a746[_0xc348('0x36')]=_[_0xc348('0x39')](db['Team'][_0xc348('0x32')]);_0x24a746['query']=_[_0xc348('0x39')](_0x36242b[_0xc348('0x38')]);_0x24a746[_0xc348('0x3a')]=_[_0xc348('0x3b')](_0x24a746[_0xc348('0x36')],_0x24a746[_0xc348('0x38')]);_0x1abdb6[_0xc348('0x3c')]=_['intersection'](_0x24a746[_0xc348('0x36')],qs[_0xc348('0x3d')](_0x36242b[_0xc348('0x38')][_0xc348('0x3d')]));_0x1abdb6[_0xc348('0x3c')]=_0x1abdb6[_0xc348('0x3c')]['length']?_0x1abdb6['attributes']:_0x24a746[_0xc348('0x36')];_0x1abdb6[_0xc348('0x40')]=qs['sort'](_0x36242b[_0xc348('0x38')]['sort']);_0x1abdb6[_0xc348('0x42')]=qs['filters'](_[_0xc348('0x43')](_0x36242b[_0xc348('0x38')],_0x24a746[_0xc348('0x3a')]));if(_0x36242b[_0xc348('0x38')][_0xc348('0x44')]){_0x1abdb6[_0xc348('0x42')]=_[_0xc348('0x45')](_0x1abdb6[_0xc348('0x42')],{'$or':_[_0xc348('0x37')](_0x1abdb6[_0xc348('0x3c')],function(_0x449861){var _0x2e3915={};_0x2e3915[_0x449861]={'$like':'%'+_0x36242b[_0xc348('0x38')][_0xc348('0x44')]+'%'};return _0x2e3915;})});}_0x1abdb6=_[_0xc348('0x45')]({},_0x1abdb6,_0x36242b[_0xc348('0x46')]);return _0x13146f[_0xc348('0x67')](_0x1abdb6);}})[_0xc348('0x28')](function(_0x4c20ee){if(_0x4c20ee){_0x1a78d5=_0x4c20ee[_0xc348('0x5d')];if(!_0x36242b['query'][_0xc348('0x3e')](_0xc348('0x3f'))){_0x1abdb6[_0xc348('0x22')]=qs[_0xc348('0x22')](_0x36242b['query'][_0xc348('0x22')]);_0x1abdb6[_0xc348('0x20')]=qs['offset'](_0x36242b[_0xc348('0x38')]['offset']);}return _0x13146f['getTeams'](_0x1abdb6);}})[_0xc348('0x28')](function(_0x3889d8){if(_0x3889d8){return _0x3889d8?{'count':_0x1a78d5,'rows':_0x3889d8}:null;}})['then'](respondWithResult(_0x32531d,null))[_0xc348('0x4b')](handleError(_0x32531d,null));};exports[_0xc348('0x68')]=function(_0x5489f2,_0x5378aa,_0x353f06){var _0x3bfc19=_0x5489f2[_0xc348('0x50')][_0xc348('0x69')];return db['Team'][_0xc348('0x49')]({'where':{'id':_0x3bfc19},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xc348('0x6a'),_0xc348('0x6b'),'interface'],'raw':!![]}]})['then'](function(_0x92bd55){if(_0x92bd55){var _0x1537f2=_[_0xc348('0x6c')](_0x92bd55,function(_0x13beec){var _0x497357=_0x13beec[_0xc348('0x2a')]({'plain':!![]});return _0x497357[_0xc348('0x6d')];});return db[_0xc348('0x48')][_0xc348('0x4e')]({'where':{'id':_0x5489f2[_0xc348('0x59')]['id']}})[_0xc348('0x28')](function(_0x58afe9){return db[_0xc348('0x6e')]['transaction'](function(_0x3da162){return _0x58afe9[_0xc348('0x68')](_0x3bfc19,{'transaction':_0x3da162})[_0xc348('0x28')](function(){return BPromise['each'](_0x1537f2,function(_0x3b0ca5){return db['UserWhatsappQueue'][_0xc348('0x6f')]({'where':{'UserId':_0x3b0ca5['id'],'WhatsappQueueId':_0x5489f2[_0xc348('0x59')]['id']},'transaction':_0x3da162});});})[_0xc348('0x28')](function(){_0x1537f2['forEach'](function(_0x3f6acd){socket[_0xc348('0x70')](_0xc348('0x71'),{'UserId':_0x3f6acd['id'],'WhatsappQueueId':_0x58afe9['id']});});});});});}})['then'](respondWithStatusCode(_0x5378aa,null))[_0xc348('0x4b')](handleError(_0x5378aa,null));};exports[_0xc348('0x72')]=function(_0x47060f,_0x11dff6,_0x379b51){return db[_0xc348('0x73')]['findAll']({'where':{'id':_0x47060f['query'][_0xc348('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc348('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xc348('0x28')](handleEntityNotFound(_0x11dff6,null))[_0xc348('0x28')](function(_0x100301){var _0x3944c7=_[_0xc348('0x37')](_0x100301,'id');var _0x404ed0=[];var _0x20e01d=[];var _0x4865c5=squel['select']();_0x4865c5['field']('tq.TeamId')[_0xc348('0x74')](_0xc348('0x75'),'tq')[_0xc348('0x76')](_0xc348('0x77'),'ut',_0xc348('0x78'))[_0xc348('0x42')]('WhatsappQueueId\x20=\x20?',_0x47060f['params']['id']);for(var _0x3102f7=0x0;_0x3102f7<_0x100301[_0xc348('0x5d')];_0x3102f7+=0x1){let _0x4d9eb8=_0x100301[_0x3102f7];for(var _0x1cbc06=0x0;_0x1cbc06<_0x4d9eb8[_0xc348('0x6d')][_0xc348('0x5d')];_0x1cbc06+=0x1){let _0x2da169=_0x4d9eb8[_0xc348('0x6d')][_0x1cbc06];var _0xf9ea6d=_0x4865c5[_0xc348('0x79')]();_0xf9ea6d[_0xc348('0x42')]('ut.UserId\x20=\x20?',_0x2da169['id']);_0x20e01d[_0xc348('0x7a')](db[_0xc348('0x6e')][_0xc348('0x38')](_0xf9ea6d[_0xc348('0x7b')](),{'type':db['sequelize'][_0xc348('0x7c')][_0xc348('0x7d')]})[_0xc348('0x28')](function(_0x15fda9){if(_0x15fda9[_0xc348('0x5d')]===0x1){return _0x2da169['id'];}else{var _0x3c982c=_[_0xc348('0x7e')](_[_0xc348('0x37')](_0x15fda9,_0xc348('0x7f')),function(_0x22e9f4){return _[_0xc348('0x80')](_0x3944c7,_0x22e9f4);});if(_0x3c982c){return _0x2da169['id'];}}}));}}return BPromise[_0xc348('0x81')](_0x20e01d)[_0xc348('0x28')](function(_0x5d152f){_0x404ed0=_(_0x404ed0)[_0xc348('0x82')](_0x5d152f)[_0xc348('0x83')]()[_0xc348('0x84')]();return db[_0xc348('0x48')][_0xc348('0x4e')]({'where':{'id':_0x47060f[_0xc348('0x59')]['id']}})[_0xc348('0x28')](function(_0x506d0c){return db['sequelize'][_0xc348('0x85')](function(_0x4d2740){return _0x506d0c[_0xc348('0x72')](_0x47060f['query']['ids'],{'transaction':_0x4d2740})[_0xc348('0x28')](function(){if(!_[_0xc348('0x86')](_0x404ed0)){return _0x506d0c['removeAgents'](_0x404ed0,{'transaction':_0x4d2740});}})[_0xc348('0x28')](function(){_0x404ed0[_0xc348('0x87')](function(_0x570a98){socket[_0xc348('0x70')](_0xc348('0x88'),{'UserId':_0x570a98,'WhatsappQueueId':_0x506d0c['id']});});});});});});})[_0xc348('0x28')](respondWithStatusCode(_0x11dff6,null))[_0xc348('0x4b')](handleError(_0x11dff6,null));};exports[_0xc348('0x89')]=function(_0x15f8ee,_0x200918,_0x4a34eb){return db[_0xc348('0x48')]['find']({'where':{'id':_0x15f8ee[_0xc348('0x59')]['id']}})[_0xc348('0x28')](handleEntityNotFound(_0x200918,null))[_0xc348('0x28')](function(_0x5225b5){if(_0x5225b5){return _0x5225b5[_0xc348('0x89')](_0x15f8ee['body'][_0xc348('0x69')],_[_0xc348('0x8a')](_0x15f8ee[_0xc348('0x50')],[_0xc348('0x69'),'id'])||{})['spread'](function(_0x2b00de){for(var _0x2c290a=0x0;_0x2c290a<_0x15f8ee['body']['ids'][_0xc348('0x5d')];_0x2c290a+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0x15f8ee[_0xc348('0x50')][_0xc348('0x69')][_0x2c290a]),'WhatsappQueueId':Number(_0x15f8ee['params']['id'])});}return _0x2b00de;});}})[_0xc348('0x28')](respondWithResult(_0x200918,null))['catch'](handleError(_0x200918,null));};exports[_0xc348('0x8b')]=function(_0x1cb656,_0x38cb93,_0x51762d){return db[_0xc348('0x48')]['find']({'where':{'id':_0x1cb656['params']['id']}})['then'](handleEntityNotFound(_0x38cb93,null))[_0xc348('0x28')](function(_0x1b7f55){if(_0x1b7f55){return _0x1b7f55[_0xc348('0x8b')](_0x1cb656[_0xc348('0x38')][_0xc348('0x69')])[_0xc348('0x28')](function(){if(_['isArray'](_0x1cb656[_0xc348('0x38')][_0xc348('0x69')])){for(var _0x3ae448=0x0;_0x3ae448<_0x1cb656[_0xc348('0x38')][_0xc348('0x69')][_0xc348('0x5d')];_0x3ae448+=0x1){socket['emit'](_0xc348('0x88'),{'UserId':Number(_0x1cb656['query']['ids'][_0x3ae448]),'WhatsappQueueId':Number(_0x1cb656['params']['id'])});}}else{socket[_0xc348('0x70')](_0xc348('0x88'),{'UserId':Number(_0x1cb656[_0xc348('0x38')][_0xc348('0x69')]),'WhatsappQueueId':Number(_0x1cb656[_0xc348('0x59')]['id'])});}});}})[_0xc348('0x28')](respondWithStatusCode(_0x38cb93,null))[_0xc348('0x4b')](handleError(_0x38cb93,null));};exports[_0xc348('0x8c')]=function(_0x4350e1,_0x589914,_0x2220bc){var _0x5ea149={};var _0x32e315={};var _0x11cf25;var _0x35e695;return db['WhatsappQueue'][_0xc348('0x5b')]({'where':{'id':_0x4350e1[_0xc348('0x59')]['id']}})[_0xc348('0x28')](handleEntityNotFound(_0x589914,null))[_0xc348('0x28')](function(_0x392cf1){if(_0x392cf1){_0x11cf25=_0x392cf1;_0x32e315[_0xc348('0x36')]=_['keys'](db[_0xc348('0x5f')]['rawAttributes']);_0x32e315[_0xc348('0x38')]=_[_0xc348('0x39')](_0x4350e1[_0xc348('0x38')]);_0x32e315[_0xc348('0x3a')]=_[_0xc348('0x3b')](_0x32e315['model'],_0x32e315[_0xc348('0x38')]);_0x5ea149['attributes']=_[_0xc348('0x3b')](_0x32e315['model'],qs['fields'](_0x4350e1[_0xc348('0x38')][_0xc348('0x3d')]));_0x5ea149[_0xc348('0x3c')]=_0x5ea149['attributes'][_0xc348('0x5d')]?_0x5ea149[_0xc348('0x3c')]:_0x32e315['model'];_0x5ea149[_0xc348('0x40')]=qs[_0xc348('0x41')](_0x4350e1[_0xc348('0x38')][_0xc348('0x41')]);_0x5ea149[_0xc348('0x42')]=qs[_0xc348('0x3a')](_['pick'](_0x4350e1[_0xc348('0x38')],_0x32e315[_0xc348('0x3a')]));if(_0x4350e1['query'][_0xc348('0x44')]){_0x5ea149['where']=_[_0xc348('0x45')](_0x5ea149['where'],{'$or':_[_0xc348('0x37')](_0x5ea149[_0xc348('0x3c')],function(_0x4871a4){var _0x47aacb={};_0x47aacb[_0x4871a4]={'$like':'%'+_0x4350e1[_0xc348('0x38')][_0xc348('0x44')]+'%'};return _0x47aacb;})});}_0x5ea149=_[_0xc348('0x45')]({},_0x5ea149,_0x4350e1[_0xc348('0x46')]);return _0x11cf25[_0xc348('0x8c')](_0x5ea149);}})[_0xc348('0x28')](function(_0x556182){if(_0x556182){_0x35e695=_0x556182[_0xc348('0x5d')];if(!_0x4350e1['query'][_0xc348('0x3e')](_0xc348('0x3f'))){_0x5ea149['limit']=qs['limit'](_0x4350e1['query'][_0xc348('0x22')]);_0x5ea149[_0xc348('0x20')]=qs[_0xc348('0x20')](_0x4350e1[_0xc348('0x38')][_0xc348('0x20')]);}return _0x11cf25[_0xc348('0x8c')](_0x5ea149);}})[_0xc348('0x28')](function(_0x10b0ea){if(_0x10b0ea){return _0x10b0ea?{'count':_0x35e695,'rows':_0x10b0ea}:null;}})['then'](respondWithResult(_0x589914,null))[_0xc348('0x4b')](handleError(_0x589914,null));}; \ No newline at end of file +var _0xe1f2=['Agents','sequelize','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','WhatsappQueue','includeAll','include','rows','catch','params','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','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','findAll','User','findAndCountAll','UserId','agent','whatsappPause','format','%s/%s','SIP','createdAt','updatedAt','Team','getTeams','ids','online','voicePause','interface','flatMap'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe1f2,0x1d2));var _0x2e1f=function(_0x582e18,_0x4fd856){_0x582e18=_0x582e18-0x0;var _0x445d03=_0xe1f2[_0x582e18];return _0x445d03;};'use strict';var emlformat=require(_0x2e1f('0x0'));var rimraf=require(_0x2e1f('0x1'));var zipdir=require(_0x2e1f('0x2'));var jsonpatch=require(_0x2e1f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e1f('0x4'));var util=require(_0x2e1f('0x5'));var path=require(_0x2e1f('0x6'));var sox=require(_0x2e1f('0x7'));var csv=require('to-csv');var ejs=require(_0x2e1f('0x8'));var fs=require('fs');var fs_extra=require(_0x2e1f('0x9'));var _=require('lodash');var squel=require(_0x2e1f('0xa'));var crypto=require(_0x2e1f('0xb'));var jsforce=require(_0x2e1f('0xc'));var deskjs=require(_0x2e1f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2e1f('0xe'));var Papa=require('papaparse');var Redis=require(_0x2e1f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2e1f('0x10'));var as=require(_0x2e1f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e1f('0x12'))(_0x2e1f('0x13'));var utils=require(_0x2e1f('0x14'));var config=require(_0x2e1f('0x15'));var licenseUtil=require(_0x2e1f('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2e1f('0x17')](config['redis'],{'host':_0x2e1f('0x18'),'port':0x18eb});var socket=require(_0x2e1f('0x19'))(new Redis(config[_0x2e1f('0x1a')]));require(_0x2e1f('0x1b'))[_0x2e1f('0x1c')](socket);function respondWithStatusCode(_0x542efa,_0x2f0ca9){_0x2f0ca9=_0x2f0ca9||0xcc;return function(_0x3bfa7a){if(_0x3bfa7a){return _0x542efa[_0x2e1f('0x1d')](_0x2f0ca9);}return _0x542efa[_0x2e1f('0x1e')](_0x2f0ca9)['end']();};}function respondWithResult(_0x2631ca,_0x21742a){_0x21742a=_0x21742a||0xc8;return function(_0x4b2de9){if(_0x4b2de9){return _0x2631ca[_0x2e1f('0x1e')](_0x21742a)[_0x2e1f('0x1f')](_0x4b2de9);}};}function respondWithFilteredResult(_0x596759,_0x16f49c){return function(_0x3489b5){if(_0x3489b5){var _0x1af048=typeof _0x16f49c[_0x2e1f('0x20')]==='undefined'&&typeof _0x16f49c[_0x2e1f('0x21')]===_0x2e1f('0x22');var _0x52c1b1=_0x3489b5[_0x2e1f('0x23')];var _0x4ad03b=_0x1af048?0x0:_0x16f49c[_0x2e1f('0x20')];var _0xc81838=_0x1af048?_0x3489b5[_0x2e1f('0x23')]:_0x16f49c[_0x2e1f('0x20')]+_0x16f49c['limit'];var _0x3a98a5;if(_0xc81838>=_0x52c1b1){_0xc81838=_0x52c1b1;_0x3a98a5=0xc8;}else{_0x3a98a5=0xce;}_0x596759[_0x2e1f('0x1e')](_0x3a98a5);return _0x596759[_0x2e1f('0x24')](_0x2e1f('0x25'),_0x4ad03b+'-'+_0xc81838+'/'+_0x52c1b1)[_0x2e1f('0x1f')](_0x3489b5);}return null;};}function patchUpdates(_0x4ddac1){return function(_0x117167){try{jsonpatch[_0x2e1f('0x26')](_0x117167,_0x4ddac1,!![]);}catch(_0x49d369){return BPromise[_0x2e1f('0x27')](_0x49d369);}return _0x117167[_0x2e1f('0x28')]();};}function saveUpdates(_0x746aa8,_0x780fde){return function(_0x2ec505){if(_0x2ec505){return _0x2ec505[_0x2e1f('0x29')](_0x746aa8)[_0x2e1f('0x2a')](function(_0xca9dd8){return _0xca9dd8;});}return null;};}function removeEntity(_0x2336bf,_0x489b0d){return function(_0x2e4943){if(_0x2e4943){return _0x2e4943[_0x2e1f('0x2b')]()['then'](function(){var _0xe98723=_0x2e4943[_0x2e1f('0x2c')]({'plain':!![]});var _0x448869=_0x2e1f('0x2d');return db[_0x2e1f('0x2e')]['destroy']({'where':{'type':_0x448869,'resourceId':_0xe98723['id']}})[_0x2e1f('0x2a')](function(){return _0x2e4943;});})[_0x2e1f('0x2a')](function(){_0x2336bf[_0x2e1f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8efa74,_0x17a87b){return function(_0x519dbe){if(!_0x519dbe){_0x8efa74['sendStatus'](0x194);}return _0x519dbe;};}function handleError(_0x442869,_0x2a5c58){_0x2a5c58=_0x2a5c58||0x1f4;return function(_0xda558a){logger[_0x2e1f('0x2f')](_0xda558a[_0x2e1f('0x30')]);if(_0xda558a[_0x2e1f('0x31')]){delete _0xda558a[_0x2e1f('0x31')];}_0x442869[_0x2e1f('0x1e')](_0x2a5c58)['send'](_0xda558a);};}exports['index']=function(_0x5275f7,_0x29935e){var _0x2e0c69={},_0x940222={},_0x2853eb={'count':0x0,'rows':[]};var _0x2762cf=_[_0x2e1f('0x32')](db['WhatsappQueue'][_0x2e1f('0x33')],function(_0x5db66d){return{'name':_0x5db66d[_0x2e1f('0x34')],'type':_0x5db66d[_0x2e1f('0x35')]['key']};});_0x940222[_0x2e1f('0x36')]=_[_0x2e1f('0x32')](_0x2762cf,_0x2e1f('0x31'));_0x940222[_0x2e1f('0x37')]=_[_0x2e1f('0x38')](_0x5275f7[_0x2e1f('0x37')]);_0x940222[_0x2e1f('0x39')]=_[_0x2e1f('0x3a')](_0x940222[_0x2e1f('0x36')],_0x940222[_0x2e1f('0x37')]);_0x2e0c69[_0x2e1f('0x3b')]=_[_0x2e1f('0x3a')](_0x940222[_0x2e1f('0x36')],qs[_0x2e1f('0x3c')](_0x5275f7['query'][_0x2e1f('0x3c')]));_0x2e0c69['attributes']=_0x2e0c69['attributes']['length']?_0x2e0c69[_0x2e1f('0x3b')]:_0x940222[_0x2e1f('0x36')];if(!_0x5275f7[_0x2e1f('0x37')][_0x2e1f('0x3d')](_0x2e1f('0x3e'))){_0x2e0c69[_0x2e1f('0x21')]=qs['limit'](_0x5275f7[_0x2e1f('0x37')][_0x2e1f('0x21')]);_0x2e0c69[_0x2e1f('0x20')]=qs[_0x2e1f('0x20')](_0x5275f7['query'][_0x2e1f('0x20')]);}_0x2e0c69['order']=qs[_0x2e1f('0x3f')](_0x5275f7[_0x2e1f('0x37')]['sort']);_0x2e0c69[_0x2e1f('0x40')]=qs['filters'](_[_0x2e1f('0x41')](_0x5275f7[_0x2e1f('0x37')],_0x940222[_0x2e1f('0x39')]),_0x2762cf);if(_0x5275f7[_0x2e1f('0x37')]['filter']){_0x2e0c69[_0x2e1f('0x40')]=_[_0x2e1f('0x42')](_0x2e0c69[_0x2e1f('0x40')],{'$or':_[_0x2e1f('0x32')](_0x2762cf,function(_0x4f83b4){if(_0x4f83b4['type']!==_0x2e1f('0x43')){var _0x51ff56={};_0x51ff56[_0x4f83b4[_0x2e1f('0x31')]]={'$like':'%'+_0x5275f7['query'][_0x2e1f('0x44')]+'%'};return _0x51ff56;}})});}_0x2e0c69=_['merge']({},_0x2e0c69,_0x5275f7[_0x2e1f('0x45')]);var _0x2fc9f2={'where':_0x2e0c69[_0x2e1f('0x40')]};return db[_0x2e1f('0x46')][_0x2e1f('0x23')](_0x2fc9f2)[_0x2e1f('0x2a')](function(_0x4f40a9){_0x2853eb['count']=_0x4f40a9;if(_0x5275f7['query'][_0x2e1f('0x47')]){_0x2e0c69[_0x2e1f('0x48')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x2e0c69);})[_0x2e1f('0x2a')](function(_0x368e77){_0x2853eb[_0x2e1f('0x49')]=_0x368e77;return _0x2853eb;})['then'](respondWithFilteredResult(_0x29935e,_0x2e0c69))[_0x2e1f('0x4a')](handleError(_0x29935e,null));};exports['show']=function(_0x3f9aa9,_0x5dcb5a){var _0x26920c={'raw':!![],'where':{'id':_0x3f9aa9[_0x2e1f('0x4b')]['id']}},_0x3d3c75={};_0x3d3c75[_0x2e1f('0x36')]=_[_0x2e1f('0x38')](db[_0x2e1f('0x46')][_0x2e1f('0x33')]);_0x3d3c75[_0x2e1f('0x37')]=_[_0x2e1f('0x38')](_0x3f9aa9[_0x2e1f('0x37')]);_0x3d3c75[_0x2e1f('0x39')]=_[_0x2e1f('0x3a')](_0x3d3c75[_0x2e1f('0x36')],_0x3d3c75[_0x2e1f('0x37')]);_0x26920c[_0x2e1f('0x3b')]=_[_0x2e1f('0x3a')](_0x3d3c75[_0x2e1f('0x36')],qs[_0x2e1f('0x3c')](_0x3f9aa9[_0x2e1f('0x37')][_0x2e1f('0x3c')]));_0x26920c[_0x2e1f('0x3b')]=_0x26920c[_0x2e1f('0x3b')][_0x2e1f('0x4c')]?_0x26920c['attributes']:_0x3d3c75[_0x2e1f('0x36')];if(_0x3f9aa9[_0x2e1f('0x37')]['includeAll']){_0x26920c[_0x2e1f('0x48')]=[{'all':!![]}];}_0x26920c=_[_0x2e1f('0x42')]({},_0x26920c,_0x3f9aa9[_0x2e1f('0x45')]);return db[_0x2e1f('0x46')][_0x2e1f('0x4d')](_0x26920c)[_0x2e1f('0x2a')](handleEntityNotFound(_0x5dcb5a,null))['then'](respondWithResult(_0x5dcb5a,null))[_0x2e1f('0x4a')](handleError(_0x5dcb5a,null));};exports[_0x2e1f('0x4e')]=function(_0x1c1527,_0x5c2b6b){return db[_0x2e1f('0x46')]['create'](_0x1c1527['body'],{})[_0x2e1f('0x2a')](function(_0x23bbbe){var _0x3a2d88=_0x1c1527[_0x2e1f('0x4f')]['get']({'plain':!![]});if(!_0x3a2d88)throw new Error(_0x2e1f('0x50'));if(_0x3a2d88[_0x2e1f('0x51')]===_0x2e1f('0x4f')){var _0xc5549d=_0x23bbbe[_0x2e1f('0x2c')]({'plain':!![]});var _0x25aa75=_0x2e1f('0x2d');return db['UserProfileSection'][_0x2e1f('0x4d')]({'where':{'name':_0x25aa75,'userProfileId':_0x3a2d88[_0x2e1f('0x52')]},'raw':!![]})[_0x2e1f('0x2a')](function(_0x3737e0){if(_0x3737e0&&_0x3737e0[_0x2e1f('0x53')]===0x0){return db[_0x2e1f('0x2e')][_0x2e1f('0x4e')]({'name':_0xc5549d['name'],'resourceId':_0xc5549d['id'],'type':_0x3737e0[_0x2e1f('0x31')],'sectionId':_0x3737e0['id']},{})[_0x2e1f('0x2a')](function(){return _0x23bbbe;});}else{return _0x23bbbe;}})[_0x2e1f('0x4a')](function(_0x5700a1){logger[_0x2e1f('0x2f')](_0x2e1f('0x54'),_0x5700a1);throw _0x5700a1;});}return _0x23bbbe;})['then'](respondWithResult(_0x5c2b6b,0xc9))['catch'](handleError(_0x5c2b6b,null));};exports['update']=function(_0x3fbe50,_0x38f434){if(_0x3fbe50[_0x2e1f('0x55')]['id']){delete _0x3fbe50['body']['id'];}return db[_0x2e1f('0x46')][_0x2e1f('0x4d')]({'where':{'id':_0x3fbe50['params']['id']}})[_0x2e1f('0x2a')](handleEntityNotFound(_0x38f434,null))['then'](saveUpdates(_0x3fbe50[_0x2e1f('0x55')],null))[_0x2e1f('0x2a')](respondWithResult(_0x38f434,null))['catch'](handleError(_0x38f434,null));};exports[_0x2e1f('0x2b')]=function(_0x21961d,_0x2deb61){return db[_0x2e1f('0x46')][_0x2e1f('0x4d')]({'where':{'id':_0x21961d[_0x2e1f('0x4b')]['id']}})[_0x2e1f('0x2a')](handleEntityNotFound(_0x2deb61,null))[_0x2e1f('0x2a')](removeEntity(_0x2deb61,null))['catch'](handleError(_0x2deb61,null));};exports[_0x2e1f('0x56')]=function(_0x5abfa3,_0xdfc3ba){return db[_0x2e1f('0x46')][_0x2e1f('0x56')]()[_0x2e1f('0x2a')](respondWithResult(_0xdfc3ba,null))['catch'](handleError(_0xdfc3ba,null));};exports[_0x2e1f('0x57')]=function(_0x58e8b9,_0x3282ad,_0x2fd84e){var _0x44d6c0={'raw':!![],'where':{}},_0xebaffc={},_0x35cf2b;return db['WhatsappQueue'][_0x2e1f('0x58')]({'where':{'id':_0x58e8b9[_0x2e1f('0x4b')]['id']}})[_0x2e1f('0x2a')](handleEntityNotFound(_0x3282ad,null))['then'](function(_0x291693){if(_0x291693){_0x35cf2b=_0x291693[_0x2e1f('0x2c')]({'plain':!![]});_0xebaffc[_0x2e1f('0x36')]=_[_0x2e1f('0x38')](db[_0x2e1f('0x59')][_0x2e1f('0x33')]);_0xebaffc[_0x2e1f('0x37')]=_[_0x2e1f('0x38')](_0x58e8b9[_0x2e1f('0x37')]);_0xebaffc[_0x2e1f('0x39')]=_[_0x2e1f('0x3a')](_0xebaffc[_0x2e1f('0x36')],_0xebaffc[_0x2e1f('0x37')]);_0x44d6c0[_0x2e1f('0x3b')]=_['intersection'](_0xebaffc[_0x2e1f('0x36')],qs[_0x2e1f('0x3c')](_0x58e8b9[_0x2e1f('0x37')][_0x2e1f('0x3c')]));_0x44d6c0[_0x2e1f('0x3b')]=_0x44d6c0[_0x2e1f('0x3b')][_0x2e1f('0x4c')]?_0x44d6c0[_0x2e1f('0x3b')]:_0xebaffc[_0x2e1f('0x36')];if(!_0x58e8b9[_0x2e1f('0x37')][_0x2e1f('0x3d')](_0x2e1f('0x3e'))){_0x44d6c0[_0x2e1f('0x21')]=qs['limit'](_0x58e8b9['query']['limit']);_0x44d6c0[_0x2e1f('0x20')]=qs[_0x2e1f('0x20')](_0x58e8b9['query'][_0x2e1f('0x20')]);}_0x44d6c0[_0x2e1f('0x5a')]=qs[_0x2e1f('0x3f')](_0x58e8b9[_0x2e1f('0x37')][_0x2e1f('0x3f')]);_0x44d6c0['where']=qs['filters'](_['pick'](_0x58e8b9[_0x2e1f('0x37')],_0xebaffc['filters']));_0x44d6c0['where'][_0x2e1f('0x5b')]=_0x291693['id'];if(_0x58e8b9[_0x2e1f('0x37')]['filter']){_0x44d6c0['where']=_['merge'](_0x44d6c0['where'],{'$or':_[_0x2e1f('0x32')](_0x44d6c0[_0x2e1f('0x3b')],function(_0xad69b0){var _0x25f2be={};_0x25f2be[_0xad69b0]={'$like':'%'+_0x58e8b9[_0x2e1f('0x37')][_0x2e1f('0x44')]+'%'};return _0x25f2be;})});}_0x44d6c0=_[_0x2e1f('0x42')]({},_0x44d6c0,_0x58e8b9[_0x2e1f('0x45')]);return db[_0x2e1f('0x59')][_0x2e1f('0x5c')](_0x44d6c0);}})[_0x2e1f('0x2a')](function(_0x3d2570){if(_0x3d2570){return db[_0x2e1f('0x5d')][_0x2e1f('0x5e')]({'where':{'id':_[_0x2e1f('0x32')](_0x3d2570,_0x2e1f('0x5f')),'role':_0x2e1f('0x60')},'attributes':['id',_0x2e1f('0x31'),_0x2e1f('0x61'),'updatedAt','createdAt']});}})['then'](function(_0x4575f4){if(_0x4575f4){return{'count':_0x4575f4[_0x2e1f('0x23')],'rows':_[_0x2e1f('0x32')](_0x4575f4[_0x2e1f('0x49')],function(_0x270db2){return{'membername':_0x270db2[_0x2e1f('0x31')],'UserId':_0x270db2['id'],'queue_name':_0x35cf2b[_0x2e1f('0x31')],'WhatsappQueueId':_0x35cf2b['id'],'interface':util[_0x2e1f('0x62')](_0x2e1f('0x63'),_0x2e1f('0x64'),_0x270db2[_0x2e1f('0x31')]),'penalty':0x0,'paused':_0x270db2[_0x2e1f('0x61')],'createdAt':_0x270db2[_0x2e1f('0x65')],'updatedAt':_0x270db2[_0x2e1f('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3282ad,_0x44d6c0))[_0x2e1f('0x4a')](handleError(_0x3282ad,null));};exports['getTeams']=function(_0x43bb63,_0x396172,_0x44fa21){var _0x300722={};var _0x546c64={};var _0x30474f;var _0xe45e00;return db[_0x2e1f('0x46')][_0x2e1f('0x58')]({'where':{'id':_0x43bb63[_0x2e1f('0x4b')]['id']}})[_0x2e1f('0x2a')](handleEntityNotFound(_0x396172,null))[_0x2e1f('0x2a')](function(_0x125956){if(_0x125956){_0x30474f=_0x125956;_0x546c64[_0x2e1f('0x36')]=_[_0x2e1f('0x38')](db[_0x2e1f('0x67')][_0x2e1f('0x33')]);_0x546c64[_0x2e1f('0x37')]=_['keys'](_0x43bb63[_0x2e1f('0x37')]);_0x546c64[_0x2e1f('0x39')]=_[_0x2e1f('0x3a')](_0x546c64[_0x2e1f('0x36')],_0x546c64[_0x2e1f('0x37')]);_0x300722['attributes']=_['intersection'](_0x546c64['model'],qs['fields'](_0x43bb63['query'][_0x2e1f('0x3c')]));_0x300722[_0x2e1f('0x3b')]=_0x300722['attributes'][_0x2e1f('0x4c')]?_0x300722[_0x2e1f('0x3b')]:_0x546c64[_0x2e1f('0x36')];_0x300722[_0x2e1f('0x5a')]=qs[_0x2e1f('0x3f')](_0x43bb63[_0x2e1f('0x37')][_0x2e1f('0x3f')]);_0x300722[_0x2e1f('0x40')]=qs[_0x2e1f('0x39')](_[_0x2e1f('0x41')](_0x43bb63[_0x2e1f('0x37')],_0x546c64[_0x2e1f('0x39')]));if(_0x43bb63[_0x2e1f('0x37')]['filter']){_0x300722['where']=_['merge'](_0x300722[_0x2e1f('0x40')],{'$or':_['map'](_0x300722[_0x2e1f('0x3b')],function(_0x28ce70){var _0x35cde7={};_0x35cde7[_0x28ce70]={'$like':'%'+_0x43bb63[_0x2e1f('0x37')]['filter']+'%'};return _0x35cde7;})});}_0x300722=_[_0x2e1f('0x42')]({},_0x300722,_0x43bb63[_0x2e1f('0x45')]);return _0x30474f[_0x2e1f('0x68')](_0x300722);}})['then'](function(_0x40bb27){if(_0x40bb27){_0xe45e00=_0x40bb27[_0x2e1f('0x4c')];if(!_0x43bb63['query'][_0x2e1f('0x3d')](_0x2e1f('0x3e'))){_0x300722[_0x2e1f('0x21')]=qs[_0x2e1f('0x21')](_0x43bb63[_0x2e1f('0x37')][_0x2e1f('0x21')]);_0x300722[_0x2e1f('0x20')]=qs[_0x2e1f('0x20')](_0x43bb63['query']['offset']);}return _0x30474f[_0x2e1f('0x68')](_0x300722);}})[_0x2e1f('0x2a')](function(_0x1d2081){if(_0x1d2081){return _0x1d2081?{'count':_0xe45e00,'rows':_0x1d2081}:null;}})[_0x2e1f('0x2a')](respondWithResult(_0x396172,null))[_0x2e1f('0x4a')](handleError(_0x396172,null));};exports['addTeams']=function(_0x5f07ff,_0x3d44c2,_0x1200bb){var _0x3ec75f=_0x5f07ff[_0x2e1f('0x55')][_0x2e1f('0x69')];return db['Team'][_0x2e1f('0x5c')]({'where':{'id':_0x3ec75f},'attributes':['id'],'include':[{'model':db[_0x2e1f('0x5d')],'as':'Agents','attributes':['id','name',_0x2e1f('0x6a'),_0x2e1f('0x6b'),_0x2e1f('0x6c')],'raw':!![]}]})[_0x2e1f('0x2a')](function(_0x1a17dd){if(_0x1a17dd){var _0x409fad=_[_0x2e1f('0x6d')](_0x1a17dd,function(_0x33ba4b){var _0x49d2af=_0x33ba4b[_0x2e1f('0x2c')]({'plain':!![]});return _0x49d2af[_0x2e1f('0x6e')];});return db[_0x2e1f('0x46')][_0x2e1f('0x4d')]({'where':{'id':_0x5f07ff[_0x2e1f('0x4b')]['id']}})[_0x2e1f('0x2a')](function(_0x14b475){return db[_0x2e1f('0x6f')]['transaction'](function(_0x3c4076){return _0x14b475['addTeams'](_0x3ec75f,{'transaction':_0x3c4076})[_0x2e1f('0x2a')](function(){return BPromise['each'](_0x409fad,function(_0xb68da5){return db[_0x2e1f('0x59')][_0x2e1f('0x70')]({'where':{'UserId':_0xb68da5['id'],'WhatsappQueueId':_0x5f07ff[_0x2e1f('0x4b')]['id']},'transaction':_0x3c4076});});})[_0x2e1f('0x2a')](function(){_0x409fad[_0x2e1f('0x71')](function(_0x1fd271){socket['emit'](_0x2e1f('0x72'),{'UserId':_0x1fd271['id'],'WhatsappQueueId':_0x14b475['id']});});});});});}})[_0x2e1f('0x2a')](respondWithStatusCode(_0x3d44c2,null))[_0x2e1f('0x4a')](handleError(_0x3d44c2,null));};exports[_0x2e1f('0x73')]=function(_0x183f20,_0x33f313,_0x2077d0){return db['Team']['findAll']({'where':{'id':_0x183f20[_0x2e1f('0x37')][_0x2e1f('0x69')]},'attributes':['id'],'include':[{'model':db[_0x2e1f('0x5d')],'as':_0x2e1f('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x2e1f('0x2a')](handleEntityNotFound(_0x33f313,null))[_0x2e1f('0x2a')](function(_0x2eabb3){var _0x436297=_[_0x2e1f('0x32')](_0x2eabb3,'id');var _0x3346ec=[];var _0x3d6184=[];var _0x39c26b=squel['select']();_0x39c26b[_0x2e1f('0x74')](_0x2e1f('0x75'))[_0x2e1f('0x76')](_0x2e1f('0x77'),'tq')[_0x2e1f('0x78')](_0x2e1f('0x79'),'ut',_0x2e1f('0x7a'))['where'](_0x2e1f('0x7b'),_0x183f20[_0x2e1f('0x4b')]['id']);for(var _0x56e93e=0x0;_0x56e93e<_0x2eabb3[_0x2e1f('0x4c')];_0x56e93e+=0x1){let _0x425cae=_0x2eabb3[_0x56e93e];for(var _0x12b583=0x0;_0x12b583<_0x425cae[_0x2e1f('0x6e')][_0x2e1f('0x4c')];_0x12b583+=0x1){let _0x432446=_0x425cae['Agents'][_0x12b583];var _0x361866=_0x39c26b['clone']();_0x361866[_0x2e1f('0x40')](_0x2e1f('0x7c'),_0x432446['id']);_0x3d6184[_0x2e1f('0x7d')](db['sequelize'][_0x2e1f('0x37')](_0x361866[_0x2e1f('0x7e')](),{'type':db[_0x2e1f('0x6f')][_0x2e1f('0x7f')][_0x2e1f('0x80')]})[_0x2e1f('0x2a')](function(_0x2a255b){if(_0x2a255b[_0x2e1f('0x4c')]===0x1){return _0x432446['id'];}else{var _0x86fcbe=_[_0x2e1f('0x81')](_[_0x2e1f('0x32')](_0x2a255b,_0x2e1f('0x82')),function(_0x9785b8){return _['includes'](_0x436297,_0x9785b8);});if(_0x86fcbe){return _0x432446['id'];}}}));}}return BPromise[_0x2e1f('0x83')](_0x3d6184)[_0x2e1f('0x2a')](function(_0x16d224){_0x3346ec=_(_0x3346ec)[_0x2e1f('0x84')](_0x16d224)[_0x2e1f('0x85')]()['value']();return db['WhatsappQueue'][_0x2e1f('0x4d')]({'where':{'id':_0x183f20[_0x2e1f('0x4b')]['id']}})['then'](function(_0x3a0469){return db['sequelize'][_0x2e1f('0x86')](function(_0x3936cf){return _0x3a0469[_0x2e1f('0x73')](_0x183f20[_0x2e1f('0x37')]['ids'],{'transaction':_0x3936cf})[_0x2e1f('0x2a')](function(){if(!_[_0x2e1f('0x87')](_0x3346ec)){return _0x3a0469[_0x2e1f('0x88')](_0x3346ec,{'transaction':_0x3936cf});}})[_0x2e1f('0x2a')](function(){_0x3346ec[_0x2e1f('0x71')](function(_0x1fc850){socket['emit'](_0x2e1f('0x89'),{'UserId':_0x1fc850,'WhatsappQueueId':_0x3a0469['id']});});});});});});})[_0x2e1f('0x2a')](respondWithStatusCode(_0x33f313,null))[_0x2e1f('0x4a')](handleError(_0x33f313,null));};exports['addAgents']=function(_0x24a49f,_0xf8fb97,_0x147e04){return db['WhatsappQueue']['find']({'where':{'id':_0x24a49f[_0x2e1f('0x4b')]['id']}})[_0x2e1f('0x2a')](handleEntityNotFound(_0xf8fb97,null))[_0x2e1f('0x2a')](function(_0x272010){if(_0x272010){return _0x272010[_0x2e1f('0x8a')](_0x24a49f['body']['ids'],_[_0x2e1f('0x8b')](_0x24a49f[_0x2e1f('0x55')],['ids','id'])||{})[_0x2e1f('0x8c')](function(_0x223bce){for(var _0x5a425c=0x0;_0x5a425c<_0x24a49f[_0x2e1f('0x55')][_0x2e1f('0x69')]['length'];_0x5a425c+=0x1){socket['emit'](_0x2e1f('0x72'),{'UserId':Number(_0x24a49f[_0x2e1f('0x55')][_0x2e1f('0x69')][_0x5a425c]),'WhatsappQueueId':Number(_0x24a49f['params']['id'])});}return _0x223bce;});}})[_0x2e1f('0x2a')](respondWithResult(_0xf8fb97,null))[_0x2e1f('0x4a')](handleError(_0xf8fb97,null));};exports[_0x2e1f('0x88')]=function(_0x1f71a9,_0x1f734d,_0x46c75d){return db[_0x2e1f('0x46')][_0x2e1f('0x4d')]({'where':{'id':_0x1f71a9[_0x2e1f('0x4b')]['id']}})[_0x2e1f('0x2a')](handleEntityNotFound(_0x1f734d,null))[_0x2e1f('0x2a')](function(_0x34d6f7){if(_0x34d6f7){return _0x34d6f7['removeAgents'](_0x1f71a9[_0x2e1f('0x37')]['ids'])[_0x2e1f('0x2a')](function(){if(_[_0x2e1f('0x8d')](_0x1f71a9[_0x2e1f('0x37')][_0x2e1f('0x69')])){for(var _0x1499d3=0x0;_0x1499d3<_0x1f71a9['query'][_0x2e1f('0x69')][_0x2e1f('0x4c')];_0x1499d3+=0x1){socket[_0x2e1f('0x8e')]('userWhatsappQueue:remove',{'UserId':Number(_0x1f71a9[_0x2e1f('0x37')][_0x2e1f('0x69')][_0x1499d3]),'WhatsappQueueId':Number(_0x1f71a9[_0x2e1f('0x4b')]['id'])});}}else{socket[_0x2e1f('0x8e')](_0x2e1f('0x89'),{'UserId':Number(_0x1f71a9[_0x2e1f('0x37')]['ids']),'WhatsappQueueId':Number(_0x1f71a9[_0x2e1f('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f734d,null))[_0x2e1f('0x4a')](handleError(_0x1f734d,null));};exports[_0x2e1f('0x8f')]=function(_0x490054,_0x57bc6d,_0x4ba30a){var _0x45cf21={};var _0x5c0b63={};var _0x291667;var _0x21ea39;return db[_0x2e1f('0x46')][_0x2e1f('0x58')]({'where':{'id':_0x490054[_0x2e1f('0x4b')]['id']}})[_0x2e1f('0x2a')](handleEntityNotFound(_0x57bc6d,null))[_0x2e1f('0x2a')](function(_0x193550){if(_0x193550){_0x291667=_0x193550;_0x5c0b63[_0x2e1f('0x36')]=_['keys'](db[_0x2e1f('0x5d')][_0x2e1f('0x33')]);_0x5c0b63[_0x2e1f('0x37')]=_[_0x2e1f('0x38')](_0x490054[_0x2e1f('0x37')]);_0x5c0b63[_0x2e1f('0x39')]=_['intersection'](_0x5c0b63[_0x2e1f('0x36')],_0x5c0b63[_0x2e1f('0x37')]);_0x45cf21[_0x2e1f('0x3b')]=_[_0x2e1f('0x3a')](_0x5c0b63[_0x2e1f('0x36')],qs[_0x2e1f('0x3c')](_0x490054['query']['fields']));_0x45cf21[_0x2e1f('0x3b')]=_0x45cf21['attributes'][_0x2e1f('0x4c')]?_0x45cf21[_0x2e1f('0x3b')]:_0x5c0b63[_0x2e1f('0x36')];_0x45cf21[_0x2e1f('0x5a')]=qs[_0x2e1f('0x3f')](_0x490054[_0x2e1f('0x37')][_0x2e1f('0x3f')]);_0x45cf21[_0x2e1f('0x40')]=qs[_0x2e1f('0x39')](_[_0x2e1f('0x41')](_0x490054['query'],_0x5c0b63[_0x2e1f('0x39')]));if(_0x490054[_0x2e1f('0x37')][_0x2e1f('0x44')]){_0x45cf21[_0x2e1f('0x40')]=_[_0x2e1f('0x42')](_0x45cf21[_0x2e1f('0x40')],{'$or':_[_0x2e1f('0x32')](_0x45cf21[_0x2e1f('0x3b')],function(_0x5f48f6){var _0x56dba1={};_0x56dba1[_0x5f48f6]={'$like':'%'+_0x490054[_0x2e1f('0x37')]['filter']+'%'};return _0x56dba1;})});}_0x45cf21=_[_0x2e1f('0x42')]({},_0x45cf21,_0x490054[_0x2e1f('0x45')]);return _0x291667[_0x2e1f('0x8f')](_0x45cf21);}})['then'](function(_0x299df8){if(_0x299df8){_0x21ea39=_0x299df8[_0x2e1f('0x4c')];if(!_0x490054[_0x2e1f('0x37')]['hasOwnProperty'](_0x2e1f('0x3e'))){_0x45cf21[_0x2e1f('0x21')]=qs[_0x2e1f('0x21')](_0x490054['query'][_0x2e1f('0x21')]);_0x45cf21['offset']=qs['offset'](_0x490054[_0x2e1f('0x37')][_0x2e1f('0x20')]);}return _0x291667[_0x2e1f('0x8f')](_0x45cf21);}})[_0x2e1f('0x2a')](function(_0xfb70b0){if(_0xfb70b0){return _0xfb70b0?{'count':_0x21ea39,'rows':_0xfb70b0}:null;}})[_0x2e1f('0x2a')](respondWithResult(_0x57bc6d,null))[_0x2e1f('0x4a')](handleError(_0x57bc6d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 5bf04f8..6028bb6 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 _0xeabc=['exports','events','WhatsappQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0xeabc,0x131));var _0xceab=function(_0x3f326f,_0x55b4ea){_0x3f326f=_0x3f326f-0x0;var _0x42c3c9=_0xeabc[_0x3f326f];return _0x42c3c9;};'use strict';var EventEmitter=require(_0xceab('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xceab('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xceab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xceab('0x3'),'afterDestroy':_0xceab('0x4')};function emitEvent(_0x52c22b){return function(_0x763036,_0x41981e,_0x4989a3){WhatsappQueueEvents[_0xceab('0x5')](_0x52c22b+':'+_0x763036['id'],_0x763036);WhatsappQueueEvents['emit'](_0x52c22b,_0x763036);_0x4989a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xceab('0x6')](e,emitEvent(event));}}module[_0xceab('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xf58e=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5b5505,_0x28d5aa){var _0x2192e8=function(_0x1bbc34){while(--_0x1bbc34){_0x5b5505['push'](_0x5b5505['shift']());}};_0x2192e8(++_0x28d5aa);}(_0xf58e,0xd8));var _0xef58=function(_0x4a716c,_0x108681){_0x4a716c=_0x4a716c-0x0;var _0x4f1ce8=_0xf58e[_0x4a716c];return _0x4f1ce8;};'use strict';var EventEmitter=require(_0xef58('0x0'));var WhatsappQueue=require(_0xef58('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xef58('0x2')](0x0);var events={'afterCreate':_0xef58('0x3'),'afterUpdate':'update','afterDestroy':_0xef58('0x4')};function emitEvent(_0x9c89d4){return function(_0x19f686,_0x1e7800,_0x57d3bf){WhatsappQueueEvents[_0xef58('0x5')](_0x9c89d4+':'+_0x19f686['id'],_0x19f686);WhatsappQueueEvents[_0xef58('0x5')](_0x9c89d4,_0x19f686);_0x57d3bf(null);};}for(var e in events){if(events[_0xef58('0x6')](e)){var event=events[e];WhatsappQueue[_0xef58('0x7')](e,emitEvent(event));}}module[_0xef58('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index f5d1c92..3f224c3 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 _0x63d6=['bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger'];(function(_0x2a1c53,_0x1fadf4){var _0x32e248=function(_0x520397){while(--_0x520397){_0x2a1c53['push'](_0x2a1c53['shift']());}};_0x32e248(++_0x1fadf4);}(_0x63d6,0x105));var _0x663d=function(_0x4abe25,_0x3d2379){_0x4abe25=_0x4abe25-0x0;var _0x472ebf=_0x63d6[_0x4abe25];return _0x472ebf;};'use strict';var _=require(_0x663d('0x0'));var util=require(_0x663d('0x1'));var logger=require(_0x663d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x663d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663d('0x4'));var rimraf=require(_0x663d('0x5'));var config=require(_0x663d('0x6'));var attributes=require(_0x663d('0x7'));module[_0x663d('0x8')]=function(_0x51d7ef,_0x3e0180){return _0x51d7ef[_0x663d('0x9')](_0x663d('0xa'),attributes,{'tableName':_0x663d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb6c=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','../../config/logger','api'];(function(_0x4d3b77,_0x3c789c){var _0x1a716a=function(_0x10707c){while(--_0x10707c){_0x4d3b77['push'](_0x4d3b77['shift']());}};_0x1a716a(++_0x3c789c);}(_0xfb6c,0x15b));var _0xcfb6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcfb6('0x0'));var util=require(_0xcfb6('0x1'));var logger=require(_0xcfb6('0x2'))(_0xcfb6('0x3'));var moment=require(_0xcfb6('0x4'));var BPromise=require(_0xcfb6('0x5'));var rp=require(_0xcfb6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfb6('0x7'));var config=require(_0xcfb6('0x8'));var attributes=require(_0xcfb6('0x9'));module[_0xcfb6('0xa')]=function(_0x33679a,_0x3b5fed){return _0x33679a[_0xcfb6('0xb')](_0xcfb6('0xc'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 947f86d..65a5bd6 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 _0x8a69=['code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','map','include','model','attributes','then','debug','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2f48f,_0x5c2476){var _0x4fe910=function(_0x33d3fd){while(--_0x33d3fd){_0x2f48f['push'](_0x2f48f['shift']());}};_0x4fe910(++_0x5c2476);}(_0x8a69,0xea));var _0x98a6=function(_0x1165c3,_0x18d20d){_0x1165c3=_0x1165c3-0x0;var _0x453e30=_0x8a69[_0x1165c3];return _0x453e30;};'use strict';var _=require(_0x98a6('0x0'));var util=require(_0x98a6('0x1'));var moment=require(_0x98a6('0x2'));var BPromise=require(_0x98a6('0x3'));var rs=require(_0x98a6('0x4'));var fs=require('fs');var Redis=require(_0x98a6('0x5'));var db=require(_0x98a6('0x6'))['db'];var utils=require(_0x98a6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x98a6('0x8'));var jayson=require(_0x98a6('0x9'));var client=jayson[_0x98a6('0xa')][_0x98a6('0xb')]({'port':0x232a});config[_0x98a6('0xc')]=_[_0x98a6('0xd')](config[_0x98a6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x98a6('0xe'))(new Redis(config[_0x98a6('0xc')]));require(_0x98a6('0xf'))[_0x98a6('0x10')](socket);function respondWithRpcPromise(_0x1823f6,_0x2fd0c7,_0x16cf84){return new BPromise(function(_0x14b19c,_0x9c2976){return client[_0x98a6('0x11')](_0x1823f6,_0x16cf84)['then'](function(_0x219793){logger[_0x98a6('0x12')](_0x98a6('0x13'),_0x2fd0c7,_0x98a6('0x14'));logger['debug'](_0x98a6('0x15'),_0x2fd0c7,_0x98a6('0x14'),JSON[_0x98a6('0x16')](_0x219793));if(_0x219793[_0x98a6('0x17')]){if(_0x219793[_0x98a6('0x17')][_0x98a6('0x18')]===0x1f4){logger[_0x98a6('0x17')](_0x98a6('0x13'),_0x2fd0c7,_0x219793[_0x98a6('0x17')][_0x98a6('0x19')]);return _0x9c2976(_0x219793[_0x98a6('0x17')][_0x98a6('0x19')]);}logger['error'](_0x98a6('0x13'),_0x2fd0c7,_0x219793[_0x98a6('0x17')]['message']);return _0x14b19c(_0x219793['error']['message']);}else{logger[_0x98a6('0x12')](_0x98a6('0x13'),_0x2fd0c7,_0x98a6('0x14'));_0x14b19c(_0x219793[_0x98a6('0x1a')][_0x98a6('0x19')]);}})[_0x98a6('0x1b')](function(_0x25f321){logger['error'](_0x98a6('0x13'),_0x2fd0c7,_0x25f321);_0x9c2976(_0x25f321);});});}exports[_0x98a6('0x1c')]=function(_0x2e6ed9){var _0x410f7d=this;return new Promise(function(_0x15d086,_0x2c41c){return db[_0x98a6('0x1d')][_0x98a6('0x1e')]({'raw':_0x2e6ed9[_0x98a6('0x1f')]?_0x2e6ed9[_0x98a6('0x1f')][_0x98a6('0x20')]===undefined?!![]:![]:!![],'where':_0x2e6ed9['options']?_0x2e6ed9[_0x98a6('0x1f')][_0x98a6('0x21')]||null:null,'attributes':_0x2e6ed9['options']?_0x2e6ed9[_0x98a6('0x1f')]['attributes']||null:null,'limit':_0x2e6ed9[_0x98a6('0x1f')]?_0x2e6ed9[_0x98a6('0x1f')][_0x98a6('0x22')]||null:null,'include':_0x2e6ed9[_0x98a6('0x1f')]?_0x2e6ed9[_0x98a6('0x1f')]['include']?_[_0x98a6('0x23')](_0x2e6ed9['options'][_0x98a6('0x24')],function(_0x4ddacc){return{'model':db[_0x4ddacc[_0x98a6('0x25')]],'as':_0x4ddacc['as'],'attributes':_0x4ddacc[_0x98a6('0x26')],'include':_0x4ddacc[_0x98a6('0x24')]?_[_0x98a6('0x23')](_0x4ddacc[_0x98a6('0x24')],function(_0x351fac){return{'model':db[_0x351fac['model']],'as':_0x351fac['as'],'attributes':_0x351fac[_0x98a6('0x26')],'include':_0x351fac[_0x98a6('0x24')]?_[_0x98a6('0x23')](_0x351fac['include'],function(_0x179f22){return{'model':db[_0x179f22[_0x98a6('0x25')]],'as':_0x179f22['as'],'attributes':_0x179f22[_0x98a6('0x26')]};}):[]};}):[]};}):[]:[]})[_0x98a6('0x27')](function(_0x2e70c0){logger[_0x98a6('0x12')](_0x98a6('0x1c'),_0x2e6ed9);logger[_0x98a6('0x28')](_0x98a6('0x1c'),_0x2e6ed9,JSON[_0x98a6('0x16')](_0x2e70c0));_0x15d086(_0x2e70c0);})['catch'](function(_0x663696){logger['error'](_0x98a6('0x1c'),_0x663696['message'],_0x2e6ed9);_0x2c41c(_0x410f7d['error'](0x1f4,_0x663696[_0x98a6('0x19')]));});});};exports[_0x98a6('0x29')]=function(_0x511505){var _0x314f53=this;return new Promise(function(_0x3e6f48,_0x413831){return db[_0x98a6('0x1d')][_0x98a6('0x2a')]({'raw':_0x511505['options']?_0x511505[_0x98a6('0x1f')][_0x98a6('0x20')]===undefined?!![]:![]:!![],'where':_0x511505['options']?_0x511505['options'][_0x98a6('0x21')]||null:null,'attributes':_0x511505[_0x98a6('0x1f')]?_0x511505[_0x98a6('0x1f')]['attributes']||null:null,'include':_0x511505[_0x98a6('0x1f')]?_0x511505[_0x98a6('0x1f')][_0x98a6('0x24')]?_[_0x98a6('0x23')](_0x511505[_0x98a6('0x1f')][_0x98a6('0x24')],function(_0x48e30a){return{'model':db[_0x48e30a[_0x98a6('0x25')]],'as':_0x48e30a['as'],'attributes':_0x48e30a[_0x98a6('0x26')],'include':_0x48e30a['include']?_[_0x98a6('0x23')](_0x48e30a[_0x98a6('0x24')],function(_0x570ca6){return{'model':db[_0x570ca6['model']],'as':_0x570ca6['as'],'attributes':_0x570ca6[_0x98a6('0x26')],'include':_0x570ca6[_0x98a6('0x24')]?_[_0x98a6('0x23')](_0x570ca6[_0x98a6('0x24')],function(_0x23e9dc){return{'model':db[_0x23e9dc[_0x98a6('0x25')]],'as':_0x23e9dc['as'],'attributes':_0x23e9dc[_0x98a6('0x26')]};}):[]};}):[]};}):[]:[]})[_0x98a6('0x27')](function(_0x27d37e){logger[_0x98a6('0x12')]('ShowWhatsappQueue',_0x511505);logger[_0x98a6('0x28')](_0x98a6('0x29'),_0x511505,JSON[_0x98a6('0x16')](_0x27d37e));_0x3e6f48(_0x27d37e);})[_0x98a6('0x1b')](function(_0x527340){logger['error']('ShowWhatsappQueue',_0x527340[_0x98a6('0x19')],_0x511505);_0x413831(_0x314f53[_0x98a6('0x17')](0x1f4,_0x527340[_0x98a6('0x19')]));});});}; \ No newline at end of file +var _0x9344=['result','catch','WhatsappQueue','options','where','attributes','limit','include','model','map','GetWhatsappQueue','ShowWhatsappQueue','find','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x4bcf66,_0x35bbab){var _0x8eb0e7=function(_0x9bbdc8){while(--_0x9bbdc8){_0x4bcf66['push'](_0x4bcf66['shift']());}};_0x8eb0e7(++_0x35bbab);}(_0x9344,0x120));var _0x4934=function(_0x18b165,_0x40a7ea){_0x18b165=_0x18b165-0x0;var _0x1d8e19=_0x9344[_0x18b165];return _0x1d8e19;};'use strict';var _=require(_0x4934('0x0'));var util=require(_0x4934('0x1'));var moment=require(_0x4934('0x2'));var BPromise=require(_0x4934('0x3'));var rs=require(_0x4934('0x4'));var fs=require('fs');var Redis=require(_0x4934('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4934('0x6'))(_0x4934('0x7'));var config=require('../../config/environment');var jayson=require(_0x4934('0x8'));var client=jayson[_0x4934('0x9')][_0x4934('0xa')]({'port':0x232a});config[_0x4934('0xb')]=_[_0x4934('0xc')](config[_0x4934('0xb')],{'host':_0x4934('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4934('0xb')]));require(_0x4934('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a87a0,_0x15bf69,_0x5d7852){return new BPromise(function(_0x194d5d,_0x5422f3){return client[_0x4934('0xf')](_0x4a87a0,_0x5d7852)['then'](function(_0x400b1f){logger[_0x4934('0x10')](_0x4934('0x11'),_0x15bf69,'request\x20sent');logger[_0x4934('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x15bf69,_0x4934('0x13'),JSON[_0x4934('0x14')](_0x400b1f));if(_0x400b1f[_0x4934('0x15')]){if(_0x400b1f[_0x4934('0x15')][_0x4934('0x16')]===0x1f4){logger[_0x4934('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x15bf69,_0x400b1f[_0x4934('0x15')][_0x4934('0x17')]);return _0x5422f3(_0x400b1f[_0x4934('0x15')][_0x4934('0x17')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x15bf69,_0x400b1f[_0x4934('0x15')][_0x4934('0x17')]);return _0x194d5d(_0x400b1f[_0x4934('0x15')]['message']);}else{logger['info'](_0x4934('0x11'),_0x15bf69,'request\x20sent');_0x194d5d(_0x400b1f[_0x4934('0x18')][_0x4934('0x17')]);}})[_0x4934('0x19')](function(_0x1952dd){logger[_0x4934('0x15')](_0x4934('0x11'),_0x15bf69,_0x1952dd);_0x5422f3(_0x1952dd);});});}exports['GetWhatsappQueue']=function(_0x2a8748){var _0x47f3aa=this;return new Promise(function(_0x3ded28,_0x43cb32){return db[_0x4934('0x1a')]['findAll']({'raw':_0x2a8748['options']?_0x2a8748[_0x4934('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2a8748[_0x4934('0x1b')]?_0x2a8748['options'][_0x4934('0x1c')]||null:null,'attributes':_0x2a8748['options']?_0x2a8748[_0x4934('0x1b')][_0x4934('0x1d')]||null:null,'limit':_0x2a8748[_0x4934('0x1b')]?_0x2a8748[_0x4934('0x1b')][_0x4934('0x1e')]||null:null,'include':_0x2a8748[_0x4934('0x1b')]?_0x2a8748[_0x4934('0x1b')]['include']?_['map'](_0x2a8748[_0x4934('0x1b')][_0x4934('0x1f')],function(_0xad9d57){return{'model':db[_0xad9d57[_0x4934('0x20')]],'as':_0xad9d57['as'],'attributes':_0xad9d57['attributes'],'include':_0xad9d57[_0x4934('0x1f')]?_[_0x4934('0x21')](_0xad9d57[_0x4934('0x1f')],function(_0x51b903){return{'model':db[_0x51b903['model']],'as':_0x51b903['as'],'attributes':_0x51b903[_0x4934('0x1d')],'include':_0x51b903['include']?_[_0x4934('0x21')](_0x51b903[_0x4934('0x1f')],function(_0x4faa26){return{'model':db[_0x4faa26[_0x4934('0x20')]],'as':_0x4faa26['as'],'attributes':_0x4faa26['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4220d9){logger['info'](_0x4934('0x22'),_0x2a8748);logger[_0x4934('0x12')](_0x4934('0x22'),_0x2a8748,JSON['stringify'](_0x4220d9));_0x3ded28(_0x4220d9);})['catch'](function(_0x2fda80){logger[_0x4934('0x15')](_0x4934('0x22'),_0x2fda80[_0x4934('0x17')],_0x2a8748);_0x43cb32(_0x47f3aa[_0x4934('0x15')](0x1f4,_0x2fda80[_0x4934('0x17')]));});});};exports[_0x4934('0x23')]=function(_0x1caae7){var _0x177b52=this;return new Promise(function(_0x1b7f0a,_0x145c81){return db[_0x4934('0x1a')][_0x4934('0x24')]({'raw':_0x1caae7[_0x4934('0x1b')]?_0x1caae7[_0x4934('0x1b')][_0x4934('0x25')]===undefined?!![]:![]:!![],'where':_0x1caae7['options']?_0x1caae7[_0x4934('0x1b')]['where']||null:null,'attributes':_0x1caae7[_0x4934('0x1b')]?_0x1caae7[_0x4934('0x1b')][_0x4934('0x1d')]||null:null,'include':_0x1caae7[_0x4934('0x1b')]?_0x1caae7[_0x4934('0x1b')][_0x4934('0x1f')]?_[_0x4934('0x21')](_0x1caae7[_0x4934('0x1b')][_0x4934('0x1f')],function(_0x53f60d){return{'model':db[_0x53f60d[_0x4934('0x20')]],'as':_0x53f60d['as'],'attributes':_0x53f60d[_0x4934('0x1d')],'include':_0x53f60d[_0x4934('0x1f')]?_[_0x4934('0x21')](_0x53f60d['include'],function(_0x7464e6){return{'model':db[_0x7464e6[_0x4934('0x20')]],'as':_0x7464e6['as'],'attributes':_0x7464e6[_0x4934('0x1d')],'include':_0x7464e6['include']?_[_0x4934('0x21')](_0x7464e6[_0x4934('0x1f')],function(_0x5f570b){return{'model':db[_0x5f570b[_0x4934('0x20')]],'as':_0x5f570b['as'],'attributes':_0x5f570b[_0x4934('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4934('0x26')](function(_0x8ccd44){logger[_0x4934('0x10')](_0x4934('0x23'),_0x1caae7);logger[_0x4934('0x12')]('ShowWhatsappQueue',_0x1caae7,JSON[_0x4934('0x14')](_0x8ccd44));_0x1b7f0a(_0x8ccd44);})[_0x4934('0x19')](function(_0x1eed9f){logger[_0x4934('0x15')](_0x4934('0x23'),_0x1eed9f['message'],_0x1caae7);_0x145c81(_0x177b52[_0x4934('0x15')](0x1f4,_0x1eed9f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 80f5766..6adca9c 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 _0x001e=['register','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener'];(function(_0x28d54c,_0x53d9ba){var _0x32ab5c=function(_0x18959b){while(--_0x18959b){_0x28d54c['push'](_0x28d54c['shift']());}};_0x32ab5c(++_0x53d9ba);}(_0x001e,0xaa));var _0xe001=function(_0x47575c,_0x1aff8e){_0x47575c=_0x47575c-0x0;var _0x872611=_0x001e[_0x47575c];return _0x872611;};'use strict';var WhatsappQueueEvents=require(_0xe001('0x0'));var events=[_0xe001('0x1'),_0xe001('0x2'),_0xe001('0x3')];function createListener(_0x46b6b8,_0x5baa97){return function(_0x198010){_0x5baa97[_0xe001('0x4')](_0x46b6b8,_0x198010);};}function removeListener(_0x6961d4,_0x3d225d){return function(){WhatsappQueueEvents[_0xe001('0x5')](_0x6961d4,_0x3d225d);};}exports[_0xe001('0x6')]=function(_0x375bd4){for(var _0x5de942=0x0,_0x3a6eed=events['length'];_0x5de942<_0x3a6eed;_0x5de942++){var _0x581f29=events[_0x5de942];var _0x47d820=createListener(_0xe001('0x7')+_0x581f29,_0x375bd4);WhatsappQueueEvents['on'](_0x581f29,_0x47d820);}}; \ No newline at end of file +var _0x9abd=['length','whatsappQueue:','remove','update','emit','removeListener'];(function(_0x316fb4,_0x583ceb){var _0x3d5d42=function(_0x1ff457){while(--_0x1ff457){_0x316fb4['push'](_0x316fb4['shift']());}};_0x3d5d42(++_0x583ceb);}(_0x9abd,0x1d6));var _0xd9ab=function(_0x2f9363,_0x1571b6){_0x2f9363=_0x2f9363-0x0;var _0x44f2df=_0x9abd[_0x2f9363];return _0x44f2df;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0xd9ab('0x0'),_0xd9ab('0x1')];function createListener(_0x894a56,_0x524d30){return function(_0x196493){_0x524d30[_0xd9ab('0x2')](_0x894a56,_0x196493);};}function removeListener(_0x16c142,_0x5c6f3f){return function(){WhatsappQueueEvents[_0xd9ab('0x3')](_0x16c142,_0x5c6f3f);};}exports['register']=function(_0x2dac20){for(var _0xd70b3a=0x0,_0x54a04d=events[_0xd9ab('0x4')];_0xd70b3a<_0x54a04d;_0xd70b3a++){var _0x34a48a=events[_0xd70b3a];var _0x185028=createListener(_0xd9ab('0x5')+_0x34a48a,_0x2dac20);WhatsappQueueEvents['on'](_0x34a48a,_0x185028);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 7641f4e..304443f 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 _0xe571=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0xe571,0x86));var _0x1e57=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe571[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1e57('0x0'));var util=require(_0x1e57('0x1'));var path=require(_0x1e57('0x2'));var timeout=require(_0x1e57('0x3'));var express=require(_0x1e57('0x4'));var router=express['Router']();var fs_extra=require(_0x1e57('0x5'));var auth=require(_0x1e57('0x6'));var interaction=require(_0x1e57('0x7'));var config=require('../../config/environment');var controller=require(_0x1e57('0x8'));router[_0x1e57('0x9')]('/',auth[_0x1e57('0xa')](),controller[_0x1e57('0xb')]);router[_0x1e57('0x9')](_0x1e57('0xc'),auth['isAuthenticated'](),controller[_0x1e57('0xd')]);router['get'](_0x1e57('0xe'),auth['isAuthenticated'](),controller[_0x1e57('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1e57('0x10')]);router[_0x1e57('0x11')](_0x1e57('0xe'),auth[_0x1e57('0xa')](),controller[_0x1e57('0x12')]);router[_0x1e57('0x13')](_0x1e57('0xe'),auth[_0x1e57('0xa')](),controller[_0x1e57('0x14')]);module[_0x1e57('0x15')]=router; \ No newline at end of file +var _0xf866=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x107c9f,_0x36c1bf){var _0x19d725=function(_0x5bf5e8){while(--_0x5bf5e8){_0x107c9f['push'](_0x107c9f['shift']());}};_0x19d725(++_0x36c1bf);}(_0xf866,0x131));var _0x6f86=function(_0x3fe0b6,_0x26ff47){_0x3fe0b6=_0x3fe0b6-0x0;var _0x1a179e=_0xf866[_0x3fe0b6];return _0x1a179e;};'use strict';var multer=require(_0x6f86('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6f86('0x1'));var express=require(_0x6f86('0x2'));var router=express[_0x6f86('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f86('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f86('0x5'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x6f86('0x6')](),controller[_0x6f86('0x7')]);router[_0x6f86('0x8')](_0x6f86('0x9'),auth['isAuthenticated'](),controller[_0x6f86('0xa')]);router['get'](_0x6f86('0xb'),auth[_0x6f86('0x6')](),controller[_0x6f86('0xc')]);router[_0x6f86('0xd')]('/',auth['isAuthenticated'](),controller[_0x6f86('0xe')]);router[_0x6f86('0xf')](_0x6f86('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6f86('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6f86('0x11')]);module[_0x6f86('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 8b18671..77f09e5 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x54a887,_0x59afac){var _0x3f7ff3=function(_0x566db5){while(--_0x566db5){_0x54a887['push'](_0x54a887['shift']());}};_0x3f7ff3(++_0x59afac);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x2ef197,_0x324e75){var _0x44328f=function(_0x1db196){while(--_0x1db196){_0x2ef197['push'](_0x2ef197['shift']());}};_0x44328f(++_0x324e75);}(_0x7a54,0x106));var _0x47a5=function(_0x3094fe,_0x375de4){_0x3094fe=_0x3094fe-0x0;var _0x42d7c9=_0x7a54[_0x3094fe];return _0x42d7c9;};'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 331c887..b313f8d 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 _0xb688=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','end','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','show','includeAll','include','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x24d873,_0x392f67){var _0x68f10f=function(_0x35ca6b){while(--_0x35ca6b){_0x24d873['push'](_0x24d873['shift']());}};_0x68f10f(++_0x392f67);}(_0xb688,0xcf));var _0x8b68=function(_0x4e14c9,_0xcd3a4d){_0x4e14c9=_0x4e14c9-0x0;var _0x5db011=_0xb688[_0x4e14c9];return _0x5db011;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x1965cf,_0x2f3af4){_0x2f3af4=_0x2f3af4||0xcc;return function(_0xaa8725){if(_0xaa8725){return _0x1965cf[_0x8b68('0x1b')](_0x2f3af4);}return _0x1965cf[_0x8b68('0x1c')](_0x2f3af4)['end']();};}function respondWithResult(_0xb2df35,_0x509033){_0x509033=_0x509033||0xc8;return function(_0x5e3c66){if(_0x5e3c66){return _0xb2df35[_0x8b68('0x1c')](_0x509033)[_0x8b68('0x1d')](_0x5e3c66);}};}function respondWithFilteredResult(_0x27d717,_0x5d3468){return function(_0x5c8d0e){if(_0x5c8d0e){var _0x23bd52=typeof _0x5d3468['offset']===_0x8b68('0x1e')&&typeof _0x5d3468[_0x8b68('0x1f')]===_0x8b68('0x1e');var _0x10c9c6=_0x5c8d0e['count'];var _0xd17693=_0x23bd52?0x0:_0x5d3468[_0x8b68('0x20')];var _0x4a68c7=_0x23bd52?_0x5c8d0e[_0x8b68('0x21')]:_0x5d3468[_0x8b68('0x20')]+_0x5d3468[_0x8b68('0x1f')];var _0x17f321;if(_0x4a68c7>=_0x10c9c6){_0x4a68c7=_0x10c9c6;_0x17f321=0xc8;}else{_0x17f321=0xce;}_0x27d717[_0x8b68('0x1c')](_0x17f321);return _0x27d717['set'](_0x8b68('0x22'),_0xd17693+'-'+_0x4a68c7+'/'+_0x10c9c6)[_0x8b68('0x1d')](_0x5c8d0e);}return null;};}function patchUpdates(_0x59e9b1){return function(_0x1a9788){try{jsonpatch[_0x8b68('0x23')](_0x1a9788,_0x59e9b1,!![]);}catch(_0x1dbc1d){return BPromise['reject'](_0x1dbc1d);}return _0x1a9788['save']();};}function saveUpdates(_0x23edc1,_0x59cb26){return function(_0x332202){if(_0x332202){return _0x332202[_0x8b68('0x24')](_0x23edc1)[_0x8b68('0x25')](function(_0x21ecca){return _0x21ecca;});}return null;};}function removeEntity(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(_0x59bb8a){return _0x59bb8a[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){_0x32ddc5['status'](0xcc)[_0x8b68('0x27')]();});}};}function handleEntityNotFound(_0x3cf8d2,_0x240b0b){return function(_0x5590ec){if(!_0x5590ec){_0x3cf8d2['sendStatus'](0x194);}return _0x5590ec;};}function handleError(_0x4fe8f6,_0x92d186){_0x92d186=_0x92d186||0x1f4;return function(_0x448e43){logger[_0x8b68('0x28')](_0x448e43['stack']);if(_0x448e43[_0x8b68('0x29')]){delete _0x448e43['name'];}_0x4fe8f6['status'](_0x92d186)[_0x8b68('0x2a')](_0x448e43);};}exports['index']=function(_0x26cad7,_0x3ac356){var _0x48e2c8={},_0x494ce4={},_0x357635={'count':0x0,'rows':[]};var _0x1cd230=_[_0x8b68('0x2b')](db[_0x8b68('0x2c')][_0x8b68('0x2d')],function(_0x2ad2df){return{'name':_0x2ad2df[_0x8b68('0x2e')],'type':_0x2ad2df['type'][_0x8b68('0x2f')]};});_0x494ce4['model']=_[_0x8b68('0x2b')](_0x1cd230,_0x8b68('0x29'));_0x494ce4['query']=_[_0x8b68('0x30')](_0x26cad7[_0x8b68('0x31')]);_0x494ce4[_0x8b68('0x32')]=_['intersection'](_0x494ce4['model'],_0x494ce4[_0x8b68('0x31')]);_0x48e2c8[_0x8b68('0x33')]=_[_0x8b68('0x34')](_0x494ce4[_0x8b68('0x35')],qs[_0x8b68('0x36')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x36')]));_0x48e2c8[_0x8b68('0x33')]=_0x48e2c8[_0x8b68('0x33')][_0x8b68('0x37')]?_0x48e2c8[_0x8b68('0x33')]:_0x494ce4[_0x8b68('0x35')];if(!_0x26cad7[_0x8b68('0x31')][_0x8b68('0x38')](_0x8b68('0x39'))){_0x48e2c8[_0x8b68('0x1f')]=qs[_0x8b68('0x1f')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x1f')]);_0x48e2c8[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x26cad7[_0x8b68('0x31')]['offset']);}_0x48e2c8['order']=qs[_0x8b68('0x3a')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x3a')]);_0x48e2c8[_0x8b68('0x3b')]=qs[_0x8b68('0x32')](_[_0x8b68('0x3c')](_0x26cad7[_0x8b68('0x31')],_0x494ce4[_0x8b68('0x32')]),_0x1cd230);if(_0x26cad7['query'][_0x8b68('0x3d')]){_0x48e2c8[_0x8b68('0x3b')]=_[_0x8b68('0x3e')](_0x48e2c8[_0x8b68('0x3b')],{'$or':_[_0x8b68('0x2b')](_0x1cd230,function(_0x3e0032){if(_0x3e0032[_0x8b68('0x3f')]!==_0x8b68('0x40')){var _0x517571={};_0x517571[_0x3e0032[_0x8b68('0x29')]]={'$like':'%'+_0x26cad7[_0x8b68('0x31')][_0x8b68('0x3d')]+'%'};return _0x517571;}})});}_0x48e2c8=_[_0x8b68('0x3e')]({},_0x48e2c8,_0x26cad7[_0x8b68('0x41')]);var _0x3b3394={'where':_0x48e2c8[_0x8b68('0x3b')]};return db['WhatsappQueueReport'][_0x8b68('0x21')](_0x3b3394)[_0x8b68('0x25')](function(_0x48f159){_0x357635[_0x8b68('0x21')]=_0x48f159;if(_0x26cad7[_0x8b68('0x31')]['includeAll']){_0x48e2c8['include']=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x48e2c8);})[_0x8b68('0x25')](function(_0x23d24a){_0x357635['rows']=_0x23d24a;return _0x357635;})[_0x8b68('0x25')](respondWithFilteredResult(_0x3ac356,_0x48e2c8))['catch'](handleError(_0x3ac356,null));};exports[_0x8b68('0x42')]=function(_0x3841d2,_0x5a3193){var _0x2f90d9={'raw':!![],'where':{'id':_0x3841d2['params']['id']}},_0x5ae345={};_0x5ae345['model']=_[_0x8b68('0x30')](db[_0x8b68('0x2c')][_0x8b68('0x2d')]);_0x5ae345[_0x8b68('0x31')]=_['keys'](_0x3841d2[_0x8b68('0x31')]);_0x5ae345['filters']=_[_0x8b68('0x34')](_0x5ae345[_0x8b68('0x35')],_0x5ae345['query']);_0x2f90d9[_0x8b68('0x33')]=_[_0x8b68('0x34')](_0x5ae345[_0x8b68('0x35')],qs[_0x8b68('0x36')](_0x3841d2['query'][_0x8b68('0x36')]));_0x2f90d9[_0x8b68('0x33')]=_0x2f90d9[_0x8b68('0x33')][_0x8b68('0x37')]?_0x2f90d9[_0x8b68('0x33')]:_0x5ae345[_0x8b68('0x35')];if(_0x3841d2[_0x8b68('0x31')][_0x8b68('0x43')]){_0x2f90d9[_0x8b68('0x44')]=[{'all':!![]}];}_0x2f90d9=_[_0x8b68('0x3e')]({},_0x2f90d9,_0x3841d2[_0x8b68('0x41')]);return db[_0x8b68('0x2c')][_0x8b68('0x45')](_0x2f90d9)[_0x8b68('0x25')](handleEntityNotFound(_0x5a3193,null))[_0x8b68('0x25')](respondWithResult(_0x5a3193,null))[_0x8b68('0x46')](handleError(_0x5a3193,null));};exports['create']=function(_0x3b7b06,_0x20681a){return db['WhatsappQueueReport'][_0x8b68('0x47')](_0x3b7b06['body'],{})['then'](respondWithResult(_0x20681a,0xc9))['catch'](handleError(_0x20681a,null));};exports[_0x8b68('0x24')]=function(_0x35874b,_0x34047c){if(_0x35874b[_0x8b68('0x48')]['id']){delete _0x35874b['body']['id'];}return db['WhatsappQueueReport'][_0x8b68('0x45')]({'where':{'id':_0x35874b[_0x8b68('0x49')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x34047c,null))['then'](saveUpdates(_0x35874b[_0x8b68('0x48')],null))[_0x8b68('0x25')](respondWithResult(_0x34047c,null))['catch'](handleError(_0x34047c,null));};exports[_0x8b68('0x26')]=function(_0xacac82,_0x595942){return db[_0x8b68('0x2c')][_0x8b68('0x45')]({'where':{'id':_0xacac82['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x595942,null))[_0x8b68('0x25')](removeEntity(_0x595942,null))['catch'](handleError(_0x595942,null));};exports['describe']=function(_0x5e3e99,_0x28f82d){return db[_0x8b68('0x2c')][_0x8b68('0x4a')]()[_0x8b68('0x25')](respondWithResult(_0x28f82d,null))['catch'](handleError(_0x28f82d,null));}; \ No newline at end of file +var _0xab40=['describe','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','then','stack','name','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','count','includeAll','WhatsappQueueReport','findAll','rows','show','params','include','catch','create','body','update','find'];(function(_0x604342,_0x48cbb4){var _0x1ad801=function(_0xf86295){while(--_0xf86295){_0x604342['push'](_0x604342['shift']());}};_0x1ad801(++_0x48cbb4);}(_0xab40,0xcd));var _0x0ab4=function(_0x880cad,_0x327205){_0x880cad=_0x880cad-0x0;var _0x4eaa32=_0xab40[_0x880cad];return _0x4eaa32;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249dc3,_0x45e6fd){_0x45e6fd=_0x45e6fd||0xcc;return function(_0x1e7555){if(_0x1e7555){return _0x249dc3[_0x0ab4('0x15')](_0x45e6fd);}return _0x249dc3[_0x0ab4('0x16')](_0x45e6fd)[_0x0ab4('0x17')]();};}function respondWithResult(_0x112162,_0x2cc644){_0x2cc644=_0x2cc644||0xc8;return function(_0x3cb1df){if(_0x3cb1df){return _0x112162[_0x0ab4('0x16')](_0x2cc644)[_0x0ab4('0x18')](_0x3cb1df);}};}function respondWithFilteredResult(_0x36d246,_0x293e20){return function(_0x45fad1){if(_0x45fad1){var _0x2a83a8=typeof _0x293e20[_0x0ab4('0x19')]===_0x0ab4('0x1a')&&typeof _0x293e20[_0x0ab4('0x1b')]==='undefined';var _0x5000d4=_0x45fad1['count'];var _0x17422f=_0x2a83a8?0x0:_0x293e20[_0x0ab4('0x19')];var _0x2f50d2=_0x2a83a8?_0x45fad1['count']:_0x293e20[_0x0ab4('0x19')]+_0x293e20[_0x0ab4('0x1b')];var _0x212ebd;if(_0x2f50d2>=_0x5000d4){_0x2f50d2=_0x5000d4;_0x212ebd=0xc8;}else{_0x212ebd=0xce;}_0x36d246[_0x0ab4('0x16')](_0x212ebd);return _0x36d246['set']('Content-Range',_0x17422f+'-'+_0x2f50d2+'/'+_0x5000d4)[_0x0ab4('0x18')](_0x45fad1);}return null;};}function patchUpdates(_0x5b1ed5){return function(_0x2b0e29){try{jsonpatch[_0x0ab4('0x1c')](_0x2b0e29,_0x5b1ed5,!![]);}catch(_0x5bb1d0){return BPromise[_0x0ab4('0x1d')](_0x5bb1d0);}return _0x2b0e29[_0x0ab4('0x1e')]();};}function saveUpdates(_0x2c55b3,_0x1d5c14){return function(_0x12d06d){if(_0x12d06d){return _0x12d06d['update'](_0x2c55b3)['then'](function(_0x24b929){return _0x24b929;});}return null;};}function removeEntity(_0x14087f,_0x392afe){return function(_0x13c882){if(_0x13c882){return _0x13c882['destroy']()[_0x0ab4('0x1f')](function(){_0x14087f[_0x0ab4('0x16')](0xcc)[_0x0ab4('0x17')]();});}};}function handleEntityNotFound(_0x4ea9aa,_0x4c5caf){return function(_0x176ff1){if(!_0x176ff1){_0x4ea9aa[_0x0ab4('0x15')](0x194);}return _0x176ff1;};}function handleError(_0x1a17ce,_0x4ae515){_0x4ae515=_0x4ae515||0x1f4;return function(_0x519b23){logger['error'](_0x519b23[_0x0ab4('0x20')]);if(_0x519b23['name']){delete _0x519b23[_0x0ab4('0x21')];}_0x1a17ce[_0x0ab4('0x16')](_0x4ae515)['send'](_0x519b23);};}exports['index']=function(_0x4d0cc1,_0x3d38a4){var _0x183bac={},_0x1cfdad={},_0x3f61cb={'count':0x0,'rows':[]};var _0x25385e=_['map'](db['WhatsappQueueReport']['rawAttributes'],function(_0x2e7a97){return{'name':_0x2e7a97[_0x0ab4('0x22')],'type':_0x2e7a97[_0x0ab4('0x23')][_0x0ab4('0x24')]};});_0x1cfdad[_0x0ab4('0x25')]=_['map'](_0x25385e,'name');_0x1cfdad[_0x0ab4('0x26')]=_[_0x0ab4('0x27')](_0x4d0cc1[_0x0ab4('0x26')]);_0x1cfdad['filters']=_['intersection'](_0x1cfdad[_0x0ab4('0x25')],_0x1cfdad['query']);_0x183bac[_0x0ab4('0x28')]=_[_0x0ab4('0x29')](_0x1cfdad[_0x0ab4('0x25')],qs[_0x0ab4('0x2a')](_0x4d0cc1[_0x0ab4('0x26')][_0x0ab4('0x2a')]));_0x183bac['attributes']=_0x183bac[_0x0ab4('0x28')][_0x0ab4('0x2b')]?_0x183bac[_0x0ab4('0x28')]:_0x1cfdad[_0x0ab4('0x25')];if(!_0x4d0cc1['query']['hasOwnProperty'](_0x0ab4('0x2c'))){_0x183bac[_0x0ab4('0x1b')]=qs[_0x0ab4('0x1b')](_0x4d0cc1['query']['limit']);_0x183bac['offset']=qs[_0x0ab4('0x19')](_0x4d0cc1[_0x0ab4('0x26')][_0x0ab4('0x19')]);}_0x183bac['order']=qs['sort'](_0x4d0cc1['query'][_0x0ab4('0x2d')]);_0x183bac[_0x0ab4('0x2e')]=qs[_0x0ab4('0x2f')](_[_0x0ab4('0x30')](_0x4d0cc1[_0x0ab4('0x26')],_0x1cfdad[_0x0ab4('0x2f')]),_0x25385e);if(_0x4d0cc1[_0x0ab4('0x26')][_0x0ab4('0x31')]){_0x183bac[_0x0ab4('0x2e')]=_[_0x0ab4('0x32')](_0x183bac['where'],{'$or':_[_0x0ab4('0x33')](_0x25385e,function(_0x31e234){if(_0x31e234[_0x0ab4('0x23')]!==_0x0ab4('0x34')){var _0x2e1da9={};_0x2e1da9[_0x31e234[_0x0ab4('0x21')]]={'$like':'%'+_0x4d0cc1[_0x0ab4('0x26')][_0x0ab4('0x31')]+'%'};return _0x2e1da9;}})});}_0x183bac=_[_0x0ab4('0x32')]({},_0x183bac,_0x4d0cc1[_0x0ab4('0x35')]);var _0x449437={'where':_0x183bac[_0x0ab4('0x2e')]};return db['WhatsappQueueReport'][_0x0ab4('0x36')](_0x449437)[_0x0ab4('0x1f')](function(_0x1cee1c){_0x3f61cb[_0x0ab4('0x36')]=_0x1cee1c;if(_0x4d0cc1['query'][_0x0ab4('0x37')]){_0x183bac['include']=[{'all':!![]}];}return db[_0x0ab4('0x38')][_0x0ab4('0x39')](_0x183bac);})[_0x0ab4('0x1f')](function(_0x245021){_0x3f61cb[_0x0ab4('0x3a')]=_0x245021;return _0x3f61cb;})[_0x0ab4('0x1f')](respondWithFilteredResult(_0x3d38a4,_0x183bac))['catch'](handleError(_0x3d38a4,null));};exports[_0x0ab4('0x3b')]=function(_0x3cc364,_0xe3df73){var _0x48029f={'raw':!![],'where':{'id':_0x3cc364[_0x0ab4('0x3c')]['id']}},_0x395e0b={};_0x395e0b[_0x0ab4('0x25')]=_[_0x0ab4('0x27')](db[_0x0ab4('0x38')]['rawAttributes']);_0x395e0b['query']=_['keys'](_0x3cc364[_0x0ab4('0x26')]);_0x395e0b[_0x0ab4('0x2f')]=_['intersection'](_0x395e0b[_0x0ab4('0x25')],_0x395e0b['query']);_0x48029f[_0x0ab4('0x28')]=_['intersection'](_0x395e0b[_0x0ab4('0x25')],qs[_0x0ab4('0x2a')](_0x3cc364[_0x0ab4('0x26')][_0x0ab4('0x2a')]));_0x48029f[_0x0ab4('0x28')]=_0x48029f[_0x0ab4('0x28')]['length']?_0x48029f[_0x0ab4('0x28')]:_0x395e0b[_0x0ab4('0x25')];if(_0x3cc364[_0x0ab4('0x26')][_0x0ab4('0x37')]){_0x48029f[_0x0ab4('0x3d')]=[{'all':!![]}];}_0x48029f=_[_0x0ab4('0x32')]({},_0x48029f,_0x3cc364['options']);return db[_0x0ab4('0x38')]['find'](_0x48029f)[_0x0ab4('0x1f')](handleEntityNotFound(_0xe3df73,null))[_0x0ab4('0x1f')](respondWithResult(_0xe3df73,null))[_0x0ab4('0x3e')](handleError(_0xe3df73,null));};exports['create']=function(_0x5b09e,_0x1fcc3b){return db[_0x0ab4('0x38')][_0x0ab4('0x3f')](_0x5b09e[_0x0ab4('0x40')],{})[_0x0ab4('0x1f')](respondWithResult(_0x1fcc3b,0xc9))['catch'](handleError(_0x1fcc3b,null));};exports[_0x0ab4('0x41')]=function(_0xdcc118,_0x302894){if(_0xdcc118[_0x0ab4('0x40')]['id']){delete _0xdcc118[_0x0ab4('0x40')]['id'];}return db[_0x0ab4('0x38')][_0x0ab4('0x42')]({'where':{'id':_0xdcc118[_0x0ab4('0x3c')]['id']}})[_0x0ab4('0x1f')](handleEntityNotFound(_0x302894,null))[_0x0ab4('0x1f')](saveUpdates(_0xdcc118[_0x0ab4('0x40')],null))[_0x0ab4('0x1f')](respondWithResult(_0x302894,null))[_0x0ab4('0x3e')](handleError(_0x302894,null));};exports['destroy']=function(_0x2c3a0a,_0x354bc){return db['WhatsappQueueReport'][_0x0ab4('0x42')]({'where':{'id':_0x2c3a0a['params']['id']}})['then'](handleEntityNotFound(_0x354bc,null))[_0x0ab4('0x1f')](removeEntity(_0x354bc,null))[_0x0ab4('0x3e')](handleError(_0x354bc,null));};exports[_0x0ab4('0x43')]=function(_0x4966bc,_0x12a2df){return db[_0x0ab4('0x38')][_0x0ab4('0x43')]()[_0x0ab4('0x1f')](respondWithResult(_0x12a2df,null))[_0x0ab4('0x3e')](handleError(_0x12a2df,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 0db3d59..b1df6aa 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 _0xf20b=['../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x10e223,_0x44854b){var _0x2a1510=function(_0x249a1b){while(--_0x249a1b){_0x10e223['push'](_0x10e223['shift']());}};_0x2a1510(++_0x44854b);}(_0xf20b,0xd6));var _0xbf20=function(_0x30f7df,_0x365039){_0x30f7df=_0x30f7df-0x0;var _0xb28731=_0xf20b[_0x30f7df];return _0xb28731;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf20('0x0'))(_0xbf20('0x1'));var moment=require(_0xbf20('0x2'));var BPromise=require(_0xbf20('0x3'));var rp=require(_0xbf20('0x4'));var fs=require('fs');var path=require(_0xbf20('0x5'));var rimraf=require(_0xbf20('0x6'));var config=require(_0xbf20('0x7'));var attributes=require(_0xbf20('0x8'));module[_0xbf20('0x9')]=function(_0x34ed05,_0x48429a){return _0x34ed05[_0xbf20('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0xbf20('0xb'),'paranoid':![],'indexes':[{'name':_0xbf20('0xc'),'fields':[_0xbf20('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2bad=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5b02d6,_0x527c00){var _0x43dab4=function(_0x34508f){while(--_0x34508f){_0x5b02d6['push'](_0x5b02d6['shift']());}};_0x43dab4(++_0x527c00);}(_0x2bad,0xf5));var _0xd2ba=function(_0x7eb3ad,_0x571c4e){_0x7eb3ad=_0x7eb3ad-0x0;var _0x19816b=_0x2bad[_0x7eb3ad];return _0x19816b;};'use strict';var _=require(_0xd2ba('0x0'));var util=require('util');var logger=require(_0xd2ba('0x1'))(_0xd2ba('0x2'));var moment=require(_0xd2ba('0x3'));var BPromise=require(_0xd2ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2ba('0x5'));var rimraf=require(_0xd2ba('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0xd2ba('0x7')]=function(_0x8b6d6d,_0x396239){return _0x8b6d6d[_0xd2ba('0x8')](_0xd2ba('0x9'),attributes,{'tableName':_0xd2ba('0xa'),'paranoid':![],'indexes':[{'name':_0xd2ba('0xb'),'fields':[_0xd2ba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 76e8d4d..01d4e16 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 _0x9d48=['limit','UpdateWhatsappQueueReport','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','update','attributes'];(function(_0x4591c9,_0x32cc25){var _0x37284c=function(_0x56c0){while(--_0x56c0){_0x4591c9['push'](_0x4591c9['shift']());}};_0x37284c(++_0x32cc25);}(_0x9d48,0x182));var _0x89d4=function(_0x436849,_0x430b00){_0x436849=_0x436849-0x0;var _0x5c5f73=_0x9d48[_0x436849];return _0x5c5f73;};'use strict';var _=require('lodash');var util=require(_0x89d4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x89d4('0x1'));var fs=require('fs');var Redis=require(_0x89d4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x89d4('0x3'));var logger=require(_0x89d4('0x4'))(_0x89d4('0x5'));var config=require(_0x89d4('0x6'));var jayson=require(_0x89d4('0x7'));var client=jayson[_0x89d4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xae7f15,_0x43d754,_0x4f8bac){return new BPromise(function(_0x25cbba,_0x46066e){return client[_0x89d4('0x9')](_0xae7f15,_0x4f8bac)[_0x89d4('0xa')](function(_0x1991f7){logger[_0x89d4('0xb')](_0x89d4('0xc'),_0x43d754,_0x89d4('0xd'));logger[_0x89d4('0xe')](_0x89d4('0xf'),_0x43d754,_0x89d4('0xd'),JSON[_0x89d4('0x10')](_0x1991f7));if(_0x1991f7['error']){if(_0x1991f7[_0x89d4('0x11')][_0x89d4('0x12')]===0x1f4){logger[_0x89d4('0x11')](_0x89d4('0xc'),_0x43d754,_0x1991f7['error']['message']);return _0x46066e(_0x1991f7['error']['message']);}logger[_0x89d4('0x11')](_0x89d4('0xc'),_0x43d754,_0x1991f7[_0x89d4('0x11')][_0x89d4('0x13')]);return _0x25cbba(_0x1991f7[_0x89d4('0x11')][_0x89d4('0x13')]);}else{logger[_0x89d4('0xb')](_0x89d4('0xc'),_0x43d754,_0x89d4('0xd'));_0x25cbba(_0x1991f7[_0x89d4('0x14')][_0x89d4('0x13')]);}})[_0x89d4('0x15')](function(_0x3bbd6f){logger['error'](_0x89d4('0xc'),_0x43d754,_0x3bbd6f);_0x46066e(_0x3bbd6f);});});}exports['CreateWhatsappQueueReport']=function(_0x4e1252){var _0x453edf=this;return new Promise(function(_0x45fee5,_0xc63f78){return db[_0x89d4('0x16')][_0x89d4('0x17')](_0x4e1252[_0x89d4('0x18')],{'raw':_0x4e1252[_0x89d4('0x19')]?_0x4e1252['options'][_0x89d4('0x1a')]===undefined?!![]:![]:!![]})[_0x89d4('0xa')](function(_0x50db57){logger[_0x89d4('0xb')](_0x89d4('0x1b'),_0x4e1252);logger[_0x89d4('0xe')](_0x89d4('0x1b'),_0x4e1252,JSON[_0x89d4('0x10')](_0x50db57));_0x45fee5(_0x50db57);})['catch'](function(_0x6bc671){logger[_0x89d4('0x11')]('CreateWhatsappQueueReport',_0x6bc671[_0x89d4('0x13')],_0x4e1252);_0xc63f78(_0x453edf[_0x89d4('0x11')](0x1f4,_0x6bc671[_0x89d4('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x533e8d){var _0x2950a2=this;return new Promise(function(_0x4cedae,_0x40ba74){return db[_0x89d4('0x16')][_0x89d4('0x1c')](_0x533e8d[_0x89d4('0x18')],{'raw':_0x533e8d[_0x89d4('0x19')]?_0x533e8d[_0x89d4('0x19')][_0x89d4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533e8d['options']?_0x533e8d[_0x89d4('0x19')]['where']||null:null,'attributes':_0x533e8d['options']?_0x533e8d[_0x89d4('0x19')][_0x89d4('0x1d')]||null:null,'limit':_0x533e8d['options']?_0x533e8d[_0x89d4('0x19')][_0x89d4('0x1e')]||null:null})['then'](function(_0x392972){logger[_0x89d4('0xb')](_0x89d4('0x1f'),_0x533e8d);logger['debug'](_0x89d4('0x1f'),_0x533e8d,JSON[_0x89d4('0x10')](_0x392972));_0x4cedae(_0x392972);})[_0x89d4('0x15')](function(_0x3eca27){logger[_0x89d4('0x11')]('UpdateWhatsappQueueReport',_0x3eca27[_0x89d4('0x13')],_0x533e8d);_0x40ba74(_0x2950a2[_0x89d4('0x11')](0x1f4,_0x3eca27[_0x89d4('0x13')]));});});}; \ No newline at end of file +var _0x10b8=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','limit','lodash','util','moment','bluebird'];(function(_0x28b357,_0x5d2705){var _0x82da35=function(_0x542392){while(--_0x542392){_0x28b357['push'](_0x28b357['shift']());}};_0x82da35(++_0x5d2705);}(_0x10b8,0x17c));var _0x810b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x10b8[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x810b('0x0'));var util=require(_0x810b('0x1'));var moment=require(_0x810b('0x2'));var BPromise=require(_0x810b('0x3'));var rs=require(_0x810b('0x4'));var fs=require('fs');var Redis=require(_0x810b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x810b('0x6'));var logger=require(_0x810b('0x7'))(_0x810b('0x8'));var config=require('../../config/environment');var jayson=require(_0x810b('0x9'));var client=jayson[_0x810b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a542a,_0x4976a8,_0x3615dd){return new BPromise(function(_0x59c5ef,_0x13d941){return client[_0x810b('0xb')](_0x1a542a,_0x3615dd)[_0x810b('0xc')](function(_0x4e1f1b){logger['info'](_0x810b('0xd'),_0x4976a8,_0x810b('0xe'));logger[_0x810b('0xf')](_0x810b('0x10'),_0x4976a8,_0x810b('0xe'),JSON[_0x810b('0x11')](_0x4e1f1b));if(_0x4e1f1b[_0x810b('0x12')]){if(_0x4e1f1b[_0x810b('0x12')][_0x810b('0x13')]===0x1f4){logger[_0x810b('0x12')](_0x810b('0xd'),_0x4976a8,_0x4e1f1b[_0x810b('0x12')][_0x810b('0x14')]);return _0x13d941(_0x4e1f1b[_0x810b('0x12')][_0x810b('0x14')]);}logger[_0x810b('0x12')](_0x810b('0xd'),_0x4976a8,_0x4e1f1b[_0x810b('0x12')]['message']);return _0x59c5ef(_0x4e1f1b[_0x810b('0x12')][_0x810b('0x14')]);}else{logger[_0x810b('0x15')](_0x810b('0xd'),_0x4976a8,_0x810b('0xe'));_0x59c5ef(_0x4e1f1b['result'][_0x810b('0x14')]);}})[_0x810b('0x16')](function(_0x378d69){logger[_0x810b('0x12')](_0x810b('0xd'),_0x4976a8,_0x378d69);_0x13d941(_0x378d69);});});}exports[_0x810b('0x17')]=function(_0x14e9d9){var _0x27c7f9=this;return new Promise(function(_0x628f2,_0x588758){return db[_0x810b('0x18')][_0x810b('0x19')](_0x14e9d9[_0x810b('0x1a')],{'raw':_0x14e9d9[_0x810b('0x1b')]?_0x14e9d9['options'][_0x810b('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x521287){logger[_0x810b('0x15')](_0x810b('0x17'),_0x14e9d9);logger[_0x810b('0xf')](_0x810b('0x17'),_0x14e9d9,JSON[_0x810b('0x11')](_0x521287));_0x628f2(_0x521287);})[_0x810b('0x16')](function(_0x594716){logger[_0x810b('0x12')](_0x810b('0x17'),_0x594716[_0x810b('0x14')],_0x14e9d9);_0x588758(_0x27c7f9['error'](0x1f4,_0x594716['message']));});});};exports[_0x810b('0x1d')]=function(_0x2fdb81){var _0x1fce8e=this;return new Promise(function(_0xdaf0e8,_0x5d853e){return db[_0x810b('0x18')]['update'](_0x2fdb81[_0x810b('0x1a')],{'raw':_0x2fdb81[_0x810b('0x1b')]?_0x2fdb81[_0x810b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fdb81['options']?_0x2fdb81[_0x810b('0x1b')][_0x810b('0x1e')]||null:null,'attributes':_0x2fdb81[_0x810b('0x1b')]?_0x2fdb81['options']['attributes']||null:null,'limit':_0x2fdb81['options']?_0x2fdb81[_0x810b('0x1b')][_0x810b('0x1f')]||null:null})['then'](function(_0x2cdb29){logger[_0x810b('0x15')]('UpdateWhatsappQueueReport',_0x2fdb81);logger[_0x810b('0xf')](_0x810b('0x1d'),_0x2fdb81,JSON[_0x810b('0x11')](_0x2cdb29));_0xdaf0e8(_0x2cdb29);})[_0x810b('0x16')](function(_0x40966f){logger[_0x810b('0x12')](_0x810b('0x1d'),_0x40966f[_0x810b('0x14')],_0x2fdb81);_0x5d853e(_0x1fce8e[_0x810b('0x12')](0x1f4,_0x40966f[_0x810b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index d1a5783..19de12f 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 _0xc621=['fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x528327,_0x234696){var _0x3732d8=function(_0x2ac652){while(--_0x2ac652){_0x528327['push'](_0x528327['shift']());}};_0x3732d8(++_0x234696);}(_0xc621,0x1f4));var _0x1c62=function(_0x5908c6,_0xb65a85){_0x5908c6=_0x5908c6-0x0;var _0x3ad8aa=_0xc621[_0x5908c6];return _0x3ad8aa;};'use strict';var multer=require('multer');var util=require(_0x1c62('0x0'));var path=require(_0x1c62('0x1'));var timeout=require(_0x1c62('0x2'));var express=require('express');var router=express[_0x1c62('0x3')]();var fs_extra=require(_0x1c62('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1c62('0x5'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0x1c62('0x6')](),controller[_0x1c62('0x7')]);router[_0x1c62('0x8')](_0x1c62('0x9'),auth[_0x1c62('0x6')](),controller[_0x1c62('0xa')]);router[_0x1c62('0x8')](_0x1c62('0xb'),auth['isAuthenticated'](),controller[_0x1c62('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1c62('0xd')]);router[_0x1c62('0xe')](_0x1c62('0xb'),auth[_0x1c62('0x6')](),controller['update']);router[_0x1c62('0xf')]('/:id',auth[_0x1c62('0x6')](),controller[_0x1c62('0x10')]);module[_0x1c62('0x11')]=router; \ No newline at end of file +var _0x6cfe=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x44ea8a,_0x1b559c){var _0x5ade26=function(_0x4ba5ff){while(--_0x4ba5ff){_0x44ea8a['push'](_0x44ea8a['shift']());}};_0x5ade26(++_0x1b559c);}(_0x6cfe,0x6d));var _0xe6cf=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0x6cfe[_0x1c510a];return _0x23cedd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe6cf('0x0'));var timeout=require(_0xe6cf('0x1'));var express=require(_0xe6cf('0x2'));var router=express['Router']();var fs_extra=require(_0xe6cf('0x3'));var auth=require(_0xe6cf('0x4'));var interaction=require(_0xe6cf('0x5'));var config=require(_0xe6cf('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0xe6cf('0x7')]('/',auth[_0xe6cf('0x8')](),controller[_0xe6cf('0x9')]);router['get'](_0xe6cf('0xa'),auth[_0xe6cf('0x8')](),controller[_0xe6cf('0xb')]);router[_0xe6cf('0x7')](_0xe6cf('0xc'),auth[_0xe6cf('0x8')](),controller['show']);router[_0xe6cf('0xd')]('/',auth[_0xe6cf('0x8')](),controller['create']);router[_0xe6cf('0xe')](_0xe6cf('0xc'),auth['isAuthenticated'](),controller[_0xe6cf('0xf')]);router[_0xe6cf('0x10')](_0xe6cf('0xc'),auth['isAuthenticated'](),controller[_0xe6cf('0x11')]);module[_0xe6cf('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index cca864e..5012bc3 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 _0x7292=['ENUM','account','agent','queue','sequelize','exports','STRING'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0x7292,0x107));var _0x2729=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x7292[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0x2729('0x0'));module[_0x2729('0x1')]={'uniqueid':{'type':Sequelize[_0x2729('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2729('0x3')](_0x2729('0x4'),_0x2729('0x5'),_0x2729('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8f4c=['agent','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5a0f53,_0x3cf8a4){_0x5a0f53=_0x5a0f53-0x0;var _0x262793=_0x8f4c[_0x5a0f53];return _0x262793;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'uniqueid':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc8f4('0x3')](_0xc8f4('0x4'),_0xc8f4('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc8f4('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 49e2e2e..7932347 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 _0x2c02=['include','findAll','rows','catch','params','keys','intersection','length','find','create','body','update','describe','eml-format','fast-json-patch','moment','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','map','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','WhatsappTransferReport','includeAll'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x2c02,0x18e));var _0x22c0=function(_0x137173,_0x26fa5f){_0x137173=_0x137173-0x0;var _0x1c32df=_0x2c02[_0x137173];return _0x1c32df;};'use strict';var emlformat=require(_0x22c0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x22c0('0x1'));var rp=require('request-promise');var moment=require(_0x22c0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x22c0('0x3'));var util=require(_0x22c0('0x4'));var path=require(_0x22c0('0x5'));var sox=require(_0x22c0('0x6'));var csv=require(_0x22c0('0x7'));var ejs=require(_0x22c0('0x8'));var fs=require('fs');var fs_extra=require(_0x22c0('0x9'));var _=require('lodash');var squel=require(_0x22c0('0xa'));var crypto=require(_0x22c0('0xb'));var jsforce=require(_0x22c0('0xc'));var deskjs=require(_0x22c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x22c0('0xe'));var Papa=require(_0x22c0('0xf'));var Redis=require(_0x22c0('0x10'));var authService=require(_0x22c0('0x11'));var qs=require(_0x22c0('0x12'));var as=require(_0x22c0('0x13'));var hardwareService=require(_0x22c0('0x14'));var logger=require(_0x22c0('0x15'))(_0x22c0('0x16'));var utils=require(_0x22c0('0x17'));var config=require(_0x22c0('0x18'));var licenseUtil=require(_0x22c0('0x19'));var db=require(_0x22c0('0x1a'))['db'];function respondWithStatusCode(_0xc1fea1,_0x2ad646){_0x2ad646=_0x2ad646||0xcc;return function(_0xcaf095){if(_0xcaf095){return _0xc1fea1[_0x22c0('0x1b')](_0x2ad646);}return _0xc1fea1[_0x22c0('0x1c')](_0x2ad646)[_0x22c0('0x1d')]();};}function respondWithResult(_0x11f900,_0x35be1e){_0x35be1e=_0x35be1e||0xc8;return function(_0x39c773){if(_0x39c773){return _0x11f900[_0x22c0('0x1c')](_0x35be1e)['json'](_0x39c773);}};}function respondWithFilteredResult(_0x58364a,_0x43fc9a){return function(_0x366d41){if(_0x366d41){var _0x5aef23=typeof _0x43fc9a[_0x22c0('0x1e')]===_0x22c0('0x1f')&&typeof _0x43fc9a[_0x22c0('0x20')]===_0x22c0('0x1f');var _0xccd987=_0x366d41['count'];var _0x282009=_0x5aef23?0x0:_0x43fc9a[_0x22c0('0x1e')];var _0x3f9208=_0x5aef23?_0x366d41[_0x22c0('0x21')]:_0x43fc9a[_0x22c0('0x1e')]+_0x43fc9a[_0x22c0('0x20')];var _0x346712;if(_0x3f9208>=_0xccd987){_0x3f9208=_0xccd987;_0x346712=0xc8;}else{_0x346712=0xce;}_0x58364a['status'](_0x346712);return _0x58364a[_0x22c0('0x22')](_0x22c0('0x23'),_0x282009+'-'+_0x3f9208+'/'+_0xccd987)[_0x22c0('0x24')](_0x366d41);}return null;};}function patchUpdates(_0x7129ad){return function(_0x4228fd){try{jsonpatch[_0x22c0('0x25')](_0x4228fd,_0x7129ad,!![]);}catch(_0x5e5f2a){return BPromise[_0x22c0('0x26')](_0x5e5f2a);}return _0x4228fd[_0x22c0('0x27')]();};}function saveUpdates(_0x3de34c,_0x58d887){return function(_0x576091){if(_0x576091){return _0x576091['update'](_0x3de34c)[_0x22c0('0x28')](function(_0x5c908b){return _0x5c908b;});}return null;};}function removeEntity(_0x57974a,_0x3bddfe){return function(_0x1d704a){if(_0x1d704a){return _0x1d704a[_0x22c0('0x29')]()[_0x22c0('0x28')](function(){_0x57974a[_0x22c0('0x1c')](0xcc)[_0x22c0('0x1d')]();});}};}function handleEntityNotFound(_0x548117,_0x4f7bce){return function(_0xf1f987){if(!_0xf1f987){_0x548117['sendStatus'](0x194);}return _0xf1f987;};}function handleError(_0x23da6a,_0x371481){_0x371481=_0x371481||0x1f4;return function(_0x6b2507){logger[_0x22c0('0x2a')](_0x6b2507['stack']);if(_0x6b2507[_0x22c0('0x2b')]){delete _0x6b2507['name'];}_0x23da6a[_0x22c0('0x1c')](_0x371481)[_0x22c0('0x2c')](_0x6b2507);};}exports['index']=function(_0x3e1b66,_0x43c658){var _0x327a6e={},_0x3241c5={},_0x52a49={'count':0x0,'rows':[]};var _0x15970b=_[_0x22c0('0x2d')](db['WhatsappTransferReport'][_0x22c0('0x2e')],function(_0x3d7f60){return{'name':_0x3d7f60['fieldName'],'type':_0x3d7f60[_0x22c0('0x2f')][_0x22c0('0x30')]};});_0x3241c5[_0x22c0('0x31')]=_[_0x22c0('0x2d')](_0x15970b,_0x22c0('0x2b'));_0x3241c5[_0x22c0('0x32')]=_['keys'](_0x3e1b66[_0x22c0('0x32')]);_0x3241c5[_0x22c0('0x33')]=_['intersection'](_0x3241c5[_0x22c0('0x31')],_0x3241c5[_0x22c0('0x32')]);_0x327a6e[_0x22c0('0x34')]=_['intersection'](_0x3241c5[_0x22c0('0x31')],qs[_0x22c0('0x35')](_0x3e1b66[_0x22c0('0x32')]['fields']));_0x327a6e[_0x22c0('0x34')]=_0x327a6e[_0x22c0('0x34')]['length']?_0x327a6e[_0x22c0('0x34')]:_0x3241c5[_0x22c0('0x31')];if(!_0x3e1b66[_0x22c0('0x32')][_0x22c0('0x36')](_0x22c0('0x37'))){_0x327a6e['limit']=qs['limit'](_0x3e1b66[_0x22c0('0x32')][_0x22c0('0x20')]);_0x327a6e[_0x22c0('0x1e')]=qs[_0x22c0('0x1e')](_0x3e1b66[_0x22c0('0x32')][_0x22c0('0x1e')]);}_0x327a6e[_0x22c0('0x38')]=qs['sort'](_0x3e1b66['query'][_0x22c0('0x39')]);_0x327a6e[_0x22c0('0x3a')]=qs[_0x22c0('0x33')](_['pick'](_0x3e1b66[_0x22c0('0x32')],_0x3241c5[_0x22c0('0x33')]),_0x15970b);if(_0x3e1b66[_0x22c0('0x32')][_0x22c0('0x3b')]){_0x327a6e[_0x22c0('0x3a')]=_[_0x22c0('0x3c')](_0x327a6e[_0x22c0('0x3a')],{'$or':_[_0x22c0('0x2d')](_0x15970b,function(_0x3f2f79){if(_0x3f2f79['type']!=='VIRTUAL'){var _0x11984b={};_0x11984b[_0x3f2f79[_0x22c0('0x2b')]]={'$like':'%'+_0x3e1b66[_0x22c0('0x32')][_0x22c0('0x3b')]+'%'};return _0x11984b;}})});}_0x327a6e=_[_0x22c0('0x3c')]({},_0x327a6e,_0x3e1b66[_0x22c0('0x3d')]);var _0x146613={'where':_0x327a6e[_0x22c0('0x3a')]};return db[_0x22c0('0x3e')][_0x22c0('0x21')](_0x146613)[_0x22c0('0x28')](function(_0x218e89){_0x52a49[_0x22c0('0x21')]=_0x218e89;if(_0x3e1b66[_0x22c0('0x32')][_0x22c0('0x3f')]){_0x327a6e[_0x22c0('0x40')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x22c0('0x41')](_0x327a6e);})[_0x22c0('0x28')](function(_0x2adfb2){_0x52a49[_0x22c0('0x42')]=_0x2adfb2;return _0x52a49;})['then'](respondWithFilteredResult(_0x43c658,_0x327a6e))[_0x22c0('0x43')](handleError(_0x43c658,null));};exports['show']=function(_0x2dd26c,_0x2fbb79){var _0x158f28={'raw':!![],'where':{'id':_0x2dd26c[_0x22c0('0x44')]['id']}},_0x2c2c6a={};_0x2c2c6a[_0x22c0('0x31')]=_[_0x22c0('0x45')](db['WhatsappTransferReport']['rawAttributes']);_0x2c2c6a['query']=_[_0x22c0('0x45')](_0x2dd26c['query']);_0x2c2c6a[_0x22c0('0x33')]=_[_0x22c0('0x46')](_0x2c2c6a[_0x22c0('0x31')],_0x2c2c6a[_0x22c0('0x32')]);_0x158f28[_0x22c0('0x34')]=_[_0x22c0('0x46')](_0x2c2c6a[_0x22c0('0x31')],qs[_0x22c0('0x35')](_0x2dd26c[_0x22c0('0x32')][_0x22c0('0x35')]));_0x158f28[_0x22c0('0x34')]=_0x158f28[_0x22c0('0x34')][_0x22c0('0x47')]?_0x158f28[_0x22c0('0x34')]:_0x2c2c6a[_0x22c0('0x31')];if(_0x2dd26c[_0x22c0('0x32')][_0x22c0('0x3f')]){_0x158f28[_0x22c0('0x40')]=[{'all':!![]}];}_0x158f28=_[_0x22c0('0x3c')]({},_0x158f28,_0x2dd26c[_0x22c0('0x3d')]);return db['WhatsappTransferReport'][_0x22c0('0x48')](_0x158f28)['then'](handleEntityNotFound(_0x2fbb79,null))[_0x22c0('0x28')](respondWithResult(_0x2fbb79,null))[_0x22c0('0x43')](handleError(_0x2fbb79,null));};exports[_0x22c0('0x49')]=function(_0x31d503,_0x1fb404){return db[_0x22c0('0x3e')][_0x22c0('0x49')](_0x31d503[_0x22c0('0x4a')],{})[_0x22c0('0x28')](respondWithResult(_0x1fb404,0xc9))[_0x22c0('0x43')](handleError(_0x1fb404,null));};exports[_0x22c0('0x4b')]=function(_0x206bfc,_0x57534b){if(_0x206bfc[_0x22c0('0x4a')]['id']){delete _0x206bfc['body']['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x206bfc[_0x22c0('0x44')]['id']}})['then'](handleEntityNotFound(_0x57534b,null))['then'](saveUpdates(_0x206bfc[_0x22c0('0x4a')],null))[_0x22c0('0x28')](respondWithResult(_0x57534b,null))[_0x22c0('0x43')](handleError(_0x57534b,null));};exports['destroy']=function(_0x3e0987,_0x2d883e){return db['WhatsappTransferReport']['find']({'where':{'id':_0x3e0987[_0x22c0('0x44')]['id']}})[_0x22c0('0x28')](handleEntityNotFound(_0x2d883e,null))[_0x22c0('0x28')](removeEntity(_0x2d883e,null))[_0x22c0('0x43')](handleError(_0x2d883e,null));};exports[_0x22c0('0x4c')]=function(_0x127c4d,_0x5b077e){return db[_0x22c0('0x3e')][_0x22c0('0x4c')]()['then'](respondWithResult(_0x5b077e,null))[_0x22c0('0x43')](handleError(_0x5b077e,null));}; \ No newline at end of file +var _0xdcc1=['update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','include','findAll','rows','catch','params','includeAll','options','find','create'];(function(_0x5730f6,_0x151cdb){var _0x5bd860=function(_0x5cae67){while(--_0x5cae67){_0x5730f6['push'](_0x5730f6['shift']());}};_0x5bd860(++_0x151cdb);}(_0xdcc1,0x170));var _0x1dcc=function(_0x3645a3,_0x18f645){_0x3645a3=_0x3645a3-0x0;var _0xbf0d07=_0xdcc1[_0x3645a3];return _0xbf0d07;};'use strict';var emlformat=require(_0x1dcc('0x0'));var rimraf=require(_0x1dcc('0x1'));var zipdir=require(_0x1dcc('0x2'));var jsonpatch=require(_0x1dcc('0x3'));var rp=require('request-promise');var moment=require(_0x1dcc('0x4'));var BPromise=require(_0x1dcc('0x5'));var Mustache=require(_0x1dcc('0x6'));var util=require(_0x1dcc('0x7'));var path=require('path');var sox=require(_0x1dcc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dcc('0x9'));var _=require(_0x1dcc('0xa'));var squel=require('squel');var crypto=require(_0x1dcc('0xb'));var jsforce=require(_0x1dcc('0xc'));var deskjs=require(_0x1dcc('0xd'));var toCsv=require(_0x1dcc('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1dcc('0xf'));var qs=require(_0x1dcc('0x10'));var as=require(_0x1dcc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1dcc('0x12'));var utils=require(_0x1dcc('0x13'));var config=require(_0x1dcc('0x14'));var licenseUtil=require(_0x1dcc('0x15'));var db=require(_0x1dcc('0x16'))['db'];function respondWithStatusCode(_0x471c52,_0x2e9ca6){_0x2e9ca6=_0x2e9ca6||0xcc;return function(_0xe60089){if(_0xe60089){return _0x471c52[_0x1dcc('0x17')](_0x2e9ca6);}return _0x471c52[_0x1dcc('0x18')](_0x2e9ca6)[_0x1dcc('0x19')]();};}function respondWithResult(_0x235727,_0x562e6b){_0x562e6b=_0x562e6b||0xc8;return function(_0x7ec68){if(_0x7ec68){return _0x235727['status'](_0x562e6b)[_0x1dcc('0x1a')](_0x7ec68);}};}function respondWithFilteredResult(_0x435657,_0x41c758){return function(_0x5695fb){if(_0x5695fb){var _0x1cc74c=typeof _0x41c758[_0x1dcc('0x1b')]===_0x1dcc('0x1c')&&typeof _0x41c758[_0x1dcc('0x1d')]===_0x1dcc('0x1c');var _0x2f8cde=_0x5695fb[_0x1dcc('0x1e')];var _0x4cfbfd=_0x1cc74c?0x0:_0x41c758[_0x1dcc('0x1b')];var _0x5b317f=_0x1cc74c?_0x5695fb[_0x1dcc('0x1e')]:_0x41c758['offset']+_0x41c758[_0x1dcc('0x1d')];var _0x48b2d0;if(_0x5b317f>=_0x2f8cde){_0x5b317f=_0x2f8cde;_0x48b2d0=0xc8;}else{_0x48b2d0=0xce;}_0x435657[_0x1dcc('0x18')](_0x48b2d0);return _0x435657[_0x1dcc('0x1f')](_0x1dcc('0x20'),_0x4cfbfd+'-'+_0x5b317f+'/'+_0x2f8cde)[_0x1dcc('0x1a')](_0x5695fb);}return null;};}function patchUpdates(_0x40aebf){return function(_0xc47449){try{jsonpatch[_0x1dcc('0x21')](_0xc47449,_0x40aebf,!![]);}catch(_0x4dc3d9){return BPromise['reject'](_0x4dc3d9);}return _0xc47449[_0x1dcc('0x22')]();};}function saveUpdates(_0xd2c906,_0x56d0b1){return function(_0x596857){if(_0x596857){return _0x596857['update'](_0xd2c906)[_0x1dcc('0x23')](function(_0x2da7e7){return _0x2da7e7;});}return null;};}function removeEntity(_0x1a9a93,_0x8ed124){return function(_0x4a0034){if(_0x4a0034){return _0x4a0034[_0x1dcc('0x24')]()[_0x1dcc('0x23')](function(){_0x1a9a93['status'](0xcc)[_0x1dcc('0x19')]();});}};}function handleEntityNotFound(_0x1174bb,_0x160db5){return function(_0x1a5053){if(!_0x1a5053){_0x1174bb['sendStatus'](0x194);}return _0x1a5053;};}function handleError(_0x307299,_0x2eb616){_0x2eb616=_0x2eb616||0x1f4;return function(_0x3adaf1){logger[_0x1dcc('0x25')](_0x3adaf1[_0x1dcc('0x26')]);if(_0x3adaf1[_0x1dcc('0x27')]){delete _0x3adaf1[_0x1dcc('0x27')];}_0x307299['status'](_0x2eb616)[_0x1dcc('0x28')](_0x3adaf1);};}exports['index']=function(_0x54bf3a,_0x4b44cd){var _0x50d232={},_0x48e29b={},_0x9168c8={'count':0x0,'rows':[]};var _0x24df01=_[_0x1dcc('0x29')](db[_0x1dcc('0x2a')][_0x1dcc('0x2b')],function(_0x5b0e9c){return{'name':_0x5b0e9c[_0x1dcc('0x2c')],'type':_0x5b0e9c['type']['key']};});_0x48e29b[_0x1dcc('0x2d')]=_[_0x1dcc('0x29')](_0x24df01,_0x1dcc('0x27'));_0x48e29b[_0x1dcc('0x2e')]=_[_0x1dcc('0x2f')](_0x54bf3a['query']);_0x48e29b[_0x1dcc('0x30')]=_[_0x1dcc('0x31')](_0x48e29b[_0x1dcc('0x2d')],_0x48e29b[_0x1dcc('0x2e')]);_0x50d232[_0x1dcc('0x32')]=_['intersection'](_0x48e29b[_0x1dcc('0x2d')],qs[_0x1dcc('0x33')](_0x54bf3a['query'][_0x1dcc('0x33')]));_0x50d232[_0x1dcc('0x32')]=_0x50d232[_0x1dcc('0x32')][_0x1dcc('0x34')]?_0x50d232[_0x1dcc('0x32')]:_0x48e29b[_0x1dcc('0x2d')];if(!_0x54bf3a[_0x1dcc('0x2e')][_0x1dcc('0x35')](_0x1dcc('0x36'))){_0x50d232['limit']=qs[_0x1dcc('0x1d')](_0x54bf3a[_0x1dcc('0x2e')][_0x1dcc('0x1d')]);_0x50d232[_0x1dcc('0x1b')]=qs[_0x1dcc('0x1b')](_0x54bf3a[_0x1dcc('0x2e')][_0x1dcc('0x1b')]);}_0x50d232[_0x1dcc('0x37')]=qs[_0x1dcc('0x38')](_0x54bf3a[_0x1dcc('0x2e')]['sort']);_0x50d232[_0x1dcc('0x39')]=qs[_0x1dcc('0x30')](_['pick'](_0x54bf3a[_0x1dcc('0x2e')],_0x48e29b[_0x1dcc('0x30')]),_0x24df01);if(_0x54bf3a[_0x1dcc('0x2e')][_0x1dcc('0x3a')]){_0x50d232[_0x1dcc('0x39')]=_['merge'](_0x50d232[_0x1dcc('0x39')],{'$or':_[_0x1dcc('0x29')](_0x24df01,function(_0x4031f9){if(_0x4031f9[_0x1dcc('0x3b')]!=='VIRTUAL'){var _0x3da7d7={};_0x3da7d7[_0x4031f9[_0x1dcc('0x27')]]={'$like':'%'+_0x54bf3a[_0x1dcc('0x2e')][_0x1dcc('0x3a')]+'%'};return _0x3da7d7;}})});}_0x50d232=_[_0x1dcc('0x3c')]({},_0x50d232,_0x54bf3a['options']);var _0x5617bb={'where':_0x50d232[_0x1dcc('0x39')]};return db['WhatsappTransferReport'][_0x1dcc('0x1e')](_0x5617bb)[_0x1dcc('0x23')](function(_0x53bd41){_0x9168c8[_0x1dcc('0x1e')]=_0x53bd41;if(_0x54bf3a[_0x1dcc('0x2e')]['includeAll']){_0x50d232[_0x1dcc('0x3d')]=[{'all':!![]}];}return db[_0x1dcc('0x2a')][_0x1dcc('0x3e')](_0x50d232);})['then'](function(_0x5e646c){_0x9168c8[_0x1dcc('0x3f')]=_0x5e646c;return _0x9168c8;})[_0x1dcc('0x23')](respondWithFilteredResult(_0x4b44cd,_0x50d232))[_0x1dcc('0x40')](handleError(_0x4b44cd,null));};exports['show']=function(_0x22f909,_0x4a2f78){var _0x372b11={'raw':!![],'where':{'id':_0x22f909[_0x1dcc('0x41')]['id']}},_0x2bac8c={};_0x2bac8c[_0x1dcc('0x2d')]=_['keys'](db['WhatsappTransferReport'][_0x1dcc('0x2b')]);_0x2bac8c[_0x1dcc('0x2e')]=_[_0x1dcc('0x2f')](_0x22f909[_0x1dcc('0x2e')]);_0x2bac8c[_0x1dcc('0x30')]=_[_0x1dcc('0x31')](_0x2bac8c[_0x1dcc('0x2d')],_0x2bac8c[_0x1dcc('0x2e')]);_0x372b11['attributes']=_[_0x1dcc('0x31')](_0x2bac8c[_0x1dcc('0x2d')],qs[_0x1dcc('0x33')](_0x22f909[_0x1dcc('0x2e')][_0x1dcc('0x33')]));_0x372b11[_0x1dcc('0x32')]=_0x372b11[_0x1dcc('0x32')][_0x1dcc('0x34')]?_0x372b11[_0x1dcc('0x32')]:_0x2bac8c[_0x1dcc('0x2d')];if(_0x22f909['query'][_0x1dcc('0x42')]){_0x372b11['include']=[{'all':!![]}];}_0x372b11=_[_0x1dcc('0x3c')]({},_0x372b11,_0x22f909[_0x1dcc('0x43')]);return db[_0x1dcc('0x2a')][_0x1dcc('0x44')](_0x372b11)[_0x1dcc('0x23')](handleEntityNotFound(_0x4a2f78,null))[_0x1dcc('0x23')](respondWithResult(_0x4a2f78,null))[_0x1dcc('0x40')](handleError(_0x4a2f78,null));};exports[_0x1dcc('0x45')]=function(_0x313eaf,_0x25fe11){return db[_0x1dcc('0x2a')][_0x1dcc('0x45')](_0x313eaf['body'],{})[_0x1dcc('0x23')](respondWithResult(_0x25fe11,0xc9))[_0x1dcc('0x40')](handleError(_0x25fe11,null));};exports[_0x1dcc('0x46')]=function(_0x588e3d,_0x5cce23){if(_0x588e3d['body']['id']){delete _0x588e3d[_0x1dcc('0x47')]['id'];}return db['WhatsappTransferReport'][_0x1dcc('0x44')]({'where':{'id':_0x588e3d['params']['id']}})['then'](handleEntityNotFound(_0x5cce23,null))[_0x1dcc('0x23')](saveUpdates(_0x588e3d[_0x1dcc('0x47')],null))[_0x1dcc('0x23')](respondWithResult(_0x5cce23,null))['catch'](handleError(_0x5cce23,null));};exports[_0x1dcc('0x24')]=function(_0x3f6386,_0xd7e30f){return db[_0x1dcc('0x2a')][_0x1dcc('0x44')]({'where':{'id':_0x3f6386[_0x1dcc('0x41')]['id']}})[_0x1dcc('0x23')](handleEntityNotFound(_0xd7e30f,null))['then'](removeEntity(_0xd7e30f,null))[_0x1dcc('0x40')](handleError(_0xd7e30f,null));};exports[_0x1dcc('0x48')]=function(_0x41f403,_0x3f7f71){return db[_0x1dcc('0x2a')][_0x1dcc('0x48')]()[_0x1dcc('0x23')](respondWithResult(_0x3f7f71,null))[_0x1dcc('0x40')](handleError(_0x3f7f71,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index d50a1b2..277ea4d 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 _0x3f53=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x5bdb83,_0x3605de){var _0x1986bb=function(_0x2d6e94){while(--_0x2d6e94){_0x5bdb83['push'](_0x5bdb83['shift']());}};_0x1986bb(++_0x3605de);}(_0x3f53,0xfa));var _0x33f5=function(_0xeea58e,_0x2f44c5){_0xeea58e=_0xeea58e-0x0;var _0x287d13=_0x3f53[_0xeea58e];return _0x287d13;};'use strict';var _=require(_0x33f5('0x0'));var util=require(_0x33f5('0x1'));var logger=require(_0x33f5('0x2'))(_0x33f5('0x3'));var moment=require('moment');var BPromise=require(_0x33f5('0x4'));var rp=require(_0x33f5('0x5'));var fs=require('fs');var path=require(_0x33f5('0x6'));var rimraf=require(_0x33f5('0x7'));var config=require(_0x33f5('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0x33f5('0x9')]=function(_0x372e84,_0x4f0e13){return _0x372e84[_0x33f5('0xa')](_0x33f5('0xb'),attributes,{'tableName':_0x33f5('0xc'),'paranoid':![],'indexes':[{'name':_0x33f5('0xd'),'fields':[_0x33f5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0e4=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x10dae1,_0x26e8fa){var _0xa36517=function(_0x4fc378){while(--_0x4fc378){_0x10dae1['push'](_0x10dae1['shift']());}};_0xa36517(++_0x26e8fa);}(_0xa0e4,0xd4));var _0x4a0e=function(_0xe26c86,_0x541146){_0xe26c86=_0xe26c86-0x0;var _0x3d4dd7=_0xa0e4[_0xe26c86];return _0x3d4dd7;};'use strict';var _=require(_0x4a0e('0x0'));var util=require(_0x4a0e('0x1'));var logger=require(_0x4a0e('0x2'))('api');var moment=require(_0x4a0e('0x3'));var BPromise=require(_0x4a0e('0x4'));var rp=require(_0x4a0e('0x5'));var fs=require('fs');var path=require(_0x4a0e('0x6'));var rimraf=require(_0x4a0e('0x7'));var config=require(_0x4a0e('0x8'));var attributes=require(_0x4a0e('0x9'));module[_0x4a0e('0xa')]=function(_0x1cf5c9,_0x57b3ee){return _0x1cf5c9[_0x4a0e('0xb')](_0x4a0e('0xc'),attributes,{'tableName':_0x4a0e('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4a0e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 2761ec8..103c9bf 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 _0x1008=['request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1008,0x106));var _0x8100=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0x1008[_0x2c18a8];return _0x1e009a;};'use strict';var _=require(_0x8100('0x0'));var util=require(_0x8100('0x1'));var moment=require('moment');var BPromise=require(_0x8100('0x2'));var rs=require(_0x8100('0x3'));var fs=require('fs');var Redis=require(_0x8100('0x4'));var db=require(_0x8100('0x5'))['db'];var utils=require(_0x8100('0x6'));var logger=require(_0x8100('0x7'))(_0x8100('0x8'));var config=require(_0x8100('0x9'));var jayson=require(_0x8100('0xa'));var client=jayson[_0x8100('0xb')][_0x8100('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20259b,_0x537175,_0xcbc242){return new BPromise(function(_0x3fedeb,_0x4f0056){return client[_0x8100('0xd')](_0x20259b,_0xcbc242)[_0x8100('0xe')](function(_0x298e7f){logger[_0x8100('0xf')](_0x8100('0x10'),_0x537175,_0x8100('0x11'));logger[_0x8100('0x12')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x537175,_0x8100('0x11'),JSON[_0x8100('0x13')](_0x298e7f));if(_0x298e7f['error']){if(_0x298e7f[_0x8100('0x14')][_0x8100('0x15')]===0x1f4){logger[_0x8100('0x14')](_0x8100('0x10'),_0x537175,_0x298e7f[_0x8100('0x14')][_0x8100('0x16')]);return _0x4f0056(_0x298e7f['error'][_0x8100('0x16')]);}logger[_0x8100('0x14')](_0x8100('0x10'),_0x537175,_0x298e7f[_0x8100('0x14')][_0x8100('0x16')]);return _0x3fedeb(_0x298e7f[_0x8100('0x14')]['message']);}else{logger[_0x8100('0xf')](_0x8100('0x10'),_0x537175,_0x8100('0x11'));_0x3fedeb(_0x298e7f[_0x8100('0x17')][_0x8100('0x16')]);}})[_0x8100('0x18')](function(_0x2b00b1){logger[_0x8100('0x14')](_0x8100('0x10'),_0x537175,_0x2b00b1);_0x4f0056(_0x2b00b1);});});} \ No newline at end of file +var _0xff94=['lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x5a26d2,_0x5d3763){var _0x2c5ce8=function(_0x59d440){while(--_0x59d440){_0x5a26d2['push'](_0x5a26d2['shift']());}};_0x2c5ce8(++_0x5d3763);}(_0xff94,0x1e6));var _0x4ff9=function(_0x4868c9,_0x445302){_0x4868c9=_0x4868c9-0x0;var _0x3ceeff=_0xff94[_0x4868c9];return _0x3ceeff;};'use strict';var _=require(_0x4ff9('0x0'));var util=require(_0x4ff9('0x1'));var moment=require('moment');var BPromise=require(_0x4ff9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ff9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ff9('0x4'));var logger=require(_0x4ff9('0x5'))(_0x4ff9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4ff9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34be5a,_0x3d8199,_0x4e83d0){return new BPromise(function(_0x4337d8,_0x3eb8d9){return client['request'](_0x34be5a,_0x4e83d0)[_0x4ff9('0x8')](function(_0x28f51c){logger[_0x4ff9('0x9')](_0x4ff9('0xa'),_0x3d8199,'request\x20sent');logger[_0x4ff9('0xb')](_0x4ff9('0xc'),_0x3d8199,_0x4ff9('0xd'),JSON['stringify'](_0x28f51c));if(_0x28f51c[_0x4ff9('0xe')]){if(_0x28f51c[_0x4ff9('0xe')][_0x4ff9('0xf')]===0x1f4){logger[_0x4ff9('0xe')](_0x4ff9('0xa'),_0x3d8199,_0x28f51c['error'][_0x4ff9('0x10')]);return _0x3eb8d9(_0x28f51c[_0x4ff9('0xe')][_0x4ff9('0x10')]);}logger['error'](_0x4ff9('0xa'),_0x3d8199,_0x28f51c[_0x4ff9('0xe')][_0x4ff9('0x10')]);return _0x4337d8(_0x28f51c[_0x4ff9('0xe')]['message']);}else{logger[_0x4ff9('0x9')](_0x4ff9('0xa'),_0x3d8199,_0x4ff9('0xd'));_0x4337d8(_0x28f51c['result'][_0x4ff9('0x10')]);}})[_0x4ff9('0x11')](function(_0x4364d8){logger[_0x4ff9('0xe')](_0x4ff9('0xa'),_0x3d8199,_0x4364d8);_0x3eb8d9(_0x4364d8);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index c3a0401..ebd77d7 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe83c=['Offline\x20apps:','status','default','./config/license','catch','exit','lodash','./mysqldb','./config/environment','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','start','info','map','filter','online','name','join'];(function(_0x41905b,_0x31e9f0){var _0x2b3af1=function(_0x37058a){while(--_0x37058a){_0x41905b['push'](_0x41905b['shift']());}};_0x2b3af1(++_0x31e9f0);}(_0xe83c,0xf0));var _0xce83=function(_0x2383bc,_0x2d5ec9){_0x2383bc=_0x2383bc-0x0;var _0x283573=_0xe83c[_0x2383bc];return _0x283573;};'use strict';var _=require(_0xce83('0x0'));var mysqldb=require(_0xce83('0x1'));var rpc=require('./rpc');var config=require(_0xce83('0x2'));var logger=require(_0xce83('0x3'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xce83('0x4'));var schedule=require(_0xce83('0x5'));var chat=require(_0xce83('0x6'));var whatsapp=require(_0xce83('0x7'));var transcribe=require(_0xce83('0x8'));function main(){return mysqldb['db'][_0xce83('0x9')][_0xce83('0xa')]()[_0xce83('0xb')](function(){return rpc[_0xce83('0xc')]();})[_0xce83('0xb')](function(_0x181e4d){logger['info'](_0x181e4d);return chat[_0xce83('0xd')]();})['then'](function(){return whatsapp['start']();})['then'](function(){return schedule['start']();})[_0xce83('0xb')](function(){return transcribe['start']();})[_0xce83('0xb')](function(_0x339056){logger[_0xce83('0xe')](_0x339056);return pm2[_0xce83('0xd')](pm2Config);})[_0xce83('0xb')](function(_0x14b5f6){logger[_0xce83('0xe')]('Online\x20apps:',_[_0xce83('0xf')](_[_0xce83('0x10')](_0x14b5f6,{'status':_0xce83('0x11')}),_0xce83('0x12'))[_0xce83('0x13')]());logger[_0xce83('0xe')](_0xce83('0x14'),_['map'](_[_0xce83('0x10')](_0x14b5f6,function(_0x23aa08){return _0x23aa08[_0xce83('0x15')]!==_0xce83('0x11');}),'name')[_0xce83('0x13')]()||'None');config['seedDB']&&require('./config/seedDB')[_0xce83('0x16')]();require(_0xce83('0x17'))[_0xce83('0x16')]();})[_0xce83('0x18')](function(_0x5e2497){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5e2497);process[_0xce83('0x19')](0x1);});}main(); \ No newline at end of file +var _0xbcfe=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','online','status','name','join','None','seedDB','./config/seedDB','default','./config/license','catch','error'];(function(_0x2cf21f,_0x356012){var _0x2c0b0d=function(_0x4d09b4){while(--_0x4d09b4){_0x2cf21f['push'](_0x2cf21f['shift']());}};_0x2c0b0d(++_0x356012);}(_0xbcfe,0x14c));var _0xebcf=function(_0x1ba19b,_0x3bab3d){_0x1ba19b=_0x1ba19b-0x0;var _0x5a9b34=_0xbcfe[_0x1ba19b];return _0x5a9b34;};'use strict';var _=require(_0xebcf('0x0'));var mysqldb=require(_0xebcf('0x1'));var rpc=require(_0xebcf('0x2'));var config=require(_0xebcf('0x3'));var logger=require(_0xebcf('0x4'))(_0xebcf('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0xebcf('0x6'));var schedule=require(_0xebcf('0x7'));var chat=require(_0xebcf('0x8'));var whatsapp=require(_0xebcf('0x9'));var transcribe=require(_0xebcf('0xa'));function main(){return mysqldb['db'][_0xebcf('0xb')][_0xebcf('0xc')]()[_0xebcf('0xd')](function(){return rpc[_0xebcf('0xe')]();})[_0xebcf('0xd')](function(_0x28594f){logger[_0xebcf('0xf')](_0x28594f);return chat[_0xebcf('0x10')]();})['then'](function(){return whatsapp[_0xebcf('0x10')]();})['then'](function(){return schedule[_0xebcf('0x10')]();})[_0xebcf('0xd')](function(){return transcribe[_0xebcf('0x10')]();})['then'](function(_0xe19994){logger['info'](_0xe19994);return pm2[_0xebcf('0x10')](pm2Config);})[_0xebcf('0xd')](function(_0x59a320){logger[_0xebcf('0xf')](_0xebcf('0x11'),_[_0xebcf('0x12')](_[_0xebcf('0x13')](_0x59a320,{'status':_0xebcf('0x14')}),'name')['join']());logger[_0xebcf('0xf')]('Offline\x20apps:',_[_0xebcf('0x12')](_[_0xebcf('0x13')](_0x59a320,function(_0x1403e8){return _0x1403e8[_0xebcf('0x15')]!==_0xebcf('0x14');}),_0xebcf('0x16'))[_0xebcf('0x17')]()||_0xebcf('0x18'));config[_0xebcf('0x19')]&&require(_0xebcf('0x1a'))[_0xebcf('0x1b')]();require(_0xebcf('0x1c'))[_0xebcf('0x1b')]();})[_0xebcf('0x1d')](function(_0x350396){logger[_0xebcf('0x1e')](_0xebcf('0x1f'),_0x350396);process[_0xebcf('0x20')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 4fadbc9..8bab38d 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 _0x21a4=['phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','json','unmanaged','Unmanaged.','Forbidden.','catch','headers','Basic','User','find','pass','status','Wrong\x20credentials.','startsWith','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','/dashboards/general','send','retrieveApiKey','apiKeyIat','apiKeyNonce','regenerateApiKey','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','join','sign','payload','options','promisify','randomBytes','toString','hex','floor','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','moment','secrets','session','name','internal','permissions','md5secret','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired'];(function(_0x1aec02,_0x3a7f22){var _0x10a837=function(_0x42641b){while(--_0x42641b){_0x1aec02['push'](_0x1aec02['shift']());}};_0x10a837(++_0x3a7f22);}(_0x21a4,0x1c7));var _0x421a=function(_0x4cb1c0,_0x24075f){_0x4cb1c0=_0x4cb1c0-0x0;var _0x48ab53=_0x21a4[_0x4cb1c0];return _0x48ab53;};'use strict';var db=require(_0x421a('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x421a('0x1'));var licenseUtil=require(_0x421a('0x2'));var encryptor=require(_0x421a('0x3'));var _=require('lodash');var jwt=require(_0x421a('0x4'));var expressJwt=require(_0x421a('0x5'));var compose=require(_0x421a('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x421a('0x7'));var BPromise=require(_0x421a('0x8'));var util=require('util');var moment=require(_0x421a('0x9'));var validateJwt=expressJwt({'secret':config[_0x421a('0xa')][_0x421a('0xb')]});var userAttributes=['id','role','fullname',_0x421a('0xc'),_0x421a('0xd'),'email','userpic',_0x421a('0xe'),_0x421a('0xf'),'voicePause',_0x421a('0x10'),_0x421a('0x11'),_0x421a('0x12'),_0x421a('0x13'),_0x421a('0x14'),_0x421a('0x15'),_0x421a('0x16'),_0x421a('0x17'),_0x421a('0x18'),_0x421a('0x19'),_0x421a('0x1a'),_0x421a('0x1b'),_0x421a('0x1c'),_0x421a('0x1d'),_0x421a('0x1e'),_0x421a('0x1f'),_0x421a('0x20'),_0x421a('0x21'),_0x421a('0x22'),_0x421a('0x23'),_0x421a('0x24'),_0x421a('0x25'),_0x421a('0x26'),_0x421a('0x27'),_0x421a('0x28'),_0x421a('0x29'),_0x421a('0x2a'),_0x421a('0x2b'),'wssPort',_0x421a('0x2c'),'downloadOmnichannelInteractions',_0x421a('0x2d')];exports['isChatInteractionAuthorized']=function(){return this[_0x421a('0x2e')](!![])[_0x421a('0x2f')](function(_0x2b22fd,_0x1d4596,_0x4f7dc2){if(_0x2b22fd[_0x421a('0x30')]){_0x4f7dc2();}else{return db[_0x421a('0x31')][_0x421a('0x32')]({'where':{'id':_0x2b22fd[_0x421a('0x33')]['id']},'attributes':['id',_0x421a('0x34'),_0x421a('0x35')],'raw':!![]})[_0x421a('0x36')](function(_0x10fd9b){if(_0x10fd9b&&_0x10fd9b[_0x421a('0x34')]){return _0x1d4596['status'](_0x10fd9b[_0x421a('0x35')]==='unmanaged'?0x195:0x193)[_0x421a('0x37')]({'message':_0x10fd9b[_0x421a('0x35')]===_0x421a('0x38')?_0x421a('0x39'):_0x421a('0x3a')});}else{_0x4f7dc2();}})[_0x421a('0x3b')](function(_0x52948a){_0x4f7dc2(_0x52948a);});}});};exports[_0x421a('0x2e')]=function isAuthenticated(_0x55d739){return compose()[_0x421a('0x2f')](function(_0x4f83d7,_0x45a19e,_0x383241){var _0xd5e13;if(_0x4f83d7[_0x421a('0x3c')]['authorization']){if(_['startsWith'](_0x4f83d7[_0x421a('0x3c')]['authorization'],_0x421a('0x3d'))){var _0x3ef089=basicAuth(_0x4f83d7);db[_0x421a('0x3e')][_0x421a('0x3f')]({'where':{'name':_0x3ef089['name']}})['then'](function(_0x460296){if(!_0x460296||!_0x460296['authenticate'](_0x3ef089[_0x421a('0x40')])){return _0x45a19e[_0x421a('0x41')](0x191)[_0x421a('0x37')]({'message':_0x421a('0x42')});}_0x4f83d7['user']={'id':_0x460296['id']};_0x383241();})['catch'](function(_0x34f88d){_0x383241(_0x34f88d);});}else if(_[_0x421a('0x43')](_0x4f83d7[_0x421a('0x3c')]['authorization'],'Bearer')){validateJwt(_0x4f83d7,_0x45a19e,_0x383241);}else{if(_0x55d739){_0x383241();}else{return _0x45a19e[_0x421a('0x41')](0x193)[_0x421a('0x37')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x4f83d7[_0x421a('0x44')][_0x421a('0x45')]){try{var _0x3c9d37={'audience':hardwareConf[_0x421a('0x46')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x4f83d7[_0x421a('0x44')][_0x421a('0x45')],_0x3c9d37)[_0x421a('0x36')](function(_0x429d84){return db[_0x421a('0x3e')][_0x421a('0x3f')]({'where':{'id':_0x429d84[_0x421a('0x47')]}})[_0x421a('0x36')](function(_0x469b3d){_0xd5e13=_0x469b3d;return db[_0x421a('0x48')]['findOne']({'where':{'id':0x1},'attributes':[_0x421a('0x49'),_0x421a('0x4a')],'raw':!![]});})[_0x421a('0x36')](function(_0x2cd08b){if(!_0xd5e13||!_[_0x421a('0x4b')](_0xd5e13['apiKeyNonce'],_0x429d84['nonce'])){return _0x45a19e[_0x421a('0x41')](0x191)[_0x421a('0x37')]({'message':_0x421a('0x4c')});}if(_0xd5e13[_0x421a('0x4d')]){return _0x45a19e[_0x421a('0x41')](0x191)[_0x421a('0x37')]({'message':_0x421a('0x4e')});}if(_0xd5e13[_0x421a('0x4f')]){if(_0x2cd08b[_0x421a('0x4a')]>0x0){if(moment(_0xd5e13['blockedAt'])[_0x421a('0x50')](_0x2cd08b[_0x421a('0x4a')],_0x421a('0x51'))>moment()){return _0x45a19e[_0x421a('0x41')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x45a19e[_0x421a('0x41')](0x191)[_0x421a('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x4f83d7[_0x421a('0x30')]={'id':_0xd5e13['id']};_0x383241();});})[_0x421a('0x3b')](function(){return _0x45a19e[_0x421a('0x41')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x354e7e){_0x383241(_0x354e7e);}}else if(_0x55d739){_0x383241();}else{return _0x45a19e[_0x421a('0x41')](0x193)[_0x421a('0x37')]({'message':_0x421a('0x52')});}})[_0x421a('0x2f')](function(_0x479af5,_0x250737,_0x4c54c2){if(_0x479af5[_0x421a('0x30')]){db[_0x421a('0x3e')][_0x421a('0x3f')]({'where':{'id':_0x479af5[_0x421a('0x30')]['id']},'attributes':userAttributes})[_0x421a('0x36')](function(_0x105373){if(!_0x105373){return _0x250737[_0x421a('0x41')](0x194)['json']({'message':_0x421a('0x53')});}_0x479af5[_0x421a('0x30')]=_0x105373;_0x4c54c2();})[_0x421a('0x3b')](function(_0x259c7d){_0x4c54c2(_0x259c7d);});}else if(_0x55d739){_0x4c54c2();}else{return _0x250737['status'](0x194)[_0x421a('0x37')]({'message':_0x421a('0x54')});}});};exports[_0x421a('0x55')]=function canUpdate(){return compose()['use'](function(_0x20a4a1,_0x2ced78,_0x41561f){return licenseUtil[_0x421a('0x56')]()['then'](function(_0x60520d){if(_0x60520d[_0x421a('0x57')]){_0x41561f();}else{return _0x2ced78[_0x421a('0x41')](0x193)[_0x421a('0x37')]({'message':_0x421a('0x58')});}})[_0x421a('0x3b')](function(_0x4e00cc){_0x41561f(_0x4e00cc);});});};exports[_0x421a('0x59')]=function(_0x532510,_0xfdbc93,_0x152b68){_0x532510['isMiddleware']=!![];return _0x152b68();};exports[_0x421a('0x5a')]=function signToken(_0x8dffbc){return signJwt(_0x8dffbc);};exports['setTokenCookie']=function(_0x360820,_0x2b70fc){if(!_0x360820[_0x421a('0x30')]){return _0x2b70fc[_0x421a('0x41')](0x194)[_0x421a('0x37')]({'message':_0x421a('0x5b')});}var _0x2f9f41={'payload':{'id':_0x360820[_0x421a('0x30')]['id'],'role':_0x360820[_0x421a('0x30')][_0x421a('0x5c')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2f9f41)[_0x421a('0x36')](function(_0x14104d){_0x2b70fc[_0x421a('0x5d')](_0x421a('0x5e'),_0x14104d);_0x2b70fc['redirect'](_0x421a('0x5f'));})[_0x421a('0x3b')](function(_0x106489){return _0x2b70fc[_0x421a('0x41')](0x1f4)[_0x421a('0x60')](_0x106489);});};exports[_0x421a('0x61')]=function(_0x47d241){if(_['isNil'](_0x47d241['apiKeyNonce'])||_['isNil'](_0x47d241[_0x421a('0x62')])){return null;}else{return createJwt(_0x47d241);}};exports['generateApiKey']=function(_0x2489b9){_0x2489b9[_0x421a('0x63')]=generateNonce();_0x2489b9['apiKeyIat']=generateIssuedAt();return createJwt(_0x2489b9);};exports[_0x421a('0x64')]=function(_0x4b85d5,_0x28f0c8){var _0x5b529d=_0x4b85d5[_0x421a('0x44')][_0x421a('0x45')];if(_0x5b529d){var _0xff1102={'nonce':_0x28f0c8[_0x421a('0x63')],'iat':_0x28f0c8[_0x421a('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x421a('0x46')]()};return verifyJwt(_0x5b529d,_0xff1102)['then'](function(){return generateApiKey(_0x28f0c8);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x26746c){var _0xb4a8c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xb4a8c3[_0x421a('0x65')](_0x26746c))throw new db[(_0x421a('0x66'))]['ValidationError'](_0x421a('0x67'));return;};exports['validatePasswordHistory']=function(_0x11aa52,_0xb1f32b,_0x48bc1b){var _0x2a3c79=encryptor[_0x421a('0x68')](_0xb1f32b)[_0x421a('0x69')](',');for(var _0x408132=0x0;_0x408132<_0x48bc1b;_0x408132++){if(!_0x2a3c79[_0x408132])break;if(_0x11aa52[_0x421a('0x6a')]()===_0x2a3c79[_0x408132][_0x421a('0x6a')]()){var _0x2b77d2=util[_0x421a('0x6b')](_0x421a('0x6c'),_0x48bc1b);if(_0x48bc1b===0x1){_0x2b77d2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x421a('0x66'))][(_0x421a('0x6d'))](_0x2b77d2);}}return;};exports[_0x421a('0x6e')]=function(_0x2ce5ea,_0x5bec22){var _0x1df018=_0x5bec22?encryptor[_0x421a('0x68')](_0x5bec22)[_0x421a('0x69')](','):[];if(_0x1df018[_0x421a('0x6f')]===0x5){_0x1df018[_0x421a('0x70')](-0x1,0x1);}_0x1df018['unshift'](_0x2ce5ea);return encryptor[_0x421a('0x71')](_0x1df018[_0x421a('0x72')](','));};function signJwt(_0x292c66){var _0xd10ea=BPromise['promisify'](jwt[_0x421a('0x73')],{'context':jwt});var _0x37e524=_0x292c66['secret']||config[_0x421a('0xa')][_0x421a('0xb')];return new BPromise(function(_0x4048c4,_0x175e54){_0xd10ea(_0x292c66[_0x421a('0x74')],_0x37e524,_0x292c66[_0x421a('0x75')])[_0x421a('0x36')](function(_0x1278b2){_0x4048c4(_0x1278b2);})[_0x421a('0x3b')](function(_0x49ea9f){_0x175e54(_0x49ea9f);});});}function verifyJwt(_0x20cdc8,_0x573880,_0x52713a){var _0x23ad73=BPromise[_0x421a('0x76')](jwt['verify'],{'context':jwt});var _0x3d6ff1=_0x52713a||config[_0x421a('0xa')][_0x421a('0xb')];return new BPromise(function(_0x1cb1ae,_0x2841a4){_0x23ad73(_0x20cdc8,_0x3d6ff1,_0x573880)[_0x421a('0x36')](function(_0x3aaafa){_0x1cb1ae(_0x3aaafa);})[_0x421a('0x3b')](function(_0xbc08b4){_0x2841a4(_0xbc08b4);});});}function generateNonce(){return crypto[_0x421a('0x77')](0x10)[_0x421a('0x78')](_0x421a('0x79'));}function generateIssuedAt(){return Math[_0x421a('0x7a')](Date['now']()/0x3e8)[_0x421a('0x78')]();}function createJwt(_0x3fca68){var _0x18c639={'payload':{'iat':_0x3fca68[_0x421a('0x62')],'nonce':_0x3fca68[_0x421a('0x63')]},'options':{'algorithm':'HS512','subject':_0x3fca68['id'][_0x421a('0x78')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x18c639)[_0x421a('0x36')](function(_0x204db6){return{'iat':_0x3fca68[_0x421a('0x62')],'nonce':_0x3fca68[_0x421a('0x63')],'token':_0x204db6};});} \ No newline at end of file +var _0x80ae=['lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','phoneBarAutoAnswer','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','wssPort','downloadVoiceRecordings','downloadAttachments','isAuthenticated','use','findOne','params','closed','disposition','then','status','json','unmanaged','Forbidden.','headers','authorization','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','startsWith','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','Setting','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','user','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','redirect','/dashboards/general','isNil','apiKeyIat','query','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','encryptString','join','promisify','sign','payload','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','secrets','session','role','fullname','permissions','voicePause','faxPause','openchannelPause','showWebBar'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x80ae,0xc9));var _0xe80a=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0x80ae[_0x5c4585];return _0x21dede;};'use strict';var db=require(_0xe80a('0x0'))['db'];var config=require(_0xe80a('0x1'));var hardwareConf=require(_0xe80a('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xe80a('0x3'));var _=require(_0xe80a('0x4'));var jwt=require(_0xe80a('0x5'));var expressJwt=require(_0xe80a('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0xe80a('0x7'));var crypto=require(_0xe80a('0x8'));var BPromise=require(_0xe80a('0x9'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xe80a('0xa')][_0xe80a('0xb')]});var userAttributes=['id',_0xe80a('0xc'),_0xe80a('0xd'),'name','internal','email','userpic',_0xe80a('0xe'),'md5secret',_0xe80a('0xf'),'chatPause','mailPause',_0xe80a('0x10'),'smsPause',_0xe80a('0x11'),'pauseType',_0xe80a('0x12'),_0xe80a('0x13'),_0xe80a('0x14'),_0xe80a('0x15'),'allowmessenger',_0xe80a('0x16'),'alias',_0xe80a('0x17'),'phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording',_0xe80a('0x18'),_0xe80a('0x19'),_0xe80a('0x1a'),_0xe80a('0x1b'),_0xe80a('0x1c'),_0xe80a('0x1d'),'hotdesk','interface',_0xe80a('0x1e'),'privacyEnabled','settingsEnabled',_0xe80a('0x1f'),_0xe80a('0x20'),'downloadOmnichannelInteractions',_0xe80a('0x21')];exports['isChatInteractionAuthorized']=function(){return this[_0xe80a('0x22')](!![])[_0xe80a('0x23')](function(_0x4adb10,_0x3ac08a,_0x40474c){if(_0x4adb10['user']){_0x40474c();}else{return db['ChatInteraction'][_0xe80a('0x24')]({'where':{'id':_0x4adb10[_0xe80a('0x25')]['id']},'attributes':['id',_0xe80a('0x26'),_0xe80a('0x27')],'raw':!![]})[_0xe80a('0x28')](function(_0x487f84){if(_0x487f84&&_0x487f84[_0xe80a('0x26')]){return _0x3ac08a[_0xe80a('0x29')](_0x487f84[_0xe80a('0x27')]==='unmanaged'?0x195:0x193)[_0xe80a('0x2a')]({'message':_0x487f84[_0xe80a('0x27')]===_0xe80a('0x2b')?'Unmanaged.':_0xe80a('0x2c')});}else{_0x40474c();}})['catch'](function(_0x12ef63){_0x40474c(_0x12ef63);});}});};exports['isAuthenticated']=function isAuthenticated(_0x3f4a81){return compose()['use'](function(_0x445f51,_0x568362,_0x292fd1){var _0x4add10;if(_0x445f51[_0xe80a('0x2d')]['authorization']){if(_['startsWith'](_0x445f51[_0xe80a('0x2d')][_0xe80a('0x2e')],'Basic')){var _0x1c2962=basicAuth(_0x445f51);db[_0xe80a('0x2f')][_0xe80a('0x30')]({'where':{'name':_0x1c2962[_0xe80a('0x31')]}})[_0xe80a('0x28')](function(_0x5c453d){if(!_0x5c453d||!_0x5c453d[_0xe80a('0x32')](_0x1c2962[_0xe80a('0x33')])){return _0x568362[_0xe80a('0x29')](0x191)[_0xe80a('0x2a')]({'message':_0xe80a('0x34')});}_0x445f51['user']={'id':_0x5c453d['id']};_0x292fd1();})[_0xe80a('0x35')](function(_0x73b89f){_0x292fd1(_0x73b89f);});}else if(_[_0xe80a('0x36')](_0x445f51['headers']['authorization'],_0xe80a('0x37'))){validateJwt(_0x445f51,_0x568362,_0x292fd1);}else{if(_0x3f4a81){_0x292fd1();}else{return _0x568362[_0xe80a('0x29')](0x193)[_0xe80a('0x2a')]({'message':_0xe80a('0x38')});}}}else if(_0x445f51['query'][_0xe80a('0x39')]){try{var _0x460c33={'audience':hardwareConf[_0xe80a('0x3a')](),'issuer':hardwareConf[_0xe80a('0x3a')]()};verifyJwt(_0x445f51['query'][_0xe80a('0x39')],_0x460c33)['then'](function(_0x27bec7){return db[_0xe80a('0x2f')][_0xe80a('0x30')]({'where':{'id':_0x27bec7['sub']}})[_0xe80a('0x28')](function(_0x1bf1bc){_0x4add10=_0x1bf1bc;return db[_0xe80a('0x3b')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe80a('0x3c')],'raw':!![]});})[_0xe80a('0x28')](function(_0x2a3367){if(!_0x4add10||!_['isEqual'](_0x4add10[_0xe80a('0x3d')],_0x27bec7[_0xe80a('0x3e')])){return _0x568362['status'](0x191)['json']({'message':_0xe80a('0x3f')});}if(_0x4add10[_0xe80a('0x40')]){return _0x568362[_0xe80a('0x29')](0x191)['json']({'message':_0xe80a('0x41')});}if(_0x4add10[_0xe80a('0x42')]){if(_0x2a3367[_0xe80a('0x3c')]>0x0){if(moment(_0x4add10[_0xe80a('0x43')])[_0xe80a('0x44')](_0x2a3367['blockDuration'],'minutes')>moment()){return _0x568362[_0xe80a('0x29')](0x191)[_0xe80a('0x2a')]({'message':_0xe80a('0x41')});}}else{return _0x568362[_0xe80a('0x29')](0x191)[_0xe80a('0x2a')]({'message':_0xe80a('0x41')});}}_0x445f51[_0xe80a('0x45')]={'id':_0x4add10['id']};_0x292fd1();});})[_0xe80a('0x35')](function(){return _0x568362[_0xe80a('0x29')](0x191)[_0xe80a('0x2a')]({'message':_0xe80a('0x41')});});}catch(_0x1594ea){_0x292fd1(_0x1594ea);}}else if(_0x3f4a81){_0x292fd1();}else{return _0x568362[_0xe80a('0x29')](0x193)[_0xe80a('0x2a')]({'message':_0xe80a('0x38')});}})[_0xe80a('0x23')](function(_0x373e65,_0x12faaa,_0x53da5c){if(_0x373e65['user']){db[_0xe80a('0x2f')][_0xe80a('0x30')]({'where':{'id':_0x373e65[_0xe80a('0x45')]['id']},'attributes':userAttributes})[_0xe80a('0x28')](function(_0x41af42){if(!_0x41af42){return _0x12faaa['status'](0x194)[_0xe80a('0x2a')]({'message':_0xe80a('0x46')});}_0x373e65['user']=_0x41af42;_0x53da5c();})[_0xe80a('0x35')](function(_0x43a69c){_0x53da5c(_0x43a69c);});}else if(_0x3f4a81){_0x53da5c();}else{return _0x12faaa[_0xe80a('0x29')](0x194)[_0xe80a('0x2a')]({'message':_0xe80a('0x47')});}});};exports[_0xe80a('0x48')]=function canUpdate(){return compose()[_0xe80a('0x23')](function(_0x38a248,_0x14ff2c,_0x304b13){return licenseUtil[_0xe80a('0x49')]()[_0xe80a('0x28')](function(_0x5f19b1){if(_0x5f19b1[_0xe80a('0x4a')]){_0x304b13();}else{return _0x14ff2c['status'](0x193)[_0xe80a('0x2a')]({'message':_0xe80a('0x4b')});}})[_0xe80a('0x35')](function(_0x35c39a){_0x304b13(_0x35c39a);});});};exports['isMiddleware']=function(_0x538c59,_0x2a0a2b,_0x5cb4a2){_0x538c59[_0xe80a('0x4c')]=!![];return _0x5cb4a2();};exports[_0xe80a('0x4d')]=function signToken(_0x21c2b7){return signJwt(_0x21c2b7);};exports[_0xe80a('0x4e')]=function(_0xac1aa,_0x2dfb45){if(!_0xac1aa[_0xe80a('0x45')]){return _0x2dfb45[_0xe80a('0x29')](0x194)[_0xe80a('0x2a')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x12d395={'payload':{'id':_0xac1aa[_0xe80a('0x45')]['id'],'role':_0xac1aa['user'][_0xe80a('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x12d395)['then'](function(_0x5ded44){_0x2dfb45[_0xe80a('0x4f')]('motion.token',_0x5ded44);_0x2dfb45[_0xe80a('0x50')](_0xe80a('0x51'));})['catch'](function(_0x2d5e20){return _0x2dfb45[_0xe80a('0x29')](0x1f4)['send'](_0x2d5e20);});};exports['retrieveApiKey']=function(_0x506ef7){if(_[_0xe80a('0x52')](_0x506ef7[_0xe80a('0x3d')])||_['isNil'](_0x506ef7[_0xe80a('0x53')])){return null;}else{return createJwt(_0x506ef7);}};exports['generateApiKey']=function(_0x537aed){_0x537aed[_0xe80a('0x3d')]=generateNonce();_0x537aed['apiKeyIat']=generateIssuedAt();return createJwt(_0x537aed);};exports['regenerateApiKey']=function(_0x7a6795,_0x4b91a5){var _0x42dd5c=_0x7a6795[_0xe80a('0x54')][_0xe80a('0x39')];if(_0x42dd5c){var _0x348a32={'nonce':_0x4b91a5[_0xe80a('0x3d')],'iat':_0x4b91a5[_0xe80a('0x53')],'audience':hardwareConf[_0xe80a('0x3a')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x42dd5c,_0x348a32)['then'](function(){return generateApiKey(_0x4b91a5);});}else{throw{'message':_0xe80a('0x55')};}};exports[_0xe80a('0x56')]=function(_0x56d9e9){var _0x2f152a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2f152a[_0xe80a('0x57')](_0x56d9e9))throw new db[(_0xe80a('0x58'))][(_0xe80a('0x59'))](_0xe80a('0x5a'));return;};exports['validatePasswordHistory']=function(_0x2772d4,_0x11e2b3,_0x3a385e){var _0x46f8ec=encryptor[_0xe80a('0x5b')](_0x11e2b3)[_0xe80a('0x5c')](',');for(var _0x4385df=0x0;_0x4385df<_0x3a385e;_0x4385df++){if(!_0x46f8ec[_0x4385df])break;if(_0x2772d4[_0xe80a('0x5d')]()===_0x46f8ec[_0x4385df][_0xe80a('0x5d')]()){var _0x105e40=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x3a385e);if(_0x3a385e===0x1){_0x105e40=_0xe80a('0x5e');}throw new db[(_0xe80a('0x58'))][(_0xe80a('0x59'))](_0x105e40);}}return;};exports[_0xe80a('0x5f')]=function(_0x1a3dfa,_0x3f5066){var _0x175d57=_0x3f5066?encryptor[_0xe80a('0x5b')](_0x3f5066)[_0xe80a('0x5c')](','):[];if(_0x175d57[_0xe80a('0x60')]===0x5){_0x175d57['splice'](-0x1,0x1);}_0x175d57['unshift'](_0x1a3dfa);return encryptor[_0xe80a('0x61')](_0x175d57[_0xe80a('0x62')](','));};function signJwt(_0x5b5317){var _0x5882d0=BPromise[_0xe80a('0x63')](jwt[_0xe80a('0x64')],{'context':jwt});var _0x1e43ca=_0x5b5317['secret']||config[_0xe80a('0xa')][_0xe80a('0xb')];return new BPromise(function(_0x4ff914,_0x38e363){_0x5882d0(_0x5b5317[_0xe80a('0x65')],_0x1e43ca,_0x5b5317[_0xe80a('0x66')])[_0xe80a('0x28')](function(_0x3fee44){_0x4ff914(_0x3fee44);})['catch'](function(_0xeb3162){_0x38e363(_0xeb3162);});});}function verifyJwt(_0x160cf6,_0x86bd1e,_0x58e86c){var _0x137c45=BPromise[_0xe80a('0x63')](jwt[_0xe80a('0x67')],{'context':jwt});var _0x3c3165=_0x58e86c||config[_0xe80a('0xa')][_0xe80a('0xb')];return new BPromise(function(_0x3c81b9,_0x49b292){_0x137c45(_0x160cf6,_0x3c3165,_0x86bd1e)[_0xe80a('0x28')](function(_0x1a7364){_0x3c81b9(_0x1a7364);})[_0xe80a('0x35')](function(_0x3e0863){_0x49b292(_0x3e0863);});});}function generateNonce(){return crypto[_0xe80a('0x68')](0x10)['toString'](_0xe80a('0x69'));}function generateIssuedAt(){return Math[_0xe80a('0x6a')](Date[_0xe80a('0x6b')]()/0x3e8)[_0xe80a('0x6c')]();}function createJwt(_0x4bb25e){var _0x46d211={'payload':{'iat':_0x4bb25e[_0xe80a('0x53')],'nonce':_0x4bb25e[_0xe80a('0x3d')]},'options':{'algorithm':_0xe80a('0x6d'),'subject':_0x4bb25e['id'][_0xe80a('0x6c')](),'issuer':hardwareConf[_0xe80a('0x3a')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x46d211)[_0xe80a('0x28')](function(_0x2d0cd1){return{'iat':_0x4bb25e[_0xe80a('0x53')],'nonce':_0x4bb25e[_0xe80a('0x3d')],'token':_0x2d0cd1};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 1bed75e..a7c4faf 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 _0xf514=['decryptString','secret','bluebird','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','update','end','final','binary','close','unlink','decryptFile','createReadStream','createDecipher','data','write','createCipher','utf8','base64'];(function(_0xc43651,_0x229597){var _0x355d1d=function(_0x30516b){while(--_0x30516b){_0xc43651['push'](_0xc43651['shift']());}};_0x355d1d(++_0x229597);}(_0xf514,0x8a));var _0x4f51=function(_0x2dd7f1,_0x53524a){_0x2dd7f1=_0x2dd7f1-0x0;var _0x45db0a=_0xf514[_0x2dd7f1];return _0x45db0a;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x4f51('0x0'));var _=require('lodash');var config=require(_0x4f51('0x1'));var logger=require(_0x4f51('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4f51('0x3')][_0x4f51('0x4')],'algorithm':_0x4f51('0x5')};const fileOptions={'algorithm':_0x4f51('0x6')};if(config[_0x4f51('0x7')]&&config[_0x4f51('0x7')][_0x4f51('0x8')]){var isSupported=isAlgorithmSupported(config[_0x4f51('0x7')][_0x4f51('0x8')]);if(isSupported){fileOptions[_0x4f51('0x8')]=config[_0x4f51('0x7')][_0x4f51('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4f51('0x9')](',\x20');logger[_0x4f51('0xa')](config['encrypt'][_0x4f51('0x8')],_0x4f51('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x1de1b0){return AES_SUPPORTED_RX['test'](_0x1de1b0);}function getSupportedCiphers(){return crypto[_0x4f51('0xc')]()[_0x4f51('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x49ff0f){return getSupportedCiphers()[_0x4f51('0xe')](_0x49ff0f)>-0x1;}function combineOptions(_0x215847){var _0x231f64={};for(var _0x1faad2 in fileOptions){if(fileOptions[_0x4f51('0xf')](_0x1faad2)){_0x231f64[_0x1faad2]=fileOptions[_0x1faad2];}}if(_0x215847){for(var _0x985528 in _0x215847){if(_0x215847[_0x4f51('0xf')](_0x985528)){_0x231f64[_0x985528]=_0x215847[_0x985528];}}}return _0x231f64;}exports[_0x4f51('0x10')]=function(_0x32805b,_0x541566,_0x12c98f,_0x111a23){return new BPromise(function(_0x433a25,_0x4adcff){_0x111a23=combineOptions(_0x111a23);var _0x4e4179=new Buffer(_0x12c98f);var _0x37cba1=fs['createReadStream'](_0x32805b);var _0x2cb2a9=fs[_0x4f51('0x11')](_0x541566);var _0x4a48b0=crypto['createCipher'](_0x111a23[_0x4f51('0x8')],_0x4e4179);_0x37cba1['on']('data',function(_0x349455){var _0x127dd4=new Buffer(_0x4a48b0[_0x4f51('0x12')](_0x349455),'binary');_0x2cb2a9['write'](_0x127dd4);});_0x37cba1['on'](_0x4f51('0x13'),function(){try{var _0x8f9398=new Buffer(_0x4a48b0[_0x4f51('0x14')](_0x4f51('0x15')),'binary');_0x2cb2a9['write'](_0x8f9398);_0x2cb2a9[_0x4f51('0x13')]();_0x2cb2a9['on'](_0x4f51('0x16'),function(){return _0x433a25(_0x541566);});}catch(_0x1e8e10){fs[_0x4f51('0x17')](_0x541566);return _0x4adcff(_0x1e8e10);}});});};exports[_0x4f51('0x18')]=function(_0x44fb27,_0x49978b,_0x191013,_0x5a5ac4){return new BPromise(function(_0x48c486,_0x1fd00a){_0x5a5ac4=combineOptions(_0x5a5ac4);var _0x16f4b2=new Buffer(_0x191013);var _0x57c689=fs[_0x4f51('0x19')](_0x44fb27);var _0x382f4d=fs[_0x4f51('0x11')](_0x49978b);var _0x2c4d14=crypto[_0x4f51('0x1a')](_0x5a5ac4[_0x4f51('0x8')],_0x16f4b2);_0x57c689['on'](_0x4f51('0x1b'),function(_0x3ecbea){var _0x52e36a=new Buffer(_0x2c4d14['update'](_0x3ecbea),_0x4f51('0x15'));_0x382f4d[_0x4f51('0x1c')](_0x52e36a);});_0x57c689['on'](_0x4f51('0x13'),function(){try{var _0x38d0fc=new Buffer(_0x2c4d14[_0x4f51('0x14')](_0x4f51('0x15')),_0x4f51('0x15'));_0x382f4d['write'](_0x38d0fc);_0x382f4d['end']();_0x382f4d['on'](_0x4f51('0x16'),function(){return _0x48c486(_0x49978b);});}catch(_0x558ef3){fs[_0x4f51('0x17')](_0x49978b);return _0x1fd00a(_0x558ef3);}});});};exports['encryptString']=function(_0x37d2e0,_0xabb3d6,_0xd5857c){var _0x181214=_0xd5857c||stringOptions['algorithm'];var _0x2c187b=_0xabb3d6||stringOptions['secret'];var _0x2c1008=crypto[_0x4f51('0x1d')](_0x181214,_0x2c187b);var _0x17660e=_0x2c1008[_0x4f51('0x12')](_0x37d2e0,_0x4f51('0x1e'),_0x4f51('0x1f'));_0x17660e+=_0x2c1008[_0x4f51('0x14')]('base64');return _0x17660e;};exports[_0x4f51('0x20')]=function(_0x212988,_0x553808,_0x19acbc){var _0x388f41=_0x19acbc||stringOptions[_0x4f51('0x8')];var _0x5c906c=_0x553808||stringOptions[_0x4f51('0x21')];var _0x361fc1=crypto[_0x4f51('0x1a')](_0x388f41,_0x5c906c);var _0x34d9e4=_0x361fc1[_0x4f51('0x12')](_0x212988,'base64','utf8');_0x34d9e4+=_0x361fc1[_0x4f51('0x14')]('utf8');return _0x34d9e4;}; \ No newline at end of file +var _0xb591=['final','close','unlink','decryptFile','createWriteStream','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createCipher','data','update','binary','write','end'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xb591,0x15f));var _0x1b59=function(_0xb69f5,_0x5476e8){_0xb69f5=_0xb69f5-0x0;var _0x693c8b=_0xb591[_0xb69f5];return _0x693c8b;};'use strict';var crypto=require(_0x1b59('0x0'));var fs=require('fs');var BPromise=require(_0x1b59('0x1'));var _=require(_0x1b59('0x2'));var config=require(_0x1b59('0x3'));var logger=require(_0x1b59('0x4'))(_0x1b59('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x1b59('0x6')};const fileOptions={'algorithm':_0x1b59('0x7')};if(config[_0x1b59('0x8')]&&config[_0x1b59('0x8')][_0x1b59('0x9')]){var isSupported=isAlgorithmSupported(config[_0x1b59('0x8')][_0x1b59('0x9')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x1b59('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1b59('0xa')](',\x20');logger['error'](config[_0x1b59('0x8')][_0x1b59('0x9')],_0x1b59('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x47a5a8){return AES_SUPPORTED_RX['test'](_0x47a5a8);}function getSupportedCiphers(){return crypto[_0x1b59('0xc')]()[_0x1b59('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x560ce1){return getSupportedCiphers()[_0x1b59('0xe')](_0x560ce1)>-0x1;}function combineOptions(_0x439ee9){var _0x1a841b={};for(var _0x3c5000 in fileOptions){if(fileOptions[_0x1b59('0xf')](_0x3c5000)){_0x1a841b[_0x3c5000]=fileOptions[_0x3c5000];}}if(_0x439ee9){for(var _0x53b90c in _0x439ee9){if(_0x439ee9[_0x1b59('0xf')](_0x53b90c)){_0x1a841b[_0x53b90c]=_0x439ee9[_0x53b90c];}}}return _0x1a841b;}exports['encryptFile']=function(_0x2eb012,_0x50761f,_0x1bece9,_0x37a7bc){return new BPromise(function(_0x461721,_0x3a0483){_0x37a7bc=combineOptions(_0x37a7bc);var _0x1f0915=new Buffer(_0x1bece9);var _0x400018=fs[_0x1b59('0x10')](_0x2eb012);var _0x3f3556=fs['createWriteStream'](_0x50761f);var _0x361d6=crypto[_0x1b59('0x11')](_0x37a7bc[_0x1b59('0x9')],_0x1f0915);_0x400018['on'](_0x1b59('0x12'),function(_0x2e6249){var _0x4c479e=new Buffer(_0x361d6[_0x1b59('0x13')](_0x2e6249),_0x1b59('0x14'));_0x3f3556[_0x1b59('0x15')](_0x4c479e);});_0x400018['on'](_0x1b59('0x16'),function(){try{var _0x1b21ff=new Buffer(_0x361d6[_0x1b59('0x17')](_0x1b59('0x14')),_0x1b59('0x14'));_0x3f3556[_0x1b59('0x15')](_0x1b21ff);_0x3f3556[_0x1b59('0x16')]();_0x3f3556['on'](_0x1b59('0x18'),function(){return _0x461721(_0x50761f);});}catch(_0x1e9860){fs[_0x1b59('0x19')](_0x50761f);return _0x3a0483(_0x1e9860);}});});};exports[_0x1b59('0x1a')]=function(_0x5df09d,_0x3f57cb,_0x57e26b,_0x27e28a){return new BPromise(function(_0x1ccd7c,_0x3cf1d7){_0x27e28a=combineOptions(_0x27e28a);var _0x433864=new Buffer(_0x57e26b);var _0xbfb681=fs['createReadStream'](_0x5df09d);var _0x1e5567=fs[_0x1b59('0x1b')](_0x3f57cb);var _0x2c1485=crypto[_0x1b59('0x1c')](_0x27e28a[_0x1b59('0x9')],_0x433864);_0xbfb681['on'](_0x1b59('0x12'),function(_0xb0ac1e){var _0xa1ca98=new Buffer(_0x2c1485[_0x1b59('0x13')](_0xb0ac1e),_0x1b59('0x14'));_0x1e5567[_0x1b59('0x15')](_0xa1ca98);});_0xbfb681['on'](_0x1b59('0x16'),function(){try{var _0x53cc00=new Buffer(_0x2c1485[_0x1b59('0x17')](_0x1b59('0x14')),_0x1b59('0x14'));_0x1e5567[_0x1b59('0x15')](_0x53cc00);_0x1e5567['end']();_0x1e5567['on'](_0x1b59('0x18'),function(){return _0x1ccd7c(_0x3f57cb);});}catch(_0x372b68){fs['unlink'](_0x3f57cb);return _0x3cf1d7(_0x372b68);}});});};exports[_0x1b59('0x1d')]=function(_0xf1bdf0,_0x4ddb7e,_0x511e20){var _0x2afca3=_0x511e20||stringOptions[_0x1b59('0x9')];var _0x192ae4=_0x4ddb7e||stringOptions[_0x1b59('0x1e')];var _0x11b746=crypto[_0x1b59('0x11')](_0x2afca3,_0x192ae4);var _0x1892a5=_0x11b746[_0x1b59('0x13')](_0xf1bdf0,_0x1b59('0x1f'),_0x1b59('0x20'));_0x1892a5+=_0x11b746['final'](_0x1b59('0x20'));return _0x1892a5;};exports[_0x1b59('0x21')]=function(_0x53b33a,_0x23364e,_0x185371){var _0x24f608=_0x185371||stringOptions[_0x1b59('0x9')];var _0x5c6dce=_0x23364e||stringOptions['secret'];var _0x285c74=crypto[_0x1b59('0x1c')](_0x24f608,_0x5c6dce);var _0x388d5d=_0x285c74['update'](_0x53b33a,_0x1b59('0x20'),_0x1b59('0x1f'));_0x388d5d+=_0x285c74[_0x1b59('0x17')](_0x1b59('0x1f'));return _0x388d5d;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index db7112f..a2c593e 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 _0x61fd=['path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','length','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util'];(function(_0x57aa3d,_0x4c4899){var _0x4a6cc6=function(_0x210859){while(--_0x210859){_0x57aa3d['push'](_0x57aa3d['shift']());}};_0x4a6cc6(++_0x4c4899);}(_0x61fd,0x1ca));var _0xd61f=function(_0xac547d,_0x4f0417){_0xac547d=_0xac547d-0x0;var _0x63252a=_0x61fd[_0xac547d];return _0x63252a;};'use strict';var util=require(_0xd61f('0x0'));var path=require(_0xd61f('0x1'));var _=require(_0xd61f('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xd61f('0x3'));var zipdir=require(_0xd61f('0x4'));var rimraf=require(_0xd61f('0x5'));var db=require(_0xd61f('0x6'))['db'];var dbH=require(_0xd61f('0x6'))[_0xd61f('0x7')];var logger=require('../../config/logger')(_0xd61f('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xd61f('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd61f('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x43fb38,_0xa6d820){var _0x1449b2={'status':_0x43fb38};var _0x18421d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa6d820){_0x1449b2[_0xd61f('0xa')]=_0xa6d820;}return db[_0xd61f('0xb')][_0xd61f('0xc')](_0x1449b2,_0x18421d);}function main(){var _0x5bb08a=0x1388;var _0x568c3c;logger['info'](util[_0xd61f('0xd')](_0xd61f('0xe'),EXTRACTED_REPORT_ID,_0xd61f('0xf')));return db[_0xd61f('0x10')][_0xd61f('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd61f('0x12'),_0xd61f('0x13')]})['then'](function(_0x24ba59){if(_0x24ba59){_0x568c3c=_0x24ba59;_0x5bb08a=_0x568c3c[_0xd61f('0x13')]||0x1388;}})[_0xd61f('0x14')](function(){return dbH['sequelize'][_0xd61f('0x15')](util[_0xd61f('0xd')](_0xd61f('0x16'),QUERY),{'type':dbH[_0xd61f('0x17')][_0xd61f('0x18')][_0xd61f('0x19')]});})['then'](function(_0x389763){if(!_0x389763[0x0][_0xd61f('0x1a')]){return analyticExtractedReport(_0xd61f('0x1b'));}var _0x108921=[];var _0x12c677=0x0;if(_0x568c3c['split']){if(_0x389763&&_0x389763['length']){var _0x5ca08c=_[_0xd61f('0x1c')](_0x389763[0x0][_0xd61f('0x1a')]/_0x5bb08a);var _0x4ea7f3=Number[_0xd61f('0x1d')](_0x389763[0x0][_0xd61f('0x1a')]/_0x5bb08a)?_0x389763[0x0]['num']%_0x5bb08a:0x0;_0x5ca08c[_0xd61f('0x1e')](function(_0x138afb){if(_0x138afb>0x0){_0x12c677+=_0x5bb08a;}_0x108921[_0xd61f('0x1f')](dbH[_0xd61f('0x17')]['query'](util[_0xd61f('0xd')](_0xd61f('0x20'),QUERY,_0x5bb08a,_0x12c677),{'type':dbH['sequelize'][_0xd61f('0x18')][_0xd61f('0x19')]}));});if(_0x4ea7f3>0x0){_0x12c677+=_0x5bb08a;_0x108921[_0xd61f('0x1f')](dbH[_0xd61f('0x17')]['query'](util['format'](_0xd61f('0x20'),QUERY,_0x4ea7f3,_0x12c677),{'type':dbH[_0xd61f('0x17')][_0xd61f('0x18')][_0xd61f('0x19')]}));}}}else{_0x108921['push'](dbH[_0xd61f('0x17')][_0xd61f('0x15')](QUERY,{'type':dbH[_0xd61f('0x17')][_0xd61f('0x18')]['SELECT']}));}var _0x50df66=path[_0xd61f('0x21')](PATH);var _0x32d9eb=path[_0xd61f('0x22')](PATH,'.csv');var _0x4b2ae9=_0x568c3c[_0xd61f('0x12')]&&_0x108921[_0xd61f('0x23')]>0x1;var _0x33cb81=[];if(!fs[_0xd61f('0x24')](path[_0xd61f('0x25')](_0x50df66,_0x32d9eb))&&_0x4b2ae9){fs[_0xd61f('0x26')](path['join'](_0x50df66,_0x32d9eb));}return BPromise['each'](_0x108921,function(_0x510385){_0x33cb81[_0xd61f('0x1f')](_0x510385);})[_0xd61f('0x14')](function(){for(var _0x203f1f=0x0;_0x203f1f<_0x33cb81[_0xd61f('0x23')];_0x203f1f+=0x1){var _0x4c66ff;var _0x1d24f3=_0x33cb81[_0x203f1f];if(_0x4b2ae9){_0x4c66ff=path[_0xd61f('0x25')](_0x50df66,_0x32d9eb,util[_0xd61f('0xd')](_0xd61f('0x27'),_0x32d9eb,_0x203f1f,_0xd61f('0x28')));}else{_0x4c66ff=path[_0xd61f('0x25')](_0x50df66,util[_0xd61f('0xd')](_0xd61f('0x29'),_0x32d9eb,_0xd61f('0x28')));}fs['writeFileSync'](_0x4c66ff,csv(_0x1d24f3));}})[_0xd61f('0x14')](function(){if(_0x4b2ae9){return new Promise(function(_0x51dc32){zipdir(path[_0xd61f('0x25')](_0x50df66,_0x32d9eb),{'saveTo':path[_0xd61f('0x25')](_0x50df66,util[_0xd61f('0xd')]('%s.%s',_0x32d9eb,_0xd61f('0x2a')))},function(_0x4df78b,_0x5521ec){rimraf(path[_0xd61f('0x25')](_0x50df66,_0x32d9eb),function(){});_0x51dc32('zip\x20finished');});});}})[_0xd61f('0x14')](function(){logger['info'](util[_0xd61f('0xd')](_0xd61f('0x2b'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xd61f('0x2c'),_0x4b2ae9?util['format'](_0xd61f('0x29'),_0x32d9eb,_0x4b2ae9?'zip':'csv'):null);});})[_0xd61f('0x2d')](function(_0x519309){logger[_0xd61f('0x2e')](util[_0xd61f('0xd')](_0xd61f('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util[_0xd61f('0x30')](_0x519309,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xd61f('0x31')](function(){process[_0xd61f('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5922=['../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','sequelize','query','QueryTypes','then','Empty','length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.csv','existsSync','join','each','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','rimraf'];(function(_0x136937,_0x25cc44){var _0x2800f6=function(_0x3eaaa1){while(--_0x3eaaa1){_0x136937['push'](_0x136937['shift']());}};_0x2800f6(++_0x25cc44);}(_0x5922,0x109));var _0x2592=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x5922[_0x334841];return _0x5beb4b;};'use strict';var util=require(_0x2592('0x0'));var path=require(_0x2592('0x1'));var _=require(_0x2592('0x2'));var csv=require(_0x2592('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x2592('0x4'));var db=require(_0x2592('0x5'))['db'];var dbH=require(_0x2592('0x5'))[_0x2592('0x6')];var logger=require(_0x2592('0x7'))(_0x2592('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2592('0x9')][0x3];var PATH=process[_0x2592('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x205e93,_0x254f88){var _0x1dcaf9={'status':_0x205e93};var _0x2d95ed={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x254f88){_0x1dcaf9[_0x2592('0xa')]=_0x254f88;}return db[_0x2592('0xb')]['update'](_0x1dcaf9,_0x2d95ed);}function main(){var _0x541610=0x1388;var _0x47202a;logger[_0x2592('0xc')](util[_0x2592('0xd')](_0x2592('0xe'),EXTRACTED_REPORT_ID,_0x2592('0xf')));return db[_0x2592('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2592('0x11'),_0x2592('0x12')]})['then'](function(_0x4d2e1c){if(_0x4d2e1c){_0x47202a=_0x4d2e1c;_0x541610=_0x47202a['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x2592('0x13')][_0x2592('0x14')](util[_0x2592('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x2592('0x13')][_0x2592('0x15')]['SELECT']});})[_0x2592('0x16')](function(_0xcc1941){if(!_0xcc1941[0x0]['num']){return analyticExtractedReport(_0x2592('0x17'));}var _0x13ea40=[];var _0x109b17=0x0;if(_0x47202a[_0x2592('0x11')]){if(_0xcc1941&&_0xcc1941[_0x2592('0x18')]){var _0x4ddc5b=_[_0x2592('0x19')](_0xcc1941[0x0][_0x2592('0x1a')]/_0x541610);var _0x4ff9e1=Number[_0x2592('0x1b')](_0xcc1941[0x0]['num']/_0x541610)?_0xcc1941[0x0][_0x2592('0x1a')]%_0x541610:0x0;_0x4ddc5b['forEach'](function(_0x5e70e1){if(_0x5e70e1>0x0){_0x109b17+=_0x541610;}_0x13ea40[_0x2592('0x1c')](dbH['sequelize'][_0x2592('0x14')](util[_0x2592('0xd')](_0x2592('0x1d'),QUERY,_0x541610,_0x109b17),{'type':dbH[_0x2592('0x13')][_0x2592('0x15')][_0x2592('0x1e')]}));});if(_0x4ff9e1>0x0){_0x109b17+=_0x541610;_0x13ea40[_0x2592('0x1c')](dbH[_0x2592('0x13')][_0x2592('0x14')](util[_0x2592('0xd')](_0x2592('0x1d'),QUERY,_0x4ff9e1,_0x109b17),{'type':dbH[_0x2592('0x13')]['QueryTypes']['SELECT']}));}}}else{_0x13ea40[_0x2592('0x1c')](dbH[_0x2592('0x13')][_0x2592('0x14')](QUERY,{'type':dbH[_0x2592('0x13')]['QueryTypes'][_0x2592('0x1e')]}));}var _0x14353a=path['dirname'](PATH);var _0x5e19ce=path[_0x2592('0x1f')](PATH,_0x2592('0x20'));var _0x7e8789=_0x47202a[_0x2592('0x11')]&&_0x13ea40[_0x2592('0x18')]>0x1;var _0x2acefb=[];if(!fs[_0x2592('0x21')](path[_0x2592('0x22')](_0x14353a,_0x5e19ce))&&_0x7e8789){fs['mkdirSync'](path['join'](_0x14353a,_0x5e19ce));}return BPromise[_0x2592('0x23')](_0x13ea40,function(_0x1a24d3){_0x2acefb[_0x2592('0x1c')](_0x1a24d3);})['then'](function(){for(var _0x13d478=0x0;_0x13d478<_0x2acefb[_0x2592('0x18')];_0x13d478+=0x1){var _0x238687;var _0x43afc6=_0x2acefb[_0x13d478];if(_0x7e8789){_0x238687=path['join'](_0x14353a,_0x5e19ce,util['format']('%s%d.%s',_0x5e19ce,_0x13d478,_0x2592('0x24')));}else{_0x238687=path['join'](_0x14353a,util['format'](_0x2592('0x25'),_0x5e19ce,_0x2592('0x24')));}fs[_0x2592('0x26')](_0x238687,csv(_0x43afc6));}})[_0x2592('0x16')](function(){if(_0x7e8789){return new Promise(function(_0x4bfcd7){zipdir(path[_0x2592('0x22')](_0x14353a,_0x5e19ce),{'saveTo':path[_0x2592('0x22')](_0x14353a,util[_0x2592('0xd')](_0x2592('0x25'),_0x5e19ce,'zip'))},function(_0x580833,_0x54c4b4){rimraf(path['join'](_0x14353a,_0x5e19ce),function(){});_0x4bfcd7('zip\x20finished');});});}})[_0x2592('0x16')](function(){logger[_0x2592('0xc')](util[_0x2592('0xd')](_0x2592('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x7e8789?util[_0x2592('0xd')]('%s.%s',_0x5e19ce,_0x7e8789?_0x2592('0x28'):'csv'):null);});})['catch'](function(_0x5025b9){logger[_0x2592('0xc')](util[_0x2592('0xd')](_0x2592('0x29'),EXTRACTED_REPORT_ID,_0x2592('0xf')),util[_0x2592('0x2a')](_0x5025b9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2592('0x2b'));})[_0x2592('0x2c')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 441db19..f250b78 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 _0x7033=['center','Interaction\x20Transcript','header','finish','error','createPdfFromHTML','createPdfKitDocument','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','../../config/logger','analytics','argv','savename','map','toString','value','fill','length','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','before','margin','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','split','then','splitSizePdf','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','sequelize','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','zip','info','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','PDF','inspect','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7033,0x103));var _0x3703=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7033[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x3703('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x3703('0x1'));var moment=require(_0x3703('0x2'));var htmlToPdfmake=require(_0x3703('0x3'));var PdfPrinter=require(_0x3703('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x3703('0x5'));var JSDOM=require(_0x3703('0x6'))[_0x3703('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0x3703('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0x3703('0x9'))['dbH'];var logger=require(_0x3703('0xa'))(_0x3703('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x3703('0xc')][0x4];var NAME=process[_0x3703('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x215857,_0x503d7d){var _0x3b1e9b={'status':_0x215857};var _0x4a35d9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x503d7d){_0x3b1e9b[_0x3703('0xd')]=_0x503d7d;}return db['AnalyticExtractedReport']['update'](_0x3b1e9b,_0x4a35d9);}function getHeaders(_0x611d28){return _['map'](_0x611d28,function(_0x2771bf){return{'text':_0x2771bf,'style':'tableHeader'};});}function getRows(_0xf47180,_0x2217a9){return _[_0x3703('0xe')](_0x2217a9,function(_0xfd6e2d){return _(_0xfd6e2d)['pick'](_0xf47180)[_0x3703('0xe')](function(_0x50c621){return _0x50c621?_[_0x3703('0xf')](_0x50c621):'';})[_0x3703('0x10')]();});}function createTable(_0x4577a5,_0x5d47ed){var _0x5289ef={'widths':_[_0x3703('0x11')](Array(_0x4577a5[_0x3703('0x12')]),0x91),'heights':function(_0x4165ca){return _0x4165ca===0x0?_0x3703('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x17aea9=getHeaders(_0x4577a5);_0x5289ef[_0x3703('0x14')][_0x3703('0x15')](_0x17aea9);var _0x4ecb40=getRows(_0x4577a5,_0x5d47ed);_0x5289ef['body']=_0x5289ef[_0x3703('0x14')][_0x3703('0x16')](_0x4ecb40);return _0x5289ef;}function createTables(_0x361f6b){var _0xe2bcea=[];var _0x1574fe=_[_0x3703('0x17')](Object[_0x3703('0x18')](_0x361f6b[0x0]),0x5);_0x1574fe['forEach'](function(_0x47097a){_0xe2bcea['push'](createTable(_0x47097a,_0x361f6b));});return _0xe2bcea;}function getPDFDocDefinition(_0x183265){var _0x476941=util[_0x3703('0x19')](_0x3703('0x1a'),NAME,EXTRACTED_REPORT[_0x3703('0x1b')],moment(EXTRACTED_REPORT[_0x3703('0x1c')])[_0x3703('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x3703('0x1d')])[_0x3703('0x19')](FORMAT));var _0x25933f=[];for(var _0x357506=0x0;_0x357506<_0x183265['length'];_0x357506++){var _0x2bfe67=[];if(_0x357506===0x0){_0x2bfe67['push']({'text':_0x476941,'style':'header'});}var _0x5984b5={'table':_0x183265[_0x357506]};if(_0x357506>0x0){_0x5984b5['pageBreak']=_0x3703('0x1e');_0x5984b5[_0x3703('0x1f')]=[0x0,0x46,0x0,0x0];}_0x2bfe67[_0x3703('0x15')](_0x5984b5);_0x25933f[_0x3703('0x15')](_0x2bfe67);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x25933f,'footer':function(_0x149077,_0x3e54b8){return{'text':_0x149077[_0x3703('0xf')]()+_0x3703('0x20')+_0x3e54b8,'style':_0x3703('0x21')};},'defaultStyle':{'font':_0x3703('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3703('0x23')},'footer':{'alignment':_0x3703('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x397062){var _0x2f8e28=0x1388;var _0x162c53;if(!_0x397062[0x0][_0x3703('0x25')]){return analyticExtractedReport(_0x3703('0x26'));}return db[_0x3703('0x27')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3703('0x28'),'splitSizePdf']})[_0x3703('0x29')](function(_0x5107aa){if(_0x5107aa){_0x162c53=_0x5107aa;_0x2f8e28=_0x162c53[_0x3703('0x2a')]||0x3e8;}})[_0x3703('0x29')](function(){var _0x375d99=[];var _0x1de5cc=0x0;if(_0x162c53[_0x3703('0x28')]){if(_0x397062&&_0x397062[_0x3703('0x12')]){var _0x488e39=_['range'](_0x397062[0x0][_0x3703('0x25')]/_0x2f8e28);var _0x16e731=Number['isInteger'](_0x397062[0x0]['num']/_0x2f8e28)?_0x397062[0x0][_0x3703('0x25')]%_0x2f8e28:0x0;_0x488e39[_0x3703('0x2b')](function(_0x1002bd){if(_0x1002bd>0x0){_0x1de5cc+=_0x2f8e28;}_0x375d99['push'](dbH['sequelize'][_0x3703('0x2c')](util[_0x3703('0x19')](_0x3703('0x2d'),QUERY,_0x2f8e28,_0x1de5cc),{'type':dbH['sequelize'][_0x3703('0x2e')]['SELECT']}));});if(_0x16e731>0x0){_0x1de5cc+=_0x2f8e28;_0x375d99[_0x3703('0x15')](dbH[_0x3703('0x2f')]['query'](util[_0x3703('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x16e731,_0x1de5cc),{'type':dbH[_0x3703('0x2f')][_0x3703('0x2e')][_0x3703('0x30')]}));}}}else{_0x375d99[_0x3703('0x15')](dbH[_0x3703('0x2f')][_0x3703('0x2c')](QUERY,{'type':dbH['sequelize'][_0x3703('0x2e')]['SELECT']}));}var _0x503f3f=path[_0x3703('0x31')](PATH);var _0x524c0a=path[_0x3703('0x32')](PATH,_0x3703('0x33'));var _0xfca9a8=_0x162c53[_0x3703('0x28')]&&_0x375d99['length']>0x1;var _0xd4fcde=[];if(!fs[_0x3703('0x34')](path[_0x3703('0x35')](_0x503f3f,_0x524c0a))&&_0xfca9a8){fs[_0x3703('0x36')](path[_0x3703('0x35')](_0x503f3f,_0x524c0a));}return BPromise[_0x3703('0x37')](_0x375d99,function(_0x480d3f){_0xd4fcde['push'](_0x480d3f);})[_0x3703('0x29')](function(){var _0x2e29ee=[];for(var _0x20d62d=0x0;_0x20d62d<_0xd4fcde[_0x3703('0x12')];_0x20d62d+=0x1){var _0x12c1f2=_0xd4fcde[_0x20d62d];var _0x59ed56=createTables(_[_0x3703('0x38')](_0x12c1f2));var _0x23ab0d;var _0x56553f=getPDFDocDefinition(_0x59ed56);var _0x1a399c=getPDFPrinter();var _0x166b07=_0x1a399c['createPdfKitDocument'](_0x56553f);if(_0xfca9a8){_0x23ab0d=path['join'](_0x503f3f,_0x524c0a,util[_0x3703('0x19')](_0x3703('0x39'),_0x524c0a,_0x20d62d,_0x3703('0x3a')));}else{_0x23ab0d=path['join'](_0x503f3f,util['format'](_0x3703('0x3b'),_0x524c0a,_0x3703('0x3a')));}_0x2e29ee[_0x3703('0x15')](writePDFDocument(_0x166b07,_0x23ab0d));}return Promise['all'](_0x2e29ee);})['then'](function(){if(_0xfca9a8){return new Promise(function(_0x19bcfe){zipdir(path[_0x3703('0x35')](_0x503f3f,_0x524c0a),{'saveTo':path[_0x3703('0x35')](_0x503f3f,util[_0x3703('0x19')](_0x3703('0x3b'),_0x524c0a,_0x3703('0x3c')))},function(){rimraf(path[_0x3703('0x35')](_0x503f3f,_0x524c0a),function(){});_0x19bcfe('zip\x20finished');});});}})[_0x3703('0x29')](function(){if(!_0xfca9a8)return;rimraf(path['join'](_0x503f3f,_0x524c0a),function(){});})[_0x3703('0x29')](function(){logger[_0x3703('0x3d')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x3703('0x3e'),_0xfca9a8?util[_0x3703('0x19')](_0x3703('0x3b'),_0x524c0a,_0xfca9a8?_0x3703('0x3c'):_0x3703('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3703('0x3d')](util['format'](_0x3703('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x3703('0x40')][_0x3703('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3703('0x29')](function(_0x31e56c){EXTRACTED_REPORT=_0x31e56c;return dbH['sequelize'][_0x3703('0x2c')](util['format'](_0x3703('0x42'),QUERY),{'type':dbH['sequelize'][_0x3703('0x2e')]['SELECT']});})[_0x3703('0x29')](extractReport)[_0x3703('0x43')](function(_0x2d959d){logger[_0x3703('0x3d')](util[_0x3703('0x19')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3703('0x44')),util[_0x3703('0x45')](_0x2d959d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x3703('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4f71de=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x3703('0x47'),'bolditalics':__dirname+_0x3703('0x48')}});return _0x4f71de;}function getPDFDocDefinitionFromHTML(_0xc39336,_0x47bf2f){var _0x1bde43=util[_0x3703('0x19')](_0x3703('0x49'),_0x47bf2f[_0x3703('0x4a')],_0x47bf2f[_0x3703('0x4b')]);var _0x28b56b=moment()[_0x3703('0x19')](_0x3703('0x4c'))[_0x3703('0xf')]();var _0x3b952d=htmlToPdfmake(_0xc39336,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3b952d],'defaultStyle':{'font':_0x3703('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3703('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3703('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3703('0x4d')}},'header':function(){return[{'text':_0x3703('0x4e'),'style':_0x3703('0x4f')}];},'footer':function(_0x42f305,_0x31df0b){return[{'text':util[_0x3703('0x19')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x1bde43,_0x42f305,_0x31df0b,_0x28b56b),'style':_0x3703('0x21')}];}};}function writePDFDocument(_0x3447fc,_0x2434fc){return new Promise(function(_0x5043bc,_0x1abcce){var _0xec8b73=_0x3447fc['pipe'](fs['createWriteStream'](_0x2434fc));_0xec8b73['on']('finish',function(){_0x5043bc(_0x3703('0x50'));});_0xec8b73['on'](_0x3703('0x51'),function(_0x137744){_0x1abcce(_0x137744);});_0x3447fc['end']();});}exports[_0x3703('0x52')]=function(_0x3aa7f1,_0x2143af){var _0x3345bf=getPDFPrinter();var _0x59120c=getPDFDocDefinitionFromHTML(_0x3aa7f1,_0x2143af);var _0x3cbc79=_0x3345bf[_0x3703('0x53')](_0x59120c);return writePDFDocument(_0x3cbc79,_0x2143af[_0x3703('0x1')])[_0x3703('0x43')](function(_0x7913a7){throw _0x7913a7;});}; \ No newline at end of file +var _0x15bd=['right','Empty','Setting','split','splitSizePdf','then','range','num','isInteger','query','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','map','tableHeader','toString','fill','auto','body','push','concat','chunk','name','startDate','format','endDate','length','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black'];(function(_0x430b24,_0x1f085e){var _0x5cee14=function(_0x15fcf4){while(--_0x15fcf4){_0x430b24['push'](_0x430b24['shift']());}};_0x5cee14(++_0x1f085e);}(_0x15bd,0x8f));var _0xd15b=function(_0x5ece84,_0xc06c9f){_0x5ece84=_0x5ece84-0x0;var _0x2a12c4=_0x15bd[_0x5ece84];return _0x2a12c4;};'use strict';var _=require(_0xd15b('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xd15b('0x1'));var moment=require(_0xd15b('0x2'));var htmlToPdfmake=require(_0xd15b('0x3'));var PdfPrinter=require(_0xd15b('0x4'));var zipdir=require(_0xd15b('0x5'));var rimraf=require(_0xd15b('0x6'));var JSDOM=require(_0xd15b('0x7'))[_0xd15b('0x8')];var window=new JSDOM('')[_0xd15b('0x9')];var BPromise=require('bluebird');var db=require(_0xd15b('0xa'))['db'];var dbH=require(_0xd15b('0xa'))[_0xd15b('0xb')];var logger=require('../../config/logger')(_0xd15b('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xd15b('0xd')][0x2]);var QUERY=process[_0xd15b('0xd')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xd15b('0xd')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x28089e,_0x8cffda){var _0x201a21={'status':_0x28089e};var _0x4ab59d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8cffda){_0x201a21['savename']=_0x8cffda;}return db[_0xd15b('0xe')]['update'](_0x201a21,_0x4ab59d);}function getHeaders(_0x1416d1){return _[_0xd15b('0xf')](_0x1416d1,function(_0x4adcd0){return{'text':_0x4adcd0,'style':_0xd15b('0x10')};});}function getRows(_0x81346c,_0x283acd){return _[_0xd15b('0xf')](_0x283acd,function(_0x1ccc8b){return _(_0x1ccc8b)['pick'](_0x81346c)[_0xd15b('0xf')](function(_0x5125bb){return _0x5125bb?_[_0xd15b('0x11')](_0x5125bb):'';})['value']();});}function createTable(_0x394378,_0x36b2c5){var _0x13744c={'widths':_[_0xd15b('0x12')](Array(_0x394378['length']),0x91),'heights':function(_0x5dfbcd){return _0x5dfbcd===0x0?_0xd15b('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3c38d6=getHeaders(_0x394378);_0x13744c[_0xd15b('0x14')][_0xd15b('0x15')](_0x3c38d6);var _0xaa1ff=getRows(_0x394378,_0x36b2c5);_0x13744c[_0xd15b('0x14')]=_0x13744c['body'][_0xd15b('0x16')](_0xaa1ff);return _0x13744c;}function createTables(_0x3b0aea){var _0x18c8c3=[];var _0x1caf45=_[_0xd15b('0x17')](Object['keys'](_0x3b0aea[0x0]),0x5);_0x1caf45['forEach'](function(_0x468baa){_0x18c8c3[_0xd15b('0x15')](createTable(_0x468baa,_0x3b0aea));});return _0x18c8c3;}function getPDFDocDefinition(_0x3b8758){var _0x5577ce=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xd15b('0x18')],moment(EXTRACTED_REPORT[_0xd15b('0x19')])[_0xd15b('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xd15b('0x1b')])[_0xd15b('0x1a')](FORMAT));var _0x5ea675=[];for(var _0xcd3185=0x0;_0xcd3185<_0x3b8758[_0xd15b('0x1c')];_0xcd3185++){var _0x2f00a9=[];if(_0xcd3185===0x0){_0x2f00a9['push']({'text':_0x5577ce,'style':_0xd15b('0x1d')});}var _0x38f569={'table':_0x3b8758[_0xcd3185]};if(_0xcd3185>0x0){_0x38f569[_0xd15b('0x1e')]=_0xd15b('0x1f');_0x38f569[_0xd15b('0x20')]=[0x0,0x46,0x0,0x0];}_0x2f00a9[_0xd15b('0x15')](_0x38f569);_0x5ea675['push'](_0x2f00a9);}return{'pageSize':'A4','pageOrientation':_0xd15b('0x21'),'content':_0x5ea675,'footer':function(_0x51488f,_0x11f7ab){return{'text':_0x51488f[_0xd15b('0x11')]()+_0xd15b('0x22')+_0x11f7ab,'style':'footer'};},'defaultStyle':{'font':_0xd15b('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd15b('0x24')},'footer':{'alignment':_0xd15b('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5e96a9){var _0x40daf=0x1388;var _0x543392;if(!_0x5e96a9[0x0]['num']){return analyticExtractedReport(_0xd15b('0x26'));}return db[_0xd15b('0x27')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd15b('0x28'),_0xd15b('0x29')]})[_0xd15b('0x2a')](function(_0x314a68){if(_0x314a68){_0x543392=_0x314a68;_0x40daf=_0x543392[_0xd15b('0x29')]||0x3e8;}})['then'](function(){var _0x36c21d=[];var _0x35a1d3=0x0;if(_0x543392[_0xd15b('0x28')]){if(_0x5e96a9&&_0x5e96a9[_0xd15b('0x1c')]){var _0x2bf38e=_[_0xd15b('0x2b')](_0x5e96a9[0x0][_0xd15b('0x2c')]/_0x40daf);var _0x558a0e=Number[_0xd15b('0x2d')](_0x5e96a9[0x0][_0xd15b('0x2c')]/_0x40daf)?_0x5e96a9[0x0]['num']%_0x40daf:0x0;_0x2bf38e['forEach'](function(_0x2b28f6){if(_0x2b28f6>0x0){_0x35a1d3+=_0x40daf;}_0x36c21d['push'](dbH['sequelize'][_0xd15b('0x2e')](util[_0xd15b('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x40daf,_0x35a1d3),{'type':dbH['sequelize']['QueryTypes'][_0xd15b('0x2f')]}));});if(_0x558a0e>0x0){_0x35a1d3+=_0x40daf;_0x36c21d[_0xd15b('0x15')](dbH['sequelize'][_0xd15b('0x2e')](util[_0xd15b('0x1a')](_0xd15b('0x30'),QUERY,_0x558a0e,_0x35a1d3),{'type':dbH[_0xd15b('0x31')][_0xd15b('0x32')][_0xd15b('0x2f')]}));}}}else{_0x36c21d[_0xd15b('0x15')](dbH[_0xd15b('0x31')][_0xd15b('0x2e')](QUERY,{'type':dbH[_0xd15b('0x31')]['QueryTypes']['SELECT']}));}var _0xcf393f=path[_0xd15b('0x33')](PATH);var _0x2eeac0=path[_0xd15b('0x34')](PATH,_0xd15b('0x35'));var _0x47cfed=_0x543392[_0xd15b('0x28')]&&_0x36c21d[_0xd15b('0x1c')]>0x1;var _0x31b6fb=[];if(!fs[_0xd15b('0x36')](path[_0xd15b('0x37')](_0xcf393f,_0x2eeac0))&&_0x47cfed){fs[_0xd15b('0x38')](path[_0xd15b('0x37')](_0xcf393f,_0x2eeac0));}return BPromise[_0xd15b('0x39')](_0x36c21d,function(_0x4f7b7b){_0x31b6fb[_0xd15b('0x15')](_0x4f7b7b);})[_0xd15b('0x2a')](function(){var _0x2da27e=[];for(var _0x55a482=0x0;_0x55a482<_0x31b6fb[_0xd15b('0x1c')];_0x55a482+=0x1){var _0x1c0335=_0x31b6fb[_0x55a482];var _0x37746e=createTables(_[_0xd15b('0x3a')](_0x1c0335));var _0x22505d;var _0x14d1ad=getPDFDocDefinition(_0x37746e);var _0x2a100e=getPDFPrinter();var _0x3aff41=_0x2a100e[_0xd15b('0x3b')](_0x14d1ad);if(_0x47cfed){_0x22505d=path[_0xd15b('0x37')](_0xcf393f,_0x2eeac0,util[_0xd15b('0x1a')](_0xd15b('0x3c'),_0x2eeac0,_0x55a482,_0xd15b('0x3d')));}else{_0x22505d=path['join'](_0xcf393f,util['format'](_0xd15b('0x3e'),_0x2eeac0,'pdf'));}_0x2da27e[_0xd15b('0x15')](writePDFDocument(_0x3aff41,_0x22505d));}return Promise[_0xd15b('0x3f')](_0x2da27e);})[_0xd15b('0x2a')](function(){if(_0x47cfed){return new Promise(function(_0x3b5efd){zipdir(path[_0xd15b('0x37')](_0xcf393f,_0x2eeac0),{'saveTo':path[_0xd15b('0x37')](_0xcf393f,util[_0xd15b('0x1a')](_0xd15b('0x3e'),_0x2eeac0,'zip'))},function(){rimraf(path[_0xd15b('0x37')](_0xcf393f,_0x2eeac0),function(){});_0x3b5efd('zip\x20finished');});});}})[_0xd15b('0x2a')](function(){if(!_0x47cfed)return;rimraf(path[_0xd15b('0x37')](_0xcf393f,_0x2eeac0),function(){});})[_0xd15b('0x2a')](function(){logger[_0xd15b('0x40')](util['format'](_0xd15b('0x41'),EXTRACTED_REPORT_ID,_0xd15b('0x42')));return analyticExtractedReport(_0xd15b('0x43'),_0x47cfed?util[_0xd15b('0x1a')](_0xd15b('0x3e'),_0x2eeac0,_0x47cfed?_0xd15b('0x44'):_0xd15b('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd15b('0x40')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd15b('0x42')));return db[_0xd15b('0xe')][_0xd15b('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2368d5){EXTRACTED_REPORT=_0x2368d5;return dbH[_0xd15b('0x31')][_0xd15b('0x2e')](util[_0xd15b('0x1a')](_0xd15b('0x46'),QUERY),{'type':dbH[_0xd15b('0x31')][_0xd15b('0x32')]['SELECT']});})[_0xd15b('0x2a')](extractReport)[_0xd15b('0x47')](function(_0x1d905a){logger['info'](util[_0xd15b('0x1a')](_0xd15b('0x48'),EXTRACTED_REPORT_ID,_0xd15b('0x42')),util[_0xd15b('0x49')](_0x1d905a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd15b('0x4a'));})['finally'](function(){process[_0xd15b('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x145168=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xd15b('0x4c'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x145168;}function getPDFDocDefinitionFromHTML(_0x35e99b,_0x986b2){var _0x5ec448=util[_0xd15b('0x1a')](_0xd15b('0x4d'),_0x986b2['channel'],_0x986b2[_0xd15b('0x4e')]);var _0x2802ff=moment()[_0xd15b('0x1a')](_0xd15b('0x4f'))[_0xd15b('0x11')]();var _0x448671=htmlToPdfmake(_0x35e99b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x448671],'defaultStyle':{'font':_0xd15b('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd15b('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd15b('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd15b('0x50')}},'header':function(){return[{'text':_0xd15b('0x51'),'style':'header'}];},'footer':function(_0x36ec36,_0x1e6032){return[{'text':util[_0xd15b('0x1a')](_0xd15b('0x52'),_0x5ec448,_0x36ec36,_0x1e6032,_0x2802ff),'style':_0xd15b('0x53')}];}};}function writePDFDocument(_0xf5b3f3,_0x51cfec){return new Promise(function(_0x5cbe3d,_0x33f235){var _0x23d60d=_0xf5b3f3[_0xd15b('0x54')](fs[_0xd15b('0x55')](_0x51cfec));_0x23d60d['on']('finish',function(){_0x5cbe3d(_0xd15b('0x56'));});_0x23d60d['on'](_0xd15b('0x57'),function(_0x4bdabb){_0x33f235(_0x4bdabb);});_0xf5b3f3[_0xd15b('0x58')]();});}exports[_0xd15b('0x59')]=function(_0x1c2cff,_0x227fe6){var _0x58854c=getPDFPrinter();var _0x415f6f=getPDFDocDefinitionFromHTML(_0x1c2cff,_0x227fe6);var _0x1b6c30=_0x58854c['createPdfKitDocument'](_0x415f6f);return writePDFDocument(_0x1b6c30,_0x227fe6[_0xd15b('0x1')])[_0xd15b('0x47')](function(_0x1ad25f){throw _0x1ad25f;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 4427e2a..14d5c5e 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 _0x2d87=['query','SELECT','then','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','%s.%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','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','sequelize'];(function(_0x1dfd1c,_0x2ed7ad){var _0x410a38=function(_0x58a1b0){while(--_0x58a1b0){_0x1dfd1c['push'](_0x1dfd1c['shift']());}};_0x410a38(++_0x2ed7ad);}(_0x2d87,0x84));var _0x72d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2d87[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x72d8('0x0'));var path=require(_0x72d8('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x72d8('0x2'));var rimraf=require(_0x72d8('0x3'));var db=require(_0x72d8('0x4'))['db'];var dbH=require('../../mysqldb')[_0x72d8('0x5')];var logger=require(_0x72d8('0x6'))(_0x72d8('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x72d8('0x8')][0x2]);var QUERY=process[_0x72d8('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x263b92,_0x759949){var _0x40edcb={'status':_0x263b92};var _0x4700e3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x759949){_0x40edcb['savename']=_0x759949;}return db[_0x72d8('0x9')]['update'](_0x40edcb,_0x4700e3);}function main(){var _0x311c7d=0x1388;var _0xbaafdf;logger[_0x72d8('0xa')](util[_0x72d8('0xb')](_0x72d8('0xc'),EXTRACTED_REPORT_ID,_0x72d8('0xd')));return db['Setting'][_0x72d8('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x72d8('0xf'),_0x72d8('0x10')]})['then'](function(_0x415659){if(_0x415659){_0xbaafdf=_0x415659;_0x311c7d=_0xbaafdf[_0x72d8('0x10')]||0x1388;}})['then'](function(){return dbH[_0x72d8('0x11')][_0x72d8('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x72d8('0x13')]});})[_0x72d8('0x14')](function(_0xdb76ba){if(!_0xdb76ba[0x0][_0x72d8('0x15')]){return analyticExtractedReport(_0x72d8('0x16'));}var _0x346237=[];var _0x557db4=0x0;if(_0xbaafdf[_0x72d8('0xf')]){if(_0xdb76ba&&_0xdb76ba[_0x72d8('0x17')]){var _0x193c68=_[_0x72d8('0x18')](_0xdb76ba[0x0][_0x72d8('0x15')]/_0x311c7d);var _0x12c2fa=Number[_0x72d8('0x19')](_0xdb76ba[0x0]['num']/_0x311c7d)?_0xdb76ba[0x0]['num']%_0x311c7d:0x0;_0x193c68['forEach'](function(_0x41cf79){if(_0x41cf79>0x0){_0x557db4+=_0x311c7d;}_0x346237[_0x72d8('0x1a')](dbH[_0x72d8('0x11')]['query'](util['format'](_0x72d8('0x1b'),QUERY,_0x311c7d,_0x557db4),{'type':dbH[_0x72d8('0x11')][_0x72d8('0x1c')]['SELECT']}));});if(_0x12c2fa>0x0){_0x557db4+=_0x311c7d;_0x346237[_0x72d8('0x1a')](dbH[_0x72d8('0x11')][_0x72d8('0x12')](util[_0x72d8('0xb')](_0x72d8('0x1b'),QUERY,_0x12c2fa,_0x557db4),{'type':dbH[_0x72d8('0x11')]['QueryTypes'][_0x72d8('0x13')]}));}}}else{_0x346237['push'](dbH['sequelize'][_0x72d8('0x12')](QUERY,{'type':dbH[_0x72d8('0x11')]['QueryTypes'][_0x72d8('0x13')]}));}var _0x3cbb4b=path[_0x72d8('0x1d')](PATH);var _0x44cf63=path[_0x72d8('0x1e')](PATH,_0x72d8('0x1f'));var _0x44ec48=_0xbaafdf[_0x72d8('0xf')]&&_0x346237[_0x72d8('0x17')]>0x1;var _0x32e04d=[];if(!fs[_0x72d8('0x20')](path['join'](_0x3cbb4b,_0x44cf63))&&_0x44ec48){fs[_0x72d8('0x21')](path[_0x72d8('0x22')](_0x3cbb4b,_0x44cf63));}return BPromise[_0x72d8('0x23')](_0x346237,function(_0x29b487){_0x32e04d[_0x72d8('0x1a')](_0x29b487);})[_0x72d8('0x14')](function(){for(var _0x4596a6=0x0;_0x4596a6<_0x32e04d[_0x72d8('0x17')];_0x4596a6+=0x1){var _0x42bb14;var _0x597ee4=_0x32e04d[_0x4596a6];if(_0x44ec48){_0x42bb14=path[_0x72d8('0x22')](_0x3cbb4b,_0x44cf63,util[_0x72d8('0xb')](_0x72d8('0x24'),_0x44cf63,_0x4596a6,'xlsx'));}else{_0x42bb14=path[_0x72d8('0x22')](_0x3cbb4b,util[_0x72d8('0xb')](_0x72d8('0x25'),_0x44cf63,_0x72d8('0x26')));}fs[_0x72d8('0x27')](_0x42bb14,json2xls(_0x597ee4),_0x72d8('0x28'));}})[_0x72d8('0x14')](function(){if(_0x44ec48){return new Promise(function(_0xe9c40d){zipdir(path[_0x72d8('0x22')](_0x3cbb4b,_0x44cf63),{'saveTo':path[_0x72d8('0x22')](_0x3cbb4b,util[_0x72d8('0xb')](_0x72d8('0x25'),_0x44cf63,_0x72d8('0x29')))},function(_0x16385a,_0x172b64){rimraf(path['join'](_0x3cbb4b,_0x44cf63),function(){});_0xe9c40d(_0x72d8('0x2a'));});});}})['then'](function(){logger[_0x72d8('0xa')](util[_0x72d8('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x72d8('0xd')));return analyticExtractedReport(_0x72d8('0x2b'),_0x44ec48?util['format'](_0x72d8('0x25'),_0x44cf63,_0x44ec48?_0x72d8('0x29'):_0x72d8('0x26')):null);});})[_0x72d8('0x2c')](function(_0x5b99ea){logger[_0x72d8('0xa')](util[_0x72d8('0xb')](_0x72d8('0x2d'),EXTRACTED_REPORT_ID,_0x72d8('0xd')),util[_0x72d8('0x2e')](_0x5b99ea,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x72d8('0x2f'));})[_0x72d8('0x30')](function(){process[_0x72d8('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4eaf=['dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT','num','Empty','length','range','isInteger','QueryTypes','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','join','mkdirSync','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','json2xls','zip-dir'];(function(_0x3468d3,_0x5f0f55){var _0x549184=function(_0x11c8a1){while(--_0x11c8a1){_0x3468d3['push'](_0x3468d3['shift']());}};_0x549184(++_0x5f0f55);}(_0x4eaf,0x199));var _0xf4ea=function(_0x338e30,_0x5a13d9){_0x338e30=_0x338e30-0x0;var _0x670385=_0x4eaf[_0x338e30];return _0x670385;};'use strict';var util=require(_0xf4ea('0x0'));var path=require(_0xf4ea('0x1'));var _=require(_0xf4ea('0x2'));var fs=require('fs');var json2xls=require(_0xf4ea('0x3'));var BPromise=require('bluebird');var zipdir=require(_0xf4ea('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf4ea('0x5')];var logger=require(_0xf4ea('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xf4ea('0x7')][0x2]);var QUERY=process[_0xf4ea('0x7')][0x3];var PATH=process[_0xf4ea('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x168e4b,_0x5744c9){var _0x185940={'status':_0x168e4b};var _0x5c8eaa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5744c9){_0x185940[_0xf4ea('0x8')]=_0x5744c9;}return db[_0xf4ea('0x9')]['update'](_0x185940,_0x5c8eaa);}function main(){var _0x554d64=0x1388;var _0x47991d;logger[_0xf4ea('0xa')](util[_0xf4ea('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0xf4ea('0xc')][_0xf4ea('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf4ea('0xe'),_0xf4ea('0xf')]})[_0xf4ea('0x10')](function(_0x13ec2b){if(_0x13ec2b){_0x47991d=_0x13ec2b;_0x554d64=_0x47991d[_0xf4ea('0xf')]||0x1388;}})[_0xf4ea('0x10')](function(){return dbH[_0xf4ea('0x11')][_0xf4ea('0x12')](util[_0xf4ea('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xf4ea('0x11')]['QueryTypes'][_0xf4ea('0x13')]});})['then'](function(_0x1a4037){if(!_0x1a4037[0x0][_0xf4ea('0x14')]){return analyticExtractedReport(_0xf4ea('0x15'));}var _0x1b546e=[];var _0x22361c=0x0;if(_0x47991d[_0xf4ea('0xe')]){if(_0x1a4037&&_0x1a4037[_0xf4ea('0x16')]){var _0x4ca3b8=_[_0xf4ea('0x17')](_0x1a4037[0x0]['num']/_0x554d64);var _0x31db18=Number[_0xf4ea('0x18')](_0x1a4037[0x0][_0xf4ea('0x14')]/_0x554d64)?_0x1a4037[0x0][_0xf4ea('0x14')]%_0x554d64:0x0;_0x4ca3b8['forEach'](function(_0x160572){if(_0x160572>0x0){_0x22361c+=_0x554d64;}_0x1b546e['push'](dbH[_0xf4ea('0x11')]['query'](util[_0xf4ea('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x554d64,_0x22361c),{'type':dbH['sequelize'][_0xf4ea('0x19')]['SELECT']}));});if(_0x31db18>0x0){_0x22361c+=_0x554d64;_0x1b546e[_0xf4ea('0x1a')](dbH[_0xf4ea('0x11')][_0xf4ea('0x12')](util[_0xf4ea('0xb')](_0xf4ea('0x1b'),QUERY,_0x31db18,_0x22361c),{'type':dbH[_0xf4ea('0x11')][_0xf4ea('0x19')][_0xf4ea('0x13')]}));}}}else{_0x1b546e['push'](dbH['sequelize'][_0xf4ea('0x12')](QUERY,{'type':dbH[_0xf4ea('0x11')][_0xf4ea('0x19')][_0xf4ea('0x13')]}));}var _0x2155a5=path[_0xf4ea('0x1c')](PATH);var _0x245480=path[_0xf4ea('0x1d')](PATH,'.xlsx');var _0x1143c8=_0x47991d[_0xf4ea('0xe')]&&_0x1b546e[_0xf4ea('0x16')]>0x1;var _0xb154ea=[];if(!fs['existsSync'](path[_0xf4ea('0x1e')](_0x2155a5,_0x245480))&&_0x1143c8){fs[_0xf4ea('0x1f')](path[_0xf4ea('0x1e')](_0x2155a5,_0x245480));}return BPromise['each'](_0x1b546e,function(_0x35a09d){_0xb154ea[_0xf4ea('0x1a')](_0x35a09d);})[_0xf4ea('0x10')](function(){for(var _0x555e28=0x0;_0x555e28<_0xb154ea[_0xf4ea('0x16')];_0x555e28+=0x1){var _0x215d31;var _0x42a471=_0xb154ea[_0x555e28];if(_0x1143c8){_0x215d31=path['join'](_0x2155a5,_0x245480,util[_0xf4ea('0xb')]('%s%d.%s',_0x245480,_0x555e28,_0xf4ea('0x20')));}else{_0x215d31=path[_0xf4ea('0x1e')](_0x2155a5,util['format'](_0xf4ea('0x21'),_0x245480,_0xf4ea('0x20')));}fs[_0xf4ea('0x22')](_0x215d31,json2xls(_0x42a471),_0xf4ea('0x23'));}})[_0xf4ea('0x10')](function(){if(_0x1143c8){return new Promise(function(_0x2c53b0){zipdir(path['join'](_0x2155a5,_0x245480),{'saveTo':path[_0xf4ea('0x1e')](_0x2155a5,util['format'](_0xf4ea('0x21'),_0x245480,_0xf4ea('0x24')))},function(_0x45815b,_0x4b7c9e){rimraf(path['join'](_0x2155a5,_0x245480),function(){});_0x2c53b0(_0xf4ea('0x25'));});});}})[_0xf4ea('0x10')](function(){logger[_0xf4ea('0xa')](util[_0xf4ea('0xb')](_0xf4ea('0x26'),EXTRACTED_REPORT_ID,_0xf4ea('0x27')));return analyticExtractedReport(_0xf4ea('0x28'),_0x1143c8?util[_0xf4ea('0xb')](_0xf4ea('0x21'),_0x245480,_0x1143c8?_0xf4ea('0x24'):_0xf4ea('0x20')):null);});})[_0xf4ea('0x29')](function(_0xdded48){logger['info'](util[_0xf4ea('0xb')](_0xf4ea('0x2a'),EXTRACTED_REPORT_ID,_0xf4ea('0x27')),util[_0xf4ea('0x2b')](_0xdded48,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf4ea('0x2c'));})['finally'](function(){process[_0xf4ea('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 12ea960..9d4eca8 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 _0x5015=['uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','push','format','CDR(type)=%s','context','priority','type','inbound','Set','CDR(routeid)=','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','Interval','findAll','then','models','IntervalId','VoiceExtension'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0x5015,0x1d4));var _0x5501=function(_0x1aa6a9,_0x8ca9a9){_0x1aa6a9=_0x1aa6a9-0x0;var _0x4181f7=_0x5015[_0x1aa6a9];return _0x4181f7;};'use strict';var _=require(_0x5501('0x0'));var util=require(_0x5501('0x1'));function rewrite(_0x3b609,_0x2add5e){var _0x567d2d=this;return _0x3b609['models'][_0x5501('0x2')][_0x5501('0x3')]({'raw':!![]})[_0x5501('0x4')](function(_0x3587e9){_0x567d2d['intervals']=_0x3587e9;return _0x3b609[_0x5501('0x5')]['VoiceExtension'][_0x5501('0x3')]({'where':{'IntervalId':_0x2add5e[_0x5501('0x6')]},'raw':!![]});})[_0x5501('0x4')](function(_0x5c6e0b){return _0x3b609[_0x5501('0x5')][_0x5501('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x5501('0x8')](_[_0x5501('0x9')](_0x5c6e0b,_0x5501('0xa')))}},'order':[{'raw':_0x5501('0xb')}],'raw':!![]});})['then'](function(_0x4deea2){var _0x592380=_[_0x5501('0xc')](_0x4deea2,{'priority':'1'});var _0x1843d9=_[_0x5501('0xc')](_0x4deea2,{'isApp':0x1});var _0x1db117=_[_0x5501('0xd')](_0x1843d9,'exten');var _0x5ee917=[_0x5501('0xe'),_0x5501('0xf')];var _0x454f08=[];var _0x57f644=[];for(var _0x27939f in _0x1db117){if(_0x1db117[_0x5501('0x10')](_0x27939f)){_0x567d2d['priority']=0x2;_0x567d2d['extensions']=[];_0x567d2d['extension']=_['find'](_0x592380,{'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')]});_0x567d2d[_0x5501('0x11')][_0x5501('0x12')]({'type':_0x1db117[_0x27939f][0x0]['type'],'app':'Set','appdata':util[_0x5501('0x13')](_0x5501('0x14'),_0x1db117[_0x27939f][0x0]['type']),'context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')],'priority':_0x567d2d[_0x5501('0x16')]++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0]['VoiceExtensionId']});if(_0x1db117[_0x27939f][0x0][_0x5501('0x17')]===_0x5501('0x18')){_0x567d2d['extensions'][_0x5501('0x12')]({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':_0x5501('0x1a')+_0x1db117[_0x27939f][0x0][_0x5501('0x1b')],'context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')],'priority':_0x567d2d['priority']++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});}else if(_0x1db117[_0x27939f][0x0][_0x5501('0x17')]===_0x5501('0x1c')){if(_0x567d2d[_0x5501('0x1d')]){_0x567d2d[_0x5501('0x11')]['push']({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':_0x5501('0x1e')+(_0x567d2d['extension'][_0x5501('0x1f')]?'${EXTEN:'+_0x567d2d[_0x5501('0x1d')][_0x5501('0x1f')]+'}':_0x5501('0x20')),'context':_0x1db117[_0x27939f][0x0]['context'],'exten':_0x1db117[_0x27939f][0x0]['exten'],'priority':_0x567d2d[_0x5501('0x16')]++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});}_0x567d2d[_0x5501('0x11')][_0x5501('0x12')]({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':'CDR(routeid)='+_0x1db117[_0x27939f][0x0][_0x5501('0x1b')],'context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0]['exten'],'priority':_0x567d2d['priority']++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});var _0x243716=_0x567d2d[_0x5501('0x16')]++;_0x567d2d[_0x5501('0x11')]['push']({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':_0x5501('0x21'),'appdata':_0x5501('0x22')+(_0x243716+0x2)+_0x5501('0x23')+(_0x243716+0x1)+')','context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')],'priority':_0x243716,'VoiceExtensionId':_0x1db117[_0x27939f][0x0]['VoiceExtensionId']});if(_0x567d2d['extension']){_0x567d2d['extensions'][_0x5501('0x12')]({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':'Set','appdata':_0x567d2d[_0x5501('0x1d')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x567d2d[_0x5501('0x1d')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x1db117[_0x27939f][0x0]['context'],'exten':_0x1db117[_0x27939f][0x0]['exten'],'priority':_0x567d2d['priority']++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0]['VoiceExtensionId']});}_0x567d2d[_0x5501('0x11')]['push']({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':_0x5501('0x24')+_0x1db117[_0x27939f][0x0][_0x5501('0x1b')],'context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')],'priority':_0x567d2d[_0x5501('0x16')]++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});if(_0x567d2d[_0x5501('0x1d')]&&_0x567d2d['extension'][_0x5501('0x10')](_0x5501('0x25'))&&_0x567d2d[_0x5501('0x1d')]['recordingFormat']!=='none'){_0x567d2d[_0x5501('0x11')][_0x5501('0x12')]({'type':_0x1db117[_0x27939f][0x0]['type'],'app':_0x5501('0x19'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')],'priority':_0x567d2d[_0x5501('0x16')]++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});_0x567d2d[_0x5501('0x11')][_0x5501('0x12')]({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x567d2d[_0x5501('0x1d')][_0x5501('0x25')]||_0x5501('0x26'),'context':_0x1db117[_0x27939f][0x0]['context'],'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')],'priority':_0x567d2d[_0x5501('0x16')]++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});}}_0x567d2d[_0x5501('0x11')][_0x5501('0x12')]({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':_0x5501('0x27'),'context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')],'priority':_0x567d2d[_0x5501('0x16')]++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});_0x567d2d[_0x5501('0x11')]['push']({'type':_0x1db117[_0x27939f][0x0]['type'],'app':_0x5501('0x19'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0][_0x5501('0xa')],'priority':_0x567d2d['priority']++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});_0x567d2d['extensions'][_0x5501('0x12')]({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':_0x5501('0x28'),'context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'exten':_0x1db117[_0x27939f][0x0]['exten'],'priority':_0x567d2d[_0x5501('0x16')]++,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});for(var _0x27f7aa=0x0,_0x3a7242=0x0;_0x27f7aa<_0x1db117[_0x27939f][_0x5501('0x29')];_0x27f7aa+=0x1,_0x3a7242=0x0){var _0x59b07c=_0x1db117[_0x27939f][_0x27f7aa];if(_0x59b07c[_0x5501('0x17')]){_0x59b07c['type']=_0x59b07c[_0x5501('0x17')]['toLowerCase']();}var _0xd46c2d=[];var _0x3c7bf5=[];delete _0x59b07c['id'];delete _0x59b07c[_0x5501('0x2a')];delete _0x59b07c[_0x5501('0x2b')];var _0x1fa816=_0x59b07c['interval']!==_0x5501('0x2c')?[_0x59b07c['interval']]:_0x59b07c[_0x5501('0x6')]?_[_0x5501('0x9')](_[_0x5501('0xc')](_0x567d2d[_0x5501('0x2d')],{'IntervalId':_0x59b07c[_0x5501('0x6')]}),'interval'):[];if(_0x59b07c[_0x5501('0x10')]('tag')){if(_0x59b07c['tag']&&_0x59b07c[_0x5501('0x2e')]!=='--'){_0xd46c2d[_0x5501('0x12')]({'type':_0x59b07c[_0x5501('0x17')],'app':'Set','appdata':_0x5501('0x2f')+_0x59b07c[_0x5501('0x2e')],'context':_0x59b07c['context'],'exten':_0x59b07c['exten'],'priority':_0x1fa816['length']+_0x567d2d['priority']+_0x3a7242++,'VoiceExtensionId':_0x59b07c[_0x5501('0x1b')]});}}if(_0x59b07c[_0x5501('0x17')]===_0x5501('0x1c')&&_0x59b07c[_0x5501('0x10')](_0x5501('0x30'))){if(_0x59b07c[_0x5501('0x30')]){_0xd46c2d['push']({'type':_0x59b07c[_0x5501('0x17')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x59b07c[_0x5501('0x30')]+')','context':_0x59b07c[_0x5501('0x15')],'exten':_0x59b07c[_0x5501('0xa')],'priority':_0x1fa816[_0x5501('0x29')]+_0x567d2d['priority']+_0x3a7242++,'VoiceExtensionId':_0x59b07c[_0x5501('0x1b')]});}else{_0xd46c2d[_0x5501('0x12')]({'type':_0x59b07c[_0x5501('0x17')],'app':'ExecIf','appdata':_0x5501('0x31'),'context':_0x59b07c[_0x5501('0x15')],'exten':_0x59b07c[_0x5501('0xa')],'priority':_0x1fa816['length']+_0x567d2d[_0x5501('0x16')]+_0x3a7242++,'VoiceExtensionId':_0x59b07c[_0x5501('0x1b')]});}}if(_0x59b07c[_0x5501('0x10')](_0x5501('0x32'))){if(_0x5ee917[_0x5501('0x33')](_0x59b07c[_0x5501('0x34')][_0x5501('0x35')]())>=0x0&&_0x59b07c['appType']!==_0x5501('0x36')){if(_0x59b07c['answer']){_0xd46c2d[_0x5501('0x12')]({'type':_0x59b07c[_0x5501('0x17')],'app':'ExecIf','appdata':_0x5501('0x37'),'context':_0x59b07c[_0x5501('0x15')],'exten':_0x59b07c[_0x5501('0xa')],'priority':_0x1fa816['length']+_0x567d2d[_0x5501('0x16')]+_0x3a7242++,'VoiceExtensionId':_0x59b07c[_0x5501('0x1b')]});_0xd46c2d[_0x5501('0x12')]({'type':_0x59b07c[_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':_0x5501('0x38'),'context':_0x59b07c[_0x5501('0x15')],'exten':_0x59b07c['exten'],'priority':_0x1fa816[_0x5501('0x29')]+_0x567d2d[_0x5501('0x16')]+_0x3a7242++,'VoiceExtensionId':_0x59b07c[_0x5501('0x1b')]});}else{_0xd46c2d[_0x5501('0x12')]({'type':_0x59b07c[_0x5501('0x17')],'app':_0x5501('0x21'),'appdata':_0x5501('0x39'),'context':_0x59b07c[_0x5501('0x15')],'exten':_0x59b07c[_0x5501('0xa')],'priority':_0x1fa816[_0x5501('0x29')]+_0x567d2d['priority']+_0x3a7242++,'VoiceExtensionId':_0x59b07c[_0x5501('0x1b')]});_0xd46c2d[_0x5501('0x12')]({'type':_0x59b07c[_0x5501('0x17')],'app':_0x5501('0x19'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x59b07c[_0x5501('0x15')],'exten':_0x59b07c['exten'],'priority':_0x1fa816[_0x5501('0x29')]+_0x567d2d[_0x5501('0x16')]+_0x3a7242++,'VoiceExtensionId':_0x59b07c[_0x5501('0x1b')]});}}}for(var _0xd9ef80=0x0;_0xd9ef80<_0x1fa816[_0x5501('0x29')];_0xd9ef80+=0x1){var _0x279f2c=_0x567d2d['priority']+_0x1fa816['length'];var _0x5bd3fa=_0xd9ef80===_0x1fa816['length']-0x1?_0x567d2d[_0x5501('0x16')]+_0xd46c2d['length']+_0x3c7bf5[_0x5501('0x29')]+0x2:_0x567d2d[_0x5501('0x16')]+_0xd9ef80+0x1;_0xd46c2d['splice'](_0xd9ef80,0x0,{'type':_0x59b07c['type'],'app':_0x5501('0x3a'),'appdata':_0x1fa816[_0xd9ef80]+'?'+_0x59b07c[_0x5501('0x15')]+_0x5501('0x3b')+_0x279f2c+':'+_0x59b07c[_0x5501('0x15')]+_0x5501('0x3b')+_0x5bd3fa,'exten':_0x59b07c[_0x5501('0xa')],'context':_0x59b07c[_0x5501('0x15')],'priority':_0x567d2d['priority']+_0xd9ef80,'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});}_0x59b07c[_0x5501('0x16')]=_0xd46c2d[_0x5501('0x29')]?_[_0x5501('0x3c')](_0xd46c2d)[_0x5501('0x16')]+0x1:_0x567d2d['priority'];_0x567d2d[_0x5501('0x16')]=(_0x3c7bf5['length']?_[_0x5501('0x3c')](_0x3c7bf5)['priority']:_0x59b07c[_0x5501('0x16')])+0x1;_0x567d2d[_0x5501('0x11')]=_['concat'](_0x567d2d[_0x5501('0x11')],_0xd46c2d,[_0x59b07c],_0x3c7bf5);}_0x567d2d['extensions']['push']({'type':_0x1db117[_0x27939f][0x0][_0x5501('0x17')],'app':'Hangup','exten':_0x1db117[_0x27939f][0x0]['exten'],'context':_0x1db117[_0x27939f][0x0][_0x5501('0x15')],'priority':_0x567d2d[_0x5501('0x16')],'VoiceExtensionId':_0x1db117[_0x27939f][0x0][_0x5501('0x1b')]});_0x454f08[_0x5501('0x12')](_0x1db117[_0x27939f][0x0]['VoiceExtensionId']);_0x57f644=_[_0x5501('0x3d')](_0x57f644,_0x567d2d[_0x5501('0x11')]);}}return _0x3b609['transaction'](function(_0x21cbbd){return _0x3b609['models'][_0x5501('0x7')][_0x5501('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x454f08}},'transaction':_0x21cbbd})['then'](function(_0x260be1){return _0x3b609[_0x5501('0x5')][_0x5501('0x7')][_0x5501('0x3f')](_[_0x5501('0x40')](_0x57f644,'priority'),{'transaction':_0x21cbbd});});});})[_0x5501('0x41')](function(_0x404315){console[_0x5501('0x42')](_0x404315);});}exports[_0x5501('0x43')]=rewrite; \ No newline at end of file +var _0x2d2c=['XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','error','rewrite','util','Interval','intervals','models','VoiceExtension','IntervalId','then','findAll','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','extensions','push','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','CDR(destination)=','cutdigits','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','map','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','answer'];(function(_0x2573ca,_0x550022){var _0x220656=function(_0x1ac82c){while(--_0x1ac82c){_0x2573ca['push'](_0x2573ca['shift']());}};_0x220656(++_0x550022);}(_0x2d2c,0x121));var _0xc2d2=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x2d2c[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require(_0xc2d2('0x0'));function rewrite(_0x2a16bb,_0x163988){var _0x194936=this;return _0x2a16bb['models'][_0xc2d2('0x1')]['findAll']({'raw':!![]})['then'](function(_0x502ca2){_0x194936[_0xc2d2('0x2')]=_0x502ca2;return _0x2a16bb[_0xc2d2('0x3')][_0xc2d2('0x4')]['findAll']({'where':{'IntervalId':_0x163988[_0xc2d2('0x5')]},'raw':!![]});})[_0xc2d2('0x6')](function(_0x35f650){return _0x2a16bb[_0xc2d2('0x3')][_0xc2d2('0x4')][_0xc2d2('0x7')]({'where':{'exten':{'$in':_[_0xc2d2('0x8')](_['map'](_0x35f650,_0xc2d2('0x9')))}},'order':[{'raw':_0xc2d2('0xa')}],'raw':!![]});})['then'](function(_0x490942){var _0x5138be=_[_0xc2d2('0xb')](_0x490942,{'priority':'1'});var _0x1a5064=_[_0xc2d2('0xb')](_0x490942,{'isApp':0x1});var _0x2bac0f=_[_0xc2d2('0xc')](_0x1a5064,_0xc2d2('0x9'));var _0x22159f=[_0xc2d2('0xd'),_0xc2d2('0xe')];var _0x3d2686=[];var _0x1de4e1=[];for(var _0xdfa826 in _0x2bac0f){if(_0x2bac0f[_0xc2d2('0xf')](_0xdfa826)){_0x194936[_0xc2d2('0x10')]=0x2;_0x194936['extensions']=[];_0x194936[_0xc2d2('0x11')]=_['find'](_0x5138be,{'exten':_0x2bac0f[_0xdfa826][0x0]['exten']});_0x194936[_0xc2d2('0x12')][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':'Set','appdata':util[_0xc2d2('0x15')](_0xc2d2('0x16'),_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')]),'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});if(_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')]===_0xc2d2('0x19')){_0x194936[_0xc2d2('0x12')][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0]['type'],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x1b')+_0x2bac0f[_0xdfa826][0x0]['VoiceExtensionId'],'context':_0x2bac0f[_0xdfa826][0x0]['context'],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});}else if(_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')]==='outbound'){if(_0x194936['extension']){_0x194936['extensions'][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x1c')+(_0x194936[_0xc2d2('0x11')][_0xc2d2('0x1d')]?_0xc2d2('0x1e')+_0x194936[_0xc2d2('0x11')][_0xc2d2('0x1d')]+'}':'${EXTEN}'),'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});}_0x194936[_0xc2d2('0x12')][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x2bac0f[_0xdfa826][0x0]['VoiceExtensionId'],'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0]['exten'],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});var _0x6f23ef=_0x194936['priority']++;_0x194936[_0xc2d2('0x12')][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0]['type'],'app':'ExecIf','appdata':_0xc2d2('0x1f')+(_0x6f23ef+0x2)+_0xc2d2('0x20')+(_0x6f23ef+0x1)+')','context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x6f23ef,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0]['VoiceExtensionId']});if(_0x194936[_0xc2d2('0x11')]){_0x194936[_0xc2d2('0x12')][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':_0x194936[_0xc2d2('0x11')][_0xc2d2('0x1d')]?_0xc2d2('0x21')+_0x194936[_0xc2d2('0x11')]['cutdigits']+'}':_0xc2d2('0x22'),'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});}_0x194936['extensions'][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x23')+_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')],'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0]['exten'],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});if(_0x194936['extension']&&_0x194936[_0xc2d2('0x11')]['hasOwnProperty'](_0xc2d2('0x24'))&&_0x194936[_0xc2d2('0x11')][_0xc2d2('0x24')]!=='none'){_0x194936[_0xc2d2('0x12')][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x25'),'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x194936['priority']++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});_0x194936[_0xc2d2('0x12')]['push']({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x194936['extension'][_0xc2d2('0x24')]||_0xc2d2('0x26'),'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});}}_0x194936['extensions'][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x27'),'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});_0x194936[_0xc2d2('0x12')][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0]['type'],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x28'),'context':_0x2bac0f[_0xdfa826][0x0]['context'],'exten':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x9')],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});_0x194936[_0xc2d2('0x12')][_0xc2d2('0x13')]({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x29'),'context':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x17')],'exten':_0x2bac0f[_0xdfa826][0x0]['exten'],'priority':_0x194936[_0xc2d2('0x10')]++,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});for(var _0x3a5e68=0x0,_0x326c55=0x0;_0x3a5e68<_0x2bac0f[_0xdfa826][_0xc2d2('0x2a')];_0x3a5e68+=0x1,_0x326c55=0x0){var _0x1b0c7d=_0x2bac0f[_0xdfa826][_0x3a5e68];if(_0x1b0c7d['type']){_0x1b0c7d[_0xc2d2('0x14')]=_0x1b0c7d['type'][_0xc2d2('0x2b')]();}var _0x5e89ea=[];var _0x47c27a=[];delete _0x1b0c7d['id'];delete _0x1b0c7d['createdAt'];delete _0x1b0c7d[_0xc2d2('0x2c')];var _0x495306=_0x1b0c7d[_0xc2d2('0x2d')]!=='*,*,*,*'?[_0x1b0c7d[_0xc2d2('0x2d')]]:_0x1b0c7d[_0xc2d2('0x5')]?_[_0xc2d2('0x2e')](_['filter'](_0x194936['intervals'],{'IntervalId':_0x1b0c7d['IntervalId']}),'interval'):[];if(_0x1b0c7d[_0xc2d2('0xf')]('tag')){if(_0x1b0c7d[_0xc2d2('0x2f')]&&_0x1b0c7d['tag']!=='--'){_0x5e89ea[_0xc2d2('0x13')]({'type':_0x1b0c7d[_0xc2d2('0x14')],'app':'Set','appdata':_0xc2d2('0x30')+_0x1b0c7d[_0xc2d2('0x2f')],'context':_0x1b0c7d['context'],'exten':_0x1b0c7d['exten'],'priority':_0x495306[_0xc2d2('0x2a')]+_0x194936['priority']+_0x326c55++,'VoiceExtensionId':_0x1b0c7d[_0xc2d2('0x18')]});}}if(_0x1b0c7d['type']===_0xc2d2('0x31')&&_0x1b0c7d['hasOwnProperty']('callerID')){if(_0x1b0c7d[_0xc2d2('0x32')]){_0x5e89ea['push']({'type':_0x1b0c7d[_0xc2d2('0x14')],'app':'ExecIf','appdata':_0xc2d2('0x33')+_0x1b0c7d['callerID']+')','context':_0x1b0c7d['context'],'exten':_0x1b0c7d['exten'],'priority':_0x495306[_0xc2d2('0x2a')]+_0x194936[_0xc2d2('0x10')]+_0x326c55++,'VoiceExtensionId':_0x1b0c7d[_0xc2d2('0x18')]});}else{_0x5e89ea[_0xc2d2('0x13')]({'type':_0x1b0c7d['type'],'app':_0xc2d2('0x34'),'appdata':_0xc2d2('0x35'),'context':_0x1b0c7d[_0xc2d2('0x17')],'exten':_0x1b0c7d[_0xc2d2('0x9')],'priority':_0x495306[_0xc2d2('0x2a')]+_0x194936['priority']+_0x326c55++,'VoiceExtensionId':_0x1b0c7d[_0xc2d2('0x18')]});}}if(_0x1b0c7d[_0xc2d2('0xf')]('answer')){if(_0x22159f[_0xc2d2('0x36')](_0x1b0c7d['app'][_0xc2d2('0x2b')]())>=0x0&&_0x1b0c7d['appType']!=='custom'){if(_0x1b0c7d[_0xc2d2('0x37')]){_0x5e89ea[_0xc2d2('0x13')]({'type':_0x1b0c7d['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x1b0c7d[_0xc2d2('0x17')],'exten':_0x1b0c7d[_0xc2d2('0x9')],'priority':_0x495306['length']+_0x194936[_0xc2d2('0x10')]+_0x326c55++,'VoiceExtensionId':_0x1b0c7d[_0xc2d2('0x18')]});_0x5e89ea[_0xc2d2('0x13')]({'type':_0x1b0c7d[_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x38'),'context':_0x1b0c7d[_0xc2d2('0x17')],'exten':_0x1b0c7d[_0xc2d2('0x9')],'priority':_0x495306[_0xc2d2('0x2a')]+_0x194936[_0xc2d2('0x10')]+_0x326c55++,'VoiceExtensionId':_0x1b0c7d[_0xc2d2('0x18')]});}else{_0x5e89ea[_0xc2d2('0x13')]({'type':_0x1b0c7d[_0xc2d2('0x14')],'app':_0xc2d2('0x34'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1b0c7d[_0xc2d2('0x17')],'exten':_0x1b0c7d[_0xc2d2('0x9')],'priority':_0x495306['length']+_0x194936[_0xc2d2('0x10')]+_0x326c55++,'VoiceExtensionId':_0x1b0c7d['VoiceExtensionId']});_0x5e89ea[_0xc2d2('0x13')]({'type':_0x1b0c7d[_0xc2d2('0x14')],'app':_0xc2d2('0x1a'),'appdata':_0xc2d2('0x39'),'context':_0x1b0c7d[_0xc2d2('0x17')],'exten':_0x1b0c7d[_0xc2d2('0x9')],'priority':_0x495306[_0xc2d2('0x2a')]+_0x194936[_0xc2d2('0x10')]+_0x326c55++,'VoiceExtensionId':_0x1b0c7d[_0xc2d2('0x18')]});}}}for(var _0xf8fa12=0x0;_0xf8fa12<_0x495306['length'];_0xf8fa12+=0x1){var _0x4150bc=_0x194936[_0xc2d2('0x10')]+_0x495306[_0xc2d2('0x2a')];var _0x41f1df=_0xf8fa12===_0x495306['length']-0x1?_0x194936[_0xc2d2('0x10')]+_0x5e89ea[_0xc2d2('0x2a')]+_0x47c27a[_0xc2d2('0x2a')]+0x2:_0x194936[_0xc2d2('0x10')]+_0xf8fa12+0x1;_0x5e89ea[_0xc2d2('0x3a')](_0xf8fa12,0x0,{'type':_0x1b0c7d[_0xc2d2('0x14')],'app':_0xc2d2('0x3b'),'appdata':_0x495306[_0xf8fa12]+'?'+_0x1b0c7d[_0xc2d2('0x17')]+_0xc2d2('0x3c')+_0x4150bc+':'+_0x1b0c7d[_0xc2d2('0x17')]+_0xc2d2('0x3c')+_0x41f1df,'exten':_0x1b0c7d[_0xc2d2('0x9')],'context':_0x1b0c7d[_0xc2d2('0x17')],'priority':_0x194936[_0xc2d2('0x10')]+_0xf8fa12,'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]});}_0x1b0c7d[_0xc2d2('0x10')]=_0x5e89ea[_0xc2d2('0x2a')]?_[_0xc2d2('0x3d')](_0x5e89ea)[_0xc2d2('0x10')]+0x1:_0x194936[_0xc2d2('0x10')];_0x194936[_0xc2d2('0x10')]=(_0x47c27a[_0xc2d2('0x2a')]?_[_0xc2d2('0x3d')](_0x47c27a)['priority']:_0x1b0c7d[_0xc2d2('0x10')])+0x1;_0x194936[_0xc2d2('0x12')]=_[_0xc2d2('0x3e')](_0x194936['extensions'],_0x5e89ea,[_0x1b0c7d],_0x47c27a);}_0x194936[_0xc2d2('0x12')]['push']({'type':_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x14')],'app':_0xc2d2('0x3f'),'exten':_0x2bac0f[_0xdfa826][0x0]['exten'],'context':_0x2bac0f[_0xdfa826][0x0]['context'],'priority':_0x194936[_0xc2d2('0x10')],'VoiceExtensionId':_0x2bac0f[_0xdfa826][0x0]['VoiceExtensionId']});_0x3d2686['push'](_0x2bac0f[_0xdfa826][0x0][_0xc2d2('0x18')]);_0x1de4e1=_[_0xc2d2('0x3e')](_0x1de4e1,_0x194936[_0xc2d2('0x12')]);}}return _0x2a16bb[_0xc2d2('0x40')](function(_0x1d7e52){return _0x2a16bb[_0xc2d2('0x3')][_0xc2d2('0x4')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3d2686}},'transaction':_0x1d7e52})[_0xc2d2('0x6')](function(_0x4d83be){return _0x2a16bb[_0xc2d2('0x3')][_0xc2d2('0x4')][_0xc2d2('0x41')](_[_0xc2d2('0x42')](_0x1de4e1,_0xc2d2('0x10')),{'transaction':_0x1d7e52});});});})['catch'](function(_0x201c4f){console[_0xc2d2('0x43')](_0x201c4f);});}exports[_0xc2d2('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 0b4221c..c251724 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 _0x7cd3=['Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','field','phone','NOW()','scheduledAt','toString','cm_contacts','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','into','select','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find'];(function(_0x1f49c2,_0xeb4570){var _0x11bb4d=function(_0x4dd5df){while(--_0x4dd5df){_0x1f49c2['push'](_0x1f49c2['shift']());}};_0x11bb4d(++_0xeb4570);}(_0x7cd3,0x12b));var _0x37cd=function(_0x1bb2d0,_0x18f103){_0x1bb2d0=_0x1bb2d0-0x0;var _0x14b18f=_0x7cd3[_0x1bb2d0];return _0x14b18f;};'use strict';var BPromise=require(_0x37cd('0x0'));var util=require(_0x37cd('0x1'));var _=require(_0x37cd('0x2'));var fs=require('fs');var squel=require(_0x37cd('0x3'));var Papa=require(_0x37cd('0x4'));var Redis=require(_0x37cd('0x5'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x37cd('0x6'))(_0x37cd('0x7'));config[_0x37cd('0x8')]=_[_0x37cd('0x9')](config[_0x37cd('0x8')],{'host':_0x37cd('0xa'),'port':0x18eb});var socket=require(_0x37cd('0xb'))(new Redis(config['redis']));require(_0x37cd('0xc'))[_0x37cd('0xd')](socket);try{if(!process[_0x37cd('0xe')][0x2]||process[_0x37cd('0xe')][0x2]===_0x37cd('0xf')||process[_0x37cd('0xe')][0x2]==='null'){throw new Error(_0x37cd('0x10'));}var FILEPATH=process['argv'][0x2];if(!process[_0x37cd('0xe')][0x3]||process['argv'][0x3]===_0x37cd('0xf')||process[_0x37cd('0xe')][0x3]===_0x37cd('0x11')||!process[_0x37cd('0xe')][0x4]||process[_0x37cd('0xe')][0x4]===_0x37cd('0xf')||process['argv'][0x4]===_0x37cd('0x11')){throw new Error(_0x37cd('0x12'));}var FIELDS=_[_0x37cd('0x13')](process[_0x37cd('0xe')][0x3][_0x37cd('0x14')](','),process[_0x37cd('0xe')][0x4][_0x37cd('0x14')](','));if(!process['argv'][0x5]||process['argv'][0x5]==='undefined'||process[_0x37cd('0xe')][0x5]===_0x37cd('0x11')){throw new Error(_0x37cd('0x15'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x37cd('0xe')][0x6]&&process['argv'][0x6]!==_0x37cd('0xf')&&process['argv'][0x6]!=='null'?process[_0x37cd('0xe')][0x6]:null;var DUPLICATES=process[_0x37cd('0xe')][0x7]&&process[_0x37cd('0xe')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x37cd('0x11')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x37cd('0xe')][0x8]===_0x37cd('0xf')||process['argv'][0x8]==='null'){throw new Error(_0x37cd('0x16'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x272390){logger[_0x37cd('0x17')](_0x272390);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(_0x59131c,_0x516d00,_0x3e5dfd,_0x4c6d20){var _0x281adc={'message':_0x516d00};_0x281adc[_0x59131c]=!![];if(_0x3e5dfd){_0x281adc[_0x37cd('0x18')]=_0x3e5dfd;}if(_0x4c6d20){_0x281adc['index']=_0x4c6d20;}return _0x281adc;}function isEmail(_0x8b1631){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))*$/[_0x37cd('0x19')](_0x8b1631);}function checkRow(_0x3af6a3,_0x3857af,_0x2a0540){return new BPromise(function(_0x537521,_0xda1672){if(_[_0x37cd('0x1a')](_0x3af6a3)){return _0xda1672(handleCheckRowError(_0x37cd('0x17'),_0x37cd('0x1b'),null,_0x2a0540));}if(_0x3af6a3[_0x37cd('0x1c')]&&_0x3af6a3[_0x37cd('0x1c')][_0x37cd('0x1d')]){var _0x24f99c=_[_0x37cd('0x1e')](_0x3af6a3['errors'],_0x37cd('0x1f'))[_0x37cd('0x20')](';');return _0xda1672(handleCheckRowError('error',_0x24f99c,null,_0x2a0540));}var _0x2b4dfe={};for(var _0x47a871 in FIELDS){if(FIELDS['hasOwnProperty'](_0x47a871)&&FIELDS[_0x47a871]){_0x2b4dfe[_0x47a871]=_0x3af6a3['data'][0x0][FIELDS[_0x47a871]]||_0x3af6a3[_0x37cd('0x21')][0x0]['\ufeff'+FIELDS[_0x47a871]];}}if(!_0x2b4dfe['firstName']){return _0xda1672(handleCheckRowError(_0x37cd('0x17'),'firstName\x20not\x20specified!',null,_0x2a0540));}if(!_0x2b4dfe['phone']){return _0xda1672(handleCheckRowError('error',_0x37cd('0x22'),null,_0x2a0540));}if(_0x2b4dfe[_0x37cd('0x23')]){var _0x22c27b=moment(_0x2b4dfe['birthDate'],_0x37cd('0x24'));if(!_0x22c27b[_0x37cd('0x25')]()){return _0xda1672(handleCheckRowError(_0x37cd('0x17'),_0x37cd('0x26'),null,_0x2a0540));}}if(_0x2b4dfe['email']){if(!isEmail(_0x2b4dfe['email'])){return _0xda1672(handleCheckRowError('error',_0x37cd('0x27'),null,_0x2a0540));}}_0x2b4dfe[_0x37cd('0x28')]=LISTID;_0x2b4dfe[_0x37cd('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x37cd('0x1d')]&&_0x3857af){var _0x35828b={};for(var _0x5346c3=0x0,_0x282e8c=DUPLICATES[_0x37cd('0x1d')];_0x5346c3<_0x282e8c;_0x5346c3+=0x1){_0x35828b[DUPLICATES[_0x5346c3]]=_0x2b4dfe[DUPLICATES[_0x5346c3]];}var _0x43e063=_[_0x37cd('0x2a')](_0x3857af,_0x35828b);if(_0x43e063){return _0xda1672(handleCheckRowError('duplicate',_0x37cd('0x2b'),_0x43e063,_0x2a0540));}}return db[_0x37cd('0x2c')][_0x37cd('0x2d')](_0x2b4dfe,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2b4dfe)})[_0x37cd('0x2e')](function(_0x51bbf7){if(DUPLICATES&&DUPLICATES['length']&&_0x3857af){_0x3857af[_0x37cd('0x2f')](_[_0x37cd('0x30')](_0x2b4dfe,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x51bbf7['id'];return _0x537521();})[_0x37cd('0x31')](function(_0x3ed464){return _0xda1672(handleCheckRowError(_0x37cd('0x17'),_0x37cd('0x32')+(_0x3ed464[_0x37cd('0x1f')]||JSON[_0x37cd('0x33')](_0x3ed464)),null,_0x2a0540));});});}function checkHopper(){function _0x1e410f(){return function(_0x4979e1){logger[_0x37cd('0x17')](_0x37cd('0x34'),_0x37cd('0x35'),util['inspect'](_0x4979e1,{'showHidden':![],'depth':null}));};}var _0x56e5da=function(_0x29f3dc,_0x369fb2){var _0x92bf76=squel[_0x37cd('0x36')]()['into'](_0x37cd('0x37'))[_0x37cd('0x38')](['phone','scheduledAt',_0x37cd('0x39'),_0x37cd('0x28'),_0x369fb2,_0x37cd('0x3a'),_0x37cd('0x3b')],squel['select']()[_0x37cd('0x3c')](_0x37cd('0x3d'),'phone')[_0x37cd('0x3c')](_0x37cd('0x3e'),_0x37cd('0x3f'))[_0x37cd('0x3c')]('id',_0x37cd('0x39'))[_0x37cd('0x3c')](LISTID[_0x37cd('0x40')](),_0x37cd('0x28'))[_0x37cd('0x3c')](_0x29f3dc['id'][_0x37cd('0x40')](),_0x369fb2)[_0x37cd('0x3c')](_0x37cd('0x3e'),_0x37cd('0x3a'))[_0x37cd('0x3c')](_0x37cd('0x3e'),_0x37cd('0x3b'))['from'](_0x37cd('0x41'))[_0x37cd('0x42')]('deletedAt\x20IS\x20NULL')[_0x37cd('0x42')](_0x37cd('0x43'),LISTID['toString']())[_0x37cd('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x37cd('0x42')](_0x37cd('0x44'),squel['select']()[_0x37cd('0x3c')](_0x37cd('0x3d'))[_0x37cd('0x45')](_0x37cd('0x37'))[_0x37cd('0x42')](_0x369fb2+'\x20=\x20?',_0x29f3dc['id'][_0x37cd('0x40')]())))[_0x37cd('0x40')]();return _0x92bf76;};var _0x165c5e=function(_0x15957c,_0x435aee){var _0x297ee4=squel[_0x37cd('0x36')]()[_0x37cd('0x46')](_0x37cd('0x37'))[_0x37cd('0x38')]([_0x37cd('0x3d'),'scheduledAt','ContactId',_0x37cd('0x28'),_0x435aee,'createdAt','updatedAt'],squel[_0x37cd('0x47')]()[_0x37cd('0x3c')](_0x37cd('0x3d'),_0x37cd('0x3d'))[_0x37cd('0x3c')](_0x37cd('0x3e'),'scheduledAt')[_0x37cd('0x3c')]('id',_0x37cd('0x39'))[_0x37cd('0x3c')](LISTID[_0x37cd('0x40')](),'ListId')[_0x37cd('0x3c')](_0x15957c['id'][_0x37cd('0x40')](),_0x435aee)['field']('NOW()','createdAt')[_0x37cd('0x3c')](_0x37cd('0x3e'),_0x37cd('0x3b'))[_0x37cd('0x45')](_0x37cd('0x41'))['where'](_0x37cd('0x48'))[_0x37cd('0x42')](_0x37cd('0x43'),LISTID[_0x37cd('0x40')]())[_0x37cd('0x42')](_0x37cd('0x49'),squel[_0x37cd('0x4a')](hopperContacts))[_0x37cd('0x42')](_0x37cd('0x4b'))[_0x37cd('0x42')](_0x37cd('0x44'),squel[_0x37cd('0x47')]()[_0x37cd('0x3c')](_0x37cd('0x4c'))[_0x37cd('0x45')](_0x37cd('0x4d'))[_0x37cd('0x42')](_0x435aee+_0x37cd('0x4e'),_0x15957c['id'][_0x37cd('0x40')]()))[_0x37cd('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x37cd('0x47')]()[_0x37cd('0x3c')](_0x37cd('0x3d'))['from'](_0x37cd('0x37'))[_0x37cd('0x42')](_0x435aee+_0x37cd('0x4e'),_0x15957c['id'][_0x37cd('0x40')]())))[_0x37cd('0x40')]();return _0x297ee4;};function _0xa986db(_0x19d047,_0x59b9b8){var _0x27fe1d=squel[_0x37cd('0x36')]()[_0x37cd('0x46')](_0x37cd('0x37'))[_0x37cd('0x38')](['phone',_0x37cd('0x3f'),_0x37cd('0x39'),_0x37cd('0x28'),_0x59b9b8,'createdAt',_0x37cd('0x3b')],squel[_0x37cd('0x47')]()[_0x37cd('0x3c')](_0x37cd('0x3d'),'phone')[_0x37cd('0x3c')]('NOW()',_0x37cd('0x3f'))['field']('id',_0x37cd('0x39'))[_0x37cd('0x3c')](LISTID[_0x37cd('0x40')](),_0x37cd('0x28'))[_0x37cd('0x3c')](_0x19d047['id'][_0x37cd('0x40')](),_0x59b9b8)[_0x37cd('0x3c')]('NOW()','createdAt')[_0x37cd('0x3c')](_0x37cd('0x3e'),'updatedAt')[_0x37cd('0x45')](_0x37cd('0x41'))['where'](_0x37cd('0x48'))[_0x37cd('0x42')](_0x37cd('0x43'),LISTID[_0x37cd('0x40')]())[_0x37cd('0x42')]('id\x20IN\x20?',squel[_0x37cd('0x4a')](hopperContacts))[_0x37cd('0x42')](_0x37cd('0x4b')))['toString']();return _0x27fe1d;}function _0x213d10(_0x3f02fd,_0x1be210){var _0x585478=squel[_0x37cd('0x36')]()[_0x37cd('0x46')](_0x37cd('0x4f'))[_0x37cd('0x38')]([_0x37cd('0x3d'),'ContactId',_0x37cd('0x28'),_0x1be210,_0x37cd('0x3a'),'updatedAt'],squel[_0x37cd('0x47')]()[_0x37cd('0x3c')](_0x37cd('0x3d'),_0x37cd('0x3d'))[_0x37cd('0x3c')]('id',_0x37cd('0x39'))['field'](LISTID[_0x37cd('0x40')](),_0x37cd('0x28'))['field'](_0x3f02fd['id'][_0x37cd('0x40')](),_0x1be210)[_0x37cd('0x3c')]('NOW()',_0x37cd('0x3a'))[_0x37cd('0x3c')](_0x37cd('0x3e'),_0x37cd('0x3b'))[_0x37cd('0x45')](_0x37cd('0x41'))['where'](_0x37cd('0x48'))[_0x37cd('0x42')](_0x37cd('0x43'),LISTID[_0x37cd('0x40')]())[_0x37cd('0x42')](_0x37cd('0x49'),squel[_0x37cd('0x4a')](hopperContacts))[_0x37cd('0x42')](_0x37cd('0x4b')))[_0x37cd('0x40')]();return _0x585478;}return db[_0x37cd('0x50')][_0x37cd('0x51')]({'where':{'type':_0x37cd('0x52')},'attributes':['id',_0x37cd('0x53')],'include':[{'model':db[_0x37cd('0x54')],'as':_0x37cd('0x55'),'where':{'id':LISTID}}]})[_0x37cd('0x2e')](function(_0x32a223){var _0x2515b8=[];if(_0x32a223){var _0x3402c0;for(var _0x59a913=0x0,_0x5d8316;_0x59a913<_0x32a223[_0x37cd('0x1d')];_0x59a913+=0x1){_0x5d8316=_0x32a223[_0x59a913][_0x37cd('0x56')]({'plain':!![]});switch(_0x5d8316[_0x37cd('0x53')]){case _0x37cd('0x57'):_0x2515b8['push'](db[_0x37cd('0x58')][_0x37cd('0x59')](_0x165c5e(_0x5d8316,_0x37cd('0x5a')))['then'](function(){})[_0x37cd('0x31')](_0x1e410f()));break;case _0x37cd('0x5b'):_0x2515b8[_0x37cd('0x2f')](db['sequelize']['query'](_0x56e5da(_0x5d8316,_0x37cd('0x5a')))['then'](function(){})[_0x37cd('0x31')](_0x1e410f()));break;default:_0x2515b8[_0x37cd('0x2f')](db[_0x37cd('0x58')][_0x37cd('0x59')](_0xa986db(_0x5d8316,_0x37cd('0x5a')))['then'](function(){})[_0x37cd('0x31')](_0x1e410f()));}}}return _0x2515b8;})[_0x37cd('0x5c')]()['then'](function(){return db[_0x37cd('0x50')][_0x37cd('0x51')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x37cd('0x54')],'as':_0x37cd('0x5d'),'where':{'id':LISTID}}]})['then'](function(_0x4931aa){var _0x4856a5=[];if(_0x4931aa){var _0x2ca3b1;for(var _0x336f32=0x0,_0x49aae3;_0x336f32<_0x4931aa[_0x37cd('0x1d')];_0x336f32+=0x1){_0x49aae3=_0x4931aa[_0x336f32]['get']({'plain':!![]});_0x4856a5['push'](db[_0x37cd('0x58')][_0x37cd('0x59')](_0x213d10(_0x49aae3,_0x37cd('0x5a')))['then'](function(){})['catch'](_0x1e410f()));}}return _0x4856a5;})['all']();})[_0x37cd('0x2e')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x37cd('0x53')],'include':[{'model':db[_0x37cd('0x54')],'as':_0x37cd('0x55'),'where':{'id':LISTID}}]})[_0x37cd('0x2e')](function(_0x3b807e){var _0x320c08=[];if(_0x3b807e){for(var _0x6158ba=0x0,_0x29a304;_0x6158ba<_0x3b807e[_0x37cd('0x1d')];_0x6158ba+=0x1){_0x29a304=_0x3b807e[_0x6158ba]['get']({'plain':!![]});switch(_0x29a304[_0x37cd('0x53')]){case _0x37cd('0x57'):_0x320c08['push'](db[_0x37cd('0x58')][_0x37cd('0x59')](_0x165c5e(_0x29a304,_0x37cd('0x5e')))[_0x37cd('0x2e')](function(){})[_0x37cd('0x31')](_0x1e410f()));break;case _0x37cd('0x5b'):_0x320c08[_0x37cd('0x2f')](db['sequelize']['query'](_0x56e5da(_0x29a304,'CampaignId'))[_0x37cd('0x2e')](function(){})[_0x37cd('0x31')](_0x1e410f()));break;default:_0x320c08[_0x37cd('0x2f')](db[_0x37cd('0x58')][_0x37cd('0x59')](_0xa986db(_0x29a304,'CampaignId'))[_0x37cd('0x2e')](function(){})['catch'](_0x1e410f()));}}}return _0x320c08;})['all']();})[_0x37cd('0x2e')](function(){return db[_0x37cd('0x5f')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x37cd('0x54')],'as':_0x37cd('0x5d'),'where':{'id':LISTID}}]})[_0x37cd('0x2e')](function(_0x13e0f4){var _0x19bf68=[];if(_0x13e0f4){for(var _0x3c4715=0x0,_0x368fa4;_0x3c4715<_0x13e0f4[_0x37cd('0x1d')];_0x3c4715+=0x1){_0x368fa4=_0x13e0f4[_0x3c4715]['get']({'plain':!![]});_0x19bf68[_0x37cd('0x2f')](db[_0x37cd('0x58')]['query'](_0x213d10(_0x368fa4,_0x37cd('0x5e')))[_0x37cd('0x2e')](function(){})[_0x37cd('0x31')](_0x1e410f()));}}return _0x19bf68;})[_0x37cd('0x5c')]();})[_0x37cd('0x31')](function(_0x114be2){logger['error'](_0x37cd('0x60'),_0x37cd('0x61'),_0x114be2[_0x37cd('0x1f')]);});}var processPromises=function(_0x1f3ed7){return BPromise[_0x37cd('0x5c')](promises)['then'](function(_0x6d788e){})[_0x37cd('0x31')](function(_0x18fce9){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x37cd('0x33')](_0x18fce9));})[_0x37cd('0x62')](function(){socket[_0x37cd('0x63')](_0x37cd('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1f3ed7){return _0x1f3ed7[_0x37cd('0x65')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x37cd('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x37cd('0x2e')](function(){socket['emit'](_0x37cd('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x37cd('0x66')](FILEPATH);}catch(_0x1259ff){logger['error'](_0x37cd('0x67'),JSON[_0x37cd('0x33')](_0x1259ff));}finally{process[_0x37cd('0x68')](0x0);}});};process['on'](_0x37cd('0x69'),function(){logger[_0x37cd('0x6a')](_0x37cd('0x6b'));endCsv();});function main(){return BPromise['resolve']()[_0x37cd('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x37cd('0x14')](',');return db[_0x37cd('0x2c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x37cd('0x2e')](function(_0xb3d987){var _0x18a761=fs[_0x37cd('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x37cd('0x6d')](_0x18a761,{'header':!![],'skipEmptyLines':!![],'step':function(_0xc95ce5,_0x90c026){total+=0x1;var _0x18482d=total;promises[_0x37cd('0x2f')](checkRow(_0xc95ce5,_0xb3d987,_0x18482d)[_0x37cd('0x2e')](function(){success+=0x1;})['catch'](function(_0x344f91){if(_0x344f91[_0x37cd('0x17')]){errors+=0x1;delete _0x344f91[_0x37cd('0x17')];}else if(_0x344f91[_0x37cd('0x6e')]){duplicates+=0x1;delete _0x344f91[_0x37cd('0x6e')];}rows['push'](_0x344f91);}));if(total%0xc8===0x0){_0x90c026[_0x37cd('0x6f')]();return processPromises(_0x90c026);}},'complete':function(){return processPromises()[_0x37cd('0x2e')](function(){logger[_0x37cd('0x6a')](_0x37cd('0x70'));endCsv();});},'error':function(_0x4b8b36,_0x97bc2a){logger[_0x37cd('0x6a')](_0x37cd('0x71'),JSON[_0x37cd('0x33')](_0x4b8b36));endCsv();}});})[_0x37cd('0x31')](function(_0x4487cf){logger[_0x37cd('0x17')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x37cd('0x33')](_0x4487cf));});}main(); \ No newline at end of file +var _0x1339=['localhost','socket.io-emitter','argv','undefined','null','Missing\x20filepath\x20parameter!','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','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','scheduledAt','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_black','VoiceQueue','outbound','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','finally','emit','resume','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger'];(function(_0x39f53e,_0x41d6a7){var _0x4ca140=function(_0x3afef6){while(--_0x3afef6){_0x39f53e['push'](_0x39f53e['shift']());}};_0x4ca140(++_0x41d6a7);}(_0x1339,0x68));var _0x9133=function(_0xb63b4c,_0x212238){_0xb63b4c=_0xb63b4c-0x0;var _0xacf18d=_0x1339[_0xb63b4c];return _0xacf18d;};'use strict';var BPromise=require(_0x9133('0x0'));var util=require(_0x9133('0x1'));var _=require(_0x9133('0x2'));var fs=require('fs');var squel=require(_0x9133('0x3'));var Papa=require(_0x9133('0x4'));var Redis=require(_0x9133('0x5'));var db=require(_0x9133('0x6'))['db'];var config=require(_0x9133('0x7'));var logger=require(_0x9133('0x8'))('api');config['redis']=_['defaults'](config['redis'],{'host':_0x9133('0x9'),'port':0x18eb});var socket=require(_0x9133('0xa'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process['argv'][0x2]||process[_0x9133('0xb')][0x2]===_0x9133('0xc')||process[_0x9133('0xb')][0x2]===_0x9133('0xd')){throw new Error(_0x9133('0xe'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x9133('0xb')][0x3]===_0x9133('0xc')||process[_0x9133('0xb')][0x3]===_0x9133('0xd')||!process[_0x9133('0xb')][0x4]||process[_0x9133('0xb')][0x4]===_0x9133('0xc')||process[_0x9133('0xb')][0x4]===_0x9133('0xd')){throw new Error(_0x9133('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x9133('0x10')](','),process[_0x9133('0xb')][0x4][_0x9133('0x10')](','));if(!process[_0x9133('0xb')][0x5]||process['argv'][0x5]===_0x9133('0xc')||process['argv'][0x5]===_0x9133('0xd')){throw new Error(_0x9133('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x9133('0xb')][0x6]&&process[_0x9133('0xb')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x9133('0xd')?process[_0x9133('0xb')][0x6]:null;var DUPLICATES=process[_0x9133('0xb')][0x7]&&process[_0x9133('0xb')][0x7]!==_0x9133('0xc')&&process[_0x9133('0xb')][0x7]!==_0x9133('0xd')?process[_0x9133('0xb')][0x7]:null;if(!process[_0x9133('0xb')][0x8]||process[_0x9133('0xb')][0x8]==='undefined'||process[_0x9133('0xb')][0x8]===_0x9133('0xd')){throw new Error(_0x9133('0x12'));}var SOCKET_TIMESTAMP=process[_0x9133('0xb')][0x8];}catch(_0x4179ed){logger[_0x9133('0x13')](_0x4179ed);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(_0x536bf3,_0x1ec88b,_0x22c432,_0x882109){var _0x3379f1={'message':_0x1ec88b};_0x3379f1[_0x536bf3]=!![];if(_0x22c432){_0x3379f1[_0x9133('0x14')]=_0x22c432;}if(_0x882109){_0x3379f1[_0x9133('0x15')]=_0x882109;}return _0x3379f1;}function isEmail(_0x2c61e7){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))*$/[_0x9133('0x16')](_0x2c61e7);}function checkRow(_0x48675e,_0x5247d9,_0x3d0cbd){return new BPromise(function(_0x30244c,_0x52a237){if(_[_0x9133('0x17')](_0x48675e)){return _0x52a237(handleCheckRowError('error',_0x9133('0x18'),null,_0x3d0cbd));}if(_0x48675e[_0x9133('0x19')]&&_0x48675e['errors'][_0x9133('0x1a')]){var _0x54f83b=_[_0x9133('0x1b')](_0x48675e[_0x9133('0x19')],_0x9133('0x1c'))[_0x9133('0x1d')](';');return _0x52a237(handleCheckRowError(_0x9133('0x13'),_0x54f83b,null,_0x3d0cbd));}var _0x1da2f6={};for(var _0x1a2bfe in FIELDS){if(FIELDS[_0x9133('0x1e')](_0x1a2bfe)&&FIELDS[_0x1a2bfe]){_0x1da2f6[_0x1a2bfe]=_0x48675e[_0x9133('0x1f')][0x0][FIELDS[_0x1a2bfe]]||_0x48675e[_0x9133('0x1f')][0x0]['\ufeff'+FIELDS[_0x1a2bfe]];}}if(!_0x1da2f6[_0x9133('0x20')]){return _0x52a237(handleCheckRowError('error',_0x9133('0x21'),null,_0x3d0cbd));}if(!_0x1da2f6[_0x9133('0x22')]){return _0x52a237(handleCheckRowError(_0x9133('0x13'),_0x9133('0x23'),null,_0x3d0cbd));}if(_0x1da2f6[_0x9133('0x24')]){var _0x595d79=moment(_0x1da2f6['birthDate'],'YYYY-MM-DD');if(!_0x595d79[_0x9133('0x25')]()){return _0x52a237(handleCheckRowError(_0x9133('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x3d0cbd));}}if(_0x1da2f6[_0x9133('0x26')]){if(!isEmail(_0x1da2f6[_0x9133('0x26')])){return _0x52a237(handleCheckRowError(_0x9133('0x13'),_0x9133('0x27'),null,_0x3d0cbd));}}_0x1da2f6[_0x9133('0x28')]=LISTID;_0x1da2f6[_0x9133('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x5247d9){var _0x20ecd6={};for(var _0x1f931f=0x0,_0x2724a9=DUPLICATES[_0x9133('0x1a')];_0x1f931f<_0x2724a9;_0x1f931f+=0x1){_0x20ecd6[DUPLICATES[_0x1f931f]]=_0x1da2f6[DUPLICATES[_0x1f931f]];}var _0x3dd242=_[_0x9133('0x2a')](_0x5247d9,_0x20ecd6);if(_0x3dd242){return _0x52a237(handleCheckRowError(_0x9133('0x2b'),_0x9133('0x2c'),_0x3dd242,_0x3d0cbd));}}return db[_0x9133('0x2d')][_0x9133('0x2e')](_0x1da2f6,{'raw':!![],'hooks':![],'fields':_[_0x9133('0x2f')](_0x1da2f6)})[_0x9133('0x30')](function(_0x96d2bf){if(DUPLICATES&&DUPLICATES['length']&&_0x5247d9){_0x5247d9[_0x9133('0x31')](_['pick'](_0x1da2f6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x96d2bf['id'];return _0x30244c();})[_0x9133('0x32')](function(_0x1f6d03){return _0x52a237(handleCheckRowError(_0x9133('0x13'),_0x9133('0x33')+(_0x1f6d03[_0x9133('0x1c')]||JSON[_0x9133('0x34')](_0x1f6d03)),null,_0x3d0cbd));});});}function checkHopper(){function _0x5edee1(){return function(_0x415eb9){logger[_0x9133('0x13')](_0x9133('0x35'),_0x9133('0x36'),util[_0x9133('0x37')](_0x415eb9,{'showHidden':![],'depth':null}));};}var _0x847e1d=function(_0x4b5260,_0x13aab3){var _0x464e47=squel[_0x9133('0x38')]()[_0x9133('0x39')](_0x9133('0x3a'))[_0x9133('0x3b')]([_0x9133('0x22'),'scheduledAt',_0x9133('0x3c'),_0x9133('0x28'),_0x13aab3,_0x9133('0x3d'),_0x9133('0x3e')],squel['select']()['field'](_0x9133('0x22'),_0x9133('0x22'))[_0x9133('0x3f')](_0x9133('0x40'),'scheduledAt')[_0x9133('0x3f')]('id',_0x9133('0x3c'))[_0x9133('0x3f')](LISTID[_0x9133('0x41')](),_0x9133('0x28'))[_0x9133('0x3f')](_0x4b5260['id']['toString'](),_0x13aab3)['field']('NOW()',_0x9133('0x3d'))[_0x9133('0x3f')](_0x9133('0x40'),_0x9133('0x3e'))[_0x9133('0x42')](_0x9133('0x43'))[_0x9133('0x44')](_0x9133('0x45'))['where'](_0x9133('0x46'),LISTID[_0x9133('0x41')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x9133('0x47'),squel[_0x9133('0x48')]()['field'](_0x9133('0x22'))[_0x9133('0x42')]('cm_hopper')[_0x9133('0x44')](_0x13aab3+_0x9133('0x49'),_0x4b5260['id'][_0x9133('0x41')]())))[_0x9133('0x41')]();return _0x464e47;};var _0x3735e5=function(_0x171470,_0x6d1518){var _0x54dcc1=squel[_0x9133('0x38')]()[_0x9133('0x39')]('cm_hopper')[_0x9133('0x3b')]([_0x9133('0x22'),_0x9133('0x4a'),_0x9133('0x3c'),_0x9133('0x28'),_0x6d1518,_0x9133('0x3d'),_0x9133('0x3e')],squel[_0x9133('0x48')]()[_0x9133('0x3f')](_0x9133('0x22'),_0x9133('0x22'))[_0x9133('0x3f')](_0x9133('0x40'),_0x9133('0x4a'))[_0x9133('0x3f')]('id',_0x9133('0x3c'))[_0x9133('0x3f')](LISTID[_0x9133('0x41')](),'ListId')['field'](_0x171470['id'][_0x9133('0x41')](),_0x6d1518)[_0x9133('0x3f')](_0x9133('0x40'),_0x9133('0x3d'))[_0x9133('0x3f')](_0x9133('0x40'),_0x9133('0x3e'))[_0x9133('0x42')](_0x9133('0x43'))[_0x9133('0x44')]('deletedAt\x20IS\x20NULL')[_0x9133('0x44')](_0x9133('0x46'),LISTID[_0x9133('0x41')]())['where'](_0x9133('0x4b'),squel[_0x9133('0x4c')](hopperContacts))[_0x9133('0x44')](_0x9133('0x4d'))[_0x9133('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9133('0x48')]()[_0x9133('0x3f')](_0x9133('0x4e'))[_0x9133('0x42')]('cm_hopper_final')[_0x9133('0x44')](_0x6d1518+_0x9133('0x49'),_0x171470['id'][_0x9133('0x41')]()))[_0x9133('0x44')](_0x9133('0x47'),squel['select']()[_0x9133('0x3f')](_0x9133('0x22'))[_0x9133('0x42')](_0x9133('0x3a'))[_0x9133('0x44')](_0x6d1518+'\x20=\x20?',_0x171470['id'][_0x9133('0x41')]())))['toString']();return _0x54dcc1;};function _0x2a0cbe(_0x6f9591,_0xe63e60){var _0x57bd19=squel['insert']()[_0x9133('0x39')](_0x9133('0x3a'))['fromQuery']([_0x9133('0x22'),_0x9133('0x4a'),_0x9133('0x3c'),_0x9133('0x28'),_0xe63e60,'createdAt',_0x9133('0x3e')],squel[_0x9133('0x48')]()['field'](_0x9133('0x22'),_0x9133('0x22'))[_0x9133('0x3f')]('NOW()','scheduledAt')[_0x9133('0x3f')]('id',_0x9133('0x3c'))['field'](LISTID[_0x9133('0x41')](),'ListId')[_0x9133('0x3f')](_0x6f9591['id'][_0x9133('0x41')](),_0xe63e60)[_0x9133('0x3f')](_0x9133('0x40'),_0x9133('0x3d'))[_0x9133('0x3f')](_0x9133('0x40'),_0x9133('0x3e'))['from'](_0x9133('0x43'))[_0x9133('0x44')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x9133('0x41')]())[_0x9133('0x44')](_0x9133('0x4b'),squel[_0x9133('0x4c')](hopperContacts))[_0x9133('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0x9133('0x41')]();return _0x57bd19;}function _0x229e36(_0x30df27,_0x58244a){var _0x5cff50=squel[_0x9133('0x38')]()[_0x9133('0x39')](_0x9133('0x4f'))[_0x9133('0x3b')]([_0x9133('0x22'),_0x9133('0x3c'),'ListId',_0x58244a,_0x9133('0x3d'),'updatedAt'],squel['select']()[_0x9133('0x3f')](_0x9133('0x22'),_0x9133('0x22'))[_0x9133('0x3f')]('id',_0x9133('0x3c'))[_0x9133('0x3f')](LISTID['toString'](),_0x9133('0x28'))['field'](_0x30df27['id'][_0x9133('0x41')](),_0x58244a)['field'](_0x9133('0x40'),_0x9133('0x3d'))[_0x9133('0x3f')]('NOW()',_0x9133('0x3e'))[_0x9133('0x42')](_0x9133('0x43'))[_0x9133('0x44')](_0x9133('0x45'))[_0x9133('0x44')](_0x9133('0x46'),LISTID[_0x9133('0x41')]())[_0x9133('0x44')](_0x9133('0x4b'),squel[_0x9133('0x4c')](hopperContacts))[_0x9133('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0x9133('0x41')]();return _0x5cff50;}return db[_0x9133('0x50')]['findAll']({'where':{'type':_0x9133('0x51')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x9133('0x52')],'as':_0x9133('0x53'),'where':{'id':LISTID}}]})[_0x9133('0x30')](function(_0x1048f1){var _0x1364e0=[];if(_0x1048f1){var _0x4613b8;for(var _0x524363=0x0,_0x5e3394;_0x524363<_0x1048f1[_0x9133('0x1a')];_0x524363+=0x1){_0x5e3394=_0x1048f1[_0x524363][_0x9133('0x54')]({'plain':!![]});switch(_0x5e3394[_0x9133('0x55')]){case _0x9133('0x56'):_0x1364e0[_0x9133('0x31')](db[_0x9133('0x57')][_0x9133('0x58')](_0x3735e5(_0x5e3394,_0x9133('0x59')))[_0x9133('0x30')](function(){})[_0x9133('0x32')](_0x5edee1()));break;case _0x9133('0x5a'):_0x1364e0[_0x9133('0x31')](db[_0x9133('0x57')][_0x9133('0x58')](_0x847e1d(_0x5e3394,_0x9133('0x59')))[_0x9133('0x30')](function(){})[_0x9133('0x32')](_0x5edee1()));break;default:_0x1364e0[_0x9133('0x31')](db[_0x9133('0x57')]['query'](_0x2a0cbe(_0x5e3394,_0x9133('0x59')))[_0x9133('0x30')](function(){})['catch'](_0x5edee1()));}}}return _0x1364e0;})[_0x9133('0x5b')]()[_0x9133('0x30')](function(){return db['VoiceQueue'][_0x9133('0x5c')]({'where':{'type':_0x9133('0x51')},'attributes':['id'],'include':[{'model':db[_0x9133('0x52')],'as':_0x9133('0x5d'),'where':{'id':LISTID}}]})[_0x9133('0x30')](function(_0x4f41c3){var _0x51b259=[];if(_0x4f41c3){var _0x1f647a;for(var _0x9664af=0x0,_0x565d90;_0x9664af<_0x4f41c3['length'];_0x9664af+=0x1){_0x565d90=_0x4f41c3[_0x9664af][_0x9133('0x54')]({'plain':!![]});_0x51b259[_0x9133('0x31')](db[_0x9133('0x57')][_0x9133('0x58')](_0x229e36(_0x565d90,_0x9133('0x59')))[_0x9133('0x30')](function(){})[_0x9133('0x32')](_0x5edee1()));}}return _0x51b259;})[_0x9133('0x5b')]();})[_0x9133('0x30')](function(){return db[_0x9133('0x5e')][_0x9133('0x5c')]({'attributes':['id',_0x9133('0x55')],'include':[{'model':db['CmList'],'as':_0x9133('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x370d0d){var _0x3f9a36=[];if(_0x370d0d){for(var _0x1a3f94=0x0,_0x5b8376;_0x1a3f94<_0x370d0d[_0x9133('0x1a')];_0x1a3f94+=0x1){_0x5b8376=_0x370d0d[_0x1a3f94][_0x9133('0x54')]({'plain':!![]});switch(_0x5b8376[_0x9133('0x55')]){case _0x9133('0x56'):_0x3f9a36['push'](db['sequelize'][_0x9133('0x58')](_0x3735e5(_0x5b8376,_0x9133('0x5f')))['then'](function(){})[_0x9133('0x32')](_0x5edee1()));break;case'onlyIfOpen':_0x3f9a36[_0x9133('0x31')](db[_0x9133('0x57')][_0x9133('0x58')](_0x847e1d(_0x5b8376,'CampaignId'))[_0x9133('0x30')](function(){})[_0x9133('0x32')](_0x5edee1()));break;default:_0x3f9a36[_0x9133('0x31')](db[_0x9133('0x57')][_0x9133('0x58')](_0x2a0cbe(_0x5b8376,'CampaignId'))[_0x9133('0x30')](function(){})[_0x9133('0x32')](_0x5edee1()));}}}return _0x3f9a36;})[_0x9133('0x5b')]();})[_0x9133('0x30')](function(){return db[_0x9133('0x5e')][_0x9133('0x5c')]({'attributes':['id'],'include':[{'model':db[_0x9133('0x52')],'as':_0x9133('0x5d'),'where':{'id':LISTID}}]})[_0x9133('0x30')](function(_0x33d0ad){var _0x3f8706=[];if(_0x33d0ad){for(var _0x538851=0x0,_0x5d467b;_0x538851<_0x33d0ad[_0x9133('0x1a')];_0x538851+=0x1){_0x5d467b=_0x33d0ad[_0x538851][_0x9133('0x54')]({'plain':!![]});_0x3f8706[_0x9133('0x31')](db[_0x9133('0x57')][_0x9133('0x58')](_0x229e36(_0x5d467b,_0x9133('0x5f')))[_0x9133('0x30')](function(){})[_0x9133('0x32')](_0x5edee1()));}}return _0x3f8706;})[_0x9133('0x5b')]();})['catch'](function(_0x3946bc){logger[_0x9133('0x13')](_0x9133('0x60'),'generalCheckHopper',_0x3946bc[_0x9133('0x1c')]);});}var processPromises=function(_0x277633){return BPromise[_0x9133('0x5b')](promises)[_0x9133('0x30')](function(_0x1468bd){})['catch'](function(_0x394a68){logger[_0x9133('0x13')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x394a68));})[_0x9133('0x61')](function(){socket[_0x9133('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x277633){return _0x277633[_0x9133('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x9133('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x9133('0x30')](function(){socket[_0x9133('0x62')](_0x9133('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9133('0x65')](FILEPATH);}catch(_0x415ec5){logger['error'](_0x9133('0x66'),JSON[_0x9133('0x34')](_0x415ec5));}finally{process[_0x9133('0x67')](0x0);}});};process['on'](_0x9133('0x68'),function(){logger[_0x9133('0x69')](_0x9133('0x6a'));endCsv();});function main(){return BPromise['resolve']()[_0x9133('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9133('0x10')](',');return db[_0x9133('0x2d')][_0x9133('0x5c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9133('0x30')](function(_0x1bc7ff){var _0xbc9e03=fs[_0x9133('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9133('0x6c')](_0xbc9e03,{'header':!![],'skipEmptyLines':!![],'step':function(_0x52fda7,_0xc4c39b){total+=0x1;var _0x2f2410=total;promises[_0x9133('0x31')](checkRow(_0x52fda7,_0x1bc7ff,_0x2f2410)[_0x9133('0x30')](function(){success+=0x1;})[_0x9133('0x32')](function(_0x34c2dc){if(_0x34c2dc[_0x9133('0x13')]){errors+=0x1;delete _0x34c2dc[_0x9133('0x13')];}else if(_0x34c2dc['duplicate']){duplicates+=0x1;delete _0x34c2dc[_0x9133('0x2b')];}rows['push'](_0x34c2dc);}));if(total%0xc8===0x0){_0xc4c39b[_0x9133('0x6d')]();return processPromises(_0xc4c39b);}},'complete':function(){return processPromises()['then'](function(){logger[_0x9133('0x69')](_0x9133('0x6e'));endCsv();});},'error':function(_0x3aca66,_0x455957){logger['info'](_0x9133('0x6f'),JSON[_0x9133('0x34')](_0x3aca66));endCsv();}});})[_0x9133('0x32')](function(_0x3c0039){logger[_0x9133('0x13')](_0x9133('0x70'),JSON[_0x9133('0x34')](_0x3c0039));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 770189f..432eca5 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 _0x3212=['id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','push','code','message','sequelize','query','spread','catch','main','stringify','start','binding','socket_timestamp','server/files/tmp','.csv','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','SystemRow','appendFileSync','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','emit','contact:import:','unlink','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','SIGINT','path','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','phone','scheduledat','ListId','createdAt','priority','UserId','recallme','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','updatedAt','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3212,0xd2));var _0x2321=function(_0x352419,_0x1d1491){_0x352419=_0x352419-0x0;var _0x3a1afc=_0x3212[_0x352419];return _0x3a1afc;};'use strict';var fs=require('fs');var path=require(_0x2321('0x0'));var _=require('lodash');var Papa=require(_0x2321('0x1'));var util=require(_0x2321('0x2'));var BPromise=require(_0x2321('0x3'));var moment=require(_0x2321('0x4'));var squel=require(_0x2321('0x5'));var Redis=require(_0x2321('0x6'));var db=require(_0x2321('0x7'))['db'];var config=require(_0x2321('0x8'));var logger=require('../../../config/logger')(_0x2321('0x9'));config[_0x2321('0xa')]=_['defaults'](config[_0x2321('0xa')],{'host':_0x2321('0xb'),'port':0x18eb});var socket=require(_0x2321('0xc'))(new Redis(config[_0x2321('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x2321('0xd')](_0x2321('0xe'));function isEmail(_0x50a496){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))*$/[_0x2321('0xf')](_0x50a496);}function selectNotIn(_0x289baf,_0x8bb6a7,_0x5749c5,_0x5e8a88,_0x5a4b61){return squel['select']()[_0x2321('0x10')]('phone')[_0x2321('0x11')](_0x5e8a88)[_0x2321('0x12')](_0x8bb6a7,null,_0x8bb6a7+_0x2321('0x13')+_0x5e8a88+'.'+_0x5749c5)[_0x2321('0x14')](_0x5e8a88+'.'+_0x5749c5+_0x2321('0x15')+_0x289baf+'.'+_0x5749c5)[_0x2321('0x14')](_0x8bb6a7+_0x2321('0x16')+_0x5a4b61[_0x2321('0x12')]()+')');}function insertCmHopper(_0x4e63c0,_0x111fb2,_0xf19b45,_0x589bb1,_0x36e9a2){var _0x176340=[_0x2321('0x17'),_0x2321('0x18'),_0x2321('0x19'),_0x2321('0x1a'),_0x111fb2+'.'+_0x589bb1,_0x2321('0x1b'),_0x2321('0x1c'),_0x2321('0x1d'),'cm_contacts.UserId','\x22'+_0x36e9a2+'\x22'];return squel[_0x2321('0x1e')]()[_0x2321('0x1f')]('cm_hopper')[_0x2321('0x20')]([_0x2321('0x21'),_0x2321('0x22'),'ContactId',_0x2321('0x23'),_0x589bb1,_0x2321('0x24'),'updatedAt',_0x2321('0x25'),_0x2321('0x26'),_0x2321('0x27')],squel[_0x2321('0x28')]()[_0x2321('0x29')](_0x176340)['from'](_0x111fb2)[_0x2321('0x12')]('cm_contacts',null,_0x2321('0x2a')+_0x111fb2+_0x2321('0x2b'))[_0x2321('0x12')](_0xf19b45,null,_0xf19b45+_0x2321('0x13')+_0x111fb2+'.'+_0x589bb1)[_0x2321('0x14')](_0x111fb2+'.CmListId\x20=\x20?',_0x4e63c0)[_0x2321('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2321('0x14')](_0x2321('0x2c'),selectNotIn(_0x111fb2,_0xf19b45,_0x589bb1,_0x2321('0x2d'),[_0x2321('0x2e'),_0x2321('0x2f')]))[_0x2321('0x14')](_0x2321('0x2c'),selectNotIn(_0x111fb2,_0xf19b45,_0x589bb1,'cm_hopper',[_0x2321('0x2e')])))[_0x2321('0x30')]();}function insertCmHopperBlack(_0x250ece,_0x4bb790,_0x1a7134,_0x18d279){var _0x175ed7=[_0x2321('0x17'),_0x2321('0x19'),_0x2321('0x1a'),_0x4bb790+'.'+_0x18d279,_0x2321('0x1b'),'cm_contacts.updatedAt'];return squel['insert']()[_0x2321('0x1f')](_0x2321('0x31'))['fromQuery']([_0x2321('0x21'),'ContactId',_0x2321('0x23'),_0x18d279,_0x2321('0x24'),_0x2321('0x32')],squel[_0x2321('0x28')]()[_0x2321('0x29')](_0x175ed7)[_0x2321('0x11')](_0x4bb790)[_0x2321('0x12')](_0x2321('0x33'),null,_0x2321('0x2a')+_0x4bb790+_0x2321('0x2b'))[_0x2321('0x12')](_0x1a7134,null,_0x1a7134+_0x2321('0x13')+_0x4bb790+'.'+_0x18d279)[_0x2321('0x14')](_0x4bb790+_0x2321('0x34'),_0x250ece)[_0x2321('0x14')](_0x2321('0x35'),NOW)[_0x2321('0x14')](_0x2321('0x2c'),squel[_0x2321('0x28')]()['field'](_0x2321('0x21'))['from'](_0x2321('0x31'))['where'](_0x2321('0x36'),_0x250ece)[_0x2321('0x14')](_0x18d279+_0x2321('0x37'),_0x4bb790+'.'+_0x18d279)))[_0x2321('0x30')]();}function insertCmContact(_0x5ca9b3,_0x2712a7,_0x50a293,_0x21a3bb){var _0x1bdc11=_['concat'](_[_0x2321('0x38')](_0x21a3bb),[_0x2321('0x23'),_0x2321('0x39'),_0x2321('0x24'),_0x2321('0x32')]);return squel[_0x2321('0x1e')]()['into'](_0x2321('0x33'))[_0x2321('0x20')](_0x1bdc11,squel['select']()[_0x2321('0x29')](_0x1bdc11)['from'](_0x2712a7)[_0x2321('0x14')]('('+_0x50a293[_0x2321('0x12')](',')+_0x2321('0x3a'),squel[_0x2321('0x28')]()[_0x2321('0x29')](_0x50a293)[_0x2321('0x11')](_0x2321('0x33'))['where'](_0x2321('0x36'),_0x5ca9b3)['where'](_0x2321('0x3b')))[_0x2321('0x14')](_0x2321('0x3c'),squel[_0x2321('0x28')]()['field'](_0x2321('0x3d'),_0x2321('0x3e'))[_0x2321('0x11')](_0x2712a7)[_0x2321('0x3f')](_0x50a293[_0x2321('0x12')](','))))[_0x2321('0x30')]();}function handleStop(){logger[_0x2321('0x40')](_0x2321('0x41'));stopped=!![];}function handleUncaughtException(_0x22f307){logger[_0x2321('0x42')](_0x22f307['message']);process[_0x2321('0x43')](0x1);}function handleError(_0x421e9e,_0x4183b5){stats[_0x2321('0x44')][_0x2321('0x45')]({'name':_0x4183b5[_0x2321('0x46')],'message':_0x4183b5[_0x2321('0x47')],'row':_0x421e9e});}function handleQuery(_0x391521){logger[_0x2321('0x40')](_0x391521);return db[_0x2321('0x48')][_0x2321('0x49')](_0x391521)[_0x2321('0x4a')](function(_0x15c2b2){results[_0x2321('0x45')](_0x15c2b2);})[_0x2321('0x4b')](function(_0x621430){logger[_0x2321('0x42')](_0x621430[_0x2321('0x47')]);});}function main(_0x15ba44,_0x137d5c,_0x1c0869,_0x48fd26){logger[_0x2321('0x40')](_0x2321('0x4c'),_0x15ba44,JSON[_0x2321('0x4d')](_0x137d5c));process['send'](_0x2321('0x4e'));var _0x15f501=_0x137d5c[_0x2321('0x4f')];var _0x29db8c=_0x137d5c[_0x2321('0x50')];var _0x430394=path[_0x2321('0x12')](config['root'],_0x2321('0x51'),_0x29db8c+_0x2321('0x52'));var _0xd60210=_[_0x2321('0x38')](_0x15f501)[_0x2321('0x12')]();logger[_0x2321('0x40')]('header',_0xd60210);fs[_0x2321('0x53')](_0x430394,_0xd60210+'\x0a');Papa[_0x2321('0x54')](fs[_0x2321('0x55')](_0x15ba44),{'header':!![],'skipEmptyLines':!![],'step':function(_0x427899,_0x57b2d7){try{for(var _0x4ce93f=0x0,_0x2d65a7=[];_0x4ce93f<_0x427899[_0x2321('0x56')][_0x2321('0x57')];_0x4ce93f++){stats[_0x2321('0x58')]+=0x1;if(_0x427899[_0x2321('0x44')][_0x4ce93f]){handleError(_0x427899[_0x2321('0x56')][_0x4ce93f],_0x427899[_0x2321('0x44')][_0x4ce93f]);}else{var _0x4756e4=[];for(var _0x3bdfff in _0x15f501){if(_0x15f501[_0x2321('0x59')](_0x3bdfff)){if(_0x427899[_0x2321('0x56')][_0x4ce93f][_0x15f501[_0x3bdfff]]){var _0x1f534=_['trim'](_0x427899['data'][_0x4ce93f][_0x15f501[_0x3bdfff]][_0x2321('0x5a')](/"/g,'\x27'));switch(_0x3bdfff){case _0x2321('0x22'):var _0x8dc79e=moment(_0x1f534,_0x2321('0xe'),!![]);if(_0x8dc79e['isValid']()){_0x2d65a7[_0x2321('0x45')]('\x22'+_0x1f534+'\x22');}else{_0x4756e4[_0x2321('0x45')](_0x2321('0x5b'));}break;case _0x2321('0x25'):var _0x209b39=parseInt(_0x1f534);_0x1f534=_['isNaN'](_0x209b39)||_0x209b39<0x0||_0x209b39>0x4?_0x48fd26?0x3:0x2:_0x209b39;_0x2d65a7[_0x2321('0x45')]('\x22'+_0x1f534+'\x22');break;case _0x2321('0x26'):var _0x3c8983=parseInt(_0x1f534);if(_[_0x2321('0x5c')](_0x3c8983)&&_[_0x2321('0x5d')](_0x1c0869,_0x3c8983)){_0x2d65a7['push']('\x22'+_0x3c8983+'\x22');}else{_0x4756e4[_0x2321('0x45')](_0x2321('0x5e'));}break;case _0x2321('0x5f'):if(isEmail(_0x1f534)){_0x2d65a7[_0x2321('0x45')]('\x22'+_0x1f534+'\x22');}else{_0x4756e4[_0x2321('0x45')](_0x2321('0x60'));}break;case _0x2321('0x61'):var _0x2e485a=moment(_0x1f534,_0x2321('0x62'),!![]);if(_0x2e485a[_0x2321('0x63')]()){_0x2d65a7[_0x2321('0x45')]('\x22'+_0x1f534+'\x22');}else{_0x4756e4[_0x2321('0x45')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2d65a7[_0x2321('0x45')]('\x22'+_0x1f534+'\x22');}}else{switch(_0x3bdfff){case'firstName':case _0x2321('0x21'):_0x4756e4['push'](_0x3bdfff+'\x20not\x20specified');break;default:_0x2d65a7[_0x2321('0x45')]('\x22\x22');}}}}if(_0x4756e4[_0x2321('0x57')]){handleError(_0x427899[_0x2321('0x56')][_0x4ce93f],{'code':_0x2321('0x64'),'message':_0x4756e4['join']()});}else{fs[_0x2321('0x65')](_0x430394,_0x2d65a7['join']()+'\x0a');}_0x2d65a7=[];}if(!(stats[_0x2321('0x58')]%0xc8)){socket['emit']('contact:import:'+_0x29db8c,stats);stats['errors']=[];}}if(stopped){logger[_0x2321('0x40')](_0x2321('0x66'));_0x57b2d7[_0x2321('0x67')]();}}catch(_0x58fac5){handleError(_0x427899[_0x2321('0x56')][_0x4ce93f],{'code':_0x2321('0x68'),'message':_0x58fac5[_0x2321('0x47')]});logger['error'](_0x2321('0x69'),_0x58fac5[_0x2321('0x47')]);}},'complete':function(){try{var _0x5b92d4=[];var _0x2c95d1=_0x2321('0x33');if(_0x137d5c[_0x2321('0x6a')]&&_0x137d5c[_0x2321('0x6a')]['length']){_0x2c95d1=_0x2321('0x6b')+_0x29db8c;_0x5b92d4[_0x2321('0x45')]('CREATE\x20TABLE\x20'+_0x2c95d1+'\x20LIKE\x20cm_contacts;');}var _0x1d5461=util[_0x2321('0xd')](_0x2321('0x6c'),_0x430394,_0x2c95d1,_0xd60210,_0x137d5c[_0x2321('0x23')],_0x137d5c[_0x2321('0x39')]||null,NOW,NOW);if(_[_0x2321('0x6d')](_0x15f501['scheduledat'])){_0x1d5461+=_0x2321('0x6e');}_0x5b92d4[_0x2321('0x45')](_0x1d5461);if(_0x137d5c[_0x2321('0x6a')]&&_0x137d5c[_0x2321('0x6a')][_0x2321('0x57')]){_0x5b92d4[_0x2321('0x45')](insertCmContact(_0x137d5c[_0x2321('0x23')],_0x2c95d1,_0x137d5c[_0x2321('0x6a')],_0x15f501));_0x5b92d4[_0x2321('0x45')](_0x2321('0x6f')+_0x2c95d1+';');}_0x5b92d4[_0x2321('0x45')](insertCmHopper(_0x137d5c[_0x2321('0x23')],'voice_queues_has_cm_lists',_0x2321('0x70'),'VoiceQueueId',_0x48fd26));_0x5b92d4['push'](insertCmHopperBlack(_0x137d5c[_0x2321('0x23')],_0x2321('0x71'),_0x2321('0x70'),_0x2321('0x72')));_0x5b92d4['push'](insertCmHopper(_0x137d5c['ListId'],_0x2321('0x73'),_0x2321('0x74'),_0x2321('0x75'),_0x48fd26));_0x5b92d4[_0x2321('0x45')](insertCmHopperBlack(_0x137d5c[_0x2321('0x23')],'campaigns_has_cm_blacklists',_0x2321('0x74'),_0x2321('0x75')));BPromise[_0x2321('0x76')](_0x5b92d4,handleQuery)[_0x2321('0x77')](function(_0x29e41a){stats[_0x2321('0x78')]=!![];stats['affectedRows']=_0x137d5c[_0x2321('0x6a')]&&_0x137d5c[_0x2321('0x6a')][_0x2321('0x57')]?results[0x2][_0x2321('0x79')]:results[0x0][_0x2321('0x79')];socket[_0x2321('0x7a')](_0x2321('0x7b')+_0x29db8c,stats);fs[_0x2321('0x7c')](_0x15ba44);fs['unlink'](_0x430394);process[_0x2321('0x43')](0x0);})[_0x2321('0x4b')](function(_0x5075dc){logger['error'](_0x5075dc[_0x2321('0x47')]);process[_0x2321('0x43')](0x1);});}catch(_0x39fb7b){logger['error'](_0x2321('0x7d'),_0x39fb7b[_0x2321('0x47')]);process['exit'](0x1);}},'error':function(_0x50750d,_0x3d8052,_0x3185f7,_0x1f3216){throw new Error(_0x1f3216);}});}function validate(){if(process['argv']&&process[_0x2321('0x7e')][_0x2321('0x57')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x3e6750=path[_0x2321('0x12')](config[_0x2321('0x7f')],_0x2321('0x51'),process[_0x2321('0x7e')][0x2]);if(!fs[_0x2321('0x80')](_0x3e6750)){throw new Error(_0x2321('0x81'));}var _0x30bb7f={};try{_0x30bb7f=JSON[_0x2321('0x54')](process[_0x2321('0x7e')][0x3]);if(!_0x30bb7f['binding']){throw new Error(_0x2321('0x82'));}if(!_0x30bb7f[_0x2321('0x4f')][_0x2321('0x21')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x30bb7f[_0x2321('0x4f')][_0x2321('0x83')]){throw new Error(_0x2321('0x84'));}var _0xd3b8b=0x0;if(_0x30bb7f[_0x2321('0x4f')][_0x2321('0x26')]){_0xd3b8b=0x1;}if(!_0x30bb7f['ListId']){throw new Error(_0x2321('0x85'));}}catch(_0x5aa4cf){throw new Error('body\x20id\x20mandatory');}var _0x3a9a4b=[];try{_0x3a9a4b=_['map'](JSON[_0x2321('0x54')](process[_0x2321('0x7e')][0x4]),'id');}catch(_0x50d714){logger[_0x2321('0x40')]('No\x20agent\x20available');}main(_0x3e6750,_0x30bb7f,_0x3a9a4b,_0xd3b8b);}validate();process['on'](_0x2321('0x86'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xb3c0=['.CmListId','.CmListId\x20=\x20?','field','cm_hopper_black','ListId\x20=\x20?','toString','concat','keys','CompanyId','fields','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','data','length','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','catch','complete','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','body\x20id\x20mandatory','argv','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','moment','squel','ioredis','../../../config/logger','import','defaults','redis','localhost','YYYY-MM-DD\x20HH:mm:ss','select','phone','from','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.updatedAt','ContactId'];(function(_0x5c0a22,_0x3e0eb3){var _0x292d8e=function(_0x28c9e6){while(--_0x28c9e6){_0x5c0a22['push'](_0x5c0a22['shift']());}};_0x292d8e(++_0x3e0eb3);}(_0xb3c0,0xd8));var _0x0b3c=function(_0x207179,_0x2b6062){_0x207179=_0x207179-0x0;var _0x271415=_0xb3c0[_0x207179];return _0x271415;};'use strict';var fs=require('fs');var path=require(_0x0b3c('0x0'));var _=require(_0x0b3c('0x1'));var Papa=require(_0x0b3c('0x2'));var util=require(_0x0b3c('0x3'));var BPromise=require('bluebird');var moment=require(_0x0b3c('0x4'));var squel=require(_0x0b3c('0x5'));var Redis=require(_0x0b3c('0x6'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x0b3c('0x7'))(_0x0b3c('0x8'));config['redis']=_[_0x0b3c('0x9')](config[_0x0b3c('0xa')],{'host':_0x0b3c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b3c('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x0b3c('0xc'));function isEmail(_0x4eb6de){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'](_0x4eb6de);}function selectNotIn(_0x271193,_0xf8c55f,_0x10027c,_0x2c52e1,_0x4933ff){return squel[_0x0b3c('0xd')]()['field'](_0x0b3c('0xe'))[_0x0b3c('0xf')](_0x2c52e1)[_0x0b3c('0x10')](_0xf8c55f,null,_0xf8c55f+'.id\x20=\x20'+_0x2c52e1+'.'+_0x10027c)['where'](_0x2c52e1+'.'+_0x10027c+_0x0b3c('0x11')+_0x271193+'.'+_0x10027c)[_0x0b3c('0x12')](_0xf8c55f+_0x0b3c('0x13')+_0x4933ff[_0x0b3c('0x10')]()+')');}function insertCmHopper(_0x5a11e2,_0x230eff,_0x56bb6b,_0x498c74,_0x49bfdc){var _0x109b56=[_0x0b3c('0x14'),'cm_contacts.scheduledat',_0x0b3c('0x15'),_0x0b3c('0x16'),_0x230eff+'.'+_0x498c74,_0x0b3c('0x17'),'cm_contacts.updatedAt',_0x0b3c('0x18'),_0x0b3c('0x19'),'\x22'+_0x49bfdc+'\x22'];return squel[_0x0b3c('0x1a')]()[_0x0b3c('0x1b')](_0x0b3c('0x1c'))[_0x0b3c('0x1d')]([_0x0b3c('0xe'),_0x0b3c('0x1e'),'ContactId',_0x0b3c('0x1f'),_0x498c74,_0x0b3c('0x20'),_0x0b3c('0x21'),_0x0b3c('0x22'),_0x0b3c('0x23'),_0x0b3c('0x24')],squel[_0x0b3c('0xd')]()['fields'](_0x109b56)[_0x0b3c('0xf')](_0x230eff)['join'](_0x0b3c('0x25'),null,_0x0b3c('0x26')+_0x230eff+'.CmListId')[_0x0b3c('0x10')](_0x56bb6b,null,_0x56bb6b+_0x0b3c('0x27')+_0x230eff+'.'+_0x498c74)['where'](_0x230eff+'.CmListId\x20=\x20?',_0x5a11e2)[_0x0b3c('0x12')](_0x0b3c('0x28'),NOW)[_0x0b3c('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x230eff,_0x56bb6b,_0x498c74,_0x0b3c('0x1c'),['\x22always\x22',_0x0b3c('0x29')]))[_0x0b3c('0x12')](_0x0b3c('0x2a'),selectNotIn(_0x230eff,_0x56bb6b,_0x498c74,_0x0b3c('0x1c'),[_0x0b3c('0x2b')])))['toString']();}function insertCmHopperBlack(_0x399b90,_0x18a636,_0x45144d,_0x22c3ed){var _0x5c7036=[_0x0b3c('0x14'),_0x0b3c('0x15'),_0x0b3c('0x16'),_0x18a636+'.'+_0x22c3ed,_0x0b3c('0x17'),_0x0b3c('0x2c')];return squel[_0x0b3c('0x1a')]()[_0x0b3c('0x1b')]('cm_hopper_black')[_0x0b3c('0x1d')](['phone',_0x0b3c('0x2d'),_0x0b3c('0x1f'),_0x22c3ed,_0x0b3c('0x20'),_0x0b3c('0x21')],squel[_0x0b3c('0xd')]()['fields'](_0x5c7036)['from'](_0x18a636)[_0x0b3c('0x10')](_0x0b3c('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x18a636+_0x0b3c('0x2e'))[_0x0b3c('0x10')](_0x45144d,null,_0x45144d+'.id\x20=\x20'+_0x18a636+'.'+_0x22c3ed)[_0x0b3c('0x12')](_0x18a636+_0x0b3c('0x2f'),_0x399b90)[_0x0b3c('0x12')](_0x0b3c('0x28'),NOW)[_0x0b3c('0x12')](_0x0b3c('0x2a'),squel[_0x0b3c('0xd')]()[_0x0b3c('0x30')]('phone')['from'](_0x0b3c('0x31'))['where'](_0x0b3c('0x32'),_0x399b90)[_0x0b3c('0x12')](_0x22c3ed+'\x20=\x20?',_0x18a636+'.'+_0x22c3ed)))[_0x0b3c('0x33')]();}function insertCmContact(_0x3c056a,_0x861107,_0x1f732b,_0x57eca8){var _0x3d7ca2=_[_0x0b3c('0x34')](_[_0x0b3c('0x35')](_0x57eca8),[_0x0b3c('0x1f'),_0x0b3c('0x36'),_0x0b3c('0x20'),_0x0b3c('0x21')]);return squel['insert']()[_0x0b3c('0x1b')](_0x0b3c('0x25'))[_0x0b3c('0x1d')](_0x3d7ca2,squel[_0x0b3c('0xd')]()['fields'](_0x3d7ca2)['from'](_0x861107)[_0x0b3c('0x12')]('('+_0x1f732b[_0x0b3c('0x10')](',')+')\x20NOT\x20IN\x20?',squel[_0x0b3c('0xd')]()[_0x0b3c('0x37')](_0x1f732b)['from'](_0x0b3c('0x25'))[_0x0b3c('0x12')]('ListId\x20=\x20?',_0x3c056a)[_0x0b3c('0x12')](_0x0b3c('0x38')))[_0x0b3c('0x12')]('id\x20IN\x20?',squel[_0x0b3c('0xd')]()[_0x0b3c('0x30')](_0x0b3c('0x39'),_0x0b3c('0x3a'))['from'](_0x861107)[_0x0b3c('0x3b')](_0x1f732b[_0x0b3c('0x10')](','))))[_0x0b3c('0x33')]();}function handleStop(){logger[_0x0b3c('0x3c')](_0x0b3c('0x3d'));stopped=!![];}function handleUncaughtException(_0x2fdb84){logger[_0x0b3c('0x3e')](_0x2fdb84[_0x0b3c('0x3f')]);process[_0x0b3c('0x40')](0x1);}function handleError(_0x17249b,_0x4096ff){stats[_0x0b3c('0x41')][_0x0b3c('0x42')]({'name':_0x4096ff[_0x0b3c('0x43')],'message':_0x4096ff[_0x0b3c('0x3f')],'row':_0x17249b});}function handleQuery(_0x4f6c6f){logger[_0x0b3c('0x3c')](_0x4f6c6f);return db[_0x0b3c('0x44')][_0x0b3c('0x45')](_0x4f6c6f)[_0x0b3c('0x46')](function(_0x5d45f3){results[_0x0b3c('0x42')](_0x5d45f3);})['catch'](function(_0x121d37){logger[_0x0b3c('0x3e')](_0x121d37[_0x0b3c('0x3f')]);});}function main(_0x1256a8,_0x25ad68,_0x571066,_0x20753c){logger[_0x0b3c('0x3c')](_0x0b3c('0x47'),_0x1256a8,JSON[_0x0b3c('0x48')](_0x25ad68));process['send'](_0x0b3c('0x49'));var _0x480883=_0x25ad68[_0x0b3c('0x4a')];var _0x4f471a=_0x25ad68[_0x0b3c('0x4b')];var _0x2dfb56=path['join'](config[_0x0b3c('0x4c')],_0x0b3c('0x4d'),_0x4f471a+_0x0b3c('0x4e'));var _0x54de45=_[_0x0b3c('0x35')](_0x480883)[_0x0b3c('0x10')]();logger[_0x0b3c('0x3c')](_0x0b3c('0x4f'),_0x54de45);fs[_0x0b3c('0x50')](_0x2dfb56,_0x54de45+'\x0a');Papa[_0x0b3c('0x51')](fs['createReadStream'](_0x1256a8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x241c88,_0x5d2247){try{for(var _0x1a47de=0x0,_0x113d60=[];_0x1a47de<_0x241c88[_0x0b3c('0x52')][_0x0b3c('0x53')];_0x1a47de++){stats['rows']+=0x1;if(_0x241c88[_0x0b3c('0x41')][_0x1a47de]){handleError(_0x241c88[_0x0b3c('0x52')][_0x1a47de],_0x241c88['errors'][_0x1a47de]);}else{var _0x2857fe=[];for(var _0x42946c in _0x480883){if(_0x480883[_0x0b3c('0x54')](_0x42946c)){if(_0x241c88[_0x0b3c('0x52')][_0x1a47de][_0x480883[_0x42946c]]){var _0x1f3888=_[_0x0b3c('0x55')](_0x241c88[_0x0b3c('0x52')][_0x1a47de][_0x480883[_0x42946c]][_0x0b3c('0x56')](/"/g,'\x27'));switch(_0x42946c){case _0x0b3c('0x1e'):var _0xdd85=moment(_0x1f3888,_0x0b3c('0xc'),!![]);if(_0xdd85[_0x0b3c('0x57')]()){_0x113d60[_0x0b3c('0x42')]('\x22'+_0x1f3888+'\x22');}else{_0x2857fe[_0x0b3c('0x42')](_0x0b3c('0x58'));}break;case _0x0b3c('0x22'):var _0xa537cf=parseInt(_0x1f3888);_0x1f3888=_[_0x0b3c('0x59')](_0xa537cf)||_0xa537cf<0x0||_0xa537cf>0x4?_0x20753c?0x3:0x2:_0xa537cf;_0x113d60[_0x0b3c('0x42')]('\x22'+_0x1f3888+'\x22');break;case _0x0b3c('0x23'):var _0xf9661e=parseInt(_0x1f3888);if(_['isNumber'](_0xf9661e)&&_[_0x0b3c('0x5a')](_0x571066,_0xf9661e)){_0x113d60[_0x0b3c('0x42')]('\x22'+_0xf9661e+'\x22');}else{_0x2857fe[_0x0b3c('0x42')](_0x0b3c('0x5b'));}break;case _0x0b3c('0x5c'):if(isEmail(_0x1f3888)){_0x113d60[_0x0b3c('0x42')]('\x22'+_0x1f3888+'\x22');}else{_0x2857fe[_0x0b3c('0x42')](_0x0b3c('0x5d'));}break;case _0x0b3c('0x5e'):var _0x440a39=moment(_0x1f3888,'YYYY-MM-DD',!![]);if(_0x440a39[_0x0b3c('0x57')]()){_0x113d60['push']('\x22'+_0x1f3888+'\x22');}else{_0x2857fe['push'](_0x0b3c('0x5f'));}break;default:_0x113d60[_0x0b3c('0x42')]('\x22'+_0x1f3888+'\x22');}}else{switch(_0x42946c){case _0x0b3c('0x60'):case'phone':_0x2857fe[_0x0b3c('0x42')](_0x42946c+_0x0b3c('0x61'));break;default:_0x113d60[_0x0b3c('0x42')]('\x22\x22');}}}}if(_0x2857fe[_0x0b3c('0x53')]){handleError(_0x241c88[_0x0b3c('0x52')][_0x1a47de],{'code':_0x0b3c('0x62'),'message':_0x2857fe[_0x0b3c('0x10')]()});}else{fs[_0x0b3c('0x63')](_0x2dfb56,_0x113d60[_0x0b3c('0x10')]()+'\x0a');}_0x113d60=[];}if(!(stats[_0x0b3c('0x64')]%0xc8)){socket[_0x0b3c('0x65')](_0x0b3c('0x66')+_0x4f471a,stats);stats[_0x0b3c('0x41')]=[];}}if(stopped){logger[_0x0b3c('0x3c')](_0x0b3c('0x67'));_0x5d2247[_0x0b3c('0x68')]();}}catch(_0x23195f){handleError(_0x241c88['data'][_0x1a47de],{'code':_0x0b3c('0x69'),'message':_0x23195f['message']});logger[_0x0b3c('0x3e')]('step',_0x23195f['message']);}},'complete':function(){try{var _0x542931=[];var _0x122959=_0x0b3c('0x25');if(_0x25ad68[_0x0b3c('0x6a')]&&_0x25ad68[_0x0b3c('0x6a')][_0x0b3c('0x53')]){_0x122959=_0x0b3c('0x6b')+_0x4f471a;_0x542931[_0x0b3c('0x42')](_0x0b3c('0x6c')+_0x122959+'\x20LIKE\x20cm_contacts;');}var _0x28a053=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x2dfb56,_0x122959,_0x54de45,_0x25ad68[_0x0b3c('0x1f')],_0x25ad68[_0x0b3c('0x36')]||null,NOW,NOW);if(_[_0x0b3c('0x6d')](_0x480883['scheduledat'])){_0x28a053+=',\x20scheduledAt\x20=\x20NOW()';}_0x542931[_0x0b3c('0x42')](_0x28a053);if(_0x25ad68[_0x0b3c('0x6a')]&&_0x25ad68[_0x0b3c('0x6a')]['length']){_0x542931[_0x0b3c('0x42')](insertCmContact(_0x25ad68[_0x0b3c('0x1f')],_0x122959,_0x25ad68[_0x0b3c('0x6a')],_0x480883));_0x542931[_0x0b3c('0x42')](_0x0b3c('0x6e')+_0x122959+';');}_0x542931[_0x0b3c('0x42')](insertCmHopper(_0x25ad68[_0x0b3c('0x1f')],_0x0b3c('0x6f'),_0x0b3c('0x70'),'VoiceQueueId',_0x20753c));_0x542931['push'](insertCmHopperBlack(_0x25ad68[_0x0b3c('0x1f')],'voice_queues_has_cm_blacklists',_0x0b3c('0x70'),_0x0b3c('0x71')));_0x542931[_0x0b3c('0x42')](insertCmHopper(_0x25ad68[_0x0b3c('0x1f')],'campaigns_has_cm_lists',_0x0b3c('0x72'),_0x0b3c('0x73'),_0x20753c));_0x542931[_0x0b3c('0x42')](insertCmHopperBlack(_0x25ad68[_0x0b3c('0x1f')],_0x0b3c('0x74'),_0x0b3c('0x72'),_0x0b3c('0x73')));BPromise[_0x0b3c('0x75')](_0x542931,handleQuery)[_0x0b3c('0x76')](function(_0x133f76){stats['finish']=!![];stats['affectedRows']=_0x25ad68[_0x0b3c('0x6a')]&&_0x25ad68[_0x0b3c('0x6a')][_0x0b3c('0x53')]?results[0x2][_0x0b3c('0x77')]:results[0x0]['affectedRows'];socket[_0x0b3c('0x65')](_0x0b3c('0x66')+_0x4f471a,stats);fs[_0x0b3c('0x78')](_0x1256a8);fs[_0x0b3c('0x78')](_0x2dfb56);process[_0x0b3c('0x40')](0x0);})[_0x0b3c('0x79')](function(_0x30ccd4){logger[_0x0b3c('0x3e')](_0x30ccd4[_0x0b3c('0x3f')]);process[_0x0b3c('0x40')](0x1);});}catch(_0x134000){logger[_0x0b3c('0x3e')](_0x0b3c('0x7a'),_0x134000[_0x0b3c('0x3f')]);process[_0x0b3c('0x40')](0x1);}},'error':function(_0x284a61,_0x2fa749,_0x26b0b2,_0x557c00){throw new Error(_0x557c00);}});}function validate(){if(process['argv']&&process['argv'][_0x0b3c('0x53')]<0x4){throw new Error(_0x0b3c('0x7b'));}var _0x2f890a=path[_0x0b3c('0x10')](config[_0x0b3c('0x4c')],_0x0b3c('0x4d'),process['argv'][0x2]);if(!fs[_0x0b3c('0x7c')](_0x2f890a)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x24d5d4={};try{_0x24d5d4=JSON[_0x0b3c('0x51')](process['argv'][0x3]);if(!_0x24d5d4[_0x0b3c('0x4a')]){throw new Error(_0x0b3c('0x7d'));}if(!_0x24d5d4[_0x0b3c('0x4a')][_0x0b3c('0xe')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x24d5d4[_0x0b3c('0x4a')][_0x0b3c('0x60')]){throw new Error(_0x0b3c('0x7e'));}var _0x4e86cb=0x0;if(_0x24d5d4[_0x0b3c('0x4a')][_0x0b3c('0x23')]){_0x4e86cb=0x1;}if(!_0x24d5d4[_0x0b3c('0x1f')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x46cd9d){throw new Error(_0x0b3c('0x7f'));}var _0x4b8ccd=[];try{_0x4b8ccd=_['map'](JSON[_0x0b3c('0x51')](process[_0x0b3c('0x80')][0x4]),'id');}catch(_0x571482){logger[_0x0b3c('0x3c')](_0x0b3c('0x81'));}main(_0x2f890a,_0x24d5d4,_0x4b8ccd,_0x4e86cb);}validate();process['on']('SIGINT',handleStop);process['on'](_0x0b3c('0x82'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 10c49f1..feb8143 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b7e=['Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','Call\x20To'];(function(_0x360299,_0x219da4){var _0x3d3f16=function(_0x220e57){while(--_0x220e57){_0x360299['push'](_0x360299['shift']());}};_0x3d3f16(++_0x219da4);}(_0x2b7e,0x70));var _0xe2b7=function(_0x20b001,_0x11d454){_0x20b001=_0x20b001-0x0;var _0x3e1ec0=_0x2b7e[_0x20b001];return _0x3e1ec0;};'use strict';exports[_0xe2b7('0x0')]=function(_0x82194e,_0x139f77){var _0x40e870=[{'type':_0xe2b7('0x1'),'content':_0xe2b7('0x2'),'variableName':null}];switch(_0x82194e[_0xe2b7('0x3')]()){case _0xe2b7('0x4'):switch(_0x139f77['toLowerCase']()){case _0xe2b7('0x5'):_0x40e870[_0xe2b7('0x6')]({'type':_0xe2b7('0x7'),'content':'','variableName':_0xe2b7('0x8')});_0x40e870[_0xe2b7('0x6')]({'type':_0xe2b7('0x7'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x40e870['push']({'type':_0xe2b7('0x1'),'content':_0xe2b7('0x9'),'variableName':null});_0x40e870[_0xe2b7('0x6')]({'type':_0xe2b7('0x7'),'content':'','variableName':_0xe2b7('0xa')});break;}}return _0x40e870;};exports['getDescriptions']=function(_0x3a2719,_0x44b356){var _0x25bf1d=[];switch(_0x3a2719[_0xe2b7('0x3')]()){case'voice':switch(_0x44b356[_0xe2b7('0x3')]()){case'inbound':_0x25bf1d=[{'type':_0xe2b7('0x1'),'content':_0xe2b7('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0xd'),'keyType':'variable','variableName':_0xe2b7('0xe')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0xf'),'keyType':'variable','variableName':'calleridname'},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x10'),'keyType':_0xe2b7('0x7'),'variableName':'destexten'},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x11'),'keyType':_0xe2b7('0x7'),'variableName':_0xe2b7('0x8')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x12'),'keyType':_0xe2b7('0x7'),'variableName':_0xe2b7('0x13')},{'type':_0xe2b7('0xc'),'content':'','key':'Date','keyType':_0xe2b7('0x7'),'variableName':_0xe2b7('0x14')},{'type':'string','content':_0xe2b7('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x16'),'keyType':_0xe2b7('0x7'),'variableName':_0xe2b7('0x17')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x18'),'keyType':_0xe2b7('0x7'),'variableName':'destcalleridnum'},{'type':_0xe2b7('0x1'),'content':_0xe2b7('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x1a'),'keyType':_0xe2b7('0x7'),'variableName':_0xe2b7('0x14')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x1b'),'keyType':_0xe2b7('0x7'),'variableName':_0xe2b7('0x1c')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x1d'),'keyType':'variable','variableName':_0xe2b7('0x1e')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x1f'),'keyType':'variable','variableName':_0xe2b7('0x20')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x21'),'keyType':_0xe2b7('0x7'),'variableName':'talktime'}];break;case'outbound':_0x25bf1d=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0xe2b7('0x22'),'keyType':_0xe2b7('0x7'),'keyContent':'','variableName':_0xe2b7('0xa')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xe2b7('0x7'),'keyContent':'','variableName':'membername'},{'type':_0xe2b7('0xc'),'content':'','key':'UniqueId','keyType':_0xe2b7('0x7'),'keyContent':'','variableName':_0xe2b7('0x13')},{'type':'keyValue','content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0xe2b7('0x23')},{'type':_0xe2b7('0x1'),'content':_0xe2b7('0x19')},{'type':'keyValue','content':'','key':_0xe2b7('0x24'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xe2b7('0x25'),'keyType':'variable','keyContent':'','variableName':_0xe2b7('0x26')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x27'),'keyType':_0xe2b7('0x7'),'keyContent':'','variableName':_0xe2b7('0x28')},{'type':_0xe2b7('0xc'),'content':'','key':_0xe2b7('0x29'),'keyType':_0xe2b7('0x7'),'keyContent':'','variableName':_0xe2b7('0x2a')}];break;}}return _0x25bf1d;}; \ No newline at end of file +var _0xc1a8=['keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','Called\x20Number','Member\x20Name','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc1a8,0xd6));var _0x8c1a=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0xc1a8[_0x36436d];return _0x34615d;};'use strict';exports[_0x8c1a('0x0')]=function(_0x453f0c,_0x2f0536){var _0x431a8a=[{'type':_0x8c1a('0x1'),'content':_0x8c1a('0x2'),'variableName':null}];switch(_0x453f0c[_0x8c1a('0x3')]()){case _0x8c1a('0x4'):switch(_0x2f0536['toLowerCase']()){case'inbound':_0x431a8a[_0x8c1a('0x5')]({'type':_0x8c1a('0x6'),'content':'','variableName':_0x8c1a('0x7')});_0x431a8a[_0x8c1a('0x5')]({'type':_0x8c1a('0x6'),'content':'','variableName':_0x8c1a('0x8')});break;case _0x8c1a('0x9'):_0x431a8a[_0x8c1a('0x5')]({'type':'string','content':_0x8c1a('0xa'),'variableName':null});_0x431a8a[_0x8c1a('0x5')]({'type':'variable','content':'','variableName':_0x8c1a('0xb')});break;}}return _0x431a8a;};exports[_0x8c1a('0xc')]=function(_0x3ca3fb,_0x259b48){var _0xb2ffb0=[];switch(_0x3ca3fb['toLowerCase']()){case _0x8c1a('0x4'):switch(_0x259b48['toLowerCase']()){case'inbound':_0xb2ffb0=[{'type':'string','content':_0x8c1a('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0x8c1a('0x6'),'variableName':_0x8c1a('0x8')},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0xf'),'keyType':_0x8c1a('0x6'),'variableName':_0x8c1a('0x10')},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x11'),'keyType':_0x8c1a('0x6'),'variableName':_0x8c1a('0x12')},{'type':_0x8c1a('0xe'),'content':'','key':'Queue','keyType':_0x8c1a('0x6'),'variableName':_0x8c1a('0x7')},{'type':_0x8c1a('0xe'),'content':'','key':'UniqueId','keyType':_0x8c1a('0x6'),'variableName':'uniqueid'},{'type':_0x8c1a('0xe'),'content':'','key':'Date','keyType':_0x8c1a('0x6'),'variableName':_0x8c1a('0x13')},{'type':_0x8c1a('0x1'),'content':_0x8c1a('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x8c1a('0x6'),'variableName':'destcalleridname'},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x15'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x8c1a('0x1'),'content':_0x8c1a('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x8c1a('0x6'),'variableName':'agentcalledAt'},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x17'),'keyType':_0x8c1a('0x6'),'variableName':_0x8c1a('0x18')},{'type':_0x8c1a('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0x8c1a('0x6'),'variableName':_0x8c1a('0x19')},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x1a'),'keyType':_0x8c1a('0x6'),'variableName':'holdtime'},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x1b'),'keyType':_0x8c1a('0x6'),'variableName':'talktime'}];break;case _0x8c1a('0x9'):_0xb2ffb0=[{'type':'string','content':_0x8c1a('0xd'),'variableName':null},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x1c'),'keyType':_0x8c1a('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x1d'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0x8c1a('0xe'),'content':'','key':'UniqueId','keyType':_0x8c1a('0x6'),'keyContent':'','variableName':_0x8c1a('0x1e')},{'type':_0x8c1a('0xe'),'content':'','key':'Date','keyType':_0x8c1a('0x6'),'keyContent':'','variableName':_0x8c1a('0x1f')},{'type':'string','content':_0x8c1a('0x16')},{'type':'keyValue','content':'','key':_0x8c1a('0x20'),'keyType':_0x8c1a('0x6'),'keyContent':'','variableName':_0x8c1a('0x21')},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x22'),'keyType':_0x8c1a('0x6'),'keyContent':'','variableName':_0x8c1a('0x23')},{'type':_0x8c1a('0xe'),'content':'','key':'Duration','keyType':_0x8c1a('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x8c1a('0xe'),'content':'','key':_0x8c1a('0x24'),'keyType':_0x8c1a('0x6'),'keyContent':'','variableName':_0x8c1a('0x25')}];break;}}return _0xb2ffb0;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 1d826d1..d3023ab 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3e7=['lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','then','update','info','catch','error','tracked','clone','omit','body'];(function(_0x5db800,_0x9c38a4){var _0x2195d9=function(_0x14ff60){while(--_0x14ff60){_0x5db800['push'](_0x5db800['shift']());}};_0x2195d9(++_0x9c38a4);}(_0xd3e7,0x16c));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7d3e('0x0'));var db=require(_0x7d3e('0x1'))['db'];var loggers={'openchannel':require(_0x7d3e('0x2'))(_0x7d3e('0x3')),'mail':require('../../config/logger')(_0x7d3e('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x7d3e('0x2'))(_0x7d3e('0x5')),'chat':require(_0x7d3e('0x2'))(_0x7d3e('0x6')),'whatsapp':require(_0x7d3e('0x2'))(_0x7d3e('0x7'))};function getInteractionId(_0xf358b1,_0x1d1b1d,_0x1d6e25){if(_0xf358b1&&_0xf358b1[_[_0x7d3e('0x8')](_0x1d6e25)+_0x7d3e('0x9')]){return _0xf358b1[_[_0x7d3e('0x8')](_0x1d6e25)+'InteractionId'];}else if(_0xf358b1&&_0xf358b1['id']){return _0xf358b1['id'];}else if(_0x1d1b1d&&_0x1d1b1d['id']){return _0x1d1b1d['id'];}else{return'unknown';}}function log(_0x2420c3,_0x421d34,_0x42be1c,_0x2a7dc6,_0x38f5f0,_0x5ab358){loggers[_0x38f5f0[_0x7d3e('0xa')]()][_0x2420c3](_0x7d3e('0xb'),_0x5ab358[_0x7d3e('0xc')](),_0x421d34?_0x421d34['id']:null,_0x421d34?_0x421d34[_0x7d3e('0xd')]:null,_0x421d34?_0x421d34['role']:null,getInteractionId(_0x42be1c,_0x2a7dc6,_0x38f5f0),_0x42be1c?JSON[_0x7d3e('0xe')](_0x42be1c):_0x7d3e('0xf'));}function updateUser(_0x1d41a5,_0x490922,_0x2334f9,_0xb7d2bd,_0x50f393){db[_[_0x7d3e('0x8')](_0xb7d2bd)+_0x7d3e('0x10')]['findOne']({'where':{'id':getInteractionId(_0x490922,_0x2334f9,_0xb7d2bd)}})[_0x7d3e('0x11')](function(_0x190b4f){if(_0x190b4f){return _0x190b4f[_0x7d3e('0x12')]({'UserId':_0x1d41a5?_0x1d41a5['id']:null});}})[_0x7d3e('0x11')](function(_0x767bd9){if(_0x767bd9){log(_0x7d3e('0x13'),_0x1d41a5,_0x490922,_0x2334f9,_0xb7d2bd,_0x50f393);}})[_0x7d3e('0x14')](function(){log(_0x7d3e('0x15'),_0x1d41a5,_0x490922,_0x2334f9,_0xb7d2bd,_0x50f393);});}exports[_0x7d3e('0x16')]=function(_0x3a1bbf,_0x2b2250){return function(_0x2c2caf,_0x47c8f0,_0x2588cd){var _0xe6f254=_0x2c2caf['user'];var _0x552f75={};var _0x150c6a=_0x2c2caf['query'];if(_0x552f75){_0x552f75=_[_0x7d3e('0x17')](_0x2c2caf['body']);_0x552f75=_[_0x7d3e('0x18')](_0x552f75,[_0x7d3e('0x19'),'html','phone','fax','mobile']);}updateUser(_0xe6f254,_0x552f75,_0x150c6a,_0x3a1bbf,_0x2b2250);_0x2588cd(null);};}; \ No newline at end of file +var _0x3b42=['upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','error','tracked','user','query','clone','body','omit','html','phone','mobile','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions'];(function(_0x4b7ac3,_0x43ac26){var _0x20b278=function(_0x21f73f){while(--_0x21f73f){_0x4b7ac3['push'](_0x4b7ac3['shift']());}};_0x20b278(++_0x43ac26);}(_0x3b42,0x139));var _0x23b4=function(_0x4b207d,_0x58b6c4){_0x4b207d=_0x4b207d-0x0;var _0x5954b0=_0x3b42[_0x4b207d];return _0x5954b0;};'use strict';var _=require('lodash');var db=require(_0x23b4('0x0'))['db'];var loggers={'openchannel':require(_0x23b4('0x1'))(_0x23b4('0x2')),'mail':require(_0x23b4('0x1'))('mail-interactions'),'fax':require(_0x23b4('0x1'))(_0x23b4('0x3')),'sms':require(_0x23b4('0x1'))(_0x23b4('0x4')),'chat':require('../../config/logger')(_0x23b4('0x5')),'whatsapp':require(_0x23b4('0x1'))(_0x23b4('0x6'))};function getInteractionId(_0x28d180,_0xce0efe,_0x28f8e9){if(_0x28d180&&_0x28d180[_[_0x23b4('0x7')](_0x28f8e9)+_0x23b4('0x8')]){return _0x28d180[_[_0x23b4('0x7')](_0x28f8e9)+_0x23b4('0x8')];}else if(_0x28d180&&_0x28d180['id']){return _0x28d180['id'];}else if(_0xce0efe&&_0xce0efe['id']){return _0xce0efe['id'];}else{return _0x23b4('0x9');}}function log(_0x2b7d6f,_0x5e12fb,_0x5bc955,_0x323ee1,_0x112b2c,_0x3c2d28){loggers[_0x112b2c[_0x23b4('0xa')]()][_0x2b7d6f](_0x23b4('0xb'),_0x3c2d28[_0x23b4('0xc')](),_0x5e12fb?_0x5e12fb['id']:null,_0x5e12fb?_0x5e12fb[_0x23b4('0xd')]:null,_0x5e12fb?_0x5e12fb[_0x23b4('0xe')]:null,getInteractionId(_0x5bc955,_0x323ee1,_0x112b2c),_0x5bc955?JSON[_0x23b4('0xf')](_0x5bc955):_0x23b4('0x10'));}function updateUser(_0x218f06,_0x3840bc,_0x3494b3,_0x1ea72a,_0xb7b9cc){db[_[_0x23b4('0x7')](_0x1ea72a)+_0x23b4('0x11')][_0x23b4('0x12')]({'where':{'id':getInteractionId(_0x3840bc,_0x3494b3,_0x1ea72a)}})[_0x23b4('0x13')](function(_0xf32c75){if(_0xf32c75){return _0xf32c75[_0x23b4('0x14')]({'UserId':_0x218f06?_0x218f06['id']:null});}})[_0x23b4('0x13')](function(_0x492ee4){if(_0x492ee4){log(_0x23b4('0x15'),_0x218f06,_0x3840bc,_0x3494b3,_0x1ea72a,_0xb7b9cc);}})['catch'](function(){log(_0x23b4('0x16'),_0x218f06,_0x3840bc,_0x3494b3,_0x1ea72a,_0xb7b9cc);});}exports[_0x23b4('0x17')]=function(_0x4f4966,_0x14c579){return function(_0x554b3b,_0x592f49,_0x18234c){var _0x59528a=_0x554b3b[_0x23b4('0x18')];var _0x524af3={};var _0x17245c=_0x554b3b[_0x23b4('0x19')];if(_0x524af3){_0x524af3=_[_0x23b4('0x1a')](_0x554b3b[_0x23b4('0x1b')]);_0x524af3=_[_0x23b4('0x1c')](_0x524af3,[_0x23b4('0x1b'),_0x23b4('0x1d'),_0x23b4('0x1e'),'fax',_0x23b4('0x1f')]);}updateUser(_0x59528a,_0x524af3,_0x17245c,_0x4f4966,_0x14c579);_0x18234c(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 8353c47..6ef6764 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 _0x05c6=['use','License','findOne','then','count','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x05c6,0x177));var _0x605c=function(_0x42ecf8,_0x1b62d6){_0x42ecf8=_0x42ecf8-0x0;var _0x281db8=_0x05c6[_0x42ecf8];return _0x281db8;};'use strict';var crypto=require(_0x605c('0x0'));var util=require(_0x605c('0x1'));var compose=require(_0x605c('0x2'));var db=require(_0x605c('0x3'))['db'];var config=require(_0x605c('0x4'));function getValueFromLicense(_0x25a32e,_0x396f2f){if(_0x25a32e&&_0x396f2f){if(_0x396f2f[_0x605c('0x5')]&&_0x396f2f['license']){var _0x5f351d=_0x396f2f[_0x605c('0x5')];var _0xf11bb5=_0x396f2f['license'];var _0x4f2c19=_0x5f351d[_0x605c('0x6')]('-')[0x4];var _0x265b30=_0x5f351d['split']('-')[0x0];var _0x5351a1=crypto[_0x605c('0x7')](_0x605c('0x8'),util[_0x605c('0x9')](_0x605c('0xa'),_0x4f2c19,_0x5f351d,_0x265b30));var _0x10e74e=_0x5351a1[_0x605c('0xb')](_0xf11bb5,'base64',_0x605c('0xc'));_0x10e74e+=_0x5351a1[_0x605c('0xd')](_0x605c('0xc'));var _0x205915=JSON[_0x605c('0xe')](_0x10e74e);return _0x205915['hasOwnProperty'](_0x25a32e)?_0x205915[_0x25a32e]:null;}}return null;}function isLimit(_0xa153e7,_0x22b4e9,_0x4d1faa,_0xc2dec7){var _0x40f991=_0x22b4e9;return compose()[_0x605c('0xf')](function(_0x37e0ae,_0x582c85,_0x5ae9fd){return db[_0x605c('0x10')][_0x605c('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x605c('0x12')](function(_0x53d11f){var _0x3083c9=getValueFromLicense(_0xa153e7,_0x53d11f);return _0x3083c9?_0x3083c9:_0x40f991;})[_0x605c('0x12')](function(_0x174a95){_0x40f991=_0x174a95;return _0x4d1faa[_0x605c('0x13')](_0xc2dec7);})[_0x605c('0x12')](function(_0x5771fe){if(_0x5771fe>=_0x40f991){return _0x582c85['status'](0x193)['json']({'message':util['format'](_0x605c('0x14'),_0xa153e7)});}_0x5ae9fd();})[_0x605c('0x15')](function(_0x12ecb2){_0x5ae9fd(_0x12ecb2);});});}function isUserLimit(){return isLimit(_0x605c('0x16'),0x1,db[_0x605c('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0x605c('0x18')}]}});}exports[_0x605c('0x19')]=isUserLimit; \ No newline at end of file +var _0x78ce=['createDecipher','format','update','base64','utf8','License','findOne','then','status','json','catch','User','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','license','data1','split'];(function(_0x4c02a3,_0x131bd3){var _0x2d5944=function(_0xfd210c){while(--_0xfd210c){_0x4c02a3['push'](_0x4c02a3['shift']());}};_0x2d5944(++_0x131bd3);}(_0x78ce,0x1c7));var _0xe78c=function(_0x127bb2,_0x849c5f){_0x127bb2=_0x127bb2-0x0;var _0x596034=_0x78ce[_0x127bb2];return _0x596034;};'use strict';var crypto=require(_0xe78c('0x0'));var util=require('util');var compose=require(_0xe78c('0x1'));var db=require(_0xe78c('0x2'))['db'];var config=require(_0xe78c('0x3'));function getValueFromLicense(_0x235cdd,_0x476791){if(_0x235cdd&&_0x476791){if(_0x476791['data1']&&_0x476791[_0xe78c('0x4')]){var _0x63c159=_0x476791[_0xe78c('0x5')];var _0x4bb1e5=_0x476791[_0xe78c('0x4')];var _0x3806f4=_0x63c159[_0xe78c('0x6')]('-')[0x4];var _0x567134=_0x63c159['split']('-')[0x0];var _0x55f486=crypto[_0xe78c('0x7')]('aes-256-ctr',util[_0xe78c('0x8')]('%s:%s:%s',_0x3806f4,_0x63c159,_0x567134));var _0x1b5f77=_0x55f486[_0xe78c('0x9')](_0x4bb1e5,_0xe78c('0xa'),_0xe78c('0xb'));_0x1b5f77+=_0x55f486['final'](_0xe78c('0xb'));var _0x1ec249=JSON['parse'](_0x1b5f77);return _0x1ec249['hasOwnProperty'](_0x235cdd)?_0x1ec249[_0x235cdd]:null;}}return null;}function isLimit(_0x960133,_0x116835,_0x506ae8,_0x30fc41){var _0xfca30a=_0x116835;return compose()['use'](function(_0x103b4f,_0x19d566,_0x5169ca){return db[_0xe78c('0xc')][_0xe78c('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xe78c('0xe')](function(_0x2179d){var _0x502fab=getValueFromLicense(_0x960133,_0x2179d);return _0x502fab?_0x502fab:_0xfca30a;})[_0xe78c('0xe')](function(_0x20e3be){_0xfca30a=_0x20e3be;return _0x506ae8['count'](_0x30fc41);})[_0xe78c('0xe')](function(_0x503572){if(_0x503572>=_0xfca30a){return _0x19d566[_0xe78c('0xf')](0x193)[_0xe78c('0x10')]({'message':util[_0xe78c('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x960133)});}_0x5169ca();})[_0xe78c('0x11')](function(_0x42329a){_0x5169ca(_0x42329a);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xe78c('0x12')],{'where':{'$or':[{'role':_0xe78c('0x13')},{'role':_0xe78c('0x14')}]}});}exports[_0xe78c('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 038178e..7694602 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 _0xd85c=['IN\x20?','$notIn','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','>\x20?','<=\x20?','>=\x20?','start','DATE','utcOffset','add','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','shift','match','map','conditions','push','buildExpression','operator','$eq','$between','value','$lte','days','format','castTo','text','CAST(','\x20AS\x20','field','\x20OR\x20','\x20IS\x20NULL)','$in'];(function(_0x49d055,_0x59e241){var _0x206a51=function(_0x4e036b){while(--_0x4e036b){_0x49d055['push'](_0x49d055['shift']());}};_0x206a51(++_0x59e241);}(_0xd85c,0x1bc));var _0xcd85=function(_0x24abae,_0x5c34d8){_0x24abae=_0x24abae-0x0;var _0x8365ac=_0xd85c[_0x24abae];return _0x8365ac;};'use strict';var _=require(_0xcd85('0x0'));var moment=require(_0xcd85('0x1'));exports[_0xcd85('0x2')]=function(_0x47e20d){var _0x1b7e39={'conditions':[]};_0x1b7e39[_0xcd85('0x3')]=_[_0xcd85('0x4')](_0x47e20d,_0xcd85('0x5'))?'or':_0xcd85('0x6');var _0x3aa620=_0x47e20d[_0xcd85('0x7')](_0xcd85('0x8'),'')['replace'](_0xcd85('0x5'),'')[_0xcd85('0x9')]('||');for(var _0x20fe82=0x0;_0x20fe82<_0x3aa620['length'];_0x20fe82++){var _0x7cbf86=_0x3aa620[_0x20fe82][_0xcd85('0x9')](':=');var _0x4bb8e2=_0x7cbf86[0x0];var _0xf570af=_0x7cbf86[_0xcd85('0xa')](0x1);_0xf570af[_0xcd85('0xb')](function(_0x43155a){var _0x4bf3d6=_0x43155a['split']('[')[_0xcd85('0xc')]();var _0x19e8cb=_0x43155a[_0xcd85('0xd')](/\[(.*?)\]/g);_0x19e8cb[_0xcd85('0xb')](function(_0x22ea1c){var _0x4d4b22=_0x22ea1c[_0xcd85('0x9')]('[')['filter'](function(_0x5e95dc){return _0x5e95dc['indexOf'](']')>-0x1;})[_0xcd85('0xe')](function(_0x573172){return _0x573172[_0xcd85('0x9')](']')[0x0];})[0x0];_0x1b7e39[_0xcd85('0xf')][_0xcd85('0x10')]({'field':_0x4bb8e2,'operator':_0x4bf3d6,'value':_0x4d4b22});});});}return _0x1b7e39;};exports[_0xcd85('0x11')]=function(_0x2435b8,_0x2afbf0,_0x114aa7){var _0x18ef38={};if(_0x2afbf0==='DATE'){if(_0x114aa7[_0xcd85('0x12')]===_0xcd85('0x13')){_0x114aa7['operator']=_0xcd85('0x14');_0x114aa7[_0xcd85('0x15')]+=','+_0x114aa7['value'];}else if(_['includes'](['$gt',_0xcd85('0x16')],_0x114aa7[_0xcd85('0x12')])){_0x114aa7['value']=moment(_0x114aa7['value'])['add'](0x1,_0xcd85('0x17'))[_0xcd85('0x18')]('YYYY-MM-DD');}}if(_0x114aa7['castTo']){_0x2afbf0=_0x114aa7[_0xcd85('0x19')];_0x18ef38[_0xcd85('0x1a')]=_0xcd85('0x1b')+_0x2435b8+'.'+_0x114aa7['field']+_0xcd85('0x1c')+_0x114aa7[_0xcd85('0x19')]+')\x20'+parseOperator(_0x114aa7[_0xcd85('0x12')]);}else{_0x18ef38['text']=_0x2435b8+'.'+_0x114aa7[_0xcd85('0x1d')]+'\x20'+parseOperator(_0x114aa7['operator']);}if(_['includes'](['$ne','$notIn'],_0x114aa7[_0xcd85('0x12')]))_0x18ef38[_0xcd85('0x1a')]='('+_0x18ef38[_0xcd85('0x1a')]+_0xcd85('0x1e')+_0x2435b8+'.'+_0x114aa7[_0xcd85('0x1d')]+_0xcd85('0x1f');_0x18ef38['value']=parseValue(_0x2afbf0,_0x114aa7[_0xcd85('0x12')],_0x114aa7[_0xcd85('0x15')]);return _0x18ef38;};function parseOperator(_0x3a7c85){var _0x41b5e2;switch(_0x3a7c85){case _0xcd85('0x20'):_0x41b5e2=_0xcd85('0x21');break;case _0xcd85('0x22'):_0x41b5e2=_0xcd85('0x23');break;case _0xcd85('0x13'):_0x41b5e2='=\x20?';break;case _0xcd85('0x24'):_0x41b5e2=_0xcd85('0x25');break;case _0xcd85('0x26'):case _0xcd85('0x27'):case _0xcd85('0x28'):_0x41b5e2=_0xcd85('0x29');break;case'$lt':_0x41b5e2=_0xcd85('0x2a');break;case _0xcd85('0x2b'):_0x41b5e2=_0xcd85('0x2c');break;case _0xcd85('0x16'):_0x41b5e2=_0xcd85('0x2d');break;case'$gte':_0x41b5e2=_0xcd85('0x2e');break;case _0xcd85('0x14'):_0x41b5e2='BETWEEN\x20?\x20AND\x20?';break;}return _0x41b5e2;}function parseValue(_0x348fd9,_0x58d914,_0x144699){var _0x3a72c5={'start':undefined,'end':undefined};switch(_0x58d914){case _0xcd85('0x20'):case _0xcd85('0x22'):_0x3a72c5[_0xcd85('0x2f')]=_0x144699[_0xcd85('0x9')](',');break;case'$substring':_0x3a72c5[_0xcd85('0x2f')]='%'+_0x144699+'%';break;case _0xcd85('0x27'):_0x3a72c5[_0xcd85('0x2f')]=_0x144699+'%';break;case _0xcd85('0x28'):_0x3a72c5[_0xcd85('0x2f')]='%'+_0x144699;break;case _0xcd85('0x14'):var _0x1738e0=_0x144699[_0xcd85('0x9')](',');var _0x144699=_0x1738e0['shift']();var _0xfe760a=_0x1738e0['pop']();if(_0x348fd9===_0xcd85('0x30')){_0x144699=moment(_0x144699)['utcOffset'](0x0,!![])[_0xcd85('0x18')]();_0xfe760a=moment(_0xfe760a)[_0xcd85('0x31')](0x0,!![])[_0xcd85('0x32')](0x17,_0xcd85('0x33'))[_0xcd85('0x32')](0x3b,'minutes')[_0xcd85('0x32')](0x3b,_0xcd85('0x34'))[_0xcd85('0x18')]();}_0x3a72c5={'start':_0x144699,'end':_0xfe760a};break;default:_0x3a72c5[_0xcd85('0x2f')]=_0x144699;break;}return _0x3a72c5;} \ No newline at end of file +var _0x99ef=['lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$or]','split','length','slice','shift','forEach','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','format'];(function(_0x5b31a5,_0x5c524d){var _0x52d80b=function(_0x5201b0){while(--_0x5201b0){_0x5b31a5['push'](_0x5b31a5['shift']());}};_0x52d80b(++_0x5c524d);}(_0x99ef,0x19d));var _0xf99e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x99ef[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf99e('0x0'));var moment=require(_0xf99e('0x1'));exports[_0xf99e('0x2')]=function(_0x274746){var _0xce665c={'conditions':[]};_0xce665c[_0xf99e('0x3')]=_[_0xf99e('0x4')](_0x274746,'[$or]')?'or':_0xf99e('0x5');var _0x54abdb=_0x274746['replace']('[$and]','')[_0xf99e('0x6')](_0xf99e('0x7'),'')[_0xf99e('0x8')]('||');for(var _0x5e190f=0x0;_0x5e190f<_0x54abdb[_0xf99e('0x9')];_0x5e190f++){var _0x4799db=_0x54abdb[_0x5e190f][_0xf99e('0x8')](':=');var _0x318532=_0x4799db[0x0];var _0x2e6eb1=_0x4799db[_0xf99e('0xa')](0x1);_0x2e6eb1['forEach'](function(_0x593683){var _0x2253ae=_0x593683[_0xf99e('0x8')]('[')[_0xf99e('0xb')]();var _0x5df687=_0x593683['match'](/\[(.*?)\]/g);_0x5df687[_0xf99e('0xc')](function(_0x384fa5){var _0x23203b=_0x384fa5[_0xf99e('0x8')]('[')['filter'](function(_0x2f7300){return _0x2f7300[_0xf99e('0xd')](']')>-0x1;})[_0xf99e('0xe')](function(_0x4f7377){return _0x4f7377[_0xf99e('0x8')](']')[0x0];})[0x0];_0xce665c[_0xf99e('0xf')][_0xf99e('0x10')]({'field':_0x318532,'operator':_0x2253ae,'value':_0x23203b});});});}return _0xce665c;};exports[_0xf99e('0x11')]=function(_0x2d0568,_0x352aed,_0x286535){var _0x2b4d3d={};if(_0x352aed===_0xf99e('0x12')){if(_0x286535['operator']===_0xf99e('0x13')){_0x286535[_0xf99e('0x14')]=_0xf99e('0x15');_0x286535['value']+=','+_0x286535[_0xf99e('0x16')];}else if(_[_0xf99e('0x17')]([_0xf99e('0x18'),_0xf99e('0x19')],_0x286535[_0xf99e('0x14')])){_0x286535[_0xf99e('0x16')]=moment(_0x286535[_0xf99e('0x16')])[_0xf99e('0x1a')](0x1,_0xf99e('0x1b'))['format'](_0xf99e('0x1c'));}}if(_0x286535['castTo']){_0x352aed=_0x286535[_0xf99e('0x1d')];_0x2b4d3d[_0xf99e('0x1e')]=_0xf99e('0x1f')+_0x2d0568+'.'+_0x286535['field']+_0xf99e('0x20')+_0x286535['castTo']+')\x20'+parseOperator(_0x286535[_0xf99e('0x14')]);}else{_0x2b4d3d[_0xf99e('0x1e')]=_0x2d0568+'.'+_0x286535[_0xf99e('0x21')]+'\x20'+parseOperator(_0x286535[_0xf99e('0x14')]);}if(_['includes']([_0xf99e('0x22'),'$notIn'],_0x286535[_0xf99e('0x14')]))_0x2b4d3d[_0xf99e('0x1e')]='('+_0x2b4d3d[_0xf99e('0x1e')]+_0xf99e('0x23')+_0x2d0568+'.'+_0x286535[_0xf99e('0x21')]+_0xf99e('0x24');_0x2b4d3d['value']=parseValue(_0x352aed,_0x286535[_0xf99e('0x14')],_0x286535[_0xf99e('0x16')]);return _0x2b4d3d;};function parseOperator(_0x4e2c3e){var _0x3ce98f;switch(_0x4e2c3e){case _0xf99e('0x25'):_0x3ce98f=_0xf99e('0x26');break;case _0xf99e('0x27'):_0x3ce98f=_0xf99e('0x28');break;case _0xf99e('0x13'):_0x3ce98f=_0xf99e('0x29');break;case'$ne':_0x3ce98f='<>\x20?';break;case _0xf99e('0x2a'):case _0xf99e('0x2b'):case _0xf99e('0x2c'):_0x3ce98f=_0xf99e('0x2d');break;case _0xf99e('0x2e'):_0x3ce98f=_0xf99e('0x2f');break;case _0xf99e('0x18'):_0x3ce98f=_0xf99e('0x30');break;case _0xf99e('0x19'):_0x3ce98f=_0xf99e('0x31');break;case _0xf99e('0x32'):_0x3ce98f='>=\x20?';break;case _0xf99e('0x15'):_0x3ce98f=_0xf99e('0x33');break;}return _0x3ce98f;}function parseValue(_0x879dff,_0x52799f,_0x3096dd){var _0x241ca8={'start':undefined,'end':undefined};switch(_0x52799f){case _0xf99e('0x25'):case _0xf99e('0x27'):_0x241ca8[_0xf99e('0x34')]=_0x3096dd[_0xf99e('0x8')](',');break;case _0xf99e('0x2a'):_0x241ca8[_0xf99e('0x34')]='%'+_0x3096dd+'%';break;case _0xf99e('0x2b'):_0x241ca8[_0xf99e('0x34')]=_0x3096dd+'%';break;case _0xf99e('0x2c'):_0x241ca8[_0xf99e('0x34')]='%'+_0x3096dd;break;case _0xf99e('0x15'):var _0x46448c=_0x3096dd[_0xf99e('0x8')](',');var _0x3096dd=_0x46448c[_0xf99e('0xb')]();var _0x562267=_0x46448c[_0xf99e('0x35')]();if(_0x879dff===_0xf99e('0x12')){_0x3096dd=moment(_0x3096dd)[_0xf99e('0x36')](0x0,!![])['format']();_0x562267=moment(_0x562267)[_0xf99e('0x36')](0x0,!![])[_0xf99e('0x1a')](0x17,_0xf99e('0x37'))['add'](0x3b,_0xf99e('0x38'))['add'](0x3b,_0xf99e('0x39'))[_0xf99e('0x3a')]();}_0x241ca8={'start':_0x3096dd,'end':_0x562267};break;default:_0x241ca8[_0xf99e('0x34')]=_0x3096dd;break;}return _0x241ca8;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 4e8e43d..101b145 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 _0x20d9=['length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','includes','push','query','$id','model','intersection','attributes','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte','format','$lte','utc','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','substr','DESC','unsigned','omit'];(function(_0x11b28a,_0x501fe3){var _0x5eeda7=function(_0x12cc1b){while(--_0x12cc1b){_0x11b28a['push'](_0x11b28a['shift']());}};_0x5eeda7(++_0x501fe3);}(_0x20d9,0x18a));var _0x920d=function(_0x4f6d50,_0x1b7897){_0x4f6d50=_0x4f6d50-0x0;var _0x1049b0=_0x20d9[_0x4f6d50];return _0x1049b0;};'use strict';var _=require(_0x920d('0x0'));var sequelize=require(_0x920d('0x1'));var moment=require(_0x920d('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x27d5e7){var _0x1354bb=['ne'];try{var _0x2b9bf8=JSON[_0x920d('0x3')](_0x27d5e7);var _0x5cf3db=Object['keys'](_0x2b9bf8)[0x0];return _0x1354bb['includes'](_0x5cf3db);}catch(_0x35de47){return![];}}function getOperatorValue(_0x211235){var _0x15bb5d=JSON[_0x920d('0x3')](_0x211235);var _0x2708d5=Object[_0x920d('0x4')](_0x15bb5d)[0x0];var _0x233e92=_0x15bb5d[_0x2708d5];return{['$'+_0x2708d5]:_0x233e92};}exports[_0x920d('0x5')]=function(_0x262678){var _0x11375c=null;if(_0x262678){_0x11375c=_0x262678[_0x920d('0x6')](',');}return _0x11375c;};exports[_0x920d('0x7')]=function(_0x10d24c,_0x23fb0f){var _0x1299a0={};if(!_[_0x920d('0x8')](_0x10d24c)){_[_0x920d('0x9')](_0x10d24c,function(_0x1172d4,_0x18b56d){try{if(_0x23fb0f){var _0x5ce598=_[_0x920d('0xa')](_0x23fb0f,{'name':_0x18b56d})||{};if(hasSequelizeOperator(_0x1172d4)){_0x1299a0[_0x18b56d]=getOperatorValue(_0x1172d4);}else if(_0x5ce598['type']===_0x920d('0xb')&&_[_0x920d('0xc')](_0x1172d4)){var _0x204785=JSON[_0x920d('0x3')](_0x1172d4);var _0xb2eede={'$gte':moment(moment(_0x204785[_0x920d('0xd')])['format']('YYYY-MM-DD'))['utc']()[_0x920d('0xe')](),'$lte':moment(moment(_0x204785[_0x920d('0xf')])[_0x920d('0xe')]('YYYY-MM-DD'))[_0x920d('0x10')]()[_0x920d('0x11')](0x1,'s')['format']()};_0x1299a0[_0x18b56d]=_0xb2eede;}else if(_0x5ce598[_0x920d('0x12')]===_0x920d('0x13')){_0x1299a0[_0x18b56d]=_0x1172d4;}else{_0x1299a0[_0x18b56d]=_[_0x920d('0x14')](_0x1172d4)?_0x1172d4:JSON[_0x920d('0x3')](_0x1172d4);}}else{_0x1299a0[_0x18b56d]=_[_0x920d('0x14')](_0x1172d4)?_0x1172d4:JSON[_0x920d('0x3')](_0x1172d4);}}catch(_0x2bf016){_0x1299a0[_0x18b56d]=_0x1172d4['split'](',');}});}return _0x1299a0;};exports[_0x920d('0x15')]=function(_0x21a514){_0x21a514=parseInt(_0x21a514,0xa);if(!_0x21a514||_0x21a514<0x0){_0x21a514=LIMIT_VALUE;}return _0x21a514;};exports[_0x920d('0x16')]=function(_0x37f291){_0x37f291=parseInt(_0x37f291,0xa);if(!_0x37f291||_0x37f291<0x0){_0x37f291=0x0;}return _0x37f291;};exports[_0x920d('0x17')]=function(_0x295f29){var _0x133a88,_0xb344a8=null;if(_0x295f29){_0x133a88=_0x295f29[_0x920d('0x6')](',');_0xb344a8=_[_0x920d('0x18')](_0x133a88,function(_0x43bd91){if(_0x43bd91[_0x920d('0x19')]('-')===0x0){return[_0x43bd91===_0x920d('0x1a')?sequelize[_0x920d('0x1b')](sequelize[_0x920d('0x1c')](_0x920d('0x1a')),'unsigned'):_0x43bd91[_0x920d('0x1d')](0x1),_0x920d('0x1e')];}else{return[_0x43bd91===_0x920d('0x1a')?sequelize[_0x920d('0x1b')](sequelize['col'](_0x920d('0x1a')),_0x920d('0x1f')):_0x43bd91,'ASC'];}});}return _0xb344a8;};exports[_0x920d('0x20')]=function(_0x4ed28f,_0x466bf6){if(_[_0x920d('0x8')](_0x4ed28f)){return _0x4ed28f;}if(_[_0x920d('0x14')](_0x4ed28f)){for(var _0x58dd06=0x0;_0x58dd06<_0x4ed28f[_0x920d('0x21')];_0x58dd06+=0x1){_0x4ed28f[_0x58dd06]=this[_0x920d('0x20')](_0x4ed28f[_0x58dd06],_0x466bf6);}return _0x4ed28f;}if(!_[_0x920d('0x22')](_0x4ed28f)){return _0x4ed28f;}if(_[_0x920d('0x23')](_0x466bf6)){_0x466bf6=[_0x466bf6];}if(!_[_0x920d('0x14')](_0x466bf6)){return _0x4ed28f;}for(var _0x7bd8e5=0x0;_0x7bd8e5<_0x466bf6[_0x920d('0x21')];_0x7bd8e5+=0x1){_[_0x920d('0x24')](_0x4ed28f,_0x466bf6[_0x7bd8e5]);}for(var _0x47e1c9 in _0x4ed28f){if(_0x4ed28f[_0x920d('0x25')](_0x47e1c9)){_0x4ed28f[_0x47e1c9]=this['omit'](_0x4ed28f[_0x47e1c9],_0x466bf6);}}return _0x4ed28f;};exports[_0x920d('0x26')]=function(_0x3a91ba){return _0x3a91ba['match'](RegExp(_0x920d('0x27')))?!![]:![];};exports[_0x920d('0x28')]=function(_0x41ee07){return _0x41ee07[_0x920d('0x29')](/^\S+@\S+$/)?!![]:![];};exports[_0x920d('0x2a')]=function(_0x1857cc){var _0xf8ac6b=[];_0x1857cc[_0x920d('0x6')](/[ ,]+/)[_0x920d('0x2b')](function(_0x3200e0){_0x3200e0=_0x3200e0[_0x920d('0x2c')](/([^:]")"+/g,'$1');_0x3200e0='+'+_0x3200e0+'*';if(_0x3200e0[_0x920d('0x2d')]('@'))_0x3200e0='\x22'+_0x3200e0+'\x22';_0xf8ac6b[_0x920d('0x2e')](_0x3200e0);});return _0xf8ac6b['join']('\x20');};exports['getOptions']=function(_0x13506c,_0x720075,_0x6f97fc){var _0x11d35a={},_0x38f975={};if(_0x720075[_0x920d('0x2f')]['$id']){_0x720075[_0x920d('0x2f')]['id']=_0x720075['query'][_0x920d('0x30')];delete _0x720075['query'][_0x920d('0x30')];}_0x11d35a[_0x920d('0x31')]=_[_0x920d('0x18')](_0x13506c,'name');_0x11d35a[_0x920d('0x2f')]=_[_0x920d('0x4')](_0x720075[_0x920d('0x2f')]);_0x11d35a[_0x920d('0x7')]=_[_0x920d('0x32')](_0x11d35a[_0x920d('0x31')],_0x11d35a[_0x920d('0x2f')]);_0x38f975[_0x920d('0x33')]=_[_0x920d('0x32')](_0x11d35a[_0x920d('0x31')],this['fields'](_0x720075['query'][_0x920d('0x5')]));_0x38f975[_0x920d('0x33')]=_0x38f975[_0x920d('0x33')][_0x920d('0x21')]?_0x38f975[_0x920d('0x33')]:_0x11d35a[_0x920d('0x31')];if(!_0x720075[_0x920d('0x2f')][_0x920d('0x25')](_0x920d('0x34'))){_0x38f975[_0x920d('0x15')]=this[_0x920d('0x15')](_0x720075[_0x920d('0x2f')]['limit']);_0x38f975['offset']=this[_0x920d('0x16')](_0x720075['query'][_0x920d('0x16')]);}_0x38f975[_0x920d('0x35')]=this[_0x920d('0x17')](_0x720075[_0x920d('0x2f')][_0x920d('0x17')]);_0x38f975[_0x920d('0x36')]=this[_0x920d('0x7')](_[_0x920d('0x37')](_0x720075[_0x920d('0x2f')],_0x11d35a['filters']),_0x13506c);if(_0x720075[_0x920d('0x2f')][_0x920d('0x38')]){_0x38f975[_0x920d('0x36')]=_[_0x920d('0x39')](_0x38f975['where'],{'$or':_[_0x920d('0x18')](_0x13506c,function(_0xe1c3fe){if(_0xe1c3fe[_0x920d('0x3a')]!==_0x920d('0x3b')){if(_0x6f97fc){return sequelize[_0x920d('0x36')](sequelize['fn']('lower',sequelize[_0x920d('0x1c')](_0xe1c3fe[_0x920d('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x720075['query'][_0x920d('0x38')]+'%')});}else{var _0x12f682={};_0x12f682[_0xe1c3fe[_0x920d('0x12')]]={'$like':'%'+_0x720075['query']['filter']+'%'};return _0x12f682;}}})});}_0x38f975=_[_0x920d('0x39')]({},_0x38f975,_0x720075[_0x920d('0x3c')]);return _0x38f975;}; \ No newline at end of file +var _0x7479=['unsigned','ASC','omit','length','isObject','isString','unset','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','includes','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','nolimit','order','pick','where','type','VIRTUAL','lower','filter','merge','options','lodash','sequelize','parse','keys','fields','filters','isEmpty','forOwn','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','utc','subtract','name','isArray','split','limit','offset','sort','map','indexOf','priority','col','substr','cast'];(function(_0x6492e0,_0x3cc2b1){var _0x279645=function(_0x50cf99){while(--_0x50cf99){_0x6492e0['push'](_0x6492e0['shift']());}};_0x279645(++_0x3cc2b1);}(_0x7479,0x95));var _0x9747=function(_0x1c0e63,_0x5e9216){_0x1c0e63=_0x1c0e63-0x0;var _0x21b3db=_0x7479[_0x1c0e63];return _0x21b3db;};'use strict';var _=require(_0x9747('0x0'));var sequelize=require(_0x9747('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x599874){var _0x5da660=['ne'];try{var _0xd05f4d=JSON[_0x9747('0x2')](_0x599874);var _0x53e7ba=Object[_0x9747('0x3')](_0xd05f4d)[0x0];return _0x5da660['includes'](_0x53e7ba);}catch(_0x2a0884){return![];}}function getOperatorValue(_0x1fe619){var _0x67a092=JSON[_0x9747('0x2')](_0x1fe619);var _0x124dcc=Object[_0x9747('0x3')](_0x67a092)[0x0];var _0xadec60=_0x67a092[_0x124dcc];return{['$'+_0x124dcc]:_0xadec60};}exports[_0x9747('0x4')]=function(_0x4a5384){var _0x1342e3=null;if(_0x4a5384){_0x1342e3=_0x4a5384['split'](',');}return _0x1342e3;};exports[_0x9747('0x5')]=function(_0x2c66ed,_0x734bf){var _0x3229d9={};if(!_[_0x9747('0x6')](_0x2c66ed)){_[_0x9747('0x7')](_0x2c66ed,function(_0x320dc7,_0xa8e5ce){try{if(_0x734bf){var _0x36fc17=_['find'](_0x734bf,{'name':_0xa8e5ce})||{};if(hasSequelizeOperator(_0x320dc7)){_0x3229d9[_0xa8e5ce]=getOperatorValue(_0x320dc7);}else if(_0x36fc17['type']===_0x9747('0x8')&&_[_0x9747('0x9')](_0x320dc7)){var _0x237a1a=JSON[_0x9747('0x2')](_0x320dc7);var _0x4025fe={'$gte':moment(moment(_0x237a1a[_0x9747('0xa')])[_0x9747('0xb')](_0x9747('0xc')))['utc']()[_0x9747('0xb')](),'$lte':moment(moment(_0x237a1a[_0x9747('0xd')])[_0x9747('0xb')]('YYYY-MM-DD'))[_0x9747('0xe')]()[_0x9747('0xf')](0x1,'s')[_0x9747('0xb')]()};_0x3229d9[_0xa8e5ce]=_0x4025fe;}else if(_0x36fc17[_0x9747('0x10')]==='uniqueid'){_0x3229d9[_0xa8e5ce]=_0x320dc7;}else{_0x3229d9[_0xa8e5ce]=_[_0x9747('0x11')](_0x320dc7)?_0x320dc7:JSON[_0x9747('0x2')](_0x320dc7);}}else{_0x3229d9[_0xa8e5ce]=_[_0x9747('0x11')](_0x320dc7)?_0x320dc7:JSON[_0x9747('0x2')](_0x320dc7);}}catch(_0x378f0d){_0x3229d9[_0xa8e5ce]=_0x320dc7[_0x9747('0x12')](',');}});}return _0x3229d9;};exports[_0x9747('0x13')]=function(_0x15b251){_0x15b251=parseInt(_0x15b251,0xa);if(!_0x15b251||_0x15b251<0x0){_0x15b251=LIMIT_VALUE;}return _0x15b251;};exports[_0x9747('0x14')]=function(_0x426630){_0x426630=parseInt(_0x426630,0xa);if(!_0x426630||_0x426630<0x0){_0x426630=0x0;}return _0x426630;};exports[_0x9747('0x15')]=function(_0x48bbc9){var _0x4662f9,_0x2c8481=null;if(_0x48bbc9){_0x4662f9=_0x48bbc9['split'](',');_0x2c8481=_[_0x9747('0x16')](_0x4662f9,function(_0x1c0a84){if(_0x1c0a84[_0x9747('0x17')]('-')===0x0){return[_0x1c0a84===_0x9747('0x18')?sequelize['cast'](sequelize[_0x9747('0x19')](_0x9747('0x18')),'unsigned'):_0x1c0a84[_0x9747('0x1a')](0x1),'DESC'];}else{return[_0x1c0a84==='priority'?sequelize[_0x9747('0x1b')](sequelize['col'](_0x9747('0x18')),_0x9747('0x1c')):_0x1c0a84,_0x9747('0x1d')];}});}return _0x2c8481;};exports[_0x9747('0x1e')]=function(_0x4b9849,_0x1cf57b){if(_[_0x9747('0x6')](_0x4b9849)){return _0x4b9849;}if(_[_0x9747('0x11')](_0x4b9849)){for(var _0x41869a=0x0;_0x41869a<_0x4b9849[_0x9747('0x1f')];_0x41869a+=0x1){_0x4b9849[_0x41869a]=this['omit'](_0x4b9849[_0x41869a],_0x1cf57b);}return _0x4b9849;}if(!_[_0x9747('0x20')](_0x4b9849)){return _0x4b9849;}if(_[_0x9747('0x21')](_0x1cf57b)){_0x1cf57b=[_0x1cf57b];}if(!_[_0x9747('0x11')](_0x1cf57b)){return _0x4b9849;}for(var _0x26b5a6=0x0;_0x26b5a6<_0x1cf57b[_0x9747('0x1f')];_0x26b5a6+=0x1){_[_0x9747('0x22')](_0x4b9849,_0x1cf57b[_0x26b5a6]);}for(var _0x4cd40f in _0x4b9849){if(_0x4b9849['hasOwnProperty'](_0x4cd40f)){_0x4b9849[_0x4cd40f]=this[_0x9747('0x1e')](_0x4b9849[_0x4cd40f],_0x1cf57b);}}return _0x4b9849;};exports['isNumeric']=function(_0x91d60d){return _0x91d60d[_0x9747('0x23')](RegExp(_0x9747('0x24')))?!![]:![];};exports[_0x9747('0x25')]=function(_0x4a19cd){return _0x4a19cd['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x9747('0x26')]=function(_0x1cbab0){var _0x12b75f=[];_0x1cbab0[_0x9747('0x12')](/[ ,]+/)[_0x9747('0x27')](function(_0xe6d4){_0xe6d4=_0xe6d4[_0x9747('0x28')](/([^:]")"+/g,'$1');_0xe6d4='+'+_0xe6d4+'*';if(_0xe6d4[_0x9747('0x29')]('@'))_0xe6d4='\x22'+_0xe6d4+'\x22';_0x12b75f['push'](_0xe6d4);});return _0x12b75f['join']('\x20');};exports[_0x9747('0x2a')]=function(_0x1afc25,_0x276582,_0x1322f3){var _0x29e82f={},_0x4b1bc9={};if(_0x276582[_0x9747('0x2b')][_0x9747('0x2c')]){_0x276582[_0x9747('0x2b')]['id']=_0x276582[_0x9747('0x2b')]['$id'];delete _0x276582[_0x9747('0x2b')]['$id'];}_0x29e82f[_0x9747('0x2d')]=_[_0x9747('0x16')](_0x1afc25,_0x9747('0x10'));_0x29e82f[_0x9747('0x2b')]=_[_0x9747('0x3')](_0x276582[_0x9747('0x2b')]);_0x29e82f[_0x9747('0x5')]=_[_0x9747('0x2e')](_0x29e82f['model'],_0x29e82f[_0x9747('0x2b')]);_0x4b1bc9[_0x9747('0x2f')]=_[_0x9747('0x2e')](_0x29e82f['model'],this['fields'](_0x276582[_0x9747('0x2b')][_0x9747('0x4')]));_0x4b1bc9[_0x9747('0x2f')]=_0x4b1bc9[_0x9747('0x2f')]['length']?_0x4b1bc9[_0x9747('0x2f')]:_0x29e82f[_0x9747('0x2d')];if(!_0x276582[_0x9747('0x2b')][_0x9747('0x30')](_0x9747('0x31'))){_0x4b1bc9[_0x9747('0x13')]=this[_0x9747('0x13')](_0x276582[_0x9747('0x2b')][_0x9747('0x13')]);_0x4b1bc9[_0x9747('0x14')]=this[_0x9747('0x14')](_0x276582['query'][_0x9747('0x14')]);}_0x4b1bc9[_0x9747('0x32')]=this['sort'](_0x276582['query'][_0x9747('0x15')]);_0x4b1bc9['where']=this[_0x9747('0x5')](_[_0x9747('0x33')](_0x276582['query'],_0x29e82f[_0x9747('0x5')]),_0x1afc25);if(_0x276582['query']['filter']){_0x4b1bc9[_0x9747('0x34')]=_['merge'](_0x4b1bc9['where'],{'$or':_['map'](_0x1afc25,function(_0x1f4840){if(_0x1f4840[_0x9747('0x35')]!==_0x9747('0x36')){if(_0x1322f3){return sequelize[_0x9747('0x34')](sequelize['fn'](_0x9747('0x37'),sequelize[_0x9747('0x19')](_0x1f4840[_0x9747('0x10')])),{'$like':sequelize['fn']('lower','%'+_0x276582[_0x9747('0x2b')]['filter']+'%')});}else{var _0x3bdfb7={};_0x3bdfb7[_0x1f4840[_0x9747('0x10')]]={'$like':'%'+_0x276582[_0x9747('0x2b')][_0x9747('0x38')]+'%'};return _0x3bdfb7;}}})});}_0x4b1bc9=_[_0x9747('0x39')]({},_0x4b1bc9,_0x276582[_0x9747('0x3a')]);return _0x4b1bc9;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index dbedafa..2ebba95 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32d1=['env','production','set','appPath','join','public','development','test','root','client','use','split','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','initialize','express','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','./environment','default','get'];(function(_0x4432ca,_0x1c3ae8){var _0x29424c=function(_0x4ca3ee){while(--_0x4ca3ee){_0x4432ca['push'](_0x4432ca['shift']());}};_0x29424c(++_0x1c3ae8);}(_0x32d1,0x79));var _0x132d=function(_0x722d30,_0x1633a3){_0x722d30=_0x722d30-0x0;var _0x22b826=_0x32d1[_0x722d30];return _0x22b826;};'use strict';var express=require(_0x132d('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x132d('0x1'));var methodOverride=require(_0x132d('0x2'));var cookieParser=require(_0x132d('0x3'));var errorHandler=require(_0x132d('0x4'));var path=require(_0x132d('0x5'));var passport=require(_0x132d('0x6'));var cors=require(_0x132d('0x7'));var moment=require('moment');var config=require(_0x132d('0x8'));var db=require('../mysqldb')['db'];exports[_0x132d('0x9')]=function(_0x163257){var _0x6055bd=_0x163257[_0x132d('0xa')](_0x132d('0xb'));if(_0x6055bd===_0x132d('0xc')){_0x163257[_0x132d('0xd')](_0x132d('0xe'),path[_0x132d('0xf')](config['root'],_0x132d('0x10')));}if(_0x6055bd===_0x132d('0x11')||_0x6055bd===_0x132d('0x12')){_0x163257[_0x132d('0xd')](_0x132d('0xe'),path['join'](config[_0x132d('0x13')],_0x132d('0x14')));_0x163257[_0x132d('0x15')](errorHandler());}_0x163257[_0x132d('0xd')]('json\x20replacer',function(_0xf7ee7a,_0x3e18bd){if(this[_0xf7ee7a]instanceof Date){_0x3e18bd=this[_0xf7ee7a]['toISOString']()[_0x132d('0x16')]('.')[0x0]+'Z';}return _0x3e18bd;});_0x163257[_0x132d('0x15')](express['static'](_0x163257[_0x132d('0xa')]('appPath')));_0x163257['set'](_0x132d('0x17'),config[_0x132d('0x13')]+_0x132d('0x18'));_0x163257[_0x132d('0x19')](_0x132d('0x1a'),require(_0x132d('0x1b'))[_0x132d('0x1c')]);_0x163257[_0x132d('0xd')](_0x132d('0x1d'),_0x132d('0x1a'));_0x163257[_0x132d('0x15')](bodyParser[_0x132d('0x1e')]({'limit':'50mb','extended':!![]}));_0x163257[_0x132d('0x15')](bodyParser[_0x132d('0x1f')]({'limit':'50mb'}));_0x163257['use'](cors());_0x163257[_0x132d('0x15')](methodOverride());_0x163257[_0x132d('0x15')](cookieParser());_0x163257[_0x132d('0x15')](passport[_0x132d('0x20')]());}; \ No newline at end of file +var _0x5833=['view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','./environment','../mysqldb','default','get','env','production','set','join','development','appPath','root','use','json\x20replacer','toISOString','split','static','views','/server/views','engine','html','ejs','renderFile'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x5833,0x149));var _0x3583=function(_0x537ba2,_0xfea899){_0x537ba2=_0x537ba2-0x0;var _0x15de2c=_0x5833[_0x537ba2];return _0x15de2c;};'use strict';var express=require(_0x3583('0x0'));var favicon=require(_0x3583('0x1'));var bodyParser=require(_0x3583('0x2'));var methodOverride=require(_0x3583('0x3'));var cookieParser=require(_0x3583('0x4'));var errorHandler=require(_0x3583('0x5'));var path=require(_0x3583('0x6'));var passport=require(_0x3583('0x7'));var cors=require(_0x3583('0x8'));var moment=require('moment');var config=require(_0x3583('0x9'));var db=require(_0x3583('0xa'))['db'];exports[_0x3583('0xb')]=function(_0x233af8){var _0x32a845=_0x233af8[_0x3583('0xc')](_0x3583('0xd'));if(_0x32a845===_0x3583('0xe')){_0x233af8[_0x3583('0xf')]('appPath',path[_0x3583('0x10')](config['root'],'public'));}if(_0x32a845===_0x3583('0x11')||_0x32a845==='test'){_0x233af8[_0x3583('0xf')](_0x3583('0x12'),path[_0x3583('0x10')](config[_0x3583('0x13')],'client'));_0x233af8[_0x3583('0x14')](errorHandler());}_0x233af8['set'](_0x3583('0x15'),function(_0x41943b,_0x154337){if(this[_0x41943b]instanceof Date){_0x154337=this[_0x41943b][_0x3583('0x16')]()[_0x3583('0x17')]('.')[0x0]+'Z';}return _0x154337;});_0x233af8[_0x3583('0x14')](express[_0x3583('0x18')](_0x233af8[_0x3583('0xc')](_0x3583('0x12'))));_0x233af8[_0x3583('0xf')](_0x3583('0x19'),config[_0x3583('0x13')]+_0x3583('0x1a'));_0x233af8[_0x3583('0x1b')](_0x3583('0x1c'),require(_0x3583('0x1d'))[_0x3583('0x1e')]);_0x233af8[_0x3583('0xf')](_0x3583('0x1f'),_0x3583('0x1c'));_0x233af8['use'](bodyParser[_0x3583('0x20')]({'limit':_0x3583('0x21'),'extended':!![]}));_0x233af8[_0x3583('0x14')](bodyParser[_0x3583('0x22')]({'limit':_0x3583('0x21')}));_0x233af8[_0x3583('0x14')](cors());_0x233af8[_0x3583('0x14')](methodOverride());_0x233af8[_0x3583('0x14')](cookieParser());_0x233af8[_0x3583('0x14')](passport[_0x3583('0x23')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index da9c523..08162fd 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 _0x075a=['IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','model','join','md5','update','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','digest','substring','crypto','child_process','execSync','keys','length','filter','family'];(function(_0x1e001d,_0x2d0895){var _0x1f86f9=function(_0x122940){while(--_0x122940){_0x1e001d['push'](_0x1e001d['shift']());}};_0x1f86f9(++_0x2d0895);}(_0x075a,0x119));var _0xa075=function(_0x4125bf,_0x1e2eff){_0x4125bf=_0x4125bf-0x0;var _0x542bec=_0x075a[_0x4125bf];return _0x542bec;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xa075('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xa075('0x1'))[_0xa075('0x2')];var config=require('../environment');function getInterfaces(){var _0x2c2432=[];var _0x365388=os['networkInterfaces']();var _0x35aaff=_['orderBy'](_[_0xa075('0x3')](_0x365388));for(var _0x2287f3=0x0;_0x2287f3<_0x35aaff[_0xa075('0x4')];_0x2287f3++){var _0x486a50=_0x365388[_0x35aaff[_0x2287f3]][_0xa075('0x5')](function(_0x57ab88){return _0x57ab88[_0xa075('0x6')]===_0xa075('0x7')&&_0x57ab88[_0xa075('0x8')]===![];});_0x2c2432=_0x2c2432['concat'](_0x486a50);}return _0x2c2432;}function getFirstInterface(){var _0xd57dcb=_[_0xa075('0x9')](getInterfaces());return{'macAddress':_0xd57dcb&&_0xd57dcb['mac']?_0xd57dcb[_0xa075('0xa')]:_0xa075('0xb'),'ipAddress':_0xd57dcb&&_0xd57dcb[_0xa075('0xc')]?_0xd57dcb[_0xa075('0xc')]:_0xa075('0xd')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x2dd735=_['orderBy'](os[_0xa075('0xe')]()['map'](function(_0x3bc3ac){return _0x3bc3ac[_0xa075('0xf')];}))[_0xa075('0x10')](':');return crypto['createHash'](_0xa075('0x11'))[_0xa075('0x12')](_0x2dd735)['digest']('hex');}exports[_0xa075('0x13')]=function(){var _0x1926c4=os[_0xa075('0x14')]();var _0x281b26=/[0-9a-f-]{36}/;if(config[_0xa075('0x15')]&&_0x281b26[_0xa075('0x16')](config[_0xa075('0x15')])){return config[_0xa075('0x15')];}else if(_0x1926c4===_0xa075('0x17')){return exec(_0xa075('0x18'),{'encoding':_0xa075('0x19')})[_0xa075('0x1a')]('\x0d\x0a','');}else{var _0x96450d=getFirstInterface();var _0x2bfb87=getCPUhash();var _0x58acdc=_0x2bfb87+'|'+os[_0xa075('0x1b')]()+'|'+_0x96450d[_0xa075('0x1c')]+'|'+_0x96450d[_0xa075('0x1d')];var _0x5117e3=crypto['createHash'](_0xa075('0x11'))[_0xa075('0x12')](_0x58acdc)[_0xa075('0x1e')]('hex');return _0x5117e3[_0xa075('0x1f')](0x0,0x8)+'-'+_0x5117e3['substring'](0x8,0xc)+'-'+_0x5117e3[_0xa075('0x1f')](0xc,0x10)+'-'+_0x5117e3['substring'](0x10,0x14)+'-'+_0x5117e3['substring'](0x14);}}; \ No newline at end of file +var _0xef01=['digest','hex','getUuid','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','substring','lodash','crypto','bimedia-machine-uuid','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','head','mac','address','getFirstInterface','cpus','model','join','createHash','md5','update'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xef01,0x155));var _0x1ef0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xef01[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1ef0('0x0'));var os=require('os');var crypto=require(_0x1ef0('0x1'));var machine=require(_0x1ef0('0x2'));var exec=require('child_process')['execSync'];var config=require(_0x1ef0('0x3'));function getInterfaces(){var _0x5cffe8=[];var _0x32a0c8=os[_0x1ef0('0x4')]();var _0x3a5672=_[_0x1ef0('0x5')](_[_0x1ef0('0x6')](_0x32a0c8));for(var _0x57e0b8=0x0;_0x57e0b8<_0x3a5672[_0x1ef0('0x7')];_0x57e0b8++){var _0x8ca2c6=_0x32a0c8[_0x3a5672[_0x57e0b8]][_0x1ef0('0x8')](function(_0x3f5b7f){return _0x3f5b7f[_0x1ef0('0x9')]===_0x1ef0('0xa')&&_0x3f5b7f[_0x1ef0('0xb')]===![];});_0x5cffe8=_0x5cffe8['concat'](_0x8ca2c6);}return _0x5cffe8;}function getFirstInterface(){var _0x5b9148=_[_0x1ef0('0xc')](getInterfaces());return{'macAddress':_0x5b9148&&_0x5b9148[_0x1ef0('0xd')]?_0x5b9148[_0x1ef0('0xd')]:'00:00:00:00:00:00','ipAddress':_0x5b9148&&_0x5b9148[_0x1ef0('0xe')]?_0x5b9148[_0x1ef0('0xe')]:'127.0.0.1'};}exports[_0x1ef0('0xf')]=getFirstInterface;function getCPUhash(){var _0xbc0e3c=_[_0x1ef0('0x5')](os[_0x1ef0('0x10')]()['map'](function(_0x1badb1){return _0x1badb1[_0x1ef0('0x11')];}))[_0x1ef0('0x12')](':');return crypto[_0x1ef0('0x13')](_0x1ef0('0x14'))[_0x1ef0('0x15')](_0xbc0e3c)[_0x1ef0('0x16')](_0x1ef0('0x17'));}exports[_0x1ef0('0x18')]=function(){var _0x48d264=os['platform']();var _0x42d22e=/[0-9a-f-]{36}/;if(config[_0x1ef0('0x19')]&&_0x42d22e[_0x1ef0('0x1a')](config[_0x1ef0('0x19')])){return config[_0x1ef0('0x19')];}else if(_0x48d264==='win32'){return exec(_0x1ef0('0x1b'),{'encoding':_0x1ef0('0x1c')})[_0x1ef0('0x1d')]('\x0d\x0a','');}else{var _0x4748cd=getFirstInterface();var _0x4f8470=getCPUhash();var _0x30b1f3=_0x4f8470+'|'+os[_0x1ef0('0x1e')]()+'|'+_0x4748cd[_0x1ef0('0x1f')]+'|'+_0x4748cd['ipAddress'];var _0x248629=crypto['createHash']('md5')[_0x1ef0('0x15')](_0x30b1f3)['digest'](_0x1ef0('0x17'));return _0x248629[_0x1ef0('0x20')](0x0,0x8)+'-'+_0x248629[_0x1ef0('0x20')](0x8,0xc)+'-'+_0x248629['substring'](0xc,0x10)+'-'+_0x248629[_0x1ef0('0x20')](0x10,0x14)+'-'+_0x248629[_0x1ef0('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index fd827ec..b87f263 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 _0x59b3=['%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','get','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','format','encryptString','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','./hardware','../logger','license'];(function(_0x113990,_0x42ff49){var _0x4ddc63=function(_0x49885f){while(--_0x49885f){_0x113990['push'](_0x113990['shift']());}};_0x4ddc63(++_0x42ff49);}(_0x59b3,0xce));var _0x359b=function(_0x46496c,_0x289e70){_0x46496c=_0x46496c-0x0;var _0x4f77c8=_0x59b3[_0x46496c];return _0x4f77c8;};'use strict';var util=require(_0x359b('0x0'));var moment=require(_0x359b('0x1'));var rp=require(_0x359b('0x2'));var BPromise=require(_0x359b('0x3'));var pkginfo=require(_0x359b('0x4'))(module,'version');var db=require(_0x359b('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x359b('0x6'));var logger=require(_0x359b('0x7'))(_0x359b('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3c5ac9){return new BPromise(function(_0xb5c49f,_0x39a970){var _0x20af1a=util['format'](_0x359b('0x9'),HOST,_0x3c5ac9,module['exports']['version']);if(oldToken){_0x20af1a=util['format'](_0x359b('0xa'),HOST,_0x3c5ac9,module[_0x359b('0xb')]['version'],oldToken);}var _0x238f82={'uri':_0x20af1a,'method':_0x359b('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x238f82)['then'](function(_0x569e1d){_0xb5c49f(_0x569e1d);})['catch'](function(_0x4560ba){_0x39a970(_0x4560ba);});});}function manageLicense(_0x1040b6,_0x3146c6){var _0xbc7f2f=_0x3146c6[_0x359b('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0xbc7f2f[_0x359b('0xe')]!==_0x1040b6&&!_0xbc7f2f[_0x359b('0xf')]){oldToken=_0xbc7f2f[_0x359b('0xe')];}httpRequest(_0x1040b6)[_0x359b('0x10')](function(_0x215e8e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x215e8e[_0x359b('0x11')]){isOldTokenSent=![];if(!_0xbc7f2f[_0x359b('0x8')]&&_0xbc7f2f['license']!=_0x215e8e[_0x359b('0x8')]||_0xbc7f2f[_0x359b('0x8')]&&_0xbc7f2f[_0x359b('0xf')]){logger[_0x359b('0x12')](_0x359b('0x13'));}if(_0xbc7f2f[_0x359b('0x8')]&&!_0xbc7f2f[_0x359b('0xf')]&&_0xbc7f2f['license']!=_0x215e8e[_0x359b('0x8')]){logger[_0x359b('0x12')](_0x359b('0x14'));}if(_0xbc7f2f[_0x359b('0x8')]&&!_0xbc7f2f[_0x359b('0xf')]&&_0xbc7f2f[_0x359b('0x8')]==_0x215e8e[_0x359b('0x8')]){return _0x3146c6;}return _0x3146c6[_0x359b('0x15')]({'data1':_0x1040b6,'data2':null,'license':_0x215e8e[_0x359b('0x8')]});}else{if(_0x215e8e[_0x359b('0x8')]||_0xbc7f2f[_0x359b('0x8')]){if(!_0xbc7f2f[_0x359b('0xf')]){if(_0xbc7f2f[_0x359b('0xe')]==_0x1040b6){GRAY_PERIOD_REASON=_0x359b('0x16');logger[_0x359b('0x12')](_0x359b('0x17'));}else{GRAY_PERIOD_REASON=_0x359b('0x18');logger[_0x359b('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xbc7f2f[_0x359b('0xe')],_0x1040b6);}logger[_0x359b('0x12')](_0x359b('0x19'),GRAY_PERIOD_REASON[_0x359b('0x1a')](),moment()[_0x359b('0x1b')]('YYYY-MM-DD\x20HH:mm'));return _0x3146c6[_0x359b('0x15')]({'data2':encryptor[_0x359b('0x1c')](moment()[_0x359b('0x1b')](_0x359b('0x1d')))});}else{if(moment()[_0x359b('0x1e')](encryptor['decryptString'](_0xbc7f2f[_0x359b('0xf')]),_0x359b('0x1f'))>DAYS){logger[_0x359b('0x12')](_0x359b('0x20'),moment()[_0x359b('0x1b')](_0x359b('0x1d')));isOldTokenSent=![];return _0x3146c6['update']({'data1':_0x1040b6,'data2':null,'license':null});}}}else{if(_0xbc7f2f[_0x359b('0xe')]!=_0x1040b6){logger['info'](_0x359b('0x21'),_0xbc7f2f['data1'],_0x1040b6);return _0x3146c6[_0x359b('0x15')]({'data1':_0x1040b6,'data2':null,'license':null});}}}return _0x3146c6;})[_0x359b('0x10')](function(_0xfcd292){_0x3146c6=_0xfcd292;})['catch'](function(_0x1dd188){logger[_0x359b('0x22')](_0x1dd188[_0x359b('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x359b('0x24')](),_0x3146c6);},TIME);});}function defaultLicense(){var _0x16426a=hardware[_0x359b('0x24')]();if(_0x16426a){return db[_0x359b('0x25')][_0x359b('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x16426a}})[_0x359b('0x27')](function(_0xb0cbb,_0x53d1df){logger[_0x359b('0x12')](_0x359b('0x28'),_0x16426a);manageLicense(_0x16426a,_0xb0cbb);})[_0x359b('0x29')](function(_0x103160){logger[_0x359b('0x22')](_0x103160[_0x359b('0x23')]);});}}exports[_0x359b('0x2a')]=defaultLicense; \ No newline at end of file +var _0x90a0=['YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString'];(function(_0x6eeca9,_0x5f48c2){var _0xf4958=function(_0x30af8e){while(--_0x30af8e){_0x6eeca9['push'](_0x6eeca9['shift']());}};_0xf4958(++_0x5f48c2);}(_0x90a0,0xef));var _0x090a=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x90a0[_0xe66cf2];return _0x2d84e7;};'use strict';var util=require(_0x090a('0x0'));var moment=require(_0x090a('0x1'));var rp=require(_0x090a('0x2'));var BPromise=require(_0x090a('0x3'));var pkginfo=require(_0x090a('0x4'))(module,_0x090a('0x5'));var db=require(_0x090a('0x6'))['db'];var encryptor=require(_0x090a('0x7'));var hardware=require(_0x090a('0x8'));var logger=require(_0x090a('0x9'))(_0x090a('0xa'));var HOST=_0x090a('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x9feade){return new BPromise(function(_0x1e4507,_0x4680b3){var _0x31bde9=util[_0x090a('0xc')](_0x090a('0xd'),HOST,_0x9feade,module[_0x090a('0xe')][_0x090a('0x5')]);if(oldToken){_0x31bde9=util[_0x090a('0xc')](_0x090a('0xf'),HOST,_0x9feade,module[_0x090a('0xe')][_0x090a('0x5')],oldToken);}var _0x49da41={'uri':_0x31bde9,'method':_0x090a('0x10'),'timeout':0xea60,'json':!![]};return rp(_0x49da41)[_0x090a('0x11')](function(_0x2be845){_0x1e4507(_0x2be845);})['catch'](function(_0x3bc862){_0x4680b3(_0x3bc862);});});}function manageLicense(_0x456478,_0x1eb8bc){var _0xfa95f0=_0x1eb8bc[_0x090a('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0xfa95f0[_0x090a('0x13')]!==_0x456478&&!_0xfa95f0[_0x090a('0x14')]){oldToken=_0xfa95f0[_0x090a('0x13')];}httpRequest(_0x456478)[_0x090a('0x11')](function(_0x5c76a9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5c76a9[_0x090a('0x15')]){isOldTokenSent=![];if(!_0xfa95f0[_0x090a('0xa')]&&_0xfa95f0['license']!=_0x5c76a9[_0x090a('0xa')]||_0xfa95f0['license']&&_0xfa95f0[_0x090a('0x14')]){logger[_0x090a('0x16')](_0x090a('0x17'));}if(_0xfa95f0['license']&&!_0xfa95f0[_0x090a('0x14')]&&_0xfa95f0[_0x090a('0xa')]!=_0x5c76a9[_0x090a('0xa')]){logger[_0x090a('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0xfa95f0['license']&&!_0xfa95f0[_0x090a('0x14')]&&_0xfa95f0['license']==_0x5c76a9[_0x090a('0xa')]){return _0x1eb8bc;}return _0x1eb8bc[_0x090a('0x18')]({'data1':_0x456478,'data2':null,'license':_0x5c76a9[_0x090a('0xa')]});}else{if(_0x5c76a9[_0x090a('0xa')]||_0xfa95f0[_0x090a('0xa')]){if(!_0xfa95f0['data2']){if(_0xfa95f0[_0x090a('0x13')]==_0x456478){GRAY_PERIOD_REASON='Disabled';logger[_0x090a('0x16')](_0x090a('0x19'));}else{GRAY_PERIOD_REASON=_0x090a('0x1a');logger['info'](_0x090a('0x1b'),_0xfa95f0[_0x090a('0x13')],_0x456478);}logger[_0x090a('0x16')](_0x090a('0x1c'),GRAY_PERIOD_REASON[_0x090a('0x1d')](),moment()[_0x090a('0xc')]('YYYY-MM-DD\x20HH:mm'));return _0x1eb8bc[_0x090a('0x18')]({'data2':encryptor[_0x090a('0x1e')](moment()[_0x090a('0xc')](_0x090a('0x1f')))});}else{if(moment()[_0x090a('0x20')](encryptor[_0x090a('0x21')](_0xfa95f0[_0x090a('0x14')]),_0x090a('0x22'))>DAYS){logger['info'](_0x090a('0x23'),moment()['format'](_0x090a('0x1f')));isOldTokenSent=![];return _0x1eb8bc[_0x090a('0x18')]({'data1':_0x456478,'data2':null,'license':null});}}}else{if(_0xfa95f0[_0x090a('0x13')]!=_0x456478){logger[_0x090a('0x16')](_0x090a('0x1b'),_0xfa95f0['data1'],_0x456478);return _0x1eb8bc[_0x090a('0x18')]({'data1':_0x456478,'data2':null,'license':null});}}}return _0x1eb8bc;})[_0x090a('0x11')](function(_0x9c515e){_0x1eb8bc=_0x9c515e;})[_0x090a('0x24')](function(_0x499253){logger[_0x090a('0x25')](_0x499253[_0x090a('0x26')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x090a('0x27')](),_0x1eb8bc);},TIME);});}function defaultLicense(){var _0x408f9b=hardware[_0x090a('0x27')]();if(_0x408f9b){return db[_0x090a('0x28')][_0x090a('0x29')]({'where':{'id':0x1},'defaults':{'data1':_0x408f9b}})[_0x090a('0x2a')](function(_0x2267b3,_0x519266){logger[_0x090a('0x16')](_0x090a('0x2b'),_0x408f9b);manageLicense(_0x408f9b,_0x2267b3);})[_0x090a('0x24')](function(_0x5e5055){logger[_0x090a('0x25')](_0x5e5055[_0x090a('0x26')]);});}}exports[_0x090a('0x2c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 128839c..dc90e39 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 _0x9bd2=['defaults','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','demo','deadline','add','grayReason','machineUuid','changed','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephone','forEach','user','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find'];(function(_0x18f9eb,_0x469ee2){var _0x31156e=function(_0x3bdc96){while(--_0x3bdc96){_0x18f9eb['push'](_0x18f9eb['shift']());}};_0x31156e(++_0x469ee2);}(_0x9bd2,0x19b));var _0x29bd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9bd2[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x29bd('0x0'));var _=require(_0x29bd('0x1'));var moment=require(_0x29bd('0x2'));var BPromise=require(_0x29bd('0x3'));var hardware=require(_0x29bd('0x4'));var encryptor=require(_0x29bd('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x29bd('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x29bd('0x7'),'machineUuid':hardware[_0x29bd('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':_0x29bd('0x9'),'machineUuid':hardware[_0x29bd('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x385443){return new BPromise(function(_0x122301,_0x2e1e64){return db[_0x29bd('0xa')][_0x29bd('0xb')](_[_0x29bd('0xc')](_0x385443,{'raw':!![],'where':{'id':0x1}}))[_0x29bd('0xd')](function(_0x52c8a5){return checkLicense(_0x52c8a5,null);})[_0x29bd('0xd')](function(_0x49e035){_0x122301(_0x49e035);return;})[_0x29bd('0xe')](function(_0x54aa88){_0x2e1e64(_0x54aa88);});});}function checkLicense(_0x2dd5e9,_0x253ff9){if(!_0x2dd5e9){demoLicense[_0x29bd('0xf')]=_0x2dd5e9['data1'];return demoLicense;}try{var _0x2068ed=_0x253ff9||_0x2dd5e9[_0x29bd('0x10')];if(_[_0x29bd('0x11')](_0x2068ed)){throw new Error(_0x29bd('0x12'));}var _0x10aa5b=_0x2dd5e9[_0x29bd('0x13')];var _0x526cc2=_0x2dd5e9[_0x29bd('0x14')];var _0x2449cd=_0x10aa5b[_0x29bd('0x15')]('-')[0x4];var _0x5ce061=_0x10aa5b[_0x29bd('0x15')]('-')[0x0];var _0xd0d972=encryptor[_0x29bd('0x16')](_0x2068ed,util[_0x29bd('0x17')](_0x29bd('0x18'),_0x2449cd,_0x10aa5b,_0x5ce061));var _0x58f494=JSON['parse'](_0xd0d972);_0x58f494[_0x29bd('0x19')]=![];_0x58f494[_0x29bd('0xf')]=_0x10aa5b;_0x58f494['machineUuid']=hardware[_0x29bd('0x8')]();if(_0x526cc2){var _0x114cbf=encryptor[_0x29bd('0x16')](_0x526cc2);_0x58f494['gray']=_0x114cbf;_0x58f494[_0x29bd('0x1a')]=moment(_0x114cbf)[_0x29bd('0x1b')](0x7,'days')[_0x29bd('0x17')]();_0x58f494[_0x29bd('0x1c')]=_0x58f494[_0x29bd('0xf')]!=_0x58f494[_0x29bd('0x1d')]?_0x29bd('0x1e'):'disabled';}return _0x58f494;}catch(_0x526867){breakingLicense['uuid']=_0x2dd5e9[_0x29bd('0x13')];breakingLicense[_0x29bd('0x1f')]=_0x526867[_0x29bd('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x55a9ac,_0x55b2eb){getLicense()[_0x29bd('0xd')](function(_0x5d8e1a){return db[_0x29bd('0x20')][_0x29bd('0x21')]({'attributes':[_0x29bd('0x22'),[db[_0x29bd('0x23')]['fn'](_0x29bd('0x24'),db[_0x29bd('0x23')][_0x29bd('0x25')](_0x29bd('0x22'))),_0x29bd('0x26')]],'group':_0x29bd('0x22'),'where':{'role':{'$or':[_0x29bd('0x27'),'user',_0x29bd('0x28')]}},'raw':!![]})[_0x29bd('0xd')](function(_0x5b5fdd){var _0x25a6b3={'user':_0x5d8e1a['users']||0x0,'telephone':_0x5d8e1a['telephones']||0x0};_0x5b5fdd[_0x29bd('0x29')](function(_0x52bab0){var _0x39e6ca=_0x52bab0[_0x29bd('0x22')]==='admin'?_0x29bd('0x2a'):_0x52bab0[_0x29bd('0x22')];_0x25a6b3[_0x39e6ca]-=_0x52bab0[_0x29bd('0x26')];if(_0x25a6b3[_0x39e6ca]<0x0)_0x25a6b3[_0x39e6ca]=0x0;});_0x55a9ac(_0x25a6b3);return;});})[_0x29bd('0xe')](function(_0x260853){_0x55b2eb(_0x260853);});});}function checkUserLimits(_0xaa73dc){return new BPromise(function(_0x2c325d,_0x2122f5){getLimits()[_0x29bd('0xd')](function(_0x137cab){var _0x51748b=_[_0x29bd('0x2b')](_['countBy'](_0xaa73dc,_0x29bd('0x22')),[_0x29bd('0x27'),_0x29bd('0x2a'),'telephone']);var _0x2c61c9=(_0x51748b[_0x29bd('0x27')]||0x0)+(_0x51748b[_0x29bd('0x2a')]||0x0);var _0x11fc23=_0x51748b[_0x29bd('0x28')]||0x0;if(_0x2c61c9>_0x137cab[_0x29bd('0x2a')])return _0x2122f5(_0x29bd('0x2c'));if(_0x11fc23>_0x137cab[_0x29bd('0x28')])return _0x2122f5(_0x29bd('0x2d'));return _0x2c325d();})[_0x29bd('0xe')](function(_0x40ae48){_0x2122f5(_0x40ae48);});});}module[_0x29bd('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x255c=['find','defaults','then','catch','uuid','license','isEmpty','data1','data2','split','decryptString','%s:%s:%s','parse','demo','machineUuid','deadline','add','days','grayReason','changed','User','role','sequelize','COUNT','col','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x255c,0xe5));var _0xc255=function(_0x5ca733,_0x8bbe05){_0x5ca733=_0x5ca733-0x0;var _0x1ee41d=_0x255c[_0x5ca733];return _0x1ee41d;};'use strict';var util=require('util');var _=require(_0xc255('0x0'));var moment=require(_0xc255('0x1'));var BPromise=require(_0xc255('0x2'));var hardware=require(_0xc255('0x3'));var encryptor=require(_0xc255('0x4'));var db=require(_0xc255('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc255('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc255('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc255('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc255('0x8'),'machineUuid':hardware[_0xc255('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x58bb8d){return new BPromise(function(_0x2ff595,_0xfca980){return db[_0xc255('0xa')][_0xc255('0xb')](_[_0xc255('0xc')](_0x58bb8d,{'raw':!![],'where':{'id':0x1}}))[_0xc255('0xd')](function(_0x5a660a){return checkLicense(_0x5a660a,null);})[_0xc255('0xd')](function(_0x1a199a){_0x2ff595(_0x1a199a);return;})[_0xc255('0xe')](function(_0x56aecd){_0xfca980(_0x56aecd);});});}function checkLicense(_0x29bbdd,_0x2e3095){if(!_0x29bbdd){demoLicense[_0xc255('0xf')]=_0x29bbdd['data1'];return demoLicense;}try{var _0x2138a9=_0x2e3095||_0x29bbdd[_0xc255('0x10')];if(_[_0xc255('0x11')](_0x2138a9)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2c9a79=_0x29bbdd[_0xc255('0x12')];var _0x16cde9=_0x29bbdd[_0xc255('0x13')];var _0xecf7d3=_0x2c9a79[_0xc255('0x14')]('-')[0x4];var _0x191a11=_0x2c9a79[_0xc255('0x14')]('-')[0x0];var _0x5bc9bf=encryptor[_0xc255('0x15')](_0x2138a9,util['format'](_0xc255('0x16'),_0xecf7d3,_0x2c9a79,_0x191a11));var _0x4cb88a=JSON[_0xc255('0x17')](_0x5bc9bf);_0x4cb88a[_0xc255('0x18')]=![];_0x4cb88a['uuid']=_0x2c9a79;_0x4cb88a[_0xc255('0x19')]=hardware[_0xc255('0x9')]();if(_0x16cde9){var _0x239c4f=encryptor['decryptString'](_0x16cde9);_0x4cb88a['gray']=_0x239c4f;_0x4cb88a[_0xc255('0x1a')]=moment(_0x239c4f)[_0xc255('0x1b')](0x7,_0xc255('0x1c'))['format']();_0x4cb88a[_0xc255('0x1d')]=_0x4cb88a[_0xc255('0xf')]!=_0x4cb88a[_0xc255('0x19')]?_0xc255('0x1e'):'disabled';}return _0x4cb88a;}catch(_0x14e2b2){breakingLicense[_0xc255('0xf')]=_0x29bbdd['data1'];breakingLicense['message']=_0x14e2b2['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4763fe,_0x5b691f){getLicense()[_0xc255('0xd')](function(_0x4bf7bc){return db[_0xc255('0x1f')]['findAll']({'attributes':[_0xc255('0x20'),[db[_0xc255('0x21')]['fn'](_0xc255('0x22'),db[_0xc255('0x21')][_0xc255('0x23')](_0xc255('0x20'))),_0xc255('0x24')]],'group':_0xc255('0x20'),'where':{'role':{'$or':[_0xc255('0x25'),_0xc255('0x26'),_0xc255('0x27')]}},'raw':!![]})[_0xc255('0xd')](function(_0x282c54){var _0x299cfb={'user':_0x4bf7bc[_0xc255('0x28')]||0x0,'telephone':_0x4bf7bc[_0xc255('0x29')]||0x0};_0x282c54[_0xc255('0x2a')](function(_0x7be7da){var _0x4b2af3=_0x7be7da[_0xc255('0x20')]===_0xc255('0x25')?_0xc255('0x26'):_0x7be7da[_0xc255('0x20')];_0x299cfb[_0x4b2af3]-=_0x7be7da['count'];if(_0x299cfb[_0x4b2af3]<0x0)_0x299cfb[_0x4b2af3]=0x0;});_0x4763fe(_0x299cfb);return;});})[_0xc255('0xe')](function(_0x511d05){_0x5b691f(_0x511d05);});});}function checkUserLimits(_0x53b95b){return new BPromise(function(_0x49d125,_0x341322){getLimits()[_0xc255('0xd')](function(_0x333cb2){var _0x63b3dc=_[_0xc255('0x2b')](_[_0xc255('0x2c')](_0x53b95b,_0xc255('0x20')),[_0xc255('0x25'),'user',_0xc255('0x27')]);var _0x339c21=(_0x63b3dc['admin']||0x0)+(_0x63b3dc['user']||0x0);var _0x4cfae1=_0x63b3dc[_0xc255('0x27')]||0x0;if(_0x339c21>_0x333cb2[_0xc255('0x26')])return _0x341322(_0xc255('0x2d'));if(_0x4cfae1>_0x333cb2['telephone'])return _0x341322(_0xc255('0x2e'));return _0x49d125();})[_0xc255('0xe')](function(_0x424856){_0x341322(_0x424856);});});}module[_0xc255('0x2f')]={'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 79aa836..2966db5 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 _0xdb28=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x4261a1,_0x433e02){var _0x350b6f=function(_0x2997a3){while(--_0x2997a3){_0x4261a1['push'](_0x4261a1['shift']());}};_0x350b6f(++_0x433e02);}(_0xdb28,0x106));var _0x8db2=function(_0x23bc66,_0x33eabf){_0x23bc66=_0x23bc66-0x0;var _0x5776b2=_0xdb28[_0x23bc66];return _0x5776b2;};'use strict';module[_0x8db2('0x0')]={'DOMAIN':_0x8db2('0x1'),'SESSION_SECRET':_0x8db2('0x2'),'GOOGLE_ID':_0x8db2('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x955f=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x4fdd28,_0xa33304){var _0x117f46=function(_0x956254){while(--_0x956254){_0x4fdd28['push'](_0x4fdd28['shift']());}};_0x117f46(++_0xa33304);}(_0x955f,0x1eb));var _0xf955=function(_0x378052,_0x546d35){_0x378052=_0x378052-0x0;var _0x1bd362=_0x955f[_0x378052];return _0x1bd362;};'use strict';module[_0xf955('0x0')]={'DOMAIN':_0xf955('0x1'),'SESSION_SECRET':_0xf955('0x2'),'GOOGLE_ID':_0xf955('0x3'),'GOOGLE_SECRET':_0xf955('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 990288a..409049d 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71bc=['%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','File','%s-%s','error','transports','info','Console','env','debugLevel','winston','util','path','/var','log','xcally','format'];(function(_0x50df09,_0x2f65a5){var _0x6afd7e=function(_0x9e66a7){while(--_0x9e66a7){_0x50df09['push'](_0x50df09['shift']());}};_0x6afd7e(++_0x2f65a5);}(_0x71bc,0x149));var _0xc71b=function(_0x204c60,_0x245942){_0x204c60=_0x204c60-0x0;var _0x922e35=_0x71bc[_0x204c60];return _0x922e35;};'use strict';var moment=require('moment');var winston=require(_0xc71b('0x0'));var util=require(_0xc71b('0x1'));var path=require(_0xc71b('0x2'));var debugLevel='INFO';function filename(_0x2df142,_0x4e93cc){return path['join'](_0xc71b('0x3'),_0xc71b('0x4'),_0xc71b('0x5'),util[_0xc71b('0x6')](_0xc71b('0x7'),_0x2df142,_0x4e93cc));}function formatter(_0x240846,_0x355c83){_0x355c83['message']=_0x355c83[_0xc71b('0x8')][_0xc71b('0x9')](/@@{/g,_0xc71b('0xa'))[_0xc71b('0x9')](/}@@/g,'}}}')[_0xc71b('0x9')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0xc71b('0xb'),moment()[_0xc71b('0x6')](_0xc71b('0xc')),_0x355c83['level'][_0xc71b('0xd')](),_0x240846,_0x355c83['message']);}module[_0xc71b('0xe')]=function(_0x2f4144){return new winston[(_0xc71b('0xf'))]({'transports':[new winston['transports'][(_0xc71b('0x10'))]({'name':util[_0xc71b('0x6')](_0xc71b('0x11'),_0x2f4144,_0xc71b('0x12')),'filename':filename(_0x2f4144,_0xc71b('0x12')),'level':_0xc71b('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x51e054){return formatter(_0x2f4144,_0x51e054);}}),new winston[(_0xc71b('0x13'))]['File']({'name':util[_0xc71b('0x6')](_0xc71b('0x11'),_0x2f4144,_0xc71b('0x14')),'filename':filename(_0x2f4144,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2561c3){return formatter(_0x2f4144,_0x2561c3);}}),new winston[(_0xc71b('0x13'))][(_0xc71b('0x15'))]({'level':process[_0xc71b('0x16')][_0xc71b('0x17')]||debugLevel,'json':![],'formatter':function(_0x25959a){return formatter(_0x2f4144,_0x25959a);}})]});}; \ No newline at end of file +var _0xa5e6=['log','xcally','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','transports','format','%s-%s','error','File','info','Console','env','debugLevel','moment','util','path','INFO','join','/var'];(function(_0x22664b,_0x32f617){var _0x191457=function(_0x33ab9d){while(--_0x33ab9d){_0x22664b['push'](_0x22664b['shift']());}};_0x191457(++_0x32f617);}(_0xa5e6,0x94));var _0x6a5e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa5e6[_0x21a9d9];return _0x46adce;};'use strict';var moment=require(_0x6a5e('0x0'));var winston=require('winston');var util=require(_0x6a5e('0x1'));var path=require(_0x6a5e('0x2'));var debugLevel=_0x6a5e('0x3');function filename(_0x9a5eda,_0x45fa3f){return path[_0x6a5e('0x4')](_0x6a5e('0x5'),_0x6a5e('0x6'),_0x6a5e('0x7'),util['format'](_0x6a5e('0x8'),_0x9a5eda,_0x45fa3f));}function formatter(_0x556707,_0x24e92b){_0x24e92b[_0x6a5e('0x9')]=_0x24e92b[_0x6a5e('0x9')][_0x6a5e('0xa')](/@@{/g,'{{{')[_0x6a5e('0xa')](/}@@/g,'}}}')[_0x6a5e('0xa')](/@{/g,'{{')[_0x6a5e('0xa')](/}@/g,'}}');return util['format'](_0x6a5e('0xb'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x24e92b['level'][_0x6a5e('0xc')](),_0x556707,_0x24e92b['message']);}module['exports']=function(_0x2bd78f){return new winston['Logger']({'transports':[new winston[(_0x6a5e('0xd'))]['File']({'name':util[_0x6a5e('0xe')](_0x6a5e('0xf'),_0x2bd78f,_0x6a5e('0x10')),'filename':filename(_0x2bd78f,_0x6a5e('0x10')),'level':_0x6a5e('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x43dd8e){return formatter(_0x2bd78f,_0x43dd8e);}}),new winston[(_0x6a5e('0xd'))][(_0x6a5e('0x11'))]({'name':util['format']('%s-%s',_0x2bd78f,_0x6a5e('0x12')),'filename':filename(_0x2bd78f,_0x6a5e('0x12')),'level':_0x6a5e('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3cb4f3){return formatter(_0x2bd78f,_0x3cb4f3);}}),new winston[(_0x6a5e('0xd'))][(_0x6a5e('0x13'))]({'level':process[_0x6a5e('0x14')][_0x6a5e('0x15')]||debugLevel,'json':![],'formatter':function(_0x39e9ba){return formatter(_0x2bd78f,_0x39e9ba);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index a1c5b02..0d19ef8 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 _0xd30f=['../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0x3e0cf7,_0x402382){var _0x5827ac=function(_0x47c8d8){while(--_0x47c8d8){_0x3e0cf7['push'](_0x3e0cf7['shift']());}};_0x5827ac(++_0x402382);}(_0xd30f,0x1f1));var _0xfd30=function(_0x40f727,_0x37c675){_0x40f727=_0x40f727-0x0;var _0xe80ae9=_0xd30f[_0x40f727];return _0xe80ae9;};'use strict';var path=require(_0xfd30('0x0'));var os=require('os');var config={'apps':[{'name':_0xfd30('0x1'),'script':path[_0xfd30('0x2')](__dirname,'../../services/express/index.js')},{'name':_0xfd30('0x3'),'script':path[_0xfd30('0x2')](__dirname,_0xfd30('0x4'))},{'name':_0xfd30('0x5'),'script':path[_0xfd30('0x2')](__dirname,_0xfd30('0x6'))},{'name':_0xfd30('0x7'),'script':path['join'](__dirname,_0xfd30('0x8'))},{'name':_0xfd30('0x9'),'script':path[_0xfd30('0x2')](__dirname,_0xfd30('0xa'))},{'name':'xdr','script':path[_0xfd30('0x2')](__dirname,_0xfd30('0xb'))}]};module[_0xfd30('0xc')]=config; \ No newline at end of file +var _0xb727=['email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','agi','../../services/agi/index.js'];(function(_0x393500,_0x1037af){var _0x120d3b=function(_0x17234e){while(--_0x17234e){_0x393500['push'](_0x393500['shift']());}};_0x120d3b(++_0x1037af);}(_0xb727,0x1e7));var _0x7b72=function(_0x56b6d3,_0x106b7b){_0x56b6d3=_0x56b6d3-0x0;var _0x31f13a=_0xb727[_0x56b6d3];return _0x31f13a;};'use strict';var path=require(_0x7b72('0x0'));var os=require('os');var config={'apps':[{'name':_0x7b72('0x1'),'script':path[_0x7b72('0x2')](__dirname,_0x7b72('0x3'))},{'name':_0x7b72('0x4'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x7b72('0x5'),'script':path[_0x7b72('0x2')](__dirname,_0x7b72('0x6'))},{'name':_0x7b72('0x7'),'script':path['join'](__dirname,_0x7b72('0x8'))},{'name':'routing','script':path[_0x7b72('0x2')](__dirname,_0x7b72('0x9'))},{'name':_0x7b72('0xa'),'script':path['join'](__dirname,_0x7b72('0xb'))}]};module[_0x7b72('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 42e71cb..cdf0dcd 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 _0x8ea3=['dump','saved','pm2','bluebird','connect','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x4d57f1,_0x19b772){var _0x5ba3d8=function(_0x2ca906){while(--_0x2ca906){_0x4d57f1['push'](_0x4d57f1['shift']());}};_0x5ba3d8(++_0x19b772);}(_0x8ea3,0x1c9));var _0x38ea=function(_0x2a60fc,_0x2b1cf4){_0x2a60fc=_0x2a60fc-0x0;var _0x4dd1a6=_0x8ea3[_0x2a60fc];return _0x4dd1a6;};'use strict';var pm2=require(_0x38ea('0x0'));var BPromise=require(_0x38ea('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x3410d4,_0x305aaa){return pm2[_0x38ea('0x2')](function(_0x7cf66d){if(_0x7cf66d){return _0x305aaa(_0x7cf66d);}return _0x3410d4('connected');});});};exports[_0x38ea('0x3')]=function(_0xb38a61){return connect()[_0x38ea('0x4')](function(){return new BPromise(function(_0x5849d2,_0x43058d){return pm2[_0x38ea('0x3')](_0xb38a61,function(_0x3a9c84,_0x113342){if(_0x3a9c84){return _0x43058d(_0x3a9c84);}pm2[_0x38ea('0x5')]();return _0x5849d2(_0x113342);});});});};exports[_0x38ea('0x6')]=function(_0x1eb33c){return connect()[_0x38ea('0x4')](function(){return new BPromise(function(_0x21b8f2,_0x2a9cbf){return pm2[_0x38ea('0x6')](_0x1eb33c,function(_0x16b8e6,_0x2cf290){if(_0x16b8e6){return _0x2a9cbf(_0x16b8e6);}pm2['disconnect']();return _0x21b8f2(_0x2cf290);});});});};exports[_0x38ea('0x7')]=function(_0x4ea3c3){return connect()[_0x38ea('0x4')](function(){return new BPromise(function(_0x38a874,_0x2f70bf){return pm2[_0x38ea('0x7')](_0x4ea3c3,function(_0x520de2,_0x2aeede){if(_0x520de2){return _0x2f70bf(_0x520de2);}pm2[_0x38ea('0x5')]();return _0x38a874(_0x2aeede);});});});};exports[_0x38ea('0x8')]=function(){return connect()[_0x38ea('0x4')](function(){return new BPromise(function(_0x5360c4,_0x21603d){return pm2[_0x38ea('0x8')](function(_0x50f22b,_0x26648b){if(_0x50f22b){return _0x21603d(_0x50f22b);}pm2[_0x38ea('0x5')]();return _0x5360c4(_0x26648b);});});});};exports[_0x38ea('0x9')]=function(_0x50dfda){return connect()['then'](function(){return new BPromise(function(_0x3f45c5,_0x49fe89){return pm2['describe'](_0x50dfda,function(_0x461dc0,_0xe04d21){if(_0x461dc0){return _0x49fe89(_0x461dc0);}pm2[_0x38ea('0x5')]();return _0x3f45c5(_0xe04d21);});});});};exports[_0x38ea('0xa')]=function(_0x182ef4){return connect()[_0x38ea('0x4')](function(){return new BPromise(function(_0x111be2,_0x347d5){return pm2[_0x38ea('0xa')](_0x182ef4,function(_0x4e1ec8,_0x13dd04){if(_0x4e1ec8){return _0x347d5(_0x4e1ec8);}pm2['disconnect']();return _0x111be2(_0x13dd04);});});});};exports[_0x38ea('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x349bac,_0x4d3343){return pm2[_0x38ea('0xb')](function(_0x5d83dc){if(_0x5d83dc){return _0x4d3343(_0x5d83dc);}return _0x349bac(_0x38ea('0xc'));});});});}; \ No newline at end of file +var _0xbfd5=['then','disconnect','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start'];(function(_0x36565e,_0x1ea085){var _0x6c0b44=function(_0x36c897){while(--_0x36c897){_0x36565e['push'](_0x36565e['shift']());}};_0x6c0b44(++_0x1ea085);}(_0xbfd5,0x10b));var _0x5bfd=function(_0x42cd69,_0x73ce5f){_0x42cd69=_0x42cd69-0x0;var _0x4cc0d7=_0xbfd5[_0x42cd69];return _0x4cc0d7;};'use strict';var pm2=require(_0x5bfd('0x0'));var BPromise=require(_0x5bfd('0x1'));var config=require(_0x5bfd('0x2'));function connect(){return new BPromise(function(_0x2b6b5f,_0x258696){return pm2[_0x5bfd('0x3')](function(_0x1e3e31){if(_0x1e3e31){return _0x258696(_0x1e3e31);}return _0x2b6b5f(_0x5bfd('0x4'));});});};exports[_0x5bfd('0x5')]=function(_0x9f7bc0){return connect()[_0x5bfd('0x6')](function(){return new BPromise(function(_0x5db566,_0xfec157){return pm2[_0x5bfd('0x5')](_0x9f7bc0,function(_0x501b36,_0x490938){if(_0x501b36){return _0xfec157(_0x501b36);}pm2[_0x5bfd('0x7')]();return _0x5db566(_0x490938);});});});};exports['stop']=function(_0x241629){return connect()[_0x5bfd('0x6')](function(){return new BPromise(function(_0x3330cb,_0x1a43fc){return pm2['stop'](_0x241629,function(_0xde8949,_0x5db15c){if(_0xde8949){return _0x1a43fc(_0xde8949);}pm2['disconnect']();return _0x3330cb(_0x5db15c);});});});};exports['restart']=function(_0x1f7bf0){return connect()[_0x5bfd('0x6')](function(){return new BPromise(function(_0x43e695,_0x521a91){return pm2['restart'](_0x1f7bf0,function(_0x5b316c,_0x40c90d){if(_0x5b316c){return _0x521a91(_0x5b316c);}pm2[_0x5bfd('0x7')]();return _0x43e695(_0x40c90d);});});});};exports[_0x5bfd('0x8')]=function(){return connect()[_0x5bfd('0x6')](function(){return new BPromise(function(_0x10e4b8,_0x2e6dda){return pm2[_0x5bfd('0x8')](function(_0x26a094,_0x177907){if(_0x26a094){return _0x2e6dda(_0x26a094);}pm2[_0x5bfd('0x7')]();return _0x10e4b8(_0x177907);});});});};exports[_0x5bfd('0x9')]=function(_0xfc485b){return connect()[_0x5bfd('0x6')](function(){return new BPromise(function(_0x29a846,_0x1667e3){return pm2[_0x5bfd('0x9')](_0xfc485b,function(_0x308d4b,_0x1f083b){if(_0x308d4b){return _0x1667e3(_0x308d4b);}pm2[_0x5bfd('0x7')]();return _0x29a846(_0x1f083b);});});});};exports[_0x5bfd('0xa')]=function(_0xdf534){return connect()[_0x5bfd('0x6')](function(){return new BPromise(function(_0x42a084,_0x5144fa){return pm2[_0x5bfd('0xa')](_0xdf534,function(_0x26b0d5,_0x4c6c7e){if(_0x26b0d5){return _0x5144fa(_0x26b0d5);}pm2[_0x5bfd('0x7')]();return _0x42a084(_0x4c6c7e);});});});};exports[_0x5bfd('0xb')]=function(){return connect()[_0x5bfd('0x6')](function(){return new BPromise(function(_0x3d58ac,_0x1817d0){return pm2['dump'](function(_0x1ed08c){if(_0x1ed08c){return _0x1817d0(_0x1ed08c);}return _0x3d58ac(_0x5bfd('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index e66c0a2..452c9fa 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 _0xbab3=['error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','ioredis','../../config/environment','../logger','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','lastMsgAt','subtract','minutes','then','map','info','join','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','chatInteraction:update'];(function(_0x1102cd,_0x3ab6ef){var _0xe4941=function(_0x40cb55){while(--_0x40cb55){_0x1102cd['push'](_0x1102cd['shift']());}};_0xe4941(++_0x3ab6ef);}(_0xbab3,0x1a7));var _0x3bab=function(_0x295fe9,_0x345828){_0x295fe9=_0x295fe9-0x0;var _0x3b80df=_0xbab3[_0x295fe9];return _0x3b80df;};'use strict';var _=require(_0x3bab('0x0'));var moment=require('moment');var Redis=require(_0x3bab('0x1'));var util=require('util');var config=require(_0x3bab('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x3bab('0x3'))('schedule');config[_0x3bab('0x4')]=_['defaults'](config[_0x3bab('0x4')],{'host':_0x3bab('0x5'),'port':0x18eb});var io=require(_0x3bab('0x6'))(new Redis(config[_0x3bab('0x4')]));function closeInteractions(){var _0x5b3077=0x0;var _0x4b0b56=[];return db[_0x3bab('0x7')][_0x3bab('0x8')]({'raw':!![],'attributes':['id',_0x3bab('0x9')],'where':{'id':0x1}})['then'](function(_0x155dce){_0x5b3077=_0x155dce[_0x3bab('0x9')];if(_0x5b3077){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x3bab('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3bab('0xb')](_0x155dce[_0x3bab('0x9')],_0x3bab('0xc'))}}});}else{return[];}})[_0x3bab('0xd')](function(_0x3e3ba1){if(_0x3e3ba1&&_0x3e3ba1['length']){_0x4b0b56=_[_0x3bab('0xe')](_0x3e3ba1||[],'id');logger[_0x3bab('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x4b0b56[_0x3bab('0x10')]());return db[_0x3bab('0x11')][_0x3bab('0x12')]({'closeReason':_0x3bab('0x13'),'disposition':_0x3bab('0x14'),'closed':!![],'closedAt':moment()[_0x3bab('0x15')](_0x3bab('0x16'))},{'where':{'id':_0x4b0b56}});}})[_0x3bab('0xd')](function(){if(_0x4b0b56&&_0x4b0b56[_0x3bab('0x17')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4b0b56[_0x3bab('0x10')]());for(var _0x2e9920=0x0;_0x2e9920<_0x4b0b56[_0x3bab('0x17')];_0x2e9920++){io['emit'](_0x3bab('0x18'),{'id':_0x4b0b56[_0x2e9920],'closed':!![]});}}})['catch'](function(_0x1aefcb){logger[_0x3bab('0x19')](_0x3bab('0x1a'),_0x1aefcb?util['inspect'](_0x1aefcb,{'showHidden':![],'depth':null}):'');});}exports[_0x3bab('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6d17=['system','format','YYYY-MM-DD\x20HH:mm:ss','emit','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update'];(function(_0x1d5746,_0x4166c9){var _0x28ea74=function(_0x1dbb65){while(--_0x1dbb65){_0x1d5746['push'](_0x1d5746['shift']());}};_0x28ea74(++_0x4166c9);}(_0x6d17,0x1e4));var _0x76d1=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0x6d17[_0x1f71d8];return _0x10b045;};'use strict';var _=require(_0x76d1('0x0'));var moment=require(_0x76d1('0x1'));var Redis=require(_0x76d1('0x2'));var util=require(_0x76d1('0x3'));var config=require(_0x76d1('0x4'));var db=require(_0x76d1('0x5'))['db'];var logger=require(_0x76d1('0x6'))('schedule');config['redis']=_['defaults'](config[_0x76d1('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x76d1('0x8'))(new Redis(config[_0x76d1('0x7')]));function closeInteractions(){var _0x32012b=0x0;var _0x36af31=[];return db[_0x76d1('0x9')][_0x76d1('0xa')]({'raw':!![],'attributes':['id',_0x76d1('0xb')],'where':{'id':0x1}})[_0x76d1('0xc')](function(_0x47921a){_0x32012b=_0x47921a['chatTimeout'];if(_0x32012b){return db[_0x76d1('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x76d1('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x47921a[_0x76d1('0xb')],'minutes')}}});}else{return[];}})[_0x76d1('0xc')](function(_0x21756e){if(_0x21756e&&_0x21756e[_0x76d1('0xf')]){_0x36af31=_[_0x76d1('0x10')](_0x21756e||[],'id');logger[_0x76d1('0x11')](_0x76d1('0x12'),_0x36af31['join']());return db[_0x76d1('0xd')][_0x76d1('0x13')]({'closeReason':_0x76d1('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x76d1('0x15')](_0x76d1('0x16'))},{'where':{'id':_0x36af31}});}})[_0x76d1('0xc')](function(){if(_0x36af31&&_0x36af31[_0x76d1('0xf')]){logger[_0x76d1('0x11')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x36af31['join']());for(var _0x288031=0x0;_0x288031<_0x36af31[_0x76d1('0xf')];_0x288031++){io[_0x76d1('0x17')]('chatInteraction:update',{'id':_0x36af31[_0x288031],'closed':!![]});}}})['catch'](function(_0xe64138){logger[_0x76d1('0x18')](_0x76d1('0x19'),_0xe64138?util[_0x76d1('0x1a')](_0xe64138,{'showHidden':![],'depth':null}):'');});}exports[_0x76d1('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 6305e4b..172d6ac 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 _0xd36a=['Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','savename','basename','extname','zip','join','status','Sent','message','attachments','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','length','exists','stop','delete\x20cron','toRun','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','update','update\x20cron','deleteJob','run','util','lodash','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','email'];(function(_0x18ff0c,_0x129418){var _0x53dcbf=function(_0x47b2db){while(--_0x47b2db){_0x18ff0c['push'](_0x18ff0c['shift']());}};_0x53dcbf(++_0x129418);}(_0xd36a,0x141));var _0xad36=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd36a[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var util=require(_0xad36('0x0'));var path=require('path');var _=require(_0xad36('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xad36('0x2'));var logger=require(_0xad36('0x3'))(_0xad36('0x4'));var db=require(_0xad36('0x5'))['db'];var analyticCustomReportController=require(_0xad36('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xad36('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x511864,_0x303eed){return function(){logger[_0xad36('0x8')](_0xad36('0x9'),_0x511864['email']);var _0x5f1cb8=!![];var _0x5f5a12={'tls':{'rejectUnauthorized':![]}};if(_0x511864[_0xad36('0xa')][_0xad36('0xb')][_0xad36('0xc')]){_0x5f5a12['service']=_0x511864[_0xad36('0xa')][_0xad36('0xb')][_0xad36('0xc')];}else{_0x5f5a12[_0xad36('0xd')]=_0x511864[_0xad36('0xa')]['Smtp'][_0xad36('0xd')];_0x5f5a12['port']=_0x511864['MailAccount'][_0xad36('0xb')][_0xad36('0xe')];_0x5f5a12[_0xad36('0xf')]=_0x511864[_0xad36('0xa')][_0xad36('0xb')][_0xad36('0xf')];}if(_0x511864[_0xad36('0xa')][_0xad36('0xb')][_0xad36('0x10')]){_0x5f5a12[_0xad36('0x11')]={'user':_0x511864['MailAccount'][_0xad36('0xb')][_0xad36('0x12')],'pass':_0x511864['MailAccount'][_0xad36('0xb')][_0xad36('0x13')]};}var _0x1028ec={'account':_0x5f5a12,'message':{'from':util[_0xad36('0x14')](_0xad36('0x15'),_0x511864[_0xad36('0xa')]['name'],_0x511864['MailAccount'][_0xad36('0x16')]||_0x511864['MailAccount']['Smtp'][_0xad36('0x12')]),'to':_0x511864[_0xad36('0x16')],'cc':_0x511864['cc'],'bcc':_0x511864['bcc'],'subject':util[_0xad36('0x14')](_0xad36('0x17'),_0x303eed[_0xad36('0x18')],_0x511864[_0xad36('0x19')],_0x511864[_0xad36('0x1a')])}};var _0x2ca788=path['join'](__dirname,'../../files/reports');var _0x3b0e99=_0x303eed[_0xad36('0x1b')];var _0x16bc50=util[_0xad36('0x14')]('%s.%s',path[_0xad36('0x1c')](_0x303eed['savename'],path[_0xad36('0x1d')](_0x303eed[_0xad36('0x1b')])),_0xad36('0x1e'));var _0x1243f3=path[_0xad36('0x1f')](_0x2ca788,_0x3b0e99);var _0x24e143=path[_0xad36('0x1f')](_0x2ca788,_0x16bc50);if(fs['existsSync'](_0x1243f3)){_0x303eed[_0xad36('0x20')]=_0xad36('0x21');_0x1028ec[_0xad36('0x22')][_0xad36('0x23')]=[{'filename':_0x3b0e99,'path':_0x1243f3}];_0x1028ec[_0xad36('0x22')]['text']=util[_0xad36('0x14')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xad36('0x24')](_0x303eed,null,0x2));}else if(fs['existsSync'](_0x24e143)){_0x303eed['status']=_0xad36('0x21');_0x1028ec[_0xad36('0x22')][_0xad36('0x23')]=[{'filename':_0x16bc50,'path':_0x24e143}];}else{_0x1028ec[_0xad36('0x22')]['text']=_0xad36('0x25');if(!_0x511864[_0xad36('0x26')]){_0x5f1cb8=![];logger[_0xad36('0x8')](_0xad36('0x27'));}}if(_0x5f1cb8){return client[_0xad36('0x28')](_0xad36('0x29'),_0x1028ec)[_0xad36('0x2a')](function(_0x6730d2){if(_0x6730d2['error']){return logger[_0xad36('0x2b')](_0xad36('0x2c'),JSON[_0xad36('0x24')](_0x6730d2));}return logger['info']('email\x20sent');})[_0xad36('0x2d')](function(_0x1cf112){return logger[_0xad36('0x2b')](_0xad36('0x2c'),JSON[_0xad36('0x24')](_0x1cf112));});}};}function handleError(){return function(_0x493640){return logger[_0xad36('0x2b')](JSON[_0xad36('0x24')](_0x493640));};}function handleResult(_0x234960){return function(_0x49194c){logger[_0xad36('0x8')](_0xad36('0x2e'),JSON[_0xad36('0x24')](_0x49194c));if(_0x234960[_0xad36('0xa')]&&_0x234960[_0xad36('0xa')]['Smtp']&&!_[_0xad36('0x2f')](_0x234960[_0xad36('0x16')])){setTimeout(handleSendEmail(_0x234960,_0x49194c),0x3c*0x3e8);}};}function handleJob(_0x1ae3fa){return function(){try{if(_[_0xad36('0x2f')](_0x1ae3fa[_0xad36('0x19')])){return logger[_0xad36('0x8')](_0xad36('0x30'));}if(_[_0xad36('0x2f')](_0x1ae3fa[_0xad36('0x1a')])){return logger[_0xad36('0x8')]('subtractUnit\x20null\x20or\x20undefined');}var _0x5bb5f5={'startDate':moment()[_0xad36('0x31')](_0x1ae3fa[_0xad36('0x19')],_0x1ae3fa['subtractUnit'])[_0xad36('0x14')](_0xad36('0x32')),'endDate':moment()[_0xad36('0x14')](_0xad36('0x32')),'type':_0xad36('0x33'),'output':_0x1ae3fa[_0xad36('0x34')],'name':_0x1ae3fa[_0xad36('0x18')]};if(!_[_0xad36('0x2f')](_0x1ae3fa[_0xad36('0x35')])){logger[_0xad36('0x8')](_0xad36('0x36'),_0x1ae3fa['DefaultReportId']);return analyticDefaultReportController[_0xad36('0x37')]({'id':_0x1ae3fa['DefaultReportId']},_0x5bb5f5)[_0xad36('0x2a')](handleResult(_0x1ae3fa))[_0xad36('0x2d')](handleError());}if(!_[_0xad36('0x2f')](_0x1ae3fa[_0xad36('0x38')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x1ae3fa[_0xad36('0x38')]);return analyticCustomReportController[_0xad36('0x37')]({'id':_0x1ae3fa['CustomReportId']},_0x5bb5f5)[_0xad36('0x2a')](handleResult(_0x1ae3fa))[_0xad36('0x2d')](handleError());}}catch(_0x47ff94){logger[_0xad36('0x2b')](JSON['stringify'](_0x47ff94));}return logger['info'](_0xad36('0x39'));};}function getJobs(_0x507444){var _0x423d37={};if(_0x507444){_0x423d37['id']=_0x507444;}return db[_0xad36('0x3a')][_0xad36('0x3b')]({'where':_0x423d37,'include':[{'model':db[_0xad36('0xa')],'attributes':['id',_0xad36('0x18'),_0xad36('0x16')],'include':[{'model':db[_0xad36('0x3c')],'as':'Smtp'}]}]})['then'](function(_0x361eff){var _0x5849b4=_[_0xad36('0x3d')](manager[_0xad36('0x3e')]);var _0x44ef31=_[_0xad36('0x3f')](_0x361eff,function(_0x502093){return _0x502093['id']['toString']();});var _0x59a797=_[_0xad36('0x40')](_0x361eff,function(_0x419720){return _0x419720['id'][_0xad36('0x41')]();});var _0x210b9d=_0x507444?_0x44ef31:_[_0xad36('0x42')](_0x44ef31,_0x5849b4);var _0x307243=_['intersection'](_0x44ef31,_0x5849b4);var _0x5795c3=_[_0xad36('0x42')](_0x5849b4,_0x44ef31);var _0x4476da;var _0x383115;for(_0x4476da=0x0;_0x4476da<_0x5795c3[_0xad36('0x43')]&&!_0x507444;_0x4476da+=0x1){_0x383115=_0x5795c3[_0x4476da]['toString']();if(manager[_0xad36('0x44')](_0x383115)){manager[_0xad36('0x45')](_0x383115);manager['deleteJob'](_0x383115);logger[_0xad36('0x8')](_0xad36('0x46'),_0x383115);}}logger[_0xad36('0x8')](_0xad36('0x47'),JSON['stringify'](_0x210b9d));for(_0x4476da=0x0;_0x4476da<_0x210b9d['length'];_0x4476da+=0x1){_0x383115=_0x210b9d[_0x4476da]['toString']();logger[_0xad36('0x8')]('index',_0x383115);if(_0x507444){logger[_0xad36('0x8')]('my\x20id',_0x507444);logger[_0xad36('0x8')](JSON[_0xad36('0x24')](_0x59a797[_0x383115]));BPromise[_0xad36('0x48')]()[_0xad36('0x2a')](handleJob(_0x59a797[_0x383115]));logger[_0xad36('0x8')](_0xad36('0x49'),_0x59a797[_0x383115][_0xad36('0x18')],_0x59a797[_0x383115][_0xad36('0x4a')]);}else if(_0x59a797[_0x383115][_0xad36('0x4a')]&&_0x59a797[_0x383115][_0xad36('0x4b')]&&moment()[_0xad36('0x4c')](_0x59a797[_0x383115][_0xad36('0x4d')],_0x59a797[_0x383115][_0xad36('0x4e')])){manager[_0xad36('0x4f')](_0x383115,_0x59a797[_0x383115][_0xad36('0x4a')],handleJob(_0x59a797[_0x383115]));manager['start'](_0x383115);logger['info'](_0xad36('0x50'),_0x59a797[_0x383115][_0xad36('0x18')],_0x59a797[_0x383115][_0xad36('0x4a')]);}else if(manager[_0xad36('0x44')](_0x383115)){manager['stop'](_0x383115);manager['deleteJob'](_0x383115);logger[_0xad36('0x8')](_0xad36('0x51'),_0x59a797[_0x383115][_0xad36('0x18')],_0x59a797[_0x383115]['cron']);}}for(_0x4476da=0x0,_0x383115;_0x4476da<_0x307243['length']&&!_0x507444;_0x4476da+=0x1){_0x383115=_0x307243[_0x4476da][_0xad36('0x41')]();if(manager[_0xad36('0x44')](_0x383115)){if(_0x59a797[_0x383115][_0xad36('0x4a')]&&_0x59a797[_0x383115][_0xad36('0x4b')]&&moment()[_0xad36('0x4c')](_0x59a797[_0x383115]['startAt'],_0x59a797[_0x383115][_0xad36('0x4e')])){manager[_0xad36('0x52')](_0x383115,_0x59a797[_0x383115][_0xad36('0x4a')],handleJob(_0x59a797[_0x383115]));logger[_0xad36('0x8')](_0xad36('0x53'),_0x59a797[_0x383115][_0xad36('0x18')],_0x59a797[_0x383115]['cron']);}else{manager['stop'](_0x383115);manager[_0xad36('0x54')](_0x383115);logger[_0xad36('0x8')](_0xad36('0x51'),_0x59a797[_0x383115][_0xad36('0x18')],_0x59a797[_0x383115][_0xad36('0x4a')]);}}}})[_0xad36('0x2d')](function(_0x4486cd){logger[_0xad36('0x2b')](JSON[_0xad36('0x24')](_0x4486cd));});}exports[_0xad36('0x55')]=function(_0x50195e){return getJobs(_0x50195e);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x4336=['deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','active','isBetween','startAt','endAt','add','cron','exists','stop\x20cron','update','update\x20cron','run','start','util','lodash','moment','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','Smtp','service','host','MailAccount','port','secure','authentication','auth','user','pass','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','../../files/reports','%s.%s','basename','savename','join','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','text','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','length','stop'];(function(_0x189b1f,_0x189f27){var _0x52c66f=function(_0x48c008){while(--_0x48c008){_0x189b1f['push'](_0x189b1f['shift']());}};_0x52c66f(++_0x189f27);}(_0x4336,0x1c5));var _0x6433=function(_0x3625e2,_0x4efb25){_0x3625e2=_0x3625e2-0x0;var _0x228f96=_0x4336[_0x3625e2];return _0x228f96;};'use strict';var fs=require('fs');var util=require(_0x6433('0x0'));var path=require('path');var _=require(_0x6433('0x1'));var moment=require(_0x6433('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x6433('0x3'))(_0x6433('0x4'));var db=require(_0x6433('0x5'))['db'];var analyticCustomReportController=require(_0x6433('0x6'));var analyticDefaultReportController=require(_0x6433('0x7'));var client=jayson[_0x6433('0x8')][_0x6433('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2de107,_0x320e47){return function(){logger[_0x6433('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x2de107[_0x6433('0xb')]);var _0x28bda3=!![];var _0x498530={'tls':{'rejectUnauthorized':![]}};if(_0x2de107['MailAccount'][_0x6433('0xc')][_0x6433('0xd')]){_0x498530[_0x6433('0xd')]=_0x2de107['MailAccount']['Smtp'][_0x6433('0xd')];}else{_0x498530[_0x6433('0xe')]=_0x2de107[_0x6433('0xf')]['Smtp'][_0x6433('0xe')];_0x498530[_0x6433('0x10')]=_0x2de107[_0x6433('0xf')][_0x6433('0xc')][_0x6433('0x10')];_0x498530[_0x6433('0x11')]=_0x2de107['MailAccount'][_0x6433('0xc')][_0x6433('0x11')];}if(_0x2de107[_0x6433('0xf')][_0x6433('0xc')][_0x6433('0x12')]){_0x498530[_0x6433('0x13')]={'user':_0x2de107[_0x6433('0xf')][_0x6433('0xc')][_0x6433('0x14')],'pass':_0x2de107['MailAccount'][_0x6433('0xc')][_0x6433('0x15')]};}var _0x10ffb8={'account':_0x498530,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2de107[_0x6433('0xf')]['name'],_0x2de107[_0x6433('0xf')]['email']||_0x2de107[_0x6433('0xf')][_0x6433('0xc')]['user']),'to':_0x2de107[_0x6433('0xb')],'cc':_0x2de107['cc'],'bcc':_0x2de107['bcc'],'subject':util[_0x6433('0x16')](_0x6433('0x17'),_0x320e47[_0x6433('0x18')],_0x2de107[_0x6433('0x19')],_0x2de107[_0x6433('0x1a')])}};var _0x25ff48=path['join'](__dirname,_0x6433('0x1b'));var _0x579e82=_0x320e47['savename'];var _0x1370a9=util[_0x6433('0x16')](_0x6433('0x1c'),path[_0x6433('0x1d')](_0x320e47[_0x6433('0x1e')],path['extname'](_0x320e47[_0x6433('0x1e')])),'zip');var _0x39e5ec=path[_0x6433('0x1f')](_0x25ff48,_0x579e82);var _0x368409=path[_0x6433('0x1f')](_0x25ff48,_0x1370a9);if(fs[_0x6433('0x20')](_0x39e5ec)){_0x320e47[_0x6433('0x21')]=_0x6433('0x22');_0x10ffb8[_0x6433('0x23')][_0x6433('0x24')]=[{'filename':_0x579e82,'path':_0x39e5ec}];_0x10ffb8['message']['text']=util[_0x6433('0x16')](_0x6433('0x25'),JSON['stringify'](_0x320e47,null,0x2));}else if(fs['existsSync'](_0x368409)){_0x320e47[_0x6433('0x21')]=_0x6433('0x22');_0x10ffb8[_0x6433('0x23')][_0x6433('0x24')]=[{'filename':_0x1370a9,'path':_0x368409}];}else{_0x10ffb8['message'][_0x6433('0x26')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2de107['sendIfEmpty']){_0x28bda3=![];logger[_0x6433('0xa')](_0x6433('0x27'));}}if(_0x28bda3){return client['request'](_0x6433('0x28'),_0x10ffb8)[_0x6433('0x29')](function(_0x142e9e){if(_0x142e9e[_0x6433('0x2a')]){return logger[_0x6433('0x2a')](_0x6433('0x2b'),JSON[_0x6433('0x2c')](_0x142e9e));}return logger[_0x6433('0xa')](_0x6433('0x2d'));})[_0x6433('0x2e')](function(_0x32ea8b){return logger[_0x6433('0x2a')]('error\x20mail',JSON[_0x6433('0x2c')](_0x32ea8b));});}};}function handleError(){return function(_0x474249){return logger['error'](JSON['stringify'](_0x474249));};}function handleResult(_0xf794c5){return function(_0x38328a){logger[_0x6433('0xa')](_0x6433('0x2f'),JSON[_0x6433('0x2c')](_0x38328a));if(_0xf794c5[_0x6433('0xf')]&&_0xf794c5[_0x6433('0xf')][_0x6433('0xc')]&&!_[_0x6433('0x30')](_0xf794c5[_0x6433('0xb')])){setTimeout(handleSendEmail(_0xf794c5,_0x38328a),0x3c*0x3e8);}};}function handleJob(_0x2c7ebf){return function(){try{if(_[_0x6433('0x30')](_0x2c7ebf[_0x6433('0x19')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x6433('0x30')](_0x2c7ebf[_0x6433('0x1a')])){return logger[_0x6433('0xa')](_0x6433('0x31'));}var _0x1bb58e={'startDate':moment()[_0x6433('0x32')](_0x2c7ebf[_0x6433('0x19')],_0x2c7ebf[_0x6433('0x1a')])[_0x6433('0x16')](_0x6433('0x33')),'endDate':moment()[_0x6433('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x2c7ebf['output'],'name':_0x2c7ebf['name']};if(!_[_0x6433('0x30')](_0x2c7ebf[_0x6433('0x34')])){logger[_0x6433('0xa')](_0x6433('0x35'),_0x2c7ebf[_0x6433('0x34')]);return analyticDefaultReportController[_0x6433('0x36')]({'id':_0x2c7ebf[_0x6433('0x34')]},_0x1bb58e)['then'](handleResult(_0x2c7ebf))['catch'](handleError());}if(!_[_0x6433('0x30')](_0x2c7ebf[_0x6433('0x37')])){logger[_0x6433('0xa')](_0x6433('0x38'),_0x2c7ebf[_0x6433('0x37')]);return analyticCustomReportController[_0x6433('0x36')]({'id':_0x2c7ebf[_0x6433('0x37')]},_0x1bb58e)['then'](handleResult(_0x2c7ebf))[_0x6433('0x2e')](handleError());}}catch(_0x29fb73){logger[_0x6433('0x2a')](JSON[_0x6433('0x2c')](_0x29fb73));}return logger[_0x6433('0xa')](_0x6433('0x39'));};}function getJobs(_0x572881){var _0x597d6e={};if(_0x572881){_0x597d6e['id']=_0x572881;}return db[_0x6433('0x3a')][_0x6433('0x3b')]({'where':_0x597d6e,'include':[{'model':db[_0x6433('0xf')],'attributes':['id',_0x6433('0x18'),_0x6433('0xb')],'include':[{'model':db[_0x6433('0x3c')],'as':'Smtp'}]}]})[_0x6433('0x29')](function(_0x2bc656){var _0x4cdcc6=_[_0x6433('0x3d')](manager[_0x6433('0x3e')]);var _0x2029b4=_[_0x6433('0x3f')](_0x2bc656,function(_0x2245b3){return _0x2245b3['id']['toString']();});var _0x1c1db6=_[_0x6433('0x40')](_0x2bc656,function(_0x228971){return _0x228971['id'][_0x6433('0x41')]();});var _0x22628f=_0x572881?_0x2029b4:_['difference'](_0x2029b4,_0x4cdcc6);var _0x1f8e5b=_['intersection'](_0x2029b4,_0x4cdcc6);var _0x3cc79c=_[_0x6433('0x42')](_0x4cdcc6,_0x2029b4);var _0x5cc2df;var _0x1817b0;for(_0x5cc2df=0x0;_0x5cc2df<_0x3cc79c[_0x6433('0x43')]&&!_0x572881;_0x5cc2df+=0x1){_0x1817b0=_0x3cc79c[_0x5cc2df][_0x6433('0x41')]();if(manager['exists'](_0x1817b0)){manager[_0x6433('0x44')](_0x1817b0);manager[_0x6433('0x45')](_0x1817b0);logger[_0x6433('0xa')](_0x6433('0x46'),_0x1817b0);}}logger[_0x6433('0xa')](_0x6433('0x47'),JSON[_0x6433('0x2c')](_0x22628f));for(_0x5cc2df=0x0;_0x5cc2df<_0x22628f[_0x6433('0x43')];_0x5cc2df+=0x1){_0x1817b0=_0x22628f[_0x5cc2df]['toString']();logger[_0x6433('0xa')](_0x6433('0x48'),_0x1817b0);if(_0x572881){logger['info'](_0x6433('0x49'),_0x572881);logger[_0x6433('0xa')](JSON['stringify'](_0x1c1db6[_0x1817b0]));BPromise['resolve']()[_0x6433('0x29')](handleJob(_0x1c1db6[_0x1817b0]));logger['info'](_0x6433('0x4a'),_0x1c1db6[_0x1817b0][_0x6433('0x18')],_0x1c1db6[_0x1817b0]['cron']);}else if(_0x1c1db6[_0x1817b0]['cron']&&_0x1c1db6[_0x1817b0][_0x6433('0x4b')]&&moment()[_0x6433('0x4c')](_0x1c1db6[_0x1817b0][_0x6433('0x4d')],_0x1c1db6[_0x1817b0][_0x6433('0x4e')])){manager[_0x6433('0x4f')](_0x1817b0,_0x1c1db6[_0x1817b0][_0x6433('0x50')],handleJob(_0x1c1db6[_0x1817b0]));manager['start'](_0x1817b0);logger['info']('add\x20cron',_0x1c1db6[_0x1817b0][_0x6433('0x18')],_0x1c1db6[_0x1817b0][_0x6433('0x50')]);}else if(manager[_0x6433('0x51')](_0x1817b0)){manager[_0x6433('0x44')](_0x1817b0);manager[_0x6433('0x45')](_0x1817b0);logger[_0x6433('0xa')](_0x6433('0x52'),_0x1c1db6[_0x1817b0][_0x6433('0x18')],_0x1c1db6[_0x1817b0][_0x6433('0x50')]);}}for(_0x5cc2df=0x0,_0x1817b0;_0x5cc2df<_0x1f8e5b[_0x6433('0x43')]&&!_0x572881;_0x5cc2df+=0x1){_0x1817b0=_0x1f8e5b[_0x5cc2df]['toString']();if(manager[_0x6433('0x51')](_0x1817b0)){if(_0x1c1db6[_0x1817b0][_0x6433('0x50')]&&_0x1c1db6[_0x1817b0][_0x6433('0x4b')]&&moment()['isBetween'](_0x1c1db6[_0x1817b0][_0x6433('0x4d')],_0x1c1db6[_0x1817b0][_0x6433('0x4e')])){manager[_0x6433('0x53')](_0x1817b0,_0x1c1db6[_0x1817b0][_0x6433('0x50')],handleJob(_0x1c1db6[_0x1817b0]));logger[_0x6433('0xa')](_0x6433('0x54'),_0x1c1db6[_0x1817b0]['name'],_0x1c1db6[_0x1817b0][_0x6433('0x50')]);}else{manager[_0x6433('0x44')](_0x1817b0);manager[_0x6433('0x45')](_0x1817b0);logger[_0x6433('0xa')](_0x6433('0x52'),_0x1c1db6[_0x1817b0]['name'],_0x1c1db6[_0x1817b0][_0x6433('0x50')]);}}}})[_0x6433('0x2e')](function(_0x458dec){logger[_0x6433('0x2a')](JSON['stringify'](_0x458dec));});}exports[_0x6433('0x55')]=function(_0x171941){return getJobs(_0x171941);};exports[_0x6433('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index db3924d..7e6f16a 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 _0xeffd=['data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Positive','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','inspect','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','info','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','findOne'];(function(_0x4b7f8d,_0x1ed50d){var _0x257c1f=function(_0x16fff6){while(--_0x16fff6){_0x4b7f8d['push'](_0x4b7f8d['shift']());}};_0x257c1f(++_0x1ed50d);}(_0xeffd,0x6b));var _0xdeff=function(_0x45931d,_0x216fc2){_0x45931d=_0x45931d-0x0;var _0xd2f7f4=_0xeffd[_0x45931d];return _0xd2f7f4;};var _=require(_0xdeff('0x0'));var AWS=require('aws-sdk');var rp=require(_0xdeff('0x1'));var util=require(_0xdeff('0x2'));var BPromise=require(_0xdeff('0x3'));var db=require(_0xdeff('0x4'))['db'];var logger=require(_0xdeff('0x5'))(_0xdeff('0x6'));function getTranscriptionJob(_0x298274,_0x2881fd,_0x8315d4,_0x1c4628){return new Promise(function(_0x1ed641,_0x132631){var _0x281ad7=new AWS[(_0xdeff('0x7'))]({'accessKeyId':_0x2881fd,'secretAccessKey':_0x298274,'region':_0x8315d4});_0x281ad7[_0xdeff('0x8')]({'TranscriptionJobName':_0x1c4628},function(_0x12e953,_0x24897a){if(_0x12e953){return _0x132631(_0x12e953);}else{return _0x1ed641(_0x24897a);}});});}function sentiment(_0x540ae6,_0x3ae201,_0x45a8a6,_0xf6d58d,_0x51fcb7){return new Promise(function(_0x1ff265,_0x4423e9){var _0x3c1482=new AWS[(_0xdeff('0x9'))]({'accessKeyId':_0x3ae201,'secretAccessKey':_0x540ae6,'region':_0x45a8a6});_0x3c1482[_0xdeff('0xa')]({'Text':_0xf6d58d,'LanguageCode':_0x51fcb7[_0xdeff('0xb')](0x0,0x2)},function(_0x2e9783,_0x402075){if(_0x2e9783){return _0x4423e9(_0x2e9783);}else{return _0x1ff265(_0x402075);}});});}function checkTranscribeJob(_0x505d0c,_0x461699,_0x116bf9){var _0x4952f2;return new BPromise(function(_0x2e614c,_0x4e7526){logger['info'](util[_0xdeff('0xc')](_0xdeff('0xd'),_0x505d0c['id'],_0x505d0c[_0xdeff('0xe')]));return getTranscriptionJob(_0x116bf9[_0xdeff('0xf')],_0x116bf9['data2'],_0x461699[_0xdeff('0x10')],_0x505d0c[_0xdeff('0xe')])[_0xdeff('0x11')](function(_0x391633){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x505d0c['id'],_0x505d0c['transcribeName'],_0x391633[_0xdeff('0x13')]['TranscriptionJobStatus']));if(!_0x505d0c['fileText']){switch(_0x391633[_0xdeff('0x13')][_0xdeff('0x14')]){case'COMPLETED':var _0x2de203={'transcribeStatus':_0x391633[_0xdeff('0x13')][_0xdeff('0x14')],'fileUri':_0x391633[_0xdeff('0x13')][_0xdeff('0x15')][_0xdeff('0x16')]};logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x505d0c['id']));return rp({'uri':_0x391633['TranscriptionJob']['Transcript'][_0xdeff('0x16')],'json':!![]})['then'](function(_0x189627){logger[_0xdeff('0x12')](util['format'](_0xdeff('0x17'),_0x505d0c['id']));if(_0x189627&&_0x189627[_0xdeff('0x18')]&&_0x189627['results']['transcripts']&&_0x189627[_0xdeff('0x18')][_0xdeff('0x19')][_0xdeff('0x1a')]){_0x2de203[_0xdeff('0x1b')]='';for(var _0x32add9=0x0;_0x32add9<_0x189627['results'][_0xdeff('0x19')][_0xdeff('0x1a')];_0x32add9++){_0x2de203[_0xdeff('0x1b')]+=_0x189627[_0xdeff('0x18')][_0xdeff('0x19')][_0x32add9][_0xdeff('0x1c')]+'';}}return _0x505d0c[_0xdeff('0x1d')](_0x2de203);})['then'](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x505d0c['id']));if(!_0x505d0c['tempSentiment']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x20'));}if(!_0x461699[_0xdeff('0x21')]||!_0x461699[_0xdeff('0x22')]||!_0x461699[_0xdeff('0x23')]||!_0x461699[_0xdeff('0x24')]||!_0x461699['bucket']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x25'));}if(!_0x2de203['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x461699[_0xdeff('0x22')]===_0x116bf9['id']){return _0x116bf9;}else{return db['CloudProvider'][_0xdeff('0x26')]({'where':{'id':_settings[_0xdeff('0x22')]}});}})[_0xdeff('0x11')](function(_0x5af6b2){if(!_0x5af6b2){throw new db[(_0xdeff('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5af6b2[_0xdeff('0xf')]||!_0x5af6b2[_0xdeff('0x27')]){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x4952f2=_0x5af6b2;logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x28'),_0x505d0c['id']));return sentiment(_0x4952f2[_0xdeff('0xf')],_0x4952f2[_0xdeff('0x27')],_0x461699[_0xdeff('0x23')],_0x2de203[_0xdeff('0x1b')],_0x461699['language']);})[_0xdeff('0x11')](function(_0x5cef77){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x29'),_0x505d0c['id']));return _0x505d0c[_0xdeff('0x1d')]({'sentiment':_0x5cef77[_0xdeff('0x2a')],'sPositive':_0x5cef77[_0xdeff('0x2b')]['Positive'],'sNegative':_0x5cef77[_0xdeff('0x2b')][_0xdeff('0x2c')],'sMixed':_0x5cef77['SentimentScore'][_0xdeff('0x2d')],'sNeutral':_0x5cef77[_0xdeff('0x2b')][_0xdeff('0x2e')]});})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x2f'),_0x505d0c['id']));_0x2e614c();});case _0xdeff('0x30'):return _0x505d0c['update']({'transcribeStatus':_0xdeff('0x30'),'failureReason':_0x391633['TranscriptionJob'][_0xdeff('0x31')]})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util['format'](_0xdeff('0x2f'),_0x505d0c['id']));_0x2e614c();});default:logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x32'),_0x505d0c['id']));break;}}else{return BPromise[_0xdeff('0x33')]()['then'](function(){if(!_0x505d0c[_0xdeff('0x34')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x20'));}if(!_0x461699['sentiment']||!_0x461699[_0xdeff('0x22')]||!_0x461699[_0xdeff('0x23')]||!_0x461699[_0xdeff('0x24')]||!_0x461699[_0xdeff('0x35')]){throw new db[(_0xdeff('0x1e'))]['ValidationError'](_0xdeff('0x25'));}if(!_0x505d0c[_0xdeff('0x1b')]){throw new Error(_0xdeff('0x36'));}if(_0x461699[_0xdeff('0x22')]===_0x116bf9['id']){return _0x116bf9;}else{return db[_0xdeff('0x37')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xdeff('0x11')](function(_0x1f5411){if(!_0x1f5411){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x38'));}if(!_0x1f5411[_0xdeff('0xf')]||!_0x1f5411[_0xdeff('0x27')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x39'));}_0x4952f2=_0x1f5411;logger[_0xdeff('0x12')](util['format'](_0xdeff('0x28'),_0x505d0c['id']));return sentiment(_0x4952f2[_0xdeff('0xf')],_0x4952f2[_0xdeff('0x27')],_0x461699[_0xdeff('0x23')],_0x505d0c['fileText'],_0x461699[_0xdeff('0x24')]);})[_0xdeff('0x11')](function(_0x8fe480){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x29'),_0x505d0c['id']));return _0x505d0c[_0xdeff('0x1d')]({'sentiment':_0x8fe480[_0xdeff('0x2a')],'sPositive':_0x8fe480['SentimentScore'][_0xdeff('0x3a')],'sNegative':_0x8fe480[_0xdeff('0x2b')][_0xdeff('0x2c')],'sMixed':_0x8fe480[_0xdeff('0x2b')][_0xdeff('0x2d')],'sNeutral':_0x8fe480['SentimentScore'][_0xdeff('0x2e')],'transcribeStatus':_0xdeff('0x3b')});})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x505d0c['id']));_0x2e614c();});}})[_0xdeff('0x3c')](function(_0x4e7316){if(_0x4e7316){if(!_0x4e7316[_0xdeff('0x3d')]||_0x4e7316[_0xdeff('0x3d')]!==_0xdeff('0x3e')){logger[_0xdeff('0x3f')](util[_0xdeff('0xc')](_0xdeff('0x40'),_0x505d0c['id']),util['inspect'](_0x4e7316,{'showHidden':![],'depth':null}));}}_0x2e614c();});});}function checkTranscribe(){var _0x49bc0b;var _0x71b5a5;var _0xf91a72;return db[_0xdeff('0x41')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xdeff('0x11')](function(_0x344218){if(!_0x344218||!_0x344218['length']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x42'));}_0x49bc0b=_0x344218;return db['Setting'][_0xdeff('0x26')]({'where':{'id':0x1}});})[_0xdeff('0x11')](function(_0x1ca376){if(!_0x1ca376){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x43'));}_0x71b5a5=_0x1ca376;if(!_0x71b5a5[_0xdeff('0x6')]||!_0x71b5a5[_0xdeff('0x44')]||!_0x71b5a5[_0xdeff('0x10')]||!_0x71b5a5[_0xdeff('0x24')]||!_0x71b5a5[_0xdeff('0x35')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x45'));}return db['CloudProvider'][_0xdeff('0x26')]({'where':{'id':_0x71b5a5[_0xdeff('0x44')]}});})[_0xdeff('0x11')](function(_0x33482b){if(!_0x33482b){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x38'));}if(!_0x33482b[_0xdeff('0xf')]||!_0x33482b['data2']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x39'));}_0xf91a72=_0x33482b;var _0x552749=[];_0x49bc0b['forEach'](function(_0x1e43a6){_0x552749[_0xdeff('0x46')](checkTranscribeJob(_0x1e43a6,_0x71b5a5,_0xf91a72));});return BPromise[_0xdeff('0x47')](_0x552749);})[_0xdeff('0x3c')](function(_0x440053){if(_0x440053){if(!_0x440053[_0xdeff('0x3d')]||_0x440053['name']!=='SequelizeValidationError'){logger[_0xdeff('0x3f')](util[_0xdeff('0x48')](_0x440053,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x422f=['FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','bucket','CloudProvider','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','util','bluebird','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','then','TranscriptionJob','TranscriptionJobStatus','fileText','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sequelize','ValidationError','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x422f,0x1c7));var _0xf422=function(_0x49d000,_0xaa9cc1){_0x49d000=_0x49d000-0x0;var _0x2a5ace=_0x422f[_0x49d000];return _0x2a5ace;};var _=require('lodash');var AWS=require(_0xf422('0x0'));var rp=require('request-promise');var util=require(_0xf422('0x1'));var BPromise=require(_0xf422('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xf422('0x3'))(_0xf422('0x4'));function getTranscriptionJob(_0x312bc8,_0x444ad5,_0x16047c,_0x434f27){return new Promise(function(_0x3e3e5d,_0x13ed91){var _0x350b2d=new AWS['TranscribeService']({'accessKeyId':_0x444ad5,'secretAccessKey':_0x312bc8,'region':_0x16047c});_0x350b2d[_0xf422('0x5')]({'TranscriptionJobName':_0x434f27},function(_0x1037fa,_0xc2c9f5){if(_0x1037fa){return _0x13ed91(_0x1037fa);}else{return _0x3e3e5d(_0xc2c9f5);}});});}function sentiment(_0x23a1bf,_0x53d577,_0x5f02da,_0x419ec4,_0x526c03){return new Promise(function(_0x599177,_0x85cccc){var _0x39f67b=new AWS[(_0xf422('0x6'))]({'accessKeyId':_0x53d577,'secretAccessKey':_0x23a1bf,'region':_0x5f02da});_0x39f67b[_0xf422('0x7')]({'Text':_0x419ec4,'LanguageCode':_0x526c03[_0xf422('0x8')](0x0,0x2)},function(_0x579838,_0x1a3c21){if(_0x579838){return _0x85cccc(_0x579838);}else{return _0x599177(_0x1a3c21);}});});}function checkTranscribeJob(_0x14b379,_0x4d56d1,_0x133a6a){var _0x8aa9cc;return new BPromise(function(_0x1ea998,_0x2c14cd){logger[_0xf422('0x9')](util[_0xf422('0xa')](_0xf422('0xb'),_0x14b379['id'],_0x14b379[_0xf422('0xc')]));return getTranscriptionJob(_0x133a6a[_0xf422('0xd')],_0x133a6a['data2'],_0x4d56d1['transcribeRegion'],_0x14b379['transcribeName'])[_0xf422('0xe')](function(_0x30b70a){logger[_0xf422('0x9')](util[_0xf422('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x14b379['id'],_0x14b379[_0xf422('0xc')],_0x30b70a[_0xf422('0xf')][_0xf422('0x10')]));if(!_0x14b379[_0xf422('0x11')]){switch(_0x30b70a[_0xf422('0xf')][_0xf422('0x10')]){case'COMPLETED':var _0x502976={'transcribeStatus':_0x30b70a[_0xf422('0xf')][_0xf422('0x10')],'fileUri':_0x30b70a[_0xf422('0xf')]['Transcript'][_0xf422('0x12')]};logger['info'](util[_0xf422('0xa')](_0xf422('0x13'),_0x14b379['id']));return rp({'uri':_0x30b70a[_0xf422('0xf')]['Transcript'][_0xf422('0x12')],'json':!![]})[_0xf422('0xe')](function(_0x511529){logger['info'](util[_0xf422('0xa')](_0xf422('0x14'),_0x14b379['id']));if(_0x511529&&_0x511529['results']&&_0x511529[_0xf422('0x15')]['transcripts']&&_0x511529[_0xf422('0x15')][_0xf422('0x16')][_0xf422('0x17')]){_0x502976[_0xf422('0x11')]='';for(var _0x24d34d=0x0;_0x24d34d<_0x511529[_0xf422('0x15')][_0xf422('0x16')][_0xf422('0x17')];_0x24d34d++){_0x502976['fileText']+=_0x511529[_0xf422('0x15')]['transcripts'][_0x24d34d][_0xf422('0x18')]+'';}}return _0x14b379[_0xf422('0x19')](_0x502976);})[_0xf422('0xe')](function(){logger[_0xf422('0x9')](util[_0xf422('0xa')](_0xf422('0x1a'),_0x14b379['id']));if(!_0x14b379[_0xf422('0x1b')]){throw new db['Sequelize']['ValidationError'](_0xf422('0x1c'));}if(!_0x4d56d1[_0xf422('0x1d')]||!_0x4d56d1[_0xf422('0x1e')]||!_0x4d56d1[_0xf422('0x1f')]||!_0x4d56d1[_0xf422('0x20')]||!_0x4d56d1['bucket']){throw new db[(_0xf422('0x21'))][(_0xf422('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x502976['fileText']){throw new Error(_0xf422('0x23'));}if(_0x4d56d1['sentimentAccountId']===_0x133a6a['id']){return _0x133a6a;}else{return db['CloudProvider'][_0xf422('0x24')]({'where':{'id':_settings[_0xf422('0x1e')]}});}})['then'](function(_0x261e29){if(!_0x261e29){throw new db[(_0xf422('0x21'))][(_0xf422('0x22'))](_0xf422('0x25'));}if(!_0x261e29[_0xf422('0xd')]||!_0x261e29['data2']){throw new db[(_0xf422('0x21'))]['ValidationError'](_0xf422('0x26'));}_0x8aa9cc=_0x261e29;logger[_0xf422('0x9')](util[_0xf422('0xa')](_0xf422('0x27'),_0x14b379['id']));return sentiment(_0x8aa9cc[_0xf422('0xd')],_0x8aa9cc[_0xf422('0x28')],_0x4d56d1[_0xf422('0x1f')],_0x502976['fileText'],_0x4d56d1['language']);})[_0xf422('0xe')](function(_0x374bfc){logger['info'](util[_0xf422('0xa')](_0xf422('0x29'),_0x14b379['id']));return _0x14b379[_0xf422('0x19')]({'sentiment':_0x374bfc[_0xf422('0x2a')],'sPositive':_0x374bfc[_0xf422('0x2b')][_0xf422('0x2c')],'sNegative':_0x374bfc[_0xf422('0x2b')][_0xf422('0x2d')],'sMixed':_0x374bfc[_0xf422('0x2b')][_0xf422('0x2e')],'sNeutral':_0x374bfc[_0xf422('0x2b')][_0xf422('0x2f')]});})[_0xf422('0xe')](function(){logger[_0xf422('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x14b379['id']));_0x1ea998();});case'FAILED':return _0x14b379[_0xf422('0x19')]({'transcribeStatus':_0xf422('0x30'),'failureReason':_0x30b70a['TranscriptionJob'][_0xf422('0x31')]})['then'](function(){logger[_0xf422('0x9')](util[_0xf422('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x14b379['id']));_0x1ea998();});default:logger[_0xf422('0x9')](util[_0xf422('0xa')](_0xf422('0x32'),_0x14b379['id']));break;}}else{return BPromise['resolve']()[_0xf422('0xe')](function(){if(!_0x14b379['tempSentiment']){throw new db['Sequelize']['ValidationError'](_0xf422('0x1c'));}if(!_0x4d56d1[_0xf422('0x1d')]||!_0x4d56d1[_0xf422('0x1e')]||!_0x4d56d1[_0xf422('0x1f')]||!_0x4d56d1[_0xf422('0x20')]||!_0x4d56d1[_0xf422('0x33')]){throw new db[(_0xf422('0x21'))][(_0xf422('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x14b379['fileText']){throw new Error(_0xf422('0x23'));}if(_0x4d56d1[_0xf422('0x1e')]===_0x133a6a['id']){return _0x133a6a;}else{return db[_0xf422('0x34')][_0xf422('0x24')]({'where':{'id':_settings[_0xf422('0x1e')]}});}})[_0xf422('0xe')](function(_0x56d615){if(!_0x56d615){throw new db[(_0xf422('0x21'))]['ValidationError'](_0xf422('0x25'));}if(!_0x56d615[_0xf422('0xd')]||!_0x56d615['data2']){throw new db[(_0xf422('0x21'))][(_0xf422('0x22'))](_0xf422('0x26'));}_0x8aa9cc=_0x56d615;logger[_0xf422('0x9')](util[_0xf422('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x14b379['id']));return sentiment(_0x8aa9cc[_0xf422('0xd')],_0x8aa9cc[_0xf422('0x28')],_0x4d56d1[_0xf422('0x1f')],_0x14b379[_0xf422('0x11')],_0x4d56d1[_0xf422('0x20')]);})['then'](function(_0x2ba1d6){logger[_0xf422('0x9')](util['format'](_0xf422('0x29'),_0x14b379['id']));return _0x14b379['update']({'sentiment':_0x2ba1d6[_0xf422('0x2a')],'sPositive':_0x2ba1d6[_0xf422('0x2b')][_0xf422('0x2c')],'sNegative':_0x2ba1d6[_0xf422('0x2b')][_0xf422('0x2d')],'sMixed':_0x2ba1d6[_0xf422('0x2b')][_0xf422('0x2e')],'sNeutral':_0x2ba1d6[_0xf422('0x2b')][_0xf422('0x2f')],'transcribeStatus':_0xf422('0x35')});})[_0xf422('0xe')](function(){logger[_0xf422('0x9')](util[_0xf422('0xa')](_0xf422('0x1a'),_0x14b379['id']));_0x1ea998();});}})[_0xf422('0x36')](function(_0x548c27){if(_0x548c27){if(!_0x548c27['name']||_0x548c27[_0xf422('0x37')]!==_0xf422('0x38')){logger[_0xf422('0x39')](util['format'](_0xf422('0x3a'),_0x14b379['id']),util[_0xf422('0x3b')](_0x548c27,{'showHidden':![],'depth':null}));}}_0x1ea998();});});}function checkTranscribe(){var _0x39910e;var _0x13d2bf;var _0x1f3a30;return db[_0xf422('0x3c')][_0xf422('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xf422('0xe')](function(_0x4d8114){if(!_0x4d8114||!_0x4d8114[_0xf422('0x17')]){throw new db[(_0xf422('0x21'))]['ValidationError'](_0xf422('0x3e'));}_0x39910e=_0x4d8114;return db[_0xf422('0x3f')][_0xf422('0x24')]({'where':{'id':0x1}});})[_0xf422('0xe')](function(_0x2df71a){if(!_0x2df71a){throw new db['Sequelize']['ValidationError'](_0xf422('0x40'));}_0x13d2bf=_0x2df71a;if(!_0x13d2bf['transcribe']||!_0x13d2bf[_0xf422('0x41')]||!_0x13d2bf[_0xf422('0x42')]||!_0x13d2bf[_0xf422('0x20')]||!_0x13d2bf[_0xf422('0x33')]){throw new db['Sequelize']['ValidationError'](_0xf422('0x43'));}return db[_0xf422('0x34')][_0xf422('0x24')]({'where':{'id':_0x13d2bf[_0xf422('0x41')]}});})[_0xf422('0xe')](function(_0x350af2){if(!_0x350af2){throw new db['Sequelize'][(_0xf422('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x350af2[_0xf422('0xd')]||!_0x350af2[_0xf422('0x28')]){throw new db[(_0xf422('0x21'))][(_0xf422('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x1f3a30=_0x350af2;var _0x48e491=[];_0x39910e[_0xf422('0x44')](function(_0x253141){_0x48e491[_0xf422('0x45')](checkTranscribeJob(_0x253141,_0x13d2bf,_0x1f3a30));});return BPromise[_0xf422('0x46')](_0x48e491);})[_0xf422('0x36')](function(_0x2ce919){if(_0x2ce919){if(!_0x2ce919[_0xf422('0x37')]||_0x2ce919['name']!==_0xf422('0x38')){logger[_0xf422('0x39')](util[_0xf422('0x3b')](_0x2ce919,{'showHidden':![],'depth':null}));}}});}exports[_0xf422('0x47')]=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 cff938c..fa6fd9b 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 _0x4bdc=['error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','socket.io-emitter','lastMsgAt','subtract','hours','then','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch'];(function(_0x447a04,_0xf69663){var _0x42483b=function(_0x4fd5b3){while(--_0x4fd5b3){_0x447a04['push'](_0x447a04['shift']());}};_0x42483b(++_0xf69663);}(_0x4bdc,0x18c));var _0xc4bd=function(_0x4ae15d,_0x23de6f){_0x4ae15d=_0x4ae15d-0x0;var _0x87ae62=_0x4bdc[_0x4ae15d];return _0x87ae62;};'use strict';var _=require(_0xc4bd('0x0'));var moment=require(_0xc4bd('0x1'));var Redis=require('ioredis');var util=require(_0xc4bd('0x2'));var config=require(_0xc4bd('0x3'));var db=require(_0xc4bd('0x4'))['db'];var logger=require(_0xc4bd('0x5'))('schedule');config[_0xc4bd('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc4bd('0x7'))(new Redis(config[_0xc4bd('0x6')]));function closeInteractions(){var _0x45a093=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0xc4bd('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xc4bd('0x9')](0x18,_0xc4bd('0xa'))}}})[_0xc4bd('0xb')](function(_0x707413){if(_0x707413&&_0x707413['length']){_0x45a093=_[_0xc4bd('0xc')](_0x707413||[],'id');logger['info'](_0xc4bd('0xd'),_0x45a093[_0xc4bd('0xe')]());return db[_0xc4bd('0xf')][_0xc4bd('0x10')]({'closeReason':'system','disposition':_0xc4bd('0x11'),'closed':!![],'closedAt':moment()[_0xc4bd('0x12')](_0xc4bd('0x13'))},{'where':{'id':_0x45a093}});}})[_0xc4bd('0xb')](function(){if(_0x45a093&&_0x45a093[_0xc4bd('0x14')]){logger['info'](_0xc4bd('0x15'),_0x45a093[_0xc4bd('0xe')]());for(var _0x51631c=0x0;_0x51631c<_0x45a093[_0xc4bd('0x14')];_0x51631c++){io[_0xc4bd('0x16')]('whatsappInteraction:update',{'id':_0x45a093[_0x51631c],'closed':!![]});}}})[_0xc4bd('0x17')](function(_0x29d4aa){logger[_0xc4bd('0x18')](_0xc4bd('0x19'),_0x29d4aa?util[_0xc4bd('0x1a')](_0x29d4aa,{'showHidden':![],'depth':null}):'');});}exports[_0xc4bd('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6869=['inspect','lodash','moment','ioredis','../../config/environment','schedule','redis','defaults','localhost','WhatsappInteraction','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','format','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0x16fddb,_0x22f5a4){var _0x51308a=function(_0x544627){while(--_0x544627){_0x16fddb['push'](_0x16fddb['shift']());}};_0x51308a(++_0x22f5a4);}(_0x6869,0xe2));var _0x9686=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6869[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x9686('0x0'));var moment=require(_0x9686('0x1'));var Redis=require(_0x9686('0x2'));var util=require('util');var config=require(_0x9686('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x9686('0x4'));config[_0x9686('0x5')]=_[_0x9686('0x6')](config[_0x9686('0x5')],{'host':_0x9686('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9686('0x5')]));function closeInteractions(){var _0x1e4b89=[];return db[_0x9686('0x8')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9686('0x9')](0x18,_0x9686('0xa'))}}})[_0x9686('0xb')](function(_0x316f3e){if(_0x316f3e&&_0x316f3e['length']){_0x1e4b89=_[_0x9686('0xc')](_0x316f3e||[],'id');logger[_0x9686('0xd')](_0x9686('0xe'),_0x1e4b89[_0x9686('0xf')]());return db[_0x9686('0x8')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x9686('0x10')](_0x9686('0x11'))},{'where':{'id':_0x1e4b89}});}})[_0x9686('0xb')](function(){if(_0x1e4b89&&_0x1e4b89[_0x9686('0x12')]){logger[_0x9686('0xd')](_0x9686('0x13'),_0x1e4b89['join']());for(var _0xd24b8f=0x0;_0xd24b8f<_0x1e4b89[_0x9686('0x12')];_0xd24b8f++){io['emit'](_0x9686('0x14'),{'id':_0x1e4b89[_0xd24b8f],'closed':!![]});}}})[_0x9686('0x15')](function(_0x21771b){logger[_0x9686('0x16')](_0x9686('0x17'),_0x21771b?util[_0x9686('0x18')](_0x21771b,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index eeb2c92..a5c660b 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64da=['Biondo','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','innocenzo.biondo','@xcally.com','now','Innocenzo'];(function(_0x4e25fe,_0x24b0c2){var _0x17fc4d=function(_0x57a3c2){while(--_0x57a3c2){_0x4e25fe['push'](_0x4e25fe['shift']());}};_0x17fc4d(++_0x24b0c2);}(_0x64da,0x189));var _0xa64d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x64da[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0xa64d('0x0'));var db=require(_0xa64d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa64d('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xa64d('0x3')+i+_0xa64d('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xa64d('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xa64d('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa64d('0x2')]({'id':i,'firstName':_0xa64d('0x6')+i,'lastName':_0xa64d('0x7')+i,'phone':0xf879fb460+i,'email':_0xa64d('0x3')+i+_0xa64d('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa64d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa64d('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa64d('0x5')](),'updatedAt':Date[_0xa64d('0x5')]()});}db[_0xa64d('0x8')][_0xa64d('0x9')]({'where':{}})['then'](function(){return db['CmContact']['bulkCreate'](contacts);})[_0xa64d('0xa')](function(){console[_0xa64d('0xb')](_0xa64d('0xc'),_0xa64d('0xd'));return db[_0xa64d('0xe')]['destroy']({'where':{}});})[_0xa64d('0xa')](function(){return db['CmHopper'][_0xa64d('0xf')](hopper);})['then'](function(){console[_0xa64d('0xb')]('finished\x20populating',_0xa64d('0x10'));return db['CmContact'][_0xa64d('0xf')](contacts2);})[_0xa64d('0xa')](function(){console[_0xa64d('0xb')](_0xa64d('0xc'),_0xa64d('0x11'));return db[_0xa64d('0xe')][_0xa64d('0xf')](hopper2);})[_0xa64d('0xa')](function(){console['log'](_0xa64d('0xc'),_0xa64d('0x12'));})[_0xa64d('0x13')](function(_0x2b72d5){console[_0xa64d('0xb')](_0x2b72d5);}); \ No newline at end of file +var _0x7d8f=['@xcally.com','destroy','then','CmContact','bulkCreate','log','finished\x20populating','CmHopper','hopper1','contacts2','hopper2','catch','util','push','Innocenzo','innocenzo.biondo','now','Biondo'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7d8f,0xd2));var _0xf7d8=function(_0x26a8a6,_0x1d50ba){_0x26a8a6=_0x26a8a6-0x0;var _0x3cd35b=_0x7d8f[_0x26a8a6];return _0x3cd35b;};'use strict';var util=require(_0xf7d8('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf7d8('0x1')]({'id':i,'firstName':_0xf7d8('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xf7d8('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf7d8('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xf7d8('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xf7d8('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xf7d8('0x5')+i,'phone':0xf879fb460+i,'email':_0xf7d8('0x3')+i+_0xf7d8('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf7d8('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db['CmContact'][_0xf7d8('0x7')]({'where':{}})[_0xf7d8('0x8')](function(){return db[_0xf7d8('0x9')][_0xf7d8('0xa')](contacts);})[_0xf7d8('0x8')](function(){console[_0xf7d8('0xb')](_0xf7d8('0xc'),'contacts1');return db[_0xf7d8('0xd')]['destroy']({'where':{}});})[_0xf7d8('0x8')](function(){return db[_0xf7d8('0xd')]['bulkCreate'](hopper);})[_0xf7d8('0x8')](function(){console['log'](_0xf7d8('0xc'),_0xf7d8('0xe'));return db[_0xf7d8('0x9')][_0xf7d8('0xa')](contacts2);})[_0xf7d8('0x8')](function(){console['log'](_0xf7d8('0xc'),_0xf7d8('0xf'));return db[_0xf7d8('0xd')][_0xf7d8('0xa')](hopper2);})['then'](function(){console[_0xf7d8('0xb')](_0xf7d8('0xc'),_0xf7d8('0x10'));})[_0xf7d8('0x11')](function(_0x2b2bbc){console[_0xf7d8('0xb')](_0x2b2bbc);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index f90e334..95212b5 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb31e=['yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','util','../mysqldb','format','%s%s','agent','password','udp','wss','all','ulaw'];(function(_0x5ddf4f,_0x2b27c8){var _0x2799df=function(_0x25303d){while(--_0x25303d){_0x5ddf4f['push'](_0x5ddf4f['shift']());}};_0x2799df(++_0x2b27c8);}(_0xb31e,0x1ea));var _0xeb31=function(_0x27da5b,_0x30b30e){_0x27da5b=_0x27da5b-0x0;var _0x229712=_0xb31e[_0x27da5b];return _0x229712;};'use strict';var util=require(_0xeb31('0x0'));var db=require(_0xeb31('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xeb31('0x2')](_0xeb31('0x3'),_0xeb31('0x4'),i),'fullname':util['format']('%s%s',_0xeb31('0x4'),i),'email':util[_0xeb31('0x2')]('%s%s@xcally.com',_0xeb31('0x4'),i),'role':_0xeb31('0x4'),'password':_0xeb31('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xeb31('0x6'),'ws',_0xeb31('0x7')],'disallow':[_0xeb31('0x8')],'allow':[_0xeb31('0x9')],'defaultuser':util[_0xeb31('0x2')](_0xeb31('0x3'),_0xeb31('0x4'),i),'encryption':'yes','avpf':_0xeb31('0xa'),'force_avp':_0xeb31('0xa'),'icesupport':_0xeb31('0xa'),'dtlsenable':_0xeb31('0xa'),'dtlsverify':'no','dtlscertfile':_0xeb31('0xb'),'dtlsprivatekey':_0xeb31('0xc'),'dtlssetup':_0xeb31('0xd'),'callerid':util[_0xeb31('0x2')](_0xeb31('0xe'),util[_0xeb31('0x2')](_0xeb31('0x3'),_0xeb31('0x4'),i),0xfa0+i)});}db[_0xeb31('0xf')][_0xeb31('0x10')](users)[_0xeb31('0x11')](function(){console[_0xeb31('0x12')](_0xeb31('0x13'));})['catch'](function(_0x1cdd16){console[_0xeb31('0x12')](_0x1cdd16);}); \ No newline at end of file +var _0x95cf=['udp','wss','ulaw','%s%s','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','push','format','agent','%s%s@xcally.com','password','friend'];(function(_0xcf26bc,_0x3caebd){var _0x432988=function(_0x231ac5){while(--_0x231ac5){_0xcf26bc['push'](_0xcf26bc['shift']());}};_0x432988(++_0x3caebd);}(_0x95cf,0x1c5));var _0xf95c=function(_0x4d4ff0,_0x5b12d2){_0x4d4ff0=_0x4d4ff0-0x0;var _0x25b41b=_0x95cf[_0x4d4ff0];return _0x25b41b;};'use strict';var util=require(_0xf95c('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf95c('0x1')]({'name':util[_0xf95c('0x2')]('%s%s','agent',i),'fullname':util['format']('%s%s',_0xf95c('0x3'),i),'email':util[_0xf95c('0x2')](_0xf95c('0x4'),'agent',i),'role':'agent','password':_0xf95c('0x5'),'internal':0xfa0+i,'type':_0xf95c('0x6'),'transport':[_0xf95c('0x7'),'ws',_0xf95c('0x8')],'disallow':['all'],'allow':[_0xf95c('0x9')],'defaultuser':util['format'](_0xf95c('0xa'),'agent',i),'encryption':_0xf95c('0xb'),'avpf':_0xf95c('0xb'),'force_avp':_0xf95c('0xb'),'icesupport':'yes','dtlsenable':_0xf95c('0xb'),'dtlsverify':'no','dtlscertfile':_0xf95c('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf95c('0xd'),'callerid':util[_0xf95c('0x2')](_0xf95c('0xe'),util[_0xf95c('0x2')](_0xf95c('0xa'),_0xf95c('0x3'),i),0xfa0+i)});}db[_0xf95c('0xf')]['bulkCreate'](users)[_0xf95c('0x10')](function(){console[_0xf95c('0x11')](_0xf95c('0x12'));})[_0xf95c('0x13')](function(_0x20bfbd){console[_0xf95c('0x11')](_0x20bfbd);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index eaf9fb4..451706c 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7c1=['OpenchannelInteractions','WhatsappInteraction','user:%s','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','userProfileId','SmsQueues','getVoiceQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','catch','log','join','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','findOne','then','autoAssociation','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','Trunks','findAll','IvrCampaigns','resourceId','where','format','%s:queue:%s','length','handshake','find','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions'];(function(_0x3e30b3,_0x320137){var _0x202833=function(_0x297761){while(--_0x297761){_0x3e30b3['push'](_0x3e30b3['shift']());}};_0x202833(++_0x320137);}(_0xd7c1,0xa5));var _0x1d7c=function(_0x4616b7,_0x2ec5e){_0x4616b7=_0x4616b7-0x0;var _0x4c5114=_0xd7c1[_0x4616b7];return _0x4c5114;};'use strict';var _=require(_0x1d7c('0x0'));var util=require(_0x1d7c('0x1'));var BPromise=require(_0x1d7c('0x2'));var db=require(_0x1d7c('0x3'))['db'];var config=require(_0x1d7c('0x4'));var queryQueues={'attributes':['id',_0x1d7c('0x5')],'include':[{'as':_0x1d7c('0x6'),'model':db[_0x1d7c('0x7')],'attributes':['id',_0x1d7c('0x5'),_0x1d7c('0x8')],'raw':!![],'where':{'role':_0x1d7c('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1d7c('0x5')],'where':{'role':_0x1d7c('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1d7c('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x1d7c('0x5')],'where':{'role':_0x1d7c('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1d7c('0x5'),_0x1d7c('0xb')],'where':{'type':_0x1d7c('0xc')}};function getAssociatedResources(_0x10fff3,_0x1091e3,_0x4a7eef){return db['UserProfileSection'][_0x1d7c('0xd')]({'where':{'name':_0x10fff3,'userProfileId':_0x1091e3},'raw':!![]})[_0x1d7c('0xe')](function(_0x38fd05){if(_0x38fd05){if(_0x38fd05[_0x1d7c('0xf')]){switch(_0x10fff3){case'VoiceQueues':case _0x1d7c('0x10'):case _0x1d7c('0x11'):case'SmsQueues':case _0x1d7c('0x12'):case _0x1d7c('0x13'):case _0x1d7c('0x14'):return db[_0x4a7eef]['findAll'](queryQueues);case _0x1d7c('0x15'):return db[_0x4a7eef]['findAll'](queryTelephones);case _0x1d7c('0x16'):return db[_0x4a7eef][_0x1d7c('0x17')](queryTrunks);case _0x1d7c('0x18'):return db[_0x4a7eef][_0x1d7c('0x17')](queryCampaigns);}}else{return db['UserProfileResource'][_0x1d7c('0x17')]({'attributes':['resourceId'],'where':{'sectionId':_0x38fd05['id']},'raw':!![]})[_0x1d7c('0xe')](function(_0x49dbb4){if(_0x49dbb4){var _0x41112d={'where':{'id':_['map'](_0x49dbb4,_0x1d7c('0x19'))},'raw':!![]};switch(_0x4a7eef){case _0x1d7c('0x7'):_0x41112d[_0x1d7c('0x1a')][_0x1d7c('0x8')]=_0x1d7c('0xa');break;case'Campaign':_0x41112d[_0x1d7c('0x1a')][_0x1d7c('0xb')]='ivr';break;}return db[_0x4a7eef][_0x1d7c('0x17')](_0x41112d);}else{return[];}});}}else{return[];}})['then'](function(_0x5147d1){return _0x5147d1;});}function joinOrLeaveQueues(_0x29b24c,_0x1f31f2,_0xf378ad,_0x4102a4){_0x29b24c[_0x1f31f2](util[_0x1d7c('0x1b')](_0x1d7c('0x1c'),_0xf378ad,_0x4102a4[_0x1d7c('0x5')]));if(_0x4102a4[_0x1d7c('0x6')]){for(var _0x1dafe8=0x0;_0x1dafe8<_0x4102a4[_0x1d7c('0x6')][_0x1d7c('0x1d')];_0x1dafe8+=0x1){_0x29b24c[_0x1f31f2](util['format']('user:%s',_0x4102a4['Agents'][_0x1dafe8]['name']));}}}function joinOrLeave(_0x218bdd,_0x3037ed,_0x33e74e){var _0x57c6e7;if(_0x218bdd[_0x1d7c('0x1e')]['query']['id']){db[_0x1d7c('0x7')][_0x1d7c('0x1f')]({'attributes':['id',_0x1d7c('0x5'),'role','userProfileId'],'where':{'id':_0x218bdd[_0x1d7c('0x1e')][_0x1d7c('0x20')]['id']},'include':[{'model':db[_0x1d7c('0x21')],'as':_0x1d7c('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x1d7c('0x23')],'as':_0x1d7c('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x1d7c('0x25')],'as':_0x1d7c('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1d7c('0x27')],'as':_0x1d7c('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x1d7c('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x1d7c('0x2a')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x1d7c('0xe')](function(_0x3ef33a){if(_0x3ef33a){_0x57c6e7=_0x3ef33a;_0x218bdd[_0x3037ed](util[_0x1d7c('0x1b')](_0x1d7c('0x2b'),_0x3ef33a[_0x1d7c('0x5')]));var _0x443a85=[];switch(_0x3ef33a[_0x1d7c('0x8')]){case _0x1d7c('0x2c'):_0x218bdd[_0x3037ed](_0x1d7c('0x2d'));_0x218bdd[_0x3037ed](_0x1d7c('0x2e'));if(queryQueues['hasOwnProperty'](_0x1d7c('0x2f'))){delete queryQueues[_0x1d7c('0x2f')];}_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x31')][_0x1d7c('0x17')](queryQueues));_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x32')]['findAll'](queryQueues));_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x33')][_0x1d7c('0x17')](queryQueues));_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x34')][_0x1d7c('0x17')](queryQueues));_0x443a85['push'](db[_0x1d7c('0x35')][_0x1d7c('0x17')](queryQueues));_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x36')][_0x1d7c('0x17')](queryQueues));_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x37')][_0x1d7c('0x17')](queryQueues));_0x443a85[_0x1d7c('0x30')](db['User'][_0x1d7c('0x17')](queryTelephones));_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x38')]['findAll'](queryTrunks));_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x39')][_0x1d7c('0x17')](queryCampaigns));_0x443a85['push'](db[_0x1d7c('0x7')][_0x1d7c('0x17')](queryAgents));break;case'user':_0x218bdd[_0x3037ed](_0x1d7c('0x2d'));_0x218bdd[_0x3037ed](_0x1d7c('0x2e'));_0x443a85['push'](getAssociatedResources('VoiceQueues',_0x3ef33a[_0x1d7c('0x3a')],_0x1d7c('0x31')));_0x443a85[_0x1d7c('0x30')](getAssociatedResources(_0x1d7c('0x10'),_0x3ef33a[_0x1d7c('0x3a')],'ChatQueue'));_0x443a85[_0x1d7c('0x30')](getAssociatedResources('FaxQueues',_0x3ef33a[_0x1d7c('0x3a')],_0x1d7c('0x33')));_0x443a85['push'](getAssociatedResources(_0x1d7c('0x3b'),_0x3ef33a[_0x1d7c('0x3a')],'SmsQueue'));_0x443a85['push'](getAssociatedResources('MailQueues',_0x3ef33a[_0x1d7c('0x3a')],'MailQueue'));_0x443a85['push'](getAssociatedResources('OpenchannelQueues',_0x3ef33a[_0x1d7c('0x3a')],_0x1d7c('0x36')));_0x443a85[_0x1d7c('0x30')](getAssociatedResources(_0x1d7c('0x14'),_0x3ef33a[_0x1d7c('0x3a')],'WhatsappQueue'));_0x443a85[_0x1d7c('0x30')](getAssociatedResources(_0x1d7c('0x15'),_0x3ef33a[_0x1d7c('0x3a')],'User'));_0x443a85[_0x1d7c('0x30')](getAssociatedResources('Trunks',_0x3ef33a[_0x1d7c('0x3a')],_0x1d7c('0x38')));_0x443a85[_0x1d7c('0x30')](getAssociatedResources(_0x1d7c('0x18'),_0x3ef33a[_0x1d7c('0x3a')],_0x1d7c('0x39')));_0x443a85[_0x1d7c('0x30')](db[_0x1d7c('0x7')][_0x1d7c('0x17')](queryAgents));break;case _0x1d7c('0x9'):_0x218bdd[_0x3037ed](_0x1d7c('0x2d'));_0x218bdd[_0x3037ed](_0x1d7c('0x2e'));_0x443a85[_0x1d7c('0x30')](_0x3ef33a[_0x1d7c('0x3c')]({'attributes':['id','name']}));_0x443a85[_0x1d7c('0x30')](_0x3ef33a[_0x1d7c('0x3d')]({'attributes':['id',_0x1d7c('0x5')]}));_0x443a85['push'](_0x3ef33a[_0x1d7c('0x3e')]({'attributes':['id',_0x1d7c('0x5')]}));_0x443a85[_0x1d7c('0x30')](_0x3ef33a['getSmsQueues']({'attributes':['id',_0x1d7c('0x5')]}));_0x443a85['push'](_0x3ef33a['getMailQueues']({'attributes':['id',_0x1d7c('0x5')]}));_0x443a85[_0x1d7c('0x30')](_0x3ef33a[_0x1d7c('0x3f')]({'attributes':['id',_0x1d7c('0x5')]}));_0x443a85['push'](_0x3ef33a[_0x1d7c('0x40')]({'attributes':['id',_0x1d7c('0x5')]}));break;}return BPromise[_0x1d7c('0x41')](_0x443a85);}})['then'](function(_0xd538d1){if(_0xd538d1&&_0xd538d1[_0x1d7c('0x1d')]){for(var _0x4677e9=0x0;_0x4677e9<_0xd538d1[_0x1d7c('0x1d')];_0x4677e9+=0x1){for(var _0x16c522=0x0;_0x16c522<_0xd538d1[_0x4677e9][_0x1d7c('0x1d')];_0x16c522+=0x1){switch(_0x4677e9){case 0x0:joinOrLeaveQueues(_0x218bdd,_0x3037ed,_0x1d7c('0x42'),_0xd538d1[_0x4677e9][_0x16c522]);break;case 0x1:joinOrLeaveQueues(_0x218bdd,_0x3037ed,_0x1d7c('0x43'),_0xd538d1[_0x4677e9][_0x16c522]);break;case 0x2:joinOrLeaveQueues(_0x218bdd,_0x3037ed,'fax',_0xd538d1[_0x4677e9][_0x16c522]);break;case 0x3:joinOrLeaveQueues(_0x218bdd,_0x3037ed,_0x1d7c('0x44'),_0xd538d1[_0x4677e9][_0x16c522]);break;case 0x4:joinOrLeaveQueues(_0x218bdd,_0x3037ed,_0x1d7c('0x45'),_0xd538d1[_0x4677e9][_0x16c522]);break;case 0x5:joinOrLeaveQueues(_0x218bdd,_0x3037ed,_0x1d7c('0x46'),_0xd538d1[_0x4677e9][_0x16c522]);break;case 0x6:joinOrLeaveQueues(_0x218bdd,_0x3037ed,_0x1d7c('0x47'),_0xd538d1[_0x4677e9][_0x16c522]);break;case 0x7:if(_0x57c6e7[_0x1d7c('0x8')]!==_0x1d7c('0x9'))_0x218bdd[_0x3037ed](util[_0x1d7c('0x1b')]('telephone:%s',_0xd538d1[_0x4677e9][_0x16c522]['name']));break;case 0x8:if(_0x57c6e7[_0x1d7c('0x8')]!==_0x1d7c('0x9'))_0x218bdd[_0x3037ed](util[_0x1d7c('0x1b')](_0x1d7c('0x48'),_0xd538d1[_0x4677e9][_0x16c522][_0x1d7c('0x5')]));break;case 0x9:if(_0x57c6e7[_0x1d7c('0x8')]!==_0x1d7c('0x9'))_0x218bdd[_0x3037ed](util[_0x1d7c('0x1b')](_0x1d7c('0x49'),_0xd538d1[_0x4677e9][_0x16c522][_0x1d7c('0xb')],_0xd538d1[_0x4677e9][_0x16c522][_0x1d7c('0x5')]));break;case 0xa:_0x218bdd[_0x3037ed](util[_0x1d7c('0x1b')](_0x1d7c('0x2b'),_0xd538d1[_0x4677e9][_0x16c522]['name']));break;}}}}})[_0x1d7c('0xe')](function(){if(_0x3037ed===_0x1d7c('0x4a')){var _0x373939=_[_0x1d7c('0x4b')](_0x57c6e7[_0x1d7c('0x22')],'id');return _0x57c6e7[_0x1d7c('0x4c')](_0x373939)[_0x1d7c('0xe')](function(){for(var _0x1a768d=0x0;_0x1a768d<_0x373939[_0x1d7c('0x1d')];_0x1a768d+=0x1){_0x33e74e[_0x1d7c('0x4d')](_0x1d7c('0x4e'),{'ChatInteractionId':Number(_0x373939[_0x1a768d]),'UserId':Number(_0x57c6e7['id'])});}});}})[_0x1d7c('0xe')](function(){if(_0x3037ed==='leave'){var _0x1a2cdb=_[_0x1d7c('0x4b')](_0x57c6e7[_0x1d7c('0x24')],'id');return _0x57c6e7[_0x1d7c('0x4f')](_0x1a2cdb)[_0x1d7c('0xe')](function(){for(var _0x3a3445=0x0;_0x3a3445<_0x1a2cdb[_0x1d7c('0x1d')];_0x3a3445+=0x1){_0x33e74e[_0x1d7c('0x4d')](_0x1d7c('0x50'),{'MailInteractionId':Number(_0x1a2cdb[_0x3a3445]),'UserId':Number(_0x57c6e7['id'])});}});}})[_0x1d7c('0xe')](function(){if(_0x3037ed===_0x1d7c('0x4a')){var _0x54403e=_[_0x1d7c('0x4b')](_0x57c6e7['FaxInteractions'],'id');return _0x57c6e7[_0x1d7c('0x51')](_0x54403e)[_0x1d7c('0xe')](function(){for(var _0x10d4b4=0x0;_0x10d4b4<_0x54403e[_0x1d7c('0x1d')];_0x10d4b4+=0x1){_0x33e74e['emit'](_0x1d7c('0x52'),{'FaxInteractionId':Number(_0x54403e[_0x10d4b4]),'UserId':Number(_0x57c6e7['id'])});}});}})[_0x1d7c('0xe')](function(){if(_0x3037ed===_0x1d7c('0x4a')){var _0x23f280=_[_0x1d7c('0x4b')](_0x57c6e7[_0x1d7c('0x28')],'id');return _0x57c6e7[_0x1d7c('0x53')](_0x23f280)['then'](function(){for(var _0x22388d=0x0;_0x22388d<_0x23f280[_0x1d7c('0x1d')];_0x22388d+=0x1){_0x33e74e[_0x1d7c('0x4d')](_0x1d7c('0x54'),{'SmsInteractionId':Number(_0x23f280[_0x22388d]),'UserId':Number(_0x57c6e7['id'])});}});}})[_0x1d7c('0xe')](function(){if(_0x3037ed==='leave'){var _0x445c89=_[_0x1d7c('0x4b')](_0x57c6e7[_0x1d7c('0x29')],'id');return _0x57c6e7[_0x1d7c('0x55')](_0x445c89)[_0x1d7c('0xe')](function(){for(var _0x3cdd59=0x0;_0x3cdd59<_0x445c89['length'];_0x3cdd59+=0x1){_0x33e74e[_0x1d7c('0x4d')](_0x1d7c('0x56'),{'OpenchannelInteractionId':Number(_0x445c89[_0x3cdd59]),'UserId':Number(_0x57c6e7['id'])});}});}})[_0x1d7c('0xe')](function(){if(_0x3037ed===_0x1d7c('0x4a')){var _0x26b5ad=_[_0x1d7c('0x4b')](_0x57c6e7[_0x1d7c('0x57')],'id');return _0x57c6e7[_0x1d7c('0x58')](_0x26b5ad)['then'](function(){for(var _0x558eff=0x0;_0x558eff<_0x26b5ad[_0x1d7c('0x1d')];_0x558eff+=0x1){_0x33e74e[_0x1d7c('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x26b5ad[_0x558eff]),'UserId':Number(_0x57c6e7['id'])});}});}})[_0x1d7c('0x59')](function(_0x41e227){_0x218bdd[_0x1d7c('0x5a')](_0x41e227);});}}function onDisconnect(_0x303ca6,_0x542be3){joinOrLeave(_0x303ca6,'leave',_0x542be3);}function onConnect(_0x534e0c){joinOrLeave(_0x534e0c,_0x1d7c('0x5b'));}exports['default']=function(_0xd5486a){_0xd5486a['on']('connection',function(_0x3d4cd6){_0x3d4cd6[_0x1d7c('0x5c')](0x0);_0x3d4cd6[_0x1d7c('0x5d')]=_0x3d4cd6[_0x1d7c('0x5e')][_0x1d7c('0x5f')][_0x1d7c('0x60')]+':'+_0x3d4cd6['request'][_0x1d7c('0x5f')][_0x1d7c('0x61')];_0x3d4cd6[_0x1d7c('0x62')]=new Date();_0x3d4cd6[_0x1d7c('0x5a')]=function(_0x5411a4){console['log']('SocketIO\x20'+_0x3d4cd6[_0x1d7c('0x63')][_0x1d7c('0x5')]+'['+_0x3d4cd6[_0x1d7c('0x5d')]+']',_0x5411a4);};_0x3d4cd6['on'](_0x1d7c('0x64'),function(){onDisconnect(_0x3d4cd6,_0xd5486a);_0x3d4cd6[_0x1d7c('0x5a')](_0x1d7c('0x65'));});onConnect(_0x3d4cd6);_0x3d4cd6['log'](_0x1d7c('0x66'));});}; \ No newline at end of file +var _0xaee6=['FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','Campaign','ivr','format','Agents','length','user:%s','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:outbound','SmsQueues','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','emit','user_has_chat_interactions:remove','leave','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','telephone','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xaee6,0x187));var _0x6aee=function(_0x2e8a1b,_0x32ad81){_0x2e8a1b=_0x2e8a1b-0x0;var _0x52cf0b=_0xaee6[_0x2e8a1b];return _0x52cf0b;};'use strict';var _=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var BPromise=require(_0x6aee('0x2'));var db=require(_0x6aee('0x3'))['db'];var config=require(_0x6aee('0x4'));var queryQueues={'attributes':['id',_0x6aee('0x5')],'include':[{'as':'Agents','model':db[_0x6aee('0x6')],'attributes':['id',_0x6aee('0x5'),_0x6aee('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6aee('0x5')],'where':{'role':_0x6aee('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x6aee('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x6aee('0x5')],'where':{'role':_0x6aee('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6aee('0x5'),_0x6aee('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x490b55,_0x9cc4ee,_0x5ac194){return db[_0x6aee('0xb')][_0x6aee('0xc')]({'where':{'name':_0x490b55,'userProfileId':_0x9cc4ee},'raw':!![]})[_0x6aee('0xd')](function(_0x57e596){if(_0x57e596){if(_0x57e596[_0x6aee('0xe')]){switch(_0x490b55){case _0x6aee('0xf'):case _0x6aee('0x10'):case _0x6aee('0x11'):case'SmsQueues':case _0x6aee('0x12'):case'OpenchannelQueues':case _0x6aee('0x13'):return db[_0x5ac194][_0x6aee('0x14')](queryQueues);case _0x6aee('0x15'):return db[_0x5ac194][_0x6aee('0x14')](queryTelephones);case _0x6aee('0x16'):return db[_0x5ac194]['findAll'](queryTrunks);case _0x6aee('0x17'):return db[_0x5ac194][_0x6aee('0x14')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0x6aee('0x18')],'where':{'sectionId':_0x57e596['id']},'raw':!![]})[_0x6aee('0xd')](function(_0x658ef){if(_0x658ef){var _0x18b259={'where':{'id':_[_0x6aee('0x19')](_0x658ef,_0x6aee('0x18'))},'raw':!![]};switch(_0x5ac194){case _0x6aee('0x6'):_0x18b259[_0x6aee('0x1a')]['role']=_0x6aee('0x8');break;case _0x6aee('0x1b'):_0x18b259['where'][_0x6aee('0xa')]=_0x6aee('0x1c');break;}return db[_0x5ac194]['findAll'](_0x18b259);}else{return[];}});}}else{return[];}})[_0x6aee('0xd')](function(_0x138d83){return _0x138d83;});}function joinOrLeaveQueues(_0x39a9c1,_0x3231af,_0x340eae,_0x26aab4){_0x39a9c1[_0x3231af](util[_0x6aee('0x1d')]('%s:queue:%s',_0x340eae,_0x26aab4[_0x6aee('0x5')]));if(_0x26aab4['Agents']){for(var _0x495ec5=0x0;_0x495ec5<_0x26aab4[_0x6aee('0x1e')][_0x6aee('0x1f')];_0x495ec5+=0x1){_0x39a9c1[_0x3231af](util[_0x6aee('0x1d')](_0x6aee('0x20'),_0x26aab4[_0x6aee('0x1e')][_0x495ec5][_0x6aee('0x5')]));}}}function joinOrLeave(_0xc458e7,_0x1ffa47,_0x57b997){var _0xc1b66c;if(_0xc458e7['handshake']['query']['id']){db[_0x6aee('0x6')][_0x6aee('0x21')]({'attributes':['id','name',_0x6aee('0x7'),_0x6aee('0x22')],'where':{'id':_0xc458e7['handshake'][_0x6aee('0x23')]['id']},'include':[{'model':db[_0x6aee('0x24')],'as':_0x6aee('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x6aee('0x26')],'as':_0x6aee('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x6aee('0x28')],'as':_0x6aee('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x6aee('0x2a')],'as':_0x6aee('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x6aee('0x2c')],'as':_0x6aee('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0x6aee('0x2e')],'as':_0x6aee('0x2f'),'attributes':['id'],'raw':!![]}]})[_0x6aee('0xd')](function(_0x15e0db){if(_0x15e0db){_0xc1b66c=_0x15e0db;_0xc458e7[_0x1ffa47](util[_0x6aee('0x1d')]('user:%s',_0x15e0db['name']));var _0xe7f369=[];switch(_0x15e0db[_0x6aee('0x7')]){case _0x6aee('0x30'):_0xc458e7[_0x1ffa47](_0x6aee('0x31'));_0xc458e7[_0x1ffa47]('voice:outbound');if(queryQueues[_0x6aee('0x32')]('include')){delete queryQueues[_0x6aee('0x33')];}_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x35')][_0x6aee('0x14')](queryQueues));_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x36')][_0x6aee('0x14')](queryQueues));_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x37')][_0x6aee('0x14')](queryQueues));_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x38')][_0x6aee('0x14')](queryQueues));_0xe7f369['push'](db[_0x6aee('0x39')][_0x6aee('0x14')](queryQueues));_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x3a')][_0x6aee('0x14')](queryQueues));_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x3b')][_0x6aee('0x14')](queryQueues));_0xe7f369['push'](db[_0x6aee('0x6')][_0x6aee('0x14')](queryTelephones));_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x3c')][_0x6aee('0x14')](queryTrunks));_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x1b')][_0x6aee('0x14')](queryCampaigns));_0xe7f369[_0x6aee('0x34')](db[_0x6aee('0x6')][_0x6aee('0x14')](queryAgents));break;case'user':_0xc458e7[_0x1ffa47]('voice:inbound');_0xc458e7[_0x1ffa47](_0x6aee('0x3d'));_0xe7f369['push'](getAssociatedResources('VoiceQueues',_0x15e0db[_0x6aee('0x22')],_0x6aee('0x35')));_0xe7f369[_0x6aee('0x34')](getAssociatedResources('ChatQueues',_0x15e0db[_0x6aee('0x22')],_0x6aee('0x36')));_0xe7f369[_0x6aee('0x34')](getAssociatedResources(_0x6aee('0x11'),_0x15e0db['userProfileId'],_0x6aee('0x37')));_0xe7f369[_0x6aee('0x34')](getAssociatedResources(_0x6aee('0x3e'),_0x15e0db[_0x6aee('0x22')],_0x6aee('0x38')));_0xe7f369['push'](getAssociatedResources(_0x6aee('0x12'),_0x15e0db[_0x6aee('0x22')],_0x6aee('0x39')));_0xe7f369[_0x6aee('0x34')](getAssociatedResources(_0x6aee('0x3f'),_0x15e0db['userProfileId'],_0x6aee('0x3a')));_0xe7f369['push'](getAssociatedResources(_0x6aee('0x13'),_0x15e0db[_0x6aee('0x22')],_0x6aee('0x3b')));_0xe7f369[_0x6aee('0x34')](getAssociatedResources(_0x6aee('0x15'),_0x15e0db[_0x6aee('0x22')],'User'));_0xe7f369['push'](getAssociatedResources(_0x6aee('0x16'),_0x15e0db['userProfileId'],_0x6aee('0x3c')));_0xe7f369[_0x6aee('0x34')](getAssociatedResources(_0x6aee('0x17'),_0x15e0db[_0x6aee('0x22')],'Campaign'));_0xe7f369[_0x6aee('0x34')](db['User'][_0x6aee('0x14')](queryAgents));break;case'agent':_0xc458e7[_0x1ffa47](_0x6aee('0x31'));_0xc458e7[_0x1ffa47](_0x6aee('0x3d'));_0xe7f369[_0x6aee('0x34')](_0x15e0db[_0x6aee('0x40')]({'attributes':['id',_0x6aee('0x5')]}));_0xe7f369[_0x6aee('0x34')](_0x15e0db[_0x6aee('0x41')]({'attributes':['id',_0x6aee('0x5')]}));_0xe7f369['push'](_0x15e0db[_0x6aee('0x42')]({'attributes':['id',_0x6aee('0x5')]}));_0xe7f369['push'](_0x15e0db['getSmsQueues']({'attributes':['id',_0x6aee('0x5')]}));_0xe7f369[_0x6aee('0x34')](_0x15e0db['getMailQueues']({'attributes':['id',_0x6aee('0x5')]}));_0xe7f369['push'](_0x15e0db[_0x6aee('0x43')]({'attributes':['id',_0x6aee('0x5')]}));_0xe7f369[_0x6aee('0x34')](_0x15e0db[_0x6aee('0x44')]({'attributes':['id','name']}));break;}return BPromise['all'](_0xe7f369);}})[_0x6aee('0xd')](function(_0x320581){if(_0x320581&&_0x320581[_0x6aee('0x1f')]){for(var _0x9a9c20=0x0;_0x9a9c20<_0x320581['length'];_0x9a9c20+=0x1){for(var _0x2c5c8b=0x0;_0x2c5c8b<_0x320581[_0x9a9c20]['length'];_0x2c5c8b+=0x1){switch(_0x9a9c20){case 0x0:joinOrLeaveQueues(_0xc458e7,_0x1ffa47,_0x6aee('0x45'),_0x320581[_0x9a9c20][_0x2c5c8b]);break;case 0x1:joinOrLeaveQueues(_0xc458e7,_0x1ffa47,_0x6aee('0x46'),_0x320581[_0x9a9c20][_0x2c5c8b]);break;case 0x2:joinOrLeaveQueues(_0xc458e7,_0x1ffa47,_0x6aee('0x47'),_0x320581[_0x9a9c20][_0x2c5c8b]);break;case 0x3:joinOrLeaveQueues(_0xc458e7,_0x1ffa47,_0x6aee('0x48'),_0x320581[_0x9a9c20][_0x2c5c8b]);break;case 0x4:joinOrLeaveQueues(_0xc458e7,_0x1ffa47,'mail',_0x320581[_0x9a9c20][_0x2c5c8b]);break;case 0x5:joinOrLeaveQueues(_0xc458e7,_0x1ffa47,_0x6aee('0x49'),_0x320581[_0x9a9c20][_0x2c5c8b]);break;case 0x6:joinOrLeaveQueues(_0xc458e7,_0x1ffa47,_0x6aee('0x4a'),_0x320581[_0x9a9c20][_0x2c5c8b]);break;case 0x7:if(_0xc1b66c[_0x6aee('0x7')]!==_0x6aee('0x9'))_0xc458e7[_0x1ffa47](util[_0x6aee('0x1d')](_0x6aee('0x4b'),_0x320581[_0x9a9c20][_0x2c5c8b][_0x6aee('0x5')]));break;case 0x8:if(_0xc1b66c[_0x6aee('0x7')]!=='agent')_0xc458e7[_0x1ffa47](util[_0x6aee('0x1d')](_0x6aee('0x4c'),_0x320581[_0x9a9c20][_0x2c5c8b]['name']));break;case 0x9:if(_0xc1b66c[_0x6aee('0x7')]!==_0x6aee('0x9'))_0xc458e7[_0x1ffa47](util[_0x6aee('0x1d')](_0x6aee('0x4d'),_0x320581[_0x9a9c20][_0x2c5c8b]['type'],_0x320581[_0x9a9c20][_0x2c5c8b]['name']));break;case 0xa:_0xc458e7[_0x1ffa47](util[_0x6aee('0x1d')](_0x6aee('0x20'),_0x320581[_0x9a9c20][_0x2c5c8b][_0x6aee('0x5')]));break;}}}}})[_0x6aee('0xd')](function(){if(_0x1ffa47==='leave'){var _0x118538=_['map'](_0xc1b66c[_0x6aee('0x25')],'id');return _0xc1b66c['removeChatInteractions'](_0x118538)[_0x6aee('0xd')](function(){for(var _0x1c3b02=0x0;_0x1c3b02<_0x118538[_0x6aee('0x1f')];_0x1c3b02+=0x1){_0x57b997[_0x6aee('0x4e')](_0x6aee('0x4f'),{'ChatInteractionId':Number(_0x118538[_0x1c3b02]),'UserId':Number(_0xc1b66c['id'])});}});}})[_0x6aee('0xd')](function(){if(_0x1ffa47===_0x6aee('0x50')){var _0x3a3bdb=_[_0x6aee('0x19')](_0xc1b66c[_0x6aee('0x27')],'id');return _0xc1b66c['removeMailInteractions'](_0x3a3bdb)[_0x6aee('0xd')](function(){for(var _0x2356ea=0x0;_0x2356ea<_0x3a3bdb[_0x6aee('0x1f')];_0x2356ea+=0x1){_0x57b997[_0x6aee('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x3a3bdb[_0x2356ea]),'UserId':Number(_0xc1b66c['id'])});}});}})['then'](function(){if(_0x1ffa47===_0x6aee('0x50')){var _0x5177f9=_[_0x6aee('0x19')](_0xc1b66c['FaxInteractions'],'id');return _0xc1b66c[_0x6aee('0x51')](_0x5177f9)[_0x6aee('0xd')](function(){for(var _0x106e95=0x0;_0x106e95<_0x5177f9['length'];_0x106e95+=0x1){_0x57b997['emit'](_0x6aee('0x52'),{'FaxInteractionId':Number(_0x5177f9[_0x106e95]),'UserId':Number(_0xc1b66c['id'])});}});}})['then'](function(){if(_0x1ffa47==='leave'){var _0x16d437=_[_0x6aee('0x19')](_0xc1b66c[_0x6aee('0x2b')],'id');return _0xc1b66c[_0x6aee('0x53')](_0x16d437)[_0x6aee('0xd')](function(){for(var _0x2172fe=0x0;_0x2172fe<_0x16d437[_0x6aee('0x1f')];_0x2172fe+=0x1){_0x57b997[_0x6aee('0x4e')](_0x6aee('0x54'),{'SmsInteractionId':Number(_0x16d437[_0x2172fe]),'UserId':Number(_0xc1b66c['id'])});}});}})['then'](function(){if(_0x1ffa47===_0x6aee('0x50')){var _0x2e4021=_[_0x6aee('0x19')](_0xc1b66c[_0x6aee('0x2d')],'id');return _0xc1b66c[_0x6aee('0x55')](_0x2e4021)[_0x6aee('0xd')](function(){for(var _0x235bfc=0x0;_0x235bfc<_0x2e4021[_0x6aee('0x1f')];_0x235bfc+=0x1){_0x57b997[_0x6aee('0x4e')](_0x6aee('0x56'),{'OpenchannelInteractionId':Number(_0x2e4021[_0x235bfc]),'UserId':Number(_0xc1b66c['id'])});}});}})[_0x6aee('0xd')](function(){if(_0x1ffa47==='leave'){var _0x1a228c=_[_0x6aee('0x19')](_0xc1b66c[_0x6aee('0x2f')],'id');return _0xc1b66c[_0x6aee('0x57')](_0x1a228c)[_0x6aee('0xd')](function(){for(var _0x238890=0x0;_0x238890<_0x1a228c[_0x6aee('0x1f')];_0x238890+=0x1){_0x57b997[_0x6aee('0x4e')](_0x6aee('0x58'),{'WhatsappInteractionId':Number(_0x1a228c[_0x238890]),'UserId':Number(_0xc1b66c['id'])});}});}})[_0x6aee('0x59')](function(_0x22300e){_0xc458e7[_0x6aee('0x5a')](_0x22300e);});}}function onDisconnect(_0x5271dd,_0x5cd73d){joinOrLeave(_0x5271dd,_0x6aee('0x50'),_0x5cd73d);}function onConnect(_0x27080f){joinOrLeave(_0x27080f,'join');}exports[_0x6aee('0x5b')]=function(_0x32e7e6){_0x32e7e6['on'](_0x6aee('0x5c'),function(_0x2cda38){_0x2cda38[_0x6aee('0x5d')](0x0);_0x2cda38[_0x6aee('0x5e')]=_0x2cda38['request']['connection'][_0x6aee('0x5f')]+':'+_0x2cda38[_0x6aee('0x60')][_0x6aee('0x5c')][_0x6aee('0x61')];_0x2cda38['connectedAt']=new Date();_0x2cda38[_0x6aee('0x5a')]=function(_0x2e83e8){console[_0x6aee('0x5a')](_0x6aee('0x62')+_0x2cda38[_0x6aee('0x63')][_0x6aee('0x5')]+'['+_0x2cda38[_0x6aee('0x5e')]+']',_0x2e83e8);};_0x2cda38['on']('disconnect',function(){onDisconnect(_0x2cda38,_0x32e7e6);_0x2cda38[_0x6aee('0x5a')](_0x6aee('0x64'));});onConnect(_0x2cda38);_0x2cda38['log'](_0x6aee('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a5795a6..5122bc2 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 _0xbfa4=['SmsInteraction','closedinteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','EventManager','info','error','Trigger,\x20%s','catch','get','motionChannel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','then','contact','UserId','User','find','name','email','internal','interface','format','SIP/%s','channel','agent','incomingmessage','opened','ContactId','query','closed','changed','substatus','fullname','default','length','model','hook','toLowerCase','util','../../mysqldb','jayson/promise','../logger','triggers','lodash','client','afterCreate','newinteraction','Chat','afterUpdate','ChatMessage','newmessage','Sms'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xbfa4,0x76));var _0x4bfa=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xbfa4[_0xbe200f];return _0x192597;};'use strict';var util=require(_0x4bfa('0x0'));var db=require(_0x4bfa('0x1'))['db'];var jayson=require(_0x4bfa('0x2'));var logger=require(_0x4bfa('0x3'))(_0x4bfa('0x4'));var _=require(_0x4bfa('0x5'));var client=jayson[_0x4bfa('0x6')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0x4bfa('0x7'),'condition':_0x4bfa('0x8'),'callback':afterCreate},{'channel':_0x4bfa('0x9'),'model':'ChatInteraction','event':_0x4bfa('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':_0x4bfa('0xb'),'event':_0x4bfa('0x7'),'condition':_0x4bfa('0xc'),'callback':afterCreateMessage},{'channel':_0x4bfa('0xd'),'model':'SmsInteraction','event':_0x4bfa('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4bfa('0xd'),'model':_0x4bfa('0xe'),'event':_0x4bfa('0xa'),'condition':_0x4bfa('0xf'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x4bfa('0x7'),'condition':_0x4bfa('0xc'),'callback':afterCreateMessage},{'channel':_0x4bfa('0x10'),'model':_0x4bfa('0x11'),'event':_0x4bfa('0x7'),'condition':_0x4bfa('0x8'),'callback':afterCreate},{'channel':_0x4bfa('0x10'),'model':_0x4bfa('0x11'),'event':_0x4bfa('0xa'),'condition':_0x4bfa('0xf'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x4bfa('0x12'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0x4bfa('0x13'),'event':_0x4bfa('0x7'),'condition':_0x4bfa('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0x4bfa('0x13'),'event':_0x4bfa('0xa'),'condition':_0x4bfa('0xf'),'callback':afterUpdate},{'channel':_0x4bfa('0x14'),'model':_0x4bfa('0x15'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4bfa('0x16'),'model':_0x4bfa('0x17'),'event':_0x4bfa('0x7'),'condition':_0x4bfa('0x8'),'callback':afterCreate},{'channel':_0x4bfa('0x16'),'model':_0x4bfa('0x17'),'event':'afterUpdate','condition':_0x4bfa('0xf'),'callback':afterUpdate},{'channel':'Mail','model':_0x4bfa('0x18'),'event':_0x4bfa('0x7'),'condition':_0x4bfa('0xc'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x4bfa('0x19'),'event':_0x4bfa('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4bfa('0x1a'),'model':_0x4bfa('0x19'),'event':'afterUpdate','condition':_0x4bfa('0xf'),'callback':afterUpdate},{'channel':_0x4bfa('0x1a'),'model':'OpenchannelMessage','event':_0x4bfa('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x371421){return client['request'](_0x4bfa('0x1b'),_0x371421)['then'](function(_0xd99515){logger[_0x4bfa('0x1c')]('Trigger,\x20%s',_0x4bfa('0x1b'),_0xd99515);if(_0xd99515[_0x4bfa('0x1d')]){if(_0xd99515[_0x4bfa('0x1d')]['code']===0x1f4){logger[_0x4bfa('0x1d')](_0x4bfa('0x1e'),_0x4bfa('0x1b'),_0xd99515[_0x4bfa('0x1d')]);}}})[_0x4bfa('0x1f')](function(_0x224f7a){logger[_0x4bfa('0x1d')](_0x4bfa('0x1e'),_0x4bfa('0x1b'),_0x224f7a);});}function afterCreateMessage(_0x5f208a,_0x2f69e4){return function(_0x24e27e,_0x2c2027){_0x24e27e=_0x24e27e[_0x4bfa('0x20')]({'plain':!![]});_0x24e27e['channel']=_0x5f208a;_0x24e27e[_0x4bfa('0x21')]=_0x5f208a;_0x24e27e[_0x4bfa('0x22')]=_0x24e27e['direction'];var _0x9a507a=_0x4bfa('0x23')+_0x24e27e['ContactId'];return db[_0x4bfa('0x24')]['query'](_0x9a507a,{'type':db[_0x4bfa('0x25')][_0x4bfa('0x26')][_0x4bfa('0x27')],'raw':!![]})[_0x4bfa('0x28')](function(_0x5f34f2){return _0x5f34f2;})[_0x4bfa('0x28')](function(_0x4c51c9){if(_0x4c51c9){_0x24e27e[_0x4bfa('0x29')]=_0x4c51c9[0x0];}if(_0x24e27e[_0x4bfa('0x2a')]){return db[_0x4bfa('0x2b')][_0x4bfa('0x2c')]({'where':{'id':_0x24e27e[_0x4bfa('0x2a')]},'attributes':['id',_0x4bfa('0x2d'),'fullname',_0x4bfa('0x2e'),_0x4bfa('0x2f')],'raw':!![]})['then'](function(_0xfd8f55){_0x24e27e[_0x4bfa('0x30')]=util[_0x4bfa('0x31')](_0x4bfa('0x32'),_0xfd8f55[_0x4bfa('0x2d')]);_0x24e27e[_0x4bfa('0x33')]=_0x5f208a;_0x24e27e[_0x4bfa('0x34')]=_0xfd8f55;return request({'event':_0x4bfa('0x35'),'message':_0x24e27e});})[_0x4bfa('0x1f')](function(_0x54bcc9){console[_0x4bfa('0x1d')](_0x54bcc9);});}else{return request({'event':'outgoingmessage','message':_0x24e27e});}});};}function afterCreate(_0x5eceac,_0x343754){return function(_0x5b6092,_0x3cee01){_0x5b6092=_0x5b6092[_0x4bfa('0x20')]({'plain':!![]});_0x5b6092['channel']=_0x5eceac;_0x5b6092[_0x4bfa('0x21')]=_0x5eceac;_0x5b6092['event']=_0x4bfa('0x36');var _0x39f7f8=_0x4bfa('0x23')+_0x5b6092[_0x4bfa('0x37')];return db['sequelize'][_0x4bfa('0x38')](_0x39f7f8,{'type':db['Sequelize'][_0x4bfa('0x26')][_0x4bfa('0x27')],'raw':!![]})[_0x4bfa('0x28')](function(_0x19c566){return _0x19c566;})[_0x4bfa('0x28')](function(_0x510def){if(_0x510def){_0x5b6092['contact']=_0x510def[0x0];}return request({'event':_0x343754,'message':_0x5b6092});});};}function afterUpdate(_0x212249){return function(_0x9f03ba){var _0x1ef345=_0x9f03ba['changed'](_0x4bfa('0x39'))&&_0x9f03ba[_0x4bfa('0x39')];var _0xcabeef=_0x9f03ba[_0x4bfa('0x3a')](_0x4bfa('0x3b'));if(_0x1ef345||_0xcabeef){var _0x40dcad=_0x1ef345?_0x4bfa('0xf'):'substatus';var _0x39c6b9=_0x39c6b9[_0x4bfa('0x20')]({'plain':!![]});_0x39c6b9[_0x4bfa('0x33')]=_0x212249;_0x39c6b9['motionChannel']=_0x212249;_0x39c6b9[_0x4bfa('0x22')]=_0x1ef345?_0x4bfa('0x39'):_0x4bfa('0x3b');var _0x4d0bae='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x39c6b9['ContactId'];return db[_0x4bfa('0x24')][_0x4bfa('0x38')](_0x4d0bae,{'type':db['Sequelize'][_0x4bfa('0x26')][_0x4bfa('0x27')],'raw':!![]})[_0x4bfa('0x28')](function(_0x5a678f){if(_0x5a678f){_0x39c6b9[_0x4bfa('0x29')]=_0x5a678f[0x0];}if(_0x39c6b9[_0x4bfa('0x2a')]){return db['User'][_0x4bfa('0x2c')]({'where':{'id':_0x39c6b9['UserId']},'attributes':['id',_0x4bfa('0x2d'),_0x4bfa('0x3c'),_0x4bfa('0x2e'),_0x4bfa('0x2f')],'raw':!![]})[_0x4bfa('0x28')](function(_0xf3626){_0x39c6b9[_0x4bfa('0x30')]=util[_0x4bfa('0x31')](_0x4bfa('0x32'),_0xf3626[_0x4bfa('0x2d')]);_0x39c6b9[_0x4bfa('0x34')]=_0xf3626;return request({'event':_0x40dcad,'message':_0x39c6b9});})[_0x4bfa('0x1f')](function(_0x15bebe){console['error'](_0x15bebe);});}else{return request({'event':_0x40dcad,'message':_0x39c6b9});}});}};}exports[_0x4bfa('0x3d')]=function(){for(var _0x5e95e4=0x0;_0x5e95e4=_0x4436fa['agents']){throw Error(_0xec2d('0x18'));}_0x4e3aa9(_0x20c7c2);})[_0xec2d('0x19')](function(_0xeb1cd8){_0x316f26(_0xeb1cd8);});});}; \ No newline at end of file +var _0xfdc9=['sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb'];(function(_0x4b1a60,_0x425725){var _0x17fb9b=function(_0x5a05e9){while(--_0x5a05e9){_0x4b1a60['push'](_0x4b1a60['shift']());}};_0x17fb9b(++_0x425725);}(_0xfdc9,0xc6));var _0x9fdc=function(_0x2df0a4,_0x2613ba){_0x2df0a4=_0x2df0a4-0x0;var _0x4b3409=_0xfdc9[_0x2df0a4];return _0x4b3409;};'use strict';var _=require(_0x9fdc('0x0'));var BPromise=require('bluebird');var db=require(_0x9fdc('0x1'))['db'];var util=require('./license/util');var channels=['voice','mail','chat','fax',_0x9fdc('0x2'),_0x9fdc('0x3'),_0x9fdc('0x4')];exports[_0x9fdc('0x5')]=function(){return channels;};exports[_0x9fdc('0x6')]=function(_0x4797da){_0x4797da=_0x4797da[_0x9fdc('0x7')]();return _[_0x9fdc('0x8')](channels,_0x4797da);};exports[_0x9fdc('0x9')]=function(_0x4a2e5f,_0x3b7290,_0x32c77c,_0x5a8121){var _0x29c135={'loginAttempts':_0x3b7290,'blocked':_0x32c77c};if(!_['isUndefined'](_0x5a8121)){_0x29c135[_0x9fdc('0xa')]=_0x5a8121;}return _0x4a2e5f[_0x9fdc('0xb')](_0x29c135);};exports[_0x9fdc('0xc')]=function(_0x4602dc){return new BPromise(function(_0x389c25,_0x243c88){var _0x49a2fc=0x0;if(_0x4602dc['role']!==_0x9fdc('0xd')){_0x389c25(_0x4602dc);}db[_0x9fdc('0xe')][_0x9fdc('0xf')]({'where':{'role':_0x9fdc('0xd'),'online':!![],'id':{'$ne':_0x4602dc['id']}}})[_0x9fdc('0x10')](function(_0x5177c2){_0x49a2fc=_0x5177c2;return util[_0x9fdc('0xc')]();})[_0x9fdc('0x10')](function(_0x3cb354){if(_0x3cb354&&_0x3cb354[_0x9fdc('0x11')]&&_0x49a2fc>=_0x3cb354[_0x9fdc('0x11')]){throw Error(_0x9fdc('0x12'));}_0x389c25(_0x4602dc);})[_0x9fdc('0x13')](function(_0x5826aa){_0x243c88(_0x5826aa);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 8f33834..557d2d4 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98e7=['404','status','render','json','send'];(function(_0x41a654,_0x44742a){var _0x222eca=function(_0x46d0bb){while(--_0x46d0bb){_0x41a654['push'](_0x41a654['shift']());}};_0x222eca(++_0x44742a);}(_0x98e7,0x1c2));var _0x798e=function(_0x7ec78e,_0x31931f){_0x7ec78e=_0x7ec78e-0x0;var _0x3ab195=_0x98e7[_0x7ec78e];return _0x3ab195;};'use strict';module['exports'][0x194]=function pageNotFound(_0x103176,_0x3a3b70){var _0x221342=_0x798e('0x0');var _0x320e4d=0x194;var _0x1571c4={'status':_0x320e4d};_0x3a3b70[_0x798e('0x1')](_0x1571c4['status']);_0x3a3b70[_0x798e('0x2')](_0x221342,{},function(_0x5b0363,_0x2e49cf){if(_0x5b0363){return _0x3a3b70[_0x798e('0x1')](_0x1571c4[_0x798e('0x1')])[_0x798e('0x3')](_0x1571c4);}_0x3a3b70[_0x798e('0x4')](_0x2e49cf);});}; \ No newline at end of file +var _0x594d=['json','send','exports','404','status','render'];(function(_0xa3a010,_0x268bec){var _0x5c7fa0=function(_0x207747){while(--_0x207747){_0xa3a010['push'](_0xa3a010['shift']());}};_0x5c7fa0(++_0x268bec);}(_0x594d,0x92));var _0xd594=function(_0x34e171,_0xa5938b){_0x34e171=_0x34e171-0x0;var _0x5b1afe=_0x594d[_0x34e171];return _0x5b1afe;};'use strict';module[_0xd594('0x0')][0x194]=function pageNotFound(_0x4d8fb7,_0x4a7d4b){var _0x22a505=_0xd594('0x1');var _0x389d7f=0x194;var _0x496b6a={'status':_0x389d7f};_0x4a7d4b[_0xd594('0x2')](_0x496b6a[_0xd594('0x2')]);_0x4a7d4b[_0xd594('0x3')](_0x22a505,{},function(_0x7f4ec6,_0x5f056d){if(_0x7f4ec6){return _0x4a7d4b[_0xd594('0x2')](_0x496b6a['status'])[_0xd594('0x4')](_0x496b6a);}_0x4a7d4b[_0xd594('0x5')](_0x5f056d);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 647061c..c0c8967 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteraction','belongsTo','UserProfile','belongsToMany','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','VoiceQueueId','CmHopper','Hoppers','HopperHistories','CmHopperBlack','JscriptySessions','TrunkId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Disposition','Dispositions','Interactions','List','ListId','Template','mandatoryDispositionPause','Agents','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','restrict','IntervalId','TagId','Items','FaxAccountId','Answers','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteraction','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','ProactiveActions','Agent','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_user_has_contacts','cm_contact_has_tags','Queue','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','Action','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','DeskField','int_desk_configuration_has_tags','ZohoField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','ServicenowField','Dynamics365Field','FromId','ToId','ProjectId','VoiceQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','TrunkBackup','TrunkBackupId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappMessage','user_has_whatsapp_accounts','WhatsappInteractionId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','mysql','name','utf8_general_ci','sequelizeHistory','utf8mb4','utf8','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Automation','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount'];(function(_0x2a086e,_0x304033){var _0x1ff462=function(_0x1220a8){while(--_0x1220a8){_0x2a086e['push'](_0x2a086e['shift']());}};_0x1ff462(++_0x304033);}(_0xac4a,0x13f));var _0xaac4=function(_0x3cd918,_0x549736){_0x3cd918=_0x3cd918-0x0;var _0x1aa722=_0xac4a[_0x3cd918];return _0x1aa722;};'use strict';var config=require(_0xaac4('0x0'));var Sequelize=require(_0xaac4('0x1'));var _=require(_0xaac4('0x2'));var jstz=require(_0xaac4('0x3'));var timezone=jstz[_0xaac4('0x4')]();config[_0xaac4('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0xaac4('0x5'),'username':_0xaac4('0x6'),'password':_0xaac4('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xaac4('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xaac4('0x9')](),'define':{'charset':'utf8','collate':_0xaac4('0xa')}}});config[_0xaac4('0xb')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xaac4('0x5'),'username':'xcall','password':_0xaac4('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xaac4('0xc')},'logging':![],'timezone':timezone[_0xaac4('0x9')](),'define':{'charset':_0xaac4('0xd'),'collate':_0xaac4('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xaac4('0x1')]['database'],config['sequelize'][_0xaac4('0xe')],config[_0xaac4('0x1')][_0xaac4('0xf')],config['sequelize'][_0xaac4('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xaac4('0xb')]['database'],config[_0xaac4('0xb')][_0xaac4('0xe')],config[_0xaac4('0xb')][_0xaac4('0xf')],config[_0xaac4('0xb')][_0xaac4('0x10')])};db[_0xaac4('0x11')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x13'));db[_0xaac4('0x14')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xaac4('0x15')]=db['sequelize'][_0xaac4('0x12')]('../api/voiceContext/voiceContext.model');db[_0xaac4('0x16')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x17'));db[_0xaac4('0x18')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x19'));db[_0xaac4('0x1a')]=db['sequelize'][_0xaac4('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0xaac4('0x1b')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x1c'));db[_0xaac4('0x1d')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x1e'));db[_0xaac4('0x1f')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x20'));db[_0xaac4('0x21')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x22'));db['VoiceCallReport']=db['sequelize']['import']('../api/voiceCallReport/voiceCallReport.model');db[_0xaac4('0x23')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x24'));db[_0xaac4('0x25')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x26'));db[_0xaac4('0x27')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x28'));db[_0xaac4('0x29')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x2a'));db[_0xaac4('0x2b')]=db['sequelize'][_0xaac4('0x12')]('../api/trunk/trunk.model');db[_0xaac4('0x2c')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x2d'));db['UserVoiceQueueRt']=db['sequelize']['import'](_0xaac4('0x2e'));db[_0xaac4('0x2f')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x30'));db[_0xaac4('0x31')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x32'));db[_0xaac4('0x33')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x34'));db[_0xaac4('0x35')]=db[_0xaac4('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0xaac4('0x36')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0xaac4('0x37')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x38'));db[_0xaac4('0x39')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xaac4('0x3a')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/mailServerIn/mailServerIn.model');db[_0xaac4('0x3b')]=db['sequelize']['import'](_0xaac4('0x3c'));db[_0xaac4('0x3d')]=db[_0xaac4('0x1')]['import']('../api/mailAccount/mailAccount.model');db[_0xaac4('0x3e')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x3f'));db[_0xaac4('0x40')]=db[_0xaac4('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0xaac4('0x41')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x42'));db[_0xaac4('0x43')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x44'));db[_0xaac4('0x45')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x46'));db[_0xaac4('0x47')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/mailQueueReport/mailQueueReport.model');db[_0xaac4('0x48')]=db['sequelize']['import'](_0xaac4('0x49'));db[_0xaac4('0x4a')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x4b'));db[_0xaac4('0x4c')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/faxAccount/faxAccount.model');db[_0xaac4('0x4d')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x4e'));db['FaxInteraction']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x4f'));db['FaxMessage']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x50'));db[_0xaac4('0x51')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x52'));db[_0xaac4('0x53')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x54'));db[_0xaac4('0x55')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x56'));db[_0xaac4('0x57')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/smsApplication/smsApplication.model');db[_0xaac4('0x58')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x59'));db[_0xaac4('0x5a')]=db['sequelize']['import'](_0xaac4('0x5b'));db[_0xaac4('0x5c')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/smsQueue/smsQueue.model');db[_0xaac4('0x5d')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x5e'));db['OpenchannelApplication']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x5f'));db['OpenchannelInteraction']=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x60'));db[_0xaac4('0x61')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x62'));db['OpenchannelQueue']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x63'));db[_0xaac4('0x64')]=db['sequelize'][_0xaac4('0x12')]('../api/chatWebsite/chatWebsite.model');db[_0xaac4('0x65')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x66'));db[_0xaac4('0x67')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x68'));db[_0xaac4('0x69')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x6a'));db[_0xaac4('0x6b')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x6c'));db[_0xaac4('0x6d')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x6e'));db[_0xaac4('0x6f')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/chatQueue/chatQueue.model');db[_0xaac4('0x70')]=db['sequelize'][_0xaac4('0x12')]('../api/chatGroup/chatGroup.model');db[_0xaac4('0x71')]=db['sequelize']['import'](_0xaac4('0x72'));db[_0xaac4('0x73')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x74'));db[_0xaac4('0x75')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x76'));db['CmHopper']=db[_0xaac4('0x1')]['import'](_0xaac4('0x77'));db['CmHopperBlack']=db['sequelize']['import'](_0xaac4('0x78'));db[_0xaac4('0x79')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xaac4('0x7a')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xaac4('0x7b')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x7c'));db[_0xaac4('0x7d')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xaac4('0x1')]['import']('../api/action/action.model');db[_0xaac4('0x7e')]=db['sequelize'][_0xaac4('0x12')]('../api/automation/automation.model');db[_0xaac4('0x7f')]=db[_0xaac4('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x80'));db[_0xaac4('0x81')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x82'));db[_0xaac4('0x83')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x84'));db[_0xaac4('0x85')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x86'));db[_0xaac4('0x87')]=db[_0xaac4('0x1')]['import']('../api/cdr/cdr.model');db[_0xaac4('0x88')]=db['sequelize']['import'](_0xaac4('0x89'));db['Schedule']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x8a'));db[_0xaac4('0x8b')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x8c'));db[_0xaac4('0x8d')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x8e'));db['Template']=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/template/template.model');db[_0xaac4('0x8f')]=db[_0xaac4('0x1')]['import']('../api/trigger/trigger.model');db[_0xaac4('0x90')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x91'));db[_0xaac4('0x92')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x93'));db['IntegrationReport']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x94'));db[_0xaac4('0x95')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xaac4('0x96')]=db[_0xaac4('0x1')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0xaac4('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import'](_0xaac4('0x97'));db[_0xaac4('0x98')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xaac4('0x99')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x9a'));db[_0xaac4('0x9b')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xaac4('0x9c')]=db['sequelize']['import'](_0xaac4('0x9d'));db[_0xaac4('0x9e')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x9f'));db[_0xaac4('0xa0')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa1'));db[_0xaac4('0xa2')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa3'));db[_0xaac4('0xa4')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa5'));db[_0xaac4('0xa6')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa7'));db[_0xaac4('0xa8')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa9'));db['DeskField']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xaa'));db[_0xaac4('0xab')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xac'));db[_0xaac4('0xad')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xae'));db['ZohoField']=db[_0xaac4('0x1')]['import'](_0xaac4('0xaf'));db[_0xaac4('0xb0')]=db['sequelize'][_0xaac4('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xaac4('0xb1')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xb2'));db[_0xaac4('0xb3')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xb4'));db[_0xaac4('0xb5')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xb6'));db[_0xaac4('0xb7')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xaac4('0xb8')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xaac4('0xb9')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xba'));db[_0xaac4('0xbb')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xbc'));db[_0xaac4('0xbd')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xbe'));db[_0xaac4('0xbf')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xc0'));db['ServicenowConfiguration']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xc1'));db['ServicenowField']=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0xaac4('0xc2')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xc3'));db[_0xaac4('0xc4')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xc5'));db['Dynamics365Field']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xc6'));db[_0xaac4('0xc7')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xc8'));db[_0xaac4('0xc9')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xca'));db[_0xaac4('0xcb')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x93'));db[_0xaac4('0xcc')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xcd'));db[_0xaac4('0xce')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xcf'));db[_0xaac4('0xd0')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xd1'));db[_0xaac4('0xd2')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xaac4('0xd3')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xd4'));db[_0xaac4('0xd5')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xaac4('0xd6')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xd7'));db[_0xaac4('0xd8')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xd9'));db['SquareDetailsReport']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xda'));db[_0xaac4('0xdb')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xdc'));db[_0xaac4('0xdd')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/setting/setting.model');db['SquareOdbc']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xde'));db[_0xaac4('0xdf')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xe0'));db[_0xaac4('0xe1')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xe2'));db[_0xaac4('0xe3')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xe4'));db[_0xaac4('0xe5')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xe6'));db[_0xaac4('0xe7')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xe8'));db[_0xaac4('0xe9')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xea'));db[_0xaac4('0xeb')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xec'));db[_0xaac4('0xed')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xee'));db[_0xaac4('0xef')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xf0'));db[_0xaac4('0xf1')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xf2'));db[_0xaac4('0xf3')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xf4'));db[_0xaac4('0xf5')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xf6'));db[_0xaac4('0xf7')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xf8'));db[_0xaac4('0xf9')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xfa'));db[_0xaac4('0xfb')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xfc'));db[_0xaac4('0xfd')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xfe'));db['UserProfile']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xff'));db[_0xaac4('0x100')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x101'));db[_0xaac4('0x102')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x103'));db[_0xaac4('0x104')]=db['sequelize']['import'](_0xaac4('0x105'));db[_0xaac4('0x106')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x107'));db[_0xaac4('0x108')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x109'));db['WhatsappInteraction']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x10a'));db['WhatsappMessage']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x10b'));db[_0xaac4('0x10c')]=db['sequelize']['import'](_0xaac4('0x10d'));db[_0xaac4('0x10e')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x10f'));db[_0xaac4('0x110')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x111'));db['CloudProvider']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x112'));db[_0xaac4('0x113')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x114'));db['TeamVoicePrefix']=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x115'));db[_0xaac4('0x11')][_0xaac4('0x116')](db[_0xaac4('0x1f')],{'as':_0xaac4('0x1f'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x1b')],{'as':_0xaac4('0x11a'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')]['hasMany'](db[_0xaac4('0x11b')],{'as':'VoiceQueuesRt','foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db['VoiceExtension'],{'as':_0xaac4('0x11c'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db[_0xaac4('0x11')][_0xaac4('0x119')](db['CmHopperFinal'],{'as':_0xaac4('0x11d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x7a')],{'as':_0xaac4('0x11e'),'foreignKey':'UserId'});db[_0xaac4('0x11')][_0xaac4('0x119')](db['ReportAgentPreview'],{'as':_0xaac4('0x7b'),'foreignKey':_0xaac4('0x118')});db['User']['hasMany'](db['OpenchannelInteraction'],{'as':_0xaac4('0x11f'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')]['hasMany'](db[_0xaac4('0x69')],{'as':'ChatInteractions','foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x58')],{'as':_0xaac4('0x120'),'foreignKey':'UserId'});db[_0xaac4('0x11')]['hasMany'](db[_0xaac4('0x121')],{'as':_0xaac4('0x122'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x41')],{'as':_0xaac4('0x123'),'foreignKey':'UserId'});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x124')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x104')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0xaac4('0x125')](db[_0xaac4('0x126')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xaac4('0x11')][_0xaac4('0x127')](db['ChatGroup'],{'as':'Groups','through':_0xaac4('0x128')});db[_0xaac4('0x11')]['belongsToMany'](db[_0xaac4('0x75')],{'as':_0xaac4('0x129'),'through':'cm_user_has_contacts'});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x12a'),'through':_0xaac4('0x12b')});db[_0xaac4('0x11')]['belongsToMany'](db['Team'],{'through':'user_has_teams'});db[_0xaac4('0x11')]['belongsToMany'](db[_0xaac4('0x41')],{'as':'MailInteractions','through':_0xaac4('0x12c')});db['User'][_0xaac4('0x127')](db[_0xaac4('0x69')],{'as':'ChatInteractions','through':_0xaac4('0x12d')});db['User'][_0xaac4('0x127')](db['FaxInteraction'],{'as':_0xaac4('0x122'),'through':_0xaac4('0x12e')});db['User'][_0xaac4('0x127')](db[_0xaac4('0x58')],{'as':_0xaac4('0x120'),'through':_0xaac4('0x12f')});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0xaac4('0x130')});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x124')],{'as':_0xaac4('0x131'),'through':_0xaac4('0x132')});db[_0xaac4('0x11')]['belongsToMany'](db[_0xaac4('0x1a')],{'as':'VoiceQueues','through':_0xaac4('0x2f'),'required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0xfd')],{'as':_0xaac4('0x133'),'through':_0xaac4('0x134'),'required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x3e')],{'as':_0xaac4('0x135'),'through':'UserMailQueue','required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x6f')],{'as':_0xaac4('0x136'),'through':_0xaac4('0x31'),'required':![],'hooks':!![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db['FaxQueue'],{'as':_0xaac4('0x137'),'through':_0xaac4('0x35'),'required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x5c')],{'as':_0xaac4('0x138'),'through':_0xaac4('0x36'),'required':![]});db['User'][_0xaac4('0x127')](db[_0xaac4('0x139')],{'as':_0xaac4('0x13a'),'through':_0xaac4('0x37'),'required':![]});db[_0xaac4('0x11')]['belongsToMany'](db['WhatsappQueue'],{'as':_0xaac4('0x13b'),'through':_0xaac4('0x39'),'required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'through':_0xaac4('0x12b')});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x64')],{'as':_0xaac4('0x13c'),'through':_0xaac4('0x13d')});db['User'][_0xaac4('0x127')](db['FaxAccount'],{'as':'FaxAccounts','through':_0xaac4('0x13e')});db['User'][_0xaac4('0x127')](db[_0xaac4('0x3d')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x5d')],{'as':_0xaac4('0x13f'),'through':_0xaac4('0x140')});db[_0xaac4('0x11')][_0xaac4('0x127')](db['SmsAccount'],{'as':_0xaac4('0x141'),'through':_0xaac4('0x142')});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x106')],{'as':_0xaac4('0x143'),'through':'user_has_whatsapp_accounts'});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0xdf')],{'as':_0xaac4('0x144'),'through':_0xaac4('0x145')});db[_0xaac4('0x14')]['hasMany'](db[_0xaac4('0x16')],{'as':_0xaac4('0x146'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x147')});db['VoiceContext'][_0xaac4('0x119')](db[_0xaac4('0x16')],{'onDelete':_0xaac4('0x117')});db[_0xaac4('0x16')][_0xaac4('0x119')](db[_0xaac4('0x16')],{'as':_0xaac4('0x148'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x18')][_0xaac4('0x127')](db['Sound'],{'as':'Sounds','through':_0xaac4('0x149')});db[_0xaac4('0x1a')][_0xaac4('0x119')](db[_0xaac4('0x11b')],{'as':'Members','foreignKey':_0xaac4('0x14a')});db['VoiceQueue']['hasMany'](db[_0xaac4('0x14b')],{'as':_0xaac4('0x14c'),'foreignKey':_0xaac4('0x14a')});db[_0xaac4('0x1a')]['hasMany'](db[_0xaac4('0x79')],{'as':_0xaac4('0x11d'),'foreignKey':'VoiceQueueId'});db[_0xaac4('0x1a')][_0xaac4('0x119')](db[_0xaac4('0x7a')],{'as':_0xaac4('0x14d'),'foreignKey':_0xaac4('0x14a')});db['VoiceQueue']['hasMany'](db['ReportAgentPreview'],{'as':_0xaac4('0x7b'),'foreignKey':_0xaac4('0x14a')});db[_0xaac4('0x1a')][_0xaac4('0x119')](db[_0xaac4('0x14e')],{'as':'HopperBlacks','foreignKey':_0xaac4('0x14a')});db[_0xaac4('0x1a')][_0xaac4('0x119')](db[_0xaac4('0xd5')],{'as':_0xaac4('0x14f'),'foreignKey':'VoiceQueueId'});db[_0xaac4('0x1a')][_0xaac4('0x125')](db['Trunk'],{'as':'Trunk','foreignKey':_0xaac4('0x150')});db[_0xaac4('0x1a')][_0xaac4('0x125')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0xaac4('0x125')](db[_0xaac4('0x83')],{'as':_0xaac4('0x83'),'foreignKey':'IntervalId'});db[_0xaac4('0x1a')][_0xaac4('0x125')](db[_0xaac4('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0xaac4('0x151')});db['VoiceQueue'][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x12a'),'through':_0xaac4('0x152')});db[_0xaac4('0x1a')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Agents','through':_0xaac4('0x2f')});db[_0xaac4('0x1a')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'as':_0xaac4('0x153'),'through':_0xaac4('0x113')});db['VoiceQueue'][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x154'),'through':_0xaac4('0x155')});db[_0xaac4('0x1b')]['belongsTo'](db[_0xaac4('0x11')],{'as':'User','foreignKey':_0xaac4('0x118')});db[_0xaac4('0x1d')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x11'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x1f')][_0xaac4('0x119')](db[_0xaac4('0x21')],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':'mailboxuser','sourceKey':_0xaac4('0x157')});db[_0xaac4('0x21')][_0xaac4('0x125')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xaac4('0x157')});db[_0xaac4('0x158')][_0xaac4('0x119')](db['VoiceQueueReport'],{'as':_0xaac4('0x159'),'foreignKey':_0xaac4('0x15a'),'constraints':![]});db[_0xaac4('0x158')][_0xaac4('0x119')](db[_0xaac4('0x25')],{'as':_0xaac4('0x15b'),'foreignKey':_0xaac4('0x15a'),'constraints':![]});db[_0xaac4('0x158')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x11'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x158')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x3a')][_0xaac4('0x125')](db['MailAccount'],{'as':_0xaac4('0x3d'),'foreignKey':_0xaac4('0x15e')});db['MailServerOut'][_0xaac4('0x125')](db['MailAccount'],{'as':_0xaac4('0x3d'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xaac4('0x116')](db[_0xaac4('0x3a')],{'as':_0xaac4('0x15f'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x3d')][_0xaac4('0x116')](db[_0xaac4('0x3b')],{'as':_0xaac4('0x160'),'onDelete':'cascade'});db['MailAccount']['hasMany'](db[_0xaac4('0x161')],{'as':_0xaac4('0x162'),'foreignKey':'MailAccountId','onDelete':_0xaac4('0x117')});db['MailAccount']['hasMany'](db[_0xaac4('0x7f')],{'as':'Answers','foreignKey':_0xaac4('0x15e')});db[_0xaac4('0x3d')][_0xaac4('0x119')](db[_0xaac4('0x43')],{'as':_0xaac4('0x156'),'foreignKey':_0xaac4('0x15e')});db[_0xaac4('0x3d')]['hasMany'](db[_0xaac4('0x41')],{'as':_0xaac4('0x163')});db[_0xaac4('0x3d')][_0xaac4('0x119')](db['MailApplication'],{'as':_0xaac4('0x148')});db[_0xaac4('0x3d')][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x3d')][_0xaac4('0x125')](db['Template'],{'as':_0xaac4('0x166'),'foreignKey':'TemplateId'});db[_0xaac4('0x3d')][_0xaac4('0x125')](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db[_0xaac4('0x3d')][_0xaac4('0x127')](db['User'],{'as':_0xaac4('0x168'),'through':_0xaac4('0x169')});db[_0xaac4('0x3e')]['belongsToMany'](db[_0xaac4('0x11')],{'as':'Agents','through':_0xaac4('0x33')});db[_0xaac4('0x3e')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x16a'),'as':_0xaac4('0x153')});db[_0xaac4('0x41')][_0xaac4('0x119')](db[_0xaac4('0x43')],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x16b')});db[_0xaac4('0x41')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'as':_0xaac4('0x16c'),'foreignKey':'MailAccountId'});db[_0xaac4('0x41')][_0xaac4('0x125')](db['CmContact'],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x41')]['belongsTo'](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':'UserId'});db[_0xaac4('0x41')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x16e'),'as':_0xaac4('0x16f')});db[_0xaac4('0x41')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x16e'),'as':_0xaac4('0x170')});db['MailInteraction'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':_0xaac4('0x12c'),'foreignKey':_0xaac4('0x16b')});db['MailMessage'][_0xaac4('0x119')](db[_0xaac4('0xed')],{'as':_0xaac4('0x172'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x43')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x11')});db[_0xaac4('0x43')]['belongsTo'](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':'Contact'});db[_0xaac4('0x43')]['belongsTo'](db[_0xaac4('0x41')],{'as':_0xaac4('0x173'),'foreignKey':_0xaac4('0x16b')});db[_0xaac4('0x43')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x15e')});db['MailMessage'][_0xaac4('0x125')](db[_0xaac4('0x64')],{'as':_0xaac4('0x64'),'foreignKey':_0xaac4('0x174')});db[_0xaac4('0x43')][_0xaac4('0x125')](db['ChatOfflineMessage'],{'as':_0xaac4('0x6d'),'foreignKey':'ChatOfflineMessageId'});db[_0xaac4('0x45')]['belongsTo'](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x45')][_0xaac4('0x125')](db[_0xaac4('0x3e')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x45')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0xaac4('0x83')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x176')});db[_0xaac4('0x45')][_0xaac4('0x125')](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db[_0xaac4('0x47')][_0xaac4('0x125')](db['MailAccount'],{});db[_0xaac4('0x47')][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':'List','foreignKey':_0xaac4('0x165')});db[_0xaac4('0x47')]['belongsTo'](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x47')][_0xaac4('0x125')](db['MailInteraction'],{});db[_0xaac4('0x47')][_0xaac4('0x125')](db[_0xaac4('0x43')],{});db[_0xaac4('0x47')][_0xaac4('0x125')](db[_0xaac4('0x11')],{});db[_0xaac4('0x47')]['belongsTo'](db[_0xaac4('0x3e')],{});db[_0xaac4('0x48')]['hasMany'](db[_0xaac4('0x4a')],{'as':_0xaac4('0x178'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x4c')][_0xaac4('0x119')](db[_0xaac4('0x161')],{'as':_0xaac4('0x162'),'foreignKey':_0xaac4('0x179'),'onDelete':_0xaac4('0x117')});db['FaxAccount']['hasMany'](db[_0xaac4('0x7f')],{'as':_0xaac4('0x17a'),'foreignKey':_0xaac4('0x179')});db[_0xaac4('0x4c')][_0xaac4('0x119')](db[_0xaac4('0x121')],{'as':'Interactions'});db[_0xaac4('0x4c')][_0xaac4('0x119')](db[_0xaac4('0x4d')],{'as':_0xaac4('0x148')});db['FaxAccount'][_0xaac4('0x119')](db[_0xaac4('0x16')],{'as':_0xaac4('0x17b'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x4c')]['hasMany'](db[_0xaac4('0x17c')],{'as':_0xaac4('0x156')});db['FaxAccount']['belongsTo'](db[_0xaac4('0x2b')],{'as':_0xaac4('0x2b')});db[_0xaac4('0x4c')][_0xaac4('0x125')](db['CmList'],{'as':'List','foreignKey':_0xaac4('0x165')});db[_0xaac4('0x4c')][_0xaac4('0x125')](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db['FaxAccount'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x13e')});db['FaxApplication'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x4d')][_0xaac4('0x125')](db[_0xaac4('0x51')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x4d')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x4d')]['belongsTo'](db['Tag'],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db[_0xaac4('0x121')][_0xaac4('0x119')](db['FaxMessage'],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x17d')});db['FaxInteraction'][_0xaac4('0x125')](db[_0xaac4('0x4c')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x179')});db[_0xaac4('0x121')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x121')][_0xaac4('0x125')](db['User'],{'as':_0xaac4('0x16d'),'foreignKey':_0xaac4('0x118')});db['FaxInteraction'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':'fax_interaction_has_tags','as':_0xaac4('0x16f')});db[_0xaac4('0x121')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x17e'),'as':'ThroughTags'});db[_0xaac4('0x121')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':'user_has_fax_interactions','foreignKey':_0xaac4('0x17d')});db[_0xaac4('0x17c')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x11')});db[_0xaac4('0x17c')]['belongsTo'](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xaac4('0x17d')});db[_0xaac4('0x17c')][_0xaac4('0x125')](db['CmContact'],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x15c')});db[_0xaac4('0x17c')]['belongsTo'](db[_0xaac4('0xed')],{'as':_0xaac4('0xed'),'foreignKey':_0xaac4('0x17f')});db['FaxMessage'][_0xaac4('0x125')](db[_0xaac4('0x4c')],{'as':_0xaac4('0x16c'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Agents','through':_0xaac4('0x35')});db[_0xaac4('0x51')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x180'),'as':'Teams'});db[_0xaac4('0x53')]['belongsTo'](db[_0xaac4('0x4c')],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xaac4('0x53')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x53')][_0xaac4('0x125')](db[_0xaac4('0x121')],{});db[_0xaac4('0x53')]['belongsTo'](db[_0xaac4('0x17c')],{});db['FaxQueueReport'][_0xaac4('0x125')](db[_0xaac4('0x11')],{});db['FaxQueueReport'][_0xaac4('0x125')](db[_0xaac4('0x51')],{});db[_0xaac4('0x55')][_0xaac4('0x119')](db['Disposition'],{'as':_0xaac4('0x162'),'foreignKey':_0xaac4('0x181'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x55')][_0xaac4('0x119')](db['CannedAnswer'],{'as':_0xaac4('0x17a'),'foreignKey':'SmsAccountId'});db[_0xaac4('0x55')][_0xaac4('0x119')](db[_0xaac4('0x5a')],{'as':_0xaac4('0x156'),'foreignKey':_0xaac4('0x181')});db[_0xaac4('0x55')]['hasMany'](db['SmsInteraction'],{'as':_0xaac4('0x163')});db[_0xaac4('0x55')][_0xaac4('0x119')](db[_0xaac4('0x57')],{'as':_0xaac4('0x148')});db['SmsAccount']['belongsTo'](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x55')]['belongsTo'](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xaac4('0x55')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x175')});db['SmsApplication'][_0xaac4('0x125')](db[_0xaac4('0x5c')],{'onDelete':_0xaac4('0x175')});db['SmsApplication'][_0xaac4('0x125')](db[_0xaac4('0x55')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x57')][_0xaac4('0x125')](db[_0xaac4('0x83')],{'onDelete':'restrict','foreignKey':_0xaac4('0x176')});db['SmsApplication'][_0xaac4('0x125')](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db['SmsInteraction'][_0xaac4('0x119')](db['SmsMessage'],{'as':'Messages','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x182')});db['SmsInteraction']['belongsTo'](db[_0xaac4('0x55')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x181')});db[_0xaac4('0x58')]['belongsTo'](db['CmContact'],{'as':_0xaac4('0x15c'),'foreignKey':'ContactId'});db[_0xaac4('0x58')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':'UserId'});db['SmsInteraction'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x183'),'as':_0xaac4('0x16f')});db[_0xaac4('0x58')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x183'),'as':_0xaac4('0x170')});db[_0xaac4('0x58')]['belongsToMany'](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':_0xaac4('0x12f'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xaac4('0x125')](db['User'],{'as':'User'});db[_0xaac4('0x5a')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':'Contact'});db[_0xaac4('0x5a')][_0xaac4('0x125')](db[_0xaac4('0x58')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x173'),'foreignKey':'SmsInteractionId'});db[_0xaac4('0x5a')][_0xaac4('0x125')](db[_0xaac4('0x55')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x181')});db[_0xaac4('0x5c')]['belongsToMany'](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x36'),'foreignKey':_0xaac4('0x184')});db[_0xaac4('0x5c')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x185'),'as':_0xaac4('0x153')});db[_0xaac4('0x5d')][_0xaac4('0x119')](db[_0xaac4('0x161')],{'as':_0xaac4('0x162'),'foreignKey':_0xaac4('0x186'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x5d')]['hasMany'](db[_0xaac4('0x7f')],{'as':_0xaac4('0x17a'),'foreignKey':_0xaac4('0x186')});db['OpenchannelAccount']['hasMany'](db[_0xaac4('0x187')],{'as':_0xaac4('0x163'),'foreignKey':_0xaac4('0x186')});db['OpenchannelAccount']['hasMany'](db[_0xaac4('0x61')],{'as':_0xaac4('0x156'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xaac4('0x119')](db[_0xaac4('0x188')],{'as':_0xaac4('0x148'),'foreignKey':_0xaac4('0x186')});db[_0xaac4('0x5d')][_0xaac4('0x125')](db['CmList'],{'as':_0xaac4('0x164'),'foreignKey':'ListId'});db[_0xaac4('0x5d')]['belongsTo'](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db['OpenchannelAccount'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x140')});db['OpenchannelApplication']['belongsTo'](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x188')][_0xaac4('0x125')](db[_0xaac4('0x139')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x189')});db['OpenchannelApplication'][_0xaac4('0x125')](db[_0xaac4('0x5d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x186')});db[_0xaac4('0x188')][_0xaac4('0x125')](db[_0xaac4('0x83')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x176')});db['OpenchannelApplication'][_0xaac4('0x125')](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db[_0xaac4('0x187')][_0xaac4('0x119')](db[_0xaac4('0x61')],{'as':_0xaac4('0x156'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xaac4('0x187')][_0xaac4('0x125')](db[_0xaac4('0x5d')],{'as':'Account','foreignKey':_0xaac4('0x186')});db[_0xaac4('0x187')][_0xaac4('0x125')](db['CmContact'],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x187')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x187')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x18a'),'as':_0xaac4('0x16f')});db[_0xaac4('0x187')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xaac4('0x187')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Users','through':_0xaac4('0x130'),'foreignKey':_0xaac4('0x18b')});db[_0xaac4('0x61')]['belongsTo'](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x11')});db[_0xaac4('0x61')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':'Contact'});db[_0xaac4('0x61')][_0xaac4('0x125')](db[_0xaac4('0x187')],{'onDelete':'cascade','as':_0xaac4('0x173'),'foreignKey':_0xaac4('0x18b')});db['OpenchannelMessage'][_0xaac4('0x125')](db[_0xaac4('0xed')],{'as':_0xaac4('0xed'),'foreignKey':_0xaac4('0x17f')});db['OpenchannelMessage']['belongsTo'](db[_0xaac4('0x5d')],{'as':_0xaac4('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0xaac4('0x139')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x37'),'foreignKey':_0xaac4('0x189')});db[_0xaac4('0x139')]['belongsToMany'](db[_0xaac4('0xe5')],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite'][_0xaac4('0x119')](db[_0xaac4('0x161')],{'as':'Dispositions','foreignKey':_0xaac4('0x174'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x64')]['hasMany'](db[_0xaac4('0x7f')],{'as':_0xaac4('0x17a'),'foreignKey':_0xaac4('0x174')});db['ChatWebsite']['hasMany'](db['ChatProactiveAction'],{'as':_0xaac4('0x18c')});db[_0xaac4('0x64')][_0xaac4('0x119')](db[_0xaac4('0x69')],{'as':_0xaac4('0x163')});db['ChatWebsite'][_0xaac4('0x119')](db[_0xaac4('0x67')],{'as':'Applications'});db['ChatWebsite'][_0xaac4('0x119')](db[_0xaac4('0x6b')],{'as':'Messages'});db[_0xaac4('0x64')][_0xaac4('0x125')](db['CmList'],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x64')][_0xaac4('0x125')](db[_0xaac4('0x83')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xaac4('0x64')][_0xaac4('0x125')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xaac4('0x15e')});db[_0xaac4('0x64')]['belongsTo'](db['Pause'],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db[_0xaac4('0x64')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x13d')});db[_0xaac4('0x65')]['belongsTo'](db[_0xaac4('0x5d')],{});db[_0xaac4('0x65')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xaac4('0x165')});db['OpenchannelQueueReport'][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x65')][_0xaac4('0x125')](db[_0xaac4('0x187')],{});db[_0xaac4('0x65')][_0xaac4('0x125')](db[_0xaac4('0x61')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xaac4('0x11')],{});db[_0xaac4('0x65')][_0xaac4('0x125')](db['OpenchannelQueue'],{});db[_0xaac4('0x67')]['belongsTo'](db[_0xaac4('0x11')],{'as':_0xaac4('0x18d'),'foreignKey':'UserId','onDelete':'restrict'});db[_0xaac4('0x67')][_0xaac4('0x125')](db[_0xaac4('0x6f')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0xaac4('0x175')});db['ChatApplication'][_0xaac4('0x125')](db['ChatWebsite'],{'as':_0xaac4('0x18e'),'foreignKey':_0xaac4('0x174'),'onDelete':_0xaac4('0x175')});db['ChatApplication']['belongsTo'](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':'TagId'});db[_0xaac4('0x69')][_0xaac4('0x119')](db[_0xaac4('0x6b')],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':'ChatInteractionId'});db[_0xaac4('0x69')][_0xaac4('0x125')](db[_0xaac4('0x64')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x174')});db[_0xaac4('0x69')]['belongsTo'](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x69')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x69')][_0xaac4('0x127')](db['Tag'],{'through':_0xaac4('0x18f'),'as':_0xaac4('0x16f')});db[_0xaac4('0x69')][_0xaac4('0x127')](db['Tag'],{'through':_0xaac4('0x18f'),'as':_0xaac4('0x170')});db[_0xaac4('0x69')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xaac4('0x190')});db['ChatMessage'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':'cascade','as':_0xaac4('0x11')});db[_0xaac4('0x6b')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':'Contact','foreignKey':_0xaac4('0x15d')});db['ChatMessage'][_0xaac4('0x125')](db[_0xaac4('0x69')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x173'),'foreignKey':_0xaac4('0x190')});db[_0xaac4('0x6b')][_0xaac4('0x125')](db['Attachment'],{'as':_0xaac4('0xed'),'foreignKey':'AttachmentId'});db[_0xaac4('0x6b')]['belongsTo'](db[_0xaac4('0x64')],{'as':'Account','foreignKey':_0xaac4('0x174')});db['ChatOfflineMessage'][_0xaac4('0x119')](db[_0xaac4('0xed')],{'as':_0xaac4('0x172'),'foreignKey':_0xaac4('0x191'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db[_0xaac4('0x6d')]['belongsTo'](db['CmContact'],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db['ChatOfflineMessage'][_0xaac4('0x125')](db[_0xaac4('0x64')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x174')});db[_0xaac4('0x6f')]['belongsToMany'](db[_0xaac4('0x11')],{'as':'Agents','through':_0xaac4('0x31'),'hooks':!![]});db[_0xaac4('0x6f')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x192'),'as':'Teams'});db['ChatGroup'][_0xaac4('0x119')](db[_0xaac4('0xd0')],{'as':_0xaac4('0x156'),'foreignKey':_0xaac4('0x193'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x70')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Members','through':_0xaac4('0x128')});db['ChatProactiveAction'][_0xaac4('0x125')](db[_0xaac4('0x64')],{'as':_0xaac4('0x18e'),'foreignKey':'ChatWebsiteId'});db[_0xaac4('0x73')]['hasMany'](db[_0xaac4('0x75')],{'as':_0xaac4('0x129'),'foreignKey':_0xaac4('0x194')});db[_0xaac4('0x75')]['hasMany'](db[_0xaac4('0x14b')],{'as':_0xaac4('0x14c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x75')][_0xaac4('0x119')](db['CmHopperFinal'],{'as':_0xaac4('0x11d'),'foreignKey':'ContactId'});db[_0xaac4('0x75')][_0xaac4('0x119')](db[_0xaac4('0x7a')],{'as':_0xaac4('0x14d'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x75')]['hasMany'](db[_0xaac4('0x7b')],{'as':_0xaac4('0x7b'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x75')][_0xaac4('0x119')](db[_0xaac4('0xd5')],{'as':_0xaac4('0x14f'),'foreignKey':_0xaac4('0x15d')});db['CmContact']['hasMany'](db[_0xaac4('0x187')],{'as':_0xaac4('0x11f'),'foreignKey':'ContactId','onDelete':_0xaac4('0x175')});db[_0xaac4('0x75')][_0xaac4('0x119')](db[_0xaac4('0x69')],{'as':'ChatInteractions','foreignKey':_0xaac4('0x15d'),'onDelete':_0xaac4('0x175')});db[_0xaac4('0x75')]['hasMany'](db[_0xaac4('0x58')],{'as':_0xaac4('0x120'),'foreignKey':_0xaac4('0x15d'),'onDelete':_0xaac4('0x175')});db['CmContact'][_0xaac4('0x119')](db[_0xaac4('0x121')],{'as':_0xaac4('0x122'),'foreignKey':_0xaac4('0x15d'),'onDelete':'restrict'});db[_0xaac4('0x75')][_0xaac4('0x119')](db['MailInteraction'],{'as':_0xaac4('0x123'),'foreignKey':_0xaac4('0x15d'),'onDelete':_0xaac4('0x175')});db[_0xaac4('0x75')][_0xaac4('0x125')](db[_0xaac4('0x73')],{'as':_0xaac4('0x195'),'foreignKey':_0xaac4('0x194')});db[_0xaac4('0x75')][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':'ListId','onDelete':_0xaac4('0x117')});db[_0xaac4('0x75')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Users','through':_0xaac4('0x196')});db['CmContact'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'as':_0xaac4('0x16f'),'through':_0xaac4('0x197')});db['CmContact'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x197'),'as':_0xaac4('0x170')});db[_0xaac4('0x14b')]['belongsTo'](db['CmContact'],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x14b')][_0xaac4('0x125')](db['CmList'],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x14b')][_0xaac4('0x125')](db['User'],{'as':_0xaac4('0x18d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x14b')][_0xaac4('0x125')](db[_0xaac4('0x1a')],{'as':_0xaac4('0x198'),'foreignKey':'VoiceQueueId','onDelete':_0xaac4('0x117')});db['CmHopper'][_0xaac4('0x125')](db[_0xaac4('0xe9')],{'as':_0xaac4('0xe9'),'foreignKey':_0xaac4('0x199'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x14b')]['belongsTo'](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':'OwnerId'});db[_0xaac4('0x14e')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d'),'onDelete':'cascade'});db['CmHopperBlack'][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':'List','foreignKey':_0xaac4('0x165'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x14e')]['belongsTo'](db[_0xaac4('0x1a')],{'as':_0xaac4('0x198'),'foreignKey':_0xaac4('0x14a'),'onDelete':_0xaac4('0x117')});db['CmHopperBlack'][_0xaac4('0x125')](db['Campaign'],{'as':_0xaac4('0xe9'),'foreignKey':'CampaignId','onDelete':_0xaac4('0x117')});db['Automation'][_0xaac4('0x119')](db[_0xaac4('0x81')],{'as':{'plural':_0xaac4('0x19a'),'singular':_0xaac4('0x19b')},'foreignKey':_0xaac4('0x19c'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db[_0xaac4('0x7e')][_0xaac4('0x119')](db[_0xaac4('0x81')],{'as':{'plural':_0xaac4('0x19d'),'singular':_0xaac4('0x19e')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xaac4('0x7e')]['hasMany'](db[_0xaac4('0x19f')],{'as':'Actions','foreignKey':_0xaac4('0x1a0'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db[_0xaac4('0x161')][_0xaac4('0x119')](db['Disposition'],{'as':_0xaac4('0x162'),'foreignKey':_0xaac4('0x1a1'),'onDelete':_0xaac4('0x117')});db['Interval'][_0xaac4('0x119')](db[_0xaac4('0x83')],{'as':_0xaac4('0x1a2'),'foreignKey':_0xaac4('0x176'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xaac4('0x83')][_0xaac4('0x119')](db['VoiceExtension'],{'as':_0xaac4('0x11c'),'foreignKey':'IntervalId','onDelete':_0xaac4('0x175')});db[_0xaac4('0x83')][_0xaac4('0x119')](db[_0xaac4('0x45')],{'as':_0xaac4('0x1a3'),'foreignKey':_0xaac4('0x176')});db[_0xaac4('0x83')]['hasMany'](db['ChatApplication'],{'as':_0xaac4('0x1a4'),'foreignKey':_0xaac4('0x176')});db[_0xaac4('0x83')][_0xaac4('0x119')](db[_0xaac4('0x4d')],{'as':_0xaac4('0x1a5'),'foreignKey':'IntervalId'});db['Interval'][_0xaac4('0x119')](db[_0xaac4('0x57')],{'as':'SmsApplications','foreignKey':_0xaac4('0x176')});db[_0xaac4('0x1a6')]['belongsTo'](db[_0xaac4('0x3d')],{});db[_0xaac4('0x1a6')][_0xaac4('0x125')](db[_0xaac4('0x96')],{'foreignKey':_0xaac4('0x1a7')});db[_0xaac4('0x1a6')]['belongsTo'](db[_0xaac4('0x95')],{'foreignKey':_0xaac4('0x1a8')});db[_0xaac4('0x8b')][_0xaac4('0x127')](db[_0xaac4('0x18')],{'as':'Mohs','through':_0xaac4('0x149'),'onDelete':'restrict'});db['Tag'][_0xaac4('0x127')](db[_0xaac4('0x75')],{'through':_0xaac4('0x197')});db[_0xaac4('0x8d')][_0xaac4('0x127')](db[_0xaac4('0x69')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xaac4('0x127')](db[_0xaac4('0x41')],{'through':_0xaac4('0x16e')});db['Tag'][_0xaac4('0x127')](db[_0xaac4('0x58')],{'through':_0xaac4('0x183')});db[_0xaac4('0x8d')][_0xaac4('0x127')](db[_0xaac4('0x121')],{'through':'fax_interaction_has_tags'});db[_0xaac4('0x8d')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xaac4('0x18a')});db[_0xaac4('0x8d')][_0xaac4('0x127')](db['WhatsappInteraction'],{'through':_0xaac4('0x1a9')});db['Trigger']['hasMany'](db[_0xaac4('0x81')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xaac4('0x8f')][_0xaac4('0x119')](db[_0xaac4('0x81')],{'as':{'plural':_0xaac4('0x1aa'),'singular':_0xaac4('0x1ab')},'foreignKey':_0xaac4('0x1ac'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db['Trigger'][_0xaac4('0x119')](db['Action'],{'as':_0xaac4('0x1ad'),'foreignKey':_0xaac4('0x1ae'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db['AnalyticCustomReport'][_0xaac4('0x119')](db['AnalyticFieldReport'],{'as':_0xaac4('0x1af'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1a8'),'hooks':!![]});db[_0xaac4('0x96')][_0xaac4('0x119')](db[_0xaac4('0x98')],{'as':_0xaac4('0x1af'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xaac4('0x1b0')][_0xaac4('0x119')](db[_0xaac4('0x98')],{'as':_0xaac4('0x1af'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b1')});db[_0xaac4('0x98')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0xaac4('0x1b1')});db[_0xaac4('0x9b')][_0xaac4('0x119')](db[_0xaac4('0x9c')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db['SalesforceConfiguration'][_0xaac4('0x119')](db['SalesforceField'],{'as':_0xaac4('0x1b4'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x9c')][_0xaac4('0x119')](db[_0xaac4('0x9e')],{'as':_0xaac4('0x1b6'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0x9c')][_0xaac4('0x119')](db[_0xaac4('0x9e')],{'as':_0xaac4('0x1af'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x9c')][_0xaac4('0x125')](db[_0xaac4('0x9b')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0x9e')][_0xaac4('0x119')](db['SalesforceField'],{'as':_0xaac4('0x1b9'),'foreignKey':_0xaac4('0x1b5')});db['SalesforceField'][_0xaac4('0x119')](db['SalesforceField'],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0x9e')]['hasMany'](db[_0xaac4('0x9e')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x9e')]['belongsTo'](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db['SugarcrmAccount']['hasMany'](db[_0xaac4('0xa2')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xa2')][_0xaac4('0x119')](db['SugarcrmField'],{'as':_0xaac4('0x1b4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xaac4('0xa2')][_0xaac4('0x119')](db[_0xaac4('0xa4')],{'as':_0xaac4('0x1b6'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xa2')][_0xaac4('0x119')](db[_0xaac4('0xa4')],{'as':'Fields','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b8')});db['SugarcrmConfiguration'][_0xaac4('0x125')](db[_0xaac4('0xa0')],{'as':_0xaac4('0x16c'),'foreignKey':'AccountId'});db['SugarcrmField']['hasMany'](db[_0xaac4('0xa4')],{'as':_0xaac4('0x1b9'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xa4')][_0xaac4('0x119')](db[_0xaac4('0xa4')],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xa4')]['hasMany'](db['SugarcrmField'],{'as':_0xaac4('0x1bb'),'foreignKey':'FieldId'});db[_0xaac4('0xa4')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':'VariableId'});db[_0xaac4('0xa6')][_0xaac4('0x119')](db[_0xaac4('0xa8')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db['DeskConfiguration'][_0xaac4('0x119')](db[_0xaac4('0x1bd')],{'as':_0xaac4('0x1b4'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xa8')]['hasMany'](db['DeskField'],{'as':_0xaac4('0x1b6'),'onDelete':'cascade','foreignKey':_0xaac4('0x1b7')});db['DeskConfiguration']['hasMany'](db[_0xaac4('0x1bd')],{'as':_0xaac4('0x1af'),'onDelete':'cascade','foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xa8')][_0xaac4('0x125')](db['DeskAccount'],{'as':'Account','foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xa8')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x1be')});db[_0xaac4('0x1bd')]['hasMany'](db[_0xaac4('0x1bd')],{'as':_0xaac4('0x1b9'),'foreignKey':'SubjectId'});db[_0xaac4('0x1bd')][_0xaac4('0x119')](db[_0xaac4('0x1bd')],{'as':_0xaac4('0x1ba'),'foreignKey':'DescriptionId'});db[_0xaac4('0x1bd')][_0xaac4('0x119')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db['DeskField']['belongsTo'](db['Variable'],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xab')][_0xaac4('0x119')](db['ZohoConfiguration'],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xad')][_0xaac4('0x119')](db['ZohoField'],{'as':_0xaac4('0x1b4'),'onDelete':_0xaac4('0x117'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xaac4('0x119')](db[_0xaac4('0x1bf')],{'as':_0xaac4('0x1b6'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xaac4('0x1bf')],{'as':'Fields','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xad')][_0xaac4('0x125')](db['ZohoAccount'],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0x1bf')][_0xaac4('0x119')](db['ZohoField'],{'as':_0xaac4('0x1b9'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x1bf')][_0xaac4('0x119')](db[_0xaac4('0x1bf')],{'as':'Description','foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0x1bf')][_0xaac4('0x119')](db[_0xaac4('0x1bf')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x1bf')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xb0')]['hasMany'](db[_0xaac4('0xb1')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xb1')]['hasMany'](db[_0xaac4('0xb3')],{'as':_0xaac4('0x1b4'),'foreignKey':_0xaac4('0x1b5')});db['ZendeskConfiguration']['hasMany'](db[_0xaac4('0xb3')],{'as':_0xaac4('0x1b6'),'foreignKey':'DescriptionId'});db[_0xaac4('0xb1')][_0xaac4('0x119')](db['ZendeskField'],{'as':'Fields','foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xb1')][_0xaac4('0x125')](db[_0xaac4('0xb0')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xb1')]['belongsToMany'](db[_0xaac4('0x8d')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0xaac4('0x119')](db['ZendeskField'],{'as':_0xaac4('0x1b9'),'foreignKey':'SubjectId'});db[_0xaac4('0xb3')][_0xaac4('0x119')](db[_0xaac4('0xb3')],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xb3')]['hasMany'](db[_0xaac4('0xb3')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xb3')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xb5')][_0xaac4('0x119')](db['FreshdeskConfiguration'],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xb7')][_0xaac4('0x119')](db[_0xaac4('0xb8')],{'as':_0xaac4('0x1b4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xaac4('0xb7')]['hasMany'](db[_0xaac4('0xb8')],{'as':_0xaac4('0x1b6'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xb7')]['hasMany'](db[_0xaac4('0xb8')],{'as':_0xaac4('0x1af'),'onDelete':'cascade','foreignKey':_0xaac4('0x1b8')});db['FreshdeskConfiguration'][_0xaac4('0x125')](db[_0xaac4('0xb5')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db['FreshdeskConfiguration'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x1c0')});db[_0xaac4('0xb8')][_0xaac4('0x119')](db[_0xaac4('0xb8')],{'as':'Subject','foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xb8')][_0xaac4('0x119')](db['FreshdeskField'],{'as':_0xaac4('0x1ba'),'foreignKey':'DescriptionId'});db[_0xaac4('0xb8')][_0xaac4('0x119')](db['FreshdeskField'],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xb8')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xb9')][_0xaac4('0x119')](db[_0xaac4('0xbb')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db['VtigerConfiguration']['hasMany'](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1b4'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xbb')][_0xaac4('0x119')](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1b6'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xbb')][_0xaac4('0x119')](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1af'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xbb')]['belongsTo'](db[_0xaac4('0xb9')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xbd')][_0xaac4('0x119')](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1b9'),'foreignKey':'SubjectId'});db[_0xaac4('0xbd')][_0xaac4('0x119')](db['VtigerField'],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db['VtigerField']['hasMany'](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xbd')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xbf')][_0xaac4('0x119')](db[_0xaac4('0x1c1')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0x1c1')]['hasMany'](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1b4'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x1c1')][_0xaac4('0x119')](db['ServicenowField'],{'as':_0xaac4('0x1b6'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0x1c1')][_0xaac4('0x119')](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1af'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x1c1')]['belongsTo'](db[_0xaac4('0xbf')],{'as':_0xaac4('0x16c'),'foreignKey':'AccountId'});db['ServicenowField'][_0xaac4('0x119')](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1b9'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x1c2')][_0xaac4('0x119')](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1ba'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0xaac4('0x119')](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x1c2')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':'Variable','foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xc2')][_0xaac4('0x119')](db[_0xaac4('0xc4')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xc4')]['hasMany'](db[_0xaac4('0x1c3')],{'as':'Descriptions','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xc4')][_0xaac4('0x119')](db[_0xaac4('0x1c3')],{'as':_0xaac4('0x1af'),'onDelete':'cascade','foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xaac4('0x125')](db[_0xaac4('0xc2')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0x1c3')][_0xaac4('0x119')](db[_0xaac4('0x1c3')],{'as':'Subject','foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x1c3')]['hasMany'](db[_0xaac4('0x1c3')],{'as':_0xaac4('0x1ba'),'foreignKey':'DescriptionId'});db[_0xaac4('0x1c3')][_0xaac4('0x119')](db[_0xaac4('0x1c3')],{'as':_0xaac4('0x1bb'),'foreignKey':'FieldId'});db[_0xaac4('0x1c3')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0xaac4('0x119')](db[_0xaac4('0xc9')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xc9')][_0xaac4('0x119')](db[_0xaac4('0xcb')],{'as':_0xaac4('0x1b4'),'foreignKey':'SubjectId'});db[_0xaac4('0xc9')][_0xaac4('0x119')](db['FreshsalesField'],{'as':_0xaac4('0x1b6'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xc9')]['hasMany'](db['FreshsalesField'],{'as':_0xaac4('0x1af'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xc9')][_0xaac4('0x125')](db[_0xaac4('0xc7')],{'as':'Account','foreignKey':_0xaac4('0x1b3')});db['FreshsalesField'][_0xaac4('0x119')](db[_0xaac4('0xcb')],{'as':'Subject','foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xcb')][_0xaac4('0x119')](db[_0xaac4('0xcb')],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xcb')]['hasMany'](db[_0xaac4('0xcb')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xcb')]['belongsTo'](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xce')][_0xaac4('0x125')](db[_0xaac4('0x64')],{});db['ChatQueueReport'][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0xce')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db[_0xaac4('0xce')][_0xaac4('0x125')](db[_0xaac4('0x69')],{});db[_0xaac4('0xce')][_0xaac4('0x125')](db['ChatMessage'],{});db[_0xaac4('0xce')][_0xaac4('0x125')](db['User'],{});db[_0xaac4('0xce')][_0xaac4('0x125')](db['ChatQueue'],{});db[_0xaac4('0xd0')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':'cascade','foreignKey':_0xaac4('0x1c4')});db[_0xaac4('0xd0')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1c5')});db[_0xaac4('0xd5')][_0xaac4('0x119')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xaac4('0x117')});db[_0xaac4('0xd5')][_0xaac4('0x119')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0xaac4('0x117')});db[_0xaac4('0xd6')][_0xaac4('0x125')](db[_0xaac4('0x55')],{});db[_0xaac4('0xd6')][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':'ListId'});db[_0xaac4('0xd6')]['belongsTo'](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db['SmsQueueReport'][_0xaac4('0x125')](db['SmsInteraction'],{});db[_0xaac4('0xd6')][_0xaac4('0x125')](db[_0xaac4('0x5a')],{});db[_0xaac4('0xd6')][_0xaac4('0x125')](db[_0xaac4('0x11')],{});db[_0xaac4('0xd6')]['belongsTo'](db[_0xaac4('0x5c')],{});db['JscriptyProject'][_0xaac4('0x119')](db['JscriptySessionReport'],{'foreignKey':_0xaac4('0x1c6')});db[_0xaac4('0xdb')][_0xaac4('0x119')](db[_0xaac4('0xd3')],{'foreignKey':'ProjectId'});db[_0xaac4('0xdb')][_0xaac4('0x119')](db[_0xaac4('0xd2')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':_0xaac4('0x145')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':'user_has_teams'});db[_0xaac4('0xe5')][_0xaac4('0x127')](db[_0xaac4('0x1a')],{'through':_0xaac4('0x113'),'as':_0xaac4('0x1c7')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db[_0xaac4('0x3e')],{'through':_0xaac4('0x16a'),'as':_0xaac4('0x135')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db['ChatQueue'],{'through':_0xaac4('0x192'),'as':_0xaac4('0x136')});db['Team'][_0xaac4('0x127')](db[_0xaac4('0x51')],{'through':_0xaac4('0x180'),'as':_0xaac4('0x137')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db['SmsQueue'],{'through':_0xaac4('0x185'),'as':_0xaac4('0x138')});db[_0xaac4('0xe5')]['belongsToMany'](db[_0xaac4('0x139')],{'through':_0xaac4('0x1c8'),'as':_0xaac4('0x13a')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db['WhatsappQueue'],{'through':_0xaac4('0x1c9'),'as':_0xaac4('0x13b')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db[_0xaac4('0xfd')],{'through':_0xaac4('0x1ca'),'as':_0xaac4('0x133')});db['Campaign'][_0xaac4('0x119')](db[_0xaac4('0x14b')],{'as':_0xaac4('0x14c'),'foreignKey':_0xaac4('0x199')});db[_0xaac4('0xe9')][_0xaac4('0x119')](db[_0xaac4('0x79')],{'as':_0xaac4('0x11d'),'foreignKey':_0xaac4('0x199')});db[_0xaac4('0xe9')][_0xaac4('0x119')](db['CmHopperHistory'],{'as':_0xaac4('0x14d'),'foreignKey':_0xaac4('0x199')});db[_0xaac4('0xe9')][_0xaac4('0x119')](db[_0xaac4('0x14e')],{'as':_0xaac4('0x1cb'),'foreignKey':_0xaac4('0x199')});db[_0xaac4('0xe9')]['belongsTo'](db['Trunk'],{'as':_0xaac4('0x2b'),'foreignKey':_0xaac4('0x150')});db[_0xaac4('0xe9')][_0xaac4('0x125')](db['Trunk'],{'as':_0xaac4('0x1cc'),'foreignKey':_0xaac4('0x1cd')});db[_0xaac4('0xe9')]['belongsTo'](db[_0xaac4('0x83')],{'as':'Interval','foreignKey':_0xaac4('0x176')});db[_0xaac4('0xe9')][_0xaac4('0x125')](db[_0xaac4('0xdf')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xaac4('0xe9')]['belongsToMany'](db[_0xaac4('0xfb')],{'as':'Lists','through':_0xaac4('0x1ce')});db['Campaign'][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x154'),'through':'campaigns_has_cm_blacklists'});db[_0xaac4('0xed')][_0xaac4('0x125')](db[_0xaac4('0x6d')],{'as':_0xaac4('0x6d'),'foreignKey':_0xaac4('0x191')});db[_0xaac4('0xf1')]['belongsTo'](db['MailMessage'],{});db[_0xaac4('0xf1')][_0xaac4('0x125')](db[_0xaac4('0x41')],{});db[_0xaac4('0xf1')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'foreignKey':_0xaac4('0x1cf'),'as':_0xaac4('0x1d0')});db[_0xaac4('0xf1')]['belongsTo'](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d1'),'as':'FromAgent'});db[_0xaac4('0xf1')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db['MailTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x3e')],{'foreignKey':_0xaac4('0x1d4'),'as':_0xaac4('0x1d5')});db[_0xaac4('0xf1')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'foreignKey':_0xaac4('0x1d6'),'as':_0xaac4('0x1d7')});db['ChatTransferReport'][_0xaac4('0x125')](db['ChatMessage'],{});db[_0xaac4('0xf3')][_0xaac4('0x125')](db['ChatInteraction'],{});db[_0xaac4('0xf3')][_0xaac4('0x125')](db['ChatWebsite'],{'foreignKey':_0xaac4('0x1d8'),'as':_0xaac4('0x1d0')});db[_0xaac4('0xf3')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':'FromUserId','as':_0xaac4('0x1d9')});db[_0xaac4('0xf3')]['belongsTo'](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db[_0xaac4('0xf3')]['belongsTo'](db[_0xaac4('0x6f')],{'foreignKey':_0xaac4('0x1da'),'as':'ToQueue'});db[_0xaac4('0xf3')][_0xaac4('0x125')](db['ChatWebsite'],{'foreignKey':_0xaac4('0x1db'),'as':_0xaac4('0x1d7')});db[_0xaac4('0xf5')][_0xaac4('0x125')](db[_0xaac4('0x17c')],{});db[_0xaac4('0xf5')][_0xaac4('0x125')](db[_0xaac4('0x121')],{});db[_0xaac4('0xf5')][_0xaac4('0x125')](db[_0xaac4('0x4c')],{'foreignKey':_0xaac4('0x1dc'),'as':_0xaac4('0x1d0')});db[_0xaac4('0xf5')][_0xaac4('0x125')](db['User'],{'foreignKey':_0xaac4('0x1d1'),'as':_0xaac4('0x1d9')});db['FaxTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db['FaxTransferReport'][_0xaac4('0x125')](db['FaxQueue'],{'foreignKey':_0xaac4('0x1dd'),'as':_0xaac4('0x1d5')});db[_0xaac4('0xf5')][_0xaac4('0x125')](db['FaxAccount'],{'foreignKey':_0xaac4('0x1de'),'as':_0xaac4('0x1d7')});db[_0xaac4('0xf7')][_0xaac4('0x125')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xaac4('0x187')],{});db['OpenchannelTransferReport'][_0xaac4('0x125')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0xaac4('0x1d0')});db['OpenchannelTransferReport'][_0xaac4('0x125')](db['User'],{'foreignKey':_0xaac4('0x1d1'),'as':_0xaac4('0x1d9')});db['OpenchannelTransferReport']['belongsTo'](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db[_0xaac4('0xf7')]['belongsTo'](db[_0xaac4('0x139')],{'foreignKey':_0xaac4('0x1df'),'as':_0xaac4('0x1d5')});db['OpenchannelTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x5d')],{'foreignKey':_0xaac4('0x1e0'),'as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0xaac4('0x5a')],{});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x58')],{});db[_0xaac4('0xf9')][_0xaac4('0x125')](db['SmsAccount'],{'foreignKey':_0xaac4('0x1e1'),'as':'FromAccount'});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d1'),'as':_0xaac4('0x1d9')});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x5c')],{'foreignKey':_0xaac4('0x1e2'),'as':_0xaac4('0x1d5')});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x55')],{'foreignKey':_0xaac4('0x1e3'),'as':'ToAccount'});db[_0xaac4('0xfb')]['hasMany'](db['Disposition'],{'as':_0xaac4('0x162'),'foreignKey':'ListId','onDelete':_0xaac4('0x117')});db['CmList'][_0xaac4('0x119')](db[_0xaac4('0x7d')],{'as':_0xaac4('0x1e4'),'foreignKey':_0xaac4('0x165')});db['CmList'][_0xaac4('0x119')](db[_0xaac4('0x75')],{'as':_0xaac4('0x129'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x165')});db['CmList']['hasMany'](db[_0xaac4('0x79')],{'as':'HopperFinals','foreignKey':_0xaac4('0x165')});db[_0xaac4('0xfb')][_0xaac4('0x119')](db[_0xaac4('0x7a')],{'as':_0xaac4('0x11e'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0xfb')]['hasMany'](db[_0xaac4('0x7b')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xaac4('0xfb')][_0xaac4('0x127')](db[_0xaac4('0x1a')],{'as':_0xaac4('0x1e5'),'through':_0xaac4('0x152')});db[_0xaac4('0xfb')]['belongsToMany'](db[_0xaac4('0x11')],{'as':'Agents','through':'cm_user_has_lists'});db['VoicePrefix'][_0xaac4('0x119')](db[_0xaac4('0x16')],{'as':'Extensions','onDelete':_0xaac4('0x117')});db['VoicePrefix'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x134')});db[_0xaac4('0xfd')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x1ca'),'as':_0xaac4('0x153')});db[_0xaac4('0x126')][_0xaac4('0x119')](db['User'],{'as':'Users','foreignKey':_0xaac4('0x1e6')});db[_0xaac4('0x126')][_0xaac4('0x119')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xaac4('0x1e6'),'onDelete':'cascade'});db['UserProfileSection'][_0xaac4('0x119')](db['UserProfileResource'],{'as':_0xaac4('0x1e7'),'foreignKey':_0xaac4('0x1e8'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x106')][_0xaac4('0x119')](db[_0xaac4('0x161')],{'as':_0xaac4('0x162'),'foreignKey':'WhatsappAccountId','onDelete':_0xaac4('0x117')});db[_0xaac4('0x106')]['hasMany'](db[_0xaac4('0x7f')],{'as':_0xaac4('0x17a'),'foreignKey':_0xaac4('0x1e9')});db[_0xaac4('0x106')][_0xaac4('0x119')](db[_0xaac4('0x1ea')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xaac4('0x119')](db[_0xaac4('0x124')],{'as':'Interactions'});db[_0xaac4('0x106')]['hasMany'](db[_0xaac4('0x108')],{'as':_0xaac4('0x148')});db['WhatsappAccount'][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x106')][_0xaac4('0x125')](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db[_0xaac4('0x106')]['belongsToMany'](db['User'],{'as':_0xaac4('0x168'),'through':_0xaac4('0x1eb')});db[_0xaac4('0x108')][_0xaac4('0x125')](db['User'],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x108')][_0xaac4('0x125')](db[_0xaac4('0x110')],{'onDelete':'restrict'});db[_0xaac4('0x108')][_0xaac4('0x125')](db[_0xaac4('0x106')],{'onDelete':_0xaac4('0x175')});db['WhatsappApplication']['belongsTo'](db[_0xaac4('0x83')],{'onDelete':_0xaac4('0x175'),'foreignKey':'IntervalId'});db[_0xaac4('0x108')]['belongsTo'](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db[_0xaac4('0x124')][_0xaac4('0x119')](db[_0xaac4('0x1ea')],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1ec')});db[_0xaac4('0x124')][_0xaac4('0x125')](db[_0xaac4('0x106')],{'as':_0xaac4('0x16c'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db['WhatsappInteraction'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x124')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x1a9'),'as':_0xaac4('0x16f')});db['WhatsappInteraction'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':'whatsapp_interaction_has_tags','as':_0xaac4('0x170')});db['WhatsappInteraction'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':_0xaac4('0x132'),'foreignKey':_0xaac4('0x1ec')});db[_0xaac4('0x1ea')]['belongsTo'](db[_0xaac4('0x11')],{'as':_0xaac4('0x11')});db[_0xaac4('0x1ea')]['belongsTo'](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x15c')});db[_0xaac4('0x1ea')][_0xaac4('0x125')](db[_0xaac4('0x124')],{'onDelete':'cascade','as':_0xaac4('0x173'),'foreignKey':_0xaac4('0x1ec')});db[_0xaac4('0x1ea')][_0xaac4('0x125')](db[_0xaac4('0x106')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1e9')});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x106')],{});db[_0xaac4('0x10c')][_0xaac4('0x125')](db['CmList'],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x124')],{});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x110')],{});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x1ea')],{});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x11')],{});db[_0xaac4('0x10e')]['belongsTo'](db[_0xaac4('0x1ea')],{});db[_0xaac4('0x10e')][_0xaac4('0x125')](db['WhatsappInteraction'],{});db[_0xaac4('0x10e')][_0xaac4('0x125')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0xaac4('0x1d0')});db['WhatsappTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x106')],{'foreignKey':'ToWhatsappAccountId','as':_0xaac4('0x1d7')});db['WhatsappTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x110')],{'foreignKey':_0xaac4('0x1ed'),'as':_0xaac4('0x1d5')});db[_0xaac4('0x10e')]['belongsTo'](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d1'),'as':_0xaac4('0x1d9')});db[_0xaac4('0x10e')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db[_0xaac4('0x110')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0xaac4('0x1ee')});db[_0xaac4('0x110')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x1c9'),'as':_0xaac4('0x153')});module[_0xaac4('0x1ef')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa75b=['../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','UserProfile','belongsToMany','Groups','Contacts','Lists','user_has_teams','MailInteraction','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccount','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','mandatoryDispositionPauseId','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Exntensions','Agents','user_has_fax_accounts','FaxQueue','FaxInteractionId','fax_interaction_has_tags','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','ChatGroupId','chat_group_has_users','CompanyId','JscriptySessionReport','Company','cm_user_has_contacts','cm_contact_has_tags','Condition','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','CustomReportId','Fields','DefaultReportId','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','SugarcrmAccount','Configurations','DescriptionId','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','SquareProject','team_has_mail_queues','team_has_sms_queues','team_has_whatsapp_queues','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','cm_user_has_lists','userProfileId','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','database','username','password','sequelizeHistory','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','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','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition'];(function(_0x34a14d,_0xc49d24){var _0x2015f2=function(_0x2a0b48){while(--_0x2a0b48){_0x34a14d['push'](_0x34a14d['shift']());}};_0x2015f2(++_0xc49d24);}(_0xa75b,0x170));var _0xba75=function(_0x3f64bc,_0x41424a){_0x3f64bc=_0x3f64bc-0x0;var _0x3e92f8=_0xa75b[_0x3f64bc];return _0x3e92f8;};'use strict';var config=require(_0xba75('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xba75('0x1'));var timezone=jstz[_0xba75('0x2')]();config[_0xba75('0x3')]=_[_0xba75('0x4')](config[_0xba75('0x3')],{'database':_0xba75('0x5'),'username':_0xba75('0x6'),'password':_0xba75('0x7'),'options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xba75('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0xba75('0x6'),'password':'xC@LL1234','options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':_0xba75('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x3')][_0xba75('0xe')],config[_0xba75('0x3')][_0xba75('0xf')],config[_0xba75('0x3')][_0xba75('0x10')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x11')]['database'],config[_0xba75('0x11')][_0xba75('0xf')],config[_0xba75('0x11')][_0xba75('0x10')],config['sequelizeHistory'][_0xba75('0x12')])};db[_0xba75('0x13')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x15'));db['VoiceChanSpy']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x16'));db['VoiceContext']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x17'));db[_0xba75('0x18')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xba75('0x19')]=db[_0xba75('0x3')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xba75('0x1a')]=db[_0xba75('0x3')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xba75('0x1b')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1c'));db[_0xba75('0x1d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1e'));db[_0xba75('0x1f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x20'));db['VoiceMailMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x21'));db[_0xba75('0x22')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x23'));db[_0xba75('0x24')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db['sequelize'][_0xba75('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xba75('0x25')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x26'));db[_0xba75('0x27')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x28'));db[_0xba75('0x29')]=db[_0xba75('0x3')]['import']('../api/trunk/trunk.model');db[_0xba75('0x2a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2b'));db[_0xba75('0x2c')]=db[_0xba75('0x3')]['import'](_0xba75('0x2d'));db[_0xba75('0x2e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2f'));db[_0xba75('0x30')]=db[_0xba75('0x3')]['import'](_0xba75('0x31'));db[_0xba75('0x32')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x33'));db[_0xba75('0x34')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x35'));db[_0xba75('0x36')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x37'));db[_0xba75('0x38')]=db['sequelize']['import'](_0xba75('0x39'));db[_0xba75('0x3a')]=db[_0xba75('0x3')]['import'](_0xba75('0x3b'));db[_0xba75('0x3c')]=db['sequelize']['import'](_0xba75('0x3d'));db[_0xba75('0x3e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x3f'));db['MailAccount']=db['sequelize'][_0xba75('0x14')](_0xba75('0x40'));db[_0xba75('0x41')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x42'));db[_0xba75('0x43')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x44'));db['MailInteraction']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x45'));db[_0xba75('0x46')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x47'));db['MailApplication']=db[_0xba75('0x3')]['import'](_0xba75('0x48'));db['MailQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x49'));db[_0xba75('0x4a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x4b'));db[_0xba75('0x4c')]=db[_0xba75('0x3')]['import'](_0xba75('0x4d'));db[_0xba75('0x4e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x4f'));db[_0xba75('0x50')]=db['sequelize']['import']('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xba75('0x3')]['import'](_0xba75('0x51'));db[_0xba75('0x52')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x53'));db['FaxQueue']=db['sequelize'][_0xba75('0x14')]('../api/faxQueue/faxQueue.model');db[_0xba75('0x54')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x55'));db[_0xba75('0x56')]=db[_0xba75('0x3')]['import'](_0xba75('0x57'));db[_0xba75('0x58')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x59'));db[_0xba75('0x5a')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0xba75('0x5b')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x5c'));db[_0xba75('0x5d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x5e'));db[_0xba75('0x5f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x60'));db[_0xba75('0x61')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x62'));db[_0xba75('0x63')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x64'));db['OpenchannelMessage']=db['sequelize'][_0xba75('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xba75('0x3')]['import'](_0xba75('0x65'));db[_0xba75('0x66')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x67'));db['OpenchannelQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xba75('0x68')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x69'));db[_0xba75('0x6a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x6b'));db['ChatMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6c'));db[_0xba75('0x6d')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xba75('0x6e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6f'));db[_0xba75('0x70')]=db[_0xba75('0x3')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0xba75('0x14')](_0xba75('0x71'));db[_0xba75('0x72')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x73'));db[_0xba75('0x74')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x75'));db[_0xba75('0x76')]=db[_0xba75('0x3')]['import'](_0xba75('0x77'));db[_0xba75('0x78')]=db['sequelize'][_0xba75('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xba75('0x79')]=db[_0xba75('0x3')]['import'](_0xba75('0x7a'));db[_0xba75('0x7b')]=db['sequelize']['import'](_0xba75('0x7c'));db['ReportAgentPreview']=db[_0xba75('0x3')]['import'](_0xba75('0x7d'));db[_0xba75('0x7e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x7f'));db['Action']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/action/action.model');db[_0xba75('0x80')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x81'));db[_0xba75('0x82')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x83'));db[_0xba75('0x84')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x85'));db['Condition']=db['sequelize'][_0xba75('0x14')](_0xba75('0x86'));db[_0xba75('0x87')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x88'));db[_0xba75('0x89')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8a'));db[_0xba75('0x8b')]=db['sequelize'][_0xba75('0x14')]('../api/cdr/cdr.model');db[_0xba75('0x8c')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8d'));db[_0xba75('0x8e')]=db[_0xba75('0x3')]['import'](_0xba75('0x8f'));db['Sound']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/sound/sound.model');db['Tag']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x90'));db[_0xba75('0x91')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/template/template.model');db[_0xba75('0x92')]=db[_0xba75('0x3')]['import'](_0xba75('0x93'));db[_0xba75('0x94')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x95'));db['Integration']=db[_0xba75('0x3')]['import'](_0xba75('0x96'));db[_0xba75('0x97')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x98'));db[_0xba75('0x99')]=db['sequelize']['import'](_0xba75('0x9a'));db['AnalyticDefaultReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xba75('0x9b')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0xba75('0x9c')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x9d'));db[_0xba75('0x9e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x9f'));db[_0xba75('0xa0')]=db['sequelize']['import'](_0xba75('0xa1'));db[_0xba75('0xa2')]=db['sequelize'][_0xba75('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xba75('0xa3')]=db[_0xba75('0x3')]['import'](_0xba75('0xa4'));db['SugarcrmAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xba75('0xa5')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa6'));db[_0xba75('0xa7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa8'));db['DeskAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xba75('0xa9')]=db['sequelize'][_0xba75('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xba75('0x3')]['import'](_0xba75('0xaa'));db['ZohoConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xba75('0xab')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xac'));db[_0xba75('0xad')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xae'));db['ZendeskConfiguration']=db[_0xba75('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xba75('0xaf')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xb0'));db[_0xba75('0xb1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb2'));db[_0xba75('0xb3')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb4'));db[_0xba75('0xb5')]=db['sequelize']['import'](_0xba75('0xb6'));db['VtigerAccount']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb7'));db[_0xba75('0xb8')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xba75('0x3')]['import'](_0xba75('0xb9'));db[_0xba75('0xba')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbb'));db['ServicenowConfiguration']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbc'));db[_0xba75('0xbd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbe'));db[_0xba75('0xbf')]=db[_0xba75('0x3')]['import'](_0xba75('0xc0'));db[_0xba75('0xc1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc2'));db[_0xba75('0xc3')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xba75('0xc4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc5'));db[_0xba75('0xc6')]=db[_0xba75('0x3')]['import'](_0xba75('0xc7'));db['FreshsalesField']=db[_0xba75('0x3')]['import'](_0xba75('0xc8'));db[_0xba75('0xc9')]=db[_0xba75('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xca'));db[_0xba75('0xcb')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xcc'));db[_0xba75('0xcd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xce'));db[_0xba75('0xcf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd0'));db['JscriptyQuestionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd1'));db['JscriptySessionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd2'));db[_0xba75('0xd3')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd4'));db['SquareReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd5'));db[_0xba75('0xd6')]=db[_0xba75('0x3')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xba75('0xd7')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd8'));db[_0xba75('0xd9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xda'));db[_0xba75('0xdb')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0xba75('0x14')]('../api/squareProject/squareProject.model');db[_0xba75('0xdc')]=db['sequelize'][_0xba75('0x14')]('../api/squareRecording/squareRecording.model');db[_0xba75('0xdd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xde'));db[_0xba75('0xdf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe0'));db['License']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe1'));db[_0xba75('0xe2')]=db[_0xba75('0x3')]['import'](_0xba75('0xe3'));db[_0xba75('0xe4')]=db[_0xba75('0x3')]['import'](_0xba75('0xe5'));db['Attachment']=db['sequelize'][_0xba75('0x14')](_0xba75('0xe6'));db[_0xba75('0xe7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe8'));db[_0xba75('0xe9')]=db['sequelize'][_0xba75('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xba75('0xea')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xeb'));db[_0xba75('0xec')]=db[_0xba75('0x3')]['import'](_0xba75('0xed'));db[_0xba75('0xee')]=db[_0xba75('0x3')]['import'](_0xba75('0xef'));db[_0xba75('0xf0')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf1'));db[_0xba75('0xf2')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf3'));db[_0xba75('0xf4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf5'));db['UserProfile']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/userProfile/userProfile.model');db[_0xba75('0xf6')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xf7'));db['UserProfileResource']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf8'));db[_0xba75('0xf9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfa'));db['WhatsappAccount']=db['sequelize']['import'](_0xba75('0xfb'));db[_0xba75('0xfc')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfd'));db[_0xba75('0xfe')]=db[_0xba75('0x3')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xba75('0xff')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x100'));db[_0xba75('0x101')]=db['sequelize'][_0xba75('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xba75('0x102')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x103'));db[_0xba75('0x104')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x105'));db[_0xba75('0x106')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x107'));db[_0xba75('0x108')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x109'));db[_0xba75('0x10a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10b'));db['UserVoicePrefix']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10c'));db[_0xba75('0x13')][_0xba75('0x10d')](db[_0xba75('0x1f')],{'as':'VoiceMail','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x2c')],{'as':_0xba75('0x111'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x112'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x13')][_0xba75('0x110')](db['CmHopperFinal'],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x114'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['OpenchannelInteraction'],{'as':_0xba75('0x116'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xba75('0x13')]['hasMany'](db[_0xba75('0xf9')],{'as':_0xba75('0x11b'),'foreignKey':_0xba75('0x11c')});db[_0xba75('0x13')]['belongsTo'](db[_0xba75('0x11d')],{'as':_0xba75('0x11d'),'foreignKey':'userProfileId'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x70')],{'as':_0xba75('0x11f'),'through':'chat_group_has_users'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db['CmList'],{'as':_0xba75('0x121'),'through':'cm_user_has_lists'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x122')});db['User']['belongsToMany'](db[_0xba75('0x123')],{'as':'MailInteractions','through':_0xba75('0x124')});db['User'][_0xba75('0x11e')](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'through':_0xba75('0x126')});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'through':_0xba75('0x127')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'through':_0xba75('0x128')});db['User'][_0xba75('0x11e')](db[_0xba75('0x63')],{'as':_0xba75('0x116'),'through':'user_has_openchannel_interactions'});db[_0xba75('0x13')][_0xba75('0x11e')](db['WhatsappInteraction'],{'as':_0xba75('0x129'),'through':_0xba75('0x12a')});db['User']['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x12b'),'through':'UserVoiceQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db['VoicePrefix'],{'as':_0xba75('0x12c'),'through':_0xba75('0x12d'),'required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x41')],{'as':_0xba75('0x12e'),'through':_0xba75('0x32'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x6e')],{'as':_0xba75('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xba75('0x11e')](db['FaxQueue'],{'as':_0xba75('0x130'),'through':'UserFaxQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'as':_0xba75('0x131'),'through':_0xba75('0x36'),'required':![]});db['User'][_0xba75('0x11e')](db[_0xba75('0x132')],{'as':_0xba75('0x133'),'through':_0xba75('0x38'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x104')],{'as':_0xba75('0x134'),'through':_0xba75('0x3a'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0xf2')],{'through':'cm_user_has_lists'});db['User'][_0xba75('0x11e')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xba75('0x135')});db[_0xba75('0x13')][_0xba75('0x11e')](db['FaxAccount'],{'as':_0xba75('0x136'),'through':'user_has_fax_accounts'});db[_0xba75('0x13')][_0xba75('0x11e')](db['MailAccount'],{'as':'MailAccounts','through':_0xba75('0x137')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5f')],{'as':_0xba75('0x138'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x56')],{'as':'SmsAccounts','through':_0xba75('0x139')});db['User'][_0xba75('0x11e')](db[_0xba75('0x13a')],{'as':_0xba75('0x13b'),'through':_0xba75('0x13c')});db[_0xba75('0x13')][_0xba75('0x11e')](db['SquareProject'],{'as':'SquareProjects','through':_0xba75('0x13d')});db[_0xba75('0x13e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x13f'),'onDelete':'cascade','foreignKey':_0xba75('0x140')});db[_0xba75('0x141')][_0xba75('0x110')](db[_0xba75('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x142'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x19')][_0xba75('0x11e')](db[_0xba75('0x143')],{'as':_0xba75('0x144'),'through':_0xba75('0x145')});db['VoiceQueue'][_0xba75('0x110')](db['UserVoiceQueueRt'],{'as':_0xba75('0x146'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['CmHopper'],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')]['hasMany'](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x147')});db['VoiceQueue'][_0xba75('0x110')](db['JscriptySessionReport'],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x14b')](db[_0xba75('0x29')],{'as':'Trunk','foreignKey':_0xba75('0x14c')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x14d'),'foreignKey':_0xba75('0x14e')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Interval'],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db['VoiceQueue'][_0xba75('0x14b')](db['Pause'],{'as':_0xba75('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'Lists','through':_0xba75('0x151')});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'as':'Teams','through':_0xba75('0x108')});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x152')});db['VoiceRecording'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1d')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1f')]['hasMany'](db[_0xba75('0x153')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x155'),'sourceKey':_0xba75('0x156')});db['VoiceMailMessage'][_0xba75('0x14b')](db[_0xba75('0x1f')],{'foreignKey':_0xba75('0x155'),'targetKey':_0xba75('0x156')});db[_0xba75('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':_0xba75('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0xba75('0x22')][_0xba75('0x110')](db[_0xba75('0x158')],{'as':_0xba75('0x159'),'foreignKey':_0xba75('0x15a'),'constraints':![]});db[_0xba75('0x22')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':'UserId'});db[_0xba75('0x22')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x3c')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x15d'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x3e')]['belongsTo'](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasOne'](db[_0xba75('0x3c')],{'as':_0xba75('0x15f'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x10d')](db['MailServerOut'],{'as':_0xba75('0x160'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x15e'),'onDelete':_0xba75('0x10e')});db['MailAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'foreignKey':'MailAccountId'});db[_0xba75('0x15d')][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x164')],{'as':'Applications'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db['MailAccount'][_0xba75('0x14b')](db[_0xba75('0x91')],{'as':_0xba75('0x91'),'foreignKey':'TemplateId'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db[_0xba75('0x15d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x137')});db['MailQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x32')});db[_0xba75('0x41')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_mail_queues','as':_0xba75('0x167')});db[_0xba75('0x123')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'onDelete':'cascade','foreignKey':_0xba75('0x168')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x123')]['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16d')});db['MailInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16e')});db[_0xba75('0x123')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':'user_has_mail_interactions','foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':_0xba75('0x171'),'onDelete':'cascade'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db[_0xba75('0x46')]['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x46')]['belongsTo'](db['MailInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'ChatWebsite','foreignKey':_0xba75('0x173')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db['MailApplication'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')][_0xba75('0x14b')](db['MailQueue'],{'onDelete':_0xba75('0x175')});db['MailApplication']['belongsTo'](db[_0xba75('0x15d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')]['belongsTo'](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x164')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db['MailQueueReport'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db['MailQueueReport']['belongsTo'](db[_0xba75('0x13')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x41')],{});db[_0xba75('0x4a')][_0xba75('0x110')](db[_0xba75('0x4c')],{'as':_0xba75('0x179'),'onDelete':'cascade'});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'FaxAccountId','onDelete':_0xba75('0x10e')});db['FaxAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x17a')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x163')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x50')],{'as':_0xba75('0x142')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x17b'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x52')],{'as':_0xba75('0x154')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x29')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x4e')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x4e')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x17d')});db[_0xba75('0x50')][_0xba75('0x14b')](db['User'],{'onDelete':'restrict'});db[_0xba75('0x50')][_0xba75('0x14b')](db[_0xba75('0x17e')],{'onDelete':_0xba75('0x175')});db['FaxApplication'][_0xba75('0x14b')](db[_0xba75('0x4e')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x50')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db['FaxInteraction']['hasMany'](db['FaxMessage'],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':_0xba75('0x169'),'foreignKey':'FaxAccountId'});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x118')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16d')});db['FaxInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16e')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x127'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x52')][_0xba75('0x14b')](db['FaxInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x17f')});db['FaxMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':'AttachmentId'});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':'Account','foreignKey':_0xba75('0x17a')});db['FaxQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x34')});db['FaxQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxAccount'],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0x52')],{});db['FaxQueueReport'][_0xba75('0x14b')](db['User'],{});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxQueue'],{});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x181'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')]['hasMany'](db['SmsInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x56')]['hasMany'](db[_0xba75('0x58')],{'as':_0xba75('0x142')});db['SmsAccount'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x56')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db['SmsAccount']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x139')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x5d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x56')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x87')],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0x58')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db[_0xba75('0x5a')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5a')][_0xba75('0x14b')](db['SmsAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x5a')]['belongsTo'](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['SmsInteraction'][_0xba75('0x11e')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction']['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x183'),'as':'ThroughTags'});db[_0xba75('0x5a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x128'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':'User'});db['SmsMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x5a')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':'SmsInteractionId'});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x56')],{'as':_0xba75('0x169'),'foreignKey':'SmsAccountId'});db[_0xba75('0x5d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x36'),'foreignKey':_0xba75('0x184')});db['SmsQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'OpenchannelAccountId','onDelete':_0xba75('0x10e')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x185')});db['OpenchannelAccount'][_0xba75('0x110')](db[_0xba75('0x63')],{'as':_0xba75('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xba75('0x5f')][_0xba75('0x110')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x61')],{'as':_0xba75('0x142'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x5f')]['belongsTo'](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x5f')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x61')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x61')][_0xba75('0x14b')](db['OpenchannelQueue'],{'onDelete':_0xba75('0x175'),'foreignKey':'OpenchannelQueueId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x5f')],{'onDelete':'restrict','foreignKey':_0xba75('0x185')});db['OpenchannelApplication'][_0xba75('0x14b')](db[_0xba75('0x87')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x63')][_0xba75('0x110')](db[_0xba75('0x186')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x187')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x63')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':'Tags'});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':_0xba75('0x16e')});db[_0xba75('0x63')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x189'),'foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':'cascade','as':'User'});db[_0xba75('0x186')]['belongsTo'](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x63')],{'onDelete':_0xba75('0x10e'),'as':'Interaction','foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db['Attachment'],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':'Account','foreignKey':_0xba75('0x185')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x38'),'foreignKey':_0xba75('0x18b')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x18c'),'as':_0xba75('0x167')});db['ChatWebsite'][_0xba75('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xba75('0x173'),'onDelete':'cascade'});db['ChatWebsite'][_0xba75('0x110')](db['CannedAnswer'],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x18d')],{'as':'ProactiveActions'});db[_0xba75('0x66')][_0xba75('0x110')](db['ChatInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x142')});db[_0xba75('0x66')]['hasMany'](db['ChatMessage'],{'as':_0xba75('0x154')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':'Interval','foreignKey':_0xba75('0x14f')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x66')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x135')});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x5f')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x18e')][_0xba75('0x14b')](db['CmContact'],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x63')],{});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x186')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x132')],{});db[_0xba75('0x68')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x18f'),'foreignKey':_0xba75('0x10f'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xba75('0x6e')],{'as':_0xba75('0x190'),'foreignKey':_0xba75('0x191'),'onDelete':'restrict'});db['ChatApplication'][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173'),'onDelete':'restrict'});db[_0xba75('0x68')]['belongsTo'](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['ChatInteraction'][_0xba75('0x110')](db[_0xba75('0x192')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x193')});db[_0xba75('0x6a')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6a')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6a')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db['ChatInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xba75('0x6a')][_0xba75('0x11e')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xba75('0x16e')});db[_0xba75('0x6a')]['belongsToMany'](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x126'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x192')][_0xba75('0x14b')](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db[_0xba75('0x192')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x172'),'foreignKey':_0xba75('0x193')});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db[_0xba75('0x192')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6d')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':'Attachments','foreignKey':_0xba75('0x174'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x6d')][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6d')][_0xba75('0x14b')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xba75('0x173')});db[_0xba75('0x6e')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x30'),'hooks':!![]});db['ChatQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_chat_queues','as':'Teams'});db[_0xba75('0x70')][_0xba75('0x110')](db[_0xba75('0xcd')],{'as':'Messages','foreignKey':_0xba75('0x194'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x70')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x146'),'through':_0xba75('0x195')});db[_0xba75('0x18d')]['belongsTo'](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173')});db['CmCompany'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xba75('0x74')][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x197')],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'ContactId','onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':'FaxInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db['CmContact'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x14b')](db[_0xba75('0x72')],{'as':_0xba75('0x198'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x199')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'as':'Tags','through':_0xba75('0x19a')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x19a'),'as':_0xba75('0x16e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xba75('0x10f')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0xe2')],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':'OwnerId'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db['CmHopperBlack'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':'cascade'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db[_0xba75('0x78')]['belongsTo'](db['Campaign'],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db['Automation'][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19c'),'singular':_0xba75('0x19d')},'foreignKey':_0xba75('0x19e'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19f'),'singular':_0xba75('0x1a0')},'foreignKey':'AutomationAnyId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x1a1')],{'as':_0xba75('0x1a2'),'foreignKey':_0xba75('0x1a3'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x84')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ParentId','onDelete':'cascade'});db['Interval'][_0xba75('0x110')](db[_0xba75('0x87')],{'as':'Intervals','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x10e'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xba75('0x18')],{'as':'Extensions','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x175')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x164')],{'as':_0xba75('0x1a4'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x1a5'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db['FaxApplication'],{'as':_0xba75('0x1a6'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x58')],{'as':'SmsApplications','foreignKey':_0xba75('0x14f')});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x1a7')],{'foreignKey':'DefaultReportId'});db[_0xba75('0x8e')]['belongsTo'](db[_0xba75('0x99')],{'foreignKey':'CustomReportId'});db[_0xba75('0x143')]['belongsToMany'](db[_0xba75('0x19')],{'as':_0xba75('0x1a8'),'through':_0xba75('0x145'),'onDelete':_0xba75('0x175')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x74')],{'through':_0xba75('0x19a')});db[_0xba75('0x16b')]['belongsToMany'](db['ChatInteraction'],{'through':_0xba75('0x1a9')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x123')],{'through':_0xba75('0x16c')});db['Tag'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'through':_0xba75('0x183')});db['Tag']['belongsToMany'](db[_0xba75('0x118')],{'through':_0xba75('0x180')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x63')],{'through':'openchannel_interaction_has_tags'});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0xfe')],{'through':_0xba75('0x1aa')});db['Trigger']['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ab'),'singular':_0xba75('0x1ac')},'foreignKey':_0xba75('0x1ad'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x92')][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xba75('0x1af'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x99')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xba75('0x1b0'),'hooks':!![]});db[_0xba75('0x1a7')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b2')});db[_0xba75('0x1b3')][_0xba75('0x110')](db['AnalyticFieldReport'],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b4')});db[_0xba75('0x9c')]['belongsTo'](db[_0xba75('0x1b3')],{'foreignKey':_0xba75('0x1b4')});db[_0xba75('0xa0')][_0xba75('0x110')](db[_0xba75('0xa2')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa2')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['SalesforceConfiguration']['hasMany'](db[_0xba75('0xa3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa2')]['belongsTo'](db[_0xba75('0xa0')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['SalesforceField'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa3')][_0xba75('0x110')](db['SalesforceField'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xa3')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa3')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':'VariableId'});db[_0xba75('0x1bd')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa5')]['hasMany'](db[_0xba75('0xa7')],{'as':_0xba75('0x1b6'),'onDelete':'cascade','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa5')][_0xba75('0x110')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa5')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xba75('0x14b')](db[_0xba75('0x1bd')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa7')]['hasMany'](db['SugarcrmField'],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['SugarcrmField'][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa7')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa7')][_0xba75('0x14b')](db['Variable'],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c1')]['hasMany'](db[_0xba75('0x1c2')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1c2')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['DeskConfiguration'][_0xba75('0x14b')](db['DeskAccount'],{'as':_0xba75('0x169'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c3')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0xba75('0x1c4')]['hasMany'](db[_0xba75('0x1c5')],{'as':_0xba75('0x1be'),'onDelete':'cascade','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c5')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db['ZohoConfiguration'][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c5')]['belongsTo'](db[_0xba75('0x1c4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xab')]['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZohoField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xad')][_0xba75('0x110')](db[_0xba75('0x1c6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1b6'),'foreignKey':'SubjectId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c6')][_0xba75('0x14b')](db[_0xba75('0xad')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c6')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c7')});db[_0xba75('0xaf')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['ZendeskField'][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xaf')]['hasMany'](db[_0xba75('0xaf')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZendeskField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0xb1')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')]['hasMany'](db[_0xba75('0xb5')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb3')][_0xba75('0x110')](db['FreshdeskField'],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb3')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xba75('0xb3')][_0xba75('0x14b')](db['FreshdeskAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xba75('0xb5')]['hasMany'](db[_0xba75('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb5')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0xb5')]['belongsTo'](db['Variable'],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c8')][_0xba75('0x110')](db[_0xba75('0xb8')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb8')][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb8')]['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['VtigerConfiguration']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db['VtigerConfiguration'][_0xba75('0x14b')](db['VtigerAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['VtigerField']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['VtigerField'][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0x1c9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ServicenowAccount'][_0xba75('0x110')](db[_0xba75('0x1ca')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':_0xba75('0x1b6'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1ca')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1ca')][_0xba75('0x14b')](db[_0xba75('0xba')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xbd')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xbd')][_0xba75('0x110')](db['ServicenowField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['ServicenowField'][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xbd')]['belongsTo'](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db['Dynamics365Account'][_0xba75('0x110')](db[_0xba75('0xc1')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0xc1')][_0xba75('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['Dynamics365Configuration'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc1')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['Dynamics365Configuration'][_0xba75('0x14b')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xba75('0x1b5')});db['Dynamics365Field'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db[_0xba75('0xc3')]['hasMany'](db['Dynamics365Field'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xc3')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xc4')][_0xba75('0x110')](db[_0xba75('0xc6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesConfiguration'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Descriptions','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xc6')][_0xba75('0x14b')](db[_0xba75('0xc4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subject','foreignKey':_0xba75('0x1b7')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1cb')][_0xba75('0x110')](db['FreshsalesField'],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1cb')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ChatQueueReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0x6a')],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xcb')]['belongsTo'](db['User'],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x6e')],{});db['ChatInternalMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cc')});db[_0xba75('0xcd')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cd')});db[_0xba75('0x197')][_0xba75('0x110')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xba75('0x197')][_0xba75('0x110')](db[_0xba75('0xcf')],{'foreignKey':_0xba75('0x1ce'),'onDelete':'cascade'});db[_0xba75('0xd3')]['belongsTo'](db[_0xba75('0x56')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db['SmsQueueReport']['belongsTo'](db[_0xba75('0x5d')],{});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptySessionReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db[_0xba75('0x1d0')],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0x1d1')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x13d')});db['Team'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x122')});db[_0xba75('0xdf')]['belongsToMany'](db['VoiceQueue'],{'through':_0xba75('0x108'),'as':_0xba75('0x12b')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x41')],{'through':_0xba75('0x1d2'),'as':'MailQueues'});db[_0xba75('0xdf')][_0xba75('0x11e')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xba75('0x12f')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x17e')],{'through':'team_has_fax_queues','as':_0xba75('0x130')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'through':_0xba75('0x1d3'),'as':_0xba75('0x131')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x132')],{'through':_0xba75('0x18c'),'as':_0xba75('0x133')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x104')],{'through':_0xba75('0x1d4'),'as':_0xba75('0x134')});db['Team']['belongsToMany'](db[_0xba75('0xf4')],{'through':_0xba75('0x10a'),'as':_0xba75('0x12c')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xba75('0xe2')]['hasMany'](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x1d5')});db['Campaign']['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x29'),'foreignKey':_0xba75('0x14c')});db[_0xba75('0xe2')]['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x14d'),'foreignKey':'TrunkBackupId'});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x1d1')],{'as':_0xba75('0x1d1'),'foreignKey':_0xba75('0x1d6')});db[_0xba75('0xe2')]['belongsToMany'](db[_0xba75('0xf2')],{'as':_0xba75('0x121'),'through':_0xba75('0x1d7')});db[_0xba75('0xe2')][_0xba75('0x11e')](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x1d8')});db[_0xba75('0x170')]['belongsTo'](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db['MailTransferReport'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':_0xba75('0x1d9'),'as':'FromAccount'});db[_0xba75('0xe9')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x41')],{'foreignKey':'ToMailQueueId','as':_0xba75('0x1de')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':'ToMailAccountId','as':_0xba75('0x1df')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xea')]['belongsTo'](db[_0xba75('0x6a')],{});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e0'),'as':'FromAccount'});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':'FromAgent'});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x6e')],{'foreignKey':'ToChatQueueId','as':_0xba75('0x1de')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e1'),'as':'ToAccount'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x52')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'foreignKey':_0xba75('0x1e2'),'as':_0xba75('0x1e3')});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':_0xba75('0x1db')});db[_0xba75('0xec')][_0xba75('0x14b')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x17e')],{'foreignKey':_0xba75('0x1e4'),'as':_0xba75('0x1de')});db[_0xba75('0xec')][_0xba75('0x14b')](db['FaxAccount'],{'foreignKey':_0xba75('0x1e5'),'as':'ToAccount'});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelMessage'],{});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelInteraction'],{});db[_0xba75('0xee')]['belongsTo'](db[_0xba75('0x5f')],{'foreignKey':_0xba75('0x1e6'),'as':_0xba75('0x1e3')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xee')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db[_0xba75('0x132')],{'foreignKey':_0xba75('0x1e7'),'as':_0xba75('0x1de')});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db['SmsTransferReport'][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':_0xba75('0x1e8'),'as':_0xba75('0x1e3')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['SmsQueue'],{'foreignKey':_0xba75('0x1e9'),'as':_0xba75('0x1de')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':'ToSmsAccountId','as':_0xba75('0x1df')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0xf2')][_0xba75('0x110')](db['CmCustomField'],{'as':_0xba75('0x1ea'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':'Contacts','onDelete':_0xba75('0x10e'),'foreignKey':'ListId'});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistory','foreignKey':_0xba75('0x178')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':'ListId'});db[_0xba75('0xf2')]['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x1eb'),'through':_0xba75('0x151')});db[_0xba75('0xf2')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x1ec')});db[_0xba75('0xf4')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':'Extensions','onDelete':_0xba75('0x10e')});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x10a'),'as':'Teams'});db[_0xba75('0x11d')]['hasMany'](db['User'],{'as':_0xba75('0x16f'),'foreignKey':_0xba75('0x1ed')});db[_0xba75('0x11d')][_0xba75('0x110')](db[_0xba75('0xf6')],{'as':_0xba75('0x1ee'),'foreignKey':_0xba75('0x1ed'),'onDelete':_0xba75('0x10e')});db[_0xba75('0xf6')][_0xba75('0x110')](db[_0xba75('0x1ef')],{'as':_0xba75('0x1f0'),'foreignKey':'sectionId','onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':'Dispositions','foreignKey':_0xba75('0x1f1'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')]['hasMany'](db[_0xba75('0x82')],{'as':'Answers','foreignKey':_0xba75('0x1f1')});db['WhatsappAccount'][_0xba75('0x110')](db[_0xba75('0xff')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappApplication'],{'as':'Applications'});db[_0xba75('0x13a')]['belongsTo'](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x13a')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x13a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x13c')});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['WhatsappQueue'],{'onDelete':_0xba75('0x175')});db['WhatsappApplication'][_0xba75('0x14b')](db[_0xba75('0x13a')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['WhatsappInteraction'][_0xba75('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xfe')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':'Account','foreignKey':_0xba75('0x1f1')});db['WhatsappInteraction'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0xba75('0x14b')](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'whatsapp_interaction_has_tags','as':_0xba75('0x16d')});db[_0xba75('0xfe')][_0xba75('0x11e')](db['Tag'],{'through':_0xba75('0x1aa'),'as':_0xba75('0x16e')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x12a'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db['WhatsappMessage']['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0xfe')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x13a')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x101')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0xfe')],{});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x104')],{});db[_0xba75('0x101')]['belongsTo'](db[_0xba75('0xff')],{});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0xff')],{});db[_0xba75('0x102')]['belongsTo'](db[_0xba75('0xfe')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':_0xba75('0x1f3'),'as':_0xba75('0x1df')});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x104')],{'foreignKey':'ToQueueId','as':_0xba75('0x1de')});db['WhatsappTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['WhatsappQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xba75('0x104')][_0xba75('0x11e')](db['Team'],{'through':_0xba75('0x1d4'),'as':_0xba75('0x167')});module[_0xba75('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 0884a09..e8c2c71 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeed7=['./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','./api/chatTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','get','appPath','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','securityToken','code','accessKey','tenantId','channelSecret','accessToken','authToken','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','key','pass','localstationid','registry','isPlainObject','replace','@@{','}@@','includes','lodash','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','user','name','role','inspect','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','responseTime','other','agent_id','agent_name','test','./api/user','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/chatWebsite','./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/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields'];(function(_0x5e2fb1,_0x359dab){var _0x1dfc53=function(_0x567aaa){while(--_0x567aaa){_0x5e2fb1['push'](_0x5e2fb1['shift']());}};_0x1dfc53(++_0x359dab);}(_0xeed7,0x92));var _0x7eed=function(_0x5a237d,_0x72f72){_0x5a237d=_0x5a237d-0x0;var _0x18ed7e=_0xeed7[_0x5a237d];return _0x18ed7e;};'use strict';var _=require(_0x7eed('0x0'));var path=require('path');var express=require(_0x7eed('0x1'));var ewinston=require(_0x7eed('0x2'));var util=require(_0x7eed('0x3'));var errors=require(_0x7eed('0x4'));var config=require(_0x7eed('0x5'));var logger=require(_0x7eed('0x6'))(_0x7eed('0x7'));var authLogger=require('./config/logger')(_0x7eed('0x8'));exports[_0x7eed('0x9')]=function(_0x5d6648){_0x5d6648[_0x7eed('0xa')](ewinston[_0x7eed('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x361261,_0x474229){var _0x222dc1=_0x7eed('0xc');if(!_[_0x7eed('0xd')](_0x361261[_0x7eed('0xe')])){_0x222dc1+=_0x7eed('0xf');var _0x48435e=_0x361261[_0x7eed('0xe')];maskSensitiveData(_0x48435e);}return util[_0x7eed('0x10')](_0x222dc1,_0x361261[_0x7eed('0x11')],_0x361261[_0x7eed('0x12')][_0x7eed('0x13')]?_0x361261[_0x7eed('0x12')][_0x7eed('0x13')]:_0x361261[_0x7eed('0x14')]['remoteAddress']||_0x361261['ip'],_0x361261[_0x7eed('0x15')],_0x474229[_0x7eed('0x16')],_0x474229['responseTime'],_0x361261[_0x7eed('0x17')]?_0x361261['user']['id']:null,_0x361261['user']?_0x361261[_0x7eed('0x17')][_0x7eed('0x18')]:null,_0x361261[_0x7eed('0x17')]?_0x361261[_0x7eed('0x17')][_0x7eed('0x19')]:null,_0x48435e?util[_0x7eed('0x1a')](_0x48435e,![],null):'');}}));_0x5d6648['use'](ewinston[_0x7eed('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4b334a,_0x36866e){var _0x10426e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4b334a[_0x7eed('0xe')]&&_0x4b334a[_0x7eed('0xe')][_0x7eed('0x1b')]&&_0x4b334a[_0x7eed('0xe')]['agent_id']){_0x10426e=_0x7eed('0x1c');}return util[_0x7eed('0x10')](_0x10426e,_0x4b334a['method'],_0x4b334a[_0x7eed('0x12')][_0x7eed('0x13')]?_0x4b334a[_0x7eed('0x12')][_0x7eed('0x13')]:_0x4b334a[_0x7eed('0x14')][_0x7eed('0x1d')]||_0x4b334a['ip'],_0x4b334a[_0x7eed('0x15')],_0x36866e[_0x7eed('0x16')],_0x36866e[_0x7eed('0x1e')],_0x4b334a[_0x7eed('0x17')]?_0x4b334a[_0x7eed('0x17')]['id']:null,_0x4b334a[_0x7eed('0x17')]?_0x4b334a[_0x7eed('0x17')][_0x7eed('0x18')]:null,_0x4b334a[_0x7eed('0x17')]?_0x4b334a[_0x7eed('0x17')][_0x7eed('0x19')]:null,_0x4b334a[_0x7eed('0xe')]&&_0x4b334a[_0x7eed('0xe')]['device']?_0x4b334a[_0x7eed('0xe')]['device']:_0x7eed('0x1f'),_0x4b334a[_0x7eed('0xe')]&&_0x4b334a[_0x7eed('0xe')][_0x7eed('0x20')]?_0x4b334a[_0x7eed('0xe')][_0x7eed('0x20')]:'',_0x4b334a[_0x7eed('0xe')]&&_0x4b334a[_0x7eed('0xe')][_0x7eed('0x21')]?_0x4b334a[_0x7eed('0xe')][_0x7eed('0x21')]:'');},'ignoreRoute':function(_0x844f29){var _0x2730f6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2730f6[_0x7eed('0x22')](_0x844f29[_0x7eed('0x15')]);}}));_0x5d6648[_0x7eed('0xa')]('/api/users',require(_0x7eed('0x23')));_0x5d6648[_0x7eed('0xa')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x5d6648[_0x7eed('0xa')]('/api/voice/contexts',require(_0x7eed('0x24')));_0x5d6648[_0x7eed('0xa')]('/api/voice/extensions',require(_0x7eed('0x25')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x26'),require('./api/voiceMusicOnHold'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x27'),require(_0x7eed('0x28')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x29'),require('./api/voiceRecording'));_0x5d6648[_0x7eed('0xa')]('/api/screen/recordings',require(_0x7eed('0x2a')));_0x5d6648['use']('/api/voice/mails',require('./api/voiceMail'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x2b'),require(_0x7eed('0x2c')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x2d'),require('./api/voiceCallReport'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x2e'),require(_0x7eed('0x2f')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x30'),require(_0x7eed('0x31')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x32'),require(_0x7eed('0x33')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x34'),require('./api/memberReport'));_0x5d6648['use']('/api/trunks',require('./api/trunk'));_0x5d6648['use']('/api/voice/transfers/reports',require(_0x7eed('0x35')));_0x5d6648['use'](_0x7eed('0x36'),require(_0x7eed('0x37')));_0x5d6648[_0x7eed('0xa')]('/api/mail/accounts',require('./api/mailAccount'));_0x5d6648[_0x7eed('0xa')]('/api/mail/queues',require(_0x7eed('0x38')));_0x5d6648['use'](_0x7eed('0x39'),require('./api/mailSubstatus'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x3a'),require(_0x7eed('0x3b')));_0x5d6648['use']('/api/mail/messages',require(_0x7eed('0x3c')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x3d'),require(_0x7eed('0x3e')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x3f'),require(_0x7eed('0x40')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x41'),require('./api/dashboard'));_0x5d6648[_0x7eed('0xa')]('/api/dashboards/items',require(_0x7eed('0x42')));_0x5d6648[_0x7eed('0xa')]('/api/fax/accounts',require('./api/faxAccount'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x43'),require('./api/faxApplication'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x44'),require(_0x7eed('0x45')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x46'),require(_0x7eed('0x47')));_0x5d6648[_0x7eed('0xa')]('/api/fax/queues',require('./api/faxQueue'));_0x5d6648['use'](_0x7eed('0x48'),require(_0x7eed('0x49')));_0x5d6648['use'](_0x7eed('0x4a'),require(_0x7eed('0x4b')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x4c'),require('./api/smsApplication'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x4d'),require('./api/smsInteraction'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x4e'),require(_0x7eed('0x4f')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x50'),require('./api/smsQueue'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x51'),require('./api/openchannelAccount'));_0x5d6648['use'](_0x7eed('0x52'),require(_0x7eed('0x53')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x54'),require(_0x7eed('0x55')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x56'),require('./api/openchannelMessage'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x57'),require('./api/openchannelQueue'));_0x5d6648[_0x7eed('0xa')]('/api/chat/websites',require(_0x7eed('0x58')));_0x5d6648[_0x7eed('0xa')]('/api/openchannel/reports/queue',require(_0x7eed('0x59')));_0x5d6648['use'](_0x7eed('0x5a'),require(_0x7eed('0x5b')));_0x5d6648['use'](_0x7eed('0x5c'),require('./api/chatInteraction'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x5d'),require(_0x7eed('0x5e')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x5f'),require('./api/chatOfflineMessage'));_0x5d6648['use'](_0x7eed('0x60'),require(_0x7eed('0x61')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x62'),require('./api/chatGroup'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x63'),require(_0x7eed('0x64')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x65'),require(_0x7eed('0x66')));_0x5d6648[_0x7eed('0xa')]('/api/cm/contacts',require(_0x7eed('0x67')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x68'),require(_0x7eed('0x69')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x6a'),require(_0x7eed('0x6b')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x6c'),require(_0x7eed('0x6d')));_0x5d6648['use']('/api/cm/hopper_history',require(_0x7eed('0x6e')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x6f'),require(_0x7eed('0x70')));_0x5d6648[_0x7eed('0xa')]('/api/actions',require(_0x7eed('0x71')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x72'),require(_0x7eed('0x73')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x74'),require(_0x7eed('0x75')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x76'),require('./api/disposition'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x77'),require(_0x7eed('0x78')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x79'),require('./api/interval'));_0x5d6648['use'](_0x7eed('0x7a'),require('./api/pause'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x7b'),require(_0x7eed('0x7c')));_0x5d6648['use']('/api/voiceQueuesLog',require(_0x7eed('0x7d')));_0x5d6648[_0x7eed('0xa')]('/api/schedules',require('./api/schedule'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x7e'),require(_0x7eed('0x7f')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x80'),require(_0x7eed('0x81')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x82'),require('./api/template'));_0x5d6648['use'](_0x7eed('0x83'),require(_0x7eed('0x84')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x85'),require(_0x7eed('0x86')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x87'),require('./api/integration'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x88'),require(_0x7eed('0x89')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x8a'),require('./api/analyticCustomReport'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x8b'),require(_0x7eed('0x8c')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x8d'),require(_0x7eed('0x8e')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x8f'),require('./api/analyticMetric'));_0x5d6648[_0x7eed('0xa')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x90'),require('./api/analyticTreeReport'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x91'),require(_0x7eed('0x92')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x93'),require(_0x7eed('0x94')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x95'),require('./api/intSalesforceField'));_0x5d6648['use'](_0x7eed('0x96'),require(_0x7eed('0x97')));_0x5d6648[_0x7eed('0xa')]('/api/integrations/sugarcrm/configurations',require(_0x7eed('0x98')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x99'),require(_0x7eed('0x9a')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x9b'),require(_0x7eed('0x9c')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x9d'),require(_0x7eed('0x9e')));_0x5d6648['use'](_0x7eed('0x9f'),require('./api/intDeskField'));_0x5d6648['use']('/api/integrations/zoho/accounts',require(_0x7eed('0xa0')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xa1'),require(_0x7eed('0xa2')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xa3'),require('./api/intZohoField'));_0x5d6648['use']('/api/integrations/zendesk/accounts',require(_0x7eed('0xa4')));_0x5d6648['use']('/api/integrations/zendesk/configurations',require(_0x7eed('0xa5')));_0x5d6648['use'](_0x7eed('0xa6'),require(_0x7eed('0xa7')));_0x5d6648[_0x7eed('0xa')]('/api/integrations/freshdesk/accounts',require(_0x7eed('0xa8')));_0x5d6648['use'](_0x7eed('0xa9'),require(_0x7eed('0xaa')));_0x5d6648['use'](_0x7eed('0xab'),require(_0x7eed('0xac')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xad'),require(_0x7eed('0xae')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xaf'),require('./api/intVtigerConfiguration'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xb0'),require(_0x7eed('0xb1')));_0x5d6648['use'](_0x7eed('0xb2'),require('./api/intServicenowAccount'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xb3'),require(_0x7eed('0xb4')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xb5'),require(_0x7eed('0xb6')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xb7'),require(_0x7eed('0xb8')));_0x5d6648['use'](_0x7eed('0xb9'),require(_0x7eed('0xba')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xbb'),require(_0x7eed('0xbc')));_0x5d6648[_0x7eed('0xa')]('/api/integrations/freshsales/accounts',require(_0x7eed('0xbd')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xbe'),require(_0x7eed('0xbf')));_0x5d6648['use']('/api/integrations/freshsales/fields',require(_0x7eed('0xc0')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xc1'),require('./api/network'));_0x5d6648[_0x7eed('0xa')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x5d6648[_0x7eed('0xa')]('/api/chat/internal/messages',require(_0x7eed('0xc2')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xc3'),require(_0x7eed('0xc4')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xc5'),require(_0x7eed('0xc6')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xc7'),require('./api/jscriptySessionReport'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xc8'),require('./api/smsQueueReport'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xc9'),require(_0x7eed('0xca')));_0x5d6648[_0x7eed('0xa')]('/api/square/details/reports',require(_0x7eed('0xcb')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xcc'),require(_0x7eed('0xcd')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xce'),require(_0x7eed('0xcf')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xd0'),require(_0x7eed('0xd1')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xd2'),require('./api/squareProject'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xd3'),require(_0x7eed('0xd4')));_0x5d6648['use'](_0x7eed('0xd5'),require(_0x7eed('0xd6')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xd7'),require('./api/team'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xd8'),require('./api/license'));_0x5d6648['use'](_0x7eed('0xd9'),require(_0x7eed('0xda')));_0x5d6648['use'](_0x7eed('0xdb'),require('./api/migration'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xdc'),require(_0x7eed('0xdd')));_0x5d6648['use'](_0x7eed('0xde'),require('./api/plugin'));_0x5d6648['use']('/api/mail/reports/transfer',require(_0x7eed('0xdf')));_0x5d6648[_0x7eed('0xa')]('/api/chat/reports/transfer',require(_0x7eed('0xe0')));_0x5d6648[_0x7eed('0xa')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x5d6648['use'](_0x7eed('0xe1'),require('./api/openchannelTransferReport'));_0x5d6648['use'](_0x7eed('0xe2'),require('./api/smsTransferReport'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xe3'),require(_0x7eed('0xe4')));_0x5d6648[_0x7eed('0xa')]('/api/voice/prefixes',require(_0x7eed('0xe5')));_0x5d6648['use'](_0x7eed('0xe6'),require(_0x7eed('0xe7')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xe8'),require('./api/userProfileSection'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xe9'),require(_0x7eed('0xea')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xeb'),require(_0x7eed('0xec')));_0x5d6648[_0x7eed('0xa')]('/api/whatsapp/accounts',require(_0x7eed('0xed')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xee'),require(_0x7eed('0xef')));_0x5d6648['use']('/api/whatsapp/interactions',require(_0x7eed('0xf0')));_0x5d6648[_0x7eed('0xa')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x5d6648['use'](_0x7eed('0xf1'),require(_0x7eed('0xf2')));_0x5d6648[_0x7eed('0xa')]('/api/whatsapp/reports/transfer',require(_0x7eed('0xf3')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xf4'),require('./api/whatsappQueue'));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xf5'),require(_0x7eed('0xf6')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xf7'),require(_0x7eed('0xf8')));_0x5d6648['use'](_0x7eed('0xf9'),require(_0x7eed('0xfa')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xfb'),require(_0x7eed('0xfc')));_0x5d6648['use']('/api/jira',require(_0x7eed('0xfd')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0xfe'),require(_0x7eed('0xff')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x100'),require(_0x7eed('0x101')));_0x5d6648['use'](_0x7eed('0x102'),require('./api/system'));_0x5d6648[_0x7eed('0xa')]('/api/pm2',require('./api/pm2'));_0x5d6648[_0x7eed('0xa')]('/api/webbar',require(_0x7eed('0x103')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x104'),express[_0x7eed('0x105')](path[_0x7eed('0x106')](config[_0x7eed('0x107')],'/apidoc')));_0x5d6648['use']('/www',express[_0x7eed('0x105')](path[_0x7eed('0x106')](config[_0x7eed('0x107')],'/www')));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x108'),express[_0x7eed('0x105')](path[_0x7eed('0x106')](config[_0x7eed('0x107')],_0x7eed('0x108'))));_0x5d6648[_0x7eed('0xa')](_0x7eed('0x109'),express['static'](path[_0x7eed('0x106')](config['root'],_0x7eed('0x10a'),_0x7eed('0x10b'))));_0x5d6648['use'](_0x7eed('0x10c'),express[_0x7eed('0x105')](path['join'](config[_0x7eed('0x107')],_0x7eed('0x10d'))));_0x5d6648[_0x7eed('0x10e')](_0x7eed('0x10f'))['get'](errors[0x194]);_0x5d6648[_0x7eed('0x10e')]('/*')['get'](function(_0x33e30e,_0x18eea8){_0x18eea8[_0x7eed('0x110')](path['resolve'](_0x5d6648[_0x7eed('0x111')](_0x7eed('0x112'))+'/index.html'));});};var sensitiveFields=[_0x7eed('0x113'),_0x7eed('0x114'),_0x7eed('0x115'),_0x7eed('0x116'),_0x7eed('0x117'),_0x7eed('0x118'),_0x7eed('0x119'),_0x7eed('0x11a'),_0x7eed('0x11b'),_0x7eed('0x11c'),_0x7eed('0x11d'),'clientId','clientSecret',_0x7eed('0x11e'),_0x7eed('0x11f'),_0x7eed('0x120'),_0x7eed('0x121'),'token',_0x7eed('0x122'),_0x7eed('0x123'),'accessTokenSecret',_0x7eed('0x124'),'consumerKey','consumerSecret',_0x7eed('0x125'),_0x7eed('0x126'),_0x7eed('0x127'),_0x7eed('0x128'),_0x7eed('0x129'),_0x7eed('0x12a'),_0x7eed('0x12b'),_0x7eed('0x12c'),'secretaccesskey',_0x7eed('0x12d'),'user',_0x7eed('0x12e'),'accountSid',_0x7eed('0x12f'),'dsn','secret',_0x7eed('0x130'),'oldPassword'];function maskSensitiveData(_0x33442d){var _0x46c747=/(?!^)[\s\S](?!$)/g;if(!_[_0x7eed('0x131')](_0x33442d))return;for(var _0x3718e3 in _0x33442d){if(_['isArray'](_0x33442d[_0x3718e3])){for(var _0x3c34ad=0x0;_0x3c34ad<_0x33442d[_0x3718e3]['length'];_0x3c34ad++){maskSensitiveData(_0x33442d[_0x3718e3][_0x3c34ad]);}}else if(_['isPlainObject'](_0x33442d[_0x3718e3])){maskSensitiveData(_0x33442d[_0x3718e3]);}else if(_['isString'](_0x33442d[_0x3718e3])){_0x33442d[_0x3718e3]=_0x33442d[_0x3718e3][_0x7eed('0x132')](/{{{/g,_0x7eed('0x133'))[_0x7eed('0x132')](/}}}/g,_0x7eed('0x134'))[_0x7eed('0x132')](/{{/g,'@{')[_0x7eed('0x132')](/}}/g,'}@');if(_[_0x7eed('0x135')](sensitiveFields,_0x3718e3)){_0x33442d[_0x3718e3]=_0x33442d[_0x3718e3][_0x7eed('0x132')](_0x46c747,'*');}}}} \ No newline at end of file +var _0xdaca=['./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/cm/lists','./api/voicePrefix','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','street','phone','mobile','fax','email','clientSecret','securityToken','code','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','membername','calleridname','clientEmail','privateKey','accesskeyid','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','isString','replace','}@@','lodash','path','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','responseTime','name','agent_name','test','/api/users','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','/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/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xdaca,0xa4));var _0xadac=function(_0x24a992,_0x5c49eb){_0x24a992=_0x24a992-0x0;var _0x26e1d4=_0xdaca[_0x24a992];return _0x26e1d4;};'use strict';var _=require(_0xadac('0x0'));var path=require(_0xadac('0x1'));var express=require('express');var ewinston=require(_0xadac('0x2'));var util=require(_0xadac('0x3'));var errors=require(_0xadac('0x4'));var config=require(_0xadac('0x5'));var logger=require(_0xadac('0x6'))(_0xadac('0x7'));var authLogger=require(_0xadac('0x6'))(_0xadac('0x8'));exports[_0xadac('0x9')]=function(_0x48015c){_0x48015c[_0xadac('0xa')](ewinston[_0xadac('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x22e876,_0x2a16b8){var _0x19c988=_0xadac('0xc');if(!_[_0xadac('0xd')](_0x22e876['body'])){_0x19c988+=_0xadac('0xe');var _0x5f5aee=_0x22e876['body'];maskSensitiveData(_0x5f5aee);}return util[_0xadac('0xf')](_0x19c988,_0x22e876[_0xadac('0x10')],_0x22e876[_0xadac('0x11')][_0xadac('0x12')]?_0x22e876[_0xadac('0x11')]['x-forwarded-for']:_0x22e876[_0xadac('0x13')][_0xadac('0x14')]||_0x22e876['ip'],_0x22e876[_0xadac('0x15')],_0x2a16b8[_0xadac('0x16')],_0x2a16b8['responseTime'],_0x22e876[_0xadac('0x17')]?_0x22e876[_0xadac('0x17')]['id']:null,_0x22e876[_0xadac('0x17')]?_0x22e876[_0xadac('0x17')]['name']:null,_0x22e876[_0xadac('0x17')]?_0x22e876[_0xadac('0x17')][_0xadac('0x18')]:null,_0x5f5aee?util['inspect'](_0x5f5aee,![],null):'');}}));_0x48015c[_0xadac('0xa')](ewinston[_0xadac('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x117452,_0x57a5f8){var _0x2d038a=_0xadac('0x19');if(_0x117452[_0xadac('0x1a')]&&_0x117452['body'][_0xadac('0x1b')]&&_0x117452[_0xadac('0x1a')][_0xadac('0x1c')]){_0x2d038a=_0xadac('0x1d');}return util['format'](_0x2d038a,_0x117452[_0xadac('0x10')],_0x117452['headers'][_0xadac('0x12')]?_0x117452[_0xadac('0x11')][_0xadac('0x12')]:_0x117452[_0xadac('0x13')][_0xadac('0x14')]||_0x117452['ip'],_0x117452[_0xadac('0x15')],_0x57a5f8[_0xadac('0x16')],_0x57a5f8[_0xadac('0x1e')],_0x117452[_0xadac('0x17')]?_0x117452[_0xadac('0x17')]['id']:null,_0x117452[_0xadac('0x17')]?_0x117452[_0xadac('0x17')][_0xadac('0x1f')]:null,_0x117452[_0xadac('0x17')]?_0x117452[_0xadac('0x17')][_0xadac('0x18')]:null,_0x117452[_0xadac('0x1a')]&&_0x117452[_0xadac('0x1a')]['device']?_0x117452[_0xadac('0x1a')]['device']:'other',_0x117452[_0xadac('0x1a')]&&_0x117452['body'][_0xadac('0x1c')]?_0x117452[_0xadac('0x1a')][_0xadac('0x1c')]:'',_0x117452[_0xadac('0x1a')]&&_0x117452['body'][_0xadac('0x20')]?_0x117452[_0xadac('0x1a')]['agent_name']:'');},'ignoreRoute':function(_0x49493d){var _0x47ff32=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x47ff32[_0xadac('0x21')](_0x49493d[_0xadac('0x15')]);}}));_0x48015c[_0xadac('0xa')](_0xadac('0x22'),require('./api/user'));_0x48015c[_0xadac('0xa')]('/api/voice/chanspy',require(_0xadac('0x23')));_0x48015c[_0xadac('0xa')]('/api/voice/contexts',require(_0xadac('0x24')));_0x48015c['use'](_0xadac('0x25'),require(_0xadac('0x26')));_0x48015c[_0xadac('0xa')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x48015c[_0xadac('0xa')]('/api/voice/queues',require('./api/voiceQueue'));_0x48015c[_0xadac('0xa')](_0xadac('0x27'),require(_0xadac('0x28')));_0x48015c[_0xadac('0xa')](_0xadac('0x29'),require(_0xadac('0x2a')));_0x48015c[_0xadac('0xa')]('/api/voice/mails',require(_0xadac('0x2b')));_0x48015c[_0xadac('0xa')](_0xadac('0x2c'),require(_0xadac('0x2d')));_0x48015c['use'](_0xadac('0x2e'),require(_0xadac('0x2f')));_0x48015c['use']('/api/voice/dials/reports',require(_0xadac('0x30')));_0x48015c['use']('/api/voice/agents/reports',require(_0xadac('0x31')));_0x48015c[_0xadac('0xa')]('/api/voice/queues/reports',require(_0xadac('0x32')));_0x48015c[_0xadac('0xa')](_0xadac('0x33'),require('./api/memberReport'));_0x48015c[_0xadac('0xa')](_0xadac('0x34'),require(_0xadac('0x35')));_0x48015c[_0xadac('0xa')]('/api/voice/transfers/reports',require(_0xadac('0x36')));_0x48015c[_0xadac('0xa')](_0xadac('0x37'),require(_0xadac('0x38')));_0x48015c[_0xadac('0xa')](_0xadac('0x39'),require(_0xadac('0x3a')));_0x48015c[_0xadac('0xa')](_0xadac('0x3b'),require(_0xadac('0x3c')));_0x48015c['use'](_0xadac('0x3d'),require('./api/mailSubstatus'));_0x48015c[_0xadac('0xa')](_0xadac('0x3e'),require(_0xadac('0x3f')));_0x48015c[_0xadac('0xa')]('/api/mail/messages',require(_0xadac('0x40')));_0x48015c[_0xadac('0xa')](_0xadac('0x41'),require(_0xadac('0x42')));_0x48015c['use']('/api/mail/reports/queue',require(_0xadac('0x43')));_0x48015c[_0xadac('0xa')](_0xadac('0x44'),require('./api/dashboard'));_0x48015c['use'](_0xadac('0x45'),require(_0xadac('0x46')));_0x48015c[_0xadac('0xa')](_0xadac('0x47'),require('./api/faxAccount'));_0x48015c['use'](_0xadac('0x48'),require(_0xadac('0x49')));_0x48015c[_0xadac('0xa')](_0xadac('0x4a'),require(_0xadac('0x4b')));_0x48015c['use'](_0xadac('0x4c'),require(_0xadac('0x4d')));_0x48015c[_0xadac('0xa')](_0xadac('0x4e'),require(_0xadac('0x4f')));_0x48015c[_0xadac('0xa')](_0xadac('0x50'),require(_0xadac('0x51')));_0x48015c[_0xadac('0xa')](_0xadac('0x52'),require(_0xadac('0x53')));_0x48015c['use'](_0xadac('0x54'),require('./api/smsApplication'));_0x48015c[_0xadac('0xa')](_0xadac('0x55'),require('./api/smsInteraction'));_0x48015c[_0xadac('0xa')](_0xadac('0x56'),require('./api/smsMessage'));_0x48015c[_0xadac('0xa')]('/api/sms/queues',require(_0xadac('0x57')));_0x48015c[_0xadac('0xa')](_0xadac('0x58'),require(_0xadac('0x59')));_0x48015c[_0xadac('0xa')](_0xadac('0x5a'),require(_0xadac('0x5b')));_0x48015c[_0xadac('0xa')]('/api/openchannel/interactions',require(_0xadac('0x5c')));_0x48015c[_0xadac('0xa')](_0xadac('0x5d'),require(_0xadac('0x5e')));_0x48015c['use']('/api/openchannel/queues',require(_0xadac('0x5f')));_0x48015c[_0xadac('0xa')](_0xadac('0x60'),require('./api/chatWebsite'));_0x48015c['use']('/api/openchannel/reports/queue',require(_0xadac('0x61')));_0x48015c['use']('/api/chat/applications',require('./api/chatApplication'));_0x48015c['use'](_0xadac('0x62'),require(_0xadac('0x63')));_0x48015c[_0xadac('0xa')](_0xadac('0x64'),require(_0xadac('0x65')));_0x48015c[_0xadac('0xa')](_0xadac('0x66'),require(_0xadac('0x67')));_0x48015c['use'](_0xadac('0x68'),require(_0xadac('0x69')));_0x48015c[_0xadac('0xa')](_0xadac('0x6a'),require('./api/chatGroup'));_0x48015c[_0xadac('0xa')](_0xadac('0x6b'),require('./api/chatProactiveAction'));_0x48015c['use']('/api/cm/companies',require('./api/cmCompany'));_0x48015c[_0xadac('0xa')](_0xadac('0x6c'),require(_0xadac('0x6d')));_0x48015c[_0xadac('0xa')](_0xadac('0x6e'),require(_0xadac('0x6f')));_0x48015c[_0xadac('0xa')](_0xadac('0x70'),require(_0xadac('0x71')));_0x48015c[_0xadac('0xa')]('/api/cm/hopper_final',require(_0xadac('0x72')));_0x48015c[_0xadac('0xa')]('/api/cm/hopper_history',require(_0xadac('0x73')));_0x48015c[_0xadac('0xa')](_0xadac('0x74'),require(_0xadac('0x75')));_0x48015c['use'](_0xadac('0x76'),require('./api/action'));_0x48015c[_0xadac('0xa')](_0xadac('0x77'),require('./api/automation'));_0x48015c['use']('/api/canned_answers',require(_0xadac('0x78')));_0x48015c[_0xadac('0xa')](_0xadac('0x79'),require(_0xadac('0x7a')));_0x48015c[_0xadac('0xa')]('/api/conditions',require(_0xadac('0x7b')));_0x48015c[_0xadac('0xa')](_0xadac('0x7c'),require(_0xadac('0x7d')));_0x48015c[_0xadac('0xa')](_0xadac('0x7e'),require(_0xadac('0x7f')));_0x48015c['use']('/api/cdr',require(_0xadac('0x80')));_0x48015c['use'](_0xadac('0x81'),require(_0xadac('0x82')));_0x48015c[_0xadac('0xa')](_0xadac('0x83'),require(_0xadac('0x84')));_0x48015c[_0xadac('0xa')](_0xadac('0x85'),require(_0xadac('0x86')));_0x48015c[_0xadac('0xa')](_0xadac('0x87'),require(_0xadac('0x88')));_0x48015c[_0xadac('0xa')]('/api/templates',require('./api/template'));_0x48015c['use'](_0xadac('0x89'),require(_0xadac('0x8a')));_0x48015c[_0xadac('0xa')](_0xadac('0x8b'),require(_0xadac('0x8c')));_0x48015c[_0xadac('0xa')](_0xadac('0x8d'),require(_0xadac('0x8e')));_0x48015c[_0xadac('0xa')](_0xadac('0x8f'),require('./api/integrationReport'));_0x48015c['use'](_0xadac('0x90'),require('./api/analyticCustomReport'));_0x48015c['use'](_0xadac('0x91'),require(_0xadac('0x92')));_0x48015c[_0xadac('0xa')](_0xadac('0x93'),require(_0xadac('0x94')));_0x48015c[_0xadac('0xa')](_0xadac('0x95'),require('./api/analyticMetric'));_0x48015c[_0xadac('0xa')](_0xadac('0x96'),require(_0xadac('0x97')));_0x48015c[_0xadac('0xa')]('/api/analytics/tree_reports',require(_0xadac('0x98')));_0x48015c['use']('/api/integrations/salesforce/accounts',require(_0xadac('0x99')));_0x48015c[_0xadac('0xa')]('/api/integrations/salesforce/configurations',require(_0xadac('0x9a')));_0x48015c[_0xadac('0xa')](_0xadac('0x9b'),require(_0xadac('0x9c')));_0x48015c['use'](_0xadac('0x9d'),require(_0xadac('0x9e')));_0x48015c[_0xadac('0xa')](_0xadac('0x9f'),require(_0xadac('0xa0')));_0x48015c['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x48015c[_0xadac('0xa')](_0xadac('0xa1'),require('./api/intDeskAccount'));_0x48015c['use'](_0xadac('0xa2'),require(_0xadac('0xa3')));_0x48015c[_0xadac('0xa')](_0xadac('0xa4'),require(_0xadac('0xa5')));_0x48015c[_0xadac('0xa')]('/api/integrations/zoho/accounts',require(_0xadac('0xa6')));_0x48015c[_0xadac('0xa')](_0xadac('0xa7'),require(_0xadac('0xa8')));_0x48015c[_0xadac('0xa')](_0xadac('0xa9'),require(_0xadac('0xaa')));_0x48015c[_0xadac('0xa')](_0xadac('0xab'),require(_0xadac('0xac')));_0x48015c['use'](_0xadac('0xad'),require('./api/intZendeskConfiguration'));_0x48015c[_0xadac('0xa')](_0xadac('0xae'),require('./api/intZendeskField'));_0x48015c[_0xadac('0xa')](_0xadac('0xaf'),require(_0xadac('0xb0')));_0x48015c['use'](_0xadac('0xb1'),require(_0xadac('0xb2')));_0x48015c[_0xadac('0xa')](_0xadac('0xb3'),require(_0xadac('0xb4')));_0x48015c['use'](_0xadac('0xb5'),require(_0xadac('0xb6')));_0x48015c[_0xadac('0xa')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x48015c[_0xadac('0xa')](_0xadac('0xb7'),require(_0xadac('0xb8')));_0x48015c['use'](_0xadac('0xb9'),require(_0xadac('0xba')));_0x48015c[_0xadac('0xa')]('/api/integrations/servicenow/configurations',require(_0xadac('0xbb')));_0x48015c['use']('/api/integrations/servicenow/fields',require(_0xadac('0xbc')));_0x48015c['use'](_0xadac('0xbd'),require('./api/intDynamics365Account'));_0x48015c[_0xadac('0xa')](_0xadac('0xbe'),require('./api/intDynamics365Configuration'));_0x48015c[_0xadac('0xa')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x48015c[_0xadac('0xa')](_0xadac('0xbf'),require('./api/intFreshsalesAccount'));_0x48015c[_0xadac('0xa')](_0xadac('0xc0'),require(_0xadac('0xc1')));_0x48015c[_0xadac('0xa')](_0xadac('0xc2'),require(_0xadac('0xc3')));_0x48015c['use'](_0xadac('0xc4'),require('./api/network'));_0x48015c[_0xadac('0xa')](_0xadac('0xc5'),require(_0xadac('0xc6')));_0x48015c[_0xadac('0xa')](_0xadac('0xc7'),require('./api/chatInternalMessage'));_0x48015c[_0xadac('0xa')](_0xadac('0xc8'),require('./api/jscriptyAnswerReport'));_0x48015c['use'](_0xadac('0xc9'),require(_0xadac('0xca')));_0x48015c['use'](_0xadac('0xcb'),require(_0xadac('0xcc')));_0x48015c[_0xadac('0xa')]('/api/sms/reports/queue',require(_0xadac('0xcd')));_0x48015c['use'](_0xadac('0xce'),require('./api/squareReport'));_0x48015c[_0xadac('0xa')]('/api/square/details/reports',require(_0xadac('0xcf')));_0x48015c[_0xadac('0xa')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x48015c[_0xadac('0xa')](_0xadac('0xd0'),require(_0xadac('0xd1')));_0x48015c['use']('/api/square/odbc',require(_0xadac('0xd2')));_0x48015c[_0xadac('0xa')](_0xadac('0xd3'),require(_0xadac('0xd4')));_0x48015c[_0xadac('0xa')]('/api/square/recordings',require(_0xadac('0xd5')));_0x48015c['use']('/api/square/messages',require(_0xadac('0xd6')));_0x48015c[_0xadac('0xa')](_0xadac('0xd7'),require(_0xadac('0xd8')));_0x48015c[_0xadac('0xa')]('/api/license',require(_0xadac('0xd9')));_0x48015c[_0xadac('0xa')](_0xadac('0xda'),require(_0xadac('0xdb')));_0x48015c[_0xadac('0xa')](_0xadac('0xdc'),require(_0xadac('0xdd')));_0x48015c[_0xadac('0xa')](_0xadac('0xde'),require(_0xadac('0xdf')));_0x48015c['use'](_0xadac('0xe0'),require(_0xadac('0xe1')));_0x48015c['use'](_0xadac('0xe2'),require(_0xadac('0xe3')));_0x48015c[_0xadac('0xa')](_0xadac('0xe4'),require(_0xadac('0xe5')));_0x48015c['use']('/api/fax/reports/transfer',require(_0xadac('0xe6')));_0x48015c[_0xadac('0xa')]('/api/openchannel/reports/transfer',require(_0xadac('0xe7')));_0x48015c[_0xadac('0xa')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x48015c[_0xadac('0xa')](_0xadac('0xe8'),require('./api/cmList'));_0x48015c[_0xadac('0xa')]('/api/voice/prefixes',require(_0xadac('0xe9')));_0x48015c['use']('/api/userProfiles',require(_0xadac('0xea')));_0x48015c[_0xadac('0xa')]('/api/userProfile/sections',require(_0xadac('0xeb')));_0x48015c['use']('/api/userProfile/resources',require(_0xadac('0xec')));_0x48015c[_0xadac('0xa')](_0xadac('0xed'),require('./api/userNotification'));_0x48015c[_0xadac('0xa')]('/api/whatsapp/accounts',require(_0xadac('0xee')));_0x48015c[_0xadac('0xa')](_0xadac('0xef'),require(_0xadac('0xf0')));_0x48015c['use'](_0xadac('0xf1'),require(_0xadac('0xf2')));_0x48015c[_0xadac('0xa')]('/api/whatsapp/messages',require(_0xadac('0xf3')));_0x48015c[_0xadac('0xa')](_0xadac('0xf4'),require('./api/whatsappQueueReport'));_0x48015c[_0xadac('0xa')](_0xadac('0xf5'),require(_0xadac('0xf6')));_0x48015c['use'](_0xadac('0xf7'),require(_0xadac('0xf8')));_0x48015c[_0xadac('0xa')](_0xadac('0xf9'),require(_0xadac('0xfa')));_0x48015c[_0xadac('0xa')](_0xadac('0xfb'),require('./api/realtime'));_0x48015c['use'](_0xadac('0xfc'),require(_0xadac('0xfd')));_0x48015c[_0xadac('0xa')]('/api/auth/google',require(_0xadac('0xfe')));_0x48015c['use'](_0xadac('0xff'),require(_0xadac('0x100')));_0x48015c['use'](_0xadac('0x101'),require(_0xadac('0x102')));_0x48015c['use'](_0xadac('0x103'),require(_0xadac('0x104')));_0x48015c[_0xadac('0xa')](_0xadac('0x105'),require('./api/system'));_0x48015c[_0xadac('0xa')]('/api/pm2',require(_0xadac('0x106')));_0x48015c[_0xadac('0xa')](_0xadac('0x107'),require(_0xadac('0x108')));_0x48015c[_0xadac('0xa')](_0xadac('0x109'),express[_0xadac('0x10a')](path[_0xadac('0x10b')](config[_0xadac('0x10c')],'/apidoc')));_0x48015c['use'](_0xadac('0x10d'),express[_0xadac('0x10a')](path[_0xadac('0x10b')](config[_0xadac('0x10c')],'/www')));_0x48015c[_0xadac('0xa')](_0xadac('0x10e'),express[_0xadac('0x10a')](path[_0xadac('0x10b')](config['root'],_0xadac('0x10e'))));_0x48015c['use'](_0xadac('0x10f'),express[_0xadac('0x10a')](path[_0xadac('0x10b')](config[_0xadac('0x10c')],_0xadac('0x110'),_0xadac('0x111'))));_0x48015c['use'](_0xadac('0x112'),express[_0xadac('0x10a')](path[_0xadac('0x10b')](config['root'],_0xadac('0x113'))));_0x48015c[_0xadac('0x114')](_0xadac('0x115'))['get'](errors[0x194]);_0x48015c[_0xadac('0x114')]('/*')[_0xadac('0x116')](function(_0x32ba6,_0xa568d2){_0xa568d2['sendFile'](path[_0xadac('0x117')](_0x48015c[_0xadac('0x116')](_0xadac('0x118'))+_0xadac('0x119')));});};var sensitiveFields=[_0xadac('0x11a'),_0xadac('0x11b'),_0xadac('0x11c'),_0xadac('0x11d'),_0xadac('0x11e'),'lastName',_0xadac('0x11f'),_0xadac('0x120'),_0xadac('0x121'),_0xadac('0x122'),_0xadac('0x123'),'clientId',_0xadac('0x124'),_0xadac('0x125'),_0xadac('0x126'),'accessKey',_0xadac('0x127'),_0xadac('0x128'),_0xadac('0x129'),_0xadac('0x12a'),_0xadac('0x12b'),_0xadac('0x12c'),_0xadac('0x12d'),'consumerSecret',_0xadac('0x12e'),_0xadac('0x12f'),'calleridnum','exten','vidaooApiKey',_0xadac('0x130'),_0xadac('0x131'),_0xadac('0x132'),'secretaccesskey',_0xadac('0x133'),_0xadac('0x17'),_0xadac('0x134'),_0xadac('0x135'),_0xadac('0x136'),_0xadac('0x137'),_0xadac('0x138'),_0xadac('0x139'),_0xadac('0x13a')];function maskSensitiveData(_0x148efc){var _0x20de2a=/(?!^)[\s\S](?!$)/g;if(!_[_0xadac('0x13b')](_0x148efc))return;for(var _0x302320 in _0x148efc){if(_[_0xadac('0x13c')](_0x148efc[_0x302320])){for(var _0x2407d4=0x0;_0x2407d4<_0x148efc[_0x302320]['length'];_0x2407d4++){maskSensitiveData(_0x148efc[_0x302320][_0x2407d4]);}}else if(_[_0xadac('0x13b')](_0x148efc[_0x302320])){maskSensitiveData(_0x148efc[_0x302320]);}else if(_[_0xadac('0x13d')](_0x148efc[_0x302320])){_0x148efc[_0x302320]=_0x148efc[_0x302320][_0xadac('0x13e')](/{{{/g,'@@{')[_0xadac('0x13e')](/}}}/g,_0xadac('0x13f'))[_0xadac('0x13e')](/{{/g,'@{')[_0xadac('0x13e')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x302320)){_0x148efc[_0x302320]=_0x148efc[_0x302320][_0xadac('0x13e')](_0x20de2a,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 97fd984..75f857d 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59fe=['../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueueReport/faxQueueReport.rpc'];(function(_0x2148db,_0x5c0a9d){var _0x152365=function(_0x417036){while(--_0x417036){_0x2148db['push'](_0x2148db['shift']());}};_0x152365(++_0x5c0a9d);}(_0x59fe,0x199));var _0xe59f=function(_0x3addbf,_0x4210e2){_0x3addbf=_0x3addbf-0x0;var _0x5c2baa=_0x59fe[_0x3addbf];return _0x5c2baa;};'use strict';var jayson=require(_0xe59f('0x0'));var BPromise=require(_0xe59f('0x1'));var _=require(_0xe59f('0x2'));var config=require('../config/environment');exports[_0xe59f('0x3')]=function(){return new BPromise(function(_0x53a9d7,_0x4678e0){var _0x3fa458={};_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x5')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x6')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x7')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/voiceRecording/voiceRecording.rpc'));_0x3fa458=_['merge'](_0x3fa458,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x8')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x9')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0xa')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0xb')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/trunk/trunk.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0xc')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0xd')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0xe')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0xf')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x10')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/mailInteraction/mailInteraction.rpc'));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x11')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x12')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x13')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x14')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x15')));_0x3fa458=_['merge'](_0x3fa458,require('../api/faxInteraction/faxInteraction.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/faxMessage/faxMessage.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/faxQueue/faxQueue.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x16')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/smsAccount/smsAccount.rpc'));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x17')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x18')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x19')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x1a')));_0x3fa458=_['merge'](_0x3fa458,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x1b')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x1c')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x1d')));_0x3fa458=_['merge'](_0x3fa458,require('../api/chatQueue/chatQueue.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x1e')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/cmHopper/cmHopper.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x1f')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x20')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x21')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x22')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x23')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x24')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x25')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x26')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x27')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/variable/variable.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x28')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x29')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x2a')));_0x3fa458=_['merge'](_0x3fa458,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x2b')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x2c')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x2d')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x2e')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x2f')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x30')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x31')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x32')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x33')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x34')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x35')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x36')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/squareMessage/squareMessage.rpc'));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x37')));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x38')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/plugin/plugin.rpc'));_0x3fa458=_['merge'](_0x3fa458,require(_0xe59f('0x39')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x3a')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x3b')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require(_0xe59f('0x3c')));_0x3fa458=_[_0xe59f('0x4')](_0x3fa458,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x124957=jayson[_0xe59f('0x3d')](_0x3fa458)[_0xe59f('0x3e')]();var _0x5db9b6=config[_0xe59f('0x3f')][_0xe59f('0x40')]||config[_0xe59f('0x40')]+0x1;var _0x4f0ce1=config['rpc']['ip']||_0xe59f('0x41');_0x124957['on'](_0xe59f('0x42'),function(_0x2d3917){return _0x4678e0(_0x2d3917);});_0x124957[_0xe59f('0x3')](_0x5db9b6,_0x4f0ce1,function(){console[_0xe59f('0x43')](_0xe59f('0x44'),_0x4f0ce1,_0x5db9b6);require(_0xe59f('0x45'))[_0xe59f('0x46')]();return _0x53a9d7(_0xe59f('0x47')+_0x4f0ce1+':'+_0x5db9b6);});});}; \ No newline at end of file +var _0xa927=['../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xa927,0x10d));var _0x7a92=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa927[_0x2641f9];return _0x585741;};'use strict';var jayson=require(_0x7a92('0x0'));var BPromise=require(_0x7a92('0x1'));var _=require(_0x7a92('0x2'));var config=require(_0x7a92('0x3'));exports[_0x7a92('0x4')]=function(){return new BPromise(function(_0x4d2267,_0x1c6779){var _0x4613cb={};_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x6')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x7')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x8')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x9')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0xa')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0xb')));_0x4613cb=_['merge'](_0x4613cb,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0xc')));_0x4613cb=_['merge'](_0x4613cb,require('../api/trunk/trunk.rpc'));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0xd')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0xe')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0xf')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x10')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x11')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x12')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x13')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x14')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x15')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x16')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x17')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x18')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require('../api/faxMessage/faxMessage.rpc'));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x19')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x1a')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x1b')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x1c')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x1d')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x1e')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x1f')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x20')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x21')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x22')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x23')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x24')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x25')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x26')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require('../api/cmHopper/cmHopper.rpc'));_0x4613cb=_['merge'](_0x4613cb,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x27')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x28')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x29')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x2a')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x2b')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x2c')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x2d')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x2e')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x2f')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x30')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x31')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x32')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x33')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x34')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x35')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x36')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x37')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x38')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x39')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require('../api/squareReport/squareReport.rpc'));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x3a')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x3b')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x3c')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x3d')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require('../api/squareRecording/squareRecording.rpc'));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x3e')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x3f')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x40')));_0x4613cb=_['merge'](_0x4613cb,require('../api/plugin/plugin.rpc'));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x41')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x42')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x43')));_0x4613cb=_[_0x7a92('0x5')](_0x4613cb,require(_0x7a92('0x44')));_0x4613cb=_['merge'](_0x4613cb,require(_0x7a92('0x45')));var _0x2a0ca7=jayson[_0x7a92('0x46')](_0x4613cb)[_0x7a92('0x47')]();var _0x38bb79=config[_0x7a92('0x48')][_0x7a92('0x49')]||config[_0x7a92('0x49')]+0x1;var _0x3805b0=config[_0x7a92('0x48')]['ip']||_0x7a92('0x4a');_0x2a0ca7['on']('error',function(_0x5d692c){return _0x1c6779(_0x5d692c);});_0x2a0ca7[_0x7a92('0x4')](_0x38bb79,_0x3805b0,function(){console[_0x7a92('0x4b')](_0x7a92('0x4c'),_0x3805b0,_0x38bb79);require('../config/triggers')[_0x7a92('0x4d')]();return _0x4d2267(_0x7a92('0x4e')+_0x3805b0+':'+_0x38bb79);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 710e609..c14789e 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 _0x74d3=['E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','answer','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','./reply','setEncoding','utf8','setTimeout','headers','ready','line','hangup','substring','520-Invalid','no\x20code','replace','substr','startsWith','split','length','error','emit','E_AGI_SOCKET_ERROR','code','close','timeout'];(function(_0x1afa38,_0x13bd4d){var _0x404b19=function(_0x3d29da){while(--_0x3d29da){_0x1afa38['push'](_0x1afa38['shift']());}};_0x404b19(++_0x13bd4d);}(_0x74d3,0x159));var _0x374d=function(_0x1c3f84,_0x97d3be){_0x1c3f84=_0x1c3f84-0x0;var _0x9cb33e=_0x74d3[_0x1c3f84];return _0x9cb33e;};'use strict';var util=require(_0x374d('0x0'));var _=require(_0x374d('0x1'));var EventEmitter=require(_0x374d('0x2'))['EventEmitter'];var AGIReply=require(_0x374d('0x3'));var AGIError=require('./error');function AGIChannel(_0x356a4e){var _0x9f6268=this,_0x1a79ae=new AGIReply(),_0x5e7908=![],_0x2ef1fc={};EventEmitter['call'](_0x9f6268);_0x356a4e[_0x374d('0x4')](_0x374d('0x5'));_0x356a4e[_0x374d('0x6')](0x8*0x3c*0x3c*0x3e8);_0x1a79ae['setEncoding'](_0x374d('0x5'));_0x1a79ae['on'](_0x374d('0x7'),function(_0x3668d1){for(var _0x5f400f in _0x3668d1){_0x9f6268[_0x5f400f]=_0x3668d1[_0x5f400f];}_0x9f6268['emit'](_0x374d('0x8'));});_0x1a79ae['on'](_0x374d('0x9'),function(_0x44fb2f){if(_0x44fb2f['toLowerCase']()=='hangup'){_0x9f6268['emit'](_0x374d('0xa'));return;}if(_0x44fb2f[_0x374d('0xb')](0x0,0xb)==_0x374d('0xc')){_0x5e7908=!![];}if(_0x5e7908){_0x2ef1fc['rx']+=_0x44fb2f+'\x0a';if(_0x44fb2f['search']('520\x20End\x20of\x20proper')!=-0x1){_0x5e7908=![];}}else{_0x2ef1fc['rx']=_0x44fb2f;}if(_0x5e7908){return;}if(typeof _0x2ef1fc['cb']=='function'){var _0x18cb16=_0x2ef1fc['rx'][_0x374d('0xb')](0x0,0x3),_0x40b492=null,_0x412286=null;_0x18cb16=parseInt(_0x18cb16);if(isNaN(_0x18cb16)){_0x2ef1fc['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x374d('0xd')});return;}if(_0x18cb16!=0xc8){_0x2ef1fc['cb'](null,{'code':_0x18cb16,'result':-0x1,'extra':'KO'});return;}_0x40b492=_0x2ef1fc['rx'][_0x374d('0xb')](0x4)[_0x374d('0xe')]('result=','');if(_0x40b492['indexOf']('\x20')!=-0x1){_0x40b492=_0x40b492[_0x374d('0xf')](0x0,_0x40b492['indexOf']('\x20'));}if(_[_0x374d('0x10')](_0x40b492,'-1')){_0x40b492=parseInt(_0x40b492);}_0x412286=_0x2ef1fc['rx'][_0x374d('0x11')]('\x20');if(_0x412286[_0x374d('0x12')]==0x3){_0x412286=_0x412286[0x2][_0x374d('0xb')](0x1,_0x412286[0x2][_0x374d('0x12')]-0x1);}else if(_0x412286['length']>0x3){var _0x27651f=/\((.+)\)/;var _0x18776c=_0x2ef1fc['rx']['match'](_0x27651f);if(_0x18776c){_0x412286=_0x18776c[0x1];}else{_0x412286=null;}}else{_0x412286=null;}_0x2ef1fc['cb'](null,{'code':_0x18cb16,'result':_0x40b492,'extra':_0x412286});}});_0x356a4e['on'](_0x374d('0x13'),function(_0x323c53){_0x9f6268[_0x374d('0x14')](_0x374d('0x13'),new AGIError(_0x374d('0x15'),_0x323c53[_0x374d('0x16')]));});_0x356a4e['on'](_0x374d('0x17'),function(){_0x9f6268['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x356a4e['on'](_0x374d('0x18'),function(){_0x9f6268[_0x374d('0x14')]('timeout',new AGIError(_0x374d('0x19')));_0x356a4e[_0x374d('0x1a')]();});_0x356a4e[_0x374d('0x1b')](_0x1a79ae);this[_0x374d('0x1c')]=function(_0x3ecfc0,_0x32b865){var _0x3ecfc0=_0x3ecfc0||'',_0x32b865=typeof _0x32b865==_0x374d('0x1d')?_0x32b865:new Function();_0x2ef1fc={'tx':_0x3ecfc0,'rx':'','cb':_0x32b865};_0x356a4e[_0x374d('0x1e')](_0x3ecfc0+'\x0a');},this[_0x374d('0x17')]=function(){_0x356a4e['destroy']();};}util[_0x374d('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x374d('0x20')][_0x374d('0x21')]=function(_0x58cbb1){return this[_0x374d('0x1c')][_0x374d('0x22')](this,_0x58cbb1);};AGIChannel[_0x374d('0x20')][_0x374d('0x23')]=function(){return this[_0x374d('0x21')]('ANSWER');};AGIChannel[_0x374d('0x20')]['getData']=function(_0x23c47a,_0x49a8ec,_0xd96ed9){_0x23c47a=_0x23c47a===undefined?'beep':_0x23c47a;_0x49a8ec=_0x49a8ec===undefined?'5':_0x49a8ec;_0xd96ed9=_0xd96ed9===undefined?'1':_0xd96ed9;return this[_0x374d('0x21')](util[_0x374d('0x24')](_0x374d('0x25'),_0x23c47a,_0x49a8ec*0x3e8,_0xd96ed9));};AGIChannel[_0x374d('0x20')][_0x374d('0x26')]=function(_0x322ccf){_0x322ccf=_0x322ccf||_0x374d('0x27');return this[_0x374d('0x21')](util['format'](_0x374d('0x28'),_0x322ccf));};AGIChannel[_0x374d('0x20')][_0x374d('0x29')]=function(_0x2ed03,_0x5ee217){if(_[_0x374d('0x2a')](_0x5ee217)){return this[_0x374d('0x21')](util[_0x374d('0x24')](_0x374d('0x2b'),_0x2ed03,_0x5ee217[_0x374d('0x2c')](',')));}return this['sendRequest'](util[_0x374d('0x24')](_0x374d('0x2b'),_0x2ed03,_0x5ee217));};AGIChannel[_0x374d('0x20')][_0x374d('0x2d')]=function(_0x367617){return this[_0x374d('0x21')](util[_0x374d('0x24')](_0x374d('0x2e'),_0x367617));};AGIChannel['prototype'][_0x374d('0x2f')]=function(_0x5df502){return this[_0x374d('0x21')](util['format']('SET\x20EXTENSION\x20%s',_0x5df502));};AGIChannel[_0x374d('0x20')][_0x374d('0x30')]=function(_0x272e89){return this[_0x374d('0x21')](util[_0x374d('0x24')](_0x374d('0x31'),_0x272e89));};AGIChannel['prototype'][_0x374d('0xa')]=function(){return this[_0x374d('0x21')](_0x374d('0x32'));};AGIChannel[_0x374d('0x20')][_0x374d('0x33')]=function(_0x29e0e8,_0x39e0c3){var _0x1d3089=_[_0x374d('0x34')](_0x39e0c3)||_[_0x374d('0x35')](_0x39e0c3)?_0x39e0c3[_0x374d('0x36')]():_0x39e0c3;return this[_0x374d('0x21')](util[_0x374d('0x24')](_0x374d('0x37'),_0x29e0e8,_0x1d3089?_0x1d3089[_0x374d('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x374d('0x20')][_0x374d('0x38')]=function(_0x2a2dc2,_0x189480){return this[_0x374d('0x21')](util[_0x374d('0x24')](_0x374d('0x39'),_0x2a2dc2,_0x189480));};AGIChannel['prototype'][_0x374d('0x3a')]=function(_0x348998,_0x55dcb8){return this[_0x374d('0x21')](util['format'](_0x374d('0x3b'),_0x348998,_0x55dcb8));};AGIChannel[_0x374d('0x20')][_0x374d('0x3c')]=function(_0x5413c1,_0x58ffb2){return this[_0x374d('0x21')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x5413c1,_0x58ffb2));};AGIChannel[_0x374d('0x20')][_0x374d('0x3d')]=function(_0x4ef8fd,_0x5c658c,_0x3c324a){_0x5c658c=_0x5c658c||this[_0x374d('0x3e')];_0x3c324a=_0x3c324a||0x1;this[_0x374d('0x2d')](_0x4ef8fd);this['setExtension'](_0x5c658c);this[_0x374d('0x30')](_0x3c324a);return this['noop'](util[_0x374d('0x24')]('GOTO\x20%s\x20%s\x20%s',_0x4ef8fd,_0x5c658c,_0x3c324a));};AGIChannel['prototype']['getVariable']=function(_0x32d43b){return this[_0x374d('0x21')](util[_0x374d('0x24')]('GET\x20VARIABLE\x20\x22%s\x22',_0x32d43b));};AGIChannel[_0x374d('0x20')][_0x374d('0x3f')]=function(_0x4c8e2e,_0x43157e,_0x324793,_0x16a985,_0x51ec22,_0x277015){_0x43157e=_0x43157e||_0x374d('0x40');_0x324793=_0x324793||'';_0x16a985=_0x16a985===undefined?-0x1:_0x16a985==='-1'?-0x1:_0x16a985*0x3e8;_0x51ec22=_0x51ec22===undefined?'':'s='+_0x51ec22;_0x277015=_0x277015?_0x374d('0x41'):'';return this[_0x374d('0x21')](util['format'](_0x374d('0x42'),_0x4c8e2e,_0x43157e,_0x324793,_0x16a985,_0x277015,_0x51ec22));};AGIChannel['prototype'][_0x374d('0x43')]=function(_0x3ec703,_0x36355c){_0x36355c=_0x36355c||'';return this['sendRequest'](util[_0x374d('0x24')](_0x374d('0x44'),_0x3ec703,_0x36355c));};AGIChannel[_0x374d('0x20')][_0x374d('0x45')]=function(_0x319cba){return this[_0x374d('0x29')](_0x374d('0x46'),_0x319cba);};AGIChannel[_0x374d('0x20')]['wait']=function(_0x1b3633){return this[_0x374d('0x29')](_0x374d('0x47'),_0x1b3633);};AGIChannel[_0x374d('0x20')][_0x374d('0x13')]=function(_0x40d1f7,_0x336aef){this[_0x374d('0x26')](util['format'](_0x374d('0x48'),_0x40d1f7['id'],_0x40d1f7['label'],_0x336aef));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x374d('0x49')]=AGIChannel; \ No newline at end of file +var _0x1410=['./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','answer','ANSWER','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','HANGUP','setVariable','isBoolean','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter'];(function(_0x1fd8b3,_0x3bd29a){var _0x1f461f=function(_0x171f72){while(--_0x171f72){_0x1fd8b3['push'](_0x1fd8b3['shift']());}};_0x1f461f(++_0x3bd29a);}(_0x1410,0x130));var _0x0141=function(_0x544f55,_0x37cdab){_0x544f55=_0x544f55-0x0;var _0x55bbe6=_0x1410[_0x544f55];return _0x55bbe6;};'use strict';var util=require(_0x0141('0x0'));var _=require(_0x0141('0x1'));var EventEmitter=require(_0x0141('0x2'))[_0x0141('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x0141('0x4'));function AGIChannel(_0x4f3258){var _0x3c3422=this,_0x5d2855=new AGIReply(),_0x194c72=![],_0x454af1={};EventEmitter[_0x0141('0x5')](_0x3c3422);_0x4f3258[_0x0141('0x6')](_0x0141('0x7'));_0x4f3258[_0x0141('0x8')](0x8*0x3c*0x3c*0x3e8);_0x5d2855[_0x0141('0x6')](_0x0141('0x7'));_0x5d2855['on'](_0x0141('0x9'),function(_0x57cfbb){for(var _0x19ff64 in _0x57cfbb){_0x3c3422[_0x19ff64]=_0x57cfbb[_0x19ff64];}_0x3c3422[_0x0141('0xa')](_0x0141('0xb'));});_0x5d2855['on'](_0x0141('0xc'),function(_0x1b6b66){if(_0x1b6b66[_0x0141('0xd')]()==_0x0141('0xe')){_0x3c3422[_0x0141('0xa')]('hangup');return;}if(_0x1b6b66[_0x0141('0xf')](0x0,0xb)==_0x0141('0x10')){_0x194c72=!![];}if(_0x194c72){_0x454af1['rx']+=_0x1b6b66+'\x0a';if(_0x1b6b66[_0x0141('0x11')](_0x0141('0x12'))!=-0x1){_0x194c72=![];}}else{_0x454af1['rx']=_0x1b6b66;}if(_0x194c72){return;}if(typeof _0x454af1['cb']=='function'){var _0x49cebd=_0x454af1['rx']['substring'](0x0,0x3),_0xab59e3=null,_0x25aefb=null;_0x49cebd=parseInt(_0x49cebd);if(isNaN(_0x49cebd)){_0x454af1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0141('0x13')});return;}if(_0x49cebd!=0xc8){_0x454af1['cb'](null,{'code':_0x49cebd,'result':-0x1,'extra':'KO'});return;}_0xab59e3=_0x454af1['rx'][_0x0141('0xf')](0x4)[_0x0141('0x14')](_0x0141('0x15'),'');if(_0xab59e3[_0x0141('0x16')]('\x20')!=-0x1){_0xab59e3=_0xab59e3['substr'](0x0,_0xab59e3[_0x0141('0x16')]('\x20'));}if(_['startsWith'](_0xab59e3,'-1')){_0xab59e3=parseInt(_0xab59e3);}_0x25aefb=_0x454af1['rx'][_0x0141('0x17')]('\x20');if(_0x25aefb[_0x0141('0x18')]==0x3){_0x25aefb=_0x25aefb[0x2][_0x0141('0xf')](0x1,_0x25aefb[0x2][_0x0141('0x18')]-0x1);}else if(_0x25aefb[_0x0141('0x18')]>0x3){var _0x3c91e8=/\((.+)\)/;var _0x5274ab=_0x454af1['rx']['match'](_0x3c91e8);if(_0x5274ab){_0x25aefb=_0x5274ab[0x1];}else{_0x25aefb=null;}}else{_0x25aefb=null;}_0x454af1['cb'](null,{'code':_0x49cebd,'result':_0xab59e3,'extra':_0x25aefb});}});_0x4f3258['on'](_0x0141('0x19'),function(_0x3720f6){_0x3c3422['emit'](_0x0141('0x19'),new AGIError(_0x0141('0x1a'),_0x3720f6[_0x0141('0x1b')]));});_0x4f3258['on'](_0x0141('0x1c'),function(){_0x3c3422['emit'](_0x0141('0x1c'),new AGIError(_0x0141('0x1d')));});_0x4f3258['on']('timeout',function(){_0x3c3422[_0x0141('0xa')](_0x0141('0x1e'),new AGIError(_0x0141('0x1f')));_0x4f3258[_0x0141('0x20')]();});_0x4f3258[_0x0141('0x21')](_0x5d2855);this[_0x0141('0x22')]=function(_0x5e0ebe,_0x21d8fc){var _0x5e0ebe=_0x5e0ebe||'',_0x21d8fc=typeof _0x21d8fc==_0x0141('0x23')?_0x21d8fc:new Function();_0x454af1={'tx':_0x5e0ebe,'rx':'','cb':_0x21d8fc};_0x4f3258[_0x0141('0x24')](_0x5e0ebe+'\x0a');},this[_0x0141('0x1c')]=function(){_0x4f3258[_0x0141('0x20')]();};}util[_0x0141('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x0141('0x26')][_0x0141('0x27')]=function(_0x43b105){return this[_0x0141('0x22')]['sync'](this,_0x43b105);};AGIChannel[_0x0141('0x26')][_0x0141('0x28')]=function(){return this[_0x0141('0x27')](_0x0141('0x29'));};AGIChannel[_0x0141('0x26')]['getData']=function(_0x59196f,_0x4f0c09,_0x2bb7c4){_0x59196f=_0x59196f===undefined?'beep':_0x59196f;_0x4f0c09=_0x4f0c09===undefined?'5':_0x4f0c09;_0x2bb7c4=_0x2bb7c4===undefined?'1':_0x2bb7c4;return this[_0x0141('0x27')](util['format'](_0x0141('0x2a'),_0x59196f,_0x4f0c09*0x3e8,_0x2bb7c4));};AGIChannel[_0x0141('0x26')][_0x0141('0x2b')]=function(_0x378a87){_0x378a87=_0x378a87||_0x0141('0x2c');return this[_0x0141('0x27')](util[_0x0141('0x2d')](_0x0141('0x2e'),_0x378a87));};AGIChannel[_0x0141('0x26')][_0x0141('0x2f')]=function(_0x32ce7e,_0x36c409){if(_[_0x0141('0x30')](_0x36c409)){return this['sendRequest'](util[_0x0141('0x2d')]('EXEC\x20%s\x20%s',_0x32ce7e,_0x36c409[_0x0141('0x31')](',')));}return this[_0x0141('0x27')](util[_0x0141('0x2d')](_0x0141('0x32'),_0x32ce7e,_0x36c409));};AGIChannel[_0x0141('0x26')][_0x0141('0x33')]=function(_0x5292ef){return this[_0x0141('0x27')](util['format'](_0x0141('0x34'),_0x5292ef));};AGIChannel[_0x0141('0x26')][_0x0141('0x35')]=function(_0x54d8fa){return this[_0x0141('0x27')](util[_0x0141('0x2d')]('SET\x20EXTENSION\x20%s',_0x54d8fa));};AGIChannel[_0x0141('0x26')][_0x0141('0x36')]=function(_0x17dd47){return this[_0x0141('0x27')](util[_0x0141('0x2d')]('SET\x20PRIORITY\x20%s',_0x17dd47));};AGIChannel[_0x0141('0x26')][_0x0141('0xe')]=function(){return this[_0x0141('0x27')](_0x0141('0x37'));};AGIChannel[_0x0141('0x26')][_0x0141('0x38')]=function(_0x4eaa30,_0x52437d){var _0x12ad43=_[_0x0141('0x39')](_0x52437d)||_['isNumber'](_0x52437d)?_0x52437d[_0x0141('0x3a')]():_0x52437d;return this[_0x0141('0x27')](util[_0x0141('0x2d')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x4eaa30,_0x12ad43?_0x12ad43['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0141('0x26')][_0x0141('0x3b')]=function(_0x45dfb3,_0x284986){return this[_0x0141('0x27')](util[_0x0141('0x2d')](_0x0141('0x3c'),_0x45dfb3,_0x284986));};AGIChannel['prototype'][_0x0141('0x3d')]=function(_0x258bc0,_0x5b76c1){return this[_0x0141('0x27')](util[_0x0141('0x2d')](_0x0141('0x3e'),_0x258bc0,_0x5b76c1));};AGIChannel[_0x0141('0x26')][_0x0141('0x3f')]=function(_0x158480,_0xe7cce0){return this[_0x0141('0x27')](util['format'](_0x0141('0x40'),_0x158480,_0xe7cce0));};AGIChannel[_0x0141('0x26')]['continueAt']=function(_0x1d545b,_0x21baeb,_0x321f83){_0x21baeb=_0x21baeb||this[_0x0141('0x41')];_0x321f83=_0x321f83||0x1;this[_0x0141('0x33')](_0x1d545b);this['setExtension'](_0x21baeb);this[_0x0141('0x36')](_0x321f83);return this['noop'](util[_0x0141('0x2d')]('GOTO\x20%s\x20%s\x20%s',_0x1d545b,_0x21baeb,_0x321f83));};AGIChannel['prototype']['getVariable']=function(_0x25870d){return this[_0x0141('0x27')](util[_0x0141('0x2d')]('GET\x20VARIABLE\x20\x22%s\x22',_0x25870d));};AGIChannel[_0x0141('0x26')][_0x0141('0x42')]=function(_0x451471,_0x51de8f,_0x4c64bf,_0x3caba9,_0x268d2a,_0x3195bc){_0x51de8f=_0x51de8f||_0x0141('0x43');_0x4c64bf=_0x4c64bf||'';_0x3caba9=_0x3caba9===undefined?-0x1:_0x3caba9==='-1'?-0x1:_0x3caba9*0x3e8;_0x268d2a=_0x268d2a===undefined?'':'s='+_0x268d2a;_0x3195bc=_0x3195bc?_0x0141('0x44'):'';return this[_0x0141('0x27')](util[_0x0141('0x2d')](_0x0141('0x45'),_0x451471,_0x51de8f,_0x4c64bf,_0x3caba9,_0x3195bc,_0x268d2a));};AGIChannel['prototype'][_0x0141('0x46')]=function(_0x1dd10c,_0xbacb30){_0xbacb30=_0xbacb30||'';return this['sendRequest'](util[_0x0141('0x2d')](_0x0141('0x47'),_0x1dd10c,_0xbacb30));};AGIChannel[_0x0141('0x26')]['agi']=function(_0x34d300){return this['exec'](_0x0141('0x48'),_0x34d300);};AGIChannel['prototype'][_0x0141('0x49')]=function(_0x558af0){return this[_0x0141('0x2f')](_0x0141('0x4a'),_0x558af0);};AGIChannel[_0x0141('0x26')][_0x0141('0x19')]=function(_0x20a901,_0x482e1e){this[_0x0141('0x2b')](util[_0x0141('0x2d')](_0x0141('0x4b'),_0x20a901['id'],_0x20a901['label'],_0x482e1e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0141('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 49f8468..a509a72 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 _0x505e=['format','apply','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x4a01b0,_0x27961b){var _0x585fb6=function(_0x375edb){while(--_0x375edb){_0x4a01b0['push'](_0x4a01b0['shift']());}};_0x585fb6(++_0x27961b);}(_0x505e,0x18b));var _0xe505=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x505e[_0x374ada];return _0x449ed8;};'use strict';var util=require(_0xe505('0x0'));var error={'E_AGI_UNDEFINED':_0xe505('0x1'),'E_AGI_ARGUMENT_PORT':_0xe505('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xe505('0x3'),'E_AGI_SOCKET_ERROR':_0xe505('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xe505('0x5'),'E_AGI_COMMAND_EMPTY':_0xe505('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe505('0x7'),'E_AGI_IVR_ENTRY':_0xe505('0x8')};function AGIError(_0x7c0178){var _0x7c0178=_0x7c0178||null,_0x55b50b=_0x55b50b||[],_0x45034b=0x1,_0x655149='';if(!error[_0x7c0178]){_0x7c0178=_0xe505('0x9');}_0x55b50b[_0xe505('0xa')](error[_0x7c0178]);while(arguments[_0x45034b]){_0x55b50b[_0xe505('0xa')](arguments[_0x45034b]);_0x45034b++;}_0x655149=util[_0xe505('0xb')][_0xe505('0xc')](util,_0x55b50b);this['message']=_0x655149;this[_0xe505('0xd')]=_0x7c0178;}module['exports']=AGIError; \ No newline at end of file +var _0x56d3=['util','[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.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name'];(function(_0xc719e0,_0xacba87){var _0x29d720=function(_0xa5398e){while(--_0xa5398e){_0xc719e0['push'](_0xc719e0['shift']());}};_0x29d720(++_0xacba87);}(_0x56d3,0xe0));var _0x356d=function(_0x126d15,_0x3f2de5){_0x126d15=_0x126d15-0x0;var _0x6a68b0=_0x56d3[_0x126d15];return _0x6a68b0;};'use strict';var util=require(_0x356d('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x356d('0x1'),'E_AGI_SERVER_VOICE_DISABLED':_0x356d('0x2'),'E_AGI_SOCKET_ERROR':_0x356d('0x3'),'E_AGI_SOCKET_CLOSE':_0x356d('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x356d('0x5'),'E_AGI_COMMAND_EMPTY':_0x356d('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x356d('0x7')};function AGIError(_0x4af928){var _0x4af928=_0x4af928||null,_0x110a3a=_0x110a3a||[],_0x3e0c0d=0x1,_0x4646ca='';if(!error[_0x4af928]){_0x4af928=_0x356d('0x8');}_0x110a3a[_0x356d('0x9')](error[_0x4af928]);while(arguments[_0x3e0c0d]){_0x110a3a[_0x356d('0x9')](arguments[_0x3e0c0d]);_0x3e0c0d++;}_0x4646ca=util[_0x356d('0xa')][_0x356d('0xb')](util,_0x110a3a);this[_0x356d('0xc')]=_0x4646ca;this[_0x356d('0xd')]=_0x4af928;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 52fae01..4839049 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 _0xa887=['vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','edges','numberOfEdges','vertices','prototype','addEdge','push','size','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','length','info','no\x20edge/s\x20available','split','target','invalid'];(function(_0x11f74e,_0x1aef0c){var _0x1b73e6=function(_0x2db7fe){while(--_0x2db7fe){_0x11f74e['push'](_0x11f74e['shift']());}};_0x1b73e6(++_0x1aef0c);}(_0xa887,0xe6));var _0x7a88=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa887[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7a88('0x0'));var logger=require(_0x7a88('0x1'))(_0x7a88('0x2'));var verticesWithRetry=[_0x7a88('0x3'),'getdigits',_0x7a88('0x4')];var Graph=function(){this['vertices']={};this[_0x7a88('0x5')]={};this[_0x7a88('0x6')]=0x0;};Graph['prototype']['addVertex']=function(_0x49cb64){this[_0x7a88('0x7')][_0x49cb64['id']]=_0x49cb64;this[_0x7a88('0x5')][_0x49cb64['id']]=[];};Graph[_0x7a88('0x8')][_0x7a88('0x9')]=function(_0xe68d76,_0xd33ce4,_0x86c25c){this[_0x7a88('0x5')][_0xe68d76][_0x7a88('0xa')]({'target':_0xd33ce4,'condition':_0x86c25c});this[_0x7a88('0x6')]+=0x1;};Graph[_0x7a88('0x8')][_0x7a88('0xb')]=function(){return _[_0x7a88('0xb')](this[_0x7a88('0x7')]);};Graph[_0x7a88('0x8')]['relations']=function(){return this['numberOfEdges'];};Graph['prototype'][_0x7a88('0xc')]=function(_0x5d72c5){return this[_0x7a88('0x7')][_0x5d72c5];};Graph[_0x7a88('0x8')][_0x7a88('0xd')]=function(_0x413791,_0x45d03c){if(!this['vertices'][_0x413791]){return logger['info'](_0x7a88('0xe'));}var _0x111d35=_0x45d03c(this[_0x7a88('0x7')][_0x413791]);if(!_0x111d35){return logger['info'](_0x7a88('0xf'));}if(this['edges'][_0x413791][_0x7a88('0x10')]===0x0){return logger[_0x7a88('0x11')](_0x7a88('0x12'));}for(var _0x27d041=0x0,_0x44779d=[],_0x577d77=![];_0x27d041\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','code','result','isUndefined','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','response','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','listening','connection','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1a19,0x14e));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require('xml2json');var _=require(_0x91a1('0x0'));var syncho=require(_0x91a1('0x1'));var util=require(_0x91a1('0x2'));var moment=require(_0x91a1('0x3'));var config=require(_0x91a1('0x4'));var logger=require(_0x91a1('0x5'))(_0x91a1('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x91a1('0x7'));var Graph=require(_0x91a1('0x8'));var Vertices=require(_0x91a1('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x91a1('0x6')]=_[_0x91a1('0xa')](config[_0x91a1('0x6')],{'ip':_0x91a1('0xb'),'port':0x11dd});function connectionHandler(_0xbb0205){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0xbb0205);agiHandler(_0xbb0205);}catch(_0xc5aecc){logger[_0x91a1('0xc')](_0xc5aecc[_0x91a1('0xd')]);}});});}function listeningHandler(){console['log'](_0x91a1('0xe'),config[_0x91a1('0x6')][_0x91a1('0xf')]);logger[_0x91a1('0x10')](util[_0x91a1('0x11')](_0x91a1('0x12'),config[_0x91a1('0x6')]['ip'],config[_0x91a1('0x6')][_0x91a1('0xf')]));}function errorHandler(_0x3828f8){if(_0x3828f8&&_0x3828f8[_0x91a1('0x13')]&&_0x3828f8[_0x91a1('0x14')]){logger[_0x91a1('0xc')](util['format'](_0x91a1('0x15'),_0x3828f8[_0x91a1('0x13')],_0x3828f8[_0x91a1('0x14')]));}else{logger[_0x91a1('0xc')](util[_0x91a1('0x11')]('[ERROR]\x20%s',_0x3828f8[_0x91a1('0xd')]));}}function closeHandler(){logger['info'](util[_0x91a1('0x11')](_0x91a1('0x16'),this[_0x91a1('0x17')],this[_0x91a1('0x18')],this['callerid'],this['dnid'],this[_0x91a1('0x19')]));try{createSquareReport(this);}catch(_0x5caa19){logger[_0x91a1('0xc')](_0x5caa19[_0x91a1('0xd')]);}}function timeoutHandler(){logger['info'](util['format'](_0x91a1('0x1a'),this['arg_1'],this[_0x91a1('0x18')],this['callerid'],this['dnid'],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x91a1('0x11')](_0x91a1('0x1b'),this[_0x91a1('0x17')],this[_0x91a1('0x18')],this[_0x91a1('0x1c')],this[_0x91a1('0x1d')],this['uniqueid']));this[_0x91a1('0x1e')]=!![];}function getRoot(_0x3a5b7d){return parser['toJson'](_0x3a5b7d,{'object':!![]})[_0x91a1('0x1f')][_0x91a1('0x20')];}function addVertex(_0x5bf0b2,_0x11686d,_0x5c0621){_0x11686d[_0x91a1('0x21')]=_0x5c0621;if(_0x11686d[_0x91a1('0x22')](_0x91a1('0x23'))){_0x11686d[_0x91a1('0x24')]=parseInt(_0x11686d['retry'],0xa);}_0x5bf0b2[_0x91a1('0x25')](_[_0x91a1('0x26')](_0x11686d,_0x91a1('0x27')));}function initGraph(_0x3e8922,_0x3a8463){var _0x5ed897=new Graph();for(var _0x1c2366 in _0x3e8922){if(_0x3e8922['hasOwnProperty'](_0x1c2366)){if(_[_0x91a1('0x28')](_0x3e8922[_0x1c2366])){for(var _0x967d6=0x0;_0x967d6<_0x3e8922[_0x1c2366][_0x91a1('0x29')];_0x967d6+=0x1){addVertex(_0x5ed897,_0x3e8922[_0x1c2366][_0x967d6],_0x1c2366);}}else{addVertex(_0x5ed897,_0x3e8922[_0x1c2366],_0x1c2366);}}}for(var _0x77ddd4=0x0;_0x77ddd4<_0x3a8463[_0x91a1('0x29')];_0x77ddd4+=0x1){if(_0x3a8463[_0x77ddd4][_0x91a1('0x2a')]&&_0x3a8463[_0x77ddd4][_0x91a1('0x2b')]){_0x5ed897['addEdge'](_0x3a8463[_0x77ddd4][_0x91a1('0x2a')],_0x3a8463[_0x77ddd4][_0x91a1('0x2b')],_0x3a8463[_0x77ddd4]['value']);}}return _0x5ed897;}function getSquareProject(_0x4922be,_0x466812){rpc['getSquareProject'](_0x4922be)[_0x91a1('0x2c')](function(_0x231982){_0x466812(null,_0x231982);})['catch'](function(_0x3ee197){_0x466812(null,_0x3ee197);});}function createSquareReport(_0x158750,_0x371fc7){rpc[_0x91a1('0x2d')](_0x158750)[_0x91a1('0x2c')](function(_0x67ce3f){if(_0x371fc7){_0x371fc7(null,_0x67ce3f);}})[_0x91a1('0x2e')](function(_0x1430a6){if(_0x371fc7){_0x371fc7(null,_0x1430a6);}});}function setChannelVariables(_0x30a17a){for(var _0x2edd4d in _0x30a17a){if(_0x30a17a['hasOwnProperty'](_0x2edd4d)){if(_0x2edd4d[_0x91a1('0x2f')](_0x91a1('0x30'))===0x0){_0x30a17a[_0x2edd4d[_0x91a1('0x31')](0x4)]=_0x30a17a[_0x2edd4d];delete _0x30a17a[_0x2edd4d];}}}}function getLogFromObject(_0x386b1c){return util[_0x91a1('0x32')](_0x386b1c,{'showHidden':![],'depth':null});}function agiHandler(_0x2663c5){var _0x41ed90,_0x4327f5,_0x4099c6,_0x52f20c,_0x3ecf6c;logger[_0x91a1('0x33')]('variables',JSON[_0x91a1('0x34')](_0x2663c5,null,0x2));logger[_0x91a1('0x10')](util[_0x91a1('0x11')](_0x91a1('0x35'),_0x2663c5['arg_1'],_0x2663c5[_0x91a1('0x18')],_0x2663c5[_0x91a1('0x1c')],_0x2663c5[_0x91a1('0x1d')],_0x2663c5[_0x91a1('0x19')]));_0x2663c5['on'](_0x91a1('0xc'),errorHandler);_0x2663c5['on'](_0x91a1('0x36'),closeHandler);_0x2663c5['on'](_0x91a1('0x37'),timeoutHandler);_0x2663c5[_0x91a1('0x1e')]=![];_0x2663c5['on'](_0x91a1('0x38'),hangupHandler);var _0x40483e=getSquareProject[_0x91a1('0x39')](null,_0x2663c5[_0x91a1('0x17')]);if(_0x40483e){if(_0x40483e['production']){_0x41ed90=getRoot(_0x40483e[_0x91a1('0x3a')]);if(_0x41ed90&&_0x41ed90[_0x91a1('0x3b')]){logger[_0x91a1('0x33')](_0x91a1('0x20'),JSON[_0x91a1('0x34')](_0x41ed90,null,0x2));_0x2663c5['joinAt']=moment()[_0x91a1('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4327f5=initGraph(_['omit'](_0x41ed90,_0x91a1('0x27')),_0x41ed90[_0x91a1('0x27')]);_0x4099c6=new Vertices(_0x2663c5,rpc,mailRpc);logger['info'](util[_0x91a1('0x11')](_0x91a1('0x3c'),_0x2663c5['arg_1'],_0x2663c5['calleridname'],_0x2663c5['callerid'],_0x2663c5[_0x91a1('0x1d')],_0x2663c5[_0x91a1('0x19')]));_0x4327f5[_0x91a1('0x3d')](_0x41ed90[_0x91a1('0x3b')]['id'],function(_0x2e361d){try{_0x2e361d=_0x4099c6[_0x91a1('0x3e')](_0x2e361d);logger[_0x91a1('0x33')](_0x91a1('0x3f'),JSON[_0x91a1('0x34')](_0x2e361d,null,0x2));if(_0x2e361d[_0x91a1('0x21')]===_0x91a1('0x40')){logger[_0x91a1('0x10')](_0x91a1('0x41'));_0x2663c5[_0x91a1('0x42')]=_0x2e361d['context']||_0x2663c5[_0x91a1('0x42')];_0x2663c5['extension']=_0x2e361d['extension'];_0x2663c5[_0x91a1('0x43')]=_0x2e361d['priority']?_0x2e361d[_0x91a1('0x43')]-0x1:0x1;return null;}else if(_0x2e361d&&_0x4099c6[_0x2e361d[_0x91a1('0x21')]]){_0x3ecf6c=_0x4099c6[_0x2e361d['agicommand']](_0x2e361d);logger['info']('response',JSON[_0x91a1('0x34')](_0x3ecf6c,null,0x2));if(_0x3ecf6c&&_0x3ecf6c[_0x91a1('0x44')]===AGI_CODE_SUCCESS&&_0x3ecf6c[_0x91a1('0x45')]!==AGI_RESULT_ERROR&&!_0x2663c5['evtHangup']){logger[_0x91a1('0x33')]('response',getLogFromObject(_0x3ecf6c));return _[_0x91a1('0x46')](_0x3ecf6c[_0x91a1('0x45')])?null:_0x3ecf6c[_0x91a1('0x45')]['toString']();}else{logger[_0x91a1('0xc')]('response',getLogFromObject(_0x3ecf6c));return null;}}else{logger['error'](_0x91a1('0x47'));return null;}}catch(_0x1c2828){logger[_0x91a1('0xc')](_0x1c2828[_0x91a1('0xd')]);return null;}});if(_0x41ed90['finally']){logger['info'](util[_0x91a1('0x11')](_0x91a1('0x48'),_0x2663c5[_0x91a1('0x17')],_0x2663c5[_0x91a1('0x18')],_0x2663c5[_0x91a1('0x1c')],_0x2663c5[_0x91a1('0x1d')],_0x2663c5[_0x91a1('0x19')]));_0x4327f5['traverseBFS'](_0x41ed90[_0x91a1('0x49')]['id'],function(_0x134786){try{_0x134786=_0x4099c6[_0x91a1('0x3e')](_0x134786);logger[_0x91a1('0x33')](_0x91a1('0x3f'),JSON[_0x91a1('0x34')](_0x134786,null,0x2));if(_0x134786&&_0x4099c6[_0x134786[_0x91a1('0x21')]]){_0x3ecf6c=_0x4099c6[_0x134786[_0x91a1('0x21')]](_0x134786);if(_0x3ecf6c){logger[_0x91a1('0x33')](_0x91a1('0x4a'),getLogFromObject(_0x3ecf6c));return _[_0x91a1('0x46')](_0x3ecf6c['result'])?null:_0x3ecf6c[_0x91a1('0x45')]['toString']();}else{logger[_0x91a1('0xc')](_0x91a1('0x4a'),getLogFromObject(_0x3ecf6c));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x304501){logger['error'](_0x304501['stack']);return null;}});}logger[_0x91a1('0x10')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2663c5[_0x91a1('0x17')],_0x2663c5[_0x91a1('0x18')],_0x2663c5['callerid'],_0x2663c5[_0x91a1('0x1d')],_0x2663c5[_0x91a1('0x19')]));logger[_0x91a1('0x10')](util['format'](_0x91a1('0x4b'),_0x2663c5[_0x91a1('0x42')],_0x2663c5[_0x91a1('0x4c')],parseInt(_0x2663c5[_0x91a1('0x43')],0xa)+0x1));_0x2663c5[_0x91a1('0x4d')](_0x2663c5['context'],_0x2663c5[_0x91a1('0x4c')],parseInt(_0x2663c5['priority'],0xa)+0x1);_0x2663c5[_0x91a1('0x36')]();}}else{logger[_0x91a1('0xc')](util['format'](_0x91a1('0x4e'),_0x2663c5[_0x91a1('0x17')]));_0x2663c5[_0x91a1('0x4d')](_0x2663c5[_0x91a1('0x42')],_0x2663c5[_0x91a1('0x4c')],parseInt(_0x2663c5[_0x91a1('0x43')],0xa)+0x1);_0x2663c5[_0x91a1('0x36')]();}}else{logger[_0x91a1('0xc')](util[_0x91a1('0x11')](_0x91a1('0x4f'),_0x2663c5['arg_1']));_0x2663c5['continueAt'](_0x2663c5['context'],_0x2663c5[_0x91a1('0x4c')],parseInt(_0x2663c5[_0x91a1('0x43')],0xa)+0x1);_0x2663c5[_0x91a1('0x36')]();}}function main(){var _0x1bec56;return utilLicense[_0x91a1('0x50')]()[_0x91a1('0x2c')](function(_0x40779e){if(_0x40779e){if(_0x40779e[_0x91a1('0x51')]){if(_0x40779e[_0x91a1('0x52')]&&_0x40779e['callysquare']>0x0){logger[_0x91a1('0x10')](util[_0x91a1('0x11')](_0x91a1('0x53'),_0x40779e[_0x91a1('0x52')]));_0x1bec56=_0x40779e[_0x91a1('0x52')];}else{logger[_0x91a1('0x10')](_0x91a1('0x54'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1bec56=-0x1;}}})[_0x91a1('0x2e')](function(_0x24b6ab){logger[_0x91a1('0xc')](_0x91a1('0x55'),_0x24b6ab[_0x91a1('0xd')]);})[_0x91a1('0x49')](function(){var _0x4c3ad9=require('./server')(config['agi'][_0x91a1('0xf')],config[_0x91a1('0x6')]['ip'],_0x1bec56);_0x4c3ad9['on'](_0x91a1('0xc'),errorHandler);_0x4c3ad9['on'](_0x91a1('0x56'),listeningHandler);_0x4c3ad9['on'](_0x91a1('0x57'),connectionHandler);_0x4c3ad9['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xb578=['[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','util','moment','../../config/logger','agi','./rpc','./mailRpc','defaults','127.0.0.1','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','stack','arg_1','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length','source','target','addEdge','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','calleridname','close','hangup','sync','start','root','stringify','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s'];(function(_0x423e83,_0x551f1e){var _0x11d9de=function(_0x5924d9){while(--_0x5924d9){_0x423e83['push'](_0x423e83['shift']());}};_0x11d9de(++_0x551f1e);}(_0xb578,0x102));var _0x8b57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb578[_0x14add3];return _0x4a174f;};'use strict';var parser=require(_0x8b57('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0x8b57('0x1'));var moment=require(_0x8b57('0x2'));var config=require('../../config/environment');var logger=require(_0x8b57('0x3'))(_0x8b57('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0x8b57('0x5'));var mailRpc=require(_0x8b57('0x6'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8b57('0x4')]=_[_0x8b57('0x7')](config['agi'],{'ip':_0x8b57('0x8'),'port':0x11dd});function connectionHandler(_0x31da4c){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x31da4c);agiHandler(_0x31da4c);}catch(_0x1572f3){logger[_0x8b57('0x9')](_0x1572f3['stack']);}});});}function listeningHandler(){console[_0x8b57('0xa')](_0x8b57('0xb'),config[_0x8b57('0x4')][_0x8b57('0xc')]);logger[_0x8b57('0xd')](util[_0x8b57('0xe')](_0x8b57('0xf'),config[_0x8b57('0x4')]['ip'],config[_0x8b57('0x4')][_0x8b57('0xc')]));}function errorHandler(_0x27bc28){if(_0x27bc28&&_0x27bc28[_0x8b57('0x10')]&&_0x27bc28[_0x8b57('0x11')]){logger[_0x8b57('0x9')](util['format']('[%s]\x20%s',_0x27bc28[_0x8b57('0x10')],_0x27bc28[_0x8b57('0x11')]));}else{logger[_0x8b57('0x9')](util[_0x8b57('0xe')](_0x8b57('0x12'),_0x27bc28[_0x8b57('0x13')]));}}function closeHandler(){logger[_0x8b57('0xd')](util[_0x8b57('0xe')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x8b57('0x14')],this['calleridname'],this[_0x8b57('0x15')],this[_0x8b57('0x16')],this[_0x8b57('0x17')]));try{createSquareReport(this);}catch(_0xe9089d){logger[_0x8b57('0x9')](_0xe9089d[_0x8b57('0x13')]);}}function timeoutHandler(){logger['info'](util[_0x8b57('0xe')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x8b57('0x14')],this['calleridname'],this[_0x8b57('0x15')],this[_0x8b57('0x16')],this[_0x8b57('0x17')]));}function hangupHandler(){logger[_0x8b57('0xd')](util[_0x8b57('0xe')](_0x8b57('0x18'),this['arg_1'],this['calleridname'],this[_0x8b57('0x15')],this[_0x8b57('0x16')],this[_0x8b57('0x17')]));this[_0x8b57('0x19')]=!![];}function getRoot(_0x425ff5){return parser['toJson'](_0x425ff5,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0xb2062a,_0x99c2f5,_0x502f81){_0x99c2f5[_0x8b57('0x1a')]=_0x502f81;if(_0x99c2f5[_0x8b57('0x1b')](_0x8b57('0x1c'))){_0x99c2f5[_0x8b57('0x1d')]=parseInt(_0x99c2f5['retry'],0xa);}_0xb2062a['addVertex'](_[_0x8b57('0x1e')](_0x99c2f5,_0x8b57('0x1f')));}function initGraph(_0x1314b5,_0x54fd34){var _0x3ffcd8=new Graph();for(var _0x237e24 in _0x1314b5){if(_0x1314b5[_0x8b57('0x1b')](_0x237e24)){if(_[_0x8b57('0x20')](_0x1314b5[_0x237e24])){for(var _0x413965=0x0;_0x413965<_0x1314b5[_0x237e24][_0x8b57('0x21')];_0x413965+=0x1){addVertex(_0x3ffcd8,_0x1314b5[_0x237e24][_0x413965],_0x237e24);}}else{addVertex(_0x3ffcd8,_0x1314b5[_0x237e24],_0x237e24);}}}for(var _0x10d2bc=0x0;_0x10d2bc<_0x54fd34['length'];_0x10d2bc+=0x1){if(_0x54fd34[_0x10d2bc][_0x8b57('0x22')]&&_0x54fd34[_0x10d2bc][_0x8b57('0x23')]){_0x3ffcd8[_0x8b57('0x24')](_0x54fd34[_0x10d2bc]['source'],_0x54fd34[_0x10d2bc]['target'],_0x54fd34[_0x10d2bc]['value']);}}return _0x3ffcd8;}function getSquareProject(_0x4c4239,_0x3dc3ec){rpc['getSquareProject'](_0x4c4239)[_0x8b57('0x25')](function(_0x50a0be){_0x3dc3ec(null,_0x50a0be);})['catch'](function(_0x29b2c9){_0x3dc3ec(null,_0x29b2c9);});}function createSquareReport(_0x8cab9d,_0x30fef1){rpc[_0x8b57('0x26')](_0x8cab9d)[_0x8b57('0x25')](function(_0x4375a1){if(_0x30fef1){_0x30fef1(null,_0x4375a1);}})[_0x8b57('0x27')](function(_0x842b3f){if(_0x30fef1){_0x30fef1(null,_0x842b3f);}});}function setChannelVariables(_0x589e34){for(var _0x46e2de in _0x589e34){if(_0x589e34['hasOwnProperty'](_0x46e2de)){if(_0x46e2de[_0x8b57('0x28')](_0x8b57('0x29'))===0x0){_0x589e34[_0x46e2de[_0x8b57('0x2a')](0x4)]=_0x589e34[_0x46e2de];delete _0x589e34[_0x46e2de];}}}}function getLogFromObject(_0x377c0a){return util[_0x8b57('0x2b')](_0x377c0a,{'showHidden':![],'depth':null});}function agiHandler(_0x5dcfd6){var _0x7b5bfe,_0x139c55,_0x290031,_0x5376fd,_0x37b4e2;logger[_0x8b57('0x2c')]('variables',JSON['stringify'](_0x5dcfd6,null,0x2));logger[_0x8b57('0xd')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5dcfd6[_0x8b57('0x14')],_0x5dcfd6[_0x8b57('0x2d')],_0x5dcfd6[_0x8b57('0x15')],_0x5dcfd6[_0x8b57('0x16')],_0x5dcfd6['uniqueid']));_0x5dcfd6['on'](_0x8b57('0x9'),errorHandler);_0x5dcfd6['on'](_0x8b57('0x2e'),closeHandler);_0x5dcfd6['on']('timeout',timeoutHandler);_0x5dcfd6[_0x8b57('0x19')]=![];_0x5dcfd6['on'](_0x8b57('0x2f'),hangupHandler);var _0x4a3628=getSquareProject[_0x8b57('0x30')](null,_0x5dcfd6[_0x8b57('0x14')]);if(_0x4a3628){if(_0x4a3628['production']){_0x7b5bfe=getRoot(_0x4a3628['production']);if(_0x7b5bfe&&_0x7b5bfe[_0x8b57('0x31')]){logger['debug'](_0x8b57('0x32'),JSON[_0x8b57('0x33')](_0x7b5bfe,null,0x2));_0x5dcfd6[_0x8b57('0x34')]=moment()[_0x8b57('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x139c55=initGraph(_[_0x8b57('0x1e')](_0x7b5bfe,_0x8b57('0x1f')),_0x7b5bfe[_0x8b57('0x1f')]);_0x290031=new Vertices(_0x5dcfd6,rpc,mailRpc);logger['info'](util['format'](_0x8b57('0x35'),_0x5dcfd6['arg_1'],_0x5dcfd6[_0x8b57('0x2d')],_0x5dcfd6[_0x8b57('0x15')],_0x5dcfd6[_0x8b57('0x16')],_0x5dcfd6[_0x8b57('0x17')]));_0x139c55['traverseBFS'](_0x7b5bfe[_0x8b57('0x31')]['id'],function(_0x2baa30){try{_0x2baa30=_0x290031['clear'](_0x2baa30);logger['debug']('vertex',JSON[_0x8b57('0x33')](_0x2baa30,null,0x2));if(_0x2baa30[_0x8b57('0x1a')]===_0x8b57('0x36')){logger[_0x8b57('0xd')](_0x8b57('0x37'));_0x5dcfd6['context']=_0x2baa30[_0x8b57('0x38')]||_0x5dcfd6[_0x8b57('0x38')];_0x5dcfd6[_0x8b57('0x39')]=_0x2baa30[_0x8b57('0x39')];_0x5dcfd6[_0x8b57('0x3a')]=_0x2baa30[_0x8b57('0x3a')]?_0x2baa30[_0x8b57('0x3a')]-0x1:0x1;return null;}else if(_0x2baa30&&_0x290031[_0x2baa30[_0x8b57('0x1a')]]){_0x37b4e2=_0x290031[_0x2baa30[_0x8b57('0x1a')]](_0x2baa30);logger[_0x8b57('0xd')](_0x8b57('0x3b'),JSON[_0x8b57('0x33')](_0x37b4e2,null,0x2));if(_0x37b4e2&&_0x37b4e2[_0x8b57('0x3c')]===AGI_CODE_SUCCESS&&_0x37b4e2[_0x8b57('0x3d')]!==AGI_RESULT_ERROR&&!_0x5dcfd6[_0x8b57('0x19')]){logger[_0x8b57('0x2c')](_0x8b57('0x3b'),getLogFromObject(_0x37b4e2));return _[_0x8b57('0x3e')](_0x37b4e2[_0x8b57('0x3d')])?null:_0x37b4e2[_0x8b57('0x3d')][_0x8b57('0x3f')]();}else{logger['error']('response',getLogFromObject(_0x37b4e2));return null;}}else{logger[_0x8b57('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x5ea66e){logger['error'](_0x5ea66e['stack']);return null;}});if(_0x7b5bfe[_0x8b57('0x40')]){logger[_0x8b57('0xd')](util['format'](_0x8b57('0x41'),_0x5dcfd6[_0x8b57('0x14')],_0x5dcfd6[_0x8b57('0x2d')],_0x5dcfd6['callerid'],_0x5dcfd6[_0x8b57('0x16')],_0x5dcfd6[_0x8b57('0x17')]));_0x139c55[_0x8b57('0x42')](_0x7b5bfe[_0x8b57('0x40')]['id'],function(_0x4235b6){try{_0x4235b6=_0x290031[_0x8b57('0x43')](_0x4235b6);logger[_0x8b57('0x2c')](_0x8b57('0x44'),JSON['stringify'](_0x4235b6,null,0x2));if(_0x4235b6&&_0x290031[_0x4235b6[_0x8b57('0x1a')]]){_0x37b4e2=_0x290031[_0x4235b6[_0x8b57('0x1a')]](_0x4235b6);if(_0x37b4e2){logger['debug'](_0x8b57('0x3b'),getLogFromObject(_0x37b4e2));return _[_0x8b57('0x3e')](_0x37b4e2[_0x8b57('0x3d')])?null:_0x37b4e2['result'][_0x8b57('0x3f')]();}else{logger[_0x8b57('0x9')](_0x8b57('0x3b'),getLogFromObject(_0x37b4e2));return null;}}else{logger['error'](_0x8b57('0x45'));return null;}}catch(_0x14980e){logger[_0x8b57('0x9')](_0x14980e[_0x8b57('0x13')]);return null;}});}logger['info'](util[_0x8b57('0xe')](_0x8b57('0x46'),_0x5dcfd6[_0x8b57('0x14')],_0x5dcfd6[_0x8b57('0x2d')],_0x5dcfd6[_0x8b57('0x15')],_0x5dcfd6[_0x8b57('0x16')],_0x5dcfd6[_0x8b57('0x17')]));logger[_0x8b57('0xd')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x5dcfd6[_0x8b57('0x38')],_0x5dcfd6[_0x8b57('0x39')],parseInt(_0x5dcfd6[_0x8b57('0x3a')],0xa)+0x1));_0x5dcfd6[_0x8b57('0x47')](_0x5dcfd6[_0x8b57('0x38')],_0x5dcfd6['extension'],parseInt(_0x5dcfd6[_0x8b57('0x3a')],0xa)+0x1);_0x5dcfd6[_0x8b57('0x2e')]();}}else{logger['error'](util[_0x8b57('0xe')](_0x8b57('0x48'),_0x5dcfd6['arg_1']));_0x5dcfd6[_0x8b57('0x47')](_0x5dcfd6[_0x8b57('0x38')],_0x5dcfd6[_0x8b57('0x39')],parseInt(_0x5dcfd6[_0x8b57('0x3a')],0xa)+0x1);_0x5dcfd6[_0x8b57('0x2e')]();}}else{logger[_0x8b57('0x9')](util[_0x8b57('0xe')](_0x8b57('0x49'),_0x5dcfd6['arg_1']));_0x5dcfd6[_0x8b57('0x47')](_0x5dcfd6[_0x8b57('0x38')],_0x5dcfd6[_0x8b57('0x39')],parseInt(_0x5dcfd6[_0x8b57('0x3a')],0xa)+0x1);_0x5dcfd6[_0x8b57('0x2e')]();}}function main(){var _0x2c5c37;return utilLicense[_0x8b57('0x4a')]()[_0x8b57('0x25')](function(_0x26e3a5){if(_0x26e3a5){if(_0x26e3a5[_0x8b57('0x4b')]){if(_0x26e3a5['callysquare']&&_0x26e3a5[_0x8b57('0x4c')]>0x0){logger[_0x8b57('0xd')](util[_0x8b57('0xe')](_0x8b57('0x4d'),_0x26e3a5[_0x8b57('0x4c')]));_0x2c5c37=_0x26e3a5[_0x8b57('0x4c')];}else{logger[_0x8b57('0xd')](_0x8b57('0x4e'));}}else{logger['info'](_0x8b57('0x4f'));_0x2c5c37=-0x1;}}})[_0x8b57('0x27')](function(_0x47a431){logger[_0x8b57('0x9')](_0x8b57('0x50'),_0x47a431[_0x8b57('0x13')]);})[_0x8b57('0x40')](function(){var _0xc55ad6=require(_0x8b57('0x51'))(config['agi'][_0x8b57('0xc')],config[_0x8b57('0x4')]['ip'],_0x2c5c37);_0xc55ad6['on']('error',errorHandler);_0xc55ad6['on'](_0x8b57('0x52'),listeningHandler);_0xc55ad6['on'](_0x8b57('0x53'),connectionHandler);_0xc55ad6['on'](_0x8b57('0x2e'),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 f53e7bc..7a29967 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 _0x0536=['message','result','catch','sendMailMessage','SendMail','bluebird','client','then','error'];(function(_0x3e6525,_0x2f6596){var _0x2680ba=function(_0x2d3410){while(--_0x2d3410){_0x3e6525['push'](_0x3e6525['shift']());}};_0x2680ba(++_0x2f6596);}(_0x0536,0x1eb));var _0x6053=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0536[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x6053('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x6053('0x1')]['http']({'port':0x232b});function request(_0x4ef6f9,_0x49b24d){return new BPromise(function(_0x943530,_0x11623){return client['request'](_0x4ef6f9,_0x49b24d)[_0x6053('0x2')](function(_0xa3240b){if(_0xa3240b[_0x6053('0x3')]){return _0x11623(_0xa3240b[_0x6053('0x3')][_0x6053('0x4')]);}else{return _0x943530(_0xa3240b[_0x6053('0x5')]);}})[_0x6053('0x6')](function(_0x31c241){return _0x11623(_0x31c241);});});}exports[_0x6053('0x7')]=function(_0x1bb2d8,_0x1f50b8){return request(_0x6053('0x8'),{'account':_0x1bb2d8,'message':_0x1f50b8});}; \ No newline at end of file +var _0x1344=['http','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x12ca16,_0x281fd9){var _0x56fb78=function(_0x3479b2){while(--_0x3479b2){_0x12ca16['push'](_0x12ca16['shift']());}};_0x56fb78(++_0x281fd9);}(_0x1344,0xbd));var _0x4134=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0x1344[_0x3dc68d];return _0xdf7f94;};'use strict';var BPromise=require(_0x4134('0x0'));var jayson=require(_0x4134('0x1'));var client=jayson[_0x4134('0x2')][_0x4134('0x3')]({'port':0x232b});function request(_0x42df57,_0x274a8b){return new BPromise(function(_0x161488,_0x52454e){return client[_0x4134('0x4')](_0x42df57,_0x274a8b)[_0x4134('0x5')](function(_0x1050ee){if(_0x1050ee['error']){return _0x52454e(_0x1050ee[_0x4134('0x6')][_0x4134('0x7')]);}else{return _0x161488(_0x1050ee[_0x4134('0x8')]);}})[_0x4134('0x9')](function(_0x1da69e){return _0x52454e(_0x1da69e);});});}exports[_0x4134('0xa')]=function(_0x4e6f70,_0x176e11){return request(_0x4134('0xb'),{'account':_0x4e6f70,'message':_0x176e11});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index a6e5a0f..11033ee 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 _0x7899=['stream','Transform','call','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','line','exports','util'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7899,0x168));var _0x9789=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0x7899[_0x33c1b1];return _0x2c2037;};'use strict';var util=require(_0x9789('0x0'));var Transform=require(_0x9789('0x1'))[_0x9789('0x2')];function AGIReply(_0x1dc7c6){Transform[_0x9789('0x3')](this,_0x1dc7c6);this[_0x9789('0x4')]='';this[_0x9789('0x5')]=![];}util[_0x9789('0x6')](AGIReply,Transform);AGIReply['prototype'][_0x9789('0x7')]=function(_0x57c1b7,_0x1f5929,_0x41a7bb){var _0x1aa0be='\x0a',_0x4c0e9b=['\x0a\x0a',_0x9789('0x8')],_0x1f2050=-0x1,_0x49c9c2=-0x1,_0xc1dc7b='',_0x1cf0c6=0x0,_0x84385f='',_0xec9d81='';this[_0x9789('0x4')]+=_0x57c1b7[_0x9789('0x9')]();_0x84385f=this[_0x9789('0x4')];if(!this[_0x9789('0x5')]){_0x1cf0c6=0x0;while(_0x4c0e9b[_0x1cf0c6]){while((_0x49c9c2=_0x84385f[_0x9789('0xa')](_0x4c0e9b[_0x1cf0c6]))!=-0x1){_0xc1dc7b=_0x4c0e9b[_0x1cf0c6];_0xec9d81=_0x84385f[_0x9789('0xb')](0x0,_0x49c9c2);_0x84385f=_0x84385f[_0x9789('0xb')](_0x49c9c2+_0xc1dc7b[_0x9789('0xc')]);var _0x25c62f=_0xec9d81[_0x9789('0xd')](_0x1aa0be),_0x29de07=0x0,_0x4d6d7d={},_0x3395a5='',_0x3a615f='',_0x266579=-0x1;while(_0x25c62f[_0x29de07]){_0x266579=_0x25c62f[_0x29de07][_0x9789('0xa')](':');if(_0x266579!=-0x1){_0x3395a5=_0x25c62f[_0x29de07][_0x9789('0xe')](0x0,_0x266579)['trim']();_0x3a615f=_0x25c62f[_0x29de07][_0x9789('0xe')](_0x266579+0x1)[_0x9789('0xf')]();if(_0x3395a5[_0x9789('0xc')]>0x0){_0x4d6d7d[_0x3395a5]=_0x3a615f;}}else{}_0x29de07++;}this[_0x9789('0x10')]('headers',_0x4d6d7d);this[_0x9789('0x5')]=!![];}_0x1cf0c6++;}this['_localBuffer']=_0x84385f;}else{while((_0x1f2050=_0x84385f['indexOf'](_0x1aa0be))!=-0x1){_0xec9d81=_0x84385f[_0x9789('0xb')](0x0,_0x1f2050);this[_0x9789('0x10')](_0x9789('0x11'),_0xec9d81);_0x84385f=_0x84385f[_0x9789('0xb')](_0x1f2050+_0x1aa0be['length']);}this[_0x9789('0x4')]=_0x84385f;}_0x41a7bb();};module[_0x9789('0x12')]=AGIReply; \ No newline at end of file +var _0xf5ab=['indexOf','substring','length','split','slice','trim','emit','util','stream','Transform','call','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf5ab,0x117));var _0xbf5a=function(_0x3a0ee7,_0x503b0c){_0x3a0ee7=_0x3a0ee7-0x0;var _0x5eca81=_0xf5ab[_0x3a0ee7];return _0x5eca81;};'use strict';var util=require(_0xbf5a('0x0'));var Transform=require(_0xbf5a('0x1'))[_0xbf5a('0x2')];function AGIReply(_0x325b66){Transform[_0xbf5a('0x3')](this,_0x325b66);this[_0xbf5a('0x4')]='';this[_0xbf5a('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0xbf5a('0x6')]=function(_0x467b58,_0x118fb4,_0x5c36bb){var _0x347362='\x0a',_0x481964=['\x0a\x0a',_0xbf5a('0x7')],_0x561ea3=-0x1,_0x4300df=-0x1,_0xd1c51e='',_0xf6a9e2=0x0,_0x49f2ab='',_0x5521c5='';this[_0xbf5a('0x4')]+=_0x467b58[_0xbf5a('0x8')]();_0x49f2ab=this[_0xbf5a('0x4')];if(!this['_inBody']){_0xf6a9e2=0x0;while(_0x481964[_0xf6a9e2]){while((_0x4300df=_0x49f2ab[_0xbf5a('0x9')](_0x481964[_0xf6a9e2]))!=-0x1){_0xd1c51e=_0x481964[_0xf6a9e2];_0x5521c5=_0x49f2ab[_0xbf5a('0xa')](0x0,_0x4300df);_0x49f2ab=_0x49f2ab[_0xbf5a('0xa')](_0x4300df+_0xd1c51e[_0xbf5a('0xb')]);var _0x1c2544=_0x5521c5[_0xbf5a('0xc')](_0x347362),_0x1529d1=0x0,_0x278056={},_0x576797='',_0x540cdf='',_0x398399=-0x1;while(_0x1c2544[_0x1529d1]){_0x398399=_0x1c2544[_0x1529d1][_0xbf5a('0x9')](':');if(_0x398399!=-0x1){_0x576797=_0x1c2544[_0x1529d1][_0xbf5a('0xd')](0x0,_0x398399)[_0xbf5a('0xe')]();_0x540cdf=_0x1c2544[_0x1529d1]['slice'](_0x398399+0x1)[_0xbf5a('0xe')]();if(_0x576797[_0xbf5a('0xb')]>0x0){_0x278056[_0x576797]=_0x540cdf;}}else{}_0x1529d1++;}this['emit']('headers',_0x278056);this[_0xbf5a('0x5')]=!![];}_0xf6a9e2++;}this[_0xbf5a('0x4')]=_0x49f2ab;}else{while((_0x561ea3=_0x49f2ab['indexOf'](_0x347362))!=-0x1){_0x5521c5=_0x49f2ab[_0xbf5a('0xa')](0x0,_0x561ea3);this[_0xbf5a('0xf')]('line',_0x5521c5);_0x49f2ab=_0x49f2ab[_0xbf5a('0xa')](_0x561ea3+_0x347362[_0xbf5a('0xb')]);}this['_localBuffer']=_0x49f2ab;}_0x5c36bb();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 6227285..fdb2f86 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 _0x0069=['CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0069,0x131));var _0x9006=function(_0x52f975,_0x305404){_0x52f975=_0x52f975-0x0;var _0x1b15a3=_0x0069[_0x52f975];return _0x1b15a3;};'use strict';var BPromise=require(_0x9006('0x0'));var moment=require(_0x9006('0x1'));var _=require(_0x9006('0x2'));var util=require(_0x9006('0x3'));var jayson=require(_0x9006('0x4'));var client=jayson[_0x9006('0x5')][_0x9006('0x6')]({'port':0x2329});function request(_0x3abe04,_0x294f6e){return new BPromise(function(_0x2f9e86,_0x3611d2){return client[_0x9006('0x7')](_0x3abe04,_0x294f6e)[_0x9006('0x8')](function(_0x158448){if(_0x158448[_0x9006('0x9')]){return _0x3611d2(_0x158448[_0x9006('0x9')]['message']);}else{return _0x2f9e86(_0x158448[_0x9006('0xa')]);}})['catch'](function(_0x28317f){return _0x3611d2(_0x28317f);});});}exports[_0x9006('0xb')]=function(_0x2f1888){return request(_0x9006('0xc'),{'options':{'raw':![],'where':{'name':_0x2f1888},'attributes':[_0x9006('0xd')]}});};exports[_0x9006('0xe')]=function(_0xba38d7){return request(_0x9006('0xf'),{'options':{'raw':![],'where':{'id':_0xba38d7},'include':[{'model':_0x9006('0x10'),'as':_0x9006('0x11')}],'attributes':['id',_0x9006('0x12'),_0x9006('0x13')]}});};exports[_0x9006('0x14')]=function(_0x4f02fa){return request(_0x9006('0xc'),{'options':{'where':{'id':_0x4f02fa},'attributes':[_0x9006('0x12')]}});};exports[_0x9006('0x15')]=function(_0x4746a2){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4746a2},'attributes':[_0x9006('0x12')]}});};exports['getVariableById']=function(_0x314437){return request('ShowVariable',{'options':{'where':{'id':_0x314437},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x3ac6f4){return request(_0x9006('0x16'),{'options':{'where':{'id':_0x3ac6f4},'attributes':[_0x9006('0x17')]}});};exports['getUserById']=function(_0x384a6b){return request(_0x9006('0x18'),{'options':{'where':{'id':_0x384a6b},'attributes':['name']}});};exports[_0x9006('0x19')]=function(_0xeaeb05){return request(_0x9006('0x1a'),{'options':{'where':{'id':_0xeaeb05},'attributes':[_0x9006('0x12')]}});};exports[_0x9006('0x1b')]=function(_0x3c3a40){return request(_0x9006('0x1c'),{'options':{'where':{'id':_0x3c3a40},'attributes':[_0x9006('0x1d')]}});};exports['getIntervalById']=function(_0x224492){return request(_0x9006('0x1e'),{'options':{'raw':![],'where':{'id':_0x224492},'include':[{'model':_0x9006('0x1f'),'as':_0x9006('0x20')}]}});};exports[_0x9006('0x21')]=function(_0x58e846){return request(_0x9006('0x22'),{'options':{'where':{'id':_0x58e846},'attributes':['id','name']}});};exports[_0x9006('0x23')]=function(_0x62e270){return request('CreateSmsMessage',{'body':_0x62e270});};exports[_0x9006('0x24')]=function(_0x7c7289){return request(_0x9006('0x25'),{'body':_0x7c7289});};exports[_0x9006('0x26')]=function(_0x5acae5){return request('CreateSquareReport',{'body':_[_0x9006('0x27')](_0x5acae5,{'project_name':_0x5acae5[_0x9006('0x28')],'prev_project_name':_0x5acae5[_0x9006('0x29')]||'','is_subproject':_0x5acae5[_0x9006('0x29')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x9006('0x2a')]=function(_0x3e95b1){return request(_0x9006('0x2b'),{'body':_0x3e95b1});};exports[_0x9006('0x2c')]=function(_0x470a1d){return request(_0x9006('0x2d'),{'body':_0x470a1d});};exports[_0x9006('0x2e')]=function(_0x19d034){return request(_0x9006('0x2f'),{'options':{'raw':![],'where':{'phone':_0x19d034[_0x9006('0x30')],'ListId':_0x19d034['ListId']}}})[_0x9006('0x8')](function(_0x38a0f8){if(_0x38a0f8){return _0x38a0f8;}return request(_0x9006('0x31'),{'body':_0x19d034});});};exports[_0x9006('0x32')]=function(_0x3951e4){return request(_0x9006('0x33'),{'options':{'where':{'id':_0x3951e4},'attributes':[_0x9006('0x12')]}});};exports[_0x9006('0x34')]=function(_0x347447,_0x2e5883){return request(_0x9006('0x35'),{'body':{'interface':_0x2e5883},'options':{'where':_0x347447}});};exports[_0x9006('0x36')]=function(_0x22bd34,_0x473ee8,_0x2a594c){return request('PauseUser',{'body':{'type':_0x473ee8,'uniqueid':_0x2a594c},'options':{'where':_0x22bd34}});};exports['agentUnpause']=function(_0xb68ee6){return request(_0x9006('0x37'),{'body':{},'options':{'where':_0xb68ee6}});};exports[_0x9006('0x38')]=function(_0x4fca27){return request('LogoutUser',{'body':{},'options':{'where':_0x4fca27}});}; \ No newline at end of file +var _0xb1c0=['createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','bluebird','moment','lodash','util','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','getSoundById','getIntervalById','ShowInterval','Intervals','ShowSmsAccount'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0xb1c0,0x1f2));var _0x0b1c=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xb1c0[_0x4ae6ef];return _0x3cbb4e;};'use strict';var BPromise=require(_0x0b1c('0x0'));var moment=require(_0x0b1c('0x1'));var _=require(_0x0b1c('0x2'));var util=require(_0x0b1c('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x0b1c('0x4')][_0x0b1c('0x5')]({'port':0x2329});function request(_0x46ff06,_0x28eeb7){return new BPromise(function(_0x12d082,_0xbe981f){return client[_0x0b1c('0x6')](_0x46ff06,_0x28eeb7)[_0x0b1c('0x7')](function(_0x5a8132){if(_0x5a8132[_0x0b1c('0x8')]){return _0xbe981f(_0x5a8132['error'][_0x0b1c('0x9')]);}else{return _0x12d082(_0x5a8132[_0x0b1c('0xa')]);}})['catch'](function(_0x27a8e7){return _0xbe981f(_0x27a8e7);});});}exports[_0x0b1c('0xb')]=function(_0x5556fb){return request(_0x0b1c('0xc'),{'options':{'raw':![],'where':{'name':_0x5556fb},'attributes':['production']}});};exports[_0x0b1c('0xd')]=function(_0x4270c9){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4270c9},'include':[{'model':_0x0b1c('0xe'),'as':'Smtp'}],'attributes':['id',_0x0b1c('0xf'),_0x0b1c('0x10')]}});};exports[_0x0b1c('0x11')]=function(_0x2b3d32){return request(_0x0b1c('0xc'),{'options':{'where':{'id':_0x2b3d32},'attributes':[_0x0b1c('0xf')]}});};exports[_0x0b1c('0x12')]=function(_0x32d1a5){return request(_0x0b1c('0x13'),{'options':{'where':{'id':_0x32d1a5},'attributes':[_0x0b1c('0xf')]}});};exports[_0x0b1c('0x14')]=function(_0x245924){return request(_0x0b1c('0x15'),{'options':{'where':{'id':_0x245924},'attributes':[_0x0b1c('0xf')]}});};exports[_0x0b1c('0x16')]=function(_0x265034){return request(_0x0b1c('0x17'),{'options':{'where':{'id':_0x265034},'attributes':['dsn']}});};exports[_0x0b1c('0x18')]=function(_0x37b751){return request(_0x0b1c('0x19'),{'options':{'where':{'id':_0x37b751},'attributes':[_0x0b1c('0xf')]}});};exports[_0x0b1c('0x1a')]=function(_0x4e66e0){return request('ShowTrunk',{'options':{'where':{'id':_0x4e66e0},'attributes':['name']}});};exports[_0x0b1c('0x1b')]=function(_0x4503d8){return request('ShowSound',{'options':{'where':{'id':_0x4503d8},'attributes':['save_name']}});};exports[_0x0b1c('0x1c')]=function(_0x39c317){return request(_0x0b1c('0x1d'),{'options':{'raw':![],'where':{'id':_0x39c317},'include':[{'model':'Interval','as':_0x0b1c('0x1e')}]}});};exports['getSmsAccountById']=function(_0x40b5af){return request(_0x0b1c('0x1f'),{'options':{'where':{'id':_0x40b5af},'attributes':['id',_0x0b1c('0xf')]}});};exports[_0x0b1c('0x20')]=function(_0x120e4c){return request(_0x0b1c('0x21'),{'body':_0x120e4c});};exports['createSquareDetailsReport']=function(_0x5604ab){return request(_0x0b1c('0x22'),{'body':_0x5604ab});};exports[_0x0b1c('0x23')]=function(_0x324d77){return request(_0x0b1c('0x24'),{'body':_[_0x0b1c('0x25')](_0x324d77,{'project_name':_0x324d77['arg_1'],'prev_project_name':_0x324d77[_0x0b1c('0x26')]||'','is_subproject':_0x324d77['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x0b1c('0x27'))})});};exports[_0x0b1c('0x28')]=function(_0x461fac){return request(_0x0b1c('0x29'),{'body':_0x461fac});};exports['createSquareMessage']=function(_0x2317d6){return request(_0x0b1c('0x2a'),{'body':_0x2317d6});};exports['createCmContact']=function(_0x5a4bac){return request(_0x0b1c('0x2b'),{'options':{'raw':![],'where':{'phone':_0x5a4bac[_0x0b1c('0x2c')],'ListId':_0x5a4bac[_0x0b1c('0x2d')]}}})['then'](function(_0x7aa2ab){if(_0x7aa2ab){return _0x7aa2ab;}return request(_0x0b1c('0x2e'),{'body':_0x5a4bac});});};exports['getPauseById']=function(_0x3730d2){return request(_0x0b1c('0x2f'),{'options':{'where':{'id':_0x3730d2},'attributes':[_0x0b1c('0xf')]}});};exports[_0x0b1c('0x30')]=function(_0x1ce56b,_0x34fa42){return request(_0x0b1c('0x31'),{'body':{'interface':_0x34fa42},'options':{'where':_0x1ce56b}});};exports[_0x0b1c('0x32')]=function(_0x446b9d,_0x5ebde6,_0x31486d){return request(_0x0b1c('0x33'),{'body':{'type':_0x5ebde6,'uniqueid':_0x31486d},'options':{'where':_0x446b9d}});};exports['agentUnpause']=function(_0x17c388){return request(_0x0b1c('0x34'),{'body':{},'options':{'where':_0x17c388}});};exports['agentLogout']=function(_0x59e095){return request('LogoutUser',{'body':{},'options':{'where':_0x59e095}});}; \ 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 ce0ad51..8bbf273 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 _0x975f=['exports','./polly'];(function(_0x34accb,_0x493649){var _0x5b8120=function(_0x4a9404){while(--_0x4a9404){_0x34accb['push'](_0x34accb['shift']());}};_0x5b8120(++_0x493649);}(_0x975f,0x191));var _0xf975=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x975f[_0x5783f4];return _0x28e380;};var polly=require(_0xf975('0x0'));var lex=require('./lex');module[_0xf975('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x1bb4=['./lex','exports','./polly'];(function(_0xa11108,_0x1cbaf1){var _0x108bd3=function(_0x3c0ee3){while(--_0x3c0ee3){_0xa11108['push'](_0xa11108['shift']());}};_0x108bd3(++_0x1cbaf1);}(_0x1bb4,0x1c7));var _0x41bb=function(_0x19661e,_0x40c4c2){_0x19661e=_0x19661e-0x0;var _0x4777ee=_0x1bb4[_0x19661e];return _0x4777ee;};var polly=require(_0x41bb('0x0'));var lex=require(_0x41bb('0x1'));module[_0x41bb('0x2')]={'polly':polly,'lex':lex}; \ 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 66fc6f0..f4687f8 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(_0x336353,_0x285fcb){var _0x354436=function(_0x5f05ff){while(--_0x5f05ff){_0x336353['push'](_0x336353['shift']());}};_0x354436(++_0x285fcb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x30a6d6,_0x229753){var _0xf7c511=function(_0x2e6369){while(--_0x2e6369){_0x30a6d6['push'](_0x30a6d6['shift']());}};_0xf7c511(++_0x229753);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 e9e1bb3..de83b33 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 _0x34a8=['./lib/api'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x34a8,0x110));var _0x834a=function(_0x1258fb,_0x2ef597){_0x1258fb=_0x1258fb-0x0;var _0x4b7f68=_0x34a8[_0x1258fb];return _0x4b7f68;};'use strict';var polly=require(_0x834a('0x0'));module['exports']=function(_0x50423d,_0x174c1e,_0x195a27,_0x6e8df3,_0x5edbb0,_0x3c88ba,_0x54ee36){return polly(_0x50423d,_0x174c1e,_0x195a27,_0x6e8df3,_0x5edbb0,_0x3c88ba,_0x54ee36);}; \ No newline at end of file +var _0x40ed=['exports'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x40ed,0xb2));var _0xd40e=function(_0x9149ac,_0x35400c){_0x9149ac=_0x9149ac-0x0;var _0x32e7f5=_0x40ed[_0x9149ac];return _0x32e7f5;};'use strict';var polly=require('./lib/api');module[_0xd40e('0x0')]=function(_0x22be51,_0x1037f2,_0x552df5,_0x49e9c6,_0x3c3b40,_0x55f83d,_0x571f9c){return polly(_0x22be51,_0x1037f2,_0x552df5,_0x49e9c6,_0x3c3b40,_0x55f83d,_0x571f9c);}; \ 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 aa77409..8027088 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 _0xf22d=['synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring'];(function(_0x54a9b8,_0x5e92c8){var _0xc80e8=function(_0x2ca239){while(--_0x2ca239){_0x54a9b8['push'](_0x54a9b8['shift']());}};_0xc80e8(++_0x5e92c8);}(_0xf22d,0x1d3));var _0xdf22=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xf22d[_0x292f93];return _0x5a94b1;};'use strict';var fs=require('fs');var path=require(_0xdf22('0x0'));var BPromise=require(_0xdf22('0x1'));var rs=require(_0xdf22('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x53e52f,_0x38539f,_0x403bc9){return new BPromise(function(_0x5b33bd,_0x6b73c6){_0x53e52f[_0xdf22('0x3')](_0x38539f,function(_0x33da14,_0x2dfcbd){if(_0x33da14){_0x6b73c6(_0x33da14);}else if(_0x2dfcbd){if(_0x2dfcbd[_0xdf22('0x4')]instanceof Buffer){fs['writeFile'](_0x403bc9,_0x2dfcbd['AudioStream'],function(_0x28bc72){if(_0x28bc72){_0x6b73c6(_0x28bc72);}else{_0x5b33bd();}});}else{_0x6b73c6(new Error(_0xdf22('0x5')));}}else{_0x6b73c6(new Error(_0xdf22('0x6')));}});});}module[_0xdf22('0x7')]=function(_0x1c1359,_0x4bbd2c,_0x1630a5,_0x1cb335,_0x1f80f5,_0x3e7693,_0x1522c9){var _0x2b01da=new AWS['Polly']({'accessKeyId':_0x1c1359,'secretAccessKey':_0x4bbd2c,'region':_0x1630a5});var _0x4af07e={'Text':_0x1f80f5,'TextType':_0x3e7693||_0xdf22('0x8'),'OutputFormat':_0xdf22('0x9'),'VoiceId':_0x1cb335};return pollyResult(_0x2b01da,_0x4af07e,_0x1522c9);}; \ No newline at end of file +var _0x1f13=['mp3','path','bluebird','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1f13,0x1e1));var _0x31f1=function(_0xef4d14,_0x108cdf){_0xef4d14=_0xef4d14-0x0;var _0x505ed0=_0x1f13[_0xef4d14];return _0x505ed0;};'use strict';var fs=require('fs');var path=require(_0x31f1('0x0'));var BPromise=require(_0x31f1('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x2d4fc8,_0x5477f8,_0x364143){return new BPromise(function(_0x5c32cc,_0x22e9ce){_0x2d4fc8[_0x31f1('0x2')](_0x5477f8,function(_0x19e13c,_0x26d29c){if(_0x19e13c){_0x22e9ce(_0x19e13c);}else if(_0x26d29c){if(_0x26d29c[_0x31f1('0x3')]instanceof Buffer){fs[_0x31f1('0x4')](_0x364143,_0x26d29c[_0x31f1('0x3')],function(_0x3ffc03){if(_0x3ffc03){_0x22e9ce(_0x3ffc03);}else{_0x5c32cc();}});}else{_0x22e9ce(new Error(_0x31f1('0x5')));}}else{_0x22e9ce(new Error(_0x31f1('0x6')));}});});}module[_0x31f1('0x7')]=function(_0x3654a6,_0x3d1d77,_0x5d4710,_0x226581,_0x360f3b,_0x31fcc4,_0x4808b2){var _0x112c02=new AWS[(_0x31f1('0x8'))]({'accessKeyId':_0x3654a6,'secretAccessKey':_0x3d1d77,'region':_0x5d4710});var _0x4de5fa={'Text':_0x360f3b,'TextType':_0x31fcc4||'text','OutputFormat':_0x31f1('0x9'),'VoiceId':_0x226581};return pollyResult(_0x112c02,_0x4de5fa,_0x4808b2);}; \ 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 b6de0fd..49a6c6c 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 _0x16b1=['./lib/api','exports'];(function(_0x9e7851,_0x1f8e39){var _0x1acc4b=function(_0x8fe024){while(--_0x8fe024){_0x9e7851['push'](_0x9e7851['shift']());}};_0x1acc4b(++_0x1f8e39);}(_0x16b1,0x1c4));var _0x116b=function(_0x4f7671,_0x4de544){_0x4f7671=_0x4f7671-0x0;var _0x54d462=_0x16b1[_0x4f7671];return _0x54d462;};'use strict';var asr=require(_0x116b('0x0'));module[_0x116b('0x1')]=function(_0x352c7f,_0x2c2dd3,_0x2eda89,_0x2baec8){return asr(_0x352c7f,_0x2c2dd3,_0x2eda89);}; \ No newline at end of file +var _0x1a32=['./lib/api','exports'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x1a32,0x86));var _0x21a3=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x1a32[_0x580647];return _0x5f0792;};'use strict';var asr=require(_0x21a3('0x0'));module[_0x21a3('0x1')]=function(_0xff2f81,_0x3b1b12,_0x3ee7bf,_0x5be139){return asr(_0xff2f81,_0x3b1b12,_0x3ee7bf);}; \ 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 b4c51cc..ee8ba83 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 _0x8ce3=['url','bluebird','exports','string','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0x2b5c6d,_0x25549c){var _0x4d9ff5=function(_0x56dad0){while(--_0x56dad0){_0x2b5c6d['push'](_0x2b5c6d['shift']());}};_0x4d9ff5(++_0x25549c);}(_0x8ce3,0xc3));var _0x38ce=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0x8ce3[_0x1de43c];return _0x296d3e;};'use strict';var url=require(_0x38ce('0x0'));var BPromise=require(_0x38ce('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x38ce('0x2')]=function(_0x2b99b0,_0xee1d0e,_0x26ec48){return new BPromise(function(_0x1b4dd4,_0x17b96d){var _0x1efae3;if(typeof _0x2b99b0!==_0x38ce('0x3')||_0x2b99b0['length']===0x0){return _0x17b96d(_0x38ce('0x4'));}if(typeof _0xee1d0e!==_0x38ce('0x3')||_0xee1d0e['length']===0x0){return _0x17b96d(_0x38ce('0x5'));}if(typeof _0x26ec48!==_0x38ce('0x6')&&(typeof _0x26ec48!==_0x38ce('0x3')||_0x26ec48['length']===0x0)){return _0x17b96d(_0x38ce('0x7'));}try{_0x1efae3=fs['readFileSync'](_0x2b99b0)[_0x38ce('0x8')]('base64');}catch(_0x133bd5){return _0x17b96d(_0x133bd5);}return _0x1b4dd4({'method':_0x38ce('0x9'),'uri':host+_0x38ce('0xa')+_0xee1d0e,'body':{'config':{'encoding':_0x38ce('0xb'),'sampleRateHertz':_0x38ce('0xc'),'languageCode':_0x26ec48},'audio':{'content':_0x1efae3}},'json':!![]});});}; \ No newline at end of file +var _0x1782=['string','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','filepath\x20should\x20be\x20a\x20string'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0x1782,0x13e));var _0x2178=function(_0x25ada9,_0x5f0e07){_0x25ada9=_0x25ada9-0x0;var _0x59e1ab=_0x1782[_0x25ada9];return _0x59e1ab;};'use strict';var url=require(_0x2178('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x2178('0x1');module[_0x2178('0x2')]=function(_0x1df52d,_0x1c92e6,_0x17b0da){return new BPromise(function(_0x4a185d,_0x601378){var _0x1659a1;if(typeof _0x1df52d!=='string'||_0x1df52d['length']===0x0){return _0x601378(_0x2178('0x3'));}if(typeof _0x1c92e6!==_0x2178('0x4')||_0x1c92e6['length']===0x0){return _0x601378('key\x20should\x20be\x20a\x20string');}if(typeof _0x17b0da!=='undefined'&&(typeof _0x17b0da!==_0x2178('0x4')||_0x17b0da[_0x2178('0x5')]===0x0)){return _0x601378(_0x2178('0x6'));}try{_0x1659a1=fs[_0x2178('0x7')](_0x1df52d)[_0x2178('0x8')](_0x2178('0x9'));}catch(_0x5119ea){return _0x601378(_0x5119ea);}return _0x4a185d({'method':_0x2178('0xa'),'uri':host+_0x2178('0xb')+_0x1c92e6,'body':{'config':{'encoding':_0x2178('0xc'),'sampleRateHertz':_0x2178('0xd'),'languageCode':_0x17b0da},'audio':{'content':_0x1659a1}},'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 5360310..0267dcb 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 _0x0d7e=['./asr','exports'];(function(_0x3910bb,_0x331041){var _0x1dc310=function(_0x20d454){while(--_0x20d454){_0x3910bb['push'](_0x3910bb['shift']());}};_0x1dc310(++_0x331041);}(_0x0d7e,0x1d6));var _0xe0d7=function(_0x524fe8,_0x1a4497){_0x524fe8=_0x524fe8-0x0;var _0x47560a=_0x0d7e[_0x524fe8];return _0x47560a;};var asr=require(_0xe0d7('0x0'));module[_0xe0d7('0x1')]={'asr':asr}; \ No newline at end of file +var _0x45ea=['./asr','exports'];(function(_0x4e84eb,_0x333f26){var _0x11cdad=function(_0xe727a7){while(--_0xe727a7){_0x4e84eb['push'](_0x4e84eb['shift']());}};_0x11cdad(++_0x333f26);}(_0x45ea,0x148));var _0xa45e=function(_0x21fda9,_0x2ed338){_0x21fda9=_0x21fda9-0x0;var _0x4c39cd=_0x45ea[_0x21fda9];return _0x4c39cd;};var asr=require(_0xa45e('0x0'));module[_0xa45e('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 c0fe9a8..7292879 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 _0xe93e=['confidence','googleASR\x20confidence','catch','name','textRequest','result','resolvedQuery','action','fulfillment','speech','score','status','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','sox','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','unlink','chmodSync','777','readFileSync','toString','base64','https://texttospeech.googleapis.com/v1/','?key=','ssml','audioConfig','MP3','text:synthesize','then','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0xe93e,0xb7));var _0xee93=function(_0xe4936,_0x3cd5c0){_0xe4936=_0xe4936-0x0;var _0x254fee=_0xe93e[_0xe4936];return _0x254fee;};'use strict';var apiai=require(_0xee93('0x0'));var BPromise=require(_0xee93('0x1'));var dialogflow=require(_0xee93('0x2'));var fs=require('fs');var http=require(_0xee93('0x3'));var https=require(_0xee93('0x4'));var md5=require(_0xee93('0x5'));var path=require(_0xee93('0x6'));var querystring=require(_0xee93('0x7'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0xee93('0x8'));var tts=require('google-tts-api');var urlParse=require(_0xee93('0x9'))[_0xee93('0xa')];var util=require(_0xee93('0xb'));var aws=require(_0xee93('0xc'));var google=require(_0xee93('0xd'));var sestek=require(_0xee93('0xe'));var tilde=require(_0xee93('0xf'));var logger=require(_0xee93('0x10'))('agi');var ISPEECH_API=_0xee93('0x11');function downloadFile(_0x4ad0ac,_0x4e3463){return new BPromise(function(_0x5f012e,_0x1a08cd){var _0x35d5e8=urlParse(_0x4ad0ac);var _0x1a28c4=_0x35d5e8[_0xee93('0x12')]===_0xee93('0x13')?https:http;var _0x154e15={'host':_0x35d5e8[_0xee93('0x14')],'path':_0x35d5e8['path'],'headers':{'user-agent':_0xee93('0x15')}};_0x1a28c4[_0xee93('0x16')](_0x154e15,function(_0x44c9b9){if(_0x44c9b9[_0xee93('0x17')]!==0xc8){logger[_0xee93('0x18')](_0xee93('0x19')+_0x4ad0ac+_0xee93('0x1a')+_0x44c9b9['statusCode']+'\x20('+_0x44c9b9[_0xee93('0x1b')]+')');_0x1a08cd(new Error(_0xee93('0x19')+_0x4ad0ac+_0xee93('0x1a')+_0x44c9b9[_0xee93('0x17')]+'\x20('+_0x44c9b9['statusMessage']+')'));return;}var _0x5922df=fs[_0xee93('0x1c')](_0x4e3463);_0x5922df['on'](_0xee93('0x1d'),function(){logger[_0xee93('0x1e')](_0xee93('0x1f'));_0x5922df[_0xee93('0x20')](_0x5f012e);});_0x5922df['on']('error',function(_0x3b779c){fs['unlink'](_0x4e3463);logger[_0xee93('0x18')](_0xee93('0x21'),_0x3b779c);_0x1a08cd(_0x3b779c);});_0x44c9b9[_0xee93('0x22')](_0x5922df);})['on'](_0xee93('0x18'),function(_0x9f662e){logger[_0xee93('0x18')](_0x9f662e);_0x1a08cd(_0x9f662e);})[_0xee93('0x23')]();});}function uploadFile(_0x540119){return new BPromise(function(_0x10a0b4,_0x4542e5){var _0x513743=urlParse(_0x540119);var _0x52058d=_0x513743[_0xee93('0x12')]===_0xee93('0x13')?https:http;var _0x4d6d41={'host':_0x513743['host'],'path':_0x513743[_0xee93('0x6')],'headers':{'user-agent':_0xee93('0x15')}};_0x52058d[_0xee93('0x16')](_0x4d6d41,function(_0x117c65){if(_0x117c65[_0xee93('0x17')]!==0xc8){_0x4542e5(new Error(_0xee93('0x19')+_0x540119+_0xee93('0x1a')+_0x117c65['statusCode']+'\x20('+_0x117c65['statusMessage']+')'));return;}var _0x257f7d='';_0x117c65['on'](_0xee93('0x24'),function(_0x4983ad){_0x257f7d+=_0x4983ad;});_0x117c65['on']('end',function(){_0x10a0b4(_0x257f7d);});})['on'](_0xee93('0x18'),function(_0xf54dad){_0x4542e5(_0xf54dad);})['end']();});}function convertFile(_0x30f74c,_0x143bde){return new BPromise(function(_0x1910f4,_0x7599bd){var _0x452364=sox[_0xee93('0x25')](_0x30f74c,_0x143bde,{'sampleRate':0x1f40,'format':_0xee93('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x452364['on'](_0xee93('0x18'),function(_0x20e34d){logger[_0xee93('0x18')](_0xee93('0x27'),_0x20e34d);_0x7599bd(_0x20e34d);});_0x452364['on'](_0xee93('0x23'),function(){logger[_0xee93('0x1e')](_0xee93('0x28'));_0x1910f4();});_0x452364[_0xee93('0x29')]();});}function base64Decode(_0x136131,_0x502a68){var _0x20ad04=path[_0xee93('0x2a')](__dirname,_0xee93('0x2b'),rs[_0xee93('0x2c')](0x4)+_0xee93('0x2d'));fs[_0xee93('0x2e')](_0x20ad04,_0x136131,'base64');return convertFile(_0x20ad04,_0x502a68)['then'](function(){try{fs[_0xee93('0x2f')](_0x20ad04);fs[_0xee93('0x30')](_0x502a68,_0xee93('0x31'));}catch(_0x1e1a49){logger[_0xee93('0x18')](_0x1e1a49);}return _0x502a68['split']('.')[0x0];});}function base64Encode(_0x126968){var _0xb97721=fs[_0xee93('0x32')](_0x126968);return new Buffer(_0xb97721)[_0xee93('0x33')](_0xee93('0x34'));}exports['googleCloudTTS']=function(_0x4d8c53,_0x3e1f7f,_0x253776,_0x20710d,_0x3b357a,_0x29824f){var _0x5a6ce0,_0x1fb371;var _0x4e4ca6=_0xee93('0x35');var _0x575380=_0xee93('0x36')+_0x4d8c53;var _0x437937={};if(_0x3e1f7f===_0xee93('0x37')){_0x437937['input']={'ssml':_0x253776};}else{_0x437937['input']={'text':_0x253776};};_0x437937['voice']={'languageCode':_0x20710d,'ssmlGender':_0x3b357a};_0x437937[_0xee93('0x38')]={'audioEncoding':_0xee93('0x39'),'sampleRateHertz':0x1f40};var _0x12e01a={'url':_0x4e4ca6+_0xee93('0x3a')+_0x575380,'method':'POST','json':!![],'body':_0x437937};return rp(_0x12e01a)[_0xee93('0x3b')](function(_0x29e3a3){return new BPromise(function(_0x2263b4,_0x216156){_0x5a6ce0=path[_0xee93('0x2a')](__dirname,_0xee93('0x2b'),rs[_0xee93('0x2c')](0x4)+_0xee93('0x3c'));var _0x2c24d4=Buffer[_0xee93('0x3d')](_0x29e3a3[_0xee93('0x3e')],_0xee93('0x34'));return fs[_0xee93('0x3f')](_0x5a6ce0,_0x2c24d4,function(_0x34d747){_0x216156(_0x34d747);},function(_0x80d119){fs[_0xee93('0x30')](_0x5a6ce0,_0xee93('0x31'));_0x2263b4(_0x80d119);});});})[_0xee93('0x3b')](function(_0x1986db){_0x1fb371=path[_0xee93('0x2a')](__dirname,_0xee93('0x2b'),rs[_0xee93('0x2c')](0x4)+_0xee93('0x2d'));return convertFile(_0x5a6ce0,_0x1fb371);})[_0xee93('0x3b')](function(){try{fs['unlink'](_0x5a6ce0);fs['chmodSync'](_0x1fb371,_0xee93('0x31'));}catch(_0x2ead3c){logger[_0xee93('0x18')](_0x2ead3c);}logger['info'](_0xee93('0x40'),_0x1fb371[_0xee93('0x41')]('.')[0x0]);return _0x1fb371[_0xee93('0x41')]('.')[0x0];});};exports[_0xee93('0x42')]=function(_0x5dc6d3,_0x4fcd6a){var _0x4731e8=_0xee93('0x43');var _0xf623b9,_0x371c9b;var _0x41038b;var _0x29d791={'encoding':_0xee93('0x44'),'method':_0xee93('0x45'),'timeout':0x2710,'url':_0x4731e8,'headers':{'Content-Type':_0xee93('0x46')},'body':_0xee93('0x47')+encodeURIComponent(JSON[_0xee93('0x48')]([[[_0xee93('0x49'),JSON[_0xee93('0x48')]([_0x5dc6d3,_0x4fcd6a||'en',![],_0xee93('0x4a')]),null,_0xee93('0x4b')]]]))};return rp(_0x29d791)[_0xee93('0x3b')](function(_0x3efb6b){try{_0x41038b=eval(_0x3efb6b[_0xee93('0x4c')](0x5))[0x0][0x2];}catch(_0x26950b){throw new Error(_0xee93('0x4d')+_0x3efb6b['data']);}if(!_0x41038b){if(_0x5dc6d3[_0xee93('0x4e')]>0xc8){throw new Error(_0xee93('0x4f'));}else{throw new Error('lang\x20\x22'+_0x4fcd6a+'\x22\x20might\x20not\x20exist');}}try{_0x41038b=eval(_0x41038b)[0x0];}catch(_0x5bb346){throw new Error(_0xee93('0x4d')+res['data']);}const _0x41e902=_0x41038b;_0xf623b9=path[_0xee93('0x2a')](__dirname,'tmp',rs[_0xee93('0x2c')](0x4)+'.mp3');fs[_0xee93('0x2e')](_0xf623b9,_0x41038b,{'encoding':_0xee93('0x34')});_0x371c9b=path[_0xee93('0x2a')](__dirname,_0xee93('0x2b'),rs[_0xee93('0x2c')](0x4)+'.wav');return convertFile(_0xf623b9,_0x371c9b);})['then'](function(){try{fs[_0xee93('0x2f')](_0xf623b9);fs[_0xee93('0x30')](_0x371c9b,'777');}catch(_0x2478d4){logger[_0xee93('0x18')](_0x2478d4);}logger[_0xee93('0x1e')](_0xee93('0x50'),_0x371c9b[_0xee93('0x41')]('.')[0x0]);return _0x371c9b[_0xee93('0x41')]('.')[0x0];});};exports[_0xee93('0x51')]=function(_0x444f9d,_0x178e3f,_0x5bb5d1){return google[_0xee93('0x52')](_0x444f9d,_0x178e3f,_0x5bb5d1)[_0xee93('0x3b')](function(_0x180772){logger[_0xee93('0x1e')](_0x180772[_0xee93('0x53')]);return rp(_0x180772);})['then'](function(_0x264c1f){var _0x21133c='';var _0x34c298=0x0;try{fs['unlink'](_0x444f9d);}catch(_0x1edced){logger[_0xee93('0x18')](_0x1edced);}if(_0x264c1f&&_0x264c1f[_0xee93('0x54')]){_0x21133c=_0x264c1f[_0xee93('0x54')][_0xee93('0x55')](function(_0x1cad4d){return _0x1cad4d&&_0x1cad4d['alternatives'][0x0]&&_0x1cad4d[_0xee93('0x56')][0x0]['transcript']?_0x1cad4d[_0xee93('0x56')][0x0][_0xee93('0x57')]:'';})[_0xee93('0x58')]('\x0a');_0x34c298=_0x264c1f[_0xee93('0x54')][_0xee93('0x55')](function(_0x170959){return _0x170959&&_0x170959[_0xee93('0x56')][0x0]&&_0x170959['alternatives'][0x0][_0xee93('0x59')]?_0x170959[_0xee93('0x56')][0x0][_0xee93('0x59')]:0x0;})[_0xee93('0x58')]('\x0a');}logger[_0xee93('0x1e')]('googleASR\x20transcription',_0x21133c);logger[_0xee93('0x1e')](_0xee93('0x5a'),_0x34c298);return{'transcript':_0x21133c,'confidence':_0x34c298};})[_0xee93('0x5b')](function(_0x135f21){logger[_0xee93('0x18')]('[%s]\x20%s:%s',_0x135f21[_0xee93('0x17')],_0x135f21[_0xee93('0x5c')],_0x135f21['message']);});};exports['googleDialogflow']=function(_0x20e822,_0x2d5905,_0x4743f6,_0x49ada3){var _0x552425=apiai(_0x2d5905,{'language':_0x49ada3||'en'});return _0x552425[_0xee93('0x5d')](_0x4743f6,{'sessionId':md5(_0x20e822)})[_0xee93('0x3b')](function(_0xf48510){logger[_0xee93('0x1e')](JSON[_0xee93('0x48')](_0xf48510));return{'source':_0xf48510[_0xee93('0x5e')]['source'],'resolvedQuery':_0xf48510['result'][_0xee93('0x5f')],'action':_0xf48510[_0xee93('0x5e')][_0xee93('0x60')],'actionIncomplete':_0xf48510[_0xee93('0x5e')]['actionIncomplete'],'speech':_0xf48510[_0xee93('0x5e')][_0xee93('0x61')][_0xee93('0x62')],'score':_0xf48510[_0xee93('0x5e')][_0xee93('0x63')],'statusCode':_0xf48510[_0xee93('0x64')]['code'],'endConversation':_0xf48510[_0xee93('0x5e')][_0xee93('0x65')]['endConversation']||![],'isFallbackIntent':_0xf48510[_0xee93('0x5e')][_0xee93('0x65')][_0xee93('0x66')]};});};exports[_0xee93('0x67')]=function(_0x3977da,_0x931ccb,_0x53c519,_0x3bdf37,_0x3d4c4a,_0x52c881){var _0x3787f7=_0x3bdf37[_0xee93('0x68')](/\\n/g,'\x0a');var _0x3fb735={'credentials':{'private_key':_0x3787f7,'client_email':_0x53c519}};var _0x4315c2=new dialogflow['SessionsClient'](_0x3fb735);var _0x5b6386=_0x4315c2[_0xee93('0x69')](_0x931ccb,md5(_0x3977da));var _0x45f35e={'session':_0x5b6386,'queryInput':{'text':{'text':_0x3d4c4a,'languageCode':_0x52c881}}};return _0x4315c2[_0xee93('0x6a')](_0x45f35e)['then'](function(_0x44a58c){if(_0x44a58c&&_0x44a58c['length']){logger[_0xee93('0x1e')](_0xee93('0x6b'),JSON[_0xee93('0x48')](_0x44a58c));var _0x55eb06=_0x44a58c[0x0];if(_0x55eb06){var _0x2db377={'action':_0x55eb06[_0xee93('0x6c')][_0xee93('0x60')],'allRequiredParamsPresent':_0x55eb06[_0xee93('0x6c')][_0xee93('0x6d')],'endConversation':_0x55eb06[_0xee93('0x6c')][_0xee93('0x6e')]&&_0x55eb06['queryResult']['diagnosticInfo'][_0xee93('0x6f')]?_0x55eb06[_0xee93('0x6c')][_0xee93('0x6e')]['fields']['end_conversation'][_0xee93('0x70')]:![],'fulfillmentText':_0x55eb06[_0xee93('0x6c')][_0xee93('0x71')],'intentName':_0x55eb06[_0xee93('0x6c')]['intent'][_0xee93('0x5c')],'intentDisplayName':_0x55eb06[_0xee93('0x6c')]['intent']['displayName'],'isFallbackIntent':_0x55eb06[_0xee93('0x6c')][_0xee93('0x72')][_0xee93('0x73')],'languageCode':_0x55eb06[_0xee93('0x6c')][_0xee93('0x74')],'queryText':_0x55eb06['queryResult'][_0xee93('0x75')],'responseId':_0x55eb06[_0xee93('0x76')],'score':_0x55eb06[_0xee93('0x6c')][_0xee93('0x77')],'speech':_0x55eb06[_0xee93('0x6c')][_0xee93('0x71')],'providerResponse':JSON[_0xee93('0x48')](_0x44a58c)};return _0x2db377;}}});};exports['tildeASR']=function(_0x34cf1f,_0x111e7e,_0x5a1407,_0x13edf8){return tilde[_0xee93('0x52')](_0x34cf1f,_0x111e7e,_0x5a1407,_0x13edf8)['then'](function(_0x540047){try{fs[_0xee93('0x2f')](_0x34cf1f);}catch(_0x503b22){logger[_0xee93('0x18')](_0x503b22);}logger['info'](_0xee93('0x78'),_0x540047[_0xee93('0x57')]);logger['info'](_0xee93('0x79'),_0x540047['confidence']);return _0x540047;});};exports[_0xee93('0x7a')]=function(_0x2bc253,_0x3eb246,_0x504d6b,_0x4dda52,_0x2a2985,_0x381c66){var _0x8273b5=path[_0xee93('0x2a')](__dirname,_0xee93('0x2b'),rs[_0xee93('0x2c')](0x4)+_0xee93('0x3c'));var _0x293551;return aws[_0xee93('0x7b')](_0x2bc253,_0x3eb246,_0x504d6b,_0x4dda52,_0x2a2985,_0x381c66,_0x8273b5)[_0xee93('0x3b')](function(){_0x293551=path['resolve'](__dirname,_0xee93('0x2b'),rs['generate'](0x4)+_0xee93('0x2d'));return convertFile(_0x8273b5,_0x293551);})[_0xee93('0x3b')](function(){try{fs[_0xee93('0x2f')](_0x8273b5);fs[_0xee93('0x30')](_0x293551,_0xee93('0x31'));}catch(_0x58f011){logger['error'](_0x58f011);}return _0x293551[_0xee93('0x41')]('.')[0x0];});};exports[_0xee93('0x7c')]=function(_0x49a9e6,_0x33b47f,_0x11aa12,_0x44582d,_0x5d2ea5,_0x33ea73){return aws[_0xee93('0x7d')](_0x49a9e6,_0x33b47f,_0x11aa12,_0x44582d,_0x5d2ea5,_0x33ea73)['then'](function(_0xc0380f){logger[_0xee93('0x1e')](JSON[_0xee93('0x48')](_0xc0380f));return _0xc0380f;});};exports[_0xee93('0x7e')]=function(_0x666007,_0x4bd45c,_0x4f16e3,_0x46d808){var _0x2a9df9=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x666007,encodeURIComponent(_0x4bd45c),_0x4f16e3,_0x46d808);var _0x2e8b9c=path[_0xee93('0x2a')](__dirname,_0xee93('0x2b'),rs['generate'](0x4)+_0xee93('0x3c'));var _0x432394;return downloadFile(_0x2a9df9,_0x2e8b9c)['then'](function(){_0x432394=path[_0xee93('0x2a')](__dirname,_0xee93('0x2b'),rs[_0xee93('0x2c')](0x4)+'.wav');return convertFile(_0x2e8b9c,_0x432394);})[_0xee93('0x3b')](function(){try{fs['unlink'](_0x2e8b9c);fs[_0xee93('0x30')](_0x432394,'777');}catch(_0x348f75){logger[_0xee93('0x18')](_0x348f75);}return _0x432394[_0xee93('0x41')]('.')[0x0];});};exports['ispeechASR']=function(_0x68e40f,_0x151bd0,_0x110404,_0x51a6e3){var _0xbcff23=util[_0xee93('0x7f')](_0xee93('0x80'),ISPEECH_API,_0x151bd0,_0x110404,base64Encode(_0x68e40f),_0x51a6e3?util[_0xee93('0x7f')]('model=%s',encodeURIComponent(_0x51a6e3)):'freeform=3');return uploadFile(_0xbcff23)[_0xee93('0x3b')](function(_0xe65946){return querystring[_0xee93('0xa')](_0xe65946);});};exports[_0xee93('0x81')]=function(_0x28da04,_0x53167d){return sestek[_0xee93('0x82')](_0x28da04,_0x53167d)[_0xee93('0x3b')](function(_0x2d68b4){logger[_0xee93('0x1e')](JSON[_0xee93('0x48')](_0x2d68b4));var _0x745be2={'speech':_0x2d68b4[_0xee93('0x83')],'action':_0x2d68b4[_0xee93('0x84')]?_0x2d68b4['channelData']['CustomAction']:undefined,'actiondata':_0x2d68b4['channelData']?_0x2d68b4[_0xee93('0x84')][_0xee93('0x85')]:undefined};if(_0x2d68b4[_0xee93('0x84')]&&_0x2d68b4[_0xee93('0x84')][_0xee93('0x86')]){return base64Decode(_0x2d68b4['channelData'][_0xee93('0x86')][_0xee93('0x87')],path[_0xee93('0x2a')](__dirname,'tmp',rs[_0xee93('0x2c')](0x4)+_0xee93('0x2d')))[_0xee93('0x3b')](function(_0x31ca9c){_0x745be2['audiofile']=_0x31ca9c;return _0x745be2;});}return _0x745be2;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x08cf=['text:synthesize','POST','.mp3','from','audioContent','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','name','message','googleDialogflow','textRequest','result','action','actionIncomplete','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','detectIntent','length','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','parse','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','dialogflow','http','md5','querystring','randomstring','sox','util','./aws','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','info','finish\x20download\x20file','close','download\x20error','end','data','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig'];(function(_0x560f24,_0x4f5306){var _0x42e919=function(_0x254bcd){while(--_0x254bcd){_0x560f24['push'](_0x560f24['shift']());}};_0x42e919(++_0x4f5306);}(_0x08cf,0xd0));var _0xf08c=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0x08cf[_0x3a8db5];return _0x2c03cd;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xf08c('0x0'));var fs=require('fs');var http=require(_0xf08c('0x1'));var https=require('https');var md5=require(_0xf08c('0x2'));var path=require('path');var querystring=require(_0xf08c('0x3'));var rp=require('request-promise');var rs=require(_0xf08c('0x4'));var sox=require(_0xf08c('0x5'));var tts=require('google-tts-api');var urlParse=require('url')['parse'];var util=require(_0xf08c('0x6'));var aws=require(_0xf08c('0x7'));var google=require('./google');var sestek=require(_0xf08c('0x8'));var tilde=require('./tilde');var logger=require(_0xf08c('0x9'))('agi');var ISPEECH_API=_0xf08c('0xa');function downloadFile(_0x4fe93a,_0x35e57a){return new BPromise(function(_0x4c221d,_0xb15dfe){var _0x5d5736=urlParse(_0x4fe93a);var _0x433f6a=_0x5d5736[_0xf08c('0xb')]===_0xf08c('0xc')?https:http;var _0x151c8a={'host':_0x5d5736[_0xf08c('0xd')],'path':_0x5d5736[_0xf08c('0xe')],'headers':{'user-agent':_0xf08c('0xf')}};_0x433f6a[_0xf08c('0x10')](_0x151c8a,function(_0x18891a){if(_0x18891a['statusCode']!==0xc8){logger[_0xf08c('0x11')](_0xf08c('0x12')+_0x4fe93a+_0xf08c('0x13')+_0x18891a[_0xf08c('0x14')]+'\x20('+_0x18891a[_0xf08c('0x15')]+')');_0xb15dfe(new Error(_0xf08c('0x12')+_0x4fe93a+_0xf08c('0x13')+_0x18891a[_0xf08c('0x14')]+'\x20('+_0x18891a[_0xf08c('0x15')]+')'));return;}var _0xedd6e4=fs[_0xf08c('0x16')](_0x35e57a);_0xedd6e4['on']('finish',function(){logger[_0xf08c('0x17')](_0xf08c('0x18'));_0xedd6e4[_0xf08c('0x19')](_0x4c221d);});_0xedd6e4['on']('error',function(_0x486ec0){fs['unlink'](_0x35e57a);logger[_0xf08c('0x11')](_0xf08c('0x1a'),_0x486ec0);_0xb15dfe(_0x486ec0);});_0x18891a['pipe'](_0xedd6e4);})['on'](_0xf08c('0x11'),function(_0xa7bd6a){logger[_0xf08c('0x11')](_0xa7bd6a);_0xb15dfe(_0xa7bd6a);})[_0xf08c('0x1b')]();});}function uploadFile(_0x5eae5a){return new BPromise(function(_0x56402c,_0x66acb0){var _0x55718c=urlParse(_0x5eae5a);var _0x26afe3=_0x55718c[_0xf08c('0xb')]===_0xf08c('0xc')?https:http;var _0x23ad16={'host':_0x55718c[_0xf08c('0xd')],'path':_0x55718c[_0xf08c('0xe')],'headers':{'user-agent':'WHAT_EVER'}};_0x26afe3[_0xf08c('0x10')](_0x23ad16,function(_0x746d85){if(_0x746d85[_0xf08c('0x14')]!==0xc8){_0x66acb0(new Error('request\x20to\x20'+_0x5eae5a+'\x20failed,\x20status\x20code\x20=\x20'+_0x746d85[_0xf08c('0x14')]+'\x20('+_0x746d85[_0xf08c('0x15')]+')'));return;}var _0x2eeeb3='';_0x746d85['on'](_0xf08c('0x1c'),function(_0x393f7c){_0x2eeeb3+=_0x393f7c;});_0x746d85['on'](_0xf08c('0x1b'),function(){_0x56402c(_0x2eeeb3);});})['on'](_0xf08c('0x11'),function(_0x3d9ab9){_0x66acb0(_0x3d9ab9);})['end']();});}function convertFile(_0x341544,_0x1f31b8){return new BPromise(function(_0x9ecc37,_0x36ac15){var _0x98b39d=sox['transcode'](_0x341544,_0x1f31b8,{'sampleRate':0x1f40,'format':_0xf08c('0x1d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x98b39d['on'](_0xf08c('0x11'),function(_0x208491){logger[_0xf08c('0x11')]('error\x20convert',_0x208491);_0x36ac15(_0x208491);});_0x98b39d['on']('end',function(){logger[_0xf08c('0x17')](_0xf08c('0x1e'));_0x9ecc37();});_0x98b39d[_0xf08c('0x1f')]();});}function base64Decode(_0x4ec64d,_0x5aee3f){var _0x29c939=path[_0xf08c('0x20')](__dirname,_0xf08c('0x21'),rs[_0xf08c('0x22')](0x4)+_0xf08c('0x23'));fs[_0xf08c('0x24')](_0x29c939,_0x4ec64d,_0xf08c('0x25'));return convertFile(_0x29c939,_0x5aee3f)[_0xf08c('0x26')](function(){try{fs[_0xf08c('0x27')](_0x29c939);fs[_0xf08c('0x28')](_0x5aee3f,_0xf08c('0x29'));}catch(_0x5ca631){logger[_0xf08c('0x11')](_0x5ca631);}return _0x5aee3f[_0xf08c('0x2a')]('.')[0x0];});}function base64Encode(_0xef0382){var _0x88a6f4=fs[_0xf08c('0x2b')](_0xef0382);return new Buffer(_0x88a6f4)[_0xf08c('0x2c')](_0xf08c('0x25'));}exports[_0xf08c('0x2d')]=function(_0x28e75c,_0x60213c,_0x31ca73,_0x5279f7,_0x5537d0,_0x53f811){var _0x18bbdc,_0x91b06b;var _0x40e31b=_0xf08c('0x2e');var _0x41244c=_0xf08c('0x2f')+_0x28e75c;var _0x1c5834={};if(_0x60213c===_0xf08c('0x30')){_0x1c5834['input']={'ssml':_0x31ca73};}else{_0x1c5834[_0xf08c('0x31')]={'text':_0x31ca73};};_0x1c5834[_0xf08c('0x32')]={'languageCode':_0x5279f7,'ssmlGender':_0x5537d0};_0x1c5834[_0xf08c('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x44d174={'url':_0x40e31b+_0xf08c('0x34')+_0x41244c,'method':_0xf08c('0x35'),'json':!![],'body':_0x1c5834};return rp(_0x44d174)[_0xf08c('0x26')](function(_0x462657){return new BPromise(function(_0x40e384,_0x18c50a){_0x18bbdc=path[_0xf08c('0x20')](__dirname,_0xf08c('0x21'),rs[_0xf08c('0x22')](0x4)+_0xf08c('0x36'));var _0x531750=Buffer[_0xf08c('0x37')](_0x462657[_0xf08c('0x38')],'base64');return fs['writeFile'](_0x18bbdc,_0x531750,function(_0x48de95){_0x18c50a(_0x48de95);},function(_0x22dd7e){fs[_0xf08c('0x28')](_0x18bbdc,_0xf08c('0x29'));_0x40e384(_0x22dd7e);});});})[_0xf08c('0x26')](function(_0x19b6a4){_0x91b06b=path['resolve'](__dirname,_0xf08c('0x21'),rs[_0xf08c('0x22')](0x4)+_0xf08c('0x23'));return convertFile(_0x18bbdc,_0x91b06b);})['then'](function(){try{fs[_0xf08c('0x27')](_0x18bbdc);fs[_0xf08c('0x28')](_0x91b06b,_0xf08c('0x29'));}catch(_0x1d8ad7){logger[_0xf08c('0x11')](_0x1d8ad7);}logger['info'](_0xf08c('0x39'),_0x91b06b[_0xf08c('0x2a')]('.')[0x0]);return _0x91b06b[_0xf08c('0x2a')]('.')[0x0];});};exports[_0xf08c('0x3a')]=function(_0xa5fdb2,_0x2cee8d){var _0x38dd90=_0xf08c('0x3b');var _0x2afd4c,_0x2e22f8;var _0x3fb64e;var _0x22df10={'encoding':_0xf08c('0x3c'),'method':'POST','timeout':0x2710,'url':_0x38dd90,'headers':{'Content-Type':_0xf08c('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0xf08c('0x3e')]([[[_0xf08c('0x3f'),JSON[_0xf08c('0x3e')]([_0xa5fdb2,_0x2cee8d||'en',![],'null']),null,_0xf08c('0x40')]]]))};return rp(_0x22df10)[_0xf08c('0x26')](function(_0x563cf3){try{_0x3fb64e=eval(_0x563cf3[_0xf08c('0x41')](0x5))[0x0][0x2];}catch(_0x14521e){throw new Error('parse\x20response\x20failed:\x0a'+_0x563cf3[_0xf08c('0x1c')]);}if(!_0x3fb64e){if(_0xa5fdb2['length']>0xc8){throw new Error(_0xf08c('0x42'));}else{throw new Error('lang\x20\x22'+_0x2cee8d+_0xf08c('0x43'));}}try{_0x3fb64e=eval(_0x3fb64e)[0x0];}catch(_0x23b3cc){throw new Error(_0xf08c('0x44')+res[_0xf08c('0x1c')]);}const _0x117c61=_0x3fb64e;_0x2afd4c=path[_0xf08c('0x20')](__dirname,'tmp',rs[_0xf08c('0x22')](0x4)+'.mp3');fs[_0xf08c('0x24')](_0x2afd4c,_0x3fb64e,{'encoding':'base64'});_0x2e22f8=path[_0xf08c('0x20')](__dirname,_0xf08c('0x21'),rs[_0xf08c('0x22')](0x4)+_0xf08c('0x23'));return convertFile(_0x2afd4c,_0x2e22f8);})[_0xf08c('0x26')](function(){try{fs[_0xf08c('0x27')](_0x2afd4c);fs[_0xf08c('0x28')](_0x2e22f8,_0xf08c('0x29'));}catch(_0x433af5){logger[_0xf08c('0x11')](_0x433af5);}logger[_0xf08c('0x17')](_0xf08c('0x45'),_0x2e22f8[_0xf08c('0x2a')]('.')[0x0]);return _0x2e22f8[_0xf08c('0x2a')]('.')[0x0];});};exports[_0xf08c('0x46')]=function(_0x3cd419,_0x4a3e99,_0xb365d8){return google['asr'](_0x3cd419,_0x4a3e99,_0xb365d8)['then'](function(_0x3df124){logger[_0xf08c('0x17')](_0x3df124[_0xf08c('0x47')]);return rp(_0x3df124);})[_0xf08c('0x26')](function(_0x3b4971){var _0x15d1d3='';var _0x506baf=0x0;try{fs[_0xf08c('0x27')](_0x3cd419);}catch(_0x25f4a8){logger[_0xf08c('0x11')](_0x25f4a8);}if(_0x3b4971&&_0x3b4971[_0xf08c('0x48')]){_0x15d1d3=_0x3b4971[_0xf08c('0x48')]['map'](function(_0x25d8bf){return _0x25d8bf&&_0x25d8bf[_0xf08c('0x49')][0x0]&&_0x25d8bf[_0xf08c('0x49')][0x0][_0xf08c('0x4a')]?_0x25d8bf[_0xf08c('0x49')][0x0][_0xf08c('0x4a')]:'';})[_0xf08c('0x4b')]('\x0a');_0x506baf=_0x3b4971[_0xf08c('0x48')][_0xf08c('0x4c')](function(_0x18dbaf){return _0x18dbaf&&_0x18dbaf['alternatives'][0x0]&&_0x18dbaf[_0xf08c('0x49')][0x0][_0xf08c('0x4d')]?_0x18dbaf[_0xf08c('0x49')][0x0][_0xf08c('0x4d')]:0x0;})['join']('\x0a');}logger[_0xf08c('0x17')](_0xf08c('0x4e'),_0x15d1d3);logger['info']('googleASR\x20confidence',_0x506baf);return{'transcript':_0x15d1d3,'confidence':_0x506baf};})[_0xf08c('0x4f')](function(_0x6c9ae5){logger[_0xf08c('0x11')]('[%s]\x20%s:%s',_0x6c9ae5[_0xf08c('0x14')],_0x6c9ae5[_0xf08c('0x50')],_0x6c9ae5[_0xf08c('0x51')]);});};exports[_0xf08c('0x52')]=function(_0x53ebe1,_0x3f75b5,_0x1c677e,_0x453077){var _0x14a13a=apiai(_0x3f75b5,{'language':_0x453077||'en'});return _0x14a13a[_0xf08c('0x53')](_0x1c677e,{'sessionId':md5(_0x53ebe1)})[_0xf08c('0x26')](function(_0x3c564b){logger['info'](JSON[_0xf08c('0x3e')](_0x3c564b));return{'source':_0x3c564b[_0xf08c('0x54')]['source'],'resolvedQuery':_0x3c564b[_0xf08c('0x54')]['resolvedQuery'],'action':_0x3c564b['result'][_0xf08c('0x55')],'actionIncomplete':_0x3c564b[_0xf08c('0x54')][_0xf08c('0x56')],'speech':_0x3c564b['result']['fulfillment'][_0xf08c('0x57')],'score':_0x3c564b[_0xf08c('0x54')][_0xf08c('0x58')],'statusCode':_0x3c564b[_0xf08c('0x59')][_0xf08c('0x5a')],'endConversation':_0x3c564b[_0xf08c('0x54')][_0xf08c('0x5b')][_0xf08c('0x5c')]||![],'isFallbackIntent':_0x3c564b[_0xf08c('0x54')][_0xf08c('0x5b')][_0xf08c('0x5d')]};});};exports[_0xf08c('0x5e')]=function(_0x3f3146,_0x2beec0,_0x581e6d,_0x3e6f20,_0xfc4af3,_0x46c409){var _0x256d6d=_0x3e6f20[_0xf08c('0x5f')](/\\n/g,'\x0a');var _0x2e94b4={'credentials':{'private_key':_0x256d6d,'client_email':_0x581e6d}};var _0x1dbdc1=new dialogflow['SessionsClient'](_0x2e94b4);var _0x496cff=_0x1dbdc1['sessionPath'](_0x2beec0,md5(_0x3f3146));var _0x2a87ea={'session':_0x496cff,'queryInput':{'text':{'text':_0xfc4af3,'languageCode':_0x46c409}}};return _0x1dbdc1[_0xf08c('0x60')](_0x2a87ea)[_0xf08c('0x26')](function(_0x2f8d57){if(_0x2f8d57&&_0x2f8d57[_0xf08c('0x61')]){logger[_0xf08c('0x17')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x2f8d57));var _0x565097=_0x2f8d57[0x0];if(_0x565097){var _0xb1757={'action':_0x565097['queryResult']['action'],'allRequiredParamsPresent':_0x565097[_0xf08c('0x62')][_0xf08c('0x63')],'endConversation':_0x565097[_0xf08c('0x62')][_0xf08c('0x64')]&&_0x565097[_0xf08c('0x62')][_0xf08c('0x64')][_0xf08c('0x65')]?_0x565097[_0xf08c('0x62')]['diagnosticInfo'][_0xf08c('0x65')][_0xf08c('0x66')][_0xf08c('0x67')]:![],'fulfillmentText':_0x565097[_0xf08c('0x62')][_0xf08c('0x68')],'intentName':_0x565097['queryResult'][_0xf08c('0x69')][_0xf08c('0x50')],'intentDisplayName':_0x565097['queryResult'][_0xf08c('0x69')][_0xf08c('0x6a')],'isFallbackIntent':_0x565097[_0xf08c('0x62')][_0xf08c('0x69')]['isFallback'],'languageCode':_0x565097[_0xf08c('0x62')]['languageCode'],'queryText':_0x565097[_0xf08c('0x62')][_0xf08c('0x6b')],'responseId':_0x565097[_0xf08c('0x6c')],'score':_0x565097[_0xf08c('0x62')][_0xf08c('0x6d')],'speech':_0x565097[_0xf08c('0x62')][_0xf08c('0x68')],'providerResponse':JSON[_0xf08c('0x3e')](_0x2f8d57)};return _0xb1757;}}});};exports[_0xf08c('0x6e')]=function(_0x2df94f,_0x328bb8,_0x2bb585,_0x4b17b9){return tilde[_0xf08c('0x6f')](_0x2df94f,_0x328bb8,_0x2bb585,_0x4b17b9)[_0xf08c('0x26')](function(_0xad7af){try{fs[_0xf08c('0x27')](_0x2df94f);}catch(_0xf48176){logger['error'](_0xf48176);}logger[_0xf08c('0x17')](_0xf08c('0x70'),_0xad7af[_0xf08c('0x4a')]);logger[_0xf08c('0x17')]('Tilde\x20ASR\x20confidence',_0xad7af[_0xf08c('0x4d')]);return _0xad7af;});};exports[_0xf08c('0x71')]=function(_0x292443,_0x3ba5e2,_0x50aa73,_0x24f9dc,_0x7f6003,_0x490593){var _0x551170=path[_0xf08c('0x20')](__dirname,_0xf08c('0x21'),rs[_0xf08c('0x22')](0x4)+_0xf08c('0x36'));var _0x5d8693;return aws['polly'](_0x292443,_0x3ba5e2,_0x50aa73,_0x24f9dc,_0x7f6003,_0x490593,_0x551170)[_0xf08c('0x26')](function(){_0x5d8693=path['resolve'](__dirname,_0xf08c('0x21'),rs['generate'](0x4)+_0xf08c('0x23'));return convertFile(_0x551170,_0x5d8693);})[_0xf08c('0x26')](function(){try{fs[_0xf08c('0x27')](_0x551170);fs['chmodSync'](_0x5d8693,_0xf08c('0x29'));}catch(_0x38100b){logger[_0xf08c('0x11')](_0x38100b);}return _0x5d8693['split']('.')[0x0];});};exports['awsLex']=function(_0x59673f,_0x444adc,_0x166b2e,_0x3ae1a3,_0x2a26a6,_0xf973db){return aws['lex'](_0x59673f,_0x444adc,_0x166b2e,_0x3ae1a3,_0x2a26a6,_0xf973db)[_0xf08c('0x26')](function(_0x3f01e9){logger['info'](JSON[_0xf08c('0x3e')](_0x3f01e9));return _0x3f01e9;});};exports[_0xf08c('0x72')]=function(_0x4e3bf0,_0x19d356,_0x424d4c,_0x1e9ba1){var _0x128ac9=util['format'](_0xf08c('0x73'),ISPEECH_API,_0x4e3bf0,encodeURIComponent(_0x19d356),_0x424d4c,_0x1e9ba1);var _0x4c570a=path[_0xf08c('0x20')](__dirname,_0xf08c('0x21'),rs[_0xf08c('0x22')](0x4)+_0xf08c('0x36'));var _0x262ccc;return downloadFile(_0x128ac9,_0x4c570a)[_0xf08c('0x26')](function(){_0x262ccc=path[_0xf08c('0x20')](__dirname,'tmp',rs[_0xf08c('0x22')](0x4)+_0xf08c('0x23'));return convertFile(_0x4c570a,_0x262ccc);})['then'](function(){try{fs[_0xf08c('0x27')](_0x4c570a);fs['chmodSync'](_0x262ccc,_0xf08c('0x29'));}catch(_0x203e4b){logger[_0xf08c('0x11')](_0x203e4b);}return _0x262ccc['split']('.')[0x0];});};exports[_0xf08c('0x74')]=function(_0x943c6c,_0x3b7980,_0x3d6405,_0x17282b){var _0x211c62=util[_0xf08c('0x75')](_0xf08c('0x76'),ISPEECH_API,_0x3b7980,_0x3d6405,base64Encode(_0x943c6c),_0x17282b?util['format'](_0xf08c('0x77'),encodeURIComponent(_0x17282b)):'freeform=3');return uploadFile(_0x211c62)[_0xf08c('0x26')](function(_0x16b1b5){return querystring[_0xf08c('0x78')](_0x16b1b5);});};exports[_0xf08c('0x79')]=function(_0x56f5ae,_0xf9e9c7){return sestek[_0xf08c('0x7a')](_0x56f5ae,_0xf9e9c7)[_0xf08c('0x26')](function(_0x293b00){logger[_0xf08c('0x17')](JSON['stringify'](_0x293b00));var _0x7d07d6={'speech':_0x293b00[_0xf08c('0x7b')],'action':_0x293b00[_0xf08c('0x7c')]?_0x293b00[_0xf08c('0x7c')][_0xf08c('0x7d')]:undefined,'actiondata':_0x293b00[_0xf08c('0x7c')]?_0x293b00[_0xf08c('0x7c')]['CustomActionData']:undefined};if(_0x293b00['channelData']&&_0x293b00['channelData'][_0xf08c('0x7e')]){return base64Decode(_0x293b00[_0xf08c('0x7c')][_0xf08c('0x7e')][_0xf08c('0x7f')],path[_0xf08c('0x20')](__dirname,'tmp',rs[_0xf08c('0x22')](0x4)+'.wav'))[_0xf08c('0x26')](function(_0x1e8535){_0x7d07d6[_0xf08c('0x80')]=_0x1e8535;return _0x7d07d6;});}return _0x7d07d6;});};exports[_0xf08c('0x81')]=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 6f28561..52694b8 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 _0x5938=['./nda'];(function(_0x41c746,_0x59ddf0){var _0x2d7282=function(_0x288680){while(--_0x288680){_0x41c746['push'](_0x41c746['shift']());}};_0x2d7282(++_0x59ddf0);}(_0x5938,0x1f3));var _0x8593=function(_0xe7cdf2,_0x1ef489){_0xe7cdf2=_0xe7cdf2-0x0;var _0x5e83aa=_0x5938[_0xe7cdf2];return _0x5e83aa;};var nda=require(_0x8593('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0xc048=['exports','./nda'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xc048,0x1b7));var _0x8c04=function(_0x34d2eb,_0xca9749){_0x34d2eb=_0x34d2eb-0x0;var _0x451305=_0xc048[_0x34d2eb];return _0x451305;};var nda=require(_0x8c04('0x0'));module[_0x8c04('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 87410e0..4deef81 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 _0x58a7=['project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','text','Bearer\x20','access_token','body','channelData','ProjectName'];(function(_0x11595c,_0x5e14a0){var _0x3acfcb=function(_0x30d5ef){while(--_0x30d5ef){_0x11595c['push'](_0x11595c['shift']());}};_0x3acfcb(++_0x5e14a0);}(_0x58a7,0xf7));var _0x758a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x58a7[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require(_0x758a('0x0'));var url=require(_0x758a('0x1'));var logger=require(_0x758a('0x2'))(_0x758a('0x3'));module[_0x758a('0x4')]=function(_0x62bb23,_0x306220){var _0x30f974={'method':'POST','uri':url[_0x758a('0x5')](_0x306220[_0x758a('0x6')],_0x758a('0x7')),'form':{'grant_type':_0x758a('0x8'),'username':_0x306220['username'],'password':_0x306220['password']},'json':!![]};return rp(_0x30f974)[_0x758a('0x9')](function(_0x514bca){var _0x227bdb={'method':_0x758a('0xa'),'uri':url[_0x758a('0x5')](_0x306220[_0x758a('0xb')],_0x758a('0xc')),'body':{'type':_0x306220[_0x758a('0xd')]||_0x758a('0xe'),'channelId':_0x758a('0xf'),'conversation':{'id':_0x62bb23[_0x758a('0x10')]},'from':{'id':_0x62bb23[_0x758a('0x11')],'name':_0x62bb23[_0x758a('0x12')]},'recipient':{'id':_0x62bb23['dnid'],'name':_0x62bb23['extension']},'text':_0x306220[_0x758a('0x13')],'channelData':{}},'headers':{'Authorization':_0x758a('0x14')+_0x514bca[_0x758a('0x15')]},'json':!![]};if(_0x306220['project']){_0x227bdb[_0x758a('0x16')][_0x758a('0x17')][_0x758a('0x18')]=_0x306220[_0x758a('0x19')];}if(_0x306220[_0x758a('0x1a')]=='1'){_0x227bdb['body']['channelData'][_0x758a('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x758a('0x1c')};}if(_0x306220[_0x758a('0x1d')]){_0x227bdb['body']['channelData']['CustomAction']=_0x306220['custom_action'];if(_0x306220[_0x758a('0x1e')]){_0x227bdb[_0x758a('0x16')]['channelData'][_0x758a('0x1f')]=_0x306220[_0x758a('0x1e')];}}logger[_0x758a('0x20')](JSON[_0x758a('0x21')](_0x227bdb));return rp(_0x227bdb);});}; \ No newline at end of file +var _0x1df5=['ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData'];(function(_0x1c0afc,_0x26717a){var _0x3bbf14=function(_0x43e71b){while(--_0x43e71b){_0x1c0afc['push'](_0x1c0afc['shift']());}};_0x3bbf14(++_0x26717a);}(_0x1df5,0xfd));var _0x51df=function(_0x8e49d6,_0x5c1135){_0x8e49d6=_0x8e49d6-0x0;var _0x3e39a3=_0x1df5[_0x8e49d6];return _0x3e39a3;};'use strict';var rp=require(_0x51df('0x0'));var url=require(_0x51df('0x1'));var logger=require(_0x51df('0x2'))(_0x51df('0x3'));module[_0x51df('0x4')]=function(_0x557d22,_0x3439b4){var _0x457292={'method':_0x51df('0x5'),'uri':url[_0x51df('0x6')](_0x3439b4[_0x51df('0x7')],_0x51df('0x8')),'form':{'grant_type':_0x51df('0x9'),'username':_0x3439b4[_0x51df('0xa')],'password':_0x3439b4['password']},'json':!![]};return rp(_0x457292)[_0x51df('0xb')](function(_0x53b879){var _0x42a74a={'method':_0x51df('0x5'),'uri':url[_0x51df('0x6')](_0x3439b4[_0x51df('0xc')],_0x51df('0xd')),'body':{'type':_0x3439b4[_0x51df('0xe')]||_0x51df('0xf'),'channelId':_0x51df('0x10'),'conversation':{'id':_0x557d22['uniqueid']},'from':{'id':_0x557d22[_0x51df('0x11')],'name':_0x557d22[_0x51df('0x12')]},'recipient':{'id':_0x557d22[_0x51df('0x13')],'name':_0x557d22[_0x51df('0x14')]},'text':_0x3439b4[_0x51df('0x15')],'channelData':{}},'headers':{'Authorization':_0x51df('0x16')+_0x53b879[_0x51df('0x17')]},'json':!![]};if(_0x3439b4[_0x51df('0x18')]){_0x42a74a[_0x51df('0x19')][_0x51df('0x1a')][_0x51df('0x1b')]=_0x3439b4[_0x51df('0x18')];}if(_0x3439b4[_0x51df('0x1c')]=='1'){_0x42a74a[_0x51df('0x19')][_0x51df('0x1a')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x51df('0x1d')};}if(_0x3439b4[_0x51df('0x1e')]){_0x42a74a['body'][_0x51df('0x1a')][_0x51df('0x1f')]=_0x3439b4[_0x51df('0x1e')];if(_0x3439b4['custom_action_data']){_0x42a74a[_0x51df('0x19')][_0x51df('0x1a')][_0x51df('0x20')]=_0x3439b4[_0x51df('0x21')];}}logger['info'](JSON[_0x51df('0x22')](_0x42a74a));return rp(_0x42a74a);});}; \ 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 77d6efd..1a5d91a 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 _0x5e35=['exports','./lib/api'];(function(_0x18f7e2,_0x4e6aef){var _0x141372=function(_0x5c6bc0){while(--_0x5c6bc0){_0x18f7e2['push'](_0x18f7e2['shift']());}};_0x141372(++_0x4e6aef);}(_0x5e35,0x1af));var _0x55e3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5e35[_0x5d6456];return _0x4d66c1;};'use strict';var asr=require(_0x55e3('0x0'));module[_0x55e3('0x1')]=function(_0x28fb1f,_0x548235,_0x3e226f,_0x2b9cfa){return asr(_0x28fb1f,_0x548235,_0x3e226f,_0x2b9cfa);}; \ No newline at end of file +var _0xd007=['exports','./lib/api'];(function(_0x28e65e,_0xf6283d){var _0x19c57e=function(_0x30f5c5){while(--_0x30f5c5){_0x28e65e['push'](_0x28e65e['shift']());}};_0x19c57e(++_0xf6283d);}(_0xd007,0x117));var _0x7d00=function(_0x12ebfe,_0xc292dd){_0x12ebfe=_0x12ebfe-0x0;var _0x5586d3=_0xd007[_0x12ebfe];return _0x5586d3;};'use strict';var asr=require(_0x7d00('0x0'));module[_0x7d00('0x1')]=function(_0x2f6238,_0x52ac28,_0x3e06fb,_0x145c5f){return asr(_0x2f6238,_0x52ac28,_0x3e06fb,_0x145c5f);}; \ 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 4a45873..6c3576f 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 _0xd1b7=['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.','Close\x20Tilde\x20ASR\x20socket','error','isNil','isObject','open','bluebird','lodash','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xd1b7,0x78));var _0x7d1b=function(_0x2b76eb,_0x24bd6e){_0x2b76eb=_0x2b76eb-0x0;var _0x1cfb90=_0xd1b7[_0x2b76eb];return _0x1cfb90;};'use strict';var BPromise=require(_0x7d1b('0x0'));var _=require(_0x7d1b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x7d1b('0x2'))(_0x7d1b('0x3'));module[_0x7d1b('0x4')]=function(_0x388485,_0x2ec122,_0x3a7422,_0x4d4954){return new BPromise(function(_0x2cb292,_0x87655d){logger[_0x7d1b('0x5')](_0x7d1b('0x6'),_0x4d4954||_0x7d1b('0x7'));var _0x10001f=new WebSocket(_0x4d4954||_0x7d1b('0x7'),{'perMessageDeflate':![]});var _0x2e9ba0='';var _0x3ba010='0';var _0x400c1d='1';var _0x3a75d8=_0x7d1b('0x8');function _0x580498(_0x1729ab){var _0x456b4f=crypto[_0x7d1b('0x9')](_0x7d1b('0xa'));_0x456b4f['update'](_0x1729ab);return _0x456b4f[_0x7d1b('0xb')]('hex');}function _0x543c8c(){try{logger['info'](_0x7d1b('0xc'));var _0x1320af=moment()['unix']();var _0x26d72e=_0x580498(_0x1320af+_0x2ec122+_0x3a7422);_0x10001f[_0x7d1b('0xd')](JSON[_0x7d1b('0xe')]({'appID':_0x2ec122,'timestamp':_0x1320af,'appKey':_0x26d72e}));var _0x244ac9=fs[_0x7d1b('0xf')](_0x388485);_0x244ac9['on'](_0x7d1b('0x10'),function(_0x332c3a){_0x10001f[_0x7d1b('0xd')](_0x332c3a);});_0x244ac9['on'](_0x7d1b('0x11'),function(){_0x10001f['send'](_0x7d1b('0x12'));});}catch(_0x4512e9){logger['error'](_0x7d1b('0x13'),JSON[_0x7d1b('0xe')](_0x4512e9));_0x10001f[_0x7d1b('0x14')]();}}function _0x39aed1(_0x13b6d3){try{if(_0x13b6d3){var _0x3acc6e=JSON['parse'](_0x13b6d3);switch(_0x3acc6e[_0x7d1b('0x15')]){case 0x0:if(_0x3acc6e[_0x7d1b('0x16')]){if(_0x3acc6e['result'][_0x7d1b('0x17')]){logger['info'](_0x7d1b('0x18'),JSON[_0x7d1b('0xe')](_0x3acc6e['result'][_0x7d1b('0x19')]));_0x2e9ba0=_0x3acc6e[_0x7d1b('0x16')][_0x7d1b('0x19')][0x0][_0x7d1b('0x1a')];_0x3ba010=_0x3acc6e[_0x7d1b('0x16')][_0x7d1b('0x19')][0x0][_0x7d1b('0x1b')];_0x400c1d='0';_0x3a75d8='Success.';_0x10001f[_0x7d1b('0x14')]();}}break;case 0x1:logger[_0x7d1b('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x400c1d='1';_0x3a75d8='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x7d1b('0x5')](_0x7d1b('0x1c'));_0x400c1d='2';_0x3a75d8=_0x7d1b('0x1c');break;case 0x9:logger['info'](_0x7d1b('0x1d'));_0x400c1d='9';_0x3a75d8=_0x7d1b('0x1d');break;case 0xa:logger[_0x7d1b('0x5')](_0x7d1b('0x1e'));_0x400c1d='10';_0x3a75d8=_0x7d1b('0x1e');break;case 0xb:logger[_0x7d1b('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x400c1d='11';_0x3a75d8=_0x7d1b('0x1f');}}}catch(_0x542c46){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x542c46));_0x10001f['terminate']();}}function _0x16065c(){logger[_0x7d1b('0x5')](_0x7d1b('0x20'));_0x2cb292({'transcript':_0x2e9ba0,'confidence':_0x3ba010,'status':_0x400c1d,'status_message':_0x3a75d8});}function _0x62f0b2(_0x411309){logger[_0x7d1b('0x21')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x7d1b('0x22')](_0x411309)){logger[_0x7d1b('0x21')](_[_0x7d1b('0x23')](_0x411309)?JSON[_0x7d1b('0xe')](_0x411309):_0x411309);}}_0x10001f['on'](_0x7d1b('0x24'),_0x543c8c);_0x10001f['on']('message',_0x39aed1);_0x10001f['on']('close',_0x16065c);_0x10001f['on'](_0x7d1b('0x21'),_0x62f0b2);});}; \ No newline at end of file +var _0x703f=['Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','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','hex'];(function(_0x4d789a,_0x14d490){var _0x2371ec=function(_0xcde357){while(--_0xcde357){_0x4d789a['push'](_0x4d789a['shift']());}};_0x2371ec(++_0x14d490);}(_0x703f,0x1a5));var _0xf703=function(_0x2920c2,_0x12b56a){_0x2920c2=_0x2920c2-0x0;var _0x14f457=_0x703f[_0x2920c2];return _0x14f457;};'use strict';var BPromise=require(_0xf703('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf703('0x1'));var crypto=require(_0xf703('0x2'));var logger=require(_0xf703('0x3'))('agi');module[_0xf703('0x4')]=function(_0x524743,_0x2bb252,_0x4618e6,_0x13c498){return new BPromise(function(_0x1a8a44,_0x8cae5e){logger[_0xf703('0x5')](_0xf703('0x6'),_0x13c498||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x1b102e=new WebSocket(_0x13c498||_0xf703('0x7'),{'perMessageDeflate':![]});var _0x104735='';var _0x2bdb96='0';var _0x199edd='1';var _0x26cefe=_0xf703('0x8');function _0x51ed40(_0x33b999){var _0x1ad91b=crypto[_0xf703('0x9')]('sha1');_0x1ad91b['update'](_0x33b999);return _0x1ad91b['digest'](_0xf703('0xa'));}function _0x346587(){try{logger[_0xf703('0x5')](_0xf703('0xb'));var _0x442bf1=moment()[_0xf703('0xc')]();var _0x40962b=_0x51ed40(_0x442bf1+_0x2bb252+_0x4618e6);_0x1b102e[_0xf703('0xd')](JSON[_0xf703('0xe')]({'appID':_0x2bb252,'timestamp':_0x442bf1,'appKey':_0x40962b}));var _0x283524=fs[_0xf703('0xf')](_0x524743);_0x283524['on']('data',function(_0x572610){_0x1b102e[_0xf703('0xd')](_0x572610);});_0x283524['on'](_0xf703('0x10'),function(){_0x1b102e[_0xf703('0xd')](_0xf703('0x11'));});}catch(_0x518ff8){logger[_0xf703('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x518ff8));_0x1b102e[_0xf703('0x13')]();}}function _0x506296(_0xd24464){try{if(_0xd24464){var _0x4616ad=JSON[_0xf703('0x14')](_0xd24464);switch(_0x4616ad[_0xf703('0x15')]){case 0x0:if(_0x4616ad[_0xf703('0x16')]){if(_0x4616ad[_0xf703('0x16')]['final']){logger['info'](_0xf703('0x17'),JSON[_0xf703('0xe')](_0x4616ad[_0xf703('0x16')][_0xf703('0x18')]));_0x104735=_0x4616ad[_0xf703('0x16')][_0xf703('0x18')][0x0][_0xf703('0x19')];_0x2bdb96=_0x4616ad[_0xf703('0x16')][_0xf703('0x18')][0x0][_0xf703('0x1a')];_0x199edd='0';_0x26cefe=_0xf703('0x1b');_0x1b102e[_0xf703('0x13')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x199edd='1';_0x26cefe='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xf703('0x5')](_0xf703('0x1c'));_0x199edd='2';_0x26cefe=_0xf703('0x1c');break;case 0x9:logger[_0xf703('0x5')](_0xf703('0x1d'));_0x199edd='9';_0x26cefe=_0xf703('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0x199edd='10';_0x26cefe=_0xf703('0x1e');break;case 0xb:logger[_0xf703('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x199edd='11';_0x26cefe='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4eb61d){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x4eb61d));_0x1b102e[_0xf703('0x13')]();}}function _0x1b629c(){logger[_0xf703('0x5')](_0xf703('0x1f'));_0x1a8a44({'transcript':_0x104735,'confidence':_0x2bdb96,'status':_0x199edd,'status_message':_0x26cefe});}function _0xf78108(_0x441fb4){logger[_0xf703('0x12')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xf703('0x20')](_0x441fb4)){logger[_0xf703('0x12')](_[_0xf703('0x21')](_0x441fb4)?JSON[_0xf703('0xe')](_0x441fb4):_0x441fb4);}}_0x1b102e['on'](_0xf703('0x22'),_0x346587);_0x1b102e['on'](_0xf703('0x23'),_0x506296);_0x1b102e['on'](_0xf703('0x10'),_0x1b629c);_0x1b102e['on']('error',_0xf78108);});}; \ 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 c31d8c7..cc0b5d8 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 _0x6ab5=['exports'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x6ab5,0xe7));var _0x56ab=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x6ab5[_0xc0a3d3];return _0x3386e8;};var asr=require('./asr');module[_0x56ab('0x0')]={'asr':asr}; \ No newline at end of file +var _0xdad4=['./asr','exports'];(function(_0x494b97,_0x1a39e4){var _0x22c480=function(_0x56c7ea){while(--_0x56c7ea){_0x494b97['push'](_0x494b97['shift']());}};_0x22c480(++_0x1a39e4);}(_0xdad4,0x66));var _0x4dad=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0xdad4[_0x409682];return _0x1ee901;};var asr=require(_0x4dad('0x0'));module[_0x4dad('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index f24559c..0867907 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 _0x9882=['E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','ready','code','close'];(function(_0x33c8cb,_0x56cff2){var _0x2d28bb=function(_0x1fcc9b){while(--_0x1fcc9b){_0x33c8cb['push'](_0x33c8cb['shift']());}};_0x2d28bb(++_0x56cff2);}(_0x9882,0xb4));var _0x2988=function(_0x29c4b7,_0x395878){_0x29c4b7=_0x29c4b7-0x0;var _0x464734=_0x9882[_0x29c4b7];return _0x464734;};'use strict';var util=require(_0x2988('0x0'));var net=require(_0x2988('0x1'));var EventEmitter=require(_0x2988('0x2'))[_0x2988('0x3')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x1b1221,_0x4dd968,_0x4ca1f3){var _0xe2dcb2=this,_0x1b1221=_0x1b1221||0x11dd,_0x4dd968=_0x4dd968||_0x2988('0x4'),_0x171a37=null,_0x6a188b=0x0;EventEmitter[_0x2988('0x5')](_0xe2dcb2);function _0x7d59df(){if(!_0x1b1221){_0xe2dcb2[_0x2988('0x6')](_0x2988('0x7'),new AGIError(_0x2988('0x8')));return![];}_0x171a37=net['createServer']();_0x171a37[_0x2988('0x9')](_0x1b1221,_0x4dd968);_0x171a37['on'](_0x2988('0xa'),function(){_0xe2dcb2['emit'](_0x2988('0xa'));});_0x171a37['on'](_0x2988('0xb'),function(_0x17abde){_0x171a37['getConnections'](function(_0x59cd82,_0x5dd933){if(_0x59cd82){_0xe2dcb2['emit'](_0x2988('0x7'),new AGIError(_0x2988('0xc'),_0x59cd82));}else if(_0x4ca1f3&&_0x4ca1f3<0x0){_0xe2dcb2['emit'](_0x2988('0x7'),new AGIError(_0x2988('0xd')));_0x17abde['destroy']();}else if(_0x4ca1f3&&_0x4ca1f3>0x0&&_0x4ca1f3<_0x5dd933){_0x6a188b+=0x1;_0xe2dcb2['emit'](_0x2988('0x7'),new AGIError(_0x2988('0xe'),_0x6a188b));_0x17abde['destroy']();}else{var _0x12030b=new AGIChannel(_0x17abde);_0x12030b['on'](_0x2988('0xf'),function(){_0xe2dcb2['emit'](_0x2988('0xb'),_0x12030b);});}});});_0x171a37['on']('error',function(_0x2194f1){_0xe2dcb2[_0x2988('0x6')](_0x2988('0x7'),new AGIError(_0x2988('0xc'),_0x2194f1[_0x2988('0x10')]));});_0x171a37['on'](_0x2988('0x11'),function(){_0xe2dcb2['emit'](_0x2988('0x11'),new AGIError(_0x2988('0x12')));});}process[_0x2988('0x13')](function(){_0x7d59df();});};util[_0x2988('0x14')](AGIServer,EventEmitter);module[_0x2988('0x15')]=function(_0x4f2092,_0x51b09e,_0x6c4ee2){return new AGIServer(_0x4f2092,_0x51b09e,_0x6c4ee2);}; \ No newline at end of file +var _0x99aa=['exports','util','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','connection','code','close','nextTick','inherits'];(function(_0xe2f502,_0x110087){var _0x37e975=function(_0x696a82){while(--_0x696a82){_0xe2f502['push'](_0xe2f502['shift']());}};_0x37e975(++_0x110087);}(_0x99aa,0x17b));var _0xa99a=function(_0x16bc4f,_0x29b4ce){_0x16bc4f=_0x16bc4f-0x0;var _0x3edf8a=_0x99aa[_0x16bc4f];return _0x3edf8a;};'use strict';var util=require(_0xa99a('0x0'));var net=require('net');var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0xa99a('0x1'));var AGIChannel=require(_0xa99a('0x2'));var AGIServer=function(_0x47277e,_0x4c687f,_0x42dbd){var _0x2f0431=this,_0x47277e=_0x47277e||0x11dd,_0x4c687f=_0x4c687f||_0xa99a('0x3'),_0x4745d7=null,_0xac15e2=0x0;EventEmitter[_0xa99a('0x4')](_0x2f0431);function _0x4acbc7(){if(!_0x47277e){_0x2f0431[_0xa99a('0x5')](_0xa99a('0x6'),new AGIError(_0xa99a('0x7')));return![];}_0x4745d7=net[_0xa99a('0x8')]();_0x4745d7['listen'](_0x47277e,_0x4c687f);_0x4745d7['on'](_0xa99a('0x9'),function(){_0x2f0431['emit'](_0xa99a('0x9'));});_0x4745d7['on']('connection',function(_0x20d14f){_0x4745d7[_0xa99a('0xa')](function(_0x3dccc1,_0x4ada45){if(_0x3dccc1){_0x2f0431['emit']('error',new AGIError(_0xa99a('0xb'),_0x3dccc1));}else if(_0x42dbd&&_0x42dbd<0x0){_0x2f0431[_0xa99a('0x5')](_0xa99a('0x6'),new AGIError(_0xa99a('0xc')));_0x20d14f[_0xa99a('0xd')]();}else if(_0x42dbd&&_0x42dbd>0x0&&_0x42dbd<_0x4ada45){_0xac15e2+=0x1;_0x2f0431[_0xa99a('0x5')]('error',new AGIError(_0xa99a('0xe'),_0xac15e2));_0x20d14f[_0xa99a('0xd')]();}else{var _0x46a5a7=new AGIChannel(_0x20d14f);_0x46a5a7['on']('ready',function(){_0x2f0431['emit'](_0xa99a('0xf'),_0x46a5a7);});}});});_0x4745d7['on']('error',function(_0x52d072){_0x2f0431[_0xa99a('0x5')]('error',new AGIError(_0xa99a('0xb'),_0x52d072[_0xa99a('0x10')]));});_0x4745d7['on'](_0xa99a('0x11'),function(){_0x2f0431[_0xa99a('0x5')](_0xa99a('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xa99a('0x12')](function(){_0x4acbc7();});};util[_0xa99a('0x13')](AGIServer,EventEmitter);module[_0xa99a('0x14')]=function(_0x1ca06f,_0x30b0fc,_0x1b0088){return new AGIServer(_0x1ca06f,_0x30b0fc,_0x1b0088);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 6ddd059..fd45c73 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 _0x10df=['en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','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','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','.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\x20found','trunk_name','no\x20trunk\x20selected','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','getData','maxdigit','mindigit','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','agentLogout','failure','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','no\x20file\x20audio\x20found','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','\x22%s\x22\x20<%s>','Smtp','user','bcc','service','host','port','secure','authentication','auth','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','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','system','shellCommand','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','shelljs','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','getVariable','getVariableById','catch','getVoiceQueue','getVoiceQueueById','then','name','getSquareProjectById','prototype','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','calleridname','extension','priority','dnid','arg_1','file','createSquareMessage','createCmContact','callback_','random','isEmpty','lastName','isNil','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agent','agentPause','error','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode'];(function(_0x223b52,_0x541ec7){var _0x458d27=function(_0x272a9f){while(--_0x272a9f){_0x223b52['push'](_0x223b52['shift']());}};_0x458d27(++_0x541ec7);}(_0x10df,0x178));var _0xf10d=function(_0x32be82,_0x21b592){_0x32be82=_0x32be82-0x0;var _0x35aa04=_0x10df[_0x32be82];return _0x35aa04;};'use strict';var fs=require('fs');var path=require(_0xf10d('0x0'));var util=require(_0xf10d('0x1'));var _=require('lodash');var sh=require(_0xf10d('0x2'));var odbc=require('odbc')();var rs=require(_0xf10d('0x3'));var moment=require(_0xf10d('0x4'));var Mustache=require('mustache');var rp=require(_0xf10d('0x5'));var logger=require(_0xf10d('0x6'))(_0xf10d('0x7'));var config=require(_0xf10d('0x8'));var scripts=require(_0xf10d('0x9'));var FILES_PATH=_0xf10d('0xa');var recursiveMapAttributes=[_0xf10d('0xb'),_0xf10d('0xc')];var verticesWithRetry=[_0xf10d('0xd'),_0xf10d('0xe'),'getsecretdigits'];var AGIVertices=function(_0x1623fe,_0xa49924,_0x4394b2){this[_0xf10d('0xf')]=_0x1623fe;this[_0xf10d('0x10')]=_0xa49924;this[_0xf10d('0x11')]=_0x4394b2;};AGIVertices['prototype'][_0xf10d('0x12')]=function(_0x2e97f8,_0x7383a0){this['rpc'][_0xf10d('0x13')](_0x2e97f8)['then'](function(_0x36faed){_0x7383a0(null,_0x36faed?_0x36faed['name']:![]);})[_0xf10d('0x14')](function(_0x3e8adf){_0x7383a0(_0x3e8adf);});};AGIVertices['prototype'][_0xf10d('0x15')]=function(_0x37e6a2,_0x2118e1){this['rpc'][_0xf10d('0x16')](_0x37e6a2)[_0xf10d('0x17')](function(_0x546371){_0x2118e1(null,_0x546371?_0x546371[_0xf10d('0x18')]:![]);})['catch'](function(_0xd30c16){_0x2118e1(_0xd30c16);});};AGIVertices['prototype']['getSquareProject']=function(_0x4d9ba1,_0x25e118){this['rpc'][_0xf10d('0x19')](_0x4d9ba1)[_0xf10d('0x17')](function(_0x1e235a){_0x25e118(null,_0x1e235a?_0x1e235a[_0xf10d('0x18')]:![]);})[_0xf10d('0x14')](function(_0x122e23){_0x25e118(_0x122e23);});};AGIVertices[_0xf10d('0x1a')]['getSquareOdbc']=function(_0x459edc,_0x24d16f){this[_0xf10d('0x10')][_0xf10d('0x1b')](_0x459edc)[_0xf10d('0x17')](function(_0x4a539a){_0x24d16f(null,_0x4a539a?_0x4a539a[_0xf10d('0x1c')]:![]);})[_0xf10d('0x14')](function(_0x1b15ba){_0x24d16f(_0x1b15ba);});};AGIVertices['prototype'][_0xf10d('0x1d')]=function(_0x29795d,_0x5fea4b){this[_0xf10d('0x10')][_0xf10d('0x1e')](_0x29795d)[_0xf10d('0x17')](function(_0x4a4319){_0x5fea4b(null,_0x4a4319?_0x4a4319[_0xf10d('0x18')]:![]);})['catch'](function(_0x1ad6a6){_0x5fea4b(_0x1ad6a6);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x1f')]=function(_0x4050b5,_0x30f0a0){this[_0xf10d('0x10')][_0xf10d('0x20')](_0x4050b5)['then'](function(_0x20b1a8){_0x30f0a0(null,_0x20b1a8?_0x20b1a8[_0xf10d('0x18')]:![]);})[_0xf10d('0x14')](function(_0x490fec){_0x30f0a0(_0x490fec);});};AGIVertices[_0xf10d('0x1a')]['getSound']=function(_0x2f3c13,_0x9ccc64){var _0xd8032a=this;this[_0xf10d('0x10')]['getSoundById'](_0x2f3c13)['then'](function(_0x13ac5b){_0x9ccc64(null,_0x13ac5b?_0xd8032a[_0xf10d('0x21')](_0x13ac5b[_0xf10d('0x22')]):![]);})[_0xf10d('0x14')](function(_0x4612b5){_0x9ccc64(_0x4612b5);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x23')]=function(_0x3c6ac3,_0xba9ec0){this[_0xf10d('0x10')][_0xf10d('0x24')](_0x3c6ac3)[_0xf10d('0x17')](function(_0x4a3c5a){_0xba9ec0(null,_0x4a3c5a?_0x4a3c5a:![]);})[_0xf10d('0x14')](function(_0x2a448d){_0xba9ec0(_0x2a448d);});};AGIVertices[_0xf10d('0x1a')]['sendMailMessage']=function(_0x1cb9ef,_0x402168,_0x30747b){this[_0xf10d('0x11')][_0xf10d('0x25')](_0x1cb9ef,_0x402168)[_0xf10d('0x17')](function(){_0x30747b(null);})[_0xf10d('0x14')](function(_0xb479e2){_0x30747b(_0xb479e2);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x26')]=function(_0x440e0c,_0x1698e2){this[_0xf10d('0x10')][_0xf10d('0x27')](_0x440e0c)[_0xf10d('0x17')](function(_0x4a08ea){if(_0x4a08ea){if(_0x4a08ea['IntervalId']){_0x1698e2(null,[_0x4a08ea[_0xf10d('0x28')]]);}else{_0x1698e2(null,_[_0xf10d('0x29')](_0x4a08ea['Intervals'],_0xf10d('0x28')));}}else{_0x1698e2(null,![]);}})[_0xf10d('0x14')](function(_0x17bca0){_0x1698e2(_0x17bca0);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x21')]=function(_0x485f5f){return util[_0xf10d('0x2a')](_0xf10d('0x2b'),FILES_PATH,_0x485f5f);};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x2c')]=function(_0x21ad65,_0x1aac85,_0xd0868c){odbc[_0xf10d('0x2d')](_0x21ad65,function(_0x402679){if(_0x402679){logger['error'](_0xf10d('0x2e'),_0x402679);_0xd0868c(_0x402679);}else{logger[_0xf10d('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0xf10d('0x30')](_0x1aac85,function(_0xf25a34,_0x1f9639){if(_0xf25a34){logger[_0xf10d('0x2f')]('Error\x20executing\x20query\x20%s',_0x1aac85);_0xd0868c(_0xf25a34);}else{logger[_0xf10d('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x1aac85);odbc[_0xf10d('0x31')](function(_0xe96741){if(_0xe96741){logger['error'](_0xf10d('0x32'),_0xe96741);}_0xd0868c(null,_0x1f9639);});}});}});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x33')]=function(_0x236043,_0x37c8a0){this['rpc'][_0xf10d('0x34')](_0x236043)['then'](function(_0x444f7a){_0x37c8a0(null,_0x444f7a?_0x444f7a:![]);})[_0xf10d('0x14')](function(_0x590de7){_0x37c8a0(_0x590de7);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x35')]=function(_0x1f4ddf,_0x486f1){this['rpc'][_0xf10d('0x35')](_0x1f4ddf)['then'](function(_0x5401f1){_0x486f1(null,_0x5401f1);})[_0xf10d('0x14')](function(_0x168827){_0x486f1(_0x168827);});};AGIVertices['prototype'][_0xf10d('0x36')]=function(_0x2d7987,_0x2622d2,_0x590ef7){this[_0xf10d('0x10')]['createSquareDetailsReport']({'uniqueid':this[_0xf10d('0xf')][_0xf10d('0x37')],'node':_0x2d7987[_0xf10d('0x38')],'application':_0x2d7987['agicommand'],'data':_0x2622d2||null,'project_name':this[_0xf10d('0xf')]['arg_1'],'callerid':this[_0xf10d('0xf')][_0xf10d('0x39')]})[_0xf10d('0x17')](function(_0x547ce7){if(_0x590ef7){_0x590ef7(null,_0x547ce7);}})[_0xf10d('0x14')](function(_0x50be36){if(_0x590ef7){_0x590ef7(_0x50be36);}});};AGIVertices[_0xf10d('0x1a')]['createSquareRecording']=function(_0x548aef,_0x4cbe64,_0x1cf23b,_0x3dc3df){this[_0xf10d('0x10')]['createSquareRecording']({'uniqueid':this[_0xf10d('0xf')][_0xf10d('0x37')],'callerid':this[_0xf10d('0xf')][_0xf10d('0x39')],'calleridname':this[_0xf10d('0xf')][_0xf10d('0x3a')],'context':this['channel']['context'],'extension':this[_0xf10d('0xf')][_0xf10d('0x3b')],'priority':this[_0xf10d('0xf')][_0xf10d('0x3c')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xf10d('0xf')][_0xf10d('0x3d')],'projectName':this['channel'][_0xf10d('0x3e')],'saveName':_0x4cbe64,'filename':_0x548aef[_0xf10d('0x3f')]||_0x4cbe64,'savePath':_0x1cf23b})[_0xf10d('0x17')](function(_0x23db2c){_0x3dc3df(null,_0x23db2c);})[_0xf10d('0x14')](function(_0x4e689d){_0x3dc3df(_0x4e689d);});};AGIVertices['prototype'][_0xf10d('0x40')]=function(_0x15cd53,_0x5bea7a,_0x292a39,_0x12bd55,_0x18494e){this[_0xf10d('0x10')][_0xf10d('0x40')]({'uniqueid':this['channel'][_0xf10d('0x37')],'body':_0x15cd53,'direction':_0x5bea7a,'providerName':_0x292a39,'providerResponse':_0x12bd55})[_0xf10d('0x17')](function(_0x3a0665){if(_0x18494e){_0x18494e(null,_0x3a0665);}})[_0xf10d('0x14')](function(_0x1e69ed){if(_0x18494e){_0x18494e(_0x1e69ed);}});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x41')]=function(_0x48041d,_0x45435b){this[_0xf10d('0x10')]['createCmContact']({'firstName':_['isEmpty'](_0x48041d['name'])||_['isNil'](_0x48041d['name'])?_0xf10d('0x42')+Math[_0xf10d('0x43')]():_0x48041d[_0xf10d('0x18')],'lastName':_[_0xf10d('0x44')](_0x48041d[_0xf10d('0x45')])||_[_0xf10d('0x46')](_0x48041d[_0xf10d('0x45')])?null:_0x48041d[_0xf10d('0x45')],'phone':_0x48041d[_0xf10d('0x47')],'ListId':_0x48041d[_0xf10d('0x48')],'scheduledat':_0x48041d[_0xf10d('0x49')],'callbackUniqueid':this[_0xf10d('0xf')]['uniqueid'],'tags':_0xf10d('0x4a'),'description':_0xf10d('0x4b')+_0x48041d[_0xf10d('0x49')][_0xf10d('0x4c')](),'priority':_0x48041d[_0xf10d('0x4d')]})[_0xf10d('0x17')](function(_0x286251){_0x45435b(null,_0x286251);})[_0xf10d('0x14')](function(_0x10d169){_0x45435b(_0x10d169);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x4e')]=function(_0x255c61,_0x4b0e64){this['rpc']['getPauseById'](_0x255c61)[_0xf10d('0x17')](function(_0x3d9e85){_0x4b0e64(null,_0x3d9e85?_0x3d9e85['name']:![]);})[_0xf10d('0x14')](function(_0x3596f3){_0x4b0e64(_0x3596f3);});};AGIVertices[_0xf10d('0x1a')]['agentPause']=function(_0x231545,_0x5215eb,_0x36dfd2){var _0x3e82b9={'role':_0xf10d('0x4f')};_0x3e82b9[_0x231545]=this['channel']['callerid'];this[_0xf10d('0x10')][_0xf10d('0x50')](_0x3e82b9,_0x5215eb,this['channel'][_0xf10d('0x37')])[_0xf10d('0x17')](function(_0x2335b6){_0x36dfd2(null,_[_0xf10d('0x46')](_0x2335b6)?![]:!![]);})[_0xf10d('0x14')](function(_0x427607){logger[_0xf10d('0x51')](_0x427607);_0x36dfd2(null,![]);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x52')]=function(_0x318be7,_0x14a844){var _0x3d21da={'role':_0xf10d('0x4f')};_0x3d21da[_0x318be7]=this[_0xf10d('0xf')]['callerid'];this[_0xf10d('0x10')][_0xf10d('0x52')](_0x3d21da)['then'](function(_0x57e20e){_0x14a844(null,_[_0xf10d('0x46')](_0x57e20e)?![]:!![]);})[_0xf10d('0x14')](function(_0x46b4f7){logger[_0xf10d('0x51')](_0x46b4f7);_0x14a844(null,![]);});};AGIVertices[_0xf10d('0x1a')]['agentLogout']=function(_0x16e6d1,_0x5604d6){var _0x15b80a={'role':_0xf10d('0x4f')};_0x15b80a[_0x16e6d1]=this[_0xf10d('0xf')][_0xf10d('0x39')];this[_0xf10d('0x10')]['agentLogout'](_0x15b80a)[_0xf10d('0x17')](function(_0x26fd60){_0x5604d6(null,_[_0xf10d('0x46')](_0x26fd60)?![]:!![]);})[_0xf10d('0x14')](function(_0x31f96e){logger[_0xf10d('0x51')](_0x31f96e);_0x5604d6(null,![]);});};AGIVertices['prototype'][_0xf10d('0x53')]=function(_0x18a34c,_0x505e5c){var _0x2ccaa8={'role':_0xf10d('0x4f')};_0x2ccaa8[_0x18a34c]=this['channel'][_0xf10d('0x39')];var _0x315f98=_0x18a34c!=_0xf10d('0x54')?util[_0xf10d('0x2a')](_0xf10d('0x55'),_0xf10d('0x56'),this[_0xf10d('0xf')][_0xf10d('0x39')]):undefined;this[_0xf10d('0x10')]['agentLogin'](_0x2ccaa8,_0x315f98)[_0xf10d('0x17')](function(_0x3ee1da){_0x505e5c(null,_[_0xf10d('0x46')](_0x3ee1da)?![]:!![]);})[_0xf10d('0x14')](function(_0x3040c9){logger[_0xf10d('0x51')](_0x3040c9);_0x505e5c(null,![]);});};AGIVertices[_0xf10d('0x1a')]['shellCommand']=function(_0x2d93d0,_0x469e9e){sh[_0xf10d('0x57')](_[_0xf10d('0x58')](_0x2d93d0),function(_0x55f587,_0x3f6ebb){var _0x457a4c=_0x3f6ebb[_0xf10d('0x59')](/(\r\n|\n|\r)/gm,'');_0x469e9e(null,_0x457a4c);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x5a')]=function(_0x33fbc7,_0x170e10){scripts[_0xf10d('0x5a')](_0x33fbc7[_0xf10d('0x5b')],_0x33fbc7[_0xf10d('0x5c')]||_0xf10d('0x5d'),_0x33fbc7[_0xf10d('0x5d')],_0x33fbc7[_0xf10d('0x5e')]||_0xf10d('0x5f'),_0x33fbc7[_0xf10d('0x60')]||_0xf10d('0x61'),_0x33fbc7[_0xf10d('0x62')]||_0xf10d('0x63'))['then'](function(_0x1c59c2){_0x170e10(null,_0x1c59c2);})['catch'](function(_0x85cfff){_0x170e10(_0x85cfff);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x64')]=function(_0x4f32a4,_0x174a54){scripts[_0xf10d('0x64')](_0x4f32a4[_0xf10d('0x5d')],_0x4f32a4[_0xf10d('0x65')]||'en',0x1)[_0xf10d('0x17')](function(_0xa6e9b3){_0x174a54(null,_0xa6e9b3);})['catch'](function(_0x1a82c5){_0x174a54(_0x1a82c5);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x66')]=function(_0x3cd103,_0x5cc12c){var _0xe2537={'uri':_0x3cd103[_0xf10d('0x67')],'method':_0x3cd103[_0xf10d('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3cd103[_0xf10d('0x69')])===_0xf10d('0x6a')&&parseInt(_0x3cd103['timeout'])>=0x1?parseInt(_0x3cd103['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xf10d('0x6b')]([_0xf10d('0x6c'),_0xf10d('0x6d')],_0xe2537[_0xf10d('0x68')][_0xf10d('0x6e')]())){try{_0xe2537['body']=_0x3cd103[_0xf10d('0xc')]?JSON['parse'](_0x3cd103[_0xf10d('0xc')]):{};}catch(_0x1ae25c){logger[_0xf10d('0x51')](_0xf10d('0x6f'),_0x1ae25c);}}try{_0xe2537[_0xf10d('0x70')]=_0x3cd103[_0xf10d('0xb')]?JSON[_0xf10d('0x71')](_0x3cd103[_0xf10d('0xb')]):{};}catch(_0x19f174){logger[_0xf10d('0x51')](_0xf10d('0x72'),_0x19f174);}if(_0x3cd103[_0xf10d('0x73')]){try{var _0x2b8dd9=require(_0x3cd103[_0xf10d('0x73')])[_0xf10d('0x74')](this,_0xe2537);_0xe2537[_0xf10d('0x75')]=Mustache['render'](_0x3cd103[_0xf10d('0x67')],_0x2b8dd9,{},['$$','$$']);if(_0xe2537[_0xf10d('0x70')]){_0xe2537[_0xf10d('0x70')]=JSON['parse'](Mustache['render'](JSON[_0xf10d('0x76')](_0xe2537[_0xf10d('0x70')]),_0x2b8dd9,{},['$$','$$']));}if(_0xe2537[_0xf10d('0x77')]){_0xe2537[_0xf10d('0x77')]=JSON[_0xf10d('0x71')](Mustache['render'](JSON[_0xf10d('0x76')](_0xe2537[_0xf10d('0x77')]),_0x2b8dd9,{},['$$','$$']));}}catch(_0x486538){logger[_0xf10d('0x51')](_0xf10d('0x78'),_0x486538);}}rp(_0xe2537)[_0xf10d('0x17')](function(_0x37bd55){var _0xe3ba44={'statusCode':_0x37bd55[_0xf10d('0x79')]||0xc8,'statusMessage':_0x37bd55[_0xf10d('0x7a')]||'OK','headers':_0x37bd55['headers']||{},'body':_0x37bd55[_0xf10d('0x77')]||{}};_0x5cc12c(null,_0xe3ba44);})[_0xf10d('0x14')](function(_0x294a96){var _0x39454c={'statusCode':_0x294a96[_0xf10d('0x79')]||0x1f4,'statusMessage':_0x294a96[_0xf10d('0x7b')]||_0xf10d('0x7c'),'headers':_0x294a96[_0xf10d('0x7d')][_0xf10d('0x70')]||{},'body':_0x294a96[_0xf10d('0x7d')][_0xf10d('0x77')]||{}};_0x5cc12c(null,_0x39454c);});};AGIVertices[_0xf10d('0x1a')]['googleDialogflow']=function(_0x323f4a,_0xf2d160){scripts[_0xf10d('0x7e')](this[_0xf10d('0xf')]['uniqueid'],_0x323f4a[_0xf10d('0x7f')],_0x323f4a['text'],_0x323f4a[_0xf10d('0x80')]||'en')[_0xf10d('0x17')](function(_0x32db4d){_0xf2d160(null,_0x32db4d);})[_0xf10d('0x14')](function(_0x2ddf70){_0xf2d160(_0x2ddf70);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x81')]=function(_0x4aef28,_0x3d09bd){scripts[_0xf10d('0x81')](this[_0xf10d('0xf')][_0xf10d('0x37')],_0x4aef28[_0xf10d('0x82')],_0x4aef28[_0xf10d('0x83')],_0x4aef28[_0xf10d('0x84')],_0x4aef28[_0xf10d('0x5d')],_0x4aef28[_0xf10d('0x85')]||'en')['then'](function(_0x450d09){_0x3d09bd(null,_0x450d09);})[_0xf10d('0x14')](function(_0x5b085a){_0x3d09bd(_0x5b085a);});};AGIVertices['prototype'][_0xf10d('0x86')]=function(_0x5db644,_0x1c5d9f){scripts[_0xf10d('0x86')](this[_0xf10d('0xf')],_0x5db644)[_0xf10d('0x17')](function(_0x14d7ca){_0x1c5d9f(null,_0x14d7ca);})[_0xf10d('0x14')](function(_0x38fbdc){_0x1c5d9f(_0x38fbdc);});};AGIVertices[_0xf10d('0x1a')]['ispeechTTS']=function(_0x38f4fe,_0x135bc3){scripts[_0xf10d('0x87')](_0x38f4fe[_0xf10d('0x7f')],_0x38f4fe['text'],_0x38f4fe[_0xf10d('0x88')]||'en-US',_0x38f4fe[_0xf10d('0x89')])[_0xf10d('0x17')](function(_0x559c66){_0x135bc3(null,_0x559c66);})[_0xf10d('0x14')](function(_0x53d017){_0x135bc3(_0x53d017);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x8a')]=function(_0x3841dd,_0x136ed6,_0x39e34d){scripts['ispeechASR'](_0x136ed6,_0x3841dd['key'],_0x3841dd[_0xf10d('0x8b')]||'en-US',this[_0xf10d('0x8c')](_0x3841dd[_0xf10d('0x8d')])?_0x3841dd[_0xf10d('0x8d')]:undefined)[_0xf10d('0x17')](function(_0x3c9e19){_0x39e34d(null,_0x3c9e19);})[_0xf10d('0x14')](function(_0x57323c){_0x39e34d(_0x57323c);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x8e')]=function(_0x570683,_0x6d8e2f){scripts[_0xf10d('0x8e')](_0x570683[_0xf10d('0x8f')],_0x570683[_0xf10d('0x90')],_0x570683['aws_polly_region'],_0x570683[_0xf10d('0x91')]||'Amy',_0x570683[_0xf10d('0x5d')],_0x570683[_0xf10d('0x92')]||_0xf10d('0x5d'))[_0xf10d('0x17')](function(_0x58bf7e){_0x6d8e2f(null,_0x58bf7e);})['catch'](function(_0x28522f){_0x6d8e2f(_0x28522f);});};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x93')]=function(_0x266cf1,_0xbced07){scripts[_0xf10d('0x93')](this[_0xf10d('0xf')]['uniqueid'],_0x266cf1['aws_access_key_id'],_0x266cf1[_0xf10d('0x90')],_0x266cf1[_0xf10d('0x94')],_0x266cf1[_0xf10d('0x5d')],_0x266cf1['aws_bot_name'])[_0xf10d('0x17')](function(_0x5765a9){_0xbced07(null,_0x5765a9);})[_0xf10d('0x14')](function(_0x14ac51){_0xbced07(_0x14ac51);});};AGIVertices['prototype']['googleASR']=function(_0x5245a4,_0x461bae,_0x2488ad){scripts[_0xf10d('0x95')](_0x461bae,_0x5245a4[_0xf10d('0x7f')],_0x5245a4[_0xf10d('0x96')]||_0xf10d('0x5f'))[_0xf10d('0x17')](function(_0x2d9ca6){_0x2488ad(null,_0x2d9ca6);})[_0xf10d('0x14')](function(_0xadb78){_0x2488ad(_0xadb78);});};AGIVertices['prototype'][_0xf10d('0x97')]=function(_0x27e85a,_0x2a3cca,_0x5bf799){scripts['tildeASR'](_0x2a3cca,_0x27e85a[_0xf10d('0x98')],_0x27e85a[_0xf10d('0x99')],_0x27e85a['uri'])[_0xf10d('0x17')](function(_0x40a75f){_0x5bf799(null,_0x40a75f);})[_0xf10d('0x14')](function(_0xdb4894){_0x5bf799(_0xdb4894);});};AGIVertices[_0xf10d('0x1a')]['clear']=function(_0x6e848b){var _0x3e9fc5=_[_0xf10d('0x6b')](verticesWithRetry,_0x6e848b[_0xf10d('0x9a')])?_0x6e848b:_[_0xf10d('0x9b')](_0x6e848b);for(var _0xfd03b0 in _0x3e9fc5){if(_0x3e9fc5[_0xf10d('0x9c')](_0xfd03b0)){if(_0x3e9fc5[_0xfd03b0]&&_[_0xf10d('0x9d')](_0x3e9fc5[_0xfd03b0])){if(_[_0xf10d('0x6b')](recursiveMapAttributes,_0xfd03b0)){_0x3e9fc5[_0xfd03b0]=this[_0xf10d('0x9e')](_0x3e9fc5[_0xfd03b0]);}else{_0x3e9fc5[_0xfd03b0]=this[_0xf10d('0x9f')](_0x3e9fc5[_0xfd03b0]);}}}}return _0x3e9fc5;};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xa0')]=function(_0xcec356){for(var _0x231684 in _0xcec356){if(_0xcec356[_0xf10d('0x9c')](_0x231684)){if(_[_0xf10d('0xa1')](_0xcec356[_0x231684])){this[_0xf10d('0xa0')](_0xcec356[_0x231684]);}else if(_[_0xf10d('0xa2')](_0xcec356[_0x231684])){for(var _0x28e473=0x0;_0x28e473<_0xcec356[_0x231684][_0xf10d('0xa3')];_0x28e473++){this[_0xf10d('0xa0')](_0xcec356[_0x231684][_0x28e473]);}}else if(_[_0xf10d('0x9d')](_0xcec356[_0x231684])){_0xcec356[_0x231684]=this[_0xf10d('0x9f')](_0xcec356[_0x231684]);}}}};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xa4')]=function(_0x1bd994,_0x264204){for(var _0x3d4e5b in _0x1bd994){if(_0x1bd994[_0xf10d('0x9c')](_0x3d4e5b)){if(_[_0xf10d('0xa1')](_0x1bd994[_0x3d4e5b])){if(!_[_0xf10d('0x44')](_0x1bd994[_0x3d4e5b])){this[_0xf10d('0xa4')](_0x1bd994[_0x3d4e5b],util[_0xf10d('0x2a')]('%s.%s',_0x264204,_0x3d4e5b));}}else if(_[_0xf10d('0xa2')](_0x1bd994[_0x3d4e5b])){for(var _0x3ad9ba=0x0;_0x3ad9ba<_0x1bd994[_0x3d4e5b][_0xf10d('0xa3')];_0x3ad9ba++){this[_0xf10d('0xa4')](_0x1bd994[_0x3d4e5b][_0x3ad9ba],util[_0xf10d('0x2a')](_0xf10d('0xa5'),_0x264204,_0x3d4e5b+'['+_0x3ad9ba+']'));}}else{if(!_[_0xf10d('0x46')](_0x1bd994[_0x3d4e5b])){this[_0xf10d('0xf')]['setVariable'](util[_0xf10d('0x2a')]('%s.%s',_0x264204,_0x3d4e5b),_0x1bd994[_0x3d4e5b]);}}}}};AGIVertices[_0xf10d('0x1a')]['replaceObjectAllVariables']=function(_0x96e673){try{var _0x18f2a0=JSON[_0xf10d('0x71')](_0x96e673);this['recursiveNodeIndex'](_0x18f2a0);return JSON[_0xf10d('0x76')](_0x18f2a0);}catch(_0x278a28){return this[_0xf10d('0x9f')](_0x96e673);}};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x9f')]=function(_0x32b8ee){var _0x2f2384=_0x32b8ee[_0xf10d('0xa6')]('{');for(var _0x29ddb2=0x1;_0x29ddb2<_0x2f2384['length'];_0x29ddb2+=0x1){var _0x490c6f=_0x2f2384[_0x29ddb2][_0xf10d('0xa6')]('}');if(_0x490c6f[_0xf10d('0xa3')]>0x1){_0x32b8ee=_0x32b8ee[_0xf10d('0xa7')]('{'+_0x490c6f[0x0]+'}',this['channel'][_0xf10d('0x12')](_0x490c6f[0x0])[_0xf10d('0xa8')]||_0x490c6f[0x0]);}}if(_0x2f2384[_0xf10d('0xa3')]===0x1){return _0x32b8ee[_0xf10d('0x4c')]();}return this[_0xf10d('0x9f')](_0x32b8ee);};AGIVertices['prototype'][_0xf10d('0xa9')]=function(_0x29cb8d,_0xe03c42){var _0xb32dba=this[_0xf10d('0xf')][_0xf10d('0x12')](_0x29cb8d);if(_0xb32dba[_0xf10d('0xaa')]===-0x1){return _0xb32dba;}logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0xab'),_0xe03c42,_0xb32dba['extra']));return this[_0xf10d('0xf')][_0xf10d('0xac')](_0xe03c42,_0xb32dba['extra']);};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x8c')]=function(_0x45fe79){return _0x45fe79&&_0x45fe79!=='0'&&_0x45fe79!=='-1'&&_0x45fe79!=='';};AGIVertices['prototype'][_0xf10d('0xad')]=function(_0x509207){this[_0xf10d('0x36')]['sync'](this,_0x509207,'-');_0x509207[_0xf10d('0xae')]=_0x509207[_0xf10d('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xaf')]=function(_0xc5f5dd){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0xb0'),_0xc5f5dd[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0xc5f5dd[_0xf10d('0x5d')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0xb2'));}var _0x2028b6='\x22'+_0xc5f5dd[_0xf10d('0x5d')]+'\x22';if(this[_0xf10d('0x8c')](_0xc5f5dd['options'])){_0x2028b6+=','+_0xc5f5dd[_0xf10d('0x7d')];}var _0x5cb255=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0xb3'),_0x2028b6);if(_0x5cb255[_0xf10d('0xaa')]===-0x1){return _0x5cb255;}return this['channel'][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xb4'),_0x2028b6));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xb5')]=function(_0x12034b){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0xb6'),_0x12034b[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x12034b['grammar'])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0xb7'));}var _0x494f04=_0x12034b[_0xf10d('0xb8')];if(this['isConfigured'](_0x12034b[_0xf10d('0x7d')])){_0x494f04+=','+_0x12034b[_0xf10d('0x7d')];}var _0x48e626=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0xb9'),_0x494f04);if(_0x48e626['result']===-0x1){return _0x48e626;}var _0x231a2d=this[_0xf10d('0xa9')](_0xf10d('0xba'),_0xf10d('0xbb'));if(_0x231a2d[_0xf10d('0xaa')]===-0x1){return _0x231a2d;}var _0x3b85fa=this['getAndSetVariable'](_0xf10d('0xbc'),_0xf10d('0xbd'));if(_0x3b85fa[_0xf10d('0xaa')]===-0x1){return _0x3b85fa;}var _0x2d0990=this[_0xf10d('0xa9')](_0xf10d('0xbe'),_0xf10d('0xbf'));if(_0x2d0990[_0xf10d('0xaa')]===-0x1){return _0x2d0990;}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util['format'](_0xf10d('0xc0'),_0x494f04));};AGIVertices[_0xf10d('0x1a')]['agi']=function(_0x3859b8){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0xc1'),_0x3859b8['label']));return this['channel']['agi']([_0x3859b8['command'],_0x3859b8[_0xf10d('0xc2')]]);};AGIVertices['prototype'][_0xf10d('0xc3')]=function(_0x584c7d){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0xc4'),_0x584c7d[_0xf10d('0x38')]));if(this[_0xf10d('0x8c')](_0x584c7d['timeout'])){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0xc5'),_0x584c7d['timeout']));var _0x5e1a15=this[_0xf10d('0xf')][_0xf10d('0xc6')](_0x584c7d[_0xf10d('0x69')]);if(_0x5e1a15['result']===-0x1){return _0x5e1a15;}}return this['channel'][_0xf10d('0xc3')]();};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x4a')]=function(_0x233285){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x233285[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x233285[_0xf10d('0x48')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x233285,_0xf10d('0xc7'));}_0x233285[_0xf10d('0x49')]=moment();if(this[_0xf10d('0x8c')](_0x233285[_0xf10d('0xc8')])){_0x233285[_0xf10d('0x49')]=moment()[_0xf10d('0xc9')](_0x233285[_0xf10d('0xc8')],'minutes');}if(!this[_0xf10d('0x8c')](_0x233285[_0xf10d('0x4d')])){_0x233285['callback_priority']=0x2;}this[_0xf10d('0x41')][_0xf10d('0x74')](this,_0x233285);return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xca'),_0x233285[_0xf10d('0x47')],_0x233285[_0xf10d('0x48')],_0x233285['scheduledAt']));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xcb')]=function(_0x3eed1a){logger[_0xf10d('0x2f')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x3eed1a['label']));var _0x3064db=this['channel'][_0xf10d('0x57')](_0x3eed1a[_0xf10d('0xcc')],_0x3eed1a['options']);if(_0x3064db[_0xf10d('0xaa')]===-0x1){return _0x3064db;}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('Executed\x20command\x20%s\x20%s',_0x3eed1a[_0xf10d('0xcc')],_0x3eed1a[_0xf10d('0x7d')]));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xcd')]=function(_0x1f3642){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0xce'),_0x1f3642[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x1f3642[_0xf10d('0x5d')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0xb2'));}var _0x5b5bcc='\x22'+_0x1f3642[_0xf10d('0x5d')]+'\x22';if(this[_0xf10d('0x8c')](_0x1f3642[_0xf10d('0x7d')])){_0x5b5bcc+=','+_0x1f3642[_0xf10d('0x7d')];}var _0x12e619=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0xb3'),_0x5b5bcc);if(_0x12e619['result']===-0x1){return _0x12e619;}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xb4'),_0x5b5bcc));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xcf')]=function(_0x3a864d){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3a864d[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x3a864d['text'])){return this['channel']['noop'](_0xf10d('0xb2'));}var _0x2e7837='\x22'+_0x3a864d[_0xf10d('0x5d')]+'\x22';if(this['isConfigured'](_0x3a864d['options'])){_0x2e7837+=','+_0x3a864d[_0xf10d('0x7d')];}var _0x2ceca9=this[_0xf10d('0xf')][_0xf10d('0x57')]('MRCPSynth',_0x2e7837);if(_0x2ceca9['result']===-0x1){return _0x2ceca9;}return this[_0xf10d('0xf')]['noop'](util[_0xf10d('0x2a')](_0xf10d('0xb4'),_0x2e7837));};AGIVertices['prototype']['lumenvoxasr']=function(_0x2cd916){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2cd916[_0xf10d('0x38')]));if(!this['isConfigured'](_0x2cd916['grammar'])){return this['channel']['noop'](_0xf10d('0xb7'));}var _0x248200=_0x2cd916[_0xf10d('0xb8')];if(this[_0xf10d('0x8c')](_0x2cd916['options'])){_0x248200+=','+_0x2cd916[_0xf10d('0x7d')];}var _0x4b8650=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0xb9'),_0x248200);if(_0x4b8650['result']===-0x1){return _0x4b8650;}var _0x19cf86=this['getAndSetVariable'](_0xf10d('0xba'),_0xf10d('0xd0'));if(_0x19cf86[_0xf10d('0xaa')]===-0x1){return _0x19cf86;}var _0x2a45d1=this['getAndSetVariable']('RECOG_INPUT()',_0xf10d('0xd1'));if(_0x2a45d1['result']===-0x1){return _0x2a45d1;}var _0x40db4e=this[_0xf10d('0xa9')](_0xf10d('0xbe'),_0xf10d('0xd2'));if(_0x40db4e[_0xf10d('0xaa')]===-0x1){return _0x40db4e;}return this[_0xf10d('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x248200));};AGIVertices[_0xf10d('0x1a')]['sestekasr']=function(_0x4e8e8d){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x4e8e8d[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x4e8e8d[_0xf10d('0xb8')])){return this['channel'][_0xf10d('0xb1')](_0xf10d('0xb7'));}var _0x515a4d=_0x4e8e8d[_0xf10d('0xb8')];if(this[_0xf10d('0x8c')](_0x4e8e8d[_0xf10d('0x7d')])){_0x515a4d+=','+_0x4e8e8d['options'];}var _0x56c79a=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0xb9'),_0x515a4d);if(_0x56c79a[_0xf10d('0xaa')]===-0x1){return _0x56c79a;}var _0x20cc3b=this[_0xf10d('0xa9')]('RECOG_CONFIDENCE()',_0xf10d('0xd3'));if(_0x20cc3b[_0xf10d('0xaa')]===-0x1){return _0x20cc3b;}var _0x39a7ba=this[_0xf10d('0xa9')](_0xf10d('0xbc'),_0xf10d('0xd4'));if(_0x39a7ba['result']===-0x1){return _0x39a7ba;}var _0x195c79=this[_0xf10d('0xa9')](_0xf10d('0xbe'),'SESTEK_ASR_INSTANCE');if(_0x195c79['result']===-0x1){return _0x195c79;}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xc0'),_0x515a4d));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xd5')]=function(_0x3aa004){logger[_0xf10d('0x2f')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3aa004[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x3aa004[_0xf10d('0xd6')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x3aa004,_0xf10d('0xd7'));}var _0x5df20f=this[_0xf10d('0xd8')][_0xf10d('0x74')](this,_0x3aa004[_0xf10d('0xd6')]);if(!_0x5df20f){return this['channel'][_0xf10d('0x51')](_0x3aa004,_0xf10d('0xd9'));}if(!this[_0xf10d('0x8c')](_0x3aa004[_0xf10d('0x30')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x3aa004,'no\x20query\x20configured');}var _0x47eb71=_0x3aa004[_0xf10d('0x30')][_0xf10d('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xda'),_0x47eb71));var _0x352990=this['getQueryOdbc'][_0xf10d('0x74')](this,_0x5df20f,_0x47eb71);this['createSquareDetailsReport']['sync'](this,_0x3aa004,_0x47eb71);if(!this[_0xf10d('0x8c')](_0x3aa004[_0xf10d('0xdb')])){return this['channel'][_0xf10d('0xb1')](_0xf10d('0xdc'));}var _0x3f4164=this['getVariable']['sync'](this,_0x3aa004[_0xf10d('0xdb')]);if(!_0x3f4164){return this['channel']['error'](_0x3aa004,_0xf10d('0xdd'));}var _0x112b2c=this;_0x352990[_0xf10d('0xde')](function(_0xb39d84,_0x328c42){Object[_0xf10d('0xdf')](_0xb39d84)[_0xf10d('0xde')](function(_0x2b2417){_0x112b2c[_0xf10d('0xf')]['setVariable'](util[_0xf10d('0x2a')](_0xf10d('0xe0'),_0x3f4164,_0x328c42,_0x2b2417),_0xb39d84[_0x2b2417]);});});this[_0xf10d('0xf')][_0xf10d('0xac')](util['format'](_0xf10d('0xe1'),_0x3f4164),_0x352990['length']);return this[_0xf10d('0xf')]['noop'](util['format'](_0xf10d('0xe2'),_0x3f4164));};AGIVertices['prototype'][_0xf10d('0xe3')]=function(_0x2a3753){logger[_0xf10d('0xe4')](util[_0xf10d('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2a3753[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x2a3753[_0xf10d('0xe5')])){return this['channel'][_0xf10d('0x51')](_0x2a3753,_0xf10d('0xe6'));}var _0x107a0b=this[_0xf10d('0x1d')][_0xf10d('0x74')](this,_0x2a3753[_0xf10d('0xe5')]);if(!_0x107a0b){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x2a3753,_0xf10d('0xe7'));}var _0x509f68=this['channel'][_0xf10d('0x57')](_0xf10d('0xe8'),[util[_0xf10d('0x2a')](_0xf10d('0xe9'),_0x107a0b),_0x2a3753[_0xf10d('0x69')],_0x2a3753[_0xf10d('0xea')],_0x2a3753[_0xf10d('0x67')]]);if(_0x509f68[_0xf10d('0xaa')]===-0x1){return _0x509f68;}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xeb'),_0xf10d('0xe8')));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xec')]=function(_0x4b227e){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0xed'),_0x4b227e[_0xf10d('0x38')]));if(!this['isConfigured'](_0x4b227e[_0xf10d('0x7f')])){return this['channel'][_0xf10d('0xb1')](_0xf10d('0xee'));}if(!this[_0xf10d('0x8c')](_0x4b227e[_0xf10d('0x5d')])){return this['channel'][_0xf10d('0xb1')](_0xf10d('0xb2'));}this[_0xf10d('0xf')]['bot']=!![];this[_0xf10d('0x36')](_0x4b227e);this[_0xf10d('0x40')](_0x4b227e[_0xf10d('0x5d')],'in','','');this['channel'][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xef'),_0x4b227e[_0xf10d('0x5d')]));var _0x5d6137=this['googleDialogflow'][_0xf10d('0x74')](this,_0x4b227e);if(_0x5d6137){for(var _0x59621f in _0x5d6137){if(_0x5d6137[_0xf10d('0x9c')](_0x59621f)){this[_0xf10d('0xf')][_0xf10d('0xac')](util['format'](_0xf10d('0xf0'),_0x59621f['toUpperCase']()),_0x5d6137[_0x59621f]);}}this[_0xf10d('0x40')](_0x5d6137[_0xf10d('0xf1')],_0xf10d('0xf2'),_0xf10d('0xec'),'');return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xf3'),_0x5d6137[_0xf10d('0xf1')]));}return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x4b227e,_0xf10d('0xf4'));};AGIVertices['prototype'][_0xf10d('0xf5')]=function(_0x416692){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0xf6'),_0x416692[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x416692[_0xf10d('0x82')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0xf7'));}if(!this[_0xf10d('0x8c')](_0x416692[_0xf10d('0x83')])){return this[_0xf10d('0xf')]['noop']('no\x20client_email\x20configured');}if(!this[_0xf10d('0x8c')](_0x416692[_0xf10d('0x84')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')]('no\x20private_key\x20configured');}if(!this[_0xf10d('0x8c')](_0x416692['dialogflowV2_language'])){return this[_0xf10d('0xf')][_0xf10d('0xb1')]('no\x20anguage\x20configured');}if(!this[_0xf10d('0x8c')](_0x416692['text'])){return this[_0xf10d('0xf')]['noop'](_0xf10d('0xb2'));}this[_0xf10d('0xf')][_0xf10d('0xf8')]=!![];this[_0xf10d('0x36')](_0x416692);this[_0xf10d('0x40')](_0x416692[_0xf10d('0x5d')],'in','','');this[_0xf10d('0xf')]['noop'](util[_0xf10d('0x2a')](_0xf10d('0xf9'),_0x416692['text']));var _0x5947c4=this[_0xf10d('0x81')][_0xf10d('0x74')](this,_0x416692);if(_0x5947c4){for(var _0x1b8867 in _0x5947c4){if(_0x5947c4[_0xf10d('0x9c')](_0x1b8867)){if(_0x1b8867!==_0xf10d('0xfa')){this[_0xf10d('0xf')][_0xf10d('0xac')](util['format'](_0xf10d('0xf0'),_0x1b8867[_0xf10d('0x6e')]()),_0x5947c4[_0x1b8867]);}}}this[_0xf10d('0x40')](_0x5947c4['speech'],_0xf10d('0xf2'),'dialogflowV2',_0x5947c4[_0xf10d('0xfa')]);return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('DialogflowV2\x20Result\x20%s',_0x5947c4['speech']));}return this['channel']['error'](_0x416692,_0xf10d('0xfb'));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xfc')]=function(_0x2d913c){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0xfd'),_0x2d913c[_0xf10d('0x38')]));if(!this['isConfigured'](_0x2d913c['ndauth_url'])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0xfe'));}if(!this[_0xf10d('0x8c')](_0x2d913c['username'])){return this['channel']['noop'](_0xf10d('0xff'));}if(!this[_0xf10d('0x8c')](_0x2d913c[_0xf10d('0x100')])){return this['channel']['noop'](_0xf10d('0x101'));}if(!this[_0xf10d('0x8c')](_0x2d913c[_0xf10d('0x102')])){return this[_0xf10d('0xf')]['noop']('no\x20text\x20configured');}this[_0xf10d('0xf')][_0xf10d('0xf8')]=!![];this[_0xf10d('0x36')](_0x2d913c);this[_0xf10d('0x40')](_0x2d913c[_0xf10d('0x5d')],'in','','');this[_0xf10d('0xf')][_0xf10d('0xb1')](util['format'](_0xf10d('0x103'),_0x2d913c[_0xf10d('0x5d')]));var _0x1dd684=this[_0xf10d('0x86')]['sync'](this,_0x2d913c);if(_0x1dd684){for(var _0x5f5824 in _0x1dd684){if(_0x1dd684[_0xf10d('0x9c')](_0x5f5824)){this[_0xf10d('0xf')][_0xf10d('0xac')](util[_0xf10d('0x2a')](_0xf10d('0x104'),_0x5f5824[_0xf10d('0x6e')]()),_0x1dd684[_0x5f5824]);}}this[_0xf10d('0x40')](_0x1dd684[_0xf10d('0xf1')],_0xf10d('0xf2'),'sesteknda','');if(_0x1dd684['audiofile']){this[_0xf10d('0xf')]['noop'](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x1dd684[_0xf10d('0x105')]));var _0x46bfb3=this[_0xf10d('0xf')]['streamFile'](_0x1dd684[_0xf10d('0x105')]);try{fs['unlink'](_0x1dd684[_0xf10d('0x105')]+_0xf10d('0x106'));}catch(_0x44c349){logger[_0xf10d('0x51')](_0x44c349);}return _0x46bfb3;}else{return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x107'),_0x1dd684[_0xf10d('0xf1')]));}}return this['channel'][_0xf10d('0x51')](_0x2d913c,_0xf10d('0x108'));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x109')]=function(_0x52756f){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x10a'),_0x52756f[_0xf10d('0x38')]));return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0x109'));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x10b')]=function(_0x96cb0e){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x10c'),_0x96cb0e['label']));var _0x4178a6='';if(_0x96cb0e[_0xf10d('0x10d')]){if(!this['isConfigured'](_0x96cb0e[_0xf10d('0x10d')])){return this[_0xf10d('0xf')]['error'](_0x96cb0e,'no\x20trunk\x20selected');}else{var _0x2ce8ab=parseInt(_0x96cb0e[_0xf10d('0x10d')],0xa);if(isNaN(_0x2ce8ab)){_0x4178a6=_0x96cb0e[_0xf10d('0x10d')];}else{_0x4178a6=this[_0xf10d('0x1f')][_0xf10d('0x74')](this,_0x96cb0e[_0xf10d('0x10d')]);if(!_0x4178a6){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x96cb0e,_0xf10d('0x10e'));}}}}else if(_0x96cb0e[_0xf10d('0x10f')]){_0x4178a6=_0x96cb0e[_0xf10d('0x10f')];}else{return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x96cb0e,_0xf10d('0x110'));}var _0x3daab1=this['channel']['exec']('DIAL',[util[_0xf10d('0x2a')]('SIP/%s/%s',_0x4178a6,_0x96cb0e['phone']),_0x96cb0e['timeout'],_0x96cb0e[_0xf10d('0xea')],_0x96cb0e[_0xf10d('0x67')]]);if(_0x3daab1[_0xf10d('0xaa')]===-0x1){return _0x3daab1;}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util['format'](_0xf10d('0xeb'),_0xf10d('0xe8')));};AGIVertices[_0xf10d('0x1a')]['finally']=function(_0x5e8717){logger['info'](util['format'](_0xf10d('0x111'),_0x5e8717['label']));return this[_0xf10d('0xf')]['noop'](_0xf10d('0x112'));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xe')]=function(_0xf992d1){logger['info'](util['format'](_0xf10d('0x113'),_0xf992d1[_0xf10d('0x38')]));if(_0xf992d1[_0xf10d('0xae')]===0x0){return this['maxRetry'](_0xf992d1);}_0xf992d1[_0xf10d('0xae')]-=0x1;if(!this[_0xf10d('0x8c')](_0xf992d1[_0xf10d('0x114')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0xf992d1,_0xf10d('0x115'));}var _0x14054d=this[_0xf10d('0x116')]['sync'](this,_0xf992d1[_0xf10d('0x114')]);if(!_0x14054d){return this[_0xf10d('0xf')]['error'](_0xf992d1,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0xf992d1[_0xf10d('0xdb')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0xf10d('0xdc'));}var _0x6fa983=this['channel'][_0xf10d('0x117')](_0x14054d,_0xf992d1['response'],_0xf992d1[_0xf10d('0x118')]);var _0x266298=_0x6fa983[_0xf10d('0xaa')]?_0x6fa983[_0xf10d('0xaa')]['toString']():'';logger['info']('test',JSON[_0xf10d('0x76')](_0x6fa983));if(_0x6fa983[_0xf10d('0xaa')]===-0x1){this['createSquareDetailsReport'][_0xf10d('0x74')](this,_0xf992d1,_0x266298);return _0x6fa983;}else if(_0x6fa983[_0xf10d('0xa8')]==='timeout'){_0x6fa983[_0xf10d('0xaa')]=_0x266298[_0xf10d('0xa3')]>=parseInt(_0xf992d1[_0xf10d('0x119')])?'x':'i';}else{_0x6fa983[_0xf10d('0xaa')]=_0x266298[_0xf10d('0xa3')]>=parseInt(_0xf992d1[_0xf10d('0x119')])&&_0x266298['length']<=parseInt(_0xf992d1[_0xf10d('0x118')])?'x':'i';}var _0x447f94=this[_0xf10d('0x12')][_0xf10d('0x74')](this,_0xf992d1[_0xf10d('0xdb')]);if(!_0x447f94){return this[_0xf10d('0xf')]['error'](_0xf992d1,_0xf10d('0xdd'));}this['channel'][_0xf10d('0xac')](_0x447f94,_0x266298);if(this[_0xf10d('0x8c')](_0xf992d1[_0xf10d('0x11a')])){var _0x5b292a=parseInt(_0xf992d1['hiddendigitsnum'],0xa);var _0x45ed88=rs[_0xf10d('0x11b')]({'charset':'*','length':_0x5b292a});var _0x5b7b39=_0x266298[_0xf10d('0xa3')];if(_0x5b7b39>0x0){if(_0x5b7b39>_0x5b292a){this[_0xf10d('0x36')][_0xf10d('0x74')](this,_0xf992d1,_0xf992d1['hiddendigitspos']===_0xf10d('0x11c')?_0x45ed88+_0x266298[_0xf10d('0x11d')](_0x5b292a):_0x266298[_0xf10d('0x11d')](0x0,_0x5b7b39-_0x5b292a)+_0x45ed88);}else{this[_0xf10d('0x36')][_0xf10d('0x74')](this,_0xf992d1,rs[_0xf10d('0x11b')]({'charset':'*','length':_0x5b7b39}));}}else{this['createSquareDetailsReport'][_0xf10d('0x74')](this,_0xf992d1,'');}}else{this[_0xf10d('0x36')][_0xf10d('0x74')](this,_0xf992d1,_0x266298);}return _0x6fa983;};AGIVertices['prototype'][_0xf10d('0x11e')]=function(_0x308c44){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x11f'),_0x308c44[_0xf10d('0x38')]));return this['getdigits'](_0x308c44);};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x120')]=function(_0xfffd21){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x121'),_0xfffd21[_0xf10d('0x38')]));this[_0xf10d('0x36')][_0xf10d('0x74')](this,_0xfffd21,_0xfffd21[_0xf10d('0x122')]);return this['channel']['noop'](util[_0xf10d('0x2a')](_0xf10d('0x123'),_0xfffd21['goalname']));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x124')]=function(_0x46a0b9){logger[_0xf10d('0x2f')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x46a0b9[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x46a0b9[_0xf10d('0x8f')])||!this[_0xf10d('0x8c')](_0x46a0b9[_0xf10d('0x90')])){return this['channel']['noop'](_0xf10d('0x125'));}if(!this[_0xf10d('0x8c')](_0x46a0b9[_0xf10d('0x5d')])){return this['channel']['noop'](_0xf10d('0xb2'));}this[_0xf10d('0xf')]['noop'](util[_0xf10d('0x2a')](_0xf10d('0x126'),_0x46a0b9[_0xf10d('0x5d')]));var _0xb34a03=this[_0xf10d('0x8e')][_0xf10d('0x74')](this,_0x46a0b9);if(_0xb34a03){this['channel'][_0xf10d('0xb1')](util['format'](_0xf10d('0x127'),_0xb34a03));var _0x3a99ee=this[_0xf10d('0xf')][_0xf10d('0x128')](_0xb34a03);try{fs[_0xf10d('0x129')](_0xb34a03+_0xf10d('0x106'));}catch(_0x4f3629){logger[_0xf10d('0x51')](_0x4f3629);}return _0x3a99ee;}return this['channel']['error'](_0x46a0b9,_0xf10d('0x12a'));};AGIVertices[_0xf10d('0x1a')]['awslex']=function(_0x3db400){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x3db400[_0xf10d('0x38')]));if(!this['isConfigured'](_0x3db400[_0xf10d('0x8f')])||!this[_0xf10d('0x8c')](_0x3db400['aws_secret_access_key'])){return this['channel'][_0xf10d('0xb1')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xf10d('0x8c')](_0x3db400['aws_bot_name'])){return this[_0xf10d('0xf')]['noop'](_0xf10d('0x12b'));}if(!this[_0xf10d('0x8c')](_0x3db400[_0xf10d('0x5d')])){return this['channel'][_0xf10d('0xb1')](_0xf10d('0xb2'));}this['channel'][_0xf10d('0xf8')]=!![];this['createSquareDetailsReport'](_0x3db400);this['createSquareMessage'](_0x3db400[_0xf10d('0x5d')],'in','','');this[_0xf10d('0xf')]['noop'](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x3db400[_0xf10d('0x5d')]));var _0x2ef21e=this[_0xf10d('0x93')][_0xf10d('0x74')](this,_0x3db400);if(_0x2ef21e){for(var _0xf50a9a in _0x2ef21e){if(_0x2ef21e['hasOwnProperty'](_0xf50a9a)&&_[_0xf10d('0x9d')](_0x2ef21e[_0xf50a9a])){this[_0xf10d('0xf')]['setVariable'](util[_0xf10d('0x2a')](_0xf10d('0x12c'),_0xf50a9a[_0xf10d('0x6e')]()),_0x2ef21e[_0xf50a9a]);}}if(_[_0xf10d('0x46')](_0x2ef21e[_0xf10d('0x7b')])){return this['channel'][_0xf10d('0xb1')](_0xf10d('0x12d'));}else{this[_0xf10d('0x40')](_0x2ef21e[_0xf10d('0x7b')],_0xf10d('0xf2'),_0xf10d('0x12e'),'');return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x12f'),_0x2ef21e['message']));}}return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x3db400,_0xf10d('0x130'));};AGIVertices['prototype'][_0xf10d('0x131')]=function(_0x5ba09e){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x132'),_0x5ba09e['label'],_0x5ba09e[_0xf10d('0x69')]));if(!this['isConfigured'](_0x5ba09e[_0xf10d('0x7f')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')]('no\x20key\x20configured');}var _0xcfc99='wav';var _0x23d5db=util[_0xf10d('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xf10d('0x11b')](0x4));var _0x13d9af=util[_0xf10d('0x2a')](_0xf10d('0xa5'),_0x23d5db,_0xcfc99);var _0x28b1d7=!![];if(_0x5ba09e[_0xf10d('0x133')]===_0xf10d('0x134')){_0x28b1d7=![];}var _0x19497d=this[_0xf10d('0xf')]['recordFile'](_0x23d5db,_0xcfc99,_0x5ba09e[_0xf10d('0x135')],_0x5ba09e[_0xf10d('0x69')],undefined,_0x28b1d7);if(_0x19497d[_0xf10d('0xaa')]!==-0x1){this['channel']['noop'](util['format'](_0xf10d('0x136'),_0x13d9af));var _0x29ff36=this[_0xf10d('0x95')][_0xf10d('0x74')](this,_0x5ba09e,_0x13d9af);if(_0x29ff36){for(var _0x478540 in _0x29ff36){if(_0x29ff36[_0xf10d('0x9c')](_0x478540)){this[_0xf10d('0xf')][_0xf10d('0xac')](util['format'](_0xf10d('0x137'),_0x478540[_0xf10d('0x6e')]()),_0x29ff36[_0x478540]);}}return this['channel']['noop'](util['format'](_0xf10d('0x138'),JSON[_0xf10d('0x76')](_0x29ff36)));}}return _0x19497d;};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x139')]=function(_0xdc0086){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x13a'),_0xdc0086['label']));if(!this[_0xf10d('0x8c')](_0xdc0086[_0xf10d('0x98')])){return this[_0xf10d('0xf')]['noop'](_0xf10d('0x13b'));}if(!this[_0xf10d('0x8c')](_0xdc0086[_0xf10d('0x99')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')]('no\x20appsecret\x20configured');}var _0x527568='wav';var _0x586146=util['format'](_0xf10d('0x13c'),FILES_PATH,rs['generate'](0x4));var _0x3aaf94=util[_0xf10d('0x2a')]('%s.%s',_0x586146,_0x527568);var _0x26d956=!![];if(_0xdc0086[_0xf10d('0x133')]===_0xf10d('0x134')){_0x26d956=![];}var _0xc1a074=this[_0xf10d('0xf')][_0xf10d('0x13d')](_0x586146,_0x527568,_0xdc0086['intKey'],_0xdc0086['timeout'],undefined,_0x26d956);if(_0xc1a074[_0xf10d('0xaa')]!==-0x1){this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x13e'),_0x3aaf94));var _0x4e3fed=this[_0xf10d('0x97')][_0xf10d('0x74')](this,_0xdc0086,_0x3aaf94);if(_0x4e3fed){for(var _0x299250 in _0x4e3fed){if(_0x4e3fed[_0xf10d('0x9c')](_0x299250)){this[_0xf10d('0xf')]['setVariable'](util[_0xf10d('0x2a')](_0xf10d('0x13f'),_0x299250[_0xf10d('0x6e')]()),_0x4e3fed[_0x299250]);}}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x4e3fed)));}}return _0xc1a074;};AGIVertices['prototype'][_0xf10d('0x140')]=function(_0x243363){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x141'),_0x243363[_0xf10d('0x38')]));return this['channel']['continueAt'](_0x243363[_0xf10d('0x142')],_0x243363[_0xf10d('0x3b')],_0x243363['priority']);};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x143')]=function(_0x42561c){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x144'),_0x42561c[_0xf10d('0x38')]));if(!this['isConfigured'](_0x42561c[_0xf10d('0x145')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x42561c,_0xf10d('0x146'));}try{var _0x323b2d=eval(_0x42561c[_0xf10d('0x145')])?_0xf10d('0x147'):_0xf10d('0x148');this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('EVAL\x20CONDITION\x20%s\x20%s',_0x42561c['condition'],_0x323b2d));return{'code':0xc8,'result':_0x323b2d};}catch(_0x4faeae){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x149')]=function(_0x4d59e9){logger[_0xf10d('0x2f')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4d59e9[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x4d59e9['interval_id'])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x4d59e9,'no\x20interval\x20configured');}var _0x22d0fa=this[_0xf10d('0x26')][_0xf10d('0x74')](this,_0x4d59e9[_0xf10d('0x14a')]);if(!_0x22d0fa){return this['channel'][_0xf10d('0x51')](_0x4d59e9,_0xf10d('0x14b'));}for(var _0x428e5f=0x0;_0x428e5f<_0x22d0fa[_0xf10d('0xa3')];_0x428e5f+=0x1){var _0x978a4a=this['channel'][_0xf10d('0x12')](util[_0xf10d('0x2a')](_0xf10d('0x14c'),_0x22d0fa[_0x428e5f]));if(_0x978a4a[_0xf10d('0xaa')]===-0x1){return _0x978a4a;}logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x14d'),_0x22d0fa[_0x428e5f],_0x978a4a[_0xf10d('0xa8')]));if(_0x978a4a[_0xf10d('0xa8')]===_0xf10d('0x147')){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x14d'),_0x22d0fa[_0x428e5f],_0xf10d('0x147')));this[_0xf10d('0xf')][_0xf10d('0xb1')](util['format'](_0xf10d('0x14d'),_0x22d0fa[_0x428e5f],'true'));return{'code':0xc8,'result':_0xf10d('0x147')};}else{logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x14d'),_0x22d0fa[_0x428e5f],_0xf10d('0x148')));this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('IFTIME\x20%s\x20%s',_0x22d0fa[_0x428e5f],'false'));}}return{'code':0xc8,'result':_0xf10d('0x148')};};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x14e')]=function(_0x323b8f){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0x14f'),_0x323b8f[_0xf10d('0x38')]));return this[_0xf10d('0xf')]['hangup']();};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x150')]=function(_0x5d2eab){logger['info'](util[_0xf10d('0x2a')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5d2eab[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x5d2eab[_0xf10d('0x7f')])){return this['channel'][_0xf10d('0xb1')]('no\x20key\x20configured');}var _0x153d91=_0xf10d('0x151');var _0x174926=util[_0xf10d('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xf10d('0x11b')](0x4));var _0xeed5db=util['format'](_0xf10d('0xa5'),_0x174926,_0x153d91);var _0x3a7b02=!![];if(_0x5d2eab[_0xf10d('0x133')]===_0xf10d('0x134')){_0x3a7b02=![];}var _0x348ef5=this['channel'][_0xf10d('0x13d')](_0x174926,_0x153d91,_0x5d2eab[_0xf10d('0x135')],_0x5d2eab[_0xf10d('0x69')],undefined,_0x3a7b02);if(_0x348ef5[_0xf10d('0xaa')]!==-0x1){this[_0xf10d('0xf')]['noop'](util[_0xf10d('0x2a')](_0xf10d('0x152'),_0xeed5db));var _0x57ae9f=this[_0xf10d('0x8a')][_0xf10d('0x74')](this,_0x5d2eab,_0xeed5db);if(_0x57ae9f){for(var _0x237e99 in _0x57ae9f){if(_0x57ae9f[_0xf10d('0x9c')](_0x237e99)){this['channel'][_0xf10d('0xac')](util['format'](_0xf10d('0x153'),_0x237e99[_0xf10d('0x6e')]()),_0x57ae9f[_0x237e99]);}}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x154'),JSON[_0xf10d('0x76')](_0x57ae9f)));}}return _0x348ef5;};AGIVertices[_0xf10d('0x1a')]['ispeechtts']=function(_0x23ff0e){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x155'),_0x23ff0e['label']));if(!this[_0xf10d('0x8c')](_0x23ff0e[_0xf10d('0x7f')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')]('no\x20key\x20configured');}if(!this[_0xf10d('0x8c')](_0x23ff0e['text'])){return this[_0xf10d('0xf')]['noop'](_0xf10d('0xb2'));}this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x156'),_0x23ff0e[_0xf10d('0x5d')]));var _0x348d4b=this[_0xf10d('0x87')][_0xf10d('0x74')](this,_0x23ff0e);if(_0x348d4b){this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x152'),_0x348d4b));var _0x5731d2=this[_0xf10d('0xf')][_0xf10d('0x128')](_0x348d4b,_0x23ff0e[_0xf10d('0x135')]);try{fs['unlink'](_0x348d4b+'.wav');}catch(_0x23e71b){logger['error'](_0x23e71b);}return _0x5731d2;}return this[_0xf10d('0xf')]['error'](_0x23ff0e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xf10d('0x1a')]['login']=function(_0x3897bc){logger[_0xf10d('0x2f')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3897bc[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x3897bc[_0xf10d('0x157')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x3897bc,_0xf10d('0x158'));}logger[_0xf10d('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf10d('0xf')]['callerid'],_0x3897bc[_0xf10d('0x157')]));var _0xa9f205=this[_0xf10d('0x53')][_0xf10d('0x74')](this,_0x3897bc[_0xf10d('0x157')]);if(_0xa9f205){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x159'),this[_0xf10d('0xf')]['callerid'],_0x3897bc[_0xf10d('0x157')]));this[_0xf10d('0xf')]['noop'](util[_0xf10d('0x2a')](_0xf10d('0x159'),this['channel'][_0xf10d('0x39')],_0x3897bc[_0xf10d('0x157')]));return{'code':0xc8,'result':_0xf10d('0x15a')};}else{logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x15b'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x3897bc[_0xf10d('0x157')]));this['channel']['noop'](util[_0xf10d('0x2a')](_0xf10d('0x15b'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x3897bc['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x15c')]=function(_0x5e088b){logger[_0xf10d('0x2f')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x5e088b['label']));if(!this['isConfigured'](_0x5e088b[_0xf10d('0x157')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x5e088b,_0xf10d('0x158'));}logger[_0xf10d('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5e088b[_0xf10d('0x157')]));var _0x2c2b8d=this[_0xf10d('0x15d')][_0xf10d('0x74')](this,_0x5e088b[_0xf10d('0x157')]);if(_0x2c2b8d){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5e088b[_0xf10d('0x157')]));this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x159'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5e088b['findBy']));return{'code':0xc8,'result':_0xf10d('0x15a')};}else{logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x15b'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5e088b[_0xf10d('0x157')]));this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5e088b[_0xf10d('0x157')]));return{'code':0xc8,'result':_0xf10d('0x15e')};}};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x15f')]=function(_0x1e9019){logger['info'](util[_0xf10d('0x2a')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1e9019[_0xf10d('0x38')]));if(!this['isConfigured'](_0x1e9019[_0xf10d('0x160')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x1e9019,_0xf10d('0x161'));}this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x162'),_0x1e9019[_0xf10d('0x160')]));var _0x547429=eval(_0x1e9019['operation']);if(!this['isConfigured'](_0x1e9019[_0xf10d('0xdb')])){return this['channel']['noop'](_0xf10d('0xdc'));}var _0x5e0e7f=this[_0xf10d('0x12')][_0xf10d('0x74')](this,_0x1e9019[_0xf10d('0xdb')]);if(!_0x5e0e7f){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x1e9019,_0xf10d('0xdd'));}if(_[_0xf10d('0xa2')](_0x547429)){var _0x334077=this;_0x547429['forEach'](function(_0x5f5a39,_0x52b263){_0x334077[_0xf10d('0xf')][_0xf10d('0xac')](util[_0xf10d('0x2a')](_0xf10d('0x163'),_0x5e0e7f,_0x52b263),_0x5f5a39);});return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x164'),_0x5e0e7f));}else{return this['channel'][_0xf10d('0xac')](_0x5e0e7f,_0x547429);}};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xd')]=function(_0x37b980){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x165'),_0x37b980[_0xf10d('0x38')]));if(_0x37b980['retry']===0x0){return this[_0xf10d('0xad')](_0x37b980);}_0x37b980[_0xf10d('0xae')]-=0x1;if(!this[_0xf10d('0x8c')](_0x37b980[_0xf10d('0x114')])){return this['channel'][_0xf10d('0x51')](_0x37b980,_0xf10d('0x115'));}var _0x53e859=this['getSound'][_0xf10d('0x74')](this,_0x37b980[_0xf10d('0x114')]);if(!_0x53e859){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x37b980,'no\x20file\x20audio\x20found');}var _0x36c850=this[_0xf10d('0xf')][_0xf10d('0x117')](_0x53e859,_0x37b980[_0xf10d('0x166')],_0x37b980[_0xf10d('0x167')]);var _0x3b5c49=_0x36c850[_0xf10d('0xaa')];if(_0x36c850[_0xf10d('0xaa')]===-0x1){this[_0xf10d('0x36')]['sync'](this,_0x37b980,'-1');return _0x36c850;}else if(_0x36c850['extra']==='timeout'){_0x36c850['result']=_0x36c850[_0xf10d('0xaa')][_0xf10d('0xa3')]>0x0?_0x36c850[_0xf10d('0xaa')]:'t';}else if(_[_0xf10d('0x44')](_0x36c850[_0xf10d('0xaa')])){_0x36c850[_0xf10d('0xaa')]='#';_0x3b5c49='#';}if(!this['isConfigured'](_0x37b980['variable_id'])){this[_0xf10d('0xf')]['noop'](_0xf10d('0xdc'));}else{var _0x2097b6=this[_0xf10d('0x12')][_0xf10d('0x74')](this,_0x37b980[_0xf10d('0xdb')]);if(!_0x2097b6){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x37b980,_0xf10d('0xdd'));}this[_0xf10d('0xf')][_0xf10d('0xac')](_0x2097b6,_0x3b5c49);}this[_0xf10d('0x36')][_0xf10d('0x74')](this,_0x37b980,_0x3b5c49);return _0x36c850;};AGIVertices[_0xf10d('0x1a')][_0xf10d('0xb1')]=function(_0x592a98){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x168'),_0x592a98['label']));return this[_0xf10d('0xf')]['noop'](_0x592a98[_0xf10d('0x169')]||_0x592a98[_0xf10d('0x38')]);};AGIVertices['prototype']['pause']=function(_0x27adce){logger['info'](util[_0xf10d('0x2a')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x27adce['label']));if(!this[_0xf10d('0x8c')](_0x27adce['findBy'])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x27adce,_0xf10d('0x158'));}logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x16a'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x27adce[_0xf10d('0x157')]));var _0x5a8eeb=this[_0xf10d('0x4e')][_0xf10d('0x74')](this,_0x27adce[_0xf10d('0x16b')]);var _0x6a4a2d=this[_0xf10d('0x50')][_0xf10d('0x74')](this,_0x27adce[_0xf10d('0x157')],_0x5a8eeb);if(_0x6a4a2d){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x159'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x27adce[_0xf10d('0x157')]));this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf10d('0xf')][_0xf10d('0x39')],_0x27adce[_0xf10d('0x157')]));return{'code':0xc8,'result':_0xf10d('0x15a')};}else{logger[_0xf10d('0x2f')](util['format'](_0xf10d('0x15b'),this[_0xf10d('0xf')]['callerid'],_0x27adce['findBy']));this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x159'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x27adce[_0xf10d('0x157')]));return{'code':0xc8,'result':_0xf10d('0x15e')};}};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x16c')]=function(_0x21815c){logger['info'](util[_0xf10d('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x21815c[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x21815c['file_id'])){return this['channel']['error'](_0x21815c,_0xf10d('0x115'));}var _0x5242ba=this[_0xf10d('0x116')][_0xf10d('0x74')](this,_0x21815c['file_id']);if(!_0x5242ba){return this[_0xf10d('0xf')]['error'](_0x21815c,_0xf10d('0x16d'));}var _0x523a50=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0x16e'),[_0x5242ba,_0x21815c[_0xf10d('0xea')]]);if(_0x523a50['result']===-0x1){return _0x523a50;}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x16f'),_0xf10d('0x16e'),_0x5242ba));};AGIVertices['prototype'][_0xf10d('0x170')]=function(_0xad9ea0){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x171'),_0xad9ea0[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0xad9ea0['queue_id'])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0xad9ea0,_0xf10d('0x172'));}var _0x435976='';var _0x4b2c28=parseInt(_0xad9ea0[_0xf10d('0x173')],0xa);if(isNaN(_0x4b2c28)){_0x435976=_0xad9ea0['queue_id'];}else{_0x435976=this[_0xf10d('0x15')][_0xf10d('0x74')](this,_0xad9ea0['queue_id']);if(!_0x435976){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0xad9ea0,_0xf10d('0x174'));}}var _0xb214fb='';if(this[_0xf10d('0x8c')](_0xad9ea0[_0xf10d('0x114')])){var _0x25c42e=this[_0xf10d('0x116')][_0xf10d('0x74')](this,_0xad9ea0[_0xf10d('0x114')]);if(_0x25c42e){_0xb214fb=_0x25c42e;}}this[_0xf10d('0x36')][_0xf10d('0x74')](this,_0xad9ea0,_0x435976);if(_0xad9ea0['opts']['indexOf']('x')<0x0){_0xad9ea0[_0xf10d('0xea')]+='x';}if(_0xad9ea0['opts'][_0xf10d('0x175')]('X')<0x0){_0xad9ea0[_0xf10d('0xea')]+='X';}this[_0xf10d('0xf')]['setVariable'](_0xf10d('0x176'),_0x435976?_0x435976['toLowerCase']():'');var _0x23e688=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0x177'),[_0x435976,_0xad9ea0[_0xf10d('0xea')],_0xad9ea0[_0xf10d('0x67')],_0xb214fb,_0xad9ea0[_0xf10d('0x69')],_0xad9ea0['agi'],_0xad9ea0[_0xf10d('0x178')],_0xad9ea0['gosub'],'',_0xad9ea0[_0xf10d('0x179')]]);if(_0x23e688[_0xf10d('0xaa')]===-0x1){return _0x23e688;}return this['channel'][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x435976));};AGIVertices['prototype'][_0xf10d('0x17a')]=function(_0x534e46){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x17b'),_0x534e46['label']));var _0x4789d1=_0x534e46[_0xf10d('0x17c')]||_0xf10d('0x151');var _0x594f8b=util['format'](_0xf10d('0x17d'),this[_0xf10d('0xf')][_0xf10d('0x37')],rs[_0xf10d('0x11b')](0x5));var _0x310132=util['format'](_0xf10d('0x17e'),FILES_PATH,_0x594f8b,_0x4789d1);var _0xc7fa24=util[_0xf10d('0x2a')]('%s/recordings/%s',FILES_PATH,_0x594f8b);this[_0xf10d('0x17f')][_0xf10d('0x74')](this,_0x534e46,_0x594f8b,_0x310132);this[_0xf10d('0xf')][_0xf10d('0xac')](_0xf10d('0x180'),_0x594f8b);logger[_0xf10d('0x2f')](_0xf10d('0x181'),_0xc7fa24,_0x4789d1,_0x534e46[_0xf10d('0x182')],_0x534e46[_0xf10d('0x69')]);return this[_0xf10d('0xf')]['recordFile'](_0xc7fa24,_0x4789d1,_0x534e46[_0xf10d('0x182')],_0x534e46[_0xf10d('0x69')],undefined,!![]);};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x183')]=function(_0x54f1b6){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x184'),_0x54f1b6['label']));if(!this[_0xf10d('0x8c')](_0x54f1b6[_0xf10d('0x67')])){return this['channel']['noop'](_0xf10d('0x185'));}var _0xfc1eff=this[_0xf10d('0x66')]['sync'](this,_0x54f1b6);logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x186'),util[_0xf10d('0x187')](_0xfc1eff,{'showHidden':![],'depth':null})));if(!this[_0xf10d('0x8c')](_0x54f1b6[_0xf10d('0xdb')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0x188'));}var _0xfea1b9=this[_0xf10d('0x12')]['sync'](this,_0x54f1b6[_0xf10d('0xdb')]);if(!_0xfea1b9){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x54f1b6,'no\x20variable\x20found');}this[_0xf10d('0xf')][_0xf10d('0xac')](util[_0xf10d('0x2a')](_0xf10d('0x189'),_0xfea1b9),_0xfc1eff[_0xf10d('0x79')]?_0xfc1eff[_0xf10d('0x79')]:_0xf10d('0x18a'));this[_0xf10d('0xf')][_0xf10d('0xac')](util[_0xf10d('0x2a')]('%s_STATUS_MESSAGE',_0xfea1b9),_0xfc1eff[_0xf10d('0x7a')]?_0xfc1eff[_0xf10d('0x7a')]:'OK');if(_0xfc1eff[_0xf10d('0x77')]){try{this[_0xf10d('0xa4')](_0xfc1eff[_0xf10d('0x77')],_0xfea1b9);}catch(_0x294e83){logger[_0xf10d('0x51')](util['format'](_0xf10d('0x18b'),_0xfea1b9));}}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0xe2'),_0xfea1b9));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x18c')]=function(_0x3bccee){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x18d'),_0x3bccee['label']));return this['channel'][_0xf10d('0x18e')](_0x3bccee[_0xf10d('0x18f')][_0xf10d('0x59')](/\s+/g,''),_0x3bccee[_0xf10d('0x182')]);};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x190')]=function(_0x45c36e){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0x191'),_0x45c36e['label']));return this[_0xf10d('0xf')][_0xf10d('0x192')](_0x45c36e[_0xf10d('0x6a')][_0xf10d('0x59')](/\s+/g,''),_0x45c36e[_0xf10d('0x182')]);};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x193')]=function(_0x27f23e){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x194'),_0x27f23e[_0xf10d('0x38')]));return this[_0xf10d('0xf')][_0xf10d('0x195')](_0x27f23e['text'],_0x27f23e[_0xf10d('0x182')]);};AGIVertices['prototype'][_0xf10d('0x196')]=function(_0x5c2e3d){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x197'),_0x5c2e3d[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x5c2e3d['account_id'])){return this[_0xf10d('0xf')]['noop'](_0xf10d('0x198'));}var _0x5f2001=this[_0xf10d('0x23')][_0xf10d('0x74')](this,_0x5c2e3d[_0xf10d('0x199')]);if(!_0x5f2001||!_0x5f2001['Smtp']){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x5c2e3d,'no\x20mail\x20account\x20found');}var _0x5beb25={'from':util['format'](_0xf10d('0x19a'),_0x5f2001[_0xf10d('0x18')],_0x5f2001['email']||_0x5f2001[_0xf10d('0x19b')][_0xf10d('0x19c')]),'to':_0x5c2e3d['to']||'','cc':_0x5c2e3d['cc']||'','bcc':_0x5c2e3d[_0xf10d('0x19d')]||'','subject':_0x5c2e3d['subject'],'html':_0x5c2e3d['text'],'text':_0x5c2e3d[_0xf10d('0x5d')]};var _0x2d9f5f={'tls':{'rejectUnauthorized':![]}};if(_0x5f2001['Smtp'][_0xf10d('0x19e')]){_0x2d9f5f[_0xf10d('0x19e')]=_0x5f2001['Smtp']['service'];}else{_0x2d9f5f[_0xf10d('0x19f')]=_0x5f2001['Smtp'][_0xf10d('0x19f')];_0x2d9f5f['port']=_0x5f2001[_0xf10d('0x19b')][_0xf10d('0x1a0')];_0x2d9f5f[_0xf10d('0x1a1')]=_0x5f2001[_0xf10d('0x19b')][_0xf10d('0x1a1')];}if(_0x5f2001[_0xf10d('0x19b')][_0xf10d('0x1a2')]){_0x2d9f5f[_0xf10d('0x1a3')]={'user':_0x5f2001[_0xf10d('0x19b')]['user'],'pass':_0x5f2001[_0xf10d('0x19b')]['pass']};}if(this['isConfigured'](_0x5c2e3d['template_id'])){}logger[_0xf10d('0xe4')](_0xf10d('0x1a4'),JSON['stringify'](_0x5beb25));this['createSquareDetailsReport'][_0xf10d('0x74')](this,_0x5c2e3d,_0x5c2e3d[_0xf10d('0x199')]);this['channel'][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x1a5'),_0x5f2001[_0xf10d('0x18')]));this[_0xf10d('0x25')]['sync'](this,_0x2d9f5f,_0x5beb25);return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0x1a6'));};AGIVertices['prototype'][_0xf10d('0x1a7')]=function(_0x5da482){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x1a8'),_0x5da482[_0xf10d('0x38')]));return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0x1a9'));};AGIVertices['prototype']['sendSMS']=function(_0x31a928){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x1aa'),_0x31a928[_0xf10d('0x38')]));if(!this['isConfigured'](_0x31a928[_0xf10d('0x1ab')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0x1ac'));}var _0x4e060c=this[_0xf10d('0x33')][_0xf10d('0x74')](this,_0x31a928['sms_account_id']);if(!_0x4e060c){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x31a928,_0xf10d('0x1ad'));}var _0x38d036={'body':_0x31a928[_0xf10d('0x1ae')],'phone':_0x31a928['to']||'','SmsAccountId':_0x4e060c['id']};logger[_0xf10d('0xe4')](_0xf10d('0x1af'),JSON[_0xf10d('0x76')](_0x38d036));this['createSquareDetailsReport'][_0xf10d('0x74')](this,_0x31a928,_0x31a928[_0xf10d('0x1ab')]);this[_0xf10d('0xf')][_0xf10d('0xb1')](util['format'](_0xf10d('0x1b0'),_0x4e060c[_0xf10d('0x18')]));this[_0xf10d('0x35')][_0xf10d('0x74')](this,_0x38d036);return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0x1b1'));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x1b2')]=function(_0x1c8b6f){logger['info'](util[_0xf10d('0x2a')](_0xf10d('0x1b3'),_0x1c8b6f[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x1c8b6f['variable_id'])){return this[_0xf10d('0xf')]['error'](_0x1c8b6f,_0xf10d('0x1b4'));}var _0x5574f8=this[_0xf10d('0x12')][_0xf10d('0x74')](this,_0x1c8b6f['variable_id']);if(!_0x5574f8){return this[_0xf10d('0xf')]['error'](_0x1c8b6f,_0xf10d('0xdd'));}return this[_0xf10d('0xf')]['setVariable'](_0x5574f8,_0x1c8b6f[_0xf10d('0x1b5')]);};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x1b6')]=function(_0xa2e7ef){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x1b7'),_0xa2e7ef[_0xf10d('0x38')]));this['channel'][_0xf10d('0xb1')](_0xf10d('0x1b8'));if(_0xa2e7ef['answer']===_0xf10d('0x1b9')){this['channel'][_0xf10d('0xb1')](_0xf10d('0x1ba'));return this[_0xf10d('0xf')][_0xf10d('0xc3')]();}return this['channel'][_0xf10d('0xb1')]('Skipped\x20Answer');};AGIVertices[_0xf10d('0x1a')]['subproject']=function(_0x4cc3aa){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x1bb'),_0x4cc3aa[_0xf10d('0x38')]));if(!this['isConfigured'](_0x4cc3aa[_0xf10d('0x1bc')])){return this['channel'][_0xf10d('0x51')](_0x4cc3aa,_0xf10d('0x1bd'));}var _0x54e764=this[_0xf10d('0x1be')]['sync'](this,_0x4cc3aa[_0xf10d('0x1bc')]);if(!this[_0xf10d('0x8c')](_0x54e764)){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x4cc3aa,util[_0xf10d('0x2a')](_0xf10d('0x1bf'),_0x4cc3aa[_0xf10d('0x1bc')]));}if(_0x54e764===this[_0xf10d('0xf')][_0xf10d('0x3e')]){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x4cc3aa,_0xf10d('0x1c0'));}this['createSquareDetailsReport'][_0xf10d('0x74')](this,_0x4cc3aa,_0x54e764);var _0x5081d8=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0x1c1'),util[_0xf10d('0x2a')](_0xf10d('0x1c2'),config['agi']['host']||'127.0.0.1',_0x54e764,this[_0xf10d('0xf')][_0xf10d('0x3e')]));if(_0x5081d8['result']===-0x1){return _0x5081d8;}return this['channel'][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x16f'),_0xf10d('0x1c1'),_0x54e764));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x1c3')]=function(_0x5e9184){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x5e9184[_0xf10d('0x38')]));var _0x5bad8e=this[_0xf10d('0x1c4')][_0xf10d('0x74')](this,_0x5e9184[_0xf10d('0x1c5')]);this[_0xf10d('0x36')]['sync'](this,_0x5e9184,_0x5e9184['command']);if(this[_0xf10d('0x8c')](_0x5e9184[_0xf10d('0xdb')])){var _0x3f41e2=this[_0xf10d('0x12')]['sync'](this,_0x5e9184[_0xf10d('0xdb')]);if(_0x3f41e2){this[_0xf10d('0xf')][_0xf10d('0xac')](_0x3f41e2,_0x5bad8e);return this[_0xf10d('0xf')][_0xf10d('0xb1')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x5e9184[_0xf10d('0x1c5')],_0x3f41e2));}}return this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x1c6'),_0x5e9184[_0xf10d('0x1c5')]));};AGIVertices['prototype'][_0xf10d('0x1c7')]=function(_0x490a18){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x1c8'),_0x490a18[_0xf10d('0x38')]));_0x490a18[_0xf10d('0x5d')]=_0x490a18[_0xf10d('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf10d('0x8c')](_0x490a18[_0xf10d('0x5b')])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0x1c9'));}if(!this[_0xf10d('0x8c')](_0x490a18[_0xf10d('0x5d')])){return this[_0xf10d('0xf')]['noop'](_0xf10d('0xb2'));}this['channel'][_0xf10d('0xb1')](util['format'](_0xf10d('0x1ca'),_0x490a18['text']));var _0x50d4a3=this[_0xf10d('0x5a')][_0xf10d('0x74')](this,_0x490a18);if(_0x50d4a3){this['channel']['noop'](util[_0xf10d('0x2a')](_0xf10d('0x1cb'),_0x50d4a3));var _0x241f6c=this['channel']['streamFile'](_0x50d4a3);try{fs[_0xf10d('0x129')](_0x50d4a3+_0xf10d('0x106'));}catch(_0x527de0){logger[_0xf10d('0x51')](_0x527de0);}return _0x241f6c;}return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x490a18,_0xf10d('0x1cc'));};AGIVertices['prototype'][_0xf10d('0x1cd')]=function(_0x2dc72f){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0x1ce'),_0x2dc72f[_0xf10d('0x38')]));_0x2dc72f[_0xf10d('0x5d')]=_0x2dc72f['text'][_0xf10d('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2dc72f['text'])){return this[_0xf10d('0xf')][_0xf10d('0xb1')](_0xf10d('0xb2'));}this['channel']['noop'](util[_0xf10d('0x2a')]('Trying\x20Google\x20TTS\x20%s',_0x2dc72f[_0xf10d('0x5d')]));var _0x443677=this[_0xf10d('0x64')][_0xf10d('0x74')](this,_0x2dc72f);if(_0x443677){this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')]('Google\x20TTS\x20%s\x20file\x20created',_0x443677));var _0x4f4c01=this[_0xf10d('0xf')][_0xf10d('0x128')](_0x443677);try{fs['unlink'](_0x443677+_0xf10d('0x106'));}catch(_0x2158e6){logger['error'](_0x2158e6);}return _0x4f4c01;}return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x2dc72f,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x1cf')]=function(_0x5a9e23){logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5a9e23['label']));if(!this[_0xf10d('0x8c')](_0x5a9e23[_0xf10d('0x157')])){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x5a9e23,'no\x20find\x20by\x20configured');}logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x16a'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5a9e23['findBy']));var _0x2ca89d=this['agentUnpause']['sync'](this,_0x5a9e23[_0xf10d('0x157')]);if(_0x2ca89d){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0x159'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5a9e23['findBy']));this['channel'][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x159'),this['channel']['callerid'],_0x5a9e23['findBy']));return{'code':0xc8,'result':_0xf10d('0x15a')};}else{logger[_0xf10d('0x2f')](util[_0xf10d('0x2a')](_0xf10d('0x15b'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5a9e23[_0xf10d('0x157')]));this[_0xf10d('0xf')][_0xf10d('0xb1')](util[_0xf10d('0x2a')](_0xf10d('0x15b'),this[_0xf10d('0xf')][_0xf10d('0x39')],_0x5a9e23[_0xf10d('0x157')]));return{'code':0xc8,'result':_0xf10d('0x15e')};}};AGIVertices['prototype'][_0xf10d('0x1d0')]=function(_0x2d1542){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0x1d1'),_0x2d1542['label']));var _0x8d61cb=this[_0xf10d('0xf')][_0xf10d('0x57')](_0xf10d('0x1d2'),[_0x2d1542[_0xf10d('0x1d3')],_0x2d1542[_0xf10d('0x7d')]]);if(_0x8d61cb[_0xf10d('0xaa')]===-0x1){return _0x8d61cb;}return this['channel'][_0xf10d('0xb1')](util['format'](_0xf10d('0x16f'),_0xf10d('0x1d2'),_0x2d1542[_0xf10d('0x1d3')]));};AGIVertices[_0xf10d('0x1a')][_0xf10d('0x1d4')]=function(_0x228753){logger[_0xf10d('0x2f')](util['format'](_0xf10d('0x1d5'),_0x228753[_0xf10d('0x38')]));if(!this[_0xf10d('0x8c')](_0x228753[_0xf10d('0xdb')])){return this[_0xf10d('0xf')]['error'](_0x228753,_0xf10d('0x1b4'));}var _0x1d2830=this['getVariable'][_0xf10d('0x74')](this,_0x228753[_0xf10d('0xdb')]);if(!_0x1d2830){return this[_0xf10d('0xf')][_0xf10d('0x51')](_0x228753,'no\x20variable\x20found');}var _0x2cf1b8=this[_0xf10d('0xf')][_0xf10d('0x12')](_0x1d2830);return{'code':0xc8,'result':_0x2cf1b8['extra']?_0x2cf1b8[_0xf10d('0xa8')]:'-'};};String['prototype'][_0xf10d('0xa7')]=function(_0x79095b,_0x4fc068){return this['split'](_0x79095b)['join'](_0x4fc068);};module[_0xf10d('0x1d6')]=AGIVertices; \ No newline at end of file +var _0xbedb=['Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','variable_id','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','recordFile','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','200','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','exports','path','util','lodash','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','createSquareRecording','callerid','context','extension','arg_1','file','createSquareMessage','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','timeout','includes','POST','method','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','uri','render','url','stringify','statusMessage','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','agicommand','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','toString','getAndSetVariable','result','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','list_id','no\x20list\x20selected','delay','add','minutes','createCmContact','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','query','no\x20query\x20configured','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','dialogflow'];(function(_0x1874b8,_0x2f5ac7){var _0x3b76be=function(_0x5d9753){while(--_0x5d9753){_0x1874b8['push'](_0x1874b8['shift']());}};_0x3b76be(++_0x2f5ac7);}(_0xbedb,0xe3));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0xbbed('0x0'));var util=require(_0xbbed('0x1'));var _=require(_0xbbed('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0xbbed('0x3'));var Mustache=require(_0xbbed('0x4'));var rp=require(_0xbbed('0x5'));var logger=require('../../config/logger')(_0xbbed('0x6'));var config=require(_0xbbed('0x7'));var scripts=require(_0xbbed('0x8'));var FILES_PATH=_0xbbed('0x9');var recursiveMapAttributes=[_0xbbed('0xa'),'rawBody'];var verticesWithRetry=['menu',_0xbbed('0xb'),_0xbbed('0xc')];var AGIVertices=function(_0x3a6f5f,_0x206135,_0x5adb0b){this['channel']=_0x3a6f5f;this[_0xbbed('0xd')]=_0x206135;this[_0xbbed('0xe')]=_0x5adb0b;};AGIVertices[_0xbbed('0xf')][_0xbbed('0x10')]=function(_0x5f30e3,_0x1b9ee3){this[_0xbbed('0xd')]['getVariableById'](_0x5f30e3)[_0xbbed('0x11')](function(_0x82e53a){_0x1b9ee3(null,_0x82e53a?_0x82e53a[_0xbbed('0x12')]:![]);})[_0xbbed('0x13')](function(_0x8a2b56){_0x1b9ee3(_0x8a2b56);});};AGIVertices[_0xbbed('0xf')]['getVoiceQueue']=function(_0x1f3388,_0x52fb0a){this[_0xbbed('0xd')][_0xbbed('0x14')](_0x1f3388)[_0xbbed('0x11')](function(_0x510fb1){_0x52fb0a(null,_0x510fb1?_0x510fb1[_0xbbed('0x12')]:![]);})[_0xbbed('0x13')](function(_0x163871){_0x52fb0a(_0x163871);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x15')]=function(_0x1c98e1,_0x3d6e8b){this[_0xbbed('0xd')][_0xbbed('0x16')](_0x1c98e1)[_0xbbed('0x11')](function(_0x314546){_0x3d6e8b(null,_0x314546?_0x314546[_0xbbed('0x12')]:![]);})[_0xbbed('0x13')](function(_0x4e1252){_0x3d6e8b(_0x4e1252);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x17')]=function(_0x582a01,_0x5c5c7c){this[_0xbbed('0xd')][_0xbbed('0x18')](_0x582a01)[_0xbbed('0x11')](function(_0x48e892){_0x5c5c7c(null,_0x48e892?_0x48e892[_0xbbed('0x19')]:![]);})[_0xbbed('0x13')](function(_0x371fc0){_0x5c5c7c(_0x371fc0);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x1a')]=function(_0x4bb68e,_0x3d58aa){this[_0xbbed('0xd')]['getUserById'](_0x4bb68e)[_0xbbed('0x11')](function(_0x1e3eeb){_0x3d58aa(null,_0x1e3eeb?_0x1e3eeb[_0xbbed('0x12')]:![]);})[_0xbbed('0x13')](function(_0x2c4d91){_0x3d58aa(_0x2c4d91);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x1b')]=function(_0x2fa198,_0x5767a0){this[_0xbbed('0xd')][_0xbbed('0x1c')](_0x2fa198)[_0xbbed('0x11')](function(_0x471e55){_0x5767a0(null,_0x471e55?_0x471e55[_0xbbed('0x12')]:![]);})[_0xbbed('0x13')](function(_0x1edc68){_0x5767a0(_0x1edc68);});};AGIVertices['prototype'][_0xbbed('0x1d')]=function(_0x5f4c2f,_0x29232f){var _0x3cf0c2=this;this[_0xbbed('0xd')][_0xbbed('0x1e')](_0x5f4c2f)[_0xbbed('0x11')](function(_0x341ea9){_0x29232f(null,_0x341ea9?_0x3cf0c2['getSoundPath'](_0x341ea9[_0xbbed('0x1f')]):![]);})[_0xbbed('0x13')](function(_0x54ac3a){_0x29232f(_0x54ac3a);});};AGIVertices[_0xbbed('0xf')]['getMailAccount']=function(_0x53ed9c,_0x22070c){this[_0xbbed('0xd')][_0xbbed('0x20')](_0x53ed9c)['then'](function(_0x1d5f45){_0x22070c(null,_0x1d5f45?_0x1d5f45:![]);})[_0xbbed('0x13')](function(_0x2a8b62){_0x22070c(_0x2a8b62);});};AGIVertices['prototype'][_0xbbed('0x21')]=function(_0x1d437e,_0x11f6aa,_0x220468){this[_0xbbed('0xe')][_0xbbed('0x21')](_0x1d437e,_0x11f6aa)['then'](function(){_0x220468(null);})['catch'](function(_0x1a02d7){_0x220468(_0x1a02d7);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x22')]=function(_0x9adcf,_0x4a7374){this[_0xbbed('0xd')][_0xbbed('0x23')](_0x9adcf)['then'](function(_0x2565a9){if(_0x2565a9){if(_0x2565a9[_0xbbed('0x24')]){_0x4a7374(null,[_0x2565a9[_0xbbed('0x25')]]);}else{_0x4a7374(null,_[_0xbbed('0x26')](_0x2565a9[_0xbbed('0x27')],_0xbbed('0x25')));}}else{_0x4a7374(null,![]);}})['catch'](function(_0x2f2762){_0x4a7374(_0x2f2762);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x28')]=function(_0x1fc40e){return util[_0xbbed('0x29')](_0xbbed('0x2a'),FILES_PATH,_0x1fc40e);};AGIVertices[_0xbbed('0xf')][_0xbbed('0x2b')]=function(_0x36ed88,_0x234300,_0x54d319){odbc[_0xbbed('0x2c')](_0x36ed88,function(_0x37c16){if(_0x37c16){logger[_0xbbed('0x2d')](_0xbbed('0x2e'),_0x37c16);_0x54d319(_0x37c16);}else{logger['info'](_0xbbed('0x2f'));odbc['query'](_0x234300,function(_0x4903cd,_0x3d24c5){if(_0x4903cd){logger[_0xbbed('0x30')]('Error\x20executing\x20query\x20%s',_0x234300);_0x54d319(_0x4903cd);}else{logger['info'](_0xbbed('0x31'),_0x234300);odbc[_0xbbed('0x32')](function(_0x57e8f4){if(_0x57e8f4){logger[_0xbbed('0x2d')](_0xbbed('0x33'),_0x57e8f4);}_0x54d319(null,_0x3d24c5);});}});}});};AGIVertices['prototype'][_0xbbed('0x34')]=function(_0x22831f,_0x2363f0){this['rpc'][_0xbbed('0x35')](_0x22831f)['then'](function(_0x1a0e05){_0x2363f0(null,_0x1a0e05?_0x1a0e05:![]);})[_0xbbed('0x13')](function(_0xd04651){_0x2363f0(_0xd04651);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x36')]=function(_0x841430,_0x3c1a36){this[_0xbbed('0xd')][_0xbbed('0x36')](_0x841430)[_0xbbed('0x11')](function(_0x3c6815){_0x3c1a36(null,_0x3c6815);})[_0xbbed('0x13')](function(_0x1dff3a){_0x3c1a36(_0x1dff3a);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x37')]=function(_0x56d88a,_0x274272,_0x3276c4){this[_0xbbed('0xd')][_0xbbed('0x37')]({'uniqueid':this[_0xbbed('0x38')][_0xbbed('0x39')],'node':_0x56d88a['label'],'application':_0x56d88a['agicommand'],'data':_0x274272||null,'project_name':this['channel']['arg_1'],'callerid':this[_0xbbed('0x38')]['callerid']})['then'](function(_0x3e427d){if(_0x3276c4){_0x3276c4(null,_0x3e427d);}})[_0xbbed('0x13')](function(_0x12fdbe){if(_0x3276c4){_0x3276c4(_0x12fdbe);}});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x3a')]=function(_0x464530,_0x288b96,_0x397a3a,_0x225f21){this[_0xbbed('0xd')][_0xbbed('0x3a')]({'uniqueid':this[_0xbbed('0x38')][_0xbbed('0x39')],'callerid':this[_0xbbed('0x38')][_0xbbed('0x3b')],'calleridname':this[_0xbbed('0x38')]['calleridname'],'context':this['channel'][_0xbbed('0x3c')],'extension':this['channel'][_0xbbed('0x3d')],'priority':this[_0xbbed('0x38')]['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0xbbed('0x38')]['dnid'],'projectName':this[_0xbbed('0x38')][_0xbbed('0x3e')],'saveName':_0x288b96,'filename':_0x464530[_0xbbed('0x3f')]||_0x288b96,'savePath':_0x397a3a})[_0xbbed('0x11')](function(_0x35c9da){_0x225f21(null,_0x35c9da);})[_0xbbed('0x13')](function(_0x4e0c61){_0x225f21(_0x4e0c61);});};AGIVertices['prototype'][_0xbbed('0x40')]=function(_0x4a5be6,_0x5cd5ee,_0x26b9c7,_0x166ff5,_0x1e2e59){this['rpc'][_0xbbed('0x40')]({'uniqueid':this[_0xbbed('0x38')][_0xbbed('0x39')],'body':_0x4a5be6,'direction':_0x5cd5ee,'providerName':_0x26b9c7,'providerResponse':_0x166ff5})['then'](function(_0x1968d4){if(_0x1e2e59){_0x1e2e59(null,_0x1968d4);}})['catch'](function(_0x48f871){if(_0x1e2e59){_0x1e2e59(_0x48f871);}});};AGIVertices[_0xbbed('0xf')]['createCmContact']=function(_0x7c5c49,_0x2bfa34){this[_0xbbed('0xd')]['createCmContact']({'firstName':_[_0xbbed('0x41')](_0x7c5c49['name'])||_[_0xbbed('0x42')](_0x7c5c49['name'])?_0xbbed('0x43')+Math[_0xbbed('0x44')]():_0x7c5c49[_0xbbed('0x12')],'lastName':_[_0xbbed('0x41')](_0x7c5c49[_0xbbed('0x45')])||_[_0xbbed('0x42')](_0x7c5c49[_0xbbed('0x45')])?null:_0x7c5c49[_0xbbed('0x45')],'phone':_0x7c5c49[_0xbbed('0x46')],'ListId':_0x7c5c49['list_id'],'scheduledat':_0x7c5c49[_0xbbed('0x47')],'callbackUniqueid':this[_0xbbed('0x38')][_0xbbed('0x39')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x7c5c49[_0xbbed('0x47')]['toString'](),'priority':_0x7c5c49[_0xbbed('0x48')]})[_0xbbed('0x11')](function(_0x5d1df0){_0x2bfa34(null,_0x5d1df0);})[_0xbbed('0x13')](function(_0x4b5edc){_0x2bfa34(_0x4b5edc);});};AGIVertices['prototype'][_0xbbed('0x49')]=function(_0x48992e,_0x465af2){this[_0xbbed('0xd')][_0xbbed('0x4a')](_0x48992e)[_0xbbed('0x11')](function(_0x218a4e){_0x465af2(null,_0x218a4e?_0x218a4e[_0xbbed('0x12')]:![]);})['catch'](function(_0x776560){_0x465af2(_0x776560);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x4b')]=function(_0xe7b128,_0x48c80d,_0x5f0a40){var _0x22d4a6={'role':_0xbbed('0x4c')};_0x22d4a6[_0xe7b128]=this[_0xbbed('0x38')][_0xbbed('0x3b')];this['rpc']['agentPause'](_0x22d4a6,_0x48c80d,this['channel'][_0xbbed('0x39')])[_0xbbed('0x11')](function(_0x5ced7c){_0x5f0a40(null,_[_0xbbed('0x42')](_0x5ced7c)?![]:!![]);})[_0xbbed('0x13')](function(_0x74be95){logger[_0xbbed('0x2d')](_0x74be95);_0x5f0a40(null,![]);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x4d')]=function(_0x4b7b4f,_0x368d9e){var _0x4e3bf4={'role':_0xbbed('0x4c')};_0x4e3bf4[_0x4b7b4f]=this['channel'][_0xbbed('0x3b')];this[_0xbbed('0xd')][_0xbbed('0x4d')](_0x4e3bf4)[_0xbbed('0x11')](function(_0x5db810){_0x368d9e(null,_[_0xbbed('0x42')](_0x5db810)?![]:!![]);})[_0xbbed('0x13')](function(_0x36665e){logger[_0xbbed('0x2d')](_0x36665e);_0x368d9e(null,![]);});};AGIVertices[_0xbbed('0xf')]['agentLogout']=function(_0x137aea,_0x2992a4){var _0x4651d3={'role':'agent'};_0x4651d3[_0x137aea]=this[_0xbbed('0x38')][_0xbbed('0x3b')];this[_0xbbed('0xd')]['agentLogout'](_0x4651d3)[_0xbbed('0x11')](function(_0x1d68f9){_0x2992a4(null,_[_0xbbed('0x42')](_0x1d68f9)?![]:!![]);})[_0xbbed('0x13')](function(_0x50611f){logger[_0xbbed('0x2d')](_0x50611f);_0x2992a4(null,![]);});};AGIVertices['prototype'][_0xbbed('0x4e')]=function(_0x2eb39d,_0x407fa5){var _0x580165={'role':_0xbbed('0x4c')};_0x580165[_0x2eb39d]=this[_0xbbed('0x38')][_0xbbed('0x3b')];var _0x3190ee=_0x2eb39d!=_0xbbed('0x4f')?util[_0xbbed('0x29')](_0xbbed('0x50'),'LOCAL',this[_0xbbed('0x38')][_0xbbed('0x3b')]):undefined;this[_0xbbed('0xd')][_0xbbed('0x4e')](_0x580165,_0x3190ee)['then'](function(_0x104843){_0x407fa5(null,_[_0xbbed('0x42')](_0x104843)?![]:!![]);})[_0xbbed('0x13')](function(_0x1299fc){logger['error'](_0x1299fc);_0x407fa5(null,![]);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x51')]=function(_0x27ffe5,_0x3fe790){sh[_0xbbed('0x52')](_[_0xbbed('0x53')](_0x27ffe5),function(_0x49eba4,_0x1bf9db){var _0x38268c=_0x1bf9db['replace'](/(\r\n|\n|\r)/gm,'');_0x3fe790(null,_0x38268c);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x54')]=function(_0x35950d,_0xa48891){scripts[_0xbbed('0x54')](_0x35950d['apiKey'],_0x35950d[_0xbbed('0x55')]||_0xbbed('0x56'),_0x35950d['text'],_0x35950d[_0xbbed('0x57')]||_0xbbed('0x58'),_0x35950d[_0xbbed('0x59')]||'MALE',_0x35950d[_0xbbed('0x5a')]||'MP3')['then'](function(_0xbb1e6d){_0xa48891(null,_0xbb1e6d);})['catch'](function(_0x59ab33){_0xa48891(_0x59ab33);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x5b')]=function(_0x3cb54e,_0x48043b){scripts[_0xbbed('0x5b')](_0x3cb54e[_0xbbed('0x56')],_0x3cb54e[_0xbbed('0x5c')]||'en',0x1)[_0xbbed('0x11')](function(_0x4cfb80){_0x48043b(null,_0x4cfb80);})[_0xbbed('0x13')](function(_0x141cd6){_0x48043b(_0x141cd6);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x5d')]=function(_0x1a7a2f,_0x4ef7bf){var _0x500211={'uri':_0x1a7a2f['url'],'method':_0x1a7a2f['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1a7a2f[_0xbbed('0x5e')])==='number'&&parseInt(_0x1a7a2f[_0xbbed('0x5e')])>=0x1?parseInt(_0x1a7a2f[_0xbbed('0x5e')])*0x3e8:0x5*0x3e8};if(_[_0xbbed('0x5f')]([_0xbbed('0x60'),'PUT'],_0x500211[_0xbbed('0x61')][_0xbbed('0x62')]())){try{_0x500211[_0xbbed('0x63')]=_0x1a7a2f[_0xbbed('0x64')]?JSON[_0xbbed('0x65')](_0x1a7a2f[_0xbbed('0x64')]):{};}catch(_0x5554a9){logger[_0xbbed('0x2d')](_0xbbed('0x66'),_0x5554a9);}}try{_0x500211[_0xbbed('0x67')]=_0x1a7a2f['rawHeaders']?JSON[_0xbbed('0x65')](_0x1a7a2f[_0xbbed('0xa')]):{};}catch(_0x2c8a5c){logger[_0xbbed('0x2d')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2c8a5c);}if(_0x1a7a2f[_0xbbed('0x68')]){try{var _0x2d6818=require(_0x1a7a2f[_0xbbed('0x68')])['sync'](this,_0x500211);_0x500211[_0xbbed('0x69')]=Mustache[_0xbbed('0x6a')](_0x1a7a2f[_0xbbed('0x6b')],_0x2d6818,{},['$$','$$']);if(_0x500211[_0xbbed('0x67')]){_0x500211['headers']=JSON[_0xbbed('0x65')](Mustache[_0xbbed('0x6a')](JSON[_0xbbed('0x6c')](_0x500211[_0xbbed('0x67')]),_0x2d6818,{},['$$','$$']));}if(_0x500211[_0xbbed('0x63')]){_0x500211[_0xbbed('0x63')]=JSON[_0xbbed('0x65')](Mustache['render'](JSON['stringify'](_0x500211[_0xbbed('0x63')]),_0x2d6818,{},['$$','$$']));}}catch(_0x2f2884){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2f2884);}}rp(_0x500211)[_0xbbed('0x11')](function(_0x30bfb2){var _0x3f80d4={'statusCode':_0x30bfb2['statusCode']||0xc8,'statusMessage':_0x30bfb2[_0xbbed('0x6d')]||'OK','headers':_0x30bfb2[_0xbbed('0x67')]||{},'body':_0x30bfb2[_0xbbed('0x63')]||{}};_0x4ef7bf(null,_0x3f80d4);})[_0xbbed('0x13')](function(_0x1d0c59){var _0x45a99c={'statusCode':_0x1d0c59[_0xbbed('0x6e')]||0x1f4,'statusMessage':_0x1d0c59[_0xbbed('0x6f')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x1d0c59[_0xbbed('0x70')][_0xbbed('0x67')]||{},'body':_0x1d0c59[_0xbbed('0x70')][_0xbbed('0x63')]||{}};_0x4ef7bf(null,_0x45a99c);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x71')]=function(_0x309605,_0x2d61f1){scripts[_0xbbed('0x71')](this[_0xbbed('0x38')][_0xbbed('0x39')],_0x309605[_0xbbed('0x72')],_0x309605[_0xbbed('0x56')],_0x309605[_0xbbed('0x73')]||'en')[_0xbbed('0x11')](function(_0x346945){_0x2d61f1(null,_0x346945);})[_0xbbed('0x13')](function(_0x74d1cc){_0x2d61f1(_0x74d1cc);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x74')]=function(_0x13c782,_0x5124ef){scripts[_0xbbed('0x74')](this[_0xbbed('0x38')][_0xbbed('0x39')],_0x13c782[_0xbbed('0x75')],_0x13c782[_0xbbed('0x76')],_0x13c782[_0xbbed('0x77')],_0x13c782[_0xbbed('0x56')],_0x13c782['dialogflowV2_language']||'en')[_0xbbed('0x11')](function(_0x2ef795){_0x5124ef(null,_0x2ef795);})[_0xbbed('0x13')](function(_0x4861df){_0x5124ef(_0x4861df);});};AGIVertices['prototype']['sestekNDA']=function(_0x1cee8c,_0x1dbe39){scripts[_0xbbed('0x78')](this[_0xbbed('0x38')],_0x1cee8c)[_0xbbed('0x11')](function(_0x3bc5fd){_0x1dbe39(null,_0x3bc5fd);})['catch'](function(_0x150228){_0x1dbe39(_0x150228);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x79')]=function(_0x257639,_0xc8c7bc){scripts['ispeechTTS'](_0x257639[_0xbbed('0x72')],_0x257639[_0xbbed('0x56')],_0x257639[_0xbbed('0x7a')]||_0xbbed('0x58'),_0x257639[_0xbbed('0x7b')])['then'](function(_0x29d5c7){_0xc8c7bc(null,_0x29d5c7);})['catch'](function(_0x3950ff){_0xc8c7bc(_0x3950ff);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x7c')]=function(_0x39ff4e,_0xc38ca0,_0x28bcf0){scripts[_0xbbed('0x7c')](_0xc38ca0,_0x39ff4e['key'],_0x39ff4e[_0xbbed('0x7d')]||'en-US',this[_0xbbed('0x7e')](_0x39ff4e[_0xbbed('0x7f')])?_0x39ff4e[_0xbbed('0x7f')]:undefined)[_0xbbed('0x11')](function(_0x180444){_0x28bcf0(null,_0x180444);})[_0xbbed('0x13')](function(_0x5b5748){_0x28bcf0(_0x5b5748);});};AGIVertices[_0xbbed('0xf')]['awsPolly']=function(_0x355219,_0x2897b1){scripts[_0xbbed('0x80')](_0x355219[_0xbbed('0x81')],_0x355219[_0xbbed('0x82')],_0x355219[_0xbbed('0x83')],_0x355219[_0xbbed('0x84')]||_0xbbed('0x85'),_0x355219['text'],_0x355219[_0xbbed('0x86')]||_0xbbed('0x56'))[_0xbbed('0x11')](function(_0x427b53){_0x2897b1(null,_0x427b53);})[_0xbbed('0x13')](function(_0xb68ab3){_0x2897b1(_0xb68ab3);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x87')]=function(_0x58a064,_0x3c3176){scripts[_0xbbed('0x87')](this[_0xbbed('0x38')]['uniqueid'],_0x58a064[_0xbbed('0x81')],_0x58a064['aws_secret_access_key'],_0x58a064[_0xbbed('0x88')],_0x58a064[_0xbbed('0x56')],_0x58a064[_0xbbed('0x89')])[_0xbbed('0x11')](function(_0x4e3999){_0x3c3176(null,_0x4e3999);})[_0xbbed('0x13')](function(_0xaca505){_0x3c3176(_0xaca505);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x8a')]=function(_0x51777d,_0x1fb9b5,_0x2c1112){scripts[_0xbbed('0x8a')](_0x1fb9b5,_0x51777d[_0xbbed('0x72')],_0x51777d[_0xbbed('0x8b')]||'en-US')[_0xbbed('0x11')](function(_0xf7bbd1){_0x2c1112(null,_0xf7bbd1);})['catch'](function(_0x50610b){_0x2c1112(_0x50610b);});};AGIVertices[_0xbbed('0xf')][_0xbbed('0x8c')]=function(_0x5e327d,_0x467d21,_0x457ad9){scripts[_0xbbed('0x8c')](_0x467d21,_0x5e327d[_0xbbed('0x8d')],_0x5e327d[_0xbbed('0x8e')],_0x5e327d[_0xbbed('0x69')])['then'](function(_0x448183){_0x457ad9(null,_0x448183);})[_0xbbed('0x13')](function(_0xc0f08a){_0x457ad9(_0xc0f08a);});};AGIVertices[_0xbbed('0xf')]['clear']=function(_0x203cc8){var _0x547da1=_[_0xbbed('0x5f')](verticesWithRetry,_0x203cc8[_0xbbed('0x8f')])?_0x203cc8:_['clone'](_0x203cc8);for(var _0x5bef45 in _0x547da1){if(_0x547da1[_0xbbed('0x90')](_0x5bef45)){if(_0x547da1[_0x5bef45]&&_[_0xbbed('0x91')](_0x547da1[_0x5bef45])){if(_[_0xbbed('0x5f')](recursiveMapAttributes,_0x5bef45)){_0x547da1[_0x5bef45]=this[_0xbbed('0x92')](_0x547da1[_0x5bef45]);}else{_0x547da1[_0x5bef45]=this[_0xbbed('0x93')](_0x547da1[_0x5bef45]);}}}}return _0x547da1;};AGIVertices[_0xbbed('0xf')]['recursiveNodeIndex']=function(_0x3950f1){for(var _0x1e2e5a in _0x3950f1){if(_0x3950f1[_0xbbed('0x90')](_0x1e2e5a)){if(_[_0xbbed('0x94')](_0x3950f1[_0x1e2e5a])){this[_0xbbed('0x95')](_0x3950f1[_0x1e2e5a]);}else if(_[_0xbbed('0x96')](_0x3950f1[_0x1e2e5a])){for(var _0x4e3f8e=0x0;_0x4e3f8e<_0x3950f1[_0x1e2e5a][_0xbbed('0x97')];_0x4e3f8e++){this['recursiveNodeIndex'](_0x3950f1[_0x1e2e5a][_0x4e3f8e]);}}else if(_[_0xbbed('0x91')](_0x3950f1[_0x1e2e5a])){_0x3950f1[_0x1e2e5a]=this[_0xbbed('0x93')](_0x3950f1[_0x1e2e5a]);}}}};AGIVertices[_0xbbed('0xf')][_0xbbed('0x98')]=function(_0x227066,_0x2a5637){for(var _0x1406bf in _0x227066){if(_0x227066[_0xbbed('0x90')](_0x1406bf)){if(_[_0xbbed('0x94')](_0x227066[_0x1406bf])){if(!_[_0xbbed('0x41')](_0x227066[_0x1406bf])){this[_0xbbed('0x98')](_0x227066[_0x1406bf],util[_0xbbed('0x29')](_0xbbed('0x99'),_0x2a5637,_0x1406bf));}}else if(_[_0xbbed('0x96')](_0x227066[_0x1406bf])){for(var _0x40f99c=0x0;_0x40f99c<_0x227066[_0x1406bf]['length'];_0x40f99c++){this[_0xbbed('0x98')](_0x227066[_0x1406bf][_0x40f99c],util['format'](_0xbbed('0x99'),_0x2a5637,_0x1406bf+'['+_0x40f99c+']'));}}else{if(!_[_0xbbed('0x42')](_0x227066[_0x1406bf])){this[_0xbbed('0x38')][_0xbbed('0x9a')](util['format'](_0xbbed('0x99'),_0x2a5637,_0x1406bf),_0x227066[_0x1406bf]);}}}}};AGIVertices[_0xbbed('0xf')][_0xbbed('0x92')]=function(_0x585f92){try{var _0x1321c2=JSON['parse'](_0x585f92);this['recursiveNodeIndex'](_0x1321c2);return JSON['stringify'](_0x1321c2);}catch(_0x42d0ef){return this['replaceAllVariables'](_0x585f92);}};AGIVertices[_0xbbed('0xf')][_0xbbed('0x93')]=function(_0x2387a3){var _0x495ec9=_0x2387a3[_0xbbed('0x9b')]('{');for(var _0xb35aea=0x1;_0xb35aea<_0x495ec9['length'];_0xb35aea+=0x1){var _0x1d4393=_0x495ec9[_0xb35aea][_0xbbed('0x9b')]('}');if(_0x1d4393['length']>0x1){_0x2387a3=_0x2387a3[_0xbbed('0x9c')]('{'+_0x1d4393[0x0]+'}',this['channel'][_0xbbed('0x10')](_0x1d4393[0x0])['extra']||_0x1d4393[0x0]);}}if(_0x495ec9[_0xbbed('0x97')]===0x1){return _0x2387a3[_0xbbed('0x9d')]();}return this[_0xbbed('0x93')](_0x2387a3);};AGIVertices[_0xbbed('0xf')][_0xbbed('0x9e')]=function(_0x4a5720,_0x4e9c94){var _0x5aaa3e=this[_0xbbed('0x38')][_0xbbed('0x10')](_0x4a5720);if(_0x5aaa3e[_0xbbed('0x9f')]===-0x1){return _0x5aaa3e;}logger[_0xbbed('0x30')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4e9c94,_0x5aaa3e[_0xbbed('0xa0')]));return this[_0xbbed('0x38')][_0xbbed('0x9a')](_0x4e9c94,_0x5aaa3e['extra']);};AGIVertices['prototype'][_0xbbed('0x7e')]=function(_0x20937e){return _0x20937e&&_0x20937e!=='0'&&_0x20937e!=='-1'&&_0x20937e!=='';};AGIVertices[_0xbbed('0xf')][_0xbbed('0xa1')]=function(_0x28eb66){this['createSquareDetailsReport']['sync'](this,_0x28eb66,'-');_0x28eb66[_0xbbed('0xa2')]=_0x28eb66['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbbed('0xf')][_0xbbed('0xa3')]=function(_0x1891c5){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0xa4'),_0x1891c5[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x1891c5[_0xbbed('0x56')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xa7'));}var _0x19ac63='\x22'+_0x1891c5[_0xbbed('0x56')]+'\x22';if(this[_0xbbed('0x7e')](_0x1891c5[_0xbbed('0x70')])){_0x19ac63+=','+_0x1891c5['options'];}var _0x1be52c=this['channel'][_0xbbed('0x52')](_0xbbed('0xa8'),_0x19ac63);if(_0x1be52c['result']===-0x1){return _0x1be52c;}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0xa9'),_0x19ac63));};AGIVertices[_0xbbed('0xf')][_0xbbed('0xaa')]=function(_0x460c11){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0xab'),_0x460c11[_0xbbed('0xa5')]));if(!this['isConfigured'](_0x460c11[_0xbbed('0xac')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xad'));}var _0x21937f=_0x460c11['grammar'];if(this[_0xbbed('0x7e')](_0x460c11[_0xbbed('0x70')])){_0x21937f+=','+_0x460c11[_0xbbed('0x70')];}var _0x3c1b15=this[_0xbbed('0x38')][_0xbbed('0x52')]('MRCPRecog',_0x21937f);if(_0x3c1b15[_0xbbed('0x9f')]===-0x1){return _0x3c1b15;}var _0x5ba264=this[_0xbbed('0x9e')](_0xbbed('0xae'),_0xbbed('0xaf'));if(_0x5ba264[_0xbbed('0x9f')]===-0x1){return _0x5ba264;}var _0x262f29=this[_0xbbed('0x9e')](_0xbbed('0xb0'),_0xbbed('0xb1'));if(_0x262f29[_0xbbed('0x9f')]===-0x1){return _0x262f29;}var _0x58e26b=this[_0xbbed('0x9e')](_0xbbed('0xb2'),'MRCP_RECOG_INSTANCE');if(_0x58e26b['result']===-0x1){return _0x58e26b;}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format'](_0xbbed('0xb3'),_0x21937f));};AGIVertices[_0xbbed('0xf')]['agi']=function(_0x14833a){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0xb4'),_0x14833a[_0xbbed('0xa5')]));return this['channel'][_0xbbed('0x6')]([_0x14833a[_0xbbed('0xb5')],_0x14833a[_0xbbed('0xb6')]]);};AGIVertices['prototype'][_0xbbed('0xb7')]=function(_0x57b77b){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x57b77b[_0xbbed('0xa5')]));if(this[_0xbbed('0x7e')](_0x57b77b[_0xbbed('0x5e')])){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0xb8'),_0x57b77b['timeout']));var _0xc632c9=this[_0xbbed('0x38')][_0xbbed('0xb9')](_0x57b77b[_0xbbed('0x5e')]);if(_0xc632c9['result']===-0x1){return _0xc632c9;}}return this[_0xbbed('0x38')][_0xbbed('0xb7')]();};AGIVertices[_0xbbed('0xf')][_0xbbed('0xba')]=function(_0x2a5ef4){logger['info'](util[_0xbbed('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x2a5ef4[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x2a5ef4[_0xbbed('0xbb')])){return this[_0xbbed('0x38')]['error'](_0x2a5ef4,_0xbbed('0xbc'));}_0x2a5ef4[_0xbbed('0x47')]=moment();if(this[_0xbbed('0x7e')](_0x2a5ef4[_0xbbed('0xbd')])){_0x2a5ef4[_0xbbed('0x47')]=moment()[_0xbbed('0xbe')](_0x2a5ef4[_0xbbed('0xbd')],_0xbbed('0xbf'));}if(!this[_0xbbed('0x7e')](_0x2a5ef4[_0xbbed('0x48')])){_0x2a5ef4[_0xbbed('0x48')]=0x2;}this[_0xbbed('0xc0')][_0xbbed('0xc1')](this,_0x2a5ef4);return this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format'](_0xbbed('0xc2'),_0x2a5ef4[_0xbbed('0x46')],_0x2a5ef4[_0xbbed('0xbb')],_0x2a5ef4[_0xbbed('0x47')]));};AGIVertices[_0xbbed('0xf')][_0xbbed('0xc3')]=function(_0x1cfcd0){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x1cfcd0['label']));var _0x159c69=this['channel'][_0xbbed('0x52')](_0x1cfcd0['application'],_0x1cfcd0[_0xbbed('0x70')]);if(_0x159c69[_0xbbed('0x9f')]===-0x1){return _0x159c69;}return this['channel'][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0xc4'),_0x1cfcd0[_0xbbed('0xc5')],_0x1cfcd0[_0xbbed('0x70')]));};AGIVertices['prototype'][_0xbbed('0xc6')]=function(_0x3ace9b){logger[_0xbbed('0x30')](util['format'](_0xbbed('0xc7'),_0x3ace9b[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x3ace9b[_0xbbed('0x56')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xa7'));}var _0x17f7b0='\x22'+_0x3ace9b[_0xbbed('0x56')]+'\x22';if(this[_0xbbed('0x7e')](_0x3ace9b[_0xbbed('0x70')])){_0x17f7b0+=','+_0x3ace9b[_0xbbed('0x70')];}var _0x1dd1b5=this['channel'][_0xbbed('0x52')](_0xbbed('0xa8'),_0x17f7b0);if(_0x1dd1b5[_0xbbed('0x9f')]===-0x1){return _0x1dd1b5;}return this[_0xbbed('0x38')]['noop'](util['format'](_0xbbed('0xa9'),_0x17f7b0));};AGIVertices[_0xbbed('0xf')][_0xbbed('0xc8')]=function(_0x58bab8){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0xc9'),_0x58bab8[_0xbbed('0xa5')]));if(!this['isConfigured'](_0x58bab8['text'])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xa7'));}var _0x569df6='\x22'+_0x58bab8[_0xbbed('0x56')]+'\x22';if(this['isConfigured'](_0x58bab8[_0xbbed('0x70')])){_0x569df6+=','+_0x58bab8[_0xbbed('0x70')];}var _0x43dd3a=this[_0xbbed('0x38')][_0xbbed('0x52')](_0xbbed('0xa8'),_0x569df6);if(_0x43dd3a['result']===-0x1){return _0x43dd3a;}return this[_0xbbed('0x38')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x569df6));};AGIVertices[_0xbbed('0xf')][_0xbbed('0xca')]=function(_0x1d961a){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1d961a[_0xbbed('0xa5')]));if(!this['isConfigured'](_0x1d961a['grammar'])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xad'));}var _0x29482b=_0x1d961a[_0xbbed('0xac')];if(this[_0xbbed('0x7e')](_0x1d961a[_0xbbed('0x70')])){_0x29482b+=','+_0x1d961a[_0xbbed('0x70')];}var _0x5029c9=this[_0xbbed('0x38')][_0xbbed('0x52')](_0xbbed('0xcb'),_0x29482b);if(_0x5029c9[_0xbbed('0x9f')]===-0x1){return _0x5029c9;}var _0x34c23b=this[_0xbbed('0x9e')]('RECOG_CONFIDENCE()',_0xbbed('0xcc'));if(_0x34c23b[_0xbbed('0x9f')]===-0x1){return _0x34c23b;}var _0x13364a=this[_0xbbed('0x9e')]('RECOG_INPUT()',_0xbbed('0xcd'));if(_0x13364a['result']===-0x1){return _0x13364a;}var _0x34782f=this['getAndSetVariable']('RECOG_INSTANCE()',_0xbbed('0xce'));if(_0x34782f[_0xbbed('0x9f')]===-0x1){return _0x34782f;}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0xb3'),_0x29482b));};AGIVertices[_0xbbed('0xf')]['sestekasr']=function(_0x54edc5){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0xcf'),_0x54edc5[_0xbbed('0xa5')]));if(!this['isConfigured'](_0x54edc5[_0xbbed('0xac')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xad'));}var _0x3e7c5a=_0x54edc5[_0xbbed('0xac')];if(this['isConfigured'](_0x54edc5[_0xbbed('0x70')])){_0x3e7c5a+=','+_0x54edc5['options'];}var _0x3004a4=this[_0xbbed('0x38')][_0xbbed('0x52')]('MRCPRecog',_0x3e7c5a);if(_0x3004a4[_0xbbed('0x9f')]===-0x1){return _0x3004a4;}var _0x257dec=this['getAndSetVariable'](_0xbbed('0xae'),_0xbbed('0xd0'));if(_0x257dec[_0xbbed('0x9f')]===-0x1){return _0x257dec;}var _0x119ca2=this[_0xbbed('0x9e')](_0xbbed('0xb0'),_0xbbed('0xd1'));if(_0x119ca2[_0xbbed('0x9f')]===-0x1){return _0x119ca2;}var _0x2cc729=this[_0xbbed('0x9e')]('RECOG_INSTANCE()',_0xbbed('0xd2'));if(_0x2cc729[_0xbbed('0x9f')]===-0x1){return _0x2cc729;}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0xb3'),_0x3e7c5a));};AGIVertices[_0xbbed('0xf')][_0xbbed('0xd3')]=function(_0x513ffc){logger[_0xbbed('0x30')](util['format'](_0xbbed('0xd4'),_0x513ffc['label']));if(!this[_0xbbed('0x7e')](_0x513ffc[_0xbbed('0xd5')])){return this['channel'][_0xbbed('0x2d')](_0x513ffc,'no\x20database\x20selected');}var _0x17b603=this[_0xbbed('0x17')]['sync'](this,_0x513ffc[_0xbbed('0xd5')]);if(!_0x17b603){return this[_0xbbed('0x38')]['error'](_0x513ffc,'no\x20odbc\x20database\x20found');}if(!this[_0xbbed('0x7e')](_0x513ffc[_0xbbed('0xd6')])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x513ffc,_0xbbed('0xd7'));}var _0x47fa8f=_0x513ffc['query'][_0xbbed('0xd8')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0xd9'),_0x47fa8f));var _0x4de4dc=this[_0xbbed('0x2b')]['sync'](this,_0x17b603,_0x47fa8f);this[_0xbbed('0x37')][_0xbbed('0xc1')](this,_0x513ffc,_0x47fa8f);if(!this[_0xbbed('0x7e')](_0x513ffc['variable_id'])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xda'));}var _0x7a2a05=this['getVariable'][_0xbbed('0xc1')](this,_0x513ffc['variable_id']);if(!_0x7a2a05){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x513ffc,_0xbbed('0xdb'));}var _0x5be37c=this;_0x4de4dc[_0xbbed('0xdc')](function(_0x11292e,_0x480ca1){Object[_0xbbed('0xdd')](_0x11292e)[_0xbbed('0xdc')](function(_0x486485){_0x5be37c[_0xbbed('0x38')][_0xbbed('0x9a')](util[_0xbbed('0x29')](_0xbbed('0xde'),_0x7a2a05,_0x480ca1,_0x486485),_0x11292e[_0x486485]);});});this[_0xbbed('0x38')]['setVariable'](util[_0xbbed('0x29')](_0xbbed('0xdf'),_0x7a2a05),_0x4de4dc['length']);return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')]('variable\x20%s\x20set',_0x7a2a05));};AGIVertices[_0xbbed('0xf')]['dial']=function(_0x20d41f){logger[_0xbbed('0xe0')](util['format'](_0xbbed('0xe1'),_0x20d41f[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x20d41f[_0xbbed('0xe2')])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x20d41f,'no\x20user\x20selected');}var _0x1d4986=this[_0xbbed('0x1a')]['sync'](this,_0x20d41f[_0xbbed('0xe2')]);if(!_0x1d4986){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x20d41f,_0xbbed('0xe3'));}var _0x56d0b5=this[_0xbbed('0x38')][_0xbbed('0x52')](_0xbbed('0xe4'),[util['format'](_0xbbed('0xe5'),_0x1d4986),_0x20d41f[_0xbbed('0x5e')],_0x20d41f[_0xbbed('0xe6')],_0x20d41f[_0xbbed('0x6b')]]);if(_0x56d0b5[_0xbbed('0x9f')]===-0x1){return _0x56d0b5;}return this['channel'][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0xe7'),_0xbbed('0xe4')));};AGIVertices['prototype']['dialogflow']=function(_0x477833){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0xe8'),_0x477833['label']));if(!this[_0xbbed('0x7e')](_0x477833['key'])){return this['channel'][_0xbbed('0xa6')]('no\x20key\x20configured');}if(!this[_0xbbed('0x7e')](_0x477833[_0xbbed('0x56')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')]('no\x20text\x20configured');}this[_0xbbed('0x38')][_0xbbed('0xe9')]=!![];this[_0xbbed('0x37')](_0x477833);this[_0xbbed('0x40')](_0x477833[_0xbbed('0x56')],'in','','');this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0xea'),_0x477833[_0xbbed('0x56')]));var _0x5b8a6e=this['googleDialogflow']['sync'](this,_0x477833);if(_0x5b8a6e){for(var _0x1fe65c in _0x5b8a6e){if(_0x5b8a6e[_0xbbed('0x90')](_0x1fe65c)){this[_0xbbed('0x38')][_0xbbed('0x9a')](util[_0xbbed('0x29')](_0xbbed('0xeb'),_0x1fe65c[_0xbbed('0x62')]()),_0x5b8a6e[_0x1fe65c]);}}this[_0xbbed('0x40')](_0x5b8a6e[_0xbbed('0xec')],'out',_0xbbed('0xed'),'');return this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format'](_0xbbed('0xee'),_0x5b8a6e[_0xbbed('0xec')]));}return this['channel'][_0xbbed('0x2d')](_0x477833,_0xbbed('0xef'));};AGIVertices['prototype'][_0xbbed('0xf0')]=function(_0x3b184d){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3b184d[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x3b184d[_0xbbed('0x75')])){return this[_0xbbed('0x38')]['noop'](_0xbbed('0xf1'));}if(!this[_0xbbed('0x7e')](_0x3b184d[_0xbbed('0x76')])){return this['channel'][_0xbbed('0xa6')](_0xbbed('0xf2'));}if(!this[_0xbbed('0x7e')](_0x3b184d[_0xbbed('0x77')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xf3'));}if(!this['isConfigured'](_0x3b184d[_0xbbed('0xf4')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xf5'));}if(!this[_0xbbed('0x7e')](_0x3b184d['text'])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xa7'));}this[_0xbbed('0x38')]['bot']=!![];this[_0xbbed('0x37')](_0x3b184d);this[_0xbbed('0x40')](_0x3b184d[_0xbbed('0x56')],'in','','');this['channel']['noop'](util[_0xbbed('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x3b184d['text']));var _0x3a7c82=this[_0xbbed('0x74')][_0xbbed('0xc1')](this,_0x3b184d);if(_0x3a7c82){for(var _0x5a2046 in _0x3a7c82){if(_0x3a7c82[_0xbbed('0x90')](_0x5a2046)){if(_0x5a2046!==_0xbbed('0xf6')){this[_0xbbed('0x38')]['setVariable'](util[_0xbbed('0x29')](_0xbbed('0xeb'),_0x5a2046[_0xbbed('0x62')]()),_0x3a7c82[_0x5a2046]);}}}this[_0xbbed('0x40')](_0x3a7c82[_0xbbed('0xec')],'out',_0xbbed('0xf0'),_0x3a7c82[_0xbbed('0xf6')]);return this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format']('DialogflowV2\x20Result\x20%s',_0x3a7c82[_0xbbed('0xec')]));}return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x3b184d,_0xbbed('0xf7'));};AGIVertices[_0xbbed('0xf')][_0xbbed('0xf8')]=function(_0x5af8b5){logger['info'](util[_0xbbed('0x29')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5af8b5['label']));if(!this[_0xbbed('0x7e')](_0x5af8b5[_0xbbed('0xf9')])){return this['channel'][_0xbbed('0xa6')](_0xbbed('0xfa'));}if(!this[_0xbbed('0x7e')](_0x5af8b5['username'])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xfb'));}if(!this[_0xbbed('0x7e')](_0x5af8b5[_0xbbed('0xfc')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xfd'));}if(!this[_0xbbed('0x7e')](_0x5af8b5[_0xbbed('0xfe')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')]('no\x20text\x20configured');}this[_0xbbed('0x38')][_0xbbed('0xe9')]=!![];this['createSquareDetailsReport'](_0x5af8b5);this[_0xbbed('0x40')](_0x5af8b5['text'],'in','','');this[_0xbbed('0x38')]['noop'](util['format'](_0xbbed('0xff'),_0x5af8b5[_0xbbed('0x56')]));var _0x1d246e=this['sestekNDA']['sync'](this,_0x5af8b5);if(_0x1d246e){for(var _0x1ff170 in _0x1d246e){if(_0x1d246e[_0xbbed('0x90')](_0x1ff170)){this[_0xbbed('0x38')][_0xbbed('0x9a')](util['format'](_0xbbed('0x100'),_0x1ff170['toUpperCase']()),_0x1d246e[_0x1ff170]);}}this[_0xbbed('0x40')](_0x1d246e['speech'],_0xbbed('0x101'),_0xbbed('0xf8'),'');if(_0x1d246e[_0xbbed('0x102')]){this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format'](_0xbbed('0x103'),_0x1d246e[_0xbbed('0x102')]));var _0x5badb3=this[_0xbbed('0x38')]['streamFile'](_0x1d246e[_0xbbed('0x102')]);try{fs[_0xbbed('0x104')](_0x1d246e['audiofile']+_0xbbed('0x105'));}catch(_0x9542fc){logger[_0xbbed('0x2d')](_0x9542fc);}return _0x5badb3;}else{return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x106'),_0x1d246e[_0xbbed('0xec')]));}}return this[_0xbbed('0x38')]['error'](_0x5af8b5,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xbbed('0xf')][_0xbbed('0x107')]=function(_0x37db98){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x108'),_0x37db98[_0xbbed('0xa5')]));return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x107'));};AGIVertices['prototype'][_0xbbed('0x109')]=function(_0x1fc7c1){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x10a'),_0x1fc7c1[_0xbbed('0xa5')]));var _0x42fad8='';if(_0x1fc7c1[_0xbbed('0x10b')]){if(!this[_0xbbed('0x7e')](_0x1fc7c1[_0xbbed('0x10b')])){return this[_0xbbed('0x38')]['error'](_0x1fc7c1,'no\x20trunk\x20selected');}else{var _0x59929b=parseInt(_0x1fc7c1[_0xbbed('0x10b')],0xa);if(isNaN(_0x59929b)){_0x42fad8=_0x1fc7c1[_0xbbed('0x10b')];}else{_0x42fad8=this[_0xbbed('0x1b')][_0xbbed('0xc1')](this,_0x1fc7c1[_0xbbed('0x10b')]);if(!_0x42fad8){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x1fc7c1,_0xbbed('0x10c'));}}}}else if(_0x1fc7c1['trunk_name']){_0x42fad8=_0x1fc7c1[_0xbbed('0x10d')];}else{return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x1fc7c1,'no\x20trunk\x20selected');}var _0x588a22=this[_0xbbed('0x38')][_0xbbed('0x52')](_0xbbed('0xe4'),[util[_0xbbed('0x29')](_0xbbed('0x10e'),_0x42fad8,_0x1fc7c1[_0xbbed('0x46')]),_0x1fc7c1[_0xbbed('0x5e')],_0x1fc7c1[_0xbbed('0xe6')],_0x1fc7c1[_0xbbed('0x6b')]]);if(_0x588a22[_0xbbed('0x9f')]===-0x1){return _0x588a22;}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0xe7'),'DIAL'));};AGIVertices[_0xbbed('0xf')]['finally']=function(_0x47f9e0){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x47f9e0['label']));return this[_0xbbed('0x38')][_0xbbed('0xa6')]('finally');};AGIVertices[_0xbbed('0xf')]['getdigits']=function(_0x9e5d8d){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x10f'),_0x9e5d8d[_0xbbed('0xa5')]));if(_0x9e5d8d[_0xbbed('0xa2')]===0x0){return this['maxRetry'](_0x9e5d8d);}_0x9e5d8d[_0xbbed('0xa2')]-=0x1;if(!this['isConfigured'](_0x9e5d8d[_0xbbed('0x110')])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x9e5d8d,_0xbbed('0x111'));}var _0x40444d=this[_0xbbed('0x1d')]['sync'](this,_0x9e5d8d['file_id']);if(!_0x40444d){return this[_0xbbed('0x38')]['error'](_0x9e5d8d,_0xbbed('0x112'));}if(!this['isConfigured'](_0x9e5d8d['variable_id'])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0xbbed('0xda'));}var _0x15ba15=this['channel']['getData'](_0x40444d,_0x9e5d8d[_0xbbed('0x113')],_0x9e5d8d[_0xbbed('0x114')]);var _0x3162be=_0x15ba15[_0xbbed('0x9f')]?_0x15ba15['result'][_0xbbed('0x9d')]():'';logger['info'](_0xbbed('0x115'),JSON['stringify'](_0x15ba15));if(_0x15ba15[_0xbbed('0x9f')]===-0x1){this['createSquareDetailsReport'][_0xbbed('0xc1')](this,_0x9e5d8d,_0x3162be);return _0x15ba15;}else if(_0x15ba15['extra']===_0xbbed('0x5e')){_0x15ba15[_0xbbed('0x9f')]=_0x3162be[_0xbbed('0x97')]>=parseInt(_0x9e5d8d['mindigit'])?'x':'i';}else{_0x15ba15[_0xbbed('0x9f')]=_0x3162be['length']>=parseInt(_0x9e5d8d[_0xbbed('0x116')])&&_0x3162be[_0xbbed('0x97')]<=parseInt(_0x9e5d8d['maxdigit'])?'x':'i';}var _0x3bfcb4=this[_0xbbed('0x10')][_0xbbed('0xc1')](this,_0x9e5d8d[_0xbbed('0x117')]);if(!_0x3bfcb4){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x9e5d8d,'no\x20variable\x20found');}this['channel'][_0xbbed('0x9a')](_0x3bfcb4,_0x3162be);if(this['isConfigured'](_0x9e5d8d[_0xbbed('0x118')])){var _0x1dc595=parseInt(_0x9e5d8d[_0xbbed('0x118')],0xa);var _0x201207=rs[_0xbbed('0x119')]({'charset':'*','length':_0x1dc595});var _0x2289fb=_0x3162be['length'];if(_0x2289fb>0x0){if(_0x2289fb>_0x1dc595){this['createSquareDetailsReport'][_0xbbed('0xc1')](this,_0x9e5d8d,_0x9e5d8d[_0xbbed('0x11a')]===_0xbbed('0x11b')?_0x201207+_0x3162be[_0xbbed('0x11c')](_0x1dc595):_0x3162be[_0xbbed('0x11c')](0x0,_0x2289fb-_0x1dc595)+_0x201207);}else{this['createSquareDetailsReport'][_0xbbed('0xc1')](this,_0x9e5d8d,rs['generate']({'charset':'*','length':_0x2289fb}));}}else{this[_0xbbed('0x37')][_0xbbed('0xc1')](this,_0x9e5d8d,'');}}else{this['createSquareDetailsReport'][_0xbbed('0xc1')](this,_0x9e5d8d,_0x3162be);}return _0x15ba15;};AGIVertices[_0xbbed('0xf')][_0xbbed('0xc')]=function(_0x16a684){logger[_0xbbed('0x30')](util['format'](_0xbbed('0x11d'),_0x16a684[_0xbbed('0xa5')]));return this[_0xbbed('0xb')](_0x16a684);};AGIVertices['prototype']['goal']=function(_0x173af6){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x11e'),_0x173af6['label']));this[_0xbbed('0x37')]['sync'](this,_0x173af6,_0x173af6[_0xbbed('0x11f')]);return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')]('GOAL\x20%s',_0x173af6[_0xbbed('0x11f')]));};AGIVertices[_0xbbed('0xf')]['awspolly']=function(_0x45caa7){logger['info'](util['format'](_0xbbed('0x120'),_0x45caa7['label']));if(!this[_0xbbed('0x7e')](_0x45caa7[_0xbbed('0x81')])||!this[_0xbbed('0x7e')](_0x45caa7['aws_secret_access_key'])){return this['channel'][_0xbbed('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xbbed('0x7e')](_0x45caa7[_0xbbed('0x56')])){return this[_0xbbed('0x38')]['noop'](_0xbbed('0xa7'));}this['channel'][_0xbbed('0xa6')](util[_0xbbed('0x29')]('Trying\x20aws\x20Polly\x20%s',_0x45caa7[_0xbbed('0x56')]));var _0x5da2e0=this[_0xbbed('0x80')][_0xbbed('0xc1')](this,_0x45caa7);if(_0x5da2e0){this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x121'),_0x5da2e0));var _0xb7bb7f=this[_0xbbed('0x38')][_0xbbed('0x122')](_0x5da2e0);try{fs['unlink'](_0x5da2e0+_0xbbed('0x105'));}catch(_0x2a3f80){logger[_0xbbed('0x2d')](_0x2a3f80);}return _0xb7bb7f;}return this['channel'][_0xbbed('0x2d')](_0x45caa7,_0xbbed('0x123'));};AGIVertices[_0xbbed('0xf')]['awslex']=function(_0x3a5aa0){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x124'),_0x3a5aa0[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x3a5aa0[_0xbbed('0x81')])||!this[_0xbbed('0x7e')](_0x3a5aa0[_0xbbed('0x82')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x125'));}if(!this['isConfigured'](_0x3a5aa0['aws_bot_name'])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x126'));}if(!this['isConfigured'](_0x3a5aa0['text'])){return this['channel']['noop'](_0xbbed('0xa7'));}this['channel'][_0xbbed('0xe9')]=!![];this[_0xbbed('0x37')](_0x3a5aa0);this[_0xbbed('0x40')](_0x3a5aa0[_0xbbed('0x56')],'in','','');this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x127'),_0x3a5aa0[_0xbbed('0x56')]));var _0x24e610=this[_0xbbed('0x87')][_0xbbed('0xc1')](this,_0x3a5aa0);if(_0x24e610){for(var _0x24bbbc in _0x24e610){if(_0x24e610[_0xbbed('0x90')](_0x24bbbc)&&_[_0xbbed('0x91')](_0x24e610[_0x24bbbc])){this['channel'][_0xbbed('0x9a')](util[_0xbbed('0x29')](_0xbbed('0x128'),_0x24bbbc[_0xbbed('0x62')]()),_0x24e610[_0x24bbbc]);}}if(_[_0xbbed('0x42')](_0x24e610[_0xbbed('0x6f')])){return this[_0xbbed('0x38')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xbbed('0x40')](_0x24e610[_0xbbed('0x6f')],_0xbbed('0x101'),_0xbbed('0x129'),'');return this['channel'][_0xbbed('0xa6')](util['format'](_0xbbed('0x12a'),_0x24e610[_0xbbed('0x6f')]));}}return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x3a5aa0,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xbbed('0xf')][_0xbbed('0x12b')]=function(_0x207c90){logger[_0xbbed('0x30')](util['format'](_0xbbed('0x12c'),_0x207c90[_0xbbed('0xa5')],_0x207c90[_0xbbed('0x5e')]));if(!this[_0xbbed('0x7e')](_0x207c90['key'])){return this['channel']['noop'](_0xbbed('0x12d'));}var _0x13101e=_0xbbed('0x12e');var _0x16bdb7=util[_0xbbed('0x29')](_0xbbed('0x12f'),FILES_PATH,rs['generate'](0x4));var _0xb73a46=util['format'](_0xbbed('0x99'),_0x16bdb7,_0x13101e);var _0x2b7477=!![];if(_0x207c90['beep']===_0xbbed('0x130')){_0x2b7477=![];}var _0x9469af=this[_0xbbed('0x38')]['recordFile'](_0x16bdb7,_0x13101e,_0x207c90['intKey'],_0x207c90[_0xbbed('0x5e')],undefined,_0x2b7477);if(_0x9469af['result']!==-0x1){this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format'](_0xbbed('0x131'),_0xb73a46));var _0x38f004=this[_0xbbed('0x8a')][_0xbbed('0xc1')](this,_0x207c90,_0xb73a46);if(_0x38f004){for(var _0x3a48fb in _0x38f004){if(_0x38f004[_0xbbed('0x90')](_0x3a48fb)){this[_0xbbed('0x38')]['setVariable'](util[_0xbbed('0x29')](_0xbbed('0x132'),_0x3a48fb[_0xbbed('0x62')]()),_0x38f004[_0x3a48fb]);}}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x133'),JSON[_0xbbed('0x6c')](_0x38f004)));}}return _0x9469af;};AGIVertices[_0xbbed('0xf')]['tildeasr']=function(_0x2e0247){logger[_0xbbed('0x30')](util['format'](_0xbbed('0x134'),_0x2e0247[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x2e0247[_0xbbed('0x8d')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x135'));}if(!this['isConfigured'](_0x2e0247[_0xbbed('0x8e')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x425a2d='wav';var _0x4a202f=util[_0xbbed('0x29')](_0xbbed('0x12f'),FILES_PATH,rs[_0xbbed('0x119')](0x4));var _0x1979af=util[_0xbbed('0x29')](_0xbbed('0x99'),_0x4a202f,_0x425a2d);var _0x2de1ff=!![];if(_0x2e0247[_0xbbed('0x136')]===_0xbbed('0x130')){_0x2de1ff=![];}var _0x36d049=this[_0xbbed('0x38')]['recordFile'](_0x4a202f,_0x425a2d,_0x2e0247[_0xbbed('0x137')],_0x2e0247[_0xbbed('0x5e')],undefined,_0x2de1ff);if(_0x36d049[_0xbbed('0x9f')]!==-0x1){this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')](_0xbbed('0x138'),_0x1979af));var _0x3174fc=this[_0xbbed('0x8c')][_0xbbed('0xc1')](this,_0x2e0247,_0x1979af);if(_0x3174fc){for(var _0x3eaa79 in _0x3174fc){if(_0x3174fc[_0xbbed('0x90')](_0x3eaa79)){this[_0xbbed('0x38')][_0xbbed('0x9a')](util[_0xbbed('0x29')](_0xbbed('0x139'),_0x3eaa79[_0xbbed('0x62')]()),_0x3174fc[_0x3eaa79]);}}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format'](_0xbbed('0x13a'),JSON[_0xbbed('0x6c')](_0x3174fc)));}}return _0x36d049;};AGIVertices[_0xbbed('0xf')]['gotoc']=function(_0x5bf5e7){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x13b'),_0x5bf5e7[_0xbbed('0xa5')]));return this[_0xbbed('0x38')][_0xbbed('0x13c')](_0x5bf5e7[_0xbbed('0x3c')],_0x5bf5e7['extension'],_0x5bf5e7[_0xbbed('0x13d')]);};AGIVertices[_0xbbed('0xf')][_0xbbed('0x13e')]=function(_0x5bb2b3){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x13f'),_0x5bb2b3['label']));if(!this[_0xbbed('0x7e')](_0x5bb2b3[_0xbbed('0x140')])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x5bb2b3,_0xbbed('0x141'));}try{var _0x3f59ec=eval(_0x5bb2b3[_0xbbed('0x140')])?_0xbbed('0x142'):_0xbbed('0x143');this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x5bb2b3[_0xbbed('0x140')],_0x3f59ec));return{'code':0xc8,'result':_0x3f59ec};}catch(_0x1e1b33){return{'code':0xc8,'result':_0xbbed('0x143')};}};AGIVertices['prototype'][_0xbbed('0x144')]=function(_0x2bde56){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x145'),_0x2bde56[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x2bde56[_0xbbed('0x146')])){return this[_0xbbed('0x38')]['error'](_0x2bde56,_0xbbed('0x147'));}var _0x2ce1e4=this[_0xbbed('0x22')]['sync'](this,_0x2bde56['interval_id']);if(!_0x2ce1e4){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x2bde56,'no\x20intervals\x20found');}for(var _0x2dfa24=0x0;_0x2dfa24<_0x2ce1e4[_0xbbed('0x97')];_0x2dfa24+=0x1){var _0x18e853=this['channel'][_0xbbed('0x10')](util[_0xbbed('0x29')](_0xbbed('0x148'),_0x2ce1e4[_0x2dfa24]));if(_0x18e853[_0xbbed('0x9f')]===-0x1){return _0x18e853;}logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x149'),_0x2ce1e4[_0x2dfa24],_0x18e853[_0xbbed('0xa0')]));if(_0x18e853[_0xbbed('0xa0')]===_0xbbed('0x142')){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x149'),_0x2ce1e4[_0x2dfa24],'true'));this['channel'][_0xbbed('0xa6')](util[_0xbbed('0x29')]('IFTIME\x20%s\x20%s',_0x2ce1e4[_0x2dfa24],_0xbbed('0x142')));return{'code':0xc8,'result':_0xbbed('0x142')};}else{logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('IFTIME\x20%s\x20%s',_0x2ce1e4[_0x2dfa24],_0xbbed('0x143')));this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')](_0xbbed('0x149'),_0x2ce1e4[_0x2dfa24],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0xbbed('0x14a')]=function(_0x4e8d2a){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x14b'),_0x4e8d2a[_0xbbed('0xa5')]));return this[_0xbbed('0x38')][_0xbbed('0x14a')]();};AGIVertices['prototype'][_0xbbed('0x14c')]=function(_0x4a836e){logger[_0xbbed('0x30')](util['format'](_0xbbed('0x14d'),_0x4a836e['label']));if(!this[_0xbbed('0x7e')](_0x4a836e[_0xbbed('0x72')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x12d'));}var _0x472f4a=_0xbbed('0x12e');var _0x2b9746=util['format'](_0xbbed('0x12f'),FILES_PATH,rs[_0xbbed('0x119')](0x4));var _0x5ace39=util['format'](_0xbbed('0x99'),_0x2b9746,_0x472f4a);var _0x66ee15=!![];if(_0x4a836e[_0xbbed('0x136')]==='NOBEEP'){_0x66ee15=![];}var _0x5de88d=this[_0xbbed('0x38')]['recordFile'](_0x2b9746,_0x472f4a,_0x4a836e[_0xbbed('0x137')],_0x4a836e[_0xbbed('0x5e')],undefined,_0x66ee15);if(_0x5de88d[_0xbbed('0x9f')]!==-0x1){this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x14e'),_0x5ace39));var _0x35d2e8=this[_0xbbed('0x7c')][_0xbbed('0xc1')](this,_0x4a836e,_0x5ace39);if(_0x35d2e8){for(var _0xf8b5a9 in _0x35d2e8){if(_0x35d2e8[_0xbbed('0x90')](_0xf8b5a9)){this['channel'][_0xbbed('0x9a')](util['format'](_0xbbed('0x14f'),_0xf8b5a9['toUpperCase']()),_0x35d2e8[_0xf8b5a9]);}}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x35d2e8)));}}return _0x5de88d;};AGIVertices['prototype'][_0xbbed('0x150')]=function(_0xfef93c){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0xfef93c[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0xfef93c[_0xbbed('0x72')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x12d'));}if(!this[_0xbbed('0x7e')](_0xfef93c[_0xbbed('0x56')])){return this['channel'][_0xbbed('0xa6')](_0xbbed('0xa7'));}this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')](_0xbbed('0x151'),_0xfef93c[_0xbbed('0x56')]));var _0x1d07d1=this[_0xbbed('0x79')][_0xbbed('0xc1')](this,_0xfef93c);if(_0x1d07d1){this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x14e'),_0x1d07d1));var _0x40dcca=this[_0xbbed('0x38')]['streamFile'](_0x1d07d1,_0xfef93c['intKey']);try{fs[_0xbbed('0x104')](_0x1d07d1+_0xbbed('0x105'));}catch(_0x25c7a1){logger[_0xbbed('0x2d')](_0x25c7a1);}return _0x40dcca;}return this['channel'][_0xbbed('0x2d')](_0xfef93c,_0xbbed('0x152'));};AGIVertices['prototype'][_0xbbed('0x153')]=function(_0x33302f){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x154'),_0x33302f[_0xbbed('0xa5')]));if(!this['isConfigured'](_0x33302f[_0xbbed('0x155')])){return this['channel'][_0xbbed('0x2d')](_0x33302f,_0xbbed('0x156'));}logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x157'),this['channel'][_0xbbed('0x3b')],_0x33302f[_0xbbed('0x155')]));var _0x4e487b=this[_0xbbed('0x4e')][_0xbbed('0xc1')](this,_0x33302f['findBy']);if(_0x4e487b){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x158'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x33302f[_0xbbed('0x155')]));this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbbed('0x38')]['callerid'],_0x33302f[_0xbbed('0x155')]));return{'code':0xc8,'result':_0xbbed('0x159')};}else{logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x15a'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x33302f['findBy']));this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x15a'),this[_0xbbed('0x38')]['callerid'],_0x33302f[_0xbbed('0x155')]));return{'code':0xc8,'result':_0xbbed('0x15b')};}};AGIVertices[_0xbbed('0xf')][_0xbbed('0x15c')]=function(_0x15a917){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x15d'),_0x15a917[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x15a917[_0xbbed('0x155')])){return this[_0xbbed('0x38')]['error'](_0x15a917,_0xbbed('0x156'));}logger[_0xbbed('0x30')](util['format'](_0xbbed('0x157'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x15a917[_0xbbed('0x155')]));var _0x39e13d=this[_0xbbed('0x15e')][_0xbbed('0xc1')](this,_0x15a917[_0xbbed('0x155')]);if(_0x39e13d){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x158'),this['channel']['callerid'],_0x15a917[_0xbbed('0x155')]));this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x158'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x15a917['findBy']));return{'code':0xc8,'result':_0xbbed('0x159')};}else{logger['info'](util[_0xbbed('0x29')](_0xbbed('0x15a'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x15a917[_0xbbed('0x155')]));this['channel'][_0xbbed('0xa6')](util[_0xbbed('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x15a917['findBy']));return{'code':0xc8,'result':_0xbbed('0x15b')};}};AGIVertices[_0xbbed('0xf')]['math']=function(_0x485e2a){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x15f'),_0x485e2a[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x485e2a[_0xbbed('0x160')])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x485e2a,_0xbbed('0x161'));}this['channel'][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x162'),_0x485e2a['operation']));var _0xb05eaa=eval(_0x485e2a[_0xbbed('0x160')]);if(!this[_0xbbed('0x7e')](_0x485e2a[_0xbbed('0x117')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xda'));}var _0x31faa9=this[_0xbbed('0x10')][_0xbbed('0xc1')](this,_0x485e2a[_0xbbed('0x117')]);if(!_0x31faa9){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x485e2a,_0xbbed('0xdb'));}if(_['isArray'](_0xb05eaa)){var _0x2e9486=this;_0xb05eaa[_0xbbed('0xdc')](function(_0xc0ad46,_0x1e3e2a){_0x2e9486[_0xbbed('0x38')][_0xbbed('0x9a')](util[_0xbbed('0x29')](_0xbbed('0x163'),_0x31faa9,_0x1e3e2a),_0xc0ad46);});return this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')](_0xbbed('0x164'),_0x31faa9));}else{return this[_0xbbed('0x38')][_0xbbed('0x9a')](_0x31faa9,_0xb05eaa);}};AGIVertices[_0xbbed('0xf')]['menu']=function(_0x51432e){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x165'),_0x51432e[_0xbbed('0xa5')]));if(_0x51432e[_0xbbed('0xa2')]===0x0){return this['maxRetry'](_0x51432e);}_0x51432e[_0xbbed('0xa2')]-=0x1;if(!this[_0xbbed('0x7e')](_0x51432e[_0xbbed('0x110')])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x51432e,'no\x20file\x20audio\x20selected');}var _0x115d21=this[_0xbbed('0x1d')]['sync'](this,_0x51432e[_0xbbed('0x110')]);if(!_0x115d21){return this[_0xbbed('0x38')]['error'](_0x51432e,_0xbbed('0x112'));}var _0x4a234c=this['channel'][_0xbbed('0x166')](_0x115d21,_0x51432e['response'],_0x51432e[_0xbbed('0x167')]);var _0x2e47e6=_0x4a234c[_0xbbed('0x9f')];if(_0x4a234c[_0xbbed('0x9f')]===-0x1){this[_0xbbed('0x37')][_0xbbed('0xc1')](this,_0x51432e,'-1');return _0x4a234c;}else if(_0x4a234c[_0xbbed('0xa0')]===_0xbbed('0x5e')){_0x4a234c[_0xbbed('0x9f')]=_0x4a234c[_0xbbed('0x9f')][_0xbbed('0x97')]>0x0?_0x4a234c[_0xbbed('0x9f')]:'t';}else if(_['isEmpty'](_0x4a234c[_0xbbed('0x9f')])){_0x4a234c[_0xbbed('0x9f')]='#';_0x2e47e6='#';}if(!this[_0xbbed('0x7e')](_0x51432e['variable_id'])){this[_0xbbed('0x38')][_0xbbed('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x54937c=this['getVariable']['sync'](this,_0x51432e['variable_id']);if(!_0x54937c){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x51432e,'no\x20variable\x20found');}this['channel'][_0xbbed('0x9a')](_0x54937c,_0x2e47e6);}this[_0xbbed('0x37')][_0xbbed('0xc1')](this,_0x51432e,_0x2e47e6);return _0x4a234c;};AGIVertices[_0xbbed('0xf')][_0xbbed('0xa6')]=function(_0x5d4255){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x168'),_0x5d4255[_0xbbed('0xa5')]));return this['channel'][_0xbbed('0xa6')](_0x5d4255[_0xbbed('0x169')]||_0x5d4255[_0xbbed('0xa5')]);};AGIVertices[_0xbbed('0xf')][_0xbbed('0x16a')]=function(_0x13b042){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x16b'),_0x13b042['label']));if(!this[_0xbbed('0x7e')](_0x13b042['findBy'])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x13b042,'no\x20find\x20by\x20configured');}logger[_0xbbed('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x13b042[_0xbbed('0x155')]));var _0x54eeed=this[_0xbbed('0x49')][_0xbbed('0xc1')](this,_0x13b042[_0xbbed('0x16c')]);var _0x157f03=this[_0xbbed('0x4b')]['sync'](this,_0x13b042[_0xbbed('0x155')],_0x54eeed);if(_0x157f03){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x158'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x13b042['findBy']));this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x158'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x13b042[_0xbbed('0x155')]));return{'code':0xc8,'result':_0xbbed('0x159')};}else{logger['info'](util['format'](_0xbbed('0x15a'),this['channel'][_0xbbed('0x3b')],_0x13b042[_0xbbed('0x155')]));this['channel']['noop'](util[_0xbbed('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbbed('0x38')]['callerid'],_0x13b042['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xbbed('0xf')][_0xbbed('0x16d')]=function(_0x46c49e){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x16e'),_0x46c49e['label']));if(!this['isConfigured'](_0x46c49e[_0xbbed('0x110')])){return this['channel'][_0xbbed('0x2d')](_0x46c49e,_0xbbed('0x111'));}var _0x15a153=this[_0xbbed('0x1d')]['sync'](this,_0x46c49e[_0xbbed('0x110')]);if(!_0x15a153){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x46c49e,_0xbbed('0x112'));}var _0x3d93c4=this[_0xbbed('0x38')][_0xbbed('0x52')](_0xbbed('0x16f'),[_0x15a153,_0x46c49e[_0xbbed('0xe6')]]);if(_0x3d93c4[_0xbbed('0x9f')]===-0x1){return _0x3d93c4;}return this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')](_0xbbed('0xc4'),_0xbbed('0x16f'),_0x15a153));};AGIVertices[_0xbbed('0xf')][_0xbbed('0x170')]=function(_0x286a78){logger['info'](util[_0xbbed('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x286a78['label']));if(!this[_0xbbed('0x7e')](_0x286a78[_0xbbed('0x171')])){return this['channel']['error'](_0x286a78,_0xbbed('0x172'));}var _0x3747ef='';var _0x1a7114=parseInt(_0x286a78[_0xbbed('0x171')],0xa);if(isNaN(_0x1a7114)){_0x3747ef=_0x286a78[_0xbbed('0x171')];}else{_0x3747ef=this[_0xbbed('0x173')][_0xbbed('0xc1')](this,_0x286a78['queue_id']);if(!_0x3747ef){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x286a78,_0xbbed('0x174'));}}var _0x2ade8b='';if(this[_0xbbed('0x7e')](_0x286a78[_0xbbed('0x110')])){var _0x40f7cd=this[_0xbbed('0x1d')][_0xbbed('0xc1')](this,_0x286a78[_0xbbed('0x110')]);if(_0x40f7cd){_0x2ade8b=_0x40f7cd;}}this[_0xbbed('0x37')][_0xbbed('0xc1')](this,_0x286a78,_0x3747ef);if(_0x286a78['opts'][_0xbbed('0x175')]('x')<0x0){_0x286a78[_0xbbed('0xe6')]+='x';}if(_0x286a78[_0xbbed('0xe6')][_0xbbed('0x175')]('X')<0x0){_0x286a78['opts']+='X';}this[_0xbbed('0x38')][_0xbbed('0x9a')]('XMCS-QUEUE',_0x3747ef?_0x3747ef[_0xbbed('0x176')]():'');var _0x22d308=this['channel'][_0xbbed('0x52')](_0xbbed('0x177'),[_0x3747ef,_0x286a78[_0xbbed('0xe6')],_0x286a78['url'],_0x2ade8b,_0x286a78[_0xbbed('0x5e')],_0x286a78['agi'],_0x286a78[_0xbbed('0x178')],_0x286a78[_0xbbed('0x179')],'',_0x286a78[_0xbbed('0x17a')]]);if(_0x22d308[_0xbbed('0x9f')]===-0x1){return _0x22d308;}return this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')]('Executed\x20command\x20%s\x20%s',_0xbbed('0x177'),_0x3747ef));};AGIVertices['prototype'][_0xbbed('0x17b')]=function(_0x41b0bf){logger[_0xbbed('0x30')](util['format'](_0xbbed('0x17c'),_0x41b0bf[_0xbbed('0xa5')]));var _0x259962=_0x41b0bf['recordingFormat']||_0xbbed('0x12e');var _0x501c5d=util[_0xbbed('0x29')](_0xbbed('0x17d'),this[_0xbbed('0x38')][_0xbbed('0x39')],rs['generate'](0x5));var _0x20e4f3=util['format'](_0xbbed('0x17e'),FILES_PATH,_0x501c5d,_0x259962);var _0x27f675=util[_0xbbed('0x29')](_0xbbed('0x12f'),FILES_PATH,_0x501c5d);this[_0xbbed('0x3a')][_0xbbed('0xc1')](this,_0x41b0bf,_0x501c5d,_0x20e4f3);this[_0xbbed('0x38')][_0xbbed('0x9a')](_0xbbed('0x17f'),_0x501c5d);logger['info'](_0xbbed('0x180'),_0x27f675,_0x259962,_0x41b0bf[_0xbbed('0x181')],_0x41b0bf[_0xbbed('0x5e')]);return this['channel'][_0xbbed('0x182')](_0x27f675,_0x259962,_0x41b0bf[_0xbbed('0x181')],_0x41b0bf['timeout'],undefined,!![]);};AGIVertices[_0xbbed('0xf')][_0xbbed('0x183')]=function(_0x502a59){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x184'),_0x502a59[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x502a59[_0xbbed('0x6b')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x185'));}var _0x4a6b05=this[_0xbbed('0x5d')][_0xbbed('0xc1')](this,_0x502a59);logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x186'),util['inspect'](_0x4a6b05,{'showHidden':![],'depth':null})));if(!this[_0xbbed('0x7e')](_0x502a59['variable_id'])){return this[_0xbbed('0x38')][_0xbbed('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x5643ce=this[_0xbbed('0x10')]['sync'](this,_0x502a59[_0xbbed('0x117')]);if(!_0x5643ce){return this['channel'][_0xbbed('0x2d')](_0x502a59,'no\x20variable\x20found');}this[_0xbbed('0x38')][_0xbbed('0x9a')](util[_0xbbed('0x29')]('%s_STATUS_CODE',_0x5643ce),_0x4a6b05[_0xbbed('0x6e')]?_0x4a6b05[_0xbbed('0x6e')]:_0xbbed('0x187'));this['channel'][_0xbbed('0x9a')](util['format']('%s_STATUS_MESSAGE',_0x5643ce),_0x4a6b05[_0xbbed('0x6d')]?_0x4a6b05[_0xbbed('0x6d')]:'OK');if(_0x4a6b05['body']){try{this[_0xbbed('0x98')](_0x4a6b05[_0xbbed('0x63')],_0x5643ce);}catch(_0x28e2c7){logger[_0xbbed('0x2d')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x5643ce));}}return this[_0xbbed('0x38')]['noop'](util['format'](_0xbbed('0x188'),_0x5643ce));};AGIVertices[_0xbbed('0xf')]['saydigits']=function(_0x2ff2b6){logger['info'](util['format'](_0xbbed('0x189'),_0x2ff2b6[_0xbbed('0xa5')]));return this[_0xbbed('0x38')][_0xbbed('0x18a')](_0x2ff2b6[_0xbbed('0x18b')]['replace'](/\s+/g,''),_0x2ff2b6[_0xbbed('0x181')]);};AGIVertices[_0xbbed('0xf')][_0xbbed('0x18c')]=function(_0x2cea7c){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x18d'),_0x2cea7c[_0xbbed('0xa5')]));return this[_0xbbed('0x38')][_0xbbed('0x18e')](_0x2cea7c[_0xbbed('0x18f')][_0xbbed('0xd8')](/\s+/g,''),_0x2cea7c[_0xbbed('0x181')]);};AGIVertices[_0xbbed('0xf')][_0xbbed('0x190')]=function(_0x2add3a){logger[_0xbbed('0x30')](util['format'](_0xbbed('0x191'),_0x2add3a[_0xbbed('0xa5')]));return this[_0xbbed('0x38')][_0xbbed('0x192')](_0x2add3a[_0xbbed('0x56')],_0x2add3a[_0xbbed('0x181')]);};AGIVertices[_0xbbed('0xf')]['sendMail']=function(_0x20fdb7){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x193'),_0x20fdb7[_0xbbed('0xa5')]));if(!this['isConfigured'](_0x20fdb7[_0xbbed('0x194')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')]('no\x20mail\x20account\x20configured');}var _0xcfab55=this[_0xbbed('0x195')][_0xbbed('0xc1')](this,_0x20fdb7[_0xbbed('0x194')]);if(!_0xcfab55||!_0xcfab55[_0xbbed('0x196')]){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x20fdb7,'no\x20mail\x20account\x20found');}var _0x67fd51={'from':util[_0xbbed('0x29')](_0xbbed('0x197'),_0xcfab55['name'],_0xcfab55[_0xbbed('0x198')]||_0xcfab55['Smtp'][_0xbbed('0x199')]),'to':_0x20fdb7['to']||'','cc':_0x20fdb7['cc']||'','bcc':_0x20fdb7[_0xbbed('0x19a')]||'','subject':_0x20fdb7[_0xbbed('0x19b')],'html':_0x20fdb7[_0xbbed('0x56')],'text':_0x20fdb7['text']};var _0x19ee7f={'tls':{'rejectUnauthorized':![]}};if(_0xcfab55[_0xbbed('0x196')][_0xbbed('0x19c')]){_0x19ee7f['service']=_0xcfab55[_0xbbed('0x196')][_0xbbed('0x19c')];}else{_0x19ee7f['host']=_0xcfab55[_0xbbed('0x196')][_0xbbed('0x19d')];_0x19ee7f[_0xbbed('0x19e')]=_0xcfab55[_0xbbed('0x196')][_0xbbed('0x19e')];_0x19ee7f[_0xbbed('0x19f')]=_0xcfab55[_0xbbed('0x196')][_0xbbed('0x19f')];}if(_0xcfab55['Smtp'][_0xbbed('0x1a0')]){_0x19ee7f[_0xbbed('0x1a1')]={'user':_0xcfab55[_0xbbed('0x196')]['user'],'pass':_0xcfab55[_0xbbed('0x196')]['pass']};}if(this[_0xbbed('0x7e')](_0x20fdb7[_0xbbed('0x1a2')])){}logger['debug'](_0xbbed('0x1a3'),JSON['stringify'](_0x67fd51));this[_0xbbed('0x37')][_0xbbed('0xc1')](this,_0x20fdb7,_0x20fdb7[_0xbbed('0x194')]);this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x1a4'),_0xcfab55[_0xbbed('0x12')]));this[_0xbbed('0x21')]['sync'](this,_0x19ee7f,_0x67fd51);return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x1a5'));};AGIVertices[_0xbbed('0xf')]['sendFax']=function(_0x1716d2){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x1716d2['label']));return this['channel'][_0xbbed('0xa6')](_0xbbed('0x1a6'));};AGIVertices[_0xbbed('0xf')][_0xbbed('0x1a7')]=function(_0x633037){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x1a8'),_0x633037[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x633037[_0xbbed('0x1a9')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x1aa'));}var _0x58d872=this[_0xbbed('0x34')][_0xbbed('0xc1')](this,_0x633037[_0xbbed('0x1a9')]);if(!_0x58d872){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x633037,'no\x20sms\x20account\x20found');}var _0x29910c={'body':_0x633037[_0xbbed('0x1ab')],'phone':_0x633037['to']||'','SmsAccountId':_0x58d872['id']};logger[_0xbbed('0xe0')](_0xbbed('0x1ac'),JSON[_0xbbed('0x6c')](_0x29910c));this['createSquareDetailsReport'][_0xbbed('0xc1')](this,_0x633037,_0x633037[_0xbbed('0x1a9')]);this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')](_0xbbed('0x1ad'),_0x58d872['name']));this['createSmsMessage'][_0xbbed('0xc1')](this,_0x29910c);return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x1ae'));};AGIVertices[_0xbbed('0xf')]['set']=function(_0x4d0ec7){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x1af'),_0x4d0ec7[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x4d0ec7[_0xbbed('0x117')])){return this[_0xbbed('0x38')]['error'](_0x4d0ec7,_0xbbed('0x1b0'));}var _0x30cd43=this[_0xbbed('0x10')][_0xbbed('0xc1')](this,_0x4d0ec7[_0xbbed('0x117')]);if(!_0x30cd43){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x4d0ec7,'no\x20variable\x20found');}return this[_0xbbed('0x38')][_0xbbed('0x9a')](_0x30cd43,_0x4d0ec7[_0xbbed('0x1b1')]);};AGIVertices['prototype'][_0xbbed('0x1b2')]=function(_0x48ee44){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x1b3'),_0x48ee44[_0xbbed('0xa5')]));this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x1b4'));if(_0x48ee44[_0xbbed('0xb7')]===_0xbbed('0x1b5')){this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x1b6'));return this[_0xbbed('0x38')]['answer']();}return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x1b7'));};AGIVertices[_0xbbed('0xf')][_0xbbed('0x1b8')]=function(_0x5a3f1d){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x1b9'),_0x5a3f1d[_0xbbed('0xa5')]));if(!this['isConfigured'](_0x5a3f1d['project_id'])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x5a3f1d,'no\x20subproject\x20selected');}var _0x580f3f=this['getSquareProject'][_0xbbed('0xc1')](this,_0x5a3f1d[_0xbbed('0x1ba')]);if(!this[_0xbbed('0x7e')](_0x580f3f)){return this['channel'][_0xbbed('0x2d')](_0x5a3f1d,util[_0xbbed('0x29')](_0xbbed('0x1bb'),_0x5a3f1d[_0xbbed('0x1ba')]));}if(_0x580f3f===this['channel'][_0xbbed('0x3e')]){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x5a3f1d,_0xbbed('0x1bc'));}this[_0xbbed('0x37')]['sync'](this,_0x5a3f1d,_0x580f3f);var _0x5b19c9=this[_0xbbed('0x38')]['exec']('AGI',util[_0xbbed('0x29')](_0xbbed('0x1bd'),config['agi'][_0xbbed('0x19d')]||_0xbbed('0x1be'),_0x580f3f,this[_0xbbed('0x38')][_0xbbed('0x3e')]));if(_0x5b19c9[_0xbbed('0x9f')]===-0x1){return _0x5b19c9;}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')]('Executed\x20command\x20%s\x20%s','AGI',_0x580f3f));};AGIVertices['prototype'][_0xbbed('0x1bf')]=function(_0x53c9d9){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x53c9d9[_0xbbed('0xa5')]));var _0x4110ca=this[_0xbbed('0x51')][_0xbbed('0xc1')](this,_0x53c9d9[_0xbbed('0xb5')]);this['createSquareDetailsReport'][_0xbbed('0xc1')](this,_0x53c9d9,_0x53c9d9[_0xbbed('0xb5')]);if(this[_0xbbed('0x7e')](_0x53c9d9[_0xbbed('0x117')])){var _0x2fd80a=this[_0xbbed('0x10')][_0xbbed('0xc1')](this,_0x53c9d9['variable_id']);if(_0x2fd80a){this[_0xbbed('0x38')][_0xbbed('0x9a')](_0x2fd80a,_0x4110ca);return this['channel']['noop'](util[_0xbbed('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x53c9d9[_0xbbed('0xb5')],_0x2fd80a));}}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x1c0'),_0x53c9d9['command']));};AGIVertices[_0xbbed('0xf')][_0xbbed('0x1c1')]=function(_0x24fa9a){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x1c2'),_0x24fa9a[_0xbbed('0xa5')]));_0x24fa9a[_0xbbed('0x56')]=_0x24fa9a[_0xbbed('0x56')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x24fa9a[_0xbbed('0x1c3')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0x1c4'));}if(!this[_0xbbed('0x7e')](_0x24fa9a[_0xbbed('0x56')])){return this[_0xbbed('0x38')][_0xbbed('0xa6')]('no\x20text\x20configured');}this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x24fa9a[_0xbbed('0x56')]));var _0x161c06=this['googleCloudTTS']['sync'](this,_0x24fa9a);if(_0x161c06){this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x161c06));var _0x28559c=this[_0xbbed('0x38')][_0xbbed('0x122')](_0x161c06);try{fs[_0xbbed('0x104')](_0x161c06+_0xbbed('0x105'));}catch(_0x31728c){logger[_0xbbed('0x2d')](_0x31728c);}return _0x28559c;}return this['channel'][_0xbbed('0x2d')](_0x24fa9a,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbbed('0xf')][_0xbbed('0x1c5')]=function(_0x51e815){logger['info'](util[_0xbbed('0x29')](_0xbbed('0x1c6'),_0x51e815[_0xbbed('0xa5')]));_0x51e815[_0xbbed('0x56')]=_0x51e815['text'][_0xbbed('0xd8')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbbed('0x7e')](_0x51e815['text'])){return this[_0xbbed('0x38')][_0xbbed('0xa6')](_0xbbed('0xa7'));}this[_0xbbed('0x38')]['noop'](util[_0xbbed('0x29')](_0xbbed('0x1c7'),_0x51e815[_0xbbed('0x56')]));var _0x4251fe=this[_0xbbed('0x5b')]['sync'](this,_0x51e815);if(_0x4251fe){this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x1c8'),_0x4251fe));var _0x4440be=this[_0xbbed('0x38')][_0xbbed('0x122')](_0x4251fe);try{fs['unlink'](_0x4251fe+_0xbbed('0x105'));}catch(_0x5d3a32){logger[_0xbbed('0x2d')](_0x5d3a32);}return _0x4440be;}return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x51e815,_0xbbed('0x1c9'));};AGIVertices['prototype'][_0xbbed('0x1ca')]=function(_0x21edd2){logger[_0xbbed('0x30')](util['format'](_0xbbed('0x1cb'),_0x21edd2[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0x21edd2['findBy'])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0x21edd2,_0xbbed('0x156'));}logger[_0xbbed('0x30')](util['format'](_0xbbed('0x157'),this[_0xbbed('0x38')]['callerid'],_0x21edd2[_0xbbed('0x155')]));var _0x530a34=this[_0xbbed('0x4d')][_0xbbed('0xc1')](this,_0x21edd2[_0xbbed('0x155')]);if(_0x530a34){logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x158'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x21edd2[_0xbbed('0x155')]));this[_0xbbed('0x38')][_0xbbed('0xa6')](util[_0xbbed('0x29')](_0xbbed('0x158'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x21edd2[_0xbbed('0x155')]));return{'code':0xc8,'result':_0xbbed('0x159')};}else{logger[_0xbbed('0x30')](util[_0xbbed('0x29')](_0xbbed('0x15a'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x21edd2[_0xbbed('0x155')]));this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format'](_0xbbed('0x15a'),this[_0xbbed('0x38')][_0xbbed('0x3b')],_0x21edd2[_0xbbed('0x155')]));return{'code':0xc8,'result':_0xbbed('0x15b')};}};AGIVertices[_0xbbed('0xf')][_0xbbed('0x1cc')]=function(_0xc5f5c1){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0xc5f5c1[_0xbbed('0xa5')]));var _0x2977ca=this[_0xbbed('0x38')]['exec'](_0xbbed('0x1cd'),[_0xc5f5c1[_0xbbed('0x1ce')],_0xc5f5c1[_0xbbed('0x70')]]);if(_0x2977ca[_0xbbed('0x9f')]===-0x1){return _0x2977ca;}return this[_0xbbed('0x38')][_0xbbed('0xa6')](util['format'](_0xbbed('0xc4'),_0xbbed('0x1cd'),_0xc5f5c1[_0xbbed('0x1ce')]));};AGIVertices['prototype'][_0xbbed('0x1cf')]=function(_0xdba074){logger[_0xbbed('0x30')](util[_0xbbed('0x29')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0xdba074[_0xbbed('0xa5')]));if(!this[_0xbbed('0x7e')](_0xdba074['variable_id'])){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0xdba074,_0xbbed('0x1b0'));}var _0x38fd59=this['getVariable'][_0xbbed('0xc1')](this,_0xdba074[_0xbbed('0x117')]);if(!_0x38fd59){return this[_0xbbed('0x38')][_0xbbed('0x2d')](_0xdba074,'no\x20variable\x20found');}var _0x48e2d8=this[_0xbbed('0x38')][_0xbbed('0x10')](_0x38fd59);return{'code':0xc8,'result':_0x48e2d8[_0xbbed('0xa0')]?_0x48e2d8['extra']:'-'};};String['prototype'][_0xbbed('0x9c')]=function(_0x3b70b0,_0x3a36e3){return this[_0xbbed('0x9b')](_0x3b70b0)['join'](_0x3a36e3);};module[_0xbbed('0x1d0')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 61a1701..9757dc6 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 _0x01cb=['getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','updateAcw','timer','update','uniqueid','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action'];(function(_0x3e5eab,_0xf2fa50){var _0x43ed67=function(_0x159616){while(--_0x159616){_0x3e5eab['push'](_0x3e5eab['shift']());}};_0x43ed67(++_0xf2fa50);}(_0x01cb,0x12d));var _0xb01c=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x01cb[_0x9b3efc];return _0x200f05;};'use strict';var util=require(_0xb01c('0x0'));var _=require(_0xb01c('0x1'));var moment=require('moment');var ami=require(_0xb01c('0x2'));var logger=require('../../../config/logger')(_0xb01c('0x3'));var RpcUser=require(_0xb01c('0x4'));var RpcVoiceAgentReport=require(_0xb01c('0x5'));function Acw(_0x247890){this[_0xb01c('0x6')]=_0x247890[_0xb01c('0x6')];this[_0xb01c('0x7')]=_0x247890['agents'];this[_0xb01c('0x8')]=_0x247890[_0xb01c('0x8')];this[_0xb01c('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xb01c('0xa')](this));ami['on']('hanguprequest',this[_0xb01c('0xb')]['bind'](this));ami['on'](_0xb01c('0xc'),this['syncHangup'][_0xb01c('0xa')](this));ami['on'](_0xb01c('0xd'),this[_0xb01c('0xe')]['bind'](this));ami['on'](_0xb01c('0xf'),this[_0xb01c('0x10')]['bind'](this));ami['on']('blindtransfer',this[_0xb01c('0x11')][_0xb01c('0xa')](this));ami['on'](_0xb01c('0x12'),this['syncAgentConnectPreview'][_0xb01c('0xa')](this));}function getDiff(_0x353c08){var _0x431257=moment()[_0xb01c('0x13')](0x0);var _0x27d6ce=moment(_0x353c08)[_0xb01c('0x13')](0x0);return _0x431257[_0xb01c('0x14')](_0x27d6ce,_0xb01c('0x15'));}Acw[_0xb01c('0x16')][_0xb01c('0x17')]=function(_0x5a5585){try{var _0x3c6e85=this;var _0x62c081=this[_0xb01c('0x9')][_0x5a5585][_0xb01c('0x18')];var _0xcaf755=this[_0xb01c('0x9')][_0x5a5585][_0xb01c('0x19')];var _0x295e28=this['voiceQueues'][_0xcaf755];var _0x4e739c=![];var _0x45703b=_0xb01c('0x1a');if(_0x295e28[_0xb01c('0x1b')]){if(_0x295e28[_0xb01c('0x1c')][_0xb01c('0x1d')]){_0x4e739c=!![];_0x45703b=_0x295e28[_0xb01c('0x1c')]['name'];}}ami[_0xb01c('0x1e')]({'action':'QueuePause','interface':_0x62c081,'paused':!![],'reason':_0x45703b})['then'](function(_0x20926a){if(_0x3c6e85[_0xb01c('0x7')][_0x62c081]){return RpcUser[_0xb01c('0x1f')](_0x3c6e85[_0xb01c('0x7')][_0x62c081]['id'])[_0xb01c('0x20')](function(_0x9c152f){if(_0x9c152f&&!_0x9c152f[_0xb01c('0x21')]){logger[_0xb01c('0x22')](_0xb01c('0x23'),_0x5a5585,_0x62c081,_0xcaf755);var _0x2e9cf7=_0x3c6e85['channels'][_0x5a5585][_0xb01c('0x24')]&&_0x3c6e85[_0xb01c('0x9')][_0x5a5585][_0xb01c('0x25')]?_0x3c6e85[_0xb01c('0x9')][_0x5a5585][_0xb01c('0x25')]:_0x5a5585;return RpcUser[_0xb01c('0x26')](_0x3c6e85[_0xb01c('0x7')][_0x62c081],_0x45703b,_0x2e9cf7)['then'](function(_0x595c4b){if(!_0x4e739c){_0x3c6e85[_0xb01c('0x8')][_0x62c081]={};logger[_0xb01c('0x22')](_0xb01c('0x27'),_0x5a5585,_0x3c6e85[_0xb01c('0x6')][_0xcaf755]['acwTimeout'],_0x62c081,_0xcaf755);_0x3c6e85[_0xb01c('0x8')][_0x62c081]['timer']=setTimeout(_0x3c6e85[_0xb01c('0x28')]['bind'](_0x3c6e85,_0x62c081),_0x3c6e85[_0xb01c('0x6')][_0xcaf755][_0xb01c('0x29')]*0x3e8);_0x3c6e85[_0xb01c('0x8')][_0x62c081][_0xb01c('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3c6e85[_0xb01c('0x8')][_0x62c081]['uniqueid']=_0x5a5585;_0x3c6e85[_0xb01c('0x8')][_0x62c081]['queue']=_0xcaf755;_0x3c6e85[_0xb01c('0x8')][_0x62c081][_0xb01c('0x2b')]=function(){var _0x4195b2=getDiff(_0x3c6e85[_0xb01c('0x8')][_0x62c081][_0xb01c('0x2a')]);clearTimeout(_0x3c6e85['timers'][_0x62c081]['timer']);_0x3c6e85[_0xb01c('0x8')][_0x62c081][_0xb01c('0x2c')]=![];RpcVoiceAgentReport[_0xb01c('0x2d')]({'acwtime':_0x4195b2},_0x3c6e85[_0xb01c('0x8')][_0x62c081][_0xb01c('0x2e')],_0x62c081)[_0xb01c('0x20')](function(_0x13016f){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x5a5585,_0x4195b2,_0x13016f);})[_0xb01c('0x2f')](function(_0x3b9188){logger['error'](_0xb01c('0x30'),_0x5a5585,_0x3b9188);});delete _0x3c6e85[_0xb01c('0x8')][_0x62c081];};}});}else{logger[_0xb01c('0x22')](_0xb01c('0x31'),_0x5a5585,_0x62c081,_0xcaf755);}});}})[_0xb01c('0x2f')](function(_0x3fcc3d){logger[_0xb01c('0x32')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5a5585,_0x3c6e85[_0xb01c('0x6')][_0xcaf755][_0xb01c('0x29')],_0x62c081,_0xcaf755);})[_0xb01c('0x33')](function(){delete _0x3c6e85[_0xb01c('0x9')][_0x5a5585];});}catch(_0x586114){logger[_0xb01c('0x32')]('[ACW][START]\x20%s',_0x586114[_0xb01c('0x34')]);}};Acw['prototype']['stopAcw']=function(_0x22c02b){try{var _0x533e37=this;if(_0x533e37[_0xb01c('0x8')][_0x22c02b]){_0x533e37['timers'][_0x22c02b][_0xb01c('0x2c')]=![];var _0x389e6a=_0x533e37['timers'][_0x22c02b][_0xb01c('0x2e')];var _0x5ee21c=_0x533e37[_0xb01c('0x8')][_0x22c02b][_0xb01c('0x19')];var _0x2c629c=_0x533e37[_0xb01c('0x6')][_0x5ee21c][_0xb01c('0x29')];logger['info'](_0xb01c('0x35'),_0x389e6a,_0x22c02b);RpcUser[_0xb01c('0x36')](this[_0xb01c('0x7')][_0x22c02b]);RpcVoiceAgentReport[_0xb01c('0x2d')]({'acwtime':_0x2c629c,'agentacw':!![]},_0x389e6a,_0x22c02b)[_0xb01c('0x20')](function(_0x166112){logger[_0xb01c('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x389e6a,_0x2c629c,_0x166112);})['catch'](function(_0x4ba073){logger[_0xb01c('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x389e6a,_0x4ba073);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x22c02b);if(_0x533e37[_0xb01c('0x8')]){logger[_0xb01c('0x22')]('[ACW][TIMERS]',JSON[_0xb01c('0x37')](_0x533e37['timers']));}}}catch(_0x1d0165){logger[_0xb01c('0x32')](_0xb01c('0x38'),_0x1d0165['message']);}};Acw[_0xb01c('0x16')][_0xb01c('0x39')]=function(_0x5822ed){try{if(this[_0xb01c('0x6')][_0x5822ed[_0xb01c('0x19')]]&&(this[_0xb01c('0x6')][_0x5822ed[_0xb01c('0x19')]][_0xb01c('0x3')]||this[_0xb01c('0x6')][_0x5822ed[_0xb01c('0x19')]][_0xb01c('0x1b')])){if(this[_0xb01c('0x7')][_0x5822ed[_0xb01c('0x18')]]){this['channels'][_0x5822ed[_0xb01c('0x2e')]]={'queue':_0x5822ed[_0xb01c('0x19')],'interface':_0x5822ed[_0xb01c('0x18')],'destlinkedid':_0x5822ed[_0xb01c('0x25')]};}}}catch(_0x2da156){logger[_0xb01c('0x32')](_0xb01c('0x3a'),_0x2da156['message']);}};Acw[_0xb01c('0x16')][_0xb01c('0x3b')]=function(_0x29ad29){try{if(this['voiceQueues'][_0x29ad29[_0xb01c('0x19')]]&&(this['voiceQueues'][_0x29ad29[_0xb01c('0x19')]][_0xb01c('0x3')]||this[_0xb01c('0x6')][_0x29ad29[_0xb01c('0x19')]][_0xb01c('0x1b')])){if(this[_0xb01c('0x7')][_0x29ad29[_0xb01c('0x18')]]){this['channels'][_0x29ad29[_0xb01c('0x2e')]]={'queue':_0x29ad29[_0xb01c('0x19')],'interface':_0x29ad29['interface']};}}}catch(_0x4570a1){logger[_0xb01c('0x32')](_0xb01c('0x3c'),_0x4570a1[_0xb01c('0x34')]);}};Acw[_0xb01c('0x16')][_0xb01c('0xb')]=function(_0xf82e3f){try{if(this[_0xb01c('0x9')][_0xf82e3f[_0xb01c('0x2e')]]&&_[_0xb01c('0x3d')](this[_0xb01c('0x9')][_0xf82e3f[_0xb01c('0x2e')]][_0xb01c('0x24')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0xf82e3f[_0xb01c('0x2e')]);this[_0xb01c('0x17')](_0xf82e3f[_0xb01c('0x2e')]);}else if(this['channels'][_0xf82e3f[_0xb01c('0x3e')]]&&_[_0xb01c('0x3d')](this[_0xb01c('0x9')][_0xf82e3f[_0xb01c('0x3e')]]['attended'])){logger[_0xb01c('0x22')]('[%s][HANGUP:LINKEDID]',_0xf82e3f[_0xb01c('0x3e')]);this[_0xb01c('0x17')](_0xf82e3f[_0xb01c('0x3e')]);}}catch(_0x32f78a){logger[_0xb01c('0x32')](_0xb01c('0x3f'),_0x32f78a['message']);}};Acw[_0xb01c('0x16')][_0xb01c('0x40')]=function(_0x46bd16){try{if(this[_0xb01c('0x9')][_0x46bd16[_0xb01c('0x2e')]]&&this[_0xb01c('0x9')][_0x46bd16['uniqueid']][_0xb01c('0x24')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x46bd16['uniqueid']);this[_0xb01c('0x17')](_0x46bd16[_0xb01c('0x2e')]);}else if(this[_0xb01c('0x9')][_0x46bd16[_0xb01c('0x3e')]]&&this[_0xb01c('0x9')][_0x46bd16[_0xb01c('0x3e')]][_0xb01c('0x24')]){logger[_0xb01c('0x22')](_0xb01c('0x41'),_0x46bd16[_0xb01c('0x3e')]);this[_0xb01c('0x17')](_0x46bd16['linkedid']);}}catch(_0x2b2bff){logger[_0xb01c('0x32')]('[ACW][syncHangup]\x20%s',_0x2b2bff[_0xb01c('0x34')]);}};Acw[_0xb01c('0x16')][_0xb01c('0x10')]=function(_0x1de3f1){try{if(!_[_0xb01c('0x42')](this[_0xb01c('0x9')][_0x1de3f1['transfereeuniqueid']])){this['startAcw'](_0x1de3f1[_0xb01c('0x43')]);if(this[_0xb01c('0x9')][_0x1de3f1[_0xb01c('0x44')]]){this['channels'][_0x1de3f1[_0xb01c('0x44')]][_0xb01c('0x24')]=!![];this[_0xb01c('0x9')][_0x1de3f1[_0xb01c('0x45')]]=this[_0xb01c('0x9')][_0x1de3f1['secondtransfereruniqueid']];delete this[_0xb01c('0x9')][_0x1de3f1[_0xb01c('0x44')]];}}else if(!_[_0xb01c('0x42')](this['channels'][_0x1de3f1[_0xb01c('0x45')]])){this['startAcw'](_0x1de3f1[_0xb01c('0x45')]);if(this['channels'][_0x1de3f1['origtransfereruniqueid']]){this[_0xb01c('0x9')][_0x1de3f1[_0xb01c('0x46')]]['attended']=!![];this['channels'][_0x1de3f1[_0xb01c('0x43')]]=this[_0xb01c('0x9')][_0x1de3f1[_0xb01c('0x46')]];delete this['channels'][_0x1de3f1[_0xb01c('0x46')]];}}}catch(_0x55bd84){logger[_0xb01c('0x32')](_0xb01c('0x47'),_0x55bd84[_0xb01c('0x34')]);}};Acw[_0xb01c('0x16')]['syncBlindTransfer']=function(_0x45a0e6){try{if(this[_0xb01c('0x9')][_0x45a0e6[_0xb01c('0x48')]]){logger[_0xb01c('0x22')](_0xb01c('0x49'),JSON['stringify'](_0x45a0e6[_0xb01c('0x48')]));this[_0xb01c('0x17')](_0x45a0e6[_0xb01c('0x48')]);}else if(this['channels'][_0x45a0e6[_0xb01c('0x4a')]]){logger[_0xb01c('0x22')](_0xb01c('0x4b'),JSON[_0xb01c('0x37')](_0x45a0e6[_0xb01c('0x4a')]));this[_0xb01c('0x17')](_0x45a0e6[_0xb01c('0x4a')]);}}catch(_0xe01dc7){logger[_0xb01c('0x32')](_0xb01c('0x4c'),_0xe01dc7['message']);}};Acw['prototype'][_0xb01c('0xe')]=function(_0x3adb0c){try{if(this[_0xb01c('0x6')][_0x3adb0c[_0xb01c('0x19')]]&&this[_0xb01c('0x6')][_0x3adb0c['queue']][_0xb01c('0x4d')]===_0xb01c('0x4e')){if(this[_0xb01c('0x7')][_0x3adb0c[_0xb01c('0x18')]]){logger[_0xb01c('0x22')](_0xb01c('0x4f'),_0x3adb0c[_0xb01c('0x2e')],_0x3adb0c[_0xb01c('0x18')],_0x3adb0c['queue']);return RpcUser[_0xb01c('0x26')](this['agents'][_0x3adb0c[_0xb01c('0x18')]],_0xb01c('0x50'),_0x3adb0c[_0xb01c('0x2e')]);}}}catch(_0x5a10fc){logger['error'](_0xb01c('0x51'),_0x5a10fc[_0xb01c('0x34')]);}};module[_0xb01c('0x52')]=Acw; \ No newline at end of file +var _0xc4c9=['savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','info','destlinkedid'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xc4c9,0x87));var _0x9c4c=function(_0x2e5f41,_0x5c7eea){_0x2e5f41=_0x2e5f41-0x0;var _0xcda89a=_0xc4c9[_0x2e5f41];return _0xcda89a;};'use strict';var util=require('util');var _=require(_0x9c4c('0x0'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x9c4c('0x1'))(_0x9c4c('0x2'));var RpcUser=require(_0x9c4c('0x3'));var RpcVoiceAgentReport=require(_0x9c4c('0x4'));function Acw(_0x1f516c){this[_0x9c4c('0x5')]=_0x1f516c[_0x9c4c('0x5')];this[_0x9c4c('0x6')]=_0x1f516c[_0x9c4c('0x6')];this[_0x9c4c('0x7')]=_0x1f516c[_0x9c4c('0x7')];this[_0x9c4c('0x8')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x9c4c('0x9')](this));ami['on'](_0x9c4c('0xa'),this[_0x9c4c('0xb')]['bind'](this));ami['on'](_0x9c4c('0xc'),this['syncHangup'][_0x9c4c('0x9')](this));ami['on'](_0x9c4c('0xd'),this[_0x9c4c('0xe')][_0x9c4c('0x9')](this));ami['on'](_0x9c4c('0xf'),this['syncAttendedTransfer'][_0x9c4c('0x9')](this));ami['on']('blindtransfer',this[_0x9c4c('0x10')][_0x9c4c('0x9')](this));ami['on'](_0x9c4c('0x11'),this[_0x9c4c('0x12')][_0x9c4c('0x9')](this));}function getDiff(_0x3fb971){var _0x1b97a8=moment()['milliseconds'](0x0);var _0x431fca=moment(_0x3fb971)['milliseconds'](0x0);return _0x1b97a8[_0x9c4c('0x13')](_0x431fca,_0x9c4c('0x14'));}Acw[_0x9c4c('0x15')][_0x9c4c('0x16')]=function(_0x58459b){try{var _0xf96b28=this;var _0x4b7834=this['channels'][_0x58459b][_0x9c4c('0x17')];var _0x293e6b=this[_0x9c4c('0x8')][_0x58459b]['queue'];var _0x25f68e=this[_0x9c4c('0x5')][_0x293e6b];var _0x23c4d8=![];var _0x3b3d2e=_0x9c4c('0x18');if(_0x25f68e[_0x9c4c('0x19')]){if(_0x25f68e[_0x9c4c('0x1a')][_0x9c4c('0x1b')]){_0x23c4d8=!![];_0x3b3d2e=_0x25f68e[_0x9c4c('0x1a')]['name'];}}ami['Action']({'action':_0x9c4c('0x1c'),'interface':_0x4b7834,'paused':!![],'reason':_0x3b3d2e})[_0x9c4c('0x1d')](function(_0x5d41d9){if(_0xf96b28[_0x9c4c('0x6')][_0x4b7834]){return RpcUser[_0x9c4c('0x1e')](_0xf96b28[_0x9c4c('0x6')][_0x4b7834]['id'])[_0x9c4c('0x1d')](function(_0x5c4647){if(_0x5c4647&&!_0x5c4647['voicePause']){logger[_0x9c4c('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x58459b,_0x4b7834,_0x293e6b);var _0x2b06e0=_0xf96b28[_0x9c4c('0x8')][_0x58459b]['attended']&&_0xf96b28[_0x9c4c('0x8')][_0x58459b][_0x9c4c('0x20')]?_0xf96b28['channels'][_0x58459b][_0x9c4c('0x20')]:_0x58459b;return RpcUser[_0x9c4c('0x21')](_0xf96b28[_0x9c4c('0x6')][_0x4b7834],_0x3b3d2e,_0x2b06e0)['then'](function(_0x2ea346){if(!_0x23c4d8){_0xf96b28['timers'][_0x4b7834]={};logger[_0x9c4c('0x1f')](_0x9c4c('0x22'),_0x58459b,_0xf96b28['voiceQueues'][_0x293e6b][_0x9c4c('0x23')],_0x4b7834,_0x293e6b);_0xf96b28[_0x9c4c('0x7')][_0x4b7834][_0x9c4c('0x24')]=setTimeout(_0xf96b28[_0x9c4c('0x25')][_0x9c4c('0x9')](_0xf96b28,_0x4b7834),_0xf96b28[_0x9c4c('0x5')][_0x293e6b][_0x9c4c('0x23')]*0x3e8);_0xf96b28[_0x9c4c('0x7')][_0x4b7834][_0x9c4c('0x26')]=moment()[_0x9c4c('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0xf96b28[_0x9c4c('0x7')][_0x4b7834][_0x9c4c('0x28')]=_0x58459b;_0xf96b28[_0x9c4c('0x7')][_0x4b7834][_0x9c4c('0x29')]=_0x293e6b;_0xf96b28[_0x9c4c('0x7')][_0x4b7834][_0x9c4c('0x2a')]=function(){var _0x5b0e20=getDiff(_0xf96b28['timers'][_0x4b7834]['lastPauseAt']);clearTimeout(_0xf96b28[_0x9c4c('0x7')][_0x4b7834]['timer']);_0xf96b28[_0x9c4c('0x7')][_0x4b7834][_0x9c4c('0x24')]=![];RpcVoiceAgentReport[_0x9c4c('0x2b')]({'acwtime':_0x5b0e20},_0xf96b28[_0x9c4c('0x7')][_0x4b7834][_0x9c4c('0x28')],_0x4b7834)[_0x9c4c('0x1d')](function(_0x50a686){logger['info'](_0x9c4c('0x2c'),_0x58459b,_0x5b0e20,_0x50a686);})['catch'](function(_0x3556e9){logger[_0x9c4c('0x2d')]('[%s][UPDATE][ERRORS:%s]',_0x58459b,_0x3556e9);});delete _0xf96b28['timers'][_0x4b7834];};}});}else{logger[_0x9c4c('0x1f')](_0x9c4c('0x2e'),_0x58459b,_0x4b7834,_0x293e6b);}});}})[_0x9c4c('0x2f')](function(_0x480b6f){logger[_0x9c4c('0x2d')](_0x9c4c('0x22'),_0x58459b,_0xf96b28['voiceQueues'][_0x293e6b][_0x9c4c('0x23')],_0x4b7834,_0x293e6b);})[_0x9c4c('0x30')](function(){delete _0xf96b28[_0x9c4c('0x8')][_0x58459b];});}catch(_0x38386f){logger[_0x9c4c('0x2d')](_0x9c4c('0x31'),_0x38386f[_0x9c4c('0x32')]);}};Acw[_0x9c4c('0x15')][_0x9c4c('0x25')]=function(_0x5dc392){try{var _0x3ed1f4=this;if(_0x3ed1f4[_0x9c4c('0x7')][_0x5dc392]){_0x3ed1f4[_0x9c4c('0x7')][_0x5dc392][_0x9c4c('0x24')]=![];var _0x1dbc9a=_0x3ed1f4[_0x9c4c('0x7')][_0x5dc392][_0x9c4c('0x28')];var _0x2bdcd8=_0x3ed1f4[_0x9c4c('0x7')][_0x5dc392]['queue'];var _0x226355=_0x3ed1f4[_0x9c4c('0x5')][_0x2bdcd8][_0x9c4c('0x23')];logger[_0x9c4c('0x1f')]('[%s][TIMER][STOP][AGENT:%s]',_0x1dbc9a,_0x5dc392);RpcUser[_0x9c4c('0x33')](this[_0x9c4c('0x6')][_0x5dc392]);RpcVoiceAgentReport[_0x9c4c('0x2b')]({'acwtime':_0x226355,'agentacw':!![]},_0x1dbc9a,_0x5dc392)[_0x9c4c('0x1d')](function(_0x38ebfc){logger[_0x9c4c('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x1dbc9a,_0x226355,_0x38ebfc);})[_0x9c4c('0x2f')](function(_0x12d478){logger[_0x9c4c('0x2d')](_0x9c4c('0x34'),_0x1dbc9a,_0x12d478);});}else{logger[_0x9c4c('0x2d')](_0x9c4c('0x35'),_0x5dc392);if(_0x3ed1f4[_0x9c4c('0x7')]){logger[_0x9c4c('0x1f')](_0x9c4c('0x36'),JSON[_0x9c4c('0x37')](_0x3ed1f4[_0x9c4c('0x7')]));}}}catch(_0x3a0142){logger['error'](_0x9c4c('0x38'),_0x3a0142[_0x9c4c('0x32')]);}};Acw['prototype']['syncAgentConnect']=function(_0x218371){try{if(this[_0x9c4c('0x5')][_0x218371[_0x9c4c('0x29')]]&&(this[_0x9c4c('0x5')][_0x218371[_0x9c4c('0x29')]][_0x9c4c('0x2')]||this[_0x9c4c('0x5')][_0x218371[_0x9c4c('0x29')]][_0x9c4c('0x19')])){if(this['agents'][_0x218371[_0x9c4c('0x17')]]){this['channels'][_0x218371[_0x9c4c('0x28')]]={'queue':_0x218371[_0x9c4c('0x29')],'interface':_0x218371[_0x9c4c('0x17')],'destlinkedid':_0x218371['destlinkedid']};}}}catch(_0x3bc770){logger[_0x9c4c('0x2d')](_0x9c4c('0x39'),_0x3bc770['message']);}};Acw['prototype'][_0x9c4c('0x12')]=function(_0x4159e8){try{if(this[_0x9c4c('0x5')][_0x4159e8[_0x9c4c('0x29')]]&&(this[_0x9c4c('0x5')][_0x4159e8[_0x9c4c('0x29')]]['acw']||this[_0x9c4c('0x5')][_0x4159e8[_0x9c4c('0x29')]][_0x9c4c('0x19')])){if(this[_0x9c4c('0x6')][_0x4159e8[_0x9c4c('0x17')]]){this[_0x9c4c('0x8')][_0x4159e8['uniqueid']]={'queue':_0x4159e8[_0x9c4c('0x29')],'interface':_0x4159e8['interface']};}}}catch(_0xd30f57){logger[_0x9c4c('0x2d')](_0x9c4c('0x3a'),_0xd30f57['message']);}};Acw['prototype'][_0x9c4c('0xb')]=function(_0x5d76bb){try{if(this[_0x9c4c('0x8')][_0x5d76bb['uniqueid']]&&_[_0x9c4c('0x3b')](this['channels'][_0x5d76bb[_0x9c4c('0x28')]][_0x9c4c('0x3c')])){logger[_0x9c4c('0x1f')](_0x9c4c('0x3d'),_0x5d76bb[_0x9c4c('0x28')]);this['startAcw'](_0x5d76bb[_0x9c4c('0x28')]);}else if(this[_0x9c4c('0x8')][_0x5d76bb[_0x9c4c('0x3e')]]&&_[_0x9c4c('0x3b')](this[_0x9c4c('0x8')][_0x5d76bb[_0x9c4c('0x3e')]]['attended'])){logger[_0x9c4c('0x1f')](_0x9c4c('0x3f'),_0x5d76bb[_0x9c4c('0x3e')]);this['startAcw'](_0x5d76bb[_0x9c4c('0x3e')]);}}catch(_0x4c4875){logger['error'](_0x9c4c('0x40'),_0x4c4875[_0x9c4c('0x32')]);}};Acw[_0x9c4c('0x15')][_0x9c4c('0x41')]=function(_0x3f691d){try{if(this[_0x9c4c('0x8')][_0x3f691d[_0x9c4c('0x28')]]&&this[_0x9c4c('0x8')][_0x3f691d[_0x9c4c('0x28')]][_0x9c4c('0x3c')]){logger[_0x9c4c('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3f691d[_0x9c4c('0x28')]);this[_0x9c4c('0x16')](_0x3f691d[_0x9c4c('0x28')]);}else if(this[_0x9c4c('0x8')][_0x3f691d[_0x9c4c('0x3e')]]&&this[_0x9c4c('0x8')][_0x3f691d[_0x9c4c('0x3e')]][_0x9c4c('0x3c')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3f691d[_0x9c4c('0x3e')]);this[_0x9c4c('0x16')](_0x3f691d[_0x9c4c('0x3e')]);}}catch(_0x29f804){logger['error']('[ACW][syncHangup]\x20%s',_0x29f804[_0x9c4c('0x32')]);}};Acw['prototype'][_0x9c4c('0x42')]=function(_0xf60d9f){try{if(!_[_0x9c4c('0x43')](this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x44')]])){this[_0x9c4c('0x16')](_0xf60d9f[_0x9c4c('0x44')]);if(this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x45')]]){this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x45')]][_0x9c4c('0x3c')]=!![];this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x46')]]=this['channels'][_0xf60d9f[_0x9c4c('0x45')]];delete this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x45')]];}}else if(!_[_0x9c4c('0x43')](this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x46')]])){this[_0x9c4c('0x16')](_0xf60d9f['transfertargetuniqueid']);if(this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x47')]]){this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x47')]][_0x9c4c('0x3c')]=!![];this['channels'][_0xf60d9f[_0x9c4c('0x44')]]=this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x47')]];delete this[_0x9c4c('0x8')][_0xf60d9f[_0x9c4c('0x47')]];}}}catch(_0x43ac63){logger[_0x9c4c('0x2d')](_0x9c4c('0x48'),_0x43ac63[_0x9c4c('0x32')]);}};Acw[_0x9c4c('0x15')][_0x9c4c('0x10')]=function(_0x56e42a){try{if(this[_0x9c4c('0x8')][_0x56e42a[_0x9c4c('0x49')]]){logger[_0x9c4c('0x1f')](_0x9c4c('0x4a'),JSON[_0x9c4c('0x37')](_0x56e42a[_0x9c4c('0x49')]));this['startAcw'](_0x56e42a[_0x9c4c('0x49')]);}else if(this[_0x9c4c('0x8')][_0x56e42a[_0x9c4c('0x4b')]]){logger[_0x9c4c('0x1f')](_0x9c4c('0x4c'),JSON['stringify'](_0x56e42a[_0x9c4c('0x4b')]));this[_0x9c4c('0x16')](_0x56e42a['transfererlinkedid']);}}catch(_0x1bd4bc){logger['error'](_0x9c4c('0x4d'),_0x1bd4bc['message']);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x16a183){try{if(this[_0x9c4c('0x5')][_0x16a183[_0x9c4c('0x29')]]&&this[_0x9c4c('0x5')][_0x16a183[_0x9c4c('0x29')]][_0x9c4c('0x4e')]===_0x9c4c('0x4f')){if(this[_0x9c4c('0x6')][_0x16a183[_0x9c4c('0x17')]]){logger[_0x9c4c('0x1f')](_0x9c4c('0x50'),_0x16a183[_0x9c4c('0x28')],_0x16a183[_0x9c4c('0x17')],_0x16a183[_0x9c4c('0x29')]);return RpcUser[_0x9c4c('0x21')](this[_0x9c4c('0x6')][_0x16a183[_0x9c4c('0x17')]],_0x9c4c('0x51'),_0x16a183[_0x9c4c('0x28')]);}}}catch(_0x79e405){logger[_0x9c4c('0x2d')](_0x9c4c('0x52'),_0x79e405['message']);}};module[_0x9c4c('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index cccaa31..2b1a4fb 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 _0xa7bf=['sippeerstatus','queuesummary','actionCoreShowChannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionQueueSummary','catch','log','exports','bluebird','moment','util','lodash','../../config/logger','../../config/environment','port','asterisk','username','password','keepConnected','Action','error','inspect','actionSipShowRegistry','devicestatelist','actionSipPeerStatus'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0xa7bf,0x14d));var _0xfa7b=function(_0x17feac,_0x2b88b5){_0x17feac=_0x17feac-0x0;var _0x5c064b=_0xa7bf[_0x17feac];return _0x5c064b;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xfa7b('0x0'));var moment=require(_0xfa7b('0x1'));var util=require(_0xfa7b('0x2'));var _=require(_0xfa7b('0x3'));var logger=require(_0xfa7b('0x4'))('ami');var config=require(_0xfa7b('0x5'));var ami=new Manager(config['asterisk'][_0xfa7b('0x6')],config['asterisk']['ip'],config[_0xfa7b('0x7')][_0xfa7b('0x8')],config[_0xfa7b('0x7')][_0xfa7b('0x9')],!![]);ami[_0xfa7b('0xa')]();ami[_0xfa7b('0xb')]=BPromise['promisify'](ami['action']);function error(_0x3ecc96){logger[_0xfa7b('0xc')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xfa7b('0x8')],config[_0xfa7b('0x7')]['ip'],config['asterisk'][_0xfa7b('0x6')],util[_0xfa7b('0xd')](_0x3ecc96,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xfa7b('0x7')][_0xfa7b('0x8')],config['asterisk']['ip'],config[_0xfa7b('0x7')][_0xfa7b('0x6')]));}ami[_0xfa7b('0xe')]=function(){return function(){return ami[_0xfa7b('0xb')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xfa7b('0xf')});};};ami[_0xfa7b('0x10')]=function(){return function(){return ami[_0xfa7b('0xb')]({'action':_0xfa7b('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xfa7b('0xb')]({'action':_0xfa7b('0x12')});};};ami[_0xfa7b('0x13')]=function(){return function(){return ami[_0xfa7b('0xb')]({'action':'coreshowchannels'});};};function connect(_0xdb7e20){logger[_0xfa7b('0x14')](util[_0xfa7b('0x15')](_0xfa7b('0x16'),config[_0xfa7b('0x7')][_0xfa7b('0x8')],config[_0xfa7b('0x7')]['ip'],config[_0xfa7b('0x7')]['port']));ami[_0xfa7b('0x17')](_0xfa7b('0xc'),error);ami[_0xfa7b('0x17')](_0xfa7b('0x18'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x5211d7){logger[_0xfa7b('0x14')](util[_0xfa7b('0x15')](_0xfa7b('0x19'),config[_0xfa7b('0x7')][_0xfa7b('0x8')],config[_0xfa7b('0x7')]['ip'],config[_0xfa7b('0x7')][_0xfa7b('0x6')],util['inspect'](_0x5211d7,![],null)));});ami['on'](_0xfa7b('0x1a'),function(_0x1fdd62){logger[_0xfa7b('0x14')](util['format'](_0xfa7b('0x1b'),config[_0xfa7b('0x7')]['username'],config[_0xfa7b('0x7')]['ip'],config[_0xfa7b('0x7')][_0xfa7b('0x6')]));return BPromise[_0xfa7b('0x1c')]()[_0xfa7b('0x1d')](ami[_0xfa7b('0xe')]())[_0xfa7b('0x1d')](ami[_0xfa7b('0x1e')]())['then'](ami['actionSipPeerStatus']())[_0xfa7b('0x1d')](ami[_0xfa7b('0x1f')]())[_0xfa7b('0x1d')](ami[_0xfa7b('0x13')]())[_0xfa7b('0x20')](function(_0x4f99c7){console[_0xfa7b('0x21')](_0x4f99c7);});});ami[_0xfa7b('0x17')](_0xfa7b('0xc'),error);ami[_0xfa7b('0x17')](_0xfa7b('0x18'),close);module[_0xfa7b('0x22')]=ami; \ No newline at end of file +var _0x5f7f=['catch','log','exports','asterisk-manager','moment','lodash','ami','../../config/environment','asterisk','port','username','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','actionCoreShowChannels'];(function(_0x5389bc,_0x40bc54){var _0x5f51b7=function(_0x187475){while(--_0x187475){_0x5389bc['push'](_0x5389bc['shift']());}};_0x5f51b7(++_0x40bc54);}(_0x5f7f,0x12b));var _0xf5f7=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f7f[_0x3947c9];return _0x2e7871;};'use strict';var Manager=require(_0xf5f7('0x0'));var BPromise=require('bluebird');var moment=require(_0xf5f7('0x1'));var util=require('util');var _=require(_0xf5f7('0x2'));var logger=require('../../config/logger')(_0xf5f7('0x3'));var config=require(_0xf5f7('0x4'));var ami=new Manager(config[_0xf5f7('0x5')][_0xf5f7('0x6')],config[_0xf5f7('0x5')]['ip'],config[_0xf5f7('0x5')][_0xf5f7('0x7')],config[_0xf5f7('0x5')][_0xf5f7('0x8')],!![]);ami['keepConnected']();ami[_0xf5f7('0x9')]=BPromise[_0xf5f7('0xa')](ami[_0xf5f7('0xb')]);function error(_0x2c9a12){logger[_0xf5f7('0xc')](util[_0xf5f7('0xd')](_0xf5f7('0xe'),config[_0xf5f7('0x5')][_0xf5f7('0x7')],config['asterisk']['ip'],config['asterisk']['port'],util[_0xf5f7('0xf')](_0x2c9a12,![],null)));}function close(){logger[_0xf5f7('0xc')](util[_0xf5f7('0xd')](_0xf5f7('0x10'),config[_0xf5f7('0x5')][_0xf5f7('0x7')],config[_0xf5f7('0x5')]['ip'],config[_0xf5f7('0x5')]['port']));}ami[_0xf5f7('0x11')]=function(){return function(){return ami[_0xf5f7('0x9')]({'action':_0xf5f7('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xf5f7('0x9')]({'action':_0xf5f7('0x13')});};};ami[_0xf5f7('0x14')]=function(){return function(){return ami['Action']({'action':_0xf5f7('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xf5f7('0x9')]({'action':_0xf5f7('0x16')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(_0x36dedb){logger['info'](util[_0xf5f7('0xd')](_0xf5f7('0x17'),config['asterisk'][_0xf5f7('0x7')],config[_0xf5f7('0x5')]['ip'],config[_0xf5f7('0x5')][_0xf5f7('0x6')]));ami[_0xf5f7('0x18')](_0xf5f7('0xc'),error);ami[_0xf5f7('0x18')](_0xf5f7('0x19'),close);}ami['on'](_0xf5f7('0x1a'),connect);ami['on']('shutdown',function(_0x4b321a){logger[_0xf5f7('0x1b')](util[_0xf5f7('0xd')](_0xf5f7('0x1c'),config[_0xf5f7('0x5')][_0xf5f7('0x7')],config[_0xf5f7('0x5')]['ip'],config[_0xf5f7('0x5')]['port'],util[_0xf5f7('0xf')](_0x4b321a,![],null)));});ami['on']('fullybooted',function(_0xf9b2e0){logger[_0xf5f7('0x1b')](util[_0xf5f7('0xd')](_0xf5f7('0x1d'),config[_0xf5f7('0x5')]['username'],config['asterisk']['ip'],config[_0xf5f7('0x5')][_0xf5f7('0x6')]));return BPromise[_0xf5f7('0x1e')]()[_0xf5f7('0x1f')](ami[_0xf5f7('0x11')]())[_0xf5f7('0x1f')](ami['actionDeviceStateList']())[_0xf5f7('0x1f')](ami[_0xf5f7('0x14')]())['then'](ami[_0xf5f7('0x20')]())[_0xf5f7('0x1f')](ami[_0xf5f7('0x21')]())[_0xf5f7('0x22')](function(_0x9a9f76){console[_0xf5f7('0x23')](_0x9a9f76);});});ami[_0xf5f7('0x18')](_0xf5f7('0xc'),error);ami['once'](_0xf5f7('0x19'),close);module[_0xf5f7('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a45b899..089587c 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x1a154c,_0x3810c1){var _0x51da5f=function(_0x5c2103){while(--_0x5c2103){_0x1a154c['push'](_0x1a154c['shift']());}};_0x51da5f(++_0x3810c1);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3c3698,_0xa0bf08){_0x3c3698=_0x3c3698-0x0;var _0x4e6637=_0xbdb7[_0x3c3698];return _0x4e6637;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda3f,0xec));var _0xfda3=function(_0x4e1894,_0x532c21){_0x4e1894=_0x4e1894-0x0;var _0x32188c=_0xda3f[_0x4e1894];return _0x32188c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 17e260c..ddb73e9 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d4b=['ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId'];(function(_0x26be60,_0x4859a4){var _0x5c6cc9=function(_0x4ece41){while(--_0x4ece41){_0x26be60['push'](_0x26be60['shift']());}};_0x5c6cc9(++_0x4859a4);}(_0x1d4b,0x1cb));var _0xb1d4=function(_0x11b8f4,_0x210f0a){_0x11b8f4=_0x11b8f4-0x0;var _0x30972c=_0x1d4b[_0x11b8f4];return _0x30972c;};'use strict';var util=require(_0xb1d4('0x0'));var _=require(_0xb1d4('0x1'));var moment=require(_0xb1d4('0x2'));function checkNameSurname(_0x1ba4f1,_0xa8921f,_0x1d3acc){var _0x1c3587='';if(!_[_0xb1d4('0x3')](_0xa8921f)&&_0xb1d4('0x4')===typeof _0xa8921f){_0x1c3587+=_0xa8921f;}if(!_[_0xb1d4('0x3')](_0x1d3acc)&&_0xb1d4('0x4')===typeof _0x1d3acc){_0x1c3587+='\x20'+_0x1d3acc;}if(_0x1c3587!==''){return _0x1c3587;}return _0x1ba4f1;}function Action(_0x266788,_0x953b53,_0x1ebe1b){this['voiceQueue']=_0x266788;this[_0xb1d4('0x5')]=_0x1ebe1b||undefined;this[_0xb1d4('0x6')]=checkNameSurname(_0x953b53[_0xb1d4('0x7')][_0xb1d4('0x8')],_0x953b53['Contact'][_0xb1d4('0x9')],_0x953b53['Contact'][_0xb1d4('0xa')]);this[_0xb1d4('0xb')]=_0x953b53[_0xb1d4('0x7')][_0xb1d4('0x8')];this[_0xb1d4('0xc')]=_0x266788[_0xb1d4('0x6')];this[_0xb1d4('0xd')]=_0x953b53[_0xb1d4('0xd')]||![];this[_0xb1d4('0xe')]=_0x266788[_0xb1d4('0xe')];this['dialQueueTimeout']=_0x266788[_0xb1d4('0xf')]||0x3;this[_0xb1d4('0x10')]=_0x953b53[_0xb1d4('0x10')];this['countbusyretry']=_0x953b53[_0xb1d4('0x11')];this[_0xb1d4('0x12')]=_0x953b53['countcongestionretry'];this['countnoanswerretry']=_0x953b53[_0xb1d4('0x13')];this['countnosuchnumberretry']=_0x953b53[_0xb1d4('0x14')];this['countdropretry']=_0x953b53[_0xb1d4('0x15')];this[_0xb1d4('0x16')]=_0x953b53[_0xb1d4('0x16')];this['countmachineretry']=_0x953b53['countmachineretry'];this[_0xb1d4('0x17')]=_0x953b53[_0xb1d4('0x17')];this[_0xb1d4('0x18')]=_0x953b53[_0xb1d4('0x18')];this[_0xb1d4('0x19')]=_0x953b53['ListId'];this['UserId']=_0x953b53[_0xb1d4('0x1a')];this[_0xb1d4('0x1b')]=_0x953b53[_0xb1d4('0x1b')];this[_0xb1d4('0x1c')]=_0x953b53[_0xb1d4('0x1c')];this['idHopper']=_0x953b53['id'];this[_0xb1d4('0x1d')]=_0x953b53['Contact'][_0xb1d4('0x9')]||'';this['starttime']=moment()[_0xb1d4('0x1e')](_0xb1d4('0x1f'));this[_0xb1d4('0x20')]=_0x953b53[_0xb1d4('0x20')];this['callbackuniqueid']=_0x953b53[_0xb1d4('0x21')];this['callbackat']=_0x953b53[_0xb1d4('0x22')];this[_0xb1d4('0x23')]=_0x953b53[_0xb1d4('0x23')];this[_0xb1d4('0x24')]='';this[_0xb1d4('0x25')]='';}Action[_0xb1d4('0x26')][_0xb1d4('0x27')]=function(){return util[_0xb1d4('0x1e')](_0xb1d4('0x28'),this[_0xb1d4('0x6')],this['voiceQueue'][_0xb1d4('0x29')]>0x0?this[_0xb1d4('0xb')][_0xb1d4('0x2a')](this['voiceQueue'][_0xb1d4('0x29')]):this[_0xb1d4('0xb')]);};Action[_0xb1d4('0x26')]['getQueue']=function(){return this['queue'];};module[_0xb1d4('0x2b')]=Action; \ No newline at end of file +var _0x5622=['CampaignId','idHopper','firstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','queue','lodash','string','isNil','voiceQueue','uniqueid','name','Contact','phone','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x2a643b,_0x9d71a3){var _0x70a406=function(_0x483250){while(--_0x483250){_0x2a643b['push'](_0x2a643b['shift']());}};_0x70a406(++_0x9d71a3);}(_0x5622,0xb5));var _0x2562=function(_0x3c0216,_0x23e80d){_0x3c0216=_0x3c0216-0x0;var _0x2bdd93=_0x5622[_0x3c0216];return _0x2bdd93;};'use strict';var util=require('util');var _=require(_0x2562('0x0'));var moment=require('moment');function checkNameSurname(_0x147c09,_0x574940,_0x53f99e){var _0x4f43b1='';if(!_['isNil'](_0x574940)&&_0x2562('0x1')===typeof _0x574940){_0x4f43b1+=_0x574940;}if(!_[_0x2562('0x2')](_0x53f99e)&&_0x2562('0x1')===typeof _0x53f99e){_0x4f43b1+='\x20'+_0x53f99e;}if(_0x4f43b1!==''){return _0x4f43b1;}return _0x147c09;}function Action(_0x4507b6,_0x2dd3f0,_0x55f353){this[_0x2562('0x3')]=_0x4507b6;this[_0x2562('0x4')]=_0x55f353||undefined;this[_0x2562('0x5')]=checkNameSurname(_0x2dd3f0[_0x2562('0x6')][_0x2562('0x7')],_0x2dd3f0[_0x2562('0x6')]['firstName'],_0x2dd3f0['Contact'][_0x2562('0x8')]);this['number']=_0x2dd3f0['Contact']['phone'];this['queue']=_0x4507b6[_0x2562('0x5')];this[_0x2562('0x9')]=_0x2dd3f0[_0x2562('0x9')]||![];this[_0x2562('0xa')]=_0x4507b6[_0x2562('0xa')];this[_0x2562('0xb')]=_0x4507b6[_0x2562('0xb')]||0x3;this[_0x2562('0xc')]=_0x2dd3f0[_0x2562('0xc')];this[_0x2562('0xd')]=_0x2dd3f0[_0x2562('0xd')];this['countcongestionretry']=_0x2dd3f0['countcongestionretry'];this[_0x2562('0xe')]=_0x2dd3f0['countnoanswerretry'];this[_0x2562('0xf')]=_0x2dd3f0['countnosuchnumberretry'];this[_0x2562('0x10')]=_0x2dd3f0[_0x2562('0x10')];this[_0x2562('0x11')]=_0x2dd3f0['countabandonedretry'];this[_0x2562('0x12')]=_0x2dd3f0[_0x2562('0x12')];this['countagentrejectretry']=_0x2dd3f0[_0x2562('0x13')];this['ContactId']=_0x2dd3f0[_0x2562('0x14')];this['ListId']=_0x2dd3f0[_0x2562('0x15')];this[_0x2562('0x16')]=_0x2dd3f0[_0x2562('0x16')];this[_0x2562('0x17')]=_0x2dd3f0['VoiceQueueId'];this['CampaignId']=_0x2dd3f0[_0x2562('0x18')];this[_0x2562('0x19')]=_0x2dd3f0['id'];this['ContactFirstName']=_0x2dd3f0[_0x2562('0x6')][_0x2562('0x1a')]||'';this['starttime']=moment()['format'](_0x2562('0x1b'));this[_0x2562('0x1c')]=_0x2dd3f0[_0x2562('0x1c')];this['callbackuniqueid']=_0x2dd3f0[_0x2562('0x1d')];this[_0x2562('0x1e')]=_0x2dd3f0['callbackat'];this[_0x2562('0x1f')]=_0x2dd3f0[_0x2562('0x1f')];this[_0x2562('0x20')]='';this[_0x2562('0x21')]='';}Action[_0x2562('0x22')][_0x2562('0x23')]=function(){return util['format'](_0x2562('0x24'),this[_0x2562('0x5')],this['voiceQueue'][_0x2562('0x25')]>0x0?this[_0x2562('0x26')][_0x2562('0x27')](this[_0x2562('0x3')][_0x2562('0x25')]):this['number']);};Action[_0x2562('0x22')]['getQueue']=function(){return this[_0x2562('0x28')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 429357f..75cc9d1 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0541=['uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0541,0x14d));var _0x1054=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x0541[_0x2aecb2];return _0x3ebb80;};'use strict';var util=require('util');var _=require(_0x1054('0x0'));var moment=require(_0x1054('0x1'));function getSeconds(_0x259312,_0x4392c1){var _0x21d474=moment(_0x259312)[_0x1054('0x2')](0x0);var _0x379be2=moment(_0x4392c1)[_0x1054('0x2')](0x0);return _0x21d474[_0x1054('0x3')](_0x379be2,'seconds');}function AgentComplete(_0x469963,_0x2c5840){this[_0x1054('0x4')]=0x4;this[_0x1054('0x5')]=_0x1054('0x6');this[_0x1054('0x7')]=_0x469963[_0x1054('0x7')];this[_0x1054('0x8')]=_0x469963[_0x1054('0x8')];this['campaigntype']=_0x469963[_0x1054('0x8')]===_0x1054('0x9')?'queue':_0x469963['type'];this[_0x1054('0xa')]=_0x469963[_0x1054('0xa')];this[_0x1054('0xb')]=_0x469963[_0x1054('0xb')];this[_0x1054('0xc')]=_0x469963[_0x1054('0xc')];this[_0x1054('0xd')]=_0x469963['countbusyretry']+_0x469963[_0x1054('0xb')]+_0x469963['countnoanswerretry']+_0x469963[_0x1054('0xe')]+_0x469963[_0x1054('0xf')]+_0x469963[_0x1054('0x10')]+_0x469963[_0x1054('0x11')]+_0x469963[_0x1054('0x12')];this['countnosuchnumberretry']=_0x469963[_0x1054('0xe')];this[_0x1054('0xf')]=_0x469963[_0x1054('0xf')];this[_0x1054('0x10')]=_0x469963[_0x1054('0x10')];this[_0x1054('0x11')]=_0x469963[_0x1054('0x11')];this[_0x1054('0x12')]=_0x469963['countagentrejectretry'];this[_0x1054('0x13')]=_0x2c5840[_0x1054('0x13')];this[_0x1054('0x14')]=_0x469963[_0x1054('0x15')];this['calleridnum']=_0x469963[_0x1054('0x16')];this[_0x1054('0x17')]=_0x469963[_0x1054('0x17')];this['responsetime']=_0x469963[_0x1054('0x18')];this['answertime']=_0x469963[_0x1054('0x19')];this['endtime']=moment()[_0x1054('0x1a')](_0x1054('0x1b'));this['ringtime']=getSeconds(_0x469963['responsetime'],_0x469963[_0x1054('0x17')]);this[_0x1054('0x1c')]=getSeconds(_0x469963[_0x1054('0x19')],_0x469963[_0x1054('0x18')]);this[_0x1054('0x1d')]=getSeconds(this['endtime'],_0x469963[_0x1054('0x19')]);this['queue']=_0x2c5840[_0x1054('0x1e')];this['membername']=_0x2c5840[_0x1054('0x1f')];this[_0x1054('0x20')]=_0x2c5840['reason'];this[_0x1054('0x21')]=_0x469963[_0x1054('0x21')];this[_0x1054('0x22')]=_0x469963[_0x1054('0x22')];this[_0x1054('0x23')]=_0x469963[_0x1054('0x23')];this['recallme']=_0x469963[_0x1054('0x24')];this[_0x1054('0x25')]=_0x469963[_0x1054('0x25')];this[_0x1054('0x26')]=_0x469963[_0x1054('0x26')];this['UserId']=_0x469963['UserId'];this[_0x1054('0x27')]=_0x469963[_0x1054('0x27')];this['CampaignId']=_0x469963[_0x1054('0x28')];this[_0x1054('0x29')]=_0x469963[_0x1054('0x29')]||'';this['originatecalleridname']=_0x469963[_0x1054('0x2a')]||'';}module[_0x1054('0x2b')]=AgentComplete; \ No newline at end of file +var _0x22bc=['type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','seconds','statedesc','Answer','scheduledat'];(function(_0x50f0a1,_0x2449ab){var _0x43371f=function(_0x841c04){while(--_0x841c04){_0x50f0a1['push'](_0x50f0a1['shift']());}};_0x43371f(++_0x2449ab);}(_0x22bc,0x17d));var _0xc22b=function(_0xee133f,_0x224a72){_0xee133f=_0xee133f-0x0;var _0x4b40ee=_0x22bc[_0xee133f];return _0x4b40ee;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x194d3f,_0x246b3e){var _0x22a99b=moment(_0x194d3f)['milliseconds'](0x0);var _0x248685=moment(_0x246b3e)[_0xc22b('0x0')](0x0);return _0x22a99b[_0xc22b('0x1')](_0x248685,_0xc22b('0x2'));}function AgentComplete(_0x190873,_0x400d6e){this['state']=0x4;this[_0xc22b('0x3')]=_0xc22b('0x4');this[_0xc22b('0x5')]=_0x190873[_0xc22b('0x5')];this['type']=_0x190873[_0xc22b('0x6')];this['campaigntype']=_0x190873['type']==='outbound'?_0xc22b('0x7'):_0x190873[_0xc22b('0x6')];this['countbusyretry']=_0x190873[_0xc22b('0x8')];this[_0xc22b('0x9')]=_0x190873[_0xc22b('0x9')];this[_0xc22b('0xa')]=_0x190873[_0xc22b('0xa')];this[_0xc22b('0xb')]=_0x190873['countbusyretry']+_0x190873[_0xc22b('0x9')]+_0x190873[_0xc22b('0xa')]+_0x190873[_0xc22b('0xc')]+_0x190873[_0xc22b('0xd')]+_0x190873['countabandonedretry']+_0x190873[_0xc22b('0xe')]+_0x190873[_0xc22b('0xf')];this[_0xc22b('0xc')]=_0x190873[_0xc22b('0xc')];this[_0xc22b('0xd')]=_0x190873['countdropretry'];this[_0xc22b('0x10')]=_0x190873[_0xc22b('0x10')];this[_0xc22b('0xe')]=_0x190873[_0xc22b('0xe')];this['countagentrejectretry']=_0x190873[_0xc22b('0xf')];this['uniqueid']=_0x400d6e[_0xc22b('0x11')];this[_0xc22b('0x12')]=_0x190873[_0xc22b('0x13')];this['calleridnum']=_0x190873[_0xc22b('0x14')];this[_0xc22b('0x15')]=_0x190873[_0xc22b('0x15')];this[_0xc22b('0x16')]=_0x190873[_0xc22b('0x16')];this['answertime']=_0x190873[_0xc22b('0x17')];this[_0xc22b('0x18')]=moment()[_0xc22b('0x19')](_0xc22b('0x1a'));this[_0xc22b('0x1b')]=getSeconds(_0x190873[_0xc22b('0x16')],_0x190873[_0xc22b('0x15')]);this[_0xc22b('0x1c')]=getSeconds(_0x190873[_0xc22b('0x17')],_0x190873[_0xc22b('0x16')]);this[_0xc22b('0x1d')]=getSeconds(this[_0xc22b('0x18')],_0x190873[_0xc22b('0x17')]);this['queue']=_0x400d6e['queue'];this[_0xc22b('0x1e')]=_0x400d6e[_0xc22b('0x1e')];this[_0xc22b('0x1f')]=_0x400d6e[_0xc22b('0x1f')];this[_0xc22b('0x20')]=_0x190873[_0xc22b('0x20')];this['callbackuniqueid']=_0x190873['callbackuniqueid'];this[_0xc22b('0x21')]=_0x190873['callbackat'];this[_0xc22b('0x22')]=_0x190873['recallme'];this[_0xc22b('0x23')]=_0x190873[_0xc22b('0x23')];this[_0xc22b('0x24')]=_0x190873[_0xc22b('0x24')];this['UserId']=_0x190873[_0xc22b('0x25')];this[_0xc22b('0x26')]=_0x190873[_0xc22b('0x26')];this[_0xc22b('0x27')]=_0x190873[_0xc22b('0x27')];this[_0xc22b('0x28')]=_0x190873[_0xc22b('0x28')]||'';this[_0xc22b('0x29')]=_0x190873[_0xc22b('0x29')]||'';}module[_0xc22b('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 2d18697..418a85e 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x032e=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x539c87,_0x2a4890){var _0x4593f5=function(_0x3af5fc){while(--_0x3af5fc){_0x539c87['push'](_0x539c87['shift']());}};_0x4593f5(++_0x2a4890);}(_0x032e,0x124));var _0xe032=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x032e[_0x24237f];return _0x48298e;};'use strict';var util=require(_0xe032('0x0'));var _=require('lodash');var moment=require(_0xe032('0x1'));function getSeconds(_0x1cf95c,_0x5ca562){var _0x4afba2=moment(_0x1cf95c)[_0xe032('0x2')](0x0);var _0x2ce001=moment(_0x5ca562)[_0xe032('0x2')](0x0);return _0x4afba2[_0xe032('0x3')](_0x2ce001,_0xe032('0x4'));}function Final(_0x420020){this[_0xe032('0x5')]=_0x420020[_0xe032('0x5')];this[_0xe032('0x6')]=_0x420020[_0xe032('0x6')];this[_0xe032('0x7')]=_0x420020[_0xe032('0x7')];this[_0xe032('0x8')]=_0x420020[_0xe032('0x7')]===_0xe032('0x9')?_0xe032('0xa'):_0x420020[_0xe032('0x7')];this[_0xe032('0xb')]=_0x420020['countbusyretry'];this[_0xe032('0xc')]=_0x420020[_0xe032('0xc')];this[_0xe032('0xd')]=_0x420020[_0xe032('0xd')];this[_0xe032('0xe')]=_0x420020[_0xe032('0xb')]+_0x420020[_0xe032('0xc')]+_0x420020['countnoanswerretry']+_0x420020[_0xe032('0xf')]+_0x420020[_0xe032('0x10')]+_0x420020[_0xe032('0x11')]+_0x420020[_0xe032('0x12')]+_0x420020['countagentrejectretry'];this[_0xe032('0xf')]=_0x420020[_0xe032('0xf')];this[_0xe032('0x10')]=_0x420020[_0xe032('0x10')];this[_0xe032('0x11')]=_0x420020[_0xe032('0x11')];this[_0xe032('0x12')]=_0x420020['countmachineretry'];this[_0xe032('0x13')]=_0x420020[_0xe032('0x13')];this[_0xe032('0xa')]=_0x420020[_0xe032('0xa')];this[_0xe032('0x14')]=_0x420020[_0xe032('0x14')];this['calleridnum']=_0x420020[_0xe032('0x15')];this[_0xe032('0x16')]=_0x420020[_0xe032('0x16')];this[_0xe032('0x17')]=_0x420020[_0xe032('0x17')];this['endtime']=_0x420020['responsetime'];this['ringtime']=_0x420020[_0xe032('0x18')]||0x0;this['holdtime']=_0x420020[_0xe032('0x19')]||0x0;this[_0xe032('0x1a')]=_0x420020[_0xe032('0x1a')]||0x0;this[_0xe032('0x1b')]=_0x420020[_0xe032('0x1b')];this[_0xe032('0x1c')]=_0x420020[_0xe032('0x1c')];this['callbackat']=_0x420020[_0xe032('0x1d')];this[_0xe032('0x1e')]=_0x420020[_0xe032('0x1e')];this[_0xe032('0x1f')]=_0x420020[_0xe032('0x1f')];this[_0xe032('0x20')]=_0x420020[_0xe032('0x20')];this[_0xe032('0x21')]=_0x420020['UserId'];this['VoiceQueueId']=_0x420020['VoiceQueueId'];this[_0xe032('0x22')]=_0x420020[_0xe032('0x22')];this[_0xe032('0x23')]=_0x420020[_0xe032('0x23')]||'';this[_0xe032('0x24')]=_0x420020[_0xe032('0x24')]||'';}module[_0xe032('0x25')]=Final; \ No newline at end of file +var _0x885a=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0x16a2b5,_0x4b419b){var _0x3943eb=function(_0x17c54a){while(--_0x17c54a){_0x16a2b5['push'](_0x16a2b5['shift']());}};_0x3943eb(++_0x4b419b);}(_0x885a,0x180));var _0xa885=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x885a[_0x27af45];return _0x18df21;};'use strict';var util=require('util');var _=require(_0xa885('0x0'));var moment=require(_0xa885('0x1'));function getSeconds(_0x35456c,_0x2e4bc8){var _0x573a2b=moment(_0x35456c)[_0xa885('0x2')](0x0);var _0x1c41b5=moment(_0x2e4bc8)[_0xa885('0x2')](0x0);return _0x573a2b[_0xa885('0x3')](_0x1c41b5,_0xa885('0x4'));}function Final(_0x33f18b){this['uniqueid']=_0x33f18b[_0xa885('0x5')];this[_0xa885('0x6')]=_0x33f18b[_0xa885('0x6')];this['type']=_0x33f18b[_0xa885('0x7')];this[_0xa885('0x8')]=_0x33f18b[_0xa885('0x7')]==='outbound'?_0xa885('0x9'):_0x33f18b[_0xa885('0x7')];this[_0xa885('0xa')]=_0x33f18b[_0xa885('0xa')];this[_0xa885('0xb')]=_0x33f18b[_0xa885('0xb')];this[_0xa885('0xc')]=_0x33f18b['countnoanswerretry'];this[_0xa885('0xd')]=_0x33f18b[_0xa885('0xa')]+_0x33f18b[_0xa885('0xb')]+_0x33f18b[_0xa885('0xc')]+_0x33f18b[_0xa885('0xe')]+_0x33f18b[_0xa885('0xf')]+_0x33f18b[_0xa885('0x10')]+_0x33f18b['countmachineretry']+_0x33f18b[_0xa885('0x11')];this[_0xa885('0xe')]=_0x33f18b[_0xa885('0xe')];this[_0xa885('0xf')]=_0x33f18b[_0xa885('0xf')];this['countabandonedretry']=_0x33f18b[_0xa885('0x10')];this[_0xa885('0x12')]=_0x33f18b['countmachineretry'];this[_0xa885('0x11')]=_0x33f18b[_0xa885('0x11')];this['queue']=_0x33f18b[_0xa885('0x9')];this[_0xa885('0x13')]=_0x33f18b['calleridname'];this[_0xa885('0x14')]=_0x33f18b['calleridnum'];this[_0xa885('0x15')]=_0x33f18b[_0xa885('0x15')];this[_0xa885('0x16')]=_0x33f18b['responsetime'];this[_0xa885('0x17')]=_0x33f18b['responsetime'];this[_0xa885('0x18')]=_0x33f18b[_0xa885('0x18')]||0x0;this[_0xa885('0x19')]=_0x33f18b['holdtime']||0x0;this[_0xa885('0x1a')]=_0x33f18b[_0xa885('0x1a')]||0x0;this[_0xa885('0x1b')]=_0x33f18b['callback'];this[_0xa885('0x1c')]=_0x33f18b[_0xa885('0x1c')];this[_0xa885('0x1d')]=_0x33f18b['callbackat'];this[_0xa885('0x1e')]=_0x33f18b['recallme'];this[_0xa885('0x1f')]=_0x33f18b[_0xa885('0x1f')];this['ListId']=_0x33f18b[_0xa885('0x20')];this[_0xa885('0x21')]=_0x33f18b[_0xa885('0x21')];this['VoiceQueueId']=_0x33f18b[_0xa885('0x22')];this[_0xa885('0x23')]=_0x33f18b['CampaignId'];this[_0xa885('0x24')]=_0x33f18b['originatecalleridnum']||'';this[_0xa885('0x25')]=_0x33f18b['originatecalleridname']||'';}module[_0xa885('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index ba4bc42..d6cfd28 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3325=['VoiceQueueId','CampaignId','exports','lodash','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x326986,_0x1eed04){var _0x50027c=function(_0x587e04){while(--_0x587e04){_0x326986['push'](_0x326986['shift']());}};_0x50027c(++_0x1eed04);}(_0x3325,0x129));var _0x5332=function(_0x46b7c4,_0x119ebc){_0x46b7c4=_0x46b7c4-0x0;var _0x7ab83=_0x3325[_0x46b7c4];return _0x7ab83;};'use strict';var util=require('util');var _=require(_0x5332('0x0'));var moment=require('moment');function getSeconds(_0x136aac,_0x2a2d5b){var _0x414836=moment(_0x136aac)[_0x5332('0x1')](0x0);var _0x4c25d4=moment(_0x2a2d5b)[_0x5332('0x1')](0x0);return _0x414836[_0x5332('0x2')](_0x4c25d4,_0x5332('0x3'));}function Hangup(_0x2344d3,_0x4c2e57){this['state']=0x4;this[_0x5332('0x4')]=_0x5332('0x5');this['scheduledat']=_0x2344d3[_0x5332('0x6')];this[_0x5332('0x7')]=_0x2344d3[_0x5332('0x7')];this[_0x5332('0x8')]=_0x2344d3[_0x5332('0x7')]===_0x5332('0x9')?_0x5332('0xa'):_0x2344d3[_0x5332('0x7')];this[_0x5332('0xb')]=_0x2344d3[_0x5332('0xb')];this[_0x5332('0xc')]=_0x2344d3[_0x5332('0xc')];this[_0x5332('0xd')]=_0x2344d3[_0x5332('0xd')];this[_0x5332('0xe')]=_0x2344d3[_0x5332('0xb')]+_0x2344d3[_0x5332('0xc')]+_0x2344d3[_0x5332('0xd')]+_0x2344d3[_0x5332('0xf')]+_0x2344d3[_0x5332('0x10')]+_0x2344d3['countabandonedretry']+_0x2344d3[_0x5332('0x11')]+_0x2344d3[_0x5332('0x12')];this[_0x5332('0xf')]=_0x2344d3[_0x5332('0xf')];this[_0x5332('0x10')]=_0x2344d3[_0x5332('0x10')];this[_0x5332('0x13')]=_0x2344d3[_0x5332('0x13')];this[_0x5332('0x11')]=_0x2344d3['countmachineretry'];this[_0x5332('0x12')]=_0x2344d3[_0x5332('0x12')];this[_0x5332('0x14')]=_0x4c2e57[_0x5332('0x14')];this[_0x5332('0x15')]=_0x2344d3[_0x5332('0x16')];this[_0x5332('0x17')]=_0x2344d3['number'];this[_0x5332('0x18')]=_0x2344d3[_0x5332('0x18')];this[_0x5332('0x19')]=_0x2344d3[_0x5332('0x19')];this[_0x5332('0x1a')]=moment()['format'](_0x5332('0x1b'));this['ringtime']=getSeconds(_0x2344d3['responsetime'],_0x2344d3[_0x5332('0x18')]);this[_0x5332('0x1c')]=0x0;this['talktime']=getSeconds(this[_0x5332('0x1a')],_0x2344d3[_0x5332('0x19')]);this[_0x5332('0xa')]=_0x2344d3[_0x5332('0xa')];this['membername']=_0x5332('0x1d');this[_0x5332('0x1e')]=_0x4c2e57[_0x5332('0x1f')];this[_0x5332('0x20')]=_0x2344d3['callback'];this[_0x5332('0x21')]=_0x2344d3['callbackuniqueid'];this[_0x5332('0x22')]=_0x2344d3[_0x5332('0x22')];this[_0x5332('0x23')]=_0x2344d3['recallme'];this['ContactId']=_0x2344d3[_0x5332('0x24')];this[_0x5332('0x25')]=_0x2344d3[_0x5332('0x25')];this['UserId']=_0x2344d3[_0x5332('0x26')];this[_0x5332('0x27')]=_0x2344d3['VoiceQueueId'];this[_0x5332('0x28')]=_0x2344d3['CampaignId'];}module[_0x5332('0x29')]=Hangup; \ No newline at end of file +var _0xe044=['holdtime','talktime','queue','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xe044,0x170));var _0x4e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe044[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4e04('0x0'));var _=require(_0x4e04('0x1'));var moment=require(_0x4e04('0x2'));function getSeconds(_0x38f2a7,_0x15250a){var _0xcb0da8=moment(_0x38f2a7)[_0x4e04('0x3')](0x0);var _0x1b1892=moment(_0x15250a)[_0x4e04('0x3')](0x0);return _0xcb0da8['diff'](_0x1b1892,_0x4e04('0x4'));}function Hangup(_0x6286ae,_0x2dcfab){this[_0x4e04('0x5')]=0x4;this[_0x4e04('0x6')]=_0x4e04('0x7');this[_0x4e04('0x8')]=_0x6286ae['scheduledat'];this[_0x4e04('0x9')]=_0x6286ae[_0x4e04('0x9')];this['campaigntype']=_0x6286ae[_0x4e04('0x9')]===_0x4e04('0xa')?'queue':_0x6286ae['type'];this[_0x4e04('0xb')]=_0x6286ae[_0x4e04('0xb')];this[_0x4e04('0xc')]=_0x6286ae[_0x4e04('0xc')];this[_0x4e04('0xd')]=_0x6286ae[_0x4e04('0xd')];this['countglobal']=_0x6286ae['countbusyretry']+_0x6286ae[_0x4e04('0xc')]+_0x6286ae['countnoanswerretry']+_0x6286ae['countnosuchnumberretry']+_0x6286ae[_0x4e04('0xe')]+_0x6286ae[_0x4e04('0xf')]+_0x6286ae['countmachineretry']+_0x6286ae[_0x4e04('0x10')];this[_0x4e04('0x11')]=_0x6286ae[_0x4e04('0x11')];this[_0x4e04('0xe')]=_0x6286ae[_0x4e04('0xe')];this[_0x4e04('0xf')]=_0x6286ae[_0x4e04('0xf')];this[_0x4e04('0x12')]=_0x6286ae['countmachineretry'];this[_0x4e04('0x10')]=_0x6286ae[_0x4e04('0x10')];this[_0x4e04('0x13')]=_0x2dcfab[_0x4e04('0x13')];this['calleridname']=_0x6286ae[_0x4e04('0x14')];this['calleridnum']=_0x6286ae[_0x4e04('0x15')];this[_0x4e04('0x16')]=_0x6286ae[_0x4e04('0x16')];this[_0x4e04('0x17')]=_0x6286ae['responsetime'];this[_0x4e04('0x18')]=moment()[_0x4e04('0x19')](_0x4e04('0x1a'));this[_0x4e04('0x1b')]=getSeconds(_0x6286ae['responsetime'],_0x6286ae['starttime']);this[_0x4e04('0x1c')]=0x0;this[_0x4e04('0x1d')]=getSeconds(this[_0x4e04('0x18')],_0x6286ae[_0x4e04('0x17')]);this[_0x4e04('0x1e')]=_0x6286ae['queue'];this['membername']=_0x4e04('0x1f');this[_0x4e04('0x20')]=_0x2dcfab[_0x4e04('0x21')];this[_0x4e04('0x22')]=_0x6286ae[_0x4e04('0x22')];this[_0x4e04('0x23')]=_0x6286ae['callbackuniqueid'];this[_0x4e04('0x24')]=_0x6286ae[_0x4e04('0x24')];this[_0x4e04('0x25')]=_0x6286ae[_0x4e04('0x25')];this[_0x4e04('0x26')]=_0x6286ae[_0x4e04('0x26')];this[_0x4e04('0x27')]=_0x6286ae[_0x4e04('0x27')];this['UserId']=_0x6286ae[_0x4e04('0x28')];this[_0x4e04('0x29')]=_0x6286ae['VoiceQueueId'];this[_0x4e04('0x2a')]=_0x6286ae['CampaignId'];}module[_0x4e04('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 5aafaa4..395323f 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf59c=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','name','calleridnum','number','starttime','ringtime','responsetime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf59c,0x17c));var _0xcf59=function(_0x206f18,_0x23258f){_0x206f18=_0x206f18-0x0;var _0xdb21c3=_0xf59c[_0x206f18];return _0xdb21c3;};'use strict';var util=require(_0xcf59('0x0'));var _=require(_0xcf59('0x1'));var moment=require(_0xcf59('0x2'));function getSeconds(_0x42cf7a,_0x31a464){var _0x2b8a57=moment(_0x42cf7a)['milliseconds'](0x0);var _0xa8ad7c=moment(_0x31a464)[_0xcf59('0x3')](0x0);return _0x2b8a57['diff'](_0xa8ad7c,'seconds');}function History(_0x55217a){this[_0xcf59('0x4')]=_0x55217a[_0xcf59('0x4')];this[_0xcf59('0x5')]=_0x55217a[_0xcf59('0x5')]||undefined;this['type']=_0x55217a[_0xcf59('0x6')];this[_0xcf59('0x7')]=_0x55217a['type']===_0xcf59('0x8')?_0xcf59('0x9'):_0x55217a['type'];this[_0xcf59('0xa')]=_0x55217a[_0xcf59('0xa')];this[_0xcf59('0xb')]=_0x55217a[_0xcf59('0xb')];this[_0xcf59('0xc')]=_0x55217a[_0xcf59('0xc')];this[_0xcf59('0xd')]=_0x55217a[_0xcf59('0xa')]+_0x55217a[_0xcf59('0xb')]+_0x55217a[_0xcf59('0xc')]+_0x55217a['countnosuchnumberretry']+_0x55217a[_0xcf59('0xe')]+_0x55217a[_0xcf59('0xf')]+_0x55217a['countmachineretry']+_0x55217a[_0xcf59('0x10')];this[_0xcf59('0x11')]=_0x55217a[_0xcf59('0x11')];this[_0xcf59('0xe')]=_0x55217a['countdropretry'];this[_0xcf59('0xf')]=_0x55217a['countabandonedretry'];this['countmachineretry']=_0x55217a[_0xcf59('0x12')];this['countagentrejectretry']=_0x55217a[_0xcf59('0x10')];this['queue']=_0x55217a[_0xcf59('0x9')];this[_0xcf59('0x13')]=_0x55217a[_0xcf59('0x14')];this[_0xcf59('0x15')]=_0x55217a[_0xcf59('0x16')];this['starttime']=_0x55217a[_0xcf59('0x17')];this['responsetime']=_0x55217a['responsetime'];this['endtime']=_0x55217a['responsetime'];this[_0xcf59('0x18')]=getSeconds(_0x55217a[_0xcf59('0x19')],_0x55217a[_0xcf59('0x17')]);this[_0xcf59('0x1a')]=0x0;this[_0xcf59('0x1b')]=0x0;this[_0xcf59('0x1c')]=_0x55217a['callback'];this[_0xcf59('0x1d')]=_0x55217a[_0xcf59('0x1d')];this['callbackat']=_0x55217a['callbackat'];this[_0xcf59('0x1e')]=_0x55217a[_0xcf59('0x1e')];this[_0xcf59('0x1f')]=_0x55217a['ContactId'];this[_0xcf59('0x20')]=_0x55217a[_0xcf59('0x20')];this['UserId']=_0x55217a[_0xcf59('0x21')];this[_0xcf59('0x22')]=_0x55217a['VoiceQueueId'];this[_0xcf59('0x23')]=_0x55217a[_0xcf59('0x23')];this['originatecalleridnum']=_0x55217a[_0xcf59('0x24')]||'';this[_0xcf59('0x25')]=_0x55217a[_0xcf59('0x25')]||'';}module[_0xcf59('0x26')]=History; \ No newline at end of file +var _0x67de=['countglobal','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67de,0x1de));var _0xe67d=function(_0x2979b8,_0x208ec3){_0x2979b8=_0x2979b8-0x0;var _0x5b16ab=_0x67de[_0x2979b8];return _0x5b16ab;};'use strict';var util=require(_0xe67d('0x0'));var _=require('lodash');var moment=require(_0xe67d('0x1'));function getSeconds(_0x15cf11,_0x139217){var _0xf12bd1=moment(_0x15cf11)[_0xe67d('0x2')](0x0);var _0x241725=moment(_0x139217)[_0xe67d('0x2')](0x0);return _0xf12bd1['diff'](_0x241725,_0xe67d('0x3'));}function History(_0x36f22d){this['uniqueid']=_0x36f22d['uniqueid'];this[_0xe67d('0x4')]=_0x36f22d[_0xe67d('0x4')]||undefined;this[_0xe67d('0x5')]=_0x36f22d[_0xe67d('0x5')];this[_0xe67d('0x6')]=_0x36f22d[_0xe67d('0x5')]===_0xe67d('0x7')?_0xe67d('0x8'):_0x36f22d['type'];this[_0xe67d('0x9')]=_0x36f22d[_0xe67d('0x9')];this[_0xe67d('0xa')]=_0x36f22d[_0xe67d('0xa')];this[_0xe67d('0xb')]=_0x36f22d[_0xe67d('0xb')];this[_0xe67d('0xc')]=_0x36f22d[_0xe67d('0x9')]+_0x36f22d[_0xe67d('0xa')]+_0x36f22d['countnoanswerretry']+_0x36f22d['countnosuchnumberretry']+_0x36f22d['countdropretry']+_0x36f22d['countabandonedretry']+_0x36f22d[_0xe67d('0xd')]+_0x36f22d[_0xe67d('0xe')];this[_0xe67d('0xf')]=_0x36f22d[_0xe67d('0xf')];this[_0xe67d('0x10')]=_0x36f22d[_0xe67d('0x10')];this[_0xe67d('0x11')]=_0x36f22d['countabandonedretry'];this[_0xe67d('0xd')]=_0x36f22d[_0xe67d('0xd')];this[_0xe67d('0xe')]=_0x36f22d['countagentrejectretry'];this[_0xe67d('0x8')]=_0x36f22d[_0xe67d('0x8')];this[_0xe67d('0x12')]=_0x36f22d[_0xe67d('0x13')];this[_0xe67d('0x14')]=_0x36f22d['number'];this['starttime']=_0x36f22d[_0xe67d('0x15')];this[_0xe67d('0x16')]=_0x36f22d[_0xe67d('0x16')];this[_0xe67d('0x17')]=_0x36f22d[_0xe67d('0x16')];this[_0xe67d('0x18')]=getSeconds(_0x36f22d[_0xe67d('0x16')],_0x36f22d[_0xe67d('0x15')]);this[_0xe67d('0x19')]=0x0;this[_0xe67d('0x1a')]=0x0;this['callback']=_0x36f22d['callback'];this['callbackuniqueid']=_0x36f22d['callbackuniqueid'];this[_0xe67d('0x1b')]=_0x36f22d[_0xe67d('0x1b')];this[_0xe67d('0x1c')]=_0x36f22d[_0xe67d('0x1c')];this[_0xe67d('0x1d')]=_0x36f22d[_0xe67d('0x1d')];this['ListId']=_0x36f22d['ListId'];this[_0xe67d('0x1e')]=_0x36f22d[_0xe67d('0x1e')];this[_0xe67d('0x1f')]=_0x36f22d[_0xe67d('0x1f')];this[_0xe67d('0x20')]=_0x36f22d[_0xe67d('0x20')];this['originatecalleridnum']=_0x36f22d[_0xe67d('0x21')]||'';this[_0xe67d('0x22')]=_0x36f22d[_0xe67d('0x22')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index f379d22..8a09300 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 _0xc9c3=['indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','countdropretry','dialDropRetryFrequency','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','object','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','check\x20failure','one\x20call\x20every:','[handlePredictive]','checkContactBlack','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','RUNNING','[actionOriginate]\x20','[getContactCampaign2]','dialMethod','dialLimitQueue','not_inuse','reachable','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Error','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','bluebird','uuid','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./hangup','env','127.0.0.1','roundrobin','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','bind','custom:queuesummary','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','seconds','outbound','answered','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','md5','format','voice:queue:%s','voice_queue:save','type','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','state','statedesc','[uniqueid]','[actions]','clearZombieChannels','undefined','isNil','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','[averageHandleTime]\x20','rescheduleContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','countglobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','minutes','ContactId','[rescheduleContact][Machine]','dialAMDActive','AMD','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','stateGlobal','createStateFinal','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','syncAgentConnect','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','dialDropMaxRetry','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','channel','actionid','strategy','locked','stateinterface','rrmemory','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','Action','command','iftime\x20%s,%s','interval','timezones','content'];(function(_0x24322c,_0x138c2c){var _0x46451c=function(_0x2f8b5e){while(--_0x2f8b5e){_0x24322c['push'](_0x24322c['shift']());}};_0x46451c(++_0x138c2c);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x20274d,_0x2ed0c8){_0x20274d=_0x20274d-0x0;var _0x53f443=_0xc9c3[_0x20274d];return _0x53f443;};'use strict';var util=require('util');var _=require(_0x3c9c('0x0'));var BPromise=require(_0x3c9c('0x1'));var uuid=require(_0x3c9c('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x3c9c('0x3'));var ut=require(_0x3c9c('0x4'));var config=require('../../../config/environment/');var logger=require(_0x3c9c('0x5'))(_0x3c9c('0x6'));var loggerBooked=require(_0x3c9c('0x5'))(_0x3c9c('0x7'));var loggerPredictive=require(_0x3c9c('0x5'))(_0x3c9c('0x8'));var loggerPredictiveCalls=require(_0x3c9c('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x3c9c('0x9'));var ami=require(_0x3c9c('0xa'));config['redis']=_[_0x3c9c('0xb')](config[_0x3c9c('0xc')],{'host':_0x3c9c('0xd'),'port':0x18eb});var io=require(_0x3c9c('0xe'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x3c9c('0xf'));var cmHopperBlack=require(_0x3c9c('0x10'));var voiceQueueRt=require(_0x3c9c('0x11'));var Action=require(_0x3c9c('0x12'));var History=require('./history');var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x3c9c('0x13'));var ipAgi=process[_0x3c9c('0x14')]['XCALLY_IP_AGI']||_0x3c9c('0x15');var strategy={'rrmemory':'rrmemory','roundrobin':_0x3c9c('0x16')};var Sequence=function(){};Sequence[_0x3c9c('0x17')][_0x3c9c('0x18')]=function(_0x541830){this[_0x3c9c('0x19')]=this['tail']?this[_0x3c9c('0x19')]['finally'](_0x541830):_0x541830();};function Dialer(_0x448319,_0x2d7785){this[_0x3c9c('0x1a')]=new Sequence();this['preview']=_0x2d7785;this[_0x3c9c('0x1b')]=_0x448319['voiceQueues'];this[_0x3c9c('0x1c')]=_0x448319[_0x3c9c('0x1c')];this[_0x3c9c('0x1d')]=_0x448319[_0x3c9c('0x1d')];this[_0x3c9c('0x1e')]=_0x448319[_0x3c9c('0x1e')];this[_0x3c9c('0x1f')]=config[_0x3c9c('0x1f')]||0x2;this[_0x3c9c('0x20')]={};this[_0x3c9c('0x21')]={};this[_0x3c9c('0x22')]={};this[_0x3c9c('0x23')]={};this['optionPredictive']={};this[_0x3c9c('0x24')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x3c9c('0x25')]={};this[_0x3c9c('0x26')]={};ami['on'](_0x3c9c('0x27'),this['syncAgentConnect']['bind'](this));ami['on'](_0x3c9c('0x28'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x3c9c('0x29'),this[_0x3c9c('0x2a')]['bind'](this));ami['on'](_0x3c9c('0x2b'),this[_0x3c9c('0x2c')][_0x3c9c('0x2d')](this));ami['on'](_0x3c9c('0x2e'),this[_0x3c9c('0x9')][_0x3c9c('0x2d')](this));ami['on']('hangup',this[_0x3c9c('0x2f')]['bind'](this));ami['on']('newexten',this[_0x3c9c('0x30')][_0x3c9c('0x2d')](this));ami['on'](_0x3c9c('0x31'),this[_0x3c9c('0x32')][_0x3c9c('0x2d')](this));ami['on'](_0x3c9c('0x33'),this[_0x3c9c('0x34')][_0x3c9c('0x2d')](this));ami['on'](_0x3c9c('0x35'),this['syncQueueStatusComplete'][_0x3c9c('0x2d')](this));this[_0x3c9c('0x36')]();this[_0x3c9c('0x37')]();}function isNotNull(_0x545cde){return _0x545cde!==null&&!_['isUndefined'](_0x545cde);}function checkIsLoggedIn(_0x43f063,_0x3bdccc){return function(){if(_0x3bdccc<=0x0){_0x43f063[_0x3c9c('0x38')]='AGENTS_NOT_LOGGED';throw _0x43f063[_0x3c9c('0x39')]+_0x3c9c('0x3a');}};}function isActive(_0x51dd7f){return _0x51dd7f;}function checkIsActive(_0x1a426a,_0x2e72fe){return function(){if(!isActive(_0x2e72fe)){_0x1a426a['message']=_0x3c9c('0x3b');throw _0x1a426a[_0x3c9c('0x39')]+_0x3c9c('0x3c');}};}function checkInterval(_0x10d648){return function(){if(!isNotNull(_0x10d648[_0x3c9c('0x3d')])){_0x10d648[_0x3c9c('0x38')]=_0x3c9c('0x3e');throw _0x10d648[_0x3c9c('0x39')]+_0x3c9c('0x3f');}if(!isNotNull(_0x10d648[_0x3c9c('0x3d')][_0x3c9c('0x40')])){_0x10d648[_0x3c9c('0x38')]=_0x3c9c('0x3e');throw _0x10d648[_0x3c9c('0x39')]+_0x3c9c('0x3f');}if(!isNotNull(_[_0x3c9c('0x41')](_0x10d648[_0x3c9c('0x3d')]['Intervals']))){_0x10d648[_0x3c9c('0x38')]=_0x3c9c('0x3e');throw _0x10d648[_0x3c9c('0x39')]+_0x3c9c('0x3f');}};}function msgResponse(_0x504b75,_0xcd7b6b,_0x247611){return{'action':_0x504b75,'response':_0xcd7b6b,'message':_0x247611,'stack':_0x247611};}function myreject(_0x20e17e){return function(_0x2a576a){return _0x20e17e(msgResponse(_0x3c9c('0x42'),'Error',JSON[_0x3c9c('0x43')](_0x2a576a)));};}function getSeconds(_0x2aa612,_0x3f4a59){var _0x61ef62=moment(_0x2aa612)[_0x3c9c('0x44')](0x0);var _0xf4b79b=moment(_0x3f4a59)[_0x3c9c('0x44')](0x0);return _0x61ef62['diff'](_0xf4b79b,_0x3c9c('0x45'));}function emit(_0x1b9fad,_0x454d7e,_0x77c2ad){io['to'](_0x1b9fad)['emit'](_0x454d7e,_0x77c2ad);}function emitVoiceQueueSummary(_0x40b744){if(_0x40b744['type']===_0x3c9c('0x46')){var _0x58aa4f={'id':_0x40b744['id'],'name':_0x40b744[_0x3c9c('0x39')],'strategy':_0x40b744['strategy'],'answered':_0x40b744[_0x3c9c('0x47')],'available':_0x40b744['available'],'loggedIn':_0x40b744[_0x3c9c('0x48')],'pTalking':_0x40b744[_0x3c9c('0x49')],'sumBillable':_0x40b744[_0x3c9c('0x4a')],'sumDuration':_0x40b744[_0x3c9c('0x4b')],'sumHoldTime':_0x40b744['sumHoldTime']||0x0,'talking':_0x40b744[_0x3c9c('0x4c')],'total':_0x40b744[_0x3c9c('0x4d')],'type':_0x40b744['type'],'unmanaged':_0x40b744[_0x3c9c('0x4e')],'abandoned':_0x40b744[_0x3c9c('0x4f')],'waiting':_0x40b744[_0x3c9c('0x50')],'loggedInDb':_0x40b744[_0x3c9c('0x51')],'dialActive':_0x40b744[_0x3c9c('0x52')],'dialMethod':_0x40b744['dialMethod'],'dialOriginateCallerIdName':_0x40b744['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x40b744['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x40b744['dialOriginateTimeout'],'dialPrefix':_0x40b744[_0x3c9c('0x53')],'outboundAnswerAgiCallsDay':_0x40b744[_0x3c9c('0x54')],'outboundAnswerCallsDay':_0x40b744[_0x3c9c('0x55')],'outboundBlacklistCallsDay':_0x40b744[_0x3c9c('0x56')],'outboundBusyCallsDay':_0x40b744['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x40b744[_0x3c9c('0x57')],'outboundDropCallsDayACS':_0x40b744['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x40b744[_0x3c9c('0x58')],'outboundDropCallsDayTimeout':_0x40b744[_0x3c9c('0x59')],'outboundNoAnswerCallsDay':_0x40b744[_0x3c9c('0x5a')],'outboundNoSuchCallsDay':_0x40b744[_0x3c9c('0x5b')],'outboundOriginateFailureCallsDay':_0x40b744[_0x3c9c('0x5c')],'outboundReCallsDay':_0x40b744[_0x3c9c('0x5d')],'outboundRejectCallsDay':_0x40b744['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x40b744[_0x3c9c('0x5e')],'predictiveIntervalAnsweredCalls':_0x40b744[_0x3c9c('0x5f')],'predictiveIntervalAvgHoldtime':_0x40b744[_0x3c9c('0x60')],'predictiveIntervalAvgTalktime':_0x40b744[_0x3c9c('0x61')],'predictiveIntervalDroppedCallsCallersExit':_0x40b744[_0x3c9c('0x62')],'predictiveIntervalDroppedCallsTimeout':_0x40b744[_0x3c9c('0x63')],'predictiveIntervalErlangCalls':_0x40b744[_0x3c9c('0x64')],'predictiveIntervalErlangCallsDroppedCalls':_0x40b744[_0x3c9c('0x65')],'predictiveIntervalHitRate':_0x40b744[_0x3c9c('0x66')],'predictiveIntervalMultiplicativeFactor':_0x40b744['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x40b744['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x40b744[_0x3c9c('0x67')],'predictiveIntervalTotalCalls':_0x40b744[_0x3c9c('0x68')],'message':_0x40b744[_0x3c9c('0x38')],'originated':_0x40b744[_0x3c9c('0x69')],'erlangCalls':_0x40b744['erlangCalls'],'erlangCallToSecond':_0x40b744[_0x3c9c('0x6a')],'erlangAbandonmentRate':_0x40b744[_0x3c9c('0x6b')],'erlangBusyFactor':_0x40b744[_0x3c9c('0x6c')],'startPredictive':_0x40b744[_0x3c9c('0x24')],'startProgressive':_0x40b744[_0x3c9c('0x6d')]};if(_0x40b744[_0x3c9c('0x6e')]){_0x58aa4f[_0x3c9c('0x6e')]={'id':_0x40b744[_0x3c9c('0x6e')]['id'],'name':_0x40b744[_0x3c9c('0x6e')][_0x3c9c('0x39')],'active':_0x40b744[_0x3c9c('0x6e')][_0x3c9c('0x6f')],'callerid':_0x40b744[_0x3c9c('0x6e')]['callerid']};}if(_0x40b744[_0x3c9c('0x3d')]){_0x58aa4f['Interval']={'id':_0x40b744[_0x3c9c('0x3d')]['id'],'name':_0x40b744['Interval']['name']};}var _0x3d3f67=md5(JSON['stringify'](_0x58aa4f));if(_0x40b744[_0x3c9c('0x70')]!==_0x3d3f67){_0x40b744[_0x3c9c('0x70')]=_0x3d3f67;emit(util[_0x3c9c('0x71')](_0x3c9c('0x72'),_0x58aa4f[_0x3c9c('0x39')]),_0x3c9c('0x73'),_0x58aa4f);}}}function emitCampaignSummary(_0x907232){if(_0x907232[_0x3c9c('0x74')]===_0x3c9c('0x75')){emit(util[_0x3c9c('0x71')]('campaign:ivr:%s',_0x907232[_0x3c9c('0x39')]),_0x3c9c('0x76'),_0x907232);}}function checkGetDataPredictive(_0x59f73c){if(isNotNull(_0x59f73c)&&!_[_0x3c9c('0x41')](_0x59f73c)){loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x78'));loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x79'),_0x59f73c['predictiveIntervalTotalCalls']);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x7a'),_0x59f73c[_0x3c9c('0x5f')]);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x7b'),_0x59f73c[_0x3c9c('0x63')]);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x7c'),_0x59f73c['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x3c9c('0x77')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59f73c[_0x3c9c('0x60')]);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x7d'),_0x59f73c[_0x3c9c('0x61')]);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x7e'));if(_0x59f73c['predictiveIntervalTotalCalls']>0x0){if(!_[_0x3c9c('0x7f')](_0x59f73c[_0x3c9c('0x61')])&&_0x59f73c[_0x3c9c('0x61')]>0x0){return!![];}loggerPredictive[_0x3c9c('0x77')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x3c9c('0x7f')](_0x59f73c[_0x3c9c('0x60')])&&_0x59f73c[_0x3c9c('0x60')]>0x0){return!![];}loggerPredictive[_0x3c9c('0x77')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x80'));}}else{loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x81'));}return![];}function mergeDataErlangB(_0x330a02){return function(_0x15a592){loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x82'));loggerPredictive[_0x3c9c('0x77')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15a592[_0x3c9c('0x83')]);loggerPredictive[_0x3c9c('0x77')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15a592[_0x3c9c('0x6a')]);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x84'),_0x15a592[_0x3c9c('0x6b')]);loggerPredictive[_0x3c9c('0x77')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15a592[_0x3c9c('0x6c')]);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x84'),_0x15a592[_0x3c9c('0x6b')]);loggerPredictive[_0x3c9c('0x77')]('---------------------------');_['merge'](_0x330a02,_0x15a592);};}function getDiff(_0x1cadaa){var _0x567753=moment()[_0x3c9c('0x44')](0x0);var _0x12344d=moment(_0x1cadaa)['milliseconds'](0x0);return _0x567753['diff'](_0x12344d,_0x3c9c('0x45'));}function ifInterval(_0x1fa25a,_0x2d1d5a){if(_['isUndefined'](_0x2d1d5a)){return![];}return getDiff(_0x2d1d5a)<_0x1fa25a*0x3c;}function freeVariablesPredictive(_0x2eda65){if(isNotNull(_0x2eda65)){if(!_[_0x3c9c('0x7f')](_0x2eda65[_0x3c9c('0x6d')])){_0x2eda65['startProgressive']=undefined;loggerPredictive['info'](_0x2eda65[_0x3c9c('0x39')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x2eda65[_0x3c9c('0x24')])){_0x2eda65['startPredictive']=undefined;loggerPredictive[_0x3c9c('0x77')](_0x2eda65[_0x3c9c('0x39')],_0x3c9c('0x85'));}if(!_[_0x3c9c('0x7f')](_0x2eda65[_0x3c9c('0x86')])){clearInterval(_0x2eda65['handlePredictive']);_0x2eda65[_0x3c9c('0x86')]=undefined;loggerPredictive[_0x3c9c('0x77')](_0x2eda65[_0x3c9c('0x39')],_0x3c9c('0x87'));}}}function erlangb(_0x25192f,_0x5c8aa7){if(_0x5c8aa7===0x0){return 0x0;}var _0x3e92e8=0x1;for(var _0x436703=0x1;_0x436703<=_0x5c8aa7;_0x436703+=0x1){_0x3e92e8=0x1+_0x3e92e8*_0x436703/_0x25192f;}return 0x1/_0x3e92e8;}function isVoiceQueueOutbound(_0x1e8a87){return _0x1e8a87==='outbound';}function isNotPreview(_0x154ddf){return _0x154ddf!==_0x3c9c('0x88');}function isCampaignIvr(_0x4f21c8){return _0x4f21c8===_0x3c9c('0x75');}function getCallerId(_0x5ef0ad,_0xb791ed,_0x1f8f80){if(!_['isUndefined'](_0x1f8f80)&&typeof _0x1f8f80===_0x3c9c('0x89')&&!_['isEmpty'](_0x1f8f80)){if(!_['isUndefined'](_0xb791ed)&&typeof _0xb791ed===_0x3c9c('0x89')&&!_[_0x3c9c('0x41')](_0xb791ed)){return util['format']('\x22%s\x22\x20<%s>',_0xb791ed,_0x1f8f80);}return util[_0x3c9c('0x71')](_0x3c9c('0x8a'),_0x1f8f80,_0x1f8f80);}if(!_['isUndefined'](_0x5ef0ad)&&typeof _0x5ef0ad===_0x3c9c('0x89')&&!_[_0x3c9c('0x41')](_0x5ef0ad)){return _0x5ef0ad;}return _0x3c9c('0x8b');}function loggerCatchQueueSummary(_0x222c11,_0x8a9fbf){return function(_0x3c0c2b){freeVariablesPredictive(_0x8a9fbf);emitVoiceQueueSummary(_0x8a9fbf);emitCampaignSummary(_0x8a9fbf);loggerSyncQueueSummary[_0x3c9c('0x8c')](_0x222c11,util[_0x3c9c('0x8d')](_0x3c0c2b,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x16f5d5,_0x68efda){return function(_0x587037){loggerPredictive[_0x3c9c('0x8c')](_0x68efda[_0x3c9c('0x39')],_0x16f5d5);loggerPredictive['error'](_0x587037[_0x3c9c('0x8e')]);freeVariablesPredictive(_0x68efda);};}function loggerCatch(_0x3cd6b4){return function(_0x48a5f2){logger[_0x3c9c('0x8c')](_0x3cd6b4,util[_0x3c9c('0x8d')](_0x48a5f2,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3ad583){return _0x3ad583&&!_[_0x3c9c('0x7f')](_0x3ad583)&&_0x3ad583[_0x3c9c('0x8f')]>0x0;}function decremetOriginate(_0x3bbd0e){if(!_[_0x3c9c('0x7f')](_0x3bbd0e)&&_0x3bbd0e!==null){if(typeof _0x3bbd0e['originated']!=='undefined'){if(_0x3bbd0e[_0x3c9c('0x69')]>0x0){_0x3bbd0e['originated']-=0x1;}else{logger[_0x3c9c('0x8c')](_0x3c9c('0x90'));}}}else{logger[_0x3c9c('0x8c')](_0x3c9c('0x91'));}}function checkContactLowerLimitOriginate(_0xbcab93,_0x55e795,_0x4134a1){if(_0x55e795>_0x4134a1){for(var _0x1534b1=0x0;_0x1534b1<_0x55e795-_0x4134a1;_0x1534b1+=0x1){decremetOriginate(_0xbcab93);}}}function loggerGetContactDialer(_0x5cc9ba,_0x2d2650,_0x1e03d7){return function(_0x5384d7){checkContactLowerLimitOriginate(_0x2d2650,_0x1e03d7,0x0);logger[_0x3c9c('0x8c')](_0x5cc9ba,util['inspect'](_0x5384d7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3d4bd4){return function(_0x520f81){if(isNotNull(_0x520f81)&&isNotNull(_0x520f81[0x0])){if(_0x520f81[0x0][_0x3c9c('0x92')]>0x0){_0x3d4bd4[_0x3c9c('0x38')]=_0x3c9c('0x93');logger[_0x3c9c('0x77')](_0x3c9c('0x94')+_0x3d4bd4[_0x3c9c('0x39')],_0x520f81[0x0][_0x3c9c('0x92')],_0x3c9c('0x95'));}else{_0x3d4bd4['message']=_0x3c9c('0x96');logger[_0x3c9c('0x77')](_0x3c9c('0x97')+_0x3d4bd4['name']);}}};}function notSendMessagesQueue(_0x10048b){if(_0x10048b[_0x3c9c('0x98')]){freeVariablesPredictive(_0x10048b);if(_0x10048b['originated']===0x0&&_0x10048b['talking']===0x0&&_0x10048b[_0x3c9c('0x50')]===0x0&&(_0x10048b[_0x3c9c('0x49')]||0x0)===0x0){_0x10048b[_0x3c9c('0x98')]=![];_0x10048b[_0x3c9c('0x99')]=0x0;_0x10048b[_0x3c9c('0x38')]=_0x3c9c('0x3b');loggerSyncQueueSummary[_0x3c9c('0x8c')](_0x3c9c('0x9a'),_0x10048b[_0x3c9c('0x39')],'is\x20not\x20active');}else{_0x10048b['message']=_0x3c9c('0x9b');loggerSyncQueueSummary[_0x3c9c('0x8c')](_0x3c9c('0x9a'),_0x10048b[_0x3c9c('0x39')],_0x3c9c('0x9c'));}emitVoiceQueueSummary(_0x10048b);}}function notSendMessagesCampaign(_0x40c627){if(_0x40c627[_0x3c9c('0x98')]){if(_0x40c627[_0x3c9c('0x69')]===0x0){_0x40c627['sendMessageOneNotActive']=![];_0x40c627[_0x3c9c('0x38')]=_0x3c9c('0x3b');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x40c627[_0x3c9c('0x39')],_0x3c9c('0x9d'));}else{_0x40c627['message']=_0x3c9c('0x9b');loggerSyncQueueSummary[_0x3c9c('0x8c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x40c627['name'],'is\x20disactive');}emitCampaignSummary(_0x40c627);}}function createObjHistory(_0x566864,_0x8d4ff3,_0x5f26d7,_0x193131,_0x4132a3){_0x566864[_0x3c9c('0x38')]=_0x5f26d7;var _0x4365c8=new Action(_0x566864,_0x8d4ff3);var _0xd1a10e=new History(_0x4365c8);_0xd1a10e[_0x3c9c('0x9e')]=_0x193131;_0xd1a10e[_0x3c9c('0x9f')]=_0x4132a3;_0xd1a10e['endtime']=_0x4365c8['starttime'];return _0xd1a10e;}Dialer[_0x3c9c('0x17')][_0x3c9c('0x37')]=function(){var _0x6ac35f=this;setInterval(function(){_0x6ac35f['clearZombieChannels'](_0x6ac35f['uniqueId'],_0x3c9c('0xa0'));_0x6ac35f['clearZombieChannels'](_0x6ac35f['actions'],_0x3c9c('0xa1'));},0x32c8);};Dialer[_0x3c9c('0x17')][_0x3c9c('0xa2')]=function(_0x57a120,_0x4dc55b){var _0x8d7e06=this;for(var _0x2acbcb in _0x57a120){if(typeof _0x57a120[_0x2acbcb]!==_0x3c9c('0xa3')){this[_0x3c9c('0x1a')]['enqueue'](function(){if(!_[_0x3c9c('0xa4')](_0x57a120[_0x2acbcb])){return ami['Action']({'action':_0x3c9c('0xa5'),'channel':_0x57a120[_0x2acbcb]['channel']})[_0x3c9c('0xa6')](function(_0x56a2c5){if(_0x56a2c5[_0x3c9c('0x38')]===_0x3c9c('0xa7')){setTimeout(function(){if(_0x57a120[_0x2acbcb]&&_0x57a120[_0x2acbcb][_0x3c9c('0x74')]!==_0x3c9c('0x75')){_0x8d7e06[_0x3c9c('0xa8')](_0x8d7e06[_0x3c9c('0x1b')][_0x57a120[_0x2acbcb][_0x3c9c('0xa9')]]);logger[_0x3c9c('0x8c')](_0x3c9c('0xaa'),_0x4dc55b,_0x2acbcb,_0x57a120[_0x2acbcb][_0x3c9c('0xa9')]);delete _0x57a120[_0x2acbcb];}if(_0x57a120[_0x2acbcb]&&_0x57a120[_0x2acbcb][_0x3c9c('0x74')]===_0x3c9c('0x75')){_0x8d7e06[_0x3c9c('0xa8')](_0x8d7e06[_0x3c9c('0x1c')][_0x57a120[_0x2acbcb][_0x3c9c('0xa9')]]);logger[_0x3c9c('0x8c')](_0x3c9c('0xab'),_0x4dc55b,_0x2acbcb,_0x57a120[_0x2acbcb][_0x3c9c('0xa9')]);delete _0x57a120[_0x2acbcb];}},0x2328);}});}});}}};Dialer[_0x3c9c('0x17')]['countReScheduled']=function(_0x3bd55f){return BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](cmHopper[_0x3c9c('0xae')](_0x3bd55f))[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xaf')));};Dialer[_0x3c9c('0x17')][_0x3c9c('0xb0')]=function(_0x25e5de){return BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](cmHopperBlack[_0x3c9c('0xb0')](_0x25e5de))[_0x3c9c('0xa6')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x3c9c('0x17')][_0x3c9c('0xb1')]=function(_0x43c32b){return BPromise['resolve']()[_0x3c9c('0xad')](cmHopperBlack[_0x3c9c('0xb1')](_0x43c32b))[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xb2')));};Dialer[_0x3c9c('0x17')]['averageHandleTime']=function(_0x226545){return BPromise['resolve']()[_0x3c9c('0xad')](cmHopperHistory['avgHandleTime'](_0x226545))[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xb3')));};Dialer[_0x3c9c('0x17')][_0x3c9c('0xb4')]=function(_0x4fc334){return BPromise[_0x3c9c('0xac')]()['then'](cmHopper[_0x3c9c('0xb4')](_0x4fc334))[_0x3c9c('0xa6')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x2d4019,_0x31f27c,_0x17df22){return BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](cmHopper['unlockContact'](_0x2d4019,_0x31f27c,_0x17df22))[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xb5')));};Dialer[_0x3c9c('0x17')][_0x3c9c('0xb6')]=function(_0x2e5309,_0x47f560,_0x2b5d3c,_0x11fa01,_0x2f473a){return BPromise['resolve']()[_0x3c9c('0xad')](cmHopper[_0x3c9c('0xb6')](_0x2e5309,_0x47f560,_0x2b5d3c,_0x11fa01))['catch'](function(_0x4df206){_0x2f473a[_0x3c9c('0xb7')]-=_0x2b5d3c;_0x2f473a['temp']=_0x2f473a[_0x3c9c('0xb7')]>0x0?_0x2f473a[_0x3c9c('0xb7')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x4df206);});};Dialer[_0x3c9c('0x17')]['getContactDialerIvr']=function(_0x294fe7,_0x32f221,_0x3e25d5,_0x39eb1d){return BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](cmHopper['getContactDialerIvr'](_0x294fe7,_0x32f221,_0x3e25d5))[_0x3c9c('0xa6')](function(_0x6a9c8f){_0x39eb1d[_0x3c9c('0xb7')]-=_0x32f221;_0x39eb1d[_0x3c9c('0xb7')]=_0x39eb1d[_0x3c9c('0xb7')]>0x0?_0x39eb1d[_0x3c9c('0xb7')]:0x0;loggerCatch(_0x3c9c('0xb8'))(_0x6a9c8f);});};Dialer[_0x3c9c('0x17')][_0x3c9c('0xb9')]=function(_0x5f3722){return BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](voiceQueueRt[_0x3c9c('0xb9')](_0x5f3722))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x3c9c('0x17')][_0x3c9c('0xba')]=function(_0x501f7d){return BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](cmHopper['moveContactManagedDialer'](_0x501f7d))[_0x3c9c('0xa6')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x3c9c('0x17')][_0x3c9c('0xbb')]=function(_0x3d3d9c){return BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](cmHopperHistory[_0x3c9c('0xbb')](_0x3d3d9c))[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xbc')));};Dialer[_0x3c9c('0x17')][_0x3c9c('0xa8')]=function(_0x20d0bd){if(!_[_0x3c9c('0x7f')](_0x20d0bd)&&_0x20d0bd!==null){if(typeof _0x20d0bd[_0x3c9c('0x69')]!==_0x3c9c('0xa3')){if(_0x20d0bd[_0x3c9c('0x69')]>0x0){_0x20d0bd[_0x3c9c('0x69')]-=0x1;}else{logger[_0x3c9c('0x8c')](_0x3c9c('0xbd'));}}}else{logger[_0x3c9c('0x8c')](_0x3c9c('0xbe'));}};Dialer[_0x3c9c('0x17')][_0x3c9c('0xbf')]=function(_0x11a4e3,_0x163032){var _0x356ac4=this;return function(_0x8f60b4){_0x356ac4[_0x3c9c('0xa8')](_0x163032);logger['error'](_0x11a4e3,util[_0x3c9c('0x8d')](_0x8f60b4,{'showHidden':![],'depth':null}));};};Dialer[_0x3c9c('0x17')][_0x3c9c('0xc0')]=function(_0x468506,_0x5bbd99,_0x10d06b){var _0xf873c4={'state':0x19,'statedesc':_0x3c9c('0xc1')};this['updateOriginated'](_0x5bbd99);this[_0x3c9c('0xc2')](_[_0x3c9c('0xc3')](_0xf873c4,_[_0x3c9c('0xc4')](_0x10d06b,['ContactId',_0x3c9c('0xc5'),_0x3c9c('0xc6'),_0x3c9c('0xc7'),_0x3c9c('0xc8')])),'[emptyContact][createHistory]',_0x3c9c('0xc9'));logger[_0x3c9c('0x8c')](_0x468506);};Dialer[_0x3c9c('0x17')][_0x3c9c('0xca')]=function(_0x481f94){return _0x481f94==='Success';};Dialer['prototype'][_0x3c9c('0xcb')]=function(_0x18bfcc){return!_[_0x3c9c('0x7f')](_0x18bfcc)&&_0x18bfcc&&!_[_0x3c9c('0x7f')](_0x18bfcc[_0x3c9c('0x39')])&&!_['isUndefined'](_0x18bfcc[_0x3c9c('0x6f')])&&_0x18bfcc[_0x3c9c('0x6f')]&&(this[_0x3c9c('0x1e')][util[_0x3c9c('0x71')](_0x3c9c('0xcc'),_0x18bfcc[_0x3c9c('0x39')])][_0x3c9c('0xa5')]==='reachable'||this[_0x3c9c('0x1e')][util[_0x3c9c('0x71')](_0x3c9c('0xcc'),_0x18bfcc[_0x3c9c('0x39')])][_0x3c9c('0xa5')]===_0x3c9c('0xcd'));};Dialer[_0x3c9c('0x17')]['saveInDb']=function(_0xc4bc3e,_0x40e4db,_0x5b3185){this[_0x3c9c('0xbb')](_0xc4bc3e)[_0x3c9c('0xa6')](loggerCatch(_0x40e4db));this[_0x3c9c('0xba')](_0xc4bc3e)[_0x3c9c('0xa6')](loggerCatch(_0x5b3185));};Dialer[_0x3c9c('0x17')][_0x3c9c('0x32')]=function(_0xf3f423){var _0x585f1b=this[_0x3c9c('0x23')][_0xf3f423[_0x3c9c('0xce')]];var _0x531c6a;if(!_['isNil'](_0xf3f423)&&!_['isNil'](_0xf3f423['variable'])&&!_[_0x3c9c('0xa4')](_0xf3f423[_0x3c9c('0xcf')]['amdstatus'])&&_0xf3f423[_0x3c9c('0xd0')]===_0x3c9c('0xd1')&&_0x585f1b){if(_0x585f1b['type']!==_0x3c9c('0x75')&&this[_0x3c9c('0x1b')][_0x585f1b[_0x3c9c('0xa9')]]['dialAMDActive']&&_0xf3f423[_0x3c9c('0xd2')]===_0x3c9c('0xd3')){delete this[_0x3c9c('0x23')][_0xf3f423['uniqueid']];this['updateOriginated'](this[_0x3c9c('0x1b')][_0x585f1b[_0x3c9c('0xa9')]]);this[_0x3c9c('0x1b')][_0x585f1b[_0x3c9c('0xa9')]][_0x3c9c('0x55')]+=0x1;this['voiceQueues'][_0x585f1b[_0x3c9c('0xa9')]][_0x3c9c('0x54')]+=0x1;_0x531c6a=new Hangup(_0x585f1b,_0xf3f423);_0x531c6a[_0x3c9c('0x9e')]=0x12;_0x531c6a[_0x3c9c('0x9f')]=_0x3c9c('0xd4');_0x531c6a[_0x3c9c('0xd5')]='AMD';ami[_0x3c9c('0xd6')](_0x3c9c('0xd7'),ut[_0x3c9c('0xd8')](_0x531c6a,_0x3c9c('0xd9')));this[_0x3c9c('0xc2')](_0x531c6a,_0x3c9c('0xda'),_0x3c9c('0xdb'));}if(_0x585f1b[_0x3c9c('0x74')]!==_0x3c9c('0x75')&&this['voiceQueues'][_0x585f1b[_0x3c9c('0xa9')]]['dialAMDActive']&&_0xf3f423['value']==='MACHINE'){var _0x41c17f=this;return new BPromise(function(_0x44bd36,_0x195cbc){delete _0x41c17f[_0x3c9c('0x23')][_0xf3f423[_0x3c9c('0xce')]];_0x41c17f[_0x3c9c('0xa8')](_0x41c17f['voiceQueues'][_0x585f1b[_0x3c9c('0xa9')]]);_0x41c17f[_0x3c9c('0x1b')][_0x585f1b[_0x3c9c('0xa9')]]['outboundAnswerCallsDay']+=0x1;_0x41c17f[_0x3c9c('0x1b')][_0x585f1b[_0x3c9c('0xa9')]][_0x3c9c('0x54')]+=0x1;var _0x409b37=_0x41c17f[_0x3c9c('0x1b')][_0x585f1b['queue']];var _0x4a2a15=new Hangup(_0x585f1b,_0xf3f423);_0x4a2a15[_0x3c9c('0x9e')]=0x13;_0x4a2a15[_0x3c9c('0x9f')]=_0x3c9c('0xdc');_0x4a2a15['membername']='AMD';_0x4a2a15[_0x3c9c('0xdd')]+=0x1;_0x4a2a15[_0x3c9c('0xde')]+=0x1;_0x4a2a15[_0x3c9c('0xd9')]=!![];ami['emit']('custom:amd',ut['buildObj'](_0x4a2a15,_0x3c9c('0xd9')));_0x41c17f[_0x3c9c('0xbb')](_0x4a2a15)[_0x3c9c('0xa6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4a2a15[_0x3c9c('0xdf')]+_0x4a2a15[_0x3c9c('0xe0')]+_0x4a2a15[_0x3c9c('0xe1')]+_0x4a2a15[_0x3c9c('0xe2')]+_0x4a2a15['countdropretry']+_0x4a2a15[_0x3c9c('0xe3')]+_0x4a2a15['countmachineretry']+_0x4a2a15['countagentrejectretry']>=_0x409b37[_0x3c9c('0xe4')]){_0x41c17f['stateGlobal'](_0x4a2a15,_0x44bd36,_0x195cbc,_0x3c9c('0xe5'));}else{if(_0x4a2a15[_0x3c9c('0xdd')]>=_0x409b37[_0x3c9c('0xe6')]){_0x41c17f['createStateFinal'](_0x4a2a15,_0x44bd36,_0x195cbc,_0x3c9c('0xe7'));}else{_0x41c17f[_0x3c9c('0xb4')]({'active':![],'countmachineretry':_0x4a2a15[_0x3c9c('0xdd')],'scheduledat':moment()[_0x3c9c('0xe8')](_0x409b37['dialMachineRetryFrequency'],_0x3c9c('0xe9'))[_0x3c9c('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a2a15[_0x3c9c('0xea')],'ListId':_0x4a2a15[_0x3c9c('0xc5')],'VoiceQueueId':_0x4a2a15[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x4a2a15[_0x3c9c('0xc8')]||undefined})[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xeb')));_0x44bd36({'reschedule':0x1});}}});}if(_0x585f1b['type']===_0x3c9c('0x75')&&this['campaigns'][_0x585f1b['queue']][_0x3c9c('0xec')]&&_0xf3f423[_0x3c9c('0xd2')]===_0x3c9c('0xd3')){delete this[_0x3c9c('0x23')][_0xf3f423[_0x3c9c('0xce')]];this[_0x3c9c('0xa8')](this[_0x3c9c('0x1c')][_0x585f1b['queue']]);_0x531c6a=new Hangup(_0x585f1b,_0xf3f423);_0x531c6a[_0x3c9c('0x9e')]=0x12;_0x531c6a['statedesc']=_0x3c9c('0xd4');_0x531c6a[_0x3c9c('0xd5')]=_0x3c9c('0xed');ami['emit'](_0x3c9c('0xd7'),ut[_0x3c9c('0xd8')](_0x531c6a,'amd'));this[_0x3c9c('0xc2')](_0x531c6a,'[syncHangupInAMDIvr][createHistory]',_0x3c9c('0xee'));}if(_0x585f1b[_0x3c9c('0x74')]===_0x3c9c('0x75')&&this[_0x3c9c('0x1c')][_0x585f1b['queue']]['dialAMDActive']&&_0xf3f423[_0x3c9c('0xd2')]==='MACHINE'){var _0x41c17f=this;return new BPromise(function(_0x156843,_0x219822){delete _0x41c17f['uniqueId'][_0xf3f423['uniqueid']];_0x41c17f[_0x3c9c('0xa8')](_0x41c17f['campaigns'][_0x585f1b[_0x3c9c('0xa9')]]);_0x41c17f[_0x3c9c('0x1c')][_0x585f1b[_0x3c9c('0xa9')]][_0x3c9c('0x55')]+=0x1;_0x41c17f['campaigns'][_0x585f1b[_0x3c9c('0xa9')]][_0x3c9c('0x54')]+=0x1;var _0x586aba=_0x41c17f[_0x3c9c('0x1c')][_0x585f1b[_0x3c9c('0xa9')]];var _0x2ed7aa=new Hangup(_0x585f1b,_0xf3f423);_0x2ed7aa[_0x3c9c('0x9e')]=0x13;_0x2ed7aa[_0x3c9c('0x9f')]=_0x3c9c('0xdc');_0x2ed7aa[_0x3c9c('0xd5')]=_0x3c9c('0xed');_0x2ed7aa[_0x3c9c('0xdd')]+=0x1;_0x2ed7aa['countglobal']+=0x1;_0x2ed7aa[_0x3c9c('0xd9')]=!![];ami[_0x3c9c('0xd6')]('custom:amd',ut['buildObj'](_0x2ed7aa,_0x3c9c('0xd9')));_0x41c17f[_0x3c9c('0xbb')](_0x2ed7aa)['catch'](loggerCatch(_0x3c9c('0xef')));if(_0x2ed7aa[_0x3c9c('0xdf')]+_0x2ed7aa[_0x3c9c('0xe0')]+_0x2ed7aa[_0x3c9c('0xe1')]+_0x2ed7aa['countnosuchnumberretry']+_0x2ed7aa['countdropretry']+_0x2ed7aa[_0x3c9c('0xe3')]+_0x2ed7aa[_0x3c9c('0xdd')]+_0x2ed7aa['countagentrejectretry']>=_0x586aba[_0x3c9c('0xe4')]){_0x41c17f[_0x3c9c('0xf0')](_0x2ed7aa,_0x156843,_0x219822,'reason19\x20machine....');}else{if(_0x2ed7aa[_0x3c9c('0xdd')]>=_0x586aba[_0x3c9c('0xe6')]){_0x41c17f[_0x3c9c('0xf1')](_0x2ed7aa,_0x156843,_0x219822,_0x3c9c('0xe7'));}else{_0x41c17f[_0x3c9c('0xb4')]({'active':![],'countmachineretry':_0x2ed7aa[_0x3c9c('0xdd')],'scheduledat':moment()[_0x3c9c('0xe8')](_0x586aba[_0x3c9c('0xf2')],'minutes')['format'](_0x3c9c('0xf3')),'ContactId':_0x2ed7aa[_0x3c9c('0xea')],'ListId':_0x2ed7aa[_0x3c9c('0xc5')],'VoiceQueueId':_0x2ed7aa['VoiceQueueId']||undefined,'CampaignId':_0x2ed7aa['CampaignId']||undefined})['catch'](loggerCatch(_0x3c9c('0xeb')));_0x156843({'reschedule':0x1});}}});}}};Dialer[_0x3c9c('0x17')][_0x3c9c('0x2f')]=function(_0xed5ee9){var _0x1f5fe7=this[_0x3c9c('0x23')][_0xed5ee9[_0x3c9c('0xce')]];var _0x59af58=this;var _0x2addca;if(_0x1f5fe7&&_0x1f5fe7['type']===_0x3c9c('0x75')){delete this[_0x3c9c('0x23')][_0xed5ee9[_0x3c9c('0xce')]];this[_0x3c9c('0xa8')](this['campaigns'][_0x1f5fe7[_0x3c9c('0xa9')]]);this[_0x3c9c('0x1c')][_0x1f5fe7[_0x3c9c('0xa9')]][_0x3c9c('0xf4')]+=0x1;_0x2addca=new Hangup(_0x1f5fe7,_0xed5ee9);this[_0x3c9c('0xbb')](_0x2addca)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xf5')));this[_0x3c9c('0xba')](_0x2addca)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xf6')));}if(_0x1f5fe7&&_0x1f5fe7['type']!==_0x3c9c('0x75')&&isNotNull(this[_0x3c9c('0x1b')][_0x1f5fe7[_0x3c9c('0xa9')]][_0x3c9c('0xf7')])){delete this[_0x3c9c('0x23')][_0xed5ee9[_0x3c9c('0xce')]];this[_0x3c9c('0xa8')](this[_0x3c9c('0x1b')][_0x1f5fe7[_0x3c9c('0xa9')]]);this[_0x3c9c('0x1b')][_0x1f5fe7[_0x3c9c('0xa9')]]['outboundAnswerCallsDay']+=0x1;this[_0x3c9c('0x1b')][_0x1f5fe7['queue']][_0x3c9c('0x54')]+=0x1;_0x2addca=new Hangup(_0x1f5fe7,_0xed5ee9);_0x2addca[_0x3c9c('0x9e')]=0x10;_0x2addca[_0x3c9c('0x9f')]='AnswerAGI';_0x2addca[_0x3c9c('0xd5')]=_0x3c9c('0xf8');this[_0x3c9c('0xbb')](_0x2addca)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xf5')));this['moveContactManagedDialer'](_0x2addca)[_0x3c9c('0xa6')](loggerCatch('[syncHangupIvr]'));}if(_0x1f5fe7&&_0x1f5fe7[_0x3c9c('0x74')]!=='ivr'&&!isNotNull(this[_0x3c9c('0x1b')][_0x1f5fe7[_0x3c9c('0xa9')]][_0x3c9c('0xf7')])){delete this['uniqueId'][_0xed5ee9[_0x3c9c('0xce')]];this[_0x3c9c('0xa8')](this[_0x3c9c('0x1b')][_0x1f5fe7[_0x3c9c('0xa9')]]);this[_0x3c9c('0x1b')][_0x1f5fe7['queue']]['outboundUnknownCallsDay']+=0x1;_0x2addca=new Hangup(_0x1f5fe7,_0xed5ee9);_0x2addca[_0x3c9c('0x9e')]=0xc;_0x2addca[_0x3c9c('0x9f')]=_0xed5ee9[_0x3c9c('0xf9')];_0x2addca[_0x3c9c('0xd5')]='Unknow';this['createHistory'](_0x2addca)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xf5')));this[_0x3c9c('0xba')](_0x2addca)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xf6')));}};Dialer[_0x3c9c('0x17')]['syncAgentComplete']=function(_0x59bead){var _0x4299db=this[_0x3c9c('0x23')][_0x59bead['uniqueid']];var _0x15b8ae=this;if(this['voiceQueues'][_0x59bead[_0x3c9c('0xa9')]]){if(_0x4299db&&_0x4299db[_0x3c9c('0x74')]!==_0x3c9c('0x75')){delete this[_0x3c9c('0x23')][_0x59bead[_0x3c9c('0xce')]];this[_0x3c9c('0x1b')][_0x59bead['queue']][_0x3c9c('0x55')]+=0x1;var _0x40b77d=new AgentComplete(_0x4299db,_0x59bead);if(_0x59bead[_0x3c9c('0xfa')]===_0x3c9c('0xfb')){_0x40b77d['agiafterat']=this['voiceQueues'][_0x59bead['queue']][_0x3c9c('0xfc')]&&this[_0x3c9c('0x1b')][_0x59bead[_0x3c9c('0xa9')]][_0x3c9c('0xfd')]?moment()['format'](_0x3c9c('0xf3')):undefined;}this[_0x3c9c('0xbb')](_0x40b77d)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xfe')));this[_0x3c9c('0xba')](_0x40b77d)[_0x3c9c('0xa6')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x3c9c('0xff')]=function(_0x36d297){if(this['voiceQueues'][_0x36d297[_0x3c9c('0xa9')]]){if(this['uniqueId'][_0x36d297['uniqueid']]&&this['uniqueId'][_0x36d297['uniqueid']][_0x3c9c('0x74')]!==_0x3c9c('0x75')){this['updateOriginated'](this[_0x3c9c('0x1b')][_0x36d297[_0x3c9c('0xa9')]]);this['uniqueId'][_0x36d297[_0x3c9c('0xce')]]['answertime']=moment()['format'](_0x3c9c('0xf3'));}}};Dialer[_0x3c9c('0x17')][_0x3c9c('0x100')]=function(_0x275ae4){this[_0x3c9c('0xbb')](_0x275ae4)[_0x3c9c('0xa6')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x3c9c('0xba')](_0x275ae4)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x101')));};Dialer[_0x3c9c('0x17')][_0x3c9c('0x102')]=function(_0x4d3344){var _0x51f906=this['uniqueId'][_0x4d3344['uniqueid']];var _0x5ebc87=this;if(this['voiceQueues'][_0x4d3344['queue']]){if(_0x51f906&&_0x51f906['type']!==_0x3c9c('0x75')){delete this[_0x3c9c('0x23')][_0x4d3344[_0x3c9c('0xce')]];this[_0x3c9c('0xa8')](this['voiceQueues'][_0x4d3344[_0x3c9c('0xa9')]]);_0x51f906['droptime']=moment()[_0x3c9c('0x71')](_0x3c9c('0xf3'));var _0x429e52=new QueueCallerAbandon(_0x51f906,_0x4d3344);if(getSeconds(_0x51f906[_0x3c9c('0x103')],_0x51f906[_0x3c9c('0x104')])>=_0x51f906[_0x3c9c('0x105')]){this[_0x3c9c('0x1b')][_0x4d3344['queue']][_0x3c9c('0x63')]+=0x1;this['voiceQueues'][_0x4d3344[_0x3c9c('0xa9')]][_0x3c9c('0x59')]+=0x1;this[_0x3c9c('0x1b')][_0x4d3344['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x429e52[_0x3c9c('0x9e')]=0xa;_0x429e52[_0x3c9c('0x9f')]=_0x3c9c('0x106');_0x429e52[_0x3c9c('0x107')]='TIMEOUT';_0x429e52['agiafterat']=this[_0x3c9c('0x1b')][_0x4d3344[_0x3c9c('0xa9')]][_0x3c9c('0xfc')]?moment()[_0x3c9c('0x71')](_0x3c9c('0xf3')):undefined;_0x429e52['countdropretry']+=0x1;_0x429e52[_0x3c9c('0xde')]+=0x1;if(_0x429e52['countdropretry']>=this[_0x3c9c('0x1b')][_0x4d3344[_0x3c9c('0xa9')]][_0x3c9c('0x108')]){this[_0x3c9c('0x100')](_0x429e52);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x429e52['countdropretry'],'scheduledat':moment()[_0x3c9c('0xe8')](this[_0x3c9c('0x1b')][_0x4d3344[_0x3c9c('0xa9')]]['dialDropRetryFrequency'],_0x3c9c('0xe9'))[_0x3c9c('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51f906['ContactId'],'ListId':_0x51f906[_0x3c9c('0xc5')],'VoiceQueueId':_0x51f906[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x51f906['CampaignId']||undefined})[_0x3c9c('0xa6')](loggerCatch('[rescheduleContact][Drop]'));var _0x3dc93e=new History(_0x429e52);_0x3dc93e[_0x3c9c('0x9e')]=0xa;_0x3dc93e[_0x3c9c('0x9f')]=_0x3c9c('0x106');_0x3dc93e[_0x3c9c('0x109')]=moment()[_0x3c9c('0x71')]('YYYY-MM-DD\x20HH:mm:ss');_0x3dc93e[_0x3c9c('0x10a')]=_0x3dc93e[_0x3c9c('0x109')];_0x3dc93e['calleridname']=_0x429e52[_0x3c9c('0x10b')];_0x3dc93e[_0x3c9c('0x10c')]=_0x429e52[_0x3c9c('0x10c')];this[_0x3c9c('0xbb')](_0x3dc93e)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x10d')));}}else{this['voiceQueues'][_0x4d3344[_0x3c9c('0xa9')]][_0x3c9c('0x62')]+=0x1;this[_0x3c9c('0x1b')][_0x4d3344['queue']][_0x3c9c('0x58')]+=0x1;_0x429e52[_0x3c9c('0x9e')]=0xb;_0x429e52['statedesc']=_0x3c9c('0x10e');_0x429e52[_0x3c9c('0x107')]=_0x3c9c('0x10f');_0x429e52['countabandonedretry']+=0x1;_0x429e52['countglobal']+=0x1;if(_0x429e52[_0x3c9c('0xe3')]>=this[_0x3c9c('0x1b')][_0x4d3344[_0x3c9c('0xa9')]][_0x3c9c('0x110')]){this['queueCallerAbandonCreateState'](_0x429e52);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x429e52[_0x3c9c('0xe3')],'scheduledat':moment()[_0x3c9c('0xe8')](this[_0x3c9c('0x1b')][_0x4d3344[_0x3c9c('0xa9')]][_0x3c9c('0x111')],_0x3c9c('0xe9'))[_0x3c9c('0x71')](_0x3c9c('0xf3')),'ContactId':_0x51f906[_0x3c9c('0xea')],'ListId':_0x51f906[_0x3c9c('0xc5')],'VoiceQueueId':_0x51f906[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x51f906[_0x3c9c('0xc8')]||undefined})[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x112')));var _0x3dc93e=new History(_0x429e52);_0x3dc93e[_0x3c9c('0x9e')]=0xb;_0x3dc93e[_0x3c9c('0x9f')]=_0x3c9c('0x10e');_0x3dc93e[_0x3c9c('0x109')]=moment()[_0x3c9c('0x71')](_0x3c9c('0xf3'));_0x3dc93e[_0x3c9c('0x10a')]=_0x3dc93e['starttime'];_0x3dc93e[_0x3c9c('0x10b')]=_0x429e52['calleridname'];_0x3dc93e[_0x3c9c('0x10c')]=_0x429e52[_0x3c9c('0x10c')];this[_0x3c9c('0xbb')](_0x3dc93e)[_0x3c9c('0xa6')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer['prototype'][_0x3c9c('0x30')]=function(_0x22ae99){if(this[_0x3c9c('0x21')][_0x22ae99['uniqueid']]){this[_0x3c9c('0x21')][_0x22ae99[_0x3c9c('0xce')]][_0x3c9c('0x113')]=_0x22ae99[_0x3c9c('0x113')];}if(this[_0x3c9c('0x23')][_0x22ae99[_0x3c9c('0xce')]]){this[_0x3c9c('0x23')][_0x22ae99[_0x3c9c('0xce')]][_0x3c9c('0x113')]=_0x22ae99[_0x3c9c('0x113')];}};Dialer[_0x3c9c('0x17')][_0x3c9c('0x34')]=function(_0x59b94b){if(strategy[this['voiceQueues'][this[_0x3c9c('0x21')][_0x59b94b[_0x3c9c('0x114')]][_0x3c9c('0xa9')]][_0x3c9c('0x115')]]===_0x3c9c('0x16')){if(this['actions'][_0x59b94b['actionid']]&&_[_0x3c9c('0xa4')](this['actions'][_0x59b94b[_0x3c9c('0x114')]][_0x3c9c('0x116')])&&_0x59b94b[_0x3c9c('0xa5')]==='1'&&_0x59b94b['paused']==='0'){if(this[_0x3c9c('0x1d')][_0x59b94b[_0x3c9c('0x117')]]){if(!this[_0x3c9c('0x1d')][_0x59b94b[_0x3c9c('0x117')]][_0x3c9c('0x116')]){this['agents'][_0x59b94b['stateinterface']]['locked']=!![];this[_0x3c9c('0x21')][_0x59b94b[_0x3c9c('0x114')]][_0x3c9c('0x116')]=!![];this['actions'][_0x59b94b[_0x3c9c('0x114')]][_0x3c9c('0x117')]=_0x59b94b[_0x3c9c('0x117')];}}}}else if((strategy[this[_0x3c9c('0x1b')][this[_0x3c9c('0x21')][_0x59b94b[_0x3c9c('0x114')]][_0x3c9c('0xa9')]][_0x3c9c('0x115')]]||_0x3c9c('0x118'))===_0x3c9c('0x118')){if(this[_0x3c9c('0x21')][_0x59b94b[_0x3c9c('0x114')]]){if(this[_0x3c9c('0x1d')][_0x59b94b[_0x3c9c('0x117')]]){this[_0x3c9c('0x21')][_0x59b94b[_0x3c9c('0x114')]]['stateinterface']=_0x59b94b[_0x3c9c('0x117')];if(_['isNil'](this[_0x3c9c('0x25')][this[_0x3c9c('0x21')][_0x59b94b[_0x3c9c('0x114')]][_0x3c9c('0xa9')]])){this[_0x3c9c('0x25')][this[_0x3c9c('0x21')][_0x59b94b[_0x3c9c('0x114')]][_0x3c9c('0xa9')]]=[];}this['queueBooked'][this['actions'][_0x59b94b['actionid']]['queue']][_0x3c9c('0x119')](_[_0x3c9c('0xc3')](_['pick'](this['actions'][_0x59b94b[_0x3c9c('0x114')]],[_0x3c9c('0x11a'),_0x3c9c('0x117')]),{'status':_0x59b94b['status'],'paused':_0x59b94b[_0x3c9c('0x11b')]}));}}}};function unlockQueueStatus(_0x413e7b,_0x3543aa){setTimeout(function(){if(_['isUndefined'](_0x413e7b[_0x3c9c('0x11c')])){loggerBooked['error'](_0x3c9c('0x11d'),_0x3543aa);}_0x413e7b[_0x3c9c('0x11c')]=!![];loggerBooked['info'](_0x3c9c('0x11e'),_0x3543aa,JSON['stringify'](_['pick'](_0x413e7b,[_0x3c9c('0x39'),_0x3c9c('0x11c')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x467428){var _0x18ee3c=this;var _0x1f3737=_0x18ee3c[_0x3c9c('0x1b')][_0x18ee3c[_0x3c9c('0x21')][_0x467428['actionid']][_0x3c9c('0xa9')]];if(strategy[this[_0x3c9c('0x1b')][this['actions'][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]][_0x3c9c('0x115')]]==='roundrobin'){if(this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]]&&this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0x117')]){this[_0x3c9c('0x88')][_0x3c9c('0x11f')](this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0x11a')],this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0x117')])['catch'](function(_0x5c4d7c){logger[_0x3c9c('0x8c')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x3c9c('0x8d')](_0x5c4d7c,{'showHidden':![],'depth':null}));})[_0x3c9c('0x120')](function(){_0x18ee3c['updateOriginated'](_0x18ee3c[_0x3c9c('0x1b')][_0x18ee3c['actions'][_0x467428['actionid']][_0x3c9c('0xa9')]]);_0x18ee3c[_0x3c9c('0x1d')][_0x18ee3c[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]]['stateinterface']]['locked']=![];delete _0x18ee3c[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]];unlockQueueStatus(_0x1f3737);});}else{this['updateOriginated'](this[_0x3c9c('0x1b')][this[_0x3c9c('0x21')][_0x467428['actionid']][_0x3c9c('0xa9')]]);this[_0x3c9c('0xb4')]({'active':![],'ContactId':this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xea')],'ListId':this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xc5')],'VoiceQueueId':this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xc7')]||undefined,'CampaignId':this['actions'][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xc8')]||undefined})['catch'](loggerCatch(_0x3c9c('0x121')));delete this[_0x3c9c('0x21')][_0x467428['actionid']];unlockQueueStatus(_0x1f3737);}}else if((strategy[this['voiceQueues'][this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]][_0x3c9c('0x115')]]||'rrmemory')===_0x3c9c('0x118')){var _0x58091e;if(this['actions'][_0x467428[_0x3c9c('0x114')]]&&!_[_0x3c9c('0x41')](this['queueBooked'][this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]])){if(this['queueBookedRR'][_0x18ee3c['actions'][_0x467428['actionid']][_0x3c9c('0xa9')]]){this[_0x3c9c('0x26')][_0x18ee3c[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]]['queue']]=this['queueBookedRR'][this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]]?this[_0x3c9c('0x26')][this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]]:this[_0x3c9c('0x25')][this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]]?this[_0x3c9c('0x25')][this[_0x3c9c('0x21')][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]][_0x3c9c('0x122')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]][_0x3c9c('0x122')]=this['queueBookedRR'][this['actions'][_0x467428[_0x3c9c('0x114')]][_0x3c9c('0xa9')]];for(var _0x121a13=0x0;_0x121a13=0x0;})[_0x3c9c('0xa6')](myreject(_0x59d5cb)));}}else{_0x29383a[_0x3c9c('0x119')](ami[_0x3c9c('0x138')]({'action':_0x3c9c('0x139'),'command':util['format']('iftime\x20%s,%s',_0x3201c2,!_[_0x3c9c('0x7f')](config[_0x3c9c('0x13c')][_0x3b13dd])?_0x3b13dd:'')})[_0x3c9c('0xad')](function(_0x4a648b){return _0x4a648b[_0x3c9c('0x13d')][_0x3c9c('0x13e')]('true')>=0x0;})[_0x3c9c('0xa6')](myreject(_0x59d5cb)));}BPromise['all'](_0x29383a)['then'](function(_0x30d52a){var _0x154689=_[_0x3c9c('0x140')](_0x30d52a);if(_0x154689){return _0x581777(_0x154689);}else{_0xd9b03d[_0x3c9c('0x38')]=_0x527aa1?_0x3c9c('0x141'):_0x3c9c('0x142');return _0x59d5cb(msgResponse(_0x3c9c('0x143'),_0x3c9c('0x133'),_0x3c9c('0x144')+_0x527aa1+'\x20'+_0x26de22+_0x3c9c('0x145')+util[_0x3c9c('0x8d')](_0x3201c2,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x3b13dd));}})[_0x3c9c('0xa6')](function(_0xe9e436){return _0x59d5cb(msgResponse(_0x3c9c('0x131'),_0x3c9c('0x133'),JSON[_0x3c9c('0x43')](_0xe9e436)));});});};Dialer[_0x3c9c('0x17')][_0x3c9c('0x146')]=function(_0x7edf6e){var _0x2aab0b=this;return function(){switch(_0x7edf6e['dialMethod']){case _0x3c9c('0x147'):freeVariablesPredictive(_0x7edf6e);_0x2aab0b[_0x3c9c('0x148')](_0x7edf6e,0x1);break;case _0x3c9c('0x149'):freeVariablesPredictive(_0x7edf6e);_0x2aab0b[_0x3c9c('0x148')](_0x7edf6e,_0x7edf6e['dialPowerLevel']);break;case'predictive':_0x2aab0b['predictive'](_0x7edf6e);break;case _0x3c9c('0x7'):freeVariablesPredictive(_0x7edf6e);_0x2aab0b[_0x3c9c('0x148')](_0x7edf6e,0x1);break;default:freeVariablesPredictive(_0x7edf6e);logger['error']('Queue',_0x7edf6e[_0x3c9c('0x39')],_0x3c9c('0x14a'));}};};Dialer[_0x3c9c('0x17')][_0x3c9c('0x14b')]=function(_0x3bd9e7){var _0x54c4c4=this;return function(){_0x54c4c4[_0x3c9c('0x14c')](_0x3bd9e7);};};Dialer[_0x3c9c('0x17')][_0x3c9c('0x9')]=function(_0x93c41a){var _0x5a8708=this;if(isNotPreview(_0x93c41a['dialMethod'])){if(isVoiceQueueOutbound(_0x93c41a[_0x3c9c('0x74')])&&isActive(_0x93c41a['dialActive'])){_0x93c41a['sendMessageOneNotActive']=!![];BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](checkIsLoggedIn(_0x93c41a,_0x93c41a[_0x3c9c('0x48')]))[_0x3c9c('0xad')](checkIsActive(_0x93c41a,_0x93c41a['dialActive']))['then'](checkInterval(_0x93c41a))['then'](_0x5a8708[_0x3c9c('0x12c')](_0x93c41a))[_0x3c9c('0xad')](_0x5a8708[_0x3c9c('0x130')](_0x93c41a[_0x3c9c('0x14d')],_0x93c41a['dialTimezone'],_0x93c41a['name'],_0x93c41a))[_0x3c9c('0xad')](_0x5a8708[_0x3c9c('0x132')](_0x93c41a['Interval'],_0x93c41a[_0x3c9c('0x14e')],_0x93c41a[_0x3c9c('0x39')],_0x93c41a))[_0x3c9c('0xad')](_0x5a8708[_0x3c9c('0x146')](_0x93c41a))['catch'](loggerCatchQueueSummary(_0x3c9c('0x14f'),_0x93c41a));}else{notSendMessagesQueue(_0x93c41a);}}else{freeVariablesPredictive(_0x93c41a);}};Dialer[_0x3c9c('0x17')][_0x3c9c('0x150')]=function(){var _0x56533e=this;var _0x14a406;for(var _0x554788 in this[_0x3c9c('0x1c')]){if(typeof this['campaigns'][_0x554788]!==_0x3c9c('0xa3')){_0x14a406=this[_0x3c9c('0x1c')][_0x554788];if(isCampaignIvr(_0x14a406[_0x3c9c('0x74')])&&isActive(_0x14a406[_0x3c9c('0x6f')])){_0x14a406[_0x3c9c('0x98')]=!![];BPromise[_0x3c9c('0xac')]()[_0x3c9c('0xad')](checkIsActive(_0x14a406,_0x14a406[_0x3c9c('0x6f')]))[_0x3c9c('0xad')](checkInterval(_0x14a406))[_0x3c9c('0xad')](_0x56533e['checkIsTrunkReachable'](_0x14a406))[_0x3c9c('0xad')](_0x56533e[_0x3c9c('0x130')](_0x14a406['dialGlobalInterval'],_0x14a406['dialTimezone'],_0x14a406[_0x3c9c('0x39')],_0x14a406))[_0x3c9c('0xad')](_0x56533e[_0x3c9c('0x132')](_0x14a406[_0x3c9c('0x3d')],_0x14a406['dialTimezone'],_0x14a406[_0x3c9c('0x39')],_0x14a406))[_0x3c9c('0xad')](_0x56533e[_0x3c9c('0x14b')](_0x14a406))[_0x3c9c('0xa6')](loggerCatchQueueSummary(_0x3c9c('0x151'),_0x14a406));}else{notSendMessagesCampaign(_0x14a406);}}}};function getCallerIdRandom(_0x405b03,_0xfd4e37){var _0x37c8db;var _0x6db072;var _0x565988;if(_0xfd4e37<=0x0){_0xfd4e37=0x1;}_0x37c8db=new RegExp(_0x3c9c('0x152')+_0xfd4e37+'}$');_0x6db072=Math[_0x3c9c('0x153')](0xa,_0xfd4e37-0x1);_0x565988=Math['pow'](0xa,_0xfd4e37)-0x1;return util[_0x3c9c('0x71')]('%s',_[_0x3c9c('0x154')](_0x405b03,_0x37c8db,_[_0x3c9c('0x155')](_0x6db072,_0x565988)));}function extractCalleridName(_0x4097fa){var _0x4f6872=_0x4097fa[_0x3c9c('0x156')](/"(.*?)"/);return _0x4f6872?_0x4f6872[0x1]:_0x4097fa;}function extractCalleridNumber(_0x202712){var _0x39e3c4=_0x202712[_0x3c9c('0x156')](/<(.*?)>/);return _0x39e3c4?_0x39e3c4[0x1]:_0x202712;}Dialer[_0x3c9c('0x17')]['actionOriginate']=function(_0x3c84af,_0x6283fa){var _0x348d1c=this;var _0xc3d9fb=uuid['v4']();this[_0x3c9c('0x21')][_0xc3d9fb]=new Action(_0x3c84af,_0x6283fa,_0xc3d9fb);return new BPromise(function(_0x38ec04,_0x2ca4e9){if(_[_0x3c9c('0x7f')](_0x3c84af)&&typeof _0x3c84af!=='object'){return _0x2ca4e9(msgResponse(_0x3c9c('0x157'),_0x3c9c('0x133'),_0x3c9c('0x158')));}if(_[_0x3c9c('0x7f')](_0x6283fa[_0x3c9c('0x159')][_0x3c9c('0x15a')])||_0x6283fa[_0x3c9c('0x159')][_0x3c9c('0x15a')]===null){return _0x2ca4e9(msgResponse(_0x3c9c('0x157'),_0x3c9c('0x133'),_0x3c9c('0x15b')));}var _0x437f12={'XMD-CALLERID':_0x348d1c[_0x3c9c('0x21')][_0xc3d9fb][_0x3c9c('0x15c')](),'XMD-AGI':_0x3c84af[_0x3c9c('0xf7')]?util['format'](_0x3c9c('0x15d'),ipAgi,_0x3c84af[_0x3c9c('0xf7')]):_0x3c9c('0x15e'),'XMD-AGIAFTER':_0x3c84af[_0x3c9c('0xfc')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x3c84af[_0x3c9c('0xfc')]):_0x3c9c('0x15e'),'XMD-QUEUE':_0x3c84af[_0x3c9c('0x74')]===_0x3c9c('0x46')?util['format'](_0x3c9c('0x15f'),_0x3c84af['name'],_0x3c84af['dialQueueOptions']||'',_0x3c84af[_0x3c9c('0xfd')]?'c':'',_0x3c84af[_0x3c9c('0x105')]||0x3):_0x3c9c('0x15e'),'XMD-CONTACTID':_0x6283fa['ContactId'],'XMD-CDRTYPE':_0x3c9c('0x6'),'CALLERID(all)':_0x348d1c[_0x3c9c('0x21')][_0xc3d9fb][_0x3c9c('0x15c')](),'XMD-AMD':_0x3c84af[_0x3c9c('0xec')]?_0x3c9c('0x160'):_0x3c9c('0x15e'),'XMD-DESTINATION':_0x3c9c('0xd1')};if(_0x3c84af['dialAMDActive']){_0x437f12[_0x3c9c('0x161')]=_0x3c84af[_0x3c9c('0x162')]||0x9c4;_0x437f12[_0x3c9c('0x163')]=_0x3c84af[_0x3c9c('0x164')]||0x5dc;_0x437f12[_0x3c9c('0x165')]=_0x3c84af[_0x3c9c('0x166')]||0x320;_0x437f12[_0x3c9c('0x167')]=_0x3c84af[_0x3c9c('0x168')]||0x1388;_0x437f12[_0x3c9c('0x169')]=_0x3c84af[_0x3c9c('0x16a')]||0x64;_0x437f12['XMD-AMDBETWEENWORDSSILENCE']=_0x3c84af[_0x3c9c('0x16b')]||0x32;_0x437f12[_0x3c9c('0x16c')]=_0x3c84af[_0x3c9c('0x16d')]||0x3;_0x437f12[_0x3c9c('0x16e')]=_0x3c84af[_0x3c9c('0x16f')]||0x100;_0x437f12[_0x3c9c('0x170')]=_0x3c84af[_0x3c9c('0x171')]||0x1388;}if(_0x3c84af[_0x3c9c('0x74')]==='outbound'){_0x437f12[_0x3c9c('0x172')]=_0x6283fa[_0x3c9c('0xc7')];}else{_0x437f12[_0x3c9c('0x173')]=_0x6283fa['CampaignId'];}for(var _0x23c9c4 in _0x6283fa[_0x3c9c('0x159')]){if(typeof _0x6283fa['Contact'][_0x23c9c4]!=='undefined'){if(isNotNull(_0x6283fa['Contact'][_0x23c9c4])&&_0x23c9c4!=='id'&&_0x23c9c4!==_0x3c9c('0x174')&&_0x23c9c4!==_0x3c9c('0x175')&&_0x23c9c4!==_0x3c9c('0x176')){_0x437f12[util[_0x3c9c('0x71')](_0x3c9c('0x177'),'XMD-',_[_0x3c9c('0x178')](_0x23c9c4))]=_0x6283fa['Contact'][_0x23c9c4];}}}var _0xe09128=_0x348d1c[_0x3c9c('0xcb')](_0x3c84af[_0x3c9c('0x6e')])?getCallerId(_0x3c84af[_0x3c9c('0x6e')][_0x3c9c('0x179')],_0x3c84af['dialOriginateCallerIdName'],_0x3c84af[_0x3c9c('0x17a')]>0x0?getCallerIdRandom(_0x3c84af[_0x3c9c('0x17b')],_0x3c84af[_0x3c9c('0x17a')]):_0x3c84af['dialOriginateCallerIdNumber']):getCallerId(_[_0x3c9c('0xa4')](_0x3c84af[_0x3c9c('0x12d')])?_0x3c84af[_0x3c9c('0x6e')]['callerid']:_0x3c84af['TrunkBackup'][_0x3c9c('0x179')],_0x3c84af[_0x3c9c('0x17c')],_0x3c84af[_0x3c9c('0x17a')]>0x0?getCallerIdRandom(_0x3c84af['dialOriginateCallerIdNumber'],_0x3c84af[_0x3c9c('0x17a')]):_0x3c84af[_0x3c9c('0x17b')]);if(_0xe09128){_0x437f12['XMD-ORIGINATECALLERIDNAME']=_0x348d1c[_0x3c9c('0x21')][_0xc3d9fb][_0x3c9c('0x17d')]=extractCalleridName(_0xe09128);_0x437f12[_0x3c9c('0x17e')]=_0x348d1c[_0x3c9c('0x21')][_0xc3d9fb][_0x3c9c('0x17f')]=extractCalleridNumber(_0xe09128);}return ami[_0x3c9c('0x138')]({'actionid':_0xc3d9fb,'action':'originate','channel':_0x348d1c['isTrunkReachable'](_0x3c84af[_0x3c9c('0x6e')])?util['format'](_0x3c9c('0x180'),_0x3c84af[_0x3c9c('0x6e')][_0x3c9c('0x39')],isNotNull(_0x3c84af[_0x3c9c('0x53')])?_0x3c84af[_0x3c9c('0x53')][_0x3c9c('0x181')]()||'':'',_0x3c84af[_0x3c9c('0x182')]>0x0?_0x6283fa[_0x3c9c('0x159')]['phone'][_0x3c9c('0x183')](_0x3c84af[_0x3c9c('0x182')]):_0x6283fa[_0x3c9c('0x159')]['phone']):util[_0x3c9c('0x71')](_0x3c9c('0x180'),_['isNil'](_0x3c84af[_0x3c9c('0x12d')])?_0x3c84af[_0x3c9c('0x6e')][_0x3c9c('0x39')]:_0x3c84af[_0x3c9c('0x12d')][_0x3c9c('0x39')],isNotNull(_0x3c84af[_0x3c9c('0x53')])?_0x3c84af[_0x3c9c('0x53')]['trim']()||'':'',_0x3c84af[_0x3c9c('0x182')]>0x0?_0x6283fa['Contact'][_0x3c9c('0x15a')]['substring'](_0x3c84af[_0x3c9c('0x182')]):_0x6283fa['Contact']['phone']),'callerid':_0xe09128,'Exten':_0x3c9c('0xd1'),'Context':_0x3c9c('0x184'),'Priority':'1','variable':_0x437f12,'timeout':(_0x3c84af[_0x3c9c('0x185')]||0x1e)*0x3e8,'async':!![],'channelid':_0xc3d9fb})[_0x3c9c('0xad')](function(_0x59f417){return _0x38ec04(_0x59f417);})[_0x3c9c('0xa6')](function(_0x37adbe){_0x3c84af[_0x3c9c('0x5c')]+=0x1;var _0x480a1e=new History(_0x348d1c[_0x3c9c('0x21')][_0xc3d9fb]);logger[_0x3c9c('0x8c')](util[_0x3c9c('0x71')](_0x3c9c('0x186'),JSON[_0x3c9c('0x43')](_0x37adbe)));_0x480a1e[_0x3c9c('0x9e')]=0xe;_0x480a1e[_0x3c9c('0x9f')]=_0x3c9c('0x187');_0x480a1e[_0x3c9c('0x109')]=moment()[_0x3c9c('0x71')](_0x3c9c('0xf3'));_0x480a1e[_0x3c9c('0x10a')]=_0x480a1e[_0x3c9c('0x109')];_0x348d1c[_0x3c9c('0xbb')](_0x480a1e)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x188')));_0x348d1c[_0x3c9c('0xba')](_0x480a1e)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x188')))[_0x3c9c('0x120')](function(){delete _0x348d1c[_0x3c9c('0x21')][_0xc3d9fb];return _0x2ca4e9(msgResponse(_0x3c9c('0x157'),'Error',_0x3c9c('0x189')));});});});};Dialer[_0x3c9c('0x17')][_0x3c9c('0x2a')]=function(_0x52e667){var _0xbcd0f6=this['actions'][_0x52e667[_0x3c9c('0x114')]];if(_0xbcd0f6){delete this[_0x3c9c('0x21')][_0x52e667[_0x3c9c('0x114')]];_0xbcd0f6[_0x3c9c('0x104')]=moment()[_0x3c9c('0x71')](_0x3c9c('0xf3'));var _0xf6d87a=_0xbcd0f6[_0x3c9c('0x74')]===_0x3c9c('0x75')?this['campaigns'][_0xbcd0f6[_0x3c9c('0xa9')]]:this['voiceQueues'][_0xbcd0f6[_0x3c9c('0x18a')]()];if(!this[_0x3c9c('0xca')](_0x52e667[_0x3c9c('0x18b')])){this[_0x3c9c('0xa8')](_0xf6d87a);return this['callProgressDetecting'](_0xbcd0f6,_0xf6d87a,_0x52e667)['catch'](loggerCatch(_0x3c9c('0x18c')));}this[_0x3c9c('0x23')][_0x52e667[_0x3c9c('0xce')]]=_0xbcd0f6;}};Dialer[_0x3c9c('0x17')][_0x3c9c('0x18d')]=function(_0x3f750b,_0x21c660,_0x32bbf6){var _0x2b9a05=new History(_0x21c660);if(_0x2b9a05[_0x3c9c('0xdf')]+_0x2b9a05[_0x3c9c('0xe0')]+_0x2b9a05[_0x3c9c('0xe1')]+_0x2b9a05['countnosuchnumberretry']+_0x2b9a05['countdropretry']+_0x2b9a05[_0x3c9c('0xe3')]+_0x2b9a05['countmachineretry']+_0x2b9a05[_0x3c9c('0x18e')]>=_0x32bbf6[_0x3c9c('0xe4')]-0x1){return!![];}switch(_0x3f750b){case 0x3:if(_0x2b9a05[_0x3c9c('0xe1')]>=_0x32bbf6[_0x3c9c('0x18f')]-0x1){return!![];}this[_0x3c9c('0xb4')]({'active':![],'countnoanswerretry':_0x2b9a05[_0x3c9c('0xe1')]+=0x1,'scheduledat':moment()[_0x3c9c('0xe8')](_0x32bbf6['dialNoAnswerRetryFrequency'],'minutes')[_0x3c9c('0x71')](_0x3c9c('0xf3')),'ContactId':_0x2b9a05[_0x3c9c('0xea')],'ListId':_0x2b9a05[_0x3c9c('0xc5')],'VoiceQueueId':_0x2b9a05[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x2b9a05[_0x3c9c('0xc8')]||undefined})[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x190')));break;case 0x5:if(_0x2b9a05[_0x3c9c('0xdf')]>=_0x32bbf6[_0x3c9c('0x191')]-0x1){return!![];}this[_0x3c9c('0xb4')]({'active':![],'countbusyretry':_0x2b9a05[_0x3c9c('0xdf')]+=0x1,'scheduledat':moment()[_0x3c9c('0xe8')](_0x32bbf6[_0x3c9c('0x192')],_0x3c9c('0xe9'))[_0x3c9c('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2b9a05['ContactId'],'ListId':_0x2b9a05[_0x3c9c('0xc5')],'VoiceQueueId':_0x2b9a05[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x2b9a05[_0x3c9c('0xc8')]||undefined})[_0x3c9c('0xa6')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x2b9a05['countcongestionretry']>=_0x32bbf6[_0x3c9c('0x193')]-0x1){return!![];}this[_0x3c9c('0xb4')]({'active':![],'countcongestionretry':_0x2b9a05[_0x3c9c('0xe0')]+=0x1,'scheduledat':moment()[_0x3c9c('0xe8')](_0x32bbf6[_0x3c9c('0x194')],_0x3c9c('0xe9'))[_0x3c9c('0x71')](_0x3c9c('0xf3')),'ContactId':_0x2b9a05[_0x3c9c('0xea')],'ListId':_0x2b9a05[_0x3c9c('0xc5')],'VoiceQueueId':_0x2b9a05[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x2b9a05[_0x3c9c('0xc8')]||undefined})[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x195')));break;case 0x0:if(_0x2b9a05[_0x3c9c('0xe2')]>=_0x32bbf6[_0x3c9c('0x196')]-0x1){return!![];}else{this[_0x3c9c('0xb4')]({'active':![],'countnosuchnumberretry':_0x2b9a05[_0x3c9c('0xe2')]+=0x1,'scheduledat':moment()[_0x3c9c('0xe8')](_0x32bbf6[_0x3c9c('0x197')],_0x3c9c('0xe9'))[_0x3c9c('0x71')](_0x3c9c('0xf3')),'ContactId':_0x2b9a05[_0x3c9c('0xea')],'ListId':_0x2b9a05['ListId'],'VoiceQueueId':_0x2b9a05['VoiceQueueId']||undefined,'CampaignId':_0x2b9a05[_0x3c9c('0xc8')]||undefined})[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x198')));}break;case 0xa:if(_0x2b9a05[_0x3c9c('0x199')]>=_0x32bbf6['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x2b9a05[_0x3c9c('0x199')]+=0x1,'scheduledat':moment()[_0x3c9c('0xe8')](_0x32bbf6[_0x3c9c('0x19a')],'minutes')[_0x3c9c('0x71')](_0x3c9c('0xf3')),'ContactId':_0x2b9a05[_0x3c9c('0xea')],'ListId':_0x2b9a05[_0x3c9c('0xc5')],'VoiceQueueId':_0x2b9a05[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x2b9a05[_0x3c9c('0xc8')]||undefined})['catch'](loggerCatch(_0x3c9c('0x19b')));break;case 0xb:if(_0x2b9a05['countabandonedretry']>=_0x32bbf6['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x3c9c('0xb4')]({'active':![],'countabandonedretry':_0x2b9a05[_0x3c9c('0xe3')]+=0x1,'scheduledat':moment()['add'](_0x32bbf6['dialAbandonedRetryFrequency'],_0x3c9c('0xe9'))[_0x3c9c('0x71')](_0x3c9c('0xf3')),'ContactId':_0x2b9a05[_0x3c9c('0xea')],'ListId':_0x2b9a05[_0x3c9c('0xc5')],'VoiceQueueId':_0x2b9a05[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x2b9a05[_0x3c9c('0xc8')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2b9a05[_0x3c9c('0xdd')]>=_0x32bbf6[_0x3c9c('0xe6')]-0x1){return!![];}this[_0x3c9c('0xb4')]({'active':![],'countmachineretry':_0x2b9a05[_0x3c9c('0xdd')]+=0x1,'scheduledat':moment()[_0x3c9c('0xe8')](_0x32bbf6['dialMachineRetryFrequency'],'minutes')[_0x3c9c('0x71')](_0x3c9c('0xf3')),'ContactId':_0x2b9a05[_0x3c9c('0xea')],'ListId':_0x2b9a05['ListId'],'VoiceQueueId':_0x2b9a05[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x2b9a05[_0x3c9c('0xc8')]||undefined})[_0x3c9c('0xa6')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2b9a05[_0x3c9c('0x18e')]>=_0x32bbf6[_0x3c9c('0x19c')]-0x1){return!![];}this[_0x3c9c('0xb4')]({'active':![],'countagentrejectretry':_0x2b9a05[_0x3c9c('0x18e')]+=0x1,'scheduledat':moment()['add'](_0x32bbf6[_0x3c9c('0x19d')],_0x3c9c('0xe9'))[_0x3c9c('0x71')](_0x3c9c('0xf3')),'ContactId':_0x2b9a05[_0x3c9c('0xea')],'ListId':_0x2b9a05[_0x3c9c('0xc5')],'VoiceQueueId':_0x2b9a05[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x2b9a05['CampaignId']||undefined})[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x19e')));break;default:return!![];}};Dialer[_0x3c9c('0x17')][_0x3c9c('0x19f')]=function(_0x3a4e00,_0x35d1a3,_0x292d3e){var _0x35f0c9=this;var _0x29b5ee=new History(_0x3a4e00);return new BPromise(function(_0x4390c1,_0x9377af){if(_[_0x3c9c('0x7f')](_0x35d1a3)&&typeof _0x35d1a3!==_0x3c9c('0x1a0')){return _0x9377af(msgResponse(_0x3c9c('0x1a1'),_0x3c9c('0x133'),'entity\x20is\x20undefine'));}if(_[_0x3c9c('0x7f')](_0x292d3e)&&typeof _0x292d3e!==_0x3c9c('0x1a0')){return _0x9377af(msgResponse(_0x3c9c('0x1a1'),'Failure',_0x3c9c('0x1a2')));}switch(_0x292d3e['reason']){case'0':_0x35d1a3['outboundNoSuchCallsDay']+=0x1;_0x29b5ee['state']=0x0;_0x29b5ee[_0x3c9c('0x9f')]=_0x3c9c('0x1a3');_0x29b5ee[_0x3c9c('0xe2')]+=0x1;_0x29b5ee['countglobal']+=0x1;ami[_0x3c9c('0xd6')]('custom:agentnosuchnumber',ut[_0x3c9c('0xd8')](_0x3a4e00,_0x3c9c('0x1a4')));_0x35f0c9[_0x3c9c('0xbb')](_0x29b5ee)[_0x3c9c('0xa6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x35f0c9['checkRetriveMax'](0x0,_0x3a4e00,_0x35d1a3)){if(_0x29b5ee[_0x3c9c('0xe2')]>=_0x35d1a3[_0x3c9c('0x196')]){_0x35f0c9[_0x3c9c('0xf1')](_0x29b5ee,_0x4390c1,_0x9377af,_0x3c9c('0x1a5'));}else{_0x35f0c9[_0x3c9c('0xf0')](_0x29b5ee,_0x4390c1,_0x9377af,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x35d1a3[_0x3c9c('0x5a')]+=0x1;_0x29b5ee[_0x3c9c('0x9e')]=0x3;_0x29b5ee['statedesc']=_0x3c9c('0x1a6');_0x29b5ee[_0x3c9c('0xe1')]+=0x1;_0x29b5ee[_0x3c9c('0xde')]+=0x1;ami['emit'](_0x3c9c('0x1a7'),ut['buildObj'](_0x3a4e00,_0x3c9c('0x1a8')));_0x35f0c9[_0x3c9c('0xbb')](_0x29b5ee)['catch'](loggerCatch(_0x3c9c('0x1a9')));if(_0x35f0c9[_0x3c9c('0x18d')](0x3,_0x3a4e00,_0x35d1a3)){if(_0x29b5ee[_0x3c9c('0xe1')]>=_0x35d1a3[_0x3c9c('0x18f')]){_0x35f0c9['createStateFinal'](_0x29b5ee,_0x4390c1,_0x9377af,'reason\x203\x20ringing\x20no\x20answer');}else{_0x35f0c9[_0x3c9c('0xf0')](_0x29b5ee,_0x4390c1,_0x9377af,_0x3c9c('0x1aa'));}}break;case'5':_0x35d1a3['outboundBusyCallsDay']+=0x1;_0x29b5ee['state']=0x5;_0x29b5ee['statedesc']='Busy';_0x29b5ee['countbusyretry']+=0x1;_0x29b5ee[_0x3c9c('0xde')]+=0x1;ami['emit'](_0x3c9c('0x1ab'),ut[_0x3c9c('0xd8')](_0x3a4e00,_0x3c9c('0x1ac')));_0x35f0c9[_0x3c9c('0xbb')](_0x29b5ee)['catch'](loggerCatch(_0x3c9c('0x1ad')));if(_0x35f0c9[_0x3c9c('0x18d')](0x5,_0x3a4e00,_0x35d1a3)){if(_0x29b5ee[_0x3c9c('0xdf')]>=_0x35d1a3['dialBusyMaxRetry']){_0x35f0c9[_0x3c9c('0xf1')](_0x29b5ee,_0x4390c1,_0x9377af,'reason\x205\x20busy');}else{_0x35f0c9[_0x3c9c('0xf0')](_0x29b5ee,_0x4390c1,_0x9377af,'reason\x205\x20busy');}}break;case'8':_0x35d1a3['outboundCongestionCallsDay']+=0x1;_0x29b5ee['state']=0x8;_0x29b5ee[_0x3c9c('0x9f')]=_0x3c9c('0x1ae');_0x29b5ee[_0x3c9c('0xe0')]+=0x1;_0x29b5ee[_0x3c9c('0xde')]+=0x1;ami[_0x3c9c('0xd6')](_0x3c9c('0x1af'),ut['buildObj'](_0x3a4e00,_0x3c9c('0x1b0')));_0x35f0c9['createHistory'](_0x29b5ee)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x1b1')));if(_0x35f0c9[_0x3c9c('0x18d')](0x8,_0x3a4e00,_0x35d1a3)){if(_0x29b5ee[_0x3c9c('0xe0')]>=_0x35d1a3[_0x3c9c('0x193')]){_0x35f0c9[_0x3c9c('0xf1')](_0x29b5ee,_0x4390c1,_0x9377af,'reason\x208\x20congestion');}else{_0x35f0c9[_0x3c9c('0xf0')](_0x29b5ee,_0x4390c1,_0x9377af,'reason\x208\x20congestion');}}break;case'11':_0x35d1a3[_0x3c9c('0x1b2')]+=0x1;_0x29b5ee['state']=0xb;_0x29b5ee['statedesc']=_0x3c9c('0x10e');_0x29b5ee[_0x3c9c('0xe3')]+=0x1;_0x29b5ee[_0x3c9c('0xde')]+=0x1;_0x35f0c9[_0x3c9c('0xbb')](_0x29b5ee)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x1b3')));if(_0x35f0c9[_0x3c9c('0x18d')](0xb,_0x3a4e00,_0x35d1a3)){if(_0x29b5ee[_0x3c9c('0xe3')]>=_0x35d1a3[_0x3c9c('0x110')]){_0x35f0c9['createStateFinal'](_0x29b5ee,_0x4390c1,_0x9377af,_0x3c9c('0x1b4'));}else{_0x35f0c9[_0x3c9c('0xf0')](_0x29b5ee,_0x4390c1,_0x9377af,'reason\x2011\x20abandoned');}}break;case'20':_0x35d1a3['outboundRejectCallsDay']+=0x1;_0x29b5ee['state']=0x14;_0x29b5ee['statedesc']=_0x3c9c('0x1b5');_0x29b5ee[_0x3c9c('0x18e')]+=0x1;_0x29b5ee[_0x3c9c('0xde')]+=0x1;ami[_0x3c9c('0xd6')](_0x3c9c('0x1b6'),ut[_0x3c9c('0xd8')](_0x3a4e00,'agentreject'));_0x35f0c9[_0x3c9c('0xbb')](_0x29b5ee)[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x1b7')));if(_0x35f0c9[_0x3c9c('0x18d')](0x14,_0x3a4e00,_0x35d1a3)){if(_0x29b5ee[_0x3c9c('0x18e')]>=_0x35d1a3[_0x3c9c('0x19c')]){_0x35f0c9[_0x3c9c('0xf1')](_0x29b5ee,_0x4390c1,_0x9377af,_0x3c9c('0x1b8'));}else{_0x35f0c9[_0x3c9c('0xf0')](_0x29b5ee,_0x4390c1,_0x9377af,_0x3c9c('0x1b8'));}}break;default:_0x35d1a3[_0x3c9c('0x5e')]+=0x1;_0x29b5ee[_0x3c9c('0x9e')]=0xc;_0x29b5ee[_0x3c9c('0x9f')]=_0x292d3e[_0x3c9c('0xfa')];_0x35f0c9[_0x3c9c('0xbb')](_0x29b5ee)['catch'](loggerCatch(_0x3c9c('0x1b9')));if(_0x35f0c9[_0x3c9c('0x18d')](_0x292d3e[_0x3c9c('0xfa')],_0x3a4e00,_0x35d1a3)){if(_0x29b5ee[_0x3c9c('0xdf')]+_0x29b5ee[_0x3c9c('0xe0')]+_0x29b5ee[_0x3c9c('0xe1')]+_0x29b5ee[_0x3c9c('0xe2')]+_0x29b5ee[_0x3c9c('0x199')]+_0x29b5ee[_0x3c9c('0xe3')]+_0x29b5ee[_0x3c9c('0xdd')]+_0x29b5ee['countagentrejectretry']>=_0x35d1a3['dialGlobalMaxRetry']){_0x35f0c9[_0x3c9c('0xf0')](_0x29b5ee,_0x4390c1,_0x9377af,_0x292d3e['reason']);}else{_0x35f0c9['createStateFinal'](_0x29b5ee,_0x4390c1,_0x9377af,_0x292d3e['reason']);}}}});};Dialer[_0x3c9c('0x17')][_0x3c9c('0xf0')]=function(_0x599eff,_0x1ad1c2,_0xa149bf,_0x125944){var _0x2ef989=new Final(_0x599eff);_0x2ef989[_0x3c9c('0x9e')]=0xf;_0x2ef989[_0x3c9c('0x9f')]=_0x3c9c('0x1ba');this[_0x3c9c('0xf1')](_0x2ef989,_0x1ad1c2,_0xa149bf,_0x125944);};Dialer[_0x3c9c('0x17')][_0x3c9c('0xf1')]=function(_0x15d370,_0x293e6b,_0x3e5783,_0x23ce97){this[_0x3c9c('0xba')](_0x15d370)[_0x3c9c('0xad')](function(){return _0x293e6b(msgResponse('[callProgressDetecting]',_0x3c9c('0x1bb'),_0x23ce97));})['catch'](function(){return _0x3e5783(msgResponse('[moveContactManagedDialer][0]',_0x3c9c('0x133'),'contact\x20not\x20moved'));});};Dialer[_0x3c9c('0x17')][_0x3c9c('0x8')]=function(_0x3aac3e){var _0x5c781b=_0x3aac3e[_0x3c9c('0x1bc')]/0x64;var _0x41bd79=_0x3aac3e[_0x3c9c('0x59')]/(_0x3aac3e[_0x3c9c('0x59')]+_0x3aac3e['outboundAnswerCallsDay']);var _0x21dcfc=Math[_0x3c9c('0x1bd')](_0x3aac3e[_0x3c9c('0x67')]*(_0x3aac3e[_0x3c9c('0x1be')]/0x64));var _0x181b43=Math[_0x3c9c('0x1bd')](_0x3aac3e[_0x3c9c('0x67')]*(_0x3aac3e['predictiveIntervalMinThreshold']/0x64));var _0x663ee9=_0x3aac3e['available']+_0x3aac3e[_0x3c9c('0x4c')];var _0x418091=Math[_0x3c9c('0x1bf')](_0x3aac3e[_0x3c9c('0x83')]*_0x3aac3e[_0x3c9c('0x6b')]*_0x3aac3e[_0x3c9c('0x66')]*_0x3aac3e['predictiveIntervalMultiplicativeFactor']);if(_[_0x3c9c('0x7f')](_0x3aac3e['startProgressive'])){if(!_[_0x3c9c('0x7f')](_0x3aac3e[_0x3c9c('0x24')])){_0x3aac3e[_0x3c9c('0x24')]=undefined;loggerPredictive['error'](_0x3c9c('0x1c0'),_0x3c9c('0x1c1'));}if(!_[_0x3c9c('0x7f')](_0x3aac3e[_0x3c9c('0x86')])){loggerPredictive[_0x3c9c('0x8c')](_0x3c9c('0x1c0'),_0x3c9c('0x1c2'));clearInterval(_0x3aac3e[_0x3c9c('0x86')]);_0x3aac3e[_0x3c9c('0x86')]=undefined;}_0x3aac3e[_0x3c9c('0x6d')]=moment()['format'](_0x3c9c('0xf3'));loggerPredictive[_0x3c9c('0x77')](_0x3aac3e[_0x3c9c('0x39')],_0x3c9c('0x1c3'),_0x3aac3e[_0x3c9c('0x6d')]);this['handlePower'](_0x3aac3e,0x1);}else if(ifInterval(_0x3aac3e[_0x3c9c('0x1c4')],_0x3aac3e[_0x3c9c('0x6d')])){this[_0x3c9c('0x148')](_0x3aac3e,0x1);loggerPredictiveCalls[_0x3c9c('0x77')](_0x3c9c('0x1c5'),_0x3aac3e[_0x3c9c('0x6d')],_0x3aac3e[_0x3c9c('0x39')]);_0x3aac3e['erlangCalls']=0x0;_0x3aac3e[_0x3c9c('0x65')]=0x0;}else if(_0x5c781b<_0x41bd79&&_0x3aac3e[_0x3c9c('0x1c6')]===_0x3c9c('0x1c7')){freeVariablesPredictive(_0x3aac3e);loggerPredictive[_0x3c9c('0x77')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x3c9c('0x1c8'),_0x41bd79,_0x3c9c('0x6d'),_0x3aac3e[_0x3c9c('0x39')]);}else if(_0x418091<_0x3aac3e[_0x3c9c('0x65')]&&_0x3aac3e[_0x3c9c('0x1c6')]===_0x3c9c('0x1c7')){freeVariablesPredictive(_0x3aac3e);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x1c9'),_0x3c9c('0x1ca'),_0x418091,_0x3c9c('0x1cb'),_0x3aac3e[_0x3c9c('0x65')],_0x3c9c('0x6d'),_0x3aac3e[_0x3c9c('0x39')]);}else if(!ifInterval(_0x3aac3e[_0x3c9c('0x1c4')],_0x3aac3e[_0x3c9c('0x6d')])&&_[_0x3c9c('0x7f')](_0x3aac3e[_0x3c9c('0x24')])&&!_[_0x3c9c('0x7f')](_0x3aac3e[_0x3c9c('0x6d')])){_0x3aac3e[_0x3c9c('0x24')]=moment()[_0x3c9c('0x71')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3c9c('0x77')](_0x3aac3e[_0x3c9c('0x39')],_0x3c9c('0x1cc'),_0x3aac3e['startPredictive']);this[_0x3c9c('0x1cd')](_0x3aac3e[_0x3c9c('0x1c4')])[_0x3c9c('0xad')](this[_0x3c9c('0x1ce')](_0x3aac3e))['then'](mergeDataErlangB(_0x3aac3e))[_0x3c9c('0xad')](this[_0x3c9c('0x1cf')](_0x3aac3e))['catch'](loggerCatchPredictive(_0x3c9c('0x1d0'),_0x3aac3e));}else if(!ifInterval(_0x3aac3e[_0x3c9c('0x1c4')],_0x3aac3e[_0x3c9c('0x24')])){_0x3aac3e[_0x3c9c('0x65')]=0x0;_0x3aac3e['startPredictive']=moment()[_0x3c9c('0x71')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3c9c('0x77')](_0x3aac3e[_0x3c9c('0x39')],'recalculate\x20predictive\x20at',_0x3aac3e[_0x3c9c('0x24')]);clearInterval(_0x3aac3e[_0x3c9c('0x86')]);_0x3aac3e[_0x3c9c('0x86')]=undefined;this['averageHandleTime'](_0x3aac3e[_0x3c9c('0x1c4')])[_0x3c9c('0xad')](this[_0x3c9c('0x1ce')](_0x3aac3e))[_0x3c9c('0xad')](mergeDataErlangB(_0x3aac3e))[_0x3c9c('0xad')](this[_0x3c9c('0x1cf')](_0x3aac3e))[_0x3c9c('0xa6')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3aac3e));}else if(_0x3aac3e['predictiveIntervalAvailable']&&_0x663ee9<_0x3aac3e[_0x3c9c('0x67')]-_0x181b43){freeVariablesPredictive(_0x3aac3e);loggerPredictive[_0x3c9c('0x77')](_0x3aac3e[_0x3c9c('0x39')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x663ee9,_0x3c9c('0x1d1'),_0x3aac3e[_0x3c9c('0x67')],'-',_0x181b43,'=',_0x3aac3e[_0x3c9c('0x67')]-_0x181b43,')');}else if(_0x3aac3e[_0x3c9c('0x67')]&&_0x663ee9>_0x3aac3e[_0x3c9c('0x67')]+_0x21dcfc){freeVariablesPredictive(_0x3aac3e);loggerPredictive[_0x3c9c('0x77')](_0x3aac3e[_0x3c9c('0x39')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x663ee9,_0x3c9c('0x1d2'),_0x3aac3e[_0x3c9c('0x67')],'+',_0x21dcfc,'=',_0x3aac3e[_0x3c9c('0x67')]+_0x21dcfc,')');}};Dialer['prototype'][_0x3c9c('0x1ce')]=function(_0x5cc2bc){var _0x4ce1aa=this;return function(_0x160c58){return new BPromise(function(_0x400d68,_0x269aa0){_[_0x3c9c('0xc3')](_0x5cc2bc,_0x160c58[0x0]);if(checkGetDataPredictive(_0x160c58[0x0])){var _0x370cd9=_0x5cc2bc[_0x3c9c('0x67')]=_0x5cc2bc[_0x3c9c('0x4c')]+_0x5cc2bc[_0x3c9c('0x99')];var _0x4aaebd=_0x5cc2bc['dialPredictiveInterval']*0x3c;var _0x39fc5d=_0x160c58[0x0][_0x3c9c('0x61')]+_0x160c58[0x0][_0x3c9c('0x60')];var _0x5c6bc7=(_0x160c58[0x0]['predictiveIntervalAnsweredCalls']+_0x160c58[0x0][_0x3c9c('0x63')]+_0x160c58[0x0][_0x3c9c('0x62')])/_0x160c58[0x0][_0x3c9c('0x68')];_0x5cc2bc[_0x3c9c('0x66')]=_0x5c6bc7>0x0?_0x5c6bc7:0x1;switch(_0x5cc2bc[_0x3c9c('0x1c6')]){case'dropRate':var _0x494c40=_0x5cc2bc[_0x3c9c('0x1bc')]/0x64;return _0x4ce1aa[_0x3c9c('0x1d3')](_0x370cd9,_0x4aaebd,_0x39fc5d,_0x5c6bc7,_0x494c40)[_0x3c9c('0xad')](function(_0x27283b){return _0x400d68(_0x27283b);});case _0x3c9c('0x1d4'):var _0x19ebc6=_0x5cc2bc[_0x3c9c('0x1bc')]/0x64;return _0x4ce1aa[_0x3c9c('0x1d5')](_0x370cd9,_0x4aaebd,_0x39fc5d,_0x5c6bc7,_0x19ebc6)[_0x3c9c('0xad')](function(_0xf83091){return _0x400d68(_0xf83091);});default:return _0x269aa0(msgResponse(_0x3c9c('0x1d6'),_0x3c9c('0x133'),'Unknown\x20Predictive'));}}else{return _0x269aa0(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x3c9c('0x17')][_0x3c9c('0x1d7')]=function(_0x43823c){var _0x37b0c3=this;return function(_0x58f4f0){return new BPromise(function(_0x44205e,_0x175e99){_[_0x3c9c('0xc3')](_0x43823c,_0x58f4f0[0x0]);if(checkGetDataPredictive(_0x58f4f0[0x0])){loggerPredictive[_0x3c9c('0x77')](JSON[_0x3c9c('0x43')](_0x58f4f0[0x0]));if(_0x43823c[_0x3c9c('0x1c6')]==='dropRate'){return _0x37b0c3[_0x3c9c('0xb9')](_0x43823c['id'])[_0x3c9c('0xad')](function(_0x143b58){var _0xc75ffd=_0x43823c[_0x3c9c('0x48')]-_0x143b58[0x0][_0x3c9c('0x1d8')];var _0x5029ff=_0x43823c[_0x3c9c('0x1c4')]*0x3c;var _0x1c7f77=_0x58f4f0[0x0][_0x3c9c('0x61')]+_0x58f4f0[0x0]['predictiveIntervalAvgHoldtime'];var _0xa3aa19=(_0x58f4f0[0x0][_0x3c9c('0x5f')]+_0x58f4f0[0x0][_0x3c9c('0x63')]+_0x58f4f0[0x0][_0x3c9c('0x62')])/_0x58f4f0[0x0][_0x3c9c('0x68')];var _0x33f4e1=_0x43823c[_0x3c9c('0x1bc')]/0x64;_0x43823c['predictiveIntervalPauses']=_0x143b58[0x0][_0x3c9c('0x1d8')]||0x0;_0x43823c[_0x3c9c('0x66')]=_0xa3aa19>0x0?_0xa3aa19:0x1;return _0x37b0c3[_0x3c9c('0x1d3')](_0xc75ffd,_0x5029ff,_0x1c7f77,_0xa3aa19,_0x33f4e1);})[_0x3c9c('0xad')](function(_0x2db8bf){return _0x44205e(_0x2db8bf);})[_0x3c9c('0xa6')](function(_0x354ddf){return _0x175e99(msgResponse(_0x3c9c('0x1d9'),_0x3c9c('0x133'),JSON[_0x3c9c('0x43')](_0x354ddf)));});}if(_0x43823c['dialPredictiveOptimization']===_0x3c9c('0x1d4')){return _0x37b0c3[_0x3c9c('0xb9')](_0x43823c['id'])[_0x3c9c('0xad')](function(_0x5362ad){var _0x2370c6=_0x43823c[_0x3c9c('0x48')]-_0x5362ad[0x0][_0x3c9c('0x1d8')];var _0x58458e=_0x43823c[_0x3c9c('0x1c4')]*0x3c;var _0x111b00=_0x58f4f0[0x0]['predictiveIntervalAvgTalktime']+_0x58f4f0[0x0][_0x3c9c('0x60')];var _0x148199=(_0x58f4f0[0x0]['predictiveIntervalAnsweredCalls']+_0x58f4f0[0x0][_0x3c9c('0x63')]+_0x58f4f0[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x58f4f0[0x0][_0x3c9c('0x68')];var _0x25cddf=_0x43823c[_0x3c9c('0x1bc')]/0x64;_0x43823c[_0x3c9c('0x1da')]=_0x5362ad[0x0][_0x3c9c('0x1d8')]||0x0;_0x43823c[_0x3c9c('0x66')]=_0x148199>0x0?_0x148199:0x1;return _0x37b0c3[_0x3c9c('0x1d5')](_0x2370c6,_0x58458e,_0x111b00,_0x148199,_0x25cddf);})[_0x3c9c('0xad')](function(_0x2621fe){return _0x44205e(_0x2621fe);})['catch'](function(_0x5cf4bd){return _0x175e99(msgResponse(_0x3c9c('0x1d9'),_0x3c9c('0x133'),JSON[_0x3c9c('0x43')](_0x5cf4bd)));});}}else{return _0x175e99(msgResponse('[getDataPredictive]',_0x3c9c('0x133'),_0x3c9c('0x1db')));}});};};Dialer[_0x3c9c('0x17')][_0x3c9c('0x1cf')]=function(_0x200a9e){var _0x4a2f58=this;return function(){var _0x1d5b4f=0x0;var _0x174163=Math[_0x3c9c('0x1bf')](_0x200a9e['erlangCallToSecond']*0x3e8);if(_0x174163>0x0){_0x174163=_0x174163<0x64?0x64:_0x174163;loggerPredictive[_0x3c9c('0x77')](_0x200a9e[_0x3c9c('0x39')],_0x3c9c('0x1dc'),_0x174163,_0x3c9c('0x44'));_0x200a9e[_0x3c9c('0x86')]=setInterval(function(){_0x4a2f58['handlePredictive'](_0x200a9e);loggerPredictiveCalls[_0x3c9c('0x77')](_0x3c9c('0x1dd'),_0x1d5b4f+=0x1);},_0x174163);}else{loggerPredictive[_0x3c9c('0x77')](_0x200a9e[_0x3c9c('0x39')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x3c9c('0x17')][_0x3c9c('0x1de')]=function(_0x398c99,_0x55118c){var _0x3a3c0c=this;return function(_0x5c9ea7){if(_['isEmpty'](_0x5c9ea7)){if(_[_0x3c9c('0xa4')](_0x55118c[_0x3c9c('0xc6')])||!_0x55118c['recallme']){if(_0x398c99['dialMethod']==='booked'){_0x398c99[_0x3c9c('0x11c')]=_[_0x3c9c('0x7f')](_0x398c99[_0x3c9c('0x11c')])?!![]:_0x398c99[_0x3c9c('0x11c')];var _0xe3c977=uuid['v4']();_0x3a3c0c[_0x3c9c('0x21')][_0xe3c977]=new Action(_0x398c99,_0x55118c,_0xe3c977);loggerBooked[_0x3c9c('0x77')]('[booked][checkContactBlack]',_0xe3c977,'queueStatusComplete:\x20',JSON[_0x3c9c('0x43')](_0x398c99[_0x3c9c('0x11c')]),_0x3c9c('0x1df'),_0x398c99[_0x3c9c('0x39')]);if(_0x398c99[_0x3c9c('0x11c')]){_0x398c99[_0x3c9c('0x11c')]=![];_0x3a3c0c[_0x3c9c('0x25')][_0x3a3c0c[_0x3c9c('0x21')][_0xe3c977][_0x3c9c('0xa9')]]=[];ami[_0x3c9c('0x138')]({'actionid':_0xe3c977,'action':_0x3c9c('0x1e0'),'queue':_0x398c99[_0x3c9c('0x39')]})[_0x3c9c('0xa6')](function(){_0x3a3c0c['updateOriginated'](_0x398c99);_0x3a3c0c[_0x3c9c('0xb4')]({'active':![],'ContactId':_0x3a3c0c['actions'][_0xe3c977][_0x3c9c('0xea')],'ListId':_0x3a3c0c[_0x3c9c('0x21')][_0xe3c977][_0x3c9c('0xc5')],'VoiceQueueId':_0x3a3c0c['actions'][_0xe3c977][_0x3c9c('0xc7')]||undefined,'CampaignId':_0x3a3c0c[_0x3c9c('0x21')][_0xe3c977][_0x3c9c('0xc8')]||undefined})['catch'](loggerCatch(_0x3c9c('0x1e1')));delete _0x3a3c0c[_0x3c9c('0x21')][_0xe3c977];});}else{loggerBooked[_0x3c9c('0x77')]('[booked][checkContactBlack][else]',JSON[_0x3c9c('0x43')](_0x398c99['queueStatusComplete']),_0x3c9c('0x1df'),_0x398c99[_0x3c9c('0x39')]);_0x3a3c0c[_0x3c9c('0xa8')](_0x398c99);_0x3a3c0c['rescheduleContact']({'active':![],'ContactId':_0x3a3c0c[_0x3c9c('0x21')][_0xe3c977]['ContactId'],'ListId':_0x3a3c0c[_0x3c9c('0x21')][_0xe3c977][_0x3c9c('0xc5')],'VoiceQueueId':_0x3a3c0c[_0x3c9c('0x21')][_0xe3c977][_0x3c9c('0xc7')]||undefined,'CampaignId':_0x3a3c0c[_0x3c9c('0x21')][_0xe3c977][_0x3c9c('0xc8')]||undefined})[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0x1e1')));delete _0x3a3c0c[_0x3c9c('0x21')][_0xe3c977];}}else{return _0x3a3c0c[_0x3c9c('0x1e2')](_0x398c99,_0x55118c);}}else{if(getDiff(_0x55118c[_0x3c9c('0x1e3')])<_0x398c99[_0x3c9c('0x1e4')]*0x3c){if(_0x55118c['Agent']&&!_0x55118c[_0x3c9c('0x1e5')][_0x3c9c('0x1e6')]){_0x3a3c0c['preview']['run'](_0x55118c['id'])[_0x3c9c('0x120')](function(){_0x3a3c0c['updateOriginated'](_0x398c99);});}else{_0x3a3c0c[_0x3c9c('0x1e7')]({'active':![]},_0x55118c['id'],0x1)[_0x3c9c('0x120')](function(){_0x3a3c0c[_0x3c9c('0xa8')](_0x398c99);});}}else{_0x398c99[_0x3c9c('0x5d')]+=0x1;_0x3a3c0c[_0x3c9c('0xa8')](_0x398c99);if(_0x398c99[_0x3c9c('0x1e8')]){_0x3a3c0c[_0x3c9c('0xb4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x55118c[_0x3c9c('0xea')],'ListId':_0x55118c['ListId'],'VoiceQueueId':_0x55118c[_0x3c9c('0xc7')]||undefined,'CampaignId':_0x55118c['CampaignId']||undefined})['catch'](loggerCatch(_0x3c9c('0x1e9')));_0x3a3c0c[_0x3c9c('0xbb')](createObjHistory(_0x398c99,_0x55118c,_0x3c9c('0x1ea'),0x17,'RecallInQueue'))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x3a3c0c['saveInDb'](createObjHistory(_0x398c99,_0x55118c,_0x3c9c('0x1eb'),0x16,'RecallFailedTimeout'),_0x3c9c('0x1ec'),'[Originate][HistoryRecallClose]');}}}}else{_0x398c99[_0x3c9c('0x56')]+=0x1;_0x3a3c0c[_0x3c9c('0xc2')](createObjHistory(_0x398c99,_0x55118c,'BLACKLIST',0xd,_0x3c9c('0x1ed')),_0x3c9c('0x1ee'),_0x3c9c('0x1ef'));throw _0x3c9c('0x1f0');}};};Dialer[_0x3c9c('0x17')][_0x3c9c('0x14c')]=function(_0x5b74b7){var _0x1fafc8=this;var _0x2ebd14=_0x5b74b7['limitCalls']-_0x5b74b7[_0x3c9c('0x69')]-_0x5b74b7[_0x3c9c('0xb7')];emitCampaignSummary(_0x5b74b7);if(_0x2ebd14>0x0){if(_0x2ebd14>this[_0x3c9c('0x1f')]){_0x2ebd14=this[_0x3c9c('0x1f')];}_0x5b74b7[_0x3c9c('0xb7')]+=_0x2ebd14;this['getContactDialerIvr'](_0x5b74b7['id'],_0x2ebd14,_0x5b74b7[_0x3c9c('0x1f1')],_0x5b74b7)[_0x3c9c('0xad')](function(_0x1ba81c){_0x5b74b7[_0x3c9c('0xb7')]-=_0x2ebd14;_0x5b74b7['temp']=_0x5b74b7[_0x3c9c('0xb7')]>0x0?_0x5b74b7[_0x3c9c('0xb7')]:0x0;if(!checkContactEmpty(_0x1ba81c)){_0x5b74b7[_0x3c9c('0x38')]=_0x3c9c('0x96');logger[_0x3c9c('0x77')]('[getContactCampaign2][Empty]'+_0x5b74b7['name']);}else{_0x5b74b7['originated']+=_0x1ba81c[_0x3c9c('0x8f')];_0x5b74b7[_0x3c9c('0x38')]=_0x3c9c('0x1f2');for(var _0x1f32cb=0x0;_0x1f32cb<_0x1ba81c[_0x3c9c('0x8f')];_0x1f32cb+=0x1){_0x5b74b7['ivrTotalCallsDays']+=0x1;if(_[_0x3c9c('0xa4')](_0x1ba81c[_0x1f32cb])||_[_0x3c9c('0xa4')](_0x1ba81c[_0x1f32cb][_0x3c9c('0x159')])||_[_0x3c9c('0xa4')](_0x1ba81c[_0x1f32cb][_0x3c9c('0x159')][_0x3c9c('0x15a')])){_0x1fafc8[_0x3c9c('0xc0')](_0x3c9c('0x1f3'),_0x5b74b7,_0x1ba81c[_0x1f32cb]);}else{_0x1fafc8[_0x3c9c('0xb1')](_[_0x3c9c('0xc4')](_0x1ba81c[_0x1f32cb],[_0x3c9c('0xc8'),'Contact.phone']))[_0x3c9c('0xad')](_0x1fafc8[_0x3c9c('0x1de')](_0x5b74b7,_0x1ba81c[_0x1f32cb]))[_0x3c9c('0xa6')](_0x1fafc8[_0x3c9c('0xbf')]('[actionOriginateIvr]\x20',_0x5b74b7));}}}})[_0x3c9c('0xa6')](loggerGetContactDialer(_0x3c9c('0x1f4'),_0x5b74b7,_0x2ebd14));}};Dialer['prototype'][_0x3c9c('0x148')]=function(_0x2b71c7,_0x526019){var _0x75bc2e=this;var _0x4600a0=[];var _0x4c4ff7=_0x526019>=0x1?_0x526019:0x1;if(_0x2b71c7[_0x3c9c('0x1f5')]===_0x3c9c('0x7')){_0x4c4ff7=0x1;}var _0xebe6ba=Math['floor'](_0x2b71c7[_0x3c9c('0x99')]*_0x4c4ff7)-_0x2b71c7[_0x3c9c('0x69')]-_0x2b71c7[_0x3c9c('0xb7')];emitVoiceQueueSummary(_0x2b71c7);if(_0x2b71c7[_0x3c9c('0x1f6')]>0x0){var _0x315504=_0x2b71c7[_0x3c9c('0x1f6')]-_0x2b71c7[_0x3c9c('0x69')]-_0x2b71c7['talking']-_0x2b71c7['temp']-_0x2b71c7['pTalking'];if(_0xebe6ba>_0x315504){_0xebe6ba=_0x315504;}}if(_0xebe6ba>0x0){if(_0x2b71c7['dialMethod']===_0x3c9c('0x7')){_0xebe6ba=0x1;}if(_0xebe6ba>this['maxNumberOriginate']){_0xebe6ba=this[_0x3c9c('0x1f')];}_0x2b71c7[_0x3c9c('0xb7')]+=_0xebe6ba;for(var _0x43323f in this[_0x3c9c('0x1d')]){if(typeof this[_0x3c9c('0x1d')][_0x43323f]!==_0x3c9c('0xa3')){if(this[_0x3c9c('0x1d')][_0x43323f]['state']===_0x3c9c('0x1f7')&&this[_0x3c9c('0x1d')][_0x43323f]['status']===_0x3c9c('0x1f8')){_0x4600a0['push'](this['agents'][_0x43323f]['id']);}}}this[_0x3c9c('0xb6')](_0x2b71c7['id'],_0x4600a0,_0xebe6ba,_0x2b71c7['dialOrderByScheduledAt'],_0x2b71c7)[_0x3c9c('0xad')](function(_0x18f030){_0x2b71c7[_0x3c9c('0xb7')]-=_0xebe6ba;_0x2b71c7[_0x3c9c('0xb7')]=_0x2b71c7['temp']>0x0?_0x2b71c7[_0x3c9c('0xb7')]:0x0;if(!checkContactEmpty(_0x18f030)){_0x75bc2e[_0x3c9c('0xae')](_0x2b71c7)[_0x3c9c('0xad')](sendMessageReschedule(_0x2b71c7))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2b71c7[_0x3c9c('0x69')]+=_0x18f030[_0x3c9c('0x8f')];_0x2b71c7[_0x3c9c('0x38')]=_0x2b71c7['dialMethod']===_0x3c9c('0x7')?'ACTIVE':'RUNNING';for(var _0x2de65b=0x0;_0x2de65b<_0x18f030[_0x3c9c('0x8f')];_0x2de65b+=0x1){if(_[_0x3c9c('0xa4')](_0x18f030[_0x2de65b])||_[_0x3c9c('0xa4')](_0x18f030[_0x2de65b][_0x3c9c('0x159')])||_[_0x3c9c('0xa4')](_0x18f030[_0x2de65b]['Contact'][_0x3c9c('0x15a')])){_0x75bc2e[_0x3c9c('0xc0')](_0x3c9c('0x1f3'),_0x2b71c7,_0x18f030[_0x2de65b]);}else{_0x75bc2e[_0x3c9c('0xb0')](_[_0x3c9c('0xc4')](_0x18f030[_0x2de65b],[_0x3c9c('0xc7'),_0x3c9c('0x1f9')]))[_0x3c9c('0xad')](_0x75bc2e[_0x3c9c('0x1de')](_0x2b71c7,_0x18f030[_0x2de65b]))[_0x3c9c('0xa6')](_0x75bc2e[_0x3c9c('0xbf')](_0x3c9c('0x1f3'),_0x2b71c7));}}}})[_0x3c9c('0xa6')](loggerGetContactDialer(_0x3c9c('0x1fa'),_0x2b71c7,_0xebe6ba));}};Dialer[_0x3c9c('0x17')][_0x3c9c('0x86')]=function(_0x595b8c){if(_0x595b8c['dialLimitQueue']>0x0){var _0x1686e6=_0x595b8c['dialLimitQueue']-_0x595b8c[_0x3c9c('0x69')]-_0x595b8c[_0x3c9c('0x4c')];if(_0x1686e6>0x0){this[_0x3c9c('0x1fb')](_0x595b8c);}else{loggerPredictiveCalls[_0x3c9c('0x77')](_0x3c9c('0x1fc'));}}else{this[_0x3c9c('0x1fb')](_0x595b8c);}};Dialer[_0x3c9c('0x17')][_0x3c9c('0x1fb')]=function(_0x137f4c){var _0xc35046=this;var _0x43ce5d=[];_0x137f4c[_0x3c9c('0x69')]+=0x1;for(var _0xa2cec9 in this['agents']){if(typeof this[_0x3c9c('0x1d')][_0xa2cec9]!=='undefined'){if(this[_0x3c9c('0x1d')][_0xa2cec9][_0x3c9c('0x9e')]===_0x3c9c('0x1f7')&&this[_0x3c9c('0x1d')][_0xa2cec9][_0x3c9c('0xa5')]==='reachable'){_0x43ce5d[_0x3c9c('0x119')](this[_0x3c9c('0x1d')][_0xa2cec9]['id']);}}}this['getContactDialer'](_0x137f4c['id'],_0x43ce5d,0x1,_0x137f4c[_0x3c9c('0x1f1')],_0x137f4c)['then'](function(_0x51808c){if(!checkContactEmpty(_0x51808c)){checkContactLowerLimitOriginate(_0x137f4c,0x1,0x0);_0xc35046['countReScheduled'](_0x137f4c)[_0x3c9c('0xad')](sendMessageReschedule(_0x137f4c))[_0x3c9c('0xa6')](loggerCatch(_0x3c9c('0xaf')));}else{_0x137f4c[_0x3c9c('0x38')]=_0x3c9c('0x1f2');if(_[_0x3c9c('0xa4')](_0x51808c[0x0])||_['isNil'](_0x51808c[0x0][_0x3c9c('0x159')])||_[_0x3c9c('0xa4')](_0x51808c[0x0][_0x3c9c('0x159')][_0x3c9c('0x15a')])){_0xc35046[_0x3c9c('0xc0')](_0x3c9c('0x1f3'),_0x137f4c,_0x51808c[0x0]);}else{_0xc35046[_0x3c9c('0xb0')](_[_0x3c9c('0xc4')](_0x51808c[0x0],[_0x3c9c('0xc7'),'Contact.phone']))[_0x3c9c('0xad')](_0xc35046[_0x3c9c('0x1de')](_0x137f4c,_0x51808c[0x0]))[_0x3c9c('0xa6')](_0xc35046['loggerHandler']('[actionOriginatePredictive]\x20',_0x137f4c));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x137f4c,0x1));emitVoiceQueueSummary(_0x137f4c);};Dialer[_0x3c9c('0x17')]['abandonmentRate']=function(_0x5722c5,_0x89bd5a,_0x5571bb,_0x527c77,_0x185a33,_0x2b748b){loggerPredictive['info'](_0x3c9c('0x1fd'));loggerPredictive[_0x3c9c('0x77')]('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',_0x5722c5);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x1fe'),_0x89bd5a);loggerPredictive['info'](_0x3c9c('0x1ff'),_0x5571bb);loggerPredictive['info'](_0x3c9c('0x200'),_0x527c77);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x201'),_0x185a33);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x7e'));return new BPromise(function(_0x397cd2,_0x49cabb){if(_0x5722c5<=0x0||isNaN(_0x5722c5)){return _0x49cabb(msgResponse(_0x3c9c('0x202'),'Error',_0x3c9c('0x203')+_0x5722c5));}if(_0x5571bb<=0x0||isNaN(_0x5571bb)){return _0x49cabb(msgResponse(_0x3c9c('0x202'),_0x3c9c('0x204'),_0x3c9c('0x205')+_0x5571bb));}if(_0x527c77<=0x0||isNaN(_0x527c77)){return _0x49cabb(msgResponse('[abandonmentRate]',_0x3c9c('0x204'),_0x3c9c('0x206')+_0x527c77));}if(_0x89bd5a<=0x0||isNaN(_0x89bd5a)){return _0x49cabb(msgResponse('[abandonmentRate]',_0x3c9c('0x204'),'interval\x20=\x20'+_0x89bd5a));}if(_0x185a33<=0x0||isNaN(_0x185a33)){return _0x49cabb(msgResponse('[abandonmentRate]',_0x3c9c('0x204'),_0x3c9c('0x207')+_0x185a33));}_0x2b748b=_0x2b748b||0x0;var _0x4b0799=0x1/_0x5571bb;var _0xc919d8=0x0;var _0x441d0a=0x0;var _0xec19b2=0x0;var _0x341ffa=0x0;for(var _0x39958c=0x0;_0xec19b2<_0x185a33;_0x39958c+=0x1){_0x441d0a=_0x39958c/_0x89bd5a;_0xc919d8=(_0x527c77*_0x441d0a+_0x2b748b)/_0x4b0799;_0xec19b2=erlangb(_0xc919d8,_0x5722c5);_0x341ffa=_0xc919d8/_0x5722c5*(0x1-erlangb(_0xc919d8,_0x5722c5));}return _0x397cd2({'erlangCalls':_0x39958c,'erlangCallToSecond':_0x89bd5a/_0x39958c,'erlangAbandonmentRate':_0xec19b2,'erlangBusyFactor':_0x341ffa});});};Dialer[_0x3c9c('0x17')][_0x3c9c('0x1d5')]=function(_0xff4d8d,_0x4b9793,_0x490954,_0x4fc54c,_0x9d52eb,_0x333d54){loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x208'));loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x209'),_0xff4d8d);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x1fe'),_0x4b9793);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x1ff'),_0x490954);loggerPredictive['info'](_0x3c9c('0x200'),_0x4fc54c);loggerPredictive[_0x3c9c('0x77')](_0x3c9c('0x20a'),_0x9d52eb);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x24644a,_0x23ebf1){if(_0xff4d8d<=0x0||isNaN(_0xff4d8d)){return _0x23ebf1(msgResponse(_0x3c9c('0x20b'),_0x3c9c('0x204'),_0x3c9c('0x203')+_0xff4d8d));}if(_0x490954<=0x0||isNaN(_0x490954)){return _0x23ebf1(msgResponse('[busyFactor]',_0x3c9c('0x204'),_0x3c9c('0x205')+_0x490954));}if(_0x4fc54c<=0x0||isNaN(_0x4fc54c)){return _0x23ebf1(msgResponse(_0x3c9c('0x20b'),_0x3c9c('0x204'),_0x3c9c('0x206')+_0x4fc54c));}if(_0x4b9793<=0x0||isNaN(_0x4b9793)){return _0x23ebf1(msgResponse('[busyFactor]',_0x3c9c('0x204'),'interval\x20=\x20'+_0x4b9793));}if(_0x9d52eb<=0x0||isNaN(_0x9d52eb)){return _0x23ebf1(msgResponse('[busyFactor]',_0x3c9c('0x204'),_0x3c9c('0x20c')+_0x9d52eb));}_0x333d54=_0x333d54||0x0;var _0xf2d4b0=0x1/_0x490954;var _0x1db9ba=0x0;var _0x4c90c8=0x0;var _0x59191f=0x0;var _0x147aec=0x0;for(var _0x66988=0x0;_0x147aec<_0x9d52eb;_0x66988+=0x1){_0x4c90c8=_0x66988/_0x4b9793;_0x1db9ba=(_0x4fc54c*_0x4c90c8+_0x333d54)/_0xf2d4b0;_0x59191f=erlangb(_0x1db9ba,_0xff4d8d);_0x147aec=_0x1db9ba/_0xff4d8d*(0x1-erlangb(_0x1db9ba,_0xff4d8d));}return _0x24644a({'erlangCalls':_0x66988,'erlangCallToSecond':_0x4b9793/_0x66988,'erlangAbandonmentRate':_0x59191f,'erlangBusyFactor':_0x147aec});});};module[_0x3c9c('0x20d')]=Dialer; \ No newline at end of file +var _0x1152=['ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','stack','length','undefined','error','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','Action','status','catch','updateOriginated','[Dialer][checkChannel]','queue','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','inspect','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','[emptyContact][createHistory]','[emptyContact]','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','HangupInAMD','membername','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','AMD','[syncHangupInAMDIvr]','countnoanswerretry','add','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','Unknow','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','Abandoned','[syncAgentComplete][createHistory][11]','channel','actionid','locked','stateinterface','push','pick','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialMethod','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','available','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','check\x20failure','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','floor','dialLimitQueue','not_inuse','dialOrderByScheduledAt','RUNNING','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','booked','syncQueueSummary','../ami','redis','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','custom:queuesummary','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','message','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','dialActive','dialOriginateCallerIdName','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive'];(function(_0x1ac032,_0x3dc349){var _0x2fd5a4=function(_0xb53fdf){while(--_0xb53fdf){_0x1ac032['push'](_0x1ac032['shift']());}};_0x2fd5a4(++_0x3dc349);}(_0x1152,0x182));var _0x2115=function(_0xa601a2,_0x47718e){_0xa601a2=_0xa601a2-0x0;var _0x54af8a=_0x1152[_0xa601a2];return _0x54af8a;};'use strict';var util=require(_0x2115('0x0'));var _=require(_0x2115('0x1'));var BPromise=require(_0x2115('0x2'));var uuid=require(_0x2115('0x3'));var moment=require(_0x2115('0x4'));var rr=require('rr');var md5=require(_0x2115('0x5'));var Redis=require(_0x2115('0x6'));var ut=require(_0x2115('0x7'));var config=require('../../../config/environment/');var logger=require(_0x2115('0x8'))('dialer');var loggerBooked=require(_0x2115('0x8'))(_0x2115('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x2115('0xa'));var ami=require(_0x2115('0xb'));config[_0x2115('0xc')]=_['defaults'](config[_0x2115('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2115('0xc')]));var cmHopper=require(_0x2115('0xd'));var cmHopperHistory=require(_0x2115('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x2115('0xf'));var Action=require('./action');var History=require(_0x2115('0x10'));var Final=require(_0x2115('0x11'));var AgentComplete=require(_0x2115('0x12'));var QueueCallerAbandon=require(_0x2115('0x13'));var Hangup=require(_0x2115('0x14'));var ipAgi=process['env'][_0x2115('0x15')]||'127.0.0.1';var strategy={'rrmemory':_0x2115('0x16'),'roundrobin':_0x2115('0x17')};var Sequence=function(){};Sequence[_0x2115('0x18')][_0x2115('0x19')]=function(_0x7f6183){this[_0x2115('0x1a')]=this[_0x2115('0x1a')]?this['tail'][_0x2115('0x1b')](_0x7f6183):_0x7f6183();};function Dialer(_0x21b589,_0xc97f87){this[_0x2115('0x1c')]=new Sequence();this[_0x2115('0x1d')]=_0xc97f87;this[_0x2115('0x1e')]=_0x21b589[_0x2115('0x1e')];this[_0x2115('0x1f')]=_0x21b589['campaigns'];this[_0x2115('0x20')]=_0x21b589[_0x2115('0x20')];this[_0x2115('0x21')]=_0x21b589['trunks'];this[_0x2115('0x22')]=config[_0x2115('0x22')]||0x2;this[_0x2115('0x23')]={};this[_0x2115('0x24')]={};this[_0x2115('0x25')]={};this[_0x2115('0x26')]={};this[_0x2115('0x27')]={};this[_0x2115('0x28')]={};this[_0x2115('0x29')]={};this[_0x2115('0x2a')]={};this[_0x2115('0x2b')]={};this[_0x2115('0x2c')]={};ami['on'](_0x2115('0x2d'),this[_0x2115('0x2e')]['bind'](this));ami['on'](_0x2115('0x2f'),this[_0x2115('0x30')][_0x2115('0x31')](this));ami['on'](_0x2115('0x32'),this[_0x2115('0x33')][_0x2115('0x31')](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on'](_0x2115('0x34'),this[_0x2115('0xa')][_0x2115('0x31')](this));ami['on']('hangup',this[_0x2115('0x35')][_0x2115('0x31')](this));ami['on'](_0x2115('0x36'),this[_0x2115('0x37')][_0x2115('0x31')](this));ami['on']('varset',this[_0x2115('0x38')][_0x2115('0x31')](this));ami['on']('queuemember',this[_0x2115('0x39')][_0x2115('0x31')](this));ami['on'](_0x2115('0x3a'),this[_0x2115('0x3b')]['bind'](this));this[_0x2115('0x3c')]();this[_0x2115('0x3d')]();}function isNotNull(_0x12d148){return _0x12d148!==null&&!_[_0x2115('0x3e')](_0x12d148);}function checkIsLoggedIn(_0x21e6b9,_0x27969d){return function(){if(_0x27969d<=0x0){_0x21e6b9['message']='AGENTS_NOT_LOGGED';throw _0x21e6b9[_0x2115('0x3f')]+_0x2115('0x40');}};}function isActive(_0x45be88){return _0x45be88;}function checkIsActive(_0x1cab53,_0x32bc0c){return function(){if(!isActive(_0x32bc0c)){_0x1cab53['message']=_0x2115('0x41');throw _0x1cab53[_0x2115('0x3f')]+_0x2115('0x42');}};}function checkInterval(_0x48a888){return function(){if(!isNotNull(_0x48a888[_0x2115('0x43')])){_0x48a888['message']=_0x2115('0x44');throw _0x48a888['name']+_0x2115('0x45');}if(!isNotNull(_0x48a888[_0x2115('0x43')][_0x2115('0x46')])){_0x48a888['message']='INTERVAL_IS_NULL';throw _0x48a888[_0x2115('0x3f')]+_0x2115('0x45');}if(!isNotNull(_['isEmpty'](_0x48a888[_0x2115('0x43')][_0x2115('0x46')]))){_0x48a888[_0x2115('0x47')]=_0x2115('0x44');throw _0x48a888['name']+_0x2115('0x45');}};}function msgResponse(_0x41c9dc,_0x1f1fc3,_0x115502){return{'action':_0x41c9dc,'response':_0x1f1fc3,'message':_0x115502,'stack':_0x115502};}function myreject(_0x5c57ed){return function(_0x43a649){return _0x5c57ed(msgResponse(_0x2115('0x48'),_0x2115('0x49'),JSON[_0x2115('0x4a')](_0x43a649)));};}function getSeconds(_0x3922de,_0x28f70b){var _0x5ce0bd=moment(_0x3922de)[_0x2115('0x4b')](0x0);var _0x1a3621=moment(_0x28f70b)[_0x2115('0x4b')](0x0);return _0x5ce0bd[_0x2115('0x4c')](_0x1a3621,_0x2115('0x4d'));}function emit(_0xcfaaa9,_0x57198d,_0x130fee){io['to'](_0xcfaaa9)['emit'](_0x57198d,_0x130fee);}function emitVoiceQueueSummary(_0x59b531){if(_0x59b531[_0x2115('0x4e')]===_0x2115('0x4f')){var _0x4572f3={'id':_0x59b531['id'],'name':_0x59b531[_0x2115('0x3f')],'strategy':_0x59b531[_0x2115('0x50')],'answered':_0x59b531[_0x2115('0x51')],'available':_0x59b531['available'],'loggedIn':_0x59b531[_0x2115('0x52')],'pTalking':_0x59b531[_0x2115('0x53')],'sumBillable':_0x59b531[_0x2115('0x54')],'sumDuration':_0x59b531[_0x2115('0x55')],'sumHoldTime':_0x59b531[_0x2115('0x56')]||0x0,'talking':_0x59b531[_0x2115('0x57')],'total':_0x59b531[_0x2115('0x58')],'type':_0x59b531[_0x2115('0x4e')],'unmanaged':_0x59b531[_0x2115('0x59')],'abandoned':_0x59b531[_0x2115('0x5a')],'waiting':_0x59b531['waiting'],'loggedInDb':_0x59b531['loggedInDb'],'dialActive':_0x59b531[_0x2115('0x5b')],'dialMethod':_0x59b531['dialMethod'],'dialOriginateCallerIdName':_0x59b531[_0x2115('0x5c')],'dialOriginateCallerIdNumber':_0x59b531['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x59b531['dialOriginateTimeout'],'dialPrefix':_0x59b531['dialPrefix'],'outboundAnswerAgiCallsDay':_0x59b531[_0x2115('0x5d')],'outboundAnswerCallsDay':_0x59b531[_0x2115('0x5e')],'outboundBlacklistCallsDay':_0x59b531[_0x2115('0x5f')],'outboundBusyCallsDay':_0x59b531[_0x2115('0x60')],'outboundCongestionCallsDay':_0x59b531[_0x2115('0x61')],'outboundDropCallsDayACS':_0x59b531['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x59b531[_0x2115('0x62')],'outboundDropCallsDayTimeout':_0x59b531['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x59b531[_0x2115('0x63')],'outboundNoSuchCallsDay':_0x59b531[_0x2115('0x64')],'outboundOriginateFailureCallsDay':_0x59b531['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x59b531[_0x2115('0x65')],'outboundRejectCallsDay':_0x59b531[_0x2115('0x66')],'outboundUnknownCallsDay':_0x59b531['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x59b531['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x59b531[_0x2115('0x67')],'predictiveIntervalAvgTalktime':_0x59b531[_0x2115('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x59b531['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x59b531['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x59b531[_0x2115('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x59b531[_0x2115('0x6a')],'predictiveIntervalHitRate':_0x59b531['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x59b531['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x59b531[_0x2115('0x6b')],'predictiveIntervalAvailable':_0x59b531[_0x2115('0x6c')],'predictiveIntervalTotalCalls':_0x59b531[_0x2115('0x6d')],'message':_0x59b531['message'],'originated':_0x59b531[_0x2115('0x6e')],'erlangCalls':_0x59b531['erlangCalls'],'erlangCallToSecond':_0x59b531[_0x2115('0x6f')],'erlangAbandonmentRate':_0x59b531[_0x2115('0x70')],'erlangBusyFactor':_0x59b531[_0x2115('0x71')],'startPredictive':_0x59b531[_0x2115('0x28')],'startProgressive':_0x59b531[_0x2115('0x29')]};if(_0x59b531['Trunk']){_0x4572f3[_0x2115('0x72')]={'id':_0x59b531['Trunk']['id'],'name':_0x59b531['Trunk'][_0x2115('0x3f')],'active':_0x59b531[_0x2115('0x72')]['active'],'callerid':_0x59b531[_0x2115('0x72')][_0x2115('0x73')]};}if(_0x59b531[_0x2115('0x43')]){_0x4572f3[_0x2115('0x43')]={'id':_0x59b531[_0x2115('0x43')]['id'],'name':_0x59b531[_0x2115('0x43')][_0x2115('0x3f')]};}var _0x347f16=md5(JSON[_0x2115('0x4a')](_0x4572f3));if(_0x59b531['md5']!==_0x347f16){_0x59b531[_0x2115('0x5')]=_0x347f16;emit(util[_0x2115('0x74')](_0x2115('0x75'),_0x4572f3['name']),_0x2115('0x76'),_0x4572f3);}}}function emitCampaignSummary(_0x592394){if(_0x592394['type']==='ivr'){emit(util[_0x2115('0x74')](_0x2115('0x77'),_0x592394['name']),'campaign:save',_0x592394);}}function checkGetDataPredictive(_0xd2f5cd){if(isNotNull(_0xd2f5cd)&&!_[_0x2115('0x78')](_0xd2f5cd)){loggerPredictive[_0x2115('0x79')](_0x2115('0x7a'));loggerPredictive[_0x2115('0x79')](_0x2115('0x7b'),_0xd2f5cd[_0x2115('0x6d')]);loggerPredictive[_0x2115('0x79')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd2f5cd[_0x2115('0x7c')]);loggerPredictive[_0x2115('0x79')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd2f5cd[_0x2115('0x7d')]);loggerPredictive[_0x2115('0x79')](_0x2115('0x7e'),_0xd2f5cd[_0x2115('0x7f')]);loggerPredictive[_0x2115('0x79')](_0x2115('0x80'),_0xd2f5cd['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x2115('0x79')](_0x2115('0x81'),_0xd2f5cd['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x2115('0x82'));if(_0xd2f5cd[_0x2115('0x6d')]>0x0){if(!_[_0x2115('0x3e')](_0xd2f5cd[_0x2115('0x68')])&&_0xd2f5cd['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x2115('0x79')](_0x2115('0x83'));if(!_[_0x2115('0x3e')](_0xd2f5cd[_0x2115('0x67')])&&_0xd2f5cd[_0x2115('0x67')]>0x0){return!![];}loggerPredictive[_0x2115('0x79')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x2115('0x79')](_0x2115('0x84'));}}else{loggerPredictive['info'](_0x2115('0x85'));}return![];}function mergeDataErlangB(_0x34f5f0){return function(_0x1edb9a){loggerPredictive['info'](_0x2115('0x86'));loggerPredictive['info'](_0x2115('0x87'),_0x1edb9a[_0x2115('0x88')]);loggerPredictive[_0x2115('0x79')](_0x2115('0x89'),_0x1edb9a[_0x2115('0x6f')]);loggerPredictive[_0x2115('0x79')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1edb9a[_0x2115('0x70')]);loggerPredictive[_0x2115('0x79')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1edb9a[_0x2115('0x71')]);loggerPredictive[_0x2115('0x79')](_0x2115('0x8a'),_0x1edb9a['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0x2115('0x8b')](_0x34f5f0,_0x1edb9a);};}function getDiff(_0x48194b){var _0x1f15c5=moment()[_0x2115('0x4b')](0x0);var _0xfe429d=moment(_0x48194b)['milliseconds'](0x0);return _0x1f15c5[_0x2115('0x4c')](_0xfe429d,'seconds');}function ifInterval(_0x386f8a,_0x3a3055){if(_['isUndefined'](_0x3a3055)){return![];}return getDiff(_0x3a3055)<_0x386f8a*0x3c;}function freeVariablesPredictive(_0x47d7d2){if(isNotNull(_0x47d7d2)){if(!_[_0x2115('0x3e')](_0x47d7d2[_0x2115('0x29')])){_0x47d7d2['startProgressive']=undefined;loggerPredictive[_0x2115('0x79')](_0x47d7d2['name'],_0x2115('0x8c'));}if(!_[_0x2115('0x3e')](_0x47d7d2['startPredictive'])){_0x47d7d2[_0x2115('0x28')]=undefined;loggerPredictive[_0x2115('0x79')](_0x47d7d2[_0x2115('0x3f')],_0x2115('0x8d'));}if(!_[_0x2115('0x3e')](_0x47d7d2[_0x2115('0x8e')])){clearInterval(_0x47d7d2[_0x2115('0x8e')]);_0x47d7d2[_0x2115('0x8e')]=undefined;loggerPredictive[_0x2115('0x79')](_0x47d7d2[_0x2115('0x3f')],_0x2115('0x8f'));}}}function erlangb(_0x22e234,_0x12b7da){if(_0x12b7da===0x0){return 0x0;}var _0x84d526=0x1;for(var _0x39ce87=0x1;_0x39ce87<=_0x12b7da;_0x39ce87+=0x1){_0x84d526=0x1+_0x84d526*_0x39ce87/_0x22e234;}return 0x1/_0x84d526;}function isVoiceQueueOutbound(_0x21baa7){return _0x21baa7===_0x2115('0x4f');}function isNotPreview(_0x227df2){return _0x227df2!=='preview';}function isCampaignIvr(_0x27dbae){return _0x27dbae===_0x2115('0x90');}function getCallerId(_0x40b279,_0x1e3cc9,_0x2ee9d1){if(!_[_0x2115('0x3e')](_0x2ee9d1)&&typeof _0x2ee9d1===_0x2115('0x91')&&!_['isEmpty'](_0x2ee9d1)){if(!_[_0x2115('0x3e')](_0x1e3cc9)&&typeof _0x1e3cc9===_0x2115('0x91')&&!_[_0x2115('0x78')](_0x1e3cc9)){return util['format'](_0x2115('0x92'),_0x1e3cc9,_0x2ee9d1);}return util[_0x2115('0x74')](_0x2115('0x92'),_0x2ee9d1,_0x2ee9d1);}if(!_[_0x2115('0x3e')](_0x40b279)&&typeof _0x40b279===_0x2115('0x91')&&!_['isEmpty'](_0x40b279)){return _0x40b279;}return _0x2115('0x93');}function loggerCatchQueueSummary(_0x57a0b3,_0x595eba){return function(_0xd0f561){freeVariablesPredictive(_0x595eba);emitVoiceQueueSummary(_0x595eba);emitCampaignSummary(_0x595eba);loggerSyncQueueSummary['error'](_0x57a0b3,util['inspect'](_0xd0f561,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x509478,_0x4f1ee3){return function(_0x145bf9){loggerPredictive['error'](_0x4f1ee3[_0x2115('0x3f')],_0x509478);loggerPredictive['error'](_0x145bf9[_0x2115('0x94')]);freeVariablesPredictive(_0x4f1ee3);};}function loggerCatch(_0x550344){return function(_0x151894){logger['error'](_0x550344,util['inspect'](_0x151894,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5b1ff6){return _0x5b1ff6&&!_[_0x2115('0x3e')](_0x5b1ff6)&&_0x5b1ff6[_0x2115('0x95')]>0x0;}function decremetOriginate(_0x573407){if(!_[_0x2115('0x3e')](_0x573407)&&_0x573407!==null){if(typeof _0x573407[_0x2115('0x6e')]!==_0x2115('0x96')){if(_0x573407[_0x2115('0x6e')]>0x0){_0x573407[_0x2115('0x6e')]-=0x1;}else{logger[_0x2115('0x97')](_0x2115('0x98'));}}}else{logger[_0x2115('0x97')](_0x2115('0x99'));}}function checkContactLowerLimitOriginate(_0x85ea33,_0x348a3f,_0x34cdc3){if(_0x348a3f>_0x34cdc3){for(var _0x2770fd=0x0;_0x2770fd<_0x348a3f-_0x34cdc3;_0x2770fd+=0x1){decremetOriginate(_0x85ea33);}}}function loggerGetContactDialer(_0x2fdeb8,_0x203e18,_0xdbab3f){return function(_0x4881c7){checkContactLowerLimitOriginate(_0x203e18,_0xdbab3f,0x0);logger[_0x2115('0x97')](_0x2fdeb8,util['inspect'](_0x4881c7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x47edc3){return function(_0x4d5934){if(isNotNull(_0x4d5934)&&isNotNull(_0x4d5934[0x0])){if(_0x4d5934[0x0][_0x2115('0x9a')]>0x0){_0x47edc3[_0x2115('0x47')]=_0x2115('0x9b');logger['info'](_0x2115('0x9c')+_0x47edc3[_0x2115('0x3f')],_0x4d5934[0x0]['contactsRescheduled'],_0x2115('0x9d'));}else{_0x47edc3[_0x2115('0x47')]=_0x2115('0x9e');logger[_0x2115('0x79')](_0x2115('0x9f')+_0x47edc3[_0x2115('0x3f')]);}}};}function notSendMessagesQueue(_0x359991){if(_0x359991[_0x2115('0xa0')]){freeVariablesPredictive(_0x359991);if(_0x359991[_0x2115('0x6e')]===0x0&&_0x359991[_0x2115('0x57')]===0x0&&_0x359991[_0x2115('0xa1')]===0x0&&(_0x359991[_0x2115('0x53')]||0x0)===0x0){_0x359991[_0x2115('0xa0')]=![];_0x359991['available']=0x0;_0x359991[_0x2115('0x47')]=_0x2115('0x41');loggerSyncQueueSummary[_0x2115('0x97')](_0x2115('0xa2'),_0x359991['name'],_0x2115('0xa3'));}else{_0x359991[_0x2115('0x47')]=_0x2115('0xa4');loggerSyncQueueSummary[_0x2115('0x97')](_0x2115('0xa2'),_0x359991[_0x2115('0x3f')],_0x2115('0xa5'));}emitVoiceQueueSummary(_0x359991);}}function notSendMessagesCampaign(_0x332177){if(_0x332177[_0x2115('0xa0')]){if(_0x332177[_0x2115('0x6e')]===0x0){_0x332177[_0x2115('0xa0')]=![];_0x332177[_0x2115('0x47')]=_0x2115('0x41');loggerSyncQueueSummary[_0x2115('0x97')](_0x2115('0xa6'),_0x332177[_0x2115('0x3f')],_0x2115('0xa3'));}else{_0x332177['message']=_0x2115('0xa4');loggerSyncQueueSummary[_0x2115('0x97')](_0x2115('0xa6'),_0x332177[_0x2115('0x3f')],_0x2115('0xa5'));}emitCampaignSummary(_0x332177);}}function createObjHistory(_0x35e7fb,_0x22c00d,_0x271fab,_0x1f6220,_0x471279){_0x35e7fb[_0x2115('0x47')]=_0x271fab;var _0xdfc5da=new Action(_0x35e7fb,_0x22c00d);var _0x322a4e=new History(_0xdfc5da);_0x322a4e[_0x2115('0xa7')]=_0x1f6220;_0x322a4e[_0x2115('0xa8')]=_0x471279;_0x322a4e[_0x2115('0xa9')]=_0xdfc5da[_0x2115('0xaa')];return _0x322a4e;}Dialer[_0x2115('0x18')]['loopClearZombieChannels']=function(){var _0x1f4e61=this;setInterval(function(){_0x1f4e61[_0x2115('0xab')](_0x1f4e61['uniqueId'],_0x2115('0xac'));_0x1f4e61[_0x2115('0xab')](_0x1f4e61[_0x2115('0x24')],_0x2115('0xad'));},0x32c8);};Dialer[_0x2115('0x18')][_0x2115('0xab')]=function(_0x4e380b,_0x893a7f){var _0x575736=this;for(var _0x21af92 in _0x4e380b){if(typeof _0x4e380b[_0x21af92]!==_0x2115('0x96')){this[_0x2115('0x1c')][_0x2115('0x19')](function(){if(!_['isNil'](_0x4e380b[_0x21af92])){return ami[_0x2115('0xae')]({'action':_0x2115('0xaf'),'channel':_0x4e380b[_0x21af92]['channel']})[_0x2115('0xb0')](function(_0x1a200b){if(_0x1a200b[_0x2115('0x47')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4e380b[_0x21af92]&&_0x4e380b[_0x21af92][_0x2115('0x4e')]!==_0x2115('0x90')){_0x575736[_0x2115('0xb1')](_0x575736[_0x2115('0x1e')][_0x4e380b[_0x21af92]['queue']]);logger['error'](_0x2115('0xb2'),_0x893a7f,_0x21af92,_0x4e380b[_0x21af92][_0x2115('0xb3')]);delete _0x4e380b[_0x21af92];}if(_0x4e380b[_0x21af92]&&_0x4e380b[_0x21af92][_0x2115('0x4e')]===_0x2115('0x90')){_0x575736['updateOriginated'](_0x575736[_0x2115('0x1f')][_0x4e380b[_0x21af92]['queue']]);logger[_0x2115('0x97')]('[Dialer][checkChannel][ivr]',_0x893a7f,_0x21af92,_0x4e380b[_0x21af92]['queue']);delete _0x4e380b[_0x21af92];}},0x2328);}});}});}}};Dialer['prototype'][_0x2115('0xb4')]=function(_0x55d7d9){return BPromise[_0x2115('0xb5')]()[_0x2115('0xb6')](cmHopper[_0x2115('0xb4')](_0x55d7d9))[_0x2115('0xb0')](loggerCatch(_0x2115('0xb7')));};Dialer['prototype'][_0x2115('0xb8')]=function(_0x2f74b5){return BPromise[_0x2115('0xb5')]()['then'](cmHopperBlack[_0x2115('0xb8')](_0x2f74b5))[_0x2115('0xb0')](loggerCatch(_0x2115('0xb9')));};Dialer[_0x2115('0x18')][_0x2115('0xba')]=function(_0x38cd11){return BPromise['resolve']()[_0x2115('0xb6')](cmHopperBlack['checkIsBlackListIvr'](_0x38cd11))[_0x2115('0xb0')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x2115('0x18')][_0x2115('0xbb')]=function(_0x4c74b4){return BPromise[_0x2115('0xb5')]()[_0x2115('0xb6')](cmHopperHistory['avgHandleTime'](_0x4c74b4))['catch'](loggerCatch(_0x2115('0xbc')));};Dialer[_0x2115('0x18')][_0x2115('0xbd')]=function(_0x496e88){return BPromise[_0x2115('0xb5')]()[_0x2115('0xb6')](cmHopper[_0x2115('0xbd')](_0x496e88))[_0x2115('0xb0')](loggerCatch(_0x2115('0xbe')));};Dialer[_0x2115('0x18')]['unlockContact']=function(_0x38fa2a,_0x57730e,_0x2bfbf2){return BPromise[_0x2115('0xb5')]()['then'](cmHopper[_0x2115('0xbf')](_0x38fa2a,_0x57730e,_0x2bfbf2))[_0x2115('0xb0')](loggerCatch(_0x2115('0xc0')));};Dialer[_0x2115('0x18')][_0x2115('0xc1')]=function(_0x445196,_0x49d0fe,_0x3f98b5,_0xf5d8af,_0x230205){return BPromise[_0x2115('0xb5')]()[_0x2115('0xb6')](cmHopper[_0x2115('0xc1')](_0x445196,_0x49d0fe,_0x3f98b5,_0xf5d8af))['catch'](function(_0xabeb6c){_0x230205[_0x2115('0xc2')]-=_0x3f98b5;_0x230205['temp']=_0x230205[_0x2115('0xc2')]>0x0?_0x230205[_0x2115('0xc2')]:0x0;loggerCatch(_0x2115('0xc3'))(_0xabeb6c);});};Dialer[_0x2115('0x18')][_0x2115('0xc4')]=function(_0x492d20,_0x1a3ddd,_0xa7216f,_0x57d735){return BPromise[_0x2115('0xb5')]()[_0x2115('0xb6')](cmHopper[_0x2115('0xc4')](_0x492d20,_0x1a3ddd,_0xa7216f))[_0x2115('0xb0')](function(_0x3c92a5){_0x57d735[_0x2115('0xc2')]-=_0x1a3ddd;_0x57d735[_0x2115('0xc2')]=_0x57d735[_0x2115('0xc2')]>0x0?_0x57d735[_0x2115('0xc2')]:0x0;loggerCatch(_0x2115('0xc5'))(_0x3c92a5);});};Dialer['prototype'][_0x2115('0xc6')]=function(_0x374159){return BPromise[_0x2115('0xb5')]()[_0x2115('0xb6')](voiceQueueRt[_0x2115('0xc6')](_0x374159))[_0x2115('0xb0')](loggerCatch(_0x2115('0xc7')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x4ebef1){return BPromise['resolve']()[_0x2115('0xb6')](cmHopper[_0x2115('0xc8')](_0x4ebef1))['catch'](loggerCatch(_0x2115('0xc9')));};Dialer[_0x2115('0x18')]['createHistory']=function(_0x56f2d5){return BPromise[_0x2115('0xb5')]()[_0x2115('0xb6')](cmHopperHistory[_0x2115('0xca')](_0x56f2d5))[_0x2115('0xb0')](loggerCatch('[createHistory]\x20'));};Dialer[_0x2115('0x18')][_0x2115('0xb1')]=function(_0xf3e93e){if(!_['isUndefined'](_0xf3e93e)&&_0xf3e93e!==null){if(typeof _0xf3e93e[_0x2115('0x6e')]!==_0x2115('0x96')){if(_0xf3e93e[_0x2115('0x6e')]>0x0){_0xf3e93e['originated']-=0x1;}else{logger[_0x2115('0x97')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x2115('0x97')](_0x2115('0xcb'));}};Dialer[_0x2115('0x18')][_0x2115('0xcc')]=function(_0x3552c6,_0x55beff){var _0x3631f5=this;return function(_0x3a08c6){_0x3631f5['updateOriginated'](_0x55beff);logger[_0x2115('0x97')](_0x3552c6,util[_0x2115('0xcd')](_0x3a08c6,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x2115('0xce')]=function(_0x24b873,_0x3696af,_0x3bd54a){var _0x5e713f={'state':0x19,'statedesc':_0x2115('0xcf')};this['updateOriginated'](_0x3696af);this[_0x2115('0xd0')](_[_0x2115('0x8b')](_0x5e713f,_['pick'](_0x3bd54a,[_0x2115('0xd1'),_0x2115('0xd2'),_0x2115('0xd3'),'VoiceQueueId','CampaignId'])),_0x2115('0xd4'),_0x2115('0xd5'));logger[_0x2115('0x97')](_0x24b873);};Dialer[_0x2115('0x18')]['isSuccess']=function(_0x24d47f){return _0x24d47f==='Success';};Dialer[_0x2115('0x18')][_0x2115('0xd6')]=function(_0x2c4005){return!_[_0x2115('0x3e')](_0x2c4005)&&_0x2c4005&&!_[_0x2115('0x3e')](_0x2c4005['name'])&&!_['isUndefined'](_0x2c4005['active'])&&_0x2c4005[_0x2115('0xd7')]&&(this['trunks'][util[_0x2115('0x74')](_0x2115('0xd8'),_0x2c4005[_0x2115('0x3f')])][_0x2115('0xaf')]===_0x2115('0xd9')||this[_0x2115('0x21')][util[_0x2115('0x74')](_0x2115('0xd8'),_0x2c4005['name'])][_0x2115('0xaf')]===_0x2115('0xda'));};Dialer[_0x2115('0x18')][_0x2115('0xd0')]=function(_0x5eccfe,_0x5c97bd,_0x4f91e4){this[_0x2115('0xca')](_0x5eccfe)[_0x2115('0xb0')](loggerCatch(_0x5c97bd));this['moveContactManagedDialer'](_0x5eccfe)['catch'](loggerCatch(_0x4f91e4));};Dialer[_0x2115('0x18')][_0x2115('0x38')]=function(_0xc95d37){var _0x41d732=this['uniqueId'][_0xc95d37[_0x2115('0xdb')]];var _0xdf128b;if(!_[_0x2115('0xdc')](_0xc95d37)&&!_[_0x2115('0xdc')](_0xc95d37[_0x2115('0xdd')])&&!_[_0x2115('0xdc')](_0xc95d37['variable'][_0x2115('0xde')])&&_0xc95d37[_0x2115('0xdf')]==='xcally-motion-dialer'&&_0x41d732){if(_0x41d732[_0x2115('0x4e')]!=='ivr'&&this[_0x2115('0x1e')][_0x41d732[_0x2115('0xb3')]][_0x2115('0xe0')]&&_0xc95d37[_0x2115('0xe1')]===_0x2115('0xe2')){delete this[_0x2115('0x26')][_0xc95d37[_0x2115('0xdb')]];this['updateOriginated'](this[_0x2115('0x1e')][_0x41d732[_0x2115('0xb3')]]);this['voiceQueues'][_0x41d732[_0x2115('0xb3')]][_0x2115('0x5e')]+=0x1;this[_0x2115('0x1e')][_0x41d732['queue']][_0x2115('0x5d')]+=0x1;_0xdf128b=new Hangup(_0x41d732,_0xc95d37);_0xdf128b[_0x2115('0xa7')]=0x12;_0xdf128b[_0x2115('0xa8')]=_0x2115('0xe3');_0xdf128b[_0x2115('0xe4')]='AMD';ami[_0x2115('0xe5')](_0x2115('0xe6'),ut[_0x2115('0xe7')](_0xdf128b,_0x2115('0xe8')));this[_0x2115('0xd0')](_0xdf128b,_0x2115('0xe9'),_0x2115('0xea'));}if(_0x41d732[_0x2115('0x4e')]!==_0x2115('0x90')&&this[_0x2115('0x1e')][_0x41d732[_0x2115('0xb3')]][_0x2115('0xe0')]&&_0xc95d37[_0x2115('0xe1')]===_0x2115('0xeb')){var _0x281bef=this;return new BPromise(function(_0x5b780f,_0x8f8bea){delete _0x281bef[_0x2115('0x26')][_0xc95d37['uniqueid']];_0x281bef['updateOriginated'](_0x281bef[_0x2115('0x1e')][_0x41d732[_0x2115('0xb3')]]);_0x281bef[_0x2115('0x1e')][_0x41d732[_0x2115('0xb3')]][_0x2115('0x5e')]+=0x1;_0x281bef[_0x2115('0x1e')][_0x41d732['queue']][_0x2115('0x5d')]+=0x1;var _0x355e02=_0x281bef[_0x2115('0x1e')][_0x41d732[_0x2115('0xb3')]];var _0x51f8f1=new Hangup(_0x41d732,_0xc95d37);_0x51f8f1[_0x2115('0xa7')]=0x13;_0x51f8f1[_0x2115('0xa8')]=_0x2115('0xec');_0x51f8f1[_0x2115('0xe4')]='AMD';_0x51f8f1[_0x2115('0xed')]+=0x1;_0x51f8f1[_0x2115('0xee')]+=0x1;_0x51f8f1[_0x2115('0xe8')]=!![];ami['emit'](_0x2115('0xe6'),ut[_0x2115('0xe7')](_0x51f8f1,_0x2115('0xe8')));_0x281bef[_0x2115('0xca')](_0x51f8f1)[_0x2115('0xb0')](loggerCatch(_0x2115('0xef')));if(_0x51f8f1[_0x2115('0xf0')]+_0x51f8f1['countcongestionretry']+_0x51f8f1['countnoanswerretry']+_0x51f8f1[_0x2115('0xf1')]+_0x51f8f1[_0x2115('0xf2')]+_0x51f8f1[_0x2115('0xf3')]+_0x51f8f1[_0x2115('0xed')]+_0x51f8f1[_0x2115('0xf4')]>=_0x355e02[_0x2115('0xf5')]){_0x281bef[_0x2115('0xf6')](_0x51f8f1,_0x5b780f,_0x8f8bea,_0x2115('0xf7'));}else{if(_0x51f8f1['countmachineretry']>=_0x355e02[_0x2115('0xf8')]){_0x281bef['createStateFinal'](_0x51f8f1,_0x5b780f,_0x8f8bea,_0x2115('0xf9'));}else{_0x281bef[_0x2115('0xbd')]({'active':![],'countmachineretry':_0x51f8f1['countmachineretry'],'scheduledat':moment()['add'](_0x355e02[_0x2115('0xfa')],_0x2115('0xfb'))[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x51f8f1[_0x2115('0xd1')],'ListId':_0x51f8f1[_0x2115('0xd2')],'VoiceQueueId':_0x51f8f1['VoiceQueueId']||undefined,'CampaignId':_0x51f8f1[_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch(_0x2115('0xfe')));_0x5b780f({'reschedule':0x1});}}});}if(_0x41d732[_0x2115('0x4e')]===_0x2115('0x90')&&this[_0x2115('0x1f')][_0x41d732[_0x2115('0xb3')]][_0x2115('0xe0')]&&_0xc95d37[_0x2115('0xe1')]===_0x2115('0xe2')){delete this[_0x2115('0x26')][_0xc95d37['uniqueid']];this['updateOriginated'](this[_0x2115('0x1f')][_0x41d732[_0x2115('0xb3')]]);_0xdf128b=new Hangup(_0x41d732,_0xc95d37);_0xdf128b[_0x2115('0xa7')]=0x12;_0xdf128b['statedesc']=_0x2115('0xe3');_0xdf128b['membername']=_0x2115('0xff');ami[_0x2115('0xe5')](_0x2115('0xe6'),ut[_0x2115('0xe7')](_0xdf128b,_0x2115('0xe8')));this['saveInDb'](_0xdf128b,'[syncHangupInAMDIvr][createHistory]',_0x2115('0x100'));}if(_0x41d732[_0x2115('0x4e')]===_0x2115('0x90')&&this['campaigns'][_0x41d732['queue']][_0x2115('0xe0')]&&_0xc95d37['value']==='MACHINE'){var _0x281bef=this;return new BPromise(function(_0x1f32dd,_0x45f19d){delete _0x281bef[_0x2115('0x26')][_0xc95d37['uniqueid']];_0x281bef[_0x2115('0xb1')](_0x281bef[_0x2115('0x1f')][_0x41d732['queue']]);_0x281bef[_0x2115('0x1f')][_0x41d732[_0x2115('0xb3')]]['outboundAnswerCallsDay']+=0x1;_0x281bef[_0x2115('0x1f')][_0x41d732[_0x2115('0xb3')]][_0x2115('0x5d')]+=0x1;var _0x5cd21e=_0x281bef[_0x2115('0x1f')][_0x41d732[_0x2115('0xb3')]];var _0x198738=new Hangup(_0x41d732,_0xc95d37);_0x198738[_0x2115('0xa7')]=0x13;_0x198738['statedesc']='Machine';_0x198738[_0x2115('0xe4')]=_0x2115('0xff');_0x198738[_0x2115('0xed')]+=0x1;_0x198738[_0x2115('0xee')]+=0x1;_0x198738[_0x2115('0xe8')]=!![];ami['emit'](_0x2115('0xe6'),ut[_0x2115('0xe7')](_0x198738,'amd'));_0x281bef[_0x2115('0xca')](_0x198738)[_0x2115('0xb0')](loggerCatch(_0x2115('0xef')));if(_0x198738[_0x2115('0xf0')]+_0x198738['countcongestionretry']+_0x198738[_0x2115('0x101')]+_0x198738[_0x2115('0xf1')]+_0x198738[_0x2115('0xf2')]+_0x198738[_0x2115('0xf3')]+_0x198738['countmachineretry']+_0x198738[_0x2115('0xf4')]>=_0x5cd21e[_0x2115('0xf5')]){_0x281bef[_0x2115('0xf6')](_0x198738,_0x1f32dd,_0x45f19d,_0x2115('0xf7'));}else{if(_0x198738[_0x2115('0xed')]>=_0x5cd21e[_0x2115('0xf8')]){_0x281bef['createStateFinal'](_0x198738,_0x1f32dd,_0x45f19d,_0x2115('0xf9'));}else{_0x281bef[_0x2115('0xbd')]({'active':![],'countmachineretry':_0x198738[_0x2115('0xed')],'scheduledat':moment()[_0x2115('0x102')](_0x5cd21e[_0x2115('0xfa')],'minutes')[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x198738[_0x2115('0xd1')],'ListId':_0x198738[_0x2115('0xd2')],'VoiceQueueId':_0x198738['VoiceQueueId']||undefined,'CampaignId':_0x198738['CampaignId']||undefined})[_0x2115('0xb0')](loggerCatch(_0x2115('0xfe')));_0x1f32dd({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x5bb4cd){var _0xda6e62=this[_0x2115('0x26')][_0x5bb4cd[_0x2115('0xdb')]];var _0x20e7f9=this;var _0x2304c4;if(_0xda6e62&&_0xda6e62['type']==='ivr'){delete this[_0x2115('0x26')][_0x5bb4cd[_0x2115('0xdb')]];this[_0x2115('0xb1')](this[_0x2115('0x1f')][_0xda6e62[_0x2115('0xb3')]]);this[_0x2115('0x1f')][_0xda6e62['queue']][_0x2115('0x103')]+=0x1;_0x2304c4=new Hangup(_0xda6e62,_0x5bb4cd);this['createHistory'](_0x2304c4)[_0x2115('0xb0')](loggerCatch(_0x2115('0x104')));this[_0x2115('0xc8')](_0x2304c4)[_0x2115('0xb0')](loggerCatch('[syncHangupIvr]'));}if(_0xda6e62&&_0xda6e62['type']!==_0x2115('0x90')&&isNotNull(this[_0x2115('0x1e')][_0xda6e62[_0x2115('0xb3')]]['dialQueueProject'])){delete this[_0x2115('0x26')][_0x5bb4cd[_0x2115('0xdb')]];this['updateOriginated'](this['voiceQueues'][_0xda6e62['queue']]);this[_0x2115('0x1e')][_0xda6e62[_0x2115('0xb3')]][_0x2115('0x5e')]+=0x1;this['voiceQueues'][_0xda6e62[_0x2115('0xb3')]][_0x2115('0x5d')]+=0x1;_0x2304c4=new Hangup(_0xda6e62,_0x5bb4cd);_0x2304c4[_0x2115('0xa7')]=0x10;_0x2304c4[_0x2115('0xa8')]=_0x2115('0x105');_0x2304c4[_0x2115('0xe4')]=_0x2115('0x106');this[_0x2115('0xca')](_0x2304c4)['catch'](loggerCatch(_0x2115('0x104')));this[_0x2115('0xc8')](_0x2304c4)[_0x2115('0xb0')](loggerCatch(_0x2115('0x107')));}if(_0xda6e62&&_0xda6e62[_0x2115('0x4e')]!=='ivr'&&!isNotNull(this[_0x2115('0x1e')][_0xda6e62[_0x2115('0xb3')]][_0x2115('0x108')])){delete this[_0x2115('0x26')][_0x5bb4cd[_0x2115('0xdb')]];this[_0x2115('0xb1')](this[_0x2115('0x1e')][_0xda6e62[_0x2115('0xb3')]]);this['voiceQueues'][_0xda6e62[_0x2115('0xb3')]][_0x2115('0x109')]+=0x1;_0x2304c4=new Hangup(_0xda6e62,_0x5bb4cd);_0x2304c4[_0x2115('0xa7')]=0xc;_0x2304c4[_0x2115('0xa8')]=_0x5bb4cd['cause-txt'];_0x2304c4['membername']=_0x2115('0x10a');this['createHistory'](_0x2304c4)[_0x2115('0xb0')](loggerCatch(_0x2115('0x104')));this[_0x2115('0xc8')](_0x2304c4)[_0x2115('0xb0')](loggerCatch(_0x2115('0x107')));}};Dialer[_0x2115('0x18')][_0x2115('0x10b')]=function(_0x5a2685){var _0x4beff1=this[_0x2115('0x26')][_0x5a2685[_0x2115('0xdb')]];var _0x2376d8=this;if(this[_0x2115('0x1e')][_0x5a2685[_0x2115('0xb3')]]){if(_0x4beff1&&_0x4beff1[_0x2115('0x4e')]!==_0x2115('0x90')){delete this[_0x2115('0x26')][_0x5a2685[_0x2115('0xdb')]];this[_0x2115('0x1e')][_0x5a2685[_0x2115('0xb3')]][_0x2115('0x5e')]+=0x1;var _0x3697aa=new AgentComplete(_0x4beff1,_0x5a2685);if(_0x5a2685[_0x2115('0x10c')]===_0x2115('0x10d')){_0x3697aa[_0x2115('0x10e')]=this[_0x2115('0x1e')][_0x5a2685[_0x2115('0xb3')]]['dialQueueProject2']&&this[_0x2115('0x1e')][_0x5a2685[_0x2115('0xb3')]][_0x2115('0x10f')]?moment()[_0x2115('0x74')](_0x2115('0xfc')):undefined;}this[_0x2115('0xca')](_0x3697aa)[_0x2115('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x2115('0xc8')](_0x3697aa)[_0x2115('0xb0')](loggerCatch(_0x2115('0x110')));}}};Dialer['prototype'][_0x2115('0x2e')]=function(_0x3d25e0){if(this['voiceQueues'][_0x3d25e0['queue']]){if(this[_0x2115('0x26')][_0x3d25e0[_0x2115('0xdb')]]&&this[_0x2115('0x26')][_0x3d25e0[_0x2115('0xdb')]][_0x2115('0x4e')]!==_0x2115('0x90')){this[_0x2115('0xb1')](this[_0x2115('0x1e')][_0x3d25e0[_0x2115('0xb3')]]);this[_0x2115('0x26')][_0x3d25e0['uniqueid']]['answertime']=moment()[_0x2115('0x74')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x2115('0x18')][_0x2115('0x111')]=function(_0x16ad13){this['createHistory'](_0x16ad13)[_0x2115('0xb0')](loggerCatch(_0x2115('0x112')));this[_0x2115('0xc8')](_0x16ad13)[_0x2115('0xb0')](loggerCatch(_0x2115('0x113')));};Dialer[_0x2115('0x18')]['syncQueueCallerAbandon']=function(_0x4c11bf){var _0x3897f0=this['uniqueId'][_0x4c11bf['uniqueid']];var _0x10a07d=this;if(this[_0x2115('0x1e')][_0x4c11bf[_0x2115('0xb3')]]){if(_0x3897f0&&_0x3897f0[_0x2115('0x4e')]!=='ivr'){delete this[_0x2115('0x26')][_0x4c11bf[_0x2115('0xdb')]];this[_0x2115('0xb1')](this[_0x2115('0x1e')][_0x4c11bf[_0x2115('0xb3')]]);_0x3897f0[_0x2115('0x114')]=moment()[_0x2115('0x74')](_0x2115('0xfc'));var _0x25fd3a=new QueueCallerAbandon(_0x3897f0,_0x4c11bf);if(getSeconds(_0x3897f0['droptime'],_0x3897f0[_0x2115('0x115')])>=_0x3897f0[_0x2115('0x116')]){this[_0x2115('0x1e')][_0x4c11bf['queue']][_0x2115('0x7d')]+=0x1;this['voiceQueues'][_0x4c11bf[_0x2115('0xb3')]][_0x2115('0x117')]+=0x1;this[_0x2115('0x1e')][_0x4c11bf['queue']][_0x2115('0x6a')]+=0x1;_0x25fd3a['state']=0xa;_0x25fd3a[_0x2115('0xa8')]='Drop';_0x25fd3a[_0x2115('0x118')]=_0x2115('0x119');_0x25fd3a['agiafterat']=this[_0x2115('0x1e')][_0x4c11bf[_0x2115('0xb3')]]['dialQueueProject2']?moment()[_0x2115('0x74')](_0x2115('0xfc')):undefined;_0x25fd3a[_0x2115('0xf2')]+=0x1;_0x25fd3a[_0x2115('0xee')]+=0x1;if(_0x25fd3a[_0x2115('0xf2')]>=this[_0x2115('0x1e')][_0x4c11bf[_0x2115('0xb3')]][_0x2115('0x11a')]){this['queueCallerAbandonCreateState'](_0x25fd3a);}else{this[_0x2115('0xbd')]({'active':![],'countdropretry':_0x25fd3a[_0x2115('0xf2')],'scheduledat':moment()[_0x2115('0x102')](this[_0x2115('0x1e')][_0x4c11bf[_0x2115('0xb3')]][_0x2115('0x11b')],'minutes')[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x3897f0[_0x2115('0xd1')],'ListId':_0x3897f0[_0x2115('0xd2')],'VoiceQueueId':_0x3897f0[_0x2115('0x11c')]||undefined,'CampaignId':_0x3897f0['CampaignId']||undefined})['catch'](loggerCatch(_0x2115('0x11d')));var _0x11708c=new History(_0x25fd3a);_0x11708c[_0x2115('0xa7')]=0xa;_0x11708c[_0x2115('0xa8')]='Drop';_0x11708c[_0x2115('0xaa')]=moment()[_0x2115('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x11708c[_0x2115('0xa9')]=_0x11708c[_0x2115('0xaa')];_0x11708c[_0x2115('0x11e')]=_0x25fd3a['calleridname'];_0x11708c[_0x2115('0x11f')]=_0x25fd3a[_0x2115('0x11f')];this[_0x2115('0xca')](_0x11708c)[_0x2115('0xb0')](loggerCatch(_0x2115('0x120')));}}else{this[_0x2115('0x1e')][_0x4c11bf[_0x2115('0xb3')]][_0x2115('0x7f')]+=0x1;this['voiceQueues'][_0x4c11bf[_0x2115('0xb3')]][_0x2115('0x62')]+=0x1;_0x25fd3a[_0x2115('0xa7')]=0xb;_0x25fd3a[_0x2115('0xa8')]='Abandoned';_0x25fd3a[_0x2115('0x118')]=_0x2115('0x121');_0x25fd3a[_0x2115('0xf3')]+=0x1;_0x25fd3a[_0x2115('0xee')]+=0x1;if(_0x25fd3a[_0x2115('0xf3')]>=this['voiceQueues'][_0x4c11bf[_0x2115('0xb3')]][_0x2115('0x122')]){this[_0x2115('0x111')](_0x25fd3a);}else{this[_0x2115('0xbd')]({'active':![],'countabandonedretry':_0x25fd3a[_0x2115('0xf3')],'scheduledat':moment()[_0x2115('0x102')](this[_0x2115('0x1e')][_0x4c11bf['queue']][_0x2115('0x123')],'minutes')[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x3897f0['ContactId'],'ListId':_0x3897f0[_0x2115('0xd2')],'VoiceQueueId':_0x3897f0[_0x2115('0x11c')]||undefined,'CampaignId':_0x3897f0[_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x11708c=new History(_0x25fd3a);_0x11708c[_0x2115('0xa7')]=0xb;_0x11708c[_0x2115('0xa8')]=_0x2115('0x124');_0x11708c['starttime']=moment()[_0x2115('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x11708c[_0x2115('0xa9')]=_0x11708c[_0x2115('0xaa')];_0x11708c['calleridname']=_0x25fd3a['calleridname'];_0x11708c[_0x2115('0x11f')]=_0x25fd3a[_0x2115('0x11f')];this['createHistory'](_0x11708c)[_0x2115('0xb0')](loggerCatch(_0x2115('0x125')));}}}}};Dialer[_0x2115('0x18')][_0x2115('0x37')]=function(_0x511a84){if(this['actions'][_0x511a84[_0x2115('0xdb')]]){this[_0x2115('0x24')][_0x511a84[_0x2115('0xdb')]][_0x2115('0x126')]=_0x511a84[_0x2115('0x126')];}if(this['uniqueId'][_0x511a84[_0x2115('0xdb')]]){this[_0x2115('0x26')][_0x511a84[_0x2115('0xdb')]][_0x2115('0x126')]=_0x511a84[_0x2115('0x126')];}};Dialer[_0x2115('0x18')][_0x2115('0x39')]=function(_0x1434fb){if(strategy[this[_0x2115('0x1e')][this[_0x2115('0x24')][_0x1434fb[_0x2115('0x127')]]['queue']][_0x2115('0x50')]]===_0x2115('0x17')){if(this[_0x2115('0x24')][_0x1434fb[_0x2115('0x127')]]&&_[_0x2115('0xdc')](this[_0x2115('0x24')][_0x1434fb[_0x2115('0x127')]][_0x2115('0x128')])&&_0x1434fb[_0x2115('0xaf')]==='1'&&_0x1434fb['paused']==='0'){if(this[_0x2115('0x20')][_0x1434fb['stateinterface']]){if(!this['agents'][_0x1434fb[_0x2115('0x129')]]['locked']){this['agents'][_0x1434fb[_0x2115('0x129')]]['locked']=!![];this['actions'][_0x1434fb[_0x2115('0x127')]]['locked']=!![];this['actions'][_0x1434fb[_0x2115('0x127')]][_0x2115('0x129')]=_0x1434fb[_0x2115('0x129')];}}}}else if((strategy[this['voiceQueues'][this[_0x2115('0x24')][_0x1434fb['actionid']][_0x2115('0xb3')]]['strategy']]||_0x2115('0x16'))==='rrmemory'){if(this[_0x2115('0x24')][_0x1434fb['actionid']]){if(this[_0x2115('0x20')][_0x1434fb['stateinterface']]){this[_0x2115('0x24')][_0x1434fb[_0x2115('0x127')]][_0x2115('0x129')]=_0x1434fb[_0x2115('0x129')];if(_[_0x2115('0xdc')](this[_0x2115('0x2b')][this[_0x2115('0x24')][_0x1434fb['actionid']][_0x2115('0xb3')]])){this[_0x2115('0x2b')][this[_0x2115('0x24')][_0x1434fb[_0x2115('0x127')]]['queue']]=[];}this[_0x2115('0x2b')][this[_0x2115('0x24')][_0x1434fb[_0x2115('0x127')]]['queue']][_0x2115('0x12a')](_['merge'](_[_0x2115('0x12b')](this[_0x2115('0x24')][_0x1434fb[_0x2115('0x127')]],[_0x2115('0x12c'),_0x2115('0x129')]),{'status':_0x1434fb['status'],'paused':_0x1434fb[_0x2115('0x12d')]}));}}}};function unlockQueueStatus(_0x6ffede,_0x550cad){setTimeout(function(){if(_[_0x2115('0x3e')](_0x6ffede[_0x2115('0x12e')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x550cad);}_0x6ffede[_0x2115('0x12e')]=!![];loggerBooked['info'](_0x2115('0x12f'),_0x550cad,JSON[_0x2115('0x4a')](_[_0x2115('0x12b')](_0x6ffede,[_0x2115('0x3f'),_0x2115('0x12e')])));},0x1f3);}Dialer['prototype'][_0x2115('0x3b')]=function(_0x4ad22c){var _0x84eede=this;var _0x5ca92=_0x84eede[_0x2115('0x1e')][_0x84eede['actions'][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xb3')]];if(strategy[this[_0x2115('0x1e')][this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xb3')]][_0x2115('0x50')]]===_0x2115('0x17')){if(this['actions'][_0x4ad22c[_0x2115('0x127')]]&&this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]][_0x2115('0x129')]){this[_0x2115('0x1d')][_0x2115('0x130')](this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]]['idHopper'],this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]]['stateinterface'])['catch'](function(_0x330d6d){logger['error'](_0x2115('0x131'),util[_0x2115('0xcd')](_0x330d6d,{'showHidden':![],'depth':null}));})[_0x2115('0x1b')](function(){_0x84eede[_0x2115('0xb1')](_0x84eede['voiceQueues'][_0x84eede['actions'][_0x4ad22c[_0x2115('0x127')]]['queue']]);_0x84eede[_0x2115('0x20')][_0x84eede['actions'][_0x4ad22c['actionid']][_0x2115('0x129')]][_0x2115('0x128')]=![];delete _0x84eede[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]];unlockQueueStatus(_0x5ca92);});}else{this['updateOriginated'](this[_0x2115('0x1e')][this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xb3')]]);this[_0x2115('0xbd')]({'active':![],'ContactId':this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xd1')],'ListId':this['actions'][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xd2')],'VoiceQueueId':this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]]['CampaignId']||undefined})[_0x2115('0xb0')](loggerCatch(_0x2115('0x132')));delete this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]];unlockQueueStatus(_0x5ca92);}}else if((strategy[this['voiceQueues'][this[_0x2115('0x24')][_0x4ad22c['actionid']][_0x2115('0xb3')]][_0x2115('0x50')]]||_0x2115('0x16'))===_0x2115('0x16')){var _0x289260;if(this['actions'][_0x4ad22c[_0x2115('0x127')]]&&!_[_0x2115('0x78')](this[_0x2115('0x2b')][this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]]['queue']])){if(this[_0x2115('0x2c')][_0x84eede['actions'][_0x4ad22c[_0x2115('0x127')]]['queue']]){this[_0x2115('0x2c')][_0x84eede['actions'][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xb3')]]=this[_0x2115('0x2c')][this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xb3')]]?this[_0x2115('0x2c')][this['actions'][_0x4ad22c[_0x2115('0x127')]]['queue']]:this[_0x2115('0x2b')][this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xb3')]]?this[_0x2115('0x2b')][this[_0x2115('0x24')][_0x4ad22c[_0x2115('0x127')]][_0x2115('0xb3')]][_0x2115('0x133')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x4ad22c[_0x2115('0x127')]]['queue']][_0x2115('0x133')]=this[_0x2115('0x2c')][this[_0x2115('0x24')][_0x4ad22c['actionid']][_0x2115('0xb3')]];for(var _0xb5dc54=0x0;_0xb5dc54=0x0;})['catch'](myreject(_0x33efd6)));}}else{_0x2a7702[_0x2115('0x12a')](ami[_0x2115('0xae')]({'action':_0x2115('0x148'),'command':util[_0x2115('0x74')](_0x2115('0x149'),_0x386fcb,!_[_0x2115('0x3e')](config['timezones'][_0x39b08a])?_0x39b08a:'')})[_0x2115('0xb6')](function(_0x5af062){return _0x5af062['content'][_0x2115('0x14c')](_0x2115('0x14d'))>=0x0;})['catch'](myreject(_0x33efd6)));}BPromise[_0x2115('0x14e')](_0x2a7702)[_0x2115('0xb6')](function(_0x529b30){var _0x237b7f=_[_0x2115('0x14f')](_0x529b30);if(_0x237b7f){return _0x5c38a2(_0x237b7f);}else{_0x365bf0[_0x2115('0x47')]=_0x48e300?_0x2115('0x150'):_0x2115('0x151');return _0x33efd6(msgResponse('[ifTime][promiseAll]',_0x2115('0x144'),_0x2115('0x152')+_0x48e300+'\x20'+_0x10e883+_0x2115('0x153')+util[_0x2115('0xcd')](_0x386fcb,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x39b08a));}})[_0x2115('0xb0')](function(_0x2e804f){return _0x33efd6(msgResponse('ifTime',_0x2115('0x144'),JSON[_0x2115('0x4a')](_0x2e804f)));});});};Dialer['prototype'][_0x2115('0x154')]=function(_0x37a622){var _0x2a8479=this;return function(){switch(_0x37a622['dialMethod']){case _0x2115('0x155'):freeVariablesPredictive(_0x37a622);_0x2a8479['handlePower'](_0x37a622,0x1);break;case'power':freeVariablesPredictive(_0x37a622);_0x2a8479[_0x2115('0x156')](_0x37a622,_0x37a622['dialPowerLevel']);break;case _0x2115('0x157'):_0x2a8479['predictive'](_0x37a622);break;case'booked':freeVariablesPredictive(_0x37a622);_0x2a8479['handlePower'](_0x37a622,0x1);break;default:freeVariablesPredictive(_0x37a622);logger[_0x2115('0x97')](_0x2115('0x158'),_0x37a622[_0x2115('0x3f')],_0x2115('0x159'));}};};Dialer['prototype'][_0x2115('0x15a')]=function(_0x43917f){var _0x5185c2=this;return function(){_0x5185c2[_0x2115('0x15b')](_0x43917f);};};Dialer[_0x2115('0x18')][_0x2115('0xa')]=function(_0x314552){var _0x2cf0f4=this;if(isNotPreview(_0x314552[_0x2115('0x15c')])){if(isVoiceQueueOutbound(_0x314552[_0x2115('0x4e')])&&isActive(_0x314552[_0x2115('0x5b')])){_0x314552['sendMessageOneNotActive']=!![];BPromise[_0x2115('0xb5')]()[_0x2115('0xb6')](checkIsLoggedIn(_0x314552,_0x314552[_0x2115('0x52')]))[_0x2115('0xb6')](checkIsActive(_0x314552,_0x314552[_0x2115('0x5b')]))[_0x2115('0xb6')](checkInterval(_0x314552))[_0x2115('0xb6')](_0x2cf0f4[_0x2115('0x13e')](_0x314552))['then'](_0x2cf0f4[_0x2115('0x141')](_0x314552[_0x2115('0x15d')],_0x314552[_0x2115('0x15e')],_0x314552[_0x2115('0x3f')],_0x314552))[_0x2115('0xb6')](_0x2cf0f4['checkIfTimeIntervals'](_0x314552[_0x2115('0x43')],_0x314552[_0x2115('0x15e')],_0x314552[_0x2115('0x3f')],_0x314552))[_0x2115('0xb6')](_0x2cf0f4['checkDialMethod'](_0x314552))[_0x2115('0xb0')](loggerCatchQueueSummary(_0x2115('0x15f'),_0x314552));}else{notSendMessagesQueue(_0x314552);}}else{freeVariablesPredictive(_0x314552);}};Dialer[_0x2115('0x18')][_0x2115('0x160')]=function(){var _0x2bfb0a=this;var _0x416d01;for(var _0x1858e2 in this[_0x2115('0x1f')]){if(typeof this[_0x2115('0x1f')][_0x1858e2]!==_0x2115('0x96')){_0x416d01=this[_0x2115('0x1f')][_0x1858e2];if(isCampaignIvr(_0x416d01[_0x2115('0x4e')])&&isActive(_0x416d01[_0x2115('0xd7')])){_0x416d01[_0x2115('0xa0')]=!![];BPromise['resolve']()[_0x2115('0xb6')](checkIsActive(_0x416d01,_0x416d01['active']))[_0x2115('0xb6')](checkInterval(_0x416d01))[_0x2115('0xb6')](_0x2bfb0a[_0x2115('0x13e')](_0x416d01))[_0x2115('0xb6')](_0x2bfb0a[_0x2115('0x141')](_0x416d01[_0x2115('0x15d')],_0x416d01[_0x2115('0x15e')],_0x416d01[_0x2115('0x3f')],_0x416d01))['then'](_0x2bfb0a[_0x2115('0x143')](_0x416d01[_0x2115('0x43')],_0x416d01['dialTimezone'],_0x416d01[_0x2115('0x3f')],_0x416d01))[_0x2115('0xb6')](_0x2bfb0a[_0x2115('0x15a')](_0x416d01))[_0x2115('0xb0')](loggerCatchQueueSummary(_0x2115('0x161'),_0x416d01));}else{notSendMessagesCampaign(_0x416d01);}}}};function getCallerIdRandom(_0x5d828e,_0x543f9f){var _0x1a2b06;var _0x1bf879;var _0x117484;if(_0x543f9f<=0x0){_0x543f9f=0x1;}_0x1a2b06=new RegExp('\x5cw{0,'+_0x543f9f+'}$');_0x1bf879=Math['pow'](0xa,_0x543f9f-0x1);_0x117484=Math[_0x2115('0x162')](0xa,_0x543f9f)-0x1;return util[_0x2115('0x74')]('%s',_[_0x2115('0x163')](_0x5d828e,_0x1a2b06,_[_0x2115('0x164')](_0x1bf879,_0x117484)));}function extractCalleridName(_0x31ff2f){var _0x13bab4=_0x31ff2f['match'](/"(.*?)"/);return _0x13bab4?_0x13bab4[0x1]:_0x31ff2f;}function extractCalleridNumber(_0x1d3a92){var _0x5c4d96=_0x1d3a92[_0x2115('0x165')](/<(.*?)>/);return _0x5c4d96?_0x5c4d96[0x1]:_0x1d3a92;}Dialer['prototype'][_0x2115('0x166')]=function(_0x7f0b9e,_0x39cac9){var _0x36a354=this;var _0x33eb17=uuid['v4']();this['actions'][_0x33eb17]=new Action(_0x7f0b9e,_0x39cac9,_0x33eb17);return new BPromise(function(_0x4bfe1c,_0x2c93f5){if(_[_0x2115('0x3e')](_0x7f0b9e)&&typeof _0x7f0b9e!==_0x2115('0x167')){return _0x2c93f5(msgResponse(_0x2115('0x168'),_0x2115('0x144'),'voiceQueue\x20is\x20undefine'));}if(_[_0x2115('0x3e')](_0x39cac9[_0x2115('0x169')]['phone'])||_0x39cac9[_0x2115('0x169')][_0x2115('0x16a')]===null){return _0x2c93f5(msgResponse(_0x2115('0x168'),'Failure',_0x2115('0x16b')));}var _0x4a9326={'XMD-CALLERID':_0x36a354[_0x2115('0x24')][_0x33eb17][_0x2115('0x16c')](),'XMD-AGI':_0x7f0b9e[_0x2115('0x108')]?util[_0x2115('0x74')](_0x2115('0x16d'),ipAgi,_0x7f0b9e['dialQueueProject']):_0x2115('0x16e'),'XMD-AGIAFTER':_0x7f0b9e[_0x2115('0x16f')]?util[_0x2115('0x74')](_0x2115('0x16d'),ipAgi,_0x7f0b9e['dialQueueProject2']):_0x2115('0x16e'),'XMD-QUEUE':_0x7f0b9e[_0x2115('0x4e')]===_0x2115('0x4f')?util[_0x2115('0x74')](_0x2115('0x170'),_0x7f0b9e[_0x2115('0x3f')],_0x7f0b9e[_0x2115('0x171')]||'',_0x7f0b9e[_0x2115('0x10f')]?'c':'',_0x7f0b9e[_0x2115('0x116')]||0x3):'NONE','XMD-CONTACTID':_0x39cac9[_0x2115('0xd1')],'XMD-CDRTYPE':_0x2115('0x172'),'CALLERID(all)':_0x36a354[_0x2115('0x24')][_0x33eb17][_0x2115('0x16c')](),'XMD-AMD':_0x7f0b9e[_0x2115('0xe0')]?_0x2115('0x173'):_0x2115('0x16e'),'XMD-DESTINATION':_0x2115('0x174')};if(_0x7f0b9e[_0x2115('0xe0')]){_0x4a9326[_0x2115('0x175')]=_0x7f0b9e[_0x2115('0x176')]||0x9c4;_0x4a9326[_0x2115('0x177')]=_0x7f0b9e[_0x2115('0x178')]||0x5dc;_0x4a9326[_0x2115('0x179')]=_0x7f0b9e[_0x2115('0x17a')]||0x320;_0x4a9326['XMD-AMDTOTALANALYSISTIME']=_0x7f0b9e[_0x2115('0x17b')]||0x1388;_0x4a9326['XMD-AMDMINWORDLENGTH']=_0x7f0b9e[_0x2115('0x17c')]||0x64;_0x4a9326['XMD-AMDBETWEENWORDSSILENCE']=_0x7f0b9e[_0x2115('0x17d')]||0x32;_0x4a9326[_0x2115('0x17e')]=_0x7f0b9e[_0x2115('0x17f')]||0x3;_0x4a9326[_0x2115('0x180')]=_0x7f0b9e[_0x2115('0x181')]||0x100;_0x4a9326[_0x2115('0x182')]=_0x7f0b9e[_0x2115('0x183')]||0x1388;}if(_0x7f0b9e[_0x2115('0x4e')]===_0x2115('0x4f')){_0x4a9326['XMD-VOICEQUEUEID']=_0x39cac9[_0x2115('0x11c')];}else{_0x4a9326[_0x2115('0x184')]=_0x39cac9['CampaignId'];}for(var _0x1a4f05 in _0x39cac9['Contact']){if(typeof _0x39cac9[_0x2115('0x169')][_0x1a4f05]!==_0x2115('0x96')){if(isNotNull(_0x39cac9['Contact'][_0x1a4f05])&&_0x1a4f05!=='id'&&_0x1a4f05!=='tags'&&_0x1a4f05!=='createdAt'&&_0x1a4f05!==_0x2115('0x185')){_0x4a9326[util[_0x2115('0x74')](_0x2115('0x186'),_0x2115('0x187'),_['toUpper'](_0x1a4f05))]=_0x39cac9['Contact'][_0x1a4f05];}}}var _0x2ad7f6=_0x36a354[_0x2115('0xd6')](_0x7f0b9e[_0x2115('0x72')])?getCallerId(_0x7f0b9e['Trunk'][_0x2115('0x73')],_0x7f0b9e[_0x2115('0x5c')],_0x7f0b9e[_0x2115('0x188')]>0x0?getCallerIdRandom(_0x7f0b9e[_0x2115('0x189')],_0x7f0b9e[_0x2115('0x188')]):_0x7f0b9e['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x7f0b9e[_0x2115('0x13f')])?_0x7f0b9e[_0x2115('0x72')][_0x2115('0x73')]:_0x7f0b9e[_0x2115('0x13f')]['callerid'],_0x7f0b9e['dialOriginateCallerIdName'],_0x7f0b9e[_0x2115('0x188')]>0x0?getCallerIdRandom(_0x7f0b9e[_0x2115('0x189')],_0x7f0b9e[_0x2115('0x188')]):_0x7f0b9e[_0x2115('0x189')]);if(_0x2ad7f6){_0x4a9326[_0x2115('0x18a')]=_0x36a354['actions'][_0x33eb17]['originatecalleridname']=extractCalleridName(_0x2ad7f6);_0x4a9326['XMD-ORIGINATECALLERIDNUM']=_0x36a354['actions'][_0x33eb17][_0x2115('0x18b')]=extractCalleridNumber(_0x2ad7f6);}return ami[_0x2115('0xae')]({'actionid':_0x33eb17,'action':_0x2115('0x168'),'channel':_0x36a354[_0x2115('0xd6')](_0x7f0b9e[_0x2115('0x72')])?util['format'](_0x2115('0x18c'),_0x7f0b9e['Trunk'][_0x2115('0x3f')],isNotNull(_0x7f0b9e[_0x2115('0x18d')])?_0x7f0b9e[_0x2115('0x18d')]['trim']()||'':'',_0x7f0b9e[_0x2115('0x18e')]>0x0?_0x39cac9[_0x2115('0x169')][_0x2115('0x16a')][_0x2115('0x18f')](_0x7f0b9e[_0x2115('0x18e')]):_0x39cac9[_0x2115('0x169')]['phone']):util[_0x2115('0x74')](_0x2115('0x18c'),_[_0x2115('0xdc')](_0x7f0b9e['TrunkBackup'])?_0x7f0b9e[_0x2115('0x72')]['name']:_0x7f0b9e['TrunkBackup'][_0x2115('0x3f')],isNotNull(_0x7f0b9e[_0x2115('0x18d')])?_0x7f0b9e[_0x2115('0x18d')][_0x2115('0x190')]()||'':'',_0x7f0b9e[_0x2115('0x18e')]>0x0?_0x39cac9['Contact']['phone']['substring'](_0x7f0b9e['dialCutDigit']):_0x39cac9[_0x2115('0x169')][_0x2115('0x16a')]),'callerid':_0x2ad7f6,'Exten':'xcally-motion-dialer','Context':_0x2115('0x191'),'Priority':'1','variable':_0x4a9326,'timeout':(_0x7f0b9e['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x33eb17})[_0x2115('0xb6')](function(_0x52c349){return _0x4bfe1c(_0x52c349);})[_0x2115('0xb0')](function(_0x18482b){_0x7f0b9e[_0x2115('0x192')]+=0x1;var _0x411b14=new History(_0x36a354['actions'][_0x33eb17]);logger[_0x2115('0x97')](util[_0x2115('0x74')](_0x2115('0x193'),JSON['stringify'](_0x18482b)));_0x411b14[_0x2115('0xa7')]=0xe;_0x411b14[_0x2115('0xa8')]=_0x2115('0x194');_0x411b14[_0x2115('0xaa')]=moment()[_0x2115('0x74')](_0x2115('0xfc'));_0x411b14[_0x2115('0xa9')]=_0x411b14['starttime'];_0x36a354[_0x2115('0xca')](_0x411b14)['catch'](loggerCatch('[originate][error]'));_0x36a354[_0x2115('0xc8')](_0x411b14)[_0x2115('0xb0')](loggerCatch(_0x2115('0x195')))[_0x2115('0x1b')](function(){delete _0x36a354[_0x2115('0x24')][_0x33eb17];return _0x2c93f5(msgResponse(_0x2115('0x168'),'Error',_0x2115('0x196')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x461feb){var _0x18f4bc=this[_0x2115('0x24')][_0x461feb['actionid']];if(_0x18f4bc){delete this['actions'][_0x461feb[_0x2115('0x127')]];_0x18f4bc[_0x2115('0x115')]=moment()['format'](_0x2115('0xfc'));var _0x81a761=_0x18f4bc[_0x2115('0x4e')]===_0x2115('0x90')?this[_0x2115('0x1f')][_0x18f4bc['queue']]:this[_0x2115('0x1e')][_0x18f4bc[_0x2115('0x197')]()];if(!this[_0x2115('0x198')](_0x461feb['response'])){this['updateOriginated'](_0x81a761);return this['callProgressDetecting'](_0x18f4bc,_0x81a761,_0x461feb)[_0x2115('0xb0')](loggerCatch(_0x2115('0x199')));}this['uniqueId'][_0x461feb[_0x2115('0xdb')]]=_0x18f4bc;}};Dialer[_0x2115('0x18')][_0x2115('0x19a')]=function(_0x1b6a6e,_0x45378d,_0x1a929b){var _0x1c2582=new History(_0x45378d);if(_0x1c2582[_0x2115('0xf0')]+_0x1c2582[_0x2115('0x19b')]+_0x1c2582[_0x2115('0x101')]+_0x1c2582[_0x2115('0xf1')]+_0x1c2582[_0x2115('0xf2')]+_0x1c2582['countabandonedretry']+_0x1c2582[_0x2115('0xed')]+_0x1c2582[_0x2115('0xf4')]>=_0x1a929b[_0x2115('0xf5')]-0x1){return!![];}switch(_0x1b6a6e){case 0x3:if(_0x1c2582[_0x2115('0x101')]>=_0x1a929b[_0x2115('0x19c')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x1c2582[_0x2115('0x101')]+=0x1,'scheduledat':moment()[_0x2115('0x102')](_0x1a929b[_0x2115('0x19d')],_0x2115('0xfb'))[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x1c2582[_0x2115('0xd1')],'ListId':_0x1c2582[_0x2115('0xd2')],'VoiceQueueId':_0x1c2582['VoiceQueueId']||undefined,'CampaignId':_0x1c2582[_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch(_0x2115('0x19e')));break;case 0x5:if(_0x1c2582['countbusyretry']>=_0x1a929b[_0x2115('0x19f')]-0x1){return!![];}this[_0x2115('0xbd')]({'active':![],'countbusyretry':_0x1c2582[_0x2115('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x1a929b[_0x2115('0x1a0')],_0x2115('0xfb'))[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x1c2582[_0x2115('0xd1')],'ListId':_0x1c2582[_0x2115('0xd2')],'VoiceQueueId':_0x1c2582[_0x2115('0x11c')]||undefined,'CampaignId':_0x1c2582[_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1c2582[_0x2115('0x19b')]>=_0x1a929b[_0x2115('0x1a1')]-0x1){return!![];}this[_0x2115('0xbd')]({'active':![],'countcongestionretry':_0x1c2582['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x1a929b[_0x2115('0x1a2')],'minutes')['format'](_0x2115('0xfc')),'ContactId':_0x1c2582[_0x2115('0xd1')],'ListId':_0x1c2582[_0x2115('0xd2')],'VoiceQueueId':_0x1c2582['VoiceQueueId']||undefined,'CampaignId':_0x1c2582[_0x2115('0xfd')]||undefined})['catch'](loggerCatch(_0x2115('0x1a3')));break;case 0x0:if(_0x1c2582['countnosuchnumberretry']>=_0x1a929b[_0x2115('0x1a4')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1c2582[_0x2115('0xf1')]+=0x1,'scheduledat':moment()[_0x2115('0x102')](_0x1a929b[_0x2115('0x1a5')],'minutes')[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x1c2582['ContactId'],'ListId':_0x1c2582[_0x2115('0xd2')],'VoiceQueueId':_0x1c2582[_0x2115('0x11c')]||undefined,'CampaignId':_0x1c2582[_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch(_0x2115('0x1a6')));}break;case 0xa:if(_0x1c2582[_0x2115('0xf2')]>=_0x1a929b[_0x2115('0x11a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x1c2582[_0x2115('0xf2')]+=0x1,'scheduledat':moment()[_0x2115('0x102')](_0x1a929b[_0x2115('0x11b')],_0x2115('0xfb'))[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x1c2582[_0x2115('0xd1')],'ListId':_0x1c2582[_0x2115('0xd2')],'VoiceQueueId':_0x1c2582[_0x2115('0x11c')]||undefined,'CampaignId':_0x1c2582[_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x1c2582[_0x2115('0xf3')]>=_0x1a929b[_0x2115('0x122')]-0x1){return!![];}this[_0x2115('0xbd')]({'active':![],'countabandonedretry':_0x1c2582[_0x2115('0xf3')]+=0x1,'scheduledat':moment()[_0x2115('0x102')](_0x1a929b[_0x2115('0x123')],_0x2115('0xfb'))[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x1c2582[_0x2115('0xd1')],'ListId':_0x1c2582['ListId'],'VoiceQueueId':_0x1c2582[_0x2115('0x11c')]||undefined,'CampaignId':_0x1c2582['CampaignId']||undefined})['catch'](loggerCatch(_0x2115('0x1a7')));break;case 0x13:if(_0x1c2582[_0x2115('0xed')]>=_0x1a929b[_0x2115('0xf8')]-0x1){return!![];}this[_0x2115('0xbd')]({'active':![],'countmachineretry':_0x1c2582['countmachineretry']+=0x1,'scheduledat':moment()[_0x2115('0x102')](_0x1a929b['dialMachineRetryFrequency'],_0x2115('0xfb'))[_0x2115('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1c2582[_0x2115('0xd1')],'ListId':_0x1c2582[_0x2115('0xd2')],'VoiceQueueId':_0x1c2582[_0x2115('0x11c')]||undefined,'CampaignId':_0x1c2582[_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch(_0x2115('0xfe')));break;case 0x14:if(_0x1c2582[_0x2115('0xf4')]>=_0x1a929b['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x2115('0xbd')]({'active':![],'countagentrejectretry':_0x1c2582[_0x2115('0xf4')]+=0x1,'scheduledat':moment()[_0x2115('0x102')](_0x1a929b[_0x2115('0x1a8')],'minutes')[_0x2115('0x74')](_0x2115('0xfc')),'ContactId':_0x1c2582['ContactId'],'ListId':_0x1c2582[_0x2115('0xd2')],'VoiceQueueId':_0x1c2582[_0x2115('0x11c')]||undefined,'CampaignId':_0x1c2582[_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch(_0x2115('0x1a9')));break;default:return!![];}};Dialer[_0x2115('0x18')][_0x2115('0x1aa')]=function(_0x266903,_0x401443,_0x5e2b29){var _0x281485=this;var _0x39151a=new History(_0x266903);return new BPromise(function(_0x490864,_0x244272){if(_[_0x2115('0x3e')](_0x401443)&&typeof _0x401443!==_0x2115('0x167')){return _0x244272(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_[_0x2115('0x3e')](_0x5e2b29)&&typeof _0x5e2b29!==_0x2115('0x167')){return _0x244272(msgResponse(_0x2115('0x1ab'),_0x2115('0x144'),'evt\x20is\x20undefine'));}switch(_0x5e2b29[_0x2115('0x10c')]){case'0':_0x401443['outboundNoSuchCallsDay']+=0x1;_0x39151a['state']=0x0;_0x39151a[_0x2115('0xa8')]=_0x2115('0x1ac');_0x39151a['countnosuchnumberretry']+=0x1;_0x39151a[_0x2115('0xee')]+=0x1;ami[_0x2115('0xe5')](_0x2115('0x1ad'),ut[_0x2115('0xe7')](_0x266903,_0x2115('0x1ae')));_0x281485['createHistory'](_0x39151a)['catch'](loggerCatch(_0x2115('0xef')));if(_0x281485[_0x2115('0x19a')](0x0,_0x266903,_0x401443)){if(_0x39151a[_0x2115('0xf1')]>=_0x401443['dialNoSuchNumberMaxRetry']){_0x281485[_0x2115('0x1af')](_0x39151a,_0x490864,_0x244272,_0x2115('0x1b0'));}else{_0x281485[_0x2115('0xf6')](_0x39151a,_0x490864,_0x244272,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x401443[_0x2115('0x63')]+=0x1;_0x39151a[_0x2115('0xa7')]=0x3;_0x39151a['statedesc']='NoAnswer';_0x39151a[_0x2115('0x101')]+=0x1;_0x39151a['countglobal']+=0x1;ami[_0x2115('0xe5')](_0x2115('0x1b1'),ut[_0x2115('0xe7')](_0x266903,_0x2115('0x1b2')));_0x281485[_0x2115('0xca')](_0x39151a)['catch'](loggerCatch(_0x2115('0x1b3')));if(_0x281485['checkRetriveMax'](0x3,_0x266903,_0x401443)){if(_0x39151a[_0x2115('0x101')]>=_0x401443[_0x2115('0x19c')]){_0x281485[_0x2115('0x1af')](_0x39151a,_0x490864,_0x244272,_0x2115('0x1b4'));}else{_0x281485['stateGlobal'](_0x39151a,_0x490864,_0x244272,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x401443[_0x2115('0x60')]+=0x1;_0x39151a[_0x2115('0xa7')]=0x5;_0x39151a[_0x2115('0xa8')]=_0x2115('0x1b5');_0x39151a['countbusyretry']+=0x1;_0x39151a['countglobal']+=0x1;ami[_0x2115('0xe5')]('custom:agentbusy',ut[_0x2115('0xe7')](_0x266903,_0x2115('0x1b6')));_0x281485[_0x2115('0xca')](_0x39151a)['catch'](loggerCatch(_0x2115('0x1b7')));if(_0x281485['checkRetriveMax'](0x5,_0x266903,_0x401443)){if(_0x39151a['countbusyretry']>=_0x401443[_0x2115('0x19f')]){_0x281485[_0x2115('0x1af')](_0x39151a,_0x490864,_0x244272,_0x2115('0x1b8'));}else{_0x281485[_0x2115('0xf6')](_0x39151a,_0x490864,_0x244272,_0x2115('0x1b8'));}}break;case'8':_0x401443[_0x2115('0x61')]+=0x1;_0x39151a[_0x2115('0xa7')]=0x8;_0x39151a[_0x2115('0xa8')]='Congestion';_0x39151a[_0x2115('0x19b')]+=0x1;_0x39151a['countglobal']+=0x1;ami[_0x2115('0xe5')](_0x2115('0x1b9'),ut[_0x2115('0xe7')](_0x266903,_0x2115('0x1ba')));_0x281485[_0x2115('0xca')](_0x39151a)[_0x2115('0xb0')](loggerCatch(_0x2115('0x1bb')));if(_0x281485['checkRetriveMax'](0x8,_0x266903,_0x401443)){if(_0x39151a[_0x2115('0x19b')]>=_0x401443[_0x2115('0x1a1')]){_0x281485[_0x2115('0x1af')](_0x39151a,_0x490864,_0x244272,_0x2115('0x1bc'));}else{_0x281485[_0x2115('0xf6')](_0x39151a,_0x490864,_0x244272,_0x2115('0x1bc'));}}break;case'11':_0x401443[_0x2115('0x1bd')]+=0x1;_0x39151a[_0x2115('0xa7')]=0xb;_0x39151a['statedesc']=_0x2115('0x124');_0x39151a[_0x2115('0xf3')]+=0x1;_0x39151a['countglobal']+=0x1;_0x281485['createHistory'](_0x39151a)['catch'](loggerCatch(_0x2115('0x125')));if(_0x281485[_0x2115('0x19a')](0xb,_0x266903,_0x401443)){if(_0x39151a['countabandonedretry']>=_0x401443[_0x2115('0x122')]){_0x281485['createStateFinal'](_0x39151a,_0x490864,_0x244272,_0x2115('0x1be'));}else{_0x281485[_0x2115('0xf6')](_0x39151a,_0x490864,_0x244272,_0x2115('0x1be'));}}break;case'20':_0x401443[_0x2115('0x66')]+=0x1;_0x39151a[_0x2115('0xa7')]=0x14;_0x39151a[_0x2115('0xa8')]='AgentReject';_0x39151a[_0x2115('0xf4')]+=0x1;_0x39151a[_0x2115('0xee')]+=0x1;ami[_0x2115('0xe5')](_0x2115('0x1bf'),ut[_0x2115('0xe7')](_0x266903,_0x2115('0x1c0')));_0x281485['createHistory'](_0x39151a)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x281485['checkRetriveMax'](0x14,_0x266903,_0x401443)){if(_0x39151a[_0x2115('0xf4')]>=_0x401443[_0x2115('0x1c1')]){_0x281485[_0x2115('0x1af')](_0x39151a,_0x490864,_0x244272,_0x2115('0x1c2'));}else{_0x281485[_0x2115('0xf6')](_0x39151a,_0x490864,_0x244272,'reason\x2020\x20agentreject');}}break;default:_0x401443[_0x2115('0x109')]+=0x1;_0x39151a[_0x2115('0xa7')]=0xc;_0x39151a['statedesc']=_0x5e2b29[_0x2115('0x10c')];_0x281485[_0x2115('0xca')](_0x39151a)[_0x2115('0xb0')](loggerCatch(_0x2115('0x1c3')));if(_0x281485['checkRetriveMax'](_0x5e2b29['reason'],_0x266903,_0x401443)){if(_0x39151a['countbusyretry']+_0x39151a[_0x2115('0x19b')]+_0x39151a[_0x2115('0x101')]+_0x39151a[_0x2115('0xf1')]+_0x39151a[_0x2115('0xf2')]+_0x39151a[_0x2115('0xf3')]+_0x39151a[_0x2115('0xed')]+_0x39151a['countagentrejectretry']>=_0x401443[_0x2115('0xf5')]){_0x281485[_0x2115('0xf6')](_0x39151a,_0x490864,_0x244272,_0x5e2b29[_0x2115('0x10c')]);}else{_0x281485['createStateFinal'](_0x39151a,_0x490864,_0x244272,_0x5e2b29[_0x2115('0x10c')]);}}}});};Dialer['prototype'][_0x2115('0xf6')]=function(_0x14c6c2,_0x1fc06e,_0xac82f,_0x36d8fc){var _0x157142=new Final(_0x14c6c2);_0x157142[_0x2115('0xa7')]=0xf;_0x157142[_0x2115('0xa8')]=_0x2115('0x1c4');this['createStateFinal'](_0x157142,_0x1fc06e,_0xac82f,_0x36d8fc);};Dialer[_0x2115('0x18')][_0x2115('0x1af')]=function(_0x27af09,_0x242334,_0x242d78,_0x163e29){this[_0x2115('0xc8')](_0x27af09)['then'](function(){return _0x242334(msgResponse(_0x2115('0x1ab'),'Success',_0x163e29));})[_0x2115('0xb0')](function(){return _0x242d78(msgResponse('[moveContactManagedDialer][0]','Failure',_0x2115('0x1c5')));});};Dialer[_0x2115('0x18')]['predictive']=function(_0x5a345a){var _0x153a6f=_0x5a345a[_0x2115('0x1c6')]/0x64;var _0x432541=_0x5a345a[_0x2115('0x117')]/(_0x5a345a['outboundDropCallsDayTimeout']+_0x5a345a[_0x2115('0x5e')]);var _0x1c8681=Math[_0x2115('0x1c7')](_0x5a345a[_0x2115('0x6c')]*(_0x5a345a['predictiveIntervalMaxThreshold']/0x64));var _0x358787=Math['round'](_0x5a345a[_0x2115('0x6c')]*(_0x5a345a['predictiveIntervalMinThreshold']/0x64));var _0x3b1aa5=_0x5a345a[_0x2115('0x1c8')]+_0x5a345a['talking'];var _0x4c8df8=Math['floor'](_0x5a345a['erlangCalls']*_0x5a345a[_0x2115('0x70')]*_0x5a345a['predictiveIntervalHitRate']*_0x5a345a['predictiveIntervalMultiplicativeFactor']);if(_[_0x2115('0x3e')](_0x5a345a[_0x2115('0x29')])){if(!_[_0x2115('0x3e')](_0x5a345a[_0x2115('0x28')])){_0x5a345a[_0x2115('0x28')]=undefined;loggerPredictive[_0x2115('0x97')](_0x2115('0x1c9'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x2115('0x3e')](_0x5a345a[_0x2115('0x8e')])){loggerPredictive[_0x2115('0x97')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5a345a['handlePredictive']);_0x5a345a[_0x2115('0x8e')]=undefined;}_0x5a345a[_0x2115('0x29')]=moment()[_0x2115('0x74')](_0x2115('0xfc'));loggerPredictive['info'](_0x5a345a[_0x2115('0x3f')],_0x2115('0x1ca'),_0x5a345a[_0x2115('0x29')]);this[_0x2115('0x156')](_0x5a345a,0x1);}else if(ifInterval(_0x5a345a['dialPredictiveInterval'],_0x5a345a[_0x2115('0x29')])){this[_0x2115('0x156')](_0x5a345a,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x5a345a[_0x2115('0x29')],_0x5a345a[_0x2115('0x3f')]);_0x5a345a[_0x2115('0x88')]=0x0;_0x5a345a[_0x2115('0x6a')]=0x0;}else if(_0x153a6f<_0x432541&&_0x5a345a['dialPredictiveOptimization']===_0x2115('0x1cb')){freeVariablesPredictive(_0x5a345a);loggerPredictive[_0x2115('0x79')](_0x2115('0x1cc'),'Dropped\x20calls\x20day',_0x432541,_0x2115('0x29'),_0x5a345a[_0x2115('0x3f')]);}else if(_0x4c8df8<_0x5a345a[_0x2115('0x6a')]&&_0x5a345a[_0x2115('0x1cd')]===_0x2115('0x1cb')){freeVariablesPredictive(_0x5a345a);loggerPredictive[_0x2115('0x79')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x4c8df8,_0x2115('0x1ce'),_0x5a345a[_0x2115('0x6a')],_0x2115('0x29'),_0x5a345a[_0x2115('0x3f')]);}else if(!ifInterval(_0x5a345a['dialPredictiveInterval'],_0x5a345a[_0x2115('0x29')])&&_[_0x2115('0x3e')](_0x5a345a[_0x2115('0x28')])&&!_[_0x2115('0x3e')](_0x5a345a[_0x2115('0x29')])){_0x5a345a[_0x2115('0x28')]=moment()[_0x2115('0x74')](_0x2115('0xfc'));loggerPredictive[_0x2115('0x79')](_0x5a345a[_0x2115('0x3f')],_0x2115('0x1cf'),_0x5a345a[_0x2115('0x28')]);this[_0x2115('0xbb')](_0x5a345a[_0x2115('0x1d0')])[_0x2115('0xb6')](this[_0x2115('0x1d1')](_0x5a345a))['then'](mergeDataErlangB(_0x5a345a))['then'](this['startMethodPredictive'](_0x5a345a))[_0x2115('0xb0')](loggerCatchPredictive(_0x2115('0x1d2'),_0x5a345a));}else if(!ifInterval(_0x5a345a['dialPredictiveInterval'],_0x5a345a[_0x2115('0x28')])){_0x5a345a[_0x2115('0x6a')]=0x0;_0x5a345a['startPredictive']=moment()[_0x2115('0x74')](_0x2115('0xfc'));loggerPredictive[_0x2115('0x79')](_0x5a345a['name'],_0x2115('0x1d3'),_0x5a345a[_0x2115('0x28')]);clearInterval(_0x5a345a['handlePredictive']);_0x5a345a[_0x2115('0x8e')]=undefined;this[_0x2115('0xbb')](_0x5a345a[_0x2115('0x1d0')])[_0x2115('0xb6')](this[_0x2115('0x1d1')](_0x5a345a))[_0x2115('0xb6')](mergeDataErlangB(_0x5a345a))[_0x2115('0xb6')](this[_0x2115('0x1d4')](_0x5a345a))['catch'](loggerCatchPredictive(_0x2115('0x1d5'),_0x5a345a));}else if(_0x5a345a[_0x2115('0x6c')]&&_0x3b1aa5<_0x5a345a[_0x2115('0x6c')]-_0x358787){freeVariablesPredictive(_0x5a345a);loggerPredictive[_0x2115('0x79')](_0x5a345a[_0x2115('0x3f')],_0x2115('0x1d6'),_0x3b1aa5,_0x2115('0x1d7'),_0x5a345a[_0x2115('0x6c')],'-',_0x358787,'=',_0x5a345a[_0x2115('0x6c')]-_0x358787,')');}else if(_0x5a345a[_0x2115('0x6c')]&&_0x3b1aa5>_0x5a345a[_0x2115('0x6c')]+_0x1c8681){freeVariablesPredictive(_0x5a345a);loggerPredictive[_0x2115('0x79')](_0x5a345a[_0x2115('0x3f')],_0x2115('0x1d6'),_0x3b1aa5,_0x2115('0x1d8'),_0x5a345a[_0x2115('0x6c')],'+',_0x1c8681,'=',_0x5a345a['predictiveIntervalAvailable']+_0x1c8681,')');}};Dialer[_0x2115('0x18')][_0x2115('0x1d1')]=function(_0x2dac8d){var _0x17f54f=this;return function(_0xbd1773){return new BPromise(function(_0x2c7882,_0xbe7051){_[_0x2115('0x8b')](_0x2dac8d,_0xbd1773[0x0]);if(checkGetDataPredictive(_0xbd1773[0x0])){var _0x25fedb=_0x2dac8d[_0x2115('0x6c')]=_0x2dac8d[_0x2115('0x57')]+_0x2dac8d[_0x2115('0x1c8')];var _0x1db087=_0x2dac8d['dialPredictiveInterval']*0x3c;var _0xd17645=_0xbd1773[0x0][_0x2115('0x68')]+_0xbd1773[0x0][_0x2115('0x67')];var _0xfa772c=(_0xbd1773[0x0][_0x2115('0x7c')]+_0xbd1773[0x0][_0x2115('0x7d')]+_0xbd1773[0x0][_0x2115('0x7f')])/_0xbd1773[0x0][_0x2115('0x6d')];_0x2dac8d[_0x2115('0x1d9')]=_0xfa772c>0x0?_0xfa772c:0x1;switch(_0x2dac8d[_0x2115('0x1cd')]){case _0x2115('0x1cb'):var _0x377e7a=_0x2dac8d[_0x2115('0x1c6')]/0x64;return _0x17f54f['abandonmentRate'](_0x25fedb,_0x1db087,_0xd17645,_0xfa772c,_0x377e7a)[_0x2115('0xb6')](function(_0x5de807){return _0x2c7882(_0x5de807);});case _0x2115('0x1da'):var _0x4aa065=_0x2dac8d['dialPredictiveOptimizationPercentage']/0x64;return _0x17f54f[_0x2115('0x1db')](_0x25fedb,_0x1db087,_0xd17645,_0xfa772c,_0x4aa065)[_0x2115('0xb6')](function(_0x5bb08c){return _0x2c7882(_0x5bb08c);});default:return _0xbe7051(msgResponse('[getDataPredictive]',_0x2115('0x144'),_0x2115('0x1dc')));}}else{return _0xbe7051(msgResponse(_0x2115('0x1dd'),_0x2115('0x144'),'check\x20failure'));}});};};Dialer[_0x2115('0x18')][_0x2115('0x1de')]=function(_0x44382c){var _0x347295=this;return function(_0x1ee294){return new BPromise(function(_0x42dfaa,_0x58b559){_[_0x2115('0x8b')](_0x44382c,_0x1ee294[0x0]);if(checkGetDataPredictive(_0x1ee294[0x0])){loggerPredictive[_0x2115('0x79')](JSON['stringify'](_0x1ee294[0x0]));if(_0x44382c[_0x2115('0x1cd')]===_0x2115('0x1cb')){return _0x347295['getVoiceQueueRtPauses'](_0x44382c['id'])['then'](function(_0x494b41){var _0x1930e2=_0x44382c['loggedIn']-_0x494b41[0x0][_0x2115('0x1df')];var _0x5cc16f=_0x44382c['dialPredictiveInterval']*0x3c;var _0x31e7ab=_0x1ee294[0x0][_0x2115('0x68')]+_0x1ee294[0x0][_0x2115('0x67')];var _0x16d9b9=(_0x1ee294[0x0][_0x2115('0x7c')]+_0x1ee294[0x0][_0x2115('0x7d')]+_0x1ee294[0x0][_0x2115('0x7f')])/_0x1ee294[0x0]['predictiveIntervalTotalCalls'];var _0x549b4a=_0x44382c['dialPredictiveOptimizationPercentage']/0x64;_0x44382c[_0x2115('0x6b')]=_0x494b41[0x0][_0x2115('0x1df')]||0x0;_0x44382c[_0x2115('0x1d9')]=_0x16d9b9>0x0?_0x16d9b9:0x1;return _0x347295[_0x2115('0x1e0')](_0x1930e2,_0x5cc16f,_0x31e7ab,_0x16d9b9,_0x549b4a);})[_0x2115('0xb6')](function(_0x26377c){return _0x42dfaa(_0x26377c);})[_0x2115('0xb0')](function(_0x374cb0){return _0x58b559(msgResponse(_0x2115('0x1e1'),_0x2115('0x144'),JSON[_0x2115('0x4a')](_0x374cb0)));});}if(_0x44382c[_0x2115('0x1cd')]===_0x2115('0x1da')){return _0x347295[_0x2115('0xc6')](_0x44382c['id'])['then'](function(_0x351659){var _0x326c1d=_0x44382c[_0x2115('0x52')]-_0x351659[0x0][_0x2115('0x1df')];var _0x1c972b=_0x44382c[_0x2115('0x1d0')]*0x3c;var _0x254b40=_0x1ee294[0x0]['predictiveIntervalAvgTalktime']+_0x1ee294[0x0][_0x2115('0x67')];var _0x528ece=(_0x1ee294[0x0]['predictiveIntervalAnsweredCalls']+_0x1ee294[0x0][_0x2115('0x7d')]+_0x1ee294[0x0][_0x2115('0x7f')])/_0x1ee294[0x0][_0x2115('0x6d')];var _0x107d57=_0x44382c['dialPredictiveOptimizationPercentage']/0x64;_0x44382c['predictiveIntervalPauses']=_0x351659[0x0]['outboundQueuePauses']||0x0;_0x44382c['predictiveIntervalHitRate']=_0x528ece>0x0?_0x528ece:0x1;return _0x347295['busyFactor'](_0x326c1d,_0x1c972b,_0x254b40,_0x528ece,_0x107d57);})[_0x2115('0xb6')](function(_0x98e3dd){return _0x42dfaa(_0x98e3dd);})[_0x2115('0xb0')](function(_0x56f161){return _0x58b559(msgResponse('[CatchErlangB]',_0x2115('0x144'),JSON['stringify'](_0x56f161)));});}}else{return _0x58b559(msgResponse('[getDataPredictive]',_0x2115('0x144'),_0x2115('0x1e2')));}});};};Dialer['prototype'][_0x2115('0x1d4')]=function(_0x1386e6){var _0x1c5aab=this;return function(){var _0x3225c7=0x0;var _0x2258dd=Math['floor'](_0x1386e6['erlangCallToSecond']*0x3e8);if(_0x2258dd>0x0){_0x2258dd=_0x2258dd<0x64?0x64:_0x2258dd;loggerPredictive[_0x2115('0x79')](_0x1386e6[_0x2115('0x3f')],_0x2115('0x1e3'),_0x2258dd,_0x2115('0x4b'));_0x1386e6[_0x2115('0x8e')]=setInterval(function(){_0x1c5aab[_0x2115('0x8e')](_0x1386e6);loggerPredictiveCalls['info']('[handlePredictive]',_0x3225c7+=0x1);},_0x2258dd);}else{loggerPredictive[_0x2115('0x79')](_0x1386e6[_0x2115('0x3f')],_0x2115('0x1e4'));}};};Dialer[_0x2115('0x18')][_0x2115('0x1e5')]=function(_0x4ed258,_0x31537e){var _0x3bc33c=this;return function(_0x2bd3d4){if(_[_0x2115('0x78')](_0x2bd3d4)){if(_[_0x2115('0xdc')](_0x31537e[_0x2115('0xd3')])||!_0x31537e[_0x2115('0x1e6')]){if(_0x4ed258[_0x2115('0x15c')]===_0x2115('0x9')){_0x4ed258[_0x2115('0x12e')]=_['isUndefined'](_0x4ed258[_0x2115('0x12e')])?!![]:_0x4ed258['queueStatusComplete'];var _0x5b2560=uuid['v4']();_0x3bc33c[_0x2115('0x24')][_0x5b2560]=new Action(_0x4ed258,_0x31537e,_0x5b2560);loggerBooked[_0x2115('0x79')](_0x2115('0x1e7'),_0x5b2560,_0x2115('0x1e8'),JSON[_0x2115('0x4a')](_0x4ed258[_0x2115('0x12e')]),'Queue:\x20',_0x4ed258[_0x2115('0x3f')]);if(_0x4ed258[_0x2115('0x12e')]){_0x4ed258[_0x2115('0x12e')]=![];_0x3bc33c[_0x2115('0x2b')][_0x3bc33c[_0x2115('0x24')][_0x5b2560]['queue']]=[];ami[_0x2115('0xae')]({'actionid':_0x5b2560,'action':_0x2115('0x1e9'),'queue':_0x4ed258[_0x2115('0x3f')]})['catch'](function(){_0x3bc33c['updateOriginated'](_0x4ed258);_0x3bc33c['rescheduleContact']({'active':![],'ContactId':_0x3bc33c[_0x2115('0x24')][_0x5b2560][_0x2115('0xd1')],'ListId':_0x3bc33c[_0x2115('0x24')][_0x5b2560][_0x2115('0xd2')],'VoiceQueueId':_0x3bc33c[_0x2115('0x24')][_0x5b2560][_0x2115('0x11c')]||undefined,'CampaignId':_0x3bc33c[_0x2115('0x24')][_0x5b2560][_0x2115('0xfd')]||undefined})[_0x2115('0xb0')](loggerCatch(_0x2115('0x1ea')));delete _0x3bc33c[_0x2115('0x24')][_0x5b2560];});}else{loggerBooked[_0x2115('0x79')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x4ed258[_0x2115('0x12e')]),_0x2115('0x1eb'),_0x4ed258['name']);_0x3bc33c[_0x2115('0xb1')](_0x4ed258);_0x3bc33c['rescheduleContact']({'active':![],'ContactId':_0x3bc33c[_0x2115('0x24')][_0x5b2560]['ContactId'],'ListId':_0x3bc33c[_0x2115('0x24')][_0x5b2560]['ListId'],'VoiceQueueId':_0x3bc33c[_0x2115('0x24')][_0x5b2560][_0x2115('0x11c')]||undefined,'CampaignId':_0x3bc33c['actions'][_0x5b2560][_0x2115('0xfd')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3bc33c[_0x2115('0x24')][_0x5b2560];}}else{return _0x3bc33c[_0x2115('0x166')](_0x4ed258,_0x31537e);}}else{if(getDiff(_0x31537e[_0x2115('0x1ec')])<_0x4ed258['dialRecallMeTimeout']*0x3c){if(_0x31537e[_0x2115('0x1ed')]&&!_0x31537e[_0x2115('0x1ed')][_0x2115('0x1ee')]){_0x3bc33c[_0x2115('0x1d')][_0x2115('0x130')](_0x31537e['id'])[_0x2115('0x1b')](function(){_0x3bc33c[_0x2115('0xb1')](_0x4ed258);});}else{_0x3bc33c[_0x2115('0xbf')]({'active':![]},_0x31537e['id'],0x1)[_0x2115('0x1b')](function(){_0x3bc33c[_0x2115('0xb1')](_0x4ed258);});}}else{_0x4ed258[_0x2115('0x65')]+=0x1;_0x3bc33c['updateOriginated'](_0x4ed258);if(_0x4ed258[_0x2115('0x1ef')]){_0x3bc33c[_0x2115('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x31537e[_0x2115('0xd1')],'ListId':_0x31537e['ListId'],'VoiceQueueId':_0x31537e[_0x2115('0x11c')]||undefined,'CampaignId':_0x31537e['CampaignId']||undefined})[_0x2115('0xb0')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3bc33c[_0x2115('0xca')](createObjHistory(_0x4ed258,_0x31537e,_0x2115('0x1f0'),0x17,'RecallInQueue'))[_0x2115('0xb0')](loggerCatch(_0x2115('0x1f1')));}else{_0x3bc33c[_0x2115('0xd0')](createObjHistory(_0x4ed258,_0x31537e,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x2115('0x1f2'),'[Originate][HistoryRecallClose]');}}}}else{_0x4ed258[_0x2115('0x5f')]+=0x1;_0x3bc33c[_0x2115('0xd0')](createObjHistory(_0x4ed258,_0x31537e,'BLACKLIST',0xd,_0x2115('0x1f3')),_0x2115('0x1f4'),_0x2115('0x1f5'));throw _0x2115('0x1f6');}};};Dialer[_0x2115('0x18')]['handleIvr']=function(_0x1f3572){var _0x4864e9=this;var _0x4715bb=_0x1f3572['limitCalls']-_0x1f3572[_0x2115('0x6e')]-_0x1f3572[_0x2115('0xc2')];emitCampaignSummary(_0x1f3572);if(_0x4715bb>0x0){if(_0x4715bb>this[_0x2115('0x22')]){_0x4715bb=this['maxNumberOriginate'];}_0x1f3572['temp']+=_0x4715bb;this[_0x2115('0xc4')](_0x1f3572['id'],_0x4715bb,_0x1f3572['dialOrderByScheduledAt'],_0x1f3572)['then'](function(_0x38da5e){_0x1f3572[_0x2115('0xc2')]-=_0x4715bb;_0x1f3572[_0x2115('0xc2')]=_0x1f3572[_0x2115('0xc2')]>0x0?_0x1f3572['temp']:0x0;if(!checkContactEmpty(_0x38da5e)){_0x1f3572[_0x2115('0x47')]=_0x2115('0x9e');logger[_0x2115('0x79')](_0x2115('0x1f7')+_0x1f3572[_0x2115('0x3f')]);}else{_0x1f3572[_0x2115('0x6e')]+=_0x38da5e[_0x2115('0x95')];_0x1f3572[_0x2115('0x47')]='RUNNING';for(var _0x196115=0x0;_0x196115<_0x38da5e[_0x2115('0x95')];_0x196115+=0x1){_0x1f3572[_0x2115('0x1f8')]+=0x1;if(_['isNil'](_0x38da5e[_0x196115])||_[_0x2115('0xdc')](_0x38da5e[_0x196115][_0x2115('0x169')])||_['isNil'](_0x38da5e[_0x196115][_0x2115('0x169')][_0x2115('0x16a')])){_0x4864e9[_0x2115('0xce')](_0x2115('0x1f9'),_0x1f3572,_0x38da5e[_0x196115]);}else{_0x4864e9['checkIsBlackListIvr'](_[_0x2115('0x12b')](_0x38da5e[_0x196115],[_0x2115('0xfd'),_0x2115('0x1fa')]))['then'](_0x4864e9['checkContactBlack'](_0x1f3572,_0x38da5e[_0x196115]))[_0x2115('0xb0')](_0x4864e9[_0x2115('0xcc')](_0x2115('0x1fb'),_0x1f3572));}}}})[_0x2115('0xb0')](loggerGetContactDialer('[getContactCampaign2]',_0x1f3572,_0x4715bb));}};Dialer[_0x2115('0x18')]['handlePower']=function(_0x500fbc,_0x49da99){var _0x4b5c60=this;var _0x29d082=[];var _0x2cd61e=_0x49da99>=0x1?_0x49da99:0x1;if(_0x500fbc['dialMethod']===_0x2115('0x9')){_0x2cd61e=0x1;}var _0x3f763b=Math[_0x2115('0x1fc')](_0x500fbc[_0x2115('0x1c8')]*_0x2cd61e)-_0x500fbc[_0x2115('0x6e')]-_0x500fbc[_0x2115('0xc2')];emitVoiceQueueSummary(_0x500fbc);if(_0x500fbc[_0x2115('0x1fd')]>0x0){var _0x10e482=_0x500fbc[_0x2115('0x1fd')]-_0x500fbc[_0x2115('0x6e')]-_0x500fbc[_0x2115('0x57')]-_0x500fbc[_0x2115('0xc2')]-_0x500fbc[_0x2115('0x53')];if(_0x3f763b>_0x10e482){_0x3f763b=_0x10e482;}}if(_0x3f763b>0x0){if(_0x500fbc[_0x2115('0x15c')]===_0x2115('0x9')){_0x3f763b=0x1;}if(_0x3f763b>this[_0x2115('0x22')]){_0x3f763b=this[_0x2115('0x22')];}_0x500fbc[_0x2115('0xc2')]+=_0x3f763b;for(var _0x4b2525 in this[_0x2115('0x20')]){if(typeof this[_0x2115('0x20')][_0x4b2525]!==_0x2115('0x96')){if(this[_0x2115('0x20')][_0x4b2525][_0x2115('0xa7')]===_0x2115('0x1fe')&&this['agents'][_0x4b2525][_0x2115('0xaf')]==='reachable'){_0x29d082[_0x2115('0x12a')](this[_0x2115('0x20')][_0x4b2525]['id']);}}}this[_0x2115('0xc1')](_0x500fbc['id'],_0x29d082,_0x3f763b,_0x500fbc[_0x2115('0x1ff')],_0x500fbc)[_0x2115('0xb6')](function(_0x138e2a){_0x500fbc['temp']-=_0x3f763b;_0x500fbc[_0x2115('0xc2')]=_0x500fbc['temp']>0x0?_0x500fbc[_0x2115('0xc2')]:0x0;if(!checkContactEmpty(_0x138e2a)){_0x4b5c60[_0x2115('0xb4')](_0x500fbc)[_0x2115('0xb6')](sendMessageReschedule(_0x500fbc))[_0x2115('0xb0')](loggerCatch('[countReScheduled]\x20'));}else{_0x500fbc[_0x2115('0x6e')]+=_0x138e2a[_0x2115('0x95')];_0x500fbc[_0x2115('0x47')]=_0x500fbc[_0x2115('0x15c')]==='booked'?'ACTIVE':_0x2115('0x200');for(var _0x5a5025=0x0;_0x5a5025<_0x138e2a[_0x2115('0x95')];_0x5a5025+=0x1){if(_[_0x2115('0xdc')](_0x138e2a[_0x5a5025])||_[_0x2115('0xdc')](_0x138e2a[_0x5a5025][_0x2115('0x169')])||_[_0x2115('0xdc')](_0x138e2a[_0x5a5025]['Contact'][_0x2115('0x16a')])){_0x4b5c60[_0x2115('0xce')](_0x2115('0x1f9'),_0x500fbc,_0x138e2a[_0x5a5025]);}else{_0x4b5c60[_0x2115('0xb8')](_['pick'](_0x138e2a[_0x5a5025],['VoiceQueueId',_0x2115('0x1fa')]))['then'](_0x4b5c60[_0x2115('0x1e5')](_0x500fbc,_0x138e2a[_0x5a5025]))['catch'](_0x4b5c60[_0x2115('0xcc')](_0x2115('0x1f9'),_0x500fbc));}}}})[_0x2115('0xb0')](loggerGetContactDialer(_0x2115('0x201'),_0x500fbc,_0x3f763b));}};Dialer[_0x2115('0x18')][_0x2115('0x8e')]=function(_0x168d7e){if(_0x168d7e[_0x2115('0x1fd')]>0x0){var _0x12ae0b=_0x168d7e[_0x2115('0x1fd')]-_0x168d7e[_0x2115('0x6e')]-_0x168d7e[_0x2115('0x57')];if(_0x12ae0b>0x0){this['tryOriginatePredictive'](_0x168d7e);}else{loggerPredictiveCalls['info'](_0x2115('0x202'));}}else{this['tryOriginatePredictive'](_0x168d7e);}};Dialer[_0x2115('0x18')][_0x2115('0x203')]=function(_0x557b1a){var _0xc8b5f4=this;var _0x41854d=[];_0x557b1a[_0x2115('0x6e')]+=0x1;for(var _0x39c8a8 in this['agents']){if(typeof this['agents'][_0x39c8a8]!==_0x2115('0x96')){if(this['agents'][_0x39c8a8][_0x2115('0xa7')]==='not_inuse'&&this['agents'][_0x39c8a8]['status']==='reachable'){_0x41854d[_0x2115('0x12a')](this[_0x2115('0x20')][_0x39c8a8]['id']);}}}this['getContactDialer'](_0x557b1a['id'],_0x41854d,0x1,_0x557b1a[_0x2115('0x1ff')],_0x557b1a)[_0x2115('0xb6')](function(_0x376911){if(!checkContactEmpty(_0x376911)){checkContactLowerLimitOriginate(_0x557b1a,0x1,0x0);_0xc8b5f4['countReScheduled'](_0x557b1a)['then'](sendMessageReschedule(_0x557b1a))[_0x2115('0xb0')](loggerCatch(_0x2115('0xb7')));}else{_0x557b1a['message']=_0x2115('0x200');if(_[_0x2115('0xdc')](_0x376911[0x0])||_['isNil'](_0x376911[0x0]['Contact'])||_[_0x2115('0xdc')](_0x376911[0x0][_0x2115('0x169')][_0x2115('0x16a')])){_0xc8b5f4['emptyContact'](_0x2115('0x1f9'),_0x557b1a,_0x376911[0x0]);}else{_0xc8b5f4[_0x2115('0xb8')](_['pick'](_0x376911[0x0],['VoiceQueueId',_0x2115('0x1fa')]))[_0x2115('0xb6')](_0xc8b5f4[_0x2115('0x1e5')](_0x557b1a,_0x376911[0x0]))[_0x2115('0xb0')](_0xc8b5f4[_0x2115('0xcc')](_0x2115('0x204'),_0x557b1a));}}})[_0x2115('0xb0')](loggerGetContactDialer(_0x2115('0x205'),_0x557b1a,0x1));emitVoiceQueueSummary(_0x557b1a);};Dialer[_0x2115('0x18')][_0x2115('0x1e0')]=function(_0x12196e,_0x4d820a,_0x176de0,_0x4621e2,_0x2f859c,_0x186ad1){loggerPredictive[_0x2115('0x79')](_0x2115('0x206'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x12196e);loggerPredictive[_0x2115('0x79')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d820a);loggerPredictive['info'](_0x2115('0x207'),_0x176de0);loggerPredictive[_0x2115('0x79')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4621e2);loggerPredictive[_0x2115('0x79')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f859c);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x4ee12e,_0x17c92d){if(_0x12196e<=0x0||isNaN(_0x12196e)){return _0x17c92d(msgResponse(_0x2115('0x208'),_0x2115('0x49'),_0x2115('0x209')+_0x12196e));}if(_0x176de0<=0x0||isNaN(_0x176de0)){return _0x17c92d(msgResponse('[abandonmentRate]',_0x2115('0x49'),'Ts\x20=\x20'+_0x176de0));}if(_0x4621e2<=0x0||isNaN(_0x4621e2)){return _0x17c92d(msgResponse(_0x2115('0x208'),_0x2115('0x49'),_0x2115('0x20a')+_0x4621e2));}if(_0x4d820a<=0x0||isNaN(_0x4d820a)){return _0x17c92d(msgResponse(_0x2115('0x208'),_0x2115('0x49'),'interval\x20=\x20'+_0x4d820a));}if(_0x2f859c<=0x0||isNaN(_0x2f859c)){return _0x17c92d(msgResponse(_0x2115('0x208'),'Error',_0x2115('0x20b')+_0x2f859c));}_0x186ad1=_0x186ad1||0x0;var _0x1e5e70=0x1/_0x176de0;var _0x252888=0x0;var _0x42847a=0x0;var _0x2d4544=0x0;var _0x2fabc8=0x0;for(var _0x5d47dd=0x0;_0x2d4544<_0x2f859c;_0x5d47dd+=0x1){_0x42847a=_0x5d47dd/_0x4d820a;_0x252888=(_0x4621e2*_0x42847a+_0x186ad1)/_0x1e5e70;_0x2d4544=erlangb(_0x252888,_0x12196e);_0x2fabc8=_0x252888/_0x12196e*(0x1-erlangb(_0x252888,_0x12196e));}return _0x4ee12e({'erlangCalls':_0x5d47dd,'erlangCallToSecond':_0x4d820a/_0x5d47dd,'erlangAbandonmentRate':_0x2d4544,'erlangBusyFactor':_0x2fabc8});});};Dialer['prototype'][_0x2115('0x1db')]=function(_0x3c2666,_0x28b396,_0x49df81,_0x39f2c7,_0x3cca3e,_0x4870f0){loggerPredictive[_0x2115('0x79')](_0x2115('0x20c'));loggerPredictive[_0x2115('0x79')](_0x2115('0x20d'),_0x3c2666);loggerPredictive[_0x2115('0x79')](_0x2115('0x20e'),_0x28b396);loggerPredictive[_0x2115('0x79')](_0x2115('0x207'),_0x49df81);loggerPredictive[_0x2115('0x79')](_0x2115('0x20f'),_0x39f2c7);loggerPredictive[_0x2115('0x79')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3cca3e);loggerPredictive[_0x2115('0x79')](_0x2115('0x82'));return new BPromise(function(_0x2a2aa8,_0x3353ca){if(_0x3c2666<=0x0||isNaN(_0x3c2666)){return _0x3353ca(msgResponse(_0x2115('0x210'),_0x2115('0x49'),_0x2115('0x209')+_0x3c2666));}if(_0x49df81<=0x0||isNaN(_0x49df81)){return _0x3353ca(msgResponse(_0x2115('0x210'),'Error','Ts\x20=\x20'+_0x49df81));}if(_0x39f2c7<=0x0||isNaN(_0x39f2c7)){return _0x3353ca(msgResponse('[busyFactor]',_0x2115('0x49'),_0x2115('0x20a')+_0x39f2c7));}if(_0x28b396<=0x0||isNaN(_0x28b396)){return _0x3353ca(msgResponse('[busyFactor]','Error','interval\x20=\x20'+_0x28b396));}if(_0x3cca3e<=0x0||isNaN(_0x3cca3e)){return _0x3353ca(msgResponse('[busyFactor]','Error',_0x2115('0x211')+_0x3cca3e));}_0x4870f0=_0x4870f0||0x0;var _0x55592e=0x1/_0x49df81;var _0x5e1161=0x0;var _0x23165b=0x0;var _0x3967a3=0x0;var _0x3dbb5c=0x0;for(var _0x4375cb=0x0;_0x3dbb5c<_0x3cca3e;_0x4375cb+=0x1){_0x23165b=_0x4375cb/_0x28b396;_0x5e1161=(_0x39f2c7*_0x23165b+_0x4870f0)/_0x55592e;_0x3967a3=erlangb(_0x5e1161,_0x3c2666);_0x3dbb5c=_0x5e1161/_0x3c2666*(0x1-erlangb(_0x5e1161,_0x3c2666));}return _0x2a2aa8({'erlangCalls':_0x4375cb,'erlangCallToSecond':_0x28b396/_0x4375cb,'erlangAbandonmentRate':_0x3967a3,'erlangBusyFactor':_0x3dbb5c});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 62f3fad..f30e38e 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8991=['uniqueid','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry'];(function(_0xcf016b,_0x4428ae){var _0xfc22fc=function(_0xa41469){while(--_0xa41469){_0xcf016b['push'](_0xcf016b['shift']());}};_0xfc22fc(++_0x4428ae);}(_0x8991,0x1b0));var _0x1899=function(_0x2ff8e3,_0x15553b){_0x2ff8e3=_0x2ff8e3-0x0;var _0x2f60b5=_0x8991[_0x2ff8e3];return _0x2f60b5;};'use strict';var util=require(_0x1899('0x0'));var _=require(_0x1899('0x1'));var moment=require('moment');function getSeconds(_0x5427d9,_0x1ec700){var _0x1c3026=moment(_0x5427d9)[_0x1899('0x2')](0x0);var _0x1183f1=moment(_0x1ec700)[_0x1899('0x2')](0x0);return _0x1c3026[_0x1899('0x3')](_0x1183f1,_0x1899('0x4'));}function QueueCallerAbandon(_0xb7cf25,_0x1bb4f5){this[_0x1899('0x5')]=_0xb7cf25[_0x1899('0x5')];this[_0x1899('0x6')]=_0xb7cf25[_0x1899('0x6')];this[_0x1899('0x7')]=_0xb7cf25['type']===_0x1899('0x8')?_0x1899('0x9'):_0xb7cf25['type'];this[_0x1899('0xa')]=_0xb7cf25[_0x1899('0xa')];this[_0x1899('0xb')]=_0xb7cf25['countcongestionretry'];this[_0x1899('0xc')]=_0xb7cf25[_0x1899('0xc')];this[_0x1899('0xd')]=_0xb7cf25[_0x1899('0xa')]+_0xb7cf25['countcongestionretry']+_0xb7cf25['countnoanswerretry']+_0xb7cf25[_0x1899('0xe')]+_0xb7cf25['countdropretry']+_0xb7cf25[_0x1899('0xf')]+_0xb7cf25[_0x1899('0x10')]+_0xb7cf25['countagentrejectretry'];this[_0x1899('0xe')]=_0xb7cf25[_0x1899('0xe')];this[_0x1899('0x11')]=_0xb7cf25[_0x1899('0x11')];this['countabandonedretry']=_0xb7cf25[_0x1899('0xf')];this[_0x1899('0x10')]=_0xb7cf25[_0x1899('0x10')];this[_0x1899('0x12')]=_0xb7cf25[_0x1899('0x12')];this[_0x1899('0x13')]=_0x1bb4f5[_0x1899('0x13')];this['calleridname']=_0xb7cf25['name'];this['calleridnum']=_0xb7cf25[_0x1899('0x14')];this['starttime']=_0xb7cf25[_0x1899('0x15')];this['responsetime']=_0xb7cf25[_0x1899('0x16')];this[_0x1899('0x17')]=_0xb7cf25[_0x1899('0x17')];this[_0x1899('0x18')]=this[_0x1899('0x17')];this[_0x1899('0x19')]=getSeconds(_0xb7cf25[_0x1899('0x16')],_0xb7cf25[_0x1899('0x15')]);this[_0x1899('0x1a')]=getSeconds(this[_0x1899('0x17')],_0xb7cf25[_0x1899('0x16')]);this['talktime']=0x0;this[_0x1899('0x9')]=_0x1bb4f5[_0x1899('0x9')];this['membername']=_0x1bb4f5[_0x1899('0x1b')];this[_0x1899('0x1c')]=_0x1bb4f5['reason'];this[_0x1899('0x1d')]=_0xb7cf25[_0x1899('0x1d')];this[_0x1899('0x1e')]=_0xb7cf25['callbackuniqueid'];this[_0x1899('0x1f')]=_0xb7cf25[_0x1899('0x1f')];this[_0x1899('0x20')]=_0xb7cf25[_0x1899('0x20')];this[_0x1899('0x21')]=_0xb7cf25['ContactId'];this['ListId']=_0xb7cf25[_0x1899('0x22')];this[_0x1899('0x23')]=_0xb7cf25[_0x1899('0x23')];this[_0x1899('0x24')]=_0xb7cf25[_0x1899('0x24')];this[_0x1899('0x25')]=_0xb7cf25[_0x1899('0x25')];this['originatecalleridnum']=_0xb7cf25[_0x1899('0x26')]||'';this[_0x1899('0x27')]=_0xb7cf25['originatecalleridname']||'';}module[_0x1899('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0x3639=['countdropretry','countabandonedretry','uniqueid','calleridname','calleridnum','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countnosuchnumberretry'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3639,0x6c));var _0x9363=function(_0x2cf5d7,_0xc40aec){_0x2cf5d7=_0x2cf5d7-0x0;var _0x21d5d4=_0x3639[_0x2cf5d7];return _0x21d5d4;};'use strict';var util=require(_0x9363('0x0'));var _=require(_0x9363('0x1'));var moment=require('moment');function getSeconds(_0x27ac6d,_0x9f04ab){var _0x1f4838=moment(_0x27ac6d)[_0x9363('0x2')](0x0);var _0x1cccfa=moment(_0x9f04ab)[_0x9363('0x2')](0x0);return _0x1f4838['diff'](_0x1cccfa,_0x9363('0x3'));}function QueueCallerAbandon(_0x40de66,_0x42c73b){this[_0x9363('0x4')]=_0x40de66[_0x9363('0x4')];this[_0x9363('0x5')]=_0x40de66[_0x9363('0x5')];this[_0x9363('0x6')]=_0x40de66[_0x9363('0x5')]===_0x9363('0x7')?'queue':_0x40de66[_0x9363('0x5')];this[_0x9363('0x8')]=_0x40de66[_0x9363('0x8')];this[_0x9363('0x9')]=_0x40de66[_0x9363('0x9')];this[_0x9363('0xa')]=_0x40de66[_0x9363('0xa')];this[_0x9363('0xb')]=_0x40de66[_0x9363('0x8')]+_0x40de66['countcongestionretry']+_0x40de66[_0x9363('0xa')]+_0x40de66['countnosuchnumberretry']+_0x40de66['countdropretry']+_0x40de66['countabandonedretry']+_0x40de66[_0x9363('0xc')]+_0x40de66[_0x9363('0xd')];this['countnosuchnumberretry']=_0x40de66[_0x9363('0xe')];this[_0x9363('0xf')]=_0x40de66[_0x9363('0xf')];this[_0x9363('0x10')]=_0x40de66[_0x9363('0x10')];this[_0x9363('0xc')]=_0x40de66['countmachineretry'];this[_0x9363('0xd')]=_0x40de66['countagentrejectretry'];this[_0x9363('0x11')]=_0x42c73b['uniqueid'];this[_0x9363('0x12')]=_0x40de66['name'];this[_0x9363('0x13')]=_0x40de66['number'];this[_0x9363('0x14')]=_0x40de66[_0x9363('0x14')];this[_0x9363('0x15')]=_0x40de66[_0x9363('0x15')];this[_0x9363('0x16')]=_0x40de66['droptime'];this[_0x9363('0x17')]=this[_0x9363('0x16')];this[_0x9363('0x18')]=getSeconds(_0x40de66[_0x9363('0x15')],_0x40de66[_0x9363('0x14')]);this['holdtime']=getSeconds(this[_0x9363('0x16')],_0x40de66[_0x9363('0x15')]);this[_0x9363('0x19')]=0x0;this['queue']=_0x42c73b[_0x9363('0x1a')];this[_0x9363('0x1b')]=_0x42c73b[_0x9363('0x1c')];this[_0x9363('0x1d')]=_0x42c73b['reason'];this[_0x9363('0x1e')]=_0x40de66[_0x9363('0x1e')];this[_0x9363('0x1f')]=_0x40de66[_0x9363('0x1f')];this[_0x9363('0x20')]=_0x40de66[_0x9363('0x20')];this[_0x9363('0x21')]=_0x40de66['recallme'];this[_0x9363('0x22')]=_0x40de66[_0x9363('0x22')];this[_0x9363('0x23')]=_0x40de66[_0x9363('0x23')];this[_0x9363('0x24')]=_0x40de66[_0x9363('0x24')];this[_0x9363('0x25')]=_0x40de66['VoiceQueueId'];this['CampaignId']=_0x40de66[_0x9363('0x26')];this[_0x9363('0x27')]=_0x40de66[_0x9363('0x27')]||'';this['originatecalleridname']=_0x40de66[_0x9363('0x28')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 3de8dea..792c5bd 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(_0x526c68,_0x1b8c4a){var _0x313f6d=function(_0x378584){while(--_0x378584){_0x526c68['push'](_0x526c68['shift']());}};_0x313f6d(++_0x1b8c4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x2332eb,_0x365453){var _0x19c481=function(_0x26d93c){while(--_0x26d93c){_0x2332eb['push'](_0x2332eb['shift']());}};_0x19c481(++_0x365453);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 0cb743b..19fc109 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 _0x4fa9=['moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','receivefax','hangup','syncHangup','originateresponse','prototype','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','.pdf','application/pdf','notify','parse','error','\x20receiveFax\x20','syncOriginateResponse','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','catch','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','bluebird'];(function(_0x4043ce,_0x175dcc){var _0x191365=function(_0x361aa0){while(--_0x361aa0){_0x4043ce['push'](_0x4043ce['shift']());}};_0x191365(++_0x175dcc);}(_0x4fa9,0x163));var _0x94fa=function(_0x1ed470,_0x259f46){_0x1ed470=_0x1ed470-0x0;var _0x190457=_0x4fa9[_0x1ed470];return _0x190457;};'use strict';var util=require(_0x94fa('0x0'));var _=require('lodash');var BPromise=require(_0x94fa('0x1'));var uuid=require('uuid');var moment=require(_0x94fa('0x2'));var path=require(_0x94fa('0x3'));var tiff2pdf=require(_0x94fa('0x4'));var gs=require(_0x94fa('0x5'));var logger=require(_0x94fa('0x6'))(_0x94fa('0x7'));var ami=require('../ami');var rpcDb=require(_0x94fa('0x8'));var Channel=require('./channel');var ut=require(_0x94fa('0x9'));var Action=require(_0x94fa('0xa'));var faxAccount=require(_0x94fa('0xb'));var attachment=require(_0x94fa('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x1ee19b){this[_0x94fa('0xd')]={};this[_0x94fa('0xe')]=_0x1ee19b[_0x94fa('0xe')];this[_0x94fa('0xf')]=_0x1ee19b[_0x94fa('0xf')];this[_0x94fa('0x10')]={};ami['on'](_0x94fa('0x11'),this[_0x94fa('0x12')][_0x94fa('0x13')](this));ami['on'](_0x94fa('0x14'),this[_0x94fa('0x15')][_0x94fa('0x13')](this));ami['on']('newstate',this[_0x94fa('0x16')][_0x94fa('0x13')](this));ami['on'](_0x94fa('0x17'),this[_0x94fa('0x18')][_0x94fa('0x13')](this));ami['on'](_0x94fa('0x19'),this['syncFaxStatus'][_0x94fa('0x13')](this));ami['on'](_0x94fa('0x1a'),this['syncReceiveFax'][_0x94fa('0x13')](this));ami['on'](_0x94fa('0x1b'),this[_0x94fa('0x1c')][_0x94fa('0x13')](this));ami['on'](_0x94fa('0x1d'),this['syncOriginateResponse'][_0x94fa('0x13')](this));}Fax[_0x94fa('0x1e')]['syncNewchannel']=function(_0x3c7857){if(_0x3c7857['context']==='from-voip-provider'){for(var _0x56778b in this[_0x94fa('0xe')]){if(this[_0x94fa('0xe')][_0x94fa('0x1f')](_0x56778b)){if(_0x3c7857[_0x94fa('0x20')]===this[_0x94fa('0xe')][_0x56778b][_0x94fa('0x21')]){this[_0x94fa('0xd')][_0x3c7857[_0x94fa('0x22')]]={};this[_0x94fa('0xd')][_0x3c7857[_0x94fa('0x22')]][_0x94fa('0x23')]=_0x3c7857[_0x94fa('0x23')];this['channels'][_0x3c7857['uniqueid']]['id']=this[_0x94fa('0xe')][_0x56778b]['id'];this[_0x94fa('0xd')][_0x3c7857[_0x94fa('0x22')]][_0x94fa('0x24')]=this[_0x94fa('0xe')][_0x56778b][_0x94fa('0x24')];logger[_0x94fa('0x25')](_0x3c7857[_0x94fa('0x22')],_0x94fa('0x26'));}}}}if(this['actions'][_0x3c7857[_0x94fa('0x22')]]){this['channels'][_0x3c7857[_0x94fa('0x22')]]={};this[_0x94fa('0xd')][_0x3c7857['uniqueid']][_0x94fa('0x23')]=_0x3c7857['channel'];logger['info'](_0x3c7857[_0x94fa('0x22')],_0x94fa('0x26'));}};Fax[_0x94fa('0x1e')][_0x94fa('0x15')]=function(_0x2a9c35){if(this[_0x94fa('0xd')][_0x2a9c35['uniqueid']]){for(var _0x234574 in _0x2a9c35['variable']){if(_0x2a9c35[_0x94fa('0x27')][_0x94fa('0x1f')](_0x234574)){this['channels'][_0x2a9c35[_0x94fa('0x22')]][_0x234574]=_0x2a9c35[_0x94fa('0x28')];}}}};Fax['prototype'][_0x94fa('0x16')]=function(_0x3d04c7){if(this['channels'][_0x3d04c7[_0x94fa('0x22')]]){this[_0x94fa('0xd')][_0x3d04c7[_0x94fa('0x22')]][_0x94fa('0x29')]=_0x3d04c7[_0x94fa('0x29')];this[_0x94fa('0xd')][_0x3d04c7[_0x94fa('0x22')]][_0x94fa('0x2a')]=_0x3d04c7['channelstatedesc'];}};Fax[_0x94fa('0x1e')][_0x94fa('0x18')]=function(_0x31556a){if(this[_0x94fa('0xd')][_0x31556a[_0x94fa('0x22')]]){for(var _0x49add1 in _0x31556a[_0x94fa('0x27')]){if(_0x31556a[_0x94fa('0x27')][_0x94fa('0x1f')](_0x49add1)){this[_0x94fa('0xd')][_0x31556a['uniqueid']][_0x49add1]=_0x31556a[_0x94fa('0x28')];}}}};Fax[_0x94fa('0x1e')][_0x94fa('0x2b')]=function(_0x76d770){if(this[_0x94fa('0xd')][_0x76d770['uniqueid']]){this[_0x94fa('0xd')][_0x76d770[_0x94fa('0x22')]]['operation']=_0x76d770['operation'];this[_0x94fa('0xd')][_0x76d770['uniqueid']][_0x94fa('0x2c')]=_0x76d770[_0x94fa('0x2c')];this[_0x94fa('0xd')][_0x76d770[_0x94fa('0x22')]][_0x94fa('0x21')]=_0x76d770['localstationid'];this[_0x94fa('0xd')][_0x76d770[_0x94fa('0x22')]][_0x94fa('0x2d')]=_0x76d770[_0x94fa('0x2d')];logger[_0x94fa('0x25')](_0x76d770[_0x94fa('0x22')],_0x94fa('0x2e'));}};Fax[_0x94fa('0x1e')]['syncReceiveFax']=function(_0x5d1743){var _0x111b5c=this;if(this['channels'][_0x5d1743[_0x94fa('0x22')]]){var _0x51086f=this[_0x94fa('0xd')][_0x5d1743[_0x94fa('0x22')]]['id'];this[_0x94fa('0xd')][_0x5d1743[_0x94fa('0x22')]][_0x94fa('0x2f')]=_0x5d1743['remotestationid'];this[_0x94fa('0xd')][_0x5d1743['uniqueid']][_0x94fa('0x30')]=_0x5d1743['pagestransferred'];this[_0x94fa('0xd')][_0x5d1743[_0x94fa('0x22')]][_0x94fa('0x21')]=_0x5d1743[_0x94fa('0x21')];this['channels'][_0x5d1743[_0x94fa('0x22')]][_0x94fa('0x31')]=_0x5d1743[_0x94fa('0x31')];this[_0x94fa('0xd')][_0x5d1743[_0x94fa('0x22')]][_0x94fa('0x32')]=_0x5d1743[_0x94fa('0x32')];this[_0x94fa('0xd')][_0x5d1743['uniqueid']][_0x94fa('0x2d')]=_0x5d1743['filename'];this[_0x94fa('0xd')][_0x5d1743[_0x94fa('0x22')]][_0x94fa('0x33')]=_0x5d1743['calleridnum'];if(this[_0x94fa('0xd')][_0x5d1743[_0x94fa('0x22')]][_0x94fa('0x30')]>0x0){tiff2pdf(_0x5d1743[_0x94fa('0x2d')],_0x94fa('0x34'),function(_0x1ba7de){logger[_0x94fa('0x25')](_0x5d1743['uniqueid'],_0x94fa('0x35'),_0x1ba7de[_0x94fa('0x36')]);attachment[_0x94fa('0x37')]({'name':path['parse'](_0x5d1743[_0x94fa('0x2d')])[_0x94fa('0x24')],'basename':path['parse'](_0x5d1743[_0x94fa('0x2d')])[_0x94fa('0x24')]+_0x94fa('0x38'),'type':_0x94fa('0x39')})['then'](function(_0xcd5dec){faxAccount[_0x94fa('0x3a')](_0x51086f,{'from':_0x5d1743['calleridnum'],'mapKey':_0x94fa('0x7'),'body':path[_0x94fa('0x3b')](_0x5d1743[_0x94fa('0x2d')])[_0x94fa('0x24')]+_0x94fa('0x38'),'AttachmentId':_0xcd5dec['id']})['catch'](function(_0x2192c6){logger[_0x94fa('0x3c')](_0x5d1743[_0x94fa('0x22')],'\x20notify\x20',JSON['stringify'](_0x2192c6));});})['catch'](function(_0x40463d){logger[_0x94fa('0x3c')](_0x5d1743[_0x94fa('0x22')],_0x94fa('0x3d'),JSON['stringify'](_0x40463d));});});}logger['info'](_0x5d1743[_0x94fa('0x22')],_0x94fa('0x3d'));}};Fax[_0x94fa('0x1e')][_0x94fa('0x3e')]=function(_0x111874){if(this[_0x94fa('0x10')][_0x111874[_0x94fa('0x22')]]){_['merge'](this[_0x94fa('0xd')][_0x111874[_0x94fa('0x22')]],_[_0x94fa('0x3f')](_0x111874,[_0x94fa('0x40'),'reason']));}};function updateStatus(_0x50ce66){if(_0x50ce66[_0x94fa('0x41')]){faxMessage[_0x94fa('0x42')](_0x50ce66[_0x94fa('0x41')],{'failMessage':_0x94fa('0x43')})[_0x94fa('0x44')](function(_0x2bd602){ut['logger'](_0x94fa('0x45'),_0x2bd602);})[_0x94fa('0x46')](function(_0x2f6fd6){ut[_0x94fa('0x47')](_0x94fa('0x48'),_0x2f6fd6);});}else{ut[_0x94fa('0x47')](_0x94fa('0x49'));}}Fax['prototype'][_0x94fa('0x4a')]=function(_0x6a889b,_0x548781,_0x436f83){var _0xd08770=this;var _0x1546b={};if(_0x548781){_0x1546b={'read':_0x548781};}else{_0x1546b={'failMessage':_0x436f83};}if(this[_0x94fa('0x10')][_0x6a889b][_0x94fa('0x41')]){faxMessage['update'](this[_0x94fa('0x10')][_0x6a889b][_0x94fa('0x41')],_0x1546b)[_0x94fa('0x44')](function(_0x232365){ut[_0x94fa('0x47')]('[Fax][Message][Updated]',_0x232365);})[_0x94fa('0x46')](function(_0x3e453c){ut[_0x94fa('0x47')](_0x94fa('0x4b'),_0x3e453c);})[_0x94fa('0x4c')](function(){delete _0xd08770[_0x94fa('0xd')][_0x6a889b];delete _0xd08770[_0x94fa('0x10')][_0x6a889b];});}else{ut[_0x94fa('0x47')](_0x94fa('0x4d'));delete this[_0x94fa('0xd')][_0x6a889b];delete this[_0x94fa('0x10')][_0x6a889b];}};Fax['prototype']['syncHangup']=function(_0x1e6ef1){var _0x26742e=this;if(this['channels'][_0x1e6ef1[_0x94fa('0x22')]]){if(this[_0x94fa('0x10')][_0x1e6ef1[_0x94fa('0x22')]]){this[_0x94fa('0xd')][_0x1e6ef1[_0x94fa('0x22')]]['id']=this[_0x94fa('0x10')][_0x1e6ef1[_0x94fa('0x22')]]['id'];this[_0x94fa('0xd')][_0x1e6ef1[_0x94fa('0x22')]]['name']=this[_0x94fa('0x10')][_0x1e6ef1[_0x94fa('0x22')]][_0x94fa('0x24')];}logger[_0x94fa('0x25')](_0x1e6ef1[_0x94fa('0x22')],this[_0x94fa('0x10')][_0x1e6ef1['uniqueid']]?_0x94fa('0x4e'):_0x94fa('0x4f'),JSON[_0x94fa('0x50')](this['channels'][_0x1e6ef1[_0x94fa('0x22')]]));if(this[_0x94fa('0x10')][_0x1e6ef1[_0x94fa('0x22')]]){if(this['channels'][_0x1e6ef1[_0x94fa('0x22')]][_0x94fa('0x51')]>0x0&&this[_0x94fa('0xd')][_0x1e6ef1[_0x94fa('0x22')]][_0x94fa('0x19')]===_0x94fa('0x52')){this[_0x94fa('0x4a')](_0x1e6ef1[_0x94fa('0x22')],!![]);}else{this['updateStatus'](_0x1e6ef1[_0x94fa('0x22')],![],this[_0x94fa('0xd')][_0x1e6ef1[_0x94fa('0x22')]][_0x94fa('0x53')]?_0x94fa('0x54')+this[_0x94fa('0xd')][_0x1e6ef1[_0x94fa('0x22')]][_0x94fa('0x53')]:_0x94fa('0x55'));}}}};Fax[_0x94fa('0x1e')][_0x94fa('0x56')]=function(_0x4b8ca5){var _0x2d2007=this;return new BPromise(function(_0x1d11dc,_0x5253f4){_0x2d2007['execOriginate'](_0x4b8ca5,_0x2d2007['faxAccounts'][_0x4b8ca5[_0x94fa('0x57')]])[_0x94fa('0x44')](function(_0x851d88){ut['logger'](_0x94fa('0x58'),_0x851d88);_0x1d11dc(ut[_0x94fa('0x36')]('Fax\x20received'));})[_0x94fa('0x46')](function(_0x163f80){ut['logger']('[Fax][execOriginate][failure]',_0x163f80);updateStatus(_0x4b8ca5);_0x5253f4(ut[_0x94fa('0x36')](_0x94fa('0x59')));});});};Fax[_0x94fa('0x1e')][_0x94fa('0x5a')]=function(_0x789da7){var _0x30ec1b=this;return new BPromise(function(_0x4ccad3,_0x4ebe0c){var _0x4d67ca=_0x30ec1b[_0x94fa('0x5b')](_0x30ec1b[_0x94fa('0xe')][_0x789da7[_0x94fa('0x57')]][_0x94fa('0x5c')],_0x789da7);if(_0x4d67ca[_0x94fa('0x5d')]){_0x4ccad3(ut['message'](_0x94fa('0x5e')));}else{_0x4ebe0c(ut[_0x94fa('0x36')](_0x4d67ca[_0x94fa('0x36')]));}});};function originate(_0x21080a,_0x194f05,_0x2ff4ba){return new BPromise(function(_0x1952bb,_0x3fa287){if(_0x2ff4ba){var _0x32633c=util[_0x94fa('0x5f')](_0x94fa('0x60'),path[_0x94fa('0x3b')](_0x21080a[_0x94fa('0x3')])[_0x94fa('0x24')],_0x21080a[_0x94fa('0x3')]);gs[_0x94fa('0x61')](_0x32633c)['then'](function(){_0x21080a['path']=util[_0x94fa('0x5f')](_0x94fa('0x62'),path['parse'](_0x21080a[_0x94fa('0x3')])[_0x94fa('0x63')],path['parse'](_0x21080a[_0x94fa('0x3')])[_0x94fa('0x24')]);_0x194f05[_0x94fa('0x64')]=_0x21080a['path'];ut[_0x94fa('0x47')](_0x94fa('0x65'),'');ami[_0x94fa('0x66')](ut[_0x94fa('0x67')](_0x21080a,_0x194f05))[_0x94fa('0x44')](function(_0x4c2539){_0x1952bb(_0x4c2539);})[_0x94fa('0x46')](function(_0x51f26f){_0x3fa287(_0x51f26f);});})[_0x94fa('0x46')](function(_0xb11b8a){_0x3fa287(_0xb11b8a);});}else{ami[_0x94fa('0x66')](ut[_0x94fa('0x67')](_0x21080a,_0x194f05))[_0x94fa('0x44')](function(_0xc4bae1){_0x1952bb(_0xc4bae1);})[_0x94fa('0x46')](function(_0x5b8497){_0x3fa287(_0x5b8497);});}});}Fax[_0x94fa('0x1e')][_0x94fa('0x68')]=function(_0x2f1c4a,_0x3f2dce){var _0x585ee3=this;return new BPromise(function(_0x9f13e0,_0x503616){var _0x47fa79=uuid['v4']();var _0x85de09=ut[_0x94fa('0x69')](_0x2f1c4a,_0x3f2dce);_0x585ee3['actions'][_0x47fa79]=new Action(_0x47fa79,_0x3f2dce,_0x2f1c4a);var _0x5878fd=_0x585ee3[_0x94fa('0x10')][_0x47fa79];if(path[_0x94fa('0x3b')](_0x2f1c4a[_0x94fa('0x3')])[_0x94fa('0x6a')]===_0x94fa('0x38')){originate(_0x5878fd,_0x85de09,!![])[_0x94fa('0x44')](function(_0x472e2b){_0x9f13e0(_0x472e2b);})[_0x94fa('0x46')](function(_0x8444c2){_0x503616(_0x8444c2);});}else{originate(_0x5878fd,_0x85de09,![])[_0x94fa('0x44')](function(_0x562d0f){_0x9f13e0(_0x562d0f);})[_0x94fa('0x46')](function(_0xd19ee7){_0x503616(_0xd19ee7);});}});};Fax[_0x94fa('0x1e')][_0x94fa('0x6b')]=function(_0x35a114){return!_[_0x94fa('0x6c')](_0x35a114)&&!_['isNil'](_0x35a114[_0x94fa('0x24')])&&!_['isNil'](_0x35a114[_0x94fa('0x6d')])&&_0x35a114['active']&&!_['isNil'](this['trunks'][util['format'](_0x94fa('0x6e'),_0x35a114[_0x94fa('0x24')])])&&!_[_0x94fa('0x6c')](this[_0x94fa('0xf')][util[_0x94fa('0x5f')](_0x94fa('0x6e'),_0x35a114['name'])][_0x94fa('0x2c')])&&(this[_0x94fa('0xf')][util['format'](_0x94fa('0x6e'),_0x35a114[_0x94fa('0x24')])][_0x94fa('0x2c')]===_0x94fa('0x6f')||this['trunks'][util[_0x94fa('0x5f')](_0x94fa('0x6e'),_0x35a114[_0x94fa('0x24')])][_0x94fa('0x2c')]==='unmonitored');};Fax['prototype'][_0x94fa('0x5b')]=function(_0x16fe36,_0x2476d5){if(!this[_0x94fa('0x6b')](_0x16fe36)){ut['logger'](_0x94fa('0x70'),_[_0x94fa('0x6c')](_0x16fe36)?'':_0x16fe36[_0x94fa('0x24')]+_0x94fa('0x71'));return{'isValid':![],'message':_0x94fa('0x72')};}if(_[_0x94fa('0x6c')](_0x2476d5['fax'])){ut[_0x94fa('0x47')](_0x94fa('0x73'),JSON[_0x94fa('0x50')](_0x2476d5));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x94fa('0x6c')](_0x2476d5['path'])){ut[_0x94fa('0x47')](_0x94fa('0x74'),JSON[_0x94fa('0x50')](_0x2476d5));return{'isValid':![],'message':_0x94fa('0x75')};}return{'isValid':!![],'message':_0x94fa('0x76')};};module['exports']=Fax; \ No newline at end of file +var _0xa582=['addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','merge','pick','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Action','variablesAction'];(function(_0x1ea6cc,_0x1e7652){var _0x12f2b0=function(_0x56ee3c){while(--_0x56ee3c){_0x1ea6cc['push'](_0x1ea6cc['shift']());}};_0x12f2b0(++_0x1e7652);}(_0xa582,0x83));var _0x2a58=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xa582[_0xbd08b4];return _0x314f1e;};'use strict';var util=require('util');var _=require(_0x2a58('0x0'));var BPromise=require(_0x2a58('0x1'));var uuid=require(_0x2a58('0x2'));var moment=require(_0x2a58('0x3'));var path=require(_0x2a58('0x4'));var tiff2pdf=require(_0x2a58('0x5'));var gs=require('./util/gs');var logger=require(_0x2a58('0x6'))(_0x2a58('0x7'));var ami=require('../ami');var rpcDb=require(_0x2a58('0x8'));var Channel=require('./channel');var ut=require(_0x2a58('0x9'));var Action=require(_0x2a58('0xa'));var faxAccount=require(_0x2a58('0xb'));var attachment=require(_0x2a58('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0xa31280){this[_0x2a58('0xd')]={};this[_0x2a58('0xe')]=_0xa31280['faxAccounts'];this[_0x2a58('0xf')]=_0xa31280[_0x2a58('0xf')];this[_0x2a58('0x10')]={};ami['on'](_0x2a58('0x11'),this[_0x2a58('0x12')]['bind'](this));ami['on'](_0x2a58('0x13'),this[_0x2a58('0x14')][_0x2a58('0x15')](this));ami['on'](_0x2a58('0x16'),this['syncNewState'][_0x2a58('0x15')](this));ami['on'](_0x2a58('0x17'),this[_0x2a58('0x18')][_0x2a58('0x15')](this));ami['on'](_0x2a58('0x19'),this[_0x2a58('0x1a')][_0x2a58('0x15')](this));ami['on'](_0x2a58('0x1b'),this[_0x2a58('0x1c')][_0x2a58('0x15')](this));ami['on']('hangup',this[_0x2a58('0x1d')]['bind'](this));ami['on'](_0x2a58('0x1e'),this[_0x2a58('0x1f')][_0x2a58('0x15')](this));}Fax['prototype'][_0x2a58('0x12')]=function(_0x325136){if(_0x325136[_0x2a58('0x20')]===_0x2a58('0x21')){for(var _0x5e55e8 in this['faxAccounts']){if(this[_0x2a58('0xe')][_0x2a58('0x22')](_0x5e55e8)){if(_0x325136[_0x2a58('0x23')]===this[_0x2a58('0xe')][_0x5e55e8]['localstationid']){this[_0x2a58('0xd')][_0x325136[_0x2a58('0x24')]]={};this[_0x2a58('0xd')][_0x325136[_0x2a58('0x24')]][_0x2a58('0x25')]=_0x325136[_0x2a58('0x25')];this[_0x2a58('0xd')][_0x325136[_0x2a58('0x24')]]['id']=this[_0x2a58('0xe')][_0x5e55e8]['id'];this['channels'][_0x325136[_0x2a58('0x24')]][_0x2a58('0x26')]=this['faxAccounts'][_0x5e55e8][_0x2a58('0x26')];logger[_0x2a58('0x27')](_0x325136[_0x2a58('0x24')],_0x2a58('0x28'));}}}}if(this['actions'][_0x325136[_0x2a58('0x24')]]){this['channels'][_0x325136[_0x2a58('0x24')]]={};this[_0x2a58('0xd')][_0x325136['uniqueid']][_0x2a58('0x25')]=_0x325136['channel'];logger['info'](_0x325136[_0x2a58('0x24')],_0x2a58('0x28'));}};Fax[_0x2a58('0x29')]['syncVarSet']=function(_0x5bb973){if(this[_0x2a58('0xd')][_0x5bb973[_0x2a58('0x24')]]){for(var _0x55bd9c in _0x5bb973[_0x2a58('0x2a')]){if(_0x5bb973[_0x2a58('0x2a')][_0x2a58('0x22')](_0x55bd9c)){this[_0x2a58('0xd')][_0x5bb973[_0x2a58('0x24')]][_0x55bd9c]=_0x5bb973[_0x2a58('0x2b')];}}}};Fax[_0x2a58('0x29')]['syncNewState']=function(_0x3f1362){if(this[_0x2a58('0xd')][_0x3f1362[_0x2a58('0x24')]]){this[_0x2a58('0xd')][_0x3f1362[_0x2a58('0x24')]][_0x2a58('0x2c')]=_0x3f1362[_0x2a58('0x2c')];this[_0x2a58('0xd')][_0x3f1362[_0x2a58('0x24')]][_0x2a58('0x2d')]=_0x3f1362[_0x2a58('0x2d')];}};Fax[_0x2a58('0x29')][_0x2a58('0x18')]=function(_0x241b44){if(this['channels'][_0x241b44[_0x2a58('0x24')]]){for(var _0x4d4d53 in _0x241b44[_0x2a58('0x2a')]){if(_0x241b44[_0x2a58('0x2a')][_0x2a58('0x22')](_0x4d4d53)){this[_0x2a58('0xd')][_0x241b44['uniqueid']][_0x4d4d53]=_0x241b44[_0x2a58('0x2b')];}}}};Fax[_0x2a58('0x29')][_0x2a58('0x1a')]=function(_0x3f5b73){if(this[_0x2a58('0xd')][_0x3f5b73[_0x2a58('0x24')]]){this['channels'][_0x3f5b73[_0x2a58('0x24')]][_0x2a58('0x2e')]=_0x3f5b73[_0x2a58('0x2e')];this[_0x2a58('0xd')][_0x3f5b73[_0x2a58('0x24')]][_0x2a58('0x2f')]=_0x3f5b73['status'];this['channels'][_0x3f5b73[_0x2a58('0x24')]][_0x2a58('0x30')]=_0x3f5b73[_0x2a58('0x30')];this[_0x2a58('0xd')][_0x3f5b73[_0x2a58('0x24')]][_0x2a58('0x31')]=_0x3f5b73[_0x2a58('0x31')];logger[_0x2a58('0x27')](_0x3f5b73[_0x2a58('0x24')],_0x2a58('0x32'));}};Fax[_0x2a58('0x29')][_0x2a58('0x1c')]=function(_0x2dbd4e){var _0x39f2b7=this;if(this[_0x2a58('0xd')][_0x2dbd4e[_0x2a58('0x24')]]){var _0x2110c6=this[_0x2a58('0xd')][_0x2dbd4e[_0x2a58('0x24')]]['id'];this[_0x2a58('0xd')][_0x2dbd4e[_0x2a58('0x24')]]['remotestationid']=_0x2dbd4e[_0x2a58('0x33')];this[_0x2a58('0xd')][_0x2dbd4e['uniqueid']][_0x2a58('0x34')]=_0x2dbd4e[_0x2a58('0x34')];this[_0x2a58('0xd')][_0x2dbd4e[_0x2a58('0x24')]][_0x2a58('0x30')]=_0x2dbd4e[_0x2a58('0x30')];this[_0x2a58('0xd')][_0x2dbd4e[_0x2a58('0x24')]][_0x2a58('0x35')]=_0x2dbd4e[_0x2a58('0x35')];this[_0x2a58('0xd')][_0x2dbd4e[_0x2a58('0x24')]][_0x2a58('0x36')]=_0x2dbd4e['transferrate'];this[_0x2a58('0xd')][_0x2dbd4e['uniqueid']][_0x2a58('0x31')]=_0x2dbd4e['filename'];this[_0x2a58('0xd')][_0x2dbd4e[_0x2a58('0x24')]][_0x2a58('0x37')]=_0x2dbd4e['calleridnum'];if(this[_0x2a58('0xd')][_0x2dbd4e[_0x2a58('0x24')]][_0x2a58('0x34')]>0x0){tiff2pdf(_0x2dbd4e[_0x2a58('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0x271aa8){logger[_0x2a58('0x27')](_0x2dbd4e[_0x2a58('0x24')],_0x2a58('0x38'),_0x271aa8['message']);attachment[_0x2a58('0x39')]({'name':path[_0x2a58('0x3a')](_0x2dbd4e[_0x2a58('0x31')])[_0x2a58('0x26')],'basename':path[_0x2a58('0x3a')](_0x2dbd4e[_0x2a58('0x31')])[_0x2a58('0x26')]+_0x2a58('0x3b'),'type':_0x2a58('0x3c')})[_0x2a58('0x3d')](function(_0x511da5){faxAccount[_0x2a58('0x3e')](_0x2110c6,{'from':_0x2dbd4e[_0x2a58('0x37')],'mapKey':_0x2a58('0x7'),'body':path[_0x2a58('0x3a')](_0x2dbd4e[_0x2a58('0x31')])[_0x2a58('0x26')]+_0x2a58('0x3b'),'AttachmentId':_0x511da5['id']})[_0x2a58('0x3f')](function(_0x562f80){logger[_0x2a58('0x40')](_0x2dbd4e[_0x2a58('0x24')],_0x2a58('0x41'),JSON[_0x2a58('0x42')](_0x562f80));});})[_0x2a58('0x3f')](function(_0x1f17cb){logger[_0x2a58('0x40')](_0x2dbd4e[_0x2a58('0x24')],'\x20receiveFax\x20',JSON[_0x2a58('0x42')](_0x1f17cb));});});}logger[_0x2a58('0x27')](_0x2dbd4e[_0x2a58('0x24')],'\x20receiveFax\x20');}};Fax[_0x2a58('0x29')][_0x2a58('0x1f')]=function(_0x3beb88){if(this[_0x2a58('0x10')][_0x3beb88[_0x2a58('0x24')]]){_[_0x2a58('0x43')](this['channels'][_0x3beb88[_0x2a58('0x24')]],_[_0x2a58('0x44')](_0x3beb88,['response',_0x2a58('0x45')]));}};function updateStatus(_0x1cdfd9){if(_0x1cdfd9['AttachmentId']){faxMessage[_0x2a58('0x46')](_0x1cdfd9[_0x2a58('0x47')],{'failMessage':_0x2a58('0x48')})[_0x2a58('0x3d')](function(_0x2e65de){ut[_0x2a58('0x49')](_0x2a58('0x4a'),_0x2e65de);})[_0x2a58('0x3f')](function(_0x231b42){ut[_0x2a58('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x231b42);});}else{ut[_0x2a58('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype']['updateStatus']=function(_0x2db4ea,_0x3d7dd2,_0x23cc4b){var _0xf571e1=this;var _0x3d9e42={};if(_0x3d7dd2){_0x3d9e42={'read':_0x3d7dd2};}else{_0x3d9e42={'failMessage':_0x23cc4b};}if(this[_0x2a58('0x10')][_0x2db4ea][_0x2a58('0x47')]){faxMessage['update'](this['actions'][_0x2db4ea]['AttachmentId'],_0x3d9e42)[_0x2a58('0x3d')](function(_0xc1f220){ut[_0x2a58('0x49')]('[Fax][Message][Updated]',_0xc1f220);})['catch'](function(_0x58be84){ut[_0x2a58('0x49')]('[Fax][Message][NoUpdate1]',_0x58be84);})[_0x2a58('0x4b')](function(){delete _0xf571e1[_0x2a58('0xd')][_0x2db4ea];delete _0xf571e1[_0x2a58('0x10')][_0x2db4ea];});}else{ut['logger'](_0x2a58('0x4c'));delete this[_0x2a58('0xd')][_0x2db4ea];delete this[_0x2a58('0x10')][_0x2db4ea];}};Fax[_0x2a58('0x29')]['syncHangup']=function(_0x12e8e0){var _0x3d92b0=this;if(this[_0x2a58('0xd')][_0x12e8e0[_0x2a58('0x24')]]){if(this[_0x2a58('0x10')][_0x12e8e0[_0x2a58('0x24')]]){this[_0x2a58('0xd')][_0x12e8e0['uniqueid']]['id']=this['actions'][_0x12e8e0[_0x2a58('0x24')]]['id'];this[_0x2a58('0xd')][_0x12e8e0[_0x2a58('0x24')]][_0x2a58('0x26')]=this[_0x2a58('0x10')][_0x12e8e0[_0x2a58('0x24')]]['name'];}logger[_0x2a58('0x27')](_0x12e8e0['uniqueid'],this[_0x2a58('0x10')][_0x12e8e0[_0x2a58('0x24')]]?'\x20hangup\x20sendFile\x20':_0x2a58('0x4d'),JSON[_0x2a58('0x42')](this['channels'][_0x12e8e0['uniqueid']]));if(this['actions'][_0x12e8e0[_0x2a58('0x24')]]){if(this['channels'][_0x12e8e0[_0x2a58('0x24')]]['faxpages']>0x0&&this[_0x2a58('0xd')][_0x12e8e0[_0x2a58('0x24')]][_0x2a58('0x19')]===_0x2a58('0x4e')){this[_0x2a58('0x4f')](_0x12e8e0[_0x2a58('0x24')],!![]);}else{this['updateStatus'](_0x12e8e0[_0x2a58('0x24')],![],this[_0x2a58('0xd')][_0x12e8e0['uniqueid']][_0x2a58('0x50')]?_0x2a58('0x51')+this['channels'][_0x12e8e0[_0x2a58('0x24')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x2a58('0x29')][_0x2a58('0x52')]=function(_0x562e72){var _0x4c560c=this;return new BPromise(function(_0x13e2d8,_0x4cc22e){_0x4c560c[_0x2a58('0x53')](_0x562e72,_0x4c560c['faxAccounts'][_0x562e72[_0x2a58('0x54')]])[_0x2a58('0x3d')](function(_0x6de1a8){ut[_0x2a58('0x49')](_0x2a58('0x55'),_0x6de1a8);_0x13e2d8(ut[_0x2a58('0x56')](_0x2a58('0x57')));})['catch'](function(_0x43907d){ut['logger']('[Fax][execOriginate][failure]',_0x43907d);updateStatus(_0x562e72);_0x4cc22e(ut[_0x2a58('0x56')]('Fax\x20failed'));});});};Fax['prototype'][_0x2a58('0x58')]=function(_0x277c33){var _0x5a5fc6=this;return new BPromise(function(_0x320270,_0x24eef8){var _0x4ef618=_0x5a5fc6['checkTrunk'](_0x5a5fc6[_0x2a58('0xe')][_0x277c33[_0x2a58('0x54')]][_0x2a58('0x59')],_0x277c33);if(_0x4ef618[_0x2a58('0x5a')]){_0x320270(ut[_0x2a58('0x56')](_0x2a58('0x5b')));}else{_0x24eef8(ut['message'](_0x4ef618['message']));}});};function originate(_0x4fe871,_0x7460b3,_0x13229b){return new BPromise(function(_0x5a69c0,_0x4d0dae){if(_0x13229b){var _0x29e7cc=util[_0x2a58('0x5c')](_0x2a58('0x5d'),path[_0x2a58('0x3a')](_0x4fe871['path'])[_0x2a58('0x26')],_0x4fe871[_0x2a58('0x4')]);gs[_0x2a58('0x5e')](_0x29e7cc)[_0x2a58('0x3d')](function(){_0x4fe871[_0x2a58('0x4')]=util['format'](_0x2a58('0x5f'),path[_0x2a58('0x3a')](_0x4fe871['path'])['dir'],path['parse'](_0x4fe871['path'])['name']);_0x7460b3[_0x2a58('0x60')]=_0x4fe871[_0x2a58('0x4')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x2a58('0x61')](ut[_0x2a58('0x62')](_0x4fe871,_0x7460b3))[_0x2a58('0x3d')](function(_0x5b9df0){_0x5a69c0(_0x5b9df0);})[_0x2a58('0x3f')](function(_0x14f758){_0x4d0dae(_0x14f758);});})['catch'](function(_0x5aca12){_0x4d0dae(_0x5aca12);});}else{ami['Action'](ut[_0x2a58('0x62')](_0x4fe871,_0x7460b3))['then'](function(_0x1cdfc2){_0x5a69c0(_0x1cdfc2);})[_0x2a58('0x3f')](function(_0x3c94b9){_0x4d0dae(_0x3c94b9);});}});}Fax[_0x2a58('0x29')][_0x2a58('0x53')]=function(_0x4032d0,_0x2c9d26){var _0x1a25e0=this;return new BPromise(function(_0x42ecd7,_0x2efce4){var _0x422f00=uuid['v4']();var _0x2a1201=ut[_0x2a58('0x63')](_0x4032d0,_0x2c9d26);_0x1a25e0[_0x2a58('0x10')][_0x422f00]=new Action(_0x422f00,_0x2c9d26,_0x4032d0);var _0x716b88=_0x1a25e0[_0x2a58('0x10')][_0x422f00];if(path[_0x2a58('0x3a')](_0x4032d0['path'])[_0x2a58('0x64')]==='.pdf'){originate(_0x716b88,_0x2a1201,!![])[_0x2a58('0x3d')](function(_0x4f72f3){_0x42ecd7(_0x4f72f3);})[_0x2a58('0x3f')](function(_0x3e8402){_0x2efce4(_0x3e8402);});}else{originate(_0x716b88,_0x2a1201,![])['then'](function(_0x2eb16f){_0x42ecd7(_0x2eb16f);})[_0x2a58('0x3f')](function(_0x354941){_0x2efce4(_0x354941);});}});};Fax['prototype'][_0x2a58('0x65')]=function(_0x3ec883){return!_[_0x2a58('0x66')](_0x3ec883)&&!_[_0x2a58('0x66')](_0x3ec883[_0x2a58('0x26')])&&!_[_0x2a58('0x66')](_0x3ec883[_0x2a58('0x67')])&&_0x3ec883['active']&&!_[_0x2a58('0x66')](this[_0x2a58('0xf')][util['format']('SIP/%s',_0x3ec883[_0x2a58('0x26')])])&&!_[_0x2a58('0x66')](this[_0x2a58('0xf')][util[_0x2a58('0x5c')]('SIP/%s',_0x3ec883[_0x2a58('0x26')])][_0x2a58('0x2f')])&&(this[_0x2a58('0xf')][util[_0x2a58('0x5c')](_0x2a58('0x68'),_0x3ec883[_0x2a58('0x26')])][_0x2a58('0x2f')]===_0x2a58('0x69')||this[_0x2a58('0xf')][util[_0x2a58('0x5c')](_0x2a58('0x68'),_0x3ec883[_0x2a58('0x26')])][_0x2a58('0x2f')]===_0x2a58('0x6a'));};Fax[_0x2a58('0x29')][_0x2a58('0x6b')]=function(_0x1d715b,_0x511bf7){if(!this[_0x2a58('0x65')](_0x1d715b)){ut[_0x2a58('0x49')](_0x2a58('0x6c'),_[_0x2a58('0x66')](_0x1d715b)?'':_0x1d715b[_0x2a58('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x2a58('0x6d')};}if(_[_0x2a58('0x66')](_0x511bf7[_0x2a58('0x7')])){ut['logger'](_0x2a58('0x6e'),JSON[_0x2a58('0x42')](_0x511bf7));return{'isValid':![],'message':_0x2a58('0x6f')};}if(_[_0x2a58('0x66')](_0x511bf7[_0x2a58('0x4')])){ut['logger'](_0x2a58('0x70'),JSON[_0x2a58('0x42')](_0x511bf7));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x2a58('0x71')};};module[_0x2a58('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f9969bc..8f39fb7 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 _0x9f4f=['../rpc/faxAccount','error','notify','resolve','then','catch','[Notify]\x20','util','bluebird','preview','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9f4f,0xf9));var _0xf9f4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9f4f[_0x32f7d7];return _0x133d09;};'use strict';var util=require(_0xf9f4('0x0'));var BPromise=require(_0xf9f4('0x1'));var logger=require('../../../config/logger')(_0xf9f4('0x2'));var _=require(_0xf9f4('0x3'));var faxAccount=require(_0xf9f4('0x4'));function loggerCatch(_0x217cc6){return function(_0x123515){logger[_0xf9f4('0x5')](_0x217cc6,util['inspect'](_0x123515,{'showHidden':![],'depth':null}));};}exports[_0xf9f4('0x6')]=function(_0x7753ee,_0x2c0bb4){return BPromise[_0xf9f4('0x7')]()[_0xf9f4('0x8')](faxAccount[_0xf9f4('0x6')](_0x7753ee,_0x2c0bb4))[_0xf9f4('0x9')](loggerCatch(_0xf9f4('0xa')));}; \ No newline at end of file +var _0x998c=['bluebird','../../../config/logger','preview','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x34eb7a,_0xceb6d5){var _0x5bef41=function(_0x3ac31e){while(--_0x3ac31e){_0x34eb7a['push'](_0x34eb7a['shift']());}};_0x5bef41(++_0xceb6d5);}(_0x998c,0xbe));var _0xc998=function(_0x469d01,_0x18c899){_0x469d01=_0x469d01-0x0;var _0x5078d3=_0x998c[_0x469d01];return _0x5078d3;};'use strict';var util=require('util');var BPromise=require(_0xc998('0x0'));var logger=require(_0xc998('0x1'))(_0xc998('0x2'));var _=require('lodash');var faxAccount=require(_0xc998('0x3'));function loggerCatch(_0x35ef46){return function(_0x55e7c9){logger[_0xc998('0x4')](_0x35ef46,util[_0xc998('0x5')](_0x55e7c9,{'showHidden':![],'depth':null}));};}exports[_0xc998('0x6')]=function(_0x2f0086,_0x59c1a3){return BPromise[_0xc998('0x7')]()[_0xc998('0x8')](faxAccount[_0xc998('0x6')](_0x2f0086,_0x59c1a3))[_0xc998('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index d290a18..524c08d 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 _0xefb5=['info','Exec\x20gs','inspect','../../../../config/logger','fax','bluebird','execute'];(function(_0x59d3c4,_0x3dc10e){var _0x34f717=function(_0x46a514){while(--_0x46a514){_0x59d3c4['push'](_0x59d3c4['shift']());}};_0x34f717(++_0x3dc10e);}(_0xefb5,0x184));var _0x5efb=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0xefb5[_0x510b98];return _0x45e775;};'use strict';var util=require('util');var logger=require(_0x5efb('0x0'))(_0x5efb('0x1'));var BPromise=require(_0x5efb('0x2'));var exec=require('child_process')['exec'];exports[_0x5efb('0x3')]=function(_0x34037){return new BPromise(function(_0x1b734f,_0x48c61d){exec(_0x34037,function(_0x173f07,_0x21d178,_0x59d641){logger[_0x5efb('0x4')](_0x5efb('0x5'),_0x21d178);if(_0x173f07){logger[_0x5efb('0x4')](_0x5efb('0x5'),'\x20Error\x20:',util[_0x5efb('0x6')](_0x173f07,{'showHidden':![],'depth':null}),_0x21d178,_0x59d641);_0x48c61d(_0x173f07);}_0x1b734f(_0x21d178);});});}; \ No newline at end of file +var _0x77ee=['info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','bluebird','exec','execute'];(function(_0x295811,_0x2825f4){var _0x147146=function(_0x939636){while(--_0x939636){_0x295811['push'](_0x295811['shift']());}};_0x147146(++_0x2825f4);}(_0x77ee,0x1ec));var _0xe77e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x77ee[_0x397e5f];return _0x5302b8;};'use strict';var util=require('util');var logger=require(_0xe77e('0x0'))('fax');var BPromise=require(_0xe77e('0x1'));var exec=require('child_process')[_0xe77e('0x2')];exports[_0xe77e('0x3')]=function(_0x279ee5){return new BPromise(function(_0x24fb1d,_0x1c755d){exec(_0x279ee5,function(_0x3bc188,_0x5b53a9,_0xa672ed){logger[_0xe77e('0x4')](_0xe77e('0x5'),_0x5b53a9);if(_0x3bc188){logger[_0xe77e('0x4')](_0xe77e('0x5'),_0xe77e('0x6'),util[_0xe77e('0x7')](_0x3bc188,{'showHidden':![],'depth':null}),_0x5b53a9,_0xa672ed);_0x1c755d(_0x3bc188);}_0x24fb1d(_0x5b53a9);});});}; \ 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 c6a6ef5..23522ad 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 _0xfbf0=['\x22%s\x22\x20<%s>','lodash','moment','message','info','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','uniqueid','originate','xcally-motion-fax','from-sip'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0xfbf0,0x141));var _0x0fbf=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xfbf0[_0x1eda20];return _0x31b953;};'use strict';var util=require('util');var _=require(_0x0fbf('0x0'));var moment=require(_0x0fbf('0x1'));var logger=require('../../../../config/logger')('fax');exports[_0x0fbf('0x2')]=function(_0x15f376){return{'message':_0x15f376};};exports['logger']=function(_0x200f9c,_0x4a244a){logger[_0x0fbf('0x3')](_0x200f9c,util['inspect'](_0x4a244a,{'showHidden':![],'depth':null}));};exports[_0x0fbf('0x4')]=function(_0x29c1cb,_0x5210d3){var _0x31427a={'XMF-ECM':_0x5210d3[_0x0fbf('0x5')],'XMF-HEADERINFO':_0x5210d3[_0x0fbf('0x6')],'XMF-MINRATE':_0x5210d3[_0x0fbf('0x7')],'XMF-MAXRATE':_0x5210d3[_0x0fbf('0x8')],'XMF-MODEM':util[_0x0fbf('0x9')](_0x0fbf('0xa'),_0x5210d3[_0x0fbf('0xb')]),'XMF-GATEWAY':_0x5210d3[_0x0fbf('0xc')],'XMF-FAXDETECT':_0x5210d3[_0x0fbf('0xd')],'XMF-T38TIMEOUT':_0x5210d3['t38timeout'],'XMF-LOCALSTATIONID':_0x5210d3[_0x0fbf('0xe')],'XMF-PATH':_0x29c1cb['path']};return _0x31427a;};exports['variablesAction']=function(_0x45e96e,_0xc8c71c){return{'actionid':_0x45e96e[_0x0fbf('0xf')],'action':_0x0fbf('0x10'),'channel':_0x45e96e['channel'],'Exten':_0x0fbf('0x11'),'Context':_0x0fbf('0x12'),'Priority':'1','callerid':util[_0x0fbf('0x9')](_0x0fbf('0x13'),_0x45e96e[_0x0fbf('0x6')]?_0x45e96e[_0x0fbf('0x6')]:'',_0x45e96e[_0x0fbf('0xe')]),'variable':_0xc8c71c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x45e96e[_0x0fbf('0xf')]};}; \ No newline at end of file +var _0x396d=['inspect','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','channel','from-sip','\x22%s\x22\x20<%s>','moment','../../../../config/logger','fax'];(function(_0x4e75c5,_0x5eeb93){var _0x872171=function(_0x137973){while(--_0x137973){_0x4e75c5['push'](_0x4e75c5['shift']());}};_0x872171(++_0x5eeb93);}(_0x396d,0xf4));var _0xd396=function(_0x50356a,_0x560d28){_0x50356a=_0x50356a-0x0;var _0x17e753=_0x396d[_0x50356a];return _0x17e753;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xd396('0x0'));var logger=require(_0xd396('0x1'))(_0xd396('0x2'));exports['message']=function(_0x150e71){return{'message':_0x150e71};};exports['logger']=function(_0x3091be,_0x378925){logger['info'](_0x3091be,util[_0xd396('0x3')](_0x378925,{'showHidden':![],'depth':null}));};exports[_0xd396('0x4')]=function(_0x5f2fa8,_0x89ef64){var _0xecacd5={'XMF-ECM':_0x89ef64[_0xd396('0x5')],'XMF-HEADERINFO':_0x89ef64[_0xd396('0x6')],'XMF-MINRATE':_0x89ef64[_0xd396('0x7')],'XMF-MAXRATE':_0x89ef64['maxrate'],'XMF-MODEM':util[_0xd396('0x8')](_0xd396('0x9'),_0x89ef64['modem']),'XMF-GATEWAY':_0x89ef64[_0xd396('0xa')],'XMF-FAXDETECT':_0x89ef64[_0xd396('0xb')],'XMF-T38TIMEOUT':_0x89ef64['t38timeout'],'XMF-LOCALSTATIONID':_0x89ef64[_0xd396('0xc')],'XMF-PATH':_0x5f2fa8[_0xd396('0xd')]};return _0xecacd5;};exports[_0xd396('0xe')]=function(_0xdd811d,_0x15d316){return{'actionid':_0xdd811d[_0xd396('0xf')],'action':'originate','channel':_0xdd811d[_0xd396('0x10')],'Exten':'xcally-motion-fax','Context':_0xd396('0x11'),'Priority':'1','callerid':util[_0xd396('0x8')](_0xd396('0x12'),_0xdd811d[_0xd396('0x6')]?_0xdd811d['headerinfo']:'',_0xdd811d[_0xd396('0xc')]),'variable':_0x15d316,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xdd811d[_0xd396('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 30a4e86..04ef0c1 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 _0x7c93=['util','moment','./server','./realtime','./report','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x7c93,0xf8));var _0x37c9=function(_0x5da201,_0x24b5c3){_0x5da201=_0x5da201-0x0;var _0x51f615=_0x7c93[_0x5da201];return _0x51f615;};'use strict';var BPromise=require('bluebird');var util=require(_0x37c9('0x0'));var moment=require(_0x37c9('0x1'));var server=require(_0x37c9('0x2'));var Realtime=require(_0x37c9('0x3'));var Report=require(_0x37c9('0x4'));var Acw=require('./acw');var Trigger=require(_0x37c9('0x5'));var Dialer=require(_0x37c9('0x6'));var Preview=require('./preview');var Fax=require(_0x37c9('0x7'));var user=require(_0x37c9('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x37c9('0x9'));var trunk=require(_0x37c9('0xa'));var trigger=require(_0x37c9('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0x37c9('0xc'));var campaign=require(_0x37c9('0xd'));var voiceExtension=require(_0x37c9('0xe'));var faxAccount=require(_0x37c9('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x37c9('0x10'));var sugarcrm=require(_0x37c9('0x11'));var freshdesk=require(_0x37c9('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x37c9('0x13'));var vtiger=require(_0x37c9('0x14'));var freshsales=require(_0x37c9('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x37c9('0x16')](_0x37c9('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x37c9('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x37c9('0x18')]()[_0x37c9('0x19')](user[_0x37c9('0x1a')]())[_0x37c9('0x19')](realtime[_0x37c9('0x1b')]())[_0x37c9('0x19')](user[_0x37c9('0x1c')]())[_0x37c9('0x19')](realtime['initTelephones']())[_0x37c9('0x19')](trunk[_0x37c9('0x1d')]())[_0x37c9('0x19')](realtime[_0x37c9('0x1e')]())[_0x37c9('0x19')](voiceQueue[_0x37c9('0x1f')]())[_0x37c9('0x19')](realtime[_0x37c9('0x20')]())[_0x37c9('0x19')](trigger[_0x37c9('0x21')]())[_0x37c9('0x19')](realtime['initTriggers']())[_0x37c9('0x19')](template['getTemplates']())[_0x37c9('0x19')](realtime[_0x37c9('0x22')]())[_0x37c9('0x19')](zendesk['getZendeskAccounts']())[_0x37c9('0x19')](realtime[_0x37c9('0x23')]())[_0x37c9('0x19')](salesforce[_0x37c9('0x24')]())[_0x37c9('0x19')](realtime[_0x37c9('0x25')]())[_0x37c9('0x19')](sugarcrm[_0x37c9('0x26')]())['then'](realtime[_0x37c9('0x27')]())['then'](freshdesk['getFreshdeskAccounts']())[_0x37c9('0x19')](realtime[_0x37c9('0x28')]())[_0x37c9('0x19')](desk['getDeskAccounts']())[_0x37c9('0x19')](realtime[_0x37c9('0x29')]())[_0x37c9('0x19')](zoho[_0x37c9('0x2a')]())[_0x37c9('0x19')](realtime[_0x37c9('0x2b')]())[_0x37c9('0x19')](vtiger['getVtigerAccounts']())[_0x37c9('0x19')](realtime[_0x37c9('0x2c')]())[_0x37c9('0x19')](freshsales[_0x37c9('0x2d')]())[_0x37c9('0x19')](realtime[_0x37c9('0x2e')]())[_0x37c9('0x19')](servicenow['getServicenowAccounts']())[_0x37c9('0x19')](realtime['initServicenowAccounts']())[_0x37c9('0x19')](dynamics365[_0x37c9('0x2f')]())[_0x37c9('0x19')](realtime[_0x37c9('0x30')]())['then'](campaign[_0x37c9('0x31')]())['then'](realtime[_0x37c9('0x32')]())['then'](voiceExtension['getVoiceExtensions']())[_0x37c9('0x19')](realtime['initVoiceExtensions']())[_0x37c9('0x19')](faxAccount[_0x37c9('0x33')]())[_0x37c9('0x19')](realtime[_0x37c9('0x34')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x37c9('0x18')]()['then'](voiceQueueReport[_0x37c9('0x35')]())[_0x37c9('0x19')](realtime[_0x37c9('0x36')]())[_0x37c9('0x19')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x37c9('0x37')]())[_0x37c9('0x19')](cmHopperHistory[_0x37c9('0x38')]())[_0x37c9('0x19')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x37c9('0x39')]())['then'](realtime[_0x37c9('0x3a')]())['then'](function(_0x80853f){})[_0x37c9('0x3b')](function(_0x269a17){console[_0x37c9('0x3c')](_0x269a17);});}function main(){return server[_0x37c9('0x3d')](realtime,preview,fax)[_0x37c9('0x19')](function(_0x28b02d){return initRealtime();})[_0x37c9('0x19')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x4ab681){console[_0x37c9('0x3c')](_0x4ab681);});}main(); \ No newline at end of file +var _0x52c4=['initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','listen','sync','bluebird','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers'];(function(_0x5e0cc9,_0x258efe){var _0x3b265d=function(_0x47c9a2){while(--_0x47c9a2){_0x5e0cc9['push'](_0x5e0cc9['shift']());}};_0x3b265d(++_0x258efe);}(_0x52c4,0x132));var _0x452c=function(_0x3f74e1,_0x2d9a18){_0x3f74e1=_0x3f74e1-0x0;var _0x2df189=_0x52c4[_0x3f74e1];return _0x2df189;};'use strict';var BPromise=require(_0x452c('0x0'));var util=require(_0x452c('0x1'));var moment=require('moment');var server=require(_0x452c('0x2'));var Realtime=require(_0x452c('0x3'));var Report=require(_0x452c('0x4'));var Acw=require(_0x452c('0x5'));var Trigger=require(_0x452c('0x6'));var Dialer=require(_0x452c('0x7'));var Preview=require(_0x452c('0x8'));var Fax=require(_0x452c('0x9'));var user=require(_0x452c('0xa'));var voiceQueue=require(_0x452c('0xb'));var voiceQueueReport=require(_0x452c('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x452c('0xd'));var trigger=require(_0x452c('0xe'));var template=require(_0x452c('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x452c('0x10'));var faxAccount=require(_0x452c('0x11'));var zendesk=require(_0x452c('0x12'));var salesforce=require(_0x452c('0x13'));var sugarcrm=require(_0x452c('0x14'));var freshdesk=require(_0x452c('0x15'));var desk=require(_0x452c('0x16'));var zoho=require(_0x452c('0x17'));var vtiger=require(_0x452c('0x18'));var freshsales=require(_0x452c('0x19'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x452c('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x452c('0x1b')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x452c('0x1b')](_0x452c('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x452c('0x1d')]()[_0x452c('0x1e')](user[_0x452c('0x1f')]())[_0x452c('0x1e')](realtime[_0x452c('0x20')]())[_0x452c('0x1e')](user['getTelephones']())[_0x452c('0x1e')](realtime[_0x452c('0x21')]())['then'](trunk[_0x452c('0x22')]())['then'](realtime['initTrunks']())['then'](voiceQueue[_0x452c('0x23')]())[_0x452c('0x1e')](realtime[_0x452c('0x24')]())[_0x452c('0x1e')](trigger[_0x452c('0x25')]())[_0x452c('0x1e')](realtime[_0x452c('0x26')]())[_0x452c('0x1e')](template['getTemplates']())[_0x452c('0x1e')](realtime[_0x452c('0x27')]())[_0x452c('0x1e')](zendesk[_0x452c('0x28')]())[_0x452c('0x1e')](realtime[_0x452c('0x29')]())[_0x452c('0x1e')](salesforce[_0x452c('0x2a')]())[_0x452c('0x1e')](realtime[_0x452c('0x2b')]())[_0x452c('0x1e')](sugarcrm['getSugarcrmAccounts']())[_0x452c('0x1e')](realtime['initSugarcrmAccounts']())[_0x452c('0x1e')](freshdesk[_0x452c('0x2c')]())[_0x452c('0x1e')](realtime[_0x452c('0x2d')]())[_0x452c('0x1e')](desk[_0x452c('0x2e')]())[_0x452c('0x1e')](realtime[_0x452c('0x2f')]())[_0x452c('0x1e')](zoho[_0x452c('0x30')]())[_0x452c('0x1e')](realtime[_0x452c('0x31')]())[_0x452c('0x1e')](vtiger[_0x452c('0x32')]())[_0x452c('0x1e')](realtime['initVtigerAccounts']())[_0x452c('0x1e')](freshsales[_0x452c('0x33')]())[_0x452c('0x1e')](realtime[_0x452c('0x34')]())[_0x452c('0x1e')](servicenow[_0x452c('0x35')]())[_0x452c('0x1e')](realtime[_0x452c('0x36')]())[_0x452c('0x1e')](dynamics365['getDynamics365Accounts']())[_0x452c('0x1e')](realtime['initDynamics365Accounts']())['then'](campaign[_0x452c('0x37')]())[_0x452c('0x1e')](realtime[_0x452c('0x38')]())[_0x452c('0x1e')](voiceExtension['getVoiceExtensions']())[_0x452c('0x1e')](realtime[_0x452c('0x39')]())[_0x452c('0x1e')](faxAccount[_0x452c('0x3a')]())['then'](realtime[_0x452c('0x3b')]())[_0x452c('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x452c('0x1d')]()[_0x452c('0x1e')](voiceQueueReport[_0x452c('0x3c')]())['then'](realtime[_0x452c('0x3d')]())[_0x452c('0x1e')](cmHopperHistory[_0x452c('0x3e')]())[_0x452c('0x1e')](realtime[_0x452c('0x3f')]())[_0x452c('0x1e')](cmHopperHistory['getCampaignHopperHistory']())[_0x452c('0x1e')](realtime[_0x452c('0x40')]())[_0x452c('0x1e')](voiceCallReport[_0x452c('0x41')]())[_0x452c('0x1e')](realtime['initVoiceCallReports']())[_0x452c('0x1e')](function(_0x160e46){})[_0x452c('0x42')](function(_0x4ecf0d){console['log'](_0x4ecf0d);});}function main(){return server[_0x452c('0x43')](realtime,preview,fax)[_0x452c('0x1e')](function(_0x267d94){return initRealtime();})[_0x452c('0x1e')](function(){return initParams();})[_0x452c('0x1e')](function(){report[_0x452c('0x44')]();setInterval(initRealtime,0x1388);})[_0x452c('0x42')](function(_0x275c2d){console['log'](_0x275c2d);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index bbf883a..68d7932 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x44ecef,_0x5ba3a1){var _0x9af612=function(_0x76a16e){while(--_0x76a16e){_0x44ecef['push'](_0x44ecef['shift']());}};_0x9af612(++_0x5ba3a1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0xcb91[_0x2650e9];return _0x3511c8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x3def85,_0x2fd098){var _0x118ac4=function(_0x1b6f74){while(--_0x1b6f74){_0x3def85['push'](_0x3def85['shift']());}};_0x118ac4(++_0x2fd098);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index b588f88..8db2485 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 _0x286b=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x9f57ca,_0xede913){var _0x171560=function(_0x5e696c){while(--_0x5e696c){_0x9f57ca['push'](_0x9f57ca['shift']());}};_0x171560(++_0xede913);}(_0x286b,0x1b0));var _0xb286=function(_0x4f2fc7,_0x1b07e7){_0x4f2fc7=_0x4f2fc7-0x0;var _0x13b98e=_0x286b[_0x4f2fc7];return _0x13b98e;};'use strict';function Campaign(_0x4f3f37){this['id']=_0x4f3f37['id']||0x0;this[_0xb286('0x0')]=_0x4f3f37[_0xb286('0x0')]||'';this['type']=_0x4f3f37[_0xb286('0x1')]||_0xb286('0x2');this[_0xb286('0x3')]=0x0;this[_0xb286('0x4')]=0x0;this[_0xb286('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xb286('0x6')]='';this[_0xb286('0x7')]=!![];this[_0xb286('0x8')]=_0x4f3f37[_0xb286('0x8')];this[_0xb286('0x9')]=_0x4f3f37[_0xb286('0x9')];this[_0xb286('0xa')]=_0x4f3f37[_0xb286('0xa')]||null;this['dialGlobalInterval']=_0x4f3f37[_0xb286('0xb')]?_0x4f3f37[_0xb286('0xb')]:null;this[_0xb286('0xc')]=_0x4f3f37['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x4f3f37[_0xb286('0xd')];this[_0xb286('0xe')]=_0x4f3f37[_0xb286('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x4f3f37['dialCongestionMaxRetry'];this[_0xb286('0xf')]=_0x4f3f37[_0xb286('0xf')];this[_0xb286('0x10')]=_0x4f3f37['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x4f3f37[_0xb286('0x11')];this[_0xb286('0x12')]=_0x4f3f37[_0xb286('0x12')];this[_0xb286('0x13')]=_0x4f3f37['dialNoAnswerRetryFrequency'];this[_0xb286('0x14')]=_0x4f3f37[_0xb286('0x14')];this[_0xb286('0x15')]=_0x4f3f37['dialNoSuchNumberMaxRetry']||0x3;this[_0xb286('0x16')]=_0x4f3f37[_0xb286('0x16')]||0x96;this[_0xb286('0x17')]=_0x4f3f37[_0xb286('0x17')]||0x3;this[_0xb286('0x18')]=_0x4f3f37[_0xb286('0x18')]||0x96;this[_0xb286('0x19')]=_0x4f3f37[_0xb286('0x19')]||0x3;this[_0xb286('0x1a')]=_0x4f3f37['dialAbandonedRetryFrequency']||0x96;this[_0xb286('0x1b')]=_0x4f3f37[_0xb286('0x1b')]||0x3;this[_0xb286('0x1c')]=_0x4f3f37[_0xb286('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x4f3f37[_0xb286('0x1d')]||0x3;this[_0xb286('0x1e')]=_0x4f3f37[_0xb286('0x1e')]||0x96;this[_0xb286('0x1f')]=_0x4f3f37[_0xb286('0x1f')]||_0xb286('0x20');this[_0xb286('0x21')]=_0x4f3f37['dialPrefix']||undefined;this[_0xb286('0x22')]=_0x4f3f37[_0xb286('0x22')]||undefined;this[_0xb286('0x23')]=_0x4f3f37['dialCutDigit']||undefined;this['TrunkBackup']=_0x4f3f37[_0xb286('0x24')]?_0x4f3f37['TrunkBackup']:undefined;this[_0xb286('0x25')]=_0x4f3f37[_0xb286('0x25')]?_0x4f3f37['Trunk']:undefined;this[_0xb286('0x26')]=_0x4f3f37[_0xb286('0x26')]?_0x4f3f37[_0xb286('0x26')]:undefined;this[_0xb286('0x27')]=_0x4f3f37['SquareProject']?_0x4f3f37['SquareProject']:undefined;this[_0xb286('0x28')]=_0x4f3f37['SquareProject']?_0x4f3f37[_0xb286('0x27')][_0xb286('0x0')]:undefined;this[_0xb286('0x29')]=_0x4f3f37['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x4f3f37['dialAMDInitialSilence'];this[_0xb286('0x2a')]=_0x4f3f37[_0xb286('0x2a')];this[_0xb286('0x2b')]=_0x4f3f37[_0xb286('0x2b')];this[_0xb286('0x2c')]=_0x4f3f37[_0xb286('0x2c')];this[_0xb286('0x2d')]=_0x4f3f37[_0xb286('0x2d')];this['dialAMDBetweenWordsSilence']=_0x4f3f37[_0xb286('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x4f3f37[_0xb286('0x2f')];this['dialAMDSilenceThreshold']=_0x4f3f37[_0xb286('0x30')];this[_0xb286('0x31')]=_0x4f3f37['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0xe66f=['type','campaign','originated','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0x3b3d0a,_0x29ba02){var _0x1dac91=function(_0x254c14){while(--_0x254c14){_0x3b3d0a['push'](_0x3b3d0a['shift']());}};_0x1dac91(++_0x29ba02);}(_0xe66f,0x1af));var _0xfe66=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xe66f[_0x29d94e];return _0x106237;};'use strict';function Campaign(_0x20ff62){this['id']=_0x20ff62['id']||0x0;this['name']=_0x20ff62[_0xfe66('0x0')]||'';this[_0xfe66('0x1')]=_0x20ff62[_0xfe66('0x1')]||_0xfe66('0x2');this[_0xfe66('0x3')]=0x0;this['temp']=0x0;this[_0xfe66('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xfe66('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xfe66('0x6')]=_0x20ff62['active'];this[_0xfe66('0x7')]=_0x20ff62['limitCalls'];this[_0xfe66('0x8')]=_0x20ff62[_0xfe66('0x8')]||null;this['dialGlobalInterval']=_0x20ff62['dialGlobalInterval']?_0x20ff62['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x20ff62['dialOriginateCallerIdName'];this[_0xfe66('0x9')]=_0x20ff62['dialOriginateCallerIdNumber'];this[_0xfe66('0xa')]=_0x20ff62[_0xfe66('0xa')]||0x1e;this[_0xfe66('0xb')]=_0x20ff62[_0xfe66('0xb')];this['dialCongestionRetryFrequency']=_0x20ff62[_0xfe66('0xc')];this[_0xfe66('0xd')]=_0x20ff62[_0xfe66('0xd')];this[_0xfe66('0xe')]=_0x20ff62[_0xfe66('0xe')];this[_0xfe66('0xf')]=_0x20ff62[_0xfe66('0xf')];this[_0xfe66('0x10')]=_0x20ff62[_0xfe66('0x10')];this[_0xfe66('0x11')]=_0x20ff62[_0xfe66('0x11')];this[_0xfe66('0x12')]=_0x20ff62[_0xfe66('0x12')]||0x3;this[_0xfe66('0x13')]=_0x20ff62[_0xfe66('0x13')]||0x96;this['dialDropMaxRetry']=_0x20ff62[_0xfe66('0x14')]||0x3;this[_0xfe66('0x15')]=_0x20ff62[_0xfe66('0x15')]||0x96;this['dialAbandonedMaxRetry']=_0x20ff62['dialAbandonedMaxRetry']||0x3;this[_0xfe66('0x16')]=_0x20ff62[_0xfe66('0x16')]||0x96;this[_0xfe66('0x17')]=_0x20ff62[_0xfe66('0x17')]||0x3;this[_0xfe66('0x18')]=_0x20ff62['dialMachineRetryFrequency']||0x96;this[_0xfe66('0x19')]=_0x20ff62[_0xfe66('0x19')]||0x3;this[_0xfe66('0x1a')]=_0x20ff62[_0xfe66('0x1a')]||0x96;this[_0xfe66('0x1b')]=_0x20ff62[_0xfe66('0x1b')]||_0xfe66('0x1c');this['dialPrefix']=_0x20ff62[_0xfe66('0x1d')]||undefined;this[_0xfe66('0x1e')]=_0x20ff62['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xfe66('0x1f')]=_0x20ff62[_0xfe66('0x1f')]||undefined;this[_0xfe66('0x20')]=_0x20ff62['TrunkBackup']?_0x20ff62[_0xfe66('0x20')]:undefined;this['Trunk']=_0x20ff62['Trunk']?_0x20ff62[_0xfe66('0x21')]:undefined;this['Interval']=_0x20ff62['Interval']?_0x20ff62[_0xfe66('0x22')]:undefined;this[_0xfe66('0x23')]=_0x20ff62[_0xfe66('0x23')]?_0x20ff62[_0xfe66('0x23')]:undefined;this[_0xfe66('0x24')]=_0x20ff62[_0xfe66('0x23')]?_0x20ff62[_0xfe66('0x23')][_0xfe66('0x0')]:undefined;this[_0xfe66('0x25')]=_0x20ff62[_0xfe66('0x25')]||![];this[_0xfe66('0x26')]=_0x20ff62[_0xfe66('0x26')];this[_0xfe66('0x27')]=_0x20ff62[_0xfe66('0x27')];this[_0xfe66('0x28')]=_0x20ff62[_0xfe66('0x28')];this[_0xfe66('0x29')]=_0x20ff62[_0xfe66('0x29')];this['dialAMDMinWordLength']=_0x20ff62[_0xfe66('0x2a')];this[_0xfe66('0x2b')]=_0x20ff62[_0xfe66('0x2b')];this[_0xfe66('0x2c')]=_0x20ff62[_0xfe66('0x2c')];this[_0xfe66('0x2d')]=_0x20ff62[_0xfe66('0x2d')];this[_0xfe66('0x2e')]=_0x20ff62[_0xfe66('0x2e')];}module[_0xfe66('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 2c35355..4dc6500 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 _0xb4b6=['lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transferconnectedlinenum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answertime','endtime','unmanaged','abandoned'];(function(_0x464124,_0x1d7c6b){var _0x4360ba=function(_0x25326a){while(--_0x25326a){_0x464124['push'](_0x464124['shift']());}};_0x4360ba(++_0x1d7c6b);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x463a00,_0x49ee1f){_0x463a00=_0x463a00-0x0;var _0xedb8e2=_0xb4b6[_0x463a00];return _0xedb8e2;};'use strict';function Channel(){this['starttime']=null;this[_0x6b4b('0x0')]='';this[_0x6b4b('0x1')]='';this[_0x6b4b('0x2')]=0x0;this[_0x6b4b('0x3')]='';this[_0x6b4b('0x4')]=undefined;this[_0x6b4b('0x5')]=undefined;this[_0x6b4b('0x6')]=0x0;this[_0x6b4b('0x7')]='';this[_0x6b4b('0x8')]=0x0;this['linkedid']=0x0;this[_0x6b4b('0x9')]=0x0;this['answered']=![];this[_0x6b4b('0xa')]=null;this[_0x6b4b('0xb')]=null;this[_0x6b4b('0xc')]=![];this[_0x6b4b('0xd')]=![];this[_0x6b4b('0xe')]='';this['lastdata']='';this[_0x6b4b('0xf')]=0x0;this[_0x6b4b('0x10')]=0x0;this[_0x6b4b('0x11')]=0x0;this[_0x6b4b('0x12')]=null;this[_0x6b4b('0x13')]=null;this[_0x6b4b('0x14')]=null;this[_0x6b4b('0x15')]=![];this[_0x6b4b('0x16')]=null;this['queue']=null;this[_0x6b4b('0x17')]=[];this['transfercalleridnum']=undefined;this[_0x6b4b('0x18')]=undefined;this[_0x6b4b('0x19')]=undefined;this[_0x6b4b('0x1a')]=0x0;}module[_0x6b4b('0x1b')]=Channel; \ No newline at end of file +var _0x8f1a=['calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','linkedid','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','queue','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel'];(function(_0xf4c2ee,_0x3aeb88){var _0x325e78=function(_0x387899){while(--_0x387899){_0xf4c2ee['push'](_0xf4c2ee['shift']());}};_0x325e78(++_0x3aeb88);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x5a1e02,_0x158d17){_0x5a1e02=_0x5a1e02-0x0;var _0x325dc9=_0x8f1a[_0x5a1e02];return _0x325dc9;};'use strict';function Channel(){this[_0xa8f1('0x0')]=null;this[_0xa8f1('0x1')]='';this[_0xa8f1('0x2')]='';this[_0xa8f1('0x3')]=0x0;this[_0xa8f1('0x4')]='';this[_0xa8f1('0x5')]=undefined;this[_0xa8f1('0x6')]=undefined;this[_0xa8f1('0x7')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0xa8f1('0x8')]=0x0;this['exten']=0x0;this[_0xa8f1('0x9')]=![];this[_0xa8f1('0xa')]=null;this['endtime']=null;this[_0xa8f1('0xb')]=![];this[_0xa8f1('0xc')]=![];this[_0xa8f1('0xd')]='';this[_0xa8f1('0xe')]='';this[_0xa8f1('0xf')]=0x0;this[_0xa8f1('0x10')]=0x0;this[_0xa8f1('0x11')]=0x0;this[_0xa8f1('0x12')]=null;this['tag']=null;this[_0xa8f1('0x13')]=null;this[_0xa8f1('0x14')]=![];this['monitorFilename']=null;this[_0xa8f1('0x15')]=null;this['monitors']=[];this[_0xa8f1('0x16')]=undefined;this[_0xa8f1('0x17')]=undefined;this[_0xa8f1('0x18')]=undefined;this['mohtime']=0x0;}module[_0xa8f1('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index fbc0051..514ba72 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 _0x912c=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x3c73ca,_0x3b40fb){var _0x434b2b=function(_0x19a51e){while(--_0x19a51e){_0x3c73ca['push'](_0x3c73ca['shift']());}};_0x434b2b(++_0x3b40fb);}(_0x912c,0x10c));var _0xc912=function(_0x3dd92b,_0x4d1139){_0x3dd92b=_0x3dd92b-0x0;var _0x5e1d23=_0x912c[_0x3dd92b];return _0x5e1d23;};'use strict';function DeskAccount(_0x156f3f){this['id']=_0x156f3f['id']||0x0;this[_0xc912('0x0')]=_0x156f3f[_0xc912('0x0')]||'';this[_0xc912('0x1')]=_0x156f3f['username']||'';this['remoteUri']=_0x156f3f[_0xc912('0x2')]||'';this['authType']=_0x156f3f[_0xc912('0x3')]||'';this[_0xc912('0x4')]=_0x156f3f['password']||'';this[_0xc912('0x5')]=_0x156f3f['consumerKey']||'';this[_0xc912('0x6')]=_0x156f3f[_0xc912('0x6')]||'';this[_0xc912('0x7')]=_0x156f3f[_0xc912('0x7')]||'';this[_0xc912('0x8')]=_0x156f3f[_0xc912('0x8')]||'';this[_0xc912('0x9')]=_0x156f3f[_0xc912('0x9')]||'';this[_0xc912('0xa')]=_0x156f3f[_0xc912('0xa')]||'';this[_0xc912('0xb')]=_0x156f3f[_0xc912('0xb')]||{};}module[_0xc912('0xc')]=DeskAccount; \ No newline at end of file +var _0x2142=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x4df057,_0x44991f){var _0x524786=function(_0x3df3cc){while(--_0x3df3cc){_0x4df057['push'](_0x4df057['shift']());}};_0x524786(++_0x44991f);}(_0x2142,0x144));var _0x2214=function(_0x3900fc,_0x5444b3){_0x3900fc=_0x3900fc-0x0;var _0x2c3039=_0x2142[_0x3900fc];return _0x2c3039;};'use strict';function DeskAccount(_0x140350){this['id']=_0x140350['id']||0x0;this[_0x2214('0x0')]=_0x140350[_0x2214('0x0')]||'';this[_0x2214('0x1')]=_0x140350[_0x2214('0x1')]||'';this[_0x2214('0x2')]=_0x140350[_0x2214('0x2')]||'';this['authType']=_0x140350[_0x2214('0x3')]||'';this[_0x2214('0x4')]=_0x140350['password']||'';this[_0x2214('0x5')]=_0x140350['consumerKey']||'';this[_0x2214('0x6')]=_0x140350['consumerSecret']||'';this[_0x2214('0x7')]=_0x140350['token']||'';this[_0x2214('0x8')]=_0x140350[_0x2214('0x8')]||'';this[_0x2214('0x9')]=_0x140350['type']||'';this[_0x2214('0xa')]=_0x140350['serverUrl']||'';this['Configurations']=_0x140350[_0x2214('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 4273e3a..86273fe 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 _0x1339=['serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0xde82,_0x5c550f){var _0x3a30f6=function(_0x24f5a5){while(--_0x24f5a5){_0xde82['push'](_0xde82['shift']());}};_0x3a30f6(++_0x5c550f);}(_0x1339,0x1ed));var _0x9133=function(_0x5b3af9,_0x225902){_0x5b3af9=_0x5b3af9-0x0;var _0x53e73a=_0x1339[_0x5b3af9];return _0x53e73a;};'use strict';function Dynamics365Account(_0x421620){this['id']=_0x421620['id']||0x0;this['name']=_0x421620[_0x9133('0x0')]||'';this[_0x9133('0x1')]=_0x421620[_0x9133('0x1')]||'';this[_0x9133('0x2')]=_0x421620[_0x9133('0x2')]||'';this[_0x9133('0x3')]=_0x421620[_0x9133('0x3')]||'';this[_0x9133('0x4')]=_0x421620['tenantId']||'';this[_0x9133('0x5')]=_0x421620[_0x9133('0x5')]||'';this[_0x9133('0x6')]=_0x421620['clientSecret']||{};this[_0x9133('0x7')]=_0x421620[_0x9133('0x7')]||'';this[_0x9133('0x8')]=_0x421620[_0x9133('0x8')]||{};}module[_0x9133('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xa9e0=['clientSecret','serverUrl','Configurations','name','password','remoteUri','tenantId','clientId'];(function(_0x49ee57,_0x245d93){var _0x25fdbc=function(_0x1383df){while(--_0x1383df){_0x49ee57['push'](_0x49ee57['shift']());}};_0x25fdbc(++_0x245d93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';function Dynamics365Account(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['username']=_0x1f0015['username']||'';this[_0x0a9e('0x1')]=_0x1f0015['password']||'';this[_0x0a9e('0x2')]=_0x1f0015[_0x0a9e('0x2')]||'';this[_0x0a9e('0x3')]=_0x1f0015[_0x0a9e('0x3')]||'';this[_0x0a9e('0x4')]=_0x1f0015['clientId']||'';this[_0x0a9e('0x5')]=_0x1f0015[_0x0a9e('0x5')]||{};this[_0x0a9e('0x6')]=_0x1f0015['serverUrl']||'';this['Configurations']=_0x1f0015[_0x0a9e('0x7')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 1a90d4b..45bb3ba 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 _0xd4c0=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29'];(function(_0x26cd3d,_0x350e6d){var _0x2604af=function(_0x792d91){while(--_0x792d91){_0x26cd3d['push'](_0x26cd3d['shift']());}};_0x2604af(++_0x350e6d);}(_0xd4c0,0x78));var _0x0d4c=function(_0x51a02e,_0x4e9947){_0x51a02e=_0x51a02e-0x0;var _0x57242f=_0xd4c0[_0x51a02e];return _0x57242f;};'use strict';function FaxAccount(_0x1fa305){this['id']=_0x1fa305['id']||0x0;this[_0x0d4c('0x0')]=_0x1fa305[_0x0d4c('0x0')]||'';this['description']=_0x1fa305[_0x0d4c('0x1')];this[_0x0d4c('0x2')]=_0x1fa305[_0x0d4c('0x2')];this[_0x0d4c('0x3')]=_0x1fa305[_0x0d4c('0x3')];this[_0x0d4c('0x4')]=_0x1fa305[_0x0d4c('0x4')];this[_0x0d4c('0x5')]=_0x1fa305[_0x0d4c('0x5')]||0x960;this['maxrate']=_0x1fa305['maxrate']||0x3840;this['modem']=_0x1fa305[_0x0d4c('0x6')]||_0x0d4c('0x7');this[_0x0d4c('0x8')]=_0x1fa305[_0x0d4c('0x8')]||'no';this[_0x0d4c('0x9')]=_0x1fa305[_0x0d4c('0x9')]||'no';this[_0x0d4c('0xa')]=_0x1fa305[_0x0d4c('0xa')]||0x1388;this[_0x0d4c('0xb')]=_0x1fa305[_0x0d4c('0xb')]||_0x0d4c('0xc');this[_0x0d4c('0xd')]=_0x1fa305[_0x0d4c('0xd')]?_0x1fa305[_0x0d4c('0xd')]:undefined;this[_0x0d4c('0xe')]=_0x1fa305[_0x0d4c('0xe')];this['key']=_0x1fa305[_0x0d4c('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x08a3=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x2e2334,_0x8ffa8b){var _0x31991c=function(_0x14c2bd){while(--_0x14c2bd){_0x2e2334['push'](_0x2e2334['shift']());}};_0x31991c(++_0x8ffa8b);}(_0x08a3,0x13a));var _0x308a=function(_0x4c883b,_0x589199){_0x4c883b=_0x4c883b-0x0;var _0x359a5a=_0x08a3[_0x4c883b];return _0x359a5a;};'use strict';function FaxAccount(_0x4f9368){this['id']=_0x4f9368['id']||0x0;this[_0x308a('0x0')]=_0x4f9368[_0x308a('0x0')]||'';this['description']=_0x4f9368[_0x308a('0x1')];this[_0x308a('0x2')]=_0x4f9368['ecm'];this['headerinfo']=_0x4f9368[_0x308a('0x3')];this[_0x308a('0x4')]=_0x4f9368[_0x308a('0x4')];this['minrate']=_0x4f9368[_0x308a('0x5')]||0x960;this[_0x308a('0x6')]=_0x4f9368[_0x308a('0x6')]||0x3840;this[_0x308a('0x7')]=_0x4f9368[_0x308a('0x7')]||_0x308a('0x8');this[_0x308a('0x9')]=_0x4f9368[_0x308a('0x9')]||'no';this[_0x308a('0xa')]=_0x4f9368[_0x308a('0xa')]||'no';this['t38timeout']=_0x4f9368[_0x308a('0xb')]||0x1388;this[_0x308a('0xc')]=_0x4f9368[_0x308a('0xc')]||_0x308a('0xd');this[_0x308a('0xe')]=_0x4f9368[_0x308a('0xe')]?_0x4f9368[_0x308a('0xe')]:undefined;this[_0x308a('0xf')]=_0x4f9368['ListId'];this['key']=_0x4f9368[_0x308a('0x10')];}module[_0x308a('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ca2ddd0..28d6806 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 _0xc871=['apiKey','token','remoteUri','Configurations','exports','name','username'];(function(_0x437c88,_0x324838){var _0x1a79cf=function(_0x2951fe){while(--_0x2951fe){_0x437c88['push'](_0x437c88['shift']());}};_0x1a79cf(++_0x324838);}(_0xc871,0x8a));var _0x1c87=function(_0x7e065c,_0x5ca9cc){_0x7e065c=_0x7e065c-0x0;var _0x300201=_0xc871[_0x7e065c];return _0x300201;};'use strict';function FreshdeskAccount(_0x13580d){this['id']=_0x13580d['id']||0x0;this[_0x1c87('0x0')]=_0x13580d[_0x1c87('0x0')]||'';this['username']=_0x13580d[_0x1c87('0x1')]||'';this[_0x1c87('0x2')]=_0x13580d[_0x1c87('0x3')]||'';this[_0x1c87('0x4')]=_0x13580d[_0x1c87('0x4')]||'';this['serverUrl']=_0x13580d['serverUrl']||'';this[_0x1c87('0x5')]=_0x13580d[_0x1c87('0x5')]||{};}module[_0x1c87('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x0dab=['Configurations','exports','name','username','remoteUri','serverUrl'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0dab,0x7a));var _0xb0da=function(_0x46ec26,_0x19f1fe){_0x46ec26=_0x46ec26-0x0;var _0x568fa9=_0x0dab[_0x46ec26];return _0x568fa9;};'use strict';function FreshdeskAccount(_0x2abb29){this['id']=_0x2abb29['id']||0x0;this[_0xb0da('0x0')]=_0x2abb29[_0xb0da('0x0')]||'';this[_0xb0da('0x1')]=_0x2abb29[_0xb0da('0x1')]||'';this['apiKey']=_0x2abb29['token']||'';this[_0xb0da('0x2')]=_0x2abb29['remoteUri']||'';this[_0xb0da('0x3')]=_0x2abb29[_0xb0da('0x3')]||'';this[_0xb0da('0x4')]=_0x2abb29[_0xb0da('0x4')]||{};}module[_0xb0da('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 9f591ee..3e48dc6 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 _0x280b=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x4f5dee,_0x1050ce){var _0x3d1c2a=function(_0x1c1d0c){while(--_0x1c1d0c){_0x4f5dee['push'](_0x4f5dee['shift']());}};_0x3d1c2a(++_0x1050ce);}(_0x280b,0xce));var _0xb280=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x280b[_0x2f5ac5];return _0x37c9a8;};'use strict';function FreshsalesAccount(_0x545f75){this['id']=_0x545f75['id']||0x0;this[_0xb280('0x0')]=_0x545f75['name']||'';this[_0xb280('0x1')]=_0x545f75[_0xb280('0x1')]||'';this[_0xb280('0x2')]=_0x545f75[_0xb280('0x3')]||'';this[_0xb280('0x4')]=_0x545f75[_0xb280('0x4')]||'';this[_0xb280('0x5')]=_0x545f75[_0xb280('0x5')]||'';this[_0xb280('0x6')]=_0x545f75['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x06f4=['name','username','remoteUri','serverUrl','Configurations'];(function(_0xd7d69e,_0x20dcf0){var _0x2cb332=function(_0x2535e5){while(--_0x2535e5){_0xd7d69e['push'](_0xd7d69e['shift']());}};_0x2cb332(++_0x20dcf0);}(_0x06f4,0x136));var _0x406f=function(_0x492a97,_0x4ec9f1){_0x492a97=_0x492a97-0x0;var _0x2000ca=_0x06f4[_0x492a97];return _0x2000ca;};'use strict';function FreshsalesAccount(_0xaf75d2){this['id']=_0xaf75d2['id']||0x0;this[_0x406f('0x0')]=_0xaf75d2['name']||'';this[_0x406f('0x1')]=_0xaf75d2[_0x406f('0x1')]||'';this['apiKey']=_0xaf75d2['token']||'';this[_0x406f('0x2')]=_0xaf75d2['remoteUri']||'';this[_0x406f('0x3')]=_0xaf75d2[_0x406f('0x3')]||'';this[_0x406f('0x4')]=_0xaf75d2[_0x406f('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 c8a1ff7..7f230a2 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 _0xc389=['exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','mohtime','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context'];(function(_0x489725,_0x2b2485){var _0x1a9cae=function(_0x20edc2){while(--_0x20edc2){_0x489725['push'](_0x489725['shift']());}};_0x1a9cae(++_0x2b2485);}(_0xc389,0x1ed));var _0x9c38=function(_0x350799,_0x5d4ae2){_0x350799=_0x350799-0x0;var _0x270c8e=_0xc389[_0x350799];return _0x270c8e;};'use strict';function QueueReport(){this[_0x9c38('0x0')]=_0x9c38('0x1');this[_0x9c38('0x2')]='';this[_0x9c38('0x3')]='';this[_0x9c38('0x4')]='';this[_0x9c38('0x5')]='';this[_0x9c38('0x6')]=null;this[_0x9c38('0x7')]=null;this[_0x9c38('0x8')]=0x1;this[_0x9c38('0x9')]=0x1;this[_0x9c38('0xa')]=![];this[_0x9c38('0xb')]=null;this['queuecallercomplete']=![];this[_0x9c38('0xc')]=null;this[_0x9c38('0xd')]=![];this[_0x9c38('0xe')]=null;this[_0x9c38('0xf')]=0x1;this[_0x9c38('0x10')]='';this['connectedlinenum']='';this[_0x9c38('0x11')]='';this[_0x9c38('0x12')]='';this[_0x9c38('0x13')]='';this[_0x9c38('0x14')]='';this[_0x9c38('0x15')]='';this[_0x9c38('0x16')]=0x0;this[_0x9c38('0x17')]=![];this[_0x9c38('0x18')]='';this[_0x9c38('0x19')]='voice';this[_0x9c38('0x1a')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x736c=['queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','exports','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x736c,0xa4));var _0xc736=function(_0x409b87,_0x5ef488){_0x409b87=_0x409b87-0x0;var _0x46fa68=_0x736c[_0x409b87];return _0x46fa68;};'use strict';function QueueReport(){this[_0xc736('0x0')]=_0xc736('0x1');this[_0xc736('0x2')]='';this['calleridnum']='';this[_0xc736('0x3')]='';this[_0xc736('0x4')]='';this[_0xc736('0x5')]=null;this[_0xc736('0x6')]=null;this[_0xc736('0x7')]=0x1;this['count']=0x1;this[_0xc736('0x8')]=![];this[_0xc736('0x9')]=null;this[_0xc736('0xa')]=![];this[_0xc736('0xb')]=null;this[_0xc736('0xc')]=![];this['queuecallerexitAt']=null;this[_0xc736('0xd')]=0x1;this[_0xc736('0xe')]='';this[_0xc736('0xf')]='';this[_0xc736('0x10')]='';this[_0xc736('0x11')]='';this[_0xc736('0x12')]='';this[_0xc736('0x13')]='';this['priority']='';this[_0xc736('0x14')]=0x0;this[_0xc736('0x15')]=![];this[_0xc736('0x16')]='';this[_0xc736('0x17')]='voice';this['mohtime']=0x0;this['variables']={};}module[_0xc736('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 012f212..6e0967d 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 _0x5386=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5386,0x1e1));var _0x6538=function(_0x3a3fcc,_0x38afb3){_0x3a3fcc=_0x3a3fcc-0x0;var _0xe16438=_0x5386[_0x3a3fcc];return _0xe16438;};'use strict';function SalesforceAccount(_0x3b55a5){this['id']=_0x3b55a5['id']||0x0;this[_0x6538('0x0')]=_0x3b55a5[_0x6538('0x0')]||'';this[_0x6538('0x1')]=_0x3b55a5['username']||'';this[_0x6538('0x2')]=_0x3b55a5[_0x6538('0x2')]||'';this[_0x6538('0x3')]=_0x3b55a5[_0x6538('0x3')]||'';this[_0x6538('0x4')]=_0x3b55a5[_0x6538('0x4')]||'';this[_0x6538('0x5')]=_0x3b55a5[_0x6538('0x5')]||'';this['securityToken']=_0x3b55a5[_0x6538('0x6')]||'';this['type']=_0x3b55a5[_0x6538('0x7')]||_0x6538('0x8');this[_0x6538('0x9')]=_0x3b55a5[_0x6538('0x9')]||'';this[_0x6538('0xa')]=_0x3b55a5[_0x6538('0xa')]||{};}module[_0x6538('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x1a85=['clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','password','clientId'];(function(_0x58ceb9,_0x5601df){var _0x3d0ff5=function(_0x3a79d0){while(--_0x3a79d0){_0x58ceb9['push'](_0x58ceb9['shift']());}};_0x3d0ff5(++_0x5601df);}(_0x1a85,0x178));var _0x51a8=function(_0x1621dd,_0x172229){_0x1621dd=_0x1621dd-0x0;var _0x3b0046=_0x1a85[_0x1621dd];return _0x3b0046;};'use strict';function SalesforceAccount(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'';this['remoteUri']=_0x4570ac['remoteUri']||'';this[_0x51a8('0x2')]=_0x4570ac[_0x51a8('0x2')]||'';this[_0x51a8('0x3')]=_0x4570ac['clientId']||'';this[_0x51a8('0x4')]=_0x4570ac['clientSecret']||'';this[_0x51a8('0x5')]=_0x4570ac['securityToken']||'';this[_0x51a8('0x6')]=_0x4570ac[_0x51a8('0x6')]||'integrationTab';this[_0x51a8('0x7')]=_0x4570ac['serverUrl']||'';this['Configurations']=_0x4570ac[_0x51a8('0x8')]||{};}module[_0x51a8('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 8b783c9..a83f165 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 _0x2fd3=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x5c619e,_0x1bccdf){var _0x445cf8=function(_0x2eaa64){while(--_0x2eaa64){_0x5c619e['push'](_0x5c619e['shift']());}};_0x445cf8(++_0x1bccdf);}(_0x2fd3,0x162));var _0x32fd=function(_0x39f5d8,_0x17cf8e){_0x39f5d8=_0x39f5d8-0x0;var _0x72fa0=_0x2fd3[_0x39f5d8];return _0x72fa0;};'use strict';function ServicenowAccount(_0xfca7ce){this['id']=_0xfca7ce['id']||0x0;this[_0x32fd('0x0')]=_0xfca7ce[_0x32fd('0x0')]||'';this['username']=_0xfca7ce[_0x32fd('0x1')]||'';this[_0x32fd('0x2')]=_0xfca7ce[_0x32fd('0x2')]||'';this[_0x32fd('0x3')]=_0xfca7ce[_0x32fd('0x3')]||'';this[_0x32fd('0x4')]=_0xfca7ce[_0x32fd('0x4')]||'';this[_0x32fd('0x5')]=_0xfca7ce['Configurations']||{};}module[_0x32fd('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xf648=['Configurations','exports','name','username','remoteUri','serverUrl'];(function(_0x4ec060,_0x1d32c3){var _0x42c903=function(_0x4620a9){while(--_0x4620a9){_0x4ec060['push'](_0x4ec060['shift']());}};_0x42c903(++_0x1d32c3);}(_0xf648,0xb6));var _0x8f64=function(_0x1c0b0f,_0x2b0322){_0x1c0b0f=_0x1c0b0f-0x0;var _0x53c46d=_0xf648[_0x1c0b0f];return _0x53c46d;};'use strict';function ServicenowAccount(_0x2dd7d2){this['id']=_0x2dd7d2['id']||0x0;this[_0x8f64('0x0')]=_0x2dd7d2[_0x8f64('0x0')]||'';this['username']=_0x2dd7d2[_0x8f64('0x1')]||'';this['password']=_0x2dd7d2['password']||'';this[_0x8f64('0x2')]=_0x2dd7d2[_0x8f64('0x2')]||'';this[_0x8f64('0x3')]=_0x2dd7d2[_0x8f64('0x3')]||'';this[_0x8f64('0x4')]=_0x2dd7d2[_0x8f64('0x4')]||{};}module[_0x8f64('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 173afbd..b89fc25 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 _0x87e3=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0xeb0c0e,_0x3bcd80){var _0x54bcb7=function(_0x2d6508){while(--_0x2d6508){_0xeb0c0e['push'](_0xeb0c0e['shift']());}};_0x54bcb7(++_0x3bcd80);}(_0x87e3,0x15e));var _0x387e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x87e3[_0x4243a3];return _0x1b2a33;};'use strict';function SugarcrmAccount(_0x40fba1){this['id']=_0x40fba1['id']||0x0;this['name']=_0x40fba1[_0x387e('0x0')]||'';this[_0x387e('0x1')]=_0x40fba1[_0x387e('0x1')]||'';this[_0x387e('0x2')]=_0x40fba1[_0x387e('0x2')]||'';this[_0x387e('0x3')]=_0x40fba1[_0x387e('0x3')]||'';this[_0x387e('0x4')]=_0x40fba1[_0x387e('0x4')]||'';this['Configurations']=_0x40fba1[_0x387e('0x5')]||{};}module[_0x387e('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x318e=['name','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x419647,_0x10275f){var _0x1229c7=function(_0x14369f){while(--_0x14369f){_0x419647['push'](_0x419647['shift']());}};_0x1229c7(++_0x10275f);}(_0x318e,0x1bc));var _0xe318=function(_0x3b4ac3,_0x17c791){_0x3b4ac3=_0x3b4ac3-0x0;var _0x26f043=_0x318e[_0x3b4ac3];return _0x26f043;};'use strict';function SugarcrmAccount(_0x1ca7f3){this['id']=_0x1ca7f3['id']||0x0;this[_0xe318('0x0')]=_0x1ca7f3[_0xe318('0x0')]||'';this['username']=_0x1ca7f3['username']||'';this[_0xe318('0x1')]=_0x1ca7f3[_0xe318('0x1')]||'';this['remoteUri']=_0x1ca7f3[_0xe318('0x2')]||'';this[_0xe318('0x3')]=_0x1ca7f3[_0xe318('0x3')]||'';this[_0xe318('0x4')]=_0x1ca7f3['Configurations']||{};}module[_0xe318('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index c675d6c..f901dd8 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 _0x2fee=['name','accountcode','unknown','stateTime','address','exports'];(function(_0x23ec0b,_0x5b5720){var _0x30ad20=function(_0x642d15){while(--_0x642d15){_0x23ec0b['push'](_0x23ec0b['shift']());}};_0x30ad20(++_0x5b5720);}(_0x2fee,0x11a));var _0xe2fe=function(_0x5578ed,_0xb4bcc9){_0x5578ed=_0x5578ed-0x0;var _0x1bdb67=_0x2fee[_0x5578ed];return _0x1bdb67;};'use strict';function Telephone(_0x57774a){this['id']=_0x57774a['id']||0x0;this['name']=_0x57774a[_0xe2fe('0x0')]||'';this['accountcode']=_0x57774a[_0xe2fe('0x1')]||'';this['state']=_0xe2fe('0x2');this[_0xe2fe('0x3')]=0x0;this['status']=_0xe2fe('0x2');this[_0xe2fe('0x4')]='';}module[_0xe2fe('0x5')]=Telephone; \ No newline at end of file +var _0xf99c=['stateTime','status','address','name','accountcode','state','unknown'];(function(_0x1fe797,_0x2d8a8b){var _0x5661db=function(_0x15896c){while(--_0x15896c){_0x1fe797['push'](_0x1fe797['shift']());}};_0x5661db(++_0x2d8a8b);}(_0xf99c,0x129));var _0xcf99=function(_0xf15462,_0x45ed46){_0xf15462=_0xf15462-0x0;var _0x1cac80=_0xf99c[_0xf15462];return _0x1cac80;};'use strict';function Telephone(_0x5c76e9){this['id']=_0x5c76e9['id']||0x0;this[_0xcf99('0x0')]=_0x5c76e9[_0xcf99('0x0')]||'';this[_0xcf99('0x1')]=_0x5c76e9[_0xcf99('0x1')]||'';this[_0xcf99('0x2')]=_0xcf99('0x3');this[_0xcf99('0x4')]=0x0;this[_0xcf99('0x5')]=_0xcf99('0x3');this[_0xcf99('0x6')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 7d4767a..322e329 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x38bebf,_0x5f0274){var _0x447241=function(_0x48d153){while(--_0x48d153){_0x38bebf['push'](_0x38bebf['shift']());}};_0x447241(++_0x5f0274);}(_0xb10b,0x12a));var _0xbb10=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0xb10b[_0xc471d2];return _0x334c68;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x39b398,_0x369df3){var _0x3ecbdf=function(_0x3b3ff9){while(--_0x3b3ff9){_0x39b398['push'](_0x39b398['shift']());}};_0x3ecbdf(++_0x369df3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d66fd,_0x3c9415){_0x2d66fd=_0x2d66fd-0x0;var _0x322f24=_0xb10b[_0x2d66fd];return _0x322f24;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 8096779..5336c05 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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 +var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x44d809,_0x1f76fb){var _0x5361b9=function(_0x3e2a7f){while(--_0x3e2a7f){_0x44d809['push'](_0x44d809['shift']());}};_0x5361b9(++_0x1f76fb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xb7e7[_0x1da04e];return _0xdd8c41;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 7f48c02..f67db87 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 _0xaa92=['stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','registry','indexOf','split','host','port','domain','domainport','refresh'];(function(_0x112186,_0x19284e){var _0x31ad99=function(_0x2bce23){while(--_0x2bce23){_0x112186['push'](_0x112186['shift']());}};_0x31ad99(++_0x19284e);}(_0xaa92,0xef));var _0x2aa9=function(_0x133fe4,_0x1f473b){_0x133fe4=_0x133fe4-0x0;var _0x4c4017=_0xaa92[_0x133fe4];return _0x4c4017;};'use strict';function Trunk(_0x2a5b06){this['id']=_0x2a5b06['id']||0x0;this[_0x2aa9('0x0')]=_0x2a5b06[_0x2aa9('0x0')]||![];this[_0x2aa9('0x1')]=_0x2a5b06['name']||'';this[_0x2aa9('0x2')]=_0x2aa9('0x3');this[_0x2aa9('0x4')]=0x0;this['status']='unknown';this[_0x2aa9('0x5')]=_0x2a5b06[_0x2aa9('0x5')]&&_0x2a5b06[_0x2aa9('0x5')][_0x2aa9('0x6')](':')?_0x2a5b06[_0x2aa9('0x5')][_0x2aa9('0x7')](':')[0x0]:'';this[_0x2aa9('0x8')]='';this[_0x2aa9('0x9')]='';this[_0x2aa9('0xa')]='';this[_0x2aa9('0xb')]='';this[_0x2aa9('0xc')]='';this[_0x2aa9('0xd')]=_0x2aa9('0x3');this[_0x2aa9('0xe')]='';this[_0x2aa9('0xf')]='';this[_0x2aa9('0x10')]=_0x2a5b06[_0x2aa9('0x10')]||'';}module[_0x2aa9('0x11')]=Trunk; \ No newline at end of file +var _0x860c=['stateRegistry','address','defaultuser','exports','active','name','unknown','stateTime','registry','port','domain','domainport','refresh'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x860c,0x170));var _0xc860=function(_0x36e61f,_0xf8eca5){_0x36e61f=_0x36e61f-0x0;var _0x29eacf=_0x860c[_0x36e61f];return _0x29eacf;};'use strict';function Trunk(_0x4c01b5){this['id']=_0x4c01b5['id']||0x0;this[_0xc860('0x0')]=_0x4c01b5[_0xc860('0x0')]||![];this[_0xc860('0x1')]=_0x4c01b5[_0xc860('0x1')]||'';this['state']=_0xc860('0x2');this[_0xc860('0x3')]=0x0;this['status']='unknown';this[_0xc860('0x4')]=_0x4c01b5[_0xc860('0x4')]&&_0x4c01b5[_0xc860('0x4')]['indexOf'](':')?_0x4c01b5[_0xc860('0x4')]['split'](':')[0x0]:'';this['host']='';this[_0xc860('0x5')]='';this[_0xc860('0x6')]='';this[_0xc860('0x7')]='';this[_0xc860('0x8')]='';this[_0xc860('0x9')]=_0xc860('0x2');this['registrationtime']='';this[_0xc860('0xa')]='';this[_0xc860('0xb')]=_0x4c01b5['defaultuser']||'';}module[_0xc860('0xc')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index f98afb3..3035eb9 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 _0xeb05=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x46a229,_0x530af4){var _0x5eb7d6=function(_0x2d09e9){while(--_0x2d09e9){_0x46a229['push'](_0x46a229['shift']());}};_0x5eb7d6(++_0x530af4);}(_0xeb05,0x186));var _0x5eb0=function(_0x2c392c,_0x310fb2){_0x2c392c=_0x2c392c-0x0;var _0x5e1db8=_0xeb05[_0x2c392c];return _0x5e1db8;};'use strict';function voiceExtension(_0x4863ad){this['id']=_0x4863ad['id']||0x0;this[_0x5eb0('0x0')]=_0x4863ad[_0x5eb0('0x0')]||'';this[_0x5eb0('0x1')]=_0x4863ad[_0x5eb0('0x1')]||_0x5eb0('0x2');this['mandatoryDisposition']=_0x4863ad[_0x5eb0('0x3')]||![];}module[_0x5eb0('0x4')]=voiceExtension; \ No newline at end of file +var _0x6e4c=['exports','exten','none','mandatoryDisposition'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6e4c,0x16d));var _0xc6e4=function(_0x25ded9,_0x5c740f){_0x25ded9=_0x25ded9-0x0;var _0x312705=_0x6e4c[_0x25ded9];return _0x312705;};'use strict';function voiceExtension(_0x120ad4){this['id']=_0x120ad4['id']||0x0;this[_0xc6e4('0x0')]=_0x120ad4['exten']||'';this['recordingFormat']=_0x120ad4['recordingFormat']||_0xc6e4('0x1');this[_0xc6e4('0x2')]=_0x120ad4['mandatoryDisposition']||![];}module[_0xc6e4('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 a4dfbc5..1ee817d 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 _0xb0fe=['acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','unmanaged','loggedIn','available'];(function(_0x4e544f,_0x5d7cf6){var _0x594331=function(_0x36f444){while(--_0x36f444){_0x4e544f['push'](_0x4e544f['shift']());}};_0x594331(++_0x5d7cf6);}(_0xb0fe,0xd2));var _0xeb0f=function(_0x569f5f,_0x1c6c5c){_0x569f5f=_0x569f5f-0x0;var _0x3e8e2e=_0xb0fe[_0x569f5f];return _0x3e8e2e;};'use strict';var statusDesc=['unknown',_0xeb0f('0x0'),_0xeb0f('0x1'),_0xeb0f('0x2'),_0xeb0f('0x3'),_0xeb0f('0x4'),_0xeb0f('0x5'),_0xeb0f('0x6'),'onhold'];var monitorFormat={'wav':_0xeb0f('0x7'),'wav49':_0xeb0f('0x8'),'gsm':_0xeb0f('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xeb0f('0xa')};function VoiceQueue(_0x3a19cb){this['id']=_0x3a19cb['id']||0x0;this[_0xeb0f('0xb')]=_0x3a19cb[_0xeb0f('0xb')]||'';this[_0xeb0f('0xc')]=_0x3a19cb[_0xeb0f('0xc')]||'';this[_0xeb0f('0xd')]=_0x3a19cb[_0xeb0f('0xd')]||_0xeb0f('0xe');this[_0xeb0f('0xf')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0xeb0f('0x10')]=0x0;this[_0xeb0f('0x11')]=0x0;this[_0xeb0f('0x12')]=0x0;this['sumBillable']=0x0;this[_0xeb0f('0x13')]=0x0;this['abandoned']=0x0;this[_0xeb0f('0x14')]=0x0;this[_0xeb0f('0x15')]=0x0;this[_0xeb0f('0x16')]=_0x3a19cb[_0xeb0f('0x16')]||![];this[_0xeb0f('0x17')]=_0x3a19cb['acwTimeout']||0xa;this[_0xeb0f('0x18')]=_0x3a19cb[_0xeb0f('0x18')]||'no';this[_0xeb0f('0x19')]=!![];this[_0xeb0f('0x1a')]='';this['originated']=0x0;this[_0xeb0f('0x1b')]=0x0;this['dialTimezone']=_0x3a19cb[_0xeb0f('0x1c')]||null;this[_0xeb0f('0x1d')]=_0x3a19cb['dialGlobalInterval']?_0x3a19cb[_0xeb0f('0x1d')]:null;this[_0xeb0f('0x1e')]=_0x3a19cb[_0xeb0f('0x1e')];this['dialMethod']=_0x3a19cb[_0xeb0f('0x1f')]||'progressive';this['dialLimitChannel']=_0x3a19cb[_0xeb0f('0x20')]||0x0;this['dialLimitQueue']=_0x3a19cb[_0xeb0f('0x21')]||0x0;this['dialPowerLevel']=_0x3a19cb[_0xeb0f('0x22')]||0x1;this[_0xeb0f('0x23')]=_0x3a19cb[_0xeb0f('0x23')]||_0xeb0f('0x24');this[_0xeb0f('0x25')]=_0x3a19cb[_0xeb0f('0x25')]||0.03;this['dialPredictiveInterval']=_0x3a19cb[_0xeb0f('0x26')]||0x258;this[_0xeb0f('0x27')]=_0x3a19cb[_0xeb0f('0x27')]||_0xeb0f('0x28');this['dialOriginateCallerIdNumber']=_0x3a19cb['dialOriginateCallerIdNumber']||_0xeb0f('0x28');this['dialOriginateTimeout']=_0x3a19cb[_0xeb0f('0x29')]||0x1e;this[_0xeb0f('0x2a')]=_0x3a19cb[_0xeb0f('0x2a')]||'tTxX';this[_0xeb0f('0x2b')]=_0x3a19cb[_0xeb0f('0x2b')]||0x3;this['dialQueueProject']=_0x3a19cb[_0xeb0f('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x3a19cb[_0xeb0f('0x2d')]||0x3;this[_0xeb0f('0x2e')]=_0x3a19cb['dialCongestionRetryFrequency']||0x96;this[_0xeb0f('0x2f')]=_0x3a19cb['dialBusyMaxRetry']||0x3;this[_0xeb0f('0x30')]=_0x3a19cb[_0xeb0f('0x30')]||0x96;this[_0xeb0f('0x31')]=_0x3a19cb[_0xeb0f('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x3a19cb[_0xeb0f('0x32')]||0x96;this[_0xeb0f('0x33')]=_0x3a19cb[_0xeb0f('0x33')]||0x3;this[_0xeb0f('0x34')]=_0x3a19cb[_0xeb0f('0x34')]||0x96;this[_0xeb0f('0x35')]=_0x3a19cb[_0xeb0f('0x35')]||0x3;this[_0xeb0f('0x36')]=_0x3a19cb[_0xeb0f('0x36')]||0x96;this[_0xeb0f('0x37')]=_0x3a19cb[_0xeb0f('0x37')]||0x3;this[_0xeb0f('0x38')]=_0x3a19cb[_0xeb0f('0x38')]||0x96;this[_0xeb0f('0x39')]=_0x3a19cb[_0xeb0f('0x39')]||0x3;this[_0xeb0f('0x3a')]=_0x3a19cb[_0xeb0f('0x3a')]||0x96;this['dialAgentRejectMaxRetry']=_0x3a19cb['dialAgentRejectMaxRetry']||0x3;this[_0xeb0f('0x3b')]=_0x3a19cb[_0xeb0f('0x3b')]||0x96;this[_0xeb0f('0x3c')]=_0x3a19cb['dialGlobalMaxRetry']||0x4;this[_0xeb0f('0x3d')]=_0x3a19cb['Trunk']?_0x3a19cb[_0xeb0f('0x3d')]:undefined;this[_0xeb0f('0x3e')]=_0x3a19cb[_0xeb0f('0x3e')]?_0x3a19cb[_0xeb0f('0x3e')]:undefined;this[_0xeb0f('0x3f')]=_0x3a19cb[_0xeb0f('0x3f')]||undefined;this[_0xeb0f('0x40')]=_0x3a19cb[_0xeb0f('0x40')]?_0x3a19cb[_0xeb0f('0x40')]:undefined;this[_0xeb0f('0x41')]=_0x3a19cb[_0xeb0f('0x41')]||_0xeb0f('0x42');this[_0xeb0f('0x43')]=_0x3a19cb['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xeb0f('0x44')]=_0x3a19cb['dialCutDigit']||undefined;this[_0xeb0f('0x45')]=strategy[_0x3a19cb[_0xeb0f('0x45')]]||_0xeb0f('0x46');this['queueStatusComplete']=!![];this[_0xeb0f('0x47')]=_0x3a19cb[_0xeb0f('0x47')]||![];this[_0xeb0f('0x48')]=_0x3a19cb[_0xeb0f('0x48')];this[_0xeb0f('0x49')]=_0x3a19cb[_0xeb0f('0x49')];this[_0xeb0f('0x4a')]=_0x3a19cb[_0xeb0f('0x4a')];this[_0xeb0f('0x4b')]=_0x3a19cb[_0xeb0f('0x4b')];this['dialAMDMinWordLength']=_0x3a19cb[_0xeb0f('0x4c')];this[_0xeb0f('0x4d')]=_0x3a19cb[_0xeb0f('0x4d')];this[_0xeb0f('0x4e')]=_0x3a19cb[_0xeb0f('0x4e')];this[_0xeb0f('0x4f')]=_0x3a19cb[_0xeb0f('0x4f')];this[_0xeb0f('0x50')]=_0x3a19cb['dialAMDMaximumWordLength'];this[_0xeb0f('0x51')]=0x0;this['pTalking']=0x0;this[_0xeb0f('0x52')]=_0x3a19cb[_0xeb0f('0x52')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xeb0f('0x53')]=0x0;this[_0xeb0f('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xeb0f('0x55')]=0x0;this[_0xeb0f('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xeb0f('0x57')]=0x0;this[_0xeb0f('0x58')]=0x0;this[_0xeb0f('0x59')]=0x0;this[_0xeb0f('0x5a')]=0x0;this[_0xeb0f('0x5b')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xeb0f('0x5c')]=undefined;this[_0xeb0f('0x5d')]=undefined;this[_0xeb0f('0x5e')]=undefined;this[_0xeb0f('0x5f')]=1.05;this[_0xeb0f('0x60')]=0x0;this[_0xeb0f('0x61')]=0x0;this[_0xeb0f('0x62')]=0x0;this[_0xeb0f('0x63')]=0x0;this[_0xeb0f('0x64')]=0x0;this[_0xeb0f('0x65')]=0x0;this[_0xeb0f('0x66')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xeb0f('0x67')]=_0x3a19cb[_0xeb0f('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x3a19cb[_0xeb0f('0x68')]||0xa;this[_0xeb0f('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xeb0f('0x6a')]=0x0;this[_0xeb0f('0x6b')]=0x0;this[_0xeb0f('0x6c')]=0x0;this[_0xeb0f('0x6d')]=_0x3a19cb[_0xeb0f('0x6d')]||0x1e;this[_0xeb0f('0x6e')]=_0x3a19cb[_0xeb0f('0x6e')]||![];this['dialQueueProject2']=_0x3a19cb[_0xeb0f('0x6f')]||undefined;this[_0xeb0f('0x70')]=_0x3a19cb[_0xeb0f('0x70')]||![];this[_0xeb0f('0x71')]=_0x3a19cb[_0xeb0f('0x71')]||![];this[_0xeb0f('0xc')]=monitorFormat[_0x3a19cb[_0xeb0f('0xc')]]?monitorFormat[_0x3a19cb[_0xeb0f('0xc')]]:undefined;this['mandatoryDisposition']=_0x3a19cb['mandatoryDisposition']||![];this[_0xeb0f('0x72')]=_0x3a19cb[_0xeb0f('0x72')]?_0x3a19cb['mandatoryDispositionPause']:undefined;}module[_0xeb0f('0x73')]=VoiceQueue; \ No newline at end of file +var _0x9be9=['roundrobin','name','monitor_format','type','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','rrmemory'];(function(_0x5339a0,_0xbd2126){var _0x13c029=function(_0x471a55){while(--_0x471a55){_0x5339a0['push'](_0x5339a0['shift']());}};_0x13c029(++_0xbd2126);}(_0x9be9,0x172));var _0x99be=function(_0x4dc315,_0x1df09c){_0x4dc315=_0x4dc315-0x0;var _0x472d39=_0x9be9[_0x4dc315];return _0x472d39;};'use strict';var statusDesc=[_0x99be('0x0'),_0x99be('0x1'),_0x99be('0x2'),_0x99be('0x3'),_0x99be('0x4'),_0x99be('0x5'),'ringing',_0x99be('0x6'),_0x99be('0x7')];var monitorFormat={'wav':_0x99be('0x8'),'wav49':_0x99be('0x9'),'gsm':'gsm'};var strategy={'rrmemory':_0x99be('0xa'),'roundrobin':_0x99be('0xb')};function VoiceQueue(_0x6536cf){this['id']=_0x6536cf['id']||0x0;this[_0x99be('0xc')]=_0x6536cf['name']||'';this[_0x99be('0xd')]=_0x6536cf[_0x99be('0xd')]||'';this['type']=_0x6536cf[_0x99be('0xe')]||'inbound';this['waiting']=0x0;this[_0x99be('0xf')]=0x0;this[_0x99be('0x10')]=0x0;this[_0x99be('0x11')]=0x0;this[_0x99be('0x12')]=0x0;this[_0x99be('0x13')]=0x0;this[_0x99be('0x14')]=0x0;this[_0x99be('0x15')]=0x0;this[_0x99be('0x16')]=0x0;this[_0x99be('0x17')]=0x0;this[_0x99be('0x18')]=0x0;this['acw']=_0x6536cf[_0x99be('0x19')]||![];this[_0x99be('0x1a')]=_0x6536cf[_0x99be('0x1a')]||0xa;this[_0x99be('0x1b')]=_0x6536cf[_0x99be('0x1b')]||'no';this['sendMessageOneNotActive']=!![];this[_0x99be('0x1c')]='';this['originated']=0x0;this[_0x99be('0x1d')]=0x0;this['dialTimezone']=_0x6536cf[_0x99be('0x1e')]||null;this[_0x99be('0x1f')]=_0x6536cf['dialGlobalInterval']?_0x6536cf['dialGlobalInterval']:null;this['dialActive']=_0x6536cf[_0x99be('0x20')];this[_0x99be('0x21')]=_0x6536cf[_0x99be('0x21')]||_0x99be('0x22');this[_0x99be('0x23')]=_0x6536cf[_0x99be('0x23')]||0x0;this[_0x99be('0x24')]=_0x6536cf[_0x99be('0x24')]||0x0;this[_0x99be('0x25')]=_0x6536cf['dialPowerLevel']||0x1;this[_0x99be('0x26')]=_0x6536cf[_0x99be('0x26')]||_0x99be('0x27');this[_0x99be('0x28')]=_0x6536cf[_0x99be('0x28')]||0.03;this['dialPredictiveInterval']=_0x6536cf['dialPredictiveInterval']||0x258;this[_0x99be('0x29')]=_0x6536cf['dialOriginateCallerIdName']||'anonymous';this[_0x99be('0x2a')]=_0x6536cf[_0x99be('0x2a')]||_0x99be('0x2b');this[_0x99be('0x2c')]=_0x6536cf['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x6536cf[_0x99be('0x2d')]||'tTxX';this[_0x99be('0x2e')]=_0x6536cf[_0x99be('0x2e')]||0x3;this[_0x99be('0x2f')]=_0x6536cf[_0x99be('0x2f')]||undefined;this[_0x99be('0x30')]=_0x6536cf[_0x99be('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x6536cf[_0x99be('0x31')]||0x96;this[_0x99be('0x32')]=_0x6536cf['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x6536cf[_0x99be('0x33')]||0x96;this[_0x99be('0x34')]=_0x6536cf[_0x99be('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x6536cf['dialNoAnswerRetryFrequency']||0x96;this[_0x99be('0x35')]=_0x6536cf[_0x99be('0x35')]||0x3;this[_0x99be('0x36')]=_0x6536cf[_0x99be('0x36')]||0x96;this[_0x99be('0x37')]=_0x6536cf['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x6536cf['dialDropRetryFrequency']||0x96;this[_0x99be('0x38')]=_0x6536cf[_0x99be('0x38')]||0x3;this[_0x99be('0x39')]=_0x6536cf[_0x99be('0x39')]||0x96;this[_0x99be('0x3a')]=_0x6536cf[_0x99be('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x6536cf[_0x99be('0x3b')]||0x96;this['dialAgentRejectMaxRetry']=_0x6536cf[_0x99be('0x3c')]||0x3;this[_0x99be('0x3d')]=_0x6536cf[_0x99be('0x3d')]||0x96;this[_0x99be('0x3e')]=_0x6536cf[_0x99be('0x3e')]||0x4;this[_0x99be('0x3f')]=_0x6536cf[_0x99be('0x3f')]?_0x6536cf[_0x99be('0x3f')]:undefined;this[_0x99be('0x40')]=_0x6536cf['TrunkBackup']?_0x6536cf[_0x99be('0x40')]:undefined;this[_0x99be('0x41')]=_0x6536cf[_0x99be('0x41')]||undefined;this[_0x99be('0x42')]=_0x6536cf[_0x99be('0x42')]?_0x6536cf['Interval']:undefined;this[_0x99be('0x43')]=_0x6536cf[_0x99be('0x43')]||_0x99be('0x44');this[_0x99be('0x45')]=_0x6536cf[_0x99be('0x45')]||undefined;this[_0x99be('0x46')]=_0x6536cf['dialCutDigit']||undefined;this[_0x99be('0x47')]=strategy[_0x6536cf[_0x99be('0x47')]]||_0x99be('0xa');this[_0x99be('0x48')]=!![];this[_0x99be('0x49')]=_0x6536cf[_0x99be('0x49')]||![];this[_0x99be('0x4a')]=_0x6536cf['dialAMDInitialSilence'];this[_0x99be('0x4b')]=_0x6536cf[_0x99be('0x4b')];this[_0x99be('0x4c')]=_0x6536cf[_0x99be('0x4c')];this[_0x99be('0x4d')]=_0x6536cf[_0x99be('0x4d')];this[_0x99be('0x4e')]=_0x6536cf[_0x99be('0x4e')];this[_0x99be('0x4f')]=_0x6536cf['dialAMDBetweenWordsSilence'];this[_0x99be('0x50')]=_0x6536cf['dialAMDMaximumNumberOfWords'];this[_0x99be('0x51')]=_0x6536cf[_0x99be('0x51')];this['dialAMDMaximumWordLength']=_0x6536cf[_0x99be('0x52')];this[_0x99be('0x53')]=0x0;this[_0x99be('0x54')]=0x0;this[_0x99be('0x55')]=_0x6536cf[_0x99be('0x55')];this[_0x99be('0x56')]=0x0;this[_0x99be('0x57')]=0x0;this[_0x99be('0x58')]=0x0;this[_0x99be('0x59')]=0x0;this[_0x99be('0x5a')]=0x0;this[_0x99be('0x5b')]=0x0;this[_0x99be('0x5c')]=0x0;this[_0x99be('0x5d')]=0x0;this[_0x99be('0x5e')]=0x0;this[_0x99be('0x5f')]=0x0;this[_0x99be('0x60')]=0x0;this[_0x99be('0x61')]=0x0;this[_0x99be('0x62')]=0x0;this[_0x99be('0x63')]=0x0;this[_0x99be('0x64')]=undefined;this[_0x99be('0x65')]=undefined;this[_0x99be('0x66')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x99be('0x67')]=0x0;this[_0x99be('0x68')]=0x0;this[_0x99be('0x69')]=0x0;this[_0x99be('0x6a')]=0x0;this[_0x99be('0x6b')]=0x0;this[_0x99be('0x6c')]=0x0;this[_0x99be('0x6d')]=0x0;this[_0x99be('0x6e')]=0x0;this[_0x99be('0x6f')]=_0x6536cf[_0x99be('0x70')]||0x14;this['predictiveIntervalMinThreshold']=_0x6536cf[_0x99be('0x70')]||0xa;this[_0x99be('0x71')]=0x0;this[_0x99be('0x72')]=0x0;this[_0x99be('0x73')]=0x1;this[_0x99be('0x74')]=0x0;this['erlangCallToSecond']=0x0;this[_0x99be('0x75')]=0x0;this[_0x99be('0x76')]=0x0;this[_0x99be('0x77')]=_0x6536cf[_0x99be('0x77')]||0x1e;this['dialRecallInQueue']=_0x6536cf[_0x99be('0x78')]||![];this['dialQueueProject2']=_0x6536cf[_0x99be('0x79')]||undefined;this[_0x99be('0x7a')]=_0x6536cf[_0x99be('0x7a')]||![];this[_0x99be('0x7b')]=_0x6536cf['dialAgiAfterHangupAgent']||![];this[_0x99be('0xd')]=monitorFormat[_0x6536cf[_0x99be('0xd')]]?monitorFormat[_0x6536cf[_0x99be('0xd')]]:undefined;this['mandatoryDisposition']=_0x6536cf[_0x99be('0x7c')]||![];this[_0x99be('0x7d')]=_0x6536cf[_0x99be('0x7d')]?_0x6536cf[_0x99be('0x7d')]:undefined;}module[_0x99be('0x7e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 42bce76..b59a7ad 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 _0x3c15=['accessKey','remoteUri','serverUrl','exports','name','username'];(function(_0xdace5d,_0x3e62fd){var _0x5ea646=function(_0xe2604f){while(--_0xe2604f){_0xdace5d['push'](_0xdace5d['shift']());}};_0x5ea646(++_0x3e62fd);}(_0x3c15,0x172));var _0x53c1=function(_0x2e4de6,_0x14e66f){_0x2e4de6=_0x2e4de6-0x0;var _0x25a586=_0x3c15[_0x2e4de6];return _0x25a586;};'use strict';function VtigerAccount(_0x17fdce){this['id']=_0x17fdce['id']||0x0;this[_0x53c1('0x0')]=_0x17fdce[_0x53c1('0x0')]||'';this[_0x53c1('0x1')]=_0x17fdce[_0x53c1('0x1')]||'';this[_0x53c1('0x2')]=_0x17fdce[_0x53c1('0x2')]||'';this['remoteUri']=_0x17fdce[_0x53c1('0x3')]||'';this[_0x53c1('0x4')]=_0x17fdce[_0x53c1('0x4')]||'';this['Configurations']=_0x17fdce['Configurations']||{};}module[_0x53c1('0x5')]=VtigerAccount; \ No newline at end of file +var _0xfd68=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xfd68,0xfd));var _0x8fd6=function(_0x542250,_0x15940d){_0x542250=_0x542250-0x0;var _0x3d9ecb=_0xfd68[_0x542250];return _0x3d9ecb;};'use strict';function VtigerAccount(_0x3e9633){this['id']=_0x3e9633['id']||0x0;this[_0x8fd6('0x0')]=_0x3e9633[_0x8fd6('0x0')]||'';this['username']=_0x3e9633[_0x8fd6('0x1')]||'';this[_0x8fd6('0x2')]=_0x3e9633[_0x8fd6('0x2')]||'';this['remoteUri']=_0x3e9633[_0x8fd6('0x3')]||'';this[_0x8fd6('0x4')]=_0x3e9633[_0x8fd6('0x4')]||'';this['Configurations']=_0x3e9633[_0x8fd6('0x5')]||{};}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 8eaa0d0..ef376de 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 _0x7120=['remoteUri','authType','type','serverUrl','Configurations','exports','name','password','token'];(function(_0x4e92bd,_0x56ab53){var _0x2e0801=function(_0x221b1f){while(--_0x221b1f){_0x4e92bd['push'](_0x4e92bd['shift']());}};_0x2e0801(++_0x56ab53);}(_0x7120,0x11d));var _0x0712=function(_0x117aee,_0xb0026a){_0x117aee=_0x117aee-0x0;var _0x3d2d58=_0x7120[_0x117aee];return _0x3d2d58;};'use strict';function ZendeskAccount(_0x1534eb){this['id']=_0x1534eb['id']||0x0;this['name']=_0x1534eb[_0x0712('0x0')]||'';this['username']=_0x1534eb['username']||'';this['password']=_0x1534eb[_0x0712('0x1')]||'';this[_0x0712('0x2')]=_0x1534eb[_0x0712('0x2')]||'';this['remoteUri']=_0x1534eb[_0x0712('0x3')]||'';this[_0x0712('0x4')]=_0x1534eb[_0x0712('0x4')]||'';this[_0x0712('0x5')]=_0x1534eb[_0x0712('0x5')]||'integrationTab';this[_0x0712('0x6')]=_0x1534eb[_0x0712('0x6')]||'';this['Configurations']=_0x1534eb[_0x0712('0x7')]||{};}module[_0x0712('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x0140=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0140,0x1e8));var _0x0014=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x0140[_0x544099];return _0x20ab09;};'use strict';function ZendeskAccount(_0x23c6ed){this['id']=_0x23c6ed['id']||0x0;this[_0x0014('0x0')]=_0x23c6ed[_0x0014('0x0')]||'';this[_0x0014('0x1')]=_0x23c6ed[_0x0014('0x1')]||'';this[_0x0014('0x2')]=_0x23c6ed[_0x0014('0x2')]||'';this[_0x0014('0x3')]=_0x23c6ed[_0x0014('0x3')]||'';this[_0x0014('0x4')]=_0x23c6ed[_0x0014('0x4')]||'';this[_0x0014('0x5')]=_0x23c6ed[_0x0014('0x5')]||'';this[_0x0014('0x6')]=_0x23c6ed['type']||_0x0014('0x7');this[_0x0014('0x8')]=_0x23c6ed['serverUrl']||'';this[_0x0014('0x9')]=_0x23c6ed['Configurations']||{};}module[_0x0014('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 4b8eefa..35b91a5 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 _0x5b35=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x582ccd,_0xa9ab43){var _0x11545d=function(_0x4010fa){while(--_0x4010fa){_0x582ccd['push'](_0x582ccd['shift']());}};_0x11545d(++_0xa9ab43);}(_0x5b35,0x16e));var _0x55b3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b35[_0x321bb2];return _0x9c12ed;};'use strict';function ZohoAccount(_0x229bb1){this['id']=_0x229bb1['id']||0x0;this[_0x55b3('0x0')]=_0x229bb1[_0x55b3('0x0')]||'';this[_0x55b3('0x1')]=_0x229bb1[_0x55b3('0x1')]||'';this[_0x55b3('0x2')]=_0x229bb1[_0x55b3('0x2')]||'';this[_0x55b3('0x3')]=_0x229bb1[_0x55b3('0x3')]||'';this[_0x55b3('0x4')]=_0x229bb1[_0x55b3('0x4')]||'';this[_0x55b3('0x5')]=_0x229bb1['clientSecret']||'';this[_0x55b3('0x6')]=_0x229bb1[_0x55b3('0x6')]||'';this[_0x55b3('0x7')]=_0x229bb1[_0x55b3('0x7')]||'';this[_0x55b3('0x8')]=_0x229bb1[_0x55b3('0x8')]||'';this[_0x55b3('0x9')]=_0x229bb1[_0x55b3('0x9')]||{};}module[_0x55b3('0xa')]=ZohoAccount; \ No newline at end of file +var _0x3aa5=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','host','zone'];(function(_0x3da2f4,_0x4dd22a){var _0x172448=function(_0x575aae){while(--_0x575aae){_0x3da2f4['push'](_0x3da2f4['shift']());}};_0x172448(++_0x4dd22a);}(_0x3aa5,0x193));var _0x53aa=function(_0x1663ae,_0x28fdf2){_0x1663ae=_0x1663ae-0x0;var _0x4f7794=_0x3aa5[_0x1663ae];return _0x4f7794;};'use strict';function ZohoAccount(_0x194480){this['id']=_0x194480['id']||0x0;this['name']=_0x194480['name']||'';this['description']=_0x194480['description']||'';this['host']=_0x194480[_0x53aa('0x0')]||'';this[_0x53aa('0x1')]=_0x194480[_0x53aa('0x1')]||'';this[_0x53aa('0x2')]=_0x194480[_0x53aa('0x2')]||'';this[_0x53aa('0x3')]=_0x194480[_0x53aa('0x3')]||'';this[_0x53aa('0x4')]=_0x194480[_0x53aa('0x4')]||'';this[_0x53aa('0x5')]=_0x194480['code']||'';this['refreshToken']=_0x194480[_0x53aa('0x6')]||'';this[_0x53aa('0x7')]=_0x194480['Configurations']||{};}module[_0x53aa('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 8b7341b..e715dab 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 _0x1777=['queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','idContact'];(function(_0xfbe97e,_0x21c1e6){var _0x53c2b4=function(_0x5399cb){while(--_0x5399cb){_0xfbe97e['push'](_0xfbe97e['shift']());}};_0x53c2b4(++_0x21c1e6);}(_0x1777,0x128));var _0x7177=function(_0x1fdb5c,_0x3a4635){_0x1fdb5c=_0x1fdb5c-0x0;var _0x58e628=_0x1777[_0x1fdb5c];return _0x58e628;};'use strict';var util=require(_0x7177('0x0'));var _=require(_0x7177('0x1'));var moment=require('moment');function checkNameSurname(_0x59198e,_0x34793e,_0x4f1769){var _0x5d664c='';if(!_[_0x7177('0x2')](_0x34793e)&&_0x7177('0x3')===typeof _0x34793e){_0x5d664c+=_0x34793e;}if(!_[_0x7177('0x2')](_0x4f1769)&&_0x7177('0x3')===typeof _0x4f1769){_0x5d664c+='\x20'+_0x4f1769;}if(_0x5d664c!==''){return _0x5d664c;}return _0x59198e;}function Action(_0x1fb20a,_0xe2d0a4,_0x57355b,_0x54d65e,_0x1ee09f){this['uniqueid']=_0x57355b||undefined;this[_0x7177('0x4')]=_0x1fb20a['id'];this[_0x7177('0x5')]=_0xe2d0a4['name'];this[_0x7177('0x6')]=_0xe2d0a4[_0x7177('0x6')];this[_0x7177('0x7')]=_0x7177('0x5');this[_0x7177('0x8')]=![];this[_0x7177('0x9')]=_[_0x7177('0x2')](_0x1fb20a[_0x7177('0xa')])?undefined:_0x1fb20a['Agent'][_0x7177('0xb')];this[_0x7177('0xc')]=this[_0x7177('0x9')]?util[_0x7177('0xd')](_0x7177('0xe'),this[_0x7177('0x9')]):_0x54d65e||undefined;this[_0x7177('0xf')]=checkNameSurname(_0x1fb20a[_0x7177('0x10')][_0x7177('0x11')],_0x1fb20a[_0x7177('0x10')][_0x7177('0x12')],_0x1fb20a[_0x7177('0x10')][_0x7177('0x13')]);this['active']=_0x1fb20a[_0x7177('0x14')]||![];this[_0x7177('0x15')]=_0x1fb20a[_0x7177('0x10')][_0x7177('0x11')];this['scheduledat']=_0x1fb20a[_0x7177('0x16')];this['countbusyretry']=_0x1fb20a[_0x7177('0x17')]||0x0;this[_0x7177('0x18')]=_0x1fb20a['countcongestionretry']||0x0;this[_0x7177('0x19')]=_0x1fb20a[_0x7177('0x19')]||0x0;this[_0x7177('0x1a')]=(_0x1fb20a[_0x7177('0x17')]||0x0)+(_0x1fb20a[_0x7177('0x18')]||0x0)+(_0x1fb20a[_0x7177('0x19')]||0x0)+(_0x1fb20a[_0x7177('0x1b')]||0x0)+(_0x1fb20a[_0x7177('0x1c')]||0x0)+(_0x1fb20a[_0x7177('0x1d')]||0x0)+(_0x1fb20a['countmachineretry']||0x0)+(_0x1fb20a[_0x7177('0x1e')]||0x0);this['countnosuchnumberretry']=_0x1fb20a[_0x7177('0x1b')]||0x0;this[_0x7177('0x1c')]=_0x1fb20a[_0x7177('0x1c')]||0x0;this[_0x7177('0x1d')]=_0x1fb20a[_0x7177('0x1d')]||0x0;this['countmachineretry']=_0x1fb20a['countmachineretry']||0x0;this['countagentrejectretry']=_0x1fb20a['countagentrejectretry']||0x0;this[_0x7177('0x1f')]=_0x1fb20a[_0x7177('0x1f')];this[_0x7177('0x20')]=_0x1fb20a[_0x7177('0x20')];this[_0x7177('0x21')]=_0x1fb20a[_0x7177('0x21')];this[_0x7177('0x22')]=_0x1fb20a[_0x7177('0x22')];this['ContactId']=_0x1fb20a['ContactId'];this['ListId']=_0x1fb20a['ListId'];this[_0x7177('0x23')]=_[_0x7177('0x2')](_0x1fb20a[_0x7177('0xa')])?_0x1fb20a[_0x7177('0x23')]:_0x1fb20a[_0x7177('0xa')]['id'];this[_0x7177('0x24')]=_0x1fb20a['VoiceQueueId'];this[_0x7177('0x25')]='';this[_0x7177('0x26')]='';}Action[_0x7177('0x27')]['getCaller']=function(){return util['format'](_0x7177('0x28'),this[_0x7177('0xf')],this[_0x7177('0x29')]);};module[_0x7177('0x2a')]=Action; \ No newline at end of file +var _0x5819=['originatecalleridnum','originatecalleridname','getCaller','format','lodash','isNil','string','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0xecee9e,_0x1cfb4d){var _0x2d2a34=function(_0x5e854f){while(--_0x5e854f){_0xecee9e['push'](_0xecee9e['shift']());}};_0x2d2a34(++_0x1cfb4d);}(_0x5819,0x1c7));var _0x9581=function(_0x213280,_0x4ebadc){_0x213280=_0x213280-0x0;var _0x3794f5=_0x5819[_0x213280];return _0x3794f5;};'use strict';var util=require('util');var _=require(_0x9581('0x0'));var moment=require('moment');function checkNameSurname(_0x404c01,_0x5a89db,_0x4e69f0){var _0x17e031='';if(!_[_0x9581('0x1')](_0x5a89db)&&_0x9581('0x2')===typeof _0x5a89db){_0x17e031+=_0x5a89db;}if(!_[_0x9581('0x1')](_0x4e69f0)&&_0x9581('0x2')===typeof _0x4e69f0){_0x17e031+='\x20'+_0x4e69f0;}if(_0x17e031!==''){return _0x17e031;}return _0x404c01;}function Action(_0x37420f,_0x593f0d,_0x3c9ad0,_0x1540d2,_0x4907f1){this[_0x9581('0x3')]=_0x3c9ad0||undefined;this[_0x9581('0x4')]=_0x37420f['id'];this[_0x9581('0x5')]=_0x593f0d[_0x9581('0x6')];this[_0x9581('0x7')]=_0x593f0d[_0x9581('0x7')];this['campaigntype']='queue';this[_0x9581('0x8')]=![];this[_0x9581('0x9')]=_[_0x9581('0x1')](_0x37420f[_0x9581('0xa')])?undefined:_0x37420f[_0x9581('0xa')][_0x9581('0x6')];this[_0x9581('0xb')]=this['membername']?util['format'](_0x9581('0xc'),this[_0x9581('0x9')]):_0x1540d2||undefined;this[_0x9581('0xd')]=checkNameSurname(_0x37420f['Contact']['phone'],_0x37420f[_0x9581('0xe')][_0x9581('0xf')],_0x37420f['Contact'][_0x9581('0x10')]);this[_0x9581('0x11')]=_0x37420f[_0x9581('0x11')]||![];this['calleridnum']=_0x37420f['Contact'][_0x9581('0x12')];this[_0x9581('0x13')]=_0x37420f['scheduledat'];this[_0x9581('0x14')]=_0x37420f[_0x9581('0x14')]||0x0;this['countcongestionretry']=_0x37420f[_0x9581('0x15')]||0x0;this['countnoanswerretry']=_0x37420f['countnoanswerretry']||0x0;this[_0x9581('0x16')]=(_0x37420f[_0x9581('0x14')]||0x0)+(_0x37420f[_0x9581('0x15')]||0x0)+(_0x37420f[_0x9581('0x17')]||0x0)+(_0x37420f[_0x9581('0x18')]||0x0)+(_0x37420f[_0x9581('0x19')]||0x0)+(_0x37420f[_0x9581('0x1a')]||0x0)+(_0x37420f[_0x9581('0x1b')]||0x0)+(_0x37420f[_0x9581('0x1c')]||0x0);this[_0x9581('0x18')]=_0x37420f[_0x9581('0x18')]||0x0;this[_0x9581('0x19')]=_0x37420f['countdropretry']||0x0;this[_0x9581('0x1a')]=_0x37420f[_0x9581('0x1a')]||0x0;this[_0x9581('0x1b')]=_0x37420f[_0x9581('0x1b')]||0x0;this['countagentrejectretry']=_0x37420f[_0x9581('0x1c')]||0x0;this[_0x9581('0x1d')]=_0x37420f[_0x9581('0x1d')];this[_0x9581('0x1e')]=_0x37420f[_0x9581('0x1e')];this[_0x9581('0x1f')]=_0x37420f[_0x9581('0x1f')];this[_0x9581('0x20')]=_0x37420f[_0x9581('0x20')];this[_0x9581('0x21')]=_0x37420f['ContactId'];this[_0x9581('0x22')]=_0x37420f[_0x9581('0x22')];this[_0x9581('0x23')]=_[_0x9581('0x1')](_0x37420f[_0x9581('0xa')])?_0x37420f[_0x9581('0x23')]:_0x37420f['Agent']['id'];this['VoiceQueueId']=_0x37420f[_0x9581('0x24')];this[_0x9581('0x25')]='';this[_0x9581('0x26')]='';}Action['prototype'][_0x9581('0x27')]=function(){return util[_0x9581('0x28')]('\x22%s\x22\x20<%s>',this[_0x9581('0xd')],this['number']);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 6f6ff82..375a0b1 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 _0xbce7=['keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','./action','./util/util','localhost','redis','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','outbound','name','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','originated:\x20','queue','dialAnswer','pick','UserId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','Agent','voicePause','logger2','[RecallMe]','catch','disableContact','starttime','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','buildAcw','custom:agentcomplete','buildObj','complete','outboundAnswerCallsDay','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','pTalking:\x20','countbusyretry','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countcongestionretry','CANCEL','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','SIP/%s','unmonitored','run','getContactPreview','recallme','validateContact','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','response','unlockContact','idContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xbce7,0x15b));var _0x7bce=function(_0x3f3408,_0x3283b0){_0x3f3408=_0x3f3408-0x0;var _0x155b34=_0xbce7[_0x3f3408];return _0x155b34;};'use strict';var util=require(_0x7bce('0x0'));var _=require(_0x7bce('0x1'));var BPromise=require(_0x7bce('0x2'));var uuid=require(_0x7bce('0x3'));var moment=require('moment');var md5=require(_0x7bce('0x4'));var Redis=require('ioredis');var config=require(_0x7bce('0x5'));var logger=require('../../../config/logger')(_0x7bce('0x6'));var loggerAction=require(_0x7bce('0x7'))(_0x7bce('0x8'));var ami=require('../ami');var rpcDb=require(_0x7bce('0x9'));var Action=require(_0x7bce('0xa'));var ut=require(_0x7bce('0xb'));config['redis']=_['defaults'](config['redis'],{'host':_0x7bce('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7bce('0xd')]));var Sequence=function(){};Sequence[_0x7bce('0xe')][_0x7bce('0xf')]=function(_0x550866){this['tail']=this[_0x7bce('0x10')]?this[_0x7bce('0x10')][_0x7bce('0x11')](_0x550866):_0x550866();};function Preview(_0x287e28){this[_0x7bce('0x12')]=new Sequence();this[_0x7bce('0x13')]=_0x287e28[_0x7bce('0x14')];this[_0x7bce('0x15')]=_0x287e28[_0x7bce('0x15')];this[_0x7bce('0x16')]={};this[_0x7bce('0x17')]=_0x287e28[_0x7bce('0x17')];this[_0x7bce('0x18')]=0x0;ami['on'](_0x7bce('0x19'),this['syncOriginateResponse'][_0x7bce('0x1a')](this));ami['on'](_0x7bce('0x1b'),this[_0x7bce('0x1c')][_0x7bce('0x1a')](this));ami['on'](_0x7bce('0x1d'),this[_0x7bce('0x1e')]['bind'](this));ami['on'](_0x7bce('0x1f'),this[_0x7bce('0x20')][_0x7bce('0x1a')](this));ami['on']('newexten',this[_0x7bce('0x21')][_0x7bce('0x1a')](this));ami['on']('varset',this[_0x7bce('0x22')][_0x7bce('0x1a')](this));ami['on']('attendedtransfer',this[_0x7bce('0x23')][_0x7bce('0x1a')](this));ami['on'](_0x7bce('0x24'),this[_0x7bce('0x25')]['bind'](this));this['loopCampaigns'](this[_0x7bce('0x13')]);}function emit(_0x58942b,_0x59b62e,_0x2c4c52){io['to'](_0x58942b)[_0x7bce('0x26')](_0x59b62e,_0x2c4c52);}function emitCampaignPreview(_0x4539b8){if(_0x4539b8[_0x7bce('0x27')]===_0x7bce('0x28')){var _0x4a5737={'id':_0x4539b8['id'],'name':_0x4539b8[_0x7bce('0x29')],'strategy':_0x4539b8['strategy'],'answered':_0x4539b8['answered'],'available':_0x4539b8[_0x7bce('0x2a')],'loggedIn':_0x4539b8[_0x7bce('0x2b')],'pTalking':_0x4539b8['pTalking'],'sumBillable':_0x4539b8[_0x7bce('0x2c')],'sumDuration':_0x4539b8[_0x7bce('0x2d')],'sumHoldTime':_0x4539b8[_0x7bce('0x2e')]||0x0,'talking':_0x4539b8['talking'],'total':_0x4539b8[_0x7bce('0x2f')],'type':_0x4539b8['type'],'unmanaged':_0x4539b8['unmanaged'],'abandoned':_0x4539b8[_0x7bce('0x30')],'waiting':_0x4539b8[_0x7bce('0x31')],'loggedInDb':_0x4539b8['loggedInDb'],'dialActive':_0x4539b8[_0x7bce('0x32')],'dialMethod':_0x4539b8[_0x7bce('0x33')],'dialOriginateCallerIdName':_0x4539b8[_0x7bce('0x34')],'dialOriginateCallerIdNumber':_0x4539b8[_0x7bce('0x35')],'dialOriginateTimeout':_0x4539b8[_0x7bce('0x36')],'dialPrefix':_0x4539b8[_0x7bce('0x37')],'outboundAnswerAgiCallsDay':_0x4539b8['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4539b8['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x4539b8[_0x7bce('0x38')],'outboundBusyCallsDay':_0x4539b8[_0x7bce('0x39')],'outboundCongestionCallsDay':_0x4539b8[_0x7bce('0x3a')],'outboundDropCallsDayACS':_0x4539b8[_0x7bce('0x3b')],'outboundDropCallsDayCallersExit':_0x4539b8[_0x7bce('0x3c')],'outboundDropCallsDayTimeout':_0x4539b8[_0x7bce('0x3d')],'outboundNoAnswerCallsDay':_0x4539b8[_0x7bce('0x3e')],'outboundNoSuchCallsDay':_0x4539b8[_0x7bce('0x3f')],'outboundOriginateFailureCallsDay':_0x4539b8['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4539b8['outboundReCallsDay'],'outboundRejectCallsDay':_0x4539b8[_0x7bce('0x40')],'outboundUnknownCallsDay':_0x4539b8[_0x7bce('0x41')],'outboundAbandonedCallsDay':_0x4539b8[_0x7bce('0x42')],'predictiveIntervalAnsweredCalls':_0x4539b8['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4539b8[_0x7bce('0x43')],'predictiveIntervalAvgTalktime':_0x4539b8['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4539b8[_0x7bce('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x4539b8[_0x7bce('0x45')],'predictiveIntervalErlangCalls':_0x4539b8[_0x7bce('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x4539b8[_0x7bce('0x47')],'predictiveIntervalHitRate':_0x4539b8[_0x7bce('0x48')],'predictiveIntervalMultiplicativeFactor':_0x4539b8['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4539b8[_0x7bce('0x49')],'predictiveIntervalAvailable':_0x4539b8[_0x7bce('0x4a')],'predictiveIntervalTotalCalls':_0x4539b8[_0x7bce('0x4b')],'message':_0x4539b8[_0x7bce('0x4c')],'originated':_0x4539b8[_0x7bce('0x4d')],'erlangCalls':_0x4539b8[_0x7bce('0x4e')],'erlangCallToSecond':_0x4539b8[_0x7bce('0x4f')],'erlangAbandonmentRate':_0x4539b8['erlangAbandonmentRate'],'erlangBusyFactor':_0x4539b8['erlangBusyFactor'],'startPredictive':_0x4539b8[_0x7bce('0x50')],'startProgressive':_0x4539b8['startProgressive']};if(_0x4539b8[_0x7bce('0x51')]){_0x4a5737[_0x7bce('0x51')]={'id':_0x4539b8[_0x7bce('0x51')]['id'],'name':_0x4539b8[_0x7bce('0x51')]['name'],'active':_0x4539b8[_0x7bce('0x51')][_0x7bce('0x52')],'callerid':_0x4539b8[_0x7bce('0x51')][_0x7bce('0x53')]};}if(_0x4539b8['Interval']){_0x4a5737['Interval']={'id':_0x4539b8[_0x7bce('0x54')]['id'],'name':_0x4539b8[_0x7bce('0x54')][_0x7bce('0x29')]};}var _0x949fec=md5(JSON[_0x7bce('0x55')](_0x4a5737));if(_0x4539b8[_0x7bce('0x4')]!==_0x949fec){_0x4539b8[_0x7bce('0x4')]=_0x949fec;emit(util[_0x7bce('0x56')](_0x7bce('0x57'),_0x4a5737[_0x7bce('0x29')]),'voice_queue:save',_0x4a5737);}}}function emitVoiceQueueChannelRemove(_0x4d0702){logger[_0x7bce('0x58')](_0x7bce('0x59'),JSON[_0x7bce('0x55')](_0x4d0702));emit(util[_0x7bce('0x56')](_0x7bce('0x57'),_0x4d0702['name']),_0x7bce('0x5a'),_0x4d0702);io[_0x7bce('0x26')](_0x7bce('0x5b'),_0x4d0702);}function notSendMessagesQueue(_0x18d729){if(_0x18d729[_0x7bce('0x5c')]){if(_0x18d729[_0x7bce('0x4d')]===0x0&&_0x18d729[_0x7bce('0x5d')]===0x0){_0x18d729[_0x7bce('0x5c')]=![];_0x18d729[_0x7bce('0x2a')]=0x0;_0x18d729[_0x7bce('0x5e')]=0x0;_0x18d729[_0x7bce('0x4c')]=_0x7bce('0x5f');ut[_0x7bce('0x60')](_0x7bce('0x61'),_0x18d729['name']+_0x7bce('0x62'));}else{_0x18d729['message']=_0x7bce('0x63');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x18d729['name']+_0x7bce('0x64'));}emitCampaignPreview(_0x18d729);}}Preview[_0x7bce('0xe')][_0x7bce('0x65')]=function(){var _0x184891=this;setInterval(function(){_0x184891[_0x7bce('0x66')]();},0x7cf);};Preview[_0x7bce('0xe')]['syncCampaigns']=function(){var _0x20f37c=this[_0x7bce('0x13')];this[_0x7bce('0x18')]+=0x1;for(var _0x31a163 in _0x20f37c){if(_0x20f37c['hasOwnProperty'](_0x31a163)&&(_0x20f37c[_0x31a163][_0x7bce('0x33')]===_0x7bce('0x6')||_0x20f37c[_0x31a163][_0x7bce('0x33')]===_0x7bce('0x67'))&&_0x20f37c[_0x31a163][_0x7bce('0x27')]==='outbound'){if(this[_0x7bce('0x18')]>0x7){this[_0x7bce('0x18')]=0x0;this[_0x7bce('0x68')]();}}if(_0x20f37c[_0x7bce('0x69')](_0x31a163)&&_0x20f37c[_0x31a163][_0x7bce('0x33')]===_0x7bce('0x6')&&_0x20f37c[_0x31a163]['type']===_0x7bce('0x28')){if(_0x20f37c[_0x31a163]['dialActive']){this[_0x7bce('0x6a')](_0x20f37c[_0x31a163]);this[_0x7bce('0x6b')](_0x20f37c[_0x31a163]);}else{notSendMessagesQueue(_0x20f37c[_0x31a163]);}}}};Preview[_0x7bce('0xe')][_0x7bce('0x6c')]=function(_0x549b67){var _0x318d25=this;this[_0x7bce('0x12')]['enqueue'](function(){if(!_[_0x7bce('0x6d')](_0x318d25['actions'][_0x549b67])){loggerAction[_0x7bce('0x58')](_0x7bce('0x6e'),_0x549b67,'Queue',_0x318d25['actions'][_0x549b67]['queue'],_0x7bce('0x6f'),JSON[_0x7bce('0x55')](_0x318d25[_0x7bce('0x13')][_0x318d25[_0x7bce('0x16')][_0x549b67][_0x7bce('0x70')]][_0x7bce('0x4d')]),'pTalking:\x20',JSON[_0x7bce('0x55')](_0x318d25['campaignsPreview'][_0x318d25['actions'][_0x549b67][_0x7bce('0x70')]][_0x7bce('0x5d')]),JSON[_0x7bce('0x55')](_0x318d25['actions'][_0x549b67][_0x7bce('0x71')]),JSON[_0x7bce('0x55')](_[_0x7bce('0x72')](_0x318d25[_0x7bce('0x16')][_0x549b67],['contactId',_0x7bce('0x73'),'VoiceQueueId',_0x7bce('0x74')])));return ami[_0x7bce('0x75')]({'action':_0x7bce('0x76'),'channel':_0x318d25[_0x7bce('0x16')][_0x549b67][_0x7bce('0x77')]})['catch'](function(_0x3a8e75){if(_0x3a8e75[_0x7bce('0x4c')]===_0x7bce('0x78')){setTimeout(function(){if(_0x318d25[_0x7bce('0x16')][_0x549b67]){ut[_0x7bce('0x79')](_0x318d25[_0x7bce('0x13')][_0x318d25['actions'][_0x549b67][_0x7bce('0x70')]],_0x7bce('0x7a'));if(_0x318d25[_0x7bce('0x16')][_0x549b67][_0x7bce('0x71')]===!![]){ut[_0x7bce('0x7b')](_0x318d25[_0x7bce('0x13')][_0x318d25['actions'][_0x549b67][_0x7bce('0x70')]],_0x7bce('0x7a'));ut[_0x7bce('0x7c')](_0x7bce('0x7d')+_0x549b67,_0x318d25[_0x7bce('0x16')][_0x549b67]['queue']);}ut[_0x7bce('0x7c')](_0x7bce('0x7e')+_0x549b67,_0x318d25[_0x7bce('0x16')][_0x549b67]['queue']);delete _0x318d25['actions'][_0x549b67];}},0x2328);}});}});};Preview[_0x7bce('0xe')][_0x7bce('0x68')]=function(){var _0x3e4b0d=this;loggerAction['info'](_0x7bce('0x7f'),_[_0x7bce('0x80')](this[_0x7bce('0x16')]));for(var _0x55af20 in this[_0x7bce('0x16')]){if(_0x3e4b0d[_0x7bce('0x16')][_0x7bce('0x69')](_0x55af20)){_0x3e4b0d[_0x7bce('0x6c')](_0x55af20);}}};Preview['prototype'][_0x7bce('0x6b')]=function(_0x17ed51){var _0x94841a=this;rpcDb[_0x7bce('0x81')](_0x17ed51['id'],ut[_0x7bce('0x82')](this[_0x7bce('0x17')]))[_0x7bce('0x83')](function(_0x72bffa){if(!_['isNil'](_0x72bffa)){for(var _0x39a0b0=0x0;_0x39a0b0<_0x72bffa[_0x7bce('0x84')];_0x39a0b0+=0x1){if(ut['getDiff'](_0x72bffa[_0x39a0b0][_0x7bce('0x85')])<_0x17ed51['dialRecallMeTimeout']*0x3c){if(_0x72bffa[_0x39a0b0]['Agent']&&!_0x72bffa[_0x39a0b0][_0x7bce('0x86')][_0x7bce('0x87')]){_0x94841a['run'](_0x72bffa[_0x39a0b0]['id'])['then'](ut[_0x7bce('0x88')](_0x7bce('0x89')))[_0x7bce('0x8a')](ut[_0x7bce('0x88')]('[RecallMe]'));}else{rpcDb[_0x7bce('0x8b')](_0x72bffa[_0x39a0b0]['id']);}}else{var _0x17b7d0=new Action(_0x72bffa[_0x39a0b0],_0x17ed51);_0x17b7d0[_0x7bce('0x8c')]=moment()[_0x7bce('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x17ed51['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x17b7d0,0x17,_0x7bce('0x8d'));if(_0x17ed51[_0x7bce('0x8e')]){rpcDb[_0x7bce('0x8f')](ut['createBody'](_0x72bffa[_0x39a0b0]));rpcDb[_0x7bce('0x90')](_0x17b7d0,_0x7bce('0x91'));}else{ut['logCustomer'](_0x17b7d0,0x16,'RecallFailedTimeout');rpcDb[_0x7bce('0x90')](_0x17b7d0,_0x7bce('0x92'));rpcDb[_0x7bce('0x93')](_0x17b7d0,'[HistoryRecallClose]');}}}}})[_0x7bce('0x8a')](ut[_0x7bce('0x88')]('[getContactRecallMe]'));};Preview[_0x7bce('0xe')][_0x7bce('0x6a')]=function(_0xb96114){_0xb96114[_0x7bce('0x5c')]=!![];if(ut['IsNotLoggedIn'](_0xb96114[_0x7bce('0x2b')])){_0xb96114['message']=_0x7bce('0x94');}else if(!ut['isActive'](_0xb96114[_0x7bce('0x32')])){_0xb96114[_0x7bce('0x4c')]=_0x7bce('0x5f');}else if(!this[_0x7bce('0x95')](_0xb96114['Trunk'])){if(!this[_0x7bce('0x95')](_0xb96114[_0x7bce('0x96')])){_0xb96114[_0x7bce('0x4c')]=_0x7bce('0x97');}else{_0xb96114[_0x7bce('0x4c')]='ACTIVE';}}else{_0xb96114[_0x7bce('0x4c')]=_0x7bce('0x98');}emitCampaignPreview(_0xb96114);};Preview[_0x7bce('0xe')][_0x7bce('0x99')]=function(_0x574c1b,_0x1e6605,_0x144907){var _0x334e6b=this;var _0x43cc27=this[_0x7bce('0x16')][_0x1e6605];var _0x163e31=this[_0x7bce('0x13')][_0x43cc27[_0x7bce('0x70')]];var _0x508268;if(_0x163e31){switch(_0x144907){case'1':_0x163e31[_0x7bce('0x3f')]+=0x1;_0x43cc27[_0x7bce('0x9a')]+=0x1;_0x43cc27[_0x7bce('0x9b')]=ut[_0x7bce('0x9c')](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0x0,_0x7bce('0x9e'));ami[_0x7bce('0x26')](_0x7bce('0x9f'),ut['buildObj'](_0x43cc27,'nosuchnumber'));rpcDb[_0x7bce('0x90')](_0x43cc27,_0x7bce('0xa0'));if(ut[_0x7bce('0x9c')](_0x43cc27)>=_0x163e31[_0x7bce('0xa1')]){_0x508268=ut[_0x7bce('0xa2')](_0x43cc27,0xf,_0x7bce('0xa3'));rpcDb['createCustomerFinal'](_0x508268,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x43cc27['countnosuchnumberretry']>=_0x163e31[_0x7bce('0xa4')]){rpcDb[_0x7bce('0x93')](_0x43cc27,_0x7bce('0xa5'));}else{rpcDb[_0x7bce('0xa6')](ut[_0x7bce('0xa7')](_0x43cc27,'countnosuchnumberretry',_0x163e31[_0x7bce('0xa8')]),_0x43cc27[_0x7bce('0xa9')],_0x43cc27[_0x7bce('0xaa')]);}}delete this[_0x7bce('0x16')][_0x574c1b[_0x7bce('0xab')]];break;case _0x7bce('0xac'):var _0x49b78c=moment()['format'](_0x7bce('0xad'));_0x43cc27[_0x7bce('0xae')]=_0x49b78c;_0x43cc27[_0x7bce('0xaf')]=_0x49b78c;_0x43cc27[_0x7bce('0x71')]=!![];_0x163e31[_0x7bce('0x5d')]+=0x1;logger[_0x7bce('0x58')](_0x7bce('0xb0'),_0x43cc27[_0x7bce('0xb1')],_0x7bce('0xb2'),_0x163e31[_0x7bce('0x29')],'pTalking:\x20',_0x163e31[_0x7bce('0x5d')]);ami[_0x7bce('0x26')]('custom:agentconnect',ut['buildObj'](_0x43cc27,_0x7bce('0xb3'),this[_0x7bce('0x13')][_0x43cc27['queue']]));if(_0x163e31['acw']){ami['emit']('custom:agentConnectPreview',ut[_0x7bce('0xb4')](_0x43cc27));}break;case'16':ami[_0x7bce('0x26')](_0x7bce('0xb5'),ut[_0x7bce('0xb6')](_0x43cc27,_0x7bce('0xb7'),this['campaignsPreview'][_0x43cc27[_0x7bce('0x70')]]));emitVoiceQueueChannelRemove(ut[_0x7bce('0xb6')](_0x43cc27,_0x7bce('0xb7')));_0x163e31[_0x7bce('0xb8')]+=0x1;_0x163e31[_0x7bce('0x2f')]+=0x1;_0x163e31['answered']+=0x1;ut['decrementTalkink'](_0x163e31,'[16]');_0x43cc27[_0x7bce('0x9b')]=ut[_0x7bce('0x9c')](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0x4,_0x7bce('0xb9'));rpcDb[_0x7bce('0x90')](_0x43cc27,_0x7bce('0xba'));rpcDb['createCustomerFinal'](_0x43cc27,_0x7bce('0xbb'));rpcDb[_0x7bce('0xbc')](_0x43cc27);_0x163e31['sumDuration']+=_0x43cc27[_0x7bce('0xbd')];_0x163e31['sumBillable']+=_0x43cc27[_0x7bce('0xbd')];logger[_0x7bce('0x58')](_0x7bce('0xbe'),_0x43cc27['uniqueid'],_0x7bce('0xb2'),_0x163e31['name'],_0x7bce('0xbf'),_0x163e31['pTalking']);delete this['actions'][_0x574c1b['linkedid']];break;case'BUSY':_0x163e31[_0x7bce('0x39')]+=0x1;_0x43cc27[_0x7bce('0xc0')]+=0x1;_0x43cc27['countglobal']=ut['totalGlobal'](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0x5,'Busy');ami[_0x7bce('0x26')](_0x7bce('0xc1'),ut['buildObj'](_0x43cc27,'busy'));rpcDb[_0x7bce('0x90')](_0x43cc27,_0x7bce('0xc2'));if(ut[_0x7bce('0x9c')](_0x43cc27)>=_0x163e31['dialGlobalMaxRetry']){_0x508268=ut[_0x7bce('0xa2')](_0x43cc27,0xf,'Global');rpcDb['createCustomerFinal'](_0x508268,_0x7bce('0xc3'));}else{if(_0x43cc27['countbusyretry']>=_0x163e31[_0x7bce('0xc4')]){rpcDb[_0x7bce('0x93')](_0x43cc27,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x7bce('0xa6')](ut['scheduledAt'](_0x43cc27,_0x7bce('0xc0'),_0x163e31[_0x7bce('0xc5')]),_0x43cc27['unlockAgent'],_0x43cc27[_0x7bce('0xaa')]);}}break;case'NOANSWER':_0x163e31['outboundNoAnswerCallsDay']+=0x1;_0x43cc27[_0x7bce('0xc6')]+=0x1;_0x43cc27[_0x7bce('0x9b')]=ut[_0x7bce('0x9c')](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0x3,_0x7bce('0xc7'));ami[_0x7bce('0x26')](_0x7bce('0xc8'),ut[_0x7bce('0xb6')](_0x43cc27,_0x7bce('0xc9')));rpcDb[_0x7bce('0x90')](_0x43cc27,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x43cc27)>=_0x163e31['dialGlobalMaxRetry']){_0x508268=ut[_0x7bce('0xa2')](_0x43cc27,0xf,_0x7bce('0xa3'));rpcDb[_0x7bce('0x93')](_0x508268,_0x7bce('0xca'));}else{if(_0x43cc27[_0x7bce('0xc6')]>=_0x163e31['dialNoAnswerMaxRetry']){rpcDb[_0x7bce('0x93')](_0x43cc27,_0x7bce('0xcb'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x43cc27,'countnoanswerretry',_0x163e31[_0x7bce('0xcc')]),_0x43cc27[_0x7bce('0xa9')],_0x43cc27['activeContact']);}}break;case _0x7bce('0xcd'):_0x163e31[_0x7bce('0x3a')]+=0x1;_0x43cc27['countcongestionretry']+=0x1;_0x43cc27[_0x7bce('0x9b')]=ut[_0x7bce('0x9c')](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0x8,'Congestion');ami['emit'](_0x7bce('0xce'),ut['buildObj'](_0x43cc27,_0x7bce('0xcf')));rpcDb[_0x7bce('0x90')](_0x43cc27,_0x7bce('0xd0'));if(ut['totalGlobal'](_0x43cc27)>=_0x163e31['dialGlobalMaxRetry']){_0x508268=ut[_0x7bce('0xa2')](_0x43cc27,0xf,_0x7bce('0xa3'));rpcDb['createCustomerFinal'](_0x508268,_0x7bce('0xd1'));}else{if(_0x43cc27['countcongestionretry']>=_0x163e31[_0x7bce('0xd2')]){rpcDb[_0x7bce('0x93')](_0x43cc27,_0x7bce('0xd0'));}else{rpcDb[_0x7bce('0xa6')](ut[_0x7bce('0xa7')](_0x43cc27,_0x7bce('0xd3'),_0x163e31[_0x7bce('0xc5')]),_0x43cc27[_0x7bce('0xa9')],_0x43cc27[_0x7bce('0xaa')]);}}break;case _0x7bce('0xd4'):_0x163e31[_0x7bce('0x40')]+=0x1;_0x43cc27['countagentrejectretry']+=0x1;_0x43cc27[_0x7bce('0x9b')]=ut['totalGlobal'](_0x43cc27);ut['logCustomer'](_0x43cc27,0x14,_0x7bce('0xd5'));ami[_0x7bce('0x26')]('custom:agentreject',ut[_0x7bce('0xb6')](_0x43cc27,_0x7bce('0xd6')));rpcDb[_0x7bce('0x90')](_0x43cc27,_0x7bce('0xd7'));if(ut[_0x7bce('0x9c')](_0x43cc27)>=_0x163e31[_0x7bce('0xa1')]){_0x508268=ut[_0x7bce('0xa2')](_0x43cc27,0x14,_0x7bce('0xd5'));rpcDb[_0x7bce('0x93')](_0x508268,_0x7bce('0xd8'));}else{if(_0x43cc27[_0x7bce('0xd9')]>=_0x163e31[_0x7bce('0xda')]){rpcDb[_0x7bce('0x93')](_0x43cc27,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7bce('0xa6')](ut['scheduledAt'](_0x43cc27,_0x7bce('0xd9'),_0x163e31['dialAgentRejectRetryFrequency']),_0x43cc27[_0x7bce('0xa9')],_0x43cc27[_0x7bce('0xaa')]);}}break;case'ABANDONED':_0x163e31[_0x7bce('0x42')]+=0x1;_0x43cc27[_0x7bce('0xdb')]+=0x1;_0x43cc27[_0x7bce('0x9b')]=ut[_0x7bce('0x9c')](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0xb,_0x7bce('0xdc'));rpcDb[_0x7bce('0x90')](_0x43cc27,_0x7bce('0xdd'));if(ut[_0x7bce('0x9c')](_0x43cc27)>=_0x163e31[_0x7bce('0xa1')]){_0x508268=ut['cloneAction'](_0x43cc27,0xf,_0x7bce('0xa3'));rpcDb[_0x7bce('0x93')](_0x508268,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x43cc27[_0x7bce('0xde')]>=_0x163e31[_0x7bce('0xdf')]){rpcDb[_0x7bce('0x93')](_0x43cc27,_0x7bce('0xdd'));}else{rpcDb[_0x7bce('0xa6')](ut[_0x7bce('0xa7')](_0x43cc27,_0x7bce('0xdb'),_0x163e31[_0x7bce('0xe0')]),_0x43cc27[_0x7bce('0xa9')],_0x43cc27['activeContact']);}}break;case'18':_0x163e31['outboundUnknownCallsDay']+=0x1;_0x43cc27[_0x7bce('0xe1')]+=0x1;_0x43cc27[_0x7bce('0x9b')]=ut[_0x7bce('0x9c')](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0x12,_0x574c1b[_0x7bce('0xe2')]||_0x574c1b['dialstatus']);ami[_0x7bce('0x26')](_0x7bce('0xe3'),ut['buildObj'](_0x43cc27,_0x7bce('0xe4')));rpcDb['createCustomerHistory'](_0x43cc27,_0x7bce('0xe5'));if(ut[_0x7bce('0x9c')](_0x43cc27)>=_0x163e31[_0x7bce('0xa1')]){_0x508268=ut[_0x7bce('0xa2')](_0x43cc27,0xf,_0x7bce('0xa3'));rpcDb[_0x7bce('0x93')](_0x508268,_0x7bce('0xe5'));}else{rpcDb[_0x7bce('0x93')](_0x43cc27,_0x7bce('0xe5'));}delete this['actions'][_0x574c1b[_0x7bce('0xab')]];break;case'19':_0x163e31['outboundUnknownCallsDay']+=0x1;_0x43cc27['countglobal']=ut[_0x7bce('0x9c')](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0x13,_0x574c1b[_0x7bce('0xe2')]||_0x574c1b['dialstatus']);ami[_0x7bce('0x26')](_0x7bce('0xe3'),ut[_0x7bce('0xb6')](_0x43cc27,_0x7bce('0xe4')));rpcDb[_0x7bce('0x90')](_0x43cc27,'[callProgressDetectingCustomer][machine]');if(ut[_0x7bce('0x9c')](_0x43cc27)>=_0x163e31['dialGlobalMaxRetry']){_0x508268=ut[_0x7bce('0xa2')](_0x43cc27,0xf,'Global');rpcDb['createCustomerFinal'](_0x508268,_0x7bce('0xe6'));}else{rpcDb['createCustomerFinal'](_0x43cc27,_0x7bce('0xe6'));}delete this[_0x7bce('0x16')][_0x574c1b[_0x7bce('0xab')]];break;default:if(_0x43cc27[_0x7bce('0x71')]){ut[_0x7bce('0x7b')](_0x163e31,_0x7bce('0xe7'));ut[_0x7bce('0x7c')](_0x7bce('0xe8')+_0x163e31['name'],_0x574c1b);}_0x163e31[_0x7bce('0x41')]+=0x1;_0x43cc27[_0x7bce('0x9b')]=ut['totalGlobal'](_0x43cc27);ut[_0x7bce('0x9d')](_0x43cc27,0xc,_0x574c1b[_0x7bce('0xe2')]||_0x574c1b[_0x7bce('0xe9')]);rpcDb[_0x7bce('0x90')](_0x43cc27,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x43cc27)>=_0x163e31[_0x7bce('0xa1')]){_0x508268=ut[_0x7bce('0xa2')](_0x43cc27,0xf,_0x7bce('0xa3'));rpcDb[_0x7bce('0x93')](_0x508268,_0x7bce('0xea'));}else{rpcDb[_0x7bce('0x93')](_0x43cc27,_0x7bce('0xea'));}delete this['actions'][_0x574c1b[_0x7bce('0xab')]];}if(!(_0x43cc27['dialAnswer']&&_0x144907==='16')){ut['updateOriginated'](_0x163e31,_0x7bce('0xeb'));logger[_0x7bce('0x58')](_0x7bce('0xec'),_0x43cc27[_0x7bce('0xb1')],_0x7bce('0xb2'),_0x163e31[_0x7bce('0x29')],'originated:\x20',_0x163e31[_0x7bce('0x4d')]);}if(_0x144907!==_0x7bce('0xac')){delete this[_0x7bce('0x16')][_0x574c1b[_0x7bce('0xab')]];delete this[_0x7bce('0x16')][_0x574c1b[_0x7bce('0xed')]];}}};Preview[_0x7bce('0xe')][_0x7bce('0xee')]=function(_0x29c412,_0x5e0fb6,_0xa29a40){if(_[_0x7bce('0xef')](_0x5e0fb6)&&'object'!==typeof _0x5e0fb6){return;}if(_[_0x7bce('0xef')](_0xa29a40)&&_0x7bce('0xf0')!==typeof _0xa29a40){return;}switch(_0xa29a40[_0x7bce('0xf1')]){case'0':ut[_0x7bce('0xf2')](_0x29c412,0x0,_0x7bce('0x9e'));rpcDb[_0x7bce('0xf3')](_0x29c412,_0x7bce('0xf4'));break;case'3':ut[_0x7bce('0xf2')](_0x29c412,0x3,_0x7bce('0xc7'));rpcDb[_0x7bce('0xf3')](_0x29c412,_0x7bce('0xf5'));break;case'5':ut['logAgent'](_0x29c412,0x5,_0x7bce('0xf6'));rpcDb[_0x7bce('0xf3')](_0x29c412,_0x7bce('0xf7'));break;case'8':ut[_0x7bce('0xf2')](_0x29c412,0x8,_0x7bce('0xf8'));rpcDb[_0x7bce('0xf3')](_0x29c412,_0x7bce('0xf9'));break;case'22':ut[_0x7bce('0xf2')](_0x29c412,0x16,_0x7bce('0xfa'));rpcDb[_0x7bce('0xf3')](_0x29c412,_0x7bce('0xfb'));break;default:ut[_0x7bce('0xf2')](_0x29c412,0xc,_0xa29a40['reason']);rpcDb[_0x7bce('0xf3')](_0x29c412,_0x7bce('0xf9'));}ut['updateOriginated'](_0x5e0fb6,_0x7bce('0xfc'));logger[_0x7bce('0x58')](_0x7bce('0xfd'),_0x29c412[_0x7bce('0xb1')],_0x7bce('0xb2'),_0x5e0fb6[_0x7bce('0x29')],_0x7bce('0x6f'),_0x5e0fb6[_0x7bce('0x4d')]);delete this[_0x7bce('0x16')][_0x29c412['uniqueid']];};Preview[_0x7bce('0xe')]['checkInBlack']=function(_0x3ca03f,_0x33d5a6,_0x585df4,_0x231752,_0x3a23f3){var _0x1bcb45=this;return new BPromise(function(_0x841564,_0x5160b0){if(_[_0x7bce('0x6d')](_0x33d5a6)||_['isNil'](_0x33d5a6[_0x7bce('0xfe')])||_[_0x7bce('0x6d')](_0x33d5a6[_0x7bce('0xfe')][_0x7bce('0xff')])||_['isNil'](_0x33d5a6[_0x7bce('0x100')])){_0x5160b0(ut[_0x7bce('0x4c')](_0x7bce('0x101'),_0x231752,_0x3a23f3));return;}var _0x4d68aa=uuid['v4']();var _0x23153f=_0x1bcb45[_0x7bce('0x13')][_0x33d5a6[_0x7bce('0x102')][_0x7bce('0x29')]];var _0x45eab2=_0x585df4?_0x1bcb45[_0x7bce('0x17')][_0x585df4]['id']:undefined;_0x1bcb45['actions'][_0x4d68aa]=new Action(_0x33d5a6,_0x23153f,_0x4d68aa,_0x585df4,_0x45eab2);var _0xb6e0e9=_0x1bcb45[_0x7bce('0x16')][_0x4d68aa];_0xb6e0e9['unlockAgent']=_0x231752;_0xb6e0e9[_0x7bce('0xaa')]=_0x3a23f3;_0xb6e0e9[_0x7bce('0x103')]=_0x585df4;if(_[_0x7bce('0x104')](_0x3ca03f)){_0x1bcb45['execCall'](_0xb6e0e9,_0x23153f,_0x33d5a6,_0x585df4)[_0x7bce('0x83')](function(_0x30dc1c){logger[_0x7bce('0x58')]('[Preview][execCall][success]',_0x7bce('0x105')+_0xb6e0e9['queue']+_0x7bce('0x106')+_0xb6e0e9['idContact'],JSON[_0x7bce('0x55')](_0x30dc1c));ami['emit'](_0x7bce('0x107'),ut[_0x7bce('0xb6')](_0xb6e0e9,_0x7bce('0x108'),_0x1bcb45[_0x7bce('0x13')][_0xb6e0e9[_0x7bce('0x70')]]));_0x841564(ut[_0x7bce('0x4c')](_0x7bce('0x109')));})['catch'](function(_0x5111b5){ut['logger'](_0x7bce('0x10a'),_0x5111b5);_0x5160b0(ut[_0x7bce('0x4c')](_0x7bce('0x10b'),_0x231752,_0x3a23f3));});}else{_0x23153f[_0x7bce('0x38')]+=0x1;ut[_0x7bce('0x10c')](_0xb6e0e9);rpcDb['createHistory'](_0xb6e0e9,_0x7bce('0x10d'));delete _0x1bcb45[_0x7bce('0x16')][_0x4d68aa];_0x5160b0(ut[_0x7bce('0x4c')]('Contact\x20in\x20black\x20List',_0x231752,_0x3a23f3));}});};Preview[_0x7bce('0xe')][_0x7bce('0x95')]=function(_0x2f6254){return!_[_0x7bce('0x6d')](_0x2f6254)&&!_[_0x7bce('0x6d')](_0x2f6254['name'])&&!_[_0x7bce('0x6d')](_0x2f6254[_0x7bce('0x52')])&&_0x2f6254['active']&&!_['isNil'](this[_0x7bce('0x15')][util[_0x7bce('0x56')](_0x7bce('0x10e'),_0x2f6254['name'])])&&!_[_0x7bce('0x6d')](this[_0x7bce('0x15')][util[_0x7bce('0x56')](_0x7bce('0x10e'),_0x2f6254[_0x7bce('0x29')])][_0x7bce('0x76')])&&(this['trunks'][util[_0x7bce('0x56')](_0x7bce('0x10e'),_0x2f6254[_0x7bce('0x29')])][_0x7bce('0x76')]==='reachable'||this[_0x7bce('0x15')][util[_0x7bce('0x56')]('SIP/%s',_0x2f6254[_0x7bce('0x29')])][_0x7bce('0x76')]===_0x7bce('0x10f'));};Preview[_0x7bce('0xe')][_0x7bce('0x110')]=function(_0xb39f5c,_0x5232d2){var _0xcf0f7d=this;return new BPromise(function(_0x43b11d,_0xfbbbdc){_0xcf0f7d['execRun'](_0xb39f5c,_0x5232d2)['then'](function(_0x1f8e20){_0x43b11d(_['pick'](_0x1f8e20,[_0x7bce('0x4c')]));})[_0x7bce('0x8a')](function(_0x3b2e67){if(_0x3b2e67['unlock']){rpcDb['unlockContact'](_0xb39f5c);}if(_0x3b2e67[_0x7bce('0x52')]){rpcDb[_0x7bce('0x8b')](_0xb39f5c);}_0xfbbbdc(_['pick'](_0x3b2e67,[_0x7bce('0x4c')]));});});};Preview[_0x7bce('0xe')]['execRun']=function(_0x54c46f,_0x41e6fb){var _0x1ca544=this;return new BPromise(function(_0x32164f,_0x9fdc53){var _0x505f2b,_0x45f7cf;rpcDb[_0x7bce('0x111')](_0x54c46f)[_0x7bce('0x83')](function(_0x5f1a7a){if(!_[_0x7bce('0x6d')](_0x5f1a7a[0x0])){_0x45f7cf=_0x5f1a7a[0x0]['recallme']?![]:!![];_0x505f2b=_0x5f1a7a[0x0][_0x7bce('0x112')]?!![]:![];_0x505f2b=_0x41e6fb?!![]:_0x505f2b;}var _0x474a17=_0x1ca544[_0x7bce('0x113')](_0x5f1a7a);if(_0x474a17['isValid']){rpcDb[_0x7bce('0x114')](_[_0x7bce('0x72')](_0x5f1a7a[0x0],[_0x7bce('0x100'),'Contact.phone']))['then'](function(_0x3289ec){_0x1ca544[_0x7bce('0x115')](_0x3289ec,_0x5f1a7a[0x0],_0x41e6fb,_0x45f7cf,_0x505f2b)[_0x7bce('0x83')](function(_0x3928c4){_0x32164f(_0x3928c4);})[_0x7bce('0x8a')](function(_0x5ad54d){_0x9fdc53(_0x5ad54d);});})[_0x7bce('0x8a')](function(_0x5418c2){ut[_0x7bce('0x60')](_0x7bce('0x116'),_0x5418c2);_0x9fdc53(ut['message'](_0x7bce('0x117'),_0x45f7cf,_0x505f2b));});}else{_0x9fdc53(ut[_0x7bce('0x4c')](_0x474a17[_0x7bce('0x4c')],_0x45f7cf,_0x505f2b));}})['catch'](function(_0x54722e){ut[_0x7bce('0x60')](_0x7bce('0x118'),_0x54722e);_0x9fdc53(ut[_0x7bce('0x4c')](_0x7bce('0x117'),![],!![]));});});};Preview[_0x7bce('0xe')]['validateContact']=function(_0x35eb28){if(_[_0x7bce('0x6d')](_0x35eb28)||_[_0x7bce('0x104')](_0x35eb28)||!_['isNil'](_0x35eb28[0x0][_0x7bce('0x86')])&&_['isNil'](_0x35eb28[0x0][_0x7bce('0x86')]['name'])){ut[_0x7bce('0x60')](_0x7bce('0x119'),_0x35eb28);return{'isValid':![],'message':_0x7bce('0x11a')};}var _0x74c7e5=this[_0x7bce('0x13')][_0x35eb28[0x0]['Queue'][_0x7bce('0x29')]];_0x74c7e5[_0x7bce('0x4c')]=_0x7bce('0x98');if(_['isNil'](_0x74c7e5)){ut['logger'](_0x7bce('0x11b'),_0x74c7e5);return{'isValid':![],'message':_0x7bce('0x11c')};}if(!this[_0x7bce('0x95')](_0x74c7e5[_0x7bce('0x51')])){ut[_0x7bce('0x60')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x7bce('0x11d')+_0x74c7e5[_0x7bce('0x29')]+_0x7bce('0x11e'));if(!this['isTrunkReachable'](_0x74c7e5['TrunkBackup'])){ut['logger'](_0x7bce('0x11f'),_0x74c7e5[_0x7bce('0x29')]+_0x7bce('0x120'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x74c7e5[_0x7bce('0x32')])){ut[_0x7bce('0x60')](_0x7bce('0x121'),_0x74c7e5['name']+_0x7bce('0x122'));return{'isValid':![],'message':_0x7bce('0x11d')+_0x74c7e5['name']+_0x7bce('0x122')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x7bce('0xe')][_0x7bce('0x123')]=function(_0x11539e,_0x5eb60f,_0x2a2465,_0x345e50){var _0x6f30dc=this;return new BPromise(function(_0x5a104,_0x4dd231){var _0x2c511c=_0x11539e[_0x7bce('0xb1')];var _0x152e43=_0x6f30dc[_0x7bce('0x95')](_0x5eb60f['Trunk'])?util[_0x7bce('0x56')](_0x7bce('0x124'),_0x5eb60f[_0x7bce('0x51')]['name'],_['isNil'](_0x5eb60f[_0x7bce('0x37')])?'':_0x5eb60f[_0x7bce('0x37')][_0x7bce('0x125')]()||'',_0x5eb60f[_0x7bce('0x126')]>0x0?_0x2a2465[_0x7bce('0xfe')][_0x7bce('0xff')][_0x7bce('0x127')](_0x5eb60f[_0x7bce('0x126')]):_0x2a2465[_0x7bce('0xfe')][_0x7bce('0xff')]):util[_0x7bce('0x56')](_0x7bce('0x124'),_['isNil'](_0x5eb60f[_0x7bce('0x96')])?_0x5eb60f[_0x7bce('0x51')][_0x7bce('0x29')]:_0x5eb60f[_0x7bce('0x96')][_0x7bce('0x29')],_[_0x7bce('0x6d')](_0x5eb60f[_0x7bce('0x37')])?'':_0x5eb60f[_0x7bce('0x37')]['trim']()||'',_0x5eb60f[_0x7bce('0x126')]>0x0?_0x2a2465[_0x7bce('0xfe')][_0x7bce('0xff')][_0x7bce('0x127')](_0x5eb60f[_0x7bce('0x126')]):_0x2a2465[_0x7bce('0xfe')][_0x7bce('0xff')]);var _0x125fff=_0x6f30dc[_0x7bce('0x95')](_0x5eb60f[_0x7bce('0x51')])?ut[_0x7bce('0x128')](_0x5eb60f[_0x7bce('0x51')][_0x7bce('0x53')],_0x5eb60f[_0x7bce('0x34')],_0x5eb60f[_0x7bce('0x129')]>0x0?ut[_0x7bce('0x12a')](_0x5eb60f['dialOriginateCallerIdNumber'],_0x5eb60f['dialRandomLastDigitCallerIdNumber']):_0x5eb60f['dialOriginateCallerIdNumber']):ut[_0x7bce('0x128')](_[_0x7bce('0x6d')](_0x5eb60f['TrunkBackup'])?_0x5eb60f[_0x7bce('0x51')]['callerid']:_0x5eb60f[_0x7bce('0x96')][_0x7bce('0x53')],_0x5eb60f['dialOriginateCallerIdName'],_0x5eb60f[_0x7bce('0x129')]>0x0?ut[_0x7bce('0x12a')](_0x5eb60f[_0x7bce('0x35')],_0x5eb60f[_0x7bce('0x129')]):_0x5eb60f['dialOriginateCallerIdNumber']);if(_0x125fff){_0x11539e[_0x7bce('0x12b')]=ut[_0x7bce('0x12c')](_0x125fff);_0x11539e['originatecalleridnum']=ut[_0x7bce('0x12d')](_0x125fff);}var _0x1a0468=ut[_0x7bce('0x12e')](_0x5eb60f,_0x2a2465,_0x152e43,_0x125fff,_0x2c511c,_0x11539e);_[_0x7bce('0x12f')](_0x11539e,ut['toLowerVariables'](_0x1a0468));_0x11539e['starttime']=moment()[_0x7bce('0x56')](_0x7bce('0xad'));ami[_0x7bce('0x75')](ut[_0x7bce('0x130')](_0x11539e,_0x5eb60f,_0x1a0468,_0x11539e[_0x7bce('0xaa')],_0x345e50))[_0x7bce('0x83')](function(_0x1e2741){var _0x5e4a84=_0x11539e[_0x7bce('0x131')];if(!_[_0x7bce('0x6d')](_0x5e4a84)){if(!_[_0x7bce('0x6d')](_0x6f30dc['agents'][_0x5e4a84])){_0x6f30dc[_0x7bce('0x17')][_0x5e4a84][_0x7bce('0x132')]=_0x11539e[_0x7bce('0x133')];emit(util['format'](_0x7bce('0x134'),_0x6f30dc[_0x7bce('0x17')][_0x5e4a84]['name']),_0x7bce('0x135'),{'destaccountcode':_0x6f30dc['agents'][_0x5e4a84]['accountcode'],'destconnectedlinenum':_0x11539e['calleridnum']});}}_0x5eb60f['originated']+=0x1;logger['info'](_0x7bce('0x136'),_0x2c511c,_0x7bce('0xb2'),_0x5eb60f[_0x7bce('0x29')],_0x7bce('0x6f'),_0x5eb60f[_0x7bce('0x4d')]);_0x5a104(_0x1e2741);})['catch'](function(_0x3fe0bf){ut[_0x7bce('0xf2')](_0x11539e,0xe,_0x7bce('0x137'));rpcDb[_0x7bce('0xf3')](_0x11539e,_0x7bce('0x138'));_0x4dd231(_0x3fe0bf);});});};Preview['prototype']['syncNewExten']=function(_0x58669e){if(this[_0x7bce('0x16')][_0x58669e['linkedid']]){this['actions'][_0x58669e[_0x7bce('0xab')]][_0x7bce('0x77')]=_0x58669e['channel'];}};Preview[_0x7bce('0xe')][_0x7bce('0x139')]=function(_0x4a2f12){var _0x124a09=this;var _0x4718f9=this[_0x7bce('0x16')][_0x4a2f12[_0x7bce('0x13a')]];if(_0x4718f9){if(_0x4718f9[_0x7bce('0x103')]&&this['agents'][_0x4718f9[_0x7bce('0x103')]]){ut[_0x7bce('0x13b')](_0x4718f9,this[_0x7bce('0x17')][_0x4718f9[_0x7bce('0x103')]][_0x7bce('0x29')],this[_0x7bce('0x17')][_0x4718f9['lookAgent']]['id']);}var _0x133bd2=_[_0x7bce('0x13c')](_0x4718f9);_0x133bd2[_0x7bce('0xae')]=moment()['format'](_0x7bce('0xad'));var _0x546d0d=_0x124a09[_0x7bce('0x13')][_0x4718f9['queue']];if(ut['isFailure'](_0x4a2f12[_0x7bce('0x13d')])){if(_0x4718f9[_0x7bce('0xa9')]){rpcDb[_0x7bce('0x13e')](_0x4718f9[_0x7bce('0x13f')]);}if(_0x4718f9[_0x7bce('0xaa')]){rpcDb[_0x7bce('0x8b')](_0x4718f9[_0x7bce('0x13f')]);}ami[_0x7bce('0x26')](_0x7bce('0x140'),ut['buildObj'](_0x4718f9,'rejected',this[_0x7bce('0x13')][_0x4718f9[_0x7bce('0x70')]]));this[_0x7bce('0xee')](_0x133bd2,_0x546d0d,_0x4a2f12);}else{_0x4718f9[_0x7bce('0x8c')]=moment()[_0x7bce('0x56')](_0x7bce('0xad'));ut[_0x7bce('0xf2')](_0x133bd2,0x4,_0x7bce('0xb9'));rpcDb[_0x7bce('0xf3')](_0x133bd2,_0x7bce('0x141'));}}};Preview[_0x7bce('0xe')][_0x7bce('0x1c')]=function(_0x538cd4){var _0x2010c0=this;var _0x4e2716=this[_0x7bce('0x16')][_0x538cd4[_0x7bce('0xab')]];var _0x2dd246;if(_0x4e2716){_0x2dd246=this[_0x7bce('0x13')][_0x4e2716[_0x7bce('0x70')]];logger['info']('[syncHangup][talking]',_0x538cd4[_0x7bce('0xab')],_0x7bce('0xb2'),_0x2dd246[_0x7bce('0x29')],'pTalking:\x20',_0x2dd246[_0x7bce('0x5d')]);}if(this[_0x7bce('0x16')][_0x538cd4['linkedid']]&&_0x538cd4[_0x7bce('0xab')]!==_0x538cd4[_0x7bce('0xb1')]){if(_0x538cd4[_0x7bce('0x142')]==='16'&&this['actions'][_0x538cd4[_0x7bce('0xab')]]['dialAnswer']){this[_0x7bce('0x99')](_0x538cd4,_0x538cd4[_0x7bce('0xab')],_0x538cd4['cause']);}else if(this[_0x7bce('0x16')][_0x538cd4[_0x7bce('0xab')]]['dialAnswer']){logger[_0x7bce('0x58')]('[syncHangup][talking][cause]',_0x538cd4[_0x7bce('0xab')],_0x538cd4[_0x7bce('0x142')],'\x20Queue',_0x2dd246[_0x7bce('0x29')],_0x7bce('0xbf'),_0x2dd246['pTalking']);this[_0x7bce('0x99')](_0x538cd4,_0x538cd4[_0x7bce('0xab')],_0x538cd4[_0x7bce('0x142')]);}}else if(_0x4e2716&&_['isNil'](_0x4e2716[_0x7bce('0x143')])&&_0x2dd246[_0x7bce('0x144')]&&_0x538cd4['linkedid']===_0x538cd4[_0x7bce('0xb1')]&&_[_0x7bce('0x6d')](_0x538cd4[_0x7bce('0xf1')])&&_0x538cd4[_0x7bce('0x142')]==='16'&&_0x538cd4['channelstate']==='6'&&_[_0x7bce('0xef')](_0x4e2716['transfer'])){if(_0x4e2716[_0x7bce('0xa9')]){rpcDb[_0x7bce('0x13e')](_0x4e2716[_0x7bce('0x13f')]);}if(_0x4e2716[_0x7bce('0xaa')]){rpcDb[_0x7bce('0x8b')](_0x4e2716[_0x7bce('0x13f')]);}_0x538cd4[_0x7bce('0xf1')]='22';this['callProgressDetectingAgent'](_0x4e2716,_0x2dd246,_0x538cd4);}else if(_0x4e2716&&_0x4e2716[_0x7bce('0x145')]){if(_0x538cd4[_0x7bce('0x142')]==='16'&&this['actions'][_0x538cd4[_0x7bce('0xab')]][_0x7bce('0x71')]){logger[_0x7bce('0x58')]('[syncHangup][talking][transfer]',_0x538cd4[_0x7bce('0xab')],_0x538cd4[_0x7bce('0x142')],_0x7bce('0xb2'),_0x2dd246[_0x7bce('0x29')],'pTalking:\x20',_0x2dd246[_0x7bce('0x5d')]);this[_0x7bce('0x99')](_0x538cd4,_0x538cd4[_0x7bce('0xab')],_0x538cd4[_0x7bce('0x142')]);}else if(this[_0x7bce('0x16')][_0x538cd4['linkedid']]['dialAnswer']){logger['info'](_0x7bce('0x146'),_0x538cd4[_0x7bce('0xab')],_0x538cd4[_0x7bce('0x142')],'\x20Queue',_0x2dd246[_0x7bce('0x29')],'pTalking:\x20',_0x2dd246[_0x7bce('0x5d')]);this['callProgressDetectingCustomer'](_0x538cd4,_0x538cd4[_0x7bce('0xab')],_0x538cd4['cause']);}}};Preview[_0x7bce('0xe')][_0x7bce('0x20')]=function(_0x5585b1){if(this[_0x7bce('0x16')][_0x5585b1['destlinkedid']]&&_0x5585b1['destlinkedid']!==_0x5585b1[_0x7bce('0x147')]){this[_0x7bce('0x99')](_0x5585b1,_0x5585b1[_0x7bce('0xed')],_0x5585b1[_0x7bce('0xe9')]);}};Preview[_0x7bce('0xe')][_0x7bce('0x1e')]=function(_0x5e5fef){if(this[_0x7bce('0x16')][_0x5e5fef[_0x7bce('0xab')]]&&_0x5e5fef['linkedid']!==_0x5e5fef[_0x7bce('0xb1')]&&!this[_0x7bce('0x16')][_0x5e5fef[_0x7bce('0xab')]][_0x7bce('0x71')]){if(_0x5e5fef[_0x7bce('0x142')]==='1'){this[_0x7bce('0x99')](_0x5e5fef,_0x5e5fef[_0x7bce('0xab')],_0x5e5fef[_0x7bce('0x142')]);}}};Preview[_0x7bce('0xe')][_0x7bce('0x148')]=function(_0x368607,_0x7de190,_0x23dd87){if(this[_0x7bce('0x16')][_0x368607]){if(_['isNil'](this[_0x7bce('0x16')][_0x368607][_0x7bce('0x149')])){this[_0x7bce('0x16')][_0x368607][_0x7bce('0x149')]={};}this[_0x7bce('0x16')][_0x368607][_0x7bce('0x149')][_0x7de190]=_0x23dd87;}};Preview[_0x7bce('0xe')]['syncVarSet']=function(_0x1bcef2){try{if(!_['isNil'](_0x1bcef2)){if(ut[_0x7bce('0x14a')](_[_0x7bce('0x14b')](_0x1bcef2[_0x7bce('0x14c')])[0x0])){this[_0x7bce('0x148')](_0x1bcef2[_0x7bce('0xb1')],_[_0x7bce('0x14b')](_0x1bcef2[_0x7bce('0x14c')])[0x0],_0x1bcef2[_0x7bce('0x14d')]);}}}catch(_0xe793c5){logger[_0x7bce('0x14e')](_0x7bce('0x14f'),util['inspect'](_0xe793c5,{'showHidden':![],'depth':null}));}};Preview[_0x7bce('0xe')][_0x7bce('0x23')]=function(_0x3a125f){if(_0x3a125f){if(this[_0x7bce('0x16')][_0x3a125f[_0x7bce('0x150')]]){this['actions'][_0x3a125f[_0x7bce('0x150')]][_0x7bce('0x145')]=!![];}}};Preview[_0x7bce('0xe')]['syncBlindTransfer']=function(_0x3ae1ef){if(_0x3ae1ef){if(this[_0x7bce('0x16')][_0x3ae1ef[_0x7bce('0x151')]]){this[_0x7bce('0x16')][_0x3ae1ef['transfererlinkedid']][_0x7bce('0x145')]=!![];}}};module[_0x7bce('0x152')]=Preview; \ No newline at end of file +var _0x20af=['Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','campaign\x20Name:\x20','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','channelAgent','destconnectedlinenum','calleridnum','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','idContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','callProgressDetectingCustomer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','syncDialEnd','destuniqueid','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','./action','./util/util','redis','defaults','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','name','strategy','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','logger','\x20is\x20disactive','prototype','syncCampaigns','outbound','clearZombieChannels','hasOwnProperty','setMessage','recallMe','isNil','actions','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','decrementTalkink','[clearZombieChannel]','loggerError','[action]','clearZombieChannel','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','complete','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x20af,0x187));var _0xf20a=function(_0x5a8ddb,_0x5af370){_0x5a8ddb=_0x5a8ddb-0x0;var _0xd27462=_0x20af[_0x5a8ddb];return _0xd27462;};'use strict';var util=require('util');var _=require(_0xf20a('0x0'));var BPromise=require(_0xf20a('0x1'));var uuid=require(_0xf20a('0x2'));var moment=require(_0xf20a('0x3'));var md5=require(_0xf20a('0x4'));var Redis=require(_0xf20a('0x5'));var config=require('../../../config/environment');var logger=require(_0xf20a('0x6'))(_0xf20a('0x7'));var loggerAction=require('../../../config/logger')(_0xf20a('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xf20a('0x9'));var ut=require(_0xf20a('0xa'));config[_0xf20a('0xb')]=_[_0xf20a('0xc')](config[_0xf20a('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xf20a('0xd'))(new Redis(config[_0xf20a('0xb')]));var Sequence=function(){};Sequence['prototype'][_0xf20a('0xe')]=function(_0x4a4e5e){this[_0xf20a('0xf')]=this['tail']?this['tail'][_0xf20a('0x10')](_0x4a4e5e):_0x4a4e5e();};function Preview(_0x54628e){this[_0xf20a('0x11')]=new Sequence();this[_0xf20a('0x12')]=_0x54628e[_0xf20a('0x13')];this[_0xf20a('0x14')]=_0x54628e[_0xf20a('0x14')];this['actions']={};this[_0xf20a('0x15')]=_0x54628e[_0xf20a('0x15')];this[_0xf20a('0x16')]=0x0;ami['on']('originateresponse',this[_0xf20a('0x17')][_0xf20a('0x18')](this));ami['on'](_0xf20a('0x19'),this[_0xf20a('0x1a')][_0xf20a('0x18')](this));ami['on'](_0xf20a('0x1b'),this[_0xf20a('0x1c')][_0xf20a('0x18')](this));ami['on'](_0xf20a('0x1d'),this['syncDialEnd'][_0xf20a('0x18')](this));ami['on'](_0xf20a('0x1e'),this[_0xf20a('0x1f')][_0xf20a('0x18')](this));ami['on'](_0xf20a('0x20'),this[_0xf20a('0x21')][_0xf20a('0x18')](this));ami['on'](_0xf20a('0x22'),this['syncAttendedTransfer'][_0xf20a('0x18')](this));ami['on'](_0xf20a('0x23'),this[_0xf20a('0x24')][_0xf20a('0x18')](this));this[_0xf20a('0x25')](this['campaignsPreview']);}function emit(_0x5565e1,_0x9966f7,_0x388239){io['to'](_0x5565e1)[_0xf20a('0x26')](_0x9966f7,_0x388239);}function emitCampaignPreview(_0x17983f){if(_0x17983f['type']==='outbound'){var _0x1fc0cb={'id':_0x17983f['id'],'name':_0x17983f[_0xf20a('0x27')],'strategy':_0x17983f[_0xf20a('0x28')],'answered':_0x17983f['answered'],'available':_0x17983f['available'],'loggedIn':_0x17983f[_0xf20a('0x29')],'pTalking':_0x17983f[_0xf20a('0x2a')],'sumBillable':_0x17983f[_0xf20a('0x2b')],'sumDuration':_0x17983f[_0xf20a('0x2c')],'sumHoldTime':_0x17983f['sumHoldTime']||0x0,'talking':_0x17983f[_0xf20a('0x2d')],'total':_0x17983f[_0xf20a('0x2e')],'type':_0x17983f[_0xf20a('0x2f')],'unmanaged':_0x17983f[_0xf20a('0x30')],'abandoned':_0x17983f[_0xf20a('0x31')],'waiting':_0x17983f[_0xf20a('0x32')],'loggedInDb':_0x17983f['loggedInDb'],'dialActive':_0x17983f[_0xf20a('0x33')],'dialMethod':_0x17983f[_0xf20a('0x34')],'dialOriginateCallerIdName':_0x17983f[_0xf20a('0x35')],'dialOriginateCallerIdNumber':_0x17983f[_0xf20a('0x36')],'dialOriginateTimeout':_0x17983f[_0xf20a('0x37')],'dialPrefix':_0x17983f[_0xf20a('0x38')],'outboundAnswerAgiCallsDay':_0x17983f[_0xf20a('0x39')],'outboundAnswerCallsDay':_0x17983f[_0xf20a('0x3a')],'outboundBlacklistCallsDay':_0x17983f[_0xf20a('0x3b')],'outboundBusyCallsDay':_0x17983f['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x17983f['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x17983f[_0xf20a('0x3c')],'outboundDropCallsDayCallersExit':_0x17983f['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x17983f[_0xf20a('0x3d')],'outboundNoAnswerCallsDay':_0x17983f[_0xf20a('0x3e')],'outboundNoSuchCallsDay':_0x17983f[_0xf20a('0x3f')],'outboundOriginateFailureCallsDay':_0x17983f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x17983f['outboundReCallsDay'],'outboundRejectCallsDay':_0x17983f['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x17983f[_0xf20a('0x40')],'outboundAbandonedCallsDay':_0x17983f[_0xf20a('0x41')],'predictiveIntervalAnsweredCalls':_0x17983f[_0xf20a('0x42')],'predictiveIntervalAvgHoldtime':_0x17983f[_0xf20a('0x43')],'predictiveIntervalAvgTalktime':_0x17983f[_0xf20a('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x17983f[_0xf20a('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x17983f[_0xf20a('0x46')],'predictiveIntervalErlangCalls':_0x17983f['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x17983f[_0xf20a('0x47')],'predictiveIntervalHitRate':_0x17983f['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x17983f[_0xf20a('0x48')],'predictiveIntervalPauses':_0x17983f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x17983f[_0xf20a('0x49')],'predictiveIntervalTotalCalls':_0x17983f[_0xf20a('0x4a')],'message':_0x17983f[_0xf20a('0x4b')],'originated':_0x17983f[_0xf20a('0x4c')],'erlangCalls':_0x17983f[_0xf20a('0x4d')],'erlangCallToSecond':_0x17983f[_0xf20a('0x4e')],'erlangAbandonmentRate':_0x17983f[_0xf20a('0x4f')],'erlangBusyFactor':_0x17983f['erlangBusyFactor'],'startPredictive':_0x17983f[_0xf20a('0x50')],'startProgressive':_0x17983f[_0xf20a('0x51')]};if(_0x17983f[_0xf20a('0x52')]){_0x1fc0cb[_0xf20a('0x52')]={'id':_0x17983f['Trunk']['id'],'name':_0x17983f[_0xf20a('0x52')][_0xf20a('0x27')],'active':_0x17983f['Trunk'][_0xf20a('0x53')],'callerid':_0x17983f['Trunk'][_0xf20a('0x54')]};}if(_0x17983f[_0xf20a('0x55')]){_0x1fc0cb['Interval']={'id':_0x17983f[_0xf20a('0x55')]['id'],'name':_0x17983f[_0xf20a('0x55')]['name']};}var _0xd0a5ad=md5(JSON[_0xf20a('0x56')](_0x1fc0cb));if(_0x17983f['md5']!==_0xd0a5ad){_0x17983f[_0xf20a('0x4')]=_0xd0a5ad;emit(util[_0xf20a('0x57')](_0xf20a('0x58'),_0x1fc0cb[_0xf20a('0x27')]),'voice_queue:save',_0x1fc0cb);}}}function emitVoiceQueueChannelRemove(_0x246d01){logger[_0xf20a('0x59')](_0xf20a('0x5a'),JSON[_0xf20a('0x56')](_0x246d01));emit(util['format'](_0xf20a('0x58'),_0x246d01[_0xf20a('0x27')]),_0xf20a('0x5b'),_0x246d01);io[_0xf20a('0x26')]('voice_queue_presence:remove',_0x246d01);}function notSendMessagesQueue(_0x95e595){if(_0x95e595[_0xf20a('0x5c')]){if(_0x95e595['originated']===0x0&&_0x95e595['pTalking']===0x0){_0x95e595[_0xf20a('0x5c')]=![];_0x95e595[_0xf20a('0x5d')]=0x0;_0x95e595[_0xf20a('0x5e')]=0x0;_0x95e595[_0xf20a('0x4b')]='NOT_ACTIVE';ut['logger'](_0xf20a('0x5f'),_0x95e595['name']+'\x20is\x20not\x20active');}else{_0x95e595[_0xf20a('0x4b')]='IS_DISACTIVED';ut[_0xf20a('0x60')](_0xf20a('0x5f'),_0x95e595[_0xf20a('0x27')]+_0xf20a('0x61'));}emitCampaignPreview(_0x95e595);}}Preview[_0xf20a('0x62')][_0xf20a('0x25')]=function(){var _0x4bb0db=this;setInterval(function(){_0x4bb0db[_0xf20a('0x63')]();},0x7cf);};Preview[_0xf20a('0x62')][_0xf20a('0x63')]=function(){var _0x4697a5=this[_0xf20a('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x5e8b76 in _0x4697a5){if(_0x4697a5['hasOwnProperty'](_0x5e8b76)&&(_0x4697a5[_0x5e8b76][_0xf20a('0x34')]==='preview'||_0x4697a5[_0x5e8b76][_0xf20a('0x34')]==='booked')&&_0x4697a5[_0x5e8b76][_0xf20a('0x2f')]===_0xf20a('0x64')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0xf20a('0x65')]();}}if(_0x4697a5[_0xf20a('0x66')](_0x5e8b76)&&_0x4697a5[_0x5e8b76]['dialMethod']===_0xf20a('0x7')&&_0x4697a5[_0x5e8b76][_0xf20a('0x2f')]==='outbound'){if(_0x4697a5[_0x5e8b76][_0xf20a('0x33')]){this[_0xf20a('0x67')](_0x4697a5[_0x5e8b76]);this[_0xf20a('0x68')](_0x4697a5[_0x5e8b76]);}else{notSendMessagesQueue(_0x4697a5[_0x5e8b76]);}}}};Preview[_0xf20a('0x62')]['clearZombieChannel']=function(_0x2f1703){var _0x4669f0=this;this[_0xf20a('0x11')]['enqueue'](function(){if(!_[_0xf20a('0x69')](_0x4669f0[_0xf20a('0x6a')][_0x2f1703])){loggerAction[_0xf20a('0x59')]('[clearZombieChannels][talking]',_0x2f1703,'Queue',_0x4669f0['actions'][_0x2f1703][_0xf20a('0x6b')],_0xf20a('0x6c'),JSON[_0xf20a('0x56')](_0x4669f0[_0xf20a('0x12')][_0x4669f0[_0xf20a('0x6a')][_0x2f1703][_0xf20a('0x6b')]][_0xf20a('0x4c')]),_0xf20a('0x6d'),JSON[_0xf20a('0x56')](_0x4669f0[_0xf20a('0x12')][_0x4669f0[_0xf20a('0x6a')][_0x2f1703][_0xf20a('0x6b')]][_0xf20a('0x2a')]),JSON[_0xf20a('0x56')](_0x4669f0[_0xf20a('0x6a')][_0x2f1703][_0xf20a('0x6e')]),JSON['stringify'](_[_0xf20a('0x6f')](_0x4669f0['actions'][_0x2f1703],['contactId',_0xf20a('0x70'),_0xf20a('0x71'),_0xf20a('0x72')])));return ami[_0xf20a('0x73')]({'action':'status','channel':_0x4669f0[_0xf20a('0x6a')][_0x2f1703][_0xf20a('0x74')]})[_0xf20a('0x75')](function(_0x3f1dcb){if(_0x3f1dcb[_0xf20a('0x4b')]===_0xf20a('0x76')){setTimeout(function(){if(_0x4669f0[_0xf20a('0x6a')][_0x2f1703]){ut['updateOriginated'](_0x4669f0[_0xf20a('0x12')][_0x4669f0['actions'][_0x2f1703]['queue']],'[clearZombieChannel]');if(_0x4669f0[_0xf20a('0x6a')][_0x2f1703][_0xf20a('0x6e')]===!![]){ut[_0xf20a('0x77')](_0x4669f0[_0xf20a('0x12')][_0x4669f0['actions'][_0x2f1703][_0xf20a('0x6b')]],_0xf20a('0x78'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x2f1703,_0x4669f0[_0xf20a('0x6a')][_0x2f1703][_0xf20a('0x6b')]);}ut[_0xf20a('0x79')]('[Dialer][checkChannel][Preview]'+_0x2f1703,_0x4669f0[_0xf20a('0x6a')][_0x2f1703][_0xf20a('0x6b')]);delete _0x4669f0[_0xf20a('0x6a')][_0x2f1703];}},0x2328);}});}});};Preview[_0xf20a('0x62')][_0xf20a('0x65')]=function(){var _0x17d5c4=this;loggerAction[_0xf20a('0x59')](_0xf20a('0x7a'),_['size'](this[_0xf20a('0x6a')]));for(var _0x2690c3 in this[_0xf20a('0x6a')]){if(_0x17d5c4[_0xf20a('0x6a')][_0xf20a('0x66')](_0x2690c3)){_0x17d5c4[_0xf20a('0x7b')](_0x2690c3);}}};Preview[_0xf20a('0x62')][_0xf20a('0x68')]=function(_0x92f752){var _0xdc01a0=this;rpcDb['getContactRecallMe'](_0x92f752['id'],ut[_0xf20a('0x7c')](this['agents']))[_0xf20a('0x7d')](function(_0x477612){if(!_['isNil'](_0x477612)){for(var _0x2fda68=0x0;_0x2fda68<_0x477612[_0xf20a('0x7e')];_0x2fda68+=0x1){if(ut['getDiff'](_0x477612[_0x2fda68][_0xf20a('0x7f')])<_0x92f752[_0xf20a('0x80')]*0x3c){if(_0x477612[_0x2fda68][_0xf20a('0x81')]&&!_0x477612[_0x2fda68][_0xf20a('0x81')]['voicePause']){_0xdc01a0[_0xf20a('0x82')](_0x477612[_0x2fda68]['id'])[_0xf20a('0x7d')](ut[_0xf20a('0x83')]('[RecallMe]'))[_0xf20a('0x75')](ut[_0xf20a('0x83')](_0xf20a('0x84')));}else{rpcDb[_0xf20a('0x85')](_0x477612[_0x2fda68]['id']);}}else{var _0x1f52f7=new Action(_0x477612[_0x2fda68],_0x92f752);_0x1f52f7[_0xf20a('0x86')]=moment()['format'](_0xf20a('0x87'));_0x92f752[_0xf20a('0x88')]+=0x1;ut[_0xf20a('0x89')](_0x1f52f7,0x17,_0xf20a('0x8a'));if(_0x92f752[_0xf20a('0x8b')]){rpcDb[_0xf20a('0x8c')](ut['createBody'](_0x477612[_0x2fda68]));rpcDb[_0xf20a('0x8d')](_0x1f52f7,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xf20a('0x89')](_0x1f52f7,0x16,'RecallFailedTimeout');rpcDb[_0xf20a('0x8d')](_0x1f52f7,_0xf20a('0x8e'));rpcDb[_0xf20a('0x8f')](_0x1f52f7,_0xf20a('0x8e'));}}}}})[_0xf20a('0x75')](ut[_0xf20a('0x83')](_0xf20a('0x90')));};Preview[_0xf20a('0x62')][_0xf20a('0x67')]=function(_0x499451){_0x499451[_0xf20a('0x5c')]=!![];if(ut[_0xf20a('0x91')](_0x499451[_0xf20a('0x29')])){_0x499451[_0xf20a('0x4b')]=_0xf20a('0x92');}else if(!ut[_0xf20a('0x93')](_0x499451[_0xf20a('0x33')])){_0x499451[_0xf20a('0x4b')]=_0xf20a('0x94');}else if(!this['isTrunkReachable'](_0x499451[_0xf20a('0x52')])){if(!this[_0xf20a('0x95')](_0x499451['TrunkBackup'])){_0x499451['message']=_0xf20a('0x96');}else{_0x499451[_0xf20a('0x4b')]=_0xf20a('0x97');}}else{_0x499451['message']=_0xf20a('0x97');}emitCampaignPreview(_0x499451);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x70a4ab,_0x4a9c75,_0x2a6849){var _0x2c8807=this;var _0x3daadd=this[_0xf20a('0x6a')][_0x4a9c75];var _0x291748=this[_0xf20a('0x12')][_0x3daadd[_0xf20a('0x6b')]];var _0x3afba6;if(_0x291748){switch(_0x2a6849){case'1':_0x291748[_0xf20a('0x3f')]+=0x1;_0x3daadd[_0xf20a('0x98')]+=0x1;_0x3daadd[_0xf20a('0x99')]=ut[_0xf20a('0x9a')](_0x3daadd);ut[_0xf20a('0x89')](_0x3daadd,0x0,_0xf20a('0x9b'));ami['emit']('custom:agentnosuchnumber',ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0x9d')));rpcDb[_0xf20a('0x8d')](_0x3daadd,_0xf20a('0x9e'));if(ut['totalGlobal'](_0x3daadd)>=_0x291748[_0xf20a('0x9f')]){_0x3afba6=ut['cloneAction'](_0x3daadd,0xf,_0xf20a('0xa0'));rpcDb[_0xf20a('0x8f')](_0x3afba6,_0xf20a('0xa1'));}else{if(_0x3daadd[_0xf20a('0x98')]>=_0x291748['dialNoSuchNumberMaxRetry']){rpcDb[_0xf20a('0x8f')](_0x3daadd,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xf20a('0xa2')](ut[_0xf20a('0xa3')](_0x3daadd,_0xf20a('0x98'),_0x291748[_0xf20a('0xa4')]),_0x3daadd[_0xf20a('0xa5')],_0x3daadd[_0xf20a('0xa6')]);}}delete this[_0xf20a('0x6a')][_0x70a4ab[_0xf20a('0xa7')]];break;case _0xf20a('0xa8'):var _0x40e3cf=moment()[_0xf20a('0x57')](_0xf20a('0x87'));_0x3daadd[_0xf20a('0xa9')]=_0x40e3cf;_0x3daadd[_0xf20a('0xaa')]=_0x40e3cf;_0x3daadd[_0xf20a('0x6e')]=!![];_0x291748[_0xf20a('0x2a')]+=0x1;logger[_0xf20a('0x59')]('[syncHangup][talking][increment]',_0x3daadd[_0xf20a('0xab')],_0xf20a('0xac'),_0x291748[_0xf20a('0x27')],'pTalking:\x20',_0x291748['pTalking']);ami[_0xf20a('0x26')]('custom:agentconnect',ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0xad'),this[_0xf20a('0x12')][_0x3daadd[_0xf20a('0x6b')]]));if(_0x291748[_0xf20a('0xae')]){ami[_0xf20a('0x26')](_0xf20a('0xaf'),ut[_0xf20a('0xb0')](_0x3daadd));}break;case'16':ami[_0xf20a('0x26')]('custom:agentcomplete',ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0xb1'),this[_0xf20a('0x12')][_0x3daadd['queue']]));emitVoiceQueueChannelRemove(ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0xb1')));_0x291748[_0xf20a('0x3a')]+=0x1;_0x291748[_0xf20a('0x2e')]+=0x1;_0x291748[_0xf20a('0xb2')]+=0x1;ut[_0xf20a('0x77')](_0x291748,'[16]');_0x3daadd[_0xf20a('0x99')]=ut[_0xf20a('0x9a')](_0x3daadd);ut[_0xf20a('0x89')](_0x3daadd,0x4,_0xf20a('0xb3'));rpcDb[_0xf20a('0x8d')](_0x3daadd,_0xf20a('0xb4'));rpcDb[_0xf20a('0x8f')](_0x3daadd,_0xf20a('0xb5'));rpcDb[_0xf20a('0xb6')](_0x3daadd);_0x291748[_0xf20a('0x2c')]+=_0x3daadd[_0xf20a('0xb7')];_0x291748[_0xf20a('0x2b')]+=_0x3daadd[_0xf20a('0xb7')];logger[_0xf20a('0x59')](_0xf20a('0xb8'),_0x3daadd[_0xf20a('0xab')],_0xf20a('0xac'),_0x291748[_0xf20a('0x27')],_0xf20a('0x6d'),_0x291748[_0xf20a('0x2a')]);delete this['actions'][_0x70a4ab['linkedid']];break;case _0xf20a('0xb9'):_0x291748[_0xf20a('0xba')]+=0x1;_0x3daadd[_0xf20a('0xbb')]+=0x1;_0x3daadd['countglobal']=ut[_0xf20a('0x9a')](_0x3daadd);ut[_0xf20a('0x89')](_0x3daadd,0x5,_0xf20a('0xbc'));ami['emit'](_0xf20a('0xbd'),ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0xbe')));rpcDb[_0xf20a('0x8d')](_0x3daadd,_0xf20a('0xbf'));if(ut[_0xf20a('0x9a')](_0x3daadd)>=_0x291748[_0xf20a('0x9f')]){_0x3afba6=ut[_0xf20a('0xc0')](_0x3daadd,0xf,'Global');rpcDb['createCustomerFinal'](_0x3afba6,_0xf20a('0xc1'));}else{if(_0x3daadd[_0xf20a('0xbb')]>=_0x291748['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x3daadd,_0xf20a('0xbf'));}else{rpcDb[_0xf20a('0xa2')](ut[_0xf20a('0xa3')](_0x3daadd,_0xf20a('0xbb'),_0x291748[_0xf20a('0xc2')]),_0x3daadd['unlockAgent'],_0x3daadd['activeContact']);}}break;case _0xf20a('0xc3'):_0x291748[_0xf20a('0x3e')]+=0x1;_0x3daadd[_0xf20a('0xc4')]+=0x1;_0x3daadd[_0xf20a('0x99')]=ut[_0xf20a('0x9a')](_0x3daadd);ut[_0xf20a('0x89')](_0x3daadd,0x3,_0xf20a('0xc5'));ami[_0xf20a('0x26')](_0xf20a('0xc6'),ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0xc7')));rpcDb[_0xf20a('0x8d')](_0x3daadd,_0xf20a('0xc8'));if(ut[_0xf20a('0x9a')](_0x3daadd)>=_0x291748[_0xf20a('0x9f')]){_0x3afba6=ut['cloneAction'](_0x3daadd,0xf,_0xf20a('0xa0'));rpcDb[_0xf20a('0x8f')](_0x3afba6,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3daadd[_0xf20a('0xc4')]>=_0x291748[_0xf20a('0xc9')]){rpcDb[_0xf20a('0x8f')](_0x3daadd,_0xf20a('0xc8'));}else{rpcDb['rescheduleContact'](ut[_0xf20a('0xa3')](_0x3daadd,_0xf20a('0xc4'),_0x291748[_0xf20a('0xca')]),_0x3daadd[_0xf20a('0xa5')],_0x3daadd[_0xf20a('0xa6')]);}}break;case'CONGESTION':_0x291748[_0xf20a('0xcb')]+=0x1;_0x3daadd[_0xf20a('0xcc')]+=0x1;_0x3daadd[_0xf20a('0x99')]=ut[_0xf20a('0x9a')](_0x3daadd);ut[_0xf20a('0x89')](_0x3daadd,0x8,_0xf20a('0xcd'));ami['emit']('custom:agentcongestion',ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0xce')));rpcDb[_0xf20a('0x8d')](_0x3daadd,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xf20a('0x9a')](_0x3daadd)>=_0x291748['dialGlobalMaxRetry']){_0x3afba6=ut[_0xf20a('0xc0')](_0x3daadd,0xf,_0xf20a('0xa0'));rpcDb[_0xf20a('0x8f')](_0x3afba6,_0xf20a('0xcf'));}else{if(_0x3daadd['countcongestionretry']>=_0x291748[_0xf20a('0xd0')]){rpcDb[_0xf20a('0x8f')](_0x3daadd,_0xf20a('0xd1'));}else{rpcDb[_0xf20a('0xa2')](ut[_0xf20a('0xa3')](_0x3daadd,_0xf20a('0xcc'),_0x291748['dialBusyRetryFrequency']),_0x3daadd[_0xf20a('0xa5')],_0x3daadd[_0xf20a('0xa6')]);}}break;case'CANCEL':_0x291748[_0xf20a('0xd2')]+=0x1;_0x3daadd[_0xf20a('0xd3')]+=0x1;_0x3daadd[_0xf20a('0x99')]=ut[_0xf20a('0x9a')](_0x3daadd);ut[_0xf20a('0x89')](_0x3daadd,0x14,_0xf20a('0xd4'));ami[_0xf20a('0x26')](_0xf20a('0xd5'),ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0xd6')));rpcDb[_0xf20a('0x8d')](_0x3daadd,_0xf20a('0xd7'));if(ut['totalGlobal'](_0x3daadd)>=_0x291748['dialGlobalMaxRetry']){_0x3afba6=ut[_0xf20a('0xc0')](_0x3daadd,0x14,'AgentReject');rpcDb[_0xf20a('0x8f')](_0x3afba6,_0xf20a('0xd8'));}else{if(_0x3daadd[_0xf20a('0xd3')]>=_0x291748[_0xf20a('0xd9')]){rpcDb['createCustomerFinal'](_0x3daadd,_0xf20a('0xd8'));}else{rpcDb['rescheduleContact'](ut[_0xf20a('0xa3')](_0x3daadd,_0xf20a('0xd3'),_0x291748[_0xf20a('0xda')]),_0x3daadd['unlockAgent'],_0x3daadd[_0xf20a('0xa6')]);}}break;case _0xf20a('0xdb'):_0x291748['outboundAbandonedCallsDay']+=0x1;_0x3daadd[_0xf20a('0xdc')]+=0x1;_0x3daadd['countglobal']=ut[_0xf20a('0x9a')](_0x3daadd);ut[_0xf20a('0x89')](_0x3daadd,0xb,_0xf20a('0xdd'));rpcDb[_0xf20a('0x8d')](_0x3daadd,_0xf20a('0xde'));if(ut[_0xf20a('0x9a')](_0x3daadd)>=_0x291748[_0xf20a('0x9f')]){_0x3afba6=ut['cloneAction'](_0x3daadd,0xf,_0xf20a('0xa0'));rpcDb['createCustomerFinal'](_0x3afba6,_0xf20a('0xde'));}else{if(_0x3daadd[_0xf20a('0xdf')]>=_0x291748[_0xf20a('0xe0')]){rpcDb[_0xf20a('0x8f')](_0x3daadd,_0xf20a('0xde'));}else{rpcDb[_0xf20a('0xa2')](ut[_0xf20a('0xa3')](_0x3daadd,'countabandonedretry',_0x291748[_0xf20a('0xe1')]),_0x3daadd[_0xf20a('0xa5')],_0x3daadd['activeContact']);}}break;case'18':_0x291748[_0xf20a('0x40')]+=0x1;_0x3daadd[_0xf20a('0xe2')]+=0x1;_0x3daadd['countglobal']=ut[_0xf20a('0x9a')](_0x3daadd);ut['logCustomer'](_0x3daadd,0x12,_0x70a4ab[_0xf20a('0xe3')]||_0x70a4ab['dialstatus']);ami[_0xf20a('0x26')](_0xf20a('0xe4'),ut[_0xf20a('0x9c')](_0x3daadd,_0xf20a('0xe5')));rpcDb[_0xf20a('0x8d')](_0x3daadd,'[callProgressDetectingCustomer][hangupInAMD]');if(ut['totalGlobal'](_0x3daadd)>=_0x291748[_0xf20a('0x9f')]){_0x3afba6=ut['cloneAction'](_0x3daadd,0xf,_0xf20a('0xa0'));rpcDb[_0xf20a('0x8f')](_0x3afba6,_0xf20a('0xe6'));}else{rpcDb[_0xf20a('0x8f')](_0x3daadd,_0xf20a('0xe6'));}delete this['actions'][_0x70a4ab[_0xf20a('0xa7')]];break;case'19':_0x291748[_0xf20a('0x40')]+=0x1;_0x3daadd[_0xf20a('0x99')]=ut[_0xf20a('0x9a')](_0x3daadd);ut['logCustomer'](_0x3daadd,0x13,_0x70a4ab[_0xf20a('0xe3')]||_0x70a4ab[_0xf20a('0xe7')]);ami[_0xf20a('0x26')](_0xf20a('0xe4'),ut[_0xf20a('0x9c')](_0x3daadd,'amd'));rpcDb[_0xf20a('0x8d')](_0x3daadd,'[callProgressDetectingCustomer][machine]');if(ut[_0xf20a('0x9a')](_0x3daadd)>=_0x291748['dialGlobalMaxRetry']){_0x3afba6=ut['cloneAction'](_0x3daadd,0xf,_0xf20a('0xa0'));rpcDb[_0xf20a('0x8f')](_0x3afba6,_0xf20a('0xe8'));}else{rpcDb[_0xf20a('0x8f')](_0x3daadd,_0xf20a('0xe8'));}delete this[_0xf20a('0x6a')][_0x70a4ab[_0xf20a('0xa7')]];break;default:if(_0x3daadd['dialAnswer']){ut[_0xf20a('0x77')](_0x291748,'[default]');ut[_0xf20a('0x79')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x291748[_0xf20a('0x27')],_0x70a4ab);}_0x291748['outboundUnknownCallsDay']+=0x1;_0x3daadd['countglobal']=ut[_0xf20a('0x9a')](_0x3daadd);ut['logCustomer'](_0x3daadd,0xc,_0x70a4ab['cause-txt']||_0x70a4ab[_0xf20a('0xe7')]);rpcDb[_0xf20a('0x8d')](_0x3daadd,_0xf20a('0xe9'));if(ut[_0xf20a('0x9a')](_0x3daadd)>=_0x291748['dialGlobalMaxRetry']){_0x3afba6=ut[_0xf20a('0xc0')](_0x3daadd,0xf,_0xf20a('0xa0'));rpcDb[_0xf20a('0x8f')](_0x3afba6,_0xf20a('0xea'));}else{rpcDb[_0xf20a('0x8f')](_0x3daadd,_0xf20a('0xea'));}delete this[_0xf20a('0x6a')][_0x70a4ab[_0xf20a('0xa7')]];}if(!(_0x3daadd[_0xf20a('0x6e')]&&_0x2a6849==='16')){ut[_0xf20a('0xeb')](_0x291748,_0xf20a('0xec'));logger[_0xf20a('0x59')]('[originated][decrement][callProgressDetectingCustomer]',_0x3daadd[_0xf20a('0xab')],'\x20Queue',_0x291748[_0xf20a('0x27')],'originated:\x20',_0x291748[_0xf20a('0x4c')]);}if(_0x2a6849!==_0xf20a('0xa8')){delete this[_0xf20a('0x6a')][_0x70a4ab[_0xf20a('0xa7')]];delete this['actions'][_0x70a4ab[_0xf20a('0xed')]];}}};Preview['prototype'][_0xf20a('0xee')]=function(_0x3f4a4b,_0x2d0224,_0x57523a){if(_[_0xf20a('0xef')](_0x2d0224)&&_0xf20a('0xf0')!==typeof _0x2d0224){return;}if(_[_0xf20a('0xef')](_0x57523a)&&_0xf20a('0xf0')!==typeof _0x57523a){return;}switch(_0x57523a[_0xf20a('0xf1')]){case'0':ut[_0xf20a('0xf2')](_0x3f4a4b,0x0,_0xf20a('0x9b'));rpcDb[_0xf20a('0xf3')](_0x3f4a4b,_0xf20a('0xf4'));break;case'3':ut[_0xf20a('0xf2')](_0x3f4a4b,0x3,_0xf20a('0xc5'));rpcDb['createAgentHistory'](_0x3f4a4b,_0xf20a('0xf5'));break;case'5':ut[_0xf20a('0xf2')](_0x3f4a4b,0x5,'Busy');rpcDb[_0xf20a('0xf3')](_0x3f4a4b,_0xf20a('0xf6'));break;case'8':ut[_0xf20a('0xf2')](_0x3f4a4b,0x8,_0xf20a('0xcd'));rpcDb[_0xf20a('0xf3')](_0x3f4a4b,_0xf20a('0xf7'));break;case'22':ut['logAgent'](_0x3f4a4b,0x16,_0xf20a('0xf8'));rpcDb['createAgentHistory'](_0x3f4a4b,_0xf20a('0xf9'));break;default:ut['logAgent'](_0x3f4a4b,0xc,_0x57523a[_0xf20a('0xf1')]);rpcDb[_0xf20a('0xf3')](_0x3f4a4b,_0xf20a('0xf7'));}ut['updateOriginated'](_0x2d0224,'[callProgressDetectingAgent]');logger[_0xf20a('0x59')](_0xf20a('0xfa'),_0x3f4a4b[_0xf20a('0xab')],_0xf20a('0xac'),_0x2d0224[_0xf20a('0x27')],_0xf20a('0x6c'),_0x2d0224[_0xf20a('0x4c')]);delete this[_0xf20a('0x6a')][_0x3f4a4b[_0xf20a('0xab')]];};Preview[_0xf20a('0x62')][_0xf20a('0xfb')]=function(_0x412cc5,_0x24b1e5,_0x21dda4,_0x4d1737,_0x4474c8){var _0x5633aa=this;return new BPromise(function(_0x2a2876,_0x566c6e){if(_[_0xf20a('0x69')](_0x24b1e5)||_[_0xf20a('0x69')](_0x24b1e5[_0xf20a('0xfc')])||_['isNil'](_0x24b1e5[_0xf20a('0xfc')][_0xf20a('0xfd')])||_[_0xf20a('0x69')](_0x24b1e5[_0xf20a('0x71')])){_0x566c6e(ut[_0xf20a('0x4b')](_0xf20a('0xfe'),_0x4d1737,_0x4474c8));return;}var _0x2e4fbe=uuid['v4']();var _0x278267=_0x5633aa[_0xf20a('0x12')][_0x24b1e5[_0xf20a('0xff')]['name']];var _0x252d28=_0x21dda4?_0x5633aa[_0xf20a('0x15')][_0x21dda4]['id']:undefined;_0x5633aa[_0xf20a('0x6a')][_0x2e4fbe]=new Action(_0x24b1e5,_0x278267,_0x2e4fbe,_0x21dda4,_0x252d28);var _0x23bcc4=_0x5633aa[_0xf20a('0x6a')][_0x2e4fbe];_0x23bcc4['unlockAgent']=_0x4d1737;_0x23bcc4['activeContact']=_0x4474c8;_0x23bcc4[_0xf20a('0x100')]=_0x21dda4;if(_[_0xf20a('0x101')](_0x412cc5)){_0x5633aa[_0xf20a('0x102')](_0x23bcc4,_0x278267,_0x24b1e5,_0x21dda4)['then'](function(_0xb76d60){logger[_0xf20a('0x59')](_0xf20a('0x103'),'Queue:\x20'+_0x23bcc4[_0xf20a('0x6b')]+_0xf20a('0x104')+_0x23bcc4['idContact'],JSON[_0xf20a('0x56')](_0xb76d60));ami[_0xf20a('0x26')]('custom:agentcalled',ut[_0xf20a('0x9c')](_0x23bcc4,_0xf20a('0x105'),_0x5633aa[_0xf20a('0x12')][_0x23bcc4[_0xf20a('0x6b')]]));_0x2a2876(ut[_0xf20a('0x4b')](_0xf20a('0x106')));})['catch'](function(_0x20b6fd){ut[_0xf20a('0x60')](_0xf20a('0x107'),_0x20b6fd);_0x566c6e(ut[_0xf20a('0x4b')](_0xf20a('0x108'),_0x4d1737,_0x4474c8));});}else{_0x278267[_0xf20a('0x3b')]+=0x1;ut[_0xf20a('0x109')](_0x23bcc4);rpcDb[_0xf20a('0x10a')](_0x23bcc4,'[Blacklist][error]');delete _0x5633aa[_0xf20a('0x6a')][_0x2e4fbe];_0x566c6e(ut['message'](_0xf20a('0x10b'),_0x4d1737,_0x4474c8));}});};Preview[_0xf20a('0x62')][_0xf20a('0x95')]=function(_0x5c0cc8){return!_[_0xf20a('0x69')](_0x5c0cc8)&&!_[_0xf20a('0x69')](_0x5c0cc8[_0xf20a('0x27')])&&!_[_0xf20a('0x69')](_0x5c0cc8[_0xf20a('0x53')])&&_0x5c0cc8[_0xf20a('0x53')]&&!_[_0xf20a('0x69')](this[_0xf20a('0x14')][util['format'](_0xf20a('0x10c'),_0x5c0cc8[_0xf20a('0x27')])])&&!_[_0xf20a('0x69')](this[_0xf20a('0x14')][util[_0xf20a('0x57')]('SIP/%s',_0x5c0cc8[_0xf20a('0x27')])][_0xf20a('0x10d')])&&(this[_0xf20a('0x14')][util['format']('SIP/%s',_0x5c0cc8[_0xf20a('0x27')])][_0xf20a('0x10d')]==='reachable'||this[_0xf20a('0x14')][util[_0xf20a('0x57')](_0xf20a('0x10c'),_0x5c0cc8[_0xf20a('0x27')])]['status']==='unmonitored');};Preview['prototype'][_0xf20a('0x82')]=function(_0x2a96f6,_0x22ad6e){var _0x28b3c2=this;return new BPromise(function(_0x555a7b,_0x4f8d23){_0x28b3c2['execRun'](_0x2a96f6,_0x22ad6e)['then'](function(_0x31ace3){_0x555a7b(_['pick'](_0x31ace3,[_0xf20a('0x4b')]));})[_0xf20a('0x75')](function(_0xd7776b){if(_0xd7776b[_0xf20a('0x10e')]){rpcDb[_0xf20a('0x10f')](_0x2a96f6);}if(_0xd7776b['active']){rpcDb[_0xf20a('0x85')](_0x2a96f6);}_0x4f8d23(_[_0xf20a('0x6f')](_0xd7776b,['message']));});});};Preview[_0xf20a('0x62')][_0xf20a('0x110')]=function(_0x146c3f,_0x4145e2){var _0x22969d=this;return new BPromise(function(_0x578f32,_0x57c1be){var _0x25d4a6,_0xdbf93d;rpcDb[_0xf20a('0x111')](_0x146c3f)[_0xf20a('0x7d')](function(_0x56a737){if(!_[_0xf20a('0x69')](_0x56a737[0x0])){_0xdbf93d=_0x56a737[0x0]['recallme']?![]:!![];_0x25d4a6=_0x56a737[0x0][_0xf20a('0x112')]?!![]:![];_0x25d4a6=_0x4145e2?!![]:_0x25d4a6;}var _0x13085a=_0x22969d[_0xf20a('0x113')](_0x56a737);if(_0x13085a[_0xf20a('0x114')]){rpcDb[_0xf20a('0x115')](_[_0xf20a('0x6f')](_0x56a737[0x0],[_0xf20a('0x71'),_0xf20a('0x116')]))[_0xf20a('0x7d')](function(_0x2c34bc){_0x22969d['checkInBlack'](_0x2c34bc,_0x56a737[0x0],_0x4145e2,_0xdbf93d,_0x25d4a6)[_0xf20a('0x7d')](function(_0x3f05e4){_0x578f32(_0x3f05e4);})[_0xf20a('0x75')](function(_0x485c62){_0x57c1be(_0x485c62);});})[_0xf20a('0x75')](function(_0x141259){ut[_0xf20a('0x60')]('[Preview][checkIsBlackList]',_0x141259);_0x57c1be(ut['message'](_0xf20a('0x117'),_0xdbf93d,_0x25d4a6));});}else{_0x57c1be(ut['message'](_0x13085a[_0xf20a('0x4b')],_0xdbf93d,_0x25d4a6));}})['catch'](function(_0x3ff7a8){ut[_0xf20a('0x60')](_0xf20a('0x118'),_0x3ff7a8);_0x57c1be(ut[_0xf20a('0x4b')](_0xf20a('0x117'),![],!![]));});});};Preview[_0xf20a('0x62')]['validateContact']=function(_0x5eda1d){if(_[_0xf20a('0x69')](_0x5eda1d)||_[_0xf20a('0x101')](_0x5eda1d)||!_[_0xf20a('0x69')](_0x5eda1d[0x0]['Agent'])&&_[_0xf20a('0x69')](_0x5eda1d[0x0]['Agent'][_0xf20a('0x27')])){ut[_0xf20a('0x60')](_0xf20a('0x119'),_0x5eda1d);return{'isValid':![],'message':_0xf20a('0x11a')};}var _0x2b5cd8=this[_0xf20a('0x12')][_0x5eda1d[0x0][_0xf20a('0xff')][_0xf20a('0x27')]];_0x2b5cd8[_0xf20a('0x4b')]=_0xf20a('0x97');if(_[_0xf20a('0x69')](_0x2b5cd8)){ut[_0xf20a('0x60')]('[Preview][validateContact][Empty\x20Campaign]',_0x2b5cd8);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xf20a('0x95')](_0x2b5cd8[_0xf20a('0x52')])){ut[_0xf20a('0x60')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xf20a('0x11b')+_0x2b5cd8[_0xf20a('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xf20a('0x95')](_0x2b5cd8[_0xf20a('0x11c')])){ut[_0xf20a('0x60')](_0xf20a('0x11d'),_0x2b5cd8[_0xf20a('0x27')]+_0xf20a('0x11e'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xf20a('0x93')](_0x2b5cd8['dialActive'])){ut[_0xf20a('0x60')](_0xf20a('0x11f'),_0x2b5cd8[_0xf20a('0x27')]+_0xf20a('0x120'));return{'isValid':![],'message':_0xf20a('0x11b')+_0x2b5cd8[_0xf20a('0x27')]+_0xf20a('0x120')};}return{'isValid':!![],'message':_0xf20a('0x121')};};Preview[_0xf20a('0x62')][_0xf20a('0x102')]=function(_0x3d25bd,_0x25fcef,_0x1d34ad,_0x47e3d3){var _0x4facec=this;return new BPromise(function(_0x3f3d2c,_0x544456){var _0x51f581=_0x3d25bd[_0xf20a('0xab')];var _0x4ae6e2=_0x4facec[_0xf20a('0x95')](_0x25fcef[_0xf20a('0x52')])?util[_0xf20a('0x57')](_0xf20a('0x122'),_0x25fcef[_0xf20a('0x52')][_0xf20a('0x27')],_[_0xf20a('0x69')](_0x25fcef[_0xf20a('0x38')])?'':_0x25fcef[_0xf20a('0x38')]['trim']()||'',_0x25fcef[_0xf20a('0x123')]>0x0?_0x1d34ad['Contact'][_0xf20a('0xfd')][_0xf20a('0x124')](_0x25fcef[_0xf20a('0x123')]):_0x1d34ad['Contact']['phone']):util['format'](_0xf20a('0x122'),_[_0xf20a('0x69')](_0x25fcef['TrunkBackup'])?_0x25fcef[_0xf20a('0x52')][_0xf20a('0x27')]:_0x25fcef[_0xf20a('0x11c')][_0xf20a('0x27')],_['isNil'](_0x25fcef['dialPrefix'])?'':_0x25fcef['dialPrefix']['trim']()||'',_0x25fcef[_0xf20a('0x123')]>0x0?_0x1d34ad[_0xf20a('0xfc')][_0xf20a('0xfd')][_0xf20a('0x124')](_0x25fcef[_0xf20a('0x123')]):_0x1d34ad[_0xf20a('0xfc')][_0xf20a('0xfd')]);var _0x7314a5=_0x4facec[_0xf20a('0x95')](_0x25fcef[_0xf20a('0x52')])?ut['getCallerId'](_0x25fcef[_0xf20a('0x52')][_0xf20a('0x54')],_0x25fcef[_0xf20a('0x35')],_0x25fcef[_0xf20a('0x125')]>0x0?ut[_0xf20a('0x126')](_0x25fcef[_0xf20a('0x36')],_0x25fcef[_0xf20a('0x125')]):_0x25fcef[_0xf20a('0x36')]):ut['getCallerId'](_[_0xf20a('0x69')](_0x25fcef['TrunkBackup'])?_0x25fcef[_0xf20a('0x52')][_0xf20a('0x54')]:_0x25fcef[_0xf20a('0x11c')]['callerid'],_0x25fcef['dialOriginateCallerIdName'],_0x25fcef[_0xf20a('0x125')]>0x0?ut[_0xf20a('0x126')](_0x25fcef[_0xf20a('0x36')],_0x25fcef[_0xf20a('0x125')]):_0x25fcef['dialOriginateCallerIdNumber']);if(_0x7314a5){_0x3d25bd[_0xf20a('0x127')]=ut[_0xf20a('0x128')](_0x7314a5);_0x3d25bd['originatecalleridnum']=ut[_0xf20a('0x129')](_0x7314a5);}var _0x5ad1dd=ut[_0xf20a('0x12a')](_0x25fcef,_0x1d34ad,_0x4ae6e2,_0x7314a5,_0x51f581,_0x3d25bd);_[_0xf20a('0x12b')](_0x3d25bd,ut[_0xf20a('0x12c')](_0x5ad1dd));_0x3d25bd[_0xf20a('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut['variablesAction'](_0x3d25bd,_0x25fcef,_0x5ad1dd,_0x3d25bd['activeContact'],_0x47e3d3))[_0xf20a('0x7d')](function(_0xe3061e){var _0x1b4704=_0x3d25bd[_0xf20a('0x12d')];if(!_[_0xf20a('0x69')](_0x1b4704)){if(!_[_0xf20a('0x69')](_0x4facec[_0xf20a('0x15')][_0x1b4704])){_0x4facec[_0xf20a('0x15')][_0x1b4704][_0xf20a('0x12e')]=_0x3d25bd[_0xf20a('0x12f')];emit(util[_0xf20a('0x57')]('user:%s',_0x4facec[_0xf20a('0x15')][_0x1b4704][_0xf20a('0x27')]),'user:agentconnect',{'destaccountcode':_0x4facec['agents'][_0x1b4704]['accountcode'],'destconnectedlinenum':_0x3d25bd[_0xf20a('0x12f')]});}}_0x25fcef[_0xf20a('0x4c')]+=0x1;logger[_0xf20a('0x59')](_0xf20a('0x130'),_0x51f581,_0xf20a('0xac'),_0x25fcef[_0xf20a('0x27')],'originated:\x20',_0x25fcef[_0xf20a('0x4c')]);_0x3f3d2c(_0xe3061e);})[_0xf20a('0x75')](function(_0x21f794){ut[_0xf20a('0xf2')](_0x3d25bd,0xe,'OriginateError');rpcDb[_0xf20a('0xf3')](_0x3d25bd,_0xf20a('0x131'));_0x544456(_0x21f794);});});};Preview[_0xf20a('0x62')][_0xf20a('0x1f')]=function(_0x447888){if(this['actions'][_0x447888[_0xf20a('0xa7')]]){this[_0xf20a('0x6a')][_0x447888[_0xf20a('0xa7')]][_0xf20a('0x74')]=_0x447888['channel'];}};Preview[_0xf20a('0x62')][_0xf20a('0x17')]=function(_0x1c098e){var _0x443073=this;var _0x1d7777=this['actions'][_0x1c098e[_0xf20a('0x132')]];if(_0x1d7777){if(_0x1d7777['lookAgent']&&this[_0xf20a('0x15')][_0x1d7777[_0xf20a('0x100')]]){ut[_0xf20a('0x133')](_0x1d7777,this[_0xf20a('0x15')][_0x1d7777[_0xf20a('0x100')]][_0xf20a('0x27')],this[_0xf20a('0x15')][_0x1d7777[_0xf20a('0x100')]]['id']);}var _0x29d66a=_[_0xf20a('0x134')](_0x1d7777);_0x29d66a[_0xf20a('0xa9')]=moment()[_0xf20a('0x57')](_0xf20a('0x87'));var _0xe5e78f=_0x443073[_0xf20a('0x12')][_0x1d7777[_0xf20a('0x6b')]];if(ut['isFailure'](_0x1c098e[_0xf20a('0x135')])){if(_0x1d7777[_0xf20a('0xa5')]){rpcDb['unlockContact'](_0x1d7777[_0xf20a('0x136')]);}if(_0x1d7777[_0xf20a('0xa6')]){rpcDb[_0xf20a('0x85')](_0x1d7777[_0xf20a('0x136')]);}ami[_0xf20a('0x26')](_0xf20a('0x137'),ut['buildObj'](_0x1d7777,_0xf20a('0x138'),this[_0xf20a('0x12')][_0x1d7777['queue']]));this['callProgressDetectingAgent'](_0x29d66a,_0xe5e78f,_0x1c098e);}else{_0x1d7777['starttime']=moment()[_0xf20a('0x57')](_0xf20a('0x87'));ut['logAgent'](_0x29d66a,0x4,'Answer');rpcDb['createAgentHistory'](_0x29d66a,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0xf20a('0x1a')]=function(_0x1048c9){var _0xbea51e=this;var _0xca7349=this[_0xf20a('0x6a')][_0x1048c9[_0xf20a('0xa7')]];var _0x173da0;if(_0xca7349){_0x173da0=this['campaignsPreview'][_0xca7349[_0xf20a('0x6b')]];logger['info'](_0xf20a('0x139'),_0x1048c9[_0xf20a('0xa7')],_0xf20a('0xac'),_0x173da0[_0xf20a('0x27')],'pTalking:\x20',_0x173da0['pTalking']);}if(this[_0xf20a('0x6a')][_0x1048c9['linkedid']]&&_0x1048c9[_0xf20a('0xa7')]!==_0x1048c9[_0xf20a('0xab')]){if(_0x1048c9['cause']==='16'&&this[_0xf20a('0x6a')][_0x1048c9[_0xf20a('0xa7')]][_0xf20a('0x6e')]){this[_0xf20a('0x13a')](_0x1048c9,_0x1048c9[_0xf20a('0xa7')],_0x1048c9[_0xf20a('0x13b')]);}else if(this[_0xf20a('0x6a')][_0x1048c9['linkedid']][_0xf20a('0x6e')]){logger[_0xf20a('0x59')](_0xf20a('0x13c'),_0x1048c9['linkedid'],_0x1048c9[_0xf20a('0x13b')],_0xf20a('0xac'),_0x173da0[_0xf20a('0x27')],_0xf20a('0x6d'),_0x173da0['pTalking']);this['callProgressDetectingCustomer'](_0x1048c9,_0x1048c9[_0xf20a('0xa7')],_0x1048c9[_0xf20a('0x13b')]);}}else if(_0xca7349&&_[_0xf20a('0x69')](_0xca7349[_0xf20a('0x13d')])&&_0x173da0[_0xf20a('0x13e')]&&_0x1048c9[_0xf20a('0xa7')]===_0x1048c9[_0xf20a('0xab')]&&_[_0xf20a('0x69')](_0x1048c9[_0xf20a('0xf1')])&&_0x1048c9[_0xf20a('0x13b')]==='16'&&_0x1048c9[_0xf20a('0x13f')]==='6'&&_[_0xf20a('0xef')](_0xca7349[_0xf20a('0x140')])){if(_0xca7349[_0xf20a('0xa5')]){rpcDb[_0xf20a('0x10f')](_0xca7349['idContact']);}if(_0xca7349['activeContact']){rpcDb['disableContact'](_0xca7349[_0xf20a('0x136')]);}_0x1048c9['reason']='22';this[_0xf20a('0xee')](_0xca7349,_0x173da0,_0x1048c9);}else if(_0xca7349&&_0xca7349[_0xf20a('0x140')]){if(_0x1048c9['cause']==='16'&&this[_0xf20a('0x6a')][_0x1048c9['linkedid']]['dialAnswer']){logger[_0xf20a('0x59')]('[syncHangup][talking][transfer]',_0x1048c9[_0xf20a('0xa7')],_0x1048c9[_0xf20a('0x13b')],_0xf20a('0xac'),_0x173da0[_0xf20a('0x27')],_0xf20a('0x6d'),_0x173da0[_0xf20a('0x2a')]);this[_0xf20a('0x13a')](_0x1048c9,_0x1048c9[_0xf20a('0xa7')],_0x1048c9[_0xf20a('0x13b')]);}else if(this[_0xf20a('0x6a')][_0x1048c9[_0xf20a('0xa7')]][_0xf20a('0x6e')]){logger['info']('[syncHangup][talking][cause]',_0x1048c9['linkedid'],_0x1048c9[_0xf20a('0x13b')],'\x20Queue',_0x173da0[_0xf20a('0x27')],_0xf20a('0x6d'),_0x173da0['pTalking']);this[_0xf20a('0x13a')](_0x1048c9,_0x1048c9[_0xf20a('0xa7')],_0x1048c9['cause']);}}};Preview['prototype'][_0xf20a('0x141')]=function(_0x16d76f){if(this['actions'][_0x16d76f[_0xf20a('0xed')]]&&_0x16d76f[_0xf20a('0xed')]!==_0x16d76f[_0xf20a('0x142')]){this[_0xf20a('0x13a')](_0x16d76f,_0x16d76f[_0xf20a('0xed')],_0x16d76f[_0xf20a('0xe7')]);}};Preview[_0xf20a('0x62')][_0xf20a('0x1c')]=function(_0x2b3006){if(this['actions'][_0x2b3006[_0xf20a('0xa7')]]&&_0x2b3006['linkedid']!==_0x2b3006[_0xf20a('0xab')]&&!this[_0xf20a('0x6a')][_0x2b3006[_0xf20a('0xa7')]]['dialAnswer']){if(_0x2b3006[_0xf20a('0x13b')]==='1'){this[_0xf20a('0x13a')](_0x2b3006,_0x2b3006[_0xf20a('0xa7')],_0x2b3006[_0xf20a('0x13b')]);}}};Preview[_0xf20a('0x62')][_0xf20a('0x143')]=function(_0x2e9aa9,_0x1baee1,_0x4ecb97){if(this['actions'][_0x2e9aa9]){if(_['isNil'](this[_0xf20a('0x6a')][_0x2e9aa9][_0xf20a('0x144')])){this['actions'][_0x2e9aa9][_0xf20a('0x144')]={};}this[_0xf20a('0x6a')][_0x2e9aa9][_0xf20a('0x144')][_0x1baee1]=_0x4ecb97;}};Preview[_0xf20a('0x62')][_0xf20a('0x21')]=function(_0x16cb04){try{if(!_[_0xf20a('0x69')](_0x16cb04)){if(ut[_0xf20a('0x145')](_['keys'](_0x16cb04[_0xf20a('0x146')])[0x0])){this[_0xf20a('0x143')](_0x16cb04[_0xf20a('0xab')],_[_0xf20a('0x147')](_0x16cb04[_0xf20a('0x146')])[0x0],_0x16cb04[_0xf20a('0x148')]);}}}catch(_0x196809){logger['error'](_0xf20a('0x149'),util[_0xf20a('0x14a')](_0x196809,{'showHidden':![],'depth':null}));}};Preview[_0xf20a('0x62')][_0xf20a('0x14b')]=function(_0x56cb9a){if(_0x56cb9a){if(this['actions'][_0x56cb9a['transfertargetlinkedid']]){this[_0xf20a('0x6a')][_0x56cb9a[_0xf20a('0x14c')]]['transfer']=!![];}}};Preview[_0xf20a('0x62')][_0xf20a('0x24')]=function(_0x3838be){if(_0x3838be){if(this[_0xf20a('0x6a')][_0x3838be[_0xf20a('0x14d')]]){this[_0xf20a('0x6a')][_0x3838be[_0xf20a('0x14d')]][_0xf20a('0x140')]=!![];}}};module[_0xf20a('0x14e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 9a218b9..0ccc197 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 _0x9cf8=['countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','catch','[createHistory]\x20','resolve','createHistory','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20'];(function(_0x47b409,_0x4fb731){var _0x2fdefb=function(_0x2f61ae){while(--_0x2f61ae){_0x47b409['push'](_0x47b409['shift']());}};_0x2fdefb(++_0x4fb731);}(_0x9cf8,0x1a5));var _0x89cf=function(_0x4a0b2c,_0x432963){_0x4a0b2c=_0x4a0b2c-0x0;var _0x37b77c=_0x9cf8[_0x4a0b2c];return _0x37b77c;};'use strict';var util=require(_0x89cf('0x0'));var BPromise=require(_0x89cf('0x1'));var logger=require(_0x89cf('0x2'))('preview');var _=require(_0x89cf('0x3'));var cmHopper=require(_0x89cf('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x89cf('0x5'));var cmHopperBlack=require(_0x89cf('0x6'));var voiceQueueRt=require(_0x89cf('0x7'));var agentReportPreview=require(_0x89cf('0x8'));var voiceQueueReport=require(_0x89cf('0x9'));function loggerCatch(_0x3cc627){return function(_0x476cef){logger[_0x89cf('0xa')](_0x3cc627,util[_0x89cf('0xb')](_0x476cef,{'showHidden':![],'depth':null}));};}function create(_0x1e15f6){return BPromise['resolve']()[_0x89cf('0xc')](cmHopperHistory['createHistory'](_0x1e15f6))[_0x89cf('0xd')](loggerCatch(_0x89cf('0xe')));}function createAgent(_0x5c82a5){return BPromise[_0x89cf('0xf')]()['then'](agentReportPreview[_0x89cf('0x10')](_0x5c82a5))[_0x89cf('0xd')](loggerCatch(_0x89cf('0xe')));}function moveContact(_0x187a2b){return BPromise[_0x89cf('0xf')]()[_0x89cf('0xc')](cmHopper[_0x89cf('0x11')](_0x187a2b,!![]))[_0x89cf('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x89cf('0x12')]=function(_0x15712d){return BPromise[_0x89cf('0xf')]()[_0x89cf('0xc')](cmHopperBlack[_0x89cf('0x12')](_0x15712d))[_0x89cf('0xd')](loggerCatch(_0x89cf('0x13')));};exports[_0x89cf('0x14')]=function(_0x4feb8){return BPromise[_0x89cf('0xf')]()[_0x89cf('0xc')](cmHopper[_0x89cf('0x14')](_0x4feb8))[_0x89cf('0xd')](loggerCatch(_0x89cf('0x15')));};exports[_0x89cf('0x10')]=function(_0x37a9bd,_0x3e5eb2){create(_0x37a9bd)[_0x89cf('0xd')](loggerCatch(_0x3e5eb2));moveContact(_0x37a9bd)['catch'](loggerCatch(_0x3e5eb2));};exports['createAgentHistory']=function(_0x1a1133,_0x3b41f4){createAgent(_0x1a1133)[_0x89cf('0xd')](loggerCatch(_0x3b41f4));};exports[_0x89cf('0x16')]=function(_0x5d280a,_0x130250){create(_0x5d280a)['catch'](loggerCatch(_0x130250));};exports[_0x89cf('0x17')]=function(_0x12321c,_0xddffb6){moveContact(_0x12321c)['catch'](loggerCatch(_0xddffb6));};exports[_0x89cf('0x18')]=function(_0xe64795,_0x4c113c,_0x4e4f30){if(_0x4c113c){_0xe64795[_0x89cf('0x19')]=null;}if(_0x4e4f30){_0xe64795['active']=![];}return BPromise[_0x89cf('0xf')]()[_0x89cf('0xc')](cmHopper['rescheduleContact'](_0xe64795))[_0x89cf('0xd')](loggerCatch(_0x89cf('0x1a')));};exports[_0x89cf('0x1b')]=function(_0x19f52b){return BPromise[_0x89cf('0xf')]()[_0x89cf('0xc')](cmHopper[_0x89cf('0x1b')](_0x19f52b))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x89cf('0x1c')]=function(_0x4a3f54){return BPromise[_0x89cf('0xf')]()['then'](cmHopper[_0x89cf('0x1c')]({'UserId':null},_0x4a3f54,0x1))[_0x89cf('0xd')](loggerCatch(_0x89cf('0x1d')));};exports[_0x89cf('0x1e')]=function(_0x57a2f7){return BPromise[_0x89cf('0xf')]()['then'](cmHopper['unlockContact']({'active':![]},_0x57a2f7,0x1))['catch'](loggerCatch(_0x89cf('0x1f')));};exports['crateCustomerReportQueue']=function(_0x4eecf0){var _0x21924a={};_0x21924a[_0x89cf('0x20')]=_0x4eecf0[_0x89cf('0x20')];_0x21924a[_0x89cf('0x21')]=_0x4eecf0[_0x89cf('0x21')];_0x21924a[_0x89cf('0x22')]=_0x4eecf0['calleridnum'];_0x21924a[_0x89cf('0x23')]=_0x4eecf0[_0x89cf('0x23')];_0x21924a['queue']=_0x4eecf0[_0x89cf('0x24')];_0x21924a[_0x89cf('0x25')]=_0x4eecf0[_0x89cf('0x26')];_0x21924a[_0x89cf('0x27')]=_0x4eecf0[_0x89cf('0x26')];_0x21924a[_0x89cf('0x28')]=0x1;_0x21924a[_0x89cf('0x29')]=_0x4eecf0[_0x89cf('0x2a')];_0x21924a[_0x89cf('0x2b')]=_0x4eecf0['membername'];_0x21924a[_0x89cf('0x2c')]='from-sip';_0x21924a[_0x89cf('0x2d')]='xcally-motion-preview';_0x21924a[_0x89cf('0x2e')]=0x0;_0x21924a[_0x89cf('0x2f')]=0x1;_0x21924a[_0x89cf('0x30')]=_0x4eecf0[_0x89cf('0x31')];_0x21924a[_0x89cf('0x32')]='COMPLETED';return BPromise['resolve']()[_0x89cf('0xc')](voiceQueueReport[_0x89cf('0x33')](_0x21924a))[_0x89cf('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x89cf('0x34')]=function(_0x1d8d3f,_0x2da7ab){return BPromise[_0x89cf('0xf')]()['then'](cmHopper[_0x89cf('0x34')](_0x1d8d3f,_0x2da7ab))[_0x89cf('0xd')](loggerCatch(_0x89cf('0x35')));};exports[_0x89cf('0x36')]=function(_0x3dd0b1){return BPromise[_0x89cf('0xf')]()[_0x89cf('0xc')](cmHopper[_0x89cf('0x18')](_0x3dd0b1,!![],!![]))['catch'](loggerCatch(_0x89cf('0x37')));}; \ No newline at end of file +var _0x9c84=['getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20'];(function(_0x3833de,_0x10a7ea){var _0x5a5631=function(_0x1d1071){while(--_0x1d1071){_0x3833de['push'](_0x3833de['shift']());}};_0x5a5631(++_0x10a7ea);}(_0x9c84,0x148));var _0x49c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9c84[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x49c8('0x0'));var BPromise=require(_0x49c8('0x1'));var logger=require(_0x49c8('0x2'))(_0x49c8('0x3'));var _=require('lodash');var cmHopper=require(_0x49c8('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x49c8('0x5'));var cmHopperBlack=require(_0x49c8('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x49c8('0x7'));var voiceQueueReport=require(_0x49c8('0x8'));function loggerCatch(_0x15423f){return function(_0x58416d){logger[_0x49c8('0x9')](_0x15423f,util[_0x49c8('0xa')](_0x58416d,{'showHidden':![],'depth':null}));};}function create(_0x1f7437){return BPromise[_0x49c8('0xb')]()[_0x49c8('0xc')](cmHopperHistory[_0x49c8('0xd')](_0x1f7437))[_0x49c8('0xe')](loggerCatch(_0x49c8('0xf')));}function createAgent(_0x40d6ed){return BPromise[_0x49c8('0xb')]()[_0x49c8('0xc')](agentReportPreview['createHistory'](_0x40d6ed))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2a261e){return BPromise[_0x49c8('0xb')]()[_0x49c8('0xc')](cmHopper[_0x49c8('0x10')](_0x2a261e,!![]))[_0x49c8('0xe')](loggerCatch(_0x49c8('0x11')));}exports[_0x49c8('0x12')]=function(_0x439fe5){return BPromise['resolve']()[_0x49c8('0xc')](cmHopperBlack['checkIsBlackList'](_0x439fe5))[_0x49c8('0xe')](loggerCatch(_0x49c8('0x13')));};exports[_0x49c8('0x14')]=function(_0x483770){return BPromise[_0x49c8('0xb')]()[_0x49c8('0xc')](cmHopper['getContactPreview'](_0x483770))['catch'](loggerCatch(_0x49c8('0x15')));};exports['createHistory']=function(_0x26c374,_0x460768){create(_0x26c374)['catch'](loggerCatch(_0x460768));moveContact(_0x26c374)['catch'](loggerCatch(_0x460768));};exports[_0x49c8('0x16')]=function(_0x29910c,_0xf6d883){createAgent(_0x29910c)[_0x49c8('0xe')](loggerCatch(_0xf6d883));};exports['createCustomerHistory']=function(_0x4fc6d6,_0x44884d){create(_0x4fc6d6)[_0x49c8('0xe')](loggerCatch(_0x44884d));};exports[_0x49c8('0x17')]=function(_0x398428,_0x4e552a){moveContact(_0x398428)['catch'](loggerCatch(_0x4e552a));};exports[_0x49c8('0x18')]=function(_0x5c2e26,_0x1f1dbf,_0x1a1362){if(_0x1f1dbf){_0x5c2e26[_0x49c8('0x19')]=null;}if(_0x1a1362){_0x5c2e26[_0x49c8('0x1a')]=![];}return BPromise[_0x49c8('0xb')]()[_0x49c8('0xc')](cmHopper[_0x49c8('0x18')](_0x5c2e26))[_0x49c8('0xe')](loggerCatch(_0x49c8('0x1b')));};exports[_0x49c8('0x1c')]=function(_0x596034){return BPromise[_0x49c8('0xb')]()[_0x49c8('0xc')](cmHopper['countReScheduled'](_0x596034))[_0x49c8('0xe')](loggerCatch(_0x49c8('0x1d')));};exports[_0x49c8('0x1e')]=function(_0x4cc868){return BPromise['resolve']()[_0x49c8('0xc')](cmHopper[_0x49c8('0x1e')]({'UserId':null},_0x4cc868,0x1))[_0x49c8('0xe')](loggerCatch(_0x49c8('0x1f')));};exports['disableContact']=function(_0x3b10c2){return BPromise[_0x49c8('0xb')]()['then'](cmHopper[_0x49c8('0x1e')]({'active':![]},_0x3b10c2,0x1))[_0x49c8('0xe')](loggerCatch(_0x49c8('0x20')));};exports[_0x49c8('0x21')]=function(_0x117e0a){var _0x2ac7e6={};_0x2ac7e6[_0x49c8('0x22')]=_0x117e0a[_0x49c8('0x22')];_0x2ac7e6[_0x49c8('0x23')]=_0x117e0a['uniqueid'];_0x2ac7e6[_0x49c8('0x24')]=_0x117e0a[_0x49c8('0x24')];_0x2ac7e6[_0x49c8('0x25')]=_0x117e0a['calleridname'];_0x2ac7e6['queue']=_0x117e0a['queue'];_0x2ac7e6[_0x49c8('0x26')]=_0x117e0a['answertime'];_0x2ac7e6[_0x49c8('0x27')]=_0x117e0a[_0x49c8('0x28')];_0x2ac7e6[_0x49c8('0x29')]=0x1;_0x2ac7e6['queuecallercompleteAt']=_0x117e0a['endtime'];_0x2ac7e6[_0x49c8('0x2a')]=_0x117e0a['membername'];_0x2ac7e6[_0x49c8('0x2b')]=_0x49c8('0x2c');_0x2ac7e6[_0x49c8('0x2d')]=_0x49c8('0x2e');_0x2ac7e6[_0x49c8('0x2f')]=0x0;_0x2ac7e6[_0x49c8('0x30')]=0x1;_0x2ac7e6[_0x49c8('0x31')]=_0x117e0a[_0x49c8('0x32')];_0x2ac7e6[_0x49c8('0x33')]='COMPLETED';return BPromise[_0x49c8('0xb')]()[_0x49c8('0xc')](voiceQueueReport[_0x49c8('0x34')](_0x2ac7e6))[_0x49c8('0xe')](loggerCatch(_0x49c8('0x35')));};exports[_0x49c8('0x36')]=function(_0x4087ed,_0x4d25e7){return BPromise['resolve']()[_0x49c8('0xc')](cmHopper[_0x49c8('0x36')](_0x4087ed,_0x4d25e7))[_0x49c8('0xe')](loggerCatch(_0x49c8('0x37')));};exports[_0x49c8('0x38')]=function(_0x1f72e4){return BPromise[_0x49c8('0xb')]()[_0x49c8('0xc')](cmHopper[_0x49c8('0x18')](_0x1f72e4,!![],!![]))['catch'](loggerCatch(_0x49c8('0x39')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 5409823..f99035c 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 _0xd0e8=['Blacklist','starttime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','ringtime','membername','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','originate','channelAgent','timeout','uniqueid','totalGlobal','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','hasOwnProperty','not_inuse','status','reachable','push','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','calleridnum','countcongestionretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','addVariables','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist'];(function(_0x55d5ae,_0x482485){var _0x36f211=function(_0x2df47e){while(--_0x2df47e){_0x55d5ae['push'](_0x55d5ae['shift']());}};_0x36f211(++_0x482485);}(_0xd0e8,0x16f));var _0x8d0e=function(_0x26bd0c,_0x96601e){_0x26bd0c=_0x26bd0c-0x0;var _0x6b834=_0xd0e8[_0x26bd0c];return _0x6b834;};'use strict';var util=require(_0x8d0e('0x0'));var _=require(_0x8d0e('0x1'));var moment=require('moment');var logger=require(_0x8d0e('0x2'))(_0x8d0e('0x3'));var ipAgi=process['env'][_0x8d0e('0x4')]||'127.0.0.1';function getSeconds(_0x2a6705,_0x56ecd9){var _0x5be5f1=moment(_0x2a6705)[_0x8d0e('0x5')](0x0);var _0x5791d5=moment(_0x56ecd9)[_0x8d0e('0x5')](0x0);return _0x5be5f1[_0x8d0e('0x6')](_0x5791d5,_0x8d0e('0x7'));}exports[_0x8d0e('0x8')]=function(_0x398193){return function(_0x3fefa8){logger[_0x8d0e('0x9')](_0x398193,util[_0x8d0e('0xa')](_0x3fefa8,{'showHidden':![],'depth':null}));};};exports[_0x8d0e('0xb')]=function(_0x276d5c,_0x348a9f){logger[_0x8d0e('0xc')](_0x276d5c,util[_0x8d0e('0xa')](_0x348a9f,{'showHidden':![],'depth':null}));};exports[_0x8d0e('0xd')]=function(_0x638ebe,_0x27f4b2){logger[_0x8d0e('0x9')](_0x638ebe,util[_0x8d0e('0xa')](_0x27f4b2,{'showHidden':![],'depth':null}));};exports[_0x8d0e('0xe')]=function(_0x3099d2){return function(_0x310e0c){logger['info'](_0x3099d2,util[_0x8d0e('0xa')](_0x310e0c,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x836a61,_0x3e710e,_0x23394d){return{'message':_0x836a61,'unlock':_0x3e710e,'active':_0x23394d};};exports[_0x8d0e('0xf')]=function(_0x1076d7,_0x38c686,_0x5628e7){if(!_[_0x8d0e('0x10')](_0x5628e7)&&'string'===typeof _0x5628e7&&!_[_0x8d0e('0x11')](_0x5628e7)){if(!_['isUndefined'](_0x38c686)&&_0x8d0e('0x12')===typeof _0x38c686&&!_[_0x8d0e('0x11')](_0x38c686)){return util['format'](_0x8d0e('0x13'),_0x38c686,_0x5628e7);}return util[_0x8d0e('0x14')](_0x8d0e('0x13'),_0x5628e7,_0x5628e7);}if(!_[_0x8d0e('0x10')](_0x1076d7)&&_0x8d0e('0x12')===typeof _0x1076d7&&!_['isEmpty'](_0x1076d7)){return _0x1076d7;}return _0x8d0e('0x15');};exports['isActive']=function(_0x104b93){if(_['isNil'](_0x104b93)){return![];}return _0x104b93;};exports[_0x8d0e('0x16')]=function(_0x46c797,_0x33e70b,_0x41d1c5,_0x52862f,_0x5ce857,_0x4019c8){var _0x3e8c03={'XMD-QUEUE':_0x33e70b[_0x8d0e('0x17')]?_0x33e70b[_0x8d0e('0x17')][_0x8d0e('0x18')]:'','XMD-CALLERID':_0x52862f,'XMD-CALLERID-PREVIEW':_0x4019c8?util['format'](_0x8d0e('0x13'),_0x4019c8[_0x8d0e('0x19')],_0x4019c8['calleridnum']):_0x52862f,'XMD-DIALID':_0x5ce857,'XMD-CONTACTID':_0x33e70b[_0x8d0e('0x1a')],'XMD-CDRTYPE':_0x8d0e('0x1b'),'CALLERID(all)':_0x52862f,'XMD-VOICEQUEUEID':_0x33e70b[_0x8d0e('0x1c')],'XMD-DIALCHANNEL':_0x41d1c5,'XMD-DIALTIMEOUT':_0x46c797[_0x8d0e('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x8d0e('0x14')](_0x8d0e('0x1e'),_0x46c797[_0x8d0e('0x1f')]?'g':'',_[_0x8d0e('0x11')](_0x46c797['monitor_format'])?'':_0x8d0e('0x20')),'XMD-DIALURL':_0x46c797[_0x8d0e('0x21')]||'','XMD-AGI':_0x46c797[_0x8d0e('0x22')]?util['format'](_0x8d0e('0x23'),ipAgi,_0x46c797[_0x8d0e('0x22')]):_0x8d0e('0x24'),'XMD-AGIAFTER':_0x46c797[_0x8d0e('0x1f')]?util[_0x8d0e('0x14')](_0x8d0e('0x23'),ipAgi,_0x46c797[_0x8d0e('0x1f')]):_0x8d0e('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x4019c8?_0x4019c8[_0x8d0e('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x4019c8?_0x4019c8[_0x8d0e('0x26')]:'','XMD-DESTINATION':_0x8d0e('0x27')};if(!_[_0x8d0e('0x11')](_0x46c797[_0x8d0e('0x28')])){_0x3e8c03[util[_0x8d0e('0x14')]('%s',_0x8d0e('0x29'))]=_0x46c797[_0x8d0e('0x28')];_0x3e8c03[util[_0x8d0e('0x14')]('%s',_0x8d0e('0x2a'))]=_0x5ce857;}if(_0x33e70b&&_0x33e70b[_0x8d0e('0x2b')]){for(var _0x398881 in _0x33e70b[_0x8d0e('0x2b')]){if(_0x33e70b['Contact']['hasOwnProperty'](_0x398881)){if(!_[_0x8d0e('0x2c')](_0x33e70b[_0x8d0e('0x2b')][_0x398881])&&_0x398881!=='id'&&_0x398881!==_0x8d0e('0x2d')&&_0x398881!==_0x8d0e('0x2e')&&_0x398881!==_0x8d0e('0x2f')){_0x3e8c03[util[_0x8d0e('0x14')](_0x8d0e('0x30'),_0x8d0e('0x31'),_[_0x8d0e('0x32')](_0x398881))]=_0x33e70b['Contact'][_0x398881];}}}}return _0x3e8c03;};exports[_0x8d0e('0x33')]=function(_0x4a496c){var _0x186603={};for(var _0x32829d in _0x4a496c){if(_0x4a496c['hasOwnProperty'](_0x32829d)){_0x186603[util[_0x8d0e('0x14')]('%s',_[_0x8d0e('0x34')](_0x32829d))]=_0x4a496c[_0x32829d];}}return{'variables':_0x186603};};exports['updateOriginated']=function(_0x5d3f48,_0x52e6cf){if(!_[_0x8d0e('0x2c')](_0x5d3f48)){if(_0x5d3f48['hasOwnProperty']('originated')){if(_0x5d3f48[_0x8d0e('0x35')]>0x0){_0x5d3f48[_0x8d0e('0x35')]-=0x1;}else{logger[_0x8d0e('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x52e6cf);}}}else{logger['error'](_0x8d0e('0x36'),_0x52e6cf);}};exports[_0x8d0e('0x37')]=function(_0x29e6a1){var _0x515b8b=moment()[_0x8d0e('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x29e6a1['state']=0xd;_0x29e6a1['statedesc']=_0x8d0e('0x38');_0x29e6a1[_0x8d0e('0x39')]=_0x515b8b;_0x29e6a1['responsetime']=_0x515b8b;_0x29e6a1[_0x8d0e('0x3a')]=_0x515b8b;};exports[_0x8d0e('0x3b')]=function(_0x51ae55,_0x3b9f08,_0x147cf3){var _0x42aed8=moment()[_0x8d0e('0x14')](_0x8d0e('0x3c'));_0x51ae55[_0x8d0e('0x3d')]=_0x3b9f08;_0x51ae55[_0x8d0e('0x3e')]=_0x147cf3;_0x51ae55[_0x8d0e('0x3f')]=_0x42aed8;_0x51ae55[_0x8d0e('0x40')]=getSeconds(_0x51ae55[_0x8d0e('0x3f')],_0x51ae55[_0x8d0e('0x39')]);};exports['logLookAgent']=function(_0x1b430f,_0x286506,_0x52b48c){_0x1b430f[_0x8d0e('0x41')]=_0x286506;_0x1b430f['UserId']=_0x52b48c;};exports['logCustomer']=function(_0x195a01,_0x49a517,_0x191543){var _0x2da578=moment()['format'](_0x8d0e('0x3c'));_0x195a01[_0x8d0e('0x3d')]=_0x49a517;_0x195a01[_0x8d0e('0x3e')]=_0x191543;_0x195a01['responsetime']=_0x195a01[_0x8d0e('0x3f')]?_0x195a01[_0x8d0e('0x3f')]:_0x2da578;_0x195a01[_0x8d0e('0x3a')]=_0x195a01[_0x8d0e('0x3a')]?_0x195a01[_0x8d0e('0x3a')]:_0x2da578;_0x195a01[_0x8d0e('0x40')]=getSeconds(_0x195a01[_0x8d0e('0x3f')]||0x0,_0x195a01[_0x8d0e('0x39')]||0x0);_0x195a01[_0x8d0e('0x42')]=_0x195a01[_0x8d0e('0x43')]?getSeconds(_0x195a01[_0x8d0e('0x3a')],_0x195a01[_0x8d0e('0x43')]):0x0;};exports['isFailure']=function(_0xc33c5d){return _0xc33c5d===_0x8d0e('0x44');};exports[_0x8d0e('0x45')]=function(_0x1eff2e,_0x23ddf9,_0x1fb95f,_0x40d15c,_0x4ec021){var _0x3ce73d=_0x40d15c?_0x8d0e('0x46'):_0x1eff2e[_0x8d0e('0x19')];_0x3ce73d=_0x4ec021?_0x8d0e('0x47'):_0x3ce73d;return{'actionid':_0x1eff2e['uniqueid'],'action':_0x8d0e('0x48'),'channel':_0x1eff2e[_0x8d0e('0x49')],'callerid':util[_0x8d0e('0x14')](_0x8d0e('0x13'),_0x3ce73d,_0x1eff2e['calleridnum']),'Exten':_0x8d0e('0x27'),'Context':'from-sip','Priority':'1','variable':_0x1fb95f,'timeout':(_0x23ddf9[_0x8d0e('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1eff2e[_0x8d0e('0x4b')]};};exports[_0x8d0e('0x4c')]=function(_0x1efa2a){return _0x1efa2a['countbusyretry']+_0x1efa2a['countcongestionretry']+_0x1efa2a[_0x8d0e('0x4d')]+_0x1efa2a[_0x8d0e('0x4e')]+_0x1efa2a[_0x8d0e('0x4f')];};exports[_0x8d0e('0x50')]=function(_0x4f775b){var _0x4cdc46=_['clone'](_0x4f775b);_0x4cdc46[_0x8d0e('0x3d')]=0xf;_0x4cdc46[_0x8d0e('0x3e')]=_0x8d0e('0x51');return _0x4cdc46;};exports[_0x8d0e('0x52')]=function(_0x429ade,_0xe96bf7,_0x1baf8a){var _0x2b954a={};_0x2b954a[_0xe96bf7]=_0x429ade[_0xe96bf7];_0x2b954a['active']=![];_0x2b954a[_0x8d0e('0x53')]=moment()[_0x8d0e('0x54')](_0x1baf8a,_0x8d0e('0x55'))['format'](_0x8d0e('0x3c'));_0x2b954a[_0x8d0e('0x1a')]=_0x429ade['ContactId'];_0x2b954a[_0x8d0e('0x56')]=_0x429ade[_0x8d0e('0x56')];_0x2b954a[_0x8d0e('0x1c')]=_0x429ade[_0x8d0e('0x1c')]||undefined;return _0x2b954a;};exports['decrementTalkink']=function(_0x27e07a,_0xbef774){if(!_[_0x8d0e('0x2c')](_0x27e07a)){if(_0x27e07a[_0x8d0e('0x57')]>0x0){_0x27e07a['pTalking']-=0x1;}else{logger[_0x8d0e('0x9')](_0xbef774,_0x8d0e('0x58'));}}else{logger[_0x8d0e('0x9')](_0xbef774,_0x8d0e('0x59'));}};exports['IsNotLoggedIn']=function(_0x43caf8){if(_0x43caf8<=0x0){return!![];}return![];};exports[_0x8d0e('0x5a')]=function(_0x4ffb96,_0x3d0097,_0xf2f10d){_0x4ffb96['lastevent']=_0x3d0097;_0x4ffb96[_0x8d0e('0x18')]=_0x4ffb96[_0x8d0e('0x5b')];_0x4ffb96[_0x8d0e('0x5c')]=_0x4ffb96['channelAgent'];_0x4ffb96[_0x8d0e('0x5d')]=_0x8d0e('0x5e');if(_0xf2f10d){_0x4ffb96[_0x8d0e('0x5f')]=_0xf2f10d[_0x8d0e('0x5f')];}return _0x4ffb96;};exports[_0x8d0e('0x60')]=function(_0x569560){var _0x3e4969={};_0x3e4969[_0x8d0e('0x5b')]=_0x569560[_0x8d0e('0x5b')];_0x3e4969[_0x8d0e('0x5c')]=_0x569560[_0x8d0e('0x49')];_0x3e4969[_0x8d0e('0x4b')]=_0x569560[_0x8d0e('0x4b')];return _0x3e4969;};exports['agentReadyId']=function(_0x1a6edd){var _0x34ef9d=[];for(var _0x3c55da in _0x1a6edd){if(_0x1a6edd[_0x8d0e('0x61')](_0x3c55da)){if(!_['isNil'](_0x1a6edd[_0x3c55da])&&_0x1a6edd[_0x3c55da][_0x8d0e('0x3d')]===_0x8d0e('0x62')&&_0x1a6edd[_0x3c55da][_0x8d0e('0x63')]===_0x8d0e('0x64')){_0x34ef9d[_0x8d0e('0x65')](_0x1a6edd[_0x3c55da]['id']);}}}return _0x34ef9d;};exports['getDiff']=function(_0x41c9f6){var _0x2256b0=moment()[_0x8d0e('0x5')](0x0);var _0x18ba2d=moment(_0x41c9f6)[_0x8d0e('0x5')](0x0);return _0x2256b0['diff'](_0x18ba2d,_0x8d0e('0x7'));};exports[_0x8d0e('0x66')]=function(_0x4c3396){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4c3396[_0x8d0e('0x1a')],'ListId':_0x4c3396[_0x8d0e('0x56')],'VoiceQueueId':_0x4c3396['VoiceQueueId']||undefined,'CampaignId':_0x4c3396[_0x8d0e('0x67')]||undefined};};exports[_0x8d0e('0x68')]=function(_0x3d62ef){if(_0x3d62ef===_0x8d0e('0x4b')||_0x3d62ef===_0x8d0e('0x69')||_0x3d62ef===_0x8d0e('0x5b')||_0x3d62ef==='type'||_0x3d62ef===_0x8d0e('0x6a')||_0x3d62ef===_0x8d0e('0x6b')||_0x3d62ef==='membername'||_0x3d62ef===_0x8d0e('0x49')||_0x3d62ef===_0x8d0e('0x19')||_0x3d62ef==='active'||_0x3d62ef===_0x8d0e('0x6c')||_0x3d62ef===_0x8d0e('0x53')||_0x3d62ef==='countbusyretry'||_0x3d62ef===_0x8d0e('0x6d')||_0x3d62ef==='countnoanswerretry'||_0x3d62ef===_0x8d0e('0x6e')||_0x3d62ef===_0x8d0e('0x6f')||_0x3d62ef==='callbackuniqueid'||_0x3d62ef===_0x8d0e('0x70')||_0x3d62ef===_0x8d0e('0x71')||_0x3d62ef===_0x8d0e('0x1a')||_0x3d62ef===_0x8d0e('0x56')||_0x3d62ef==='UserId'||_0x3d62ef===_0x8d0e('0x1c')||_0x3d62ef===_0x8d0e('0x72')||_0x3d62ef===_0x8d0e('0x73')||_0x3d62ef===_0x8d0e('0x74')||_0x3d62ef===_0x8d0e('0x75')||_0x3d62ef===_0x8d0e('0x76')||_0x3d62ef==='xmd-dialurl'||_0x3d62ef===_0x8d0e('0x77')||_0x3d62ef===_0x8d0e('0x78')||_0x3d62ef===_0x8d0e('0x79')||_0x3d62ef==='xmd-dialchannel'||_0x3d62ef==='xmd-contactid'||_0x3d62ef==='xmd-cdrtype'||_0x3d62ef==='xmd-callerid'||_0x3d62ef===_0x8d0e('0x7a')||_0x3d62ef===_0x8d0e('0x7b')||_0x3d62ef===_0x8d0e('0x7c')||_0x3d62ef===_0x8d0e('0x7d')||_0x3d62ef===_0x8d0e('0x7e')||_0x3d62ef===_0x8d0e('0x7f')||_0x3d62ef===_0x8d0e('0x80')||_0x3d62ef==='rtpaudioqoslossbridged'||_0x3d62ef===_0x8d0e('0x81')||_0x3d62ef===_0x8d0e('0x82')||_0x3d62ef===_0x8d0e('0x7c')||_0x3d62ef===_0x8d0e('0x7d')||_0x3d62ef==='rtpaudioqosjitter'||_0x3d62ef==='rtpaudioqosjitterbridged'||_0x3d62ef===_0x8d0e('0x80')||_0x3d62ef===_0x8d0e('0x83')||_0x3d62ef===_0x8d0e('0x81')||_0x3d62ef===_0x8d0e('0x82')||_0x3d62ef==='bridgepeer'||_0x3d62ef===_0x8d0e('0x84')||_0x3d62ef===_0x8d0e('0x3d')||_0x3d62ef===_0x8d0e('0x3e')){return![];}return!![];};exports[_0x8d0e('0x85')]=function(_0x282ff1,_0xf7b003){var _0x4b824d,_0x375603,_0x127c5e;if(_0xf7b003<=0x0){_0xf7b003=0x1;}_0x4b824d=new RegExp(_0x8d0e('0x86')+_0xf7b003+'}$');_0x375603=Math[_0x8d0e('0x87')](0xa,_0xf7b003-0x1);_0x127c5e=Math['pow'](0xa,_0xf7b003)-0x1;return util[_0x8d0e('0x14')]('%s',_[_0x8d0e('0x88')](_0x282ff1,_0x4b824d,_[_0x8d0e('0x89')](_0x375603,_0x127c5e)));};exports[_0x8d0e('0x8a')]=function(_0x51db94){var _0x35ed01=_0x51db94[_0x8d0e('0x8b')](/"(.*?)"/);return _0x35ed01?_0x35ed01[0x1]:_0x51db94;};exports[_0x8d0e('0x8c')]=function(_0x523c1a){var _0x9a130c=_0x523c1a['match'](/<(.*?)>/);return _0x9a130c?_0x9a130c[0x1]:_0x523c1a;}; \ No newline at end of file +var _0xf1af=['callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','loggerError','logger2','inspect','message','getCallerId','string','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','starttime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','responsetime','membername','UserId','logCustomer','ringtime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','interface','motionChannel','mandatoryDisposition','buildAcw','queue','not_inuse','status','reachable','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callback'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xf1af,0xa5));var _0xff1a=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xf1af[_0x1c546c];return _0x2cc384;};'use strict';var util=require(_0xff1a('0x0'));var _=require(_0xff1a('0x1'));var moment=require(_0xff1a('0x2'));var logger=require(_0xff1a('0x3'))(_0xff1a('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xff1a('0x5');function getSeconds(_0x1fd280,_0x49bf0e){var _0x2901fc=moment(_0x1fd280)['milliseconds'](0x0);var _0x4ffa2a=moment(_0x49bf0e)[_0xff1a('0x6')](0x0);return _0x2901fc[_0xff1a('0x7')](_0x4ffa2a,_0xff1a('0x8'));}exports[_0xff1a('0x9')]=function(_0x34a473){return function(_0x1466d4){logger[_0xff1a('0xa')](_0x34a473,util['inspect'](_0x1466d4,{'showHidden':![],'depth':null}));};};exports[_0xff1a('0xb')]=function(_0x1a478e,_0x5788c7){logger[_0xff1a('0xc')](_0x1a478e,util['inspect'](_0x5788c7,{'showHidden':![],'depth':null}));};exports[_0xff1a('0xd')]=function(_0x1344fe,_0x57d1bf){logger[_0xff1a('0xa')](_0x1344fe,util['inspect'](_0x57d1bf,{'showHidden':![],'depth':null}));};exports[_0xff1a('0xe')]=function(_0x14bdc2){return function(_0x276a5d){logger[_0xff1a('0xc')](_0x14bdc2,util[_0xff1a('0xf')](_0x276a5d,{'showHidden':![],'depth':null}));};};exports[_0xff1a('0x10')]=function(_0x47e8e2,_0x47f724,_0x5c2cb7){return{'message':_0x47e8e2,'unlock':_0x47f724,'active':_0x5c2cb7};};exports[_0xff1a('0x11')]=function(_0x2a2449,_0x5e58a0,_0x301e94){if(!_['isUndefined'](_0x301e94)&&_0xff1a('0x12')===typeof _0x301e94&&!_['isEmpty'](_0x301e94)){if(!_[_0xff1a('0x13')](_0x5e58a0)&&_0xff1a('0x12')===typeof _0x5e58a0&&!_[_0xff1a('0x14')](_0x5e58a0)){return util[_0xff1a('0x15')](_0xff1a('0x16'),_0x5e58a0,_0x301e94);}return util[_0xff1a('0x15')](_0xff1a('0x16'),_0x301e94,_0x301e94);}if(!_[_0xff1a('0x13')](_0x2a2449)&&_0xff1a('0x12')===typeof _0x2a2449&&!_[_0xff1a('0x14')](_0x2a2449)){return _0x2a2449;}return _0xff1a('0x17');};exports[_0xff1a('0x18')]=function(_0x441ca6){if(_[_0xff1a('0x19')](_0x441ca6)){return![];}return _0x441ca6;};exports['addVariables']=function(_0x390db6,_0x5d8318,_0x36413d,_0x3f4e5d,_0x4d86a1,_0x505c7e){var _0xb26a1b={'XMD-QUEUE':_0x5d8318[_0xff1a('0x1a')]?_0x5d8318[_0xff1a('0x1a')]['name']:'','XMD-CALLERID':_0x3f4e5d,'XMD-CALLERID-PREVIEW':_0x505c7e?util['format'](_0xff1a('0x16'),_0x505c7e[_0xff1a('0x1b')],_0x505c7e[_0xff1a('0x1c')]):_0x3f4e5d,'XMD-DIALID':_0x4d86a1,'XMD-CONTACTID':_0x5d8318[_0xff1a('0x1d')],'XMD-CDRTYPE':_0xff1a('0x1e'),'CALLERID(all)':_0x3f4e5d,'XMD-VOICEQUEUEID':_0x5d8318[_0xff1a('0x1f')],'XMD-DIALCHANNEL':_0x36413d,'XMD-DIALTIMEOUT':_0x390db6['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xff1a('0x15')](_0xff1a('0x20'),_0x390db6[_0xff1a('0x21')]?'g':'',_['isEmpty'](_0x390db6[_0xff1a('0x22')])?'':_0xff1a('0x23')),'XMD-DIALURL':_0x390db6['dialPreviewUrl']||'','XMD-AGI':_0x390db6[_0xff1a('0x24')]?util['format'](_0xff1a('0x25'),ipAgi,_0x390db6['dialQueueProject']):_0xff1a('0x26'),'XMD-AGIAFTER':_0x390db6[_0xff1a('0x21')]?util[_0xff1a('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x390db6[_0xff1a('0x21')]):_0xff1a('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x505c7e?_0x505c7e[_0xff1a('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x505c7e?_0x505c7e[_0xff1a('0x28')]:'','XMD-DESTINATION':_0xff1a('0x29')};if(!_['isEmpty'](_0x390db6['monitor_format'])){_0xb26a1b[util[_0xff1a('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x390db6[_0xff1a('0x22')];_0xb26a1b[util[_0xff1a('0x15')]('%s',_0xff1a('0x2a'))]=_0x4d86a1;}if(_0x5d8318&&_0x5d8318[_0xff1a('0x2b')]){for(var _0x15e9d9 in _0x5d8318[_0xff1a('0x2b')]){if(_0x5d8318[_0xff1a('0x2b')][_0xff1a('0x2c')](_0x15e9d9)){if(!_[_0xff1a('0x19')](_0x5d8318[_0xff1a('0x2b')][_0x15e9d9])&&_0x15e9d9!=='id'&&_0x15e9d9!=='tags'&&_0x15e9d9!==_0xff1a('0x2d')&&_0x15e9d9!=='updatedAt'){_0xb26a1b[util[_0xff1a('0x15')]('%s%s',_0xff1a('0x2e'),_[_0xff1a('0x2f')](_0x15e9d9))]=_0x5d8318[_0xff1a('0x2b')][_0x15e9d9];}}}}return _0xb26a1b;};exports[_0xff1a('0x30')]=function(_0x301ffd){var _0x231c5d={};for(var _0x298f96 in _0x301ffd){if(_0x301ffd[_0xff1a('0x2c')](_0x298f96)){_0x231c5d[util[_0xff1a('0x15')]('%s',_[_0xff1a('0x31')](_0x298f96))]=_0x301ffd[_0x298f96];}}return{'variables':_0x231c5d};};exports['updateOriginated']=function(_0x6d01d8,_0x52c227){if(!_[_0xff1a('0x19')](_0x6d01d8)){if(_0x6d01d8['hasOwnProperty'](_0xff1a('0x32'))){if(_0x6d01d8[_0xff1a('0x32')]>0x0){_0x6d01d8['originated']-=0x1;}else{logger[_0xff1a('0xa')](_0xff1a('0x33'),_0x52c227);}}}else{logger[_0xff1a('0xa')](_0xff1a('0x34'),_0x52c227);}};exports[_0xff1a('0x35')]=function(_0x81dfa7){var _0x2f706b=moment()[_0xff1a('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x81dfa7[_0xff1a('0x36')]=0xd;_0x81dfa7['statedesc']=_0xff1a('0x37');_0x81dfa7[_0xff1a('0x38')]=_0x2f706b;_0x81dfa7['responsetime']=_0x2f706b;_0x81dfa7[_0xff1a('0x39')]=_0x2f706b;};exports[_0xff1a('0x3a')]=function(_0x4caef6,_0xa2d5b3,_0x494ea9){var _0x3ab165=moment()[_0xff1a('0x15')](_0xff1a('0x3b'));_0x4caef6[_0xff1a('0x36')]=_0xa2d5b3;_0x4caef6[_0xff1a('0x3c')]=_0x494ea9;_0x4caef6[_0xff1a('0x3d')]=_0x3ab165;_0x4caef6['ringtime']=getSeconds(_0x4caef6['responsetime'],_0x4caef6[_0xff1a('0x38')]);};exports['logLookAgent']=function(_0x2540e8,_0x23b861,_0x4c83db){_0x2540e8[_0xff1a('0x3e')]=_0x23b861;_0x2540e8[_0xff1a('0x3f')]=_0x4c83db;};exports[_0xff1a('0x40')]=function(_0x34630f,_0x1edd27,_0x193e51){var _0x2b2f7b=moment()['format'](_0xff1a('0x3b'));_0x34630f['state']=_0x1edd27;_0x34630f['statedesc']=_0x193e51;_0x34630f[_0xff1a('0x3d')]=_0x34630f[_0xff1a('0x3d')]?_0x34630f[_0xff1a('0x3d')]:_0x2b2f7b;_0x34630f[_0xff1a('0x39')]=_0x34630f[_0xff1a('0x39')]?_0x34630f[_0xff1a('0x39')]:_0x2b2f7b;_0x34630f[_0xff1a('0x41')]=getSeconds(_0x34630f[_0xff1a('0x3d')]||0x0,_0x34630f['starttime']||0x0);_0x34630f['talktime']=_0x34630f['answertime']?getSeconds(_0x34630f['endtime'],_0x34630f['answertime']):0x0;};exports[_0xff1a('0x42')]=function(_0x340b48){return _0x340b48===_0xff1a('0x43');};exports[_0xff1a('0x44')]=function(_0x44d644,_0xd1d2d5,_0x6e79fc,_0x2a072a,_0x2788db){var _0x3a13f7=_0x2a072a?_0xff1a('0x45'):_0x44d644[_0xff1a('0x1b')];_0x3a13f7=_0x2788db?_0xff1a('0x46'):_0x3a13f7;return{'actionid':_0x44d644[_0xff1a('0x47')],'action':'originate','channel':_0x44d644[_0xff1a('0x48')],'callerid':util[_0xff1a('0x15')](_0xff1a('0x16'),_0x3a13f7,_0x44d644[_0xff1a('0x1c')]),'Exten':_0xff1a('0x29'),'Context':'from-sip','Priority':'1','variable':_0x6e79fc,'timeout':(_0xd1d2d5[_0xff1a('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x44d644[_0xff1a('0x47')]};};exports[_0xff1a('0x4a')]=function(_0x1bb227){return _0x1bb227[_0xff1a('0x4b')]+_0x1bb227[_0xff1a('0x4c')]+_0x1bb227[_0xff1a('0x4d')]+_0x1bb227[_0xff1a('0x4e')]+_0x1bb227[_0xff1a('0x4f')];};exports[_0xff1a('0x50')]=function(_0x6d12a1){var _0x4185d2=_[_0xff1a('0x51')](_0x6d12a1);_0x4185d2[_0xff1a('0x36')]=0xf;_0x4185d2[_0xff1a('0x3c')]='Global';return _0x4185d2;};exports[_0xff1a('0x52')]=function(_0x1d18df,_0x57ee43,_0x24e5e2){var _0x3d9c5e={};_0x3d9c5e[_0x57ee43]=_0x1d18df[_0x57ee43];_0x3d9c5e[_0xff1a('0x53')]=![];_0x3d9c5e[_0xff1a('0x54')]=moment()['add'](_0x24e5e2,_0xff1a('0x55'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d9c5e[_0xff1a('0x1d')]=_0x1d18df[_0xff1a('0x1d')];_0x3d9c5e[_0xff1a('0x56')]=_0x1d18df[_0xff1a('0x56')];_0x3d9c5e[_0xff1a('0x1f')]=_0x1d18df[_0xff1a('0x1f')]||undefined;return _0x3d9c5e;};exports['decrementTalkink']=function(_0x7fe4b5,_0x11d029){if(!_['isNil'](_0x7fe4b5)){if(_0x7fe4b5[_0xff1a('0x57')]>0x0){_0x7fe4b5[_0xff1a('0x57')]-=0x1;}else{logger[_0xff1a('0xa')](_0x11d029,_0xff1a('0x58'));}}else{logger[_0xff1a('0xa')](_0x11d029,_0xff1a('0x59'));}};exports[_0xff1a('0x5a')]=function(_0x39aac7){if(_0x39aac7<=0x0){return!![];}return![];};exports[_0xff1a('0x5b')]=function(_0x2f9a37,_0x30a109,_0x1f4108){_0x2f9a37['lastevent']=_0x30a109;_0x2f9a37['name']=_0x2f9a37['queue'];_0x2f9a37[_0xff1a('0x5c')]=_0x2f9a37[_0xff1a('0x48')];_0x2f9a37[_0xff1a('0x5d')]='voice';if(_0x1f4108){_0x2f9a37['mandatoryDisposition']=_0x1f4108[_0xff1a('0x5e')];}return _0x2f9a37;};exports[_0xff1a('0x5f')]=function(_0x144398){var _0x4dcfe0={};_0x4dcfe0['queue']=_0x144398[_0xff1a('0x60')];_0x4dcfe0[_0xff1a('0x5c')]=_0x144398['channelAgent'];_0x4dcfe0[_0xff1a('0x47')]=_0x144398[_0xff1a('0x47')];return _0x4dcfe0;};exports['agentReadyId']=function(_0x35243b){var _0x18e395=[];for(var _0x3962fb in _0x35243b){if(_0x35243b['hasOwnProperty'](_0x3962fb)){if(!_[_0xff1a('0x19')](_0x35243b[_0x3962fb])&&_0x35243b[_0x3962fb][_0xff1a('0x36')]===_0xff1a('0x61')&&_0x35243b[_0x3962fb][_0xff1a('0x62')]===_0xff1a('0x63')){_0x18e395['push'](_0x35243b[_0x3962fb]['id']);}}}return _0x18e395;};exports['getDiff']=function(_0xd59e3a){var _0x539e4e=moment()[_0xff1a('0x6')](0x0);var _0x4fe8c9=moment(_0xd59e3a)[_0xff1a('0x6')](0x0);return _0x539e4e[_0xff1a('0x7')](_0x4fe8c9,_0xff1a('0x8'));};exports['createBody']=function(_0x11698e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x11698e[_0xff1a('0x1d')],'ListId':_0x11698e[_0xff1a('0x56')],'VoiceQueueId':_0x11698e[_0xff1a('0x1f')]||undefined,'CampaignId':_0x11698e['CampaignId']||undefined};};exports[_0xff1a('0x64')]=function(_0x2b7114){if(_0x2b7114===_0xff1a('0x47')||_0x2b7114===_0xff1a('0x65')||_0x2b7114==='queue'||_0x2b7114===_0xff1a('0x66')||_0x2b7114===_0xff1a('0x67')||_0x2b7114===_0xff1a('0x68')||_0x2b7114==='membername'||_0x2b7114===_0xff1a('0x48')||_0x2b7114===_0xff1a('0x1b')||_0x2b7114==='active'||_0x2b7114==='calleridnum'||_0x2b7114===_0xff1a('0x54')||_0x2b7114===_0xff1a('0x4b')||_0x2b7114===_0xff1a('0x4c')||_0x2b7114===_0xff1a('0x4d')||_0x2b7114===_0xff1a('0x69')||_0x2b7114===_0xff1a('0x6a')||_0x2b7114===_0xff1a('0x6b')||_0x2b7114===_0xff1a('0x6c')||_0x2b7114===_0xff1a('0x6d')||_0x2b7114===_0xff1a('0x1d')||_0x2b7114===_0xff1a('0x56')||_0x2b7114==='UserId'||_0x2b7114===_0xff1a('0x1f')||_0x2b7114==='sipcallid'||_0x2b7114===_0xff1a('0x6e')||_0x2b7114==='xmd-queue'||_0x2b7114===_0xff1a('0x6f')||_0x2b7114===_0xff1a('0x70')||_0x2b7114===_0xff1a('0x71')||_0x2b7114===_0xff1a('0x72')||_0x2b7114==='xmd-dialoptions'||_0x2b7114===_0xff1a('0x73')||_0x2b7114===_0xff1a('0x74')||_0x2b7114===_0xff1a('0x75')||_0x2b7114===_0xff1a('0x76')||_0x2b7114===_0xff1a('0x77')||_0x2b7114==='xmd-agiafter'||_0x2b7114===_0xff1a('0x78')||_0x2b7114===_0xff1a('0x79')||_0x2b7114===_0xff1a('0x7a')||_0x2b7114===_0xff1a('0x7b')||_0x2b7114===_0xff1a('0x7c')||_0x2b7114===_0xff1a('0x7d')||_0x2b7114===_0xff1a('0x7e')||_0x2b7114===_0xff1a('0x7f')||_0x2b7114==='rtpaudioqosrttbridged'||_0x2b7114===_0xff1a('0x79')||_0x2b7114==='rtpaudioqosbridged'||_0x2b7114===_0xff1a('0x7b')||_0x2b7114==='rtpaudioqosjitterbridged'||_0x2b7114===_0xff1a('0x7d')||_0x2b7114===_0xff1a('0x7e')||_0x2b7114==='rtpaudioqosrtt'||_0x2b7114===_0xff1a('0x80')||_0x2b7114===_0xff1a('0x81')||_0x2b7114===_0xff1a('0x82')||_0x2b7114===_0xff1a('0x36')||_0x2b7114===_0xff1a('0x3c')){return![];}return!![];};exports[_0xff1a('0x83')]=function(_0x1af30c,_0x34f810){var _0x57fe26,_0x366673,_0x5120db;if(_0x34f810<=0x0){_0x34f810=0x1;}_0x57fe26=new RegExp(_0xff1a('0x84')+_0x34f810+'}$');_0x366673=Math['pow'](0xa,_0x34f810-0x1);_0x5120db=Math['pow'](0xa,_0x34f810)-0x1;return util[_0xff1a('0x15')]('%s',_[_0xff1a('0x85')](_0x1af30c,_0x57fe26,_['random'](_0x366673,_0x5120db)));};exports[_0xff1a('0x86')]=function(_0x1ee359){var _0x920125=_0x1ee359['match'](/"(.*?)"/);return _0x920125?_0x920125[0x1]:_0x1ee359;};exports['extractCalleridNumber']=function(_0x501ceb){var _0x1ea02f=_0x501ceb[_0xff1a('0x87')](/<(.*?)>/);return _0x1ea02f?_0x1ea02f[0x1]:_0x501ceb;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index fbcc0bc..e7cd58f 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 _0xaa36=['queueadd','string','number','boolean','queueremove','queuepause','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x311572,_0x4b8a4e){var _0x24835c=function(_0x74291c){while(--_0x74291c){_0x311572['push'](_0x311572['shift']());}};_0x24835c(++_0x4b8a4e);}(_0xaa36,0x1b9));var _0x6aa3=function(_0x4557d0,_0x4ff090){_0x4557d0=_0x4557d0-0x0;var _0x40bfb1=_0xaa36[_0x4557d0];return _0x40bfb1;};'use strict';exports[_0x6aa3('0x0')]={'queue':{'type':_0x6aa3('0x1'),'required':!![]},'interface':{'type':_0x6aa3('0x1'),'required':!![]},'membername':{'type':_0x6aa3('0x1'),'required':!![]},'penalty':{'type':_0x6aa3('0x2'),'required':![]},'paused':{'type':_0x6aa3('0x3'),'required':![]}};exports[_0x6aa3('0x4')]={'queue':{'type':_0x6aa3('0x1'),'required':!![]},'interface':{'type':_0x6aa3('0x1'),'required':!![]}};exports[_0x6aa3('0x5')]={'interface':{'type':_0x6aa3('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x6aa3('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x6aa3('0x1'),'required':![]}};exports[_0x6aa3('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x6aa3('0x1')},'format':{'type':_0x6aa3('0x1')},'mixmonitorid':{'type':_0x6aa3('0x1')}};exports[_0x6aa3('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x6aa3('0x8')]={'uniqueid':{'type':_0x6aa3('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x6aa3('0x1')}}; \ No newline at end of file +var _0x1c6e=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup'];(function(_0x4028a4,_0x10d72b){var _0x1b3cd7=function(_0x2e484e){while(--_0x2e484e){_0x4028a4['push'](_0x4028a4['shift']());}};_0x1b3cd7(++_0x10d72b);}(_0x1c6e,0x1c3));var _0xe1c6=function(_0x1b5a05,_0x2c80de){_0x1b5a05=_0x1b5a05-0x0;var _0x347931=_0x1c6e[_0x1b5a05];return _0x347931;};'use strict';exports[_0xe1c6('0x0')]={'queue':{'type':_0xe1c6('0x1'),'required':!![]},'interface':{'type':_0xe1c6('0x1'),'required':!![]},'membername':{'type':_0xe1c6('0x1'),'required':!![]},'penalty':{'type':_0xe1c6('0x2'),'required':![]},'paused':{'type':_0xe1c6('0x3'),'required':![]}};exports[_0xe1c6('0x4')]={'queue':{'type':_0xe1c6('0x1'),'required':!![]},'interface':{'type':_0xe1c6('0x1'),'required':!![]}};exports[_0xe1c6('0x5')]={'interface':{'type':_0xe1c6('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xe1c6('0x1'),'required':![]}};exports[_0xe1c6('0x6')]={'module':{'type':'string','required':![]}};exports[_0xe1c6('0x7')]={'uniqueid':{'type':_0xe1c6('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xe1c6('0x1'),'required':!![]},'filename':{'type':_0xe1c6('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xe1c6('0x1')}};exports[_0xe1c6('0x8')]={'uniqueid':{'type':_0xe1c6('0x1'),'required':!![]}};exports[_0xe1c6('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xe1c6('0x1'),'required':!![]},'context':{'type':_0xe1c6('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index cdbd957..e67bf70 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 _0xac5a=['salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','answered','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initVoiceExtensions','voiceExtensions','initFaxAccounts','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','channels','outboundChannels','settings','zendeskAccounts'];(function(_0x438fca,_0x169e8d){var _0x351253=function(_0x2c8396){while(--_0x2c8396){_0x438fca['push'](_0x438fca['shift']());}};_0x351253(++_0x169e8d);}(_0xac5a,0xb2));var _0xaac5=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0xac5a[_0x553150];return _0x18193d;};'use strict';var BPromise=require(_0xaac5('0x0'));var util=require(_0xaac5('0x1'));var _=require(_0xaac5('0x2'));var moment=require(_0xaac5('0x3'));var Agent=require('../model/agent');var Telephone=require(_0xaac5('0x4'));var Trunk=require(_0xaac5('0x5'));var VoiceQueue=require(_0xaac5('0x6'));var Trigger=require(_0xaac5('0x7'));var Template=require(_0xaac5('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xaac5('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xaac5('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xaac5('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xaac5('0xc'));var VtigerAccount=require(_0xaac5('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xaac5('0xe'));var FreshsalesAccount=require(_0xaac5('0xf'));var FaxAccount=require(_0xaac5('0x10'));var Realtime=function(){this[_0xaac5('0x11')]={};this[_0xaac5('0x12')]={};this[_0xaac5('0x13')]={};this[_0xaac5('0x14')]={};this[_0xaac5('0x15')]={};this[_0xaac5('0x16')]={};this[_0xaac5('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xaac5('0x18')]={};this['queueChannels']={};this[_0xaac5('0x19')]={};this['timers']={};this[_0xaac5('0x1a')]={};this[_0xaac5('0x1b')]={};this[_0xaac5('0x1c')]={};this[_0xaac5('0x1d')]={};this[_0xaac5('0x1e')]={};this['zohoAccounts']={};this[_0xaac5('0x1f')]={};this[_0xaac5('0x20')]={};this[_0xaac5('0x21')]={};this[_0xaac5('0x22')]={};this[_0xaac5('0x23')]={};this[_0xaac5('0x24')]={};};function freeIsNotKey(_0x14f57a,_0x42ccf9,_0x385cf9){var _0x2556e8=_[_0xaac5('0x25')](_0x14f57a,function(_0x2575b8,_0x416ff5){return _0x2575b8[_0x385cf9];});for(var _0x459733 in _0x42ccf9){if(_0x42ccf9[_0xaac5('0x26')](_0x459733)){if(!_0x2556e8[_0x459733]){delete _0x42ccf9[_0x459733];}}}}function freeIsNotKeySip(_0x4ec9af,_0x525f88){var _0x343c0b=_[_0xaac5('0x25')](_0x4ec9af,function(_0x159976,_0x550057){return util[_0xaac5('0x27')](_0xaac5('0x28'),_0x159976[_0xaac5('0x29')]);});for(var _0x1cd8ed in _0x525f88){if(_0x525f88[_0xaac5('0x26')](_0x1cd8ed)){if(!_0x343c0b[_0x1cd8ed]){delete _0x525f88[_0x1cd8ed];}}}}function freeIsNotKeyAgent(_0x3bffaf,_0x57bbc2){var _0xce1378=_[_0xaac5('0x25')](_0x3bffaf,function(_0x5733a1,_0x47056c){var _0x22e43c=_[_0xaac5('0x2a')](_0x5733a1[_0xaac5('0x2b')])?util[_0xaac5('0x27')]('SIP/%s',_0x5733a1[_0xaac5('0x29')]):_0x5733a1['interface'];return _0x22e43c;});for(var _0x39c5a8 in _0x57bbc2){if(_0x57bbc2['hasOwnProperty'](_0x39c5a8)){if(!_0xce1378[_0x39c5a8]){delete _0x57bbc2[_0x39c5a8];}}}}function clearVoiceCallReports(_0x444968){_0x444968['total']=0x0;_0x444968['answered']=0x0;_0x444968[_0xaac5('0x2c')]=0x0;_0x444968['sumDuration']=0x0;_0x444968[_0xaac5('0x2d')]=0x0;}function clearCampaigns(_0x109144){if(!_[_0xaac5('0x2e')](_0x109144)){for(var _0x498354 in _0x109144){if(_0x109144[_0xaac5('0x26')](_0x498354)){_0x109144[_0x498354][_0xaac5('0x2f')]=0x0;_0x109144[_0x498354][_0xaac5('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4b5759){if(!_[_0xaac5('0x2e')](_0x4b5759)){for(var _0x48504e in _0x4b5759){if(_0x4b5759[_0xaac5('0x26')](_0x48504e)){_0x4b5759[_0x48504e][_0xaac5('0x31')]=0x0;_0x4b5759[_0x48504e]['answered']=0x0;_0x4b5759[_0x48504e]['unmanaged']=0x0;_0x4b5759[_0x48504e]['abandoned']=0x0;_0x4b5759[_0x48504e][_0xaac5('0x2c')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x32')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x2d')]=0x0;_0x4b5759[_0x48504e]['outboundAnswerAgiCallsDay']=0x0;_0x4b5759[_0x48504e][_0xaac5('0x33')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x34')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x35')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x36')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x37')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x38')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x39')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x3a')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x3b')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x3c')]=0x0;_0x4b5759[_0x48504e][_0xaac5('0x3d')]=0x0;_0x4b5759[_0x48504e]['outboundAnswerAgiCallsDay']=0x0;_0x4b5759[_0x48504e][_0xaac5('0x3e')]=0x0;_0x4b5759[_0x48504e]['queueStatusComplete']=!![];}}}}Realtime[_0xaac5('0x3f')][_0xaac5('0x40')]=function(_0x5447a5,_0x3970fa){for(var _0x261e64 in _0x3970fa){if(_0x5447a5[_0xaac5('0x26')](_0x261e64)){_0x5447a5[_0x261e64]=_0x3970fa[_0x261e64];}}};Realtime['prototype'][_0xaac5('0x41')]=function(){var _0x4360b6=this;return function(_0x370037){if(_0x370037){freeIsNotKeyAgent(_0x370037,_0x4360b6[_0xaac5('0x11')]);for(var _0x2a7333=0x0,_0x8323c7={},_0xf05036={};_0x2a7333<_0x370037[_0xaac5('0x42')];_0x2a7333+=0x1){_0x8323c7=_0x370037[_0x2a7333];var _0x2e0fac=_['isNil'](_0x8323c7['interface'])?util[_0xaac5('0x27')]('SIP/%s',_0x8323c7['name']):_0x8323c7[_0xaac5('0x2b')];if(_[_0xaac5('0x43')](_0x4360b6[_0xaac5('0x11')][_0x2e0fac])){_0x4360b6[_0xaac5('0x11')][_0x2e0fac]=new Agent(_0x8323c7);}else{_0x4360b6[_0xaac5('0x40')](_0x4360b6[_0xaac5('0x11')][_0x2e0fac],_0x8323c7);}}}return _0x4360b6['agents'];};};Realtime['prototype'][_0xaac5('0x44')]=function(){var _0x2b0247=this;return function(_0x608e2f){if(_0x608e2f){freeIsNotKeySip(_0x608e2f,_0x2b0247[_0xaac5('0x12')]);for(var _0x51ae58=0x0,_0x4b889d={},_0x253365={};_0x51ae58<_0x608e2f[_0xaac5('0x42')];_0x51ae58+=0x1){_0x4b889d=_0x608e2f[_0x51ae58];if(_[_0xaac5('0x43')](_0x2b0247[_0xaac5('0x12')][util['format']('SIP/%s',_0x4b889d[_0xaac5('0x29')])])){_0x2b0247[_0xaac5('0x12')][util[_0xaac5('0x27')](_0xaac5('0x28'),_0x4b889d[_0xaac5('0x29')])]=new Telephone(_0x4b889d);}else{_0x2b0247[_0xaac5('0x40')](_0x2b0247['telephones'][util['format']('SIP/%s',_0x4b889d[_0xaac5('0x29')])],_0x4b889d);}}}return _0x2b0247[_0xaac5('0x12')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x45')]=function(){var _0x3a53b0=this;return function(_0x166f74){if(_0x166f74){freeIsNotKeySip(_0x166f74,_0x3a53b0['trunks']);for(var _0x2e7f32=0x0,_0x16511a={},_0x1d1797={};_0x2e7f32<_0x166f74[_0xaac5('0x42')];_0x2e7f32+=0x1){_0x16511a=_0x166f74[_0x2e7f32];if(_[_0xaac5('0x43')](_0x3a53b0[_0xaac5('0x13')][util[_0xaac5('0x27')](_0xaac5('0x28'),_0x16511a['name'])])){_0x3a53b0[_0xaac5('0x13')][util['format'](_0xaac5('0x28'),_0x16511a[_0xaac5('0x29')])]=new Trunk(_0x16511a);}else{_0x3a53b0[_0xaac5('0x40')](_0x3a53b0['trunks'][util[_0xaac5('0x27')](_0xaac5('0x28'),_0x16511a[_0xaac5('0x29')])],_0x16511a);}}}return _0x3a53b0[_0xaac5('0x13')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x46')]=function(){var _0x231836=this;return function(_0x9577c8){if(_0x9577c8){freeIsNotKey(_0x9577c8,_0x231836['voiceQueues'],'name');for(var _0x2edaef=0x0,_0x4d23f9={},_0x4242a={};_0x2edaef<_0x9577c8[_0xaac5('0x42')];_0x2edaef+=0x1){_0x4d23f9=_0x9577c8[_0x2edaef];if(_[_0xaac5('0x43')](_0x231836[_0xaac5('0x14')][_0x4d23f9[_0xaac5('0x29')]])){_0x231836['voiceQueues'][_0x4d23f9[_0xaac5('0x29')]]=new VoiceQueue(_0x4d23f9);}else{_0x231836[_0xaac5('0x40')](_0x231836[_0xaac5('0x14')][_0x4d23f9['name']],_0x4d23f9);}}}return _0x231836[_0xaac5('0x14')];};};Realtime['prototype'][_0xaac5('0x47')]=function(){var _0x53ba13=this;return function(_0x40f2ea){if(_0x40f2ea){freeIsNotKey(_0x40f2ea,_0x53ba13[_0xaac5('0x15')],'id');for(var _0x29536a=0x0,_0x43bbe8={},_0x466894={};_0x29536a<_0x40f2ea[_0xaac5('0x42')];_0x29536a+=0x1){_0x43bbe8=_0x40f2ea[_0x29536a];if(_[_0xaac5('0x43')](_0x53ba13[_0xaac5('0x15')][_0x43bbe8['id']])){_0x53ba13[_0xaac5('0x15')][_0x43bbe8['id']]=new Trigger(_0x43bbe8);}else{_0x53ba13[_0xaac5('0x40')](_0x53ba13[_0xaac5('0x15')][_0x43bbe8['id']],_0x43bbe8);}}}return _0x53ba13[_0xaac5('0x15')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x48')]=function(){var _0x21953a=this;return function(_0x310578){if(_0x310578){freeIsNotKey(_0x310578,_0x21953a[_0xaac5('0x17')],'id');for(var _0x42089f=0x0,_0x2ff8a8={},_0x101b35={};_0x42089f<_0x310578[_0xaac5('0x42')];_0x42089f+=0x1){_0x2ff8a8=_0x310578[_0x42089f];if(_[_0xaac5('0x43')](_0x21953a[_0xaac5('0x17')][_0x2ff8a8['id']])){_0x21953a[_0xaac5('0x17')][_0x2ff8a8['id']]=new Template(_0x2ff8a8);}else{_0x21953a[_0xaac5('0x40')](_0x21953a[_0xaac5('0x17')][_0x2ff8a8['id']],_0x2ff8a8);}}}return _0x21953a[_0xaac5('0x17')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x49')]=function(){var _0x343fb2=this;return function(_0x46962c){if(_0x46962c){freeIsNotKey(_0x46962c,_0x343fb2[_0xaac5('0x1b')],'id');for(var _0x4632bd=0x0,_0x35fa01={},_0x4b4419={};_0x4632bd<_0x46962c[_0xaac5('0x42')];_0x4632bd+=0x1){_0x35fa01=_0x46962c[_0x4632bd];if(_[_0xaac5('0x43')](_0x343fb2[_0xaac5('0x1b')][_0x35fa01['id']])){_0x343fb2[_0xaac5('0x1b')][_0x35fa01['id']]=new ZendeskAccount(_0x35fa01);}else{_0x343fb2[_0xaac5('0x40')](_0x343fb2[_0xaac5('0x1b')][_0x35fa01['id']],_0x35fa01);}}}return _0x343fb2[_0xaac5('0x1b')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x4a')]=function(){var _0x40f161=this;return function(_0x30520c){if(_0x30520c){freeIsNotKey(_0x30520c,_0x40f161[_0xaac5('0x1c')],'id');for(var _0x4bb5bb=0x0,_0x53d41e={},_0x1a10de={};_0x4bb5bb<_0x30520c['length'];_0x4bb5bb+=0x1){_0x53d41e=_0x30520c[_0x4bb5bb];if(_[_0xaac5('0x43')](_0x40f161[_0xaac5('0x1c')][_0x53d41e['id']])){_0x40f161[_0xaac5('0x1c')][_0x53d41e['id']]=new SalesforceAccount(_0x53d41e);}else{_0x40f161[_0xaac5('0x40')](_0x40f161['salesforceAccounts'][_0x53d41e['id']],_0x53d41e);}}}return _0x40f161[_0xaac5('0x1c')];};};Realtime['prototype'][_0xaac5('0x4b')]=function(){var _0x19848b=this;return function(_0x4e8af0){if(_0x4e8af0){freeIsNotKey(_0x4e8af0,_0x19848b[_0xaac5('0x1e')],'id');for(var _0x5b8fc3=0x0,_0x3f3752={},_0x26ef6e={};_0x5b8fc3<_0x4e8af0['length'];_0x5b8fc3+=0x1){_0x3f3752=_0x4e8af0[_0x5b8fc3];if(_['isUndefined'](_0x19848b[_0xaac5('0x1e')][_0x3f3752['id']])){_0x19848b[_0xaac5('0x1e')][_0x3f3752['id']]=new FreshdeskAccount(_0x3f3752);}else{_0x19848b['mergeFromDatabase'](_0x19848b[_0xaac5('0x1e')][_0x3f3752['id']],_0x3f3752);}}}return _0x19848b[_0xaac5('0x1e')];};};Realtime['prototype'][_0xaac5('0x4c')]=function(){var _0x47b094=this;return function(_0x41ccdd){if(_0x41ccdd){freeIsNotKey(_0x41ccdd,_0x47b094[_0xaac5('0x4d')],'id');for(var _0x4b4c03=0x0,_0xd1dee4={},_0x9416de={};_0x4b4c03<_0x41ccdd[_0xaac5('0x42')];_0x4b4c03+=0x1){_0xd1dee4=_0x41ccdd[_0x4b4c03];if(_[_0xaac5('0x43')](_0x47b094['zohoAccounts'][_0xd1dee4['id']])){_0x47b094['zohoAccounts'][_0xd1dee4['id']]=new ZohoAccount(_0xd1dee4);}else{_0x47b094[_0xaac5('0x40')](_0x47b094[_0xaac5('0x4d')][_0xd1dee4['id']],_0xd1dee4);}}}return _0x47b094[_0xaac5('0x4d')];};};Realtime[_0xaac5('0x3f')]['initDeskAccounts']=function(){var _0x64fa28=this;return function(_0x3e34d7){if(_0x3e34d7){freeIsNotKey(_0x3e34d7,_0x64fa28['deskAccounts'],'id');for(var _0x1dcda8=0x0,_0x444b1c={},_0x287b7a={};_0x1dcda8<_0x3e34d7['length'];_0x1dcda8+=0x1){_0x444b1c=_0x3e34d7[_0x1dcda8];if(_[_0xaac5('0x43')](_0x64fa28[_0xaac5('0x1f')][_0x444b1c['id']])){_0x64fa28[_0xaac5('0x1f')][_0x444b1c['id']]=new DeskAccount(_0x444b1c);}else{_0x64fa28[_0xaac5('0x40')](_0x64fa28['deskAccounts'][_0x444b1c['id']],_0x444b1c);}}}return _0x64fa28['deskAccounts'];};};Realtime[_0xaac5('0x3f')]['initSugarcrmAccounts']=function(){var _0x576aa5=this;return function(_0x251982){if(_0x251982){freeIsNotKey(_0x251982,_0x576aa5[_0xaac5('0x1d')],'id');for(var _0xa201a1=0x0,_0xca9a07={},_0xbe9450={};_0xa201a1<_0x251982[_0xaac5('0x42')];_0xa201a1+=0x1){_0xca9a07=_0x251982[_0xa201a1];if(_['isUndefined'](_0x576aa5[_0xaac5('0x1d')][_0xca9a07['id']])){_0x576aa5[_0xaac5('0x1d')][_0xca9a07['id']]=new SugarcrmAccount(_0xca9a07);}else{_0x576aa5[_0xaac5('0x40')](_0x576aa5[_0xaac5('0x1d')][_0xca9a07['id']],_0xca9a07);}}}return _0x576aa5[_0xaac5('0x1d')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x4e')]=function(){var _0x529286=this;return function(_0x28d881){if(_0x28d881){freeIsNotKey(_0x28d881,_0x529286[_0xaac5('0x20')],'id');for(var _0x29fc67=0x0,_0x24dda6={},_0x727785={};_0x29fc67<_0x28d881['length'];_0x29fc67+=0x1){_0x24dda6=_0x28d881[_0x29fc67];if(_[_0xaac5('0x43')](_0x529286[_0xaac5('0x20')][_0x24dda6['id']])){_0x529286['vtigerAccounts'][_0x24dda6['id']]=new VtigerAccount(_0x24dda6);}else{_0x529286[_0xaac5('0x40')](_0x529286['vtigerAccounts'][_0x24dda6['id']],_0x24dda6);}}}return _0x529286[_0xaac5('0x20')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x4f')]=function(){var _0x39a39a=this;return function(_0x33eba8){if(_0x33eba8){freeIsNotKey(_0x33eba8,_0x39a39a['servicenowAccounts'],'id');for(var _0x393ea7=0x0,_0xb127bf={},_0x985046={};_0x393ea7<_0x33eba8[_0xaac5('0x42')];_0x393ea7+=0x1){_0xb127bf=_0x33eba8[_0x393ea7];if(_['isUndefined'](_0x39a39a[_0xaac5('0x21')][_0xb127bf['id']])){_0x39a39a[_0xaac5('0x21')][_0xb127bf['id']]=new ServicenowAccount(_0xb127bf);}else{_0x39a39a[_0xaac5('0x40')](_0x39a39a[_0xaac5('0x21')][_0xb127bf['id']],_0xb127bf);}}}return _0x39a39a[_0xaac5('0x21')];};};Realtime['prototype'][_0xaac5('0x50')]=function(){var _0xa36113=this;return function(_0xec9a1){if(_0xec9a1){freeIsNotKey(_0xec9a1,_0xa36113['dynamics365Accounts'],'id');for(var _0x746738=0x0,_0x1b8ae9={},_0x2dc88b={};_0x746738<_0xec9a1[_0xaac5('0x42')];_0x746738+=0x1){_0x1b8ae9=_0xec9a1[_0x746738];if(_['isUndefined'](_0xa36113['dynamics365Accounts'][_0x1b8ae9['id']])){_0xa36113[_0xaac5('0x22')][_0x1b8ae9['id']]=new Dynamics365Account(_0x1b8ae9);}else{_0xa36113['mergeFromDatabase'](_0xa36113[_0xaac5('0x22')][_0x1b8ae9['id']],_0x1b8ae9);}}}return _0xa36113[_0xaac5('0x22')];};};Realtime[_0xaac5('0x3f')]['initFreshsalesAccounts']=function(){var _0x21bb9d=this;return function(_0x1376b4){if(_0x1376b4){freeIsNotKey(_0x1376b4,_0x21bb9d[_0xaac5('0x23')],'id');for(var _0x5c9023=0x0,_0x2e781c={},_0x820d55={};_0x5c9023<_0x1376b4[_0xaac5('0x42')];_0x5c9023+=0x1){_0x2e781c=_0x1376b4[_0x5c9023];if(_[_0xaac5('0x43')](_0x21bb9d['freshsalesAccounts'][_0x2e781c['id']])){_0x21bb9d['freshsalesAccounts'][_0x2e781c['id']]=new FreshsalesAccount(_0x2e781c);}else{_0x21bb9d[_0xaac5('0x40')](_0x21bb9d[_0xaac5('0x23')][_0x2e781c['id']],_0x2e781c);}}}return _0x21bb9d[_0xaac5('0x23')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x51')]=function(){var _0x425223=this;return function(_0x1c6203){for(var _0x57d89=0x0;_0x57d89<_0x1c6203[_0xaac5('0x42')];_0x57d89+=0x1){_[_0xaac5('0x52')](_0x425223[_0xaac5('0x14')][_0x1c6203[_0x57d89][_0xaac5('0x29')]],_0x1c6203[_0x57d89]);}return _0x425223['voiceQueues'];};};Realtime[_0xaac5('0x3f')]['initVoiceQueueReports']=function(){var _0x24640d=this;return function(_0x2376a2){clearVoiceQueues(_0x24640d[_0xaac5('0x14')]);if(_0x2376a2){_0x2376a2=_[_0xaac5('0x53')](_0x2376a2,'uniqueid');for(var _0x5f55d2 in _0x2376a2){if(_0x2376a2['hasOwnProperty'](_0x5f55d2)){var _0x5cb6eb={};for(var _0x564b0e=0x0;_0x564b0e<_0x2376a2[_0x5f55d2]['length'];_0x564b0e+=0x1){var _0x5f3d47=_0x2376a2[_0x5f55d2][_0x564b0e]['queue'];if(_0x24640d[_0xaac5('0x14')][_0x5f3d47]){if(_0x2376a2[_0x5f55d2][_0x564b0e]['queuecallerexit']){_0x24640d[_0xaac5('0x14')][_0x5f3d47]['unmanaged']+=0x1;}if(_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x54')]){_0x24640d['voiceQueues'][_0x5f3d47][_0xaac5('0x55')]+=0x1;}_0x24640d[_0xaac5('0x14')][_0x5f3d47][_0xaac5('0x2c')]+=moment(_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x56')])[_0xaac5('0x57')](moment(_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x58')]),'seconds')||0x0;if(_0x564b0e===_0x2376a2[_0x5f55d2]['length']-0x1){_0x24640d[_0xaac5('0x14')][_0x5f3d47]['sumDuration']+=moment(_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x59')]||_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x5a')]||_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x5b')])[_0xaac5('0x57')](moment(_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x58')]),_0xaac5('0x5c'))||0x0;_0x24640d[_0xaac5('0x14')][_0x5f3d47]['total']+=0x1;if(_0x2376a2[_0x5f55d2][_0x564b0e]['queuecallercomplete']){_0x24640d[_0xaac5('0x14')][_0x5f3d47][_0xaac5('0x5d')]+=0x1;_0x24640d[_0xaac5('0x14')][_0x5f3d47][_0xaac5('0x2d')]+=moment(_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x59')])['diff'](moment(_0x2376a2[_0x5f55d2][_0x564b0e][_0xaac5('0x56')]),_0xaac5('0x5c'))||0x0;}}else{_0x24640d[_0xaac5('0x14')][_0x5f3d47][_0xaac5('0x32')]+=_0x24640d['voiceQueues'][_0x5f3d47]['sumHoldTime']||0x0;}}}}}}return _0x24640d[_0xaac5('0x14')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x5e')]=function(){var _0x36395c=this;return function(_0x52b136){clearVoiceCallReports(_0x36395c['outbound']);if(_0x52b136){for(var _0x11aa10=0x0;_0x11aa10<_0x52b136[_0xaac5('0x42')];_0x11aa10+=0x1){_0x36395c[_0xaac5('0x5f')][_0xaac5('0x31')]+=0x1;_0x36395c[_0xaac5('0x5f')][_0xaac5('0x32')]+=_0x52b136[_0x11aa10][_0xaac5('0x60')];if(_0x52b136[_0x11aa10][_0xaac5('0x61')]===_0xaac5('0x62')){_0x36395c[_0xaac5('0x5f')][_0xaac5('0x5d')]+=0x1;_0x36395c[_0xaac5('0x5f')]['sumHoldTime']+=_0x52b136[_0x11aa10][_0xaac5('0x60')]-_0x52b136[_0x11aa10][_0xaac5('0x63')]||0x0;_0x36395c[_0xaac5('0x5f')][_0xaac5('0x2d')]+=_0x52b136[_0x11aa10][_0xaac5('0x63')];}}}return _0x36395c[_0xaac5('0x5f')];};};Realtime[_0xaac5('0x3f')]['initCampaigns']=function(){var _0x58db23=this;return function(_0x197b0a){if(_0x197b0a){freeIsNotKey(_0x197b0a,_0x58db23[_0xaac5('0x16')],'name');for(var _0x21f3bf=0x0,_0x5de282={};_0x21f3bf<_0x197b0a[_0xaac5('0x42')];_0x21f3bf+=0x1){_0x5de282=_0x197b0a[_0x21f3bf];if(_[_0xaac5('0x43')](_0x58db23[_0xaac5('0x16')][_0x5de282[_0xaac5('0x29')]])){_0x58db23[_0xaac5('0x16')][_0x5de282[_0xaac5('0x29')]]=new Campaign(_0x5de282);}else{_0x58db23[_0xaac5('0x40')](_0x58db23['campaigns'][_0x5de282['name']],_0x5de282);_0x58db23['campaigns'][_0x5de282['name']]['dialQueueProject']=_0x5de282['SquareProject']?_0x5de282['SquareProject']['name']:undefined;}}}return _0x58db23[_0xaac5('0x16')];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x64')]=function(){var _0x4685d4=this;return function(_0x54b77a){if(_0x54b77a){freeIsNotKey(_0x54b77a,_0x4685d4[_0xaac5('0x65')],'id');for(var _0x381920=0x0,_0x13e653={};_0x381920<_0x54b77a['length'];_0x381920+=0x1){_0x13e653=_0x54b77a[_0x381920];if(_[_0xaac5('0x43')](_0x4685d4[_0xaac5('0x65')][_0x13e653['id']])){_0x4685d4['voiceExtensions'][_0x13e653['id']]=new VoiceExtension(_0x13e653);}else{_0x4685d4[_0xaac5('0x40')](_0x4685d4['voiceExtensions'][_0x13e653['id']],_0x13e653);}}}return _0x4685d4[_0xaac5('0x65')];};};Realtime[_0xaac5('0x3f')]['initCampaignHopperHistory']=function(){var _0x4b406e=this;return function(_0x3b17eb){clearCampaigns(_0x4b406e['campaigns']);for(var _0x29c3a3=0x0;_0x29c3a3<_0x3b17eb['length'];_0x29c3a3+=0x1){_[_0xaac5('0x52')](_0x4b406e[_0xaac5('0x16')][_0x3b17eb[_0x29c3a3][_0xaac5('0x29')]],_0x3b17eb[_0x29c3a3]);}return _0x4b406e['campaigns'];};};Realtime[_0xaac5('0x3f')][_0xaac5('0x66')]=function(){var _0xd7fc55=this;return function(_0x45f752){if(_0x45f752){freeIsNotKey(_0x45f752,_0xd7fc55[_0xaac5('0x24')],'id');for(var _0x562f9b=0x0,_0x416e44={},_0x26e3d0={};_0x562f9b<_0x45f752['length'];_0x562f9b+=0x1){_0x416e44=_0x45f752[_0x562f9b];if(_[_0xaac5('0x43')](_0xd7fc55[_0xaac5('0x24')][_0x416e44['id']])){_0xd7fc55[_0xaac5('0x24')][_0x416e44['id']]=new FaxAccount(_0x416e44);}else{_0xd7fc55['mergeFromDatabase'](_0xd7fc55['faxAccounts'][_0x416e44['id']],_0x416e44);}}}return _0xd7fc55[_0xaac5('0x24')];};};module['exports']=Realtime; \ No newline at end of file +var _0xbf3d=['sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','initTrunks','voiceQueues','initTriggers','triggers','initTemplates','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','unmanaged','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','duration','billableseconds','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','voiceExtensions','outboundChannels','settings','salesforceAccounts'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbf3d,0x186));var _0xdbf3=function(_0x2eb204,_0x425c65){_0x2eb204=_0x2eb204-0x0;var _0x24a236=_0xbf3d[_0x2eb204];return _0x24a236;};'use strict';var BPromise=require(_0xdbf3('0x0'));var util=require(_0xdbf3('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0xdbf3('0x2'));var VoiceQueue=require(_0xdbf3('0x3'));var Trigger=require(_0xdbf3('0x4'));var Template=require(_0xdbf3('0x5'));var Campaign=require(_0xdbf3('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xdbf3('0x7'));var SalesforceAccount=require(_0xdbf3('0x8'));var FreshdeskAccount=require(_0xdbf3('0x9'));var SugarcrmAccount=require(_0xdbf3('0xa'));var ZohoAccount=require(_0xdbf3('0xb'));var DeskAccount=require(_0xdbf3('0xc'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xdbf3('0xd'));var FreshsalesAccount=require(_0xdbf3('0xe'));var FaxAccount=require(_0xdbf3('0xf'));var Realtime=function(){this[_0xdbf3('0x10')]={};this[_0xdbf3('0x11')]={};this[_0xdbf3('0x12')]={};this['voiceQueues']={};this['triggers']={};this[_0xdbf3('0x13')]={};this[_0xdbf3('0x14')]={};this[_0xdbf3('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xdbf3('0x16')]={};this['channels']={};this['queueChannels']={};this[_0xdbf3('0x17')]={};this['timers']={};this[_0xdbf3('0x18')]={};this['zendeskAccounts']={};this[_0xdbf3('0x19')]={};this[_0xdbf3('0x1a')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0xdbf3('0x1b')]={};this[_0xdbf3('0x1c')]={};this[_0xdbf3('0x1d')]={};this[_0xdbf3('0x1e')]={};this['freshsalesAccounts']={};this[_0xdbf3('0x1f')]={};};function freeIsNotKey(_0x151fe3,_0x3f7332,_0x3c091b){var _0x57fbb5=_[_0xdbf3('0x20')](_0x151fe3,function(_0x553cad,_0x5d004d){return _0x553cad[_0x3c091b];});for(var _0x27fd0e in _0x3f7332){if(_0x3f7332['hasOwnProperty'](_0x27fd0e)){if(!_0x57fbb5[_0x27fd0e]){delete _0x3f7332[_0x27fd0e];}}}}function freeIsNotKeySip(_0x42e084,_0x598358){var _0x81d14e=_['mapKeys'](_0x42e084,function(_0x16c550,_0xc2df74){return util[_0xdbf3('0x21')](_0xdbf3('0x22'),_0x16c550[_0xdbf3('0x23')]);});for(var _0x2b4382 in _0x598358){if(_0x598358[_0xdbf3('0x24')](_0x2b4382)){if(!_0x81d14e[_0x2b4382]){delete _0x598358[_0x2b4382];}}}}function freeIsNotKeyAgent(_0xaa18eb,_0xf17b93){var _0x255e08=_[_0xdbf3('0x20')](_0xaa18eb,function(_0x423747,_0x407e1d){var _0x59e5d1=_[_0xdbf3('0x25')](_0x423747[_0xdbf3('0x26')])?util[_0xdbf3('0x21')](_0xdbf3('0x22'),_0x423747['name']):_0x423747[_0xdbf3('0x26')];return _0x59e5d1;});for(var _0x51f636 in _0xf17b93){if(_0xf17b93[_0xdbf3('0x24')](_0x51f636)){if(!_0x255e08[_0x51f636]){delete _0xf17b93[_0x51f636];}}}}function clearVoiceCallReports(_0x165ea5){_0x165ea5[_0xdbf3('0x27')]=0x0;_0x165ea5[_0xdbf3('0x28')]=0x0;_0x165ea5[_0xdbf3('0x29')]=0x0;_0x165ea5[_0xdbf3('0x2a')]=0x0;_0x165ea5[_0xdbf3('0x2b')]=0x0;}function clearCampaigns(_0xdf71a2){if(!_[_0xdbf3('0x2c')](_0xdf71a2)){for(var _0x11686f in _0xdf71a2){if(_0xdf71a2['hasOwnProperty'](_0x11686f)){_0xdf71a2[_0x11686f][_0xdbf3('0x2d')]=0x0;_0xdf71a2[_0x11686f][_0xdbf3('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x97714a){if(!_[_0xdbf3('0x2c')](_0x97714a)){for(var _0x35c53e in _0x97714a){if(_0x97714a[_0xdbf3('0x24')](_0x35c53e)){_0x97714a[_0x35c53e][_0xdbf3('0x27')]=0x0;_0x97714a[_0x35c53e]['answered']=0x0;_0x97714a[_0x35c53e]['unmanaged']=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x2f')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x29')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x2a')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x2b')]=0x0;_0x97714a[_0x35c53e]['outboundAnswerAgiCallsDay']=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x30')]=0x0;_0x97714a[_0x35c53e]['outboundBusyCallsDay']=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x31')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x32')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x33')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x34')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x35')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x36')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x37')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x38')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x39')]=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x3a')]=0x0;_0x97714a[_0x35c53e]['outboundAnswerCallsDay']=0x0;_0x97714a[_0x35c53e][_0xdbf3('0x3b')]=!![];}}}}Realtime['prototype'][_0xdbf3('0x3c')]=function(_0x435bbf,_0x39fa5e){for(var _0x5f5ec5 in _0x39fa5e){if(_0x435bbf[_0xdbf3('0x24')](_0x5f5ec5)){_0x435bbf[_0x5f5ec5]=_0x39fa5e[_0x5f5ec5];}}};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x3e')]=function(){var _0x149c07=this;return function(_0x89d495){if(_0x89d495){freeIsNotKeyAgent(_0x89d495,_0x149c07[_0xdbf3('0x10')]);for(var _0x2f8e16=0x0,_0x114eb0={},_0x2e4ba8={};_0x2f8e16<_0x89d495[_0xdbf3('0x3f')];_0x2f8e16+=0x1){_0x114eb0=_0x89d495[_0x2f8e16];var _0x3e3279=_[_0xdbf3('0x25')](_0x114eb0[_0xdbf3('0x26')])?util['format']('SIP/%s',_0x114eb0[_0xdbf3('0x23')]):_0x114eb0['interface'];if(_[_0xdbf3('0x40')](_0x149c07['agents'][_0x3e3279])){_0x149c07['agents'][_0x3e3279]=new Agent(_0x114eb0);}else{_0x149c07[_0xdbf3('0x3c')](_0x149c07[_0xdbf3('0x10')][_0x3e3279],_0x114eb0);}}}return _0x149c07[_0xdbf3('0x10')];};};Realtime['prototype'][_0xdbf3('0x41')]=function(){var _0x416671=this;return function(_0x157c5c){if(_0x157c5c){freeIsNotKeySip(_0x157c5c,_0x416671[_0xdbf3('0x11')]);for(var _0xe7059d=0x0,_0x59a7d7={},_0x4e34f1={};_0xe7059d<_0x157c5c[_0xdbf3('0x3f')];_0xe7059d+=0x1){_0x59a7d7=_0x157c5c[_0xe7059d];if(_[_0xdbf3('0x40')](_0x416671[_0xdbf3('0x11')][util[_0xdbf3('0x21')](_0xdbf3('0x22'),_0x59a7d7[_0xdbf3('0x23')])])){_0x416671[_0xdbf3('0x11')][util[_0xdbf3('0x21')]('SIP/%s',_0x59a7d7[_0xdbf3('0x23')])]=new Telephone(_0x59a7d7);}else{_0x416671[_0xdbf3('0x3c')](_0x416671[_0xdbf3('0x11')][util[_0xdbf3('0x21')]('SIP/%s',_0x59a7d7['name'])],_0x59a7d7);}}}return _0x416671[_0xdbf3('0x11')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x42')]=function(){var _0x7d6c6d=this;return function(_0x4b1c27){if(_0x4b1c27){freeIsNotKeySip(_0x4b1c27,_0x7d6c6d['trunks']);for(var _0x43650b=0x0,_0x224954={},_0x54fbe7={};_0x43650b<_0x4b1c27[_0xdbf3('0x3f')];_0x43650b+=0x1){_0x224954=_0x4b1c27[_0x43650b];if(_['isUndefined'](_0x7d6c6d[_0xdbf3('0x12')][util[_0xdbf3('0x21')](_0xdbf3('0x22'),_0x224954[_0xdbf3('0x23')])])){_0x7d6c6d[_0xdbf3('0x12')][util[_0xdbf3('0x21')](_0xdbf3('0x22'),_0x224954[_0xdbf3('0x23')])]=new Trunk(_0x224954);}else{_0x7d6c6d['mergeFromDatabase'](_0x7d6c6d['trunks'][util['format'](_0xdbf3('0x22'),_0x224954[_0xdbf3('0x23')])],_0x224954);}}}return _0x7d6c6d['trunks'];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x577c10=this;return function(_0x49e560){if(_0x49e560){freeIsNotKey(_0x49e560,_0x577c10[_0xdbf3('0x43')],_0xdbf3('0x23'));for(var _0x23ca03=0x0,_0x55ee6e={},_0xdfd706={};_0x23ca03<_0x49e560[_0xdbf3('0x3f')];_0x23ca03+=0x1){_0x55ee6e=_0x49e560[_0x23ca03];if(_[_0xdbf3('0x40')](_0x577c10['voiceQueues'][_0x55ee6e[_0xdbf3('0x23')]])){_0x577c10[_0xdbf3('0x43')][_0x55ee6e['name']]=new VoiceQueue(_0x55ee6e);}else{_0x577c10[_0xdbf3('0x3c')](_0x577c10['voiceQueues'][_0x55ee6e[_0xdbf3('0x23')]],_0x55ee6e);}}}return _0x577c10[_0xdbf3('0x43')];};};Realtime['prototype'][_0xdbf3('0x44')]=function(){var _0x57726e=this;return function(_0x133376){if(_0x133376){freeIsNotKey(_0x133376,_0x57726e['triggers'],'id');for(var _0x25f77f=0x0,_0x208271={},_0x36283f={};_0x25f77f<_0x133376[_0xdbf3('0x3f')];_0x25f77f+=0x1){_0x208271=_0x133376[_0x25f77f];if(_[_0xdbf3('0x40')](_0x57726e[_0xdbf3('0x45')][_0x208271['id']])){_0x57726e[_0xdbf3('0x45')][_0x208271['id']]=new Trigger(_0x208271);}else{_0x57726e[_0xdbf3('0x3c')](_0x57726e[_0xdbf3('0x45')][_0x208271['id']],_0x208271);}}}return _0x57726e[_0xdbf3('0x45')];};};Realtime['prototype'][_0xdbf3('0x46')]=function(){var _0x56046a=this;return function(_0x529566){if(_0x529566){freeIsNotKey(_0x529566,_0x56046a[_0xdbf3('0x14')],'id');for(var _0x29ecb8=0x0,_0x3ea515={},_0x1df70a={};_0x29ecb8<_0x529566['length'];_0x29ecb8+=0x1){_0x3ea515=_0x529566[_0x29ecb8];if(_[_0xdbf3('0x40')](_0x56046a[_0xdbf3('0x14')][_0x3ea515['id']])){_0x56046a[_0xdbf3('0x14')][_0x3ea515['id']]=new Template(_0x3ea515);}else{_0x56046a['mergeFromDatabase'](_0x56046a[_0xdbf3('0x14')][_0x3ea515['id']],_0x3ea515);}}}return _0x56046a[_0xdbf3('0x14')];};};Realtime[_0xdbf3('0x3d')]['initZendeskAccounts']=function(){var _0x23fbf7=this;return function(_0x2e420d){if(_0x2e420d){freeIsNotKey(_0x2e420d,_0x23fbf7[_0xdbf3('0x47')],'id');for(var _0x21e8aa=0x0,_0x4c997f={},_0x15c7e5={};_0x21e8aa<_0x2e420d[_0xdbf3('0x3f')];_0x21e8aa+=0x1){_0x4c997f=_0x2e420d[_0x21e8aa];if(_[_0xdbf3('0x40')](_0x23fbf7[_0xdbf3('0x47')][_0x4c997f['id']])){_0x23fbf7[_0xdbf3('0x47')][_0x4c997f['id']]=new ZendeskAccount(_0x4c997f);}else{_0x23fbf7[_0xdbf3('0x3c')](_0x23fbf7[_0xdbf3('0x47')][_0x4c997f['id']],_0x4c997f);}}}return _0x23fbf7['zendeskAccounts'];};};Realtime['prototype'][_0xdbf3('0x48')]=function(){var _0x4885d5=this;return function(_0x96774e){if(_0x96774e){freeIsNotKey(_0x96774e,_0x4885d5[_0xdbf3('0x19')],'id');for(var _0x4fe3e7=0x0,_0x5d7154={},_0x51e9cd={};_0x4fe3e7<_0x96774e[_0xdbf3('0x3f')];_0x4fe3e7+=0x1){_0x5d7154=_0x96774e[_0x4fe3e7];if(_['isUndefined'](_0x4885d5[_0xdbf3('0x19')][_0x5d7154['id']])){_0x4885d5[_0xdbf3('0x19')][_0x5d7154['id']]=new SalesforceAccount(_0x5d7154);}else{_0x4885d5[_0xdbf3('0x3c')](_0x4885d5[_0xdbf3('0x19')][_0x5d7154['id']],_0x5d7154);}}}return _0x4885d5[_0xdbf3('0x19')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x49')]=function(){var _0x30ce81=this;return function(_0x5c1c3c){if(_0x5c1c3c){freeIsNotKey(_0x5c1c3c,_0x30ce81[_0xdbf3('0x4a')],'id');for(var _0x42e8b6=0x0,_0x403c58={},_0x4c52fd={};_0x42e8b6<_0x5c1c3c[_0xdbf3('0x3f')];_0x42e8b6+=0x1){_0x403c58=_0x5c1c3c[_0x42e8b6];if(_[_0xdbf3('0x40')](_0x30ce81['freshdeskAccounts'][_0x403c58['id']])){_0x30ce81[_0xdbf3('0x4a')][_0x403c58['id']]=new FreshdeskAccount(_0x403c58);}else{_0x30ce81[_0xdbf3('0x3c')](_0x30ce81[_0xdbf3('0x4a')][_0x403c58['id']],_0x403c58);}}}return _0x30ce81[_0xdbf3('0x4a')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x4b')]=function(){var _0x52a89f=this;return function(_0x135d92){if(_0x135d92){freeIsNotKey(_0x135d92,_0x52a89f['zohoAccounts'],'id');for(var _0x18938f=0x0,_0x71ade2={},_0x23c44f={};_0x18938f<_0x135d92[_0xdbf3('0x3f')];_0x18938f+=0x1){_0x71ade2=_0x135d92[_0x18938f];if(_[_0xdbf3('0x40')](_0x52a89f[_0xdbf3('0x4c')][_0x71ade2['id']])){_0x52a89f['zohoAccounts'][_0x71ade2['id']]=new ZohoAccount(_0x71ade2);}else{_0x52a89f[_0xdbf3('0x3c')](_0x52a89f[_0xdbf3('0x4c')][_0x71ade2['id']],_0x71ade2);}}}return _0x52a89f['zohoAccounts'];};};Realtime['prototype'][_0xdbf3('0x4d')]=function(){var _0x4b02a4=this;return function(_0x5a626e){if(_0x5a626e){freeIsNotKey(_0x5a626e,_0x4b02a4[_0xdbf3('0x1b')],'id');for(var _0xdf2906=0x0,_0x90514d={},_0x36ff80={};_0xdf2906<_0x5a626e[_0xdbf3('0x3f')];_0xdf2906+=0x1){_0x90514d=_0x5a626e[_0xdf2906];if(_['isUndefined'](_0x4b02a4['deskAccounts'][_0x90514d['id']])){_0x4b02a4[_0xdbf3('0x1b')][_0x90514d['id']]=new DeskAccount(_0x90514d);}else{_0x4b02a4[_0xdbf3('0x3c')](_0x4b02a4[_0xdbf3('0x1b')][_0x90514d['id']],_0x90514d);}}}return _0x4b02a4[_0xdbf3('0x1b')];};};Realtime['prototype'][_0xdbf3('0x4e')]=function(){var _0x3641bc=this;return function(_0x513b4a){if(_0x513b4a){freeIsNotKey(_0x513b4a,_0x3641bc[_0xdbf3('0x1a')],'id');for(var _0x252ec8=0x0,_0x3e3be8={},_0x51b858={};_0x252ec8<_0x513b4a[_0xdbf3('0x3f')];_0x252ec8+=0x1){_0x3e3be8=_0x513b4a[_0x252ec8];if(_[_0xdbf3('0x40')](_0x3641bc[_0xdbf3('0x1a')][_0x3e3be8['id']])){_0x3641bc[_0xdbf3('0x1a')][_0x3e3be8['id']]=new SugarcrmAccount(_0x3e3be8);}else{_0x3641bc[_0xdbf3('0x3c')](_0x3641bc['sugarcrmAccounts'][_0x3e3be8['id']],_0x3e3be8);}}}return _0x3641bc[_0xdbf3('0x1a')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x4f')]=function(){var _0x5dd561=this;return function(_0x4b6abe){if(_0x4b6abe){freeIsNotKey(_0x4b6abe,_0x5dd561['vtigerAccounts'],'id');for(var _0x4f7018=0x0,_0x192d21={},_0x3e8181={};_0x4f7018<_0x4b6abe[_0xdbf3('0x3f')];_0x4f7018+=0x1){_0x192d21=_0x4b6abe[_0x4f7018];if(_[_0xdbf3('0x40')](_0x5dd561[_0xdbf3('0x1c')][_0x192d21['id']])){_0x5dd561[_0xdbf3('0x1c')][_0x192d21['id']]=new VtigerAccount(_0x192d21);}else{_0x5dd561[_0xdbf3('0x3c')](_0x5dd561['vtigerAccounts'][_0x192d21['id']],_0x192d21);}}}return _0x5dd561[_0xdbf3('0x1c')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x50')]=function(){var _0x4d5384=this;return function(_0x57d426){if(_0x57d426){freeIsNotKey(_0x57d426,_0x4d5384[_0xdbf3('0x1d')],'id');for(var _0x61ce7b=0x0,_0x132b05={},_0x1fe4e4={};_0x61ce7b<_0x57d426[_0xdbf3('0x3f')];_0x61ce7b+=0x1){_0x132b05=_0x57d426[_0x61ce7b];if(_['isUndefined'](_0x4d5384[_0xdbf3('0x1d')][_0x132b05['id']])){_0x4d5384['servicenowAccounts'][_0x132b05['id']]=new ServicenowAccount(_0x132b05);}else{_0x4d5384['mergeFromDatabase'](_0x4d5384['servicenowAccounts'][_0x132b05['id']],_0x132b05);}}}return _0x4d5384[_0xdbf3('0x1d')];};};Realtime[_0xdbf3('0x3d')]['initDynamics365Accounts']=function(){var _0x3997e4=this;return function(_0x37b4f5){if(_0x37b4f5){freeIsNotKey(_0x37b4f5,_0x3997e4['dynamics365Accounts'],'id');for(var _0x3d2a76=0x0,_0x5a18fc={},_0x2c8e88={};_0x3d2a76<_0x37b4f5[_0xdbf3('0x3f')];_0x3d2a76+=0x1){_0x5a18fc=_0x37b4f5[_0x3d2a76];if(_['isUndefined'](_0x3997e4[_0xdbf3('0x1e')][_0x5a18fc['id']])){_0x3997e4['dynamics365Accounts'][_0x5a18fc['id']]=new Dynamics365Account(_0x5a18fc);}else{_0x3997e4[_0xdbf3('0x3c')](_0x3997e4[_0xdbf3('0x1e')][_0x5a18fc['id']],_0x5a18fc);}}}return _0x3997e4[_0xdbf3('0x1e')];};};Realtime[_0xdbf3('0x3d')]['initFreshsalesAccounts']=function(){var _0xf7ca23=this;return function(_0x55c1cc){if(_0x55c1cc){freeIsNotKey(_0x55c1cc,_0xf7ca23[_0xdbf3('0x51')],'id');for(var _0x59ac5f=0x0,_0x2d8767={},_0x17fcc1={};_0x59ac5f<_0x55c1cc[_0xdbf3('0x3f')];_0x59ac5f+=0x1){_0x2d8767=_0x55c1cc[_0x59ac5f];if(_[_0xdbf3('0x40')](_0xf7ca23[_0xdbf3('0x51')][_0x2d8767['id']])){_0xf7ca23[_0xdbf3('0x51')][_0x2d8767['id']]=new FreshsalesAccount(_0x2d8767);}else{_0xf7ca23[_0xdbf3('0x3c')](_0xf7ca23[_0xdbf3('0x51')][_0x2d8767['id']],_0x2d8767);}}}return _0xf7ca23[_0xdbf3('0x51')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x52')]=function(){var _0x48f90f=this;return function(_0x52efcd){for(var _0x83b0d6=0x0;_0x83b0d6<_0x52efcd[_0xdbf3('0x3f')];_0x83b0d6+=0x1){_[_0xdbf3('0x53')](_0x48f90f['voiceQueues'][_0x52efcd[_0x83b0d6][_0xdbf3('0x23')]],_0x52efcd[_0x83b0d6]);}return _0x48f90f[_0xdbf3('0x43')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x54')]=function(){var _0x316cca=this;return function(_0x4f8230){clearVoiceQueues(_0x316cca[_0xdbf3('0x43')]);if(_0x4f8230){_0x4f8230=_[_0xdbf3('0x55')](_0x4f8230,_0xdbf3('0x56'));for(var _0x10caaf in _0x4f8230){if(_0x4f8230[_0xdbf3('0x24')](_0x10caaf)){var _0x3cba7b={};for(var _0x26442e=0x0;_0x26442e<_0x4f8230[_0x10caaf]['length'];_0x26442e+=0x1){var _0x3d4cf7=_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x57')];if(_0x316cca['voiceQueues'][_0x3d4cf7]){if(_0x4f8230[_0x10caaf][_0x26442e]['queuecallerexit']){_0x316cca['voiceQueues'][_0x3d4cf7][_0xdbf3('0x58')]+=0x1;}if(_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x59')]){_0x316cca[_0xdbf3('0x43')][_0x3d4cf7]['abandoned']+=0x1;}_0x316cca['voiceQueues'][_0x3d4cf7]['sumHoldTime']+=moment(_0x4f8230[_0x10caaf][_0x26442e]['queuecallerleaveAt'])['diff'](moment(_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x5a')]),_0xdbf3('0x5b'))||0x0;if(_0x26442e===_0x4f8230[_0x10caaf][_0xdbf3('0x3f')]-0x1){_0x316cca[_0xdbf3('0x43')][_0x3d4cf7]['sumDuration']+=moment(_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x5c')]||_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x5d')]||_0x4f8230[_0x10caaf][_0x26442e]['queuecallerexitAt'])[_0xdbf3('0x5e')](moment(_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x5a')]),_0xdbf3('0x5b'))||0x0;_0x316cca[_0xdbf3('0x43')][_0x3d4cf7][_0xdbf3('0x27')]+=0x1;if(_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x5f')]){_0x316cca[_0xdbf3('0x43')][_0x3d4cf7][_0xdbf3('0x28')]+=0x1;_0x316cca['voiceQueues'][_0x3d4cf7][_0xdbf3('0x2b')]+=moment(_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x5c')])[_0xdbf3('0x5e')](moment(_0x4f8230[_0x10caaf][_0x26442e][_0xdbf3('0x60')]),_0xdbf3('0x5b'))||0x0;}}else{_0x316cca[_0xdbf3('0x43')][_0x3d4cf7][_0xdbf3('0x2a')]+=_0x316cca['voiceQueues'][_0x3d4cf7][_0xdbf3('0x29')]||0x0;}}}}}}return _0x316cca[_0xdbf3('0x43')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x61')]=function(){var _0x3fd982=this;return function(_0x468031){clearVoiceCallReports(_0x3fd982['outbound']);if(_0x468031){for(var _0x226c78=0x0;_0x226c78<_0x468031[_0xdbf3('0x3f')];_0x226c78+=0x1){_0x3fd982[_0xdbf3('0x15')][_0xdbf3('0x27')]+=0x1;_0x3fd982[_0xdbf3('0x15')][_0xdbf3('0x2a')]+=_0x468031[_0x226c78][_0xdbf3('0x62')];if(_0x468031[_0x226c78]['disposition']==='ANSWERED'){_0x3fd982[_0xdbf3('0x15')]['answered']+=0x1;_0x3fd982['outbound'][_0xdbf3('0x29')]+=_0x468031[_0x226c78][_0xdbf3('0x62')]-_0x468031[_0x226c78][_0xdbf3('0x63')]||0x0;_0x3fd982['outbound']['sumBillable']+=_0x468031[_0x226c78][_0xdbf3('0x63')];}}}return _0x3fd982[_0xdbf3('0x15')];};};Realtime[_0xdbf3('0x3d')]['initCampaigns']=function(){var _0x278304=this;return function(_0x495573){if(_0x495573){freeIsNotKey(_0x495573,_0x278304['campaigns'],'name');for(var _0x2ed09a=0x0,_0x3d4bd9={};_0x2ed09a<_0x495573[_0xdbf3('0x3f')];_0x2ed09a+=0x1){_0x3d4bd9=_0x495573[_0x2ed09a];if(_['isUndefined'](_0x278304[_0xdbf3('0x13')][_0x3d4bd9[_0xdbf3('0x23')]])){_0x278304[_0xdbf3('0x13')][_0x3d4bd9[_0xdbf3('0x23')]]=new Campaign(_0x3d4bd9);}else{_0x278304[_0xdbf3('0x3c')](_0x278304['campaigns'][_0x3d4bd9['name']],_0x3d4bd9);_0x278304[_0xdbf3('0x13')][_0x3d4bd9[_0xdbf3('0x23')]]['dialQueueProject']=_0x3d4bd9['SquareProject']?_0x3d4bd9['SquareProject'][_0xdbf3('0x23')]:undefined;}}}return _0x278304['campaigns'];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x64')]=function(){var _0x4ad6b1=this;return function(_0x1109b8){if(_0x1109b8){freeIsNotKey(_0x1109b8,_0x4ad6b1[_0xdbf3('0x16')],'id');for(var _0x48c813=0x0,_0x33ba61={};_0x48c813<_0x1109b8[_0xdbf3('0x3f')];_0x48c813+=0x1){_0x33ba61=_0x1109b8[_0x48c813];if(_['isUndefined'](_0x4ad6b1[_0xdbf3('0x16')][_0x33ba61['id']])){_0x4ad6b1[_0xdbf3('0x16')][_0x33ba61['id']]=new VoiceExtension(_0x33ba61);}else{_0x4ad6b1[_0xdbf3('0x3c')](_0x4ad6b1[_0xdbf3('0x16')][_0x33ba61['id']],_0x33ba61);}}}return _0x4ad6b1['voiceExtensions'];};};Realtime['prototype'][_0xdbf3('0x65')]=function(){var _0x3bd8b4=this;return function(_0x336755){clearCampaigns(_0x3bd8b4[_0xdbf3('0x13')]);for(var _0x272980=0x0;_0x272980<_0x336755[_0xdbf3('0x3f')];_0x272980+=0x1){_['merge'](_0x3bd8b4[_0xdbf3('0x13')][_0x336755[_0x272980][_0xdbf3('0x23')]],_0x336755[_0x272980]);}return _0x3bd8b4[_0xdbf3('0x13')];};};Realtime[_0xdbf3('0x3d')][_0xdbf3('0x66')]=function(){var _0x347a7a=this;return function(_0x1dc808){if(_0x1dc808){freeIsNotKey(_0x1dc808,_0x347a7a['faxAccounts'],'id');for(var _0x38c14b=0x0,_0x3cfe2={},_0x4f49ac={};_0x38c14b<_0x1dc808[_0xdbf3('0x3f')];_0x38c14b+=0x1){_0x3cfe2=_0x1dc808[_0x38c14b];if(_[_0xdbf3('0x40')](_0x347a7a['faxAccounts'][_0x3cfe2['id']])){_0x347a7a[_0xdbf3('0x1f')][_0x3cfe2['id']]=new FaxAccount(_0x3cfe2);}else{_0x347a7a['mergeFromDatabase'](_0x347a7a[_0xdbf3('0x1f')][_0x3cfe2['id']],_0x3cfe2);}}}return _0x347a7a['faxAccounts'];};};module[_0xdbf3('0x67')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index fc79b60..6bcdf11 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 _0xe6b0=['from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','monitor','monitorFilename','monitors','filename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','mobile','phone','SIP/%s','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','length','connectedlinenum','assigned','lastAssignedTo','interface','format','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','voiceQueueReport','create','match','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid'];(function(_0x296d1b,_0x1f0bf0){var _0x3c747f=function(_0x1d5096){while(--_0x1d5096){_0x296d1b['push'](_0x296d1b['shift']());}};_0x3c747f(++_0x1f0bf0);}(_0xe6b0,0x12c));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e6b('0x0'));var moment=require(_0x0e6b('0x1'));var util=require(_0x0e6b('0x2'));var config=require(_0x0e6b('0x3'));var ami=require(_0x0e6b('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x0e6b('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x0e6b('0x6'));var RpcVoiceQueueReport=require(_0x0e6b('0x7'));var RpcVoiceRecording=require(_0x0e6b('0x8'));var RpcVoiceTransferReport=require(_0x0e6b('0x9'));var VoiceQueueReport=require(_0x0e6b('0xa'));var VoiceCallReport=require(_0x0e6b('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x0e6b('0xc'));var UserReport=require(_0x0e6b('0xd'));function Report(_0x5aa52d){this['realtime']=_0x5aa52d;this[_0x0e6b('0xe')]=_0x5aa52d[_0x0e6b('0xe')];this[_0x0e6b('0xf')]=_0x5aa52d[_0x0e6b('0xf')];}Report[_0x0e6b('0x10')][_0x0e6b('0x11')]=function(_0x4562ff){var _0x1ce079=new VoiceQueueReport(this[_0x0e6b('0x12')]);var _0x3856b5=new VoiceAgentReport(this[_0x0e6b('0x12')]);var _0x98274b=new VoiceDialReport(this[_0x0e6b('0x12')]);var _0x427ecc=new VoiceCallReport(this['realtime']);var _0x526235=new UserReport(this['realtime']);if(config[_0x0e6b('0x13')]&&config[_0x0e6b('0x13')][_0x0e6b('0x14')]){ami['on'](_0x0e6b('0x15'),this['voiceQueueReport']['bind'](this));ami['on']('custom:voiceCallReport',this[_0x0e6b('0x16')][_0x0e6b('0x17')](this));ami['on'](_0x0e6b('0x18'),this[_0x0e6b('0x19')][_0x0e6b('0x17')](this));ami['on']('custom:voiceDialReport',this[_0x0e6b('0x1a')]['bind'](this));ami['on']('blindtransfer',this[_0x0e6b('0x1b')][_0x0e6b('0x17')](this));ami['on'](_0x0e6b('0x1c'),this[_0x0e6b('0x1d')][_0x0e6b('0x17')](this));}};Report['prototype'][_0x0e6b('0x1e')]=function(_0x1c8613){var _0x5baef4;_0x5baef4=_[_0x0e6b('0x1f')](this[_0x0e6b('0xe')],function(_0x13033e){return _0x13033e[_0x0e6b('0x20')]==_0x1c8613||_0x13033e[_0x0e6b('0x21')]==_0x1c8613;});if(_[_0x0e6b('0x22')](_0x5baef4)){var _0x4cad3a=_[_0x0e6b('0x1f')](this[_0x0e6b('0xf')],function(_0x39bc72){return _0x39bc72[_0x0e6b('0x20')]==_0x1c8613||_0x39bc72[_0x0e6b('0x21')]==_0x1c8613;});if(_0x4cad3a){_0x5baef4=_[_0x0e6b('0x1f')](this[_0x0e6b('0xe')],function(_0x1ee337){return _0x1ee337['interface']==util['format']('SIP/%s',_0x4cad3a[_0x0e6b('0x21')]);});}}return _0x5baef4;};Report[_0x0e6b('0x10')]['voiceQueueReport']=function(_0x4507ae){for(var _0xa8da2f=0x0;_0xa8da2f<_0x4507ae[_0x0e6b('0x23')];_0xa8da2f+=0x1){var _0x237817=this['findAgent'](_0x4507ae[_0xa8da2f][_0x0e6b('0x24')]);if(_0x237817){_0x4507ae[_0xa8da2f][_0x0e6b('0x20')]=_0x237817['accountcode'];_0x4507ae[_0xa8da2f][_0x0e6b('0x25')]=!![];_0x4507ae[_0xa8da2f][_0x0e6b('0x26')]=_0x237817['name'];_0x4507ae[_0xa8da2f][_0x0e6b('0x27')]=_[_0x0e6b('0x22')](_0x237817[_0x0e6b('0x27')])?util[_0x0e6b('0x28')]('SIP/%s',_0x237817[_0x0e6b('0x21')]):_0x237817[_0x0e6b('0x27')];if(_0x4507ae[_0xa8da2f]['queuecallercomplete']){_0x4507ae[_0xa8da2f][_0x0e6b('0x29')]=moment()[_0x0e6b('0x28')](_0x0e6b('0x2a'));}if(_0x4507ae[_0xa8da2f]['queuecallerexit']){_0x4507ae[_0xa8da2f][_0x0e6b('0x2b')]=moment()['format'](_0x0e6b('0x2a'));}RpcMemberReport[_0x0e6b('0x2c')](_0x4507ae[_0xa8da2f]);}RpcVoiceQueueReport[_0x0e6b('0x2d')](_0x4507ae[_0xa8da2f]);}};function extractCalleridNumber(_0x44bd1f){var _0x53b62e=_0x44bd1f[_0x0e6b('0x2e')](/<(.*?)>/);return _0x53b62e?_0x53b62e[0x1]:_0x44bd1f;}Report['prototype'][_0x0e6b('0x16')]=function(_0x10da99){_0x10da99[_0x0e6b('0x2f')]=_0x10da99[_0x0e6b('0x2f')]||_0x10da99['exten'];if(_0x10da99[_0x0e6b('0x30')]==_0x0e6b('0x31')){_0x10da99[_0x0e6b('0x32')]=_0x0e6b('0x33');_0x10da99[_0x0e6b('0x34')]=_0x10da99[_0x0e6b('0x33')];if(_0x10da99[_0x0e6b('0x35')]==_0x0e6b('0x36')){_0x10da99[_0x0e6b('0x20')]='';_0x10da99[_0x0e6b('0x2f')]=extractCalleridNumber(_0x10da99[_0x0e6b('0x37')]);}else if(_0x10da99[_0x0e6b('0x35')]==_0x0e6b('0x38')){if(_0x10da99[_0x0e6b('0x2f')]==_0x0e6b('0x39')){_0x10da99['destination']=extractCalleridNumber(_0x10da99[_0x0e6b('0x3a')]);_0x10da99[_0x0e6b('0x3b')]=_0x10da99[_0x0e6b('0x3c')];_0x10da99[_0x0e6b('0x3d')]=[_0x10da99[_0x0e6b('0x3e')],_0x10da99[_0x0e6b('0x3e')]=_0x10da99[_0x0e6b('0x3d')]][0x0];_0x10da99[_0x0e6b('0x37')]=_0x10da99[_0x0e6b('0x3a')];}else{_0x10da99[_0x0e6b('0x2f')]=_0x10da99['calleridnum'];_0x10da99['calleridnum']=_0x10da99[_0x0e6b('0x3c')];if(_0x10da99[_0x0e6b('0x3f')]=='ANSWERED'){_0x10da99[_0x0e6b('0x20')]=_0x10da99[_0x0e6b('0x24')];}else{_0x10da99[_0x0e6b('0x20')]='';}}}}else{_0x10da99[_0x0e6b('0x37')]=util[_0x0e6b('0x28')](_0x0e6b('0x40'),_0x10da99[_0x0e6b('0x41')],_0x10da99['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x10da99[_0x0e6b('0x42')]]){var _0x35465b=RpcVoiceTransferReport[_0x0e6b('0x43')][_0x10da99[_0x0e6b('0x42')]];_0x35465b[_0x0e6b('0x44')]=_0x10da99[_0x0e6b('0x45')];RpcVoiceTransferReport['blindTransfer'](_0x35465b);delete RpcVoiceTransferReport['transfers'][_0x10da99[_0x0e6b('0x42')]];}RpcVoiceCallReport[_0x0e6b('0x2d')](_0x10da99);if(_0x10da99[_0x0e6b('0x46')]){for(var _0x1d8189=0x0;_0x1d8189<_0x10da99['monitors']['length'];_0x1d8189+=0x1){_0x10da99[_0x0e6b('0x47')]=_0x10da99[_0x0e6b('0x48')][_0x1d8189][_0x0e6b('0x49')];_0x10da99[_0x0e6b('0x4a')]=_0x10da99['monitors'][_0x1d8189][_0x0e6b('0x4a')];if(_0x10da99[_0x0e6b('0x4b')]=='xcally-motion-preview'){_0x10da99['calleridnum']=_0x10da99[_0x0e6b('0x24')];_0x10da99[_0x0e6b('0x41')]=_0x10da99[_0x0e6b('0x4c')];_0x10da99[_0x0e6b('0x24')]=_0x10da99['accountcode'];_0x10da99['connectedlinename']=_0x10da99[_0x0e6b('0x4d')];_0x10da99[_0x0e6b('0x4b')]=_0x10da99[_0x0e6b('0x3c')];}else if(_0x10da99[_0x0e6b('0x4b')]==_0x0e6b('0x4e')){_0x10da99[_0x0e6b('0x3b')]=_0x10da99[_0x0e6b('0x2f')];_0x10da99[_0x0e6b('0x4b')]=_0x10da99['originatecalleridnum'];}RpcVoiceRecording[_0x0e6b('0x2d')](_0x10da99);}}};Report[_0x0e6b('0x10')][_0x0e6b('0x19')]=function(_0x23358b){if(_[_0x0e6b('0x4f')](_0x23358b)){_0x23358b[_0x0e6b('0x50')](function(_0x460f5f){RpcVoiceAgentReport[_0x0e6b('0x2d')](_0x460f5f);});}else{RpcVoiceAgentReport[_0x0e6b('0x2d')](_0x23358b);}};Report[_0x0e6b('0x10')][_0x0e6b('0x1a')]=function(_0x39cf63){RpcVoiceDialReport[_0x0e6b('0x2d')](_0x39cf63);var _0x2fae62;var _0x56b06a;var _0x29a628=_0x39cf63[_0x0e6b('0x3e')];if(_['startsWith'](_0x29a628,_0x0e6b('0x51'))){_0x56b06a=_0x29a628[_0x0e6b('0x52')](_0x29a628['indexOf']('/')+0x1,_0x29a628[_0x0e6b('0x53')]('@'));_0x2fae62=_['find'](this[_0x0e6b('0xe')],function(_0x5f3c62){return _0x5f3c62[_0x0e6b('0x54')]==_0x56b06a||_0x5f3c62[_0x0e6b('0x55')]==_0x56b06a||_0x5f3c62['accountcode']==_0x56b06a;});}else{_0x56b06a=_0x29a628[_0x0e6b('0x52')](_0x29a628[_0x0e6b('0x53')]('/')+0x1,_0x29a628['lastIndexOf']('-'));_0x2fae62=this[_0x0e6b('0x1e')](_0x56b06a);}if(_0x2fae62){_0x39cf63[_0x0e6b('0x27')]=_[_0x0e6b('0x22')](_0x2fae62[_0x0e6b('0x27')])?util[_0x0e6b('0x28')](_0x0e6b('0x56'),_0x2fae62[_0x0e6b('0x21')]):_0x2fae62[_0x0e6b('0x27')];_0x39cf63[_0x0e6b('0x4d')]=_0x2fae62[_0x0e6b('0x21')];_0x39cf63[_0x0e6b('0x20')]=_0x2fae62[_0x0e6b('0x20')];RpcMemberReport[_0x0e6b('0x1a')](_0x39cf63);}};Report['prototype']['blindTransfer']=function(_0x51a626){RpcVoiceTransferReport[_0x0e6b('0x43')][_0x51a626[_0x0e6b('0x57')]]=_0x51a626;};Report['prototype'][_0x0e6b('0x1d')]=function(_0x451d0c){RpcVoiceTransferReport['attendedTransfer'](_0x451d0c);};module[_0x0e6b('0x58')]=Report; \ No newline at end of file +var _0x2406=['callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','channel','calleridnum','disposition','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','monitors','monitorFilename','createdAt','connectedlinename','isArray','forEach','Local','substring','indexOf','phone','membername','transfererlinkedid','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','isNil','find','accountcode','name','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','format','create','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x2406,0x6f));var _0x6240=function(_0x4594d4,_0x5a7bb4){_0x4594d4=_0x4594d4-0x0;var _0x445a55=_0x2406[_0x4594d4];return _0x445a55;};'use strict';var _=require('lodash');var moment=require(_0x6240('0x0'));var util=require(_0x6240('0x1'));var config=require(_0x6240('0x2'));var ami=require(_0x6240('0x3'));var RpcVoiceAgentReport=require(_0x6240('0x4'));var RpcVoiceCallReport=require(_0x6240('0x5'));var RpcVoiceDialReport=require(_0x6240('0x6'));var RpcMemberReport=require(_0x6240('0x7'));var RpcVoiceQueueReport=require(_0x6240('0x8'));var RpcVoiceRecording=require(_0x6240('0x9'));var RpcVoiceTransferReport=require(_0x6240('0xa'));var VoiceQueueReport=require(_0x6240('0xb'));var VoiceCallReport=require(_0x6240('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x6240('0xd'));var UserReport=require(_0x6240('0xe'));function Report(_0x25d38b){this[_0x6240('0xf')]=_0x25d38b;this[_0x6240('0x10')]=_0x25d38b[_0x6240('0x10')];this[_0x6240('0x11')]=_0x25d38b[_0x6240('0x11')];}Report[_0x6240('0x12')][_0x6240('0x13')]=function(_0x877017){var _0x4ba22e=new VoiceQueueReport(this[_0x6240('0xf')]);var _0x4c6be1=new VoiceAgentReport(this[_0x6240('0xf')]);var _0x154513=new VoiceDialReport(this[_0x6240('0xf')]);var _0x20ad21=new VoiceCallReport(this[_0x6240('0xf')]);var _0x429462=new UserReport(this[_0x6240('0xf')]);if(config['xdr']&&config[_0x6240('0x14')][_0x6240('0x15')]){ami['on'](_0x6240('0x16'),this[_0x6240('0x17')][_0x6240('0x18')](this));ami['on'](_0x6240('0x19'),this[_0x6240('0x1a')][_0x6240('0x18')](this));ami['on'](_0x6240('0x1b'),this[_0x6240('0x1c')]['bind'](this));ami['on'](_0x6240('0x1d'),this[_0x6240('0x1e')][_0x6240('0x18')](this));ami['on'](_0x6240('0x1f'),this[_0x6240('0x20')][_0x6240('0x18')](this));ami['on']('attendedtransfer',this[_0x6240('0x21')]['bind'](this));}};Report[_0x6240('0x12')][_0x6240('0x22')]=function(_0x4b1ebd){var _0x2acf0a;_0x2acf0a=_['find'](this[_0x6240('0x10')],function(_0x6a6ddc){return _0x6a6ddc['accountcode']==_0x4b1ebd||_0x6a6ddc['name']==_0x4b1ebd;});if(_[_0x6240('0x23')](_0x2acf0a)){var _0x126a8b=_[_0x6240('0x24')](this[_0x6240('0x11')],function(_0x4c4ac5){return _0x4c4ac5[_0x6240('0x25')]==_0x4b1ebd||_0x4c4ac5[_0x6240('0x26')]==_0x4b1ebd;});if(_0x126a8b){_0x2acf0a=_[_0x6240('0x24')](this[_0x6240('0x10')],function(_0x3d70ce){return _0x3d70ce['interface']==util['format'](_0x6240('0x27'),_0x126a8b['name']);});}}return _0x2acf0a;};Report[_0x6240('0x12')][_0x6240('0x17')]=function(_0x504b7d){for(var _0x3042e4=0x0;_0x3042e4<_0x504b7d[_0x6240('0x28')];_0x3042e4+=0x1){var _0xb72ef8=this['findAgent'](_0x504b7d[_0x3042e4][_0x6240('0x29')]);if(_0xb72ef8){_0x504b7d[_0x3042e4]['accountcode']=_0xb72ef8['accountcode'];_0x504b7d[_0x3042e4][_0x6240('0x2a')]=!![];_0x504b7d[_0x3042e4][_0x6240('0x2b')]=_0xb72ef8[_0x6240('0x26')];_0x504b7d[_0x3042e4][_0x6240('0x2c')]=_[_0x6240('0x23')](_0xb72ef8[_0x6240('0x2c')])?util['format'](_0x6240('0x27'),_0xb72ef8[_0x6240('0x26')]):_0xb72ef8['interface'];if(_0x504b7d[_0x3042e4][_0x6240('0x2d')]){_0x504b7d[_0x3042e4][_0x6240('0x2e')]=moment()['format'](_0x6240('0x2f'));}if(_0x504b7d[_0x3042e4][_0x6240('0x30')]){_0x504b7d[_0x3042e4]['queuecallerexitAt']=moment()[_0x6240('0x31')](_0x6240('0x2f'));}RpcMemberReport[_0x6240('0x17')](_0x504b7d[_0x3042e4]);}RpcVoiceQueueReport[_0x6240('0x32')](_0x504b7d[_0x3042e4]);}};function extractCalleridNumber(_0x47b1be){var _0x37f91a=_0x47b1be['match'](/<(.*?)>/);return _0x37f91a?_0x37f91a[0x1]:_0x47b1be;}Report['prototype'][_0x6240('0x1a')]=function(_0x5ad1d7){_0x5ad1d7['destination']=_0x5ad1d7[_0x6240('0x33')]||_0x5ad1d7[_0x6240('0x34')];if(_0x5ad1d7[_0x6240('0x35')]=='dialer'){_0x5ad1d7[_0x6240('0x36')]=_0x6240('0x37');_0x5ad1d7[_0x6240('0x38')]=_0x5ad1d7[_0x6240('0x37')];if(_0x5ad1d7[_0x6240('0x39')]==_0x6240('0x3a')){_0x5ad1d7[_0x6240('0x25')]='';_0x5ad1d7[_0x6240('0x33')]=extractCalleridNumber(_0x5ad1d7[_0x6240('0x3b')]);}else if(_0x5ad1d7[_0x6240('0x39')]==_0x6240('0x3c')){if(_0x5ad1d7[_0x6240('0x33')]==_0x6240('0x3d')){_0x5ad1d7[_0x6240('0x33')]=extractCalleridNumber(_0x5ad1d7[_0x6240('0x3e')]);_0x5ad1d7['calleridnum']=_0x5ad1d7[_0x6240('0x3f')];_0x5ad1d7['destinationchannel']=[_0x5ad1d7[_0x6240('0x40')],_0x5ad1d7[_0x6240('0x40')]=_0x5ad1d7['destinationchannel']][0x0];_0x5ad1d7[_0x6240('0x3b')]=_0x5ad1d7[_0x6240('0x3e')];}else{_0x5ad1d7['destination']=_0x5ad1d7[_0x6240('0x41')];_0x5ad1d7[_0x6240('0x41')]=_0x5ad1d7[_0x6240('0x3f')];if(_0x5ad1d7[_0x6240('0x42')]=='ANSWERED'){_0x5ad1d7[_0x6240('0x25')]=_0x5ad1d7[_0x6240('0x29')];}else{_0x5ad1d7['accountcode']='';}}}}else{_0x5ad1d7[_0x6240('0x3b')]=util[_0x6240('0x31')](_0x6240('0x43'),_0x5ad1d7[_0x6240('0x44')],_0x5ad1d7['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x5ad1d7[_0x6240('0x45')]]){var _0x4d42be=RpcVoiceTransferReport[_0x6240('0x46')][_0x5ad1d7[_0x6240('0x45')]];_0x4d42be[_0x6240('0x47')]=_0x5ad1d7[_0x6240('0x48')];RpcVoiceTransferReport['blindTransfer'](_0x4d42be);delete RpcVoiceTransferReport[_0x6240('0x46')][_0x5ad1d7[_0x6240('0x45')]];}RpcVoiceCallReport[_0x6240('0x32')](_0x5ad1d7);if(_0x5ad1d7['monitor']){for(var _0x3648be=0x0;_0x3648be<_0x5ad1d7[_0x6240('0x49')][_0x6240('0x28')];_0x3648be+=0x1){_0x5ad1d7[_0x6240('0x4a')]=_0x5ad1d7[_0x6240('0x49')][_0x3648be]['filename'];_0x5ad1d7[_0x6240('0x4b')]=_0x5ad1d7['monitors'][_0x3648be][_0x6240('0x4b')];if(_0x5ad1d7['exten']=='xcally-motion-preview'){_0x5ad1d7[_0x6240('0x41')]=_0x5ad1d7[_0x6240('0x29')];_0x5ad1d7['calleridname']=_0x5ad1d7['connectedlinename'];_0x5ad1d7[_0x6240('0x29')]=_0x5ad1d7[_0x6240('0x25')];_0x5ad1d7[_0x6240('0x4c')]=_0x5ad1d7['membername'];_0x5ad1d7[_0x6240('0x34')]=_0x5ad1d7[_0x6240('0x3f')];}else if(_0x5ad1d7['exten']=='xcally-motion-dialer'){_0x5ad1d7['calleridnum']=_0x5ad1d7['destination'];_0x5ad1d7[_0x6240('0x34')]=_0x5ad1d7[_0x6240('0x3f')];}RpcVoiceRecording[_0x6240('0x32')](_0x5ad1d7);}}};Report['prototype'][_0x6240('0x1c')]=function(_0x3299bd){if(_[_0x6240('0x4d')](_0x3299bd)){_0x3299bd[_0x6240('0x4e')](function(_0x4bf811){RpcVoiceAgentReport['create'](_0x4bf811);});}else{RpcVoiceAgentReport[_0x6240('0x32')](_0x3299bd);}};Report[_0x6240('0x12')]['voiceDialReport']=function(_0x5a5123){RpcVoiceDialReport[_0x6240('0x32')](_0x5a5123);var _0x4c4819;var _0x462994;var _0x3229fd=_0x5a5123['channel'];if(_['startsWith'](_0x3229fd,_0x6240('0x4f'))){_0x462994=_0x3229fd[_0x6240('0x50')](_0x3229fd[_0x6240('0x51')]('/')+0x1,_0x3229fd[_0x6240('0x51')]('@'));_0x4c4819=_['find'](this[_0x6240('0x10')],function(_0x2df455){return _0x2df455['mobile']==_0x462994||_0x2df455[_0x6240('0x52')]==_0x462994||_0x2df455['accountcode']==_0x462994;});}else{_0x462994=_0x3229fd[_0x6240('0x50')](_0x3229fd[_0x6240('0x51')]('/')+0x1,_0x3229fd['lastIndexOf']('-'));_0x4c4819=this[_0x6240('0x22')](_0x462994);}if(_0x4c4819){_0x5a5123[_0x6240('0x2c')]=_[_0x6240('0x23')](_0x4c4819[_0x6240('0x2c')])?util[_0x6240('0x31')](_0x6240('0x27'),_0x4c4819[_0x6240('0x26')]):_0x4c4819[_0x6240('0x2c')];_0x5a5123[_0x6240('0x53')]=_0x4c4819['name'];_0x5a5123[_0x6240('0x25')]=_0x4c4819[_0x6240('0x25')];RpcMemberReport[_0x6240('0x1e')](_0x5a5123);}};Report['prototype'][_0x6240('0x20')]=function(_0x208446){RpcVoiceTransferReport[_0x6240('0x46')][_0x208446[_0x6240('0x54')]]=_0x208446;};Report[_0x6240('0x12')][_0x6240('0x21')]=function(_0x3d1f35){RpcVoiceTransferReport[_0x6240('0x21')](_0x3d1f35);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index b342c12..9a00214 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb501=['stateTime','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','phone','accountcode','syncPeerStatus','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','registered','peer','status','telephone:save','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','syncRealtimeShow','then','actionSipShowRegistry','catch','inspect','resolve','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','error','prototype','isNotNull','isUndefined','emit','info','username','debug','[userReport][registry]','stateRegistry','state','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','inuse','toNumber','updateStatusRealtime'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0xb501,0xa6));var _0x1b50=function(_0x98397d,_0x3604ac){_0x98397d=_0x98397d-0x0;var _0x56bfb0=_0xb501[_0x98397d];return _0x56bfb0;};'use strict';var _=require('lodash');var moment=require(_0x1b50('0x0'));var util=require('util');var Redis=require(_0x1b50('0x1'));var BPromise=require(_0x1b50('0x2'));var config=require(_0x1b50('0x3'));var logger=require(_0x1b50('0x4'))('ami');var ami=require(_0x1b50('0x5'));config['redis']=_[_0x1b50('0x6')](config[_0x1b50('0x7')],{'host':_0x1b50('0x8'),'port':0x18eb});var io=require(_0x1b50('0x9'))(new Redis(config[_0x1b50('0x7')]));function UserReport(_0xcb268){this[_0x1b50('0xa')]=_0xcb268[_0x1b50('0xa')];this[_0x1b50('0xb')]=_0xcb268[_0x1b50('0xb')];this[_0x1b50('0xc')]=_0xcb268[_0x1b50('0xc')];ami['on'](_0x1b50('0xd'),this[_0x1b50('0xe')][_0x1b50('0xf')](this));ami['on'](_0x1b50('0x10'),this[_0x1b50('0xe')][_0x1b50('0xf')](this));ami['on']('devicestatechange',this[_0x1b50('0x11')][_0x1b50('0xf')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0x1b50('0xf')](this));return this[_0x1b50('0x12')]();}function showSipRegistrations(){Promise['resolve']()[_0x1b50('0x13')](ami[_0x1b50('0x14')]())[_0x1b50('0x15')](function(_0x32b512){logger['error']('[userReport][sipshowregistry]',util[_0x1b50('0x16')](_0x32b512,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x1b50('0x17')]()[_0x1b50('0x13')](ami[_0x1b50('0x18')]())['catch'](function(_0x5e0ec8){logger['error'](_0x1b50('0x19'),util['inspect'](_0x5e0ec8,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x1b50('0x17')]()[_0x1b50('0x13')](ami[_0x1b50('0x1a')]())[_0x1b50('0x15')](function(_0x4491cc){logger[_0x1b50('0x1b')]('[userReport][sippeerstatus]',util['inspect'](_0x4491cc,{'showHidden':![],'depth':null}));});}UserReport[_0x1b50('0x1c')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x1b50('0x13')](showSipRegistrations())[_0x1b50('0x13')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x1b50('0x1c')][_0x1b50('0x1d')]=function(_0x41369c){return _0x41369c!==null&&!_[_0x1b50('0x1e')](_0x41369c);};UserReport[_0x1b50('0x1c')][_0x1b50('0x1f')]=function(_0x5d5829,_0x419ba1,_0x3e5a3b){io['to'](_0x5d5829)[_0x1b50('0x1f')](_0x419ba1,_0x3e5a3b);};UserReport[_0x1b50('0x1c')]['syncRegistry']=function(_0x4ceaa0){try{if(this[_0x1b50('0x1d')](_0x4ceaa0)){logger[_0x1b50('0x20')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x4ceaa0[_0x1b50('0x21')],_0x4ceaa0['state']);logger[_0x1b50('0x22')](_0x1b50('0x23'),util['inspect'](_0x4ceaa0,{'showHidden':![],'depth':null}));var _0x2f5d96=_['find'](this['trunks'],{'defaultuser':_0x4ceaa0[_0x1b50('0x21')]});if(_0x2f5d96){_0x4ceaa0[_0x1b50('0x24')]=_0x4ceaa0[_0x1b50('0x25')];_['merge'](_0x2f5d96,_[_0x1b50('0x26')](_0x4ceaa0,[_0x1b50('0x27'),_0x1b50('0x28'),_0x1b50('0x21'),_0x1b50('0x25')]));logger[_0x1b50('0x22')](_0x1b50('0x29'),util['inspect'](_0x2f5d96,{'showHidden':![],'depth':null}));this[_0x1b50('0x1f')](util['format'](_0x1b50('0x2a'),_0x2f5d96[_0x1b50('0x2b')]),_0x1b50('0x2c'),_0x2f5d96);}}}catch(_0x3c997f){logger[_0x1b50('0x1b')]('[userReport][registry]',util[_0x1b50('0x16')](_0x3c997f,{'showHidden':![],'depth':null}));}};UserReport[_0x1b50('0x1c')]['syncDeviceState']=function(_0x4a4c9f){try{if(this[_0x1b50('0x1d')](_0x4a4c9f)){logger[_0x1b50('0x20')](_0x1b50('0x2d'),_0x4a4c9f['device'],_0x4a4c9f[_0x1b50('0x25')]);logger[_0x1b50('0x22')](_0x1b50('0x2e'),util[_0x1b50('0x16')](_0x4a4c9f,{'showHidden':![],'depth':null}));if(this[_0x1b50('0xb')][_0x4a4c9f[_0x1b50('0x2f')]]){if(!this['agents'][_0x4a4c9f['device']][_0x1b50('0x30')]||_0x4a4c9f[_0x1b50('0x25')][_0x1b50('0x31')]()==_0x1b50('0x32')){this[_0x1b50('0xb')][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x30')]=![];if(this['agents'][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x25')]!==_0x4a4c9f[_0x1b50('0x25')][_0x1b50('0x31')]()){this[_0x1b50('0xb')][_0x4a4c9f[_0x1b50('0x2f')]]['stateTime']=_[_0x1b50('0x33')](moment()['format']('x'));}this[_0x1b50('0xb')][_0x4a4c9f['device']][_0x1b50('0x25')]=_0x4a4c9f[_0x1b50('0x25')][_0x1b50('0x31')]();this[_0x1b50('0xb')][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x34')](_0x4a4c9f);}}else if(this['telephones'][_0x4a4c9f['device']]){if(this['telephones'][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x25')]!==_0x4a4c9f[_0x1b50('0x25')]['toLowerCase']()){this[_0x1b50('0xc')][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x35')]=_[_0x1b50('0x33')](moment()[_0x1b50('0x36')]('x'));}this[_0x1b50('0xc')][_0x4a4c9f[_0x1b50('0x2f')]]['state']=_0x4a4c9f[_0x1b50('0x25')][_0x1b50('0x31')]();logger[_0x1b50('0x22')](_0x1b50('0x37'),util[_0x1b50('0x16')](this['telephones'][_0x4a4c9f[_0x1b50('0x2f')]],{'showHidden':![],'depth':null}));this[_0x1b50('0x1f')](util['format'](_0x1b50('0x38'),this['telephones'][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x2b')]),'telephone:save',this[_0x1b50('0xc')][_0x4a4c9f[_0x1b50('0x2f')]]);}else if(this['trunks'][_0x4a4c9f[_0x1b50('0x2f')]]){if(this[_0x1b50('0xa')][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x25')]!==_0x4a4c9f['state']['toLowerCase']()){this[_0x1b50('0xa')][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x35')]=_['toNumber'](moment()[_0x1b50('0x36')]('x'));}this[_0x1b50('0xa')][_0x4a4c9f[_0x1b50('0x2f')]][_0x1b50('0x25')]=_0x4a4c9f[_0x1b50('0x25')]['toLowerCase']();logger[_0x1b50('0x22')](_0x1b50('0x39'),util[_0x1b50('0x16')](this[_0x1b50('0xa')][_0x4a4c9f[_0x1b50('0x2f')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',this['trunks'][_0x4a4c9f[_0x1b50('0x2f')]]['name']),_0x1b50('0x2c'),this[_0x1b50('0xa')][_0x4a4c9f['device']]);}else if(_[_0x1b50('0x3a')](_0x4a4c9f[_0x1b50('0x2f')],_0x1b50('0x3b'))){var _0x151c4f=_0x4a4c9f[_0x1b50('0x2f')];var _0x11ebad=_0x151c4f['substring'](_0x151c4f[_0x1b50('0x3c')]('/')+0x1,_0x151c4f['indexOf']('@'));var _0x564781=_['find'](this[_0x1b50('0xb')],function(_0x2cd6c9){return _0x2cd6c9[_0x1b50('0x3d')]==_0x11ebad||_0x2cd6c9[_0x1b50('0x3e')]==_0x11ebad||_0x2cd6c9[_0x1b50('0x3f')]==_0x11ebad;});if(_0x564781){if(_0x564781[_0x1b50('0x25')]!==_0x4a4c9f[_0x1b50('0x25')][_0x1b50('0x31')]()){_0x564781[_0x1b50('0x35')]=_[_0x1b50('0x33')](moment()[_0x1b50('0x36')]('x'));}_0x564781[_0x1b50('0x25')]=_0x4a4c9f[_0x1b50('0x25')][_0x1b50('0x31')]();_0x564781[_0x1b50('0x30')]=!![];_0x564781[_0x1b50('0x34')](_0x4a4c9f);}}}}catch(_0x190ab2){logger[_0x1b50('0x1b')]('[userReport][devicestatechange]',util[_0x1b50('0x16')](_0x190ab2,{'showHidden':![],'depth':null}));}};UserReport[_0x1b50('0x1c')][_0x1b50('0x40')]=function(_0x2966ac){try{if(this['isNotNull'](_0x2966ac)&&this['isNotNull'](_0x2966ac[_0x1b50('0x41')])){logger[_0x1b50('0x20')](_0x1b50('0x42'),_0x2966ac['peer'],_0x2966ac[_0x1b50('0x43')],_0x2966ac[_0x1b50('0x41')]);logger[_0x1b50('0x22')](_0x1b50('0x44'),util[_0x1b50('0x16')](_0x2966ac,{'showHidden':![],'depth':null}));if(this[_0x1b50('0xb')][_0x2966ac['peer']]){if(!this[_0x1b50('0xb')][_0x2966ac['peer']][_0x1b50('0x30')]||_0x2966ac['peerstatus'][_0x1b50('0x31')]()==_0x1b50('0x45')){this[_0x1b50('0xb')][_0x2966ac[_0x1b50('0x46')]][_0x1b50('0x30')]=![];this[_0x1b50('0xb')][_0x2966ac[_0x1b50('0x46')]][_0x1b50('0x47')]=_0x2966ac[_0x1b50('0x41')]['toLowerCase']();this[_0x1b50('0xb')][_0x2966ac[_0x1b50('0x46')]]['address']=_0x2966ac['address'];this[_0x1b50('0xb')][_0x2966ac['peer']][_0x1b50('0x34')](_0x2966ac);}}else if(this[_0x1b50('0xc')][_0x2966ac[_0x1b50('0x46')]]){this[_0x1b50('0xc')][_0x2966ac['peer']][_0x1b50('0x47')]=_0x2966ac[_0x1b50('0x41')]['toLowerCase']();this[_0x1b50('0xc')][_0x2966ac[_0x1b50('0x46')]][_0x1b50('0x43')]=_0x2966ac[_0x1b50('0x43')];logger['debug']('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x1b50('0x16')](this[_0x1b50('0xc')][_0x2966ac[_0x1b50('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x1b50('0x36')](_0x1b50('0x38'),this[_0x1b50('0xc')][_0x2966ac['peer']][_0x1b50('0x2b')]),_0x1b50('0x48'),this['telephones'][_0x2966ac[_0x1b50('0x46')]]);}else if(this['trunks'][_0x2966ac[_0x1b50('0x46')]]){this[_0x1b50('0xa')][_0x2966ac['peer']][_0x1b50('0x47')]=_0x2966ac['peerstatus']['toLowerCase']();this['trunks'][_0x2966ac[_0x1b50('0x46')]][_0x1b50('0x43')]=_0x2966ac['address'];logger['debug']('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x1b50('0x16')](this[_0x1b50('0xa')][_0x2966ac[_0x1b50('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x1b50('0x36')](_0x1b50('0x2a'),this[_0x1b50('0xa')][_0x2966ac[_0x1b50('0x46')]][_0x1b50('0x2b')]),_0x1b50('0x2c'),this[_0x1b50('0xa')][_0x2966ac[_0x1b50('0x46')]]);}}}catch(_0x10cc1b){logger['error'](_0x1b50('0x44'),util['inspect'](_0x10cc1b,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x4b48=['syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','telephones','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','merge','omit','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','agents','local','inuse','toLowerCase','stateTime','toNumber','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','trunk:%s','startsWith','Local','mobile','phone','accountcode','updateStatusRealtime','[userReport][devicestatechange]'];(function(_0x3e7cbd,_0x19cb84){var _0x2cc49a=function(_0x69f76d){while(--_0x69f76d){_0x3e7cbd['push'](_0x3e7cbd['shift']());}};_0x2cc49a(++_0x19cb84);}(_0x4b48,0x190));var _0x84b4=function(_0x5c7b9b,_0x210a86){_0x5c7b9b=_0x5c7b9b-0x0;var _0x4e811b=_0x4b48[_0x5c7b9b];return _0x4e811b;};'use strict';var _=require(_0x84b4('0x0'));var moment=require(_0x84b4('0x1'));var util=require(_0x84b4('0x2'));var Redis=require(_0x84b4('0x3'));var BPromise=require(_0x84b4('0x4'));var config=require(_0x84b4('0x5'));var logger=require(_0x84b4('0x6'))(_0x84b4('0x7'));var ami=require(_0x84b4('0x8'));config[_0x84b4('0x9')]=_['defaults'](config[_0x84b4('0x9')],{'host':_0x84b4('0xa'),'port':0x18eb});var io=require(_0x84b4('0xb'))(new Redis(config[_0x84b4('0x9')]));function UserReport(_0x2ae3e1){this[_0x84b4('0xc')]=_0x2ae3e1['trunks'];this['agents']=_0x2ae3e1['agents'];this['telephones']=_0x2ae3e1[_0x84b4('0xd')];ami['on']('registryentry',this[_0x84b4('0xe')][_0x84b4('0xf')](this));ami['on']('registry',this[_0x84b4('0xe')][_0x84b4('0xf')](this));ami['on'](_0x84b4('0x10'),this[_0x84b4('0x11')]['bind'](this));ami['on'](_0x84b4('0x12'),this['syncPeerStatus'][_0x84b4('0xf')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x84b4('0x13')]()['then'](ami[_0x84b4('0x14')]())[_0x84b4('0x15')](function(_0x51c889){logger[_0x84b4('0x16')](_0x84b4('0x17'),util[_0x84b4('0x18')](_0x51c889,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x84b4('0x13')]()[_0x84b4('0x19')](ami[_0x84b4('0x1a')]())[_0x84b4('0x15')](function(_0x2b13c3){logger[_0x84b4('0x16')](_0x84b4('0x1b'),util[_0x84b4('0x18')](_0x2b13c3,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x84b4('0x13')]()[_0x84b4('0x19')](ami[_0x84b4('0x1c')]())[_0x84b4('0x15')](function(_0x1574ed){logger[_0x84b4('0x16')](_0x84b4('0x1d'),util['inspect'](_0x1574ed,{'showHidden':![],'depth':null}));});}UserReport[_0x84b4('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x84b4('0x19')](showSipRegistrations())[_0x84b4('0x19')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x84b4('0x1e')][_0x84b4('0x1f')]=function(_0x4d4b8b){return _0x4d4b8b!==null&&!_[_0x84b4('0x20')](_0x4d4b8b);};UserReport[_0x84b4('0x1e')][_0x84b4('0x21')]=function(_0x33bf7d,_0x25b65c,_0x2c7775){io['to'](_0x33bf7d)[_0x84b4('0x21')](_0x25b65c,_0x2c7775);};UserReport[_0x84b4('0x1e')]['syncRegistry']=function(_0x5884f3){try{if(this[_0x84b4('0x1f')](_0x5884f3)){logger[_0x84b4('0x22')](_0x84b4('0x23'),_0x5884f3['username'],_0x5884f3[_0x84b4('0x24')]);logger[_0x84b4('0x25')](_0x84b4('0x26'),util['inspect'](_0x5884f3,{'showHidden':![],'depth':null}));var _0x3b7ea1=_[_0x84b4('0x27')](this[_0x84b4('0xc')],{'defaultuser':_0x5884f3[_0x84b4('0x28')]});if(_0x3b7ea1){_0x5884f3[_0x84b4('0x29')]=_0x5884f3[_0x84b4('0x24')];_[_0x84b4('0x2a')](_0x3b7ea1,_[_0x84b4('0x2b')](_0x5884f3,[_0x84b4('0x2c'),'actionid','username',_0x84b4('0x24')]));logger[_0x84b4('0x25')](_0x84b4('0x2d'),util[_0x84b4('0x18')](_0x3b7ea1,{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',_0x3b7ea1[_0x84b4('0x2e')]),_0x84b4('0x2f'),_0x3b7ea1);}}}catch(_0x5ca583){logger[_0x84b4('0x16')]('[userReport][registry]',util[_0x84b4('0x18')](_0x5ca583,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x84b4('0x11')]=function(_0x57ec54){try{if(this[_0x84b4('0x1f')](_0x57ec54)){logger['info'](_0x84b4('0x30'),_0x57ec54[_0x84b4('0x31')],_0x57ec54[_0x84b4('0x24')]);logger[_0x84b4('0x25')]('[userReport][devicestatechange]',util[_0x84b4('0x18')](_0x57ec54,{'showHidden':![],'depth':null}));if(this[_0x84b4('0x32')][_0x57ec54[_0x84b4('0x31')]]){if(!this[_0x84b4('0x32')][_0x57ec54['device']][_0x84b4('0x33')]||_0x57ec54[_0x84b4('0x24')]['toLowerCase']()==_0x84b4('0x34')){this[_0x84b4('0x32')][_0x57ec54[_0x84b4('0x31')]][_0x84b4('0x33')]=![];if(this['agents'][_0x57ec54[_0x84b4('0x31')]]['state']!==_0x57ec54[_0x84b4('0x24')][_0x84b4('0x35')]()){this[_0x84b4('0x32')][_0x57ec54['device']][_0x84b4('0x36')]=_[_0x84b4('0x37')](moment()[_0x84b4('0x38')]('x'));}this[_0x84b4('0x32')][_0x57ec54[_0x84b4('0x31')]]['state']=_0x57ec54[_0x84b4('0x24')][_0x84b4('0x35')]();this[_0x84b4('0x32')][_0x57ec54['device']]['updateStatusRealtime'](_0x57ec54);}}else if(this[_0x84b4('0xd')][_0x57ec54[_0x84b4('0x31')]]){if(this[_0x84b4('0xd')][_0x57ec54[_0x84b4('0x31')]][_0x84b4('0x24')]!==_0x57ec54['state'][_0x84b4('0x35')]()){this[_0x84b4('0xd')][_0x57ec54[_0x84b4('0x31')]]['stateTime']=_[_0x84b4('0x37')](moment()['format']('x'));}this['telephones'][_0x57ec54[_0x84b4('0x31')]]['state']=_0x57ec54[_0x84b4('0x24')]['toLowerCase']();logger['debug'](_0x84b4('0x39'),util[_0x84b4('0x18')](this[_0x84b4('0xd')][_0x57ec54[_0x84b4('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x84b4('0x38')](_0x84b4('0x3a'),this[_0x84b4('0xd')][_0x57ec54[_0x84b4('0x31')]][_0x84b4('0x2e')]),_0x84b4('0x3b'),this['telephones'][_0x57ec54['device']]);}else if(this[_0x84b4('0xc')][_0x57ec54['device']]){if(this[_0x84b4('0xc')][_0x57ec54[_0x84b4('0x31')]][_0x84b4('0x24')]!==_0x57ec54[_0x84b4('0x24')][_0x84b4('0x35')]()){this[_0x84b4('0xc')][_0x57ec54[_0x84b4('0x31')]][_0x84b4('0x36')]=_['toNumber'](moment()[_0x84b4('0x38')]('x'));}this[_0x84b4('0xc')][_0x57ec54['device']][_0x84b4('0x24')]=_0x57ec54['state']['toLowerCase']();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x84b4('0x18')](this['trunks'][_0x57ec54[_0x84b4('0x31')]],{'showHidden':![],'depth':null}));this[_0x84b4('0x21')](util['format'](_0x84b4('0x3c'),this[_0x84b4('0xc')][_0x57ec54[_0x84b4('0x31')]]['name']),_0x84b4('0x2f'),this['trunks'][_0x57ec54['device']]);}else if(_[_0x84b4('0x3d')](_0x57ec54[_0x84b4('0x31')],_0x84b4('0x3e'))){var _0x4185d4=_0x57ec54[_0x84b4('0x31')];var _0x5ed9fa=_0x4185d4['substring'](_0x4185d4['indexOf']('/')+0x1,_0x4185d4['indexOf']('@'));var _0x17c859=_[_0x84b4('0x27')](this['agents'],function(_0x3f318c){return _0x3f318c[_0x84b4('0x3f')]==_0x5ed9fa||_0x3f318c[_0x84b4('0x40')]==_0x5ed9fa||_0x3f318c[_0x84b4('0x41')]==_0x5ed9fa;});if(_0x17c859){if(_0x17c859[_0x84b4('0x24')]!==_0x57ec54[_0x84b4('0x24')]['toLowerCase']()){_0x17c859[_0x84b4('0x36')]=_[_0x84b4('0x37')](moment()['format']('x'));}_0x17c859[_0x84b4('0x24')]=_0x57ec54[_0x84b4('0x24')]['toLowerCase']();_0x17c859[_0x84b4('0x33')]=!![];_0x17c859[_0x84b4('0x42')](_0x57ec54);}}}}catch(_0x2d6557){logger[_0x84b4('0x16')](_0x84b4('0x43'),util[_0x84b4('0x18')](_0x2d6557,{'showHidden':![],'depth':null}));}};UserReport[_0x84b4('0x1e')][_0x84b4('0x44')]=function(_0x532d87){try{if(this[_0x84b4('0x1f')](_0x532d87)&&this[_0x84b4('0x1f')](_0x532d87[_0x84b4('0x12')])){logger['info'](_0x84b4('0x45'),_0x532d87[_0x84b4('0x46')],_0x532d87['address'],_0x532d87['peerstatus']);logger[_0x84b4('0x25')](_0x84b4('0x47'),util[_0x84b4('0x18')](_0x532d87,{'showHidden':![],'depth':null}));if(this[_0x84b4('0x32')][_0x532d87[_0x84b4('0x46')]]){if(!this[_0x84b4('0x32')][_0x532d87[_0x84b4('0x46')]][_0x84b4('0x33')]||_0x532d87[_0x84b4('0x12')][_0x84b4('0x35')]()==_0x84b4('0x48')){this['agents'][_0x532d87[_0x84b4('0x46')]][_0x84b4('0x33')]=![];this['agents'][_0x532d87[_0x84b4('0x46')]][_0x84b4('0x49')]=_0x532d87[_0x84b4('0x12')][_0x84b4('0x35')]();this[_0x84b4('0x32')][_0x532d87[_0x84b4('0x46')]][_0x84b4('0x4a')]=_0x532d87[_0x84b4('0x4a')];this[_0x84b4('0x32')][_0x532d87[_0x84b4('0x46')]]['updateStatusRealtime'](_0x532d87);}}else if(this['telephones'][_0x532d87['peer']]){this[_0x84b4('0xd')][_0x532d87[_0x84b4('0x46')]]['status']=_0x532d87[_0x84b4('0x12')][_0x84b4('0x35')]();this['telephones'][_0x532d87[_0x84b4('0x46')]]['address']=_0x532d87['address'];logger[_0x84b4('0x25')](_0x84b4('0x4b'),util['inspect'](this[_0x84b4('0xd')][_0x532d87[_0x84b4('0x46')]],{'showHidden':![],'depth':null}));this[_0x84b4('0x21')](util[_0x84b4('0x38')](_0x84b4('0x3a'),this[_0x84b4('0xd')][_0x532d87[_0x84b4('0x46')]][_0x84b4('0x2e')]),_0x84b4('0x3b'),this[_0x84b4('0xd')][_0x532d87[_0x84b4('0x46')]]);}else if(this[_0x84b4('0xc')][_0x532d87[_0x84b4('0x46')]]){this[_0x84b4('0xc')][_0x532d87[_0x84b4('0x46')]][_0x84b4('0x49')]=_0x532d87[_0x84b4('0x12')][_0x84b4('0x35')]();this[_0x84b4('0xc')][_0x532d87[_0x84b4('0x46')]]['address']=_0x532d87[_0x84b4('0x4a')];logger[_0x84b4('0x25')](_0x84b4('0x4c'),util[_0x84b4('0x18')](this[_0x84b4('0xc')][_0x532d87[_0x84b4('0x46')]],{'showHidden':![],'depth':null}));this[_0x84b4('0x21')](util[_0x84b4('0x38')](_0x84b4('0x3c'),this[_0x84b4('0xc')][_0x532d87[_0x84b4('0x46')]]['name']),'trunk:save',this[_0x84b4('0xc')][_0x532d87[_0x84b4('0x46')]]);}}}catch(_0x927ef3){logger[_0x84b4('0x16')](_0x84b4('0x47'),util[_0x84b4('0x18')](_0x927ef3,{'showHidden':![],'depth':null}));}};module[_0x84b4('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index f95593b..fd3a48e 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6615=['syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','isNotNull','prototype','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','inspect','channels','isUndefined','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answeredelsewheredestinationuniqueid','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','talktime','acw','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','agentcompleteAt','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','socket.io-emitter','voiceChannels','voiceQueues','agents','variables','agentcalled','bind','agentconnect'];(function(_0x13b70f,_0x5c1116){var _0x51427c=function(_0x54bb0b){while(--_0x54bb0b){_0x13b70f['push'](_0x13b70f['shift']());}};_0x51427c(++_0x5c1116);}(_0x6615,0x8f));var _0x5661=function(_0x315b61,_0x4bb11e){_0x315b61=_0x315b61-0x0;var _0x3521e8=_0x6615[_0x315b61];return _0x3521e8;};'use strict';var _=require(_0x5661('0x0'));var moment=require(_0x5661('0x1'));var util=require('util');var Redis=require(_0x5661('0x2'));var config=require(_0x5661('0x3'));var logger=require(_0x5661('0x4'))(_0x5661('0x5'));var ami=require('../ami');config['redis']=_[_0x5661('0x6')](config[_0x5661('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5661('0x8'))(new Redis(config[_0x5661('0x7')]));function VoiceAgentReport(_0x17ecda){this['channels']={};this[_0x5661('0x9')]=_0x17ecda['channels'];this[_0x5661('0xa')]=_0x17ecda[_0x5661('0xa')];this[_0x5661('0xb')]=_0x17ecda['agents'];this[_0x5661('0xc')]={};ami['on'](_0x5661('0xd'),this['syncAgentCalled'][_0x5661('0xe')](this));ami['on'](_0x5661('0xf'),this[_0x5661('0x10')][_0x5661('0xe')](this));ami['on']('agentringnoanswer',this[_0x5661('0x11')][_0x5661('0xe')](this));ami['on'](_0x5661('0x12'),this['syncQueueCallerAbandon'][_0x5661('0xe')](this));ami['on'](_0x5661('0x13'),this[_0x5661('0x14')][_0x5661('0xe')](this));ami['on'](_0x5661('0x15'),this[_0x5661('0x16')]['bind'](this));ami['on'](_0x5661('0x17'),this[_0x5661('0x18')][_0x5661('0xe')](this));ami['on'](_0x5661('0x19'),this['syncMusicOnHoldStart'][_0x5661('0xe')](this));ami['on'](_0x5661('0x1a'),this[_0x5661('0x1b')][_0x5661('0xe')](this));ami['on']('attendedtransfer',this[_0x5661('0x1c')][_0x5661('0xe')](this));ami['on'](_0x5661('0x1d'),this[_0x5661('0x1e')][_0x5661('0xe')](this));}VoiceAgentReport['prototype']['emit']=function(_0x1343f0,_0x2be48d,_0x56080d){io['to'](_0x1343f0)[_0x5661('0x1f')](_0x2be48d,_0x56080d);};VoiceAgentReport['prototype'][_0x5661('0x20')]=function(_0x4ea382){return _0x4ea382!==null&&!_['isUndefined'](_0x4ea382);};VoiceAgentReport[_0x5661('0x21')][_0x5661('0x22')]=function(_0x1d78e3){try{if(this[_0x5661('0x20')](_0x1d78e3)){logger[_0x5661('0x23')](_0x5661('0x24'),_0x1d78e3[_0x5661('0x25')],_0x1d78e3[_0x5661('0x26')],_0x1d78e3[_0x5661('0x27')]);logger[_0x5661('0x28')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x1d78e3[_0x5661('0x25')],util[_0x5661('0x29')](_0x1d78e3,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0x1d78e3[_0x5661('0x25')]])){this[_0x5661('0x2a')][_0x1d78e3[_0x5661('0x25')]]={};}if(_[_0x5661('0x2b')](this[_0x5661('0x2a')][_0x1d78e3[_0x5661('0x25')]][_0x1d78e3[_0x5661('0x27')]])){this[_0x5661('0x2a')][_0x1d78e3['uniqueid']][_0x1d78e3['destuniqueid']]={'agentcalledAt':moment()[_0x5661('0x2c')](_0x5661('0x2d')),'lastevent':'called','mandatoryDisposition':this['voiceQueues'][_0x1d78e3[_0x5661('0x2e')]]?this[_0x5661('0xa')][_0x1d78e3[_0x5661('0x2e')]][_0x5661('0x2f')]||![]:![],'type':this['voiceQueues'][_0x1d78e3[_0x5661('0x2e')]]?this[_0x5661('0xa')][_0x1d78e3[_0x5661('0x2e')]][_0x5661('0x30')]||_0x5661('0x31'):_0x5661('0x31'),'variables':this[_0x5661('0xc')][_0x1d78e3['uniqueid']],'motionChannel':_0x5661('0x32')};}_['merge'](this[_0x5661('0x2a')][_0x1d78e3['uniqueid']][_0x1d78e3['destuniqueid']],_[_0x5661('0x33')](_0x1d78e3,[_0x5661('0x34'),'privilege']));logger[_0x5661('0x28')](_0x5661('0x35'),_0x1d78e3[_0x5661('0x25')],util[_0x5661('0x29')](this[_0x5661('0x2a')][_0x1d78e3[_0x5661('0x25')]][_0x1d78e3[_0x5661('0x27')]],{'showHidden':![],'depth':null}));ami[_0x5661('0x1f')](_0x5661('0x36'),this[_0x5661('0x2a')][_0x1d78e3[_0x5661('0x25')]][_0x1d78e3['destuniqueid']]);logger[_0x5661('0x28')](_0x5661('0x37'),_0x1d78e3[_0x5661('0x25')],util[_0x5661('0x29')](this[_0x5661('0x2a')][_0x1d78e3[_0x5661('0x25')]][_0x1d78e3['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x5661('0x1f')](util[_0x5661('0x2c')](_0x5661('0x38'),_0x1d78e3[_0x5661('0x26')]),_0x5661('0x39'),this[_0x5661('0x2a')][_0x1d78e3[_0x5661('0x25')]][_0x1d78e3[_0x5661('0x27')]]);}}catch(_0x115fc1){logger[_0x5661('0x3a')](_0x5661('0x3b'),_0x1d78e3[_0x5661('0x25')],util[_0x5661('0x29')](_0x115fc1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5661('0x10')]=function(_0x21c291){try{if(this[_0x5661('0x20')](_0x21c291)){if(this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]]){logger['debug'](_0x5661('0x3c'),_0x21c291[_0x5661('0x25')],util[_0x5661('0x29')](_0x21c291,{'showHidden':![],'depth':null}));for(var _0x140d5e in this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]]){if(this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x5661('0x3d')](_0x140d5e)){if(_0x21c291[_0x5661('0x27')]===_0x140d5e){logger[_0x5661('0x23')](_0x5661('0x3e'),_0x21c291['uniqueid'],_0x21c291[_0x5661('0x26')],_0x21c291[_0x5661('0x27')]);this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x3f')]=moment()['format'](_0x5661('0x2d'));this['channels'][_0x21c291['uniqueid']][_0x140d5e]['connectedlinename']=_0x21c291[_0x5661('0x40')];this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x41')]=_0x21c291[_0x5661('0x41')];this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e]['destchannelstate']=_0x21c291[_0x5661('0x42')];this[_0x5661('0x2a')][_0x21c291['uniqueid']][_0x140d5e]['destchannelstatedesc']=_0x21c291[_0x5661('0x43')];this[_0x5661('0x2a')][_0x21c291['uniqueid']][_0x140d5e][_0x5661('0x44')]=_0x21c291[_0x5661('0x44')];this['channels'][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x45')]=_0x5661('0x46');if(this[_0x5661('0x9')][this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x25')]]){var _0x51da6d=this[_0x5661('0x9')][this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e]['uniqueid']][_0x5661('0x47')];this[_0x5661('0x2a')][_0x21c291['uniqueid']][_0x140d5e][_0x5661('0x47')]=_0x51da6d;_0x21c291[_0x5661('0x47')]=_0x51da6d;}_[_0x5661('0x48')](this['agents'][_0x21c291[_0x5661('0x49')]],_[_0x5661('0x4a')](_0x21c291,[_0x5661('0x2e'),_0x5661('0x4b'),_0x5661('0x47')]));logger['debug'](_0x5661('0x4c'),_0x21c291[_0x5661('0x25')],util[_0x5661('0x29')](this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x21c291[_0x5661('0x27')]],{'showHidden':![],'depth':null}));ami['emit'](_0x5661('0x4d'),this['channels'][_0x21c291[_0x5661('0x25')]][_0x21c291[_0x5661('0x27')]]);logger['debug'](_0x5661('0x4e'),_0x21c291[_0x5661('0x25')],util[_0x5661('0x29')](this['channels'][_0x21c291[_0x5661('0x25')]][_0x21c291['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x5661('0x1f')](util[_0x5661('0x2c')](_0x5661('0x38'),_0x21c291[_0x5661('0x26')]),_0x5661('0x4f'),this[_0x5661('0x2a')][_0x21c291['uniqueid']][_0x21c291[_0x5661('0x27')]]);}else if(!this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x50')]&&!this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x13')]){logger[_0x5661('0x23')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x21c291['uniqueid'],this['channels'][_0x21c291['uniqueid']][_0x140d5e]['membername'],_0x140d5e);this['channels'][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x50')]=!![];this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x51')]=moment()[_0x5661('0x2c')](_0x5661('0x2d'));this['channels'][_0x21c291[_0x5661('0x25')]][_0x140d5e][_0x5661('0x52')]=_0x21c291['destuniqueid'];this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e]['answeredelsewheremembername']=_0x21c291['membername'];this['channels'][_0x21c291['uniqueid']][_0x140d5e]['lastevent']='answered_elsewhere';this[_0x5661('0x2a')][_0x21c291['uniqueid']][_0x140d5e][_0x5661('0x53')]=_0x5661('0x54');logger[_0x5661('0x28')](_0x5661('0x55'),_0x21c291[_0x5661('0x25')],util[_0x5661('0x29')](this[_0x5661('0x2a')][_0x21c291[_0x5661('0x25')]][_0x140d5e],{'showHidden':![],'depth':null}));ami[_0x5661('0x1f')](_0x5661('0x56'),this['channels'][_0x21c291[_0x5661('0x25')]][_0x140d5e]);}}}}}}catch(_0x31b4b6){logger[_0x5661('0x3a')](_0x5661('0x57'),_0x21c291['uniqueid'],util['inspect'](_0x31b4b6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5661('0x11')]=function(_0x4ec9bc){try{if(this['isNotNull'](_0x4ec9bc)){logger[_0x5661('0x28')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x4ec9bc[_0x5661('0x25')],util[_0x5661('0x29')](_0x4ec9bc,{'showHidden':![],'depth':null}));if(this[_0x5661('0x2a')][_0x4ec9bc[_0x5661('0x25')]]&&this[_0x5661('0x2a')][_0x4ec9bc[_0x5661('0x25')]][_0x4ec9bc['destuniqueid']]){logger[_0x5661('0x23')](_0x5661('0x58'),_0x4ec9bc[_0x5661('0x25')],_0x4ec9bc[_0x5661('0x26')],_0x4ec9bc[_0x5661('0x27')]);this[_0x5661('0x2a')][_0x4ec9bc['uniqueid']][_0x4ec9bc[_0x5661('0x27')]]['agentringnoanswer']=!![];this[_0x5661('0x2a')][_0x4ec9bc[_0x5661('0x25')]][_0x4ec9bc[_0x5661('0x27')]][_0x5661('0x51')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x5661('0x2a')][_0x4ec9bc[_0x5661('0x25')]][_0x4ec9bc[_0x5661('0x27')]][_0x5661('0x45')]=_0x5661('0x59');this[_0x5661('0x2a')][_0x4ec9bc[_0x5661('0x25')]][_0x4ec9bc[_0x5661('0x27')]][_0x5661('0x53')]=_0x5661('0x59');logger['debug'](_0x5661('0x5a'),_0x4ec9bc['uniqueid'],util[_0x5661('0x29')](this[_0x5661('0x2a')][_0x4ec9bc['uniqueid']][_0x4ec9bc['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x5661('0x1f')](_0x5661('0x5b'),this['channels'][_0x4ec9bc[_0x5661('0x25')]][_0x4ec9bc[_0x5661('0x27')]]);}}}catch(_0x265c6f){logger[_0x5661('0x3a')](_0x5661('0x5c'),_0x4ec9bc[_0x5661('0x25')],util['inspect'](_0x265c6f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5661('0x21')][_0x5661('0x5d')]=function(_0x5ecd1a){try{if(this[_0x5661('0x20')](_0x5ecd1a)){logger[_0x5661('0x28')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x5ecd1a[_0x5661('0x25')],util[_0x5661('0x29')](_0x5ecd1a,{'showHidden':![],'depth':null}));if(this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]]){for(var _0x5874d6 in this[_0x5661('0x2a')][_0x5ecd1a['uniqueid']]){if(this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]][_0x5661('0x3d')](_0x5874d6)&&!this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]][_0x5874d6][_0x5661('0x50')]&&!this[_0x5661('0x2a')][_0x5ecd1a['uniqueid']][_0x5874d6][_0x5661('0x13')]){logger[_0x5661('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x5ecd1a[_0x5661('0x25')],this['channels'][_0x5ecd1a['uniqueid']][_0x5874d6]['membername'],_0x5874d6);this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]][_0x5874d6][_0x5661('0x50')]=!![];this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]][_0x5874d6][_0x5661('0x51')]=moment()[_0x5661('0x2c')](_0x5661('0x2d'));this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]][_0x5874d6][_0x5661('0x45')]=_0x5661('0x5e');this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]][_0x5874d6][_0x5661('0x53')]=_0x5661('0x5e');logger[_0x5661('0x28')](_0x5661('0x5f'),_0x5ecd1a[_0x5661('0x25')],util[_0x5661('0x29')](this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]][_0x5874d6],{'showHidden':![],'depth':null}));ami[_0x5661('0x1f')](_0x5661('0x60'),this[_0x5661('0x2a')][_0x5ecd1a[_0x5661('0x25')]][_0x5874d6]);}}}}}catch(_0x25baa4){logger[_0x5661('0x3a')](_0x5661('0x61'),_0x5ecd1a[_0x5661('0x25')],util[_0x5661('0x29')](_0x25baa4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5661('0x21')]['syncAgentComplete']=function(_0x16619d){try{if(this[_0x5661('0x20')](_0x16619d)){logger[_0x5661('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x16619d[_0x5661('0x25')],util['inspect'](_0x16619d,{'showHidden':![],'depth':null}));if(this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]]){for(var _0x36f1fa in this[_0x5661('0x2a')][_0x16619d['uniqueid']]){if(this['channels'][_0x16619d['uniqueid']]['hasOwnProperty'](_0x36f1fa)){if(this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]][_0x36f1fa][_0x5661('0x3f')]&&!this['channels'][_0x16619d[_0x5661('0x25')]][_0x36f1fa][_0x5661('0x13')]){logger['info'](_0x5661('0x62'),_0x16619d[_0x5661('0x25')],this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]][_0x36f1fa][_0x5661('0x26')],_0x36f1fa);this[_0x5661('0x2a')][_0x16619d['uniqueid']][_0x36f1fa][_0x5661('0x13')]=!![];this['channels'][_0x16619d[_0x5661('0x25')]][_0x36f1fa]['agentcompleteAt']=moment()[_0x5661('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]][_0x36f1fa][_0x5661('0x45')]=_0x5661('0x63');this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]][_0x36f1fa][_0x5661('0x53')]=_0x16619d[_0x5661('0x53')]==_0x5661('0x64')?_0x5661('0x65'):_0x16619d[_0x5661('0x53')];this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]][_0x36f1fa]['talktime']=_0x16619d[_0x5661('0x66')];if(this[_0x5661('0xa')][_0x16619d['queue']]&&this[_0x5661('0xa')][_0x16619d[_0x5661('0x2e')]][_0x5661('0x67')]){this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]][_0x36f1fa]['acwtime']=this[_0x5661('0xa')][_0x16619d[_0x5661('0x2e')]]['acwTimeout'];this['channels'][_0x16619d[_0x5661('0x25')]][_0x36f1fa][_0x5661('0x68')]=!![];}this[_0x5661('0xb')][_0x16619d['interface']]=_['omit'](this['agents'][_0x16619d['interface']],['queue','destconnectedlinenum']);logger[_0x5661('0x28')](_0x5661('0x69'),_0x16619d['uniqueid'],util[_0x5661('0x29')](this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]][_0x36f1fa],{'showHidden':![],'depth':null}));ami['emit'](_0x5661('0x6a'),this['channels'][_0x16619d[_0x5661('0x25')]][_0x36f1fa]);logger[_0x5661('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x16619d[_0x5661('0x25')],util[_0x5661('0x29')](this[_0x5661('0x2a')][_0x16619d['uniqueid']][_0x36f1fa],{'showHidden':![],'depth':null}));this[_0x5661('0x1f')](util[_0x5661('0x2c')](_0x5661('0x38'),_0x16619d[_0x5661('0x26')]),_0x5661('0x6b'),this[_0x5661('0x2a')][_0x16619d[_0x5661('0x25')]][_0x36f1fa]);}}}}}}catch(_0x12cc70){logger['error'](_0x5661('0x6c'),_0x16619d['uniqueid'],util[_0x5661('0x29')](_0x12cc70,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5661('0x21')][_0x5661('0x16')]=function(_0x205f9d){try{if(this['isNotNull'](_0x205f9d)){logger[_0x5661('0x28')]('[%s][voiceAgentReport][varset]\x20event:',_0x205f9d[_0x5661('0x25')],util['inspect'](_0x205f9d,{'showHidden':![],'depth':null}));this['addVariable'](_0x205f9d[_0x5661('0x25')],_['keys'](_0x205f9d[_0x5661('0x6d')])[0x0],_0x205f9d[_0x5661('0x6e')]);if(this[_0x5661('0x2a')][_0x205f9d[_0x5661('0x25')]]){for(var _0x4b1f95 in this['channels'][_0x205f9d[_0x5661('0x25')]]){if(this[_0x5661('0x2a')][_0x205f9d['uniqueid']][_0x5661('0x3d')](_0x4b1f95)){logger[_0x5661('0x23')](_0x5661('0x6f'),_0x205f9d[_0x5661('0x25')],_0x4b1f95,_[_0x5661('0x70')](_0x205f9d[_0x5661('0x6d')])[0x0],_0x205f9d[_0x5661('0x6e')]);if(_[_0x5661('0x2b')](this[_0x5661('0x2a')][_0x205f9d[_0x5661('0x25')]][_0x4b1f95][_0x5661('0xc')])){this[_0x5661('0x2a')][_0x205f9d[_0x5661('0x25')]][_0x4b1f95][_0x5661('0xc')]={};}this[_0x5661('0x2a')][_0x205f9d[_0x5661('0x25')]][_0x4b1f95][_0x5661('0xc')]=this[_0x5661('0xc')][_0x205f9d[_0x5661('0x25')]];}}}}}catch(_0x6927d2){logger[_0x5661('0x3a')](_0x5661('0x71'),_0x205f9d[_0x5661('0x25')],util[_0x5661('0x29')](_0x6927d2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5661('0x21')]['addVariable']=function(_0x5b51fe,_0x2c6b12,_0x1a5403){var _0x2cb465=[_0x5661('0x72'),_0x5661('0x73'),_0x5661('0x74'),_0x5661('0x75'),'rtpaudioqosloss',_0x5661('0x76'),'rtpaudioqosrtt',_0x5661('0x77'),_0x5661('0x78'),_0x5661('0x79'),_0x5661('0x7a'),_0x5661('0x7b'),_0x5661('0x7c'),_0x5661('0x7d'),_0x5661('0x7e'),'memberlastcall',_0x5661('0x26'),_0x5661('0x7f'),_0x5661('0x80')];if(!_['isNil'](_0x2c6b12)&&!_[_0x5661('0x81')](_0x2cb465,_0x2c6b12)){if(_[_0x5661('0x2b')](this[_0x5661('0xc')][_0x5b51fe])){this[_0x5661('0xc')][_0x5b51fe]={};}this[_0x5661('0xc')][_0x5b51fe][_0x2c6b12]=_0x1a5403;}};VoiceAgentReport[_0x5661('0x21')]['syncHangup']=function(_0x4b73b3){try{if(this[_0x5661('0x20')](_0x4b73b3)){logger[_0x5661('0x28')](_0x5661('0x82'),_0x4b73b3[_0x5661('0x25')],util[_0x5661('0x29')](_0x4b73b3,{'showHidden':![],'depth':null}));if(this['channels'][_0x4b73b3['uniqueid']]){for(var _0x517875 in this[_0x5661('0x2a')][_0x4b73b3[_0x5661('0x25')]]){if(this[_0x5661('0x2a')][_0x4b73b3['uniqueid']][_0x5661('0x3d')](_0x517875)){if(this[_0x5661('0x2a')][_0x4b73b3[_0x5661('0x25')]][_0x517875]['reason']=='transfer'&&this[_0x5661('0x2a')][_0x4b73b3[_0x5661('0x25')]][_0x517875][_0x5661('0x13')]){logger[_0x5661('0x23')](_0x5661('0x83'),_0x4b73b3[_0x5661('0x25')],_0x517875);this['channels'][_0x4b73b3[_0x5661('0x25')]][_0x517875]['agentcompleteAt']=moment()[_0x5661('0x2c')](_0x5661('0x2d'));}}}logger[_0x5661('0x28')](_0x5661('0x84'),_0x4b73b3['uniqueid'],util[_0x5661('0x29')](_[_0x5661('0x85')](this['channels'][_0x4b73b3[_0x5661('0x25')]]),{'showHidden':![],'depth':null}));ami[_0x5661('0x1f')](_0x5661('0x86'),_[_0x5661('0x85')](this[_0x5661('0x2a')][_0x4b73b3['uniqueid']]));delete this[_0x5661('0x2a')][_0x4b73b3[_0x5661('0x25')]];}if(this[_0x5661('0xc')][_0x4b73b3[_0x5661('0x25')]]){delete this[_0x5661('0xc')][_0x4b73b3['uniqueid']];}}}catch(_0x324b52){logger[_0x5661('0x3a')](_0x5661('0x87'),_0x4b73b3[_0x5661('0x25')],util[_0x5661('0x29')](_0x324b52,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5661('0x21')][_0x5661('0x1c')]=function(_0x1c669){try{if(this['isNotNull'](_0x1c669)){logger[_0x5661('0x28')](_0x5661('0x88'),_0x1c669[_0x5661('0x25')],util[_0x5661('0x29')](_0x1c669,{'showHidden':![],'depth':null}));if(this[_0x5661('0x2a')][_0x1c669[_0x5661('0x89')]]){for(var _0xe08167 in this['channels'][_0x1c669[_0x5661('0x89')]]){if(this['channels'][_0x1c669['transfereeuniqueid']][_0x5661('0x3d')](_0xe08167)){if(_0x1c669[_0x5661('0x8a')]===_0xe08167){logger[_0x5661('0x23')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1c669[_0x5661('0x25')],this[_0x5661('0x2a')][_0x1c669[_0x5661('0x89')]][_0xe08167][_0x5661('0x26')],_0xe08167);var _0xfa0899=moment();this[_0x5661('0x2a')][_0x1c669[_0x5661('0x89')]][_0xe08167]['agentcomplete']=!![];this['channels'][_0x1c669[_0x5661('0x89')]][_0xe08167][_0x5661('0x8b')]=moment()[_0x5661('0x2c')](_0x5661('0x2d'));this['channels'][_0x1c669[_0x5661('0x89')]][_0xe08167][_0x5661('0x45')]=_0x5661('0x63');this[_0x5661('0x2a')][_0x1c669[_0x5661('0x89')]][_0xe08167][_0x5661('0x53')]='transfer';this[_0x5661('0x2a')][_0x1c669[_0x5661('0x89')]][_0xe08167][_0x5661('0x66')]=_0xfa0899[_0x5661('0x8c')](this[_0x5661('0x2a')][_0x1c669[_0x5661('0x89')]][_0xe08167]['agentconnectAt'],_0x5661('0x8d'));}}}}if(this[_0x5661('0x2a')][_0x1c669[_0x5661('0x8e')]]){var _0x212d9a=this['channels'][_0x1c669[_0x5661('0x8e')]];this[_0x5661('0x2a')][_0x1c669[_0x5661('0x8e')]]=this[_0x5661('0x2a')][_0x1c669[_0x5661('0x89')]];this[_0x5661('0x2a')][_0x1c669[_0x5661('0x89')]]=_0x212d9a;}}}catch(_0x42ce91){logger[_0x5661('0x3a')](_0x5661('0x8f'),_0x1c669['uniqueid'],util[_0x5661('0x29')](_0x42ce91,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5661('0x1e')]=function(_0x4cb8a9){try{if(this[_0x5661('0x20')](_0x4cb8a9)){logger[_0x5661('0x28')](_0x5661('0x90'),_0x4cb8a9['uniqueid'],util[_0x5661('0x29')](_0x4cb8a9,{'showHidden':![],'depth':null}));if(this['channels'][_0x4cb8a9[_0x5661('0x89')]]){for(var _0x2a7cb9 in this['channels'][_0x4cb8a9[_0x5661('0x89')]]){if(this[_0x5661('0x2a')][_0x4cb8a9[_0x5661('0x89')]][_0x5661('0x3d')](_0x2a7cb9)){if(_0x4cb8a9[_0x5661('0x91')]===_0x2a7cb9){logger['info'](_0x5661('0x92'),_0x4cb8a9['uniqueid'],this['channels'][_0x4cb8a9[_0x5661('0x89')]][_0x2a7cb9][_0x5661('0x26')],_0x2a7cb9);var _0x41dd4a=moment();this[_0x5661('0x2a')][_0x4cb8a9[_0x5661('0x89')]][_0x2a7cb9][_0x5661('0x13')]=!![];this[_0x5661('0x2a')][_0x4cb8a9[_0x5661('0x89')]][_0x2a7cb9][_0x5661('0x8b')]=_0x41dd4a;this[_0x5661('0x2a')][_0x4cb8a9['transfereeuniqueid']][_0x2a7cb9][_0x5661('0x45')]=_0x5661('0x63');this[_0x5661('0x2a')][_0x4cb8a9[_0x5661('0x89')]][_0x2a7cb9][_0x5661('0x53')]='transfer';this[_0x5661('0x2a')][_0x4cb8a9[_0x5661('0x89')]][_0x2a7cb9]['talktime']=_0x41dd4a['diff'](this['channels'][_0x4cb8a9[_0x5661('0x89')]][_0x2a7cb9]['agentconnectAt'],'seconds');}}}}}}catch(_0x23438c){logger[_0x5661('0x3a')](_0x5661('0x93'),_0x4cb8a9[_0x5661('0x25')],util[_0x5661('0x29')](_0x23438c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5661('0x94')]=function(_0x1d92bc){var _0x4d0501='';try{if(this[_0x5661('0x20')](_0x1d92bc)){logger[_0x5661('0x28')](_0x5661('0x95'),_0x1d92bc['uniqueid'],util[_0x5661('0x29')](_0x1d92bc,{'showHidden':![],'depth':null}));if(_0x1d92bc['channel']){_0x4d0501=_0x1d92bc[_0x5661('0x96')][_0x5661('0x97')](0x0,_0x1d92bc[_0x5661('0x96')][_0x5661('0x98')]('-'));if(this[_0x5661('0xb')][_0x4d0501]){logger[_0x5661('0x23')](_0x5661('0x99'),_0x1d92bc[_0x5661('0x25')],_0x4d0501);this['agents'][_0x4d0501][_0x5661('0x9a')]=!![];}}}}catch(_0x594311){logger[_0x5661('0x3a')](_0x5661('0x9b'),_0x1d92bc['uniqueid'],util[_0x5661('0x29')](_0x594311,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5661('0x21')][_0x5661('0x1b')]=function(_0x209960){var _0x5cf903='';try{if(this[_0x5661('0x20')](_0x209960)){logger[_0x5661('0x28')](_0x5661('0x9c'),_0x209960[_0x5661('0x25')],util['inspect'](_0x209960,{'showHidden':![],'depth':null}));if(_0x209960['channel']){_0x5cf903=_0x209960[_0x5661('0x96')][_0x5661('0x97')](0x0,_0x209960[_0x5661('0x96')][_0x5661('0x98')]('-'));if(this[_0x5661('0xb')][_0x5cf903]){logger[_0x5661('0x23')](_0x5661('0x9d'),_0x209960[_0x5661('0x25')],_0x5cf903);this['agents'][_0x5cf903][_0x5661('0x9a')]=![];}}}}catch(_0x819214){logger[_0x5661('0x3a')](_0x5661('0x9e'),_0x209960[_0x5661('0x25')],util[_0x5661('0x29')](_0x819214,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x3c21=['syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstart','musiconholdstop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','syncAgentCalled','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','merge','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','interface','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','agentcompleteAt','complete','transfer','agent','talktime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','isUndefined','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','moment','ioredis','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon'];(function(_0x5e5d2d,_0x1a1edd){var _0x273120=function(_0x555e2b){while(--_0x555e2b){_0x5e5d2d['push'](_0x5e5d2d['shift']());}};_0x273120(++_0x1a1edd);}(_0x3c21,0x19e));var _0x13c2=function(_0x31898f,_0x219b2c){_0x31898f=_0x31898f-0x0;var _0x571ad9=_0x3c21[_0x31898f];return _0x571ad9;};'use strict';var _=require('lodash');var moment=require(_0x13c2('0x0'));var util=require('util');var Redis=require(_0x13c2('0x1'));var config=require('../../../config/environment');var logger=require(_0x13c2('0x2'))(_0x13c2('0x3'));var ami=require(_0x13c2('0x4'));config[_0x13c2('0x5')]=_['defaults'](config[_0x13c2('0x5')],{'host':_0x13c2('0x6'),'port':0x18eb});var io=require(_0x13c2('0x7'))(new Redis(config[_0x13c2('0x5')]));function VoiceAgentReport(_0xc30c80){this[_0x13c2('0x8')]={};this[_0x13c2('0x9')]=_0xc30c80[_0x13c2('0x8')];this[_0x13c2('0xa')]=_0xc30c80[_0x13c2('0xa')];this[_0x13c2('0xb')]=_0xc30c80[_0x13c2('0xb')];this[_0x13c2('0xc')]={};ami['on']('agentcalled',this['syncAgentCalled'][_0x13c2('0xd')](this));ami['on']('agentconnect',this[_0x13c2('0xe')]['bind'](this));ami['on'](_0x13c2('0xf'),this[_0x13c2('0x10')][_0x13c2('0xd')](this));ami['on'](_0x13c2('0x11'),this[_0x13c2('0x12')][_0x13c2('0xd')](this));ami['on'](_0x13c2('0x13'),this[_0x13c2('0x14')][_0x13c2('0xd')](this));ami['on'](_0x13c2('0x15'),this[_0x13c2('0x16')]['bind'](this));ami['on'](_0x13c2('0x17'),this['syncHangup'][_0x13c2('0xd')](this));ami['on'](_0x13c2('0x18'),this['syncMusicOnHoldStart'][_0x13c2('0xd')](this));ami['on'](_0x13c2('0x19'),this['syncMusicOnHoldStop'][_0x13c2('0xd')](this));ami['on']('attendedtransfer',this[_0x13c2('0x1a')][_0x13c2('0xd')](this));ami['on'](_0x13c2('0x1b'),this[_0x13c2('0x1c')][_0x13c2('0xd')](this));}VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x1e')]=function(_0x26a756,_0x3c486f,_0x5436e9){io['to'](_0x26a756)[_0x13c2('0x1e')](_0x3c486f,_0x5436e9);};VoiceAgentReport[_0x13c2('0x1d')]['isNotNull']=function(_0x2bef69){return _0x2bef69!==null&&!_['isUndefined'](_0x2bef69);};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x1f')]=function(_0x4f3e6b){try{if(this[_0x13c2('0x20')](_0x4f3e6b)){logger[_0x13c2('0x21')](_0x13c2('0x22'),_0x4f3e6b['uniqueid'],_0x4f3e6b[_0x13c2('0x23')],_0x4f3e6b[_0x13c2('0x24')]);logger[_0x13c2('0x25')](_0x13c2('0x26'),_0x4f3e6b[_0x13c2('0x27')],util['inspect'](_0x4f3e6b,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x13c2('0x8')][_0x4f3e6b['uniqueid']])){this[_0x13c2('0x8')][_0x4f3e6b[_0x13c2('0x27')]]={};}if(_['isUndefined'](this[_0x13c2('0x8')][_0x4f3e6b[_0x13c2('0x27')]][_0x4f3e6b[_0x13c2('0x24')]])){this[_0x13c2('0x8')][_0x4f3e6b[_0x13c2('0x27')]][_0x4f3e6b[_0x13c2('0x24')]]={'agentcalledAt':moment()[_0x13c2('0x28')](_0x13c2('0x29')),'lastevent':_0x13c2('0x2a'),'mandatoryDisposition':this[_0x13c2('0xa')][_0x4f3e6b[_0x13c2('0x2b')]]?this[_0x13c2('0xa')][_0x4f3e6b[_0x13c2('0x2b')]][_0x13c2('0x2c')]||![]:![],'type':this[_0x13c2('0xa')][_0x4f3e6b[_0x13c2('0x2b')]]?this['voiceQueues'][_0x4f3e6b[_0x13c2('0x2b')]][_0x13c2('0x2d')]||'inbound':_0x13c2('0x2e'),'variables':this[_0x13c2('0xc')][_0x4f3e6b[_0x13c2('0x27')]],'motionChannel':'voice'};}_[_0x13c2('0x2f')](this['channels'][_0x4f3e6b[_0x13c2('0x27')]][_0x4f3e6b[_0x13c2('0x24')]],_['omit'](_0x4f3e6b,[_0x13c2('0x30'),_0x13c2('0x31')]));logger[_0x13c2('0x25')](_0x13c2('0x32'),_0x4f3e6b['uniqueid'],util[_0x13c2('0x33')](this[_0x13c2('0x8')][_0x4f3e6b[_0x13c2('0x27')]][_0x4f3e6b[_0x13c2('0x24')]],{'showHidden':![],'depth':null}));ami[_0x13c2('0x1e')](_0x13c2('0x34'),this[_0x13c2('0x8')][_0x4f3e6b['uniqueid']][_0x4f3e6b[_0x13c2('0x24')]]);logger['debug'](_0x13c2('0x35'),_0x4f3e6b[_0x13c2('0x27')],util[_0x13c2('0x33')](this[_0x13c2('0x8')][_0x4f3e6b[_0x13c2('0x27')]][_0x4f3e6b['destuniqueid']],{'showHidden':![],'depth':null}));this['emit'](util[_0x13c2('0x28')]('user:%s',_0x4f3e6b[_0x13c2('0x23')]),'user:called',this['channels'][_0x4f3e6b[_0x13c2('0x27')]][_0x4f3e6b[_0x13c2('0x24')]]);}}catch(_0x1cbbc3){logger[_0x13c2('0x36')](_0x13c2('0x37'),_0x4f3e6b[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x1cbbc3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0xe')]=function(_0xf0b984){try{if(this['isNotNull'](_0xf0b984)){if(this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]]){logger['debug'](_0x13c2('0x38'),_0xf0b984[_0x13c2('0x27')],util[_0x13c2('0x33')](_0xf0b984,{'showHidden':![],'depth':null}));for(var _0x25cfb5 in this['channels'][_0xf0b984['uniqueid']]){if(this['channels'][_0xf0b984[_0x13c2('0x27')]]['hasOwnProperty'](_0x25cfb5)){if(_0xf0b984[_0x13c2('0x24')]===_0x25cfb5){logger[_0x13c2('0x21')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0xf0b984[_0x13c2('0x27')],_0xf0b984['membername'],_0xf0b984[_0x13c2('0x24')]);this['channels'][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5]['agentconnectAt']=moment()[_0x13c2('0x28')](_0x13c2('0x29'));this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5]['connectedlinename']=_0xf0b984[_0x13c2('0x39')];this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x3a')]=_0xf0b984[_0x13c2('0x3a')];this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x3b')]=_0xf0b984[_0x13c2('0x3b')];this['channels'][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5]['destchannelstatedesc']=_0xf0b984[_0x13c2('0x3c')];this['channels'][_0xf0b984['uniqueid']][_0x25cfb5][_0x13c2('0x3d')]=_0xf0b984[_0x13c2('0x3d')];this['channels'][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x3e')]='connect';if(this['voiceChannels'][this[_0x13c2('0x8')][_0xf0b984['uniqueid']][_0x25cfb5][_0x13c2('0x27')]]){var _0x123a78=this['voiceChannels'][this['channels'][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x27')]][_0x13c2('0x3f')];this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x3f')]=_0x123a78;_0xf0b984[_0x13c2('0x3f')]=_0x123a78;}_[_0x13c2('0x2f')](this[_0x13c2('0xb')][_0xf0b984[_0x13c2('0x40')]],_['pick'](_0xf0b984,[_0x13c2('0x2b'),_0x13c2('0x41'),_0x13c2('0x3f')]));logger[_0x13c2('0x25')](_0x13c2('0x42'),_0xf0b984['uniqueid'],util['inspect'](this['channels'][_0xf0b984[_0x13c2('0x27')]][_0xf0b984['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x13c2('0x1e')](_0x13c2('0x43'),this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0xf0b984['destuniqueid']]);logger[_0x13c2('0x25')](_0x13c2('0x44'),_0xf0b984[_0x13c2('0x27')],util[_0x13c2('0x33')](this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0xf0b984['destuniqueid']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x13c2('0x45'),_0xf0b984['membername']),_0x13c2('0x46'),this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0xf0b984['destuniqueid']]);}else if(!this['channels'][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0xf')]&&!this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x13')]){logger[_0x13c2('0x21')](_0x13c2('0x47'),_0xf0b984[_0x13c2('0x27')],this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x23')],_0x25cfb5);this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0xf')]=!![];this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5]['agentringnoanswerAt']=moment()[_0x13c2('0x28')](_0x13c2('0x29'));this['channels'][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5]['answeredelsewheredestinationuniqueid']=_0xf0b984['destuniqueid'];this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x48')]=_0xf0b984[_0x13c2('0x23')];this['channels'][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5][_0x13c2('0x3e')]=_0x13c2('0x49');this[_0x13c2('0x8')][_0xf0b984['uniqueid']][_0x25cfb5][_0x13c2('0x4a')]=_0x13c2('0x49');logger[_0x13c2('0x25')](_0x13c2('0x4b'),_0xf0b984['uniqueid'],util[_0x13c2('0x33')](this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5],{'showHidden':![],'depth':null}));ami[_0x13c2('0x1e')](_0x13c2('0x4c'),this[_0x13c2('0x8')][_0xf0b984[_0x13c2('0x27')]][_0x25cfb5]);}}}}}}catch(_0x1ad5e9){logger['error'](_0x13c2('0x4d'),_0xf0b984[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x1ad5e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x13c2('0x10')]=function(_0x4c9ddb){try{if(this[_0x13c2('0x20')](_0x4c9ddb)){logger[_0x13c2('0x25')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x4c9ddb[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x4c9ddb,{'showHidden':![],'depth':null}));if(this[_0x13c2('0x8')][_0x4c9ddb[_0x13c2('0x27')]]&&this[_0x13c2('0x8')][_0x4c9ddb['uniqueid']][_0x4c9ddb['destuniqueid']]){logger[_0x13c2('0x21')](_0x13c2('0x4e'),_0x4c9ddb[_0x13c2('0x27')],_0x4c9ddb[_0x13c2('0x23')],_0x4c9ddb['destuniqueid']);this['channels'][_0x4c9ddb['uniqueid']][_0x4c9ddb[_0x13c2('0x24')]][_0x13c2('0xf')]=!![];this[_0x13c2('0x8')][_0x4c9ddb[_0x13c2('0x27')]][_0x4c9ddb[_0x13c2('0x24')]][_0x13c2('0x4f')]=moment()[_0x13c2('0x28')](_0x13c2('0x29'));this[_0x13c2('0x8')][_0x4c9ddb[_0x13c2('0x27')]][_0x4c9ddb[_0x13c2('0x24')]]['lastevent']='rejected';this['channels'][_0x4c9ddb[_0x13c2('0x27')]][_0x4c9ddb['destuniqueid']][_0x13c2('0x4a')]=_0x13c2('0x50');logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x4c9ddb[_0x13c2('0x27')],util[_0x13c2('0x33')](this[_0x13c2('0x8')][_0x4c9ddb['uniqueid']][_0x4c9ddb['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x13c2('0x1e')](_0x13c2('0x51'),this[_0x13c2('0x8')][_0x4c9ddb[_0x13c2('0x27')]][_0x4c9ddb[_0x13c2('0x24')]]);}}}catch(_0x498c81){logger[_0x13c2('0x36')]('[%s][voiceAgentReport][agentringnoanswer]',_0x4c9ddb[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x498c81,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x12')]=function(_0x49205d){try{if(this['isNotNull'](_0x49205d)){logger['debug'](_0x13c2('0x52'),_0x49205d[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x49205d,{'showHidden':![],'depth':null}));if(this['channels'][_0x49205d['uniqueid']]){for(var _0x34a461 in this[_0x13c2('0x8')][_0x49205d[_0x13c2('0x27')]]){if(this[_0x13c2('0x8')][_0x49205d[_0x13c2('0x27')]][_0x13c2('0x53')](_0x34a461)&&!this[_0x13c2('0x8')][_0x49205d['uniqueid']][_0x34a461]['agentringnoanswer']&&!this[_0x13c2('0x8')][_0x49205d[_0x13c2('0x27')]][_0x34a461]['agentcomplete']){logger[_0x13c2('0x21')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x49205d[_0x13c2('0x27')],this[_0x13c2('0x8')][_0x49205d[_0x13c2('0x27')]][_0x34a461][_0x13c2('0x23')],_0x34a461);this[_0x13c2('0x8')][_0x49205d[_0x13c2('0x27')]][_0x34a461][_0x13c2('0xf')]=!![];this[_0x13c2('0x8')][_0x49205d[_0x13c2('0x27')]][_0x34a461]['agentringnoanswerAt']=moment()[_0x13c2('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x49205d[_0x13c2('0x27')]][_0x34a461][_0x13c2('0x3e')]='abandoned';this[_0x13c2('0x8')][_0x49205d[_0x13c2('0x27')]][_0x34a461][_0x13c2('0x4a')]=_0x13c2('0x54');logger[_0x13c2('0x25')](_0x13c2('0x55'),_0x49205d[_0x13c2('0x27')],util[_0x13c2('0x33')](this['channels'][_0x49205d[_0x13c2('0x27')]][_0x34a461],{'showHidden':![],'depth':null}));ami[_0x13c2('0x1e')]('custom:agentqueuecallerabandon',this['channels'][_0x49205d[_0x13c2('0x27')]][_0x34a461]);}}}}}catch(_0x9968f2){logger[_0x13c2('0x36')](_0x13c2('0x56'),_0x49205d[_0x13c2('0x27')],util['inspect'](_0x9968f2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')]['syncAgentComplete']=function(_0x5dfbac){try{if(this[_0x13c2('0x20')](_0x5dfbac)){logger[_0x13c2('0x25')](_0x13c2('0x57'),_0x5dfbac[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x5dfbac,{'showHidden':![],'depth':null}));if(this[_0x13c2('0x8')][_0x5dfbac['uniqueid']]){for(var _0x50d524 in this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]]){if(this['channels'][_0x5dfbac[_0x13c2('0x27')]]['hasOwnProperty'](_0x50d524)){if(this['channels'][_0x5dfbac[_0x13c2('0x27')]][_0x50d524][_0x13c2('0x58')]&&!this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]][_0x50d524][_0x13c2('0x13')]){logger[_0x13c2('0x21')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5dfbac[_0x13c2('0x27')],this['channels'][_0x5dfbac[_0x13c2('0x27')]][_0x50d524]['membername'],_0x50d524);this[_0x13c2('0x8')][_0x5dfbac['uniqueid']][_0x50d524][_0x13c2('0x13')]=!![];this[_0x13c2('0x8')][_0x5dfbac['uniqueid']][_0x50d524][_0x13c2('0x59')]=moment()[_0x13c2('0x28')](_0x13c2('0x29'));this[_0x13c2('0x8')][_0x5dfbac['uniqueid']][_0x50d524][_0x13c2('0x3e')]=_0x13c2('0x5a');this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]][_0x50d524]['reason']=_0x5dfbac[_0x13c2('0x4a')]==_0x13c2('0x5b')?_0x13c2('0x5c'):_0x5dfbac[_0x13c2('0x4a')];this['channels'][_0x5dfbac[_0x13c2('0x27')]][_0x50d524][_0x13c2('0x5d')]=_0x5dfbac[_0x13c2('0x5d')];if(this[_0x13c2('0xa')][_0x5dfbac[_0x13c2('0x2b')]]&&this['voiceQueues'][_0x5dfbac[_0x13c2('0x2b')]]['acw']){this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]][_0x50d524]['acwtime']=this['voiceQueues'][_0x5dfbac[_0x13c2('0x2b')]]['acwTimeout'];this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]][_0x50d524][_0x13c2('0x5e')]=!![];}this[_0x13c2('0xb')][_0x5dfbac[_0x13c2('0x40')]]=_['omit'](this[_0x13c2('0xb')][_0x5dfbac[_0x13c2('0x40')]],['queue',_0x13c2('0x41')]);logger[_0x13c2('0x25')](_0x13c2('0x5f'),_0x5dfbac['uniqueid'],util[_0x13c2('0x33')](this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]][_0x50d524],{'showHidden':![],'depth':null}));ami['emit'](_0x13c2('0x60'),this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]][_0x50d524]);logger[_0x13c2('0x25')](_0x13c2('0x61'),_0x5dfbac[_0x13c2('0x27')],util['inspect'](this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]][_0x50d524],{'showHidden':![],'depth':null}));this[_0x13c2('0x1e')](util['format'](_0x13c2('0x45'),_0x5dfbac[_0x13c2('0x23')]),'user:agentcomplete',this[_0x13c2('0x8')][_0x5dfbac[_0x13c2('0x27')]][_0x50d524]);}}}}}}catch(_0x43d37d){logger[_0x13c2('0x36')](_0x13c2('0x62'),_0x5dfbac[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x43d37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x16')]=function(_0x1a32cd){try{if(this[_0x13c2('0x20')](_0x1a32cd)){logger[_0x13c2('0x25')](_0x13c2('0x63'),_0x1a32cd[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x1a32cd,{'showHidden':![],'depth':null}));this[_0x13c2('0x64')](_0x1a32cd[_0x13c2('0x27')],_[_0x13c2('0x65')](_0x1a32cd['variable'])[0x0],_0x1a32cd[_0x13c2('0x66')]);if(this[_0x13c2('0x8')][_0x1a32cd[_0x13c2('0x27')]]){for(var _0x2bc094 in this[_0x13c2('0x8')][_0x1a32cd[_0x13c2('0x27')]]){if(this['channels'][_0x1a32cd[_0x13c2('0x27')]][_0x13c2('0x53')](_0x2bc094)){logger[_0x13c2('0x21')](_0x13c2('0x67'),_0x1a32cd['uniqueid'],_0x2bc094,_[_0x13c2('0x65')](_0x1a32cd[_0x13c2('0x68')])[0x0],_0x1a32cd[_0x13c2('0x66')]);if(_[_0x13c2('0x69')](this[_0x13c2('0x8')][_0x1a32cd[_0x13c2('0x27')]][_0x2bc094][_0x13c2('0xc')])){this[_0x13c2('0x8')][_0x1a32cd[_0x13c2('0x27')]][_0x2bc094][_0x13c2('0xc')]={};}this[_0x13c2('0x8')][_0x1a32cd[_0x13c2('0x27')]][_0x2bc094][_0x13c2('0xc')]=this[_0x13c2('0xc')][_0x1a32cd['uniqueid']];}}}}}catch(_0x2550e9){logger[_0x13c2('0x36')](_0x13c2('0x6a'),_0x1a32cd[_0x13c2('0x27')],util['inspect'](_0x2550e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x64')]=function(_0x8b8790,_0x3b6ca2,_0x5eb305){var _0x3f87a4=['rtpaudioqos',_0x13c2('0x6b'),_0x13c2('0x6c'),_0x13c2('0x6d'),'rtpaudioqosloss',_0x13c2('0x6e'),_0x13c2('0x6f'),_0x13c2('0x70'),_0x13c2('0x71'),_0x13c2('0x72'),_0x13c2('0x73'),'bridgepvtcallid',_0x13c2('0x74'),_0x13c2('0x75'),'memberinterface','memberlastcall',_0x13c2('0x23'),_0x13c2('0x76'),_0x13c2('0x77')];if(!_[_0x13c2('0x78')](_0x3b6ca2)&&!_[_0x13c2('0x79')](_0x3f87a4,_0x3b6ca2)){if(_['isUndefined'](this[_0x13c2('0xc')][_0x8b8790])){this[_0x13c2('0xc')][_0x8b8790]={};}this[_0x13c2('0xc')][_0x8b8790][_0x3b6ca2]=_0x5eb305;}};VoiceAgentReport['prototype'][_0x13c2('0x7a')]=function(_0x4cc207){try{if(this[_0x13c2('0x20')](_0x4cc207)){logger[_0x13c2('0x25')]('[%s][voiceAgentReport][hangup]\x20event:',_0x4cc207[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x4cc207,{'showHidden':![],'depth':null}));if(this[_0x13c2('0x8')][_0x4cc207[_0x13c2('0x27')]]){for(var _0xda3585 in this[_0x13c2('0x8')][_0x4cc207[_0x13c2('0x27')]]){if(this[_0x13c2('0x8')][_0x4cc207[_0x13c2('0x27')]][_0x13c2('0x53')](_0xda3585)){if(this[_0x13c2('0x8')][_0x4cc207['uniqueid']][_0xda3585]['reason']==_0x13c2('0x5b')&&this[_0x13c2('0x8')][_0x4cc207['uniqueid']][_0xda3585]['agentcomplete']){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4cc207[_0x13c2('0x27')],_0xda3585);this[_0x13c2('0x8')][_0x4cc207[_0x13c2('0x27')]][_0xda3585][_0x13c2('0x59')]=moment()['format'](_0x13c2('0x29'));}}}logger[_0x13c2('0x25')](_0x13c2('0x7b'),_0x4cc207[_0x13c2('0x27')],util[_0x13c2('0x33')](_[_0x13c2('0x7c')](this[_0x13c2('0x8')][_0x4cc207[_0x13c2('0x27')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x13c2('0x7c')](this[_0x13c2('0x8')][_0x4cc207[_0x13c2('0x27')]]));delete this[_0x13c2('0x8')][_0x4cc207['uniqueid']];}if(this[_0x13c2('0xc')][_0x4cc207[_0x13c2('0x27')]]){delete this[_0x13c2('0xc')][_0x4cc207['uniqueid']];}}}catch(_0x3a265b){logger[_0x13c2('0x36')](_0x13c2('0x7d'),_0x4cc207[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x3a265b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x1a')]=function(_0x167bdf){try{if(this[_0x13c2('0x20')](_0x167bdf)){logger['debug'](_0x13c2('0x7e'),_0x167bdf[_0x13c2('0x27')],util['inspect'](_0x167bdf,{'showHidden':![],'depth':null}));if(this[_0x13c2('0x8')][_0x167bdf[_0x13c2('0x7f')]]){for(var _0x207397 in this[_0x13c2('0x8')][_0x167bdf['transfereeuniqueid']]){if(this['channels'][_0x167bdf[_0x13c2('0x7f')]][_0x13c2('0x53')](_0x207397)){if(_0x167bdf['origtransfereruniqueid']===_0x207397){logger[_0x13c2('0x21')](_0x13c2('0x80'),_0x167bdf[_0x13c2('0x27')],this[_0x13c2('0x8')][_0x167bdf['transfereeuniqueid']][_0x207397][_0x13c2('0x23')],_0x207397);var _0x431217=moment();this[_0x13c2('0x8')][_0x167bdf[_0x13c2('0x7f')]][_0x207397][_0x13c2('0x13')]=!![];this['channels'][_0x167bdf[_0x13c2('0x7f')]][_0x207397][_0x13c2('0x59')]=moment()[_0x13c2('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x13c2('0x8')][_0x167bdf[_0x13c2('0x7f')]][_0x207397][_0x13c2('0x3e')]=_0x13c2('0x5a');this[_0x13c2('0x8')][_0x167bdf[_0x13c2('0x7f')]][_0x207397][_0x13c2('0x4a')]=_0x13c2('0x5b');this[_0x13c2('0x8')][_0x167bdf[_0x13c2('0x7f')]][_0x207397]['talktime']=_0x431217[_0x13c2('0x81')](this[_0x13c2('0x8')][_0x167bdf[_0x13c2('0x7f')]][_0x207397][_0x13c2('0x58')],_0x13c2('0x82'));}}}}if(this['channels'][_0x167bdf[_0x13c2('0x83')]]){var _0x174a7e=this['channels'][_0x167bdf[_0x13c2('0x83')]];this['channels'][_0x167bdf[_0x13c2('0x83')]]=this[_0x13c2('0x8')][_0x167bdf['transfereeuniqueid']];this[_0x13c2('0x8')][_0x167bdf[_0x13c2('0x7f')]]=_0x174a7e;}}}catch(_0x5c8518){logger[_0x13c2('0x36')](_0x13c2('0x84'),_0x167bdf[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x5c8518,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x1c')]=function(_0x10b75a){try{if(this[_0x13c2('0x20')](_0x10b75a)){logger[_0x13c2('0x25')](_0x13c2('0x85'),_0x10b75a['uniqueid'],util['inspect'](_0x10b75a,{'showHidden':![],'depth':null}));if(this[_0x13c2('0x8')][_0x10b75a['transfereeuniqueid']]){for(var _0x885581 in this[_0x13c2('0x8')][_0x10b75a['transfereeuniqueid']]){if(this[_0x13c2('0x8')][_0x10b75a[_0x13c2('0x7f')]][_0x13c2('0x53')](_0x885581)){if(_0x10b75a[_0x13c2('0x86')]===_0x885581){logger[_0x13c2('0x21')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x10b75a[_0x13c2('0x27')],this[_0x13c2('0x8')][_0x10b75a[_0x13c2('0x7f')]][_0x885581][_0x13c2('0x23')],_0x885581);var _0x48e74d=moment();this['channels'][_0x10b75a['transfereeuniqueid']][_0x885581][_0x13c2('0x13')]=!![];this[_0x13c2('0x8')][_0x10b75a[_0x13c2('0x7f')]][_0x885581][_0x13c2('0x59')]=_0x48e74d;this[_0x13c2('0x8')][_0x10b75a[_0x13c2('0x7f')]][_0x885581][_0x13c2('0x3e')]=_0x13c2('0x5a');this['channels'][_0x10b75a[_0x13c2('0x7f')]][_0x885581][_0x13c2('0x4a')]=_0x13c2('0x5b');this[_0x13c2('0x8')][_0x10b75a[_0x13c2('0x7f')]][_0x885581][_0x13c2('0x5d')]=_0x48e74d[_0x13c2('0x81')](this[_0x13c2('0x8')][_0x10b75a[_0x13c2('0x7f')]][_0x885581][_0x13c2('0x58')],_0x13c2('0x82'));}}}}}}catch(_0x23b29a){logger['error'](_0x13c2('0x87'),_0x10b75a[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x23b29a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x88')]=function(_0x2071c6){var _0x467f5a='';try{if(this['isNotNull'](_0x2071c6)){logger[_0x13c2('0x25')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x2071c6[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x2071c6,{'showHidden':![],'depth':null}));if(_0x2071c6[_0x13c2('0x89')]){_0x467f5a=_0x2071c6['channel'][_0x13c2('0x8a')](0x0,_0x2071c6[_0x13c2('0x89')][_0x13c2('0x8b')]('-'));if(this[_0x13c2('0xb')][_0x467f5a]){logger['info'](_0x13c2('0x8c'),_0x2071c6[_0x13c2('0x27')],_0x467f5a);this[_0x13c2('0xb')][_0x467f5a][_0x13c2('0x8d')]=!![];}}}}catch(_0x5a66b8){logger[_0x13c2('0x36')]('[%s][voiceAgentReport][musiconholdstart]',_0x2071c6[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x5a66b8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x13c2('0x1d')][_0x13c2('0x8e')]=function(_0x16ac58){var _0x406fbd='';try{if(this[_0x13c2('0x20')](_0x16ac58)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x16ac58[_0x13c2('0x27')],util['inspect'](_0x16ac58,{'showHidden':![],'depth':null}));if(_0x16ac58['channel']){_0x406fbd=_0x16ac58[_0x13c2('0x89')][_0x13c2('0x8a')](0x0,_0x16ac58[_0x13c2('0x89')][_0x13c2('0x8b')]('-'));if(this[_0x13c2('0xb')][_0x406fbd]){logger[_0x13c2('0x21')](_0x13c2('0x8f'),_0x16ac58[_0x13c2('0x27')],_0x406fbd);this[_0x13c2('0xb')][_0x406fbd][_0x13c2('0x8d')]=![];}}}}catch(_0x3364da){logger[_0x13c2('0x36')]('[%s][voiceAgentReport][musiconholdstop]',_0x16ac58[_0x13c2('0x27')],util[_0x13c2('0x33')](_0x3364da,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 157dd39..2981c03 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7640=['invalid','ringing','ringinuse','onhold','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','keys','context','exten','xcally-motion-preview','channel','split','format','user:%s','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','starttime','disposition','pick','from-sip','destconnectedlinenum','[%s][voiceCallReport][newchannel]','syncNewExten','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','applicationdata','info','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','set','cdr(','match','queue','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','channelstate','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','accountcode','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcalluniqueid','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','holdtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','stopRecordingOnTransfer','catch','StopMixMonitor','destinationchannel','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','syncBlindTransfer','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','path','ioredis','../../../config/environment','../ami','../model/channel','unknown','not_inuse','busy'];(function(_0x3c7ac6,_0x3e1503){var _0x8353ae=function(_0x21a166){while(--_0x21a166){_0x3c7ac6['push'](_0x3c7ac6['shift']());}};_0x8353ae(++_0x3e1503);}(_0x7640,0xc1));var _0x0764=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x7640[_0x29d915];return _0x160f86;};'use strict';var BPromise=require(_0x0764('0x0'));var _=require(_0x0764('0x1'));var moment=require(_0x0764('0x2'));var util=require('util');var path=require(_0x0764('0x3'));var Redis=require(_0x0764('0x4'));var config=require(_0x0764('0x5'));var logger=require('../../../config/logger')('ami');var ami=require(_0x0764('0x6'));var Channel=require(_0x0764('0x7'));var RpcSetting=require('../rpc/setting');var statusDesc=[_0x0764('0x8'),_0x0764('0x9'),'inuse',_0x0764('0xa'),_0x0764('0xb'),'unavailable',_0x0764('0xc'),_0x0764('0xd'),_0x0764('0xe')];var applications=['set','queue',_0x0764('0xf'),_0x0764('0x10'),_0x0764('0x11'),'voicemail'];var dispositions=[_0x0764('0x12'),_0x0764('0x13'),_0x0764('0x13'),_0x0764('0x12'),_0x0764('0x12'),'NO\x20ANSWER',_0x0764('0x14'),_0x0764('0x15'),_0x0764('0x13'),_0x0764('0x13'),_0x0764('0x13')];var actions={};config[_0x0764('0x16')]=_[_0x0764('0x17')](config['redis'],{'host':_0x0764('0x18'),'port':0x18eb});var io=require(_0x0764('0x19'))(new Redis(config[_0x0764('0x16')]));function VoiceCallReport(_0x5c77a6){this[_0x0764('0x1a')]=_0x5c77a6['channels'];this[_0x0764('0x1b')]=_0x5c77a6[_0x0764('0x1b')];this[_0x0764('0x1c')]={};ami['on'](_0x0764('0x1d'),this['syncNewExten'][_0x0764('0x1e')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on'](_0x0764('0x1f'),this[_0x0764('0x20')][_0x0764('0x1e')](this));ami['on'](_0x0764('0x21'),this[_0x0764('0x22')][_0x0764('0x1e')](this));ami['on'](_0x0764('0x23'),this[_0x0764('0x24')][_0x0764('0x1e')](this));ami['on'](_0x0764('0x25'),this['syncHangup'][_0x0764('0x1e')](this));ami['on'](_0x0764('0x26'),this[_0x0764('0x27')][_0x0764('0x1e')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x0764('0x1e')](this));ami['on'](_0x0764('0x28'),this['syncBlindTransfer'][_0x0764('0x1e')](this));ami['on'](_0x0764('0x29'),this[_0x0764('0x2a')][_0x0764('0x1e')](this));ami['on'](_0x0764('0x2b'),this[_0x0764('0x2c')]['bind'](this));try{logger['info'](_0x0764('0x2d'));ami[_0x0764('0x2e')]();}catch(_0x39e57f){logger[_0x0764('0x2f')](_0x0764('0x30'),util[_0x0764('0x31')](_0x39e57f,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x0764('0x32')][_0x0764('0x33')]=function(_0xcf71e9){return _0xcf71e9!==null&&!_[_0x0764('0x34')](_0xcf71e9);};VoiceCallReport['prototype'][_0x0764('0x35')]=function(_0x5ab318,_0x3394ef,_0x51bb1c){io['to'](_0x5ab318)['emit'](_0x3394ef,_0x51bb1c);};VoiceCallReport[_0x0764('0x32')][_0x0764('0x27')]=function(_0x2aa72c){try{if(this[_0x0764('0x33')](_0x2aa72c)){logger['info'](_0x0764('0x36'),_0x2aa72c[_0x0764('0x37')],_0x2aa72c[_0x0764('0x38')],_0x2aa72c[_0x0764('0x39')]);logger[_0x0764('0x3a')](_0x0764('0x3b'),_0x2aa72c[_0x0764('0x37')],util[_0x0764('0x31')](_0x2aa72c,{'showHidden':![],'depth':null}));if(_0x2aa72c[_0x0764('0x37')]===_0x2aa72c[_0x0764('0x3c')]){if(!_[_0x0764('0x34')](this[_0x0764('0x1a')][_0x2aa72c['uniqueid']])){_[_0x0764('0x3d')](this['channels'][_0x2aa72c[_0x0764('0x37')]],_['pick'](_0x2aa72c,_[_0x0764('0x3e')](this[_0x0764('0x1a')][_0x2aa72c[_0x0764('0x37')]])));}}if(_0x2aa72c[_0x0764('0x3f')]==='from-sip'){if(this[_0x0764('0x1b')][_0x2aa72c['channel']['split']('-')[0x0]]){if(_0x2aa72c[_0x0764('0x40')]==_0x0764('0x41')){this['agents'][_0x2aa72c[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x2aa72c['connectedlinenum'];this[_0x0764('0x35')](util[_0x0764('0x44')](_0x0764('0x45'),this[_0x0764('0x1b')][_0x2aa72c[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]][_0x0764('0x46')]),_0x0764('0x47'),{'destaccountcode':this['agents'][_0x2aa72c['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2aa72c[_0x0764('0x48')]});}}}}}catch(_0x586e45){logger[_0x0764('0x2f')](_0x0764('0x49'),_0x2aa72c[_0x0764('0x37')],util[_0x0764('0x31')](_0x586e45,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0764('0x32')]['syncNewChannel']=function(_0x4e11af){try{if(this['isNotNull'](_0x4e11af)){logger[_0x0764('0x3a')]('[%s][voiceCallReport][newchannel]\x20event:',_0x4e11af[_0x0764('0x37')],util[_0x0764('0x31')](_0x4e11af,{'showHidden':![],'depth':null}));if(_0x4e11af[_0x0764('0x37')]===_0x4e11af['linkedid']&&_0x4e11af[_0x0764('0x42')]!=_0x0764('0x4a')){if(_[_0x0764('0x34')](this[_0x0764('0x1a')][_0x4e11af['uniqueid']])){logger['info']('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x4e11af[_0x0764('0x37')],_0x4e11af['context'],_0x4e11af[_0x0764('0x40')]);this['channels'][_0x4e11af[_0x0764('0x37')]]=new Channel();this['channels'][_0x4e11af[_0x0764('0x37')]][_0x0764('0x4b')]=moment()[_0x0764('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4e11af[_0x0764('0x37')]][_0x0764('0x4c')]=dispositions[_['toNumber'](_0x4e11af['channelstate'])];_[_0x0764('0x3d')](this[_0x0764('0x1a')][_0x4e11af['uniqueid']],_[_0x0764('0x4d')](_0x4e11af,_['keys'](this['channels'][_0x4e11af[_0x0764('0x37')]])));if(_0x4e11af[_0x0764('0x3f')]===_0x0764('0x4e')){if(this[_0x0764('0x1b')][_0x4e11af[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]){if(_[_0x0764('0x34')](this[_0x0764('0x1b')][_0x4e11af['channel'][_0x0764('0x43')]('-')[0x0]][_0x0764('0x4f')])){this['agents'][_0x4e11af[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]][_0x0764('0x4f')]=_0x4e11af['exten'];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x4e11af['uniqueid'],util[_0x0764('0x31')]({'destaccountcode':this['agents'][_0x4e11af[_0x0764('0x42')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4e11af['exten']},{'showHidden':![],'depth':null}));this[_0x0764('0x35')](util[_0x0764('0x44')]('user:%s',this[_0x0764('0x1b')][_0x4e11af[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]][_0x0764('0x46')]),_0x0764('0x47'),{'destaccountcode':this[_0x0764('0x1b')][_0x4e11af['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4e11af[_0x0764('0x40')]});}}}}}}}catch(_0x4e453d){logger[_0x0764('0x2f')](_0x0764('0x50'),_0x4e11af['uniqueid'],util['inspect'](_0x4e453d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0764('0x32')][_0x0764('0x51')]=function(_0x313e41){try{if(this['isNotNull'](_0x313e41)){logger[_0x0764('0x3a')]('[%s][voiceCallReport][newexten]\x20event:',_0x313e41['uniqueid'],util['inspect'](_0x313e41,{'showHidden':![],'depth':null}));if(_0x313e41[_0x0764('0x37')]===_0x313e41[_0x0764('0x3c')]&&_0x313e41['exten']!='h'&&_0x313e41[_0x0764('0x42')]!=_0x0764('0x4a')){_0x313e41[_0x0764('0x52')]=_0x313e41[_0x0764('0x52')][_0x0764('0x53')]();_0x313e41['applicationdata']=_0x313e41['appdata']&&_0x313e41[_0x0764('0x54')][_0x0764('0x55')](_0x0764('0x56'))?_0x313e41['appdata']:(_0x313e41['appdata']||_0x313e41[_0x0764('0x57')])['toLowerCase']();logger[_0x0764('0x58')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x313e41['uniqueid'],_0x313e41[_0x0764('0x52')],_0x313e41[_0x0764('0x57')]);if(_[_0x0764('0x34')](this[_0x0764('0x1a')][_0x313e41[_0x0764('0x37')]])){this[_0x0764('0x1a')][_0x313e41[_0x0764('0x37')]]=new Channel();this['channels'][_0x313e41[_0x0764('0x37')]][_0x0764('0x4b')]=_0x313e41[_0x0764('0x59')]?moment()[_0x0764('0x5a')](moment['duration'](_0x313e41[_0x0764('0x59')])['seconds'](),_0x0764('0x5b'))[_0x0764('0x44')](_0x0764('0x5c')):moment()[_0x0764('0x44')](_0x0764('0x5c'));this[_0x0764('0x1a')][_0x313e41[_0x0764('0x37')]][_0x0764('0x4c')]='NO\x20ANSWER';}_[_0x0764('0x3d')](this[_0x0764('0x1a')][_0x313e41[_0x0764('0x37')]],_[_0x0764('0x4d')](_0x313e41,_[_0x0764('0x3e')](this[_0x0764('0x1a')][_0x313e41[_0x0764('0x37')]])));if(_[_0x0764('0x5d')](applications,_0x313e41[_0x0764('0x52')])){this[_0x0764('0x1a')][_0x313e41[_0x0764('0x37')]][_0x0764('0x5e')]=_0x313e41[_0x0764('0x52')];this[_0x0764('0x1a')][_0x313e41[_0x0764('0x37')]][_0x0764('0x5f')]=_0x313e41['applicationdata'];if(_0x313e41[_0x0764('0x52')]===_0x0764('0x60')&&_['startsWith'](_0x313e41[_0x0764('0x57')][_0x0764('0x53')](),_0x0764('0x61'))){var _0x1b1827=_0x313e41[_0x0764('0x57')][_0x0764('0x43')]('=');var _0x2ded6a=_0x1b1827[0x0][_0x0764('0x53')]()[_0x0764('0x62')](/cdr\((.*)\)/);if(_0x2ded6a){this[_0x0764('0x1a')][_0x313e41[_0x0764('0x37')]][_0x2ded6a[0x1]]=_0x1b1827[0x1];}}else if(_0x313e41['application']===_0x0764('0x63')){this['channels'][_0x313e41[_0x0764('0x37')]][_0x0764('0x63')]=_0x313e41[_0x0764('0x57')]['split'](',')[0x0];}}}}}catch(_0x52303e){logger[_0x0764('0x2f')]('[%s][voiceCallReport][newexten]',_0x313e41[_0x0764('0x37')],util[_0x0764('0x31')](_0x52303e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0764('0x32')][_0x0764('0x22')]=function(_0x1b2fff){try{if(this['isNotNull'](_0x1b2fff)){logger['info'](_0x0764('0x64'),_0x1b2fff[_0x0764('0x37')],_0x1b2fff['linkedid'],_0x1b2fff[_0x0764('0x38')],_0x1b2fff['calleridnum']);logger['debug'](_0x0764('0x65'),_0x1b2fff['uniqueid'],util[_0x0764('0x31')](_0x1b2fff,{'showHidden':![],'depth':null}));if(_0x1b2fff[_0x0764('0x37')]!==_0x1b2fff['linkedid']){if(this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]]){if(_0x1b2fff['channelstate']==='6'){if(!this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]][_0x0764('0x66')]){var _0x2304c5=moment();this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]][_0x0764('0x66')]=!![];this[_0x0764('0x1a')][_0x1b2fff['linkedid']][_0x0764('0x67')]=_0x2304c5[_0x0764('0x44')](_0x0764('0x5c'));if(this['channels'][_0x1b2fff[_0x0764('0x3c')]][_0x0764('0x4b')]){this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]]['holdtime']=_0x2304c5[_0x0764('0x68')](this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]][_0x0764('0x4b')],_0x0764('0x5b'));}}this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]]['linkedid']=_0x1b2fff[_0x0764('0x37')];if(_0x1b2fff[_0x0764('0x39')]!==_0x0764('0x41')){this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]][_0x0764('0x48')]=_0x1b2fff['calleridnum'];}this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]][_0x0764('0x69')]=_0x1b2fff[_0x0764('0x38')];this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]]['destinationchannel']=_0x1b2fff[_0x0764('0x42')];this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]][_0x0764('0x4c')]=dispositions[_['toNumber'](_0x1b2fff[_0x0764('0x6a')])];if(this['agents'][_0x1b2fff[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]){this['channels'][_0x1b2fff[_0x0764('0x3c')]]['UserId']=this[_0x0764('0x1b')][_0x1b2fff[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]['id'];this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]]['membername']=this[_0x0764('0x1b')][_0x1b2fff[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]['name'];}}}}else{if(this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x37')]]){if(_0x1b2fff[_0x0764('0x6a')]==='6'){if(this['agents'][_0x1b2fff[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]){this['channels'][_0x1b2fff[_0x0764('0x37')]][_0x0764('0x6b')]=this[_0x0764('0x1b')][_0x1b2fff['channel'][_0x0764('0x43')]('-')[0x0]]['id'];this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x37')]]['membername']=this[_0x0764('0x1b')][_0x1b2fff[_0x0764('0x42')]['split']('-')[0x0]][_0x0764('0x46')];}}}}if(_0x1b2fff[_0x0764('0x6a')]==='6'&&_0x1b2fff[_0x0764('0x3f')]===_0x0764('0x4e')){if(this[_0x0764('0x1b')][_0x1b2fff[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]){this['agents'][_0x1b2fff['channel'][_0x0764('0x43')]('-')[0x0]][_0x0764('0x4f')]=_0x1b2fff[_0x0764('0x40')];var _0x59512f;if(this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x37')]])_0x59512f=this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x37')]][_0x0764('0x6c')];else if(this[_0x0764('0x1a')][_0x1b2fff[_0x0764('0x3c')]])_0x59512f=this[_0x0764('0x1a')][_0x1b2fff['linkedid']][_0x0764('0x6c')];logger['debug'](_0x0764('0x6d'),_0x1b2fff['uniqueid'],util['inspect']({'destaccountcode':this[_0x0764('0x1b')][_0x1b2fff[_0x0764('0x42')]['split']('-')[0x0]][_0x0764('0x6e')],'destconnectedlinenum':_0x1b2fff[_0x0764('0x40')],'routealias':_0x59512f},{'showHidden':![],'depth':null}));this[_0x0764('0x35')](util[_0x0764('0x44')](_0x0764('0x45'),this[_0x0764('0x1b')][_0x1b2fff[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]][_0x0764('0x46')]),_0x0764('0x47'),{'destaccountcode':this[_0x0764('0x1b')][_0x1b2fff['channel'][_0x0764('0x43')]('-')[0x0]][_0x0764('0x6e')],'destconnectedlinenum':_0x1b2fff[_0x0764('0x40')],'routealias':_0x59512f});}}}}catch(_0x5b059f){logger[_0x0764('0x2f')]('[%s][voiceCallReport][newstate]',_0x1b2fff[_0x0764('0x37')],util[_0x0764('0x31')](_0x5b059f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0764('0x32')][_0x0764('0x6f')]=function(_0x27c752,_0x2a46e3){try{if(this[_0x0764('0x1a')][_0x27c752]){logger['info'](_0x0764('0x70'),_0x27c752,_0x2a46e3);this[_0x0764('0x1a')][_0x27c752][_0x0764('0x71')]=!![];if(_[_0x0764('0x72')](_0x2a46e3,'.wav49')){_0x2a46e3=_0x2a46e3['replace'](_0x0764('0x73'),_0x0764('0x74'));}this[_0x0764('0x1a')][_0x27c752]['monitorFilename']=_0x2a46e3;var _0x1d19c6=_['find'](this[_0x0764('0x1a')][_0x27c752][_0x0764('0x75')],{'filename':_0x2a46e3});if(_[_0x0764('0x76')](_0x1d19c6)){this[_0x0764('0x1a')][_0x27c752][_0x0764('0x75')]['push']({'filename':_0x2a46e3,'createdAt':moment()['format'](_0x0764('0x5c')),'mixmonitorid':'','status':_0x0764('0x77')});}}}catch(_0x14613){logger[_0x0764('0x2f')](_0x0764('0x78'),_0x27c752,util['inspect'](_0x14613,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0764('0x32')][_0x0764('0x24')]=function(_0x180733){try{if(this['isNotNull'](_0x180733)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x180733['uniqueid'],util['inspect'](_0x180733,{'showHidden':![],'depth':null}));if(this[_0x0764('0x1a')][_0x180733[_0x0764('0x37')]]&&_0x180733['channel']!=_0x0764('0x4a')){if(this[_0x0764('0x33')](_0x180733[_0x0764('0x79')])){if(this[_0x0764('0x33')](_0x180733[_0x0764('0x79')][_0x0764('0x7a')])){logger[_0x0764('0x58')](_0x0764('0x7b'),_0x180733[_0x0764('0x37')],_0x180733[_0x0764('0x7c')]);this['syncMixMonitorFilename'](_0x180733['uniqueid'],_0x180733[_0x0764('0x7c')]);}else if(this['isNotNull'](_0x180733['variable'][_0x0764('0x7d')])){logger['info'](_0x0764('0x7e'),_0x180733[_0x0764('0x37')],_0x180733['value']);this[_0x0764('0x1a')][_0x180733[_0x0764('0x37')]][_0x0764('0x39')]=_0x180733[_0x0764('0x7c')];}else if(this['isNotNull'](_0x180733[_0x0764('0x79')][_0x0764('0x7f')])){logger['info'](_0x0764('0x80'),_0x180733[_0x0764('0x37')],_0x180733[_0x0764('0x7c')]);this[_0x0764('0x1a')][_0x180733[_0x0764('0x37')]][_0x0764('0x81')]=_0x180733[_0x0764('0x7c')];}else if(this['isNotNull'](_0x180733[_0x0764('0x79')][_0x0764('0x82')])){logger['info'](_0x0764('0x83'),_0x180733[_0x0764('0x37')],_0x180733[_0x0764('0x7c')]);this[_0x0764('0x1a')][_0x180733['uniqueid']][_0x0764('0x84')]=_0x180733[_0x0764('0x7c')];}else if(this['isNotNull'](_0x180733[_0x0764('0x79')][_0x0764('0x85')])){logger['info'](_0x0764('0x86'),_0x180733[_0x0764('0x37')],_0x180733[_0x0764('0x7c')]['split'](',')[0x0]);this[_0x0764('0x1a')][_0x180733['uniqueid']]['queue']=_0x180733['value'][_0x0764('0x43')](',')[0x0];}else if(this[_0x0764('0x33')](_0x180733['variable'][_0x0764('0x87')])){logger[_0x0764('0x58')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x180733[_0x0764('0x37')],_0x180733[_0x0764('0x7c')]);this[_0x0764('0x1a')][_0x180733['uniqueid']][_0x0764('0x88')]=_0x180733[_0x0764('0x7c')];}else if(this[_0x0764('0x33')](_0x180733['variable']['xmd-destination'])){logger['info'](_0x0764('0x89'),_0x180733[_0x0764('0x37')],_0x180733['value']);this[_0x0764('0x1a')][_0x180733['uniqueid']]['destination']=_0x180733[_0x0764('0x7c')];}else if(this[_0x0764('0x33')](_0x180733['variable'][_0x0764('0x8a')])){logger[_0x0764('0x58')](_0x0764('0x8b'),_0x180733[_0x0764('0x37')],_0x180733[_0x0764('0x7c')]);this[_0x0764('0x1a')][_0x180733[_0x0764('0x37')]][_0x0764('0x8c')]=_0x180733[_0x0764('0x7c')];}else if(this[_0x0764('0x33')](_0x180733['variable'][_0x0764('0x8d')])){logger[_0x0764('0x58')](_0x0764('0x8e'),_0x180733[_0x0764('0x37')],_0x180733['value']);this[_0x0764('0x1a')][_0x180733['uniqueid']]['queue']=_0x180733[_0x0764('0x7c')];}else if(this[_0x0764('0x33')](_0x180733[_0x0764('0x79')]['sipcallid'])){logger[_0x0764('0x58')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x180733['uniqueid'],_0x180733[_0x0764('0x7c')]);this['channels'][_0x180733[_0x0764('0x37')]][_0x0764('0x8f')]=_0x180733[_0x0764('0x7c')];}}}else if(this[_0x0764('0x33')](_0x180733['variable'][_0x0764('0x7a')])){if(_0x180733[_0x0764('0x7c')]){var _0x4ee078=path['parse'](_0x180733[_0x0764('0x7c')])[_0x0764('0x46')];logger[_0x0764('0x58')](_0x0764('0x7b'),_0x4ee078,_0x180733[_0x0764('0x7c')]);this[_0x0764('0x6f')](_0x4ee078,_0x180733[_0x0764('0x7c')]);}}else if(this[_0x0764('0x1a')][_0x180733[_0x0764('0x3c')]]){if(this[_0x0764('0x33')](_0x180733['variable'])){if(this[_0x0764('0x33')](_0x180733[_0x0764('0x79')][_0x0764('0x90')])){logger[_0x0764('0x58')](_0x0764('0x91'),_0x180733[_0x0764('0x3c')],_0x180733[_0x0764('0x7c')]);this['channels'][_0x180733[_0x0764('0x3c')]][_0x0764('0x92')]=_0x180733[_0x0764('0x7c')];}}}}}catch(_0xf127be){logger[_0x0764('0x2f')](_0x0764('0x93'),_0x180733[_0x0764('0x37')],util[_0x0764('0x31')](_0xf127be,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0764('0x32')][_0x0764('0x94')]=function(_0x97e13){try{if(this['isNotNull'](_0x97e13)){logger['debug'](_0x0764('0x95'),_0x97e13[_0x0764('0x37')],util[_0x0764('0x31')](_0x97e13,{'showHidden':![],'depth':null}));if(this[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]]){logger['info'](_0x0764('0x96'),_0x97e13[_0x0764('0x37')],_0x97e13[_0x0764('0x97')]);var _0x5ad6c8=moment();this['channels'][_0x97e13[_0x0764('0x37')]][_0x0764('0x98')]=_0x5ad6c8['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]]['duration']=_0x5ad6c8[_0x0764('0x68')](this[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]][_0x0764('0x4b')],_0x0764('0x5b'));if(this['channels'][_0x97e13[_0x0764('0x37')]][_0x0764('0x66')]){this[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]]['billableseconds']=_0x5ad6c8[_0x0764('0x68')](this[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]]['answertime'],_0x0764('0x5b'));this[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]][_0x0764('0x99')]=this['channels'][_0x97e13['uniqueid']][_0x0764('0x59')]-this[_0x0764('0x1a')][_0x97e13['uniqueid']][_0x0764('0x9a')];}if(_0x97e13[_0x0764('0x3f')]===_0x0764('0x4e')){if(this[_0x0764('0x1b')][_0x97e13['channel'][_0x0764('0x43')]('-')[0x0]]){this[_0x0764('0x1b')][_0x97e13[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]=_[_0x0764('0x9b')](this['agents'][_0x97e13[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]],[_0x0764('0x4f')]);logger[_0x0764('0x3a')](_0x0764('0x9c'),_0x97e13[_0x0764('0x37')],util['inspect']({'id':this['agents'][_0x97e13[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x97e13[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]][_0x0764('0x6e')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0764('0x45'),this[_0x0764('0x1b')][_0x97e13[_0x0764('0x42')][_0x0764('0x43')]('-')[0x0]][_0x0764('0x46')]),_0x0764('0x9d'),{'id':this[_0x0764('0x1b')][_0x97e13['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x0764('0x1b')][_0x97e13['channel'][_0x0764('0x43')]('-')[0x0]]['accountcode']});}}var _0x52a2a9=this;Promise[_0x0764('0x9e')]()[_0x0764('0x9f')](function(){var _0x2b185a=_0x52a2a9['channels'][_0x97e13[_0x0764('0x37')]];if(typeof _0x2b185a[_0x0764('0xa0')]==='undefined')return;if(_[_0x0764('0xa1')](_0x2b185a['monitors']))return;return RpcSetting[_0x0764('0xa2')]()[_0x0764('0x9f')](function(_0x2bf801){if(!_0x2bf801[_0x0764('0xa3')])return;return Promise[_0x0764('0x9e')]()[_0x0764('0x9f')](function(){return ami['Action']({'action':'StopMixMonitor','channel':_0x2b185a[_0x0764('0x42')]})[_0x0764('0xa4')](function(){});})['then'](function(){return ami['Action']({'action':_0x0764('0xa5'),'channel':_0x2b185a[_0x0764('0xa6')]})['catch'](function(){})[_0x0764('0xa7')](function(){var _0x468646=_0x52a2a9[_0x0764('0x1b')][_0x2b185a[_0x0764('0xa6')]['split']('-')[0x0]];if(!_0x468646)return;io[_0x0764('0x35')](_0x0764('0xa8'),{'agentId':_0x468646['id'],'uniqueid':_0x2b185a['uniqueid']});});});});})['then'](function(){if(_0x97e13[_0x0764('0xa9')]===_0x0764('0xaa')){_0x52a2a9[_0x0764('0x1c')][_0x97e13[_0x0764('0x37')]]=_0x52a2a9[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]];}else{if(_0x52a2a9['channels'][_0x97e13['uniqueid']][_0x0764('0x84')]==='outbound'&&_0x52a2a9[_0x0764('0x1c')][_0x97e13[_0x0764('0x37')]]){_0x52a2a9['channels'][_0x97e13[_0x0764('0x37')]][_0x0764('0x37')]=[_0x52a2a9[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]][_0x0764('0x3c')],_0x52a2a9['channels'][_0x97e13[_0x0764('0x37')]]['linkedid']=_0x52a2a9[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]][_0x0764('0x37')]][0x0];delete _0x52a2a9[_0x0764('0x1c')][_0x97e13[_0x0764('0x37')]];}}logger[_0x0764('0x3a')](_0x0764('0xab'),_0x97e13['uniqueid'],util[_0x0764('0x31')](_0x52a2a9['channels'][_0x97e13[_0x0764('0x37')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0764('0xac'),_0x52a2a9[_0x0764('0x1a')][_0x97e13[_0x0764('0x37')]]);delete _0x52a2a9['channels'][_0x97e13['uniqueid']];});}}}catch(_0x125062){logger[_0x0764('0x2f')](_0x0764('0xad'),_0x97e13[_0x0764('0x37')],util['inspect'](_0x125062,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0764('0xae')]=function(_0x306797){try{if(this[_0x0764('0x33')](_0x306797)){logger[_0x0764('0x58')](_0x0764('0xaf'),_0x306797[_0x0764('0x37')],_0x306797['origtransferercalleridnum'],_0x306797[_0x0764('0xb0')]);logger['debug'](_0x0764('0xb1'),_0x306797['uniqueid'],util[_0x0764('0x31')](_0x306797,{'showHidden':![],'depth':null}));if(this[_0x0764('0x1a')][_0x306797[_0x0764('0xb2')]]){this[_0x0764('0x1a')][_0x306797['transfereeuniqueid']][_0x0764('0xb3')]=_0x306797['origtransferercalleridnum'];this[_0x0764('0x1a')][_0x306797[_0x0764('0xb2')]][_0x0764('0xb4')]=_0x306797[_0x0764('0xb0')];if(this[_0x0764('0x1a')][_0x306797[_0x0764('0xb5')]]){var _0x72c80c=this[_0x0764('0x1a')][_0x306797[_0x0764('0xb5')]];this['channels'][_0x306797[_0x0764('0xb5')]]=this[_0x0764('0x1a')][_0x306797[_0x0764('0xb2')]];this[_0x0764('0x1a')][_0x306797[_0x0764('0xb2')]]=_0x72c80c;}}else if(this['channels'][_0x306797[_0x0764('0xb6')]]){this[_0x0764('0x1a')][_0x306797['transfertargetuniqueid']]['transfercalleridnum']=_0x306797['origtransferercalleridnum'];this[_0x0764('0x1a')][_0x306797[_0x0764('0xb6')]]['transferconnectedlinenum']=_0x306797[_0x0764('0xb0')];if(this[_0x0764('0x1a')][_0x306797['origtransfereruniqueid']]){var _0x72c80c=this[_0x0764('0x1a')][_0x306797[_0x0764('0xb7')]];this[_0x0764('0x1a')][_0x306797[_0x0764('0xb7')]]=this[_0x0764('0x1a')][_0x306797[_0x0764('0xb6')]];this[_0x0764('0x1a')][_0x306797['transfertargetuniqueid']]=_0x72c80c;}}if((this[_0x0764('0x1a')][_0x306797[_0x0764('0xb7')]]||this['channels'][_0x306797[_0x0764('0xb8')]])&&this[_0x0764('0x1a')][_0x306797['secondtransfereruniqueid']]){var _0x29f919=_[_0x0764('0xb9')]([this[_0x0764('0x1a')][_0x306797[_0x0764('0xb7')]],this['channels'][_0x306797[_0x0764('0xb8')]],this[_0x0764('0x1a')][_0x306797[_0x0764('0xb5')]]],function(_0x1a2e5){return _0x1a2e5&&_0x1a2e5[_0x0764('0x84')]===_0x0764('0xba')&&_0x1a2e5[_0x0764('0xbb')];});if(_0x29f919){if(this[_0x0764('0x1a')][_0x306797['origtransfereruniqueid']])this[_0x0764('0x1a')][_0x306797['origtransfereruniqueid']][_0x0764('0xa0')]=_0x0764('0xbc');if(this[_0x0764('0x1a')][_0x306797[_0x0764('0xb8')]])this[_0x0764('0x1a')][_0x306797['origtransfererlinkedid']][_0x0764('0xa0')]=_0x0764('0xbc');this[_0x0764('0x1a')][_0x306797[_0x0764('0xb5')]][_0x0764('0xa0')]=_0x0764('0xbc');}}}}catch(_0xd9d869){logger[_0x0764('0x2f')]('[%s][voiceCallReport][attendedtransfer]',_0x306797[_0x0764('0x37')],util[_0x0764('0x31')](_0xd9d869,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0764('0xbd')]=function(_0x48c06b){try{if(this[_0x0764('0x33')](_0x48c06b)){logger[_0x0764('0x58')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x48c06b[_0x0764('0x37')],_0x48c06b[_0x0764('0xbe')],_0x48c06b[_0x0764('0xbf')]);logger[_0x0764('0x3a')](_0x0764('0xc0'),_0x48c06b['uniqueid'],util[_0x0764('0x31')](_0x48c06b,{'showHidden':![],'depth':null}));if(this[_0x0764('0x1a')][_0x48c06b[_0x0764('0xb2')]]){this[_0x0764('0x1a')][_0x48c06b['transfereeuniqueid']][_0x0764('0xb3')]=_0x48c06b[_0x0764('0xbe')];this[_0x0764('0x1a')][_0x48c06b[_0x0764('0xb2')]][_0x0764('0xb4')]=_0x48c06b['extension'];this['channels'][_0x48c06b[_0x0764('0xb2')]]['transferType']=_0x0764('0xc1');this['syncHangup']({'event':_0x0764('0xaa'),'uniqueid':_0x48c06b[_0x0764('0xb2')],'context':_0x48c06b['context'],'channel':_0x48c06b[_0x0764('0xc2')]});}else{this['channels'][_0x48c06b[_0x0764('0xc3')]][_0x0764('0xa0')]=_0x0764('0xc1');}}}catch(_0x403b90){logger[_0x0764('0x2f')](_0x0764('0xc4'),_0x48c06b[_0x0764('0x37')],util['inspect'](_0x403b90,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0764('0x32')]['syncMusicOnHoldStart']=function(_0x44f049){try{if(this['isNotNull'](_0x44f049)){logger[_0x0764('0x3a')](_0x0764('0xc5'),_0x44f049['uniqueid'],util[_0x0764('0x31')](_0x44f049,{'showHidden':![],'depth':null}));if(this[_0x0764('0x1a')][_0x44f049['uniqueid']]){if(!_['isNil'](this[_0x0764('0x1a')][_0x44f049[_0x0764('0x37')]][_0x0764('0x67')])){this[_0x0764('0x1a')][_0x44f049[_0x0764('0x37')]][_0x0764('0xc6')]=moment()[_0x0764('0x44')](_0x0764('0x5c'));logger['info']('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x44f049[_0x0764('0x37')],this[_0x0764('0x1a')][_0x44f049[_0x0764('0x37')]][_0x0764('0xc6')]);}}}}catch(_0x15ee16){logger[_0x0764('0x2f')](_0x0764('0xc7'),_0x44f049[_0x0764('0x37')],util[_0x0764('0x31')](_0x15ee16,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0764('0x32')][_0x0764('0x2c')]=function(_0x5723cb){try{if(this[_0x0764('0x33')](_0x5723cb)){logger[_0x0764('0x3a')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x5723cb[_0x0764('0x37')],util['inspect'](_0x5723cb,{'showHidden':![],'depth':null}));if(this[_0x0764('0x1a')][_0x5723cb[_0x0764('0x37')]]){if(!_[_0x0764('0x76')](this['channels'][_0x5723cb[_0x0764('0x37')]]['mohstarttime'])){this['channels'][_0x5723cb['uniqueid']][_0x0764('0xc8')]+=moment()['milliseconds'](0x0)[_0x0764('0x68')](this['channels'][_0x5723cb['uniqueid']][_0x0764('0xc6')],'seconds');logger['info'](_0x0764('0xc9'),_0x5723cb[_0x0764('0x37')],this['channels'][_0x5723cb[_0x0764('0x37')]][_0x0764('0xc8')]);delete this[_0x0764('0x1a')][_0x5723cb['uniqueid']][_0x0764('0xc6')];}}}}catch(_0xaaf53f){logger['error'](_0x0764('0xca'),_0x5723cb[_0x0764('0x37')],util[_0x0764('0x31')](_0xaaf53f,{'showHidden':![],'depth':null}));}};module[_0x0764('0xcb')]=VoiceCallReport; \ No newline at end of file +var _0xd9a3=['cause-txt','endtime','holdtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','Action','StopMixMonitor','destinationchannel','catch','event','BlindTransfer','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','extension','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../model/channel','../rpc/setting','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','set','agi','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isUndefined','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','debug','linkedid','merge','pick','keys','context','from-sip','channel','split','exten','format','user:%s','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','isNotNull','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','application','applicationdata','appdata','startsWith','CDR(routeAlias)','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','includes','lastapplication','lastdata','cdr(','match','queue','[%s][voiceCallReport][newexten]','syncNewState','calleridname','calleridnum','answered','answertime','starttime','diff','xcally-motion-preview','connectedlinename','UserId','channelstate','routealias','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s'];(function(_0x32c311,_0x388d88){var _0x58b9bf=function(_0x1d3b30){while(--_0x1d3b30){_0x32c311['push'](_0x32c311['shift']());}};_0x58b9bf(++_0x388d88);}(_0xd9a3,0xff));var _0x3d9a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd9a3[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x3d9a('0x0'));var _=require(_0x3d9a('0x1'));var moment=require(_0x3d9a('0x2'));var util=require(_0x3d9a('0x3'));var path=require(_0x3d9a('0x4'));var Redis=require(_0x3d9a('0x5'));var config=require(_0x3d9a('0x6'));var logger=require(_0x3d9a('0x7'))('ami');var ami=require('../ami');var Channel=require(_0x3d9a('0x8'));var RpcSetting=require(_0x3d9a('0x9'));var statusDesc=[_0x3d9a('0xa'),_0x3d9a('0xb'),_0x3d9a('0xc'),'busy',_0x3d9a('0xd'),_0x3d9a('0xe'),_0x3d9a('0xf'),_0x3d9a('0x10'),_0x3d9a('0x11')];var applications=[_0x3d9a('0x12'),'queue',_0x3d9a('0x13'),'dial','playback',_0x3d9a('0x14')];var dispositions=[_0x3d9a('0x15'),_0x3d9a('0x16'),'FAILED',_0x3d9a('0x15'),_0x3d9a('0x15'),_0x3d9a('0x15'),'ANSWERED',_0x3d9a('0x17'),_0x3d9a('0x16'),_0x3d9a('0x16'),_0x3d9a('0x16')];var actions={};config[_0x3d9a('0x18')]=_[_0x3d9a('0x19')](config['redis'],{'host':_0x3d9a('0x1a'),'port':0x18eb});var io=require(_0x3d9a('0x1b'))(new Redis(config['redis']));function VoiceCallReport(_0x4d67ef){this[_0x3d9a('0x1c')]=_0x4d67ef[_0x3d9a('0x1c')];this[_0x3d9a('0x1d')]=_0x4d67ef[_0x3d9a('0x1d')];this[_0x3d9a('0x1e')]={};ami['on'](_0x3d9a('0x1f'),this[_0x3d9a('0x20')][_0x3d9a('0x21')](this));ami['on']('newexten',this[_0x3d9a('0x20')][_0x3d9a('0x21')](this));ami['on'](_0x3d9a('0x22'),this[_0x3d9a('0x23')][_0x3d9a('0x21')](this));ami['on'](_0x3d9a('0x24'),this['syncNewState']['bind'](this));ami['on'](_0x3d9a('0x25'),this[_0x3d9a('0x26')][_0x3d9a('0x21')](this));ami['on'](_0x3d9a('0x27'),this[_0x3d9a('0x28')][_0x3d9a('0x21')](this));ami['on']('newcallerid',this[_0x3d9a('0x29')][_0x3d9a('0x21')](this));ami['on'](_0x3d9a('0x2a'),this[_0x3d9a('0x2b')][_0x3d9a('0x21')](this));ami['on'](_0x3d9a('0x2c'),this[_0x3d9a('0x2d')][_0x3d9a('0x21')](this));ami['on'](_0x3d9a('0x2e'),this[_0x3d9a('0x2f')][_0x3d9a('0x21')](this));ami['on'](_0x3d9a('0x30'),this[_0x3d9a('0x31')]['bind'](this));try{logger[_0x3d9a('0x32')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x3d9a('0x33')]();}catch(_0xdc809a){logger[_0x3d9a('0x34')](_0x3d9a('0x35'),util[_0x3d9a('0x36')](_0xdc809a,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0x39d648){return _0x39d648!==null&&!_[_0x3d9a('0x37')](_0x39d648);};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x39')]=function(_0x2b12aa,_0x32e457,_0x5a3729){io['to'](_0x2b12aa)[_0x3d9a('0x39')](_0x32e457,_0x5a3729);};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x29')]=function(_0x5c76e5){try{if(this['isNotNull'](_0x5c76e5)){logger['info'](_0x3d9a('0x3a'),_0x5c76e5[_0x3d9a('0x3b')],_0x5c76e5['calleridname'],_0x5c76e5['calleridnum']);logger[_0x3d9a('0x3c')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x5c76e5[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x5c76e5,{'showHidden':![],'depth':null}));if(_0x5c76e5[_0x3d9a('0x3b')]===_0x5c76e5[_0x3d9a('0x3d')]){if(!_[_0x3d9a('0x37')](this['channels'][_0x5c76e5[_0x3d9a('0x3b')]])){_[_0x3d9a('0x3e')](this['channels'][_0x5c76e5[_0x3d9a('0x3b')]],_[_0x3d9a('0x3f')](_0x5c76e5,_[_0x3d9a('0x40')](this[_0x3d9a('0x1c')][_0x5c76e5['uniqueid']])));}}if(_0x5c76e5[_0x3d9a('0x41')]===_0x3d9a('0x42')){if(this[_0x3d9a('0x1d')][_0x5c76e5[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]]){if(_0x5c76e5[_0x3d9a('0x45')]=='xcally-motion-preview'){this[_0x3d9a('0x1d')][_0x5c76e5[_0x3d9a('0x43')]['split']('-')[0x0]]['destconnectedlinenum']=_0x5c76e5['connectedlinenum'];this[_0x3d9a('0x39')](util[_0x3d9a('0x46')](_0x3d9a('0x47'),this['agents'][_0x5c76e5[_0x3d9a('0x43')]['split']('-')[0x0]][_0x3d9a('0x48')]),_0x3d9a('0x49'),{'destaccountcode':this[_0x3d9a('0x1d')][_0x5c76e5[_0x3d9a('0x43')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5c76e5[_0x3d9a('0x4a')]});}}}}}catch(_0xd5688a){logger[_0x3d9a('0x34')](_0x3d9a('0x4b'),_0x5c76e5[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0xd5688a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x23')]=function(_0x3c63d2){try{if(this[_0x3d9a('0x4c')](_0x3c63d2)){logger[_0x3d9a('0x3c')](_0x3d9a('0x4d'),_0x3c63d2[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x3c63d2,{'showHidden':![],'depth':null}));if(_0x3c63d2[_0x3d9a('0x3b')]===_0x3c63d2[_0x3d9a('0x3d')]&&_0x3c63d2['channel']!=_0x3d9a('0x4e')){if(_[_0x3d9a('0x37')](this[_0x3d9a('0x1c')][_0x3c63d2['uniqueid']])){logger[_0x3d9a('0x32')](_0x3d9a('0x4f'),_0x3c63d2['uniqueid'],_0x3c63d2['context'],_0x3c63d2[_0x3d9a('0x45')]);this['channels'][_0x3c63d2[_0x3d9a('0x3b')]]=new Channel();this[_0x3d9a('0x1c')][_0x3c63d2['uniqueid']]['starttime']=moment()[_0x3d9a('0x46')](_0x3d9a('0x50'));this['channels'][_0x3c63d2[_0x3d9a('0x3b')]][_0x3d9a('0x51')]=dispositions[_[_0x3d9a('0x52')](_0x3c63d2['channelstate'])];_[_0x3d9a('0x3e')](this[_0x3d9a('0x1c')][_0x3c63d2[_0x3d9a('0x3b')]],_['pick'](_0x3c63d2,_['keys'](this[_0x3d9a('0x1c')][_0x3c63d2[_0x3d9a('0x3b')]])));if(_0x3c63d2[_0x3d9a('0x41')]===_0x3d9a('0x42')){if(this[_0x3d9a('0x1d')][_0x3c63d2[_0x3d9a('0x43')]['split']('-')[0x0]]){if(_[_0x3d9a('0x37')](this[_0x3d9a('0x1d')][_0x3c63d2['channel'][_0x3d9a('0x44')]('-')[0x0]][_0x3d9a('0x53')])){this['agents'][_0x3c63d2['channel'][_0x3d9a('0x44')]('-')[0x0]][_0x3d9a('0x53')]=_0x3c63d2[_0x3d9a('0x45')];logger['debug'](_0x3d9a('0x54'),_0x3c63d2['uniqueid'],util[_0x3d9a('0x36')]({'destaccountcode':this[_0x3d9a('0x1d')][_0x3c63d2['channel'][_0x3d9a('0x44')]('-')[0x0]][_0x3d9a('0x55')],'destconnectedlinenum':_0x3c63d2[_0x3d9a('0x45')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x3d9a('0x46')](_0x3d9a('0x47'),this[_0x3d9a('0x1d')][_0x3c63d2['channel'][_0x3d9a('0x44')]('-')[0x0]]['name']),_0x3d9a('0x49'),{'destaccountcode':this[_0x3d9a('0x1d')][_0x3c63d2[_0x3d9a('0x43')]['split']('-')[0x0]][_0x3d9a('0x55')],'destconnectedlinenum':_0x3c63d2[_0x3d9a('0x45')]});}}}}}}}catch(_0x420c32){logger[_0x3d9a('0x34')]('[%s][voiceCallReport][newchannel]',_0x3c63d2[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x420c32,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x20')]=function(_0x446423){try{if(this[_0x3d9a('0x4c')](_0x446423)){logger[_0x3d9a('0x3c')]('[%s][voiceCallReport][newexten]\x20event:',_0x446423['uniqueid'],util[_0x3d9a('0x36')](_0x446423,{'showHidden':![],'depth':null}));if(_0x446423[_0x3d9a('0x3b')]===_0x446423['linkedid']&&_0x446423[_0x3d9a('0x45')]!='h'&&_0x446423['channel']!='OutgoingSpoolFailed'){_0x446423[_0x3d9a('0x56')]=_0x446423[_0x3d9a('0x56')]['toLowerCase']();_0x446423[_0x3d9a('0x57')]=_0x446423[_0x3d9a('0x58')]&&_0x446423[_0x3d9a('0x58')][_0x3d9a('0x59')](_0x3d9a('0x5a'))?_0x446423[_0x3d9a('0x58')]:(_0x446423[_0x3d9a('0x58')]||_0x446423[_0x3d9a('0x57')])[_0x3d9a('0x5b')]();logger['info'](_0x3d9a('0x5c'),_0x446423['uniqueid'],_0x446423[_0x3d9a('0x56')],_0x446423['applicationdata']);if(_[_0x3d9a('0x37')](this['channels'][_0x446423['uniqueid']])){this[_0x3d9a('0x1c')][_0x446423['uniqueid']]=new Channel();this[_0x3d9a('0x1c')][_0x446423[_0x3d9a('0x3b')]]['starttime']=_0x446423['duration']?moment()[_0x3d9a('0x5d')](moment[_0x3d9a('0x5e')](_0x446423[_0x3d9a('0x5e')])['seconds'](),_0x3d9a('0x5f'))[_0x3d9a('0x46')](_0x3d9a('0x50')):moment()[_0x3d9a('0x46')](_0x3d9a('0x50'));this[_0x3d9a('0x1c')][_0x446423[_0x3d9a('0x3b')]]['disposition']=_0x3d9a('0x15');}_[_0x3d9a('0x3e')](this[_0x3d9a('0x1c')][_0x446423[_0x3d9a('0x3b')]],_['pick'](_0x446423,_[_0x3d9a('0x40')](this[_0x3d9a('0x1c')][_0x446423[_0x3d9a('0x3b')]])));if(_[_0x3d9a('0x60')](applications,_0x446423[_0x3d9a('0x56')])){this[_0x3d9a('0x1c')][_0x446423['uniqueid']][_0x3d9a('0x61')]=_0x446423[_0x3d9a('0x56')];this[_0x3d9a('0x1c')][_0x446423[_0x3d9a('0x3b')]][_0x3d9a('0x62')]=_0x446423[_0x3d9a('0x57')];if(_0x446423[_0x3d9a('0x56')]===_0x3d9a('0x12')&&_[_0x3d9a('0x59')](_0x446423[_0x3d9a('0x57')][_0x3d9a('0x5b')](),_0x3d9a('0x63'))){var _0xe2aca3=_0x446423[_0x3d9a('0x57')][_0x3d9a('0x44')]('=');var _0x192633=_0xe2aca3[0x0][_0x3d9a('0x5b')]()[_0x3d9a('0x64')](/cdr\((.*)\)/);if(_0x192633){this['channels'][_0x446423['uniqueid']][_0x192633[0x1]]=_0xe2aca3[0x1];}}else if(_0x446423['application']==='queue'){this[_0x3d9a('0x1c')][_0x446423[_0x3d9a('0x3b')]][_0x3d9a('0x65')]=_0x446423[_0x3d9a('0x57')][_0x3d9a('0x44')](',')[0x0];}}}}}catch(_0x442675){logger[_0x3d9a('0x34')](_0x3d9a('0x66'),_0x446423['uniqueid'],util[_0x3d9a('0x36')](_0x442675,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x67')]=function(_0x38cdb5){try{if(this[_0x3d9a('0x4c')](_0x38cdb5)){logger[_0x3d9a('0x32')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x38cdb5[_0x3d9a('0x3b')],_0x38cdb5[_0x3d9a('0x3d')],_0x38cdb5[_0x3d9a('0x68')],_0x38cdb5[_0x3d9a('0x69')]);logger[_0x3d9a('0x3c')]('[%s][voiceCallReport][newstate]\x20event:',_0x38cdb5[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x38cdb5,{'showHidden':![],'depth':null}));if(_0x38cdb5[_0x3d9a('0x3b')]!==_0x38cdb5[_0x3d9a('0x3d')]){if(this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]]){if(_0x38cdb5['channelstate']==='6'){if(!this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x6a')]){var _0xad902b=moment();this['channels'][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x6a')]=!![];this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x6b')]=_0xad902b[_0x3d9a('0x46')](_0x3d9a('0x50'));if(this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x6c')]){this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]]['holdtime']=_0xad902b[_0x3d9a('0x6d')](this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x6c')],'seconds');}}this[_0x3d9a('0x1c')][_0x38cdb5['linkedid']]['linkedid']=_0x38cdb5[_0x3d9a('0x3b')];if(_0x38cdb5['calleridnum']!==_0x3d9a('0x6e')){this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x4a')]=_0x38cdb5[_0x3d9a('0x69')];}this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x6f')]=_0x38cdb5[_0x3d9a('0x68')];this[_0x3d9a('0x1c')][_0x38cdb5['linkedid']]['destinationchannel']=_0x38cdb5[_0x3d9a('0x43')];this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]]['disposition']=dispositions[_[_0x3d9a('0x52')](_0x38cdb5['channelstate'])];if(this[_0x3d9a('0x1d')][_0x38cdb5[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]]){this['channels'][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x70')]=this[_0x3d9a('0x1d')][_0x38cdb5[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]]['id'];this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]]['membername']=this['agents'][_0x38cdb5[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]][_0x3d9a('0x48')];}}}}else{if(this['channels'][_0x38cdb5['uniqueid']]){if(_0x38cdb5[_0x3d9a('0x71')]==='6'){if(this[_0x3d9a('0x1d')][_0x38cdb5[_0x3d9a('0x43')]['split']('-')[0x0]]){this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3b')]]['UserId']=this['agents'][_0x38cdb5['channel'][_0x3d9a('0x44')]('-')[0x0]]['id'];this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3b')]]['membername']=this[_0x3d9a('0x1d')][_0x38cdb5[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]]['name'];}}}}if(_0x38cdb5[_0x3d9a('0x71')]==='6'&&_0x38cdb5[_0x3d9a('0x41')]===_0x3d9a('0x42')){if(this[_0x3d9a('0x1d')][_0x38cdb5[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]]){this['agents'][_0x38cdb5[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]][_0x3d9a('0x53')]=_0x38cdb5[_0x3d9a('0x45')];var _0x2081e8;if(this['channels'][_0x38cdb5[_0x3d9a('0x3b')]])_0x2081e8=this['channels'][_0x38cdb5[_0x3d9a('0x3b')]][_0x3d9a('0x72')];else if(this[_0x3d9a('0x1c')][_0x38cdb5['linkedid']])_0x2081e8=this[_0x3d9a('0x1c')][_0x38cdb5[_0x3d9a('0x3d')]][_0x3d9a('0x72')];logger[_0x3d9a('0x3c')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x38cdb5['uniqueid'],util[_0x3d9a('0x36')]({'destaccountcode':this[_0x3d9a('0x1d')][_0x38cdb5['channel']['split']('-')[0x0]][_0x3d9a('0x55')],'destconnectedlinenum':_0x38cdb5['exten'],'routealias':_0x2081e8},{'showHidden':![],'depth':null}));this[_0x3d9a('0x39')](util[_0x3d9a('0x46')](_0x3d9a('0x47'),this['agents'][_0x38cdb5[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]][_0x3d9a('0x48')]),_0x3d9a('0x49'),{'destaccountcode':this[_0x3d9a('0x1d')][_0x38cdb5['channel']['split']('-')[0x0]][_0x3d9a('0x55')],'destconnectedlinenum':_0x38cdb5[_0x3d9a('0x45')],'routealias':_0x2081e8});}}}}catch(_0x208b37){logger[_0x3d9a('0x34')]('[%s][voiceCallReport][newstate]',_0x38cdb5['uniqueid'],util[_0x3d9a('0x36')](_0x208b37,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3d9a('0x38')]['syncMixMonitorFilename']=function(_0x561570,_0xd0f0b5){try{if(this['channels'][_0x561570]){logger[_0x3d9a('0x32')](_0x3d9a('0x73'),_0x561570,_0xd0f0b5);this[_0x3d9a('0x1c')][_0x561570]['monitor']=!![];if(_[_0x3d9a('0x74')](_0xd0f0b5,_0x3d9a('0x75'))){_0xd0f0b5=_0xd0f0b5[_0x3d9a('0x76')](_0x3d9a('0x75'),_0x3d9a('0x77'));}this['channels'][_0x561570][_0x3d9a('0x78')]=_0xd0f0b5;var _0x8997e0=_['find'](this[_0x3d9a('0x1c')][_0x561570][_0x3d9a('0x79')],{'filename':_0xd0f0b5});if(_['isNil'](_0x8997e0)){this['channels'][_0x561570]['monitors']['push']({'filename':_0xd0f0b5,'createdAt':moment()['format'](_0x3d9a('0x50')),'mixmonitorid':'','status':_0x3d9a('0x7a')});}}}catch(_0x44c58d){logger[_0x3d9a('0x34')](_0x3d9a('0x7b'),_0x561570,util[_0x3d9a('0x36')](_0x44c58d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x2bd62b){try{if(this[_0x3d9a('0x4c')](_0x2bd62b)){logger[_0x3d9a('0x3c')]('[%s][voiceCallReport][varset]\x20event:',_0x2bd62b['uniqueid'],util[_0x3d9a('0x36')](_0x2bd62b,{'showHidden':![],'depth':null}));if(this[_0x3d9a('0x1c')][_0x2bd62b[_0x3d9a('0x3b')]]&&_0x2bd62b[_0x3d9a('0x43')]!=_0x3d9a('0x4e')){if(this[_0x3d9a('0x4c')](_0x2bd62b[_0x3d9a('0x7c')])){if(this['isNotNull'](_0x2bd62b[_0x3d9a('0x7c')]['mixmonitor_filename'])){logger[_0x3d9a('0x32')](_0x3d9a('0x7d'),_0x2bd62b[_0x3d9a('0x3b')],_0x2bd62b[_0x3d9a('0x7e')]);this[_0x3d9a('0x7f')](_0x2bd62b['uniqueid'],_0x2bd62b[_0x3d9a('0x7e')]);}else if(this['isNotNull'](_0x2bd62b[_0x3d9a('0x7c')][_0x3d9a('0x80')])){logger[_0x3d9a('0x32')](_0x3d9a('0x81'),_0x2bd62b[_0x3d9a('0x3b')],_0x2bd62b[_0x3d9a('0x7e')]);this['channels'][_0x2bd62b[_0x3d9a('0x3b')]][_0x3d9a('0x69')]=_0x2bd62b[_0x3d9a('0x7e')];}else if(this[_0x3d9a('0x4c')](_0x2bd62b[_0x3d9a('0x7c')][_0x3d9a('0x82')])){logger[_0x3d9a('0x32')](_0x3d9a('0x83'),_0x2bd62b[_0x3d9a('0x3b')],_0x2bd62b[_0x3d9a('0x7e')]);this[_0x3d9a('0x1c')][_0x2bd62b['uniqueid']][_0x3d9a('0x84')]=_0x2bd62b[_0x3d9a('0x7e')];}else if(this[_0x3d9a('0x4c')](_0x2bd62b[_0x3d9a('0x7c')]['xmd-cdrtype'])){logger[_0x3d9a('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x2bd62b[_0x3d9a('0x3b')],_0x2bd62b['value']);this[_0x3d9a('0x1c')][_0x2bd62b[_0x3d9a('0x3b')]]['type']=_0x2bd62b['value'];}else if(this['isNotNull'](_0x2bd62b[_0x3d9a('0x7c')][_0x3d9a('0x85')])){logger['info'](_0x3d9a('0x86'),_0x2bd62b[_0x3d9a('0x3b')],_0x2bd62b[_0x3d9a('0x7e')][_0x3d9a('0x44')](',')[0x0]);this['channels'][_0x2bd62b[_0x3d9a('0x3b')]][_0x3d9a('0x65')]=_0x2bd62b[_0x3d9a('0x7e')][_0x3d9a('0x44')](',')[0x0];}else if(this[_0x3d9a('0x4c')](_0x2bd62b[_0x3d9a('0x7c')][_0x3d9a('0x87')])){logger['info'](_0x3d9a('0x88'),_0x2bd62b[_0x3d9a('0x3b')],_0x2bd62b[_0x3d9a('0x7e')]);this['channels'][_0x2bd62b[_0x3d9a('0x3b')]]['originatecalleridnum']=_0x2bd62b[_0x3d9a('0x7e')];}else if(this[_0x3d9a('0x4c')](_0x2bd62b[_0x3d9a('0x7c')]['xmd-destination'])){logger[_0x3d9a('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x2bd62b[_0x3d9a('0x3b')],_0x2bd62b[_0x3d9a('0x7e')]);this['channels'][_0x2bd62b['uniqueid']]['destination']=_0x2bd62b['value'];}else if(this[_0x3d9a('0x4c')](_0x2bd62b[_0x3d9a('0x7c')][_0x3d9a('0x89')])){logger[_0x3d9a('0x32')](_0x3d9a('0x8a'),_0x2bd62b[_0x3d9a('0x3b')],_0x2bd62b[_0x3d9a('0x7e')]);this['channels'][_0x2bd62b[_0x3d9a('0x3b')]][_0x3d9a('0x8b')]=_0x2bd62b['value'];}else if(this[_0x3d9a('0x4c')](_0x2bd62b['variable'][_0x3d9a('0x8c')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x2bd62b['uniqueid'],_0x2bd62b['value']);this[_0x3d9a('0x1c')][_0x2bd62b[_0x3d9a('0x3b')]][_0x3d9a('0x65')]=_0x2bd62b[_0x3d9a('0x7e')];}else if(this['isNotNull'](_0x2bd62b[_0x3d9a('0x7c')][_0x3d9a('0x8d')])){logger['info'](_0x3d9a('0x8e'),_0x2bd62b['uniqueid'],_0x2bd62b[_0x3d9a('0x7e')]);this[_0x3d9a('0x1c')][_0x2bd62b[_0x3d9a('0x3b')]][_0x3d9a('0x8f')]=_0x2bd62b[_0x3d9a('0x7e')];}}}else if(this[_0x3d9a('0x4c')](_0x2bd62b[_0x3d9a('0x7c')][_0x3d9a('0x90')])){if(_0x2bd62b[_0x3d9a('0x7e')]){var _0x1d1846=path[_0x3d9a('0x91')](_0x2bd62b['value'])['name'];logger[_0x3d9a('0x32')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1d1846,_0x2bd62b[_0x3d9a('0x7e')]);this['syncMixMonitorFilename'](_0x1d1846,_0x2bd62b[_0x3d9a('0x7e')]);}}else if(this['channels'][_0x2bd62b[_0x3d9a('0x3d')]]){if(this[_0x3d9a('0x4c')](_0x2bd62b[_0x3d9a('0x7c')])){if(this[_0x3d9a('0x4c')](_0x2bd62b['variable'][_0x3d9a('0x8d')])){logger[_0x3d9a('0x32')](_0x3d9a('0x8e'),_0x2bd62b[_0x3d9a('0x3d')],_0x2bd62b[_0x3d9a('0x7e')]);this['channels'][_0x2bd62b[_0x3d9a('0x3d')]]['sipcalllinkedid']=_0x2bd62b['value'];}}}}}catch(_0xa7179){logger[_0x3d9a('0x34')](_0x3d9a('0x92'),_0x2bd62b[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0xa7179,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3d9a('0x28')]=function(_0x70a2f0){try{if(this['isNotNull'](_0x70a2f0)){logger['debug'](_0x3d9a('0x93'),_0x70a2f0['uniqueid'],util[_0x3d9a('0x36')](_0x70a2f0,{'showHidden':![],'depth':null}));if(this[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]]){logger[_0x3d9a('0x32')](_0x3d9a('0x94'),_0x70a2f0[_0x3d9a('0x3b')],_0x70a2f0[_0x3d9a('0x95')]);var _0x3ac002=moment();this[_0x3d9a('0x1c')][_0x70a2f0['uniqueid']][_0x3d9a('0x96')]=_0x3ac002[_0x3d9a('0x46')](_0x3d9a('0x50'));this[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0x5e')]=_0x3ac002[_0x3d9a('0x6d')](this['channels'][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0x6c')],_0x3d9a('0x5f'));if(this[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0x6a')]){this[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]]['billableseconds']=_0x3ac002['diff'](this[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]]['answertime'],_0x3d9a('0x5f'));this[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0x97')]=this[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0x5e')]-this[_0x3d9a('0x1c')][_0x70a2f0['uniqueid']][_0x3d9a('0x98')];}if(_0x70a2f0['context']===_0x3d9a('0x42')){if(this['agents'][_0x70a2f0[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]]){this[_0x3d9a('0x1d')][_0x70a2f0[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]]=_[_0x3d9a('0x99')](this[_0x3d9a('0x1d')][_0x70a2f0[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]],['destconnectedlinenum']);logger[_0x3d9a('0x3c')](_0x3d9a('0x9a'),_0x70a2f0['uniqueid'],util[_0x3d9a('0x36')]({'id':this[_0x3d9a('0x1d')][_0x70a2f0[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x70a2f0[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]][_0x3d9a('0x55')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x3d9a('0x47'),this[_0x3d9a('0x1d')][_0x70a2f0['channel']['split']('-')[0x0]][_0x3d9a('0x48')]),_0x3d9a('0x9b'),{'id':this[_0x3d9a('0x1d')][_0x70a2f0[_0x3d9a('0x43')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x70a2f0[_0x3d9a('0x43')][_0x3d9a('0x44')]('-')[0x0]][_0x3d9a('0x55')]});}}var _0x10118b=this;Promise[_0x3d9a('0x9c')]()[_0x3d9a('0x9d')](function(){var _0x127b96=_0x10118b[_0x3d9a('0x1c')][_0x70a2f0['uniqueid']];if(typeof _0x127b96[_0x3d9a('0x9e')]==='undefined')return;if(_[_0x3d9a('0x9f')](_0x127b96[_0x3d9a('0x79')]))return;return RpcSetting[_0x3d9a('0xa0')]()['then'](function(_0x1fba3e){if(!_0x1fba3e['stopRecordingOnTransfer'])return;return Promise[_0x3d9a('0x9c')]()[_0x3d9a('0x9d')](function(){return ami[_0x3d9a('0xa1')]({'action':_0x3d9a('0xa2'),'channel':_0x127b96[_0x3d9a('0x43')]})['catch'](function(){});})['then'](function(){return ami[_0x3d9a('0xa1')]({'action':_0x3d9a('0xa2'),'channel':_0x127b96[_0x3d9a('0xa3')]})[_0x3d9a('0xa4')](function(){})['finally'](function(){var _0x4e56fb=_0x10118b['agents'][_0x127b96[_0x3d9a('0xa3')][_0x3d9a('0x44')]('-')[0x0]];if(!_0x4e56fb)return;io['emit']('webbar:stopmonitors',{'agentId':_0x4e56fb['id'],'uniqueid':_0x127b96['uniqueid']});});});});})['then'](function(){if(_0x70a2f0[_0x3d9a('0xa5')]===_0x3d9a('0xa6')){_0x10118b[_0x3d9a('0x1e')][_0x70a2f0['uniqueid']]=_0x10118b[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]];}else{if(_0x10118b[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0xa7')]===_0x3d9a('0xa8')&&_0x10118b[_0x3d9a('0x1e')][_0x70a2f0[_0x3d9a('0x3b')]]){_0x10118b[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0x3b')]=[_0x10118b[_0x3d9a('0x1c')][_0x70a2f0['uniqueid']][_0x3d9a('0x3d')],_0x10118b[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0x3d')]=_0x10118b[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]][_0x3d9a('0x3b')]][0x0];delete _0x10118b['blindTransfers'][_0x70a2f0[_0x3d9a('0x3b')]];}}logger[_0x3d9a('0x3c')](_0x3d9a('0xa9'),_0x70a2f0[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x10118b[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceCallReport',_0x10118b[_0x3d9a('0x1c')][_0x70a2f0['uniqueid']]);delete _0x10118b[_0x3d9a('0x1c')][_0x70a2f0[_0x3d9a('0x3b')]];});}}}catch(_0x4681e2){logger['error'](_0x3d9a('0xaa'),_0x70a2f0[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x4681e2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x2b')]=function(_0x4fb3b7){try{if(this[_0x3d9a('0x4c')](_0x4fb3b7)){logger[_0x3d9a('0x32')](_0x3d9a('0xab'),_0x4fb3b7['uniqueid'],_0x4fb3b7['origtransferercalleridnum'],_0x4fb3b7[_0x3d9a('0xac')]);logger[_0x3d9a('0x3c')](_0x3d9a('0xad'),_0x4fb3b7[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x4fb3b7,{'showHidden':![],'depth':null}));if(this[_0x3d9a('0x1c')][_0x4fb3b7['transfereeuniqueid']]){this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xae')]]['transfercalleridnum']=_0x4fb3b7[_0x3d9a('0xaf')];this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xae')]][_0x3d9a('0xb0')]=_0x4fb3b7[_0x3d9a('0xac')];if(this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb1')]]){var _0xc1faf1=this[_0x3d9a('0x1c')][_0x4fb3b7['secondtransfereruniqueid']];this[_0x3d9a('0x1c')][_0x4fb3b7['secondtransfereruniqueid']]=this[_0x3d9a('0x1c')][_0x4fb3b7['transfereeuniqueid']];this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xae')]]=_0xc1faf1;}}else if(this['channels'][_0x4fb3b7[_0x3d9a('0xb2')]]){this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb2')]][_0x3d9a('0xb3')]=_0x4fb3b7[_0x3d9a('0xaf')];this[_0x3d9a('0x1c')][_0x4fb3b7['transfertargetuniqueid']][_0x3d9a('0xb0')]=_0x4fb3b7[_0x3d9a('0xac')];if(this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb4')]]){var _0xc1faf1=this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb4')]];this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb4')]]=this['channels'][_0x4fb3b7[_0x3d9a('0xb2')]];this['channels'][_0x4fb3b7[_0x3d9a('0xb2')]]=_0xc1faf1;}}if((this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb4')]]||this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb5')]])&&this[_0x3d9a('0x1c')][_0x4fb3b7['secondtransfereruniqueid']]){var _0x47536a=_[_0x3d9a('0xb6')]([this[_0x3d9a('0x1c')][_0x4fb3b7['origtransfereruniqueid']],this['channels'][_0x4fb3b7[_0x3d9a('0xb5')]],this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb1')]]],function(_0xb03901){return _0xb03901&&_0xb03901[_0x3d9a('0xa7')]===_0x3d9a('0xa8')&&_0xb03901[_0x3d9a('0xb7')];});if(_0x47536a){if(this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb4')]])this[_0x3d9a('0x1c')][_0x4fb3b7['origtransfereruniqueid']][_0x3d9a('0x9e')]=_0x3d9a('0xb8');if(this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb5')]])this[_0x3d9a('0x1c')][_0x4fb3b7['origtransfererlinkedid']][_0x3d9a('0x9e')]=_0x3d9a('0xb8');this[_0x3d9a('0x1c')][_0x4fb3b7[_0x3d9a('0xb1')]]['transferType']=_0x3d9a('0xb8');}}}}catch(_0x1930c8){logger[_0x3d9a('0x34')](_0x3d9a('0xb9'),_0x4fb3b7[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x1930c8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x2d')]=function(_0x193e6a){try{if(this[_0x3d9a('0x4c')](_0x193e6a)){logger[_0x3d9a('0x32')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x193e6a[_0x3d9a('0x3b')],_0x193e6a['transfereecalleridnum'],_0x193e6a['extension']);logger['debug'](_0x3d9a('0xba'),_0x193e6a['uniqueid'],util['inspect'](_0x193e6a,{'showHidden':![],'depth':null}));if(this[_0x3d9a('0x1c')][_0x193e6a[_0x3d9a('0xae')]]){this[_0x3d9a('0x1c')][_0x193e6a['transfereeuniqueid']][_0x3d9a('0xb3')]=_0x193e6a[_0x3d9a('0xbb')];this[_0x3d9a('0x1c')][_0x193e6a[_0x3d9a('0xae')]]['transferconnectedlinenum']=_0x193e6a[_0x3d9a('0xbc')];this[_0x3d9a('0x1c')][_0x193e6a[_0x3d9a('0xae')]][_0x3d9a('0x9e')]=_0x3d9a('0xbd');this[_0x3d9a('0x28')]({'event':'BlindTransfer','uniqueid':_0x193e6a[_0x3d9a('0xae')],'context':_0x193e6a['context'],'channel':_0x193e6a['transfererchannel']});}else{this[_0x3d9a('0x1c')][_0x193e6a[_0x3d9a('0xbe')]][_0x3d9a('0x9e')]='BLIND';}}}catch(_0x489330){logger[_0x3d9a('0x34')](_0x3d9a('0xbf'),_0x193e6a[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x489330,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x2f')]=function(_0x33e7db){try{if(this[_0x3d9a('0x4c')](_0x33e7db)){logger[_0x3d9a('0x3c')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x33e7db[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x33e7db,{'showHidden':![],'depth':null}));if(this[_0x3d9a('0x1c')][_0x33e7db['uniqueid']]){if(!_[_0x3d9a('0xc0')](this[_0x3d9a('0x1c')][_0x33e7db[_0x3d9a('0x3b')]]['answertime'])){this['channels'][_0x33e7db[_0x3d9a('0x3b')]][_0x3d9a('0xc1')]=moment()[_0x3d9a('0x46')](_0x3d9a('0x50'));logger['info'](_0x3d9a('0xc2'),_0x33e7db[_0x3d9a('0x3b')],this[_0x3d9a('0x1c')][_0x33e7db[_0x3d9a('0x3b')]]['mohstarttime']);}}}}catch(_0x4c7feb){logger['error'](_0x3d9a('0xc3'),_0x33e7db['uniqueid'],util[_0x3d9a('0x36')](_0x4c7feb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3d9a('0x38')][_0x3d9a('0x31')]=function(_0x364c15){try{if(this[_0x3d9a('0x4c')](_0x364c15)){logger[_0x3d9a('0x3c')](_0x3d9a('0xc4'),_0x364c15[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0x364c15,{'showHidden':![],'depth':null}));if(this[_0x3d9a('0x1c')][_0x364c15[_0x3d9a('0x3b')]]){if(!_[_0x3d9a('0xc0')](this[_0x3d9a('0x1c')][_0x364c15[_0x3d9a('0x3b')]][_0x3d9a('0xc1')])){this['channels'][_0x364c15['uniqueid']][_0x3d9a('0xc5')]+=moment()[_0x3d9a('0xc6')](0x0)[_0x3d9a('0x6d')](this[_0x3d9a('0x1c')][_0x364c15['uniqueid']][_0x3d9a('0xc1')],_0x3d9a('0x5f'));logger[_0x3d9a('0x32')](_0x3d9a('0xc7'),_0x364c15[_0x3d9a('0x3b')],this[_0x3d9a('0x1c')][_0x364c15[_0x3d9a('0x3b')]][_0x3d9a('0xc5')]);delete this[_0x3d9a('0x1c')][_0x364c15['uniqueid']]['mohstarttime'];}}}}catch(_0xa8378c){logger[_0x3d9a('0x34')](_0x3d9a('0xc8'),_0x364c15[_0x3d9a('0x3b')],util[_0x3d9a('0x36')](_0xa8378c,{'showHidden':![],'depth':null}));}};module[_0x3d9a('0xc9')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 7061f80..15a950f 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f3b=['syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','isUndefined','emit','isNotNull','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','substring','privilege','membername','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice_outbound_channel:save','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','info','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','value','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','outbound','answered','holdtime','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','application','toLowerCase','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','moment','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','channels','syncDialBegin','bind','dialend','syncDialEnd'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0x3f3b,0x14d));var _0xb3f3=function(_0x5241f8,_0x461fcf){_0x5241f8=_0x5241f8-0x0;var _0x11b932=_0x3f3b[_0x5241f8];return _0x11b932;};'use strict';var _=require('lodash');var moment=require(_0xb3f3('0x0'));var util=require(_0xb3f3('0x1'));var Redis=require('ioredis');var config=require(_0xb3f3('0x2'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');config[_0xb3f3('0x3')]=_[_0xb3f3('0x4')](config[_0xb3f3('0x3')],{'host':_0xb3f3('0x5'),'port':0x18eb});var io=require(_0xb3f3('0x6'))(new Redis(config['redis']));function VoiceDialReport(_0xa1506){this[_0xb3f3('0x7')]=_0xa1506['outboundChannels'];this['outbound']=_0xa1506['outbound'];this['applications']={};this['variables']={};ami['on']('dialbegin',this[_0xb3f3('0x8')][_0xb3f3('0x9')](this));ami['on'](_0xb3f3('0xa'),this[_0xb3f3('0xb')][_0xb3f3('0x9')](this));ami['on']('varset',this[_0xb3f3('0xc')][_0xb3f3('0x9')](this));ami['on'](_0xb3f3('0xd'),this[_0xb3f3('0xe')][_0xb3f3('0x9')](this));ami['on'](_0xb3f3('0xf'),this[_0xb3f3('0x10')][_0xb3f3('0x9')](this));}VoiceDialReport[_0xb3f3('0x11')]['isNotNull']=function(_0xfb39ce){return _0xfb39ce!==null&&!_[_0xb3f3('0x12')](_0xfb39ce);};VoiceDialReport[_0xb3f3('0x11')][_0xb3f3('0x13')]=function(_0x4cbb14,_0x11dd12,_0x4de1b4){io['to'](_0x4cbb14)[_0xb3f3('0x13')](_0x11dd12,_0x4de1b4);};VoiceDialReport[_0xb3f3('0x11')][_0xb3f3('0x8')]=function(_0x37e308){try{if(this[_0xb3f3('0x14')](_0x37e308)){logger['debug'](_0xb3f3('0x15'),_0x37e308[_0xb3f3('0x16')],util[_0xb3f3('0x17')](_0x37e308,{'showHidden':![],'depth':null}));if(this[_0xb3f3('0x7')][_0x37e308[_0xb3f3('0x16')]]){_[_0xb3f3('0x18')](this[_0xb3f3('0x7')][_0x37e308[_0xb3f3('0x16')]],{'starttime':moment()[_0xb3f3('0x19')](_0xb3f3('0x1a')),'lastevent':_0xb3f3('0x1b'),'interface':_0x37e308[_0xb3f3('0x1c')]['substring'](0x0,_0x37e308[_0xb3f3('0x1c')][_0xb3f3('0x1d')]('-')),'membername':_0x37e308['channel'][_0xb3f3('0x1e')](_0x37e308[_0xb3f3('0x1c')][_0xb3f3('0x1d')]('/')+0x1,_0x37e308[_0xb3f3('0x1c')][_0xb3f3('0x1d')]('-'))},_['omit'](_0x37e308,['event',_0xb3f3('0x1f')]));logger['info']('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x37e308['uniqueid'],this[_0xb3f3('0x7')][_0x37e308[_0xb3f3('0x16')]][_0xb3f3('0x20')],this[_0xb3f3('0x7')][_0x37e308[_0xb3f3('0x16')]]['interface']);logger[_0xb3f3('0x21')](_0xb3f3('0x22'),_0x37e308[_0xb3f3('0x16')],util[_0xb3f3('0x17')](this[_0xb3f3('0x7')][_0x37e308[_0xb3f3('0x16')]],{'showHidden':![],'depth':null}));if(this[_0xb3f3('0x23')][_0x37e308['uniqueid']])_[_0xb3f3('0x18')](this[_0xb3f3('0x7')][_0x37e308['uniqueid']],this[_0xb3f3('0x23')][_0x37e308[_0xb3f3('0x16')]]);this[_0xb3f3('0x13')]('voice:outbound',_0xb3f3('0x24'),this[_0xb3f3('0x7')][_0x37e308[_0xb3f3('0x16')]]);logger[_0xb3f3('0x21')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x37e308[_0xb3f3('0x16')],util[_0xb3f3('0x17')](this[_0xb3f3('0x7')][_0x37e308[_0xb3f3('0x16')]],{'showHidden':![],'depth':null}));ami[_0xb3f3('0x13')]('custom:dialbegin',this[_0xb3f3('0x7')][_0x37e308['uniqueid']]);}}}catch(_0x5cb546){logger[_0xb3f3('0x25')](_0xb3f3('0x26'),_0x37e308[_0xb3f3('0x16')],util[_0xb3f3('0x17')](_0x5cb546,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb3f3('0x11')][_0xb3f3('0xb')]=function(_0x153070){try{if(this[_0xb3f3('0x14')](_0x153070)){logger[_0xb3f3('0x21')](_0xb3f3('0x27'),_0x153070[_0xb3f3('0x16')],util[_0xb3f3('0x17')](_0x153070,{'showHidden':![],'depth':null}));if(this[_0xb3f3('0x7')][_0x153070[_0xb3f3('0x16')]]){this[_0xb3f3('0x7')][_0x153070['uniqueid']][_0xb3f3('0x28')]=_0x153070[_0xb3f3('0x28')];if(_0x153070[_0xb3f3('0x28')]==='ANSWER'){this[_0xb3f3('0x7')][_0x153070[_0xb3f3('0x16')]][_0xb3f3('0x29')]=_0x153070[_0xb3f3('0x29')];this[_0xb3f3('0x7')][_0x153070['uniqueid']]['connectedlinename']=_0x153070[_0xb3f3('0x2a')];this[_0xb3f3('0x7')][_0x153070[_0xb3f3('0x16')]][_0xb3f3('0x2b')]=moment()[_0xb3f3('0x19')](_0xb3f3('0x1a'));this['channels'][_0x153070['uniqueid']][_0xb3f3('0x2c')]='connect';logger[_0xb3f3('0x2d')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x153070[_0xb3f3('0x16')],_0x153070['channel'][_0xb3f3('0x1e')](_0x153070[_0xb3f3('0x1c')]['lastIndexOf']('/')+0x1,_0x153070[_0xb3f3('0x1c')][_0xb3f3('0x1d')]('-')));logger[_0xb3f3('0x21')](_0xb3f3('0x2e'),_0x153070[_0xb3f3('0x16')],util[_0xb3f3('0x17')](this[_0xb3f3('0x7')][_0x153070[_0xb3f3('0x16')]],{'showHidden':![],'depth':null}));ami[_0xb3f3('0x13')](_0xb3f3('0x2f'),this[_0xb3f3('0x7')][_0x153070[_0xb3f3('0x16')]]);}logger[_0xb3f3('0x21')](_0xb3f3('0x30'),_0x153070[_0xb3f3('0x16')],util['inspect'](this['channels'][_0x153070[_0xb3f3('0x16')]],{'showHidden':![],'depth':null}));this[_0xb3f3('0x13')](_0xb3f3('0x31'),_0xb3f3('0x24'),this[_0xb3f3('0x7')][_0x153070[_0xb3f3('0x16')]]);}}}catch(_0x374a24){logger[_0xb3f3('0x25')](_0xb3f3('0x32'),_0x153070[_0xb3f3('0x16')],util['inspect'](_0x374a24,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb3f3('0x11')][_0xb3f3('0xc')]=function(_0x56cc4a){try{if(this['isNotNull'](_0x56cc4a)){logger[_0xb3f3('0x21')](_0xb3f3('0x33'),_0x56cc4a[_0xb3f3('0x16')],util[_0xb3f3('0x17')](_0x56cc4a,{'showHidden':![],'depth':null}));this['addVariable'](_0x56cc4a[_0xb3f3('0x16')],_[_0xb3f3('0x34')](_0x56cc4a[_0xb3f3('0x35')])[0x0],_0x56cc4a[_0xb3f3('0x36')]);if(this[_0xb3f3('0x14')](_0x56cc4a['variable'])&&this['isNotNull'](_0x56cc4a[_0xb3f3('0x35')]['outboundrouteid'])){if(_['isUndefined'](this[_0xb3f3('0x7')][_0x56cc4a[_0xb3f3('0x16')]])){this[_0xb3f3('0x7')][_0x56cc4a[_0xb3f3('0x16')]]={'routeId':_0x56cc4a[_0xb3f3('0x36')],'variables':this[_0xb3f3('0x37')][_0x56cc4a['uniqueid']],'motionChannel':_0xb3f3('0x38')};logger[_0xb3f3('0x2d')](_0xb3f3('0x39'),_0x56cc4a[_0xb3f3('0x16')],_0x56cc4a[_0xb3f3('0x35')][_0xb3f3('0x3a')],_[_0xb3f3('0x34')](_0x56cc4a[_0xb3f3('0x35')])[0x0],_0x56cc4a[_0xb3f3('0x36')]);logger['debug'](_0xb3f3('0x3b'),_0x56cc4a['uniqueid'],util[_0xb3f3('0x17')](this['channels'][_0x56cc4a[_0xb3f3('0x16')]],{'showHidden':![],'depth':null}));this['emit'](_0xb3f3('0x31'),_0xb3f3('0x24'),this[_0xb3f3('0x7')][_0x56cc4a[_0xb3f3('0x16')]]);}}}}catch(_0x3e9949){logger['error'](_0xb3f3('0x3c'),_0x56cc4a[_0xb3f3('0x16')],util[_0xb3f3('0x17')](_0x3e9949,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb3f3('0x11')][_0xb3f3('0x3d')]=function(_0x4736e4,_0x34195f,_0x11a78c){var _0x5e6855=[_0xb3f3('0x3e'),_0xb3f3('0x3f'),_0xb3f3('0x40'),_0xb3f3('0x41'),_0xb3f3('0x42'),_0xb3f3('0x43'),_0xb3f3('0x44'),_0xb3f3('0x45'),_0xb3f3('0x46'),_0xb3f3('0x47'),_0xb3f3('0x48'),_0xb3f3('0x49'),_0xb3f3('0x4a'),_0xb3f3('0x4b'),_0xb3f3('0x4c'),_0xb3f3('0x4d'),'membername','memberpenalty','memberrealtime'];if(!_[_0xb3f3('0x4e')](_0x34195f)&&!_[_0xb3f3('0x4f')](_0x5e6855,_0x34195f)){if(_['isUndefined'](this[_0xb3f3('0x37')][_0x4736e4])){this[_0xb3f3('0x37')][_0x4736e4]={};}this[_0xb3f3('0x37')][_0x4736e4][_0x34195f]=_0x11a78c;}};VoiceDialReport[_0xb3f3('0x11')][_0xb3f3('0x10')]=function(_0x278f25){try{if(this[_0xb3f3('0x14')](_0x278f25)){logger['debug'](_0xb3f3('0x50'),_0x278f25[_0xb3f3('0x16')],util['inspect'](_0x278f25,{'showHidden':![],'depth':null}));if(this[_0xb3f3('0x7')][_0x278f25['uniqueid']]){logger[_0xb3f3('0x2d')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x278f25[_0xb3f3('0x16')],_0x278f25[_0xb3f3('0x51')]);this['channels'][_0x278f25['uniqueid']][_0xb3f3('0x52')]=moment()[_0xb3f3('0x19')](_0xb3f3('0x1a'));this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]][_0xb3f3('0x53')]=moment(this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]][_0xb3f3('0x52')])[_0xb3f3('0x54')](this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]][_0xb3f3('0x55')],_0xb3f3('0x56'));this[_0xb3f3('0x7')][_0x278f25['uniqueid']]['lastevent']=_0xb3f3('0x57');this['outbound'][_0xb3f3('0x58')]+=0x1;if(this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]][_0xb3f3('0x2b')]){this[_0xb3f3('0x59')][_0xb3f3('0x5a')]+=0x1;this[_0xb3f3('0x7')][_0x278f25['uniqueid']][_0xb3f3('0x5b')]=moment(this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]][_0xb3f3('0x2b')])[_0xb3f3('0x54')](this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]]['starttime'],_0xb3f3('0x56'));this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]]['billableseconds']=moment(this[_0xb3f3('0x7')][_0x278f25['uniqueid']][_0xb3f3('0x52')])['diff'](this[_0xb3f3('0x7')][_0x278f25['uniqueid']][_0xb3f3('0x2b')],'seconds');this[_0xb3f3('0x59')]['sumHoldTime']+=this[_0xb3f3('0x7')][_0x278f25['uniqueid']][_0xb3f3('0x5b')]||0x0;this[_0xb3f3('0x59')]['sumBillable']+=this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]][_0xb3f3('0x5c')];}this['outbound'][_0xb3f3('0x5d')]+=this[_0xb3f3('0x7')][_0x278f25['uniqueid']][_0xb3f3('0x53')];logger[_0xb3f3('0x21')](_0xb3f3('0x5e'),_0x278f25[_0xb3f3('0x16')],util[_0xb3f3('0x17')](this['channels'][_0x278f25[_0xb3f3('0x16')]],{'showHidden':![],'depth':null}));ami[_0xb3f3('0x13')](_0xb3f3('0x5f'),this['channels'][_0x278f25[_0xb3f3('0x16')]]);logger[_0xb3f3('0x21')](_0xb3f3('0x60'),_0x278f25[_0xb3f3('0x16')],util[_0xb3f3('0x17')](this['channels'][_0x278f25[_0xb3f3('0x16')]],{'showHidden':![],'depth':null}));ami[_0xb3f3('0x13')](_0xb3f3('0x61'),this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]]);logger[_0xb3f3('0x21')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x278f25[_0xb3f3('0x16')],util[_0xb3f3('0x17')](this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]],{'showHidden':![],'depth':null}));this['emit'](_0xb3f3('0x31'),_0xb3f3('0x62'),this['outbound']);logger[_0xb3f3('0x2d')](_0xb3f3('0x63'),JSON['stringify'](this[_0xb3f3('0x7')][_0x278f25['uniqueid']]));logger['debug'](_0xb3f3('0x64'),_0x278f25[_0xb3f3('0x16')],util[_0xb3f3('0x17')](this['channels'][_0x278f25['uniqueid']],{'showHidden':![],'depth':null}));this[_0xb3f3('0x13')](_0xb3f3('0x31'),_0xb3f3('0x65'),this[_0xb3f3('0x7')][_0x278f25['uniqueid']]);delete this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x16')]];}else if(this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x66')]]){this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x66')]][_0xb3f3('0x16')]=this[_0xb3f3('0x7')][_0x278f25[_0xb3f3('0x66')]][_0xb3f3('0x67')];}if(this['variables'][_0x278f25[_0xb3f3('0x16')]]){delete this[_0xb3f3('0x37')][_0x278f25['uniqueid']];}}}catch(_0x1b472b){logger[_0xb3f3('0x25')](_0xb3f3('0x68'),_0x278f25[_0xb3f3('0x16')],util[_0xb3f3('0x17')](_0x1b472b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb3f3('0x11')]['syncNewExten']=function(_0x553b4d){try{if(this[_0xb3f3('0x14')](_0x553b4d)){logger[_0xb3f3('0x21')]('[%s][voiceDialReport][newexten]\x20event:',_0x553b4d[_0xb3f3('0x16')],util[_0xb3f3('0x17')](_0x553b4d,{'showHidden':![],'depth':null}));if(_0x553b4d[_0xb3f3('0x69')][_0xb3f3('0x6a')]()==='set'){_0x553b4d[_0xb3f3('0x6b')]=(_0x553b4d[_0xb3f3('0x6c')]||_0x553b4d[_0xb3f3('0x6b')])[_0xb3f3('0x6a')]();if(_[_0xb3f3('0x6d')](_0x553b4d['applicationdata'],_0xb3f3('0x6e'))){if(_[_0xb3f3('0x12')](this[_0xb3f3('0x23')][_0x553b4d['uniqueid']]))this[_0xb3f3('0x23')][_0x553b4d[_0xb3f3('0x16')]]={};logger['info'](_0xb3f3('0x6f'),_0x553b4d[_0xb3f3('0x16')],_0x553b4d[_0xb3f3('0x69')],_0x553b4d[_0xb3f3('0x6b')]);var _0x18bb1d=_0x553b4d['applicationdata'][_0xb3f3('0x70')]('=');var _0xdf64c2=_0x18bb1d[0x0]['match'](/cdr\((.*)\)/);if(_0xdf64c2)this[_0xb3f3('0x23')][_0x553b4d[_0xb3f3('0x16')]][_0xdf64c2[0x1]]=_0x18bb1d[0x1];}}}}catch(_0x300db6){logger[_0xb3f3('0x25')](_0xb3f3('0x71'),_0x553b4d[_0xb3f3('0x16')],util[_0xb3f3('0x17')](_0x300db6,{'showHidden':![],'depth':null}));}};module[_0xb3f3('0x72')]=VoiceDialReport; \ No newline at end of file +var _0xce86=['outbound','applications','variables','dialbegin','syncDialEnd','varset','syncVarSet','bind','newexten','hangup','isNotNull','isUndefined','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','privilege','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','info','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','complete','total','holdtime','billableseconds','sumHoldTime','sumBillable','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','toLowerCase','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','outboundChannels'];(function(_0x237af2,_0x4e8225){var _0x422ede=function(_0x2b5628){while(--_0x2b5628){_0x237af2['push'](_0x237af2['shift']());}};_0x422ede(++_0x4e8225);}(_0xce86,0x150));var _0x6ce8=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0xce86[_0x33155c];return _0x5becf7;};'use strict';var _=require(_0x6ce8('0x0'));var moment=require('moment');var util=require(_0x6ce8('0x1'));var Redis=require(_0x6ce8('0x2'));var config=require(_0x6ce8('0x3'));var logger=require(_0x6ce8('0x4'))(_0x6ce8('0x5'));var ami=require(_0x6ce8('0x6'));config[_0x6ce8('0x7')]=_[_0x6ce8('0x8')](config[_0x6ce8('0x7')],{'host':_0x6ce8('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6ce8('0x7')]));function VoiceDialReport(_0x460fa3){this[_0x6ce8('0xa')]=_0x460fa3[_0x6ce8('0xb')];this[_0x6ce8('0xc')]=_0x460fa3[_0x6ce8('0xc')];this[_0x6ce8('0xd')]={};this[_0x6ce8('0xe')]={};ami['on'](_0x6ce8('0xf'),this['syncDialBegin']['bind'](this));ami['on']('dialend',this[_0x6ce8('0x10')]['bind'](this));ami['on'](_0x6ce8('0x11'),this[_0x6ce8('0x12')][_0x6ce8('0x13')](this));ami['on'](_0x6ce8('0x14'),this['syncNewExten']['bind'](this));ami['on'](_0x6ce8('0x15'),this['syncHangup'][_0x6ce8('0x13')](this));}VoiceDialReport['prototype'][_0x6ce8('0x16')]=function(_0x44f8c3){return _0x44f8c3!==null&&!_[_0x6ce8('0x17')](_0x44f8c3);};VoiceDialReport[_0x6ce8('0x18')][_0x6ce8('0x19')]=function(_0x18bbc6,_0x258b34,_0x5f4c1e){io['to'](_0x18bbc6)[_0x6ce8('0x19')](_0x258b34,_0x5f4c1e);};VoiceDialReport[_0x6ce8('0x18')]['syncDialBegin']=function(_0x1b6878){try{if(this[_0x6ce8('0x16')](_0x1b6878)){logger[_0x6ce8('0x1a')](_0x6ce8('0x1b'),_0x1b6878[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](_0x1b6878,{'showHidden':![],'depth':null}));if(this[_0x6ce8('0xa')][_0x1b6878[_0x6ce8('0x1c')]]){_[_0x6ce8('0x1e')](this[_0x6ce8('0xa')][_0x1b6878['uniqueid']],{'starttime':moment()[_0x6ce8('0x1f')](_0x6ce8('0x20')),'lastevent':'called','interface':_0x1b6878[_0x6ce8('0x21')][_0x6ce8('0x22')](0x0,_0x1b6878[_0x6ce8('0x21')]['lastIndexOf']('-')),'membername':_0x1b6878[_0x6ce8('0x21')][_0x6ce8('0x22')](_0x1b6878['channel'][_0x6ce8('0x23')]('/')+0x1,_0x1b6878[_0x6ce8('0x21')][_0x6ce8('0x23')]('-'))},_[_0x6ce8('0x24')](_0x1b6878,['event',_0x6ce8('0x25')]));logger['info']('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x1b6878['uniqueid'],this['channels'][_0x1b6878[_0x6ce8('0x1c')]]['membername'],this[_0x6ce8('0xa')][_0x1b6878['uniqueid']][_0x6ce8('0x26')]);logger[_0x6ce8('0x1a')](_0x6ce8('0x27'),_0x1b6878['uniqueid'],util[_0x6ce8('0x1d')](this[_0x6ce8('0xa')][_0x1b6878[_0x6ce8('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0x6ce8('0xd')][_0x1b6878[_0x6ce8('0x1c')]])_['merge'](this[_0x6ce8('0xa')][_0x1b6878['uniqueid']],this[_0x6ce8('0xd')][_0x1b6878[_0x6ce8('0x1c')]]);this[_0x6ce8('0x19')](_0x6ce8('0x28'),_0x6ce8('0x29'),this['channels'][_0x1b6878[_0x6ce8('0x1c')]]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x1b6878[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](this['channels'][_0x1b6878[_0x6ce8('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x6ce8('0x19')]('custom:dialbegin',this[_0x6ce8('0xa')][_0x1b6878[_0x6ce8('0x1c')]]);}}}catch(_0x14da12){logger[_0x6ce8('0x2a')](_0x6ce8('0x2b'),_0x1b6878[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](_0x14da12,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6ce8('0x18')][_0x6ce8('0x10')]=function(_0x3c5973){try{if(this[_0x6ce8('0x16')](_0x3c5973)){logger[_0x6ce8('0x1a')](_0x6ce8('0x2c'),_0x3c5973['uniqueid'],util[_0x6ce8('0x1d')](_0x3c5973,{'showHidden':![],'depth':null}));if(this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]]){this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]][_0x6ce8('0x2d')]=_0x3c5973[_0x6ce8('0x2d')];if(_0x3c5973[_0x6ce8('0x2d')]===_0x6ce8('0x2e')){this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]][_0x6ce8('0x2f')]=_0x3c5973['connectedlinenum'];this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]][_0x6ce8('0x30')]=_0x3c5973['connectedlinename'];this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]][_0x6ce8('0x31')]=moment()[_0x6ce8('0x1f')](_0x6ce8('0x20'));this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]]['lastevent']=_0x6ce8('0x32');logger['info'](_0x6ce8('0x33'),_0x3c5973[_0x6ce8('0x1c')],_0x3c5973['channel']['substring'](_0x3c5973[_0x6ce8('0x21')][_0x6ce8('0x23')]('/')+0x1,_0x3c5973[_0x6ce8('0x21')]['lastIndexOf']('-')));logger[_0x6ce8('0x1a')](_0x6ce8('0x34'),_0x3c5973['uniqueid'],util['inspect'](this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x6ce8('0x35'),this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]]);}logger[_0x6ce8('0x1a')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3c5973['uniqueid'],util[_0x6ce8('0x1d')](this['channels'][_0x3c5973[_0x6ce8('0x1c')]],{'showHidden':![],'depth':null}));this[_0x6ce8('0x19')]('voice:outbound','voice_outbound_channel:save',this[_0x6ce8('0xa')][_0x3c5973[_0x6ce8('0x1c')]]);}}}catch(_0x41a040){logger[_0x6ce8('0x2a')](_0x6ce8('0x36'),_0x3c5973[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](_0x41a040,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6ce8('0x18')][_0x6ce8('0x12')]=function(_0x7ef557){try{if(this[_0x6ce8('0x16')](_0x7ef557)){logger[_0x6ce8('0x1a')](_0x6ce8('0x37'),_0x7ef557[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](_0x7ef557,{'showHidden':![],'depth':null}));this[_0x6ce8('0x38')](_0x7ef557[_0x6ce8('0x1c')],_[_0x6ce8('0x39')](_0x7ef557[_0x6ce8('0x3a')])[0x0],_0x7ef557[_0x6ce8('0x3b')]);if(this[_0x6ce8('0x16')](_0x7ef557['variable'])&&this[_0x6ce8('0x16')](_0x7ef557[_0x6ce8('0x3a')][_0x6ce8('0x3c')])){if(_[_0x6ce8('0x17')](this[_0x6ce8('0xa')][_0x7ef557[_0x6ce8('0x1c')]])){this[_0x6ce8('0xa')][_0x7ef557[_0x6ce8('0x1c')]]={'routeId':_0x7ef557[_0x6ce8('0x3b')],'variables':this['variables'][_0x7ef557[_0x6ce8('0x1c')]],'motionChannel':_0x6ce8('0x3d')};logger[_0x6ce8('0x3e')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x7ef557['uniqueid'],_0x7ef557[_0x6ce8('0x3a')][_0x6ce8('0x3c')],_['keys'](_0x7ef557[_0x6ce8('0x3a')])[0x0],_0x7ef557[_0x6ce8('0x3b')]);logger[_0x6ce8('0x1a')](_0x6ce8('0x3f'),_0x7ef557[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](this[_0x6ce8('0xa')][_0x7ef557[_0x6ce8('0x1c')]],{'showHidden':![],'depth':null}));this[_0x6ce8('0x19')](_0x6ce8('0x28'),_0x6ce8('0x29'),this[_0x6ce8('0xa')][_0x7ef557[_0x6ce8('0x1c')]]);}}}}catch(_0x5d26fc){logger[_0x6ce8('0x2a')](_0x6ce8('0x40'),_0x7ef557[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](_0x5d26fc,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x6ce8('0x38')]=function(_0x164272,_0x12a627,_0x3df1e1){var _0x51812c=[_0x6ce8('0x41'),_0x6ce8('0x42'),_0x6ce8('0x43'),'rtpaudioqosjitterbridged',_0x6ce8('0x44'),'rtpaudioqoslossbridged',_0x6ce8('0x45'),_0x6ce8('0x46'),_0x6ce8('0x47'),_0x6ce8('0x48'),'bridgepeer',_0x6ce8('0x49'),_0x6ce8('0x4a'),_0x6ce8('0x4b'),_0x6ce8('0x4c'),_0x6ce8('0x4d'),_0x6ce8('0x4e'),_0x6ce8('0x4f'),_0x6ce8('0x50')];if(!_[_0x6ce8('0x51')](_0x12a627)&&!_[_0x6ce8('0x52')](_0x51812c,_0x12a627)){if(_[_0x6ce8('0x17')](this[_0x6ce8('0xe')][_0x164272])){this[_0x6ce8('0xe')][_0x164272]={};}this[_0x6ce8('0xe')][_0x164272][_0x12a627]=_0x3df1e1;}};VoiceDialReport[_0x6ce8('0x18')][_0x6ce8('0x53')]=function(_0x4f35c9){try{if(this['isNotNull'](_0x4f35c9)){logger[_0x6ce8('0x1a')](_0x6ce8('0x54'),_0x4f35c9['uniqueid'],util[_0x6ce8('0x1d')](_0x4f35c9,{'showHidden':![],'depth':null}));if(this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]]){logger[_0x6ce8('0x3e')](_0x6ce8('0x55'),_0x4f35c9[_0x6ce8('0x1c')],_0x4f35c9[_0x6ce8('0x56')]);this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x57')]=moment()[_0x6ce8('0x1f')](_0x6ce8('0x20'));this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]]['duration']=moment(this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x57')])[_0x6ce8('0x58')](this['channels'][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x59')],_0x6ce8('0x5a'));this[_0x6ce8('0xa')][_0x4f35c9['uniqueid']]['lastevent']=_0x6ce8('0x5b');this['outbound'][_0x6ce8('0x5c')]+=0x1;if(this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]]['answertime']){this[_0x6ce8('0xc')]['answered']+=0x1;this[_0x6ce8('0xa')][_0x4f35c9['uniqueid']][_0x6ce8('0x5d')]=moment(this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]]['answertime'])['diff'](this['channels'][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x59')],_0x6ce8('0x5a'));this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x5e')]=moment(this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x57')])['diff'](this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x31')],_0x6ce8('0x5a'));this[_0x6ce8('0xc')][_0x6ce8('0x5f')]+=this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x5d')]||0x0;this['outbound'][_0x6ce8('0x60')]+=this['channels'][_0x4f35c9[_0x6ce8('0x1c')]][_0x6ce8('0x5e')];}this[_0x6ce8('0xc')]['sumDuration']+=this[_0x6ce8('0xa')][_0x4f35c9['uniqueid']]['duration'];logger[_0x6ce8('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x4f35c9[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x6ce8('0x19')](_0x6ce8('0x61'),this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]]);logger['debug'](_0x6ce8('0x62'),_0x4f35c9['uniqueid'],util[_0x6ce8('0x1d')](this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x6ce8('0x19')](_0x6ce8('0x63'),this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x1c')]]);logger[_0x6ce8('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x4f35c9['uniqueid'],util[_0x6ce8('0x1d')](this['channels'][_0x4f35c9[_0x6ce8('0x1c')]],{'showHidden':![],'depth':null}));this[_0x6ce8('0x19')](_0x6ce8('0x28'),_0x6ce8('0x64'),this['outbound']);logger[_0x6ce8('0x3e')](_0x6ce8('0x65'),JSON['stringify'](this['channels'][_0x4f35c9[_0x6ce8('0x1c')]]));logger[_0x6ce8('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x4f35c9[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](this[_0x6ce8('0xa')][_0x4f35c9['uniqueid']],{'showHidden':![],'depth':null}));this[_0x6ce8('0x19')]('voice:outbound',_0x6ce8('0x66'),this['channels'][_0x4f35c9[_0x6ce8('0x1c')]]);delete this['channels'][_0x4f35c9[_0x6ce8('0x1c')]];}else if(this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x67')]]){this[_0x6ce8('0xa')][_0x4f35c9['linkedid']]['uniqueid']=this[_0x6ce8('0xa')][_0x4f35c9[_0x6ce8('0x67')]][_0x6ce8('0x68')];}if(this['variables'][_0x4f35c9[_0x6ce8('0x1c')]]){delete this['variables'][_0x4f35c9[_0x6ce8('0x1c')]];}}}catch(_0x16cd8b){logger[_0x6ce8('0x2a')](_0x6ce8('0x69'),_0x4f35c9[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](_0x16cd8b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6ce8('0x18')]['syncNewExten']=function(_0x3e4188){try{if(this[_0x6ce8('0x16')](_0x3e4188)){logger[_0x6ce8('0x1a')](_0x6ce8('0x6a'),_0x3e4188['uniqueid'],util[_0x6ce8('0x1d')](_0x3e4188,{'showHidden':![],'depth':null}));if(_0x3e4188[_0x6ce8('0x6b')]['toLowerCase']()===_0x6ce8('0x6c')){_0x3e4188[_0x6ce8('0x6d')]=(_0x3e4188['appdata']||_0x3e4188[_0x6ce8('0x6d')])[_0x6ce8('0x6e')]();if(_['startsWith'](_0x3e4188[_0x6ce8('0x6d')],_0x6ce8('0x6f'))){if(_[_0x6ce8('0x17')](this[_0x6ce8('0xd')][_0x3e4188[_0x6ce8('0x1c')]]))this[_0x6ce8('0xd')][_0x3e4188[_0x6ce8('0x1c')]]={};logger[_0x6ce8('0x3e')](_0x6ce8('0x70'),_0x3e4188['uniqueid'],_0x3e4188[_0x6ce8('0x6b')],_0x3e4188['applicationdata']);var _0x6bdf58=_0x3e4188[_0x6ce8('0x6d')][_0x6ce8('0x71')]('=');var _0x42554d=_0x6bdf58[0x0]['match'](/cdr\((.*)\)/);if(_0x42554d)this[_0x6ce8('0xd')][_0x3e4188['uniqueid']][_0x42554d[0x1]]=_0x6bdf58[0x1];}}}}catch(_0x3e3d68){logger[_0x6ce8('0x2a')](_0x6ce8('0x72'),_0x3e4188[_0x6ce8('0x1c')],util[_0x6ce8('0x1d')](_0x3e3d68,{'showHidden':![],'depth':null}));}};module[_0x6ce8('0x73')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 48006c0..3863766 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9086=['transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','set','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','application','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','prototype','enqueue','tail','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','bind','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','syncHangup','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','clearZombieChannels','channels','switch','isNil','status','channel','catch','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','error','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','available','sumBillable','sumDuration','sumHoldTime','total','unmanaged','waiting','Trunk','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','format','voice_queue:save','Action','queues','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','callers','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','emitVoiceQueueChannelSave','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','membername','reason','transfer','toLowerCase','local/','linkedid','queuecallerexit','queuecallerexitAt','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','CONTINUE','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','abandoned','length','milliseconds','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten'];(function(_0x5e54ea,_0x27a035){var _0x5ebbfb=function(_0x1a4968){while(--_0x1a4968){_0x5e54ea['push'](_0x5e54ea['shift']());}};_0x5ebbfb(++_0x27a035);}(_0x9086,0x10b));var _0x6908=function(_0x41227c,_0x5485f2){_0x41227c=_0x41227c-0x0;var _0x47f3a8=_0x9086[_0x41227c];return _0x47f3a8;};'use strict';var _=require(_0x6908('0x0'));var moment=require(_0x6908('0x1'));var util=require('util');var md5=require(_0x6908('0x2'));var Redis=require(_0x6908('0x3'));var config=require(_0x6908('0x4'));var logger=require(_0x6908('0x5'))(_0x6908('0x6'));var ami=require(_0x6908('0x7'));var QueueReport=require('../model/queueReport');config[_0x6908('0x8')]=_['defaults'](config['redis'],{'host':_0x6908('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6908('0x8')]));var Sequence=function(){};Sequence[_0x6908('0xa')][_0x6908('0xb')]=function(_0x56df93){this[_0x6908('0xc')]=this['tail']?this[_0x6908('0xc')]['finally'](_0x56df93):_0x56df93();};function VoiceQueueReport(_0x652982){this[_0x6908('0xd')]=new Sequence();this[_0x6908('0xe')]={};this[_0x6908('0xf')]=_0x652982[_0x6908('0xf')];this['channels']=_0x652982[_0x6908('0x10')];this[_0x6908('0x11')]=_0x652982[_0x6908('0x11')];this[_0x6908('0x12')]=!![];this[_0x6908('0x13')]=_0x652982[_0x6908('0x13')];this[_0x6908('0x14')]={};ami['on'](_0x6908('0x15'),this[_0x6908('0x16')]['bind'](this));ami['on'](_0x6908('0x17'),this['syncQueueSummaryComplete'][_0x6908('0x18')](this));ami['on'](_0x6908('0x19'),this['syncQueueCallerJoin'][_0x6908('0x18')](this));ami['on'](_0x6908('0x1a'),this[_0x6908('0x1b')][_0x6908('0x18')](this));ami['on'](_0x6908('0x1c'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0x6908('0x1d'),this[_0x6908('0x1e')][_0x6908('0x18')](this));ami['on']('agentconnect',this[_0x6908('0x1f')]['bind'](this));ami['on'](_0x6908('0x20'),this[_0x6908('0x21')][_0x6908('0x18')](this));ami['on']('hangup',this[_0x6908('0x22')][_0x6908('0x18')](this));ami['on']('fullybooted',this[_0x6908('0x23')][_0x6908('0x18')](this));ami['on'](_0x6908('0x24'),this[_0x6908('0x25')][_0x6908('0x18')](this));ami['on'](_0x6908('0x26'),this[_0x6908('0x27')][_0x6908('0x18')](this));ami['on'](_0x6908('0x28'),this[_0x6908('0x29')][_0x6908('0x18')](this));ami['on'](_0x6908('0x2a'),this[_0x6908('0x2b')][_0x6908('0x18')](this));ami['on'](_0x6908('0x2c'),this[_0x6908('0x2d')][_0x6908('0x18')](this));this[_0x6908('0x2e')]();this[_0x6908('0x2f')]();}function clearChannels(_0x56a1e8){if(!_[_0x6908('0x30')](_0x56a1e8)){for(var _0x1854dc in _0x56a1e8){if(_0x56a1e8['hasOwnProperty'](_0x1854dc)){delete _0x56a1e8[_0x1854dc];}}}}function clearCampaigns(_0x92caac){if(!_['isEmpty'](_0x92caac)){for(var _0x5232be in _0x92caac){if(_0x92caac[_0x6908('0x31')](_0x5232be)){_0x92caac[_0x5232be][_0x6908('0x32')]=0x0;}}}}function clearVoiceQueues(_0x1244ce){if(!_[_0x6908('0x30')](_0x1244ce)){for(var _0x362ce7 in _0x1244ce){if(_0x1244ce[_0x6908('0x31')](_0x362ce7)){_0x1244ce[_0x362ce7][_0x6908('0x32')]=0x0;_0x1244ce[_0x362ce7][_0x6908('0x33')]=0x0;_0x1244ce[_0x362ce7][_0x6908('0x34')]=0x0;_0x1244ce[_0x362ce7]['waiting']=0x0;_0x1244ce[_0x362ce7][_0x6908('0x35')]=!![];}}}}function clearAgentBooked(_0x315234){if(!_[_0x6908('0x30')](_0x315234)){for(var _0x44be5d in _0x315234){if(_0x315234['hasOwnProperty'](_0x44be5d)){_0x315234[_0x44be5d]['unlockRR']=!![];}}}}VoiceQueueReport[_0x6908('0xa')][_0x6908('0x36')]=function(){var _0x1e775a=this;for(var _0x2e67f2 in this[_0x6908('0x37')]){if(this[_0x6908('0x37')][_0x6908('0x31')](_0x2e67f2)&&!this[_0x6908('0x37')][_0x2e67f2][_0x6908('0x38')]){this[_0x6908('0xd')][_0x6908('0xb')](function(){if(!_[_0x6908('0x39')](_0x1e775a['channels'][_0x2e67f2])){return ami['Action']({'action':_0x6908('0x3a'),'channel':_0x1e775a[_0x6908('0x37')][_0x2e67f2][_0x6908('0x3b')]})[_0x6908('0x3c')](function(_0x34e733){if(_0x34e733['message']===_0x6908('0x3d')){setTimeout(function(){if(_0x1e775a[_0x6908('0x37')][_0x2e67f2]){delete _0x1e775a[_0x6908('0x37')][_0x2e67f2];logger['error'](_0x6908('0x3e'),_0x2e67f2,util[_0x6908('0x3f')](_0x34e733,{'showHidden':![],'depth':null}));}if(_0x1e775a['queueReports'][_0x2e67f2]){delete _0x1e775a[_0x6908('0xe')][_0x2e67f2];logger['error'](_0x6908('0x40'),_0x2e67f2,util['inspect'](_0x34e733,{'showHidden':![],'depth':null}));}if(_0x1e775a[_0x6908('0x14')][_0x2e67f2]){delete _0x1e775a['variables'][_0x2e67f2];logger[_0x6908('0x41')](_0x6908('0x42'),_0x2e67f2,util[_0x6908('0x3f')](_0x34e733,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x23')]=function(){logger[_0x6908('0x41')](_0x6908('0x43'));clearChannels(this[_0x6908('0x37')]);this[_0x6908('0x44')](this[_0x6908('0xe')]);clearAgentBooked(this[_0x6908('0xf')]);clearVoiceQueues(this[_0x6908('0x11')]);clearCampaigns(this[_0x6908('0x13')]);};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x44')]=function(_0x5619d6){var _0x559db1=this;if(!_[_0x6908('0x30')](_0x5619d6)){for(var _0x359c06 in _0x5619d6){if(_0x5619d6[_0x6908('0x31')](_0x359c06)){_0x559db1[_0x6908('0x45')](_0x5619d6[_0x359c06],'clearqueuereport');delete _0x5619d6[_0x359c06];}}}};VoiceQueueReport[_0x6908('0xa')]['emit']=function(_0x104cd5,_0x425fd3,_0x2ee150){io['to'](_0x104cd5)[_0x6908('0x46')](_0x425fd3,_0x2ee150);};VoiceQueueReport[_0x6908('0xa')]['emitVoiceQueueChannelSave']=function(_0x30b41f,_0x31d450){logger[_0x6908('0x47')](_0x6908('0x48')+_0x31d450+_0x6908('0x49'),_0x30b41f[_0x6908('0x4a')],util['inspect'](_0x30b41f,{'showHidden':![],'depth':null}));this[_0x6908('0x46')](util['format'](_0x6908('0x4b'),_0x30b41f[_0x6908('0x4c')]),_0x6908('0x4d'),_0x30b41f);io[_0x6908('0x46')](_0x6908('0x4e'),_0x30b41f);};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x45')]=function(_0x20ed64,_0xba7b12){logger[_0x6908('0x47')](_0x6908('0x48')+_0xba7b12+_0x6908('0x4f'),_0x20ed64['uniqueid'],util[_0x6908('0x3f')](_0x20ed64,{'showHidden':![],'depth':null}));this[_0x6908('0x46')](util['format']('voice:queue:%s',_0x20ed64['name']),_0x6908('0x50'),_0x20ed64);io[_0x6908('0x46')](_0x6908('0x51'),_0x20ed64);};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x52')]=function(_0x165926,_0x42b020){if(_0x165926[_0x6908('0x53')]===_0x6908('0x54')){var _0x27ddc3={'id':_0x165926['id'],'name':_0x165926[_0x6908('0x4c')],'strategy':_0x165926['strategy'],'answered':_0x165926[_0x6908('0x55')],'available':_0x165926[_0x6908('0x56')],'loggedIn':_0x165926['loggedIn'],'pTalking':_0x165926[_0x6908('0x34')],'sumBillable':_0x165926[_0x6908('0x57')],'sumDuration':_0x165926[_0x6908('0x58')],'sumHoldTime':_0x165926[_0x6908('0x59')]||0x0,'talking':_0x165926[_0x6908('0x33')],'total':_0x165926[_0x6908('0x5a')],'type':_0x165926[_0x6908('0x53')],'unmanaged':_0x165926[_0x6908('0x5b')],'abandoned':_0x165926['abandoned'],'waiting':_0x165926[_0x6908('0x5c')]};if(_0x165926[_0x6908('0x5d')]){_0x27ddc3[_0x6908('0x5d')]={'id':_0x165926['Trunk']['id'],'name':_0x165926[_0x6908('0x5d')]['name'],'active':_0x165926['Trunk']['active'],'callerid':_0x165926[_0x6908('0x5d')][_0x6908('0x5e')]};}if(_0x165926[_0x6908('0x5f')]){_0x27ddc3['Interval']={'id':_0x165926[_0x6908('0x5f')]['id'],'name':_0x165926[_0x6908('0x5f')][_0x6908('0x4c')]};}var _0x2ba84a=md5(JSON[_0x6908('0x60')](_0x27ddc3));if(_0x165926[_0x6908('0x2')]!==_0x2ba84a){_0x165926['md5']=_0x2ba84a;logger['debug'](_0x6908('0x61')+_0x42b020+_0x6908('0x62'),util[_0x6908('0x3f')](_0x27ddc3,{'showHidden':![],'depth':null}));this[_0x6908('0x46')](util[_0x6908('0x63')]('voice:queue:%s',_0x27ddc3['name']),_0x6908('0x64'),_0x27ddc3);}}};VoiceQueueReport[_0x6908('0xa')]['isNotNull']=function(_0x352a18){return _0x352a18!==null&&!_['isUndefined'](_0x352a18);};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x2f')]=function(){var _0x28a7a6=this;setInterval(function(){_0x28a7a6['clearZombieChannels']();ami[_0x6908('0x65')]({'action':_0x6908('0x66')})[_0x6908('0x3c')](function(_0x35b831){logger[_0x6908('0x41')]('[voiceQueueReport][queues]',util[_0x6908('0x3f')](_0x35b831,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x2e')]=function(){var _0x19b11e=this;setInterval(function(){if(_0x19b11e[_0x6908('0x12')]){return ami[_0x6908('0x65')]({'action':'queuesummary'})[_0x6908('0x67')](function(_0x45b95b){_0x19b11e[_0x6908('0x12')]=![];})[_0x6908('0x3c')](function(_0x123ee6){logger[_0x6908('0x41')](_0x6908('0x68'),util['inspect'](_0x123ee6,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x6908('0x16')]=function(_0x494de9){try{if(this[_0x6908('0x69')](_0x494de9)&&this['isNotNull'](_0x494de9[_0x6908('0x6a')])){logger['debug'](_0x6908('0x6b'),util['inspect'](_0x494de9,{'showHidden':![],'depth':null}));if(this[_0x6908('0x11')][_0x494de9['queue']]){logger[_0x6908('0x6c')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x494de9['queue']);var _0x3b2095=_[_0x6908('0x6d')](this[_0x6908('0x37')],_0x6908('0x6a'))[_0x494de9[_0x6908('0x6a')]]||0x0;var _0x1fa632=_0x3b2095-_0x494de9[_0x6908('0x6e')];if(this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]][_0x6908('0x5c')]!==_[_0x6908('0x6f')](_0x494de9['callers'])||this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]][_0x6908('0x70')]!==_['toNumber'](_0x494de9[_0x6908('0x71')])||this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]][_0x6908('0x56')]!==_[_0x6908('0x6f')](_0x494de9[_0x6908('0x56')])||this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]]['talking']!==_0x1fa632){this['voiceQueues'][_0x494de9[_0x6908('0x6a')]][_0x6908('0x5c')]=_[_0x6908('0x6f')](_0x494de9[_0x6908('0x6e')]);this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]][_0x6908('0x70')]=_['toNumber'](_0x494de9[_0x6908('0x71')]);this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]][_0x6908('0x56')]=_[_0x6908('0x6f')](_0x494de9[_0x6908('0x56')]);this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]][_0x6908('0x33')]=_0x1fa632>0x0?_0x1fa632:0x0;this['voiceQueues'][_0x494de9['queue']][_0x6908('0x33')]=this['voiceQueues'][_0x494de9[_0x6908('0x6a')]][_0x6908('0x33')]>_[_0x6908('0x6f')](_0x494de9[_0x6908('0x71')])?_['toNumber'](_0x494de9[_0x6908('0x71')]):this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]][_0x6908('0x33')];this[_0x6908('0x52')](this['voiceQueues'][_0x494de9[_0x6908('0x6a')]],_0x6908('0x15'));}logger['debug'](_0x6908('0x72'),util[_0x6908('0x3f')](this[_0x6908('0x11')][_0x494de9['queue']],{'showHidden':![],'depth':null}));ami[_0x6908('0x46')](_0x6908('0x73'),this[_0x6908('0x11')][_0x494de9[_0x6908('0x6a')]]);}}}catch(_0x53cb46){logger[_0x6908('0x41')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x53cb46,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x74')]=function(_0xbb5c89){logger[_0x6908('0x47')](_0x6908('0x75'),util[_0x6908('0x3f')](_0xbb5c89,{'showHidden':![],'depth':null}));this[_0x6908('0x12')]=!![];};VoiceQueueReport[_0x6908('0xa')]['syncQueueCallerJoin']=function(_0x41f4c2){try{if(this['isNotNull'](_0x41f4c2)){logger[_0x6908('0x47')](_0x6908('0x76'),_0x41f4c2[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x41f4c2,{'showHidden':![],'depth':null}));if(_[_0x6908('0x77')](this['queueReports'][_0x41f4c2[_0x6908('0x4a')]]))this[_0x6908('0xe')][_0x41f4c2['uniqueid']]=[];if(_['isUndefined'](this[_0x6908('0x37')][_0x41f4c2[_0x6908('0x4a')]]))this[_0x6908('0x37')][_0x41f4c2[_0x6908('0x4a')]]={};var _0x55a23c=new QueueReport();_0x55a23c['name']=_0x41f4c2['queue'];_0x55a23c['type']=this['voiceQueues'][_0x55a23c[_0x6908('0x4c')]]&&this[_0x6908('0x11')][_0x55a23c['name']][_0x6908('0x53')]?this[_0x6908('0x11')][_0x55a23c['name']][_0x6908('0x53')]||'inbound':_0x6908('0x54');_0x55a23c['queue']=_0x41f4c2[_0x6908('0x6a')];_0x55a23c['queuecallerjoinAt']=moment()[_0x6908('0x63')](_0x6908('0x78'));_0x55a23c['position']=_0x41f4c2[_0x6908('0x79')];_0x55a23c[_0x6908('0x7a')]=_0x41f4c2[_0x6908('0x7a')];_0x55a23c[_0x6908('0x4a')]=_0x41f4c2[_0x6908('0x4a')];_0x55a23c[_0x6908('0x7b')]=this[_0x6908('0x37')][_0x41f4c2[_0x6908('0x4a')]]['routealias'];logger[_0x6908('0x6c')](_0x6908('0x7c'),_0x55a23c[_0x6908('0x4c')],_0x55a23c[_0x6908('0x53')]);_[_0x6908('0x7d')](_0x55a23c,_['pick'](_0x41f4c2,_[_0x6908('0x7e')](_0x55a23c)));this[_0x6908('0xe')][_0x41f4c2[_0x6908('0x4a')]][_0x6908('0x7f')](_0x55a23c);this[_0x6908('0x37')][_0x41f4c2['uniqueid']]=_0x55a23c;this['emitVoiceQueueChannelSave'](_0x55a23c,_0x6908('0x19'));}}catch(_0xb8fa2f){logger[_0x6908('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0x41f4c2['uniqueid'],util['inspect'](_0xb8fa2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x1b')]=function(_0x5d89bd){try{if(this['isNotNull'](_0x5d89bd)){logger[_0x6908('0x47')](_0x6908('0x80'),_0x5d89bd[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x5d89bd,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5d89bd['uniqueid']]){var _0x3fd4c1=_[_0x6908('0x81')](this['queueReports'][_0x5d89bd[_0x6908('0x4a')]]);_0x3fd4c1[_0x6908('0x82')]=![];_0x3fd4c1['queuecallercompleteAt']=null;_0x3fd4c1[_0x6908('0x83')]=_0x5d89bd[_0x6908('0x83')];_0x3fd4c1[_0x6908('0x84')]=_0x5d89bd['originalposition'];_0x3fd4c1[_0x6908('0x1a')]=!![];_0x3fd4c1['queuecallerabandonAt']=moment()['format'](_0x6908('0x78'));_0x3fd4c1[_0x6908('0x85')]=_0x6908('0x86');_0x3fd4c1[_0x6908('0x87')]=null;logger[_0x6908('0x6c')](_0x6908('0x88'),_0x3fd4c1[_0x6908('0x4c')],_0x3fd4c1[_0x6908('0x53')]);this[_0x6908('0x37')][_0x5d89bd['uniqueid']]=_0x3fd4c1;this[_0x6908('0x45')](_0x3fd4c1,_0x6908('0x1a'));}}}catch(_0x4a469e){logger[_0x6908('0x41')](_0x6908('0x80'),_0x5d89bd[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x4a469e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x89')]=function(_0x19860f){try{if(this[_0x6908('0x69')](_0x19860f)){logger[_0x6908('0x47')](_0x6908('0x8a'),_0x19860f[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x19860f,{'showHidden':![],'depth':null}));if(this[_0x6908('0xe')][_0x19860f['uniqueid']]){var _0x47510f=_[_0x6908('0x81')](this[_0x6908('0xe')][_0x19860f[_0x6908('0x4a')]]);_0x47510f[_0x6908('0x8b')]=moment()[_0x6908('0x63')](_0x6908('0x78'));_0x47510f[_0x6908('0x8c')]=_0x19860f['connectedlinenum'];_0x47510f[_0x6908('0x8d')]=_0x19860f[_0x6908('0x8d')];logger['info'](_0x6908('0x8e'),_0x47510f[_0x6908('0x4c')],_0x47510f[_0x6908('0x53')],_0x19860f[_0x6908('0x8c')],_0x19860f['connectedlinename']);this[_0x6908('0x37')][_0x19860f[_0x6908('0x4a')]]=_0x47510f;this[_0x6908('0x8f')](_0x47510f,_0x6908('0x1c'));}}}catch(_0x490bc5){logger[_0x6908('0x41')](_0x6908('0x8a'),_0x19860f[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x490bc5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x1f')]=function(_0x311c0c){try{if(this[_0x6908('0x69')](_0x311c0c)){logger[_0x6908('0x47')](_0x6908('0x90'),_0x311c0c[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x311c0c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x311c0c[_0x6908('0x4a')]]){var _0x4e6274=_[_0x6908('0x81')](this['queueReports'][_0x311c0c[_0x6908('0x4a')]]);_0x4e6274[_0x6908('0x82')]=!![];_0x4e6274['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x6908('0x6c')](_0x6908('0x91'),_0x4e6274[_0x6908('0x4c')],_0x4e6274[_0x6908('0x53')]);}}}catch(_0x505a65){logger[_0x6908('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x311c0c[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x505a65,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6908('0x1e')]=function(_0x5d9586){try{if(this['isNotNull'](_0x5d9586)){logger[_0x6908('0x47')](_0x6908('0x92'),_0x5d9586[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x5d9586,{'showHidden':![],'depth':null}));if(this[_0x6908('0xe')][_0x5d9586['uniqueid']]){var _0x118255=_[_0x6908('0x81')](this['queueReports'][_0x5d9586[_0x6908('0x4a')]]);_0x118255[_0x6908('0x1a')]=![];_0x118255[_0x6908('0x93')]=null;_0x118255['assigned']=!![];_0x118255[_0x6908('0x87')]=_0x5d9586[_0x6908('0x94')];_0x118255[_0x6908('0x83')]=_0x5d9586[_0x6908('0x83')];_0x118255[_0x6908('0x82')]=!![];_0x118255['queuecallerexit']=![];_0x118255['queuecallerexitAt']=null;if(!_0x118255['transfer']){if(_0x5d9586[_0x6908('0x95')]==_0x6908('0x96')){_0x118255[_0x6908('0x85')]='COMPLETED';logger[_0x6908('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x118255['name'],_0x118255['type']);}else{if(_['startsWith'](_0x5d9586['channel'][_0x6908('0x97')](),_0x6908('0x98'))){if(this['queueReports'][_0x5d9586[_0x6908('0x99')]]){var _0x3a109c=_[_0x6908('0x81')](this[_0x6908('0xe')][_0x5d9586['linkedid']]);_0x3a109c['queuecallercomplete']=![];_0x3a109c[_0x6908('0x9a')]=!![];_0x3a109c[_0x6908('0x9b')]=moment(_0x118255[_0x6908('0x9c')])[_0x6908('0x9d')](_0x5d9586[_0x6908('0x83')],_0x6908('0x9e'))[_0x6908('0x63')](_0x6908('0x78'));_0x3a109c[_0x6908('0x85')]=_0x6908('0x9f');_0x3a109c['transfer']=!![];_0x3a109c[_0x6908('0xa0')]=_0x6908('0xa1');_0x3a109c[_0x6908('0xa2')]=_0x5d9586[_0x6908('0xa3')];_0x3a109c['transferuniqueid']=_0x5d9586[_0x6908('0x4a')];logger['info'](_0x6908('0xa4'),_0x3a109c['name'],_0x3a109c[_0x6908('0x53')]);var _0x589e80=this[_0x6908('0xe')][_0x5d9586[_0x6908('0x99')]];this['queueReports'][_0x5d9586[_0x6908('0x99')]]=this['queueReports'][_0x5d9586[_0x6908('0x4a')]];this[_0x6908('0xe')][_0x5d9586[_0x6908('0x4a')]]=_0x589e80;}}else{_0x118255['queuecallerexitreason']=_0x6908('0xa5')+_0x5d9586[_0x6908('0x95')]['toUpperCase']();logger[_0x6908('0x6c')](_0x6908('0xa6'),_0x118255[_0x6908('0x4c')],_0x118255[_0x6908('0x53')],_0x118255['queuecallerexitreason']);}}}this[_0x6908('0x37')][_0x5d9586[_0x6908('0x4a')]]=_0x118255;this['emitVoiceQueueChannelRemove'](_0x118255,_0x6908('0x1d'));}}}catch(_0x1c7d33){logger[_0x6908('0x41')](_0x6908('0x92'),_0x5d9586[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x1c7d33,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6908('0x21')]=function(_0x42ff31){try{if(this['isNotNull'](_0x42ff31)){logger['debug'](_0x6908('0xa7'),_0x42ff31['uniqueid'],util[_0x6908('0x3f')](_0x42ff31,{'showHidden':![],'depth':null}));this[_0x6908('0xa8')](_0x42ff31[_0x6908('0x4a')],_[_0x6908('0x7e')](_0x42ff31[_0x6908('0xa9')])[0x0],_0x42ff31['value']);if(this[_0x6908('0xe')][_0x42ff31[_0x6908('0x4a')]]){var _0x27475e=_['last'](this[_0x6908('0xe')][_0x42ff31[_0x6908('0x4a')]]);if(_0x27475e){if(this[_0x6908('0x69')](_0x42ff31[_0x6908('0xa9')])&&this[_0x6908('0x69')](_0x42ff31['variable']['queuestatus'])){switch(_0x42ff31['value']){case _0x6908('0xaa'):_0x27475e[_0x6908('0x9a')]=![];_0x27475e['queuecallerexitAt']=null;break;case _0x6908('0xab'):_0x27475e['lastevent']=_0x6908('0xac');_0x27475e[_0x6908('0x9a')]=!![];_0x27475e['queuecallerexitAt']=moment()[_0x6908('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x27475e[_0x6908('0x8b')]=moment()['format'](_0x6908('0x78'));logger[_0x6908('0x47')](_0x6908('0xad'),_0x42ff31['uniqueid'],util[_0x6908('0x3f')](_0x27475e,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x27475e);break;default:_0x27475e[_0x6908('0x9a')]=!![];_0x27475e[_0x6908('0x9b')]=moment()['format'](_0x6908('0x78'));_0x27475e[_0x6908('0x8b')]=moment()[_0x6908('0x63')](_0x6908('0x78'));}_0x27475e[_0x6908('0x1a')]=![];_0x27475e[_0x6908('0x93')]=null;_0x27475e[_0x6908('0x85')]=_0x42ff31['value'];this[_0x6908('0x37')][_0x42ff31['uniqueid']]=_0x27475e;this[_0x6908('0x45')](_0x27475e,'varset');}else if(this[_0x6908('0x69')](_0x42ff31[_0x6908('0xa9')])&&this[_0x6908('0x69')](_0x42ff31[_0x6908('0xa9')][_0x6908('0xae')])){if(!_0x27475e[_0x6908('0x1a')]){_0x27475e['queuecallerexit']=!![];_0x27475e['queuecallerexitAt']=moment()[_0x6908('0x63')](_0x6908('0x78'));_0x27475e[_0x6908('0x85')]='EXITWITHKEY';_0x27475e[_0x6908('0x8b')]=moment()[_0x6908('0x63')](_0x6908('0x78'));this['channels'][_0x42ff31[_0x6908('0x4a')]]=_0x27475e;}}logger[_0x6908('0x6c')](_0x6908('0xaf'),_0x42ff31['uniqueid'],_0x27475e['name'],_0x27475e[_0x6908('0x53')],_[_0x6908('0x7e')](_0x42ff31['variable'])[0x0],_0x42ff31['value']);_0x27475e['variables']=this[_0x6908('0x14')][_0x42ff31[_0x6908('0x4a')]];}}}}catch(_0x21018e){logger[_0x6908('0x41')]('[%s][voiceQueueReport][varset]',_0x42ff31[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x21018e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6908('0xa8')]=function(_0x1ff0ed,_0x55fbfa,_0x588b0e){var _0x4d8684=[_0x6908('0xb0'),_0x6908('0xb1'),_0x6908('0xb2'),_0x6908('0xb3'),_0x6908('0xb4'),_0x6908('0xb5'),_0x6908('0xb6'),_0x6908('0xb7'),'sipcallid','sipuri',_0x6908('0xb8'),'bridgepvtcallid',_0x6908('0xb9'),_0x6908('0xba'),'memberinterface',_0x6908('0xbb'),_0x6908('0x94'),_0x6908('0xbc'),_0x6908('0xbd')];if(!_[_0x6908('0x39')](_0x55fbfa)&&!_[_0x6908('0xbe')](_0x4d8684,_0x55fbfa)){if(_[_0x6908('0x77')](this['variables'][_0x1ff0ed])){this[_0x6908('0x14')][_0x1ff0ed]={};}this[_0x6908('0x14')][_0x1ff0ed][_0x55fbfa]=_0x588b0e;}};VoiceQueueReport[_0x6908('0xa')][_0x6908('0x22')]=function(_0x5d96a4){try{if(this[_0x6908('0x69')](_0x5d96a4)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x5d96a4[_0x6908('0x4a')],util[_0x6908('0x3f')](_0x5d96a4,{'showHidden':![],'depth':null}));if(this[_0x6908('0xe')][_0x5d96a4['uniqueid']]){for(var _0x5b395d=0x0,_0x298701={};_0x5b395d0x0?_0x4c77e0:0x0;this[_0x31b7('0x12')][_0x4bd00d['queue']][_0x31b7('0x6e')]=this['voiceQueues'][_0x4bd00d[_0x31b7('0x67')]][_0x31b7('0x6e')]>_[_0x31b7('0x6d')](_0x4bd00d[_0x31b7('0x6f')])?_['toNumber'](_0x4bd00d[_0x31b7('0x6f')]):this['voiceQueues'][_0x4bd00d[_0x31b7('0x67')]][_0x31b7('0x6e')];this[_0x31b7('0x50')](this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]],_0x31b7('0x16'));}logger['debug'](_0x31b7('0x70'),util[_0x31b7('0x3e')](this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]],{'showHidden':![],'depth':null}));ami[_0x31b7('0x44')](_0x31b7('0x71'),this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]]);}}}catch(_0x350fba){logger[_0x31b7('0x3d')](_0x31b7('0x65'),util[_0x31b7('0x3e')](_0x350fba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x1a')]=function(_0x2de398){logger[_0x31b7('0x46')](_0x31b7('0x72'),util[_0x31b7('0x3e')](_0x2de398,{'showHidden':![],'depth':null}));this[_0x31b7('0x13')]=!![];};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x73')]=function(_0x2640db){try{if(this[_0x31b7('0x66')](_0x2640db)){logger[_0x31b7('0x46')](_0x31b7('0x74'),_0x2640db[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x2640db,{'showHidden':![],'depth':null}));if(_[_0x31b7('0x60')](this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]]))this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]]=[];if(_[_0x31b7('0x60')](this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]))this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]={};var _0x4b923b=new QueueReport();_0x4b923b[_0x31b7('0x4a')]=_0x2640db[_0x31b7('0x67')];_0x4b923b['type']=this[_0x31b7('0x12')][_0x4b923b[_0x31b7('0x4a')]]&&this[_0x31b7('0x12')][_0x4b923b[_0x31b7('0x4a')]][_0x31b7('0x51')]?this['voiceQueues'][_0x4b923b[_0x31b7('0x4a')]][_0x31b7('0x51')]||_0x31b7('0x75'):_0x31b7('0x75');_0x4b923b[_0x31b7('0x67')]=_0x2640db[_0x31b7('0x67')];_0x4b923b[_0x31b7('0x76')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x4b923b[_0x31b7('0x78')]=_0x2640db[_0x31b7('0x78')];_0x4b923b[_0x31b7('0x79')]=_0x2640db['count'];_0x4b923b['uniqueid']=_0x2640db['uniqueid'];_0x4b923b[_0x31b7('0x7a')]=this['channels'][_0x2640db[_0x31b7('0x48')]][_0x31b7('0x7a')];logger['info'](_0x31b7('0x7b'),_0x4b923b[_0x31b7('0x4a')],_0x4b923b[_0x31b7('0x51')]);_[_0x31b7('0x7c')](_0x4b923b,_['pick'](_0x2640db,_['keys'](_0x4b923b)));this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]][_0x31b7('0x7d')](_0x4b923b);this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]=_0x4b923b;this[_0x31b7('0x45')](_0x4b923b,_0x31b7('0x1b'));}}catch(_0xbb8b16){logger[_0x31b7('0x3d')](_0x31b7('0x74'),_0x2640db['uniqueid'],util[_0x31b7('0x3e')](_0xbb8b16,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x1c')]=function(_0x50f1b5){try{if(this[_0x31b7('0x66')](_0x50f1b5)){logger[_0x31b7('0x46')](_0x31b7('0x7e'),_0x50f1b5[_0x31b7('0x48')],util['inspect'](_0x50f1b5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x50f1b5['uniqueid']]){var _0x1739af=_['last'](this['queueReports'][_0x50f1b5[_0x31b7('0x48')]]);_0x1739af['queuecallercomplete']=![];_0x1739af[_0x31b7('0x7f')]=null;_0x1739af[_0x31b7('0x80')]=_0x50f1b5['holdtime'];_0x1739af['originalposition']=_0x50f1b5[_0x31b7('0x81')];_0x1739af[_0x31b7('0x82')]=!![];_0x1739af[_0x31b7('0x83')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x1739af['queuecallerexitreason']=_0x31b7('0x84');_0x1739af[_0x31b7('0x85')]=null;logger[_0x31b7('0x69')](_0x31b7('0x86'),_0x1739af[_0x31b7('0x4a')],_0x1739af[_0x31b7('0x51')]);this['channels'][_0x50f1b5[_0x31b7('0x48')]]=_0x1739af;this[_0x31b7('0x42')](_0x1739af,_0x31b7('0x82'));}}}catch(_0x2f314c){logger[_0x31b7('0x3d')](_0x31b7('0x7e'),_0x50f1b5['uniqueid'],util[_0x31b7('0x3e')](_0x2f314c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x1d')]=function(_0x4e369c){try{if(this[_0x31b7('0x66')](_0x4e369c)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x4e369c[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x4e369c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4e369c[_0x31b7('0x48')]]){var _0x50bde9=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x4e369c[_0x31b7('0x48')]]);_0x50bde9[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x50bde9['connectedlinenum']=_0x4e369c[_0x31b7('0x89')];_0x50bde9[_0x31b7('0x8a')]=_0x4e369c[_0x31b7('0x8a')];logger['info'](_0x31b7('0x8b'),_0x50bde9[_0x31b7('0x4a')],_0x50bde9[_0x31b7('0x51')],_0x4e369c['connectedlinenum'],_0x4e369c['connectedlinename']);this[_0x31b7('0x10')][_0x4e369c['uniqueid']]=_0x50bde9;this[_0x31b7('0x45')](_0x50bde9,_0x31b7('0x8c'));}}}catch(_0x5da016){logger[_0x31b7('0x3d')]('[%s][voiceQueueReport][queuecallerleave]',_0x4e369c['uniqueid'],util[_0x31b7('0x3e')](_0x5da016,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x20')]=function(_0x323ab2){try{if(this['isNotNull'](_0x323ab2)){logger[_0x31b7('0x46')](_0x31b7('0x8d'),_0x323ab2['uniqueid'],util['inspect'](_0x323ab2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x323ab2[_0x31b7('0x48')]]){var _0x477445=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x323ab2[_0x31b7('0x48')]]);_0x477445[_0x31b7('0x8e')]=!![];_0x477445['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x31b7('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x477445[_0x31b7('0x4a')],_0x477445[_0x31b7('0x51')]);}}}catch(_0x2a7141){logger[_0x31b7('0x3d')](_0x31b7('0x8d'),_0x323ab2[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x2a7141,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x1f')]=function(_0x100da0){try{if(this[_0x31b7('0x66')](_0x100da0)){logger[_0x31b7('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x100da0['uniqueid'],util[_0x31b7('0x3e')](_0x100da0,{'showHidden':![],'depth':null}));if(this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]]){var _0x18b1be=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x100da0['uniqueid']]);_0x18b1be[_0x31b7('0x82')]=![];_0x18b1be[_0x31b7('0x83')]=null;_0x18b1be[_0x31b7('0x8f')]=!![];_0x18b1be[_0x31b7('0x85')]=_0x100da0['membername'];_0x18b1be['holdtime']=_0x100da0[_0x31b7('0x80')];_0x18b1be[_0x31b7('0x8e')]=!![];_0x18b1be[_0x31b7('0x90')]=![];_0x18b1be['queuecallerexitAt']=null;if(!_0x18b1be[_0x31b7('0x91')]){if(_0x100da0[_0x31b7('0x92')]==_0x31b7('0x91')){_0x18b1be[_0x31b7('0x93')]='COMPLETED';logger['info'](_0x31b7('0x94'),_0x18b1be[_0x31b7('0x4a')],_0x18b1be[_0x31b7('0x51')]);}else{if(_[_0x31b7('0x95')](_0x100da0[_0x31b7('0x3a')][_0x31b7('0x96')](),_0x31b7('0x97'))){if(this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]){var _0x16bce7=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]);_0x16bce7['queuecallercomplete']=![];_0x16bce7[_0x31b7('0x90')]=!![];_0x16bce7[_0x31b7('0x99')]=moment(_0x18b1be[_0x31b7('0x76')])[_0x31b7('0x9a')](_0x100da0[_0x31b7('0x80')],_0x31b7('0x9b'))[_0x31b7('0x4e')](_0x31b7('0x77'));_0x16bce7[_0x31b7('0x93')]=_0x31b7('0x9c');_0x16bce7[_0x31b7('0x91')]=!![];_0x16bce7[_0x31b7('0x9d')]='FORWARD';_0x16bce7['transferexten']=_0x100da0[_0x31b7('0x9e')];_0x16bce7[_0x31b7('0x9f')]=_0x100da0['uniqueid'];logger[_0x31b7('0x69')](_0x31b7('0xa0'),_0x16bce7[_0x31b7('0x4a')],_0x16bce7['type']);var _0x1b1884=this['queueReports'][_0x100da0[_0x31b7('0x98')]];this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]=this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]];this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]]=_0x1b1884;}}else{_0x18b1be[_0x31b7('0x93')]=_0x31b7('0xa1')+_0x100da0[_0x31b7('0x92')][_0x31b7('0xa2')]();logger['info'](_0x31b7('0xa3'),_0x18b1be[_0x31b7('0x4a')],_0x18b1be[_0x31b7('0x51')],_0x18b1be[_0x31b7('0x93')]);}}}this['channels'][_0x100da0[_0x31b7('0x48')]]=_0x18b1be;this[_0x31b7('0x42')](_0x18b1be,'agentcomplete');}}}catch(_0x12421e){logger['error'](_0x31b7('0xa4'),_0x100da0[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x12421e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x22')]=function(_0x3e500b){try{if(this['isNotNull'](_0x3e500b)){logger[_0x31b7('0x46')](_0x31b7('0xa5'),_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x3e500b,{'showHidden':![],'depth':null}));this[_0x31b7('0xa6')](_0x3e500b[_0x31b7('0x48')],_[_0x31b7('0xa7')](_0x3e500b['variable'])[0x0],_0x3e500b['value']);if(this[_0x31b7('0xe')][_0x3e500b[_0x31b7('0x48')]]){var _0x5af354=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x3e500b[_0x31b7('0x48')]]);if(_0x5af354){if(this[_0x31b7('0x66')](_0x3e500b[_0x31b7('0xa8')])&&this[_0x31b7('0x66')](_0x3e500b['variable'][_0x31b7('0xa9')])){switch(_0x3e500b[_0x31b7('0xaa')]){case'CONTINUE':_0x5af354[_0x31b7('0x90')]=![];_0x5af354[_0x31b7('0x99')]=null;break;case'TIMEOUT':_0x5af354[_0x31b7('0xab')]='timeout';_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x5af354[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x31b7('0x46')](_0x31b7('0xac'),_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x5af354,{'showHidden':![],'depth':null}));ami[_0x31b7('0x44')](_0x31b7('0xad'),_0x5af354);break;default:_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()['format'](_0x31b7('0x77'));_0x5af354[_0x31b7('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5af354['queuecallerabandon']=![];_0x5af354[_0x31b7('0x83')]=null;_0x5af354[_0x31b7('0x93')]=_0x3e500b[_0x31b7('0xaa')];this[_0x31b7('0x10')][_0x3e500b[_0x31b7('0x48')]]=_0x5af354;this[_0x31b7('0x42')](_0x5af354,_0x31b7('0x21'));}else if(this[_0x31b7('0x66')](_0x3e500b['variable'])&&this[_0x31b7('0x66')](_0x3e500b[_0x31b7('0xa8')]['queueposition'])){if(!_0x5af354[_0x31b7('0x82')]){_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x5af354[_0x31b7('0x93')]=_0x31b7('0xae');_0x5af354[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x31b7('0x10')][_0x3e500b[_0x31b7('0x48')]]=_0x5af354;}}logger[_0x31b7('0x69')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3e500b[_0x31b7('0x48')],_0x5af354['name'],_0x5af354['type'],_[_0x31b7('0xa7')](_0x3e500b[_0x31b7('0xa8')])[0x0],_0x3e500b['value']);_0x5af354[_0x31b7('0x15')]=this[_0x31b7('0x15')][_0x3e500b[_0x31b7('0x48')]];}}}}catch(_0x50560d){logger['error']('[%s][voiceQueueReport][varset]',_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x50560d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0xa6')]=function(_0x45cbff,_0x30d1fe,_0x885199){var _0x2a6f37=[_0x31b7('0xaf'),_0x31b7('0xb0'),'rtpaudioqosjitter',_0x31b7('0xb1'),'rtpaudioqosloss',_0x31b7('0xb2'),_0x31b7('0xb3'),_0x31b7('0xb4'),'sipcallid',_0x31b7('0xb5'),'bridgepeer',_0x31b7('0xb6'),'membercalls',_0x31b7('0xb7'),'memberinterface',_0x31b7('0xb8'),_0x31b7('0xb9'),_0x31b7('0xba'),'memberrealtime'];if(!_[_0x31b7('0xbb')](_0x30d1fe)&&!_[_0x31b7('0xbc')](_0x2a6f37,_0x30d1fe)){if(_['isUndefined'](this[_0x31b7('0x15')][_0x45cbff])){this[_0x31b7('0x15')][_0x45cbff]={};}this[_0x31b7('0x15')][_0x45cbff][_0x30d1fe]=_0x885199;}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x23')]=function(_0x5c8071){try{if(this[_0x31b7('0x66')](_0x5c8071)){logger[_0x31b7('0x46')](_0x31b7('0xbd'),_0x5c8071[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x5c8071,{'showHidden':![],'depth':null}));if(this[_0x31b7('0xe')][_0x5c8071[_0x31b7('0x48')]]){for(var _0x3b0fb3=0x0,_0x144c27={};_0x3b0fb3=0x0?moment(_0x5cdd73['endtime'])[_0xd2ad('0x10')](_0x5cdd73['starttime'],_0xd2ad('0x1a')):null,'data1':_0xd2ad('0x1b'),'data2':_0x5cdd73[_0xd2ad('0x15')],'data3':_0x5cdd73[_0xd2ad('0x13')],'data4':_0x5cdd73['dialstring']||null,'role':_0xd2ad('0x14'),'internal':_0x5cdd73[_0xd2ad('0x15')]?_[_0xd2ad('0x16')](_0x5cdd73[_0xd2ad('0x15')]):undefined,'uniqueid':_0x5cdd73[_0xd2ad('0x1c')]},'log':_0xd2ad('0x7')});}; \ No newline at end of file +var _0x1348=['voice','membername','starttime','endtime','diff','accountcode','exten','dialstring','toNumber','lodash','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','calleridnum','queue','agent','uniqueid'];(function(_0x1435f4,_0x1fc2ab){var _0x1f9f3e=function(_0x225e5c){while(--_0x225e5c){_0x1435f4['push'](_0x1435f4['shift']());}};_0x1f9f3e(++_0x1fc2ab);}(_0x1348,0x90));var _0x8134=function(_0x513b46,_0x3348e1){_0x513b46=_0x513b46-0x0;var _0x4f2d36=_0x1348[_0x513b46];return _0x4f2d36;};'use strict';var moment=require('moment');var _=require(_0x8134('0x0'));var util=require('util');var client=require(_0x8134('0x1'));exports['voiceQueueReport']=function(_0x1761cc){var _0x5488c1=_0x1761cc[_0x8134('0x2')]||_0x1761cc[_0x8134('0x3')];return client[_0x8134('0x4')](_0x8134('0x5'),{'body':{'channel':'voice','membername':_0x1761cc[_0x8134('0x6')],'interface':_[_0x8134('0x7')](_0x1761cc[_0x8134('0x8')])?util[_0x8134('0x9')](_0x8134('0xa'),_0x1761cc[_0x8134('0x6')]):_0x1761cc[_0x8134('0x8')],'type':_0x8134('0xb'),'enterAt':_0x1761cc['queuecallerleaveAt'],'exitAt':_0x5488c1,'duration':moment(_0x5488c1)['diff'](_0x1761cc[_0x8134('0xc')],_0x8134('0xd')),'data1':'inbound','data2':_0x1761cc[_0x8134('0xe')],'data3':_0x1761cc['exten'],'data4':null,'data5':_0x1761cc[_0x8134('0xf')],'role':_0x8134('0x10'),'internal':_0x1761cc['accountcode']?_['toNumber'](_0x1761cc['accountcode']):undefined,'uniqueid':_0x1761cc[_0x8134('0x11')]},'log':_0x8134('0x5')});};exports['voiceDialReport']=function(_0x38ca6c){return client[_0x8134('0x4')](_0x8134('0x5'),{'body':{'channel':_0x8134('0x12'),'membername':_0x38ca6c[_0x8134('0x13')],'interface':_0x38ca6c[_0x8134('0x8')],'type':_0x8134('0xb'),'enterAt':_0x38ca6c[_0x8134('0x14')],'exitAt':_0x38ca6c[_0x8134('0x15')],'duration':moment(_0x38ca6c['endtime'])[_0x8134('0x16')](_0x38ca6c[_0x8134('0x14')],_0x8134('0xd'))>=0x0?moment(_0x38ca6c['endtime'])[_0x8134('0x16')](_0x38ca6c[_0x8134('0x14')],_0x8134('0xd')):null,'data1':'outbound','data2':_0x38ca6c[_0x8134('0x17')],'data3':_0x38ca6c[_0x8134('0x18')],'data4':_0x38ca6c[_0x8134('0x19')]||null,'role':'agent','internal':_0x38ca6c[_0x8134('0x17')]?_[_0x8134('0x1a')](_0x38ca6c[_0x8134('0x17')]):undefined,'uniqueid':_0x38ca6c['uniqueid']},'log':_0x8134('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 52a3646..14eee59 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 _0xd8ea=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x283264,_0x21e887){var _0x1fcb43=function(_0x4578db){while(--_0x4578db){_0x283264['push'](_0x283264['shift']());}};_0x1fcb43(++_0x21e887);}(_0xd8ea,0x1bd));var _0xad8e=function(_0x2337d2,_0x840b0e){_0x2337d2=_0x2337d2-0x0;var _0x579862=_0xd8ea[_0x2337d2];return _0x579862;};'use strict';var client=require(_0xad8e('0x0'));exports[_0xad8e('0x1')]=function(){return client[_0xad8e('0x2')](_0xad8e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xad8e('0x4')]},'log':_0xad8e('0x5')});}; \ No newline at end of file +var _0x8523=['GetSettings','../client','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x5eb8a2,_0x25ac60){var _0x462799=function(_0x5f4ad2){while(--_0x5f4ad2){_0x5eb8a2['push'](_0x5eb8a2['shift']());}};_0x462799(++_0x25ac60);}(_0x8523,0x65));var _0x3852=function(_0x1909c9,_0x18da0d){_0x1909c9=_0x1909c9-0x0;var _0x23df72=_0x8523[_0x1909c9];return _0x23df72;};'use strict';var client=require(_0x3852('0x0'));exports['getSettings']=function(){return client[_0x3852('0x1')](_0x3852('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3852('0x3')]},'log':_0x3852('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index f718578..2aa9a35 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 _0xbe9d=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x33d7ff,_0x46fe3d){var _0x3ab158=function(_0x128065){while(--_0x128065){_0x33d7ff['push'](_0x33d7ff['shift']());}};_0x3ab158(++_0x46fe3d);}(_0xbe9d,0x99));var _0xdbe9=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xbe9d[_0x2763f2];return _0x3ef471;};'use strict';var client=require(_0xdbe9('0x0'));exports[_0xdbe9('0x1')]=function(_0x37c57c){return function(_0x475f9e){return client[_0xdbe9('0x2')](_0xdbe9('0x3'),{'options':{'raw':!![],'attributes':['id',_0xdbe9('0x4'),_0xdbe9('0x5')]},'log':_0xdbe9('0x3')});};}; \ No newline at end of file +var _0x0c6f=['name','html','GetTemplate','../client','getTemplates'];(function(_0x5cda3e,_0x49535b){var _0x98274=function(_0x4064fa){while(--_0x4064fa){_0x5cda3e['push'](_0x5cda3e['shift']());}};_0x98274(++_0x49535b);}(_0x0c6f,0x85));var _0xf0c6=function(_0x1bc8a9,_0x1a3d04){_0x1bc8a9=_0x1bc8a9-0x0;var _0x56b3e3=_0x0c6f[_0x1bc8a9];return _0x56b3e3;};'use strict';var client=require(_0xf0c6('0x0'));exports[_0xf0c6('0x1')]=function(_0x111422){return function(_0x46c528){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xf0c6('0x2'),_0xf0c6('0x3')]},'log':_0xf0c6('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index a10399a..45b71b1 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 _0x60f0=['GetTrigger','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','action','data1','data2','data3','data5','data7','Request'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x60f0,0x1af));var _0x060f=function(_0x1578fb,_0x4798b6){_0x1578fb=_0x1578fb-0x0;var _0x87a9c1=_0x60f0[_0x1578fb];return _0x87a9c1;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x4083b5){return function(_0x52e386){return client[_0x060f('0x0')](_0x060f('0x1'),{'options':{'raw':![],'attributes':['id','name','channel',_0x060f('0x2')],'include':[{'model':_0x060f('0x3'),'as':_0x060f('0x4'),'attributes':['id',_0x060f('0x5'),_0x060f('0x6'),_0x060f('0x7')]},{'model':_0x060f('0x3'),'as':_0x060f('0x8'),'attributes':['id',_0x060f('0x5'),_0x060f('0x6'),'value']},{'model':_0x060f('0x9'),'as':'Actions','attributes':['id',_0x060f('0xa'),_0x060f('0xb'),_0x060f('0xc'),_0x060f('0xd'),'data4',_0x060f('0xe'),'data6',_0x060f('0xf')]}]},'log':_0x060f('0x1')});};}; \ No newline at end of file +var _0x27de=['data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','AllConditions','operator','value','Condition','AnyConditions','field','Action','Actions','action','data1','data4','data5'];(function(_0x233d57,_0x284678){var _0x3eec8c=function(_0x56d91b){while(--_0x56d91b){_0x233d57['push'](_0x233d57['shift']());}};_0x3eec8c(++_0x284678);}(_0x27de,0x1d0));var _0xe27d=function(_0x392e8d,_0x3d05ca){_0x392e8d=_0x392e8d-0x0;var _0x40c881=_0x27de[_0x392e8d];return _0x40c881;};'use strict';var client=require(_0xe27d('0x0'));exports[_0xe27d('0x1')]=function(_0x4ea7ae){return function(_0x578a4c){return client[_0xe27d('0x2')](_0xe27d('0x3'),{'options':{'raw':![],'attributes':['id',_0xe27d('0x4'),_0xe27d('0x5'),_0xe27d('0x6')],'include':[{'model':'Condition','as':_0xe27d('0x7'),'attributes':['id','field',_0xe27d('0x8'),_0xe27d('0x9')]},{'model':_0xe27d('0xa'),'as':_0xe27d('0xb'),'attributes':['id',_0xe27d('0xc'),_0xe27d('0x8'),'value']},{'model':_0xe27d('0xd'),'as':_0xe27d('0xe'),'attributes':['id',_0xe27d('0xf'),_0xe27d('0x10'),'data2','data3',_0xe27d('0x11'),_0xe27d('0x12'),_0xe27d('0x13'),_0xe27d('0x14')]}]},'log':_0xe27d('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 79c477d..a26362b 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 _0xa8a8=['registry','defaultuser','../client','getTrunks','GetTrunk','name'];(function(_0x3ff59d,_0x209599){var _0x221f59=function(_0x121af2){while(--_0x121af2){_0x3ff59d['push'](_0x3ff59d['shift']());}};_0x221f59(++_0x209599);}(_0xa8a8,0xec));var _0x8a8a=function(_0x52dfe4,_0x5a145d){_0x52dfe4=_0x52dfe4-0x0;var _0x4b075d=_0xa8a8[_0x52dfe4];return _0x4b075d;};'use strict';var client=require(_0x8a8a('0x0'));exports[_0x8a8a('0x1')]=function(_0x1934ab){return function(_0x2dd9b7){return client['Request'](_0x8a8a('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x8a8a('0x3'),_0x8a8a('0x4'),_0x8a8a('0x5')]},'log':_0x8a8a('0x2')});};}; \ No newline at end of file +var _0x2e3d=['GetTrunk','name','../client','Request'];(function(_0xa98eeb,_0x37cc88){var _0x3af6b7=function(_0x5a569b){while(--_0x5a569b){_0xa98eeb['push'](_0xa98eeb['shift']());}};_0x3af6b7(++_0x37cc88);}(_0x2e3d,0x1be));var _0xd2e3=function(_0x50f9c5,_0x27437b){_0x50f9c5=_0x50f9c5-0x0;var _0x15aa49=_0x2e3d[_0x50f9c5];return _0x15aa49;};'use strict';var client=require(_0xd2e3('0x0'));exports['getTrunks']=function(_0x595b6c){return function(_0x1390fd){return client[_0xd2e3('0x1')](_0xd2e3('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd2e3('0x3'),'registry','defaultuser']},'log':_0xd2e3('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 822eba3..b3f7a28 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 _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x145a69,_0x5e3724){var _0x3bb49d=function(_0x4dae59){while(--_0x4dae59){_0x145a69['push'](_0x145a69['shift']());}};_0x3bb49d(++_0x5e3724);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe706,0xa3));var _0x6e70=function(_0x40174f,_0x3a6751){_0x40174f=_0x40174f-0x0;var _0x40717c=_0xe706[_0x40174f];return _0x40717c;};'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 73ee7f2..f448458 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 _0x5193=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x2b0960,_0x525d1c){var _0x140c06=function(_0x491281){while(--_0x491281){_0x2b0960['push'](_0x2b0960['shift']());}};_0x140c06(++_0x525d1c);}(_0x5193,0xf2));var _0x3519=function(_0x3443a5,_0x461820){_0x3443a5=_0x3443a5-0x0;var _0x244e62=_0x5193[_0x3443a5];return _0x244e62;};'use strict';var client=require(_0x3519('0x0'));exports[_0x3519('0x1')]=function(_0x10f9a6){return client[_0x3519('0x2')](_0x3519('0x3'),{'body':_0x10f9a6,'log':_0x3519('0x3')});};exports['update']=function(_0x5262bf,_0x5386c2,_0x327541){return client[_0x3519('0x2')]('UpdateVoiceAgentReport',{'body':_0x5262bf,'options':{'where':{'uniqueid':_0x5386c2,'interface':_0x327541,'agentcomplete':!![]}},'log':_0x3519('0x4')});}; \ No newline at end of file +var _0xd5ce=['Request','CreateVoiceAgentReport','update','../client','create'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0xd5ce,0x99));var _0xed5c=function(_0x1bcc66,_0x36640b){_0x1bcc66=_0x1bcc66-0x0;var _0x1bab7a=_0xd5ce[_0x1bcc66];return _0x1bab7a;};'use strict';var client=require(_0xed5c('0x0'));exports[_0xed5c('0x1')]=function(_0x5455ee){return client[_0xed5c('0x2')](_0xed5c('0x3'),{'body':_0x5455ee,'log':'CreateVoiceAgentReport'});};exports[_0xed5c('0x4')]=function(_0x2f0055,_0x2fadee,_0x34188f){return client['Request']('UpdateVoiceAgentReport',{'body':_0x2f0055,'options':{'where':{'uniqueid':_0x2fadee,'interface':_0x34188f,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 964051e..75a4267 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 _0xb663=['GetVoiceCallReport','outbound','startOf','format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports'];(function(_0x2ab350,_0x32859f){var _0x4acac=function(_0x58ddc6){while(--_0x58ddc6){_0x2ab350['push'](_0x2ab350['shift']());}};_0x4acac(++_0x32859f);}(_0xb663,0x11b));var _0x3b66=function(_0x3e9e66,_0x3a889b){_0x3e9e66=_0x3e9e66-0x0;var _0x293ce3=_0xb663[_0x3e9e66];return _0x293ce3;};'use strict';var moment=require(_0x3b66('0x0'));var util=require('util');var _=require(_0x3b66('0x1'));var client=require(_0x3b66('0x2'));exports[_0x3b66('0x3')]=function(_0x4756fc){return client[_0x3b66('0x4')]('CreateVoiceCallReport',{'body':_[_0x3b66('0x5')](_0x4756fc,{'source':_0x4756fc[_0x3b66('0x6')],'destinationcontext':_0x4756fc[_0x3b66('0x7')],'callerid':_0x4756fc[_0x3b66('0x8')],'amaflags':_0x3b66('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x3b66('0xa')]=function(){return function(){return client[_0x3b66('0x4')](_0x3b66('0xb'),{'options':{'where':{'type':[_0x3b66('0xc')],'createdAt':{'$between':[moment()[_0x3b66('0xd')]('day')[_0x3b66('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x3b66('0xf')](_0x3b66('0x10'))['format'](_0x3b66('0x11'))]}},'attributes':['type','disposition',_0x3b66('0x12'),_0x3b66('0x13')]},'log':_0x3b66('0x14')});};}; \ No newline at end of file +var _0xf3bc=['context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','moment','util','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xf3bc,0x13d));var _0xcf3b=function(_0x4bb597,_0xd4e0b2){_0x4bb597=_0x4bb597-0x0;var _0x179e51=_0xf3bc[_0x4bb597];return _0x179e51;};'use strict';var moment=require(_0xcf3b('0x0'));var util=require(_0xcf3b('0x1'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x38c0fe){return client[_0xcf3b('0x2')](_0xcf3b('0x3'),{'body':_[_0xcf3b('0x4')](_0x38c0fe,{'source':_0x38c0fe[_0xcf3b('0x5')],'destinationcontext':_0x38c0fe[_0xcf3b('0x6')],'callerid':_0x38c0fe[_0xcf3b('0x7')],'amaflags':_0xcf3b('0x8')}),'log':_0xcf3b('0x3')});};exports[_0xcf3b('0x9')]=function(){return function(){return client[_0xcf3b('0x2')](_0xcf3b('0xa'),{'options':{'where':{'type':[_0xcf3b('0xb')],'createdAt':{'$between':[moment()['startOf'](_0xcf3b('0xc'))['format'](_0xcf3b('0xd')),moment()['endOf'](_0xcf3b('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0xcf3b('0xe'),_0xcf3b('0xf'),_0xcf3b('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 55382d9..5d37b32 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 _0xb3e7=['CreateVoiceDialReport','../client','Request'];(function(_0x3bf7e8,_0x5cd5a1){var _0x5b294a=function(_0x58bf72){while(--_0x58bf72){_0x3bf7e8['push'](_0x3bf7e8['shift']());}};_0x5b294a(++_0x5cd5a1);}(_0xb3e7,0xdc));var _0x7b3e=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xb3e7[_0x59c301];return _0x3866b9;};'use strict';var client=require(_0x7b3e('0x0'));exports['create']=function(_0x303aa6){return client[_0x7b3e('0x1')](_0x7b3e('0x2'),{'body':_0x303aa6,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xfde2=['create','Request','CreateVoiceDialReport','../client'];(function(_0x587b33,_0x4c587e){var _0x338cc3=function(_0x62a4c5){while(--_0x62a4c5){_0x587b33['push'](_0x587b33['shift']());}};_0x338cc3(++_0x4c587e);}(_0xfde2,0xef));var _0x2fde=function(_0x69532a,_0x229506){_0x69532a=_0x69532a-0x0;var _0x4f0a60=_0xfde2[_0x69532a];return _0x4f0a60;};'use strict';var client=require(_0x2fde('0x0'));exports[_0x2fde('0x1')]=function(_0x54e929){return client[_0x2fde('0x2')]('CreateVoiceDialReport',{'body':_0x54e929,'log':_0x2fde('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index a0cb957..8280a44 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 _0x6b24=['GetVoiceExtension','exten','getVoiceExtensions','Request'];(function(_0x12c4ee,_0x19ead8){var _0x232137=function(_0x3e6f6d){while(--_0x3e6f6d){_0x12c4ee['push'](_0x12c4ee['shift']());}};_0x232137(++_0x19ead8);}(_0x6b24,0x1ce));var _0x46b2=function(_0x41deb8,_0x458105){_0x41deb8=_0x41deb8-0x0;var _0x1e2084=_0x6b24[_0x41deb8];return _0x1e2084;};'use strict';var client=require('../client');exports[_0x46b2('0x0')]=function(){return function(){return client[_0x46b2('0x1')](_0x46b2('0x2'),{'options':{'raw':!![],'attributes':['id',_0x46b2('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x657b=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0x657b,0x131));var _0xb657=function(_0x475e36,_0x3ca386){_0x475e36=_0x475e36-0x0;var _0x2b8fb1=_0x657b[_0x475e36];return _0x2b8fb1;};'use strict';var client=require(_0xb657('0x0'));exports[_0xb657('0x1')]=function(){return function(){return client[_0xb657('0x2')](_0xb657('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb657('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xb657('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 24b9e77..c8dab6d 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 _0x9659=['dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','name','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel'];(function(_0x43eb89,_0x62d271){var _0x385fcb=function(_0x5c38e5){while(--_0x5c38e5){_0x43eb89['push'](_0x43eb89['shift']());}};_0x385fcb(++_0x62d271);}(_0x9659,0xb0));var _0x9965=function(_0x1e2dc5,_0x4f7353){_0x1e2dc5=_0x1e2dc5-0x0;var _0x1d881d=_0x9659[_0x1e2dc5];return _0x1d881d;};'use strict';var client=require('../client');exports[_0x9965('0x0')]=function(){return function(){return client[_0x9965('0x1')](_0x9965('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9965('0x3'),_0x9965('0x4'),_0x9965('0x5'),_0x9965('0x6'),_0x9965('0x7'),_0x9965('0x8'),_0x9965('0x9'),_0x9965('0xa'),_0x9965('0xb'),_0x9965('0xc'),_0x9965('0xd'),_0x9965('0xe'),_0x9965('0xf'),'dialOriginateCallerIdName',_0x9965('0x10'),_0x9965('0x11'),_0x9965('0x12'),_0x9965('0x13'),_0x9965('0x14'),_0x9965('0x15'),'dialCongestionRetryFrequency',_0x9965('0x16'),_0x9965('0x17'),_0x9965('0x18'),_0x9965('0x19'),_0x9965('0x1a'),_0x9965('0x1b'),_0x9965('0x1c'),_0x9965('0x1d'),_0x9965('0x1e'),_0x9965('0x1f'),'dialAMDInitialSilence',_0x9965('0x20'),'dialAMDAfterGreetingSilence',_0x9965('0x21'),_0x9965('0x22'),_0x9965('0x23'),_0x9965('0x24'),_0x9965('0x25'),_0x9965('0x26'),'timeout',_0x9965('0x27'),_0x9965('0x28'),'dialOrderByScheduledAt',_0x9965('0x29'),_0x9965('0x2a'),_0x9965('0x2b'),'monitor_format',_0x9965('0x2c'),_0x9965('0x2d'),_0x9965('0x2e'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0x9965('0x2f'),_0x9965('0x30'),'dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency',_0x9965('0x31'),'dialAgentRejectRetryFrequency',_0x9965('0x32'),_0x9965('0x33'),_0x9965('0x34')],'include':[{'model':_0x9965('0x35'),'as':_0x9965('0x35'),'attributes':['id','name',_0x9965('0x36'),_0x9965('0x37')]},{'model':_0x9965('0x38'),'as':_0x9965('0x39'),'attributes':['id','name']},{'model':'Trunk','as':_0x9965('0x3a'),'attributes':['id','name',_0x9965('0x36'),_0x9965('0x37')]},{'model':_0x9965('0x3b'),'as':_0x9965('0x3b'),'attributes':['id','name'],'include':[{'model':_0x9965('0x3b'),'as':_0x9965('0x3c'),'attributes':['id',_0x9965('0x3d'),_0x9965('0x3e')]}]}]},'log':_0x9965('0x0')});};}; \ No newline at end of file +var _0x1988=['dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','mandatoryDispositionPause','callerid','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x1e85c4,_0x4fff68){var _0x268836=function(_0x1f5f89){while(--_0x1f5f89){_0x1e85c4['push'](_0x1e85c4['shift']());}};_0x268836(++_0x4fff68);}(_0x1988,0x6f));var _0x8198=function(_0x5af668,_0x3b73ec){_0x5af668=_0x5af668-0x0;var _0x129baa=_0x1988[_0x5af668];return _0x129baa;};'use strict';var client=require('../client');exports[_0x8198('0x0')]=function(){return function(){return client[_0x8198('0x1')](_0x8198('0x2'),{'options':{'raw':![],'attributes':['id',_0x8198('0x3'),_0x8198('0x4'),'acwTimeout',_0x8198('0x5'),'monitor_format',_0x8198('0x6'),_0x8198('0x7'),'dialMethod',_0x8198('0x8'),_0x8198('0x9'),_0x8198('0xa'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x8198('0xb'),_0x8198('0xc'),_0x8198('0xd'),'dialOriginateTimeout',_0x8198('0xe'),_0x8198('0xf'),'dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x8198('0x10'),_0x8198('0x11'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval',_0x8198('0x12'),_0x8198('0x13'),'dialAMDActive',_0x8198('0x14'),_0x8198('0x15'),_0x8198('0x16'),'dialAMDTotalAnalysisTime',_0x8198('0x17'),'dialAMDBetweenWordsSilence',_0x8198('0x18'),_0x8198('0x19'),_0x8198('0x1a'),_0x8198('0x1b'),_0x8198('0x1c'),'dialRecallInQueue',_0x8198('0x1d'),_0x8198('0x1e'),_0x8198('0x1f'),_0x8198('0x20'),_0x8198('0x21'),_0x8198('0x22'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x8198('0x23'),'dialNoSuchNumberRetryFrequency',_0x8198('0x24'),_0x8198('0x25'),_0x8198('0x26'),_0x8198('0x27'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x8198('0x28'),_0x8198('0x29'),_0x8198('0x2a'),'dialPredictiveIntervalMaxThreshold',_0x8198('0x2b')],'include':[{'model':_0x8198('0x2c'),'as':_0x8198('0x2c'),'attributes':['id',_0x8198('0x3'),'callerid',_0x8198('0x2d')]},{'model':'Pause','as':_0x8198('0x2e'),'attributes':['id',_0x8198('0x3')]},{'model':_0x8198('0x2c'),'as':'TrunkBackup','attributes':['id',_0x8198('0x3'),_0x8198('0x2f'),_0x8198('0x2d')]},{'model':'Interval','as':'Interval','attributes':['id',_0x8198('0x3')],'include':[{'model':_0x8198('0x30'),'as':'Intervals','attributes':['id',_0x8198('0x3'),_0x8198('0x31')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 2fde63d..3fb85f2 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(_0x508849,_0x15ab84){var _0x550392=function(_0x917730){while(--_0x917730){_0x508849['push'](_0x508849['shift']());}};_0x550392(++_0x15ab84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x7612ee,_0x2d9674){var _0x364bae=function(_0xa3b96a){while(--_0xa3b96a){_0x7612ee['push'](_0x7612ee['shift']());}};_0x364bae(++_0x2d9674);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 1af5cc2..05ae6e2 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 _0xb5ae=['getVoiceQueueRtPauses','../client'];(function(_0x480e53,_0x5c8da4){var _0x12c12f=function(_0x1a6c28){while(--_0x1a6c28){_0x480e53['push'](_0x480e53['shift']());}};_0x12c12f(++_0x5c8da4);}(_0xb5ae,0xf1));var _0xeb5a=function(_0x20c888,_0x1338fd){_0x20c888=_0x20c888-0x0;var _0x56edde=_0xb5ae[_0x20c888];return _0x56edde;};'use strict';var client=require(_0xeb5a('0x0'));exports[_0xeb5a('0x1')]=function(_0xd5e1c2){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0xd5e1c2,'paused':!![]},'raw':!![]},'log':_0xeb5a('0x1')});};}; \ No newline at end of file +var _0x93b4=['getVoiceQueueRtPauses','../client','Request','GetVoiceQueueRtPauses'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x93b4,0xc1));var _0x493b=function(_0x792763,_0x14af19){_0x792763=_0x792763-0x0;var _0x48044b=_0x93b4[_0x792763];return _0x48044b;};'use strict';var client=require(_0x493b('0x0'));exports['getVoiceQueueRtPauses']=function(_0x4c9fef){return function(){return client[_0x493b('0x1')](_0x493b('0x2'),{'options':{'where':{'VoiceQueueId':_0x4c9fef,'paused':!![]},'raw':!![]},'log':_0x493b('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index c94298c..1632ade 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x4d4e8a,_0x162fd7){var _0x2e304d=function(_0x52d517){while(--_0x52d517){_0x4d4e8a['push'](_0x4d4e8a['shift']());}};_0x2e304d(++_0x162fd7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x2e00ca,_0x101c05){var _0x305e01=function(_0x419e17){while(--_0x419e17){_0x2e00ca['push'](_0x2e00ca['shift']());}};_0x305e01(++_0x101c05);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 8ca6453..b2e7e37 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 _0x58c5=['transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x58c5,0x18a));var _0x558c=function(_0x82791e,_0x57e0c5){_0x82791e=_0x82791e-0x0;var _0x20cb8c=_0x58c5[_0x82791e];return _0x20cb8c;};'use strict';var client=require(_0x558c('0x0'));exports[_0x558c('0x1')]={};exports[_0x558c('0x2')]=function(_0x41d68f){return client[_0x558c('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x41d68f[_0x558c('0x4')],'transfererchannel':_0x41d68f[_0x558c('0x5')],'transferercalleridnum':_0x41d68f[_0x558c('0x6')],'transferercalleridname':_0x41d68f[_0x558c('0x7')],'transfererconnectedlinenum':_0x41d68f[_0x558c('0x8')],'transfererconnectedlinename':_0x41d68f[_0x558c('0x9')],'transfereraccountcode':_0x41d68f[_0x558c('0xa')],'transferercontext':_0x41d68f[_0x558c('0xb')],'transfererexten':_0x41d68f[_0x558c('0xc')],'transfererlinkedid':_0x41d68f[_0x558c('0xd')],'transfereechannel':_0x41d68f[_0x558c('0xe')],'transfereecalleridnum':_0x41d68f[_0x558c('0xf')],'transfereecalleridname':_0x41d68f[_0x558c('0x10')],'transfereeconnectedlinenum':_0x41d68f[_0x558c('0x11')],'transfereeconnectedlinename':_0x41d68f[_0x558c('0x12')],'transfereeaccountcode':_0x41d68f['transfereeaccountcode'],'transfereecontext':_0x41d68f['transfereecontext'],'transfereeexten':_0x41d68f['transfereeexten'],'transfereelinkedid':_0x41d68f[_0x558c('0x13')],'isexternal':_0x41d68f[_0x558c('0x14')],'context':_0x41d68f[_0x558c('0x15')],'extension':_0x41d68f[_0x558c('0x16')],'type':_0x558c('0x17')},'log':_0x558c('0x18')});};exports[_0x558c('0x19')]=function(_0x5f0c37){return client[_0x558c('0x3')](_0x558c('0x18'),{'body':{'result':_0x5f0c37['result'],'transfererchannel':_0x5f0c37[_0x558c('0x1a')],'transferercalleridnum':_0x5f0c37['origtransferercalleridnum'],'transferercalleridname':_0x5f0c37['origtransferercalleridname'],'transfererconnectedlinenum':_0x5f0c37[_0x558c('0x1b')],'transfererconnectedlinename':_0x5f0c37[_0x558c('0x1c')],'transfereraccountcode':_0x5f0c37[_0x558c('0x1d')],'transferercontext':_0x5f0c37[_0x558c('0x1e')],'transfererexten':_0x5f0c37[_0x558c('0x1f')],'transfererlinkedid':_0x5f0c37[_0x558c('0x20')],'transfereechannel':_0x5f0c37[_0x558c('0x21')],'transfereecalleridnum':_0x5f0c37[_0x558c('0x22')],'transfereecalleridname':_0x5f0c37[_0x558c('0x23')],'transfereeconnectedlinenum':_0x5f0c37[_0x558c('0x24')],'transfereeconnectedlinename':_0x5f0c37['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5f0c37['transfertargetaccountcode'],'transfereecontext':_0x5f0c37[_0x558c('0x25')],'transfereeexten':_0x5f0c37[_0x558c('0x26')],'transfereelinkedid':_0x5f0c37[_0x558c('0x27')],'isexternal':_0x5f0c37[_0x558c('0x14')],'context':_0x5f0c37[_0x558c('0x28')],'extension':_0x5f0c37[_0x558c('0x29')],'type':_0x558c('0x2a')},'log':_0x558c('0x18')});}; \ No newline at end of file +var _0x8b2a=['transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','isexternal','context','blind','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0x8b2a,0x129));var _0xa8b2=function(_0x493df0,_0x3808fe){_0x493df0=_0x493df0-0x0;var _0x4b6a03=_0x8b2a[_0x493df0];return _0x4b6a03;};'use strict';var client=require(_0xa8b2('0x0'));exports['transfers']={};exports[_0xa8b2('0x1')]=function(_0x18bfe9){return client[_0xa8b2('0x2')](_0xa8b2('0x3'),{'body':{'result':_0x18bfe9[_0xa8b2('0x4')],'transfererchannel':_0x18bfe9[_0xa8b2('0x5')],'transferercalleridnum':_0x18bfe9[_0xa8b2('0x6')],'transferercalleridname':_0x18bfe9['transferercalleridname'],'transfererconnectedlinenum':_0x18bfe9[_0xa8b2('0x7')],'transfererconnectedlinename':_0x18bfe9[_0xa8b2('0x8')],'transfereraccountcode':_0x18bfe9[_0xa8b2('0x9')],'transferercontext':_0x18bfe9[_0xa8b2('0xa')],'transfererexten':_0x18bfe9[_0xa8b2('0xb')],'transfererlinkedid':_0x18bfe9['transfererlinkedid'],'transfereechannel':_0x18bfe9[_0xa8b2('0xc')],'transfereecalleridnum':_0x18bfe9[_0xa8b2('0xd')],'transfereecalleridname':_0x18bfe9[_0xa8b2('0xe')],'transfereeconnectedlinenum':_0x18bfe9[_0xa8b2('0xf')],'transfereeconnectedlinename':_0x18bfe9[_0xa8b2('0x10')],'transfereeaccountcode':_0x18bfe9['transfereeaccountcode'],'transfereecontext':_0x18bfe9[_0xa8b2('0x11')],'transfereeexten':_0x18bfe9['transfereeexten'],'transfereelinkedid':_0x18bfe9[_0xa8b2('0x12')],'isexternal':_0x18bfe9[_0xa8b2('0x13')],'context':_0x18bfe9[_0xa8b2('0x14')],'extension':_0x18bfe9['extension'],'type':_0xa8b2('0x15')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x12fd8b){return client[_0xa8b2('0x2')](_0xa8b2('0x3'),{'body':{'result':_0x12fd8b['result'],'transfererchannel':_0x12fd8b['origtransfererchannel'],'transferercalleridnum':_0x12fd8b[_0xa8b2('0x16')],'transferercalleridname':_0x12fd8b[_0xa8b2('0x17')],'transfererconnectedlinenum':_0x12fd8b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x12fd8b[_0xa8b2('0x18')],'transfereraccountcode':_0x12fd8b[_0xa8b2('0x19')],'transferercontext':_0x12fd8b[_0xa8b2('0x1a')],'transfererexten':_0x12fd8b[_0xa8b2('0x1b')],'transfererlinkedid':_0x12fd8b['origtransfererlinkedid'],'transfereechannel':_0x12fd8b[_0xa8b2('0x1c')],'transfereecalleridnum':_0x12fd8b[_0xa8b2('0x1d')],'transfereecalleridname':_0x12fd8b[_0xa8b2('0x1e')],'transfereeconnectedlinenum':_0x12fd8b[_0xa8b2('0x1f')],'transfereeconnectedlinename':_0x12fd8b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x12fd8b[_0xa8b2('0x20')],'transfereecontext':_0x12fd8b[_0xa8b2('0x21')],'transfereeexten':_0x12fd8b[_0xa8b2('0x22')],'transfereelinkedid':_0x12fd8b[_0xa8b2('0x23')],'isexternal':_0x12fd8b[_0xa8b2('0x13')],'context':_0x12fd8b[_0xa8b2('0x24')],'extension':_0x12fd8b['origtransfererexten'],'type':_0xa8b2('0x25')},'log':_0xa8b2('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 348232d..674df55 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 _0x0eeb=['originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','wav','MixMonitor','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','emit','custom:','event','faxAccounts','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../ami','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','then','message','catch','command','Command','Action','content','voiceQueues','hasOwnProperty','strategy','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0eeb[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var jayson=require(_0xb0ee('0x2'));var schema=require(_0xb0ee('0x3'));var BPromise=require(_0xb0ee('0x4'));var moment=require(_0xb0ee('0x5'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xb0ee('0x6'));exports[_0xb0ee('0x7')]=function(_0x13a7ce,_0x76bf19,_0x209dda){return new BPromise(function(_0x453fa4,_0x17f445){var _0x5377b4={'QueuePause':function(_0x207a85){return new Promise(function(_0x586bc9,_0x13c198){var _0x3fb986=util[_0xb0ee('0x8')](_0xb0ee('0x9'),_0xb0ee('0xa'),_0x207a85[_0xb0ee('0xb')]);if(_0x13a7ce['timers']&&_0x13a7ce['timers'][_0x3fb986]&&_0x13a7ce[_0xb0ee('0xc')][_0x3fb986][_0xb0ee('0xd')]){_0x13a7ce['timers'][_0x3fb986]['updateAcw']();}if(_0x13a7ce[_0xb0ee('0xe')][_0x3fb986]){_0x13a7ce[_0xb0ee('0xe')][_0x3fb986][_0xb0ee('0xf')]({'statePause':_0x207a85[_0xb0ee('0x10')]?!![]:![]});}_0x586bc9({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x1675b3){var _0x538f86=this;return new Promise(function(_0x478f98,_0x5c27b6){if(ami[_0xb0ee('0x11')]()==![]){return _0x5c27b6(_0x538f86[_0xb0ee('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xb0ee('0x13')][_0xb0ee('0x14')],_0xb0ee('0x15')][_0xb0ee('0x16')]('\x20')));}_0x1675b3=_[_0xb0ee('0x17')](_0x1675b3,_[_0xb0ee('0x18')](properties[_0xb0ee('0x19')]));_0x1675b3[_0xb0ee('0x1a')]='Reload';return ami['Action'](_0x1675b3)[_0xb0ee('0x1b')](function(_0x5702d8){_0x478f98({'code':0xc8,'message':_0x5702d8[_0xb0ee('0x1c')]});})[_0xb0ee('0x1d')](function(_0x480e51){_0x5c27b6(_0x538f86['error'](0x1f5,_0x480e51[_0xb0ee('0x1c')]));});});},'Command':function(_0x2bd14a){var _0x13c8a9=this;return new Promise(function(_0x4ce528,_0x1c5ed4){if(ami[_0xb0ee('0x11')]()==![]){return _0x1c5ed4(_0x13c8a9[_0xb0ee('0x12')](0x1f4,[config[_0xb0ee('0x13')]['ip'],config['asterisk'][_0xb0ee('0x14')],_0xb0ee('0x15')][_0xb0ee('0x16')]('\x20')));}_0x2bd14a=_[_0xb0ee('0x17')](_0x2bd14a,_0xb0ee('0x1e'));_0x2bd14a[_0xb0ee('0x1a')]=_0xb0ee('0x1f');return ami[_0xb0ee('0x20')](_0x2bd14a)[_0xb0ee('0x1b')](function(_0xc019d5){_0x4ce528({'code':0xc8,'message':_0xc019d5[_0xb0ee('0x21')]});})[_0xb0ee('0x1d')](function(_0x140c8f){_0x1c5ed4(_0x13c8a9[_0xb0ee('0x12')](0x1f5,_0x140c8f[_0xb0ee('0x1c')]));});});},'VoiceQueues':function(_0x5a1197){return new Promise(function(_0x151188,_0x4c4433){var _0x53bccd=[];for(var _0x3442b7 in _0x13a7ce[_0xb0ee('0x22')]){if(_0x13a7ce[_0xb0ee('0x22')][_0xb0ee('0x23')](_0x3442b7)){var _0x560e40=_0x13a7ce[_0xb0ee('0x22')][_0x3442b7];var _0x379e19={'id':_0x560e40['id'],'name':_0x560e40[_0xb0ee('0xb')],'strategy':_0x560e40[_0xb0ee('0x24')],'answered':_0x560e40['answered'],'available':_0x560e40['available'],'loggedIn':_0x560e40[_0xb0ee('0x25')],'pTalking':_0x560e40[_0xb0ee('0x26')],'sumBillable':_0x560e40[_0xb0ee('0x27')],'sumDuration':_0x560e40[_0xb0ee('0x28')],'sumHoldTime':_0x560e40[_0xb0ee('0x29')]||0x0,'talking':_0x560e40['talking'],'total':_0x560e40['total'],'type':_0x560e40[_0xb0ee('0x2a')],'unmanaged':_0x560e40[_0xb0ee('0x2b')],'abandoned':_0x560e40[_0xb0ee('0x2c')],'waiting':_0x560e40[_0xb0ee('0x2d')],'loggedInDb':_0x560e40[_0xb0ee('0x2e')]};if(_0x560e40[_0xb0ee('0x2a')]===_0xb0ee('0x2f')){_0x379e19[_0xb0ee('0x30')]=_0x560e40[_0xb0ee('0x30')];_0x379e19['dialMethod']=_0x560e40[_0xb0ee('0x31')];_0x379e19[_0xb0ee('0x32')]=_0x560e40[_0xb0ee('0x32')];_0x379e19[_0xb0ee('0x33')]=_0x560e40[_0xb0ee('0x33')];_0x379e19[_0xb0ee('0x34')]=_0x560e40[_0xb0ee('0x34')];_0x379e19[_0xb0ee('0x35')]=_0x560e40['dialPrefix'];_0x379e19[_0xb0ee('0x36')]=_0x560e40['temp'];_0x379e19[_0xb0ee('0x37')]=_0x560e40[_0xb0ee('0x37')];_0x379e19[_0xb0ee('0x38')]=_0x560e40['outboundAnswerCallsDay'];_0x379e19['outboundBlacklistCallsDay']=_0x560e40['outboundBlacklistCallsDay'];_0x379e19['outboundBusyCallsDay']=_0x560e40[_0xb0ee('0x39')];_0x379e19[_0xb0ee('0x3a')]=_0x560e40['outboundCongestionCallsDay'];_0x379e19[_0xb0ee('0x3b')]=_0x560e40['outboundDropCallsDayACS'];_0x379e19['outboundDropCallsDayCallersExit']=_0x560e40[_0xb0ee('0x3c')];_0x379e19['outboundDropCallsDayTimeout']=_0x560e40['outboundDropCallsDayTimeout'];_0x379e19['outboundNoAnswerCallsDay']=_0x560e40[_0xb0ee('0x3d')];_0x379e19[_0xb0ee('0x3e')]=_0x560e40['outboundNoSuchCallsDay'];_0x379e19[_0xb0ee('0x3f')]=_0x560e40[_0xb0ee('0x3f')];_0x379e19[_0xb0ee('0x40')]=_0x560e40[_0xb0ee('0x40')];_0x379e19[_0xb0ee('0x41')]=_0x560e40[_0xb0ee('0x41')];_0x379e19[_0xb0ee('0x42')]=_0x560e40[_0xb0ee('0x42')];_0x379e19[_0xb0ee('0x43')]=_0x560e40[_0xb0ee('0x43')];_0x379e19[_0xb0ee('0x44')]=_0x560e40[_0xb0ee('0x44')];_0x379e19[_0xb0ee('0x45')]=_0x560e40[_0xb0ee('0x45')];_0x379e19[_0xb0ee('0x46')]=_0x560e40[_0xb0ee('0x46')];_0x379e19[_0xb0ee('0x47')]=_0x560e40[_0xb0ee('0x47')];_0x379e19[_0xb0ee('0x48')]=_0x560e40[_0xb0ee('0x48')];_0x379e19[_0xb0ee('0x49')]=_0x560e40['predictiveIntervalErlangCallsDroppedCalls'];_0x379e19['predictiveIntervalHitRate']=_0x560e40[_0xb0ee('0x4a')];_0x379e19['predictiveIntervalMultiplicativeFactor']=_0x560e40[_0xb0ee('0x4b')];_0x379e19[_0xb0ee('0x4c')]=_0x560e40[_0xb0ee('0x4c')];_0x379e19[_0xb0ee('0x4d')]=_0x560e40[_0xb0ee('0x4d')];_0x379e19['predictiveIntervalTotalCalls']=_0x560e40[_0xb0ee('0x4e')];_0x379e19[_0xb0ee('0x1c')]=_0x560e40['message'];_0x379e19[_0xb0ee('0x4f')]=_0x560e40[_0xb0ee('0x4f')];_0x379e19[_0xb0ee('0x50')]=_0x560e40[_0xb0ee('0x50')];_0x379e19[_0xb0ee('0x51')]=_0x560e40[_0xb0ee('0x51')];_0x379e19[_0xb0ee('0x52')]=_0x560e40['erlangAbandonmentRate'];_0x379e19[_0xb0ee('0x53')]=_0x560e40[_0xb0ee('0x53')];_0x379e19['startPredictive']=_0x560e40[_0xb0ee('0x54')];_0x379e19['startProgressive']=_0x560e40[_0xb0ee('0x55')];}if(_0x560e40['Trunk']){_0x379e19[_0xb0ee('0x56')]={'id':_0x560e40['Trunk']['id'],'name':_0x560e40[_0xb0ee('0x56')][_0xb0ee('0xb')],'active':_0x560e40[_0xb0ee('0x56')][_0xb0ee('0x57')],'callerid':_0x560e40[_0xb0ee('0x56')][_0xb0ee('0x58')]};}if(_0x560e40[_0xb0ee('0x59')]){_0x379e19[_0xb0ee('0x59')]={'id':_0x560e40[_0xb0ee('0x59')]['id'],'name':_0x560e40[_0xb0ee('0x59')][_0xb0ee('0xb')]};}_0x53bccd[_0xb0ee('0x5a')](_0x379e19);}}_0x151188({'count':_0x53bccd[_0xb0ee('0x5b')],'rows':_0x53bccd});});},'UpdateVoiceQueue':function(_0x3283e1){return new Promise(function(_0x29c77f,_0x1fe004){var _0x531285=_['find'](_0x13a7ce[_0xb0ee('0x22')],{'id':parseInt(_0x3283e1['id'])});var _0x1c9b6f=_['omit'](_0x3283e1,['id']);if(_0x531285){for(var _0x3ef149 in _0x1c9b6f){if(typeof _0x1c9b6f[_0x3ef149]!=='undefined'&&typeof _0x531285[_0x3ef149]!==_0xb0ee('0x5c')){_0x531285[_0x3ef149]=_0x1c9b6f[_0x3ef149];}}_0x29c77f(_0x531285);}else{_0x1fe004();}});},'VoiceChannels':function(_0x10b262){return new Promise(function(_0x27ad3f,_0x75d703){var _0xc97f89=_[_0xb0ee('0x5d')](_0x13a7ce[_0xb0ee('0x5e')]);_0x27ad3f({'count':_0xc97f89[_0xb0ee('0x5b')],'rows':_0xc97f89});});},'VoiceChannelMixMonitor':function(_0xd75cb7){var _0x9dc38a=this;return new Promise(function(_0x27ad24,_0x481163){if(ami['isConnected']()==![]){return _0x481163(_0x9dc38a['error'](0x1f4,[config[_0xb0ee('0x13')]['ip'],config[_0xb0ee('0x13')]['username'],_0xb0ee('0x15')][_0xb0ee('0x16')]('\x20')));}var _0x17e916=schema(properties[_0xb0ee('0x5f')])[_0xb0ee('0x3')](_0xd75cb7);if(_0x17e916[_0xb0ee('0x5b')]>0x0){return _0x481163(_0x9dc38a['error'](0x1f4,_[_0xb0ee('0x60')](_0x17e916,_0xb0ee('0x1c'))['join'](',\x20')));}var _0x32df68=_['find'](_0x13a7ce[_0xb0ee('0x5e')],{'uniqueid':_0xd75cb7[_0xb0ee('0x61')]});if(_0x32df68&&_0x32df68[_0xb0ee('0x62')]){var _0x599412=util['format'](_0xb0ee('0x63'),_0xd75cb7['filename']||_0xd75cb7[_0xb0ee('0x61')],_0xd75cb7[_0xb0ee('0x8')]||_0xb0ee('0x64'));return ami[_0xb0ee('0x20')]({'action':_0xb0ee('0x65'),'channel':_0x32df68[_0xb0ee('0x62')],'file':_0x599412,'options':'ai(mixmonitorid)'})[_0xb0ee('0x1b')](function(_0x341adf){var _0x4ec9bf=_[_0xb0ee('0x66')](_0x32df68[_0xb0ee('0x67')],{'filename':_0xb0ee('0x68')+_0x599412[_0xb0ee('0x69')]()});if(_[_0xb0ee('0x6a')](_0x4ec9bf)){_0x32df68[_0xb0ee('0x67')][_0xb0ee('0x5a')]({'filename':'/var/spool/asterisk/monitor/'+_0x599412[_0xb0ee('0x69')](),'createdAt':moment()[_0xb0ee('0x8')](_0xb0ee('0x6b')),'mixmonitorid':_0x341adf['mixmonitorid'],'status':_0xb0ee('0x6c')});}else{_0x4ec9bf[_0xb0ee('0x6d')]=_0x341adf[_0xb0ee('0x6d')];_0x4ec9bf[_0xb0ee('0x6e')]='rec';}_0x27ad24({'code':0xc8,'message':[_0xd75cb7[_0xb0ee('0x61')],_0xb0ee('0x6f'),_0x341adf[_0xb0ee('0x6d')]]['join']('\x20'),'mixmonitorid':_0x341adf[_0xb0ee('0x6d')]});})[_0xb0ee('0x1d')](function(_0x46deb9){_0x481163(_0x9dc38a[_0xb0ee('0x12')](0x1f5,[_0xd75cb7[_0xb0ee('0x61')],_0x46deb9[_0xb0ee('0x1c')][_0xb0ee('0x69')]()][_0xb0ee('0x16')]('\x20')));});}else{return _0x481163(_0x9dc38a['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x1b1311){var _0x40b4e4=this;return new Promise(function(_0x1ba436,_0x2f7068){if(ami[_0xb0ee('0x11')]()==![]){return _0x2f7068(_0x40b4e4['error'](0x1f4,[config[_0xb0ee('0x13')]['ip'],config['asterisk'][_0xb0ee('0x14')],'ami\x20disconnected']['join']('\x20')));}var _0x105f42=schema(properties[_0xb0ee('0x5f')])[_0xb0ee('0x3')](_0x1b1311);if(_0x105f42[_0xb0ee('0x5b')]>0x0){return _0x2f7068(_0x40b4e4[_0xb0ee('0x12')](0x1f4,_[_0xb0ee('0x60')](_0x105f42,_0xb0ee('0x1c'))[_0xb0ee('0x16')](',\x20')));}var _0x155a88=_[_0xb0ee('0x66')](_0x13a7ce[_0xb0ee('0x5e')],{'uniqueid':_0x1b1311['uniqueid']});if(_0x155a88){return BPromise['resolve']()['then'](function(){if(_0x155a88[_0xb0ee('0x62')]){return ami['Action']({'action':_0xb0ee('0x70'),'channel':_0x155a88['channel'],'mixmonitorid':_0x1b1311['mixmonitorid']})[_0xb0ee('0x1d')](function(_0x1b42aa){});}})['then'](function(){if(_0x155a88[_0xb0ee('0x71')]){return ami[_0xb0ee('0x20')]({'action':_0xb0ee('0x70'),'channel':_0x155a88['destinationchannel'],'mixmonitorid':_0x1b1311[_0xb0ee('0x6d')]})[_0xb0ee('0x1d')](function(_0x12c781){});}})[_0xb0ee('0x1b')](function(_0x3281de){var _0x285499=_[_0xb0ee('0x66')](_0x155a88['monitors'],{'mixmonitorid':_0x1b1311['mixmonitorid']});if(_0x285499){_0x285499[_0xb0ee('0x6e')]=_0xb0ee('0x72');}})[_0xb0ee('0x1b')](function(){var _0x387072=util[_0xb0ee('0x8')](_0xb0ee('0x63'),_0x1b1311['filename']||_0x1b1311[_0xb0ee('0x61')],_0x1b1311['format']||_0xb0ee('0x64'));var _0x2bdb86=_[_0xb0ee('0x66')](_0x155a88['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x387072[_0xb0ee('0x69')]()});if(_0x2bdb86){_0x2bdb86[_0xb0ee('0x6e')]=_0xb0ee('0x72');}})[_0xb0ee('0x1b')](function(){_0x1ba436({'code':0xc8,'message':[_0x1b1311[_0xb0ee('0x61')],_0xb0ee('0x73')][_0xb0ee('0x16')]('\x20')});})[_0xb0ee('0x1d')](function(_0xa2f2ef){_0x2f7068(_0x40b4e4[_0xb0ee('0x12')](0x1f5,[_0x1b1311[_0xb0ee('0x61')],_0xa2f2ef['message'][_0xb0ee('0x69')]()]['join']('\x20')));});}else{return _0x2f7068(_0x40b4e4[_0xb0ee('0x12')](0x1f5,_0xb0ee('0x74')));}});},'VoiceQueuesChannels':function(_0xd52d8c){return new Promise(function(_0x46faf5,_0x13ee76){var _0x252b68=_[_0xb0ee('0x5d')](_0x13a7ce['queueChannels']);_0x46faf5({'count':_0x252b68[_0xb0ee('0x5b')],'rows':_0x252b68});});},'VoiceQueuesChannel':function(_0x358238){var _0x17ce21=this;return new Promise(function(_0x4f06a3,_0xa085e4){var _0x1cbaf9=schema(properties[_0xb0ee('0x75')])[_0xb0ee('0x3')](_0x358238);if(_0x1cbaf9['length']>0x0){return _0xa085e4(_0x17ce21[_0xb0ee('0x12')](0x1f4,_[_0xb0ee('0x60')](_0x1cbaf9,'message')[_0xb0ee('0x16')](',\x20')));}var _0x59caab=_[_0xb0ee('0x66')](_0x13a7ce[_0xb0ee('0x76')],{'uniqueid':_0x358238[_0xb0ee('0x61')]});if(_0x59caab){_0x4f06a3(_0x59caab);}else{return _0xa085e4(_0x17ce21[_0xb0ee('0x12')](0x1f5,_0xb0ee('0x74')));}});},'VoiceQueuesChannelHangup':function(_0x3e8f10){var _0x3712ce=this;return new Promise(function(_0x2d5685,_0x203b46){if(ami[_0xb0ee('0x11')]()==![]){return _0x203b46(_0x3712ce[_0xb0ee('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xb0ee('0x13')]['username'],_0xb0ee('0x15')]['join']('\x20')));}var _0x451d75=schema(properties[_0xb0ee('0x77')])[_0xb0ee('0x3')](_0x3e8f10);if(_0x451d75[_0xb0ee('0x5b')]>0x0){return _0x203b46(_0x3712ce['error'](0x1f4,_[_0xb0ee('0x60')](_0x451d75,'message')['join'](',\x20')));}var _0x16f2ff=_['find'](_0x13a7ce[_0xb0ee('0x76')],{'uniqueid':_0x3e8f10[_0xb0ee('0x61')]});if(_0x16f2ff&&_0x16f2ff[_0xb0ee('0x62')]){return ami['Action']({'action':_0xb0ee('0x78'),'channel':_0x16f2ff[_0xb0ee('0x62')]})[_0xb0ee('0x1b')](function(_0x2228c7){_0x2d5685({'code':0xc8,'message':[_0x3e8f10[_0xb0ee('0x61')],_0x2228c7[_0xb0ee('0x1c')][_0xb0ee('0x69')]()][_0xb0ee('0x16')]('\x20')});})[_0xb0ee('0x1d')](function(_0x371a13){_0x203b46(_0x3712ce[_0xb0ee('0x12')](0x1f5,[_0x3e8f10[_0xb0ee('0x61')],_0x371a13['message']['toLowerCase']()][_0xb0ee('0x16')]('\x20')));});}else{return _0x203b46(_0x3712ce[_0xb0ee('0x12')](0x1f5,_0xb0ee('0x74')));}});},'VoiceQueuesChannelRedirect':function(_0x1b53ea){var _0x1aed71=this;return new Promise(function(_0x47f06f,_0xe26a66){if(ami[_0xb0ee('0x11')]()==![]){return _0xe26a66(_0x1aed71[_0xb0ee('0x12')](0x1f4,[config[_0xb0ee('0x13')]['ip'],config[_0xb0ee('0x13')][_0xb0ee('0x14')],_0xb0ee('0x15')][_0xb0ee('0x16')]('\x20')));}var _0x58a6f2=schema(properties[_0xb0ee('0x79')])[_0xb0ee('0x3')](_0x1b53ea);if(_0x58a6f2['length']>0x0){return _0xe26a66(_0x1aed71[_0xb0ee('0x12')](0x1f4,_[_0xb0ee('0x60')](_0x58a6f2,'message')[_0xb0ee('0x16')](',\x20')));}var _0x5f0e6d=_['find'](_0x13a7ce[_0xb0ee('0x76')],{'uniqueid':_0x1b53ea[_0xb0ee('0x61')]});if(_0x5f0e6d&&_0x5f0e6d[_0xb0ee('0x62')]){return ami['Action']({'action':'Redirect','channel':_0x5f0e6d[_0xb0ee('0x62')],'exten':_0x1b53ea[_0xb0ee('0x7a')],'context':_0x1b53ea[_0xb0ee('0x7b')]||_0x5f0e6d['context'],'priority':0x1})[_0xb0ee('0x1b')](function(_0x445c3f){_0x47f06f({'code':0xc8,'message':[_0x1b53ea['uniqueid'],_0x445c3f['message']['toLowerCase']()]['join']('\x20')});})[_0xb0ee('0x1d')](function(_0x3066b6){_0xe26a66(_0x1aed71[_0xb0ee('0x12')](0x1f5,[_0x1b53ea['uniqueid'],_0x3066b6[_0xb0ee('0x1c')]['toLowerCase']()]['join']('\x20')));});}else{return _0xe26a66(_0x1aed71['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2b2597){return new Promise(function(_0x345eb7,_0x586bce){var _0x5a634a=_[_0xb0ee('0x5d')](_0x13a7ce[_0xb0ee('0xe')]);_0x345eb7({'count':_0x5a634a['length'],'rows':_0x5a634a});});},'Telephones':function(_0x4b0e71){return new Promise(function(_0x195707,_0x4608f4){var _0x5169bc=_['values'](_0x13a7ce[_0xb0ee('0x7c')]);_0x195707({'count':_0x5169bc['length'],'rows':_0x5169bc});});},'Trunks':function(_0x4f6f59){return new Promise(function(_0x3e8034,_0x472b1c){var _0x471e4a=_[_0xb0ee('0x5d')](_0x13a7ce[_0xb0ee('0x7d')]);_0x3e8034({'count':_0x471e4a[_0xb0ee('0x5b')],'rows':_0x471e4a});});},'OutboundChannels':function(_0x55c96c){return new Promise(function(_0x437dd1,_0x11a80c){var _0x3e2f22=_['values'](_0x13a7ce[_0xb0ee('0x7e')]);_0x437dd1({'count':_0x3e2f22['length'],'rows':_0x3e2f22});});},'Outbound':function(_0xa22b39){return new Promise(function(_0x50d3c7,_0x4c1a66){_0x50d3c7(_0x13a7ce[_0xb0ee('0x2f')]);});},'Campaigns':function(_0x445c83){return new Promise(function(_0x4e7981,_0x163b65){var _0x1726ad=_[_0xb0ee('0x5d')](_0x13a7ce[_0xb0ee('0x7f')]);_0x4e7981({'count':_0x1726ad[_0xb0ee('0x5b')],'rows':_0x1726ad});});},'VoiceQueuesPreview':function(_0x2406df){var _0x206de5=this;return new Promise(function(_0x44a5ad,_0x222491){_0x76bf19[_0xb0ee('0x80')](_0x2406df['id'])[_0xb0ee('0x1b')](function(_0x39dd25){_0x44a5ad({'code':0xc8,'message':_0x39dd25[_0xb0ee('0x1c')]});})[_0xb0ee('0x1d')](function(_0x59e4f1){_0x222491(_0x206de5[_0xb0ee('0x12')](0x1f4,_0x59e4f1[_0xb0ee('0x1c')]));});});},'EventManager':function(_0x4a0b5b){var _0x2e4ffe=this;return new Promise(function(_0x554405,_0x2e7604){if(!_0x4a0b5b['event']){return _0x2e7604(_0x2e4ffe[_0xb0ee('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xb0ee('0x81')](_0xb0ee('0x82')+_0x4a0b5b[_0xb0ee('0x83')],_0x4a0b5b[_0xb0ee('0x1c')]);_0x554405({'code':0xc8,'message':_0x4a0b5b});});},'FaxAccounts':function(_0x96d5c6){return new Promise(function(_0xf74391,_0x50a7c0){var _0x314e3c=_[_0xb0ee('0x5d')](_0x13a7ce[_0xb0ee('0x84')]);_0xf74391({'count':_0x314e3c[_0xb0ee('0x5b')],'rows':_0x314e3c});});},'SendFax':function(_0x48d347){var _0x351c45=this;return new Promise(function(_0x4ebb8b,_0x469490){_0x209dda[_0xb0ee('0x85')](_0x48d347)['then'](function(_0x2ce819){_0x4ebb8b({'code':0xc8,'message':_0x2ce819[_0xb0ee('0x1c')]});})['catch'](function(_0x249c57){_0x469490(_0x351c45['error'](0x1f4,_0x249c57[_0xb0ee('0x1c')]));});});},'CheckAfterSend':function(_0xa0ab4d){var _0x500722=this;return new Promise(function(_0x54a398,_0x1713e2){_0x209dda[_0xb0ee('0x86')](_0xa0ab4d)[_0xb0ee('0x1b')](function(_0x188773){_0x54a398({'code':0xc8,'message':_0x188773['message']});})[_0xb0ee('0x1d')](function(_0x1a2f27){_0x1713e2(_0x500722[_0xb0ee('0x12')](0x1f4,_0x1a2f27[_0xb0ee('0x1c')]));});});}};var _0x1ad658=jayson['server'](_0x5377b4)['http']();_0x1ad658['on'](_0xb0ee('0x12'),function(_0x51c4ed){return _0x17f445(_0x51c4ed);});_0x1ad658[_0xb0ee('0x7')](0x232a,_0xb0ee('0x87'),function(){console[_0xb0ee('0x88')](_0xb0ee('0x89'),0x232a);return _0x453fa4('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xdfa0=['then','message','catch','voiceQueues','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','length','find','omit','undefined','values','channels','voicechannel','uniqueid','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','monitors','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','emit','custom:','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','moment','../../../config/environment','../properties','listen','format','%s/%s','SIP','timers','timer','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action'];(function(_0x3386fd,_0x8596f4){var _0x19e6f6=function(_0x4bd4ec){while(--_0x4bd4ec){_0x3386fd['push'](_0x3386fd['shift']());}};_0x19e6f6(++_0x8596f4);}(_0xdfa0,0x69));var _0x0dfa=function(_0x19bb9b,_0x4827d9){_0x19bb9b=_0x19bb9b-0x0;var _0x597235=_0xdfa0[_0x19bb9b];return _0x597235;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var jayson=require(_0x0dfa('0x1'));var schema=require(_0x0dfa('0x2'));var BPromise=require('bluebird');var moment=require(_0x0dfa('0x3'));var config=require(_0x0dfa('0x4'));var properties=require(_0x0dfa('0x5'));var ami=require('../ami');exports[_0x0dfa('0x6')]=function(_0x50b91e,_0x2f60d7,_0x2efe20){return new BPromise(function(_0x4830b6,_0x417f7a){var _0x29ca78={'QueuePause':function(_0x32280b){return new Promise(function(_0x16070c,_0x3b6881){var _0x4c7be0=util[_0x0dfa('0x7')](_0x0dfa('0x8'),_0x0dfa('0x9'),_0x32280b['name']);if(_0x50b91e[_0x0dfa('0xa')]&&_0x50b91e['timers'][_0x4c7be0]&&_0x50b91e[_0x0dfa('0xa')][_0x4c7be0][_0x0dfa('0xb')]){_0x50b91e[_0x0dfa('0xa')][_0x4c7be0]['updateAcw']();}if(_0x50b91e[_0x0dfa('0xc')][_0x4c7be0]){_0x50b91e[_0x0dfa('0xc')][_0x4c7be0]['updateStatusRealtime']({'statePause':_0x32280b[_0x0dfa('0xd')]?!![]:![]});}_0x16070c({'code':0xc8,'message':_0x0dfa('0xe')});});},'Reload':function(_0x47c37c){var _0x4162e1=this;return new Promise(function(_0x1e5532,_0x4215fd){if(ami[_0x0dfa('0xf')]()==![]){return _0x4215fd(_0x4162e1[_0x0dfa('0x10')](0x1f4,[config[_0x0dfa('0x11')]['ip'],config['asterisk'][_0x0dfa('0x12')],_0x0dfa('0x13')][_0x0dfa('0x14')]('\x20')));}_0x47c37c=_[_0x0dfa('0x15')](_0x47c37c,_[_0x0dfa('0x16')](properties[_0x0dfa('0x17')]));_0x47c37c[_0x0dfa('0x18')]=_0x0dfa('0x19');return ami[_0x0dfa('0x1a')](_0x47c37c)[_0x0dfa('0x1b')](function(_0xc524fe){_0x1e5532({'code':0xc8,'message':_0xc524fe[_0x0dfa('0x1c')]});})[_0x0dfa('0x1d')](function(_0x208c0b){_0x4215fd(_0x4162e1[_0x0dfa('0x10')](0x1f5,_0x208c0b['message']));});});},'Command':function(_0xd21935){var _0x22ff4e=this;return new Promise(function(_0x263d6c,_0x1bb2a){if(ami[_0x0dfa('0xf')]()==![]){return _0x1bb2a(_0x22ff4e['error'](0x1f4,[config['asterisk']['ip'],config[_0x0dfa('0x11')][_0x0dfa('0x12')],_0x0dfa('0x13')]['join']('\x20')));}_0xd21935=_[_0x0dfa('0x15')](_0xd21935,'command');_0xd21935[_0x0dfa('0x18')]='Command';return ami[_0x0dfa('0x1a')](_0xd21935)[_0x0dfa('0x1b')](function(_0x43f048){_0x263d6c({'code':0xc8,'message':_0x43f048['content']});})[_0x0dfa('0x1d')](function(_0x70ff72){_0x1bb2a(_0x22ff4e[_0x0dfa('0x10')](0x1f5,_0x70ff72[_0x0dfa('0x1c')]));});});},'VoiceQueues':function(_0x1dfbea){return new Promise(function(_0x12bd2a,_0x13005a){var _0x3f40e4=[];for(var _0x2e4523 in _0x50b91e[_0x0dfa('0x1e')]){if(_0x50b91e['voiceQueues']['hasOwnProperty'](_0x2e4523)){var _0x4084c6=_0x50b91e[_0x0dfa('0x1e')][_0x2e4523];var _0x4992b8={'id':_0x4084c6['id'],'name':_0x4084c6[_0x0dfa('0x1f')],'strategy':_0x4084c6[_0x0dfa('0x20')],'answered':_0x4084c6[_0x0dfa('0x21')],'available':_0x4084c6['available'],'loggedIn':_0x4084c6[_0x0dfa('0x22')],'pTalking':_0x4084c6[_0x0dfa('0x23')],'sumBillable':_0x4084c6[_0x0dfa('0x24')],'sumDuration':_0x4084c6[_0x0dfa('0x25')],'sumHoldTime':_0x4084c6[_0x0dfa('0x26')]||0x0,'talking':_0x4084c6[_0x0dfa('0x27')],'total':_0x4084c6['total'],'type':_0x4084c6[_0x0dfa('0x28')],'unmanaged':_0x4084c6[_0x0dfa('0x29')],'abandoned':_0x4084c6['abandoned'],'waiting':_0x4084c6[_0x0dfa('0x2a')],'loggedInDb':_0x4084c6[_0x0dfa('0x2b')]};if(_0x4084c6[_0x0dfa('0x28')]===_0x0dfa('0x2c')){_0x4992b8['dialActive']=_0x4084c6[_0x0dfa('0x2d')];_0x4992b8[_0x0dfa('0x2e')]=_0x4084c6[_0x0dfa('0x2e')];_0x4992b8['dialOriginateCallerIdName']=_0x4084c6['dialOriginateCallerIdName'];_0x4992b8[_0x0dfa('0x2f')]=_0x4084c6[_0x0dfa('0x2f')];_0x4992b8['dialOriginateTimeout']=_0x4084c6['dialOriginateTimeout'];_0x4992b8['dialPrefix']=_0x4084c6[_0x0dfa('0x30')];_0x4992b8[_0x0dfa('0x31')]=_0x4084c6[_0x0dfa('0x31')];_0x4992b8[_0x0dfa('0x32')]=_0x4084c6['outboundAnswerAgiCallsDay'];_0x4992b8[_0x0dfa('0x33')]=_0x4084c6[_0x0dfa('0x33')];_0x4992b8[_0x0dfa('0x34')]=_0x4084c6[_0x0dfa('0x34')];_0x4992b8[_0x0dfa('0x35')]=_0x4084c6[_0x0dfa('0x35')];_0x4992b8[_0x0dfa('0x36')]=_0x4084c6[_0x0dfa('0x36')];_0x4992b8[_0x0dfa('0x37')]=_0x4084c6[_0x0dfa('0x37')];_0x4992b8['outboundDropCallsDayCallersExit']=_0x4084c6['outboundDropCallsDayCallersExit'];_0x4992b8[_0x0dfa('0x38')]=_0x4084c6[_0x0dfa('0x38')];_0x4992b8[_0x0dfa('0x39')]=_0x4084c6[_0x0dfa('0x39')];_0x4992b8[_0x0dfa('0x3a')]=_0x4084c6['outboundNoSuchCallsDay'];_0x4992b8[_0x0dfa('0x3b')]=_0x4084c6['outboundOriginateFailureCallsDay'];_0x4992b8[_0x0dfa('0x3c')]=_0x4084c6[_0x0dfa('0x3c')];_0x4992b8[_0x0dfa('0x3d')]=_0x4084c6['outboundRejectCallsDay'];_0x4992b8['outboundUnknownCallsDay']=_0x4084c6[_0x0dfa('0x3e')];_0x4992b8[_0x0dfa('0x3f')]=_0x4084c6[_0x0dfa('0x3f')];_0x4992b8['predictiveIntervalAvgHoldtime']=_0x4084c6[_0x0dfa('0x40')];_0x4992b8['predictiveIntervalAvgTalktime']=_0x4084c6[_0x0dfa('0x41')];_0x4992b8[_0x0dfa('0x42')]=_0x4084c6['predictiveIntervalDroppedCallsCallersExit'];_0x4992b8[_0x0dfa('0x43')]=_0x4084c6[_0x0dfa('0x43')];_0x4992b8[_0x0dfa('0x44')]=_0x4084c6[_0x0dfa('0x44')];_0x4992b8[_0x0dfa('0x45')]=_0x4084c6[_0x0dfa('0x45')];_0x4992b8['predictiveIntervalHitRate']=_0x4084c6[_0x0dfa('0x46')];_0x4992b8[_0x0dfa('0x47')]=_0x4084c6[_0x0dfa('0x47')];_0x4992b8[_0x0dfa('0x48')]=_0x4084c6[_0x0dfa('0x48')];_0x4992b8[_0x0dfa('0x49')]=_0x4084c6[_0x0dfa('0x49')];_0x4992b8[_0x0dfa('0x4a')]=_0x4084c6[_0x0dfa('0x4a')];_0x4992b8[_0x0dfa('0x1c')]=_0x4084c6[_0x0dfa('0x1c')];_0x4992b8['originated']=_0x4084c6['originated'];_0x4992b8[_0x0dfa('0x4b')]=_0x4084c6[_0x0dfa('0x4b')];_0x4992b8['erlangCallToSecond']=_0x4084c6['erlangCallToSecond'];_0x4992b8['erlangAbandonmentRate']=_0x4084c6[_0x0dfa('0x4c')];_0x4992b8['erlangBusyFactor']=_0x4084c6[_0x0dfa('0x4d')];_0x4992b8[_0x0dfa('0x4e')]=_0x4084c6[_0x0dfa('0x4e')];_0x4992b8[_0x0dfa('0x4f')]=_0x4084c6[_0x0dfa('0x4f')];}if(_0x4084c6[_0x0dfa('0x50')]){_0x4992b8[_0x0dfa('0x50')]={'id':_0x4084c6[_0x0dfa('0x50')]['id'],'name':_0x4084c6['Trunk'][_0x0dfa('0x1f')],'active':_0x4084c6[_0x0dfa('0x50')]['active'],'callerid':_0x4084c6[_0x0dfa('0x50')][_0x0dfa('0x51')]};}if(_0x4084c6['Interval']){_0x4992b8[_0x0dfa('0x52')]={'id':_0x4084c6[_0x0dfa('0x52')]['id'],'name':_0x4084c6[_0x0dfa('0x52')][_0x0dfa('0x1f')]};}_0x3f40e4['push'](_0x4992b8);}}_0x12bd2a({'count':_0x3f40e4[_0x0dfa('0x53')],'rows':_0x3f40e4});});},'UpdateVoiceQueue':function(_0x2617b1){return new Promise(function(_0x483630,_0x3fc10d){var _0x13c4ad=_[_0x0dfa('0x54')](_0x50b91e[_0x0dfa('0x1e')],{'id':parseInt(_0x2617b1['id'])});var _0x1f31b7=_[_0x0dfa('0x55')](_0x2617b1,['id']);if(_0x13c4ad){for(var _0x33c17b in _0x1f31b7){if(typeof _0x1f31b7[_0x33c17b]!==_0x0dfa('0x56')&&typeof _0x13c4ad[_0x33c17b]!==_0x0dfa('0x56')){_0x13c4ad[_0x33c17b]=_0x1f31b7[_0x33c17b];}}_0x483630(_0x13c4ad);}else{_0x3fc10d();}});},'VoiceChannels':function(_0x5bb41a){return new Promise(function(_0x28573d,_0x326433){var _0x48de6c=_[_0x0dfa('0x57')](_0x50b91e[_0x0dfa('0x58')]);_0x28573d({'count':_0x48de6c[_0x0dfa('0x53')],'rows':_0x48de6c});});},'VoiceChannelMixMonitor':function(_0xa676cc){var _0x560dfe=this;return new Promise(function(_0x5df0e8,_0x5f4572){if(ami[_0x0dfa('0xf')]()==![]){return _0x5f4572(_0x560dfe[_0x0dfa('0x10')](0x1f4,[config[_0x0dfa('0x11')]['ip'],config[_0x0dfa('0x11')][_0x0dfa('0x12')],_0x0dfa('0x13')]['join']('\x20')));}var _0x595ba5=schema(properties[_0x0dfa('0x59')])[_0x0dfa('0x2')](_0xa676cc);if(_0x595ba5[_0x0dfa('0x53')]>0x0){return _0x5f4572(_0x560dfe[_0x0dfa('0x10')](0x1f4,_['map'](_0x595ba5,'message')['join'](',\x20')));}var _0x2f018c=_[_0x0dfa('0x54')](_0x50b91e[_0x0dfa('0x58')],{'uniqueid':_0xa676cc[_0x0dfa('0x5a')]});if(_0x2f018c&&_0x2f018c[_0x0dfa('0x5b')]){var _0x16b025=util[_0x0dfa('0x7')](_0x0dfa('0x5c'),_0xa676cc['filename']||_0xa676cc['uniqueid'],_0xa676cc['format']||_0x0dfa('0x5d'));return ami['Action']({'action':_0x0dfa('0x5e'),'channel':_0x2f018c[_0x0dfa('0x5b')],'file':_0x16b025,'options':_0x0dfa('0x5f')})[_0x0dfa('0x1b')](function(_0x748132){var _0x31f272=_['find'](_0x2f018c['monitors'],{'filename':_0x0dfa('0x60')+_0x16b025[_0x0dfa('0x61')]()});if(_[_0x0dfa('0x62')](_0x31f272)){_0x2f018c['monitors'][_0x0dfa('0x63')]({'filename':_0x0dfa('0x60')+_0x16b025[_0x0dfa('0x61')](),'createdAt':moment()[_0x0dfa('0x7')](_0x0dfa('0x64')),'mixmonitorid':_0x748132[_0x0dfa('0x65')],'status':_0x0dfa('0x66')});}else{_0x31f272[_0x0dfa('0x65')]=_0x748132['mixmonitorid'];_0x31f272[_0x0dfa('0x67')]=_0x0dfa('0x66');}_0x5df0e8({'code':0xc8,'message':[_0xa676cc[_0x0dfa('0x5a')],_0x0dfa('0x68'),_0x748132[_0x0dfa('0x65')]]['join']('\x20'),'mixmonitorid':_0x748132['mixmonitorid']});})[_0x0dfa('0x1d')](function(_0x5389d6){_0x5f4572(_0x560dfe[_0x0dfa('0x10')](0x1f5,[_0xa676cc[_0x0dfa('0x5a')],_0x5389d6[_0x0dfa('0x1c')]['toLowerCase']()][_0x0dfa('0x14')]('\x20')));});}else{return _0x5f4572(_0x560dfe[_0x0dfa('0x10')](0x1f5,_0x0dfa('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x417ee1){var _0x1dddca=this;return new Promise(function(_0x598888,_0x4b4b04){if(ami['isConnected']()==![]){return _0x4b4b04(_0x1dddca[_0x0dfa('0x10')](0x1f4,[config[_0x0dfa('0x11')]['ip'],config[_0x0dfa('0x11')][_0x0dfa('0x12')],_0x0dfa('0x13')][_0x0dfa('0x14')]('\x20')));}var _0x56e483=schema(properties[_0x0dfa('0x59')])[_0x0dfa('0x2')](_0x417ee1);if(_0x56e483[_0x0dfa('0x53')]>0x0){return _0x4b4b04(_0x1dddca[_0x0dfa('0x10')](0x1f4,_[_0x0dfa('0x6a')](_0x56e483,_0x0dfa('0x1c'))['join'](',\x20')));}var _0x34d1e1=_[_0x0dfa('0x54')](_0x50b91e[_0x0dfa('0x58')],{'uniqueid':_0x417ee1['uniqueid']});if(_0x34d1e1){return BPromise[_0x0dfa('0x6b')]()[_0x0dfa('0x1b')](function(){if(_0x34d1e1[_0x0dfa('0x5b')]){return ami[_0x0dfa('0x1a')]({'action':_0x0dfa('0x6c'),'channel':_0x34d1e1[_0x0dfa('0x5b')],'mixmonitorid':_0x417ee1[_0x0dfa('0x65')]})[_0x0dfa('0x1d')](function(_0x4a1c24){});}})[_0x0dfa('0x1b')](function(){if(_0x34d1e1['destinationchannel']){return ami['Action']({'action':_0x0dfa('0x6c'),'channel':_0x34d1e1['destinationchannel'],'mixmonitorid':_0x417ee1[_0x0dfa('0x65')]})[_0x0dfa('0x1d')](function(_0x34107a){});}})['then'](function(_0x20217b){var _0x2b0b2d=_['find'](_0x34d1e1[_0x0dfa('0x6d')],{'mixmonitorid':_0x417ee1[_0x0dfa('0x65')]});if(_0x2b0b2d){_0x2b0b2d[_0x0dfa('0x67')]=_0x0dfa('0x6e');}})[_0x0dfa('0x1b')](function(){var _0x36c123=util[_0x0dfa('0x7')]('%s.%s',_0x417ee1[_0x0dfa('0x6f')]||_0x417ee1['uniqueid'],_0x417ee1[_0x0dfa('0x7')]||_0x0dfa('0x5d'));var _0x4a96b3=_['find'](_0x34d1e1['monitors'],{'filename':_0x0dfa('0x60')+_0x36c123['toLowerCase']()});if(_0x4a96b3){_0x4a96b3['status']=_0x0dfa('0x6e');}})[_0x0dfa('0x1b')](function(){_0x598888({'code':0xc8,'message':[_0x417ee1[_0x0dfa('0x5a')],_0x0dfa('0x70')][_0x0dfa('0x14')]('\x20')});})[_0x0dfa('0x1d')](function(_0x3b1c93){_0x4b4b04(_0x1dddca[_0x0dfa('0x10')](0x1f5,[_0x417ee1[_0x0dfa('0x5a')],_0x3b1c93[_0x0dfa('0x1c')]['toLowerCase']()][_0x0dfa('0x14')]('\x20')));});}else{return _0x4b4b04(_0x1dddca[_0x0dfa('0x10')](0x1f5,_0x0dfa('0x69')));}});},'VoiceQueuesChannels':function(_0x478b01){return new Promise(function(_0x212c43,_0x4132b5){var _0x230333=_[_0x0dfa('0x57')](_0x50b91e[_0x0dfa('0x71')]);_0x212c43({'count':_0x230333[_0x0dfa('0x53')],'rows':_0x230333});});},'VoiceQueuesChannel':function(_0x2e5d85){var _0x1c1e49=this;return new Promise(function(_0x1b3c5c,_0x321219){var _0x311560=schema(properties[_0x0dfa('0x72')])['validate'](_0x2e5d85);if(_0x311560['length']>0x0){return _0x321219(_0x1c1e49[_0x0dfa('0x10')](0x1f4,_['map'](_0x311560,_0x0dfa('0x1c'))[_0x0dfa('0x14')](',\x20')));}var _0x44e3d3=_['find'](_0x50b91e[_0x0dfa('0x71')],{'uniqueid':_0x2e5d85[_0x0dfa('0x5a')]});if(_0x44e3d3){_0x1b3c5c(_0x44e3d3);}else{return _0x321219(_0x1c1e49['error'](0x1f5,_0x0dfa('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x2d10ba){var _0xbf4253=this;return new Promise(function(_0x1e66ed,_0x48930b){if(ami[_0x0dfa('0xf')]()==![]){return _0x48930b(_0xbf4253[_0x0dfa('0x10')](0x1f4,[config[_0x0dfa('0x11')]['ip'],config[_0x0dfa('0x11')][_0x0dfa('0x12')],_0x0dfa('0x13')]['join']('\x20')));}var _0x21828e=schema(properties[_0x0dfa('0x73')])[_0x0dfa('0x2')](_0x2d10ba);if(_0x21828e[_0x0dfa('0x53')]>0x0){return _0x48930b(_0xbf4253[_0x0dfa('0x10')](0x1f4,_[_0x0dfa('0x6a')](_0x21828e,_0x0dfa('0x1c'))[_0x0dfa('0x14')](',\x20')));}var _0x460210=_[_0x0dfa('0x54')](_0x50b91e[_0x0dfa('0x71')],{'uniqueid':_0x2d10ba[_0x0dfa('0x5a')]});if(_0x460210&&_0x460210[_0x0dfa('0x5b')]){return ami[_0x0dfa('0x1a')]({'action':'Hangup','channel':_0x460210['channel']})[_0x0dfa('0x1b')](function(_0x4e3d5c){_0x1e66ed({'code':0xc8,'message':[_0x2d10ba[_0x0dfa('0x5a')],_0x4e3d5c[_0x0dfa('0x1c')][_0x0dfa('0x61')]()]['join']('\x20')});})[_0x0dfa('0x1d')](function(_0x57cf28){_0x48930b(_0xbf4253[_0x0dfa('0x10')](0x1f5,[_0x2d10ba[_0x0dfa('0x5a')],_0x57cf28[_0x0dfa('0x1c')][_0x0dfa('0x61')]()][_0x0dfa('0x14')]('\x20')));});}else{return _0x48930b(_0xbf4253[_0x0dfa('0x10')](0x1f5,_0x0dfa('0x69')));}});},'VoiceQueuesChannelRedirect':function(_0x5b013d){var _0x47221a=this;return new Promise(function(_0x2e32eb,_0x13f23d){if(ami[_0x0dfa('0xf')]()==![]){return _0x13f23d(_0x47221a[_0x0dfa('0x10')](0x1f4,[config[_0x0dfa('0x11')]['ip'],config[_0x0dfa('0x11')]['username'],'ami\x20disconnected'][_0x0dfa('0x14')]('\x20')));}var _0x47ef36=schema(properties[_0x0dfa('0x74')])[_0x0dfa('0x2')](_0x5b013d);if(_0x47ef36[_0x0dfa('0x53')]>0x0){return _0x13f23d(_0x47221a[_0x0dfa('0x10')](0x1f4,_[_0x0dfa('0x6a')](_0x47ef36,_0x0dfa('0x1c'))[_0x0dfa('0x14')](',\x20')));}var _0x5d757c=_['find'](_0x50b91e[_0x0dfa('0x71')],{'uniqueid':_0x5b013d[_0x0dfa('0x5a')]});if(_0x5d757c&&_0x5d757c[_0x0dfa('0x5b')]){return ami[_0x0dfa('0x1a')]({'action':_0x0dfa('0x75'),'channel':_0x5d757c[_0x0dfa('0x5b')],'exten':_0x5b013d[_0x0dfa('0x76')],'context':_0x5b013d[_0x0dfa('0x77')]||_0x5d757c[_0x0dfa('0x77')],'priority':0x1})['then'](function(_0x1b3e83){_0x2e32eb({'code':0xc8,'message':[_0x5b013d[_0x0dfa('0x5a')],_0x1b3e83[_0x0dfa('0x1c')][_0x0dfa('0x61')]()][_0x0dfa('0x14')]('\x20')});})[_0x0dfa('0x1d')](function(_0x3c8641){_0x13f23d(_0x47221a[_0x0dfa('0x10')](0x1f5,[_0x5b013d[_0x0dfa('0x5a')],_0x3c8641[_0x0dfa('0x1c')]['toLowerCase']()][_0x0dfa('0x14')]('\x20')));});}else{return _0x13f23d(_0x47221a[_0x0dfa('0x10')](0x1f5,_0x0dfa('0x69')));}});},'Agents':function(_0xd61f76){return new Promise(function(_0x1541b0,_0x55571d){var _0x4d917b=_[_0x0dfa('0x57')](_0x50b91e[_0x0dfa('0xc')]);_0x1541b0({'count':_0x4d917b['length'],'rows':_0x4d917b});});},'Telephones':function(_0x207a7e){return new Promise(function(_0x49c24e,_0x22b554){var _0x31ad4b=_[_0x0dfa('0x57')](_0x50b91e[_0x0dfa('0x78')]);_0x49c24e({'count':_0x31ad4b[_0x0dfa('0x53')],'rows':_0x31ad4b});});},'Trunks':function(_0x1dfe90){return new Promise(function(_0x25c249,_0x300cf3){var _0xe5c893=_[_0x0dfa('0x57')](_0x50b91e['trunks']);_0x25c249({'count':_0xe5c893[_0x0dfa('0x53')],'rows':_0xe5c893});});},'OutboundChannels':function(_0x5cbd8c){return new Promise(function(_0x4060df,_0x10d2bb){var _0x5ccf40=_[_0x0dfa('0x57')](_0x50b91e[_0x0dfa('0x79')]);_0x4060df({'count':_0x5ccf40[_0x0dfa('0x53')],'rows':_0x5ccf40});});},'Outbound':function(_0x215164){return new Promise(function(_0x595432,_0x220503){_0x595432(_0x50b91e['outbound']);});},'Campaigns':function(_0x3293af){return new Promise(function(_0x457a6e,_0x235d55){var _0x246ec7=_['values'](_0x50b91e[_0x0dfa('0x7a')]);_0x457a6e({'count':_0x246ec7[_0x0dfa('0x53')],'rows':_0x246ec7});});},'VoiceQueuesPreview':function(_0x2fabad){var _0x1940c3=this;return new Promise(function(_0x43ed92,_0x9a23ac){_0x2f60d7[_0x0dfa('0x7b')](_0x2fabad['id'])['then'](function(_0x1422e3){_0x43ed92({'code':0xc8,'message':_0x1422e3[_0x0dfa('0x1c')]});})[_0x0dfa('0x1d')](function(_0x149c42){_0x9a23ac(_0x1940c3[_0x0dfa('0x10')](0x1f4,_0x149c42[_0x0dfa('0x1c')]));});});},'EventManager':function(_0xa31f6d){var _0x24b545=this;return new Promise(function(_0x1aaec4,_0x2d10fe){if(!_0xa31f6d[_0x0dfa('0x7c')]){return _0x2d10fe(_0x24b545['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x0dfa('0x7d')](_0x0dfa('0x7e')+_0xa31f6d[_0x0dfa('0x7c')],_0xa31f6d[_0x0dfa('0x1c')]);_0x1aaec4({'code':0xc8,'message':_0xa31f6d});});},'FaxAccounts':function(_0xf1a314){return new Promise(function(_0x415311,_0x5962b0){var _0x106093=_[_0x0dfa('0x57')](_0x50b91e['faxAccounts']);_0x415311({'count':_0x106093[_0x0dfa('0x53')],'rows':_0x106093});});},'SendFax':function(_0x4ec4e6){var _0x5bd9ca=this;return new Promise(function(_0x2160d8,_0x4ea5f9){_0x2efe20[_0x0dfa('0x7f')](_0x4ec4e6)[_0x0dfa('0x1b')](function(_0x279182){_0x2160d8({'code':0xc8,'message':_0x279182[_0x0dfa('0x1c')]});})['catch'](function(_0x588d9a){_0x4ea5f9(_0x5bd9ca[_0x0dfa('0x10')](0x1f4,_0x588d9a[_0x0dfa('0x1c')]));});});},'CheckAfterSend':function(_0x31c7e8){var _0x1fed70=this;return new Promise(function(_0x17c14f,_0x371df9){_0x2efe20[_0x0dfa('0x80')](_0x31c7e8)[_0x0dfa('0x1b')](function(_0x5a8633){_0x17c14f({'code':0xc8,'message':_0x5a8633[_0x0dfa('0x1c')]});})[_0x0dfa('0x1d')](function(_0x383be1){_0x371df9(_0x1fed70['error'](0x1f4,_0x383be1[_0x0dfa('0x1c')]));});});}};var _0xbe1c53=jayson['server'](_0x29ca78)['http']();_0xbe1c53['on'](_0x0dfa('0x10'),function(_0x464bc1){return _0x417f7a(_0x464bc1);});_0xbe1c53['listen'](0x232a,_0x0dfa('0x81'),function(){console[_0x0dfa('0x82')](_0x0dfa('0x83'),0x232a);return _0x4830b6('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index a48d969..726f116 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 _0x70e0=['[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','union','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','data4','firstName','calleridname','','destcalleridname','Unknown','then','createContact'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x70e0,0x17b));var _0x070e=function(_0x5be2f3,_0x25b22d){_0x5be2f3=_0x5be2f3-0x0;var _0x31b0e5=_0x70e0[_0x5be2f3];return _0x31b0e5;};'use strict';var _=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var Redis=require(_0x070e('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x070e('0x3'))(_0x070e('0x4'));var cmContactRpc=require(_0x070e('0x5'));config[_0x070e('0x6')]=_['defaults'](config[_0x070e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x7'))(new Redis(config['redis']));function emit(_0x56e420,_0x5032e5,_0x35ab0c,_0x1e11f0,_0x604664){logger[_0x070e('0x8')](_0x070e('0x9'),_0x56e420,_0x5032e5['id'],_0x35ab0c,_0x1e11f0,JSON[_0x070e('0xa')](_0x604664));io['to'](_0x35ab0c)[_0x070e('0xb')](_0x1e11f0,_0x604664);}exports['exec']=function(_0x49b2fb,_0x50f4eb,_0x2e3e5e,_0x12bb37){var _0xb8d819,_0xa927a2;var _0xffcdd6={};var _0x25cfe1=Number(_0x2e3e5e[_0x070e('0xc')]);var _0x39d2b9=_0x2e3e5e[_0x070e('0xd')]?Boolean(Number(_0x2e3e5e[_0x070e('0xd')])):![];var _0x52da3b;var _0x5dca0f=![];if(!_[_0x070e('0xe')](_0x2e3e5e['data5'])){if(_0x2e3e5e['data5']=='1')_0x5dca0f=!![];}if(!_0x5dca0f){if(_0x12bb37['xmd-contactid']){_0xffcdd6['id']=_0x12bb37[_0x070e('0xf')];}}if(!_0xffcdd6['id']){_0xffcdd6[_0x070e('0x10')]=_0x25cfe1;_0x52da3b=_0x2e3e5e['data3']&&_0x2e3e5e['data3']!=='0'?_0x2e3e5e[_0x070e('0x11')][_0x070e('0x12')](','):[_0x070e('0x13')];_0xffcdd6[_0x070e('0x14')]=_['map'](_0x52da3b,function(_0x49861b){var _0x17e2e4={};_0x17e2e4[_0x49861b]=_0x12bb37[_0x070e('0x15')]?_0x12bb37[_0x070e('0x16')]:_0x12bb37[_0x070e('0x17')];return _0x17e2e4;});}var _0x364b3f=['id','firstName',_0x070e('0x18'),_0x070e('0x13'),_0x070e('0x19'),_0x070e('0x1a'),_0x070e('0x10'),'createdAt','scheduledAt','updatedAt'];var _0x9907cf=_[_0x070e('0x1b')](_0x364b3f,_0x52da3b);BPromise[_0x070e('0x1c')]()['then'](cmContactRpc[_0x070e('0x1d')]({'attributes':_0x9907cf,'where':_0xffcdd6}))['then'](function(_0xf8dd5d){_0xa927a2=_0xf8dd5d;if(!_[_0x070e('0x1e')](_0xa927a2)){if(_0xa927a2[_0x070e('0x1f')]===0x1){_0xb8d819=_0xa927a2[0x0];logger[_0x070e('0x8')](_0x070e('0x20'),_0x12bb37[_0x070e('0x21')],_0x50f4eb['id'],_0xb8d819['id']);}else{logger[_0x070e('0x8')](_0x070e('0x22'),_0x12bb37['uniqueid'],_0x50f4eb['id'],_[_0x070e('0x23')](_0xa927a2,'id')[_0x070e('0x24')](','));}return;}else{logger[_0x070e('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x12bb37[_0x070e('0x21')],_0x50f4eb['id']);var _0x5f3e9d={'ListId':_0x25cfe1};var _0x4a2dbd=_0x2e3e5e[_0x070e('0x25')]&&_0x2e3e5e[_0x070e('0x25')]!=='0'?_0x2e3e5e[_0x070e('0x25')]:_0x070e('0x13');if(_0x39d2b9){logger[_0x070e('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x12bb37[_0x070e('0x21')],_0x50f4eb['id']);_0x5f3e9d[_0x4a2dbd]=_[_0x070e('0xe')](_0x12bb37[_0x070e('0x15')])?_0x12bb37[_0x070e('0x17')]:_0x12bb37[_0x070e('0x16')];if(_[_0x070e('0xe')](_0x12bb37[_0x070e('0x15')])){_0x5f3e9d[_0x070e('0x26')]=_0x12bb37['calleridname']&&_0x12bb37[_0x070e('0x27')]!==_0x070e('0x28')?_0x12bb37[_0x070e('0x27')]:'Unknown';}else{_0x5f3e9d['firstName']=_0x12bb37[_0x070e('0x29')]&&_0x12bb37[_0x070e('0x29')]!==_0x070e('0x28')?_0x12bb37['destcalleridname']:_0x070e('0x2a');}return BPromise[_0x070e('0x1c')]()[_0x070e('0x2b')](cmContactRpc[_0x070e('0x2c')](_0x5f3e9d))['then'](function(_0x5bf522){_0xb8d819=_0x5bf522;_0xa927a2['push'](_0x5bf522);if(_0xb8d819){logger['info'](_0x070e('0x2d'),_0x12bb37['uniqueid'],_0x50f4eb['id'],_0xb8d819['id']);}return;});}else{logger[_0x070e('0x8')](_0x070e('0x2e'),_0x12bb37['uniqueid'],_0x50f4eb['id']);_0x5f3e9d[_0x4a2dbd]=_['isNil'](_0x12bb37[_0x070e('0x15')])?_0x12bb37[_0x070e('0x17')]:_0x12bb37['destcalleridnum'];if(_['isNil'](_0x12bb37[_0x070e('0x15')])){_0x5f3e9d[_0x070e('0x26')]=_0x12bb37[_0x070e('0x27')]&&_0x12bb37[_0x070e('0x27')]!==_0x070e('0x28')?_0x12bb37['calleridname']:'Unknown';}else{_0x5f3e9d[_0x070e('0x26')]=_0x12bb37[_0x070e('0x29')]&&_0x12bb37[_0x070e('0x29')]!==_0x070e('0x28')?_0x12bb37[_0x070e('0x29')]:'Unknown';}_0xb8d819=_0x5f3e9d;_0xa927a2[_0x070e('0x2f')](_0x5f3e9d);return;}}})[_0x070e('0x2b')](function(){if(_0x49b2fb){emit(_0x12bb37['uniqueid'],_0x50f4eb,util[_0x070e('0x30')](_0x070e('0x31'),_0x49b2fb['name']),util['format']('trigger:%s',_0x2e3e5e[_0x070e('0x32')][_0x070e('0x33')]()),{'evt':_[_0x070e('0x34')](_0x12bb37,{'autoCreate':_0x39d2b9}),'contact':_0xb8d819===undefined?{}:_0xb8d819,'contacts':_0xa927a2[_0x070e('0x1f')]===0x0?undefined:_0xa927a2});}});}; \ No newline at end of file +var _0x6f0d=['length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','info','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','resolve','then','isEmpty'];(function(_0x4d0882,_0x158e0b){var _0x45a2b8=function(_0x2d3b7d){while(--_0x2d3b7d){_0x4d0882['push'](_0x4d0882['shift']());}};_0x45a2b8(++_0x158e0b);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x351567,_0x108ff3){_0x351567=_0x351567-0x0;var _0xfa2eb2=_0x6f0d[_0x351567];return _0xfa2eb2;};'use strict';var _=require('lodash');var BPromise=require(_0xd6f0('0x0'));var Redis=require(_0xd6f0('0x1'));var util=require(_0xd6f0('0x2'));var config=require(_0xd6f0('0x3'));var logger=require('../../../../config/logger')(_0xd6f0('0x4'));var cmContactRpc=require(_0xd6f0('0x5'));config[_0xd6f0('0x6')]=_[_0xd6f0('0x7')](config[_0xd6f0('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd6f0('0x8'))(new Redis(config['redis']));function emit(_0xe21ac4,_0x1af29c,_0x8b89a9,_0x1a48a0,_0x4c4916){logger['info'](_0xd6f0('0x9'),_0xe21ac4,_0x1af29c['id'],_0x8b89a9,_0x1a48a0,JSON[_0xd6f0('0xa')](_0x4c4916));io['to'](_0x8b89a9)[_0xd6f0('0xb')](_0x1a48a0,_0x4c4916);}exports[_0xd6f0('0xc')]=function(_0x225dcf,_0x4db64a,_0x136eee,_0xee144c){var _0x329f69,_0x44bba6;var _0x4d10a1={};var _0x1ce8d5=Number(_0x136eee[_0xd6f0('0xd')]);var _0x306aad=_0x136eee[_0xd6f0('0xe')]?Boolean(Number(_0x136eee[_0xd6f0('0xe')])):![];var _0x409549;var _0x2bf5b8=![];if(!_[_0xd6f0('0xf')](_0x136eee[_0xd6f0('0x10')])){if(_0x136eee['data5']=='1')_0x2bf5b8=!![];}if(!_0x2bf5b8){if(_0xee144c[_0xd6f0('0x11')]){_0x4d10a1['id']=_0xee144c[_0xd6f0('0x11')];}}if(!_0x4d10a1['id']){_0x4d10a1['ListId']=_0x1ce8d5;_0x409549=_0x136eee[_0xd6f0('0x12')]&&_0x136eee['data3']!=='0'?_0x136eee[_0xd6f0('0x12')][_0xd6f0('0x13')](','):[_0xd6f0('0x14')];_0x4d10a1[_0xd6f0('0x15')]=_[_0xd6f0('0x16')](_0x409549,function(_0x61defb){var _0x25da0c={};_0x25da0c[_0x61defb]=_0xee144c[_0xd6f0('0x17')]?_0xee144c[_0xd6f0('0x18')]:_0xee144c[_0xd6f0('0x19')];return _0x25da0c;});}var _0x23ab6c=['id',_0xd6f0('0x1a'),_0xd6f0('0x1b'),_0xd6f0('0x14'),_0xd6f0('0x1c'),_0xd6f0('0x1d'),'ListId','createdAt',_0xd6f0('0x1e'),_0xd6f0('0x1f')];var _0x1158dc=_['union'](_0x23ab6c,_0x409549);BPromise[_0xd6f0('0x20')]()[_0xd6f0('0x21')](cmContactRpc['getContacts']({'attributes':_0x1158dc,'where':_0x4d10a1}))[_0xd6f0('0x21')](function(_0x515687){_0x44bba6=_0x515687;if(!_[_0xd6f0('0x22')](_0x44bba6)){if(_0x44bba6[_0xd6f0('0x23')]===0x1){_0x329f69=_0x44bba6[0x0];logger['info'](_0xd6f0('0x24'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_0x329f69['id']);}else{logger['info'](_0xd6f0('0x26'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_[_0xd6f0('0x16')](_0x44bba6,'id')['join'](','));}return;}else{logger[_0xd6f0('0x27')](_0xd6f0('0x28'),_0xee144c['uniqueid'],_0x4db64a['id']);var _0xcea0ae={'ListId':_0x1ce8d5};var _0x551be8=_0x136eee[_0xd6f0('0x29')]&&_0x136eee[_0xd6f0('0x29')]!=='0'?_0x136eee[_0xd6f0('0x29')]:_0xd6f0('0x14');if(_0x306aad){logger[_0xd6f0('0x27')](_0xd6f0('0x2a'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id']);_0xcea0ae[_0x551be8]=_[_0xd6f0('0xf')](_0xee144c['routeId'])?_0xee144c[_0xd6f0('0x19')]:_0xee144c[_0xd6f0('0x18')];if(_['isNil'](_0xee144c[_0xd6f0('0x17')])){_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2b')]&&_0xee144c[_0xd6f0('0x2b')]!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2b')]:_0xd6f0('0x2d');}else{_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2e')]&&_0xee144c[_0xd6f0('0x2e')]!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2e')]:_0xd6f0('0x2d');}return BPromise[_0xd6f0('0x20')]()[_0xd6f0('0x21')](cmContactRpc[_0xd6f0('0x2f')](_0xcea0ae))[_0xd6f0('0x21')](function(_0x376890){_0x329f69=_0x376890;_0x44bba6[_0xd6f0('0x30')](_0x376890);if(_0x329f69){logger[_0xd6f0('0x27')](_0xd6f0('0x31'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_0x329f69['id']);}return;});}else{logger['info'](_0xd6f0('0x32'),_0xee144c['uniqueid'],_0x4db64a['id']);_0xcea0ae[_0x551be8]=_['isNil'](_0xee144c[_0xd6f0('0x17')])?_0xee144c[_0xd6f0('0x19')]:_0xee144c[_0xd6f0('0x18')];if(_[_0xd6f0('0xf')](_0xee144c[_0xd6f0('0x17')])){_0xcea0ae['firstName']=_0xee144c[_0xd6f0('0x2b')]&&_0xee144c['calleridname']!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2b')]:_0xd6f0('0x2d');}else{_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2e')]&&_0xee144c['destcalleridname']!==''?_0xee144c[_0xd6f0('0x2e')]:_0xd6f0('0x2d');}_0x329f69=_0xcea0ae;_0x44bba6['push'](_0xcea0ae);return;}}})[_0xd6f0('0x21')](function(){if(_0x225dcf){emit(_0xee144c['uniqueid'],_0x4db64a,util[_0xd6f0('0x33')](_0xd6f0('0x34'),_0x225dcf[_0xd6f0('0x35')]),util[_0xd6f0('0x33')](_0xd6f0('0x36'),_0x136eee[_0xd6f0('0x37')][_0xd6f0('0x38')]()),{'evt':_['merge'](_0xee144c,{'autoCreate':_0x306aad}),'contact':_0x329f69===undefined?{}:_0x329f69,'contacts':_0x44bba6['length']===0x0?undefined:_0x44bba6});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 68b012d..6e82f8d 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 _0x0f4b=['custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','emit','info','clone','motionChannel','undefined','prototype','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','popup','data2','html','render','template\x20not\x20found','buildUri','data3','isNil','data4','location','uriLocation','data5','800','windowHeight','data6','600','winApplication','format','user:%s','interface','trigger:%s:%s','data1','jscripty','name','trigger:%s','exec','integration','queue','urlforward','script','query','search','channel','AllConditions','length','every','checkConditions','AnyConditions','some','account','chat','ChatWebsiteId','operator','AccountId','value','interaction','message','event','agent','membername','lastevent','routeId','exports','url','mustache','ioredis','./urlforward','./script','../../../config/environment','../../../config/logger','../ami','redis','defaults','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction'];(function(_0x62366c,_0xd0c813){var _0x5bea15=function(_0x2d5d98){while(--_0x2d5d98){_0x62366c['push'](_0x62366c['shift']());}};_0x5bea15(++_0xd0c813);}(_0x0f4b,0x1a9));var _0xb0f4=function(_0x5abad7,_0x512ec8){_0x5abad7=_0x5abad7-0x0;var _0x178035=_0x0f4b[_0x5abad7];return _0x178035;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0xb0f4('0x0'));var Mustache=require(_0xb0f4('0x1'));var Redis=require(_0xb0f4('0x2'));var urlforward=require(_0xb0f4('0x3'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0xb0f4('0x4'));var config=require(_0xb0f4('0x5'));var logger=require(_0xb0f4('0x6'))('trigger');var ami=require(_0xb0f4('0x7'));config[_0xb0f4('0x8')]=_[_0xb0f4('0x9')](config[_0xb0f4('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb0f4('0x8')]));var operators={'equals':function(_0x4486f6,_0x3fb564){return _0x4486f6==_0x3fb564;},'not_equals':function(_0x5da448,_0x54de2e){return _0x5da448!=_0x54de2e;}};var barAndWebActions=['popup',_0xb0f4('0x0'),_0xb0f4('0xa')];function Trigger(_0x54f19b){this[_0xb0f4('0xb')]=_0x54f19b[_0xb0f4('0xb')];this[_0xb0f4('0xc')]=_0x54f19b[_0xb0f4('0xc')];this[_0xb0f4('0xd')]=_0x54f19b['voiceQueues'];this[_0xb0f4('0xe')]=_0x54f19b[_0xb0f4('0xe')];this[_0xb0f4('0xf')]=_0x54f19b['voiceExtensions'];this[_0xb0f4('0x10')]=_0x54f19b[_0xb0f4('0x10')];this[_0xb0f4('0x11')]=_0x54f19b[_0xb0f4('0x11')];this[_0xb0f4('0x12')]=_0x54f19b[_0xb0f4('0x12')];this[_0xb0f4('0x13')]=_0x54f19b[_0xb0f4('0x13')];this[_0xb0f4('0x14')]=_0x54f19b['zohoAccounts'];this[_0xb0f4('0x15')]=_0x54f19b[_0xb0f4('0x15')];this[_0xb0f4('0x16')]=_0x54f19b['vtigerAccounts'];this['servicenowAccounts']=_0x54f19b['servicenowAccounts'];this[_0xb0f4('0x17')]=_0x54f19b[_0xb0f4('0x17')];this[_0xb0f4('0x18')]=_0x54f19b['freshsalesAccounts'];this['accounts']={'zendesk':this[_0xb0f4('0x10')],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xb0f4('0x14')],'desk':this[_0xb0f4('0x15')],'vtiger':this[_0xb0f4('0x16')],'dynamics365':this[_0xb0f4('0x17')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xb0f4('0x19')]};ami['on'](_0xb0f4('0x1a'),this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on']('custom:agentconnect',this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x1d'),this['syncCustomEvent'][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x1e'),this['syncCustomEvent'][_0xb0f4('0x1c')](this));ami['on']('custom:agentnosuchnumber',this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x1f'),this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x20'),this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x21'),this[_0xb0f4('0x1b')]['bind'](this));ami['on'](_0xb0f4('0x22'),this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x23'),this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on']('custom:queuecallerabandon',this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x24'),this['syncCustomEvent'][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x25'),this[_0xb0f4('0x26')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x27'),this[_0xb0f4('0x26')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x28'),this[_0xb0f4('0x26')]['bind'](this));ami['on'](_0xb0f4('0x29'),this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x2a'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb0f4('0x2b'),this[_0xb0f4('0x1b')]['bind'](this));ami['on'](_0xb0f4('0x2c'),this['syncCustomEvent'][_0xb0f4('0x1c')](this));ami['on'](_0xb0f4('0x2d'),this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));ami['on']('custom:acceptmessage',this[_0xb0f4('0x1b')]['bind'](this));ami['on'](_0xb0f4('0x2e'),this[_0xb0f4('0x1b')][_0xb0f4('0x1c')](this));}Trigger['prototype'][_0xb0f4('0x2f')]=function(_0x36d763,_0x117a9b,_0x4ad10f){logger[_0xb0f4('0x30')](_0x36d763,_0x117a9b,JSON['stringify'](_0x4ad10f));io['to'](_0x36d763)[_0xb0f4('0x2f')](_0x117a9b,_0x4ad10f);};Trigger['prototype']['syncCustomEvent']=function(_0xbafc8c){var _0x129e39=_[_0xb0f4('0x31')](_0xbafc8c);if(typeof _0x129e39[_0xb0f4('0x32')]===_0xb0f4('0x33')){_0x129e39[_0xb0f4('0x32')]='voice';}this['checkTriggers'](_0x129e39);};Trigger[_0xb0f4('0x34')][_0xb0f4('0x26')]=function(_0x4a6142){if(this[_0xb0f4('0xc')][_0x4a6142['interface']]){this[_0xb0f4('0x1b')](_0x4a6142);}};Trigger[_0xb0f4('0x34')][_0xb0f4('0x35')]=function(_0x536cf6){var _0x1e82c5;for(var _0x446f28 in this[_0xb0f4('0xb')]){if(this['triggers'][_0xb0f4('0x36')](_0x446f28)){if(this[_0xb0f4('0xb')][_0x446f28][_0xb0f4('0x37')]){_0x1e82c5=this[_0xb0f4('0x38')](this[_0xb0f4('0xb')][_0x446f28],_0x536cf6);if(_0x1e82c5){_[_0xb0f4('0x39')](_0x536cf6,_0x536cf6[_0xb0f4('0x3a')]);for(var _0x279bf5=0x0,_0x42db24,_0x345d27,_0x120076;_0x279bf50x0){_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 +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x4ae16d,_0xddf6c5){var _0x239970=function(_0x4c1ce8){while(--_0x4c1ce8){_0x4ae16d['push'](_0x4ae16d['shift']());}};_0x239970(++_0xddf6c5);}(_0x55ca,0x126));var _0xa55c=function(_0x871ef5,_0x58880b){_0x871ef5=_0x871ef5-0x0;var _0x1f62ea=_0x55ca[_0x871ef5];return _0x1f62ea;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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 0feded8..0afc972 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 _0xe41f=['Bearer\x20','4.0','value','validateEmail','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20Created!','forEach','includes','string','picklist','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','phonecalls','/contacts(','callDirection','queue','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','dynamics365','defaults','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid'];(function(_0x289fa8,_0x1fc3cc){var _0x1a5fbd=function(_0x25419a){while(--_0x25419a){_0x289fa8['push'](_0x289fa8['shift']());}};_0x1a5fbd(++_0x1fc3cc);}(_0xe41f,0xb7));var _0xfe41=function(_0x22721a,_0x5f6b8f){_0x22721a=_0x22721a-0x0;var _0x22dfe7=_0xe41f[_0x22721a];return _0x22dfe7;};'use strict';var _=require(_0xfe41('0x0'));var BPromise=require(_0xfe41('0x1'));var rp=require(_0xfe41('0x2'));var util=require(_0xfe41('0x3'));var intUtil=require(_0xfe41('0x4'));var md5=require(_0xfe41('0x5'));var Redis=require(_0xfe41('0x6'));var logger=require('../../../../config/logger')(_0xfe41('0x7'));var config=require('../../../../config/environment');config['redis']=_[_0xfe41('0x8')](config[_0xfe41('0x9')],{'host':_0xfe41('0xa'),'port':0x18eb});var io=require(_0xfe41('0xb'))(new Redis(config[_0xfe41('0x9')]));function getAuthToken(_0xf85265,_0x54e2a7,_0x503388){var _0x1cb5ab={'method':_0xfe41('0xc'),'uri':_0x54e2a7,'form':{'client_id':_0xf85265[_0xfe41('0xd')],'resource':_0xf85265[_0xfe41('0xe')],'username':_0xf85265[_0xfe41('0xf')],'password':_0xf85265[_0xfe41('0x10')],'grant_type':_0xfe41('0x10'),'client_secret':_0xf85265[_0xfe41('0x11')]},'json':!![]};return rp(_0x1cb5ab)[_0xfe41('0x12')](function(_0x491c22){return _0x491c22[_0xfe41('0x13')];})['catch'](function(_0x3ba0f2){logger[_0xfe41('0x14')]('['+[_0x503388[_0xfe41('0x15')]()]+_0xfe41('0x16'));return _0x3ba0f2[_0xfe41('0x17')];});}function getUser(_0xa76c11,_0x3266fa,_0x4739bc,_0x447437,_0x2337ba,_0x178653){return new BPromise(function(_0x1f9a8a,_0x1bb69a){return getAuthToken(_0x3266fa,_0x447437,_0x178653)[_0xfe41('0x12')](function(_0x208ea5){var _0x73b3e4={'method':'GET','uri':_0x2337ba+_0xfe41('0x18'),'headers':{'Authorization':_0xfe41('0x19')+_0x208ea5,'OData-Version':_0xfe41('0x1a')},'json':!![]};return rp(_0x73b3e4);})['then'](function(_0x17833d){var _0x3f2e53=_0x17833d[_0xfe41('0x1b')];var _0x2d2936=![];var _0x27367c=null;if(!_['isNil'](_0x4739bc)){if(intUtil[_0xfe41('0x1c')](_0x4739bc[_0xfe41('0x1d')])){_0xa76c11[_0xfe41('0x1e')]=_0x4739bc['email'];for(_0x27367c=0x0;_0x27367c<_0x3f2e53[_0xfe41('0x1f')];_0x27367c++){if(_0x3f2e53[_0x27367c]['internalemailaddress']===_0x4739bc[_0xfe41('0x1d')]&&!_0x3f2e53[_0x27367c]['isdisabled']){_0x2d2936=!![];logger[_0xfe41('0x20')]('['+[_0x178653[_0xfe41('0x15')]()]+_0xfe41('0x21')+_0x3f2e53[_0x27367c][_0xfe41('0x22')]+'!');_0xa76c11[_0xfe41('0x23')]=_0x3f2e53[_0x27367c]['systemuserid'];}}}}if(!_0x2d2936){logger[_0xfe41('0x20')]('['+[_0x178653[_0xfe41('0x15')]()]+_0xfe41('0x24'));_0xa76c11['userEmail']=_0x3266fa[_0xfe41('0xf')];for(_0x27367c=0x0;_0x27367c<_0x3f2e53['length'];_0x27367c++){if(_0x3f2e53[_0x27367c][_0xfe41('0x25')]===_0x3266fa[_0xfe41('0xf')]){_0xa76c11[_0xfe41('0x23')]=_0x3f2e53[_0x27367c][_0xfe41('0x22')];}}}_0x1f9a8a(_0xa76c11);})[_0xfe41('0x26')](function(_0x3a8fd5){_0x1bb69a(_0x3a8fd5[_0xfe41('0x17')]);});});}function createEndUser(_0x587f4c,_0x37cb5a,_0x3f14e2,_0x3ebd1e,_0x36ff72,_0x2842f5){return new BPromise(function(_0x5925ca,_0x323b4e){return getAuthToken(_0x37cb5a,_0x3f14e2,_0x2842f5)[_0xfe41('0x12')](function(_0x508aa1){var _0x127250=_0x2842f5[_0xfe41('0x27')]()===_0xfe41('0x28')?_0x36ff72[_0xfe41('0x29')]:_0x36ff72[_0xfe41('0x2a')];var _0x2995e2={'method':'POST','uri':_0x3ebd1e+_0xfe41('0x2b'),'body':{'telephone1':_0x127250,'fullname':_0x127250,'firstname':_0x127250,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfe41('0x2c')+_0x587f4c[_0xfe41('0x23')]+')'},'headers':{'Authorization':_0xfe41('0x19')+_0x508aa1,'OData-Version':_0xfe41('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2995e2);})[_0xfe41('0x12')](function(_0x23c5a9){var _0x18a1f3=_0x23c5a9[_0xfe41('0x2d')]['odata-entityid'];var _0x31a5a5=_0x18a1f3[_0xfe41('0x2e')](_0x18a1f3[_0xfe41('0x2f')]('(')+0x1,_0x18a1f3[_0xfe41('0x2f')](')'));_0x587f4c[_0xfe41('0x30')]=_0x31a5a5;_0x5925ca(_0x587f4c);})['catch'](function(_0x3b94b9){_0x323b4e(_0x3b94b9[_0xfe41('0x17')]);});});}function getEndUser(_0x3a77a6,_0x3eb1e2,_0x45863c,_0x4db8dd,_0x41bbd1,_0x23e69e){return new BPromise(function(_0x480ac5,_0x5a3511){var _0x46bde9=_0x23e69e[_0xfe41('0x27')]()===_0xfe41('0x28')?_0x41bbd1[_0xfe41('0x29')]:_0x41bbd1['calleridnum'];return getAuthToken(_0x3eb1e2,_0x45863c,_0x23e69e)[_0xfe41('0x12')](function(_0x84a77e){var _0x3a2869={'method':'GET','uri':_0x4db8dd+_0xfe41('0x31')+_0x46bde9[_0xfe41('0x32')]('+',_0xfe41('0x33'))+'\x27','headers':{'Authorization':_0xfe41('0x19')+_0x84a77e,'If-None-Match':null,'OData-Version':_0xfe41('0x1a')},'json':!![]};return rp(_0x3a2869);})[_0xfe41('0x12')](function(_0x413257){var _0x44ca08=null;if(_0x413257){var _0x4d7d36=_0x413257['value'];var _0x4caaa4=![];for(_0x44ca08=0x0;_0x44ca08<_0x4d7d36[_0xfe41('0x1f')];_0x44ca08++){if(_0x4d7d36[_0x44ca08][_0xfe41('0x34')]===_0x46bde9){_0x4caaa4=!![];_0x3a77a6[_0xfe41('0x30')]=_0x4d7d36[_0x44ca08][_0xfe41('0x35')];}}if(_0x4caaa4){_0x480ac5(_0x3a77a6);}else{return createEndUser(_0x3a77a6,_0x3eb1e2,_0x45863c,_0x4db8dd,_0x41bbd1,_0x23e69e)[_0xfe41('0x12')](function(_0x145de6){logger[_0xfe41('0x20')]('['+[_0x23e69e[_0xfe41('0x15')]()]+']\x20Enduser\x20created!',_0x145de6[_0xfe41('0x30')]);_0x480ac5(_0x145de6);});}}else{return createEndUser(_0x3a77a6,_0x3eb1e2,_0x45863c,_0x4db8dd,_0x41bbd1,_0x23e69e)[_0xfe41('0x12')](function(_0x456a77){logger[_0xfe41('0x20')]('['+[_0x23e69e[_0xfe41('0x15')]()]+_0xfe41('0x36'),_0x456a77['enduserId']);_0x480ac5(_0x456a77);});}});});}function getCustomFields(_0x342df2,_0x4e076d,_0x33f913){var _0x536cf6={};if(_0x342df2['length']>0x0){_[_0xfe41('0x37')](_0x342df2,function(_0x4bde6e){if(_[_0xfe41('0x38')]([_0xfe41('0x39'),_0xfe41('0x3a')],_0x4bde6e['type'])&&_0x4bde6e[_0xfe41('0x3b')]&&!_0x4bde6e[_0xfe41('0x3c')]){var _0x114486=_0x4bde6e[_0xfe41('0x3d')][_0xfe41('0x27')]();var _0x11a8a7=_0x114486[_0xfe41('0x2e')](0x0,_0x114486['indexOf']('_'));var _0x37e7b1=_0x114486[_0xfe41('0x2e')](_0x114486[_0xfe41('0x3e')]('_')+0x1);if(_0x11a8a7===_0x33f913){_0x536cf6[_0x37e7b1]=_0x4bde6e[_0xfe41('0x3f')];}}});}return _0x536cf6;}function getTicket(_0x427625,_0xcf1028,_0x59144b,_0x4b2ad6,_0x227761,_0x163783,_0x10f1f3){return new BPromise(function(_0x2e0a69,_0x1bb7b7){var _0x3b4f3a;return getAuthToken(_0xcf1028,_0x59144b,_0x10f1f3)['then'](function(_0x247f84){if(_0x163783[_0xfe41('0x40')]===_0xfe41('0x41')){_0x3b4f3a={'method':'POST','uri':_0x4b2ad6+_0xfe41('0x42'),'body':Object[_0xfe41('0x43')]({},{'title':intUtil[_0xfe41('0x44')](_0x163783[_0xfe41('0x45')],_0x227761,'\x20'),'description':intUtil['getString'](_0x163783[_0xfe41('0x46')],_0x227761,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x427625[_0xfe41('0x30')]+')','ownerid@odata.bind':'/systemusers('+_0x427625[_0xfe41('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x163783[_0xfe41('0x47')],_0x227761,_0x163783[_0xfe41('0x40')])),'headers':{'Authorization':_0xfe41('0x19')+_0x247f84,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x163783['ticketType']===_0xfe41('0x48')){_0x3b4f3a={'method':_0xfe41('0xc'),'uri':_0x4b2ad6+_0xfe41('0x49'),'body':Object[_0xfe41('0x43')]({},{'subject':intUtil[_0xfe41('0x44')](_0x163783[_0xfe41('0x45')],_0x227761,'\x20'),'phonenumber':String(_0x227761[_0xfe41('0x2a')]),'description':intUtil[_0xfe41('0x44')](_0x163783['Descriptions'],_0x227761,'\x0a'),'regardingobjectid_contact@odata.bind':_0xfe41('0x4a')+_0x427625[_0xfe41('0x30')]+')','ownerid@odata.bind':'/systemusers('+_0x427625[_0xfe41('0x23')]+')','directioncode':_0x427625[_0xfe41('0x4b')]===_0xfe41('0x4c')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xfe41('0x2c')+_0x427625[_0xfe41('0x23')]+')','participationtypemask':_0x427625[_0xfe41('0x4b')]===_0xfe41('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0xfe41('0x4a')+_0x427625['enduserId']+')','participationtypemask':_0x427625[_0xfe41('0x4b')]===_0xfe41('0x4c')?0x1:0x2}]},getCustomFields(_0x163783[_0xfe41('0x47')],_0x227761,_0x163783[_0xfe41('0x40')])),'headers':{'Authorization':_0xfe41('0x19')+_0x247f84,'OData-Version':_0xfe41('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3b4f3a);})[_0xfe41('0x12')](function(_0x493684){var _0x3ff437=_0x493684[_0xfe41('0x2d')][_0xfe41('0x4d')];var _0x10c4ba=_0x3ff437['substring'](_0x3ff437[_0xfe41('0x2f')]('(')+0x1,_0x3ff437['lastIndexOf'](')'));_0x427625[_0xfe41('0x4e')]=_0x10c4ba;_0x2e0a69(_0x427625);})[_0xfe41('0x26')](function(_0x193fe3){_0x1bb7b7(_0x193fe3['message']);});});}function emit(_0x82ccf1,_0x390f4f,_0x41c775,_0xfea394){var _0x52445f={'uri':util[_0xfe41('0x4f')](_0xfe41('0x50'),_0x82ccf1,_0x41c775,_0xfea394)};io['to'](util[_0xfe41('0x4f')]('user:%s',_0x390f4f))[_0xfe41('0x51')](_0xfe41('0x52'),_0x52445f);}exports['cs']=function(_0x1648ce,_0x249cf5,_0x2a787d,_0x170771,_0x5ceb5a,_0x314ac6,_0xf199bf,_0x44e2ba){var _0x1772b6={};_0x314ac6[_0xfe41('0xe')]=intUtil['stripTrailingSlash'](_0x314ac6['remoteUri']);_0x314ac6[_0xfe41('0x53')]=intUtil['stripTrailingSlash'](_0x314ac6['serverUrl']);_0x1772b6[_0xfe41('0x4b')]=_0x44e2ba==='queue'||_0x44e2ba===_0xfe41('0x54')?_0xfe41('0x4c'):_0xfe41('0x28');var _0x4d9077=util['format'](_0xfe41('0x55'),_0x314ac6[_0xfe41('0xe')]);var _0x49ed4c=util[_0xfe41('0x4f')](_0xfe41('0x56'),_0x314ac6[_0xfe41('0x57')]);var _0x54f601=util[_0xfe41('0x4f')](_0xfe41('0x58'),_0x314ac6[_0xfe41('0x53')],_0x249cf5[_0xfe41('0x59')],md5(_0x249cf5[_0xfe41('0x59')]));if(_0x5ceb5a&&_0x5ceb5a['monitor_format']){logger[_0xfe41('0x20')](_0xfe41('0x5a'),_0xfe41('0x5b'));_0x249cf5[_0xfe41('0x5c')]=_0x54f601;}else if(_0xf199bf&&_0xf199bf['recordingFormat']&&_0xf199bf['recordingFormat']!==_0xfe41('0x5d')){logger['info']('[OUTBOUND]',_0xfe41('0x5b'));_0x249cf5[_0xfe41('0x5c')]=_0x54f601;}else{_0x249cf5[_0xfe41('0x5c')]='';}return getUser(_0x1772b6,_0x314ac6,_0x170771,_0x49ed4c,_0x4d9077,_0x44e2ba)[_0xfe41('0x12')](function(_0xb9e9ec){logger[_0xfe41('0x20')]('['+_0x44e2ba[_0xfe41('0x15')]()+_0xfe41('0x5e'),_0xb9e9ec['userId']);logger[_0xfe41('0x20')]('['+_0x44e2ba[_0xfe41('0x15')]()+_0xfe41('0x5f'),_0xb9e9ec['userEmail']);return getEndUser(_0xb9e9ec,_0x314ac6,_0x49ed4c,_0x4d9077,_0x249cf5,_0x44e2ba);})['then'](function(_0x42d746){logger[_0xfe41('0x20')]('['+_0x44e2ba[_0xfe41('0x15')]()+_0xfe41('0x60'),_0x42d746[_0xfe41('0x30')]);logger[_0xfe41('0x20')]('['+_0x44e2ba[_0xfe41('0x15')]()+_0xfe41('0x61'),_0x249cf5['calleridnum']);return getTicket(_0x42d746,_0x314ac6,_0x49ed4c,_0x4d9077,_0x249cf5,_0x2a787d,_0x44e2ba);})['then'](function(_0x4926e7){logger[_0xfe41('0x20')](util['format']('['+_0x44e2ba['toUpperCase']()+_0xfe41('0x62'),_0x2a787d[_0xfe41('0x40')],_0x4926e7[_0xfe41('0x4e')]));logger[_0xfe41('0x20')](util[_0xfe41('0x4f')]('['+_0x44e2ba[_0xfe41('0x15')]()+_0xfe41('0x63'),_0x44e2ba));if(_0x44e2ba!==_0xfe41('0x54')){logger[_0xfe41('0x20')]('['+_0x44e2ba[_0xfe41('0x15')]()+']',_0xfe41('0x64'));emit(_0x314ac6[_0xfe41('0xe')],_0x170771[_0xfe41('0x65')],_0x2a787d['ticketType'],_0x4926e7[_0xfe41('0x4e')]);}})[_0xfe41('0x26')](function(_0x381bb8){logger[_0xfe41('0x14')]('['+_0x44e2ba['toUpperCase']()+_0xfe41('0x66'),util[_0xfe41('0x67')](_0x381bb8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb681=[']\x20Enduser\x20Created!','forEach','includes','picklist','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','callDirection','queue','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','stripTrailingSlash','unmanaged','format','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','clientId','remoteUri','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','length','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','replace','%2b','telephone1'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xb681,0x153));var _0x1b68=function(_0x33ebc6,_0x563937){_0x33ebc6=_0x33ebc6-0x0;var _0x3c4def=_0xb681[_0x33ebc6];return _0x3c4def;};'use strict';var _=require(_0x1b68('0x0'));var BPromise=require(_0x1b68('0x1'));var rp=require(_0x1b68('0x2'));var util=require(_0x1b68('0x3'));var intUtil=require(_0x1b68('0x4'));var md5=require(_0x1b68('0x5'));var Redis=require(_0x1b68('0x6'));var logger=require(_0x1b68('0x7'))(_0x1b68('0x8'));var config=require(_0x1b68('0x9'));config['redis']=_[_0x1b68('0xa')](config['redis'],{'host':_0x1b68('0xb'),'port':0x18eb});var io=require(_0x1b68('0xc'))(new Redis(config[_0x1b68('0xd')]));function getAuthToken(_0x536e88,_0x5b3ebb,_0x54c76f){var _0x5eb0b9={'method':'POST','uri':_0x5b3ebb,'form':{'client_id':_0x536e88[_0x1b68('0xe')],'resource':_0x536e88[_0x1b68('0xf')],'username':_0x536e88[_0x1b68('0x10')],'password':_0x536e88[_0x1b68('0x11')],'grant_type':_0x1b68('0x11'),'client_secret':_0x536e88['clientSecret']},'json':!![]};return rp(_0x5eb0b9)[_0x1b68('0x12')](function(_0x55389e){return _0x55389e[_0x1b68('0x13')];})[_0x1b68('0x14')](function(_0x381033){logger[_0x1b68('0x15')]('['+[_0x54c76f[_0x1b68('0x16')]()]+_0x1b68('0x17'));return _0x381033[_0x1b68('0x18')];});}function getUser(_0x350824,_0x101fd9,_0xf772c0,_0x29ba43,_0x720e3,_0x34c33c){return new BPromise(function(_0x3f44ce,_0xf18406){return getAuthToken(_0x101fd9,_0x29ba43,_0x34c33c)['then'](function(_0x469312){var _0x2b9f85={'method':_0x1b68('0x19'),'uri':_0x720e3+_0x1b68('0x1a'),'headers':{'Authorization':_0x1b68('0x1b')+_0x469312,'OData-Version':_0x1b68('0x1c')},'json':!![]};return rp(_0x2b9f85);})[_0x1b68('0x12')](function(_0x138fe8){var _0x282cf3=_0x138fe8[_0x1b68('0x1d')];var _0x8d4ea8=![];var _0x448841=null;if(!_[_0x1b68('0x1e')](_0xf772c0)){if(intUtil[_0x1b68('0x1f')](_0xf772c0[_0x1b68('0x20')])){_0x350824['userEmail']=_0xf772c0['email'];for(_0x448841=0x0;_0x448841<_0x282cf3['length'];_0x448841++){if(_0x282cf3[_0x448841][_0x1b68('0x21')]===_0xf772c0[_0x1b68('0x20')]&&!_0x282cf3[_0x448841]['isdisabled']){_0x8d4ea8=!![];logger[_0x1b68('0x22')]('['+[_0x34c33c[_0x1b68('0x16')]()]+_0x1b68('0x23')+_0x282cf3[_0x448841][_0x1b68('0x24')]+'!');_0x350824[_0x1b68('0x25')]=_0x282cf3[_0x448841][_0x1b68('0x24')];}}}}if(!_0x8d4ea8){logger['info']('['+[_0x34c33c[_0x1b68('0x16')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x350824['userEmail']=_0x101fd9['username'];for(_0x448841=0x0;_0x448841<_0x282cf3[_0x1b68('0x26')];_0x448841++){if(_0x282cf3[_0x448841][_0x1b68('0x21')]===_0x101fd9[_0x1b68('0x10')]){_0x350824[_0x1b68('0x25')]=_0x282cf3[_0x448841][_0x1b68('0x24')];}}}_0x3f44ce(_0x350824);})[_0x1b68('0x14')](function(_0x3fea17){_0xf18406(_0x3fea17['message']);});});}function createEndUser(_0x26ba50,_0x181018,_0x506e4c,_0xc946aa,_0x3b1d72,_0xe2f765){return new BPromise(function(_0x4d8df9,_0x4f82c1){return getAuthToken(_0x181018,_0x506e4c,_0xe2f765)[_0x1b68('0x12')](function(_0x191cc7){var _0x3eb5e5=_0xe2f765[_0x1b68('0x27')]()===_0x1b68('0x28')?_0x3b1d72[_0x1b68('0x29')]:_0x3b1d72[_0x1b68('0x2a')];var _0x26cdba={'method':_0x1b68('0x2b'),'uri':_0xc946aa+_0x1b68('0x2c'),'body':{'telephone1':_0x3eb5e5,'fullname':_0x3eb5e5,'firstname':_0x3eb5e5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1b68('0x2d')+_0x26ba50[_0x1b68('0x25')]+')'},'headers':{'Authorization':_0x1b68('0x1b')+_0x191cc7,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x26cdba);})[_0x1b68('0x12')](function(_0x39deb5){var _0x341cb3=_0x39deb5['headers'][_0x1b68('0x2e')];var _0x1fccd6=_0x341cb3[_0x1b68('0x2f')](_0x341cb3[_0x1b68('0x30')]('(')+0x1,_0x341cb3[_0x1b68('0x30')](')'));_0x26ba50[_0x1b68('0x31')]=_0x1fccd6;_0x4d8df9(_0x26ba50);})[_0x1b68('0x14')](function(_0x12f43e){_0x4f82c1(_0x12f43e[_0x1b68('0x18')]);});});}function getEndUser(_0x303e87,_0x48afd8,_0x37968e,_0x784a28,_0x32d97b,_0x57d166){return new BPromise(function(_0x20aae9,_0x42bce3){var _0xb94b11=_0x57d166[_0x1b68('0x27')]()===_0x1b68('0x28')?_0x32d97b[_0x1b68('0x29')]:_0x32d97b[_0x1b68('0x2a')];return getAuthToken(_0x48afd8,_0x37968e,_0x57d166)[_0x1b68('0x12')](function(_0x16a82f){var _0x55022d={'method':_0x1b68('0x19'),'uri':_0x784a28+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0xb94b11[_0x1b68('0x32')]('+',_0x1b68('0x33'))+'\x27','headers':{'Authorization':_0x1b68('0x1b')+_0x16a82f,'If-None-Match':null,'OData-Version':_0x1b68('0x1c')},'json':!![]};return rp(_0x55022d);})[_0x1b68('0x12')](function(_0x20b6ab){var _0x37f89b=null;if(_0x20b6ab){var _0x13e31a=_0x20b6ab[_0x1b68('0x1d')];var _0x52ce81=![];for(_0x37f89b=0x0;_0x37f89b<_0x13e31a[_0x1b68('0x26')];_0x37f89b++){if(_0x13e31a[_0x37f89b][_0x1b68('0x34')]===_0xb94b11){_0x52ce81=!![];_0x303e87[_0x1b68('0x31')]=_0x13e31a[_0x37f89b]['contactid'];}}if(_0x52ce81){_0x20aae9(_0x303e87);}else{return createEndUser(_0x303e87,_0x48afd8,_0x37968e,_0x784a28,_0x32d97b,_0x57d166)[_0x1b68('0x12')](function(_0x16aa06){logger[_0x1b68('0x22')]('['+[_0x57d166['toUpperCase']()]+']\x20Enduser\x20created!',_0x16aa06['enduserId']);_0x20aae9(_0x16aa06);});}}else{return createEndUser(_0x303e87,_0x48afd8,_0x37968e,_0x784a28,_0x32d97b,_0x57d166)[_0x1b68('0x12')](function(_0x412b9b){logger[_0x1b68('0x22')]('['+[_0x57d166[_0x1b68('0x16')]()]+_0x1b68('0x35'),_0x412b9b[_0x1b68('0x31')]);_0x20aae9(_0x412b9b);});}});});}function getCustomFields(_0x19bb26,_0x1ff6fa,_0x2936d6){var _0x56ba8b={};if(_0x19bb26[_0x1b68('0x26')]>0x0){_[_0x1b68('0x36')](_0x19bb26,function(_0x29889d){if(_[_0x1b68('0x37')](['string',_0x1b68('0x38')],_0x29889d['type'])&&_0x29889d['nameField']&&!_0x29889d['customField']){var _0x33dc43=_0x29889d['idField'][_0x1b68('0x27')]();var _0x13545c=_0x33dc43['substring'](0x0,_0x33dc43[_0x1b68('0x39')]('_'));var _0x2b0075=_0x33dc43[_0x1b68('0x2f')](_0x33dc43['indexOf']('_')+0x1);if(_0x13545c===_0x2936d6){_0x56ba8b[_0x2b0075]=_0x29889d[_0x1b68('0x3a')];}}});}return _0x56ba8b;}function getTicket(_0x33881a,_0x38797d,_0x22d7e4,_0xd873b3,_0x12a57a,_0x55b883,_0x34c509){return new BPromise(function(_0x168620,_0x5a6319){var _0x38281c;return getAuthToken(_0x38797d,_0x22d7e4,_0x34c509)[_0x1b68('0x12')](function(_0x561301){if(_0x55b883['ticketType']===_0x1b68('0x3b')){_0x38281c={'method':_0x1b68('0x2b'),'uri':_0xd873b3+_0x1b68('0x3c'),'body':Object[_0x1b68('0x3d')]({},{'title':intUtil[_0x1b68('0x3e')](_0x55b883[_0x1b68('0x3f')],_0x12a57a,'\x20'),'description':intUtil[_0x1b68('0x3e')](_0x55b883[_0x1b68('0x40')],_0x12a57a,'\x0a'),'customerid_contact@odata.bind':_0x1b68('0x41')+_0x33881a[_0x1b68('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x33881a[_0x1b68('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x55b883[_0x1b68('0x42')],_0x12a57a,_0x55b883[_0x1b68('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x561301,'OData-Version':_0x1b68('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x55b883['ticketType']===_0x1b68('0x44')){_0x38281c={'method':_0x1b68('0x2b'),'uri':_0xd873b3+_0x1b68('0x45'),'body':Object['assign']({},{'subject':intUtil[_0x1b68('0x3e')](_0x55b883[_0x1b68('0x3f')],_0x12a57a,'\x20'),'phonenumber':String(_0x12a57a['calleridnum']),'description':intUtil[_0x1b68('0x3e')](_0x55b883[_0x1b68('0x40')],_0x12a57a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1b68('0x41')+_0x33881a['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x33881a[_0x1b68('0x25')]+')','directioncode':_0x33881a[_0x1b68('0x46')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x33881a['userId']+')','participationtypemask':_0x33881a[_0x1b68('0x46')]===_0x1b68('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x1b68('0x41')+_0x33881a['enduserId']+')','participationtypemask':_0x33881a[_0x1b68('0x46')]===_0x1b68('0x47')?0x1:0x2}]},getCustomFields(_0x55b883[_0x1b68('0x42')],_0x12a57a,_0x55b883[_0x1b68('0x43')])),'headers':{'Authorization':_0x1b68('0x1b')+_0x561301,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x38281c);})[_0x1b68('0x12')](function(_0x2c1995){var _0x17adc4=_0x2c1995[_0x1b68('0x48')][_0x1b68('0x2e')];var _0x37d16b=_0x17adc4[_0x1b68('0x2f')](_0x17adc4[_0x1b68('0x30')]('(')+0x1,_0x17adc4[_0x1b68('0x30')](')'));_0x33881a[_0x1b68('0x49')]=_0x37d16b;_0x168620(_0x33881a);})[_0x1b68('0x14')](function(_0x544f03){_0x5a6319(_0x544f03['message']);});});}function emit(_0xf18fa9,_0x365221,_0x5d7cb5,_0x3c18ad){var _0x359e7c={'uri':util['format'](_0x1b68('0x4a'),_0xf18fa9,_0x5d7cb5,_0x3c18ad)};io['to'](util['format'](_0x1b68('0x4b'),_0x365221))['emit']('trigger:browser:url',_0x359e7c);}exports['cs']=function(_0x39c1f0,_0x2c9461,_0x4e4079,_0x593fd4,_0x2b9570,_0x5e47be,_0x33ca17,_0x2bcf4d){var _0x4deec9={};_0x5e47be['remoteUri']=intUtil[_0x1b68('0x4c')](_0x5e47be[_0x1b68('0xf')]);_0x5e47be['serverUrl']=intUtil[_0x1b68('0x4c')](_0x5e47be['serverUrl']);_0x4deec9[_0x1b68('0x46')]=_0x2bcf4d==='queue'||_0x2bcf4d===_0x1b68('0x4d')?_0x1b68('0x47'):'outbound';var _0x1e0bda=util[_0x1b68('0x4e')]('%s/api/data/v9.0/',_0x5e47be['remoteUri']);var _0x2df479=util['format'](_0x1b68('0x4f'),_0x5e47be[_0x1b68('0x50')]);var _0x4d7b03=util[_0x1b68('0x4e')](_0x1b68('0x51'),_0x5e47be[_0x1b68('0x52')],_0x2c9461['uniqueid'],md5(_0x2c9461[_0x1b68('0x53')]));if(_0x2b9570&&_0x2b9570[_0x1b68('0x54')]){logger[_0x1b68('0x22')]('[QUEUE]',_0x1b68('0x55'));_0x2c9461[_0x1b68('0x56')]=_0x4d7b03;}else if(_0x33ca17&&_0x33ca17[_0x1b68('0x57')]&&_0x33ca17[_0x1b68('0x57')]!==_0x1b68('0x58')){logger[_0x1b68('0x22')](_0x1b68('0x59'),_0x1b68('0x55'));_0x2c9461['recordingURL']=_0x4d7b03;}else{_0x2c9461[_0x1b68('0x56')]='';}return getUser(_0x4deec9,_0x5e47be,_0x593fd4,_0x2df479,_0x1e0bda,_0x2bcf4d)[_0x1b68('0x12')](function(_0x55c106){logger[_0x1b68('0x22')]('['+_0x2bcf4d[_0x1b68('0x16')]()+']\x20The\x20User\x20ID\x20is:',_0x55c106[_0x1b68('0x25')]);logger[_0x1b68('0x22')]('['+_0x2bcf4d[_0x1b68('0x16')]()+_0x1b68('0x5a'),_0x55c106[_0x1b68('0x5b')]);return getEndUser(_0x55c106,_0x5e47be,_0x2df479,_0x1e0bda,_0x2c9461,_0x2bcf4d);})[_0x1b68('0x12')](function(_0x246a72){logger['info']('['+_0x2bcf4d[_0x1b68('0x16')]()+_0x1b68('0x5c'),_0x246a72['enduserId']);logger[_0x1b68('0x22')]('['+_0x2bcf4d[_0x1b68('0x16')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x2c9461[_0x1b68('0x2a')]);return getTicket(_0x246a72,_0x5e47be,_0x2df479,_0x1e0bda,_0x2c9461,_0x4e4079,_0x2bcf4d);})[_0x1b68('0x12')](function(_0x575cc1){logger[_0x1b68('0x22')](util[_0x1b68('0x4e')]('['+_0x2bcf4d[_0x1b68('0x16')]()+_0x1b68('0x5d'),_0x4e4079[_0x1b68('0x43')],_0x575cc1[_0x1b68('0x49')]));logger[_0x1b68('0x22')](util[_0x1b68('0x4e')]('['+_0x2bcf4d['toUpperCase']()+_0x1b68('0x5e'),_0x2bcf4d));if(_0x2bcf4d!==_0x1b68('0x4d')){logger['info']('['+_0x2bcf4d[_0x1b68('0x16')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5e47be[_0x1b68('0xf')],_0x593fd4[_0x1b68('0x5f')],_0x4e4079[_0x1b68('0x43')],_0x575cc1[_0x1b68('0x49')]);}})[_0x1b68('0x14')](function(_0x114f4d){logger['error']('['+_0x2bcf4d['toUpperCase']()+_0x1b68('0x60'),util[_0x1b68('0x61')](_0x114f4d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index f8c8258..ee9791a 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 _0x5e83=['serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','[OUTBOUND]','destcalleridname','stringify','unmanaged','lastevent','toUpperCase','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','find','email','%s/api/v2/agents/me','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','base64','debug','[HTTP]','GET','length','map','forEach','includes','string','picklist','type','customField','nameField','toString','push','content','variable','variableName','idField','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash'];(function(_0x8094b6,_0x1e80ee){var _0x1a42fc=function(_0x869ff4){while(--_0x869ff4){_0x8094b6['push'](_0x8094b6['shift']());}};_0x1a42fc(++_0x1e80ee);}(_0x5e83,0x76));var _0x35e8=function(_0x463e24,_0x4029b7){_0x463e24=_0x463e24-0x0;var _0x1d3304=_0x5e83[_0x463e24];return _0x1d3304;};'use strict';var _=require('lodash');var rp=require(_0x35e8('0x0'));var md5=require(_0x35e8('0x1'));var util=require(_0x35e8('0x2'));var Redis=require('ioredis');var intUtil=require(_0x35e8('0x3'));var config=require(_0x35e8('0x4'));var logger=require(_0x35e8('0x5'))(_0x35e8('0x6'));config[_0x35e8('0x7')]=_[_0x35e8('0x8')](config['redis'],{'host':_0x35e8('0x9'),'port':0x18eb});var io=require(_0x35e8('0xa'))(new Redis(config[_0x35e8('0x7')]));var headers={'Content-Type':_0x35e8('0xb'),'Accept':_0x35e8('0xb')};function emit(_0xeaf53a,_0x219c27,_0x207bdf){io['to'](_0xeaf53a)['emit'](_0x219c27,_0x207bdf);}function getTicket(_0x2ad664,_0x3e4c5c,_0x409003,_0x23417d,_0x4f2eff){logger[_0x35e8('0xc')]('Creating\x20new\x20ticket...');var _0x3c3872=_[_0x35e8('0xd')]({'responder_id':_0x3e4c5c['id'],'requester_id':_0x409003['id'],'name':util[_0x35e8('0xe')](_0x35e8('0xf'),_0x4f2eff[_0x35e8('0x10')]),'phone':_0x4f2eff[_0x35e8('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x35e8('0x12')](_0x23417d[_0x35e8('0x13')],_0x4f2eff,'\x20'),'description':intUtil[_0x35e8('0x12')](_0x23417d[_0x35e8('0x14')],_0x4f2eff,_0x35e8('0x15')),'tags':getTags(_0x23417d[_0x35e8('0x16')],'name')},getCustomFields(_0x23417d['Fields'],_0x4f2eff));_0x3c3872[_0x35e8('0x17')]=_[_0x35e8('0x18')](_['keyBy'](_0x3c3872[_0x35e8('0x17')],'id'),_0x35e8('0x19'));return request({'uri':util[_0x35e8('0xe')](_0x35e8('0x1a'),_0x2ad664[_0x35e8('0x1b')]),'method':_0x35e8('0x1c'),'body':_0x3c3872})[_0x35e8('0x1d')](function(_0x295b76){logger[_0x35e8('0xc')](_0x35e8('0x1e'));return _0x295b76;});}function getUser(_0x271b1b,_0x3ac9e6){if(intUtil[_0x35e8('0x1f')](_0x3ac9e6)){return request({'uri':util[_0x35e8('0xe')](_0x35e8('0x20'),_0x271b1b[_0x35e8('0x1b')]),'qs':{'email':_0x3ac9e6}})['then'](function(_0x176fe0){if(_0x176fe0['length']){logger[_0x35e8('0xc')](_0x35e8('0x21'));return _[_0x35e8('0x22')](_0x176fe0,function(_0xdfcea8){return _0xdfcea8['contact'][_0x35e8('0x23')]===_0x3ac9e6;});}else{logger[_0x35e8('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x35e8('0xe')](_0x35e8('0x24'),_0x271b1b[_0x35e8('0x1b')])})[_0x35e8('0x1d')](function(_0x360c23){logger[_0x35e8('0xc')](_0x35e8('0x25'));return _0x360c23;});}});}else{logger[_0x35e8('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x35e8('0xe')](_0x35e8('0x24'),_0x271b1b[_0x35e8('0x1b')])})['then'](function(_0x48e191){logger[_0x35e8('0xc')]('Admin\x20account\x20selected.');return _0x48e191;});}}function getEndUser(_0x963a31,_0x383ef2,_0x211f92){logger[_0x35e8('0xc')](_0x35e8('0x26'),_0x211f92);return request({'uri':util[_0x35e8('0xe')]('%s/api/v2/contacts',_0x963a31[_0x35e8('0x1b')]),'qs':{'phone':_0x211f92}})[_0x35e8('0x1d')](function(_0x333ded){if(_0x333ded['length']){logger[_0x35e8('0xc')](_0x35e8('0x27'));return _['find'](_0x333ded,{'phone':_0x211f92});}else{logger[_0x35e8('0xc')](_0x35e8('0x28'));return request({'uri':util[_0x35e8('0xe')](_0x35e8('0x29'),_0x963a31['remoteUri']),'method':_0x35e8('0x1c'),'body':{'name':_0x383ef2,'phone':_0x211f92}})[_0x35e8('0x1d')](function(_0x29f639){logger['info'](_0x35e8('0x2a'));return _0x29f639;});}});}function getAuth(_0x13f23a){return util[_0x35e8('0xe')](_0x35e8('0x2b'),new Buffer(_0x13f23a[_0x35e8('0x2c')]+':X')['toString'](_0x35e8('0x2d')));}function request(_0x17b55e){logger[_0x35e8('0x2e')](_0x35e8('0x2f'),JSON['stringify'](_0x17b55e));return rp(_[_0x35e8('0x8')](_0x17b55e,{'method':_0x35e8('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x8ee0be,_0x32ec8e){var _0x46f7b7=[];if(_0x8ee0be&&_0x8ee0be[_0x35e8('0x31')]>0x0){_0x46f7b7=_[_0x35e8('0x32')](_0x8ee0be,_0x32ec8e);}return _0x46f7b7;}function getCustomFields(_0x1e21da,_0x55d8cf){var _0x1d3327=[];var _0x268b16={'custom_fields':[]};if(_0x1e21da['length']>0x0){_[_0x35e8('0x33')](_0x1e21da,function(_0x42a106){if(_[_0x35e8('0x34')]([_0x35e8('0x35'),_0x35e8('0x36')],_0x42a106[_0x35e8('0x37')])&&_0x42a106['nameField']&&!_0x42a106[_0x35e8('0x38')]){_0x268b16[_0x42a106[_0x35e8('0x39')]['toLowerCase']()]=_0x42a106['content'][_0x35e8('0x3a')]();}else if(_[_0x35e8('0x34')]([_0x35e8('0x35'),'picklist'],_0x42a106['type'])&&_0x42a106['idField']&&_0x42a106[_0x35e8('0x38')]){_0x268b16[_0x35e8('0x17')][_0x35e8('0x3b')]({'id':_0x42a106['idField'],'value':_0x42a106[_0x35e8('0x3c')][_0x35e8('0x3a')]()});}else if(_0x42a106[_0x35e8('0x37')]===_0x35e8('0x3d')&&_0x42a106[_0x35e8('0x3e')]&&_0x42a106['idField']&&_0x42a106[_0x35e8('0x38')]){_0x55d8cf[_0x42a106[_0x35e8('0x3e')]]&&_0x268b16[_0x35e8('0x17')][_0x35e8('0x3b')]({'id':_0x42a106[_0x35e8('0x3f')],'value':_0x55d8cf[_0x42a106['variableName']]['toString']()});}else if(_0x42a106['type']===_0x35e8('0x40')&&_0x42a106[_0x35e8('0x41')]&&_0x42a106[_0x35e8('0x41')][_0x35e8('0x42')]&&_0x42a106[_0x35e8('0x3f')]&&_0x42a106[_0x35e8('0x38')]){_0x55d8cf[_0x42a106[_0x35e8('0x41')][_0x35e8('0x42')][_0x35e8('0x43')]()]&&_0x268b16[_0x35e8('0x17')]['push']({'id':_0x42a106[_0x35e8('0x3f')],'value':_0x55d8cf[_0x42a106[_0x35e8('0x41')][_0x35e8('0x42')]['toLowerCase']()][_0x35e8('0x3a')]()});}});}return _0x268b16;}exports[_0x35e8('0x44')]=function(_0x4ec0f5,_0x21b0e3,_0x503fba,_0x594d32,_0x408ed1,_0x6ce4e5){var _0x25a242,_0x41db14;_0x6ce4e5[_0x35e8('0x1b')]=intUtil[_0x35e8('0x45')](_0x6ce4e5['remoteUri']);_0x6ce4e5['serverUrl']=intUtil['stripTrailingSlash'](_0x6ce4e5[_0x35e8('0x46')]);if(_0x408ed1&&_0x408ed1[_0x35e8('0x47')]){logger['info'](_0x35e8('0x48'),_0x35e8('0x49'));_0x21b0e3[_0x35e8('0x4a')]=util[_0x35e8('0xe')](_0x35e8('0x4b'),_0x6ce4e5[_0x35e8('0x46')],_0x21b0e3[_0x35e8('0x4c')],md5(_0x21b0e3['uniqueid']));}else{_0x21b0e3[_0x35e8('0x4a')]='';}headers[_0x35e8('0x4d')]=getAuth(_0x6ce4e5);return getUser(_0x6ce4e5,_0x594d32[_0x35e8('0x23')])[_0x35e8('0x1d')](function(_0x452593){_0x25a242=_0x452593;logger[_0x35e8('0xc')](_0x35e8('0x4e'),_0x25a242['id']);return getEndUser(_0x6ce4e5,_0x21b0e3[_0x35e8('0x10')],_0x21b0e3[_0x35e8('0x11')]);})[_0x35e8('0x1d')](function(_0x335769){_0x41db14=_0x335769;logger['info'](_0x35e8('0x4f'),_0x41db14['id']);return getTicket(_0x6ce4e5,_0x25a242,_0x41db14,_0x503fba,_0x21b0e3);})['then'](function(_0x31dfb6){if(_0x31dfb6&&_0x31dfb6['id']){logger[_0x35e8('0xc')](_0x35e8('0x1e'));logger['info'](_0x35e8('0x50'),_0x31dfb6['id']);logger[_0x35e8('0xc')](_0x35e8('0x48'),_0x35e8('0x51'));emit(util[_0x35e8('0xe')](_0x35e8('0x52'),_0x594d32[_0x35e8('0x42')]),_0x35e8('0x53'),{'uri':util[_0x35e8('0xe')](_0x35e8('0x54'),_0x6ce4e5[_0x35e8('0x1b')],_0x31dfb6['id'])});}})[_0x35e8('0x55')](function(_0x4c2ca5){logger[_0x35e8('0x56')]('[QUEUE]',JSON['stringify'](_0x4c2ca5));});};exports[_0x35e8('0x57')]=function(_0xa74402,_0x43ca93,_0x49c637,_0x137add,_0x13ba2b,_0x21cd24,_0xee22b3){var _0x265092,_0x365f67;_0x21cd24[_0x35e8('0x1b')]=intUtil[_0x35e8('0x45')](_0x21cd24['remoteUri']);_0x21cd24[_0x35e8('0x46')]=intUtil[_0x35e8('0x45')](_0x21cd24[_0x35e8('0x46')]);if(_0xee22b3&&_0xee22b3['recordingFormat']&&_0xee22b3['recordingFormat']!=='none'){logger['info'](_0x35e8('0x58'),_0x35e8('0x49'));_0x43ca93['recordingURL']=util[_0x35e8('0xe')](_0x35e8('0x4b'),_0x21cd24[_0x35e8('0x46')],_0x43ca93[_0x35e8('0x4c')],md5(_0x43ca93[_0x35e8('0x4c')]));}headers[_0x35e8('0x4d')]=getAuth(_0x21cd24);return getUser(_0x21cd24,_0x137add[_0x35e8('0x23')])[_0x35e8('0x1d')](function(_0xff2761){_0x265092=_0xff2761;logger[_0x35e8('0xc')](_0x35e8('0x4e'),_0x265092['id']);return getEndUser(_0x21cd24,_0x43ca93[_0x35e8('0x59')],_0x43ca93['destcalleridnum']);})['then'](function(_0x35721e){_0x365f67=_0x35721e;logger[_0x35e8('0xc')]('The\x20Enduser\x20ID\x20is:',_0x365f67['id']);return getTicket(_0x21cd24,_0x265092,_0x365f67,_0x49c637,_0x43ca93);})[_0x35e8('0x1d')](function(_0x577ffa){if(_0x577ffa&&_0x577ffa['id']){logger['info'](_0x35e8('0x1e'));logger['info'](_0x35e8('0x50'),_0x577ffa['id']);logger['info'](_0x35e8('0x58'),_0x35e8('0x51'));emit(util[_0x35e8('0xe')](_0x35e8('0x52'),_0x137add[_0x35e8('0x42')]),_0x35e8('0x53'),{'uri':util[_0x35e8('0xe')](_0x35e8('0x54'),_0x21cd24[_0x35e8('0x1b')],_0x577ffa['id'])});}})[_0x35e8('0x55')](function(_0x95647c){logger[_0x35e8('0x56')]('[OUTBOUND]',JSON[_0x35e8('0x5a')](_0x95647c));});};exports[_0x35e8('0x5b')]=function(_0x545650,_0x2776c4,_0x340e00,_0xd64921,_0xd4ee37,_0x5513bb){var _0x175b42,_0x145408;_0x5513bb[_0x35e8('0x1b')]=intUtil[_0x35e8('0x45')](_0x5513bb['remoteUri']);_0x5513bb[_0x35e8('0x46')]=intUtil['stripTrailingSlash'](_0x5513bb[_0x35e8('0x46')]);if(_0xd4ee37&&_0xd4ee37[_0x35e8('0x47')]){logger[_0x35e8('0xc')]('['+_0x2776c4[_0x35e8('0x5c')][_0x35e8('0x5d')]()+']',_0x35e8('0x49'));_0x2776c4[_0x35e8('0x4a')]=util[_0x35e8('0xe')](_0x35e8('0x4b'),_0x5513bb[_0x35e8('0x46')],_0x2776c4['uniqueid'],md5(_0x2776c4[_0x35e8('0x4c')]));}else{_0x2776c4[_0x35e8('0x4a')]='';}headers[_0x35e8('0x4d')]=getAuth(_0x5513bb);return getUser(_0x5513bb,'')[_0x35e8('0x1d')](function(_0x3b7788){_0x175b42=_0x3b7788;logger[_0x35e8('0xc')](_0x35e8('0x4e'),_0x175b42['id']);return getEndUser(_0x5513bb,_0x2776c4['calleridname'],_0x2776c4[_0x35e8('0x11')]);})['then'](function(_0x3ccb91){_0x145408=_0x3ccb91;logger[_0x35e8('0xc')](_0x35e8('0x4f'),_0x145408['id']);return getTicket(_0x5513bb,_0x175b42,_0x145408,_0x340e00,_0x2776c4);})['then'](function(_0x1a8804){if(_0x1a8804){logger[_0x35e8('0xc')](_0x35e8('0x1e'));logger['info'](_0x35e8('0x50'),_0x1a8804['id']);}})[_0x35e8('0x55')](function(_0x1dbc86){logger[_0x35e8('0x56')]('['+_0x2776c4[_0x35e8('0x5c')]['toUpperCase']()+']',JSON[_0x35e8('0x5a')](_0x1dbc86));});}; \ No newline at end of file +var _0x7b4d=['none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','stringify','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','Fields','mapValues','keyBy','custom_fields','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','format','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','debug','[HTTP]','GET','forEach','string','type','nameField','customField','content','toString','includes','idField','push','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat'];(function(_0x50d13d,_0x31f10e){var _0x9d2080=function(_0x560d69){while(--_0x560d69){_0x50d13d['push'](_0x50d13d['shift']());}};_0x9d2080(++_0x31f10e);}(_0x7b4d,0x120));var _0xd7b4=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0x7b4d[_0x5302fb];return _0x43e6a4;};'use strict';var _=require(_0xd7b4('0x0'));var rp=require(_0xd7b4('0x1'));var md5=require(_0xd7b4('0x2'));var util=require(_0xd7b4('0x3'));var Redis=require(_0xd7b4('0x4'));var intUtil=require(_0xd7b4('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xd7b4('0x6'));config[_0xd7b4('0x7')]=_[_0xd7b4('0x8')](config[_0xd7b4('0x7')],{'host':_0xd7b4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd7b4('0x7')]));var headers={'Content-Type':_0xd7b4('0xa'),'Accept':'application/json'};function emit(_0x1371a7,_0x21f6b4,_0x571f01){io['to'](_0x1371a7)[_0xd7b4('0xb')](_0x21f6b4,_0x571f01);}function getTicket(_0x3101be,_0xc75e10,_0x3ee24,_0x545ef6,_0x35e972){logger[_0xd7b4('0xc')](_0xd7b4('0xd'));var _0x5a2ff7=_['merge']({'responder_id':_0xc75e10['id'],'requester_id':_0x3ee24['id'],'name':util['format']('Caller\x20-\x20%s',_0x35e972[_0xd7b4('0xe')]),'phone':_0x35e972[_0xd7b4('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x545ef6[_0xd7b4('0x10')],_0x35e972,'\x20'),'description':intUtil[_0xd7b4('0x11')](_0x545ef6[_0xd7b4('0x12')],_0x35e972,_0xd7b4('0x13')),'tags':getTags(_0x545ef6[_0xd7b4('0x14')],'name')},getCustomFields(_0x545ef6[_0xd7b4('0x15')],_0x35e972));_0x5a2ff7['custom_fields']=_[_0xd7b4('0x16')](_[_0xd7b4('0x17')](_0x5a2ff7[_0xd7b4('0x18')],'id'),_0xd7b4('0x19'));return request({'uri':util['format']('%s/api/v2/tickets',_0x3101be[_0xd7b4('0x1a')]),'method':_0xd7b4('0x1b'),'body':_0x5a2ff7})[_0xd7b4('0x1c')](function(_0x4f937b){logger[_0xd7b4('0xc')](_0xd7b4('0x1d'));return _0x4f937b;});}function getUser(_0x1f2fc4,_0x390778){if(intUtil[_0xd7b4('0x1e')](_0x390778)){return request({'uri':util[_0xd7b4('0x1f')](_0xd7b4('0x20'),_0x1f2fc4[_0xd7b4('0x1a')]),'qs':{'email':_0x390778}})[_0xd7b4('0x1c')](function(_0x3306c4){if(_0x3306c4[_0xd7b4('0x21')]){logger[_0xd7b4('0xc')](_0xd7b4('0x22'));return _[_0xd7b4('0x23')](_0x3306c4,function(_0x5b543c){return _0x5b543c[_0xd7b4('0x24')][_0xd7b4('0x25')]===_0x390778;});}else{logger[_0xd7b4('0xc')](_0xd7b4('0x26'));return request({'uri':util[_0xd7b4('0x1f')](_0xd7b4('0x27'),_0x1f2fc4[_0xd7b4('0x1a')])})[_0xd7b4('0x1c')](function(_0xa53387){logger['info']('Admin\x20account\x20selected.');return _0xa53387;});}});}else{logger[_0xd7b4('0xc')](_0xd7b4('0x28'));return request({'uri':util[_0xd7b4('0x1f')](_0xd7b4('0x27'),_0x1f2fc4['remoteUri'])})['then'](function(_0xe5bd17){logger[_0xd7b4('0xc')](_0xd7b4('0x29'));return _0xe5bd17;});}}function getEndUser(_0x271e08,_0x580a85,_0x5d60d4){logger[_0xd7b4('0xc')](_0xd7b4('0x2a'),_0x5d60d4);return request({'uri':util[_0xd7b4('0x1f')](_0xd7b4('0x2b'),_0x271e08[_0xd7b4('0x1a')]),'qs':{'phone':_0x5d60d4}})['then'](function(_0xd5bf9e){if(_0xd5bf9e[_0xd7b4('0x21')]){logger['info'](_0xd7b4('0x2c'));return _[_0xd7b4('0x23')](_0xd5bf9e,{'phone':_0x5d60d4});}else{logger[_0xd7b4('0xc')](_0xd7b4('0x2d'));return request({'uri':util[_0xd7b4('0x1f')]('%s/api/v2/contacts',_0x271e08[_0xd7b4('0x1a')]),'method':_0xd7b4('0x1b'),'body':{'name':_0x580a85,'phone':_0x5d60d4}})[_0xd7b4('0x1c')](function(_0x1c7c05){logger[_0xd7b4('0xc')]('Enduser\x20created.');return _0x1c7c05;});}});}function getAuth(_0x54248c){return util['format'](_0xd7b4('0x2e'),new Buffer(_0x54248c[_0xd7b4('0x2f')]+':X')['toString']('base64'));}function request(_0x58d48b){logger[_0xd7b4('0x30')](_0xd7b4('0x31'),JSON['stringify'](_0x58d48b));return rp(_[_0xd7b4('0x8')](_0x58d48b,{'method':_0xd7b4('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x1dab3b,_0x460c14){var _0x4d712e=[];if(_0x1dab3b&&_0x1dab3b['length']>0x0){_0x4d712e=_['map'](_0x1dab3b,_0x460c14);}return _0x4d712e;}function getCustomFields(_0x223419,_0x16f40b){var _0x11ed86=[];var _0x3a65d5={'custom_fields':[]};if(_0x223419[_0xd7b4('0x21')]>0x0){_[_0xd7b4('0x33')](_0x223419,function(_0x169af7){if(_['includes']([_0xd7b4('0x34'),'picklist'],_0x169af7[_0xd7b4('0x35')])&&_0x169af7[_0xd7b4('0x36')]&&!_0x169af7[_0xd7b4('0x37')]){_0x3a65d5[_0x169af7[_0xd7b4('0x36')]['toLowerCase']()]=_0x169af7[_0xd7b4('0x38')][_0xd7b4('0x39')]();}else if(_[_0xd7b4('0x3a')]([_0xd7b4('0x34'),'picklist'],_0x169af7['type'])&&_0x169af7[_0xd7b4('0x3b')]&&_0x169af7[_0xd7b4('0x37')]){_0x3a65d5[_0xd7b4('0x18')][_0xd7b4('0x3c')]({'id':_0x169af7[_0xd7b4('0x3b')],'value':_0x169af7['content']['toString']()});}else if(_0x169af7[_0xd7b4('0x35')]===_0xd7b4('0x3d')&&_0x169af7['variableName']&&_0x169af7['idField']&&_0x169af7[_0xd7b4('0x37')]){_0x16f40b[_0x169af7[_0xd7b4('0x3e')]]&&_0x3a65d5[_0xd7b4('0x18')]['push']({'id':_0x169af7['idField'],'value':_0x16f40b[_0x169af7[_0xd7b4('0x3e')]]['toString']()});}else if(_0x169af7[_0xd7b4('0x35')]==='customVariable'&&_0x169af7[_0xd7b4('0x3f')]&&_0x169af7[_0xd7b4('0x3f')]['name']&&_0x169af7[_0xd7b4('0x3b')]&&_0x169af7[_0xd7b4('0x37')]){_0x16f40b[_0x169af7[_0xd7b4('0x3f')][_0xd7b4('0x40')]['toLowerCase']()]&&_0x3a65d5[_0xd7b4('0x18')][_0xd7b4('0x3c')]({'id':_0x169af7['idField'],'value':_0x16f40b[_0x169af7['Variable']['name']['toLowerCase']()][_0xd7b4('0x39')]()});}});}return _0x3a65d5;}exports[_0xd7b4('0x41')]=function(_0x49e2b0,_0x2a5079,_0x392327,_0x4c2b41,_0x2bacfe,_0x3979ad){var _0x26bd27,_0x4002cb;_0x3979ad['remoteUri']=intUtil['stripTrailingSlash'](_0x3979ad[_0xd7b4('0x1a')]);_0x3979ad['serverUrl']=intUtil[_0xd7b4('0x42')](_0x3979ad[_0xd7b4('0x43')]);if(_0x2bacfe&&_0x2bacfe[_0xd7b4('0x44')]){logger[_0xd7b4('0xc')](_0xd7b4('0x45'),'Recording\x20is\x20enabled!');_0x2a5079[_0xd7b4('0x46')]=util[_0xd7b4('0x1f')](_0xd7b4('0x47'),_0x3979ad[_0xd7b4('0x43')],_0x2a5079[_0xd7b4('0x48')],md5(_0x2a5079[_0xd7b4('0x48')]));}else{_0x2a5079['recordingURL']='';}headers[_0xd7b4('0x49')]=getAuth(_0x3979ad);return getUser(_0x3979ad,_0x4c2b41[_0xd7b4('0x25')])[_0xd7b4('0x1c')](function(_0x823a48){_0x26bd27=_0x823a48;logger[_0xd7b4('0xc')](_0xd7b4('0x4a'),_0x26bd27['id']);return getEndUser(_0x3979ad,_0x2a5079[_0xd7b4('0xe')],_0x2a5079[_0xd7b4('0xf')]);})['then'](function(_0x392b96){_0x4002cb=_0x392b96;logger[_0xd7b4('0xc')](_0xd7b4('0x4b'),_0x4002cb['id']);return getTicket(_0x3979ad,_0x26bd27,_0x4002cb,_0x392327,_0x2a5079);})[_0xd7b4('0x1c')](function(_0x4c0196){if(_0x4c0196&&_0x4c0196['id']){logger[_0xd7b4('0xc')](_0xd7b4('0x1d'));logger[_0xd7b4('0xc')](_0xd7b4('0x4c'),_0x4c0196['id']);logger[_0xd7b4('0xc')](_0xd7b4('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd7b4('0x1f')](_0xd7b4('0x4d'),_0x4c2b41[_0xd7b4('0x40')]),_0xd7b4('0x4e'),{'uri':util[_0xd7b4('0x1f')](_0xd7b4('0x4f'),_0x3979ad['remoteUri'],_0x4c0196['id'])});}})[_0xd7b4('0x50')](function(_0x237e17){logger[_0xd7b4('0x51')](_0xd7b4('0x45'),JSON['stringify'](_0x237e17));});};exports[_0xd7b4('0x52')]=function(_0x258904,_0x56e499,_0x462628,_0x51707b,_0x4d84f3,_0x2a6a7f,_0x49dff4){var _0x51ada2,_0x1efc29;_0x2a6a7f[_0xd7b4('0x1a')]=intUtil[_0xd7b4('0x42')](_0x2a6a7f[_0xd7b4('0x1a')]);_0x2a6a7f[_0xd7b4('0x43')]=intUtil['stripTrailingSlash'](_0x2a6a7f[_0xd7b4('0x43')]);if(_0x49dff4&&_0x49dff4[_0xd7b4('0x53')]&&_0x49dff4['recordingFormat']!==_0xd7b4('0x54')){logger[_0xd7b4('0xc')](_0xd7b4('0x55'),_0xd7b4('0x56'));_0x56e499[_0xd7b4('0x46')]=util[_0xd7b4('0x1f')](_0xd7b4('0x47'),_0x2a6a7f[_0xd7b4('0x43')],_0x56e499[_0xd7b4('0x48')],md5(_0x56e499[_0xd7b4('0x48')]));}headers[_0xd7b4('0x49')]=getAuth(_0x2a6a7f);return getUser(_0x2a6a7f,_0x51707b[_0xd7b4('0x25')])[_0xd7b4('0x1c')](function(_0xf744d7){_0x51ada2=_0xf744d7;logger[_0xd7b4('0xc')](_0xd7b4('0x4a'),_0x51ada2['id']);return getEndUser(_0x2a6a7f,_0x56e499['destcalleridname'],_0x56e499[_0xd7b4('0x57')]);})[_0xd7b4('0x1c')](function(_0x3a34f0){_0x1efc29=_0x3a34f0;logger['info'](_0xd7b4('0x4b'),_0x1efc29['id']);return getTicket(_0x2a6a7f,_0x51ada2,_0x1efc29,_0x462628,_0x56e499);})[_0xd7b4('0x1c')](function(_0x45e36a){if(_0x45e36a&&_0x45e36a['id']){logger[_0xd7b4('0xc')](_0xd7b4('0x1d'));logger['info'](_0xd7b4('0x4c'),_0x45e36a['id']);logger[_0xd7b4('0xc')](_0xd7b4('0x55'),_0xd7b4('0x58'));emit(util[_0xd7b4('0x1f')](_0xd7b4('0x4d'),_0x51707b[_0xd7b4('0x40')]),_0xd7b4('0x4e'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x2a6a7f[_0xd7b4('0x1a')],_0x45e36a['id'])});}})[_0xd7b4('0x50')](function(_0x5aec62){logger[_0xd7b4('0x51')]('[OUTBOUND]',JSON[_0xd7b4('0x59')](_0x5aec62));});};exports[_0xd7b4('0x5a')]=function(_0x11c9ab,_0x711873,_0x249543,_0x7eb0e2,_0x21ef7f,_0x173535){var _0x408ee7,_0x2e6733;_0x173535['remoteUri']=intUtil[_0xd7b4('0x42')](_0x173535[_0xd7b4('0x1a')]);_0x173535[_0xd7b4('0x43')]=intUtil[_0xd7b4('0x42')](_0x173535[_0xd7b4('0x43')]);if(_0x21ef7f&&_0x21ef7f[_0xd7b4('0x44')]){logger[_0xd7b4('0xc')]('['+_0x711873[_0xd7b4('0x5b')]['toUpperCase']()+']',_0xd7b4('0x56'));_0x711873[_0xd7b4('0x46')]=util[_0xd7b4('0x1f')](_0xd7b4('0x47'),_0x173535[_0xd7b4('0x43')],_0x711873['uniqueid'],md5(_0x711873[_0xd7b4('0x48')]));}else{_0x711873[_0xd7b4('0x46')]='';}headers[_0xd7b4('0x49')]=getAuth(_0x173535);return getUser(_0x173535,'')[_0xd7b4('0x1c')](function(_0x5e0ccd){_0x408ee7=_0x5e0ccd;logger[_0xd7b4('0xc')](_0xd7b4('0x4a'),_0x408ee7['id']);return getEndUser(_0x173535,_0x711873[_0xd7b4('0xe')],_0x711873[_0xd7b4('0xf')]);})[_0xd7b4('0x1c')](function(_0x563868){_0x2e6733=_0x563868;logger[_0xd7b4('0xc')](_0xd7b4('0x4b'),_0x2e6733['id']);return getTicket(_0x173535,_0x408ee7,_0x2e6733,_0x249543,_0x711873);})[_0xd7b4('0x1c')](function(_0x5304e7){if(_0x5304e7){logger[_0xd7b4('0xc')]('Ticket\x20created!');logger[_0xd7b4('0xc')](_0xd7b4('0x4c'),_0x5304e7['id']);}})['catch'](function(_0x2b67f3){logger[_0xd7b4('0x51')]('['+_0x711873['lastevent'][_0xd7b4('0x5c')]()+']',JSON['stringify'](_0x2b67f3));});}; \ 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 7c6fff6..782597f 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 _0xb227=['format','task','Task\x20created:','ticketId','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','util','ioredis','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','info','then','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xb227,0xcd));var _0x7b22=function(_0x2d6d33,_0x44f126){_0x2d6d33=_0x2d6d33-0x0;var _0x34e073=_0xb227[_0x2d6d33];return _0x34e073;};'use strict';var _=require(_0x7b22('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x7b22('0x1'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x7b22('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x7b22('0x3'))(_0x7b22('0x4'));config[_0x7b22('0x5')]=_[_0x7b22('0x6')](config[_0x7b22('0x5')],{'host':_0x7b22('0x7'),'port':0x18eb});var io=require(_0x7b22('0x8'))(new Redis(config['redis']));function getAdminId(_0x4303c2,_0x4ea643,_0x5e21e0,_0x595d8d){return new Promise(function(_0x5be6cb,_0x31fb8f){var _0x4b0df7=![];var _0x460dc4={'method':_0x7b22('0x9'),'uri':_0x595d8d+'/api/selector/owners','json':!![]};_0x460dc4['headers']=_0x5e21e0;logger[_0x7b22('0xa')]('Getting\x20admin\x20information');return rp(_0x460dc4)[_0x7b22('0xb')](function(_0x218a5a){if(_0x218a5a){var _0x4d57d5=_0x218a5a['users'];var _0x17c4b0=null;for(_0x17c4b0=0x0;_0x17c4b0<_0x4d57d5[_0x7b22('0xc')];_0x17c4b0++){if(_0x4d57d5[_0x17c4b0]['email']===_0x4303c2[_0x7b22('0xd')]){_0x4303c2[_0x7b22('0xe')]=_0x4d57d5[_0x17c4b0]['id'];_0x4b0df7=!![];}}if(_0x4b0df7){logger[_0x7b22('0xa')](_0x7b22('0xf'),_0x4303c2[_0x7b22('0xe')]);_0x5be6cb(_0x4303c2);}else{_0x31fb8f({'statusCode':0x194,'message':_0x7b22('0x10')});}}else{_0x31fb8f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x7b22('0x11')](function(_0x53f863){logger[_0x7b22('0x12')]('['+[_0x4ea643['toUpperCase']()]+']',_0x53f863[_0x7b22('0x13')]);_0x31fb8f(_0x53f863);});});}function getUser(_0x3c3671,_0x439f45,_0xf9f371){return function(_0x5737cd){return new Promise(function(_0x1a3ee4,_0x41c425){var _0x55ce8b={'method':_0x7b22('0x9'),'uri':_0xf9f371+_0x7b22('0x14'),'json':!![]};_0x55ce8b['headers']=_0x439f45;logger[_0x7b22('0xa')](_0x7b22('0x15'));return rp(_0x55ce8b)['then'](function(_0x132fd9){if(_0x132fd9){var _0x57e578=_0x132fd9['users'];var _0x2e2714=![];var _0x2208ab=null;if(_0x5737cd[_0x7b22('0x16')]!==null){logger[_0x7b22('0xa')](_0x7b22('0x17'),_0x5737cd['agentEmail']);_0x5737cd[_0x7b22('0x18')]=_0x5737cd[_0x7b22('0x16')];for(_0x2208ab=0x0;_0x2208ab<_0x57e578['length'];_0x2208ab++){if(_0x57e578[_0x2208ab][_0x7b22('0x19')]===_0x5737cd[_0x7b22('0x16')]){_0x2e2714=!![];_0x5737cd[_0x7b22('0x1a')]=_0x57e578[_0x2208ab]['id'];logger['info'](_0x7b22('0x1b'),_0x5737cd[_0x7b22('0x1a')]);}}}if(!_0x2e2714){logger[_0x7b22('0xa')]('Admin\x20selected');_0x5737cd[_0x7b22('0x18')]=_0x5737cd[_0x7b22('0xd')];_0x5737cd[_0x7b22('0x1a')]=_0x5737cd[_0x7b22('0xe')];_0x2e2714=!![];}if(_0x2e2714){_0x1a3ee4(_0x5737cd);}else{_0x41c425({'statusCode':0x194,'message':_0x7b22('0x10')});}}else{_0x41c425({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x7b22('0x11')](function(_0x4ad4a0){logger[_0x7b22('0x12')]('['+[_0x3c3671[_0x7b22('0x1c')]()]+']',_0x4ad4a0[_0x7b22('0x13')]);_0x41c425(_0x4ad4a0);});});};}function searchContact(_0x16175b,_0x4a6f08,_0x49290c,_0x4d6f3b){return new Promise(function(_0xbbd643,_0x3a875f){var _0x20e83e={'method':'GET','headers':_0x4a6f08,'uri':_0x16175b+_0x7b22('0x1d')+_0x4d6f3b+_0x7b22('0x1e')+_0x49290c+_0x7b22('0x1f'),'json':!![]};rp(_0x20e83e)[_0x7b22('0xb')](function(_0x1c54cd){var _0x437539=_[_0x7b22('0x20')](_0x1c54cd[_0x7b22('0x21')][_0x7b22('0x21')],[_0x49290c,_0x4d6f3b]);_0xbbd643(_0x437539);})[_0x7b22('0x11')](function(_0x13ed1f){_0x3a875f(_0x13ed1f);});});}function getEndUser(_0x2086cf,_0x51dcbf,_0x6d438f){return function(_0x473569){return new Promise(function(_0x30ba40,_0xc38ac1){logger[_0x7b22('0xa')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x473569[_0x7b22('0x22')]));searchContact(_0x6d438f,_0x51dcbf,_0x7b22('0x23'),_0x473569[_0x7b22('0x22')])['then'](function(_0x302809){if(_0x302809){_0x473569[_0x7b22('0x24')]=_0x302809['id'];logger['info'](_0x7b22('0x25'),_0x473569[_0x7b22('0x24')]);return _0x30ba40(_0x473569);}searchContact(_0x6d438f,_0x51dcbf,_0x7b22('0x26'),_0x473569[_0x7b22('0x22')])[_0x7b22('0xb')](function(_0x1e71e5){if(_0x1e71e5){_0x473569['endUserId']=_0x1e71e5['id'];logger[_0x7b22('0xa')](_0x7b22('0x27'),_0x473569['endUserId']);return _0x30ba40(_0x473569);}createEndUser(_0x473569,_0x2086cf,_0x51dcbf,_0x6d438f)['then'](function(_0x57ecc5){logger[_0x7b22('0xa')](_0x7b22('0x28'),_0x57ecc5[_0x7b22('0x24')]);return _0x30ba40(_0x57ecc5);});});})[_0x7b22('0x11')](function(_0x34c4cb){_0xc38ac1(_0x34c4cb);});});};}function createEndUser(_0x47274e,_0xd3fd0e,_0xb923c6,_0x5f6da2){return new Promise(function(_0x55459e,_0x37b098){var _0x199934=moment();var _0x1f9d5f={'method':_0x7b22('0x29'),'uri':_0x5f6da2+_0x7b22('0x2a'),'body':{'contact':{'last_name':_0x47274e[_0x7b22('0x22')],'work_number':_0x47274e[_0x7b22('0x22')],'mobile_number':_0x47274e['contactNumber'],'owner_id':_0x47274e['userId'],'created_at':_0x199934['format'](_0x7b22('0x2b'))}},'json':!![]};_0x1f9d5f[_0x7b22('0x2c')]=_0xb923c6;logger['info'](_0x7b22('0x2d'));return rp(_0x1f9d5f)['then'](function(_0x66147c){_0x47274e[_0x7b22('0x24')]=_0x66147c[_0x7b22('0x2e')]['id'];_0x55459e(_0x47274e);})[_0x7b22('0x11')](function(_0x213c25){logger[_0x7b22('0x12')]('['+[_0xd3fd0e[_0x7b22('0x1c')]()]+']',_0x213c25[_0x7b22('0x13')]);_0x37b098(_0x213c25['message']);});});}function getTicket(_0x235659,_0x43fa60,_0x1a5745,_0x1b5577,_0x338a7d){return function(_0x5d2ccc){logger['info'](_0x7b22('0x2f'));return new Promise(function(_0x4d6828,_0x144a5c){var _0x3ab741=moment();var _0x361342={'method':'POST','uri':_0x1a5745+_0x7b22('0x30'),'body':{'title':intUtil[_0x7b22('0x31')](_0x1b5577[_0x7b22('0x32')],_0x338a7d,'\x20'),'description':intUtil[_0x7b22('0x31')](_0x1b5577[_0x7b22('0x33')],_0x338a7d,'\x0a'),'owner_id':_0x5d2ccc[_0x7b22('0x1a')],'creater_id':_0x5d2ccc[_0x7b22('0xe')],'targetable_id':_0x5d2ccc[_0x7b22('0x24')],'targetable_type':_0x7b22('0x34'),'created_at':_0x3ab741[_0x7b22('0x35')](_0x7b22('0x2b')),'due_date':_0x3ab741['add'](0x1e,'m')[_0x7b22('0x35')](_0x7b22('0x2b'))},'json':!![]};_0x361342[_0x7b22('0x2c')]=_0x43fa60;return rp(_0x361342)['then'](function(_0x3735a3){_0x5d2ccc['ticketId']=_0x3735a3[_0x7b22('0x36')]['id'];logger[_0x7b22('0xa')](_0x7b22('0x37'),_0x5d2ccc[_0x7b22('0x38')]);_0x4d6828(_0x5d2ccc);})[_0x7b22('0x11')](function(_0x34a32e){logger[_0x7b22('0x12')]('['+[_0x235659[_0x7b22('0x1c')]()]+']',_0x34a32e[_0x7b22('0x13')]);_0x144a5c(_0x34a32e[_0x7b22('0x13')]);});});};}function emit(_0x2d95e1,_0x5466aa,_0x5ad9ed){var _0x4bbeab={'uri':_0x2d95e1+'/contacts/'+_0x5ad9ed};io['to'](util[_0x7b22('0x35')](_0x7b22('0x39'),_0x5466aa))[_0x7b22('0x3a')](_0x7b22('0x3b'),_0x4bbeab);}exports['cs']=function(_0x540369,_0xf46416,_0x5da8d3,_0x3accb1,_0xb138ce,_0x296b73,_0x462907,_0xcb71ed){var _0xddd25f={};var _0x2ed2c6={'Authorization':'Token\x20token='+_0x296b73[_0x7b22('0x3c')]};_0x296b73[_0x7b22('0x3d')]=intUtil[_0x7b22('0x3e')](_0x296b73[_0x7b22('0x3d')]);_0x296b73[_0x7b22('0x3f')]=intUtil[_0x7b22('0x3e')](_0x296b73[_0x7b22('0x3f')]);var _0x35118f=_0x296b73['remoteUri'];_0xddd25f['adminEmail']=_0x296b73[_0x7b22('0x40')];_0xddd25f['contactNumber']=_0xcb71ed[_0x7b22('0x41')]()===_0x7b22('0x42')?_0xf46416[_0x7b22('0x43')]:_0xf46416[_0x7b22('0x44')];_0xddd25f[_0x7b22('0x45')]=_0xcb71ed==='queue'||_0xcb71ed===_0x7b22('0x46')?_0x7b22('0x47'):_0x7b22('0x42');if(_0x3accb1){_0xddd25f[_0x7b22('0x16')]=_0x3accb1[_0x7b22('0x19')];}var _0x5be4fa=util[_0x7b22('0x35')](_0x7b22('0x48'),_0x296b73['serverUrl'],_0xf46416[_0x7b22('0x49')],md5(_0xf46416['uniqueid']));if(_0xb138ce&&_0xb138ce[_0x7b22('0x4a')]){logger[_0x7b22('0xa')](_0x7b22('0x4b'),_0x7b22('0x4c'));_0xf46416[_0x7b22('0x4d')]=_0x5be4fa;}else if(_0x462907&&_0x462907[_0x7b22('0x4e')]&&_0x462907[_0x7b22('0x4e')]!==_0x7b22('0x4f')){logger[_0x7b22('0xa')](_0x7b22('0x50'),_0x7b22('0x4c'));_0xf46416[_0x7b22('0x4d')]=_0x5be4fa;}else{_0xf46416['recordingURL']='';}return getAdminId(_0xddd25f,_0xcb71ed,_0x2ed2c6,_0x35118f)[_0x7b22('0xb')](getUser(_0xcb71ed,_0x2ed2c6,_0x35118f))['then'](getEndUser(_0xcb71ed,_0x2ed2c6,_0x35118f))[_0x7b22('0xb')](getTicket(_0xcb71ed,_0x2ed2c6,_0x35118f,_0x5da8d3,_0xf46416))[_0x7b22('0xb')](function(_0x398b25){logger[_0x7b22('0xa')](util[_0x7b22('0x35')](_0x7b22('0x51'),_0x398b25['ticketId']));if(_0xcb71ed!==_0x7b22('0x46')){logger[_0x7b22('0xa')]('['+[_0xcb71ed[_0x7b22('0x1c')]()]+']',_0x7b22('0x52'));emit(_0x35118f,_0x3accb1[_0x7b22('0x53')],_0x398b25[_0x7b22('0x24')]);}})[_0x7b22('0x11')](function(_0x4a134e){logger[_0x7b22('0x12')]('['+[_0xcb71ed['toUpperCase']()]+_0x7b22('0x54'),util[_0x7b22('0x55')](_0x4a134e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7954=['Contact','ticketId','task','Task\x20created:','user:%s','emit','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','moment','freshsales','redis','defaults','GET','/api/selector/owners','Getting\x20admin\x20information','then','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','headers','info','Getting\x20user\x20list','agentEmail','length','User\x20found:','userId','Admin\x20selected','userEmail','adminEmail','/api/lookup?q=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions'];(function(_0x358eab,_0x5d035f){var _0x8e018b=function(_0x595721){while(--_0x595721){_0x358eab['push'](_0x358eab['shift']());}};_0x8e018b(++_0x5d035f);}(_0x7954,0xb3));var _0x4795=function(_0x52e122,_0x4e7d31){_0x52e122=_0x52e122-0x0;var _0x21bd42=_0x7954[_0x52e122];return _0x21bd42;};'use strict';var _=require('lodash');var rp=require(_0x4795('0x0'));var md5=require(_0x4795('0x1'));var util=require('util');var moment=require(_0x4795('0x2'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4795('0x3'));config[_0x4795('0x4')]=_[_0x4795('0x5')](config[_0x4795('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x2e6929,_0x165308,_0x2e45b9,_0x37487d){return new Promise(function(_0x1d974f,_0x115e73){var _0x3c44b4=![];var _0x57de59={'method':_0x4795('0x6'),'uri':_0x37487d+_0x4795('0x7'),'json':!![]};_0x57de59['headers']=_0x2e45b9;logger['info'](_0x4795('0x8'));return rp(_0x57de59)[_0x4795('0x9')](function(_0x374af9){if(_0x374af9){var _0x5dfd5e=_0x374af9['users'];var _0x41ffc1=null;for(_0x41ffc1=0x0;_0x41ffc1<_0x5dfd5e['length'];_0x41ffc1++){if(_0x5dfd5e[_0x41ffc1][_0x4795('0xa')]===_0x2e6929['adminEmail']){_0x2e6929[_0x4795('0xb')]=_0x5dfd5e[_0x41ffc1]['id'];_0x3c44b4=!![];}}if(_0x3c44b4){logger['info']('Admin\x20found:',_0x2e6929['adminId']);_0x1d974f(_0x2e6929);}else{_0x115e73({'statusCode':0x194,'message':_0x4795('0xc')});}}else{_0x115e73({'statusCode':0x194,'message':_0x4795('0xc')});}})[_0x4795('0xd')](function(_0x1d9cd1){logger[_0x4795('0xe')]('['+[_0x165308[_0x4795('0xf')]()]+']',_0x1d9cd1[_0x4795('0x10')]);_0x115e73(_0x1d9cd1);});});}function getUser(_0x10dcc2,_0x30fa8e,_0x5487d5){return function(_0x121261){return new Promise(function(_0x27ac4b,_0x568d6){var _0x3409b3={'method':_0x4795('0x6'),'uri':_0x5487d5+_0x4795('0x7'),'json':!![]};_0x3409b3[_0x4795('0x11')]=_0x30fa8e;logger[_0x4795('0x12')](_0x4795('0x13'));return rp(_0x3409b3)['then'](function(_0x1eabac){if(_0x1eabac){var _0x13e170=_0x1eabac['users'];var _0x15dac4=![];var _0x4419ee=null;if(_0x121261['agentEmail']!==null){logger[_0x4795('0x12')]('Getting\x20user\x20with\x20email',_0x121261[_0x4795('0x14')]);_0x121261['userEmail']=_0x121261[_0x4795('0x14')];for(_0x4419ee=0x0;_0x4419ee<_0x13e170[_0x4795('0x15')];_0x4419ee++){if(_0x13e170[_0x4419ee]['email']===_0x121261[_0x4795('0x14')]){_0x15dac4=!![];_0x121261['userId']=_0x13e170[_0x4419ee]['id'];logger['info'](_0x4795('0x16'),_0x121261[_0x4795('0x17')]);}}}if(!_0x15dac4){logger[_0x4795('0x12')](_0x4795('0x18'));_0x121261[_0x4795('0x19')]=_0x121261[_0x4795('0x1a')];_0x121261[_0x4795('0x17')]=_0x121261[_0x4795('0xb')];_0x15dac4=!![];}if(_0x15dac4){_0x27ac4b(_0x121261);}else{_0x568d6({'statusCode':0x194,'message':_0x4795('0xc')});}}else{_0x568d6({'statusCode':0x194,'message':_0x4795('0xc')});}})[_0x4795('0xd')](function(_0x3bf7b4){logger[_0x4795('0xe')]('['+[_0x10dcc2['toUpperCase']()]+']',_0x3bf7b4[_0x4795('0x10')]);_0x568d6(_0x3bf7b4);});});};}function searchContact(_0x55cfbf,_0x4d71bf,_0x3f2b0e,_0x55b07a){return new Promise(function(_0x50d2ee,_0x1caa05){var _0x2d17bb={'method':_0x4795('0x6'),'headers':_0x4d71bf,'uri':_0x55cfbf+_0x4795('0x1b')+_0x55b07a+'&f='+_0x3f2b0e+'&entities=contact','json':!![]};rp(_0x2d17bb)[_0x4795('0x9')](function(_0x26e560){var _0x301c2a=_[_0x4795('0x1c')](_0x26e560[_0x4795('0x1d')]['contacts'],[_0x3f2b0e,_0x55b07a]);_0x50d2ee(_0x301c2a);})[_0x4795('0xd')](function(_0x4d70e0){_0x1caa05(_0x4d70e0);});});}function getEndUser(_0xe62ac2,_0x418c19,_0x11bd2c){return function(_0x3a632d){return new Promise(function(_0x4aafc3,_0x32f1fa){logger[_0x4795('0x12')](util[_0x4795('0x1e')](_0x4795('0x1f'),_0x3a632d[_0x4795('0x20')]));searchContact(_0x11bd2c,_0x418c19,_0x4795('0x21'),_0x3a632d[_0x4795('0x20')])[_0x4795('0x9')](function(_0x13d094){if(_0x13d094){_0x3a632d[_0x4795('0x22')]=_0x13d094['id'];logger[_0x4795('0x12')](_0x4795('0x23'),_0x3a632d[_0x4795('0x22')]);return _0x4aafc3(_0x3a632d);}searchContact(_0x11bd2c,_0x418c19,_0x4795('0x24'),_0x3a632d[_0x4795('0x20')])[_0x4795('0x9')](function(_0x39d436){if(_0x39d436){_0x3a632d[_0x4795('0x22')]=_0x39d436['id'];logger['info']('Contact\x20found\x20work_number:',_0x3a632d[_0x4795('0x22')]);return _0x4aafc3(_0x3a632d);}createEndUser(_0x3a632d,_0xe62ac2,_0x418c19,_0x11bd2c)['then'](function(_0x4fefee){logger[_0x4795('0x12')](_0x4795('0x25'),_0x4fefee[_0x4795('0x22')]);return _0x4aafc3(_0x4fefee);});});})[_0x4795('0xd')](function(_0x20b290){_0x32f1fa(_0x20b290);});});};}function createEndUser(_0x260d4d,_0x889bbf,_0x51f11f,_0xfe8569){return new Promise(function(_0x4e3566,_0x3e4407){var _0x313a22=moment();var _0x551aba={'method':_0x4795('0x26'),'uri':_0xfe8569+'/api/contacts','body':{'contact':{'last_name':_0x260d4d[_0x4795('0x20')],'work_number':_0x260d4d[_0x4795('0x20')],'mobile_number':_0x260d4d['contactNumber'],'owner_id':_0x260d4d[_0x4795('0x17')],'created_at':_0x313a22['format'](_0x4795('0x27'))}},'json':!![]};_0x551aba['headers']=_0x51f11f;logger[_0x4795('0x12')](_0x4795('0x28'));return rp(_0x551aba)[_0x4795('0x9')](function(_0xb05827){_0x260d4d[_0x4795('0x22')]=_0xb05827[_0x4795('0x29')]['id'];_0x4e3566(_0x260d4d);})[_0x4795('0xd')](function(_0x422f71){logger['error']('['+[_0x889bbf[_0x4795('0xf')]()]+']',_0x422f71[_0x4795('0x10')]);_0x3e4407(_0x422f71[_0x4795('0x10')]);});});}function getTicket(_0x44bcd4,_0x5db306,_0x12ec94,_0x6242b0,_0x5305b6){return function(_0x5ca0d9){logger['info'](_0x4795('0x2a'));return new Promise(function(_0x2d2653,_0x4c3848){var _0x168cda=moment();var _0x33e044={'method':_0x4795('0x26'),'uri':_0x12ec94+'/api/tasks','body':{'title':intUtil[_0x4795('0x2b')](_0x6242b0[_0x4795('0x2c')],_0x5305b6,'\x20'),'description':intUtil[_0x4795('0x2b')](_0x6242b0[_0x4795('0x2d')],_0x5305b6,'\x0a'),'owner_id':_0x5ca0d9[_0x4795('0x17')],'creater_id':_0x5ca0d9[_0x4795('0xb')],'targetable_id':_0x5ca0d9[_0x4795('0x22')],'targetable_type':_0x4795('0x2e'),'created_at':_0x168cda[_0x4795('0x1e')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x168cda['add'](0x1e,'m')[_0x4795('0x1e')](_0x4795('0x27'))},'json':!![]};_0x33e044[_0x4795('0x11')]=_0x5db306;return rp(_0x33e044)[_0x4795('0x9')](function(_0x32a3e4){_0x5ca0d9[_0x4795('0x2f')]=_0x32a3e4[_0x4795('0x30')]['id'];logger['info'](_0x4795('0x31'),_0x5ca0d9[_0x4795('0x2f')]);_0x2d2653(_0x5ca0d9);})[_0x4795('0xd')](function(_0x2af2de){logger[_0x4795('0xe')]('['+[_0x44bcd4[_0x4795('0xf')]()]+']',_0x2af2de[_0x4795('0x10')]);_0x4c3848(_0x2af2de[_0x4795('0x10')]);});});};}function emit(_0x200903,_0x5f0658,_0x66f96c){var _0x2b13f0={'uri':_0x200903+'/contacts/'+_0x66f96c};io['to'](util[_0x4795('0x1e')](_0x4795('0x32'),_0x5f0658))[_0x4795('0x33')]('trigger:browser:url',_0x2b13f0);}exports['cs']=function(_0x2da8da,_0x5cc296,_0x3a17ef,_0x5eecc7,_0x109e46,_0x62d227,_0x16c75e,_0x252923){var _0x3379b2={};var _0x408395={'Authorization':'Token\x20token='+_0x62d227[_0x4795('0x34')]};_0x62d227[_0x4795('0x35')]=intUtil[_0x4795('0x36')](_0x62d227[_0x4795('0x35')]);_0x62d227[_0x4795('0x37')]=intUtil['stripTrailingSlash'](_0x62d227[_0x4795('0x37')]);var _0x3334a9=_0x62d227[_0x4795('0x35')];_0x3379b2[_0x4795('0x1a')]=_0x62d227[_0x4795('0x38')];_0x3379b2[_0x4795('0x20')]=_0x252923[_0x4795('0x39')]()===_0x4795('0x3a')?_0x5cc296[_0x4795('0x3b')]:_0x5cc296[_0x4795('0x3c')];_0x3379b2[_0x4795('0x3d')]=_0x252923==='queue'||_0x252923==='unmanaged'?_0x4795('0x3e'):'outbound';if(_0x5eecc7){_0x3379b2[_0x4795('0x14')]=_0x5eecc7[_0x4795('0xa')];}var _0x5aedd5=util[_0x4795('0x1e')](_0x4795('0x3f'),_0x62d227[_0x4795('0x37')],_0x5cc296[_0x4795('0x40')],md5(_0x5cc296[_0x4795('0x40')]));if(_0x109e46&&_0x109e46[_0x4795('0x41')]){logger[_0x4795('0x12')](_0x4795('0x42'),_0x4795('0x43'));_0x5cc296[_0x4795('0x44')]=_0x5aedd5;}else if(_0x16c75e&&_0x16c75e[_0x4795('0x45')]&&_0x16c75e[_0x4795('0x45')]!==_0x4795('0x46')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5cc296[_0x4795('0x44')]=_0x5aedd5;}else{_0x5cc296[_0x4795('0x44')]='';}return getAdminId(_0x3379b2,_0x252923,_0x408395,_0x3334a9)[_0x4795('0x9')](getUser(_0x252923,_0x408395,_0x3334a9))[_0x4795('0x9')](getEndUser(_0x252923,_0x408395,_0x3334a9))['then'](getTicket(_0x252923,_0x408395,_0x3334a9,_0x3a17ef,_0x5cc296))[_0x4795('0x9')](function(_0x467166){logger[_0x4795('0x12')](util[_0x4795('0x1e')](_0x4795('0x47'),_0x467166[_0x4795('0x2f')]));if(_0x252923!=='unmanaged'){logger[_0x4795('0x12')]('['+[_0x252923[_0x4795('0xf')]()]+']',_0x4795('0x48'));emit(_0x3334a9,_0x5eecc7['name'],_0x467166[_0x4795('0x22')]);}})[_0x4795('0xd')](function(_0x20faff){logger['error']('['+[_0x252923[_0x4795('0xf')]()]+_0x4795('0x49'),util[_0x4795('0x4a')](_0x20faff,{'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 05492de..d9fde75 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 _0xba7e=['unmanaged','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','lodash','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./dynamics365','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','data3','queue','outbound','log','EVENT\x20UNKNOWN'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0xba7e,0x13c));var _0xeba7=function(_0x379ca9,_0x268f7f){_0x379ca9=_0x379ca9-0x0;var _0x8c3467=_0xba7e[_0x379ca9];return _0x8c3467;};'use strict';var _=require(_0xeba7('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0xeba7('0x1'));var sugarcrm=require(_0xeba7('0x2'));var freshdesk=require(_0xeba7('0x3'));var zoho=require('./zoho');var desk=require(_0xeba7('0x4'));var vtiger=require(_0xeba7('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0xeba7('0x6'));var freshsales=require('./freshsales');var integrations=['zendesk','salesforce',_0xeba7('0x7'),_0xeba7('0x8'),_0xeba7('0x9'),_0xeba7('0xa'),_0xeba7('0xb'),_0xeba7('0xc'),'freshsales',_0xeba7('0xd')];exports[_0xeba7('0xe')]=function(_0x5caff2,_0x24987a,_0x47233c,_0x21aedf,_0x582460,_0x3d206e){if(_0x47233c){if(_[_0xeba7('0xf')](integrations,_0x5caff2[_0xeba7('0x10')][_0xeba7('0x11')]())){try{var _0x37b5de=null;var _0x9154a='';var _0x32ad0a=_0x47233c[_0x5caff2[_0xeba7('0x10')][_0xeba7('0x11')]()];if(_0x32ad0a){var _0x4b4547=_0x32ad0a[_0x5caff2[_0xeba7('0x12')]];if(_0x4b4547){var _0x31b8b5=_[_0xeba7('0x13')](_0x4b4547['Configurations'],{'id':parseInt(_0x5caff2[_0xeba7('0x14')],0xa)});if(_0x31b8b5){if(_0x21aedf){if(_0x582460&&_0x24987a[_0xeba7('0x15')]){_0x9154a=_0xeba7('0x15');}else if(_0x24987a['routeId']){_0x9154a=_0xeba7('0x16');}else{console[_0xeba7('0x17')](_0xeba7('0x18'),_0x24987a);}}else{_0x9154a=_0xeba7('0x19');}switch(_0x5caff2['data1'][_0xeba7('0x11')]()){case'zendesk':zendesk[_0x9154a](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e);break;case'salesforce':salesforce[_0x9154a](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e);break;case'sugarcrm':sugarcrm[_0x9154a](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e);break;case _0xeba7('0x8'):freshdesk[_0x9154a](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e);break;case _0xeba7('0x9'):zoho[_0x9154a](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e);break;case _0xeba7('0xa'):desk[_0x9154a](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e);break;case _0xeba7('0xb'):vtiger[_0x9154a](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e);break;case'freshsales':freshsales['cs'](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e,_0x9154a);break;case _0xeba7('0xd'):servicenow['cs'](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e,_0x9154a);break;case _0xeba7('0xc'):dynamics365['cs'](_0x5caff2,_0x24987a,_0x31b8b5,_0x21aedf,_0x582460,_0x4b4547,_0x3d206e,_0x9154a);break;default:console[_0xeba7('0x17')](_0xeba7('0x1a'));}}else{_0x37b5de=require(_0xeba7('0x1b'))(_0x5caff2[_0xeba7('0x10')][_0xeba7('0x11')]());_0x37b5de[_0xeba7('0x1c')](_0xeba7('0x1d'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x5caff2['data1'][_0xeba7('0x11')](),_0x5caff2[_0xeba7('0x14')]));}}else{_0x37b5de=require(_0xeba7('0x1b'))(_0x5caff2[_0xeba7('0x10')][_0xeba7('0x11')]());_0x37b5de[_0xeba7('0x1c')](_0xeba7('0x1d'),util[_0xeba7('0x1e')]('%s\x20account\x20#%s\x20not\x20found',_0x5caff2[_0xeba7('0x10')][_0xeba7('0x11')](),_0x5caff2['data2']));}}else{}}catch(_0x2b163e){console[_0xeba7('0x1c')](_0x2b163e);}}}}; \ No newline at end of file +var _0xc18b=['%s\x20account\x20#%s\x20not\x20found','lodash','util','./sugarcrm','./freshdesk','./vtiger','./servicenow','./dynamics365','./freshsales','freshdesk','desk','vtiger','dynamics365','servicenow','exec','data1','toLowerCase','data2','routeId','log','EVENT\x20UNKNOWN','unmanaged','salesforce','sugarcrm','freshsales','unknown\x20integration','../../../../config/logger','error','%s\x20configuration\x20#%s\x20not\x20found','data3','[EXEC]','format'];(function(_0x3b5448,_0x103f5e){var _0x511fd1=function(_0x5cb6f3){while(--_0x5cb6f3){_0x3b5448['push'](_0x3b5448['shift']());}};_0x511fd1(++_0x103f5e);}(_0xc18b,0x1c1));var _0xbc18=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0xc18b[_0x1d5400];return _0x21d9fe;};'use strict';var _=require(_0xbc18('0x0'));var util=require(_0xbc18('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xbc18('0x2'));var freshdesk=require(_0xbc18('0x3'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0xbc18('0x4'));var servicenow=require(_0xbc18('0x5'));var dynamics365=require(_0xbc18('0x6'));var freshsales=require(_0xbc18('0x7'));var integrations=['zendesk','salesforce','sugarcrm',_0xbc18('0x8'),'zoho',_0xbc18('0x9'),_0xbc18('0xa'),_0xbc18('0xb'),'freshsales',_0xbc18('0xc')];exports[_0xbc18('0xd')]=function(_0x4252df,_0x389a1f,_0x58a41a,_0x36785c,_0x10546b,_0x377354){if(_0x58a41a){if(_['includes'](integrations,_0x4252df[_0xbc18('0xe')][_0xbc18('0xf')]())){try{var _0x43de8d=null;var _0x9593c3='';var _0x170cac=_0x58a41a[_0x4252df[_0xbc18('0xe')][_0xbc18('0xf')]()];if(_0x170cac){var _0x50b801=_0x170cac[_0x4252df[_0xbc18('0x10')]];if(_0x50b801){var _0x436e0f=_['find'](_0x50b801['Configurations'],{'id':parseInt(_0x4252df['data3'],0xa)});if(_0x436e0f){if(_0x36785c){if(_0x10546b&&_0x389a1f['queue']){_0x9593c3='queue';}else if(_0x389a1f[_0xbc18('0x11')]){_0x9593c3='outbound';}else{console[_0xbc18('0x12')](_0xbc18('0x13'),_0x389a1f);}}else{_0x9593c3=_0xbc18('0x14');}switch(_0x4252df['data1'][_0xbc18('0xf')]()){case'zendesk':zendesk[_0x9593c3](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354);break;case _0xbc18('0x15'):salesforce[_0x9593c3](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354);break;case _0xbc18('0x16'):sugarcrm[_0x9593c3](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354);break;case _0xbc18('0x8'):freshdesk[_0x9593c3](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354);break;case'zoho':zoho[_0x9593c3](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354);break;case _0xbc18('0x9'):desk[_0x9593c3](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354);break;case _0xbc18('0xa'):vtiger[_0x9593c3](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354);break;case _0xbc18('0x17'):freshsales['cs'](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354,_0x9593c3);break;case _0xbc18('0xc'):servicenow['cs'](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354,_0x9593c3);break;case _0xbc18('0xb'):dynamics365['cs'](_0x4252df,_0x389a1f,_0x436e0f,_0x36785c,_0x10546b,_0x50b801,_0x377354,_0x9593c3);break;default:console['log'](_0xbc18('0x18'));}}else{_0x43de8d=require(_0xbc18('0x19'))(_0x4252df[_0xbc18('0xe')][_0xbc18('0xf')]());_0x43de8d[_0xbc18('0x1a')]('[EXEC]',util['format'](_0xbc18('0x1b'),_0x4252df[_0xbc18('0xe')]['toLowerCase'](),_0x4252df[_0xbc18('0x1c')]));}}else{_0x43de8d=require(_0xbc18('0x19'))(_0x4252df[_0xbc18('0xe')][_0xbc18('0xf')]());_0x43de8d[_0xbc18('0x1a')](_0xbc18('0x1d'),util[_0xbc18('0x1e')](_0xbc18('0x1f'),_0x4252df[_0xbc18('0xe')][_0xbc18('0xf')](),_0x4252df[_0xbc18('0x10')]));}}else{}}catch(_0x357575){console[_0xbc18('0x1a')](_0x357575);}}}}; \ 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 e44d8f0..eb28e0e 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 _0x758d=['WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','sobject','isNil','User','find','length','Email','Name','identity','then','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','execute','additionalSearchLead','$or','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.','','Caller\x20-\x20%s','LastName','Company','No\x20Company','format','upperFirst','create','forEach','string','picklist','idField','content','variableName','toString','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[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','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead'];(function(_0x2840d2,_0x5a85ad){var _0x10d46f=function(_0x51d962){while(--_0x51d962){_0x2840d2['push'](_0x2840d2['shift']());}};_0x10d46f(++_0x5a85ad);}(_0x758d,0x6a));var _0xd758=function(_0x6c6cf5,_0x23ae92){_0x6c6cf5=_0x6c6cf5-0x0;var _0x40a646=_0x758d[_0x6c6cf5];return _0x40a646;};'use strict';var _=require('lodash');var rp=require(_0xd758('0x0'));var moment=require(_0xd758('0x1'));var BPromise=require(_0xd758('0x2'));var md5=require('md5');var jsforce=require(_0xd758('0x3'));var util=require(_0xd758('0x4'));var Redis=require(_0xd758('0x5'));var intUtil=require('./util');var config=require(_0xd758('0x6'));var logger=require(_0xd758('0x7'))(_0xd758('0x8'));config['redis']=_['defaults'](config[_0xd758('0x9')],{'host':_0xd758('0xa'),'port':0x18eb});var io=require(_0xd758('0xb'))(new Redis(config[_0xd758('0x9')]));function emit(_0x5518a0,_0x52d8f3,_0xd9132b){io['to'](_0x5518a0)[_0xd758('0xc')](_0x52d8f3,_0xd9132b);}function getTicket(_0x2dcd58,_0x4a7232,_0x12b4bf,_0x1a069f,_0x129023,_0x4c81ee,_0x3013e4,_0x43b80f){var _0x331309=Object[_0xd758('0xd')]({},{'OwnerId':_0x4a7232['id'],'Subject':intUtil[_0xd758('0xe')](_0x1a069f['Subjects'],_0x129023,'\x20'),'Description':intUtil[_0xd758('0xe')](_0x1a069f[_0xd758('0xf')],_0x129023,'\x0a')},getCustomFields(_0x4c81ee,_0x129023));if(_0x12b4bf){if(_0x1a069f[_0xd758('0x10')]===_0xd758('0x11')){_0x331309['ActivityDate']=moment[_0xd758('0x12')]();_0x331309[_0xd758('0x13')]=![];_0x331309[_0xd758('0x14')]=![];if(_0x12b4bf[_0xd758('0x15')]===_0xd758('0x16')||_0x12b4bf[_0xd758('0x15')]===_0xd758('0x17')){_0x331309[_0xd758('0x18')]=_0x12b4bf['id'];}else if(_0x12b4bf['endUserType']===_0xd758('0x19')){_0x331309[_0xd758('0x1a')]=_0x12b4bf['id'];}}else if(_0x1a069f[_0xd758('0x10')]===_0xd758('0x1b')){if(_0x12b4bf[_0xd758('0x15')]==='contact'){_0x331309[_0xd758('0x1c')]=_0x12b4bf['id'];}else if(_0x12b4bf['endUserType']===_0xd758('0x19')){_0x331309[_0xd758('0x1d')]=_0x12b4bf['id'];}else if(_0x12b4bf['endUserType']==='lead'&&_0x1a069f[_0xd758('0x1e')]){_0x331309[_0x1a069f[_0xd758('0x1e')]]=_0x12b4bf['id'];}else{logger[_0xd758('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x3013e4[_0xd758('0x20')](_0x1a069f[_0xd758('0x10')])['create'](_0x331309);}function getUser(_0x26a930,_0x531502,_0x1d8acd){if(!_[_0xd758('0x21')](_0x531502)&&intUtil['validateEmail'](_0x531502)){var _0x9aeeb0={'Email':_0x531502};var _0x5b2a0d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1d8acd['sobject'](_0xd758('0x22'))[_0xd758('0x23')](_0x9aeeb0,_0x5b2a0d)['execute']()['then'](function(_0x79227a){if(_0x79227a[_0xd758('0x24')]){var _0x437e02=_['find'](_0x79227a,function(_0x257650){return _0x257650[_0xd758('0x25')]===_0x531502;});if(_0x437e02){logger['info']('Agent\x20%s\x20found.',_0x531502);return BPromise['resolve']({'id':_0x437e02['Id'],'name':_0x437e02[_0xd758('0x26')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x531502);return _0x1d8acd[_0xd758('0x27')]()[_0xd758('0x28')](function(_0x3e4cff){return BPromise[_0xd758('0x29')]({'id':_0x3e4cff[_0xd758('0x2a')],'name':_0x3e4cff[_0xd758('0x2b')]});});}});}else{logger[_0xd758('0x1f')](_0xd758('0x2c'),_0x531502);return _0x1d8acd[_0xd758('0x27')]()[_0xd758('0x28')](function(_0x4b205f){return BPromise[_0xd758('0x29')]({'id':_0x4b205f[_0xd758('0x2a')],'name':_0x4b205f['display_name']});});}}function getEndUser(_0x430fae,_0x92899d,_0x5e95ba,_0x4590c7,_0x34f1bb){var _0x420e5e={'$or':{'Phone':_0x4590c7}};var _0x45f5f4={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xd758('0x29')]()[_0xd758('0x28')](function(){logger[_0xd758('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x4590c7,_0x92899d[_0xd758('0x2d')]);switch(_0x92899d[_0xd758('0x2d')]){case _0xd758('0x2e'):var _0xfd2f0=_[_0xd758('0x2f')](_0x420e5e);if(_0x92899d['additionalSearchContact']){var _0x2f114e={};_0x2f114e[_0x92899d[_0xd758('0x30')]]=_0x4590c7;_[_0xd758('0x31')](_0xfd2f0['$or'],_0x2f114e);}return _0x34f1bb[_0xd758('0x20')](_0xd758('0x32'))['find'](_0xfd2f0,_0x45f5f4)[_0xd758('0x33')]()[_0xd758('0x28')](function(_0x24a1d9){if(_0x24a1d9&&_0x24a1d9[_0xd758('0x24')]){return _0x24a1d9;}else{var _0x50a41c=_['cloneDeep'](_0x420e5e);if(_0x92899d[_0xd758('0x34')]){var _0x2c96bb={};_0x2c96bb[_0x92899d['additionalSearchLead']]=_0x4590c7;_['merge'](_0x50a41c[_0xd758('0x35')],_0x2c96bb);}return _0x34f1bb[_0xd758('0x20')](_0xd758('0x36'))['find'](_0x50a41c,_0x45f5f4);}});case'account_contact_lead':var _0x2cfadb=_[_0xd758('0x2f')](_0x420e5e);if(_0x92899d[_0xd758('0x37')]){var _0x2f114e={};_0x2f114e[_0x92899d['additionalSearchAccount']]=_0x4590c7;_[_0xd758('0x31')](_0x2cfadb['$or'],_0x2f114e);}return _0x34f1bb[_0xd758('0x20')]('Account')[_0xd758('0x23')](_0x2cfadb,_0x45f5f4)[_0xd758('0x33')]()[_0xd758('0x28')](function(_0x59cfc0){if(_0x59cfc0&&_0x59cfc0[_0xd758('0x24')]){return _0x59cfc0;}else{var _0x16a91c=_[_0xd758('0x2f')](_0x420e5e);if(_0x92899d[_0xd758('0x30')]){var _0x75110f={};_0x75110f[_0x92899d[_0xd758('0x30')]]=_0x4590c7;_[_0xd758('0x31')](_0x16a91c[_0xd758('0x35')],_0x75110f);}return _0x34f1bb[_0xd758('0x20')](_0xd758('0x32'))[_0xd758('0x23')](_0x16a91c,_0x45f5f4)[_0xd758('0x28')](function(_0x2bd859){if(_0x2bd859&&_0x2bd859[_0xd758('0x24')]){return _0x2bd859;}else{var _0x281f1c=_['cloneDeep'](_0x420e5e);if(_0x92899d[_0xd758('0x34')]){var _0x235d59={};_0x235d59[_0x92899d[_0xd758('0x34')]]=_0x4590c7;_[_0xd758('0x31')](_0x281f1c[_0xd758('0x35')],_0x235d59);}return _0x34f1bb[_0xd758('0x20')](_0xd758('0x36'))['find'](_0x281f1c,_0x45f5f4);}});}});case _0xd758('0x16'):var _0xfd2f0=_[_0xd758('0x2f')](_0x420e5e);if(_0x92899d['additionalSearchContact']){var _0x2f114e={};_0x2f114e[_0x92899d['additionalSearchContact']]=_0x4590c7;_[_0xd758('0x31')](_0xfd2f0[_0xd758('0x35')],_0x2f114e);}return _0x34f1bb[_0xd758('0x20')]('Contact')[_0xd758('0x23')](_0xfd2f0,_0x45f5f4)[_0xd758('0x33')]();case _0xd758('0x17'):var _0x1703a3=_[_0xd758('0x2f')](_0x420e5e);if(_0x92899d[_0xd758('0x34')]){var _0x2f114e={};_0x2f114e[_0x92899d[_0xd758('0x34')]]=_0x4590c7;_['merge'](_0x1703a3[_0xd758('0x35')],_0x2f114e);}return _0x34f1bb[_0xd758('0x20')]('Lead')['find'](_0x1703a3,_0x45f5f4);case'account':var _0x2cfadb=_[_0xd758('0x2f')](_0x420e5e);if(_0x92899d[_0xd758('0x37')]){var _0x2f114e={};_0x2f114e[_0x92899d[_0xd758('0x37')]]=_0x4590c7;_[_0xd758('0x31')](_0x2cfadb[_0xd758('0x35')],_0x2f114e);}return _0x34f1bb[_0xd758('0x20')](_0xd758('0x38'))[_0xd758('0x23')](_0x2cfadb,_0x45f5f4);default:return null;}})['then'](function(_0x5349ad){if(_0x5349ad&&_0x5349ad[_0xd758('0x24')]){var _0x5b5212=_[_0xd758('0x39')](_0x5349ad);if(_0x5b5212){return BPromise[_0xd758('0x29')]({'id':_0x5b5212['Id'],'name':_0x5b5212[_0xd758('0x26')],'phone':_0x5b5212[_0xd758('0x3a')],'endUserType':_0x5b5212[_0xd758('0x3b')][_0xd758('0x3c')][_0xd758('0x3d')]()});}}})[_0xd758('0x28')](function(_0x2e6d16){if(_0x2e6d16){logger['info'](_0xd758('0x3e'),_0x2e6d16[_0xd758('0x15')],_0x4590c7);return BPromise[_0xd758('0x29')](_0x2e6d16);}else{logger[_0xd758('0x1f')](_0xd758('0x3f'),_0x4590c7);var _0x4954af={'Phone':_0x4590c7};if(_0x92899d[_0xd758('0x40')]){if(_0x92899d[_0xd758('0x40')]===_0xd758('0x16')){logger['info'](_0xd758('0x41'),_0x4590c7,_0x92899d['moduleCreate']);_0x4954af['LastName']=_0x5e95ba!==_0xd758('0x42')?_0x5e95ba:util['format'](_0xd758('0x43'),_0x4590c7);}else if(_0x92899d['moduleCreate']==='lead'){logger[_0xd758('0x1f')](_0xd758('0x41'),_0x4590c7,_0x92899d['moduleCreate']);_0x4954af[_0xd758('0x44')]=_0x5e95ba!==_0xd758('0x42')?_0x5e95ba:util['format']('Caller\x20-\x20%s',_0x4590c7);_0x4954af[_0xd758('0x45')]=_0xd758('0x46');}else if(_0x92899d[_0xd758('0x40')]===_0xd758('0x19')){logger[_0xd758('0x1f')](_0xd758('0x41'),_0x4590c7,_0x92899d[_0xd758('0x40')]);_0x4954af[_0xd758('0x26')]=_0x5e95ba!==''?_0x5e95ba:util[_0xd758('0x47')]('Caller\x20-\x20%s',_0x4590c7);}else{return null;}}return _0x34f1bb[_0xd758('0x20')](_[_0xd758('0x48')](_0x92899d[_0xd758('0x40')]))[_0xd758('0x49')](_0x4954af)['then'](function(_0x2441b5){return BPromise[_0xd758('0x29')]({'id':_0x2441b5['id'],'endUserType':_0x92899d[_0xd758('0x40')]});});}});}function getCustomFields(_0x5df921,_0x371ab5){var _0x61de2d={};if(_0x5df921[_0xd758('0x24')]>0x0){_[_0xd758('0x4a')](_0x5df921,function(_0x1b2c19){if(_['includes']([_0xd758('0x4b'),_0xd758('0x4c')],_0x1b2c19[_0xd758('0x3c')])&&_0x1b2c19[_0xd758('0x4d')]){_0x61de2d[_0x1b2c19['idField']]=_0x1b2c19[_0xd758('0x4e')]['toString']();}else if(_0x1b2c19['type']==='variable'&&_0x1b2c19[_0xd758('0x4f')]&&_0x1b2c19[_0xd758('0x4d')]){_0x371ab5[_0x1b2c19['variableName']]&&(_0x61de2d[_0x1b2c19[_0xd758('0x4d')]]=_0x371ab5[_0x1b2c19[_0xd758('0x4f')]][_0xd758('0x50')]());}else if(_0x1b2c19[_0xd758('0x3c')]===_0xd758('0x51')&&_0x1b2c19[_0xd758('0x52')]&&_0x1b2c19['Variable'][_0xd758('0x53')]&&_0x1b2c19[_0xd758('0x4d')]){_0x371ab5[_0x1b2c19['Variable']['name'][_0xd758('0x3d')]()]&&(_0x61de2d[_0x1b2c19[_0xd758('0x4d')]]=_0x371ab5[_0x1b2c19[_0xd758('0x52')][_0xd758('0x53')][_0xd758('0x3d')]()][_0xd758('0x50')]());}});}return _0x61de2d;}function getConnection(_0x159a47){var _0x44556c=_0x159a47['password'][_0xd758('0x54')](_0x159a47[_0xd758('0x55')]);var _0x425f05=new jsforce[(_0xd758('0x56'))]({'oauth2':{'loginUrl':_0x159a47[_0xd758('0x57')]||_0xd758('0x58'),'clientId':_0x159a47[_0xd758('0x59')],'clientSecret':_0x159a47[_0xd758('0x5a')]}});return _0x425f05[_0xd758('0x5b')](_0x159a47[_0xd758('0x5c')],_0x44556c)['then'](function(){logger[_0xd758('0x1f')](_0xd758('0x5d'));return _0x425f05;});}exports[_0xd758('0x5e')]=function(_0x1dc583,_0x37bb13,_0x5a9799,_0x5cf41a,_0x1c9c71,_0x2866c4){var _0x301b23,_0x3348bd,_0x31b9bb,_0x5368ec;_0x2866c4[_0xd758('0x5f')]=intUtil['stripTrailingSlash'](_0x2866c4[_0xd758('0x5f')]);_0x2866c4[_0xd758('0x57')]=intUtil[_0xd758('0x60')](_0x2866c4[_0xd758('0x57')]);if(_0x1c9c71&&_0x1c9c71[_0xd758('0x61')]){logger[_0xd758('0x1f')]('[QUEUE]','Recording\x20is\x20enabled!');_0x37bb13[_0xd758('0x62')]=util[_0xd758('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2866c4[_0xd758('0x5f')],_0x37bb13[_0xd758('0x63')],md5(_0x37bb13[_0xd758('0x63')]));}else{_0x37bb13['recordingURL']='';}return getConnection(_0x2866c4)[_0xd758('0x28')](function(_0x5913dc){_0x5368ec=_0x5913dc;return getUser(_0x2866c4,_0x5cf41a[_0xd758('0x64')],_0x5368ec);})[_0xd758('0x28')](function(_0x3a78a6){_0x301b23=_0x3a78a6;return getEndUser(_0x2866c4,_0x5a9799,_0x37bb13[_0xd758('0x65')],_0x37bb13[_0xd758('0x66')],_0x5368ec);})[_0xd758('0x28')](function(_0x10cdc7){_0x3348bd=_0x10cdc7;return getTicket(_0x2866c4,_0x301b23,_0x3348bd,_0x5a9799,_0x37bb13,_0x5a9799[_0xd758('0x67')],_0x5368ec,_0xd758('0x5e'));})[_0xd758('0x28')](function(_0x2e746d){_0x31b9bb=_0x2e746d;logger[_0xd758('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x31b9bb['id']);logger[_0xd758('0x1f')](_0xd758('0x68'),_0x31b9bb['id'],_0x5cf41a[_0xd758('0x53')],_0x2866c4[_0xd758('0x3c')]);switch(_0x2866c4[_0xd758('0x3c')]){case _0xd758('0x69'):emit(util['format'](_0xd758('0x6a'),_0x5cf41a[_0xd758('0x53')]),_0xd758('0x6b'),{'recordId':_0x31b9bb['id']});break;case _0xd758('0x6c'):emit(util[_0xd758('0x47')](_0xd758('0x6a'),_0x5cf41a[_0xd758('0x53')]),_0xd758('0x6d'),{'uri':util[_0xd758('0x47')](_0xd758('0x6e'),_0x5368ec['instanceUrl'],_0x31b9bb['id'])});break;default:logger['error'](_0xd758('0x6f'));}})[_0xd758('0x70')](function(_0xca05ed){logger[_0xd758('0x71')](_0xd758('0x72'),_0xca05ed);});};exports[_0xd758('0x73')]=function(_0x13d29d,_0x457fb3,_0x25a35b,_0x574e0e,_0xb7b044,_0x2fa177,_0x3db175){var _0x42b939,_0x23fda9,_0x13aea8,_0x37b1ba;_0x2fa177['serverUrl']=intUtil[_0xd758('0x60')](_0x2fa177[_0xd758('0x5f')]);_0x2fa177[_0xd758('0x57')]=intUtil['stripTrailingSlash'](_0x2fa177[_0xd758('0x57')]);if(_0x3db175&&_0x3db175[_0xd758('0x74')]&&_0x3db175[_0xd758('0x74')]!==_0xd758('0x75')){logger[_0xd758('0x1f')](_0xd758('0x76'),_0xd758('0x77'));_0x457fb3[_0xd758('0x62')]=util[_0xd758('0x47')](_0xd758('0x78'),_0x2fa177['serverUrl'],_0x457fb3[_0xd758('0x63')],md5(_0x457fb3[_0xd758('0x63')]));}return getConnection(_0x2fa177)['then'](function(_0x307967){_0x37b1ba=_0x307967;return getUser(_0x2fa177,_0x574e0e['email'],_0x37b1ba);})[_0xd758('0x28')](function(_0x3d9779){_0x42b939=_0x3d9779;return getEndUser(_0x2fa177,_0x25a35b,_0x457fb3[_0xd758('0x79')],_0x457fb3[_0xd758('0x7a')],_0x37b1ba);})[_0xd758('0x28')](function(_0x72f8d6){_0x23fda9=_0x72f8d6;return getTicket(_0x2fa177,_0x42b939,_0x23fda9,_0x25a35b,_0x457fb3,_0x25a35b['Fields'],_0x37b1ba,_0xd758('0x73'));})['then'](function(_0x18526b){_0x13aea8=_0x18526b;logger[_0xd758('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x13aea8['id']);logger['info'](_0xd758('0x7b'),_0x13aea8['id'],_0x574e0e['name'],_0x2fa177[_0xd758('0x3c')]);switch(_0x2fa177[_0xd758('0x3c')]){case _0xd758('0x69'):emit(util[_0xd758('0x47')]('user:%s',_0x574e0e[_0xd758('0x53')]),_0xd758('0x6b'),{'recordId':_0x13aea8['id']});break;case _0xd758('0x6c'):emit(util[_0xd758('0x47')](_0xd758('0x6a'),_0x574e0e[_0xd758('0x53')]),_0xd758('0x6d'),{'uri':util[_0xd758('0x47')](_0xd758('0x6e'),_0x37b1ba[_0xd758('0x7c')],_0x13aea8['id'])});break;default:logger[_0xd758('0x71')](_0xd758('0x76'),_0xd758('0x7d'));}})[_0xd758('0x70')](function(_0x3d79d0){logger[_0xd758('0x71')]('[OUTBOUND]',_0x3d79d0);});};exports[_0xd758('0x7e')]=function(_0x2a0e3b,_0x13025a,_0x482d47,_0x2eb10a,_0x508f9c,_0x35028f){var _0x5de237,_0x2f9b43,_0x49ccd9,_0x3ab2e5;_0x35028f[_0xd758('0x5f')]=intUtil[_0xd758('0x60')](_0x35028f['serverUrl']);_0x35028f['remoteUri']=intUtil['stripTrailingSlash'](_0x35028f[_0xd758('0x57')]);if(_0x508f9c&&_0x508f9c[_0xd758('0x61')]){logger[_0xd758('0x1f')]('['+_0x13025a[_0xd758('0x7f')]['toUpperCase']()+']',_0xd758('0x77'));_0x13025a[_0xd758('0x62')]=util[_0xd758('0x47')](_0xd758('0x78'),_0x35028f[_0xd758('0x5f')],_0x13025a[_0xd758('0x63')],md5(_0x13025a[_0xd758('0x63')]));}else{_0x13025a[_0xd758('0x62')]='';}return getConnection(_0x35028f)[_0xd758('0x28')](function(_0x709419){_0x3ab2e5=_0x709419;if(!_[_0xd758('0x21')](_0x2eb10a)){return getUser(_0x35028f,_0x2eb10a[_0xd758('0x53')],_0x3ab2e5);}else{return getUser(_0x35028f,null,_0x3ab2e5);}})[_0xd758('0x28')](function(_0xc24e1e){_0x5de237=_0xc24e1e;return getEndUser(_0x35028f,_0x482d47,_0x13025a[_0xd758('0x65')],_0x13025a[_0xd758('0x66')],_0x3ab2e5);})['then'](function(_0x5eb9fd){_0x2f9b43=_0x5eb9fd;return getTicket(_0x35028f,_0x5de237,_0x2f9b43,_0x482d47,_0x13025a,_0x482d47['Fields'],_0x3ab2e5);})['then'](function(_0x1b835e){_0x49ccd9=_0x1b835e;logger['info']('['+_0x13025a[_0xd758('0x7f')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x49ccd9['id']);logger[_0xd758('0x1f')]('['+_0x13025a['lastevent'][_0xd758('0x80')]()+_0xd758('0x81'),_0x35028f[_0xd758('0x3c')]);})[_0xd758('0x70')](function(_0x3334ba){logger[_0xd758('0x71')]('['+_0x13025a[_0xd758('0x7f')][_0xd758('0x80')]()+']',_0x3334ba);});}; \ No newline at end of file +var _0x0df8=['ticketType','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','Case','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','User','find','execute','then','length','Email','resolve','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','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.','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/logger','salesforce','defaults','localhost','redis','assign','Subjects','Descriptions'];(function(_0x4af1b0,_0x2bd324){var _0x50f35f=function(_0x44d253){while(--_0x44d253){_0x4af1b0['push'](_0x4af1b0['shift']());}};_0x50f35f(++_0x2bd324);}(_0x0df8,0x173));var _0x80df=function(_0x36261a,_0x1fceb2){_0x36261a=_0x36261a-0x0;var _0x260c5a=_0x0df8[_0x36261a];return _0x260c5a;};'use strict';var _=require(_0x80df('0x0'));var rp=require(_0x80df('0x1'));var moment=require(_0x80df('0x2'));var BPromise=require(_0x80df('0x3'));var md5=require(_0x80df('0x4'));var jsforce=require(_0x80df('0x5'));var util=require(_0x80df('0x6'));var Redis=require(_0x80df('0x7'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x80df('0x8'))(_0x80df('0x9'));config['redis']=_[_0x80df('0xa')](config['redis'],{'host':_0x80df('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x80df('0xc')]));function emit(_0x53c117,_0xa7ce78,_0x37addf){io['to'](_0x53c117)['emit'](_0xa7ce78,_0x37addf);}function getTicket(_0x3a114a,_0x1a5875,_0x1319e3,_0x3e73f8,_0x4280bb,_0x299fe8,_0x5d74e4,_0x4e69c2){var _0x194adb=Object[_0x80df('0xd')]({},{'OwnerId':_0x1a5875['id'],'Subject':intUtil['getString'](_0x3e73f8[_0x80df('0xe')],_0x4280bb,'\x20'),'Description':intUtil['getString'](_0x3e73f8[_0x80df('0xf')],_0x4280bb,'\x0a')},getCustomFields(_0x299fe8,_0x4280bb));if(_0x1319e3){if(_0x3e73f8[_0x80df('0x10')]==='Task'){_0x194adb[_0x80df('0x11')]=moment[_0x80df('0x12')]();_0x194adb[_0x80df('0x13')]=![];_0x194adb['IsRecurrence']=![];if(_0x1319e3[_0x80df('0x14')]===_0x80df('0x15')||_0x1319e3[_0x80df('0x14')]===_0x80df('0x16')){_0x194adb[_0x80df('0x17')]=_0x1319e3['id'];}else if(_0x1319e3[_0x80df('0x14')]===_0x80df('0x18')){_0x194adb[_0x80df('0x19')]=_0x1319e3['id'];}}else if(_0x3e73f8[_0x80df('0x10')]===_0x80df('0x1a')){if(_0x1319e3[_0x80df('0x14')]===_0x80df('0x15')){_0x194adb['ContactId']=_0x1319e3['id'];}else if(_0x1319e3['endUserType']===_0x80df('0x18')){_0x194adb[_0x80df('0x1b')]=_0x1319e3['id'];}else if(_0x1319e3[_0x80df('0x14')]===_0x80df('0x16')&&_0x3e73f8['leadId']){_0x194adb[_0x3e73f8[_0x80df('0x1c')]]=_0x1319e3['id'];}else{logger['info'](_0x80df('0x1d'));}}}return _0x5d74e4[_0x80df('0x1e')](_0x3e73f8[_0x80df('0x10')])['create'](_0x194adb);}function getUser(_0x4e9b79,_0x138f77,_0x2e0b9b){if(!_[_0x80df('0x1f')](_0x138f77)&&intUtil['validateEmail'](_0x138f77)){var _0x5217c2={'Email':_0x138f77};var _0x40b6b9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2e0b9b[_0x80df('0x1e')](_0x80df('0x20'))[_0x80df('0x21')](_0x5217c2,_0x40b6b9)[_0x80df('0x22')]()[_0x80df('0x23')](function(_0x30851b){if(_0x30851b[_0x80df('0x24')]){var _0x19bf21=_[_0x80df('0x21')](_0x30851b,function(_0x7a8031){return _0x7a8031[_0x80df('0x25')]===_0x138f77;});if(_0x19bf21){logger['info']('Agent\x20%s\x20found.',_0x138f77);return BPromise[_0x80df('0x26')]({'id':_0x19bf21['Id'],'name':_0x19bf21['Name']});}}else{logger[_0x80df('0x27')](_0x80df('0x28'),_0x138f77);return _0x2e0b9b['identity']()[_0x80df('0x23')](function(_0x49448b){return BPromise['resolve']({'id':_0x49448b['user_id'],'name':_0x49448b['display_name']});});}});}else{logger[_0x80df('0x27')](_0x80df('0x28'),_0x138f77);return _0x2e0b9b[_0x80df('0x29')]()['then'](function(_0x16758b){return BPromise['resolve']({'id':_0x16758b[_0x80df('0x2a')],'name':_0x16758b[_0x80df('0x2b')]});});}}function getEndUser(_0x14cbb0,_0x125e03,_0x578d96,_0x22d108,_0x1bf4ed){var _0x352d27={'$or':{'Phone':_0x22d108}};var _0x39f795={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x80df('0x26')]()[_0x80df('0x23')](function(){logger[_0x80df('0x27')](_0x80df('0x2c'),_0x22d108,_0x125e03[_0x80df('0x2d')]);switch(_0x125e03[_0x80df('0x2d')]){case _0x80df('0x2e'):var _0x4f60c9=_[_0x80df('0x2f')](_0x352d27);if(_0x125e03['additionalSearchContact']){var _0x49efde={};_0x49efde[_0x125e03[_0x80df('0x30')]]=_0x22d108;_['merge'](_0x4f60c9[_0x80df('0x31')],_0x49efde);}return _0x1bf4ed[_0x80df('0x1e')](_0x80df('0x32'))[_0x80df('0x21')](_0x4f60c9,_0x39f795)['execute']()['then'](function(_0x10af50){if(_0x10af50&&_0x10af50['length']){return _0x10af50;}else{var _0x5b0174=_['cloneDeep'](_0x352d27);if(_0x125e03['additionalSearchLead']){var _0x4465e4={};_0x4465e4[_0x125e03[_0x80df('0x33')]]=_0x22d108;_[_0x80df('0x34')](_0x5b0174[_0x80df('0x31')],_0x4465e4);}return _0x1bf4ed['sobject'](_0x80df('0x35'))[_0x80df('0x21')](_0x5b0174,_0x39f795);}});case _0x80df('0x36'):var _0x22d343=_['cloneDeep'](_0x352d27);if(_0x125e03[_0x80df('0x37')]){var _0x49efde={};_0x49efde[_0x125e03[_0x80df('0x37')]]=_0x22d108;_[_0x80df('0x34')](_0x22d343[_0x80df('0x31')],_0x49efde);}return _0x1bf4ed['sobject'](_0x80df('0x38'))[_0x80df('0x21')](_0x22d343,_0x39f795)[_0x80df('0x22')]()[_0x80df('0x23')](function(_0x1703c2){if(_0x1703c2&&_0x1703c2[_0x80df('0x24')]){return _0x1703c2;}else{var _0x1ec408=_[_0x80df('0x2f')](_0x352d27);if(_0x125e03['additionalSearchContact']){var _0x810ba8={};_0x810ba8[_0x125e03[_0x80df('0x30')]]=_0x22d108;_[_0x80df('0x34')](_0x1ec408[_0x80df('0x31')],_0x810ba8);}return _0x1bf4ed[_0x80df('0x1e')](_0x80df('0x32'))[_0x80df('0x21')](_0x1ec408,_0x39f795)[_0x80df('0x23')](function(_0x21e6f0){if(_0x21e6f0&&_0x21e6f0['length']){return _0x21e6f0;}else{var _0x3e42d1=_['cloneDeep'](_0x352d27);if(_0x125e03['additionalSearchLead']){var _0x1fa130={};_0x1fa130[_0x125e03[_0x80df('0x33')]]=_0x22d108;_['merge'](_0x3e42d1[_0x80df('0x31')],_0x1fa130);}return _0x1bf4ed[_0x80df('0x1e')]('Lead')[_0x80df('0x21')](_0x3e42d1,_0x39f795);}});}});case'contact':var _0x4f60c9=_['cloneDeep'](_0x352d27);if(_0x125e03[_0x80df('0x30')]){var _0x49efde={};_0x49efde[_0x125e03['additionalSearchContact']]=_0x22d108;_['merge'](_0x4f60c9[_0x80df('0x31')],_0x49efde);}return _0x1bf4ed[_0x80df('0x1e')]('Contact')[_0x80df('0x21')](_0x4f60c9,_0x39f795)[_0x80df('0x22')]();case'lead':var _0x56e1c0=_[_0x80df('0x2f')](_0x352d27);if(_0x125e03[_0x80df('0x33')]){var _0x49efde={};_0x49efde[_0x125e03[_0x80df('0x33')]]=_0x22d108;_[_0x80df('0x34')](_0x56e1c0['$or'],_0x49efde);}return _0x1bf4ed[_0x80df('0x1e')]('Lead')['find'](_0x56e1c0,_0x39f795);case _0x80df('0x18'):var _0x22d343=_[_0x80df('0x2f')](_0x352d27);if(_0x125e03[_0x80df('0x37')]){var _0x49efde={};_0x49efde[_0x125e03[_0x80df('0x37')]]=_0x22d108;_[_0x80df('0x34')](_0x22d343['$or'],_0x49efde);}return _0x1bf4ed['sobject']('Account')[_0x80df('0x21')](_0x22d343,_0x39f795);default:return null;}})[_0x80df('0x23')](function(_0x431c44){if(_0x431c44&&_0x431c44[_0x80df('0x24')]){var _0x4cd1cc=_[_0x80df('0x39')](_0x431c44);if(_0x4cd1cc){return BPromise[_0x80df('0x26')]({'id':_0x4cd1cc['Id'],'name':_0x4cd1cc[_0x80df('0x3a')],'phone':_0x4cd1cc[_0x80df('0x3b')],'endUserType':_0x4cd1cc['attributes']['type']['toLowerCase']()});}}})['then'](function(_0x28d5ca){if(_0x28d5ca){logger[_0x80df('0x27')](_0x80df('0x3c'),_0x28d5ca[_0x80df('0x14')],_0x22d108);return BPromise[_0x80df('0x26')](_0x28d5ca);}else{logger[_0x80df('0x27')](_0x80df('0x3d'),_0x22d108);var _0x2d0388={'Phone':_0x22d108};if(_0x125e03['moduleCreate']){if(_0x125e03[_0x80df('0x3e')]===_0x80df('0x15')){logger[_0x80df('0x27')](_0x80df('0x3f'),_0x22d108,_0x125e03[_0x80df('0x3e')]);_0x2d0388['LastName']=_0x578d96!==_0x80df('0x40')?_0x578d96:util[_0x80df('0x41')]('Caller\x20-\x20%s',_0x22d108);}else if(_0x125e03[_0x80df('0x3e')]===_0x80df('0x16')){logger[_0x80df('0x27')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x22d108,_0x125e03['moduleCreate']);_0x2d0388['LastName']=_0x578d96!==_0x80df('0x40')?_0x578d96:util[_0x80df('0x41')](_0x80df('0x42'),_0x22d108);_0x2d0388[_0x80df('0x43')]=_0x80df('0x44');}else if(_0x125e03[_0x80df('0x3e')]===_0x80df('0x18')){logger[_0x80df('0x27')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x22d108,_0x125e03[_0x80df('0x3e')]);_0x2d0388[_0x80df('0x3a')]=_0x578d96!==''?_0x578d96:util[_0x80df('0x41')](_0x80df('0x42'),_0x22d108);}else{return null;}}return _0x1bf4ed['sobject'](_[_0x80df('0x45')](_0x125e03[_0x80df('0x3e')]))[_0x80df('0x46')](_0x2d0388)[_0x80df('0x23')](function(_0x4f1ef0){return BPromise[_0x80df('0x26')]({'id':_0x4f1ef0['id'],'endUserType':_0x125e03['moduleCreate']});});}});}function getCustomFields(_0xaee3fb,_0x16b53f){var _0x4b78c5={};if(_0xaee3fb[_0x80df('0x24')]>0x0){_[_0x80df('0x47')](_0xaee3fb,function(_0x333738){if(_[_0x80df('0x48')]([_0x80df('0x49'),_0x80df('0x4a')],_0x333738[_0x80df('0x4b')])&&_0x333738[_0x80df('0x4c')]){_0x4b78c5[_0x333738['idField']]=_0x333738['content'][_0x80df('0x4d')]();}else if(_0x333738[_0x80df('0x4b')]===_0x80df('0x4e')&&_0x333738[_0x80df('0x4f')]&&_0x333738[_0x80df('0x4c')]){_0x16b53f[_0x333738[_0x80df('0x4f')]]&&(_0x4b78c5[_0x333738[_0x80df('0x4c')]]=_0x16b53f[_0x333738[_0x80df('0x4f')]][_0x80df('0x4d')]());}else if(_0x333738[_0x80df('0x4b')]===_0x80df('0x50')&&_0x333738[_0x80df('0x51')]&&_0x333738[_0x80df('0x51')][_0x80df('0x52')]&&_0x333738[_0x80df('0x4c')]){_0x16b53f[_0x333738['Variable'][_0x80df('0x52')][_0x80df('0x53')]()]&&(_0x4b78c5[_0x333738[_0x80df('0x4c')]]=_0x16b53f[_0x333738[_0x80df('0x51')][_0x80df('0x52')]['toLowerCase']()]['toString']());}});}return _0x4b78c5;}function getConnection(_0xa7f572){var _0xa61ea9=_0xa7f572[_0x80df('0x54')][_0x80df('0x55')](_0xa7f572['securityToken']);var _0x15a619=new jsforce[(_0x80df('0x56'))]({'oauth2':{'loginUrl':_0xa7f572[_0x80df('0x57')]||_0x80df('0x58'),'clientId':_0xa7f572[_0x80df('0x59')],'clientSecret':_0xa7f572[_0x80df('0x5a')]}});return _0x15a619['login'](_0xa7f572[_0x80df('0x5b')],_0xa61ea9)[_0x80df('0x23')](function(){logger['info'](_0x80df('0x5c'));return _0x15a619;});}exports[_0x80df('0x5d')]=function(_0x6e116e,_0x4b0d02,_0x1c29a7,_0x1a698f,_0x4937f7,_0x37d9aa){var _0x34a34c,_0x1fdbdf,_0x36338f,_0x57eb5d;_0x37d9aa[_0x80df('0x5e')]=intUtil[_0x80df('0x5f')](_0x37d9aa[_0x80df('0x5e')]);_0x37d9aa[_0x80df('0x57')]=intUtil['stripTrailingSlash'](_0x37d9aa['remoteUri']);if(_0x4937f7&&_0x4937f7[_0x80df('0x60')]){logger['info']('[QUEUE]',_0x80df('0x61'));_0x4b0d02[_0x80df('0x62')]=util[_0x80df('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x37d9aa['serverUrl'],_0x4b0d02[_0x80df('0x63')],md5(_0x4b0d02[_0x80df('0x63')]));}else{_0x4b0d02[_0x80df('0x62')]='';}return getConnection(_0x37d9aa)[_0x80df('0x23')](function(_0x58522c){_0x57eb5d=_0x58522c;return getUser(_0x37d9aa,_0x1a698f['email'],_0x57eb5d);})[_0x80df('0x23')](function(_0x56c2a5){_0x34a34c=_0x56c2a5;return getEndUser(_0x37d9aa,_0x1c29a7,_0x4b0d02[_0x80df('0x64')],_0x4b0d02['calleridnum'],_0x57eb5d);})[_0x80df('0x23')](function(_0x158510){_0x1fdbdf=_0x158510;return getTicket(_0x37d9aa,_0x34a34c,_0x1fdbdf,_0x1c29a7,_0x4b0d02,_0x1c29a7[_0x80df('0x65')],_0x57eb5d,_0x80df('0x5d'));})['then'](function(_0x253f9b){_0x36338f=_0x253f9b;logger[_0x80df('0x27')](_0x80df('0x66'),_0x36338f['id']);logger[_0x80df('0x27')](_0x80df('0x67'),_0x36338f['id'],_0x1a698f[_0x80df('0x52')],_0x37d9aa[_0x80df('0x4b')]);switch(_0x37d9aa['type']){case _0x80df('0x68'):emit(util[_0x80df('0x41')](_0x80df('0x69'),_0x1a698f[_0x80df('0x52')]),_0x80df('0x6a'),{'recordId':_0x36338f['id']});break;case _0x80df('0x6b'):emit(util['format'](_0x80df('0x69'),_0x1a698f[_0x80df('0x52')]),_0x80df('0x6c'),{'uri':util[_0x80df('0x41')](_0x80df('0x6d'),_0x57eb5d[_0x80df('0x6e')],_0x36338f['id'])});break;default:logger[_0x80df('0x6f')](_0x80df('0x70'));}})['catch'](function(_0x4282a1){logger[_0x80df('0x6f')](_0x80df('0x71'),_0x4282a1);});};exports[_0x80df('0x72')]=function(_0x8c60b3,_0x4bc74a,_0x13598a,_0x4d3e0a,_0x428a71,_0x20d10a,_0x5d3774){var _0x2b660c,_0x5a1ebd,_0x39cecc,_0x57231d;_0x20d10a[_0x80df('0x5e')]=intUtil[_0x80df('0x5f')](_0x20d10a[_0x80df('0x5e')]);_0x20d10a[_0x80df('0x57')]=intUtil[_0x80df('0x5f')](_0x20d10a[_0x80df('0x57')]);if(_0x5d3774&&_0x5d3774[_0x80df('0x73')]&&_0x5d3774[_0x80df('0x73')]!==_0x80df('0x74')){logger[_0x80df('0x27')](_0x80df('0x75'),_0x80df('0x61'));_0x4bc74a[_0x80df('0x62')]=util[_0x80df('0x41')](_0x80df('0x76'),_0x20d10a[_0x80df('0x5e')],_0x4bc74a['uniqueid'],md5(_0x4bc74a['uniqueid']));}return getConnection(_0x20d10a)[_0x80df('0x23')](function(_0x1ad052){_0x57231d=_0x1ad052;return getUser(_0x20d10a,_0x4d3e0a['email'],_0x57231d);})[_0x80df('0x23')](function(_0x613404){_0x2b660c=_0x613404;return getEndUser(_0x20d10a,_0x13598a,_0x4bc74a[_0x80df('0x77')],_0x4bc74a[_0x80df('0x78')],_0x57231d);})[_0x80df('0x23')](function(_0x223625){_0x5a1ebd=_0x223625;return getTicket(_0x20d10a,_0x2b660c,_0x5a1ebd,_0x13598a,_0x4bc74a,_0x13598a[_0x80df('0x65')],_0x57231d,'outbound');})[_0x80df('0x23')](function(_0x1dcae7){_0x39cecc=_0x1dcae7;logger[_0x80df('0x27')](_0x80df('0x79'),_0x39cecc['id']);logger[_0x80df('0x27')](_0x80df('0x7a'),_0x39cecc['id'],_0x4d3e0a[_0x80df('0x52')],_0x20d10a[_0x80df('0x4b')]);switch(_0x20d10a['type']){case _0x80df('0x68'):emit(util[_0x80df('0x41')]('user:%s',_0x4d3e0a['name']),'trigger:salesforce:display',{'recordId':_0x39cecc['id']});break;case _0x80df('0x6b'):emit(util[_0x80df('0x41')](_0x80df('0x69'),_0x4d3e0a[_0x80df('0x52')]),_0x80df('0x6c'),{'uri':util[_0x80df('0x41')](_0x80df('0x6d'),_0x57231d['instanceUrl'],_0x39cecc['id'])});break;default:logger[_0x80df('0x6f')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x42338b){logger[_0x80df('0x6f')]('[OUTBOUND]',_0x42338b);});};exports[_0x80df('0x7b')]=function(_0xd8453,_0xdee02f,_0x3a6f60,_0x44db4c,_0x537e88,_0x45acfe){var _0xa955d,_0x24d1ec,_0x1c3143,_0x18b010;_0x45acfe[_0x80df('0x5e')]=intUtil['stripTrailingSlash'](_0x45acfe['serverUrl']);_0x45acfe[_0x80df('0x57')]=intUtil[_0x80df('0x5f')](_0x45acfe['remoteUri']);if(_0x537e88&&_0x537e88[_0x80df('0x60')]){logger[_0x80df('0x27')]('['+_0xdee02f[_0x80df('0x7c')][_0x80df('0x7d')]()+']','Recording\x20is\x20enabled!');_0xdee02f['recordingURL']=util['format'](_0x80df('0x76'),_0x45acfe[_0x80df('0x5e')],_0xdee02f[_0x80df('0x63')],md5(_0xdee02f[_0x80df('0x63')]));}else{_0xdee02f[_0x80df('0x62')]='';}return getConnection(_0x45acfe)[_0x80df('0x23')](function(_0x27846a){_0x18b010=_0x27846a;if(!_[_0x80df('0x1f')](_0x44db4c)){return getUser(_0x45acfe,_0x44db4c['name'],_0x18b010);}else{return getUser(_0x45acfe,null,_0x18b010);}})[_0x80df('0x23')](function(_0x35d09d){_0xa955d=_0x35d09d;return getEndUser(_0x45acfe,_0x3a6f60,_0xdee02f[_0x80df('0x64')],_0xdee02f[_0x80df('0x7e')],_0x18b010);})[_0x80df('0x23')](function(_0x5c9116){_0x24d1ec=_0x5c9116;return getTicket(_0x45acfe,_0xa955d,_0x24d1ec,_0x3a6f60,_0xdee02f,_0x3a6f60[_0x80df('0x65')],_0x18b010);})[_0x80df('0x23')](function(_0x424a40){_0x1c3143=_0x424a40;logger['info']('['+_0xdee02f['lastevent'][_0x80df('0x7d')]()+']\x20Ticket\x20%s\x20created.',_0x1c3143['id']);logger['info']('['+_0xdee02f['lastevent'][_0x80df('0x7d')]()+_0x80df('0x7f'),_0x45acfe[_0x80df('0x4b')]);})[_0x80df('0x80')](function(_0x562d91){logger[_0x80df('0x6f')]('['+_0xdee02f[_0x80df('0x7c')][_0x80df('0x7d')]()+']',_0x562d91);});}; \ 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 5b8f7e8..bdc8fc5 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 _0x27d8=['],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','nameField','customField','toLowerCase','content','includes','string','picklist','idField','toString','variableName','type','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active','userId','adminEmail'];(function(_0x524a7b,_0x4db051){var _0x3af95f=function(_0x3ceddf){while(--_0x3ceddf){_0x524a7b['push'](_0x524a7b['shift']());}};_0x3af95f(++_0x4db051);}(_0x27d8,0x1a5));var _0x827d=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x27d8[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x827d('0x0'));var Promise=require(_0x827d('0x1'));var rp=require(_0x827d('0x2'));var util=require(_0x827d('0x3'));var md5=require(_0x827d('0x4'));var Redis=require(_0x827d('0x5'));var intUtil=require(_0x827d('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x827d('0x7'));config[_0x827d('0x8')]=_['defaults'](config[_0x827d('0x8')],{'host':_0x827d('0x9'),'port':0x18eb});var io=require(_0x827d('0xa'))(new Redis(config[_0x827d('0x8')]));function getAdminUser(_0x44fa40,_0x402e94,_0x1db957,_0x5a508f,_0xb6c991,_0x14a404){return new Promise(function(_0x57e90,_0x4b2724){var _0x2b673a={'method':_0x827d('0xb'),'uri':_0x5a508f+_0x827d('0xc')+'&'+_0xb6c991+'&'+_0x14a404,'auth':_0x402e94,'json':!![]};return rp(_0x2b673a)['then'](function(_0x20212f){if(_0x20212f[_0x827d('0xd')][_0x827d('0xe')]>0x0){_0x1db957[_0x827d('0xf')]=_0x20212f['result'][0x0][_0x827d('0x10')];}logger[_0x827d('0x11')]('['+[_0x44fa40['toUpperCase']()]+_0x827d('0x12'),_0x1db957);_0x57e90(_0x1db957);})['catch'](function(_0x6c883b){logger[_0x827d('0x13')]('['+[_0x44fa40[_0x827d('0x14')]()]+']',_0x6c883b[_0x827d('0x15')]);_0x4b2724(_0x6c883b[_0x827d('0x15')]);});});}function getUser(_0x3104d3,_0x577c91,_0x43af9f,_0x3d65b4,_0x578b98){return function(_0x56666c){logger[_0x827d('0x11')]('['+[_0x3104d3[_0x827d('0x14')]()]+_0x827d('0x16'),_0x56666c);return new Promise(function(_0x507e67,_0x4ad799){if(intUtil[_0x827d('0x17')](_0x56666c[_0x827d('0x18')])){var _0x2be6c0={'method':_0x827d('0xb'),'uri':_0x43af9f+_0x827d('0x19')+_0x56666c[_0x827d('0x18')]+'&'+_0x3d65b4+'&'+_0x578b98,'auth':_0x577c91,'json':!![]};logger[_0x827d('0x11')]('['+[_0x3104d3[_0x827d('0x14')]()]+_0x827d('0x1a'),_0x2be6c0);return rp(_0x2be6c0)[_0x827d('0x1b')](function(_0x3f8107){logger['info']('['+[_0x3104d3[_0x827d('0x14')]()]+'],\x20getUser\x20entity',_0x3f8107);if(_0x3f8107['result'][_0x827d('0xe')]>0x0&&String(_0x3f8107[_0x827d('0xd')][0x0][_0x827d('0x1c')])==='true'){_0x56666c[_0x827d('0x1d')]=_0x3f8107[_0x827d('0xd')][0x0][_0x827d('0x10')];}else{_0x56666c[_0x827d('0x1d')]=_0x56666c['adminId'];_0x56666c[_0x827d('0x18')]=_0x56666c[_0x827d('0x1e')];}logger['info']('['+[_0x3104d3['toUpperCase']()]+_0x827d('0x1f'),_0x56666c);_0x507e67(_0x56666c);})[_0x827d('0x20')](function(_0xc1d6a3){logger[_0x827d('0x13')]('['+[_0x3104d3['toUpperCase']()]+']',_0xc1d6a3['message']);_0x4ad799(_0xc1d6a3['message']);});}else{logger[_0x827d('0x11')]('['+[_0x3104d3[_0x827d('0x14')]()]+_0x827d('0x21'));_0x56666c[_0x827d('0x1d')]=_0x56666c['adminId'];_0x56666c[_0x827d('0x18')]=_0x56666c[_0x827d('0x1e')];_0x507e67(_0x56666c);}});};}function createEndUser(_0x9df3d,_0x272068,_0x315174,_0x21449a,_0x4081e3){logger[_0x827d('0x11')]('['+[_0x9df3d[_0x827d('0x14')]()]+'],\x20createEndUser\x20input\x20crm',_0x315174);return new Promise(function(_0x37164a,_0x416ab8){var _0x3deaeb={'method':_0x827d('0x22'),'uri':_0x21449a+_0x827d('0x23')+_0x4081e3,'body':{'user_name':_0x315174[_0x827d('0x24')],'roles':'user','first_name':_0x315174[_0x827d('0x24')],'active':_0x827d('0x25'),'date_format':_0x827d('0x26'),'phone':_0x315174[_0x827d('0x24')]},'auth':_0x272068,'json':!![]};return rp(_0x3deaeb)[_0x827d('0x1b')](function(_0x40e79e){logger[_0x827d('0x11')]('['+[_0x9df3d[_0x827d('0x14')]()]+_0x827d('0x27'),_0x40e79e['result']);_0x315174[_0x827d('0x28')]=_0x40e79e[_0x827d('0xd')][_0x827d('0x10')];_0x37164a(_0x315174);})[_0x827d('0x20')](function(_0x52c66b){logger['error']('['+[_0x9df3d[_0x827d('0x14')]()]+']',_0x52c66b[_0x827d('0x15')]);_0x416ab8(_0x52c66b['message']);});});}function getEndUser(_0x47a9b2,_0x2cc1ed,_0x48de36,_0x15339d,_0x1f78d6){return function(_0x32e231){logger[_0x827d('0x11')]('['+[_0x47a9b2['toUpperCase']()]+_0x827d('0x29'),_0x32e231);return new Promise(function(_0x148600,_0xb1c4d6){var _0x33744b={'method':_0x827d('0xb'),'uri':_0x48de36+'sys_user?sysparm_query=phone%3D'+_0x32e231[_0x827d('0x24')]+'&'+_0x15339d+'&'+_0x1f78d6,'auth':_0x2cc1ed,'json':!![]};return rp(_0x33744b)[_0x827d('0x1b')](function(_0x10c536){if(_0x10c536[_0x827d('0xd')][_0x827d('0xe')]>0x0){_0x32e231[_0x827d('0x28')]=_0x10c536[_0x827d('0xd')][0x0][_0x827d('0x10')];logger['info']('['+[_0x47a9b2[_0x827d('0x14')]()]+_0x827d('0x2a'),_0x32e231);_0x148600(_0x32e231);}else{return createEndUser(_0x47a9b2,_0x2cc1ed,_0x32e231,_0x48de36,_0x15339d)[_0x827d('0x1b')](function(_0x2964b0){logger[_0x827d('0x11')]('['+[_0x47a9b2['toUpperCase']()]+_0x827d('0x2b'),_0x2964b0);_0x148600(_0x2964b0);});}})[_0x827d('0x20')](function(_0xb945df){logger['error']('['+[_0x47a9b2[_0x827d('0x14')]()]+']',_0xb945df[_0x827d('0x15')]);_0xb1c4d6(_0xb945df[_0x827d('0x15')]);});});};}function getCustomFields(_0x4baf83,_0xffb56e){var _0x3f5860={};if(_0x4baf83['length']>0x0){_['forEach'](_0x4baf83,function(_0x1dd63b){if(_['includes'](['string','picklist'],_0x1dd63b['type'])&&_0x1dd63b[_0x827d('0x2c')]&&!_0x1dd63b[_0x827d('0x2d')]){_0x3f5860[_0x1dd63b[_0x827d('0x2c')][_0x827d('0x2e')]()]=_0x1dd63b[_0x827d('0x2f')]['toString']();}else if(_[_0x827d('0x30')]([_0x827d('0x31'),_0x827d('0x32')],_0x1dd63b['type'])&&_0x1dd63b['idField']&&_0x1dd63b[_0x827d('0x2d')]){_0x3f5860[_0x1dd63b[_0x827d('0x33')][_0x827d('0x2e')]()]=_0x1dd63b[_0x827d('0x2f')][_0x827d('0x34')]();}else if(_0x1dd63b['type']==='variable'&&_0x1dd63b[_0x827d('0x35')]&&_0x1dd63b[_0x827d('0x33')]&&_0x1dd63b[_0x827d('0x2d')]){_0x3f5860[_0x1dd63b[_0x827d('0x33')][_0x827d('0x2e')]()]=_0xffb56e[_0x1dd63b[_0x827d('0x35')]][_0x827d('0x34')]();}else if(_0x1dd63b[_0x827d('0x36')]===_0x827d('0x37')&&_0x1dd63b['Variable']&&_0x1dd63b[_0x827d('0x38')][_0x827d('0x39')]&&_0x1dd63b[_0x827d('0x33')]&&_0x1dd63b[_0x827d('0x2d')]){_0x3f5860[_0x1dd63b[_0x827d('0x33')][_0x827d('0x2e')]()]=_0xffb56e[_0x1dd63b[_0x827d('0x38')][_0x827d('0x39')][_0x827d('0x2e')]()][_0x827d('0x34')]();}});}return _0x3f5860;}function getTicket(_0xdfba92,_0x5aafbb,_0x4c9513,_0x4112c7,_0x5c20ac,_0x3968bc){return function(_0x24b3a1){logger[_0x827d('0x11')]('['+[_0xdfba92['toUpperCase']()]+_0x827d('0x3a'),_0x24b3a1);return new Promise(function(_0x57f4c1,_0x5e7bd8){var _0x44b535=_0xdfba92[_0x827d('0x2e')]()===_0x827d('0x3b')?_0x24b3a1['userId']:_0x24b3a1[_0x827d('0x28')];var _0x2c0183={'method':'POST','uri':_0x4c9513+_0x827d('0x3c')+'?'+_0x3968bc,'body':Object[_0x827d('0x3d')]({},{'active':'true','caller_id':_0x44b535,'assigned_to':_0x24b3a1[_0x827d('0x1d')],'short_description':intUtil['getString'](_0x4112c7[_0x827d('0x3e')],_0x5c20ac,'\x20'),'description':intUtil[_0x827d('0x3f')](_0x4112c7[_0x827d('0x40')],_0x5c20ac,'\x0a')},getCustomFields(_0x4112c7[_0x827d('0x41')],_0x5c20ac)),'auth':_0x5aafbb,'json':!![]};return rp(_0x2c0183)[_0x827d('0x1b')](function(_0x1bebe7){logger[_0x827d('0x11')]('['+[_0xdfba92[_0x827d('0x14')]()]+_0x827d('0x42'),_0x1bebe7[_0x827d('0xd')]);_0x24b3a1[_0x827d('0x43')]=_0x1bebe7[_0x827d('0xd')][_0x827d('0x10')];_0x24b3a1[_0x827d('0x44')]=_0x1bebe7['result']['number'];logger[_0x827d('0x11')]('['+[_0xdfba92[_0x827d('0x14')]()]+_0x827d('0x45'),_0x24b3a1);_0x57f4c1(_0x24b3a1);})[_0x827d('0x20')](function(_0x547e7b){logger[_0x827d('0x13')]('['+[_0xdfba92['toUpperCase']()]+']',_0x547e7b[_0x827d('0x15')]);_0x5e7bd8(_0x547e7b[_0x827d('0x15')]);});});};}function createRemoteTag(_0x113efb,_0x29da84,_0x3bd0fb,_0x2465e3){return new Promise(function(_0xd510f7,_0x565222){var _0x5e2728={'method':_0x827d('0x22'),'uri':_0x3bd0fb+_0x827d('0x46')+'?'+_0x2465e3,'body':{'short_description':_0x113efb,'global':!![],'active':!![],'name':_0x113efb},'auth':_0x29da84,'json':!![]};return rp(_0x5e2728)[_0x827d('0x1b')](function(_0x353ae9){var _0x528006=_0x353ae9[_0x827d('0xd')]['sys_id'];_0xd510f7(_0x528006);});});}function getRemoteTag(_0x381dda,_0x4201c8,_0x503414,_0x146261,_0x14da49){return new Promise(function(_0x7c2274,_0x2b44fa){var _0x5d345c={'method':_0x827d('0xb'),'uri':_0x503414+_0x827d('0x46')+_0x827d('0x47')+_0x381dda+'&'+_0x146261,'auth':_0x4201c8,'json':!![]};return rp(_0x5d345c)['then'](function(_0x113fa0){if(_0x113fa0['result'][_0x827d('0xe')]>0x0){var _0x43cb8a=_0x113fa0[_0x827d('0xd')][0x0][_0x827d('0x10')];_0x7c2274(_0x43cb8a);}else{return createRemoteTag(_0x381dda,_0x4201c8,_0x503414,_0x146261)[_0x827d('0x1b')](function(_0x58edf7){_0x7c2274(_0x58edf7);});}});});}function assignTagToIncident(_0x1ae653,_0x44cc4d,_0x3bf551,_0xe8e168,_0x94c665){return new Promise(function(_0x59ebc7,_0x21352d){var _0x2a917f={'method':_0x827d('0x22'),'uri':_0x3bf551+_0x827d('0x48')+'?'+_0x94c665,'body':{'label':_0x1ae653,'table':'incident','id_type':_0x827d('0x49'),'table_key':_0xe8e168[_0x827d('0x43')],'title':_0x827d('0x4a')+_0xe8e168['ticketNumber'],'id_display':_0xe8e168['ticketNumber']},'auth':_0x44cc4d,'json':!![]};return rp(_0x2a917f)[_0x827d('0x1b')](function(_0x1b39d4){_0x59ebc7();})[_0x827d('0x20')](function(){_0x59ebc7();});});}function manageTags(_0x10e9db,_0x48adb1,_0x44ff31,_0x39befc,_0x2e852b,_0x228dab,_0x54d99c){return new Promise(function(_0x26e823,_0x5e096b){var _0x1f10e9=[];_0x48adb1['forEach'](function(_0x3aecd9){_0x1f10e9[_0x827d('0x4b')](getRemoteTag(_0x3aecd9,_0x44ff31,_0x39befc,_0x228dab,_0x54d99c));});return Promise[_0x827d('0x4c')](_0x1f10e9)['then'](function(_0x1abf68){if(_0x1abf68[_0x827d('0xe')]){logger[_0x827d('0x11')]('['+[_0x10e9db[_0x827d('0x14')]()]+_0x827d('0x4d'),_0x1abf68);var _0x275418=[];_0x1abf68[_0x827d('0x4e')](function(_0x4adafa){_0x275418[_0x827d('0x4b')](assignTagToIncident(_0x4adafa,_0x44ff31,_0x39befc,_0x2e852b,_0x228dab));});return Promise[_0x827d('0x4c')](_0x275418)[_0x827d('0x1b')](function(){_0x26e823();})[_0x827d('0x20')](function(){_0x26e823();});}else{_0x26e823();}});});}function getTags(_0x53a3ff,_0x584906,_0xd2d80d,_0x4b6fac,_0x13d585,_0x54c3d5){return function(_0x107c47){return new Promise(function(_0xa6e74d,_0x38622b){var _0x12fb78=[];var _0x152c72=_0x4b6fac[_0x827d('0x4f')];if(_0x152c72&&_0x152c72['length']>0x0){_0x12fb78=_[_0x827d('0x50')](_0x152c72,_0x827d('0x39'));}if(_0x12fb78[_0x827d('0xe')]>0x0){return manageTags(_0x53a3ff,_0x12fb78,_0x584906,_0xd2d80d,_0x107c47,_0x13d585,_0x54c3d5)[_0x827d('0x1b')](function(){_0xa6e74d(_0x107c47);});}else{_0xa6e74d(_0x107c47);}});};}function emit(_0x1bb321,_0x53ec21,_0x4a6a30){var _0x505699=_0x827d('0x51')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x827d('0x52')+_0x827d('0x53');var _0x5d4edd={'uri':_0x1bb321+_0x827d('0x54')+_0x4a6a30+_0x505699};io['to'](util[_0x827d('0x55')](_0x827d('0x56'),_0x53ec21))[_0x827d('0x57')](_0x827d('0x58'),_0x5d4edd);}exports['cs']=function(_0x3a6de7,_0x523da5,_0x1303b4,_0x30cf1f,_0x1a135b,_0x3fbf0c,_0x55ef00,_0x3873fd){var _0x50cc78={};var _0x4d8bf9={'user':_0x3fbf0c[_0x827d('0x59')],'pass':_0x3fbf0c[_0x827d('0x5a')]};var _0x47d517='sysparm_limit=1';var _0x4efb1f=_0x827d('0x5b');_0x3fbf0c[_0x827d('0x5c')]=intUtil['stripTrailingSlash'](_0x3fbf0c['remoteUri']);_0x3fbf0c[_0x827d('0x5d')]=intUtil[_0x827d('0x5e')](_0x3fbf0c[_0x827d('0x5d')]);var _0x47767d=util[_0x827d('0x55')](_0x827d('0x5f'),_0x3fbf0c[_0x827d('0x5c')]);_0x50cc78[_0x827d('0x18')]=!_[_0x827d('0x60')](_0x30cf1f)?_0x30cf1f['email']:null;_0x50cc78[_0x827d('0x1e')]=_0x3fbf0c[_0x827d('0x61')];_0x50cc78[_0x827d('0x24')]=_0x3873fd[_0x827d('0x2e')]()===_0x827d('0x3b')?_0x523da5[_0x827d('0x62')]:_0x523da5[_0x827d('0x63')];_0x50cc78[_0x827d('0x64')]=_0x3873fd==='queue'||_0x3873fd===_0x827d('0x65')?'queue':_0x827d('0x3b');var _0x21e70c=util[_0x827d('0x55')](_0x827d('0x66'),_0x3fbf0c['serverUrl'],_0x523da5[_0x827d('0x67')],md5(_0x523da5['uniqueid']));if(_0x1a135b&&_0x1a135b[_0x827d('0x68')]){logger[_0x827d('0x11')](_0x827d('0x69'),_0x827d('0x6a'));_0x523da5['recordingURL']=_0x21e70c;}else if(_0x55ef00&&_0x55ef00['recordingFormat']&&_0x55ef00['recordingFormat']!==_0x827d('0x6b')){logger['info'](_0x827d('0x6c'),_0x827d('0x6a'));_0x523da5[_0x827d('0x6d')]=_0x21e70c;}else{_0x523da5[_0x827d('0x6d')]='';}return getAdminUser(_0x3873fd,_0x4d8bf9,_0x50cc78,_0x47767d,_0x4efb1f,_0x47d517)[_0x827d('0x1b')](getUser(_0x3873fd,_0x4d8bf9,_0x47767d,_0x4efb1f,_0x47d517))[_0x827d('0x1b')](getEndUser(_0x3873fd,_0x4d8bf9,_0x47767d,_0x4efb1f,_0x47d517))[_0x827d('0x1b')](getTicket(_0x3873fd,_0x4d8bf9,_0x47767d,_0x1303b4,_0x523da5,_0x4efb1f))[_0x827d('0x1b')](function(_0x484eda){logger[_0x827d('0x11')](util[_0x827d('0x55')](_0x827d('0x6e'),_0x484eda['ticketId']));logger['info'](util[_0x827d('0x55')]('call\x20direction:\x20%s',_0x3873fd));if(_0x3873fd!=='unmanaged'){logger['info']('['+[_0x3873fd[_0x827d('0x14')]()]+']',_0x827d('0x6f'));emit(_0x3fbf0c[_0x827d('0x5c')],_0x30cf1f[_0x827d('0x39')],_0x484eda[_0x827d('0x43')]);}})[_0x827d('0x20')](function(_0x39397f){logger['error']('['+[_0x3873fd[_0x827d('0x14')]()]+_0x827d('0x70'),util['inspect'](_0x39397f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x33f6=['util','md5','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','],\x20getUser\x20crm','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','then','],\x20createEndUser\x20crm','forEach','includes','string','picklist','customField','nameField','toLowerCase','content','toString','type','idField','variable','variableName','customVariable','Variable','name','outbound','assign','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise'];(function(_0x11716e,_0x2cb0f4){var _0xad90e=function(_0xcac206){while(--_0xcac206){_0x11716e['push'](_0x11716e['shift']());}};_0xad90e(++_0x2cb0f4);}(_0x33f6,0xd5));var _0x633f=function(_0x3085b0,_0x1ef25a){_0x3085b0=_0x3085b0-0x0;var _0x25705e=_0x33f6[_0x3085b0];return _0x25705e;};'use strict';var _=require(_0x633f('0x0'));var Promise=require(_0x633f('0x1'));var rp=require(_0x633f('0x2'));var util=require(_0x633f('0x3'));var md5=require(_0x633f('0x4'));var Redis=require('ioredis');var intUtil=require(_0x633f('0x5'));var config=require('../../../../config/environment');var logger=require(_0x633f('0x6'))('servicenow');config[_0x633f('0x7')]=_[_0x633f('0x8')](config[_0x633f('0x7')],{'host':_0x633f('0x9'),'port':0x18eb});var io=require(_0x633f('0xa'))(new Redis(config[_0x633f('0x7')]));function getAdminUser(_0x47201b,_0x48b6b5,_0x3cdd98,_0x5be56e,_0x34ee31,_0x223e19){return new Promise(function(_0x132bdc,_0x36a120){var _0x489ffa={'method':_0x633f('0xb'),'uri':_0x5be56e+_0x633f('0xc')+'&'+_0x34ee31+'&'+_0x223e19,'auth':_0x48b6b5,'json':!![]};return rp(_0x489ffa)['then'](function(_0x104f68){if(_0x104f68[_0x633f('0xd')][_0x633f('0xe')]>0x0){_0x3cdd98[_0x633f('0xf')]=_0x104f68[_0x633f('0xd')][0x0][_0x633f('0x10')];}logger['info']('['+[_0x47201b[_0x633f('0x11')]()]+_0x633f('0x12'),_0x3cdd98);_0x132bdc(_0x3cdd98);})[_0x633f('0x13')](function(_0x5c5d01){logger[_0x633f('0x14')]('['+[_0x47201b[_0x633f('0x11')]()]+']',_0x5c5d01[_0x633f('0x15')]);_0x36a120(_0x5c5d01[_0x633f('0x15')]);});});}function getUser(_0x400962,_0x151430,_0x50d237,_0x94bd20,_0x8e3b10){return function(_0x22f4fd){logger[_0x633f('0x16')]('['+[_0x400962[_0x633f('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x22f4fd);return new Promise(function(_0x193865,_0x5694b3){if(intUtil[_0x633f('0x17')](_0x22f4fd[_0x633f('0x18')])){var _0x511566={'method':_0x633f('0xb'),'uri':_0x50d237+_0x633f('0x19')+_0x22f4fd[_0x633f('0x18')]+'&'+_0x94bd20+'&'+_0x8e3b10,'auth':_0x151430,'json':!![]};logger[_0x633f('0x16')]('['+[_0x400962['toUpperCase']()]+_0x633f('0x1a'),_0x511566);return rp(_0x511566)['then'](function(_0x30d495){logger[_0x633f('0x16')]('['+[_0x400962['toUpperCase']()]+_0x633f('0x1b'),_0x30d495);if(_0x30d495[_0x633f('0xd')][_0x633f('0xe')]>0x0&&String(_0x30d495['result'][0x0]['active'])==='true'){_0x22f4fd[_0x633f('0x1c')]=_0x30d495['result'][0x0][_0x633f('0x10')];}else{_0x22f4fd[_0x633f('0x1c')]=_0x22f4fd[_0x633f('0xf')];_0x22f4fd[_0x633f('0x18')]=_0x22f4fd['adminEmail'];}logger[_0x633f('0x16')]('['+[_0x400962['toUpperCase']()]+_0x633f('0x1d'),_0x22f4fd);_0x193865(_0x22f4fd);})['catch'](function(_0x410b4f){logger['error']('['+[_0x400962[_0x633f('0x11')]()]+']',_0x410b4f[_0x633f('0x15')]);_0x5694b3(_0x410b4f[_0x633f('0x15')]);});}else{logger[_0x633f('0x16')]('['+[_0x400962[_0x633f('0x11')]()]+']\x20using\x20admin\x20profile');_0x22f4fd['userId']=_0x22f4fd[_0x633f('0xf')];_0x22f4fd[_0x633f('0x18')]=_0x22f4fd[_0x633f('0x1e')];_0x193865(_0x22f4fd);}});};}function createEndUser(_0x8d270,_0x35ca43,_0x281969,_0x2561b3,_0x37ea66){logger[_0x633f('0x16')]('['+[_0x8d270[_0x633f('0x11')]()]+_0x633f('0x1f'),_0x281969);return new Promise(function(_0x1521a2,_0x29fd12){var _0x2206bc={'method':_0x633f('0x20'),'uri':_0x2561b3+_0x633f('0x21')+_0x37ea66,'body':{'user_name':_0x281969[_0x633f('0x22')],'roles':'user','first_name':_0x281969[_0x633f('0x22')],'active':_0x633f('0x23'),'date_format':_0x633f('0x24'),'phone':_0x281969[_0x633f('0x22')]},'auth':_0x35ca43,'json':!![]};return rp(_0x2206bc)['then'](function(_0x3c5b19){logger[_0x633f('0x16')]('['+[_0x8d270['toUpperCase']()]+_0x633f('0x25'),_0x3c5b19[_0x633f('0xd')]);_0x281969[_0x633f('0x26')]=_0x3c5b19[_0x633f('0xd')]['sys_id'];_0x1521a2(_0x281969);})[_0x633f('0x13')](function(_0x444d1f){logger[_0x633f('0x14')]('['+[_0x8d270[_0x633f('0x11')]()]+']',_0x444d1f[_0x633f('0x15')]);_0x29fd12(_0x444d1f['message']);});});}function getEndUser(_0x537125,_0x57fb14,_0x38f702,_0x1a200b,_0x3a0f8f){return function(_0x313bbb){logger[_0x633f('0x16')]('['+[_0x537125['toUpperCase']()]+_0x633f('0x27'),_0x313bbb);return new Promise(function(_0x362e8c,_0x4c9289){var _0x3f5432={'method':_0x633f('0xb'),'uri':_0x38f702+'sys_user?sysparm_query=phone%3D'+_0x313bbb[_0x633f('0x22')]+'&'+_0x1a200b+'&'+_0x3a0f8f,'auth':_0x57fb14,'json':!![]};return rp(_0x3f5432)['then'](function(_0x332d82){if(_0x332d82[_0x633f('0xd')][_0x633f('0xe')]>0x0){_0x313bbb[_0x633f('0x26')]=_0x332d82[_0x633f('0xd')][0x0]['sys_id'];logger[_0x633f('0x16')]('['+[_0x537125[_0x633f('0x11')]()]+_0x633f('0x28'),_0x313bbb);_0x362e8c(_0x313bbb);}else{return createEndUser(_0x537125,_0x57fb14,_0x313bbb,_0x38f702,_0x1a200b)[_0x633f('0x29')](function(_0xb41577){logger[_0x633f('0x16')]('['+[_0x537125[_0x633f('0x11')]()]+_0x633f('0x2a'),_0xb41577);_0x362e8c(_0xb41577);});}})[_0x633f('0x13')](function(_0x2437c8){logger['error']('['+[_0x537125[_0x633f('0x11')]()]+']',_0x2437c8['message']);_0x4c9289(_0x2437c8['message']);});});};}function getCustomFields(_0x8070bf,_0x33427c){var _0x4761db={};if(_0x8070bf[_0x633f('0xe')]>0x0){_[_0x633f('0x2b')](_0x8070bf,function(_0x31ed1e){if(_[_0x633f('0x2c')]([_0x633f('0x2d'),_0x633f('0x2e')],_0x31ed1e['type'])&&_0x31ed1e['nameField']&&!_0x31ed1e[_0x633f('0x2f')]){_0x4761db[_0x31ed1e[_0x633f('0x30')][_0x633f('0x31')]()]=_0x31ed1e[_0x633f('0x32')][_0x633f('0x33')]();}else if(_[_0x633f('0x2c')]([_0x633f('0x2d'),_0x633f('0x2e')],_0x31ed1e[_0x633f('0x34')])&&_0x31ed1e['idField']&&_0x31ed1e['customField']){_0x4761db[_0x31ed1e[_0x633f('0x35')][_0x633f('0x31')]()]=_0x31ed1e[_0x633f('0x32')][_0x633f('0x33')]();}else if(_0x31ed1e[_0x633f('0x34')]===_0x633f('0x36')&&_0x31ed1e[_0x633f('0x37')]&&_0x31ed1e['idField']&&_0x31ed1e['customField']){_0x4761db[_0x31ed1e['idField'][_0x633f('0x31')]()]=_0x33427c[_0x31ed1e[_0x633f('0x37')]][_0x633f('0x33')]();}else if(_0x31ed1e[_0x633f('0x34')]===_0x633f('0x38')&&_0x31ed1e[_0x633f('0x39')]&&_0x31ed1e[_0x633f('0x39')]['name']&&_0x31ed1e[_0x633f('0x35')]&&_0x31ed1e[_0x633f('0x2f')]){_0x4761db[_0x31ed1e[_0x633f('0x35')]['toLowerCase']()]=_0x33427c[_0x31ed1e['Variable'][_0x633f('0x3a')][_0x633f('0x31')]()]['toString']();}});}return _0x4761db;}function getTicket(_0x60395b,_0x8afcf4,_0x56d4e6,_0x4c437d,_0x1247ee,_0x547e51){return function(_0x4d9819){logger[_0x633f('0x16')]('['+[_0x60395b[_0x633f('0x11')]()]+']\x20getTicket\x20input\x20crm',_0x4d9819);return new Promise(function(_0x283e7e,_0x3dba86){var _0x4b3c5a=_0x60395b['toLowerCase']()===_0x633f('0x3b')?_0x4d9819[_0x633f('0x1c')]:_0x4d9819[_0x633f('0x26')];var _0x634b39={'method':'POST','uri':_0x56d4e6+'incident'+'?'+_0x547e51,'body':Object[_0x633f('0x3c')]({},{'active':_0x633f('0x23'),'caller_id':_0x4b3c5a,'assigned_to':_0x4d9819['userId'],'short_description':intUtil['getString'](_0x4c437d[_0x633f('0x3d')],_0x1247ee,'\x20'),'description':intUtil['getString'](_0x4c437d[_0x633f('0x3e')],_0x1247ee,'\x0a')},getCustomFields(_0x4c437d[_0x633f('0x3f')],_0x1247ee)),'auth':_0x8afcf4,'json':!![]};return rp(_0x634b39)[_0x633f('0x29')](function(_0x66e69a){logger[_0x633f('0x16')]('['+[_0x60395b['toUpperCase']()]+_0x633f('0x40'),_0x66e69a['result']);_0x4d9819[_0x633f('0x41')]=_0x66e69a[_0x633f('0xd')]['sys_id'];_0x4d9819[_0x633f('0x42')]=_0x66e69a[_0x633f('0xd')][_0x633f('0x43')];logger[_0x633f('0x16')]('['+[_0x60395b['toUpperCase']()]+_0x633f('0x44'),_0x4d9819);_0x283e7e(_0x4d9819);})[_0x633f('0x13')](function(_0x14fa13){logger['error']('['+[_0x60395b[_0x633f('0x11')]()]+']',_0x14fa13['message']);_0x3dba86(_0x14fa13[_0x633f('0x15')]);});});};}function createRemoteTag(_0x2447ff,_0x4c8abd,_0xd523d8,_0x394c77){return new Promise(function(_0x5504f0,_0x46b037){var _0x2a83d4={'method':'POST','uri':_0xd523d8+_0x633f('0x45')+'?'+_0x394c77,'body':{'short_description':_0x2447ff,'global':!![],'active':!![],'name':_0x2447ff},'auth':_0x4c8abd,'json':!![]};return rp(_0x2a83d4)[_0x633f('0x29')](function(_0x3323d0){var _0x5a7136=_0x3323d0[_0x633f('0xd')][_0x633f('0x10')];_0x5504f0(_0x5a7136);});});}function getRemoteTag(_0xe27fc6,_0x1ef008,_0x451eb5,_0x1cc56a,_0x8ba4b7){return new Promise(function(_0x4dcc7c,_0x1f85cb){var _0x15948a={'method':_0x633f('0xb'),'uri':_0x451eb5+'label'+_0x633f('0x46')+_0xe27fc6+'&'+_0x1cc56a,'auth':_0x1ef008,'json':!![]};return rp(_0x15948a)['then'](function(_0x2e8f98){if(_0x2e8f98['result'][_0x633f('0xe')]>0x0){var _0x603fd2=_0x2e8f98[_0x633f('0xd')][0x0][_0x633f('0x10')];_0x4dcc7c(_0x603fd2);}else{return createRemoteTag(_0xe27fc6,_0x1ef008,_0x451eb5,_0x1cc56a)[_0x633f('0x29')](function(_0x570725){_0x4dcc7c(_0x570725);});}});});}function assignTagToIncident(_0x4ec6ab,_0xa73190,_0x3a069c,_0x4e8beb,_0x2ec81d){return new Promise(function(_0x1d743f,_0x73643e){var _0x49e644={'method':_0x633f('0x20'),'uri':_0x3a069c+_0x633f('0x47')+'?'+_0x2ec81d,'body':{'label':_0x4ec6ab,'table':'incident','id_type':_0x633f('0x48'),'table_key':_0x4e8beb[_0x633f('0x41')],'title':_0x633f('0x49')+_0x4e8beb['ticketNumber'],'id_display':_0x4e8beb['ticketNumber']},'auth':_0xa73190,'json':!![]};return rp(_0x49e644)[_0x633f('0x29')](function(_0x4c3b37){_0x1d743f();})['catch'](function(){_0x1d743f();});});}function manageTags(_0x1e3eda,_0x2dc351,_0x3abf9c,_0x399e58,_0x2044f3,_0x140010,_0x42dbb6){return new Promise(function(_0x58b01c,_0x1f6e46){var _0x3f44fb=[];_0x2dc351[_0x633f('0x2b')](function(_0x43294c){_0x3f44fb['push'](getRemoteTag(_0x43294c,_0x3abf9c,_0x399e58,_0x140010,_0x42dbb6));});return Promise[_0x633f('0x4a')](_0x3f44fb)['then'](function(_0x277924){if(_0x277924[_0x633f('0xe')]){logger['info']('['+[_0x1e3eda[_0x633f('0x11')]()]+_0x633f('0x4b'),_0x277924);var _0xa19fa3=[];_0x277924[_0x633f('0x2b')](function(_0x101b16){_0xa19fa3[_0x633f('0x4c')](assignTagToIncident(_0x101b16,_0x3abf9c,_0x399e58,_0x2044f3,_0x140010));});return Promise[_0x633f('0x4a')](_0xa19fa3)[_0x633f('0x29')](function(){_0x58b01c();})[_0x633f('0x13')](function(){_0x58b01c();});}else{_0x58b01c();}});});}function getTags(_0x59342a,_0x25f944,_0x396d5c,_0x5180b4,_0x16846d,_0x57dfb6){return function(_0x17304f){return new Promise(function(_0x4dcb15,_0xb380f){var _0xa2cad0=[];var _0x19f522=_0x5180b4[_0x633f('0x4d')];if(_0x19f522&&_0x19f522[_0x633f('0xe')]>0x0){_0xa2cad0=_[_0x633f('0x4e')](_0x19f522,_0x633f('0x3a'));}if(_0xa2cad0[_0x633f('0xe')]>0x0){return manageTags(_0x59342a,_0xa2cad0,_0x25f944,_0x396d5c,_0x17304f,_0x16846d,_0x57dfb6)[_0x633f('0x29')](function(){_0x4dcb15(_0x17304f);});}else{_0x4dcb15(_0x17304f);}});};}function emit(_0x455f7d,_0x1237ba,_0x4ee5d8){var _0x421ba8='%26sysparm_record_target%3Dincident'+_0x633f('0x4f')+_0x633f('0x50')+_0x633f('0x51');var _0x2c88fe={'uri':_0x455f7d+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x4ee5d8+_0x421ba8};io['to'](util[_0x633f('0x52')](_0x633f('0x53'),_0x1237ba))[_0x633f('0x54')]('trigger:browser:url',_0x2c88fe);}exports['cs']=function(_0x50240e,_0x47dbdb,_0xad0d6b,_0x59b526,_0xb23566,_0x2f9d43,_0x24c4a2,_0x41c3a9){var _0x1c28f1={};var _0x4ac176={'user':_0x2f9d43[_0x633f('0x55')],'pass':_0x2f9d43['password']};var _0x35fd05=_0x633f('0x56');var _0x5e576f=_0x633f('0x57');_0x2f9d43[_0x633f('0x58')]=intUtil[_0x633f('0x59')](_0x2f9d43['remoteUri']);_0x2f9d43[_0x633f('0x5a')]=intUtil['stripTrailingSlash'](_0x2f9d43[_0x633f('0x5a')]);var _0x2704b8=util['format']('%s/api/now/table/',_0x2f9d43[_0x633f('0x58')]);_0x1c28f1['userEmail']=!_[_0x633f('0x5b')](_0x59b526)?_0x59b526['email']:null;_0x1c28f1[_0x633f('0x1e')]=_0x2f9d43[_0x633f('0x5c')];_0x1c28f1[_0x633f('0x22')]=_0x41c3a9[_0x633f('0x31')]()===_0x633f('0x3b')?_0x47dbdb['destcalleridnum']:_0x47dbdb['calleridnum'];_0x1c28f1[_0x633f('0x5d')]=_0x41c3a9===_0x633f('0x5e')||_0x41c3a9===_0x633f('0x5f')?_0x633f('0x5e'):_0x633f('0x3b');var _0x3c885e=util[_0x633f('0x52')](_0x633f('0x60'),_0x2f9d43[_0x633f('0x5a')],_0x47dbdb[_0x633f('0x61')],md5(_0x47dbdb[_0x633f('0x61')]));if(_0xb23566&&_0xb23566[_0x633f('0x62')]){logger[_0x633f('0x16')](_0x633f('0x63'),'Recording\x20is\x20enabled!');_0x47dbdb[_0x633f('0x64')]=_0x3c885e;}else if(_0x24c4a2&&_0x24c4a2['recordingFormat']&&_0x24c4a2[_0x633f('0x65')]!==_0x633f('0x66')){logger[_0x633f('0x16')](_0x633f('0x67'),_0x633f('0x68'));_0x47dbdb[_0x633f('0x64')]=_0x3c885e;}else{_0x47dbdb[_0x633f('0x64')]='';}return getAdminUser(_0x41c3a9,_0x4ac176,_0x1c28f1,_0x2704b8,_0x5e576f,_0x35fd05)[_0x633f('0x29')](getUser(_0x41c3a9,_0x4ac176,_0x2704b8,_0x5e576f,_0x35fd05))['then'](getEndUser(_0x41c3a9,_0x4ac176,_0x2704b8,_0x5e576f,_0x35fd05))[_0x633f('0x29')](getTicket(_0x41c3a9,_0x4ac176,_0x2704b8,_0xad0d6b,_0x47dbdb,_0x5e576f))['then'](function(_0x26f258){logger[_0x633f('0x16')](util[_0x633f('0x52')]('The\x20ticket\x20ID\x20is:\x20%s',_0x26f258[_0x633f('0x41')]));logger[_0x633f('0x16')](util['format'](_0x633f('0x69'),_0x41c3a9));if(_0x41c3a9!==_0x633f('0x5f')){logger[_0x633f('0x16')]('['+[_0x41c3a9[_0x633f('0x11')]()]+']',_0x633f('0x6a'));emit(_0x2f9d43[_0x633f('0x58')],_0x59b526[_0x633f('0x3a')],_0x26f258['ticketId']);}})['catch'](function(_0x3a0efc){logger[_0x633f('0x14')]('['+[_0x41c3a9[_0x633f('0x11')]()]+_0x633f('0x6b'),util['inspect'](_0x3a0efc,{'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 d8c186c..ff2bcc4 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 _0x4387=['Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','toLowerCase','toString','customField','custom_fields','content','variable','customVariable','Variable','login','PLAIN','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','unmanaged','%s/service/v4_1/rest.php','monitor_format','lastevent','toUpperCase','The\x20User\x20ID\x20is:','contacts','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','Contacts','name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Basic\x20%s','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name',''];(function(_0x226cec,_0x18bfba){var _0x4ce349=function(_0x506f25){while(--_0x506f25){_0x226cec['push'](_0x226cec['shift']());}};_0x4ce349(++_0x18bfba);}(_0x4387,0x1aa));var _0x7438=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4387[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7438('0x0'));var rp=require(_0x7438('0x1'));var BPromise=require(_0x7438('0x2'));var md5=require(_0x7438('0x3'));var util=require('util');var Redis=require(_0x7438('0x4'));var intUtil=require(_0x7438('0x5'));var config=require(_0x7438('0x6'));var logger=require(_0x7438('0x7'))(_0x7438('0x8'));config[_0x7438('0x9')]=_[_0x7438('0xa')](config[_0x7438('0x9')],{'host':_0x7438('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7438('0x9')]));var def={'method':_0x7438('0xc'),'json':!![]};function emit(_0x35bd50,_0x5b367b,_0x4355f5){io['to'](_0x35bd50)[_0x7438('0xd')](_0x5b367b,_0x4355f5);}function getTicket(_0x412726,_0xdf8373,_0x13e9b8,_0xc39a14,_0x30074b,_0x2ace19,_0x32406d,_0x47af6d){logger[_0x7438('0xe')](_0x7438('0xf'));var _0x29887c=new Date();var _0x13a28e=[{'name':'name','value':intUtil[_0x7438('0x10')](_0xc39a14['Subjects'],_0x30074b,'\x20')},{'name':_0x7438('0x11'),'value':_0xdf8373['id']},{'name':_0x7438('0x12'),'value':_0xdf8373['id']},{'name':_0x7438('0x13'),'value':intUtil[_0x7438('0x10')](_0xc39a14[_0x7438('0x14')],_0x30074b,'\x0a')},{'name':_0x7438('0x15'),'value':_0x29887c[_0x7438('0x16')]()[_0x7438('0x17')](0x0,0x13)[_0x7438('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x7438('0x19'),'value':'15'},{'name':_0x7438('0x1a'),'value':_0x13e9b8['id']},{'name':'parent_type','value':_0x7438('0x1b')},{'name':'parent_name','value':_0x13e9b8[_0x7438('0x1c')]},{'name':'direction','value':_0x47af6d}];if(_0x2ace19[_0x7438('0x1d')]){_[_0x7438('0x1e')](_0x2ace19,function(_0x187635){if(_0x30074b[_0x187635[_0x7438('0x1f')]]){_0x13a28e[_0x7438('0x20')]({'name':_0x187635[_0x7438('0x21')],'value':_0x30074b[_0x187635[_0x7438('0x1f')]]});}});}return request({'form':{'method':_0x7438('0x22'),'input_type':_0x7438('0x23'),'response_type':_0x7438('0x23'),'rest_data':JSON[_0x7438('0x24')]({'session':_0x32406d['id'],'module_name':'Calls','name_value_list':_0x13a28e})}});}function getAuth(_0x3cd1f7){return util['format'](_0x7438('0x25'),new Buffer(_0x3cd1f7[_0x7438('0x26')]+':X')['toString'](_0x7438('0x27')));}function getServerInfo(_0x52c5ee){return request({'form':{'method':_0x7438('0x28'),'input_type':_0x7438('0x23'),'response_type':_0x7438('0x23'),'rest_data':JSON[_0x7438('0x24')]({'session':_0x52c5ee['id']})}});}function getUser(_0xaeaed2,_0x56ddc5,_0x4f72c1){if(!_[_0x7438('0x29')](_0x56ddc5)){logger['info'](_0x7438('0x2a'),_0x56ddc5);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x7438('0x23'),'rest_data':JSON['stringify']({'session':_0x4f72c1['id'],'module_name':'Employees','query':util[_0x7438('0x2b')](_0x7438('0x2c'),_0x56ddc5),'order_by':'','offset':'0','select_fields':['id','name',_0x7438('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7438('0x2e')](function(_0x4cea5d){if(_0x4cea5d[_0x7438('0x2f')]['length']){var _0x752dff=_[_0x7438('0x30')](_0x4cea5d[_0x7438('0x2f')],function(_0x19d6a1){return _0x19d6a1['name_value_list'][_0x7438('0x2d')][_0x7438('0x31')]===_0x56ddc5;});if(_0x752dff){logger[_0x7438('0xe')](_0x7438('0x32'));return BPromise[_0x7438('0x33')]({'id':_0x752dff['name_value_list']['id'][_0x7438('0x31')],'name':_0x752dff['name_value_list'][_0x7438('0x1c')]['value']});}}logger[_0x7438('0xe')](_0x7438('0x34'));return BPromise[_0x7438('0x33')]({'id':_0x4f72c1[_0x7438('0x35')][_0x7438('0x36')][_0x7438('0x31')],'name':_0x4f72c1[_0x7438('0x35')][_0x7438('0x2d')][_0x7438('0x31')]});});}else{logger['info'](_0x7438('0x37'));return BPromise['resolve']({'id':_0x4f72c1[_0x7438('0x35')][_0x7438('0x36')][_0x7438('0x31')],'name':_0x4f72c1['name_value_list'][_0x7438('0x2d')][_0x7438('0x31')]});}}function getEndUser(_0x454c16,_0x267d1c,_0x3e1680,_0x5a2ca3){logger['info']('Searching\x20enduser\x20with\x20phone',_0x3e1680);return request({'form':{'method':'get_entry_list','input_type':_0x7438('0x23'),'response_type':_0x7438('0x23'),'rest_data':JSON['stringify']({'session':_0x5a2ca3['id'],'module_name':_0x7438('0x1b'),'query':util['format'](_0x7438('0x38'),_0x3e1680),'order_by':'','offset':'0','select_fields':['id',_0x7438('0x1c'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7438('0x2e')](function(_0x3d8775){if(_0x3d8775['entry_list']['length']){var _0x58c374=_['find'](_0x3d8775['entry_list'],function(_0x9a5400){return _0x9a5400['name_value_list'][_0x7438('0x39')][_0x7438('0x31')]===_0x3e1680;});if(_0x58c374){logger[_0x7438('0xe')](_0x7438('0x3a'));return BPromise[_0x7438('0x33')]({'id':_0x58c374[_0x7438('0x35')]['id'][_0x7438('0x31')],'name':_0x58c374[_0x7438('0x35')][_0x7438('0x1c')]['value'],'phone':_0x58c374[_0x7438('0x35')]['phone_home'][_0x7438('0x31')]});}}else{logger['info'](_0x7438('0x3b'));return request({'form':{'method':_0x7438('0x22'),'input_type':_0x7438('0x23'),'response_type':_0x7438('0x23'),'rest_data':JSON['stringify']({'session':_0x5a2ca3['id'],'module_name':_0x7438('0x1b'),'name_value_list':[{'name':_0x7438('0x3c'),'value':_0x267d1c!==_0x7438('0x3d')?_0x267d1c:util['format'](_0x7438('0x3e'),_0x3e1680)},{'name':_0x7438('0x39'),'value':_0x3e1680}]})}})['then'](function(_0x4100a1){logger[_0x7438('0xe')](_0x7438('0x3f'));return BPromise[_0x7438('0x33')]({'id':_0x4100a1['id'],'name':_0x4100a1[_0x7438('0x2f')]['first_name'][_0x7438('0x31')],'phone':_0x4100a1['entry_list'][_0x7438('0x39')][_0x7438('0x31')]});});}});}function request(_0x238037){logger[_0x7438('0x40')](_0x7438('0x41'),JSON[_0x7438('0x24')](_0x238037));return rp(_['merge'](def,_0x238037));}function getTags(_0x426c62,_0x223e39){var _0x5e6e05=[];if(_0x426c62&&_0x426c62[_0x7438('0x1d')]>0x0){_0x5e6e05=_[_0x7438('0x42')](_0x426c62,_0x223e39);}return _0x5e6e05;}function getCustomFields(_0x30f4f7,_0x43b160){var _0x447aea=[];var _0x546c4b={'custom_fields':[]};if(_0x30f4f7[_0x7438('0x1d')]>0x0){_[_0x7438('0x1e')](_0x30f4f7,function(_0x17e0d9){if(_0x17e0d9[_0x7438('0x43')]===_0x7438('0x44')&&_0x17e0d9[_0x7438('0x45')]&&!_0x17e0d9['customField']){_0x546c4b[_0x17e0d9[_0x7438('0x45')][_0x7438('0x46')]()]=_0x17e0d9['content'][_0x7438('0x47')]();}else if(_0x17e0d9[_0x7438('0x43')]==='string'&&_0x17e0d9[_0x7438('0x21')]&&_0x17e0d9[_0x7438('0x48')]){_0x546c4b[_0x7438('0x49')][_0x7438('0x20')]({'id':_0x17e0d9[_0x7438('0x21')],'value':_0x17e0d9[_0x7438('0x4a')][_0x7438('0x47')]()});}else if(_0x17e0d9['type']===_0x7438('0x4b')&&_0x17e0d9[_0x7438('0x1f')]&&_0x17e0d9[_0x7438('0x21')]&&_0x17e0d9[_0x7438('0x48')]){_0x43b160[_0x17e0d9[_0x7438('0x1f')]]&&_0x546c4b['custom_fields'][_0x7438('0x20')]({'id':_0x17e0d9[_0x7438('0x21')],'value':_0x43b160[_0x17e0d9[_0x7438('0x1f')]][_0x7438('0x47')]()});}else if(_0x17e0d9[_0x7438('0x43')]===_0x7438('0x4c')&&_0x17e0d9[_0x7438('0x4d')]&&_0x17e0d9[_0x7438('0x4d')][_0x7438('0x1c')]&&_0x17e0d9[_0x7438('0x21')]&&_0x17e0d9[_0x7438('0x48')]){_0x43b160[_0x17e0d9[_0x7438('0x4d')][_0x7438('0x1c')][_0x7438('0x46')]()]&&_0x546c4b['custom_fields'][_0x7438('0x20')]({'id':_0x17e0d9[_0x7438('0x21')],'value':_0x43b160[_0x17e0d9[_0x7438('0x4d')][_0x7438('0x1c')]['toLowerCase']()]['toString']()});}});}return _0x546c4b;}function getConnection(_0x42fd39){return request({'method':_0x7438('0xc'),'form':{'method':_0x7438('0x4e'),'input_type':_0x7438('0x23'),'response_type':'JSON','rest_data':JSON[_0x7438('0x24')]({'user_auth':{'user_name':_0x42fd39['username'],'password':_0x42fd39['password'],'encryption':_0x7438('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x7438('0x2e')](function(_0x5bae5c){var _0xa89045=_0x5bae5c;if(_0xa89045['id']){def['sessionID']=_0xa89045['id'];return BPromise[_0x7438('0x33')](_0xa89045);}else{throw new Error(util['format'](_0x7438('0x50'),_0x42fd39['id']));}});}function setRelationship(_0x42abfe,_0x1f87a8,_0x341294,_0x255ece){return request({'form':{'method':_0x7438('0x51'),'input_type':_0x7438('0x23'),'response_type':'JSON','rest_data':JSON[_0x7438('0x24')]({'session':_0x42abfe['id'],'module_name':_0x7438('0x52'),'module_id':_0x341294['id'],'link_field_name':_0x255ece,'related_ids':[_0x1f87a8['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7438('0x53')]=function(_0x3fa2ce,_0x1eea2a,_0x4f54fe,_0x75dd9d,_0x4b7d99,_0x39f420){var _0x2ec314,_0x5b4b98,_0x18c7d9,_0x2c1247;_0x39f420[_0x7438('0x54')]=intUtil[_0x7438('0x55')](_0x39f420['remoteUri']);_0x39f420[_0x7438('0x56')]=intUtil['stripTrailingSlash'](_0x39f420[_0x7438('0x56')]);def[_0x7438('0x57')]=util['format']('%s/service/v4_1/rest.php',_0x39f420['remoteUri']);if(_0x4b7d99&&_0x4b7d99['monitor_format']){logger[_0x7438('0xe')](_0x7438('0x58'),_0x7438('0x59'));_0x1eea2a[_0x7438('0x5a')]=util[_0x7438('0x2b')](_0x7438('0x5b'),_0x39f420['serverUrl'],_0x1eea2a['uniqueid'],md5(_0x1eea2a[_0x7438('0x5c')]));}else{_0x1eea2a[_0x7438('0x5a')]='';}return getConnection(_0x39f420)[_0x7438('0x2e')](function(_0x2ed952){_0x2c1247=_0x2ed952;return getUser(_0x39f420,_0x75dd9d[_0x7438('0x1c')],_0x2c1247);})[_0x7438('0x2e')](function(_0xdbcd54){_0x2ec314=_0xdbcd54;logger[_0x7438('0xe')]('The\x20User\x20ID\x20is:',_0x2ec314['id']);return getEndUser(_0x39f420,_0x1eea2a[_0x7438('0x5d')],_0x1eea2a[_0x7438('0x5e')],_0x2c1247);})[_0x7438('0x2e')](function(_0x2cc10f){_0x5b4b98=_0x2cc10f;logger[_0x7438('0xe')](_0x7438('0x5f'),_0x5b4b98['id']);return getTicket(_0x39f420,_0x2ec314,_0x5b4b98,_0x4f54fe,_0x1eea2a,_0x4f54fe[_0x7438('0x60')],_0x2c1247,_0x7438('0x61'));})['then'](function(_0x1f69d4){_0x18c7d9=_0x1f69d4;logger['info'](_0x7438('0x62'));logger[_0x7438('0xe')](_0x7438('0x63'),_0x18c7d9['id']);return setRelationship(_0x2c1247,_0x2ec314,_0x18c7d9,_0x7438('0x64'));})[_0x7438('0x2e')](function(){return setRelationship(_0x2c1247,_0x5b4b98,_0x18c7d9,'contacts');})[_0x7438('0x2e')](function(){return getServerInfo(_0x2c1247);})[_0x7438('0x2e')](function(_0x4c02cf){var _0x3edc45=parseInt(_0x4c02cf[_0x7438('0x65')][_0x7438('0x66')](0x0));var _0x1c0a74=util[_0x7438('0x2b')](_0x7438('0x67'),_0x39f420[_0x7438('0x54')],_0x18c7d9['id']);if(_0x3edc45>0x6){_0x1c0a74=util[_0x7438('0x2b')](_0x7438('0x68'),_0x39f420[_0x7438('0x54')],_0x18c7d9['id']);}logger['info'](_0x7438('0x58'),_0x7438('0x69'));emit(util[_0x7438('0x2b')](_0x7438('0x6a'),_0x75dd9d['name']),_0x7438('0x6b'),{'uri':_0x1c0a74});})[_0x7438('0x6c')](function(_0xd14bd0){logger[_0x7438('0x6d')](_0x7438('0x58'),JSON['stringify'](_0xd14bd0));});};exports['outbound']=function(_0x10b5f8,_0x5f2761,_0x1ab07a,_0x5db532,_0x9629cd,_0x2b4cc9,_0x1aeecb){var _0x596f9c,_0x189ceb,_0xc4503e,_0x2609bb;_0x2b4cc9['remoteUri']=intUtil[_0x7438('0x55')](_0x2b4cc9[_0x7438('0x54')]);_0x2b4cc9[_0x7438('0x56')]=intUtil[_0x7438('0x55')](_0x2b4cc9['serverUrl']);def[_0x7438('0x57')]=util[_0x7438('0x2b')]('%s/service/v4_1/rest.php',_0x2b4cc9[_0x7438('0x54')]);if(_0x1aeecb&&_0x1aeecb['recordingFormat']&&_0x1aeecb[_0x7438('0x6e')]!=='none'){logger[_0x7438('0xe')](_0x7438('0x6f'),_0x7438('0x59'));_0x5f2761[_0x7438('0x5a')]=util[_0x7438('0x2b')](_0x7438('0x5b'),_0x2b4cc9['serverUrl'],_0x5f2761['uniqueid'],md5(_0x5f2761[_0x7438('0x5c')]));}return getConnection(_0x2b4cc9)[_0x7438('0x2e')](function(_0x168f29){_0x2609bb=_0x168f29;return getUser(_0x2b4cc9,_0x5db532[_0x7438('0x1c')],_0x2609bb);})['then'](function(_0x510a14){_0x596f9c=_0x510a14;logger[_0x7438('0xe')]('The\x20User\x20ID\x20is:',_0x596f9c['id']);return getEndUser(_0x2b4cc9,_0x5f2761[_0x7438('0x70')],_0x5f2761[_0x7438('0x71')],_0x2609bb);})['then'](function(_0xbce89d){_0x189ceb=_0xbce89d;logger[_0x7438('0xe')]('The\x20Enduser\x20ID\x20is:',_0x189ceb['id']);return getTicket(_0x2b4cc9,_0x596f9c,_0x189ceb,_0x1ab07a,_0x5f2761,_0x1ab07a[_0x7438('0x60')],_0x2609bb,_0x7438('0x72'));})[_0x7438('0x2e')](function(_0x14b9d3){_0xc4503e=_0x14b9d3;logger[_0x7438('0xe')]('Ticket\x20created!');logger[_0x7438('0xe')](_0x7438('0x63'),_0xc4503e['id']);return setRelationship(_0x2609bb,_0x596f9c,_0xc4503e,_0x7438('0x64'));})[_0x7438('0x2e')](function(){return setRelationship(_0x2609bb,_0x189ceb,_0xc4503e,'contacts');})[_0x7438('0x2e')](function(){return getServerInfo(_0x2609bb);})['then'](function(_0x55e3a5){var _0x294bc5=parseInt(_0x55e3a5[_0x7438('0x65')][_0x7438('0x66')](0x0));var _0x1a1159=util[_0x7438('0x2b')](_0x7438('0x67'),_0x2b4cc9[_0x7438('0x54')],_0xc4503e['id']);if(_0x294bc5>0x6){_0x1a1159=util[_0x7438('0x2b')](_0x7438('0x68'),_0x2b4cc9['remoteUri'],_0xc4503e['id']);}logger[_0x7438('0xe')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7438('0x2b')](_0x7438('0x6a'),_0x5db532[_0x7438('0x1c')]),_0x7438('0x6b'),{'uri':_0x1a1159});})[_0x7438('0x6c')](function(_0x51989d){logger[_0x7438('0x6d')](_0x7438('0x6f'),JSON['stringify'](_0x51989d));});};exports[_0x7438('0x73')]=function(_0x3e4c2f,_0x6571b7,_0x114b7f,_0x11f987,_0x2bcc67,_0x335188){var _0x3d14fe,_0x5ca762,_0x5b19f7,_0x400165;_0x335188['remoteUri']=intUtil['stripTrailingSlash'](_0x335188[_0x7438('0x54')]);_0x335188[_0x7438('0x56')]=intUtil[_0x7438('0x55')](_0x335188['serverUrl']);def[_0x7438('0x57')]=util[_0x7438('0x2b')](_0x7438('0x74'),_0x335188['remoteUri']);if(_0x2bcc67&&_0x2bcc67[_0x7438('0x75')]){logger[_0x7438('0xe')]('['+_0x6571b7[_0x7438('0x76')][_0x7438('0x77')]()+']',_0x7438('0x59'));_0x6571b7[_0x7438('0x5a')]=util['format'](_0x7438('0x5b'),_0x335188[_0x7438('0x56')],_0x6571b7['uniqueid'],md5(_0x6571b7[_0x7438('0x5c')]));}else{_0x6571b7[_0x7438('0x5a')]='';}return getConnection(_0x335188)['then'](function(_0x32ba8d){_0x400165=_0x32ba8d;if(!_[_0x7438('0x29')](_0x11f987)){return getUser(_0x335188,_0x11f987[_0x7438('0x1c')],_0x400165);}else{return getUser(_0x335188,null,_0x400165);}})['then'](function(_0x1743dc){_0x3d14fe=_0x1743dc;logger['info'](_0x7438('0x78'),_0x3d14fe['id']);return getEndUser(_0x335188,_0x6571b7[_0x7438('0x5d')],_0x6571b7[_0x7438('0x5e')],_0x400165);})['then'](function(_0x3386b7){_0x5ca762=_0x3386b7;logger[_0x7438('0xe')](_0x7438('0x5f'),_0x5ca762['id']);return getTicket(_0x335188,_0x3d14fe,_0x5ca762,_0x114b7f,_0x6571b7,_0x114b7f['Fields'],_0x400165,_0x7438('0x61'));})[_0x7438('0x2e')](function(_0x409e7d){_0x5b19f7=_0x409e7d;logger['info'](_0x7438('0x62'));logger[_0x7438('0xe')](_0x7438('0x63'),_0x5b19f7['id']);return setRelationship(_0x400165,_0x3d14fe,_0x5b19f7,_0x7438('0x64'));})[_0x7438('0x2e')](function(){return setRelationship(_0x400165,_0x5ca762,_0x5b19f7,_0x7438('0x79'));})['then'](function(){return getServerInfo(_0x400165);})['catch'](function(_0x30d3f5){logger[_0x7438('0x6d')]('['+_0x6571b7[_0x7438('0x76')]['toUpperCase']()+']',JSON[_0x7438('0x24')](_0x30d3f5));});}; \ No newline at end of file +var _0xb533=['recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','Outbound','trigger:browser:url','unmanaged','lastevent','calleridname','calleridnum','toUpperCase','lodash','bluebird','md5','util','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','name','getString','Subjects','assigned_user_id','created_by','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','name_value_list','user_name','resolve','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','push','variable','customVariable','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','%s/service/v4_1/rest.php'];(function(_0x1ec65c,_0x354923){var _0x5249c2=function(_0x451341){while(--_0x451341){_0x1ec65c['push'](_0x1ec65c['shift']());}};_0x5249c2(++_0x354923);}(_0xb533,0x1e6));var _0x3b53=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xb533[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x3b53('0x0'));var rp=require('request-promise');var BPromise=require(_0x3b53('0x1'));var md5=require(_0x3b53('0x2'));var util=require(_0x3b53('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3b53('0x4'));var config=require(_0x3b53('0x5'));var logger=require('../../../../config/logger')(_0x3b53('0x6'));config[_0x3b53('0x7')]=_[_0x3b53('0x8')](config[_0x3b53('0x7')],{'host':_0x3b53('0x9'),'port':0x18eb});var io=require(_0x3b53('0xa'))(new Redis(config[_0x3b53('0x7')]));var def={'method':_0x3b53('0xb'),'json':!![]};function emit(_0x573d70,_0xa504da,_0x5f2da7){io['to'](_0x573d70)['emit'](_0xa504da,_0x5f2da7);}function getTicket(_0x416b2b,_0x4b4155,_0x10f5bf,_0x32fcd4,_0x2300f2,_0x1dd39f,_0x23acf8,_0x1f9ac8){logger[_0x3b53('0xc')]('Creating\x20new\x20ticket...');var _0x1dd24e=new Date();var _0x443547=[{'name':_0x3b53('0xd'),'value':intUtil[_0x3b53('0xe')](_0x32fcd4[_0x3b53('0xf')],_0x2300f2,'\x20')},{'name':_0x3b53('0x10'),'value':_0x4b4155['id']},{'name':_0x3b53('0x11'),'value':_0x4b4155['id']},{'name':'description','value':intUtil[_0x3b53('0xe')](_0x32fcd4['Descriptions'],_0x2300f2,'\x0a')},{'name':'date_start','value':_0x1dd24e[_0x3b53('0x12')]()[_0x3b53('0x13')](0x0,0x13)[_0x3b53('0x14')]('T','\x20')},{'name':_0x3b53('0x15'),'value':'0'},{'name':_0x3b53('0x16'),'value':'15'},{'name':_0x3b53('0x17'),'value':_0x10f5bf['id']},{'name':_0x3b53('0x18'),'value':_0x3b53('0x19')},{'name':'parent_name','value':_0x10f5bf[_0x3b53('0xd')]},{'name':_0x3b53('0x1a'),'value':_0x1f9ac8}];if(_0x1dd39f[_0x3b53('0x1b')]){_[_0x3b53('0x1c')](_0x1dd39f,function(_0x25d06c){if(_0x2300f2[_0x25d06c['variableName']]){_0x443547['push']({'name':_0x25d06c[_0x3b53('0x1d')],'value':_0x2300f2[_0x25d06c[_0x3b53('0x1e')]]});}});}return request({'form':{'method':_0x3b53('0x1f'),'input_type':'JSON','response_type':_0x3b53('0x20'),'rest_data':JSON[_0x3b53('0x21')]({'session':_0x23acf8['id'],'module_name':_0x3b53('0x22'),'name_value_list':_0x443547})}});}function getAuth(_0x2b23f4){return util[_0x3b53('0x23')](_0x3b53('0x24'),new Buffer(_0x2b23f4['apiKey']+':X')[_0x3b53('0x25')]('base64'));}function getServerInfo(_0x1d9fc7){return request({'form':{'method':_0x3b53('0x26'),'input_type':_0x3b53('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1d9fc7['id']})}});}function getUser(_0x3897ea,_0x1619ac,_0x3aa452){if(!_[_0x3b53('0x27')](_0x1619ac)){logger[_0x3b53('0xc')](_0x3b53('0x28'),_0x1619ac);return request({'form':{'method':_0x3b53('0x29'),'input_type':'JSON','response_type':_0x3b53('0x20'),'rest_data':JSON[_0x3b53('0x21')]({'session':_0x3aa452['id'],'module_name':_0x3b53('0x2a'),'query':util['format'](_0x3b53('0x2b'),_0x1619ac),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x30e1c3){if(_0x30e1c3[_0x3b53('0x2c')][_0x3b53('0x1b')]){var _0x5c7b19=_[_0x3b53('0x2d')](_0x30e1c3[_0x3b53('0x2c')],function(_0x949c33){return _0x949c33[_0x3b53('0x2e')][_0x3b53('0x2f')]['value']===_0x1619ac;});if(_0x5c7b19){logger[_0x3b53('0xc')]('Agent\x20found!');return BPromise[_0x3b53('0x30')]({'id':_0x5c7b19['name_value_list']['id'][_0x3b53('0x31')],'name':_0x5c7b19[_0x3b53('0x2e')]['name'][_0x3b53('0x31')]});}}logger[_0x3b53('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3b53('0x30')]({'id':_0x3aa452[_0x3b53('0x2e')][_0x3b53('0x32')][_0x3b53('0x31')],'name':_0x3aa452['name_value_list'][_0x3b53('0x2f')]['value']});});}else{logger['info'](_0x3b53('0x33'));return BPromise[_0x3b53('0x30')]({'id':_0x3aa452['name_value_list'][_0x3b53('0x32')][_0x3b53('0x31')],'name':_0x3aa452[_0x3b53('0x2e')][_0x3b53('0x2f')]['value']});}}function getEndUser(_0x39e2e6,_0x3bcad9,_0x2e29b7,_0x4c4fc1){logger[_0x3b53('0xc')]('Searching\x20enduser\x20with\x20phone',_0x2e29b7);return request({'form':{'method':_0x3b53('0x29'),'input_type':_0x3b53('0x20'),'response_type':_0x3b53('0x20'),'rest_data':JSON[_0x3b53('0x21')]({'session':_0x4c4fc1['id'],'module_name':_0x3b53('0x19'),'query':util['format'](_0x3b53('0x34'),_0x2e29b7),'order_by':'','offset':'0','select_fields':['id',_0x3b53('0xd'),_0x3b53('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3b53('0x36')](function(_0x70334a){if(_0x70334a[_0x3b53('0x2c')][_0x3b53('0x1b')]){var _0x3d9918=_[_0x3b53('0x2d')](_0x70334a[_0x3b53('0x2c')],function(_0x36fd7b){return _0x36fd7b[_0x3b53('0x2e')][_0x3b53('0x35')][_0x3b53('0x31')]===_0x2e29b7;});if(_0x3d9918){logger[_0x3b53('0xc')](_0x3b53('0x37'));return BPromise['resolve']({'id':_0x3d9918[_0x3b53('0x2e')]['id'][_0x3b53('0x31')],'name':_0x3d9918[_0x3b53('0x2e')][_0x3b53('0xd')]['value'],'phone':_0x3d9918[_0x3b53('0x2e')][_0x3b53('0x35')][_0x3b53('0x31')]});}}else{logger[_0x3b53('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3b53('0x21')]({'session':_0x4c4fc1['id'],'module_name':_0x3b53('0x19'),'name_value_list':[{'name':'first_name','value':_0x3bcad9!==_0x3b53('0x38')?_0x3bcad9:util[_0x3b53('0x23')](_0x3b53('0x39'),_0x2e29b7)},{'name':_0x3b53('0x35'),'value':_0x2e29b7}]})}})[_0x3b53('0x36')](function(_0x3d227d){logger[_0x3b53('0xc')](_0x3b53('0x3a'));return BPromise[_0x3b53('0x30')]({'id':_0x3d227d['id'],'name':_0x3d227d[_0x3b53('0x2c')][_0x3b53('0x3b')][_0x3b53('0x31')],'phone':_0x3d227d['entry_list'][_0x3b53('0x35')][_0x3b53('0x31')]});});}});}function request(_0x439915){logger[_0x3b53('0x3c')](_0x3b53('0x3d'),JSON['stringify'](_0x439915));return rp(_[_0x3b53('0x3e')](def,_0x439915));}function getTags(_0x54e036,_0x46df5a){var _0x5f4940=[];if(_0x54e036&&_0x54e036['length']>0x0){_0x5f4940=_[_0x3b53('0x3f')](_0x54e036,_0x46df5a);}return _0x5f4940;}function getCustomFields(_0x261eba,_0x5dc18b){var _0x35cb0a=[];var _0x413506={'custom_fields':[]};if(_0x261eba['length']>0x0){_[_0x3b53('0x1c')](_0x261eba,function(_0x1d409f){if(_0x1d409f[_0x3b53('0x40')]===_0x3b53('0x41')&&_0x1d409f[_0x3b53('0x42')]&&!_0x1d409f[_0x3b53('0x43')]){_0x413506[_0x1d409f[_0x3b53('0x42')][_0x3b53('0x44')]()]=_0x1d409f[_0x3b53('0x45')][_0x3b53('0x25')]();}else if(_0x1d409f[_0x3b53('0x40')]===_0x3b53('0x41')&&_0x1d409f[_0x3b53('0x1d')]&&_0x1d409f[_0x3b53('0x43')]){_0x413506[_0x3b53('0x46')][_0x3b53('0x47')]({'id':_0x1d409f[_0x3b53('0x1d')],'value':_0x1d409f['content'][_0x3b53('0x25')]()});}else if(_0x1d409f[_0x3b53('0x40')]===_0x3b53('0x48')&&_0x1d409f[_0x3b53('0x1e')]&&_0x1d409f[_0x3b53('0x1d')]&&_0x1d409f[_0x3b53('0x43')]){_0x5dc18b[_0x1d409f['variableName']]&&_0x413506[_0x3b53('0x46')]['push']({'id':_0x1d409f[_0x3b53('0x1d')],'value':_0x5dc18b[_0x1d409f[_0x3b53('0x1e')]]['toString']()});}else if(_0x1d409f[_0x3b53('0x40')]===_0x3b53('0x49')&&_0x1d409f[_0x3b53('0x4a')]&&_0x1d409f[_0x3b53('0x4a')]['name']&&_0x1d409f[_0x3b53('0x1d')]&&_0x1d409f[_0x3b53('0x43')]){_0x5dc18b[_0x1d409f['Variable'][_0x3b53('0xd')][_0x3b53('0x44')]()]&&_0x413506[_0x3b53('0x46')][_0x3b53('0x47')]({'id':_0x1d409f[_0x3b53('0x1d')],'value':_0x5dc18b[_0x1d409f[_0x3b53('0x4a')][_0x3b53('0xd')][_0x3b53('0x44')]()][_0x3b53('0x25')]()});}});}return _0x413506;}function getConnection(_0x3201e8){return request({'method':_0x3b53('0xb'),'form':{'method':'login','input_type':_0x3b53('0x20'),'response_type':_0x3b53('0x20'),'rest_data':JSON[_0x3b53('0x21')]({'user_auth':{'user_name':_0x3201e8['username'],'password':_0x3201e8[_0x3b53('0x4b')],'encryption':_0x3b53('0x4c')},'application':_0x3b53('0x4d')})}})[_0x3b53('0x36')](function(_0x483731){var _0xc619bc=_0x483731;if(_0xc619bc['id']){def[_0x3b53('0x4e')]=_0xc619bc['id'];return BPromise[_0x3b53('0x30')](_0xc619bc);}else{throw new Error(util[_0x3b53('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x3201e8['id']));}});}function setRelationship(_0x2336a6,_0x1862ed,_0xad5e11,_0x213d74){return request({'form':{'method':'set_relationship','input_type':_0x3b53('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2336a6['id'],'module_name':_0x3b53('0x22'),'module_id':_0xad5e11['id'],'link_field_name':_0x213d74,'related_ids':[_0x1862ed['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3b53('0x4f')]=function(_0x51171c,_0xeb018a,_0x1fb075,_0x4a353d,_0x4d0d1e,_0x3f6657){var _0x3a39f0,_0x29c640,_0x2d7df5,_0x76418f;_0x3f6657[_0x3b53('0x50')]=intUtil[_0x3b53('0x51')](_0x3f6657[_0x3b53('0x50')]);_0x3f6657[_0x3b53('0x52')]=intUtil[_0x3b53('0x51')](_0x3f6657[_0x3b53('0x52')]);def[_0x3b53('0x53')]=util[_0x3b53('0x23')]('%s/service/v4_1/rest.php',_0x3f6657['remoteUri']);if(_0x4d0d1e&&_0x4d0d1e[_0x3b53('0x54')]){logger['info'](_0x3b53('0x55'),_0x3b53('0x56'));_0xeb018a[_0x3b53('0x57')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f6657[_0x3b53('0x52')],_0xeb018a[_0x3b53('0x58')],md5(_0xeb018a[_0x3b53('0x58')]));}else{_0xeb018a[_0x3b53('0x57')]='';}return getConnection(_0x3f6657)['then'](function(_0x4d81d8){_0x76418f=_0x4d81d8;return getUser(_0x3f6657,_0x4a353d[_0x3b53('0xd')],_0x76418f);})['then'](function(_0x3e1dc6){_0x3a39f0=_0x3e1dc6;logger[_0x3b53('0xc')](_0x3b53('0x59'),_0x3a39f0['id']);return getEndUser(_0x3f6657,_0xeb018a['calleridname'],_0xeb018a['calleridnum'],_0x76418f);})[_0x3b53('0x36')](function(_0x208564){_0x29c640=_0x208564;logger[_0x3b53('0xc')](_0x3b53('0x5a'),_0x29c640['id']);return getTicket(_0x3f6657,_0x3a39f0,_0x29c640,_0x1fb075,_0xeb018a,_0x1fb075['Fields'],_0x76418f,_0x3b53('0x5b'));})[_0x3b53('0x36')](function(_0x1dd792){_0x2d7df5=_0x1dd792;logger[_0x3b53('0xc')](_0x3b53('0x5c'));logger[_0x3b53('0xc')](_0x3b53('0x5d'),_0x2d7df5['id']);return setRelationship(_0x76418f,_0x3a39f0,_0x2d7df5,_0x3b53('0x5e'));})[_0x3b53('0x36')](function(){return setRelationship(_0x76418f,_0x29c640,_0x2d7df5,_0x3b53('0x5f'));})[_0x3b53('0x36')](function(){return getServerInfo(_0x76418f);})['then'](function(_0x58416c){var _0x4a372d=parseInt(_0x58416c[_0x3b53('0x60')][_0x3b53('0x61')](0x0));var _0x1433db=util['format'](_0x3b53('0x62'),_0x3f6657[_0x3b53('0x50')],_0x2d7df5['id']);if(_0x4a372d>0x6){_0x1433db=util[_0x3b53('0x23')](_0x3b53('0x63'),_0x3f6657[_0x3b53('0x50')],_0x2d7df5['id']);}logger[_0x3b53('0xc')](_0x3b53('0x55'),_0x3b53('0x64'));emit(util[_0x3b53('0x23')]('user:%s',_0x4a353d[_0x3b53('0xd')]),'trigger:browser:url',{'uri':_0x1433db});})[_0x3b53('0x65')](function(_0x525a0e){logger[_0x3b53('0x66')]('[QUEUE]',JSON[_0x3b53('0x21')](_0x525a0e));});};exports['outbound']=function(_0x2423c7,_0x873bea,_0x58a554,_0x515a03,_0x7d0544,_0x59aae5,_0x588f66){var _0x3b8482,_0x2c80f5,_0x5354f7,_0x1d22f7;_0x59aae5[_0x3b53('0x50')]=intUtil[_0x3b53('0x51')](_0x59aae5[_0x3b53('0x50')]);_0x59aae5['serverUrl']=intUtil['stripTrailingSlash'](_0x59aae5[_0x3b53('0x52')]);def[_0x3b53('0x53')]=util[_0x3b53('0x23')](_0x3b53('0x67'),_0x59aae5[_0x3b53('0x50')]);if(_0x588f66&&_0x588f66[_0x3b53('0x68')]&&_0x588f66[_0x3b53('0x68')]!==_0x3b53('0x69')){logger['info'](_0x3b53('0x6a'),_0x3b53('0x56'));_0x873bea[_0x3b53('0x57')]=util[_0x3b53('0x23')](_0x3b53('0x6b'),_0x59aae5[_0x3b53('0x52')],_0x873bea[_0x3b53('0x58')],md5(_0x873bea['uniqueid']));}return getConnection(_0x59aae5)['then'](function(_0x41403a){_0x1d22f7=_0x41403a;return getUser(_0x59aae5,_0x515a03[_0x3b53('0xd')],_0x1d22f7);})[_0x3b53('0x36')](function(_0x5ad3f8){_0x3b8482=_0x5ad3f8;logger[_0x3b53('0xc')](_0x3b53('0x59'),_0x3b8482['id']);return getEndUser(_0x59aae5,_0x873bea[_0x3b53('0x6c')],_0x873bea[_0x3b53('0x6d')],_0x1d22f7);})[_0x3b53('0x36')](function(_0x625db6){_0x2c80f5=_0x625db6;logger[_0x3b53('0xc')]('The\x20Enduser\x20ID\x20is:',_0x2c80f5['id']);return getTicket(_0x59aae5,_0x3b8482,_0x2c80f5,_0x58a554,_0x873bea,_0x58a554[_0x3b53('0x6e')],_0x1d22f7,_0x3b53('0x6f'));})[_0x3b53('0x36')](function(_0x589dd0){_0x5354f7=_0x589dd0;logger['info']('Ticket\x20created!');logger[_0x3b53('0xc')](_0x3b53('0x5d'),_0x5354f7['id']);return setRelationship(_0x1d22f7,_0x3b8482,_0x5354f7,'users');})['then'](function(){return setRelationship(_0x1d22f7,_0x2c80f5,_0x5354f7,'contacts');})[_0x3b53('0x36')](function(){return getServerInfo(_0x1d22f7);})['then'](function(_0x3ca58e){var _0x2bee4d=parseInt(_0x3ca58e['version'][_0x3b53('0x61')](0x0));var _0x2b1581=util['format'](_0x3b53('0x62'),_0x59aae5[_0x3b53('0x50')],_0x5354f7['id']);if(_0x2bee4d>0x6){_0x2b1581=util[_0x3b53('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x59aae5[_0x3b53('0x50')],_0x5354f7['id']);}logger[_0x3b53('0xc')](_0x3b53('0x6a'),_0x3b53('0x64'));emit(util['format']('user:%s',_0x515a03['name']),_0x3b53('0x70'),{'uri':_0x2b1581});})['catch'](function(_0x377373){logger[_0x3b53('0x66')](_0x3b53('0x6a'),JSON[_0x3b53('0x21')](_0x377373));});};exports[_0x3b53('0x71')]=function(_0x304050,_0x38c3c7,_0x33c5b8,_0x2cf4ec,_0x5db566,_0x1b6d99){var _0x49f897,_0x2fba5c,_0x325e9b,_0x23c607;_0x1b6d99[_0x3b53('0x50')]=intUtil['stripTrailingSlash'](_0x1b6d99[_0x3b53('0x50')]);_0x1b6d99[_0x3b53('0x52')]=intUtil['stripTrailingSlash'](_0x1b6d99['serverUrl']);def[_0x3b53('0x53')]=util['format'](_0x3b53('0x67'),_0x1b6d99[_0x3b53('0x50')]);if(_0x5db566&&_0x5db566[_0x3b53('0x54')]){logger[_0x3b53('0xc')]('['+_0x38c3c7[_0x3b53('0x72')]['toUpperCase']()+']',_0x3b53('0x56'));_0x38c3c7[_0x3b53('0x57')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b6d99[_0x3b53('0x52')],_0x38c3c7['uniqueid'],md5(_0x38c3c7[_0x3b53('0x58')]));}else{_0x38c3c7[_0x3b53('0x57')]='';}return getConnection(_0x1b6d99)['then'](function(_0x30ce39){_0x23c607=_0x30ce39;if(!_['isNil'](_0x2cf4ec)){return getUser(_0x1b6d99,_0x2cf4ec[_0x3b53('0xd')],_0x23c607);}else{return getUser(_0x1b6d99,null,_0x23c607);}})[_0x3b53('0x36')](function(_0x6086bb){_0x49f897=_0x6086bb;logger[_0x3b53('0xc')](_0x3b53('0x59'),_0x49f897['id']);return getEndUser(_0x1b6d99,_0x38c3c7[_0x3b53('0x73')],_0x38c3c7[_0x3b53('0x74')],_0x23c607);})['then'](function(_0x532cac){_0x2fba5c=_0x532cac;logger['info'](_0x3b53('0x5a'),_0x2fba5c['id']);return getTicket(_0x1b6d99,_0x49f897,_0x2fba5c,_0x33c5b8,_0x38c3c7,_0x33c5b8['Fields'],_0x23c607,_0x3b53('0x5b'));})[_0x3b53('0x36')](function(_0x4ec494){_0x325e9b=_0x4ec494;logger[_0x3b53('0xc')](_0x3b53('0x5c'));logger[_0x3b53('0xc')](_0x3b53('0x5d'),_0x325e9b['id']);return setRelationship(_0x23c607,_0x49f897,_0x325e9b,_0x3b53('0x5e'));})[_0x3b53('0x36')](function(){return setRelationship(_0x23c607,_0x2fba5c,_0x325e9b,_0x3b53('0x5f'));})[_0x3b53('0x36')](function(){return getServerInfo(_0x23c607);})[_0x3b53('0x65')](function(_0x195583){logger[_0x3b53('0x66')]('['+_0x38c3c7[_0x3b53('0x72')][_0x3b53('0x75')]()+']',JSON['stringify'](_0x195583));});}; \ 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 8b27708..603bf66 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 _0x1b46=['keyType','key','%s:\x20%s','format','join','slice','substring','isNil','test','lodash','util','getString','length','type','string','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','push','keyValue'];(function(_0x166294,_0x175bc9){var _0x304968=function(_0x119ed1){while(--_0x119ed1){_0x166294['push'](_0x166294['shift']());}};_0x304968(++_0x175bc9);}(_0x1b46,0x6d));var _0x61b4=function(_0x26ef1d,_0x37716e){_0x26ef1d=_0x26ef1d-0x0;var _0x2ec844=_0x1b46[_0x26ef1d];return _0x2ec844;};'use strict';var _=require(_0x61b4('0x0'));var util=require(_0x61b4('0x1'));exports[_0x61b4('0x2')]=function(_0x24a58a,_0x3c0542,_0x156738){var _0x10aab5=[];if(_0x24a58a[_0x61b4('0x3')]>0x0){var _0x5b2184=_['sortBy'](_0x24a58a,['id']);for(var _0x1f7e2e=0x0;_0x1f7e2e<_0x5b2184[_0x61b4('0x3')];_0x1f7e2e++){var _0x1a0035=_0x5b2184[_0x1f7e2e];if(_0x1a0035[_0x61b4('0x4')]===_0x61b4('0x5')){_0x10aab5['push'](_0x1a0035[_0x61b4('0x6')]);}else if(_0x1a0035[_0x61b4('0x4')]===_0x61b4('0x7')&&_0x1a0035[_0x61b4('0x8')]){_0x3c0542[_0x1a0035[_0x61b4('0x8')]]&&_0x10aab5['push'](_0x3c0542[_0x1a0035[_0x61b4('0x8')]][_0x61b4('0x9')]());}else if(_0x1a0035[_0x61b4('0x4')]===_0x61b4('0xa')&&_0x1a0035[_0x61b4('0xb')]&&_0x1a0035[_0x61b4('0xb')]['name']){_0x3c0542[_0x1a0035['Variable'][_0x61b4('0xc')][_0x61b4('0xd')]()]&&_0x10aab5[_0x61b4('0xe')](_0x3c0542[_0x1a0035[_0x61b4('0xb')][_0x61b4('0xc')]['toLowerCase']()][_0x61b4('0x9')]());}else if(_0x1a0035[_0x61b4('0x4')]===_0x61b4('0xf')){if(_0x1a0035[_0x61b4('0x10')]===_0x61b4('0x5')&&_0x1a0035[_0x61b4('0x11')]){_0x10aab5[_0x61b4('0xe')](util['format'](_0x61b4('0x12'),_0x1a0035[_0x61b4('0x11')],_0x1a0035['keyContent']));}else if(_0x1a0035[_0x61b4('0x10')]===_0x61b4('0x7')&&_0x1a0035['variableName']&&_0x1a0035['key']){_0x3c0542[_0x1a0035[_0x61b4('0x8')]]&&_0x10aab5['push'](util[_0x61b4('0x13')](_0x61b4('0x12'),_0x1a0035['key'],_0x3c0542[_0x1a0035[_0x61b4('0x8')]]));}else if(_0x1a0035[_0x61b4('0x10')]==='customVariable'&&_0x1a0035[_0x61b4('0xb')]&&_0x1a0035[_0x61b4('0xb')]['name']&&_0x1a0035[_0x61b4('0x11')]){_0x3c0542[_0x1a0035[_0x61b4('0xb')][_0x61b4('0xc')][_0x61b4('0xd')]()]&&_0x10aab5['push'](util[_0x61b4('0x13')](_0x61b4('0x12'),_0x1a0035[_0x61b4('0x11')],_0x3c0542[_0x1a0035[_0x61b4('0xb')][_0x61b4('0xc')][_0x61b4('0xd')]()]));}}}}return _0x10aab5[_0x61b4('0x14')](_0x156738);};exports['stripTrailingSlash']=function(_0x51c4f5){var _0x135aee=_0x51c4f5[_0x61b4('0x15')](-0x1);if(_0x135aee==='/'){_0x51c4f5=_0x51c4f5[_0x61b4('0x16')](0x0,_0x51c4f5['lastIndexOf'](_0x135aee));}return _0x51c4f5;};exports['validateEmail']=function(_0x5e1d38){if(!_[_0x61b4('0x17')](_0x5e1d38)&&_0x5e1d38!==''){var _0x3687c2=/^(([^<>()\[\]\\.,;:\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 _0x3687c2[_0x61b4('0x18')](String(_0x5e1d38)[_0x61b4('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xf99f=['getString','sortBy','length','string','push','content','type','variableName','toString','customVariable','Variable','toLowerCase','name','keyValue','keyType','key','%s:\x20%s','keyContent','variable','format','join','slice','test','lodash','util'];(function(_0x2e28fe,_0x3c762f){var _0x31cfd1=function(_0x502e29){while(--_0x502e29){_0x2e28fe['push'](_0x2e28fe['shift']());}};_0x31cfd1(++_0x3c762f);}(_0xf99f,0x94));var _0xff99=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0xf99f[_0x5774be];return _0x4914b4;};'use strict';var _=require(_0xff99('0x0'));var util=require(_0xff99('0x1'));exports[_0xff99('0x2')]=function(_0x4d1367,_0x397010,_0x1fc1cb){var _0x45cf8a=[];if(_0x4d1367['length']>0x0){var _0x314728=_[_0xff99('0x3')](_0x4d1367,['id']);for(var _0x49f805=0x0;_0x49f805<_0x314728[_0xff99('0x4')];_0x49f805++){var _0x3df53f=_0x314728[_0x49f805];if(_0x3df53f['type']===_0xff99('0x5')){_0x45cf8a[_0xff99('0x6')](_0x3df53f[_0xff99('0x7')]);}else if(_0x3df53f[_0xff99('0x8')]==='variable'&&_0x3df53f['variableName']){_0x397010[_0x3df53f[_0xff99('0x9')]]&&_0x45cf8a['push'](_0x397010[_0x3df53f[_0xff99('0x9')]][_0xff99('0xa')]());}else if(_0x3df53f[_0xff99('0x8')]===_0xff99('0xb')&&_0x3df53f[_0xff99('0xc')]&&_0x3df53f[_0xff99('0xc')]['name']){_0x397010[_0x3df53f['Variable']['name'][_0xff99('0xd')]()]&&_0x45cf8a[_0xff99('0x6')](_0x397010[_0x3df53f[_0xff99('0xc')][_0xff99('0xe')]['toLowerCase']()]['toString']());}else if(_0x3df53f[_0xff99('0x8')]===_0xff99('0xf')){if(_0x3df53f[_0xff99('0x10')]===_0xff99('0x5')&&_0x3df53f[_0xff99('0x11')]){_0x45cf8a[_0xff99('0x6')](util['format'](_0xff99('0x12'),_0x3df53f['key'],_0x3df53f[_0xff99('0x13')]));}else if(_0x3df53f[_0xff99('0x10')]===_0xff99('0x14')&&_0x3df53f[_0xff99('0x9')]&&_0x3df53f[_0xff99('0x11')]){_0x397010[_0x3df53f[_0xff99('0x9')]]&&_0x45cf8a[_0xff99('0x6')](util[_0xff99('0x15')](_0xff99('0x12'),_0x3df53f[_0xff99('0x11')],_0x397010[_0x3df53f[_0xff99('0x9')]]));}else if(_0x3df53f[_0xff99('0x10')]===_0xff99('0xb')&&_0x3df53f[_0xff99('0xc')]&&_0x3df53f[_0xff99('0xc')][_0xff99('0xe')]&&_0x3df53f['key']){_0x397010[_0x3df53f[_0xff99('0xc')]['name'][_0xff99('0xd')]()]&&_0x45cf8a['push'](util[_0xff99('0x15')](_0xff99('0x12'),_0x3df53f['key'],_0x397010[_0x3df53f[_0xff99('0xc')][_0xff99('0xe')]['toLowerCase']()]));}}}}return _0x45cf8a[_0xff99('0x16')](_0x1fc1cb);};exports['stripTrailingSlash']=function(_0x4a755c){var _0x2d8aba=_0x4a755c[_0xff99('0x17')](-0x1);if(_0x2d8aba==='/'){_0x4a755c=_0x4a755c['substring'](0x0,_0x4a755c['lastIndexOf'](_0x2d8aba));}return _0x4a755c;};exports['validateEmail']=function(_0x37a9e8){if(!_['isNil'](_0x37a9e8)&&_0x37a9e8!==''){var _0xa8d391=/^(([^<>()\[\]\\.,;:\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 _0xa8d391[_0xff99('0x18')](String(_0x37a9e8)[_0xff99('0xd')]());}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 b3558d0..1dbe816 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x1114ce,_0x298547){var _0x3b3acf=function(_0xb914a2){while(--_0xb914a2){_0x1114ce['push'](_0x1114ce['shift']());}};_0x3b3acf(++_0x298547);}(_0xe706,0xa3));var _0x6e70=function(_0xcf7d1e,_0x1b00ad){_0xcf7d1e=_0xcf7d1e-0x0;var _0x42b2cb=_0xe706[_0xcf7d1e];return _0x42b2cb;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index d5dd33f..4771416 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 _0x821e=['debug','stringify','defaults','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','custom_fields','customVariable','Variable','name','queue','serverUrl','stripTrailingSlash','monitor_format','[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:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x821e,0x123));var _0xe821=function(_0x25fc41,_0x250864){_0x25fc41=_0x25fc41-0x0;var _0x1371d1=_0x821e[_0x25fc41];return _0x1371d1;};'use strict';var _=require(_0xe821('0x0'));var rp=require(_0xe821('0x1'));var md5=require(_0xe821('0x2'));var util=require(_0xe821('0x3'));var Redis=require(_0xe821('0x4'));var intUtil=require(_0xe821('0x5'));var config=require(_0xe821('0x6'));var logger=require(_0xe821('0x7'))(_0xe821('0x8'));config[_0xe821('0x9')]=_['defaults'](config['redis'],{'host':_0xe821('0xa'),'port':0x18eb});var io=require(_0xe821('0xb'))(new Redis(config[_0xe821('0x9')]));function emit(_0x46d16d,_0x39e86b,_0xbfaec7){io['to'](_0x46d16d)[_0xe821('0xc')](_0x39e86b,_0xbfaec7);}var headers={'Content-Type':_0xe821('0xd'),'Accept':_0xe821('0xd')};function getTicket(_0x4b542f,_0x3603d5,_0x114c99,_0x473f13,_0x1d5d7f){logger[_0xe821('0xe')](_0xe821('0xf'));return request({'uri':util[_0xe821('0x10')](_0xe821('0x11'),_0x4b542f['remoteUri']),'method':_0xe821('0x12'),'body':{'ticket':_['merge']({'requester_id':_0x114c99['id'],'submitter_id':_0x3603d5?_0x3603d5['id']:undefined,'assignee_id':_0x3603d5?_0x3603d5['id']:undefined,'tags':getTags(_0x473f13[_0xe821('0x13')],'name'),'subject':intUtil[_0xe821('0x14')](_0x473f13[_0xe821('0x15')],_0x1d5d7f,'\x20'),'description':intUtil[_0xe821('0x14')](_0x473f13[_0xe821('0x16')],_0x1d5d7f,'\x0a'),'comment':{'public':![],'body':intUtil[_0xe821('0x14')](_0x473f13['Descriptions'],_0x1d5d7f,'\x0a')}},getCustomFields(_0x473f13[_0xe821('0x17')],_0x1d5d7f))}})[_0xe821('0x18')](function(_0x31308d){logger['info'](_0xe821('0x19'));return _0x31308d[_0xe821('0x1a')];});}function getUser(_0xe7984d,_0x2522fc){if(intUtil[_0xe821('0x1b')](_0x2522fc)){logger[_0xe821('0xe')](_0xe821('0x1c'),_0x2522fc);return request({'uri':util['format'](_0xe821('0x1d'),_0xe7984d['remoteUri']),'qs':{'query':util[_0xe821('0x10')](_0xe821('0x1e'),_0x2522fc)}})[_0xe821('0x18')](function(_0x5d8b96){if(_0x5d8b96[_0xe821('0x1f')]){logger[_0xe821('0xe')]('Agent\x20found!');return _['find'](_0x5d8b96['results'],{'email':_0x2522fc,'role':_0xe821('0x20')});}else{logger[_0xe821('0xe')](_0xe821('0x21'));return request({'uri':util[_0xe821('0x10')]('%s/users/me.json',_0xe7984d[_0xe821('0x22')])})[_0xe821('0x18')](function(_0xe2d10f){logger[_0xe821('0xe')](_0xe821('0x23'));return _0xe2d10f[_0xe821('0x24')];});}});}else{logger[_0xe821('0xe')](_0xe821('0x21'));return request({'uri':util[_0xe821('0x10')](_0xe821('0x25'),_0xe7984d[_0xe821('0x22')])})['then'](function(_0x3548c4){logger[_0xe821('0xe')]('Admin\x20account\x20selected.');return _0x3548c4[_0xe821('0x24')];});}}function getEndUser(_0x6a18e,_0x3be092,_0x4556ee){logger[_0xe821('0xe')](_0xe821('0x26'),_0x4556ee);return request({'uri':util[_0xe821('0x10')](_0xe821('0x1d'),_0x6a18e[_0xe821('0x22')]),'qs':{'query':util['format'](_0xe821('0x27'),_0x4556ee)}})['then'](function(_0x5761c3){var _0x54a8e4;if(_0x5761c3[_0xe821('0x28')][_0xe821('0x29')]){_0x5761c3[_0xe821('0x28')]=_[_0xe821('0x2a')](_0x5761c3[_0xe821('0x28')],{'suspended':![],'role':_0xe821('0x2b')});if(_0x5761c3[_0xe821('0x28')]['length']){_0x54a8e4=_[_0xe821('0x2c')](_0x5761c3[_0xe821('0x28')]);}}if(_0x54a8e4){logger[_0xe821('0xe')](_0xe821('0x2d'));return _0x54a8e4;}else{logger['info'](_0xe821('0x2e'));return request({'uri':util[_0xe821('0x10')](_0xe821('0x2f'),_0x6a18e[_0xe821('0x22')]),'method':_0xe821('0x12'),'body':{'user':{'role':_0xe821('0x2b'),'name':util[_0xe821('0x10')]('Caller\x20-\x20%s',_0x3be092||_0x4556ee),'phone':_0x4556ee}}})[_0xe821('0x18')](function(_0xe79945){logger[_0xe821('0xe')]('Enduser\x20created.');return _0xe79945[_0xe821('0x24')];});}});}function getAuth(_0x530774){var _0x4a7922;if(_0x530774[_0xe821('0x30')]==='password'){_0x4a7922=util[_0xe821('0x10')](_0xe821('0x31'),_0x530774[_0xe821('0x32')],_0x530774[_0xe821('0x33')]);}else if(_0x530774[_0xe821('0x30')]===_0xe821('0x34')){_0x4a7922=util[_0xe821('0x10')](_0xe821('0x35'),_0x530774[_0xe821('0x32')],_0x530774[_0xe821('0x34')]);}return util['format'](_0xe821('0x36'),new Buffer(_0x4a7922)[_0xe821('0x37')](_0xe821('0x38')));}function request(_0x2cc206){logger[_0xe821('0x39')]('[HTTP]',JSON[_0xe821('0x3a')](_0x2cc206));return rp(_[_0xe821('0x3b')](_0x2cc206,{'method':_0xe821('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x58b72a,_0x5c28cb){var _0x566ffd=[];if(_0x58b72a&&_0x58b72a[_0xe821('0x29')]>0x0){_0x566ffd=_[_0xe821('0x3d')](_0x58b72a,_0x5c28cb);}return _0x566ffd;}function getCustomFields(_0x257314,_0x52a6a7){var _0x539068=[];var _0x542447={'custom_fields':[]};if(_0x257314[_0xe821('0x29')]>0x0){_[_0xe821('0x3e')](_0x257314,function(_0x3fa9cc){if(_[_0xe821('0x3f')]([_0xe821('0x40'),_0xe821('0x41')],_0x3fa9cc[_0xe821('0x42')])&&_0x3fa9cc[_0xe821('0x43')]&&!_0x3fa9cc[_0xe821('0x44')]){_0x542447[_0x3fa9cc[_0xe821('0x43')][_0xe821('0x45')]()]=_0x3fa9cc[_0xe821('0x46')][_0xe821('0x37')]();}else if(_[_0xe821('0x3f')](['string',_0xe821('0x41')],_0x3fa9cc[_0xe821('0x42')])&&_0x3fa9cc[_0xe821('0x47')]&&_0x3fa9cc['customField']){_0x542447['custom_fields'][_0xe821('0x48')]({'id':_0x3fa9cc['idField'],'value':_0x3fa9cc[_0xe821('0x46')][_0xe821('0x37')]()});}else if(_0x3fa9cc[_0xe821('0x42')]===_0xe821('0x49')&&_0x3fa9cc[_0xe821('0x4a')]&&_0x3fa9cc[_0xe821('0x47')]&&_0x3fa9cc[_0xe821('0x44')]){_0x52a6a7[_0x3fa9cc[_0xe821('0x4a')]]&&_0x542447[_0xe821('0x4b')][_0xe821('0x48')]({'id':_0x3fa9cc[_0xe821('0x47')],'value':_0x52a6a7[_0x3fa9cc['variableName']][_0xe821('0x37')]()});}else if(_0x3fa9cc[_0xe821('0x42')]===_0xe821('0x4c')&&_0x3fa9cc[_0xe821('0x4d')]&&_0x3fa9cc[_0xe821('0x4d')][_0xe821('0x4e')]&&_0x3fa9cc[_0xe821('0x47')]&&_0x3fa9cc['customField']){_0x52a6a7[_0x3fa9cc['Variable']['name'][_0xe821('0x45')]()]&&_0x542447[_0xe821('0x4b')][_0xe821('0x48')]({'id':_0x3fa9cc[_0xe821('0x47')],'value':_0x52a6a7[_0x3fa9cc['Variable'][_0xe821('0x4e')]['toLowerCase']()]['toString']()});}});}return _0x542447;}exports[_0xe821('0x4f')]=function(_0x322ac7,_0x2e9126,_0x3533bc,_0x2b8dcc,_0xd1eae8,_0x3d0e8){var _0x69ce0b,_0x5b9c36;_0x3d0e8[_0xe821('0x22')]=intUtil['stripTrailingSlash'](_0x3d0e8[_0xe821('0x22')]);_0x3d0e8[_0xe821('0x50')]=intUtil[_0xe821('0x51')](_0x3d0e8[_0xe821('0x50')]);if(_0xd1eae8&&_0xd1eae8[_0xe821('0x52')]){logger['info'](_0xe821('0x53'),'Recording\x20is\x20enabled!');_0x2e9126[_0xe821('0x54')]=util[_0xe821('0x10')](_0xe821('0x55'),_0x3d0e8[_0xe821('0x50')],_0x2e9126[_0xe821('0x56')],md5(_0x2e9126[_0xe821('0x56')]));}else{_0x2e9126[_0xe821('0x54')]='';}headers[_0xe821('0x57')]=getAuth(_0x3d0e8);return getUser(_0x3d0e8,_0x2b8dcc[_0xe821('0x58')])[_0xe821('0x18')](function(_0x4936aa){_0x69ce0b=_0x4936aa;logger[_0xe821('0xe')](_0xe821('0x59'),_0x69ce0b['id']);return getEndUser(_0x3d0e8,_0x2e9126[_0xe821('0x5a')],_0x2e9126[_0xe821('0x5b')]);})[_0xe821('0x18')](function(_0x1e6a41){_0x5b9c36=_0x1e6a41;logger[_0xe821('0xe')](_0xe821('0x5c'),_0x5b9c36['id']);return getTicket(_0x3d0e8,_0x69ce0b,_0x5b9c36,_0x3533bc,_0x2e9126);})[_0xe821('0x18')](function(_0x5c730f){if(_0x5c730f){logger[_0xe821('0xe')](_0xe821('0x5d'),_0x5c730f['id']);switch(_0x3d0e8[_0xe821('0x42')]){case _0xe821('0x5e'):logger['info']('[QUEUE]',_0xe821('0x5f'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3d0e8['remoteUri'],_0x69ce0b['id'],_0x5c730f['id']),'method':'POST'});case _0xe821('0x60'):logger[_0xe821('0xe')](_0xe821('0x53'),_0xe821('0x61'));emit(util[_0xe821('0x10')](_0xe821('0x62'),_0x2b8dcc[_0xe821('0x4e')]),'trigger:browser:url',{'uri':util[_0xe821('0x10')]('%s/agent/tickets/%s',_0x3d0e8[_0xe821('0x22')][_0xe821('0x63')](_0xe821('0x64'),''),_0x5c730f['id'])});break;default:logger[_0xe821('0x65')]('[QUEUE]',_0xe821('0x66'));}}})[_0xe821('0x67')](function(_0xbe3697){logger[_0xe821('0x65')](_0xe821('0x68'),util[_0xe821('0x69')](_0xbe3697,{'showHidden':!![],'depth':null}));});};exports[_0xe821('0x6a')]=function(_0x4b6eb9,_0x3cc54a,_0x773772,_0x4bb6ac,_0x4f9bb9,_0x519409,_0x411f80){var _0x3c66ca,_0x5057fa;_0x519409[_0xe821('0x22')]=intUtil['stripTrailingSlash'](_0x519409[_0xe821('0x22')]);_0x519409[_0xe821('0x50')]=intUtil[_0xe821('0x51')](_0x519409[_0xe821('0x50')]);if(_0x411f80&&_0x411f80[_0xe821('0x6b')]&&_0x411f80[_0xe821('0x6b')]!=='none'){logger[_0xe821('0xe')](_0xe821('0x6c'),_0xe821('0x6d'));_0x3cc54a[_0xe821('0x54')]=util[_0xe821('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x519409[_0xe821('0x50')],_0x3cc54a[_0xe821('0x56')],md5(_0x3cc54a[_0xe821('0x56')]));}headers[_0xe821('0x57')]=getAuth(_0x519409);return getUser(_0x519409,_0x4bb6ac[_0xe821('0x58')])[_0xe821('0x18')](function(_0x207324){_0x3c66ca=_0x207324;logger[_0xe821('0xe')](_0xe821('0x59'),_0x3c66ca['id']);return getEndUser(_0x519409,_0x3cc54a[_0xe821('0x6e')],_0x3cc54a['destcalleridnum']);})[_0xe821('0x18')](function(_0x57fbe2){_0x5057fa=_0x57fbe2;logger[_0xe821('0xe')](_0xe821('0x5c'),_0x5057fa['id']);return getTicket(_0x519409,_0x3c66ca,_0x5057fa,_0x773772,_0x3cc54a);})['then'](function(_0x48c7e2){if(_0x48c7e2){logger[_0xe821('0xe')](_0xe821('0x5d'),_0x48c7e2['id']);switch(_0x519409['type']){case'integrationTab':logger['info'](_0xe821('0x6c'),_0xe821('0x5f'));return request({'uri':util[_0xe821('0x10')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x519409['remoteUri'],_0x3c66ca['id'],_0x48c7e2['id']),'method':_0xe821('0x12')});case _0xe821('0x60'):logger['info']('[OUTBOUND]',_0xe821('0x61'));emit(util[_0xe821('0x10')](_0xe821('0x62'),_0x4bb6ac[_0xe821('0x4e')]),'trigger:browser:url',{'uri':util[_0xe821('0x10')]('%s/agent/tickets/%s',_0x519409['remoteUri'][_0xe821('0x63')](_0xe821('0x64'),''),_0x48c7e2['id'])});break;default:logger['error'](_0xe821('0x6c'),_0xe821('0x66'));}}})[_0xe821('0x67')](function(_0x28c5cb){logger['error'](_0xe821('0x6f'),util[_0xe821('0x69')](_0x28c5cb,{'showHidden':!![],'depth':null}));});};exports[_0xe821('0x70')]=function(_0x47b430,_0x5ce8e5,_0x27e48d,_0xfeb2ed,_0x28c225,_0x5362b1){var _0x5a73f1,_0x3812a1;_0x5362b1[_0xe821('0x22')]=intUtil[_0xe821('0x51')](_0x5362b1[_0xe821('0x22')]);_0x5362b1[_0xe821('0x50')]=intUtil['stripTrailingSlash'](_0x5362b1[_0xe821('0x50')]);if(_0x28c225&&_0x28c225['monitor_format']){logger['info']('['+_0x5ce8e5[_0xe821('0x71')][_0xe821('0x72')]()+']',_0xe821('0x6d'));_0x5ce8e5['recordingURL']=util[_0xe821('0x10')](_0xe821('0x55'),_0x5362b1[_0xe821('0x50')],_0x5ce8e5[_0xe821('0x56')],md5(_0x5ce8e5[_0xe821('0x56')]));}else{_0x5ce8e5[_0xe821('0x54')]='';}headers['Authorization']=getAuth(_0x5362b1);return getUser(_0x5362b1)[_0xe821('0x18')](function(_0x5595af){_0x5a73f1=_0x5595af;logger['info'](_0xe821('0x59'),_0x5a73f1['id']);return getEndUser(_0x5362b1,_0x5ce8e5[_0xe821('0x5a')],_0x5ce8e5[_0xe821('0x5b')]);})[_0xe821('0x18')](function(_0x1efb46){_0x3812a1=_0x1efb46;logger[_0xe821('0xe')](_0xe821('0x5c'),_0x3812a1['id']);return getTicket(_0x5362b1,_0x5a73f1,_0x3812a1,_0x27e48d,_0x5ce8e5);})[_0xe821('0x18')](function(_0x1426b6){if(_0x1426b6){logger[_0xe821('0xe')](_0xe821('0x5d'),_0x1426b6['id']);}})[_0xe821('0x67')](function(_0x3d4532){logger['error']('['+_0x5ce8e5[_0xe821('0x71')][_0xe821('0x72')]()+']'+_0xe821('0x73'),util['inspect'](_0x3d4532,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4db3=['forEach','includes','string','type','nameField','customField','picklist','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','Enduser\x20found!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','GET'];(function(_0x3c260a,_0x1ab69e){var _0x139f82=function(_0x51b7bd){while(--_0x51b7bd){_0x3c260a['push'](_0x3c260a['shift']());}};_0x139f82(++_0x1ab69e);}(_0x4db3,0xa8));var _0x34db=function(_0xefefc3,_0x3fbe3b){_0xefefc3=_0xefefc3-0x0;var _0xc6272b=_0x4db3[_0xefefc3];return _0xc6272b;};'use strict';var _=require(_0x34db('0x0'));var rp=require(_0x34db('0x1'));var md5=require(_0x34db('0x2'));var util=require(_0x34db('0x3'));var Redis=require(_0x34db('0x4'));var intUtil=require(_0x34db('0x5'));var config=require(_0x34db('0x6'));var logger=require(_0x34db('0x7'))(_0x34db('0x8'));config[_0x34db('0x9')]=_[_0x34db('0xa')](config[_0x34db('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x34db('0x9')]));function emit(_0x5a8deb,_0x4e7212,_0x5bf2e7){io['to'](_0x5a8deb)[_0x34db('0xb')](_0x4e7212,_0x5bf2e7);}var headers={'Content-Type':_0x34db('0xc'),'Accept':'application/json'};function getTicket(_0x237f1c,_0x51b965,_0x34c318,_0x350c9f,_0x3bdb85){logger[_0x34db('0xd')](_0x34db('0xe'));return request({'uri':util[_0x34db('0xf')](_0x34db('0x10'),_0x237f1c['remoteUri']),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x34c318['id'],'submitter_id':_0x51b965?_0x51b965['id']:undefined,'assignee_id':_0x51b965?_0x51b965['id']:undefined,'tags':getTags(_0x350c9f[_0x34db('0x11')],'name'),'subject':intUtil[_0x34db('0x12')](_0x350c9f[_0x34db('0x13')],_0x3bdb85,'\x20'),'description':intUtil[_0x34db('0x12')](_0x350c9f['Descriptions'],_0x3bdb85,'\x0a'),'comment':{'public':![],'body':intUtil[_0x34db('0x12')](_0x350c9f[_0x34db('0x14')],_0x3bdb85,'\x0a')}},getCustomFields(_0x350c9f[_0x34db('0x15')],_0x3bdb85))}})[_0x34db('0x16')](function(_0x502f59){logger['info'](_0x34db('0x17'));return _0x502f59['ticket'];});}function getUser(_0x595ad8,_0x3e60ec){if(intUtil[_0x34db('0x18')](_0x3e60ec)){logger[_0x34db('0xd')]('Getting\x20agent\x20with\x20email',_0x3e60ec);return request({'uri':util['format'](_0x34db('0x19'),_0x595ad8[_0x34db('0x1a')]),'qs':{'query':util[_0x34db('0xf')](_0x34db('0x1b'),_0x3e60ec)}})[_0x34db('0x16')](function(_0xcd8272){if(_0xcd8272[_0x34db('0x1c')]){logger[_0x34db('0xd')](_0x34db('0x1d'));return _[_0x34db('0x1e')](_0xcd8272[_0x34db('0x1f')],{'email':_0x3e60ec,'role':_0x34db('0x20')});}else{logger[_0x34db('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x34db('0xf')](_0x34db('0x21'),_0x595ad8[_0x34db('0x1a')])})['then'](function(_0x29aa89){logger[_0x34db('0xd')](_0x34db('0x22'));return _0x29aa89[_0x34db('0x23')];});}});}else{logger[_0x34db('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x34db('0xf')](_0x34db('0x21'),_0x595ad8['remoteUri'])})['then'](function(_0x49c275){logger[_0x34db('0xd')](_0x34db('0x22'));return _0x49c275[_0x34db('0x23')];});}}function getEndUser(_0x17a831,_0x1d6da7,_0x2287f4){logger[_0x34db('0xd')](_0x34db('0x24'),_0x2287f4);return request({'uri':util['format']('%s/search.json',_0x17a831[_0x34db('0x1a')]),'qs':{'query':util[_0x34db('0xf')]('type:user\x20role:end-user\x20phone:%s',_0x2287f4)}})[_0x34db('0x16')](function(_0x12e133){var _0x212314;if(_0x12e133[_0x34db('0x1f')][_0x34db('0x25')]){_0x12e133[_0x34db('0x1f')]=_[_0x34db('0x26')](_0x12e133[_0x34db('0x1f')],{'suspended':![],'role':_0x34db('0x27')});if(_0x12e133[_0x34db('0x1f')]['length']){_0x212314=_['first'](_0x12e133[_0x34db('0x1f')]);}}if(_0x212314){logger['info'](_0x34db('0x28'));return _0x212314;}else{logger[_0x34db('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x34db('0xf')](_0x34db('0x29'),_0x17a831[_0x34db('0x1a')]),'method':_0x34db('0x2a'),'body':{'user':{'role':_0x34db('0x27'),'name':util[_0x34db('0xf')](_0x34db('0x2b'),_0x1d6da7||_0x2287f4),'phone':_0x2287f4}}})[_0x34db('0x16')](function(_0x4bd44e){logger[_0x34db('0xd')](_0x34db('0x2c'));return _0x4bd44e[_0x34db('0x23')];});}});}function getAuth(_0x30bb25){var _0x2ffce9;if(_0x30bb25['authType']===_0x34db('0x2d')){_0x2ffce9=util[_0x34db('0xf')](_0x34db('0x2e'),_0x30bb25[_0x34db('0x2f')],_0x30bb25[_0x34db('0x2d')]);}else if(_0x30bb25[_0x34db('0x30')]===_0x34db('0x31')){_0x2ffce9=util[_0x34db('0xf')](_0x34db('0x32'),_0x30bb25[_0x34db('0x2f')],_0x30bb25[_0x34db('0x31')]);}return util['format'](_0x34db('0x33'),new Buffer(_0x2ffce9)[_0x34db('0x34')]('base64'));}function request(_0x42fe01){logger[_0x34db('0x35')](_0x34db('0x36'),JSON['stringify'](_0x42fe01));return rp(_[_0x34db('0xa')](_0x42fe01,{'method':_0x34db('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x5505f1,_0x513370){var _0x557b76=[];if(_0x5505f1&&_0x5505f1[_0x34db('0x25')]>0x0){_0x557b76=_['map'](_0x5505f1,_0x513370);}return _0x557b76;}function getCustomFields(_0x1178ac,_0x3e5806){var _0x54b282=[];var _0x13e226={'custom_fields':[]};if(_0x1178ac[_0x34db('0x25')]>0x0){_[_0x34db('0x38')](_0x1178ac,function(_0x59975f){if(_[_0x34db('0x39')]([_0x34db('0x3a'),'picklist'],_0x59975f[_0x34db('0x3b')])&&_0x59975f[_0x34db('0x3c')]&&!_0x59975f[_0x34db('0x3d')]){_0x13e226[_0x59975f[_0x34db('0x3c')]['toLowerCase']()]=_0x59975f['content'][_0x34db('0x34')]();}else if(_[_0x34db('0x39')]([_0x34db('0x3a'),_0x34db('0x3e')],_0x59975f[_0x34db('0x3b')])&&_0x59975f[_0x34db('0x3f')]&&_0x59975f[_0x34db('0x3d')]){_0x13e226[_0x34db('0x40')][_0x34db('0x41')]({'id':_0x59975f[_0x34db('0x3f')],'value':_0x59975f[_0x34db('0x42')][_0x34db('0x34')]()});}else if(_0x59975f[_0x34db('0x3b')]===_0x34db('0x43')&&_0x59975f['variableName']&&_0x59975f[_0x34db('0x3f')]&&_0x59975f[_0x34db('0x3d')]){_0x3e5806[_0x59975f[_0x34db('0x44')]]&&_0x13e226[_0x34db('0x40')]['push']({'id':_0x59975f['idField'],'value':_0x3e5806[_0x59975f[_0x34db('0x44')]]['toString']()});}else if(_0x59975f[_0x34db('0x3b')]===_0x34db('0x45')&&_0x59975f[_0x34db('0x46')]&&_0x59975f['Variable']['name']&&_0x59975f['idField']&&_0x59975f[_0x34db('0x3d')]){_0x3e5806[_0x59975f['Variable'][_0x34db('0x47')]['toLowerCase']()]&&_0x13e226[_0x34db('0x40')]['push']({'id':_0x59975f[_0x34db('0x3f')],'value':_0x3e5806[_0x59975f['Variable'][_0x34db('0x47')][_0x34db('0x48')]()][_0x34db('0x34')]()});}});}return _0x13e226;}exports['queue']=function(_0xd94126,_0x250e3c,_0x22087a,_0x49a6fc,_0x11210c,_0x3845e0){var _0x102387,_0x2defd0;_0x3845e0['remoteUri']=intUtil['stripTrailingSlash'](_0x3845e0[_0x34db('0x1a')]);_0x3845e0[_0x34db('0x49')]=intUtil[_0x34db('0x4a')](_0x3845e0[_0x34db('0x49')]);if(_0x11210c&&_0x11210c[_0x34db('0x4b')]){logger['info'](_0x34db('0x4c'),'Recording\x20is\x20enabled!');_0x250e3c[_0x34db('0x4d')]=util[_0x34db('0xf')](_0x34db('0x4e'),_0x3845e0[_0x34db('0x49')],_0x250e3c[_0x34db('0x4f')],md5(_0x250e3c[_0x34db('0x4f')]));}else{_0x250e3c[_0x34db('0x4d')]='';}headers[_0x34db('0x50')]=getAuth(_0x3845e0);return getUser(_0x3845e0,_0x49a6fc[_0x34db('0x51')])[_0x34db('0x16')](function(_0x2b6e24){_0x102387=_0x2b6e24;logger['info']('The\x20User\x20ID\x20is:',_0x102387['id']);return getEndUser(_0x3845e0,_0x250e3c[_0x34db('0x52')],_0x250e3c[_0x34db('0x53')]);})[_0x34db('0x16')](function(_0x2f6d2e){_0x2defd0=_0x2f6d2e;logger[_0x34db('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2defd0['id']);return getTicket(_0x3845e0,_0x102387,_0x2defd0,_0x22087a,_0x250e3c);})[_0x34db('0x16')](function(_0x59f7fd){if(_0x59f7fd){logger[_0x34db('0xd')](_0x34db('0x54'),_0x59f7fd['id']);switch(_0x3845e0[_0x34db('0x3b')]){case _0x34db('0x55'):logger[_0x34db('0xd')](_0x34db('0x4c'),_0x34db('0x56'));return request({'uri':util[_0x34db('0xf')](_0x34db('0x57'),_0x3845e0[_0x34db('0x1a')],_0x102387['id'],_0x59f7fd['id']),'method':'POST'});case _0x34db('0x58'):logger[_0x34db('0xd')](_0x34db('0x4c'),_0x34db('0x59'));emit(util['format'](_0x34db('0x5a'),_0x49a6fc['name']),_0x34db('0x5b'),{'uri':util[_0x34db('0xf')](_0x34db('0x5c'),_0x3845e0[_0x34db('0x1a')]['replace'](_0x34db('0x5d'),''),_0x59f7fd['id'])});break;default:logger[_0x34db('0x5e')](_0x34db('0x4c'),_0x34db('0x5f'));}}})[_0x34db('0x60')](function(_0x572ab2){logger[_0x34db('0x5e')](_0x34db('0x61'),util[_0x34db('0x62')](_0x572ab2,{'showHidden':!![],'depth':null}));});};exports[_0x34db('0x63')]=function(_0x7b6474,_0x4fb208,_0x10af53,_0x2632e9,_0x5d02ca,_0x746877,_0x4d7b13){var _0x1c0a1d,_0x3010aa;_0x746877['remoteUri']=intUtil[_0x34db('0x4a')](_0x746877[_0x34db('0x1a')]);_0x746877['serverUrl']=intUtil[_0x34db('0x4a')](_0x746877[_0x34db('0x49')]);if(_0x4d7b13&&_0x4d7b13[_0x34db('0x64')]&&_0x4d7b13['recordingFormat']!==_0x34db('0x65')){logger[_0x34db('0xd')](_0x34db('0x66'),_0x34db('0x67'));_0x4fb208[_0x34db('0x4d')]=util[_0x34db('0xf')](_0x34db('0x4e'),_0x746877[_0x34db('0x49')],_0x4fb208[_0x34db('0x4f')],md5(_0x4fb208['uniqueid']));}headers[_0x34db('0x50')]=getAuth(_0x746877);return getUser(_0x746877,_0x2632e9['email'])[_0x34db('0x16')](function(_0x5d2edf){_0x1c0a1d=_0x5d2edf;logger[_0x34db('0xd')]('The\x20User\x20ID\x20is:',_0x1c0a1d['id']);return getEndUser(_0x746877,_0x4fb208[_0x34db('0x68')],_0x4fb208[_0x34db('0x69')]);})[_0x34db('0x16')](function(_0x290c43){_0x3010aa=_0x290c43;logger[_0x34db('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3010aa['id']);return getTicket(_0x746877,_0x1c0a1d,_0x3010aa,_0x10af53,_0x4fb208);})[_0x34db('0x16')](function(_0x911878){if(_0x911878){logger['info']('The\x20Ticket\x20ID\x20is:',_0x911878['id']);switch(_0x746877[_0x34db('0x3b')]){case _0x34db('0x55'):logger[_0x34db('0xd')](_0x34db('0x66'),_0x34db('0x56'));return request({'uri':util[_0x34db('0xf')](_0x34db('0x57'),_0x746877['remoteUri'],_0x1c0a1d['id'],_0x911878['id']),'method':_0x34db('0x2a')});case _0x34db('0x58'):logger[_0x34db('0xd')](_0x34db('0x66'),_0x34db('0x59'));emit(util[_0x34db('0xf')]('user:%s',_0x2632e9[_0x34db('0x47')]),_0x34db('0x5b'),{'uri':util['format'](_0x34db('0x5c'),_0x746877[_0x34db('0x1a')][_0x34db('0x6a')](_0x34db('0x5d'),''),_0x911878['id'])});break;default:logger[_0x34db('0x5e')](_0x34db('0x66'),_0x34db('0x5f'));}}})[_0x34db('0x60')](function(_0x4e5481){logger[_0x34db('0x5e')](_0x34db('0x6b'),util[_0x34db('0x62')](_0x4e5481,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x5ba0d5,_0x1a835f,_0x390444,_0x3dda68,_0x19349d,_0x16385c){var _0x18ef81,_0x98d988;_0x16385c[_0x34db('0x1a')]=intUtil[_0x34db('0x4a')](_0x16385c['remoteUri']);_0x16385c['serverUrl']=intUtil[_0x34db('0x4a')](_0x16385c['serverUrl']);if(_0x19349d&&_0x19349d['monitor_format']){logger['info']('['+_0x1a835f[_0x34db('0x6c')][_0x34db('0x6d')]()+']','Recording\x20is\x20enabled!');_0x1a835f[_0x34db('0x4d')]=util[_0x34db('0xf')](_0x34db('0x4e'),_0x16385c[_0x34db('0x49')],_0x1a835f[_0x34db('0x4f')],md5(_0x1a835f[_0x34db('0x4f')]));}else{_0x1a835f[_0x34db('0x4d')]='';}headers[_0x34db('0x50')]=getAuth(_0x16385c);return getUser(_0x16385c)[_0x34db('0x16')](function(_0xf8c725){_0x18ef81=_0xf8c725;logger[_0x34db('0xd')]('The\x20User\x20ID\x20is:',_0x18ef81['id']);return getEndUser(_0x16385c,_0x1a835f[_0x34db('0x52')],_0x1a835f['calleridnum']);})[_0x34db('0x16')](function(_0x20cd8a){_0x98d988=_0x20cd8a;logger[_0x34db('0xd')](_0x34db('0x6e'),_0x98d988['id']);return getTicket(_0x16385c,_0x18ef81,_0x98d988,_0x390444,_0x1a835f);})['then'](function(_0xf6446c){if(_0xf6446c){logger['info'](_0x34db('0x54'),_0xf6446c['id']);}})[_0x34db('0x60')](function(_0x55de31){logger[_0x34db('0x5e')]('['+_0x1a835f['lastevent'][_0x34db('0x6d')]()+']'+_0x34db('0x6f'),util[_0x34db('0x62')](_0x55de31,{'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 5e81aba..2115f94 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 _0xdb5b=['com','request-promise','util','./util','moment','bluebird','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','[HTTP]','length','includes','string','picklist','idField','variableName','toString','type','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','zone','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','clientId','clientSecret','refresh_token','then','add','seconds','catch','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','https://www.zohoapis.','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Owner','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Called','complete','connect','rejected','abandoned','Call_Result','Abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','POST','/crm/v2/Calls','Call\x20created!','err','stack','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','unmanaged','monitor_format','toUpperCase'];(function(_0x4d2157,_0x201cf1){var _0x172f80=function(_0x587167){while(--_0x587167){_0x4d2157['push'](_0x4d2157['shift']());}};_0x172f80(++_0x201cf1);}(_0xdb5b,0x95));var _0xbdb5=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xdb5b[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var rp=require(_0xbdb5('0x0'));var md5=require('md5');var util=require(_0xbdb5('0x1'));var intUtil=require(_0xbdb5('0x2'));var moment=require(_0xbdb5('0x3'));var Redis=require('ioredis');var BPromise=require(_0xbdb5('0x4'));var config=require('../../../../config/environment');var logger=require(_0xbdb5('0x5'))(_0xbdb5('0x6'));config[_0xbdb5('0x7')]=_[_0xbdb5('0x8')](config[_0xbdb5('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xbdb5('0x9'))(new Redis(config['redis']));function emit(_0x33ac04,_0x28304f,_0x1e8381){io['to'](_0x33ac04)[_0xbdb5('0xa')](_0x28304f,_0x1e8381);}function request(_0x6cc33b){logger['debug'](_0xbdb5('0xb'),JSON['stringify'](_0x6cc33b));return rp(_0x6cc33b);}function getCustomFields(_0x299311,_0x593c9a){var _0x3d952a={};if(_0x299311[_0xbdb5('0xc')]>0x0){_['forEach'](_0x299311,function(_0x33ea95){if(_[_0xbdb5('0xd')]([_0xbdb5('0xe'),_0xbdb5('0xf')],_0x33ea95['type'])&&_0x33ea95[_0xbdb5('0x10')]){_0x3d952a[_0x33ea95[_0xbdb5('0x10')]]=_0x33ea95['content']['toString']();}else if(_0x33ea95['type']==='variable'&&_0x33ea95[_0xbdb5('0x11')]&&_0x33ea95[_0xbdb5('0x10')]&&_0x593c9a[_0x33ea95[_0xbdb5('0x11')]]){_0x3d952a[_0x33ea95[_0xbdb5('0x10')]]=_0x593c9a[_0x33ea95[_0xbdb5('0x11')]][_0xbdb5('0x12')]();}else if(_0x33ea95[_0xbdb5('0x13')]==='customVariable'&&_0x33ea95[_0xbdb5('0x14')]&&_0x33ea95[_0xbdb5('0x14')][_0xbdb5('0x15')]&&_0x33ea95[_0xbdb5('0x10')]&&_0x593c9a[_0x33ea95[_0xbdb5('0x14')][_0xbdb5('0x15')][_0xbdb5('0x16')]()]){_0x3d952a[_0x33ea95['idField']]=_0x593c9a[_0x33ea95['Variable'][_0xbdb5('0x15')]['toLowerCase']()][_0xbdb5('0x12')]();}});}return _0x3d952a;}function getName(_0x54cc8f){if(_0x54cc8f[_0xbdb5('0x17')]('\x20')>0x0){var _0x3420f9=_0x54cc8f['split'](/ (.+)/);if(_0x3420f9[0x1]){return _0x3420f9;}}return[_0x54cc8f,_0x54cc8f];}var accountsTokens={};function getAccessToken(_0x58675b){return new Promise(function(_0x41b7c1,_0x182428){if(!_[_0xbdb5('0x18')](accountsTokens[_0x58675b['id']])&&!_['isNil'](accountsTokens[_0x58675b['id']][_0xbdb5('0x19')])){if(moment()[_0xbdb5('0x1a')](accountsTokens[_0x58675b['id']]['expires_in'])){_0x41b7c1(accountsTokens[_0x58675b['id']][_0xbdb5('0x19')]);}}var _0x5cfa54;switch(_0x58675b[_0xbdb5('0x1b')]){case'US':_0x5cfa54='https://accounts.zoho.com';break;case'AU':_0x5cfa54='https://accounts.zoho.com.au';break;case'EU':_0x5cfa54='https://accounts.zoho.eu';break;case'IN':_0x5cfa54=_0xbdb5('0x1c');break;case'CN':_0x5cfa54=_0xbdb5('0x1d');break;default:_0x5cfa54=_0xbdb5('0x1e');break;}var _0x4f24f9={'method':'POST','uri':_0x5cfa54+'/oauth/v2/token','qs':{'refresh_token':_0x58675b['refreshToken'],'client_id':_0x58675b[_0xbdb5('0x1f')],'client_secret':_0x58675b[_0xbdb5('0x20')],'grant_type':_0xbdb5('0x21')},'json':!![]};return rp(_0x4f24f9)[_0xbdb5('0x22')](function(_0x8486d){accountsTokens[_0x58675b['id']]={'access_token':_0x8486d[_0xbdb5('0x19')],'expires_in':moment()[_0xbdb5('0x23')](_0x8486d['expires_in'],_0xbdb5('0x24'))};_0x41b7c1(_0x8486d[_0xbdb5('0x19')]);})[_0xbdb5('0x25')](function(_0x4af683){logger['error']('Failing\x20creating\x20the\x20access_token',_0x4af683['stack']);_0x182428(_0x4af683);});});}function getUser(_0x4e10f1,_0x3fc5de,_0x1e42a5,_0x118554){logger['info'](_0xbdb5('0x26'));return request({'method':_0xbdb5('0x27'),'uri':util[_0xbdb5('0x28')](_0xbdb5('0x29'),_0x3fc5de),'qs':{'type':_0xbdb5('0x2a')},'headers':{'Authorization':_0xbdb5('0x2b')+_0x4e10f1},'json':!![]})[_0xbdb5('0x22')](function(_0x5db607){if(_0x5db607['users']){var _0x3aae31=-0x1;if(_[_0xbdb5('0x2c')](_0x5db607[_0xbdb5('0x2d')])){if(!_[_0xbdb5('0x18')](_0x118554)){_0x3aae31=_['findIndex'](_0x5db607[_0xbdb5('0x2d')],function(_0x1b18af){return _0x1b18af[_0xbdb5('0x2e')]===_0x118554;});}if(_0x3aae31>=0x0){logger[_0xbdb5('0x2f')](_0xbdb5('0x30'));}else{logger[_0xbdb5('0x2f')](_0xbdb5('0x31'));_0x3aae31=_['findIndex'](_0x5db607['users'],function(_0x5a9b1a){return _0x5a9b1a[_0xbdb5('0x32')][_0xbdb5('0x15')]==='Administrator';});}return _0x5db607[_0xbdb5('0x2d')][_0x3aae31];}else{if(_0x5db607[_0xbdb5('0x33')][_0xbdb5('0x32')][_0xbdb5('0x15')]===_0xbdb5('0x34')){logger[_0xbdb5('0x2f')](_0xbdb5('0x31'));user=_0x5db607[_0xbdb5('0x33')];return user;}else{logger[_0xbdb5('0x35')](_0xbdb5('0x36'),JSON[_0xbdb5('0x37')](_0x5db607));throw new Error(_0xbdb5('0x38')+JSON['stringify'](_0x5db607));}}}else{logger[_0xbdb5('0x35')](_0xbdb5('0x36'),JSON[_0xbdb5('0x37')](_0x5db607));throw new Error(_0xbdb5('0x38')+JSON['stringify'](_0x5db607));}})[_0xbdb5('0x25')](function(_0x5194da){console[_0xbdb5('0x35')](_0x5194da);});}function getZohoUser(_0x4b9876,_0x47b35f){return new BPromise(function(_0x5ba3cd,_0x12fd76){request(_0x4b9876)[_0xbdb5('0x22')](function(_0x41b872){var _0x875a5e=null;if(_0x41b872){_0x875a5e=_0x41b872[_0xbdb5('0x39')][0x0];_0x875a5e[_0xbdb5('0x3a')]=_0x47b35f;}_0x5ba3cd(_0x875a5e);})[_0xbdb5('0x25')](function(_0x5eab38){_0x12fd76(_0x5eab38);});});}function createEndUser(_0x2c4645,_0x34e9d7,_0x4c2389,_0x285ca2,_0x45db06,_0x522c8c){var _0x4c2389=getName(_0x4c2389);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x34e9d7+_0xbdb5('0x3b')+_[_0xbdb5('0x3c')](_0x522c8c[_0xbdb5('0x3d')])+'s','body':{'data':[{'Last_Name':_0x4c2389[0x1],'First_Name':_0x4c2389[0x0],'Phone':_0x285ca2,'Owner':{'name':!_['isNil'](_0x45db06[_0xbdb5('0x3e')][_0xbdb5('0x15')])?_0x45db06[_0xbdb5('0x3e')]['name']:!_[_0xbdb5('0x18')](_0x45db06['first_name'])?_0x45db06[_0xbdb5('0x3f')]+'\x20'+_0x45db06['last_name']:_0x45db06[_0xbdb5('0x40')],'id':_0x45db06['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2c4645},'json':!![]})['then'](function(_0x1c3e40){if(_0x1c3e40&&_0x1c3e40['data'][0x0][_0xbdb5('0x41')]===_0xbdb5('0x42')){var _0x4d6f78=_0x1c3e40[_0xbdb5('0x39')][0x0][_0xbdb5('0x43')];_0x4d6f78[_0xbdb5('0x3a')]=_[_0xbdb5('0x3c')](_0x522c8c['moduleCreate'])+'s';return _0x4d6f78;}logger['error'](_0xbdb5('0x36'),JSON['stringify'](data));throw new Error(_0xbdb5('0x44')+JSON[_0xbdb5('0x37')](data));})['catch'](function(_0x16bf21){console[_0xbdb5('0x45')](_0xbdb5('0x46'),_0x16bf21);});}function getEndUser(_0x23b666,_0x2ae59a,_0x228f86,_0x283795,_0x2d164f,_0x168906,_0x36bcb6){var _0x407536={'method':_0xbdb5('0x27'),'uri':'','headers':{'Authorization':_0xbdb5('0x2b')+_0x23b666},'json':!![]};switch(_0x36bcb6[_0xbdb5('0x47')]){case _0xbdb5('0x48'):_0x407536['uri']=_0xbdb5('0x49')+_0x2ae59a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2d164f+'))';return getZohoUser(_0x407536,_0xbdb5('0x4a'))[_0xbdb5('0x22')](function(_0x489367){if(_0x489367)return _0x489367;_0x407536[_0xbdb5('0x4b')]='https://www.zohoapis.'+_0x2ae59a+_0xbdb5('0x4c')+_0x2d164f+'))';return getZohoUser(_0x407536,_0xbdb5('0x4d'))[_0xbdb5('0x22')](function(_0x5b6307){if(_0x5b6307)return _0x5b6307;if(_0x36bcb6[_0xbdb5('0x3d')]!=_0xbdb5('0x4e')){return createEndUser(_0x23b666,_0x2ae59a,_0x283795,_0x2d164f,_0x168906,_0x36bcb6);}else{return{};}});});break;case'contact':_0x407536['uri']=_0xbdb5('0x49')+_0x2ae59a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2d164f+'))';return getZohoUser(_0x407536,'Contacts')[_0xbdb5('0x22')](function(_0x4c530e){if(_0x4c530e)return _0x4c530e;if(_0x36bcb6[_0xbdb5('0x3d')]!=_0xbdb5('0x4e')){return createEndUser(_0x23b666,_0x2ae59a,_0x283795,_0x2d164f,_0x168906,_0x36bcb6);}else{return{};}});break;case _0xbdb5('0x4f'):_0x407536[_0xbdb5('0x4b')]=_0xbdb5('0x49')+_0x2ae59a+_0xbdb5('0x4c')+_0x2d164f+'))';return getZohoUser(_0x407536,_0xbdb5('0x4d'))[_0xbdb5('0x22')](function(_0x4434eb){if(_0x4434eb)return _0x4434eb;if(_0x36bcb6[_0xbdb5('0x3d')]!=_0xbdb5('0x4e')){return createEndUser(_0x23b666,_0x2ae59a,_0x283795,_0x2d164f,_0x168906,_0x36bcb6);}else{return{};}});break;}}function getCall(_0x2e1d66,_0x53baf8,_0x461caa,_0x1fb49e,_0x5ad229,_0x41ab93,_0x1fe77b,_0xd2343f){logger[_0xbdb5('0x2f')]('Creating\x20new\x20call...');var _0x2dcdbc={};_0x2dcdbc[_0xbdb5('0x50')]={'name':!_[_0xbdb5('0x18')](_0x1fb49e[_0xbdb5('0x3e')][_0xbdb5('0x15')])&&!_['isNil'](_0x1fb49e[_0xbdb5('0x32')]['name'])&&_0x1fb49e[_0xbdb5('0x32')][_0xbdb5('0x15')]===_0xbdb5('0x51')?_0x1fb49e['role'][_0xbdb5('0x15')]:!_[_0xbdb5('0x18')](_0x1fb49e[_0xbdb5('0x3f')])?_0x1fb49e[_0xbdb5('0x3f')]+'\x20'+_0x1fb49e[_0xbdb5('0x40')]:_0x1fb49e[_0xbdb5('0x40')],'id':_0x1fb49e['id']};_0x2dcdbc[_0xbdb5('0x52')]=intUtil[_0xbdb5('0x53')](_0x41ab93[_0xbdb5('0x54')],_0x1fe77b,'\x20');_0x2dcdbc['Description']=intUtil['getString'](_0x41ab93[_0xbdb5('0x55')],_0x1fe77b,'\x0a');if(_0x5ad229['enduserType']===_0xbdb5('0x4a')){_0x2dcdbc[_0xbdb5('0x56')]={'name':!_['isNil'](_0x5ad229[_0xbdb5('0x57')])?_0x5ad229['Full_Name']:!_[_0xbdb5('0x18')](_0x5ad229['First_Name'])?_0x5ad229[_0xbdb5('0x58')]+'\x20'+_0x5ad229['Last_Name']:_0x5ad229['Last_Name'],'id':_0x5ad229['id']};}if(_0x5ad229[_0xbdb5('0x3a')]==='Leads'){_0x2dcdbc[_0xbdb5('0x59')]={'name':!_[_0xbdb5('0x18')](_0x5ad229[_0xbdb5('0x57')])?_0x5ad229[_0xbdb5('0x57')]:!_[_0xbdb5('0x18')](_0x5ad229[_0xbdb5('0x58')])?_0x5ad229[_0xbdb5('0x58')]+'\x20'+_0x5ad229[_0xbdb5('0x5a')]:_0x5ad229[_0xbdb5('0x5a')],'id':_0x5ad229['id']};_0x2dcdbc[_0xbdb5('0x5b')]=_[_0xbdb5('0x3c')](_0x5ad229[_0xbdb5('0x3a')]);}if(_0x1fe77b[_0xbdb5('0x5c')]){_0x2dcdbc[_0xbdb5('0x5d')]=moment[_0xbdb5('0x5e')](parseInt(_0x1fe77b[_0xbdb5('0x5c')])*0x3e8)['format'](_0xbdb5('0x5f'));}else if(_0x1fe77b[_0xbdb5('0x60')]&&_0x1fe77b['endtime']){_0x2dcdbc[_0xbdb5('0x5d')]=moment['utc'](moment(_0x1fe77b[_0xbdb5('0x61')],_0xbdb5('0x62'))['diff'](moment(_0x1fe77b[_0xbdb5('0x63')],_0xbdb5('0x62'))))[_0xbdb5('0x28')]('mm:ss');}switch(_0x1fe77b[_0xbdb5('0x64')]){case _0xbdb5('0x65'):_0x2dcdbc['Call_Result']=_0xbdb5('0x66');break;case _0xbdb5('0x67'):case _0xbdb5('0x68'):_0x2dcdbc['Call_Result']='Answered';break;case _0xbdb5('0x69'):_0x2dcdbc['Call_Result']='Rejected';break;case _0xbdb5('0x6a'):_0x2dcdbc[_0xbdb5('0x6b')]=_0xbdb5('0x6c');break;case'timeout':_0x2dcdbc[_0xbdb5('0x6b')]='Timeout';default:}_0x2dcdbc[_0xbdb5('0x6d')]=(_0xd2343f===_0xbdb5('0x6e')?moment(_0x1fe77b['starttime'])[_0xbdb5('0x28')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x1fe77b[_0xbdb5('0x6f')])[_0xbdb5('0x28')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xbdb5('0x28')]('YYYY-MM-DDTHH:mm:ss');_0x2dcdbc[_0xbdb5('0x70')]=_0xd2343f||_0xbdb5('0x71');_0x2dcdbc=_['merge'](_0x2dcdbc,getCustomFields(_0x41ab93[_0xbdb5('0x72')],_0x1fe77b));return request({'method':_0xbdb5('0x73'),'uri':'https://www.zohoapis.'+_0x53baf8+_0xbdb5('0x74'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2e1d66},'body':{'data':[_0x2dcdbc]},'json':!![]})['then'](function(_0x61271c){if(_0x61271c&&_0x61271c[_0xbdb5('0x39')][0x0]['code']==='SUCCESS'){logger[_0xbdb5('0x2f')](_0xbdb5('0x75'));return{'id':_0x61271c['data'][0x0][_0xbdb5('0x43')]['id']};}})['catch'](function(_0x56a8d8){logger[_0xbdb5('0x2f')](_0xbdb5('0x76'),_0x56a8d8[_0xbdb5('0x77')]);console[_0xbdb5('0x45')]('err',_0x56a8d8);});}exports['queue']=function(_0x57f6ba,_0x3b5777,_0x21407a,_0x57f302,_0x5525b5,_0x3ab5dd){var _0x3054d6,_0x2a9e0d,_0x4e2423;_0x3ab5dd[_0xbdb5('0x78')]=intUtil[_0xbdb5('0x79')](_0x3ab5dd[_0xbdb5('0x78')]);_0x3ab5dd[_0xbdb5('0x7a')]=intUtil['stripTrailingSlash'](_0x3ab5dd[_0xbdb5('0x7a')]);if(_0x5525b5&&_0x5525b5['monitor_format']){logger[_0xbdb5('0x2f')](_0xbdb5('0x7b'),_0xbdb5('0x7c'));_0x3b5777[_0xbdb5('0x7d')]=_0x3ab5dd['serverUrl']+'/api/voice/recordings/'+_0x3b5777[_0xbdb5('0x7e')]+_0xbdb5('0x7f')+md5(_0x3b5777['uniqueid']);}else{_0x3b5777['recordingURL']='';}var _0x1c14ae=_0x3ab5dd[_0xbdb5('0x78')]===_0xbdb5('0x80')?'eu':'com';return getAccessToken(_0x3ab5dd)['then'](function(_0x332430){_0x4e2423=_0x332430;return getUser(_0x4e2423,_0x1c14ae,_0x3ab5dd,_0x57f302[_0xbdb5('0x2e')]);})['then'](function(_0x53fb8d){_0x3054d6=_0x53fb8d;logger[_0xbdb5('0x2f')](_0xbdb5('0x81'),_0x3054d6['id']);return getEndUser(_0x4e2423,_0x1c14ae,_0x3ab5dd,_0x3b5777[_0xbdb5('0x82')],_0x3b5777[_0xbdb5('0x83')],_0x3054d6,_0x21407a);})[_0xbdb5('0x22')](function(_0x1f61ba){_0x2a9e0d=_0x1f61ba;return getCall(_0x4e2423,_0x1c14ae,_0x3ab5dd,_0x3054d6,_0x2a9e0d,_0x21407a,_0x3b5777,_0xbdb5('0x71'));})[_0xbdb5('0x22')](function(_0x34d854){if(_0x34d854){logger[_0xbdb5('0x2f')]('The\x20Call\x20ID\x20is:',_0x34d854['id']);logger[_0xbdb5('0x2f')]('[QUEUE]',_0xbdb5('0x84'));emit(util['format'](_0xbdb5('0x85'),_0x57f302[_0xbdb5('0x15')]),_0xbdb5('0x86'),{'uri':_0xbdb5('0x87')+_0x3ab5dd['host']+_0xbdb5('0x88')+_0x34d854['id']});}})['catch'](function(_0x3aa731){logger[_0xbdb5('0x35')](_0xbdb5('0x7b'),JSON['stringify'](_0x3aa731));});};exports['outbound']=function(_0x1ccd71,_0x5b3caf,_0xf4f669,_0x3b7e94,_0x5ea38a,_0x462249,_0x3835a4){var _0x9a334f,_0x11dd24,_0x468ace;_0x462249[_0xbdb5('0x78')]=intUtil[_0xbdb5('0x79')](_0x462249[_0xbdb5('0x78')]);_0x462249[_0xbdb5('0x7a')]=intUtil['stripTrailingSlash'](_0x462249[_0xbdb5('0x7a')]);if(_0x3835a4&&_0x3835a4['recordingFormat']&&_0x3835a4[_0xbdb5('0x89')]!==_0xbdb5('0x8a')){logger[_0xbdb5('0x2f')](_0xbdb5('0x8b'),_0xbdb5('0x7c'));_0x5b3caf['recordingURL']=_0x462249[_0xbdb5('0x7a')]+_0xbdb5('0x8c')+_0x5b3caf['uniqueid']+_0xbdb5('0x7f')+md5(_0x5b3caf[_0xbdb5('0x7e')]);}var _0x11090a=_0x462249[_0xbdb5('0x78')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x462249)['then'](function(_0x571e68){_0x468ace=_0x571e68;return getUser(_0x468ace,_0x11090a,_0x462249,_0x3b7e94[_0xbdb5('0x2e')]);})[_0xbdb5('0x22')](function(_0x495c45){_0x9a334f=_0x495c45;logger[_0xbdb5('0x2f')]('The\x20User\x20ID\x20is:',_0x9a334f['id']);return getEndUser(_0x468ace,_0x11090a,_0x462249,_0x5b3caf[_0xbdb5('0x8d')],_0x5b3caf['destcalleridnum'],_0x9a334f,_0xf4f669);})['then'](function(_0x37aea0){_0x11dd24=_0x37aea0;return getCall(_0x468ace,_0x11090a,_0x462249,_0x9a334f,_0x11dd24,_0xf4f669,_0x5b3caf,_0xbdb5('0x8e'));})['then'](function(_0x4ee60b){if(_0x4ee60b){logger[_0xbdb5('0x2f')](_0xbdb5('0x8f'),_0x4ee60b['id']);logger[_0xbdb5('0x2f')](_0xbdb5('0x8b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbdb5('0x28')](_0xbdb5('0x85'),_0x3b7e94['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x462249[_0xbdb5('0x78')]+_0xbdb5('0x88')+_0x4ee60b['id']});}})['catch'](function(_0x681c97){logger['error'](_0xbdb5('0x8b'),JSON[_0xbdb5('0x37')](_0x681c97));});};exports[_0xbdb5('0x90')]=function(_0xdd6f19,_0x17b725,_0x1d4026,_0x190f61,_0x5091fe,_0xa9e2bb){var _0x47235e,_0x2fa20a,_0x478c8f;_0xa9e2bb['host']=intUtil[_0xbdb5('0x79')](_0xa9e2bb[_0xbdb5('0x78')]);_0xa9e2bb[_0xbdb5('0x7a')]=intUtil[_0xbdb5('0x79')](_0xa9e2bb[_0xbdb5('0x7a')]);if(_0x5091fe&&_0x5091fe[_0xbdb5('0x91')]){logger['info']('['+_0x17b725[_0xbdb5('0x64')][_0xbdb5('0x92')]()+']',_0xbdb5('0x7c'));_0x17b725[_0xbdb5('0x7d')]=_0xa9e2bb[_0xbdb5('0x7a')]+_0xbdb5('0x8c')+_0x17b725[_0xbdb5('0x7e')]+_0xbdb5('0x7f')+md5(_0x17b725[_0xbdb5('0x7e')]);}else{_0x17b725[_0xbdb5('0x7d')]='';}var _0x4df9e=_0xa9e2bb[_0xbdb5('0x78')]===_0xbdb5('0x80')?'eu':_0xbdb5('0x93');return getAccessToken(_0xa9e2bb)[_0xbdb5('0x22')](function(_0x4f1b70){_0x478c8f=_0x4f1b70;return getUser(_0x478c8f,_0x4df9e,_0xa9e2bb);})[_0xbdb5('0x22')](function(_0x3a11ec){_0x47235e=_0x3a11ec;logger[_0xbdb5('0x2f')]('The\x20User\x20ID\x20is:',_0x47235e['id']);return getEndUser(_0x478c8f,_0x4df9e,_0xa9e2bb,_0x17b725[_0xbdb5('0x82')],_0x17b725['calleridnum'],_0x47235e,_0x1d4026);})[_0xbdb5('0x22')](function(_0x174a9f){_0x2fa20a=_0x174a9f;return getCall(_0x478c8f,_0x4df9e,_0xa9e2bb,_0x47235e,_0x2fa20a,_0x1d4026,_0x17b725,_0xbdb5('0x71'));})[_0xbdb5('0x22')](function(_0x5a8458){if(_0x5a8458){logger[_0xbdb5('0x2f')](_0xbdb5('0x8f'),_0x5a8458['id']);}})['catch'](function(_0x27c36a){logger[_0xbdb5('0x35')]('['+_0x17b725['lastevent'][_0xbdb5('0x92')]()+']',JSON[_0xbdb5('0x37')](_0x27c36a));});}; \ No newline at end of file +var _0x7e35=['rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','https://crm.','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','length','forEach','includes','string','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','then','users','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Owner','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','talktime','Call_Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','Answered'];(function(_0x48517c,_0x2c3dc8){var _0x4d7d2d=function(_0x2c37fc){while(--_0x2c37fc){_0x48517c['push'](_0x48517c['shift']());}};_0x4d7d2d(++_0x2c3dc8);}(_0x7e35,0xc9));var _0x57e3=function(_0x477dcc,_0x41cff4){_0x477dcc=_0x477dcc-0x0;var _0x5857c0=_0x7e35[_0x477dcc];return _0x5857c0;};'use strict';var _=require(_0x57e3('0x0'));var rp=require(_0x57e3('0x1'));var md5=require(_0x57e3('0x2'));var util=require(_0x57e3('0x3'));var intUtil=require(_0x57e3('0x4'));var moment=require(_0x57e3('0x5'));var Redis=require(_0x57e3('0x6'));var BPromise=require(_0x57e3('0x7'));var config=require(_0x57e3('0x8'));var logger=require(_0x57e3('0x9'))(_0x57e3('0xa'));config[_0x57e3('0xb')]=_['defaults'](config[_0x57e3('0xb')],{'host':_0x57e3('0xc'),'port':0x18eb});var io=require(_0x57e3('0xd'))(new Redis(config[_0x57e3('0xb')]));function emit(_0x5426d4,_0x8a7ea1,_0x12b4cf){io['to'](_0x5426d4)[_0x57e3('0xe')](_0x8a7ea1,_0x12b4cf);}function request(_0x52b471){logger[_0x57e3('0xf')](_0x57e3('0x10'),JSON['stringify'](_0x52b471));return rp(_0x52b471);}function getCustomFields(_0x56b73b,_0x43da76){var _0x31785e={};if(_0x56b73b[_0x57e3('0x11')]>0x0){_[_0x57e3('0x12')](_0x56b73b,function(_0x3bc45a){if(_[_0x57e3('0x13')]([_0x57e3('0x14'),'picklist'],_0x3bc45a[_0x57e3('0x15')])&&_0x3bc45a[_0x57e3('0x16')]){_0x31785e[_0x3bc45a[_0x57e3('0x16')]]=_0x3bc45a[_0x57e3('0x17')][_0x57e3('0x18')]();}else if(_0x3bc45a[_0x57e3('0x15')]===_0x57e3('0x19')&&_0x3bc45a[_0x57e3('0x1a')]&&_0x3bc45a[_0x57e3('0x16')]&&_0x43da76[_0x3bc45a[_0x57e3('0x1a')]]){_0x31785e[_0x3bc45a[_0x57e3('0x16')]]=_0x43da76[_0x3bc45a[_0x57e3('0x1a')]]['toString']();}else if(_0x3bc45a[_0x57e3('0x15')]==='customVariable'&&_0x3bc45a['Variable']&&_0x3bc45a[_0x57e3('0x1b')]['name']&&_0x3bc45a[_0x57e3('0x16')]&&_0x43da76[_0x3bc45a[_0x57e3('0x1b')][_0x57e3('0x1c')][_0x57e3('0x1d')]()]){_0x31785e[_0x3bc45a[_0x57e3('0x16')]]=_0x43da76[_0x3bc45a[_0x57e3('0x1b')][_0x57e3('0x1c')]['toLowerCase']()][_0x57e3('0x18')]();}});}return _0x31785e;}function getName(_0x3055ba){if(_0x3055ba[_0x57e3('0x1e')]('\x20')>0x0){var _0x1fd08e=_0x3055ba[_0x57e3('0x1f')](/ (.+)/);if(_0x1fd08e[0x1]){return _0x1fd08e;}}return[_0x3055ba,_0x3055ba];}var accountsTokens={};function getAccessToken(_0x3f2028){return new Promise(function(_0x272476,_0xde10ca){if(!_[_0x57e3('0x20')](accountsTokens[_0x3f2028['id']])&&!_['isNil'](accountsTokens[_0x3f2028['id']][_0x57e3('0x21')])){if(moment()[_0x57e3('0x22')](accountsTokens[_0x3f2028['id']][_0x57e3('0x23')])){_0x272476(accountsTokens[_0x3f2028['id']]['access_token']);}}var _0x2662f6;switch(_0x3f2028[_0x57e3('0x24')]){case'US':_0x2662f6='https://accounts.zoho.com';break;case'AU':_0x2662f6=_0x57e3('0x25');break;case'EU':_0x2662f6='https://accounts.zoho.eu';break;case'IN':_0x2662f6=_0x57e3('0x26');break;case'CN':_0x2662f6=_0x57e3('0x27');break;default:_0x2662f6='https://accounts.zoho.eu';break;}var _0x23b105={'method':'POST','uri':_0x2662f6+_0x57e3('0x28'),'qs':{'refresh_token':_0x3f2028[_0x57e3('0x29')],'client_id':_0x3f2028['clientId'],'client_secret':_0x3f2028[_0x57e3('0x2a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x23b105)['then'](function(_0x625c2d){accountsTokens[_0x3f2028['id']]={'access_token':_0x625c2d[_0x57e3('0x21')],'expires_in':moment()[_0x57e3('0x2b')](_0x625c2d['expires_in'],_0x57e3('0x2c'))};_0x272476(_0x625c2d['access_token']);})[_0x57e3('0x2d')](function(_0x1575f2){logger[_0x57e3('0x2e')](_0x57e3('0x2f'),_0x1575f2[_0x57e3('0x30')]);_0xde10ca(_0x1575f2);});});}function getUser(_0x5b02fa,_0x215449,_0xc92b5,_0x2f110d){logger[_0x57e3('0x31')](_0x57e3('0x32'));return request({'method':_0x57e3('0x33'),'uri':util['format'](_0x57e3('0x34'),_0x215449),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5b02fa},'json':!![]})[_0x57e3('0x35')](function(_0x2006b4){if(_0x2006b4[_0x57e3('0x36')]){var _0xd3dd43=-0x1;if(_['isArrayLikeObject'](_0x2006b4[_0x57e3('0x36')])){if(!_[_0x57e3('0x20')](_0x2f110d)){_0xd3dd43=_[_0x57e3('0x37')](_0x2006b4[_0x57e3('0x36')],function(_0x1b2d1c){return _0x1b2d1c[_0x57e3('0x38')]===_0x2f110d;});}if(_0xd3dd43>=0x0){logger[_0x57e3('0x31')](_0x57e3('0x39'));}else{logger[_0x57e3('0x31')]('Using\x20the\x20admin\x20account!');_0xd3dd43=_[_0x57e3('0x37')](_0x2006b4[_0x57e3('0x36')],function(_0x4b8172){return _0x4b8172[_0x57e3('0x3a')][_0x57e3('0x1c')]===_0x57e3('0x3b');});}return _0x2006b4[_0x57e3('0x36')][_0xd3dd43];}else{if(_0x2006b4[_0x57e3('0x3c')]['profile'][_0x57e3('0x1c')]==='Administrator'){logger['info'](_0x57e3('0x3d'));user=_0x2006b4[_0x57e3('0x3c')];return user;}else{logger[_0x57e3('0x2e')](_0x57e3('0x3e'),JSON[_0x57e3('0x3f')](_0x2006b4));throw new Error(_0x57e3('0x40')+JSON[_0x57e3('0x3f')](_0x2006b4));}}}else{logger['error'](_0x57e3('0x3e'),JSON[_0x57e3('0x3f')](_0x2006b4));throw new Error(_0x57e3('0x40')+JSON[_0x57e3('0x3f')](_0x2006b4));}})['catch'](function(_0x3002ec){console[_0x57e3('0x2e')](_0x3002ec);});}function getZohoUser(_0x2032dc,_0x285a27){return new BPromise(function(_0x106173,_0x5177e9){request(_0x2032dc)['then'](function(_0x356336){var _0x5b9558=null;if(_0x356336){_0x5b9558=_0x356336[_0x57e3('0x41')][0x0];_0x5b9558[_0x57e3('0x42')]=_0x285a27;}_0x106173(_0x5b9558);})[_0x57e3('0x2d')](function(_0x1c6f9b){_0x5177e9(_0x1c6f9b);});});}function createEndUser(_0x21626b,_0x53cf7c,_0x35e752,_0x5a830f,_0x5a6ced,_0x2a8d50){var _0x35e752=getName(_0x35e752);return request({'method':_0x57e3('0x43'),'uri':_0x57e3('0x44')+_0x53cf7c+_0x57e3('0x45')+_[_0x57e3('0x46')](_0x2a8d50[_0x57e3('0x47')])+'s','body':{'data':[{'Last_Name':_0x35e752[0x1],'First_Name':_0x35e752[0x0],'Phone':_0x5a830f,'Owner':{'name':!_[_0x57e3('0x20')](_0x5a6ced['role']['name'])?_0x5a6ced[_0x57e3('0x48')]['name']:!_['isNil'](_0x5a6ced[_0x57e3('0x49')])?_0x5a6ced[_0x57e3('0x49')]+'\x20'+_0x5a6ced[_0x57e3('0x4a')]:_0x5a6ced['last_name'],'id':_0x5a6ced['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x21626b},'json':!![]})[_0x57e3('0x35')](function(_0x2a1940){if(_0x2a1940&&_0x2a1940[_0x57e3('0x41')][0x0][_0x57e3('0x4b')]===_0x57e3('0x4c')){var _0x3742c2=_0x2a1940[_0x57e3('0x41')][0x0]['details'];_0x3742c2[_0x57e3('0x42')]=_[_0x57e3('0x46')](_0x2a8d50[_0x57e3('0x47')])+'s';return _0x3742c2;}logger['error'](_0x57e3('0x3e'),JSON[_0x57e3('0x3f')](data));throw new Error(_0x57e3('0x4d')+JSON['stringify'](data));})[_0x57e3('0x2d')](function(_0x352ddd){console[_0x57e3('0x4e')](_0x57e3('0x4f'),_0x352ddd);});}function getEndUser(_0x245571,_0xd03ecd,_0x3bfbee,_0x26ac61,_0x419d83,_0xc80953,_0x562e67){var _0x5db514={'method':_0x57e3('0x33'),'uri':'','headers':{'Authorization':_0x57e3('0x50')+_0x245571},'json':!![]};switch(_0x562e67[_0x57e3('0x51')]){case'contact_lead':_0x5db514[_0x57e3('0x52')]=_0x57e3('0x44')+_0xd03ecd+_0x57e3('0x53')+_0x419d83+'))';return getZohoUser(_0x5db514,_0x57e3('0x54'))[_0x57e3('0x35')](function(_0x29941a){if(_0x29941a)return _0x29941a;_0x5db514['uri']='https://www.zohoapis.'+_0xd03ecd+_0x57e3('0x55')+_0x419d83+'))';return getZohoUser(_0x5db514,_0x57e3('0x56'))['then'](function(_0x17939b){if(_0x17939b)return _0x17939b;if(_0x562e67[_0x57e3('0x47')]!=_0x57e3('0x57')){return createEndUser(_0x245571,_0xd03ecd,_0x26ac61,_0x419d83,_0xc80953,_0x562e67);}else{return{};}});});break;case _0x57e3('0x58'):_0x5db514[_0x57e3('0x52')]='https://www.zohoapis.'+_0xd03ecd+_0x57e3('0x53')+_0x419d83+'))';return getZohoUser(_0x5db514,_0x57e3('0x54'))[_0x57e3('0x35')](function(_0x2dd304){if(_0x2dd304)return _0x2dd304;if(_0x562e67[_0x57e3('0x47')]!=_0x57e3('0x57')){return createEndUser(_0x245571,_0xd03ecd,_0x26ac61,_0x419d83,_0xc80953,_0x562e67);}else{return{};}});break;case'lead':_0x5db514[_0x57e3('0x52')]=_0x57e3('0x44')+_0xd03ecd+_0x57e3('0x55')+_0x419d83+'))';return getZohoUser(_0x5db514,_0x57e3('0x56'))[_0x57e3('0x35')](function(_0x444eb8){if(_0x444eb8)return _0x444eb8;if(_0x562e67[_0x57e3('0x47')]!='nothing'){return createEndUser(_0x245571,_0xd03ecd,_0x26ac61,_0x419d83,_0xc80953,_0x562e67);}else{return{};}});break;}}function getCall(_0x166254,_0x2cafc2,_0x17d82f,_0x67f46e,_0x64820c,_0x16f03c,_0x19c412,_0x2c1e54){logger['info']('Creating\x20new\x20call...');var _0x558d26={};_0x558d26[_0x57e3('0x59')]={'name':!_['isNil'](_0x67f46e[_0x57e3('0x48')][_0x57e3('0x1c')])&&!_['isNil'](_0x67f46e[_0x57e3('0x3a')][_0x57e3('0x1c')])&&_0x67f46e['profile'][_0x57e3('0x1c')]==='administrator'?_0x67f46e[_0x57e3('0x48')][_0x57e3('0x1c')]:!_[_0x57e3('0x20')](_0x67f46e[_0x57e3('0x49')])?_0x67f46e[_0x57e3('0x49')]+'\x20'+_0x67f46e[_0x57e3('0x4a')]:_0x67f46e['last_name'],'id':_0x67f46e['id']};_0x558d26[_0x57e3('0x5a')]=intUtil[_0x57e3('0x5b')](_0x16f03c[_0x57e3('0x5c')],_0x19c412,'\x20');_0x558d26[_0x57e3('0x5d')]=intUtil['getString'](_0x16f03c[_0x57e3('0x5e')],_0x19c412,'\x0a');if(_0x64820c[_0x57e3('0x42')]===_0x57e3('0x54')){_0x558d26['Who_Id']={'name':!_[_0x57e3('0x20')](_0x64820c[_0x57e3('0x5f')])?_0x64820c[_0x57e3('0x5f')]:!_['isNil'](_0x64820c['First_Name'])?_0x64820c[_0x57e3('0x60')]+'\x20'+_0x64820c[_0x57e3('0x61')]:_0x64820c[_0x57e3('0x61')],'id':_0x64820c['id']};}if(_0x64820c[_0x57e3('0x42')]==='Leads'){_0x558d26['What_Id']={'name':!_[_0x57e3('0x20')](_0x64820c[_0x57e3('0x5f')])?_0x64820c[_0x57e3('0x5f')]:!_[_0x57e3('0x20')](_0x64820c['First_Name'])?_0x64820c[_0x57e3('0x60')]+'\x20'+_0x64820c['Last_Name']:_0x64820c[_0x57e3('0x61')],'id':_0x64820c['id']};_0x558d26['$se_module']=_[_0x57e3('0x46')](_0x64820c['enduserType']);}if(_0x19c412[_0x57e3('0x62')]){_0x558d26[_0x57e3('0x63')]=moment[_0x57e3('0x64')](parseInt(_0x19c412[_0x57e3('0x62')])*0x3e8)[_0x57e3('0x65')](_0x57e3('0x66'));}else if(_0x19c412[_0x57e3('0x67')]&&_0x19c412['endtime']){_0x558d26['Call_Duration']=moment[_0x57e3('0x64')](moment(_0x19c412[_0x57e3('0x68')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x19c412['starttime'],_0x57e3('0x69'))))[_0x57e3('0x65')](_0x57e3('0x66'));}switch(_0x19c412['lastevent']){case _0x57e3('0x6a'):_0x558d26[_0x57e3('0x6b')]=_0x57e3('0x6c');break;case _0x57e3('0x6d'):case'connect':_0x558d26['Call_Result']=_0x57e3('0x6e');break;case _0x57e3('0x6f'):_0x558d26[_0x57e3('0x6b')]=_0x57e3('0x70');break;case _0x57e3('0x71'):_0x558d26[_0x57e3('0x6b')]='Abandoned';break;case _0x57e3('0x72'):_0x558d26[_0x57e3('0x6b')]=_0x57e3('0x73');default:}_0x558d26[_0x57e3('0x74')]=(_0x2c1e54===_0x57e3('0x75')?moment(_0x19c412[_0x57e3('0x76')])[_0x57e3('0x65')](_0x57e3('0x69')):moment(_0x19c412[_0x57e3('0x77')])[_0x57e3('0x65')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x57e3('0x65')](_0x57e3('0x69'));_0x558d26[_0x57e3('0x78')]=_0x2c1e54||_0x57e3('0x79');_0x558d26=_[_0x57e3('0x7a')](_0x558d26,getCustomFields(_0x16f03c[_0x57e3('0x7b')],_0x19c412));return request({'method':_0x57e3('0x43'),'uri':_0x57e3('0x44')+_0x2cafc2+_0x57e3('0x7c'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x166254},'body':{'data':[_0x558d26]},'json':!![]})[_0x57e3('0x35')](function(_0x39a0e7){if(_0x39a0e7&&_0x39a0e7['data'][0x0]['code']===_0x57e3('0x4c')){logger[_0x57e3('0x31')](_0x57e3('0x7d'));return{'id':_0x39a0e7[_0x57e3('0x41')][0x0][_0x57e3('0x7e')]['id']};}})[_0x57e3('0x2d')](function(_0x1f920a){logger['info'](_0x57e3('0x7f'),_0x1f920a[_0x57e3('0x30')]);console[_0x57e3('0x4e')](_0x57e3('0x7f'),_0x1f920a);});}exports[_0x57e3('0x80')]=function(_0x4afd91,_0x2cc36c,_0x45da7a,_0x299ff4,_0xd9036a,_0xee8319){var _0x64fa86,_0xdc1704,_0x295d3d;_0xee8319[_0x57e3('0x81')]=intUtil['stripTrailingSlash'](_0xee8319['host']);_0xee8319[_0x57e3('0x82')]=intUtil[_0x57e3('0x83')](_0xee8319['serverUrl']);if(_0xd9036a&&_0xd9036a[_0x57e3('0x84')]){logger['info'](_0x57e3('0x85'),_0x57e3('0x86'));_0x2cc36c[_0x57e3('0x87')]=_0xee8319[_0x57e3('0x82')]+_0x57e3('0x88')+_0x2cc36c[_0x57e3('0x89')]+_0x57e3('0x8a')+md5(_0x2cc36c['uniqueid']);}else{_0x2cc36c[_0x57e3('0x87')]='';}var _0x56165d=_0xee8319['host']===_0x57e3('0x8b')?'eu':_0x57e3('0x8c');return getAccessToken(_0xee8319)[_0x57e3('0x35')](function(_0x337657){_0x295d3d=_0x337657;return getUser(_0x295d3d,_0x56165d,_0xee8319,_0x299ff4['email']);})[_0x57e3('0x35')](function(_0x4eec12){_0x64fa86=_0x4eec12;logger['info'](_0x57e3('0x8d'),_0x64fa86['id']);return getEndUser(_0x295d3d,_0x56165d,_0xee8319,_0x2cc36c[_0x57e3('0x8e')],_0x2cc36c[_0x57e3('0x8f')],_0x64fa86,_0x45da7a);})[_0x57e3('0x35')](function(_0x1c297d){_0xdc1704=_0x1c297d;return getCall(_0x295d3d,_0x56165d,_0xee8319,_0x64fa86,_0xdc1704,_0x45da7a,_0x2cc36c,'Inbound');})[_0x57e3('0x35')](function(_0x10a612){if(_0x10a612){logger[_0x57e3('0x31')]('The\x20Call\x20ID\x20is:',_0x10a612['id']);logger[_0x57e3('0x31')]('[QUEUE]',_0x57e3('0x90'));emit(util[_0x57e3('0x65')](_0x57e3('0x91'),_0x299ff4['name']),_0x57e3('0x92'),{'uri':'https://crm.'+_0xee8319[_0x57e3('0x81')]+_0x57e3('0x93')+_0x10a612['id']});}})[_0x57e3('0x2d')](function(_0x3aa937){logger['error']('[QUEUE]',JSON['stringify'](_0x3aa937));});};exports[_0x57e3('0x75')]=function(_0x427a2c,_0x11d878,_0x4fc397,_0x17a0a8,_0x5c7173,_0x5e6a7d,_0x174bd8){var _0x50bf77,_0x2d36be,_0x51b843;_0x5e6a7d[_0x57e3('0x81')]=intUtil[_0x57e3('0x83')](_0x5e6a7d[_0x57e3('0x81')]);_0x5e6a7d[_0x57e3('0x82')]=intUtil['stripTrailingSlash'](_0x5e6a7d[_0x57e3('0x82')]);if(_0x174bd8&&_0x174bd8[_0x57e3('0x94')]&&_0x174bd8[_0x57e3('0x94')]!=='none'){logger['info'](_0x57e3('0x95'),_0x57e3('0x86'));_0x11d878[_0x57e3('0x87')]=_0x5e6a7d[_0x57e3('0x82')]+'/api/voice/recordings/'+_0x11d878['uniqueid']+_0x57e3('0x8a')+md5(_0x11d878['uniqueid']);}var _0x1bafc7=_0x5e6a7d[_0x57e3('0x81')]===_0x57e3('0x8b')?'eu':_0x57e3('0x8c');return getAccessToken(_0x5e6a7d)[_0x57e3('0x35')](function(_0x3eef99){_0x51b843=_0x3eef99;return getUser(_0x51b843,_0x1bafc7,_0x5e6a7d,_0x17a0a8[_0x57e3('0x38')]);})[_0x57e3('0x35')](function(_0x548fef){_0x50bf77=_0x548fef;logger[_0x57e3('0x31')](_0x57e3('0x8d'),_0x50bf77['id']);return getEndUser(_0x51b843,_0x1bafc7,_0x5e6a7d,_0x11d878['destcalleridname'],_0x11d878[_0x57e3('0x96')],_0x50bf77,_0x4fc397);})['then'](function(_0x1d4eb0){_0x2d36be=_0x1d4eb0;return getCall(_0x51b843,_0x1bafc7,_0x5e6a7d,_0x50bf77,_0x2d36be,_0x4fc397,_0x11d878,_0x57e3('0x97'));})[_0x57e3('0x35')](function(_0xb0bcc6){if(_0xb0bcc6){logger[_0x57e3('0x31')](_0x57e3('0x98'),_0xb0bcc6['id']);logger[_0x57e3('0x31')](_0x57e3('0x95'),_0x57e3('0x90'));emit(util[_0x57e3('0x65')](_0x57e3('0x91'),_0x17a0a8[_0x57e3('0x1c')]),_0x57e3('0x92'),{'uri':_0x57e3('0x99')+_0x5e6a7d[_0x57e3('0x81')]+_0x57e3('0x93')+_0xb0bcc6['id']});}})[_0x57e3('0x2d')](function(_0x561208){logger[_0x57e3('0x2e')](_0x57e3('0x95'),JSON[_0x57e3('0x3f')](_0x561208));});};exports[_0x57e3('0x9a')]=function(_0x500470,_0x5d6c39,_0x246f64,_0x16f36a,_0x3a8f4c,_0x134530){var _0x17771f,_0xc938b7,_0x1337f5;_0x134530['host']=intUtil['stripTrailingSlash'](_0x134530[_0x57e3('0x81')]);_0x134530[_0x57e3('0x82')]=intUtil['stripTrailingSlash'](_0x134530[_0x57e3('0x82')]);if(_0x3a8f4c&&_0x3a8f4c['monitor_format']){logger[_0x57e3('0x31')]('['+_0x5d6c39['lastevent']['toUpperCase']()+']',_0x57e3('0x86'));_0x5d6c39[_0x57e3('0x87')]=_0x134530[_0x57e3('0x82')]+_0x57e3('0x88')+_0x5d6c39[_0x57e3('0x89')]+_0x57e3('0x8a')+md5(_0x5d6c39[_0x57e3('0x89')]);}else{_0x5d6c39[_0x57e3('0x87')]='';}var _0x33c3e1=_0x134530[_0x57e3('0x81')]===_0x57e3('0x8b')?'eu':_0x57e3('0x8c');return getAccessToken(_0x134530)[_0x57e3('0x35')](function(_0x418be3){_0x1337f5=_0x418be3;return getUser(_0x1337f5,_0x33c3e1,_0x134530);})[_0x57e3('0x35')](function(_0x5771ca){_0x17771f=_0x5771ca;logger['info']('The\x20User\x20ID\x20is:',_0x17771f['id']);return getEndUser(_0x1337f5,_0x33c3e1,_0x134530,_0x5d6c39[_0x57e3('0x8e')],_0x5d6c39['calleridnum'],_0x17771f,_0x246f64);})['then'](function(_0x1400fa){_0xc938b7=_0x1400fa;return getCall(_0x1337f5,_0x33c3e1,_0x134530,_0x17771f,_0xc938b7,_0x246f64,_0x5d6c39,_0x57e3('0x79'));})['then'](function(_0x21a6ac){if(_0x21a6ac){logger[_0x57e3('0x31')](_0x57e3('0x98'),_0x21a6ac['id']);}})[_0x57e3('0x2d')](function(_0x26b9fe){logger[_0x57e3('0x2e')]('['+_0x5d6c39['lastevent'][_0x57e3('0x9b')]()+']',JSON[_0x57e3('0x3f')](_0x26b9fe));});}; \ 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 caa2be1..6adb49f 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 _0xea63=['mustache','../../../../config/logger','trigger','exec','data2','Script','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x4bc3de,_0xbe618b){var _0x3d11e0=function(_0x4b38e9){while(--_0x4b38e9){_0x4bc3de['push'](_0x4bc3de['shift']());}};_0x3d11e0(++_0xbe618b);}(_0xea63,0x110));var _0x3ea6=function(_0x18b855,_0x226cde){_0x18b855=_0x18b855-0x0;var _0x1a8d2f=_0xea63[_0x18b855];return _0x1a8d2f;};'use strict';var util=require(_0x3ea6('0x0'));var sh=require('shelljs');var Mustache=require(_0x3ea6('0x1'));var logger=require(_0x3ea6('0x2'))(_0x3ea6('0x3'));exports[_0x3ea6('0x4')]=function(_0xe1c8d,_0xeadf6d){var _0x4ff7c2=_0xe1c8d['data2']?_0xe1c8d[_0x3ea6('0x5')]:_0x3ea6('0x6');var _0x207e7b=_0xe1c8d['data3']?Mustache[_0x3ea6('0x7')](_0xe1c8d['data3'],_0xeadf6d):_0xeadf6d;sh[_0x3ea6('0x4')](_0x207e7b,function(_0x4dd8fa,_0x307ec4,_0x319a79){if(_0x4dd8fa!==0x0){logger[_0x3ea6('0x8')](util[_0x3ea6('0x9')](_0x3ea6('0xa'),_0x4ff7c2,_0x207e7b,_0x4dd8fa,_0x319a79));}else{logger[_0x3ea6('0xb')](util['format'](_0x3ea6('0xc'),_0x4ff7c2,_0x207e7b,_0x307ec4));}});}; \ No newline at end of file +var _0xab98=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xab98,0x11c));var _0x8ab9=function(_0xf879bb,_0x5aaebf){_0xf879bb=_0xf879bb-0x0;var _0x277abc=_0xab98[_0xf879bb];return _0x277abc;};'use strict';var util=require('util');var sh=require(_0x8ab9('0x0'));var Mustache=require(_0x8ab9('0x1'));var logger=require(_0x8ab9('0x2'))(_0x8ab9('0x3'));exports[_0x8ab9('0x4')]=function(_0x5a06d6,_0x283a2f){var _0x350052=_0x5a06d6[_0x8ab9('0x5')]?_0x5a06d6[_0x8ab9('0x5')]:_0x8ab9('0x6');var _0x482b12=_0x5a06d6[_0x8ab9('0x7')]?Mustache[_0x8ab9('0x8')](_0x5a06d6['data3'],_0x283a2f):_0x283a2f;sh[_0x8ab9('0x4')](_0x482b12,function(_0x6ccb21,_0x2736dd,_0x16a844){if(_0x6ccb21!==0x0){logger[_0x8ab9('0x9')](util['format'](_0x8ab9('0xa'),_0x350052,_0x482b12,_0x6ccb21,_0x16a844));}else{logger[_0x8ab9('0xb')](util[_0x8ab9('0xc')](_0x8ab9('0xd'),_0x350052,_0x482b12,_0x2736dd));}});}; \ 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 73c6b07..c0d449e 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 _0x5137=['data2','stringify','isNil',',\x20request\x20body:\x20','object','data1','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','exec','data5','headers','data6','GET','POST','PUT','data7','parse','render','body','error','stack','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x25f664,_0x182d05){var _0x45f9c9=function(_0x373ccb){while(--_0x373ccb){_0x25f664['push'](_0x25f664['shift']());}};_0x45f9c9(++_0x182d05);}(_0x5137,0xd5));var _0x7513=function(_0x1fbb86,_0x2a19f1){_0x1fbb86=_0x1fbb86-0x0;var _0x46d6b7=_0x5137[_0x1fbb86];return _0x46d6b7;};'use strict';var rp=require(_0x7513('0x0'));var util=require(_0x7513('0x1'));var _=require('lodash');var Mustache=require(_0x7513('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0x7513('0x3')]=function(_0x59fa85,_0x191102){var _0x4bc855,_0x46fe61;var _0xa9a77e={'method':_0x59fa85['data1']['toUpperCase'](),'uri':Mustache['render'](_0x59fa85['data2'],_0x191102),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x59fa85[_0x7513('0x4')])==='number'&&parseInt(_0x59fa85[_0x7513('0x4')])>=0x1&&parseInt(_0x59fa85['data5'])<=0xa?parseInt(_0x59fa85[_0x7513('0x4')])*0x3e8:0x5*0x3e8};try{_0xa9a77e[_0x7513('0x5')]=_0x59fa85[_0x7513('0x6')]?JSON['parse'](Mustache['render'](_0x59fa85[_0x7513('0x6')],_0x191102)):{};}catch(_0x2ecbf8){logger['error'](_0x2ecbf8['stack']);}switch(_0x59fa85['data1']['toUpperCase']()){case _0x7513('0x7'):case'DELETE':_0x4bc855=null;_0xa9a77e['qs']=_0x191102;break;case _0x7513('0x8'):case _0x7513('0x9'):if(_0x59fa85[_0x7513('0xa')]){try{_0x4bc855=JSON[_0x7513('0xb')](Mustache[_0x7513('0xc')](_0x59fa85[_0x7513('0xa')],_0x191102));_0xa9a77e[_0x7513('0xd')]=_0x4bc855;}catch(_0x5a9669){logger[_0x7513('0xe')](_0x5a9669[_0x7513('0xf')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4bc855=_0x191102;_0xa9a77e['body']=_0x4bc855;}break;}logger[_0x7513('0x10')](util[_0x7513('0x11')](_0x7513('0x12'),_0x59fa85['data1'],_0x59fa85[_0x7513('0x13')],JSON[_0x7513('0x14')](_0xa9a77e)));rp(_0xa9a77e)['then'](function(_0x45901e){_0x4bc855=!_[_0x7513('0x15')](_0x4bc855)?_0x7513('0x16')+_0x4bc855:'';_0x46fe61=typeof _0x45901e[_0x7513('0xd')]===_0x7513('0x17')?JSON[_0x7513('0x14')](_0x45901e[_0x7513('0xd')]):_0x45901e[_0x7513('0xd')];logger[_0x7513('0x10')](util[_0x7513('0x11')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x59fa85[_0x7513('0x18')],_0x59fa85['data2'],_0x45901e[_0x7513('0x19')],_0x46fe61));})['catch'](function(_0x462af1){logger[_0x7513('0xe')](util[_0x7513('0x11')](_0x7513('0x1a'),_0x59fa85[_0x7513('0x18')],_0x59fa85[_0x7513('0x13')],_0x462af1[_0x7513('0x19')],_0x462af1[_0x7513('0x1b')],_0x462af1[_0x7513('0x1c')]));});}; \ No newline at end of file +var _0x7341=['stack','GET','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','catch','message','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','data5','number','headers','parse','render','data6','error'];(function(_0x290201,_0x279632){var _0x3d5c08=function(_0x3d0f41){while(--_0x3d0f41){_0x290201['push'](_0x290201['shift']());}};_0x3d5c08(++_0x279632);}(_0x7341,0x173));var _0x1734=function(_0x742a0,_0x140756){_0x742a0=_0x742a0-0x0;var _0x10b4f7=_0x7341[_0x742a0];return _0x10b4f7;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x1734('0x0'));var Mustache=require(_0x1734('0x1'));var logger=require(_0x1734('0x2'))('trigger');exports[_0x1734('0x3')]=function(_0x36f8a5,_0x4af5a2){var _0x32491a,_0x171d10;var _0x26b914={'method':_0x36f8a5[_0x1734('0x4')][_0x1734('0x5')](),'uri':Mustache['render'](_0x36f8a5['data2'],_0x4af5a2),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x36f8a5[_0x1734('0x6')])===_0x1734('0x7')&&parseInt(_0x36f8a5[_0x1734('0x6')])>=0x1&&parseInt(_0x36f8a5['data5'])<=0xa?parseInt(_0x36f8a5['data5'])*0x3e8:0x5*0x3e8};try{_0x26b914[_0x1734('0x8')]=_0x36f8a5['data6']?JSON[_0x1734('0x9')](Mustache[_0x1734('0xa')](_0x36f8a5[_0x1734('0xb')],_0x4af5a2)):{};}catch(_0x34c8f1){logger[_0x1734('0xc')](_0x34c8f1[_0x1734('0xd')]);}switch(_0x36f8a5[_0x1734('0x4')][_0x1734('0x5')]()){case _0x1734('0xe'):case _0x1734('0xf'):_0x32491a=null;_0x26b914['qs']=_0x4af5a2;break;case _0x1734('0x10'):case _0x1734('0x11'):if(_0x36f8a5[_0x1734('0x12')]){try{_0x32491a=JSON['parse'](Mustache[_0x1734('0xa')](_0x36f8a5[_0x1734('0x12')],_0x4af5a2));_0x26b914['body']=_0x32491a;}catch(_0xe62dfc){logger[_0x1734('0xc')](_0xe62dfc['stack']);logger[_0x1734('0xc')](_0x1734('0x13'));}}else{_0x32491a=_0x4af5a2;_0x26b914[_0x1734('0x14')]=_0x32491a;}break;}logger[_0x1734('0x15')](util[_0x1734('0x16')](_0x1734('0x17'),_0x36f8a5[_0x1734('0x4')],_0x36f8a5['data2'],JSON[_0x1734('0x18')](_0x26b914)));rp(_0x26b914)['then'](function(_0x3ee415){_0x32491a=!_[_0x1734('0x19')](_0x32491a)?_0x1734('0x1a')+_0x32491a:'';_0x171d10=typeof _0x3ee415[_0x1734('0x14')]==='object'?JSON[_0x1734('0x18')](_0x3ee415[_0x1734('0x14')]):_0x3ee415['body'];logger[_0x1734('0x15')](util[_0x1734('0x16')](_0x1734('0x1b'),_0x36f8a5[_0x1734('0x4')],_0x36f8a5[_0x1734('0x1c')],_0x3ee415[_0x1734('0x1d')],_0x171d10));})[_0x1734('0x1e')](function(_0x175a3a){logger['error'](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x36f8a5['data1'],_0x36f8a5[_0x1734('0x1c')],_0x175a3a[_0x1734('0x1d')],_0x175a3a['name'],_0x175a3a[_0x1734('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index a8a231c..f7c6e74 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 _0xf77c=['result','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error','message'];(function(_0x41f220,_0x1e3b2b){var _0x110aa2=function(_0x218fc1){while(--_0x218fc1){_0x41f220['push'](_0x41f220['shift']());}};_0x110aa2(++_0x1e3b2b);}(_0xf77c,0xaa));var _0xcf77=function(_0x327615,_0x128547){_0x327615=_0x327615-0x0;var _0xd86a49=_0xf77c[_0x327615];return _0xd86a49;};'use strict';var jayson=require(_0xcf77('0x0'));var BPromise=require(_0xcf77('0x1'));var logger=require(_0xcf77('0x2'))(_0xcf77('0x3'));var client=jayson[_0xcf77('0x4')][_0xcf77('0x5')]({'port':0x2329});client[_0xcf77('0x6')]=function(_0x3a2975,_0x41af0a){return new BPromise(function(_0x191544,_0x1d02b0){return client['request'](_0x3a2975,_0x41af0a)[_0xcf77('0x7')](function(_0x10cc8b){logger[_0xcf77('0x8')](_0xcf77('0x9'),_0xcf77('0x3'),_0x3a2975,_0x41af0a,_0x10cc8b);if(_0x10cc8b[_0xcf77('0xa')]){logger['error'](_0xcf77('0x9'),_0xcf77('0x3'),_0x3a2975,_0x10cc8b[_0xcf77('0xa')][_0xcf77('0xb')],_0x41af0a);return _0x1d02b0(_0x10cc8b[_0xcf77('0xa')][_0xcf77('0xb')]);}else{return _0x191544(_0x10cc8b[_0xcf77('0xc')]);}})['catch'](function(_0xa9b384){logger[_0xcf77('0xa')](_0xcf77('0x9'),_0xcf77('0x3'),_0x3a2975,_0xa9b384,_0x41af0a);return _0x1d02b0(_0xa9b384);});});};module['exports']=client; \ No newline at end of file +var _0xc843=['message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error','rpc'];(function(_0x5a34e5,_0x40d8ab){var _0x464c90=function(_0xc6980d){while(--_0xc6980d){_0x5a34e5['push'](_0x5a34e5['shift']());}};_0x464c90(++_0x40d8ab);}(_0xc843,0x15c));var _0x3c84=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0xc843[_0x1ae491];return _0x4958a5;};'use strict';var jayson=require(_0x3c84('0x0'));var BPromise=require(_0x3c84('0x1'));var logger=require(_0x3c84('0x2'))(_0x3c84('0x3'));var client=jayson[_0x3c84('0x4')][_0x3c84('0x5')]({'port':0x2329});client[_0x3c84('0x6')]=function(_0x309b34,_0x23d632){return new BPromise(function(_0x287092,_0x30c313){return client[_0x3c84('0x7')](_0x309b34,_0x23d632)[_0x3c84('0x8')](function(_0x1ae1ac){logger[_0x3c84('0x9')]('rpc',_0x3c84('0x3'),_0x309b34,_0x23d632,_0x1ae1ac);if(_0x1ae1ac[_0x3c84('0xa')]){logger['error'](_0x3c84('0xb'),_0x3c84('0x3'),_0x309b34,_0x1ae1ac[_0x3c84('0xa')][_0x3c84('0xc')],_0x23d632);return _0x30c313(_0x1ae1ac[_0x3c84('0xa')][_0x3c84('0xc')]);}else{return _0x287092(_0x1ae1ac[_0x3c84('0xd')]);}})['catch'](function(_0x4f9d79){logger['error']('rpc',_0x3c84('0x3'),_0x309b34,_0x4f9d79,_0x23d632);return _0x30c313(_0x4f9d79);});});};module[_0x3c84('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 6e3816b..0dbdebc 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 _0x53aa=['getMailAccounts','then','initMailAccounts','refresh','listen','getSettings','catch','log','bluebird','./server','./realtime','./lib/email','resolve'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x53aa,0x167));var _0xa53a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x53aa[_0x2c91e9];return _0x13f0ff;};'use strict';var BPromise=require(_0xa53a('0x0'));var server=require(_0xa53a('0x1'));var Realtime=require(_0xa53a('0x2'));var EmailChannel=require(_0xa53a('0x3'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xa53a('0x4')]()['then'](mailAccount[_0xa53a('0x5')]())[_0xa53a('0x6')](realtime[_0xa53a('0x7')]())[_0xa53a('0x6')](function(){email[_0xa53a('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xa53a('0x9')](realtime,email)[_0xa53a('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xa53a('0xa')]();})[_0xa53a('0x6')](function(_0x462829){return setInterval(initRealtime,_0x462829['loginMailFrequency']*0x3e8);})[_0xa53a('0xb')](function(_0x5785a9){console[_0xa53a('0xc')](_0x5785a9);});}main(); \ No newline at end of file +var _0xe19e=['loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','initMailAccounts','refresh','mailAccounts','listen','getSettings'];(function(_0x57d72a,_0x1a4609){var _0x31415f=function(_0x35dbc8){while(--_0x35dbc8){_0x57d72a['push'](_0x57d72a['shift']());}};_0x31415f(++_0x1a4609);}(_0xe19e,0x93));var _0xee19=function(_0x396039,_0x41e5bd){_0x396039=_0x396039-0x0;var _0xed4b12=_0xe19e[_0x396039];return _0xed4b12;};'use strict';var BPromise=require(_0xee19('0x0'));var server=require(_0xee19('0x1'));var Realtime=require(_0xee19('0x2'));var EmailChannel=require(_0xee19('0x3'));var mailAccount=require(_0xee19('0x4'));var setting=require(_0xee19('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xee19('0x6')]()[_0xee19('0x7')](mailAccount['getMailAccounts']())[_0xee19('0x7')](realtime[_0xee19('0x8')]())[_0xee19('0x7')](function(){email[_0xee19('0x9')](realtime[_0xee19('0xa')]);return realtime;});}function main(){return server[_0xee19('0xb')](realtime,email)[_0xee19('0x7')](function(){return initRealtime();})[_0xee19('0x7')](function(){return setting[_0xee19('0xc')]();})[_0xee19('0x7')](function(_0x3c5585){return setInterval(initRealtime,_0x3c5585[_0xee19('0xd')]*0x3e8);})[_0xee19('0xe')](function(_0x25a900){console[_0xee19('0xf')](_0x25a900);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 0793a03..19be377 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 _0x58e1=['disabled','connected','name','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','error','lastSync','handleImapError','send','Smtp','verify','then','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','Imap','status','messageStatus','isNil','stringify','mailAccount:update','refresh','active','hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd'];(function(_0x5904b9,_0x5224bc){var _0xdcffdc=function(_0x349c25){while(--_0x349c25){_0x5904b9['push'](_0x5904b9['shift']());}};_0xdcffdc(++_0x5224bc);}(_0x58e1,0xf4));var _0x158e=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x58e1[_0x390a19];return _0x5d8230;};'use strict';var _=require(_0x158e('0x0'));var moment=require(_0x158e('0x1'));var BPromise=require(_0x158e('0x2'));var md5=require(_0x158e('0x3'));var Redis=require(_0x158e('0x4'));var config=require(_0x158e('0x5'));var logger=require('../../../config/logger')(_0x158e('0x6'));config[_0x158e('0x7')]=_[_0x158e('0x8')](config[_0x158e('0x7')],{'host':_0x158e('0x9'),'port':0x18eb});var io=require(_0x158e('0xa'))(new Redis(config[_0x158e('0x7')]));var EmailImap=require(_0x158e('0xb'));var EmailSmtp=require(_0x158e('0xc'));var mailAccount=require(_0x158e('0xd'));var md5Accounts={};function EmailChannel(_0x3f7707){logger[_0x158e('0xe')](_0x158e('0xf'));this[_0x158e('0x10')]=_0x3f7707[_0x158e('0x10')];this[_0x158e('0x11')]={};this[_0x158e('0x12')]=new EmailSmtp();}EmailChannel[_0x158e('0x13')][_0x158e('0x14')]=function(_0x51e470){var _0xcde56c=this[_0x158e('0x10')][_0x51e470];var _0x1c1656={'id':_0xcde56c['id'],'name':_0xcde56c['name'],'key':_0xcde56c[_0x158e('0x15')],'active':_0xcde56c['active'],'Imap':{'status':_0xcde56c[_0x158e('0x16')][_0x158e('0x17')],'messageStatus':_0xcde56c[_0x158e('0x16')][_0x158e('0x18')],'total':_0xcde56c[_0x158e('0x16')]['total']}};if(_[_0x158e('0x19')](md5Accounts[_0x51e470])){md5Accounts[_0x51e470]={};}var _0x1dc084=md5(JSON[_0x158e('0x1a')](_0x1c1656));if(md5Accounts[_0x51e470][_0x158e('0x3')]!==_0x1dc084){md5Accounts[_0x51e470][_0x158e('0x3')]=_0x1dc084;io['emit'](_0x158e('0x1b'),_0x1c1656);}};EmailChannel['prototype'][_0x158e('0x1c')]=function(_0x557815){for(var _0x27052c in _0x557815){if(_0x557815['hasOwnProperty'](_0x27052c)){if(_0x557815[_0x27052c][_0x158e('0x16')]&&_0x557815[_0x27052c][_0x158e('0x1d')]){var _0x4fefce=_0x557815[_0x27052c][_0x158e('0x16')];if(!this[_0x158e('0x11')][_0x158e('0x1e')](_0x4fefce['id'])){this[_0x158e('0x11')][_0x4fefce['id']]=new EmailImap(_0x4fefce,_0x557815[_0x27052c][_0x158e('0x6')]);this['imapAccounts'][_0x4fefce['id']]['on'](_0x158e('0x1f'),this['handleImapBox'][_0x158e('0x20')](this,_0x27052c));this['imapAccounts'][_0x4fefce['id']]['on'](_0x158e('0x6'),this[_0x158e('0x21')]['bind'](this,_0x27052c));this[_0x158e('0x11')][_0x4fefce['id']]['on'](_0x158e('0x22'),this[_0x158e('0x23')]['bind'](this,_0x27052c));this[_0x158e('0x11')][_0x4fefce['id']]['on']('error',this['handleImapError'][_0x158e('0x20')](this,_0x27052c));}}else{if(_[_0x158e('0x19')](this['mailAccounts'][_0x27052c]['Imap'])){this['mailAccounts'][_0x27052c][_0x158e('0x16')]={};}this[_0x158e('0x10')][_0x27052c][_0x158e('0x16')]['status']=_0x158e('0x24');this[_0x158e('0x10')][_0x27052c]['Imap'][_0x158e('0x18')]='';this[_0x158e('0x14')](_0x27052c);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x5d6c89,_0x18fd23){if(this[_0x158e('0x10')][_0x5d6c89]){this[_0x158e('0x10')][_0x5d6c89]['Imap']['status']=_0x158e('0x25');this['mailAccounts'][_0x5d6c89][_0x158e('0x16')][_0x158e('0x18')]=_0x18fd23[_0x158e('0x26')];if(_0x18fd23[_0x158e('0x27')]){this['mailAccounts'][_0x5d6c89][_0x158e('0x16')][_0x158e('0x28')]=_0x18fd23['messages'][_0x158e('0x28')];}return this[_0x158e('0x14')](_0x5d6c89);}};EmailChannel['prototype']['handleImapEmail']=function(_0x551c5d,_0x4a9bf6){logger[_0x158e('0xe')](_0x158e('0x29'),_0x4a9bf6['firstName'],_0x4a9bf6[_0x158e('0x2a')],_0x4a9bf6[_0x158e('0x2b')],_0x551c5d);if(this['mailAccounts'][_0x551c5d]){return mailAccount[_0x158e('0x2c')](_0x551c5d,_0x4a9bf6)['then'](function(_0x4593e1){if(_0x4593e1){logger['info'](_0x158e('0x2d'));}})[_0x158e('0x2e')](function(_0x25c776){logger[_0x158e('0x2f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x158e('0x1a')](_0x25c776));});}};EmailChannel['prototype'][_0x158e('0x23')]=function(_0x231738){if(this['mailAccounts'][_0x231738]&&this[_0x158e('0x10')][_0x231738][_0x158e('0x16')]){if(this[_0x158e('0x11')][this[_0x158e('0x10')][_0x231738][_0x158e('0x16')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x231738][_0x158e('0x16')]['id']];}this[_0x158e('0x10')][_0x231738][_0x158e('0x16')][_0x158e('0x30')]=moment();this[_0x158e('0x14')](_0x231738);}};EmailChannel['prototype'][_0x158e('0x31')]=function(_0x483cc3,_0x17af7f){if(this[_0x158e('0x10')][_0x483cc3]){this[_0x158e('0x10')][_0x483cc3]['Imap'][_0x158e('0x17')]='error';this['mailAccounts'][_0x483cc3]['Imap'][_0x158e('0x18')]=_0x17af7f;return this[_0x158e('0x14')](_0x483cc3);}};EmailChannel[_0x158e('0x13')]['sendMail']=function(_0x105520,_0x533538){return this[_0x158e('0x12')][_0x158e('0x32')](_0x105520,_0x533538);};EmailChannel[_0x158e('0x13')]['verifySmtp']=function(_0x1beedf){var _0x440fb9=this;if(this[_0x158e('0x10')][_0x1beedf['id']]){if(_[_0x158e('0x19')](this['mailAccounts'][_0x1beedf['id']][_0x158e('0x33')])){this[_0x158e('0x10')][_0x1beedf['id']][_0x158e('0x33')]={};}this[_0x158e('0x10')][_0x1beedf['id']][_0x158e('0x33')][_0x158e('0x30')]=moment();return new BPromise(function(_0x55e4ec,_0x14f465){return _0x440fb9[_0x158e('0x12')][_0x158e('0x34')](_0x1beedf)[_0x158e('0x35')](function(_0x5d6091){_0x440fb9[_0x158e('0x10')][_0x1beedf['id']][_0x158e('0x33')][_0x158e('0x17')]=_0x158e('0x36');_0x440fb9[_0x158e('0x10')][_0x1beedf['id']][_0x158e('0x33')][_0x158e('0x18')]='';_0x440fb9[_0x158e('0x14')](_0x1beedf['id']);_0x55e4ec(_0x5d6091);})[_0x158e('0x2e')](function(_0x45eefa){_0x440fb9[_0x158e('0x10')][_0x1beedf['id']][_0x158e('0x33')]['status']='error';_0x440fb9['mailAccounts'][_0x1beedf['id']][_0x158e('0x33')][_0x158e('0x18')]=_0x45eefa;_0x440fb9[_0x158e('0x14')](_0x1beedf['id']);_0x14f465(_0x45eefa);});});}return this['smtp']['verify'](_0x1beedf);};module[_0x158e('0x37')]=EmailChannel; \ No newline at end of file +var _0x0457=['New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','catch','handleImapEnd','sendMail','smtp','send','verifySmtp','Smtp','lastSync','verify','then','verified','exports','lodash','moment','md5','ioredis','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','email','box','bind','handleImapEmail','end','error','handleImapError','disabled','handleImapBox','status','connected','messages'];(function(_0xc878c5,_0x4531a8){var _0x96888=function(_0xee5dd8){while(--_0xee5dd8){_0xc878c5['push'](_0xc878c5['shift']());}};_0x96888(++_0x4531a8);}(_0x0457,0x128));var _0x7045=function(_0x1b29a4,_0xe794d3){_0x1b29a4=_0x1b29a4-0x0;var _0x2eddbd=_0x0457[_0x1b29a4];return _0x2eddbd;};'use strict';var _=require(_0x7045('0x0'));var moment=require(_0x7045('0x1'));var BPromise=require('bluebird');var md5=require(_0x7045('0x2'));var Redis=require(_0x7045('0x3'));var config=require('../../../config/environment');var logger=require(_0x7045('0x4'))('email');config[_0x7045('0x5')]=_[_0x7045('0x6')](config['redis'],{'host':_0x7045('0x7'),'port':0x18eb});var io=require(_0x7045('0x8'))(new Redis(config[_0x7045('0x5')]));var EmailImap=require(_0x7045('0x9'));var EmailSmtp=require(_0x7045('0xa'));var mailAccount=require(_0x7045('0xb'));var md5Accounts={};function EmailChannel(_0xbc9e27){logger[_0x7045('0xc')](_0x7045('0xd'));this[_0x7045('0xe')]=_0xbc9e27[_0x7045('0xe')];this[_0x7045('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x7045('0x10')][_0x7045('0x11')]=function(_0x24c0b2){var _0x2b0c16=this[_0x7045('0xe')][_0x24c0b2];var _0x2148b4={'id':_0x2b0c16['id'],'name':_0x2b0c16[_0x7045('0x12')],'key':_0x2b0c16['key'],'active':_0x2b0c16[_0x7045('0x13')],'Imap':{'status':_0x2b0c16[_0x7045('0x14')]['status'],'messageStatus':_0x2b0c16[_0x7045('0x14')][_0x7045('0x15')],'total':_0x2b0c16[_0x7045('0x14')][_0x7045('0x16')]}};if(_[_0x7045('0x17')](md5Accounts[_0x24c0b2])){md5Accounts[_0x24c0b2]={};}var _0x3c0b3b=md5(JSON[_0x7045('0x18')](_0x2148b4));if(md5Accounts[_0x24c0b2][_0x7045('0x2')]!==_0x3c0b3b){md5Accounts[_0x24c0b2][_0x7045('0x2')]=_0x3c0b3b;io[_0x7045('0x11')](_0x7045('0x19'),_0x2148b4);}};EmailChannel[_0x7045('0x10')][_0x7045('0x1a')]=function(_0xd63f26){for(var _0x37b176 in _0xd63f26){if(_0xd63f26[_0x7045('0x1b')](_0x37b176)){if(_0xd63f26[_0x37b176][_0x7045('0x14')]&&_0xd63f26[_0x37b176][_0x7045('0x13')]){var _0x43bfbd=_0xd63f26[_0x37b176][_0x7045('0x14')];if(!this['imapAccounts'][_0x7045('0x1b')](_0x43bfbd['id'])){this[_0x7045('0xf')][_0x43bfbd['id']]=new EmailImap(_0x43bfbd,_0xd63f26[_0x37b176][_0x7045('0x1c')]);this[_0x7045('0xf')][_0x43bfbd['id']]['on'](_0x7045('0x1d'),this['handleImapBox'][_0x7045('0x1e')](this,_0x37b176));this[_0x7045('0xf')][_0x43bfbd['id']]['on'](_0x7045('0x1c'),this[_0x7045('0x1f')][_0x7045('0x1e')](this,_0x37b176));this[_0x7045('0xf')][_0x43bfbd['id']]['on'](_0x7045('0x20'),this['handleImapEnd'][_0x7045('0x1e')](this,_0x37b176));this[_0x7045('0xf')][_0x43bfbd['id']]['on'](_0x7045('0x21'),this[_0x7045('0x22')][_0x7045('0x1e')](this,_0x37b176));}}else{if(_[_0x7045('0x17')](this[_0x7045('0xe')][_0x37b176][_0x7045('0x14')])){this['mailAccounts'][_0x37b176][_0x7045('0x14')]={};}this[_0x7045('0xe')][_0x37b176][_0x7045('0x14')]['status']=_0x7045('0x23');this['mailAccounts'][_0x37b176][_0x7045('0x14')][_0x7045('0x15')]='';this[_0x7045('0x11')](_0x37b176);}}}};EmailChannel[_0x7045('0x10')][_0x7045('0x24')]=function(_0x205d15,_0x1f9859){if(this[_0x7045('0xe')][_0x205d15]){this['mailAccounts'][_0x205d15][_0x7045('0x14')][_0x7045('0x25')]=_0x7045('0x26');this[_0x7045('0xe')][_0x205d15][_0x7045('0x14')][_0x7045('0x15')]=_0x1f9859[_0x7045('0x12')];if(_0x1f9859['messages']){this['mailAccounts'][_0x205d15]['Imap'][_0x7045('0x16')]=_0x1f9859[_0x7045('0x27')][_0x7045('0x16')];}return this[_0x7045('0x11')](_0x205d15);}};EmailChannel[_0x7045('0x10')][_0x7045('0x1f')]=function(_0x5b8f6b,_0x41d808){logger[_0x7045('0xc')](_0x7045('0x28'),_0x41d808[_0x7045('0x29')],_0x41d808[_0x7045('0x2a')],_0x41d808[_0x7045('0x2b')],_0x5b8f6b);if(this[_0x7045('0xe')][_0x5b8f6b]){return mailAccount['notify'](_0x5b8f6b,_0x41d808)['then'](function(_0x221538){if(_0x221538){logger[_0x7045('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0x7045('0x2c')](function(_0xf5560b){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x7045('0x18')](_0xf5560b));});}};EmailChannel[_0x7045('0x10')][_0x7045('0x2d')]=function(_0x1ada12){if(this[_0x7045('0xe')][_0x1ada12]&&this[_0x7045('0xe')][_0x1ada12][_0x7045('0x14')]){if(this[_0x7045('0xf')][this[_0x7045('0xe')][_0x1ada12][_0x7045('0x14')]['id']]){delete this['imapAccounts'][this[_0x7045('0xe')][_0x1ada12][_0x7045('0x14')]['id']];}this[_0x7045('0xe')][_0x1ada12][_0x7045('0x14')]['lastSync']=moment();this['emit'](_0x1ada12);}};EmailChannel[_0x7045('0x10')][_0x7045('0x22')]=function(_0x1706a9,_0x285d13){if(this['mailAccounts'][_0x1706a9]){this[_0x7045('0xe')][_0x1706a9]['Imap'][_0x7045('0x25')]=_0x7045('0x21');this[_0x7045('0xe')][_0x1706a9][_0x7045('0x14')][_0x7045('0x15')]=_0x285d13;return this[_0x7045('0x11')](_0x1706a9);}};EmailChannel[_0x7045('0x10')][_0x7045('0x2e')]=function(_0x1d4aab,_0x249910){return this[_0x7045('0x2f')][_0x7045('0x30')](_0x1d4aab,_0x249910);};EmailChannel[_0x7045('0x10')][_0x7045('0x31')]=function(_0x23e36f){var _0x396007=this;if(this['mailAccounts'][_0x23e36f['id']]){if(_[_0x7045('0x17')](this[_0x7045('0xe')][_0x23e36f['id']]['Smtp'])){this[_0x7045('0xe')][_0x23e36f['id']][_0x7045('0x32')]={};}this['mailAccounts'][_0x23e36f['id']]['Smtp'][_0x7045('0x33')]=moment();return new BPromise(function(_0x135ad1,_0xad8c83){return _0x396007[_0x7045('0x2f')][_0x7045('0x34')](_0x23e36f)[_0x7045('0x35')](function(_0x4577e1){_0x396007['mailAccounts'][_0x23e36f['id']][_0x7045('0x32')][_0x7045('0x25')]=_0x7045('0x36');_0x396007['mailAccounts'][_0x23e36f['id']][_0x7045('0x32')][_0x7045('0x15')]='';_0x396007['emit'](_0x23e36f['id']);_0x135ad1(_0x4577e1);})[_0x7045('0x2c')](function(_0x1bcbb8){_0x396007['mailAccounts'][_0x23e36f['id']][_0x7045('0x32')][_0x7045('0x25')]=_0x7045('0x21');_0x396007[_0x7045('0xe')][_0x23e36f['id']][_0x7045('0x32')][_0x7045('0x15')]=_0x1bcbb8;_0x396007[_0x7045('0x11')](_0x23e36f['id']);_0xad8c83(_0x1bcbb8);});});}return this['smtp'][_0x7045('0x34')](_0x23e36f);};module[_0x7045('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index c42ce87..5a155ec 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 _0xd4c9=['mailparser','iconv','Iconv','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','imap','once','ready','bind','handleError','connect','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','getHost','service','email','handleReady','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','textCode','hasOwnProperty','upperFirst','exports','path','util','randomstring'];(function(_0xf20295,_0x345c54){var _0x25f12f=function(_0x3e63a7){while(--_0x3e63a7){_0xf20295['push'](_0xf20295['shift']());}};_0x25f12f(++_0x345c54);}(_0xd4c9,0x1bd));var _0x9d4c=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0xd4c9[_0x4ca333];return _0x13b2e1;};'use strict';var fs=require('fs');var path=require(_0x9d4c('0x0'));var util=require(_0x9d4c('0x1'));var Imap=require('imap');var _=require('lodash');var rs=require(_0x9d4c('0x2'));var simpleParser=require(_0x9d4c('0x3'))['simpleParser'];var Iconv=require(_0x9d4c('0x4'))[_0x9d4c('0x5')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0x9d4c('0x6'));var logger=require(_0x9d4c('0x7'))('email');function EmailImap(_0x6bc2b8,_0x45977b){this[_0x9d4c('0x8')]=_0x9d4c('0x9');this[_0x9d4c('0xa')]=this[_0x9d4c('0xb')](_0x6bc2b8,_0x45977b);this[_0x9d4c('0xc')]=new Imap(this[_0x9d4c('0xa')]);this['imap'][_0x9d4c('0xd')](_0x9d4c('0xe'),this['handleReady'][_0x9d4c('0xf')](this));this[_0x9d4c('0xc')]['once']('end',this['handleEnd'][_0x9d4c('0xf')](this));this[_0x9d4c('0xc')]['on']('error',this[_0x9d4c('0x10')][_0x9d4c('0xf')](this));this[_0x9d4c('0xc')][_0x9d4c('0x11')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x9d4c('0x12')][_0x9d4c('0xb')]=function(_0x2ff21d,_0x4d33f4){var _0x2e9d24={'connTimeout':_0x2ff21d[_0x9d4c('0x13')]?_0x2ff21d[_0x9d4c('0x13')]*0x3e8:0x2710,'authTimeout':_0x2ff21d[_0x9d4c('0x14')]?_0x2ff21d[_0x9d4c('0x14')]*0x3e8:0x1388};if(_[_0x9d4c('0x15')](_0x2ff21d['service'])){if(_0x2ff21d[_0x9d4c('0x16')]){_0x2e9d24[_0x9d4c('0x17')]=_0x2ff21d[_0x9d4c('0x17')];_0x2e9d24[_0x9d4c('0x18')]=_0x2ff21d[_0x9d4c('0x18')];}_0x2e9d24[_0x9d4c('0x19')]=_0x2ff21d[_0x9d4c('0x19')];_0x2e9d24['port']=_0x2ff21d[_0x9d4c('0x1a')]||0x3e1;if(_0x2ff21d[_0x9d4c('0x1b')]){_0x2e9d24[_0x9d4c('0x1b')]=!![];}else{_0x2e9d24[_0x9d4c('0x1b')]=![];_0x2e9d24[_0x9d4c('0x1c')]=_0x9d4c('0x1d');}}else{_0x2e9d24[_0x9d4c('0x17')]=_0x2ff21d['user'];_0x2e9d24['password']=_0x2ff21d[_0x9d4c('0x18')];_0x2e9d24[_0x9d4c('0x19')]=utils[_0x9d4c('0x1e')](_0x2ff21d[_0x9d4c('0x1f')]);_0x2e9d24[_0x9d4c('0x1a')]=0x3e1;_0x2e9d24['tls']=!![];}_0x2e9d24[_0x9d4c('0x20')]=_0x4d33f4||_0x2ff21d[_0x9d4c('0x17')]||'anonymous@xcally.com';return _0x2e9d24;};EmailImap[_0x9d4c('0x12')][_0x9d4c('0x21')]=function(){this[_0x9d4c('0xc')][_0x9d4c('0x22')](this['mailbox'],![],this['handleOpenBox'][_0x9d4c('0xf')](this));};EmailImap['prototype'][_0x9d4c('0x23')]=function(_0x2df650,_0x173c83){if(_0x2df650){this[_0x9d4c('0x10')](_0x2df650,!![]);}else{this[_0x9d4c('0x24')](_0x9d4c('0x25'),_0x173c83);this[_0x9d4c('0x26')]();}};EmailImap['prototype'][_0x9d4c('0x27')]=function(_0x2a0be8){if(_0x2a0be8){this[_0x9d4c('0x10')](_0x2a0be8,!![]);}else{this['imap'][_0x9d4c('0x28')]();}};EmailImap['prototype'][_0x9d4c('0x26')]=function(){this[_0x9d4c('0xc')][_0x9d4c('0x29')]([_0x9d4c('0x2a')],this[_0x9d4c('0x2b')]['bind'](this));};EmailImap['prototype'][_0x9d4c('0x2b')]=function(_0x5bb303,_0x5ca13f){if(_0x5bb303){this[_0x9d4c('0x10')](_0x5bb303,!![]);}else{if(_0x5ca13f[_0x9d4c('0x2c')]){try{var _0x521de3=this[_0x9d4c('0xc')][_0x9d4c('0x2d')](_0x5ca13f,{'bodies':'','markSeen':!![]});_0x521de3['on'](_0x9d4c('0x2e'),this[_0x9d4c('0x2f')][_0x9d4c('0xf')](this));_0x521de3[_0x9d4c('0xd')](_0x9d4c('0x30'),this[_0x9d4c('0x31')]['bind'](this));_0x521de3['once'](_0x9d4c('0x28'),this[_0x9d4c('0x32')][_0x9d4c('0xf')](this));}catch(_0x24d84f){logger['error'](_0x24d84f);}}else{this[_0x9d4c('0xc')][_0x9d4c('0x33')](!![],this[_0x9d4c('0x27')][_0x9d4c('0xf')](this));}}};EmailImap[_0x9d4c('0x12')]['handleFetchMessage']=function(_0x30572a,_0x505988){_0x30572a['on'](_0x9d4c('0x34'),this[_0x9d4c('0x35')]['bind'](this));_0x30572a[_0x9d4c('0xd')](_0x9d4c('0x36'),this[_0x9d4c('0x37')][_0x9d4c('0xf')](this));_0x30572a['once'](_0x9d4c('0x28'),this[_0x9d4c('0x38')]['bind'](this));};EmailImap['prototype'][_0x9d4c('0x35')]=function(_0x1f6a53,_0x2357cf){simpleParser(_0x1f6a53,{'Iconv':Iconv},this[_0x9d4c('0x39')][_0x9d4c('0xf')](this));};EmailImap[_0x9d4c('0x12')][_0x9d4c('0x37')]=function(_0x2ea799){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap['prototype'][_0x9d4c('0x39')]=function(_0x29d7a9,_0x2e8357){if(_0x29d7a9){logger[_0x9d4c('0x30')](_0x29d7a9);}else{var _0x5abb36=this;utils[_0x9d4c('0x3a')](this[_0x9d4c('0xa')],_0x2e8357,function(_0x2efe83){_0x5abb36[_0x9d4c('0x24')](_0x9d4c('0x20'),_0x2efe83);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x9d4c('0xc')][_0x9d4c('0x33')](!![],this[_0x9d4c('0x27')][_0x9d4c('0xf')](this));};EmailImap[_0x9d4c('0x12')]['handleFetchError']=function(_0x4c9f6e){this[_0x9d4c('0x10')](_0x4c9f6e);this[_0x9d4c('0xc')][_0x9d4c('0x33')](!![],this[_0x9d4c('0x27')][_0x9d4c('0xf')](this));};EmailImap[_0x9d4c('0x12')][_0x9d4c('0x3b')]=function(){this['emit']('end');};EmailImap[_0x9d4c('0x12')][_0x9d4c('0x10')]=function(_0x4b1412,_0x326035){logger[_0x9d4c('0x30')](_0x9d4c('0x10'),this[_0x9d4c('0xa')][_0x9d4c('0x20')],JSON['stringify'](_0x4b1412));var _0x5720d9='';if(_0x4b1412){if(_0x4b1412[_0x9d4c('0x3c')]){_0x5720d9=_0x4b1412['textCode'];}else{for(var _0x1c031c in _0x4b1412){if(_0x4b1412[_0x9d4c('0x3d')](_0x1c031c)){_0x5720d9+=_[_0x9d4c('0x3e')](_0x1c031c)+':\x20'+_0x4b1412[_0x1c031c]+'\x0a';}}}}if(_0x326035){this['imap']['end']();}else{this[_0x9d4c('0x24')]('error',_0x5720d9);this[_0x9d4c('0x24')](_0x9d4c('0x28'));}};module[_0x9d4c('0x3f')]=EmailImap; \ No newline at end of file +var _0xc3e7=['host','port','tls','required','getHost','service','anonymous@xcally.com','openBox','mailbox','handleOpenBox','box','readUnseen','handleCloseBox','end','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','once','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','emit','handleFetchEnd','closeBox','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','account','getAccount','imap','ready','handleReady','bind','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','authentication','user','password'];(function(_0x390041,_0xe57416){var _0x25b9b1=function(_0x260e42){while(--_0x260e42){_0x390041['push'](_0x390041['shift']());}};_0x25b9b1(++_0xe57416);}(_0xc3e7,0xa1));var _0x7c3e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xc3e7[_0xbb091];return _0x467a04;};'use strict';var fs=require('fs');var path=require(_0x7c3e('0x0'));var util=require(_0x7c3e('0x1'));var Imap=require('imap');var _=require(_0x7c3e('0x2'));var rs=require(_0x7c3e('0x3'));var simpleParser=require(_0x7c3e('0x4'))[_0x7c3e('0x5')];var Iconv=require(_0x7c3e('0x6'))[_0x7c3e('0x7')];var EventEmitter=require(_0x7c3e('0x8'))[_0x7c3e('0x9')];var utils=require('./utils');var logger=require(_0x7c3e('0xa'))(_0x7c3e('0xb'));function EmailImap(_0x3f2280,_0x18ea42){this['mailbox']='INBOX';this[_0x7c3e('0xc')]=this[_0x7c3e('0xd')](_0x3f2280,_0x18ea42);this['imap']=new Imap(this[_0x7c3e('0xc')]);this[_0x7c3e('0xe')]['once'](_0x7c3e('0xf'),this[_0x7c3e('0x10')][_0x7c3e('0x11')](this));this[_0x7c3e('0xe')]['once']('end',this['handleEnd'][_0x7c3e('0x11')](this));this[_0x7c3e('0xe')]['on'](_0x7c3e('0x12'),this[_0x7c3e('0x13')][_0x7c3e('0x11')](this));this[_0x7c3e('0xe')][_0x7c3e('0x14')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x7c3e('0x15')]['getAccount']=function(_0x5179df,_0x12ed2a){var _0x3a6927={'connTimeout':_0x5179df[_0x7c3e('0x16')]?_0x5179df[_0x7c3e('0x16')]*0x3e8:0x2710,'authTimeout':_0x5179df[_0x7c3e('0x17')]?_0x5179df['authTimeout']*0x3e8:0x1388};if(_[_0x7c3e('0x18')](_0x5179df['service'])){if(_0x5179df[_0x7c3e('0x19')]){_0x3a6927[_0x7c3e('0x1a')]=_0x5179df['user'];_0x3a6927[_0x7c3e('0x1b')]=_0x5179df[_0x7c3e('0x1b')];}_0x3a6927[_0x7c3e('0x1c')]=_0x5179df[_0x7c3e('0x1c')];_0x3a6927[_0x7c3e('0x1d')]=_0x5179df['port']||0x3e1;if(_0x5179df[_0x7c3e('0x1e')]){_0x3a6927[_0x7c3e('0x1e')]=!![];}else{_0x3a6927[_0x7c3e('0x1e')]=![];_0x3a6927['autotls']=_0x7c3e('0x1f');}}else{_0x3a6927['user']=_0x5179df[_0x7c3e('0x1a')];_0x3a6927[_0x7c3e('0x1b')]=_0x5179df['password'];_0x3a6927[_0x7c3e('0x1c')]=utils[_0x7c3e('0x20')](_0x5179df[_0x7c3e('0x21')]);_0x3a6927['port']=0x3e1;_0x3a6927[_0x7c3e('0x1e')]=!![];}_0x3a6927[_0x7c3e('0xb')]=_0x12ed2a||_0x5179df[_0x7c3e('0x1a')]||_0x7c3e('0x22');return _0x3a6927;};EmailImap[_0x7c3e('0x15')]['handleReady']=function(){this['imap'][_0x7c3e('0x23')](this[_0x7c3e('0x24')],![],this[_0x7c3e('0x25')][_0x7c3e('0x11')](this));};EmailImap['prototype'][_0x7c3e('0x25')]=function(_0x5e5138,_0xf3487a){if(_0x5e5138){this['handleError'](_0x5e5138,!![]);}else{this['emit'](_0x7c3e('0x26'),_0xf3487a);this[_0x7c3e('0x27')]();}};EmailImap[_0x7c3e('0x15')][_0x7c3e('0x28')]=function(_0x5725e5){if(_0x5725e5){this['handleError'](_0x5725e5,!![]);}else{this[_0x7c3e('0xe')][_0x7c3e('0x29')]();}};EmailImap['prototype'][_0x7c3e('0x27')]=function(){this[_0x7c3e('0xe')]['search']([_0x7c3e('0x2a')],this[_0x7c3e('0x2b')][_0x7c3e('0x11')](this));};EmailImap[_0x7c3e('0x15')]['handleReadUnseen']=function(_0x350eb7,_0x39d6a9){if(_0x350eb7){this[_0x7c3e('0x13')](_0x350eb7,!![]);}else{if(_0x39d6a9[_0x7c3e('0x2c')]){try{var _0x329f5e=this[_0x7c3e('0xe')][_0x7c3e('0x2d')](_0x39d6a9,{'bodies':'','markSeen':!![]});_0x329f5e['on']('message',this[_0x7c3e('0x2e')]['bind'](this));_0x329f5e['once']('error',this[_0x7c3e('0x2f')]['bind'](this));_0x329f5e[_0x7c3e('0x30')](_0x7c3e('0x29'),this['handleFetchEnd'][_0x7c3e('0x11')](this));}catch(_0x4c2a56){logger[_0x7c3e('0x12')](_0x4c2a56);}}else{this[_0x7c3e('0xe')]['closeBox'](!![],this['handleCloseBox'][_0x7c3e('0x11')](this));}}};EmailImap[_0x7c3e('0x15')][_0x7c3e('0x2e')]=function(_0x379894,_0x28e2a9){_0x379894['on'](_0x7c3e('0x31'),this[_0x7c3e('0x32')][_0x7c3e('0x11')](this));_0x379894[_0x7c3e('0x30')](_0x7c3e('0x33'),this['handleMessageAttributes']['bind'](this));_0x379894[_0x7c3e('0x30')](_0x7c3e('0x29'),this[_0x7c3e('0x34')][_0x7c3e('0x11')](this));};EmailImap[_0x7c3e('0x15')][_0x7c3e('0x32')]=function(_0x5683fc,_0xae6b5d){simpleParser(_0x5683fc,{'Iconv':Iconv},this[_0x7c3e('0x35')][_0x7c3e('0x11')](this));};EmailImap[_0x7c3e('0x15')]['handleMessageAttributes']=function(_0x489c6f){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x7c3e('0x15')]['handleSimpleParser']=function(_0x2b3798,_0x1a87a3){if(_0x2b3798){logger[_0x7c3e('0x12')](_0x2b3798);}else{var _0x43b66=this;utils['parser'](this[_0x7c3e('0xc')],_0x1a87a3,function(_0x537a44){_0x43b66[_0x7c3e('0x36')]('email',_0x537a44);});}};EmailImap['prototype'][_0x7c3e('0x37')]=function(){this[_0x7c3e('0xe')][_0x7c3e('0x38')](!![],this['handleCloseBox'][_0x7c3e('0x11')](this));};EmailImap[_0x7c3e('0x15')][_0x7c3e('0x2f')]=function(_0x1007ca){this['handleError'](_0x1007ca);this['imap'][_0x7c3e('0x38')](!![],this[_0x7c3e('0x28')][_0x7c3e('0x11')](this));};EmailImap[_0x7c3e('0x15')][_0x7c3e('0x39')]=function(){this[_0x7c3e('0x36')](_0x7c3e('0x29'));};EmailImap[_0x7c3e('0x15')][_0x7c3e('0x13')]=function(_0x3f07ea,_0x5ba3a5){logger[_0x7c3e('0x12')](_0x7c3e('0x13'),this[_0x7c3e('0xc')][_0x7c3e('0xb')],JSON[_0x7c3e('0x3a')](_0x3f07ea));var _0x48b3a5='';if(_0x3f07ea){if(_0x3f07ea[_0x7c3e('0x3b')]){_0x48b3a5=_0x3f07ea[_0x7c3e('0x3b')];}else{for(var _0x383d4c in _0x3f07ea){if(_0x3f07ea[_0x7c3e('0x3c')](_0x383d4c)){_0x48b3a5+=_[_0x7c3e('0x3d')](_0x383d4c)+':\x20'+_0x3f07ea[_0x383d4c]+'\x0a';}}}}if(_0x5ba3a5){this['imap'][_0x7c3e('0x29')]();}else{this[_0x7c3e('0x36')](_0x7c3e('0x12'),_0x48b3a5);this['emit'](_0x7c3e('0x29'));}};module[_0x7c3e('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d9ac94d..6b5b541 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 _0xa7af=['verify','toString','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','sendMail'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0xa7af,0xc4));var _0xfa7a=function(_0x4b869a,_0x1f993d){_0x4b869a=_0x4b869a-0x0;var _0x10d713=_0xa7af[_0x4b869a];return _0x10d713;};'use strict';var nodemailer=require(_0xfa7a('0x0'));var BPromise=require(_0xfa7a('0x1'));var inlineBase64=require(_0xfa7a('0x2'));function EmailSmtp(){}EmailSmtp[_0xfa7a('0x3')][_0xfa7a('0x4')]=function(_0x50f840,_0x566a78){return new BPromise(function(_0x4f5905,_0x58dbe8){var _0x3f6b52=nodemailer[_0xfa7a('0x5')](_0x50f840);_0x3f6b52[_0xfa7a('0x6')]('compile',inlineBase64());_0x3f6b52[_0xfa7a('0x7')](_0x566a78,function(_0x545e2c,_0x3775a0){if(_0x545e2c){_0x58dbe8(_0x545e2c['toString']());}else{_0x4f5905(_0x3775a0);}});});};EmailSmtp[_0xfa7a('0x3')][_0xfa7a('0x8')]=function(_0x1f19c4){return new BPromise(function(_0x10c056,_0x13b427){var _0x24d36a=nodemailer[_0xfa7a('0x5')](_0x1f19c4);_0x24d36a[_0xfa7a('0x8')](function(_0x55d112,_0x322a3f){if(_0x55d112){_0x13b427(_0x55d112[_0xfa7a('0x9')]());}else{if(_0x322a3f){_0x10c056(_0x322a3f);}else{_0x13b427(_0xfa7a('0xa'));}}});});};module[_0xfa7a('0xb')]=EmailSmtp; \ No newline at end of file +var _0x0331=['toString','prototype','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x0331,0xad));var _0x1033=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x0331[_0x3a7634];return _0x23bbe9;};'use strict';var nodemailer=require(_0x1033('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x1033('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x1033('0x2')]=function(_0x30367d,_0x123c47){return new BPromise(function(_0x2d527f,_0x95cd1){var _0x2600f1=nodemailer[_0x1033('0x3')](_0x30367d);_0x2600f1[_0x1033('0x4')](_0x1033('0x5'),inlineBase64());_0x2600f1[_0x1033('0x6')](_0x123c47,function(_0x2c109d,_0x48e39c){if(_0x2c109d){_0x95cd1(_0x2c109d[_0x1033('0x7')]());}else{_0x2d527f(_0x48e39c);}});});};EmailSmtp[_0x1033('0x8')][_0x1033('0x9')]=function(_0x3ae886){return new BPromise(function(_0x41559a,_0x231cc8){var _0x253359=nodemailer[_0x1033('0x3')](_0x3ae886);_0x253359[_0x1033('0x9')](function(_0x21d40b,_0x5aa7a1){if(_0x21d40b){_0x231cc8(_0x21d40b[_0x1033('0x7')]());}else{if(_0x5aa7a1){_0x41559a(_0x5aa7a1);}else{_0x231cc8(_0x1033('0xa'));}}});});};module[_0x1033('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index aeeeb0e..4c8d922 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 _0x9ade=['util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','split','slice','Anonymous','length','pop','isEmpty','html','test','replace','includes','','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path'];(function(_0x224ad9,_0x5d97a7){var _0x532997=function(_0x323951){while(--_0x323951){_0x224ad9['push'](_0x224ad9['shift']());}};_0x532997(++_0x5d97a7);}(_0x9ade,0x8e));var _0xe9ad=function(_0x28b440,_0x1b2b23){_0x28b440=_0x28b440-0x0;var _0x271fdd=_0x9ade[_0x28b440];return _0x271fdd;};'use strict';var _=require(_0xe9ad('0x0'));var moment=require(_0xe9ad('0x1'));var random=require(_0xe9ad('0x2'));var fs=require('fs');var path=require(_0xe9ad('0x3'));var util=require(_0xe9ad('0x4'));var tnef=require(_0xe9ad('0x5'));var logger=require(_0xe9ad('0x6'))(_0xe9ad('0x7'));var config=require(_0xe9ad('0x8'));function getAddress(_0x441278){var _0x5ed31d=_[_0xe9ad('0x9')](_0x441278['value']);return _0x5ed31d&&_0x5ed31d['address']?_0x5ed31d[_0xe9ad('0xa')]:_0xe9ad('0xb')+random[_0xe9ad('0xc')](0x6)+_0xe9ad('0xd');}function getFirstName(_0x359a7c){var _0x1b715a=_[_0xe9ad('0x9')](_0x359a7c[_0xe9ad('0xe')]);if(_0x1b715a&&_0x1b715a[_0xe9ad('0xf')]){if(_0x1b715a[_0xe9ad('0xf')]==_0x1b715a[_0xe9ad('0xa')]){return _0x1b715a['name'][_0xe9ad('0x10')](0x0,_0x1b715a[_0xe9ad('0xf')]['indexOf']('@'));}var _0x418e9d=_0x1b715a[_0xe9ad('0xf')][_0xe9ad('0x11')](/\s+/);return _0x418e9d['length']>0x1?_0x418e9d[_0xe9ad('0x12')](0x0,-0x1)['join']('\x20'):_0x1b715a['name'];}return _0xe9ad('0x13');}function getLastName(_0x2cbf3b){var _0x2296ba=_[_0xe9ad('0x9')](_0x2cbf3b[_0xe9ad('0xe')]);if(_0x2296ba&&_0x2296ba[_0xe9ad('0xf')]){var _0x389f11=_0x2296ba[_0xe9ad('0xf')]['split'](/\s+/);return _0x389f11[_0xe9ad('0x14')]>0x1?_0x389f11[_0xe9ad('0x15')]():'';}return'';}function getMails(_0x37c6a9,_0x2204aa){var _0x364278='';for(var _0x358c47=0x0;_0x358c47<_0x2204aa['value'][_0xe9ad('0x14')];_0x358c47+=0x1){if(_0x2204aa[_0xe9ad('0xe')][_0x358c47][_0xe9ad('0xa')]!==_0x37c6a9){if(!_[_0xe9ad('0x16')](_0x364278)){_0x364278+=',';}_0x364278+=_0x2204aa[_0xe9ad('0xe')][_0x358c47][_0xe9ad('0xf')]||_0x2204aa[_0xe9ad('0xe')][_0x358c47][_0xe9ad('0xa')]||'';_0x364278+='\x20<';_0x364278+=_0x2204aa[_0xe9ad('0xe')][_0x358c47][_0xe9ad('0xa')]?_0x2204aa[_0xe9ad('0xe')][_0x358c47]['address']:_0xe9ad('0xb')+random['generate'](0x6)+_0xe9ad('0xd');_0x364278+='>';}}return _0x364278;}function parseEmail(_0x5435d6,_0x3c1911,_0x5bb308){if(_0x3c1911[_0xe9ad('0x17')]){var _0x37089a=/)<[^<]*)*<\/script>/gi;while(_0x37089a[_0xe9ad('0x18')](_0x3c1911['html'])){_0x3c1911['html']=_0x3c1911[_0xe9ad('0x17')][_0xe9ad('0x19')](_0x37089a,'');}if(_0x3c1911['html'][_0xe9ad('0x1a')](_0xe9ad('0x1b'))){var _0x123317=[];_0x3c1911['attachments'][_0xe9ad('0x1c')](_0x8db3e3=>{_0x123317[_0xe9ad('0x1d')](_0x8db3e3[_0xe9ad('0x1e')]);});var _0x37e926=/]+>/g;var _0x5a75a4=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3ad89d=_0x3c1911[_0xe9ad('0x17')][_0xe9ad('0x19')](_0x5a75a4,_0xe9ad('0x1f'));var _0x20ee77=_0x3ad89d[_0xe9ad('0x19')](_0x37e926,'_IMG');for(let _0x5c5ab5=0x0;_0x5c5ab5<_0x123317[_0xe9ad('0x14')];_0x5c5ab5++){var _0x4a9916=_0x20ee77[_0xe9ad('0x19')](_0xe9ad('0x20'),'\x20[Attachment:\x20'+_0x123317[_0x5c5ab5]+_0xe9ad('0x21'));_0x20ee77=_0x4a9916;}_0x3c1911[_0xe9ad('0x17')]=_0x20ee77;}_0x5bb308[_0xe9ad('0x22')]=_0x3c1911[_0xe9ad('0x17')];}else{_0x5bb308[_0xe9ad('0x22')]=_0x3c1911[_0xe9ad('0x23')];}if(_0x5bb308[_0xe9ad('0x22')]){_0x5bb308['body']=_0x5bb308[_0xe9ad('0x22')][_0xe9ad('0x19')](/0x0){var _0x49431e=[_0xe9ad('0x33'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0xfa68d2=0x0;_0xfa68d2<_0x3c1911[_0xe9ad('0x32')][_0xe9ad('0x14')];_0xfa68d2++){var _0x34d66d=_[_0xe9ad('0x34')](_0x49431e,_0x3c1911[_0xe9ad('0x32')][_0xfa68d2]['line']);if(_0x34d66d>=0x0){_0x5bb308['isAutoreply']=!![];}}}return _0x5bb308;}exports['parser']=function(_0x3c63e8,_0x13fd26,_0x259791){var _0x1b42bf={'from':getAddress(_0x13fd26[_0xe9ad('0x35')]),'firstName':getFirstName(_0x13fd26[_0xe9ad('0x35')]),'lastName':getLastName(_0x13fd26['from']),'mapKey':_0xe9ad('0x7'),'message':{'from':getMails(_0x3c63e8['email'],_0x13fd26[_0xe9ad('0x35')]),'to':_0x3c63e8[_0xe9ad('0x7')],'cc':'','subject':_0x13fd26['subject']||'','messageId':_0x13fd26[_0xe9ad('0x36')],'inReplyTo':_0x13fd26[_0xe9ad('0x37')],'sentAt':moment(_0x13fd26['date'])[_0xe9ad('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x13fd26['html']&&!_0x13fd26[_0xe9ad('0x23')]){var _0x32062b=_['filter'](_0x13fd26[_0xe9ad('0x28')],{'contentType':_0xe9ad('0x38')});if(_0x32062b[_0xe9ad('0x14')]){logger[_0xe9ad('0x39')](util[_0xe9ad('0x2b')](_0xe9ad('0x3a'),_0x13fd26[_0xe9ad('0x36')]));tnef[_0xe9ad('0x3b')](_[_0xe9ad('0x3c')](_0x32062b)[_0xe9ad('0x31')],function(_0x41f709,_0xf7310){if(_0xf7310){_0x13fd26[_0xe9ad('0x17')]=_0xf7310[_0xe9ad('0x3d')]||_0xe9ad('0x3e');if(_0xf7310[_0xe9ad('0x3f')]){for(var _0x219ee5=0x0;_0x219ee5<_0xf7310[_0xe9ad('0x3f')][_0xe9ad('0x14')];_0x219ee5++){var _0x16491e=_0xf7310[_0xe9ad('0x3f')][_0x219ee5];_0x1b42bf[_0xe9ad('0x25')]['attachments'][_0xe9ad('0x1d')]({'filename':_0x16491e[_0xe9ad('0x40')],'content':Buffer[_0xe9ad('0x35')](_0x16491e[_0xe9ad('0x41')])});}}}_0x259791(parseEmail(_0x3c63e8,_0x13fd26,_0x1b42bf));});}else{_0x13fd26[_0xe9ad('0x17')]='

Empty\x20message

';_0x259791(parseEmail(_0x3c63e8,_0x13fd26,_0x1b42bf));}}else{_0x259791(parseEmail(_0x3c63e8,_0x13fd26,_0x1b42bf));}};exports['getHost']=function(_0x315403){switch(_0x315403){case _0xe9ad('0x42'):return _0xe9ad('0x43');case _0xe9ad('0x44'):return'imap.mail.yahoo.com';case'hotmail':return _0xe9ad('0x45');case _0xe9ad('0x46'):return _0xe9ad('0x47');}return _0xe9ad('0x48');}; \ No newline at end of file +var _0x1ab1=['filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','path','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','join','Anonymous','length','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x225793['slice'](0x0,-0x1)[_0x11ab('0xd')]('\x20'):_0x3daeaf[_0x11ab('0x9')];}return _0x11ab('0xe');}function getLastName(_0x3587b7){var _0xdd66dd=_['head'](_0x3587b7[_0x11ab('0x4')]);if(_0xdd66dd&&_0xdd66dd[_0x11ab('0x9')]){var _0x215b33=_0xdd66dd[_0x11ab('0x9')]['split'](/\s+/);return _0x215b33[_0x11ab('0xf')]>0x1?_0x215b33[_0x11ab('0x10')]():'';}return'';}function getMails(_0x2ab33d,_0x223b80){var _0xe0b00b='';for(var _0x3a500b=0x0;_0x3a500b<_0x223b80[_0x11ab('0x4')]['length'];_0x3a500b+=0x1){if(_0x223b80[_0x11ab('0x4')][_0x3a500b][_0x11ab('0x5')]!==_0x2ab33d){if(!_[_0x11ab('0x11')](_0xe0b00b)){_0xe0b00b+=',';}_0xe0b00b+=_0x223b80[_0x11ab('0x4')][_0x3a500b][_0x11ab('0x9')]||_0x223b80[_0x11ab('0x4')][_0x3a500b][_0x11ab('0x5')]||'';_0xe0b00b+='\x20<';_0xe0b00b+=_0x223b80['value'][_0x3a500b][_0x11ab('0x5')]?_0x223b80[_0x11ab('0x4')][_0x3a500b][_0x11ab('0x5')]:_0x11ab('0x6')+random[_0x11ab('0x7')](0x6)+'@xcally.com';_0xe0b00b+='>';}}return _0xe0b00b;}function parseEmail(_0x59c83f,_0x25a57f,_0x2c7352){if(_0x25a57f[_0x11ab('0x12')]){var _0x27fdfd=/)<[^<]*)*<\/script>/gi;while(_0x27fdfd[_0x11ab('0x13')](_0x25a57f[_0x11ab('0x12')])){_0x25a57f[_0x11ab('0x12')]=_0x25a57f['html']['replace'](_0x27fdfd,'');}if(_0x25a57f[_0x11ab('0x12')][_0x11ab('0x14')](_0x11ab('0x15'))){var _0xe4a440=[];_0x25a57f[_0x11ab('0x16')][_0x11ab('0x17')](_0x4b2650=>{_0xe4a440[_0x11ab('0x18')](_0x4b2650[_0x11ab('0x19')]);});var _0x47cad2=/]+>/g;var _0x114bdb=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3aeaee=_0x25a57f['html']['replace'](_0x114bdb,_0x11ab('0x1a'));var _0xcd5f22=_0x3aeaee[_0x11ab('0x1b')](_0x47cad2,_0x11ab('0x1c'));for(let _0xdc141e=0x0;_0xdc141e<_0xe4a440[_0x11ab('0xf')];_0xdc141e++){var _0x2c5cef=_0xcd5f22['replace'](_0x11ab('0x1c'),_0x11ab('0x1d')+_0xe4a440[_0xdc141e]+_0x11ab('0x1e'));_0xcd5f22=_0x2c5cef;}_0x25a57f[_0x11ab('0x12')]=_0xcd5f22;}_0x2c7352[_0x11ab('0x1f')]=_0x25a57f[_0x11ab('0x12')];}else{_0x2c7352[_0x11ab('0x1f')]=_0x25a57f['textAsHtml'];}if(_0x2c7352[_0x11ab('0x1f')]){_0x2c7352[_0x11ab('0x1f')]=_0x2c7352[_0x11ab('0x1f')][_0x11ab('0x1b')](/0x0){var _0x2a6409=['Auto-Submitted:\x20auto-replied',_0x11ab('0x2f'),'Precedence:\x20auto_reply'];for(var _0xd16068=0x0;_0xd16068<_0x25a57f[_0x11ab('0x2e')]['length'];_0xd16068++){var _0x307ae7=_[_0x11ab('0xb')](_0x2a6409,_0x25a57f['headerLines'][_0xd16068][_0x11ab('0x30')]);if(_0x307ae7>=0x0){_0x2c7352[_0x11ab('0x31')]=!![];}}}return _0x2c7352;}exports[_0x11ab('0x32')]=function(_0x38f585,_0x3af1b3,_0x1498db){var _0x3460b5={'from':getAddress(_0x3af1b3[_0x11ab('0x33')]),'firstName':getFirstName(_0x3af1b3[_0x11ab('0x33')]),'lastName':getLastName(_0x3af1b3['from']),'mapKey':_0x11ab('0x2'),'message':{'from':getMails(_0x38f585['email'],_0x3af1b3[_0x11ab('0x33')]),'to':_0x38f585[_0x11ab('0x2')],'cc':'','subject':_0x3af1b3[_0x11ab('0x34')]||'','messageId':_0x3af1b3[_0x11ab('0x35')],'inReplyTo':_0x3af1b3['inReplyTo'],'sentAt':moment(_0x3af1b3['date'])['format'](_0x11ab('0x36')),'attach':![],'attachments':[]}};if(!_0x3af1b3['html']&&!_0x3af1b3['textAsHtml']){var _0x1ce730=_[_0x11ab('0x37')](_0x3af1b3[_0x11ab('0x16')],{'contentType':_0x11ab('0x38')});if(_0x1ce730['length']){logger['info'](util[_0x11ab('0x28')](_0x11ab('0x39'),_0x3af1b3[_0x11ab('0x35')]));tnef['parseBuffer'](_['first'](_0x1ce730)[_0x11ab('0x2d')],function(_0x3ae1dc,_0x134837){if(_0x134837){_0x3af1b3[_0x11ab('0x12')]=_0x134837['BodyHTML']||_0x11ab('0x3a');if(_0x134837[_0x11ab('0x3b')]){for(var _0x268d0e=0x0;_0x268d0e<_0x134837['Attachments']['length'];_0x268d0e++){var _0x502c63=_0x134837[_0x11ab('0x3b')][_0x268d0e];_0x3460b5['message']['attachments'][_0x11ab('0x18')]({'filename':_0x502c63[_0x11ab('0x3c')],'content':Buffer[_0x11ab('0x33')](_0x502c63[_0x11ab('0x3d')])});}}}_0x1498db(parseEmail(_0x38f585,_0x3af1b3,_0x3460b5));});}else{_0x3af1b3[_0x11ab('0x12')]='

Empty\x20message

';_0x1498db(parseEmail(_0x38f585,_0x3af1b3,_0x3460b5));}}else{_0x1498db(parseEmail(_0x38f585,_0x3af1b3,_0x3460b5));}};exports[_0x11ab('0x3e')]=function(_0x1b1e99){switch(_0x1b1e99){case _0x11ab('0x3f'):return'imap.gmail.com';case _0x11ab('0x40'):return _0x11ab('0x41');case _0x11ab('0x42'):return _0x11ab('0x43');case _0x11ab('0x44'):return _0x11ab('0x45');}return _0x11ab('0x46');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 7105ff7..274380c 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 _0x4d66=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x57d2fe,_0x51a013){var _0x27c672=function(_0x41d426){while(--_0x41d426){_0x57d2fe['push'](_0x57d2fe['shift']());}};_0x27c672(++_0x51a013);}(_0x4d66,0x8e));var _0x64d6=function(_0x388493,_0x23301e){_0x388493=_0x388493-0x0;var _0x5300a1=_0x4d66[_0x388493];return _0x5300a1;};'use strict';var _=require(_0x64d6('0x0'));function MailAccount(_0x17a45f){this['id']=_0x17a45f['id']||0x0;this[_0x64d6('0x1')]=_0x17a45f['name']||_0x64d6('0x2');this[_0x64d6('0x3')]=_0x17a45f[_0x64d6('0x3')]||_0x64d6('0x4');this['active']=_0x17a45f[_0x64d6('0x5')]||![];this[_0x64d6('0x6')]=_0x17a45f[_0x64d6('0x6')]||[];this[_0x64d6('0x7')]=_0x17a45f[_0x64d6('0x7')]||[];}module[_0x64d6('0x8')]=MailAccount; \ No newline at end of file +var _0xcfd1=['lodash','name','Service','key','active','Imap','Smtp'];(function(_0x104b7b,_0x354ce2){var _0xaeaa36=function(_0x2185fd){while(--_0x2185fd){_0x104b7b['push'](_0x104b7b['shift']());}};_0xaeaa36(++_0x354ce2);}(_0xcfd1,0x17a));var _0x1cfd=function(_0xd6ab42,_0x4a76f8){_0xd6ab42=_0xd6ab42-0x0;var _0x445960=_0xcfd1[_0xd6ab42];return _0x445960;};'use strict';var _=require(_0x1cfd('0x0'));function MailAccount(_0x4bf417){this['id']=_0x4bf417['id']||0x0;this[_0x1cfd('0x1')]=_0x4bf417['name']||_0x1cfd('0x2');this[_0x1cfd('0x3')]=_0x4bf417[_0x1cfd('0x3')]||'SERV';this[_0x1cfd('0x4')]=_0x4bf417[_0x1cfd('0x4')]||![];this[_0x1cfd('0x5')]=_0x4bf417[_0x1cfd('0x5')]||[];this[_0x1cfd('0x6')]=_0x4bf417[_0x1cfd('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index e500da5..1b16902 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 _0x2a60=['mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','exports','lodash','../model/mailAccount'];(function(_0x1f1a2f,_0x3078e4){var _0x3c7545=function(_0x56c30e){while(--_0x56c30e){_0x1f1a2f['push'](_0x1f1a2f['shift']());}};_0x3c7545(++_0x3078e4);}(_0x2a60,0x1c0));var _0x02a6=function(_0x373a44,_0x15c3df){_0x373a44=_0x373a44-0x0;var _0x514338=_0x2a60[_0x373a44];return _0x514338;};'use strict';var _=require(_0x02a6('0x0'));var MailAccount=require(_0x02a6('0x1'));var Realtime=function(){this[_0x02a6('0x2')]={};};function freeIsNotKey(_0x960d4c,_0x25db28,_0x4bd207){var _0x312886=_[_0x02a6('0x3')](_0x960d4c,function(_0x659a70,_0x483b39){return _0x659a70[_0x4bd207];});for(var _0x287705 in _0x25db28){if(_0x25db28[_0x02a6('0x4')](_0x287705)){if(!_0x312886[_0x287705]){delete _0x25db28[_0x287705];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x365c40,_0x5c2505){for(var _0x38c4aa in _0x5c2505){if(_0x365c40['hasOwnProperty'](_0x38c4aa)){_0x365c40[_0x38c4aa]=_0x5c2505[_0x38c4aa];}}};Realtime[_0x02a6('0x5')][_0x02a6('0x6')]=function(){var _0x5aafe0=this;return function(_0x24c6c1){if(_0x24c6c1){freeIsNotKey(_0x24c6c1,_0x5aafe0['mailAccounts'],'id');for(var _0x5d8a3c=0x0,_0x25de7b={},_0x250868={};_0x5d8a3c<_0x24c6c1[_0x02a6('0x7')];_0x5d8a3c+=0x1){_0x25de7b=_0x24c6c1[_0x5d8a3c];if(_[_0x02a6('0x8')](_0x5aafe0[_0x02a6('0x2')][_0x25de7b['id']])){_0x5aafe0[_0x02a6('0x2')][_0x25de7b['id']]=new MailAccount(_0x25de7b);}else{_['merge'](_0x5aafe0['mailAccounts'][_0x25de7b['id']],_0x25de7b);}}}return _0x5aafe0[_0x02a6('0x2')];};};module[_0x02a6('0x9')]=Realtime; \ No newline at end of file +var _0xcf23=['merge','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length'];(function(_0x446f31,_0x3e3484){var _0x170363=function(_0x2ab5f0){while(--_0x2ab5f0){_0x446f31['push'](_0x446f31['shift']());}};_0x170363(++_0x3e3484);}(_0xcf23,0x17d));var _0x3cf2=function(_0x1a077d,_0x120275){_0x1a077d=_0x1a077d-0x0;var _0x5bfb0b=_0xcf23[_0x1a077d];return _0x5bfb0b;};'use strict';var _=require(_0x3cf2('0x0'));var MailAccount=require(_0x3cf2('0x1'));var Realtime=function(){this[_0x3cf2('0x2')]={};};function freeIsNotKey(_0x1863c1,_0x1ee4c5,_0x2f776d){var _0x3c098d=_[_0x3cf2('0x3')](_0x1863c1,function(_0x589a14,_0x1042c7){return _0x589a14[_0x2f776d];});for(var _0x58416d in _0x1ee4c5){if(_0x1ee4c5[_0x3cf2('0x4')](_0x58416d)){if(!_0x3c098d[_0x58416d]){delete _0x1ee4c5[_0x58416d];}}}}Realtime[_0x3cf2('0x5')][_0x3cf2('0x6')]=function(_0x3d0c30,_0xd1628){for(var _0x2d7735 in _0xd1628){if(_0x3d0c30[_0x3cf2('0x4')](_0x2d7735)){_0x3d0c30[_0x2d7735]=_0xd1628[_0x2d7735];}}};Realtime[_0x3cf2('0x5')][_0x3cf2('0x7')]=function(){var _0x22f739=this;return function(_0x2e971c){if(_0x2e971c){freeIsNotKey(_0x2e971c,_0x22f739['mailAccounts'],'id');for(var _0x3a1efc=0x0,_0x253d8a={},_0xd74dc1={};_0x3a1efc<_0x2e971c[_0x3cf2('0x8')];_0x3a1efc+=0x1){_0x253d8a=_0x2e971c[_0x3a1efc];if(_['isUndefined'](_0x22f739[_0x3cf2('0x2')][_0x253d8a['id']])){_0x22f739[_0x3cf2('0x2')][_0x253d8a['id']]=new MailAccount(_0x253d8a);}else{_[_0x3cf2('0x9')](_0x22f739['mailAccounts'][_0x253d8a['id']],_0x253d8a);}}}return _0x22f739[_0x3cf2('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index d1d3f27..4db54b3 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 _0x7fea=['MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','name','service','email','active','key','ListId'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x7fea,0x149));var _0xa7fe=function(_0x3f08c4,_0x203595){_0x3f08c4=_0x3f08c4-0x0;var _0x13549e=_0x7fea[_0x3f08c4];return _0x13549e;};'use strict';var client=require('../client');exports[_0xa7fe('0x0')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0xa7fe('0x1'),_0xa7fe('0x2'),_0xa7fe('0x3'),_0xa7fe('0x4'),_0xa7fe('0x5'),_0xa7fe('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0xa7fe('0x7'),'as':_0xa7fe('0x8')},{'model':_0xa7fe('0x9'),'as':_0xa7fe('0xa')}]},'log':_0xa7fe('0xb')});};};exports[_0xa7fe('0xc')]=function(_0x4668f0,_0x3d9135){return client['Request']('NotifyMailAccount',{'account':{'id':_0x4668f0},'body':_0x3d9135,'log':_0xa7fe('0xd')});}; \ No newline at end of file +var _0xcef7=['Request','GetMailAccount','name','service','active','key','MailServerIn','Imap','Smtp','notify','NotifyMailAccount','getMailAccounts'];(function(_0x55095e,_0x454514){var _0x3061f0=function(_0x5527fa){while(--_0x5527fa){_0x55095e['push'](_0x55095e['shift']());}};_0x3061f0(++_0x454514);}(_0xcef7,0xe3));var _0x7cef=function(_0x3e9253,_0x295f11){_0x3e9253=_0x3e9253-0x0;var _0x18b1f4=_0xcef7[_0x3e9253];return _0x18b1f4;};'use strict';var client=require('../client');exports[_0x7cef('0x0')]=function(){return function(){return client[_0x7cef('0x1')](_0x7cef('0x2'),{'options':{'attributes':['id',_0x7cef('0x3'),_0x7cef('0x4'),'email',_0x7cef('0x5'),_0x7cef('0x6'),'ListId','TemplateId'],'raw':![],'include':[{'model':_0x7cef('0x7'),'as':_0x7cef('0x8')},{'model':'MailServerOut','as':_0x7cef('0x9')}]},'log':'getMailAccount'});};};exports[_0x7cef('0xa')]=function(_0x3c1d1a,_0x5e69ae){return client['Request'](_0x7cef('0xb'),{'account':{'id':_0x3c1d1a},'body':_0x5e69ae,'log':_0x7cef('0xb')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 5379113..d19c4bd 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 _0x7985=['loginMailFrequency','GetSettings','getSettings','Request','ShowSetting'];(function(_0x213d0d,_0x4c50f5){var _0x3a94a6=function(_0x2b4c2d){while(--_0x2b4c2d){_0x213d0d['push'](_0x213d0d['shift']());}};_0x3a94a6(++_0x4c50f5);}(_0x7985,0x165));var _0x5798=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x7985[_0x95942];return _0x6d7f81;};'use strict';var client=require('../client');exports[_0x5798('0x0')]=function(){return client[_0x5798('0x1')](_0x5798('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5798('0x3')]},'log':_0x5798('0x4')});}; \ No newline at end of file +var _0x4525=['getSettings','Request','loginMailFrequency','../client'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x4525,0x107));var _0x5452=function(_0x464727,_0x290df8){_0x464727=_0x464727-0x0;var _0x4450ad=_0x4525[_0x464727];return _0x4450ad;};'use strict';var client=require(_0x5452('0x0'));exports[_0x5452('0x1')]=function(){return client[_0x5452('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5452('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d0ac20b..a895bfa 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(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 a2a93b6..c39f0ea 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 _0xacad=['defaults','adapter','socket.io-redis','../../config/triggers','default','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','createServer','listen','port','polling','redis'];(function(_0x4d471b,_0x281167){var _0x54fd9b=function(_0x4d85b0){while(--_0x4d85b0){_0x4d471b['push'](_0x4d471b['shift']());}};_0x54fd9b(++_0x281167);}(_0xacad,0x171));var _0xdaca=function(_0x31c003,_0x296906){_0x31c003=_0x31c003-0x0;var _0x54e0c7=_0xacad[_0x31c003];return _0x54e0c7;};'use strict';var _=require('lodash');var http=require(_0xdaca('0x0'));var express=require(_0xdaca('0x1'));var sticky=require(_0xdaca('0x2'));var Redis=require(_0xdaca('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xdaca('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xdaca('0x5')](server,config[_0xdaca('0x6')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xdaca('0x7')]});config[_0xdaca('0x8')]=_[_0xdaca('0x9')](config[_0xdaca('0x8')],{'host':'localhost','port':0x18eb});socketio[_0xdaca('0xa')](require(_0xdaca('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xdaca('0x8')])}));require(_0xdaca('0xc'))['default']();require('../../config/socketio')[_0xdaca('0xd')](socketio);require('../../config/express')[_0xdaca('0xd')](app);require(_0xdaca('0xe'))[_0xdaca('0xd')](app);}else{server['once']('listening',function(){console[_0xdaca('0xf')](_0xdaca('0x10'),config['port']);});}exports=module[_0xdaca('0x11')]=app; \ No newline at end of file +var _0xf01b=['express','ioredis','createServer','timeout','listen','socket.io','websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','once','log','port','exports','lodash','http'];(function(_0x2d1ca3,_0x54f4b9){var _0x41f52c=function(_0x5d5468){while(--_0x5d5468){_0x2d1ca3['push'](_0x2d1ca3['shift']());}};_0x41f52c(++_0x54f4b9);}(_0xf01b,0x140));var _0xbf01=function(_0x5a2f1f,_0x283c07){_0x5a2f1f=_0x5a2f1f-0x0;var _0xb6a70a=_0xf01b[_0x5a2f1f];return _0xb6a70a;};'use strict';var _=require(_0xbf01('0x0'));var http=require(_0xbf01('0x1'));var express=require(_0xbf01('0x2'));var sticky=require('sticky-session');var Redis=require(_0xbf01('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xbf01('0x4')](app);server[_0xbf01('0x5')]=0xdbba0;if(sticky[_0xbf01('0x6')](server,config['port'])){var socketio=require(_0xbf01('0x7'))(server,{'transports':[_0xbf01('0x8'),_0xbf01('0x9')]});config['redis']=_[_0xbf01('0xa')](config[_0xbf01('0xb')],{'host':_0xbf01('0xc'),'port':0x18eb});socketio[_0xbf01('0xd')](require(_0xbf01('0xe'))({'pubClient':new Redis(config[_0xbf01('0xb')]),'subClient':new Redis(config[_0xbf01('0xb')])}));require(_0xbf01('0xf'))[_0xbf01('0x10')]();require(_0xbf01('0x11'))[_0xbf01('0x10')](socketio);require(_0xbf01('0x12'))[_0xbf01('0x10')](app);require('../../routes')['default'](app);}else{server[_0xbf01('0x13')]('listening',function(){console[_0xbf01('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xbf01('0x15')]);});}exports=module[_0xbf01('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index cda59b9..c6563de 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 _0xd24f=['rpc','error','message','catch','exports','jayson/promise','bluebird','routing','client','http','Request','request','debug'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xd24f,0xc8));var _0xfd24=function(_0x4dade6,_0x16b01d){_0x4dade6=_0x4dade6-0x0;var _0x513270=_0xd24f[_0x4dade6];return _0x513270;};'use strict';var jayson=require(_0xfd24('0x0'));var BPromise=require(_0xfd24('0x1'));var logger=require('../../config/logger')(_0xfd24('0x2'));var client=jayson[_0xfd24('0x3')][_0xfd24('0x4')]({'port':0x2329});client[_0xfd24('0x5')]=function(_0x16993c,_0x484292){return new BPromise(function(_0x4c10fb,_0x1d678a){return client[_0xfd24('0x6')](_0x16993c,_0x484292)['then'](function(_0x5a1649){logger[_0xfd24('0x7')](_0xfd24('0x8'),_0xfd24('0x2'),_0x16993c,_0x484292,_0x5a1649);if(_0x5a1649[_0xfd24('0x9')]){logger['error'](_0xfd24('0x8'),_0xfd24('0x2'),_0x16993c,_0x5a1649[_0xfd24('0x9')]['message'],_0x484292);return _0x1d678a(_0x5a1649['error'][_0xfd24('0xa')]);}else{return _0x4c10fb(_0x5a1649['result']);}})[_0xfd24('0xb')](function(_0x4da8e1){logger[_0xfd24('0x9')](_0xfd24('0x8'),'routing',_0x16993c,_0x4da8e1,_0x484292);return _0x1d678a(_0x4da8e1);});});};module[_0xfd24('0xc')]=client; \ No newline at end of file +var _0x842d=['../../config/logger','routing','client','request','then','debug','rpc','error','message','result'];(function(_0x5d7e13,_0x3630e2){var _0x1beeaa=function(_0x3ebfc0){while(--_0x3ebfc0){_0x5d7e13['push'](_0x5d7e13['shift']());}};_0x1beeaa(++_0x3630e2);}(_0x842d,0x154));var _0xd842=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x842d[_0x5b34c0];return _0x242bd3;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xd842('0x0'))(_0xd842('0x1'));var client=jayson[_0xd842('0x2')]['http']({'port':0x2329});client['Request']=function(_0x28c82e,_0x301d97){return new BPromise(function(_0x1aba2a,_0x35895b){return client[_0xd842('0x3')](_0x28c82e,_0x301d97)[_0xd842('0x4')](function(_0x2a81ba){logger[_0xd842('0x5')](_0xd842('0x6'),_0xd842('0x1'),_0x28c82e,_0x301d97,_0x2a81ba);if(_0x2a81ba['error']){logger[_0xd842('0x7')](_0xd842('0x6'),_0xd842('0x1'),_0x28c82e,_0x2a81ba[_0xd842('0x7')][_0xd842('0x8')],_0x301d97);return _0x35895b(_0x2a81ba[_0xd842('0x7')][_0xd842('0x8')]);}else{return _0x1aba2a(_0x2a81ba[_0xd842('0x9')]);}})['catch'](function(_0x5b7d1c){logger[_0xd842('0x7')](_0xd842('0x6'),_0xd842('0x1'),_0x28c82e,_0x5b7d1c,_0x301d97);return _0x35895b(_0x5b7d1c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 1b3706b..666e17a 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 _0xd76f=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x4180c6,_0x642cf3){var _0xe0e5aa=function(_0x37f4e8){while(--_0x37f4e8){_0x4180c6['push'](_0x4180c6['shift']());}};_0xe0e5aa(++_0x642cf3);}(_0xd76f,0x66));var _0xfd76=function(_0x9105f4,_0x3bf6f7){_0x9105f4=_0x9105f4-0x0;var _0x57a818=_0xd76f[_0x9105f4];return _0x57a818;};'use strict';var BPromise=require(_0xfd76('0x0'));var server=require(_0xfd76('0x1'));var Realtime=require('./realtime');var user=require(_0xfd76('0x2'));var interval=require(_0xfd76('0x3'));var openchannelQueue=require(_0xfd76('0x4'));var chatQueue=require(_0xfd76('0x5'));var smsQueue=require(_0xfd76('0x6'));var mailQueue=require(_0xfd76('0x7'));var faxQueue=require(_0xfd76('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xfd76('0x9')]()[_0xfd76('0xa')](user[_0xfd76('0xb')]())[_0xfd76('0xa')](realtime[_0xfd76('0xc')]())[_0xfd76('0xa')](interval[_0xfd76('0xd')]())[_0xfd76('0xa')](realtime[_0xfd76('0xe')]())[_0xfd76('0xa')](openchannelQueue['getOpenchannelQueues']())[_0xfd76('0xa')](realtime[_0xfd76('0xf')]())[_0xfd76('0xa')](chatQueue[_0xfd76('0x10')]())['then'](realtime[_0xfd76('0x11')]())[_0xfd76('0xa')](smsQueue[_0xfd76('0x12')]())[_0xfd76('0xa')](realtime[_0xfd76('0x13')]())[_0xfd76('0xa')](mailQueue[_0xfd76('0x14')]())[_0xfd76('0xa')](realtime[_0xfd76('0x15')]())['then'](faxQueue[_0xfd76('0x16')]())[_0xfd76('0xa')](realtime[_0xfd76('0x17')]())[_0xfd76('0xa')](whatsappQueue['getWhatsappQueues']())[_0xfd76('0xa')](realtime[_0xfd76('0x18')]())['then'](function(){return realtime;});}function main(){return server[_0xfd76('0x19')](realtime)['then'](function(_0x91a173){return initRealtime();})[_0xfd76('0xa')](function(_0x58ef53){return setInterval(initRealtime,0x1388);})['catch'](function(_0x358335){console[_0xfd76('0x1a')](_0x358335);});}main(); \ No newline at end of file +var _0x8d78=['bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','initWhatsappQueues','listen','catch','log'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x8d78,0x7d));var _0x88d7=function(_0x35b88f,_0x3432b8){_0x35b88f=_0x35b88f-0x0;var _0x2440bb=_0x8d78[_0x35b88f];return _0x2440bb;};'use strict';var BPromise=require(_0x88d7('0x0'));var server=require(_0x88d7('0x1'));var Realtime=require('./realtime');var user=require(_0x88d7('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x88d7('0x3'));var chatQueue=require(_0x88d7('0x4'));var smsQueue=require(_0x88d7('0x5'));var mailQueue=require(_0x88d7('0x6'));var faxQueue=require(_0x88d7('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x88d7('0x8')]()['then'](user[_0x88d7('0x9')]())[_0x88d7('0xa')](realtime[_0x88d7('0xb')]())[_0x88d7('0xa')](interval[_0x88d7('0xc')]())[_0x88d7('0xa')](realtime[_0x88d7('0xd')]())[_0x88d7('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x88d7('0xa')](realtime[_0x88d7('0xe')]())[_0x88d7('0xa')](chatQueue[_0x88d7('0xf')]())[_0x88d7('0xa')](realtime[_0x88d7('0x10')]())[_0x88d7('0xa')](smsQueue[_0x88d7('0x11')]())[_0x88d7('0xa')](realtime['initSmsQueues']())[_0x88d7('0xa')](mailQueue[_0x88d7('0x12')]())['then'](realtime[_0x88d7('0x13')]())[_0x88d7('0xa')](faxQueue['getFaxQueues']())[_0x88d7('0xa')](realtime[_0x88d7('0x14')]())[_0x88d7('0xa')](whatsappQueue['getWhatsappQueues']())[_0x88d7('0xa')](realtime[_0x88d7('0x15')]())[_0x88d7('0xa')](function(){return realtime;});}function main(){return server[_0x88d7('0x16')](realtime)['then'](function(_0x35971a){return initRealtime();})[_0x88d7('0xa')](function(_0x21561f){return setInterval(initRealtime,0x1388);})[_0x88d7('0x17')](function(_0x5484ca){console[_0x88d7('0x18')](_0x5484ca);});}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 d217738..94ad880 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x91b736,_0x4b6be5){var _0x561313=function(_0x24aefe){while(--_0x24aefe){_0x91b736['push'](_0x91b736['shift']());}};_0x561313(++_0x4b6be5);}(_0x7a54,0x106));var _0x47a5=function(_0x465841,_0x41f533){_0x465841=_0x465841-0x0;var _0x397302=_0x7a54[_0x465841];return _0x397302;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x1034be,_0x4a0783){var _0x33690f=function(_0x2eef99){while(--_0x2eef99){_0x1034be['push'](_0x1034be['shift']());}};_0x33690f(++_0x4a0783);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1cc9024..e2d41f1 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 _0x6d84=['message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','request','error'];(function(_0x1a8dc6,_0x3d36cf){var _0x55cd71=function(_0x3c5268){while(--_0x3c5268){_0x1a8dc6['push'](_0x1a8dc6['shift']());}};_0x55cd71(++_0x3d36cf);}(_0x6d84,0xc3));var _0x46d8=function(_0xe43ee2,_0x52c722){_0xe43ee2=_0xe43ee2-0x0;var _0xeda6d6=_0x6d84[_0xe43ee2];return _0xeda6d6;};'use strict';var BPromise=require(_0x46d8('0x0'));var jayson=require(_0x46d8('0x1'));var client=jayson['client'][_0x46d8('0x2')]({'port':0x232b});function request(_0x4cca3b,_0x994f75){return new BPromise(function(_0x20ccbe,_0x217490){return client[_0x46d8('0x3')](_0x4cca3b,_0x994f75)['then'](function(_0x2ee067){if(_0x2ee067['error']){return _0x217490(_0x2ee067[_0x46d8('0x4')][_0x46d8('0x5')]);}else{return _0x20ccbe(_0x2ee067[_0x46d8('0x6')]);}})[_0x46d8('0x7')](function(_0x2a7e2e){return _0x217490(_0x2a7e2e);});});}exports[_0x46d8('0x8')]=function(_0x353bcd,_0x59b905){return request(_0x46d8('0x9'),{'account':_0x353bcd,'message':_0x59b905});}; \ No newline at end of file +var _0x9e57=['error','message','result','catch','sendMailMessage','jayson/promise','client','request'];(function(_0x4e20d5,_0x33ed7f){var _0x4f3b6f=function(_0x38f173){while(--_0x38f173){_0x4e20d5['push'](_0x4e20d5['shift']());}};_0x4f3b6f(++_0x33ed7f);}(_0x9e57,0x12d));var _0x79e5=function(_0x12542a,_0x220a0d){_0x12542a=_0x12542a-0x0;var _0x1cd15b=_0x9e57[_0x12542a];return _0x1cd15b;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x79e5('0x0'));var client=jayson[_0x79e5('0x1')]['http']({'port':0x232b});function request(_0x16cb2c,_0x10feaf){return new BPromise(function(_0x4540bb,_0x2e3bca){return client[_0x79e5('0x2')](_0x16cb2c,_0x10feaf)['then'](function(_0x10d7bc){if(_0x10d7bc['error']){return _0x2e3bca(_0x10d7bc[_0x79e5('0x3')][_0x79e5('0x4')]);}else{return _0x4540bb(_0x10d7bc[_0x79e5('0x5')]);}})[_0x79e5('0x6')](function(_0x4d627d){return _0x2e3bca(_0x4d627d);});});}exports[_0x79e5('0x7')]=function(_0x4c7f01,_0x5af535){return request('SendMail',{'account':_0x4c7f01,'message':_0x5af535});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index ec44a02..4dfd22a 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 _0xd876=['chatCurrentCapacity','mailCurrentCapacity','stringify','lodash','md5','ioredis','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','sms','length','Status','StatusTime'];(function(_0x57b4cf,_0x7aced5){var _0x4432e6=function(_0x376cf8){while(--_0x376cf8){_0x57b4cf['push'](_0x57b4cf['shift']());}};_0x4432e6(++_0x7aced5);}(_0xd876,0x11b));var _0x6d87=function(_0xc74747,_0x92e7bd){_0xc74747=_0xc74747-0x0;var _0x58a347=_0xd876[_0xc74747];return _0x58a347;};'use strict';var _=require(_0x6d87('0x0'));var moment=require('moment');var md5=require(_0x6d87('0x1'));var Redis=require(_0x6d87('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x6d87('0x3')](config[_0x6d87('0x4')],{'host':_0x6d87('0x5'),'port':0x18eb});var io=require(_0x6d87('0x6'))(new Redis(config[_0x6d87('0x4')]));function Agent(_0x16f8c9){this['id']=_0x16f8c9['id']||0x0;this[_0x6d87('0x7')]=_0x16f8c9[_0x6d87('0x7')]||'';this[_0x6d87('0x8')]=_0x16f8c9['online']||!![];this['voicePause']=_0x16f8c9[_0x6d87('0x9')]||![];this[_0x6d87('0xa')]=_0x16f8c9[_0x6d87('0xa')]||![];this['mailPause']=_0x16f8c9[_0x6d87('0xb')]||![];this[_0x6d87('0xc')]=_0x16f8c9[_0x6d87('0xc')]||![];this['smsPause']=_0x16f8c9[_0x6d87('0xd')]||![];this[_0x6d87('0xe')]=_0x16f8c9[_0x6d87('0xe')]||![];this[_0x6d87('0xf')]=_0x6d87('0x10');this[_0x6d87('0x11')]=0x0;this['chatCapacity']=_0x16f8c9[_0x6d87('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x6d87('0x13')]='unknown';this[_0x6d87('0x14')]=0x0;this[_0x6d87('0x15')]=_0x16f8c9[_0x6d87('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x6d87('0x10');this[_0x6d87('0x16')]=0x0;this['faxCapacity']=_0x16f8c9[_0x6d87('0x17')]||0x0;this[_0x6d87('0x18')]=0x0;this[_0x6d87('0x19')]='unknown';this[_0x6d87('0x1a')]=0x0;this[_0x6d87('0x1b')]=_0x16f8c9[_0x6d87('0x1b')]||0x0;this[_0x6d87('0x1c')]=0x0;this[_0x6d87('0x1d')]=_0x6d87('0x10');this[_0x6d87('0x1e')]=0x0;this[_0x6d87('0x1f')]=_0x16f8c9['whatsappCapacity']||0x0;this[_0x6d87('0x20')]=0x0;this[_0x6d87('0x21')]=_0x6d87('0x10');this[_0x6d87('0x22')]=0x0;this[_0x6d87('0x23')]=_0x16f8c9[_0x6d87('0x23')]||0x0;this[_0x6d87('0x24')]=0x0;this[_0x6d87('0x25')]=![];this['busyQueue']=undefined;this[_0x6d87('0x1')]='';this[_0x6d87('0x26')]();}Agent[_0x6d87('0x27')][_0x6d87('0x28')]=function(_0xc39f25){if(this[_0xc39f25+_0x6d87('0x29')]>0x0){if(this[_0xc39f25+_0x6d87('0x2a')]>0x0&&this[_0xc39f25+'CurrentCapacity']>=this[_0xc39f25+_0x6d87('0x2a')]){return _0x6d87('0x2b');}else{return _0x6d87('0x2c');}}else{return _0x6d87('0x2d');}};Agent[_0x6d87('0x27')][_0x6d87('0x26')]=function(){var _0x56abfb=[_0x6d87('0x2e'),_0x6d87('0x2f'),_0x6d87('0x30'),'fax',_0x6d87('0x31'),'whatsapp'];for(var _0x4d98d8=0x0;_0x4d98d8<_0x56abfb[_0x6d87('0x32')];_0x4d98d8+=0x1){var _0x368986=this[_0x6d87('0x28')](_0x56abfb[_0x4d98d8]);if(this[_0x56abfb[_0x4d98d8]+_0x6d87('0x33')]!==_0x368986){this[_0x56abfb[_0x4d98d8]+_0x6d87('0x34')]=_['toNumber'](moment()['format']('x'));}this[_0x56abfb[_0x4d98d8]+_0x6d87('0x33')]=_0x368986;}var _0x9bde89={'id':this['id'],'name':this['name'],'online':this[_0x6d87('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x6d87('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x6d87('0xd')],'faxPause':this[_0x6d87('0xc')],'openchannelPause':this[_0x6d87('0xe')],'chatStatus':this[_0x6d87('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x6d87('0x35')],'mailStatus':this[_0x6d87('0x13')],'mailStatusTime':this[_0x6d87('0x14')],'mailCapacity':this[_0x6d87('0x15')],'mailCurrentCapacity':this[_0x6d87('0x36')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x6d87('0x1c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x6d87('0x1f')],'whatsappCurrentCapacity':this[_0x6d87('0x20')],'openchannelStatus':this[_0x6d87('0x21')],'openchannelStatusTime':this[_0x6d87('0x22')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x672207=md5(JSON[_0x6d87('0x37')](_0x9bde89));if(this[_0x6d87('0x1')]!==_0x672207){this[_0x6d87('0x1')]=_0x672207;io['emit']('user:save',_0x9bde89);}};module['exports']=Agent; \ No newline at end of file +var _0x8d75=['mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','updateRealtime','getChannelStatus','CurrentCapacity','working','idle','mail','chat','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatPause','faxStatusTime','smsStatus','smsCurrentCapacity','whatsappCurrentCapacity','openchannelCurrentCapacity','busyQueue','stringify','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause'];(function(_0x5288ec,_0x118738){var _0x122d28=function(_0x3dccf9){while(--_0x3dccf9){_0x5288ec['push'](_0x5288ec['shift']());}};_0x122d28(++_0x118738);}(_0x8d75,0x6d));var _0x58d7=function(_0x4abf2f,_0x143879){_0x4abf2f=_0x4abf2f-0x0;var _0x2f0911=_0x8d75[_0x4abf2f];return _0x2f0911;};'use strict';var _=require(_0x58d7('0x0'));var moment=require(_0x58d7('0x1'));var md5=require(_0x58d7('0x2'));var Redis=require(_0x58d7('0x3'));var config=require(_0x58d7('0x4'));config[_0x58d7('0x5')]=_['defaults'](config['redis'],{'host':_0x58d7('0x6'),'port':0x18eb});var io=require(_0x58d7('0x7'))(new Redis(config[_0x58d7('0x5')]));function Agent(_0x403ac7){this['id']=_0x403ac7['id']||0x0;this[_0x58d7('0x8')]=_0x403ac7['name']||'';this['online']=_0x403ac7[_0x58d7('0x9')]||!![];this[_0x58d7('0xa')]=_0x403ac7[_0x58d7('0xa')]||![];this['chatPause']=_0x403ac7['chatPause']||![];this[_0x58d7('0xb')]=_0x403ac7['mailPause']||![];this[_0x58d7('0xc')]=_0x403ac7[_0x58d7('0xc')]||![];this[_0x58d7('0xd')]=_0x403ac7[_0x58d7('0xd')]||![];this[_0x58d7('0xe')]=_0x403ac7[_0x58d7('0xe')]||![];this[_0x58d7('0xf')]=_0x58d7('0x10');this[_0x58d7('0x11')]=0x0;this[_0x58d7('0x12')]=_0x403ac7[_0x58d7('0x12')]||0x0;this[_0x58d7('0x13')]=0x0;this[_0x58d7('0x14')]='unknown';this[_0x58d7('0x15')]=0x0;this[_0x58d7('0x16')]=_0x403ac7[_0x58d7('0x16')]||0x0;this[_0x58d7('0x17')]=0x0;this[_0x58d7('0x18')]=_0x58d7('0x10');this['faxStatusTime']=0x0;this[_0x58d7('0x19')]=_0x403ac7[_0x58d7('0x19')]||0x0;this[_0x58d7('0x1a')]=0x0;this['smsStatus']='unknown';this[_0x58d7('0x1b')]=0x0;this[_0x58d7('0x1c')]=_0x403ac7[_0x58d7('0x1c')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x58d7('0x1d')]=_0x58d7('0x10');this[_0x58d7('0x1e')]=0x0;this[_0x58d7('0x1f')]=_0x403ac7[_0x58d7('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x58d7('0x20')]=_0x58d7('0x10');this[_0x58d7('0x21')]=0x0;this['openchannelCapacity']=_0x403ac7[_0x58d7('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x58d7('0x23')]=![];this['busyQueue']=undefined;this[_0x58d7('0x2')]='';this[_0x58d7('0x24')]();}Agent['prototype'][_0x58d7('0x25')]=function(_0x54f90b){if(this[_0x54f90b+_0x58d7('0x26')]>0x0){if(this[_0x54f90b+'Capacity']>0x0&&this[_0x54f90b+_0x58d7('0x26')]>=this[_0x54f90b+'Capacity']){return'maxcapacity';}else{return _0x58d7('0x27');}}else{return _0x58d7('0x28');}};Agent['prototype'][_0x58d7('0x24')]=function(){var _0x41e47b=[_0x58d7('0x29'),_0x58d7('0x2a'),_0x58d7('0x2b'),'fax',_0x58d7('0x2c'),_0x58d7('0x2d')];for(var _0x31b101=0x0;_0x31b101<_0x41e47b[_0x58d7('0x2e')];_0x31b101+=0x1){var _0x34a638=this['getChannelStatus'](_0x41e47b[_0x31b101]);if(this[_0x41e47b[_0x31b101]+_0x58d7('0x2f')]!==_0x34a638){this[_0x41e47b[_0x31b101]+_0x58d7('0x30')]=_[_0x58d7('0x31')](moment()[_0x58d7('0x32')]('x'));}this[_0x41e47b[_0x31b101]+_0x58d7('0x2f')]=_0x34a638;}var _0x428a19={'id':this['id'],'name':this[_0x58d7('0x8')],'online':this[_0x58d7('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x58d7('0x33')],'mailPause':this['mailPause'],'smsPause':this[_0x58d7('0xd')],'faxPause':this[_0x58d7('0xc')],'openchannelPause':this[_0x58d7('0xe')],'chatStatus':this[_0x58d7('0xf')],'chatStatusTime':this[_0x58d7('0x11')],'chatCapacity':this[_0x58d7('0x12')],'chatCurrentCapacity':this[_0x58d7('0x13')],'mailStatus':this[_0x58d7('0x14')],'mailStatusTime':this[_0x58d7('0x15')],'mailCapacity':this[_0x58d7('0x16')],'mailCurrentCapacity':this[_0x58d7('0x17')],'faxStatus':this[_0x58d7('0x18')],'faxStatusTime':this[_0x58d7('0x34')],'faxCapacity':this[_0x58d7('0x19')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x58d7('0x35')],'smsStatusTime':this[_0x58d7('0x1b')],'smsCapacity':this[_0x58d7('0x1c')],'smsCurrentCapacity':this[_0x58d7('0x36')],'whatsappStatus':this[_0x58d7('0x1d')],'whatsappStatusTime':this[_0x58d7('0x1e')],'whatsappCapacity':this[_0x58d7('0x1f')],'whatsappCurrentCapacity':this[_0x58d7('0x37')],'openchannelStatus':this[_0x58d7('0x20')],'openchannelStatusTime':this[_0x58d7('0x21')],'openchannelCapacity':this[_0x58d7('0x22')],'openchannelCurrentCapacity':this[_0x58d7('0x38')],'busy':this[_0x58d7('0x23')],'busyQueue':this[_0x58d7('0x39')]};var _0x36d1b4=md5(JSON[_0x58d7('0x3a')](_0x428a19));if(this[_0x58d7('0x2')]!==_0x36d1b4){this[_0x58d7('0x2')]=_0x36d1b4;io['emit'](_0x58d7('0x3b'),_0x428a19);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index fbc3e5f..a0cd88c 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 _0x8d38=['length','online','paused','available','stringify','format','chat_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d38,0x13b));var _0x88d3=function(_0x4309ff,_0x4f2d83){_0x4309ff=_0x4309ff-0x0;var _0x5481aa=_0x8d38[_0x4309ff];return _0x5481aa;};'use strict';var _=require(_0x88d3('0x0'));var md5=require(_0x88d3('0x1'));var util=require('util');var Redis=require(_0x88d3('0x2'));var config=require(_0x88d3('0x3'));config[_0x88d3('0x4')]=_[_0x88d3('0x5')](config[_0x88d3('0x4')],{'host':_0x88d3('0x6'),'port':0x18eb});var io=require(_0x88d3('0x7'))(new Redis(config['redis']));function ChatQueue(_0x4d3598){this['id']=_0x4d3598['id']||0x0;this['name']=_0x4d3598[_0x88d3('0x8')]||'';this[_0x88d3('0x9')]=_0x4d3598[_0x88d3('0x9')]||0xa;this[_0x88d3('0xa')]=_0x4d3598[_0x88d3('0xa')]||_0x88d3('0xb');this['Agents']=_0x4d3598[_0x88d3('0xc')];this[_0x88d3('0xd')]={};this[_0x88d3('0xe')]=0x0;this[_0x88d3('0x1')]='';this[_0x88d3('0xf')]();this[_0x88d3('0x10')]();}ChatQueue[_0x88d3('0x11')]['updateRouting']=function(){var _0x4ec299=this['mapAgentsId'][_0x88d3('0x12')];this['mapAgentsId']=_[_0x88d3('0x13')](this[_0x88d3('0xc')],'id');this[_0x88d3('0xd')]['_rr']=_0x4ec299;};ChatQueue[_0x88d3('0x11')][_0x88d3('0x10')]=function(){this[_0x88d3('0x14')]=0x0;this['paused']=0x0;for(var _0x22c80e=0x0;_0x22c80e=0x0?this[_0x88d3('0x18')]:0x0;var _0x5d7de2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x88d3('0x14')],'name':this[_0x88d3('0x8')],'paused':this['paused'],'waiting':this[_0x88d3('0xe')]};var _0x2dd597=md5(JSON[_0x88d3('0x19')](_0x5d7de2));if(this[_0x88d3('0x1')]!==_0x2dd597){this[_0x88d3('0x1')]=_0x2dd597;io['to'](util[_0x88d3('0x1a')]('chat:queue:%s',_0x5d7de2[_0x88d3('0x8')]))['emit'](_0x88d3('0x1b'),_0x5d7de2);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x128f=['prototype','_rr','updateRealtime','paused','length','online','loggedIn','chatPause','available','stringify','chat:queue:%s','emit','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x59a81c,_0x7d1496){var _0x27286b=function(_0x21ab19){while(--_0x21ab19){_0x59a81c['push'](_0x59a81c['shift']());}};_0x27286b(++_0x7d1496);}(_0x128f,0x194));var _0xf128=function(_0x4c28d2,_0x2b8273){_0x4c28d2=_0x4c28d2-0x0;var _0x1299b8=_0x128f[_0x4c28d2];return _0x1299b8;};'use strict';var _=require('lodash');var md5=require(_0xf128('0x0'));var util=require(_0xf128('0x1'));var Redis=require(_0xf128('0x2'));var config=require(_0xf128('0x3'));config[_0xf128('0x4')]=_[_0xf128('0x5')](config['redis'],{'host':_0xf128('0x6'),'port':0x18eb});var io=require(_0xf128('0x7'))(new Redis(config[_0xf128('0x4')]));function ChatQueue(_0x1139d9){this['id']=_0x1139d9['id']||0x0;this[_0xf128('0x8')]=_0x1139d9[_0xf128('0x8')]||'';this[_0xf128('0x9')]=_0x1139d9['timeout']||0xa;this[_0xf128('0xa')]=_0x1139d9[_0xf128('0xa')]||_0xf128('0xb');this['Agents']=_0x1139d9[_0xf128('0xc')];this[_0xf128('0xd')]={};this[_0xf128('0xe')]=0x0;this[_0xf128('0x0')]='';this[_0xf128('0xf')]();this['updateRealtime']();}ChatQueue[_0xf128('0x10')]['updateRouting']=function(){var _0x121094=this['mapAgentsId'][_0xf128('0x11')];this[_0xf128('0xd')]=_['map'](this[_0xf128('0xc')],'id');this[_0xf128('0xd')][_0xf128('0x11')]=_0x121094;};ChatQueue[_0xf128('0x10')][_0xf128('0x12')]=function(){this['loggedIn']=0x0;this[_0xf128('0x13')]=0x0;for(var _0x2428ad=0x0;_0x2428ad=0x0?this[_0xf128('0x18')]:0x0;var _0x227a6a={'id':this['id'],'available':this[_0xf128('0x18')],'loggedIn':this[_0xf128('0x16')],'name':this[_0xf128('0x8')],'paused':this[_0xf128('0x13')],'waiting':this[_0xf128('0xe')]};var _0x242e86=md5(JSON[_0xf128('0x19')](_0x227a6a));if(this['md5']!==_0x242e86){this[_0xf128('0x0')]=_0x242e86;io['to'](util['format'](_0xf128('0x1a'),_0x227a6a[_0xf128('0x8')]))[_0xf128('0x1b')]('chat_queue:save',_0x227a6a);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 9995196..3c374c5 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 _0x0e3c=['name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','faxPause','paused','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','ioredis','redis','defaults'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x0e3c,0xcb));var _0xc0e3=function(_0x8e20ca,_0x3a24b7){_0x8e20ca=_0x8e20ca-0x0;var _0x3f8b4b=_0x0e3c[_0x8e20ca];return _0x3f8b4b;};'use strict';var _=require(_0xc0e3('0x0'));var md5=require(_0xc0e3('0x1'));var util=require('util');var Redis=require(_0xc0e3('0x2'));var config=require('../../../config/environment');config[_0xc0e3('0x3')]=_[_0xc0e3('0x4')](config[_0xc0e3('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x110d88){this['id']=_0x110d88['id']||0x0;this[_0xc0e3('0x5')]=_0x110d88[_0xc0e3('0x5')]||'';this[_0xc0e3('0x6')]=_0x110d88[_0xc0e3('0x6')]||0xa;this[_0xc0e3('0x7')]=_0x110d88['strategy']||'beepall';this['Agents']=_0x110d88[_0xc0e3('0x8')];this[_0xc0e3('0x9')]={};this[_0xc0e3('0xa')]=0x0;this[_0xc0e3('0x1')]='';this[_0xc0e3('0xb')]();this[_0xc0e3('0xc')]();}FaxQueue[_0xc0e3('0xd')][_0xc0e3('0xb')]=function(){var _0x36de37=this[_0xc0e3('0x9')][_0xc0e3('0xe')];this['mapAgentsId']=_[_0xc0e3('0xf')](this['Agents'],'id');this['mapAgentsId'][_0xc0e3('0xe')]=_0x36de37;};FaxQueue[_0xc0e3('0xd')]['updateRealtime']=function(){this[_0xc0e3('0x10')]=0x0;this['paused']=0x0;for(var _0x1c4579=0x0;_0x1c4579=0x0?this[_0xc0e3('0x14')]:0x0;var _0x131e45={'id':this['id'],'available':this[_0xc0e3('0x14')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xc0e3('0x13')],'waiting':this['waiting']};var _0x3365f0=md5(JSON[_0xc0e3('0x15')](_0x131e45));if(this[_0xc0e3('0x1')]!==_0x3365f0){this[_0xc0e3('0x1')]=_0x3365f0;io['to'](util[_0xc0e3('0x16')](_0xc0e3('0x17'),_0x131e45['name']))['emit'](_0xc0e3('0x18'),_0x131e45);}};module[_0xc0e3('0x19')]=FaxQueue; \ No newline at end of file +var _0x06a6=['strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x44a8cf,_0x383da8){var _0x5e7e33=function(_0xda1e8d){while(--_0xda1e8d){_0x44a8cf['push'](_0x44a8cf['shift']());}};_0x5e7e33(++_0x383da8);}(_0x06a6,0xd8));var _0x606a=function(_0x14f389,_0x4224ca){_0x14f389=_0x14f389-0x0;var _0x15fce5=_0x06a6[_0x14f389];return _0x15fce5;};'use strict';var _=require('lodash');var md5=require(_0x606a('0x0'));var util=require('util');var Redis=require(_0x606a('0x1'));var config=require('../../../config/environment');config['redis']=_[_0x606a('0x2')](config[_0x606a('0x3')],{'host':_0x606a('0x4'),'port':0x18eb});var io=require(_0x606a('0x5'))(new Redis(config['redis']));function FaxQueue(_0x38aff3){this['id']=_0x38aff3['id']||0x0;this[_0x606a('0x6')]=_0x38aff3[_0x606a('0x6')]||'';this[_0x606a('0x7')]=_0x38aff3['timeout']||0xa;this[_0x606a('0x8')]=_0x38aff3[_0x606a('0x8')]||_0x606a('0x9');this[_0x606a('0xa')]=_0x38aff3[_0x606a('0xa')];this['mapAgentsId']={};this[_0x606a('0xb')]=0x0;this[_0x606a('0x0')]='';this[_0x606a('0xc')]();this[_0x606a('0xd')]();}FaxQueue[_0x606a('0xe')][_0x606a('0xc')]=function(){var _0x43a035=this[_0x606a('0xf')][_0x606a('0x10')];this[_0x606a('0xf')]=_['map'](this[_0x606a('0xa')],'id');this['mapAgentsId'][_0x606a('0x10')]=_0x43a035;};FaxQueue[_0x606a('0xe')][_0x606a('0xd')]=function(){this[_0x606a('0x11')]=0x0;this[_0x606a('0x12')]=0x0;for(var _0x18d251=0x0;_0x18d251=0x0?this[_0x606a('0x15')]:0x0;var _0x372332={'id':this['id'],'available':this[_0x606a('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x606a('0x12')],'waiting':this[_0x606a('0xb')]};var _0x3f458d=md5(JSON[_0x606a('0x16')](_0x372332));if(this[_0x606a('0x0')]!==_0x3f458d){this[_0x606a('0x0')]=_0x3f458d;io['to'](util[_0x606a('0x17')](_0x606a('0x18'),_0x372332[_0x606a('0x6')]))[_0x606a('0x19')](_0x606a('0x1a'),_0x372332);}};module[_0x606a('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index bbedcd1..0f7a9b5 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 _0x5e7f=['name','Intervals','exports'];(function(_0x2581bd,_0x39a600){var _0x252e7e=function(_0x5df12e){while(--_0x5df12e){_0x2581bd['push'](_0x2581bd['shift']());}};_0x252e7e(++_0x39a600);}(_0x5e7f,0xc9));var _0xf5e7=function(_0x2e7e1f,_0x32661e){_0x2e7e1f=_0x2e7e1f-0x0;var _0xac761=_0x5e7f[_0x2e7e1f];return _0xac761;};'use strict';function Interval(_0x57fe37){this['id']=_0x57fe37['id']||0x0;this[_0xf5e7('0x0')]=_0x57fe37['name']||'';this[_0xf5e7('0x1')]=_0x57fe37['Intervals']||{};}module[_0xf5e7('0x2')]=Interval; \ No newline at end of file +var _0x21e5=['exports','name','Intervals'];(function(_0x32fc4c,_0x33e9de){var _0x24de9a=function(_0x29648e){while(--_0x29648e){_0x32fc4c['push'](_0x32fc4c['shift']());}};_0x24de9a(++_0x33e9de);}(_0x21e5,0x169));var _0x521e=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x21e5[_0x31e5cb];return _0x4170df;};'use strict';function Interval(_0x58d8e1){this['id']=_0x58d8e1['id']||0x0;this[_0x521e('0x0')]=_0x58d8e1[_0x521e('0x0')]||'';this[_0x521e('0x1')]=_0x58d8e1[_0x521e('0x1')]||{};}module[_0x521e('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 48c6cff..dac77ef 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 _0xb7ac=['length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused'];(function(_0xd36133,_0x38eb94){var _0x439f9a=function(_0x2ab31e){while(--_0x2ab31e){_0xd36133['push'](_0xd36133['shift']());}};_0x439f9a(++_0x38eb94);}(_0xb7ac,0x1cc));var _0xcb7a=function(_0x3eeea3,_0x1e3bdd){_0x3eeea3=_0x3eeea3-0x0;var _0x44c17=_0xb7ac[_0x3eeea3];return _0x44c17;};'use strict';var _=require('lodash');var md5=require(_0xcb7a('0x0'));var util=require(_0xcb7a('0x1'));var Redis=require(_0xcb7a('0x2'));var config=require(_0xcb7a('0x3'));config[_0xcb7a('0x4')]=_[_0xcb7a('0x5')](config['redis'],{'host':_0xcb7a('0x6'),'port':0x18eb});var io=require(_0xcb7a('0x7'))(new Redis(config[_0xcb7a('0x4')]));function MailQueue(_0x3c1edf){this['id']=_0x3c1edf['id']||0x0;this[_0xcb7a('0x8')]=_0x3c1edf[_0xcb7a('0x8')]||'';this[_0xcb7a('0x9')]=_0x3c1edf['timeout']||0xa;this['strategy']=_0x3c1edf[_0xcb7a('0xa')]||'beepall';this[_0xcb7a('0xb')]=_0x3c1edf['Agents'];this[_0xcb7a('0xc')]={};this[_0xcb7a('0xd')]=0x0;this['md5']='';this[_0xcb7a('0xe')]();this[_0xcb7a('0xf')]();}MailQueue[_0xcb7a('0x10')][_0xcb7a('0xe')]=function(){var _0x203acd=this[_0xcb7a('0xc')][_0xcb7a('0x11')];this[_0xcb7a('0xc')]=_['map'](this[_0xcb7a('0xb')],'id');this[_0xcb7a('0xc')][_0xcb7a('0x11')]=_0x203acd;};MailQueue[_0xcb7a('0x10')][_0xcb7a('0xf')]=function(){this[_0xcb7a('0x12')]=0x0;this[_0xcb7a('0x13')]=0x0;for(var _0x395dcf=0x0;_0x395dcf=0x0?this[_0xcb7a('0x17')]:0x0;var _0x4a2b91={'id':this['id'],'available':this['available'],'loggedIn':this[_0xcb7a('0x12')],'name':this[_0xcb7a('0x8')],'paused':this[_0xcb7a('0x13')],'waiting':this[_0xcb7a('0xd')]};var _0x63c7ce=md5(JSON[_0xcb7a('0x18')](_0x4a2b91));if(this['md5']!==_0x63c7ce){this[_0xcb7a('0x0')]=_0x63c7ce;io['to'](util[_0xcb7a('0x19')](_0xcb7a('0x1a'),_0x4a2b91[_0xcb7a('0x8')]))[_0xcb7a('0x1b')](_0xcb7a('0x1c'),_0x4a2b91);}};module[_0xcb7a('0x1d')]=MailQueue; \ No newline at end of file +var _0x7dcb=['length','mailPause','available','loggedIn','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','ioredis','../../../config/environment','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused'];(function(_0x63e939,_0x2d88aa){var _0x2aa1e5=function(_0x18b047){while(--_0x18b047){_0x63e939['push'](_0x63e939['shift']());}};_0x2aa1e5(++_0x2d88aa);}(_0x7dcb,0x182));var _0xb7dc=function(_0x3c6678,_0xf7d827){_0x3c6678=_0x3c6678-0x0;var _0x2c6493=_0x7dcb[_0x3c6678];return _0x2c6493;};'use strict';var _=require(_0xb7dc('0x0'));var md5=require(_0xb7dc('0x1'));var util=require('util');var Redis=require(_0xb7dc('0x2'));var config=require(_0xb7dc('0x3'));config['redis']=_[_0xb7dc('0x4')](config['redis'],{'host':_0xb7dc('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x3fdb9b){this['id']=_0x3fdb9b['id']||0x0;this[_0xb7dc('0x6')]=_0x3fdb9b[_0xb7dc('0x6')]||'';this['timeout']=_0x3fdb9b[_0xb7dc('0x7')]||0xa;this['strategy']=_0x3fdb9b[_0xb7dc('0x8')]||_0xb7dc('0x9');this[_0xb7dc('0xa')]=_0x3fdb9b['Agents'];this[_0xb7dc('0xb')]={};this[_0xb7dc('0xc')]=0x0;this[_0xb7dc('0x1')]='';this['updateRouting']();this[_0xb7dc('0xd')]();}MailQueue[_0xb7dc('0xe')][_0xb7dc('0xf')]=function(){var _0x336823=this['mapAgentsId'][_0xb7dc('0x10')];this[_0xb7dc('0xb')]=_[_0xb7dc('0x11')](this[_0xb7dc('0xa')],'id');this[_0xb7dc('0xb')][_0xb7dc('0x10')]=_0x336823;};MailQueue[_0xb7dc('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xb7dc('0x12')]=0x0;for(var _0xaed86=0x0;_0xaed86=0x0?this[_0xb7dc('0x15')]:0x0;var _0x33165a={'id':this['id'],'available':this[_0xb7dc('0x15')],'loggedIn':this[_0xb7dc('0x16')],'name':this[_0xb7dc('0x6')],'paused':this[_0xb7dc('0x12')],'waiting':this[_0xb7dc('0xc')]};var _0x5c4a54=md5(JSON['stringify'](_0x33165a));if(this[_0xb7dc('0x1')]!==_0x5c4a54){this[_0xb7dc('0x1')]=_0x5c4a54;io['to'](util[_0xb7dc('0x17')](_0xb7dc('0x18'),_0x33165a['name']))[_0xb7dc('0x19')](_0xb7dc('0x1a'),_0x33165a);}};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 f6dc39c..8821f73 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 _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x1261,0x144));var _0x1126=function(_0x305117,_0x289f1a){_0x305117=_0x305117-0x0;var _0x184cb7=_0x1261[_0x305117];return _0x184cb7;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 9124ad2..aeaa85a 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 _0x1159=['loggedIn','paused','smsPause','available','waiting','stringify','md5','format','sms:queue:%s','sms_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','map','_rr','updateRealtime'];(function(_0x17bcfb,_0xeb1dbd){var _0x1650e5=function(_0x1ccfaa){while(--_0x1ccfaa){_0x17bcfb['push'](_0x17bcfb['shift']());}};_0x1650e5(++_0xeb1dbd);}(_0x1159,0xf3));var _0x9115=function(_0x5d1fb4,_0x2a4f51){_0x5d1fb4=_0x5d1fb4-0x0;var _0x2d2f54=_0x1159[_0x5d1fb4];return _0x2d2f54;};'use strict';var _=require(_0x9115('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x9115('0x1'));var config=require(_0x9115('0x2'));config[_0x9115('0x3')]=_[_0x9115('0x4')](config[_0x9115('0x3')],{'host':_0x9115('0x5'),'port':0x18eb});var io=require(_0x9115('0x6'))(new Redis(config[_0x9115('0x3')]));function SmsQueue(_0x579e72){this['id']=_0x579e72['id']||0x0;this[_0x9115('0x7')]=_0x579e72[_0x9115('0x7')]||'';this[_0x9115('0x8')]=_0x579e72[_0x9115('0x8')]||0xa;this[_0x9115('0x9')]=_0x579e72[_0x9115('0x9')]||_0x9115('0xa');this['Agents']=_0x579e72[_0x9115('0xb')];this[_0x9115('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x9115('0xd')]();this['updateRealtime']();}SmsQueue[_0x9115('0xe')][_0x9115('0xd')]=function(){var _0x35f3fe=this[_0x9115('0xc')]['_rr'];this[_0x9115('0xc')]=_[_0x9115('0xf')](this[_0x9115('0xb')],'id');this[_0x9115('0xc')][_0x9115('0x10')]=_0x35f3fe;};SmsQueue[_0x9115('0xe')][_0x9115('0x11')]=function(){this[_0x9115('0x12')]=0x0;this[_0x9115('0x13')]=0x0;for(var _0x4b5d27=0x0;_0x4b5d27=0x0?this[_0x9115('0x15')]:0x0;var _0x157ad2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9115('0x12')],'name':this[_0x9115('0x7')],'paused':this[_0x9115('0x13')],'waiting':this[_0x9115('0x16')]};var _0x95ed4b=md5(JSON[_0x9115('0x17')](_0x157ad2));if(this[_0x9115('0x18')]!==_0x95ed4b){this[_0x9115('0x18')]=_0x95ed4b;io['to'](util[_0x9115('0x19')](_0x9115('0x1a'),_0x157ad2[_0x9115('0x7')]))['emit'](_0x9115('0x1b'),_0x157ad2);}};module[_0x9115('0x1c')]=SmsQueue; \ No newline at end of file +var _0xeb5d=['waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','available','stringify','format','emit','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeb5d[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var md5=require(_0xdeb5('0x0'));var util=require(_0xdeb5('0x1'));var Redis=require(_0xdeb5('0x2'));var config=require(_0xdeb5('0x3'));config['redis']=_['defaults'](config[_0xdeb5('0x4')],{'host':_0xdeb5('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdeb5('0x4')]));function SmsQueue(_0x255dd0){this['id']=_0x255dd0['id']||0x0;this[_0xdeb5('0x6')]=_0x255dd0[_0xdeb5('0x6')]||'';this[_0xdeb5('0x7')]=_0x255dd0[_0xdeb5('0x7')]||0xa;this[_0xdeb5('0x8')]=_0x255dd0[_0xdeb5('0x8')]||_0xdeb5('0x9');this[_0xdeb5('0xa')]=_0x255dd0[_0xdeb5('0xa')];this[_0xdeb5('0xb')]={};this[_0xdeb5('0xc')]=0x0;this[_0xdeb5('0x0')]='';this[_0xdeb5('0xd')]();this[_0xdeb5('0xe')]();}SmsQueue[_0xdeb5('0xf')]['updateRouting']=function(){var _0x2ec04f=this[_0xdeb5('0xb')][_0xdeb5('0x10')];this[_0xdeb5('0xb')]=_[_0xdeb5('0x11')](this[_0xdeb5('0xa')],'id');this[_0xdeb5('0xb')][_0xdeb5('0x10')]=_0x2ec04f;};SmsQueue['prototype'][_0xdeb5('0xe')]=function(){this['loggedIn']=0x0;this[_0xdeb5('0x12')]=0x0;for(var _0x11d83a=0x0;_0x11d83a=0x0?this['available']:0x0;var _0x1679ee={'id':this['id'],'available':this[_0xdeb5('0x15')],'loggedIn':this[_0xdeb5('0x14')],'name':this['name'],'paused':this[_0xdeb5('0x12')],'waiting':this['waiting']};var _0x20ac22=md5(JSON[_0xdeb5('0x16')](_0x1679ee));if(this[_0xdeb5('0x0')]!==_0x20ac22){this[_0xdeb5('0x0')]=_0x20ac22;io['to'](util[_0xdeb5('0x17')]('sms:queue:%s',_0x1679ee[_0xdeb5('0x6')]))[_0xdeb5('0x18')]('sms_queue:save',_0x1679ee);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 2e935be..46073ae 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 _0x859e=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','stringify','format','emit','whatsapp_queue:save','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x859e,0x98));var _0xe859=function(_0x35d0bc,_0x4ffa16){_0x35d0bc=_0x35d0bc-0x0;var _0x32de9c=_0x859e[_0x35d0bc];return _0x32de9c;};'use strict';var _=require(_0xe859('0x0'));var md5=require(_0xe859('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xe859('0x2'));config[_0xe859('0x3')]=_[_0xe859('0x4')](config['redis'],{'host':_0xe859('0x5'),'port':0x18eb});var io=require(_0xe859('0x6'))(new Redis(config[_0xe859('0x3')]));function WhatsappQueue(_0x4d7792){this['id']=_0x4d7792['id']||0x0;this['name']=_0x4d7792[_0xe859('0x7')]||'';this[_0xe859('0x8')]=_0x4d7792[_0xe859('0x8')]||0xa;this[_0xe859('0x9')]=_0x4d7792[_0xe859('0x9')]||_0xe859('0xa');this[_0xe859('0xb')]=_0x4d7792['Agents'];this[_0xe859('0xc')]={};this[_0xe859('0xd')]=0x0;this[_0xe859('0x1')]='';this[_0xe859('0xe')]();this[_0xe859('0xf')]();}WhatsappQueue[_0xe859('0x10')][_0xe859('0xe')]=function(){var _0xf1a385=this[_0xe859('0xc')][_0xe859('0x11')];this[_0xe859('0xc')]=_[_0xe859('0x12')](this['Agents'],'id');this[_0xe859('0xc')][_0xe859('0x11')]=_0xf1a385;};WhatsappQueue[_0xe859('0x10')][_0xe859('0xf')]=function(){this[_0xe859('0x13')]=0x0;this[_0xe859('0x14')]=0x0;for(var _0xf58364=0x0;_0xf58364=0x0?this[_0xe859('0x16')]:0x0;var _0x4d7e11={'id':this['id'],'available':this[_0xe859('0x16')],'loggedIn':this[_0xe859('0x13')],'name':this[_0xe859('0x7')],'paused':this['paused'],'waiting':this[_0xe859('0xd')]};var _0x35bd76=md5(JSON[_0xe859('0x17')](_0x4d7e11));if(this[_0xe859('0x1')]!==_0x35bd76){this[_0xe859('0x1')]=_0x35bd76;io['to'](util[_0xe859('0x18')]('whatsapp:queue:%s',_0x4d7e11[_0xe859('0x7')]))[_0xe859('0x19')](_0xe859('0x1a'),_0x4d7e11);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xba5a=['paused','length','online','available','stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','loggedIn'];(function(_0x4d804f,_0x36f525){var _0x443b54=function(_0x3581d7){while(--_0x3581d7){_0x4d804f['push'](_0x4d804f['shift']());}};_0x443b54(++_0x36f525);}(_0xba5a,0x1b7));var _0xaba5=function(_0x41cc3f,_0x2678a2){_0x41cc3f=_0x41cc3f-0x0;var _0x47ff58=_0xba5a[_0x41cc3f];return _0x47ff58;};'use strict';var _=require(_0xaba5('0x0'));var md5=require(_0xaba5('0x1'));var util=require(_0xaba5('0x2'));var Redis=require(_0xaba5('0x3'));var config=require(_0xaba5('0x4'));config[_0xaba5('0x5')]=_['defaults'](config[_0xaba5('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0xa1b381){this['id']=_0xa1b381['id']||0x0;this[_0xaba5('0x6')]=_0xa1b381[_0xaba5('0x6')]||'';this[_0xaba5('0x7')]=_0xa1b381[_0xaba5('0x7')]||0xa;this[_0xaba5('0x8')]=_0xa1b381['strategy']||_0xaba5('0x9');this[_0xaba5('0xa')]=_0xa1b381[_0xaba5('0xa')];this[_0xaba5('0xb')]={};this[_0xaba5('0xc')]=0x0;this[_0xaba5('0x1')]='';this['updateRouting']();this[_0xaba5('0xd')]();}WhatsappQueue[_0xaba5('0xe')]['updateRouting']=function(){var _0x382051=this[_0xaba5('0xb')][_0xaba5('0xf')];this[_0xaba5('0xb')]=_['map'](this[_0xaba5('0xa')],'id');this[_0xaba5('0xb')][_0xaba5('0xf')]=_0x382051;};WhatsappQueue[_0xaba5('0xe')]['updateRealtime']=function(){this[_0xaba5('0x10')]=0x0;this[_0xaba5('0x11')]=0x0;for(var _0xd3d01e=0x0;_0xd3d01e=0x0?this[_0xaba5('0x14')]:0x0;var _0x1dee91={'id':this['id'],'available':this[_0xaba5('0x14')],'loggedIn':this[_0xaba5('0x10')],'name':this[_0xaba5('0x6')],'paused':this[_0xaba5('0x11')],'waiting':this[_0xaba5('0xc')]};var _0x5943c1=md5(JSON[_0xaba5('0x15')](_0x1dee91));if(this[_0xaba5('0x1')]!==_0x5943c1){this['md5']=_0x5943c1;io['to'](util['format']('whatsapp:queue:%s',_0x1dee91[_0xaba5('0x6')]))[_0xaba5('0x16')]('whatsapp_queue:save',_0x1dee91);}};module[_0xaba5('0x17')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 3be1ee6..ebf6919 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(_0x28307e,_0x531964){var _0x15cea5=function(_0x27557a){while(--_0x27557a){_0x28307e['push'](_0x28307e['shift']());}};_0x15cea5(++_0x531964);}(_0xb10b,0x12a));var _0xbb10=function(_0x4336a6,_0xc235ca){_0x4336a6=_0x4336a6-0x0;var _0x4012f3=_0xb10b[_0x4336a6];return _0x4012f3;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 8b17b9f..b6ce2f0 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 _0xad2d=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x77d7a8,_0x585abd){var _0x403ad8=function(_0x993035){while(--_0x993035){_0x77d7a8['push'](_0x77d7a8['shift']());}};_0x403ad8(++_0x585abd);}(_0xad2d,0x1e1));var _0xdad2=function(_0x39e4fa,_0x3e1738){_0x39e4fa=_0x39e4fa-0x0;var _0x15e617=_0xad2d[_0x39e4fa];return _0x15e617;};'use strict';var client=require('../client');exports[_0xdad2('0x0')]=function(_0x2edb81,_0x501137){return client[_0xdad2('0x1')](_0xdad2('0x2'),{'body':_0x501137,'options':{'where':{'id':_0x2edb81}},'log':_0xdad2('0x3')});};exports[_0xdad2('0x4')]=function(_0x683edb,_0x5b5913){return client[_0xdad2('0x1')](_0xdad2('0x5'),{'body':_0x5b5913,'options':{'where':{'id':_0x683edb}},'log':_0xdad2('0x6')});}; \ No newline at end of file +var _0xcca6=['Request','updateChatInteraction','addTags','../client','update'];(function(_0x6a912b,_0xef43c3){var _0x226f7c=function(_0x2d20ea){while(--_0x2d20ea){_0x6a912b['push'](_0x6a912b['shift']());}};_0x226f7c(++_0xef43c3);}(_0xcca6,0xdf));var _0x6cca=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0xcca6[_0x56740a];return _0x257144;};'use strict';var client=require(_0x6cca('0x0'));exports[_0x6cca('0x1')]=function(_0x3bfca5,_0x580817){return client[_0x6cca('0x2')]('UpdateChatInteraction',{'body':_0x580817,'options':{'where':{'id':_0x3bfca5}},'log':_0x6cca('0x3')});};exports[_0x6cca('0x4')]=function(_0x360956,_0x299976){return client[_0x6cca('0x2')]('AddTagsToChatInteraction',{'body':_0x299976,'options':{'where':{'id':_0x360956}},'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 9023bdd..bd20e5c 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 _0x22f6=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x29e871,_0x5069de){var _0x4dd8d0=function(_0x617123){while(--_0x617123){_0x29e871['push'](_0x29e871['shift']());}};_0x4dd8d0(++_0x5069de);}(_0x22f6,0x7b));var _0x622f=function(_0x5170ae,_0x5ed5ac){_0x5170ae=_0x5170ae-0x0;var _0x7181a6=_0x22f6[_0x5170ae];return _0x7181a6;};'use strict';var client=require(_0x622f('0x0'));exports[_0x622f('0x1')]=function(_0x5388a4){return client[_0x622f('0x2')](_0x622f('0x3'),{'body':_0x5388a4,'log':_0x622f('0x4')});}; \ No newline at end of file +var _0x1c6e=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x1c6e,0x1a1));var _0xe1c6=function(_0x2f32c4,_0x531dc6){_0x2f32c4=_0x2f32c4-0x0;var _0x3f3018=_0x1c6e[_0x2f32c4];return _0x3f3018;};'use strict';var client=require(_0xe1c6('0x0'));exports[_0xe1c6('0x1')]=function(_0x25f9d9){return client[_0xe1c6('0x2')](_0xe1c6('0x3'),{'body':_0x25f9d9,'log':_0xe1c6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 1705dd4..419c5d9 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 _0xbf07=['../client','getChatQueues','Request','GetChatQueue','timeout','strategy','online'];(function(_0xeb1c85,_0x50e5d3){var _0x1727a0=function(_0x4d6a50){while(--_0x4d6a50){_0xeb1c85['push'](_0xeb1c85['shift']());}};_0x1727a0(++_0x50e5d3);}(_0xbf07,0x77));var _0x7bf0=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0xbf07[_0x35007a];return _0x574f68;};'use strict';var client=require(_0x7bf0('0x0'));exports[_0x7bf0('0x1')]=function(){return function(){return client[_0x7bf0('0x2')](_0x7bf0('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7bf0('0x4'),_0x7bf0('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x7bf0('0x6'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xb673=['name','timeout','User','Agents','chatPause','../client','getChatQueues','GetChatQueue'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0xb673,0xa5));var _0x3b67=function(_0x3c650e,_0x28ffbb){_0x3c650e=_0x3c650e-0x0;var _0x218481=_0xb673[_0x3c650e];return _0x218481;};'use strict';var client=require(_0x3b67('0x0'));exports[_0x3b67('0x1')]=function(){return function(){return client['Request'](_0x3b67('0x2'),{'options':{'raw':![],'attributes':['id',_0x3b67('0x3'),_0x3b67('0x4'),'strategy'],'include':[{'model':_0x3b67('0x5'),'as':_0x3b67('0x6'),'attributes':['id',_0x3b67('0x3'),'online',_0x3b67('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 899e11a..0c1890d 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 _0x45c8=['Request','CreateChatQueueReport','UpdateChatQueueReport','DESC','../client'];(function(_0x3f9eb2,_0x476b1f){var _0x68f396=function(_0x1b7cc6){while(--_0x1b7cc6){_0x3f9eb2['push'](_0x3f9eb2['shift']());}};_0x68f396(++_0x476b1f);}(_0x45c8,0xef));var _0x845c=function(_0x166a6d,_0x3c61d1){_0x166a6d=_0x166a6d-0x0;var _0x38227c=_0x45c8[_0x166a6d];return _0x38227c;};'use strict';var client=require(_0x845c('0x0'));exports['create']=function(_0xc21dff){return client[_0x845c('0x1')](_0x845c('0x2'),{'body':_0xc21dff,'log':_0x845c('0x2')});};exports['update']=function(_0x4ecb22,_0x4d43f8){return client['Request'](_0x845c('0x3'),{'body':_0x4d43f8,'options':{'where':{'uniqueid':_0x4ecb22},'order':[['id',_0x845c('0x4')]],'limit':0x1},'log':_0x845c('0x3')});}; \ No newline at end of file +var _0x7eb9=['update','UpdateChatQueueReport','../client','Request','CreateChatQueueReport'];(function(_0x3d786a,_0x17ef07){var _0x5074a6=function(_0x6c245a){while(--_0x6c245a){_0x3d786a['push'](_0x3d786a['shift']());}};_0x5074a6(++_0x17ef07);}(_0x7eb9,0xd9));var _0x97eb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7eb9[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x97eb('0x0'));exports['create']=function(_0x4d9b00){return client[_0x97eb('0x1')]('CreateChatQueueReport',{'body':_0x4d9b00,'log':_0x97eb('0x2')});};exports[_0x97eb('0x3')]=function(_0x67960,_0x130bf4){return client['Request'](_0x97eb('0x4'),{'body':_0x130bf4,'options':{'where':{'uniqueid':_0x67960},'order':[['id','DESC']],'limit':0x1},'log':_0x97eb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 8c6266d..970be2e 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(_0x2f6074,_0xc985c6){var _0x174bd7=function(_0x2aec0a){while(--_0x2aec0a){_0x2f6074['push'](_0x2f6074['shift']());}};_0x174bd7(++_0xc985c6);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0x7a54,0x106));var _0x47a5=function(_0xaee96f,_0x16c57a){_0xaee96f=_0xaee96f-0x0;var _0x4e1662=_0x7a54[_0xaee96f];return _0x4e1662;};'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 c026d80..7adbfc3 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 _0xa617=['Request','createFaxMessage','../client','create'];(function(_0x283aa5,_0x43113a){var _0x343e70=function(_0x98af2){while(--_0x98af2){_0x283aa5['push'](_0x283aa5['shift']());}};_0x343e70(++_0x43113a);}(_0xa617,0x1d6));var _0x7a61=function(_0x886420,_0x264952){_0x886420=_0x886420-0x0;var _0x4ee37e=_0xa617[_0x886420];return _0x4ee37e;};'use strict';var client=require(_0x7a61('0x0'));exports[_0x7a61('0x1')]=function(_0x351a1e){return client[_0x7a61('0x2')]('CreateFaxMessage',{'body':_0x351a1e,'log':_0x7a61('0x3')});}; \ No newline at end of file +var _0x628f=['createFaxMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x628f,0x1c5));var _0xf628=function(_0x4e29e5,_0x5ce388){_0x4e29e5=_0x4e29e5-0x0;var _0x312749=_0x628f[_0x4e29e5];return _0x312749;};'use strict';var client=require('../client');exports[_0xf628('0x0')]=function(_0x373b95){return client['Request']('CreateFaxMessage',{'body':_0x373b95,'log':_0xf628('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 260e963..9cac0d0 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 _0x3c75=['online','faxPause','../client','getFaxQueues','name','Agents'];(function(_0x349b5c,_0x55e5fa){var _0x3efcac=function(_0x27832d){while(--_0x27832d){_0x349b5c['push'](_0x349b5c['shift']());}};_0x3efcac(++_0x55e5fa);}(_0x3c75,0x1dc));var _0x53c7=function(_0x286cc9,_0x4b80d6){_0x286cc9=_0x286cc9-0x0;var _0x59dbae=_0x3c75[_0x286cc9];return _0x59dbae;};'use strict';var client=require(_0x53c7('0x0'));exports[_0x53c7('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x53c7('0x2'),'timeout','strategy'],'include':[{'model':'User','as':_0x53c7('0x3'),'attributes':['id',_0x53c7('0x2'),_0x53c7('0x4'),_0x53c7('0x5')]}]},'log':_0x53c7('0x1')});};}; \ No newline at end of file +var _0x9938=['GetFaxQueue','timeout','strategy','User','Agents','name','online','faxPause','../client','getFaxQueues','Request'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0x9938,0x19f));var _0x8993=function(_0x1b4233,_0xff3b93){_0x1b4233=_0x1b4233-0x0;var _0x1f7dd9=_0x9938[_0x1b4233];return _0x1f7dd9;};'use strict';var client=require(_0x8993('0x0'));exports[_0x8993('0x1')]=function(){return function(){return client[_0x8993('0x2')](_0x8993('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8993('0x4'),_0x8993('0x5')],'include':[{'model':_0x8993('0x6'),'as':_0x8993('0x7'),'attributes':['id',_0x8993('0x8'),_0x8993('0x9'),_0x8993('0xa')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 2353517..dbfd91a 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 _0x7c96=['CreateFaxQueueReport','update','UpdateFaxQueueReport','../client','create','Request'];(function(_0xb6488f,_0xd311bf){var _0x29a11b=function(_0x35c4b3){while(--_0x35c4b3){_0xb6488f['push'](_0xb6488f['shift']());}};_0x29a11b(++_0xd311bf);}(_0x7c96,0x12f));var _0x67c9=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x7c96[_0x74892f];return _0x10ee61;};'use strict';var client=require(_0x67c9('0x0'));exports[_0x67c9('0x1')]=function(_0x56af80){return client[_0x67c9('0x2')]('CreateFaxQueueReport',{'body':_0x56af80,'log':_0x67c9('0x3')});};exports[_0x67c9('0x4')]=function(_0x331aed,_0x35c777){return client[_0x67c9('0x2')](_0x67c9('0x5'),{'body':_0x35c777,'options':{'where':{'uniqueid':_0x331aed},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xde15=['UpdateFaxQueueReport','Request','DESC'];(function(_0x25d865,_0x228cd8){var _0x2c7324=function(_0x3f38bc){while(--_0x3f38bc){_0x25d865['push'](_0x25d865['shift']());}};_0x2c7324(++_0x228cd8);}(_0xde15,0x106));var _0x5de1=function(_0x530893,_0x56472e){_0x530893=_0x530893-0x0;var _0x372215=_0xde15[_0x530893];return _0x372215;};'use strict';var client=require('../client');exports['create']=function(_0x55834e){return client[_0x5de1('0x0')]('CreateFaxQueueReport',{'body':_0x55834e,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x561aa3,_0x1d517a){return client[_0x5de1('0x0')]('UpdateFaxQueueReport',{'body':_0x1d517a,'options':{'where':{'uniqueid':_0x561aa3},'order':[['id',_0x5de1('0x1')]],'limit':0x1},'log':_0x5de1('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index adb6a0e..954d8bb 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 _0xc170=['Intervals','interval','getIntervals','name','Interval'];(function(_0x568013,_0x5233ec){var _0x53b61f=function(_0x345a5d){while(--_0x345a5d){_0x568013['push'](_0x568013['shift']());}};_0x53b61f(++_0x5233ec);}(_0xc170,0x189));var _0x0c17=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xc170[_0x580576];return _0x3f55a0;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0c17('0x0')],'include':[{'model':_0x0c17('0x1'),'as':_0x0c17('0x2'),'attributes':['id','name',_0x0c17('0x3')]}]},'log':_0x0c17('0x4')});};}; \ No newline at end of file +var _0xf99e=['GetInterval','name','Interval','interval','../client','getIntervals','Request'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0xf99e,0x14d));var _0xef99=function(_0x59c5e8,_0x482de4){_0x59c5e8=_0x59c5e8-0x0;var _0x220a95=_0xf99e[_0x59c5e8];return _0x220a95;};'use strict';var client=require(_0xef99('0x0'));exports[_0xef99('0x1')]=function(){return function(){return client[_0xef99('0x2')](_0xef99('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xef99('0x4')],'include':[{'model':_0xef99('0x5'),'as':'Intervals','attributes':['id',_0xef99('0x4'),_0xef99('0x6')]}]},'log':_0xef99('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 904da0c..b655a82 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 _0x1399=['UpdateMailInteraction','updateMailInteraction','addTags','Request','../client','update'];(function(_0x385acf,_0x477dee){var _0x1e2ffd=function(_0x372494){while(--_0x372494){_0x385acf['push'](_0x385acf['shift']());}};_0x1e2ffd(++_0x477dee);}(_0x1399,0x16c));var _0x9139=function(_0x4ed90b,_0x5b8dc5){_0x4ed90b=_0x4ed90b-0x0;var _0x812d6d=_0x1399[_0x4ed90b];return _0x812d6d;};'use strict';var client=require(_0x9139('0x0'));exports[_0x9139('0x1')]=function(_0x5740a9,_0x474911){return client['Request'](_0x9139('0x2'),{'body':_0x474911,'options':{'where':{'id':_0x5740a9}},'log':_0x9139('0x3')});};exports[_0x9139('0x4')]=function(_0x28f155,_0x251798){return client[_0x9139('0x5')]('AddTagsToMailInteraction',{'body':_0x251798,'options':{'where':{'id':_0x28f155}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x9582=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','addTags'];(function(_0x2d819b,_0x511b06){var _0x38c7ab=function(_0x3b1ced){while(--_0x3b1ced){_0x2d819b['push'](_0x2d819b['shift']());}};_0x38c7ab(++_0x511b06);}(_0x9582,0x95));var _0x2958=function(_0x498a6e,_0x1dfe88){_0x498a6e=_0x498a6e-0x0;var _0x546469=_0x9582[_0x498a6e];return _0x546469;};'use strict';var client=require(_0x2958('0x0'));exports[_0x2958('0x1')]=function(_0xd87e37,_0x3d6d1f){return client[_0x2958('0x2')](_0x2958('0x3'),{'body':_0x3d6d1f,'options':{'where':{'id':_0xd87e37}},'log':'updateMailInteraction'});};exports[_0x2958('0x4')]=function(_0x3b907e,_0x136c77){return client[_0x2958('0x2')](_0x2958('0x5'),{'body':_0x136c77,'options':{'where':{'id':_0x3b907e}},'log':_0x2958('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 14b2107..245fc0e 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 _0xc7f7=['../client','Request','CreateMailMessage'];(function(_0x1fe4fa,_0x501a3b){var _0x2132c0=function(_0x5cf63b){while(--_0x5cf63b){_0x1fe4fa['push'](_0x1fe4fa['shift']());}};_0x2132c0(++_0x501a3b);}(_0xc7f7,0x1aa));var _0x7c7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7f7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7c7f('0x0'));exports['create']=function(_0x553256){return client[_0x7c7f('0x1')](_0x7c7f('0x2'),{'body':_0x553256,'log':'createMailMessage'});}; \ No newline at end of file +var _0x3287=['createMailMessage','../client','Request','CreateMailMessage'];(function(_0x13afba,_0x6167ab){var _0x1f9e83=function(_0x47382e){while(--_0x47382e){_0x13afba['push'](_0x13afba['shift']());}};_0x1f9e83(++_0x6167ab);}(_0x3287,0xe5));var _0x7328=function(_0x5424d3,_0x1ddf0a){_0x5424d3=_0x5424d3-0x0;var _0x7853e8=_0x3287[_0x5424d3];return _0x7853e8;};'use strict';var client=require(_0x7328('0x0'));exports['create']=function(_0x3ade48){return client[_0x7328('0x1')](_0x7328('0x2'),{'body':_0x3ade48,'log':_0x7328('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index ed8f850..ec9ba8c 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 _0x2728=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','User','Agents'];(function(_0x1ae29c,_0x3893c4){var _0x28c0cf=function(_0x123067){while(--_0x123067){_0x1ae29c['push'](_0x1ae29c['shift']());}};_0x28c0cf(++_0x3893c4);}(_0x2728,0x1d8));var _0x8272=function(_0x3cedf9,_0x3586c6){_0x3cedf9=_0x3cedf9-0x0;var _0x4789b1=_0x2728[_0x3cedf9];return _0x4789b1;};'use strict';var client=require(_0x8272('0x0'));exports[_0x8272('0x1')]=function(){return function(){return client[_0x8272('0x2')](_0x8272('0x3'),{'options':{'raw':![],'attributes':['id',_0x8272('0x4'),_0x8272('0x5'),'strategy'],'include':[{'model':_0x8272('0x6'),'as':_0x8272('0x7'),'attributes':['id','name',_0x8272('0x8'),_0x8272('0x9')]}]},'log':_0x8272('0x1')});};}; \ No newline at end of file +var _0x3893=['name','timeout','strategy','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x548a64,_0x32015f){var _0x3bf527=function(_0x53cb4b){while(--_0x53cb4b){_0x548a64['push'](_0x548a64['shift']());}};_0x3bf527(++_0x32015f);}(_0x3893,0xec));var _0x3389=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x3893[_0x11a55c];return _0x26c390;};'use strict';var client=require(_0x3389('0x0'));exports[_0x3389('0x1')]=function(){return function(){return client[_0x3389('0x2')](_0x3389('0x3'),{'options':{'raw':![],'attributes':['id',_0x3389('0x4'),_0x3389('0x5'),_0x3389('0x6')],'include':[{'model':'User','as':_0x3389('0x7'),'attributes':['id',_0x3389('0x4'),_0x3389('0x8'),_0x3389('0x9')]}]},'log':_0x3389('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1610a8c..7d15210 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 _0x3ee6=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','Request'];(function(_0x3d5deb,_0x5d8eb4){var _0x2060a8=function(_0x405378){while(--_0x405378){_0x3d5deb['push'](_0x3d5deb['shift']());}};_0x2060a8(++_0x5d8eb4);}(_0x3ee6,0xa6));var _0x63ee=function(_0x5a2873,_0x491a13){_0x5a2873=_0x5a2873-0x0;var _0x42ee7e=_0x3ee6[_0x5a2873];return _0x42ee7e;};'use strict';var client=require(_0x63ee('0x0'));exports['create']=function(_0x22cb24){return client[_0x63ee('0x1')]('CreateMailQueueReport',{'body':_0x22cb24,'log':_0x63ee('0x2')});};exports[_0x63ee('0x3')]=function(_0x3dd3de,_0x41daa7){return client[_0x63ee('0x1')](_0x63ee('0x4'),{'body':_0x41daa7,'options':{'where':{'uniqueid':_0x3dd3de},'order':[['id',_0x63ee('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x441d=['CreateMailQueueReport','Request','DESC','UpdateMailQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x441d,0x194));var _0xd441=function(_0x22fc7e,_0xadeaa4){_0x22fc7e=_0x22fc7e-0x0;var _0x8418df=_0x441d[_0x22fc7e];return _0x8418df;};'use strict';var client=require('../client');exports['create']=function(_0x55aaf7){return client['Request'](_0xd441('0x0'),{'body':_0x55aaf7,'log':_0xd441('0x0')});};exports['update']=function(_0x2ee7ec,_0x327c8b){return client[_0xd441('0x1')]('UpdateMailQueueReport',{'body':_0x327c8b,'options':{'where':{'uniqueid':_0x2ee7ec},'order':[['id',_0xd441('0x2')]],'limit':0x1},'log':_0xd441('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 4bfcee4..232a095 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 _0xf80f=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf80f,0x1b8));var _0xff80=function(_0x553152,_0xa76fe){_0x553152=_0x553152-0x0;var _0x4e45e9=_0xf80f[_0x553152];return _0x4e45e9;};'use strict';var client=require('../client');exports[_0xff80('0x0')]=function(_0xecde6,_0xa54a66){return client[_0xff80('0x1')](_0xff80('0x2'),{'body':_0xa54a66,'options':{'where':{'id':_0xecde6}},'log':_0xff80('0x3')});};exports['addTags']=function(_0xbec010,_0x2d8af8){return client[_0xff80('0x1')](_0xff80('0x4'),{'body':_0x2d8af8,'options':{'where':{'id':_0xbec010}},'log':_0xff80('0x5')});}; \ No newline at end of file +var _0xa989=['update','Request','updateOpenchannelInteraction','addTags','../client'];(function(_0x52a58f,_0x8e51a7){var _0x2a213b=function(_0x46e6af){while(--_0x46e6af){_0x52a58f['push'](_0x52a58f['shift']());}};_0x2a213b(++_0x8e51a7);}(_0xa989,0x176));var _0x9a98=function(_0x14e8be,_0x489103){_0x14e8be=_0x14e8be-0x0;var _0x503e3f=_0xa989[_0x14e8be];return _0x503e3f;};'use strict';var client=require(_0x9a98('0x0'));exports[_0x9a98('0x1')]=function(_0x5b66a4,_0x1a3de7){return client[_0x9a98('0x2')]('UpdateOpenchannelInteraction',{'body':_0x1a3de7,'options':{'where':{'id':_0x5b66a4}},'log':_0x9a98('0x3')});};exports[_0x9a98('0x4')]=function(_0x32cac6,_0x2c3ef4){return client[_0x9a98('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x2c3ef4,'options':{'where':{'id':_0x32cac6}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 311cb7f..7b14833 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 _0x5234=['create','Request','createOpenchannelMessage','../client'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x5234,0x14b));var _0x4523=function(_0x1c129c,_0x525b75){_0x1c129c=_0x1c129c-0x0;var _0x75f7c7=_0x5234[_0x1c129c];return _0x75f7c7;};'use strict';var client=require(_0x4523('0x0'));exports[_0x4523('0x1')]=function(_0x189788){return client[_0x4523('0x2')]('CreateOpenchannelMessage',{'body':_0x189788,'log':_0x4523('0x3')});}; \ No newline at end of file +var _0xd186=['../client','Request','CreateOpenchannelMessage'];(function(_0x5dd7d8,_0x92670){var _0x245a83=function(_0x10f4e3){while(--_0x10f4e3){_0x5dd7d8['push'](_0x5dd7d8['shift']());}};_0x245a83(++_0x92670);}(_0xd186,0xf0));var _0x6d18=function(_0x2ec8cc,_0x2aab7d){_0x2ec8cc=_0x2ec8cc-0x0;var _0xf9a0e2=_0xd186[_0x2ec8cc];return _0xf9a0e2;};'use strict';var client=require(_0x6d18('0x0'));exports['create']=function(_0x525028){return client[_0x6d18('0x1')](_0x6d18('0x2'),{'body':_0x525028,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 2946d07..f737958 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 _0x2572=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x6d394d,_0x185b80){var _0x1f0621=function(_0x2e5c81){while(--_0x2e5c81){_0x6d394d['push'](_0x6d394d['shift']());}};_0x1f0621(++_0x185b80);}(_0x2572,0x110));var _0x2257=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2572[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x2257('0x0'));exports[_0x2257('0x1')]=function(){return function(){return client[_0x2257('0x2')](_0x2257('0x3'),{'options':{'raw':![],'attributes':['id',_0x2257('0x4'),_0x2257('0x5'),_0x2257('0x6')],'include':[{'model':_0x2257('0x7'),'as':_0x2257('0x8'),'attributes':['id','name',_0x2257('0x9'),_0x2257('0xa')]}]},'log':_0x2257('0x1')});};}; \ No newline at end of file +var _0x9239=['Agents','online','openchannelPause','getOpenchannelQueues','Request','name','strategy','User'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9239,0x1bc));var _0x9923=function(_0x4973b2,_0x214665){_0x4973b2=_0x4973b2-0x0;var _0x59f1c3=_0x9239[_0x4973b2];return _0x59f1c3;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x9923('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x9923('0x1'),'timeout',_0x9923('0x2')],'include':[{'model':_0x9923('0x3'),'as':_0x9923('0x4'),'attributes':['id',_0x9923('0x1'),_0x9923('0x5'),_0x9923('0x6')]}]},'log':_0x9923('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7b1cb4b..c88f00f 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 _0x7782=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7782,0xa2));var _0x2778=function(_0x15a09d,_0x23580c){_0x15a09d=_0x15a09d-0x0;var _0x26ed02=_0x7782[_0x15a09d];return _0x26ed02;};'use strict';var client=require('../client');exports[_0x2778('0x0')]=function(_0x5cb0f3){return client[_0x2778('0x1')](_0x2778('0x2'),{'body':_0x5cb0f3,'log':_0x2778('0x2')});};exports[_0x2778('0x3')]=function(_0x24d3e7,_0x67a11){return client[_0x2778('0x1')](_0x2778('0x4'),{'body':_0x67a11,'options':{'where':{'uniqueid':_0x24d3e7},'order':[['id',_0x2778('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xb477=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','create'];(function(_0x23cba4,_0x75722){var _0x47c4b3=function(_0x34321f){while(--_0x34321f){_0x23cba4['push'](_0x23cba4['shift']());}};_0x47c4b3(++_0x75722);}(_0xb477,0x8f));var _0x7b47=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xb477[_0x50a0c2];return _0x5ebadd;};'use strict';var client=require('../client');exports[_0x7b47('0x0')]=function(_0x12a8af){return client[_0x7b47('0x1')]('CreateOpenchannelQueueReport',{'body':_0x12a8af,'log':_0x7b47('0x2')});};exports[_0x7b47('0x3')]=function(_0x178ba9,_0x5ccfb5){return client[_0x7b47('0x1')](_0x7b47('0x4'),{'body':_0x5ccfb5,'options':{'where':{'uniqueid':_0x178ba9},'order':[['id',_0x7b47('0x5')]],'limit':0x1},'log':_0x7b47('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index ff672fa..7a44f1d 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 _0x55d2=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x1ca3d8,_0x4e5e24){var _0x5474c3=function(_0x54eceb){while(--_0x54eceb){_0x1ca3d8['push'](_0x1ca3d8['shift']());}};_0x5474c3(++_0x4e5e24);}(_0x55d2,0x9f));var _0x255d=function(_0x11fc8b,_0x4ee51d){_0x11fc8b=_0x11fc8b-0x0;var _0x4ea86e=_0x55d2[_0x11fc8b];return _0x4ea86e;};'use strict';var client=require('../client');exports['update']=function(_0x37e1c7,_0x1bd891){return client[_0x255d('0x0')](_0x255d('0x1'),{'body':_0x1bd891,'options':{'where':{'id':_0x37e1c7}},'log':_0x255d('0x2')});};exports[_0x255d('0x3')]=function(_0x57cbc1,_0x44e16c){return client[_0x255d('0x0')](_0x255d('0x4'),{'body':_0x44e16c,'options':{'where':{'id':_0x57cbc1}},'log':_0x255d('0x5')});}; \ No newline at end of file +var _0xd04b=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction'];(function(_0x160fbc,_0x2f06ed){var _0x2a34ee=function(_0x2b1211){while(--_0x2b1211){_0x160fbc['push'](_0x160fbc['shift']());}};_0x2a34ee(++_0x2f06ed);}(_0xd04b,0x145));var _0xbd04=function(_0x136bdc,_0x2b1cad){_0x136bdc=_0x136bdc-0x0;var _0xad4b10=_0xd04b[_0x136bdc];return _0xad4b10;};'use strict';var client=require(_0xbd04('0x0'));exports[_0xbd04('0x1')]=function(_0x4775e2,_0x5186f0){return client[_0xbd04('0x2')]('UpdateSmsInteraction',{'body':_0x5186f0,'options':{'where':{'id':_0x4775e2}},'log':_0xbd04('0x3')});};exports[_0xbd04('0x4')]=function(_0xc1c02f,_0xe948b3){return client[_0xbd04('0x2')](_0xbd04('0x5'),{'body':_0xe948b3,'options':{'where':{'id':_0xc1c02f}},'log':_0xbd04('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 7ad9843..6a40897 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 _0x460d=['create','Request','createSmsMessage'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x460d,0x174));var _0xd460=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x460d[_0x4953da];return _0x2d3780;};'use strict';var client=require('../client');exports[_0xd460('0x0')]=function(_0x5009f7){return client[_0xd460('0x1')]('CreateSmsMessage',{'body':_0x5009f7,'log':_0xd460('0x2')});}; \ No newline at end of file +var _0x3d97=['../client','Request','CreateSmsMessage','createSmsMessage'];(function(_0x6d9a0a,_0x5aa364){var _0x376544=function(_0x2d1423){while(--_0x2d1423){_0x6d9a0a['push'](_0x6d9a0a['shift']());}};_0x376544(++_0x5aa364);}(_0x3d97,0x12c));var _0x73d9=function(_0xdb9cab,_0x186aa2){_0xdb9cab=_0xdb9cab-0x0;var _0x4060a6=_0x3d97[_0xdb9cab];return _0x4060a6;};'use strict';var client=require(_0x73d9('0x0'));exports['create']=function(_0x36d90d){return client[_0x73d9('0x1')](_0x73d9('0x2'),{'body':_0x36d90d,'log':_0x73d9('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 216d954..ffde7cb 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0xdcb92d,_0x5ac529){var _0x567e7d=function(_0x2df2ba){while(--_0x2df2ba){_0xdcb92d['push'](_0xdcb92d['shift']());}};_0x567e7d(++_0x5ac529);}(_0xe706,0xa3));var _0x6e70=function(_0x5d9eaa,_0x167a02){_0x5d9eaa=_0x5d9eaa-0x0;var _0x15db37=_0xe706[_0x5d9eaa];return _0x15db37;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x4609be,_0x35833b){var _0x550998=function(_0x4b66ee){while(--_0x4b66ee){_0x4609be['push'](_0x4609be['shift']());}};_0x550998(++_0x35833b);}(_0x70e0,0x17b));var _0x070e=function(_0x4a648d,_0x473472){_0x4a648d=_0x4a648d-0x0;var _0x3dde71=_0x70e0[_0x4a648d];return _0x3dde71;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index bd42a29..430a073 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0xa3b16c,_0x4e4f50){var _0x3f2c47=function(_0x132942){while(--_0x132942){_0xa3b16c['push'](_0xa3b16c['shift']());}};_0x3f2c47(++_0x4e4f50);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x20e00e,_0x1d9fc5){var _0x1ab989=function(_0x5052d6){while(--_0x5052d6){_0x20e00e['push'](_0x20e00e['shift']());}};_0x1ab989(++_0x1d9fc5);}(_0x34e8,0x12c));var _0x834e=function(_0x489246,_0x2a1f5c){_0x489246=_0x489246-0x0;var _0x92138b=_0x34e8[_0x489246];return _0x92138b;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8598154..692f08d 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(_0x11344c,_0x2b24b7){var _0x3e9e2f=function(_0x43c310){while(--_0x43c310){_0x11344c['push'](_0x11344c['shift']());}};_0x3e9e2f(++_0x2b24b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x4a5e90,_0x54eead){var _0x276048=function(_0x26ab1e){while(--_0x26ab1e){_0x4a5e90['push'](_0x4a5e90['shift']());}};_0x276048(++_0x54eead);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 4893fe4..503858a 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 _0x3a6d=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x3a6d,0x143));var _0xd3a6=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x3a6d[_0x5f1391];return _0x50ebe3;};'use strict';var client=require(_0xd3a6('0x0'));exports[_0xd3a6('0x1')]=function(_0x5cb93b,_0x389f73){return client[_0xd3a6('0x2')](_0xd3a6('0x3'),{'body':_0x389f73,'options':{'where':{'id':_0x5cb93b}},'log':_0xd3a6('0x4')});};exports[_0xd3a6('0x5')]=function(_0x585473,_0x1cb966){return client[_0xd3a6('0x2')](_0xd3a6('0x6'),{'body':_0x1cb966,'options':{'where':{'id':_0x585473}},'log':_0xd3a6('0x7')});}; \ No newline at end of file +var _0x524e=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0x524e,0x15e));var _0xe524=function(_0x5ecec1,_0x5db278){_0x5ecec1=_0x5ecec1-0x0;var _0x809e0c=_0x524e[_0x5ecec1];return _0x809e0c;};'use strict';var client=require('../client');exports['update']=function(_0x353d8a,_0x154ece){return client[_0xe524('0x0')](_0xe524('0x1'),{'body':_0x154ece,'options':{'where':{'id':_0x353d8a}},'log':_0xe524('0x2')});};exports[_0xe524('0x3')]=function(_0xabd694,_0x32c90b){return client[_0xe524('0x0')](_0xe524('0x4'),{'body':_0x32c90b,'options':{'where':{'id':_0xabd694}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 03b4f32..4dabf0a 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 _0xf26d=['../client','create','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1bdc52,_0x4876a9){var _0xdf3fa3=function(_0x2a3ba4){while(--_0x2a3ba4){_0x1bdc52['push'](_0x1bdc52['shift']());}};_0xdf3fa3(++_0x4876a9);}(_0xf26d,0x114));var _0xdf26=function(_0x404d5e,_0x45c0b3){_0x404d5e=_0x404d5e-0x0;var _0x44a8ad=_0xf26d[_0x404d5e];return _0x44a8ad;};'use strict';var client=require(_0xdf26('0x0'));exports[_0xdf26('0x1')]=function(_0x1067f1){return client['Request'](_0xdf26('0x2'),{'body':_0x1067f1,'log':_0xdf26('0x3')});}; \ No newline at end of file +var _0xd333=['create','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd333,0x13b));var _0x3d33=function(_0x139949,_0x216a20){_0x139949=_0x139949-0x0;var _0x136c7a=_0xd333[_0x139949];return _0x136c7a;};'use strict';var client=require(_0x3d33('0x0'));exports[_0x3d33('0x1')]=function(_0x5b7a36){return client['Request'](_0x3d33('0x2'),{'body':_0x5b7a36,'log':_0x3d33('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index fe2a7e5..f271f0d 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 _0x3552=['timeout','strategy','User','name','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x3552,0x74));var _0x2355=function(_0x5b0d60,_0x2cf285){_0x5b0d60=_0x5b0d60-0x0;var _0x5a74ad=_0x3552[_0x5b0d60];return _0x5a74ad;};'use strict';var client=require(_0x2355('0x0'));exports[_0x2355('0x1')]=function(){return function(){return client[_0x2355('0x2')](_0x2355('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2355('0x4'),_0x2355('0x5')],'include':[{'model':_0x2355('0x6'),'as':'Agents','attributes':['id',_0x2355('0x7'),_0x2355('0x8'),_0x2355('0x9')]}]},'log':_0x2355('0x1')});};}; \ No newline at end of file +var _0xd6ca=['strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0x47141b,_0x5cc269){var _0x12f6f7=function(_0x25361){while(--_0x25361){_0x47141b['push'](_0x47141b['shift']());}};_0x12f6f7(++_0x5cc269);}(_0xd6ca,0x1e9));var _0xad6c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd6ca[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0xad6c('0x0'));exports[_0xad6c('0x1')]=function(){return function(){return client[_0xad6c('0x2')](_0xad6c('0x3'),{'options':{'raw':![],'attributes':['id',_0xad6c('0x4'),_0xad6c('0x5'),_0xad6c('0x6')],'include':[{'model':_0xad6c('0x7'),'as':_0xad6c('0x8'),'attributes':['id','name',_0xad6c('0x9'),_0xad6c('0xa')]}]},'log':_0xad6c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index e6a08d3..bd24ff9 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 _0x77fd=['Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x5c542b,_0x626809){var _0x40c342=function(_0x247794){while(--_0x247794){_0x5c542b['push'](_0x5c542b['shift']());}};_0x40c342(++_0x626809);}(_0x77fd,0x144));var _0xd77f=function(_0xb3f712,_0x3ed2e6){_0xb3f712=_0xb3f712-0x0;var _0x2baf96=_0x77fd[_0xb3f712];return _0x2baf96;};'use strict';var client=require(_0xd77f('0x0'));exports['create']=function(_0x41fcac){return client[_0xd77f('0x1')]('CreateWhatsappQueueReport',{'body':_0x41fcac,'log':_0xd77f('0x2')});};exports['update']=function(_0x4d14ca,_0x3ffbdc){return client[_0xd77f('0x1')](_0xd77f('0x3'),{'body':_0x3ffbdc,'options':{'where':{'uniqueid':_0x4d14ca},'order':[['id',_0xd77f('0x4')]],'limit':0x1},'log':_0xd77f('0x3')});}; \ No newline at end of file +var _0xb1d4=['create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x52ee86,_0x36b9ac){var _0x4d9fed=function(_0x260ab0){while(--_0x260ab0){_0x52ee86['push'](_0x52ee86['shift']());}};_0x4d9fed(++_0x36b9ac);}(_0xb1d4,0x6f));var _0x4b1d=function(_0x1f6437,_0x59ef95){_0x1f6437=_0x1f6437-0x0;var _0x19d158=_0xb1d4[_0x1f6437];return _0x19d158;};'use strict';var client=require(_0x4b1d('0x0'));exports[_0x4b1d('0x1')]=function(_0x2eda2f){return client['Request']('CreateWhatsappQueueReport',{'body':_0x2eda2f,'log':_0x4b1d('0x2')});};exports[_0x4b1d('0x3')]=function(_0x3265f8,_0x22671e){return client[_0x4b1d('0x4')](_0x4b1d('0x5'),{'body':_0x22671e,'options':{'where':{'uniqueid':_0x3265f8},'order':[['id',_0x4b1d('0x6')]],'limit':0x1},'log':_0x4b1d('0x5')});}; \ 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 b0a14c9..ec8dae2 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 _0xd25f=['info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','join','find','agents','createQueue','atimeout','channel','START:%s','rules','end','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','./strategy','string'];(function(_0xf6aec0,_0x51ffd6){var _0x59a51b=function(_0x57adc6){while(--_0x57adc6){_0xf6aec0['push'](_0xf6aec0['shift']());}};_0x59a51b(++_0x51ffd6);}(_0xd25f,0x7e));var _0xfd25=function(_0x2ea4f0,_0x420118){_0x2ea4f0=_0x2ea4f0-0x0;var _0x5c5877=_0xd25f[_0x2ea4f0];return _0x5c5877;};'use strict';var schema=require('validate');var _=require(_0xfd25('0x0'));var util=require(_0xfd25('0x1'));var seqqueue=require(_0xfd25('0x2'));var logger=require(_0xfd25('0x3'))('routing');var strategy=require(_0xfd25('0x4'));var queue=schema({'name':{'type':_0xfd25('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x1ff512,_0x349ea9,_0xb861ba){return logger[_0xfd25('0x6')](util[_0xfd25('0x7')](_0xfd25('0x8'),_0x1ff512,_0x349ea9[_0xfd25('0x9')],_0xb861ba));}function handleFindAgent(_0x428572){return function(_0x14827a){return _0x14827a[_0xfd25('0x9')][_0xfd25('0xa')]()===_0x428572[_0xfd25('0xa')]();};}exports[_0xfd25('0xb')]=function(_0xd5cac1,_0x332e97,_0x273558,_0x4d3c54){return function(_0x331209){try{var _0x11c97b={'name':_0x332e97[0x0],'timeout':_0x332e97[0x1]};var _0x480861=queue[_0xfd25('0xc')](_0x11c97b,{'typecast':!![]});if(_0x480861[_0xfd25('0xd')]){logger[_0xfd25('0xe')](_0xfd25('0xf'),_0xd5cac1,_['map'](_0x480861,'message')[_0xfd25('0x10')](',\x20'));_0x331209['stop']();}else{var _0x3aae61=_[_0xfd25('0x11')](_0x273558[_0xfd25('0x12')],handleFindAgent(_0x11c97b[_0xfd25('0x9')]));if(_0x3aae61){var _0x74596d=(_0x11c97b['timeout']||0xa)*0x3e8;var _0x491a37,_0x1adc2a;var _0x18a935=seqqueue[_0xfd25('0x13')](_0x74596d);_0x18a935['id']=_0xd5cac1;_0x18a935[_0xfd25('0x14')]=_0x74596d;_0x18a935[_0xfd25('0x15')]=_0x4d3c54[_0xfd25('0x15')];writeLog(_0xd5cac1,_0x3aae61,util[_0xfd25('0x7')](_0xfd25('0x16'),_0x74596d));_0x273558[_0xfd25('0x17')][_0xd5cac1]['on'](_0xfd25('0x18'),function(){logger[_0xfd25('0x6')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0xd5cac1);clearTimeout(_0x1adc2a);_0x1adc2a=undefined;_0x18a935[_0xfd25('0x19')]();if(_0x273558[_0xfd25('0x17')][_0xd5cac1]){delete _0x273558['rules'][_0xd5cac1];}_0x331209[_0xfd25('0x1a')]();});_0x273558[_0xfd25('0x17')][_0xd5cac1]['on'](_0xfd25('0x1b'),function(){if(_0x273558[_0xfd25('0x17')][_0xd5cac1]){delete _0x273558[_0xfd25('0x17')][_0xd5cac1];}});_0x1adc2a=setTimeout(function(){logger[_0xfd25('0x6')](_0xfd25('0x1c'),_0xd5cac1);clearTimeout(_0x1adc2a);_0x18a935[_0xfd25('0x19')]();_0x331209['next']();},_0x74596d);strategy['agent'](_0x18a935,_0x3aae61,_0x273558,_0x4d3c54);}else{logger[_0xfd25('0xe')](_0xfd25('0x1d'),_0xd5cac1,_0x11c97b['name']);_0x331209[_0xfd25('0x1a')]();}}}catch(_0x5c51d8){console[_0xfd25('0x1e')](_0x5c51d8);logger[_0xfd25('0xe')](_0xfd25('0x1f'),_0xd5cac1,_0x5c51d8[_0xfd25('0x20')]);_0x331209[_0xfd25('0x1a')]();}};}; \ No newline at end of file +var _0xadf6=['stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message'];(function(_0x469a59,_0x53c812){var _0x4caab2=function(_0x1e68f3){while(--_0x1e68f3){_0x469a59['push'](_0x469a59['shift']());}};_0x4caab2(++_0x53c812);}(_0xadf6,0x9d));var _0x6adf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xadf6[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require(_0x6adf('0x0'));var _=require(_0x6adf('0x1'));var util=require('util');var seqqueue=require(_0x6adf('0x2'));var logger=require(_0x6adf('0x3'))('routing');var strategy=require(_0x6adf('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x6adf('0x5')},'timeout':{'type':_0x6adf('0x6'),'message':_0x6adf('0x7')}});function writeLog(_0x139cee,_0x1c6937,_0x3ca092){return logger[_0x6adf('0x8')](util[_0x6adf('0x9')](_0x6adf('0xa'),_0x139cee,_0x1c6937['name'],_0x3ca092));}function handleFindAgent(_0x307613){return function(_0x1ea82c){return _0x1ea82c[_0x6adf('0xb')][_0x6adf('0xc')]()===_0x307613[_0x6adf('0xc')]();};}exports[_0x6adf('0xd')]=function(_0x4e20b2,_0x1ae7f2,_0x17cc02,_0x5f0cd7){return function(_0x37796d){try{var _0x5f04b0={'name':_0x1ae7f2[0x0],'timeout':_0x1ae7f2[0x1]};var _0x3a513d=queue['validate'](_0x5f04b0,{'typecast':!![]});if(_0x3a513d[_0x6adf('0xe')]){logger[_0x6adf('0xf')](_0x6adf('0x10'),_0x4e20b2,_['map'](_0x3a513d,_0x6adf('0x11'))['join'](',\x20'));_0x37796d[_0x6adf('0x12')]();}else{var _0x48b17a=_['find'](_0x17cc02[_0x6adf('0x13')],handleFindAgent(_0x5f04b0[_0x6adf('0xb')]));if(_0x48b17a){var _0x349c88=(_0x5f04b0[_0x6adf('0x14')]||0xa)*0x3e8;var _0x59f64a,_0x2efb9a;var _0x35060a=seqqueue[_0x6adf('0x15')](_0x349c88);_0x35060a['id']=_0x4e20b2;_0x35060a[_0x6adf('0x16')]=_0x349c88;_0x35060a[_0x6adf('0x17')]=_0x5f0cd7[_0x6adf('0x17')];writeLog(_0x4e20b2,_0x48b17a,util['format'](_0x6adf('0x18'),_0x349c88));_0x17cc02[_0x6adf('0x19')][_0x4e20b2]['on'](_0x6adf('0x1a'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x4e20b2);clearTimeout(_0x2efb9a);_0x2efb9a=undefined;_0x35060a[_0x6adf('0x1b')]();if(_0x17cc02[_0x6adf('0x19')][_0x4e20b2]){delete _0x17cc02[_0x6adf('0x19')][_0x4e20b2];}_0x37796d[_0x6adf('0x12')]();});_0x17cc02[_0x6adf('0x19')][_0x4e20b2]['on'](_0x6adf('0x1c'),function(){if(_0x17cc02[_0x6adf('0x19')][_0x4e20b2]){delete _0x17cc02[_0x6adf('0x19')][_0x4e20b2];}});_0x2efb9a=setTimeout(function(){logger[_0x6adf('0x8')](_0x6adf('0x1d'),_0x4e20b2);clearTimeout(_0x2efb9a);_0x35060a[_0x6adf('0x1b')]();_0x37796d[_0x6adf('0x1e')]();},_0x349c88);strategy[_0x6adf('0x1f')](_0x35060a,_0x48b17a,_0x17cc02,_0x5f0cd7);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x4e20b2,_0x5f04b0[_0x6adf('0xb')]);_0x37796d[_0x6adf('0x12')]();}}}catch(_0x599c9e){console[_0x6adf('0x20')](_0x599c9e);logger['error'](_0x6adf('0x21'),_0x4e20b2,_0x599c9e[_0x6adf('0x22')]);_0x37796d[_0x6adf('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index cc69c29..5acdaf3 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 _0xf1a3=['UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','create','then','catch','error','stringify','[%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','body','toString','postText','amazonlex','providerName','providerResponse','Failed','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf1a3,0x89));var _0x3f1a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf1a3[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x3f1a('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x3f1a('0x1'));var logger=require(_0x3f1a('0x2'))(_0x3f1a('0x3'));var rpc={'chatMessage':require(_0x3f1a('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3f1a('0x5')),'faxMessage':require(_0x3f1a('0x6')),'whatsappMessage':require(_0x3f1a('0x7'))};exports['consequence']=function(_0x23371d,_0x200a16){return function(_0x55baaa){try{if(!_[_0x3f1a('0x8')](this[_0x3f1a('0x9')][_0x3f1a('0xa')])){logger[_0x3f1a('0xb')](_0x3f1a('0xc'),_0x23371d,_0x3f1a('0xd'));return _0x55baaa[_0x3f1a('0xe')]();}var _0x46147f={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3f1a('0xf')](_0x3f1a('0x10')),'direction':_0x3f1a('0x11')};if(this[_0x3f1a('0x12')]===_0x3f1a('0x13')||this['channel']===_0x3f1a('0x14')){_0x46147f[_0x3f1a('0x15')]=this[_0x3f1a('0x9')][_0x3f1a('0x15')];}var _0x3694c7=this[_0x3f1a('0x12')];if(_0x3694c7===_0x3f1a('0x16')){_0x46147f[_0x3f1a('0x17')]=this[_0x3f1a('0x18')]['id'];}else{_0x46147f[_[_0x3f1a('0x19')](_0x3694c7)+_0x3f1a('0x1a')]=this[_0x3f1a('0x18')]['id'];}_0x46147f[_[_0x3f1a('0x19')](_0x3694c7)+_0x3f1a('0x1b')]=this[_0x3f1a('0x9')]['id'];if(this[_0x3f1a('0x9')][_0x3f1a('0x1c')]){var _0x8cd665=_0x200a16[0x4];if(!_[_0x3f1a('0x1d')](_0x8cd665)){_0x46147f['body']=utils['getMustacheRender'](_0x8cd665,this);return rpc[_0x3694c7+_0x3f1a('0x1e')][_0x3f1a('0x1f')](_0x46147f)[_0x3f1a('0x20')](function(_0x2f63d1){logger[_0x3f1a('0xb')](_0x3f1a('0xc'),_0x23371d,_0x46147f['body']);})[_0x3f1a('0x21')](function(_0x25bae7){logger[_0x3f1a('0x22')](_0x3f1a('0xc'),_0x23371d,JSON[_0x3f1a('0x23')](_0x25bae7));})['finally'](function(){logger['info'](_0x3f1a('0x24'),_0x23371d);_0x55baaa[_0x3f1a('0x25')]();});}else{logger[_0x3f1a('0xb')](_0x3f1a('0x26'),_0x23371d);_0x55baaa[_0x3f1a('0x25')]();}}else{var _0x4ad40b=this;var _0x1a05e6=new AWS[(_0x3f1a('0x27'))]({'accessKeyId':_0x200a16[0x0],'secretAccessKey':_0x200a16[0x1],'region':_0x200a16[0x2]});var _0x556c1e={'botAlias':_0x3f1a('0x28'),'botName':_0x200a16[0x3],'inputText':this[_0x3f1a('0x29')][_0x3f1a('0x2a')],'userId':this[_0x3f1a('0x12')]+':'+this[_0x3f1a('0x9')]['id'][_0x3f1a('0x2b')]()};_0x1a05e6[_0x3f1a('0x2c')](_0x556c1e,function(_0x4fb981,_0x24f405){if(_0x4fb981){logger[_0x3f1a('0x22')](_0x3f1a('0xc'),_0x23371d,_0x4fb981[_0x3f1a('0x29')]);_0x55baaa[_0x3f1a('0xe')]();}else if(_0x24f405&&_0x24f405[_0x3f1a('0x29')]){_0x4ad40b[_0x3f1a('0x2a')][_0x3f1a('0x2d')]=_0x24f405;_0x46147f[_0x3f1a('0x2a')]=_0x24f405[_0x3f1a('0x29')];_0x46147f[_0x3f1a('0x2e')]=_0x3f1a('0x2d');_0x46147f[_0x3f1a('0x2f')]=JSON[_0x3f1a('0x23')](_0x24f405);return rpc[_0x3694c7+_0x3f1a('0x1e')][_0x3f1a('0x1f')](_0x46147f)[_0x3f1a('0x20')](function(_0x47c9dd){logger[_0x3f1a('0xb')](_0x3f1a('0xc'),_0x23371d,_0x46147f['body']);if(_0x24f405['dialogState']==_0x3f1a('0x30')){_0x55baaa['next']();}else{_0x55baaa[_0x3f1a('0x25')]();}})[_0x3f1a('0x21')](function(_0x4269a7){logger['error'](_0x3f1a('0xc'),_0x23371d,JSON[_0x3f1a('0x23')](_0x4269a7));_0x55baaa[_0x3f1a('0xe')]();});}else{_0x55baaa['next']();}});}}catch(_0x238541){logger[_0x3f1a('0x22')](_0x3f1a('0xc'),_0x23371d,JSON[_0x3f1a('0x23')](_0x238541));_0x55baaa['stop']();}};}; \ No newline at end of file +var _0x6fa2=['Message','create','then','body','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','$LATEST','message','toString','postText','error','amazonlex','providerResponse','stringify','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','interaction','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender'];(function(_0x13ff25,_0x58244b){var _0x127daf=function(_0xf0a23b){while(--_0xf0a23b){_0x13ff25['push'](_0x13ff25['shift']());}};_0x127daf(++_0x58244b);}(_0x6fa2,0x1ac));var _0x26fa=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6fa2[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x26fa('0x0'));var moment=require(_0x26fa('0x1'));var AWS=require(_0x26fa('0x2'));var utils=require(_0x26fa('0x3'));var logger=require(_0x26fa('0x4'))(_0x26fa('0x5'));var rpc={'chatMessage':require(_0x26fa('0x6')),'openchannelMessage':require(_0x26fa('0x7')),'mailMessage':require(_0x26fa('0x8')),'smsMessage':require(_0x26fa('0x9')),'faxMessage':require(_0x26fa('0xa')),'whatsappMessage':require(_0x26fa('0xb'))};exports[_0x26fa('0xc')]=function(_0x18d33c,_0x4e2c9e){return function(_0x1df79f){try{if(!_['isNil'](this['interaction'][_0x26fa('0xd')])){logger[_0x26fa('0xe')](_0x26fa('0xf'),_0x18d33c,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1df79f[_0x26fa('0x10')]();}var _0x159b72={'ContactId':this['contact']['id'],'sentAt':moment()[_0x26fa('0x11')](_0x26fa('0x12')),'direction':_0x26fa('0x13')};if(this['channel']===_0x26fa('0x14')||this[_0x26fa('0x15')]===_0x26fa('0x16')){_0x159b72[_0x26fa('0x17')]=this[_0x26fa('0x18')]['phone'];}var _0x5204ae=this[_0x26fa('0x15')];if(_0x5204ae==='chat'){_0x159b72['ChatWebsiteId']=this[_0x26fa('0x19')]['id'];}else{_0x159b72[_[_0x26fa('0x1a')](_0x5204ae)+'AccountId']=this[_0x26fa('0x19')]['id'];}_0x159b72[_[_0x26fa('0x1a')](_0x5204ae)+_0x26fa('0x1b')]=this[_0x26fa('0x18')]['id'];if(this['interaction'][_0x26fa('0x1c')]){var _0x59cc52=_0x4e2c9e[0x4];if(!_[_0x26fa('0x1d')](_0x59cc52)){_0x159b72['body']=utils[_0x26fa('0x1e')](_0x59cc52,this);return rpc[_0x5204ae+_0x26fa('0x1f')][_0x26fa('0x20')](_0x159b72)[_0x26fa('0x21')](function(_0x103000){logger[_0x26fa('0xe')](_0x26fa('0xf'),_0x18d33c,_0x159b72[_0x26fa('0x22')]);})[_0x26fa('0x23')](function(_0xe822dd){logger['error'](_0x26fa('0xf'),_0x18d33c,JSON['stringify'](_0xe822dd));})[_0x26fa('0x24')](function(){logger['info'](_0x26fa('0x25'),_0x18d33c);_0x1df79f[_0x26fa('0x26')]();});}else{logger[_0x26fa('0xe')](_0x26fa('0x27'),_0x18d33c);_0x1df79f[_0x26fa('0x26')]();}}else{var _0x24c5cf=this;var _0x62cf21=new AWS[(_0x26fa('0x28'))]({'accessKeyId':_0x4e2c9e[0x0],'secretAccessKey':_0x4e2c9e[0x1],'region':_0x4e2c9e[0x2]});var _0x27379a={'botAlias':_0x26fa('0x29'),'botName':_0x4e2c9e[0x3],'inputText':this[_0x26fa('0x2a')]['body'],'userId':this[_0x26fa('0x15')]+':'+this[_0x26fa('0x18')]['id'][_0x26fa('0x2b')]()};_0x62cf21[_0x26fa('0x2c')](_0x27379a,function(_0x38f549,_0x41c39d){if(_0x38f549){logger[_0x26fa('0x2d')](_0x26fa('0xf'),_0x18d33c,_0x38f549[_0x26fa('0x2a')]);_0x1df79f[_0x26fa('0x10')]();}else if(_0x41c39d&&_0x41c39d[_0x26fa('0x2a')]){_0x24c5cf[_0x26fa('0x22')]['amazonlex']=_0x41c39d;_0x159b72[_0x26fa('0x22')]=_0x41c39d['message'];_0x159b72['providerName']=_0x26fa('0x2e');_0x159b72[_0x26fa('0x2f')]=JSON[_0x26fa('0x30')](_0x41c39d);return rpc[_0x5204ae+_0x26fa('0x1f')][_0x26fa('0x20')](_0x159b72)[_0x26fa('0x21')](function(_0x348264){logger[_0x26fa('0xe')]('[%s][AMAZONLEX]\x20%s',_0x18d33c,_0x159b72[_0x26fa('0x22')]);if(_0x41c39d[_0x26fa('0x31')]==_0x26fa('0x32')){_0x1df79f['next']();}else{_0x1df79f[_0x26fa('0x26')]();}})[_0x26fa('0x23')](function(_0x1d0d43){logger['error'](_0x26fa('0xf'),_0x18d33c,JSON[_0x26fa('0x30')](_0x1d0d43));_0x1df79f[_0x26fa('0x10')]();});}else{_0x1df79f[_0x26fa('0x10')]();}});}}catch(_0x58ea4e){logger[_0x26fa('0x2d')]('[%s][AMAZONLEX]\x20%s',_0x18d33c,JSON[_0x26fa('0x30')](_0x58ea4e));_0x1df79f[_0x26fa('0x26')]();}};}; \ 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 b762e66..c9f6475 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 _0x2456=['user','pass','messageId','html','','replace','';_0x53f4de[_0x6245('0x3a')]={'Auto-Submitted':_0x6245('0x3b'),'X-Auto-Response-Suppress':_0x6245('0x3c'),'Precedence':_0x6245('0x3d')};return mailRpc[_0x6245('0x3e')](_0x37b2e7,_0x53f4de)[_0x6245('0x3f')](function(_0x2608de){logger['info'](_0x6245('0x40'),_0xfb1ef6);_0x53f4de[_0x6245('0x35')]=_0x2608de[_0x6245('0x21')][_0x6245('0x35')];return rpc[_0x2ca04c+_0x6245('0x2a')][_0x6245('0x41')](_0x53f4de);})[_0x6245('0x3f')](function(_0x495fe){logger[_0x6245('0x18')](_0x6245('0x12'),_0xfb1ef6,JSON[_0x6245('0x42')](_0x495fe));})[_0x6245('0x43')](function(_0x2c5fdb){logger['error'](_0x6245('0x44'),_0xfb1ef6,JSON[_0x6245('0x42')](_0x2c5fdb));})[_0x6245('0x45')](function(){Promise[_0x6245('0x46')]()[_0x6245('0x3f')](function(){if(_0x4bd02c[0x0]!=='2'||_0x3747c2[_0x6245('0x47')])return;return rpc[_0x2ca04c+_0x6245('0x48')]['update'](_0x3747c2['id'],{'autoreplyExecuted':!![]})['then'](function(_0x52d60a){logger['info'](_0x6245('0x49'),_0xfb1ef6,JSON['stringify'](_0x52d60a));})[_0x6245('0x43')](function(_0x588c7a){logger['error'](_0x6245('0x4a'),_0xfb1ef6,JSON[_0x6245('0x42')](_0x588c7a));});})[_0x6245('0x3f')](function(){_0x5c5464[_0x6245('0x14')]();});});}else{return rpc[this[_0x6245('0xf')]+_0x6245('0x2a')]['create'](_0x53f4de)[_0x6245('0x3f')](function(_0x165116){logger[_0x6245('0x18')](_0x6245('0x12'),_0xfb1ef6,_0x53f4de[_0x6245('0x20')]);})[_0x6245('0x43')](function(_0x187e60){logger[_0x6245('0x4b')](_0x6245('0x12'),_0xfb1ef6,JSON[_0x6245('0x42')](_0x187e60));})[_0x6245('0x45')](function(){Promise[_0x6245('0x46')]()[_0x6245('0x3f')](function(){if(_0x4bd02c[0x0]!=='2'||_0x3747c2[_0x6245('0x47')])return;return rpc[_0x2ca04c+_0x6245('0x48')][_0x6245('0x4c')](_0x3747c2['id'],{'autoreplyExecuted':!![]})[_0x6245('0x3f')](function(_0x58343f){logger[_0x6245('0x18')](_0x6245('0x49'),_0xfb1ef6,JSON['stringify'](_0x58343f));})['catch'](function(_0x491cab){logger[_0x6245('0x4b')](_0x6245('0x4a'),_0xfb1ef6,JSON['stringify'](_0x491cab));});})[_0x6245('0x3f')](function(){_0x5c5464['next']();});});}}}catch(_0x2c4182){logger[_0x6245('0x4b')](_0x6245('0x12'),_0xfb1ef6,JSON[_0x6245('0x42')](_0x2c4182));_0x5c5464[_0x6245('0x4d')]();}};}; \ No newline at end of file +var _0x6591=['Re:\x20','chat','account','upperFirst','InteractionId','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','messageId','html','','replace','','auto-replied','All','auto_reply','sendMailMessage','then','Message','create','catch','error','stringify','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','created','interaction','Autoreply\x20already\x20sent','next','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','mail','from','phone','read','subject','startsWith','Re:'];(function(_0x2a4eec,_0x16bc0b){var _0x22c80e=function(_0x50286e){while(--_0x50286e){_0x2a4eec['push'](_0x2a4eec['shift']());}};_0x22c80e(++_0x16bc0b);}(_0x6591,0x1a6));var _0x1659=function(_0xeff2c3,_0x3a5a82){_0xeff2c3=_0xeff2c3-0x0;var _0x2cade6=_0x6591[_0xeff2c3];return _0x2cade6;};'use strict';var _=require(_0x1659('0x0'));var moment=require(_0x1659('0x1'));var utils=require(_0x1659('0x2'));var logger=require(_0x1659('0x3'))('routing');var rpc={'chatMessage':require(_0x1659('0x4')),'openchannelMessage':require(_0x1659('0x5')),'mailMessage':require(_0x1659('0x6')),'smsMessage':require(_0x1659('0x7')),'faxMessage':require(_0x1659('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1659('0x9')),'mailInteraction':require(_0x1659('0xa')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x1659('0xb')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x1659('0xc'));exports[_0x1659('0xd')]=function(_0x245c6d,_0x3b604d,_0x2579bd,_0x3261a7){return function(_0x256bd6){try{var _0x2b68d6=this['channel'];if(_0x2b68d6==='mail'&&_0x3261a7[_0x1659('0xe')][_0x1659('0xf')]){logger[_0x1659('0x10')](_0x1659('0x11'),_0x245c6d,_0x1659('0x12'));return _0x256bd6['next']();}if(_0x3b604d[0x0]==='1'&&(_[_0x1659('0x13')](this['interaction'][_0x1659('0x14')])||!this[_0x1659('0x15')][_0x1659('0x14')])){logger[_0x1659('0x10')](_0x1659('0x11'),_0x245c6d,_0x1659('0x16'));return _0x256bd6[_0x1659('0x17')]();}if(_0x3b604d[0x0]==='2'&&this[_0x1659('0x15')][_0x1659('0x18')]){logger[_0x1659('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x245c6d,_0x1659('0x19'));return _0x256bd6[_0x1659('0x17')]();}var _0x16c354={'ContactId':this[_0x1659('0x1a')]['id'],'sentAt':moment()[_0x1659('0x1b')](_0x1659('0x1c')),'direction':_0x1659('0x1d')};if(this[_0x1659('0x1e')]==='mail'){_0x16c354['body']=utils[_0x1659('0x1f')](_0x3b604d[0x2],this);}else{_0x16c354[_0x1659('0xe')]=utils['getMustacheRender'](_0x3b604d[0x1],this);}if(this[_0x1659('0x20')]){_0x16c354['to']=this[_0x1659('0x20')]['from']||'';if(this[_0x1659('0x1e')]===_0x1659('0x21')&&_0x3b604d[0x1]==='1'){_0x16c354['cc']=this['message']['cc']||'';}_0x16c354[_0x1659('0x22')]=this['message']['to']||'';_0x16c354[_0x1659('0x23')]=this[_0x1659('0x20')][_0x1659('0x23')]||'';_0x16c354[_0x1659('0x24')]=!![];if(this[_0x1659('0x20')]['subject']){_0x16c354['subject']='';_0x16c354[_0x1659('0x25')]+=_[_0x1659('0x26')](this['message'][_0x1659('0x25')],_0x1659('0x27'))?'':_0x1659('0x28');_0x16c354[_0x1659('0x25')]+=this['message'][_0x1659('0x25')];}}if(this['channel']===_0x1659('0x29')){_0x16c354['ChatWebsiteId']=this[_0x1659('0x2a')]['id'];}else{_0x16c354[_[_0x1659('0x2b')](this[_0x1659('0x1e')])+'AccountId']=this[_0x1659('0x2a')]['id'];}_0x16c354[_[_0x1659('0x2b')](this[_0x1659('0x1e')])+_0x1659('0x2c')]=this[_0x1659('0x15')]['id'];var _0x6949fd=this[_0x1659('0x15')];if(rpc[this[_0x1659('0x1e')]+'Message']){if(this[_0x1659('0x1e')]==='mail'){var _0x5737ed={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x1659('0x2d')][_0x1659('0x2e')]){_0x5737ed[_0x1659('0x2e')]=this['account'][_0x1659('0x2d')]['service'];}else{_0x5737ed[_0x1659('0x2f')]=this[_0x1659('0x2a')][_0x1659('0x2d')][_0x1659('0x2f')];_0x5737ed[_0x1659('0x30')]=this['account']['Smtp']['port'];_0x5737ed[_0x1659('0x31')]=this['account'][_0x1659('0x2d')][_0x1659('0x31')];}if(this[_0x1659('0x2a')][_0x1659('0x2d')][_0x1659('0x32')]){_0x5737ed['auth']={'user':this[_0x1659('0x2a')]['Smtp'][_0x1659('0x33')],'pass':this[_0x1659('0x2a')][_0x1659('0x2d')][_0x1659('0x34')]};}_0x16c354[_0x1659('0x35')]=this[_0x1659('0x20')][_0x1659('0x36')];_0x16c354[_0x1659('0x37')]=_0x1659('0x38')+_[_0x1659('0x39')](_0x16c354[_0x1659('0xe')],']+(>|$)/g,''),'priorityTrue':_0x1d1ebe[0x1],'priorityFalse':_0x1d1ebe[0x2]};var _0x25f1ad=gotoif[_0xa0c5('0x0')](_0x149766,{'typecast':!![]});if(_0x25f1ad[_0xa0c5('0xc')]){logger[_0xa0c5('0xd')](_0xa0c5('0xe'),_0x4e8ee0,_[_0xa0c5('0xf')](_0x25f1ad,'message')[_0xa0c5('0x10')](',\x20'));_0x384f0a['stop']();}else{try{var _0x15c775=eval('('+_0x149766[_0xa0c5('0x11')]+')');var _0x40f9b4=_0x15c775?_0x149766['priorityTrue']:_0x149766['priorityFalse'];logger[_0xa0c5('0x12')](_0xa0c5('0x13'),_0x4e8ee0,_0x149766[_0xa0c5('0x11')],_0x15c775,_0x40f9b4||'next');if(_0x40f9b4){var _0x4be152=_[_0xa0c5('0x14')](_0x384f0a['rules'](),{'p':_0x40f9b4});if(_0x4be152>=0x0){logger['info'](_0xa0c5('0x15'),_0x4e8ee0,_0x40f9b4||_0xa0c5('0x16'),_0x4be152);_0x384f0a[_0xa0c5('0x16')](_0x4be152);}else{logger[_0xa0c5('0x12')](_0xa0c5('0x17'),_0x4e8ee0,_0x40f9b4||_0xa0c5('0x16'));_0x384f0a[_0xa0c5('0x18')]();}}else{_0x384f0a[_0xa0c5('0x16')]();}}catch(_0x49f654){logger[_0xa0c5('0xd')](_0xa0c5('0x19'),_0x4e8ee0,_0x49f654[_0xa0c5('0x1a')]);_0x384f0a['stop']();}}}catch(_0x30c412){logger['error']('[%s][GOTOIF]\x20%s',_0x4e8ee0,JSON[_0xa0c5('0x1b')](_0x30c412));_0x384f0a[_0xa0c5('0x18')]();}};}; \ No newline at end of file +var _0xf75a=['[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','../../../../config/logger','routing','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info'];(function(_0x3ce301,_0x858468){var _0x323499=function(_0x789e5b){while(--_0x789e5b){_0x3ce301['push'](_0x3ce301['shift']());}};_0x323499(++_0x858468);}(_0xf75a,0xf1));var _0xaf75=function(_0x2af47e,_0x1d2a86){_0x2af47e=_0x2af47e-0x0;var _0x5bca26=_0xf75a[_0x2af47e];return _0x5bca26;};'use strict';var schema=require(_0xaf75('0x0'));var _=require(_0xaf75('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0xaf75('0x2'))(_0xaf75('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0xaf75('0x4')},'priorityFalse':{'type':_0xaf75('0x5'),'message':_0xaf75('0x6')}});exports[_0xaf75('0x7')]=function(_0x443989,_0x954da4){return function(_0x106085){try{var _0x289092={'condition':htmlToText[_0xaf75('0x8')](utils[_0xaf75('0x9')](_0x954da4[0x0],this),{'wordwrap':![]})[_0xaf75('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x954da4[0x1],'priorityFalse':_0x954da4[0x2]};var _0x48672c=gotoif[_0xaf75('0x0')](_0x289092,{'typecast':!![]});if(_0x48672c['length']){logger['error'](_0xaf75('0xb'),_0x443989,_['map'](_0x48672c,_0xaf75('0xc'))[_0xaf75('0xd')](',\x20'));_0x106085[_0xaf75('0xe')]();}else{try{var _0x529dfb=eval('('+_0x289092[_0xaf75('0xf')]+')');var _0x25f3a5=_0x529dfb?_0x289092[_0xaf75('0x10')]:_0x289092[_0xaf75('0x11')];logger[_0xaf75('0x12')](_0xaf75('0x13'),_0x443989,_0x289092[_0xaf75('0xf')],_0x529dfb,_0x25f3a5||_0xaf75('0x14'));if(_0x25f3a5){var _0x20342a=_['findIndex'](_0x106085[_0xaf75('0x15')](),{'p':_0x25f3a5});if(_0x20342a>=0x0){logger[_0xaf75('0x12')](_0xaf75('0x16'),_0x443989,_0x25f3a5||'next',_0x20342a);_0x106085[_0xaf75('0x14')](_0x20342a);}else{logger[_0xaf75('0x12')](_0xaf75('0x17'),_0x443989,_0x25f3a5||_0xaf75('0x14'));_0x106085['stop']();}}else{_0x106085[_0xaf75('0x14')]();}}catch(_0xfff924){logger[_0xaf75('0x18')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x443989,_0xfff924[_0xaf75('0xc')]);_0x106085[_0xaf75('0xe')]();}}}catch(_0x48098e){logger[_0xaf75('0x18')](_0xaf75('0xb'),_0x443989,JSON[_0xaf75('0x19')](_0x48098e));_0x106085[_0xaf75('0xe')]();}};}; \ 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 fd3fca2..4fe8c78 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 _0xec94=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','validate','lodash','../../../../config/logger','routing','number','consequence','length','[%s][GOTOP]\x20%s','map','join','stop','info','priority'];(function(_0x57c197,_0x3a3769){var _0x2b056b=function(_0x3582bc){while(--_0x3582bc){_0x57c197['push'](_0x57c197['shift']());}};_0x2b056b(++_0x3a3769);}(_0xec94,0x7b));var _0x4ec9=function(_0x5ad37c,_0x48985a){_0x5ad37c=_0x5ad37c-0x0;var _0x322c6a=_0xec94[_0x5ad37c];return _0x322c6a;};'use strict';var schema=require(_0x4ec9('0x0'));var _=require(_0x4ec9('0x1'));var logger=require(_0x4ec9('0x2'))(_0x4ec9('0x3'));var gotop=schema({'priority':{'type':_0x4ec9('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x4ec9('0x5')]=function(_0x11d7f1,_0x435bf8){return function(_0x489105){try{var _0x52c215={'priority':_0x435bf8[0x0]};var _0x53dec0=gotop[_0x4ec9('0x0')](_0x52c215,{'typecast':!![]});if(_0x53dec0[_0x4ec9('0x6')]){logger['error'](_0x4ec9('0x7'),_0x11d7f1,_[_0x4ec9('0x8')](_0x53dec0,'message')[_0x4ec9('0x9')](',\x20'));_0x489105[_0x4ec9('0xa')]();}else{logger[_0x4ec9('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x11d7f1,_0x52c215[_0x4ec9('0xc')]);if(_0x52c215[_0x4ec9('0xc')]){var _0x2ec2ce=_['findIndex'](_0x489105['rules'](),{'p':_0x52c215[_0x4ec9('0xc')]});if(_0x2ec2ce>=0x0){logger[_0x4ec9('0xb')](_0x4ec9('0xd'),_0x11d7f1,_0x52c215['priority']||'next',_0x2ec2ce);_0x489105[_0x4ec9('0xe')](_0x2ec2ce);}else{logger[_0x4ec9('0xb')](_0x4ec9('0xf'),_0x11d7f1,_0x52c215[_0x4ec9('0xc')]||_0x4ec9('0xe'));_0x489105[_0x4ec9('0xa')]();}}else{_0x489105[_0x4ec9('0xe')]();}}}catch(_0x166742){logger[_0x4ec9('0x10')]('[%s][GOTOP]\x20%s',_0x11d7f1,JSON['stringify'](_0x166742));_0x489105['stop']();}};}; \ No newline at end of file +var _0xd8ad=['findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stop','validate','lodash','../../../../config/logger','routing','number','consequence','length','error','map','message','info','[%s][GOTOP]\x20priority\x20%s','priority'];(function(_0x3fe9d9,_0x2b98a9){var _0x5099b9=function(_0x2e8981){while(--_0x2e8981){_0x3fe9d9['push'](_0x3fe9d9['shift']());}};_0x5099b9(++_0x2b98a9);}(_0xd8ad,0x195));var _0xdd8a=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0xd8ad[_0x3be0c4];return _0x11af9f;};'use strict';var schema=require(_0xdd8a('0x0'));var _=require(_0xdd8a('0x1'));var logger=require(_0xdd8a('0x2'))(_0xdd8a('0x3'));var gotop=schema({'priority':{'type':_0xdd8a('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xdd8a('0x5')]=function(_0x13a2b6,_0x563f60){return function(_0x31e935){try{var _0x36b84c={'priority':_0x563f60[0x0]};var _0x4db9d2=gotop[_0xdd8a('0x0')](_0x36b84c,{'typecast':!![]});if(_0x4db9d2[_0xdd8a('0x6')]){logger[_0xdd8a('0x7')]('[%s][GOTOP]\x20%s',_0x13a2b6,_[_0xdd8a('0x8')](_0x4db9d2,_0xdd8a('0x9'))['join'](',\x20'));_0x31e935['stop']();}else{logger[_0xdd8a('0xa')](_0xdd8a('0xb'),_0x13a2b6,_0x36b84c[_0xdd8a('0xc')]);if(_0x36b84c[_0xdd8a('0xc')]){var _0x13cf4c=_[_0xdd8a('0xd')](_0x31e935['rules'](),{'p':_0x36b84c[_0xdd8a('0xc')]});if(_0x13cf4c>=0x0){logger[_0xdd8a('0xa')](_0xdd8a('0xe'),_0x13a2b6,_0x36b84c['priority']||_0xdd8a('0xf'),_0x13cf4c);_0x31e935[_0xdd8a('0xf')](_0x13cf4c);}else{logger[_0xdd8a('0xa')](_0xdd8a('0x10'),_0x13a2b6,_0x36b84c[_0xdd8a('0xc')]||_0xdd8a('0xf'));_0x31e935['stop']();}}else{_0x31e935['next']();}}}catch(_0x159bfe){logger[_0xdd8a('0x7')](_0xdd8a('0x11'),_0x13a2b6,JSON['stringify'](_0x159bfe));_0x31e935[_0xdd8a('0x12')]();}};}; \ 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 b1d59e4..0c09327 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 _0xe605=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','account','upperFirst','channel','AccountId','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stop','lodash','./utils','routing','../../rpc/chatMessage'];(function(_0x20181d,_0x1d290f){var _0x29d53b=function(_0x102df4){while(--_0x102df4){_0x20181d['push'](_0x20181d['shift']());}};_0x29d53b(++_0x1d290f);}(_0xe605,0x92));var _0x5e60=function(_0x225474,_0x36b83f){_0x225474=_0x225474-0x0;var _0x13a483=_0xe605[_0x225474];return _0x13a483;};'use strict';var _=require(_0x5e60('0x0'));var utils=require(_0x5e60('0x1'));var logger=require('../../../../config/logger')(_0x5e60('0x2'));var rpc={'chatMessage':require(_0x5e60('0x3')),'openchannelMessage':require(_0x5e60('0x4')),'mailMessage':require(_0x5e60('0x5')),'smsMessage':require(_0x5e60('0x6')),'faxMessage':require(_0x5e60('0x7')),'whatsappMessage':require(_0x5e60('0x8'))};exports[_0x5e60('0x9')]=function(_0x297ab2,_0xc41535){return function(_0x1d4a08){try{var _0x168a14={'body':utils['getMustacheRender'](_0xc41535[0x0],this),'ContactId':this[_0x5e60('0xa')]['id']};if(this['channel']==='chat'){_0x168a14['ChatWebsiteId']=this[_0x5e60('0xb')]['id'];}else{_0x168a14[_[_0x5e60('0xc')](this[_0x5e60('0xd')])+_0x5e60('0xe')]=this[_0x5e60('0xb')]['id'];}_0x168a14[_[_0x5e60('0xc')](this['channel'])+_0x5e60('0xf')]=this['interaction']['id'];if(rpc[this[_0x5e60('0xd')]+_0x5e60('0x10')]){return rpc[this[_0x5e60('0xd')]+'Message'][_0x5e60('0x11')](_0x168a14)[_0x5e60('0x12')](function(_0x1f4e14){logger[_0x5e60('0x13')](_0x5e60('0x14'),_0x297ab2,_0x168a14[_0x5e60('0x15')]);_0x1d4a08['next']();})[_0x5e60('0x16')](function(_0x45304f){logger[_0x5e60('0x17')](_0x5e60('0x14'),_0x297ab2,JSON['stringify'](_0x45304f));_0x1d4a08[_0x5e60('0x18')]();});}}catch(_0x529ffe){logger[_0x5e60('0x17')](_0x5e60('0x14'),_0x297ab2,JSON['stringify'](_0x529ffe));_0x1d4a08[_0x5e60('0x18')]();}};}; \ No newline at end of file +var _0x2bb0=['create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','Message'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2bb0,0xf3));var _0x02bb=function(_0x120fb9,_0x3924ee){_0x120fb9=_0x120fb9-0x0;var _0x12a3fb=_0x2bb0[_0x120fb9];return _0x12a3fb;};'use strict';var _=require(_0x02bb('0x0'));var utils=require(_0x02bb('0x1'));var logger=require(_0x02bb('0x2'))('routing');var rpc={'chatMessage':require(_0x02bb('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x02bb('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x02bb('0x5'))};exports[_0x02bb('0x6')]=function(_0x8e4057,_0x390ff7){return function(_0x43dbb7){try{var _0x16bb7c={'body':utils[_0x02bb('0x7')](_0x390ff7[0x0],this),'ContactId':this['contact']['id']};if(this[_0x02bb('0x8')]===_0x02bb('0x9')){_0x16bb7c[_0x02bb('0xa')]=this['account']['id'];}else{_0x16bb7c[_[_0x02bb('0xb')](this['channel'])+_0x02bb('0xc')]=this[_0x02bb('0xd')]['id'];}_0x16bb7c[_['upperFirst'](this[_0x02bb('0x8')])+_0x02bb('0xe')]=this[_0x02bb('0xf')]['id'];if(rpc[this['channel']+_0x02bb('0x10')]){return rpc[this['channel']+_0x02bb('0x10')][_0x02bb('0x11')](_0x16bb7c)[_0x02bb('0x12')](function(_0x5c8728){logger[_0x02bb('0x13')](_0x02bb('0x14'),_0x8e4057,_0x16bb7c[_0x02bb('0x15')]);_0x43dbb7['next']();})[_0x02bb('0x16')](function(_0x55ec40){logger[_0x02bb('0x17')](_0x02bb('0x14'),_0x8e4057,JSON[_0x02bb('0x18')](_0x55ec40));_0x43dbb7[_0x02bb('0x19')]();});}}catch(_0x264ef4){logger[_0x02bb('0x17')]('[%s][MESSAGE]\x20%s',_0x8e4057,JSON['stringify'](_0x264ef4));_0x43dbb7[_0x02bb('0x19')]();}};}; \ 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 03fe1aa..cec9a5d 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 _0xdef6=['routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','stop'];(function(_0x14717f,_0x56e986){var _0x2d40bd=function(_0x16f0e6){while(--_0x16f0e6){_0x14717f['push'](_0x14717f['shift']());}};_0x2d40bd(++_0x56e986);}(_0xdef6,0xe0));var _0x6def=function(_0x16bd21,_0x3410da){_0x16bd21=_0x16bd21-0x0;var _0x3224c0=_0xdef6[_0x16bd21];return _0x3224c0;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x6def('0x0'));exports[_0x6def('0x1')]=function(_0x169bcf,_0x2b07c5){return function(_0x1ed5bf){try{logger['info'](_0x6def('0x2'),_0x169bcf,utils[_0x6def('0x3')](_0x2b07c5[0x0],this));_0x1ed5bf['next']();}catch(_0x27fa1a){logger[_0x6def('0x4')](_0x6def('0x2'),_0x169bcf,JSON[_0x6def('0x5')](_0x27fa1a));_0x1ed5bf[_0x6def('0x6')]();}};}; \ No newline at end of file +var _0x99a7=['next','error','stop','routing','info','[%s][NOOP]\x20%s'];(function(_0x128b58,_0x4d8d77){var _0x1fe6b7=function(_0x331f01){while(--_0x331f01){_0x128b58['push'](_0x128b58['shift']());}};_0x1fe6b7(++_0x4d8d77);}(_0x99a7,0x17d));var _0x799a=function(_0x75c3eb,_0x271b5a){_0x75c3eb=_0x75c3eb-0x0;var _0x6e6585=_0x99a7[_0x75c3eb];return _0x6e6585;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x799a('0x0'));exports['consequence']=function(_0x2dbe6d,_0xcdb625){return function(_0x34be2d){try{logger[_0x799a('0x1')](_0x799a('0x2'),_0x2dbe6d,utils['getMustacheRender'](_0xcdb625[0x0],this));_0x34be2d[_0x799a('0x3')]();}catch(_0x49a0ee){logger[_0x799a('0x4')](_0x799a('0x2'),_0x2dbe6d,JSON['stringify'](_0x49a0ee));_0x34be2d[_0x799a('0x5')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 2c93e71..058a7b7 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 _0x6f8b=['timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','beepall','log','stack','stop','validate','util','seq-queue','ioredis','../../../../config/logger','./strategy','redis','defaults','localhost','queue_id','account','queue','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x3beeed,_0x36ad45){var _0x28d457=function(_0x27d477){while(--_0x27d477){_0x3beeed['push'](_0x3beeed['shift']());}};_0x28d457(++_0x36ad45);}(_0x6f8b,0x1b3));var _0xb6f8=function(_0x5d67c2,_0x550b96){_0x5d67c2=_0x5d67c2-0x0;var _0x1790d7=_0x6f8b[_0x5d67c2];return _0x1790d7;};'use strict';var schema=require(_0xb6f8('0x0'));var _=require('lodash');var util=require(_0xb6f8('0x1'));var seqqueue=require(_0xb6f8('0x2'));var moment=require('moment');var Redis=require(_0xb6f8('0x3'));var config=require('../../../../config/environment');var logger=require(_0xb6f8('0x4'))('routing');var strategy=require(_0xb6f8('0x5'));config[_0xb6f8('0x6')]=_[_0xb6f8('0x7')](config[_0xb6f8('0x6')],{'host':_0xb6f8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb6f8('0x6')]));var attributes=['id',_0xb6f8('0x9'),_0xb6f8('0xa'),_0xb6f8('0xb'),'from','joinAt'];function emit(_0x2a0e27,_0x54b6ac,_0x540dff){io['to'](_0x2a0e27)[_0xb6f8('0xc')](_0x54b6ac,_0x540dff);}function emitChannelQueueInteraction(_0x1b6f87,_0x2eb806,_0x1eaa37,_0x5a2416,_0x32cb62,_0x47ce61,_0x38eca8,_0x3333bc){var _0x1c6aa8=_['clone'](_0x1eaa37);_0x1c6aa8[_0xb6f8('0x9')]=_0x3333bc;_0x1c6aa8[_0xb6f8('0xb')]=_0x2eb806;_0x1c6aa8[_0xb6f8('0xa')]=_0x5a2416;_0x1c6aa8['id']=_0x32cb62;if(_0x47ce61){_0x38eca8[util['format'](_0xb6f8('0xd'),_0x1b6f87)][_0x32cb62]=_[_0xb6f8('0xe')](_0x1c6aa8,attributes);}else{delete _0x38eca8[util[_0xb6f8('0xf')](_0xb6f8('0xd'),_0x1b6f87)][_0x32cb62];}emit(util[_0xb6f8('0xf')](_0xb6f8('0x10'),_0x1b6f87,_0x2eb806),util[_0xb6f8('0xf')]('%s_queue_waiting_interaction:%s',_0x1b6f87,_0x47ce61?_0xb6f8('0x11'):_0xb6f8('0x12')),_['pick'](_0x1c6aa8,attributes));}var rpc={'openchannelQueueReport':require(_0xb6f8('0x13')),'mailQueueReport':require(_0xb6f8('0x14')),'chatQueueReport':require(_0xb6f8('0x15')),'smsQueueReport':require(_0xb6f8('0x16')),'faxQueueReport':require(_0xb6f8('0x17')),'whatsappQueueReport':require(_0xb6f8('0x18'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xb6f8('0x19')},'timeout':{'type':_0xb6f8('0x1a'),'message':_0xb6f8('0x1b')}});function startRouting(_0x27b40c,_0x1d56c8,_0x355278,_0x555ae6){if(_0x27b40c&&_0x1d56c8&&_0x355278){_0x1d56c8['waiting']+=0x1;var _0x41b470={'uniqueid':_0x27b40c,'from':_0x355278[_0xb6f8('0x1c')]?_0x355278[_0xb6f8('0x1c')]['from']:'','joinAt':moment()[_0xb6f8('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x355278['contact']?_0x355278[_0xb6f8('0x1d')]['id']:null,'ListId':_0x355278[_0xb6f8('0x1e')]?_0x355278[_0xb6f8('0x1e')]['id']:null};_0x41b470[_[_0xb6f8('0x1f')](_0x355278[_0xb6f8('0x20')])+_0xb6f8('0x21')]=_0x1d56c8['id']||null;_0x41b470[_[_0xb6f8('0x1f')](_0x355278[_0xb6f8('0x20')])+_0xb6f8('0x22')]=_0x355278[_0xb6f8('0x23')]?_0x355278['interaction']['id']:null;_0x41b470[_['upperFirst'](_0x355278[_0xb6f8('0x20')])+_0xb6f8('0x24')]=_0x355278['message']?_0x355278[_0xb6f8('0x25')]['id']:null;_0x41b470[_[_0xb6f8('0x1f')](_0x355278[_0xb6f8('0x20')])+(_0x355278['channel']!==_0xb6f8('0x26')?_0xb6f8('0x27'):_0xb6f8('0x28'))]=_0x355278[_0xb6f8('0xa')]?_0x355278[_0xb6f8('0xa')]['id']:null;logger[_0xb6f8('0x29')](util[_0xb6f8('0xf')](_0xb6f8('0x2a'),_0x27b40c,_0x1d56c8[_0xb6f8('0x2b')]));emitChannelQueueInteraction(_0x355278[_0xb6f8('0x20')],_0x1d56c8[_0xb6f8('0x2b')],_0x41b470,_0x355278[_0xb6f8('0xa')]['name'],_0x355278[_0xb6f8('0x25')]['id'],!![],_0x555ae6,_0x1d56c8['id']);if(rpc[_0x355278[_0xb6f8('0x20')]+_0xb6f8('0x2c')]){return rpc[_0x355278[_0xb6f8('0x20')]+_0xb6f8('0x2c')]['create'](_0x41b470)[_0xb6f8('0x2d')](function(_0x4acd09){logger['error'](_0xb6f8('0x2e'));});}}}function stopRouting(_0x3b1816,_0x40982b,_0x969d98,_0x3b5d02){if(_0x3b1816&&_0x40982b){_0x40982b[_0xb6f8('0x2f')]-=0x1;var _0x3cc30d={'leaveAt':moment()[_0xb6f8('0xf')](_0xb6f8('0x30')),'acceptAt':moment()['format'](_0xb6f8('0x30')),'reason':_0xb6f8('0x31')};logger['info'](util[_0xb6f8('0xf')](_0xb6f8('0x32'),_0x3b1816,_0x40982b[_0xb6f8('0x2b')]));emitChannelQueueInteraction(_0x969d98[_0xb6f8('0x20')],_0x40982b['name'],_0x969d98[_0xb6f8('0x1c')],_0x969d98[_0xb6f8('0xa')][_0xb6f8('0x2b')],_0x969d98[_0xb6f8('0x25')]['id'],![],_0x3b5d02,_0x40982b['id']);if(rpc[_0x969d98[_0xb6f8('0x20')]+_0xb6f8('0x2c')]){return rpc[_0x969d98[_0xb6f8('0x20')]+'QueueReport']['update'](_0x3b1816,_0x3cc30d)[_0xb6f8('0x2d')](function(_0x4ac7cc){logger[_0xb6f8('0x33')](_0xb6f8('0x34'));});}}}function endRouting(_0x24df98,_0x755c69,_0x5e8147,_0x30bf16){if(_0x24df98&&_0x755c69){_0x755c69[_0xb6f8('0x2f')]-=0x1;var _0x42cf84={'leaveAt':moment()['format'](_0xb6f8('0x30')),'exitAt':moment()[_0xb6f8('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb6f8('0x35')};logger[_0xb6f8('0x29')](util[_0xb6f8('0xf')](_0xb6f8('0x36'),_0x24df98,_0x755c69['name']));emitChannelQueueInteraction(_0x5e8147[_0xb6f8('0x20')],_0x755c69[_0xb6f8('0x2b')],_0x5e8147[_0xb6f8('0x1c')],_0x5e8147[_0xb6f8('0xa')][_0xb6f8('0x2b')],_0x5e8147['message']['id'],![],_0x30bf16);if(rpc[_0x5e8147[_0xb6f8('0x20')]+_0xb6f8('0x2c')]){return rpc[_0x5e8147[_0xb6f8('0x20')]+'QueueReport']['update'](_0x24df98,_0x42cf84)['catch'](function(_0x2a5794){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x232264){return function(_0x1dbf11){return _0x1dbf11[_0xb6f8('0x2b')][_0xb6f8('0x37')]()===_0x232264[_0xb6f8('0x37')]();};}exports[_0xb6f8('0x38')]=function(_0x31fcf4,_0x3ca4eb,_0x3b4c80,_0x458e82){return function(_0x307bbf){try{var _0x2b7870={'name':_0x3ca4eb[0x0],'timeout':_0x3ca4eb[0x1]};var _0x29d656=queue[_0xb6f8('0x0')](_0x2b7870,{'typecast':!![]});if(_0x29d656[_0xb6f8('0x39')]){logger[_0xb6f8('0x33')](_0xb6f8('0x3a'),_0x31fcf4,_[_0xb6f8('0x3b')](_0x29d656,_0xb6f8('0x25'))[_0xb6f8('0x3c')](',\x20'));_0x307bbf['stop']();}else{var _0x133809=_[_0xb6f8('0x3d')](_0x3b4c80[_0x458e82[_0xb6f8('0x20')]+_0xb6f8('0x3e')],handleFindQueue(_0x2b7870[_0xb6f8('0x2b')]));if(_0x133809){startRouting(_0x31fcf4,_0x133809,_0x458e82,_0x3b4c80);var _0x52a14e=(_0x133809[_0xb6f8('0x35')]||0xa)*0x3e8;var _0x2db956=(_0x2b7870['timeout']||0x14)*0x3e8;var _0x4088fd,_0x5552fd;if(_0x52a14e>_0x2db956){_0x2db956=_0x52a14e;}var _0x1a3bde=seqqueue[_0xb6f8('0x3f')](_0x52a14e);_0x1a3bde['id']=_0x31fcf4;_0x1a3bde[_0xb6f8('0x40')]=_0x52a14e;_0x1a3bde[_0xb6f8('0x41')]=_0x2db956;_0x1a3bde['channel']=_0x458e82[_0xb6f8('0x20')];_0x3b4c80[_0xb6f8('0x42')][_0x31fcf4]['on'](_0xb6f8('0x43'),function(){logger['info'](_0xb6f8('0x44'),_0x31fcf4);stopRouting(_0x31fcf4,_0x133809,_0x458e82,_0x3b4c80);clearTimeout(_0x4088fd);_0x4088fd=undefined;_0x1a3bde[_0xb6f8('0x45')](!![]);if(_0x3b4c80[_0xb6f8('0x42')][_0x31fcf4]){delete _0x3b4c80[_0xb6f8('0x42')][_0x31fcf4];}_0x307bbf['stop']();});_0x3b4c80[_0xb6f8('0x42')][_0x31fcf4]['on'](_0xb6f8('0x46'),function(){if(_0x3b4c80[_0xb6f8('0x42')][_0x31fcf4]){delete _0x3b4c80[_0xb6f8('0x42')][_0x31fcf4];}});_0x4088fd=setTimeout(function(){logger[_0xb6f8('0x29')](_0xb6f8('0x47'),_0x31fcf4);endRouting(_0x31fcf4,_0x133809,_0x458e82,_0x3b4c80);clearTimeout(_0x4088fd);_0x1a3bde[_0xb6f8('0x45')](!![]);_0x307bbf['next']();},_0x2db956);switch(_0x133809['strategy']){case _0xb6f8('0x48'):strategy[_0xb6f8('0x48')](_0x1a3bde,_0x133809,_0x3b4c80,_0x458e82);break;default:strategy[_0xb6f8('0x49')](_0x1a3bde,_0x133809,_0x3b4c80,_0x458e82);}}else{logger[_0xb6f8('0x33')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x31fcf4,_0x2b7870[_0xb6f8('0x2b')]);_0x307bbf['stop']();}}}catch(_0x20cec7){console[_0xb6f8('0x4a')](_0x20cec7);logger[_0xb6f8('0x33')](_0xb6f8('0x3a'),_0x31fcf4,_0x20cec7[_0xb6f8('0x4b')]);_0x307bbf[_0xb6f8('0x4c')]();}};}; \ No newline at end of file +var _0xeaac=['join','find','Queues','atimeout','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','queue','joinAt','emit','clone','account','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','from','contact','list','channel','upperFirst','InteractionId','interaction','MessageId','message','chat','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','info','update','update\x20queue\x20report','timeout','toLowerCase','consequence','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeaac,0xa7));var _0xceaa=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xeaac[_0x2d7f0e];return _0x110b07;};'use strict';var schema=require(_0xceaa('0x0'));var _=require(_0xceaa('0x1'));var util=require(_0xceaa('0x2'));var seqqueue=require(_0xceaa('0x3'));var moment=require(_0xceaa('0x4'));var Redis=require(_0xceaa('0x5'));var config=require(_0xceaa('0x6'));var logger=require(_0xceaa('0x7'))(_0xceaa('0x8'));var strategy=require(_0xceaa('0x9'));config[_0xceaa('0xa')]=_[_0xceaa('0xb')](config[_0xceaa('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xceaa('0xc'))(new Redis(config[_0xceaa('0xa')]));var attributes=['id',_0xceaa('0xd'),'account',_0xceaa('0xe'),'from',_0xceaa('0xf')];function emit(_0xe988d4,_0x3e0528,_0x593305){io['to'](_0xe988d4)[_0xceaa('0x10')](_0x3e0528,_0x593305);}function emitChannelQueueInteraction(_0x46ac76,_0xc24db4,_0x5aa66e,_0x55c359,_0x187eb3,_0x3fa0a1,_0x23fcf6,_0x35e2fe){var _0x2cc012=_[_0xceaa('0x11')](_0x5aa66e);_0x2cc012[_0xceaa('0xd')]=_0x35e2fe;_0x2cc012[_0xceaa('0xe')]=_0xc24db4;_0x2cc012[_0xceaa('0x12')]=_0x55c359;_0x2cc012['id']=_0x187eb3;if(_0x3fa0a1){_0x23fcf6[util[_0xceaa('0x13')](_0xceaa('0x14'),_0x46ac76)][_0x187eb3]=_['pick'](_0x2cc012,attributes);}else{delete _0x23fcf6[util[_0xceaa('0x13')]('%sQueuesWaitingInteractions',_0x46ac76)][_0x187eb3];}emit(util['format']('%s:queue:%s',_0x46ac76,_0xc24db4),util[_0xceaa('0x13')](_0xceaa('0x15'),_0x46ac76,_0x3fa0a1?_0xceaa('0x16'):_0xceaa('0x17')),_[_0xceaa('0x18')](_0x2cc012,attributes));}var rpc={'openchannelQueueReport':require(_0xceaa('0x19')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xceaa('0x1a')),'smsQueueReport':require(_0xceaa('0x1b')),'faxQueueReport':require(_0xceaa('0x1c')),'whatsappQueueReport':require(_0xceaa('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xceaa('0x1e')},'timeout':{'type':_0xceaa('0x1f'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x206bd0,_0x1ac1f5,_0x40b5d3,_0x342a02){if(_0x206bd0&&_0x1ac1f5&&_0x40b5d3){_0x1ac1f5[_0xceaa('0x20')]+=0x1;var _0x301fbb={'uniqueid':_0x206bd0,'from':_0x40b5d3[_0xceaa('0x21')]?_0x40b5d3[_0xceaa('0x21')][_0xceaa('0x22')]:'','joinAt':moment()[_0xceaa('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40b5d3[_0xceaa('0x23')]?_0x40b5d3[_0xceaa('0x23')]['id']:null,'ListId':_0x40b5d3[_0xceaa('0x24')]?_0x40b5d3[_0xceaa('0x24')]['id']:null};_0x301fbb[_['upperFirst'](_0x40b5d3[_0xceaa('0x25')])+'QueueId']=_0x1ac1f5['id']||null;_0x301fbb[_[_0xceaa('0x26')](_0x40b5d3[_0xceaa('0x25')])+_0xceaa('0x27')]=_0x40b5d3[_0xceaa('0x28')]?_0x40b5d3['interaction']['id']:null;_0x301fbb[_[_0xceaa('0x26')](_0x40b5d3[_0xceaa('0x25')])+_0xceaa('0x29')]=_0x40b5d3[_0xceaa('0x2a')]?_0x40b5d3['message']['id']:null;_0x301fbb[_[_0xceaa('0x26')](_0x40b5d3[_0xceaa('0x25')])+(_0x40b5d3[_0xceaa('0x25')]!==_0xceaa('0x2b')?'AccountId':_0xceaa('0x2c'))]=_0x40b5d3['account']?_0x40b5d3[_0xceaa('0x12')]['id']:null;logger['info'](util[_0xceaa('0x13')](_0xceaa('0x2d'),_0x206bd0,_0x1ac1f5[_0xceaa('0x2e')]));emitChannelQueueInteraction(_0x40b5d3['channel'],_0x1ac1f5[_0xceaa('0x2e')],_0x301fbb,_0x40b5d3['account']['name'],_0x40b5d3[_0xceaa('0x2a')]['id'],!![],_0x342a02,_0x1ac1f5['id']);if(rpc[_0x40b5d3[_0xceaa('0x25')]+_0xceaa('0x2f')]){return rpc[_0x40b5d3[_0xceaa('0x25')]+'QueueReport'][_0xceaa('0x30')](_0x301fbb)[_0xceaa('0x31')](function(_0x3db73a){logger[_0xceaa('0x32')](_0xceaa('0x33'));});}}}function stopRouting(_0x21ffb3,_0x26dcab,_0x278629,_0x4149c4){if(_0x21ffb3&&_0x26dcab){_0x26dcab[_0xceaa('0x20')]-=0x1;var _0x57c12a={'leaveAt':moment()[_0xceaa('0x13')](_0xceaa('0x34')),'acceptAt':moment()['format'](_0xceaa('0x34')),'reason':_0xceaa('0x35')};logger[_0xceaa('0x36')](util[_0xceaa('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x21ffb3,_0x26dcab[_0xceaa('0x2e')]));emitChannelQueueInteraction(_0x278629[_0xceaa('0x25')],_0x26dcab[_0xceaa('0x2e')],_0x278629[_0xceaa('0x21')],_0x278629[_0xceaa('0x12')][_0xceaa('0x2e')],_0x278629['message']['id'],![],_0x4149c4,_0x26dcab['id']);if(rpc[_0x278629[_0xceaa('0x25')]+_0xceaa('0x2f')]){return rpc[_0x278629[_0xceaa('0x25')]+_0xceaa('0x2f')][_0xceaa('0x37')](_0x21ffb3,_0x57c12a)[_0xceaa('0x31')](function(_0x550346){logger[_0xceaa('0x32')](_0xceaa('0x38'));});}}}function endRouting(_0x408596,_0x45dd3b,_0x28613b,_0x49b7b2){if(_0x408596&&_0x45dd3b){_0x45dd3b['waiting']-=0x1;var _0x23c292={'leaveAt':moment()[_0xceaa('0x13')](_0xceaa('0x34')),'exitAt':moment()[_0xceaa('0x13')](_0xceaa('0x34')),'reason':_0xceaa('0x39')};logger['info'](util[_0xceaa('0x13')]('[%s][END:QUEUE][NAME:%s]',_0x408596,_0x45dd3b[_0xceaa('0x2e')]));emitChannelQueueInteraction(_0x28613b[_0xceaa('0x25')],_0x45dd3b[_0xceaa('0x2e')],_0x28613b[_0xceaa('0x21')],_0x28613b[_0xceaa('0x12')][_0xceaa('0x2e')],_0x28613b[_0xceaa('0x2a')]['id'],![],_0x49b7b2);if(rpc[_0x28613b[_0xceaa('0x25')]+_0xceaa('0x2f')]){return rpc[_0x28613b[_0xceaa('0x25')]+'QueueReport'][_0xceaa('0x37')](_0x408596,_0x23c292)[_0xceaa('0x31')](function(_0xb7f97b){logger[_0xceaa('0x32')](_0xceaa('0x38'));});}}}function handleFindQueue(_0x458bea){return function(_0x4cf401){return _0x4cf401[_0xceaa('0x2e')][_0xceaa('0x3a')]()===_0x458bea['toLowerCase']();};}exports[_0xceaa('0x3b')]=function(_0x2e0bb9,_0x13b530,_0x33ffa6,_0x45187c){return function(_0x38bc37){try{var _0x205f28={'name':_0x13b530[0x0],'timeout':_0x13b530[0x1]};var _0x458466=queue['validate'](_0x205f28,{'typecast':!![]});if(_0x458466[_0xceaa('0x3c')]){logger[_0xceaa('0x32')]('[%s][QUEUE]\x20%s',_0x2e0bb9,_['map'](_0x458466,'message')[_0xceaa('0x3d')](',\x20'));_0x38bc37['stop']();}else{var _0x2bb14c=_[_0xceaa('0x3e')](_0x33ffa6[_0x45187c[_0xceaa('0x25')]+_0xceaa('0x3f')],handleFindQueue(_0x205f28[_0xceaa('0x2e')]));if(_0x2bb14c){startRouting(_0x2e0bb9,_0x2bb14c,_0x45187c,_0x33ffa6);var _0x4d2b35=(_0x2bb14c[_0xceaa('0x39')]||0xa)*0x3e8;var _0x35aca2=(_0x205f28[_0xceaa('0x39')]||0x14)*0x3e8;var _0x542c60,_0x20588a;if(_0x4d2b35>_0x35aca2){_0x35aca2=_0x4d2b35;}var _0x5ef397=seqqueue['createQueue'](_0x4d2b35);_0x5ef397['id']=_0x2e0bb9;_0x5ef397[_0xceaa('0x40')]=_0x4d2b35;_0x5ef397['qtimeout']=_0x35aca2;_0x5ef397[_0xceaa('0x25')]=_0x45187c[_0xceaa('0x25')];_0x33ffa6[_0xceaa('0x41')][_0x2e0bb9]['on']('end',function(){logger[_0xceaa('0x36')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2e0bb9);stopRouting(_0x2e0bb9,_0x2bb14c,_0x45187c,_0x33ffa6);clearTimeout(_0x542c60);_0x542c60=undefined;_0x5ef397['close'](!![]);if(_0x33ffa6[_0xceaa('0x41')][_0x2e0bb9]){delete _0x33ffa6[_0xceaa('0x41')][_0x2e0bb9];}_0x38bc37[_0xceaa('0x42')]();});_0x33ffa6['rules'][_0x2e0bb9]['on'](_0xceaa('0x43'),function(){if(_0x33ffa6['rules'][_0x2e0bb9]){delete _0x33ffa6[_0xceaa('0x41')][_0x2e0bb9];}});_0x542c60=setTimeout(function(){logger[_0xceaa('0x36')](_0xceaa('0x44'),_0x2e0bb9);endRouting(_0x2e0bb9,_0x2bb14c,_0x45187c,_0x33ffa6);clearTimeout(_0x542c60);_0x5ef397[_0xceaa('0x45')](!![]);_0x38bc37['next']();},_0x35aca2);switch(_0x2bb14c[_0xceaa('0x46')]){case'rrmemory':strategy[_0xceaa('0x47')](_0x5ef397,_0x2bb14c,_0x33ffa6,_0x45187c);break;default:strategy[_0xceaa('0x48')](_0x5ef397,_0x2bb14c,_0x33ffa6,_0x45187c);}}else{logger['error'](_0xceaa('0x49'),_0x2e0bb9,_0x205f28[_0xceaa('0x2e')]);_0x38bc37[_0xceaa('0x42')]();}}}catch(_0x31ae47){console[_0xceaa('0x4a')](_0x31ae47);logger[_0xceaa('0x32')]('[%s][QUEUE]\x20%s',_0x2e0bb9,_0x31ae47[_0xceaa('0x4b')]);_0x38bc37['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 4d3d41e..35da740 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 _0x02ba=['[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','agents','busyQueue','showNotification','writeLog','RINGING',':FORCED'];(function(_0x5500f9,_0x5e10c6){var _0x5cb53e=function(_0x109033){while(--_0x109033){_0x5500f9['push'](_0x5500f9['shift']());}};_0x5cb53e(++_0x5e10c6);}(_0x02ba,0x72));var _0xa02b=function(_0x409d51,_0x1f0de6){_0x409d51=_0x409d51-0x0;var _0x13eb4b=_0x02ba[_0x409d51];return _0x13eb4b;};'use strict';var _=require(_0xa02b('0x0'));var uuid=require(_0xa02b('0x1'));var util=require(_0xa02b('0x2'));var logger=require(_0xa02b('0x3'))(_0xa02b('0x4'));var Agent=function(_0x27f075,_0x2e18b5,_0x17db99,_0x28b202){this[_0xa02b('0x5')]=uuid['v4']();this[_0xa02b('0x6')]=_0x27f075;this[_0xa02b('0x7')]=_0x2e18b5;this['realtime']=_0x17db99;this[_0xa02b('0x4')]=_0x28b202;this[_0xa02b('0x6')][_0xa02b('0x8')](this['handleRun'][_0xa02b('0x9')](this),this[_0xa02b('0xa')]['bind'](this));this['squeue']['on'](_0xa02b('0xb'),this[_0xa02b('0xa')]['bind'](this));this[_0xa02b('0x6')]['on'](_0xa02b('0xc'),this[_0xa02b('0xd')]['bind'](this));};Agent[_0xa02b('0xe')][_0xa02b('0x8')]=function(){this[_0xa02b('0x6')]['push'](this['handleRun'][_0xa02b('0x9')](this),this[_0xa02b('0xa')][_0xa02b('0x9')](this));};Agent[_0xa02b('0xe')][_0xa02b('0xd')]=function(){this[_0xa02b('0xa')](!![]);};Agent[_0xa02b('0xe')][_0xa02b('0xf')]=function(_0x3c59a5){logger[_0xa02b('0x10')](_0xa02b('0x11'),this[_0xa02b('0x6')]['id'],this[_0xa02b('0x7')]['id']);if(_['isNil'](this[_0xa02b('0x12')]['agents'][this[_0xa02b('0x7')]['id']])){logger[_0xa02b('0x10')](_0xa02b('0x13'),this['squeue']['id'],this[_0xa02b('0x7')]['id']);setTimeout(this[_0xa02b('0x8')][_0xa02b('0x9')](this),0x3e8);}else{if(this[_0xa02b('0x4')][_0xa02b('0x14')]||util[_0xa02b('0x15')](this[_0xa02b('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],this[_0xa02b('0x6')][_0xa02b('0x16')],![])){this['realtime']['agents'][this['agent']['id']][_0xa02b('0x17')]=!![];this[_0xa02b('0x12')][_0xa02b('0x18')][this[_0xa02b('0x7')]['id']][_0xa02b('0x19')]=undefined;util[_0xa02b('0x1a')](this['notificationId'],this[_0xa02b('0x6')]['id'],this[_0xa02b('0x12')][_0xa02b('0x18')][this[_0xa02b('0x7')]['id']],null,this['routing']);util[_0xa02b('0x1b')](this['squeue']['id'],this['realtime'][_0xa02b('0x18')][this['agent']['id']],_0xa02b('0x1c')+(this[_0xa02b('0x4')][_0xa02b('0x14')]?_0xa02b('0x1d'):''));}else{logger[_0xa02b('0x10')](_0xa02b('0x1e'),this[_0xa02b('0x6')]['id'],this[_0xa02b('0x7')]['id']);setTimeout(this[_0xa02b('0x8')][_0xa02b('0x9')](this),0x3e8);}}};Agent[_0xa02b('0xe')][_0xa02b('0xa')]=function(_0xbba9ed){if(_[_0xa02b('0x1f')](this[_0xa02b('0x12')][_0xa02b('0x18')][this[_0xa02b('0x7')]['id']])){return logger[_0xa02b('0x10')](_0xa02b('0x13'),this[_0xa02b('0x6')]['id'],this[_0xa02b('0x7')]['id']);}else{logger[_0xa02b('0x10')](_0xa02b('0x20'),this[_0xa02b('0x6')]['id'],this[_0xa02b('0x7')]['id']);util[_0xa02b('0x21')](this[_0xa02b('0x5')],this[_0xa02b('0x6')]['id'],this[_0xa02b('0x12')][_0xa02b('0x18')][this['agent']['id']],null,this[_0xa02b('0x4')]);this[_0xa02b('0x12')][_0xa02b('0x18')][this[_0xa02b('0x7')]['id']][_0xa02b('0x17')]=![];this[_0xa02b('0x12')][_0xa02b('0x18')][this['agent']['id']][_0xa02b('0x19')]=undefined;util[_0xa02b('0x1b')](this[_0xa02b('0x6')]['id'],this[_0xa02b('0x12')][_0xa02b('0x18')][this[_0xa02b('0x7')]['id']],_0xbba9ed?_0xa02b('0x22'):'TIMEOUT');}if(!_0xbba9ed){setTimeout(this[_0xa02b('0x8')][_0xa02b('0x9')](this),0x3e8);}};function agent(_0x2130cb,_0x5a963e,_0x5a5ce6,_0x45b4d0){return new Agent(_0x2130cb,_0x5a963e,_0x5a5ce6,_0x45b4d0);}module[_0xa02b('0x23')]=agent; \ No newline at end of file +var _0x9afe=[':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busy','STOP','TIMEOUT','lodash','uuid','./util','routing','notificationId','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','busyQueue','writeLog','RINGING'];(function(_0x16f77c,_0x5256b1){var _0x78986e=function(_0x10430){while(--_0x10430){_0x16f77c['push'](_0x16f77c['shift']());}};_0x78986e(++_0x5256b1);}(_0x9afe,0xc6));var _0xe9af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9afe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe9af('0x0'));var uuid=require(_0xe9af('0x1'));var util=require(_0xe9af('0x2'));var logger=require('../../../../../config/logger')(_0xe9af('0x3'));var Agent=function(_0x608eca,_0x206878,_0x6481e6,_0x5fa44d){this[_0xe9af('0x4')]=uuid['v4']();this[_0xe9af('0x5')]=_0x608eca;this[_0xe9af('0x6')]=_0x206878;this[_0xe9af('0x7')]=_0x6481e6;this[_0xe9af('0x3')]=_0x5fa44d;this[_0xe9af('0x5')][_0xe9af('0x8')](this[_0xe9af('0x9')]['bind'](this),this[_0xe9af('0xa')][_0xe9af('0xb')](this));this[_0xe9af('0x5')]['on'](_0xe9af('0xc'),this[_0xe9af('0xa')][_0xe9af('0xb')](this));this['squeue']['on'](_0xe9af('0xd'),this['handleDrained']['bind'](this));};Agent[_0xe9af('0xe')][_0xe9af('0x8')]=function(){this[_0xe9af('0x5')][_0xe9af('0x8')](this[_0xe9af('0x9')][_0xe9af('0xb')](this),this[_0xe9af('0xa')][_0xe9af('0xb')](this));};Agent[_0xe9af('0xe')][_0xe9af('0xf')]=function(){this['handleTimeout'](!![]);};Agent[_0xe9af('0xe')][_0xe9af('0x9')]=function(_0x16bdc8){logger[_0xe9af('0x10')](_0xe9af('0x11'),this[_0xe9af('0x5')]['id'],this[_0xe9af('0x6')]['id']);if(_[_0xe9af('0x12')](this[_0xe9af('0x7')]['agents'][this[_0xe9af('0x6')]['id']])){logger[_0xe9af('0x10')](_0xe9af('0x13'),this[_0xe9af('0x5')]['id'],this[_0xe9af('0x6')]['id']);setTimeout(this[_0xe9af('0x8')]['bind'](this),0x3e8);}else{if(this[_0xe9af('0x3')][_0xe9af('0x14')]||util[_0xe9af('0x15')](this[_0xe9af('0x5')]['id'],this[_0xe9af('0x7')]['agents'][this[_0xe9af('0x6')]['id']],this[_0xe9af('0x5')]['channel'],![])){this[_0xe9af('0x7')][_0xe9af('0x16')][this['agent']['id']]['busy']=!![];this[_0xe9af('0x7')][_0xe9af('0x16')][this[_0xe9af('0x6')]['id']][_0xe9af('0x17')]=undefined;util['showNotification'](this[_0xe9af('0x4')],this[_0xe9af('0x5')]['id'],this[_0xe9af('0x7')][_0xe9af('0x16')][this[_0xe9af('0x6')]['id']],null,this[_0xe9af('0x3')]);util[_0xe9af('0x18')](this[_0xe9af('0x5')]['id'],this[_0xe9af('0x7')][_0xe9af('0x16')][this[_0xe9af('0x6')]['id']],_0xe9af('0x19')+(this['routing'][_0xe9af('0x14')]?_0xe9af('0x1a'):''));}else{logger[_0xe9af('0x10')](_0xe9af('0x1b'),this['squeue']['id'],this[_0xe9af('0x6')]['id']);setTimeout(this[_0xe9af('0x8')]['bind'](this),0x3e8);}}};Agent['prototype'][_0xe9af('0xa')]=function(_0x13e325){if(_[_0xe9af('0x12')](this['realtime'][_0xe9af('0x16')][this[_0xe9af('0x6')]['id']])){return logger[_0xe9af('0x10')](_0xe9af('0x13'),this[_0xe9af('0x5')]['id'],this[_0xe9af('0x6')]['id']);}else{logger[_0xe9af('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this['agent']['id']);util[_0xe9af('0x1c')](this['notificationId'],this[_0xe9af('0x5')]['id'],this[_0xe9af('0x7')][_0xe9af('0x16')][this[_0xe9af('0x6')]['id']],null,this[_0xe9af('0x3')]);this[_0xe9af('0x7')][_0xe9af('0x16')][this[_0xe9af('0x6')]['id']][_0xe9af('0x1d')]=![];this['realtime'][_0xe9af('0x16')][this['agent']['id']][_0xe9af('0x17')]=undefined;util[_0xe9af('0x18')](this[_0xe9af('0x5')]['id'],this['realtime'][_0xe9af('0x16')][this[_0xe9af('0x6')]['id']],_0x13e325?_0xe9af('0x1e'):_0xe9af('0x1f'));}if(!_0x13e325){setTimeout(this['push'][_0xe9af('0xb')](this),0x3e8);}};function agent(_0x3ab655,_0x53fd8e,_0x5202be,_0x32a398){return new Agent(_0x3ab655,_0x53fd8e,_0x5202be,_0x32a398);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 6100add..3b43208 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 _0xe3c5=['channel','writeLog','busy','busyQueue','showNotification','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','isNil','Agents','length','agents','info'];(function(_0x49c049,_0x4bcc9c){var _0x38d57c=function(_0xe859b9){while(--_0xe859b9){_0x49c049['push'](_0x49c049['shift']());}};_0x38d57c(++_0x4bcc9c);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0xe3c5[_0x540dcb];return _0x49353c;};'use strict';var _=require(_0x5e3c('0x0'));var uuid=require(_0x5e3c('0x1'));var util=require(_0x5e3c('0x2'));var logger=require(_0x5e3c('0x3'))(_0x5e3c('0x4'));var Beepall=function(_0x383d11,_0x5b8a04,_0x46e129,_0x2ef6cd){this[_0x5e3c('0x5')]=uuid['v4']();this[_0x5e3c('0x6')]=_0x383d11;this[_0x5e3c('0x7')]=_0x5b8a04;this[_0x5e3c('0x8')]=_0x46e129;this[_0x5e3c('0x4')]=_0x2ef6cd;this[_0x5e3c('0x6')][_0x5e3c('0x9')](this[_0x5e3c('0xa')][_0x5e3c('0xb')](this),this[_0x5e3c('0xc')]['bind'](this));this['squeue']['on'](_0x5e3c('0xd'),this[_0x5e3c('0xc')][_0x5e3c('0xb')](this));this[_0x5e3c('0x6')]['on'](_0x5e3c('0xe'),this['handleDrained'][_0x5e3c('0xb')](this));};Beepall[_0x5e3c('0xf')]['push']=function(){this[_0x5e3c('0x6')]['push'](this['handleRun'][_0x5e3c('0xb')](this),this[_0x5e3c('0xc')][_0x5e3c('0xb')](this));};Beepall[_0x5e3c('0xf')][_0x5e3c('0x10')]=function(_0x30bc22){this[_0x5e3c('0xc')](!![]);};Beepall[_0x5e3c('0xf')]['handleRun']=function(_0x54937f){var _0x34d23c=!![];if(!_[_0x5e3c('0x11')](this[_0x5e3c('0x7')])&&!_['isNil'](this['queue'][_0x5e3c('0x12')])&&this[_0x5e3c('0x7')][_0x5e3c('0x12')][_0x5e3c('0x13')]>0x0){for(var _0x523a91=0x0,_0x54039a;_0x523a910x0){for(var _0x1c028b=0x0,_0x54f82a;_0x1c028b0x0&&_0x3a0bfb[_0x9dff60+'CurrentCapacity']>=_0x3a0bfb[_0x9dff60+'Capacity']){writeLog(_0x30fba2,_0x3a0bfb,_0x9dff60['toUpperCase']()+_0x97c0('0x24'));return![];}}return!![];};exports[_0x97c0('0x25')]=function(_0x3a744c,_0x225e43,_0x26939e,_0x153b14,_0x4a3645){return sendNotification(!![],_0x3a744c,_0x225e43,_0x26939e,_0x153b14,_0x4a3645);};exports[_0x97c0('0x26')]=function(_0x1c183f,_0x325090,_0x4ad645,_0x14617c,_0x148e95){return sendNotification(![],_0x1c183f,_0x325090,_0x4ad645,_0x14617c,_0x148e95);};exports[_0x97c0('0x27')]=writeLog; \ No newline at end of file +var _0xa456=['name','account','notificationSound','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','format','user:%s'];(function(_0x311831,_0x5d83aa){var _0x581097=function(_0x5a0ee){while(--_0x5a0ee){_0x311831['push'](_0x311831['shift']());}};_0x581097(++_0x5d83aa);}(_0xa456,0x142));var _0x6a45=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xa456[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var utils=require(_0x6a45('0x2'));var Mustache=require(_0x6a45('0x3'));var Redis=require('ioredis');var config=require(_0x6a45('0x4'));var logger=require(_0x6a45('0x5'))(_0x6a45('0x6'));config['redis']=_[_0x6a45('0x7')](config[_0x6a45('0x8')],{'host':_0x6a45('0x9'),'port':0x18eb});var io=require(_0x6a45('0xa'))(new Redis(config['redis']));function emit(_0x25cf8d,_0x26bfc0,_0x214514){io['to'](_0x25cf8d)[_0x6a45('0xb')](_0x26bfc0,_0x214514);}function sendNotification(_0x3deb09,_0x4858df,_0x3a5c20,_0x517040,_0x36378a,_0x3a9671){io['to'](util[_0x6a45('0xc')](_0x6a45('0xd'),_0x517040[_0x6a45('0xe')]))['emit']('user:save',_0x517040);var _0xe62823=_0x3a9671||{};var _0x465b59=_0x3a5c20['split']('.');var _0x5a39f6={'uniqueid':_0x4858df,'channel':_0x465b59[0x0],'id':_0x465b59[0x1],'title':_0x465b59[0x0]+'\x20interaction','interactionId':_0x465b59[0x2],'queue':_0x36378a?_0x36378a[_0x6a45('0xe')]:null,'sound':_0xe62823[_0x6a45('0xf')][_0x6a45('0x10')],'shake':_0xe62823[_0x6a45('0xf')][_0x6a45('0x11')]};try{if(!_0xe62823['body']){_0xe62823['body']={};}if(_0x36378a){_0xe62823[_0x6a45('0x12')][_0x6a45('0x13')]=_0x36378a;}else if(_0xe62823['body'][_0x6a45('0x13')]){delete _0xe62823[_0x6a45('0x12')][_0x6a45('0x13')];}_0x5a39f6[_0x6a45('0x14')]=utils['getMustacheRender'](_0xe62823['account']['notificationTemplate'],_0xe62823);}catch(_0x396d7d){_0x5a39f6[_0x6a45('0x14')]=_0x6a45('0x15');logger['error'](util[_0x6a45('0xc')](_0x6a45('0x16'),_0x4858df,_0x396d7d[_0x6a45('0x17')]));}io['to'](util['format']('user:%s',_0x517040['name']))[_0x6a45('0xb')](util[_0x6a45('0xc')]('notification:%s',_0x3deb09?_0x6a45('0x18'):_0x6a45('0x19')),_0x5a39f6);}function writeLog(_0x4f7000,_0x4f7110,_0xdf10c6){return logger[_0x6a45('0x1a')](util[_0x6a45('0xc')](_0x6a45('0x1b'),_0x4f7000,_0x4f7110['name'],_0xdf10c6));}exports['isAgentAvailable']=function(_0x3faae5,_0x59af4b,_0x11290c,_0x22373c){if(_0x59af4b[_0x6a45('0x1c')]){writeLog(_0x3faae5,_0x59af4b,_0x6a45('0x1d'));return![];}if(!_0x59af4b[_0x6a45('0x1e')]){writeLog(_0x3faae5,_0x59af4b,_0x6a45('0x1f'));return![];}if(_0x59af4b[_0x11290c+_0x6a45('0x20')]){writeLog(_0x3faae5,_0x59af4b,_0x6a45('0x21'));return![];}if(_0x22373c&&_0x59af4b[_0x6a45('0x22')](_0x11290c+_0x6a45('0x23'))&&_0x59af4b['hasOwnProperty'](_0x11290c+_0x6a45('0x24'))){if(_0x59af4b[_0x11290c+'Capacity']>0x0&&_0x59af4b[_0x11290c+_0x6a45('0x24')]>=_0x59af4b[_0x11290c+_0x6a45('0x23')]){writeLog(_0x3faae5,_0x59af4b,_0x11290c[_0x6a45('0x25')]()+_0x6a45('0x26'));return![];}}return!![];};exports[_0x6a45('0x27')]=function(_0x526062,_0x2b8cc8,_0x308003,_0x4770cc,_0x1ccff0){return sendNotification(!![],_0x526062,_0x2b8cc8,_0x308003,_0x4770cc,_0x1ccff0);};exports[_0x6a45('0x28')]=function(_0x227b6f,_0x3fac9b,_0x313c13,_0x54286d,_0x14adb5){return sendNotification(![],_0x227b6f,_0x3fac9b,_0x313c13,_0x54286d,_0x14adb5);};exports[_0x6a45('0x29')]=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 9439056..d83d519 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 _0xa378=['[%s][SYSTEM]\x20%s','map','join','info','next','getMustacheRender','exec','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x3525db,_0xc9aa65){var _0xb07e23=function(_0x1b1af0){while(--_0x1b1af0){_0x3525db['push'](_0x3525db['shift']());}};_0xb07e23(++_0xc9aa65);}(_0xa378,0xb9));var _0x8a37=function(_0x37e546,_0x3dd4bc){_0x37e546=_0x37e546-0x0;var _0x558aed=_0xa378[_0x37e546];return _0x558aed;};'use strict';var schema=require(_0x8a37('0x0'));var sh=require(_0x8a37('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x8a37('0x2'))(_0x8a37('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x8a37('0x4')}});exports['consequence']=function(_0x178f58,_0x2585b0){return function(_0x1806dc){try{var _0x400da5={'command':_0x2585b0[0x0]};var _0x4d8135=system[_0x8a37('0x0')](_0x400da5,{'typecast':!![]});if(_0x4d8135['length']){logger['error'](_0x8a37('0x5'),_0x178f58,_[_0x8a37('0x6')](_0x4d8135,'message')[_0x8a37('0x7')](',\x20'));logger[_0x8a37('0x8')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x178f58);_0x1806dc[_0x8a37('0x9')]();}else{var _0x1fd84f=this;var _0x521a9b=utils[_0x8a37('0xa')](_0x2585b0[0x0],this);logger[_0x8a37('0x8')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x178f58,_0x521a9b);sh[_0x8a37('0xb')](_['trim'](_0x521a9b),function(_0x21b2a1,_0x379b69){logger[_0x8a37('0x8')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x178f58,_0x21b2a1);if(_0x21b2a1==0x0){var _0x22fe4f=_0x379b69[_0x8a37('0xc')](/(\r\n|\n|\r)/gm,'');if(_[_0x8a37('0xd')](_0x2585b0[0x1])||_[_0x8a37('0xe')](_0x2585b0[0x1])){logger[_0x8a37('0x8')]('[%s][SYSTEM]\x20no\x20variable',_0x178f58);_0x1fd84f[_0x8a37('0xf')][_0x2585b0[0x1]]=_0x22fe4f;}else{logger[_0x8a37('0x8')](_0x8a37('0x10'),_0x178f58,_0x2585b0[0x1],_0x22fe4f);_0x1fd84f[_0x8a37('0xf')][_0x2585b0[0x1]]=_0x22fe4f;}}_0x1806dc[_0x8a37('0x9')]();});}}catch(_0x53aed6){logger['error'](_0x8a37('0x5'),_0x178f58,_[_0x8a37('0x11')](_0x53aed6)?JSON[_0x8a37('0x12')](_0x53aed6):_0x53aed6);logger[_0x8a37('0x8')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x178f58);_0x1806dc['next']();}};}; \ No newline at end of file +var _0x0773=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing'];(function(_0x3ac063,_0x52424f){var _0xa682d=function(_0x47af4a){while(--_0x47af4a){_0x3ac063['push'](_0x3ac063['shift']());}};_0xa682d(++_0x52424f);}(_0x0773,0x1da));var _0x3077=function(_0xafb35f,_0x5178cf){_0xafb35f=_0xafb35f-0x0;var _0x2e69f1=_0x0773[_0xafb35f];return _0x2e69f1;};'use strict';var schema=require(_0x3077('0x0'));var sh=require(_0x3077('0x1'));var _=require(_0x3077('0x2'));var utils=require(_0x3077('0x3'));var logger=require(_0x3077('0x4'))(_0x3077('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x3077('0x6')}});exports[_0x3077('0x7')]=function(_0x21de57,_0xab803f){return function(_0x2f4699){try{var _0x45a3c4={'command':_0xab803f[0x0]};var _0x47cb09=system[_0x3077('0x0')](_0x45a3c4,{'typecast':!![]});if(_0x47cb09['length']){logger[_0x3077('0x8')](_0x3077('0x9'),_0x21de57,_[_0x3077('0xa')](_0x47cb09,'message')[_0x3077('0xb')](',\x20'));logger[_0x3077('0xc')](_0x3077('0xd'),_0x21de57);_0x2f4699['next']();}else{var _0x2916c9=this;var _0x1e4f8a=utils[_0x3077('0xe')](_0xab803f[0x0],this);logger[_0x3077('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x21de57,_0x1e4f8a);sh[_0x3077('0xf')](_[_0x3077('0x10')](_0x1e4f8a),function(_0x5e97b4,_0x487323){logger['info'](_0x3077('0x11'),_0x21de57,_0x5e97b4);if(_0x5e97b4==0x0){var _0x1d01fc=_0x487323['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x3077('0x12')](_0xab803f[0x1])||_['isEmpty'](_0xab803f[0x1])){logger[_0x3077('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x21de57);_0x2916c9[_0x3077('0x13')][_0xab803f[0x1]]=_0x1d01fc;}else{logger[_0x3077('0xc')](_0x3077('0x14'),_0x21de57,_0xab803f[0x1],_0x1d01fc);_0x2916c9[_0x3077('0x13')][_0xab803f[0x1]]=_0x1d01fc;}}_0x2f4699[_0x3077('0x15')]();});}}catch(_0x158cc1){logger[_0x3077('0x8')](_0x3077('0x9'),_0x21de57,_[_0x3077('0x16')](_0x158cc1)?JSON[_0x3077('0x17')](_0x158cc1):_0x158cc1);logger[_0x3077('0xc')](_0x3077('0xd'),_0x21de57);_0x2f4699['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 66d4480..81cf8f2 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 _0xf491=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error','[%s][TAG]\x20%s','stringify','finally','isObject','lodash','../../rpc/chatInteraction'];(function(_0x331071,_0x28406d){var _0x34b5d3=function(_0x50d852){while(--_0x50d852){_0x331071['push'](_0x331071['shift']());}};_0x34b5d3(++_0x28406d);}(_0xf491,0x19c));var _0x1f49=function(_0x1b420a,_0x34c749){_0x1b420a=_0x1b420a-0x0;var _0x3e706b=_0xf491[_0x1b420a];return _0x3e706b;};'use strict';var schema=require('validate');var _=require(_0x1f49('0x0'));var rpc={'chatInteraction':require(_0x1f49('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x1f49('0x2')),'mailInteraction':require(_0x1f49('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1f49('0x4'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x1f49('0x5'),'required':!![],'message':_0x1f49('0x6')}});exports[_0x1f49('0x7')]=function(_0x129427,_0x42943b,_0x1371f8,_0x3904de){return function(_0x1139e0){try{var _0x430d58={'tag':_0x42943b[0x0]};var _0x5ed0f6=tag[_0x1f49('0x8')](_0x430d58,{'typecast':!![]});if(_0x5ed0f6['length']){logger['error']('[%s][TAG]\x20%s',_0x129427,_[_0x1f49('0x9')](_0x5ed0f6,'message')[_0x1f49('0xa')](',\x20'));logger[_0x1f49('0xb')](_0x1f49('0xc'),_0x129427);_0x1139e0[_0x1f49('0xd')]();}else{var _0x285d80={'ids':[_0x42943b[0x0]]};if(rpc[_0x3904de[_0x1f49('0xe')]+_0x1f49('0xf')]){rpc[_0x3904de['channel']+_0x1f49('0xf')][_0x1f49('0x10')](_0x3904de['interaction']['id'],_0x285d80)['then'](function(_0x128f22){logger[_0x1f49('0xb')](_0x1f49('0x11'),_0x129427,_0x42943b[0x1],_0x3904de[_0x1f49('0xe')],_0x3904de['interaction']['id']);})['catch'](function(_0x49627e){logger[_0x1f49('0x12')](_0x1f49('0x13'),_0x129427,JSON[_0x1f49('0x14')](_0x49627e));logger[_0x1f49('0xb')](_0x1f49('0xc'),_0x129427);})[_0x1f49('0x15')](function(){_0x1139e0['next']();});}}}catch(_0x5b6b23){logger[_0x1f49('0x12')]('[%s][TAG]\x20%s',_0x129427,_[_0x1f49('0x16')](_0x5b6b23)?JSON['stringify'](_0x5b6b23):_0x5b6b23);logger[_0x1f49('0xb')](_0x1f49('0xc'),_0x129427);_0x1139e0[_0x1f49('0xd')]();}};}; \ No newline at end of file +var _0x6474=['next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0xadc3fe,_0x40ce3e){var _0x5f2683=function(_0x54a4ff){while(--_0x54a4ff){_0xadc3fe['push'](_0xadc3fe['shift']());}};_0x5f2683(++_0x40ce3e);}(_0x6474,0x121));var _0x4647=function(_0x216d64,_0x46a985){_0x216d64=_0x216d64-0x0;var _0x5ec7ef=_0x6474[_0x216d64];return _0x5ec7ef;};'use strict';var schema=require(_0x4647('0x0'));var _=require(_0x4647('0x1'));var rpc={'chatInteraction':require(_0x4647('0x2')),'openchannelInteraction':require(_0x4647('0x3')),'smsInteraction':require(_0x4647('0x4')),'mailInteraction':require(_0x4647('0x5')),'faxInteraction':require(_0x4647('0x6')),'whatsappInteraction':require(_0x4647('0x7'))};var logger=require(_0x4647('0x8'))(_0x4647('0x9'));var tag=schema({'tag':{'type':_0x4647('0xa'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x4647('0xb')]=function(_0x1754fd,_0x582505,_0x580b19,_0x34da30){return function(_0x1fcd11){try{var _0x4385aa={'tag':_0x582505[0x0]};var _0x496073=tag['validate'](_0x4385aa,{'typecast':!![]});if(_0x496073[_0x4647('0xc')]){logger[_0x4647('0xd')](_0x4647('0xe'),_0x1754fd,_[_0x4647('0xf')](_0x496073,_0x4647('0x10'))['join'](',\x20'));logger[_0x4647('0x11')](_0x4647('0x12'),_0x1754fd);_0x1fcd11[_0x4647('0x13')]();}else{var _0x24cfc6={'ids':[_0x582505[0x0]]};if(rpc[_0x34da30[_0x4647('0x14')]+_0x4647('0x15')]){rpc[_0x34da30[_0x4647('0x14')]+'Interaction'][_0x4647('0x16')](_0x34da30['interaction']['id'],_0x24cfc6)[_0x4647('0x17')](function(_0x3eecba){logger[_0x4647('0x11')](_0x4647('0x18'),_0x1754fd,_0x582505[0x1],_0x34da30[_0x4647('0x14')],_0x34da30['interaction']['id']);})[_0x4647('0x19')](function(_0x563982){logger['error'](_0x4647('0xe'),_0x1754fd,JSON[_0x4647('0x1a')](_0x563982));logger[_0x4647('0x11')](_0x4647('0x12'),_0x1754fd);})['finally'](function(){_0x1fcd11[_0x4647('0x13')]();});}}}catch(_0x152747){logger[_0x4647('0xd')](_0x4647('0xe'),_0x1754fd,_[_0x4647('0x1b')](_0x152747)?JSON['stringify'](_0x152747):_0x152747);logger['info'](_0x4647('0x12'),_0x1754fd);_0x1fcd11['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 35f892a..663982a 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x566d3c,_0x4f2575){var _0x51e995=function(_0x5e6a66){while(--_0x5e6a66){_0x566d3c['push'](_0x566d3c['shift']());}};_0x51e995(++_0x4f2575);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x5c5944,_0x1eab00){var _0x3f04da=function(_0xd7472b){while(--_0xd7472b){_0x5c5944['push'](_0x5c5944['shift']());}};_0x3f04da(++_0x1eab00);}(_0xe706,0xa3));var _0x6e70=function(_0xa16401,_0x9a9949){_0xa16401=_0xa16401-0x0;var _0x3d5676=_0xe706[_0xa16401];return _0x3d5676;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index edafff8..0d3afc3 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 _0x1e91=['../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','IntervalId','isNil','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','app','toLowerCase','appdata','channel','mail','push','slice','join','dialogflow','dialogflowv2','split','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird'];(function(_0x237d18,_0x1957fc){var _0x2e8b5e=function(_0xe5863e){while(--_0xe5863e){_0x237d18['push'](_0x237d18['shift']());}};_0x2e8b5e(++_0x1957fc);}(_0x1e91,0x1d8));var _0x11e9=function(_0x526f9b,_0x458c4e){_0x526f9b=_0x526f9b-0x0;var _0x468133=_0x1e91[_0x526f9b];return _0x468133;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x11e9('0x0'));var fs=require('fs');var jayson=require(_0x11e9('0x1'));var BPromise=require(_0x11e9('0x2'));var uuid=require('uuid');var config=require(_0x11e9('0x3'));var logger=require(_0x11e9('0x4'))(_0x11e9('0x5'));var rpc={'openchannelQueueReport':require(_0x11e9('0x6')),'mailQueueReport':require(_0x11e9('0x7')),'chatQueueReport':require(_0x11e9('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x11e9('0x9'))};var RuleEngine=require(_0x11e9('0xa'));function getId(_0xb1850d,_0x5bfa7d,_0x25fa41){return util[_0x11e9('0xb')]('%s.%s.%s',_0xb1850d,_0x5bfa7d||0x0,_0x25fa41||0x0);}function getIntervals(_0x390f1d,_0xa10da0){var _0x28596d=[];if(!_['isNil'](_0xa10da0[_0x11e9('0xc')])&&!_[_0x11e9('0xd')](_0x390f1d[_0xa10da0['IntervalId']])&&!_[_0x11e9('0xd')](_0x390f1d[_0xa10da0[_0x11e9('0xc')]][_0x11e9('0xe')])){_0x28596d=_[_0x11e9('0xf')](_0x390f1d[_0xa10da0['IntervalId']][_0x11e9('0xe')],_0x11e9('0x10'));}else if(!_['isNil'](_0xa10da0['interval'])){_0x28596d=[_0xa10da0[_0x11e9('0x10')]];}return _0x28596d;}exports[_0x11e9('0x11')]=function(_0x485b72){_0x485b72[_0x11e9('0x12')]={};return new BPromise(function(_0x29b7b0,_0x14f1db){var _0x5dc9f7={'Start':function(_0x22b7ac){var _0x4b9435=this;return new Promise(function(_0x46b7ee,_0x565a96){if(_0x22b7ac){try{var _0x6a3f31=[];var _0x594c22=getId(_0x22b7ac['channel'],_0x22b7ac['message']?_0x22b7ac[_0x11e9('0x13')]['id']:0x0,_0x22b7ac[_0x11e9('0x14')]?_0x22b7ac[_0x11e9('0x14')]['id']:0x0);if(_0x22b7ac[_0x11e9('0x15')]&&_[_0x11e9('0x16')](_0x22b7ac[_0x11e9('0x15')])&&_0x22b7ac[_0x11e9('0x15')]['length']){for(var _0x21738a=0x0;_0x21738a<_0x22b7ac[_0x11e9('0x15')][_0x11e9('0x17')];_0x21738a+=0x1){var _0x525344=_0x22b7ac[_0x11e9('0x15')][_0x21738a];if(fs[_0x11e9('0x18')](path['join'](__dirname,'applications',_0x525344[_0x11e9('0x19')]+'.js'))){var _0x44aa5c=[];switch(_0x525344[_0x11e9('0x19')][_0x11e9('0x1a')]()){case'autoreply':var _0xa0414b=_0x525344[_0x11e9('0x1b')]['split'](',');if(_0x22b7ac[_0x11e9('0x1c')]===_0x11e9('0x1d')){_0x44aa5c[_0x11e9('0x1e')](_0xa0414b[0x0]);_0x44aa5c['push'](_0xa0414b[0x1]);_0x44aa5c[_0x11e9('0x1e')](_0xa0414b[_0x11e9('0x1f')](0x2,_0xa0414b[_0x11e9('0x17')])['join'](','));}else{_0x44aa5c['push'](_0xa0414b[0x0]);_0x44aa5c['push'](_0xa0414b[_0x11e9('0x1f')](0x1,_0xa0414b[_0x11e9('0x17')])[_0x11e9('0x20')](','));}break;case _0x11e9('0x21'):var _0x3c810f=_0x525344['appdata']['split'](',');_0x44aa5c['push'](_0x3c810f[0x0]);_0x44aa5c[_0x11e9('0x1e')](_0x3c810f[0x1]);_0x44aa5c[_0x11e9('0x1e')](_0x3c810f[_0x11e9('0x1f')](0x2,_0x3c810f[_0x11e9('0x17')])[_0x11e9('0x20')](','));break;case _0x11e9('0x22'):var _0x64b2ca=_0x525344[_0x11e9('0x1b')][_0x11e9('0x23')](',');_0x44aa5c[_0x11e9('0x1e')](_0x64b2ca[0x0]);_0x44aa5c[_0x11e9('0x1e')](_0x64b2ca[0x1]);_0x44aa5c[_0x11e9('0x1e')](_0x64b2ca[0x2]);_0x44aa5c[_0x11e9('0x1e')](_0x64b2ca[0x3]);_0x44aa5c[_0x11e9('0x1e')](_0x64b2ca['slice'](0x4,_0x64b2ca[_0x11e9('0x17')])['join'](','));break;case'amazonlex':var _0x3ce912=_0x525344[_0x11e9('0x1b')][_0x11e9('0x23')](',');_0x44aa5c[_0x11e9('0x1e')](_0x3ce912[0x0]);_0x44aa5c[_0x11e9('0x1e')](_0x3ce912[0x1]);_0x44aa5c[_0x11e9('0x1e')](_0x3ce912[0x2]);_0x44aa5c[_0x11e9('0x1e')](_0x3ce912[0x3]);_0x44aa5c[_0x11e9('0x1e')](_0x3ce912['slice'](0x4,_0x3ce912['length'])[_0x11e9('0x20')](','));break;case _0x11e9('0x13'):_0x44aa5c[_0x11e9('0x1e')](_0x525344[_0x11e9('0x1b')]);break;case _0x11e9('0x24'):_0x44aa5c[_0x11e9('0x1e')](_0x525344[_0x11e9('0x25')]);_0x44aa5c[_0x11e9('0x1e')](_0x525344[_0x11e9('0x1b')]);break;default:_0x44aa5c=_[_0x11e9('0xd')](_0x525344[_0x11e9('0x1b')])?[]:_0x525344[_0x11e9('0x1b')][_0x11e9('0x23')](',');}var _0x3e5eb0={'id':util[_0x11e9('0xb')](_0x11e9('0x26'),_0x594c22,_0x525344['id'],_0x525344['app']),'condition':require(_0x11e9('0x27'))[_0x11e9('0x28')](_0x594c22,getIntervals(_0x485b72[_0x11e9('0x29')],_0x525344),_0x485b72),'consequence':require(_0x11e9('0x2a')+_0x525344[_0x11e9('0x19')])['consequence'](_0x594c22,_0x44aa5c,_0x485b72,_0x22b7ac),'p':_0x525344[_0x11e9('0x2b')]||0x0};logger[_0x11e9('0x2c')](_0x11e9('0x2d'),_0x3e5eb0['id'],'on\x20interval',getIntervals(_0x485b72[_0x11e9('0x29')],_0x525344)[_0x11e9('0x20')](_0x11e9('0x2e')));_0x6a3f31['push'](_0x3e5eb0);}else{logger[_0x11e9('0x2f')](_0x11e9('0x30'),path[_0x11e9('0x20')](__dirname,_0x11e9('0x15'),_0x525344[_0x11e9('0x19')]+_0x11e9('0x31')));}}_0x485b72[_0x11e9('0x12')][_0x594c22]=new RuleEngine(_0x6a3f31);_0x485b72[_0x11e9('0x12')][_0x594c22][_0x11e9('0x32')](_0x22b7ac,function(_0x35b86c){logger[_0x11e9('0x2c')](_0x11e9('0x33'),JSON[_0x11e9('0x34')](_0x35b86c[_0x11e9('0x35')]));if(_0x485b72[_0x11e9('0x12')][_0x594c22]){_0x485b72[_0x11e9('0x12')][_0x594c22][_0x11e9('0x36')](_0x11e9('0x37'));}});return _0x46b7ee({'code':0xc8,'message':_0x22b7ac});}else{logger[_0x11e9('0x2c')]('No\x20applications\x20to\x20execute');return _0x46b7ee({'code':0xc8,'message':_0x22b7ac});}}catch(_0x409b1f){logger[_0x11e9('0x2f')](_0x409b1f[_0x11e9('0x38')]);return _0x565a96(_0x4b9435['error'](0x1f4,_0x409b1f));}}return _0x565a96(_0x11e9('0x39'));});},'AcceptMessage':function(_0x529923){var _0x553a0c=this;return new Promise(function(_0x13e4df,_0x2478cd){if(_0x529923[_0x11e9('0x3a')]&&_0x529923[_0x11e9('0x3a')]['id']){if(_0x485b72['agents'][_0x529923[_0x11e9('0x3a')]['id']]){_0x485b72[_0x11e9('0x3b')][_0x529923['agent']['id']][_0x11e9('0x3c')]=![];_0x485b72['agents'][_0x529923['agent']['id']][_0x11e9('0x3d')]=undefined;}}if(_0x529923[_0x11e9('0x13')]&&_0x529923[_0x11e9('0x13')]['id']){try{var _0x1515fb=getId(_0x529923[_0x11e9('0x1c')],_0x529923['message']?_0x529923['message']['id']:0x0,_0x529923['interaction']?_0x529923[_0x11e9('0x14')]['id']:0x0);if(_0x485b72[_0x11e9('0x12')][_0x1515fb]){_0x485b72['rules'][_0x1515fb]['emit']('end');if(rpc[_0x529923[_0x11e9('0x1c')]+_0x11e9('0x3e')]){rpc[_0x529923['channel']+_0x11e9('0x3e')][_0x11e9('0x3f')](_0x1515fb,{'UserId':_0x529923['message'][_0x11e9('0x40')]})[_0x11e9('0x41')](function(_0x2f8956){logger['error'](_0x11e9('0x42'));});}}return _0x13e4df({'code':0xc8,'message':_0x529923});}catch(_0x24c0f2){logger[_0x11e9('0x2f')](_0x24c0f2[_0x11e9('0x38')]);return _0x2478cd(_0x553a0c[_0x11e9('0x2f')](0x1f4,_0x24c0f2));}}logger[_0x11e9('0x2f')](_0x11e9('0x43'));return _0x2478cd(_0x553a0c[_0x11e9('0x2f')](0x1f4,_0x11e9('0x43')));});},'RejectMessage':function(_0x50c19d){var _0x1a5686=this;return new Promise(function(_0x127dd7,_0x2dd89d){if(_0x50c19d['agent']&&_0x50c19d['agent']['id']){try{if(_0x485b72[_0x11e9('0x3b')][_0x50c19d[_0x11e9('0x3a')]['id']]){_0x485b72[_0x11e9('0x3b')][_0x50c19d[_0x11e9('0x3a')]['id']]['busy']=![];_0x485b72[_0x11e9('0x3b')][_0x50c19d[_0x11e9('0x3a')]['id']]['busyQueue']=undefined;}return _0x127dd7({'code':0xc8,'message':_0x50c19d});}catch(_0x48dcea){logger[_0x11e9('0x2f')](_0x48dcea[_0x11e9('0x38')]);return _0x2dd89d(_0x1a5686[_0x11e9('0x2f')](0x1f4,_0x48dcea));}}logger[_0x11e9('0x2f')]('message\x20is\x20empty');return _0x2dd89d(_0x1a5686['error'](0x1f4,_0x11e9('0x43')));});},'AbandonInteraction':function(_0x57d76f){var _0x147146=this;return new Promise(function(_0x2c7e06,_0x1a75c9){if(_0x57d76f[_0x11e9('0x1c')]&&_0x57d76f[_0x11e9('0x14')]&&_0x57d76f[_0x11e9('0x14')]['id']){try{var _0x40e777=getId(_0x57d76f[_0x11e9('0x1c')],_0x57d76f[_0x11e9('0x13')]?_0x57d76f[_0x11e9('0x13')]['id']:0x0,_0x57d76f[_0x11e9('0x14')]?_0x57d76f[_0x11e9('0x14')]['id']:0x0);if(_0x485b72[_0x11e9('0x12')][_0x40e777]){_0x485b72[_0x11e9('0x12')][_0x40e777][_0x11e9('0x36')](_0x11e9('0x44'));}return _0x2c7e06({'code':0xc8,'message':_0x57d76f});}catch(_0x2d3c10){logger[_0x11e9('0x2f')](_0x2d3c10[_0x11e9('0x38')]);return _0x1a75c9(_0x147146[_0x11e9('0x2f')](0x1f4,_0x2d3c10));}}logger[_0x11e9('0x2f')](_0x11e9('0x43'));return _0x1a75c9(_0x147146[_0x11e9('0x2f')](0x1f4,_0x11e9('0x43')));});},'AgentCapacity':function(_0x8eccb){var _0x38f9a6=this;return new Promise(function(_0x33416d,_0xa2157b){if(_0x485b72[_0x11e9('0x3b')]['hasOwnProperty'](_0x8eccb['id'])){for(var _0x7be87e in _0x8eccb[_0x11e9('0x45')]){if(_0x8eccb[_0x11e9('0x45')][_0x11e9('0x46')](_0x7be87e)){if(_0x485b72[_0x11e9('0x3b')][_0x8eccb['id']][_0x11e9('0x46')](_0x7be87e+_0x11e9('0x47'))){_0x485b72[_0x11e9('0x3b')][_0x8eccb['id']][_0x7be87e+'CurrentCapacity']=parseInt(_0x8eccb[_0x11e9('0x45')][_0x7be87e],0xa);}}}_0x485b72[_0x11e9('0x3b')][_0x8eccb['id']]['updateRealtime']();return _0x33416d({'code':0xc8,'message':_0x485b72[_0x11e9('0x3b')][_0x8eccb['id']]});}else{return _0xa2157b(_0x38f9a6['error'](0x1f4,_0x11e9('0x48')));}});},'Agents':function(_0x18d231){return new Promise(function(_0x2087c5,_0x13f588){var _0x22beaf=_[_0x11e9('0x49')](_0x485b72['agents']);_0x2087c5({'count':_0x22beaf[_0x11e9('0x17')],'rows':_0x22beaf});});},'ChatQueues':function(_0x4086fb){return new Promise(function(_0x927b03,_0x1410a5){var _0x1c0efd=[];for(var _0x1f9780 in _0x485b72[_0x11e9('0x4a')]){if(_0x485b72['chatQueues'][_0x11e9('0x46')](_0x1f9780)){var _0x436788=_0x485b72[_0x11e9('0x4a')][_0x1f9780];var _0x3f6079={'id':_0x436788['id'],'available':_0x436788[_0x11e9('0x4b')],'loggedIn':_0x436788['loggedIn'],'name':_0x436788[_0x11e9('0x4c')],'paused':_0x436788[_0x11e9('0x4d')],'waiting':_0x436788[_0x11e9('0x4e')]};_0x1c0efd[_0x11e9('0x1e')](_0x3f6079);}}_0x927b03({'count':_0x1c0efd[_0x11e9('0x17')],'rows':_0x1c0efd});});},'MailQueues':function(_0x18d414){return new Promise(function(_0xcc0601,_0x14432){var _0xee9c10=[];for(var _0x1b07ca in _0x485b72[_0x11e9('0x4f')]){if(_0x485b72[_0x11e9('0x4f')][_0x11e9('0x46')](_0x1b07ca)){var _0x3cb792=_0x485b72[_0x11e9('0x4f')][_0x1b07ca];var _0x4b511d={'id':_0x3cb792['id'],'available':_0x3cb792[_0x11e9('0x4b')],'loggedIn':_0x3cb792[_0x11e9('0x50')],'name':_0x3cb792[_0x11e9('0x4c')],'paused':_0x3cb792['paused'],'waiting':_0x3cb792[_0x11e9('0x4e')]};_0xee9c10[_0x11e9('0x1e')](_0x4b511d);}}_0xcc0601({'count':_0xee9c10[_0x11e9('0x17')],'rows':_0xee9c10});});},'OpenchannelQueues':function(_0x3e9e22){return new Promise(function(_0xa08527,_0x42b211){var _0x4ff622=[];for(var _0x34431c in _0x485b72[_0x11e9('0x51')]){if(_0x485b72[_0x11e9('0x51')][_0x11e9('0x46')](_0x34431c)){var _0xd58acb=_0x485b72[_0x11e9('0x51')][_0x34431c];var _0xae0b56={'id':_0xd58acb['id'],'available':_0xd58acb[_0x11e9('0x4b')],'loggedIn':_0xd58acb['loggedIn'],'name':_0xd58acb[_0x11e9('0x4c')],'paused':_0xd58acb['paused'],'waiting':_0xd58acb[_0x11e9('0x4e')]};_0x4ff622[_0x11e9('0x1e')](_0xae0b56);}}_0xa08527({'count':_0x4ff622['length'],'rows':_0x4ff622});});},'SmsQueues':function(_0x11e853){return new Promise(function(_0x363dce,_0x403164){var _0x5cd1a2=[];for(var _0x22851d in _0x485b72[_0x11e9('0x52')]){if(_0x485b72[_0x11e9('0x52')][_0x11e9('0x46')](_0x22851d)){var _0x2cd7a1=_0x485b72[_0x11e9('0x52')][_0x22851d];var _0x1a48cf={'id':_0x2cd7a1['id'],'available':_0x2cd7a1['available'],'loggedIn':_0x2cd7a1['loggedIn'],'name':_0x2cd7a1[_0x11e9('0x4c')],'paused':_0x2cd7a1[_0x11e9('0x4d')],'waiting':_0x2cd7a1['waiting']};_0x5cd1a2['push'](_0x1a48cf);}}_0x363dce({'count':_0x5cd1a2[_0x11e9('0x17')],'rows':_0x5cd1a2});});},'FaxQueues':function(_0x9593ea){return new Promise(function(_0x35c9c6,_0x15830d){var _0xc76c85=[];for(var _0xb0deea in _0x485b72[_0x11e9('0x53')]){if(_0x485b72[_0x11e9('0x53')]['hasOwnProperty'](_0xb0deea)){var _0x3cabdd=_0x485b72[_0x11e9('0x53')][_0xb0deea];var _0xa0d2f9={'id':_0x3cabdd['id'],'available':_0x3cabdd[_0x11e9('0x4b')],'loggedIn':_0x3cabdd['loggedIn'],'name':_0x3cabdd[_0x11e9('0x4c')],'paused':_0x3cabdd['paused'],'waiting':_0x3cabdd[_0x11e9('0x4e')]};_0xc76c85[_0x11e9('0x1e')](_0xa0d2f9);}}_0x35c9c6({'count':_0xc76c85['length'],'rows':_0xc76c85});});},'WhatsappQueues':function(_0x1c3a18){return new Promise(function(_0x29daa1,_0x5571f6){var _0x2d1539=[];for(var _0x64cc95 in _0x485b72[_0x11e9('0x54')]){if(_0x485b72[_0x11e9('0x54')][_0x11e9('0x46')](_0x64cc95)){var _0x14ec04=_0x485b72[_0x11e9('0x54')][_0x64cc95];var _0x2f0fb7={'id':_0x14ec04['id'],'available':_0x14ec04[_0x11e9('0x4b')],'loggedIn':_0x14ec04[_0x11e9('0x50')],'name':_0x14ec04[_0x11e9('0x4c')],'paused':_0x14ec04[_0x11e9('0x4d')],'waiting':_0x14ec04[_0x11e9('0x4e')]};_0x2d1539[_0x11e9('0x1e')](_0x2f0fb7);}}_0x29daa1({'count':_0x2d1539[_0x11e9('0x17')],'rows':_0x2d1539});});},'ChatQueuesWaitingInteractions':function(_0xd8dce){return new Promise(function(_0x1661d6,_0x37071e){var _0xe35252=_[_0x11e9('0x49')](_0x485b72[_0x11e9('0x55')]);_0x1661d6({'count':_0xe35252[_0x11e9('0x17')],'rows':_0xe35252});});},'MailQueuesWaitingInteractions':function(_0x5a328f){return new Promise(function(_0x108c88,_0x114e1c){var _0x42c440=_['values'](_0x485b72[_0x11e9('0x56')]);_0x108c88({'count':_0x42c440[_0x11e9('0x17')],'rows':_0x42c440});});},'OpenchannelQueuesWaitingInteractions':function(_0x561975){return new Promise(function(_0x4411de,_0x2350a8){var _0x220daf=_[_0x11e9('0x49')](_0x485b72[_0x11e9('0x57')]);_0x4411de({'count':_0x220daf['length'],'rows':_0x220daf});});},'SmsQueuesWaitingInteractions':function(_0x498a16){return new Promise(function(_0x49f3c7,_0x1bb0e6){var _0xa5c754=_['values'](_0x485b72[_0x11e9('0x58')]);_0x49f3c7({'count':_0xa5c754[_0x11e9('0x17')],'rows':_0xa5c754});});},'FaxQueuesWaitingInteractions':function(_0x5ce527){return new Promise(function(_0x59a3a0,_0x3126ef){var _0x15339b=_[_0x11e9('0x49')](_0x485b72[_0x11e9('0x59')]);_0x59a3a0({'count':_0x15339b[_0x11e9('0x17')],'rows':_0x15339b});});},'WhatsappQueuesWaitingInteractions':function(_0x365f98){return new Promise(function(_0x482a0a,_0x2868c3){var _0x45d69f=_['values'](_0x485b72['whatsappQueuesWaitingInteractions']);_0x482a0a({'count':_0x45d69f['length'],'rows':_0x45d69f});});}};var _0x4cc0fe=jayson[_0x11e9('0x5a')](_0x5dc9f7)[_0x11e9('0x5b')]();_0x4cc0fe['on'](_0x11e9('0x2f'),function(_0x34396a){logger['error'](JSON[_0x11e9('0x34')](_0x34396a));return _0x14f1db(_0x34396a);});_0x4cc0fe[_0x11e9('0x11')](0x232c,_0x11e9('0x5c'),function(){console[_0x11e9('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x29b7b0(_0x11e9('0x5e')+0x232c);});});}; \ No newline at end of file +var _0xa00e=['interaction','applications','isArray','length','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','app','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','agent','agents','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','map','interval','listen','channel','message'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xa00e,0x170));var _0xea00=function(_0x3b9743,_0x1613dd){_0x3b9743=_0x3b9743-0x0;var _0x25c5b3=_0xa00e[_0x3b9743];return _0x25c5b3;};'use strict';var _=require(_0xea00('0x0'));var util=require('util');var path=require(_0xea00('0x1'));var fs=require('fs');var jayson=require(_0xea00('0x2'));var BPromise=require(_0xea00('0x3'));var uuid=require(_0xea00('0x4'));var config=require(_0xea00('0x5'));var logger=require('../../../config/logger')(_0xea00('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xea00('0x7')),'chatQueueReport':require(_0xea00('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xea00('0x9')),'whatsappQueueReport':require(_0xea00('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x554a52,_0x33c525,_0xec9168){return util[_0xea00('0xb')](_0xea00('0xc'),_0x554a52,_0x33c525||0x0,_0xec9168||0x0);}function getIntervals(_0x2554a2,_0x3ea5f3){var _0x4515bd=[];if(!_[_0xea00('0xd')](_0x3ea5f3[_0xea00('0xe')])&&!_['isNil'](_0x2554a2[_0x3ea5f3['IntervalId']])&&!_[_0xea00('0xd')](_0x2554a2[_0x3ea5f3['IntervalId']]['Intervals'])){_0x4515bd=_[_0xea00('0xf')](_0x2554a2[_0x3ea5f3[_0xea00('0xe')]]['Intervals'],'interval');}else if(!_['isNil'](_0x3ea5f3[_0xea00('0x10')])){_0x4515bd=[_0x3ea5f3[_0xea00('0x10')]];}return _0x4515bd;}exports[_0xea00('0x11')]=function(_0x4cda98){_0x4cda98['rules']={};return new BPromise(function(_0x3bbb40,_0x414356){var _0x460215={'Start':function(_0x438fce){var _0x44140a=this;return new Promise(function(_0x3a00a5,_0x400663){if(_0x438fce){try{var _0x3fdfb7=[];var _0x126430=getId(_0x438fce[_0xea00('0x12')],_0x438fce['message']?_0x438fce[_0xea00('0x13')]['id']:0x0,_0x438fce[_0xea00('0x14')]?_0x438fce[_0xea00('0x14')]['id']:0x0);if(_0x438fce[_0xea00('0x15')]&&_[_0xea00('0x16')](_0x438fce['applications'])&&_0x438fce[_0xea00('0x15')][_0xea00('0x17')]){for(var _0x5e9e85=0x0;_0x5e9e85<_0x438fce[_0xea00('0x15')][_0xea00('0x17')];_0x5e9e85+=0x1){var _0x3f04e4=_0x438fce[_0xea00('0x15')][_0x5e9e85];if(fs['existsSync'](path['join'](__dirname,_0xea00('0x15'),_0x3f04e4['app']+_0xea00('0x18')))){var _0x2deb5d=[];switch(_0x3f04e4['app'][_0xea00('0x19')]()){case _0xea00('0x1a'):var _0x4a5f29=_0x3f04e4[_0xea00('0x1b')][_0xea00('0x1c')](',');if(_0x438fce[_0xea00('0x12')]===_0xea00('0x1d')){_0x2deb5d[_0xea00('0x1e')](_0x4a5f29[0x0]);_0x2deb5d[_0xea00('0x1e')](_0x4a5f29[0x1]);_0x2deb5d[_0xea00('0x1e')](_0x4a5f29[_0xea00('0x1f')](0x2,_0x4a5f29[_0xea00('0x17')])[_0xea00('0x20')](','));}else{_0x2deb5d[_0xea00('0x1e')](_0x4a5f29[0x0]);_0x2deb5d[_0xea00('0x1e')](_0x4a5f29[_0xea00('0x1f')](0x1,_0x4a5f29[_0xea00('0x17')])[_0xea00('0x20')](','));}break;case'dialogflow':var _0x3a6d2f=_0x3f04e4['appdata']['split'](',');_0x2deb5d[_0xea00('0x1e')](_0x3a6d2f[0x0]);_0x2deb5d['push'](_0x3a6d2f[0x1]);_0x2deb5d[_0xea00('0x1e')](_0x3a6d2f[_0xea00('0x1f')](0x2,_0x3a6d2f[_0xea00('0x17')])[_0xea00('0x20')](','));break;case _0xea00('0x21'):var _0x3ac5d0=_0x3f04e4[_0xea00('0x1b')][_0xea00('0x1c')](',');_0x2deb5d[_0xea00('0x1e')](_0x3ac5d0[0x0]);_0x2deb5d[_0xea00('0x1e')](_0x3ac5d0[0x1]);_0x2deb5d['push'](_0x3ac5d0[0x2]);_0x2deb5d['push'](_0x3ac5d0[0x3]);_0x2deb5d[_0xea00('0x1e')](_0x3ac5d0[_0xea00('0x1f')](0x4,_0x3ac5d0[_0xea00('0x17')])['join'](','));break;case _0xea00('0x22'):var _0x30656c=_0x3f04e4[_0xea00('0x1b')][_0xea00('0x1c')](',');_0x2deb5d[_0xea00('0x1e')](_0x30656c[0x0]);_0x2deb5d['push'](_0x30656c[0x1]);_0x2deb5d['push'](_0x30656c[0x2]);_0x2deb5d[_0xea00('0x1e')](_0x30656c[0x3]);_0x2deb5d[_0xea00('0x1e')](_0x30656c[_0xea00('0x1f')](0x4,_0x30656c[_0xea00('0x17')])[_0xea00('0x20')](','));break;case'message':_0x2deb5d[_0xea00('0x1e')](_0x3f04e4[_0xea00('0x1b')]);break;case _0xea00('0x23'):_0x2deb5d['push'](_0x3f04e4[_0xea00('0x24')]);_0x2deb5d[_0xea00('0x1e')](_0x3f04e4[_0xea00('0x1b')]);break;default:_0x2deb5d=_['isNil'](_0x3f04e4[_0xea00('0x1b')])?[]:_0x3f04e4[_0xea00('0x1b')][_0xea00('0x1c')](',');}var _0x30bc48={'id':util[_0xea00('0xb')](_0xea00('0x25'),_0x126430,_0x3f04e4['id'],_0x3f04e4[_0xea00('0x26')]),'condition':require(_0xea00('0x27'))[_0xea00('0x28')](_0x126430,getIntervals(_0x4cda98[_0xea00('0x29')],_0x3f04e4),_0x4cda98),'consequence':require(_0xea00('0x2a')+_0x3f04e4[_0xea00('0x26')])[_0xea00('0x2b')](_0x126430,_0x2deb5d,_0x4cda98,_0x438fce),'p':_0x3f04e4[_0xea00('0x2c')]||0x0};logger[_0xea00('0x2d')](_0xea00('0x2e'),_0x30bc48['id'],_0xea00('0x2f'),getIntervals(_0x4cda98[_0xea00('0x29')],_0x3f04e4)[_0xea00('0x20')](_0xea00('0x30')));_0x3fdfb7[_0xea00('0x1e')](_0x30bc48);}else{logger[_0xea00('0x31')](_0xea00('0x32'),path[_0xea00('0x20')](__dirname,_0xea00('0x15'),_0x3f04e4[_0xea00('0x26')]+'.js'));}}_0x4cda98[_0xea00('0x33')][_0x126430]=new RuleEngine(_0x3fdfb7);_0x4cda98['rules'][_0x126430][_0xea00('0x34')](_0x438fce,function(_0x4852bc){logger[_0xea00('0x2d')](_0xea00('0x35'),JSON[_0xea00('0x36')](_0x4852bc[_0xea00('0x37')]));if(_0x4cda98[_0xea00('0x33')][_0x126430]){_0x4cda98['rules'][_0x126430][_0xea00('0x38')](_0xea00('0x39'));}});return _0x3a00a5({'code':0xc8,'message':_0x438fce});}else{logger[_0xea00('0x2d')](_0xea00('0x3a'));return _0x3a00a5({'code':0xc8,'message':_0x438fce});}}catch(_0x12926a){logger[_0xea00('0x31')](_0x12926a['stack']);return _0x400663(_0x44140a['error'](0x1f4,_0x12926a));}}return _0x400663('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3fb31d){var _0x5f1302=this;return new Promise(function(_0x51bb39,_0x309e1f){if(_0x3fb31d[_0xea00('0x3b')]&&_0x3fb31d[_0xea00('0x3b')]['id']){if(_0x4cda98[_0xea00('0x3c')][_0x3fb31d[_0xea00('0x3b')]['id']]){_0x4cda98[_0xea00('0x3c')][_0x3fb31d[_0xea00('0x3b')]['id']][_0xea00('0x3d')]=![];_0x4cda98[_0xea00('0x3c')][_0x3fb31d['agent']['id']][_0xea00('0x3e')]=undefined;}}if(_0x3fb31d[_0xea00('0x13')]&&_0x3fb31d[_0xea00('0x13')]['id']){try{var _0x18f967=getId(_0x3fb31d['channel'],_0x3fb31d[_0xea00('0x13')]?_0x3fb31d[_0xea00('0x13')]['id']:0x0,_0x3fb31d[_0xea00('0x14')]?_0x3fb31d['interaction']['id']:0x0);if(_0x4cda98['rules'][_0x18f967]){_0x4cda98[_0xea00('0x33')][_0x18f967][_0xea00('0x38')](_0xea00('0x3f'));if(rpc[_0x3fb31d['channel']+_0xea00('0x40')]){rpc[_0x3fb31d[_0xea00('0x12')]+_0xea00('0x40')][_0xea00('0x41')](_0x18f967,{'UserId':_0x3fb31d[_0xea00('0x13')]['UserId']})[_0xea00('0x42')](function(_0x1dc2e7){logger[_0xea00('0x31')](_0xea00('0x43'));});}}return _0x51bb39({'code':0xc8,'message':_0x3fb31d});}catch(_0x513ef5){logger[_0xea00('0x31')](_0x513ef5[_0xea00('0x44')]);return _0x309e1f(_0x5f1302['error'](0x1f4,_0x513ef5));}}logger[_0xea00('0x31')](_0xea00('0x45'));return _0x309e1f(_0x5f1302[_0xea00('0x31')](0x1f4,_0xea00('0x45')));});},'RejectMessage':function(_0x3cd9ab){var _0x238b32=this;return new Promise(function(_0xab9f5,_0x174680){if(_0x3cd9ab[_0xea00('0x3b')]&&_0x3cd9ab[_0xea00('0x3b')]['id']){try{if(_0x4cda98[_0xea00('0x3c')][_0x3cd9ab['agent']['id']]){_0x4cda98[_0xea00('0x3c')][_0x3cd9ab[_0xea00('0x3b')]['id']]['busy']=![];_0x4cda98[_0xea00('0x3c')][_0x3cd9ab[_0xea00('0x3b')]['id']]['busyQueue']=undefined;}return _0xab9f5({'code':0xc8,'message':_0x3cd9ab});}catch(_0x4afcf0){logger[_0xea00('0x31')](_0x4afcf0['stack']);return _0x174680(_0x238b32['error'](0x1f4,_0x4afcf0));}}logger[_0xea00('0x31')]('message\x20is\x20empty');return _0x174680(_0x238b32[_0xea00('0x31')](0x1f4,_0xea00('0x45')));});},'AbandonInteraction':function(_0x5cbace){var _0x20c670=this;return new Promise(function(_0x3949a5,_0x316aa3){if(_0x5cbace[_0xea00('0x12')]&&_0x5cbace[_0xea00('0x14')]&&_0x5cbace['interaction']['id']){try{var _0x52ec5a=getId(_0x5cbace[_0xea00('0x12')],_0x5cbace[_0xea00('0x13')]?_0x5cbace[_0xea00('0x13')]['id']:0x0,_0x5cbace[_0xea00('0x14')]?_0x5cbace['interaction']['id']:0x0);if(_0x4cda98[_0xea00('0x33')][_0x52ec5a]){_0x4cda98[_0xea00('0x33')][_0x52ec5a][_0xea00('0x38')]('end');}return _0x3949a5({'code':0xc8,'message':_0x5cbace});}catch(_0x55f6ed){logger[_0xea00('0x31')](_0x55f6ed[_0xea00('0x44')]);return _0x316aa3(_0x20c670[_0xea00('0x31')](0x1f4,_0x55f6ed));}}logger[_0xea00('0x31')](_0xea00('0x45'));return _0x316aa3(_0x20c670[_0xea00('0x31')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0xaccc70){var _0x5e2f19=this;return new Promise(function(_0x355e0f,_0x353002){if(_0x4cda98[_0xea00('0x3c')][_0xea00('0x46')](_0xaccc70['id'])){for(var _0x2ec701 in _0xaccc70['capacity']){if(_0xaccc70[_0xea00('0x47')][_0xea00('0x46')](_0x2ec701)){if(_0x4cda98[_0xea00('0x3c')][_0xaccc70['id']][_0xea00('0x46')](_0x2ec701+_0xea00('0x48'))){_0x4cda98[_0xea00('0x3c')][_0xaccc70['id']][_0x2ec701+_0xea00('0x48')]=parseInt(_0xaccc70[_0xea00('0x47')][_0x2ec701],0xa);}}}_0x4cda98[_0xea00('0x3c')][_0xaccc70['id']][_0xea00('0x49')]();return _0x355e0f({'code':0xc8,'message':_0x4cda98[_0xea00('0x3c')][_0xaccc70['id']]});}else{return _0x353002(_0x5e2f19['error'](0x1f4,_0xea00('0x4a')));}});},'Agents':function(_0x171bdf){return new Promise(function(_0x44ab8e,_0x535b06){var _0x12c1b0=_[_0xea00('0x4b')](_0x4cda98[_0xea00('0x3c')]);_0x44ab8e({'count':_0x12c1b0['length'],'rows':_0x12c1b0});});},'ChatQueues':function(_0x2d820a){return new Promise(function(_0x2cce86,_0x4312f2){var _0x2b8247=[];for(var _0x45e335 in _0x4cda98[_0xea00('0x4c')]){if(_0x4cda98[_0xea00('0x4c')][_0xea00('0x46')](_0x45e335)){var _0x238472=_0x4cda98[_0xea00('0x4c')][_0x45e335];var _0xab8f88={'id':_0x238472['id'],'available':_0x238472[_0xea00('0x4d')],'loggedIn':_0x238472[_0xea00('0x4e')],'name':_0x238472[_0xea00('0x4f')],'paused':_0x238472[_0xea00('0x50')],'waiting':_0x238472[_0xea00('0x51')]};_0x2b8247[_0xea00('0x1e')](_0xab8f88);}}_0x2cce86({'count':_0x2b8247[_0xea00('0x17')],'rows':_0x2b8247});});},'MailQueues':function(_0x5e928a){return new Promise(function(_0x58e243,_0x111885){var _0x3dca5e=[];for(var _0x478e4c in _0x4cda98['mailQueues']){if(_0x4cda98[_0xea00('0x52')][_0xea00('0x46')](_0x478e4c)){var _0x37fa5f=_0x4cda98['mailQueues'][_0x478e4c];var _0x41be7f={'id':_0x37fa5f['id'],'available':_0x37fa5f[_0xea00('0x4d')],'loggedIn':_0x37fa5f[_0xea00('0x4e')],'name':_0x37fa5f[_0xea00('0x4f')],'paused':_0x37fa5f[_0xea00('0x50')],'waiting':_0x37fa5f[_0xea00('0x51')]};_0x3dca5e['push'](_0x41be7f);}}_0x58e243({'count':_0x3dca5e[_0xea00('0x17')],'rows':_0x3dca5e});});},'OpenchannelQueues':function(_0x329c0a){return new Promise(function(_0x22b906,_0x475819){var _0x45ef9d=[];for(var _0x1ab3b1 in _0x4cda98[_0xea00('0x53')]){if(_0x4cda98[_0xea00('0x53')][_0xea00('0x46')](_0x1ab3b1)){var _0x2a9179=_0x4cda98['openchannelQueues'][_0x1ab3b1];var _0x327e49={'id':_0x2a9179['id'],'available':_0x2a9179[_0xea00('0x4d')],'loggedIn':_0x2a9179[_0xea00('0x4e')],'name':_0x2a9179[_0xea00('0x4f')],'paused':_0x2a9179[_0xea00('0x50')],'waiting':_0x2a9179[_0xea00('0x51')]};_0x45ef9d[_0xea00('0x1e')](_0x327e49);}}_0x22b906({'count':_0x45ef9d[_0xea00('0x17')],'rows':_0x45ef9d});});},'SmsQueues':function(_0x407cf9){return new Promise(function(_0xe9e0d1,_0x31f2cd){var _0xe7f2df=[];for(var _0x235e15 in _0x4cda98[_0xea00('0x54')]){if(_0x4cda98[_0xea00('0x54')][_0xea00('0x46')](_0x235e15)){var _0x1b800e=_0x4cda98['smsQueues'][_0x235e15];var _0x2479f6={'id':_0x1b800e['id'],'available':_0x1b800e[_0xea00('0x4d')],'loggedIn':_0x1b800e[_0xea00('0x4e')],'name':_0x1b800e[_0xea00('0x4f')],'paused':_0x1b800e[_0xea00('0x50')],'waiting':_0x1b800e[_0xea00('0x51')]};_0xe7f2df[_0xea00('0x1e')](_0x2479f6);}}_0xe9e0d1({'count':_0xe7f2df[_0xea00('0x17')],'rows':_0xe7f2df});});},'FaxQueues':function(_0x214ba3){return new Promise(function(_0x1ecea0,_0x50faab){var _0x1e101d=[];for(var _0x4e07bb in _0x4cda98['faxQueues']){if(_0x4cda98[_0xea00('0x55')]['hasOwnProperty'](_0x4e07bb)){var _0x49a018=_0x4cda98[_0xea00('0x55')][_0x4e07bb];var _0x4cf879={'id':_0x49a018['id'],'available':_0x49a018[_0xea00('0x4d')],'loggedIn':_0x49a018[_0xea00('0x4e')],'name':_0x49a018[_0xea00('0x4f')],'paused':_0x49a018[_0xea00('0x50')],'waiting':_0x49a018[_0xea00('0x51')]};_0x1e101d['push'](_0x4cf879);}}_0x1ecea0({'count':_0x1e101d['length'],'rows':_0x1e101d});});},'WhatsappQueues':function(_0x15b3d4){return new Promise(function(_0x109bd6,_0x3460bc){var _0x206079=[];for(var _0xf4e346 in _0x4cda98[_0xea00('0x56')]){if(_0x4cda98[_0xea00('0x56')][_0xea00('0x46')](_0xf4e346)){var _0x146eb5=_0x4cda98['whatsappQueues'][_0xf4e346];var _0x43c34a={'id':_0x146eb5['id'],'available':_0x146eb5[_0xea00('0x4d')],'loggedIn':_0x146eb5['loggedIn'],'name':_0x146eb5[_0xea00('0x4f')],'paused':_0x146eb5[_0xea00('0x50')],'waiting':_0x146eb5[_0xea00('0x51')]};_0x206079[_0xea00('0x1e')](_0x43c34a);}}_0x109bd6({'count':_0x206079[_0xea00('0x17')],'rows':_0x206079});});},'ChatQueuesWaitingInteractions':function(_0x5d70d7){return new Promise(function(_0x52c570,_0x3c5efd){var _0x1dd689=_['values'](_0x4cda98[_0xea00('0x57')]);_0x52c570({'count':_0x1dd689[_0xea00('0x17')],'rows':_0x1dd689});});},'MailQueuesWaitingInteractions':function(_0x5c0d30){return new Promise(function(_0x52ce36,_0xcd4f1e){var _0xacd8cb=_['values'](_0x4cda98['mailQueuesWaitingInteractions']);_0x52ce36({'count':_0xacd8cb['length'],'rows':_0xacd8cb});});},'OpenchannelQueuesWaitingInteractions':function(_0x340ba7){return new Promise(function(_0x1e12ca,_0x2c2322){var _0x28b7d2=_[_0xea00('0x4b')](_0x4cda98[_0xea00('0x58')]);_0x1e12ca({'count':_0x28b7d2[_0xea00('0x17')],'rows':_0x28b7d2});});},'SmsQueuesWaitingInteractions':function(_0x36fd92){return new Promise(function(_0x46f78f,_0x2a245b){var _0x3f3395=_['values'](_0x4cda98[_0xea00('0x59')]);_0x46f78f({'count':_0x3f3395[_0xea00('0x17')],'rows':_0x3f3395});});},'FaxQueuesWaitingInteractions':function(_0x5dc6d5){return new Promise(function(_0xe7c4b6,_0x26642e){var _0x1267ad=_[_0xea00('0x4b')](_0x4cda98[_0xea00('0x5a')]);_0xe7c4b6({'count':_0x1267ad[_0xea00('0x17')],'rows':_0x1267ad});});},'WhatsappQueuesWaitingInteractions':function(_0x504e7f){return new Promise(function(_0x36ddf1,_0x4c20b7){var _0x51cc49=_[_0xea00('0x4b')](_0x4cda98[_0xea00('0x5b')]);_0x36ddf1({'count':_0x51cc49[_0xea00('0x17')],'rows':_0x51cc49});});}};var _0x4064cc=jayson[_0xea00('0x5c')](_0x460215)[_0xea00('0x5d')]();_0x4064cc['on'](_0xea00('0x31'),function(_0x3800e7){logger[_0xea00('0x31')](JSON[_0xea00('0x36')](_0x3800e7));return _0x414356(_0x3800e7);});_0x4064cc[_0xea00('0x11')](0x232c,_0xea00('0x5e'),function(){console[_0xea00('0x5f')](_0xea00('0x60'),0x232c);return _0x3bbb40('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index bd24825..eaccc41 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 _0xde07=['condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','../../../config/logger','routing','client','http','request','error','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xde07,0x14b));var _0x7de0=function(_0x1a4e7b,_0x335a88){_0x1a4e7b=_0x1a4e7b-0x0;var _0xafb055=_0xde07[_0x1a4e7b];return _0xafb055;};'use strict';var util=require(_0x7de0('0x0'));var BPromise=require(_0x7de0('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x7de0('0x2'))(_0x7de0('0x3'));var client=jayson[_0x7de0('0x4')][_0x7de0('0x5')]({'port':0x232a});function request(_0x494de3,_0x45f31d){return new BPromise(function(_0x4fb876,_0x13ef02){return client[_0x7de0('0x6')](_0x494de3,_0x45f31d)['then'](function(_0x86af81){if(_0x86af81[_0x7de0('0x7')]){return _0x13ef02(_0x86af81[_0x7de0('0x7')][_0x7de0('0x8')]);}else{return _0x4fb876(_0x86af81[_0x7de0('0x9')]);}})['catch'](function(_0x474c71){return _0x13ef02(_0x474c71);});});}exports[_0x7de0('0xa')]=function(_0x4ec3dd,_0x684288,_0x54bac2){return function(_0x3573bf){if(_0x54bac2[_0x7de0('0xb')]&&!_0x54bac2[_0x7de0('0xb')][_0x4ec3dd]){logger['info'](_0x7de0('0xc'),_0x4ec3dd);return _0x3573bf[_0x7de0('0xd')]();}var _0x16951b=[];for(var _0x5e6358=0x0;_0x5e6358<_0x684288['length'];_0x5e6358+=0x1){_0x16951b[_0x7de0('0xe')](request(_0x7de0('0xf'),{'command':util[_0x7de0('0x10')](_0x7de0('0x11'),_0x684288[_0x5e6358])})['then'](function(_0x5ee6f6){return _0x5ee6f6&&_0x5ee6f6[_0x7de0('0x8')]&&_0x5ee6f6[_0x7de0('0x8')][_0x7de0('0x12')](_0x7de0('0x13'))>=0x0?!![]:![];})[_0x7de0('0x14')](function(_0x13fbd3){logger[_0x7de0('0x7')](_0x7de0('0x15'),_0x4ec3dd,_0x684288[_0x5e6358]);}));}BPromise[_0x7de0('0x16')](_0x16951b)['then'](function(_0x498052){var _0x447c9d=_[_0x7de0('0x17')](_0x498052);logger[_0x7de0('0x18')](_0x7de0('0x19'),_0x4ec3dd,_0x684288[_0x7de0('0x1a')](_0x7de0('0x1b')),_0x447c9d);_0x3573bf[_0x7de0('0x1c')](_0x447c9d);})[_0x7de0('0x14')](function(_0xb6d2b8){console[_0x7de0('0x1d')](_0xb6d2b8);logger[_0x7de0('0x7')](_0x7de0('0x19'),_0x4ec3dd,_0x684288[_0x7de0('0x1a')](_0x7de0('0x1b')),_0xb6d2b8[_0x7de0('0x1e')]);_0x3573bf['stop']();});};}; \ No newline at end of file +var _0x1783=['bluebird','jayson/promise','lodash','routing','client','request','then','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','error','[%s][INTERVAL]\x20%s','some','join','\x20|\x20','log','[%s][INTERVAL]\x20%s\x20%s','stack'];(function(_0x580cf8,_0x26751e){var _0xcc9a9e=function(_0x5a67ad){while(--_0x5a67ad){_0x580cf8['push'](_0x580cf8['shift']());}};_0xcc9a9e(++_0x26751e);}(_0x1783,0x188));var _0x3178=function(_0x511210,_0x5a960c){_0x511210=_0x511210-0x0;var _0x9bfd32=_0x1783[_0x511210];return _0x9bfd32;};'use strict';var util=require('util');var BPromise=require(_0x3178('0x0'));var jayson=require(_0x3178('0x1'));var _=require(_0x3178('0x2'));var logger=require('../../../config/logger')(_0x3178('0x3'));var client=jayson[_0x3178('0x4')]['http']({'port':0x232a});function request(_0x481fbd,_0x3d74c5){return new BPromise(function(_0x350ce4,_0x486c48){return client[_0x3178('0x5')](_0x481fbd,_0x3d74c5)[_0x3178('0x6')](function(_0x1b9a2c){if(_0x1b9a2c['error']){return _0x486c48(_0x1b9a2c['error'][_0x3178('0x7')]);}else{return _0x350ce4(_0x1b9a2c['result']);}})[_0x3178('0x8')](function(_0x4af8e2){return _0x486c48(_0x4af8e2);});});}exports[_0x3178('0x9')]=function(_0x4efa27,_0x29d8bd,_0x3b3222){return function(_0x4ffadb){if(_0x3b3222[_0x3178('0xa')]&&!_0x3b3222[_0x3178('0xa')][_0x4efa27]){logger[_0x3178('0xb')](_0x3178('0xc'),_0x4efa27);return _0x4ffadb[_0x3178('0xd')]();}var _0x23ff30=[];for(var _0x4f71d9=0x0;_0x4f71d9<_0x29d8bd[_0x3178('0xe')];_0x4f71d9+=0x1){_0x23ff30[_0x3178('0xf')](request(_0x3178('0x10'),{'command':util[_0x3178('0x11')](_0x3178('0x12'),_0x29d8bd[_0x4f71d9])})['then'](function(_0x3ae313){return _0x3ae313&&_0x3ae313['message']&&_0x3ae313['message'][_0x3178('0x13')]('true')>=0x0?!![]:![];})[_0x3178('0x8')](function(_0x2ea6be){logger[_0x3178('0x14')](_0x3178('0x15'),_0x4efa27,_0x29d8bd[_0x4f71d9]);}));}BPromise['all'](_0x23ff30)[_0x3178('0x6')](function(_0x221cce){var _0x422cf5=_[_0x3178('0x16')](_0x221cce);logger[_0x3178('0xb')]('[%s][INTERVAL]\x20%s\x20%s',_0x4efa27,_0x29d8bd[_0x3178('0x17')](_0x3178('0x18')),_0x422cf5);_0x4ffadb['when'](_0x422cf5);})[_0x3178('0x8')](function(_0x2cae21){console[_0x3178('0x19')](_0x2cae21);logger['error'](_0x3178('0x1a'),_0x4efa27,_0x29d8bd[_0x3178('0x17')](_0x3178('0x18')),_0x2cae21[_0x3178('0x1b')]);_0x4ffadb[_0x3178('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index d10fd67..1002d8a 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 _0xbaf0=['includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','[%s][agents][hangup]','util','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','connectedlinename','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','push','forIn'];(function(_0x3a7490,_0x265112){var _0x4209ab=function(_0x1e230c){while(--_0x1e230c){_0x3a7490['push'](_0x3a7490['shift']());}};_0x4209ab(++_0x265112);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var utils=require(_0x0baf('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1e212d,_0x263f79){utils[_0x0baf('0x2')](util[_0x0baf('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1e212d[_0x0baf('0x4')],_0x1e212d[_0x0baf('0x5')],_0x1e212d[_0x0baf('0x6')],_0x1e212d[_0x0baf('0x7')],_0x1e212d[_0x0baf('0x8')],_0x1e212d[_0x0baf('0x9')],_0x1e212d[_0x0baf('0xa')],_0x1e212d[_0x0baf('0xb')]));if(_0x1e212d[_0x0baf('0x6')]){utils['getVoiceQueueByName'](_0x1e212d[_0x0baf('0x6')])['then'](function(_0x4605c3){if(_0x4605c3){_0x1e212d[_0x0baf('0xc')]=_0x4605c3[_0x0baf('0xc')];_0x1e212d[_0x0baf('0xd')]=_0x1e212d[_0x0baf('0xe')]?_0x4605c3[_0x0baf('0xf')]:![];_0x1e212d[_0x0baf('0x10')]=_0x1e212d[_0x0baf('0xd')]?_0x4605c3[_0x0baf('0x11')]:0x0;}utils[_0x0baf('0x12')](_0x0baf('0x13'),_0x1e212d);});}else{utils['request']('CreateVoiceAgentReport',_0x1e212d);}if(_0x263f79){delete transfers[_0x1e212d[_0x0baf('0x4')]];}else{delete agents[_0x1e212d[_0x0baf('0x14')]];}}exports[_0x0baf('0x15')]=function(_0x13df17){try{utils['debug'](util[_0x0baf('0x3')]('[%s][agents][agentcalled]',_0x13df17[_0x0baf('0x4')]),_0x13df17);agents[_0x13df17[_0x0baf('0x14')]]=_0x13df17;agents[_0x13df17[_0x0baf('0x14')]][_0x0baf('0x16')]=utils[_0x0baf('0x17')]();agents[_0x13df17[_0x0baf('0x14')]]['lastevent']='called';agents[_0x13df17[_0x0baf('0x14')]][_0x0baf('0xa')]=null;agents[_0x13df17[_0x0baf('0x14')]][_0x0baf('0x18')]=null;utils[_0x0baf('0x2')](util[_0x0baf('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x13df17[_0x0baf('0x4')],agents[_0x13df17[_0x0baf('0x14')]][_0x0baf('0x7')],_0x13df17[_0x0baf('0x14')]));}catch(_0x47070d){utils[_0x0baf('0x19')](util['format']('[%s][agents][agentcalled]',_0x13df17[_0x0baf('0x4')]),_0x47070d);}};exports[_0x0baf('0x1a')]=function(_0x32e839){try{if(!_[_0x0baf('0x1b')](agents[_0x32e839[_0x0baf('0x14')]])){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x1d'),_0x32e839[_0x0baf('0x4')]),_0x32e839);utils[_0x0baf('0x2')](util['format'](_0x0baf('0x1e'),_0x32e839['uniqueid'],agents[_0x32e839[_0x0baf('0x14')]]['membername'],_0x32e839['destuniqueid']));agents[_0x32e839[_0x0baf('0x14')]]['agentringnoanswer']=!![];agents[_0x32e839['destuniqueid']][_0x0baf('0x1f')]=utils[_0x0baf('0x17')]();agents[_0x32e839[_0x0baf('0x14')]][_0x0baf('0xb')]=_0x0baf('0x20');agents[_0x32e839['destuniqueid']][_0x0baf('0x21')]=_0x0baf('0x20');agents[_0x32e839[_0x0baf('0x14')]][_0x0baf('0x22')]=_0x32e839[_0x0baf('0x23')]?parseInt(_0x32e839[_0x0baf('0x23')])/0x3e8:0x0;agents[_0x32e839[_0x0baf('0x14')]]['talktime']=0x0;unanswered[_0x0baf('0x24')](_0x32e839[_0x0baf('0x14')]);}}catch(_0xcaf13d){utils[_0x0baf('0x19')](util['format'](_0x0baf('0x1d'),_0x32e839[_0x0baf('0x4')]),_0xcaf13d);}};exports['queuecallerabandon']=function(_0x44ec31){try{_[_0x0baf('0x25')](agents,function(_0x478ce8,_0xb4dbb1){if(_0x478ce8[_0x0baf('0x4')]==_0x44ec31[_0x0baf('0x4')]&&!_[_0x0baf('0x26')](unanswered,_0x478ce8['destuniqueid'])){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x27'),_0x44ec31[_0x0baf('0x4')]),_0x44ec31);utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x28'),_0x44ec31[_0x0baf('0x4')],_0x478ce8[_0x0baf('0x7')],_0x478ce8[_0x0baf('0x14')]));_0x478ce8[_0x0baf('0x1a')]=!![];_0x478ce8[_0x0baf('0x1f')]=utils[_0x0baf('0x17')]();_0x478ce8[_0x0baf('0xb')]='abandoned';_0x478ce8[_0x0baf('0x21')]='abandoned';_0x478ce8[_0x0baf('0x22')]=_0x44ec31[_0x0baf('0x22')];_0x478ce8[_0x0baf('0x29')]=0x0;writeDB(_0x478ce8);}});}catch(_0x3d65f2){utils['error'](util[_0x0baf('0x3')](_0x0baf('0x27'),_0x44ec31['uniqueid']),_0x3d65f2);}};exports[_0x0baf('0x2a')]=function(_0x2447c2){try{if(agents[_0x2447c2[_0x0baf('0x14')]]){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x2b'),_0x2447c2[_0x0baf('0x4')]),_0x2447c2);utils[_0x0baf('0x2')](util['format'](_0x0baf('0x2c'),_0x2447c2[_0x0baf('0x4')],agents[_0x2447c2['destuniqueid']][_0x0baf('0x7')],_0x2447c2['destuniqueid']));agents[_0x2447c2['destuniqueid']][_0x0baf('0x2d')]=utils[_0x0baf('0x17')]();agents[_0x2447c2['destuniqueid']]['connectedlinenum']=_0x2447c2[_0x0baf('0xa')];agents[_0x2447c2[_0x0baf('0x14')]][_0x0baf('0x18')]=_0x2447c2[_0x0baf('0x18')];agents[_0x2447c2[_0x0baf('0x14')]][_0x0baf('0x22')]=_0x2447c2[_0x0baf('0x23')];agents[_0x2447c2[_0x0baf('0x14')]][_0x0baf('0xb')]=_0x0baf('0x2e');_[_0x0baf('0x25')](agents,function(_0x148540,_0x354cb1){if(_0x148540[_0x0baf('0x14')]!=_0x2447c2['destuniqueid']&&_0x148540[_0x0baf('0x4')]==_0x2447c2[_0x0baf('0x4')]){_0x148540['talktime']=0x0;_0x148540[_0x0baf('0x22')]=_0x2447c2[_0x0baf('0x23')];_0x148540[_0x0baf('0x1a')]=!![];_0x148540[_0x0baf('0x1f')]=utils[_0x0baf('0x17')]();_0x148540[_0x0baf('0xb')]='answered_elsewhere';_0x148540[_0x0baf('0x21')]=_0x0baf('0x2f');_0x148540['answeredelsewheredestinationuniqueid']=_0x2447c2[_0x0baf('0x14')];_0x148540[_0x0baf('0x30')]=_0x2447c2[_0x0baf('0x7')];writeDB(_0x148540);}});}}catch(_0x57903e){utils['error'](util[_0x0baf('0x3')](_0x0baf('0x2b'),_0x2447c2[_0x0baf('0x4')]),_0x57903e);}};exports[_0x0baf('0xe')]=function(_0x2b6d54){try{if(!_[_0x0baf('0x1b')](agents[_0x2b6d54[_0x0baf('0x14')]])){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x31'),_0x2b6d54['uniqueid']),_0x2b6d54);utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x32'),_0x2b6d54[_0x0baf('0x4')],agents[_0x2b6d54[_0x0baf('0x14')]]['membername'],_0x2b6d54[_0x0baf('0x14')]));agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0xe')]=!![];agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0x33')]=utils['now']();agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0x29')]=utils[_0x0baf('0x34')](agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0x33')],agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0x2d')]);agents[_0x2b6d54['destuniqueid']][_0x0baf('0x21')]=_0x2b6d54[_0x0baf('0x21')];agents[_0x2b6d54[_0x0baf('0x14')]]['lastevent']=_0x0baf('0x35');writeDB(agents[_0x2b6d54[_0x0baf('0x14')]]);}}catch(_0x10fa62){utils[_0x0baf('0x19')](util[_0x0baf('0x3')](_0x0baf('0x31'),_0x2b6d54[_0x0baf('0x4')]),_0x10fa62);}};exports['blindtransfer']=function(_0x22c451){try{if(!_[_0x0baf('0x1b')](agents[_0x22c451[_0x0baf('0x36')]])){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x37'),_0x22c451[_0x0baf('0x4')]),_0x22c451);utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x38'),_0x22c451[_0x0baf('0x4')],agents[_0x22c451['transfereruniqueid']]['membername'],agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x4')]));agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x39')]=!![];agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x3a')]=_0x0baf('0x3b');agents[_0x22c451['transfereruniqueid']][_0x0baf('0x3c')]=_0x22c451[_0x0baf('0x3d')];agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x3e')]=agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x4')];}}catch(_0x5e1849){utils[_0x0baf('0x19')](util['format'](_0x0baf('0x37'),_0x22c451['uniqueid']),_0x5e1849);}};exports[_0x0baf('0x3f')]=function(_0x5eaeb2){try{utils[_0x0baf('0x1c')](util['format'](_0x0baf('0x40'),_0x5eaeb2[_0x0baf('0x41')]),_0x5eaeb2);if(_0x5eaeb2[_0x0baf('0x41')]==_0x5eaeb2[_0x0baf('0x42')]){if(!_[_0x0baf('0x1b')](agents[_0x5eaeb2['secondtransfereruniqueid']])){utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x43'),_0x5eaeb2[_0x0baf('0x41')],agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x7')]));agents[_0x5eaeb2['secondtransfereruniqueid']][_0x0baf('0x39')]=!![];agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x3a')]=_0x0baf('0x45');agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x3c')]=_0x5eaeb2[_0x0baf('0x46')];agents[_0x5eaeb2['secondtransfereruniqueid']]['transferuniqueid']=_0x5eaeb2[_0x0baf('0x41')];}if(_0x5eaeb2[_0x0baf('0x47')]&&agents[_0x5eaeb2[_0x0baf('0x47')]]){agents[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x48')]=0x1;transfers[_0x5eaeb2[_0x0baf('0x47')]]=_[_0x0baf('0x49')](agents[_0x5eaeb2[_0x0baf('0x47')]]);transfers[_0x5eaeb2[_0x0baf('0x47')]]['calleridnum']=agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x9')];transfers[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x4a')]=agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x4a')];transfers[_0x5eaeb2[_0x0baf('0x47')]]['agentcalledAt']=utils[_0x0baf('0x17')]();transfers[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x2d')]=utils[_0x0baf('0x17')]();transfers[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x22')]=0x0;transfers[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x48')]=0x2;}}else if(_0x5eaeb2['secondtransfereruniqueid']==_0x5eaeb2[_0x0baf('0x4b')]){if(!_['isNil'](agents[_0x5eaeb2[_0x0baf('0x41')]])){utils['info'](util['format'](_0x0baf('0x43'),_0x5eaeb2['origtransfereruniqueid'],agents[_0x5eaeb2[_0x0baf('0x41')]][_0x0baf('0x7')]));agents[_0x5eaeb2['origtransfereruniqueid']][_0x0baf('0x39')]=!![];agents[_0x5eaeb2[_0x0baf('0x41')]][_0x0baf('0x3a')]='ATTENDED';agents[_0x5eaeb2['origtransfereruniqueid']][_0x0baf('0x3c')]=_0x5eaeb2[_0x0baf('0x4c')];agents[_0x5eaeb2[_0x0baf('0x41')]][_0x0baf('0x3e')]=_0x5eaeb2[_0x0baf('0x44')];}if(_0x5eaeb2['transfertargetuniqueid']&&agents[_0x5eaeb2[_0x0baf('0x4d')]]){agents[_0x5eaeb2['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x5eaeb2['transfertargetuniqueid']]=_[_0x0baf('0x49')](agents[_0x5eaeb2['transfertargetuniqueid']]);transfers[_0x5eaeb2['transfertargetuniqueid']][_0x0baf('0x9')]=agents[_0x5eaeb2[_0x0baf('0x41')]][_0x0baf('0x9')];transfers[_0x5eaeb2[_0x0baf('0x4d')]][_0x0baf('0x4a')]=agents[_0x5eaeb2[_0x0baf('0x41')]]['calleridname'];transfers[_0x5eaeb2[_0x0baf('0x4d')]][_0x0baf('0x16')]=utils[_0x0baf('0x17')]();transfers[_0x5eaeb2[_0x0baf('0x4d')]][_0x0baf('0x2d')]=utils[_0x0baf('0x17')]();transfers[_0x5eaeb2['transfertargetuniqueid']][_0x0baf('0x22')]=0x0;transfers[_0x5eaeb2[_0x0baf('0x4d')]][_0x0baf('0x48')]=0x2;}}}catch(_0x5d4053){utils[_0x0baf('0x19')](util[_0x0baf('0x3')](_0x0baf('0x40'),_0x5eaeb2[_0x0baf('0x41')]),_0x5d4053);}};exports[_0x0baf('0x4e')]=function(_0x27a959){try{utils[_0x0baf('0x1c')](util['format']('[%s][agents][hangup]',_0x27a959['uniqueid']),_0x27a959);if(agents[_0x27a959[_0x0baf('0x4')]]&&agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')]===_0x0baf('0x20')){if(_0x27a959[_0x0baf('0x4f')]==='21'){agents[_0x27a959[_0x0baf('0x4')]]['reason']='rejected';agents[_0x27a959[_0x0baf('0x4')]]['lastevent']=_0x0baf('0x50');}utils[_0x0baf('0x2')](util['format'](_0x0baf('0x51'),_0x27a959[_0x0baf('0x4')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x7')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]));writeDB(agents[_0x27a959[_0x0baf('0x4')]]);var _0x5ea0f3=unanswered['indexOf'](_0x27a959['uniqueid']);if(_0x5ea0f3>-0x1){unanswered['splice'](_0x5ea0f3,0x1);}}if(transfers[_0x27a959['uniqueid']]){transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xe')]=!![];transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x33')]=utils['now']();transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x29')]=utils['diffTime'](transfers[_0x27a959['uniqueid']][_0x0baf('0x33')],transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x2d')]);transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')]=_0x0baf('0x52');transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]='complete';utils[_0x0baf('0x2')](util[_0x0baf('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x27a959[_0x0baf('0x4')],transfers[_0x27a959[_0x0baf('0x4')]]['membername'],transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')],transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]));writeDB(transfers[_0x27a959[_0x0baf('0x4')]],!![]);}if(agents[_0x27a959['uniqueid']]&&agents[_0x27a959['uniqueid']][_0x0baf('0x2d')]){agents[_0x27a959[_0x0baf('0x4')]]['agentcomplete']=!![];agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x33')]=utils[_0x0baf('0x17')]();agents[_0x27a959['uniqueid']][_0x0baf('0x29')]=utils[_0x0baf('0x34')](agents[_0x27a959[_0x0baf('0x4')]]['agentcompleteAt'],agents[_0x27a959[_0x0baf('0x4')]]['agentconnectAt']);agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')]=agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x39')]?_0x0baf('0x39'):'agent';agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]='complete';utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x51'),_0x27a959[_0x0baf('0x4')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x7')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]));writeDB(agents[_0x27a959[_0x0baf('0x4')]]);}}catch(_0x2c2f09){utils['error'](util['format'](_0x0baf('0x53'),_0x27a959[_0x0baf('0x4')]),_0x2c2f09);}}; \ No newline at end of file +var _0x1be1=['destuniqueid','agentcalled','debug','called','error','[%s][agents][agentcalled]','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','lastevent','timeout','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','reason','holdtime','[%s][agents][agentconnect]','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','connectedlinenum','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request'];(function(_0x30e6b0,_0x207d37){var _0x508899=function(_0x311be7){while(--_0x311be7){_0x30e6b0['push'](_0x30e6b0['shift']());}};_0x508899(++_0x207d37);}(_0x1be1,0x192));var _0x11be=function(_0x43269e,_0x1de869){_0x43269e=_0x43269e-0x0;var _0x4a9fae=_0x1be1[_0x43269e];return _0x4a9fae;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x11be('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x33a55d,_0x5527b3){utils[_0x11be('0x1')](util[_0x11be('0x2')](_0x11be('0x3'),_0x33a55d[_0x11be('0x4')],_0x33a55d['channel'],_0x33a55d[_0x11be('0x5')],_0x33a55d[_0x11be('0x6')],_0x33a55d[_0x11be('0x7')],_0x33a55d['calleridnum'],_0x33a55d[_0x11be('0x8')],_0x33a55d['lastevent']));if(_0x33a55d[_0x11be('0x5')]){utils[_0x11be('0x9')](_0x33a55d[_0x11be('0x5')])[_0x11be('0xa')](function(_0x162eaa){if(_0x162eaa){_0x33a55d['type']=_0x162eaa[_0x11be('0xb')];_0x33a55d[_0x11be('0xc')]=_0x33a55d['agentcomplete']?_0x162eaa[_0x11be('0xd')]:![];_0x33a55d[_0x11be('0xe')]=_0x33a55d[_0x11be('0xc')]?_0x162eaa[_0x11be('0xf')]:0x0;}utils['request'](_0x11be('0x10'),_0x33a55d);});}else{utils[_0x11be('0x11')](_0x11be('0x10'),_0x33a55d);}if(_0x5527b3){delete transfers[_0x33a55d['uniqueid']];}else{delete agents[_0x33a55d[_0x11be('0x12')]];}}exports[_0x11be('0x13')]=function(_0x4ce3ae){try{utils[_0x11be('0x14')](util['format']('[%s][agents][agentcalled]',_0x4ce3ae['uniqueid']),_0x4ce3ae);agents[_0x4ce3ae['destuniqueid']]=_0x4ce3ae;agents[_0x4ce3ae['destuniqueid']]['agentcalledAt']=utils['now']();agents[_0x4ce3ae[_0x11be('0x12')]]['lastevent']=_0x11be('0x15');agents[_0x4ce3ae[_0x11be('0x12')]][_0x11be('0x8')]=null;agents[_0x4ce3ae[_0x11be('0x12')]]['connectedlinename']=null;utils[_0x11be('0x1')](util[_0x11be('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4ce3ae[_0x11be('0x4')],agents[_0x4ce3ae[_0x11be('0x12')]][_0x11be('0x6')],_0x4ce3ae['destuniqueid']));}catch(_0x51ba82){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x17'),_0x4ce3ae[_0x11be('0x4')]),_0x51ba82);}};exports['agentringnoanswer']=function(_0x12a5bd){try{if(!_[_0x11be('0x18')](agents[_0x12a5bd[_0x11be('0x12')]])){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x19'),_0x12a5bd[_0x11be('0x4')]),_0x12a5bd);utils[_0x11be('0x1')](util[_0x11be('0x2')](_0x11be('0x1a'),_0x12a5bd['uniqueid'],agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x6')],_0x12a5bd[_0x11be('0x12')]));agents[_0x12a5bd['destuniqueid']]['agentringnoanswer']=!![];agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x1b')]=utils[_0x11be('0x1c')]();agents[_0x12a5bd['destuniqueid']][_0x11be('0x1d')]='timeout';agents[_0x12a5bd[_0x11be('0x12')]]['reason']=_0x11be('0x1e');agents[_0x12a5bd[_0x11be('0x12')]]['holdtime']=_0x12a5bd[_0x11be('0x1f')]?parseInt(_0x12a5bd[_0x11be('0x1f')])/0x3e8:0x0;agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x20')]=0x0;unanswered[_0x11be('0x21')](_0x12a5bd[_0x11be('0x12')]);}}catch(_0xf5a6ac){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][agentringnoanswer]',_0x12a5bd[_0x11be('0x4')]),_0xf5a6ac);}};exports['queuecallerabandon']=function(_0x182f6b){try{_[_0x11be('0x22')](agents,function(_0x510476,_0x584d4c){if(_0x510476[_0x11be('0x4')]==_0x182f6b[_0x11be('0x4')]&&!_[_0x11be('0x23')](unanswered,_0x510476[_0x11be('0x12')])){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x24'),_0x182f6b[_0x11be('0x4')]),_0x182f6b);utils[_0x11be('0x1')](util['format'](_0x11be('0x25'),_0x182f6b[_0x11be('0x4')],_0x510476[_0x11be('0x6')],_0x510476[_0x11be('0x12')]));_0x510476[_0x11be('0x26')]=!![];_0x510476[_0x11be('0x1b')]=utils['now']();_0x510476[_0x11be('0x1d')]=_0x11be('0x27');_0x510476[_0x11be('0x28')]=_0x11be('0x27');_0x510476[_0x11be('0x29')]=_0x182f6b['holdtime'];_0x510476[_0x11be('0x20')]=0x0;writeDB(_0x510476);}});}catch(_0x254be5){utils[_0x11be('0x16')](util['format'](_0x11be('0x24'),_0x182f6b['uniqueid']),_0x254be5);}};exports['agentconnect']=function(_0x4c1f4d){try{if(agents[_0x4c1f4d['destuniqueid']]){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x2a'),_0x4c1f4d['uniqueid']),_0x4c1f4d);utils[_0x11be('0x1')](util[_0x11be('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4c1f4d[_0x11be('0x4')],agents[_0x4c1f4d['destuniqueid']][_0x11be('0x6')],_0x4c1f4d['destuniqueid']));agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();agents[_0x4c1f4d[_0x11be('0x12')]]['connectedlinenum']=_0x4c1f4d[_0x11be('0x8')];agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x2c')]=_0x4c1f4d[_0x11be('0x2c')];agents[_0x4c1f4d['destuniqueid']][_0x11be('0x29')]=_0x4c1f4d[_0x11be('0x1f')];agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x1d')]=_0x11be('0x2d');_[_0x11be('0x22')](agents,function(_0x5742d1,_0x5ee47c){if(_0x5742d1[_0x11be('0x12')]!=_0x4c1f4d[_0x11be('0x12')]&&_0x5742d1['uniqueid']==_0x4c1f4d[_0x11be('0x4')]){_0x5742d1[_0x11be('0x20')]=0x0;_0x5742d1['holdtime']=_0x4c1f4d[_0x11be('0x1f')];_0x5742d1['agentringnoanswer']=!![];_0x5742d1[_0x11be('0x1b')]=utils['now']();_0x5742d1[_0x11be('0x1d')]=_0x11be('0x2e');_0x5742d1['reason']=_0x11be('0x2e');_0x5742d1['answeredelsewheredestinationuniqueid']=_0x4c1f4d[_0x11be('0x12')];_0x5742d1[_0x11be('0x2f')]=_0x4c1f4d[_0x11be('0x6')];writeDB(_0x5742d1);}});}}catch(_0x383604){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x2a'),_0x4c1f4d['uniqueid']),_0x383604);}};exports[_0x11be('0x30')]=function(_0x18cddf){try{if(!_[_0x11be('0x18')](agents[_0x18cddf[_0x11be('0x12')]])){utils['debug'](util['format']('[%s][agents][agentcomplete]',_0x18cddf[_0x11be('0x4')]),_0x18cddf);utils['info'](util[_0x11be('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x18cddf[_0x11be('0x4')],agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x6')],_0x18cddf[_0x11be('0x12')]));agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x30')]=!![];agents[_0x18cddf[_0x11be('0x12')]]['agentcompleteAt']=utils[_0x11be('0x1c')]();agents[_0x18cddf['destuniqueid']][_0x11be('0x20')]=utils[_0x11be('0x31')](agents[_0x18cddf[_0x11be('0x12')]]['agentcompleteAt'],agents[_0x18cddf['destuniqueid']]['agentconnectAt']);agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x28')]=_0x18cddf['reason'];agents[_0x18cddf['destuniqueid']]['lastevent']=_0x11be('0x32');writeDB(agents[_0x18cddf[_0x11be('0x12')]]);}}catch(_0x2cdf2a){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x33'),_0x18cddf[_0x11be('0x4')]),_0x2cdf2a);}};exports[_0x11be('0x34')]=function(_0x2ce110){try{if(!_[_0x11be('0x18')](agents[_0x2ce110[_0x11be('0x35')]])){utils['debug'](util[_0x11be('0x2')](_0x11be('0x36'),_0x2ce110['uniqueid']),_0x2ce110);utils['info'](util['format'](_0x11be('0x37'),_0x2ce110['uniqueid'],agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x6')],agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x4')]));agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x38')]=!![];agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x39')]=_0x11be('0x3a');agents[_0x2ce110['transfereruniqueid']][_0x11be('0x3b')]=_0x2ce110['extension'];agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x3c')]=agents[_0x2ce110['transfereruniqueid']][_0x11be('0x4')];}}catch(_0x1164a4){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x36'),_0x2ce110['uniqueid']),_0x1164a4);}};exports['attendedtransfer']=function(_0x46764d){try{utils[_0x11be('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x46764d[_0x11be('0x3d')]),_0x46764d);if(_0x46764d[_0x11be('0x3d')]==_0x46764d[_0x11be('0x3e')]){if(!_['isNil'](agents[_0x46764d['secondtransfereruniqueid']])){utils['info'](util[_0x11be('0x2')](_0x11be('0x3f'),_0x46764d[_0x11be('0x3d')],agents[_0x46764d['secondtransfereruniqueid']]['membername']));agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x38')]=!![];agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x39')]='ATTENDED';agents[_0x46764d[_0x11be('0x40')]]['transferexten']=_0x46764d['origtransfererexten'];agents[_0x46764d['secondtransfereruniqueid']]['transferuniqueid']=_0x46764d[_0x11be('0x3d')];}if(_0x46764d[_0x11be('0x41')]&&agents[_0x46764d[_0x11be('0x41')]]){agents[_0x46764d[_0x11be('0x41')]][_0x11be('0x42')]=0x1;transfers[_0x46764d[_0x11be('0x41')]]=_[_0x11be('0x43')](agents[_0x46764d['transfereeuniqueid']]);transfers[_0x46764d['transfereeuniqueid']][_0x11be('0x44')]=agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x44')];transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x45')]=agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x45')];transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x46')]=utils['now']();transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();transfers[_0x46764d['transfereeuniqueid']][_0x11be('0x29')]=0x0;transfers[_0x46764d[_0x11be('0x41')]]['agententerreason']=0x2;}}else if(_0x46764d['secondtransfereruniqueid']==_0x46764d[_0x11be('0x47')]){if(!_[_0x11be('0x18')](agents[_0x46764d[_0x11be('0x3d')]])){utils[_0x11be('0x1')](util['format'](_0x11be('0x3f'),_0x46764d[_0x11be('0x3d')],agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x6')]));agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x38')]=!![];agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x39')]=_0x11be('0x48');agents[_0x46764d['origtransfereruniqueid']]['transferexten']=_0x46764d[_0x11be('0x49')];agents[_0x46764d[_0x11be('0x3d')]]['transferuniqueid']=_0x46764d[_0x11be('0x40')];}if(_0x46764d[_0x11be('0x4a')]&&agents[_0x46764d[_0x11be('0x4a')]]){agents[_0x46764d[_0x11be('0x4a')]][_0x11be('0x42')]=0x1;transfers[_0x46764d[_0x11be('0x4a')]]=_[_0x11be('0x43')](agents[_0x46764d['transfertargetuniqueid']]);transfers[_0x46764d['transfertargetuniqueid']][_0x11be('0x44')]=agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x44')];transfers[_0x46764d['transfertargetuniqueid']][_0x11be('0x45')]=agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x45')];transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x46')]=utils[_0x11be('0x1c')]();transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x29')]=0x0;transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x42')]=0x2;}}}catch(_0x464459){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][attendedtransfer]',_0x46764d['origtransfereruniqueid']),_0x464459);}};exports[_0x11be('0x4b')]=function(_0x554aba){try{utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x4c'),_0x554aba[_0x11be('0x4')]),_0x554aba);if(agents[_0x554aba[_0x11be('0x4')]]&&agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')]===_0x11be('0x1e')){if(_0x554aba[_0x11be('0x4d')]==='21'){agents[_0x554aba['uniqueid']][_0x11be('0x28')]=_0x11be('0x4e');agents[_0x554aba[_0x11be('0x4')]]['lastevent']=_0x11be('0x4e');}utils[_0x11be('0x1')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x554aba['uniqueid'],agents[_0x554aba['uniqueid']][_0x11be('0x6')],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]));writeDB(agents[_0x554aba['uniqueid']]);var _0x2c80b7=unanswered[_0x11be('0x4f')](_0x554aba[_0x11be('0x4')]);if(_0x2c80b7>-0x1){unanswered[_0x11be('0x50')](_0x2c80b7,0x1);}}if(transfers[_0x554aba[_0x11be('0x4')]]){transfers[_0x554aba['uniqueid']][_0x11be('0x30')]=!![];transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')]=utils[_0x11be('0x1c')]();transfers[_0x554aba['uniqueid']][_0x11be('0x20')]=utils[_0x11be('0x31')](transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')],transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x2b')]);transfers[_0x554aba['uniqueid']][_0x11be('0x28')]=_0x11be('0x52');transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]='complete';utils[_0x11be('0x1')](util['format'](_0x11be('0x53'),_0x554aba[_0x11be('0x4')],transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x6')],transfers[_0x554aba['uniqueid']][_0x11be('0x28')],transfers[_0x554aba[_0x11be('0x4')]]['lastevent']));writeDB(transfers[_0x554aba[_0x11be('0x4')]],!![]);}if(agents[_0x554aba[_0x11be('0x4')]]&&agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x2b')]){agents[_0x554aba['uniqueid']][_0x11be('0x30')]=!![];agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')]=utils[_0x11be('0x1c')]();agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x20')]=utils[_0x11be('0x31')](agents[_0x554aba[_0x11be('0x4')]]['agentcompleteAt'],agents[_0x554aba[_0x11be('0x4')]]['agentconnectAt']);agents[_0x554aba['uniqueid']][_0x11be('0x28')]=agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x38')]?_0x11be('0x38'):_0x11be('0x52');agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]='complete';utils['info'](util[_0x11be('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x554aba['uniqueid'],agents[_0x554aba[_0x11be('0x4')]]['membername'],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')],agents[_0x554aba['uniqueid']][_0x11be('0x1d')]));writeDB(agents[_0x554aba[_0x11be('0x4')]]);}}catch(_0x56d8d7){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][hangup]',_0x554aba[_0x11be('0x4')]),_0x56d8d7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 748ed2f..a17007a 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 _0x317d=['\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','queue','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','hangup','execif','gotoif','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','DOCUMENTATION','newstate','[%s][calls][newstate]','channelstate','systemanswertime','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','isNil','answertime','toNumber','error','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','diffTime','endtime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','value','source','xmd-phone'];(function(_0x270f6d,_0x3bb90a){var _0x352cc3=function(_0x2ae217){while(--_0x2ae217){_0x270f6d['push'](_0x270f6d['shift']());}};_0x352cc3(++_0x3bb90a);}(_0x317d,0xf0));var _0xd317=function(_0x3ea8dd,_0x302326){_0x3ea8dd=_0x3ea8dd-0x0;var _0x3c67bf=_0x317d[_0x3ea8dd];return _0x3c67bf;};'use strict';var _=require(_0xd317('0x0'));var util=require(_0xd317('0x1'));var utils=require(_0xd317('0x2'));var transfers=require(_0xd317('0x3'));var dispositions=[_0xd317('0x4'),_0xd317('0x5'),_0xd317('0x5'),_0xd317('0x4'),_0xd317('0x4'),_0xd317('0x4'),_0xd317('0x6'),_0xd317('0x7'),_0xd317('0x5'),_0xd317('0x5'),_0xd317('0x5')];var channels={};function writeDB(_0x436087){var _0x293f02;if(transfers[_0xd317('0x8')][_0x436087[_0xd317('0x9')]]){_0x293f02=_0x436087[_0xd317('0x9')];_0x436087['uniqueid']=transfers[_0xd317('0x8')][_0x436087[_0xd317('0x9')]][_0xd317('0xa')];}utils['info'](util[_0xd317('0xb')](_0xd317('0xc'),_0x436087['uniqueid'],_0x436087[_0xd317('0xd')],_0x436087['queue'],_0x436087[_0xd317('0xe')],_0x436087['interface'],_0x436087[_0xd317('0xf')],_0x436087[_0xd317('0x10')],_0x436087[_0xd317('0x11')]));if(_0x436087[_0xd317('0x12')]){utils['getUserByInternal'](_0x436087[_0xd317('0x12')])[_0xd317('0x13')](function(_0x5f1389){if(_0x5f1389){_0x436087[_0xd317('0x14')]=_0x5f1389['id'];}utils[_0xd317('0x15')](_0xd317('0x16'),_0x436087);});}else{utils[_0xd317('0x15')](_0xd317('0x16'),_0x436087);}if(channels[_0x436087[_0xd317('0x9')]]){delete channels[_0x436087[_0xd317('0x9')]];}else if(_0x293f02&&channels[_0x293f02]){delete transfers[_0xd317('0x8')][_0x293f02];delete channels[_0x293f02];}}exports['newchannel']=function(_0x5e68e8){try{utils[_0xd317('0x17')](util['format'](_0xd317('0x18'),_0x5e68e8[_0xd317('0x9')]),_0x5e68e8);if(_0x5e68e8[_0xd317('0x9')]==_0x5e68e8[_0xd317('0x19')]&&_0x5e68e8[_0xd317('0xd')]!=_0xd317('0x1a')){utils[_0xd317('0x1b')](util['format'](_0xd317('0x1c'),_0x5e68e8[_0xd317('0x9')],_0x5e68e8['context'],_0x5e68e8[_0xd317('0x1d')]));channels[_0x5e68e8[_0xd317('0x9')]]={'uniqueid':_0x5e68e8[_0xd317('0x9')],'accountcode':_0x5e68e8[_0xd317('0x12')],'source':_0x5e68e8[_0xd317('0xf')],'destination':_0x5e68e8[_0xd317('0x1d')],'destinationcontext':_0x5e68e8[_0xd317('0x1e')],'channel':_0x5e68e8[_0xd317('0xd')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd317('0x4'),'amaflags':_0xd317('0x1f')};}}catch(_0x1b63b1){utils['error'](util[_0xd317('0xb')](_0xd317('0x18'),_0x5e68e8[_0xd317('0x9')]),_0x1b63b1);}};exports[_0xd317('0x20')]=function(_0x5a026a){try{utils[_0xd317('0x17')](util[_0xd317('0xb')](_0xd317('0x21'),_0x5a026a[_0xd317('0x9')]),_0x5a026a);if(!_['isNil'](channels[_0x5a026a[_0xd317('0x9')]])&&_0x5a026a[_0xd317('0x22')]==0x6){utils[_0xd317('0x1b')](util[_0xd317('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x5a026a[_0xd317('0x9')],_0x5a026a[_0xd317('0x1e')],_0x5a026a[_0xd317('0xd')]));if(_['isNil'](channels[_0x5a026a[_0xd317('0x9')]][_0xd317('0x23')])){channels[_0x5a026a[_0xd317('0x9')]]['systemanswertime']=utils[_0xd317('0x24')]();}}else if(!_['isNil'](channels[_0x5a026a['linkedid']])&&_0x5a026a[_0xd317('0x22')]==0x6&&_0x5a026a[_0xd317('0x1e')]!='transfer'){utils['info'](util['format'](_0xd317('0x25'),_0x5a026a[_0xd317('0x9')],_0x5a026a['linkedid'],_0x5a026a[_0xd317('0x1e')],_0x5a026a[_0xd317('0xd')]));channels[_0x5a026a[_0xd317('0x19')]][_0xd317('0x12')]=_0x5a026a[_0xd317('0x12')];channels[_0x5a026a[_0xd317('0x19')]][_0xd317('0x26')]=_0x5a026a[_0xd317('0xd')];if(_[_0xd317('0x27')](channels[_0x5a026a[_0xd317('0x19')]][_0xd317('0x28')])){channels[_0x5a026a[_0xd317('0x19')]][_0xd317('0x28')]=utils[_0xd317('0x24')]();}channels[_0x5a026a['linkedid']]['disposition']=dispositions[_[_0xd317('0x29')](_0x5a026a[_0xd317('0x22')])]||_0xd317('0x6');}}catch(_0x2730f8){utils[_0xd317('0x2a')](util[_0xd317('0xb')]('[%s][calls][newstate]',_0x5a026a[_0xd317('0x9')]),_0x2730f8);}};exports['hangup']=function(_0x50495f){try{if(!_[_0xd317('0x27')](channels[_0x50495f[_0xd317('0x9')]])){utils[_0xd317('0x17')](util['format']('[%s][calls][hangup]',_0x50495f['uniqueid']),_0x50495f);if(_[_0xd317('0x27')](channels[_0x50495f[_0xd317('0x9')]][_0xd317('0x2b')])){channels[_0x50495f[_0xd317('0x9')]][_0xd317('0x2b')]=_0x50495f[_0xd317('0x2c')]+'\x20<'+_0x50495f['calleridnum']+'>';}utils['info'](util['format'](_0xd317('0x2d'),_0x50495f[_0xd317('0x9')],channels[_0x50495f['uniqueid']][_0xd317('0x2b')],_0x50495f['cause-txt']));channels[_0x50495f[_0xd317('0x9')]]['endtime']=utils[_0xd317('0x24')]();channels[_0x50495f[_0xd317('0x9')]]['duration']=utils[_0xd317('0x2e')](channels[_0x50495f[_0xd317('0x9')]][_0xd317('0x2f')],channels[_0x50495f['uniqueid']]['starttime']);channels[_0x50495f[_0xd317('0x9')]][_0xd317('0x30')]=channels[_0x50495f[_0xd317('0x9')]][_0xd317('0x28')]?utils[_0xd317('0x2e')](channels[_0x50495f[_0xd317('0x9')]][_0xd317('0x2f')],channels[_0x50495f['uniqueid']]['answertime']):0x0;writeDB(channels[_0x50495f['uniqueid']]);}}catch(_0x3918b6){utils[_0xd317('0x2a')](util[_0xd317('0xb')](_0xd317('0x31'),_0x50495f[_0xd317('0x9')]),_0x3918b6);}};exports[_0xd317('0x32')]=function(_0x2841b1){try{if(!_['isNil'](channels[_0x2841b1[_0xd317('0x33')]])){utils[_0xd317('0x17')](util[_0xd317('0xb')](_0xd317('0x34'),_0x2841b1['origtransfereruniqueid']),_0x2841b1);if(channels[_0x2841b1[_0xd317('0x33')]][_0xd317('0xd')]==_0x2841b1[_0xd317('0x35')]){utils[_0xd317('0x1b')](util['format'](_0xd317('0x36'),_0x2841b1[_0xd317('0x37')],_0x2841b1[_0xd317('0x33')],_0x2841b1[_0xd317('0x38')]));channels[_0x2841b1['localtwolinkedid']][_0xd317('0x26')]=_0x2841b1[_0xd317('0x38')];channels[_0x2841b1['localtwolinkedid']][_0xd317('0x39')]=_0xd317('0x3a');}else if(channels[_0x2841b1[_0xd317('0x33')]][_0xd317('0xd')]=_0x2841b1[_0xd317('0x3b')]){utils[_0xd317('0x1b')](util[_0xd317('0xb')](_0xd317('0x36'),_0x2841b1[_0xd317('0x37')],_0x2841b1[_0xd317('0x33')],_0x2841b1['origtransfererchannel']));channels[_0x2841b1[_0xd317('0x33')]][_0xd317('0x26')]=_0x2841b1[_0xd317('0x3c')];channels[_0x2841b1['localtwolinkedid']][_0xd317('0x39')]=_0xd317('0x3a');}}}catch(_0xfcd83c){utils['error'](util[_0xd317('0xb')](_0xd317('0x34'),_0x2841b1['origtransfereruniqueid']),_0xfcd83c);}};exports[_0xd317('0x3d')]=function(_0x4847c9){try{if(!_[_0xd317('0x27')](channels[_0x4847c9[_0xd317('0x9')]])){utils['debug'](util[_0xd317('0xb')]('[%s][calls][musiconholdstart]',_0x4847c9[_0xd317('0x9')]),_0x4847c9);channels[_0x4847c9['uniqueid']][_0xd317('0x3e')]=utils['now']();utils[_0xd317('0x1b')](util[_0xd317('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4847c9[_0xd317('0x9')],channels[_0x4847c9[_0xd317('0x9')]]['musiconholdstartAt']));}}catch(_0x2c9e30){utils['error'](util[_0xd317('0xb')](_0xd317('0x3f'),_0x4847c9[_0xd317('0x9')]),_0x2c9e30);}};exports[_0xd317('0x40')]=function(_0x33ded6){try{if(!_[_0xd317('0x27')](channels[_0x33ded6['uniqueid']])){utils[_0xd317('0x17')](util[_0xd317('0xb')]('[%s][calls][musiconholdstop]',_0x33ded6[_0xd317('0x9')]),_0x33ded6);if(!_[_0xd317('0x27')](channels[_0x33ded6['uniqueid']]['musiconholdstartAt'])){channels[_0x33ded6[_0xd317('0x9')]]['mohtime']+=utils[_0xd317('0x2e')](utils[_0xd317('0x24')](),channels[_0x33ded6[_0xd317('0x9')]]['musiconholdstartAt']);utils['info'](util[_0xd317('0xb')](_0xd317('0x41'),_0x33ded6['uniqueid'],channels[_0x33ded6['uniqueid']]['mohtime']));delete channels[_0x33ded6[_0xd317('0x9')]][_0xd317('0x3e')];}}}catch(_0x8bb6c7){utils[_0xd317('0x2a')](util[_0xd317('0xb')]('[%s][calls][musiconholdstop]',_0x33ded6[_0xd317('0x9')]),_0x8bb6c7);}};exports[_0xd317('0x42')]=function(_0x4a5178){try{if(!_[_0xd317('0x27')](channels[_0x4a5178[_0xd317('0x9')]])){utils[_0xd317('0x17')](util[_0xd317('0xb')](_0xd317('0x43'),_0x4a5178['uniqueid']),_0x4a5178);if(!_['isNil'](_0x4a5178[_0xd317('0x44')]['xmd-originatecalleridnum'])){utils[_0xd317('0x1b')](util[_0xd317('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x4a5178[_0xd317('0x9')],_0x4a5178[_0xd317('0x45')]));channels[_0x4a5178[_0xd317('0x9')]][_0xd317('0x46')]=_0x4a5178['value'];}if(!_['isNil'](_0x4a5178[_0xd317('0x44')][_0xd317('0x47')])){utils[_0xd317('0x1b')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x4a5178['uniqueid'],_0x4a5178['value']));channels[_0x4a5178['uniqueid']]['destination']=_0x4a5178[_0xd317('0x45')];channels[_0x4a5178[_0xd317('0x9')]]['callerid']='\x22'+_0x4a5178['value']+_0xd317('0x48')+_0x4a5178[_0xd317('0x45')]+'>';}if(!_[_0xd317('0x27')](_0x4a5178['variable'][_0xd317('0x49')])||!_['isNil'](_0x4a5178[_0xd317('0x44')][_0xd317('0x4a')])){utils[_0xd317('0x1b')](util['format'](_0xd317('0x4b'),_0x4a5178[_0xd317('0x9')],!_[_0xd317('0x27')](_0x4a5178['variable'][_0xd317('0x49')])?_0xd317('0x49'):_0xd317('0x4a'),_0x4a5178[_0xd317('0x45')]));channels[_0x4a5178[_0xd317('0x9')]][_0xd317('0x2b')]=_0x4a5178['value'];}if(!_[_0xd317('0x27')](_0x4a5178[_0xd317('0x44')]['xmd-queue'])||!_[_0xd317('0x27')](_0x4a5178['variable'][_0xd317('0x4c')])){utils[_0xd317('0x1b')](util[_0xd317('0xb')](_0xd317('0x4b'),_0x4a5178[_0xd317('0x9')],!_[_0xd317('0x27')](_0x4a5178[_0xd317('0x44')][_0xd317('0x4d')])?_0xd317('0x4d'):_0xd317('0x4c'),_0x4a5178[_0xd317('0x45')]));channels[_0x4a5178['uniqueid']][_0xd317('0x4e')]=_0xd317('0x4f');channels[_0x4a5178[_0xd317('0x9')]]['lastdata']=_0x4a5178['value'];channels[_0x4a5178[_0xd317('0x9')]][_0xd317('0x50')]=!![];}if(!_['isNil'](_0x4a5178[_0xd317('0x44')]['xmd-contactid'])){utils[_0xd317('0x1b')](util[_0xd317('0xb')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4a5178[_0xd317('0x9')],_0x4a5178[_0xd317('0x45')]));channels[_0x4a5178[_0xd317('0x9')]][_0xd317('0x51')]=_0x4a5178[_0xd317('0x45')];}if(!_[_0xd317('0x27')](_0x4a5178[_0xd317('0x44')][_0xd317('0x52')])){utils[_0xd317('0x1b')](util[_0xd317('0xb')](_0xd317('0x53'),_0x4a5178['uniqueid'],_0x4a5178['value']));channels[_0x4a5178[_0xd317('0x9')]][_0xd317('0x54')]=_0x4a5178[_0xd317('0x45')];}if(!_['isNil'](_0x4a5178[_0xd317('0x44')][_0xd317('0x55')])){utils[_0xd317('0x1b')](util[_0xd317('0xb')](_0xd317('0x56'),_0x4a5178[_0xd317('0x9')],_0x4a5178[_0xd317('0x45')]));channels[_0x4a5178[_0xd317('0x9')]]['routeid']=_0x4a5178[_0xd317('0x45')];}if(!_[_0xd317('0x27')](_0x4a5178[_0xd317('0x44')][_0xd317('0x57')])){utils[_0xd317('0x1b')](util[_0xd317('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4a5178[_0xd317('0x9')],_0x4a5178['value']));channels[_0x4a5178[_0xd317('0x9')]]['sipcallid']=_0x4a5178[_0xd317('0x45')];}}}catch(_0x178eae){utils[_0xd317('0x2a')](util[_0xd317('0xb')](_0xd317('0x43'),_0x4a5178[_0xd317('0x9')]),_0x178eae);}};exports[_0xd317('0x58')]=function(_0x1130a9){try{if(!_[_0xd317('0x27')](channels[_0x1130a9[_0xd317('0x9')]])){utils[_0xd317('0x17')](util[_0xd317('0xb')](_0xd317('0x59'),_0x1130a9[_0xd317('0x9')]),_0x1130a9);utils[_0xd317('0x1b')](util[_0xd317('0xb')](_0xd317('0x5a'),_0x1130a9[_0xd317('0x9')],_0x1130a9[_0xd317('0x5b')],_0x1130a9[_0xd317('0x5c')]));if(_0x1130a9[_0xd317('0x5b')][_0xd317('0x5d')]()==_0xd317('0x5e')&&_[_0xd317('0x5f')](_0x1130a9['appdata'][_0xd317('0x5d')](),_0xd317('0x60'))){var _0x2d6018=_0x1130a9[_0xd317('0x5c')][_0xd317('0x61')]('=');var _0x2876b0=_0x2d6018[0x0][_0xd317('0x62')](_0x2d6018[0x0][_0xd317('0x63')]('(')+0x1,_0x2d6018[0x0]['lastIndexOf'](')'));var _0x28be0e=_0x2d6018[0x1];channels[_0x1130a9[_0xd317('0x9')]][_0x2876b0]=_0x28be0e;}if(!_['includes']([_0xd317('0x64'),'noop',_0xd317('0x65'),'set',_0xd317('0x66')],_0x1130a9[_0xd317('0x5b')][_0xd317('0x5d')]())){channels[_0x1130a9[_0xd317('0x9')]][_0xd317('0x4e')]=_0x1130a9[_0xd317('0x5b')];channels[_0x1130a9[_0xd317('0x9')]][_0xd317('0x67')]=_0x1130a9['appdata'];}}}catch(_0x280cad){utils[_0xd317('0x2a')](util[_0xd317('0xb')](_0xd317('0x59'),_0x1130a9['uniqueid']),_0x280cad);}}; \ No newline at end of file +var _0x8967=['[%s][calls][newchannel]','newstate','debug','[%s][calls][newstate]','isNil','channelstate','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','callerid','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','execif','gotoif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','CreateVoiceCallReport','request','newchannel','linkedid','OutgoingSpoolFailed','info','context','exten','now','DOCUMENTATION','error'];(function(_0x27887d,_0x110e27){var _0x16b836=function(_0x4c8cb4){while(--_0x4c8cb4){_0x27887d['push'](_0x27887d['shift']());}};_0x16b836(++_0x110e27);}(_0x8967,0x18c));var _0x7896=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8967[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x7896('0x0'));var utils=require(_0x7896('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0x7896('0x2'),_0x7896('0x3'),_0x7896('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0x7896('0x2'),_0x7896('0x4'),_0x7896('0x5'),_0x7896('0x3'),'FAILED',_0x7896('0x3')];var channels={};function writeDB(_0x55f6a5){var _0x14a865;if(transfers['blinds'][_0x55f6a5[_0x7896('0x6')]]){_0x14a865=_0x55f6a5[_0x7896('0x6')];_0x55f6a5[_0x7896('0x6')]=transfers[_0x7896('0x7')][_0x55f6a5[_0x7896('0x6')]][_0x7896('0x8')];}utils['info'](util[_0x7896('0x9')](_0x7896('0xa'),_0x55f6a5[_0x7896('0x6')],_0x55f6a5[_0x7896('0xb')],_0x55f6a5[_0x7896('0xc')],_0x55f6a5[_0x7896('0xd')],_0x55f6a5[_0x7896('0xe')],_0x55f6a5[_0x7896('0xf')],_0x55f6a5[_0x7896('0x10')],_0x55f6a5[_0x7896('0x11')]));if(_0x55f6a5[_0x7896('0x12')]){utils['getUserByInternal'](_0x55f6a5['accountcode'])[_0x7896('0x13')](function(_0xb2ab39){if(_0xb2ab39){_0x55f6a5[_0x7896('0x14')]=_0xb2ab39['id'];}utils['request'](_0x7896('0x15'),_0x55f6a5);});}else{utils[_0x7896('0x16')](_0x7896('0x15'),_0x55f6a5);}if(channels[_0x55f6a5[_0x7896('0x6')]]){delete channels[_0x55f6a5['uniqueid']];}else if(_0x14a865&&channels[_0x14a865]){delete transfers['blinds'][_0x14a865];delete channels[_0x14a865];}}exports[_0x7896('0x17')]=function(_0x233630){try{utils['debug'](util['format']('[%s][calls][newchannel]',_0x233630[_0x7896('0x6')]),_0x233630);if(_0x233630[_0x7896('0x6')]==_0x233630[_0x7896('0x18')]&&_0x233630['channel']!=_0x7896('0x19')){utils[_0x7896('0x1a')](util[_0x7896('0x9')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x233630[_0x7896('0x6')],_0x233630[_0x7896('0x1b')],_0x233630[_0x7896('0x1c')]));channels[_0x233630['uniqueid']]={'uniqueid':_0x233630[_0x7896('0x6')],'accountcode':_0x233630['accountcode'],'source':_0x233630[_0x7896('0xf')],'destination':_0x233630[_0x7896('0x1c')],'destinationcontext':_0x233630[_0x7896('0x1b')],'channel':_0x233630[_0x7896('0xb')],'starttime':utils[_0x7896('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7896('0x2'),'amaflags':_0x7896('0x1e')};}}catch(_0x3ddf3c){utils[_0x7896('0x1f')](util[_0x7896('0x9')](_0x7896('0x20'),_0x233630['uniqueid']),_0x3ddf3c);}};exports[_0x7896('0x21')]=function(_0x51400f){try{utils[_0x7896('0x22')](util['format'](_0x7896('0x23'),_0x51400f[_0x7896('0x6')]),_0x51400f);if(!_[_0x7896('0x24')](channels[_0x51400f[_0x7896('0x6')]])&&_0x51400f[_0x7896('0x25')]==0x6){utils[_0x7896('0x1a')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x51400f['uniqueid'],_0x51400f[_0x7896('0x1b')],_0x51400f['channel']));if(_[_0x7896('0x24')](channels[_0x51400f[_0x7896('0x6')]][_0x7896('0x26')])){channels[_0x51400f[_0x7896('0x6')]][_0x7896('0x26')]=utils[_0x7896('0x1d')]();}}else if(!_['isNil'](channels[_0x51400f[_0x7896('0x18')]])&&_0x51400f[_0x7896('0x25')]==0x6&&_0x51400f[_0x7896('0x1b')]!='transfer'){utils[_0x7896('0x1a')](util[_0x7896('0x9')](_0x7896('0x27'),_0x51400f[_0x7896('0x6')],_0x51400f[_0x7896('0x18')],_0x51400f[_0x7896('0x1b')],_0x51400f['channel']));channels[_0x51400f[_0x7896('0x18')]]['accountcode']=_0x51400f['accountcode'];channels[_0x51400f[_0x7896('0x18')]]['destinationchannel']=_0x51400f[_0x7896('0xb')];if(_[_0x7896('0x24')](channels[_0x51400f[_0x7896('0x18')]][_0x7896('0x28')])){channels[_0x51400f['linkedid']][_0x7896('0x28')]=utils[_0x7896('0x1d')]();}channels[_0x51400f[_0x7896('0x18')]][_0x7896('0x29')]=dispositions[_[_0x7896('0x2a')](_0x51400f[_0x7896('0x25')])]||_0x7896('0x4');}}catch(_0x430c72){utils[_0x7896('0x1f')](util[_0x7896('0x9')](_0x7896('0x23'),_0x51400f[_0x7896('0x6')]),_0x430c72);}};exports[_0x7896('0x2b')]=function(_0x20b8e6){try{if(!_[_0x7896('0x24')](channels[_0x20b8e6[_0x7896('0x6')]])){utils['debug'](util[_0x7896('0x9')](_0x7896('0x2c'),_0x20b8e6[_0x7896('0x6')]),_0x20b8e6);if(_[_0x7896('0x24')](channels[_0x20b8e6['uniqueid']]['callerid'])){channels[_0x20b8e6[_0x7896('0x6')]]['callerid']=_0x20b8e6['calleridname']+'\x20<'+_0x20b8e6[_0x7896('0xf')]+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x20b8e6[_0x7896('0x6')],channels[_0x20b8e6[_0x7896('0x6')]]['callerid'],_0x20b8e6[_0x7896('0x2d')]));channels[_0x20b8e6['uniqueid']][_0x7896('0x2e')]=utils[_0x7896('0x1d')]();channels[_0x20b8e6[_0x7896('0x6')]][_0x7896('0x2f')]=utils[_0x7896('0x30')](channels[_0x20b8e6[_0x7896('0x6')]]['endtime'],channels[_0x20b8e6[_0x7896('0x6')]][_0x7896('0x31')]);channels[_0x20b8e6[_0x7896('0x6')]][_0x7896('0x32')]=channels[_0x20b8e6[_0x7896('0x6')]][_0x7896('0x28')]?utils[_0x7896('0x30')](channels[_0x20b8e6[_0x7896('0x6')]][_0x7896('0x2e')],channels[_0x20b8e6['uniqueid']][_0x7896('0x28')]):0x0;writeDB(channels[_0x20b8e6['uniqueid']]);}}catch(_0x370cf7){utils['error'](util[_0x7896('0x9')]('[%s][calls][hangup]',_0x20b8e6['uniqueid']),_0x370cf7);}};exports['attendedtransfer']=function(_0xa68e06){try{if(!_[_0x7896('0x24')](channels[_0xa68e06[_0x7896('0x33')]])){utils[_0x7896('0x22')](util[_0x7896('0x9')](_0x7896('0x34'),_0xa68e06[_0x7896('0x35')]),_0xa68e06);if(channels[_0xa68e06['localtwolinkedid']][_0x7896('0xb')]==_0xa68e06[_0x7896('0x36')]){utils['info'](util['format'](_0x7896('0x37'),_0xa68e06['origtransfereruniqueid'],_0xa68e06[_0x7896('0x33')],_0xa68e06[_0x7896('0x38')]));channels[_0xa68e06[_0x7896('0x33')]][_0x7896('0x39')]=_0xa68e06[_0x7896('0x38')];channels[_0xa68e06[_0x7896('0x33')]][_0x7896('0x3a')]=_0x7896('0x3b');}else if(channels[_0xa68e06[_0x7896('0x33')]]['channel']=_0xa68e06[_0x7896('0x3c')]){utils['info'](util[_0x7896('0x9')](_0x7896('0x37'),_0xa68e06['origtransfereruniqueid'],_0xa68e06[_0x7896('0x33')],_0xa68e06['origtransfererchannel']));channels[_0xa68e06[_0x7896('0x33')]][_0x7896('0x39')]=_0xa68e06[_0x7896('0x3d')];channels[_0xa68e06[_0x7896('0x33')]][_0x7896('0x3a')]=_0x7896('0x3b');}}}catch(_0x1ecd95){utils['error'](util[_0x7896('0x9')]('[%s][calls][attendedtransfer]',_0xa68e06[_0x7896('0x35')]),_0x1ecd95);}};exports['musiconholdstart']=function(_0x1ac967){try{if(!_['isNil'](channels[_0x1ac967[_0x7896('0x6')]])){utils[_0x7896('0x22')](util['format'](_0x7896('0x3e'),_0x1ac967[_0x7896('0x6')]),_0x1ac967);channels[_0x1ac967['uniqueid']][_0x7896('0x3f')]=utils[_0x7896('0x1d')]();utils[_0x7896('0x1a')](util[_0x7896('0x9')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1ac967[_0x7896('0x6')],channels[_0x1ac967[_0x7896('0x6')]]['musiconholdstartAt']));}}catch(_0x497afb){utils[_0x7896('0x1f')](util[_0x7896('0x9')](_0x7896('0x3e'),_0x1ac967[_0x7896('0x6')]),_0x497afb);}};exports[_0x7896('0x40')]=function(_0x3669d4){try{if(!_[_0x7896('0x24')](channels[_0x3669d4[_0x7896('0x6')]])){utils['debug'](util[_0x7896('0x9')](_0x7896('0x41'),_0x3669d4['uniqueid']),_0x3669d4);if(!_[_0x7896('0x24')](channels[_0x3669d4[_0x7896('0x6')]]['musiconholdstartAt'])){channels[_0x3669d4[_0x7896('0x6')]][_0x7896('0x42')]+=utils[_0x7896('0x30')](utils[_0x7896('0x1d')](),channels[_0x3669d4[_0x7896('0x6')]]['musiconholdstartAt']);utils[_0x7896('0x1a')](util[_0x7896('0x9')](_0x7896('0x43'),_0x3669d4[_0x7896('0x6')],channels[_0x3669d4[_0x7896('0x6')]][_0x7896('0x42')]));delete channels[_0x3669d4[_0x7896('0x6')]][_0x7896('0x3f')];}}}catch(_0x18b059){utils['error'](util[_0x7896('0x9')](_0x7896('0x41'),_0x3669d4[_0x7896('0x6')]),_0x18b059);}};exports[_0x7896('0x44')]=function(_0x3f8dbe){try{if(!_['isNil'](channels[_0x3f8dbe[_0x7896('0x6')]])){utils[_0x7896('0x22')](util[_0x7896('0x9')](_0x7896('0x45'),_0x3f8dbe[_0x7896('0x6')]),_0x3f8dbe);if(!_[_0x7896('0x24')](_0x3f8dbe[_0x7896('0x46')][_0x7896('0x47')])){utils[_0x7896('0x1a')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3f8dbe[_0x7896('0x6')],_0x3f8dbe[_0x7896('0x48')]));channels[_0x3f8dbe['uniqueid']][_0x7896('0x49')]=_0x3f8dbe['value'];}if(!_['isNil'](_0x3f8dbe[_0x7896('0x46')]['xmd-phone'])){utils[_0x7896('0x1a')](util['format'](_0x7896('0x4a'),_0x3f8dbe[_0x7896('0x6')],_0x3f8dbe[_0x7896('0x48')]));channels[_0x3f8dbe[_0x7896('0x6')]]['destination']=_0x3f8dbe['value'];channels[_0x3f8dbe['uniqueid']][_0x7896('0x4b')]='\x22'+_0x3f8dbe[_0x7896('0x48')]+_0x7896('0x4c')+_0x3f8dbe[_0x7896('0x48')]+'>';}if(!_[_0x7896('0x24')](_0x3f8dbe[_0x7896('0x46')]['xmd-callerid-preview'])||!_[_0x7896('0x24')](_0x3f8dbe[_0x7896('0x46')]['xmd-callerid'])){utils[_0x7896('0x1a')](util[_0x7896('0x9')](_0x7896('0x4d'),_0x3f8dbe[_0x7896('0x6')],!_[_0x7896('0x24')](_0x3f8dbe['variable'][_0x7896('0x4e')])?_0x7896('0x4e'):_0x7896('0x4f'),_0x3f8dbe[_0x7896('0x48')]));channels[_0x3f8dbe[_0x7896('0x6')]][_0x7896('0x4b')]=_0x3f8dbe['value'];}if(!_['isNil'](_0x3f8dbe[_0x7896('0x46')]['xmd-queue'])||!_[_0x7896('0x24')](_0x3f8dbe[_0x7896('0x46')]['xmcs-queue'])){utils[_0x7896('0x1a')](util['format'](_0x7896('0x4d'),_0x3f8dbe[_0x7896('0x6')],!_[_0x7896('0x24')](_0x3f8dbe[_0x7896('0x46')][_0x7896('0x50')])?_0x7896('0x50'):_0x7896('0x51'),_0x3f8dbe[_0x7896('0x48')]));channels[_0x3f8dbe['uniqueid']][_0x7896('0x52')]='Queue';channels[_0x3f8dbe[_0x7896('0x6')]][_0x7896('0x53')]=_0x3f8dbe[_0x7896('0x48')];channels[_0x3f8dbe[_0x7896('0x6')]][_0x7896('0xc')]=!![];}if(!_['isNil'](_0x3f8dbe[_0x7896('0x46')][_0x7896('0x54')])){utils[_0x7896('0x1a')](util[_0x7896('0x9')](_0x7896('0x55'),_0x3f8dbe[_0x7896('0x6')],_0x3f8dbe[_0x7896('0x48')]));channels[_0x3f8dbe[_0x7896('0x6')]][_0x7896('0x56')]=_0x3f8dbe[_0x7896('0x48')];}if(!_[_0x7896('0x24')](_0x3f8dbe[_0x7896('0x46')][_0x7896('0x57')])){utils[_0x7896('0x1a')](util[_0x7896('0x9')](_0x7896('0x58'),_0x3f8dbe[_0x7896('0x6')],_0x3f8dbe[_0x7896('0x48')]));channels[_0x3f8dbe[_0x7896('0x6')]][_0x7896('0x59')]=_0x3f8dbe[_0x7896('0x48')];}if(!_['isNil'](_0x3f8dbe[_0x7896('0x46')][_0x7896('0x5a')])){utils['info'](util[_0x7896('0x9')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x3f8dbe['uniqueid'],_0x3f8dbe[_0x7896('0x48')]));channels[_0x3f8dbe[_0x7896('0x6')]][_0x7896('0x5b')]=_0x3f8dbe[_0x7896('0x48')];}if(!_[_0x7896('0x24')](_0x3f8dbe[_0x7896('0x46')][_0x7896('0x5c')])){utils['info'](util[_0x7896('0x9')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3f8dbe[_0x7896('0x6')],_0x3f8dbe['value']));channels[_0x3f8dbe['uniqueid']]['sipcallid']=_0x3f8dbe[_0x7896('0x48')];}}}catch(_0x1e53d1){utils[_0x7896('0x1f')](util[_0x7896('0x9')](_0x7896('0x45'),_0x3f8dbe[_0x7896('0x6')]),_0x1e53d1);}};exports['newexten']=function(_0x29b6d){try{if(!_[_0x7896('0x24')](channels[_0x29b6d[_0x7896('0x6')]])){utils['debug'](util['format'](_0x7896('0x5d'),_0x29b6d[_0x7896('0x6')]),_0x29b6d);utils['info'](util[_0x7896('0x9')](_0x7896('0x5e'),_0x29b6d[_0x7896('0x6')],_0x29b6d[_0x7896('0x5f')],_0x29b6d['appdata']));if(_0x29b6d['application'][_0x7896('0x60')]()==_0x7896('0x61')&&_[_0x7896('0x62')](_0x29b6d[_0x7896('0x63')][_0x7896('0x60')](),_0x7896('0x64'))){var _0xa20be0=_0x29b6d['appdata'][_0x7896('0x65')]('=');var _0xaa1bc4=_0xa20be0[0x0][_0x7896('0x66')](_0xa20be0[0x0][_0x7896('0x67')]('(')+0x1,_0xa20be0[0x0][_0x7896('0x67')](')'));var _0x2cde9c=_0xa20be0[0x1];channels[_0x29b6d['uniqueid']][_0xaa1bc4]=_0x2cde9c;}if(!_['includes']([_0x7896('0x2b'),_0x7896('0x68'),_0x7896('0x69'),_0x7896('0x61'),_0x7896('0x6a')],_0x29b6d[_0x7896('0x5f')][_0x7896('0x60')]())){channels[_0x29b6d[_0x7896('0x6')]][_0x7896('0x52')]=_0x29b6d[_0x7896('0x5f')];channels[_0x29b6d[_0x7896('0x6')]]['lastdata']=_0x29b6d[_0x7896('0x63')];}}}catch(_0x22d93f){utils[_0x7896('0x1f')](util[_0x7896('0x9')](_0x7896('0x5d'),_0x29b6d['uniqueid']),_0x22d93f);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 4f89fcc..da4a0c8 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 _0x9494=['connect','shutdown','info','[core]\x20shutdown','error','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x9494,0xcf));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require('./utils');exports[_0x4949('0x0')]=function(){utils['info']('[core]\x20connected');};exports[_0x4949('0x1')]=function(){utils[_0x4949('0x2')](_0x4949('0x3'));};exports['fullybooted']=function(){utils[_0x4949('0x2')]('[core]\x20fullybooted');};exports[_0x4949('0x4')]=function(_0x12bebe){utils['error'](_0x4949('0x5'),_0x12bebe);};exports[_0x4949('0x6')]=function(){utils[_0x4949('0x2')](_0x4949('0x7'));};exports[_0x4949('0x8')]=function(_0x2cafa9){}; \ No newline at end of file +var _0x916d=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils'];(function(_0xaca51d,_0x4f2453){var _0x1443c5=function(_0x3cc2af){while(--_0x3cc2af){_0xaca51d['push'](_0xaca51d['shift']());}};_0x1443c5(++_0x4f2453);}(_0x916d,0x81));var _0xd916=function(_0x464fae,_0x4c5b72){_0x464fae=_0x464fae-0x0;var _0x2c57db=_0x916d[_0x464fae];return _0x2c57db;};'use strict';var utils=require(_0xd916('0x0'));exports[_0xd916('0x1')]=function(){utils[_0xd916('0x2')](_0xd916('0x3'));};exports[_0xd916('0x4')]=function(){utils[_0xd916('0x2')](_0xd916('0x5'));};exports[_0xd916('0x6')]=function(){utils[_0xd916('0x2')](_0xd916('0x7'));};exports['error']=function(_0x10f7e7){utils[_0xd916('0x8')](_0xd916('0x9'),_0x10f7e7);};exports[_0xd916('0xa')]=function(){utils[_0xd916('0x2')](_0xd916('0xb'));};exports[_0xd916('0xc')]=function(_0x13f4fc){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index d86e59a..9fab116 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 _0x999f=['calleridname','cause-txt','complete','diffTime','endtime','holdtime','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','assign','starttime','now','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s'];(function(_0x4670e,_0x19e50c){var _0xab329a=function(_0x4fc5ba){while(--_0x4fc5ba){_0x4670e['push'](_0x4670e['shift']());}};_0xab329a(++_0x19e50c);}(_0x999f,0xf1));var _0xf999=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x999f[_0x13b392];return _0x39db24;};'use strict';var _=require('lodash');var util=require(_0xf999('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x26a5da){utils[_0xf999('0x1')](util[_0xf999('0x2')](_0xf999('0x3'),_0x26a5da[_0xf999('0x4')],_0x26a5da['channel'],_0x26a5da[_0xf999('0x5')],_0x26a5da[_0xf999('0x6')],_0x26a5da[_0xf999('0x7')],_0x26a5da[_0xf999('0x8')]));utils['request'](_0xf999('0x9'),_0x26a5da);delete dials[_0x26a5da[_0xf999('0x4')]];}exports[_0xf999('0xa')]=function(_0x17b34f){try{utils[_0xf999('0xb')](util['format'](_0xf999('0xc'),_0x17b34f['uniqueid']),_0x17b34f);utils[_0xf999('0x1')](util[_0xf999('0x2')](_0xf999('0xd'),_0x17b34f[_0xf999('0x4')],_0x17b34f[_0xf999('0xe')],_0x17b34f[_0xf999('0xf')]));if(_0x17b34f[_0xf999('0xe')]['toLowerCase']()==_0xf999('0x10')&&_[_0xf999('0x11')](_0x17b34f[_0xf999('0xf')][_0xf999('0x12')](),'cdr(routeid)')){var _0x1f7cca=_0x17b34f[_0xf999('0xf')][_0xf999('0x13')]('=');dials[_0x17b34f[_0xf999('0x4')]]={'routeId':_0x1f7cca[0x1]};}}catch(_0x5acc33){utils['error'](util[_0xf999('0x2')](_0xf999('0xc'),_0x17b34f[_0xf999('0x4')]),_0x5acc33);}};exports[_0xf999('0x14')]=function(_0x126570){try{utils[_0xf999('0xb')](util[_0xf999('0x2')](_0xf999('0x15'),_0x126570[_0xf999('0x4')]),_0x126570);if(!_[_0xf999('0x16')](_0x126570['variable'][_0xf999('0x17')])){utils[_0xf999('0x1')](util[_0xf999('0x2')](_0xf999('0x18'),_0x126570[_0xf999('0x4')],_0x126570['value']));dials[_0x126570['uniqueid']]={'routeId':_0x126570[_0xf999('0x19')]};}}catch(_0x5a416b){utils[_0xf999('0x1a')](util[_0xf999('0x2')](_0xf999('0x15'),_0x126570[_0xf999('0x4')]),_0x5a416b);}};exports['dialbegin']=function(_0x4180d9){try{if(!_[_0xf999('0x16')](dials[_0x4180d9[_0xf999('0x4')]])){utils['debug'](util[_0xf999('0x2')](_0xf999('0x1b'),_0x4180d9[_0xf999('0x4')]),_0x4180d9);dials[_0x4180d9[_0xf999('0x4')]]=_[_0xf999('0x1c')](dials[_0x4180d9[_0xf999('0x4')]],_0x4180d9);dials[_0x4180d9[_0xf999('0x4')]][_0xf999('0x1d')]=utils[_0xf999('0x1e')]();dials[_0x4180d9['uniqueid']]['lastevent']='called';utils[_0xf999('0x1')](util['format'](_0xf999('0x1f'),_0x4180d9[_0xf999('0x4')],dials[_0x4180d9[_0xf999('0x4')]][_0xf999('0x1d')]));}}catch(_0x1971ab){utils['error'](util[_0xf999('0x2')](_0xf999('0x1b'),_0x4180d9[_0xf999('0x4')]),_0x1971ab);}};exports[_0xf999('0x20')]=function(_0x3672b3){try{if(!_[_0xf999('0x16')](dials[_0x3672b3['uniqueid']])){utils[_0xf999('0xb')](util[_0xf999('0x2')]('[%s][dials][dialend]',_0x3672b3['uniqueid']),_0x3672b3);dials[_0x3672b3[_0xf999('0x4')]][_0xf999('0x8')]=_0x3672b3['dialstatus'];if(_0x3672b3['dialstatus']=='ANSWER'){dials[_0x3672b3[_0xf999('0x4')]]=_[_0xf999('0x1c')](dials[_0x3672b3[_0xf999('0x4')]],_0x3672b3);dials[_0x3672b3['uniqueid']][_0xf999('0x21')]=utils['now']();dials[_0x3672b3['uniqueid']][_0xf999('0x22')]=_0xf999('0x23');utils['info'](util[_0xf999('0x2')](_0xf999('0x24'),_0x3672b3[_0xf999('0x4')],_0x3672b3[_0xf999('0x8')],dials[_0x3672b3[_0xf999('0x4')]][_0xf999('0x21')]));}else{utils['info'](util[_0xf999('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x3672b3[_0xf999('0x4')],_0x3672b3[_0xf999('0x8')]));}}}catch(_0x4c3495){utils['error'](util['format'](_0xf999('0x25'),_0x3672b3['uniqueid']),_0x4c3495);}};exports[_0xf999('0x26')]=function(_0x2d326e){try{if(!_['isNil'](dials[_0x2d326e[_0xf999('0x4')]])){utils[_0xf999('0xb')](util['format'](_0xf999('0x27'),_0x2d326e['uniqueid']),_0x2d326e);utils['info'](util['format'](_0xf999('0x28'),_0x2d326e[_0xf999('0x4')],_0x2d326e[_0xf999('0x6')],_0x2d326e[_0xf999('0x29')],_0x2d326e[_0xf999('0x2a')]));dials[_0x2d326e[_0xf999('0x4')]]=_[_0xf999('0x1c')](dials[_0x2d326e[_0xf999('0x4')]],{'endtime':utils['now'](),'lastevent':_0xf999('0x2b')});dials[_0x2d326e[_0xf999('0x4')]]['duration']=utils[_0xf999('0x2c')](dials[_0x2d326e[_0xf999('0x4')]][_0xf999('0x2d')],dials[_0x2d326e[_0xf999('0x4')]][_0xf999('0x1d')]);dials[_0x2d326e[_0xf999('0x4')]][_0xf999('0x2e')]=utils[_0xf999('0x2c')](dials[_0x2d326e[_0xf999('0x4')]][_0xf999('0x21')]||dials[_0x2d326e[_0xf999('0x4')]][_0xf999('0x2d')],dials[_0x2d326e[_0xf999('0x4')]]['starttime']);dials[_0x2d326e[_0xf999('0x4')]]['billableseconds']=dials[_0x2d326e['uniqueid']]['answertime']?utils[_0xf999('0x2c')](dials[_0x2d326e[_0xf999('0x4')]][_0xf999('0x2d')],dials[_0x2d326e[_0xf999('0x4')]][_0xf999('0x21')]):0x0;writeDB(dials[_0x2d326e['uniqueid']]);}}catch(_0x3ac4c4){utils[_0xf999('0x1a')](util[_0xf999('0x2')](_0xf999('0x27'),_0x2d326e[_0xf999('0x4')]),_0x3ac4c4);}}; \ No newline at end of file +var _0x171c=['starttime','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','holdtime','endtime','billableseconds','diffTime','lodash','util','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called'];(function(_0x32a432,_0x1bcd75){var _0x23b513=function(_0x2dccd3){while(--_0x2dccd3){_0x32a432['push'](_0x32a432['shift']());}};_0x23b513(++_0x1bcd75);}(_0x171c,0x176));var _0xc171=function(_0x2e6002,_0x6693f5){_0x2e6002=_0x2e6002-0x0;var _0x2e92ce=_0x171c[_0x2e6002];return _0x2e92ce;};'use strict';var _=require(_0xc171('0x0'));var util=require(_0xc171('0x1'));var utils=require(_0xc171('0x2'));var dials={};function writeDB(_0x17095d){utils[_0xc171('0x3')](util[_0xc171('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x17095d[_0xc171('0x5')],_0x17095d[_0xc171('0x6')],_0x17095d[_0xc171('0x7')],_0x17095d[_0xc171('0x8')],_0x17095d[_0xc171('0x9')],_0x17095d[_0xc171('0xa')]));utils[_0xc171('0xb')]('CreateVoiceDialReport',_0x17095d);delete dials[_0x17095d[_0xc171('0x5')]];}exports['newexten']=function(_0x2afa97){try{utils[_0xc171('0xc')](util['format'](_0xc171('0xd'),_0x2afa97[_0xc171('0x5')]),_0x2afa97);utils[_0xc171('0x3')](util[_0xc171('0x4')](_0xc171('0xe'),_0x2afa97[_0xc171('0x5')],_0x2afa97['application'],_0x2afa97[_0xc171('0xf')]));if(_0x2afa97[_0xc171('0x10')][_0xc171('0x11')]()==_0xc171('0x12')&&_[_0xc171('0x13')](_0x2afa97[_0xc171('0xf')][_0xc171('0x11')](),'cdr(routeid)')){var _0xfa2551=_0x2afa97[_0xc171('0xf')][_0xc171('0x14')]('=');dials[_0x2afa97[_0xc171('0x5')]]={'routeId':_0xfa2551[0x1]};}}catch(_0x32611a){utils[_0xc171('0x15')](util[_0xc171('0x4')](_0xc171('0xd'),_0x2afa97['uniqueid']),_0x32611a);}};exports[_0xc171('0x16')]=function(_0x15c488){try{utils[_0xc171('0xc')](util['format'](_0xc171('0x17'),_0x15c488[_0xc171('0x5')]),_0x15c488);if(!_[_0xc171('0x18')](_0x15c488[_0xc171('0x19')][_0xc171('0x1a')])){utils[_0xc171('0x3')](util[_0xc171('0x4')](_0xc171('0x1b'),_0x15c488[_0xc171('0x5')],_0x15c488[_0xc171('0x1c')]));dials[_0x15c488[_0xc171('0x5')]]={'routeId':_0x15c488[_0xc171('0x1c')]};}}catch(_0x1ece1e){utils[_0xc171('0x15')](util[_0xc171('0x4')](_0xc171('0x17'),_0x15c488[_0xc171('0x5')]),_0x1ece1e);}};exports[_0xc171('0x1d')]=function(_0x100740){try{if(!_[_0xc171('0x18')](dials[_0x100740['uniqueid']])){utils[_0xc171('0xc')](util[_0xc171('0x4')](_0xc171('0x1e'),_0x100740[_0xc171('0x5')]),_0x100740);dials[_0x100740[_0xc171('0x5')]]=_['assign'](dials[_0x100740[_0xc171('0x5')]],_0x100740);dials[_0x100740[_0xc171('0x5')]]['starttime']=utils[_0xc171('0x1f')]();dials[_0x100740['uniqueid']]['lastevent']=_0xc171('0x20');utils[_0xc171('0x3')](util['format'](_0xc171('0x21'),_0x100740[_0xc171('0x5')],dials[_0x100740['uniqueid']][_0xc171('0x22')]));}}catch(_0x192617){utils[_0xc171('0x15')](util['format']('[%s][dials][dialbegin]',_0x100740[_0xc171('0x5')]),_0x192617);}};exports['dialend']=function(_0x3d99bf){try{if(!_[_0xc171('0x18')](dials[_0x3d99bf[_0xc171('0x5')]])){utils[_0xc171('0xc')](util['format']('[%s][dials][dialend]',_0x3d99bf[_0xc171('0x5')]),_0x3d99bf);dials[_0x3d99bf[_0xc171('0x5')]][_0xc171('0xa')]=_0x3d99bf[_0xc171('0xa')];if(_0x3d99bf['dialstatus']==_0xc171('0x23')){dials[_0x3d99bf[_0xc171('0x5')]]=_[_0xc171('0x24')](dials[_0x3d99bf[_0xc171('0x5')]],_0x3d99bf);dials[_0x3d99bf[_0xc171('0x5')]][_0xc171('0x25')]=utils[_0xc171('0x1f')]();dials[_0x3d99bf['uniqueid']]['lastevent']=_0xc171('0x26');utils[_0xc171('0x3')](util['format'](_0xc171('0x27'),_0x3d99bf[_0xc171('0x5')],_0x3d99bf[_0xc171('0xa')],dials[_0x3d99bf['uniqueid']]['answertime']));}else{utils[_0xc171('0x3')](util[_0xc171('0x4')](_0xc171('0x28'),_0x3d99bf[_0xc171('0x5')],_0x3d99bf['dialstatus']));}}}catch(_0x52bf63){utils[_0xc171('0x15')](util['format'](_0xc171('0x29'),_0x3d99bf[_0xc171('0x5')]),_0x52bf63);}};exports['hangup']=function(_0x1747c2){try{if(!_[_0xc171('0x18')](dials[_0x1747c2[_0xc171('0x5')]])){utils['debug'](util[_0xc171('0x4')](_0xc171('0x2a'),_0x1747c2[_0xc171('0x5')]),_0x1747c2);utils['info'](util[_0xc171('0x4')](_0xc171('0x2b'),_0x1747c2['uniqueid'],_0x1747c2[_0xc171('0x8')],_0x1747c2[_0xc171('0x2c')],_0x1747c2['cause-txt']));dials[_0x1747c2['uniqueid']]=_[_0xc171('0x24')](dials[_0x1747c2['uniqueid']],{'endtime':utils[_0xc171('0x1f')](),'lastevent':_0xc171('0x2d')});dials[_0x1747c2[_0xc171('0x5')]][_0xc171('0x2e')]=utils['diffTime'](dials[_0x1747c2[_0xc171('0x5')]]['endtime'],dials[_0x1747c2[_0xc171('0x5')]]['starttime']);dials[_0x1747c2[_0xc171('0x5')]][_0xc171('0x2f')]=utils['diffTime'](dials[_0x1747c2[_0xc171('0x5')]][_0xc171('0x25')]||dials[_0x1747c2[_0xc171('0x5')]][_0xc171('0x30')],dials[_0x1747c2[_0xc171('0x5')]][_0xc171('0x22')]);dials[_0x1747c2[_0xc171('0x5')]][_0xc171('0x31')]=dials[_0x1747c2[_0xc171('0x5')]]['answertime']?utils[_0xc171('0x32')](dials[_0x1747c2[_0xc171('0x5')]][_0xc171('0x30')],dials[_0x1747c2[_0xc171('0x5')]][_0xc171('0x25')]):0x0;writeDB(dials[_0x1747c2['uniqueid']]);}}catch(_0x54cb98){utils[_0xc171('0x15')](util['format'](_0xc171('0x2a'),_0x1747c2[_0xc171('0x5')]),_0x54cb98);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index d8ce461..24b89c9 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 _0x68d2=['musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./dials.controller','connect','shutdown','fullybooted','error','close','managerevent','format','device','devicestatechange','[%s][index][devicestatechange]','debug','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]'];(function(_0x1d1345,_0x405c9c){var _0x3d80ef=function(_0x9ac739){while(--_0x9ac739){_0x1d1345['push'](_0x1d1345['shift']());}};_0x3d80ef(++_0x405c9c);}(_0x68d2,0x1ee));var _0x268d=function(_0x35bf23,_0x71e56e){_0x35bf23=_0x35bf23-0x0;var _0x4b8d02=_0x68d2[_0x35bf23];return _0x4b8d02;};var AsteriskManager=require(_0x268d('0x0'));var config=require(_0x268d('0x1'));var utils=require('./utils');var util=require(_0x268d('0x2'));var ami=new AsteriskManager(config[_0x268d('0x3')][_0x268d('0x4')],config['asterisk']['ip'],config[_0x268d('0x3')][_0x268d('0x5')],config['asterisk'][_0x268d('0x6')],!![]);ami[_0x268d('0x7')]();if(config['xdr']&&config[_0x268d('0x8')][_0x268d('0x9')]){utils[_0x268d('0xa')](_0x268d('0xb'));}else{var agents=require(_0x268d('0xc'));var calls=require('./calls.controller');var queues=require(_0x268d('0xd'));var recordings=require(_0x268d('0xe'));var members=require('./members.controller');var dials=require(_0x268d('0xf'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on']('connect',core[_0x268d('0x10')]);ami['on'](_0x268d('0x11'),core['shutdown']);ami['on']('fullybooted',core[_0x268d('0x12')]);ami['on'](_0x268d('0x13'),core[_0x268d('0x13')]);ami['on'](_0x268d('0x14'),core['close']);ami['on'](_0x268d('0x15'),core[_0x268d('0x15')]);ami['on']('devicestatechange',function(_0x108744){try{utils['debug'](util[_0x268d('0x16')]('[%s][index][devicestatechange]',_0x108744[_0x268d('0x17')]),_0x108744);members[_0x268d('0x18')](_0x108744);}catch(_0x52916a){utils[_0x268d('0x13')](util[_0x268d('0x16')](_0x268d('0x19'),_0x108744[_0x268d('0x17')]),_0x52916a);}});ami['on']('agentcalled',function(_0x3ef35b){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x1b'),_0x3ef35b[_0x268d('0x1c')]),_0x3ef35b);agents[_0x268d('0x1d')](_0x3ef35b);}catch(_0x4628ac){utils['error'](util['format']('[%s][index][agentcalled]',_0x3ef35b['uniqueid']),_0x4628ac);}});ami['on'](_0x268d('0x1e'),function(_0x3c5eef){try{utils['debug'](util['format']('[%s][index][agentringnoanswer]',_0x3c5eef['uniqueid']),_0x3c5eef);agents[_0x268d('0x1e')](_0x3c5eef);}catch(_0x4adf3f){utils[_0x268d('0x13')](util['format'](_0x268d('0x1f'),_0x3c5eef[_0x268d('0x1c')]),_0x4adf3f);}});ami['on'](_0x268d('0x20'),function(_0x5836a7){try{utils[_0x268d('0x1a')](util['format'](_0x268d('0x21'),_0x5836a7[_0x268d('0x1c')]),_0x5836a7);agents[_0x268d('0x20')](_0x5836a7);queues[_0x268d('0x20')](_0x5836a7);}catch(_0x450559){utils[_0x268d('0x13')](util[_0x268d('0x16')](_0x268d('0x21'),_0x5836a7[_0x268d('0x1c')]),_0x450559);}});ami['on'](_0x268d('0x22'),function(_0xce26e2){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x23'),_0xce26e2['uniqueid']),_0xce26e2);agents[_0x268d('0x22')](_0xce26e2);queues['agentcomplete'](_0xce26e2);members[_0x268d('0x22')](_0xce26e2);}catch(_0x163883){utils[_0x268d('0x13')](util['format'](_0x268d('0x23'),_0xce26e2['uniqueid']),_0x163883);}});ami['on'](_0x268d('0x24'),function(_0x59ac88){try{utils[_0x268d('0x1a')](util['format'](_0x268d('0x25'),_0x59ac88['uniqueid']),_0x59ac88);agents[_0x268d('0x24')](_0x59ac88);queues[_0x268d('0x24')](_0x59ac88);}catch(_0x4fab6b){utils[_0x268d('0x13')](util[_0x268d('0x16')](_0x268d('0x25'),_0x59ac88[_0x268d('0x1c')]),_0x4fab6b);}});ami['on'](_0x268d('0x26'),function(_0x538a51){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x27'),_0x538a51['uniqueid']),_0x538a51);queues['queuecallerjoin'](_0x538a51);recordings['queuecallerjoin'](_0x538a51);}catch(_0x28793c){utils['error'](util[_0x268d('0x16')](_0x268d('0x27'),_0x538a51[_0x268d('0x1c')]),_0x28793c);}});ami['on'](_0x268d('0x28'),function(_0x241364){try{utils[_0x268d('0x1a')](util['format'](_0x268d('0x29'),_0x241364[_0x268d('0x1c')]),_0x241364);queues[_0x268d('0x28')](_0x241364);}catch(_0x3f201c){utils['error'](util[_0x268d('0x16')]('[%s][index][queuecallerleave]',_0x241364[_0x268d('0x1c')]),_0x3f201c);}});ami['on'](_0x268d('0x2a'),function(_0x5f20d5){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x2b'),_0x5f20d5[_0x268d('0x1c')]),_0x5f20d5);queues[_0x268d('0x2a')](_0x5f20d5);calls[_0x268d('0x2a')](_0x5f20d5);}catch(_0x225024){utils[_0x268d('0x13')](util[_0x268d('0x16')]('[%s][index][musiconholdstart]',_0x5f20d5[_0x268d('0x1c')]),_0x225024);}});ami['on']('musiconholdstop',function(_0x53e224){try{utils['debug'](util[_0x268d('0x16')](_0x268d('0x2c'),_0x53e224[_0x268d('0x1c')]),_0x53e224);queues[_0x268d('0x2d')](_0x53e224);calls[_0x268d('0x2d')](_0x53e224);}catch(_0x259e7d){utils[_0x268d('0x13')](util[_0x268d('0x16')]('[%s][index][musiconholdstop]',_0x53e224[_0x268d('0x1c')]),_0x259e7d);}});ami['on']('newstate',function(_0x402de5){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x2e'),_0x402de5['uniqueid']),_0x402de5);calls[_0x268d('0x2f')](_0x402de5);recordings[_0x268d('0x2f')](_0x402de5);}catch(_0x42e99d){utils['error'](util['format'](_0x268d('0x2e'),_0x402de5[_0x268d('0x1c')]),_0x42e99d);}});ami['on']('hangup',function(_0x3a8520){try{utils['debug'](util['format'](_0x268d('0x30'),_0x3a8520[_0x268d('0x1c')]),_0x3a8520);calls[_0x268d('0x31')](_0x3a8520);recordings[_0x268d('0x31')](_0x3a8520);dials['hangup'](_0x3a8520);agents[_0x268d('0x31')](_0x3a8520);queues['hangup'](_0x3a8520);}catch(_0x4b05de){utils[_0x268d('0x13')](util[_0x268d('0x16')](_0x268d('0x30'),_0x3a8520['uniqueid']),_0x4b05de);}});ami['on']('cdr',function(_0x1d5fca){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x32'),_0x1d5fca[_0x268d('0x1c')]),_0x1d5fca);members[_0x268d('0x33')](_0x1d5fca);}catch(_0x24ec1a){utils[_0x268d('0x13')](util[_0x268d('0x16')]('[%s][index][cdr]',_0x1d5fca['uniqueid']),_0x24ec1a);}});ami['on'](_0x268d('0x34'),function(_0x2c426e){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x35'),_0x2c426e['uniqueid']),_0x2c426e);queues[_0x268d('0x34')](_0x2c426e);agents['blindtransfer'](_0x2c426e);transfers[_0x268d('0x34')](_0x2c426e);}catch(_0x1729fb){utils[_0x268d('0x13')](util[_0x268d('0x16')](_0x268d('0x35'),_0x2c426e[_0x268d('0x1c')]),_0x1729fb);}});ami['on'](_0x268d('0x36'),function(_0x279bc6){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x37'),_0x279bc6[_0x268d('0x38')]),_0x279bc6);queues[_0x268d('0x36')](_0x279bc6);transfers['attendedtransfer'](_0x279bc6);agents[_0x268d('0x36')](_0x279bc6);calls[_0x268d('0x36')](_0x279bc6);}catch(_0x21d60f){utils[_0x268d('0x13')](util[_0x268d('0x16')]('[%s][index][attendedtransfer]',_0x279bc6[_0x268d('0x38')]),_0x21d60f);}});ami['on']('varset',function(_0x52858a){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x39'),_0x52858a[_0x268d('0x1c')]),_0x52858a);queues['varset'](_0x52858a);recordings[_0x268d('0x3a')](_0x52858a);calls[_0x268d('0x3a')](_0x52858a);dials[_0x268d('0x3a')](_0x52858a);}catch(_0xcf2b52){utils[_0x268d('0x13')](util[_0x268d('0x16')]('[%s][index][varset]',_0x52858a['uniqueid']),_0xcf2b52);}});ami['on'](_0x268d('0x3b'),function(_0x2a6a85){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x3c'),_0x2a6a85[_0x268d('0x1c')]),_0x2a6a85);calls[_0x268d('0x3b')](_0x2a6a85);recordings[_0x268d('0x3b')](_0x2a6a85);dials[_0x268d('0x3b')](_0x2a6a85);}catch(_0x58a1c7){utils[_0x268d('0x13')](util[_0x268d('0x16')](_0x268d('0x3c'),_0x2a6a85[_0x268d('0x1c')]),_0x58a1c7);}});ami['on']('newchannel',function(_0x288b27){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x3d'),_0x288b27[_0x268d('0x1c')]),_0x288b27);calls[_0x268d('0x3e')](_0x288b27);recordings['newchannel'](_0x288b27);}catch(_0xa9567f){utils['error'](util[_0x268d('0x16')](_0x268d('0x3d'),_0x288b27[_0x268d('0x1c')]),_0xa9567f);}});ami['on'](_0x268d('0x3f'),function(_0x346994){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x40'),_0x346994[_0x268d('0x1c')]),_0x346994);dials[_0x268d('0x3f')](_0x346994);}catch(_0x1b8e59){utils[_0x268d('0x13')](util['format'](_0x268d('0x41'),_0x346994[_0x268d('0x1c')]),_0x1b8e59);}});ami['on']('dialend',function(_0x5b8f13){try{utils[_0x268d('0x1a')](util[_0x268d('0x16')](_0x268d('0x42'),_0x5b8f13[_0x268d('0x1c')]),_0x5b8f13);dials['dialend'](_0x5b8f13);}catch(_0x21aca5){utils[_0x268d('0x13')](util[_0x268d('0x16')](_0x268d('0x42'),_0x5b8f13['uniqueid']),_0x21aca5);}});} \ No newline at end of file +var _0xd46b=['managerevent','format','[%s][index][devicestatechange]','devicestatechange','device','debug','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','username','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close'];(function(_0x5cc352,_0x1cb1bf){var _0x1eadc9=function(_0x2838c4){while(--_0x2838c4){_0x5cc352['push'](_0x5cc352['shift']());}};_0x1eadc9(++_0x1cb1bf);}(_0xd46b,0x6f));var _0xbd46=function(_0x4b3da3,_0x7e6f6a){_0x4b3da3=_0x4b3da3-0x0;var _0x373c4f=_0xd46b[_0x4b3da3];return _0x373c4f;};var AsteriskManager=require(_0xbd46('0x0'));var config=require(_0xbd46('0x1'));var utils=require('./utils');var util=require(_0xbd46('0x2'));var ami=new AsteriskManager(config[_0xbd46('0x3')]['port'],config['asterisk']['ip'],config[_0xbd46('0x3')][_0xbd46('0x4')],config['asterisk']['password'],!![]);ami[_0xbd46('0x5')]();if(config[_0xbd46('0x6')]&&config[_0xbd46('0x6')]['disabled']){utils[_0xbd46('0x7')](_0xbd46('0x8'));}else{var agents=require(_0xbd46('0x9'));var calls=require('./calls.controller');var queues=require(_0xbd46('0xa'));var recordings=require(_0xbd46('0xb'));var members=require(_0xbd46('0xc'));var dials=require(_0xbd46('0xd'));var transfers=require(_0xbd46('0xe'));var core=require(_0xbd46('0xf'));ami['on'](_0xbd46('0x10'),core[_0xbd46('0x10')]);ami['on'](_0xbd46('0x11'),core[_0xbd46('0x11')]);ami['on']('fullybooted',core[_0xbd46('0x12')]);ami['on'](_0xbd46('0x13'),core[_0xbd46('0x13')]);ami['on'](_0xbd46('0x14'),core[_0xbd46('0x14')]);ami['on'](_0xbd46('0x15'),core['managerevent']);ami['on']('devicestatechange',function(_0x5ddd88){try{utils['debug'](util[_0xbd46('0x16')](_0xbd46('0x17'),_0x5ddd88['device']),_0x5ddd88);members[_0xbd46('0x18')](_0x5ddd88);}catch(_0x3d2951){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x17'),_0x5ddd88[_0xbd46('0x19')]),_0x3d2951);}});ami['on']('agentcalled',function(_0xf5c9dc){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')](_0xbd46('0x1b'),_0xf5c9dc[_0xbd46('0x1c')]),_0xf5c9dc);agents[_0xbd46('0x1d')](_0xf5c9dc);}catch(_0x51375e){utils['error'](util[_0xbd46('0x16')](_0xbd46('0x1b'),_0xf5c9dc[_0xbd46('0x1c')]),_0x51375e);}});ami['on'](_0xbd46('0x1e'),function(_0x10ee22){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')]('[%s][index][agentringnoanswer]',_0x10ee22[_0xbd46('0x1c')]),_0x10ee22);agents[_0xbd46('0x1e')](_0x10ee22);}catch(_0x78869d){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x1f'),_0x10ee22['uniqueid']),_0x78869d);}});ami['on'](_0xbd46('0x20'),function(_0x5ac775){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')]('[%s][index][agentconnect]',_0x5ac775['uniqueid']),_0x5ac775);agents['agentconnect'](_0x5ac775);queues[_0xbd46('0x20')](_0x5ac775);}catch(_0x336072){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x21'),_0x5ac775[_0xbd46('0x1c')]),_0x336072);}});ami['on'](_0xbd46('0x22'),function(_0x36e512){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')]('[%s][index][agentcomplete]',_0x36e512[_0xbd46('0x1c')]),_0x36e512);agents['agentcomplete'](_0x36e512);queues['agentcomplete'](_0x36e512);members['agentcomplete'](_0x36e512);}catch(_0x29395f){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x23'),_0x36e512[_0xbd46('0x1c')]),_0x29395f);}});ami['on'](_0xbd46('0x24'),function(_0x305c4f){try{utils[_0xbd46('0x1a')](util['format'](_0xbd46('0x25'),_0x305c4f['uniqueid']),_0x305c4f);agents[_0xbd46('0x24')](_0x305c4f);queues[_0xbd46('0x24')](_0x305c4f);}catch(_0x4038f0){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x25'),_0x305c4f['uniqueid']),_0x4038f0);}});ami['on'](_0xbd46('0x26'),function(_0x3d4acf){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')](_0xbd46('0x27'),_0x3d4acf[_0xbd46('0x1c')]),_0x3d4acf);queues[_0xbd46('0x26')](_0x3d4acf);recordings[_0xbd46('0x26')](_0x3d4acf);}catch(_0x2e641a){utils['error'](util[_0xbd46('0x16')]('[%s][index][queuecallerjoin]',_0x3d4acf[_0xbd46('0x1c')]),_0x2e641a);}});ami['on'](_0xbd46('0x28'),function(_0x3b644d){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')]('[%s][index][queuecallerleave]',_0x3b644d[_0xbd46('0x1c')]),_0x3b644d);queues[_0xbd46('0x28')](_0x3b644d);}catch(_0x5a1904){utils[_0xbd46('0x13')](util['format'](_0xbd46('0x29'),_0x3b644d[_0xbd46('0x1c')]),_0x5a1904);}});ami['on'](_0xbd46('0x2a'),function(_0x3160ee){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')](_0xbd46('0x2b'),_0x3160ee[_0xbd46('0x1c')]),_0x3160ee);queues[_0xbd46('0x2a')](_0x3160ee);calls[_0xbd46('0x2a')](_0x3160ee);}catch(_0x5f3b71){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x2b'),_0x3160ee[_0xbd46('0x1c')]),_0x5f3b71);}});ami['on']('musiconholdstop',function(_0x4063c8){try{utils['debug'](util[_0xbd46('0x16')](_0xbd46('0x2c'),_0x4063c8[_0xbd46('0x1c')]),_0x4063c8);queues[_0xbd46('0x2d')](_0x4063c8);calls[_0xbd46('0x2d')](_0x4063c8);}catch(_0x274ded){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x2c'),_0x4063c8['uniqueid']),_0x274ded);}});ami['on'](_0xbd46('0x2e'),function(_0x4ac619){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')]('[%s][index][newstate]',_0x4ac619['uniqueid']),_0x4ac619);calls[_0xbd46('0x2e')](_0x4ac619);recordings[_0xbd46('0x2e')](_0x4ac619);}catch(_0x59e7ed){utils['error'](util['format'](_0xbd46('0x2f'),_0x4ac619[_0xbd46('0x1c')]),_0x59e7ed);}});ami['on'](_0xbd46('0x30'),function(_0x53b8ca){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')](_0xbd46('0x31'),_0x53b8ca['uniqueid']),_0x53b8ca);calls[_0xbd46('0x30')](_0x53b8ca);recordings[_0xbd46('0x30')](_0x53b8ca);dials[_0xbd46('0x30')](_0x53b8ca);agents[_0xbd46('0x30')](_0x53b8ca);queues[_0xbd46('0x30')](_0x53b8ca);}catch(_0x5ed58b){utils[_0xbd46('0x13')](util[_0xbd46('0x16')]('[%s][index][hangup]',_0x53b8ca[_0xbd46('0x1c')]),_0x5ed58b);}});ami['on']('cdr',function(_0x699c7){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')]('[%s][index][cdr]',_0x699c7[_0xbd46('0x1c')]),_0x699c7);members['cdr'](_0x699c7);}catch(_0x1f3f44){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x32'),_0x699c7[_0xbd46('0x1c')]),_0x1f3f44);}});ami['on']('blindtransfer',function(_0x3af71f){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')](_0xbd46('0x33'),_0x3af71f[_0xbd46('0x1c')]),_0x3af71f);queues['blindtransfer'](_0x3af71f);agents[_0xbd46('0x34')](_0x3af71f);transfers[_0xbd46('0x34')](_0x3af71f);}catch(_0x543c43){utils[_0xbd46('0x13')](util['format']('[%s][index][blindtransfer]',_0x3af71f[_0xbd46('0x1c')]),_0x543c43);}});ami['on'](_0xbd46('0x35'),function(_0x15a067){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')](_0xbd46('0x36'),_0x15a067[_0xbd46('0x37')]),_0x15a067);queues[_0xbd46('0x35')](_0x15a067);transfers['attendedtransfer'](_0x15a067);agents[_0xbd46('0x35')](_0x15a067);calls[_0xbd46('0x35')](_0x15a067);}catch(_0x48773c){utils[_0xbd46('0x13')](util['format'](_0xbd46('0x36'),_0x15a067[_0xbd46('0x37')]),_0x48773c);}});ami['on']('varset',function(_0x16b249){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')]('[%s][index][varset]',_0x16b249[_0xbd46('0x1c')]),_0x16b249);queues[_0xbd46('0x38')](_0x16b249);recordings[_0xbd46('0x38')](_0x16b249);calls[_0xbd46('0x38')](_0x16b249);dials[_0xbd46('0x38')](_0x16b249);}catch(_0x2bf2c2){utils[_0xbd46('0x13')](util['format'](_0xbd46('0x39'),_0x16b249[_0xbd46('0x1c')]),_0x2bf2c2);}});ami['on'](_0xbd46('0x3a'),function(_0x3fa9f9){try{utils[_0xbd46('0x1a')](util['format'](_0xbd46('0x3b'),_0x3fa9f9[_0xbd46('0x1c')]),_0x3fa9f9);calls[_0xbd46('0x3a')](_0x3fa9f9);recordings['newexten'](_0x3fa9f9);dials[_0xbd46('0x3a')](_0x3fa9f9);}catch(_0x19c346){utils[_0xbd46('0x13')](util[_0xbd46('0x16')](_0xbd46('0x3b'),_0x3fa9f9[_0xbd46('0x1c')]),_0x19c346);}});ami['on'](_0xbd46('0x3c'),function(_0x5726b1){try{utils[_0xbd46('0x1a')](util['format'](_0xbd46('0x3d'),_0x5726b1[_0xbd46('0x1c')]),_0x5726b1);calls[_0xbd46('0x3c')](_0x5726b1);recordings[_0xbd46('0x3c')](_0x5726b1);}catch(_0x1920ef){utils['error'](util['format']('[%s][index][newchannel]',_0x5726b1[_0xbd46('0x1c')]),_0x1920ef);}});ami['on'](_0xbd46('0x3e'),function(_0x2bf7a6){try{utils[_0xbd46('0x1a')](util[_0xbd46('0x16')](_0xbd46('0x3f'),_0x2bf7a6['uniqueid']),_0x2bf7a6);dials[_0xbd46('0x3e')](_0x2bf7a6);}catch(_0x401a9a){utils['error'](util[_0xbd46('0x16')]('[%s]dialbegin',_0x2bf7a6[_0xbd46('0x1c')]),_0x401a9a);}});ami['on'](_0xbd46('0x40'),function(_0x443a9d){try{utils['debug'](util[_0xbd46('0x16')]('[%s][index][dialend]',_0x443a9d[_0xbd46('0x1c')]),_0x443a9d);dials[_0xbd46('0x40')](_0x443a9d);}catch(_0xb92b5){utils[_0xbd46('0x13')](util['format'](_0xbd46('0x41'),_0x443a9d[_0xbd46('0x1c')]),_0xb92b5);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 57b2ffe..c986176 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 _0x7333=['destination','destinationchannel','lodash','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','name','internal','request','getUserByName','split','then','CreateMemberReport','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','channel','data1','source','data3'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x7333,0xfc));var _0x3733=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7333[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var utils=require(_0x3733('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x3733('0x2')];function writeDB(_0x146076){utils[_0x3733('0x3')](util['format'](_0x3733('0x4'),_0x146076[_0x3733('0x5')],_0x146076[_0x3733('0x6')],_0x146076['channel'],_0x146076[_0x3733('0x7')],_0x146076[_0x3733('0x8')],_0x146076[_0x3733('0x9')]));if(_0x146076[_0x3733('0x6')]){utils['getUserByInterface'](_0x146076[_0x3733('0x6')])['then'](function(_0x3ecffe){if(_0x3ecffe){_0x146076[_0x3733('0x8')]=_0x3ecffe[_0x3733('0xa')];_0x146076[_0x3733('0xb')]=_0x3ecffe['internal'];utils[_0x3733('0xc')]('CreateMemberReport',_0x146076);}else{utils[_0x3733('0xd')](_0x146076[_0x3733('0x6')][_0x3733('0xe')]('/')[0x1])[_0x3733('0xf')](function(_0xae44d5){if(_0xae44d5){_0x146076[_0x3733('0x8')]=_0xae44d5[_0x3733('0xa')];_0x146076[_0x3733('0xb')]=_0xae44d5[_0x3733('0xb')];utils[_0x3733('0xc')](_0x3733('0x10'),_0x146076);}});}})['catch'](function(_0x58628c){utils[_0x3733('0x11')](util[_0x3733('0x12')](_0x3733('0x13'),_0x146076[_0x3733('0x5')]),_0x58628c);});}delete members[_0x146076[_0x3733('0x6')]];}function startsWith(_0x46a03e,_0x520008){return _[_0x3733('0x14')](_0x46a03e,function(_0x607186){return _[_0x3733('0x15')](_0x520008,_0x607186);});}exports[_0x3733('0x16')]=function(_0x56c17a){try{utils[_0x3733('0x17')](util[_0x3733('0x12')](_0x3733('0x18'),members[_0x56c17a[_0x3733('0x19')]]?members[_0x56c17a['device']][_0x3733('0x5')]:_0x56c17a[_0x3733('0x19')]),_0x56c17a);utils[_0x3733('0x3')](util[_0x3733('0x12')](_0x3733('0x1a'),members[_0x56c17a[_0x3733('0x19')]]?members[_0x56c17a[_0x3733('0x19')]][_0x3733('0x5')]:_0x56c17a[_0x3733('0x19')],_0x56c17a['state'],_0x56c17a[_0x3733('0x19')]));switch(_0x56c17a[_0x3733('0x1b')]){case _0x3733('0x1c'):case'BUSY':if(!startsWith(exclude,_0x56c17a[_0x3733('0x19')])){members[_0x56c17a[_0x3733('0x19')]]={'channel':_0x3733('0x1d'),'interface':_0x56c17a[_0x3733('0x19')],'type':_0x3733('0x1e'),'enterAt':utils[_0x3733('0x1f')](),'role':_0x3733('0x20')};}break;case'NOT_INUSE':if(!_[_0x3733('0x21')](members[_0x56c17a['device']])){members[_0x56c17a[_0x3733('0x19')]][_0x3733('0x22')]=utils[_0x3733('0x1f')]();members[_0x56c17a[_0x3733('0x19')]][_0x3733('0x23')]=utils[_0x3733('0x24')](members[_0x56c17a[_0x3733('0x19')]][_0x3733('0x22')],members[_0x56c17a[_0x3733('0x19')]]['enterAt']);if(members[_0x56c17a[_0x3733('0x19')]]['uniqueid']){writeDB(members[_0x56c17a['device']]);}}break;default:break;}}catch(_0x46ee12){utils[_0x3733('0x11')](util[_0x3733('0x12')]('[%s][members][devicestatechange]',members[_0x56c17a[_0x3733('0x19')]]?members[_0x56c17a[_0x3733('0x19')]][_0x3733('0x5')]:_0x56c17a[_0x3733('0x19')]),_0x46ee12);}};exports[_0x3733('0x25')]=function(_0x1054bb){try{if(!_[_0x3733('0x21')](members[_0x1054bb['interface']])){utils[_0x3733('0x17')](util[_0x3733('0x12')](_0x3733('0x26'),_0x1054bb[_0x3733('0x5')]),_0x1054bb);utils['info'](util['format'](_0x3733('0x27'),_0x1054bb['uniqueid'],_0x1054bb[_0x3733('0x6')],_0x1054bb['queue']));members[_0x1054bb[_0x3733('0x6')]]=_[_0x3733('0x28')](members[_0x1054bb[_0x3733('0x6')]],{'data4':_0x1054bb[_0x3733('0x29')],'uniqueid':_0x1054bb[_0x3733('0x5')]});}}catch(_0x197b49){utils[_0x3733('0x11')](util[_0x3733('0x12')]('[%s][members][agentcomplete]',_0x1054bb[_0x3733('0x5')]),_0x197b49);}};exports[_0x3733('0x2a')]=function(_0x1ef72b){try{utils[_0x3733('0x17')](util[_0x3733('0x12')](_0x3733('0x2b'),_0x1ef72b[_0x3733('0x5')]),_0x1ef72b);if(_0x1ef72b[_0x3733('0x2c')]){var _0xc6cca=_0x1ef72b[_0x3733('0x2c')][_0x3733('0xe')]('-')[0x0];if(!_[_0x3733('0x21')](members[_0xc6cca])){members[_0xc6cca]=_[_0x3733('0x28')](members[_0xc6cca],{'data1':members[_0xc6cca][_0x3733('0x2d')]||_0x1ef72b[_0x3733('0x9')],'data2':members[_0xc6cca]['data2']||_0x1ef72b[_0x3733('0x2e')],'data3':members[_0xc6cca][_0x3733('0x2f')]||_0x1ef72b[_0x3733('0x30')],'uniqueid':members[_0xc6cca][_0x3733('0x5')]||_0x1ef72b[_0x3733('0x5')]});utils['info'](util[_0x3733('0x12')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1ef72b[_0x3733('0x5')],members[_0xc6cca][_0x3733('0x2d')],members[_0xc6cca][_0x3733('0x7')],members[_0xc6cca]['data3']));if(members[_0xc6cca][_0x3733('0x22')]){writeDB(members[_0xc6cca]);}}}if(_0x1ef72b['destinationchannel']){var _0x1103b4=_0x1ef72b[_0x3733('0x31')]['split']('-')[0x0];if(!_[_0x3733('0x21')](members[_0x1103b4])){members[_0x1103b4]=_[_0x3733('0x28')](members[_0x1103b4],{'data1':members[_0x1103b4][_0x3733('0x2d')]||_0x1ef72b['type'],'data2':members[_0x1103b4][_0x3733('0x7')]||_0x1ef72b[_0x3733('0x2e')],'data3':members[_0x1103b4][_0x3733('0x2f')]||_0x1ef72b[_0x3733('0x30')],'uniqueid':members[_0x1103b4][_0x3733('0x5')]||_0x1ef72b[_0x3733('0x5')]});utils['info'](util[_0x3733('0x12')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1ef72b['uniqueid'],members[_0x1103b4][_0x3733('0x2d')],members[_0x1103b4][_0x3733('0x7')],members[_0x1103b4][_0x3733('0x2f')]));if(members[_0x1103b4][_0x3733('0x22')]){writeDB(members[_0x1103b4]);}}}}catch(_0x1b310f){utils['error'](util[_0x3733('0x12')]('[%s][members][cdr]',_0x1ef72b['uniqueid']),_0x1b310f);}}; \ No newline at end of file +var _0x938c=['data1','destinationchannel','type','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','getUserByInterface','then','name','request','CreateMemberReport','getUserByName','split','internal','catch','error','devicestatechange','format','[%s][members][devicestatechange]','device','state','INUSE','now','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','debug','[%s][members][cdr]','source','destination'];(function(_0x385fd3,_0x3680b6){var _0x27c543=function(_0x3610cc){while(--_0x3610cc){_0x385fd3['push'](_0x385fd3['shift']());}};_0x27c543(++_0x3680b6);}(_0x938c,0x11f));var _0xc938=function(_0x17f785,_0x54a16e){_0x17f785=_0x17f785-0x0;var _0x1f06b8=_0x938c[_0x17f785];return _0x1f06b8;};'use strict';var _=require(_0xc938('0x0'));var util=require(_0xc938('0x1'));var utils=require('./utils');var members={};var exclude=[_0xc938('0x2'),'Queue:'];function writeDB(_0x502809){utils[_0xc938('0x3')](util['format'](_0xc938('0x4'),_0x502809[_0xc938('0x5')],_0x502809[_0xc938('0x6')],_0x502809[_0xc938('0x7')],_0x502809[_0xc938('0x8')],_0x502809[_0xc938('0x9')],_0x502809['type']));if(_0x502809[_0xc938('0x6')]){utils[_0xc938('0xa')](_0x502809['interface'])[_0xc938('0xb')](function(_0x378ba5){if(_0x378ba5){_0x502809['membername']=_0x378ba5[_0xc938('0xc')];_0x502809['internal']=_0x378ba5['internal'];utils[_0xc938('0xd')](_0xc938('0xe'),_0x502809);}else{utils[_0xc938('0xf')](_0x502809['interface'][_0xc938('0x10')]('/')[0x1])[_0xc938('0xb')](function(_0x54fd55){if(_0x54fd55){_0x502809[_0xc938('0x9')]=_0x54fd55['name'];_0x502809[_0xc938('0x11')]=_0x54fd55[_0xc938('0x11')];utils[_0xc938('0xd')]('CreateMemberReport',_0x502809);}});}})[_0xc938('0x12')](function(_0x2c8b0c){utils[_0xc938('0x13')](util['format']('[%s][members][writeDB]',_0x502809['uniqueid']),_0x2c8b0c);});}delete members[_0x502809[_0xc938('0x6')]];}function startsWith(_0x271c1d,_0x34e3a7){return _['some'](_0x271c1d,function(_0x143c42){return _['startsWith'](_0x34e3a7,_0x143c42);});}exports[_0xc938('0x14')]=function(_0x4b68be){try{utils['debug'](util[_0xc938('0x15')](_0xc938('0x16'),members[_0x4b68be['device']]?members[_0x4b68be[_0xc938('0x17')]]['uniqueid']:_0x4b68be[_0xc938('0x17')]),_0x4b68be);utils[_0xc938('0x3')](util[_0xc938('0x15')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x4b68be[_0xc938('0x17')]]?members[_0x4b68be[_0xc938('0x17')]][_0xc938('0x5')]:_0x4b68be[_0xc938('0x17')],_0x4b68be[_0xc938('0x18')],_0x4b68be[_0xc938('0x17')]));switch(_0x4b68be[_0xc938('0x18')]){case _0xc938('0x19'):case'BUSY':if(!startsWith(exclude,_0x4b68be[_0xc938('0x17')])){members[_0x4b68be[_0xc938('0x17')]]={'channel':'voice','interface':_0x4b68be[_0xc938('0x17')],'type':'TALKING','enterAt':utils[_0xc938('0x1a')](),'role':'agent'};}break;case _0xc938('0x1b'):if(!_[_0xc938('0x1c')](members[_0x4b68be[_0xc938('0x17')]])){members[_0x4b68be['device']][_0xc938('0x1d')]=utils[_0xc938('0x1a')]();members[_0x4b68be['device']]['duration']=utils[_0xc938('0x1e')](members[_0x4b68be[_0xc938('0x17')]][_0xc938('0x1d')],members[_0x4b68be[_0xc938('0x17')]][_0xc938('0x1f')]);if(members[_0x4b68be[_0xc938('0x17')]][_0xc938('0x5')]){writeDB(members[_0x4b68be[_0xc938('0x17')]]);}}break;default:break;}}catch(_0x2f1c44){utils[_0xc938('0x13')](util[_0xc938('0x15')](_0xc938('0x16'),members[_0x4b68be[_0xc938('0x17')]]?members[_0x4b68be[_0xc938('0x17')]][_0xc938('0x5')]:_0x4b68be['device']),_0x2f1c44);}};exports[_0xc938('0x20')]=function(_0x3765a6){try{if(!_[_0xc938('0x1c')](members[_0x3765a6[_0xc938('0x6')]])){utils['debug'](util[_0xc938('0x15')](_0xc938('0x21'),_0x3765a6[_0xc938('0x5')]),_0x3765a6);utils[_0xc938('0x3')](util[_0xc938('0x15')](_0xc938('0x22'),_0x3765a6[_0xc938('0x5')],_0x3765a6[_0xc938('0x6')],_0x3765a6[_0xc938('0x23')]));members[_0x3765a6['interface']]=_[_0xc938('0x24')](members[_0x3765a6[_0xc938('0x6')]],{'data4':_0x3765a6[_0xc938('0x23')],'uniqueid':_0x3765a6[_0xc938('0x5')]});}}catch(_0x2d4f82){utils[_0xc938('0x13')](util[_0xc938('0x15')](_0xc938('0x21'),_0x3765a6[_0xc938('0x5')]),_0x2d4f82);}};exports[_0xc938('0x25')]=function(_0x3334c7){try{utils[_0xc938('0x26')](util['format'](_0xc938('0x27'),_0x3334c7[_0xc938('0x5')]),_0x3334c7);if(_0x3334c7[_0xc938('0x7')]){var _0x49317b=_0x3334c7[_0xc938('0x7')][_0xc938('0x10')]('-')[0x0];if(!_['isNil'](members[_0x49317b])){members[_0x49317b]=_[_0xc938('0x24')](members[_0x49317b],{'data1':members[_0x49317b]['data1']||_0x3334c7['type'],'data2':members[_0x49317b][_0xc938('0x8')]||_0x3334c7[_0xc938('0x28')],'data3':members[_0x49317b]['data3']||_0x3334c7[_0xc938('0x29')],'uniqueid':members[_0x49317b][_0xc938('0x5')]||_0x3334c7[_0xc938('0x5')]});utils['info'](util[_0xc938('0x15')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3334c7[_0xc938('0x5')],members[_0x49317b][_0xc938('0x2a')],members[_0x49317b]['data2'],members[_0x49317b]['data3']));if(members[_0x49317b]['exitAt']){writeDB(members[_0x49317b]);}}}if(_0x3334c7[_0xc938('0x2b')]){var _0x1920a5=_0x3334c7[_0xc938('0x2b')][_0xc938('0x10')]('-')[0x0];if(!_[_0xc938('0x1c')](members[_0x1920a5])){members[_0x1920a5]=_[_0xc938('0x24')](members[_0x1920a5],{'data1':members[_0x1920a5][_0xc938('0x2a')]||_0x3334c7[_0xc938('0x2c')],'data2':members[_0x1920a5]['data2']||_0x3334c7[_0xc938('0x28')],'data3':members[_0x1920a5][_0xc938('0x2d')]||_0x3334c7[_0xc938('0x29')],'uniqueid':members[_0x1920a5][_0xc938('0x5')]||_0x3334c7['uniqueid']});utils['info'](util['format'](_0xc938('0x2e'),_0x3334c7[_0xc938('0x5')],members[_0x1920a5][_0xc938('0x2a')],members[_0x1920a5][_0xc938('0x8')],members[_0x1920a5][_0xc938('0x2d')]));if(members[_0x1920a5][_0xc938('0x1d')]){writeDB(members[_0x1920a5]);}}}}catch(_0x4513f9){utils['error'](util[_0xc938('0x15')](_0xc938('0x27'),_0x3334c7[_0xc938('0x5')]),_0x4513f9);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 5511ebe..bf8c9c6 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 _0x58bd=['queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','now','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queueposition','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','clone','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','calleridnum','accountcode'];(function(_0x2fa7a5,_0x453cbe){var _0x5b7414=function(_0x1834e4){while(--_0x1834e4){_0x2fa7a5['push'](_0x2fa7a5['shift']());}};_0x5b7414(++_0x453cbe);}(_0x58bd,0xcd));var _0xd58b=function(_0x5a6dec,_0xb91f75){_0x5a6dec=_0x5a6dec-0x0;var _0x4f409e=_0x58bd[_0x5a6dec];return _0x4f409e;};'use strict';var _=require(_0xd58b('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x31cc4b){utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x3'),_0x31cc4b['uniqueid'],_0x31cc4b[_0xd58b('0x4')],_0x31cc4b['queue'],_0x31cc4b['lastAssignedTo'],_0x31cc4b[_0xd58b('0x5')],_0x31cc4b[_0xd58b('0x6')],_0x31cc4b[_0xd58b('0x7')]));if(_0x31cc4b[_0xd58b('0x8')]){utils[_0xd58b('0x9')](_0x31cc4b['queue'])['then'](function(_0x242fe3){if(_0x242fe3){_0x31cc4b['type']=_0x242fe3[_0xd58b('0xa')];}utils[_0xd58b('0xb')](_0xd58b('0xc'),_0x31cc4b);});}else{utils['request'](_0xd58b('0xc'),_0x31cc4b);}if(_0x31cc4b[_0xd58b('0xd')]){delete queues[_0x31cc4b['transfereduniqueid']];}else{delete queues[_0x31cc4b[_0xd58b('0xe')]];}}exports[_0xd58b('0xf')]=function(_0x43fcb2){try{utils[_0xd58b('0x10')](util[_0xd58b('0x2')](_0xd58b('0x11'),_0x43fcb2[_0xd58b('0xe')]),_0x43fcb2);utils[_0xd58b('0x1')](util['format'](_0xd58b('0x12'),_0x43fcb2['uniqueid'],_0x43fcb2[_0xd58b('0x8')],_0x43fcb2[_0xd58b('0x13')]));queues[_0x43fcb2[_0xd58b('0xe')]]=_[_0xd58b('0x14')](_0x43fcb2,{'originalposition':_0x43fcb2[_0xd58b('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0xc065d){utils[_0xd58b('0x15')](util['format']('[%s][queues][queuecallerjoin]',_0x43fcb2[_0xd58b('0xe')]),_0xc065d);}};exports[_0xd58b('0x16')]=function(_0xda08c8){try{if(!_[_0xd58b('0x17')](queues[_0xda08c8[_0xd58b('0xe')]])){utils['debug'](util[_0xd58b('0x2')]('[%s][queues][hangup]',_0xda08c8[_0xd58b('0xe')]),_0xda08c8);if(queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0x18')]){if(!queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0x19')]&&!queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0x1a')]){queues[_0xda08c8['uniqueid']][_0xd58b('0x1b')]=!![];queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0x1c')]=utils['now']();queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0x7')]=_0xd58b('0x1d');}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0xda08c8[_0xd58b('0xe')],queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0x1e')],queues[_0xda08c8[_0xd58b('0xe')]]['queuecallerexitreason']));writeDB(queues[_0xda08c8['uniqueid']]);}else if(queues[_0xda08c8['uniqueid']][_0xd58b('0xd')]){utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x1f'),_0xda08c8[_0xd58b('0xe')],queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0x1e')],queues[_0xda08c8['uniqueid']][_0xd58b('0xd')]));queues[queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0xd')]]=queues[_0xda08c8[_0xd58b('0xe')]];queues[queues[_0xda08c8[_0xd58b('0xe')]][_0xd58b('0xd')]][_0xd58b('0x20')]=0x2;delete queues[_0xda08c8[_0xd58b('0xe')]];}}}catch(_0x38163c){utils['error'](util['format'](_0xd58b('0x21'),_0xda08c8[_0xd58b('0xe')]),_0x38163c);}};exports[_0xd58b('0x22')]=function(_0x260f18){try{utils[_0xd58b('0x10')](util[_0xd58b('0x2')](_0xd58b('0x23'),_0x260f18[_0xd58b('0xe')]),_0x260f18);if(!_[_0xd58b('0x17')](_0x260f18[_0xd58b('0x24')]['queuestatus'])&&_0x260f18['value'][_0xd58b('0x25')]()!==_0xd58b('0x26')){if(!_[_0xd58b('0x17')](queues[_0x260f18[_0xd58b('0xe')]])){queues[_0x260f18[_0xd58b('0xe')]][_0xd58b('0x19')]=![];queues[_0x260f18['uniqueid']]['queuecallerabandonAt']=null;queues[_0x260f18['uniqueid']][_0xd58b('0x1a')]=!![];queues[_0x260f18[_0xd58b('0xe')]]['queuecallerexitAt']=utils[_0xd58b('0x27')]();queues[_0x260f18[_0xd58b('0xe')]][_0xd58b('0x7')]=_0x260f18['value'][_0xd58b('0x25')]();utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x28'),_0x260f18['uniqueid'],queues[_0x260f18[_0xd58b('0xe')]][_0xd58b('0x1e')],_0x260f18[_0xd58b('0x29')],queues[_0x260f18[_0xd58b('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x260f18[_0xd58b('0xe')]]);}}else if(!_[_0xd58b('0x17')](_0x260f18['variable'][_0xd58b('0x2a')])){if(!_[_0xd58b('0x17')](queues[_0x260f18[_0xd58b('0xe')]])&&!queues[_0x260f18[_0xd58b('0xe')]][_0xd58b('0x19')]){queues[_0x260f18[_0xd58b('0xe')]][_0xd58b('0x19')]=![];queues[_0x260f18['uniqueid']][_0xd58b('0x2b')]=null;queues[_0x260f18[_0xd58b('0xe')]]['queuecallerexit']=!![];queues[_0x260f18[_0xd58b('0xe')]][_0xd58b('0x2c')]=utils[_0xd58b('0x27')]();queues[_0x260f18['uniqueid']][_0xd58b('0x7')]=_0xd58b('0x2d');utils['info'](util[_0xd58b('0x2')](_0xd58b('0x2e'),_0x260f18[_0xd58b('0xe')],queues[_0x260f18[_0xd58b('0xe')]]['name'],_0x260f18[_0xd58b('0x29')],queues[_0x260f18['uniqueid']][_0xd58b('0x7')]));}}}catch(_0xf5e3f2){utils[_0xd58b('0x15')](util[_0xd58b('0x2')]('[%s][queues][varset]',_0x260f18[_0xd58b('0xe')]),_0xf5e3f2);}};exports[_0xd58b('0x19')]=function(_0x1b1afe){try{if(!_[_0xd58b('0x17')](queues[_0x1b1afe[_0xd58b('0xe')]])){utils[_0xd58b('0x10')](util[_0xd58b('0x2')]('[%s][queues][queuecallerabandon]',_0x1b1afe[_0xd58b('0xe')]),_0x1b1afe);queues[_0x1b1afe['uniqueid']]['queuecallerexit']=![];queues[_0x1b1afe[_0xd58b('0xe')]][_0xd58b('0x2c')]=null;queues[_0x1b1afe[_0xd58b('0xe')]][_0xd58b('0x19')]=!![];queues[_0x1b1afe[_0xd58b('0xe')]][_0xd58b('0x2b')]=utils[_0xd58b('0x27')]();queues[_0x1b1afe[_0xd58b('0xe')]][_0xd58b('0x7')]=_0xd58b('0x2f');utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x30'),_0x1b1afe[_0xd58b('0xe')],queues[_0x1b1afe['uniqueid']]['name'],queues[_0x1b1afe[_0xd58b('0xe')]]['queuecallerexitreason']));}}catch(_0x14caf3){utils[_0xd58b('0x15')](util[_0xd58b('0x2')](_0xd58b('0x31'),_0x1b1afe[_0xd58b('0xe')]),_0x14caf3);}};exports[_0xd58b('0x32')]=function(_0x3b00da){try{if(!_[_0xd58b('0x17')](queues[_0x3b00da[_0xd58b('0xe')]])){utils['debug'](util[_0xd58b('0x2')]('[%s][queues][queuecallerleave]',_0x3b00da[_0xd58b('0xe')]),_0x3b00da);utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x33'),_0x3b00da[_0xd58b('0xe')],queues[_0x3b00da['uniqueid']][_0xd58b('0x1e')],_0x3b00da['connectedlinenum'],_0x3b00da[_0xd58b('0x34')]));queues[_0x3b00da[_0xd58b('0xe')]][_0xd58b('0x32')]=!![];queues[_0x3b00da['uniqueid']][_0xd58b('0x18')]=utils[_0xd58b('0x27')]();queues[_0x3b00da['uniqueid']][_0xd58b('0x35')]=utils['diffTime'](queues[_0x3b00da['uniqueid']][_0xd58b('0x18')],queues[_0x3b00da['uniqueid']][_0xd58b('0x36')]);queues[_0x3b00da['uniqueid']]['position']=_0x3b00da[_0xd58b('0x13')];queues[_0x3b00da[_0xd58b('0xe')]][_0xd58b('0x37')]=_0x3b00da[_0xd58b('0x37')];queues[_0x3b00da[_0xd58b('0xe')]]['connectedlinenum']=_0x3b00da['connectedlinenum'];queues[_0x3b00da[_0xd58b('0xe')]][_0xd58b('0x34')]=_0x3b00da[_0xd58b('0x34')];}}catch(_0x1122e6){utils[_0xd58b('0x15')](util[_0xd58b('0x2')](_0xd58b('0x38'),_0x3b00da['uniqueid']),_0x1122e6);}};exports[_0xd58b('0x39')]=function(_0x3523fb){try{if(!_[_0xd58b('0x17')](queues[_0x3523fb[_0xd58b('0xe')]])){utils[_0xd58b('0x10')](util[_0xd58b('0x2')](_0xd58b('0x3a'),_0x3523fb[_0xd58b('0xe')]),_0x3523fb);utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x3b'),_0x3523fb[_0xd58b('0xe')],queues[_0x3523fb[_0xd58b('0xe')]][_0xd58b('0x1e')],_0x3523fb[_0xd58b('0x3c')],_0x3523fb[_0xd58b('0x3d')]));queues[_0x3523fb[_0xd58b('0xe')]][_0xd58b('0x19')]=![];queues[_0x3523fb[_0xd58b('0xe')]][_0xd58b('0x19')]=![];queues[_0x3523fb[_0xd58b('0xe')]][_0xd58b('0x2b')]=null;queues[_0x3523fb[_0xd58b('0xe')]][_0xd58b('0x1a')]=![];queues[_0x3523fb[_0xd58b('0xe')]][_0xd58b('0x7')]=null;queues[_0x3523fb['uniqueid']][_0xd58b('0x2c')]=null;queues[_0x3523fb[_0xd58b('0xe')]]['assigned']=!![];queues[_0x3523fb[_0xd58b('0xe')]][_0xd58b('0x6')]=_0x3523fb[_0xd58b('0x3d')];queues[_0x3523fb[_0xd58b('0xe')]][_0xd58b('0x3e')]=_0x3523fb[_0xd58b('0x3c')];}}catch(_0x27b61d){utils['error'](util[_0xd58b('0x2')](_0xd58b('0x3a'),_0x3523fb['uniqueid']),_0x27b61d);}};exports[_0xd58b('0x3f')]=function(_0x1f8af1){try{if(!_[_0xd58b('0x17')](queues[_0x1f8af1['uniqueid']])){if(queues[_0x1f8af1[_0xd58b('0xe')]][_0xd58b('0x18')]){utils[_0xd58b('0x10')](util[_0xd58b('0x2')](_0xd58b('0x40'),_0x1f8af1[_0xd58b('0xe')]),_0x1f8af1);queues[_0x1f8af1[_0xd58b('0xe')]][_0xd58b('0x19')]=![];queues[_0x1f8af1[_0xd58b('0xe')]]['queuecallerabandon']=![];queues[_0x1f8af1[_0xd58b('0xe')]][_0xd58b('0x2b')]=null;queues[_0x1f8af1['uniqueid']][_0xd58b('0x1a')]=![];queues[_0x1f8af1[_0xd58b('0xe')]][_0xd58b('0x2c')]=null;queues[_0x1f8af1[_0xd58b('0xe')]][_0xd58b('0x41')]=!![];queues[_0x1f8af1[_0xd58b('0xe')]]['lastAssignedTo']=_0x1f8af1['membername'];queues[_0x1f8af1[_0xd58b('0xe')]][_0xd58b('0x1b')]=!![];queues[_0x1f8af1[_0xd58b('0xe')]]['queuecallercompleteAt']=utils['now']();if(_0x1f8af1[_0xd58b('0x42')]=='transfer'){if(!queues[_0x1f8af1['uniqueid']][_0xd58b('0x43')]){queues[_0x1f8af1[_0xd58b('0xe')]]['queuecallerexitreason']=_0xd58b('0x44');}}else{queues[_0x1f8af1['uniqueid']][_0xd58b('0x7')]=_0xd58b('0x45')+_0x1f8af1[_0xd58b('0x42')]['toUpperCase']();}utils['info'](util[_0xd58b('0x2')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x1f8af1[_0xd58b('0xe')],queues[_0x1f8af1[_0xd58b('0xe')]]['name'],_0x1f8af1[_0xd58b('0x3c')],queues[_0x1f8af1[_0xd58b('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x1f8af1[_0xd58b('0xe')]]);}}}catch(_0x588c58){utils[_0xd58b('0x15')](util[_0xd58b('0x2')](_0xd58b('0x40'),_0x1f8af1['uniqueid']),_0x588c58);}};exports[_0xd58b('0x46')]=function(_0x1f8a50){try{if(!_[_0xd58b('0x17')](queues[_0x1f8a50[_0xd58b('0x47')]])){utils[_0xd58b('0x10')](util[_0xd58b('0x2')]('[%s][queues][blindtransfer]',_0x1f8a50['uniqueid']),_0x1f8a50);queues[_0x1f8a50[_0xd58b('0x47')]][_0xd58b('0x43')]=!![];queues[_0x1f8a50[_0xd58b('0x47')]]['transfertype']=_0xd58b('0x48');queues[_0x1f8a50[_0xd58b('0x47')]][_0xd58b('0x49')]=_0x1f8a50['extension'];queues[_0x1f8a50['transfereeuniqueid']][_0xd58b('0x4a')]=_0x1f8a50['transfereeuniqueid'];queues[_0x1f8a50[_0xd58b('0x47')]][_0xd58b('0x7')]=_0xd58b('0x4b');utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x4c'),_0x1f8a50[_0xd58b('0xe')],queues[_0x1f8a50[_0xd58b('0x47')]][_0xd58b('0x1e')],_0x1f8a50[_0xd58b('0x47')],_0x1f8a50[_0xd58b('0x4d')]));}}catch(_0x122166){utils[_0xd58b('0x15')](util['format']('[%s][queues][blindtransfer]',_0x1f8a50['uniqueid']),_0x122166);}};exports['attendedtransfer']=function(_0x3e9a18){try{utils['debug'](util[_0xd58b('0x2')](_0xd58b('0x4e'),_0x3e9a18['origtransfereruniqueid']),_0x3e9a18);if(_0x3e9a18[_0xd58b('0x4f')]==_0x3e9a18[_0xd58b('0x50')]){if(!_[_0xd58b('0x17')](queues[_0x3e9a18[_0xd58b('0x51')]])){utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x52'),_0x3e9a18[_0xd58b('0x4f')],queues[_0x3e9a18['secondtransfererlinkedid']][_0xd58b('0x1e')],_0x3e9a18[_0xd58b('0x53')]));queues[_0x3e9a18[_0xd58b('0x51')]][_0xd58b('0x43')]=!![];queues[_0x3e9a18[_0xd58b('0x51')]][_0xd58b('0x54')]='ATTENDED';queues[_0x3e9a18[_0xd58b('0x51')]][_0xd58b('0x49')]=_0x3e9a18[_0xd58b('0x53')];queues[_0x3e9a18[_0xd58b('0x51')]]['transferuniqueid']=_0x3e9a18[_0xd58b('0x4f')];queues[_0x3e9a18['secondtransfererlinkedid']][_0xd58b('0x7')]=_0xd58b('0x55');}if(!_[_0xd58b('0x17')](queues[_0x3e9a18['origtransfererlinkedid']])){if(_0x3e9a18['transfereelinkedid']&&queues[_0x3e9a18['transfereelinkedid']]){queues[_0x3e9a18[_0xd58b('0x56')]][_0xd58b('0x20')]=0x1;queues[_0x3e9a18[_0xd58b('0x47')]]=_['clone'](queues[_0x3e9a18[_0xd58b('0x56')]]);queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0xd')]=_0x3e9a18[_0xd58b('0x57')];queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x20')]=0x2;queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x5')]=queues[_0x3e9a18['secondtransfererlinkedid']][_0xd58b('0x5')];queues[_0x3e9a18[_0xd58b('0x47')]]['calleridname']=queues[_0x3e9a18[_0xd58b('0x51')]][_0xd58b('0x58')];queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x36')]=utils[_0xd58b('0x27')]();queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x18')]=utils[_0xd58b('0x27')]();queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x35')]=0x0;queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x59')]=0x0;utils['info'](util[_0xd58b('0x2')](_0xd58b('0x5a'),_0x3e9a18['origtransfereruniqueid'],queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x1e')],queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x5')],queues[_0x3e9a18[_0xd58b('0x47')]][_0xd58b('0x58')]));}else{utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x5b'),_0x3e9a18[_0xd58b('0x4f')],queues[_0x3e9a18['origtransfererlinkedid']]['name'],_0x3e9a18[_0xd58b('0x51')]));queues[_0x3e9a18[_0xd58b('0x50')]]['transfereduniqueid']=_0x3e9a18[_0xd58b('0x51')];}}}else if(_0x3e9a18[_0xd58b('0x5c')]==_0x3e9a18[_0xd58b('0x51')]){if(!_[_0xd58b('0x17')](queues[_0x3e9a18[_0xd58b('0x50')]])){utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x5d'),_0x3e9a18[_0xd58b('0x4f')],queues[_0x3e9a18['origtransfererlinkedid']][_0xd58b('0x1e')],_0x3e9a18[_0xd58b('0x5c')],_0x3e9a18['secondtransfererexten']));queues[_0x3e9a18[_0xd58b('0x50')]][_0xd58b('0x43')]=!![];queues[_0x3e9a18[_0xd58b('0x50')]][_0xd58b('0x54')]=_0xd58b('0x5e');queues[_0x3e9a18['origtransfererlinkedid']][_0xd58b('0x49')]=_0x3e9a18[_0xd58b('0x5f')];queues[_0x3e9a18[_0xd58b('0x50')]][_0xd58b('0x4a')]=_0x3e9a18[_0xd58b('0x5c')];queues[_0x3e9a18[_0xd58b('0x50')]][_0xd58b('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xd58b('0x17')](queues[_0x3e9a18[_0xd58b('0x51')]])){if(_0x3e9a18['transfertargetlinkedid']&&queues[_0x3e9a18['transfertargetlinkedid']]){queues[_0x3e9a18['transfertargetlinkedid']][_0xd58b('0x20')]=0x1;queues[_0x3e9a18['transfertargetuniqueid']]=_[_0xd58b('0x60')](queues[_0x3e9a18[_0xd58b('0x61')]]);queues[_0x3e9a18[_0xd58b('0x57')]]['transfereduniqueid']=_0x3e9a18[_0xd58b('0x57')];queues[_0x3e9a18['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0x5')]=queues[_0x3e9a18[_0xd58b('0x50')]]['calleridnum'];queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0x58')]=queues[_0x3e9a18[_0xd58b('0x50')]][_0xd58b('0x58')];queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0x36')]=utils[_0xd58b('0x27')]();queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0x18')]=utils[_0xd58b('0x27')]();queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0x35')]=0x0;queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0x59')]=0x0;utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x62'),_0x3e9a18[_0xd58b('0x4f')],queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0x1e')],queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0xd')],queues[_0x3e9a18[_0xd58b('0x57')]][_0xd58b('0x5')],queues[_0x3e9a18[_0xd58b('0x57')]]['calleridname']));}else{utils[_0xd58b('0x1')](util[_0xd58b('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x3e9a18['origtransfereruniqueid'],queues[_0x3e9a18[_0xd58b('0x51')]]['name'],_0x3e9a18[_0xd58b('0x50')]));queues[_0x3e9a18[_0xd58b('0x51')]]['transfereduniqueid']=_0x3e9a18['origtransfererlinkedid'];}}}}catch(_0x535587){utils[_0xd58b('0x15')](util['format'](_0xd58b('0x4e'),_0x3e9a18['origtransfereruniqueid']),_0x535587);}};exports[_0xd58b('0x63')]=function(_0x2d7c29){try{if(!_[_0xd58b('0x17')](queues[_0x2d7c29['uniqueid']])){utils[_0xd58b('0x10')](util[_0xd58b('0x2')](_0xd58b('0x64'),_0x2d7c29[_0xd58b('0xe')]),_0x2d7c29);queues[_0x2d7c29[_0xd58b('0xe')]][_0xd58b('0x65')]=utils[_0xd58b('0x27')]();utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x66'),_0x2d7c29['uniqueid'],queues[_0x2d7c29[_0xd58b('0xe')]][_0xd58b('0x1e')],queues[_0x2d7c29[_0xd58b('0xe')]]['musiconholdstartAt']));}}catch(_0xbd7653){utils['error'](util[_0xd58b('0x2')]('[%s][queues][musiconholdstart]',_0x2d7c29[_0xd58b('0xe')]),_0xbd7653);}};exports[_0xd58b('0x67')]=function(_0x120152){try{if(!_[_0xd58b('0x17')](queues[_0x120152[_0xd58b('0xe')]])){if(!_[_0xd58b('0x17')](queues[_0x120152[_0xd58b('0xe')]][_0xd58b('0x65')])){utils['debug'](util[_0xd58b('0x2')]('[%s][queues][musiconholdstop]',_0x120152[_0xd58b('0xe')]),_0x120152);queues[_0x120152[_0xd58b('0xe')]]['mohtime']+=utils['diffTime'](utils[_0xd58b('0x27')](),queues[_0x120152[_0xd58b('0xe')]][_0xd58b('0x65')]);utils[_0xd58b('0x1')](util[_0xd58b('0x2')](_0xd58b('0x68'),_0x120152[_0xd58b('0xe')],queues[_0x120152['uniqueid']][_0xd58b('0x1e')],queues[_0x120152[_0xd58b('0xe')]][_0xd58b('0x59')]));delete queues[_0x120152[_0xd58b('0xe')]]['musiconholdstartAt'];}}}catch(_0x770713){utils[_0xd58b('0x15')](util['format'](_0xd58b('0x69'),_0x120152[_0xd58b('0xe')]),_0x770713);}}; \ No newline at end of file +var _0xd703=['now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','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]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','count','[%s][queues][queuecallerleave]','agentconnect','destaccountcode','assigned','[%s][queues][agentconnect]','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign'];(function(_0x28e7fa,_0xecc1fa){var _0x426537=function(_0x36e9fa){while(--_0x36e9fa){_0x28e7fa['push'](_0x28e7fa['shift']());}};_0x426537(++_0xecc1fa);}(_0xd703,0x190));var _0x3d70=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xd703[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x3d70('0x0'));var util=require(_0x3d70('0x1'));var utils=require(_0x3d70('0x2'));var queues={};function writeDB(_0xf17457){utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x5'),_0xf17457[_0x3d70('0x6')],_0xf17457[_0x3d70('0x7')],_0xf17457[_0x3d70('0x8')],_0xf17457[_0x3d70('0x9')],_0xf17457[_0x3d70('0xa')],_0xf17457[_0x3d70('0xb')],_0xf17457[_0x3d70('0xc')]));if(_0xf17457[_0x3d70('0x8')]){utils[_0x3d70('0xd')](_0xf17457['queue'])[_0x3d70('0xe')](function(_0xf15e02){if(_0xf15e02){_0xf17457[_0x3d70('0xf')]=_0xf15e02[_0x3d70('0xf')];}utils[_0x3d70('0x10')]('CreateVoiceQueueReport',_0xf17457);});}else{utils['request']('CreateVoiceQueueReport',_0xf17457);}if(_0xf17457[_0x3d70('0x11')]){delete queues[_0xf17457['transfereduniqueid']];}else{delete queues[_0xf17457[_0x3d70('0x6')]];}}exports[_0x3d70('0x12')]=function(_0x17a9a2){try{utils[_0x3d70('0x13')](util['format'](_0x3d70('0x14'),_0x17a9a2['uniqueid']),_0x17a9a2);utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x15'),_0x17a9a2[_0x3d70('0x6')],_0x17a9a2[_0x3d70('0x8')],_0x17a9a2[_0x3d70('0x16')]));queues[_0x17a9a2[_0x3d70('0x6')]]=_[_0x3d70('0x17')](_0x17a9a2,{'originalposition':_0x17a9a2[_0x3d70('0x16')],'queuecallerjoinAt':utils[_0x3d70('0x18')](),'mohtime':0x0});}catch(_0x2983b4){utils[_0x3d70('0x19')](util[_0x3d70('0x4')](_0x3d70('0x14'),_0x17a9a2[_0x3d70('0x6')]),_0x2983b4);}};exports[_0x3d70('0x1a')]=function(_0x2b31d3){try{if(!_[_0x3d70('0x1b')](queues[_0x2b31d3[_0x3d70('0x6')]])){utils[_0x3d70('0x13')](util['format'](_0x3d70('0x1c'),_0x2b31d3['uniqueid']),_0x2b31d3);if(queues[_0x2b31d3['uniqueid']][_0x3d70('0x1d')]){if(!queues[_0x2b31d3['uniqueid']][_0x3d70('0x1e')]&&!queues[_0x2b31d3[_0x3d70('0x6')]][_0x3d70('0x1f')]){queues[_0x2b31d3[_0x3d70('0x6')]][_0x3d70('0x20')]=!![];queues[_0x2b31d3['uniqueid']]['queuecallercompleteAt']=utils['now']();queues[_0x2b31d3['uniqueid']][_0x3d70('0xc')]=_0x3d70('0x21');}utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x22'),_0x2b31d3[_0x3d70('0x6')],queues[_0x2b31d3[_0x3d70('0x6')]][_0x3d70('0x23')],queues[_0x2b31d3[_0x3d70('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x2b31d3[_0x3d70('0x6')]]);}else if(queues[_0x2b31d3[_0x3d70('0x6')]][_0x3d70('0x11')]){utils['info'](util['format'](_0x3d70('0x24'),_0x2b31d3['uniqueid'],queues[_0x2b31d3[_0x3d70('0x6')]][_0x3d70('0x23')],queues[_0x2b31d3['uniqueid']][_0x3d70('0x11')]));queues[queues[_0x2b31d3[_0x3d70('0x6')]][_0x3d70('0x11')]]=queues[_0x2b31d3[_0x3d70('0x6')]];queues[queues[_0x2b31d3['uniqueid']]['transfereduniqueid']][_0x3d70('0x25')]=0x2;delete queues[_0x2b31d3[_0x3d70('0x6')]];}}}catch(_0x452d50){utils['error'](util[_0x3d70('0x4')](_0x3d70('0x1c'),_0x2b31d3[_0x3d70('0x6')]),_0x452d50);}};exports[_0x3d70('0x26')]=function(_0x1f3f72){try{utils['debug'](util[_0x3d70('0x4')](_0x3d70('0x27'),_0x1f3f72['uniqueid']),_0x1f3f72);if(!_[_0x3d70('0x1b')](_0x1f3f72['variable'][_0x3d70('0x28')])&&_0x1f3f72[_0x3d70('0x29')][_0x3d70('0x2a')]()!=='CONTINUE'){if(!_[_0x3d70('0x1b')](queues[_0x1f3f72[_0x3d70('0x6')]])){queues[_0x1f3f72['uniqueid']]['queuecallerabandon']=![];queues[_0x1f3f72['uniqueid']][_0x3d70('0x2b')]=null;queues[_0x1f3f72[_0x3d70('0x6')]][_0x3d70('0x1f')]=!![];queues[_0x1f3f72[_0x3d70('0x6')]][_0x3d70('0x2c')]=utils[_0x3d70('0x18')]();queues[_0x1f3f72[_0x3d70('0x6')]][_0x3d70('0xc')]=_0x1f3f72[_0x3d70('0x29')][_0x3d70('0x2a')]();utils['info'](util[_0x3d70('0x4')](_0x3d70('0x2d'),_0x1f3f72[_0x3d70('0x6')],queues[_0x1f3f72['uniqueid']][_0x3d70('0x23')],_0x1f3f72['value'],queues[_0x1f3f72[_0x3d70('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x1f3f72[_0x3d70('0x6')]]);}}else if(!_[_0x3d70('0x1b')](_0x1f3f72['variable'][_0x3d70('0x2e')])){if(!_['isNil'](queues[_0x1f3f72[_0x3d70('0x6')]])&&!queues[_0x1f3f72['uniqueid']][_0x3d70('0x1e')]){queues[_0x1f3f72[_0x3d70('0x6')]]['queuecallerabandon']=![];queues[_0x1f3f72[_0x3d70('0x6')]][_0x3d70('0x2b')]=null;queues[_0x1f3f72[_0x3d70('0x6')]]['queuecallerexit']=!![];queues[_0x1f3f72[_0x3d70('0x6')]]['queuecallerexitAt']=utils[_0x3d70('0x18')]();queues[_0x1f3f72[_0x3d70('0x6')]][_0x3d70('0xc')]=_0x3d70('0x2f');utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x30'),_0x1f3f72[_0x3d70('0x6')],queues[_0x1f3f72[_0x3d70('0x6')]][_0x3d70('0x23')],_0x1f3f72[_0x3d70('0x29')],queues[_0x1f3f72[_0x3d70('0x6')]]['queuecallerexitreason']));}}}catch(_0xd1acc7){utils[_0x3d70('0x19')](util['format'](_0x3d70('0x27'),_0x1f3f72[_0x3d70('0x6')]),_0xd1acc7);}};exports[_0x3d70('0x1e')]=function(_0x29551c){try{if(!_[_0x3d70('0x1b')](queues[_0x29551c['uniqueid']])){utils[_0x3d70('0x13')](util[_0x3d70('0x4')](_0x3d70('0x31'),_0x29551c[_0x3d70('0x6')]),_0x29551c);queues[_0x29551c[_0x3d70('0x6')]][_0x3d70('0x1f')]=![];queues[_0x29551c[_0x3d70('0x6')]][_0x3d70('0x2c')]=null;queues[_0x29551c[_0x3d70('0x6')]]['queuecallerabandon']=!![];queues[_0x29551c[_0x3d70('0x6')]][_0x3d70('0x2b')]=utils[_0x3d70('0x18')]();queues[_0x29551c[_0x3d70('0x6')]][_0x3d70('0xc')]=_0x3d70('0x32');utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x33'),_0x29551c[_0x3d70('0x6')],queues[_0x29551c['uniqueid']]['name'],queues[_0x29551c[_0x3d70('0x6')]]['queuecallerexitreason']));}}catch(_0x2b7767){utils['error'](util[_0x3d70('0x4')](_0x3d70('0x31'),_0x29551c['uniqueid']),_0x2b7767);}};exports['queuecallerleave']=function(_0x3c8e20){try{if(!_[_0x3d70('0x1b')](queues[_0x3c8e20[_0x3d70('0x6')]])){utils['debug'](util[_0x3d70('0x4')]('[%s][queues][queuecallerleave]',_0x3c8e20[_0x3d70('0x6')]),_0x3c8e20);utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x34'),_0x3c8e20['uniqueid'],queues[_0x3c8e20[_0x3d70('0x6')]][_0x3d70('0x23')],_0x3c8e20[_0x3d70('0x35')],_0x3c8e20[_0x3d70('0x36')]));queues[_0x3c8e20['uniqueid']][_0x3d70('0x37')]=!![];queues[_0x3c8e20[_0x3d70('0x6')]][_0x3d70('0x1d')]=utils[_0x3d70('0x18')]();queues[_0x3c8e20[_0x3d70('0x6')]][_0x3d70('0x38')]=utils[_0x3d70('0x39')](queues[_0x3c8e20['uniqueid']][_0x3d70('0x1d')],queues[_0x3c8e20['uniqueid']]['queuecallerjoinAt']);queues[_0x3c8e20[_0x3d70('0x6')]][_0x3d70('0x16')]=_0x3c8e20[_0x3d70('0x16')];queues[_0x3c8e20[_0x3d70('0x6')]][_0x3d70('0x3a')]=_0x3c8e20[_0x3d70('0x3a')];queues[_0x3c8e20[_0x3d70('0x6')]][_0x3d70('0x35')]=_0x3c8e20['connectedlinenum'];queues[_0x3c8e20['uniqueid']][_0x3d70('0x36')]=_0x3c8e20[_0x3d70('0x36')];}}catch(_0x33da7a){utils['error'](util['format'](_0x3d70('0x3b'),_0x3c8e20[_0x3d70('0x6')]),_0x33da7a);}};exports[_0x3d70('0x3c')]=function(_0x23ba8e){try{if(!_['isNil'](queues[_0x23ba8e['uniqueid']])){utils[_0x3d70('0x13')](util[_0x3d70('0x4')]('[%s][queues][agentconnect]',_0x23ba8e[_0x3d70('0x6')]),_0x23ba8e);utils['info'](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x23ba8e[_0x3d70('0x6')],queues[_0x23ba8e['uniqueid']][_0x3d70('0x23')],_0x23ba8e['membername'],_0x23ba8e[_0x3d70('0x3d')]));queues[_0x23ba8e[_0x3d70('0x6')]]['queuecallerabandon']=![];queues[_0x23ba8e['uniqueid']][_0x3d70('0x1e')]=![];queues[_0x23ba8e[_0x3d70('0x6')]][_0x3d70('0x2b')]=null;queues[_0x23ba8e[_0x3d70('0x6')]][_0x3d70('0x1f')]=![];queues[_0x23ba8e[_0x3d70('0x6')]][_0x3d70('0xc')]=null;queues[_0x23ba8e['uniqueid']][_0x3d70('0x2c')]=null;queues[_0x23ba8e['uniqueid']][_0x3d70('0x3e')]=!![];queues[_0x23ba8e['uniqueid']][_0x3d70('0xb')]=_0x23ba8e['destaccountcode'];queues[_0x23ba8e[_0x3d70('0x6')]]['lastAssignedTo']=_0x23ba8e['membername'];}}catch(_0x30ba7a){utils[_0x3d70('0x19')](util[_0x3d70('0x4')](_0x3d70('0x3f'),_0x23ba8e['uniqueid']),_0x30ba7a);}};exports['agentcomplete']=function(_0x44e63a){try{if(!_[_0x3d70('0x1b')](queues[_0x44e63a[_0x3d70('0x6')]])){if(queues[_0x44e63a['uniqueid']][_0x3d70('0x1d')]){utils[_0x3d70('0x13')](util[_0x3d70('0x4')](_0x3d70('0x40'),_0x44e63a['uniqueid']),_0x44e63a);queues[_0x44e63a['uniqueid']][_0x3d70('0x1e')]=![];queues[_0x44e63a[_0x3d70('0x6')]][_0x3d70('0x1e')]=![];queues[_0x44e63a[_0x3d70('0x6')]][_0x3d70('0x2b')]=null;queues[_0x44e63a[_0x3d70('0x6')]][_0x3d70('0x1f')]=![];queues[_0x44e63a[_0x3d70('0x6')]][_0x3d70('0x2c')]=null;queues[_0x44e63a[_0x3d70('0x6')]]['assigned']=!![];queues[_0x44e63a[_0x3d70('0x6')]][_0x3d70('0x9')]=_0x44e63a['membername'];queues[_0x44e63a[_0x3d70('0x6')]]['queuecallercomplete']=!![];queues[_0x44e63a[_0x3d70('0x6')]][_0x3d70('0x41')]=utils[_0x3d70('0x18')]();if(_0x44e63a[_0x3d70('0x42')]==_0x3d70('0x43')){if(!queues[_0x44e63a[_0x3d70('0x6')]][_0x3d70('0x43')]){queues[_0x44e63a['uniqueid']][_0x3d70('0xc')]=_0x3d70('0x44');}}else{queues[_0x44e63a[_0x3d70('0x6')]][_0x3d70('0xc')]=_0x3d70('0x45')+_0x44e63a[_0x3d70('0x42')][_0x3d70('0x2a')]();}utils[_0x3d70('0x3')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x44e63a[_0x3d70('0x6')],queues[_0x44e63a['uniqueid']][_0x3d70('0x23')],_0x44e63a['membername'],queues[_0x44e63a['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x44e63a[_0x3d70('0x6')]]);}}}catch(_0x4867a7){utils[_0x3d70('0x19')](util[_0x3d70('0x4')](_0x3d70('0x40'),_0x44e63a['uniqueid']),_0x4867a7);}};exports[_0x3d70('0x46')]=function(_0x3dc70b){try{if(!_['isNil'](queues[_0x3dc70b['transfereeuniqueid']])){utils[_0x3d70('0x13')](util[_0x3d70('0x4')]('[%s][queues][blindtransfer]',_0x3dc70b[_0x3d70('0x6')]),_0x3dc70b);queues[_0x3dc70b[_0x3d70('0x47')]][_0x3d70('0x43')]=!![];queues[_0x3dc70b[_0x3d70('0x47')]]['transfertype']='BLIND';queues[_0x3dc70b['transfereeuniqueid']][_0x3d70('0x48')]=_0x3dc70b[_0x3d70('0x49')];queues[_0x3dc70b[_0x3d70('0x47')]][_0x3d70('0x4a')]=_0x3dc70b['transfereeuniqueid'];queues[_0x3dc70b['transfereeuniqueid']][_0x3d70('0xc')]=_0x3d70('0x4b');utils['info'](util[_0x3d70('0x4')](_0x3d70('0x4c'),_0x3dc70b[_0x3d70('0x6')],queues[_0x3dc70b[_0x3d70('0x47')]][_0x3d70('0x23')],_0x3dc70b[_0x3d70('0x47')],_0x3dc70b[_0x3d70('0x49')]));}}catch(_0x4b9311){utils[_0x3d70('0x19')](util['format'](_0x3d70('0x4d'),_0x3dc70b['uniqueid']),_0x4b9311);}};exports['attendedtransfer']=function(_0x30adcf){try{utils[_0x3d70('0x13')](util[_0x3d70('0x4')](_0x3d70('0x4e'),_0x30adcf[_0x3d70('0x4f')]),_0x30adcf);if(_0x30adcf[_0x3d70('0x4f')]==_0x30adcf[_0x3d70('0x50')]){if(!_[_0x3d70('0x1b')](queues[_0x30adcf[_0x3d70('0x51')]])){utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x52'),_0x30adcf[_0x3d70('0x4f')],queues[_0x30adcf[_0x3d70('0x51')]][_0x3d70('0x23')],_0x30adcf[_0x3d70('0x53')]));queues[_0x30adcf['secondtransfererlinkedid']]['transfer']=!![];queues[_0x30adcf[_0x3d70('0x51')]][_0x3d70('0x54')]='ATTENDED';queues[_0x30adcf[_0x3d70('0x51')]][_0x3d70('0x48')]=_0x30adcf[_0x3d70('0x53')];queues[_0x30adcf[_0x3d70('0x51')]][_0x3d70('0x4a')]=_0x30adcf[_0x3d70('0x4f')];queues[_0x30adcf[_0x3d70('0x51')]]['queuecallerexitreason']=_0x3d70('0x55');}if(!_[_0x3d70('0x1b')](queues[_0x30adcf[_0x3d70('0x50')]])){if(_0x30adcf[_0x3d70('0x56')]&&queues[_0x30adcf[_0x3d70('0x56')]]){queues[_0x30adcf['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x30adcf[_0x3d70('0x47')]]=_[_0x3d70('0x57')](queues[_0x30adcf[_0x3d70('0x56')]]);queues[_0x30adcf[_0x3d70('0x47')]]['transfereduniqueid']=_0x30adcf[_0x3d70('0x58')];queues[_0x30adcf[_0x3d70('0x47')]]['queuecallerenterreason']=0x2;queues[_0x30adcf[_0x3d70('0x47')]]['calleridnum']=queues[_0x30adcf[_0x3d70('0x51')]][_0x3d70('0xa')];queues[_0x30adcf[_0x3d70('0x47')]]['calleridname']=queues[_0x30adcf['secondtransfererlinkedid']][_0x3d70('0x59')];queues[_0x30adcf['transfereeuniqueid']][_0x3d70('0x5a')]=utils['now']();queues[_0x30adcf[_0x3d70('0x47')]][_0x3d70('0x1d')]=utils[_0x3d70('0x18')]();queues[_0x30adcf[_0x3d70('0x47')]][_0x3d70('0x38')]=0x0;queues[_0x30adcf[_0x3d70('0x47')]][_0x3d70('0x5b')]=0x0;utils[_0x3d70('0x3')](util[_0x3d70('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x30adcf[_0x3d70('0x4f')],queues[_0x30adcf['transfereeuniqueid']]['name'],queues[_0x30adcf[_0x3d70('0x47')]][_0x3d70('0xa')],queues[_0x30adcf[_0x3d70('0x47')]][_0x3d70('0x59')]));}else{utils[_0x3d70('0x3')](util['format'](_0x3d70('0x5c'),_0x30adcf[_0x3d70('0x4f')],queues[_0x30adcf['origtransfererlinkedid']][_0x3d70('0x23')],_0x30adcf[_0x3d70('0x51')]));queues[_0x30adcf['origtransfererlinkedid']][_0x3d70('0x11')]=_0x30adcf[_0x3d70('0x51')];}}}else if(_0x30adcf[_0x3d70('0x5d')]==_0x30adcf['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x30adcf['origtransfererlinkedid']])){utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x5e'),_0x30adcf[_0x3d70('0x4f')],queues[_0x30adcf['origtransfererlinkedid']][_0x3d70('0x23')],_0x30adcf[_0x3d70('0x5d')],_0x30adcf[_0x3d70('0x5f')]));queues[_0x30adcf[_0x3d70('0x50')]]['transfer']=!![];queues[_0x30adcf[_0x3d70('0x50')]][_0x3d70('0x54')]=_0x3d70('0x60');queues[_0x30adcf[_0x3d70('0x50')]]['transferexten']=_0x30adcf[_0x3d70('0x5f')];queues[_0x30adcf['origtransfererlinkedid']]['transferuniqueid']=_0x30adcf[_0x3d70('0x5d')];queues[_0x30adcf[_0x3d70('0x50')]][_0x3d70('0xc')]='ATTENDEDTRANSFER';}if(!_[_0x3d70('0x1b')](queues[_0x30adcf[_0x3d70('0x51')]])){if(_0x30adcf[_0x3d70('0x61')]&&queues[_0x30adcf[_0x3d70('0x61')]]){queues[_0x30adcf[_0x3d70('0x61')]][_0x3d70('0x25')]=0x1;queues[_0x30adcf['transfertargetuniqueid']]=_[_0x3d70('0x57')](queues[_0x30adcf['transfertargetlinkedid']]);queues[_0x30adcf['transfertargetuniqueid']]['transfereduniqueid']=_0x30adcf[_0x3d70('0x58')];queues[_0x30adcf[_0x3d70('0x58')]]['queuecallerenterreason']=0x2;queues[_0x30adcf['transfertargetuniqueid']][_0x3d70('0xa')]=queues[_0x30adcf[_0x3d70('0x50')]][_0x3d70('0xa')];queues[_0x30adcf[_0x3d70('0x58')]][_0x3d70('0x59')]=queues[_0x30adcf[_0x3d70('0x50')]][_0x3d70('0x59')];queues[_0x30adcf[_0x3d70('0x58')]]['queuecallerjoinAt']=utils[_0x3d70('0x18')]();queues[_0x30adcf[_0x3d70('0x58')]][_0x3d70('0x1d')]=utils[_0x3d70('0x18')]();queues[_0x30adcf[_0x3d70('0x58')]][_0x3d70('0x38')]=0x0;queues[_0x30adcf['transfertargetuniqueid']]['mohtime']=0x0;utils['info'](util[_0x3d70('0x4')](_0x3d70('0x62'),_0x30adcf['origtransfereruniqueid'],queues[_0x30adcf[_0x3d70('0x58')]][_0x3d70('0x23')],queues[_0x30adcf[_0x3d70('0x58')]]['transfereduniqueid'],queues[_0x30adcf[_0x3d70('0x58')]][_0x3d70('0xa')],queues[_0x30adcf['transfertargetuniqueid']]['calleridname']));}else{utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x5c'),_0x30adcf['origtransfereruniqueid'],queues[_0x30adcf[_0x3d70('0x51')]]['name'],_0x30adcf[_0x3d70('0x50')]));queues[_0x30adcf[_0x3d70('0x51')]]['transfereduniqueid']=_0x30adcf[_0x3d70('0x50')];}}}}catch(_0x179790){utils[_0x3d70('0x19')](util['format'](_0x3d70('0x4e'),_0x30adcf[_0x3d70('0x4f')]),_0x179790);}};exports[_0x3d70('0x63')]=function(_0xc05214){try{if(!_[_0x3d70('0x1b')](queues[_0xc05214[_0x3d70('0x6')]])){utils['debug'](util['format'](_0x3d70('0x64'),_0xc05214[_0x3d70('0x6')]),_0xc05214);queues[_0xc05214[_0x3d70('0x6')]][_0x3d70('0x65')]=utils[_0x3d70('0x18')]();utils[_0x3d70('0x3')](util['format'](_0x3d70('0x66'),_0xc05214['uniqueid'],queues[_0xc05214[_0x3d70('0x6')]]['name'],queues[_0xc05214[_0x3d70('0x6')]][_0x3d70('0x65')]));}}catch(_0x5c638e){utils['error'](util[_0x3d70('0x4')](_0x3d70('0x64'),_0xc05214['uniqueid']),_0x5c638e);}};exports[_0x3d70('0x67')]=function(_0x11c61f){try{if(!_['isNil'](queues[_0x11c61f['uniqueid']])){if(!_['isNil'](queues[_0x11c61f[_0x3d70('0x6')]][_0x3d70('0x65')])){utils[_0x3d70('0x13')](util[_0x3d70('0x4')](_0x3d70('0x68'),_0x11c61f[_0x3d70('0x6')]),_0x11c61f);queues[_0x11c61f[_0x3d70('0x6')]]['mohtime']+=utils[_0x3d70('0x39')](utils['now'](),queues[_0x11c61f[_0x3d70('0x6')]][_0x3d70('0x65')]);utils[_0x3d70('0x3')](util[_0x3d70('0x4')](_0x3d70('0x69'),_0x11c61f[_0x3d70('0x6')],queues[_0x11c61f[_0x3d70('0x6')]][_0x3d70('0x23')],queues[_0x11c61f['uniqueid']][_0x3d70('0x5b')]));delete queues[_0x11c61f[_0x3d70('0x6')]][_0x3d70('0x65')];}}}catch(_0x203c3c){utils[_0x3d70('0x19')](util[_0x3d70('0x4')](_0x3d70('0x68'),_0x11c61f[_0x3d70('0x6')]),_0x203c3c);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 7c8dc8e..0afee50 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 _0x64c2=['CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','find','monitors','push','hangup','calleridname','calleridnum','connectedlinenum','connectedlinename','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x64c2,0x71));var _0x264c=function(_0x4672fd,_0x4849c4){_0x4672fd=_0x4672fd-0x0;var _0x34e503=_0x64c2[_0x4672fd];return _0x34e503;};'use strict';var _=require(_0x264c('0x0'));var util=require(_0x264c('0x1'));var utils=require(_0x264c('0x2'));var recordings={};function writeDB(_0x3eb0bd){utils[_0x264c('0x3')](util[_0x264c('0x4')](_0x264c('0x5'),_0x3eb0bd['uniqueid']));if(_0x3eb0bd[_0x264c('0x6')]){utils[_0x264c('0x7')](_0x3eb0bd[_0x264c('0x6')])[_0x264c('0x8')](function(_0x49f2a1){if(_0x49f2a1){_0x3eb0bd[_0x264c('0x9')]=_0x49f2a1['name'];_0x3eb0bd['UserId']=_0x49f2a1['id'];}utils['request']('CreateVoiceRecording',_0x3eb0bd);});}else{utils[_0x264c('0xa')](_0x264c('0xb'),_0x3eb0bd);}}exports[_0x264c('0xc')]=function(_0x24a341){try{utils[_0x264c('0xd')](util[_0x264c('0x4')](_0x264c('0xe'),_0x24a341[_0x264c('0xf')]),_0x24a341);if(_0x24a341['uniqueid']==_0x24a341[_0x264c('0x10')]){utils['info'](util[_0x264c('0x4')](_0x264c('0x11'),_0x24a341[_0x264c('0xf')],_0x24a341[_0x264c('0x12')],_0x24a341[_0x264c('0x13')]));recordings[_0x24a341['uniqueid']]={'uniqueid':_0x24a341[_0x264c('0xf')],'accountcode':_0x24a341['accountcode'],'exten':_0x24a341['exten'],'context':_0x24a341[_0x264c('0x12')],'channel':_0x24a341[_0x264c('0x14')],'monitors':[]};}}catch(_0x5e66cf){utils['error'](util[_0x264c('0x4')](_0x264c('0xe'),_0x24a341[_0x264c('0xf')]),_0x5e66cf);}};exports[_0x264c('0x15')]=function(_0x223e70){try{utils[_0x264c('0xd')](util[_0x264c('0x4')](_0x264c('0x16'),_0x223e70[_0x264c('0xf')]),_0x223e70);if(!_[_0x264c('0x17')](recordings[_0x223e70[_0x264c('0xf')]])&&_0x223e70[_0x264c('0x18')]==0x6){utils[_0x264c('0x3')](util['format'](_0x264c('0x19'),_0x223e70[_0x264c('0xf')],_0x223e70[_0x264c('0x12')],_0x223e70[_0x264c('0x14')]));}else if(!_[_0x264c('0x17')](recordings[_0x223e70[_0x264c('0x10')]])&&_0x223e70[_0x264c('0x18')]==0x6&&_0x223e70[_0x264c('0x12')]!=_0x264c('0x1a')){utils[_0x264c('0x3')](util[_0x264c('0x4')](_0x264c('0x1b'),_0x223e70['uniqueid'],_0x223e70[_0x264c('0x10')],_0x223e70[_0x264c('0x12')],_0x223e70[_0x264c('0x14')]));recordings[_0x223e70[_0x264c('0x10')]][_0x264c('0x6')]=_0x223e70['accountcode'];}}catch(_0x56f2b7){utils[_0x264c('0x1c')](util[_0x264c('0x4')](_0x264c('0x16'),_0x223e70['uniqueid']),_0x56f2b7);}};exports[_0x264c('0x1d')]=function(_0x115fc3){try{if(!_[_0x264c('0x17')](_0x115fc3[_0x264c('0x1e')])&&!_[_0x264c('0x17')](_0x115fc3[_0x264c('0x1e')][_0x264c('0x1f')])){utils[_0x264c('0xd')](util[_0x264c('0x4')](_0x264c('0x20'),_0x115fc3['uniqueid']),_0x115fc3);utils['info'](util['format'](_0x264c('0x21'),_0x115fc3['uniqueid'],_0x115fc3[_0x264c('0x1e')],_0x115fc3[_0x264c('0x22')]));if(_['endsWith'](_0x115fc3[_0x264c('0x22')],_0x264c('0x23'))){_0x115fc3['value']=_0x115fc3[_0x264c('0x22')][_0x264c('0x24')]('.wav49','.WAV');}if(recordings[_0x115fc3['linkedid']]){var _0x1b37e7=_[_0x264c('0x25')](recordings[_0x115fc3['linkedid']][_0x264c('0x26')],{'value':_0x115fc3[_0x264c('0x22')]});if(_[_0x264c('0x17')](_0x1b37e7)){recordings[_0x115fc3[_0x264c('0x10')]][_0x264c('0x26')][_0x264c('0x27')]({'value':_0x115fc3['value']});}}}}catch(_0x2bcf22){utils[_0x264c('0x1c')](util[_0x264c('0x4')](_0x264c('0x20'),_0x115fc3['uniqueid']),_0x2bcf22);}};exports[_0x264c('0x28')]=function(_0x20dbec){try{if(!_[_0x264c('0x17')](recordings[_0x20dbec[_0x264c('0xf')]])){utils[_0x264c('0xd')](util['format']('[%s][recordings][hangup]',_0x20dbec['uniqueid']),_0x20dbec);utils[_0x264c('0x3')](util[_0x264c('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x20dbec['uniqueid'],_0x20dbec['calleridnum'],_0x20dbec[_0x264c('0x29')],_0x20dbec['cause-txt']));recordings[_0x20dbec[_0x264c('0xf')]][_0x264c('0x2a')]=_0x20dbec['calleridnum'];recordings[_0x20dbec[_0x264c('0xf')]]['calleridname']=_0x20dbec[_0x264c('0x29')];recordings[_0x20dbec[_0x264c('0xf')]][_0x264c('0x2b')]=_0x20dbec[_0x264c('0x2b')];recordings[_0x20dbec[_0x264c('0xf')]][_0x264c('0x2c')]=_0x20dbec[_0x264c('0x2c')];if(recordings[_0x20dbec[_0x264c('0xf')]]['type']=='outbound'&&recordings[_0x20dbec[_0x264c('0xf')]][_0x264c('0x6')]){recordings[_0x20dbec['uniqueid']]['connectedlinenum']=recordings[_0x20dbec[_0x264c('0xf')]][_0x264c('0x6')];recordings[_0x20dbec[_0x264c('0xf')]]['connectedlinename']='';}recordings[_0x20dbec[_0x264c('0xf')]]['monitors'][_0x264c('0x2d')](function(_0x5b9dbf){var _0xd50714=_[_0x264c('0x2e')](recordings[_0x20dbec[_0x264c('0xf')]]);_0xd50714[_0x264c('0x22')]=_0x5b9dbf[_0x264c('0x22')];writeDB(_0xd50714);});delete recordings[_0x20dbec[_0x264c('0xf')]];}}catch(_0x4d4b84){utils[_0x264c('0x1c')](util[_0x264c('0x4')](_0x264c('0x2f'),_0x20dbec[_0x264c('0xf')]),_0x4d4b84);}};exports[_0x264c('0x30')]=function(_0x451946){try{if(!_[_0x264c('0x17')](recordings[_0x451946[_0x264c('0xf')]])){utils[_0x264c('0xd')](util['format'](_0x264c('0x31'),_0x451946[_0x264c('0xf')]),_0x451946);utils[_0x264c('0x3')](util[_0x264c('0x4')](_0x264c('0x32'),_0x451946['uniqueid'],_0x451946['application'],_0x451946['appdata']));if(_0x451946[_0x264c('0x33')][_0x264c('0x34')]()==_0x264c('0x35')&&_['startsWith'](_0x451946[_0x264c('0x36')][_0x264c('0x34')](),_0x264c('0x37'))){var _0x1fa001=_0x451946[_0x264c('0x36')][_0x264c('0x38')]('=');var _0x54fbf0=_0x1fa001[0x0]['substring'](_0x1fa001[0x0][_0x264c('0x39')]('(')+0x1,_0x1fa001[0x0][_0x264c('0x39')](')'));var _0x305438=_0x1fa001[0x1];recordings[_0x451946[_0x264c('0xf')]][_0x54fbf0]=_0x305438;}}}catch(_0x2329d2){utils['error'](util[_0x264c('0x4')]('[%s][recordings][newexten]',_0x451946[_0x264c('0xf')]),_0x2329d2);}};exports[_0x264c('0x3a')]=function(_0x2b5b3e){try{if(!_[_0x264c('0x17')](recordings[_0x2b5b3e[_0x264c('0xf')]])){utils[_0x264c('0xd')](util['format'](_0x264c('0x3b'),_0x2b5b3e[_0x264c('0xf')]),_0x2b5b3e);utils['info'](util[_0x264c('0x4')](_0x264c('0x3c'),_0x2b5b3e['uniqueid'],_0x2b5b3e[_0x264c('0x3d')]));recordings[_0x2b5b3e['uniqueid']][_0x264c('0x3d')]=_0x2b5b3e[_0x264c('0x3d')];}}catch(_0xee37b7){utils[_0x264c('0x1c')](util[_0x264c('0x4')]('[%s][recordings][queuecallerjoin]',_0x2b5b3e[_0x264c('0xf')]),_0xee37b7);}}; \ No newline at end of file +var _0xa824=['exten','channel','error','newstate','debug','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','varset','variable','mixmonitor_filename','value','endsWith','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','[%s][recordings][hangup]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','UserId','CreateVoiceRecording','request','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context'];(function(_0x1987e8,_0x51add3){var _0x43b359=function(_0x1aeaa8){while(--_0x1aeaa8){_0x1987e8['push'](_0x1987e8['shift']());}};_0x43b359(++_0x51add3);}(_0xa824,0x1e5));var _0x4a82=function(_0x4dc392,_0x255362){_0x4dc392=_0x4dc392-0x0;var _0x4e45ad=_0xa824[_0x4dc392];return _0x4e45ad;};'use strict';var _=require(_0x4a82('0x0'));var util=require(_0x4a82('0x1'));var utils=require(_0x4a82('0x2'));var recordings={};function writeDB(_0x5e0b50){utils[_0x4a82('0x3')](util[_0x4a82('0x4')](_0x4a82('0x5'),_0x5e0b50[_0x4a82('0x6')]));if(_0x5e0b50[_0x4a82('0x7')]){utils[_0x4a82('0x8')](_0x5e0b50[_0x4a82('0x7')])[_0x4a82('0x9')](function(_0x2a0a93){if(_0x2a0a93){_0x5e0b50[_0x4a82('0xa')]=_0x2a0a93['name'];_0x5e0b50[_0x4a82('0xb')]=_0x2a0a93['id'];}utils['request'](_0x4a82('0xc'),_0x5e0b50);});}else{utils[_0x4a82('0xd')]('CreateVoiceRecording',_0x5e0b50);}}exports[_0x4a82('0xe')]=function(_0x4b015d){try{utils['debug'](util[_0x4a82('0x4')](_0x4a82('0xf'),_0x4b015d[_0x4a82('0x6')]),_0x4b015d);if(_0x4b015d[_0x4a82('0x6')]==_0x4b015d[_0x4a82('0x10')]){utils['info'](util[_0x4a82('0x4')](_0x4a82('0x11'),_0x4b015d[_0x4a82('0x6')],_0x4b015d[_0x4a82('0x12')],_0x4b015d[_0x4a82('0x13')]));recordings[_0x4b015d[_0x4a82('0x6')]]={'uniqueid':_0x4b015d[_0x4a82('0x6')],'accountcode':_0x4b015d[_0x4a82('0x7')],'exten':_0x4b015d[_0x4a82('0x13')],'context':_0x4b015d[_0x4a82('0x12')],'channel':_0x4b015d[_0x4a82('0x14')],'monitors':[]};}}catch(_0x264d18){utils[_0x4a82('0x15')](util[_0x4a82('0x4')]('[%s][recordings][newchannel]',_0x4b015d[_0x4a82('0x6')]),_0x264d18);}};exports[_0x4a82('0x16')]=function(_0x2619a4){try{utils[_0x4a82('0x17')](util[_0x4a82('0x4')]('[%s][recordings][newstate]',_0x2619a4[_0x4a82('0x6')]),_0x2619a4);if(!_['isNil'](recordings[_0x2619a4['uniqueid']])&&_0x2619a4[_0x4a82('0x18')]==0x6){utils[_0x4a82('0x3')](util['format'](_0x4a82('0x19'),_0x2619a4[_0x4a82('0x6')],_0x2619a4[_0x4a82('0x12')],_0x2619a4[_0x4a82('0x14')]));}else if(!_[_0x4a82('0x1a')](recordings[_0x2619a4[_0x4a82('0x10')]])&&_0x2619a4['channelstate']==0x6&&_0x2619a4['context']!=_0x4a82('0x1b')){utils[_0x4a82('0x3')](util[_0x4a82('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2619a4[_0x4a82('0x6')],_0x2619a4[_0x4a82('0x10')],_0x2619a4[_0x4a82('0x12')],_0x2619a4[_0x4a82('0x14')]));recordings[_0x2619a4[_0x4a82('0x10')]][_0x4a82('0x7')]=_0x2619a4[_0x4a82('0x7')];}}catch(_0x2d9c2e){utils['error'](util['format']('[%s][recordings][newstate]',_0x2619a4[_0x4a82('0x6')]),_0x2d9c2e);}};exports[_0x4a82('0x1c')]=function(_0x2e7797){try{if(!_['isNil'](_0x2e7797[_0x4a82('0x1d')])&&!_[_0x4a82('0x1a')](_0x2e7797[_0x4a82('0x1d')][_0x4a82('0x1e')])){utils[_0x4a82('0x17')](util[_0x4a82('0x4')]('[%s][recordings][varset]',_0x2e7797[_0x4a82('0x6')]),_0x2e7797);utils[_0x4a82('0x3')](util[_0x4a82('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2e7797['uniqueid'],_0x2e7797[_0x4a82('0x1d')],_0x2e7797[_0x4a82('0x1f')]));if(_[_0x4a82('0x20')](_0x2e7797['value'],'.wav49')){_0x2e7797[_0x4a82('0x1f')]=_0x2e7797['value'][_0x4a82('0x21')]('.wav49',_0x4a82('0x22'));}if(recordings[_0x2e7797[_0x4a82('0x10')]]){var _0x59c426=_[_0x4a82('0x23')](recordings[_0x2e7797[_0x4a82('0x10')]][_0x4a82('0x24')],{'value':_0x2e7797[_0x4a82('0x1f')]});if(_[_0x4a82('0x1a')](_0x59c426)){recordings[_0x2e7797[_0x4a82('0x10')]][_0x4a82('0x24')][_0x4a82('0x25')]({'value':_0x2e7797[_0x4a82('0x1f')]});}}}}catch(_0x234f71){utils[_0x4a82('0x15')](util[_0x4a82('0x4')](_0x4a82('0x26'),_0x2e7797[_0x4a82('0x6')]),_0x234f71);}};exports[_0x4a82('0x27')]=function(_0x29072c){try{if(!_[_0x4a82('0x1a')](recordings[_0x29072c['uniqueid']])){utils[_0x4a82('0x17')](util[_0x4a82('0x4')]('[%s][recordings][hangup]',_0x29072c[_0x4a82('0x6')]),_0x29072c);utils[_0x4a82('0x3')](util[_0x4a82('0x4')](_0x4a82('0x28'),_0x29072c['uniqueid'],_0x29072c[_0x4a82('0x29')],_0x29072c[_0x4a82('0x2a')],_0x29072c['cause-txt']));recordings[_0x29072c[_0x4a82('0x6')]]['calleridnum']=_0x29072c['calleridnum'];recordings[_0x29072c[_0x4a82('0x6')]][_0x4a82('0x2a')]=_0x29072c[_0x4a82('0x2a')];recordings[_0x29072c[_0x4a82('0x6')]][_0x4a82('0x2b')]=_0x29072c['connectedlinenum'];recordings[_0x29072c[_0x4a82('0x6')]][_0x4a82('0x2c')]=_0x29072c['connectedlinename'];if(recordings[_0x29072c[_0x4a82('0x6')]][_0x4a82('0x2d')]=='outbound'&&recordings[_0x29072c['uniqueid']]['accountcode']){recordings[_0x29072c[_0x4a82('0x6')]][_0x4a82('0x2b')]=recordings[_0x29072c[_0x4a82('0x6')]][_0x4a82('0x7')];recordings[_0x29072c['uniqueid']]['connectedlinename']='';}recordings[_0x29072c[_0x4a82('0x6')]][_0x4a82('0x24')][_0x4a82('0x2e')](function(_0x417511){var _0x3ca1ab=_['clone'](recordings[_0x29072c['uniqueid']]);_0x3ca1ab[_0x4a82('0x1f')]=_0x417511['value'];writeDB(_0x3ca1ab);});delete recordings[_0x29072c[_0x4a82('0x6')]];}}catch(_0xba1afb){utils[_0x4a82('0x15')](util[_0x4a82('0x4')](_0x4a82('0x2f'),_0x29072c['uniqueid']),_0xba1afb);}};exports['newexten']=function(_0x313a2f){try{if(!_[_0x4a82('0x1a')](recordings[_0x313a2f[_0x4a82('0x6')]])){utils[_0x4a82('0x17')](util[_0x4a82('0x4')]('[%s][recordings][newexten]',_0x313a2f['uniqueid']),_0x313a2f);utils[_0x4a82('0x3')](util[_0x4a82('0x4')](_0x4a82('0x30'),_0x313a2f[_0x4a82('0x6')],_0x313a2f[_0x4a82('0x31')],_0x313a2f[_0x4a82('0x32')]));if(_0x313a2f[_0x4a82('0x31')][_0x4a82('0x33')]()==_0x4a82('0x34')&&_[_0x4a82('0x35')](_0x313a2f[_0x4a82('0x32')]['toLowerCase'](),_0x4a82('0x36'))){var _0x551b0a=_0x313a2f[_0x4a82('0x32')][_0x4a82('0x37')]('=');var _0x1eeafc=_0x551b0a[0x0][_0x4a82('0x38')](_0x551b0a[0x0][_0x4a82('0x39')]('(')+0x1,_0x551b0a[0x0][_0x4a82('0x39')](')'));var _0x33829f=_0x551b0a[0x1];recordings[_0x313a2f[_0x4a82('0x6')]][_0x1eeafc]=_0x33829f;}}}catch(_0x248c6a){utils[_0x4a82('0x15')](util['format'](_0x4a82('0x3a'),_0x313a2f[_0x4a82('0x6')]),_0x248c6a);}};exports[_0x4a82('0x3b')]=function(_0x10a9b4){try{if(!_[_0x4a82('0x1a')](recordings[_0x10a9b4['uniqueid']])){utils[_0x4a82('0x17')](util[_0x4a82('0x4')](_0x4a82('0x3c'),_0x10a9b4['uniqueid']),_0x10a9b4);utils[_0x4a82('0x3')](util['format'](_0x4a82('0x3d'),_0x10a9b4[_0x4a82('0x6')],_0x10a9b4[_0x4a82('0x3e')]));recordings[_0x10a9b4['uniqueid']][_0x4a82('0x3e')]=_0x10a9b4[_0x4a82('0x3e')];}}catch(_0xcc6e02){utils[_0x4a82('0x15')](util[_0x4a82('0x4')]('[%s][recordings][queuecallerjoin]',_0x10a9b4[_0x4a82('0x6')]),_0xcc6e02);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 37e4ccb..1e8ccf2 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 _0xd8fc=['transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','lodash','util','./utils','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','format','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blinds','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','isNil','transfereechannel','assign','transfertargetchannel'];(function(_0x5b96f6,_0x26fe54){var _0xe67cd8=function(_0x585ce5){while(--_0x585ce5){_0x5b96f6['push'](_0x5b96f6['shift']());}};_0xe67cd8(++_0x26fe54);}(_0xd8fc,0x116));var _0xcd8f=function(_0x5bd1a9,_0x313714){_0x5bd1a9=_0x5bd1a9-0x0;var _0x2ba345=_0xd8fc[_0x5bd1a9];return _0x2ba345;};'use strict';var _=require(_0xcd8f('0x0'));var util=require(_0xcd8f('0x1'));var utils=require(_0xcd8f('0x2'));function writeDB(_0x1b3935){utils['info'](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x1b3935[_0xcd8f('0x3')]===_0xcd8f('0x4')?_0x1b3935[_0xcd8f('0x5')]:_0x1b3935[_0xcd8f('0x6')],_0x1b3935['type']));utils[_0xcd8f('0x7')](_0xcd8f('0x8'),_0x1b3935);}exports['blinds']={};exports[_0xcd8f('0x9')]=function(_0x4290e4){try{utils[_0xcd8f('0xa')](util[_0xcd8f('0xb')](_0xcd8f('0xc'),_0x4290e4[_0xcd8f('0x6')]),_0x4290e4);utils[_0xcd8f('0xd')](util[_0xcd8f('0xb')](_0xcd8f('0xe'),_0x4290e4[_0xcd8f('0x6')],_0x4290e4[_0xcd8f('0xf')],_0x4290e4[_0xcd8f('0x10')],_0x4290e4[_0xcd8f('0x11')],_0x4290e4[_0xcd8f('0x12')]));_0x4290e4[_0xcd8f('0x3')]='blind';exports[_0xcd8f('0x13')][_0x4290e4['transfereruniqueid']]=_0x4290e4;writeDB(_0x4290e4);}catch(_0x195147){utils[_0xcd8f('0x14')](util['format'](_0xcd8f('0xc'),_0x4290e4[_0xcd8f('0x6')]),_0x195147);}};exports['attendedtransfer']=function(_0x2cab31){try{utils[_0xcd8f('0xa')](util[_0xcd8f('0xb')](_0xcd8f('0x15'),_0x2cab31[_0xcd8f('0x5')]),_0x2cab31);utils[_0xcd8f('0xd')](util[_0xcd8f('0xb')](_0xcd8f('0x16'),_0x2cab31[_0xcd8f('0x5')],_0x2cab31['origtransferercalleridnum'],_0x2cab31[_0xcd8f('0x17')],_0x2cab31['transfertargetcalleridnum'],_0x2cab31[_0xcd8f('0x18')]));_0x2cab31=_['assign'](_0x2cab31,{'transfererchannel':_0x2cab31[_0xcd8f('0x19')],'transferercalleridnum':_0x2cab31[_0xcd8f('0x1a')],'transferercalleridname':_0x2cab31[_0xcd8f('0x17')],'transfererconnectedlinenum':_0x2cab31['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2cab31[_0xcd8f('0x1b')],'transfereraccountcode':_0x2cab31[_0xcd8f('0x1c')],'transferercontext':_0x2cab31['secondtransferercontext'],'transfererexten':_0x2cab31[_0xcd8f('0x1d')],'transfererlinkedid':_0x2cab31['origtransfererlinkedid'],'context':_0x2cab31['origtransferercontext'],'extension':_0x2cab31['origtransfererexten'],'type':_0xcd8f('0x4')});if(_[_0xcd8f('0x1e')](_0x2cab31[_0xcd8f('0x1f')])){_0x2cab31=_[_0xcd8f('0x20')](_0x2cab31,{'transfereechannel':_0x2cab31[_0xcd8f('0x21')],'transfereecalleridnum':_0x2cab31[_0xcd8f('0x22')],'transfereecalleridname':_0x2cab31['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2cab31[_0xcd8f('0x23')],'transfereeconnectedlinename':_0x2cab31[_0xcd8f('0x24')],'transfereeaccountcode':_0x2cab31['transfertargetaccountcode'],'transfereecontext':_0x2cab31[_0xcd8f('0x25')],'transfereeexten':_0x2cab31[_0xcd8f('0x26')],'transfereelinkedid':_0x2cab31['transfertargetlinkedid']});}writeDB(_0x2cab31);}catch(_0x2a036d){utils['error'](util['format'](_0xcd8f('0x15'),_0x2cab31['origtransfereruniqueid']),_0x2a036d);}}; \ No newline at end of file +var _0x51a4=['debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blinds','blindtransfer'];(function(_0x2dff3c,_0x1f2800){var _0x446dd9=function(_0xe5e998){while(--_0xe5e998){_0x2dff3c['push'](_0x2dff3c['shift']());}};_0x446dd9(++_0x1f2800);}(_0x51a4,0xab));var _0x451a=function(_0x1c843f,_0x59ff96){_0x1c843f=_0x1c843f-0x0;var _0x10c366=_0x51a4[_0x1c843f];return _0x10c366;};'use strict';var _=require(_0x451a('0x0'));var util=require(_0x451a('0x1'));var utils=require(_0x451a('0x2'));function writeDB(_0x26c401){utils[_0x451a('0x3')](util[_0x451a('0x4')](_0x451a('0x5'),_0x26c401['type']==='attended'?_0x26c401[_0x451a('0x6')]:_0x26c401[_0x451a('0x7')],_0x26c401[_0x451a('0x8')]));utils[_0x451a('0x9')](_0x451a('0xa'),_0x26c401);}exports[_0x451a('0xb')]={};exports[_0x451a('0xc')]=function(_0xe4061d){try{utils[_0x451a('0xd')](util[_0x451a('0x4')](_0x451a('0xe'),_0xe4061d[_0x451a('0x7')]),_0xe4061d);utils[_0x451a('0x3')](util[_0x451a('0x4')](_0x451a('0xf'),_0xe4061d['uniqueid'],_0xe4061d[_0x451a('0x10')],_0xe4061d['transferercalleridname'],_0xe4061d[_0x451a('0x11')],_0xe4061d[_0x451a('0x12')]));_0xe4061d['type']=_0x451a('0x13');exports[_0x451a('0xb')][_0xe4061d['transfereruniqueid']]=_0xe4061d;writeDB(_0xe4061d);}catch(_0x32bf){utils[_0x451a('0x14')](util[_0x451a('0x4')](_0x451a('0xe'),_0xe4061d[_0x451a('0x7')]),_0x32bf);}};exports[_0x451a('0x15')]=function(_0x951191){try{utils['debug'](util[_0x451a('0x4')](_0x451a('0x16'),_0x951191['origtransfereruniqueid']),_0x951191);utils[_0x451a('0x3')](util[_0x451a('0x4')](_0x451a('0x17'),_0x951191[_0x451a('0x6')],_0x951191[_0x451a('0x18')],_0x951191['origtransferercalleridname'],_0x951191[_0x451a('0x19')],_0x951191[_0x451a('0x1a')]));_0x951191=_['assign'](_0x951191,{'transfererchannel':_0x951191[_0x451a('0x1b')],'transferercalleridnum':_0x951191[_0x451a('0x18')],'transferercalleridname':_0x951191[_0x451a('0x1c')],'transfererconnectedlinenum':_0x951191['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x951191[_0x451a('0x1d')],'transfereraccountcode':_0x951191[_0x451a('0x1e')],'transferercontext':_0x951191[_0x451a('0x1f')],'transfererexten':_0x951191[_0x451a('0x20')],'transfererlinkedid':_0x951191[_0x451a('0x21')],'context':_0x951191[_0x451a('0x22')],'extension':_0x951191[_0x451a('0x23')],'type':_0x451a('0x24')});if(_[_0x451a('0x25')](_0x951191[_0x451a('0x26')])){_0x951191=_[_0x451a('0x27')](_0x951191,{'transfereechannel':_0x951191['transfertargetchannel'],'transfereecalleridnum':_0x951191['transfertargetcalleridnum'],'transfereecalleridname':_0x951191[_0x451a('0x1a')],'transfereeconnectedlinenum':_0x951191[_0x451a('0x28')],'transfereeconnectedlinename':_0x951191[_0x451a('0x29')],'transfereeaccountcode':_0x951191[_0x451a('0x2a')],'transfereecontext':_0x951191[_0x451a('0x2b')],'transfereeexten':_0x951191[_0x451a('0x2c')],'transfereelinkedid':_0x951191[_0x451a('0x2d')]});}writeDB(_0x951191);}catch(_0x11fbee){utils[_0x451a('0x14')](util[_0x451a('0x4')](_0x451a('0x16'),_0x951191[_0x451a('0x6')]),_0x11fbee);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 6d9fadb..fbadf0a 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 _0xf7a1=['diffTime','diff','YYYY-MM-DD\x20HH:mm:ss','isAfter','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','error','inspect','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtractTime'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0xf7a1,0xef));var _0x1f7a=function(_0x4ca7c7,_0x5d16ee){_0x4ca7c7=_0x4ca7c7-0x0;var _0x456a87=_0xf7a1[_0x4ca7c7];return _0x456a87;};'use strict';var BPromise=require(_0x1f7a('0x0'));var jayson=require(_0x1f7a('0x1'));var moment=require(_0x1f7a('0x2'));var util=require(_0x1f7a('0x3'));var client=jayson[_0x1f7a('0x4')][_0x1f7a('0x5')]({'port':0x2329});var logger=require(_0x1f7a('0x6'))(_0x1f7a('0x7'));exports[_0x1f7a('0x8')]=function(_0x5db476,_0x56c12f){logger[_0x1f7a('0x8')](_0x5db476,_0x56c12f?util['inspect'](_0x56c12f,{'showHidden':![],'depth':null}):'');};exports[_0x1f7a('0x9')]=function(_0x785557,_0x24daa6){logger['debug'](_0x785557,_0x24daa6?util['inspect'](_0x24daa6,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x5a02e9,_0x3338fc){logger[_0x1f7a('0xa')](_0x5a02e9,_0x3338fc?util[_0x1f7a('0xb')](_0x3338fc,{'showHidden':![],'depth':null}):'');};exports[_0x1f7a('0xc')]=function(_0x29ce37,_0x58fc3b){return client['request'](_0x29ce37,{'body':_0x58fc3b})[_0x1f7a('0xd')](function(_0x10e6a4){logger['debug'](_0x1f7a('0xe'),_0x29ce37,_0x10e6a4?util[_0x1f7a('0xb')](_0x10e6a4,{'showHidden':![],'depth':null}):'');})[_0x1f7a('0xf')](function(_0x2799f4){logger[_0x1f7a('0xa')]('[utils][request]\x20name:%s',_0x29ce37,_0x2799f4?util[_0x1f7a('0xb')](_0x2799f4,{'showHidden':![],'depth':null}):'');});};function getUser(_0x50d666){return client[_0x1f7a('0xc')](_0x1f7a('0x10'),{'options':{'raw':!![],'attributes':['id',_0x1f7a('0x11'),_0x1f7a('0x12'),_0x1f7a('0x13')],'where':_0x50d666,'limit':0x1}})[_0x1f7a('0xd')](function(_0x453a6d){logger[_0x1f7a('0x9')]('[utils][getUser]\x20where:%s',JSON[_0x1f7a('0x14')](_0x50d666),_0x453a6d?util[_0x1f7a('0xb')](_0x453a6d,{'showHidden':![],'depth':null}):'');return _0x453a6d[_0x1f7a('0x15')][_0x1f7a('0x16')]?_0x453a6d[_0x1f7a('0x15')][0x0]:null;});}exports['getUserByInternal']=function(_0x53fac6){return new BPromise(function(_0x4ab2e2,_0x5ebaf3){if(_0x53fac6){return getUser({'internal':_0x53fac6})[_0x1f7a('0xd')](function(_0x251951){logger['info'](_0x1f7a('0x17'),_0x53fac6,_0x251951?_0x1f7a('0x18'):'notfound');return _0x4ab2e2(_0x251951);})['catch'](function(_0x52b646){logger[_0x1f7a('0xa')]('[utils][getUserByInternal]',_0x52b646?util[_0x1f7a('0xb')](_0x52b646,{'showHidden':![],'depth':null}):'');return _0x4ab2e2(null);});}return _0x4ab2e2(null);});};exports[_0x1f7a('0x19')]=function(_0x121a2c){return new BPromise(function(_0x5797da,_0x461fb5){if(_0x121a2c){return getUser({'interface':_0x121a2c})[_0x1f7a('0xd')](function(_0x34772d){logger[_0x1f7a('0x8')](_0x1f7a('0x1a'),_0x121a2c,_0x34772d?_0x1f7a('0x18'):_0x1f7a('0x1b'));return _0x5797da(_0x34772d);})[_0x1f7a('0xf')](function(_0x217e70){logger[_0x1f7a('0xa')](_0x1f7a('0x1c'),_0x217e70?util[_0x1f7a('0xb')](_0x217e70,{'showHidden':![],'depth':null}):'');return _0x5797da(null);});}return _0x5797da(null);});};exports[_0x1f7a('0x1d')]=function(_0x2d0d04){return new BPromise(function(_0x2f0f2b,_0x3c2ae6){if(_0x2d0d04){return getUser({'name':_0x2d0d04})['then'](function(_0x32ebec){logger[_0x1f7a('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2d0d04,_0x32ebec?_0x1f7a('0x18'):_0x1f7a('0x1b'));return _0x2f0f2b(_0x32ebec);})['catch'](function(_0x193e3f){logger['error'](_0x1f7a('0x1e'),_0x193e3f?util['inspect'](_0x193e3f,{'showHidden':![],'depth':null}):'');return _0x2f0f2b(null);});}return _0x2f0f2b(null);});};exports[_0x1f7a('0x1f')]=function(_0x1cb593){return new BPromise(function(_0x267887,_0x27947b){if(_0x1cb593){return client[_0x1f7a('0xc')](_0x1f7a('0x20'),{'options':{'raw':!![],'attributes':['id','name',_0x1f7a('0x21'),_0x1f7a('0x22'),_0x1f7a('0x23')],'where':{'name':_0x1cb593},'limit':0x1}})[_0x1f7a('0xd')](function(_0x3d6269){logger[_0x1f7a('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x1cb593,_0x3d6269?util['inspect'](_0x3d6269,{'showHidden':![],'depth':null}):'');logger[_0x1f7a('0x8')](_0x1f7a('0x24'),_0x1cb593,_0x3d6269?_0x1f7a('0x18'):'notfound');return _0x267887(_0x3d6269[_0x1f7a('0x15')][_0x1f7a('0x16')]?_0x3d6269[_0x1f7a('0x15')][0x0]:null);})[_0x1f7a('0xf')](function(_0x39449c){logger[_0x1f7a('0xa')](_0x1f7a('0x25'),_0x39449c?util['inspect'](_0x39449c,{'showHidden':![],'depth':null}):'');return _0x267887(null);});}return _0x267887(null);});};exports[_0x1f7a('0x26')]=function(_0x233611,_0xa9da65){return moment(_0x233611)[_0x1f7a('0x27')](_0xa9da65,_0x1f7a('0x28'))[_0x1f7a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x1f7a('0x2a')]=function(_0x4b0cdb,_0x219cd4){return moment(_0x4b0cdb)['subtract'](_0x219cd4,'seconds')[_0x1f7a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x1f7a('0x2b')]=function(_0x29dec2,_0x2c2693){return moment(_0x29dec2)[_0x1f7a('0x2c')](moment(_0x2c2693),_0x1f7a('0x28'));};exports['sumTime']=function(_0x394c38,_0x3b21f4){return parseInt(_0x394c38,0xa)+parseInt(_0x3b21f4,0xa);};exports['now']=function(){return moment()[_0x1f7a('0x29')](_0x1f7a('0x2d'));};exports[_0x1f7a('0x2e')]=function(_0x2fcef1,_0x244c60){if(_0x244c60){return moment(_0x2fcef1)['isAfter'](_0x244c60);}return!![];};exports['isBefore']=function(_0x2ffd3e,_0x573e1b){if(_0x573e1b){return moment(_0x2ffd3e)['isBefore'](_0x573e1b);}else if(_0x2ffd3e){return!![];}return![];}; \ No newline at end of file +var _0x0a08=['notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','seconds','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found'];(function(_0x5c4bbd,_0x2fcaa8){var _0x4b8c80=function(_0x3e8b08){while(--_0x3e8b08){_0x5c4bbd['push'](_0x5c4bbd['shift']());}};_0x4b8c80(++_0x2fcaa8);}(_0x0a08,0x153));var _0x80a0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0a08[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require(_0x80a0('0x0'));var jayson=require(_0x80a0('0x1'));var moment=require(_0x80a0('0x2'));var util=require(_0x80a0('0x3'));var client=jayson[_0x80a0('0x4')][_0x80a0('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0x80a0('0x6'));exports['info']=function(_0x439409,_0x176232){logger[_0x80a0('0x7')](_0x439409,_0x176232?util[_0x80a0('0x8')](_0x176232,{'showHidden':![],'depth':null}):'');};exports[_0x80a0('0x9')]=function(_0x216c4e,_0x4f0894){logger[_0x80a0('0x9')](_0x216c4e,_0x4f0894?util[_0x80a0('0x8')](_0x4f0894,{'showHidden':![],'depth':null}):'');};exports[_0x80a0('0xa')]=function(_0x55c69a,_0x461d38){logger[_0x80a0('0xa')](_0x55c69a,_0x461d38?util[_0x80a0('0x8')](_0x461d38,{'showHidden':![],'depth':null}):'');};exports[_0x80a0('0xb')]=function(_0x5a47e0,_0x1387ff){return client['request'](_0x5a47e0,{'body':_0x1387ff})[_0x80a0('0xc')](function(_0x2c1884){logger[_0x80a0('0x9')](_0x80a0('0xd'),_0x5a47e0,_0x2c1884?util['inspect'](_0x2c1884,{'showHidden':![],'depth':null}):'');})[_0x80a0('0xe')](function(_0x2bd34c){logger[_0x80a0('0xa')](_0x80a0('0xd'),_0x5a47e0,_0x2bd34c?util[_0x80a0('0x8')](_0x2bd34c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x38ebc1){return client['request'](_0x80a0('0xf'),{'options':{'raw':!![],'attributes':['id',_0x80a0('0x10'),'name',_0x80a0('0x11')],'where':_0x38ebc1,'limit':0x1}})['then'](function(_0x11cf41){logger[_0x80a0('0x9')](_0x80a0('0x12'),JSON[_0x80a0('0x13')](_0x38ebc1),_0x11cf41?util[_0x80a0('0x8')](_0x11cf41,{'showHidden':![],'depth':null}):'');return _0x11cf41[_0x80a0('0x14')][_0x80a0('0x15')]?_0x11cf41[_0x80a0('0x14')][0x0]:null;});}exports[_0x80a0('0x16')]=function(_0xab0f31){return new BPromise(function(_0x301f57,_0x51cf83){if(_0xab0f31){return getUser({'internal':_0xab0f31})[_0x80a0('0xc')](function(_0x2d2e23){logger[_0x80a0('0x7')](_0x80a0('0x17'),_0xab0f31,_0x2d2e23?_0x80a0('0x18'):_0x80a0('0x19'));return _0x301f57(_0x2d2e23);})['catch'](function(_0x3e4655){logger[_0x80a0('0xa')](_0x80a0('0x1a'),_0x3e4655?util[_0x80a0('0x8')](_0x3e4655,{'showHidden':![],'depth':null}):'');return _0x301f57(null);});}return _0x301f57(null);});};exports[_0x80a0('0x1b')]=function(_0x1ae836){return new BPromise(function(_0x5c6f44,_0x3822dc){if(_0x1ae836){return getUser({'interface':_0x1ae836})[_0x80a0('0xc')](function(_0x2c06f9){logger['info'](_0x80a0('0x1c'),_0x1ae836,_0x2c06f9?'found':_0x80a0('0x19'));return _0x5c6f44(_0x2c06f9);})[_0x80a0('0xe')](function(_0x310bfa){logger[_0x80a0('0xa')]('[utils][getUserByInterface]',_0x310bfa?util[_0x80a0('0x8')](_0x310bfa,{'showHidden':![],'depth':null}):'');return _0x5c6f44(null);});}return _0x5c6f44(null);});};exports[_0x80a0('0x1d')]=function(_0x1a8303){return new BPromise(function(_0x163807,_0x3545fa){if(_0x1a8303){return getUser({'name':_0x1a8303})[_0x80a0('0xc')](function(_0x53cc64){logger[_0x80a0('0x7')](_0x80a0('0x1e'),_0x1a8303,_0x53cc64?_0x80a0('0x18'):_0x80a0('0x19'));return _0x163807(_0x53cc64);})[_0x80a0('0xe')](function(_0x616e14){logger[_0x80a0('0xa')](_0x80a0('0x1f'),_0x616e14?util['inspect'](_0x616e14,{'showHidden':![],'depth':null}):'');return _0x163807(null);});}return _0x163807(null);});};exports[_0x80a0('0x20')]=function(_0x26323a){return new BPromise(function(_0x4c2a08,_0x49b749){if(_0x26323a){return client[_0x80a0('0xb')](_0x80a0('0x21'),{'options':{'raw':!![],'attributes':['id',_0x80a0('0x22'),_0x80a0('0x23'),_0x80a0('0x24'),'acwTimeout'],'where':{'name':_0x26323a},'limit':0x1}})[_0x80a0('0xc')](function(_0x3abc5f){logger[_0x80a0('0x9')](_0x80a0('0x25'),_0x26323a,_0x3abc5f?util[_0x80a0('0x8')](_0x3abc5f,{'showHidden':![],'depth':null}):'');logger[_0x80a0('0x7')](_0x80a0('0x26'),_0x26323a,_0x3abc5f?_0x80a0('0x18'):_0x80a0('0x19'));return _0x4c2a08(_0x3abc5f[_0x80a0('0x14')][_0x80a0('0x15')]?_0x3abc5f[_0x80a0('0x14')][0x0]:null);})[_0x80a0('0xe')](function(_0x3204fa){logger[_0x80a0('0xa')](_0x80a0('0x27'),_0x3204fa?util[_0x80a0('0x8')](_0x3204fa,{'showHidden':![],'depth':null}):'');return _0x4c2a08(null);});}return _0x4c2a08(null);});};exports[_0x80a0('0x28')]=function(_0x23aa90,_0x55f0be){return moment(_0x23aa90)[_0x80a0('0x29')](_0x55f0be,'seconds')[_0x80a0('0x2a')](_0x80a0('0x2b'));};exports[_0x80a0('0x2c')]=function(_0x2aee42,_0x3614bf){return moment(_0x2aee42)[_0x80a0('0x2d')](_0x3614bf,'seconds')[_0x80a0('0x2a')](_0x80a0('0x2b'));};exports['diffTime']=function(_0x4a0d89,_0x3dde0f){return moment(_0x4a0d89)[_0x80a0('0x2e')](moment(_0x3dde0f),_0x80a0('0x2f'));};exports[_0x80a0('0x30')]=function(_0x29f8b0,_0x4ca388){return parseInt(_0x29f8b0,0xa)+parseInt(_0x4ca388,0xa);};exports[_0x80a0('0x31')]=function(){return moment()[_0x80a0('0x2a')](_0x80a0('0x2b'));};exports[_0x80a0('0x32')]=function(_0x2a088e,_0x2893bd){if(_0x2893bd){return moment(_0x2a088e)[_0x80a0('0x32')](_0x2893bd);}return!![];};exports[_0x80a0('0x33')]=function(_0x268270,_0x1cc488){if(_0x1cc488){return moment(_0x268270)[_0x80a0('0x33')](_0x1cc488);}else if(_0x268270){return!![];}return![];}; \ No newline at end of file